diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 3343b5b..7135f30 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -1,9 +1,13 @@ -name: Build +name: Build and Sync Frontend on: pull_request: paths: - - 'frontend/**' + - "frontend/**" + +# Give the GITHUB_TOKEN permission to write back to the repo +permissions: + contents: write jobs: build: @@ -11,21 +15,29 @@ jobs: steps: - name: Checkout uses: actions/checkout@v6 + with: + # Crucial: Checkout the branch, not a detached head + ref: ${{ github.head_ref }} - name: Setup Node.js uses: actions/setup-node@v6 with: node-version: 24 - cache: 'npm' + cache: "npm" cache-dependency-path: frontend/compas_threejs/package-lock.json - name: Install dependencies working-directory: frontend/compas_threejs run: npm ci - + - name: Build frontend assets working-directory: frontend/compas_threejs run: npm run build - - name: Ensure frontend build assets are up-to-date - run: git diff --exit-code -- src/compas_threejs/viewer + # Instead of failing on diff, this commits the new files automatically + - name: Auto-commit build assets + uses: stefanzweifel/git-auto-commit-action@v7 + with: + commit_message: "chore: automated build of frontend assets" + # Only track changes in your viewer folder + file_pattern: "src/compas_threejs/viewer/**" diff --git a/examples/mesh_shading.py b/examples/mesh_shading.py new file mode 100644 index 0000000..4807e7c --- /dev/null +++ b/examples/mesh_shading.py @@ -0,0 +1,49 @@ +from compas.colors import Color +from compas.geometry import Box, Sphere + +from compas_threejs.materials import Material +from compas_threejs.text import TextGeometry +from compas_threejs.ui import Slider +from compas_threejs.viewer import Viewer + +viz = Viewer() +viz.world_axis = False +viz.picker = True +viz.default_lighting = True + + +U = 3 +V = 3 +sphere = Sphere(4) +mesh = sphere.to_mesh(False, U, V) +viz.add_geometry(mesh) + + +def update_u(value): + global mesh + global U + global V + viz.remove_object(mesh) + mesh = sphere.to_mesh(False, value, V) + U = value + viz.add_geometry(mesh) + + +slider = Slider(min=3, max=100, value=3, step=1, label="U", action=update_u) +viz.add_ui_element(slider) + + +def update_v(value): + global mesh + global U + global V + viz.remove_object(mesh) + mesh = sphere.to_mesh(False, U, value) + V = value + viz.update_geometry(mesh) + + +slider = Slider(min=3, max=100, value=3, step=1, label="V", action=update_v) +viz.add_ui_element(slider) + +viz.start() diff --git a/frontend/compas_threejs/src/protobuff/datastructures/mesh.ts b/frontend/compas_threejs/src/protobuff/datastructures/mesh.ts index 9e6bac3..09dc48c 100644 --- a/frontend/compas_threejs/src/protobuff/datastructures/mesh.ts +++ b/frontend/compas_threejs/src/protobuff/datastructures/mesh.ts @@ -2,6 +2,7 @@ import { MeshData } from "../generated/compas_pb/data/datastructures"; import { Point } from "../geometry/point"; import { MeshFaceList } from "./facelist"; import * as THREE from "three"; +import * as BufferGeometryUtils from "three/examples/jsm/utils/BufferGeometryUtils.js"; export class Mesh { public readonly data: MeshData; @@ -62,7 +63,7 @@ export class Mesh { } buildGeometry() { - const geometry = new THREE.BufferGeometry(); + let geometry = new THREE.BufferGeometry(); // Convert vertices to a flat array of positions const vertices = new Float32Array(this.vertices.length * 3); @@ -84,8 +85,8 @@ export class Mesh { geometry.setIndex(indices); geometry.setAttribute("position", new THREE.BufferAttribute(vertices, 3)); - // Compute normals for shading - geometry.computeVertexNormals(); + const creaseAngle = THREE.MathUtils.degToRad(30); + geometry = BufferGeometryUtils.toCreasedNormals(geometry, creaseAngle); // Create a basic material const material = new THREE.MeshStandardMaterial({ diff --git a/src/compas_threejs/viewer/frontend/assets/index-DpqKscTv.js b/src/compas_threejs/viewer/frontend/assets/index-CMiGoZZk.js similarity index 79% rename from src/compas_threejs/viewer/frontend/assets/index-DpqKscTv.js rename to src/compas_threejs/viewer/frontend/assets/index-CMiGoZZk.js index 558680c..4ed0218 100644 --- a/src/compas_threejs/viewer/frontend/assets/index-DpqKscTv.js +++ b/src/compas_threejs/viewer/frontend/assets/index-CMiGoZZk.js @@ -1,8 +1,8 @@ -(function(){const t=document.createElement("link").relList;if(t&&t.supports&&t.supports("modulepreload"))return;for(const r of document.querySelectorAll('link[rel="modulepreload"]'))i(r);new MutationObserver(r=>{for(const s of r)if(s.type==="childList")for(const o of s.addedNodes)o.tagName==="LINK"&&o.rel==="modulepreload"&&i(o)}).observe(document,{childList:!0,subtree:!0});function n(r){const s={};return r.integrity&&(s.integrity=r.integrity),r.referrerPolicy&&(s.referrerPolicy=r.referrerPolicy),r.crossOrigin==="use-credentials"?s.credentials="include":r.crossOrigin==="anonymous"?s.credentials="omit":s.credentials="same-origin",s}function i(r){if(r.ep)return;r.ep=!0;const s=n(r);fetch(r.href,s)}})();function ch(e){const t=Object.create(null);for(const n of e.split(","))t[n]=1;return n=>n in t}const Ie={},Es=[],_i=()=>{},Km=()=>!1,Sl=e=>e.charCodeAt(0)===111&&e.charCodeAt(1)===110&&(e.charCodeAt(2)>122||e.charCodeAt(2)<97),uh=e=>e.startsWith("onUpdate:"),on=Object.assign,hh=(e,t)=>{const n=e.indexOf(t);n>-1&&e.splice(n,1)},G_=Object.prototype.hasOwnProperty,ve=(e,t)=>G_.call(e,t),Kt=Array.isArray,Ts=e=>Yo(e)==="[object Map]",Qm=e=>Yo(e)==="[object Set]",Wf=e=>Yo(e)==="[object Date]",jt=e=>typeof e=="function",We=e=>typeof e=="string",ti=e=>typeof e=="symbol",xe=e=>e!==null&&typeof e=="object",jm=e=>(xe(e)||jt(e))&&jt(e.then)&&jt(e.catch),tg=Object.prototype.toString,Yo=e=>tg.call(e),W_=e=>Yo(e).slice(8,-1),eg=e=>Yo(e)==="[object Object]",bl=e=>We(e)&&e!=="NaN"&&e[0]!=="-"&&""+parseInt(e,10)===e,bo=ch(",key,ref,ref_for,ref_key,onVnodeBeforeMount,onVnodeMounted,onVnodeBeforeUpdate,onVnodeUpdated,onVnodeBeforeUnmount,onVnodeUnmounted"),Ml=e=>{const t=Object.create(null);return(n=>t[n]||(t[n]=e(n)))},X_=/-\w/g,Rn=Ml(e=>e.replace(X_,t=>t.slice(1).toUpperCase())),q_=/\B([A-Z])/g,Kr=Ml(e=>e.replace(q_,"-$1").toLowerCase()),wl=Ml(e=>e.charAt(0).toUpperCase()+e.slice(1)),Xa=Ml(e=>e?`on${wl(e)}`:""),_r=(e,t)=>!Object.is(e,t),Hl=(e,...t)=>{for(let n=0;n{Object.defineProperty(e,t,{configurable:!0,enumerable:!1,writable:i,value:n})},Y_=e=>{const t=parseFloat(e);return isNaN(t)?e:t};let Xf;const El=()=>Xf||(Xf=typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:typeof global<"u"?global:{});function qs(e){if(Kt(e)){const t={};for(let n=0;n{if(n){const i=n.split($_);i.length>1&&(t[i[0].trim()]=i[1].trim())}}),t}function Us(e){let t="";if(We(e))t=e;else if(Kt(e))for(let n=0;n!!(e&&e.__v_isRef===!0),Br=e=>We(e)?e:e==null?"":Kt(e)||xe(e)&&(e.toString===tg||!jt(e.toString))?rg(e)?Br(e.value):JSON.stringify(e,sg,2):String(e),sg=(e,t)=>rg(t)?sg(e,t.value):Ts(t)?{[`Map(${t.size})`]:[...t.entries()].reduce((n,[i,r],s)=>(n[Gl(i,s)+" =>"]=r,n),{})}:Qm(t)?{[`Set(${t.size})`]:[...t.values()].map(n=>Gl(n))}:ti(t)?Gl(t):xe(t)&&!Kt(t)&&!eg(t)?String(t):t,Gl=(e,t="")=>{var n;return ti(e)?`Symbol(${(n=e.description)!=null?n:t})`:e};let An;class ev{constructor(t=!1){this.detached=t,this._active=!0,this._on=0,this.effects=[],this.cleanups=[],this._isPaused=!1,this.__v_skip=!0,this.parent=An,!t&&An&&(this.index=(An.scopes||(An.scopes=[])).push(this)-1)}get active(){return this._active}pause(){if(this._active){this._isPaused=!0;let t,n;if(this.scopes)for(t=0,n=this.scopes.length;t0&&--this._on===0&&(An=this.prevScope,this.prevScope=void 0)}stop(t){if(this._active){this._active=!1;let n,i;for(n=0,i=this.effects.length;n0)return;if(wo){let t=wo;for(wo=void 0;t;){const n=t.next;t.next=void 0,t.flags&=-9,t=n}}let e;for(;Mo;){let t=Mo;for(Mo=void 0;t;){const n=t.next;if(t.next=void 0,t.flags&=-9,t.flags&1)try{t.trigger()}catch(i){e||(e=i)}t=n}}if(e)throw e}function cg(e){for(let t=e.deps;t;t=t.nextDep)t.version=-1,t.prevActiveLink=t.dep.activeLink,t.dep.activeLink=t}function ug(e){let t,n=e.depsTail,i=n;for(;i;){const r=i.prevDep;i.version===-1?(i===n&&(n=r),mh(i),iv(i)):t=i,i.dep.activeLink=i.prevActiveLink,i.prevActiveLink=void 0,i=r}e.deps=t,e.depsTail=n}function qc(e){for(let t=e.deps;t;t=t.nextDep)if(t.dep.version!==t.version||t.dep.computed&&(hg(t.dep.computed)||t.dep.version!==t.version))return!0;return!!e._dirty}function hg(e){if(e.flags&4&&!(e.flags&16)||(e.flags&=-17,e.globalVersion===Lo)||(e.globalVersion=Lo,!e.isSSR&&e.flags&128&&(!e.deps&&!e._dirty||!qc(e))))return;e.flags|=2;const t=e.dep,n=De,i=jn;De=e,jn=!0;try{cg(e);const r=e.fn(e._value);(t.version===0||_r(r,e._value))&&(e.flags|=128,e._value=r,t.version++)}catch(r){throw t.version++,r}finally{De=n,jn=i,ug(e),e.flags&=-3}}function mh(e,t=!1){const{dep:n,prevSub:i,nextSub:r}=e;if(i&&(i.nextSub=r,e.prevSub=void 0),r&&(r.prevSub=i,e.nextSub=void 0),n.subs===e&&(n.subs=i,!i&&n.computed)){n.computed.flags&=-5;for(let s=n.computed.deps;s;s=s.nextDep)mh(s,!0)}!t&&!--n.sc&&n.map&&n.map.delete(n.key)}function iv(e){const{prevDep:t,nextDep:n}=e;t&&(t.nextDep=n,e.prevDep=void 0),n&&(n.prevDep=t,e.nextDep=void 0)}let jn=!0;const fg=[];function Gi(){fg.push(jn),jn=!1}function Wi(){const e=fg.pop();jn=e===void 0?!0:e}function qf(e){const{cleanup:t}=e;if(e.cleanup=void 0,t){const n=De;De=void 0;try{t()}finally{De=n}}}let Lo=0;class rv{constructor(t,n){this.sub=t,this.dep=n,this.version=n.version,this.nextDep=this.prevDep=this.nextSub=this.prevSub=this.prevActiveLink=void 0}}class gh{constructor(t){this.computed=t,this.version=0,this.activeLink=void 0,this.subs=void 0,this.map=void 0,this.key=void 0,this.sc=0,this.__v_skip=!0}track(t){if(!De||!jn||De===this.computed)return;let n=this.activeLink;if(n===void 0||n.sub!==De)n=this.activeLink=new rv(De,this),De.deps?(n.prevDep=De.depsTail,De.depsTail.nextDep=n,De.depsTail=n):De.deps=De.depsTail=n,dg(n);else if(n.version===-1&&(n.version=this.version,n.nextDep)){const i=n.nextDep;i.prevDep=n.prevDep,n.prevDep&&(n.prevDep.nextDep=i),n.prevDep=De.depsTail,n.nextDep=void 0,De.depsTail.nextDep=n,De.depsTail=n,De.deps===n&&(De.deps=i)}return n}trigger(t){this.version++,Lo++,this.notify(t)}notify(t){dh();try{for(let n=this.subs;n;n=n.prevSub)n.sub.notify()&&n.sub.dep.notify()}finally{ph()}}}function dg(e){if(e.dep.sc++,e.sub.flags&4){const t=e.dep.computed;if(t&&!e.dep.subs){t.flags|=20;for(let i=t.deps;i;i=i.nextDep)dg(i)}const n=e.dep.subs;n!==e&&(e.prevSub=n,n&&(n.nextSub=e)),e.dep.subs=e}}const rl=new WeakMap,Gr=Symbol(""),Yc=Symbol(""),No=Symbol("");function un(e,t,n){if(jn&&De){let i=rl.get(e);i||rl.set(e,i=new Map);let r=i.get(n);r||(i.set(n,r=new gh),r.map=i,r.key=n),r.track()}}function Bi(e,t,n,i,r,s){const o=rl.get(e);if(!o){Lo++;return}const a=l=>{l&&l.trigger()};if(dh(),t==="clear")o.forEach(a);else{const l=Kt(e),c=l&&bl(n);if(l&&n==="length"){const u=Number(i);o.forEach((h,f)=>{(f==="length"||f===No||!ti(f)&&f>=u)&&a(h)})}else switch((n!==void 0||o.has(void 0))&&a(o.get(n)),c&&a(o.get(No)),t){case"add":l?c&&a(o.get("length")):(a(o.get(Gr)),Ts(e)&&a(o.get(Yc)));break;case"delete":l||(a(o.get(Gr)),Ts(e)&&a(o.get(Yc)));break;case"set":Ts(e)&&a(o.get(Gr));break}}ph()}function sv(e,t){const n=rl.get(e);return n&&n.get(t)}function is(e){const t=_e(e);return t===e?t:(un(t,"iterate",No),Vn(e)?t:t.map(ei))}function Tl(e){return un(e=_e(e),"iterate",No),e}function sr(e,t){return qi(e)?Os(Wr(e)?ei(t):t):ei(t)}const ov={__proto__:null,[Symbol.iterator](){return Xl(this,Symbol.iterator,e=>sr(this,e))},concat(...e){return is(this).concat(...e.map(t=>Kt(t)?is(t):t))},entries(){return Xl(this,"entries",e=>(e[1]=sr(this,e[1]),e))},every(e,t){return Ai(this,"every",e,t,void 0,arguments)},filter(e,t){return Ai(this,"filter",e,t,n=>n.map(i=>sr(this,i)),arguments)},find(e,t){return Ai(this,"find",e,t,n=>sr(this,n),arguments)},findIndex(e,t){return Ai(this,"findIndex",e,t,void 0,arguments)},findLast(e,t){return Ai(this,"findLast",e,t,n=>sr(this,n),arguments)},findLastIndex(e,t){return Ai(this,"findLastIndex",e,t,void 0,arguments)},forEach(e,t){return Ai(this,"forEach",e,t,void 0,arguments)},includes(...e){return ql(this,"includes",e)},indexOf(...e){return ql(this,"indexOf",e)},join(e){return is(this).join(e)},lastIndexOf(...e){return ql(this,"lastIndexOf",e)},map(e,t){return Ai(this,"map",e,t,void 0,arguments)},pop(){return eo(this,"pop")},push(...e){return eo(this,"push",e)},reduce(e,...t){return Yf(this,"reduce",e,t)},reduceRight(e,...t){return Yf(this,"reduceRight",e,t)},shift(){return eo(this,"shift")},some(e,t){return Ai(this,"some",e,t,void 0,arguments)},splice(...e){return eo(this,"splice",e)},toReversed(){return is(this).toReversed()},toSorted(e){return is(this).toSorted(e)},toSpliced(...e){return is(this).toSpliced(...e)},unshift(...e){return eo(this,"unshift",e)},values(){return Xl(this,"values",e=>sr(this,e))}};function Xl(e,t,n){const i=Tl(e),r=i[t]();return i!==e&&!Vn(e)&&(r._next=r.next,r.next=()=>{const s=r._next();return s.done||(s.value=n(s.value)),s}),r}const av=Array.prototype;function Ai(e,t,n,i,r,s){const o=Tl(e),a=o!==e&&!Vn(e),l=o[t];if(l!==av[t]){const h=l.apply(e,s);return a?ei(h):h}let c=n;o!==e&&(a?c=function(h,f){return n.call(this,sr(e,h),f,e)}:n.length>2&&(c=function(h,f){return n.call(this,h,f,e)}));const u=l.call(o,c,i);return a&&r?r(u):u}function Yf(e,t,n,i){const r=Tl(e);let s=n;return r!==e&&(Vn(e)?n.length>3&&(s=function(o,a,l){return n.call(this,o,a,l,e)}):s=function(o,a,l){return n.call(this,o,sr(e,a),l,e)}),r[t](s,...i)}function ql(e,t,n){const i=_e(e);un(i,"iterate",No);const r=i[t](...n);return(r===-1||r===!1)&&Al(n[0])?(n[0]=_e(n[0]),i[t](...n)):r}function eo(e,t,n=[]){Gi(),dh();const i=_e(e)[t].apply(e,n);return ph(),Wi(),i}const lv=ch("__proto__,__v_isRef,__isVue"),pg=new Set(Object.getOwnPropertyNames(Symbol).filter(e=>e!=="arguments"&&e!=="caller").map(e=>Symbol[e]).filter(ti));function cv(e){ti(e)||(e=String(e));const t=_e(this);return un(t,"has",e),t.hasOwnProperty(e)}class mg{constructor(t=!1,n=!1){this._isReadonly=t,this._isShallow=n}get(t,n,i){if(n==="__v_skip")return t.__v_skip;const r=this._isReadonly,s=this._isShallow;if(n==="__v_isReactive")return!r;if(n==="__v_isReadonly")return r;if(n==="__v_isShallow")return s;if(n==="__v_raw")return i===(r?s?xv:xg:s?vg:_g).get(t)||Object.getPrototypeOf(t)===Object.getPrototypeOf(i)?t:void 0;const o=Kt(t);if(!r){let l;if(o&&(l=ov[n]))return l;if(n==="hasOwnProperty")return cv}const a=Reflect.get(t,n,Ve(t)?t:i);if((ti(n)?pg.has(n):lv(n))||(r||un(t,"get",n),s))return a;if(Ve(a)){const l=o&&bl(n)?a:a.value;return r&&xe(l)?$c(l):l}return xe(a)?r?$c(a):Xi(a):a}}class gg extends mg{constructor(t=!1){super(!1,t)}set(t,n,i,r){let s=t[n];const o=Kt(t)&&bl(n);if(!this._isShallow){const c=qi(s);if(!Vn(i)&&!qi(i)&&(s=_e(s),i=_e(i)),!o&&Ve(s)&&!Ve(i))return c||(s.value=i),!0}const a=o?Number(n)e,oa=e=>Reflect.getPrototypeOf(e);function pv(e,t,n){return function(...i){const r=this.__v_raw,s=_e(r),o=Ts(s),a=e==="entries"||e===Symbol.iterator&&o,l=e==="keys"&&o,c=r[e](...i),u=n?Jc:t?Os:ei;return!t&&un(s,"iterate",l?Yc:Gr),on(Object.create(c),{next(){const{value:h,done:f}=c.next();return f?{value:h,done:f}:{value:a?[u(h[0]),u(h[1])]:u(h),done:f}}})}}function aa(e){return function(...t){return e==="delete"?!1:e==="clear"?void 0:this}}function mv(e,t){const n={get(r){const s=this.__v_raw,o=_e(s),a=_e(r);e||(_r(r,a)&&un(o,"get",r),un(o,"get",a));const{has:l}=oa(o),c=t?Jc:e?Os:ei;if(l.call(o,r))return c(s.get(r));if(l.call(o,a))return c(s.get(a));s!==o&&s.get(r)},get size(){const r=this.__v_raw;return!e&&un(_e(r),"iterate",Gr),r.size},has(r){const s=this.__v_raw,o=_e(s),a=_e(r);return e||(_r(r,a)&&un(o,"has",r),un(o,"has",a)),r===a?s.has(r):s.has(r)||s.has(a)},forEach(r,s){const o=this,a=o.__v_raw,l=_e(a),c=t?Jc:e?Os:ei;return!e&&un(l,"iterate",Gr),a.forEach((u,h)=>r.call(s,c(u),c(h),o))}};return on(n,e?{add:aa("add"),set:aa("set"),delete:aa("delete"),clear:aa("clear")}:{add(r){!t&&!Vn(r)&&!qi(r)&&(r=_e(r));const s=_e(this);return oa(s).has.call(s,r)||(s.add(r),Bi(s,"add",r,r)),this},set(r,s){!t&&!Vn(s)&&!qi(s)&&(s=_e(s));const o=_e(this),{has:a,get:l}=oa(o);let c=a.call(o,r);c||(r=_e(r),c=a.call(o,r));const u=l.call(o,r);return o.set(r,s),c?_r(s,u)&&Bi(o,"set",r,s):Bi(o,"add",r,s),this},delete(r){const s=_e(this),{has:o,get:a}=oa(s);let l=o.call(s,r);l||(r=_e(r),l=o.call(s,r)),a&&a.call(s,r);const c=s.delete(r);return l&&Bi(s,"delete",r,void 0),c},clear(){const r=_e(this),s=r.size!==0,o=r.clear();return s&&Bi(r,"clear",void 0,void 0),o}}),["keys","values","entries",Symbol.iterator].forEach(r=>{n[r]=pv(r,e,t)}),n}function _h(e,t){const n=mv(e,t);return(i,r,s)=>r==="__v_isReactive"?!e:r==="__v_isReadonly"?e:r==="__v_raw"?i:Reflect.get(ve(n,r)&&r in i?n:i,r,s)}const gv={get:_h(!1,!1)},_v={get:_h(!1,!0)},vv={get:_h(!0,!1)};const _g=new WeakMap,vg=new WeakMap,xg=new WeakMap,xv=new WeakMap;function yv(e){switch(e){case"Object":case"Array":return 1;case"Map":case"Set":case"WeakMap":case"WeakSet":return 2;default:return 0}}function Sv(e){return e.__v_skip||!Object.isExtensible(e)?0:yv(W_(e))}function Xi(e){return qi(e)?e:vh(e,!1,hv,gv,_g)}function bv(e){return vh(e,!1,dv,_v,vg)}function $c(e){return vh(e,!0,fv,vv,xg)}function vh(e,t,n,i,r){if(!xe(e)||e.__v_raw&&!(t&&e.__v_isReactive))return e;const s=Sv(e);if(s===0)return e;const o=r.get(e);if(o)return o;const a=new Proxy(e,s===2?i:n);return r.set(e,a),a}function Wr(e){return qi(e)?Wr(e.__v_raw):!!(e&&e.__v_isReactive)}function qi(e){return!!(e&&e.__v_isReadonly)}function Vn(e){return!!(e&&e.__v_isShallow)}function Al(e){return e?!!e.__v_raw:!1}function _e(e){const t=e&&e.__v_raw;return t?_e(t):e}function yg(e){return!ve(e,"__v_skip")&&Object.isExtensible(e)&&ng(e,"__v_skip",!0),e}const ei=e=>xe(e)?Xi(e):e,Os=e=>xe(e)?$c(e):e;function Ve(e){return e?e.__v_isRef===!0:!1}function sn(e){return Sg(e,!1)}function Mv(e){return Sg(e,!0)}function Sg(e,t){return Ve(e)?e:new wv(e,t)}class wv{constructor(t,n){this.dep=new gh,this.__v_isRef=!0,this.__v_isShallow=!1,this._rawValue=n?t:_e(t),this._value=n?t:ei(t),this.__v_isShallow=n}get value(){return this.dep.track(),this._value}set value(t){const n=this._rawValue,i=this.__v_isShallow||Vn(t)||qi(t);t=i?t:_e(t),_r(t,n)&&(this._rawValue=t,this._value=i?t:ei(t),this.dep.trigger())}}function vt(e){return Ve(e)?e.value:e}function xh(e){return jt(e)?e():vt(e)}const Ev={get:(e,t,n)=>t==="__v_raw"?e:vt(Reflect.get(e,t,n)),set:(e,t,n,i)=>{const r=e[t];return Ve(r)&&!Ve(n)?(r.value=n,!0):Reflect.set(e,t,n,i)}};function bg(e){return Wr(e)?e:new Proxy(e,Ev)}function Uo(e){const t=Kt(e)?new Array(e.length):{};for(const n in e)t[n]=Mg(e,n);return t}class Tv{constructor(t,n,i){this._object=t,this._key=n,this._defaultValue=i,this.__v_isRef=!0,this._value=void 0,this._raw=_e(t);let r=!0,s=t;if(!Kt(t)||!bl(String(n)))do r=!Al(s)||Vn(s);while(r&&(s=s.__v_raw));this._shallow=r}get value(){let t=this._object[this._key];return this._shallow&&(t=vt(t)),this._value=t===void 0?this._defaultValue:t}set value(t){if(this._shallow&&Ve(this._raw[this._key])){const n=this._object[this._key];if(Ve(n)){n.value=t;return}}this._object[this._key]=t}get dep(){return sv(this._raw,this._key)}}class Av{constructor(t){this._getter=t,this.__v_isRef=!0,this.__v_isReadonly=!0,this._value=void 0}get value(){return this._value=this._getter()}}function Pv(e,t,n){return Ve(e)?e:jt(e)?new Av(e):xe(e)&&arguments.length>1?Mg(e,t,n):sn(e)}function Mg(e,t,n){return new Tv(e,t,n)}class Cv{constructor(t,n,i){this.fn=t,this.setter=n,this._value=void 0,this.dep=new gh(this),this.__v_isRef=!0,this.deps=void 0,this.depsTail=void 0,this.flags=16,this.globalVersion=Lo-1,this.next=void 0,this.effect=this,this.__v_isReadonly=!n,this.isSSR=i}notify(){if(this.flags|=16,!(this.flags&8)&&De!==this)return lg(this,!0),!0}get value(){const t=this.dep.track();return hg(this),t&&(t.version=this.dep.version),this._value}set value(t){this.setter&&this.setter(t)}}function Rv(e,t,n=!1){let i,r;return jt(e)?i=e:(i=e.get,r=e.set),new Cv(i,r,n)}const la={},sl=new WeakMap;let Ur;function Dv(e,t=!1,n=Ur){if(n){let i=sl.get(n);i||sl.set(n,i=[]),i.push(e)}}function Iv(e,t,n=Ie){const{immediate:i,deep:r,once:s,scheduler:o,augmentJob:a,call:l}=n,c=x=>r?x:Vn(x)||r===!1||r===0?lr(x,1):lr(x);let u,h,f,p,g=!1,v=!1;if(Ve(e)?(h=()=>e.value,g=Vn(e)):Wr(e)?(h=()=>c(e),g=!0):Kt(e)?(v=!0,g=e.some(x=>Wr(x)||Vn(x)),h=()=>e.map(x=>{if(Ve(x))return x.value;if(Wr(x))return c(x);if(jt(x))return l?l(x,2):x()})):jt(e)?t?h=l?()=>l(e,2):e:h=()=>{if(f){Gi();try{f()}finally{Wi()}}const x=Ur;Ur=u;try{return l?l(e,3,[p]):e(p)}finally{Ur=x}}:h=_i,t&&r){const x=h,A=r===!0?1/0:r;h=()=>lr(x(),A)}const m=nv(),d=()=>{u.stop(),m&&m.active&&hh(m.effects,u)};if(s&&t){const x=t;t=(...A)=>{x(...A),d()}}let S=v?new Array(e.length).fill(la):la;const y=x=>{if(!(!(u.flags&1)||!u.dirty&&!x))if(t){const A=u.run();if(r||g||(v?A.some((P,C)=>_r(P,S[C])):_r(A,S))){f&&f();const P=Ur;Ur=u;try{const C=[A,S===la?void 0:v&&S[0]===la?[]:S,p];S=A,l?l(t,3,C):t(...C)}finally{Ur=P}}}else u.run()};return a&&a(y),u=new og(h),u.scheduler=o?()=>o(y,!1):y,p=x=>Dv(x,!1,u),f=u.onStop=()=>{const x=sl.get(u);if(x){if(l)l(x,4);else for(const A of x)A();sl.delete(u)}},t?i?y(!0):S=u.run():o?o(y.bind(null,!0),!0):u.run(),d.pause=u.pause.bind(u),d.resume=u.resume.bind(u),d.stop=d,d}function lr(e,t=1/0,n){if(t<=0||!xe(e)||e.__v_skip||(n=n||new Map,(n.get(e)||0)>=t))return e;if(n.set(e,t),t--,Ve(e))lr(e.value,t,n);else if(Kt(e))for(let i=0;i{lr(i,t,n)});else if(eg(e)){for(const i in e)lr(e[i],t,n);for(const i of Object.getOwnPropertySymbols(e))Object.prototype.propertyIsEnumerable.call(e,i)&&lr(e[i],t,n)}return e}function Jo(e,t,n,i){try{return i?e(...i):e()}catch(r){Pl(r,t,n)}}function yi(e,t,n,i){if(jt(e)){const r=Jo(e,t,n,i);return r&&jm(r)&&r.catch(s=>{Pl(s,t,n)}),r}if(Kt(e)){const r=[];for(let s=0;s>>1,r=vn[i],s=Oo(r);s=Oo(n)?vn.push(e):vn.splice(Nv(t),0,e),e.flags|=1,Tg()}}function Tg(){ol||(ol=wg.then(Pg))}function Uv(e){Kt(e)?As.push(...e):or&&e.id===-1?or.splice(xs+1,0,e):e.flags&1||(As.push(e),e.flags|=1),Tg()}function Jf(e,t,n=ui+1){for(;nOo(n)-Oo(i));if(As.length=0,or){or.push(...t);return}for(or=t,xs=0;xse.id==null?e.flags&2?-1:1/0:e.id;function Pg(e){try{for(ui=0;ui{i._d&&ul(-1);const s=al(t);let o;try{o=e(...r)}finally{al(s),i._d&&ul(1)}return o};return i._n=!0,i._c=!0,i._d=!0,i}function Er(e,t,n,i){const r=e.dirs,s=t&&t.dirs;for(let o=0;o1)return n&&jt(t)?t.call(i&&i.proxy):t}}const Ov=Symbol.for("v-scx"),Fv=()=>Ps(Ov);function kv(e,t){return bh(e,null,t)}function Xr(e,t,n){return bh(e,t,n)}function bh(e,t,n=Ie){const{immediate:i,deep:r,flush:s,once:o}=n,a=on({},n),l=t&&i||!t&&s!=="post";let c;if(Bo){if(s==="sync"){const p=Fv();c=p.__watcherHandles||(p.__watcherHandles=[])}else if(!l){const p=()=>{};return p.stop=_i,p.resume=_i,p.pause=_i,p}}const u=hn;a.call=(p,g,v)=>yi(p,u,g,v);let h=!1;s==="post"?a.scheduler=p=>{Tn(p,u&&u.suspense)}:s!=="sync"&&(h=!0,a.scheduler=(p,g)=>{g?p():yh(p)}),a.augmentJob=p=>{t&&(p.flags|=4),h&&(p.flags|=2,u&&(p.id=u.uid,p.i=u))};const f=Iv(e,t,a);return Bo&&(c?c.push(f):l&&f()),f}function Bv(e,t,n){const i=this.proxy,r=We(e)?e.includes(".")?Rg(i,e):()=>i[e]:e.bind(i,i);let s;jt(t)?s=t:(s=t.handler,n=t);const o=Zo(this),a=bh(r,s.bind(i),n);return o(),a}function Rg(e,t){const n=t.split(".");return()=>{let i=e;for(let r=0;re.__isTeleport,Hv=Symbol("_leaveCb");function Mh(e,t){e.shapeFlag&6&&e.component?(e.transition=t,Mh(e.component.subTree,t)):e.shapeFlag&128?(e.ssContent.transition=t.clone(e.ssContent),e.ssFallback.transition=t.clone(e.ssFallback)):e.transition=t}function Ze(e,t){return jt(e)?on({name:e.name},t,{setup:e}):e}function Dg(e){e.ids=[e.ids[0]+e.ids[2]+++"-",0,0]}function $f(e,t){let n;return!!((n=Object.getOwnPropertyDescriptor(e,t))&&!n.configurable)}const ll=new WeakMap;function Eo(e,t,n,i,r=!1){if(Kt(e)){e.forEach((v,m)=>Eo(v,t&&(Kt(t)?t[m]:t),n,i,r));return}if(Cs(i)&&!r){i.shapeFlag&512&&i.type.__asyncResolved&&i.component.subTree.component&&Eo(e,t,n,i.component.subTree);return}const s=i.shapeFlag&4?Ph(i.component):i.el,o=r?null:s,{i:a,r:l}=e,c=t&&t.r,u=a.refs===Ie?a.refs={}:a.refs,h=a.setupState,f=_e(h),p=h===Ie?Km:v=>$f(u,v)?!1:ve(f,v),g=(v,m)=>!(m&&$f(u,m));if(c!=null&&c!==l){if(Zf(t),We(c))u[c]=null,p(c)&&(h[c]=null);else if(Ve(c)){const v=t;g(c,v.k)&&(c.value=null),v.k&&(u[v.k]=null)}}if(jt(l))Jo(l,a,12,[o,u]);else{const v=We(l),m=Ve(l);if(v||m){const d=()=>{if(e.f){const S=v?p(l)?h[l]:u[l]:g()||!e.k?l.value:u[e.k];if(r)Kt(S)&&hh(S,s);else if(Kt(S))S.includes(s)||S.push(s);else if(v)u[l]=[s],p(l)&&(h[l]=u[l]);else{const y=[s];g(l,e.k)&&(l.value=y),e.k&&(u[e.k]=y)}}else v?(u[l]=o,p(l)&&(h[l]=o)):m&&(g(l,e.k)&&(l.value=o),e.k&&(u[e.k]=o))};if(o){const S=()=>{d(),ll.delete(e)};S.id=-1,ll.set(e,S),Tn(S,n)}else Zf(e),d()}}}function Zf(e){const t=ll.get(e);t&&(t.flags|=8,ll.delete(e))}El().requestIdleCallback;El().cancelIdleCallback;const Cs=e=>!!e.type.__asyncLoader,Ig=e=>e.type.__isKeepAlive;function Gv(e,t){Lg(e,"a",t)}function Wv(e,t){Lg(e,"da",t)}function Lg(e,t,n=hn){const i=e.__wdc||(e.__wdc=()=>{let r=n;for(;r;){if(r.isDeactivated)return;r=r.parent}return e()});if(Cl(t,i,n),n){let r=n.parent;for(;r&&r.parent;)Ig(r.parent.vnode)&&Xv(i,t,n,r),r=r.parent}}function Xv(e,t,n,i){const r=Cl(t,e,i,!0);wh(()=>{hh(i[t],r)},n)}function Cl(e,t,n=hn,i=!1){if(n){const r=n[e]||(n[e]=[]),s=t.__weh||(t.__weh=(...o)=>{Gi();const a=Zo(n),l=yi(t,n,e,o);return a(),Wi(),l});return i?r.unshift(s):r.push(s),s}}const Zi=e=>(t,n=hn)=>{(!Bo||e==="sp")&&Cl(e,(...i)=>t(...i),n)},qv=Zi("bm"),$o=Zi("m"),Yv=Zi("bu"),Jv=Zi("u"),$v=Zi("bum"),wh=Zi("um"),Zv=Zi("sp"),Kv=Zi("rtg"),Qv=Zi("rtc");function jv(e,t=hn){Cl("ec",e,t)}const tx="components",Ng=Symbol.for("v-ndc");function ex(e){return We(e)?nx(tx,e,!1)||e:e||Ng}function nx(e,t,n=!0,i=!1){const r=yn||hn;if(r){const s=r.type;{const a=Bx(s,!1);if(a&&(a===t||a===Rn(t)||a===wl(Rn(t))))return s}const o=Kf(r[e]||s[e],t)||Kf(r.appContext[e],t);return!o&&i?s:o}}function Kf(e,t){return e&&(e[t]||e[Rn(t)]||e[wl(Rn(t))])}function Rl(e,t,n,i){let r;const s=n,o=Kt(e);if(o||We(e)){const a=o&&Wr(e);let l=!1,c=!1;a&&(l=!Vn(e),c=qi(e),e=Tl(e)),r=new Array(e.length);for(let u=0,h=e.length;ut(a,l,void 0,s));else{const a=Object.keys(e);r=new Array(a.length);for(let l=0,c=a.length;l0;return ce(),Oe(Je,null,[Ge("slot",n,i)],c?-2:64)}let s=e[t];s&&s._c&&(s._d=!1),ce();const o=s&&Ug(s(n)),a=n.key||o&&o.key,l=Oe(Je,{key:(a&&!ti(a)?a:`_${t}`)+(!o&&i?"_fb":"")},o||[],o&&e._===1?64:-2);return l.scopeId&&(l.slotScopeIds=[l.scopeId+"-s"]),s&&s._c&&(s._d=!0),l}function Ug(e){return e.some(t=>ko(t)?!(t.type===Si||t.type===Je&&!Ug(t.children)):!0)?e:null}const Zc=e=>e?e0(e)?Ph(e):Zc(e.parent):null,To=on(Object.create(null),{$:e=>e,$el:e=>e.vnode.el,$data:e=>e.data,$props:e=>e.props,$attrs:e=>e.attrs,$slots:e=>e.slots,$refs:e=>e.refs,$parent:e=>Zc(e.parent),$root:e=>Zc(e.root),$host:e=>e.ce,$emit:e=>e.emit,$options:e=>Fg(e),$forceUpdate:e=>e.f||(e.f=()=>{yh(e.update)}),$nextTick:e=>e.n||(e.n=Eg.bind(e.proxy)),$watch:e=>Bv.bind(e)}),Yl=(e,t)=>e!==Ie&&!e.__isScriptSetup&&ve(e,t),ix={get({_:e},t){if(t==="__v_skip")return!0;const{ctx:n,setupState:i,data:r,props:s,accessCache:o,type:a,appContext:l}=e;if(t[0]!=="$"){const f=o[t];if(f!==void 0)switch(f){case 1:return i[t];case 2:return r[t];case 4:return n[t];case 3:return s[t]}else{if(Yl(i,t))return o[t]=1,i[t];if(r!==Ie&&ve(r,t))return o[t]=2,r[t];if(ve(s,t))return o[t]=3,s[t];if(n!==Ie&&ve(n,t))return o[t]=4,n[t];Kc&&(o[t]=0)}}const c=To[t];let u,h;if(c)return t==="$attrs"&&un(e.attrs,"get",""),c(e);if((u=a.__cssModules)&&(u=u[t]))return u;if(n!==Ie&&ve(n,t))return o[t]=4,n[t];if(h=l.config.globalProperties,ve(h,t))return h[t]},set({_:e},t,n){const{data:i,setupState:r,ctx:s}=e;return Yl(r,t)?(r[t]=n,!0):i!==Ie&&ve(i,t)?(i[t]=n,!0):ve(e.props,t)||t[0]==="$"&&t.slice(1)in e?!1:(s[t]=n,!0)},has({_:{data:e,setupState:t,accessCache:n,ctx:i,appContext:r,props:s,type:o}},a){let l;return!!(n[a]||e!==Ie&&a[0]!=="$"&&ve(e,a)||Yl(t,a)||ve(s,a)||ve(i,a)||ve(To,a)||ve(r.config.globalProperties,a)||(l=o.__cssModules)&&l[a])},defineProperty(e,t,n){return n.get!=null?e._.accessCache[t]=0:ve(n,"value")&&this.set(e,t,n.value,null),Reflect.defineProperty(e,t,n)}};function Qf(e){return Kt(e)?e.reduce((t,n)=>(t[n]=null,t),{}):e}let Kc=!0;function rx(e){const t=Fg(e),n=e.proxy,i=e.ctx;Kc=!1,t.beforeCreate&&jf(t.beforeCreate,e,"bc");const{data:r,computed:s,methods:o,watch:a,provide:l,inject:c,created:u,beforeMount:h,mounted:f,beforeUpdate:p,updated:g,activated:v,deactivated:m,beforeDestroy:d,beforeUnmount:S,destroyed:y,unmounted:x,render:A,renderTracked:P,renderTriggered:C,errorCaptured:R,serverPrefetch:b,expose:M,inheritAttrs:L,components:V,directives:q,filters:j}=t;if(c&&sx(c,i,null),o)for(const k in o){const H=o[k];jt(H)&&(i[k]=H.bind(n))}if(r){const k=r.call(n,n);xe(k)&&(e.data=Xi(k))}if(Kc=!0,s)for(const k in s){const H=s[k],ct=jt(H)?H.bind(n,n):jt(H.get)?H.get.bind(n,n):_i,pt=!jt(H)&&jt(H.set)?H.set.bind(n):_i,ft=pe({get:ct,set:pt});Object.defineProperty(i,k,{enumerable:!0,configurable:!0,get:()=>ft.value,set:kt=>ft.value=kt})}if(a)for(const k in a)Og(a[k],i,n,k);if(l){const k=jt(l)?l.call(n):l;Reflect.ownKeys(k).forEach(H=>{Sh(H,k[H])})}u&&jf(u,e,"c");function W(k,H){Kt(H)?H.forEach(ct=>k(ct.bind(n))):H&&k(H.bind(n))}if(W(qv,h),W($o,f),W(Yv,p),W(Jv,g),W(Gv,v),W(Wv,m),W(jv,R),W(Qv,P),W(Kv,C),W($v,S),W(wh,x),W(Zv,b),Kt(M))if(M.length){const k=e.exposed||(e.exposed={});M.forEach(H=>{Object.defineProperty(k,H,{get:()=>n[H],set:ct=>n[H]=ct,enumerable:!0})})}else e.exposed||(e.exposed={});A&&e.render===_i&&(e.render=A),L!=null&&(e.inheritAttrs=L),V&&(e.components=V),q&&(e.directives=q),b&&Dg(e)}function sx(e,t,n=_i){Kt(e)&&(e=Qc(e));for(const i in e){const r=e[i];let s;xe(r)?"default"in r?s=Ps(r.from||i,r.default,!0):s=Ps(r.from||i):s=Ps(r),Ve(s)?Object.defineProperty(t,i,{enumerable:!0,configurable:!0,get:()=>s.value,set:o=>s.value=o}):t[i]=s}}function jf(e,t,n){yi(Kt(e)?e.map(i=>i.bind(t.proxy)):e.bind(t.proxy),t,n)}function Og(e,t,n,i){let r=i.includes(".")?Rg(n,i):()=>n[i];if(We(e)){const s=t[e];jt(s)&&Xr(r,s)}else if(jt(e))Xr(r,e.bind(n));else if(xe(e))if(Kt(e))e.forEach(s=>Og(s,t,n,i));else{const s=jt(e.handler)?e.handler.bind(n):t[e.handler];jt(s)&&Xr(r,s,e)}}function Fg(e){const t=e.type,{mixins:n,extends:i}=t,{mixins:r,optionsCache:s,config:{optionMergeStrategies:o}}=e.appContext,a=s.get(t);let l;return a?l=a:!r.length&&!n&&!i?l=t:(l={},r.length&&r.forEach(c=>cl(l,c,o,!0)),cl(l,t,o)),xe(t)&&s.set(t,l),l}function cl(e,t,n,i=!1){const{mixins:r,extends:s}=t;s&&cl(e,s,n,!0),r&&r.forEach(o=>cl(e,o,n,!0));for(const o in t)if(!(i&&o==="expose")){const a=ox[o]||n&&n[o];e[o]=a?a(e[o],t[o]):t[o]}return e}const ox={data:td,props:ed,emits:ed,methods:po,computed:po,beforeCreate:mn,created:mn,beforeMount:mn,mounted:mn,beforeUpdate:mn,updated:mn,beforeDestroy:mn,beforeUnmount:mn,destroyed:mn,unmounted:mn,activated:mn,deactivated:mn,errorCaptured:mn,serverPrefetch:mn,components:po,directives:po,watch:lx,provide:td,inject:ax};function td(e,t){return t?e?function(){return on(jt(e)?e.call(this,this):e,jt(t)?t.call(this,this):t)}:t:e}function ax(e,t){return po(Qc(e),Qc(t))}function Qc(e){if(Kt(e)){const t={};for(let n=0;nt==="modelValue"||t==="model-value"?e.modelModifiers:e[`${t}Modifiers`]||e[`${Rn(t)}Modifiers`]||e[`${Kr(t)}Modifiers`];function fx(e,t,...n){if(e.isUnmounted)return;const i=e.vnode.props||Ie;let r=n;const s=t.startsWith("update:"),o=s&&hx(i,t.slice(7));o&&(o.trim&&(r=n.map(u=>We(u)?u.trim():u)),o.number&&(r=n.map(Y_)));let a,l=i[a=Xa(t)]||i[a=Xa(Rn(t))];!l&&s&&(l=i[a=Xa(Kr(t))]),l&&yi(l,e,6,r);const c=i[a+"Once"];if(c){if(!e.emitted)e.emitted={};else if(e.emitted[a])return;e.emitted[a]=!0,yi(c,e,6,r)}}const dx=new WeakMap;function Bg(e,t,n=!1){const i=n?dx:t.emitsCache,r=i.get(e);if(r!==void 0)return r;const s=e.emits;let o={},a=!1;if(!jt(e)){const l=c=>{const u=Bg(c,t,!0);u&&(a=!0,on(o,u))};!n&&t.mixins.length&&t.mixins.forEach(l),e.extends&&l(e.extends),e.mixins&&e.mixins.forEach(l)}return!s&&!a?(xe(e)&&i.set(e,null),null):(Kt(s)?s.forEach(l=>o[l]=null):on(o,s),xe(e)&&i.set(e,o),o)}function Dl(e,t){return!e||!Sl(t)?!1:(t=t.slice(2).replace(/Once$/,""),ve(e,t[0].toLowerCase()+t.slice(1))||ve(e,Kr(t))||ve(e,t))}function nd(e){const{type:t,vnode:n,proxy:i,withProxy:r,propsOptions:[s],slots:o,attrs:a,emit:l,render:c,renderCache:u,props:h,data:f,setupState:p,ctx:g,inheritAttrs:v}=e,m=al(e);let d,S;try{if(n.shapeFlag&4){const x=r||i,A=x;d=fi(c.call(A,x,u,h,p,f,g)),S=a}else{const x=t;d=fi(x.length>1?x(h,{attrs:a,slots:o,emit:l}):x(h,null)),S=t.props?a:px(a)}}catch(x){Ao.length=0,Pl(x,e,1),d=Ge(Si)}let y=d;if(S&&v!==!1){const x=Object.keys(S),{shapeFlag:A}=y;x.length&&A&7&&(s&&x.some(uh)&&(S=mx(S,s)),y=Jr(y,S,!1,!0))}return n.dirs&&(y=Jr(y,null,!1,!0),y.dirs=y.dirs?y.dirs.concat(n.dirs):n.dirs),n.transition&&Mh(y,n.transition),d=y,al(m),d}const px=e=>{let t;for(const n in e)(n==="class"||n==="style"||Sl(n))&&((t||(t={}))[n]=e[n]);return t},mx=(e,t)=>{const n={};for(const i in e)(!uh(i)||!(i.slice(9)in t))&&(n[i]=e[i]);return n};function gx(e,t,n){const{props:i,children:r,component:s}=e,{props:o,children:a,patchFlag:l}=t,c=s.emitsOptions;if(t.dirs||t.transition)return!0;if(n&&l>=0){if(l&1024)return!0;if(l&16)return i?id(i,o,c):!!o;if(l&8){const u=t.dynamicProps;for(let h=0;hObject.create(Vg),Gg=e=>Object.getPrototypeOf(e)===Vg;function vx(e,t,n,i=!1){const r={},s=Hg();e.propsDefaults=Object.create(null),Wg(e,t,r,s);for(const o in e.propsOptions[0])o in r||(r[o]=void 0);n?e.props=i?r:bv(r):e.type.props?e.props=r:e.props=s,e.attrs=s}function xx(e,t,n,i){const{props:r,attrs:s,vnode:{patchFlag:o}}=e,a=_e(r),[l]=e.propsOptions;let c=!1;if((i||o>0)&&!(o&16)){if(o&8){const u=e.vnode.dynamicProps;for(let h=0;h{l=!0;const[f,p]=Xg(h,t,!0);on(o,f),p&&a.push(...p)};!n&&t.mixins.length&&t.mixins.forEach(u),e.extends&&u(e.extends),e.mixins&&e.mixins.forEach(u)}if(!s&&!l)return xe(e)&&i.set(e,Es),Es;if(Kt(s))for(let u=0;ue==="_"||e==="_ctx"||e==="$stable",Th=e=>Kt(e)?e.map(fi):[fi(e)],Sx=(e,t,n)=>{if(t._n)return t;const i=$e((...r)=>Th(t(...r)),n);return i._c=!1,i},qg=(e,t,n)=>{const i=e._ctx;for(const r in e){if(Eh(r))continue;const s=e[r];if(jt(s))t[r]=Sx(r,s,i);else if(s!=null){const o=Th(s);t[r]=()=>o}}},Yg=(e,t)=>{const n=Th(t);e.slots.default=()=>n},Jg=(e,t,n)=>{for(const i in t)(n||!Eh(i))&&(e[i]=t[i])},bx=(e,t,n)=>{const i=e.slots=Hg();if(e.vnode.shapeFlag&32){const r=t._;r?(Jg(i,t,n),n&&ng(i,"_",r,!0)):qg(t,i)}else t&&Yg(e,t)},Mx=(e,t,n)=>{const{vnode:i,slots:r}=e;let s=!0,o=Ie;if(i.shapeFlag&32){const a=t._;a?n&&a===1?s=!1:Jg(r,t,n):(s=!t.$stable,qg(t,r)),o=t}else t&&(Yg(e,t),o={default:1});if(s)for(const a in r)!Eh(a)&&o[a]==null&&delete r[a]},Tn=Px;function wx(e){return Ex(e)}function Ex(e,t){const n=El();n.__VUE__=!0;const{insert:i,remove:r,patchProp:s,createElement:o,createText:a,createComment:l,setText:c,setElementText:u,parentNode:h,nextSibling:f,setScopeId:p=_i,insertStaticContent:g}=e,v=(I,O,U,z=null,F=null,X=null,E=void 0,rt=null,K=!!O.dynamicChildren)=>{if(I===O)return;I&&!no(I,O)&&(z=ot(I),kt(I,F,X,!0),I=null),O.patchFlag===-2&&(K=!1,O.dynamicChildren=null);const{type:Q,ref:it,shapeFlag:w}=O;switch(Q){case Il:m(I,O,U,z);break;case Si:d(I,O,U,z);break;case $l:I==null&&S(O,U,z,E);break;case Je:V(I,O,U,z,F,X,E,rt,K);break;default:w&1?A(I,O,U,z,F,X,E,rt,K):w&6?q(I,O,U,z,F,X,E,rt,K):(w&64||w&128)&&Q.process(I,O,U,z,F,X,E,rt,K,Mt)}it!=null&&F?Eo(it,I&&I.ref,X,O||I,!O):it==null&&I&&I.ref!=null&&Eo(I.ref,null,X,I,!0)},m=(I,O,U,z)=>{if(I==null)i(O.el=a(O.children),U,z);else{const F=O.el=I.el;O.children!==I.children&&c(F,O.children)}},d=(I,O,U,z)=>{I==null?i(O.el=l(O.children||""),U,z):O.el=I.el},S=(I,O,U,z)=>{[I.el,I.anchor]=g(I.children,O,U,z,I.el,I.anchor)},y=({el:I,anchor:O},U,z)=>{let F;for(;I&&I!==O;)F=f(I),i(I,U,z),I=F;i(O,U,z)},x=({el:I,anchor:O})=>{let U;for(;I&&I!==O;)U=f(I),r(I),I=U;r(O)},A=(I,O,U,z,F,X,E,rt,K)=>{if(O.type==="svg"?E="svg":O.type==="math"&&(E="mathml"),I==null)P(O,U,z,F,X,E,rt,K);else{const Q=I.el&&I.el._isVueCE?I.el:null;try{Q&&Q._beginPatch(),b(I,O,F,X,E,rt,K)}finally{Q&&Q._endPatch()}}},P=(I,O,U,z,F,X,E,rt)=>{let K,Q;const{props:it,shapeFlag:w,transition:_,dirs:N}=I;if(K=I.el=o(I.type,X,it&&it.is,it),w&8?u(K,I.children):w&16&&R(I.children,K,null,z,F,Jl(I,X),E,rt),N&&Er(I,null,z,"created"),C(K,I,I.scopeId,E,z),it){for(const nt in it)nt!=="value"&&!bo(nt)&&s(K,nt,null,it[nt],X,z);"value"in it&&s(K,"value",null,it.value,X),(Q=it.onVnodeBeforeMount)&&ai(Q,z,I)}N&&Er(I,null,z,"beforeMount");const Y=Tx(F,_);Y&&_.beforeEnter(K),i(K,O,U),((Q=it&&it.onVnodeMounted)||Y||N)&&Tn(()=>{Q&&ai(Q,z,I),Y&&_.enter(K),N&&Er(I,null,z,"mounted")},F)},C=(I,O,U,z,F)=>{if(U&&p(I,U),z)for(let X=0;X{for(let Q=K;Q{const rt=O.el=I.el;let{patchFlag:K,dynamicChildren:Q,dirs:it}=O;K|=I.patchFlag&16;const w=I.props||Ie,_=O.props||Ie;let N;if(U&&Tr(U,!1),(N=_.onVnodeBeforeUpdate)&&ai(N,U,O,I),it&&Er(O,I,U,"beforeUpdate"),U&&Tr(U,!0),(w.innerHTML&&_.innerHTML==null||w.textContent&&_.textContent==null)&&u(rt,""),Q?M(I.dynamicChildren,Q,rt,U,z,Jl(O,F),X):E||H(I,O,rt,null,U,z,Jl(O,F),X,!1),K>0){if(K&16)L(rt,w,_,U,F);else if(K&2&&w.class!==_.class&&s(rt,"class",null,_.class,F),K&4&&s(rt,"style",w.style,_.style,F),K&8){const Y=O.dynamicProps;for(let nt=0;nt{N&&ai(N,U,O,I),it&&Er(O,I,U,"updated")},z)},M=(I,O,U,z,F,X,E)=>{for(let rt=0;rt{if(O!==U){if(O!==Ie)for(const X in O)!bo(X)&&!(X in U)&&s(I,X,O[X],null,F,z);for(const X in U){if(bo(X))continue;const E=U[X],rt=O[X];E!==rt&&X!=="value"&&s(I,X,rt,E,F,z)}"value"in U&&s(I,"value",O.value,U.value,F)}},V=(I,O,U,z,F,X,E,rt,K)=>{const Q=O.el=I?I.el:a(""),it=O.anchor=I?I.anchor:a("");let{patchFlag:w,dynamicChildren:_,slotScopeIds:N}=O;N&&(rt=rt?rt.concat(N):N),I==null?(i(Q,U,z),i(it,U,z),R(O.children||[],U,it,F,X,E,rt,K)):w>0&&w&64&&_&&I.dynamicChildren&&I.dynamicChildren.length===_.length?(M(I.dynamicChildren,_,U,F,X,E,rt),(O.key!=null||F&&O===F.subTree)&&$g(I,O,!0)):H(I,O,U,it,F,X,E,rt,K)},q=(I,O,U,z,F,X,E,rt,K)=>{O.slotScopeIds=rt,I==null?O.shapeFlag&512?F.ctx.activate(O,U,z,E,K):j(O,U,z,F,X,E,K):J(I,O,K)},j=(I,O,U,z,F,X,E)=>{const rt=I.component=Nx(I,z,F);if(Ig(I)&&(rt.ctx.renderer=Mt),Ux(rt,!1,E),rt.asyncDep){if(F&&F.registerDep(rt,W,E),!I.el){const K=rt.subTree=Ge(Si);d(null,K,O,U),I.placeholder=K.el}}else W(rt,I,O,U,F,X,E)},J=(I,O,U)=>{const z=O.component=I.component;if(gx(I,O,U))if(z.asyncDep&&!z.asyncResolved){k(z,O,U);return}else z.next=O,z.update();else O.el=I.el,z.vnode=O},W=(I,O,U,z,F,X,E)=>{const rt=()=>{if(I.isMounted){let{next:w,bu:_,u:N,parent:Y,vnode:nt}=I;{const zt=Zg(I);if(zt){w&&(w.el=nt.el,k(I,w,E)),zt.asyncDep.then(()=>{Tn(()=>{I.isUnmounted||Q()},F)});return}}let $=w,wt;Tr(I,!1),w?(w.el=nt.el,k(I,w,E)):w=nt,_&&Hl(_),(wt=w.props&&w.props.onVnodeBeforeUpdate)&&ai(wt,Y,w,nt),Tr(I,!0);const ht=nd(I),Ct=I.subTree;I.subTree=ht,v(Ct,ht,h(Ct.el),ot(Ct),I,F,X),w.el=ht.el,$===null&&_x(I,ht.el),N&&Tn(N,F),(wt=w.props&&w.props.onVnodeUpdated)&&Tn(()=>ai(wt,Y,w,nt),F)}else{let w;const{el:_,props:N}=O,{bm:Y,m:nt,parent:$,root:wt,type:ht}=I,Ct=Cs(O);Tr(I,!1),Y&&Hl(Y),!Ct&&(w=N&&N.onVnodeBeforeMount)&&ai(w,$,O),Tr(I,!0);{wt.ce&&wt.ce._hasShadowRoot()&&wt.ce._injectChildStyle(ht);const zt=I.subTree=nd(I);v(null,zt,U,z,I,F,X),O.el=zt.el}if(nt&&Tn(nt,F),!Ct&&(w=N&&N.onVnodeMounted)){const zt=O;Tn(()=>ai(w,$,zt),F)}(O.shapeFlag&256||$&&Cs($.vnode)&&$.vnode.shapeFlag&256)&&I.a&&Tn(I.a,F),I.isMounted=!0,O=U=z=null}};I.scope.on();const K=I.effect=new og(rt);I.scope.off();const Q=I.update=K.run.bind(K),it=I.job=K.runIfDirty.bind(K);it.i=I,it.id=I.uid,K.scheduler=()=>yh(it),Tr(I,!0),Q()},k=(I,O,U)=>{O.component=I;const z=I.vnode.props;I.vnode=O,I.next=null,xx(I,O.props,z,U),Mx(I,O.children,U),Gi(),Jf(I),Wi()},H=(I,O,U,z,F,X,E,rt,K=!1)=>{const Q=I&&I.children,it=I?I.shapeFlag:0,w=O.children,{patchFlag:_,shapeFlag:N}=O;if(_>0){if(_&128){pt(Q,w,U,z,F,X,E,rt,K);return}else if(_&256){ct(Q,w,U,z,F,X,E,rt,K);return}}N&8?(it&16&&st(Q,F,X),w!==Q&&u(U,w)):it&16?N&16?pt(Q,w,U,z,F,X,E,rt,K):st(Q,F,X,!0):(it&8&&u(U,""),N&16&&R(w,U,z,F,X,E,rt,K))},ct=(I,O,U,z,F,X,E,rt,K)=>{I=I||Es,O=O||Es;const Q=I.length,it=O.length,w=Math.min(Q,it);let _;for(_=0;_it?st(I,F,X,!0,!1,w):R(O,U,z,F,X,E,rt,K,w)},pt=(I,O,U,z,F,X,E,rt,K)=>{let Q=0;const it=O.length;let w=I.length-1,_=it-1;for(;Q<=w&&Q<=_;){const N=I[Q],Y=O[Q]=K?Oi(O[Q]):fi(O[Q]);if(no(N,Y))v(N,Y,U,null,F,X,E,rt,K);else break;Q++}for(;Q<=w&&Q<=_;){const N=I[w],Y=O[_]=K?Oi(O[_]):fi(O[_]);if(no(N,Y))v(N,Y,U,null,F,X,E,rt,K);else break;w--,_--}if(Q>w){if(Q<=_){const N=_+1,Y=N_)for(;Q<=w;)kt(I[Q],F,X,!0),Q++;else{const N=Q,Y=Q,nt=new Map;for(Q=Y;Q<=_;Q++){const Et=O[Q]=K?Oi(O[Q]):fi(O[Q]);Et.key!=null&&nt.set(Et.key,Q)}let $,wt=0;const ht=_-Y+1;let Ct=!1,zt=0;const ut=new Array(ht);for(Q=0;Q=ht){kt(Et,F,X,!0);continue}let It;if(Et.key!=null)It=nt.get(Et.key);else for($=Y;$<=_;$++)if(ut[$-Y]===0&&no(Et,O[$])){It=$;break}It===void 0?kt(Et,F,X,!0):(ut[It-Y]=Q+1,It>=zt?zt=It:Ct=!0,v(Et,O[It],U,null,F,X,E,rt,K),wt++)}const St=Ct?Ax(ut):Es;for($=St.length-1,Q=ht-1;Q>=0;Q--){const Et=Y+Q,It=O[Et],yt=O[Et+1],ee=Et+1{const{el:X,type:E,transition:rt,children:K,shapeFlag:Q}=I;if(Q&6){ft(I.component.subTree,O,U,z);return}if(Q&128){I.suspense.move(O,U,z);return}if(Q&64){E.move(I,O,U,Mt);return}if(E===Je){i(X,O,U);for(let w=0;wrt.enter(X),F);else{const{leave:w,delayLeave:_,afterLeave:N}=rt,Y=()=>{I.ctx.isUnmounted?r(X):i(X,O,U)},nt=()=>{X._isLeaving&&X[Hv](!0),w(X,()=>{Y(),N&&N()})};_?_(X,Y,nt):nt()}else i(X,O,U)},kt=(I,O,U,z=!1,F=!1)=>{const{type:X,props:E,ref:rt,children:K,dynamicChildren:Q,shapeFlag:it,patchFlag:w,dirs:_,cacheIndex:N}=I;if(w===-2&&(F=!1),rt!=null&&(Gi(),Eo(rt,null,U,I,!0),Wi()),N!=null&&(O.renderCache[N]=void 0),it&256){O.ctx.deactivate(I);return}const Y=it&1&&_,nt=!Cs(I);let $;if(nt&&($=E&&E.onVnodeBeforeUnmount)&&ai($,O,I),it&6)ue(I.component,U,z);else{if(it&128){I.suspense.unmount(U,z);return}Y&&Er(I,null,O,"beforeUnmount"),it&64?I.type.remove(I,O,U,Mt,z):Q&&!Q.hasOnce&&(X!==Je||w>0&&w&64)?st(Q,O,U,!1,!0):(X===Je&&w&384||!F&&it&16)&&st(K,O,U),z&&Lt(I)}(nt&&($=E&&E.onVnodeUnmounted)||Y)&&Tn(()=>{$&&ai($,O,I),Y&&Er(I,null,O,"unmounted")},U)},Lt=I=>{const{type:O,el:U,anchor:z,transition:F}=I;if(O===Je){Zt(U,z);return}if(O===$l){x(I);return}const X=()=>{r(U),F&&!F.persisted&&F.afterLeave&&F.afterLeave()};if(I.shapeFlag&1&&F&&!F.persisted){const{leave:E,delayLeave:rt}=F,K=()=>E(U,X);rt?rt(I.el,X,K):K()}else X()},Zt=(I,O)=>{let U;for(;I!==O;)U=f(I),r(I),I=U;r(O)},ue=(I,O,U)=>{const{bum:z,scope:F,job:X,subTree:E,um:rt,m:K,a:Q}=I;sd(K),sd(Q),z&&Hl(z),F.stop(),X&&(X.flags|=8,kt(E,I,O,U)),rt&&Tn(rt,O),Tn(()=>{I.isUnmounted=!0},O)},st=(I,O,U,z=!1,F=!1,X=0)=>{for(let E=X;E{if(I.shapeFlag&6)return ot(I.component.subTree);if(I.shapeFlag&128)return I.suspense.next();const O=f(I.anchor||I.el),U=O&&O[zv];return U?f(U):O};let Pt=!1;const Vt=(I,O,U)=>{let z;I==null?O._vnode&&(kt(O._vnode,null,null,!0),z=O._vnode.component):v(O._vnode||null,I,O,null,null,null,U),O._vnode=I,Pt||(Pt=!0,Jf(z),Ag(),Pt=!1)},Mt={p:v,um:kt,m:ft,r:Lt,mt:j,mc:R,pc:H,pbc:M,n:ot,o:e};return{render:Vt,hydrate:void 0,createApp:ux(Vt)}}function Jl({type:e,props:t},n){return n==="svg"&&e==="foreignObject"||n==="mathml"&&e==="annotation-xml"&&t&&t.encoding&&t.encoding.includes("html")?void 0:n}function Tr({effect:e,job:t},n){n?(e.flags|=32,t.flags|=4):(e.flags&=-33,t.flags&=-5)}function Tx(e,t){return(!e||e&&!e.pendingBranch)&&t&&!t.persisted}function $g(e,t,n=!1){const i=e.children,r=t.children;if(Kt(i)&&Kt(r))for(let s=0;s>1,e[n[a]]0&&(t[i]=n[s-1]),n[s]=i)}}for(s=n.length,o=n[s-1];s-- >0;)n[s]=o,o=t[o];return n}function Zg(e){const t=e.subTree.component;if(t)return t.asyncDep&&!t.asyncResolved?t:Zg(t)}function sd(e){if(e)for(let t=0;te.__isSuspense;function Px(e,t){t&&t.pendingBranch?Kt(e)?t.effects.push(...e):t.effects.push(e):Uv(e)}const Je=Symbol.for("v-fgt"),Il=Symbol.for("v-txt"),Si=Symbol.for("v-cmt"),$l=Symbol.for("v-stc"),Ao=[];let Bn=null;function ce(e=!1){Ao.push(Bn=e?null:[])}function Cx(){Ao.pop(),Bn=Ao[Ao.length-1]||null}let Fo=1;function ul(e,t=!1){Fo+=e,e<0&&Bn&&t&&(Bn.hasOnce=!0)}function jg(e){return e.dynamicChildren=Fo>0?Bn||Es:null,Cx(),Fo>0&&Bn&&Bn.push(e),e}function Fn(e,t,n,i,r,s){return jg(mr(e,t,n,i,r,s,!0))}function Oe(e,t,n,i,r){return jg(Ge(e,t,n,i,r,!0))}function ko(e){return e?e.__v_isVNode===!0:!1}function no(e,t){return e.type===t.type&&e.key===t.key}const t0=({key:e})=>e??null,qa=({ref:e,ref_key:t,ref_for:n})=>(typeof e=="number"&&(e=""+e),e!=null?We(e)||Ve(e)||jt(e)?{i:yn,r:e,k:t,f:!!n}:e:null);function mr(e,t=null,n=null,i=0,r=null,s=e===Je?0:1,o=!1,a=!1){const l={__v_isVNode:!0,__v_skip:!0,type:e,props:t,key:t&&t0(t),ref:t&&qa(t),scopeId:Cg,slotScopeIds:null,children:n,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:s,patchFlag:i,dynamicProps:r,dynamicChildren:null,appContext:null,ctx:yn};return a?(Ah(l,n),s&128&&e.normalize(l)):n&&(l.shapeFlag|=We(n)?8:16),Fo>0&&!o&&Bn&&(l.patchFlag>0||s&6)&&l.patchFlag!==32&&Bn.push(l),l}const Ge=Rx;function Rx(e,t=null,n=null,i=0,r=null,s=!1){if((!e||e===Ng)&&(e=Si),ko(e)){const a=Jr(e,t,!0);return n&&Ah(a,n),Fo>0&&!s&&Bn&&(a.shapeFlag&6?Bn[Bn.indexOf(e)]=a:Bn.push(a)),a.patchFlag=-2,a}if(zx(e)&&(e=e.__vccOpts),t){t=Dx(t);let{class:a,style:l}=t;a&&!We(a)&&(t.class=Us(a)),xe(l)&&(Al(l)&&!Kt(l)&&(l=on({},l)),t.style=qs(l))}const o=We(e)?1:Qg(e)?128:Vv(e)?64:xe(e)?4:jt(e)?2:0;return mr(e,t,n,i,r,o,s,!0)}function Dx(e){return e?Al(e)||Gg(e)?on({},e):e:null}function Jr(e,t,n=!1,i=!1){const{props:r,ref:s,patchFlag:o,children:a,transition:l}=e,c=t?bi(r||{},t):r,u={__v_isVNode:!0,__v_skip:!0,type:e.type,props:c,key:c&&t0(c),ref:t&&t.ref?n&&s?Kt(s)?s.concat(qa(t)):[s,qa(t)]:qa(t):s,scopeId:e.scopeId,slotScopeIds:e.slotScopeIds,children:a,target:e.target,targetStart:e.targetStart,targetAnchor:e.targetAnchor,staticCount:e.staticCount,shapeFlag:e.shapeFlag,patchFlag:t&&e.type!==Je?o===-1?16:o|16:o,dynamicProps:e.dynamicProps,dynamicChildren:e.dynamicChildren,appContext:e.appContext,dirs:e.dirs,transition:l,component:e.component,suspense:e.suspense,ssContent:e.ssContent&&Jr(e.ssContent),ssFallback:e.ssFallback&&Jr(e.ssFallback),placeholder:e.placeholder,el:e.el,anchor:e.anchor,ctx:e.ctx,ce:e.ce};return l&&i&&Mh(u,l.clone(u)),u}function Ds(e=" ",t=0){return Ge(Il,null,e,t)}function qr(e="",t=!1){return t?(ce(),Oe(Si,null,e)):Ge(Si,null,e)}function fi(e){return e==null||typeof e=="boolean"?Ge(Si):Kt(e)?Ge(Je,null,e.slice()):ko(e)?Oi(e):Ge(Il,null,String(e))}function Oi(e){return e.el===null&&e.patchFlag!==-1||e.memo?e:Jr(e)}function Ah(e,t){let n=0;const{shapeFlag:i}=e;if(t==null)t=null;else if(Kt(t))n=16;else if(typeof t=="object")if(i&65){const r=t.default;r&&(r._c&&(r._d=!1),Ah(e,r()),r._c&&(r._d=!0));return}else{n=32;const r=t._;!r&&!Gg(t)?t._ctx=yn:r===3&&yn&&(yn.slots._===1?t._=1:(t._=2,e.patchFlag|=1024))}else jt(t)?(t={default:t,_ctx:yn},n=32):(t=String(t),i&64?(n=16,t=[Ds(t)]):n=8);e.children=t,e.shapeFlag|=n}function bi(...e){const t={};for(let n=0;nhn||yn;let hl,tu;{const e=El(),t=(n,i)=>{let r;return(r=e[n])||(r=e[n]=[]),r.push(i),s=>{r.length>1?r.forEach(o=>o(s)):r[0](s)}};hl=t("__VUE_INSTANCE_SETTERS__",n=>hn=n),tu=t("__VUE_SSR_SETTERS__",n=>Bo=n)}const Zo=e=>{const t=hn;return hl(e),e.scope.on(),()=>{e.scope.off(),hl(t)}},od=()=>{hn&&hn.scope.off(),hl(null)};function e0(e){return e.vnode.shapeFlag&4}let Bo=!1;function Ux(e,t=!1,n=!1){t&&tu(t);const{props:i,children:r}=e.vnode,s=e0(e);vx(e,i,s,t),bx(e,r,n||t);const o=s?Ox(e,t):void 0;return t&&tu(!1),o}function Ox(e,t){const n=e.type;e.accessCache=Object.create(null),e.proxy=new Proxy(e.ctx,ix);const{setup:i}=n;if(i){Gi();const r=e.setupContext=i.length>1?kx(e):null,s=Zo(e),o=Jo(i,e,0,[e.props,r]),a=jm(o);if(Wi(),s(),(a||e.sp)&&!Cs(e)&&Dg(e),a){if(o.then(od,od),t)return o.then(l=>{ad(e,l)}).catch(l=>{Pl(l,e,0)});e.asyncDep=o}else ad(e,o)}else n0(e)}function ad(e,t,n){jt(t)?e.type.__ssrInlineRender?e.ssrRender=t:e.render=t:xe(t)&&(e.setupState=bg(t)),n0(e)}function n0(e,t,n){const i=e.type;e.render||(e.render=i.render||_i);{const r=Zo(e);Gi();try{rx(e)}finally{Wi(),r()}}}const Fx={get(e,t){return un(e,"get",""),e[t]}};function kx(e){const t=n=>{e.exposed=n||{}};return{attrs:new Proxy(e.attrs,Fx),slots:e.slots,emit:e.emit,expose:t}}function Ph(e){return e.exposed?e.exposeProxy||(e.exposeProxy=new Proxy(bg(yg(e.exposed)),{get(t,n){if(n in t)return t[n];if(n in To)return To[n](e)},has(t,n){return n in t||n in To}})):e.proxy}function Bx(e,t=!0){return jt(e)?e.displayName||e.name:e.name||t&&e.__name}function zx(e){return jt(e)&&"__vccOpts"in e}const pe=(e,t)=>Rv(e,t,Bo);function Po(e,t,n){try{ul(-1);const i=arguments.length;return i===2?xe(t)&&!Kt(t)?ko(t)?Ge(e,null,[t]):Ge(e,t):Ge(e,null,t):(i>3?n=Array.prototype.slice.call(arguments,2):i===3&&ko(n)&&(n=[n]),Ge(e,t,n))}finally{ul(1)}}const Vx="3.5.28";let eu;const ld=typeof window<"u"&&window.trustedTypes;if(ld)try{eu=ld.createPolicy("vue",{createHTML:e=>e})}catch{}const i0=eu?e=>eu.createHTML(e):e=>e,Hx="http://www.w3.org/2000/svg",Gx="http://www.w3.org/1998/Math/MathML",Ui=typeof document<"u"?document:null,cd=Ui&&Ui.createElement("template"),Wx={insert:(e,t,n)=>{t.insertBefore(e,n||null)},remove:e=>{const t=e.parentNode;t&&t.removeChild(e)},createElement:(e,t,n,i)=>{const r=t==="svg"?Ui.createElementNS(Hx,e):t==="mathml"?Ui.createElementNS(Gx,e):n?Ui.createElement(e,{is:n}):Ui.createElement(e);return e==="select"&&i&&i.multiple!=null&&r.setAttribute("multiple",i.multiple),r},createText:e=>Ui.createTextNode(e),createComment:e=>Ui.createComment(e),setText:(e,t)=>{e.nodeValue=t},setElementText:(e,t)=>{e.textContent=t},parentNode:e=>e.parentNode,nextSibling:e=>e.nextSibling,querySelector:e=>Ui.querySelector(e),setScopeId(e,t){e.setAttribute(t,"")},insertStaticContent(e,t,n,i,r,s){const o=n?n.previousSibling:t.lastChild;if(r&&(r===s||r.nextSibling))for(;t.insertBefore(r.cloneNode(!0),n),!(r===s||!(r=r.nextSibling)););else{cd.innerHTML=i0(i==="svg"?`${e}`:i==="mathml"?`${e}`:e);const a=cd.content;if(i==="svg"||i==="mathml"){const l=a.firstChild;for(;l.firstChild;)a.appendChild(l.firstChild);a.removeChild(l)}t.insertBefore(a,n)}return[o?o.nextSibling:t.firstChild,n?n.previousSibling:t.lastChild]}},Xx=Symbol("_vtc");function qx(e,t,n){const i=e[Xx];i&&(t=(t?[t,...i]:[...i]).join(" ")),t==null?e.removeAttribute("class"):n?e.setAttribute("class",t):e.className=t}const ud=Symbol("_vod"),Yx=Symbol("_vsh"),Jx=Symbol(""),$x=/(?:^|;)\s*display\s*:/;function Zx(e,t,n){const i=e.style,r=We(n);let s=!1;if(n&&!r){if(t)if(We(t))for(const o of t.split(";")){const a=o.slice(0,o.indexOf(":")).trim();n[a]==null&&Ya(i,a,"")}else for(const o in t)n[o]==null&&Ya(i,o,"");for(const o in n)o==="display"&&(s=!0),Ya(i,o,n[o])}else if(r){if(t!==n){const o=i[Jx];o&&(n+=";"+o),i.cssText=n,s=$x.test(n)}}else t&&e.removeAttribute("style");ud in e&&(e[ud]=s?i.display:"",e[Yx]&&(i.display="none"))}const hd=/\s*!important$/;function Ya(e,t,n){if(Kt(n))n.forEach(i=>Ya(e,t,i));else if(n==null&&(n=""),t.startsWith("--"))e.setProperty(t,n);else{const i=Kx(e,t);hd.test(n)?e.setProperty(Kr(i),n.replace(hd,""),"important"):e[i]=n}}const fd=["Webkit","Moz","ms"],Zl={};function Kx(e,t){const n=Zl[t];if(n)return n;let i=Rn(t);if(i!=="filter"&&i in e)return Zl[t]=i;i=wl(i);for(let r=0;rKl||(ny.then(()=>Kl=0),Kl=Date.now());function ry(e,t){const n=i=>{if(!i._vts)i._vts=Date.now();else if(i._vts<=n.attached)return;yi(sy(i,n.value),t,5,[i])};return n.value=e,n.attached=iy(),n}function sy(e,t){if(Kt(t)){const n=e.stopImmediatePropagation;return e.stopImmediatePropagation=()=>{n.call(e),e._stopped=!0},t.map(i=>r=>!r._stopped&&i&&i(r))}else return t}const vd=e=>e.charCodeAt(0)===111&&e.charCodeAt(1)===110&&e.charCodeAt(2)>96&&e.charCodeAt(2)<123,oy=(e,t,n,i,r,s)=>{const o=r==="svg";t==="class"?qx(e,i,o):t==="style"?Zx(e,n,i):Sl(t)?uh(t)||ty(e,t,n,i,s):(t[0]==="."?(t=t.slice(1),!0):t[0]==="^"?(t=t.slice(1),!1):ay(e,t,i,o))?(md(e,t,i),!e.tagName.includes("-")&&(t==="value"||t==="checked"||t==="selected")&&pd(e,t,i,o,s,t!=="value")):e._isVueCE&&(/[A-Z]/.test(t)||!We(i))?md(e,Rn(t),i,s,t):(t==="true-value"?e._trueValue=i:t==="false-value"&&(e._falseValue=i),pd(e,t,i,o))};function ay(e,t,n,i){if(i)return!!(t==="innerHTML"||t==="textContent"||t in e&&vd(t)&&jt(n));if(t==="spellcheck"||t==="draggable"||t==="translate"||t==="autocorrect"||t==="sandbox"&&e.tagName==="IFRAME"||t==="form"||t==="list"&&e.tagName==="INPUT"||t==="type"&&e.tagName==="TEXTAREA")return!1;if(t==="width"||t==="height"){const r=e.tagName;if(r==="IMG"||r==="VIDEO"||r==="CANVAS"||r==="SOURCE")return!1}return vd(t)&&We(n)?!1:t in e}const ly=on({patchProp:oy},Wx);let xd;function cy(){return xd||(xd=wx(ly))}const uy=((...e)=>{const t=cy().createApp(...e),{mount:n}=t;return t.mount=i=>{const r=fy(i);if(!r)return;const s=t._component;!jt(s)&&!s.render&&!s.template&&(s.template=r.innerHTML),r.nodeType===1&&(r.textContent="");const o=n(r,!1,hy(r));return r instanceof Element&&(r.removeAttribute("v-cloak"),r.setAttribute("data-v-app","")),o},t});function hy(e){if(e instanceof SVGElement)return"svg";if(typeof MathMLElement=="function"&&e instanceof MathMLElement)return"mathml"}function fy(e){return We(e)?document.querySelector(e):e}function r0(e){var t,n,i="";if(typeof e=="string"||typeof e=="number")i+=e;else if(typeof e=="object")if(Array.isArray(e)){var r=e.length;for(t=0;ttypeof e=="boolean"?`${e}`:e===0?"0":e,Sd=s0,dy=(e,t)=>n=>{var i;if(t?.variants==null)return Sd(e,n?.class,n?.className);const{variants:r,defaultVariants:s}=t,o=Object.keys(r).map(c=>{const u=n?.[c],h=s?.[c];if(u===null)return null;const f=yd(u)||yd(h);return r[c][f]}),a=n&&Object.entries(n).reduce((c,u)=>{let[h,f]=u;return f===void 0||(c[h]=f),c},{}),l=t==null||(i=t.compoundVariants)===null||i===void 0?void 0:i.reduce((c,u)=>{let{class:h,className:f,...p}=u;return Object.entries(p).every(g=>{let[v,m]=g;return Array.isArray(m)?m.includes({...s,...a}[v]):{...s,...a}[v]===m})?[...c,h,f]:c},[]);return Sd(e,o,l,n?.class,n?.className)};function o0(e,t=Number.NEGATIVE_INFINITY,n=Number.POSITIVE_INFINITY){return Math.min(n,Math.max(t,e))}function Ch(e,t){const n=typeof e=="string"&&!t?`${e}Context`:t,i=Symbol(n);return[o=>{const a=Ps(i,o);if(a||a===null)return a;throw new Error(`Injection \`${i.toString()}\` not found. Component must be used within ${Array.isArray(e)?`one of the following components: ${e.join(", ")}`:`\`${e}\``}`)},o=>(Sh(i,o),o)]}function a0(e){return e?e.flatMap(t=>t.type===Je?a0(t.children):[t]):[]}const[py]=Ch("ConfigProvider");typeof WorkerGlobalScope<"u"&&globalThis instanceof WorkerGlobalScope;const my=e=>typeof e<"u";function gy(e){return Xi(Ve(e)?new Proxy({},{get(t,n,i){return vt(Reflect.get(e.value,n,i))},set(t,n,i){return Ve(e.value[n])&&!Ve(i)?e.value[n].value=i:e.value[n]=i,!0},deleteProperty(t,n){return Reflect.deleteProperty(e.value,n)},has(t,n){return Reflect.has(e.value,n)},ownKeys(){return Object.keys(e.value)},getOwnPropertyDescriptor(){return{enumerable:!0,configurable:!0}}}):e)}function _y(e){return gy(pe(e))}function vy(e,...t){const n=t.flat(),i=n[0];return _y(()=>Object.fromEntries(typeof i=="function"?Object.entries(Uo(e)).filter(([r,s])=>!i(xh(s),r)):Object.entries(Uo(e)).filter(r=>!n.includes(r[0]))))}function Ll(e){var t;const n=xh(e);return(t=n?.$el)!==null&&t!==void 0?t:n}function xy(){const e=Mv(!1),t=Ys();return t&&$o(()=>{e.value=!0},t),e}function yy(e){return JSON.parse(JSON.stringify(e))}function Sy(e,t,n,i={}){var r,s;const{clone:o=!1,passive:a=!1,eventName:l,deep:c=!1,defaultValue:u,shouldEmit:h}=i,f=Ys(),p=n||f?.emit||(f==null||(r=f.$emit)===null||r===void 0?void 0:r.bind(f))||(f==null||(s=f.proxy)===null||s===void 0||(s=s.$emit)===null||s===void 0?void 0:s.bind(f?.proxy));let g=l;g=g||`update:${t.toString()}`;const v=S=>o?typeof o=="function"?o(S):yy(S):S,m=()=>my(e[t])?v(e[t]):u,d=S=>{h?h(S)&&p(g,S):p(g,S)};if(a){const S=sn(m());let y=!1;return Xr(()=>e[t],x=>{y||(y=!0,S.value=v(x),Eg(()=>y=!1))}),Xr(S,x=>{!y&&(x!==e[t]||c)&&d(x)},{deep:c}),S}else return pe({get(){return m()},set(S){d(S)}})}function by(e){const t=py({dir:sn("ltr")});return pe(()=>e?.value||t.dir?.value||"ltr")}function My(e){const t=Ys(),n=t?.type.emits,i={};return n?.length||console.warn(`No emitted event found. Please check component: ${t?.type.__name}`),n?.forEach(r=>{i[Xa(Rn(r))]=(...s)=>e(r,...s)}),i}function wy(e){return pe(()=>xh(e)?!!Ll(e)?.closest("form"):!0)}function Qr(){const e=Ys(),t=sn(),n=pe(()=>["#text","#comment"].includes(t.value?.$el.nodeName)?t.value?.$el.nextElementSibling:Ll(t)),i=Object.assign({},e.exposed),r={};for(const o in e.props)Object.defineProperty(r,o,{enumerable:!0,configurable:!0,get:()=>e.props[o]});if(Object.keys(i).length>0)for(const o in i)Object.defineProperty(r,o,{enumerable:!0,configurable:!0,get:()=>i[o]});Object.defineProperty(r,"$el",{enumerable:!0,configurable:!0,get:()=>e.vnode.el}),e.exposed=r;function s(o){if(t.value=o,!!o&&(Object.defineProperty(r,"$el",{enumerable:!0,configurable:!0,get:()=>o instanceof Element?o:o.$el}),!(o instanceof Element)&&!Object.hasOwn(o,"$el"))){const a=o.$.exposed,l=Object.assign({},r);for(const c in a)Object.defineProperty(l,c,{enumerable:!0,configurable:!0,get:()=>a[c]});e.exposed=l}}return{forwardRef:s,currentRef:t,currentElement:n}}function Ey(e){const t=Ys(),n=Object.keys(t?.type.props??{}).reduce((r,s)=>{const o=(t?.type.props[s]).default;return o!==void 0&&(r[s]=o),r},{}),i=Pv(e);return pe(()=>{const r={},s=t?.vnode.props??{};return Object.keys(s).forEach(o=>{r[Rn(o)]=s[o]}),Object.keys({...n,...r}).reduce((o,a)=>(i.value[a]!==void 0&&(o[a]=i.value[a]),o),{})})}function Ty(e,t){const n=Ey(e),i=t?My(t):{};return pe(()=>({...n.value,...i}))}function Ay(e){const t=sn(),n=pe(()=>t.value?.width??0),i=pe(()=>t.value?.height??0);return $o(()=>{const r=Ll(e);if(r){t.value={width:r.offsetWidth,height:r.offsetHeight};const s=new ResizeObserver(o=>{if(!Array.isArray(o)||!o.length)return;const a=o[0];let l,c;if("borderBoxSize"in a){const u=a.borderBoxSize,h=Array.isArray(u)?u[0]:u;l=h.inlineSize,c=h.blockSize}else l=r.offsetWidth,c=r.offsetHeight;t.value={width:l,height:c}});return s.observe(r,{box:"border-box"}),()=>s.unobserve(r)}else t.value=void 0}),{width:n,height:i}}const nu=Ze({name:"PrimitiveSlot",inheritAttrs:!1,setup(e,{attrs:t,slots:n}){return()=>{if(!n.default)return null;const i=a0(n.default()),r=i.findIndex(l=>l.type!==Si);if(r===-1)return i;const s=i[r];delete s.props?.ref;const o=s.props?bi(t,s.props):t,a=Jr({...s,props:{}},o);return i.length===1?a:(i[r]=a,i)}}}),Py=["area","img","input"],Js=Ze({name:"Primitive",inheritAttrs:!1,props:{asChild:{type:Boolean,default:!1},as:{type:[String,Object],default:"div"}},setup(e,{attrs:t,slots:n}){const i=e.asChild?"template":e.as;return typeof i=="string"&&Py.includes(i)?()=>Po(i,t):i!=="template"?()=>Po(e.as,t,{default:n.default}):()=>Po(nu,t,{default:n.default})}});function iu(){const e=sn(),t=pe(()=>["#text","#comment"].includes(e.value?.$el.nodeName)?e.value?.$el.nextElementSibling:Ll(e));return{primitiveElement:e,currentElement:t}}const bd="data-reka-collection-item";function Rh(e={}){const{key:t="",isProvider:n=!1}=e,i=`${t}CollectionProvider`;let r;n?(r={collectionRef:sn(),itemMap:sn(new Map)},Sh(i,r)):r=Ps(i);const s=(u=!1)=>{const h=r.collectionRef.value;if(!h)return[];const f=Array.from(h.querySelectorAll(`[${bd}]`)),g=Array.from(r.itemMap.value.values()).sort((v,m)=>f.indexOf(v.ref)-f.indexOf(m.ref));return u?g:g.filter(v=>v.ref.dataset.disabled!=="")},o=Ze({name:"CollectionSlot",inheritAttrs:!1,setup(u,{slots:h,attrs:f}){const{primitiveElement:p,currentElement:g}=iu();return Xr(g,()=>{r.collectionRef.value=g.value}),()=>Po(nu,{ref:p,...f},h)}}),a=Ze({name:"CollectionItem",inheritAttrs:!1,props:{value:{validator:()=>!0}},setup(u,{slots:h,attrs:f}){const{primitiveElement:p,currentElement:g}=iu();return kv(v=>{if(g.value){const m=yg(g.value);r.itemMap.value.set(m,{ref:g.value,value:u.value}),v(()=>r.itemMap.value.delete(m))}}),()=>Po(nu,{...f,[bd]:"",ref:p},h)}}),l=pe(()=>Array.from(r.itemMap.value.values())),c=pe(()=>r.itemMap.value.size);return{getItems:s,reactiveItems:l,itemMapSize:c,CollectionSlot:o,CollectionItem:a}}var Cy=Ze({__name:"VisuallyHidden",props:{feature:{type:String,required:!1,default:"focusable"},asChild:{type:Boolean,required:!1},as:{type:null,required:!1,default:"span"}},setup(e){return(t,n)=>(ce(),Oe(vt(Js),{as:t.as,"as-child":t.asChild,"aria-hidden":t.feature==="focusable"?"true":void 0,"data-hidden":t.feature==="fully-hidden"?"":void 0,tabindex:t.feature==="fully-hidden"?"-1":void 0,style:{position:"absolute",border:0,width:"1px",height:"1px",padding:0,margin:"-1px",overflow:"hidden",clip:"rect(0, 0, 0, 0)",clipPath:"inset(50%)",whiteSpace:"nowrap",wordWrap:"normal",top:"-1px",left:"-1px"}},{default:$e(()=>[wi(t.$slots,"default")]),_:3},8,["as","as-child","aria-hidden","data-hidden","tabindex"]))}}),Ry=Cy,Dy=Ze({inheritAttrs:!1,__name:"VisuallyHiddenInputBubble",props:{name:{type:String,required:!0},value:{type:null,required:!0},checked:{type:Boolean,required:!1,default:void 0},required:{type:Boolean,required:!1},disabled:{type:Boolean,required:!1},feature:{type:String,required:!1,default:"fully-hidden"}},setup(e){const t=e,{primitiveElement:n,currentElement:i}=iu(),r=pe(()=>t.checked??t.value);return Xr(r,(s,o)=>{if(!i.value)return;const a=i.value,l=window.HTMLInputElement.prototype,u=Object.getOwnPropertyDescriptor(l,"value").set;if(u&&s!==o){const h=new Event("input",{bubbles:!0}),f=new Event("change",{bubbles:!0});u.call(a,s),a.dispatchEvent(h),a.dispatchEvent(f)}}),(s,o)=>(ce(),Oe(Ry,bi({ref_key:"primitiveElement",ref:n},{...t,...s.$attrs},{as:"input"}),null,16))}}),Md=Dy,Iy=Ze({inheritAttrs:!1,__name:"VisuallyHiddenInput",props:{name:{type:String,required:!0},value:{type:null,required:!0},checked:{type:Boolean,required:!1,default:void 0},required:{type:Boolean,required:!1},disabled:{type:Boolean,required:!1},feature:{type:String,required:!1,default:"fully-hidden"}},setup(e){const t=e,n=pe(()=>typeof t.value=="object"&&Array.isArray(t.value)&&t.value.length===0&&t.required),i=pe(()=>typeof t.value=="string"||typeof t.value=="number"||typeof t.value=="boolean"||t.value===null||t.value===void 0?[{name:t.name,value:t.value}]:typeof t.value=="object"&&Array.isArray(t.value)?t.value.flatMap((r,s)=>typeof r=="object"?Object.entries(r).map(([o,a])=>({name:`${t.name}[${s}][${o}]`,value:a})):{name:`${t.name}[${s}]`,value:r}):t.value!==null&&typeof t.value=="object"&&!Array.isArray(t.value)?Object.entries(t.value).map(([r,s])=>({name:`${t.name}[${r}]`,value:s})):[]);return(r,s)=>(ce(),Fn(Je,null,[qr(" We render single input if it's required "),n.value?(ce(),Oe(Md,bi({key:r.name},{...t,...r.$attrs},{name:r.name,value:r.value}),null,16,["name","value"])):(ce(!0),Fn(Je,{key:1},Rl(i.value,o=>(ce(),Oe(Md,bi({key:o.name},{ref_for:!0},{...t,...r.$attrs},{name:o.name,value:o.value}),null,16,["name","value"]))),128))],2112))}}),Ly=Iy;function Ny(e=[],t,n){const i=[...e];return i[n]=t,i.sort((r,s)=>r-s)}function l0(e,t,n){const s=100/(n-t)*(e-t);return o0(s,0,100)}function Uy(e,t){return t>2?`Value ${e+1} of ${t}`:t===2?["Minimum","Maximum"][e]:void 0}function Oy(e,t){if(e.length===1)return 0;const n=e.map(r=>Math.abs(r-t)),i=Math.min(...n);return n.indexOf(i)}function Fy(e,t,n){const i=e/2,s=Dh([0,50],[0,i]);return(i-s(t)*n)*n}function ky(e){return e.slice(0,-1).map((t,n)=>e[n+1]-t)}function By(e,t){if(t>0){const n=ky(e);return Math.min(...n)>=t}return!0}function Dh(e,t){return n=>{if(e[0]===e[1]||t[0]===t[1])return t[0];const i=(t[1]-t[0])/(e[1]-e[0]);return t[0]+i*(n-e[0])}}function zy(e){return(String(e).split(".")[1]||"").length}function Vy(e,t){const n=10**t;return Math.round(e*n)/n}const c0=["PageUp","PageDown"],u0=["ArrowUp","ArrowDown","ArrowLeft","ArrowRight"],h0={"from-left":["Home","PageDown","ArrowDown","ArrowLeft"],"from-right":["Home","PageDown","ArrowDown","ArrowRight"],"from-bottom":["Home","PageDown","ArrowDown","ArrowLeft"],"from-top":["Home","PageUp","ArrowUp","ArrowLeft"]},[f0,d0]=Ch(["SliderVertical","SliderHorizontal"]);var Hy=Ze({__name:"SliderHorizontal",props:{dir:{type:String,required:!1},min:{type:Number,required:!0},max:{type:Number,required:!0},inverted:{type:Boolean,required:!0}},emits:["slideEnd","slideStart","slideMove","homeKeyDown","endKeyDown","stepKeyDown"],setup(e,{emit:t}){const n=e,i=t,{max:r,min:s,dir:o,inverted:a}=Uo(n),{forwardRef:l,currentElement:c}=Qr(),u=$s(),h=sn(),f=sn(),p=pe(()=>o?.value!=="rtl"&&!a.value||o?.value!=="ltr"&&a.value);function g(S,y){const x=f.value||c.value.getBoundingClientRect(),A=[...u.thumbElements.value][u.valueIndexToChangeRef.value],P=u.thumbAlignment.value==="contain"?A.clientWidth:0;!h.value&&!y&&u.thumbAlignment.value==="contain"&&(h.value=S.clientX-A.getBoundingClientRect().left);const C=[0,x.width-P],R=p.value?[s.value,r.value]:[r.value,s.value],b=Dh(C,R);f.value=x;const M=y?S.clientX-x.left-P/2:S.clientX-x.left-(h.value??0);return b(M)}const v=pe(()=>p.value?"left":"right"),m=pe(()=>p.value?"right":"left"),d=pe(()=>p.value?1:-1);return d0({startEdge:v,endEdge:m,direction:d,size:"width"}),(S,y)=>(ce(),Oe(p0,{ref:vt(l),dir:vt(o),"data-orientation":"horizontal",style:qs({"--reka-slider-thumb-transform":!p.value&&vt(u).thumbAlignment.value==="overflow"?"translateX(50%)":"translateX(-50%)"}),onSlideStart:y[0]||(y[0]=x=>{const A=g(x,!0);i("slideStart",A)}),onSlideMove:y[1]||(y[1]=x=>{const A=g(x);i("slideMove",A)}),onSlideEnd:y[2]||(y[2]=()=>{f.value=void 0,h.value=void 0,i("slideEnd")}),onStepKeyDown:y[3]||(y[3]=x=>{const A=p.value?"from-left":"from-right",P=vt(h0)[A].includes(x.key);i("stepKeyDown",x,P?-1:1)}),onEndKeyDown:y[4]||(y[4]=x=>i("endKeyDown",x)),onHomeKeyDown:y[5]||(y[5]=x=>i("homeKeyDown",x))},{default:$e(()=>[wi(S.$slots,"default")]),_:3},8,["dir","style"]))}}),Gy=Hy,Wy=Ze({__name:"SliderVertical",props:{min:{type:Number,required:!0},max:{type:Number,required:!0},inverted:{type:Boolean,required:!0}},emits:["slideEnd","slideStart","slideMove","homeKeyDown","endKeyDown","stepKeyDown"],setup(e,{emit:t}){const n=e,i=t,{max:r,min:s,inverted:o}=Uo(n),a=$s(),{forwardRef:l,currentElement:c}=Qr(),u=sn(),h=sn(),f=pe(()=>!o.value);function p(d,S){const y=h.value||c.value.getBoundingClientRect(),x=[...a.thumbElements.value][a.valueIndexToChangeRef.value],A=a.thumbAlignment.value==="contain"?x.clientHeight:0;!u.value&&!S&&a.thumbAlignment.value==="contain"&&(u.value=d.clientY-x.getBoundingClientRect().top);const P=[0,y.height-A],C=f.value?[r.value,s.value]:[s.value,r.value],R=Dh(P,C),b=S?d.clientY-y.top-A/2:d.clientY-y.top-(u.value??0);return h.value=y,R(b)}const g=pe(()=>f.value?"bottom":"top"),v=pe(()=>f.value?"top":"bottom"),m=pe(()=>f.value?1:-1);return d0({startEdge:g,endEdge:v,direction:m,size:"height"}),(d,S)=>(ce(),Oe(p0,{ref:vt(l),"data-orientation":"vertical",style:qs({"--reka-slider-thumb-transform":!f.value&&vt(a).thumbAlignment.value==="overflow"?"translateY(-50%)":"translateY(50%)"}),onSlideStart:S[0]||(S[0]=y=>{const x=p(y,!0);i("slideStart",x)}),onSlideMove:S[1]||(S[1]=y=>{const x=p(y);i("slideMove",x)}),onSlideEnd:S[2]||(S[2]=()=>{h.value=void 0,u.value=void 0,i("slideEnd")}),onStepKeyDown:S[3]||(S[3]=y=>{const x=f.value?"from-bottom":"from-top",A=vt(h0)[x].includes(y.key);i("stepKeyDown",y,A?-1:1)}),onEndKeyDown:S[4]||(S[4]=y=>i("endKeyDown",y)),onHomeKeyDown:S[5]||(S[5]=y=>i("homeKeyDown",y))},{default:$e(()=>[wi(d.$slots,"default")]),_:3},8,["style"]))}}),Xy=Wy;const[$s,qy]=Ch("SliderRoot");var Yy=Ze({inheritAttrs:!1,__name:"SliderRoot",props:{defaultValue:{type:Array,required:!1,default:()=>[0]},modelValue:{type:[Array,null],required:!1},disabled:{type:Boolean,required:!1,default:!1},orientation:{type:String,required:!1,default:"horizontal"},dir:{type:String,required:!1},inverted:{type:Boolean,required:!1,default:!1},min:{type:Number,required:!1,default:0},max:{type:Number,required:!1,default:100},step:{type:Number,required:!1,default:1},minStepsBetweenThumbs:{type:Number,required:!1,default:0},thumbAlignment:{type:String,required:!1,default:"contain"},asChild:{type:Boolean,required:!1},as:{type:null,required:!1,default:"span"},name:{type:String,required:!1},required:{type:Boolean,required:!1}},emits:["update:modelValue","valueCommit"],setup(e,{emit:t}){const n=e,i=t,{min:r,max:s,step:o,minStepsBetweenThumbs:a,orientation:l,disabled:c,thumbAlignment:u,dir:h}=Uo(n),f=by(h),{forwardRef:p,currentElement:g}=Qr(),v=wy(g),{CollectionSlot:m}=Rh({isProvider:!0}),d=Sy(n,"modelValue",i,{defaultValue:n.defaultValue,passive:n.modelValue===void 0}),S=pe(()=>Array.isArray(d.value)?[...d.value]:[]),y=sn(0),x=sn(S.value);function A(M){const L=Oy(S.value,M);R(M,L)}function P(M){R(M,y.value)}function C(){const M=x.value[y.value];S.value[y.value]!==M&&i("valueCommit",_e(S.value))}function R(M,L,{commit:V}={commit:!1}){const q=zy(o.value),j=Vy(Math.round((M-r.value)/o.value)*o.value+r.value,q),J=o0(j,r.value,s.value),W=Ny(S.value,J,L);if(By(W,a.value*o.value)){y.value=W.indexOf(J);const k=String(W)!==String(d.value);k&&V&&i("valueCommit",W),k&&(b.value[y.value]?.focus(),d.value=W)}}const b=sn([]);return qy({modelValue:d,currentModelValue:S,valueIndexToChangeRef:y,thumbElements:b,orientation:l,min:r,max:s,disabled:c,thumbAlignment:u}),(M,L)=>(ce(),Oe(vt(m),null,{default:$e(()=>[(ce(),Oe(ex(vt(l)==="horizontal"?Gy:Xy),bi(M.$attrs,{ref:vt(p),"as-child":M.asChild,as:M.as,min:vt(r),max:vt(s),dir:vt(f),inverted:M.inverted,"aria-disabled":vt(c),"data-disabled":vt(c)?"":void 0,onPointerdown:L[0]||(L[0]=()=>{vt(c)||(x.value=S.value)}),onSlideStart:L[1]||(L[1]=V=>!vt(c)&&A(V)),onSlideMove:L[2]||(L[2]=V=>!vt(c)&&P(V)),onSlideEnd:L[3]||(L[3]=V=>!vt(c)&&C()),onHomeKeyDown:L[4]||(L[4]=V=>!vt(c)&&R(vt(r),0,{commit:!0})),onEndKeyDown:L[5]||(L[5]=V=>!vt(c)&&R(vt(s),S.value.length-1,{commit:!0})),onStepKeyDown:L[6]||(L[6]=(V,q)=>{if(!vt(c)){const W=vt(c0).includes(V.key)||V.shiftKey&&vt(u0).includes(V.key)?10:1,k=y.value,H=S.value[k],ct=vt(o)*W*q;R(H+ct,k,{commit:!0})}})}),{default:$e(()=>[wi(M.$slots,"default",{modelValue:vt(d)}),vt(v)&&M.name?(ce(),Oe(vt(Ly),{key:0,type:"number",value:vt(d),name:M.name,required:M.required,disabled:vt(c),step:vt(o)},null,8,["value","name","required","disabled","step"])):qr("v-if",!0)]),_:3},16,["as-child","as","min","max","dir","inverted","aria-disabled","data-disabled"]))]),_:3}))}}),Jy=Yy,$y=Ze({__name:"SliderImpl",props:{asChild:{type:Boolean,required:!1},as:{type:null,required:!1,default:"span"}},emits:["slideStart","slideMove","slideEnd","homeKeyDown","endKeyDown","stepKeyDown"],setup(e,{emit:t}){const n=e,i=t,r=$s();return(s,o)=>(ce(),Oe(vt(Js),bi({"data-slider-impl":""},n,{onKeydown:o[0]||(o[0]=a=>{a.key==="Home"?(i("homeKeyDown",a),a.preventDefault()):a.key==="End"?(i("endKeyDown",a),a.preventDefault()):vt(c0).concat(vt(u0)).includes(a.key)&&(i("stepKeyDown",a),a.preventDefault())}),onPointerdown:o[1]||(o[1]=a=>{const l=a.target;l.setPointerCapture(a.pointerId),a.preventDefault(),vt(r).thumbElements.value.includes(l)?l.focus():i("slideStart",a)}),onPointermove:o[2]||(o[2]=a=>{a.target.hasPointerCapture(a.pointerId)&&i("slideMove",a)}),onPointerup:o[3]||(o[3]=a=>{const l=a.target;l.hasPointerCapture(a.pointerId)&&(l.releasePointerCapture(a.pointerId),i("slideEnd",a))})}),{default:$e(()=>[wi(s.$slots,"default")]),_:3},16))}}),p0=$y,Zy=Ze({__name:"SliderRange",props:{asChild:{type:Boolean,required:!1},as:{type:null,required:!1,default:"span"}},setup(e){const t=$s(),n=f0();Qr();const i=pe(()=>t.currentModelValue.value.map(o=>l0(o,t.min.value,t.max.value))),r=pe(()=>t.currentModelValue.value.length>1?Math.min(...i.value):0),s=pe(()=>100-Math.max(...i.value,0));return(o,a)=>(ce(),Oe(vt(Js),{"data-disabled":vt(t).disabled.value?"":void 0,"data-orientation":vt(t).orientation.value,"as-child":o.asChild,as:o.as,style:qs({[vt(n).startEdge.value]:`${r.value}%`,[vt(n).endEdge.value]:`${s.value}%`})},{default:$e(()=>[wi(o.$slots,"default")]),_:3},8,["data-disabled","data-orientation","as-child","as","style"]))}}),Ky=Zy,Qy=Ze({inheritAttrs:!1,__name:"SliderThumbImpl",props:{index:{type:Number,required:!0},asChild:{type:Boolean,required:!1},as:{type:null,required:!1}},setup(e){const t=e,n=$s(),i=f0(),{forwardRef:r,currentElement:s}=Qr(),{CollectionItem:o}=Rh(),a=pe(()=>n.modelValue?.value?.[t.index]),l=pe(()=>a.value===void 0?0:l0(a.value,n.min.value??0,n.max.value??100)),c=pe(()=>Uy(t.index,n.modelValue?.value?.length??0)),u=Ay(s),h=pe(()=>u[i.size].value),f=pe(()=>n.thumbAlignment.value==="overflow"||!h.value?0:Fy(h.value,l.value,i.direction.value)),p=xy();return $o(()=>{n.thumbElements.value.push(s.value)}),wh(()=>{const g=n.thumbElements.value.findIndex(v=>v===s.value)??-1;n.thumbElements.value.splice(g,1)}),(g,v)=>(ce(),Oe(vt(o),null,{default:$e(()=>[Ge(vt(Js),bi(g.$attrs,{ref:vt(r),role:"slider",tabindex:vt(n).disabled.value?void 0:0,"aria-label":g.$attrs["aria-label"]||c.value,"data-disabled":vt(n).disabled.value?"":void 0,"data-orientation":vt(n).orientation.value,"aria-valuenow":a.value,"aria-valuemin":vt(n).min.value,"aria-valuemax":vt(n).max.value,"aria-orientation":vt(n).orientation.value,"as-child":g.asChild,as:g.as,style:{transform:"var(--reka-slider-thumb-transform)",position:"absolute",[vt(i).startEdge.value]:`calc(${l.value}% + ${f.value}px)`,display:!vt(p)&&a.value===void 0?"none":void 0},onFocus:v[0]||(v[0]=()=>{vt(n).valueIndexToChangeRef.value=g.index})}),{default:$e(()=>[wi(g.$slots,"default")]),_:3},16,["tabindex","aria-label","data-disabled","data-orientation","aria-valuenow","aria-valuemin","aria-valuemax","aria-orientation","as-child","as","style"])]),_:3}))}}),jy=Qy,tS=Ze({__name:"SliderThumb",props:{asChild:{type:Boolean,required:!1},as:{type:null,required:!1,default:"span"}},setup(e){const t=e,{getItems:n}=Rh(),{forwardRef:i,currentElement:r}=Qr(),s=pe(()=>r.value?n(!0).findIndex(o=>o.ref===r.value):-1);return(o,a)=>(ce(),Oe(jy,bi({ref:vt(i)},t,{index:s.value}),{default:$e(()=>[wi(o.$slots,"default")]),_:3},16,["index"]))}}),eS=tS,nS=Ze({__name:"SliderTrack",props:{asChild:{type:Boolean,required:!1},as:{type:null,required:!1,default:"span"}},setup(e){const t=$s();return Qr(),(n,i)=>(ce(),Oe(vt(Js),{"as-child":n.asChild,as:n.as,"data-disabled":vt(t).disabled.value?"":void 0,"data-orientation":vt(t).orientation.value},{default:$e(()=>[wi(n.$slots,"default")]),_:3},8,["as-child","as","data-disabled","data-orientation"]))}}),iS=nS;const rS=(e,t)=>{const n=new Array(e.length+t.length);for(let i=0;i({classGroupId:e,validator:t}),m0=(e=new Map,t=null,n)=>({nextPart:e,validators:t,classGroupId:n}),fl="-",wd=[],oS="arbitrary..",aS=e=>{const t=cS(e),{conflictingClassGroups:n,conflictingClassGroupModifiers:i}=e;return{getClassGroupId:o=>{if(o.startsWith("[")&&o.endsWith("]"))return lS(o);const a=o.split(fl),l=a[0]===""&&a.length>1?1:0;return g0(a,l,t)},getConflictingClassGroupIds:(o,a)=>{if(a){const l=i[o],c=n[o];return l?c?rS(c,l):l:c||wd}return n[o]||wd}}},g0=(e,t,n)=>{if(e.length-t===0)return n.classGroupId;const r=e[t],s=n.nextPart.get(r);if(s){const c=g0(e,t+1,s);if(c)return c}const o=n.validators;if(o===null)return;const a=t===0?e.join(fl):e.slice(t).join(fl),l=o.length;for(let c=0;ce.slice(1,-1).indexOf(":")===-1?void 0:(()=>{const t=e.slice(1,-1),n=t.indexOf(":"),i=t.slice(0,n);return i?oS+i:void 0})(),cS=e=>{const{theme:t,classGroups:n}=e;return uS(n,t)},uS=(e,t)=>{const n=m0();for(const i in e){const r=e[i];Ih(r,n,i,t)}return n},Ih=(e,t,n,i)=>{const r=e.length;for(let s=0;s{if(typeof e=="string"){fS(e,t,n);return}if(typeof e=="function"){dS(e,t,n,i);return}pS(e,t,n,i)},fS=(e,t,n)=>{const i=e===""?t:_0(t,e);i.classGroupId=n},dS=(e,t,n,i)=>{if(mS(e)){Ih(e(i),t,n,i);return}t.validators===null&&(t.validators=[]),t.validators.push(sS(n,e))},pS=(e,t,n,i)=>{const r=Object.entries(e),s=r.length;for(let o=0;o{let n=e;const i=t.split(fl),r=i.length;for(let s=0;s"isThemeGetter"in e&&e.isThemeGetter===!0,gS=e=>{if(e<1)return{get:()=>{},set:()=>{}};let t=0,n=Object.create(null),i=Object.create(null);const r=(s,o)=>{n[s]=o,t++,t>e&&(t=0,i=n,n=Object.create(null))};return{get(s){let o=n[s];if(o!==void 0)return o;if((o=i[s])!==void 0)return r(s,o),o},set(s,o){s in n?n[s]=o:r(s,o)}}},ru="!",Ed=":",_S=[],Td=(e,t,n,i,r)=>({modifiers:e,hasImportantModifier:t,baseClassName:n,maybePostfixModifierPosition:i,isExternal:r}),vS=e=>{const{prefix:t,experimentalParseClassName:n}=e;let i=r=>{const s=[];let o=0,a=0,l=0,c;const u=r.length;for(let v=0;vl?c-l:void 0;return Td(s,p,f,g)};if(t){const r=t+Ed,s=i;i=o=>o.startsWith(r)?s(o.slice(r.length)):Td(_S,!1,o,void 0,!0)}if(n){const r=i;i=s=>n({className:s,parseClassName:r})}return i},xS=e=>{const t=new Map;return e.orderSensitiveModifiers.forEach((n,i)=>{t.set(n,1e6+i)}),n=>{const i=[];let r=[];for(let s=0;s0&&(r.sort(),i.push(...r),r=[]),i.push(o)):r.push(o)}return r.length>0&&(r.sort(),i.push(...r)),i}},yS=e=>({cache:gS(e.cacheSize),parseClassName:vS(e),sortModifiers:xS(e),...aS(e)}),SS=/\s+/,bS=(e,t)=>{const{parseClassName:n,getClassGroupId:i,getConflictingClassGroupIds:r,sortModifiers:s}=t,o=[],a=e.trim().split(SS);let l="";for(let c=a.length-1;c>=0;c-=1){const u=a[c],{isExternal:h,modifiers:f,hasImportantModifier:p,baseClassName:g,maybePostfixModifierPosition:v}=n(u);if(h){l=u+(l.length>0?" "+l:l);continue}let m=!!v,d=i(m?g.substring(0,v):g);if(!d){if(!m){l=u+(l.length>0?" "+l:l);continue}if(d=i(g),!d){l=u+(l.length>0?" "+l:l);continue}m=!1}const S=f.length===0?"":f.length===1?f[0]:s(f).join(":"),y=p?S+ru:S,x=y+d;if(o.indexOf(x)>-1)continue;o.push(x);const A=r(d,m);for(let P=0;P0?" "+l:l)}return l},MS=(...e)=>{let t=0,n,i,r="";for(;t{if(typeof e=="string")return e;let t,n="";for(let i=0;i{let n,i,r,s;const o=l=>{const c=t.reduce((u,h)=>h(u),e());return n=yS(c),i=n.cache.get,r=n.cache.set,s=a,a(l)},a=l=>{const c=i(l);if(c)return c;const u=bS(l,n);return r(l,u),u};return s=o,(...l)=>s(MS(...l))},ES=[],qe=e=>{const t=n=>n[e]||ES;return t.isThemeGetter=!0,t},x0=/^\[(?:(\w[\w-]*):)?(.+)\]$/i,y0=/^\((?:(\w[\w-]*):)?(.+)\)$/i,TS=/^\d+\/\d+$/,AS=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,PS=/\d+(%|px|r?em|[sdl]?v([hwib]|min|max)|pt|pc|in|cm|mm|cap|ch|ex|r?lh|cq(w|h|i|b|min|max))|\b(calc|min|max|clamp)\(.+\)|^0$/,CS=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix)\(.+\)$/,RS=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,DS=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,rs=e=>TS.test(e),ae=e=>!!e&&!Number.isNaN(Number(e)),Ki=e=>!!e&&Number.isInteger(Number(e)),Ql=e=>e.endsWith("%")&&ae(e.slice(0,-1)),Pi=e=>AS.test(e),IS=()=>!0,LS=e=>PS.test(e)&&!CS.test(e),S0=()=>!1,NS=e=>RS.test(e),US=e=>DS.test(e),OS=e=>!Ot(e)&&!Ft(e),FS=e=>Zs(e,w0,S0),Ot=e=>x0.test(e),Ar=e=>Zs(e,E0,LS),jl=e=>Zs(e,HS,ae),Ad=e=>Zs(e,b0,S0),kS=e=>Zs(e,M0,US),ca=e=>Zs(e,T0,NS),Ft=e=>y0.test(e),io=e=>Ks(e,E0),BS=e=>Ks(e,GS),Pd=e=>Ks(e,b0),zS=e=>Ks(e,w0),VS=e=>Ks(e,M0),ua=e=>Ks(e,T0,!0),Zs=(e,t,n)=>{const i=x0.exec(e);return i?i[1]?t(i[1]):n(i[2]):!1},Ks=(e,t,n=!1)=>{const i=y0.exec(e);return i?i[1]?t(i[1]):n:!1},b0=e=>e==="position"||e==="percentage",M0=e=>e==="image"||e==="url",w0=e=>e==="length"||e==="size"||e==="bg-size",E0=e=>e==="length",HS=e=>e==="number",GS=e=>e==="family-name",T0=e=>e==="shadow",WS=()=>{const e=qe("color"),t=qe("font"),n=qe("text"),i=qe("font-weight"),r=qe("tracking"),s=qe("leading"),o=qe("breakpoint"),a=qe("container"),l=qe("spacing"),c=qe("radius"),u=qe("shadow"),h=qe("inset-shadow"),f=qe("text-shadow"),p=qe("drop-shadow"),g=qe("blur"),v=qe("perspective"),m=qe("aspect"),d=qe("ease"),S=qe("animate"),y=()=>["auto","avoid","all","avoid-page","page","left","right","column"],x=()=>["center","top","bottom","left","right","top-left","left-top","top-right","right-top","bottom-right","right-bottom","bottom-left","left-bottom"],A=()=>[...x(),Ft,Ot],P=()=>["auto","hidden","clip","visible","scroll"],C=()=>["auto","contain","none"],R=()=>[Ft,Ot,l],b=()=>[rs,"full","auto",...R()],M=()=>[Ki,"none","subgrid",Ft,Ot],L=()=>["auto",{span:["full",Ki,Ft,Ot]},Ki,Ft,Ot],V=()=>[Ki,"auto",Ft,Ot],q=()=>["auto","min","max","fr",Ft,Ot],j=()=>["start","end","center","between","around","evenly","stretch","baseline","center-safe","end-safe"],J=()=>["start","end","center","stretch","center-safe","end-safe"],W=()=>["auto",...R()],k=()=>[rs,"auto","full","dvw","dvh","lvw","lvh","svw","svh","min","max","fit",...R()],H=()=>[e,Ft,Ot],ct=()=>[...x(),Pd,Ad,{position:[Ft,Ot]}],pt=()=>["no-repeat",{repeat:["","x","y","space","round"]}],ft=()=>["auto","cover","contain",zS,FS,{size:[Ft,Ot]}],kt=()=>[Ql,io,Ar],Lt=()=>["","none","full",c,Ft,Ot],Zt=()=>["",ae,io,Ar],ue=()=>["solid","dashed","dotted","double"],st=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],ot=()=>[ae,Ql,Pd,Ad],Pt=()=>["","none",g,Ft,Ot],Vt=()=>["none",ae,Ft,Ot],Mt=()=>["none",ae,Ft,Ot],oe=()=>[ae,Ft,Ot],I=()=>[rs,"full",...R()];return{cacheSize:500,theme:{animate:["spin","ping","pulse","bounce"],aspect:["video"],blur:[Pi],breakpoint:[Pi],color:[IS],container:[Pi],"drop-shadow":[Pi],ease:["in","out","in-out"],font:[OS],"font-weight":["thin","extralight","light","normal","medium","semibold","bold","extrabold","black"],"inset-shadow":[Pi],leading:["none","tight","snug","normal","relaxed","loose"],perspective:["dramatic","near","normal","midrange","distant","none"],radius:[Pi],shadow:[Pi],spacing:["px",ae],text:[Pi],"text-shadow":[Pi],tracking:["tighter","tight","normal","wide","wider","widest"]},classGroups:{aspect:[{aspect:["auto","square",rs,Ot,Ft,m]}],container:["container"],columns:[{columns:[ae,Ot,Ft,a]}],"break-after":[{"break-after":y()}],"break-before":[{"break-before":y()}],"break-inside":[{"break-inside":["auto","avoid","avoid-page","avoid-column"]}],"box-decoration":[{"box-decoration":["slice","clone"]}],box:[{box:["border","content"]}],display:["block","inline-block","inline","flex","inline-flex","table","inline-table","table-caption","table-cell","table-column","table-column-group","table-footer-group","table-header-group","table-row-group","table-row","flow-root","grid","inline-grid","contents","list-item","hidden"],sr:["sr-only","not-sr-only"],float:[{float:["right","left","none","start","end"]}],clear:[{clear:["left","right","both","none","start","end"]}],isolation:["isolate","isolation-auto"],"object-fit":[{object:["contain","cover","fill","none","scale-down"]}],"object-position":[{object:A()}],overflow:[{overflow:P()}],"overflow-x":[{"overflow-x":P()}],"overflow-y":[{"overflow-y":P()}],overscroll:[{overscroll:C()}],"overscroll-x":[{"overscroll-x":C()}],"overscroll-y":[{"overscroll-y":C()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:b()}],"inset-x":[{"inset-x":b()}],"inset-y":[{"inset-y":b()}],start:[{start:b()}],end:[{end:b()}],top:[{top:b()}],right:[{right:b()}],bottom:[{bottom:b()}],left:[{left:b()}],visibility:["visible","invisible","collapse"],z:[{z:[Ki,"auto",Ft,Ot]}],basis:[{basis:[rs,"full","auto",a,...R()]}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["nowrap","wrap","wrap-reverse"]}],flex:[{flex:[ae,rs,"auto","initial","none",Ot]}],grow:[{grow:["",ae,Ft,Ot]}],shrink:[{shrink:["",ae,Ft,Ot]}],order:[{order:[Ki,"first","last","none",Ft,Ot]}],"grid-cols":[{"grid-cols":M()}],"col-start-end":[{col:L()}],"col-start":[{"col-start":V()}],"col-end":[{"col-end":V()}],"grid-rows":[{"grid-rows":M()}],"row-start-end":[{row:L()}],"row-start":[{"row-start":V()}],"row-end":[{"row-end":V()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":q()}],"auto-rows":[{"auto-rows":q()}],gap:[{gap:R()}],"gap-x":[{"gap-x":R()}],"gap-y":[{"gap-y":R()}],"justify-content":[{justify:[...j(),"normal"]}],"justify-items":[{"justify-items":[...J(),"normal"]}],"justify-self":[{"justify-self":["auto",...J()]}],"align-content":[{content:["normal",...j()]}],"align-items":[{items:[...J(),{baseline:["","last"]}]}],"align-self":[{self:["auto",...J(),{baseline:["","last"]}]}],"place-content":[{"place-content":j()}],"place-items":[{"place-items":[...J(),"baseline"]}],"place-self":[{"place-self":["auto",...J()]}],p:[{p:R()}],px:[{px:R()}],py:[{py:R()}],ps:[{ps:R()}],pe:[{pe:R()}],pt:[{pt:R()}],pr:[{pr:R()}],pb:[{pb:R()}],pl:[{pl:R()}],m:[{m:W()}],mx:[{mx:W()}],my:[{my:W()}],ms:[{ms:W()}],me:[{me:W()}],mt:[{mt:W()}],mr:[{mr:W()}],mb:[{mb:W()}],ml:[{ml:W()}],"space-x":[{"space-x":R()}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":R()}],"space-y-reverse":["space-y-reverse"],size:[{size:k()}],w:[{w:[a,"screen",...k()]}],"min-w":[{"min-w":[a,"screen","none",...k()]}],"max-w":[{"max-w":[a,"screen","none","prose",{screen:[o]},...k()]}],h:[{h:["screen","lh",...k()]}],"min-h":[{"min-h":["screen","lh","none",...k()]}],"max-h":[{"max-h":["screen","lh",...k()]}],"font-size":[{text:["base",n,io,Ar]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:[i,Ft,jl]}],"font-stretch":[{"font-stretch":["ultra-condensed","extra-condensed","condensed","semi-condensed","normal","semi-expanded","expanded","extra-expanded","ultra-expanded",Ql,Ot]}],"font-family":[{font:[BS,Ot,t]}],"fvn-normal":["normal-nums"],"fvn-ordinal":["ordinal"],"fvn-slashed-zero":["slashed-zero"],"fvn-figure":["lining-nums","oldstyle-nums"],"fvn-spacing":["proportional-nums","tabular-nums"],"fvn-fraction":["diagonal-fractions","stacked-fractions"],tracking:[{tracking:[r,Ft,Ot]}],"line-clamp":[{"line-clamp":[ae,"none",Ft,jl]}],leading:[{leading:[s,...R()]}],"list-image":[{"list-image":["none",Ft,Ot]}],"list-style-position":[{list:["inside","outside"]}],"list-style-type":[{list:["disc","decimal","none",Ft,Ot]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"placeholder-color":[{placeholder:H()}],"text-color":[{text:H()}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...ue(),"wavy"]}],"text-decoration-thickness":[{decoration:[ae,"from-font","auto",Ft,Ar]}],"text-decoration-color":[{decoration:H()}],"underline-offset":[{"underline-offset":[ae,"auto",Ft,Ot]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],"text-wrap":[{text:["wrap","nowrap","balance","pretty"]}],indent:[{indent:R()}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",Ft,Ot]}],whitespace:[{whitespace:["normal","nowrap","pre","pre-line","pre-wrap","break-spaces"]}],break:[{break:["normal","words","all","keep"]}],wrap:[{wrap:["break-word","anywhere","normal"]}],hyphens:[{hyphens:["none","manual","auto"]}],content:[{content:["none",Ft,Ot]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:ct()}],"bg-repeat":[{bg:pt()}],"bg-size":[{bg:ft()}],"bg-image":[{bg:["none",{linear:[{to:["t","tr","r","br","b","bl","l","tl"]},Ki,Ft,Ot],radial:["",Ft,Ot],conic:[Ki,Ft,Ot]},VS,kS]}],"bg-color":[{bg:H()}],"gradient-from-pos":[{from:kt()}],"gradient-via-pos":[{via:kt()}],"gradient-to-pos":[{to:kt()}],"gradient-from":[{from:H()}],"gradient-via":[{via:H()}],"gradient-to":[{to:H()}],rounded:[{rounded:Lt()}],"rounded-s":[{"rounded-s":Lt()}],"rounded-e":[{"rounded-e":Lt()}],"rounded-t":[{"rounded-t":Lt()}],"rounded-r":[{"rounded-r":Lt()}],"rounded-b":[{"rounded-b":Lt()}],"rounded-l":[{"rounded-l":Lt()}],"rounded-ss":[{"rounded-ss":Lt()}],"rounded-se":[{"rounded-se":Lt()}],"rounded-ee":[{"rounded-ee":Lt()}],"rounded-es":[{"rounded-es":Lt()}],"rounded-tl":[{"rounded-tl":Lt()}],"rounded-tr":[{"rounded-tr":Lt()}],"rounded-br":[{"rounded-br":Lt()}],"rounded-bl":[{"rounded-bl":Lt()}],"border-w":[{border:Zt()}],"border-w-x":[{"border-x":Zt()}],"border-w-y":[{"border-y":Zt()}],"border-w-s":[{"border-s":Zt()}],"border-w-e":[{"border-e":Zt()}],"border-w-t":[{"border-t":Zt()}],"border-w-r":[{"border-r":Zt()}],"border-w-b":[{"border-b":Zt()}],"border-w-l":[{"border-l":Zt()}],"divide-x":[{"divide-x":Zt()}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":Zt()}],"divide-y-reverse":["divide-y-reverse"],"border-style":[{border:[...ue(),"hidden","none"]}],"divide-style":[{divide:[...ue(),"hidden","none"]}],"border-color":[{border:H()}],"border-color-x":[{"border-x":H()}],"border-color-y":[{"border-y":H()}],"border-color-s":[{"border-s":H()}],"border-color-e":[{"border-e":H()}],"border-color-t":[{"border-t":H()}],"border-color-r":[{"border-r":H()}],"border-color-b":[{"border-b":H()}],"border-color-l":[{"border-l":H()}],"divide-color":[{divide:H()}],"outline-style":[{outline:[...ue(),"none","hidden"]}],"outline-offset":[{"outline-offset":[ae,Ft,Ot]}],"outline-w":[{outline:["",ae,io,Ar]}],"outline-color":[{outline:H()}],shadow:[{shadow:["","none",u,ua,ca]}],"shadow-color":[{shadow:H()}],"inset-shadow":[{"inset-shadow":["none",h,ua,ca]}],"inset-shadow-color":[{"inset-shadow":H()}],"ring-w":[{ring:Zt()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:H()}],"ring-offset-w":[{"ring-offset":[ae,Ar]}],"ring-offset-color":[{"ring-offset":H()}],"inset-ring-w":[{"inset-ring":Zt()}],"inset-ring-color":[{"inset-ring":H()}],"text-shadow":[{"text-shadow":["none",f,ua,ca]}],"text-shadow-color":[{"text-shadow":H()}],opacity:[{opacity:[ae,Ft,Ot]}],"mix-blend":[{"mix-blend":[...st(),"plus-darker","plus-lighter"]}],"bg-blend":[{"bg-blend":st()}],"mask-clip":[{"mask-clip":["border","padding","content","fill","stroke","view"]},"mask-no-clip"],"mask-composite":[{mask:["add","subtract","intersect","exclude"]}],"mask-image-linear-pos":[{"mask-linear":[ae]}],"mask-image-linear-from-pos":[{"mask-linear-from":ot()}],"mask-image-linear-to-pos":[{"mask-linear-to":ot()}],"mask-image-linear-from-color":[{"mask-linear-from":H()}],"mask-image-linear-to-color":[{"mask-linear-to":H()}],"mask-image-t-from-pos":[{"mask-t-from":ot()}],"mask-image-t-to-pos":[{"mask-t-to":ot()}],"mask-image-t-from-color":[{"mask-t-from":H()}],"mask-image-t-to-color":[{"mask-t-to":H()}],"mask-image-r-from-pos":[{"mask-r-from":ot()}],"mask-image-r-to-pos":[{"mask-r-to":ot()}],"mask-image-r-from-color":[{"mask-r-from":H()}],"mask-image-r-to-color":[{"mask-r-to":H()}],"mask-image-b-from-pos":[{"mask-b-from":ot()}],"mask-image-b-to-pos":[{"mask-b-to":ot()}],"mask-image-b-from-color":[{"mask-b-from":H()}],"mask-image-b-to-color":[{"mask-b-to":H()}],"mask-image-l-from-pos":[{"mask-l-from":ot()}],"mask-image-l-to-pos":[{"mask-l-to":ot()}],"mask-image-l-from-color":[{"mask-l-from":H()}],"mask-image-l-to-color":[{"mask-l-to":H()}],"mask-image-x-from-pos":[{"mask-x-from":ot()}],"mask-image-x-to-pos":[{"mask-x-to":ot()}],"mask-image-x-from-color":[{"mask-x-from":H()}],"mask-image-x-to-color":[{"mask-x-to":H()}],"mask-image-y-from-pos":[{"mask-y-from":ot()}],"mask-image-y-to-pos":[{"mask-y-to":ot()}],"mask-image-y-from-color":[{"mask-y-from":H()}],"mask-image-y-to-color":[{"mask-y-to":H()}],"mask-image-radial":[{"mask-radial":[Ft,Ot]}],"mask-image-radial-from-pos":[{"mask-radial-from":ot()}],"mask-image-radial-to-pos":[{"mask-radial-to":ot()}],"mask-image-radial-from-color":[{"mask-radial-from":H()}],"mask-image-radial-to-color":[{"mask-radial-to":H()}],"mask-image-radial-shape":[{"mask-radial":["circle","ellipse"]}],"mask-image-radial-size":[{"mask-radial":[{closest:["side","corner"],farthest:["side","corner"]}]}],"mask-image-radial-pos":[{"mask-radial-at":x()}],"mask-image-conic-pos":[{"mask-conic":[ae]}],"mask-image-conic-from-pos":[{"mask-conic-from":ot()}],"mask-image-conic-to-pos":[{"mask-conic-to":ot()}],"mask-image-conic-from-color":[{"mask-conic-from":H()}],"mask-image-conic-to-color":[{"mask-conic-to":H()}],"mask-mode":[{mask:["alpha","luminance","match"]}],"mask-origin":[{"mask-origin":["border","padding","content","fill","stroke","view"]}],"mask-position":[{mask:ct()}],"mask-repeat":[{mask:pt()}],"mask-size":[{mask:ft()}],"mask-type":[{"mask-type":["alpha","luminance"]}],"mask-image":[{mask:["none",Ft,Ot]}],filter:[{filter:["","none",Ft,Ot]}],blur:[{blur:Pt()}],brightness:[{brightness:[ae,Ft,Ot]}],contrast:[{contrast:[ae,Ft,Ot]}],"drop-shadow":[{"drop-shadow":["","none",p,ua,ca]}],"drop-shadow-color":[{"drop-shadow":H()}],grayscale:[{grayscale:["",ae,Ft,Ot]}],"hue-rotate":[{"hue-rotate":[ae,Ft,Ot]}],invert:[{invert:["",ae,Ft,Ot]}],saturate:[{saturate:[ae,Ft,Ot]}],sepia:[{sepia:["",ae,Ft,Ot]}],"backdrop-filter":[{"backdrop-filter":["","none",Ft,Ot]}],"backdrop-blur":[{"backdrop-blur":Pt()}],"backdrop-brightness":[{"backdrop-brightness":[ae,Ft,Ot]}],"backdrop-contrast":[{"backdrop-contrast":[ae,Ft,Ot]}],"backdrop-grayscale":[{"backdrop-grayscale":["",ae,Ft,Ot]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[ae,Ft,Ot]}],"backdrop-invert":[{"backdrop-invert":["",ae,Ft,Ot]}],"backdrop-opacity":[{"backdrop-opacity":[ae,Ft,Ot]}],"backdrop-saturate":[{"backdrop-saturate":[ae,Ft,Ot]}],"backdrop-sepia":[{"backdrop-sepia":["",ae,Ft,Ot]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":R()}],"border-spacing-x":[{"border-spacing-x":R()}],"border-spacing-y":[{"border-spacing-y":R()}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["","all","colors","opacity","shadow","transform","none",Ft,Ot]}],"transition-behavior":[{transition:["normal","discrete"]}],duration:[{duration:[ae,"initial",Ft,Ot]}],ease:[{ease:["linear","initial",d,Ft,Ot]}],delay:[{delay:[ae,Ft,Ot]}],animate:[{animate:["none",S,Ft,Ot]}],backface:[{backface:["hidden","visible"]}],perspective:[{perspective:[v,Ft,Ot]}],"perspective-origin":[{"perspective-origin":A()}],rotate:[{rotate:Vt()}],"rotate-x":[{"rotate-x":Vt()}],"rotate-y":[{"rotate-y":Vt()}],"rotate-z":[{"rotate-z":Vt()}],scale:[{scale:Mt()}],"scale-x":[{"scale-x":Mt()}],"scale-y":[{"scale-y":Mt()}],"scale-z":[{"scale-z":Mt()}],"scale-3d":["scale-3d"],skew:[{skew:oe()}],"skew-x":[{"skew-x":oe()}],"skew-y":[{"skew-y":oe()}],transform:[{transform:[Ft,Ot,"","none","gpu","cpu"]}],"transform-origin":[{origin:A()}],"transform-style":[{transform:["3d","flat"]}],translate:[{translate:I()}],"translate-x":[{"translate-x":I()}],"translate-y":[{"translate-y":I()}],"translate-z":[{"translate-z":I()}],"translate-none":["translate-none"],accent:[{accent:H()}],appearance:[{appearance:["none","auto"]}],"caret-color":[{caret:H()}],"color-scheme":[{scheme:["normal","dark","light","light-dark","only-dark","only-light"]}],cursor:[{cursor:["auto","default","pointer","wait","text","move","help","not-allowed","none","context-menu","progress","cell","crosshair","vertical-text","alias","copy","no-drop","grab","grabbing","all-scroll","col-resize","row-resize","n-resize","e-resize","s-resize","w-resize","ne-resize","nw-resize","se-resize","sw-resize","ew-resize","ns-resize","nesw-resize","nwse-resize","zoom-in","zoom-out",Ft,Ot]}],"field-sizing":[{"field-sizing":["fixed","content"]}],"pointer-events":[{"pointer-events":["auto","none"]}],resize:[{resize:["none","","y","x"]}],"scroll-behavior":[{scroll:["auto","smooth"]}],"scroll-m":[{"scroll-m":R()}],"scroll-mx":[{"scroll-mx":R()}],"scroll-my":[{"scroll-my":R()}],"scroll-ms":[{"scroll-ms":R()}],"scroll-me":[{"scroll-me":R()}],"scroll-mt":[{"scroll-mt":R()}],"scroll-mr":[{"scroll-mr":R()}],"scroll-mb":[{"scroll-mb":R()}],"scroll-ml":[{"scroll-ml":R()}],"scroll-p":[{"scroll-p":R()}],"scroll-px":[{"scroll-px":R()}],"scroll-py":[{"scroll-py":R()}],"scroll-ps":[{"scroll-ps":R()}],"scroll-pe":[{"scroll-pe":R()}],"scroll-pt":[{"scroll-pt":R()}],"scroll-pr":[{"scroll-pr":R()}],"scroll-pb":[{"scroll-pb":R()}],"scroll-pl":[{"scroll-pl":R()}],"snap-align":[{snap:["start","end","center","align-none"]}],"snap-stop":[{snap:["normal","always"]}],"snap-type":[{snap:["none","x","y","both"]}],"snap-strictness":[{snap:["mandatory","proximity"]}],touch:[{touch:["auto","none","manipulation"]}],"touch-x":[{"touch-pan":["x","left","right"]}],"touch-y":[{"touch-pan":["y","up","down"]}],"touch-pz":["touch-pinch-zoom"],select:[{select:["none","text","all","auto"]}],"will-change":[{"will-change":["auto","scroll","contents","transform",Ft,Ot]}],fill:[{fill:["none",...H()]}],"stroke-w":[{stroke:[ae,io,Ar,jl]}],stroke:[{stroke:["none",...H()]}],"forced-color-adjust":[{"forced-color-adjust":["auto","none"]}]},conflictingClassGroups:{overflow:["overflow-x","overflow-y"],overscroll:["overscroll-x","overscroll-y"],inset:["inset-x","inset-y","start","end","top","right","bottom","left"],"inset-x":["right","left"],"inset-y":["top","bottom"],flex:["basis","grow","shrink"],gap:["gap-x","gap-y"],p:["px","py","ps","pe","pt","pr","pb","pl"],px:["pr","pl"],py:["pt","pb"],m:["mx","my","ms","me","mt","mr","mb","ml"],mx:["mr","ml"],my:["mt","mb"],size:["w","h"],"font-size":["leading"],"fvn-normal":["fvn-ordinal","fvn-slashed-zero","fvn-figure","fvn-spacing","fvn-fraction"],"fvn-ordinal":["fvn-normal"],"fvn-slashed-zero":["fvn-normal"],"fvn-figure":["fvn-normal"],"fvn-spacing":["fvn-normal"],"fvn-fraction":["fvn-normal"],"line-clamp":["display","overflow"],rounded:["rounded-s","rounded-e","rounded-t","rounded-r","rounded-b","rounded-l","rounded-ss","rounded-se","rounded-ee","rounded-es","rounded-tl","rounded-tr","rounded-br","rounded-bl"],"rounded-s":["rounded-ss","rounded-es"],"rounded-e":["rounded-se","rounded-ee"],"rounded-t":["rounded-tl","rounded-tr"],"rounded-r":["rounded-tr","rounded-br"],"rounded-b":["rounded-br","rounded-bl"],"rounded-l":["rounded-tl","rounded-bl"],"border-spacing":["border-spacing-x","border-spacing-y"],"border-w":["border-w-x","border-w-y","border-w-s","border-w-e","border-w-t","border-w-r","border-w-b","border-w-l"],"border-w-x":["border-w-r","border-w-l"],"border-w-y":["border-w-t","border-w-b"],"border-color":["border-color-x","border-color-y","border-color-s","border-color-e","border-color-t","border-color-r","border-color-b","border-color-l"],"border-color-x":["border-color-r","border-color-l"],"border-color-y":["border-color-t","border-color-b"],translate:["translate-x","translate-y","translate-none"],"translate-none":["translate","translate-x","translate-y","translate-z"],"scroll-m":["scroll-mx","scroll-my","scroll-ms","scroll-me","scroll-mt","scroll-mr","scroll-mb","scroll-ml"],"scroll-mx":["scroll-mr","scroll-ml"],"scroll-my":["scroll-mt","scroll-mb"],"scroll-p":["scroll-px","scroll-py","scroll-ps","scroll-pe","scroll-pt","scroll-pr","scroll-pb","scroll-pl"],"scroll-px":["scroll-pr","scroll-pl"],"scroll-py":["scroll-pt","scroll-pb"],touch:["touch-x","touch-y","touch-pz"],"touch-x":["touch"],"touch-y":["touch"],"touch-pz":["touch"]},conflictingClassGroupModifiers:{"font-size":["leading"]},orderSensitiveModifiers:["*","**","after","backdrop","before","details-content","file","first-letter","first-line","marker","placeholder","selection"]}},XS=wS(WS);function A0(...e){return XS(s0(e))}const Ja=Ze({__name:"Button",props:{variant:{},size:{},class:{},asChild:{type:Boolean},as:{default:"button"}},setup(e){const t=e;return(n,i)=>(ce(),Oe(vt(Js),{"data-slot":"button",as:e.as,"as-child":e.asChild,class:Us(vt(A0)(vt(qS)({variant:e.variant,size:e.size}),t.class))},{default:$e(()=>[wi(n.$slots,"default")]),_:3},8,["as","as-child","class"]))}}),qS=dy("inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-md text-sm font-medium transition-all disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg:not([class*='size-'])]:size-4 shrink-0 [&_svg]:shrink-0 outline-none focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px] aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive",{variants:{variant:{default:"bg-primary text-primary-foreground hover:bg-primary/90",destructive:"bg-destructive text-white hover:bg-destructive/90 focus-visible:ring-destructive/20 dark:focus-visible:ring-destructive/40 dark:bg-destructive/60",outline:"border bg-background shadow-xs hover:bg-accent hover:text-accent-foreground dark:bg-input/30 dark:border-input dark:hover:bg-input/50",secondary:"bg-secondary text-secondary-foreground hover:bg-secondary/80",ghost:"hover:bg-accent hover:text-accent-foreground dark:hover:bg-accent/50",link:"text-primary underline-offset-4 hover:underline"},size:{default:"h-9 px-4 py-2 has-[>svg]:px-3",sm:"h-8 rounded-md gap-1.5 px-3 has-[>svg]:px-2.5",lg:"h-10 rounded-md px-6 has-[>svg]:px-4",icon:"size-9","icon-sm":"size-8","icon-lg":"size-10"}},defaultVariants:{variant:"default",size:"default"}}),YS=Ze({__name:"Slider",props:{defaultValue:{},modelValue:{},disabled:{type:Boolean},orientation:{},dir:{},inverted:{type:Boolean},min:{},max:{},step:{},minStepsBetweenThumbs:{},thumbAlignment:{},asChild:{type:Boolean},as:{},name:{},required:{type:Boolean},class:{}},emits:["update:modelValue","valueCommit"],setup(e,{emit:t}){const n=e,i=t,r=vy(n,"class"),s=Ty(r,i);return(o,a)=>(ce(),Oe(vt(Jy),bi({"data-slot":"slider",class:vt(A0)("relative flex w-full touch-none items-center select-none data-[disabled]:opacity-50 data-[orientation=vertical]:h-full data-[orientation=vertical]:min-h-44 data-[orientation=vertical]:w-auto data-[orientation=vertical]:flex-col",n.class)},vt(s)),{default:$e(({modelValue:l})=>[Ge(vt(iS),{"data-slot":"slider-track",class:"bg-muted relative grow overflow-hidden rounded-full data-[orientation=horizontal]:h-1.5 data-[orientation=horizontal]:w-full data-[orientation=vertical]:h-full data-[orientation=vertical]:w-1.5"},{default:$e(()=>[Ge(vt(Ky),{"data-slot":"slider-range",class:"bg-primary absolute data-[orientation=horizontal]:h-full data-[orientation=vertical]:w-full"})]),_:1}),(ce(!0),Fn(Je,null,Rl(l,(c,u)=>(ce(),Oe(vt(eS),{key:u,"data-slot":"slider-thumb",class:"bg-white border-primary ring-ring/50 block size-4 shrink-0 rounded-full border shadow-sm transition-[color,box-shadow] hover:ring-4 focus-visible:ring-4 focus-visible:outline-hidden disabled:pointer-events-none disabled:opacity-50"}))),128))]),_:1},16,["class"]))}});function JS(){let e=0,t=0;for(let i=0;i<28;i+=7){let r=this.buf[this.pos++];if(e|=(r&127)<>4,(n&128)==0)return this.assertBounds(),[e,t];for(let i=3;i<=31;i+=7){let r=this.buf[this.pos++];if(t|=(r&127)<>>s,a=!(!(o>>>7)&&t==0),l=(a?o|128:o)&255;if(n.push(l),!a)return}const i=e>>>28&15|(t&7)<<4,r=t>>3!=0;if(n.push((r?i|128:i)&255),!!r){for(let s=3;s<31;s=s+7){const o=t>>>s,a=!!(o>>>7),l=(a?o|128:o)&255;if(n.push(l),!a)return}n.push(t>>>31&1)}}const $a=4294967296;function Cd(e){const t=e[0]==="-";t&&(e=e.slice(1));const n=1e6;let i=0,r=0;function s(o,a){const l=Number(e.slice(o,a));r*=n,i=i*n+l,i>=$a&&(r=r+(i/$a|0),i=i%$a)}return s(-24,-18),s(-18,-12),s(-12,-6),s(-6),t?C0(i,r):Lh(i,r)}function $S(e,t){let n=Lh(e,t);const i=n.hi&2147483648;i&&(n=C0(n.lo,n.hi));const r=P0(n.lo,n.hi);return i?"-"+r:r}function P0(e,t){if({lo:e,hi:t}=ZS(e,t),t<=2097151)return String($a*t+e);const n=e&16777215,i=(e>>>24|t<<8)&16777215,r=t>>16&65535;let s=n+i*6777216+r*6710656,o=i+r*8147497,a=r*2;const l=1e7;return s>=l&&(o+=Math.floor(s/l),s%=l),o>=l&&(a+=Math.floor(o/l),o%=l),a.toString()+Rd(o)+Rd(s)}function ZS(e,t){return{lo:e>>>0,hi:t>>>0}}function Lh(e,t){return{lo:e|0,hi:t|0}}function C0(e,t){return t=~t,e?e=~e+1:t+=1,Lh(e,t)}const Rd=e=>{const t=String(e);return"0000000".slice(t.length)+t};function Dd(e,t){if(e>=0){for(;e>127;)t.push(e&127|128),e=e>>>7;t.push(e)}else{for(let n=0;n<9;n++)t.push(e&127|128),e=e>>7;t.push(1)}}function KS(){let e=this.buf[this.pos++],t=e&127;if((e&128)==0)return this.assertBounds(),t;if(e=this.buf[this.pos++],t|=(e&127)<<7,(e&128)==0)return this.assertBounds(),t;if(e=this.buf[this.pos++],t|=(e&127)<<14,(e&128)==0)return this.assertBounds(),t;if(e=this.buf[this.pos++],t|=(e&127)<<21,(e&128)==0)return this.assertBounds(),t;e=this.buf[this.pos++],t|=(e&15)<<28;for(let n=5;(e&128)!==0&&n<10;n++)e=this.buf[this.pos++];if((e&128)!=0)throw new Error("invalid varint");return this.assertBounds(),t>>>0}var Id={};const pi=QS();function QS(){const e=new DataView(new ArrayBuffer(8));if(typeof BigInt=="function"&&typeof e.getBigInt64=="function"&&typeof e.getBigUint64=="function"&&typeof e.setBigInt64=="function"&&typeof e.setBigUint64=="function"&&(!!globalThis.Deno||typeof process!="object"||typeof Id!="object"||Id.BUF_BIGINT_DISABLE!=="1")){const n=BigInt("-9223372036854775808"),i=BigInt("9223372036854775807"),r=BigInt("0"),s=BigInt("18446744073709551615");return{zero:BigInt(0),supported:!0,parse(o){const a=typeof o=="bigint"?o:BigInt(o);if(a>i||as||a>>0)}raw(t){return this.buf.length&&(this.chunks.push(new Uint8Array(this.buf)),this.buf=[]),this.chunks.push(t),this}uint32(t){for(Ud(t);t>127;)this.buf.push(t&127|128),t=t>>>7;return this.buf.push(t),this}int32(t){return nc(t),Dd(t,this.buf),this}bool(t){return this.buf.push(t?1:0),this}bytes(t){return this.uint32(t.byteLength),this.raw(t)}string(t){let n=this.encodeUtf8(t);return this.uint32(n.byteLength),this.raw(n)}float(t){rb(t);let n=new Uint8Array(4);return new DataView(n.buffer).setFloat32(0,t,!0),this.raw(n)}double(t){let n=new Uint8Array(8);return new DataView(n.buffer).setFloat64(0,t,!0),this.raw(n)}fixed32(t){Ud(t);let n=new Uint8Array(4);return new DataView(n.buffer).setUint32(0,t,!0),this.raw(n)}sfixed32(t){nc(t);let n=new Uint8Array(4);return new DataView(n.buffer).setInt32(0,t,!0),this.raw(n)}sint32(t){return nc(t),t=(t<<1^t>>31)>>>0,Dd(t,this.buf),this}sfixed64(t){let n=new Uint8Array(8),i=new DataView(n.buffer),r=pi.enc(t);return i.setInt32(0,r.lo,!0),i.setInt32(4,r.hi,!0),this.raw(n)}fixed64(t){let n=new Uint8Array(8),i=new DataView(n.buffer),r=pi.uEnc(t);return i.setInt32(0,r.lo,!0),i.setInt32(4,r.hi,!0),this.raw(n)}int64(t){let n=pi.enc(t);return tc(n.lo,n.hi,this.buf),this}sint64(t){const n=pi.enc(t),i=n.hi>>31,r=n.lo<<1^i,s=(n.hi<<1|n.lo>>>31)^i;return tc(r,s,this.buf),this}uint64(t){const n=pi.uEnc(t);return tc(n.lo,n.hi,this.buf),this}}class xt{constructor(t,n=R0().decodeUtf8){this.decodeUtf8=n,this.varint64=JS,this.uint32=KS,this.buf=t,this.len=t.length,this.pos=0,this.view=new DataView(t.buffer,t.byteOffset,t.byteLength)}tag(){let t=this.uint32(),n=t>>>3,i=t&7;if(n<=0||i<0||i>5)throw new Error("illegal tag: field no "+n+" wire type "+i);return[n,i]}skip(t,n){let i=this.pos;switch(t){case ar.Varint:for(;this.buf[this.pos++]&128;);break;case ar.Bit64:this.pos+=4;case ar.Bit32:this.pos+=4;break;case ar.LengthDelimited:let r=this.uint32();this.pos+=r;break;case ar.StartGroup:for(;;){const[s,o]=this.tag();if(o===ar.EndGroup){if(n!==void 0&&s!==n)throw new Error("invalid end group tag");break}this.skip(o,s)}break;default:throw new Error("cant skip wire type "+t)}return this.assertBounds(),this.buf.subarray(i,this.pos)}assertBounds(){if(this.pos>this.len)throw new RangeError("premature EOF")}int32(){return this.uint32()|0}sint32(){let t=this.uint32();return t>>>1^-(t&1)}int64(){return pi.dec(...this.varint64())}uint64(){return pi.uDec(...this.varint64())}sint64(){let[t,n]=this.varint64(),i=-(t&1);return t=(t>>>1|(n&1)<<31)^i,n=n>>>1^i,pi.dec(t,n)}bool(){let[t,n]=this.varint64();return t!==0||n!==0}fixed32(){return this.view.getUint32((this.pos+=4)-4,!0)}sfixed32(){return this.view.getInt32((this.pos+=4)-4,!0)}fixed64(){return pi.uDec(this.sfixed32(),this.sfixed32())}sfixed64(){return pi.dec(this.sfixed32(),this.sfixed32())}float(){return this.view.getFloat32((this.pos+=4)-4,!0)}double(){return this.view.getFloat64((this.pos+=8)-8,!0)}bytes(){let t=this.uint32(),n=this.pos;return this.pos+=t,this.assertBounds(),this.buf.subarray(n,n+t)}string(){return this.decodeUtf8(this.bytes())}}function nc(e){if(typeof e=="string")e=Number(e);else if(typeof e!="number")throw new Error("invalid int32: "+typeof e);if(!Number.isInteger(e)||e>nb||eeb||e<0)throw new Error("invalid uint32: "+e)}function rb(e){if(typeof e=="string"){const t=e;if(e=Number(e),Number.isNaN(e)&&t!=="NaN")throw new Error("invalid float32: "+t)}else if(typeof e!="number")throw new Error("invalid float32: "+typeof e);if(Number.isFinite(e)&&(e>jS||e>>3){case 1:{if(s!==10)break;r.typeUrl=n.string();continue}case 2:{if(s!==18)break;r.value=n.bytes();continue}}if((s&7)===4||s===0)break;n.skip(s&7)}return r},fromJSON(e){return{typeUrl:ic(e.typeUrl)?globalThis.String(e.typeUrl):ic(e.type_url)?globalThis.String(e.type_url):"",value:ic(e.value)?sb(e.value):new Uint8Array(0)}},toJSON(e){const t={};return e.typeUrl!==""&&(t.typeUrl=e.typeUrl),e.value.length!==0&&(t.value=ob(e.value)),t},create(e){return ys.fromPartial(e??{})},fromPartial(e){const t=Od();return t.typeUrl=e.typeUrl??"",t.value=e.value??new Uint8Array(0),t}};function sb(e){if(globalThis.Buffer)return Uint8Array.from(globalThis.Buffer.from(e,"base64"));{const t=globalThis.atob(e),n=new Uint8Array(t.length);for(let i=0;i{t.push(globalThis.String.fromCharCode(n))}),globalThis.btoa(t.join(""))}}function ic(e){return e!=null}function Fd(e){switch(e){case 0:case"NULL_VALUE":return 0;default:return-1}}function ab(e){return e===0?"NULL_VALUE":"UNRECOGNIZED"}function rc(){return{fields:{}}}const mo={encode(e,t=new ne){return globalThis.Object.entries(e.fields).forEach(([n,i])=>{i!==void 0&&su.encode({key:n,value:i},t.uint32(10).fork()).join()}),t},decode(e,t){const n=e instanceof xt?e:new xt(e),i=t===void 0?n.len:n.pos+t,r=rc();for(;n.pos>>3){case 1:{if(s!==10)break;const o=su.decode(n,n.uint32());o.value!==void 0&&(r.fields[o.key]=o.value);continue}}if((s&7)===4||s===0)break;n.skip(s&7)}return r},fromJSON(e){return{fields:ou(e.fields)?globalThis.Object.entries(e.fields).reduce((t,[n,i])=>(t[n]=i,t),{}):{}}},toJSON(e){const t={};if(e.fields){const n=globalThis.Object.entries(e.fields);n.length>0&&(t.fields={},n.forEach(([i,r])=>{t.fields[i]=r}))}return t},create(e){return mo.fromPartial(e??{})},fromPartial(e){const t=rc();return t.fields=globalThis.Object.entries(e.fields??{}).reduce((n,[i,r])=>(r!==void 0&&(n[i]=r),n),{}),t},wrap(e){const t=rc();if(e!==void 0)for(const n of globalThis.Object.keys(e))t.fields[n]=e[n];return t},unwrap(e){const t={};if(e.fields)for(const n of globalThis.Object.keys(e.fields))t[n]=e.fields[n];return t}};function kd(){return{key:"",value:void 0}}const su={encode(e,t=new ne){return e.key!==""&&t.uint32(10).string(e.key),e.value!==void 0&&zn.encode(zn.wrap(e.value),t.uint32(18).fork()).join(),t},decode(e,t){const n=e instanceof xt?e:new xt(e),i=t===void 0?n.len:n.pos+t,r=kd();for(;n.pos>>3){case 1:{if(s!==10)break;r.key=n.string();continue}case 2:{if(s!==18)break;r.value=zn.unwrap(zn.decode(n,n.uint32()));continue}}if((s&7)===4||s===0)break;n.skip(s&7)}return r},fromJSON(e){return{key:hi(e.key)?globalThis.String(e.key):"",value:hi(e?.value)?e.value:void 0}},toJSON(e){const t={};return e.key!==""&&(t.key=e.key),e.value!==void 0&&(t.value=e.value),t},create(e){return su.fromPartial(e??{})},fromPartial(e){const t=kd();return t.key=e.key??"",t.value=e.value??void 0,t}};function sc(){return{nullValue:void 0,numberValue:void 0,stringValue:void 0,boolValue:void 0,structValue:void 0,listValue:void 0}}const zn={encode(e,t=new ne){return e.nullValue!==void 0&&t.uint32(8).int32(e.nullValue),e.numberValue!==void 0&&t.uint32(17).double(e.numberValue),e.stringValue!==void 0&&t.uint32(26).string(e.stringValue),e.boolValue!==void 0&&t.uint32(32).bool(e.boolValue),e.structValue!==void 0&&mo.encode(mo.wrap(e.structValue),t.uint32(42).fork()).join(),e.listValue!==void 0&&go.encode(go.wrap(e.listValue),t.uint32(50).fork()).join(),t},decode(e,t){const n=e instanceof xt?e:new xt(e),i=t===void 0?n.len:n.pos+t,r=sc();for(;n.pos>>3){case 1:{if(s!==8)break;r.nullValue=n.int32();continue}case 2:{if(s!==17)break;r.numberValue=n.double();continue}case 3:{if(s!==26)break;r.stringValue=n.string();continue}case 4:{if(s!==32)break;r.boolValue=n.bool();continue}case 5:{if(s!==42)break;r.structValue=mo.unwrap(mo.decode(n,n.uint32()));continue}case 6:{if(s!==50)break;r.listValue=go.unwrap(go.decode(n,n.uint32()));continue}}if((s&7)===4||s===0)break;n.skip(s&7)}return r},fromJSON(e){return{nullValue:hi(e.nullValue)?Fd(e.nullValue):hi(e.null_value)?Fd(e.null_value):void 0,numberValue:hi(e.numberValue)?globalThis.Number(e.numberValue):hi(e.number_value)?globalThis.Number(e.number_value):void 0,stringValue:hi(e.stringValue)?globalThis.String(e.stringValue):hi(e.string_value)?globalThis.String(e.string_value):void 0,boolValue:hi(e.boolValue)?globalThis.Boolean(e.boolValue):hi(e.bool_value)?globalThis.Boolean(e.bool_value):void 0,structValue:ou(e.structValue)?e.structValue:ou(e.struct_value)?e.struct_value:void 0,listValue:globalThis.Array.isArray(e.listValue)?[...e.listValue]:globalThis.Array.isArray(e.list_value)?[...e.list_value]:void 0}},toJSON(e){const t={};return e.nullValue!==void 0&&(t.nullValue=ab(e.nullValue)),e.numberValue!==void 0&&(t.numberValue=e.numberValue),e.stringValue!==void 0&&(t.stringValue=e.stringValue),e.boolValue!==void 0&&(t.boolValue=e.boolValue),e.structValue!==void 0&&(t.structValue=e.structValue),e.listValue!==void 0&&(t.listValue=e.listValue),t},create(e){return zn.fromPartial(e??{})},fromPartial(e){const t=sc();return t.nullValue=e.nullValue??void 0,t.numberValue=e.numberValue??void 0,t.stringValue=e.stringValue??void 0,t.boolValue=e.boolValue??void 0,t.structValue=e.structValue??void 0,t.listValue=e.listValue??void 0,t},wrap(e){const t=sc();if(e===null)t.nullValue=0;else if(typeof e=="boolean")t.boolValue=e;else if(typeof e=="number")t.numberValue=e;else if(typeof e=="string")t.stringValue=e;else if(globalThis.Array.isArray(e))t.listValue=e;else if(typeof e=="object")t.structValue=e;else if(typeof e<"u")throw new globalThis.Error("Unsupported any value type: "+typeof e);return t},unwrap(e){if(e.stringValue!==void 0)return e.stringValue;if(e?.numberValue!==void 0)return e.numberValue;if(e?.boolValue!==void 0)return e.boolValue;if(e?.structValue!==void 0)return e.structValue;if(e?.listValue!==void 0)return e.listValue;if(e?.nullValue!==void 0)return null}};function oc(){return{values:[]}}const go={encode(e,t=new ne){for(const n of e.values)zn.encode(zn.wrap(n),t.uint32(10).fork()).join();return t},decode(e,t){const n=e instanceof xt?e:new xt(e),i=t===void 0?n.len:n.pos+t,r=oc();for(;n.pos>>3){case 1:{if(s!==10)break;r.values.push(zn.unwrap(zn.decode(n,n.uint32())));continue}}if((s&7)===4||s===0)break;n.skip(s&7)}return r},fromJSON(e){return{values:globalThis.Array.isArray(e?.values)?[...e.values]:[]}},toJSON(e){const t={};return e.values?.length&&(t.values=e.values),t},create(e){return go.fromPartial(e??{})},fromPartial(e){const t=oc();return t.values=e.values?.map(n=>n)||[],t},wrap(e){const t=oc();return t.values=e??[],t},unwrap(e){return e?.hasOwnProperty("values")&&globalThis.Array.isArray(e.values)?e.values:e}};function ou(e){return typeof e=="object"&&e!==null}function hi(e){return e!=null}function Bd(){return{message:void 0,value:void 0,fallback:void 0}}const Cn={encode(e,t=new ne){return e.message!==void 0&&ys.encode(e.message,t.uint32(10).fork()).join(),e.value!==void 0&&zn.encode(zn.wrap(e.value),t.uint32(18).fork()).join(),e.fallback!==void 0&&Ss.encode(e.fallback,t.uint32(26).fork()).join(),t},decode(e,t){const n=e instanceof xt?e:new xt(e),i=t===void 0?n.len:n.pos+t,r=Bd();for(;n.pos>>3){case 1:{if(s!==10)break;r.message=ys.decode(n,n.uint32());continue}case 2:{if(s!==18)break;r.value=zn.unwrap(zn.decode(n,n.uint32()));continue}case 3:{if(s!==26)break;r.fallback=Ss.decode(n,n.uint32());continue}}if((s&7)===4||s===0)break;n.skip(s&7)}return r},fromJSON(e){return{message:vr(e.message)?ys.fromJSON(e.message):void 0,value:vr(e?.value)?e.value:void 0,fallback:vr(e.fallback)?Ss.fromJSON(e.fallback):void 0}},toJSON(e){const t={};return e.message!==void 0&&(t.message=ys.toJSON(e.message)),e.value!==void 0&&(t.value=e.value),e.fallback!==void 0&&(t.fallback=Ss.toJSON(e.fallback)),t},create(e){return Cn.fromPartial(e??{})},fromPartial(e){const t=Bd();return t.message=e.message!==void 0&&e.message!==null?ys.fromPartial(e.message):void 0,t.value=e.value??void 0,t.fallback=e.fallback!==void 0&&e.fallback!==null?Ss.fromPartial(e.fallback):void 0,t}};function zd(){return{data:void 0}}const Ss={encode(e,t=new ne){return e.data!==void 0&&cr.encode(e.data,t.uint32(10).fork()).join(),t},decode(e,t){const n=e instanceof xt?e:new xt(e),i=t===void 0?n.len:n.pos+t,r=zd();for(;n.pos>>3){case 1:{if(s!==10)break;r.data=cr.decode(n,n.uint32());continue}}if((s&7)===4||s===0)break;n.skip(s&7)}return r},fromJSON(e){return{data:vr(e.data)?cr.fromJSON(e.data):void 0}},toJSON(e){const t={};return e.data!==void 0&&(t.data=cr.toJSON(e.data)),t},create(e){return Ss.fromPartial(e??{})},fromPartial(e){const t=zd();return t.data=e.data!==void 0&&e.data!==null?cr.fromPartial(e.data):void 0,t}};function Vd(){return{items:{}}}const cr={encode(e,t=new ne){return globalThis.Object.entries(e.items).forEach(([n,i])=>{au.encode({key:n,value:i},t.uint32(10).fork()).join()}),t},decode(e,t){const n=e instanceof xt?e:new xt(e),i=t===void 0?n.len:n.pos+t,r=Vd();for(;n.pos>>3){case 1:{if(s!==10)break;const o=au.decode(n,n.uint32());o.value!==void 0&&(r.items[o.key]=o.value);continue}}if((s&7)===4||s===0)break;n.skip(s&7)}return r},fromJSON(e){return{items:lb(e.items)?globalThis.Object.entries(e.items).reduce((t,[n,i])=>(t[n]=Cn.fromJSON(i),t),{}):{}}},toJSON(e){const t={};if(e.items){const n=globalThis.Object.entries(e.items);n.length>0&&(t.items={},n.forEach(([i,r])=>{t.items[i]=Cn.toJSON(r)}))}return t},create(e){return cr.fromPartial(e??{})},fromPartial(e){const t=Vd();return t.items=globalThis.Object.entries(e.items??{}).reduce((n,[i,r])=>(r!==void 0&&(n[i]=Cn.fromPartial(r)),n),{}),t}};function Hd(){return{key:"",value:void 0}}const au={encode(e,t=new ne){return e.key!==""&&t.uint32(10).string(e.key),e.value!==void 0&&Cn.encode(e.value,t.uint32(18).fork()).join(),t},decode(e,t){const n=e instanceof xt?e:new xt(e),i=t===void 0?n.len:n.pos+t,r=Hd();for(;n.pos>>3){case 1:{if(s!==10)break;r.key=n.string();continue}case 2:{if(s!==18)break;r.value=Cn.decode(n,n.uint32());continue}}if((s&7)===4||s===0)break;n.skip(s&7)}return r},fromJSON(e){return{key:vr(e.key)?globalThis.String(e.key):"",value:vr(e.value)?Cn.fromJSON(e.value):void 0}},toJSON(e){const t={};return e.key!==""&&(t.key=e.key),e.value!==void 0&&(t.value=Cn.toJSON(e.value)),t},create(e){return au.fromPartial(e??{})},fromPartial(e){const t=Hd();return t.key=e.key??"",t.value=e.value!==void 0&&e.value!==null?Cn.fromPartial(e.value):void 0,t}};function Gd(){return{data:void 0,version:void 0}}const D0={encode(e,t=new ne){return e.data!==void 0&&Cn.encode(e.data,t.uint32(10).fork()).join(),e.version!==void 0&&t.uint32(18).string(e.version),t},decode(e,t){const n=e instanceof xt?e:new xt(e),i=t===void 0?n.len:n.pos+t,r=Gd();for(;n.pos>>3){case 1:{if(s!==10)break;r.data=Cn.decode(n,n.uint32());continue}case 2:{if(s!==18)break;r.version=n.string();continue}}if((s&7)===4||s===0)break;n.skip(s&7)}return r},fromJSON(e){return{data:vr(e.data)?Cn.fromJSON(e.data):void 0,version:vr(e.version)?globalThis.String(e.version):void 0}},toJSON(e){const t={};return e.data!==void 0&&(t.data=Cn.toJSON(e.data)),e.version!==void 0&&(t.version=e.version),t},create(e){return D0.fromPartial(e??{})},fromPartial(e){const t=Gd();return t.data=e.data!==void 0&&e.data!==null?Cn.fromPartial(e.data):void 0,t.version=e.version??void 0,t}};function lb(e){return typeof e=="object"&&e!==null}function vr(e){return e!=null}function Wd(){return{guid:"",name:"",x:0,y:0,z:0}}const Ht={encode(e,t=new ne){return e.guid!==""&&t.uint32(10).string(e.guid),e.name!==""&&t.uint32(18).string(e.name),e.x!==0&&t.uint32(29).float(e.x),e.y!==0&&t.uint32(37).float(e.y),e.z!==0&&t.uint32(45).float(e.z),t},decode(e,t){const n=e instanceof xt?e:new xt(e),i=t===void 0?n.len:n.pos+t,r=Wd();for(;n.pos>>3){case 1:{if(s!==10)break;r.guid=n.string();continue}case 2:{if(s!==18)break;r.name=n.string();continue}case 3:{if(s!==29)break;r.x=n.float();continue}case 4:{if(s!==37)break;r.y=n.float();continue}case 5:{if(s!==45)break;r.z=n.float();continue}}if((s&7)===4||s===0)break;n.skip(s&7)}return r},fromJSON(e){return{guid:at(e.guid)?globalThis.String(e.guid):"",name:at(e.name)?globalThis.String(e.name):"",x:at(e.x)?globalThis.Number(e.x):0,y:at(e.y)?globalThis.Number(e.y):0,z:at(e.z)?globalThis.Number(e.z):0}},toJSON(e){const t={};return e.guid!==""&&(t.guid=e.guid),e.name!==""&&(t.name=e.name),e.x!==0&&(t.x=e.x),e.y!==0&&(t.y=e.y),e.z!==0&&(t.z=e.z),t},create(e){return Ht.fromPartial(e??{})},fromPartial(e){const t=Wd();return t.guid=e.guid??"",t.name=e.name??"",t.x=e.x??0,t.y=e.y??0,t.z=e.z??0,t}};function Xd(){return{guid:"",name:"",x:0,y:0,z:0}}const Me={encode(e,t=new ne){return e.guid!==""&&t.uint32(10).string(e.guid),e.name!==""&&t.uint32(18).string(e.name),e.x!==0&&t.uint32(29).float(e.x),e.y!==0&&t.uint32(37).float(e.y),e.z!==0&&t.uint32(45).float(e.z),t},decode(e,t){const n=e instanceof xt?e:new xt(e),i=t===void 0?n.len:n.pos+t,r=Xd();for(;n.pos>>3){case 1:{if(s!==10)break;r.guid=n.string();continue}case 2:{if(s!==18)break;r.name=n.string();continue}case 3:{if(s!==29)break;r.x=n.float();continue}case 4:{if(s!==37)break;r.y=n.float();continue}case 5:{if(s!==45)break;r.z=n.float();continue}}if((s&7)===4||s===0)break;n.skip(s&7)}return r},fromJSON(e){return{guid:at(e.guid)?globalThis.String(e.guid):"",name:at(e.name)?globalThis.String(e.name):"",x:at(e.x)?globalThis.Number(e.x):0,y:at(e.y)?globalThis.Number(e.y):0,z:at(e.z)?globalThis.Number(e.z):0}},toJSON(e){const t={};return e.guid!==""&&(t.guid=e.guid),e.name!==""&&(t.name=e.name),e.x!==0&&(t.x=e.x),e.y!==0&&(t.y=e.y),e.z!==0&&(t.z=e.z),t},create(e){return Me.fromPartial(e??{})},fromPartial(e){const t=Xd();return t.guid=e.guid??"",t.name=e.name??"",t.x=e.x??0,t.y=e.y??0,t.z=e.z??0,t}};function qd(){return{guid:"",name:"",point:void 0,xaxis:void 0,yaxis:void 0}}const Wt={encode(e,t=new ne){return e.guid!==""&&t.uint32(10).string(e.guid),e.name!==""&&t.uint32(18).string(e.name),e.point!==void 0&&Ht.encode(e.point,t.uint32(26).fork()).join(),e.xaxis!==void 0&&Me.encode(e.xaxis,t.uint32(34).fork()).join(),e.yaxis!==void 0&&Me.encode(e.yaxis,t.uint32(42).fork()).join(),t},decode(e,t){const n=e instanceof xt?e:new xt(e),i=t===void 0?n.len:n.pos+t,r=qd();for(;n.pos>>3){case 1:{if(s!==10)break;r.guid=n.string();continue}case 2:{if(s!==18)break;r.name=n.string();continue}case 3:{if(s!==26)break;r.point=Ht.decode(n,n.uint32());continue}case 4:{if(s!==34)break;r.xaxis=Me.decode(n,n.uint32());continue}case 5:{if(s!==42)break;r.yaxis=Me.decode(n,n.uint32());continue}}if((s&7)===4||s===0)break;n.skip(s&7)}return r},fromJSON(e){return{guid:at(e.guid)?globalThis.String(e.guid):"",name:at(e.name)?globalThis.String(e.name):"",point:at(e.point)?Ht.fromJSON(e.point):void 0,xaxis:at(e.xaxis)?Me.fromJSON(e.xaxis):void 0,yaxis:at(e.yaxis)?Me.fromJSON(e.yaxis):void 0}},toJSON(e){const t={};return e.guid!==""&&(t.guid=e.guid),e.name!==""&&(t.name=e.name),e.point!==void 0&&(t.point=Ht.toJSON(e.point)),e.xaxis!==void 0&&(t.xaxis=Me.toJSON(e.xaxis)),e.yaxis!==void 0&&(t.yaxis=Me.toJSON(e.yaxis)),t},create(e){return Wt.fromPartial(e??{})},fromPartial(e){const t=qd();return t.guid=e.guid??"",t.name=e.name??"",t.point=e.point!==void 0&&e.point!==null?Ht.fromPartial(e.point):void 0,t.xaxis=e.xaxis!==void 0&&e.xaxis!==null?Me.fromPartial(e.xaxis):void 0,t.yaxis=e.yaxis!==void 0&&e.yaxis!==null?Me.fromPartial(e.yaxis):void 0,t}};function Yd(){return{guid:"",name:"",point:void 0,normal:void 0}}const Nh={encode(e,t=new ne){return e.guid!==""&&t.uint32(10).string(e.guid),e.name!==""&&t.uint32(18).string(e.name),e.point!==void 0&&Ht.encode(e.point,t.uint32(26).fork()).join(),e.normal!==void 0&&Me.encode(e.normal,t.uint32(34).fork()).join(),t},decode(e,t){const n=e instanceof xt?e:new xt(e),i=t===void 0?n.len:n.pos+t,r=Yd();for(;n.pos>>3){case 1:{if(s!==10)break;r.guid=n.string();continue}case 2:{if(s!==18)break;r.name=n.string();continue}case 3:{if(s!==26)break;r.point=Ht.decode(n,n.uint32());continue}case 4:{if(s!==34)break;r.normal=Me.decode(n,n.uint32());continue}}if((s&7)===4||s===0)break;n.skip(s&7)}return r},fromJSON(e){return{guid:at(e.guid)?globalThis.String(e.guid):"",name:at(e.name)?globalThis.String(e.name):"",point:at(e.point)?Ht.fromJSON(e.point):void 0,normal:at(e.normal)?Me.fromJSON(e.normal):void 0}},toJSON(e){const t={};return e.guid!==""&&(t.guid=e.guid),e.name!==""&&(t.name=e.name),e.point!==void 0&&(t.point=Ht.toJSON(e.point)),e.normal!==void 0&&(t.normal=Me.toJSON(e.normal)),t},create(e){return Nh.fromPartial(e??{})},fromPartial(e){const t=Yd();return t.guid=e.guid??"",t.name=e.name??"",t.point=e.point!==void 0&&e.point!==null?Ht.fromPartial(e.point):void 0,t.normal=e.normal!==void 0&&e.normal!==null?Me.fromPartial(e.normal):void 0,t}};function Jd(){return{guid:"",name:"",w:0,x:0,y:0,z:0}}const Uh={encode(e,t=new ne){return e.guid!==""&&t.uint32(10).string(e.guid),e.name!==""&&t.uint32(18).string(e.name),e.w!==0&&t.uint32(29).float(e.w),e.x!==0&&t.uint32(37).float(e.x),e.y!==0&&t.uint32(45).float(e.y),e.z!==0&&t.uint32(53).float(e.z),t},decode(e,t){const n=e instanceof xt?e:new xt(e),i=t===void 0?n.len:n.pos+t,r=Jd();for(;n.pos>>3){case 1:{if(s!==10)break;r.guid=n.string();continue}case 2:{if(s!==18)break;r.name=n.string();continue}case 3:{if(s!==29)break;r.w=n.float();continue}case 4:{if(s!==37)break;r.x=n.float();continue}case 5:{if(s!==45)break;r.y=n.float();continue}case 6:{if(s!==53)break;r.z=n.float();continue}}if((s&7)===4||s===0)break;n.skip(s&7)}return r},fromJSON(e){return{guid:at(e.guid)?globalThis.String(e.guid):"",name:at(e.name)?globalThis.String(e.name):"",w:at(e.w)?globalThis.Number(e.w):0,x:at(e.x)?globalThis.Number(e.x):0,y:at(e.y)?globalThis.Number(e.y):0,z:at(e.z)?globalThis.Number(e.z):0}},toJSON(e){const t={};return e.guid!==""&&(t.guid=e.guid),e.name!==""&&(t.name=e.name),e.w!==0&&(t.w=e.w),e.x!==0&&(t.x=e.x),e.y!==0&&(t.y=e.y),e.z!==0&&(t.z=e.z),t},create(e){return Uh.fromPartial(e??{})},fromPartial(e){const t=Jd();return t.guid=e.guid??"",t.name=e.name??"",t.w=e.w??0,t.x=e.x??0,t.y=e.y??0,t.z=e.z??0,t}};function $d(){return{guid:"",name:"",start:void 0,end:void 0}}const Oh={encode(e,t=new ne){return e.guid!==""&&t.uint32(10).string(e.guid),e.name!==""&&t.uint32(18).string(e.name),e.start!==void 0&&Ht.encode(e.start,t.uint32(26).fork()).join(),e.end!==void 0&&Ht.encode(e.end,t.uint32(34).fork()).join(),t},decode(e,t){const n=e instanceof xt?e:new xt(e),i=t===void 0?n.len:n.pos+t,r=$d();for(;n.pos>>3){case 1:{if(s!==10)break;r.guid=n.string();continue}case 2:{if(s!==18)break;r.name=n.string();continue}case 3:{if(s!==26)break;r.start=Ht.decode(n,n.uint32());continue}case 4:{if(s!==34)break;r.end=Ht.decode(n,n.uint32());continue}}if((s&7)===4||s===0)break;n.skip(s&7)}return r},fromJSON(e){return{guid:at(e.guid)?globalThis.String(e.guid):"",name:at(e.name)?globalThis.String(e.name):"",start:at(e.start)?Ht.fromJSON(e.start):void 0,end:at(e.end)?Ht.fromJSON(e.end):void 0}},toJSON(e){const t={};return e.guid!==""&&(t.guid=e.guid),e.name!==""&&(t.name=e.name),e.start!==void 0&&(t.start=Ht.toJSON(e.start)),e.end!==void 0&&(t.end=Ht.toJSON(e.end)),t},create(e){return Oh.fromPartial(e??{})},fromPartial(e){const t=$d();return t.guid=e.guid??"",t.name=e.name??"",t.start=e.start!==void 0&&e.start!==null?Ht.fromPartial(e.start):void 0,t.end=e.end!==void 0&&e.end!==null?Ht.fromPartial(e.end):void 0,t}};function Zd(){return{guid:"",name:"",radius:0,frame:void 0}}const ur={encode(e,t=new ne){return e.guid!==""&&t.uint32(10).string(e.guid),e.name!==""&&t.uint32(18).string(e.name),e.radius!==0&&t.uint32(29).float(e.radius),e.frame!==void 0&&Wt.encode(e.frame,t.uint32(34).fork()).join(),t},decode(e,t){const n=e instanceof xt?e:new xt(e),i=t===void 0?n.len:n.pos+t,r=Zd();for(;n.pos>>3){case 1:{if(s!==10)break;r.guid=n.string();continue}case 2:{if(s!==18)break;r.name=n.string();continue}case 3:{if(s!==29)break;r.radius=n.float();continue}case 4:{if(s!==34)break;r.frame=Wt.decode(n,n.uint32());continue}}if((s&7)===4||s===0)break;n.skip(s&7)}return r},fromJSON(e){return{guid:at(e.guid)?globalThis.String(e.guid):"",name:at(e.name)?globalThis.String(e.name):"",radius:at(e.radius)?globalThis.Number(e.radius):0,frame:at(e.frame)?Wt.fromJSON(e.frame):void 0}},toJSON(e){const t={};return e.guid!==""&&(t.guid=e.guid),e.name!==""&&(t.name=e.name),e.radius!==0&&(t.radius=e.radius),e.frame!==void 0&&(t.frame=Wt.toJSON(e.frame)),t},create(e){return ur.fromPartial(e??{})},fromPartial(e){const t=Zd();return t.guid=e.guid??"",t.name=e.name??"",t.radius=e.radius??0,t.frame=e.frame!==void 0&&e.frame!==null?Wt.fromPartial(e.frame):void 0,t}};function Kd(){return{guid:"",name:"",circle:void 0,startAngle:0,endAngle:0}}const Fh={encode(e,t=new ne){return e.guid!==""&&t.uint32(10).string(e.guid),e.name!==""&&t.uint32(18).string(e.name),e.circle!==void 0&&ur.encode(e.circle,t.uint32(26).fork()).join(),e.startAngle!==0&&t.uint32(37).float(e.startAngle),e.endAngle!==0&&t.uint32(45).float(e.endAngle),t},decode(e,t){const n=e instanceof xt?e:new xt(e),i=t===void 0?n.len:n.pos+t,r=Kd();for(;n.pos>>3){case 1:{if(s!==10)break;r.guid=n.string();continue}case 2:{if(s!==18)break;r.name=n.string();continue}case 3:{if(s!==26)break;r.circle=ur.decode(n,n.uint32());continue}case 4:{if(s!==37)break;r.startAngle=n.float();continue}case 5:{if(s!==45)break;r.endAngle=n.float();continue}}if((s&7)===4||s===0)break;n.skip(s&7)}return r},fromJSON(e){return{guid:at(e.guid)?globalThis.String(e.guid):"",name:at(e.name)?globalThis.String(e.name):"",circle:at(e.circle)?ur.fromJSON(e.circle):void 0,startAngle:at(e.startAngle)?globalThis.Number(e.startAngle):at(e.start_angle)?globalThis.Number(e.start_angle):0,endAngle:at(e.endAngle)?globalThis.Number(e.endAngle):at(e.end_angle)?globalThis.Number(e.end_angle):0}},toJSON(e){const t={};return e.guid!==""&&(t.guid=e.guid),e.name!==""&&(t.name=e.name),e.circle!==void 0&&(t.circle=ur.toJSON(e.circle)),e.startAngle!==0&&(t.startAngle=e.startAngle),e.endAngle!==0&&(t.endAngle=e.endAngle),t},create(e){return Fh.fromPartial(e??{})},fromPartial(e){const t=Kd();return t.guid=e.guid??"",t.name=e.name??"",t.circle=e.circle!==void 0&&e.circle!==null?ur.fromPartial(e.circle):void 0,t.startAngle=e.startAngle??0,t.endAngle=e.endAngle??0,t}};function Qd(){return{guid:"",name:"",major:0,minor:0,frame:void 0}}const kh={encode(e,t=new ne){return e.guid!==""&&t.uint32(10).string(e.guid),e.name!==""&&t.uint32(18).string(e.name),e.major!==0&&t.uint32(29).float(e.major),e.minor!==0&&t.uint32(37).float(e.minor),e.frame!==void 0&&Wt.encode(e.frame,t.uint32(42).fork()).join(),t},decode(e,t){const n=e instanceof xt?e:new xt(e),i=t===void 0?n.len:n.pos+t,r=Qd();for(;n.pos>>3){case 1:{if(s!==10)break;r.guid=n.string();continue}case 2:{if(s!==18)break;r.name=n.string();continue}case 3:{if(s!==29)break;r.major=n.float();continue}case 4:{if(s!==37)break;r.minor=n.float();continue}case 5:{if(s!==42)break;r.frame=Wt.decode(n,n.uint32());continue}}if((s&7)===4||s===0)break;n.skip(s&7)}return r},fromJSON(e){return{guid:at(e.guid)?globalThis.String(e.guid):"",name:at(e.name)?globalThis.String(e.name):"",major:at(e.major)?globalThis.Number(e.major):0,minor:at(e.minor)?globalThis.Number(e.minor):0,frame:at(e.frame)?Wt.fromJSON(e.frame):void 0}},toJSON(e){const t={};return e.guid!==""&&(t.guid=e.guid),e.name!==""&&(t.name=e.name),e.major!==0&&(t.major=e.major),e.minor!==0&&(t.minor=e.minor),e.frame!==void 0&&(t.frame=Wt.toJSON(e.frame)),t},create(e){return kh.fromPartial(e??{})},fromPartial(e){const t=Qd();return t.guid=e.guid??"",t.name=e.name??"",t.major=e.major??0,t.minor=e.minor??0,t.frame=e.frame!==void 0&&e.frame!==null?Wt.fromPartial(e.frame):void 0,t}};function jd(){return{guid:"",name:"",focal:0,frame:void 0}}const Bh={encode(e,t=new ne){return e.guid!==""&&t.uint32(10).string(e.guid),e.name!==""&&t.uint32(18).string(e.name),e.focal!==0&&t.uint32(29).float(e.focal),e.frame!==void 0&&Wt.encode(e.frame,t.uint32(34).fork()).join(),t},decode(e,t){const n=e instanceof xt?e:new xt(e),i=t===void 0?n.len:n.pos+t,r=jd();for(;n.pos>>3){case 1:{if(s!==10)break;r.guid=n.string();continue}case 2:{if(s!==18)break;r.name=n.string();continue}case 3:{if(s!==29)break;r.focal=n.float();continue}case 4:{if(s!==34)break;r.frame=Wt.decode(n,n.uint32());continue}}if((s&7)===4||s===0)break;n.skip(s&7)}return r},fromJSON(e){return{guid:at(e.guid)?globalThis.String(e.guid):"",name:at(e.name)?globalThis.String(e.name):"",focal:at(e.focal)?globalThis.Number(e.focal):0,frame:at(e.frame)?Wt.fromJSON(e.frame):void 0}},toJSON(e){const t={};return e.guid!==""&&(t.guid=e.guid),e.name!==""&&(t.name=e.name),e.focal!==0&&(t.focal=e.focal),e.frame!==void 0&&(t.frame=Wt.toJSON(e.frame)),t},create(e){return Bh.fromPartial(e??{})},fromPartial(e){const t=jd();return t.guid=e.guid??"",t.name=e.name??"",t.focal=e.focal??0,t.frame=e.frame!==void 0&&e.frame!==null?Wt.fromPartial(e.frame):void 0,t}};function tp(){return{guid:"",name:"",major:0,minor:0,frame:void 0}}const zh={encode(e,t=new ne){return e.guid!==""&&t.uint32(10).string(e.guid),e.name!==""&&t.uint32(18).string(e.name),e.major!==0&&t.uint32(29).float(e.major),e.minor!==0&&t.uint32(37).float(e.minor),e.frame!==void 0&&Wt.encode(e.frame,t.uint32(42).fork()).join(),t},decode(e,t){const n=e instanceof xt?e:new xt(e),i=t===void 0?n.len:n.pos+t,r=tp();for(;n.pos>>3){case 1:{if(s!==10)break;r.guid=n.string();continue}case 2:{if(s!==18)break;r.name=n.string();continue}case 3:{if(s!==29)break;r.major=n.float();continue}case 4:{if(s!==37)break;r.minor=n.float();continue}case 5:{if(s!==42)break;r.frame=Wt.decode(n,n.uint32());continue}}if((s&7)===4||s===0)break;n.skip(s&7)}return r},fromJSON(e){return{guid:at(e.guid)?globalThis.String(e.guid):"",name:at(e.name)?globalThis.String(e.name):"",major:at(e.major)?globalThis.Number(e.major):0,minor:at(e.minor)?globalThis.Number(e.minor):0,frame:at(e.frame)?Wt.fromJSON(e.frame):void 0}},toJSON(e){const t={};return e.guid!==""&&(t.guid=e.guid),e.name!==""&&(t.name=e.name),e.major!==0&&(t.major=e.major),e.minor!==0&&(t.minor=e.minor),e.frame!==void 0&&(t.frame=Wt.toJSON(e.frame)),t},create(e){return zh.fromPartial(e??{})},fromPartial(e){const t=tp();return t.guid=e.guid??"",t.name=e.name??"",t.major=e.major??0,t.minor=e.minor??0,t.frame=e.frame!==void 0&&e.frame!==null?Wt.fromPartial(e.frame):void 0,t}};function ep(){return{guid:"",name:"",points:[],degree:0}}const Vh={encode(e,t=new ne){e.guid!==""&&t.uint32(10).string(e.guid),e.name!==""&&t.uint32(18).string(e.name);for(const n of e.points)Ht.encode(n,t.uint32(26).fork()).join();return e.degree!==0&&t.uint32(32).int32(e.degree),t},decode(e,t){const n=e instanceof xt?e:new xt(e),i=t===void 0?n.len:n.pos+t,r=ep();for(;n.pos>>3){case 1:{if(s!==10)break;r.guid=n.string();continue}case 2:{if(s!==18)break;r.name=n.string();continue}case 3:{if(s!==26)break;r.points.push(Ht.decode(n,n.uint32()));continue}case 4:{if(s!==32)break;r.degree=n.int32();continue}}if((s&7)===4||s===0)break;n.skip(s&7)}return r},fromJSON(e){return{guid:at(e.guid)?globalThis.String(e.guid):"",name:at(e.name)?globalThis.String(e.name):"",points:globalThis.Array.isArray(e?.points)?e.points.map(t=>Ht.fromJSON(t)):[],degree:at(e.degree)?globalThis.Number(e.degree):0}},toJSON(e){const t={};return e.guid!==""&&(t.guid=e.guid),e.name!==""&&(t.name=e.name),e.points?.length&&(t.points=e.points.map(n=>Ht.toJSON(n))),e.degree!==0&&(t.degree=Math.round(e.degree)),t},create(e){return Vh.fromPartial(e??{})},fromPartial(e){const t=ep();return t.guid=e.guid??"",t.name=e.name??"",t.points=e.points?.map(n=>Ht.fromPartial(n))||[],t.degree=e.degree??0,t}};function np(){return{guid:"",name:"",points:[]}}const Hh={encode(e,t=new ne){e.guid!==""&&t.uint32(10).string(e.guid),e.name!==""&&t.uint32(18).string(e.name);for(const n of e.points)Ht.encode(n,t.uint32(26).fork()).join();return t},decode(e,t){const n=e instanceof xt?e:new xt(e),i=t===void 0?n.len:n.pos+t,r=np();for(;n.pos>>3){case 1:{if(s!==10)break;r.guid=n.string();continue}case 2:{if(s!==18)break;r.name=n.string();continue}case 3:{if(s!==26)break;r.points.push(Ht.decode(n,n.uint32()));continue}}if((s&7)===4||s===0)break;n.skip(s&7)}return r},fromJSON(e){return{guid:at(e.guid)?globalThis.String(e.guid):"",name:at(e.name)?globalThis.String(e.name):"",points:globalThis.Array.isArray(e?.points)?e.points.map(t=>Ht.fromJSON(t)):[]}},toJSON(e){const t={};return e.guid!==""&&(t.guid=e.guid),e.name!==""&&(t.name=e.name),e.points?.length&&(t.points=e.points.map(n=>Ht.toJSON(n))),t},create(e){return Hh.fromPartial(e??{})},fromPartial(e){const t=np();return t.guid=e.guid??"",t.name=e.name??"",t.points=e.points?.map(n=>Ht.fromPartial(n))||[],t}};function ip(){return{guid:"",name:"",points:[]}}const Gh={encode(e,t=new ne){e.guid!==""&&t.uint32(10).string(e.guid),e.name!==""&&t.uint32(18).string(e.name);for(const n of e.points)Ht.encode(n,t.uint32(26).fork()).join();return t},decode(e,t){const n=e instanceof xt?e:new xt(e),i=t===void 0?n.len:n.pos+t,r=ip();for(;n.pos>>3){case 1:{if(s!==10)break;r.guid=n.string();continue}case 2:{if(s!==18)break;r.name=n.string();continue}case 3:{if(s!==26)break;r.points.push(Ht.decode(n,n.uint32()));continue}}if((s&7)===4||s===0)break;n.skip(s&7)}return r},fromJSON(e){return{guid:at(e.guid)?globalThis.String(e.guid):"",name:at(e.name)?globalThis.String(e.name):"",points:globalThis.Array.isArray(e?.points)?e.points.map(t=>Ht.fromJSON(t)):[]}},toJSON(e){const t={};return e.guid!==""&&(t.guid=e.guid),e.name!==""&&(t.name=e.name),e.points?.length&&(t.points=e.points.map(n=>Ht.toJSON(n))),t},create(e){return Gh.fromPartial(e??{})},fromPartial(e){const t=ip();return t.guid=e.guid??"",t.name=e.name??"",t.points=e.points?.map(n=>Ht.fromPartial(n))||[],t}};function rp(){return{guid:"",name:"",frame:void 0,xsize:0,ysize:0,zsize:0}}const Wh={encode(e,t=new ne){return e.guid!==""&&t.uint32(10).string(e.guid),e.name!==""&&t.uint32(18).string(e.name),e.frame!==void 0&&Wt.encode(e.frame,t.uint32(26).fork()).join(),e.xsize!==0&&t.uint32(37).float(e.xsize),e.ysize!==0&&t.uint32(45).float(e.ysize),e.zsize!==0&&t.uint32(53).float(e.zsize),t},decode(e,t){const n=e instanceof xt?e:new xt(e),i=t===void 0?n.len:n.pos+t,r=rp();for(;n.pos>>3){case 1:{if(s!==10)break;r.guid=n.string();continue}case 2:{if(s!==18)break;r.name=n.string();continue}case 3:{if(s!==26)break;r.frame=Wt.decode(n,n.uint32());continue}case 4:{if(s!==37)break;r.xsize=n.float();continue}case 5:{if(s!==45)break;r.ysize=n.float();continue}case 6:{if(s!==53)break;r.zsize=n.float();continue}}if((s&7)===4||s===0)break;n.skip(s&7)}return r},fromJSON(e){return{guid:at(e.guid)?globalThis.String(e.guid):"",name:at(e.name)?globalThis.String(e.name):"",frame:at(e.frame)?Wt.fromJSON(e.frame):void 0,xsize:at(e.xsize)?globalThis.Number(e.xsize):0,ysize:at(e.ysize)?globalThis.Number(e.ysize):0,zsize:at(e.zsize)?globalThis.Number(e.zsize):0}},toJSON(e){const t={};return e.guid!==""&&(t.guid=e.guid),e.name!==""&&(t.name=e.name),e.frame!==void 0&&(t.frame=Wt.toJSON(e.frame)),e.xsize!==0&&(t.xsize=e.xsize),e.ysize!==0&&(t.ysize=e.ysize),e.zsize!==0&&(t.zsize=e.zsize),t},create(e){return Wh.fromPartial(e??{})},fromPartial(e){const t=rp();return t.guid=e.guid??"",t.name=e.name??"",t.frame=e.frame!==void 0&&e.frame!==null?Wt.fromPartial(e.frame):void 0,t.xsize=e.xsize??0,t.ysize=e.ysize??0,t.zsize=e.zsize??0,t}};function sp(){return{guid:"",name:"",radius:0,frame:void 0}}const Xh={encode(e,t=new ne){return e.guid!==""&&t.uint32(10).string(e.guid),e.name!==""&&t.uint32(18).string(e.name),e.radius!==0&&t.uint32(29).float(e.radius),e.frame!==void 0&&Wt.encode(e.frame,t.uint32(34).fork()).join(),t},decode(e,t){const n=e instanceof xt?e:new xt(e),i=t===void 0?n.len:n.pos+t,r=sp();for(;n.pos>>3){case 1:{if(s!==10)break;r.guid=n.string();continue}case 2:{if(s!==18)break;r.name=n.string();continue}case 3:{if(s!==29)break;r.radius=n.float();continue}case 4:{if(s!==34)break;r.frame=Wt.decode(n,n.uint32());continue}}if((s&7)===4||s===0)break;n.skip(s&7)}return r},fromJSON(e){return{guid:at(e.guid)?globalThis.String(e.guid):"",name:at(e.name)?globalThis.String(e.name):"",radius:at(e.radius)?globalThis.Number(e.radius):0,frame:at(e.frame)?Wt.fromJSON(e.frame):void 0}},toJSON(e){const t={};return e.guid!==""&&(t.guid=e.guid),e.name!==""&&(t.name=e.name),e.radius!==0&&(t.radius=e.radius),e.frame!==void 0&&(t.frame=Wt.toJSON(e.frame)),t},create(e){return Xh.fromPartial(e??{})},fromPartial(e){const t=sp();return t.guid=e.guid??"",t.name=e.name??"",t.radius=e.radius??0,t.frame=e.frame!==void 0&&e.frame!==null?Wt.fromPartial(e.frame):void 0,t}};function op(){return{guid:"",name:"",radius:0,height:0,frame:void 0}}const qh={encode(e,t=new ne){return e.guid!==""&&t.uint32(10).string(e.guid),e.name!==""&&t.uint32(18).string(e.name),e.radius!==0&&t.uint32(29).float(e.radius),e.height!==0&&t.uint32(37).float(e.height),e.frame!==void 0&&Wt.encode(e.frame,t.uint32(42).fork()).join(),t},decode(e,t){const n=e instanceof xt?e:new xt(e),i=t===void 0?n.len:n.pos+t,r=op();for(;n.pos>>3){case 1:{if(s!==10)break;r.guid=n.string();continue}case 2:{if(s!==18)break;r.name=n.string();continue}case 3:{if(s!==29)break;r.radius=n.float();continue}case 4:{if(s!==37)break;r.height=n.float();continue}case 5:{if(s!==42)break;r.frame=Wt.decode(n,n.uint32());continue}}if((s&7)===4||s===0)break;n.skip(s&7)}return r},fromJSON(e){return{guid:at(e.guid)?globalThis.String(e.guid):"",name:at(e.name)?globalThis.String(e.name):"",radius:at(e.radius)?globalThis.Number(e.radius):0,height:at(e.height)?globalThis.Number(e.height):0,frame:at(e.frame)?Wt.fromJSON(e.frame):void 0}},toJSON(e){const t={};return e.guid!==""&&(t.guid=e.guid),e.name!==""&&(t.name=e.name),e.radius!==0&&(t.radius=e.radius),e.height!==0&&(t.height=e.height),e.frame!==void 0&&(t.frame=Wt.toJSON(e.frame)),t},create(e){return qh.fromPartial(e??{})},fromPartial(e){const t=op();return t.guid=e.guid??"",t.name=e.name??"",t.radius=e.radius??0,t.height=e.height??0,t.frame=e.frame!==void 0&&e.frame!==null?Wt.fromPartial(e.frame):void 0,t}};function ap(){return{guid:"",name:"",radius:0,height:0,frame:void 0}}const Yh={encode(e,t=new ne){return e.guid!==""&&t.uint32(10).string(e.guid),e.name!==""&&t.uint32(18).string(e.name),e.radius!==0&&t.uint32(29).float(e.radius),e.height!==0&&t.uint32(37).float(e.height),e.frame!==void 0&&Wt.encode(e.frame,t.uint32(42).fork()).join(),t},decode(e,t){const n=e instanceof xt?e:new xt(e),i=t===void 0?n.len:n.pos+t,r=ap();for(;n.pos>>3){case 1:{if(s!==10)break;r.guid=n.string();continue}case 2:{if(s!==18)break;r.name=n.string();continue}case 3:{if(s!==29)break;r.radius=n.float();continue}case 4:{if(s!==37)break;r.height=n.float();continue}case 5:{if(s!==42)break;r.frame=Wt.decode(n,n.uint32());continue}}if((s&7)===4||s===0)break;n.skip(s&7)}return r},fromJSON(e){return{guid:at(e.guid)?globalThis.String(e.guid):"",name:at(e.name)?globalThis.String(e.name):"",radius:at(e.radius)?globalThis.Number(e.radius):0,height:at(e.height)?globalThis.Number(e.height):0,frame:at(e.frame)?Wt.fromJSON(e.frame):void 0}},toJSON(e){const t={};return e.guid!==""&&(t.guid=e.guid),e.name!==""&&(t.name=e.name),e.radius!==0&&(t.radius=e.radius),e.height!==0&&(t.height=e.height),e.frame!==void 0&&(t.frame=Wt.toJSON(e.frame)),t},create(e){return Yh.fromPartial(e??{})},fromPartial(e){const t=ap();return t.guid=e.guid??"",t.name=e.name??"",t.radius=e.radius??0,t.height=e.height??0,t.frame=e.frame!==void 0&&e.frame!==null?Wt.fromPartial(e.frame):void 0,t}};function lp(){return{guid:"",name:"",radius:0,height:0,frame:void 0}}const Jh={encode(e,t=new ne){return e.guid!==""&&t.uint32(10).string(e.guid),e.name!==""&&t.uint32(18).string(e.name),e.radius!==0&&t.uint32(29).float(e.radius),e.height!==0&&t.uint32(37).float(e.height),e.frame!==void 0&&Wt.encode(e.frame,t.uint32(42).fork()).join(),t},decode(e,t){const n=e instanceof xt?e:new xt(e),i=t===void 0?n.len:n.pos+t,r=lp();for(;n.pos>>3){case 1:{if(s!==10)break;r.guid=n.string();continue}case 2:{if(s!==18)break;r.name=n.string();continue}case 3:{if(s!==29)break;r.radius=n.float();continue}case 4:{if(s!==37)break;r.height=n.float();continue}case 5:{if(s!==42)break;r.frame=Wt.decode(n,n.uint32());continue}}if((s&7)===4||s===0)break;n.skip(s&7)}return r},fromJSON(e){return{guid:at(e.guid)?globalThis.String(e.guid):"",name:at(e.name)?globalThis.String(e.name):"",radius:at(e.radius)?globalThis.Number(e.radius):0,height:at(e.height)?globalThis.Number(e.height):0,frame:at(e.frame)?Wt.fromJSON(e.frame):void 0}},toJSON(e){const t={};return e.guid!==""&&(t.guid=e.guid),e.name!==""&&(t.name=e.name),e.radius!==0&&(t.radius=e.radius),e.height!==0&&(t.height=e.height),e.frame!==void 0&&(t.frame=Wt.toJSON(e.frame)),t},create(e){return Jh.fromPartial(e??{})},fromPartial(e){const t=lp();return t.guid=e.guid??"",t.name=e.name??"",t.radius=e.radius??0,t.height=e.height??0,t.frame=e.frame!==void 0&&e.frame!==null?Wt.fromPartial(e.frame):void 0,t}};function cp(){return{guid:"",name:"",radiusAxis:0,radiusPipe:0,frame:void 0}}const $h={encode(e,t=new ne){return e.guid!==""&&t.uint32(10).string(e.guid),e.name!==""&&t.uint32(18).string(e.name),e.radiusAxis!==0&&t.uint32(29).float(e.radiusAxis),e.radiusPipe!==0&&t.uint32(37).float(e.radiusPipe),e.frame!==void 0&&Wt.encode(e.frame,t.uint32(42).fork()).join(),t},decode(e,t){const n=e instanceof xt?e:new xt(e),i=t===void 0?n.len:n.pos+t,r=cp();for(;n.pos>>3){case 1:{if(s!==10)break;r.guid=n.string();continue}case 2:{if(s!==18)break;r.name=n.string();continue}case 3:{if(s!==29)break;r.radiusAxis=n.float();continue}case 4:{if(s!==37)break;r.radiusPipe=n.float();continue}case 5:{if(s!==42)break;r.frame=Wt.decode(n,n.uint32());continue}}if((s&7)===4||s===0)break;n.skip(s&7)}return r},fromJSON(e){return{guid:at(e.guid)?globalThis.String(e.guid):"",name:at(e.name)?globalThis.String(e.name):"",radiusAxis:at(e.radiusAxis)?globalThis.Number(e.radiusAxis):at(e.radius_axis)?globalThis.Number(e.radius_axis):0,radiusPipe:at(e.radiusPipe)?globalThis.Number(e.radiusPipe):at(e.radius_pipe)?globalThis.Number(e.radius_pipe):0,frame:at(e.frame)?Wt.fromJSON(e.frame):void 0}},toJSON(e){const t={};return e.guid!==""&&(t.guid=e.guid),e.name!==""&&(t.name=e.name),e.radiusAxis!==0&&(t.radiusAxis=e.radiusAxis),e.radiusPipe!==0&&(t.radiusPipe=e.radiusPipe),e.frame!==void 0&&(t.frame=Wt.toJSON(e.frame)),t},create(e){return $h.fromPartial(e??{})},fromPartial(e){const t=cp();return t.guid=e.guid??"",t.name=e.name??"",t.radiusAxis=e.radiusAxis??0,t.radiusPipe=e.radiusPipe??0,t.frame=e.frame!==void 0&&e.frame!==null?Wt.fromPartial(e.frame):void 0,t}};function up(){return{guid:"",name:"",points:[]}}const Zh={encode(e,t=new ne){e.guid!==""&&t.uint32(10).string(e.guid),e.name!==""&&t.uint32(18).string(e.name);for(const n of e.points)Ht.encode(n,t.uint32(26).fork()).join();return t},decode(e,t){const n=e instanceof xt?e:new xt(e),i=t===void 0?n.len:n.pos+t,r=up();for(;n.pos>>3){case 1:{if(s!==10)break;r.guid=n.string();continue}case 2:{if(s!==18)break;r.name=n.string();continue}case 3:{if(s!==26)break;r.points.push(Ht.decode(n,n.uint32()));continue}}if((s&7)===4||s===0)break;n.skip(s&7)}return r},fromJSON(e){return{guid:at(e.guid)?globalThis.String(e.guid):"",name:at(e.name)?globalThis.String(e.name):"",points:globalThis.Array.isArray(e?.points)?e.points.map(t=>Ht.fromJSON(t)):[]}},toJSON(e){const t={};return e.guid!==""&&(t.guid=e.guid),e.name!==""&&(t.name=e.name),e.points?.length&&(t.points=e.points.map(n=>Ht.toJSON(n))),t},create(e){return Zh.fromPartial(e??{})},fromPartial(e){const t=up();return t.guid=e.guid??"",t.name=e.name??"",t.points=e.points?.map(n=>Ht.fromPartial(n))||[],t}};function hp(){return{guid:"",name:"",matrix:[]}}const Kh={encode(e,t=new ne){e.guid!==""&&t.uint32(10).string(e.guid),e.name!==""&&t.uint32(18).string(e.name),t.uint32(26).fork();for(const n of e.matrix)t.float(n);return t.join(),t},decode(e,t){const n=e instanceof xt?e:new xt(e),i=t===void 0?n.len:n.pos+t,r=hp();for(;n.pos>>3){case 1:{if(s!==10)break;r.guid=n.string();continue}case 2:{if(s!==18)break;r.name=n.string();continue}case 3:{if(s===29){r.matrix.push(n.float());continue}if(s===26){const o=n.uint32()+n.pos;for(;n.posglobalThis.Number(t)):[]}},toJSON(e){const t={};return e.guid!==""&&(t.guid=e.guid),e.name!==""&&(t.name=e.name),e.matrix?.length&&(t.matrix=e.matrix),t},create(e){return Kh.fromPartial(e??{})},fromPartial(e){const t=hp();return t.guid=e.guid??"",t.name=e.name??"",t.matrix=e.matrix?.map(n=>n)||[],t}};function fp(){return{guid:"",name:"",translationVector:void 0}}const Qh={encode(e,t=new ne){return e.guid!==""&&t.uint32(10).string(e.guid),e.name!==""&&t.uint32(18).string(e.name),e.translationVector!==void 0&&Me.encode(e.translationVector,t.uint32(26).fork()).join(),t},decode(e,t){const n=e instanceof xt?e:new xt(e),i=t===void 0?n.len:n.pos+t,r=fp();for(;n.pos>>3){case 1:{if(s!==10)break;r.guid=n.string();continue}case 2:{if(s!==18)break;r.name=n.string();continue}case 3:{if(s!==26)break;r.translationVector=Me.decode(n,n.uint32());continue}}if((s&7)===4||s===0)break;n.skip(s&7)}return r},fromJSON(e){return{guid:at(e.guid)?globalThis.String(e.guid):"",name:at(e.name)?globalThis.String(e.name):"",translationVector:at(e.translationVector)?Me.fromJSON(e.translationVector):at(e.translation_vector)?Me.fromJSON(e.translation_vector):void 0}},toJSON(e){const t={};return e.guid!==""&&(t.guid=e.guid),e.name!==""&&(t.name=e.name),e.translationVector!==void 0&&(t.translationVector=Me.toJSON(e.translationVector)),t},create(e){return Qh.fromPartial(e??{})},fromPartial(e){const t=fp();return t.guid=e.guid??"",t.name=e.name??"",t.translationVector=e.translationVector!==void 0&&e.translationVector!==null?Me.fromPartial(e.translationVector):void 0,t}};function dp(){return{guid:"",name:"",axis:void 0,angle:0,point:void 0}}const jh={encode(e,t=new ne){return e.guid!==""&&t.uint32(10).string(e.guid),e.name!==""&&t.uint32(18).string(e.name),e.axis!==void 0&&Me.encode(e.axis,t.uint32(26).fork()).join(),e.angle!==0&&t.uint32(37).float(e.angle),e.point!==void 0&&Ht.encode(e.point,t.uint32(42).fork()).join(),t},decode(e,t){const n=e instanceof xt?e:new xt(e),i=t===void 0?n.len:n.pos+t,r=dp();for(;n.pos>>3){case 1:{if(s!==10)break;r.guid=n.string();continue}case 2:{if(s!==18)break;r.name=n.string();continue}case 3:{if(s!==26)break;r.axis=Me.decode(n,n.uint32());continue}case 4:{if(s!==37)break;r.angle=n.float();continue}case 5:{if(s!==42)break;r.point=Ht.decode(n,n.uint32());continue}}if((s&7)===4||s===0)break;n.skip(s&7)}return r},fromJSON(e){return{guid:at(e.guid)?globalThis.String(e.guid):"",name:at(e.name)?globalThis.String(e.name):"",axis:at(e.axis)?Me.fromJSON(e.axis):void 0,angle:at(e.angle)?globalThis.Number(e.angle):0,point:at(e.point)?Ht.fromJSON(e.point):void 0}},toJSON(e){const t={};return e.guid!==""&&(t.guid=e.guid),e.name!==""&&(t.name=e.name),e.axis!==void 0&&(t.axis=Me.toJSON(e.axis)),e.angle!==0&&(t.angle=e.angle),e.point!==void 0&&(t.point=Ht.toJSON(e.point)),t},create(e){return jh.fromPartial(e??{})},fromPartial(e){const t=dp();return t.guid=e.guid??"",t.name=e.name??"",t.axis=e.axis!==void 0&&e.axis!==null?Me.fromPartial(e.axis):void 0,t.angle=e.angle??0,t.point=e.point!==void 0&&e.point!==null?Ht.fromPartial(e.point):void 0,t}};function pp(){return{guid:"",name:"",matrix:[]}}const tf={encode(e,t=new ne){e.guid!==""&&t.uint32(10).string(e.guid),e.name!==""&&t.uint32(18).string(e.name),t.uint32(26).fork();for(const n of e.matrix)t.float(n);return t.join(),t},decode(e,t){const n=e instanceof xt?e:new xt(e),i=t===void 0?n.len:n.pos+t,r=pp();for(;n.pos>>3){case 1:{if(s!==10)break;r.guid=n.string();continue}case 2:{if(s!==18)break;r.name=n.string();continue}case 3:{if(s===29){r.matrix.push(n.float());continue}if(s===26){const o=n.uint32()+n.pos;for(;n.posglobalThis.Number(t)):[]}},toJSON(e){const t={};return e.guid!==""&&(t.guid=e.guid),e.name!==""&&(t.name=e.name),e.matrix?.length&&(t.matrix=e.matrix),t},create(e){return tf.fromPartial(e??{})},fromPartial(e){const t=pp();return t.guid=e.guid??"",t.name=e.name??"",t.matrix=e.matrix?.map(n=>n)||[],t}};function mp(){return{guid:"",name:"",matrix:[]}}const ef={encode(e,t=new ne){e.guid!==""&&t.uint32(10).string(e.guid),e.name!==""&&t.uint32(18).string(e.name),t.uint32(26).fork();for(const n of e.matrix)t.float(n);return t.join(),t},decode(e,t){const n=e instanceof xt?e:new xt(e),i=t===void 0?n.len:n.pos+t,r=mp();for(;n.pos>>3){case 1:{if(s!==10)break;r.guid=n.string();continue}case 2:{if(s!==18)break;r.name=n.string();continue}case 3:{if(s===29){r.matrix.push(n.float());continue}if(s===26){const o=n.uint32()+n.pos;for(;n.posglobalThis.Number(t)):[]}},toJSON(e){const t={};return e.guid!==""&&(t.guid=e.guid),e.name!==""&&(t.name=e.name),e.matrix?.length&&(t.matrix=e.matrix),t},create(e){return ef.fromPartial(e??{})},fromPartial(e){const t=mp();return t.guid=e.guid??"",t.name=e.name??"",t.matrix=e.matrix?.map(n=>n)||[],t}};function gp(){return{guid:"",name:"",matrix:[]}}const nf={encode(e,t=new ne){e.guid!==""&&t.uint32(10).string(e.guid),e.name!==""&&t.uint32(18).string(e.name),t.uint32(26).fork();for(const n of e.matrix)t.float(n);return t.join(),t},decode(e,t){const n=e instanceof xt?e:new xt(e),i=t===void 0?n.len:n.pos+t,r=gp();for(;n.pos>>3){case 1:{if(s!==10)break;r.guid=n.string();continue}case 2:{if(s!==18)break;r.name=n.string();continue}case 3:{if(s===29){r.matrix.push(n.float());continue}if(s===26){const o=n.uint32()+n.pos;for(;n.posglobalThis.Number(t)):[]}},toJSON(e){const t={};return e.guid!==""&&(t.guid=e.guid),e.name!==""&&(t.name=e.name),e.matrix?.length&&(t.matrix=e.matrix),t},create(e){return nf.fromPartial(e??{})},fromPartial(e){const t=gp();return t.guid=e.guid??"",t.name=e.name??"",t.matrix=e.matrix?.map(n=>n)||[],t}};function _p(){return{guid:"",name:"",matrix:[]}}const rf={encode(e,t=new ne){e.guid!==""&&t.uint32(10).string(e.guid),e.name!==""&&t.uint32(18).string(e.name),t.uint32(26).fork();for(const n of e.matrix)t.float(n);return t.join(),t},decode(e,t){const n=e instanceof xt?e:new xt(e),i=t===void 0?n.len:n.pos+t,r=_p();for(;n.pos>>3){case 1:{if(s!==10)break;r.guid=n.string();continue}case 2:{if(s!==18)break;r.name=n.string();continue}case 3:{if(s===29){r.matrix.push(n.float());continue}if(s===26){const o=n.uint32()+n.pos;for(;n.posglobalThis.Number(t)):[]}},toJSON(e){const t={};return e.guid!==""&&(t.guid=e.guid),e.name!==""&&(t.name=e.name),e.matrix?.length&&(t.matrix=e.matrix),t},create(e){return rf.fromPartial(e??{})},fromPartial(e){const t=_p();return t.guid=e.guid??"",t.name=e.name??"",t.matrix=e.matrix?.map(n=>n)||[],t}};function at(e){return e!=null}const sf="182",Yr={ROTATE:0,DOLLY:1,PAN:2},Ms={ROTATE:0,PAN:1,DOLLY_PAN:2,DOLLY_ROTATE:3},cb=0,vp=1,ub=2,Za=1,I0=2,_o=3,yr=0,dn=1,xn=2,Vi=0,Is=1,xp=2,yp=3,Sp=4,hb=5,Fr=100,fb=101,db=102,pb=103,mb=104,gb=200,_b=201,vb=202,xb=203,lu=204,cu=205,yb=206,Sb=207,bb=208,Mb=209,wb=210,Eb=211,Tb=212,Ab=213,Pb=214,uu=0,hu=1,fu=2,Fs=3,du=4,pu=5,mu=6,gu=7,L0=0,Cb=1,Rb=2,vi=0,N0=1,U0=2,O0=3,of=4,F0=5,k0=6,B0=7,z0=300,$r=301,ks=302,_u=303,vu=304,Nl=306,xu=1e3,zi=1001,yu=1002,rn=1003,Db=1004,ha=1005,fn=1006,ac=1007,zr=1008,kn=1009,V0=1010,H0=1011,zo=1012,af=1013,Mi=1014,mi=1015,Yi=1016,lf=1017,cf=1018,Vo=1020,G0=35902,W0=35899,X0=1021,q0=1022,Qn=1023,Ji=1026,Vr=1027,Y0=1028,uf=1029,Bs=1030,hf=1031,ff=1033,Ka=33776,Qa=33777,ja=33778,tl=33779,Su=35840,bu=35841,Mu=35842,wu=35843,Eu=36196,Tu=37492,Au=37496,Pu=37488,Cu=37489,Ru=37490,Du=37491,Iu=37808,Lu=37809,Nu=37810,Uu=37811,Ou=37812,Fu=37813,ku=37814,Bu=37815,zu=37816,Vu=37817,Hu=37818,Gu=37819,Wu=37820,Xu=37821,qu=36492,Yu=36494,Ju=36495,$u=36283,Zu=36284,Ku=36285,Qu=36286,Ib=3200,J0=0,Lb=1,hr="",On="srgb",zs="srgb-linear",dl="linear",be="srgb",ss=7680,bp=519,Nb=512,Ub=513,Ob=514,df=515,Fb=516,kb=517,pf=518,Bb=519,Mp=35044,wp="300 es",gi=2e3,pl=2001;function $0(e){for(let t=e.length-1;t>=0;--t)if(e[t]>=65535)return!0;return!1}function ml(e){return document.createElementNS("http://www.w3.org/1999/xhtml",e)}function zb(){const e=ml("canvas");return e.style.display="block",e}const Ep={};function Tp(...e){const t="THREE."+e.shift();console.log(t,...e)}function Yt(...e){const t="THREE."+e.shift();console.warn(t,...e)}function de(...e){const t="THREE."+e.shift();console.error(t,...e)}function Ho(...e){const t=e.join(" ");t in Ep||(Ep[t]=!0,Yt(...e))}function Vb(e,t,n){return new Promise(function(i,r){function s(){switch(e.clientWaitSync(t,e.SYNC_FLUSH_COMMANDS_BIT,0)){case e.WAIT_FAILED:r();break;case e.TIMEOUT_EXPIRED:setTimeout(s,n);break;default:i()}}setTimeout(s,n)})}class jr{addEventListener(t,n){this._listeners===void 0&&(this._listeners={});const i=this._listeners;i[t]===void 0&&(i[t]=[]),i[t].indexOf(n)===-1&&i[t].push(n)}hasEventListener(t,n){const i=this._listeners;return i===void 0?!1:i[t]!==void 0&&i[t].indexOf(n)!==-1}removeEventListener(t,n){const i=this._listeners;if(i===void 0)return;const r=i[t];if(r!==void 0){const s=r.indexOf(n);s!==-1&&r.splice(s,1)}}dispatchEvent(t){const n=this._listeners;if(n===void 0)return;const i=n[t.type];if(i!==void 0){t.target=this;const r=i.slice(0);for(let s=0,o=r.length;s>8&255]+an[e>>16&255]+an[e>>24&255]+"-"+an[t&255]+an[t>>8&255]+"-"+an[t>>16&15|64]+an[t>>24&255]+"-"+an[n&63|128]+an[n>>8&255]+"-"+an[n>>16&255]+an[n>>24&255]+an[i&255]+an[i>>8&255]+an[i>>16&255]+an[i>>24&255]).toLowerCase()}function re(e,t,n){return Math.max(t,Math.min(n,e))}function mf(e,t){return(e%t+t)%t}function Hb(e,t,n,i,r){return i+(e-t)*(r-i)/(n-t)}function Gb(e,t,n){return e!==t?(n-e)/(t-e):0}function Ro(e,t,n){return(1-n)*e+n*t}function Wb(e,t,n,i){return Ro(e,t,1-Math.exp(-n*i))}function Xb(e,t=1){return t-Math.abs(mf(e,t*2)-t)}function qb(e,t,n){return e<=t?0:e>=n?1:(e=(e-t)/(n-t),e*e*(3-2*e))}function Yb(e,t,n){return e<=t?0:e>=n?1:(e=(e-t)/(n-t),e*e*e*(e*(e*6-15)+10))}function Jb(e,t){return e+Math.floor(Math.random()*(t-e+1))}function $b(e,t){return e+Math.random()*(t-e)}function Zb(e){return e*(.5-Math.random())}function Kb(e){e!==void 0&&(Ap=e);let t=Ap+=1831565813;return t=Math.imul(t^t>>>15,t|1),t^=t+Math.imul(t^t>>>7,t|61),((t^t>>>14)>>>0)/4294967296}function Qb(e){return e*Co}function jb(e){return e*Vs}function tM(e){return(e&e-1)===0&&e!==0}function eM(e){return Math.pow(2,Math.ceil(Math.log(e)/Math.LN2))}function nM(e){return Math.pow(2,Math.floor(Math.log(e)/Math.LN2))}function iM(e,t,n,i,r){const s=Math.cos,o=Math.sin,a=s(n/2),l=o(n/2),c=s((t+i)/2),u=o((t+i)/2),h=s((t-i)/2),f=o((t-i)/2),p=s((i-t)/2),g=o((i-t)/2);switch(r){case"XYX":e.set(a*u,l*h,l*f,a*c);break;case"YZY":e.set(l*f,a*u,l*h,a*c);break;case"ZXZ":e.set(l*h,l*f,a*u,a*c);break;case"XZX":e.set(a*u,l*g,l*p,a*c);break;case"YXY":e.set(l*p,a*u,l*g,a*c);break;case"ZYZ":e.set(l*g,l*p,a*u,a*c);break;default:Yt("MathUtils: .setQuaternionFromProperEuler() encountered an unknown order: "+r)}}function bs(e,t){switch(t.constructor){case Float32Array:return e;case Uint32Array:return e/4294967295;case Uint16Array:return e/65535;case Uint8Array:return e/255;case Int32Array:return Math.max(e/2147483647,-1);case Int16Array:return Math.max(e/32767,-1);case Int8Array:return Math.max(e/127,-1);default:throw new Error("Invalid component type.")}}function gn(e,t){switch(t.constructor){case Float32Array:return e;case Uint32Array:return Math.round(e*4294967295);case Uint16Array:return Math.round(e*65535);case Uint8Array:return Math.round(e*255);case Int32Array:return Math.round(e*2147483647);case Int16Array:return Math.round(e*32767);case Int8Array:return Math.round(e*127);default:throw new Error("Invalid component type.")}}const ju={DEG2RAD:Co,RAD2DEG:Vs,generateUUID:ts,clamp:re,euclideanModulo:mf,mapLinear:Hb,inverseLerp:Gb,lerp:Ro,damp:Wb,pingpong:Xb,smoothstep:qb,smootherstep:Yb,randInt:Jb,randFloat:$b,randFloatSpread:Zb,seededRandom:Kb,degToRad:Qb,radToDeg:jb,isPowerOfTwo:tM,ceilPowerOfTwo:eM,floorPowerOfTwo:nM,setQuaternionFromProperEuler:iM,normalize:gn,denormalize:bs};class mt{constructor(t=0,n=0){mt.prototype.isVector2=!0,this.x=t,this.y=n}get width(){return this.x}set width(t){this.x=t}get height(){return this.y}set height(t){this.y=t}set(t,n){return this.x=t,this.y=n,this}setScalar(t){return this.x=t,this.y=t,this}setX(t){return this.x=t,this}setY(t){return this.y=t,this}setComponent(t,n){switch(t){case 0:this.x=n;break;case 1:this.y=n;break;default:throw new Error("index is out of range: "+t)}return this}getComponent(t){switch(t){case 0:return this.x;case 1:return this.y;default:throw new Error("index is out of range: "+t)}}clone(){return new this.constructor(this.x,this.y)}copy(t){return this.x=t.x,this.y=t.y,this}add(t){return this.x+=t.x,this.y+=t.y,this}addScalar(t){return this.x+=t,this.y+=t,this}addVectors(t,n){return this.x=t.x+n.x,this.y=t.y+n.y,this}addScaledVector(t,n){return this.x+=t.x*n,this.y+=t.y*n,this}sub(t){return this.x-=t.x,this.y-=t.y,this}subScalar(t){return this.x-=t,this.y-=t,this}subVectors(t,n){return this.x=t.x-n.x,this.y=t.y-n.y,this}multiply(t){return this.x*=t.x,this.y*=t.y,this}multiplyScalar(t){return this.x*=t,this.y*=t,this}divide(t){return this.x/=t.x,this.y/=t.y,this}divideScalar(t){return this.multiplyScalar(1/t)}applyMatrix3(t){const n=this.x,i=this.y,r=t.elements;return this.x=r[0]*n+r[3]*i+r[6],this.y=r[1]*n+r[4]*i+r[7],this}min(t){return this.x=Math.min(this.x,t.x),this.y=Math.min(this.y,t.y),this}max(t){return this.x=Math.max(this.x,t.x),this.y=Math.max(this.y,t.y),this}clamp(t,n){return this.x=re(this.x,t.x,n.x),this.y=re(this.y,t.y,n.y),this}clampScalar(t,n){return this.x=re(this.x,t,n),this.y=re(this.y,t,n),this}clampLength(t,n){const i=this.length();return this.divideScalar(i||1).multiplyScalar(re(i,t,n))}floor(){return this.x=Math.floor(this.x),this.y=Math.floor(this.y),this}ceil(){return this.x=Math.ceil(this.x),this.y=Math.ceil(this.y),this}round(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this}roundToZero(){return this.x=Math.trunc(this.x),this.y=Math.trunc(this.y),this}negate(){return this.x=-this.x,this.y=-this.y,this}dot(t){return this.x*t.x+this.y*t.y}cross(t){return this.x*t.y-this.y*t.x}lengthSq(){return this.x*this.x+this.y*this.y}length(){return Math.sqrt(this.x*this.x+this.y*this.y)}manhattanLength(){return Math.abs(this.x)+Math.abs(this.y)}normalize(){return this.divideScalar(this.length()||1)}angle(){return Math.atan2(-this.y,-this.x)+Math.PI}angleTo(t){const n=Math.sqrt(this.lengthSq()*t.lengthSq());if(n===0)return Math.PI/2;const i=this.dot(t)/n;return Math.acos(re(i,-1,1))}distanceTo(t){return Math.sqrt(this.distanceToSquared(t))}distanceToSquared(t){const n=this.x-t.x,i=this.y-t.y;return n*n+i*i}manhattanDistanceTo(t){return Math.abs(this.x-t.x)+Math.abs(this.y-t.y)}setLength(t){return this.normalize().multiplyScalar(t)}lerp(t,n){return this.x+=(t.x-this.x)*n,this.y+=(t.y-this.y)*n,this}lerpVectors(t,n,i){return this.x=t.x+(n.x-t.x)*i,this.y=t.y+(n.y-t.y)*i,this}equals(t){return t.x===this.x&&t.y===this.y}fromArray(t,n=0){return this.x=t[n],this.y=t[n+1],this}toArray(t=[],n=0){return t[n]=this.x,t[n+1]=this.y,t}fromBufferAttribute(t,n){return this.x=t.getX(n),this.y=t.getY(n),this}rotateAround(t,n){const i=Math.cos(n),r=Math.sin(n),s=this.x-t.x,o=this.y-t.y;return this.x=s*i-o*r+t.x,this.y=s*r+o*i+t.y,this}random(){return this.x=Math.random(),this.y=Math.random(),this}*[Symbol.iterator](){yield this.x,yield this.y}}let nn=class{constructor(t=0,n=0,i=0,r=1){this.isQuaternion=!0,this._x=t,this._y=n,this._z=i,this._w=r}static slerpFlat(t,n,i,r,s,o,a){let l=i[r+0],c=i[r+1],u=i[r+2],h=i[r+3],f=s[o+0],p=s[o+1],g=s[o+2],v=s[o+3];if(a<=0){t[n+0]=l,t[n+1]=c,t[n+2]=u,t[n+3]=h;return}if(a>=1){t[n+0]=f,t[n+1]=p,t[n+2]=g,t[n+3]=v;return}if(h!==v||l!==f||c!==p||u!==g){let m=l*f+c*p+u*g+h*v;m<0&&(f=-f,p=-p,g=-g,v=-v,m=-m);let d=1-a;if(m<.9995){const S=Math.acos(m),y=Math.sin(S);d=Math.sin(d*S)/y,a=Math.sin(a*S)/y,l=l*d+f*a,c=c*d+p*a,u=u*d+g*a,h=h*d+v*a}else{l=l*d+f*a,c=c*d+p*a,u=u*d+g*a,h=h*d+v*a;const S=1/Math.sqrt(l*l+c*c+u*u+h*h);l*=S,c*=S,u*=S,h*=S}}t[n]=l,t[n+1]=c,t[n+2]=u,t[n+3]=h}static multiplyQuaternionsFlat(t,n,i,r,s,o){const a=i[r],l=i[r+1],c=i[r+2],u=i[r+3],h=s[o],f=s[o+1],p=s[o+2],g=s[o+3];return t[n]=a*g+u*h+l*p-c*f,t[n+1]=l*g+u*f+c*h-a*p,t[n+2]=c*g+u*p+a*f-l*h,t[n+3]=u*g-a*h-l*f-c*p,t}get x(){return this._x}set x(t){this._x=t,this._onChangeCallback()}get y(){return this._y}set y(t){this._y=t,this._onChangeCallback()}get z(){return this._z}set z(t){this._z=t,this._onChangeCallback()}get w(){return this._w}set w(t){this._w=t,this._onChangeCallback()}set(t,n,i,r){return this._x=t,this._y=n,this._z=i,this._w=r,this._onChangeCallback(),this}clone(){return new this.constructor(this._x,this._y,this._z,this._w)}copy(t){return this._x=t.x,this._y=t.y,this._z=t.z,this._w=t.w,this._onChangeCallback(),this}setFromEuler(t,n=!0){const i=t._x,r=t._y,s=t._z,o=t._order,a=Math.cos,l=Math.sin,c=a(i/2),u=a(r/2),h=a(s/2),f=l(i/2),p=l(r/2),g=l(s/2);switch(o){case"XYZ":this._x=f*u*h+c*p*g,this._y=c*p*h-f*u*g,this._z=c*u*g+f*p*h,this._w=c*u*h-f*p*g;break;case"YXZ":this._x=f*u*h+c*p*g,this._y=c*p*h-f*u*g,this._z=c*u*g-f*p*h,this._w=c*u*h+f*p*g;break;case"ZXY":this._x=f*u*h-c*p*g,this._y=c*p*h+f*u*g,this._z=c*u*g+f*p*h,this._w=c*u*h-f*p*g;break;case"ZYX":this._x=f*u*h-c*p*g,this._y=c*p*h+f*u*g,this._z=c*u*g-f*p*h,this._w=c*u*h+f*p*g;break;case"YZX":this._x=f*u*h+c*p*g,this._y=c*p*h+f*u*g,this._z=c*u*g-f*p*h,this._w=c*u*h-f*p*g;break;case"XZY":this._x=f*u*h-c*p*g,this._y=c*p*h-f*u*g,this._z=c*u*g+f*p*h,this._w=c*u*h+f*p*g;break;default:Yt("Quaternion: .setFromEuler() encountered an unknown order: "+o)}return n===!0&&this._onChangeCallback(),this}setFromAxisAngle(t,n){const i=n/2,r=Math.sin(i);return this._x=t.x*r,this._y=t.y*r,this._z=t.z*r,this._w=Math.cos(i),this._onChangeCallback(),this}setFromRotationMatrix(t){const n=t.elements,i=n[0],r=n[4],s=n[8],o=n[1],a=n[5],l=n[9],c=n[2],u=n[6],h=n[10],f=i+a+h;if(f>0){const p=.5/Math.sqrt(f+1);this._w=.25/p,this._x=(u-l)*p,this._y=(s-c)*p,this._z=(o-r)*p}else if(i>a&&i>h){const p=2*Math.sqrt(1+i-a-h);this._w=(u-l)/p,this._x=.25*p,this._y=(r+o)/p,this._z=(s+c)/p}else if(a>h){const p=2*Math.sqrt(1+a-i-h);this._w=(s-c)/p,this._x=(r+o)/p,this._y=.25*p,this._z=(l+u)/p}else{const p=2*Math.sqrt(1+h-i-a);this._w=(o-r)/p,this._x=(s+c)/p,this._y=(l+u)/p,this._z=.25*p}return this._onChangeCallback(),this}setFromUnitVectors(t,n){let i=t.dot(n)+1;return i<1e-8?(i=0,Math.abs(t.x)>Math.abs(t.z)?(this._x=-t.y,this._y=t.x,this._z=0,this._w=i):(this._x=0,this._y=-t.z,this._z=t.y,this._w=i)):(this._x=t.y*n.z-t.z*n.y,this._y=t.z*n.x-t.x*n.z,this._z=t.x*n.y-t.y*n.x,this._w=i),this.normalize()}angleTo(t){return 2*Math.acos(Math.abs(re(this.dot(t),-1,1)))}rotateTowards(t,n){const i=this.angleTo(t);if(i===0)return this;const r=Math.min(1,n/i);return this.slerp(t,r),this}identity(){return this.set(0,0,0,1)}invert(){return this.conjugate()}conjugate(){return this._x*=-1,this._y*=-1,this._z*=-1,this._onChangeCallback(),this}dot(t){return this._x*t._x+this._y*t._y+this._z*t._z+this._w*t._w}lengthSq(){return this._x*this._x+this._y*this._y+this._z*this._z+this._w*this._w}length(){return Math.sqrt(this._x*this._x+this._y*this._y+this._z*this._z+this._w*this._w)}normalize(){let t=this.length();return t===0?(this._x=0,this._y=0,this._z=0,this._w=1):(t=1/t,this._x=this._x*t,this._y=this._y*t,this._z=this._z*t,this._w=this._w*t),this._onChangeCallback(),this}multiply(t){return this.multiplyQuaternions(this,t)}premultiply(t){return this.multiplyQuaternions(t,this)}multiplyQuaternions(t,n){const i=t._x,r=t._y,s=t._z,o=t._w,a=n._x,l=n._y,c=n._z,u=n._w;return this._x=i*u+o*a+r*c-s*l,this._y=r*u+o*l+s*a-i*c,this._z=s*u+o*c+i*l-r*a,this._w=o*u-i*a-r*l-s*c,this._onChangeCallback(),this}slerp(t,n){if(n<=0)return this;if(n>=1)return this.copy(t);let i=t._x,r=t._y,s=t._z,o=t._w,a=this.dot(t);a<0&&(i=-i,r=-r,s=-s,o=-o,a=-a);let l=1-n;if(a<.9995){const c=Math.acos(a),u=Math.sin(c);l=Math.sin(l*c)/u,n=Math.sin(n*c)/u,this._x=this._x*l+i*n,this._y=this._y*l+r*n,this._z=this._z*l+s*n,this._w=this._w*l+o*n,this._onChangeCallback()}else this._x=this._x*l+i*n,this._y=this._y*l+r*n,this._z=this._z*l+s*n,this._w=this._w*l+o*n,this.normalize();return this}slerpQuaternions(t,n,i){return this.copy(t).slerp(n,i)}random(){const t=2*Math.PI*Math.random(),n=2*Math.PI*Math.random(),i=Math.random(),r=Math.sqrt(1-i),s=Math.sqrt(i);return this.set(r*Math.sin(t),r*Math.cos(t),s*Math.sin(n),s*Math.cos(n))}equals(t){return t._x===this._x&&t._y===this._y&&t._z===this._z&&t._w===this._w}fromArray(t,n=0){return this._x=t[n],this._y=t[n+1],this._z=t[n+2],this._w=t[n+3],this._onChangeCallback(),this}toArray(t=[],n=0){return t[n]=this._x,t[n+1]=this._y,t[n+2]=this._z,t[n+3]=this._w,t}fromBufferAttribute(t,n){return this._x=t.getX(n),this._y=t.getY(n),this._z=t.getZ(n),this._w=t.getW(n),this._onChangeCallback(),this}toJSON(){return this.toArray()}_onChange(t){return this._onChangeCallback=t,this}_onChangeCallback(){}*[Symbol.iterator](){yield this._x,yield this._y,yield this._z,yield this._w}};class D{constructor(t=0,n=0,i=0){D.prototype.isVector3=!0,this.x=t,this.y=n,this.z=i}set(t,n,i){return i===void 0&&(i=this.z),this.x=t,this.y=n,this.z=i,this}setScalar(t){return this.x=t,this.y=t,this.z=t,this}setX(t){return this.x=t,this}setY(t){return this.y=t,this}setZ(t){return this.z=t,this}setComponent(t,n){switch(t){case 0:this.x=n;break;case 1:this.y=n;break;case 2:this.z=n;break;default:throw new Error("index is out of range: "+t)}return this}getComponent(t){switch(t){case 0:return this.x;case 1:return this.y;case 2:return this.z;default:throw new Error("index is out of range: "+t)}}clone(){return new this.constructor(this.x,this.y,this.z)}copy(t){return this.x=t.x,this.y=t.y,this.z=t.z,this}add(t){return this.x+=t.x,this.y+=t.y,this.z+=t.z,this}addScalar(t){return this.x+=t,this.y+=t,this.z+=t,this}addVectors(t,n){return this.x=t.x+n.x,this.y=t.y+n.y,this.z=t.z+n.z,this}addScaledVector(t,n){return this.x+=t.x*n,this.y+=t.y*n,this.z+=t.z*n,this}sub(t){return this.x-=t.x,this.y-=t.y,this.z-=t.z,this}subScalar(t){return this.x-=t,this.y-=t,this.z-=t,this}subVectors(t,n){return this.x=t.x-n.x,this.y=t.y-n.y,this.z=t.z-n.z,this}multiply(t){return this.x*=t.x,this.y*=t.y,this.z*=t.z,this}multiplyScalar(t){return this.x*=t,this.y*=t,this.z*=t,this}multiplyVectors(t,n){return this.x=t.x*n.x,this.y=t.y*n.y,this.z=t.z*n.z,this}applyEuler(t){return this.applyQuaternion(Pp.setFromEuler(t))}applyAxisAngle(t,n){return this.applyQuaternion(Pp.setFromAxisAngle(t,n))}applyMatrix3(t){const n=this.x,i=this.y,r=this.z,s=t.elements;return this.x=s[0]*n+s[3]*i+s[6]*r,this.y=s[1]*n+s[4]*i+s[7]*r,this.z=s[2]*n+s[5]*i+s[8]*r,this}applyNormalMatrix(t){return this.applyMatrix3(t).normalize()}applyMatrix4(t){const n=this.x,i=this.y,r=this.z,s=t.elements,o=1/(s[3]*n+s[7]*i+s[11]*r+s[15]);return this.x=(s[0]*n+s[4]*i+s[8]*r+s[12])*o,this.y=(s[1]*n+s[5]*i+s[9]*r+s[13])*o,this.z=(s[2]*n+s[6]*i+s[10]*r+s[14])*o,this}applyQuaternion(t){const n=this.x,i=this.y,r=this.z,s=t.x,o=t.y,a=t.z,l=t.w,c=2*(o*r-a*i),u=2*(a*n-s*r),h=2*(s*i-o*n);return this.x=n+l*c+o*h-a*u,this.y=i+l*u+a*c-s*h,this.z=r+l*h+s*u-o*c,this}project(t){return this.applyMatrix4(t.matrixWorldInverse).applyMatrix4(t.projectionMatrix)}unproject(t){return this.applyMatrix4(t.projectionMatrixInverse).applyMatrix4(t.matrixWorld)}transformDirection(t){const n=this.x,i=this.y,r=this.z,s=t.elements;return this.x=s[0]*n+s[4]*i+s[8]*r,this.y=s[1]*n+s[5]*i+s[9]*r,this.z=s[2]*n+s[6]*i+s[10]*r,this.normalize()}divide(t){return this.x/=t.x,this.y/=t.y,this.z/=t.z,this}divideScalar(t){return this.multiplyScalar(1/t)}min(t){return this.x=Math.min(this.x,t.x),this.y=Math.min(this.y,t.y),this.z=Math.min(this.z,t.z),this}max(t){return this.x=Math.max(this.x,t.x),this.y=Math.max(this.y,t.y),this.z=Math.max(this.z,t.z),this}clamp(t,n){return this.x=re(this.x,t.x,n.x),this.y=re(this.y,t.y,n.y),this.z=re(this.z,t.z,n.z),this}clampScalar(t,n){return this.x=re(this.x,t,n),this.y=re(this.y,t,n),this.z=re(this.z,t,n),this}clampLength(t,n){const i=this.length();return this.divideScalar(i||1).multiplyScalar(re(i,t,n))}floor(){return this.x=Math.floor(this.x),this.y=Math.floor(this.y),this.z=Math.floor(this.z),this}ceil(){return this.x=Math.ceil(this.x),this.y=Math.ceil(this.y),this.z=Math.ceil(this.z),this}round(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this.z=Math.round(this.z),this}roundToZero(){return this.x=Math.trunc(this.x),this.y=Math.trunc(this.y),this.z=Math.trunc(this.z),this}negate(){return this.x=-this.x,this.y=-this.y,this.z=-this.z,this}dot(t){return this.x*t.x+this.y*t.y+this.z*t.z}lengthSq(){return this.x*this.x+this.y*this.y+this.z*this.z}length(){return Math.sqrt(this.x*this.x+this.y*this.y+this.z*this.z)}manhattanLength(){return Math.abs(this.x)+Math.abs(this.y)+Math.abs(this.z)}normalize(){return this.divideScalar(this.length()||1)}setLength(t){return this.normalize().multiplyScalar(t)}lerp(t,n){return this.x+=(t.x-this.x)*n,this.y+=(t.y-this.y)*n,this.z+=(t.z-this.z)*n,this}lerpVectors(t,n,i){return this.x=t.x+(n.x-t.x)*i,this.y=t.y+(n.y-t.y)*i,this.z=t.z+(n.z-t.z)*i,this}cross(t){return this.crossVectors(this,t)}crossVectors(t,n){const i=t.x,r=t.y,s=t.z,o=n.x,a=n.y,l=n.z;return this.x=r*l-s*a,this.y=s*o-i*l,this.z=i*a-r*o,this}projectOnVector(t){const n=t.lengthSq();if(n===0)return this.set(0,0,0);const i=t.dot(this)/n;return this.copy(t).multiplyScalar(i)}projectOnPlane(t){return lc.copy(this).projectOnVector(t),this.sub(lc)}reflect(t){return this.sub(lc.copy(t).multiplyScalar(2*this.dot(t)))}angleTo(t){const n=Math.sqrt(this.lengthSq()*t.lengthSq());if(n===0)return Math.PI/2;const i=this.dot(t)/n;return Math.acos(re(i,-1,1))}distanceTo(t){return Math.sqrt(this.distanceToSquared(t))}distanceToSquared(t){const n=this.x-t.x,i=this.y-t.y,r=this.z-t.z;return n*n+i*i+r*r}manhattanDistanceTo(t){return Math.abs(this.x-t.x)+Math.abs(this.y-t.y)+Math.abs(this.z-t.z)}setFromSpherical(t){return this.setFromSphericalCoords(t.radius,t.phi,t.theta)}setFromSphericalCoords(t,n,i){const r=Math.sin(n)*t;return this.x=r*Math.sin(i),this.y=Math.cos(n)*t,this.z=r*Math.cos(i),this}setFromCylindrical(t){return this.setFromCylindricalCoords(t.radius,t.theta,t.y)}setFromCylindricalCoords(t,n,i){return this.x=t*Math.sin(n),this.y=i,this.z=t*Math.cos(n),this}setFromMatrixPosition(t){const n=t.elements;return this.x=n[12],this.y=n[13],this.z=n[14],this}setFromMatrixScale(t){const n=this.setFromMatrixColumn(t,0).length(),i=this.setFromMatrixColumn(t,1).length(),r=this.setFromMatrixColumn(t,2).length();return this.x=n,this.y=i,this.z=r,this}setFromMatrixColumn(t,n){return this.fromArray(t.elements,n*4)}setFromMatrix3Column(t,n){return this.fromArray(t.elements,n*3)}setFromEuler(t){return this.x=t._x,this.y=t._y,this.z=t._z,this}setFromColor(t){return this.x=t.r,this.y=t.g,this.z=t.b,this}equals(t){return t.x===this.x&&t.y===this.y&&t.z===this.z}fromArray(t,n=0){return this.x=t[n],this.y=t[n+1],this.z=t[n+2],this}toArray(t=[],n=0){return t[n]=this.x,t[n+1]=this.y,t[n+2]=this.z,t}fromBufferAttribute(t,n){return this.x=t.getX(n),this.y=t.getY(n),this.z=t.getZ(n),this}random(){return this.x=Math.random(),this.y=Math.random(),this.z=Math.random(),this}randomDirection(){const t=Math.random()*Math.PI*2,n=Math.random()*2-1,i=Math.sqrt(1-n*n);return this.x=i*Math.cos(t),this.y=n,this.z=i*Math.sin(t),this}*[Symbol.iterator](){yield this.x,yield this.y,yield this.z}}const lc=new D,Pp=new nn;class ie{constructor(t,n,i,r,s,o,a,l,c){ie.prototype.isMatrix3=!0,this.elements=[1,0,0,0,1,0,0,0,1],t!==void 0&&this.set(t,n,i,r,s,o,a,l,c)}set(t,n,i,r,s,o,a,l,c){const u=this.elements;return u[0]=t,u[1]=r,u[2]=a,u[3]=n,u[4]=s,u[5]=l,u[6]=i,u[7]=o,u[8]=c,this}identity(){return this.set(1,0,0,0,1,0,0,0,1),this}copy(t){const n=this.elements,i=t.elements;return n[0]=i[0],n[1]=i[1],n[2]=i[2],n[3]=i[3],n[4]=i[4],n[5]=i[5],n[6]=i[6],n[7]=i[7],n[8]=i[8],this}extractBasis(t,n,i){return t.setFromMatrix3Column(this,0),n.setFromMatrix3Column(this,1),i.setFromMatrix3Column(this,2),this}setFromMatrix4(t){const n=t.elements;return this.set(n[0],n[4],n[8],n[1],n[5],n[9],n[2],n[6],n[10]),this}multiply(t){return this.multiplyMatrices(this,t)}premultiply(t){return this.multiplyMatrices(t,this)}multiplyMatrices(t,n){const i=t.elements,r=n.elements,s=this.elements,o=i[0],a=i[3],l=i[6],c=i[1],u=i[4],h=i[7],f=i[2],p=i[5],g=i[8],v=r[0],m=r[3],d=r[6],S=r[1],y=r[4],x=r[7],A=r[2],P=r[5],C=r[8];return s[0]=o*v+a*S+l*A,s[3]=o*m+a*y+l*P,s[6]=o*d+a*x+l*C,s[1]=c*v+u*S+h*A,s[4]=c*m+u*y+h*P,s[7]=c*d+u*x+h*C,s[2]=f*v+p*S+g*A,s[5]=f*m+p*y+g*P,s[8]=f*d+p*x+g*C,this}multiplyScalar(t){const n=this.elements;return n[0]*=t,n[3]*=t,n[6]*=t,n[1]*=t,n[4]*=t,n[7]*=t,n[2]*=t,n[5]*=t,n[8]*=t,this}determinant(){const t=this.elements,n=t[0],i=t[1],r=t[2],s=t[3],o=t[4],a=t[5],l=t[6],c=t[7],u=t[8];return n*o*u-n*a*c-i*s*u+i*a*l+r*s*c-r*o*l}invert(){const t=this.elements,n=t[0],i=t[1],r=t[2],s=t[3],o=t[4],a=t[5],l=t[6],c=t[7],u=t[8],h=u*o-a*c,f=a*l-u*s,p=c*s-o*l,g=n*h+i*f+r*p;if(g===0)return this.set(0,0,0,0,0,0,0,0,0);const v=1/g;return t[0]=h*v,t[1]=(r*c-u*i)*v,t[2]=(a*i-r*o)*v,t[3]=f*v,t[4]=(u*n-r*l)*v,t[5]=(r*s-a*n)*v,t[6]=p*v,t[7]=(i*l-c*n)*v,t[8]=(o*n-i*s)*v,this}transpose(){let t;const n=this.elements;return t=n[1],n[1]=n[3],n[3]=t,t=n[2],n[2]=n[6],n[6]=t,t=n[5],n[5]=n[7],n[7]=t,this}getNormalMatrix(t){return this.setFromMatrix4(t).invert().transpose()}transposeIntoArray(t){const n=this.elements;return t[0]=n[0],t[1]=n[3],t[2]=n[6],t[3]=n[1],t[4]=n[4],t[5]=n[7],t[6]=n[2],t[7]=n[5],t[8]=n[8],this}setUvTransform(t,n,i,r,s,o,a){const l=Math.cos(s),c=Math.sin(s);return this.set(i*l,i*c,-i*(l*o+c*a)+o+t,-r*c,r*l,-r*(-c*o+l*a)+a+n,0,0,1),this}scale(t,n){return this.premultiply(cc.makeScale(t,n)),this}rotate(t){return this.premultiply(cc.makeRotation(-t)),this}translate(t,n){return this.premultiply(cc.makeTranslation(t,n)),this}makeTranslation(t,n){return t.isVector2?this.set(1,0,t.x,0,1,t.y,0,0,1):this.set(1,0,t,0,1,n,0,0,1),this}makeRotation(t){const n=Math.cos(t),i=Math.sin(t);return this.set(n,-i,0,i,n,0,0,0,1),this}makeScale(t,n){return this.set(t,0,0,0,n,0,0,0,1),this}equals(t){const n=this.elements,i=t.elements;for(let r=0;r<9;r++)if(n[r]!==i[r])return!1;return!0}fromArray(t,n=0){for(let i=0;i<9;i++)this.elements[i]=t[i+n];return this}toArray(t=[],n=0){const i=this.elements;return t[n]=i[0],t[n+1]=i[1],t[n+2]=i[2],t[n+3]=i[3],t[n+4]=i[4],t[n+5]=i[5],t[n+6]=i[6],t[n+7]=i[7],t[n+8]=i[8],t}clone(){return new this.constructor().fromArray(this.elements)}}const cc=new ie,Cp=new ie().set(.4123908,.3575843,.1804808,.212639,.7151687,.0721923,.0193308,.1191948,.9505322),Rp=new ie().set(3.2409699,-1.5373832,-.4986108,-.9692436,1.8759675,.0415551,.0556301,-.203977,1.0569715);function rM(){const e={enabled:!0,workingColorSpace:zs,spaces:{},convert:function(r,s,o){return this.enabled===!1||s===o||!s||!o||(this.spaces[s].transfer===be&&(r.r=Hi(r.r),r.g=Hi(r.g),r.b=Hi(r.b)),this.spaces[s].primaries!==this.spaces[o].primaries&&(r.applyMatrix3(this.spaces[s].toXYZ),r.applyMatrix3(this.spaces[o].fromXYZ)),this.spaces[o].transfer===be&&(r.r=Ls(r.r),r.g=Ls(r.g),r.b=Ls(r.b))),r},workingToColorSpace:function(r,s){return this.convert(r,this.workingColorSpace,s)},colorSpaceToWorking:function(r,s){return this.convert(r,s,this.workingColorSpace)},getPrimaries:function(r){return this.spaces[r].primaries},getTransfer:function(r){return r===hr?dl:this.spaces[r].transfer},getToneMappingMode:function(r){return this.spaces[r].outputColorSpaceConfig.toneMappingMode||"standard"},getLuminanceCoefficients:function(r,s=this.workingColorSpace){return r.fromArray(this.spaces[s].luminanceCoefficients)},define:function(r){Object.assign(this.spaces,r)},_getMatrix:function(r,s,o){return r.copy(this.spaces[s].toXYZ).multiply(this.spaces[o].fromXYZ)},_getDrawingBufferColorSpace:function(r){return this.spaces[r].outputColorSpaceConfig.drawingBufferColorSpace},_getUnpackColorSpace:function(r=this.workingColorSpace){return this.spaces[r].workingColorSpaceConfig.unpackColorSpace},fromWorkingColorSpace:function(r,s){return Ho("ColorManagement: .fromWorkingColorSpace() has been renamed to .workingToColorSpace()."),e.workingToColorSpace(r,s)},toWorkingColorSpace:function(r,s){return Ho("ColorManagement: .toWorkingColorSpace() has been renamed to .colorSpaceToWorking()."),e.colorSpaceToWorking(r,s)}},t=[.64,.33,.3,.6,.15,.06],n=[.2126,.7152,.0722],i=[.3127,.329];return e.define({[zs]:{primaries:t,whitePoint:i,transfer:dl,toXYZ:Cp,fromXYZ:Rp,luminanceCoefficients:n,workingColorSpaceConfig:{unpackColorSpace:On},outputColorSpaceConfig:{drawingBufferColorSpace:On}},[On]:{primaries:t,whitePoint:i,transfer:be,toXYZ:Cp,fromXYZ:Rp,luminanceCoefficients:n,outputColorSpaceConfig:{drawingBufferColorSpace:On}}}),e}const me=rM();function Hi(e){return e<.04045?e*.0773993808:Math.pow(e*.9478672986+.0521327014,2.4)}function Ls(e){return e<.0031308?e*12.92:1.055*Math.pow(e,.41666)-.055}let os;class sM{static getDataURL(t,n="image/png"){if(/^data:/i.test(t.src)||typeof HTMLCanvasElement>"u")return t.src;let i;if(t instanceof HTMLCanvasElement)i=t;else{os===void 0&&(os=ml("canvas")),os.width=t.width,os.height=t.height;const r=os.getContext("2d");t instanceof ImageData?r.putImageData(t,0,0):r.drawImage(t,0,0,t.width,t.height),i=os}return i.toDataURL(n)}static sRGBToLinear(t){if(typeof HTMLImageElement<"u"&&t instanceof HTMLImageElement||typeof HTMLCanvasElement<"u"&&t instanceof HTMLCanvasElement||typeof ImageBitmap<"u"&&t instanceof ImageBitmap){const n=ml("canvas");n.width=t.width,n.height=t.height;const i=n.getContext("2d");i.drawImage(t,0,0,t.width,t.height);const r=i.getImageData(0,0,t.width,t.height),s=r.data;for(let o=0;o1),this.pmremVersion=0}get width(){return this.source.getSize(hc).x}get height(){return this.source.getSize(hc).y}get depth(){return this.source.getSize(hc).z}get image(){return this.source.data}set image(t=null){this.source.data=t}updateMatrix(){this.matrix.setUvTransform(this.offset.x,this.offset.y,this.repeat.x,this.repeat.y,this.rotation,this.center.x,this.center.y)}addUpdateRange(t,n){this.updateRanges.push({start:t,count:n})}clearUpdateRanges(){this.updateRanges.length=0}clone(){return new this.constructor().copy(this)}copy(t){return this.name=t.name,this.source=t.source,this.mipmaps=t.mipmaps.slice(0),this.mapping=t.mapping,this.channel=t.channel,this.wrapS=t.wrapS,this.wrapT=t.wrapT,this.magFilter=t.magFilter,this.minFilter=t.minFilter,this.anisotropy=t.anisotropy,this.format=t.format,this.internalFormat=t.internalFormat,this.type=t.type,this.offset.copy(t.offset),this.repeat.copy(t.repeat),this.center.copy(t.center),this.rotation=t.rotation,this.matrixAutoUpdate=t.matrixAutoUpdate,this.matrix.copy(t.matrix),this.generateMipmaps=t.generateMipmaps,this.premultiplyAlpha=t.premultiplyAlpha,this.flipY=t.flipY,this.unpackAlignment=t.unpackAlignment,this.colorSpace=t.colorSpace,this.renderTarget=t.renderTarget,this.isRenderTargetTexture=t.isRenderTargetTexture,this.isArrayTexture=t.isArrayTexture,this.userData=JSON.parse(JSON.stringify(t.userData)),this.needsUpdate=!0,this}setValues(t){for(const n in t){const i=t[n];if(i===void 0){Yt(`Texture.setValues(): parameter '${n}' has value of undefined.`);continue}const r=this[n];if(r===void 0){Yt(`Texture.setValues(): property '${n}' does not exist.`);continue}r&&i&&r.isVector2&&i.isVector2||r&&i&&r.isVector3&&i.isVector3||r&&i&&r.isMatrix3&&i.isMatrix3?r.copy(i):this[n]=i}}toJSON(t){const n=t===void 0||typeof t=="string";if(!n&&t.textures[this.uuid]!==void 0)return t.textures[this.uuid];const i={metadata:{version:4.7,type:"Texture",generator:"Texture.toJSON"},uuid:this.uuid,name:this.name,image:this.source.toJSON(t).uuid,mapping:this.mapping,channel:this.channel,repeat:[this.repeat.x,this.repeat.y],offset:[this.offset.x,this.offset.y],center:[this.center.x,this.center.y],rotation:this.rotation,wrap:[this.wrapS,this.wrapT],format:this.format,internalFormat:this.internalFormat,type:this.type,colorSpace:this.colorSpace,minFilter:this.minFilter,magFilter:this.magFilter,anisotropy:this.anisotropy,flipY:this.flipY,generateMipmaps:this.generateMipmaps,premultiplyAlpha:this.premultiplyAlpha,unpackAlignment:this.unpackAlignment};return Object.keys(this.userData).length>0&&(i.userData=this.userData),n||(t.textures[this.uuid]=i),i}dispose(){this.dispatchEvent({type:"dispose"})}transformUv(t){if(this.mapping!==z0)return t;if(t.applyMatrix3(this.matrix),t.x<0||t.x>1)switch(this.wrapS){case xu:t.x=t.x-Math.floor(t.x);break;case zi:t.x=t.x<0?0:1;break;case yu:Math.abs(Math.floor(t.x)%2)===1?t.x=Math.ceil(t.x)-t.x:t.x=t.x-Math.floor(t.x);break}if(t.y<0||t.y>1)switch(this.wrapT){case xu:t.y=t.y-Math.floor(t.y);break;case zi:t.y=t.y<0?0:1;break;case yu:Math.abs(Math.floor(t.y)%2)===1?t.y=Math.ceil(t.y)-t.y:t.y=t.y-Math.floor(t.y);break}return this.flipY&&(t.y=1-t.y),t}set needsUpdate(t){t===!0&&(this.version++,this.source.needsUpdate=!0)}set needsPMREMUpdate(t){t===!0&&this.pmremVersion++}}Sn.DEFAULT_IMAGE=null;Sn.DEFAULT_MAPPING=z0;Sn.DEFAULT_ANISOTROPY=1;class ze{constructor(t=0,n=0,i=0,r=1){ze.prototype.isVector4=!0,this.x=t,this.y=n,this.z=i,this.w=r}get width(){return this.z}set width(t){this.z=t}get height(){return this.w}set height(t){this.w=t}set(t,n,i,r){return this.x=t,this.y=n,this.z=i,this.w=r,this}setScalar(t){return this.x=t,this.y=t,this.z=t,this.w=t,this}setX(t){return this.x=t,this}setY(t){return this.y=t,this}setZ(t){return this.z=t,this}setW(t){return this.w=t,this}setComponent(t,n){switch(t){case 0:this.x=n;break;case 1:this.y=n;break;case 2:this.z=n;break;case 3:this.w=n;break;default:throw new Error("index is out of range: "+t)}return this}getComponent(t){switch(t){case 0:return this.x;case 1:return this.y;case 2:return this.z;case 3:return this.w;default:throw new Error("index is out of range: "+t)}}clone(){return new this.constructor(this.x,this.y,this.z,this.w)}copy(t){return this.x=t.x,this.y=t.y,this.z=t.z,this.w=t.w!==void 0?t.w:1,this}add(t){return this.x+=t.x,this.y+=t.y,this.z+=t.z,this.w+=t.w,this}addScalar(t){return this.x+=t,this.y+=t,this.z+=t,this.w+=t,this}addVectors(t,n){return this.x=t.x+n.x,this.y=t.y+n.y,this.z=t.z+n.z,this.w=t.w+n.w,this}addScaledVector(t,n){return this.x+=t.x*n,this.y+=t.y*n,this.z+=t.z*n,this.w+=t.w*n,this}sub(t){return this.x-=t.x,this.y-=t.y,this.z-=t.z,this.w-=t.w,this}subScalar(t){return this.x-=t,this.y-=t,this.z-=t,this.w-=t,this}subVectors(t,n){return this.x=t.x-n.x,this.y=t.y-n.y,this.z=t.z-n.z,this.w=t.w-n.w,this}multiply(t){return this.x*=t.x,this.y*=t.y,this.z*=t.z,this.w*=t.w,this}multiplyScalar(t){return this.x*=t,this.y*=t,this.z*=t,this.w*=t,this}applyMatrix4(t){const n=this.x,i=this.y,r=this.z,s=this.w,o=t.elements;return this.x=o[0]*n+o[4]*i+o[8]*r+o[12]*s,this.y=o[1]*n+o[5]*i+o[9]*r+o[13]*s,this.z=o[2]*n+o[6]*i+o[10]*r+o[14]*s,this.w=o[3]*n+o[7]*i+o[11]*r+o[15]*s,this}divide(t){return this.x/=t.x,this.y/=t.y,this.z/=t.z,this.w/=t.w,this}divideScalar(t){return this.multiplyScalar(1/t)}setAxisAngleFromQuaternion(t){this.w=2*Math.acos(t.w);const n=Math.sqrt(1-t.w*t.w);return n<1e-4?(this.x=1,this.y=0,this.z=0):(this.x=t.x/n,this.y=t.y/n,this.z=t.z/n),this}setAxisAngleFromRotationMatrix(t){let n,i,r,s;const l=t.elements,c=l[0],u=l[4],h=l[8],f=l[1],p=l[5],g=l[9],v=l[2],m=l[6],d=l[10];if(Math.abs(u-f)<.01&&Math.abs(h-v)<.01&&Math.abs(g-m)<.01){if(Math.abs(u+f)<.1&&Math.abs(h+v)<.1&&Math.abs(g+m)<.1&&Math.abs(c+p+d-3)<.1)return this.set(1,0,0,0),this;n=Math.PI;const y=(c+1)/2,x=(p+1)/2,A=(d+1)/2,P=(u+f)/4,C=(h+v)/4,R=(g+m)/4;return y>x&&y>A?y<.01?(i=0,r=.707106781,s=.707106781):(i=Math.sqrt(y),r=P/i,s=C/i):x>A?x<.01?(i=.707106781,r=0,s=.707106781):(r=Math.sqrt(x),i=P/r,s=R/r):A<.01?(i=.707106781,r=.707106781,s=0):(s=Math.sqrt(A),i=C/s,r=R/s),this.set(i,r,s,n),this}let S=Math.sqrt((m-g)*(m-g)+(h-v)*(h-v)+(f-u)*(f-u));return Math.abs(S)<.001&&(S=1),this.x=(m-g)/S,this.y=(h-v)/S,this.z=(f-u)/S,this.w=Math.acos((c+p+d-1)/2),this}setFromMatrixPosition(t){const n=t.elements;return this.x=n[12],this.y=n[13],this.z=n[14],this.w=n[15],this}min(t){return this.x=Math.min(this.x,t.x),this.y=Math.min(this.y,t.y),this.z=Math.min(this.z,t.z),this.w=Math.min(this.w,t.w),this}max(t){return this.x=Math.max(this.x,t.x),this.y=Math.max(this.y,t.y),this.z=Math.max(this.z,t.z),this.w=Math.max(this.w,t.w),this}clamp(t,n){return this.x=re(this.x,t.x,n.x),this.y=re(this.y,t.y,n.y),this.z=re(this.z,t.z,n.z),this.w=re(this.w,t.w,n.w),this}clampScalar(t,n){return this.x=re(this.x,t,n),this.y=re(this.y,t,n),this.z=re(this.z,t,n),this.w=re(this.w,t,n),this}clampLength(t,n){const i=this.length();return this.divideScalar(i||1).multiplyScalar(re(i,t,n))}floor(){return this.x=Math.floor(this.x),this.y=Math.floor(this.y),this.z=Math.floor(this.z),this.w=Math.floor(this.w),this}ceil(){return this.x=Math.ceil(this.x),this.y=Math.ceil(this.y),this.z=Math.ceil(this.z),this.w=Math.ceil(this.w),this}round(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this.z=Math.round(this.z),this.w=Math.round(this.w),this}roundToZero(){return this.x=Math.trunc(this.x),this.y=Math.trunc(this.y),this.z=Math.trunc(this.z),this.w=Math.trunc(this.w),this}negate(){return this.x=-this.x,this.y=-this.y,this.z=-this.z,this.w=-this.w,this}dot(t){return this.x*t.x+this.y*t.y+this.z*t.z+this.w*t.w}lengthSq(){return this.x*this.x+this.y*this.y+this.z*this.z+this.w*this.w}length(){return Math.sqrt(this.x*this.x+this.y*this.y+this.z*this.z+this.w*this.w)}manhattanLength(){return Math.abs(this.x)+Math.abs(this.y)+Math.abs(this.z)+Math.abs(this.w)}normalize(){return this.divideScalar(this.length()||1)}setLength(t){return this.normalize().multiplyScalar(t)}lerp(t,n){return this.x+=(t.x-this.x)*n,this.y+=(t.y-this.y)*n,this.z+=(t.z-this.z)*n,this.w+=(t.w-this.w)*n,this}lerpVectors(t,n,i){return this.x=t.x+(n.x-t.x)*i,this.y=t.y+(n.y-t.y)*i,this.z=t.z+(n.z-t.z)*i,this.w=t.w+(n.w-t.w)*i,this}equals(t){return t.x===this.x&&t.y===this.y&&t.z===this.z&&t.w===this.w}fromArray(t,n=0){return this.x=t[n],this.y=t[n+1],this.z=t[n+2],this.w=t[n+3],this}toArray(t=[],n=0){return t[n]=this.x,t[n+1]=this.y,t[n+2]=this.z,t[n+3]=this.w,t}fromBufferAttribute(t,n){return this.x=t.getX(n),this.y=t.getY(n),this.z=t.getZ(n),this.w=t.getW(n),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 lM extends jr{constructor(t=1,n=1,i={}){super(),i=Object.assign({generateMipmaps:!1,internalFormat:null,minFilter:fn,depthBuffer:!0,stencilBuffer:!1,resolveDepthBuffer:!0,resolveStencilBuffer:!0,depthTexture:null,samples:0,count:1,depth:1,multiview:!1},i),this.isRenderTarget=!0,this.width=t,this.height=n,this.depth=i.depth,this.scissor=new ze(0,0,t,n),this.scissorTest=!1,this.viewport=new ze(0,0,t,n);const r={width:t,height:n,depth:i.depth},s=new Sn(r);this.textures=[];const o=i.count;for(let a=0;a1);this.dispose()}this.viewport.set(0,0,t,n),this.scissor.set(0,0,t,n)}clone(){return new this.constructor().copy(this)}copy(t){this.width=t.width,this.height=t.height,this.depth=t.depth,this.scissor.copy(t.scissor),this.scissorTest=t.scissorTest,this.viewport.copy(t.viewport),this.textures.length=0;for(let n=0,i=t.textures.length;n=this.min.x&&t.x<=this.max.x&&t.y>=this.min.y&&t.y<=this.max.y&&t.z>=this.min.z&&t.z<=this.max.z}containsBox(t){return this.min.x<=t.min.x&&t.max.x<=this.max.x&&this.min.y<=t.min.y&&t.max.y<=this.max.y&&this.min.z<=t.min.z&&t.max.z<=this.max.z}getParameter(t,n){return n.set((t.x-this.min.x)/(this.max.x-this.min.x),(t.y-this.min.y)/(this.max.y-this.min.y),(t.z-this.min.z)/(this.max.z-this.min.z))}intersectsBox(t){return t.max.x>=this.min.x&&t.min.x<=this.max.x&&t.max.y>=this.min.y&&t.min.y<=this.max.y&&t.max.z>=this.min.z&&t.min.z<=this.max.z}intersectsSphere(t){return this.clampPoint(t.center,Jn),Jn.distanceToSquared(t.center)<=t.radius*t.radius}intersectsPlane(t){let n,i;return t.normal.x>0?(n=t.normal.x*this.min.x,i=t.normal.x*this.max.x):(n=t.normal.x*this.max.x,i=t.normal.x*this.min.x),t.normal.y>0?(n+=t.normal.y*this.min.y,i+=t.normal.y*this.max.y):(n+=t.normal.y*this.max.y,i+=t.normal.y*this.min.y),t.normal.z>0?(n+=t.normal.z*this.min.z,i+=t.normal.z*this.max.z):(n+=t.normal.z*this.max.z,i+=t.normal.z*this.min.z),n<=-t.constant&&i>=-t.constant}intersectsTriangle(t){if(this.isEmpty())return!1;this.getCenter(ro),da.subVectors(this.max,ro),as.subVectors(t.a,ro),ls.subVectors(t.b,ro),cs.subVectors(t.c,ro),Qi.subVectors(ls,as),ji.subVectors(cs,ls),Pr.subVectors(as,cs);let n=[0,-Qi.z,Qi.y,0,-ji.z,ji.y,0,-Pr.z,Pr.y,Qi.z,0,-Qi.x,ji.z,0,-ji.x,Pr.z,0,-Pr.x,-Qi.y,Qi.x,0,-ji.y,ji.x,0,-Pr.y,Pr.x,0];return!fc(n,as,ls,cs,da)||(n=[1,0,0,0,1,0,0,0,1],!fc(n,as,ls,cs,da))?!1:(pa.crossVectors(Qi,ji),n=[pa.x,pa.y,pa.z],fc(n,as,ls,cs,da))}clampPoint(t,n){return n.copy(t).clamp(this.min,this.max)}distanceToPoint(t){return this.clampPoint(t,Jn).distanceTo(t)}getBoundingSphere(t){return this.isEmpty()?t.makeEmpty():(this.getCenter(t.center),t.radius=this.getSize(Jn).length()*.5),t}intersect(t){return this.min.max(t.min),this.max.min(t.max),this.isEmpty()&&this.makeEmpty(),this}union(t){return this.min.min(t.min),this.max.max(t.max),this}applyMatrix4(t){return this.isEmpty()?this:(Ci[0].set(this.min.x,this.min.y,this.min.z).applyMatrix4(t),Ci[1].set(this.min.x,this.min.y,this.max.z).applyMatrix4(t),Ci[2].set(this.min.x,this.max.y,this.min.z).applyMatrix4(t),Ci[3].set(this.min.x,this.max.y,this.max.z).applyMatrix4(t),Ci[4].set(this.max.x,this.min.y,this.min.z).applyMatrix4(t),Ci[5].set(this.max.x,this.min.y,this.max.z).applyMatrix4(t),Ci[6].set(this.max.x,this.max.y,this.min.z).applyMatrix4(t),Ci[7].set(this.max.x,this.max.y,this.max.z).applyMatrix4(t),this.setFromPoints(Ci),this)}translate(t){return this.min.add(t),this.max.add(t),this}equals(t){return t.min.equals(this.min)&&t.max.equals(this.max)}toJSON(){return{min:this.min.toArray(),max:this.max.toArray()}}fromJSON(t){return this.min.fromArray(t.min),this.max.fromArray(t.max),this}}const Ci=[new D,new D,new D,new D,new D,new D,new D,new D],Jn=new D,fa=new Ko,as=new D,ls=new D,cs=new D,Qi=new D,ji=new D,Pr=new D,ro=new D,da=new D,pa=new D,Cr=new D;function fc(e,t,n,i,r){for(let s=0,o=e.length-3;s<=o;s+=3){Cr.fromArray(e,s);const a=r.x*Math.abs(Cr.x)+r.y*Math.abs(Cr.y)+r.z*Math.abs(Cr.z),l=t.dot(Cr),c=n.dot(Cr),u=i.dot(Cr);if(Math.max(-Math.max(l,c,u),Math.min(l,c,u))>a)return!1}return!0}const uM=new Ko,so=new D,dc=new D;let Qo=class{constructor(t=new D,n=-1){this.isSphere=!0,this.center=t,this.radius=n}set(t,n){return this.center.copy(t),this.radius=n,this}setFromPoints(t,n){const i=this.center;n!==void 0?i.copy(n):uM.setFromPoints(t).getCenter(i);let r=0;for(let s=0,o=t.length;sthis.radius*this.radius&&(n.sub(this.center).normalize(),n.multiplyScalar(this.radius).add(this.center)),n}getBoundingBox(t){return this.isEmpty()?(t.makeEmpty(),t):(t.set(this.center,this.center),t.expandByScalar(this.radius),t)}applyMatrix4(t){return this.center.applyMatrix4(t),this.radius=this.radius*t.getMaxScaleOnAxis(),this}translate(t){return this.center.add(t),this}expandByPoint(t){if(this.isEmpty())return this.center.copy(t),this.radius=0,this;so.subVectors(t,this.center);const n=so.lengthSq();if(n>this.radius*this.radius){const i=Math.sqrt(n),r=(i-this.radius)*.5;this.center.addScaledVector(so,r/i),this.radius+=r}return this}union(t){return t.isEmpty()?this:this.isEmpty()?(this.copy(t),this):(this.center.equals(t.center)===!0?this.radius=Math.max(this.radius,t.radius):(dc.subVectors(t.center,this.center).setLength(t.radius),this.expandByPoint(so.copy(t.center).add(dc)),this.expandByPoint(so.copy(t.center).sub(dc))),this)}equals(t){return t.center.equals(this.center)&&t.radius===this.radius}clone(){return new this.constructor().copy(this)}toJSON(){return{radius:this.radius,center:this.center.toArray()}}fromJSON(t){return this.radius=t.radius,this.center.fromArray(t.center),this}};const Ri=new D,pc=new D,ma=new D,tr=new D,mc=new D,ga=new D,gc=new D;class jo{constructor(t=new D,n=new D(0,0,-1)){this.origin=t,this.direction=n}set(t,n){return this.origin.copy(t),this.direction.copy(n),this}copy(t){return this.origin.copy(t.origin),this.direction.copy(t.direction),this}at(t,n){return n.copy(this.origin).addScaledVector(this.direction,t)}lookAt(t){return this.direction.copy(t).sub(this.origin).normalize(),this}recast(t){return this.origin.copy(this.at(t,Ri)),this}closestPointToPoint(t,n){n.subVectors(t,this.origin);const i=n.dot(this.direction);return i<0?n.copy(this.origin):n.copy(this.origin).addScaledVector(this.direction,i)}distanceToPoint(t){return Math.sqrt(this.distanceSqToPoint(t))}distanceSqToPoint(t){const n=Ri.subVectors(t,this.origin).dot(this.direction);return n<0?this.origin.distanceToSquared(t):(Ri.copy(this.origin).addScaledVector(this.direction,n),Ri.distanceToSquared(t))}distanceSqToSegment(t,n,i,r){pc.copy(t).add(n).multiplyScalar(.5),ma.copy(n).sub(t).normalize(),tr.copy(this.origin).sub(pc);const s=t.distanceTo(n)*.5,o=-this.direction.dot(ma),a=tr.dot(this.direction),l=-tr.dot(ma),c=tr.lengthSq(),u=Math.abs(1-o*o);let h,f,p,g;if(u>0)if(h=o*l-a,f=o*a-l,g=s*u,h>=0)if(f>=-g)if(f<=g){const v=1/u;h*=v,f*=v,p=h*(h+o*f+2*a)+f*(o*h+f+2*l)+c}else f=s,h=Math.max(0,-(o*f+a)),p=-h*h+f*(f+2*l)+c;else f=-s,h=Math.max(0,-(o*f+a)),p=-h*h+f*(f+2*l)+c;else f<=-g?(h=Math.max(0,-(-o*s+a)),f=h>0?-s:Math.min(Math.max(-s,-l),s),p=-h*h+f*(f+2*l)+c):f<=g?(h=0,f=Math.min(Math.max(-s,-l),s),p=f*(f+2*l)+c):(h=Math.max(0,-(o*s+a)),f=h>0?s:Math.min(Math.max(-s,-l),s),p=-h*h+f*(f+2*l)+c);else f=o>0?-s:s,h=Math.max(0,-(o*f+a)),p=-h*h+f*(f+2*l)+c;return i&&i.copy(this.origin).addScaledVector(this.direction,h),r&&r.copy(pc).addScaledVector(ma,f),p}intersectSphere(t,n){Ri.subVectors(t.center,this.origin);const i=Ri.dot(this.direction),r=Ri.dot(Ri)-i*i,s=t.radius*t.radius;if(r>s)return null;const o=Math.sqrt(s-r),a=i-o,l=i+o;return l<0?null:a<0?this.at(l,n):this.at(a,n)}intersectsSphere(t){return t.radius<0?!1:this.distanceSqToPoint(t.center)<=t.radius*t.radius}distanceToPlane(t){const n=t.normal.dot(this.direction);if(n===0)return t.distanceToPoint(this.origin)===0?0:null;const i=-(this.origin.dot(t.normal)+t.constant)/n;return i>=0?i:null}intersectPlane(t,n){const i=this.distanceToPlane(t);return i===null?null:this.at(i,n)}intersectsPlane(t){const n=t.distanceToPoint(this.origin);return n===0||t.normal.dot(this.direction)*n<0}intersectBox(t,n){let i,r,s,o,a,l;const c=1/this.direction.x,u=1/this.direction.y,h=1/this.direction.z,f=this.origin;return c>=0?(i=(t.min.x-f.x)*c,r=(t.max.x-f.x)*c):(i=(t.max.x-f.x)*c,r=(t.min.x-f.x)*c),u>=0?(s=(t.min.y-f.y)*u,o=(t.max.y-f.y)*u):(s=(t.max.y-f.y)*u,o=(t.min.y-f.y)*u),i>o||s>r||((s>i||isNaN(i))&&(i=s),(o=0?(a=(t.min.z-f.z)*h,l=(t.max.z-f.z)*h):(a=(t.max.z-f.z)*h,l=(t.min.z-f.z)*h),i>l||a>r)||((a>i||i!==i)&&(i=a),(l=0?i:r,n)}intersectsBox(t){return this.intersectBox(t,Ri)!==null}intersectTriangle(t,n,i,r,s){mc.subVectors(n,t),ga.subVectors(i,t),gc.crossVectors(mc,ga);let o=this.direction.dot(gc),a;if(o>0){if(r)return null;a=1}else if(o<0)a=-1,o=-o;else return null;tr.subVectors(this.origin,t);const l=a*this.direction.dot(ga.crossVectors(tr,ga));if(l<0)return null;const c=a*this.direction.dot(mc.cross(tr));if(c<0||l+c>o)return null;const u=-a*tr.dot(gc);return u<0?null:this.at(u/o,s)}applyMatrix4(t){return this.origin.applyMatrix4(t),this.direction.transformDirection(t),this}equals(t){return t.origin.equals(this.origin)&&t.direction.equals(this.direction)}clone(){return new this.constructor().copy(this)}}class he{constructor(t,n,i,r,s,o,a,l,c,u,h,f,p,g,v,m){he.prototype.isMatrix4=!0,this.elements=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1],t!==void 0&&this.set(t,n,i,r,s,o,a,l,c,u,h,f,p,g,v,m)}set(t,n,i,r,s,o,a,l,c,u,h,f,p,g,v,m){const d=this.elements;return d[0]=t,d[4]=n,d[8]=i,d[12]=r,d[1]=s,d[5]=o,d[9]=a,d[13]=l,d[2]=c,d[6]=u,d[10]=h,d[14]=f,d[3]=p,d[7]=g,d[11]=v,d[15]=m,this}identity(){return this.set(1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1),this}clone(){return new he().fromArray(this.elements)}copy(t){const n=this.elements,i=t.elements;return n[0]=i[0],n[1]=i[1],n[2]=i[2],n[3]=i[3],n[4]=i[4],n[5]=i[5],n[6]=i[6],n[7]=i[7],n[8]=i[8],n[9]=i[9],n[10]=i[10],n[11]=i[11],n[12]=i[12],n[13]=i[13],n[14]=i[14],n[15]=i[15],this}copyPosition(t){const n=this.elements,i=t.elements;return n[12]=i[12],n[13]=i[13],n[14]=i[14],this}setFromMatrix3(t){const n=t.elements;return this.set(n[0],n[3],n[6],0,n[1],n[4],n[7],0,n[2],n[5],n[8],0,0,0,0,1),this}extractBasis(t,n,i){return this.determinant()===0?(t.set(1,0,0),n.set(0,1,0),i.set(0,0,1),this):(t.setFromMatrixColumn(this,0),n.setFromMatrixColumn(this,1),i.setFromMatrixColumn(this,2),this)}makeBasis(t,n,i){return this.set(t.x,n.x,i.x,0,t.y,n.y,i.y,0,t.z,n.z,i.z,0,0,0,0,1),this}extractRotation(t){if(t.determinant()===0)return this.identity();const n=this.elements,i=t.elements,r=1/us.setFromMatrixColumn(t,0).length(),s=1/us.setFromMatrixColumn(t,1).length(),o=1/us.setFromMatrixColumn(t,2).length();return n[0]=i[0]*r,n[1]=i[1]*r,n[2]=i[2]*r,n[3]=0,n[4]=i[4]*s,n[5]=i[5]*s,n[6]=i[6]*s,n[7]=0,n[8]=i[8]*o,n[9]=i[9]*o,n[10]=i[10]*o,n[11]=0,n[12]=0,n[13]=0,n[14]=0,n[15]=1,this}makeRotationFromEuler(t){const n=this.elements,i=t.x,r=t.y,s=t.z,o=Math.cos(i),a=Math.sin(i),l=Math.cos(r),c=Math.sin(r),u=Math.cos(s),h=Math.sin(s);if(t.order==="XYZ"){const f=o*u,p=o*h,g=a*u,v=a*h;n[0]=l*u,n[4]=-l*h,n[8]=c,n[1]=p+g*c,n[5]=f-v*c,n[9]=-a*l,n[2]=v-f*c,n[6]=g+p*c,n[10]=o*l}else if(t.order==="YXZ"){const f=l*u,p=l*h,g=c*u,v=c*h;n[0]=f+v*a,n[4]=g*a-p,n[8]=o*c,n[1]=o*h,n[5]=o*u,n[9]=-a,n[2]=p*a-g,n[6]=v+f*a,n[10]=o*l}else if(t.order==="ZXY"){const f=l*u,p=l*h,g=c*u,v=c*h;n[0]=f-v*a,n[4]=-o*h,n[8]=g+p*a,n[1]=p+g*a,n[5]=o*u,n[9]=v-f*a,n[2]=-o*c,n[6]=a,n[10]=o*l}else if(t.order==="ZYX"){const f=o*u,p=o*h,g=a*u,v=a*h;n[0]=l*u,n[4]=g*c-p,n[8]=f*c+v,n[1]=l*h,n[5]=v*c+f,n[9]=p*c-g,n[2]=-c,n[6]=a*l,n[10]=o*l}else if(t.order==="YZX"){const f=o*l,p=o*c,g=a*l,v=a*c;n[0]=l*u,n[4]=v-f*h,n[8]=g*h+p,n[1]=h,n[5]=o*u,n[9]=-a*u,n[2]=-c*u,n[6]=p*h+g,n[10]=f-v*h}else if(t.order==="XZY"){const f=o*l,p=o*c,g=a*l,v=a*c;n[0]=l*u,n[4]=-h,n[8]=c*u,n[1]=f*h+v,n[5]=o*u,n[9]=p*h-g,n[2]=g*h-p,n[6]=a*u,n[10]=v*h+f}return n[3]=0,n[7]=0,n[11]=0,n[12]=0,n[13]=0,n[14]=0,n[15]=1,this}makeRotationFromQuaternion(t){return this.compose(hM,t,fM)}lookAt(t,n,i){const r=this.elements;return Nn.subVectors(t,n),Nn.lengthSq()===0&&(Nn.z=1),Nn.normalize(),er.crossVectors(i,Nn),er.lengthSq()===0&&(Math.abs(i.z)===1?Nn.x+=1e-4:Nn.z+=1e-4,Nn.normalize(),er.crossVectors(i,Nn)),er.normalize(),_a.crossVectors(Nn,er),r[0]=er.x,r[4]=_a.x,r[8]=Nn.x,r[1]=er.y,r[5]=_a.y,r[9]=Nn.y,r[2]=er.z,r[6]=_a.z,r[10]=Nn.z,this}multiply(t){return this.multiplyMatrices(this,t)}premultiply(t){return this.multiplyMatrices(t,this)}multiplyMatrices(t,n){const i=t.elements,r=n.elements,s=this.elements,o=i[0],a=i[4],l=i[8],c=i[12],u=i[1],h=i[5],f=i[9],p=i[13],g=i[2],v=i[6],m=i[10],d=i[14],S=i[3],y=i[7],x=i[11],A=i[15],P=r[0],C=r[4],R=r[8],b=r[12],M=r[1],L=r[5],V=r[9],q=r[13],j=r[2],J=r[6],W=r[10],k=r[14],H=r[3],ct=r[7],pt=r[11],ft=r[15];return s[0]=o*P+a*M+l*j+c*H,s[4]=o*C+a*L+l*J+c*ct,s[8]=o*R+a*V+l*W+c*pt,s[12]=o*b+a*q+l*k+c*ft,s[1]=u*P+h*M+f*j+p*H,s[5]=u*C+h*L+f*J+p*ct,s[9]=u*R+h*V+f*W+p*pt,s[13]=u*b+h*q+f*k+p*ft,s[2]=g*P+v*M+m*j+d*H,s[6]=g*C+v*L+m*J+d*ct,s[10]=g*R+v*V+m*W+d*pt,s[14]=g*b+v*q+m*k+d*ft,s[3]=S*P+y*M+x*j+A*H,s[7]=S*C+y*L+x*J+A*ct,s[11]=S*R+y*V+x*W+A*pt,s[15]=S*b+y*q+x*k+A*ft,this}multiplyScalar(t){const n=this.elements;return n[0]*=t,n[4]*=t,n[8]*=t,n[12]*=t,n[1]*=t,n[5]*=t,n[9]*=t,n[13]*=t,n[2]*=t,n[6]*=t,n[10]*=t,n[14]*=t,n[3]*=t,n[7]*=t,n[11]*=t,n[15]*=t,this}determinant(){const t=this.elements,n=t[0],i=t[4],r=t[8],s=t[12],o=t[1],a=t[5],l=t[9],c=t[13],u=t[2],h=t[6],f=t[10],p=t[14],g=t[3],v=t[7],m=t[11],d=t[15],S=l*p-c*f,y=a*p-c*h,x=a*f-l*h,A=o*p-c*u,P=o*f-l*u,C=o*h-a*u;return n*(v*S-m*y+d*x)-i*(g*S-m*A+d*P)+r*(g*y-v*A+d*C)-s*(g*x-v*P+m*C)}transpose(){const t=this.elements;let n;return n=t[1],t[1]=t[4],t[4]=n,n=t[2],t[2]=t[8],t[8]=n,n=t[6],t[6]=t[9],t[9]=n,n=t[3],t[3]=t[12],t[12]=n,n=t[7],t[7]=t[13],t[13]=n,n=t[11],t[11]=t[14],t[14]=n,this}setPosition(t,n,i){const r=this.elements;return t.isVector3?(r[12]=t.x,r[13]=t.y,r[14]=t.z):(r[12]=t,r[13]=n,r[14]=i),this}invert(){const t=this.elements,n=t[0],i=t[1],r=t[2],s=t[3],o=t[4],a=t[5],l=t[6],c=t[7],u=t[8],h=t[9],f=t[10],p=t[11],g=t[12],v=t[13],m=t[14],d=t[15],S=h*m*c-v*f*c+v*l*p-a*m*p-h*l*d+a*f*d,y=g*f*c-u*m*c-g*l*p+o*m*p+u*l*d-o*f*d,x=u*v*c-g*h*c+g*a*p-o*v*p-u*a*d+o*h*d,A=g*h*l-u*v*l-g*a*f+o*v*f+u*a*m-o*h*m,P=n*S+i*y+r*x+s*A;if(P===0)return this.set(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0);const C=1/P;return t[0]=S*C,t[1]=(v*f*s-h*m*s-v*r*p+i*m*p+h*r*d-i*f*d)*C,t[2]=(a*m*s-v*l*s+v*r*c-i*m*c-a*r*d+i*l*d)*C,t[3]=(h*l*s-a*f*s-h*r*c+i*f*c+a*r*p-i*l*p)*C,t[4]=y*C,t[5]=(u*m*s-g*f*s+g*r*p-n*m*p-u*r*d+n*f*d)*C,t[6]=(g*l*s-o*m*s-g*r*c+n*m*c+o*r*d-n*l*d)*C,t[7]=(o*f*s-u*l*s+u*r*c-n*f*c-o*r*p+n*l*p)*C,t[8]=x*C,t[9]=(g*h*s-u*v*s-g*i*p+n*v*p+u*i*d-n*h*d)*C,t[10]=(o*v*s-g*a*s+g*i*c-n*v*c-o*i*d+n*a*d)*C,t[11]=(u*a*s-o*h*s-u*i*c+n*h*c+o*i*p-n*a*p)*C,t[12]=A*C,t[13]=(u*v*r-g*h*r+g*i*f-n*v*f-u*i*m+n*h*m)*C,t[14]=(g*a*r-o*v*r-g*i*l+n*v*l+o*i*m-n*a*m)*C,t[15]=(o*h*r-u*a*r+u*i*l-n*h*l-o*i*f+n*a*f)*C,this}scale(t){const n=this.elements,i=t.x,r=t.y,s=t.z;return n[0]*=i,n[4]*=r,n[8]*=s,n[1]*=i,n[5]*=r,n[9]*=s,n[2]*=i,n[6]*=r,n[10]*=s,n[3]*=i,n[7]*=r,n[11]*=s,this}getMaxScaleOnAxis(){const t=this.elements,n=t[0]*t[0]+t[1]*t[1]+t[2]*t[2],i=t[4]*t[4]+t[5]*t[5]+t[6]*t[6],r=t[8]*t[8]+t[9]*t[9]+t[10]*t[10];return Math.sqrt(Math.max(n,i,r))}makeTranslation(t,n,i){return t.isVector3?this.set(1,0,0,t.x,0,1,0,t.y,0,0,1,t.z,0,0,0,1):this.set(1,0,0,t,0,1,0,n,0,0,1,i,0,0,0,1),this}makeRotationX(t){const n=Math.cos(t),i=Math.sin(t);return this.set(1,0,0,0,0,n,-i,0,0,i,n,0,0,0,0,1),this}makeRotationY(t){const n=Math.cos(t),i=Math.sin(t);return this.set(n,0,i,0,0,1,0,0,-i,0,n,0,0,0,0,1),this}makeRotationZ(t){const n=Math.cos(t),i=Math.sin(t);return this.set(n,-i,0,0,i,n,0,0,0,0,1,0,0,0,0,1),this}makeRotationAxis(t,n){const i=Math.cos(n),r=Math.sin(n),s=1-i,o=t.x,a=t.y,l=t.z,c=s*o,u=s*a;return this.set(c*o+i,c*a-r*l,c*l+r*a,0,c*a+r*l,u*a+i,u*l-r*o,0,c*l-r*a,u*l+r*o,s*l*l+i,0,0,0,0,1),this}makeScale(t,n,i){return this.set(t,0,0,0,0,n,0,0,0,0,i,0,0,0,0,1),this}makeShear(t,n,i,r,s,o){return this.set(1,i,s,0,t,1,o,0,n,r,1,0,0,0,0,1),this}compose(t,n,i){const r=this.elements,s=n._x,o=n._y,a=n._z,l=n._w,c=s+s,u=o+o,h=a+a,f=s*c,p=s*u,g=s*h,v=o*u,m=o*h,d=a*h,S=l*c,y=l*u,x=l*h,A=i.x,P=i.y,C=i.z;return r[0]=(1-(v+d))*A,r[1]=(p+x)*A,r[2]=(g-y)*A,r[3]=0,r[4]=(p-x)*P,r[5]=(1-(f+d))*P,r[6]=(m+S)*P,r[7]=0,r[8]=(g+y)*C,r[9]=(m-S)*C,r[10]=(1-(f+v))*C,r[11]=0,r[12]=t.x,r[13]=t.y,r[14]=t.z,r[15]=1,this}decompose(t,n,i){const r=this.elements;if(t.x=r[12],t.y=r[13],t.z=r[14],this.determinant()===0)return i.set(1,1,1),n.identity(),this;let s=us.set(r[0],r[1],r[2]).length();const o=us.set(r[4],r[5],r[6]).length(),a=us.set(r[8],r[9],r[10]).length();this.determinant()<0&&(s=-s),$n.copy(this);const c=1/s,u=1/o,h=1/a;return $n.elements[0]*=c,$n.elements[1]*=c,$n.elements[2]*=c,$n.elements[4]*=u,$n.elements[5]*=u,$n.elements[6]*=u,$n.elements[8]*=h,$n.elements[9]*=h,$n.elements[10]*=h,n.setFromRotationMatrix($n),i.x=s,i.y=o,i.z=a,this}makePerspective(t,n,i,r,s,o,a=gi,l=!1){const c=this.elements,u=2*s/(n-t),h=2*s/(i-r),f=(n+t)/(n-t),p=(i+r)/(i-r);let g,v;if(l)g=s/(o-s),v=o*s/(o-s);else if(a===gi)g=-(o+s)/(o-s),v=-2*o*s/(o-s);else if(a===pl)g=-o/(o-s),v=-o*s/(o-s);else throw new Error("THREE.Matrix4.makePerspective(): Invalid coordinate system: "+a);return c[0]=u,c[4]=0,c[8]=f,c[12]=0,c[1]=0,c[5]=h,c[9]=p,c[13]=0,c[2]=0,c[6]=0,c[10]=g,c[14]=v,c[3]=0,c[7]=0,c[11]=-1,c[15]=0,this}makeOrthographic(t,n,i,r,s,o,a=gi,l=!1){const c=this.elements,u=2/(n-t),h=2/(i-r),f=-(n+t)/(n-t),p=-(i+r)/(i-r);let g,v;if(l)g=1/(o-s),v=o/(o-s);else if(a===gi)g=-2/(o-s),v=-(o+s)/(o-s);else if(a===pl)g=-1/(o-s),v=-s/(o-s);else throw new Error("THREE.Matrix4.makeOrthographic(): Invalid coordinate system: "+a);return c[0]=u,c[4]=0,c[8]=0,c[12]=f,c[1]=0,c[5]=h,c[9]=0,c[13]=p,c[2]=0,c[6]=0,c[10]=g,c[14]=v,c[3]=0,c[7]=0,c[11]=0,c[15]=1,this}equals(t){const n=this.elements,i=t.elements;for(let r=0;r<16;r++)if(n[r]!==i[r])return!1;return!0}fromArray(t,n=0){for(let i=0;i<16;i++)this.elements[i]=t[i+n];return this}toArray(t=[],n=0){const i=this.elements;return t[n]=i[0],t[n+1]=i[1],t[n+2]=i[2],t[n+3]=i[3],t[n+4]=i[4],t[n+5]=i[5],t[n+6]=i[6],t[n+7]=i[7],t[n+8]=i[8],t[n+9]=i[9],t[n+10]=i[10],t[n+11]=i[11],t[n+12]=i[12],t[n+13]=i[13],t[n+14]=i[14],t[n+15]=i[15],t}}const us=new D,$n=new he,hM=new D(0,0,0),fM=new D(1,1,1),er=new D,_a=new D,Nn=new D,Dp=new he,Ip=new nn;class ni{constructor(t=0,n=0,i=0,r=ni.DEFAULT_ORDER){this.isEuler=!0,this._x=t,this._y=n,this._z=i,this._order=r}get x(){return this._x}set x(t){this._x=t,this._onChangeCallback()}get y(){return this._y}set y(t){this._y=t,this._onChangeCallback()}get z(){return this._z}set z(t){this._z=t,this._onChangeCallback()}get order(){return this._order}set order(t){this._order=t,this._onChangeCallback()}set(t,n,i,r=this._order){return this._x=t,this._y=n,this._z=i,this._order=r,this._onChangeCallback(),this}clone(){return new this.constructor(this._x,this._y,this._z,this._order)}copy(t){return this._x=t._x,this._y=t._y,this._z=t._z,this._order=t._order,this._onChangeCallback(),this}setFromRotationMatrix(t,n=this._order,i=!0){const r=t.elements,s=r[0],o=r[4],a=r[8],l=r[1],c=r[5],u=r[9],h=r[2],f=r[6],p=r[10];switch(n){case"XYZ":this._y=Math.asin(re(a,-1,1)),Math.abs(a)<.9999999?(this._x=Math.atan2(-u,p),this._z=Math.atan2(-o,s)):(this._x=Math.atan2(f,c),this._z=0);break;case"YXZ":this._x=Math.asin(-re(u,-1,1)),Math.abs(u)<.9999999?(this._y=Math.atan2(a,p),this._z=Math.atan2(l,c)):(this._y=Math.atan2(-h,s),this._z=0);break;case"ZXY":this._x=Math.asin(re(f,-1,1)),Math.abs(f)<.9999999?(this._y=Math.atan2(-h,p),this._z=Math.atan2(-o,c)):(this._y=0,this._z=Math.atan2(l,s));break;case"ZYX":this._y=Math.asin(-re(h,-1,1)),Math.abs(h)<.9999999?(this._x=Math.atan2(f,p),this._z=Math.atan2(l,s)):(this._x=0,this._z=Math.atan2(-o,c));break;case"YZX":this._z=Math.asin(re(l,-1,1)),Math.abs(l)<.9999999?(this._x=Math.atan2(-u,c),this._y=Math.atan2(-h,s)):(this._x=0,this._y=Math.atan2(a,p));break;case"XZY":this._z=Math.asin(-re(o,-1,1)),Math.abs(o)<.9999999?(this._x=Math.atan2(f,c),this._y=Math.atan2(a,s)):(this._x=Math.atan2(-u,p),this._y=0);break;default:Yt("Euler: .setFromRotationMatrix() encountered an unknown order: "+n)}return this._order=n,i===!0&&this._onChangeCallback(),this}setFromQuaternion(t,n,i){return Dp.makeRotationFromQuaternion(t),this.setFromRotationMatrix(Dp,n,i)}setFromVector3(t,n=this._order){return this.set(t.x,t.y,t.z,n)}reorder(t){return Ip.setFromEuler(this),this.setFromQuaternion(Ip,t)}equals(t){return t._x===this._x&&t._y===this._y&&t._z===this._z&&t._order===this._order}fromArray(t){return this._x=t[0],this._y=t[1],this._z=t[2],t[3]!==void 0&&(this._order=t[3]),this._onChangeCallback(),this}toArray(t=[],n=0){return t[n]=this._x,t[n+1]=this._y,t[n+2]=this._z,t[n+3]=this._order,t}_onChange(t){return this._onChangeCallback=t,this}_onChangeCallback(){}*[Symbol.iterator](){yield this._x,yield this._y,yield this._z,yield this._order}}ni.DEFAULT_ORDER="XYZ";class _f{constructor(){this.mask=1}set(t){this.mask=(1<>>0}enable(t){this.mask|=1<1){for(let n=0;n1){for(let i=0;i0&&(r.userData=this.userData),r.layers=this.layers.mask,r.matrix=this.matrix.toArray(),r.up=this.up.toArray(),this.matrixAutoUpdate===!1&&(r.matrixAutoUpdate=!1),this.isInstancedMesh&&(r.type="InstancedMesh",r.count=this.count,r.instanceMatrix=this.instanceMatrix.toJSON(),this.instanceColor!==null&&(r.instanceColor=this.instanceColor.toJSON())),this.isBatchedMesh&&(r.type="BatchedMesh",r.perObjectFrustumCulled=this.perObjectFrustumCulled,r.sortObjects=this.sortObjects,r.drawRanges=this._drawRanges,r.reservedRanges=this._reservedRanges,r.geometryInfo=this._geometryInfo.map(a=>({...a,boundingBox:a.boundingBox?a.boundingBox.toJSON():void 0,boundingSphere:a.boundingSphere?a.boundingSphere.toJSON():void 0})),r.instanceInfo=this._instanceInfo.map(a=>({...a})),r.availableInstanceIds=this._availableInstanceIds.slice(),r.availableGeometryIds=this._availableGeometryIds.slice(),r.nextIndexStart=this._nextIndexStart,r.nextVertexStart=this._nextVertexStart,r.geometryCount=this._geometryCount,r.maxInstanceCount=this._maxInstanceCount,r.maxVertexCount=this._maxVertexCount,r.maxIndexCount=this._maxIndexCount,r.geometryInitialized=this._geometryInitialized,r.matricesTexture=this._matricesTexture.toJSON(t),r.indirectTexture=this._indirectTexture.toJSON(t),this._colorsTexture!==null&&(r.colorsTexture=this._colorsTexture.toJSON(t)),this.boundingSphere!==null&&(r.boundingSphere=this.boundingSphere.toJSON()),this.boundingBox!==null&&(r.boundingBox=this.boundingBox.toJSON()));function s(a,l){return a[l.uuid]===void 0&&(a[l.uuid]=l.toJSON(t)),l.uuid}if(this.isScene)this.background&&(this.background.isColor?r.background=this.background.toJSON():this.background.isTexture&&(r.background=this.background.toJSON(t).uuid)),this.environment&&this.environment.isTexture&&this.environment.isRenderTargetTexture!==!0&&(r.environment=this.environment.toJSON(t).uuid);else if(this.isMesh||this.isLine||this.isPoints){r.geometry=s(t.geometries,this.geometry);const a=this.geometry.parameters;if(a!==void 0&&a.shapes!==void 0){const l=a.shapes;if(Array.isArray(l))for(let c=0,u=l.length;c0){r.children=[];for(let a=0;a0){r.animations=[];for(let a=0;a0&&(i.geometries=a),l.length>0&&(i.materials=l),c.length>0&&(i.textures=c),u.length>0&&(i.images=u),h.length>0&&(i.shapes=h),f.length>0&&(i.skeletons=f),p.length>0&&(i.animations=p),g.length>0&&(i.nodes=g)}return i.object=r,i;function o(a){const l=[];for(const c in a){const u=a[c];delete u.metadata,l.push(u)}return l}}clone(t){return new this.constructor().copy(this,t)}copy(t,n=!0){if(this.name=t.name,this.up.copy(t.up),this.position.copy(t.position),this.rotation.order=t.rotation.order,this.quaternion.copy(t.quaternion),this.scale.copy(t.scale),this.matrix.copy(t.matrix),this.matrixWorld.copy(t.matrixWorld),this.matrixAutoUpdate=t.matrixAutoUpdate,this.matrixWorldAutoUpdate=t.matrixWorldAutoUpdate,this.matrixWorldNeedsUpdate=t.matrixWorldNeedsUpdate,this.layers.mask=t.layers.mask,this.visible=t.visible,this.castShadow=t.castShadow,this.receiveShadow=t.receiveShadow,this.frustumCulled=t.frustumCulled,this.renderOrder=t.renderOrder,this.animations=t.animations.slice(),this.userData=JSON.parse(JSON.stringify(t.userData)),n===!0)for(let i=0;i0?r.multiplyScalar(1/Math.sqrt(s)):r.set(0,0,0)}static getBarycoord(t,n,i,r,s){Zn.subVectors(r,n),Ii.subVectors(i,n),vc.subVectors(t,n);const o=Zn.dot(Zn),a=Zn.dot(Ii),l=Zn.dot(vc),c=Ii.dot(Ii),u=Ii.dot(vc),h=o*c-a*a;if(h===0)return s.set(0,0,0),null;const f=1/h,p=(c*l-a*u)*f,g=(o*u-a*l)*f;return s.set(1-p-g,g,p)}static containsPoint(t,n,i,r){return this.getBarycoord(t,n,i,r,Li)===null?!1:Li.x>=0&&Li.y>=0&&Li.x+Li.y<=1}static getInterpolation(t,n,i,r,s,o,a,l){return this.getBarycoord(t,n,i,r,Li)===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(s,Li.x),l.addScaledVector(o,Li.y),l.addScaledVector(a,Li.z),l)}static getInterpolatedAttribute(t,n,i,r,s,o){return bc.setScalar(0),Mc.setScalar(0),wc.setScalar(0),bc.fromBufferAttribute(t,n),Mc.fromBufferAttribute(t,i),wc.fromBufferAttribute(t,r),o.setScalar(0),o.addScaledVector(bc,s.x),o.addScaledVector(Mc,s.y),o.addScaledVector(wc,s.z),o}static isFrontFacing(t,n,i,r){return Zn.subVectors(i,n),Ii.subVectors(t,n),Zn.cross(Ii).dot(r)<0}set(t,n,i){return this.a.copy(t),this.b.copy(n),this.c.copy(i),this}setFromPointsAndIndices(t,n,i,r){return this.a.copy(t[n]),this.b.copy(t[i]),this.c.copy(t[r]),this}setFromAttributeAndIndices(t,n,i,r){return this.a.fromBufferAttribute(t,n),this.b.fromBufferAttribute(t,i),this.c.fromBufferAttribute(t,r),this}clone(){return new this.constructor().copy(this)}copy(t){return this.a.copy(t.a),this.b.copy(t.b),this.c.copy(t.c),this}getArea(){return Zn.subVectors(this.c,this.b),Ii.subVectors(this.a,this.b),Zn.cross(Ii).length()*.5}getMidpoint(t){return t.addVectors(this.a,this.b).add(this.c).multiplyScalar(1/3)}getNormal(t){return Kn.getNormal(this.a,this.b,this.c,t)}getPlane(t){return t.setFromCoplanarPoints(this.a,this.b,this.c)}getBarycoord(t,n){return Kn.getBarycoord(t,this.a,this.b,this.c,n)}getInterpolation(t,n,i,r,s){return Kn.getInterpolation(t,this.a,this.b,this.c,n,i,r,s)}containsPoint(t){return Kn.containsPoint(t,this.a,this.b,this.c)}isFrontFacing(t){return Kn.isFrontFacing(this.a,this.b,this.c,t)}intersectsBox(t){return t.intersectsTriangle(this)}closestPointToPoint(t,n){const i=this.a,r=this.b,s=this.c;let o,a;ds.subVectors(r,i),ps.subVectors(s,i),xc.subVectors(t,i);const l=ds.dot(xc),c=ps.dot(xc);if(l<=0&&c<=0)return n.copy(i);yc.subVectors(t,r);const u=ds.dot(yc),h=ps.dot(yc);if(u>=0&&h<=u)return n.copy(r);const f=l*h-u*c;if(f<=0&&l>=0&&u<=0)return o=l/(l-u),n.copy(i).addScaledVector(ds,o);Sc.subVectors(t,s);const p=ds.dot(Sc),g=ps.dot(Sc);if(g>=0&&p<=g)return n.copy(s);const v=p*c-l*g;if(v<=0&&c>=0&&g<=0)return a=c/(c-g),n.copy(i).addScaledVector(ps,a);const m=u*g-p*h;if(m<=0&&h-u>=0&&p-g>=0)return kp.subVectors(s,r),a=(h-u)/(h-u+(p-g)),n.copy(r).addScaledVector(kp,a);const d=1/(m+v+f);return o=v*d,a=f*d,n.copy(i).addScaledVector(ds,o).addScaledVector(ps,a)}equals(t){return t.a.equals(this.a)&&t.b.equals(this.b)&&t.c.equals(this.c)}}const K0={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},nr={h:0,s:0,l:0},xa={h:0,s:0,l:0};function Ec(e,t,n){return n<0&&(n+=1),n>1&&(n-=1),n<1/6?e+(t-e)*6*n:n<1/2?t:n<2/3?e+(t-e)*6*(2/3-n):e}class $t{constructor(t,n,i){return this.isColor=!0,this.r=1,this.g=1,this.b=1,this.set(t,n,i)}set(t,n,i){if(n===void 0&&i===void 0){const r=t;r&&r.isColor?this.copy(r):typeof r=="number"?this.setHex(r):typeof r=="string"&&this.setStyle(r)}else this.setRGB(t,n,i);return this}setScalar(t){return this.r=t,this.g=t,this.b=t,this}setHex(t,n=On){return t=Math.floor(t),this.r=(t>>16&255)/255,this.g=(t>>8&255)/255,this.b=(t&255)/255,me.colorSpaceToWorking(this,n),this}setRGB(t,n,i,r=me.workingColorSpace){return this.r=t,this.g=n,this.b=i,me.colorSpaceToWorking(this,r),this}setHSL(t,n,i,r=me.workingColorSpace){if(t=mf(t,1),n=re(n,0,1),i=re(i,0,1),n===0)this.r=this.g=this.b=i;else{const s=i<=.5?i*(1+n):i+n-i*n,o=2*i-s;this.r=Ec(o,s,t+1/3),this.g=Ec(o,s,t),this.b=Ec(o,s,t-1/3)}return me.colorSpaceToWorking(this,r),this}setStyle(t,n=On){function i(s){s!==void 0&&parseFloat(s)<1&&Yt("Color: Alpha component of "+t+" will be ignored.")}let r;if(r=/^(\w+)\(([^\)]*)\)/.exec(t)){let s;const o=r[1],a=r[2];switch(o){case"rgb":case"rgba":if(s=/^\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec(a))return i(s[4]),this.setRGB(Math.min(255,parseInt(s[1],10))/255,Math.min(255,parseInt(s[2],10))/255,Math.min(255,parseInt(s[3],10))/255,n);if(s=/^\s*(\d+)\%\s*,\s*(\d+)\%\s*,\s*(\d+)\%\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec(a))return i(s[4]),this.setRGB(Math.min(100,parseInt(s[1],10))/100,Math.min(100,parseInt(s[2],10))/100,Math.min(100,parseInt(s[3],10))/100,n);break;case"hsl":case"hsla":if(s=/^\s*(\d*\.?\d+)\s*,\s*(\d*\.?\d+)\%\s*,\s*(\d*\.?\d+)\%\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec(a))return i(s[4]),this.setHSL(parseFloat(s[1])/360,parseFloat(s[2])/100,parseFloat(s[3])/100,n);break;default:Yt("Color: Unknown color model "+t)}}else if(r=/^\#([A-Fa-f\d]+)$/.exec(t)){const s=r[1],o=s.length;if(o===3)return this.setRGB(parseInt(s.charAt(0),16)/15,parseInt(s.charAt(1),16)/15,parseInt(s.charAt(2),16)/15,n);if(o===6)return this.setHex(parseInt(s,16),n);Yt("Color: Invalid hex color "+t)}else if(t&&t.length>0)return this.setColorName(t,n);return this}setColorName(t,n=On){const i=K0[t.toLowerCase()];return i!==void 0?this.setHex(i,n):Yt("Color: Unknown color "+t),this}clone(){return new this.constructor(this.r,this.g,this.b)}copy(t){return this.r=t.r,this.g=t.g,this.b=t.b,this}copySRGBToLinear(t){return this.r=Hi(t.r),this.g=Hi(t.g),this.b=Hi(t.b),this}copyLinearToSRGB(t){return this.r=Ls(t.r),this.g=Ls(t.g),this.b=Ls(t.b),this}convertSRGBToLinear(){return this.copySRGBToLinear(this),this}convertLinearToSRGB(){return this.copyLinearToSRGB(this),this}getHex(t=On){return me.workingToColorSpace(ln.copy(this),t),Math.round(re(ln.r*255,0,255))*65536+Math.round(re(ln.g*255,0,255))*256+Math.round(re(ln.b*255,0,255))}getHexString(t=On){return("000000"+this.getHex(t).toString(16)).slice(-6)}getHSL(t,n=me.workingColorSpace){me.workingToColorSpace(ln.copy(this),n);const i=ln.r,r=ln.g,s=ln.b,o=Math.max(i,r,s),a=Math.min(i,r,s);let l,c;const u=(a+o)/2;if(a===o)l=0,c=0;else{const h=o-a;switch(c=u<=.5?h/(o+a):h/(2-o-a),o){case i:l=(r-s)/h+(r0!=t>0&&this.version++,this._alphaTest=t}onBeforeRender(){}onBeforeCompile(){}customProgramCacheKey(){return this.onBeforeCompile.toString()}setValues(t){if(t!==void 0)for(const n in t){const i=t[n];if(i===void 0){Yt(`Material: parameter '${n}' has value of undefined.`);continue}const r=this[n];if(r===void 0){Yt(`Material: '${n}' is not a property of THREE.${this.type}.`);continue}r&&r.isColor?r.set(i):r&&r.isVector3&&i&&i.isVector3?r.copy(i):this[n]=i}}toJSON(t){const n=t===void 0||typeof t=="string";n&&(t={textures:{},images:{}});const i={metadata:{version:4.7,type:"Material",generator:"Material.toJSON"}};i.uuid=this.uuid,i.type=this.type,this.name!==""&&(i.name=this.name),this.color&&this.color.isColor&&(i.color=this.color.getHex()),this.roughness!==void 0&&(i.roughness=this.roughness),this.metalness!==void 0&&(i.metalness=this.metalness),this.sheen!==void 0&&(i.sheen=this.sheen),this.sheenColor&&this.sheenColor.isColor&&(i.sheenColor=this.sheenColor.getHex()),this.sheenRoughness!==void 0&&(i.sheenRoughness=this.sheenRoughness),this.emissive&&this.emissive.isColor&&(i.emissive=this.emissive.getHex()),this.emissiveIntensity!==void 0&&this.emissiveIntensity!==1&&(i.emissiveIntensity=this.emissiveIntensity),this.specular&&this.specular.isColor&&(i.specular=this.specular.getHex()),this.specularIntensity!==void 0&&(i.specularIntensity=this.specularIntensity),this.specularColor&&this.specularColor.isColor&&(i.specularColor=this.specularColor.getHex()),this.shininess!==void 0&&(i.shininess=this.shininess),this.clearcoat!==void 0&&(i.clearcoat=this.clearcoat),this.clearcoatRoughness!==void 0&&(i.clearcoatRoughness=this.clearcoatRoughness),this.clearcoatMap&&this.clearcoatMap.isTexture&&(i.clearcoatMap=this.clearcoatMap.toJSON(t).uuid),this.clearcoatRoughnessMap&&this.clearcoatRoughnessMap.isTexture&&(i.clearcoatRoughnessMap=this.clearcoatRoughnessMap.toJSON(t).uuid),this.clearcoatNormalMap&&this.clearcoatNormalMap.isTexture&&(i.clearcoatNormalMap=this.clearcoatNormalMap.toJSON(t).uuid,i.clearcoatNormalScale=this.clearcoatNormalScale.toArray()),this.sheenColorMap&&this.sheenColorMap.isTexture&&(i.sheenColorMap=this.sheenColorMap.toJSON(t).uuid),this.sheenRoughnessMap&&this.sheenRoughnessMap.isTexture&&(i.sheenRoughnessMap=this.sheenRoughnessMap.toJSON(t).uuid),this.dispersion!==void 0&&(i.dispersion=this.dispersion),this.iridescence!==void 0&&(i.iridescence=this.iridescence),this.iridescenceIOR!==void 0&&(i.iridescenceIOR=this.iridescenceIOR),this.iridescenceThicknessRange!==void 0&&(i.iridescenceThicknessRange=this.iridescenceThicknessRange),this.iridescenceMap&&this.iridescenceMap.isTexture&&(i.iridescenceMap=this.iridescenceMap.toJSON(t).uuid),this.iridescenceThicknessMap&&this.iridescenceThicknessMap.isTexture&&(i.iridescenceThicknessMap=this.iridescenceThicknessMap.toJSON(t).uuid),this.anisotropy!==void 0&&(i.anisotropy=this.anisotropy),this.anisotropyRotation!==void 0&&(i.anisotropyRotation=this.anisotropyRotation),this.anisotropyMap&&this.anisotropyMap.isTexture&&(i.anisotropyMap=this.anisotropyMap.toJSON(t).uuid),this.map&&this.map.isTexture&&(i.map=this.map.toJSON(t).uuid),this.matcap&&this.matcap.isTexture&&(i.matcap=this.matcap.toJSON(t).uuid),this.alphaMap&&this.alphaMap.isTexture&&(i.alphaMap=this.alphaMap.toJSON(t).uuid),this.lightMap&&this.lightMap.isTexture&&(i.lightMap=this.lightMap.toJSON(t).uuid,i.lightMapIntensity=this.lightMapIntensity),this.aoMap&&this.aoMap.isTexture&&(i.aoMap=this.aoMap.toJSON(t).uuid,i.aoMapIntensity=this.aoMapIntensity),this.bumpMap&&this.bumpMap.isTexture&&(i.bumpMap=this.bumpMap.toJSON(t).uuid,i.bumpScale=this.bumpScale),this.normalMap&&this.normalMap.isTexture&&(i.normalMap=this.normalMap.toJSON(t).uuid,i.normalMapType=this.normalMapType,i.normalScale=this.normalScale.toArray()),this.displacementMap&&this.displacementMap.isTexture&&(i.displacementMap=this.displacementMap.toJSON(t).uuid,i.displacementScale=this.displacementScale,i.displacementBias=this.displacementBias),this.roughnessMap&&this.roughnessMap.isTexture&&(i.roughnessMap=this.roughnessMap.toJSON(t).uuid),this.metalnessMap&&this.metalnessMap.isTexture&&(i.metalnessMap=this.metalnessMap.toJSON(t).uuid),this.emissiveMap&&this.emissiveMap.isTexture&&(i.emissiveMap=this.emissiveMap.toJSON(t).uuid),this.specularMap&&this.specularMap.isTexture&&(i.specularMap=this.specularMap.toJSON(t).uuid),this.specularIntensityMap&&this.specularIntensityMap.isTexture&&(i.specularIntensityMap=this.specularIntensityMap.toJSON(t).uuid),this.specularColorMap&&this.specularColorMap.isTexture&&(i.specularColorMap=this.specularColorMap.toJSON(t).uuid),this.envMap&&this.envMap.isTexture&&(i.envMap=this.envMap.toJSON(t).uuid,this.combine!==void 0&&(i.combine=this.combine)),this.envMapRotation!==void 0&&(i.envMapRotation=this.envMapRotation.toArray()),this.envMapIntensity!==void 0&&(i.envMapIntensity=this.envMapIntensity),this.reflectivity!==void 0&&(i.reflectivity=this.reflectivity),this.refractionRatio!==void 0&&(i.refractionRatio=this.refractionRatio),this.gradientMap&&this.gradientMap.isTexture&&(i.gradientMap=this.gradientMap.toJSON(t).uuid),this.transmission!==void 0&&(i.transmission=this.transmission),this.transmissionMap&&this.transmissionMap.isTexture&&(i.transmissionMap=this.transmissionMap.toJSON(t).uuid),this.thickness!==void 0&&(i.thickness=this.thickness),this.thicknessMap&&this.thicknessMap.isTexture&&(i.thicknessMap=this.thicknessMap.toJSON(t).uuid),this.attenuationDistance!==void 0&&this.attenuationDistance!==1/0&&(i.attenuationDistance=this.attenuationDistance),this.attenuationColor!==void 0&&(i.attenuationColor=this.attenuationColor.getHex()),this.size!==void 0&&(i.size=this.size),this.shadowSide!==null&&(i.shadowSide=this.shadowSide),this.sizeAttenuation!==void 0&&(i.sizeAttenuation=this.sizeAttenuation),this.blending!==Is&&(i.blending=this.blending),this.side!==yr&&(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!==lu&&(i.blendSrc=this.blendSrc),this.blendDst!==cu&&(i.blendDst=this.blendDst),this.blendEquation!==Fr&&(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!==Fs&&(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!==bp&&(i.stencilFunc=this.stencilFunc),this.stencilRef!==0&&(i.stencilRef=this.stencilRef),this.stencilFuncMask!==255&&(i.stencilFuncMask=this.stencilFuncMask),this.stencilFail!==ss&&(i.stencilFail=this.stencilFail),this.stencilZFail!==ss&&(i.stencilZFail=this.stencilZFail),this.stencilZPass!==ss&&(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.allowOverride===!1&&(i.allowOverride=!1),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 r(s){const o=[];for(const a in s){const l=s[a];delete l.metadata,o.push(l)}return o}if(n){const s=r(t.textures),o=r(t.images);s.length>0&&(i.textures=s),o.length>0&&(i.images=o)}return i}clone(){return new this.constructor().copy(this)}copy(t){this.name=t.name,this.blending=t.blending,this.side=t.side,this.vertexColors=t.vertexColors,this.opacity=t.opacity,this.transparent=t.transparent,this.blendSrc=t.blendSrc,this.blendDst=t.blendDst,this.blendEquation=t.blendEquation,this.blendSrcAlpha=t.blendSrcAlpha,this.blendDstAlpha=t.blendDstAlpha,this.blendEquationAlpha=t.blendEquationAlpha,this.blendColor.copy(t.blendColor),this.blendAlpha=t.blendAlpha,this.depthFunc=t.depthFunc,this.depthTest=t.depthTest,this.depthWrite=t.depthWrite,this.stencilWriteMask=t.stencilWriteMask,this.stencilFunc=t.stencilFunc,this.stencilRef=t.stencilRef,this.stencilFuncMask=t.stencilFuncMask,this.stencilFail=t.stencilFail,this.stencilZFail=t.stencilZFail,this.stencilZPass=t.stencilZPass,this.stencilWrite=t.stencilWrite;const n=t.clippingPlanes;let i=null;if(n!==null){const r=n.length;i=new Array(r);for(let s=0;s!==r;++s)i[s]=n[s].clone()}return this.clippingPlanes=i,this.clipIntersection=t.clipIntersection,this.clipShadows=t.clipShadows,this.shadowSide=t.shadowSide,this.colorWrite=t.colorWrite,this.precision=t.precision,this.polygonOffset=t.polygonOffset,this.polygonOffsetFactor=t.polygonOffsetFactor,this.polygonOffsetUnits=t.polygonOffsetUnits,this.dithering=t.dithering,this.alphaTest=t.alphaTest,this.alphaHash=t.alphaHash,this.alphaToCoverage=t.alphaToCoverage,this.premultipliedAlpha=t.premultipliedAlpha,this.forceSinglePass=t.forceSinglePass,this.allowOverride=t.allowOverride,this.visible=t.visible,this.toneMapped=t.toneMapped,this.userData=JSON.parse(JSON.stringify(t.userData)),this}dispose(){this.dispatchEvent({type:"dispose"})}set needsUpdate(t){t===!0&&this.version++}}class Sr extends es{constructor(t){super(),this.isMeshBasicMaterial=!0,this.type="MeshBasicMaterial",this.color=new $t(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 ni,this.combine=L0,this.reflectivity=1,this.refractionRatio=.98,this.wireframe=!1,this.wireframeLinewidth=1,this.wireframeLinecap="round",this.wireframeLinejoin="round",this.fog=!0,this.setValues(t)}copy(t){return super.copy(t),this.color.copy(t.color),this.map=t.map,this.lightMap=t.lightMap,this.lightMapIntensity=t.lightMapIntensity,this.aoMap=t.aoMap,this.aoMapIntensity=t.aoMapIntensity,this.specularMap=t.specularMap,this.alphaMap=t.alphaMap,this.envMap=t.envMap,this.envMapRotation.copy(t.envMapRotation),this.combine=t.combine,this.reflectivity=t.reflectivity,this.refractionRatio=t.refractionRatio,this.wireframe=t.wireframe,this.wireframeLinewidth=t.wireframeLinewidth,this.wireframeLinecap=t.wireframeLinecap,this.wireframeLinejoin=t.wireframeLinejoin,this.fog=t.fog,this}}const Xe=new D,ya=new mt;let vM=0;class bn{constructor(t,n,i=!1){if(Array.isArray(t))throw new TypeError("THREE.BufferAttribute: array should be a Typed Array.");this.isBufferAttribute=!0,Object.defineProperty(this,"id",{value:vM++}),this.name="",this.array=t,this.itemSize=n,this.count=t!==void 0?t.length/n:0,this.normalized=i,this.usage=Mp,this.updateRanges=[],this.gpuType=mi,this.version=0}onUploadCallback(){}set needsUpdate(t){t===!0&&this.version++}setUsage(t){return this.usage=t,this}addUpdateRange(t,n){this.updateRanges.push({start:t,count:n})}clearUpdateRanges(){this.updateRanges.length=0}copy(t){return this.name=t.name,this.array=new t.array.constructor(t.array),this.itemSize=t.itemSize,this.count=t.count,this.normalized=t.normalized,this.usage=t.usage,this.gpuType=t.gpuType,this}copyAt(t,n,i){t*=this.itemSize,i*=n.itemSize;for(let r=0,s=this.itemSize;rn.count&&Yt("BufferGeometry: Buffer size too small for points data. Use .dispose() and create a new geometry."),n.needsUpdate=!0}return this}computeBoundingBox(){this.boundingBox===null&&(this.boundingBox=new Ko);const t=this.attributes.position,n=this.morphAttributes.position;if(t&&t.isGLBufferAttribute){de("BufferGeometry.computeBoundingBox(): GLBufferAttribute requires a manual bounding box.",this),this.boundingBox.set(new D(-1/0,-1/0,-1/0),new D(1/0,1/0,1/0));return}if(t!==void 0){if(this.boundingBox.setFromBufferAttribute(t),n)for(let i=0,r=n.length;i0&&(t.userData=this.userData),this.parameters!==void 0){const l=this.parameters;for(const c in l)l[c]!==void 0&&(t[c]=l[c]);return t}t.data={attributes:{}};const n=this.index;n!==null&&(t.data.index={type:n.array.constructor.name,array:Array.prototype.slice.call(n.array)});const i=this.attributes;for(const l in i){const c=i[l];t.data.attributes[l]=c.toJSON(t.data)}const r={};let s=!1;for(const l in this.morphAttributes){const c=this.morphAttributes[l],u=[];for(let h=0,f=c.length;h0&&(r[l]=u,s=!0)}s&&(t.data.morphAttributes=r,t.data.morphTargetsRelative=this.morphTargetsRelative);const o=this.groups;o.length>0&&(t.data.groups=JSON.parse(JSON.stringify(o)));const a=this.boundingSphere;return a!==null&&(t.data.boundingSphere=a.toJSON()),t}clone(){return new this.constructor().copy(this)}copy(t){this.index=null,this.attributes={},this.morphAttributes={},this.groups=[],this.boundingBox=null,this.boundingSphere=null;const n={};this.name=t.name;const i=t.index;i!==null&&this.setIndex(i.clone());const r=t.attributes;for(const c in r){const u=r[c];this.setAttribute(c,u.clone(n))}const s=t.morphAttributes;for(const c in s){const u=[],h=s[c];for(let f=0,p=h.length;f0){const r=n[i[0]];if(r!==void 0){this.morphTargetInfluences=[],this.morphTargetDictionary={};for(let s=0,o=r.length;s(t.far-t.near)**2))&&(Bp.copy(s).invert(),Rr.copy(t.ray).applyMatrix4(Bp),!(i.boundingBox!==null&&Rr.intersectsBox(i.boundingBox)===!1)&&this._computeIntersections(t,n,Rr)))}_computeIntersections(t,n,i){let r;const s=this.geometry,o=this.material,a=s.index,l=s.attributes.position,c=s.attributes.uv,u=s.attributes.uv1,h=s.attributes.normal,f=s.groups,p=s.drawRange;if(a!==null)if(Array.isArray(o))for(let g=0,v=f.length;gn.far?null:{distance:c,point:Ta.clone(),object:e}}function Aa(e,t,n,i,r,s,o,a,l,c){e.getVertexPosition(a,ba),e.getVertexPosition(l,Ma),e.getVertexPosition(c,wa);const u=yM(e,t,n,i,ba,Ma,wa,Vp);if(u){const h=new D;Kn.getBarycoord(Vp,ba,Ma,wa,h),r&&(u.uv=Kn.getInterpolatedAttribute(r,a,l,c,h,new mt)),s&&(u.uv1=Kn.getInterpolatedAttribute(s,a,l,c,h,new mt)),o&&(u.normal=Kn.getInterpolatedAttribute(o,a,l,c,h,new D),u.normal.dot(i.direction)>0&&u.normal.multiplyScalar(-1));const f={a,b:l,c,normal:new D,materialIndex:0};Kn.getNormal(ba,Ma,wa,f.normal),u.face=f,u.barycoord=h}return u}class Be extends fe{constructor(t=1,n=1,i=1,r=1,s=1,o=1){super(),this.type="BoxGeometry",this.parameters={width:t,height:n,depth:i,widthSegments:r,heightSegments:s,depthSegments:o};const a=this;r=Math.floor(r),s=Math.floor(s),o=Math.floor(o);const l=[],c=[],u=[],h=[];let f=0,p=0;g("z","y","x",-1,-1,i,n,t,o,s,0),g("z","y","x",1,-1,i,n,-t,o,s,1),g("x","z","y",1,1,t,i,n,r,o,2),g("x","z","y",1,-1,t,i,-n,r,o,3),g("x","y","z",1,-1,t,n,i,r,s,4),g("x","y","z",-1,-1,t,n,-i,r,s,5),this.setIndex(l),this.setAttribute("position",new te(c,3)),this.setAttribute("normal",new te(u,3)),this.setAttribute("uv",new te(h,2));function g(v,m,d,S,y,x,A,P,C,R,b){const M=x/C,L=A/R,V=x/2,q=A/2,j=P/2,J=C+1,W=R+1;let k=0,H=0;const ct=new D;for(let pt=0;pt0?1:-1,u.push(ct.x,ct.y,ct.z),h.push(kt/C),h.push(1-pt/R),k+=1}}for(let pt=0;pt{for(const s of r)if(s.type==="childList")for(const o of s.addedNodes)o.tagName==="LINK"&&o.rel==="modulepreload"&&i(o)}).observe(document,{childList:!0,subtree:!0});function n(r){const s={};return r.integrity&&(s.integrity=r.integrity),r.referrerPolicy&&(s.referrerPolicy=r.referrerPolicy),r.crossOrigin==="use-credentials"?s.credentials="include":r.crossOrigin==="anonymous"?s.credentials="omit":s.credentials="same-origin",s}function i(r){if(r.ep)return;r.ep=!0;const s=n(r);fetch(r.href,s)}})();function ch(e){const t=Object.create(null);for(const n of e.split(","))t[n]=1;return n=>n in t}const Ie={},Es=[],_i=()=>{},Km=()=>!1,bl=e=>e.charCodeAt(0)===111&&e.charCodeAt(1)===110&&(e.charCodeAt(2)>122||e.charCodeAt(2)<97),uh=e=>e.startsWith("onUpdate:"),on=Object.assign,hh=(e,t)=>{const n=e.indexOf(t);n>-1&&e.splice(n,1)},G_=Object.prototype.hasOwnProperty,ve=(e,t)=>G_.call(e,t),Kt=Array.isArray,Ts=e=>Yo(e)==="[object Map]",Qm=e=>Yo(e)==="[object Set]",Wf=e=>Yo(e)==="[object Date]",jt=e=>typeof e=="function",We=e=>typeof e=="string",ti=e=>typeof e=="symbol",xe=e=>e!==null&&typeof e=="object",jm=e=>(xe(e)||jt(e))&&jt(e.then)&&jt(e.catch),tg=Object.prototype.toString,Yo=e=>tg.call(e),W_=e=>Yo(e).slice(8,-1),eg=e=>Yo(e)==="[object Object]",Ml=e=>We(e)&&e!=="NaN"&&e[0]!=="-"&&""+parseInt(e,10)===e,bo=ch(",key,ref,ref_for,ref_key,onVnodeBeforeMount,onVnodeMounted,onVnodeBeforeUpdate,onVnodeUpdated,onVnodeBeforeUnmount,onVnodeUnmounted"),wl=e=>{const t=Object.create(null);return(n=>t[n]||(t[n]=e(n)))},X_=/-\w/g,Rn=wl(e=>e.replace(X_,t=>t.slice(1).toUpperCase())),q_=/\B([A-Z])/g,Kr=wl(e=>e.replace(q_,"-$1").toLowerCase()),El=wl(e=>e.charAt(0).toUpperCase()+e.slice(1)),Xa=wl(e=>e?`on${El(e)}`:""),_r=(e,t)=>!Object.is(e,t),Gl=(e,...t)=>{for(let n=0;n{Object.defineProperty(e,t,{configurable:!0,enumerable:!1,writable:i,value:n})},Y_=e=>{const t=parseFloat(e);return isNaN(t)?e:t};let Xf;const Tl=()=>Xf||(Xf=typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:typeof global<"u"?global:{});function qs(e){if(Kt(e)){const t={};for(let n=0;n{if(n){const i=n.split($_);i.length>1&&(t[i[0].trim()]=i[1].trim())}}),t}function Us(e){let t="";if(We(e))t=e;else if(Kt(e))for(let n=0;n!!(e&&e.__v_isRef===!0),Br=e=>We(e)?e:e==null?"":Kt(e)||xe(e)&&(e.toString===tg||!jt(e.toString))?rg(e)?Br(e.value):JSON.stringify(e,sg,2):String(e),sg=(e,t)=>rg(t)?sg(e,t.value):Ts(t)?{[`Map(${t.size})`]:[...t.entries()].reduce((n,[i,r],s)=>(n[Wl(i,s)+" =>"]=r,n),{})}:Qm(t)?{[`Set(${t.size})`]:[...t.values()].map(n=>Wl(n))}:ti(t)?Wl(t):xe(t)&&!Kt(t)&&!eg(t)?String(t):t,Wl=(e,t="")=>{var n;return ti(e)?`Symbol(${(n=e.description)!=null?n:t})`:e};let An;class ev{constructor(t=!1){this.detached=t,this._active=!0,this._on=0,this.effects=[],this.cleanups=[],this._isPaused=!1,this.__v_skip=!0,this.parent=An,!t&&An&&(this.index=(An.scopes||(An.scopes=[])).push(this)-1)}get active(){return this._active}pause(){if(this._active){this._isPaused=!0;let t,n;if(this.scopes)for(t=0,n=this.scopes.length;t0&&--this._on===0&&(An=this.prevScope,this.prevScope=void 0)}stop(t){if(this._active){this._active=!1;let n,i;for(n=0,i=this.effects.length;n0)return;if(wo){let t=wo;for(wo=void 0;t;){const n=t.next;t.next=void 0,t.flags&=-9,t=n}}let e;for(;Mo;){let t=Mo;for(Mo=void 0;t;){const n=t.next;if(t.next=void 0,t.flags&=-9,t.flags&1)try{t.trigger()}catch(i){e||(e=i)}t=n}}if(e)throw e}function cg(e){for(let t=e.deps;t;t=t.nextDep)t.version=-1,t.prevActiveLink=t.dep.activeLink,t.dep.activeLink=t}function ug(e){let t,n=e.depsTail,i=n;for(;i;){const r=i.prevDep;i.version===-1?(i===n&&(n=r),mh(i),iv(i)):t=i,i.dep.activeLink=i.prevActiveLink,i.prevActiveLink=void 0,i=r}e.deps=t,e.depsTail=n}function Yc(e){for(let t=e.deps;t;t=t.nextDep)if(t.dep.version!==t.version||t.dep.computed&&(hg(t.dep.computed)||t.dep.version!==t.version))return!0;return!!e._dirty}function hg(e){if(e.flags&4&&!(e.flags&16)||(e.flags&=-17,e.globalVersion===Lo)||(e.globalVersion=Lo,!e.isSSR&&e.flags&128&&(!e.deps&&!e._dirty||!Yc(e))))return;e.flags|=2;const t=e.dep,n=De,i=jn;De=e,jn=!0;try{cg(e);const r=e.fn(e._value);(t.version===0||_r(r,e._value))&&(e.flags|=128,e._value=r,t.version++)}catch(r){throw t.version++,r}finally{De=n,jn=i,ug(e),e.flags&=-3}}function mh(e,t=!1){const{dep:n,prevSub:i,nextSub:r}=e;if(i&&(i.nextSub=r,e.prevSub=void 0),r&&(r.prevSub=i,e.nextSub=void 0),n.subs===e&&(n.subs=i,!i&&n.computed)){n.computed.flags&=-5;for(let s=n.computed.deps;s;s=s.nextDep)mh(s,!0)}!t&&!--n.sc&&n.map&&n.map.delete(n.key)}function iv(e){const{prevDep:t,nextDep:n}=e;t&&(t.nextDep=n,e.prevDep=void 0),n&&(n.prevDep=t,e.nextDep=void 0)}let jn=!0;const fg=[];function Gi(){fg.push(jn),jn=!1}function Wi(){const e=fg.pop();jn=e===void 0?!0:e}function qf(e){const{cleanup:t}=e;if(e.cleanup=void 0,t){const n=De;De=void 0;try{t()}finally{De=n}}}let Lo=0;class rv{constructor(t,n){this.sub=t,this.dep=n,this.version=n.version,this.nextDep=this.prevDep=this.nextSub=this.prevSub=this.prevActiveLink=void 0}}class gh{constructor(t){this.computed=t,this.version=0,this.activeLink=void 0,this.subs=void 0,this.map=void 0,this.key=void 0,this.sc=0,this.__v_skip=!0}track(t){if(!De||!jn||De===this.computed)return;let n=this.activeLink;if(n===void 0||n.sub!==De)n=this.activeLink=new rv(De,this),De.deps?(n.prevDep=De.depsTail,De.depsTail.nextDep=n,De.depsTail=n):De.deps=De.depsTail=n,dg(n);else if(n.version===-1&&(n.version=this.version,n.nextDep)){const i=n.nextDep;i.prevDep=n.prevDep,n.prevDep&&(n.prevDep.nextDep=i),n.prevDep=De.depsTail,n.nextDep=void 0,De.depsTail.nextDep=n,De.depsTail=n,De.deps===n&&(De.deps=i)}return n}trigger(t){this.version++,Lo++,this.notify(t)}notify(t){dh();try{for(let n=this.subs;n;n=n.prevSub)n.sub.notify()&&n.sub.dep.notify()}finally{ph()}}}function dg(e){if(e.dep.sc++,e.sub.flags&4){const t=e.dep.computed;if(t&&!e.dep.subs){t.flags|=20;for(let i=t.deps;i;i=i.nextDep)dg(i)}const n=e.dep.subs;n!==e&&(e.prevSub=n,n&&(n.nextSub=e)),e.dep.subs=e}}const rl=new WeakMap,Gr=Symbol(""),Jc=Symbol(""),No=Symbol("");function un(e,t,n){if(jn&&De){let i=rl.get(e);i||rl.set(e,i=new Map);let r=i.get(n);r||(i.set(n,r=new gh),r.map=i,r.key=n),r.track()}}function Bi(e,t,n,i,r,s){const o=rl.get(e);if(!o){Lo++;return}const a=l=>{l&&l.trigger()};if(dh(),t==="clear")o.forEach(a);else{const l=Kt(e),c=l&&Ml(n);if(l&&n==="length"){const u=Number(i);o.forEach((h,f)=>{(f==="length"||f===No||!ti(f)&&f>=u)&&a(h)})}else switch((n!==void 0||o.has(void 0))&&a(o.get(n)),c&&a(o.get(No)),t){case"add":l?c&&a(o.get("length")):(a(o.get(Gr)),Ts(e)&&a(o.get(Jc)));break;case"delete":l||(a(o.get(Gr)),Ts(e)&&a(o.get(Jc)));break;case"set":Ts(e)&&a(o.get(Gr));break}}ph()}function sv(e,t){const n=rl.get(e);return n&&n.get(t)}function is(e){const t=_e(e);return t===e?t:(un(t,"iterate",No),Vn(e)?t:t.map(ei))}function Al(e){return un(e=_e(e),"iterate",No),e}function sr(e,t){return qi(e)?Os(Wr(e)?ei(t):t):ei(t)}const ov={__proto__:null,[Symbol.iterator](){return ql(this,Symbol.iterator,e=>sr(this,e))},concat(...e){return is(this).concat(...e.map(t=>Kt(t)?is(t):t))},entries(){return ql(this,"entries",e=>(e[1]=sr(this,e[1]),e))},every(e,t){return Ai(this,"every",e,t,void 0,arguments)},filter(e,t){return Ai(this,"filter",e,t,n=>n.map(i=>sr(this,i)),arguments)},find(e,t){return Ai(this,"find",e,t,n=>sr(this,n),arguments)},findIndex(e,t){return Ai(this,"findIndex",e,t,void 0,arguments)},findLast(e,t){return Ai(this,"findLast",e,t,n=>sr(this,n),arguments)},findLastIndex(e,t){return Ai(this,"findLastIndex",e,t,void 0,arguments)},forEach(e,t){return Ai(this,"forEach",e,t,void 0,arguments)},includes(...e){return Yl(this,"includes",e)},indexOf(...e){return Yl(this,"indexOf",e)},join(e){return is(this).join(e)},lastIndexOf(...e){return Yl(this,"lastIndexOf",e)},map(e,t){return Ai(this,"map",e,t,void 0,arguments)},pop(){return eo(this,"pop")},push(...e){return eo(this,"push",e)},reduce(e,...t){return Yf(this,"reduce",e,t)},reduceRight(e,...t){return Yf(this,"reduceRight",e,t)},shift(){return eo(this,"shift")},some(e,t){return Ai(this,"some",e,t,void 0,arguments)},splice(...e){return eo(this,"splice",e)},toReversed(){return is(this).toReversed()},toSorted(e){return is(this).toSorted(e)},toSpliced(...e){return is(this).toSpliced(...e)},unshift(...e){return eo(this,"unshift",e)},values(){return ql(this,"values",e=>sr(this,e))}};function ql(e,t,n){const i=Al(e),r=i[t]();return i!==e&&!Vn(e)&&(r._next=r.next,r.next=()=>{const s=r._next();return s.done||(s.value=n(s.value)),s}),r}const av=Array.prototype;function Ai(e,t,n,i,r,s){const o=Al(e),a=o!==e&&!Vn(e),l=o[t];if(l!==av[t]){const h=l.apply(e,s);return a?ei(h):h}let c=n;o!==e&&(a?c=function(h,f){return n.call(this,sr(e,h),f,e)}:n.length>2&&(c=function(h,f){return n.call(this,h,f,e)}));const u=l.call(o,c,i);return a&&r?r(u):u}function Yf(e,t,n,i){const r=Al(e);let s=n;return r!==e&&(Vn(e)?n.length>3&&(s=function(o,a,l){return n.call(this,o,a,l,e)}):s=function(o,a,l){return n.call(this,o,sr(e,a),l,e)}),r[t](s,...i)}function Yl(e,t,n){const i=_e(e);un(i,"iterate",No);const r=i[t](...n);return(r===-1||r===!1)&&Pl(n[0])?(n[0]=_e(n[0]),i[t](...n)):r}function eo(e,t,n=[]){Gi(),dh();const i=_e(e)[t].apply(e,n);return ph(),Wi(),i}const lv=ch("__proto__,__v_isRef,__isVue"),pg=new Set(Object.getOwnPropertyNames(Symbol).filter(e=>e!=="arguments"&&e!=="caller").map(e=>Symbol[e]).filter(ti));function cv(e){ti(e)||(e=String(e));const t=_e(this);return un(t,"has",e),t.hasOwnProperty(e)}class mg{constructor(t=!1,n=!1){this._isReadonly=t,this._isShallow=n}get(t,n,i){if(n==="__v_skip")return t.__v_skip;const r=this._isReadonly,s=this._isShallow;if(n==="__v_isReactive")return!r;if(n==="__v_isReadonly")return r;if(n==="__v_isShallow")return s;if(n==="__v_raw")return i===(r?s?xv:xg:s?vg:_g).get(t)||Object.getPrototypeOf(t)===Object.getPrototypeOf(i)?t:void 0;const o=Kt(t);if(!r){let l;if(o&&(l=ov[n]))return l;if(n==="hasOwnProperty")return cv}const a=Reflect.get(t,n,Ve(t)?t:i);if((ti(n)?pg.has(n):lv(n))||(r||un(t,"get",n),s))return a;if(Ve(a)){const l=o&&Ml(n)?a:a.value;return r&&xe(l)?Zc(l):l}return xe(a)?r?Zc(a):Xi(a):a}}class gg extends mg{constructor(t=!1){super(!1,t)}set(t,n,i,r){let s=t[n];const o=Kt(t)&&Ml(n);if(!this._isShallow){const c=qi(s);if(!Vn(i)&&!qi(i)&&(s=_e(s),i=_e(i)),!o&&Ve(s)&&!Ve(i))return c||(s.value=i),!0}const a=o?Number(n)e,oa=e=>Reflect.getPrototypeOf(e);function pv(e,t,n){return function(...i){const r=this.__v_raw,s=_e(r),o=Ts(s),a=e==="entries"||e===Symbol.iterator&&o,l=e==="keys"&&o,c=r[e](...i),u=n?$c:t?Os:ei;return!t&&un(s,"iterate",l?Jc:Gr),on(Object.create(c),{next(){const{value:h,done:f}=c.next();return f?{value:h,done:f}:{value:a?[u(h[0]),u(h[1])]:u(h),done:f}}})}}function aa(e){return function(...t){return e==="delete"?!1:e==="clear"?void 0:this}}function mv(e,t){const n={get(r){const s=this.__v_raw,o=_e(s),a=_e(r);e||(_r(r,a)&&un(o,"get",r),un(o,"get",a));const{has:l}=oa(o),c=t?$c:e?Os:ei;if(l.call(o,r))return c(s.get(r));if(l.call(o,a))return c(s.get(a));s!==o&&s.get(r)},get size(){const r=this.__v_raw;return!e&&un(_e(r),"iterate",Gr),r.size},has(r){const s=this.__v_raw,o=_e(s),a=_e(r);return e||(_r(r,a)&&un(o,"has",r),un(o,"has",a)),r===a?s.has(r):s.has(r)||s.has(a)},forEach(r,s){const o=this,a=o.__v_raw,l=_e(a),c=t?$c:e?Os:ei;return!e&&un(l,"iterate",Gr),a.forEach((u,h)=>r.call(s,c(u),c(h),o))}};return on(n,e?{add:aa("add"),set:aa("set"),delete:aa("delete"),clear:aa("clear")}:{add(r){!t&&!Vn(r)&&!qi(r)&&(r=_e(r));const s=_e(this);return oa(s).has.call(s,r)||(s.add(r),Bi(s,"add",r,r)),this},set(r,s){!t&&!Vn(s)&&!qi(s)&&(s=_e(s));const o=_e(this),{has:a,get:l}=oa(o);let c=a.call(o,r);c||(r=_e(r),c=a.call(o,r));const u=l.call(o,r);return o.set(r,s),c?_r(s,u)&&Bi(o,"set",r,s):Bi(o,"add",r,s),this},delete(r){const s=_e(this),{has:o,get:a}=oa(s);let l=o.call(s,r);l||(r=_e(r),l=o.call(s,r)),a&&a.call(s,r);const c=s.delete(r);return l&&Bi(s,"delete",r,void 0),c},clear(){const r=_e(this),s=r.size!==0,o=r.clear();return s&&Bi(r,"clear",void 0,void 0),o}}),["keys","values","entries",Symbol.iterator].forEach(r=>{n[r]=pv(r,e,t)}),n}function _h(e,t){const n=mv(e,t);return(i,r,s)=>r==="__v_isReactive"?!e:r==="__v_isReadonly"?e:r==="__v_raw"?i:Reflect.get(ve(n,r)&&r in i?n:i,r,s)}const gv={get:_h(!1,!1)},_v={get:_h(!1,!0)},vv={get:_h(!0,!1)};const _g=new WeakMap,vg=new WeakMap,xg=new WeakMap,xv=new WeakMap;function yv(e){switch(e){case"Object":case"Array":return 1;case"Map":case"Set":case"WeakMap":case"WeakSet":return 2;default:return 0}}function Sv(e){return e.__v_skip||!Object.isExtensible(e)?0:yv(W_(e))}function Xi(e){return qi(e)?e:vh(e,!1,hv,gv,_g)}function bv(e){return vh(e,!1,dv,_v,vg)}function Zc(e){return vh(e,!0,fv,vv,xg)}function vh(e,t,n,i,r){if(!xe(e)||e.__v_raw&&!(t&&e.__v_isReactive))return e;const s=Sv(e);if(s===0)return e;const o=r.get(e);if(o)return o;const a=new Proxy(e,s===2?i:n);return r.set(e,a),a}function Wr(e){return qi(e)?Wr(e.__v_raw):!!(e&&e.__v_isReactive)}function qi(e){return!!(e&&e.__v_isReadonly)}function Vn(e){return!!(e&&e.__v_isShallow)}function Pl(e){return e?!!e.__v_raw:!1}function _e(e){const t=e&&e.__v_raw;return t?_e(t):e}function yg(e){return!ve(e,"__v_skip")&&Object.isExtensible(e)&&ng(e,"__v_skip",!0),e}const ei=e=>xe(e)?Xi(e):e,Os=e=>xe(e)?Zc(e):e;function Ve(e){return e?e.__v_isRef===!0:!1}function sn(e){return Sg(e,!1)}function Mv(e){return Sg(e,!0)}function Sg(e,t){return Ve(e)?e:new wv(e,t)}class wv{constructor(t,n){this.dep=new gh,this.__v_isRef=!0,this.__v_isShallow=!1,this._rawValue=n?t:_e(t),this._value=n?t:ei(t),this.__v_isShallow=n}get value(){return this.dep.track(),this._value}set value(t){const n=this._rawValue,i=this.__v_isShallow||Vn(t)||qi(t);t=i?t:_e(t),_r(t,n)&&(this._rawValue=t,this._value=i?t:ei(t),this.dep.trigger())}}function vt(e){return Ve(e)?e.value:e}function xh(e){return jt(e)?e():vt(e)}const Ev={get:(e,t,n)=>t==="__v_raw"?e:vt(Reflect.get(e,t,n)),set:(e,t,n,i)=>{const r=e[t];return Ve(r)&&!Ve(n)?(r.value=n,!0):Reflect.set(e,t,n,i)}};function bg(e){return Wr(e)?e:new Proxy(e,Ev)}function Uo(e){const t=Kt(e)?new Array(e.length):{};for(const n in e)t[n]=Mg(e,n);return t}class Tv{constructor(t,n,i){this._object=t,this._key=n,this._defaultValue=i,this.__v_isRef=!0,this._value=void 0,this._raw=_e(t);let r=!0,s=t;if(!Kt(t)||!Ml(String(n)))do r=!Pl(s)||Vn(s);while(r&&(s=s.__v_raw));this._shallow=r}get value(){let t=this._object[this._key];return this._shallow&&(t=vt(t)),this._value=t===void 0?this._defaultValue:t}set value(t){if(this._shallow&&Ve(this._raw[this._key])){const n=this._object[this._key];if(Ve(n)){n.value=t;return}}this._object[this._key]=t}get dep(){return sv(this._raw,this._key)}}class Av{constructor(t){this._getter=t,this.__v_isRef=!0,this.__v_isReadonly=!0,this._value=void 0}get value(){return this._value=this._getter()}}function Pv(e,t,n){return Ve(e)?e:jt(e)?new Av(e):xe(e)&&arguments.length>1?Mg(e,t,n):sn(e)}function Mg(e,t,n){return new Tv(e,t,n)}class Cv{constructor(t,n,i){this.fn=t,this.setter=n,this._value=void 0,this.dep=new gh(this),this.__v_isRef=!0,this.deps=void 0,this.depsTail=void 0,this.flags=16,this.globalVersion=Lo-1,this.next=void 0,this.effect=this,this.__v_isReadonly=!n,this.isSSR=i}notify(){if(this.flags|=16,!(this.flags&8)&&De!==this)return lg(this,!0),!0}get value(){const t=this.dep.track();return hg(this),t&&(t.version=this.dep.version),this._value}set value(t){this.setter&&this.setter(t)}}function Rv(e,t,n=!1){let i,r;return jt(e)?i=e:(i=e.get,r=e.set),new Cv(i,r,n)}const la={},sl=new WeakMap;let Ur;function Dv(e,t=!1,n=Ur){if(n){let i=sl.get(n);i||sl.set(n,i=[]),i.push(e)}}function Iv(e,t,n=Ie){const{immediate:i,deep:r,once:s,scheduler:o,augmentJob:a,call:l}=n,c=y=>r?y:Vn(y)||r===!1||r===0?lr(y,1):lr(y);let u,h,f,p,g=!1,_=!1;if(Ve(e)?(h=()=>e.value,g=Vn(e)):Wr(e)?(h=()=>c(e),g=!0):Kt(e)?(_=!0,g=e.some(y=>Wr(y)||Vn(y)),h=()=>e.map(y=>{if(Ve(y))return y.value;if(Wr(y))return c(y);if(jt(y))return l?l(y,2):y()})):jt(e)?t?h=l?()=>l(e,2):e:h=()=>{if(f){Gi();try{f()}finally{Wi()}}const y=Ur;Ur=u;try{return l?l(e,3,[p]):e(p)}finally{Ur=y}}:h=_i,t&&r){const y=h,T=r===!0?1/0:r;h=()=>lr(y(),T)}const m=nv(),d=()=>{u.stop(),m&&m.active&&hh(m.effects,u)};if(s&&t){const y=t;t=(...T)=>{y(...T),d()}}let S=_?new Array(e.length).fill(la):la;const x=y=>{if(!(!(u.flags&1)||!u.dirty&&!y))if(t){const T=u.run();if(r||g||(_?T.some((P,R)=>_r(P,S[R])):_r(T,S))){f&&f();const P=Ur;Ur=u;try{const R=[T,S===la?void 0:_&&S[0]===la?[]:S,p];S=T,l?l(t,3,R):t(...R)}finally{Ur=P}}}else u.run()};return a&&a(x),u=new og(h),u.scheduler=o?()=>o(x,!1):x,p=y=>Dv(y,!1,u),f=u.onStop=()=>{const y=sl.get(u);if(y){if(l)l(y,4);else for(const T of y)T();sl.delete(u)}},t?i?x(!0):S=u.run():o?o(x.bind(null,!0),!0):u.run(),d.pause=u.pause.bind(u),d.resume=u.resume.bind(u),d.stop=d,d}function lr(e,t=1/0,n){if(t<=0||!xe(e)||e.__v_skip||(n=n||new Map,(n.get(e)||0)>=t))return e;if(n.set(e,t),t--,Ve(e))lr(e.value,t,n);else if(Kt(e))for(let i=0;i{lr(i,t,n)});else if(eg(e)){for(const i in e)lr(e[i],t,n);for(const i of Object.getOwnPropertySymbols(e))Object.prototype.propertyIsEnumerable.call(e,i)&&lr(e[i],t,n)}return e}function Jo(e,t,n,i){try{return i?e(...i):e()}catch(r){Cl(r,t,n)}}function yi(e,t,n,i){if(jt(e)){const r=Jo(e,t,n,i);return r&&jm(r)&&r.catch(s=>{Cl(s,t,n)}),r}if(Kt(e)){const r=[];for(let s=0;s>>1,r=xn[i],s=Oo(r);s=Oo(n)?xn.push(e):xn.splice(Nv(t),0,e),e.flags|=1,Tg()}}function Tg(){ol||(ol=wg.then(Pg))}function Uv(e){Kt(e)?As.push(...e):or&&e.id===-1?or.splice(xs+1,0,e):e.flags&1||(As.push(e),e.flags|=1),Tg()}function Jf(e,t,n=ui+1){for(;nOo(n)-Oo(i));if(As.length=0,or){or.push(...t);return}for(or=t,xs=0;xse.id==null?e.flags&2?-1:1/0:e.id;function Pg(e){try{for(ui=0;ui{i._d&&ul(-1);const s=al(t);let o;try{o=e(...r)}finally{al(s),i._d&&ul(1)}return o};return i._n=!0,i._c=!0,i._d=!0,i}function Er(e,t,n,i){const r=e.dirs,s=t&&t.dirs;for(let o=0;o1)return n&&jt(t)?t.call(i&&i.proxy):t}}const Ov=Symbol.for("v-scx"),Fv=()=>Ps(Ov);function kv(e,t){return bh(e,null,t)}function Xr(e,t,n){return bh(e,t,n)}function bh(e,t,n=Ie){const{immediate:i,deep:r,flush:s,once:o}=n,a=on({},n),l=t&&i||!t&&s!=="post";let c;if(Bo){if(s==="sync"){const p=Fv();c=p.__watcherHandles||(p.__watcherHandles=[])}else if(!l){const p=()=>{};return p.stop=_i,p.resume=_i,p.pause=_i,p}}const u=hn;a.call=(p,g,_)=>yi(p,u,g,_);let h=!1;s==="post"?a.scheduler=p=>{Tn(p,u&&u.suspense)}:s!=="sync"&&(h=!0,a.scheduler=(p,g)=>{g?p():yh(p)}),a.augmentJob=p=>{t&&(p.flags|=4),h&&(p.flags|=2,u&&(p.id=u.uid,p.i=u))};const f=Iv(e,t,a);return Bo&&(c?c.push(f):l&&f()),f}function Bv(e,t,n){const i=this.proxy,r=We(e)?e.includes(".")?Rg(i,e):()=>i[e]:e.bind(i,i);let s;jt(t)?s=t:(s=t.handler,n=t);const o=Zo(this),a=bh(r,s.bind(i),n);return o(),a}function Rg(e,t){const n=t.split(".");return()=>{let i=e;for(let r=0;re.__isTeleport,Hv=Symbol("_leaveCb");function Mh(e,t){e.shapeFlag&6&&e.component?(e.transition=t,Mh(e.component.subTree,t)):e.shapeFlag&128?(e.ssContent.transition=t.clone(e.ssContent),e.ssFallback.transition=t.clone(e.ssFallback)):e.transition=t}function Ze(e,t){return jt(e)?on({name:e.name},t,{setup:e}):e}function Dg(e){e.ids=[e.ids[0]+e.ids[2]+++"-",0,0]}function $f(e,t){let n;return!!((n=Object.getOwnPropertyDescriptor(e,t))&&!n.configurable)}const ll=new WeakMap;function Eo(e,t,n,i,r=!1){if(Kt(e)){e.forEach((_,m)=>Eo(_,t&&(Kt(t)?t[m]:t),n,i,r));return}if(Cs(i)&&!r){i.shapeFlag&512&&i.type.__asyncResolved&&i.component.subTree.component&&Eo(e,t,n,i.component.subTree);return}const s=i.shapeFlag&4?Ph(i.component):i.el,o=r?null:s,{i:a,r:l}=e,c=t&&t.r,u=a.refs===Ie?a.refs={}:a.refs,h=a.setupState,f=_e(h),p=h===Ie?Km:_=>$f(u,_)?!1:ve(f,_),g=(_,m)=>!(m&&$f(u,m));if(c!=null&&c!==l){if(Zf(t),We(c))u[c]=null,p(c)&&(h[c]=null);else if(Ve(c)){const _=t;g(c,_.k)&&(c.value=null),_.k&&(u[_.k]=null)}}if(jt(l))Jo(l,a,12,[o,u]);else{const _=We(l),m=Ve(l);if(_||m){const d=()=>{if(e.f){const S=_?p(l)?h[l]:u[l]:g()||!e.k?l.value:u[e.k];if(r)Kt(S)&&hh(S,s);else if(Kt(S))S.includes(s)||S.push(s);else if(_)u[l]=[s],p(l)&&(h[l]=u[l]);else{const x=[s];g(l,e.k)&&(l.value=x),e.k&&(u[e.k]=x)}}else _?(u[l]=o,p(l)&&(h[l]=o)):m&&(g(l,e.k)&&(l.value=o),e.k&&(u[e.k]=o))};if(o){const S=()=>{d(),ll.delete(e)};S.id=-1,ll.set(e,S),Tn(S,n)}else Zf(e),d()}}}function Zf(e){const t=ll.get(e);t&&(t.flags|=8,ll.delete(e))}Tl().requestIdleCallback;Tl().cancelIdleCallback;const Cs=e=>!!e.type.__asyncLoader,Ig=e=>e.type.__isKeepAlive;function Gv(e,t){Lg(e,"a",t)}function Wv(e,t){Lg(e,"da",t)}function Lg(e,t,n=hn){const i=e.__wdc||(e.__wdc=()=>{let r=n;for(;r;){if(r.isDeactivated)return;r=r.parent}return e()});if(Rl(t,i,n),n){let r=n.parent;for(;r&&r.parent;)Ig(r.parent.vnode)&&Xv(i,t,n,r),r=r.parent}}function Xv(e,t,n,i){const r=Rl(t,e,i,!0);wh(()=>{hh(i[t],r)},n)}function Rl(e,t,n=hn,i=!1){if(n){const r=n[e]||(n[e]=[]),s=t.__weh||(t.__weh=(...o)=>{Gi();const a=Zo(n),l=yi(t,n,e,o);return a(),Wi(),l});return i?r.unshift(s):r.push(s),s}}const Zi=e=>(t,n=hn)=>{(!Bo||e==="sp")&&Rl(e,(...i)=>t(...i),n)},qv=Zi("bm"),$o=Zi("m"),Yv=Zi("bu"),Jv=Zi("u"),$v=Zi("bum"),wh=Zi("um"),Zv=Zi("sp"),Kv=Zi("rtg"),Qv=Zi("rtc");function jv(e,t=hn){Rl("ec",e,t)}const tx="components",Ng=Symbol.for("v-ndc");function ex(e){return We(e)?nx(tx,e,!1)||e:e||Ng}function nx(e,t,n=!0,i=!1){const r=Sn||hn;if(r){const s=r.type;{const a=Bx(s,!1);if(a&&(a===t||a===Rn(t)||a===El(Rn(t))))return s}const o=Kf(r[e]||s[e],t)||Kf(r.appContext[e],t);return!o&&i?s:o}}function Kf(e,t){return e&&(e[t]||e[Rn(t)]||e[El(Rn(t))])}function Dl(e,t,n,i){let r;const s=n,o=Kt(e);if(o||We(e)){const a=o&&Wr(e);let l=!1,c=!1;a&&(l=!Vn(e),c=qi(e),e=Al(e)),r=new Array(e.length);for(let u=0,h=e.length;ut(a,l,void 0,s));else{const a=Object.keys(e);r=new Array(a.length);for(let l=0,c=a.length;l0;return ce(),Oe(Je,null,[Ge("slot",n,i)],c?-2:64)}let s=e[t];s&&s._c&&(s._d=!1),ce();const o=s&&Ug(s(n)),a=n.key||o&&o.key,l=Oe(Je,{key:(a&&!ti(a)?a:`_${t}`)+(!o&&i?"_fb":"")},o||[],o&&e._===1?64:-2);return l.scopeId&&(l.slotScopeIds=[l.scopeId+"-s"]),s&&s._c&&(s._d=!0),l}function Ug(e){return e.some(t=>ko(t)?!(t.type===Si||t.type===Je&&!Ug(t.children)):!0)?e:null}const Kc=e=>e?e0(e)?Ph(e):Kc(e.parent):null,To=on(Object.create(null),{$:e=>e,$el:e=>e.vnode.el,$data:e=>e.data,$props:e=>e.props,$attrs:e=>e.attrs,$slots:e=>e.slots,$refs:e=>e.refs,$parent:e=>Kc(e.parent),$root:e=>Kc(e.root),$host:e=>e.ce,$emit:e=>e.emit,$options:e=>Fg(e),$forceUpdate:e=>e.f||(e.f=()=>{yh(e.update)}),$nextTick:e=>e.n||(e.n=Eg.bind(e.proxy)),$watch:e=>Bv.bind(e)}),Jl=(e,t)=>e!==Ie&&!e.__isScriptSetup&&ve(e,t),ix={get({_:e},t){if(t==="__v_skip")return!0;const{ctx:n,setupState:i,data:r,props:s,accessCache:o,type:a,appContext:l}=e;if(t[0]!=="$"){const f=o[t];if(f!==void 0)switch(f){case 1:return i[t];case 2:return r[t];case 4:return n[t];case 3:return s[t]}else{if(Jl(i,t))return o[t]=1,i[t];if(r!==Ie&&ve(r,t))return o[t]=2,r[t];if(ve(s,t))return o[t]=3,s[t];if(n!==Ie&&ve(n,t))return o[t]=4,n[t];Qc&&(o[t]=0)}}const c=To[t];let u,h;if(c)return t==="$attrs"&&un(e.attrs,"get",""),c(e);if((u=a.__cssModules)&&(u=u[t]))return u;if(n!==Ie&&ve(n,t))return o[t]=4,n[t];if(h=l.config.globalProperties,ve(h,t))return h[t]},set({_:e},t,n){const{data:i,setupState:r,ctx:s}=e;return Jl(r,t)?(r[t]=n,!0):i!==Ie&&ve(i,t)?(i[t]=n,!0):ve(e.props,t)||t[0]==="$"&&t.slice(1)in e?!1:(s[t]=n,!0)},has({_:{data:e,setupState:t,accessCache:n,ctx:i,appContext:r,props:s,type:o}},a){let l;return!!(n[a]||e!==Ie&&a[0]!=="$"&&ve(e,a)||Jl(t,a)||ve(s,a)||ve(i,a)||ve(To,a)||ve(r.config.globalProperties,a)||(l=o.__cssModules)&&l[a])},defineProperty(e,t,n){return n.get!=null?e._.accessCache[t]=0:ve(n,"value")&&this.set(e,t,n.value,null),Reflect.defineProperty(e,t,n)}};function Qf(e){return Kt(e)?e.reduce((t,n)=>(t[n]=null,t),{}):e}let Qc=!0;function rx(e){const t=Fg(e),n=e.proxy,i=e.ctx;Qc=!1,t.beforeCreate&&jf(t.beforeCreate,e,"bc");const{data:r,computed:s,methods:o,watch:a,provide:l,inject:c,created:u,beforeMount:h,mounted:f,beforeUpdate:p,updated:g,activated:_,deactivated:m,beforeDestroy:d,beforeUnmount:S,destroyed:x,unmounted:y,render:T,renderTracked:P,renderTriggered:R,errorCaptured:C,serverPrefetch:b,expose:M,inheritAttrs:L,components:V,directives:q,filters:j}=t;if(c&&sx(c,i,null),o)for(const k in o){const H=o[k];jt(H)&&(i[k]=H.bind(n))}if(r){const k=r.call(n,n);xe(k)&&(e.data=Xi(k))}if(Qc=!0,s)for(const k in s){const H=s[k],ct=jt(H)?H.bind(n,n):jt(H.get)?H.get.bind(n,n):_i,pt=!jt(H)&&jt(H.set)?H.set.bind(n):_i,ft=pe({get:ct,set:pt});Object.defineProperty(i,k,{enumerable:!0,configurable:!0,get:()=>ft.value,set:kt=>ft.value=kt})}if(a)for(const k in a)Og(a[k],i,n,k);if(l){const k=jt(l)?l.call(n):l;Reflect.ownKeys(k).forEach(H=>{Sh(H,k[H])})}u&&jf(u,e,"c");function W(k,H){Kt(H)?H.forEach(ct=>k(ct.bind(n))):H&&k(H.bind(n))}if(W(qv,h),W($o,f),W(Yv,p),W(Jv,g),W(Gv,_),W(Wv,m),W(jv,C),W(Qv,P),W(Kv,R),W($v,S),W(wh,y),W(Zv,b),Kt(M))if(M.length){const k=e.exposed||(e.exposed={});M.forEach(H=>{Object.defineProperty(k,H,{get:()=>n[H],set:ct=>n[H]=ct,enumerable:!0})})}else e.exposed||(e.exposed={});T&&e.render===_i&&(e.render=T),L!=null&&(e.inheritAttrs=L),V&&(e.components=V),q&&(e.directives=q),b&&Dg(e)}function sx(e,t,n=_i){Kt(e)&&(e=jc(e));for(const i in e){const r=e[i];let s;xe(r)?"default"in r?s=Ps(r.from||i,r.default,!0):s=Ps(r.from||i):s=Ps(r),Ve(s)?Object.defineProperty(t,i,{enumerable:!0,configurable:!0,get:()=>s.value,set:o=>s.value=o}):t[i]=s}}function jf(e,t,n){yi(Kt(e)?e.map(i=>i.bind(t.proxy)):e.bind(t.proxy),t,n)}function Og(e,t,n,i){let r=i.includes(".")?Rg(n,i):()=>n[i];if(We(e)){const s=t[e];jt(s)&&Xr(r,s)}else if(jt(e))Xr(r,e.bind(n));else if(xe(e))if(Kt(e))e.forEach(s=>Og(s,t,n,i));else{const s=jt(e.handler)?e.handler.bind(n):t[e.handler];jt(s)&&Xr(r,s,e)}}function Fg(e){const t=e.type,{mixins:n,extends:i}=t,{mixins:r,optionsCache:s,config:{optionMergeStrategies:o}}=e.appContext,a=s.get(t);let l;return a?l=a:!r.length&&!n&&!i?l=t:(l={},r.length&&r.forEach(c=>cl(l,c,o,!0)),cl(l,t,o)),xe(t)&&s.set(t,l),l}function cl(e,t,n,i=!1){const{mixins:r,extends:s}=t;s&&cl(e,s,n,!0),r&&r.forEach(o=>cl(e,o,n,!0));for(const o in t)if(!(i&&o==="expose")){const a=ox[o]||n&&n[o];e[o]=a?a(e[o],t[o]):t[o]}return e}const ox={data:td,props:ed,emits:ed,methods:po,computed:po,beforeCreate:gn,created:gn,beforeMount:gn,mounted:gn,beforeUpdate:gn,updated:gn,beforeDestroy:gn,beforeUnmount:gn,destroyed:gn,unmounted:gn,activated:gn,deactivated:gn,errorCaptured:gn,serverPrefetch:gn,components:po,directives:po,watch:lx,provide:td,inject:ax};function td(e,t){return t?e?function(){return on(jt(e)?e.call(this,this):e,jt(t)?t.call(this,this):t)}:t:e}function ax(e,t){return po(jc(e),jc(t))}function jc(e){if(Kt(e)){const t={};for(let n=0;nt==="modelValue"||t==="model-value"?e.modelModifiers:e[`${t}Modifiers`]||e[`${Rn(t)}Modifiers`]||e[`${Kr(t)}Modifiers`];function fx(e,t,...n){if(e.isUnmounted)return;const i=e.vnode.props||Ie;let r=n;const s=t.startsWith("update:"),o=s&&hx(i,t.slice(7));o&&(o.trim&&(r=n.map(u=>We(u)?u.trim():u)),o.number&&(r=n.map(Y_)));let a,l=i[a=Xa(t)]||i[a=Xa(Rn(t))];!l&&s&&(l=i[a=Xa(Kr(t))]),l&&yi(l,e,6,r);const c=i[a+"Once"];if(c){if(!e.emitted)e.emitted={};else if(e.emitted[a])return;e.emitted[a]=!0,yi(c,e,6,r)}}const dx=new WeakMap;function Bg(e,t,n=!1){const i=n?dx:t.emitsCache,r=i.get(e);if(r!==void 0)return r;const s=e.emits;let o={},a=!1;if(!jt(e)){const l=c=>{const u=Bg(c,t,!0);u&&(a=!0,on(o,u))};!n&&t.mixins.length&&t.mixins.forEach(l),e.extends&&l(e.extends),e.mixins&&e.mixins.forEach(l)}return!s&&!a?(xe(e)&&i.set(e,null),null):(Kt(s)?s.forEach(l=>o[l]=null):on(o,s),xe(e)&&i.set(e,o),o)}function Il(e,t){return!e||!bl(t)?!1:(t=t.slice(2).replace(/Once$/,""),ve(e,t[0].toLowerCase()+t.slice(1))||ve(e,Kr(t))||ve(e,t))}function nd(e){const{type:t,vnode:n,proxy:i,withProxy:r,propsOptions:[s],slots:o,attrs:a,emit:l,render:c,renderCache:u,props:h,data:f,setupState:p,ctx:g,inheritAttrs:_}=e,m=al(e);let d,S;try{if(n.shapeFlag&4){const y=r||i,T=y;d=fi(c.call(T,y,u,h,p,f,g)),S=a}else{const y=t;d=fi(y.length>1?y(h,{attrs:a,slots:o,emit:l}):y(h,null)),S=t.props?a:px(a)}}catch(y){Ao.length=0,Cl(y,e,1),d=Ge(Si)}let x=d;if(S&&_!==!1){const y=Object.keys(S),{shapeFlag:T}=x;y.length&&T&7&&(s&&y.some(uh)&&(S=mx(S,s)),x=Jr(x,S,!1,!0))}return n.dirs&&(x=Jr(x,null,!1,!0),x.dirs=x.dirs?x.dirs.concat(n.dirs):n.dirs),n.transition&&Mh(x,n.transition),d=x,al(m),d}const px=e=>{let t;for(const n in e)(n==="class"||n==="style"||bl(n))&&((t||(t={}))[n]=e[n]);return t},mx=(e,t)=>{const n={};for(const i in e)(!uh(i)||!(i.slice(9)in t))&&(n[i]=e[i]);return n};function gx(e,t,n){const{props:i,children:r,component:s}=e,{props:o,children:a,patchFlag:l}=t,c=s.emitsOptions;if(t.dirs||t.transition)return!0;if(n&&l>=0){if(l&1024)return!0;if(l&16)return i?id(i,o,c):!!o;if(l&8){const u=t.dynamicProps;for(let h=0;hObject.create(Vg),Gg=e=>Object.getPrototypeOf(e)===Vg;function vx(e,t,n,i=!1){const r={},s=Hg();e.propsDefaults=Object.create(null),Wg(e,t,r,s);for(const o in e.propsOptions[0])o in r||(r[o]=void 0);n?e.props=i?r:bv(r):e.type.props?e.props=r:e.props=s,e.attrs=s}function xx(e,t,n,i){const{props:r,attrs:s,vnode:{patchFlag:o}}=e,a=_e(r),[l]=e.propsOptions;let c=!1;if((i||o>0)&&!(o&16)){if(o&8){const u=e.vnode.dynamicProps;for(let h=0;h{l=!0;const[f,p]=Xg(h,t,!0);on(o,f),p&&a.push(...p)};!n&&t.mixins.length&&t.mixins.forEach(u),e.extends&&u(e.extends),e.mixins&&e.mixins.forEach(u)}if(!s&&!l)return xe(e)&&i.set(e,Es),Es;if(Kt(s))for(let u=0;ue==="_"||e==="_ctx"||e==="$stable",Th=e=>Kt(e)?e.map(fi):[fi(e)],Sx=(e,t,n)=>{if(t._n)return t;const i=$e((...r)=>Th(t(...r)),n);return i._c=!1,i},qg=(e,t,n)=>{const i=e._ctx;for(const r in e){if(Eh(r))continue;const s=e[r];if(jt(s))t[r]=Sx(r,s,i);else if(s!=null){const o=Th(s);t[r]=()=>o}}},Yg=(e,t)=>{const n=Th(t);e.slots.default=()=>n},Jg=(e,t,n)=>{for(const i in t)(n||!Eh(i))&&(e[i]=t[i])},bx=(e,t,n)=>{const i=e.slots=Hg();if(e.vnode.shapeFlag&32){const r=t._;r?(Jg(i,t,n),n&&ng(i,"_",r,!0)):qg(t,i)}else t&&Yg(e,t)},Mx=(e,t,n)=>{const{vnode:i,slots:r}=e;let s=!0,o=Ie;if(i.shapeFlag&32){const a=t._;a?n&&a===1?s=!1:Jg(r,t,n):(s=!t.$stable,qg(t,r)),o=t}else t&&(Yg(e,t),o={default:1});if(s)for(const a in r)!Eh(a)&&o[a]==null&&delete r[a]},Tn=Px;function wx(e){return Ex(e)}function Ex(e,t){const n=Tl();n.__VUE__=!0;const{insert:i,remove:r,patchProp:s,createElement:o,createText:a,createComment:l,setText:c,setElementText:u,parentNode:h,nextSibling:f,setScopeId:p=_i,insertStaticContent:g}=e,_=(I,O,U,z=null,F=null,X=null,E=void 0,rt=null,K=!!O.dynamicChildren)=>{if(I===O)return;I&&!no(I,O)&&(z=ot(I),kt(I,F,X,!0),I=null),O.patchFlag===-2&&(K=!1,O.dynamicChildren=null);const{type:Q,ref:it,shapeFlag:w}=O;switch(Q){case Ll:m(I,O,U,z);break;case Si:d(I,O,U,z);break;case Zl:I==null&&S(O,U,z,E);break;case Je:V(I,O,U,z,F,X,E,rt,K);break;default:w&1?T(I,O,U,z,F,X,E,rt,K):w&6?q(I,O,U,z,F,X,E,rt,K):(w&64||w&128)&&Q.process(I,O,U,z,F,X,E,rt,K,Mt)}it!=null&&F?Eo(it,I&&I.ref,X,O||I,!O):it==null&&I&&I.ref!=null&&Eo(I.ref,null,X,I,!0)},m=(I,O,U,z)=>{if(I==null)i(O.el=a(O.children),U,z);else{const F=O.el=I.el;O.children!==I.children&&c(F,O.children)}},d=(I,O,U,z)=>{I==null?i(O.el=l(O.children||""),U,z):O.el=I.el},S=(I,O,U,z)=>{[I.el,I.anchor]=g(I.children,O,U,z,I.el,I.anchor)},x=({el:I,anchor:O},U,z)=>{let F;for(;I&&I!==O;)F=f(I),i(I,U,z),I=F;i(O,U,z)},y=({el:I,anchor:O})=>{let U;for(;I&&I!==O;)U=f(I),r(I),I=U;r(O)},T=(I,O,U,z,F,X,E,rt,K)=>{if(O.type==="svg"?E="svg":O.type==="math"&&(E="mathml"),I==null)P(O,U,z,F,X,E,rt,K);else{const Q=I.el&&I.el._isVueCE?I.el:null;try{Q&&Q._beginPatch(),b(I,O,F,X,E,rt,K)}finally{Q&&Q._endPatch()}}},P=(I,O,U,z,F,X,E,rt)=>{let K,Q;const{props:it,shapeFlag:w,transition:v,dirs:N}=I;if(K=I.el=o(I.type,X,it&&it.is,it),w&8?u(K,I.children):w&16&&C(I.children,K,null,z,F,$l(I,X),E,rt),N&&Er(I,null,z,"created"),R(K,I,I.scopeId,E,z),it){for(const nt in it)nt!=="value"&&!bo(nt)&&s(K,nt,null,it[nt],X,z);"value"in it&&s(K,"value",null,it.value,X),(Q=it.onVnodeBeforeMount)&&ai(Q,z,I)}N&&Er(I,null,z,"beforeMount");const Y=Tx(F,v);Y&&v.beforeEnter(K),i(K,O,U),((Q=it&&it.onVnodeMounted)||Y||N)&&Tn(()=>{Q&&ai(Q,z,I),Y&&v.enter(K),N&&Er(I,null,z,"mounted")},F)},R=(I,O,U,z,F)=>{if(U&&p(I,U),z)for(let X=0;X{for(let Q=K;Q{const rt=O.el=I.el;let{patchFlag:K,dynamicChildren:Q,dirs:it}=O;K|=I.patchFlag&16;const w=I.props||Ie,v=O.props||Ie;let N;if(U&&Tr(U,!1),(N=v.onVnodeBeforeUpdate)&&ai(N,U,O,I),it&&Er(O,I,U,"beforeUpdate"),U&&Tr(U,!0),(w.innerHTML&&v.innerHTML==null||w.textContent&&v.textContent==null)&&u(rt,""),Q?M(I.dynamicChildren,Q,rt,U,z,$l(O,F),X):E||H(I,O,rt,null,U,z,$l(O,F),X,!1),K>0){if(K&16)L(rt,w,v,U,F);else if(K&2&&w.class!==v.class&&s(rt,"class",null,v.class,F),K&4&&s(rt,"style",w.style,v.style,F),K&8){const Y=O.dynamicProps;for(let nt=0;nt{N&&ai(N,U,O,I),it&&Er(O,I,U,"updated")},z)},M=(I,O,U,z,F,X,E)=>{for(let rt=0;rt{if(O!==U){if(O!==Ie)for(const X in O)!bo(X)&&!(X in U)&&s(I,X,O[X],null,F,z);for(const X in U){if(bo(X))continue;const E=U[X],rt=O[X];E!==rt&&X!=="value"&&s(I,X,rt,E,F,z)}"value"in U&&s(I,"value",O.value,U.value,F)}},V=(I,O,U,z,F,X,E,rt,K)=>{const Q=O.el=I?I.el:a(""),it=O.anchor=I?I.anchor:a("");let{patchFlag:w,dynamicChildren:v,slotScopeIds:N}=O;N&&(rt=rt?rt.concat(N):N),I==null?(i(Q,U,z),i(it,U,z),C(O.children||[],U,it,F,X,E,rt,K)):w>0&&w&64&&v&&I.dynamicChildren&&I.dynamicChildren.length===v.length?(M(I.dynamicChildren,v,U,F,X,E,rt),(O.key!=null||F&&O===F.subTree)&&$g(I,O,!0)):H(I,O,U,it,F,X,E,rt,K)},q=(I,O,U,z,F,X,E,rt,K)=>{O.slotScopeIds=rt,I==null?O.shapeFlag&512?F.ctx.activate(O,U,z,E,K):j(O,U,z,F,X,E,K):J(I,O,K)},j=(I,O,U,z,F,X,E)=>{const rt=I.component=Nx(I,z,F);if(Ig(I)&&(rt.ctx.renderer=Mt),Ux(rt,!1,E),rt.asyncDep){if(F&&F.registerDep(rt,W,E),!I.el){const K=rt.subTree=Ge(Si);d(null,K,O,U),I.placeholder=K.el}}else W(rt,I,O,U,F,X,E)},J=(I,O,U)=>{const z=O.component=I.component;if(gx(I,O,U))if(z.asyncDep&&!z.asyncResolved){k(z,O,U);return}else z.next=O,z.update();else O.el=I.el,z.vnode=O},W=(I,O,U,z,F,X,E)=>{const rt=()=>{if(I.isMounted){let{next:w,bu:v,u:N,parent:Y,vnode:nt}=I;{const zt=Zg(I);if(zt){w&&(w.el=nt.el,k(I,w,E)),zt.asyncDep.then(()=>{Tn(()=>{I.isUnmounted||Q()},F)});return}}let $=w,wt;Tr(I,!1),w?(w.el=nt.el,k(I,w,E)):w=nt,v&&Gl(v),(wt=w.props&&w.props.onVnodeBeforeUpdate)&&ai(wt,Y,w,nt),Tr(I,!0);const ht=nd(I),Ct=I.subTree;I.subTree=ht,_(Ct,ht,h(Ct.el),ot(Ct),I,F,X),w.el=ht.el,$===null&&_x(I,ht.el),N&&Tn(N,F),(wt=w.props&&w.props.onVnodeUpdated)&&Tn(()=>ai(wt,Y,w,nt),F)}else{let w;const{el:v,props:N}=O,{bm:Y,m:nt,parent:$,root:wt,type:ht}=I,Ct=Cs(O);Tr(I,!1),Y&&Gl(Y),!Ct&&(w=N&&N.onVnodeBeforeMount)&&ai(w,$,O),Tr(I,!0);{wt.ce&&wt.ce._hasShadowRoot()&&wt.ce._injectChildStyle(ht);const zt=I.subTree=nd(I);_(null,zt,U,z,I,F,X),O.el=zt.el}if(nt&&Tn(nt,F),!Ct&&(w=N&&N.onVnodeMounted)){const zt=O;Tn(()=>ai(w,$,zt),F)}(O.shapeFlag&256||$&&Cs($.vnode)&&$.vnode.shapeFlag&256)&&I.a&&Tn(I.a,F),I.isMounted=!0,O=U=z=null}};I.scope.on();const K=I.effect=new og(rt);I.scope.off();const Q=I.update=K.run.bind(K),it=I.job=K.runIfDirty.bind(K);it.i=I,it.id=I.uid,K.scheduler=()=>yh(it),Tr(I,!0),Q()},k=(I,O,U)=>{O.component=I;const z=I.vnode.props;I.vnode=O,I.next=null,xx(I,O.props,z,U),Mx(I,O.children,U),Gi(),Jf(I),Wi()},H=(I,O,U,z,F,X,E,rt,K=!1)=>{const Q=I&&I.children,it=I?I.shapeFlag:0,w=O.children,{patchFlag:v,shapeFlag:N}=O;if(v>0){if(v&128){pt(Q,w,U,z,F,X,E,rt,K);return}else if(v&256){ct(Q,w,U,z,F,X,E,rt,K);return}}N&8?(it&16&&st(Q,F,X),w!==Q&&u(U,w)):it&16?N&16?pt(Q,w,U,z,F,X,E,rt,K):st(Q,F,X,!0):(it&8&&u(U,""),N&16&&C(w,U,z,F,X,E,rt,K))},ct=(I,O,U,z,F,X,E,rt,K)=>{I=I||Es,O=O||Es;const Q=I.length,it=O.length,w=Math.min(Q,it);let v;for(v=0;vit?st(I,F,X,!0,!1,w):C(O,U,z,F,X,E,rt,K,w)},pt=(I,O,U,z,F,X,E,rt,K)=>{let Q=0;const it=O.length;let w=I.length-1,v=it-1;for(;Q<=w&&Q<=v;){const N=I[Q],Y=O[Q]=K?Oi(O[Q]):fi(O[Q]);if(no(N,Y))_(N,Y,U,null,F,X,E,rt,K);else break;Q++}for(;Q<=w&&Q<=v;){const N=I[w],Y=O[v]=K?Oi(O[v]):fi(O[v]);if(no(N,Y))_(N,Y,U,null,F,X,E,rt,K);else break;w--,v--}if(Q>w){if(Q<=v){const N=v+1,Y=Nv)for(;Q<=w;)kt(I[Q],F,X,!0),Q++;else{const N=Q,Y=Q,nt=new Map;for(Q=Y;Q<=v;Q++){const Et=O[Q]=K?Oi(O[Q]):fi(O[Q]);Et.key!=null&&nt.set(Et.key,Q)}let $,wt=0;const ht=v-Y+1;let Ct=!1,zt=0;const ut=new Array(ht);for(Q=0;Q=ht){kt(Et,F,X,!0);continue}let It;if(Et.key!=null)It=nt.get(Et.key);else for($=Y;$<=v;$++)if(ut[$-Y]===0&&no(Et,O[$])){It=$;break}It===void 0?kt(Et,F,X,!0):(ut[It-Y]=Q+1,It>=zt?zt=It:Ct=!0,_(Et,O[It],U,null,F,X,E,rt,K),wt++)}const St=Ct?Ax(ut):Es;for($=St.length-1,Q=ht-1;Q>=0;Q--){const Et=Y+Q,It=O[Et],yt=O[Et+1],ee=Et+1{const{el:X,type:E,transition:rt,children:K,shapeFlag:Q}=I;if(Q&6){ft(I.component.subTree,O,U,z);return}if(Q&128){I.suspense.move(O,U,z);return}if(Q&64){E.move(I,O,U,Mt);return}if(E===Je){i(X,O,U);for(let w=0;wrt.enter(X),F);else{const{leave:w,delayLeave:v,afterLeave:N}=rt,Y=()=>{I.ctx.isUnmounted?r(X):i(X,O,U)},nt=()=>{X._isLeaving&&X[Hv](!0),w(X,()=>{Y(),N&&N()})};v?v(X,Y,nt):nt()}else i(X,O,U)},kt=(I,O,U,z=!1,F=!1)=>{const{type:X,props:E,ref:rt,children:K,dynamicChildren:Q,shapeFlag:it,patchFlag:w,dirs:v,cacheIndex:N}=I;if(w===-2&&(F=!1),rt!=null&&(Gi(),Eo(rt,null,U,I,!0),Wi()),N!=null&&(O.renderCache[N]=void 0),it&256){O.ctx.deactivate(I);return}const Y=it&1&&v,nt=!Cs(I);let $;if(nt&&($=E&&E.onVnodeBeforeUnmount)&&ai($,O,I),it&6)ue(I.component,U,z);else{if(it&128){I.suspense.unmount(U,z);return}Y&&Er(I,null,O,"beforeUnmount"),it&64?I.type.remove(I,O,U,Mt,z):Q&&!Q.hasOnce&&(X!==Je||w>0&&w&64)?st(Q,O,U,!1,!0):(X===Je&&w&384||!F&&it&16)&&st(K,O,U),z&&Lt(I)}(nt&&($=E&&E.onVnodeUnmounted)||Y)&&Tn(()=>{$&&ai($,O,I),Y&&Er(I,null,O,"unmounted")},U)},Lt=I=>{const{type:O,el:U,anchor:z,transition:F}=I;if(O===Je){Zt(U,z);return}if(O===Zl){y(I);return}const X=()=>{r(U),F&&!F.persisted&&F.afterLeave&&F.afterLeave()};if(I.shapeFlag&1&&F&&!F.persisted){const{leave:E,delayLeave:rt}=F,K=()=>E(U,X);rt?rt(I.el,X,K):K()}else X()},Zt=(I,O)=>{let U;for(;I!==O;)U=f(I),r(I),I=U;r(O)},ue=(I,O,U)=>{const{bum:z,scope:F,job:X,subTree:E,um:rt,m:K,a:Q}=I;sd(K),sd(Q),z&&Gl(z),F.stop(),X&&(X.flags|=8,kt(E,I,O,U)),rt&&Tn(rt,O),Tn(()=>{I.isUnmounted=!0},O)},st=(I,O,U,z=!1,F=!1,X=0)=>{for(let E=X;E{if(I.shapeFlag&6)return ot(I.component.subTree);if(I.shapeFlag&128)return I.suspense.next();const O=f(I.anchor||I.el),U=O&&O[zv];return U?f(U):O};let Pt=!1;const Vt=(I,O,U)=>{let z;I==null?O._vnode&&(kt(O._vnode,null,null,!0),z=O._vnode.component):_(O._vnode||null,I,O,null,null,null,U),O._vnode=I,Pt||(Pt=!0,Jf(z),Ag(),Pt=!1)},Mt={p:_,um:kt,m:ft,r:Lt,mt:j,mc:C,pc:H,pbc:M,n:ot,o:e};return{render:Vt,hydrate:void 0,createApp:ux(Vt)}}function $l({type:e,props:t},n){return n==="svg"&&e==="foreignObject"||n==="mathml"&&e==="annotation-xml"&&t&&t.encoding&&t.encoding.includes("html")?void 0:n}function Tr({effect:e,job:t},n){n?(e.flags|=32,t.flags|=4):(e.flags&=-33,t.flags&=-5)}function Tx(e,t){return(!e||e&&!e.pendingBranch)&&t&&!t.persisted}function $g(e,t,n=!1){const i=e.children,r=t.children;if(Kt(i)&&Kt(r))for(let s=0;s>1,e[n[a]]0&&(t[i]=n[s-1]),n[s]=i)}}for(s=n.length,o=n[s-1];s-- >0;)n[s]=o,o=t[o];return n}function Zg(e){const t=e.subTree.component;if(t)return t.asyncDep&&!t.asyncResolved?t:Zg(t)}function sd(e){if(e)for(let t=0;te.__isSuspense;function Px(e,t){t&&t.pendingBranch?Kt(e)?t.effects.push(...e):t.effects.push(e):Uv(e)}const Je=Symbol.for("v-fgt"),Ll=Symbol.for("v-txt"),Si=Symbol.for("v-cmt"),Zl=Symbol.for("v-stc"),Ao=[];let Bn=null;function ce(e=!1){Ao.push(Bn=e?null:[])}function Cx(){Ao.pop(),Bn=Ao[Ao.length-1]||null}let Fo=1;function ul(e,t=!1){Fo+=e,e<0&&Bn&&t&&(Bn.hasOnce=!0)}function jg(e){return e.dynamicChildren=Fo>0?Bn||Es:null,Cx(),Fo>0&&Bn&&Bn.push(e),e}function Fn(e,t,n,i,r,s){return jg(mr(e,t,n,i,r,s,!0))}function Oe(e,t,n,i,r){return jg(Ge(e,t,n,i,r,!0))}function ko(e){return e?e.__v_isVNode===!0:!1}function no(e,t){return e.type===t.type&&e.key===t.key}const t0=({key:e})=>e??null,qa=({ref:e,ref_key:t,ref_for:n})=>(typeof e=="number"&&(e=""+e),e!=null?We(e)||Ve(e)||jt(e)?{i:Sn,r:e,k:t,f:!!n}:e:null);function mr(e,t=null,n=null,i=0,r=null,s=e===Je?0:1,o=!1,a=!1){const l={__v_isVNode:!0,__v_skip:!0,type:e,props:t,key:t&&t0(t),ref:t&&qa(t),scopeId:Cg,slotScopeIds:null,children:n,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:s,patchFlag:i,dynamicProps:r,dynamicChildren:null,appContext:null,ctx:Sn};return a?(Ah(l,n),s&128&&e.normalize(l)):n&&(l.shapeFlag|=We(n)?8:16),Fo>0&&!o&&Bn&&(l.patchFlag>0||s&6)&&l.patchFlag!==32&&Bn.push(l),l}const Ge=Rx;function Rx(e,t=null,n=null,i=0,r=null,s=!1){if((!e||e===Ng)&&(e=Si),ko(e)){const a=Jr(e,t,!0);return n&&Ah(a,n),Fo>0&&!s&&Bn&&(a.shapeFlag&6?Bn[Bn.indexOf(e)]=a:Bn.push(a)),a.patchFlag=-2,a}if(zx(e)&&(e=e.__vccOpts),t){t=Dx(t);let{class:a,style:l}=t;a&&!We(a)&&(t.class=Us(a)),xe(l)&&(Pl(l)&&!Kt(l)&&(l=on({},l)),t.style=qs(l))}const o=We(e)?1:Qg(e)?128:Vv(e)?64:xe(e)?4:jt(e)?2:0;return mr(e,t,n,i,r,o,s,!0)}function Dx(e){return e?Pl(e)||Gg(e)?on({},e):e:null}function Jr(e,t,n=!1,i=!1){const{props:r,ref:s,patchFlag:o,children:a,transition:l}=e,c=t?bi(r||{},t):r,u={__v_isVNode:!0,__v_skip:!0,type:e.type,props:c,key:c&&t0(c),ref:t&&t.ref?n&&s?Kt(s)?s.concat(qa(t)):[s,qa(t)]:qa(t):s,scopeId:e.scopeId,slotScopeIds:e.slotScopeIds,children:a,target:e.target,targetStart:e.targetStart,targetAnchor:e.targetAnchor,staticCount:e.staticCount,shapeFlag:e.shapeFlag,patchFlag:t&&e.type!==Je?o===-1?16:o|16:o,dynamicProps:e.dynamicProps,dynamicChildren:e.dynamicChildren,appContext:e.appContext,dirs:e.dirs,transition:l,component:e.component,suspense:e.suspense,ssContent:e.ssContent&&Jr(e.ssContent),ssFallback:e.ssFallback&&Jr(e.ssFallback),placeholder:e.placeholder,el:e.el,anchor:e.anchor,ctx:e.ctx,ce:e.ce};return l&&i&&Mh(u,l.clone(u)),u}function Ds(e=" ",t=0){return Ge(Ll,null,e,t)}function qr(e="",t=!1){return t?(ce(),Oe(Si,null,e)):Ge(Si,null,e)}function fi(e){return e==null||typeof e=="boolean"?Ge(Si):Kt(e)?Ge(Je,null,e.slice()):ko(e)?Oi(e):Ge(Ll,null,String(e))}function Oi(e){return e.el===null&&e.patchFlag!==-1||e.memo?e:Jr(e)}function Ah(e,t){let n=0;const{shapeFlag:i}=e;if(t==null)t=null;else if(Kt(t))n=16;else if(typeof t=="object")if(i&65){const r=t.default;r&&(r._c&&(r._d=!1),Ah(e,r()),r._c&&(r._d=!0));return}else{n=32;const r=t._;!r&&!Gg(t)?t._ctx=Sn:r===3&&Sn&&(Sn.slots._===1?t._=1:(t._=2,e.patchFlag|=1024))}else jt(t)?(t={default:t,_ctx:Sn},n=32):(t=String(t),i&64?(n=16,t=[Ds(t)]):n=8);e.children=t,e.shapeFlag|=n}function bi(...e){const t={};for(let n=0;nhn||Sn;let hl,eu;{const e=Tl(),t=(n,i)=>{let r;return(r=e[n])||(r=e[n]=[]),r.push(i),s=>{r.length>1?r.forEach(o=>o(s)):r[0](s)}};hl=t("__VUE_INSTANCE_SETTERS__",n=>hn=n),eu=t("__VUE_SSR_SETTERS__",n=>Bo=n)}const Zo=e=>{const t=hn;return hl(e),e.scope.on(),()=>{e.scope.off(),hl(t)}},od=()=>{hn&&hn.scope.off(),hl(null)};function e0(e){return e.vnode.shapeFlag&4}let Bo=!1;function Ux(e,t=!1,n=!1){t&&eu(t);const{props:i,children:r}=e.vnode,s=e0(e);vx(e,i,s,t),bx(e,r,n||t);const o=s?Ox(e,t):void 0;return t&&eu(!1),o}function Ox(e,t){const n=e.type;e.accessCache=Object.create(null),e.proxy=new Proxy(e.ctx,ix);const{setup:i}=n;if(i){Gi();const r=e.setupContext=i.length>1?kx(e):null,s=Zo(e),o=Jo(i,e,0,[e.props,r]),a=jm(o);if(Wi(),s(),(a||e.sp)&&!Cs(e)&&Dg(e),a){if(o.then(od,od),t)return o.then(l=>{ad(e,l)}).catch(l=>{Cl(l,e,0)});e.asyncDep=o}else ad(e,o)}else n0(e)}function ad(e,t,n){jt(t)?e.type.__ssrInlineRender?e.ssrRender=t:e.render=t:xe(t)&&(e.setupState=bg(t)),n0(e)}function n0(e,t,n){const i=e.type;e.render||(e.render=i.render||_i);{const r=Zo(e);Gi();try{rx(e)}finally{Wi(),r()}}}const Fx={get(e,t){return un(e,"get",""),e[t]}};function kx(e){const t=n=>{e.exposed=n||{}};return{attrs:new Proxy(e.attrs,Fx),slots:e.slots,emit:e.emit,expose:t}}function Ph(e){return e.exposed?e.exposeProxy||(e.exposeProxy=new Proxy(bg(yg(e.exposed)),{get(t,n){if(n in t)return t[n];if(n in To)return To[n](e)},has(t,n){return n in t||n in To}})):e.proxy}function Bx(e,t=!0){return jt(e)?e.displayName||e.name:e.name||t&&e.__name}function zx(e){return jt(e)&&"__vccOpts"in e}const pe=(e,t)=>Rv(e,t,Bo);function Po(e,t,n){try{ul(-1);const i=arguments.length;return i===2?xe(t)&&!Kt(t)?ko(t)?Ge(e,null,[t]):Ge(e,t):Ge(e,null,t):(i>3?n=Array.prototype.slice.call(arguments,2):i===3&&ko(n)&&(n=[n]),Ge(e,t,n))}finally{ul(1)}}const Vx="3.5.28";let nu;const ld=typeof window<"u"&&window.trustedTypes;if(ld)try{nu=ld.createPolicy("vue",{createHTML:e=>e})}catch{}const i0=nu?e=>nu.createHTML(e):e=>e,Hx="http://www.w3.org/2000/svg",Gx="http://www.w3.org/1998/Math/MathML",Ui=typeof document<"u"?document:null,cd=Ui&&Ui.createElement("template"),Wx={insert:(e,t,n)=>{t.insertBefore(e,n||null)},remove:e=>{const t=e.parentNode;t&&t.removeChild(e)},createElement:(e,t,n,i)=>{const r=t==="svg"?Ui.createElementNS(Hx,e):t==="mathml"?Ui.createElementNS(Gx,e):n?Ui.createElement(e,{is:n}):Ui.createElement(e);return e==="select"&&i&&i.multiple!=null&&r.setAttribute("multiple",i.multiple),r},createText:e=>Ui.createTextNode(e),createComment:e=>Ui.createComment(e),setText:(e,t)=>{e.nodeValue=t},setElementText:(e,t)=>{e.textContent=t},parentNode:e=>e.parentNode,nextSibling:e=>e.nextSibling,querySelector:e=>Ui.querySelector(e),setScopeId(e,t){e.setAttribute(t,"")},insertStaticContent(e,t,n,i,r,s){const o=n?n.previousSibling:t.lastChild;if(r&&(r===s||r.nextSibling))for(;t.insertBefore(r.cloneNode(!0),n),!(r===s||!(r=r.nextSibling)););else{cd.innerHTML=i0(i==="svg"?`${e}`:i==="mathml"?`${e}`:e);const a=cd.content;if(i==="svg"||i==="mathml"){const l=a.firstChild;for(;l.firstChild;)a.appendChild(l.firstChild);a.removeChild(l)}t.insertBefore(a,n)}return[o?o.nextSibling:t.firstChild,n?n.previousSibling:t.lastChild]}},Xx=Symbol("_vtc");function qx(e,t,n){const i=e[Xx];i&&(t=(t?[t,...i]:[...i]).join(" ")),t==null?e.removeAttribute("class"):n?e.setAttribute("class",t):e.className=t}const ud=Symbol("_vod"),Yx=Symbol("_vsh"),Jx=Symbol(""),$x=/(?:^|;)\s*display\s*:/;function Zx(e,t,n){const i=e.style,r=We(n);let s=!1;if(n&&!r){if(t)if(We(t))for(const o of t.split(";")){const a=o.slice(0,o.indexOf(":")).trim();n[a]==null&&Ya(i,a,"")}else for(const o in t)n[o]==null&&Ya(i,o,"");for(const o in n)o==="display"&&(s=!0),Ya(i,o,n[o])}else if(r){if(t!==n){const o=i[Jx];o&&(n+=";"+o),i.cssText=n,s=$x.test(n)}}else t&&e.removeAttribute("style");ud in e&&(e[ud]=s?i.display:"",e[Yx]&&(i.display="none"))}const hd=/\s*!important$/;function Ya(e,t,n){if(Kt(n))n.forEach(i=>Ya(e,t,i));else if(n==null&&(n=""),t.startsWith("--"))e.setProperty(t,n);else{const i=Kx(e,t);hd.test(n)?e.setProperty(Kr(i),n.replace(hd,""),"important"):e[i]=n}}const fd=["Webkit","Moz","ms"],Kl={};function Kx(e,t){const n=Kl[t];if(n)return n;let i=Rn(t);if(i!=="filter"&&i in e)return Kl[t]=i;i=El(i);for(let r=0;rQl||(ny.then(()=>Ql=0),Ql=Date.now());function ry(e,t){const n=i=>{if(!i._vts)i._vts=Date.now();else if(i._vts<=n.attached)return;yi(sy(i,n.value),t,5,[i])};return n.value=e,n.attached=iy(),n}function sy(e,t){if(Kt(t)){const n=e.stopImmediatePropagation;return e.stopImmediatePropagation=()=>{n.call(e),e._stopped=!0},t.map(i=>r=>!r._stopped&&i&&i(r))}else return t}const vd=e=>e.charCodeAt(0)===111&&e.charCodeAt(1)===110&&e.charCodeAt(2)>96&&e.charCodeAt(2)<123,oy=(e,t,n,i,r,s)=>{const o=r==="svg";t==="class"?qx(e,i,o):t==="style"?Zx(e,n,i):bl(t)?uh(t)||ty(e,t,n,i,s):(t[0]==="."?(t=t.slice(1),!0):t[0]==="^"?(t=t.slice(1),!1):ay(e,t,i,o))?(md(e,t,i),!e.tagName.includes("-")&&(t==="value"||t==="checked"||t==="selected")&&pd(e,t,i,o,s,t!=="value")):e._isVueCE&&(/[A-Z]/.test(t)||!We(i))?md(e,Rn(t),i,s,t):(t==="true-value"?e._trueValue=i:t==="false-value"&&(e._falseValue=i),pd(e,t,i,o))};function ay(e,t,n,i){if(i)return!!(t==="innerHTML"||t==="textContent"||t in e&&vd(t)&&jt(n));if(t==="spellcheck"||t==="draggable"||t==="translate"||t==="autocorrect"||t==="sandbox"&&e.tagName==="IFRAME"||t==="form"||t==="list"&&e.tagName==="INPUT"||t==="type"&&e.tagName==="TEXTAREA")return!1;if(t==="width"||t==="height"){const r=e.tagName;if(r==="IMG"||r==="VIDEO"||r==="CANVAS"||r==="SOURCE")return!1}return vd(t)&&We(n)?!1:t in e}const ly=on({patchProp:oy},Wx);let xd;function cy(){return xd||(xd=wx(ly))}const uy=((...e)=>{const t=cy().createApp(...e),{mount:n}=t;return t.mount=i=>{const r=fy(i);if(!r)return;const s=t._component;!jt(s)&&!s.render&&!s.template&&(s.template=r.innerHTML),r.nodeType===1&&(r.textContent="");const o=n(r,!1,hy(r));return r instanceof Element&&(r.removeAttribute("v-cloak"),r.setAttribute("data-v-app","")),o},t});function hy(e){if(e instanceof SVGElement)return"svg";if(typeof MathMLElement=="function"&&e instanceof MathMLElement)return"mathml"}function fy(e){return We(e)?document.querySelector(e):e}function r0(e){var t,n,i="";if(typeof e=="string"||typeof e=="number")i+=e;else if(typeof e=="object")if(Array.isArray(e)){var r=e.length;for(t=0;ttypeof e=="boolean"?`${e}`:e===0?"0":e,Sd=s0,dy=(e,t)=>n=>{var i;if(t?.variants==null)return Sd(e,n?.class,n?.className);const{variants:r,defaultVariants:s}=t,o=Object.keys(r).map(c=>{const u=n?.[c],h=s?.[c];if(u===null)return null;const f=yd(u)||yd(h);return r[c][f]}),a=n&&Object.entries(n).reduce((c,u)=>{let[h,f]=u;return f===void 0||(c[h]=f),c},{}),l=t==null||(i=t.compoundVariants)===null||i===void 0?void 0:i.reduce((c,u)=>{let{class:h,className:f,...p}=u;return Object.entries(p).every(g=>{let[_,m]=g;return Array.isArray(m)?m.includes({...s,...a}[_]):{...s,...a}[_]===m})?[...c,h,f]:c},[]);return Sd(e,o,l,n?.class,n?.className)};function o0(e,t=Number.NEGATIVE_INFINITY,n=Number.POSITIVE_INFINITY){return Math.min(n,Math.max(t,e))}function Ch(e,t){const n=typeof e=="string"&&!t?`${e}Context`:t,i=Symbol(n);return[o=>{const a=Ps(i,o);if(a||a===null)return a;throw new Error(`Injection \`${i.toString()}\` not found. Component must be used within ${Array.isArray(e)?`one of the following components: ${e.join(", ")}`:`\`${e}\``}`)},o=>(Sh(i,o),o)]}function a0(e){return e?e.flatMap(t=>t.type===Je?a0(t.children):[t]):[]}const[py]=Ch("ConfigProvider");typeof WorkerGlobalScope<"u"&&globalThis instanceof WorkerGlobalScope;const my=e=>typeof e<"u";function gy(e){return Xi(Ve(e)?new Proxy({},{get(t,n,i){return vt(Reflect.get(e.value,n,i))},set(t,n,i){return Ve(e.value[n])&&!Ve(i)?e.value[n].value=i:e.value[n]=i,!0},deleteProperty(t,n){return Reflect.deleteProperty(e.value,n)},has(t,n){return Reflect.has(e.value,n)},ownKeys(){return Object.keys(e.value)},getOwnPropertyDescriptor(){return{enumerable:!0,configurable:!0}}}):e)}function _y(e){return gy(pe(e))}function vy(e,...t){const n=t.flat(),i=n[0];return _y(()=>Object.fromEntries(typeof i=="function"?Object.entries(Uo(e)).filter(([r,s])=>!i(xh(s),r)):Object.entries(Uo(e)).filter(r=>!n.includes(r[0]))))}function Nl(e){var t;const n=xh(e);return(t=n?.$el)!==null&&t!==void 0?t:n}function xy(){const e=Mv(!1),t=Ys();return t&&$o(()=>{e.value=!0},t),e}function yy(e){return JSON.parse(JSON.stringify(e))}function Sy(e,t,n,i={}){var r,s;const{clone:o=!1,passive:a=!1,eventName:l,deep:c=!1,defaultValue:u,shouldEmit:h}=i,f=Ys(),p=n||f?.emit||(f==null||(r=f.$emit)===null||r===void 0?void 0:r.bind(f))||(f==null||(s=f.proxy)===null||s===void 0||(s=s.$emit)===null||s===void 0?void 0:s.bind(f?.proxy));let g=l;g=g||`update:${t.toString()}`;const _=S=>o?typeof o=="function"?o(S):yy(S):S,m=()=>my(e[t])?_(e[t]):u,d=S=>{h?h(S)&&p(g,S):p(g,S)};if(a){const S=sn(m());let x=!1;return Xr(()=>e[t],y=>{x||(x=!0,S.value=_(y),Eg(()=>x=!1))}),Xr(S,y=>{!x&&(y!==e[t]||c)&&d(y)},{deep:c}),S}else return pe({get(){return m()},set(S){d(S)}})}function by(e){const t=py({dir:sn("ltr")});return pe(()=>e?.value||t.dir?.value||"ltr")}function My(e){const t=Ys(),n=t?.type.emits,i={};return n?.length||console.warn(`No emitted event found. Please check component: ${t?.type.__name}`),n?.forEach(r=>{i[Xa(Rn(r))]=(...s)=>e(r,...s)}),i}function wy(e){return pe(()=>xh(e)?!!Nl(e)?.closest("form"):!0)}function Qr(){const e=Ys(),t=sn(),n=pe(()=>["#text","#comment"].includes(t.value?.$el.nodeName)?t.value?.$el.nextElementSibling:Nl(t)),i=Object.assign({},e.exposed),r={};for(const o in e.props)Object.defineProperty(r,o,{enumerable:!0,configurable:!0,get:()=>e.props[o]});if(Object.keys(i).length>0)for(const o in i)Object.defineProperty(r,o,{enumerable:!0,configurable:!0,get:()=>i[o]});Object.defineProperty(r,"$el",{enumerable:!0,configurable:!0,get:()=>e.vnode.el}),e.exposed=r;function s(o){if(t.value=o,!!o&&(Object.defineProperty(r,"$el",{enumerable:!0,configurable:!0,get:()=>o instanceof Element?o:o.$el}),!(o instanceof Element)&&!Object.hasOwn(o,"$el"))){const a=o.$.exposed,l=Object.assign({},r);for(const c in a)Object.defineProperty(l,c,{enumerable:!0,configurable:!0,get:()=>a[c]});e.exposed=l}}return{forwardRef:s,currentRef:t,currentElement:n}}function Ey(e){const t=Ys(),n=Object.keys(t?.type.props??{}).reduce((r,s)=>{const o=(t?.type.props[s]).default;return o!==void 0&&(r[s]=o),r},{}),i=Pv(e);return pe(()=>{const r={},s=t?.vnode.props??{};return Object.keys(s).forEach(o=>{r[Rn(o)]=s[o]}),Object.keys({...n,...r}).reduce((o,a)=>(i.value[a]!==void 0&&(o[a]=i.value[a]),o),{})})}function Ty(e,t){const n=Ey(e),i=t?My(t):{};return pe(()=>({...n.value,...i}))}function Ay(e){const t=sn(),n=pe(()=>t.value?.width??0),i=pe(()=>t.value?.height??0);return $o(()=>{const r=Nl(e);if(r){t.value={width:r.offsetWidth,height:r.offsetHeight};const s=new ResizeObserver(o=>{if(!Array.isArray(o)||!o.length)return;const a=o[0];let l,c;if("borderBoxSize"in a){const u=a.borderBoxSize,h=Array.isArray(u)?u[0]:u;l=h.inlineSize,c=h.blockSize}else l=r.offsetWidth,c=r.offsetHeight;t.value={width:l,height:c}});return s.observe(r,{box:"border-box"}),()=>s.unobserve(r)}else t.value=void 0}),{width:n,height:i}}const iu=Ze({name:"PrimitiveSlot",inheritAttrs:!1,setup(e,{attrs:t,slots:n}){return()=>{if(!n.default)return null;const i=a0(n.default()),r=i.findIndex(l=>l.type!==Si);if(r===-1)return i;const s=i[r];delete s.props?.ref;const o=s.props?bi(t,s.props):t,a=Jr({...s,props:{}},o);return i.length===1?a:(i[r]=a,i)}}}),Py=["area","img","input"],Js=Ze({name:"Primitive",inheritAttrs:!1,props:{asChild:{type:Boolean,default:!1},as:{type:[String,Object],default:"div"}},setup(e,{attrs:t,slots:n}){const i=e.asChild?"template":e.as;return typeof i=="string"&&Py.includes(i)?()=>Po(i,t):i!=="template"?()=>Po(e.as,t,{default:n.default}):()=>Po(iu,t,{default:n.default})}});function ru(){const e=sn(),t=pe(()=>["#text","#comment"].includes(e.value?.$el.nodeName)?e.value?.$el.nextElementSibling:Nl(e));return{primitiveElement:e,currentElement:t}}const bd="data-reka-collection-item";function Rh(e={}){const{key:t="",isProvider:n=!1}=e,i=`${t}CollectionProvider`;let r;n?(r={collectionRef:sn(),itemMap:sn(new Map)},Sh(i,r)):r=Ps(i);const s=(u=!1)=>{const h=r.collectionRef.value;if(!h)return[];const f=Array.from(h.querySelectorAll(`[${bd}]`)),g=Array.from(r.itemMap.value.values()).sort((_,m)=>f.indexOf(_.ref)-f.indexOf(m.ref));return u?g:g.filter(_=>_.ref.dataset.disabled!=="")},o=Ze({name:"CollectionSlot",inheritAttrs:!1,setup(u,{slots:h,attrs:f}){const{primitiveElement:p,currentElement:g}=ru();return Xr(g,()=>{r.collectionRef.value=g.value}),()=>Po(iu,{ref:p,...f},h)}}),a=Ze({name:"CollectionItem",inheritAttrs:!1,props:{value:{validator:()=>!0}},setup(u,{slots:h,attrs:f}){const{primitiveElement:p,currentElement:g}=ru();return kv(_=>{if(g.value){const m=yg(g.value);r.itemMap.value.set(m,{ref:g.value,value:u.value}),_(()=>r.itemMap.value.delete(m))}}),()=>Po(iu,{...f,[bd]:"",ref:p},h)}}),l=pe(()=>Array.from(r.itemMap.value.values())),c=pe(()=>r.itemMap.value.size);return{getItems:s,reactiveItems:l,itemMapSize:c,CollectionSlot:o,CollectionItem:a}}var Cy=Ze({__name:"VisuallyHidden",props:{feature:{type:String,required:!1,default:"focusable"},asChild:{type:Boolean,required:!1},as:{type:null,required:!1,default:"span"}},setup(e){return(t,n)=>(ce(),Oe(vt(Js),{as:t.as,"as-child":t.asChild,"aria-hidden":t.feature==="focusable"?"true":void 0,"data-hidden":t.feature==="fully-hidden"?"":void 0,tabindex:t.feature==="fully-hidden"?"-1":void 0,style:{position:"absolute",border:0,width:"1px",height:"1px",padding:0,margin:"-1px",overflow:"hidden",clip:"rect(0, 0, 0, 0)",clipPath:"inset(50%)",whiteSpace:"nowrap",wordWrap:"normal",top:"-1px",left:"-1px"}},{default:$e(()=>[wi(t.$slots,"default")]),_:3},8,["as","as-child","aria-hidden","data-hidden","tabindex"]))}}),Ry=Cy,Dy=Ze({inheritAttrs:!1,__name:"VisuallyHiddenInputBubble",props:{name:{type:String,required:!0},value:{type:null,required:!0},checked:{type:Boolean,required:!1,default:void 0},required:{type:Boolean,required:!1},disabled:{type:Boolean,required:!1},feature:{type:String,required:!1,default:"fully-hidden"}},setup(e){const t=e,{primitiveElement:n,currentElement:i}=ru(),r=pe(()=>t.checked??t.value);return Xr(r,(s,o)=>{if(!i.value)return;const a=i.value,l=window.HTMLInputElement.prototype,u=Object.getOwnPropertyDescriptor(l,"value").set;if(u&&s!==o){const h=new Event("input",{bubbles:!0}),f=new Event("change",{bubbles:!0});u.call(a,s),a.dispatchEvent(h),a.dispatchEvent(f)}}),(s,o)=>(ce(),Oe(Ry,bi({ref_key:"primitiveElement",ref:n},{...t,...s.$attrs},{as:"input"}),null,16))}}),Md=Dy,Iy=Ze({inheritAttrs:!1,__name:"VisuallyHiddenInput",props:{name:{type:String,required:!0},value:{type:null,required:!0},checked:{type:Boolean,required:!1,default:void 0},required:{type:Boolean,required:!1},disabled:{type:Boolean,required:!1},feature:{type:String,required:!1,default:"fully-hidden"}},setup(e){const t=e,n=pe(()=>typeof t.value=="object"&&Array.isArray(t.value)&&t.value.length===0&&t.required),i=pe(()=>typeof t.value=="string"||typeof t.value=="number"||typeof t.value=="boolean"||t.value===null||t.value===void 0?[{name:t.name,value:t.value}]:typeof t.value=="object"&&Array.isArray(t.value)?t.value.flatMap((r,s)=>typeof r=="object"?Object.entries(r).map(([o,a])=>({name:`${t.name}[${s}][${o}]`,value:a})):{name:`${t.name}[${s}]`,value:r}):t.value!==null&&typeof t.value=="object"&&!Array.isArray(t.value)?Object.entries(t.value).map(([r,s])=>({name:`${t.name}[${r}]`,value:s})):[]);return(r,s)=>(ce(),Fn(Je,null,[qr(" We render single input if it's required "),n.value?(ce(),Oe(Md,bi({key:r.name},{...t,...r.$attrs},{name:r.name,value:r.value}),null,16,["name","value"])):(ce(!0),Fn(Je,{key:1},Dl(i.value,o=>(ce(),Oe(Md,bi({key:o.name},{ref_for:!0},{...t,...r.$attrs},{name:o.name,value:o.value}),null,16,["name","value"]))),128))],2112))}}),Ly=Iy;function Ny(e=[],t,n){const i=[...e];return i[n]=t,i.sort((r,s)=>r-s)}function l0(e,t,n){const s=100/(n-t)*(e-t);return o0(s,0,100)}function Uy(e,t){return t>2?`Value ${e+1} of ${t}`:t===2?["Minimum","Maximum"][e]:void 0}function Oy(e,t){if(e.length===1)return 0;const n=e.map(r=>Math.abs(r-t)),i=Math.min(...n);return n.indexOf(i)}function Fy(e,t,n){const i=e/2,s=Dh([0,50],[0,i]);return(i-s(t)*n)*n}function ky(e){return e.slice(0,-1).map((t,n)=>e[n+1]-t)}function By(e,t){if(t>0){const n=ky(e);return Math.min(...n)>=t}return!0}function Dh(e,t){return n=>{if(e[0]===e[1]||t[0]===t[1])return t[0];const i=(t[1]-t[0])/(e[1]-e[0]);return t[0]+i*(n-e[0])}}function zy(e){return(String(e).split(".")[1]||"").length}function Vy(e,t){const n=10**t;return Math.round(e*n)/n}const c0=["PageUp","PageDown"],u0=["ArrowUp","ArrowDown","ArrowLeft","ArrowRight"],h0={"from-left":["Home","PageDown","ArrowDown","ArrowLeft"],"from-right":["Home","PageDown","ArrowDown","ArrowRight"],"from-bottom":["Home","PageDown","ArrowDown","ArrowLeft"],"from-top":["Home","PageUp","ArrowUp","ArrowLeft"]},[f0,d0]=Ch(["SliderVertical","SliderHorizontal"]);var Hy=Ze({__name:"SliderHorizontal",props:{dir:{type:String,required:!1},min:{type:Number,required:!0},max:{type:Number,required:!0},inverted:{type:Boolean,required:!0}},emits:["slideEnd","slideStart","slideMove","homeKeyDown","endKeyDown","stepKeyDown"],setup(e,{emit:t}){const n=e,i=t,{max:r,min:s,dir:o,inverted:a}=Uo(n),{forwardRef:l,currentElement:c}=Qr(),u=$s(),h=sn(),f=sn(),p=pe(()=>o?.value!=="rtl"&&!a.value||o?.value!=="ltr"&&a.value);function g(S,x){const y=f.value||c.value.getBoundingClientRect(),T=[...u.thumbElements.value][u.valueIndexToChangeRef.value],P=u.thumbAlignment.value==="contain"?T.clientWidth:0;!h.value&&!x&&u.thumbAlignment.value==="contain"&&(h.value=S.clientX-T.getBoundingClientRect().left);const R=[0,y.width-P],C=p.value?[s.value,r.value]:[r.value,s.value],b=Dh(R,C);f.value=y;const M=x?S.clientX-y.left-P/2:S.clientX-y.left-(h.value??0);return b(M)}const _=pe(()=>p.value?"left":"right"),m=pe(()=>p.value?"right":"left"),d=pe(()=>p.value?1:-1);return d0({startEdge:_,endEdge:m,direction:d,size:"width"}),(S,x)=>(ce(),Oe(p0,{ref:vt(l),dir:vt(o),"data-orientation":"horizontal",style:qs({"--reka-slider-thumb-transform":!p.value&&vt(u).thumbAlignment.value==="overflow"?"translateX(50%)":"translateX(-50%)"}),onSlideStart:x[0]||(x[0]=y=>{const T=g(y,!0);i("slideStart",T)}),onSlideMove:x[1]||(x[1]=y=>{const T=g(y);i("slideMove",T)}),onSlideEnd:x[2]||(x[2]=()=>{f.value=void 0,h.value=void 0,i("slideEnd")}),onStepKeyDown:x[3]||(x[3]=y=>{const T=p.value?"from-left":"from-right",P=vt(h0)[T].includes(y.key);i("stepKeyDown",y,P?-1:1)}),onEndKeyDown:x[4]||(x[4]=y=>i("endKeyDown",y)),onHomeKeyDown:x[5]||(x[5]=y=>i("homeKeyDown",y))},{default:$e(()=>[wi(S.$slots,"default")]),_:3},8,["dir","style"]))}}),Gy=Hy,Wy=Ze({__name:"SliderVertical",props:{min:{type:Number,required:!0},max:{type:Number,required:!0},inverted:{type:Boolean,required:!0}},emits:["slideEnd","slideStart","slideMove","homeKeyDown","endKeyDown","stepKeyDown"],setup(e,{emit:t}){const n=e,i=t,{max:r,min:s,inverted:o}=Uo(n),a=$s(),{forwardRef:l,currentElement:c}=Qr(),u=sn(),h=sn(),f=pe(()=>!o.value);function p(d,S){const x=h.value||c.value.getBoundingClientRect(),y=[...a.thumbElements.value][a.valueIndexToChangeRef.value],T=a.thumbAlignment.value==="contain"?y.clientHeight:0;!u.value&&!S&&a.thumbAlignment.value==="contain"&&(u.value=d.clientY-y.getBoundingClientRect().top);const P=[0,x.height-T],R=f.value?[r.value,s.value]:[s.value,r.value],C=Dh(P,R),b=S?d.clientY-x.top-T/2:d.clientY-x.top-(u.value??0);return h.value=x,C(b)}const g=pe(()=>f.value?"bottom":"top"),_=pe(()=>f.value?"top":"bottom"),m=pe(()=>f.value?1:-1);return d0({startEdge:g,endEdge:_,direction:m,size:"height"}),(d,S)=>(ce(),Oe(p0,{ref:vt(l),"data-orientation":"vertical",style:qs({"--reka-slider-thumb-transform":!f.value&&vt(a).thumbAlignment.value==="overflow"?"translateY(-50%)":"translateY(50%)"}),onSlideStart:S[0]||(S[0]=x=>{const y=p(x,!0);i("slideStart",y)}),onSlideMove:S[1]||(S[1]=x=>{const y=p(x);i("slideMove",y)}),onSlideEnd:S[2]||(S[2]=()=>{h.value=void 0,u.value=void 0,i("slideEnd")}),onStepKeyDown:S[3]||(S[3]=x=>{const y=f.value?"from-bottom":"from-top",T=vt(h0)[y].includes(x.key);i("stepKeyDown",x,T?-1:1)}),onEndKeyDown:S[4]||(S[4]=x=>i("endKeyDown",x)),onHomeKeyDown:S[5]||(S[5]=x=>i("homeKeyDown",x))},{default:$e(()=>[wi(d.$slots,"default")]),_:3},8,["style"]))}}),Xy=Wy;const[$s,qy]=Ch("SliderRoot");var Yy=Ze({inheritAttrs:!1,__name:"SliderRoot",props:{defaultValue:{type:Array,required:!1,default:()=>[0]},modelValue:{type:[Array,null],required:!1},disabled:{type:Boolean,required:!1,default:!1},orientation:{type:String,required:!1,default:"horizontal"},dir:{type:String,required:!1},inverted:{type:Boolean,required:!1,default:!1},min:{type:Number,required:!1,default:0},max:{type:Number,required:!1,default:100},step:{type:Number,required:!1,default:1},minStepsBetweenThumbs:{type:Number,required:!1,default:0},thumbAlignment:{type:String,required:!1,default:"contain"},asChild:{type:Boolean,required:!1},as:{type:null,required:!1,default:"span"},name:{type:String,required:!1},required:{type:Boolean,required:!1}},emits:["update:modelValue","valueCommit"],setup(e,{emit:t}){const n=e,i=t,{min:r,max:s,step:o,minStepsBetweenThumbs:a,orientation:l,disabled:c,thumbAlignment:u,dir:h}=Uo(n),f=by(h),{forwardRef:p,currentElement:g}=Qr(),_=wy(g),{CollectionSlot:m}=Rh({isProvider:!0}),d=Sy(n,"modelValue",i,{defaultValue:n.defaultValue,passive:n.modelValue===void 0}),S=pe(()=>Array.isArray(d.value)?[...d.value]:[]),x=sn(0),y=sn(S.value);function T(M){const L=Oy(S.value,M);C(M,L)}function P(M){C(M,x.value)}function R(){const M=y.value[x.value];S.value[x.value]!==M&&i("valueCommit",_e(S.value))}function C(M,L,{commit:V}={commit:!1}){const q=zy(o.value),j=Vy(Math.round((M-r.value)/o.value)*o.value+r.value,q),J=o0(j,r.value,s.value),W=Ny(S.value,J,L);if(By(W,a.value*o.value)){x.value=W.indexOf(J);const k=String(W)!==String(d.value);k&&V&&i("valueCommit",W),k&&(b.value[x.value]?.focus(),d.value=W)}}const b=sn([]);return qy({modelValue:d,currentModelValue:S,valueIndexToChangeRef:x,thumbElements:b,orientation:l,min:r,max:s,disabled:c,thumbAlignment:u}),(M,L)=>(ce(),Oe(vt(m),null,{default:$e(()=>[(ce(),Oe(ex(vt(l)==="horizontal"?Gy:Xy),bi(M.$attrs,{ref:vt(p),"as-child":M.asChild,as:M.as,min:vt(r),max:vt(s),dir:vt(f),inverted:M.inverted,"aria-disabled":vt(c),"data-disabled":vt(c)?"":void 0,onPointerdown:L[0]||(L[0]=()=>{vt(c)||(y.value=S.value)}),onSlideStart:L[1]||(L[1]=V=>!vt(c)&&T(V)),onSlideMove:L[2]||(L[2]=V=>!vt(c)&&P(V)),onSlideEnd:L[3]||(L[3]=V=>!vt(c)&&R()),onHomeKeyDown:L[4]||(L[4]=V=>!vt(c)&&C(vt(r),0,{commit:!0})),onEndKeyDown:L[5]||(L[5]=V=>!vt(c)&&C(vt(s),S.value.length-1,{commit:!0})),onStepKeyDown:L[6]||(L[6]=(V,q)=>{if(!vt(c)){const W=vt(c0).includes(V.key)||V.shiftKey&&vt(u0).includes(V.key)?10:1,k=x.value,H=S.value[k],ct=vt(o)*W*q;C(H+ct,k,{commit:!0})}})}),{default:$e(()=>[wi(M.$slots,"default",{modelValue:vt(d)}),vt(_)&&M.name?(ce(),Oe(vt(Ly),{key:0,type:"number",value:vt(d),name:M.name,required:M.required,disabled:vt(c),step:vt(o)},null,8,["value","name","required","disabled","step"])):qr("v-if",!0)]),_:3},16,["as-child","as","min","max","dir","inverted","aria-disabled","data-disabled"]))]),_:3}))}}),Jy=Yy,$y=Ze({__name:"SliderImpl",props:{asChild:{type:Boolean,required:!1},as:{type:null,required:!1,default:"span"}},emits:["slideStart","slideMove","slideEnd","homeKeyDown","endKeyDown","stepKeyDown"],setup(e,{emit:t}){const n=e,i=t,r=$s();return(s,o)=>(ce(),Oe(vt(Js),bi({"data-slider-impl":""},n,{onKeydown:o[0]||(o[0]=a=>{a.key==="Home"?(i("homeKeyDown",a),a.preventDefault()):a.key==="End"?(i("endKeyDown",a),a.preventDefault()):vt(c0).concat(vt(u0)).includes(a.key)&&(i("stepKeyDown",a),a.preventDefault())}),onPointerdown:o[1]||(o[1]=a=>{const l=a.target;l.setPointerCapture(a.pointerId),a.preventDefault(),vt(r).thumbElements.value.includes(l)?l.focus():i("slideStart",a)}),onPointermove:o[2]||(o[2]=a=>{a.target.hasPointerCapture(a.pointerId)&&i("slideMove",a)}),onPointerup:o[3]||(o[3]=a=>{const l=a.target;l.hasPointerCapture(a.pointerId)&&(l.releasePointerCapture(a.pointerId),i("slideEnd",a))})}),{default:$e(()=>[wi(s.$slots,"default")]),_:3},16))}}),p0=$y,Zy=Ze({__name:"SliderRange",props:{asChild:{type:Boolean,required:!1},as:{type:null,required:!1,default:"span"}},setup(e){const t=$s(),n=f0();Qr();const i=pe(()=>t.currentModelValue.value.map(o=>l0(o,t.min.value,t.max.value))),r=pe(()=>t.currentModelValue.value.length>1?Math.min(...i.value):0),s=pe(()=>100-Math.max(...i.value,0));return(o,a)=>(ce(),Oe(vt(Js),{"data-disabled":vt(t).disabled.value?"":void 0,"data-orientation":vt(t).orientation.value,"as-child":o.asChild,as:o.as,style:qs({[vt(n).startEdge.value]:`${r.value}%`,[vt(n).endEdge.value]:`${s.value}%`})},{default:$e(()=>[wi(o.$slots,"default")]),_:3},8,["data-disabled","data-orientation","as-child","as","style"]))}}),Ky=Zy,Qy=Ze({inheritAttrs:!1,__name:"SliderThumbImpl",props:{index:{type:Number,required:!0},asChild:{type:Boolean,required:!1},as:{type:null,required:!1}},setup(e){const t=e,n=$s(),i=f0(),{forwardRef:r,currentElement:s}=Qr(),{CollectionItem:o}=Rh(),a=pe(()=>n.modelValue?.value?.[t.index]),l=pe(()=>a.value===void 0?0:l0(a.value,n.min.value??0,n.max.value??100)),c=pe(()=>Uy(t.index,n.modelValue?.value?.length??0)),u=Ay(s),h=pe(()=>u[i.size].value),f=pe(()=>n.thumbAlignment.value==="overflow"||!h.value?0:Fy(h.value,l.value,i.direction.value)),p=xy();return $o(()=>{n.thumbElements.value.push(s.value)}),wh(()=>{const g=n.thumbElements.value.findIndex(_=>_===s.value)??-1;n.thumbElements.value.splice(g,1)}),(g,_)=>(ce(),Oe(vt(o),null,{default:$e(()=>[Ge(vt(Js),bi(g.$attrs,{ref:vt(r),role:"slider",tabindex:vt(n).disabled.value?void 0:0,"aria-label":g.$attrs["aria-label"]||c.value,"data-disabled":vt(n).disabled.value?"":void 0,"data-orientation":vt(n).orientation.value,"aria-valuenow":a.value,"aria-valuemin":vt(n).min.value,"aria-valuemax":vt(n).max.value,"aria-orientation":vt(n).orientation.value,"as-child":g.asChild,as:g.as,style:{transform:"var(--reka-slider-thumb-transform)",position:"absolute",[vt(i).startEdge.value]:`calc(${l.value}% + ${f.value}px)`,display:!vt(p)&&a.value===void 0?"none":void 0},onFocus:_[0]||(_[0]=()=>{vt(n).valueIndexToChangeRef.value=g.index})}),{default:$e(()=>[wi(g.$slots,"default")]),_:3},16,["tabindex","aria-label","data-disabled","data-orientation","aria-valuenow","aria-valuemin","aria-valuemax","aria-orientation","as-child","as","style"])]),_:3}))}}),jy=Qy,tS=Ze({__name:"SliderThumb",props:{asChild:{type:Boolean,required:!1},as:{type:null,required:!1,default:"span"}},setup(e){const t=e,{getItems:n}=Rh(),{forwardRef:i,currentElement:r}=Qr(),s=pe(()=>r.value?n(!0).findIndex(o=>o.ref===r.value):-1);return(o,a)=>(ce(),Oe(jy,bi({ref:vt(i)},t,{index:s.value}),{default:$e(()=>[wi(o.$slots,"default")]),_:3},16,["index"]))}}),eS=tS,nS=Ze({__name:"SliderTrack",props:{asChild:{type:Boolean,required:!1},as:{type:null,required:!1,default:"span"}},setup(e){const t=$s();return Qr(),(n,i)=>(ce(),Oe(vt(Js),{"as-child":n.asChild,as:n.as,"data-disabled":vt(t).disabled.value?"":void 0,"data-orientation":vt(t).orientation.value},{default:$e(()=>[wi(n.$slots,"default")]),_:3},8,["as-child","as","data-disabled","data-orientation"]))}}),iS=nS;const rS=(e,t)=>{const n=new Array(e.length+t.length);for(let i=0;i({classGroupId:e,validator:t}),m0=(e=new Map,t=null,n)=>({nextPart:e,validators:t,classGroupId:n}),fl="-",wd=[],oS="arbitrary..",aS=e=>{const t=cS(e),{conflictingClassGroups:n,conflictingClassGroupModifiers:i}=e;return{getClassGroupId:o=>{if(o.startsWith("[")&&o.endsWith("]"))return lS(o);const a=o.split(fl),l=a[0]===""&&a.length>1?1:0;return g0(a,l,t)},getConflictingClassGroupIds:(o,a)=>{if(a){const l=i[o],c=n[o];return l?c?rS(c,l):l:c||wd}return n[o]||wd}}},g0=(e,t,n)=>{if(e.length-t===0)return n.classGroupId;const r=e[t],s=n.nextPart.get(r);if(s){const c=g0(e,t+1,s);if(c)return c}const o=n.validators;if(o===null)return;const a=t===0?e.join(fl):e.slice(t).join(fl),l=o.length;for(let c=0;ce.slice(1,-1).indexOf(":")===-1?void 0:(()=>{const t=e.slice(1,-1),n=t.indexOf(":"),i=t.slice(0,n);return i?oS+i:void 0})(),cS=e=>{const{theme:t,classGroups:n}=e;return uS(n,t)},uS=(e,t)=>{const n=m0();for(const i in e){const r=e[i];Ih(r,n,i,t)}return n},Ih=(e,t,n,i)=>{const r=e.length;for(let s=0;s{if(typeof e=="string"){fS(e,t,n);return}if(typeof e=="function"){dS(e,t,n,i);return}pS(e,t,n,i)},fS=(e,t,n)=>{const i=e===""?t:_0(t,e);i.classGroupId=n},dS=(e,t,n,i)=>{if(mS(e)){Ih(e(i),t,n,i);return}t.validators===null&&(t.validators=[]),t.validators.push(sS(n,e))},pS=(e,t,n,i)=>{const r=Object.entries(e),s=r.length;for(let o=0;o{let n=e;const i=t.split(fl),r=i.length;for(let s=0;s"isThemeGetter"in e&&e.isThemeGetter===!0,gS=e=>{if(e<1)return{get:()=>{},set:()=>{}};let t=0,n=Object.create(null),i=Object.create(null);const r=(s,o)=>{n[s]=o,t++,t>e&&(t=0,i=n,n=Object.create(null))};return{get(s){let o=n[s];if(o!==void 0)return o;if((o=i[s])!==void 0)return r(s,o),o},set(s,o){s in n?n[s]=o:r(s,o)}}},su="!",Ed=":",_S=[],Td=(e,t,n,i,r)=>({modifiers:e,hasImportantModifier:t,baseClassName:n,maybePostfixModifierPosition:i,isExternal:r}),vS=e=>{const{prefix:t,experimentalParseClassName:n}=e;let i=r=>{const s=[];let o=0,a=0,l=0,c;const u=r.length;for(let _=0;_l?c-l:void 0;return Td(s,p,f,g)};if(t){const r=t+Ed,s=i;i=o=>o.startsWith(r)?s(o.slice(r.length)):Td(_S,!1,o,void 0,!0)}if(n){const r=i;i=s=>n({className:s,parseClassName:r})}return i},xS=e=>{const t=new Map;return e.orderSensitiveModifiers.forEach((n,i)=>{t.set(n,1e6+i)}),n=>{const i=[];let r=[];for(let s=0;s0&&(r.sort(),i.push(...r),r=[]),i.push(o)):r.push(o)}return r.length>0&&(r.sort(),i.push(...r)),i}},yS=e=>({cache:gS(e.cacheSize),parseClassName:vS(e),sortModifiers:xS(e),...aS(e)}),SS=/\s+/,bS=(e,t)=>{const{parseClassName:n,getClassGroupId:i,getConflictingClassGroupIds:r,sortModifiers:s}=t,o=[],a=e.trim().split(SS);let l="";for(let c=a.length-1;c>=0;c-=1){const u=a[c],{isExternal:h,modifiers:f,hasImportantModifier:p,baseClassName:g,maybePostfixModifierPosition:_}=n(u);if(h){l=u+(l.length>0?" "+l:l);continue}let m=!!_,d=i(m?g.substring(0,_):g);if(!d){if(!m){l=u+(l.length>0?" "+l:l);continue}if(d=i(g),!d){l=u+(l.length>0?" "+l:l);continue}m=!1}const S=f.length===0?"":f.length===1?f[0]:s(f).join(":"),x=p?S+su:S,y=x+d;if(o.indexOf(y)>-1)continue;o.push(y);const T=r(d,m);for(let P=0;P0?" "+l:l)}return l},MS=(...e)=>{let t=0,n,i,r="";for(;t{if(typeof e=="string")return e;let t,n="";for(let i=0;i{let n,i,r,s;const o=l=>{const c=t.reduce((u,h)=>h(u),e());return n=yS(c),i=n.cache.get,r=n.cache.set,s=a,a(l)},a=l=>{const c=i(l);if(c)return c;const u=bS(l,n);return r(l,u),u};return s=o,(...l)=>s(MS(...l))},ES=[],qe=e=>{const t=n=>n[e]||ES;return t.isThemeGetter=!0,t},x0=/^\[(?:(\w[\w-]*):)?(.+)\]$/i,y0=/^\((?:(\w[\w-]*):)?(.+)\)$/i,TS=/^\d+\/\d+$/,AS=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,PS=/\d+(%|px|r?em|[sdl]?v([hwib]|min|max)|pt|pc|in|cm|mm|cap|ch|ex|r?lh|cq(w|h|i|b|min|max))|\b(calc|min|max|clamp)\(.+\)|^0$/,CS=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix)\(.+\)$/,RS=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,DS=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,rs=e=>TS.test(e),ae=e=>!!e&&!Number.isNaN(Number(e)),Ki=e=>!!e&&Number.isInteger(Number(e)),jl=e=>e.endsWith("%")&&ae(e.slice(0,-1)),Pi=e=>AS.test(e),IS=()=>!0,LS=e=>PS.test(e)&&!CS.test(e),S0=()=>!1,NS=e=>RS.test(e),US=e=>DS.test(e),OS=e=>!Ot(e)&&!Ft(e),FS=e=>Zs(e,w0,S0),Ot=e=>x0.test(e),Ar=e=>Zs(e,E0,LS),tc=e=>Zs(e,HS,ae),Ad=e=>Zs(e,b0,S0),kS=e=>Zs(e,M0,US),ca=e=>Zs(e,T0,NS),Ft=e=>y0.test(e),io=e=>Ks(e,E0),BS=e=>Ks(e,GS),Pd=e=>Ks(e,b0),zS=e=>Ks(e,w0),VS=e=>Ks(e,M0),ua=e=>Ks(e,T0,!0),Zs=(e,t,n)=>{const i=x0.exec(e);return i?i[1]?t(i[1]):n(i[2]):!1},Ks=(e,t,n=!1)=>{const i=y0.exec(e);return i?i[1]?t(i[1]):n:!1},b0=e=>e==="position"||e==="percentage",M0=e=>e==="image"||e==="url",w0=e=>e==="length"||e==="size"||e==="bg-size",E0=e=>e==="length",HS=e=>e==="number",GS=e=>e==="family-name",T0=e=>e==="shadow",WS=()=>{const e=qe("color"),t=qe("font"),n=qe("text"),i=qe("font-weight"),r=qe("tracking"),s=qe("leading"),o=qe("breakpoint"),a=qe("container"),l=qe("spacing"),c=qe("radius"),u=qe("shadow"),h=qe("inset-shadow"),f=qe("text-shadow"),p=qe("drop-shadow"),g=qe("blur"),_=qe("perspective"),m=qe("aspect"),d=qe("ease"),S=qe("animate"),x=()=>["auto","avoid","all","avoid-page","page","left","right","column"],y=()=>["center","top","bottom","left","right","top-left","left-top","top-right","right-top","bottom-right","right-bottom","bottom-left","left-bottom"],T=()=>[...y(),Ft,Ot],P=()=>["auto","hidden","clip","visible","scroll"],R=()=>["auto","contain","none"],C=()=>[Ft,Ot,l],b=()=>[rs,"full","auto",...C()],M=()=>[Ki,"none","subgrid",Ft,Ot],L=()=>["auto",{span:["full",Ki,Ft,Ot]},Ki,Ft,Ot],V=()=>[Ki,"auto",Ft,Ot],q=()=>["auto","min","max","fr",Ft,Ot],j=()=>["start","end","center","between","around","evenly","stretch","baseline","center-safe","end-safe"],J=()=>["start","end","center","stretch","center-safe","end-safe"],W=()=>["auto",...C()],k=()=>[rs,"auto","full","dvw","dvh","lvw","lvh","svw","svh","min","max","fit",...C()],H=()=>[e,Ft,Ot],ct=()=>[...y(),Pd,Ad,{position:[Ft,Ot]}],pt=()=>["no-repeat",{repeat:["","x","y","space","round"]}],ft=()=>["auto","cover","contain",zS,FS,{size:[Ft,Ot]}],kt=()=>[jl,io,Ar],Lt=()=>["","none","full",c,Ft,Ot],Zt=()=>["",ae,io,Ar],ue=()=>["solid","dashed","dotted","double"],st=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],ot=()=>[ae,jl,Pd,Ad],Pt=()=>["","none",g,Ft,Ot],Vt=()=>["none",ae,Ft,Ot],Mt=()=>["none",ae,Ft,Ot],oe=()=>[ae,Ft,Ot],I=()=>[rs,"full",...C()];return{cacheSize:500,theme:{animate:["spin","ping","pulse","bounce"],aspect:["video"],blur:[Pi],breakpoint:[Pi],color:[IS],container:[Pi],"drop-shadow":[Pi],ease:["in","out","in-out"],font:[OS],"font-weight":["thin","extralight","light","normal","medium","semibold","bold","extrabold","black"],"inset-shadow":[Pi],leading:["none","tight","snug","normal","relaxed","loose"],perspective:["dramatic","near","normal","midrange","distant","none"],radius:[Pi],shadow:[Pi],spacing:["px",ae],text:[Pi],"text-shadow":[Pi],tracking:["tighter","tight","normal","wide","wider","widest"]},classGroups:{aspect:[{aspect:["auto","square",rs,Ot,Ft,m]}],container:["container"],columns:[{columns:[ae,Ot,Ft,a]}],"break-after":[{"break-after":x()}],"break-before":[{"break-before":x()}],"break-inside":[{"break-inside":["auto","avoid","avoid-page","avoid-column"]}],"box-decoration":[{"box-decoration":["slice","clone"]}],box:[{box:["border","content"]}],display:["block","inline-block","inline","flex","inline-flex","table","inline-table","table-caption","table-cell","table-column","table-column-group","table-footer-group","table-header-group","table-row-group","table-row","flow-root","grid","inline-grid","contents","list-item","hidden"],sr:["sr-only","not-sr-only"],float:[{float:["right","left","none","start","end"]}],clear:[{clear:["left","right","both","none","start","end"]}],isolation:["isolate","isolation-auto"],"object-fit":[{object:["contain","cover","fill","none","scale-down"]}],"object-position":[{object:T()}],overflow:[{overflow:P()}],"overflow-x":[{"overflow-x":P()}],"overflow-y":[{"overflow-y":P()}],overscroll:[{overscroll:R()}],"overscroll-x":[{"overscroll-x":R()}],"overscroll-y":[{"overscroll-y":R()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:b()}],"inset-x":[{"inset-x":b()}],"inset-y":[{"inset-y":b()}],start:[{start:b()}],end:[{end:b()}],top:[{top:b()}],right:[{right:b()}],bottom:[{bottom:b()}],left:[{left:b()}],visibility:["visible","invisible","collapse"],z:[{z:[Ki,"auto",Ft,Ot]}],basis:[{basis:[rs,"full","auto",a,...C()]}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["nowrap","wrap","wrap-reverse"]}],flex:[{flex:[ae,rs,"auto","initial","none",Ot]}],grow:[{grow:["",ae,Ft,Ot]}],shrink:[{shrink:["",ae,Ft,Ot]}],order:[{order:[Ki,"first","last","none",Ft,Ot]}],"grid-cols":[{"grid-cols":M()}],"col-start-end":[{col:L()}],"col-start":[{"col-start":V()}],"col-end":[{"col-end":V()}],"grid-rows":[{"grid-rows":M()}],"row-start-end":[{row:L()}],"row-start":[{"row-start":V()}],"row-end":[{"row-end":V()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":q()}],"auto-rows":[{"auto-rows":q()}],gap:[{gap:C()}],"gap-x":[{"gap-x":C()}],"gap-y":[{"gap-y":C()}],"justify-content":[{justify:[...j(),"normal"]}],"justify-items":[{"justify-items":[...J(),"normal"]}],"justify-self":[{"justify-self":["auto",...J()]}],"align-content":[{content:["normal",...j()]}],"align-items":[{items:[...J(),{baseline:["","last"]}]}],"align-self":[{self:["auto",...J(),{baseline:["","last"]}]}],"place-content":[{"place-content":j()}],"place-items":[{"place-items":[...J(),"baseline"]}],"place-self":[{"place-self":["auto",...J()]}],p:[{p:C()}],px:[{px:C()}],py:[{py:C()}],ps:[{ps:C()}],pe:[{pe:C()}],pt:[{pt:C()}],pr:[{pr:C()}],pb:[{pb:C()}],pl:[{pl:C()}],m:[{m:W()}],mx:[{mx:W()}],my:[{my:W()}],ms:[{ms:W()}],me:[{me:W()}],mt:[{mt:W()}],mr:[{mr:W()}],mb:[{mb:W()}],ml:[{ml:W()}],"space-x":[{"space-x":C()}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":C()}],"space-y-reverse":["space-y-reverse"],size:[{size:k()}],w:[{w:[a,"screen",...k()]}],"min-w":[{"min-w":[a,"screen","none",...k()]}],"max-w":[{"max-w":[a,"screen","none","prose",{screen:[o]},...k()]}],h:[{h:["screen","lh",...k()]}],"min-h":[{"min-h":["screen","lh","none",...k()]}],"max-h":[{"max-h":["screen","lh",...k()]}],"font-size":[{text:["base",n,io,Ar]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:[i,Ft,tc]}],"font-stretch":[{"font-stretch":["ultra-condensed","extra-condensed","condensed","semi-condensed","normal","semi-expanded","expanded","extra-expanded","ultra-expanded",jl,Ot]}],"font-family":[{font:[BS,Ot,t]}],"fvn-normal":["normal-nums"],"fvn-ordinal":["ordinal"],"fvn-slashed-zero":["slashed-zero"],"fvn-figure":["lining-nums","oldstyle-nums"],"fvn-spacing":["proportional-nums","tabular-nums"],"fvn-fraction":["diagonal-fractions","stacked-fractions"],tracking:[{tracking:[r,Ft,Ot]}],"line-clamp":[{"line-clamp":[ae,"none",Ft,tc]}],leading:[{leading:[s,...C()]}],"list-image":[{"list-image":["none",Ft,Ot]}],"list-style-position":[{list:["inside","outside"]}],"list-style-type":[{list:["disc","decimal","none",Ft,Ot]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"placeholder-color":[{placeholder:H()}],"text-color":[{text:H()}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...ue(),"wavy"]}],"text-decoration-thickness":[{decoration:[ae,"from-font","auto",Ft,Ar]}],"text-decoration-color":[{decoration:H()}],"underline-offset":[{"underline-offset":[ae,"auto",Ft,Ot]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],"text-wrap":[{text:["wrap","nowrap","balance","pretty"]}],indent:[{indent:C()}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",Ft,Ot]}],whitespace:[{whitespace:["normal","nowrap","pre","pre-line","pre-wrap","break-spaces"]}],break:[{break:["normal","words","all","keep"]}],wrap:[{wrap:["break-word","anywhere","normal"]}],hyphens:[{hyphens:["none","manual","auto"]}],content:[{content:["none",Ft,Ot]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:ct()}],"bg-repeat":[{bg:pt()}],"bg-size":[{bg:ft()}],"bg-image":[{bg:["none",{linear:[{to:["t","tr","r","br","b","bl","l","tl"]},Ki,Ft,Ot],radial:["",Ft,Ot],conic:[Ki,Ft,Ot]},VS,kS]}],"bg-color":[{bg:H()}],"gradient-from-pos":[{from:kt()}],"gradient-via-pos":[{via:kt()}],"gradient-to-pos":[{to:kt()}],"gradient-from":[{from:H()}],"gradient-via":[{via:H()}],"gradient-to":[{to:H()}],rounded:[{rounded:Lt()}],"rounded-s":[{"rounded-s":Lt()}],"rounded-e":[{"rounded-e":Lt()}],"rounded-t":[{"rounded-t":Lt()}],"rounded-r":[{"rounded-r":Lt()}],"rounded-b":[{"rounded-b":Lt()}],"rounded-l":[{"rounded-l":Lt()}],"rounded-ss":[{"rounded-ss":Lt()}],"rounded-se":[{"rounded-se":Lt()}],"rounded-ee":[{"rounded-ee":Lt()}],"rounded-es":[{"rounded-es":Lt()}],"rounded-tl":[{"rounded-tl":Lt()}],"rounded-tr":[{"rounded-tr":Lt()}],"rounded-br":[{"rounded-br":Lt()}],"rounded-bl":[{"rounded-bl":Lt()}],"border-w":[{border:Zt()}],"border-w-x":[{"border-x":Zt()}],"border-w-y":[{"border-y":Zt()}],"border-w-s":[{"border-s":Zt()}],"border-w-e":[{"border-e":Zt()}],"border-w-t":[{"border-t":Zt()}],"border-w-r":[{"border-r":Zt()}],"border-w-b":[{"border-b":Zt()}],"border-w-l":[{"border-l":Zt()}],"divide-x":[{"divide-x":Zt()}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":Zt()}],"divide-y-reverse":["divide-y-reverse"],"border-style":[{border:[...ue(),"hidden","none"]}],"divide-style":[{divide:[...ue(),"hidden","none"]}],"border-color":[{border:H()}],"border-color-x":[{"border-x":H()}],"border-color-y":[{"border-y":H()}],"border-color-s":[{"border-s":H()}],"border-color-e":[{"border-e":H()}],"border-color-t":[{"border-t":H()}],"border-color-r":[{"border-r":H()}],"border-color-b":[{"border-b":H()}],"border-color-l":[{"border-l":H()}],"divide-color":[{divide:H()}],"outline-style":[{outline:[...ue(),"none","hidden"]}],"outline-offset":[{"outline-offset":[ae,Ft,Ot]}],"outline-w":[{outline:["",ae,io,Ar]}],"outline-color":[{outline:H()}],shadow:[{shadow:["","none",u,ua,ca]}],"shadow-color":[{shadow:H()}],"inset-shadow":[{"inset-shadow":["none",h,ua,ca]}],"inset-shadow-color":[{"inset-shadow":H()}],"ring-w":[{ring:Zt()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:H()}],"ring-offset-w":[{"ring-offset":[ae,Ar]}],"ring-offset-color":[{"ring-offset":H()}],"inset-ring-w":[{"inset-ring":Zt()}],"inset-ring-color":[{"inset-ring":H()}],"text-shadow":[{"text-shadow":["none",f,ua,ca]}],"text-shadow-color":[{"text-shadow":H()}],opacity:[{opacity:[ae,Ft,Ot]}],"mix-blend":[{"mix-blend":[...st(),"plus-darker","plus-lighter"]}],"bg-blend":[{"bg-blend":st()}],"mask-clip":[{"mask-clip":["border","padding","content","fill","stroke","view"]},"mask-no-clip"],"mask-composite":[{mask:["add","subtract","intersect","exclude"]}],"mask-image-linear-pos":[{"mask-linear":[ae]}],"mask-image-linear-from-pos":[{"mask-linear-from":ot()}],"mask-image-linear-to-pos":[{"mask-linear-to":ot()}],"mask-image-linear-from-color":[{"mask-linear-from":H()}],"mask-image-linear-to-color":[{"mask-linear-to":H()}],"mask-image-t-from-pos":[{"mask-t-from":ot()}],"mask-image-t-to-pos":[{"mask-t-to":ot()}],"mask-image-t-from-color":[{"mask-t-from":H()}],"mask-image-t-to-color":[{"mask-t-to":H()}],"mask-image-r-from-pos":[{"mask-r-from":ot()}],"mask-image-r-to-pos":[{"mask-r-to":ot()}],"mask-image-r-from-color":[{"mask-r-from":H()}],"mask-image-r-to-color":[{"mask-r-to":H()}],"mask-image-b-from-pos":[{"mask-b-from":ot()}],"mask-image-b-to-pos":[{"mask-b-to":ot()}],"mask-image-b-from-color":[{"mask-b-from":H()}],"mask-image-b-to-color":[{"mask-b-to":H()}],"mask-image-l-from-pos":[{"mask-l-from":ot()}],"mask-image-l-to-pos":[{"mask-l-to":ot()}],"mask-image-l-from-color":[{"mask-l-from":H()}],"mask-image-l-to-color":[{"mask-l-to":H()}],"mask-image-x-from-pos":[{"mask-x-from":ot()}],"mask-image-x-to-pos":[{"mask-x-to":ot()}],"mask-image-x-from-color":[{"mask-x-from":H()}],"mask-image-x-to-color":[{"mask-x-to":H()}],"mask-image-y-from-pos":[{"mask-y-from":ot()}],"mask-image-y-to-pos":[{"mask-y-to":ot()}],"mask-image-y-from-color":[{"mask-y-from":H()}],"mask-image-y-to-color":[{"mask-y-to":H()}],"mask-image-radial":[{"mask-radial":[Ft,Ot]}],"mask-image-radial-from-pos":[{"mask-radial-from":ot()}],"mask-image-radial-to-pos":[{"mask-radial-to":ot()}],"mask-image-radial-from-color":[{"mask-radial-from":H()}],"mask-image-radial-to-color":[{"mask-radial-to":H()}],"mask-image-radial-shape":[{"mask-radial":["circle","ellipse"]}],"mask-image-radial-size":[{"mask-radial":[{closest:["side","corner"],farthest:["side","corner"]}]}],"mask-image-radial-pos":[{"mask-radial-at":y()}],"mask-image-conic-pos":[{"mask-conic":[ae]}],"mask-image-conic-from-pos":[{"mask-conic-from":ot()}],"mask-image-conic-to-pos":[{"mask-conic-to":ot()}],"mask-image-conic-from-color":[{"mask-conic-from":H()}],"mask-image-conic-to-color":[{"mask-conic-to":H()}],"mask-mode":[{mask:["alpha","luminance","match"]}],"mask-origin":[{"mask-origin":["border","padding","content","fill","stroke","view"]}],"mask-position":[{mask:ct()}],"mask-repeat":[{mask:pt()}],"mask-size":[{mask:ft()}],"mask-type":[{"mask-type":["alpha","luminance"]}],"mask-image":[{mask:["none",Ft,Ot]}],filter:[{filter:["","none",Ft,Ot]}],blur:[{blur:Pt()}],brightness:[{brightness:[ae,Ft,Ot]}],contrast:[{contrast:[ae,Ft,Ot]}],"drop-shadow":[{"drop-shadow":["","none",p,ua,ca]}],"drop-shadow-color":[{"drop-shadow":H()}],grayscale:[{grayscale:["",ae,Ft,Ot]}],"hue-rotate":[{"hue-rotate":[ae,Ft,Ot]}],invert:[{invert:["",ae,Ft,Ot]}],saturate:[{saturate:[ae,Ft,Ot]}],sepia:[{sepia:["",ae,Ft,Ot]}],"backdrop-filter":[{"backdrop-filter":["","none",Ft,Ot]}],"backdrop-blur":[{"backdrop-blur":Pt()}],"backdrop-brightness":[{"backdrop-brightness":[ae,Ft,Ot]}],"backdrop-contrast":[{"backdrop-contrast":[ae,Ft,Ot]}],"backdrop-grayscale":[{"backdrop-grayscale":["",ae,Ft,Ot]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[ae,Ft,Ot]}],"backdrop-invert":[{"backdrop-invert":["",ae,Ft,Ot]}],"backdrop-opacity":[{"backdrop-opacity":[ae,Ft,Ot]}],"backdrop-saturate":[{"backdrop-saturate":[ae,Ft,Ot]}],"backdrop-sepia":[{"backdrop-sepia":["",ae,Ft,Ot]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":C()}],"border-spacing-x":[{"border-spacing-x":C()}],"border-spacing-y":[{"border-spacing-y":C()}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["","all","colors","opacity","shadow","transform","none",Ft,Ot]}],"transition-behavior":[{transition:["normal","discrete"]}],duration:[{duration:[ae,"initial",Ft,Ot]}],ease:[{ease:["linear","initial",d,Ft,Ot]}],delay:[{delay:[ae,Ft,Ot]}],animate:[{animate:["none",S,Ft,Ot]}],backface:[{backface:["hidden","visible"]}],perspective:[{perspective:[_,Ft,Ot]}],"perspective-origin":[{"perspective-origin":T()}],rotate:[{rotate:Vt()}],"rotate-x":[{"rotate-x":Vt()}],"rotate-y":[{"rotate-y":Vt()}],"rotate-z":[{"rotate-z":Vt()}],scale:[{scale:Mt()}],"scale-x":[{"scale-x":Mt()}],"scale-y":[{"scale-y":Mt()}],"scale-z":[{"scale-z":Mt()}],"scale-3d":["scale-3d"],skew:[{skew:oe()}],"skew-x":[{"skew-x":oe()}],"skew-y":[{"skew-y":oe()}],transform:[{transform:[Ft,Ot,"","none","gpu","cpu"]}],"transform-origin":[{origin:T()}],"transform-style":[{transform:["3d","flat"]}],translate:[{translate:I()}],"translate-x":[{"translate-x":I()}],"translate-y":[{"translate-y":I()}],"translate-z":[{"translate-z":I()}],"translate-none":["translate-none"],accent:[{accent:H()}],appearance:[{appearance:["none","auto"]}],"caret-color":[{caret:H()}],"color-scheme":[{scheme:["normal","dark","light","light-dark","only-dark","only-light"]}],cursor:[{cursor:["auto","default","pointer","wait","text","move","help","not-allowed","none","context-menu","progress","cell","crosshair","vertical-text","alias","copy","no-drop","grab","grabbing","all-scroll","col-resize","row-resize","n-resize","e-resize","s-resize","w-resize","ne-resize","nw-resize","se-resize","sw-resize","ew-resize","ns-resize","nesw-resize","nwse-resize","zoom-in","zoom-out",Ft,Ot]}],"field-sizing":[{"field-sizing":["fixed","content"]}],"pointer-events":[{"pointer-events":["auto","none"]}],resize:[{resize:["none","","y","x"]}],"scroll-behavior":[{scroll:["auto","smooth"]}],"scroll-m":[{"scroll-m":C()}],"scroll-mx":[{"scroll-mx":C()}],"scroll-my":[{"scroll-my":C()}],"scroll-ms":[{"scroll-ms":C()}],"scroll-me":[{"scroll-me":C()}],"scroll-mt":[{"scroll-mt":C()}],"scroll-mr":[{"scroll-mr":C()}],"scroll-mb":[{"scroll-mb":C()}],"scroll-ml":[{"scroll-ml":C()}],"scroll-p":[{"scroll-p":C()}],"scroll-px":[{"scroll-px":C()}],"scroll-py":[{"scroll-py":C()}],"scroll-ps":[{"scroll-ps":C()}],"scroll-pe":[{"scroll-pe":C()}],"scroll-pt":[{"scroll-pt":C()}],"scroll-pr":[{"scroll-pr":C()}],"scroll-pb":[{"scroll-pb":C()}],"scroll-pl":[{"scroll-pl":C()}],"snap-align":[{snap:["start","end","center","align-none"]}],"snap-stop":[{snap:["normal","always"]}],"snap-type":[{snap:["none","x","y","both"]}],"snap-strictness":[{snap:["mandatory","proximity"]}],touch:[{touch:["auto","none","manipulation"]}],"touch-x":[{"touch-pan":["x","left","right"]}],"touch-y":[{"touch-pan":["y","up","down"]}],"touch-pz":["touch-pinch-zoom"],select:[{select:["none","text","all","auto"]}],"will-change":[{"will-change":["auto","scroll","contents","transform",Ft,Ot]}],fill:[{fill:["none",...H()]}],"stroke-w":[{stroke:[ae,io,Ar,tc]}],stroke:[{stroke:["none",...H()]}],"forced-color-adjust":[{"forced-color-adjust":["auto","none"]}]},conflictingClassGroups:{overflow:["overflow-x","overflow-y"],overscroll:["overscroll-x","overscroll-y"],inset:["inset-x","inset-y","start","end","top","right","bottom","left"],"inset-x":["right","left"],"inset-y":["top","bottom"],flex:["basis","grow","shrink"],gap:["gap-x","gap-y"],p:["px","py","ps","pe","pt","pr","pb","pl"],px:["pr","pl"],py:["pt","pb"],m:["mx","my","ms","me","mt","mr","mb","ml"],mx:["mr","ml"],my:["mt","mb"],size:["w","h"],"font-size":["leading"],"fvn-normal":["fvn-ordinal","fvn-slashed-zero","fvn-figure","fvn-spacing","fvn-fraction"],"fvn-ordinal":["fvn-normal"],"fvn-slashed-zero":["fvn-normal"],"fvn-figure":["fvn-normal"],"fvn-spacing":["fvn-normal"],"fvn-fraction":["fvn-normal"],"line-clamp":["display","overflow"],rounded:["rounded-s","rounded-e","rounded-t","rounded-r","rounded-b","rounded-l","rounded-ss","rounded-se","rounded-ee","rounded-es","rounded-tl","rounded-tr","rounded-br","rounded-bl"],"rounded-s":["rounded-ss","rounded-es"],"rounded-e":["rounded-se","rounded-ee"],"rounded-t":["rounded-tl","rounded-tr"],"rounded-r":["rounded-tr","rounded-br"],"rounded-b":["rounded-br","rounded-bl"],"rounded-l":["rounded-tl","rounded-bl"],"border-spacing":["border-spacing-x","border-spacing-y"],"border-w":["border-w-x","border-w-y","border-w-s","border-w-e","border-w-t","border-w-r","border-w-b","border-w-l"],"border-w-x":["border-w-r","border-w-l"],"border-w-y":["border-w-t","border-w-b"],"border-color":["border-color-x","border-color-y","border-color-s","border-color-e","border-color-t","border-color-r","border-color-b","border-color-l"],"border-color-x":["border-color-r","border-color-l"],"border-color-y":["border-color-t","border-color-b"],translate:["translate-x","translate-y","translate-none"],"translate-none":["translate","translate-x","translate-y","translate-z"],"scroll-m":["scroll-mx","scroll-my","scroll-ms","scroll-me","scroll-mt","scroll-mr","scroll-mb","scroll-ml"],"scroll-mx":["scroll-mr","scroll-ml"],"scroll-my":["scroll-mt","scroll-mb"],"scroll-p":["scroll-px","scroll-py","scroll-ps","scroll-pe","scroll-pt","scroll-pr","scroll-pb","scroll-pl"],"scroll-px":["scroll-pr","scroll-pl"],"scroll-py":["scroll-pt","scroll-pb"],touch:["touch-x","touch-y","touch-pz"],"touch-x":["touch"],"touch-y":["touch"],"touch-pz":["touch"]},conflictingClassGroupModifiers:{"font-size":["leading"]},orderSensitiveModifiers:["*","**","after","backdrop","before","details-content","file","first-letter","first-line","marker","placeholder","selection"]}},XS=wS(WS);function A0(...e){return XS(s0(e))}const Ja=Ze({__name:"Button",props:{variant:{},size:{},class:{},asChild:{type:Boolean},as:{default:"button"}},setup(e){const t=e;return(n,i)=>(ce(),Oe(vt(Js),{"data-slot":"button",as:e.as,"as-child":e.asChild,class:Us(vt(A0)(vt(qS)({variant:e.variant,size:e.size}),t.class))},{default:$e(()=>[wi(n.$slots,"default")]),_:3},8,["as","as-child","class"]))}}),qS=dy("inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-md text-sm font-medium transition-all disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg:not([class*='size-'])]:size-4 shrink-0 [&_svg]:shrink-0 outline-none focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px] aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive",{variants:{variant:{default:"bg-primary text-primary-foreground hover:bg-primary/90",destructive:"bg-destructive text-white hover:bg-destructive/90 focus-visible:ring-destructive/20 dark:focus-visible:ring-destructive/40 dark:bg-destructive/60",outline:"border bg-background shadow-xs hover:bg-accent hover:text-accent-foreground dark:bg-input/30 dark:border-input dark:hover:bg-input/50",secondary:"bg-secondary text-secondary-foreground hover:bg-secondary/80",ghost:"hover:bg-accent hover:text-accent-foreground dark:hover:bg-accent/50",link:"text-primary underline-offset-4 hover:underline"},size:{default:"h-9 px-4 py-2 has-[>svg]:px-3",sm:"h-8 rounded-md gap-1.5 px-3 has-[>svg]:px-2.5",lg:"h-10 rounded-md px-6 has-[>svg]:px-4",icon:"size-9","icon-sm":"size-8","icon-lg":"size-10"}},defaultVariants:{variant:"default",size:"default"}}),YS=Ze({__name:"Slider",props:{defaultValue:{},modelValue:{},disabled:{type:Boolean},orientation:{},dir:{},inverted:{type:Boolean},min:{},max:{},step:{},minStepsBetweenThumbs:{},thumbAlignment:{},asChild:{type:Boolean},as:{},name:{},required:{type:Boolean},class:{}},emits:["update:modelValue","valueCommit"],setup(e,{emit:t}){const n=e,i=t,r=vy(n,"class"),s=Ty(r,i);return(o,a)=>(ce(),Oe(vt(Jy),bi({"data-slot":"slider",class:vt(A0)("relative flex w-full touch-none items-center select-none data-[disabled]:opacity-50 data-[orientation=vertical]:h-full data-[orientation=vertical]:min-h-44 data-[orientation=vertical]:w-auto data-[orientation=vertical]:flex-col",n.class)},vt(s)),{default:$e(({modelValue:l})=>[Ge(vt(iS),{"data-slot":"slider-track",class:"bg-muted relative grow overflow-hidden rounded-full data-[orientation=horizontal]:h-1.5 data-[orientation=horizontal]:w-full data-[orientation=vertical]:h-full data-[orientation=vertical]:w-1.5"},{default:$e(()=>[Ge(vt(Ky),{"data-slot":"slider-range",class:"bg-primary absolute data-[orientation=horizontal]:h-full data-[orientation=vertical]:w-full"})]),_:1}),(ce(!0),Fn(Je,null,Dl(l,(c,u)=>(ce(),Oe(vt(eS),{key:u,"data-slot":"slider-thumb",class:"bg-white border-primary ring-ring/50 block size-4 shrink-0 rounded-full border shadow-sm transition-[color,box-shadow] hover:ring-4 focus-visible:ring-4 focus-visible:outline-hidden disabled:pointer-events-none disabled:opacity-50"}))),128))]),_:1},16,["class"]))}});function JS(){let e=0,t=0;for(let i=0;i<28;i+=7){let r=this.buf[this.pos++];if(e|=(r&127)<>4,(n&128)==0)return this.assertBounds(),[e,t];for(let i=3;i<=31;i+=7){let r=this.buf[this.pos++];if(t|=(r&127)<>>s,a=!(!(o>>>7)&&t==0),l=(a?o|128:o)&255;if(n.push(l),!a)return}const i=e>>>28&15|(t&7)<<4,r=t>>3!=0;if(n.push((r?i|128:i)&255),!!r){for(let s=3;s<31;s=s+7){const o=t>>>s,a=!!(o>>>7),l=(a?o|128:o)&255;if(n.push(l),!a)return}n.push(t>>>31&1)}}const $a=4294967296;function Cd(e){const t=e[0]==="-";t&&(e=e.slice(1));const n=1e6;let i=0,r=0;function s(o,a){const l=Number(e.slice(o,a));r*=n,i=i*n+l,i>=$a&&(r=r+(i/$a|0),i=i%$a)}return s(-24,-18),s(-18,-12),s(-12,-6),s(-6),t?C0(i,r):Lh(i,r)}function $S(e,t){let n=Lh(e,t);const i=n.hi&2147483648;i&&(n=C0(n.lo,n.hi));const r=P0(n.lo,n.hi);return i?"-"+r:r}function P0(e,t){if({lo:e,hi:t}=ZS(e,t),t<=2097151)return String($a*t+e);const n=e&16777215,i=(e>>>24|t<<8)&16777215,r=t>>16&65535;let s=n+i*6777216+r*6710656,o=i+r*8147497,a=r*2;const l=1e7;return s>=l&&(o+=Math.floor(s/l),s%=l),o>=l&&(a+=Math.floor(o/l),o%=l),a.toString()+Rd(o)+Rd(s)}function ZS(e,t){return{lo:e>>>0,hi:t>>>0}}function Lh(e,t){return{lo:e|0,hi:t|0}}function C0(e,t){return t=~t,e?e=~e+1:t+=1,Lh(e,t)}const Rd=e=>{const t=String(e);return"0000000".slice(t.length)+t};function Dd(e,t){if(e>=0){for(;e>127;)t.push(e&127|128),e=e>>>7;t.push(e)}else{for(let n=0;n<9;n++)t.push(e&127|128),e=e>>7;t.push(1)}}function KS(){let e=this.buf[this.pos++],t=e&127;if((e&128)==0)return this.assertBounds(),t;if(e=this.buf[this.pos++],t|=(e&127)<<7,(e&128)==0)return this.assertBounds(),t;if(e=this.buf[this.pos++],t|=(e&127)<<14,(e&128)==0)return this.assertBounds(),t;if(e=this.buf[this.pos++],t|=(e&127)<<21,(e&128)==0)return this.assertBounds(),t;e=this.buf[this.pos++],t|=(e&15)<<28;for(let n=5;(e&128)!==0&&n<10;n++)e=this.buf[this.pos++];if((e&128)!=0)throw new Error("invalid varint");return this.assertBounds(),t>>>0}var Id={};const pi=QS();function QS(){const e=new DataView(new ArrayBuffer(8));if(typeof BigInt=="function"&&typeof e.getBigInt64=="function"&&typeof e.getBigUint64=="function"&&typeof e.setBigInt64=="function"&&typeof e.setBigUint64=="function"&&(!!globalThis.Deno||typeof process!="object"||typeof Id!="object"||Id.BUF_BIGINT_DISABLE!=="1")){const n=BigInt("-9223372036854775808"),i=BigInt("9223372036854775807"),r=BigInt("0"),s=BigInt("18446744073709551615");return{zero:BigInt(0),supported:!0,parse(o){const a=typeof o=="bigint"?o:BigInt(o);if(a>i||as||a>>0)}raw(t){return this.buf.length&&(this.chunks.push(new Uint8Array(this.buf)),this.buf=[]),this.chunks.push(t),this}uint32(t){for(Ud(t);t>127;)this.buf.push(t&127|128),t=t>>>7;return this.buf.push(t),this}int32(t){return ic(t),Dd(t,this.buf),this}bool(t){return this.buf.push(t?1:0),this}bytes(t){return this.uint32(t.byteLength),this.raw(t)}string(t){let n=this.encodeUtf8(t);return this.uint32(n.byteLength),this.raw(n)}float(t){rb(t);let n=new Uint8Array(4);return new DataView(n.buffer).setFloat32(0,t,!0),this.raw(n)}double(t){let n=new Uint8Array(8);return new DataView(n.buffer).setFloat64(0,t,!0),this.raw(n)}fixed32(t){Ud(t);let n=new Uint8Array(4);return new DataView(n.buffer).setUint32(0,t,!0),this.raw(n)}sfixed32(t){ic(t);let n=new Uint8Array(4);return new DataView(n.buffer).setInt32(0,t,!0),this.raw(n)}sint32(t){return ic(t),t=(t<<1^t>>31)>>>0,Dd(t,this.buf),this}sfixed64(t){let n=new Uint8Array(8),i=new DataView(n.buffer),r=pi.enc(t);return i.setInt32(0,r.lo,!0),i.setInt32(4,r.hi,!0),this.raw(n)}fixed64(t){let n=new Uint8Array(8),i=new DataView(n.buffer),r=pi.uEnc(t);return i.setInt32(0,r.lo,!0),i.setInt32(4,r.hi,!0),this.raw(n)}int64(t){let n=pi.enc(t);return ec(n.lo,n.hi,this.buf),this}sint64(t){const n=pi.enc(t),i=n.hi>>31,r=n.lo<<1^i,s=(n.hi<<1|n.lo>>>31)^i;return ec(r,s,this.buf),this}uint64(t){const n=pi.uEnc(t);return ec(n.lo,n.hi,this.buf),this}}class xt{constructor(t,n=R0().decodeUtf8){this.decodeUtf8=n,this.varint64=JS,this.uint32=KS,this.buf=t,this.len=t.length,this.pos=0,this.view=new DataView(t.buffer,t.byteOffset,t.byteLength)}tag(){let t=this.uint32(),n=t>>>3,i=t&7;if(n<=0||i<0||i>5)throw new Error("illegal tag: field no "+n+" wire type "+i);return[n,i]}skip(t,n){let i=this.pos;switch(t){case ar.Varint:for(;this.buf[this.pos++]&128;);break;case ar.Bit64:this.pos+=4;case ar.Bit32:this.pos+=4;break;case ar.LengthDelimited:let r=this.uint32();this.pos+=r;break;case ar.StartGroup:for(;;){const[s,o]=this.tag();if(o===ar.EndGroup){if(n!==void 0&&s!==n)throw new Error("invalid end group tag");break}this.skip(o,s)}break;default:throw new Error("cant skip wire type "+t)}return this.assertBounds(),this.buf.subarray(i,this.pos)}assertBounds(){if(this.pos>this.len)throw new RangeError("premature EOF")}int32(){return this.uint32()|0}sint32(){let t=this.uint32();return t>>>1^-(t&1)}int64(){return pi.dec(...this.varint64())}uint64(){return pi.uDec(...this.varint64())}sint64(){let[t,n]=this.varint64(),i=-(t&1);return t=(t>>>1|(n&1)<<31)^i,n=n>>>1^i,pi.dec(t,n)}bool(){let[t,n]=this.varint64();return t!==0||n!==0}fixed32(){return this.view.getUint32((this.pos+=4)-4,!0)}sfixed32(){return this.view.getInt32((this.pos+=4)-4,!0)}fixed64(){return pi.uDec(this.sfixed32(),this.sfixed32())}sfixed64(){return pi.dec(this.sfixed32(),this.sfixed32())}float(){return this.view.getFloat32((this.pos+=4)-4,!0)}double(){return this.view.getFloat64((this.pos+=8)-8,!0)}bytes(){let t=this.uint32(),n=this.pos;return this.pos+=t,this.assertBounds(),this.buf.subarray(n,n+t)}string(){return this.decodeUtf8(this.bytes())}}function ic(e){if(typeof e=="string")e=Number(e);else if(typeof e!="number")throw new Error("invalid int32: "+typeof e);if(!Number.isInteger(e)||e>nb||eeb||e<0)throw new Error("invalid uint32: "+e)}function rb(e){if(typeof e=="string"){const t=e;if(e=Number(e),Number.isNaN(e)&&t!=="NaN")throw new Error("invalid float32: "+t)}else if(typeof e!="number")throw new Error("invalid float32: "+typeof e);if(Number.isFinite(e)&&(e>jS||e>>3){case 1:{if(s!==10)break;r.typeUrl=n.string();continue}case 2:{if(s!==18)break;r.value=n.bytes();continue}}if((s&7)===4||s===0)break;n.skip(s&7)}return r},fromJSON(e){return{typeUrl:rc(e.typeUrl)?globalThis.String(e.typeUrl):rc(e.type_url)?globalThis.String(e.type_url):"",value:rc(e.value)?sb(e.value):new Uint8Array(0)}},toJSON(e){const t={};return e.typeUrl!==""&&(t.typeUrl=e.typeUrl),e.value.length!==0&&(t.value=ob(e.value)),t},create(e){return ys.fromPartial(e??{})},fromPartial(e){const t=Od();return t.typeUrl=e.typeUrl??"",t.value=e.value??new Uint8Array(0),t}};function sb(e){if(globalThis.Buffer)return Uint8Array.from(globalThis.Buffer.from(e,"base64"));{const t=globalThis.atob(e),n=new Uint8Array(t.length);for(let i=0;i{t.push(globalThis.String.fromCharCode(n))}),globalThis.btoa(t.join(""))}}function rc(e){return e!=null}function Fd(e){switch(e){case 0:case"NULL_VALUE":return 0;default:return-1}}function ab(e){return e===0?"NULL_VALUE":"UNRECOGNIZED"}function sc(){return{fields:{}}}const mo={encode(e,t=new ne){return globalThis.Object.entries(e.fields).forEach(([n,i])=>{i!==void 0&&ou.encode({key:n,value:i},t.uint32(10).fork()).join()}),t},decode(e,t){const n=e instanceof xt?e:new xt(e),i=t===void 0?n.len:n.pos+t,r=sc();for(;n.pos>>3){case 1:{if(s!==10)break;const o=ou.decode(n,n.uint32());o.value!==void 0&&(r.fields[o.key]=o.value);continue}}if((s&7)===4||s===0)break;n.skip(s&7)}return r},fromJSON(e){return{fields:au(e.fields)?globalThis.Object.entries(e.fields).reduce((t,[n,i])=>(t[n]=i,t),{}):{}}},toJSON(e){const t={};if(e.fields){const n=globalThis.Object.entries(e.fields);n.length>0&&(t.fields={},n.forEach(([i,r])=>{t.fields[i]=r}))}return t},create(e){return mo.fromPartial(e??{})},fromPartial(e){const t=sc();return t.fields=globalThis.Object.entries(e.fields??{}).reduce((n,[i,r])=>(r!==void 0&&(n[i]=r),n),{}),t},wrap(e){const t=sc();if(e!==void 0)for(const n of globalThis.Object.keys(e))t.fields[n]=e[n];return t},unwrap(e){const t={};if(e.fields)for(const n of globalThis.Object.keys(e.fields))t[n]=e.fields[n];return t}};function kd(){return{key:"",value:void 0}}const ou={encode(e,t=new ne){return e.key!==""&&t.uint32(10).string(e.key),e.value!==void 0&&zn.encode(zn.wrap(e.value),t.uint32(18).fork()).join(),t},decode(e,t){const n=e instanceof xt?e:new xt(e),i=t===void 0?n.len:n.pos+t,r=kd();for(;n.pos>>3){case 1:{if(s!==10)break;r.key=n.string();continue}case 2:{if(s!==18)break;r.value=zn.unwrap(zn.decode(n,n.uint32()));continue}}if((s&7)===4||s===0)break;n.skip(s&7)}return r},fromJSON(e){return{key:hi(e.key)?globalThis.String(e.key):"",value:hi(e?.value)?e.value:void 0}},toJSON(e){const t={};return e.key!==""&&(t.key=e.key),e.value!==void 0&&(t.value=e.value),t},create(e){return ou.fromPartial(e??{})},fromPartial(e){const t=kd();return t.key=e.key??"",t.value=e.value??void 0,t}};function oc(){return{nullValue:void 0,numberValue:void 0,stringValue:void 0,boolValue:void 0,structValue:void 0,listValue:void 0}}const zn={encode(e,t=new ne){return e.nullValue!==void 0&&t.uint32(8).int32(e.nullValue),e.numberValue!==void 0&&t.uint32(17).double(e.numberValue),e.stringValue!==void 0&&t.uint32(26).string(e.stringValue),e.boolValue!==void 0&&t.uint32(32).bool(e.boolValue),e.structValue!==void 0&&mo.encode(mo.wrap(e.structValue),t.uint32(42).fork()).join(),e.listValue!==void 0&&go.encode(go.wrap(e.listValue),t.uint32(50).fork()).join(),t},decode(e,t){const n=e instanceof xt?e:new xt(e),i=t===void 0?n.len:n.pos+t,r=oc();for(;n.pos>>3){case 1:{if(s!==8)break;r.nullValue=n.int32();continue}case 2:{if(s!==17)break;r.numberValue=n.double();continue}case 3:{if(s!==26)break;r.stringValue=n.string();continue}case 4:{if(s!==32)break;r.boolValue=n.bool();continue}case 5:{if(s!==42)break;r.structValue=mo.unwrap(mo.decode(n,n.uint32()));continue}case 6:{if(s!==50)break;r.listValue=go.unwrap(go.decode(n,n.uint32()));continue}}if((s&7)===4||s===0)break;n.skip(s&7)}return r},fromJSON(e){return{nullValue:hi(e.nullValue)?Fd(e.nullValue):hi(e.null_value)?Fd(e.null_value):void 0,numberValue:hi(e.numberValue)?globalThis.Number(e.numberValue):hi(e.number_value)?globalThis.Number(e.number_value):void 0,stringValue:hi(e.stringValue)?globalThis.String(e.stringValue):hi(e.string_value)?globalThis.String(e.string_value):void 0,boolValue:hi(e.boolValue)?globalThis.Boolean(e.boolValue):hi(e.bool_value)?globalThis.Boolean(e.bool_value):void 0,structValue:au(e.structValue)?e.structValue:au(e.struct_value)?e.struct_value:void 0,listValue:globalThis.Array.isArray(e.listValue)?[...e.listValue]:globalThis.Array.isArray(e.list_value)?[...e.list_value]:void 0}},toJSON(e){const t={};return e.nullValue!==void 0&&(t.nullValue=ab(e.nullValue)),e.numberValue!==void 0&&(t.numberValue=e.numberValue),e.stringValue!==void 0&&(t.stringValue=e.stringValue),e.boolValue!==void 0&&(t.boolValue=e.boolValue),e.structValue!==void 0&&(t.structValue=e.structValue),e.listValue!==void 0&&(t.listValue=e.listValue),t},create(e){return zn.fromPartial(e??{})},fromPartial(e){const t=oc();return t.nullValue=e.nullValue??void 0,t.numberValue=e.numberValue??void 0,t.stringValue=e.stringValue??void 0,t.boolValue=e.boolValue??void 0,t.structValue=e.structValue??void 0,t.listValue=e.listValue??void 0,t},wrap(e){const t=oc();if(e===null)t.nullValue=0;else if(typeof e=="boolean")t.boolValue=e;else if(typeof e=="number")t.numberValue=e;else if(typeof e=="string")t.stringValue=e;else if(globalThis.Array.isArray(e))t.listValue=e;else if(typeof e=="object")t.structValue=e;else if(typeof e<"u")throw new globalThis.Error("Unsupported any value type: "+typeof e);return t},unwrap(e){if(e.stringValue!==void 0)return e.stringValue;if(e?.numberValue!==void 0)return e.numberValue;if(e?.boolValue!==void 0)return e.boolValue;if(e?.structValue!==void 0)return e.structValue;if(e?.listValue!==void 0)return e.listValue;if(e?.nullValue!==void 0)return null}};function ac(){return{values:[]}}const go={encode(e,t=new ne){for(const n of e.values)zn.encode(zn.wrap(n),t.uint32(10).fork()).join();return t},decode(e,t){const n=e instanceof xt?e:new xt(e),i=t===void 0?n.len:n.pos+t,r=ac();for(;n.pos>>3){case 1:{if(s!==10)break;r.values.push(zn.unwrap(zn.decode(n,n.uint32())));continue}}if((s&7)===4||s===0)break;n.skip(s&7)}return r},fromJSON(e){return{values:globalThis.Array.isArray(e?.values)?[...e.values]:[]}},toJSON(e){const t={};return e.values?.length&&(t.values=e.values),t},create(e){return go.fromPartial(e??{})},fromPartial(e){const t=ac();return t.values=e.values?.map(n=>n)||[],t},wrap(e){const t=ac();return t.values=e??[],t},unwrap(e){return e?.hasOwnProperty("values")&&globalThis.Array.isArray(e.values)?e.values:e}};function au(e){return typeof e=="object"&&e!==null}function hi(e){return e!=null}function Bd(){return{message:void 0,value:void 0,fallback:void 0}}const Cn={encode(e,t=new ne){return e.message!==void 0&&ys.encode(e.message,t.uint32(10).fork()).join(),e.value!==void 0&&zn.encode(zn.wrap(e.value),t.uint32(18).fork()).join(),e.fallback!==void 0&&Ss.encode(e.fallback,t.uint32(26).fork()).join(),t},decode(e,t){const n=e instanceof xt?e:new xt(e),i=t===void 0?n.len:n.pos+t,r=Bd();for(;n.pos>>3){case 1:{if(s!==10)break;r.message=ys.decode(n,n.uint32());continue}case 2:{if(s!==18)break;r.value=zn.unwrap(zn.decode(n,n.uint32()));continue}case 3:{if(s!==26)break;r.fallback=Ss.decode(n,n.uint32());continue}}if((s&7)===4||s===0)break;n.skip(s&7)}return r},fromJSON(e){return{message:vr(e.message)?ys.fromJSON(e.message):void 0,value:vr(e?.value)?e.value:void 0,fallback:vr(e.fallback)?Ss.fromJSON(e.fallback):void 0}},toJSON(e){const t={};return e.message!==void 0&&(t.message=ys.toJSON(e.message)),e.value!==void 0&&(t.value=e.value),e.fallback!==void 0&&(t.fallback=Ss.toJSON(e.fallback)),t},create(e){return Cn.fromPartial(e??{})},fromPartial(e){const t=Bd();return t.message=e.message!==void 0&&e.message!==null?ys.fromPartial(e.message):void 0,t.value=e.value??void 0,t.fallback=e.fallback!==void 0&&e.fallback!==null?Ss.fromPartial(e.fallback):void 0,t}};function zd(){return{data:void 0}}const Ss={encode(e,t=new ne){return e.data!==void 0&&cr.encode(e.data,t.uint32(10).fork()).join(),t},decode(e,t){const n=e instanceof xt?e:new xt(e),i=t===void 0?n.len:n.pos+t,r=zd();for(;n.pos>>3){case 1:{if(s!==10)break;r.data=cr.decode(n,n.uint32());continue}}if((s&7)===4||s===0)break;n.skip(s&7)}return r},fromJSON(e){return{data:vr(e.data)?cr.fromJSON(e.data):void 0}},toJSON(e){const t={};return e.data!==void 0&&(t.data=cr.toJSON(e.data)),t},create(e){return Ss.fromPartial(e??{})},fromPartial(e){const t=zd();return t.data=e.data!==void 0&&e.data!==null?cr.fromPartial(e.data):void 0,t}};function Vd(){return{items:{}}}const cr={encode(e,t=new ne){return globalThis.Object.entries(e.items).forEach(([n,i])=>{lu.encode({key:n,value:i},t.uint32(10).fork()).join()}),t},decode(e,t){const n=e instanceof xt?e:new xt(e),i=t===void 0?n.len:n.pos+t,r=Vd();for(;n.pos>>3){case 1:{if(s!==10)break;const o=lu.decode(n,n.uint32());o.value!==void 0&&(r.items[o.key]=o.value);continue}}if((s&7)===4||s===0)break;n.skip(s&7)}return r},fromJSON(e){return{items:lb(e.items)?globalThis.Object.entries(e.items).reduce((t,[n,i])=>(t[n]=Cn.fromJSON(i),t),{}):{}}},toJSON(e){const t={};if(e.items){const n=globalThis.Object.entries(e.items);n.length>0&&(t.items={},n.forEach(([i,r])=>{t.items[i]=Cn.toJSON(r)}))}return t},create(e){return cr.fromPartial(e??{})},fromPartial(e){const t=Vd();return t.items=globalThis.Object.entries(e.items??{}).reduce((n,[i,r])=>(r!==void 0&&(n[i]=Cn.fromPartial(r)),n),{}),t}};function Hd(){return{key:"",value:void 0}}const lu={encode(e,t=new ne){return e.key!==""&&t.uint32(10).string(e.key),e.value!==void 0&&Cn.encode(e.value,t.uint32(18).fork()).join(),t},decode(e,t){const n=e instanceof xt?e:new xt(e),i=t===void 0?n.len:n.pos+t,r=Hd();for(;n.pos>>3){case 1:{if(s!==10)break;r.key=n.string();continue}case 2:{if(s!==18)break;r.value=Cn.decode(n,n.uint32());continue}}if((s&7)===4||s===0)break;n.skip(s&7)}return r},fromJSON(e){return{key:vr(e.key)?globalThis.String(e.key):"",value:vr(e.value)?Cn.fromJSON(e.value):void 0}},toJSON(e){const t={};return e.key!==""&&(t.key=e.key),e.value!==void 0&&(t.value=Cn.toJSON(e.value)),t},create(e){return lu.fromPartial(e??{})},fromPartial(e){const t=Hd();return t.key=e.key??"",t.value=e.value!==void 0&&e.value!==null?Cn.fromPartial(e.value):void 0,t}};function Gd(){return{data:void 0,version:void 0}}const D0={encode(e,t=new ne){return e.data!==void 0&&Cn.encode(e.data,t.uint32(10).fork()).join(),e.version!==void 0&&t.uint32(18).string(e.version),t},decode(e,t){const n=e instanceof xt?e:new xt(e),i=t===void 0?n.len:n.pos+t,r=Gd();for(;n.pos>>3){case 1:{if(s!==10)break;r.data=Cn.decode(n,n.uint32());continue}case 2:{if(s!==18)break;r.version=n.string();continue}}if((s&7)===4||s===0)break;n.skip(s&7)}return r},fromJSON(e){return{data:vr(e.data)?Cn.fromJSON(e.data):void 0,version:vr(e.version)?globalThis.String(e.version):void 0}},toJSON(e){const t={};return e.data!==void 0&&(t.data=Cn.toJSON(e.data)),e.version!==void 0&&(t.version=e.version),t},create(e){return D0.fromPartial(e??{})},fromPartial(e){const t=Gd();return t.data=e.data!==void 0&&e.data!==null?Cn.fromPartial(e.data):void 0,t.version=e.version??void 0,t}};function lb(e){return typeof e=="object"&&e!==null}function vr(e){return e!=null}function Wd(){return{guid:"",name:"",x:0,y:0,z:0}}const Ht={encode(e,t=new ne){return e.guid!==""&&t.uint32(10).string(e.guid),e.name!==""&&t.uint32(18).string(e.name),e.x!==0&&t.uint32(29).float(e.x),e.y!==0&&t.uint32(37).float(e.y),e.z!==0&&t.uint32(45).float(e.z),t},decode(e,t){const n=e instanceof xt?e:new xt(e),i=t===void 0?n.len:n.pos+t,r=Wd();for(;n.pos>>3){case 1:{if(s!==10)break;r.guid=n.string();continue}case 2:{if(s!==18)break;r.name=n.string();continue}case 3:{if(s!==29)break;r.x=n.float();continue}case 4:{if(s!==37)break;r.y=n.float();continue}case 5:{if(s!==45)break;r.z=n.float();continue}}if((s&7)===4||s===0)break;n.skip(s&7)}return r},fromJSON(e){return{guid:at(e.guid)?globalThis.String(e.guid):"",name:at(e.name)?globalThis.String(e.name):"",x:at(e.x)?globalThis.Number(e.x):0,y:at(e.y)?globalThis.Number(e.y):0,z:at(e.z)?globalThis.Number(e.z):0}},toJSON(e){const t={};return e.guid!==""&&(t.guid=e.guid),e.name!==""&&(t.name=e.name),e.x!==0&&(t.x=e.x),e.y!==0&&(t.y=e.y),e.z!==0&&(t.z=e.z),t},create(e){return Ht.fromPartial(e??{})},fromPartial(e){const t=Wd();return t.guid=e.guid??"",t.name=e.name??"",t.x=e.x??0,t.y=e.y??0,t.z=e.z??0,t}};function Xd(){return{guid:"",name:"",x:0,y:0,z:0}}const Me={encode(e,t=new ne){return e.guid!==""&&t.uint32(10).string(e.guid),e.name!==""&&t.uint32(18).string(e.name),e.x!==0&&t.uint32(29).float(e.x),e.y!==0&&t.uint32(37).float(e.y),e.z!==0&&t.uint32(45).float(e.z),t},decode(e,t){const n=e instanceof xt?e:new xt(e),i=t===void 0?n.len:n.pos+t,r=Xd();for(;n.pos>>3){case 1:{if(s!==10)break;r.guid=n.string();continue}case 2:{if(s!==18)break;r.name=n.string();continue}case 3:{if(s!==29)break;r.x=n.float();continue}case 4:{if(s!==37)break;r.y=n.float();continue}case 5:{if(s!==45)break;r.z=n.float();continue}}if((s&7)===4||s===0)break;n.skip(s&7)}return r},fromJSON(e){return{guid:at(e.guid)?globalThis.String(e.guid):"",name:at(e.name)?globalThis.String(e.name):"",x:at(e.x)?globalThis.Number(e.x):0,y:at(e.y)?globalThis.Number(e.y):0,z:at(e.z)?globalThis.Number(e.z):0}},toJSON(e){const t={};return e.guid!==""&&(t.guid=e.guid),e.name!==""&&(t.name=e.name),e.x!==0&&(t.x=e.x),e.y!==0&&(t.y=e.y),e.z!==0&&(t.z=e.z),t},create(e){return Me.fromPartial(e??{})},fromPartial(e){const t=Xd();return t.guid=e.guid??"",t.name=e.name??"",t.x=e.x??0,t.y=e.y??0,t.z=e.z??0,t}};function qd(){return{guid:"",name:"",point:void 0,xaxis:void 0,yaxis:void 0}}const Wt={encode(e,t=new ne){return e.guid!==""&&t.uint32(10).string(e.guid),e.name!==""&&t.uint32(18).string(e.name),e.point!==void 0&&Ht.encode(e.point,t.uint32(26).fork()).join(),e.xaxis!==void 0&&Me.encode(e.xaxis,t.uint32(34).fork()).join(),e.yaxis!==void 0&&Me.encode(e.yaxis,t.uint32(42).fork()).join(),t},decode(e,t){const n=e instanceof xt?e:new xt(e),i=t===void 0?n.len:n.pos+t,r=qd();for(;n.pos>>3){case 1:{if(s!==10)break;r.guid=n.string();continue}case 2:{if(s!==18)break;r.name=n.string();continue}case 3:{if(s!==26)break;r.point=Ht.decode(n,n.uint32());continue}case 4:{if(s!==34)break;r.xaxis=Me.decode(n,n.uint32());continue}case 5:{if(s!==42)break;r.yaxis=Me.decode(n,n.uint32());continue}}if((s&7)===4||s===0)break;n.skip(s&7)}return r},fromJSON(e){return{guid:at(e.guid)?globalThis.String(e.guid):"",name:at(e.name)?globalThis.String(e.name):"",point:at(e.point)?Ht.fromJSON(e.point):void 0,xaxis:at(e.xaxis)?Me.fromJSON(e.xaxis):void 0,yaxis:at(e.yaxis)?Me.fromJSON(e.yaxis):void 0}},toJSON(e){const t={};return e.guid!==""&&(t.guid=e.guid),e.name!==""&&(t.name=e.name),e.point!==void 0&&(t.point=Ht.toJSON(e.point)),e.xaxis!==void 0&&(t.xaxis=Me.toJSON(e.xaxis)),e.yaxis!==void 0&&(t.yaxis=Me.toJSON(e.yaxis)),t},create(e){return Wt.fromPartial(e??{})},fromPartial(e){const t=qd();return t.guid=e.guid??"",t.name=e.name??"",t.point=e.point!==void 0&&e.point!==null?Ht.fromPartial(e.point):void 0,t.xaxis=e.xaxis!==void 0&&e.xaxis!==null?Me.fromPartial(e.xaxis):void 0,t.yaxis=e.yaxis!==void 0&&e.yaxis!==null?Me.fromPartial(e.yaxis):void 0,t}};function Yd(){return{guid:"",name:"",point:void 0,normal:void 0}}const Nh={encode(e,t=new ne){return e.guid!==""&&t.uint32(10).string(e.guid),e.name!==""&&t.uint32(18).string(e.name),e.point!==void 0&&Ht.encode(e.point,t.uint32(26).fork()).join(),e.normal!==void 0&&Me.encode(e.normal,t.uint32(34).fork()).join(),t},decode(e,t){const n=e instanceof xt?e:new xt(e),i=t===void 0?n.len:n.pos+t,r=Yd();for(;n.pos>>3){case 1:{if(s!==10)break;r.guid=n.string();continue}case 2:{if(s!==18)break;r.name=n.string();continue}case 3:{if(s!==26)break;r.point=Ht.decode(n,n.uint32());continue}case 4:{if(s!==34)break;r.normal=Me.decode(n,n.uint32());continue}}if((s&7)===4||s===0)break;n.skip(s&7)}return r},fromJSON(e){return{guid:at(e.guid)?globalThis.String(e.guid):"",name:at(e.name)?globalThis.String(e.name):"",point:at(e.point)?Ht.fromJSON(e.point):void 0,normal:at(e.normal)?Me.fromJSON(e.normal):void 0}},toJSON(e){const t={};return e.guid!==""&&(t.guid=e.guid),e.name!==""&&(t.name=e.name),e.point!==void 0&&(t.point=Ht.toJSON(e.point)),e.normal!==void 0&&(t.normal=Me.toJSON(e.normal)),t},create(e){return Nh.fromPartial(e??{})},fromPartial(e){const t=Yd();return t.guid=e.guid??"",t.name=e.name??"",t.point=e.point!==void 0&&e.point!==null?Ht.fromPartial(e.point):void 0,t.normal=e.normal!==void 0&&e.normal!==null?Me.fromPartial(e.normal):void 0,t}};function Jd(){return{guid:"",name:"",w:0,x:0,y:0,z:0}}const Uh={encode(e,t=new ne){return e.guid!==""&&t.uint32(10).string(e.guid),e.name!==""&&t.uint32(18).string(e.name),e.w!==0&&t.uint32(29).float(e.w),e.x!==0&&t.uint32(37).float(e.x),e.y!==0&&t.uint32(45).float(e.y),e.z!==0&&t.uint32(53).float(e.z),t},decode(e,t){const n=e instanceof xt?e:new xt(e),i=t===void 0?n.len:n.pos+t,r=Jd();for(;n.pos>>3){case 1:{if(s!==10)break;r.guid=n.string();continue}case 2:{if(s!==18)break;r.name=n.string();continue}case 3:{if(s!==29)break;r.w=n.float();continue}case 4:{if(s!==37)break;r.x=n.float();continue}case 5:{if(s!==45)break;r.y=n.float();continue}case 6:{if(s!==53)break;r.z=n.float();continue}}if((s&7)===4||s===0)break;n.skip(s&7)}return r},fromJSON(e){return{guid:at(e.guid)?globalThis.String(e.guid):"",name:at(e.name)?globalThis.String(e.name):"",w:at(e.w)?globalThis.Number(e.w):0,x:at(e.x)?globalThis.Number(e.x):0,y:at(e.y)?globalThis.Number(e.y):0,z:at(e.z)?globalThis.Number(e.z):0}},toJSON(e){const t={};return e.guid!==""&&(t.guid=e.guid),e.name!==""&&(t.name=e.name),e.w!==0&&(t.w=e.w),e.x!==0&&(t.x=e.x),e.y!==0&&(t.y=e.y),e.z!==0&&(t.z=e.z),t},create(e){return Uh.fromPartial(e??{})},fromPartial(e){const t=Jd();return t.guid=e.guid??"",t.name=e.name??"",t.w=e.w??0,t.x=e.x??0,t.y=e.y??0,t.z=e.z??0,t}};function $d(){return{guid:"",name:"",start:void 0,end:void 0}}const Oh={encode(e,t=new ne){return e.guid!==""&&t.uint32(10).string(e.guid),e.name!==""&&t.uint32(18).string(e.name),e.start!==void 0&&Ht.encode(e.start,t.uint32(26).fork()).join(),e.end!==void 0&&Ht.encode(e.end,t.uint32(34).fork()).join(),t},decode(e,t){const n=e instanceof xt?e:new xt(e),i=t===void 0?n.len:n.pos+t,r=$d();for(;n.pos>>3){case 1:{if(s!==10)break;r.guid=n.string();continue}case 2:{if(s!==18)break;r.name=n.string();continue}case 3:{if(s!==26)break;r.start=Ht.decode(n,n.uint32());continue}case 4:{if(s!==34)break;r.end=Ht.decode(n,n.uint32());continue}}if((s&7)===4||s===0)break;n.skip(s&7)}return r},fromJSON(e){return{guid:at(e.guid)?globalThis.String(e.guid):"",name:at(e.name)?globalThis.String(e.name):"",start:at(e.start)?Ht.fromJSON(e.start):void 0,end:at(e.end)?Ht.fromJSON(e.end):void 0}},toJSON(e){const t={};return e.guid!==""&&(t.guid=e.guid),e.name!==""&&(t.name=e.name),e.start!==void 0&&(t.start=Ht.toJSON(e.start)),e.end!==void 0&&(t.end=Ht.toJSON(e.end)),t},create(e){return Oh.fromPartial(e??{})},fromPartial(e){const t=$d();return t.guid=e.guid??"",t.name=e.name??"",t.start=e.start!==void 0&&e.start!==null?Ht.fromPartial(e.start):void 0,t.end=e.end!==void 0&&e.end!==null?Ht.fromPartial(e.end):void 0,t}};function Zd(){return{guid:"",name:"",radius:0,frame:void 0}}const ur={encode(e,t=new ne){return e.guid!==""&&t.uint32(10).string(e.guid),e.name!==""&&t.uint32(18).string(e.name),e.radius!==0&&t.uint32(29).float(e.radius),e.frame!==void 0&&Wt.encode(e.frame,t.uint32(34).fork()).join(),t},decode(e,t){const n=e instanceof xt?e:new xt(e),i=t===void 0?n.len:n.pos+t,r=Zd();for(;n.pos>>3){case 1:{if(s!==10)break;r.guid=n.string();continue}case 2:{if(s!==18)break;r.name=n.string();continue}case 3:{if(s!==29)break;r.radius=n.float();continue}case 4:{if(s!==34)break;r.frame=Wt.decode(n,n.uint32());continue}}if((s&7)===4||s===0)break;n.skip(s&7)}return r},fromJSON(e){return{guid:at(e.guid)?globalThis.String(e.guid):"",name:at(e.name)?globalThis.String(e.name):"",radius:at(e.radius)?globalThis.Number(e.radius):0,frame:at(e.frame)?Wt.fromJSON(e.frame):void 0}},toJSON(e){const t={};return e.guid!==""&&(t.guid=e.guid),e.name!==""&&(t.name=e.name),e.radius!==0&&(t.radius=e.radius),e.frame!==void 0&&(t.frame=Wt.toJSON(e.frame)),t},create(e){return ur.fromPartial(e??{})},fromPartial(e){const t=Zd();return t.guid=e.guid??"",t.name=e.name??"",t.radius=e.radius??0,t.frame=e.frame!==void 0&&e.frame!==null?Wt.fromPartial(e.frame):void 0,t}};function Kd(){return{guid:"",name:"",circle:void 0,startAngle:0,endAngle:0}}const Fh={encode(e,t=new ne){return e.guid!==""&&t.uint32(10).string(e.guid),e.name!==""&&t.uint32(18).string(e.name),e.circle!==void 0&&ur.encode(e.circle,t.uint32(26).fork()).join(),e.startAngle!==0&&t.uint32(37).float(e.startAngle),e.endAngle!==0&&t.uint32(45).float(e.endAngle),t},decode(e,t){const n=e instanceof xt?e:new xt(e),i=t===void 0?n.len:n.pos+t,r=Kd();for(;n.pos>>3){case 1:{if(s!==10)break;r.guid=n.string();continue}case 2:{if(s!==18)break;r.name=n.string();continue}case 3:{if(s!==26)break;r.circle=ur.decode(n,n.uint32());continue}case 4:{if(s!==37)break;r.startAngle=n.float();continue}case 5:{if(s!==45)break;r.endAngle=n.float();continue}}if((s&7)===4||s===0)break;n.skip(s&7)}return r},fromJSON(e){return{guid:at(e.guid)?globalThis.String(e.guid):"",name:at(e.name)?globalThis.String(e.name):"",circle:at(e.circle)?ur.fromJSON(e.circle):void 0,startAngle:at(e.startAngle)?globalThis.Number(e.startAngle):at(e.start_angle)?globalThis.Number(e.start_angle):0,endAngle:at(e.endAngle)?globalThis.Number(e.endAngle):at(e.end_angle)?globalThis.Number(e.end_angle):0}},toJSON(e){const t={};return e.guid!==""&&(t.guid=e.guid),e.name!==""&&(t.name=e.name),e.circle!==void 0&&(t.circle=ur.toJSON(e.circle)),e.startAngle!==0&&(t.startAngle=e.startAngle),e.endAngle!==0&&(t.endAngle=e.endAngle),t},create(e){return Fh.fromPartial(e??{})},fromPartial(e){const t=Kd();return t.guid=e.guid??"",t.name=e.name??"",t.circle=e.circle!==void 0&&e.circle!==null?ur.fromPartial(e.circle):void 0,t.startAngle=e.startAngle??0,t.endAngle=e.endAngle??0,t}};function Qd(){return{guid:"",name:"",major:0,minor:0,frame:void 0}}const kh={encode(e,t=new ne){return e.guid!==""&&t.uint32(10).string(e.guid),e.name!==""&&t.uint32(18).string(e.name),e.major!==0&&t.uint32(29).float(e.major),e.minor!==0&&t.uint32(37).float(e.minor),e.frame!==void 0&&Wt.encode(e.frame,t.uint32(42).fork()).join(),t},decode(e,t){const n=e instanceof xt?e:new xt(e),i=t===void 0?n.len:n.pos+t,r=Qd();for(;n.pos>>3){case 1:{if(s!==10)break;r.guid=n.string();continue}case 2:{if(s!==18)break;r.name=n.string();continue}case 3:{if(s!==29)break;r.major=n.float();continue}case 4:{if(s!==37)break;r.minor=n.float();continue}case 5:{if(s!==42)break;r.frame=Wt.decode(n,n.uint32());continue}}if((s&7)===4||s===0)break;n.skip(s&7)}return r},fromJSON(e){return{guid:at(e.guid)?globalThis.String(e.guid):"",name:at(e.name)?globalThis.String(e.name):"",major:at(e.major)?globalThis.Number(e.major):0,minor:at(e.minor)?globalThis.Number(e.minor):0,frame:at(e.frame)?Wt.fromJSON(e.frame):void 0}},toJSON(e){const t={};return e.guid!==""&&(t.guid=e.guid),e.name!==""&&(t.name=e.name),e.major!==0&&(t.major=e.major),e.minor!==0&&(t.minor=e.minor),e.frame!==void 0&&(t.frame=Wt.toJSON(e.frame)),t},create(e){return kh.fromPartial(e??{})},fromPartial(e){const t=Qd();return t.guid=e.guid??"",t.name=e.name??"",t.major=e.major??0,t.minor=e.minor??0,t.frame=e.frame!==void 0&&e.frame!==null?Wt.fromPartial(e.frame):void 0,t}};function jd(){return{guid:"",name:"",focal:0,frame:void 0}}const Bh={encode(e,t=new ne){return e.guid!==""&&t.uint32(10).string(e.guid),e.name!==""&&t.uint32(18).string(e.name),e.focal!==0&&t.uint32(29).float(e.focal),e.frame!==void 0&&Wt.encode(e.frame,t.uint32(34).fork()).join(),t},decode(e,t){const n=e instanceof xt?e:new xt(e),i=t===void 0?n.len:n.pos+t,r=jd();for(;n.pos>>3){case 1:{if(s!==10)break;r.guid=n.string();continue}case 2:{if(s!==18)break;r.name=n.string();continue}case 3:{if(s!==29)break;r.focal=n.float();continue}case 4:{if(s!==34)break;r.frame=Wt.decode(n,n.uint32());continue}}if((s&7)===4||s===0)break;n.skip(s&7)}return r},fromJSON(e){return{guid:at(e.guid)?globalThis.String(e.guid):"",name:at(e.name)?globalThis.String(e.name):"",focal:at(e.focal)?globalThis.Number(e.focal):0,frame:at(e.frame)?Wt.fromJSON(e.frame):void 0}},toJSON(e){const t={};return e.guid!==""&&(t.guid=e.guid),e.name!==""&&(t.name=e.name),e.focal!==0&&(t.focal=e.focal),e.frame!==void 0&&(t.frame=Wt.toJSON(e.frame)),t},create(e){return Bh.fromPartial(e??{})},fromPartial(e){const t=jd();return t.guid=e.guid??"",t.name=e.name??"",t.focal=e.focal??0,t.frame=e.frame!==void 0&&e.frame!==null?Wt.fromPartial(e.frame):void 0,t}};function tp(){return{guid:"",name:"",major:0,minor:0,frame:void 0}}const zh={encode(e,t=new ne){return e.guid!==""&&t.uint32(10).string(e.guid),e.name!==""&&t.uint32(18).string(e.name),e.major!==0&&t.uint32(29).float(e.major),e.minor!==0&&t.uint32(37).float(e.minor),e.frame!==void 0&&Wt.encode(e.frame,t.uint32(42).fork()).join(),t},decode(e,t){const n=e instanceof xt?e:new xt(e),i=t===void 0?n.len:n.pos+t,r=tp();for(;n.pos>>3){case 1:{if(s!==10)break;r.guid=n.string();continue}case 2:{if(s!==18)break;r.name=n.string();continue}case 3:{if(s!==29)break;r.major=n.float();continue}case 4:{if(s!==37)break;r.minor=n.float();continue}case 5:{if(s!==42)break;r.frame=Wt.decode(n,n.uint32());continue}}if((s&7)===4||s===0)break;n.skip(s&7)}return r},fromJSON(e){return{guid:at(e.guid)?globalThis.String(e.guid):"",name:at(e.name)?globalThis.String(e.name):"",major:at(e.major)?globalThis.Number(e.major):0,minor:at(e.minor)?globalThis.Number(e.minor):0,frame:at(e.frame)?Wt.fromJSON(e.frame):void 0}},toJSON(e){const t={};return e.guid!==""&&(t.guid=e.guid),e.name!==""&&(t.name=e.name),e.major!==0&&(t.major=e.major),e.minor!==0&&(t.minor=e.minor),e.frame!==void 0&&(t.frame=Wt.toJSON(e.frame)),t},create(e){return zh.fromPartial(e??{})},fromPartial(e){const t=tp();return t.guid=e.guid??"",t.name=e.name??"",t.major=e.major??0,t.minor=e.minor??0,t.frame=e.frame!==void 0&&e.frame!==null?Wt.fromPartial(e.frame):void 0,t}};function ep(){return{guid:"",name:"",points:[],degree:0}}const Vh={encode(e,t=new ne){e.guid!==""&&t.uint32(10).string(e.guid),e.name!==""&&t.uint32(18).string(e.name);for(const n of e.points)Ht.encode(n,t.uint32(26).fork()).join();return e.degree!==0&&t.uint32(32).int32(e.degree),t},decode(e,t){const n=e instanceof xt?e:new xt(e),i=t===void 0?n.len:n.pos+t,r=ep();for(;n.pos>>3){case 1:{if(s!==10)break;r.guid=n.string();continue}case 2:{if(s!==18)break;r.name=n.string();continue}case 3:{if(s!==26)break;r.points.push(Ht.decode(n,n.uint32()));continue}case 4:{if(s!==32)break;r.degree=n.int32();continue}}if((s&7)===4||s===0)break;n.skip(s&7)}return r},fromJSON(e){return{guid:at(e.guid)?globalThis.String(e.guid):"",name:at(e.name)?globalThis.String(e.name):"",points:globalThis.Array.isArray(e?.points)?e.points.map(t=>Ht.fromJSON(t)):[],degree:at(e.degree)?globalThis.Number(e.degree):0}},toJSON(e){const t={};return e.guid!==""&&(t.guid=e.guid),e.name!==""&&(t.name=e.name),e.points?.length&&(t.points=e.points.map(n=>Ht.toJSON(n))),e.degree!==0&&(t.degree=Math.round(e.degree)),t},create(e){return Vh.fromPartial(e??{})},fromPartial(e){const t=ep();return t.guid=e.guid??"",t.name=e.name??"",t.points=e.points?.map(n=>Ht.fromPartial(n))||[],t.degree=e.degree??0,t}};function np(){return{guid:"",name:"",points:[]}}const Hh={encode(e,t=new ne){e.guid!==""&&t.uint32(10).string(e.guid),e.name!==""&&t.uint32(18).string(e.name);for(const n of e.points)Ht.encode(n,t.uint32(26).fork()).join();return t},decode(e,t){const n=e instanceof xt?e:new xt(e),i=t===void 0?n.len:n.pos+t,r=np();for(;n.pos>>3){case 1:{if(s!==10)break;r.guid=n.string();continue}case 2:{if(s!==18)break;r.name=n.string();continue}case 3:{if(s!==26)break;r.points.push(Ht.decode(n,n.uint32()));continue}}if((s&7)===4||s===0)break;n.skip(s&7)}return r},fromJSON(e){return{guid:at(e.guid)?globalThis.String(e.guid):"",name:at(e.name)?globalThis.String(e.name):"",points:globalThis.Array.isArray(e?.points)?e.points.map(t=>Ht.fromJSON(t)):[]}},toJSON(e){const t={};return e.guid!==""&&(t.guid=e.guid),e.name!==""&&(t.name=e.name),e.points?.length&&(t.points=e.points.map(n=>Ht.toJSON(n))),t},create(e){return Hh.fromPartial(e??{})},fromPartial(e){const t=np();return t.guid=e.guid??"",t.name=e.name??"",t.points=e.points?.map(n=>Ht.fromPartial(n))||[],t}};function ip(){return{guid:"",name:"",points:[]}}const Gh={encode(e,t=new ne){e.guid!==""&&t.uint32(10).string(e.guid),e.name!==""&&t.uint32(18).string(e.name);for(const n of e.points)Ht.encode(n,t.uint32(26).fork()).join();return t},decode(e,t){const n=e instanceof xt?e:new xt(e),i=t===void 0?n.len:n.pos+t,r=ip();for(;n.pos>>3){case 1:{if(s!==10)break;r.guid=n.string();continue}case 2:{if(s!==18)break;r.name=n.string();continue}case 3:{if(s!==26)break;r.points.push(Ht.decode(n,n.uint32()));continue}}if((s&7)===4||s===0)break;n.skip(s&7)}return r},fromJSON(e){return{guid:at(e.guid)?globalThis.String(e.guid):"",name:at(e.name)?globalThis.String(e.name):"",points:globalThis.Array.isArray(e?.points)?e.points.map(t=>Ht.fromJSON(t)):[]}},toJSON(e){const t={};return e.guid!==""&&(t.guid=e.guid),e.name!==""&&(t.name=e.name),e.points?.length&&(t.points=e.points.map(n=>Ht.toJSON(n))),t},create(e){return Gh.fromPartial(e??{})},fromPartial(e){const t=ip();return t.guid=e.guid??"",t.name=e.name??"",t.points=e.points?.map(n=>Ht.fromPartial(n))||[],t}};function rp(){return{guid:"",name:"",frame:void 0,xsize:0,ysize:0,zsize:0}}const Wh={encode(e,t=new ne){return e.guid!==""&&t.uint32(10).string(e.guid),e.name!==""&&t.uint32(18).string(e.name),e.frame!==void 0&&Wt.encode(e.frame,t.uint32(26).fork()).join(),e.xsize!==0&&t.uint32(37).float(e.xsize),e.ysize!==0&&t.uint32(45).float(e.ysize),e.zsize!==0&&t.uint32(53).float(e.zsize),t},decode(e,t){const n=e instanceof xt?e:new xt(e),i=t===void 0?n.len:n.pos+t,r=rp();for(;n.pos>>3){case 1:{if(s!==10)break;r.guid=n.string();continue}case 2:{if(s!==18)break;r.name=n.string();continue}case 3:{if(s!==26)break;r.frame=Wt.decode(n,n.uint32());continue}case 4:{if(s!==37)break;r.xsize=n.float();continue}case 5:{if(s!==45)break;r.ysize=n.float();continue}case 6:{if(s!==53)break;r.zsize=n.float();continue}}if((s&7)===4||s===0)break;n.skip(s&7)}return r},fromJSON(e){return{guid:at(e.guid)?globalThis.String(e.guid):"",name:at(e.name)?globalThis.String(e.name):"",frame:at(e.frame)?Wt.fromJSON(e.frame):void 0,xsize:at(e.xsize)?globalThis.Number(e.xsize):0,ysize:at(e.ysize)?globalThis.Number(e.ysize):0,zsize:at(e.zsize)?globalThis.Number(e.zsize):0}},toJSON(e){const t={};return e.guid!==""&&(t.guid=e.guid),e.name!==""&&(t.name=e.name),e.frame!==void 0&&(t.frame=Wt.toJSON(e.frame)),e.xsize!==0&&(t.xsize=e.xsize),e.ysize!==0&&(t.ysize=e.ysize),e.zsize!==0&&(t.zsize=e.zsize),t},create(e){return Wh.fromPartial(e??{})},fromPartial(e){const t=rp();return t.guid=e.guid??"",t.name=e.name??"",t.frame=e.frame!==void 0&&e.frame!==null?Wt.fromPartial(e.frame):void 0,t.xsize=e.xsize??0,t.ysize=e.ysize??0,t.zsize=e.zsize??0,t}};function sp(){return{guid:"",name:"",radius:0,frame:void 0}}const Xh={encode(e,t=new ne){return e.guid!==""&&t.uint32(10).string(e.guid),e.name!==""&&t.uint32(18).string(e.name),e.radius!==0&&t.uint32(29).float(e.radius),e.frame!==void 0&&Wt.encode(e.frame,t.uint32(34).fork()).join(),t},decode(e,t){const n=e instanceof xt?e:new xt(e),i=t===void 0?n.len:n.pos+t,r=sp();for(;n.pos>>3){case 1:{if(s!==10)break;r.guid=n.string();continue}case 2:{if(s!==18)break;r.name=n.string();continue}case 3:{if(s!==29)break;r.radius=n.float();continue}case 4:{if(s!==34)break;r.frame=Wt.decode(n,n.uint32());continue}}if((s&7)===4||s===0)break;n.skip(s&7)}return r},fromJSON(e){return{guid:at(e.guid)?globalThis.String(e.guid):"",name:at(e.name)?globalThis.String(e.name):"",radius:at(e.radius)?globalThis.Number(e.radius):0,frame:at(e.frame)?Wt.fromJSON(e.frame):void 0}},toJSON(e){const t={};return e.guid!==""&&(t.guid=e.guid),e.name!==""&&(t.name=e.name),e.radius!==0&&(t.radius=e.radius),e.frame!==void 0&&(t.frame=Wt.toJSON(e.frame)),t},create(e){return Xh.fromPartial(e??{})},fromPartial(e){const t=sp();return t.guid=e.guid??"",t.name=e.name??"",t.radius=e.radius??0,t.frame=e.frame!==void 0&&e.frame!==null?Wt.fromPartial(e.frame):void 0,t}};function op(){return{guid:"",name:"",radius:0,height:0,frame:void 0}}const qh={encode(e,t=new ne){return e.guid!==""&&t.uint32(10).string(e.guid),e.name!==""&&t.uint32(18).string(e.name),e.radius!==0&&t.uint32(29).float(e.radius),e.height!==0&&t.uint32(37).float(e.height),e.frame!==void 0&&Wt.encode(e.frame,t.uint32(42).fork()).join(),t},decode(e,t){const n=e instanceof xt?e:new xt(e),i=t===void 0?n.len:n.pos+t,r=op();for(;n.pos>>3){case 1:{if(s!==10)break;r.guid=n.string();continue}case 2:{if(s!==18)break;r.name=n.string();continue}case 3:{if(s!==29)break;r.radius=n.float();continue}case 4:{if(s!==37)break;r.height=n.float();continue}case 5:{if(s!==42)break;r.frame=Wt.decode(n,n.uint32());continue}}if((s&7)===4||s===0)break;n.skip(s&7)}return r},fromJSON(e){return{guid:at(e.guid)?globalThis.String(e.guid):"",name:at(e.name)?globalThis.String(e.name):"",radius:at(e.radius)?globalThis.Number(e.radius):0,height:at(e.height)?globalThis.Number(e.height):0,frame:at(e.frame)?Wt.fromJSON(e.frame):void 0}},toJSON(e){const t={};return e.guid!==""&&(t.guid=e.guid),e.name!==""&&(t.name=e.name),e.radius!==0&&(t.radius=e.radius),e.height!==0&&(t.height=e.height),e.frame!==void 0&&(t.frame=Wt.toJSON(e.frame)),t},create(e){return qh.fromPartial(e??{})},fromPartial(e){const t=op();return t.guid=e.guid??"",t.name=e.name??"",t.radius=e.radius??0,t.height=e.height??0,t.frame=e.frame!==void 0&&e.frame!==null?Wt.fromPartial(e.frame):void 0,t}};function ap(){return{guid:"",name:"",radius:0,height:0,frame:void 0}}const Yh={encode(e,t=new ne){return e.guid!==""&&t.uint32(10).string(e.guid),e.name!==""&&t.uint32(18).string(e.name),e.radius!==0&&t.uint32(29).float(e.radius),e.height!==0&&t.uint32(37).float(e.height),e.frame!==void 0&&Wt.encode(e.frame,t.uint32(42).fork()).join(),t},decode(e,t){const n=e instanceof xt?e:new xt(e),i=t===void 0?n.len:n.pos+t,r=ap();for(;n.pos>>3){case 1:{if(s!==10)break;r.guid=n.string();continue}case 2:{if(s!==18)break;r.name=n.string();continue}case 3:{if(s!==29)break;r.radius=n.float();continue}case 4:{if(s!==37)break;r.height=n.float();continue}case 5:{if(s!==42)break;r.frame=Wt.decode(n,n.uint32());continue}}if((s&7)===4||s===0)break;n.skip(s&7)}return r},fromJSON(e){return{guid:at(e.guid)?globalThis.String(e.guid):"",name:at(e.name)?globalThis.String(e.name):"",radius:at(e.radius)?globalThis.Number(e.radius):0,height:at(e.height)?globalThis.Number(e.height):0,frame:at(e.frame)?Wt.fromJSON(e.frame):void 0}},toJSON(e){const t={};return e.guid!==""&&(t.guid=e.guid),e.name!==""&&(t.name=e.name),e.radius!==0&&(t.radius=e.radius),e.height!==0&&(t.height=e.height),e.frame!==void 0&&(t.frame=Wt.toJSON(e.frame)),t},create(e){return Yh.fromPartial(e??{})},fromPartial(e){const t=ap();return t.guid=e.guid??"",t.name=e.name??"",t.radius=e.radius??0,t.height=e.height??0,t.frame=e.frame!==void 0&&e.frame!==null?Wt.fromPartial(e.frame):void 0,t}};function lp(){return{guid:"",name:"",radius:0,height:0,frame:void 0}}const Jh={encode(e,t=new ne){return e.guid!==""&&t.uint32(10).string(e.guid),e.name!==""&&t.uint32(18).string(e.name),e.radius!==0&&t.uint32(29).float(e.radius),e.height!==0&&t.uint32(37).float(e.height),e.frame!==void 0&&Wt.encode(e.frame,t.uint32(42).fork()).join(),t},decode(e,t){const n=e instanceof xt?e:new xt(e),i=t===void 0?n.len:n.pos+t,r=lp();for(;n.pos>>3){case 1:{if(s!==10)break;r.guid=n.string();continue}case 2:{if(s!==18)break;r.name=n.string();continue}case 3:{if(s!==29)break;r.radius=n.float();continue}case 4:{if(s!==37)break;r.height=n.float();continue}case 5:{if(s!==42)break;r.frame=Wt.decode(n,n.uint32());continue}}if((s&7)===4||s===0)break;n.skip(s&7)}return r},fromJSON(e){return{guid:at(e.guid)?globalThis.String(e.guid):"",name:at(e.name)?globalThis.String(e.name):"",radius:at(e.radius)?globalThis.Number(e.radius):0,height:at(e.height)?globalThis.Number(e.height):0,frame:at(e.frame)?Wt.fromJSON(e.frame):void 0}},toJSON(e){const t={};return e.guid!==""&&(t.guid=e.guid),e.name!==""&&(t.name=e.name),e.radius!==0&&(t.radius=e.radius),e.height!==0&&(t.height=e.height),e.frame!==void 0&&(t.frame=Wt.toJSON(e.frame)),t},create(e){return Jh.fromPartial(e??{})},fromPartial(e){const t=lp();return t.guid=e.guid??"",t.name=e.name??"",t.radius=e.radius??0,t.height=e.height??0,t.frame=e.frame!==void 0&&e.frame!==null?Wt.fromPartial(e.frame):void 0,t}};function cp(){return{guid:"",name:"",radiusAxis:0,radiusPipe:0,frame:void 0}}const $h={encode(e,t=new ne){return e.guid!==""&&t.uint32(10).string(e.guid),e.name!==""&&t.uint32(18).string(e.name),e.radiusAxis!==0&&t.uint32(29).float(e.radiusAxis),e.radiusPipe!==0&&t.uint32(37).float(e.radiusPipe),e.frame!==void 0&&Wt.encode(e.frame,t.uint32(42).fork()).join(),t},decode(e,t){const n=e instanceof xt?e:new xt(e),i=t===void 0?n.len:n.pos+t,r=cp();for(;n.pos>>3){case 1:{if(s!==10)break;r.guid=n.string();continue}case 2:{if(s!==18)break;r.name=n.string();continue}case 3:{if(s!==29)break;r.radiusAxis=n.float();continue}case 4:{if(s!==37)break;r.radiusPipe=n.float();continue}case 5:{if(s!==42)break;r.frame=Wt.decode(n,n.uint32());continue}}if((s&7)===4||s===0)break;n.skip(s&7)}return r},fromJSON(e){return{guid:at(e.guid)?globalThis.String(e.guid):"",name:at(e.name)?globalThis.String(e.name):"",radiusAxis:at(e.radiusAxis)?globalThis.Number(e.radiusAxis):at(e.radius_axis)?globalThis.Number(e.radius_axis):0,radiusPipe:at(e.radiusPipe)?globalThis.Number(e.radiusPipe):at(e.radius_pipe)?globalThis.Number(e.radius_pipe):0,frame:at(e.frame)?Wt.fromJSON(e.frame):void 0}},toJSON(e){const t={};return e.guid!==""&&(t.guid=e.guid),e.name!==""&&(t.name=e.name),e.radiusAxis!==0&&(t.radiusAxis=e.radiusAxis),e.radiusPipe!==0&&(t.radiusPipe=e.radiusPipe),e.frame!==void 0&&(t.frame=Wt.toJSON(e.frame)),t},create(e){return $h.fromPartial(e??{})},fromPartial(e){const t=cp();return t.guid=e.guid??"",t.name=e.name??"",t.radiusAxis=e.radiusAxis??0,t.radiusPipe=e.radiusPipe??0,t.frame=e.frame!==void 0&&e.frame!==null?Wt.fromPartial(e.frame):void 0,t}};function up(){return{guid:"",name:"",points:[]}}const Zh={encode(e,t=new ne){e.guid!==""&&t.uint32(10).string(e.guid),e.name!==""&&t.uint32(18).string(e.name);for(const n of e.points)Ht.encode(n,t.uint32(26).fork()).join();return t},decode(e,t){const n=e instanceof xt?e:new xt(e),i=t===void 0?n.len:n.pos+t,r=up();for(;n.pos>>3){case 1:{if(s!==10)break;r.guid=n.string();continue}case 2:{if(s!==18)break;r.name=n.string();continue}case 3:{if(s!==26)break;r.points.push(Ht.decode(n,n.uint32()));continue}}if((s&7)===4||s===0)break;n.skip(s&7)}return r},fromJSON(e){return{guid:at(e.guid)?globalThis.String(e.guid):"",name:at(e.name)?globalThis.String(e.name):"",points:globalThis.Array.isArray(e?.points)?e.points.map(t=>Ht.fromJSON(t)):[]}},toJSON(e){const t={};return e.guid!==""&&(t.guid=e.guid),e.name!==""&&(t.name=e.name),e.points?.length&&(t.points=e.points.map(n=>Ht.toJSON(n))),t},create(e){return Zh.fromPartial(e??{})},fromPartial(e){const t=up();return t.guid=e.guid??"",t.name=e.name??"",t.points=e.points?.map(n=>Ht.fromPartial(n))||[],t}};function hp(){return{guid:"",name:"",matrix:[]}}const Kh={encode(e,t=new ne){e.guid!==""&&t.uint32(10).string(e.guid),e.name!==""&&t.uint32(18).string(e.name),t.uint32(26).fork();for(const n of e.matrix)t.float(n);return t.join(),t},decode(e,t){const n=e instanceof xt?e:new xt(e),i=t===void 0?n.len:n.pos+t,r=hp();for(;n.pos>>3){case 1:{if(s!==10)break;r.guid=n.string();continue}case 2:{if(s!==18)break;r.name=n.string();continue}case 3:{if(s===29){r.matrix.push(n.float());continue}if(s===26){const o=n.uint32()+n.pos;for(;n.posglobalThis.Number(t)):[]}},toJSON(e){const t={};return e.guid!==""&&(t.guid=e.guid),e.name!==""&&(t.name=e.name),e.matrix?.length&&(t.matrix=e.matrix),t},create(e){return Kh.fromPartial(e??{})},fromPartial(e){const t=hp();return t.guid=e.guid??"",t.name=e.name??"",t.matrix=e.matrix?.map(n=>n)||[],t}};function fp(){return{guid:"",name:"",translationVector:void 0}}const Qh={encode(e,t=new ne){return e.guid!==""&&t.uint32(10).string(e.guid),e.name!==""&&t.uint32(18).string(e.name),e.translationVector!==void 0&&Me.encode(e.translationVector,t.uint32(26).fork()).join(),t},decode(e,t){const n=e instanceof xt?e:new xt(e),i=t===void 0?n.len:n.pos+t,r=fp();for(;n.pos>>3){case 1:{if(s!==10)break;r.guid=n.string();continue}case 2:{if(s!==18)break;r.name=n.string();continue}case 3:{if(s!==26)break;r.translationVector=Me.decode(n,n.uint32());continue}}if((s&7)===4||s===0)break;n.skip(s&7)}return r},fromJSON(e){return{guid:at(e.guid)?globalThis.String(e.guid):"",name:at(e.name)?globalThis.String(e.name):"",translationVector:at(e.translationVector)?Me.fromJSON(e.translationVector):at(e.translation_vector)?Me.fromJSON(e.translation_vector):void 0}},toJSON(e){const t={};return e.guid!==""&&(t.guid=e.guid),e.name!==""&&(t.name=e.name),e.translationVector!==void 0&&(t.translationVector=Me.toJSON(e.translationVector)),t},create(e){return Qh.fromPartial(e??{})},fromPartial(e){const t=fp();return t.guid=e.guid??"",t.name=e.name??"",t.translationVector=e.translationVector!==void 0&&e.translationVector!==null?Me.fromPartial(e.translationVector):void 0,t}};function dp(){return{guid:"",name:"",axis:void 0,angle:0,point:void 0}}const jh={encode(e,t=new ne){return e.guid!==""&&t.uint32(10).string(e.guid),e.name!==""&&t.uint32(18).string(e.name),e.axis!==void 0&&Me.encode(e.axis,t.uint32(26).fork()).join(),e.angle!==0&&t.uint32(37).float(e.angle),e.point!==void 0&&Ht.encode(e.point,t.uint32(42).fork()).join(),t},decode(e,t){const n=e instanceof xt?e:new xt(e),i=t===void 0?n.len:n.pos+t,r=dp();for(;n.pos>>3){case 1:{if(s!==10)break;r.guid=n.string();continue}case 2:{if(s!==18)break;r.name=n.string();continue}case 3:{if(s!==26)break;r.axis=Me.decode(n,n.uint32());continue}case 4:{if(s!==37)break;r.angle=n.float();continue}case 5:{if(s!==42)break;r.point=Ht.decode(n,n.uint32());continue}}if((s&7)===4||s===0)break;n.skip(s&7)}return r},fromJSON(e){return{guid:at(e.guid)?globalThis.String(e.guid):"",name:at(e.name)?globalThis.String(e.name):"",axis:at(e.axis)?Me.fromJSON(e.axis):void 0,angle:at(e.angle)?globalThis.Number(e.angle):0,point:at(e.point)?Ht.fromJSON(e.point):void 0}},toJSON(e){const t={};return e.guid!==""&&(t.guid=e.guid),e.name!==""&&(t.name=e.name),e.axis!==void 0&&(t.axis=Me.toJSON(e.axis)),e.angle!==0&&(t.angle=e.angle),e.point!==void 0&&(t.point=Ht.toJSON(e.point)),t},create(e){return jh.fromPartial(e??{})},fromPartial(e){const t=dp();return t.guid=e.guid??"",t.name=e.name??"",t.axis=e.axis!==void 0&&e.axis!==null?Me.fromPartial(e.axis):void 0,t.angle=e.angle??0,t.point=e.point!==void 0&&e.point!==null?Ht.fromPartial(e.point):void 0,t}};function pp(){return{guid:"",name:"",matrix:[]}}const tf={encode(e,t=new ne){e.guid!==""&&t.uint32(10).string(e.guid),e.name!==""&&t.uint32(18).string(e.name),t.uint32(26).fork();for(const n of e.matrix)t.float(n);return t.join(),t},decode(e,t){const n=e instanceof xt?e:new xt(e),i=t===void 0?n.len:n.pos+t,r=pp();for(;n.pos>>3){case 1:{if(s!==10)break;r.guid=n.string();continue}case 2:{if(s!==18)break;r.name=n.string();continue}case 3:{if(s===29){r.matrix.push(n.float());continue}if(s===26){const o=n.uint32()+n.pos;for(;n.posglobalThis.Number(t)):[]}},toJSON(e){const t={};return e.guid!==""&&(t.guid=e.guid),e.name!==""&&(t.name=e.name),e.matrix?.length&&(t.matrix=e.matrix),t},create(e){return tf.fromPartial(e??{})},fromPartial(e){const t=pp();return t.guid=e.guid??"",t.name=e.name??"",t.matrix=e.matrix?.map(n=>n)||[],t}};function mp(){return{guid:"",name:"",matrix:[]}}const ef={encode(e,t=new ne){e.guid!==""&&t.uint32(10).string(e.guid),e.name!==""&&t.uint32(18).string(e.name),t.uint32(26).fork();for(const n of e.matrix)t.float(n);return t.join(),t},decode(e,t){const n=e instanceof xt?e:new xt(e),i=t===void 0?n.len:n.pos+t,r=mp();for(;n.pos>>3){case 1:{if(s!==10)break;r.guid=n.string();continue}case 2:{if(s!==18)break;r.name=n.string();continue}case 3:{if(s===29){r.matrix.push(n.float());continue}if(s===26){const o=n.uint32()+n.pos;for(;n.posglobalThis.Number(t)):[]}},toJSON(e){const t={};return e.guid!==""&&(t.guid=e.guid),e.name!==""&&(t.name=e.name),e.matrix?.length&&(t.matrix=e.matrix),t},create(e){return ef.fromPartial(e??{})},fromPartial(e){const t=mp();return t.guid=e.guid??"",t.name=e.name??"",t.matrix=e.matrix?.map(n=>n)||[],t}};function gp(){return{guid:"",name:"",matrix:[]}}const nf={encode(e,t=new ne){e.guid!==""&&t.uint32(10).string(e.guid),e.name!==""&&t.uint32(18).string(e.name),t.uint32(26).fork();for(const n of e.matrix)t.float(n);return t.join(),t},decode(e,t){const n=e instanceof xt?e:new xt(e),i=t===void 0?n.len:n.pos+t,r=gp();for(;n.pos>>3){case 1:{if(s!==10)break;r.guid=n.string();continue}case 2:{if(s!==18)break;r.name=n.string();continue}case 3:{if(s===29){r.matrix.push(n.float());continue}if(s===26){const o=n.uint32()+n.pos;for(;n.posglobalThis.Number(t)):[]}},toJSON(e){const t={};return e.guid!==""&&(t.guid=e.guid),e.name!==""&&(t.name=e.name),e.matrix?.length&&(t.matrix=e.matrix),t},create(e){return nf.fromPartial(e??{})},fromPartial(e){const t=gp();return t.guid=e.guid??"",t.name=e.name??"",t.matrix=e.matrix?.map(n=>n)||[],t}};function _p(){return{guid:"",name:"",matrix:[]}}const rf={encode(e,t=new ne){e.guid!==""&&t.uint32(10).string(e.guid),e.name!==""&&t.uint32(18).string(e.name),t.uint32(26).fork();for(const n of e.matrix)t.float(n);return t.join(),t},decode(e,t){const n=e instanceof xt?e:new xt(e),i=t===void 0?n.len:n.pos+t,r=_p();for(;n.pos>>3){case 1:{if(s!==10)break;r.guid=n.string();continue}case 2:{if(s!==18)break;r.name=n.string();continue}case 3:{if(s===29){r.matrix.push(n.float());continue}if(s===26){const o=n.uint32()+n.pos;for(;n.posglobalThis.Number(t)):[]}},toJSON(e){const t={};return e.guid!==""&&(t.guid=e.guid),e.name!==""&&(t.name=e.name),e.matrix?.length&&(t.matrix=e.matrix),t},create(e){return rf.fromPartial(e??{})},fromPartial(e){const t=_p();return t.guid=e.guid??"",t.name=e.name??"",t.matrix=e.matrix?.map(n=>n)||[],t}};function at(e){return e!=null}const sf="182",Yr={ROTATE:0,DOLLY:1,PAN:2},Ms={ROTATE:0,PAN:1,DOLLY_PAN:2,DOLLY_ROTATE:3},cb=0,vp=1,ub=2,Za=1,I0=2,_o=3,yr=0,dn=1,yn=2,Vi=0,Is=1,xp=2,yp=3,Sp=4,hb=5,Fr=100,fb=101,db=102,pb=103,mb=104,gb=200,_b=201,vb=202,xb=203,cu=204,uu=205,yb=206,Sb=207,bb=208,Mb=209,wb=210,Eb=211,Tb=212,Ab=213,Pb=214,hu=0,fu=1,du=2,Fs=3,pu=4,mu=5,gu=6,_u=7,L0=0,Cb=1,Rb=2,vi=0,N0=1,U0=2,O0=3,of=4,F0=5,k0=6,B0=7,z0=300,$r=301,ks=302,vu=303,xu=304,Ul=306,yu=1e3,zi=1001,Su=1002,rn=1003,Db=1004,ha=1005,fn=1006,lc=1007,zr=1008,kn=1009,V0=1010,H0=1011,zo=1012,af=1013,Mi=1014,mi=1015,Yi=1016,lf=1017,cf=1018,Vo=1020,G0=35902,W0=35899,X0=1021,q0=1022,Qn=1023,Ji=1026,Vr=1027,Y0=1028,uf=1029,Bs=1030,hf=1031,ff=1033,Ka=33776,Qa=33777,ja=33778,tl=33779,bu=35840,Mu=35841,wu=35842,Eu=35843,Tu=36196,Au=37492,Pu=37496,Cu=37488,Ru=37489,Du=37490,Iu=37491,Lu=37808,Nu=37809,Uu=37810,Ou=37811,Fu=37812,ku=37813,Bu=37814,zu=37815,Vu=37816,Hu=37817,Gu=37818,Wu=37819,Xu=37820,qu=37821,Yu=36492,Ju=36494,$u=36495,Zu=36283,Ku=36284,Qu=36285,ju=36286,Ib=3200,J0=0,Lb=1,hr="",On="srgb",zs="srgb-linear",dl="linear",be="srgb",ss=7680,bp=519,Nb=512,Ub=513,Ob=514,df=515,Fb=516,kb=517,pf=518,Bb=519,Mp=35044,wp="300 es",gi=2e3,pl=2001;function $0(e){for(let t=e.length-1;t>=0;--t)if(e[t]>=65535)return!0;return!1}function ml(e){return document.createElementNS("http://www.w3.org/1999/xhtml",e)}function zb(){const e=ml("canvas");return e.style.display="block",e}const Ep={};function Tp(...e){const t="THREE."+e.shift();console.log(t,...e)}function Yt(...e){const t="THREE."+e.shift();console.warn(t,...e)}function de(...e){const t="THREE."+e.shift();console.error(t,...e)}function Ho(...e){const t=e.join(" ");t in Ep||(Ep[t]=!0,Yt(...e))}function Vb(e,t,n){return new Promise(function(i,r){function s(){switch(e.clientWaitSync(t,e.SYNC_FLUSH_COMMANDS_BIT,0)){case e.WAIT_FAILED:r();break;case e.TIMEOUT_EXPIRED:setTimeout(s,n);break;default:i()}}setTimeout(s,n)})}class jr{addEventListener(t,n){this._listeners===void 0&&(this._listeners={});const i=this._listeners;i[t]===void 0&&(i[t]=[]),i[t].indexOf(n)===-1&&i[t].push(n)}hasEventListener(t,n){const i=this._listeners;return i===void 0?!1:i[t]!==void 0&&i[t].indexOf(n)!==-1}removeEventListener(t,n){const i=this._listeners;if(i===void 0)return;const r=i[t];if(r!==void 0){const s=r.indexOf(n);s!==-1&&r.splice(s,1)}}dispatchEvent(t){const n=this._listeners;if(n===void 0)return;const i=n[t.type];if(i!==void 0){t.target=this;const r=i.slice(0);for(let s=0,o=r.length;s>8&255]+an[e>>16&255]+an[e>>24&255]+"-"+an[t&255]+an[t>>8&255]+"-"+an[t>>16&15|64]+an[t>>24&255]+"-"+an[n&63|128]+an[n>>8&255]+"-"+an[n>>16&255]+an[n>>24&255]+an[i&255]+an[i>>8&255]+an[i>>16&255]+an[i>>24&255]).toLowerCase()}function re(e,t,n){return Math.max(t,Math.min(n,e))}function mf(e,t){return(e%t+t)%t}function Hb(e,t,n,i,r){return i+(e-t)*(r-i)/(n-t)}function Gb(e,t,n){return e!==t?(n-e)/(t-e):0}function Ro(e,t,n){return(1-n)*e+n*t}function Wb(e,t,n,i){return Ro(e,t,1-Math.exp(-n*i))}function Xb(e,t=1){return t-Math.abs(mf(e,t*2)-t)}function qb(e,t,n){return e<=t?0:e>=n?1:(e=(e-t)/(n-t),e*e*(3-2*e))}function Yb(e,t,n){return e<=t?0:e>=n?1:(e=(e-t)/(n-t),e*e*e*(e*(e*6-15)+10))}function Jb(e,t){return e+Math.floor(Math.random()*(t-e+1))}function $b(e,t){return e+Math.random()*(t-e)}function Zb(e){return e*(.5-Math.random())}function Kb(e){e!==void 0&&(Ap=e);let t=Ap+=1831565813;return t=Math.imul(t^t>>>15,t|1),t^=t+Math.imul(t^t>>>7,t|61),((t^t>>>14)>>>0)/4294967296}function Qb(e){return e*Co}function jb(e){return e*Vs}function tM(e){return(e&e-1)===0&&e!==0}function eM(e){return Math.pow(2,Math.ceil(Math.log(e)/Math.LN2))}function nM(e){return Math.pow(2,Math.floor(Math.log(e)/Math.LN2))}function iM(e,t,n,i,r){const s=Math.cos,o=Math.sin,a=s(n/2),l=o(n/2),c=s((t+i)/2),u=o((t+i)/2),h=s((t-i)/2),f=o((t-i)/2),p=s((i-t)/2),g=o((i-t)/2);switch(r){case"XYX":e.set(a*u,l*h,l*f,a*c);break;case"YZY":e.set(l*f,a*u,l*h,a*c);break;case"ZXZ":e.set(l*h,l*f,a*u,a*c);break;case"XZX":e.set(a*u,l*g,l*p,a*c);break;case"YXY":e.set(l*p,a*u,l*g,a*c);break;case"ZYZ":e.set(l*g,l*p,a*u,a*c);break;default:Yt("MathUtils: .setQuaternionFromProperEuler() encountered an unknown order: "+r)}}function bs(e,t){switch(t.constructor){case Float32Array:return e;case Uint32Array:return e/4294967295;case Uint16Array:return e/65535;case Uint8Array:return e/255;case Int32Array:return Math.max(e/2147483647,-1);case Int16Array:return Math.max(e/32767,-1);case Int8Array:return Math.max(e/127,-1);default:throw new Error("Invalid component type.")}}function _n(e,t){switch(t.constructor){case Float32Array:return e;case Uint32Array:return Math.round(e*4294967295);case Uint16Array:return Math.round(e*65535);case Uint8Array:return Math.round(e*255);case Int32Array:return Math.round(e*2147483647);case Int16Array:return Math.round(e*32767);case Int8Array:return Math.round(e*127);default:throw new Error("Invalid component type.")}}const gl={DEG2RAD:Co,RAD2DEG:Vs,generateUUID:ts,clamp:re,euclideanModulo:mf,mapLinear:Hb,inverseLerp:Gb,lerp:Ro,damp:Wb,pingpong:Xb,smoothstep:qb,smootherstep:Yb,randInt:Jb,randFloat:$b,randFloatSpread:Zb,seededRandom:Kb,degToRad:Qb,radToDeg:jb,isPowerOfTwo:tM,ceilPowerOfTwo:eM,floorPowerOfTwo:nM,setQuaternionFromProperEuler:iM,normalize:_n,denormalize:bs};class mt{constructor(t=0,n=0){mt.prototype.isVector2=!0,this.x=t,this.y=n}get width(){return this.x}set width(t){this.x=t}get height(){return this.y}set height(t){this.y=t}set(t,n){return this.x=t,this.y=n,this}setScalar(t){return this.x=t,this.y=t,this}setX(t){return this.x=t,this}setY(t){return this.y=t,this}setComponent(t,n){switch(t){case 0:this.x=n;break;case 1:this.y=n;break;default:throw new Error("index is out of range: "+t)}return this}getComponent(t){switch(t){case 0:return this.x;case 1:return this.y;default:throw new Error("index is out of range: "+t)}}clone(){return new this.constructor(this.x,this.y)}copy(t){return this.x=t.x,this.y=t.y,this}add(t){return this.x+=t.x,this.y+=t.y,this}addScalar(t){return this.x+=t,this.y+=t,this}addVectors(t,n){return this.x=t.x+n.x,this.y=t.y+n.y,this}addScaledVector(t,n){return this.x+=t.x*n,this.y+=t.y*n,this}sub(t){return this.x-=t.x,this.y-=t.y,this}subScalar(t){return this.x-=t,this.y-=t,this}subVectors(t,n){return this.x=t.x-n.x,this.y=t.y-n.y,this}multiply(t){return this.x*=t.x,this.y*=t.y,this}multiplyScalar(t){return this.x*=t,this.y*=t,this}divide(t){return this.x/=t.x,this.y/=t.y,this}divideScalar(t){return this.multiplyScalar(1/t)}applyMatrix3(t){const n=this.x,i=this.y,r=t.elements;return this.x=r[0]*n+r[3]*i+r[6],this.y=r[1]*n+r[4]*i+r[7],this}min(t){return this.x=Math.min(this.x,t.x),this.y=Math.min(this.y,t.y),this}max(t){return this.x=Math.max(this.x,t.x),this.y=Math.max(this.y,t.y),this}clamp(t,n){return this.x=re(this.x,t.x,n.x),this.y=re(this.y,t.y,n.y),this}clampScalar(t,n){return this.x=re(this.x,t,n),this.y=re(this.y,t,n),this}clampLength(t,n){const i=this.length();return this.divideScalar(i||1).multiplyScalar(re(i,t,n))}floor(){return this.x=Math.floor(this.x),this.y=Math.floor(this.y),this}ceil(){return this.x=Math.ceil(this.x),this.y=Math.ceil(this.y),this}round(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this}roundToZero(){return this.x=Math.trunc(this.x),this.y=Math.trunc(this.y),this}negate(){return this.x=-this.x,this.y=-this.y,this}dot(t){return this.x*t.x+this.y*t.y}cross(t){return this.x*t.y-this.y*t.x}lengthSq(){return this.x*this.x+this.y*this.y}length(){return Math.sqrt(this.x*this.x+this.y*this.y)}manhattanLength(){return Math.abs(this.x)+Math.abs(this.y)}normalize(){return this.divideScalar(this.length()||1)}angle(){return Math.atan2(-this.y,-this.x)+Math.PI}angleTo(t){const n=Math.sqrt(this.lengthSq()*t.lengthSq());if(n===0)return Math.PI/2;const i=this.dot(t)/n;return Math.acos(re(i,-1,1))}distanceTo(t){return Math.sqrt(this.distanceToSquared(t))}distanceToSquared(t){const n=this.x-t.x,i=this.y-t.y;return n*n+i*i}manhattanDistanceTo(t){return Math.abs(this.x-t.x)+Math.abs(this.y-t.y)}setLength(t){return this.normalize().multiplyScalar(t)}lerp(t,n){return this.x+=(t.x-this.x)*n,this.y+=(t.y-this.y)*n,this}lerpVectors(t,n,i){return this.x=t.x+(n.x-t.x)*i,this.y=t.y+(n.y-t.y)*i,this}equals(t){return t.x===this.x&&t.y===this.y}fromArray(t,n=0){return this.x=t[n],this.y=t[n+1],this}toArray(t=[],n=0){return t[n]=this.x,t[n+1]=this.y,t}fromBufferAttribute(t,n){return this.x=t.getX(n),this.y=t.getY(n),this}rotateAround(t,n){const i=Math.cos(n),r=Math.sin(n),s=this.x-t.x,o=this.y-t.y;return this.x=s*i-o*r+t.x,this.y=s*r+o*i+t.y,this}random(){return this.x=Math.random(),this.y=Math.random(),this}*[Symbol.iterator](){yield this.x,yield this.y}}let nn=class{constructor(t=0,n=0,i=0,r=1){this.isQuaternion=!0,this._x=t,this._y=n,this._z=i,this._w=r}static slerpFlat(t,n,i,r,s,o,a){let l=i[r+0],c=i[r+1],u=i[r+2],h=i[r+3],f=s[o+0],p=s[o+1],g=s[o+2],_=s[o+3];if(a<=0){t[n+0]=l,t[n+1]=c,t[n+2]=u,t[n+3]=h;return}if(a>=1){t[n+0]=f,t[n+1]=p,t[n+2]=g,t[n+3]=_;return}if(h!==_||l!==f||c!==p||u!==g){let m=l*f+c*p+u*g+h*_;m<0&&(f=-f,p=-p,g=-g,_=-_,m=-m);let d=1-a;if(m<.9995){const S=Math.acos(m),x=Math.sin(S);d=Math.sin(d*S)/x,a=Math.sin(a*S)/x,l=l*d+f*a,c=c*d+p*a,u=u*d+g*a,h=h*d+_*a}else{l=l*d+f*a,c=c*d+p*a,u=u*d+g*a,h=h*d+_*a;const S=1/Math.sqrt(l*l+c*c+u*u+h*h);l*=S,c*=S,u*=S,h*=S}}t[n]=l,t[n+1]=c,t[n+2]=u,t[n+3]=h}static multiplyQuaternionsFlat(t,n,i,r,s,o){const a=i[r],l=i[r+1],c=i[r+2],u=i[r+3],h=s[o],f=s[o+1],p=s[o+2],g=s[o+3];return t[n]=a*g+u*h+l*p-c*f,t[n+1]=l*g+u*f+c*h-a*p,t[n+2]=c*g+u*p+a*f-l*h,t[n+3]=u*g-a*h-l*f-c*p,t}get x(){return this._x}set x(t){this._x=t,this._onChangeCallback()}get y(){return this._y}set y(t){this._y=t,this._onChangeCallback()}get z(){return this._z}set z(t){this._z=t,this._onChangeCallback()}get w(){return this._w}set w(t){this._w=t,this._onChangeCallback()}set(t,n,i,r){return this._x=t,this._y=n,this._z=i,this._w=r,this._onChangeCallback(),this}clone(){return new this.constructor(this._x,this._y,this._z,this._w)}copy(t){return this._x=t.x,this._y=t.y,this._z=t.z,this._w=t.w,this._onChangeCallback(),this}setFromEuler(t,n=!0){const i=t._x,r=t._y,s=t._z,o=t._order,a=Math.cos,l=Math.sin,c=a(i/2),u=a(r/2),h=a(s/2),f=l(i/2),p=l(r/2),g=l(s/2);switch(o){case"XYZ":this._x=f*u*h+c*p*g,this._y=c*p*h-f*u*g,this._z=c*u*g+f*p*h,this._w=c*u*h-f*p*g;break;case"YXZ":this._x=f*u*h+c*p*g,this._y=c*p*h-f*u*g,this._z=c*u*g-f*p*h,this._w=c*u*h+f*p*g;break;case"ZXY":this._x=f*u*h-c*p*g,this._y=c*p*h+f*u*g,this._z=c*u*g+f*p*h,this._w=c*u*h-f*p*g;break;case"ZYX":this._x=f*u*h-c*p*g,this._y=c*p*h+f*u*g,this._z=c*u*g-f*p*h,this._w=c*u*h+f*p*g;break;case"YZX":this._x=f*u*h+c*p*g,this._y=c*p*h+f*u*g,this._z=c*u*g-f*p*h,this._w=c*u*h-f*p*g;break;case"XZY":this._x=f*u*h-c*p*g,this._y=c*p*h-f*u*g,this._z=c*u*g+f*p*h,this._w=c*u*h+f*p*g;break;default:Yt("Quaternion: .setFromEuler() encountered an unknown order: "+o)}return n===!0&&this._onChangeCallback(),this}setFromAxisAngle(t,n){const i=n/2,r=Math.sin(i);return this._x=t.x*r,this._y=t.y*r,this._z=t.z*r,this._w=Math.cos(i),this._onChangeCallback(),this}setFromRotationMatrix(t){const n=t.elements,i=n[0],r=n[4],s=n[8],o=n[1],a=n[5],l=n[9],c=n[2],u=n[6],h=n[10],f=i+a+h;if(f>0){const p=.5/Math.sqrt(f+1);this._w=.25/p,this._x=(u-l)*p,this._y=(s-c)*p,this._z=(o-r)*p}else if(i>a&&i>h){const p=2*Math.sqrt(1+i-a-h);this._w=(u-l)/p,this._x=.25*p,this._y=(r+o)/p,this._z=(s+c)/p}else if(a>h){const p=2*Math.sqrt(1+a-i-h);this._w=(s-c)/p,this._x=(r+o)/p,this._y=.25*p,this._z=(l+u)/p}else{const p=2*Math.sqrt(1+h-i-a);this._w=(o-r)/p,this._x=(s+c)/p,this._y=(l+u)/p,this._z=.25*p}return this._onChangeCallback(),this}setFromUnitVectors(t,n){let i=t.dot(n)+1;return i<1e-8?(i=0,Math.abs(t.x)>Math.abs(t.z)?(this._x=-t.y,this._y=t.x,this._z=0,this._w=i):(this._x=0,this._y=-t.z,this._z=t.y,this._w=i)):(this._x=t.y*n.z-t.z*n.y,this._y=t.z*n.x-t.x*n.z,this._z=t.x*n.y-t.y*n.x,this._w=i),this.normalize()}angleTo(t){return 2*Math.acos(Math.abs(re(this.dot(t),-1,1)))}rotateTowards(t,n){const i=this.angleTo(t);if(i===0)return this;const r=Math.min(1,n/i);return this.slerp(t,r),this}identity(){return this.set(0,0,0,1)}invert(){return this.conjugate()}conjugate(){return this._x*=-1,this._y*=-1,this._z*=-1,this._onChangeCallback(),this}dot(t){return this._x*t._x+this._y*t._y+this._z*t._z+this._w*t._w}lengthSq(){return this._x*this._x+this._y*this._y+this._z*this._z+this._w*this._w}length(){return Math.sqrt(this._x*this._x+this._y*this._y+this._z*this._z+this._w*this._w)}normalize(){let t=this.length();return t===0?(this._x=0,this._y=0,this._z=0,this._w=1):(t=1/t,this._x=this._x*t,this._y=this._y*t,this._z=this._z*t,this._w=this._w*t),this._onChangeCallback(),this}multiply(t){return this.multiplyQuaternions(this,t)}premultiply(t){return this.multiplyQuaternions(t,this)}multiplyQuaternions(t,n){const i=t._x,r=t._y,s=t._z,o=t._w,a=n._x,l=n._y,c=n._z,u=n._w;return this._x=i*u+o*a+r*c-s*l,this._y=r*u+o*l+s*a-i*c,this._z=s*u+o*c+i*l-r*a,this._w=o*u-i*a-r*l-s*c,this._onChangeCallback(),this}slerp(t,n){if(n<=0)return this;if(n>=1)return this.copy(t);let i=t._x,r=t._y,s=t._z,o=t._w,a=this.dot(t);a<0&&(i=-i,r=-r,s=-s,o=-o,a=-a);let l=1-n;if(a<.9995){const c=Math.acos(a),u=Math.sin(c);l=Math.sin(l*c)/u,n=Math.sin(n*c)/u,this._x=this._x*l+i*n,this._y=this._y*l+r*n,this._z=this._z*l+s*n,this._w=this._w*l+o*n,this._onChangeCallback()}else this._x=this._x*l+i*n,this._y=this._y*l+r*n,this._z=this._z*l+s*n,this._w=this._w*l+o*n,this.normalize();return this}slerpQuaternions(t,n,i){return this.copy(t).slerp(n,i)}random(){const t=2*Math.PI*Math.random(),n=2*Math.PI*Math.random(),i=Math.random(),r=Math.sqrt(1-i),s=Math.sqrt(i);return this.set(r*Math.sin(t),r*Math.cos(t),s*Math.sin(n),s*Math.cos(n))}equals(t){return t._x===this._x&&t._y===this._y&&t._z===this._z&&t._w===this._w}fromArray(t,n=0){return this._x=t[n],this._y=t[n+1],this._z=t[n+2],this._w=t[n+3],this._onChangeCallback(),this}toArray(t=[],n=0){return t[n]=this._x,t[n+1]=this._y,t[n+2]=this._z,t[n+3]=this._w,t}fromBufferAttribute(t,n){return this._x=t.getX(n),this._y=t.getY(n),this._z=t.getZ(n),this._w=t.getW(n),this._onChangeCallback(),this}toJSON(){return this.toArray()}_onChange(t){return this._onChangeCallback=t,this}_onChangeCallback(){}*[Symbol.iterator](){yield this._x,yield this._y,yield this._z,yield this._w}};class D{constructor(t=0,n=0,i=0){D.prototype.isVector3=!0,this.x=t,this.y=n,this.z=i}set(t,n,i){return i===void 0&&(i=this.z),this.x=t,this.y=n,this.z=i,this}setScalar(t){return this.x=t,this.y=t,this.z=t,this}setX(t){return this.x=t,this}setY(t){return this.y=t,this}setZ(t){return this.z=t,this}setComponent(t,n){switch(t){case 0:this.x=n;break;case 1:this.y=n;break;case 2:this.z=n;break;default:throw new Error("index is out of range: "+t)}return this}getComponent(t){switch(t){case 0:return this.x;case 1:return this.y;case 2:return this.z;default:throw new Error("index is out of range: "+t)}}clone(){return new this.constructor(this.x,this.y,this.z)}copy(t){return this.x=t.x,this.y=t.y,this.z=t.z,this}add(t){return this.x+=t.x,this.y+=t.y,this.z+=t.z,this}addScalar(t){return this.x+=t,this.y+=t,this.z+=t,this}addVectors(t,n){return this.x=t.x+n.x,this.y=t.y+n.y,this.z=t.z+n.z,this}addScaledVector(t,n){return this.x+=t.x*n,this.y+=t.y*n,this.z+=t.z*n,this}sub(t){return this.x-=t.x,this.y-=t.y,this.z-=t.z,this}subScalar(t){return this.x-=t,this.y-=t,this.z-=t,this}subVectors(t,n){return this.x=t.x-n.x,this.y=t.y-n.y,this.z=t.z-n.z,this}multiply(t){return this.x*=t.x,this.y*=t.y,this.z*=t.z,this}multiplyScalar(t){return this.x*=t,this.y*=t,this.z*=t,this}multiplyVectors(t,n){return this.x=t.x*n.x,this.y=t.y*n.y,this.z=t.z*n.z,this}applyEuler(t){return this.applyQuaternion(Pp.setFromEuler(t))}applyAxisAngle(t,n){return this.applyQuaternion(Pp.setFromAxisAngle(t,n))}applyMatrix3(t){const n=this.x,i=this.y,r=this.z,s=t.elements;return this.x=s[0]*n+s[3]*i+s[6]*r,this.y=s[1]*n+s[4]*i+s[7]*r,this.z=s[2]*n+s[5]*i+s[8]*r,this}applyNormalMatrix(t){return this.applyMatrix3(t).normalize()}applyMatrix4(t){const n=this.x,i=this.y,r=this.z,s=t.elements,o=1/(s[3]*n+s[7]*i+s[11]*r+s[15]);return this.x=(s[0]*n+s[4]*i+s[8]*r+s[12])*o,this.y=(s[1]*n+s[5]*i+s[9]*r+s[13])*o,this.z=(s[2]*n+s[6]*i+s[10]*r+s[14])*o,this}applyQuaternion(t){const n=this.x,i=this.y,r=this.z,s=t.x,o=t.y,a=t.z,l=t.w,c=2*(o*r-a*i),u=2*(a*n-s*r),h=2*(s*i-o*n);return this.x=n+l*c+o*h-a*u,this.y=i+l*u+a*c-s*h,this.z=r+l*h+s*u-o*c,this}project(t){return this.applyMatrix4(t.matrixWorldInverse).applyMatrix4(t.projectionMatrix)}unproject(t){return this.applyMatrix4(t.projectionMatrixInverse).applyMatrix4(t.matrixWorld)}transformDirection(t){const n=this.x,i=this.y,r=this.z,s=t.elements;return this.x=s[0]*n+s[4]*i+s[8]*r,this.y=s[1]*n+s[5]*i+s[9]*r,this.z=s[2]*n+s[6]*i+s[10]*r,this.normalize()}divide(t){return this.x/=t.x,this.y/=t.y,this.z/=t.z,this}divideScalar(t){return this.multiplyScalar(1/t)}min(t){return this.x=Math.min(this.x,t.x),this.y=Math.min(this.y,t.y),this.z=Math.min(this.z,t.z),this}max(t){return this.x=Math.max(this.x,t.x),this.y=Math.max(this.y,t.y),this.z=Math.max(this.z,t.z),this}clamp(t,n){return this.x=re(this.x,t.x,n.x),this.y=re(this.y,t.y,n.y),this.z=re(this.z,t.z,n.z),this}clampScalar(t,n){return this.x=re(this.x,t,n),this.y=re(this.y,t,n),this.z=re(this.z,t,n),this}clampLength(t,n){const i=this.length();return this.divideScalar(i||1).multiplyScalar(re(i,t,n))}floor(){return this.x=Math.floor(this.x),this.y=Math.floor(this.y),this.z=Math.floor(this.z),this}ceil(){return this.x=Math.ceil(this.x),this.y=Math.ceil(this.y),this.z=Math.ceil(this.z),this}round(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this.z=Math.round(this.z),this}roundToZero(){return this.x=Math.trunc(this.x),this.y=Math.trunc(this.y),this.z=Math.trunc(this.z),this}negate(){return this.x=-this.x,this.y=-this.y,this.z=-this.z,this}dot(t){return this.x*t.x+this.y*t.y+this.z*t.z}lengthSq(){return this.x*this.x+this.y*this.y+this.z*this.z}length(){return Math.sqrt(this.x*this.x+this.y*this.y+this.z*this.z)}manhattanLength(){return Math.abs(this.x)+Math.abs(this.y)+Math.abs(this.z)}normalize(){return this.divideScalar(this.length()||1)}setLength(t){return this.normalize().multiplyScalar(t)}lerp(t,n){return this.x+=(t.x-this.x)*n,this.y+=(t.y-this.y)*n,this.z+=(t.z-this.z)*n,this}lerpVectors(t,n,i){return this.x=t.x+(n.x-t.x)*i,this.y=t.y+(n.y-t.y)*i,this.z=t.z+(n.z-t.z)*i,this}cross(t){return this.crossVectors(this,t)}crossVectors(t,n){const i=t.x,r=t.y,s=t.z,o=n.x,a=n.y,l=n.z;return this.x=r*l-s*a,this.y=s*o-i*l,this.z=i*a-r*o,this}projectOnVector(t){const n=t.lengthSq();if(n===0)return this.set(0,0,0);const i=t.dot(this)/n;return this.copy(t).multiplyScalar(i)}projectOnPlane(t){return cc.copy(this).projectOnVector(t),this.sub(cc)}reflect(t){return this.sub(cc.copy(t).multiplyScalar(2*this.dot(t)))}angleTo(t){const n=Math.sqrt(this.lengthSq()*t.lengthSq());if(n===0)return Math.PI/2;const i=this.dot(t)/n;return Math.acos(re(i,-1,1))}distanceTo(t){return Math.sqrt(this.distanceToSquared(t))}distanceToSquared(t){const n=this.x-t.x,i=this.y-t.y,r=this.z-t.z;return n*n+i*i+r*r}manhattanDistanceTo(t){return Math.abs(this.x-t.x)+Math.abs(this.y-t.y)+Math.abs(this.z-t.z)}setFromSpherical(t){return this.setFromSphericalCoords(t.radius,t.phi,t.theta)}setFromSphericalCoords(t,n,i){const r=Math.sin(n)*t;return this.x=r*Math.sin(i),this.y=Math.cos(n)*t,this.z=r*Math.cos(i),this}setFromCylindrical(t){return this.setFromCylindricalCoords(t.radius,t.theta,t.y)}setFromCylindricalCoords(t,n,i){return this.x=t*Math.sin(n),this.y=i,this.z=t*Math.cos(n),this}setFromMatrixPosition(t){const n=t.elements;return this.x=n[12],this.y=n[13],this.z=n[14],this}setFromMatrixScale(t){const n=this.setFromMatrixColumn(t,0).length(),i=this.setFromMatrixColumn(t,1).length(),r=this.setFromMatrixColumn(t,2).length();return this.x=n,this.y=i,this.z=r,this}setFromMatrixColumn(t,n){return this.fromArray(t.elements,n*4)}setFromMatrix3Column(t,n){return this.fromArray(t.elements,n*3)}setFromEuler(t){return this.x=t._x,this.y=t._y,this.z=t._z,this}setFromColor(t){return this.x=t.r,this.y=t.g,this.z=t.b,this}equals(t){return t.x===this.x&&t.y===this.y&&t.z===this.z}fromArray(t,n=0){return this.x=t[n],this.y=t[n+1],this.z=t[n+2],this}toArray(t=[],n=0){return t[n]=this.x,t[n+1]=this.y,t[n+2]=this.z,t}fromBufferAttribute(t,n){return this.x=t.getX(n),this.y=t.getY(n),this.z=t.getZ(n),this}random(){return this.x=Math.random(),this.y=Math.random(),this.z=Math.random(),this}randomDirection(){const t=Math.random()*Math.PI*2,n=Math.random()*2-1,i=Math.sqrt(1-n*n);return this.x=i*Math.cos(t),this.y=n,this.z=i*Math.sin(t),this}*[Symbol.iterator](){yield this.x,yield this.y,yield this.z}}const cc=new D,Pp=new nn;class ie{constructor(t,n,i,r,s,o,a,l,c){ie.prototype.isMatrix3=!0,this.elements=[1,0,0,0,1,0,0,0,1],t!==void 0&&this.set(t,n,i,r,s,o,a,l,c)}set(t,n,i,r,s,o,a,l,c){const u=this.elements;return u[0]=t,u[1]=r,u[2]=a,u[3]=n,u[4]=s,u[5]=l,u[6]=i,u[7]=o,u[8]=c,this}identity(){return this.set(1,0,0,0,1,0,0,0,1),this}copy(t){const n=this.elements,i=t.elements;return n[0]=i[0],n[1]=i[1],n[2]=i[2],n[3]=i[3],n[4]=i[4],n[5]=i[5],n[6]=i[6],n[7]=i[7],n[8]=i[8],this}extractBasis(t,n,i){return t.setFromMatrix3Column(this,0),n.setFromMatrix3Column(this,1),i.setFromMatrix3Column(this,2),this}setFromMatrix4(t){const n=t.elements;return this.set(n[0],n[4],n[8],n[1],n[5],n[9],n[2],n[6],n[10]),this}multiply(t){return this.multiplyMatrices(this,t)}premultiply(t){return this.multiplyMatrices(t,this)}multiplyMatrices(t,n){const i=t.elements,r=n.elements,s=this.elements,o=i[0],a=i[3],l=i[6],c=i[1],u=i[4],h=i[7],f=i[2],p=i[5],g=i[8],_=r[0],m=r[3],d=r[6],S=r[1],x=r[4],y=r[7],T=r[2],P=r[5],R=r[8];return s[0]=o*_+a*S+l*T,s[3]=o*m+a*x+l*P,s[6]=o*d+a*y+l*R,s[1]=c*_+u*S+h*T,s[4]=c*m+u*x+h*P,s[7]=c*d+u*y+h*R,s[2]=f*_+p*S+g*T,s[5]=f*m+p*x+g*P,s[8]=f*d+p*y+g*R,this}multiplyScalar(t){const n=this.elements;return n[0]*=t,n[3]*=t,n[6]*=t,n[1]*=t,n[4]*=t,n[7]*=t,n[2]*=t,n[5]*=t,n[8]*=t,this}determinant(){const t=this.elements,n=t[0],i=t[1],r=t[2],s=t[3],o=t[4],a=t[5],l=t[6],c=t[7],u=t[8];return n*o*u-n*a*c-i*s*u+i*a*l+r*s*c-r*o*l}invert(){const t=this.elements,n=t[0],i=t[1],r=t[2],s=t[3],o=t[4],a=t[5],l=t[6],c=t[7],u=t[8],h=u*o-a*c,f=a*l-u*s,p=c*s-o*l,g=n*h+i*f+r*p;if(g===0)return this.set(0,0,0,0,0,0,0,0,0);const _=1/g;return t[0]=h*_,t[1]=(r*c-u*i)*_,t[2]=(a*i-r*o)*_,t[3]=f*_,t[4]=(u*n-r*l)*_,t[5]=(r*s-a*n)*_,t[6]=p*_,t[7]=(i*l-c*n)*_,t[8]=(o*n-i*s)*_,this}transpose(){let t;const n=this.elements;return t=n[1],n[1]=n[3],n[3]=t,t=n[2],n[2]=n[6],n[6]=t,t=n[5],n[5]=n[7],n[7]=t,this}getNormalMatrix(t){return this.setFromMatrix4(t).invert().transpose()}transposeIntoArray(t){const n=this.elements;return t[0]=n[0],t[1]=n[3],t[2]=n[6],t[3]=n[1],t[4]=n[4],t[5]=n[7],t[6]=n[2],t[7]=n[5],t[8]=n[8],this}setUvTransform(t,n,i,r,s,o,a){const l=Math.cos(s),c=Math.sin(s);return this.set(i*l,i*c,-i*(l*o+c*a)+o+t,-r*c,r*l,-r*(-c*o+l*a)+a+n,0,0,1),this}scale(t,n){return this.premultiply(uc.makeScale(t,n)),this}rotate(t){return this.premultiply(uc.makeRotation(-t)),this}translate(t,n){return this.premultiply(uc.makeTranslation(t,n)),this}makeTranslation(t,n){return t.isVector2?this.set(1,0,t.x,0,1,t.y,0,0,1):this.set(1,0,t,0,1,n,0,0,1),this}makeRotation(t){const n=Math.cos(t),i=Math.sin(t);return this.set(n,-i,0,i,n,0,0,0,1),this}makeScale(t,n){return this.set(t,0,0,0,n,0,0,0,1),this}equals(t){const n=this.elements,i=t.elements;for(let r=0;r<9;r++)if(n[r]!==i[r])return!1;return!0}fromArray(t,n=0){for(let i=0;i<9;i++)this.elements[i]=t[i+n];return this}toArray(t=[],n=0){const i=this.elements;return t[n]=i[0],t[n+1]=i[1],t[n+2]=i[2],t[n+3]=i[3],t[n+4]=i[4],t[n+5]=i[5],t[n+6]=i[6],t[n+7]=i[7],t[n+8]=i[8],t}clone(){return new this.constructor().fromArray(this.elements)}}const uc=new ie,Cp=new ie().set(.4123908,.3575843,.1804808,.212639,.7151687,.0721923,.0193308,.1191948,.9505322),Rp=new ie().set(3.2409699,-1.5373832,-.4986108,-.9692436,1.8759675,.0415551,.0556301,-.203977,1.0569715);function rM(){const e={enabled:!0,workingColorSpace:zs,spaces:{},convert:function(r,s,o){return this.enabled===!1||s===o||!s||!o||(this.spaces[s].transfer===be&&(r.r=Hi(r.r),r.g=Hi(r.g),r.b=Hi(r.b)),this.spaces[s].primaries!==this.spaces[o].primaries&&(r.applyMatrix3(this.spaces[s].toXYZ),r.applyMatrix3(this.spaces[o].fromXYZ)),this.spaces[o].transfer===be&&(r.r=Ls(r.r),r.g=Ls(r.g),r.b=Ls(r.b))),r},workingToColorSpace:function(r,s){return this.convert(r,this.workingColorSpace,s)},colorSpaceToWorking:function(r,s){return this.convert(r,s,this.workingColorSpace)},getPrimaries:function(r){return this.spaces[r].primaries},getTransfer:function(r){return r===hr?dl:this.spaces[r].transfer},getToneMappingMode:function(r){return this.spaces[r].outputColorSpaceConfig.toneMappingMode||"standard"},getLuminanceCoefficients:function(r,s=this.workingColorSpace){return r.fromArray(this.spaces[s].luminanceCoefficients)},define:function(r){Object.assign(this.spaces,r)},_getMatrix:function(r,s,o){return r.copy(this.spaces[s].toXYZ).multiply(this.spaces[o].fromXYZ)},_getDrawingBufferColorSpace:function(r){return this.spaces[r].outputColorSpaceConfig.drawingBufferColorSpace},_getUnpackColorSpace:function(r=this.workingColorSpace){return this.spaces[r].workingColorSpaceConfig.unpackColorSpace},fromWorkingColorSpace:function(r,s){return Ho("ColorManagement: .fromWorkingColorSpace() has been renamed to .workingToColorSpace()."),e.workingToColorSpace(r,s)},toWorkingColorSpace:function(r,s){return Ho("ColorManagement: .toWorkingColorSpace() has been renamed to .colorSpaceToWorking()."),e.colorSpaceToWorking(r,s)}},t=[.64,.33,.3,.6,.15,.06],n=[.2126,.7152,.0722],i=[.3127,.329];return e.define({[zs]:{primaries:t,whitePoint:i,transfer:dl,toXYZ:Cp,fromXYZ:Rp,luminanceCoefficients:n,workingColorSpaceConfig:{unpackColorSpace:On},outputColorSpaceConfig:{drawingBufferColorSpace:On}},[On]:{primaries:t,whitePoint:i,transfer:be,toXYZ:Cp,fromXYZ:Rp,luminanceCoefficients:n,outputColorSpaceConfig:{drawingBufferColorSpace:On}}}),e}const me=rM();function Hi(e){return e<.04045?e*.0773993808:Math.pow(e*.9478672986+.0521327014,2.4)}function Ls(e){return e<.0031308?e*12.92:1.055*Math.pow(e,.41666)-.055}let os;class sM{static getDataURL(t,n="image/png"){if(/^data:/i.test(t.src)||typeof HTMLCanvasElement>"u")return t.src;let i;if(t instanceof HTMLCanvasElement)i=t;else{os===void 0&&(os=ml("canvas")),os.width=t.width,os.height=t.height;const r=os.getContext("2d");t instanceof ImageData?r.putImageData(t,0,0):r.drawImage(t,0,0,t.width,t.height),i=os}return i.toDataURL(n)}static sRGBToLinear(t){if(typeof HTMLImageElement<"u"&&t instanceof HTMLImageElement||typeof HTMLCanvasElement<"u"&&t instanceof HTMLCanvasElement||typeof ImageBitmap<"u"&&t instanceof ImageBitmap){const n=ml("canvas");n.width=t.width,n.height=t.height;const i=n.getContext("2d");i.drawImage(t,0,0,t.width,t.height);const r=i.getImageData(0,0,t.width,t.height),s=r.data;for(let o=0;o1),this.pmremVersion=0}get width(){return this.source.getSize(fc).x}get height(){return this.source.getSize(fc).y}get depth(){return this.source.getSize(fc).z}get image(){return this.source.data}set image(t=null){this.source.data=t}updateMatrix(){this.matrix.setUvTransform(this.offset.x,this.offset.y,this.repeat.x,this.repeat.y,this.rotation,this.center.x,this.center.y)}addUpdateRange(t,n){this.updateRanges.push({start:t,count:n})}clearUpdateRanges(){this.updateRanges.length=0}clone(){return new this.constructor().copy(this)}copy(t){return this.name=t.name,this.source=t.source,this.mipmaps=t.mipmaps.slice(0),this.mapping=t.mapping,this.channel=t.channel,this.wrapS=t.wrapS,this.wrapT=t.wrapT,this.magFilter=t.magFilter,this.minFilter=t.minFilter,this.anisotropy=t.anisotropy,this.format=t.format,this.internalFormat=t.internalFormat,this.type=t.type,this.offset.copy(t.offset),this.repeat.copy(t.repeat),this.center.copy(t.center),this.rotation=t.rotation,this.matrixAutoUpdate=t.matrixAutoUpdate,this.matrix.copy(t.matrix),this.generateMipmaps=t.generateMipmaps,this.premultiplyAlpha=t.premultiplyAlpha,this.flipY=t.flipY,this.unpackAlignment=t.unpackAlignment,this.colorSpace=t.colorSpace,this.renderTarget=t.renderTarget,this.isRenderTargetTexture=t.isRenderTargetTexture,this.isArrayTexture=t.isArrayTexture,this.userData=JSON.parse(JSON.stringify(t.userData)),this.needsUpdate=!0,this}setValues(t){for(const n in t){const i=t[n];if(i===void 0){Yt(`Texture.setValues(): parameter '${n}' has value of undefined.`);continue}const r=this[n];if(r===void 0){Yt(`Texture.setValues(): property '${n}' does not exist.`);continue}r&&i&&r.isVector2&&i.isVector2||r&&i&&r.isVector3&&i.isVector3||r&&i&&r.isMatrix3&&i.isMatrix3?r.copy(i):this[n]=i}}toJSON(t){const n=t===void 0||typeof t=="string";if(!n&&t.textures[this.uuid]!==void 0)return t.textures[this.uuid];const i={metadata:{version:4.7,type:"Texture",generator:"Texture.toJSON"},uuid:this.uuid,name:this.name,image:this.source.toJSON(t).uuid,mapping:this.mapping,channel:this.channel,repeat:[this.repeat.x,this.repeat.y],offset:[this.offset.x,this.offset.y],center:[this.center.x,this.center.y],rotation:this.rotation,wrap:[this.wrapS,this.wrapT],format:this.format,internalFormat:this.internalFormat,type:this.type,colorSpace:this.colorSpace,minFilter:this.minFilter,magFilter:this.magFilter,anisotropy:this.anisotropy,flipY:this.flipY,generateMipmaps:this.generateMipmaps,premultiplyAlpha:this.premultiplyAlpha,unpackAlignment:this.unpackAlignment};return Object.keys(this.userData).length>0&&(i.userData=this.userData),n||(t.textures[this.uuid]=i),i}dispose(){this.dispatchEvent({type:"dispose"})}transformUv(t){if(this.mapping!==z0)return t;if(t.applyMatrix3(this.matrix),t.x<0||t.x>1)switch(this.wrapS){case yu:t.x=t.x-Math.floor(t.x);break;case zi:t.x=t.x<0?0:1;break;case Su:Math.abs(Math.floor(t.x)%2)===1?t.x=Math.ceil(t.x)-t.x:t.x=t.x-Math.floor(t.x);break}if(t.y<0||t.y>1)switch(this.wrapT){case yu:t.y=t.y-Math.floor(t.y);break;case zi:t.y=t.y<0?0:1;break;case Su:Math.abs(Math.floor(t.y)%2)===1?t.y=Math.ceil(t.y)-t.y:t.y=t.y-Math.floor(t.y);break}return this.flipY&&(t.y=1-t.y),t}set needsUpdate(t){t===!0&&(this.version++,this.source.needsUpdate=!0)}set needsPMREMUpdate(t){t===!0&&this.pmremVersion++}}bn.DEFAULT_IMAGE=null;bn.DEFAULT_MAPPING=z0;bn.DEFAULT_ANISOTROPY=1;class ze{constructor(t=0,n=0,i=0,r=1){ze.prototype.isVector4=!0,this.x=t,this.y=n,this.z=i,this.w=r}get width(){return this.z}set width(t){this.z=t}get height(){return this.w}set height(t){this.w=t}set(t,n,i,r){return this.x=t,this.y=n,this.z=i,this.w=r,this}setScalar(t){return this.x=t,this.y=t,this.z=t,this.w=t,this}setX(t){return this.x=t,this}setY(t){return this.y=t,this}setZ(t){return this.z=t,this}setW(t){return this.w=t,this}setComponent(t,n){switch(t){case 0:this.x=n;break;case 1:this.y=n;break;case 2:this.z=n;break;case 3:this.w=n;break;default:throw new Error("index is out of range: "+t)}return this}getComponent(t){switch(t){case 0:return this.x;case 1:return this.y;case 2:return this.z;case 3:return this.w;default:throw new Error("index is out of range: "+t)}}clone(){return new this.constructor(this.x,this.y,this.z,this.w)}copy(t){return this.x=t.x,this.y=t.y,this.z=t.z,this.w=t.w!==void 0?t.w:1,this}add(t){return this.x+=t.x,this.y+=t.y,this.z+=t.z,this.w+=t.w,this}addScalar(t){return this.x+=t,this.y+=t,this.z+=t,this.w+=t,this}addVectors(t,n){return this.x=t.x+n.x,this.y=t.y+n.y,this.z=t.z+n.z,this.w=t.w+n.w,this}addScaledVector(t,n){return this.x+=t.x*n,this.y+=t.y*n,this.z+=t.z*n,this.w+=t.w*n,this}sub(t){return this.x-=t.x,this.y-=t.y,this.z-=t.z,this.w-=t.w,this}subScalar(t){return this.x-=t,this.y-=t,this.z-=t,this.w-=t,this}subVectors(t,n){return this.x=t.x-n.x,this.y=t.y-n.y,this.z=t.z-n.z,this.w=t.w-n.w,this}multiply(t){return this.x*=t.x,this.y*=t.y,this.z*=t.z,this.w*=t.w,this}multiplyScalar(t){return this.x*=t,this.y*=t,this.z*=t,this.w*=t,this}applyMatrix4(t){const n=this.x,i=this.y,r=this.z,s=this.w,o=t.elements;return this.x=o[0]*n+o[4]*i+o[8]*r+o[12]*s,this.y=o[1]*n+o[5]*i+o[9]*r+o[13]*s,this.z=o[2]*n+o[6]*i+o[10]*r+o[14]*s,this.w=o[3]*n+o[7]*i+o[11]*r+o[15]*s,this}divide(t){return this.x/=t.x,this.y/=t.y,this.z/=t.z,this.w/=t.w,this}divideScalar(t){return this.multiplyScalar(1/t)}setAxisAngleFromQuaternion(t){this.w=2*Math.acos(t.w);const n=Math.sqrt(1-t.w*t.w);return n<1e-4?(this.x=1,this.y=0,this.z=0):(this.x=t.x/n,this.y=t.y/n,this.z=t.z/n),this}setAxisAngleFromRotationMatrix(t){let n,i,r,s;const l=t.elements,c=l[0],u=l[4],h=l[8],f=l[1],p=l[5],g=l[9],_=l[2],m=l[6],d=l[10];if(Math.abs(u-f)<.01&&Math.abs(h-_)<.01&&Math.abs(g-m)<.01){if(Math.abs(u+f)<.1&&Math.abs(h+_)<.1&&Math.abs(g+m)<.1&&Math.abs(c+p+d-3)<.1)return this.set(1,0,0,0),this;n=Math.PI;const x=(c+1)/2,y=(p+1)/2,T=(d+1)/2,P=(u+f)/4,R=(h+_)/4,C=(g+m)/4;return x>y&&x>T?x<.01?(i=0,r=.707106781,s=.707106781):(i=Math.sqrt(x),r=P/i,s=R/i):y>T?y<.01?(i=.707106781,r=0,s=.707106781):(r=Math.sqrt(y),i=P/r,s=C/r):T<.01?(i=.707106781,r=.707106781,s=0):(s=Math.sqrt(T),i=R/s,r=C/s),this.set(i,r,s,n),this}let S=Math.sqrt((m-g)*(m-g)+(h-_)*(h-_)+(f-u)*(f-u));return Math.abs(S)<.001&&(S=1),this.x=(m-g)/S,this.y=(h-_)/S,this.z=(f-u)/S,this.w=Math.acos((c+p+d-1)/2),this}setFromMatrixPosition(t){const n=t.elements;return this.x=n[12],this.y=n[13],this.z=n[14],this.w=n[15],this}min(t){return this.x=Math.min(this.x,t.x),this.y=Math.min(this.y,t.y),this.z=Math.min(this.z,t.z),this.w=Math.min(this.w,t.w),this}max(t){return this.x=Math.max(this.x,t.x),this.y=Math.max(this.y,t.y),this.z=Math.max(this.z,t.z),this.w=Math.max(this.w,t.w),this}clamp(t,n){return this.x=re(this.x,t.x,n.x),this.y=re(this.y,t.y,n.y),this.z=re(this.z,t.z,n.z),this.w=re(this.w,t.w,n.w),this}clampScalar(t,n){return this.x=re(this.x,t,n),this.y=re(this.y,t,n),this.z=re(this.z,t,n),this.w=re(this.w,t,n),this}clampLength(t,n){const i=this.length();return this.divideScalar(i||1).multiplyScalar(re(i,t,n))}floor(){return this.x=Math.floor(this.x),this.y=Math.floor(this.y),this.z=Math.floor(this.z),this.w=Math.floor(this.w),this}ceil(){return this.x=Math.ceil(this.x),this.y=Math.ceil(this.y),this.z=Math.ceil(this.z),this.w=Math.ceil(this.w),this}round(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this.z=Math.round(this.z),this.w=Math.round(this.w),this}roundToZero(){return this.x=Math.trunc(this.x),this.y=Math.trunc(this.y),this.z=Math.trunc(this.z),this.w=Math.trunc(this.w),this}negate(){return this.x=-this.x,this.y=-this.y,this.z=-this.z,this.w=-this.w,this}dot(t){return this.x*t.x+this.y*t.y+this.z*t.z+this.w*t.w}lengthSq(){return this.x*this.x+this.y*this.y+this.z*this.z+this.w*this.w}length(){return Math.sqrt(this.x*this.x+this.y*this.y+this.z*this.z+this.w*this.w)}manhattanLength(){return Math.abs(this.x)+Math.abs(this.y)+Math.abs(this.z)+Math.abs(this.w)}normalize(){return this.divideScalar(this.length()||1)}setLength(t){return this.normalize().multiplyScalar(t)}lerp(t,n){return this.x+=(t.x-this.x)*n,this.y+=(t.y-this.y)*n,this.z+=(t.z-this.z)*n,this.w+=(t.w-this.w)*n,this}lerpVectors(t,n,i){return this.x=t.x+(n.x-t.x)*i,this.y=t.y+(n.y-t.y)*i,this.z=t.z+(n.z-t.z)*i,this.w=t.w+(n.w-t.w)*i,this}equals(t){return t.x===this.x&&t.y===this.y&&t.z===this.z&&t.w===this.w}fromArray(t,n=0){return this.x=t[n],this.y=t[n+1],this.z=t[n+2],this.w=t[n+3],this}toArray(t=[],n=0){return t[n]=this.x,t[n+1]=this.y,t[n+2]=this.z,t[n+3]=this.w,t}fromBufferAttribute(t,n){return this.x=t.getX(n),this.y=t.getY(n),this.z=t.getZ(n),this.w=t.getW(n),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 lM extends jr{constructor(t=1,n=1,i={}){super(),i=Object.assign({generateMipmaps:!1,internalFormat:null,minFilter:fn,depthBuffer:!0,stencilBuffer:!1,resolveDepthBuffer:!0,resolveStencilBuffer:!0,depthTexture:null,samples:0,count:1,depth:1,multiview:!1},i),this.isRenderTarget=!0,this.width=t,this.height=n,this.depth=i.depth,this.scissor=new ze(0,0,t,n),this.scissorTest=!1,this.viewport=new ze(0,0,t,n);const r={width:t,height:n,depth:i.depth},s=new bn(r);this.textures=[];const o=i.count;for(let a=0;a1);this.dispose()}this.viewport.set(0,0,t,n),this.scissor.set(0,0,t,n)}clone(){return new this.constructor().copy(this)}copy(t){this.width=t.width,this.height=t.height,this.depth=t.depth,this.scissor.copy(t.scissor),this.scissorTest=t.scissorTest,this.viewport.copy(t.viewport),this.textures.length=0;for(let n=0,i=t.textures.length;n=this.min.x&&t.x<=this.max.x&&t.y>=this.min.y&&t.y<=this.max.y&&t.z>=this.min.z&&t.z<=this.max.z}containsBox(t){return this.min.x<=t.min.x&&t.max.x<=this.max.x&&this.min.y<=t.min.y&&t.max.y<=this.max.y&&this.min.z<=t.min.z&&t.max.z<=this.max.z}getParameter(t,n){return n.set((t.x-this.min.x)/(this.max.x-this.min.x),(t.y-this.min.y)/(this.max.y-this.min.y),(t.z-this.min.z)/(this.max.z-this.min.z))}intersectsBox(t){return t.max.x>=this.min.x&&t.min.x<=this.max.x&&t.max.y>=this.min.y&&t.min.y<=this.max.y&&t.max.z>=this.min.z&&t.min.z<=this.max.z}intersectsSphere(t){return this.clampPoint(t.center,Jn),Jn.distanceToSquared(t.center)<=t.radius*t.radius}intersectsPlane(t){let n,i;return t.normal.x>0?(n=t.normal.x*this.min.x,i=t.normal.x*this.max.x):(n=t.normal.x*this.max.x,i=t.normal.x*this.min.x),t.normal.y>0?(n+=t.normal.y*this.min.y,i+=t.normal.y*this.max.y):(n+=t.normal.y*this.max.y,i+=t.normal.y*this.min.y),t.normal.z>0?(n+=t.normal.z*this.min.z,i+=t.normal.z*this.max.z):(n+=t.normal.z*this.max.z,i+=t.normal.z*this.min.z),n<=-t.constant&&i>=-t.constant}intersectsTriangle(t){if(this.isEmpty())return!1;this.getCenter(ro),da.subVectors(this.max,ro),as.subVectors(t.a,ro),ls.subVectors(t.b,ro),cs.subVectors(t.c,ro),Qi.subVectors(ls,as),ji.subVectors(cs,ls),Pr.subVectors(as,cs);let n=[0,-Qi.z,Qi.y,0,-ji.z,ji.y,0,-Pr.z,Pr.y,Qi.z,0,-Qi.x,ji.z,0,-ji.x,Pr.z,0,-Pr.x,-Qi.y,Qi.x,0,-ji.y,ji.x,0,-Pr.y,Pr.x,0];return!dc(n,as,ls,cs,da)||(n=[1,0,0,0,1,0,0,0,1],!dc(n,as,ls,cs,da))?!1:(pa.crossVectors(Qi,ji),n=[pa.x,pa.y,pa.z],dc(n,as,ls,cs,da))}clampPoint(t,n){return n.copy(t).clamp(this.min,this.max)}distanceToPoint(t){return this.clampPoint(t,Jn).distanceTo(t)}getBoundingSphere(t){return this.isEmpty()?t.makeEmpty():(this.getCenter(t.center),t.radius=this.getSize(Jn).length()*.5),t}intersect(t){return this.min.max(t.min),this.max.min(t.max),this.isEmpty()&&this.makeEmpty(),this}union(t){return this.min.min(t.min),this.max.max(t.max),this}applyMatrix4(t){return this.isEmpty()?this:(Ci[0].set(this.min.x,this.min.y,this.min.z).applyMatrix4(t),Ci[1].set(this.min.x,this.min.y,this.max.z).applyMatrix4(t),Ci[2].set(this.min.x,this.max.y,this.min.z).applyMatrix4(t),Ci[3].set(this.min.x,this.max.y,this.max.z).applyMatrix4(t),Ci[4].set(this.max.x,this.min.y,this.min.z).applyMatrix4(t),Ci[5].set(this.max.x,this.min.y,this.max.z).applyMatrix4(t),Ci[6].set(this.max.x,this.max.y,this.min.z).applyMatrix4(t),Ci[7].set(this.max.x,this.max.y,this.max.z).applyMatrix4(t),this.setFromPoints(Ci),this)}translate(t){return this.min.add(t),this.max.add(t),this}equals(t){return t.min.equals(this.min)&&t.max.equals(this.max)}toJSON(){return{min:this.min.toArray(),max:this.max.toArray()}}fromJSON(t){return this.min.fromArray(t.min),this.max.fromArray(t.max),this}}const Ci=[new D,new D,new D,new D,new D,new D,new D,new D],Jn=new D,fa=new Ko,as=new D,ls=new D,cs=new D,Qi=new D,ji=new D,Pr=new D,ro=new D,da=new D,pa=new D,Cr=new D;function dc(e,t,n,i,r){for(let s=0,o=e.length-3;s<=o;s+=3){Cr.fromArray(e,s);const a=r.x*Math.abs(Cr.x)+r.y*Math.abs(Cr.y)+r.z*Math.abs(Cr.z),l=t.dot(Cr),c=n.dot(Cr),u=i.dot(Cr);if(Math.max(-Math.max(l,c,u),Math.min(l,c,u))>a)return!1}return!0}const uM=new Ko,so=new D,pc=new D;let Qo=class{constructor(t=new D,n=-1){this.isSphere=!0,this.center=t,this.radius=n}set(t,n){return this.center.copy(t),this.radius=n,this}setFromPoints(t,n){const i=this.center;n!==void 0?i.copy(n):uM.setFromPoints(t).getCenter(i);let r=0;for(let s=0,o=t.length;sthis.radius*this.radius&&(n.sub(this.center).normalize(),n.multiplyScalar(this.radius).add(this.center)),n}getBoundingBox(t){return this.isEmpty()?(t.makeEmpty(),t):(t.set(this.center,this.center),t.expandByScalar(this.radius),t)}applyMatrix4(t){return this.center.applyMatrix4(t),this.radius=this.radius*t.getMaxScaleOnAxis(),this}translate(t){return this.center.add(t),this}expandByPoint(t){if(this.isEmpty())return this.center.copy(t),this.radius=0,this;so.subVectors(t,this.center);const n=so.lengthSq();if(n>this.radius*this.radius){const i=Math.sqrt(n),r=(i-this.radius)*.5;this.center.addScaledVector(so,r/i),this.radius+=r}return this}union(t){return t.isEmpty()?this:this.isEmpty()?(this.copy(t),this):(this.center.equals(t.center)===!0?this.radius=Math.max(this.radius,t.radius):(pc.subVectors(t.center,this.center).setLength(t.radius),this.expandByPoint(so.copy(t.center).add(pc)),this.expandByPoint(so.copy(t.center).sub(pc))),this)}equals(t){return t.center.equals(this.center)&&t.radius===this.radius}clone(){return new this.constructor().copy(this)}toJSON(){return{radius:this.radius,center:this.center.toArray()}}fromJSON(t){return this.radius=t.radius,this.center.fromArray(t.center),this}};const Ri=new D,mc=new D,ma=new D,tr=new D,gc=new D,ga=new D,_c=new D;class jo{constructor(t=new D,n=new D(0,0,-1)){this.origin=t,this.direction=n}set(t,n){return this.origin.copy(t),this.direction.copy(n),this}copy(t){return this.origin.copy(t.origin),this.direction.copy(t.direction),this}at(t,n){return n.copy(this.origin).addScaledVector(this.direction,t)}lookAt(t){return this.direction.copy(t).sub(this.origin).normalize(),this}recast(t){return this.origin.copy(this.at(t,Ri)),this}closestPointToPoint(t,n){n.subVectors(t,this.origin);const i=n.dot(this.direction);return i<0?n.copy(this.origin):n.copy(this.origin).addScaledVector(this.direction,i)}distanceToPoint(t){return Math.sqrt(this.distanceSqToPoint(t))}distanceSqToPoint(t){const n=Ri.subVectors(t,this.origin).dot(this.direction);return n<0?this.origin.distanceToSquared(t):(Ri.copy(this.origin).addScaledVector(this.direction,n),Ri.distanceToSquared(t))}distanceSqToSegment(t,n,i,r){mc.copy(t).add(n).multiplyScalar(.5),ma.copy(n).sub(t).normalize(),tr.copy(this.origin).sub(mc);const s=t.distanceTo(n)*.5,o=-this.direction.dot(ma),a=tr.dot(this.direction),l=-tr.dot(ma),c=tr.lengthSq(),u=Math.abs(1-o*o);let h,f,p,g;if(u>0)if(h=o*l-a,f=o*a-l,g=s*u,h>=0)if(f>=-g)if(f<=g){const _=1/u;h*=_,f*=_,p=h*(h+o*f+2*a)+f*(o*h+f+2*l)+c}else f=s,h=Math.max(0,-(o*f+a)),p=-h*h+f*(f+2*l)+c;else f=-s,h=Math.max(0,-(o*f+a)),p=-h*h+f*(f+2*l)+c;else f<=-g?(h=Math.max(0,-(-o*s+a)),f=h>0?-s:Math.min(Math.max(-s,-l),s),p=-h*h+f*(f+2*l)+c):f<=g?(h=0,f=Math.min(Math.max(-s,-l),s),p=f*(f+2*l)+c):(h=Math.max(0,-(o*s+a)),f=h>0?s:Math.min(Math.max(-s,-l),s),p=-h*h+f*(f+2*l)+c);else f=o>0?-s:s,h=Math.max(0,-(o*f+a)),p=-h*h+f*(f+2*l)+c;return i&&i.copy(this.origin).addScaledVector(this.direction,h),r&&r.copy(mc).addScaledVector(ma,f),p}intersectSphere(t,n){Ri.subVectors(t.center,this.origin);const i=Ri.dot(this.direction),r=Ri.dot(Ri)-i*i,s=t.radius*t.radius;if(r>s)return null;const o=Math.sqrt(s-r),a=i-o,l=i+o;return l<0?null:a<0?this.at(l,n):this.at(a,n)}intersectsSphere(t){return t.radius<0?!1:this.distanceSqToPoint(t.center)<=t.radius*t.radius}distanceToPlane(t){const n=t.normal.dot(this.direction);if(n===0)return t.distanceToPoint(this.origin)===0?0:null;const i=-(this.origin.dot(t.normal)+t.constant)/n;return i>=0?i:null}intersectPlane(t,n){const i=this.distanceToPlane(t);return i===null?null:this.at(i,n)}intersectsPlane(t){const n=t.distanceToPoint(this.origin);return n===0||t.normal.dot(this.direction)*n<0}intersectBox(t,n){let i,r,s,o,a,l;const c=1/this.direction.x,u=1/this.direction.y,h=1/this.direction.z,f=this.origin;return c>=0?(i=(t.min.x-f.x)*c,r=(t.max.x-f.x)*c):(i=(t.max.x-f.x)*c,r=(t.min.x-f.x)*c),u>=0?(s=(t.min.y-f.y)*u,o=(t.max.y-f.y)*u):(s=(t.max.y-f.y)*u,o=(t.min.y-f.y)*u),i>o||s>r||((s>i||isNaN(i))&&(i=s),(o=0?(a=(t.min.z-f.z)*h,l=(t.max.z-f.z)*h):(a=(t.max.z-f.z)*h,l=(t.min.z-f.z)*h),i>l||a>r)||((a>i||i!==i)&&(i=a),(l=0?i:r,n)}intersectsBox(t){return this.intersectBox(t,Ri)!==null}intersectTriangle(t,n,i,r,s){gc.subVectors(n,t),ga.subVectors(i,t),_c.crossVectors(gc,ga);let o=this.direction.dot(_c),a;if(o>0){if(r)return null;a=1}else if(o<0)a=-1,o=-o;else return null;tr.subVectors(this.origin,t);const l=a*this.direction.dot(ga.crossVectors(tr,ga));if(l<0)return null;const c=a*this.direction.dot(gc.cross(tr));if(c<0||l+c>o)return null;const u=-a*tr.dot(_c);return u<0?null:this.at(u/o,s)}applyMatrix4(t){return this.origin.applyMatrix4(t),this.direction.transformDirection(t),this}equals(t){return t.origin.equals(this.origin)&&t.direction.equals(this.direction)}clone(){return new this.constructor().copy(this)}}class he{constructor(t,n,i,r,s,o,a,l,c,u,h,f,p,g,_,m){he.prototype.isMatrix4=!0,this.elements=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1],t!==void 0&&this.set(t,n,i,r,s,o,a,l,c,u,h,f,p,g,_,m)}set(t,n,i,r,s,o,a,l,c,u,h,f,p,g,_,m){const d=this.elements;return d[0]=t,d[4]=n,d[8]=i,d[12]=r,d[1]=s,d[5]=o,d[9]=a,d[13]=l,d[2]=c,d[6]=u,d[10]=h,d[14]=f,d[3]=p,d[7]=g,d[11]=_,d[15]=m,this}identity(){return this.set(1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1),this}clone(){return new he().fromArray(this.elements)}copy(t){const n=this.elements,i=t.elements;return n[0]=i[0],n[1]=i[1],n[2]=i[2],n[3]=i[3],n[4]=i[4],n[5]=i[5],n[6]=i[6],n[7]=i[7],n[8]=i[8],n[9]=i[9],n[10]=i[10],n[11]=i[11],n[12]=i[12],n[13]=i[13],n[14]=i[14],n[15]=i[15],this}copyPosition(t){const n=this.elements,i=t.elements;return n[12]=i[12],n[13]=i[13],n[14]=i[14],this}setFromMatrix3(t){const n=t.elements;return this.set(n[0],n[3],n[6],0,n[1],n[4],n[7],0,n[2],n[5],n[8],0,0,0,0,1),this}extractBasis(t,n,i){return this.determinant()===0?(t.set(1,0,0),n.set(0,1,0),i.set(0,0,1),this):(t.setFromMatrixColumn(this,0),n.setFromMatrixColumn(this,1),i.setFromMatrixColumn(this,2),this)}makeBasis(t,n,i){return this.set(t.x,n.x,i.x,0,t.y,n.y,i.y,0,t.z,n.z,i.z,0,0,0,0,1),this}extractRotation(t){if(t.determinant()===0)return this.identity();const n=this.elements,i=t.elements,r=1/us.setFromMatrixColumn(t,0).length(),s=1/us.setFromMatrixColumn(t,1).length(),o=1/us.setFromMatrixColumn(t,2).length();return n[0]=i[0]*r,n[1]=i[1]*r,n[2]=i[2]*r,n[3]=0,n[4]=i[4]*s,n[5]=i[5]*s,n[6]=i[6]*s,n[7]=0,n[8]=i[8]*o,n[9]=i[9]*o,n[10]=i[10]*o,n[11]=0,n[12]=0,n[13]=0,n[14]=0,n[15]=1,this}makeRotationFromEuler(t){const n=this.elements,i=t.x,r=t.y,s=t.z,o=Math.cos(i),a=Math.sin(i),l=Math.cos(r),c=Math.sin(r),u=Math.cos(s),h=Math.sin(s);if(t.order==="XYZ"){const f=o*u,p=o*h,g=a*u,_=a*h;n[0]=l*u,n[4]=-l*h,n[8]=c,n[1]=p+g*c,n[5]=f-_*c,n[9]=-a*l,n[2]=_-f*c,n[6]=g+p*c,n[10]=o*l}else if(t.order==="YXZ"){const f=l*u,p=l*h,g=c*u,_=c*h;n[0]=f+_*a,n[4]=g*a-p,n[8]=o*c,n[1]=o*h,n[5]=o*u,n[9]=-a,n[2]=p*a-g,n[6]=_+f*a,n[10]=o*l}else if(t.order==="ZXY"){const f=l*u,p=l*h,g=c*u,_=c*h;n[0]=f-_*a,n[4]=-o*h,n[8]=g+p*a,n[1]=p+g*a,n[5]=o*u,n[9]=_-f*a,n[2]=-o*c,n[6]=a,n[10]=o*l}else if(t.order==="ZYX"){const f=o*u,p=o*h,g=a*u,_=a*h;n[0]=l*u,n[4]=g*c-p,n[8]=f*c+_,n[1]=l*h,n[5]=_*c+f,n[9]=p*c-g,n[2]=-c,n[6]=a*l,n[10]=o*l}else if(t.order==="YZX"){const f=o*l,p=o*c,g=a*l,_=a*c;n[0]=l*u,n[4]=_-f*h,n[8]=g*h+p,n[1]=h,n[5]=o*u,n[9]=-a*u,n[2]=-c*u,n[6]=p*h+g,n[10]=f-_*h}else if(t.order==="XZY"){const f=o*l,p=o*c,g=a*l,_=a*c;n[0]=l*u,n[4]=-h,n[8]=c*u,n[1]=f*h+_,n[5]=o*u,n[9]=p*h-g,n[2]=g*h-p,n[6]=a*u,n[10]=_*h+f}return n[3]=0,n[7]=0,n[11]=0,n[12]=0,n[13]=0,n[14]=0,n[15]=1,this}makeRotationFromQuaternion(t){return this.compose(hM,t,fM)}lookAt(t,n,i){const r=this.elements;return Nn.subVectors(t,n),Nn.lengthSq()===0&&(Nn.z=1),Nn.normalize(),er.crossVectors(i,Nn),er.lengthSq()===0&&(Math.abs(i.z)===1?Nn.x+=1e-4:Nn.z+=1e-4,Nn.normalize(),er.crossVectors(i,Nn)),er.normalize(),_a.crossVectors(Nn,er),r[0]=er.x,r[4]=_a.x,r[8]=Nn.x,r[1]=er.y,r[5]=_a.y,r[9]=Nn.y,r[2]=er.z,r[6]=_a.z,r[10]=Nn.z,this}multiply(t){return this.multiplyMatrices(this,t)}premultiply(t){return this.multiplyMatrices(t,this)}multiplyMatrices(t,n){const i=t.elements,r=n.elements,s=this.elements,o=i[0],a=i[4],l=i[8],c=i[12],u=i[1],h=i[5],f=i[9],p=i[13],g=i[2],_=i[6],m=i[10],d=i[14],S=i[3],x=i[7],y=i[11],T=i[15],P=r[0],R=r[4],C=r[8],b=r[12],M=r[1],L=r[5],V=r[9],q=r[13],j=r[2],J=r[6],W=r[10],k=r[14],H=r[3],ct=r[7],pt=r[11],ft=r[15];return s[0]=o*P+a*M+l*j+c*H,s[4]=o*R+a*L+l*J+c*ct,s[8]=o*C+a*V+l*W+c*pt,s[12]=o*b+a*q+l*k+c*ft,s[1]=u*P+h*M+f*j+p*H,s[5]=u*R+h*L+f*J+p*ct,s[9]=u*C+h*V+f*W+p*pt,s[13]=u*b+h*q+f*k+p*ft,s[2]=g*P+_*M+m*j+d*H,s[6]=g*R+_*L+m*J+d*ct,s[10]=g*C+_*V+m*W+d*pt,s[14]=g*b+_*q+m*k+d*ft,s[3]=S*P+x*M+y*j+T*H,s[7]=S*R+x*L+y*J+T*ct,s[11]=S*C+x*V+y*W+T*pt,s[15]=S*b+x*q+y*k+T*ft,this}multiplyScalar(t){const n=this.elements;return n[0]*=t,n[4]*=t,n[8]*=t,n[12]*=t,n[1]*=t,n[5]*=t,n[9]*=t,n[13]*=t,n[2]*=t,n[6]*=t,n[10]*=t,n[14]*=t,n[3]*=t,n[7]*=t,n[11]*=t,n[15]*=t,this}determinant(){const t=this.elements,n=t[0],i=t[4],r=t[8],s=t[12],o=t[1],a=t[5],l=t[9],c=t[13],u=t[2],h=t[6],f=t[10],p=t[14],g=t[3],_=t[7],m=t[11],d=t[15],S=l*p-c*f,x=a*p-c*h,y=a*f-l*h,T=o*p-c*u,P=o*f-l*u,R=o*h-a*u;return n*(_*S-m*x+d*y)-i*(g*S-m*T+d*P)+r*(g*x-_*T+d*R)-s*(g*y-_*P+m*R)}transpose(){const t=this.elements;let n;return n=t[1],t[1]=t[4],t[4]=n,n=t[2],t[2]=t[8],t[8]=n,n=t[6],t[6]=t[9],t[9]=n,n=t[3],t[3]=t[12],t[12]=n,n=t[7],t[7]=t[13],t[13]=n,n=t[11],t[11]=t[14],t[14]=n,this}setPosition(t,n,i){const r=this.elements;return t.isVector3?(r[12]=t.x,r[13]=t.y,r[14]=t.z):(r[12]=t,r[13]=n,r[14]=i),this}invert(){const t=this.elements,n=t[0],i=t[1],r=t[2],s=t[3],o=t[4],a=t[5],l=t[6],c=t[7],u=t[8],h=t[9],f=t[10],p=t[11],g=t[12],_=t[13],m=t[14],d=t[15],S=h*m*c-_*f*c+_*l*p-a*m*p-h*l*d+a*f*d,x=g*f*c-u*m*c-g*l*p+o*m*p+u*l*d-o*f*d,y=u*_*c-g*h*c+g*a*p-o*_*p-u*a*d+o*h*d,T=g*h*l-u*_*l-g*a*f+o*_*f+u*a*m-o*h*m,P=n*S+i*x+r*y+s*T;if(P===0)return this.set(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0);const R=1/P;return t[0]=S*R,t[1]=(_*f*s-h*m*s-_*r*p+i*m*p+h*r*d-i*f*d)*R,t[2]=(a*m*s-_*l*s+_*r*c-i*m*c-a*r*d+i*l*d)*R,t[3]=(h*l*s-a*f*s-h*r*c+i*f*c+a*r*p-i*l*p)*R,t[4]=x*R,t[5]=(u*m*s-g*f*s+g*r*p-n*m*p-u*r*d+n*f*d)*R,t[6]=(g*l*s-o*m*s-g*r*c+n*m*c+o*r*d-n*l*d)*R,t[7]=(o*f*s-u*l*s+u*r*c-n*f*c-o*r*p+n*l*p)*R,t[8]=y*R,t[9]=(g*h*s-u*_*s-g*i*p+n*_*p+u*i*d-n*h*d)*R,t[10]=(o*_*s-g*a*s+g*i*c-n*_*c-o*i*d+n*a*d)*R,t[11]=(u*a*s-o*h*s-u*i*c+n*h*c+o*i*p-n*a*p)*R,t[12]=T*R,t[13]=(u*_*r-g*h*r+g*i*f-n*_*f-u*i*m+n*h*m)*R,t[14]=(g*a*r-o*_*r-g*i*l+n*_*l+o*i*m-n*a*m)*R,t[15]=(o*h*r-u*a*r+u*i*l-n*h*l-o*i*f+n*a*f)*R,this}scale(t){const n=this.elements,i=t.x,r=t.y,s=t.z;return n[0]*=i,n[4]*=r,n[8]*=s,n[1]*=i,n[5]*=r,n[9]*=s,n[2]*=i,n[6]*=r,n[10]*=s,n[3]*=i,n[7]*=r,n[11]*=s,this}getMaxScaleOnAxis(){const t=this.elements,n=t[0]*t[0]+t[1]*t[1]+t[2]*t[2],i=t[4]*t[4]+t[5]*t[5]+t[6]*t[6],r=t[8]*t[8]+t[9]*t[9]+t[10]*t[10];return Math.sqrt(Math.max(n,i,r))}makeTranslation(t,n,i){return t.isVector3?this.set(1,0,0,t.x,0,1,0,t.y,0,0,1,t.z,0,0,0,1):this.set(1,0,0,t,0,1,0,n,0,0,1,i,0,0,0,1),this}makeRotationX(t){const n=Math.cos(t),i=Math.sin(t);return this.set(1,0,0,0,0,n,-i,0,0,i,n,0,0,0,0,1),this}makeRotationY(t){const n=Math.cos(t),i=Math.sin(t);return this.set(n,0,i,0,0,1,0,0,-i,0,n,0,0,0,0,1),this}makeRotationZ(t){const n=Math.cos(t),i=Math.sin(t);return this.set(n,-i,0,0,i,n,0,0,0,0,1,0,0,0,0,1),this}makeRotationAxis(t,n){const i=Math.cos(n),r=Math.sin(n),s=1-i,o=t.x,a=t.y,l=t.z,c=s*o,u=s*a;return this.set(c*o+i,c*a-r*l,c*l+r*a,0,c*a+r*l,u*a+i,u*l-r*o,0,c*l-r*a,u*l+r*o,s*l*l+i,0,0,0,0,1),this}makeScale(t,n,i){return this.set(t,0,0,0,0,n,0,0,0,0,i,0,0,0,0,1),this}makeShear(t,n,i,r,s,o){return this.set(1,i,s,0,t,1,o,0,n,r,1,0,0,0,0,1),this}compose(t,n,i){const r=this.elements,s=n._x,o=n._y,a=n._z,l=n._w,c=s+s,u=o+o,h=a+a,f=s*c,p=s*u,g=s*h,_=o*u,m=o*h,d=a*h,S=l*c,x=l*u,y=l*h,T=i.x,P=i.y,R=i.z;return r[0]=(1-(_+d))*T,r[1]=(p+y)*T,r[2]=(g-x)*T,r[3]=0,r[4]=(p-y)*P,r[5]=(1-(f+d))*P,r[6]=(m+S)*P,r[7]=0,r[8]=(g+x)*R,r[9]=(m-S)*R,r[10]=(1-(f+_))*R,r[11]=0,r[12]=t.x,r[13]=t.y,r[14]=t.z,r[15]=1,this}decompose(t,n,i){const r=this.elements;if(t.x=r[12],t.y=r[13],t.z=r[14],this.determinant()===0)return i.set(1,1,1),n.identity(),this;let s=us.set(r[0],r[1],r[2]).length();const o=us.set(r[4],r[5],r[6]).length(),a=us.set(r[8],r[9],r[10]).length();this.determinant()<0&&(s=-s),$n.copy(this);const c=1/s,u=1/o,h=1/a;return $n.elements[0]*=c,$n.elements[1]*=c,$n.elements[2]*=c,$n.elements[4]*=u,$n.elements[5]*=u,$n.elements[6]*=u,$n.elements[8]*=h,$n.elements[9]*=h,$n.elements[10]*=h,n.setFromRotationMatrix($n),i.x=s,i.y=o,i.z=a,this}makePerspective(t,n,i,r,s,o,a=gi,l=!1){const c=this.elements,u=2*s/(n-t),h=2*s/(i-r),f=(n+t)/(n-t),p=(i+r)/(i-r);let g,_;if(l)g=s/(o-s),_=o*s/(o-s);else if(a===gi)g=-(o+s)/(o-s),_=-2*o*s/(o-s);else if(a===pl)g=-o/(o-s),_=-o*s/(o-s);else throw new Error("THREE.Matrix4.makePerspective(): Invalid coordinate system: "+a);return c[0]=u,c[4]=0,c[8]=f,c[12]=0,c[1]=0,c[5]=h,c[9]=p,c[13]=0,c[2]=0,c[6]=0,c[10]=g,c[14]=_,c[3]=0,c[7]=0,c[11]=-1,c[15]=0,this}makeOrthographic(t,n,i,r,s,o,a=gi,l=!1){const c=this.elements,u=2/(n-t),h=2/(i-r),f=-(n+t)/(n-t),p=-(i+r)/(i-r);let g,_;if(l)g=1/(o-s),_=o/(o-s);else if(a===gi)g=-2/(o-s),_=-(o+s)/(o-s);else if(a===pl)g=-1/(o-s),_=-s/(o-s);else throw new Error("THREE.Matrix4.makeOrthographic(): Invalid coordinate system: "+a);return c[0]=u,c[4]=0,c[8]=0,c[12]=f,c[1]=0,c[5]=h,c[9]=0,c[13]=p,c[2]=0,c[6]=0,c[10]=g,c[14]=_,c[3]=0,c[7]=0,c[11]=0,c[15]=1,this}equals(t){const n=this.elements,i=t.elements;for(let r=0;r<16;r++)if(n[r]!==i[r])return!1;return!0}fromArray(t,n=0){for(let i=0;i<16;i++)this.elements[i]=t[i+n];return this}toArray(t=[],n=0){const i=this.elements;return t[n]=i[0],t[n+1]=i[1],t[n+2]=i[2],t[n+3]=i[3],t[n+4]=i[4],t[n+5]=i[5],t[n+6]=i[6],t[n+7]=i[7],t[n+8]=i[8],t[n+9]=i[9],t[n+10]=i[10],t[n+11]=i[11],t[n+12]=i[12],t[n+13]=i[13],t[n+14]=i[14],t[n+15]=i[15],t}}const us=new D,$n=new he,hM=new D(0,0,0),fM=new D(1,1,1),er=new D,_a=new D,Nn=new D,Dp=new he,Ip=new nn;class ni{constructor(t=0,n=0,i=0,r=ni.DEFAULT_ORDER){this.isEuler=!0,this._x=t,this._y=n,this._z=i,this._order=r}get x(){return this._x}set x(t){this._x=t,this._onChangeCallback()}get y(){return this._y}set y(t){this._y=t,this._onChangeCallback()}get z(){return this._z}set z(t){this._z=t,this._onChangeCallback()}get order(){return this._order}set order(t){this._order=t,this._onChangeCallback()}set(t,n,i,r=this._order){return this._x=t,this._y=n,this._z=i,this._order=r,this._onChangeCallback(),this}clone(){return new this.constructor(this._x,this._y,this._z,this._order)}copy(t){return this._x=t._x,this._y=t._y,this._z=t._z,this._order=t._order,this._onChangeCallback(),this}setFromRotationMatrix(t,n=this._order,i=!0){const r=t.elements,s=r[0],o=r[4],a=r[8],l=r[1],c=r[5],u=r[9],h=r[2],f=r[6],p=r[10];switch(n){case"XYZ":this._y=Math.asin(re(a,-1,1)),Math.abs(a)<.9999999?(this._x=Math.atan2(-u,p),this._z=Math.atan2(-o,s)):(this._x=Math.atan2(f,c),this._z=0);break;case"YXZ":this._x=Math.asin(-re(u,-1,1)),Math.abs(u)<.9999999?(this._y=Math.atan2(a,p),this._z=Math.atan2(l,c)):(this._y=Math.atan2(-h,s),this._z=0);break;case"ZXY":this._x=Math.asin(re(f,-1,1)),Math.abs(f)<.9999999?(this._y=Math.atan2(-h,p),this._z=Math.atan2(-o,c)):(this._y=0,this._z=Math.atan2(l,s));break;case"ZYX":this._y=Math.asin(-re(h,-1,1)),Math.abs(h)<.9999999?(this._x=Math.atan2(f,p),this._z=Math.atan2(l,s)):(this._x=0,this._z=Math.atan2(-o,c));break;case"YZX":this._z=Math.asin(re(l,-1,1)),Math.abs(l)<.9999999?(this._x=Math.atan2(-u,c),this._y=Math.atan2(-h,s)):(this._x=0,this._y=Math.atan2(a,p));break;case"XZY":this._z=Math.asin(-re(o,-1,1)),Math.abs(o)<.9999999?(this._x=Math.atan2(f,c),this._y=Math.atan2(a,s)):(this._x=Math.atan2(-u,p),this._y=0);break;default:Yt("Euler: .setFromRotationMatrix() encountered an unknown order: "+n)}return this._order=n,i===!0&&this._onChangeCallback(),this}setFromQuaternion(t,n,i){return Dp.makeRotationFromQuaternion(t),this.setFromRotationMatrix(Dp,n,i)}setFromVector3(t,n=this._order){return this.set(t.x,t.y,t.z,n)}reorder(t){return Ip.setFromEuler(this),this.setFromQuaternion(Ip,t)}equals(t){return t._x===this._x&&t._y===this._y&&t._z===this._z&&t._order===this._order}fromArray(t){return this._x=t[0],this._y=t[1],this._z=t[2],t[3]!==void 0&&(this._order=t[3]),this._onChangeCallback(),this}toArray(t=[],n=0){return t[n]=this._x,t[n+1]=this._y,t[n+2]=this._z,t[n+3]=this._order,t}_onChange(t){return this._onChangeCallback=t,this}_onChangeCallback(){}*[Symbol.iterator](){yield this._x,yield this._y,yield this._z,yield this._order}}ni.DEFAULT_ORDER="XYZ";class _f{constructor(){this.mask=1}set(t){this.mask=(1<>>0}enable(t){this.mask|=1<1){for(let n=0;n1){for(let i=0;i0&&(r.userData=this.userData),r.layers=this.layers.mask,r.matrix=this.matrix.toArray(),r.up=this.up.toArray(),this.matrixAutoUpdate===!1&&(r.matrixAutoUpdate=!1),this.isInstancedMesh&&(r.type="InstancedMesh",r.count=this.count,r.instanceMatrix=this.instanceMatrix.toJSON(),this.instanceColor!==null&&(r.instanceColor=this.instanceColor.toJSON())),this.isBatchedMesh&&(r.type="BatchedMesh",r.perObjectFrustumCulled=this.perObjectFrustumCulled,r.sortObjects=this.sortObjects,r.drawRanges=this._drawRanges,r.reservedRanges=this._reservedRanges,r.geometryInfo=this._geometryInfo.map(a=>({...a,boundingBox:a.boundingBox?a.boundingBox.toJSON():void 0,boundingSphere:a.boundingSphere?a.boundingSphere.toJSON():void 0})),r.instanceInfo=this._instanceInfo.map(a=>({...a})),r.availableInstanceIds=this._availableInstanceIds.slice(),r.availableGeometryIds=this._availableGeometryIds.slice(),r.nextIndexStart=this._nextIndexStart,r.nextVertexStart=this._nextVertexStart,r.geometryCount=this._geometryCount,r.maxInstanceCount=this._maxInstanceCount,r.maxVertexCount=this._maxVertexCount,r.maxIndexCount=this._maxIndexCount,r.geometryInitialized=this._geometryInitialized,r.matricesTexture=this._matricesTexture.toJSON(t),r.indirectTexture=this._indirectTexture.toJSON(t),this._colorsTexture!==null&&(r.colorsTexture=this._colorsTexture.toJSON(t)),this.boundingSphere!==null&&(r.boundingSphere=this.boundingSphere.toJSON()),this.boundingBox!==null&&(r.boundingBox=this.boundingBox.toJSON()));function s(a,l){return a[l.uuid]===void 0&&(a[l.uuid]=l.toJSON(t)),l.uuid}if(this.isScene)this.background&&(this.background.isColor?r.background=this.background.toJSON():this.background.isTexture&&(r.background=this.background.toJSON(t).uuid)),this.environment&&this.environment.isTexture&&this.environment.isRenderTargetTexture!==!0&&(r.environment=this.environment.toJSON(t).uuid);else if(this.isMesh||this.isLine||this.isPoints){r.geometry=s(t.geometries,this.geometry);const a=this.geometry.parameters;if(a!==void 0&&a.shapes!==void 0){const l=a.shapes;if(Array.isArray(l))for(let c=0,u=l.length;c0){r.children=[];for(let a=0;a0){r.animations=[];for(let a=0;a0&&(i.geometries=a),l.length>0&&(i.materials=l),c.length>0&&(i.textures=c),u.length>0&&(i.images=u),h.length>0&&(i.shapes=h),f.length>0&&(i.skeletons=f),p.length>0&&(i.animations=p),g.length>0&&(i.nodes=g)}return i.object=r,i;function o(a){const l=[];for(const c in a){const u=a[c];delete u.metadata,l.push(u)}return l}}clone(t){return new this.constructor().copy(this,t)}copy(t,n=!0){if(this.name=t.name,this.up.copy(t.up),this.position.copy(t.position),this.rotation.order=t.rotation.order,this.quaternion.copy(t.quaternion),this.scale.copy(t.scale),this.matrix.copy(t.matrix),this.matrixWorld.copy(t.matrixWorld),this.matrixAutoUpdate=t.matrixAutoUpdate,this.matrixWorldAutoUpdate=t.matrixWorldAutoUpdate,this.matrixWorldNeedsUpdate=t.matrixWorldNeedsUpdate,this.layers.mask=t.layers.mask,this.visible=t.visible,this.castShadow=t.castShadow,this.receiveShadow=t.receiveShadow,this.frustumCulled=t.frustumCulled,this.renderOrder=t.renderOrder,this.animations=t.animations.slice(),this.userData=JSON.parse(JSON.stringify(t.userData)),n===!0)for(let i=0;i0?r.multiplyScalar(1/Math.sqrt(s)):r.set(0,0,0)}static getBarycoord(t,n,i,r,s){Zn.subVectors(r,n),Ii.subVectors(i,n),xc.subVectors(t,n);const o=Zn.dot(Zn),a=Zn.dot(Ii),l=Zn.dot(xc),c=Ii.dot(Ii),u=Ii.dot(xc),h=o*c-a*a;if(h===0)return s.set(0,0,0),null;const f=1/h,p=(c*l-a*u)*f,g=(o*u-a*l)*f;return s.set(1-p-g,g,p)}static containsPoint(t,n,i,r){return this.getBarycoord(t,n,i,r,Li)===null?!1:Li.x>=0&&Li.y>=0&&Li.x+Li.y<=1}static getInterpolation(t,n,i,r,s,o,a,l){return this.getBarycoord(t,n,i,r,Li)===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(s,Li.x),l.addScaledVector(o,Li.y),l.addScaledVector(a,Li.z),l)}static getInterpolatedAttribute(t,n,i,r,s,o){return Mc.setScalar(0),wc.setScalar(0),Ec.setScalar(0),Mc.fromBufferAttribute(t,n),wc.fromBufferAttribute(t,i),Ec.fromBufferAttribute(t,r),o.setScalar(0),o.addScaledVector(Mc,s.x),o.addScaledVector(wc,s.y),o.addScaledVector(Ec,s.z),o}static isFrontFacing(t,n,i,r){return Zn.subVectors(i,n),Ii.subVectors(t,n),Zn.cross(Ii).dot(r)<0}set(t,n,i){return this.a.copy(t),this.b.copy(n),this.c.copy(i),this}setFromPointsAndIndices(t,n,i,r){return this.a.copy(t[n]),this.b.copy(t[i]),this.c.copy(t[r]),this}setFromAttributeAndIndices(t,n,i,r){return this.a.fromBufferAttribute(t,n),this.b.fromBufferAttribute(t,i),this.c.fromBufferAttribute(t,r),this}clone(){return new this.constructor().copy(this)}copy(t){return this.a.copy(t.a),this.b.copy(t.b),this.c.copy(t.c),this}getArea(){return Zn.subVectors(this.c,this.b),Ii.subVectors(this.a,this.b),Zn.cross(Ii).length()*.5}getMidpoint(t){return t.addVectors(this.a,this.b).add(this.c).multiplyScalar(1/3)}getNormal(t){return Kn.getNormal(this.a,this.b,this.c,t)}getPlane(t){return t.setFromCoplanarPoints(this.a,this.b,this.c)}getBarycoord(t,n){return Kn.getBarycoord(t,this.a,this.b,this.c,n)}getInterpolation(t,n,i,r,s){return Kn.getInterpolation(t,this.a,this.b,this.c,n,i,r,s)}containsPoint(t){return Kn.containsPoint(t,this.a,this.b,this.c)}isFrontFacing(t){return Kn.isFrontFacing(this.a,this.b,this.c,t)}intersectsBox(t){return t.intersectsTriangle(this)}closestPointToPoint(t,n){const i=this.a,r=this.b,s=this.c;let o,a;ds.subVectors(r,i),ps.subVectors(s,i),yc.subVectors(t,i);const l=ds.dot(yc),c=ps.dot(yc);if(l<=0&&c<=0)return n.copy(i);Sc.subVectors(t,r);const u=ds.dot(Sc),h=ps.dot(Sc);if(u>=0&&h<=u)return n.copy(r);const f=l*h-u*c;if(f<=0&&l>=0&&u<=0)return o=l/(l-u),n.copy(i).addScaledVector(ds,o);bc.subVectors(t,s);const p=ds.dot(bc),g=ps.dot(bc);if(g>=0&&p<=g)return n.copy(s);const _=p*c-l*g;if(_<=0&&c>=0&&g<=0)return a=c/(c-g),n.copy(i).addScaledVector(ps,a);const m=u*g-p*h;if(m<=0&&h-u>=0&&p-g>=0)return kp.subVectors(s,r),a=(h-u)/(h-u+(p-g)),n.copy(r).addScaledVector(kp,a);const d=1/(m+_+f);return o=_*d,a=f*d,n.copy(i).addScaledVector(ds,o).addScaledVector(ps,a)}equals(t){return t.a.equals(this.a)&&t.b.equals(this.b)&&t.c.equals(this.c)}}const K0={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},nr={h:0,s:0,l:0},xa={h:0,s:0,l:0};function Tc(e,t,n){return n<0&&(n+=1),n>1&&(n-=1),n<1/6?e+(t-e)*6*n:n<1/2?t:n<2/3?e+(t-e)*6*(2/3-n):e}class $t{constructor(t,n,i){return this.isColor=!0,this.r=1,this.g=1,this.b=1,this.set(t,n,i)}set(t,n,i){if(n===void 0&&i===void 0){const r=t;r&&r.isColor?this.copy(r):typeof r=="number"?this.setHex(r):typeof r=="string"&&this.setStyle(r)}else this.setRGB(t,n,i);return this}setScalar(t){return this.r=t,this.g=t,this.b=t,this}setHex(t,n=On){return t=Math.floor(t),this.r=(t>>16&255)/255,this.g=(t>>8&255)/255,this.b=(t&255)/255,me.colorSpaceToWorking(this,n),this}setRGB(t,n,i,r=me.workingColorSpace){return this.r=t,this.g=n,this.b=i,me.colorSpaceToWorking(this,r),this}setHSL(t,n,i,r=me.workingColorSpace){if(t=mf(t,1),n=re(n,0,1),i=re(i,0,1),n===0)this.r=this.g=this.b=i;else{const s=i<=.5?i*(1+n):i+n-i*n,o=2*i-s;this.r=Tc(o,s,t+1/3),this.g=Tc(o,s,t),this.b=Tc(o,s,t-1/3)}return me.colorSpaceToWorking(this,r),this}setStyle(t,n=On){function i(s){s!==void 0&&parseFloat(s)<1&&Yt("Color: Alpha component of "+t+" will be ignored.")}let r;if(r=/^(\w+)\(([^\)]*)\)/.exec(t)){let s;const o=r[1],a=r[2];switch(o){case"rgb":case"rgba":if(s=/^\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec(a))return i(s[4]),this.setRGB(Math.min(255,parseInt(s[1],10))/255,Math.min(255,parseInt(s[2],10))/255,Math.min(255,parseInt(s[3],10))/255,n);if(s=/^\s*(\d+)\%\s*,\s*(\d+)\%\s*,\s*(\d+)\%\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec(a))return i(s[4]),this.setRGB(Math.min(100,parseInt(s[1],10))/100,Math.min(100,parseInt(s[2],10))/100,Math.min(100,parseInt(s[3],10))/100,n);break;case"hsl":case"hsla":if(s=/^\s*(\d*\.?\d+)\s*,\s*(\d*\.?\d+)\%\s*,\s*(\d*\.?\d+)\%\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec(a))return i(s[4]),this.setHSL(parseFloat(s[1])/360,parseFloat(s[2])/100,parseFloat(s[3])/100,n);break;default:Yt("Color: Unknown color model "+t)}}else if(r=/^\#([A-Fa-f\d]+)$/.exec(t)){const s=r[1],o=s.length;if(o===3)return this.setRGB(parseInt(s.charAt(0),16)/15,parseInt(s.charAt(1),16)/15,parseInt(s.charAt(2),16)/15,n);if(o===6)return this.setHex(parseInt(s,16),n);Yt("Color: Invalid hex color "+t)}else if(t&&t.length>0)return this.setColorName(t,n);return this}setColorName(t,n=On){const i=K0[t.toLowerCase()];return i!==void 0?this.setHex(i,n):Yt("Color: Unknown color "+t),this}clone(){return new this.constructor(this.r,this.g,this.b)}copy(t){return this.r=t.r,this.g=t.g,this.b=t.b,this}copySRGBToLinear(t){return this.r=Hi(t.r),this.g=Hi(t.g),this.b=Hi(t.b),this}copyLinearToSRGB(t){return this.r=Ls(t.r),this.g=Ls(t.g),this.b=Ls(t.b),this}convertSRGBToLinear(){return this.copySRGBToLinear(this),this}convertLinearToSRGB(){return this.copyLinearToSRGB(this),this}getHex(t=On){return me.workingToColorSpace(ln.copy(this),t),Math.round(re(ln.r*255,0,255))*65536+Math.round(re(ln.g*255,0,255))*256+Math.round(re(ln.b*255,0,255))}getHexString(t=On){return("000000"+this.getHex(t).toString(16)).slice(-6)}getHSL(t,n=me.workingColorSpace){me.workingToColorSpace(ln.copy(this),n);const i=ln.r,r=ln.g,s=ln.b,o=Math.max(i,r,s),a=Math.min(i,r,s);let l,c;const u=(a+o)/2;if(a===o)l=0,c=0;else{const h=o-a;switch(c=u<=.5?h/(o+a):h/(2-o-a),o){case i:l=(r-s)/h+(r0!=t>0&&this.version++,this._alphaTest=t}onBeforeRender(){}onBeforeCompile(){}customProgramCacheKey(){return this.onBeforeCompile.toString()}setValues(t){if(t!==void 0)for(const n in t){const i=t[n];if(i===void 0){Yt(`Material: parameter '${n}' has value of undefined.`);continue}const r=this[n];if(r===void 0){Yt(`Material: '${n}' is not a property of THREE.${this.type}.`);continue}r&&r.isColor?r.set(i):r&&r.isVector3&&i&&i.isVector3?r.copy(i):this[n]=i}}toJSON(t){const n=t===void 0||typeof t=="string";n&&(t={textures:{},images:{}});const i={metadata:{version:4.7,type:"Material",generator:"Material.toJSON"}};i.uuid=this.uuid,i.type=this.type,this.name!==""&&(i.name=this.name),this.color&&this.color.isColor&&(i.color=this.color.getHex()),this.roughness!==void 0&&(i.roughness=this.roughness),this.metalness!==void 0&&(i.metalness=this.metalness),this.sheen!==void 0&&(i.sheen=this.sheen),this.sheenColor&&this.sheenColor.isColor&&(i.sheenColor=this.sheenColor.getHex()),this.sheenRoughness!==void 0&&(i.sheenRoughness=this.sheenRoughness),this.emissive&&this.emissive.isColor&&(i.emissive=this.emissive.getHex()),this.emissiveIntensity!==void 0&&this.emissiveIntensity!==1&&(i.emissiveIntensity=this.emissiveIntensity),this.specular&&this.specular.isColor&&(i.specular=this.specular.getHex()),this.specularIntensity!==void 0&&(i.specularIntensity=this.specularIntensity),this.specularColor&&this.specularColor.isColor&&(i.specularColor=this.specularColor.getHex()),this.shininess!==void 0&&(i.shininess=this.shininess),this.clearcoat!==void 0&&(i.clearcoat=this.clearcoat),this.clearcoatRoughness!==void 0&&(i.clearcoatRoughness=this.clearcoatRoughness),this.clearcoatMap&&this.clearcoatMap.isTexture&&(i.clearcoatMap=this.clearcoatMap.toJSON(t).uuid),this.clearcoatRoughnessMap&&this.clearcoatRoughnessMap.isTexture&&(i.clearcoatRoughnessMap=this.clearcoatRoughnessMap.toJSON(t).uuid),this.clearcoatNormalMap&&this.clearcoatNormalMap.isTexture&&(i.clearcoatNormalMap=this.clearcoatNormalMap.toJSON(t).uuid,i.clearcoatNormalScale=this.clearcoatNormalScale.toArray()),this.sheenColorMap&&this.sheenColorMap.isTexture&&(i.sheenColorMap=this.sheenColorMap.toJSON(t).uuid),this.sheenRoughnessMap&&this.sheenRoughnessMap.isTexture&&(i.sheenRoughnessMap=this.sheenRoughnessMap.toJSON(t).uuid),this.dispersion!==void 0&&(i.dispersion=this.dispersion),this.iridescence!==void 0&&(i.iridescence=this.iridescence),this.iridescenceIOR!==void 0&&(i.iridescenceIOR=this.iridescenceIOR),this.iridescenceThicknessRange!==void 0&&(i.iridescenceThicknessRange=this.iridescenceThicknessRange),this.iridescenceMap&&this.iridescenceMap.isTexture&&(i.iridescenceMap=this.iridescenceMap.toJSON(t).uuid),this.iridescenceThicknessMap&&this.iridescenceThicknessMap.isTexture&&(i.iridescenceThicknessMap=this.iridescenceThicknessMap.toJSON(t).uuid),this.anisotropy!==void 0&&(i.anisotropy=this.anisotropy),this.anisotropyRotation!==void 0&&(i.anisotropyRotation=this.anisotropyRotation),this.anisotropyMap&&this.anisotropyMap.isTexture&&(i.anisotropyMap=this.anisotropyMap.toJSON(t).uuid),this.map&&this.map.isTexture&&(i.map=this.map.toJSON(t).uuid),this.matcap&&this.matcap.isTexture&&(i.matcap=this.matcap.toJSON(t).uuid),this.alphaMap&&this.alphaMap.isTexture&&(i.alphaMap=this.alphaMap.toJSON(t).uuid),this.lightMap&&this.lightMap.isTexture&&(i.lightMap=this.lightMap.toJSON(t).uuid,i.lightMapIntensity=this.lightMapIntensity),this.aoMap&&this.aoMap.isTexture&&(i.aoMap=this.aoMap.toJSON(t).uuid,i.aoMapIntensity=this.aoMapIntensity),this.bumpMap&&this.bumpMap.isTexture&&(i.bumpMap=this.bumpMap.toJSON(t).uuid,i.bumpScale=this.bumpScale),this.normalMap&&this.normalMap.isTexture&&(i.normalMap=this.normalMap.toJSON(t).uuid,i.normalMapType=this.normalMapType,i.normalScale=this.normalScale.toArray()),this.displacementMap&&this.displacementMap.isTexture&&(i.displacementMap=this.displacementMap.toJSON(t).uuid,i.displacementScale=this.displacementScale,i.displacementBias=this.displacementBias),this.roughnessMap&&this.roughnessMap.isTexture&&(i.roughnessMap=this.roughnessMap.toJSON(t).uuid),this.metalnessMap&&this.metalnessMap.isTexture&&(i.metalnessMap=this.metalnessMap.toJSON(t).uuid),this.emissiveMap&&this.emissiveMap.isTexture&&(i.emissiveMap=this.emissiveMap.toJSON(t).uuid),this.specularMap&&this.specularMap.isTexture&&(i.specularMap=this.specularMap.toJSON(t).uuid),this.specularIntensityMap&&this.specularIntensityMap.isTexture&&(i.specularIntensityMap=this.specularIntensityMap.toJSON(t).uuid),this.specularColorMap&&this.specularColorMap.isTexture&&(i.specularColorMap=this.specularColorMap.toJSON(t).uuid),this.envMap&&this.envMap.isTexture&&(i.envMap=this.envMap.toJSON(t).uuid,this.combine!==void 0&&(i.combine=this.combine)),this.envMapRotation!==void 0&&(i.envMapRotation=this.envMapRotation.toArray()),this.envMapIntensity!==void 0&&(i.envMapIntensity=this.envMapIntensity),this.reflectivity!==void 0&&(i.reflectivity=this.reflectivity),this.refractionRatio!==void 0&&(i.refractionRatio=this.refractionRatio),this.gradientMap&&this.gradientMap.isTexture&&(i.gradientMap=this.gradientMap.toJSON(t).uuid),this.transmission!==void 0&&(i.transmission=this.transmission),this.transmissionMap&&this.transmissionMap.isTexture&&(i.transmissionMap=this.transmissionMap.toJSON(t).uuid),this.thickness!==void 0&&(i.thickness=this.thickness),this.thicknessMap&&this.thicknessMap.isTexture&&(i.thicknessMap=this.thicknessMap.toJSON(t).uuid),this.attenuationDistance!==void 0&&this.attenuationDistance!==1/0&&(i.attenuationDistance=this.attenuationDistance),this.attenuationColor!==void 0&&(i.attenuationColor=this.attenuationColor.getHex()),this.size!==void 0&&(i.size=this.size),this.shadowSide!==null&&(i.shadowSide=this.shadowSide),this.sizeAttenuation!==void 0&&(i.sizeAttenuation=this.sizeAttenuation),this.blending!==Is&&(i.blending=this.blending),this.side!==yr&&(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!==cu&&(i.blendSrc=this.blendSrc),this.blendDst!==uu&&(i.blendDst=this.blendDst),this.blendEquation!==Fr&&(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!==Fs&&(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!==bp&&(i.stencilFunc=this.stencilFunc),this.stencilRef!==0&&(i.stencilRef=this.stencilRef),this.stencilFuncMask!==255&&(i.stencilFuncMask=this.stencilFuncMask),this.stencilFail!==ss&&(i.stencilFail=this.stencilFail),this.stencilZFail!==ss&&(i.stencilZFail=this.stencilZFail),this.stencilZPass!==ss&&(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.allowOverride===!1&&(i.allowOverride=!1),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 r(s){const o=[];for(const a in s){const l=s[a];delete l.metadata,o.push(l)}return o}if(n){const s=r(t.textures),o=r(t.images);s.length>0&&(i.textures=s),o.length>0&&(i.images=o)}return i}clone(){return new this.constructor().copy(this)}copy(t){this.name=t.name,this.blending=t.blending,this.side=t.side,this.vertexColors=t.vertexColors,this.opacity=t.opacity,this.transparent=t.transparent,this.blendSrc=t.blendSrc,this.blendDst=t.blendDst,this.blendEquation=t.blendEquation,this.blendSrcAlpha=t.blendSrcAlpha,this.blendDstAlpha=t.blendDstAlpha,this.blendEquationAlpha=t.blendEquationAlpha,this.blendColor.copy(t.blendColor),this.blendAlpha=t.blendAlpha,this.depthFunc=t.depthFunc,this.depthTest=t.depthTest,this.depthWrite=t.depthWrite,this.stencilWriteMask=t.stencilWriteMask,this.stencilFunc=t.stencilFunc,this.stencilRef=t.stencilRef,this.stencilFuncMask=t.stencilFuncMask,this.stencilFail=t.stencilFail,this.stencilZFail=t.stencilZFail,this.stencilZPass=t.stencilZPass,this.stencilWrite=t.stencilWrite;const n=t.clippingPlanes;let i=null;if(n!==null){const r=n.length;i=new Array(r);for(let s=0;s!==r;++s)i[s]=n[s].clone()}return this.clippingPlanes=i,this.clipIntersection=t.clipIntersection,this.clipShadows=t.clipShadows,this.shadowSide=t.shadowSide,this.colorWrite=t.colorWrite,this.precision=t.precision,this.polygonOffset=t.polygonOffset,this.polygonOffsetFactor=t.polygonOffsetFactor,this.polygonOffsetUnits=t.polygonOffsetUnits,this.dithering=t.dithering,this.alphaTest=t.alphaTest,this.alphaHash=t.alphaHash,this.alphaToCoverage=t.alphaToCoverage,this.premultipliedAlpha=t.premultipliedAlpha,this.forceSinglePass=t.forceSinglePass,this.allowOverride=t.allowOverride,this.visible=t.visible,this.toneMapped=t.toneMapped,this.userData=JSON.parse(JSON.stringify(t.userData)),this}dispose(){this.dispatchEvent({type:"dispose"})}set needsUpdate(t){t===!0&&this.version++}}class Sr extends es{constructor(t){super(),this.isMeshBasicMaterial=!0,this.type="MeshBasicMaterial",this.color=new $t(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 ni,this.combine=L0,this.reflectivity=1,this.refractionRatio=.98,this.wireframe=!1,this.wireframeLinewidth=1,this.wireframeLinecap="round",this.wireframeLinejoin="round",this.fog=!0,this.setValues(t)}copy(t){return super.copy(t),this.color.copy(t.color),this.map=t.map,this.lightMap=t.lightMap,this.lightMapIntensity=t.lightMapIntensity,this.aoMap=t.aoMap,this.aoMapIntensity=t.aoMapIntensity,this.specularMap=t.specularMap,this.alphaMap=t.alphaMap,this.envMap=t.envMap,this.envMapRotation.copy(t.envMapRotation),this.combine=t.combine,this.reflectivity=t.reflectivity,this.refractionRatio=t.refractionRatio,this.wireframe=t.wireframe,this.wireframeLinewidth=t.wireframeLinewidth,this.wireframeLinecap=t.wireframeLinecap,this.wireframeLinejoin=t.wireframeLinejoin,this.fog=t.fog,this}}const Xe=new D,ya=new mt;let vM=0;class pn{constructor(t,n,i=!1){if(Array.isArray(t))throw new TypeError("THREE.BufferAttribute: array should be a Typed Array.");this.isBufferAttribute=!0,Object.defineProperty(this,"id",{value:vM++}),this.name="",this.array=t,this.itemSize=n,this.count=t!==void 0?t.length/n:0,this.normalized=i,this.usage=Mp,this.updateRanges=[],this.gpuType=mi,this.version=0}onUploadCallback(){}set needsUpdate(t){t===!0&&this.version++}setUsage(t){return this.usage=t,this}addUpdateRange(t,n){this.updateRanges.push({start:t,count:n})}clearUpdateRanges(){this.updateRanges.length=0}copy(t){return this.name=t.name,this.array=new t.array.constructor(t.array),this.itemSize=t.itemSize,this.count=t.count,this.normalized=t.normalized,this.usage=t.usage,this.gpuType=t.gpuType,this}copyAt(t,n,i){t*=this.itemSize,i*=n.itemSize;for(let r=0,s=this.itemSize;rn.count&&Yt("BufferGeometry: Buffer size too small for points data. Use .dispose() and create a new geometry."),n.needsUpdate=!0}return this}computeBoundingBox(){this.boundingBox===null&&(this.boundingBox=new Ko);const t=this.attributes.position,n=this.morphAttributes.position;if(t&&t.isGLBufferAttribute){de("BufferGeometry.computeBoundingBox(): GLBufferAttribute requires a manual bounding box.",this),this.boundingBox.set(new D(-1/0,-1/0,-1/0),new D(1/0,1/0,1/0));return}if(t!==void 0){if(this.boundingBox.setFromBufferAttribute(t),n)for(let i=0,r=n.length;i0&&(t.userData=this.userData),this.parameters!==void 0){const l=this.parameters;for(const c in l)l[c]!==void 0&&(t[c]=l[c]);return t}t.data={attributes:{}};const n=this.index;n!==null&&(t.data.index={type:n.array.constructor.name,array:Array.prototype.slice.call(n.array)});const i=this.attributes;for(const l in i){const c=i[l];t.data.attributes[l]=c.toJSON(t.data)}const r={};let s=!1;for(const l in this.morphAttributes){const c=this.morphAttributes[l],u=[];for(let h=0,f=c.length;h0&&(r[l]=u,s=!0)}s&&(t.data.morphAttributes=r,t.data.morphTargetsRelative=this.morphTargetsRelative);const o=this.groups;o.length>0&&(t.data.groups=JSON.parse(JSON.stringify(o)));const a=this.boundingSphere;return a!==null&&(t.data.boundingSphere=a.toJSON()),t}clone(){return new this.constructor().copy(this)}copy(t){this.index=null,this.attributes={},this.morphAttributes={},this.groups=[],this.boundingBox=null,this.boundingSphere=null;const n={};this.name=t.name;const i=t.index;i!==null&&this.setIndex(i.clone());const r=t.attributes;for(const c in r){const u=r[c];this.setAttribute(c,u.clone(n))}const s=t.morphAttributes;for(const c in s){const u=[],h=s[c];for(let f=0,p=h.length;f0){const r=n[i[0]];if(r!==void 0){this.morphTargetInfluences=[],this.morphTargetDictionary={};for(let s=0,o=r.length;s(t.far-t.near)**2))&&(Bp.copy(s).invert(),Rr.copy(t.ray).applyMatrix4(Bp),!(i.boundingBox!==null&&Rr.intersectsBox(i.boundingBox)===!1)&&this._computeIntersections(t,n,Rr)))}_computeIntersections(t,n,i){let r;const s=this.geometry,o=this.material,a=s.index,l=s.attributes.position,c=s.attributes.uv,u=s.attributes.uv1,h=s.attributes.normal,f=s.groups,p=s.drawRange;if(a!==null)if(Array.isArray(o))for(let g=0,_=f.length;g<_;g++){const m=f[g],d=o[m.materialIndex],S=Math.max(m.start,p.start),x=Math.min(a.count,Math.min(m.start+m.count,p.start+p.count));for(let y=S,T=x;yn.far?null:{distance:c,point:Ta.clone(),object:e}}function Aa(e,t,n,i,r,s,o,a,l,c){e.getVertexPosition(a,ba),e.getVertexPosition(l,Ma),e.getVertexPosition(c,wa);const u=yM(e,t,n,i,ba,Ma,wa,Vp);if(u){const h=new D;Kn.getBarycoord(Vp,ba,Ma,wa,h),r&&(u.uv=Kn.getInterpolatedAttribute(r,a,l,c,h,new mt)),s&&(u.uv1=Kn.getInterpolatedAttribute(s,a,l,c,h,new mt)),o&&(u.normal=Kn.getInterpolatedAttribute(o,a,l,c,h,new D),u.normal.dot(i.direction)>0&&u.normal.multiplyScalar(-1));const f={a,b:l,c,normal:new D,materialIndex:0};Kn.getNormal(ba,Ma,wa,f.normal),u.face=f,u.barycoord=h}return u}class Be extends fe{constructor(t=1,n=1,i=1,r=1,s=1,o=1){super(),this.type="BoxGeometry",this.parameters={width:t,height:n,depth:i,widthSegments:r,heightSegments:s,depthSegments:o};const a=this;r=Math.floor(r),s=Math.floor(s),o=Math.floor(o);const l=[],c=[],u=[],h=[];let f=0,p=0;g("z","y","x",-1,-1,i,n,t,o,s,0),g("z","y","x",1,-1,i,n,-t,o,s,1),g("x","z","y",1,1,t,i,n,r,o,2),g("x","z","y",1,-1,t,i,-n,r,o,3),g("x","y","z",1,-1,t,n,i,r,s,4),g("x","y","z",-1,-1,t,n,-i,r,s,5),this.setIndex(l),this.setAttribute("position",new te(c,3)),this.setAttribute("normal",new te(u,3)),this.setAttribute("uv",new te(h,2));function g(_,m,d,S,x,y,T,P,R,C,b){const M=y/R,L=T/C,V=y/2,q=T/2,j=P/2,J=R+1,W=C+1;let k=0,H=0;const ct=new D;for(let pt=0;pt0?1:-1,u.push(ct.x,ct.y,ct.z),h.push(kt/R),h.push(1-pt/C),k+=1}}for(let pt=0;pt0&&(n.defines=this.defines),n.vertexShader=this.vertexShader,n.fragmentShader=this.fragmentShader,n.lights=this.lights,n.clipping=this.clipping;const i={};for(const r in this.extensions)this.extensions[r]===!0&&(i[r]=!0);return Object.keys(i).length>0&&(n.extensions=i),n}}class n_ extends Te{constructor(){super(),this.isCamera=!0,this.type="Camera",this.matrixWorldInverse=new he,this.projectionMatrix=new he,this.projectionMatrixInverse=new he,this.coordinateSystem=gi,this._reversedDepth=!1}get reversedDepth(){return this._reversedDepth}copy(t,n){return super.copy(t,n),this.matrixWorldInverse.copy(t.matrixWorldInverse),this.projectionMatrix.copy(t.projectionMatrix),this.projectionMatrixInverse.copy(t.projectionMatrixInverse),this.coordinateSystem=t.coordinateSystem,this}getWorldDirection(t){return super.getWorldDirection(t).negate()}updateMatrixWorld(t){super.updateMatrixWorld(t),this.matrixWorldInverse.copy(this.matrixWorld).invert()}updateWorldMatrix(t,n){super.updateWorldMatrix(t,n),this.matrixWorldInverse.copy(this.matrixWorld).invert()}clone(){return new this.constructor().copy(this)}}const ir=new D,Hp=new mt,Gp=new mt;class Pn extends n_{constructor(t=50,n=1,i=.1,r=2e3){super(),this.isPerspectiveCamera=!0,this.type="PerspectiveCamera",this.fov=t,this.zoom=1,this.near=i,this.far=r,this.focus=10,this.aspect=n,this.view=null,this.filmGauge=35,this.filmOffset=0,this.updateProjectionMatrix()}copy(t,n){return super.copy(t,n),this.fov=t.fov,this.zoom=t.zoom,this.near=t.near,this.far=t.far,this.focus=t.focus,this.aspect=t.aspect,this.view=t.view===null?null:Object.assign({},t.view),this.filmGauge=t.filmGauge,this.filmOffset=t.filmOffset,this}setFocalLength(t){const n=.5*this.getFilmHeight()/t;this.fov=Vs*2*Math.atan(n),this.updateProjectionMatrix()}getFocalLength(){const t=Math.tan(Co*.5*this.fov);return .5*this.getFilmHeight()/t}getEffectiveFOV(){return Vs*2*Math.atan(Math.tan(Co*.5*this.fov)/this.zoom)}getFilmWidth(){return this.filmGauge*Math.min(this.aspect,1)}getFilmHeight(){return this.filmGauge/Math.max(this.aspect,1)}getViewBounds(t,n,i){ir.set(-1,-1,.5).applyMatrix4(this.projectionMatrixInverse),n.set(ir.x,ir.y).multiplyScalar(-t/ir.z),ir.set(1,1,.5).applyMatrix4(this.projectionMatrixInverse),i.set(ir.x,ir.y).multiplyScalar(-t/ir.z)}getViewSize(t,n){return this.getViewBounds(t,Hp,Gp),n.subVectors(Gp,Hp)}setViewOffset(t,n,i,r,s,o){this.aspect=t/n,this.view===null&&(this.view={enabled:!0,fullWidth:1,fullHeight:1,offsetX:0,offsetY:0,width:1,height:1}),this.view.enabled=!0,this.view.fullWidth=t,this.view.fullHeight=n,this.view.offsetX=i,this.view.offsetY=r,this.view.width=s,this.view.height=o,this.updateProjectionMatrix()}clearViewOffset(){this.view!==null&&(this.view.enabled=!1),this.updateProjectionMatrix()}updateProjectionMatrix(){const t=this.near;let n=t*Math.tan(Co*.5*this.fov)/this.zoom,i=2*n,r=this.aspect*i,s=-.5*r;const o=this.view;if(this.view!==null&&this.view.enabled){const l=o.fullWidth,c=o.fullHeight;s+=o.offsetX*r/l,n-=o.offsetY*i/c,r*=o.width/l,i*=o.height/c}const a=this.filmOffset;a!==0&&(s+=t*a/this.getFilmWidth()),this.projectionMatrix.makePerspective(s,s+r,n,n-i,t,this.far,this.coordinateSystem,this.reversedDepth),this.projectionMatrixInverse.copy(this.projectionMatrix).invert()}toJSON(t){const n=super.toJSON(t);return n.object.fov=this.fov,n.object.zoom=this.zoom,n.object.near=this.near,n.object.far=this.far,n.object.focus=this.focus,n.object.aspect=this.aspect,this.view!==null&&(n.object.view=Object.assign({},this.view)),n.object.filmGauge=this.filmGauge,n.object.filmOffset=this.filmOffset,n}}const gs=-90,_s=1;class wM extends Te{constructor(t,n,i){super(),this.type="CubeCamera",this.renderTarget=i,this.coordinateSystem=null,this.activeMipmapLevel=0;const r=new Pn(gs,_s,t,n);r.layers=this.layers,this.add(r);const s=new Pn(gs,_s,t,n);s.layers=this.layers,this.add(s);const o=new Pn(gs,_s,t,n);o.layers=this.layers,this.add(o);const a=new Pn(gs,_s,t,n);a.layers=this.layers,this.add(a);const l=new Pn(gs,_s,t,n);l.layers=this.layers,this.add(l);const c=new Pn(gs,_s,t,n);c.layers=this.layers,this.add(c)}updateCoordinateSystem(){const t=this.coordinateSystem,n=this.children.concat(),[i,r,s,o,a,l]=n;for(const c of n)this.remove(c);if(t===gi)i.up.set(0,1,0),i.lookAt(1,0,0),r.up.set(0,1,0),r.lookAt(-1,0,0),s.up.set(0,0,-1),s.lookAt(0,1,0),o.up.set(0,0,1),o.lookAt(0,-1,0),a.up.set(0,1,0),a.lookAt(0,0,1),l.up.set(0,1,0),l.lookAt(0,0,-1);else if(t===pl)i.up.set(0,-1,0),i.lookAt(-1,0,0),r.up.set(0,-1,0),r.lookAt(1,0,0),s.up.set(0,0,1),s.lookAt(0,1,0),o.up.set(0,0,-1),o.lookAt(0,-1,0),a.up.set(0,-1,0),a.lookAt(0,0,1),l.up.set(0,-1,0),l.lookAt(0,0,-1);else throw new Error("THREE.CubeCamera.updateCoordinateSystem(): Invalid coordinate system: "+t);for(const c of n)this.add(c),c.updateMatrixWorld()}update(t,n){this.parent===null&&this.updateMatrixWorld();const{renderTarget:i,activeMipmapLevel:r}=this;this.coordinateSystem!==t.coordinateSystem&&(this.coordinateSystem=t.coordinateSystem,this.updateCoordinateSystem());const[s,o,a,l,c,u]=this.children,h=t.getRenderTarget(),f=t.getActiveCubeFace(),p=t.getActiveMipmapLevel(),g=t.xr.enabled;t.xr.enabled=!1;const v=i.texture.generateMipmaps;i.texture.generateMipmaps=!1,t.setRenderTarget(i,0,r),t.render(n,s),t.setRenderTarget(i,1,r),t.render(n,o),t.setRenderTarget(i,2,r),t.render(n,a),t.setRenderTarget(i,3,r),t.render(n,l),t.setRenderTarget(i,4,r),t.render(n,c),i.texture.generateMipmaps=v,t.setRenderTarget(i,5,r),t.render(n,u),t.setRenderTarget(h,f,p),t.xr.enabled=g,i.texture.needsPMREMUpdate=!0}}class i_ extends Sn{constructor(t=[],n=$r,i,r,s,o,a,l,c,u){super(t,n,i,r,s,o,a,l,c,u),this.isCubeTexture=!0,this.flipY=!1}get images(){return this.image}set images(t){this.image=t}}class r_ extends xi{constructor(t=1,n={}){super(t,t,n),this.isWebGLCubeRenderTarget=!0;const i={width:t,height:t,depth:1},r=[i,i,i,i,i,i];this.texture=new i_(r),this._setTextureOptions(n),this.texture.isRenderTargetTexture=!0}fromEquirectangularTexture(t,n){this.texture.type=n.type,this.texture.colorSpace=n.colorSpace,this.texture.generateMipmaps=n.generateMipmaps,this.texture.minFilter=n.minFilter,this.texture.magFilter=n.magFilter;const i={uniforms:{tEquirect:{value:null}},vertexShader:` +}`;class ii extends es{constructor(t){super(),this.isShaderMaterial=!0,this.type="ShaderMaterial",this.defines={},this.uniforms={},this.uniformsGroups=[],this.vertexShader=bM,this.fragmentShader=MM,this.linewidth=1,this.wireframe=!1,this.wireframeLinewidth=1,this.fog=!1,this.lights=!1,this.clipping=!1,this.forceSinglePass=!0,this.extensions={clipCullDistance:!1,multiDraw:!1},this.defaultAttributeValues={color:[1,1,1],uv:[0,0],uv1:[0,0]},this.index0AttributeName=void 0,this.uniformsNeedUpdate=!1,this.glslVersion=null,t!==void 0&&this.setValues(t)}copy(t){return super.copy(t),this.fragmentShader=t.fragmentShader,this.vertexShader=t.vertexShader,this.uniforms=Hs(t.uniforms),this.uniformsGroups=SM(t.uniformsGroups),this.defines=Object.assign({},t.defines),this.wireframe=t.wireframe,this.wireframeLinewidth=t.wireframeLinewidth,this.fog=t.fog,this.lights=t.lights,this.clipping=t.clipping,this.extensions=Object.assign({},t.extensions),this.glslVersion=t.glslVersion,this.defaultAttributeValues=Object.assign({},t.defaultAttributeValues),this.index0AttributeName=t.index0AttributeName,this.uniformsNeedUpdate=t.uniformsNeedUpdate,this}toJSON(t){const n=super.toJSON(t);n.glslVersion=this.glslVersion,n.uniforms={};for(const r in this.uniforms){const o=this.uniforms[r].value;o&&o.isTexture?n.uniforms[r]={type:"t",value:o.toJSON(t).uuid}:o&&o.isColor?n.uniforms[r]={type:"c",value:o.getHex()}:o&&o.isVector2?n.uniforms[r]={type:"v2",value:o.toArray()}:o&&o.isVector3?n.uniforms[r]={type:"v3",value:o.toArray()}:o&&o.isVector4?n.uniforms[r]={type:"v4",value:o.toArray()}:o&&o.isMatrix3?n.uniforms[r]={type:"m3",value:o.toArray()}:o&&o.isMatrix4?n.uniforms[r]={type:"m4",value:o.toArray()}:n.uniforms[r]={value:o}}Object.keys(this.defines).length>0&&(n.defines=this.defines),n.vertexShader=this.vertexShader,n.fragmentShader=this.fragmentShader,n.lights=this.lights,n.clipping=this.clipping;const i={};for(const r in this.extensions)this.extensions[r]===!0&&(i[r]=!0);return Object.keys(i).length>0&&(n.extensions=i),n}}class n_ extends Te{constructor(){super(),this.isCamera=!0,this.type="Camera",this.matrixWorldInverse=new he,this.projectionMatrix=new he,this.projectionMatrixInverse=new he,this.coordinateSystem=gi,this._reversedDepth=!1}get reversedDepth(){return this._reversedDepth}copy(t,n){return super.copy(t,n),this.matrixWorldInverse.copy(t.matrixWorldInverse),this.projectionMatrix.copy(t.projectionMatrix),this.projectionMatrixInverse.copy(t.projectionMatrixInverse),this.coordinateSystem=t.coordinateSystem,this}getWorldDirection(t){return super.getWorldDirection(t).negate()}updateMatrixWorld(t){super.updateMatrixWorld(t),this.matrixWorldInverse.copy(this.matrixWorld).invert()}updateWorldMatrix(t,n){super.updateWorldMatrix(t,n),this.matrixWorldInverse.copy(this.matrixWorld).invert()}clone(){return new this.constructor().copy(this)}}const ir=new D,Hp=new mt,Gp=new mt;class Pn extends n_{constructor(t=50,n=1,i=.1,r=2e3){super(),this.isPerspectiveCamera=!0,this.type="PerspectiveCamera",this.fov=t,this.zoom=1,this.near=i,this.far=r,this.focus=10,this.aspect=n,this.view=null,this.filmGauge=35,this.filmOffset=0,this.updateProjectionMatrix()}copy(t,n){return super.copy(t,n),this.fov=t.fov,this.zoom=t.zoom,this.near=t.near,this.far=t.far,this.focus=t.focus,this.aspect=t.aspect,this.view=t.view===null?null:Object.assign({},t.view),this.filmGauge=t.filmGauge,this.filmOffset=t.filmOffset,this}setFocalLength(t){const n=.5*this.getFilmHeight()/t;this.fov=Vs*2*Math.atan(n),this.updateProjectionMatrix()}getFocalLength(){const t=Math.tan(Co*.5*this.fov);return .5*this.getFilmHeight()/t}getEffectiveFOV(){return Vs*2*Math.atan(Math.tan(Co*.5*this.fov)/this.zoom)}getFilmWidth(){return this.filmGauge*Math.min(this.aspect,1)}getFilmHeight(){return this.filmGauge/Math.max(this.aspect,1)}getViewBounds(t,n,i){ir.set(-1,-1,.5).applyMatrix4(this.projectionMatrixInverse),n.set(ir.x,ir.y).multiplyScalar(-t/ir.z),ir.set(1,1,.5).applyMatrix4(this.projectionMatrixInverse),i.set(ir.x,ir.y).multiplyScalar(-t/ir.z)}getViewSize(t,n){return this.getViewBounds(t,Hp,Gp),n.subVectors(Gp,Hp)}setViewOffset(t,n,i,r,s,o){this.aspect=t/n,this.view===null&&(this.view={enabled:!0,fullWidth:1,fullHeight:1,offsetX:0,offsetY:0,width:1,height:1}),this.view.enabled=!0,this.view.fullWidth=t,this.view.fullHeight=n,this.view.offsetX=i,this.view.offsetY=r,this.view.width=s,this.view.height=o,this.updateProjectionMatrix()}clearViewOffset(){this.view!==null&&(this.view.enabled=!1),this.updateProjectionMatrix()}updateProjectionMatrix(){const t=this.near;let n=t*Math.tan(Co*.5*this.fov)/this.zoom,i=2*n,r=this.aspect*i,s=-.5*r;const o=this.view;if(this.view!==null&&this.view.enabled){const l=o.fullWidth,c=o.fullHeight;s+=o.offsetX*r/l,n-=o.offsetY*i/c,r*=o.width/l,i*=o.height/c}const a=this.filmOffset;a!==0&&(s+=t*a/this.getFilmWidth()),this.projectionMatrix.makePerspective(s,s+r,n,n-i,t,this.far,this.coordinateSystem,this.reversedDepth),this.projectionMatrixInverse.copy(this.projectionMatrix).invert()}toJSON(t){const n=super.toJSON(t);return n.object.fov=this.fov,n.object.zoom=this.zoom,n.object.near=this.near,n.object.far=this.far,n.object.focus=this.focus,n.object.aspect=this.aspect,this.view!==null&&(n.object.view=Object.assign({},this.view)),n.object.filmGauge=this.filmGauge,n.object.filmOffset=this.filmOffset,n}}const gs=-90,_s=1;class wM extends Te{constructor(t,n,i){super(),this.type="CubeCamera",this.renderTarget=i,this.coordinateSystem=null,this.activeMipmapLevel=0;const r=new Pn(gs,_s,t,n);r.layers=this.layers,this.add(r);const s=new Pn(gs,_s,t,n);s.layers=this.layers,this.add(s);const o=new Pn(gs,_s,t,n);o.layers=this.layers,this.add(o);const a=new Pn(gs,_s,t,n);a.layers=this.layers,this.add(a);const l=new Pn(gs,_s,t,n);l.layers=this.layers,this.add(l);const c=new Pn(gs,_s,t,n);c.layers=this.layers,this.add(c)}updateCoordinateSystem(){const t=this.coordinateSystem,n=this.children.concat(),[i,r,s,o,a,l]=n;for(const c of n)this.remove(c);if(t===gi)i.up.set(0,1,0),i.lookAt(1,0,0),r.up.set(0,1,0),r.lookAt(-1,0,0),s.up.set(0,0,-1),s.lookAt(0,1,0),o.up.set(0,0,1),o.lookAt(0,-1,0),a.up.set(0,1,0),a.lookAt(0,0,1),l.up.set(0,1,0),l.lookAt(0,0,-1);else if(t===pl)i.up.set(0,-1,0),i.lookAt(-1,0,0),r.up.set(0,-1,0),r.lookAt(1,0,0),s.up.set(0,0,1),s.lookAt(0,1,0),o.up.set(0,0,-1),o.lookAt(0,-1,0),a.up.set(0,-1,0),a.lookAt(0,0,1),l.up.set(0,-1,0),l.lookAt(0,0,-1);else throw new Error("THREE.CubeCamera.updateCoordinateSystem(): Invalid coordinate system: "+t);for(const c of n)this.add(c),c.updateMatrixWorld()}update(t,n){this.parent===null&&this.updateMatrixWorld();const{renderTarget:i,activeMipmapLevel:r}=this;this.coordinateSystem!==t.coordinateSystem&&(this.coordinateSystem=t.coordinateSystem,this.updateCoordinateSystem());const[s,o,a,l,c,u]=this.children,h=t.getRenderTarget(),f=t.getActiveCubeFace(),p=t.getActiveMipmapLevel(),g=t.xr.enabled;t.xr.enabled=!1;const _=i.texture.generateMipmaps;i.texture.generateMipmaps=!1,t.setRenderTarget(i,0,r),t.render(n,s),t.setRenderTarget(i,1,r),t.render(n,o),t.setRenderTarget(i,2,r),t.render(n,a),t.setRenderTarget(i,3,r),t.render(n,l),t.setRenderTarget(i,4,r),t.render(n,c),i.texture.generateMipmaps=_,t.setRenderTarget(i,5,r),t.render(n,u),t.setRenderTarget(h,f,p),t.xr.enabled=g,i.texture.needsPMREMUpdate=!0}}class i_ extends bn{constructor(t=[],n=$r,i,r,s,o,a,l,c,u){super(t,n,i,r,s,o,a,l,c,u),this.isCubeTexture=!0,this.flipY=!1}get images(){return this.image}set images(t){this.image=t}}class r_ extends xi{constructor(t=1,n={}){super(t,t,n),this.isWebGLCubeRenderTarget=!0;const i={width:t,height:t,depth:1},r=[i,i,i,i,i,i];this.texture=new i_(r),this._setTextureOptions(n),this.texture.isRenderTargetTexture=!0}fromEquirectangularTexture(t,n){this.texture.type=n.type,this.texture.colorSpace=n.colorSpace,this.texture.generateMipmaps=n.generateMipmaps,this.texture.minFilter=n.minFilter,this.texture.magFilter=n.magFilter;const i={uniforms:{tEquirect:{value:null}},vertexShader:` varying vec3 vWorldDirection; @@ -37,7 +37,7 @@ gl_FragColor = texture2D( tEquirect, sampleUV ); } - `},r=new Be(5,5,5),s=new ii({name:"CubemapFromEquirect",uniforms:Hs(i.uniforms),vertexShader:i.vertexShader,fragmentShader:i.fragmentShader,side:dn,blending:Vi});s.uniforms.tEquirect.value=n;const o=new _t(r,s),a=n.minFilter;return n.minFilter===zr&&(n.minFilter=fn),new wM(1,10,this).update(t,o),n.minFilter=a,o.geometry.dispose(),o.material.dispose(),this}clear(t,n=!0,i=!0,r=!0){const s=t.getRenderTarget();for(let o=0;o<6;o++)t.setRenderTarget(this,o),t.clear(n,i,r);t.setRenderTarget(s)}}class Pa extends Te{constructor(){super(),this.isGroup=!0,this.type="Group"}}const EM={type:"move"};class Pc{constructor(){this._targetRay=null,this._grip=null,this._hand=null}getHandSpace(){return this._hand===null&&(this._hand=new Pa,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 Pa,this._targetRay.matrixAutoUpdate=!1,this._targetRay.visible=!1,this._targetRay.hasLinearVelocity=!1,this._targetRay.linearVelocity=new D,this._targetRay.hasAngularVelocity=!1,this._targetRay.angularVelocity=new D),this._targetRay}getGripSpace(){return this._grip===null&&(this._grip=new Pa,this._grip.matrixAutoUpdate=!1,this._grip.visible=!1,this._grip.hasLinearVelocity=!1,this._grip.linearVelocity=new D,this._grip.hasAngularVelocity=!1,this._grip.angularVelocity=new D),this._grip}dispatchEvent(t){return this._targetRay!==null&&this._targetRay.dispatchEvent(t),this._grip!==null&&this._grip.dispatchEvent(t),this._hand!==null&&this._hand.dispatchEvent(t),this}connect(t){if(t&&t.hand){const n=this._hand;if(n)for(const i of t.hand.values())this._getHandJoint(n,i)}return this.dispatchEvent({type:"connected",data:t}),this}disconnect(t){return this.dispatchEvent({type:"disconnected",data:t}),this._targetRay!==null&&(this._targetRay.visible=!1),this._grip!==null&&(this._grip.visible=!1),this._hand!==null&&(this._hand.visible=!1),this}update(t,n,i){let r=null,s=null,o=null;const a=this._targetRay,l=this._grip,c=this._hand;if(t&&n.session.visibilityState!=="visible-blurred"){if(c&&t.hand){o=!0;for(const v of t.hand.values()){const m=n.getJointPose(v,i),d=this._getHandJoint(c,v);m!==null&&(d.matrix.fromArray(m.transform.matrix),d.matrix.decompose(d.position,d.rotation,d.scale),d.matrixWorldNeedsUpdate=!0,d.jointRadius=m.radius),d.visible=m!==null}const u=c.joints["index-finger-tip"],h=c.joints["thumb-tip"],f=u.position.distanceTo(h.position),p=.02,g=.005;c.inputState.pinching&&f>p+g?(c.inputState.pinching=!1,this.dispatchEvent({type:"pinchend",handedness:t.handedness,target:this})):!c.inputState.pinching&&f<=p-g&&(c.inputState.pinching=!0,this.dispatchEvent({type:"pinchstart",handedness:t.handedness,target:this}))}else l!==null&&t.gripSpace&&(s=n.getPose(t.gripSpace,i),s!==null&&(l.matrix.fromArray(s.transform.matrix),l.matrix.decompose(l.position,l.rotation,l.scale),l.matrixWorldNeedsUpdate=!0,s.linearVelocity?(l.hasLinearVelocity=!0,l.linearVelocity.copy(s.linearVelocity)):l.hasLinearVelocity=!1,s.angularVelocity?(l.hasAngularVelocity=!0,l.angularVelocity.copy(s.angularVelocity)):l.hasAngularVelocity=!1));a!==null&&(r=n.getPose(t.targetRaySpace,i),r===null&&s!==null&&(r=s),r!==null&&(a.matrix.fromArray(r.transform.matrix),a.matrix.decompose(a.position,a.rotation,a.scale),a.matrixWorldNeedsUpdate=!0,r.linearVelocity?(a.hasLinearVelocity=!0,a.linearVelocity.copy(r.linearVelocity)):a.hasLinearVelocity=!1,r.angularVelocity?(a.hasAngularVelocity=!0,a.angularVelocity.copy(r.angularVelocity)):a.hasAngularVelocity=!1,this.dispatchEvent(EM)))}return a!==null&&(a.visible=r!==null),l!==null&&(l.visible=s!==null),c!==null&&(c.visible=o!==null),this}_getHandJoint(t,n){if(t.joints[n.jointName]===void 0){const i=new Pa;i.matrixAutoUpdate=!1,i.visible=!1,t.joints[n.jointName]=i,t.add(i)}return t.joints[n.jointName]}}class TM extends Te{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 ni,this.environmentIntensity=1,this.environmentRotation=new ni,this.overrideMaterial=null,typeof __THREE_DEVTOOLS__<"u"&&__THREE_DEVTOOLS__.dispatchEvent(new CustomEvent("observe",{detail:this}))}copy(t,n){return super.copy(t,n),t.background!==null&&(this.background=t.background.clone()),t.environment!==null&&(this.environment=t.environment.clone()),t.fog!==null&&(this.fog=t.fog.clone()),this.backgroundBlurriness=t.backgroundBlurriness,this.backgroundIntensity=t.backgroundIntensity,this.backgroundRotation.copy(t.backgroundRotation),this.environmentIntensity=t.environmentIntensity,this.environmentRotation.copy(t.environmentRotation),t.overrideMaterial!==null&&(this.overrideMaterial=t.overrideMaterial.clone()),this.matrixAutoUpdate=t.matrixAutoUpdate,this}toJSON(t){const n=super.toJSON(t);return this.fog!==null&&(n.object.fog=this.fog.toJSON()),this.backgroundBlurriness>0&&(n.object.backgroundBlurriness=this.backgroundBlurriness),this.backgroundIntensity!==1&&(n.object.backgroundIntensity=this.backgroundIntensity),n.object.backgroundRotation=this.backgroundRotation.toArray(),this.environmentIntensity!==1&&(n.object.environmentIntensity=this.environmentIntensity),n.object.environmentRotation=this.environmentRotation.toArray(),n}}class AM extends Sn{constructor(t=null,n=1,i=1,r,s,o,a,l,c=rn,u=rn,h,f){super(null,o,a,l,c,u,r,s,h,f),this.isDataTexture=!0,this.image={data:t,width:n,height:i},this.generateMipmaps=!1,this.flipY=!1,this.unpackAlignment=1}}const Cc=new D,PM=new D,CM=new ie;let Fi=class{constructor(t=new D(1,0,0),n=0){this.isPlane=!0,this.normal=t,this.constant=n}set(t,n){return this.normal.copy(t),this.constant=n,this}setComponents(t,n,i,r){return this.normal.set(t,n,i),this.constant=r,this}setFromNormalAndCoplanarPoint(t,n){return this.normal.copy(t),this.constant=-n.dot(this.normal),this}setFromCoplanarPoints(t,n,i){const r=Cc.subVectors(i,n).cross(PM.subVectors(t,n)).normalize();return this.setFromNormalAndCoplanarPoint(r,t),this}copy(t){return this.normal.copy(t.normal),this.constant=t.constant,this}normalize(){const t=1/this.normal.length();return this.normal.multiplyScalar(t),this.constant*=t,this}negate(){return this.constant*=-1,this.normal.negate(),this}distanceToPoint(t){return this.normal.dot(t)+this.constant}distanceToSphere(t){return this.distanceToPoint(t.center)-t.radius}projectPoint(t,n){return n.copy(t).addScaledVector(this.normal,-this.distanceToPoint(t))}intersectLine(t,n){const i=t.delta(Cc),r=this.normal.dot(i);if(r===0)return this.distanceToPoint(t.start)===0?n.copy(t.start):null;const s=-(t.start.dot(this.normal)+this.constant)/r;return s<0||s>1?null:n.copy(t.start).addScaledVector(i,s)}intersectsLine(t){const n=this.distanceToPoint(t.start),i=this.distanceToPoint(t.end);return n<0&&i>0||i<0&&n>0}intersectsBox(t){return t.intersectsPlane(this)}intersectsSphere(t){return t.intersectsPlane(this)}coplanarPoint(t){return t.copy(this.normal).multiplyScalar(-this.constant)}applyMatrix4(t,n){const i=n||CM.getNormalMatrix(t),r=this.coplanarPoint(Cc).applyMatrix4(t),s=this.normal.applyMatrix3(i).normalize();return this.constant=-r.dot(s),this}translate(t){return this.constant-=t.dot(this.normal),this}equals(t){return t.normal.equals(this.normal)&&t.constant===this.constant}clone(){return new this.constructor().copy(this)}};const Dr=new Qo,RM=new mt(.5,.5),Ca=new D;class vf{constructor(t=new Fi,n=new Fi,i=new Fi,r=new Fi,s=new Fi,o=new Fi){this.planes=[t,n,i,r,s,o]}set(t,n,i,r,s,o){const a=this.planes;return a[0].copy(t),a[1].copy(n),a[2].copy(i),a[3].copy(r),a[4].copy(s),a[5].copy(o),this}copy(t){const n=this.planes;for(let i=0;i<6;i++)n[i].copy(t.planes[i]);return this}setFromProjectionMatrix(t,n=gi,i=!1){const r=this.planes,s=t.elements,o=s[0],a=s[1],l=s[2],c=s[3],u=s[4],h=s[5],f=s[6],p=s[7],g=s[8],v=s[9],m=s[10],d=s[11],S=s[12],y=s[13],x=s[14],A=s[15];if(r[0].setComponents(c-o,p-u,d-g,A-S).normalize(),r[1].setComponents(c+o,p+u,d+g,A+S).normalize(),r[2].setComponents(c+a,p+h,d+v,A+y).normalize(),r[3].setComponents(c-a,p-h,d-v,A-y).normalize(),i)r[4].setComponents(l,f,m,x).normalize(),r[5].setComponents(c-l,p-f,d-m,A-x).normalize();else if(r[4].setComponents(c-l,p-f,d-m,A-x).normalize(),n===gi)r[5].setComponents(c+l,p+f,d+m,A+x).normalize();else if(n===pl)r[5].setComponents(l,f,m,x).normalize();else throw new Error("THREE.Frustum.setFromProjectionMatrix(): Invalid coordinate system: "+n);return this}intersectsObject(t){if(t.boundingSphere!==void 0)t.boundingSphere===null&&t.computeBoundingSphere(),Dr.copy(t.boundingSphere).applyMatrix4(t.matrixWorld);else{const n=t.geometry;n.boundingSphere===null&&n.computeBoundingSphere(),Dr.copy(n.boundingSphere).applyMatrix4(t.matrixWorld)}return this.intersectsSphere(Dr)}intersectsSprite(t){Dr.center.set(0,0,0);const n=RM.distanceTo(t.center);return Dr.radius=.7071067811865476+n,Dr.applyMatrix4(t.matrixWorld),this.intersectsSphere(Dr)}intersectsSphere(t){const n=this.planes,i=t.center,r=-t.radius;for(let s=0;s<6;s++)if(n[s].distanceToPoint(i)0?t.max.x:t.min.x,Ca.y=r.normal.y>0?t.max.y:t.min.y,Ca.z=r.normal.z>0?t.max.z:t.min.z,r.distanceToPoint(Ca)<0)return!1}return!0}containsPoint(t){const n=this.planes;for(let i=0;i<6;i++)if(n[i].distanceToPoint(t)<0)return!1;return!0}clone(){return new this.constructor().copy(this)}}class ri extends es{constructor(t){super(),this.isLineBasicMaterial=!0,this.type="LineBasicMaterial",this.color=new $t(16777215),this.map=null,this.linewidth=1,this.linecap="round",this.linejoin="round",this.fog=!0,this.setValues(t)}copy(t){return super.copy(t),this.color.copy(t.color),this.map=t.map,this.linewidth=t.linewidth,this.linecap=t.linecap,this.linejoin=t.linejoin,this.fog=t.fog,this}}const gl=new D,_l=new D,Wp=new he,lo=new jo,Ra=new Qo,Rc=new D,Xp=new D;let en=class extends Te{constructor(t=new fe,n=new ri){super(),this.isLine=!0,this.type="Line",this.geometry=t,this.material=n,this.morphTargetDictionary=void 0,this.morphTargetInfluences=void 0,this.updateMorphTargets()}copy(t,n){return super.copy(t,n),this.material=Array.isArray(t.material)?t.material.slice():t.material,this.geometry=t.geometry,this}computeLineDistances(){const t=this.geometry;if(t.index===null){const n=t.attributes.position,i=[0];for(let r=1,s=n.count;r0){const r=n[i[0]];if(r!==void 0){this.morphTargetInfluences=[],this.morphTargetDictionary={};for(let s=0,o=r.length;si)return;Rc.applyMatrix4(e.matrixWorld);const c=t.ray.origin.distanceTo(Rc);if(!(ct.far))return{distance:c,point:Xp.clone().applyMatrix4(e.matrixWorld),index:o,face:null,faceIndex:null,barycoord:null,object:e}}const qp=new D,Yp=new D;class s_ extends en{constructor(t,n){super(t,n),this.isLineSegments=!0,this.type="LineSegments"}computeLineDistances(){const t=this.geometry;if(t.index===null){const n=t.attributes.position,i=[];for(let r=0,s=n.count;r0){const r=n[i[0]];if(r!==void 0){this.morphTargetInfluences=[],this.morphTargetDictionary={};for(let s=0,o=r.length;sr.far)return;s.push({distance:c,distanceToRay:Math.sqrt(a),point:l,index:t,face:null,faceIndex:null,barycoord:null,object:o})}}class Go extends Sn{constructor(t,n,i=Mi,r,s,o,a=rn,l=rn,c,u=Ji,h=1){if(u!==Ji&&u!==Vr)throw new Error("DepthTexture format must be either THREE.DepthFormat or THREE.DepthStencilFormat");const f={width:t,height:n,depth:h};super(f,r,s,o,a,l,u,i,c),this.isDepthTexture=!0,this.flipY=!1,this.generateMipmaps=!1,this.compareFunction=null}copy(t){return super.copy(t),this.source=new gf(Object.assign({},t.image)),this.compareFunction=t.compareFunction,this}toJSON(t){const n=super.toJSON(t);return this.compareFunction!==null&&(n.compareFunction=this.compareFunction),n}}class DM extends Go{constructor(t,n=Mi,i=$r,r,s,o=rn,a=rn,l,c=Ji){const u={width:t,height:t,depth:1},h=[u,u,u,u,u,u];super(t,t,n,i,r,s,o,a,l,c),this.image=h,this.isCubeDepthTexture=!0,this.isCubeTexture=!0}get images(){return this.image}set images(t){this.image=t}}class o_ extends Sn{constructor(t=null){super(),this.sourceTexture=t,this.isExternalTexture=!0}copy(t){return super.copy(t),this.sourceTexture=t.sourceTexture,this}}class Sf extends fe{constructor(t=1,n=1,i=4,r=8,s=1){super(),this.type="CapsuleGeometry",this.parameters={radius:t,height:n,capSegments:i,radialSegments:r,heightSegments:s},n=Math.max(0,n),i=Math.max(1,Math.floor(i)),r=Math.max(3,Math.floor(r)),s=Math.max(1,Math.floor(s));const o=[],a=[],l=[],c=[],u=n/2,h=Math.PI/2*t,f=n,p=2*h+f,g=i*2+s,v=r+1,m=new D,d=new D;for(let S=0;S<=g;S++){let y=0,x=0,A=0,P=0;if(S<=i){const b=S/i,M=b*Math.PI/2;x=-u-t*Math.cos(M),A=t*Math.sin(M),P=-t*Math.cos(M),y=b*h}else if(S<=i+s){const b=(S-i)/s;x=-u+b*n,A=t,P=0,y=h+b*f}else{const b=(S-i-s)/i,M=b*Math.PI/2;x=u+t*Math.sin(M),A=t*Math.cos(M),P=t*Math.sin(M),y=h+f+b*h}const C=Math.max(0,Math.min(1,y/p));let R=0;S===0?R=.5/r:S===g&&(R=-.5/r);for(let b=0;b<=r;b++){const M=b/r,L=M*Math.PI*2,V=Math.sin(L),q=Math.cos(L);d.x=-A*q,d.y=x,d.z=A*V,a.push(d.x,d.y,d.z),m.set(-A*q,P,A*V),m.normalize(),l.push(m.x,m.y,m.z),c.push(M+R,C)}if(S>0){const b=(S-1)*v;for(let M=0;M0&&y(!0),n>0&&y(!1)),this.setIndex(u),this.setAttribute("position",new te(h,3)),this.setAttribute("normal",new te(f,3)),this.setAttribute("uv",new te(p,2));function S(){const x=new D,A=new D;let P=0;const C=(n-t)/i;for(let R=0;R<=s;R++){const b=[],M=R/s,L=M*(n-t)+t;for(let V=0;V<=r;V++){const q=V/r,j=q*l+a,J=Math.sin(j),W=Math.cos(j);A.x=L*J,A.y=-M*i+m,A.z=L*W,h.push(A.x,A.y,A.z),x.set(J,C,W).normalize(),f.push(x.x,x.y,x.z),p.push(q,1-M),b.push(g++)}v.push(b)}for(let R=0;R0||b!==0)&&(u.push(M,L,q),P+=3),(n>0||b!==s-1)&&(u.push(L,V,q),P+=3)}c.addGroup(d,P,0),d+=P}function y(x){const A=g,P=new mt,C=new D;let R=0;const b=x===!0?t:n,M=x===!0?1:-1;for(let V=1;V<=r;V++)h.push(0,m*M,0),f.push(0,M,0),p.push(.5,.5),g++;const L=g;for(let V=0;V<=r;V++){const j=V/r*l+a,J=Math.cos(j),W=Math.sin(j);C.x=b*W,C.y=m*M,C.z=b*J,h.push(C.x,C.y,C.z),f.push(0,M,0),P.x=J*.5+.5,P.y=W*.5*M+.5,p.push(P.x,P.y),g++}for(let V=0;V.9&&C<.1&&(y<.2&&(o[S+0]+=1),x<.2&&(o[S+2]+=1),A<.2&&(o[S+4]+=1))}}function f(S){s.push(S.x,S.y,S.z)}function p(S,y){const x=S*3;y.x=t[x+0],y.y=t[x+1],y.z=t[x+2]}function g(){const S=new D,y=new D,x=new D,A=new D,P=new mt,C=new mt,R=new mt;for(let b=0,M=0;b0)l=r-1;else{l=r;break}if(r=l,i[r]===o)return r/(s-1);const u=i[r],f=i[r+1]-u,p=(o-u)/f;return(r+p)/(s-1)}getTangent(t,n){let r=t-1e-4,s=t+1e-4;r<0&&(r=0),s>1&&(s=1);const o=this.getPoint(r),a=this.getPoint(s),l=n||(o.isVector2?new mt:new D);return l.copy(a).sub(o).normalize(),l}getTangentAt(t,n){const i=this.getUtoTmapping(t);return this.getTangent(i,n)}computeFrenetFrames(t,n=!1){const i=new D,r=[],s=[],o=[],a=new D,l=new he;for(let p=0;p<=t;p++){const g=p/t;r[p]=this.getTangentAt(g,new D)}s[0]=new D,o[0]=new D;let c=Number.MAX_VALUE;const u=Math.abs(r[0].x),h=Math.abs(r[0].y),f=Math.abs(r[0].z);u<=c&&(c=u,i.set(1,0,0)),h<=c&&(c=h,i.set(0,1,0)),f<=c&&i.set(0,0,1),a.crossVectors(r[0],i).normalize(),s[0].crossVectors(r[0],a),o[0].crossVectors(r[0],s[0]);for(let p=1;p<=t;p++){if(s[p]=s[p-1].clone(),o[p]=o[p-1].clone(),a.crossVectors(r[p-1],r[p]),a.length()>Number.EPSILON){a.normalize();const g=Math.acos(re(r[p-1].dot(r[p]),-1,1));s[p].applyMatrix4(l.makeRotationAxis(a,g))}o[p].crossVectors(r[p],s[p])}if(n===!0){let p=Math.acos(re(s[0].dot(s[t]),-1,1));p/=t,r[0].dot(a.crossVectors(s[0],s[t]))>0&&(p=-p);for(let g=1;g<=t;g++)s[g].applyMatrix4(l.makeRotationAxis(r[g],p*g)),o[g].crossVectors(r[g],s[g])}return{tangents:r,normals:s,binormals:o}}clone(){return new this.constructor().copy(this)}copy(t){return this.arcLengthDivisions=t.arcLengthDivisions,this}toJSON(){const t={metadata:{version:4.7,type:"Curve",generator:"Curve.toJSON"}};return t.arcLengthDivisions=this.arcLengthDivisions,t.type=this.type,t}fromJSON(t){return this.arcLengthDivisions=t.arcLengthDivisions,this}}class wf extends Ei{constructor(t=0,n=0,i=1,r=1,s=0,o=Math.PI*2,a=!1,l=0){super(),this.isEllipseCurve=!0,this.type="EllipseCurve",this.aX=t,this.aY=n,this.xRadius=i,this.yRadius=r,this.aStartAngle=s,this.aEndAngle=o,this.aClockwise=a,this.aRotation=l}getPoint(t,n=new mt){const i=n,r=Math.PI*2;let s=this.aEndAngle-this.aStartAngle;const o=Math.abs(s)r;)s-=r;s0?0:(Math.floor(Math.abs(a)/s)+1)*s:l===0&&a===s-1&&(a=s-2,l=1);let c,u;this.closed||a>0?c=r[(a-1)%s]:(Na.subVectors(r[0],r[1]).add(r[0]),c=Na);const h=r[a%s],f=r[(a+1)%s];if(this.closed||a+2r.length-2?r.length-1:o+1],h=r[o>r.length-3?r.length-1:o+2];return i.set(Zp(a,l.x,c.x,u.x,h.x),Zp(a,l.y,c.y,u.y,h.y)),i}copy(t){super.copy(t),this.points=[];for(let n=0,i=t.points.length;n=i){const o=r[s]-i,a=this.curves[s],l=a.getLength(),c=l===0?0:1-o/l;return a.getPointAt(c,n)}s++}return null}getLength(){const t=this.getCurveLengths();return t[t.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 t=[];let n=0;for(let i=0,r=this.curves.length;i1&&!n[n.length-1].equals(n[0])&&n.push(n[0]),n}copy(t){super.copy(t),this.curves=[];for(let n=0,i=t.curves.length;n0){const h=c.getPoint(0);h.equals(this.currentPoint)||this.lineTo(h.x,h.y)}this.curves.push(c);const u=c.getPoint(1);return this.currentPoint.copy(u),this}copy(t){return super.copy(t),this.currentPoint.copy(t.currentPoint),this}toJSON(){const t=super.toJSON();return t.currentPoint=this.currentPoint.toArray(),t}fromJSON(t){return super.fromJSON(t),this.currentPoint.fromArray(t.currentPoint),this}}class el extends nh{constructor(t){super(t),this.uuid=ts(),this.type="Shape",this.holes=[]}getPointsHoles(t){const n=[];for(let i=0,r=this.holes.length;i80*n){a=e[0],l=e[1];let u=a,h=l;for(let f=n;fu&&(u=p),g>h&&(h=g)}c=Math.max(u-a,h-l),c=c!==0?32767/c:0}return Wo(s,o,n,a,l,c,0),o}function h_(e,t,n,i,r){let s;if(r===aw(e,t,n,i)>0)for(let o=t;o=t;o-=i)s=Kp(o/i|0,e[o],e[o+1],s);return s&&Gs(s,s.next)&&(qo(s),s=s.next),s}function Zr(e,t){if(!e)return e;t||(t=e);let n=e,i;do if(i=!1,!n.steiner&&(Gs(n,n.next)||Ue(n.prev,n,n.next)===0)){if(qo(n),n=t=n.prev,n===n.next)break;i=!0}else n=n.next;while(i||n!==t);return t}function Wo(e,t,n,i,r,s,o){if(!e)return;!o&&s&&ew(e,i,r,s);let a=e;for(;e.prev!==e.next;){const l=e.prev,c=e.next;if(s?YM(e,i,r,s):qM(e)){t.push(l.i,e.i,c.i),qo(e),e=c.next,a=c.next;continue}if(e=c,e===a){o?o===1?(e=JM(Zr(e),t),Wo(e,t,n,i,r,s,2)):o===2&&$M(e,t,n,i,r,s):Wo(Zr(e),t,n,i,r,s,1);break}}}function qM(e){const t=e.prev,n=e,i=e.next;if(Ue(t,n,i)>=0)return!1;const r=t.x,s=n.x,o=i.x,a=t.y,l=n.y,c=i.y,u=Math.min(r,s,o),h=Math.min(a,l,c),f=Math.max(r,s,o),p=Math.max(a,l,c);let g=i.next;for(;g!==t;){if(g.x>=u&&g.x<=f&&g.y>=h&&g.y<=p&&vo(r,a,s,l,o,c,g.x,g.y)&&Ue(g.prev,g,g.next)>=0)return!1;g=g.next}return!0}function YM(e,t,n,i){const r=e.prev,s=e,o=e.next;if(Ue(r,s,o)>=0)return!1;const a=r.x,l=s.x,c=o.x,u=r.y,h=s.y,f=o.y,p=Math.min(a,l,c),g=Math.min(u,h,f),v=Math.max(a,l,c),m=Math.max(u,h,f),d=ih(p,g,t,n,i),S=ih(v,m,t,n,i);let y=e.prevZ,x=e.nextZ;for(;y&&y.z>=d&&x&&x.z<=S;){if(y.x>=p&&y.x<=v&&y.y>=g&&y.y<=m&&y!==r&&y!==o&&vo(a,u,l,h,c,f,y.x,y.y)&&Ue(y.prev,y,y.next)>=0||(y=y.prevZ,x.x>=p&&x.x<=v&&x.y>=g&&x.y<=m&&x!==r&&x!==o&&vo(a,u,l,h,c,f,x.x,x.y)&&Ue(x.prev,x,x.next)>=0))return!1;x=x.nextZ}for(;y&&y.z>=d;){if(y.x>=p&&y.x<=v&&y.y>=g&&y.y<=m&&y!==r&&y!==o&&vo(a,u,l,h,c,f,y.x,y.y)&&Ue(y.prev,y,y.next)>=0)return!1;y=y.prevZ}for(;x&&x.z<=S;){if(x.x>=p&&x.x<=v&&x.y>=g&&x.y<=m&&x!==r&&x!==o&&vo(a,u,l,h,c,f,x.x,x.y)&&Ue(x.prev,x,x.next)>=0)return!1;x=x.nextZ}return!0}function JM(e,t){let n=e;do{const i=n.prev,r=n.next.next;!Gs(i,r)&&d_(i,n,n.next,r)&&Xo(i,r)&&Xo(r,i)&&(t.push(i.i,n.i,r.i),qo(n),qo(n.next),n=e=r),n=n.next}while(n!==e);return Zr(n)}function $M(e,t,n,i,r,s){let o=e;do{let a=o.next.next;for(;a!==o.prev;){if(o.i!==a.i&&rw(o,a)){let l=p_(o,a);o=Zr(o,o.next),l=Zr(l,l.next),Wo(o,t,n,i,r,s,0),Wo(l,t,n,i,r,s,0);return}a=a.next}o=o.next}while(o!==e)}function ZM(e,t,n,i){const r=[];for(let s=0,o=t.length;s=n.next.y&&n.next.y!==n.y){const h=n.x+(r-n.y)*(n.next.x-n.x)/(n.next.y-n.y);if(h<=i&&h>s&&(s=h,o=n.x=n.x&&n.x>=l&&i!==n.x&&f_(ro.x||n.x===o.x&&tw(o,n)))&&(o=n,u=h)}n=n.next}while(n!==a);return o}function tw(e,t){return Ue(e.prev,e,t.prev)<0&&Ue(t.next,e,e.next)<0}function ew(e,t,n,i){let r=e;do r.z===0&&(r.z=ih(r.x,r.y,t,n,i)),r.prevZ=r.prev,r.nextZ=r.next,r=r.next;while(r!==e);r.prevZ.nextZ=null,r.prevZ=null,nw(r)}function nw(e){let t,n=1;do{let i=e,r;e=null;let s=null;for(t=0;i;){t++;let o=i,a=0;for(let c=0;c0||l>0&&o;)a!==0&&(l===0||!o||i.z<=o.z)?(r=i,i=i.nextZ,a--):(r=o,o=o.nextZ,l--),s?s.nextZ=r:e=r,r.prevZ=s,s=r;i=o}s.nextZ=null,n*=2}while(t>1);return e}function ih(e,t,n,i,r){return e=(e-n)*r|0,t=(t-i)*r|0,e=(e|e<<8)&16711935,e=(e|e<<4)&252645135,e=(e|e<<2)&858993459,e=(e|e<<1)&1431655765,t=(t|t<<8)&16711935,t=(t|t<<4)&252645135,t=(t|t<<2)&858993459,t=(t|t<<1)&1431655765,e|t<<1}function iw(e){let t=e,n=e;do(t.x=(e-o)*(s-a)&&(e-o)*(i-a)>=(n-o)*(t-a)&&(n-o)*(s-a)>=(r-o)*(i-a)}function vo(e,t,n,i,r,s,o,a){return!(e===o&&t===a)&&f_(e,t,n,i,r,s,o,a)}function rw(e,t){return e.next.i!==t.i&&e.prev.i!==t.i&&!sw(e,t)&&(Xo(e,t)&&Xo(t,e)&&ow(e,t)&&(Ue(e.prev,e,t.prev)||Ue(e,t.prev,t))||Gs(e,t)&&Ue(e.prev,e,e.next)>0&&Ue(t.prev,t,t.next)>0)}function Ue(e,t,n){return(t.y-e.y)*(n.x-t.x)-(t.x-e.x)*(n.y-t.y)}function Gs(e,t){return e.x===t.x&&e.y===t.y}function d_(e,t,n,i){const r=Oa(Ue(e,t,n)),s=Oa(Ue(e,t,i)),o=Oa(Ue(n,i,e)),a=Oa(Ue(n,i,t));return!!(r!==s&&o!==a||r===0&&Ua(e,n,t)||s===0&&Ua(e,i,t)||o===0&&Ua(n,e,i)||a===0&&Ua(n,t,i))}function Ua(e,t,n){return t.x<=Math.max(e.x,n.x)&&t.x>=Math.min(e.x,n.x)&&t.y<=Math.max(e.y,n.y)&&t.y>=Math.min(e.y,n.y)}function Oa(e){return e>0?1:e<0?-1:0}function sw(e,t){let n=e;do{if(n.i!==e.i&&n.next.i!==e.i&&n.i!==t.i&&n.next.i!==t.i&&d_(n,n.next,e,t))return!0;n=n.next}while(n!==e);return!1}function Xo(e,t){return Ue(e.prev,e,e.next)<0?Ue(e,t,e.next)>=0&&Ue(e,e.prev,t)>=0:Ue(e,t,e.prev)<0||Ue(e,e.next,t)<0}function ow(e,t){let n=e,i=!1;const r=(e.x+t.x)/2,s=(e.y+t.y)/2;do n.y>s!=n.next.y>s&&n.next.y!==n.y&&r<(n.next.x-n.x)*(s-n.y)/(n.next.y-n.y)+n.x&&(i=!i),n=n.next;while(n!==e);return i}function p_(e,t){const n=rh(e.i,e.x,e.y),i=rh(t.i,t.x,t.y),r=e.next,s=t.prev;return e.next=t,t.prev=e,n.next=r,r.prev=n,i.next=n,n.prev=i,s.next=i,i.prev=s,i}function Kp(e,t,n,i){const r=rh(e,t,n);return i?(r.next=i.next,r.prev=i,i.next.prev=r,i.next=r):(r.prev=r,r.next=r),r}function qo(e){e.next.prev=e.prev,e.prev.next=e.next,e.prevZ&&(e.prevZ.nextZ=e.nextZ),e.nextZ&&(e.nextZ.prevZ=e.prevZ)}function rh(e,t,n){return{i:e,x:t,y:n,prev:null,next:null,z:0,prevZ:null,nextZ:null,steiner:!1}}function aw(e,t,n,i){let r=0;for(let s=t,o=n-i;s2&&e[t-1].equals(e[0])&&e.pop()}function jp(e,t){for(let n=0;nNumber.EPSILON){const Y=Math.sqrt(_),nt=Math.sqrt(it*it+w*w),$=z.x-Q/Y,wt=z.y+K/Y,ht=F.x-w/nt,Ct=F.y+it/nt,zt=((ht-$)*w-(Ct-wt)*it)/(K*w-Q*it);X=$+K*zt-U.x,E=wt+Q*zt-U.y;const ut=X*X+E*E;if(ut<=2)return new mt(X,E);rt=Math.sqrt(ut/2)}else{let Y=!1;K>Number.EPSILON?it>Number.EPSILON&&(Y=!0):K<-Number.EPSILON?it<-Number.EPSILON&&(Y=!0):Math.sign(Q)===Math.sign(w)&&(Y=!0),Y?(X=-Q,E=K,rt=Math.sqrt(_)):(X=K,E=Q,rt=Math.sqrt(_/2))}return new mt(X/rt,E/rt)}const ct=[];for(let U=0,z=J.length,F=z-1,X=U+1;U=0;U--){const z=U/m,F=p*Math.cos(z*Math.PI/2),X=g*Math.sin(z*Math.PI/2)+v;for(let E=0,rt=J.length;E=0;){const X=F;let E=F-1;E<0&&(E=U.length-1);for(let rt=0,K=u+m*2;rt0)&&p.push(y,x,P),(d!==i-1||l0!=t>0&&this.version++,this._anisotropy=t}get clearcoat(){return this._clearcoat}set clearcoat(t){this._clearcoat>0!=t>0&&this.version++,this._clearcoat=t}get iridescence(){return this._iridescence}set iridescence(t){this._iridescence>0!=t>0&&this.version++,this._iridescence=t}get dispersion(){return this._dispersion}set dispersion(t){this._dispersion>0!=t>0&&this.version++,this._dispersion=t}get sheen(){return this._sheen}set sheen(t){this._sheen>0!=t>0&&this.version++,this._sheen=t}get transmission(){return this._transmission}set transmission(t){this._transmission>0!=t>0&&this.version++,this._transmission=t}copy(t){return super.copy(t),this.defines={STANDARD:"",PHYSICAL:""},this.anisotropy=t.anisotropy,this.anisotropyRotation=t.anisotropyRotation,this.anisotropyMap=t.anisotropyMap,this.clearcoat=t.clearcoat,this.clearcoatMap=t.clearcoatMap,this.clearcoatRoughness=t.clearcoatRoughness,this.clearcoatRoughnessMap=t.clearcoatRoughnessMap,this.clearcoatNormalMap=t.clearcoatNormalMap,this.clearcoatNormalScale.copy(t.clearcoatNormalScale),this.dispersion=t.dispersion,this.ior=t.ior,this.iridescence=t.iridescence,this.iridescenceMap=t.iridescenceMap,this.iridescenceIOR=t.iridescenceIOR,this.iridescenceThicknessRange=[...t.iridescenceThicknessRange],this.iridescenceThicknessMap=t.iridescenceThicknessMap,this.sheen=t.sheen,this.sheenColor.copy(t.sheenColor),this.sheenColorMap=t.sheenColorMap,this.sheenRoughness=t.sheenRoughness,this.sheenRoughnessMap=t.sheenRoughnessMap,this.transmission=t.transmission,this.transmissionMap=t.transmissionMap,this.thickness=t.thickness,this.thicknessMap=t.thicknessMap,this.attenuationDistance=t.attenuationDistance,this.attenuationColor.copy(t.attenuationColor),this.specularIntensity=t.specularIntensity,this.specularIntensityMap=t.specularIntensityMap,this.specularColor.copy(t.specularColor),this.specularColorMap=t.specularColorMap,this}}class dw extends es{constructor(t){super(),this.isMeshDepthMaterial=!0,this.type="MeshDepthMaterial",this.depthPacking=Ib,this.map=null,this.alphaMap=null,this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.wireframe=!1,this.wireframeLinewidth=1,this.setValues(t)}copy(t){return super.copy(t),this.depthPacking=t.depthPacking,this.map=t.map,this.alphaMap=t.alphaMap,this.displacementMap=t.displacementMap,this.displacementScale=t.displacementScale,this.displacementBias=t.displacementBias,this.wireframe=t.wireframe,this.wireframeLinewidth=t.wireframeLinewidth,this}}class pw extends es{constructor(t){super(),this.isMeshDistanceMaterial=!0,this.type="MeshDistanceMaterial",this.map=null,this.alphaMap=null,this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.setValues(t)}copy(t){return super.copy(t),this.map=t.map,this.alphaMap=t.alphaMap,this.displacementMap=t.displacementMap,this.displacementScale=t.displacementScale,this.displacementBias=t.displacementBias,this}}const tm={enabled:!1,files:{},add:function(e,t){this.enabled!==!1&&(this.files[e]=t)},get:function(e){if(this.enabled!==!1)return this.files[e]},remove:function(e){delete this.files[e]},clear:function(){this.files={}}};class mw{constructor(t,n,i){const r=this;let s=!1,o=0,a=0,l;const c=[];this.onStart=void 0,this.onLoad=t,this.onProgress=n,this.onError=i,this._abortController=null,this.itemStart=function(u){a++,s===!1&&r.onStart!==void 0&&r.onStart(u,o,a),s=!0},this.itemEnd=function(u){o++,r.onProgress!==void 0&&r.onProgress(u,o,a),o===a&&(s=!1,r.onLoad!==void 0&&r.onLoad())},this.itemError=function(u){r.onError!==void 0&&r.onError(u)},this.resolveURL=function(u){return l?l(u):u},this.setURLModifier=function(u){return l=u,this},this.addHandler=function(u,h){return c.push(u,h),this},this.removeHandler=function(u){const h=c.indexOf(u);return h!==-1&&c.splice(h,2),this},this.getHandler=function(u){for(let h=0,f=c.length;h{n&&n(s),this.manager.itemEnd(t)},0),s;if(Ni[t]!==void 0){Ni[t].push({onLoad:n,onProgress:i,onError:r});return}Ni[t]=[],Ni[t].push({onLoad:n,onProgress:i,onError:r});const o=new Request(t,{headers:new Headers(this.requestHeader),credentials:this.withCredentials?"include":"same-origin",signal:typeof AbortSignal.any=="function"?AbortSignal.any([this._abortController.signal,this.manager.abortController.signal]):this._abortController.signal}),a=this.mimeType,l=this.responseType;fetch(o).then(c=>{if(c.status===200||c.status===0){if(c.status===0&&Yt("FileLoader: HTTP Status 0 received."),typeof ReadableStream>"u"||c.body===void 0||c.body.getReader===void 0)return c;const u=Ni[t],h=c.body.getReader(),f=c.headers.get("X-File-Size")||c.headers.get("Content-Length"),p=f?parseInt(f):0,g=p!==0;let v=0;const m=new ReadableStream({start(d){S();function S(){h.read().then(({done:y,value:x})=>{if(y)d.close();else{v+=x.byteLength;const A=new ProgressEvent("progress",{lengthComputable:g,loaded:v,total:p});for(let P=0,C=u.length;P{d.error(y)})}}});return new Response(m)}else throw new _w(`fetch for "${c.url}" responded with ${c.status}: ${c.statusText}`,c)}).then(c=>{switch(l){case"arraybuffer":return c.arrayBuffer();case"blob":return c.blob();case"document":return c.text().then(u=>new DOMParser().parseFromString(u,a));case"json":return c.json();default:if(a==="")return c.text();{const h=/charset="?([^;"\s]*)"?/i.exec(a),f=h&&h[1]?h[1].toLowerCase():void 0,p=new TextDecoder(f);return c.arrayBuffer().then(g=>p.decode(g))}}}).then(c=>{tm.add(`file:${t}`,c);const u=Ni[t];delete Ni[t];for(let h=0,f=u.length;h{const u=Ni[t];if(u===void 0)throw this.manager.itemError(t),c;delete Ni[t];for(let h=0,f=u.length;h{this.manager.itemEnd(t)}),this.manager.itemStart(t)}setResponseType(t){return this.responseType=t,this}setMimeType(t){return this.mimeType=t,this}abort(){return this._abortController.abort(),this._abortController=new AbortController,this}}class na extends Te{constructor(t,n=1){super(),this.isLight=!0,this.type="Light",this.color=new $t(t),this.intensity=n}dispose(){this.dispatchEvent({type:"dispose"})}copy(t,n){return super.copy(t,n),this.color.copy(t.color),this.intensity=t.intensity,this}toJSON(t){const n=super.toJSON(t);return n.object.color=this.color.getHex(),n.object.intensity=this.intensity,n}}const Nc=new he,em=new D,nm=new D;class Pf{constructor(t){this.camera=t,this.intensity=1,this.bias=0,this.normalBias=0,this.radius=1,this.blurSamples=8,this.mapSize=new mt(512,512),this.mapType=kn,this.map=null,this.mapPass=null,this.matrix=new he,this.autoUpdate=!0,this.needsUpdate=!1,this._frustum=new vf,this._frameExtents=new mt(1,1),this._viewportCount=1,this._viewports=[new ze(0,0,1,1)]}getViewportCount(){return this._viewportCount}getFrustum(){return this._frustum}updateMatrices(t){const n=this.camera,i=this.matrix;em.setFromMatrixPosition(t.matrixWorld),n.position.copy(em),nm.setFromMatrixPosition(t.target.matrixWorld),n.lookAt(nm),n.updateMatrixWorld(),Nc.multiplyMatrices(n.projectionMatrix,n.matrixWorldInverse),this._frustum.setFromProjectionMatrix(Nc,n.coordinateSystem,n.reversedDepth),n.reversedDepth?i.set(.5,0,0,.5,0,.5,0,.5,0,0,1,0,0,0,0,1):i.set(.5,0,0,.5,0,.5,0,.5,0,0,.5,.5,0,0,0,1),i.multiply(Nc)}getViewport(t){return this._viewports[t]}getFrameExtents(){return this._frameExtents}dispose(){this.map&&this.map.dispose(),this.mapPass&&this.mapPass.dispose()}copy(t){return this.camera=t.camera.clone(),this.intensity=t.intensity,this.bias=t.bias,this.radius=t.radius,this.autoUpdate=t.autoUpdate,this.needsUpdate=t.needsUpdate,this.normalBias=t.normalBias,this.blurSamples=t.blurSamples,this.mapSize.copy(t.mapSize),this}clone(){return new this.constructor().copy(this)}toJSON(){const t={};return this.intensity!==1&&(t.intensity=this.intensity),this.bias!==0&&(t.bias=this.bias),this.normalBias!==0&&(t.normalBias=this.normalBias),this.radius!==1&&(t.radius=this.radius),(this.mapSize.x!==512||this.mapSize.y!==512)&&(t.mapSize=this.mapSize.toArray()),t.camera=this.camera.toJSON(!1).object,delete t.camera.matrix,t}}class xw extends Pf{constructor(){super(new Pn(50,1,.5,500)),this.isSpotLightShadow=!0,this.focus=1,this.aspect=1}updateMatrices(t){const n=this.camera,i=Vs*2*t.angle*this.focus,r=this.mapSize.width/this.mapSize.height*this.aspect,s=t.distance||n.far;(i!==n.fov||r!==n.aspect||s!==n.far)&&(n.fov=i,n.aspect=r,n.far=s,n.updateProjectionMatrix()),super.updateMatrices(t)}copy(t){return super.copy(t),this.focus=t.focus,this}}class yw extends na{constructor(t,n,i=0,r=Math.PI/3,s=0,o=2){super(t,n),this.isSpotLight=!0,this.type="SpotLight",this.position.copy(Te.DEFAULT_UP),this.updateMatrix(),this.target=new Te,this.distance=i,this.angle=r,this.penumbra=s,this.decay=o,this.map=null,this.shadow=new xw}get power(){return this.intensity*Math.PI}set power(t){this.intensity=t/Math.PI}dispose(){super.dispose(),this.shadow.dispose()}copy(t,n){return super.copy(t,n),this.distance=t.distance,this.angle=t.angle,this.penumbra=t.penumbra,this.decay=t.decay,this.target=t.target.clone(),this.map=t.map,this.shadow=t.shadow.clone(),this}toJSON(t){const n=super.toJSON(t);return n.object.distance=this.distance,n.object.angle=this.angle,n.object.decay=this.decay,n.object.penumbra=this.penumbra,n.object.target=this.target.uuid,this.map&&this.map.isTexture&&(n.object.map=this.map.toJSON(t).uuid),n.object.shadow=this.shadow.toJSON(),n}}class Sw extends Pf{constructor(){super(new Pn(90,1,.5,500)),this.isPointLightShadow=!0}}class bw extends na{constructor(t,n,i=0,r=2){super(t,n),this.isPointLight=!0,this.type="PointLight",this.distance=i,this.decay=r,this.shadow=new Sw}get power(){return this.intensity*4*Math.PI}set power(t){this.intensity=t/(4*Math.PI)}dispose(){super.dispose(),this.shadow.dispose()}copy(t,n){return super.copy(t,n),this.distance=t.distance,this.decay=t.decay,this.shadow=t.shadow.clone(),this}toJSON(t){const n=super.toJSON(t);return n.object.distance=this.distance,n.object.decay=this.decay,n.object.shadow=this.shadow.toJSON(),n}}class Cf extends n_{constructor(t=-1,n=1,i=1,r=-1,s=.1,o=2e3){super(),this.isOrthographicCamera=!0,this.type="OrthographicCamera",this.zoom=1,this.view=null,this.left=t,this.right=n,this.top=i,this.bottom=r,this.near=s,this.far=o,this.updateProjectionMatrix()}copy(t,n){return super.copy(t,n),this.left=t.left,this.right=t.right,this.top=t.top,this.bottom=t.bottom,this.near=t.near,this.far=t.far,this.zoom=t.zoom,this.view=t.view===null?null:Object.assign({},t.view),this}setViewOffset(t,n,i,r,s,o){this.view===null&&(this.view={enabled:!0,fullWidth:1,fullHeight:1,offsetX:0,offsetY:0,width:1,height:1}),this.view.enabled=!0,this.view.fullWidth=t,this.view.fullHeight=n,this.view.offsetX=i,this.view.offsetY=r,this.view.width=s,this.view.height=o,this.updateProjectionMatrix()}clearViewOffset(){this.view!==null&&(this.view.enabled=!1),this.updateProjectionMatrix()}updateProjectionMatrix(){const t=(this.right-this.left)/(2*this.zoom),n=(this.top-this.bottom)/(2*this.zoom),i=(this.right+this.left)/2,r=(this.top+this.bottom)/2;let s=i-t,o=i+t,a=r+n,l=r-n;if(this.view!==null&&this.view.enabled){const c=(this.right-this.left)/this.view.fullWidth/this.zoom,u=(this.top-this.bottom)/this.view.fullHeight/this.zoom;s+=c*this.view.offsetX,o=s+c*this.view.width,a-=u*this.view.offsetY,l=a-u*this.view.height}this.projectionMatrix.makeOrthographic(s,o,a,l,this.near,this.far,this.coordinateSystem,this.reversedDepth),this.projectionMatrixInverse.copy(this.projectionMatrix).invert()}toJSON(t){const n=super.toJSON(t);return n.object.zoom=this.zoom,n.object.left=this.left,n.object.right=this.right,n.object.top=this.top,n.object.bottom=this.bottom,n.object.near=this.near,n.object.far=this.far,this.view!==null&&(n.object.view=Object.assign({},this.view)),n}}class Mw extends Pf{constructor(){super(new Cf(-5,5,5,-5,.5,500)),this.isDirectionalLightShadow=!0}}class m_ extends na{constructor(t,n){super(t,n),this.isDirectionalLight=!0,this.type="DirectionalLight",this.position.copy(Te.DEFAULT_UP),this.updateMatrix(),this.target=new Te,this.shadow=new Mw}dispose(){super.dispose(),this.shadow.dispose()}copy(t){return super.copy(t),this.target=t.target.clone(),this.shadow=t.shadow.clone(),this}toJSON(t){const n=super.toJSON(t);return n.object.shadow=this.shadow.toJSON(),n.object.target=this.target.uuid,n}}class g_ extends na{constructor(t,n){super(t,n),this.isAmbientLight=!0,this.type="AmbientLight"}}class ww extends na{constructor(t,n,i=10,r=10){super(t,n),this.isRectAreaLight=!0,this.type="RectAreaLight",this.width=i,this.height=r}get power(){return this.intensity*this.width*this.height*Math.PI}set power(t){this.intensity=t/(this.width*this.height*Math.PI)}copy(t){return super.copy(t),this.width=t.width,this.height=t.height,this}toJSON(t){const n=super.toJSON(t);return n.object.width=this.width,n.object.height=this.height,n}}class Ew extends Pn{constructor(t=[]){super(),this.isArrayCamera=!0,this.isMultiViewCamera=!1,this.cameras=t}}const im=new he;class __{constructor(t,n,i=0,r=1/0){this.ray=new jo(t,n),this.near=i,this.far=r,this.camera=null,this.layers=new _f,this.params={Mesh:{},Line:{threshold:1},LOD:{},Points:{threshold:1},Sprite:{}}}set(t,n){this.ray.set(t,n)}setFromCamera(t,n){n.isPerspectiveCamera?(this.ray.origin.setFromMatrixPosition(n.matrixWorld),this.ray.direction.set(t.x,t.y,.5).unproject(n).sub(this.ray.origin).normalize(),this.camera=n):n.isOrthographicCamera?(this.ray.origin.set(t.x,t.y,(n.near+n.far)/(n.near-n.far)).unproject(n),this.ray.direction.set(0,0,-1).transformDirection(n.matrixWorld),this.camera=n):de("Raycaster: Unsupported camera type: "+n.type)}setFromXRController(t){return im.identity().extractRotation(t.matrixWorld),this.ray.origin.setFromMatrixPosition(t.matrixWorld),this.ray.direction.set(0,0,-1).applyMatrix4(im),this}intersectObject(t,n=!0,i=[]){return sh(t,this,i,n),i.sort(rm),i}intersectObjects(t,n=!0,i=[]){for(let r=0,s=t.length;r.99999)this.quaternion.set(0,0,0,1);else if(t.y<-.99999)this.quaternion.set(1,0,0,0);else{cm.set(t.z,0,-t.x).normalize();const n=Math.acos(t.y);this.quaternion.setFromAxisAngle(cm,n)}}setLength(t,n=t*.2,i=n*.2){this.line.scale.set(1,Math.max(1e-4,t-n),1),this.line.updateMatrix(),this.cone.scale.set(i,n,i),this.cone.position.y=t,this.cone.updateMatrix()}setColor(t){this.line.material.color.set(t),this.cone.material.color.set(t)}copy(t){return super.copy(t,!1),this.line.copy(t.line),this.cone.copy(t.cone),this}dispose(){this.line.geometry.dispose(),this.line.material.dispose(),this.cone.geometry.dispose(),this.cone.material.dispose()}}class v_ extends s_{constructor(t=1){const n=[0,0,0,t,0,0,0,0,0,0,t,0,0,0,0,0,0,t],i=[1,0,0,1,.6,0,0,1,0,.6,1,0,0,0,1,0,.6,1],r=new fe;r.setAttribute("position",new te(n,3)),r.setAttribute("color",new te(i,3));const s=new ri({vertexColors:!0,toneMapped:!1});super(r,s),this.type="AxesHelper"}setColors(t,n,i){const r=new $t,s=this.geometry.attributes.color.array;return r.set(t),r.toArray(s,0),r.toArray(s,3),r.set(n),r.toArray(s,6),r.toArray(s,9),r.set(i),r.toArray(s,12),r.toArray(s,15),this.geometry.attributes.color.needsUpdate=!0,this}dispose(){this.geometry.dispose(),this.material.dispose()}}class Rw{constructor(){this.type="ShapePath",this.color=new $t,this.subPaths=[],this.currentPath=null}moveTo(t,n){return this.currentPath=new nh,this.subPaths.push(this.currentPath),this.currentPath.moveTo(t,n),this}lineTo(t,n){return this.currentPath.lineTo(t,n),this}quadraticCurveTo(t,n,i,r){return this.currentPath.quadraticCurveTo(t,n,i,r),this}bezierCurveTo(t,n,i,r,s,o){return this.currentPath.bezierCurveTo(t,n,i,r,s,o),this}splineThru(t){return this.currentPath.splineThru(t),this}toShapes(t){function n(d){const S=[];for(let y=0,x=d.length;yNumber.EPSILON){if(M<0&&(C=S[P],b=-b,R=S[A],M=-M),d.yR.y)continue;if(d.y===C.y){if(d.x===C.x)return!0}else{const L=M*(d.x-C.x)-b*(d.y-C.y);if(L===0)return!0;if(L<0)continue;x=!x}}else{if(d.y!==C.y)continue;if(R.x<=d.x&&d.x<=C.x||C.x<=d.x&&d.x<=R.x)return!0}}return x}const r=Hr.isClockWise,s=this.subPaths;if(s.length===0)return[];let o,a,l;const c=[];if(s.length===1)return a=s[0],l=new el,l.curves=a.curves,c.push(l),c;let u=!r(s[0].getPoints());u=t?!u:u;const h=[],f=[];let p=[],g=0,v;f[g]=void 0,p[g]=[];for(let d=0,S=s.length;d1){let d=!1,S=0;for(let y=0,x=f.length;y0&&d===!1&&(p=h)}let m;for(let d=0,S=f.length;dp.start-g.start);let f=0;for(let p=1;pp+g?(c.inputState.pinching=!1,this.dispatchEvent({type:"pinchend",handedness:t.handedness,target:this})):!c.inputState.pinching&&f<=p-g&&(c.inputState.pinching=!0,this.dispatchEvent({type:"pinchstart",handedness:t.handedness,target:this}))}else l!==null&&t.gripSpace&&(s=n.getPose(t.gripSpace,i),s!==null&&(l.matrix.fromArray(s.transform.matrix),l.matrix.decompose(l.position,l.rotation,l.scale),l.matrixWorldNeedsUpdate=!0,s.linearVelocity?(l.hasLinearVelocity=!0,l.linearVelocity.copy(s.linearVelocity)):l.hasLinearVelocity=!1,s.angularVelocity?(l.hasAngularVelocity=!0,l.angularVelocity.copy(s.angularVelocity)):l.hasAngularVelocity=!1));a!==null&&(r=n.getPose(t.targetRaySpace,i),r===null&&s!==null&&(r=s),r!==null&&(a.matrix.fromArray(r.transform.matrix),a.matrix.decompose(a.position,a.rotation,a.scale),a.matrixWorldNeedsUpdate=!0,r.linearVelocity?(a.hasLinearVelocity=!0,a.linearVelocity.copy(r.linearVelocity)):a.hasLinearVelocity=!1,r.angularVelocity?(a.hasAngularVelocity=!0,a.angularVelocity.copy(r.angularVelocity)):a.hasAngularVelocity=!1,this.dispatchEvent(EM)))}return a!==null&&(a.visible=r!==null),l!==null&&(l.visible=s!==null),c!==null&&(c.visible=o!==null),this}_getHandJoint(t,n){if(t.joints[n.jointName]===void 0){const i=new Pa;i.matrixAutoUpdate=!1,i.visible=!1,t.joints[n.jointName]=i,t.add(i)}return t.joints[n.jointName]}}class TM extends Te{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 ni,this.environmentIntensity=1,this.environmentRotation=new ni,this.overrideMaterial=null,typeof __THREE_DEVTOOLS__<"u"&&__THREE_DEVTOOLS__.dispatchEvent(new CustomEvent("observe",{detail:this}))}copy(t,n){return super.copy(t,n),t.background!==null&&(this.background=t.background.clone()),t.environment!==null&&(this.environment=t.environment.clone()),t.fog!==null&&(this.fog=t.fog.clone()),this.backgroundBlurriness=t.backgroundBlurriness,this.backgroundIntensity=t.backgroundIntensity,this.backgroundRotation.copy(t.backgroundRotation),this.environmentIntensity=t.environmentIntensity,this.environmentRotation.copy(t.environmentRotation),t.overrideMaterial!==null&&(this.overrideMaterial=t.overrideMaterial.clone()),this.matrixAutoUpdate=t.matrixAutoUpdate,this}toJSON(t){const n=super.toJSON(t);return this.fog!==null&&(n.object.fog=this.fog.toJSON()),this.backgroundBlurriness>0&&(n.object.backgroundBlurriness=this.backgroundBlurriness),this.backgroundIntensity!==1&&(n.object.backgroundIntensity=this.backgroundIntensity),n.object.backgroundRotation=this.backgroundRotation.toArray(),this.environmentIntensity!==1&&(n.object.environmentIntensity=this.environmentIntensity),n.object.environmentRotation=this.environmentRotation.toArray(),n}}class AM extends bn{constructor(t=null,n=1,i=1,r,s,o,a,l,c=rn,u=rn,h,f){super(null,o,a,l,c,u,r,s,h,f),this.isDataTexture=!0,this.image={data:t,width:n,height:i},this.generateMipmaps=!1,this.flipY=!1,this.unpackAlignment=1}}const Rc=new D,PM=new D,CM=new ie;let Fi=class{constructor(t=new D(1,0,0),n=0){this.isPlane=!0,this.normal=t,this.constant=n}set(t,n){return this.normal.copy(t),this.constant=n,this}setComponents(t,n,i,r){return this.normal.set(t,n,i),this.constant=r,this}setFromNormalAndCoplanarPoint(t,n){return this.normal.copy(t),this.constant=-n.dot(this.normal),this}setFromCoplanarPoints(t,n,i){const r=Rc.subVectors(i,n).cross(PM.subVectors(t,n)).normalize();return this.setFromNormalAndCoplanarPoint(r,t),this}copy(t){return this.normal.copy(t.normal),this.constant=t.constant,this}normalize(){const t=1/this.normal.length();return this.normal.multiplyScalar(t),this.constant*=t,this}negate(){return this.constant*=-1,this.normal.negate(),this}distanceToPoint(t){return this.normal.dot(t)+this.constant}distanceToSphere(t){return this.distanceToPoint(t.center)-t.radius}projectPoint(t,n){return n.copy(t).addScaledVector(this.normal,-this.distanceToPoint(t))}intersectLine(t,n){const i=t.delta(Rc),r=this.normal.dot(i);if(r===0)return this.distanceToPoint(t.start)===0?n.copy(t.start):null;const s=-(t.start.dot(this.normal)+this.constant)/r;return s<0||s>1?null:n.copy(t.start).addScaledVector(i,s)}intersectsLine(t){const n=this.distanceToPoint(t.start),i=this.distanceToPoint(t.end);return n<0&&i>0||i<0&&n>0}intersectsBox(t){return t.intersectsPlane(this)}intersectsSphere(t){return t.intersectsPlane(this)}coplanarPoint(t){return t.copy(this.normal).multiplyScalar(-this.constant)}applyMatrix4(t,n){const i=n||CM.getNormalMatrix(t),r=this.coplanarPoint(Rc).applyMatrix4(t),s=this.normal.applyMatrix3(i).normalize();return this.constant=-r.dot(s),this}translate(t){return this.constant-=t.dot(this.normal),this}equals(t){return t.normal.equals(this.normal)&&t.constant===this.constant}clone(){return new this.constructor().copy(this)}};const Dr=new Qo,RM=new mt(.5,.5),Ca=new D;class vf{constructor(t=new Fi,n=new Fi,i=new Fi,r=new Fi,s=new Fi,o=new Fi){this.planes=[t,n,i,r,s,o]}set(t,n,i,r,s,o){const a=this.planes;return a[0].copy(t),a[1].copy(n),a[2].copy(i),a[3].copy(r),a[4].copy(s),a[5].copy(o),this}copy(t){const n=this.planes;for(let i=0;i<6;i++)n[i].copy(t.planes[i]);return this}setFromProjectionMatrix(t,n=gi,i=!1){const r=this.planes,s=t.elements,o=s[0],a=s[1],l=s[2],c=s[3],u=s[4],h=s[5],f=s[6],p=s[7],g=s[8],_=s[9],m=s[10],d=s[11],S=s[12],x=s[13],y=s[14],T=s[15];if(r[0].setComponents(c-o,p-u,d-g,T-S).normalize(),r[1].setComponents(c+o,p+u,d+g,T+S).normalize(),r[2].setComponents(c+a,p+h,d+_,T+x).normalize(),r[3].setComponents(c-a,p-h,d-_,T-x).normalize(),i)r[4].setComponents(l,f,m,y).normalize(),r[5].setComponents(c-l,p-f,d-m,T-y).normalize();else if(r[4].setComponents(c-l,p-f,d-m,T-y).normalize(),n===gi)r[5].setComponents(c+l,p+f,d+m,T+y).normalize();else if(n===pl)r[5].setComponents(l,f,m,y).normalize();else throw new Error("THREE.Frustum.setFromProjectionMatrix(): Invalid coordinate system: "+n);return this}intersectsObject(t){if(t.boundingSphere!==void 0)t.boundingSphere===null&&t.computeBoundingSphere(),Dr.copy(t.boundingSphere).applyMatrix4(t.matrixWorld);else{const n=t.geometry;n.boundingSphere===null&&n.computeBoundingSphere(),Dr.copy(n.boundingSphere).applyMatrix4(t.matrixWorld)}return this.intersectsSphere(Dr)}intersectsSprite(t){Dr.center.set(0,0,0);const n=RM.distanceTo(t.center);return Dr.radius=.7071067811865476+n,Dr.applyMatrix4(t.matrixWorld),this.intersectsSphere(Dr)}intersectsSphere(t){const n=this.planes,i=t.center,r=-t.radius;for(let s=0;s<6;s++)if(n[s].distanceToPoint(i)0?t.max.x:t.min.x,Ca.y=r.normal.y>0?t.max.y:t.min.y,Ca.z=r.normal.z>0?t.max.z:t.min.z,r.distanceToPoint(Ca)<0)return!1}return!0}containsPoint(t){const n=this.planes;for(let i=0;i<6;i++)if(n[i].distanceToPoint(t)<0)return!1;return!0}clone(){return new this.constructor().copy(this)}}class ri extends es{constructor(t){super(),this.isLineBasicMaterial=!0,this.type="LineBasicMaterial",this.color=new $t(16777215),this.map=null,this.linewidth=1,this.linecap="round",this.linejoin="round",this.fog=!0,this.setValues(t)}copy(t){return super.copy(t),this.color.copy(t.color),this.map=t.map,this.linewidth=t.linewidth,this.linecap=t.linecap,this.linejoin=t.linejoin,this.fog=t.fog,this}}const _l=new D,vl=new D,Wp=new he,lo=new jo,Ra=new Qo,Dc=new D,Xp=new D;let en=class extends Te{constructor(t=new fe,n=new ri){super(),this.isLine=!0,this.type="Line",this.geometry=t,this.material=n,this.morphTargetDictionary=void 0,this.morphTargetInfluences=void 0,this.updateMorphTargets()}copy(t,n){return super.copy(t,n),this.material=Array.isArray(t.material)?t.material.slice():t.material,this.geometry=t.geometry,this}computeLineDistances(){const t=this.geometry;if(t.index===null){const n=t.attributes.position,i=[0];for(let r=1,s=n.count;r0){const r=n[i[0]];if(r!==void 0){this.morphTargetInfluences=[],this.morphTargetDictionary={};for(let s=0,o=r.length;si)return;Dc.applyMatrix4(e.matrixWorld);const c=t.ray.origin.distanceTo(Dc);if(!(ct.far))return{distance:c,point:Xp.clone().applyMatrix4(e.matrixWorld),index:o,face:null,faceIndex:null,barycoord:null,object:e}}const qp=new D,Yp=new D;class s_ extends en{constructor(t,n){super(t,n),this.isLineSegments=!0,this.type="LineSegments"}computeLineDistances(){const t=this.geometry;if(t.index===null){const n=t.attributes.position,i=[];for(let r=0,s=n.count;r0){const r=n[i[0]];if(r!==void 0){this.morphTargetInfluences=[],this.morphTargetDictionary={};for(let s=0,o=r.length;sr.far)return;s.push({distance:c,distanceToRay:Math.sqrt(a),point:l,index:t,face:null,faceIndex:null,barycoord:null,object:o})}}class Go extends bn{constructor(t,n,i=Mi,r,s,o,a=rn,l=rn,c,u=Ji,h=1){if(u!==Ji&&u!==Vr)throw new Error("DepthTexture format must be either THREE.DepthFormat or THREE.DepthStencilFormat");const f={width:t,height:n,depth:h};super(f,r,s,o,a,l,u,i,c),this.isDepthTexture=!0,this.flipY=!1,this.generateMipmaps=!1,this.compareFunction=null}copy(t){return super.copy(t),this.source=new gf(Object.assign({},t.image)),this.compareFunction=t.compareFunction,this}toJSON(t){const n=super.toJSON(t);return this.compareFunction!==null&&(n.compareFunction=this.compareFunction),n}}class DM extends Go{constructor(t,n=Mi,i=$r,r,s,o=rn,a=rn,l,c=Ji){const u={width:t,height:t,depth:1},h=[u,u,u,u,u,u];super(t,t,n,i,r,s,o,a,l,c),this.image=h,this.isCubeDepthTexture=!0,this.isCubeTexture=!0}get images(){return this.image}set images(t){this.image=t}}class o_ extends bn{constructor(t=null){super(),this.sourceTexture=t,this.isExternalTexture=!0}copy(t){return super.copy(t),this.sourceTexture=t.sourceTexture,this}}class Sf extends fe{constructor(t=1,n=1,i=4,r=8,s=1){super(),this.type="CapsuleGeometry",this.parameters={radius:t,height:n,capSegments:i,radialSegments:r,heightSegments:s},n=Math.max(0,n),i=Math.max(1,Math.floor(i)),r=Math.max(3,Math.floor(r)),s=Math.max(1,Math.floor(s));const o=[],a=[],l=[],c=[],u=n/2,h=Math.PI/2*t,f=n,p=2*h+f,g=i*2+s,_=r+1,m=new D,d=new D;for(let S=0;S<=g;S++){let x=0,y=0,T=0,P=0;if(S<=i){const b=S/i,M=b*Math.PI/2;y=-u-t*Math.cos(M),T=t*Math.sin(M),P=-t*Math.cos(M),x=b*h}else if(S<=i+s){const b=(S-i)/s;y=-u+b*n,T=t,P=0,x=h+b*f}else{const b=(S-i-s)/i,M=b*Math.PI/2;y=u+t*Math.sin(M),T=t*Math.cos(M),P=t*Math.sin(M),x=h+f+b*h}const R=Math.max(0,Math.min(1,x/p));let C=0;S===0?C=.5/r:S===g&&(C=-.5/r);for(let b=0;b<=r;b++){const M=b/r,L=M*Math.PI*2,V=Math.sin(L),q=Math.cos(L);d.x=-T*q,d.y=y,d.z=T*V,a.push(d.x,d.y,d.z),m.set(-T*q,P,T*V),m.normalize(),l.push(m.x,m.y,m.z),c.push(M+C,R)}if(S>0){const b=(S-1)*_;for(let M=0;M0&&x(!0),n>0&&x(!1)),this.setIndex(u),this.setAttribute("position",new te(h,3)),this.setAttribute("normal",new te(f,3)),this.setAttribute("uv",new te(p,2));function S(){const y=new D,T=new D;let P=0;const R=(n-t)/i;for(let C=0;C<=s;C++){const b=[],M=C/s,L=M*(n-t)+t;for(let V=0;V<=r;V++){const q=V/r,j=q*l+a,J=Math.sin(j),W=Math.cos(j);T.x=L*J,T.y=-M*i+m,T.z=L*W,h.push(T.x,T.y,T.z),y.set(J,R,W).normalize(),f.push(y.x,y.y,y.z),p.push(q,1-M),b.push(g++)}_.push(b)}for(let C=0;C0||b!==0)&&(u.push(M,L,q),P+=3),(n>0||b!==s-1)&&(u.push(L,V,q),P+=3)}c.addGroup(d,P,0),d+=P}function x(y){const T=g,P=new mt,R=new D;let C=0;const b=y===!0?t:n,M=y===!0?1:-1;for(let V=1;V<=r;V++)h.push(0,m*M,0),f.push(0,M,0),p.push(.5,.5),g++;const L=g;for(let V=0;V<=r;V++){const j=V/r*l+a,J=Math.cos(j),W=Math.sin(j);R.x=b*W,R.y=m*M,R.z=b*J,h.push(R.x,R.y,R.z),f.push(0,M,0),P.x=J*.5+.5,P.y=W*.5*M+.5,p.push(P.x,P.y),g++}for(let V=0;V.9&&R<.1&&(x<.2&&(o[S+0]+=1),y<.2&&(o[S+2]+=1),T<.2&&(o[S+4]+=1))}}function f(S){s.push(S.x,S.y,S.z)}function p(S,x){const y=S*3;x.x=t[y+0],x.y=t[y+1],x.z=t[y+2]}function g(){const S=new D,x=new D,y=new D,T=new D,P=new mt,R=new mt,C=new mt;for(let b=0,M=0;b0)l=r-1;else{l=r;break}if(r=l,i[r]===o)return r/(s-1);const u=i[r],f=i[r+1]-u,p=(o-u)/f;return(r+p)/(s-1)}getTangent(t,n){let r=t-1e-4,s=t+1e-4;r<0&&(r=0),s>1&&(s=1);const o=this.getPoint(r),a=this.getPoint(s),l=n||(o.isVector2?new mt:new D);return l.copy(a).sub(o).normalize(),l}getTangentAt(t,n){const i=this.getUtoTmapping(t);return this.getTangent(i,n)}computeFrenetFrames(t,n=!1){const i=new D,r=[],s=[],o=[],a=new D,l=new he;for(let p=0;p<=t;p++){const g=p/t;r[p]=this.getTangentAt(g,new D)}s[0]=new D,o[0]=new D;let c=Number.MAX_VALUE;const u=Math.abs(r[0].x),h=Math.abs(r[0].y),f=Math.abs(r[0].z);u<=c&&(c=u,i.set(1,0,0)),h<=c&&(c=h,i.set(0,1,0)),f<=c&&i.set(0,0,1),a.crossVectors(r[0],i).normalize(),s[0].crossVectors(r[0],a),o[0].crossVectors(r[0],s[0]);for(let p=1;p<=t;p++){if(s[p]=s[p-1].clone(),o[p]=o[p-1].clone(),a.crossVectors(r[p-1],r[p]),a.length()>Number.EPSILON){a.normalize();const g=Math.acos(re(r[p-1].dot(r[p]),-1,1));s[p].applyMatrix4(l.makeRotationAxis(a,g))}o[p].crossVectors(r[p],s[p])}if(n===!0){let p=Math.acos(re(s[0].dot(s[t]),-1,1));p/=t,r[0].dot(a.crossVectors(s[0],s[t]))>0&&(p=-p);for(let g=1;g<=t;g++)s[g].applyMatrix4(l.makeRotationAxis(r[g],p*g)),o[g].crossVectors(r[g],s[g])}return{tangents:r,normals:s,binormals:o}}clone(){return new this.constructor().copy(this)}copy(t){return this.arcLengthDivisions=t.arcLengthDivisions,this}toJSON(){const t={metadata:{version:4.7,type:"Curve",generator:"Curve.toJSON"}};return t.arcLengthDivisions=this.arcLengthDivisions,t.type=this.type,t}fromJSON(t){return this.arcLengthDivisions=t.arcLengthDivisions,this}}class wf extends Ei{constructor(t=0,n=0,i=1,r=1,s=0,o=Math.PI*2,a=!1,l=0){super(),this.isEllipseCurve=!0,this.type="EllipseCurve",this.aX=t,this.aY=n,this.xRadius=i,this.yRadius=r,this.aStartAngle=s,this.aEndAngle=o,this.aClockwise=a,this.aRotation=l}getPoint(t,n=new mt){const i=n,r=Math.PI*2;let s=this.aEndAngle-this.aStartAngle;const o=Math.abs(s)r;)s-=r;s0?0:(Math.floor(Math.abs(a)/s)+1)*s:l===0&&a===s-1&&(a=s-2,l=1);let c,u;this.closed||a>0?c=r[(a-1)%s]:(Na.subVectors(r[0],r[1]).add(r[0]),c=Na);const h=r[a%s],f=r[(a+1)%s];if(this.closed||a+2r.length-2?r.length-1:o+1],h=r[o>r.length-3?r.length-1:o+2];return i.set(Zp(a,l.x,c.x,u.x,h.x),Zp(a,l.y,c.y,u.y,h.y)),i}copy(t){super.copy(t),this.points=[];for(let n=0,i=t.points.length;n=i){const o=r[s]-i,a=this.curves[s],l=a.getLength(),c=l===0?0:1-o/l;return a.getPointAt(c,n)}s++}return null}getLength(){const t=this.getCurveLengths();return t[t.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 t=[];let n=0;for(let i=0,r=this.curves.length;i1&&!n[n.length-1].equals(n[0])&&n.push(n[0]),n}copy(t){super.copy(t),this.curves=[];for(let n=0,i=t.curves.length;n0){const h=c.getPoint(0);h.equals(this.currentPoint)||this.lineTo(h.x,h.y)}this.curves.push(c);const u=c.getPoint(1);return this.currentPoint.copy(u),this}copy(t){return super.copy(t),this.currentPoint.copy(t.currentPoint),this}toJSON(){const t=super.toJSON();return t.currentPoint=this.currentPoint.toArray(),t}fromJSON(t){return super.fromJSON(t),this.currentPoint.fromArray(t.currentPoint),this}}class el extends nh{constructor(t){super(t),this.uuid=ts(),this.type="Shape",this.holes=[]}getPointsHoles(t){const n=[];for(let i=0,r=this.holes.length;i80*n){a=e[0],l=e[1];let u=a,h=l;for(let f=n;fu&&(u=p),g>h&&(h=g)}c=Math.max(u-a,h-l),c=c!==0?32767/c:0}return Wo(s,o,n,a,l,c,0),o}function h_(e,t,n,i,r){let s;if(r===aw(e,t,n,i)>0)for(let o=t;o=t;o-=i)s=Kp(o/i|0,e[o],e[o+1],s);return s&&Gs(s,s.next)&&(qo(s),s=s.next),s}function Zr(e,t){if(!e)return e;t||(t=e);let n=e,i;do if(i=!1,!n.steiner&&(Gs(n,n.next)||Ue(n.prev,n,n.next)===0)){if(qo(n),n=t=n.prev,n===n.next)break;i=!0}else n=n.next;while(i||n!==t);return t}function Wo(e,t,n,i,r,s,o){if(!e)return;!o&&s&&ew(e,i,r,s);let a=e;for(;e.prev!==e.next;){const l=e.prev,c=e.next;if(s?YM(e,i,r,s):qM(e)){t.push(l.i,e.i,c.i),qo(e),e=c.next,a=c.next;continue}if(e=c,e===a){o?o===1?(e=JM(Zr(e),t),Wo(e,t,n,i,r,s,2)):o===2&&$M(e,t,n,i,r,s):Wo(Zr(e),t,n,i,r,s,1);break}}}function qM(e){const t=e.prev,n=e,i=e.next;if(Ue(t,n,i)>=0)return!1;const r=t.x,s=n.x,o=i.x,a=t.y,l=n.y,c=i.y,u=Math.min(r,s,o),h=Math.min(a,l,c),f=Math.max(r,s,o),p=Math.max(a,l,c);let g=i.next;for(;g!==t;){if(g.x>=u&&g.x<=f&&g.y>=h&&g.y<=p&&vo(r,a,s,l,o,c,g.x,g.y)&&Ue(g.prev,g,g.next)>=0)return!1;g=g.next}return!0}function YM(e,t,n,i){const r=e.prev,s=e,o=e.next;if(Ue(r,s,o)>=0)return!1;const a=r.x,l=s.x,c=o.x,u=r.y,h=s.y,f=o.y,p=Math.min(a,l,c),g=Math.min(u,h,f),_=Math.max(a,l,c),m=Math.max(u,h,f),d=ih(p,g,t,n,i),S=ih(_,m,t,n,i);let x=e.prevZ,y=e.nextZ;for(;x&&x.z>=d&&y&&y.z<=S;){if(x.x>=p&&x.x<=_&&x.y>=g&&x.y<=m&&x!==r&&x!==o&&vo(a,u,l,h,c,f,x.x,x.y)&&Ue(x.prev,x,x.next)>=0||(x=x.prevZ,y.x>=p&&y.x<=_&&y.y>=g&&y.y<=m&&y!==r&&y!==o&&vo(a,u,l,h,c,f,y.x,y.y)&&Ue(y.prev,y,y.next)>=0))return!1;y=y.nextZ}for(;x&&x.z>=d;){if(x.x>=p&&x.x<=_&&x.y>=g&&x.y<=m&&x!==r&&x!==o&&vo(a,u,l,h,c,f,x.x,x.y)&&Ue(x.prev,x,x.next)>=0)return!1;x=x.prevZ}for(;y&&y.z<=S;){if(y.x>=p&&y.x<=_&&y.y>=g&&y.y<=m&&y!==r&&y!==o&&vo(a,u,l,h,c,f,y.x,y.y)&&Ue(y.prev,y,y.next)>=0)return!1;y=y.nextZ}return!0}function JM(e,t){let n=e;do{const i=n.prev,r=n.next.next;!Gs(i,r)&&d_(i,n,n.next,r)&&Xo(i,r)&&Xo(r,i)&&(t.push(i.i,n.i,r.i),qo(n),qo(n.next),n=e=r),n=n.next}while(n!==e);return Zr(n)}function $M(e,t,n,i,r,s){let o=e;do{let a=o.next.next;for(;a!==o.prev;){if(o.i!==a.i&&rw(o,a)){let l=p_(o,a);o=Zr(o,o.next),l=Zr(l,l.next),Wo(o,t,n,i,r,s,0),Wo(l,t,n,i,r,s,0);return}a=a.next}o=o.next}while(o!==e)}function ZM(e,t,n,i){const r=[];for(let s=0,o=t.length;s=n.next.y&&n.next.y!==n.y){const h=n.x+(r-n.y)*(n.next.x-n.x)/(n.next.y-n.y);if(h<=i&&h>s&&(s=h,o=n.x=n.x&&n.x>=l&&i!==n.x&&f_(ro.x||n.x===o.x&&tw(o,n)))&&(o=n,u=h)}n=n.next}while(n!==a);return o}function tw(e,t){return Ue(e.prev,e,t.prev)<0&&Ue(t.next,e,e.next)<0}function ew(e,t,n,i){let r=e;do r.z===0&&(r.z=ih(r.x,r.y,t,n,i)),r.prevZ=r.prev,r.nextZ=r.next,r=r.next;while(r!==e);r.prevZ.nextZ=null,r.prevZ=null,nw(r)}function nw(e){let t,n=1;do{let i=e,r;e=null;let s=null;for(t=0;i;){t++;let o=i,a=0;for(let c=0;c0||l>0&&o;)a!==0&&(l===0||!o||i.z<=o.z)?(r=i,i=i.nextZ,a--):(r=o,o=o.nextZ,l--),s?s.nextZ=r:e=r,r.prevZ=s,s=r;i=o}s.nextZ=null,n*=2}while(t>1);return e}function ih(e,t,n,i,r){return e=(e-n)*r|0,t=(t-i)*r|0,e=(e|e<<8)&16711935,e=(e|e<<4)&252645135,e=(e|e<<2)&858993459,e=(e|e<<1)&1431655765,t=(t|t<<8)&16711935,t=(t|t<<4)&252645135,t=(t|t<<2)&858993459,t=(t|t<<1)&1431655765,e|t<<1}function iw(e){let t=e,n=e;do(t.x=(e-o)*(s-a)&&(e-o)*(i-a)>=(n-o)*(t-a)&&(n-o)*(s-a)>=(r-o)*(i-a)}function vo(e,t,n,i,r,s,o,a){return!(e===o&&t===a)&&f_(e,t,n,i,r,s,o,a)}function rw(e,t){return e.next.i!==t.i&&e.prev.i!==t.i&&!sw(e,t)&&(Xo(e,t)&&Xo(t,e)&&ow(e,t)&&(Ue(e.prev,e,t.prev)||Ue(e,t.prev,t))||Gs(e,t)&&Ue(e.prev,e,e.next)>0&&Ue(t.prev,t,t.next)>0)}function Ue(e,t,n){return(t.y-e.y)*(n.x-t.x)-(t.x-e.x)*(n.y-t.y)}function Gs(e,t){return e.x===t.x&&e.y===t.y}function d_(e,t,n,i){const r=Oa(Ue(e,t,n)),s=Oa(Ue(e,t,i)),o=Oa(Ue(n,i,e)),a=Oa(Ue(n,i,t));return!!(r!==s&&o!==a||r===0&&Ua(e,n,t)||s===0&&Ua(e,i,t)||o===0&&Ua(n,e,i)||a===0&&Ua(n,t,i))}function Ua(e,t,n){return t.x<=Math.max(e.x,n.x)&&t.x>=Math.min(e.x,n.x)&&t.y<=Math.max(e.y,n.y)&&t.y>=Math.min(e.y,n.y)}function Oa(e){return e>0?1:e<0?-1:0}function sw(e,t){let n=e;do{if(n.i!==e.i&&n.next.i!==e.i&&n.i!==t.i&&n.next.i!==t.i&&d_(n,n.next,e,t))return!0;n=n.next}while(n!==e);return!1}function Xo(e,t){return Ue(e.prev,e,e.next)<0?Ue(e,t,e.next)>=0&&Ue(e,e.prev,t)>=0:Ue(e,t,e.prev)<0||Ue(e,e.next,t)<0}function ow(e,t){let n=e,i=!1;const r=(e.x+t.x)/2,s=(e.y+t.y)/2;do n.y>s!=n.next.y>s&&n.next.y!==n.y&&r<(n.next.x-n.x)*(s-n.y)/(n.next.y-n.y)+n.x&&(i=!i),n=n.next;while(n!==e);return i}function p_(e,t){const n=rh(e.i,e.x,e.y),i=rh(t.i,t.x,t.y),r=e.next,s=t.prev;return e.next=t,t.prev=e,n.next=r,r.prev=n,i.next=n,n.prev=i,s.next=i,i.prev=s,i}function Kp(e,t,n,i){const r=rh(e,t,n);return i?(r.next=i.next,r.prev=i,i.next.prev=r,i.next=r):(r.prev=r,r.next=r),r}function qo(e){e.next.prev=e.prev,e.prev.next=e.next,e.prevZ&&(e.prevZ.nextZ=e.nextZ),e.nextZ&&(e.nextZ.prevZ=e.prevZ)}function rh(e,t,n){return{i:e,x:t,y:n,prev:null,next:null,z:0,prevZ:null,nextZ:null,steiner:!1}}function aw(e,t,n,i){let r=0;for(let s=t,o=n-i;s2&&e[t-1].equals(e[0])&&e.pop()}function jp(e,t){for(let n=0;nNumber.EPSILON){const Y=Math.sqrt(v),nt=Math.sqrt(it*it+w*w),$=z.x-Q/Y,wt=z.y+K/Y,ht=F.x-w/nt,Ct=F.y+it/nt,zt=((ht-$)*w-(Ct-wt)*it)/(K*w-Q*it);X=$+K*zt-U.x,E=wt+Q*zt-U.y;const ut=X*X+E*E;if(ut<=2)return new mt(X,E);rt=Math.sqrt(ut/2)}else{let Y=!1;K>Number.EPSILON?it>Number.EPSILON&&(Y=!0):K<-Number.EPSILON?it<-Number.EPSILON&&(Y=!0):Math.sign(Q)===Math.sign(w)&&(Y=!0),Y?(X=-Q,E=K,rt=Math.sqrt(v)):(X=K,E=Q,rt=Math.sqrt(v/2))}return new mt(X/rt,E/rt)}const ct=[];for(let U=0,z=J.length,F=z-1,X=U+1;U=0;U--){const z=U/m,F=p*Math.cos(z*Math.PI/2),X=g*Math.sin(z*Math.PI/2)+_;for(let E=0,rt=J.length;E=0;){const X=F;let E=F-1;E<0&&(E=U.length-1);for(let rt=0,K=u+m*2;rt0)&&p.push(x,y,P),(d!==i-1||l0!=t>0&&this.version++,this._anisotropy=t}get clearcoat(){return this._clearcoat}set clearcoat(t){this._clearcoat>0!=t>0&&this.version++,this._clearcoat=t}get iridescence(){return this._iridescence}set iridescence(t){this._iridescence>0!=t>0&&this.version++,this._iridescence=t}get dispersion(){return this._dispersion}set dispersion(t){this._dispersion>0!=t>0&&this.version++,this._dispersion=t}get sheen(){return this._sheen}set sheen(t){this._sheen>0!=t>0&&this.version++,this._sheen=t}get transmission(){return this._transmission}set transmission(t){this._transmission>0!=t>0&&this.version++,this._transmission=t}copy(t){return super.copy(t),this.defines={STANDARD:"",PHYSICAL:""},this.anisotropy=t.anisotropy,this.anisotropyRotation=t.anisotropyRotation,this.anisotropyMap=t.anisotropyMap,this.clearcoat=t.clearcoat,this.clearcoatMap=t.clearcoatMap,this.clearcoatRoughness=t.clearcoatRoughness,this.clearcoatRoughnessMap=t.clearcoatRoughnessMap,this.clearcoatNormalMap=t.clearcoatNormalMap,this.clearcoatNormalScale.copy(t.clearcoatNormalScale),this.dispersion=t.dispersion,this.ior=t.ior,this.iridescence=t.iridescence,this.iridescenceMap=t.iridescenceMap,this.iridescenceIOR=t.iridescenceIOR,this.iridescenceThicknessRange=[...t.iridescenceThicknessRange],this.iridescenceThicknessMap=t.iridescenceThicknessMap,this.sheen=t.sheen,this.sheenColor.copy(t.sheenColor),this.sheenColorMap=t.sheenColorMap,this.sheenRoughness=t.sheenRoughness,this.sheenRoughnessMap=t.sheenRoughnessMap,this.transmission=t.transmission,this.transmissionMap=t.transmissionMap,this.thickness=t.thickness,this.thicknessMap=t.thicknessMap,this.attenuationDistance=t.attenuationDistance,this.attenuationColor.copy(t.attenuationColor),this.specularIntensity=t.specularIntensity,this.specularIntensityMap=t.specularIntensityMap,this.specularColor.copy(t.specularColor),this.specularColorMap=t.specularColorMap,this}}class dw extends es{constructor(t){super(),this.isMeshDepthMaterial=!0,this.type="MeshDepthMaterial",this.depthPacking=Ib,this.map=null,this.alphaMap=null,this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.wireframe=!1,this.wireframeLinewidth=1,this.setValues(t)}copy(t){return super.copy(t),this.depthPacking=t.depthPacking,this.map=t.map,this.alphaMap=t.alphaMap,this.displacementMap=t.displacementMap,this.displacementScale=t.displacementScale,this.displacementBias=t.displacementBias,this.wireframe=t.wireframe,this.wireframeLinewidth=t.wireframeLinewidth,this}}class pw extends es{constructor(t){super(),this.isMeshDistanceMaterial=!0,this.type="MeshDistanceMaterial",this.map=null,this.alphaMap=null,this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.setValues(t)}copy(t){return super.copy(t),this.map=t.map,this.alphaMap=t.alphaMap,this.displacementMap=t.displacementMap,this.displacementScale=t.displacementScale,this.displacementBias=t.displacementBias,this}}const tm={enabled:!1,files:{},add:function(e,t){this.enabled!==!1&&(this.files[e]=t)},get:function(e){if(this.enabled!==!1)return this.files[e]},remove:function(e){delete this.files[e]},clear:function(){this.files={}}};class mw{constructor(t,n,i){const r=this;let s=!1,o=0,a=0,l;const c=[];this.onStart=void 0,this.onLoad=t,this.onProgress=n,this.onError=i,this._abortController=null,this.itemStart=function(u){a++,s===!1&&r.onStart!==void 0&&r.onStart(u,o,a),s=!0},this.itemEnd=function(u){o++,r.onProgress!==void 0&&r.onProgress(u,o,a),o===a&&(s=!1,r.onLoad!==void 0&&r.onLoad())},this.itemError=function(u){r.onError!==void 0&&r.onError(u)},this.resolveURL=function(u){return l?l(u):u},this.setURLModifier=function(u){return l=u,this},this.addHandler=function(u,h){return c.push(u,h),this},this.removeHandler=function(u){const h=c.indexOf(u);return h!==-1&&c.splice(h,2),this},this.getHandler=function(u){for(let h=0,f=c.length;h{n&&n(s),this.manager.itemEnd(t)},0),s;if(Ni[t]!==void 0){Ni[t].push({onLoad:n,onProgress:i,onError:r});return}Ni[t]=[],Ni[t].push({onLoad:n,onProgress:i,onError:r});const o=new Request(t,{headers:new Headers(this.requestHeader),credentials:this.withCredentials?"include":"same-origin",signal:typeof AbortSignal.any=="function"?AbortSignal.any([this._abortController.signal,this.manager.abortController.signal]):this._abortController.signal}),a=this.mimeType,l=this.responseType;fetch(o).then(c=>{if(c.status===200||c.status===0){if(c.status===0&&Yt("FileLoader: HTTP Status 0 received."),typeof ReadableStream>"u"||c.body===void 0||c.body.getReader===void 0)return c;const u=Ni[t],h=c.body.getReader(),f=c.headers.get("X-File-Size")||c.headers.get("Content-Length"),p=f?parseInt(f):0,g=p!==0;let _=0;const m=new ReadableStream({start(d){S();function S(){h.read().then(({done:x,value:y})=>{if(x)d.close();else{_+=y.byteLength;const T=new ProgressEvent("progress",{lengthComputable:g,loaded:_,total:p});for(let P=0,R=u.length;P{d.error(x)})}}});return new Response(m)}else throw new _w(`fetch for "${c.url}" responded with ${c.status}: ${c.statusText}`,c)}).then(c=>{switch(l){case"arraybuffer":return c.arrayBuffer();case"blob":return c.blob();case"document":return c.text().then(u=>new DOMParser().parseFromString(u,a));case"json":return c.json();default:if(a==="")return c.text();{const h=/charset="?([^;"\s]*)"?/i.exec(a),f=h&&h[1]?h[1].toLowerCase():void 0,p=new TextDecoder(f);return c.arrayBuffer().then(g=>p.decode(g))}}}).then(c=>{tm.add(`file:${t}`,c);const u=Ni[t];delete Ni[t];for(let h=0,f=u.length;h{const u=Ni[t];if(u===void 0)throw this.manager.itemError(t),c;delete Ni[t];for(let h=0,f=u.length;h{this.manager.itemEnd(t)}),this.manager.itemStart(t)}setResponseType(t){return this.responseType=t,this}setMimeType(t){return this.mimeType=t,this}abort(){return this._abortController.abort(),this._abortController=new AbortController,this}}class na extends Te{constructor(t,n=1){super(),this.isLight=!0,this.type="Light",this.color=new $t(t),this.intensity=n}dispose(){this.dispatchEvent({type:"dispose"})}copy(t,n){return super.copy(t,n),this.color.copy(t.color),this.intensity=t.intensity,this}toJSON(t){const n=super.toJSON(t);return n.object.color=this.color.getHex(),n.object.intensity=this.intensity,n}}const Uc=new he,em=new D,nm=new D;class Pf{constructor(t){this.camera=t,this.intensity=1,this.bias=0,this.normalBias=0,this.radius=1,this.blurSamples=8,this.mapSize=new mt(512,512),this.mapType=kn,this.map=null,this.mapPass=null,this.matrix=new he,this.autoUpdate=!0,this.needsUpdate=!1,this._frustum=new vf,this._frameExtents=new mt(1,1),this._viewportCount=1,this._viewports=[new ze(0,0,1,1)]}getViewportCount(){return this._viewportCount}getFrustum(){return this._frustum}updateMatrices(t){const n=this.camera,i=this.matrix;em.setFromMatrixPosition(t.matrixWorld),n.position.copy(em),nm.setFromMatrixPosition(t.target.matrixWorld),n.lookAt(nm),n.updateMatrixWorld(),Uc.multiplyMatrices(n.projectionMatrix,n.matrixWorldInverse),this._frustum.setFromProjectionMatrix(Uc,n.coordinateSystem,n.reversedDepth),n.reversedDepth?i.set(.5,0,0,.5,0,.5,0,.5,0,0,1,0,0,0,0,1):i.set(.5,0,0,.5,0,.5,0,.5,0,0,.5,.5,0,0,0,1),i.multiply(Uc)}getViewport(t){return this._viewports[t]}getFrameExtents(){return this._frameExtents}dispose(){this.map&&this.map.dispose(),this.mapPass&&this.mapPass.dispose()}copy(t){return this.camera=t.camera.clone(),this.intensity=t.intensity,this.bias=t.bias,this.radius=t.radius,this.autoUpdate=t.autoUpdate,this.needsUpdate=t.needsUpdate,this.normalBias=t.normalBias,this.blurSamples=t.blurSamples,this.mapSize.copy(t.mapSize),this}clone(){return new this.constructor().copy(this)}toJSON(){const t={};return this.intensity!==1&&(t.intensity=this.intensity),this.bias!==0&&(t.bias=this.bias),this.normalBias!==0&&(t.normalBias=this.normalBias),this.radius!==1&&(t.radius=this.radius),(this.mapSize.x!==512||this.mapSize.y!==512)&&(t.mapSize=this.mapSize.toArray()),t.camera=this.camera.toJSON(!1).object,delete t.camera.matrix,t}}class xw extends Pf{constructor(){super(new Pn(50,1,.5,500)),this.isSpotLightShadow=!0,this.focus=1,this.aspect=1}updateMatrices(t){const n=this.camera,i=Vs*2*t.angle*this.focus,r=this.mapSize.width/this.mapSize.height*this.aspect,s=t.distance||n.far;(i!==n.fov||r!==n.aspect||s!==n.far)&&(n.fov=i,n.aspect=r,n.far=s,n.updateProjectionMatrix()),super.updateMatrices(t)}copy(t){return super.copy(t),this.focus=t.focus,this}}class yw extends na{constructor(t,n,i=0,r=Math.PI/3,s=0,o=2){super(t,n),this.isSpotLight=!0,this.type="SpotLight",this.position.copy(Te.DEFAULT_UP),this.updateMatrix(),this.target=new Te,this.distance=i,this.angle=r,this.penumbra=s,this.decay=o,this.map=null,this.shadow=new xw}get power(){return this.intensity*Math.PI}set power(t){this.intensity=t/Math.PI}dispose(){super.dispose(),this.shadow.dispose()}copy(t,n){return super.copy(t,n),this.distance=t.distance,this.angle=t.angle,this.penumbra=t.penumbra,this.decay=t.decay,this.target=t.target.clone(),this.map=t.map,this.shadow=t.shadow.clone(),this}toJSON(t){const n=super.toJSON(t);return n.object.distance=this.distance,n.object.angle=this.angle,n.object.decay=this.decay,n.object.penumbra=this.penumbra,n.object.target=this.target.uuid,this.map&&this.map.isTexture&&(n.object.map=this.map.toJSON(t).uuid),n.object.shadow=this.shadow.toJSON(),n}}class Sw extends Pf{constructor(){super(new Pn(90,1,.5,500)),this.isPointLightShadow=!0}}class bw extends na{constructor(t,n,i=0,r=2){super(t,n),this.isPointLight=!0,this.type="PointLight",this.distance=i,this.decay=r,this.shadow=new Sw}get power(){return this.intensity*4*Math.PI}set power(t){this.intensity=t/(4*Math.PI)}dispose(){super.dispose(),this.shadow.dispose()}copy(t,n){return super.copy(t,n),this.distance=t.distance,this.decay=t.decay,this.shadow=t.shadow.clone(),this}toJSON(t){const n=super.toJSON(t);return n.object.distance=this.distance,n.object.decay=this.decay,n.object.shadow=this.shadow.toJSON(),n}}class Cf extends n_{constructor(t=-1,n=1,i=1,r=-1,s=.1,o=2e3){super(),this.isOrthographicCamera=!0,this.type="OrthographicCamera",this.zoom=1,this.view=null,this.left=t,this.right=n,this.top=i,this.bottom=r,this.near=s,this.far=o,this.updateProjectionMatrix()}copy(t,n){return super.copy(t,n),this.left=t.left,this.right=t.right,this.top=t.top,this.bottom=t.bottom,this.near=t.near,this.far=t.far,this.zoom=t.zoom,this.view=t.view===null?null:Object.assign({},t.view),this}setViewOffset(t,n,i,r,s,o){this.view===null&&(this.view={enabled:!0,fullWidth:1,fullHeight:1,offsetX:0,offsetY:0,width:1,height:1}),this.view.enabled=!0,this.view.fullWidth=t,this.view.fullHeight=n,this.view.offsetX=i,this.view.offsetY=r,this.view.width=s,this.view.height=o,this.updateProjectionMatrix()}clearViewOffset(){this.view!==null&&(this.view.enabled=!1),this.updateProjectionMatrix()}updateProjectionMatrix(){const t=(this.right-this.left)/(2*this.zoom),n=(this.top-this.bottom)/(2*this.zoom),i=(this.right+this.left)/2,r=(this.top+this.bottom)/2;let s=i-t,o=i+t,a=r+n,l=r-n;if(this.view!==null&&this.view.enabled){const c=(this.right-this.left)/this.view.fullWidth/this.zoom,u=(this.top-this.bottom)/this.view.fullHeight/this.zoom;s+=c*this.view.offsetX,o=s+c*this.view.width,a-=u*this.view.offsetY,l=a-u*this.view.height}this.projectionMatrix.makeOrthographic(s,o,a,l,this.near,this.far,this.coordinateSystem,this.reversedDepth),this.projectionMatrixInverse.copy(this.projectionMatrix).invert()}toJSON(t){const n=super.toJSON(t);return n.object.zoom=this.zoom,n.object.left=this.left,n.object.right=this.right,n.object.top=this.top,n.object.bottom=this.bottom,n.object.near=this.near,n.object.far=this.far,this.view!==null&&(n.object.view=Object.assign({},this.view)),n}}class Mw extends Pf{constructor(){super(new Cf(-5,5,5,-5,.5,500)),this.isDirectionalLightShadow=!0}}class m_ extends na{constructor(t,n){super(t,n),this.isDirectionalLight=!0,this.type="DirectionalLight",this.position.copy(Te.DEFAULT_UP),this.updateMatrix(),this.target=new Te,this.shadow=new Mw}dispose(){super.dispose(),this.shadow.dispose()}copy(t){return super.copy(t),this.target=t.target.clone(),this.shadow=t.shadow.clone(),this}toJSON(t){const n=super.toJSON(t);return n.object.shadow=this.shadow.toJSON(),n.object.target=this.target.uuid,n}}class g_ extends na{constructor(t,n){super(t,n),this.isAmbientLight=!0,this.type="AmbientLight"}}class ww extends na{constructor(t,n,i=10,r=10){super(t,n),this.isRectAreaLight=!0,this.type="RectAreaLight",this.width=i,this.height=r}get power(){return this.intensity*this.width*this.height*Math.PI}set power(t){this.intensity=t/(this.width*this.height*Math.PI)}copy(t){return super.copy(t),this.width=t.width,this.height=t.height,this}toJSON(t){const n=super.toJSON(t);return n.object.width=this.width,n.object.height=this.height,n}}class Ew extends Pn{constructor(t=[]){super(),this.isArrayCamera=!0,this.isMultiViewCamera=!1,this.cameras=t}}const im=new he;class __{constructor(t,n,i=0,r=1/0){this.ray=new jo(t,n),this.near=i,this.far=r,this.camera=null,this.layers=new _f,this.params={Mesh:{},Line:{threshold:1},LOD:{},Points:{threshold:1},Sprite:{}}}set(t,n){this.ray.set(t,n)}setFromCamera(t,n){n.isPerspectiveCamera?(this.ray.origin.setFromMatrixPosition(n.matrixWorld),this.ray.direction.set(t.x,t.y,.5).unproject(n).sub(this.ray.origin).normalize(),this.camera=n):n.isOrthographicCamera?(this.ray.origin.set(t.x,t.y,(n.near+n.far)/(n.near-n.far)).unproject(n),this.ray.direction.set(0,0,-1).transformDirection(n.matrixWorld),this.camera=n):de("Raycaster: Unsupported camera type: "+n.type)}setFromXRController(t){return im.identity().extractRotation(t.matrixWorld),this.ray.origin.setFromMatrixPosition(t.matrixWorld),this.ray.direction.set(0,0,-1).applyMatrix4(im),this}intersectObject(t,n=!0,i=[]){return sh(t,this,i,n),i.sort(rm),i}intersectObjects(t,n=!0,i=[]){for(let r=0,s=t.length;r.99999)this.quaternion.set(0,0,0,1);else if(t.y<-.99999)this.quaternion.set(1,0,0,0);else{cm.set(t.z,0,-t.x).normalize();const n=Math.acos(t.y);this.quaternion.setFromAxisAngle(cm,n)}}setLength(t,n=t*.2,i=n*.2){this.line.scale.set(1,Math.max(1e-4,t-n),1),this.line.updateMatrix(),this.cone.scale.set(i,n,i),this.cone.position.y=t,this.cone.updateMatrix()}setColor(t){this.line.material.color.set(t),this.cone.material.color.set(t)}copy(t){return super.copy(t,!1),this.line.copy(t.line),this.cone.copy(t.cone),this}dispose(){this.line.geometry.dispose(),this.line.material.dispose(),this.cone.geometry.dispose(),this.cone.material.dispose()}}class v_ extends s_{constructor(t=1){const n=[0,0,0,t,0,0,0,0,0,0,t,0,0,0,0,0,0,t],i=[1,0,0,1,.6,0,0,1,0,.6,1,0,0,0,1,0,.6,1],r=new fe;r.setAttribute("position",new te(n,3)),r.setAttribute("color",new te(i,3));const s=new ri({vertexColors:!0,toneMapped:!1});super(r,s),this.type="AxesHelper"}setColors(t,n,i){const r=new $t,s=this.geometry.attributes.color.array;return r.set(t),r.toArray(s,0),r.toArray(s,3),r.set(n),r.toArray(s,6),r.toArray(s,9),r.set(i),r.toArray(s,12),r.toArray(s,15),this.geometry.attributes.color.needsUpdate=!0,this}dispose(){this.geometry.dispose(),this.material.dispose()}}class Rw{constructor(){this.type="ShapePath",this.color=new $t,this.subPaths=[],this.currentPath=null}moveTo(t,n){return this.currentPath=new nh,this.subPaths.push(this.currentPath),this.currentPath.moveTo(t,n),this}lineTo(t,n){return this.currentPath.lineTo(t,n),this}quadraticCurveTo(t,n,i,r){return this.currentPath.quadraticCurveTo(t,n,i,r),this}bezierCurveTo(t,n,i,r,s,o){return this.currentPath.bezierCurveTo(t,n,i,r,s,o),this}splineThru(t){return this.currentPath.splineThru(t),this}toShapes(t){function n(d){const S=[];for(let x=0,y=d.length;xNumber.EPSILON){if(M<0&&(R=S[P],b=-b,C=S[T],M=-M),d.yC.y)continue;if(d.y===R.y){if(d.x===R.x)return!0}else{const L=M*(d.x-R.x)-b*(d.y-R.y);if(L===0)return!0;if(L<0)continue;y=!y}}else{if(d.y!==R.y)continue;if(C.x<=d.x&&d.x<=R.x||R.x<=d.x&&d.x<=C.x)return!0}}return y}const r=Hr.isClockWise,s=this.subPaths;if(s.length===0)return[];let o,a,l;const c=[];if(s.length===1)return a=s[0],l=new el,l.curves=a.curves,c.push(l),c;let u=!r(s[0].getPoints());u=t?!u:u;const h=[],f=[];let p=[],g=0,_;f[g]=void 0,p[g]=[];for(let d=0,S=s.length;d1){let d=!1,S=0;for(let x=0,y=f.length;x0&&d===!1&&(p=h)}let m;for(let d=0,S=f.length;dp.start-g.start);let f=0;for(let p=1;p #include #include -}`,se={alphahash_fragment:Lw,alphahash_pars_fragment:Nw,alphamap_fragment:Uw,alphamap_pars_fragment:Ow,alphatest_fragment:Fw,alphatest_pars_fragment:kw,aomap_fragment:Bw,aomap_pars_fragment:zw,batching_pars_vertex:Vw,batching_vertex:Hw,begin_vertex:Gw,beginnormal_vertex:Ww,bsdfs:Xw,iridescence_fragment:qw,bumpmap_pars_fragment:Yw,clipping_planes_fragment:Jw,clipping_planes_pars_fragment:$w,clipping_planes_pars_vertex:Zw,clipping_planes_vertex:Kw,color_fragment:Qw,color_pars_fragment:jw,color_pars_vertex:tE,color_vertex:eE,common:nE,cube_uv_reflection_fragment:iE,defaultnormal_vertex:rE,displacementmap_pars_vertex:sE,displacementmap_vertex:oE,emissivemap_fragment:aE,emissivemap_pars_fragment:lE,colorspace_fragment:cE,colorspace_pars_fragment:uE,envmap_fragment:hE,envmap_common_pars_fragment:fE,envmap_pars_fragment:dE,envmap_pars_vertex:pE,envmap_physical_pars_fragment:EE,envmap_vertex:mE,fog_vertex:gE,fog_pars_vertex:_E,fog_fragment:vE,fog_pars_fragment:xE,gradientmap_pars_fragment:yE,lightmap_pars_fragment:SE,lights_lambert_fragment:bE,lights_lambert_pars_fragment:ME,lights_pars_begin:wE,lights_toon_fragment:TE,lights_toon_pars_fragment:AE,lights_phong_fragment:PE,lights_phong_pars_fragment:CE,lights_physical_fragment:RE,lights_physical_pars_fragment:DE,lights_fragment_begin:IE,lights_fragment_maps:LE,lights_fragment_end:NE,logdepthbuf_fragment:UE,logdepthbuf_pars_fragment:OE,logdepthbuf_pars_vertex:FE,logdepthbuf_vertex:kE,map_fragment:BE,map_pars_fragment:zE,map_particle_fragment:VE,map_particle_pars_fragment:HE,metalnessmap_fragment:GE,metalnessmap_pars_fragment:WE,morphinstance_vertex:XE,morphcolor_vertex:qE,morphnormal_vertex:YE,morphtarget_pars_vertex:JE,morphtarget_vertex:$E,normal_fragment_begin:ZE,normal_fragment_maps:KE,normal_pars_fragment:QE,normal_pars_vertex:jE,normal_vertex:tT,normalmap_pars_fragment:eT,clearcoat_normal_fragment_begin:nT,clearcoat_normal_fragment_maps:iT,clearcoat_pars_fragment:rT,iridescence_pars_fragment:sT,opaque_fragment:oT,packing:aT,premultiplied_alpha_fragment:lT,project_vertex:cT,dithering_fragment:uT,dithering_pars_fragment:hT,roughnessmap_fragment:fT,roughnessmap_pars_fragment:dT,shadowmap_pars_fragment:pT,shadowmap_pars_vertex:mT,shadowmap_vertex:gT,shadowmask_pars_fragment:_T,skinbase_vertex:vT,skinning_pars_vertex:xT,skinning_vertex:yT,skinnormal_vertex:ST,specularmap_fragment:bT,specularmap_pars_fragment:MT,tonemapping_fragment:wT,tonemapping_pars_fragment:ET,transmission_fragment:TT,transmission_pars_fragment:AT,uv_pars_fragment:PT,uv_pars_vertex:CT,uv_vertex:RT,worldpos_vertex:DT,background_vert:IT,background_frag:LT,backgroundCube_vert:NT,backgroundCube_frag:UT,cube_vert:OT,cube_frag:FT,depth_vert:kT,depth_frag:BT,distance_vert:zT,distance_frag:VT,equirect_vert:HT,equirect_frag:GT,linedashed_vert:WT,linedashed_frag:XT,meshbasic_vert:qT,meshbasic_frag:YT,meshlambert_vert:JT,meshlambert_frag:$T,meshmatcap_vert:ZT,meshmatcap_frag:KT,meshnormal_vert:QT,meshnormal_frag:jT,meshphong_vert:t1,meshphong_frag:e1,meshphysical_vert:n1,meshphysical_frag:i1,meshtoon_vert:r1,meshtoon_frag:s1,points_vert:o1,points_frag:a1,shadow_vert:l1,shadow_frag:c1,sprite_vert:u1,sprite_frag:h1},At={common:{diffuse:{value:new $t(16777215)},opacity:{value:1},map:{value:null},mapTransform:{value:new ie},alphaMap:{value:null},alphaMapTransform:{value:new ie},alphaTest:{value:0}},specularmap:{specularMap:{value:null},specularMapTransform:{value:new ie}},envmap:{envMap:{value:null},envMapRotation:{value:new ie},flipEnvMap:{value:-1},reflectivity:{value:1},ior:{value:1.5},refractionRatio:{value:.98},dfgLUT:{value:null}},aomap:{aoMap:{value:null},aoMapIntensity:{value:1},aoMapTransform:{value:new ie}},lightmap:{lightMap:{value:null},lightMapIntensity:{value:1},lightMapTransform:{value:new ie}},bumpmap:{bumpMap:{value:null},bumpMapTransform:{value:new ie},bumpScale:{value:1}},normalmap:{normalMap:{value:null},normalMapTransform:{value:new ie},normalScale:{value:new mt(1,1)}},displacementmap:{displacementMap:{value:null},displacementMapTransform:{value:new ie},displacementScale:{value:1},displacementBias:{value:0}},emissivemap:{emissiveMap:{value:null},emissiveMapTransform:{value:new ie}},metalnessmap:{metalnessMap:{value:null},metalnessMapTransform:{value:new ie}},roughnessmap:{roughnessMap:{value:null},roughnessMapTransform:{value:new ie}},gradientmap:{gradientMap:{value:null}},fog:{fogDensity:{value:25e-5},fogNear:{value:1},fogFar:{value:2e3},fogColor:{value:new $t(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 $t(16777215)},opacity:{value:1},size:{value:1},scale:{value:1},map:{value:null},alphaMap:{value:null},alphaMapTransform:{value:new ie},alphaTest:{value:0},uvTransform:{value:new ie}},sprite:{diffuse:{value:new $t(16777215)},opacity:{value:1},center:{value:new mt(.5,.5)},rotation:{value:0},map:{value:null},mapTransform:{value:new ie},alphaMap:{value:null},alphaMapTransform:{value:new ie},alphaTest:{value:0}}},di={basic:{uniforms:_n([At.common,At.specularmap,At.envmap,At.aomap,At.lightmap,At.fog]),vertexShader:se.meshbasic_vert,fragmentShader:se.meshbasic_frag},lambert:{uniforms:_n([At.common,At.specularmap,At.envmap,At.aomap,At.lightmap,At.emissivemap,At.bumpmap,At.normalmap,At.displacementmap,At.fog,At.lights,{emissive:{value:new $t(0)}}]),vertexShader:se.meshlambert_vert,fragmentShader:se.meshlambert_frag},phong:{uniforms:_n([At.common,At.specularmap,At.envmap,At.aomap,At.lightmap,At.emissivemap,At.bumpmap,At.normalmap,At.displacementmap,At.fog,At.lights,{emissive:{value:new $t(0)},specular:{value:new $t(1118481)},shininess:{value:30}}]),vertexShader:se.meshphong_vert,fragmentShader:se.meshphong_frag},standard:{uniforms:_n([At.common,At.envmap,At.aomap,At.lightmap,At.emissivemap,At.bumpmap,At.normalmap,At.displacementmap,At.roughnessmap,At.metalnessmap,At.fog,At.lights,{emissive:{value:new $t(0)},roughness:{value:1},metalness:{value:0},envMapIntensity:{value:1}}]),vertexShader:se.meshphysical_vert,fragmentShader:se.meshphysical_frag},toon:{uniforms:_n([At.common,At.aomap,At.lightmap,At.emissivemap,At.bumpmap,At.normalmap,At.displacementmap,At.gradientmap,At.fog,At.lights,{emissive:{value:new $t(0)}}]),vertexShader:se.meshtoon_vert,fragmentShader:se.meshtoon_frag},matcap:{uniforms:_n([At.common,At.bumpmap,At.normalmap,At.displacementmap,At.fog,{matcap:{value:null}}]),vertexShader:se.meshmatcap_vert,fragmentShader:se.meshmatcap_frag},points:{uniforms:_n([At.points,At.fog]),vertexShader:se.points_vert,fragmentShader:se.points_frag},dashed:{uniforms:_n([At.common,At.fog,{scale:{value:1},dashSize:{value:1},totalSize:{value:2}}]),vertexShader:se.linedashed_vert,fragmentShader:se.linedashed_frag},depth:{uniforms:_n([At.common,At.displacementmap]),vertexShader:se.depth_vert,fragmentShader:se.depth_frag},normal:{uniforms:_n([At.common,At.bumpmap,At.normalmap,At.displacementmap,{opacity:{value:1}}]),vertexShader:se.meshnormal_vert,fragmentShader:se.meshnormal_frag},sprite:{uniforms:_n([At.sprite,At.fog]),vertexShader:se.sprite_vert,fragmentShader:se.sprite_frag},background:{uniforms:{uvTransform:{value:new ie},t2D:{value:null},backgroundIntensity:{value:1}},vertexShader:se.background_vert,fragmentShader:se.background_frag},backgroundCube:{uniforms:{envMap:{value:null},flipEnvMap:{value:-1},backgroundBlurriness:{value:0},backgroundIntensity:{value:1},backgroundRotation:{value:new ie}},vertexShader:se.backgroundCube_vert,fragmentShader:se.backgroundCube_frag},cube:{uniforms:{tCube:{value:null},tFlip:{value:-1},opacity:{value:1}},vertexShader:se.cube_vert,fragmentShader:se.cube_frag},equirect:{uniforms:{tEquirect:{value:null}},vertexShader:se.equirect_vert,fragmentShader:se.equirect_frag},distance:{uniforms:_n([At.common,At.displacementmap,{referencePosition:{value:new D},nearDistance:{value:1},farDistance:{value:1e3}}]),vertexShader:se.distance_vert,fragmentShader:se.distance_frag},shadow:{uniforms:_n([At.lights,At.fog,{color:{value:new $t(0)},opacity:{value:1}}]),vertexShader:se.shadow_vert,fragmentShader:se.shadow_frag}};di.physical={uniforms:_n([di.standard.uniforms,{clearcoat:{value:0},clearcoatMap:{value:null},clearcoatMapTransform:{value:new ie},clearcoatNormalMap:{value:null},clearcoatNormalMapTransform:{value:new ie},clearcoatNormalScale:{value:new mt(1,1)},clearcoatRoughness:{value:0},clearcoatRoughnessMap:{value:null},clearcoatRoughnessMapTransform:{value:new ie},dispersion:{value:0},iridescence:{value:0},iridescenceMap:{value:null},iridescenceMapTransform:{value:new ie},iridescenceIOR:{value:1.3},iridescenceThicknessMinimum:{value:100},iridescenceThicknessMaximum:{value:400},iridescenceThicknessMap:{value:null},iridescenceThicknessMapTransform:{value:new ie},sheen:{value:0},sheenColor:{value:new $t(0)},sheenColorMap:{value:null},sheenColorMapTransform:{value:new ie},sheenRoughness:{value:1},sheenRoughnessMap:{value:null},sheenRoughnessMapTransform:{value:new ie},transmission:{value:0},transmissionMap:{value:null},transmissionMapTransform:{value:new ie},transmissionSamplerSize:{value:new mt},transmissionSamplerMap:{value:null},thickness:{value:0},thicknessMap:{value:null},thicknessMapTransform:{value:new ie},attenuationDistance:{value:0},attenuationColor:{value:new $t(0)},specularColor:{value:new $t(1,1,1)},specularColorMap:{value:null},specularColorMapTransform:{value:new ie},specularIntensity:{value:1},specularIntensityMap:{value:null},specularIntensityMapTransform:{value:new ie},anisotropyVector:{value:new mt},anisotropyMap:{value:null},anisotropyMapTransform:{value:new ie}}]),vertexShader:se.meshphysical_vert,fragmentShader:se.meshphysical_frag};const Ba={r:0,b:0,g:0},Ir=new ni,f1=new he;function d1(e,t,n,i,r,s,o){const a=new $t(0);let l=s===!0?0:1,c,u,h=null,f=0,p=null;function g(y){let x=y.isScene===!0?y.background:null;return x&&x.isTexture&&(x=(y.backgroundBlurriness>0?n:t).get(x)),x}function v(y){let x=!1;const A=g(y);A===null?d(a,l):A&&A.isColor&&(d(A,1),x=!0);const P=e.xr.getEnvironmentBlendMode();P==="additive"?i.buffers.color.setClear(0,0,0,1,o):P==="alpha-blend"&&i.buffers.color.setClear(0,0,0,0,o),(e.autoClear||x)&&(i.buffers.depth.setTest(!0),i.buffers.depth.setMask(!0),i.buffers.color.setMask(!0),e.clear(e.autoClearColor,e.autoClearDepth,e.autoClearStencil))}function m(y,x){const A=g(x);A&&(A.isCubeTexture||A.mapping===Nl)?(u===void 0&&(u=new _t(new Be(1,1,1),new ii({name:"BackgroundCubeMaterial",uniforms:Hs(di.backgroundCube.uniforms),vertexShader:di.backgroundCube.vertexShader,fragmentShader:di.backgroundCube.fragmentShader,side:dn,depthTest:!1,depthWrite:!1,fog:!1,allowOverride:!1})),u.geometry.deleteAttribute("normal"),u.geometry.deleteAttribute("uv"),u.onBeforeRender=function(P,C,R){this.matrixWorld.copyPosition(R.matrixWorld)},Object.defineProperty(u.material,"envMap",{get:function(){return this.uniforms.envMap.value}}),r.update(u)),Ir.copy(x.backgroundRotation),Ir.x*=-1,Ir.y*=-1,Ir.z*=-1,A.isCubeTexture&&A.isRenderTargetTexture===!1&&(Ir.y*=-1,Ir.z*=-1),u.material.uniforms.envMap.value=A,u.material.uniforms.flipEnvMap.value=A.isCubeTexture&&A.isRenderTargetTexture===!1?-1:1,u.material.uniforms.backgroundBlurriness.value=x.backgroundBlurriness,u.material.uniforms.backgroundIntensity.value=x.backgroundIntensity,u.material.uniforms.backgroundRotation.value.setFromMatrix4(f1.makeRotationFromEuler(Ir)),u.material.toneMapped=me.getTransfer(A.colorSpace)!==be,(h!==A||f!==A.version||p!==e.toneMapping)&&(u.material.needsUpdate=!0,h=A,f=A.version,p=e.toneMapping),u.layers.enableAll(),y.unshift(u,u.geometry,u.material,0,0,null)):A&&A.isTexture&&(c===void 0&&(c=new _t(new ta(2,2),new ii({name:"BackgroundMaterial",uniforms:Hs(di.background.uniforms),vertexShader:di.background.vertexShader,fragmentShader:di.background.fragmentShader,side:yr,depthTest:!1,depthWrite:!1,fog:!1,allowOverride:!1})),c.geometry.deleteAttribute("normal"),Object.defineProperty(c.material,"map",{get:function(){return this.uniforms.t2D.value}}),r.update(c)),c.material.uniforms.t2D.value=A,c.material.uniforms.backgroundIntensity.value=x.backgroundIntensity,c.material.toneMapped=me.getTransfer(A.colorSpace)!==be,A.matrixAutoUpdate===!0&&A.updateMatrix(),c.material.uniforms.uvTransform.value.copy(A.matrix),(h!==A||f!==A.version||p!==e.toneMapping)&&(c.material.needsUpdate=!0,h=A,f=A.version,p=e.toneMapping),c.layers.enableAll(),y.unshift(c,c.geometry,c.material,0,0,null))}function d(y,x){y.getRGB(Ba,t_(e)),i.buffers.color.setClear(Ba.r,Ba.g,Ba.b,x,o)}function S(){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(y,x=1){a.set(y),l=x,d(a,l)},getClearAlpha:function(){return l},setClearAlpha:function(y){l=y,d(a,l)},render:v,addToRenderList:m,dispose:S}}function p1(e,t){const n=e.getParameter(e.MAX_VERTEX_ATTRIBS),i={},r=f(null);let s=r,o=!1;function a(M,L,V,q,j){let J=!1;const W=h(q,V,L);s!==W&&(s=W,c(s.object)),J=p(M,q,V,j),J&&g(M,q,V,j),j!==null&&t.update(j,e.ELEMENT_ARRAY_BUFFER),(J||o)&&(o=!1,x(M,L,V,q),j!==null&&e.bindBuffer(e.ELEMENT_ARRAY_BUFFER,t.get(j).buffer))}function l(){return e.createVertexArray()}function c(M){return e.bindVertexArray(M)}function u(M){return e.deleteVertexArray(M)}function h(M,L,V){const q=V.wireframe===!0;let j=i[M.id];j===void 0&&(j={},i[M.id]=j);let J=j[L.id];J===void 0&&(J={},j[L.id]=J);let W=J[q];return W===void 0&&(W=f(l()),J[q]=W),W}function f(M){const L=[],V=[],q=[];for(let j=0;j=0){const pt=j[H];let ft=J[H];if(ft===void 0&&(H==="instanceMatrix"&&M.instanceMatrix&&(ft=M.instanceMatrix),H==="instanceColor"&&M.instanceColor&&(ft=M.instanceColor)),pt===void 0||pt.attribute!==ft||ft&&pt.data!==ft.data)return!0;W++}return s.attributesNum!==W||s.index!==q}function g(M,L,V,q){const j={},J=L.attributes;let W=0;const k=V.getAttributes();for(const H in k)if(k[H].location>=0){let pt=J[H];pt===void 0&&(H==="instanceMatrix"&&M.instanceMatrix&&(pt=M.instanceMatrix),H==="instanceColor"&&M.instanceColor&&(pt=M.instanceColor));const ft={};ft.attribute=pt,pt&&pt.data&&(ft.data=pt.data),j[H]=ft,W++}s.attributes=j,s.attributesNum=W,s.index=q}function v(){const M=s.newAttributes;for(let L=0,V=M.length;L=0){let ct=j[k];if(ct===void 0&&(k==="instanceMatrix"&&M.instanceMatrix&&(ct=M.instanceMatrix),k==="instanceColor"&&M.instanceColor&&(ct=M.instanceColor)),ct!==void 0){const pt=ct.normalized,ft=ct.itemSize,kt=t.get(ct);if(kt===void 0)continue;const Lt=kt.buffer,Zt=kt.type,ue=kt.bytesPerElement,st=Zt===e.INT||Zt===e.UNSIGNED_INT||ct.gpuType===af;if(ct.isInterleavedBufferAttribute){const ot=ct.data,Pt=ot.stride,Vt=ct.offset;if(ot.isInstancedInterleavedBuffer){for(let Mt=0;Mt0&&e.getShaderPrecisionFormat(e.FRAGMENT_SHADER,e.HIGH_FLOAT).precision>0)return"highp";C="mediump"}return C==="mediump"&&e.getShaderPrecisionFormat(e.VERTEX_SHADER,e.MEDIUM_FLOAT).precision>0&&e.getShaderPrecisionFormat(e.FRAGMENT_SHADER,e.MEDIUM_FLOAT).precision>0?"mediump":"lowp"}let c=n.precision!==void 0?n.precision:"highp";const u=l(c);u!==c&&(Yt("WebGLRenderer:",c,"not supported, using",u,"instead."),c=u);const h=n.logarithmicDepthBuffer===!0,f=n.reversedDepthBuffer===!0&&t.has("EXT_clip_control"),p=e.getParameter(e.MAX_TEXTURE_IMAGE_UNITS),g=e.getParameter(e.MAX_VERTEX_TEXTURE_IMAGE_UNITS),v=e.getParameter(e.MAX_TEXTURE_SIZE),m=e.getParameter(e.MAX_CUBE_MAP_TEXTURE_SIZE),d=e.getParameter(e.MAX_VERTEX_ATTRIBS),S=e.getParameter(e.MAX_VERTEX_UNIFORM_VECTORS),y=e.getParameter(e.MAX_VARYING_VECTORS),x=e.getParameter(e.MAX_FRAGMENT_UNIFORM_VECTORS),A=e.getParameter(e.MAX_SAMPLES),P=e.getParameter(e.SAMPLES);return{isWebGL2:!0,getMaxAnisotropy:s,getMaxPrecision:l,textureFormatReadable:o,textureTypeReadable:a,precision:c,logarithmicDepthBuffer:h,reversedDepthBuffer:f,maxTextures:p,maxVertexTextures:g,maxTextureSize:v,maxCubemapSize:m,maxAttributes:d,maxVertexUniforms:S,maxVaryings:y,maxFragmentUniforms:x,maxSamples:A,samples:P}}function _1(e){const t=this;let n=null,i=0,r=!1,s=!1;const o=new Fi,a=new ie,l={value:null,needsUpdate:!1};this.uniform=l,this.numPlanes=0,this.numIntersection=0,this.init=function(h,f){const p=h.length!==0||f||i!==0||r;return r=f,i=h.length,p},this.beginShadows=function(){s=!0,u(null)},this.endShadows=function(){s=!1},this.setGlobalState=function(h,f){n=u(h,f,0)},this.setState=function(h,f,p){const g=h.clippingPlanes,v=h.clipIntersection,m=h.clipShadows,d=e.get(h);if(!r||g===null||g.length===0||s&&!m)s?u(null):c();else{const S=s?0:i,y=S*4;let x=d.clippingState||null;l.value=x,x=u(g,f,y,p);for(let A=0;A!==y;++A)x[A]=n[A];d.clippingState=x,this.numIntersection=v?this.numPlanes:0,this.numPlanes+=S}};function c(){l.value!==n&&(l.value=n,l.needsUpdate=i>0),t.numPlanes=i,t.numIntersection=0}function u(h,f,p,g){const v=h!==null?h.length:0;let m=null;if(v!==0){if(m=l.value,g!==!0||m===null){const d=p+v*4,S=f.matrixWorldInverse;a.getNormalMatrix(S),(m===null||m.length0){const c=new r_(l.height);return c.fromEquirectangularTexture(e,o),t.set(o,c),o.addEventListener("dispose",r),n(c.texture,o.mapping)}else return null}}return o}function r(o){const a=o.target;a.removeEventListener("dispose",r);const l=t.get(a);l!==void 0&&(t.delete(a),l.dispose())}function s(){t=new WeakMap}return{get:i,dispose:s}}const gr=4,hm=[.125,.215,.35,.446,.526,.582],kr=20,x1=256,co=new Cf,fm=new $t;let Oc=null,Fc=0,kc=0,Bc=!1;const y1=new D;class dm{constructor(t){this._renderer=t,this._pingPongRenderTarget=null,this._lodMax=0,this._cubeSize=0,this._sizeLods=[],this._sigmas=[],this._lodMeshes=[],this._backgroundBox=null,this._cubemapMaterial=null,this._equirectMaterial=null,this._blurMaterial=null,this._ggxMaterial=null}fromScene(t,n=0,i=.1,r=100,s={}){const{size:o=256,position:a=y1}=s;Oc=this._renderer.getRenderTarget(),Fc=this._renderer.getActiveCubeFace(),kc=this._renderer.getActiveMipmapLevel(),Bc=this._renderer.xr.enabled,this._renderer.xr.enabled=!1,this._setSize(o);const l=this._allocateTargets();return l.depthBuffer=!0,this._sceneToCubeUV(t,i,r,l,a),n>0&&this._blur(l,0,0,n),this._applyPMREM(l),this._cleanup(l),l}fromEquirectangular(t,n=null){return this._fromTexture(t,n)}fromCubemap(t,n=null){return this._fromTexture(t,n)}compileCubemapShader(){this._cubemapMaterial===null&&(this._cubemapMaterial=gm(),this._compileMaterial(this._cubemapMaterial))}compileEquirectangularShader(){this._equirectMaterial===null&&(this._equirectMaterial=mm(),this._compileMaterial(this._equirectMaterial))}dispose(){this._dispose(),this._cubemapMaterial!==null&&this._cubemapMaterial.dispose(),this._equirectMaterial!==null&&this._equirectMaterial.dispose(),this._backgroundBox!==null&&(this._backgroundBox.geometry.dispose(),this._backgroundBox.material.dispose())}_setSize(t){this._lodMax=Math.floor(Math.log2(t)),this._cubeSize=Math.pow(2,this._lodMax)}_dispose(){this._blurMaterial!==null&&this._blurMaterial.dispose(),this._ggxMaterial!==null&&this._ggxMaterial.dispose(),this._pingPongRenderTarget!==null&&this._pingPongRenderTarget.dispose();for(let t=0;t2?A:0,A,A),h.setRenderTarget(r),d&&h.render(v,l),h.render(t,l)}h.toneMapping=p,h.autoClear=f,t.background=S}_textureToCubeUV(t,n){const i=this._renderer,r=t.mapping===$r||t.mapping===ks;r?(this._cubemapMaterial===null&&(this._cubemapMaterial=gm()),this._cubemapMaterial.uniforms.flipEnvMap.value=t.isRenderTargetTexture===!1?-1:1):this._equirectMaterial===null&&(this._equirectMaterial=mm());const s=r?this._cubemapMaterial:this._equirectMaterial,o=this._lodMeshes[0];o.material=s;const a=s.uniforms;a.envMap.value=t;const l=this._cubeSize;vs(n,0,0,3*l,2*l),i.setRenderTarget(n),i.render(o,co)}_applyPMREM(t){const n=this._renderer,i=n.autoClear;n.autoClear=!1;const r=this._lodMeshes.length;for(let s=1;sg-gr?i-g+gr:0),d=4*(this._cubeSize-v);l.envMap.value=t.texture,l.roughness.value=p,l.mipInt.value=g-n,vs(s,m,d,3*v,2*v),r.setRenderTarget(s),r.render(a,co),l.envMap.value=s.texture,l.roughness.value=0,l.mipInt.value=g-i,vs(t,m,d,3*v,2*v),r.setRenderTarget(t),r.render(a,co)}_blur(t,n,i,r,s){const o=this._pingPongRenderTarget;this._halfBlur(t,o,n,i,r,"latitudinal",s),this._halfBlur(o,t,i,i,r,"longitudinal",s)}_halfBlur(t,n,i,r,s,o,a){const l=this._renderer,c=this._blurMaterial;o!=="latitudinal"&&o!=="longitudinal"&&de("blur direction must be either latitudinal or longitudinal!");const u=3,h=this._lodMeshes[r];h.material=c;const f=c.uniforms,p=this._sizeLods[i]-1,g=isFinite(s)?Math.PI/(2*p):2*Math.PI/(2*kr-1),v=s/g,m=isFinite(s)?1+Math.floor(u*v):kr;m>kr&&Yt(`sigmaRadians, ${s}, is too large and will clip, as it requested ${m} samples when the maximum is set to ${kr}`);const d=[];let S=0;for(let C=0;Cy-gr?r-y+gr:0),P=4*(this._cubeSize-x);vs(n,A,P,3*x,2*x),l.setRenderTarget(n),l.render(h,co)}}function S1(e){const t=[],n=[],i=[];let r=e;const s=e-gr+1+hm.length;for(let o=0;oe-gr?l=hm[o-e+gr-1]:o===0&&(l=0),n.push(l);const c=1/(a-2),u=-c,h=1+c,f=[u,u,h,u,h,h,u,u,h,h,u,h],p=6,g=6,v=3,m=2,d=1,S=new Float32Array(v*g*p),y=new Float32Array(m*g*p),x=new Float32Array(d*g*p);for(let P=0;P2?0:-1,b=[C,R,0,C+2/3,R,0,C+2/3,R+1,0,C,R,0,C+2/3,R+1,0,C,R+1,0];S.set(b,v*g*P),y.set(f,m*g*P);const M=[P,P,P,P,P,P];x.set(M,d*g*P)}const A=new fe;A.setAttribute("position",new bn(S,v)),A.setAttribute("uv",new bn(y,m)),A.setAttribute("faceIndex",new bn(x,d)),i.push(new _t(A,null)),r>gr&&r--}return{lodMeshes:i,sizeLods:t,sigmas:n}}function pm(e,t,n){const i=new xi(e,t,n);return i.texture.mapping=Nl,i.texture.name="PMREM.cubeUv",i.scissorTest=!0,i}function vs(e,t,n,i,r){e.viewport.set(t,n,i,r),e.scissor.set(t,n,i,r)}function b1(e,t,n){return new ii({name:"PMREMGGXConvolution",defines:{GGX_SAMPLES:x1,CUBEUV_TEXEL_WIDTH:1/t,CUBEUV_TEXEL_HEIGHT:1/n,CUBEUV_MAX_MIP:`${e}.0`},uniforms:{envMap:{value:null},roughness:{value:0},mipInt:{value:0}},vertexShader:Ol(),fragmentShader:` +}`,se={alphahash_fragment:Lw,alphahash_pars_fragment:Nw,alphamap_fragment:Uw,alphamap_pars_fragment:Ow,alphatest_fragment:Fw,alphatest_pars_fragment:kw,aomap_fragment:Bw,aomap_pars_fragment:zw,batching_pars_vertex:Vw,batching_vertex:Hw,begin_vertex:Gw,beginnormal_vertex:Ww,bsdfs:Xw,iridescence_fragment:qw,bumpmap_pars_fragment:Yw,clipping_planes_fragment:Jw,clipping_planes_pars_fragment:$w,clipping_planes_pars_vertex:Zw,clipping_planes_vertex:Kw,color_fragment:Qw,color_pars_fragment:jw,color_pars_vertex:tE,color_vertex:eE,common:nE,cube_uv_reflection_fragment:iE,defaultnormal_vertex:rE,displacementmap_pars_vertex:sE,displacementmap_vertex:oE,emissivemap_fragment:aE,emissivemap_pars_fragment:lE,colorspace_fragment:cE,colorspace_pars_fragment:uE,envmap_fragment:hE,envmap_common_pars_fragment:fE,envmap_pars_fragment:dE,envmap_pars_vertex:pE,envmap_physical_pars_fragment:EE,envmap_vertex:mE,fog_vertex:gE,fog_pars_vertex:_E,fog_fragment:vE,fog_pars_fragment:xE,gradientmap_pars_fragment:yE,lightmap_pars_fragment:SE,lights_lambert_fragment:bE,lights_lambert_pars_fragment:ME,lights_pars_begin:wE,lights_toon_fragment:TE,lights_toon_pars_fragment:AE,lights_phong_fragment:PE,lights_phong_pars_fragment:CE,lights_physical_fragment:RE,lights_physical_pars_fragment:DE,lights_fragment_begin:IE,lights_fragment_maps:LE,lights_fragment_end:NE,logdepthbuf_fragment:UE,logdepthbuf_pars_fragment:OE,logdepthbuf_pars_vertex:FE,logdepthbuf_vertex:kE,map_fragment:BE,map_pars_fragment:zE,map_particle_fragment:VE,map_particle_pars_fragment:HE,metalnessmap_fragment:GE,metalnessmap_pars_fragment:WE,morphinstance_vertex:XE,morphcolor_vertex:qE,morphnormal_vertex:YE,morphtarget_pars_vertex:JE,morphtarget_vertex:$E,normal_fragment_begin:ZE,normal_fragment_maps:KE,normal_pars_fragment:QE,normal_pars_vertex:jE,normal_vertex:tT,normalmap_pars_fragment:eT,clearcoat_normal_fragment_begin:nT,clearcoat_normal_fragment_maps:iT,clearcoat_pars_fragment:rT,iridescence_pars_fragment:sT,opaque_fragment:oT,packing:aT,premultiplied_alpha_fragment:lT,project_vertex:cT,dithering_fragment:uT,dithering_pars_fragment:hT,roughnessmap_fragment:fT,roughnessmap_pars_fragment:dT,shadowmap_pars_fragment:pT,shadowmap_pars_vertex:mT,shadowmap_vertex:gT,shadowmask_pars_fragment:_T,skinbase_vertex:vT,skinning_pars_vertex:xT,skinning_vertex:yT,skinnormal_vertex:ST,specularmap_fragment:bT,specularmap_pars_fragment:MT,tonemapping_fragment:wT,tonemapping_pars_fragment:ET,transmission_fragment:TT,transmission_pars_fragment:AT,uv_pars_fragment:PT,uv_pars_vertex:CT,uv_vertex:RT,worldpos_vertex:DT,background_vert:IT,background_frag:LT,backgroundCube_vert:NT,backgroundCube_frag:UT,cube_vert:OT,cube_frag:FT,depth_vert:kT,depth_frag:BT,distance_vert:zT,distance_frag:VT,equirect_vert:HT,equirect_frag:GT,linedashed_vert:WT,linedashed_frag:XT,meshbasic_vert:qT,meshbasic_frag:YT,meshlambert_vert:JT,meshlambert_frag:$T,meshmatcap_vert:ZT,meshmatcap_frag:KT,meshnormal_vert:QT,meshnormal_frag:jT,meshphong_vert:t1,meshphong_frag:e1,meshphysical_vert:n1,meshphysical_frag:i1,meshtoon_vert:r1,meshtoon_frag:s1,points_vert:o1,points_frag:a1,shadow_vert:l1,shadow_frag:c1,sprite_vert:u1,sprite_frag:h1},At={common:{diffuse:{value:new $t(16777215)},opacity:{value:1},map:{value:null},mapTransform:{value:new ie},alphaMap:{value:null},alphaMapTransform:{value:new ie},alphaTest:{value:0}},specularmap:{specularMap:{value:null},specularMapTransform:{value:new ie}},envmap:{envMap:{value:null},envMapRotation:{value:new ie},flipEnvMap:{value:-1},reflectivity:{value:1},ior:{value:1.5},refractionRatio:{value:.98},dfgLUT:{value:null}},aomap:{aoMap:{value:null},aoMapIntensity:{value:1},aoMapTransform:{value:new ie}},lightmap:{lightMap:{value:null},lightMapIntensity:{value:1},lightMapTransform:{value:new ie}},bumpmap:{bumpMap:{value:null},bumpMapTransform:{value:new ie},bumpScale:{value:1}},normalmap:{normalMap:{value:null},normalMapTransform:{value:new ie},normalScale:{value:new mt(1,1)}},displacementmap:{displacementMap:{value:null},displacementMapTransform:{value:new ie},displacementScale:{value:1},displacementBias:{value:0}},emissivemap:{emissiveMap:{value:null},emissiveMapTransform:{value:new ie}},metalnessmap:{metalnessMap:{value:null},metalnessMapTransform:{value:new ie}},roughnessmap:{roughnessMap:{value:null},roughnessMapTransform:{value:new ie}},gradientmap:{gradientMap:{value:null}},fog:{fogDensity:{value:25e-5},fogNear:{value:1},fogFar:{value:2e3},fogColor:{value:new $t(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 $t(16777215)},opacity:{value:1},size:{value:1},scale:{value:1},map:{value:null},alphaMap:{value:null},alphaMapTransform:{value:new ie},alphaTest:{value:0},uvTransform:{value:new ie}},sprite:{diffuse:{value:new $t(16777215)},opacity:{value:1},center:{value:new mt(.5,.5)},rotation:{value:0},map:{value:null},mapTransform:{value:new ie},alphaMap:{value:null},alphaMapTransform:{value:new ie},alphaTest:{value:0}}},di={basic:{uniforms:vn([At.common,At.specularmap,At.envmap,At.aomap,At.lightmap,At.fog]),vertexShader:se.meshbasic_vert,fragmentShader:se.meshbasic_frag},lambert:{uniforms:vn([At.common,At.specularmap,At.envmap,At.aomap,At.lightmap,At.emissivemap,At.bumpmap,At.normalmap,At.displacementmap,At.fog,At.lights,{emissive:{value:new $t(0)}}]),vertexShader:se.meshlambert_vert,fragmentShader:se.meshlambert_frag},phong:{uniforms:vn([At.common,At.specularmap,At.envmap,At.aomap,At.lightmap,At.emissivemap,At.bumpmap,At.normalmap,At.displacementmap,At.fog,At.lights,{emissive:{value:new $t(0)},specular:{value:new $t(1118481)},shininess:{value:30}}]),vertexShader:se.meshphong_vert,fragmentShader:se.meshphong_frag},standard:{uniforms:vn([At.common,At.envmap,At.aomap,At.lightmap,At.emissivemap,At.bumpmap,At.normalmap,At.displacementmap,At.roughnessmap,At.metalnessmap,At.fog,At.lights,{emissive:{value:new $t(0)},roughness:{value:1},metalness:{value:0},envMapIntensity:{value:1}}]),vertexShader:se.meshphysical_vert,fragmentShader:se.meshphysical_frag},toon:{uniforms:vn([At.common,At.aomap,At.lightmap,At.emissivemap,At.bumpmap,At.normalmap,At.displacementmap,At.gradientmap,At.fog,At.lights,{emissive:{value:new $t(0)}}]),vertexShader:se.meshtoon_vert,fragmentShader:se.meshtoon_frag},matcap:{uniforms:vn([At.common,At.bumpmap,At.normalmap,At.displacementmap,At.fog,{matcap:{value:null}}]),vertexShader:se.meshmatcap_vert,fragmentShader:se.meshmatcap_frag},points:{uniforms:vn([At.points,At.fog]),vertexShader:se.points_vert,fragmentShader:se.points_frag},dashed:{uniforms:vn([At.common,At.fog,{scale:{value:1},dashSize:{value:1},totalSize:{value:2}}]),vertexShader:se.linedashed_vert,fragmentShader:se.linedashed_frag},depth:{uniforms:vn([At.common,At.displacementmap]),vertexShader:se.depth_vert,fragmentShader:se.depth_frag},normal:{uniforms:vn([At.common,At.bumpmap,At.normalmap,At.displacementmap,{opacity:{value:1}}]),vertexShader:se.meshnormal_vert,fragmentShader:se.meshnormal_frag},sprite:{uniforms:vn([At.sprite,At.fog]),vertexShader:se.sprite_vert,fragmentShader:se.sprite_frag},background:{uniforms:{uvTransform:{value:new ie},t2D:{value:null},backgroundIntensity:{value:1}},vertexShader:se.background_vert,fragmentShader:se.background_frag},backgroundCube:{uniforms:{envMap:{value:null},flipEnvMap:{value:-1},backgroundBlurriness:{value:0},backgroundIntensity:{value:1},backgroundRotation:{value:new ie}},vertexShader:se.backgroundCube_vert,fragmentShader:se.backgroundCube_frag},cube:{uniforms:{tCube:{value:null},tFlip:{value:-1},opacity:{value:1}},vertexShader:se.cube_vert,fragmentShader:se.cube_frag},equirect:{uniforms:{tEquirect:{value:null}},vertexShader:se.equirect_vert,fragmentShader:se.equirect_frag},distance:{uniforms:vn([At.common,At.displacementmap,{referencePosition:{value:new D},nearDistance:{value:1},farDistance:{value:1e3}}]),vertexShader:se.distance_vert,fragmentShader:se.distance_frag},shadow:{uniforms:vn([At.lights,At.fog,{color:{value:new $t(0)},opacity:{value:1}}]),vertexShader:se.shadow_vert,fragmentShader:se.shadow_frag}};di.physical={uniforms:vn([di.standard.uniforms,{clearcoat:{value:0},clearcoatMap:{value:null},clearcoatMapTransform:{value:new ie},clearcoatNormalMap:{value:null},clearcoatNormalMapTransform:{value:new ie},clearcoatNormalScale:{value:new mt(1,1)},clearcoatRoughness:{value:0},clearcoatRoughnessMap:{value:null},clearcoatRoughnessMapTransform:{value:new ie},dispersion:{value:0},iridescence:{value:0},iridescenceMap:{value:null},iridescenceMapTransform:{value:new ie},iridescenceIOR:{value:1.3},iridescenceThicknessMinimum:{value:100},iridescenceThicknessMaximum:{value:400},iridescenceThicknessMap:{value:null},iridescenceThicknessMapTransform:{value:new ie},sheen:{value:0},sheenColor:{value:new $t(0)},sheenColorMap:{value:null},sheenColorMapTransform:{value:new ie},sheenRoughness:{value:1},sheenRoughnessMap:{value:null},sheenRoughnessMapTransform:{value:new ie},transmission:{value:0},transmissionMap:{value:null},transmissionMapTransform:{value:new ie},transmissionSamplerSize:{value:new mt},transmissionSamplerMap:{value:null},thickness:{value:0},thicknessMap:{value:null},thicknessMapTransform:{value:new ie},attenuationDistance:{value:0},attenuationColor:{value:new $t(0)},specularColor:{value:new $t(1,1,1)},specularColorMap:{value:null},specularColorMapTransform:{value:new ie},specularIntensity:{value:1},specularIntensityMap:{value:null},specularIntensityMapTransform:{value:new ie},anisotropyVector:{value:new mt},anisotropyMap:{value:null},anisotropyMapTransform:{value:new ie}}]),vertexShader:se.meshphysical_vert,fragmentShader:se.meshphysical_frag};const Ba={r:0,b:0,g:0},Ir=new ni,f1=new he;function d1(e,t,n,i,r,s,o){const a=new $t(0);let l=s===!0?0:1,c,u,h=null,f=0,p=null;function g(x){let y=x.isScene===!0?x.background:null;return y&&y.isTexture&&(y=(x.backgroundBlurriness>0?n:t).get(y)),y}function _(x){let y=!1;const T=g(x);T===null?d(a,l):T&&T.isColor&&(d(T,1),y=!0);const P=e.xr.getEnvironmentBlendMode();P==="additive"?i.buffers.color.setClear(0,0,0,1,o):P==="alpha-blend"&&i.buffers.color.setClear(0,0,0,0,o),(e.autoClear||y)&&(i.buffers.depth.setTest(!0),i.buffers.depth.setMask(!0),i.buffers.color.setMask(!0),e.clear(e.autoClearColor,e.autoClearDepth,e.autoClearStencil))}function m(x,y){const T=g(y);T&&(T.isCubeTexture||T.mapping===Ul)?(u===void 0&&(u=new _t(new Be(1,1,1),new ii({name:"BackgroundCubeMaterial",uniforms:Hs(di.backgroundCube.uniforms),vertexShader:di.backgroundCube.vertexShader,fragmentShader:di.backgroundCube.fragmentShader,side:dn,depthTest:!1,depthWrite:!1,fog:!1,allowOverride:!1})),u.geometry.deleteAttribute("normal"),u.geometry.deleteAttribute("uv"),u.onBeforeRender=function(P,R,C){this.matrixWorld.copyPosition(C.matrixWorld)},Object.defineProperty(u.material,"envMap",{get:function(){return this.uniforms.envMap.value}}),r.update(u)),Ir.copy(y.backgroundRotation),Ir.x*=-1,Ir.y*=-1,Ir.z*=-1,T.isCubeTexture&&T.isRenderTargetTexture===!1&&(Ir.y*=-1,Ir.z*=-1),u.material.uniforms.envMap.value=T,u.material.uniforms.flipEnvMap.value=T.isCubeTexture&&T.isRenderTargetTexture===!1?-1:1,u.material.uniforms.backgroundBlurriness.value=y.backgroundBlurriness,u.material.uniforms.backgroundIntensity.value=y.backgroundIntensity,u.material.uniforms.backgroundRotation.value.setFromMatrix4(f1.makeRotationFromEuler(Ir)),u.material.toneMapped=me.getTransfer(T.colorSpace)!==be,(h!==T||f!==T.version||p!==e.toneMapping)&&(u.material.needsUpdate=!0,h=T,f=T.version,p=e.toneMapping),u.layers.enableAll(),x.unshift(u,u.geometry,u.material,0,0,null)):T&&T.isTexture&&(c===void 0&&(c=new _t(new ta(2,2),new ii({name:"BackgroundMaterial",uniforms:Hs(di.background.uniforms),vertexShader:di.background.vertexShader,fragmentShader:di.background.fragmentShader,side:yr,depthTest:!1,depthWrite:!1,fog:!1,allowOverride:!1})),c.geometry.deleteAttribute("normal"),Object.defineProperty(c.material,"map",{get:function(){return this.uniforms.t2D.value}}),r.update(c)),c.material.uniforms.t2D.value=T,c.material.uniforms.backgroundIntensity.value=y.backgroundIntensity,c.material.toneMapped=me.getTransfer(T.colorSpace)!==be,T.matrixAutoUpdate===!0&&T.updateMatrix(),c.material.uniforms.uvTransform.value.copy(T.matrix),(h!==T||f!==T.version||p!==e.toneMapping)&&(c.material.needsUpdate=!0,h=T,f=T.version,p=e.toneMapping),c.layers.enableAll(),x.unshift(c,c.geometry,c.material,0,0,null))}function d(x,y){x.getRGB(Ba,t_(e)),i.buffers.color.setClear(Ba.r,Ba.g,Ba.b,y,o)}function S(){u!==void 0&&(u.geometry.dispose(),u.material.dispose(),u=void 0),c!==void 0&&(c.geometry.dispose(),c.material.dispose(),c=void 0)}return{getClearColor:function(){return a},setClearColor:function(x,y=1){a.set(x),l=y,d(a,l)},getClearAlpha:function(){return l},setClearAlpha:function(x){l=x,d(a,l)},render:_,addToRenderList:m,dispose:S}}function p1(e,t){const n=e.getParameter(e.MAX_VERTEX_ATTRIBS),i={},r=f(null);let s=r,o=!1;function a(M,L,V,q,j){let J=!1;const W=h(q,V,L);s!==W&&(s=W,c(s.object)),J=p(M,q,V,j),J&&g(M,q,V,j),j!==null&&t.update(j,e.ELEMENT_ARRAY_BUFFER),(J||o)&&(o=!1,y(M,L,V,q),j!==null&&e.bindBuffer(e.ELEMENT_ARRAY_BUFFER,t.get(j).buffer))}function l(){return e.createVertexArray()}function c(M){return e.bindVertexArray(M)}function u(M){return e.deleteVertexArray(M)}function h(M,L,V){const q=V.wireframe===!0;let j=i[M.id];j===void 0&&(j={},i[M.id]=j);let J=j[L.id];J===void 0&&(J={},j[L.id]=J);let W=J[q];return W===void 0&&(W=f(l()),J[q]=W),W}function f(M){const L=[],V=[],q=[];for(let j=0;j=0){const pt=j[H];let ft=J[H];if(ft===void 0&&(H==="instanceMatrix"&&M.instanceMatrix&&(ft=M.instanceMatrix),H==="instanceColor"&&M.instanceColor&&(ft=M.instanceColor)),pt===void 0||pt.attribute!==ft||ft&&pt.data!==ft.data)return!0;W++}return s.attributesNum!==W||s.index!==q}function g(M,L,V,q){const j={},J=L.attributes;let W=0;const k=V.getAttributes();for(const H in k)if(k[H].location>=0){let pt=J[H];pt===void 0&&(H==="instanceMatrix"&&M.instanceMatrix&&(pt=M.instanceMatrix),H==="instanceColor"&&M.instanceColor&&(pt=M.instanceColor));const ft={};ft.attribute=pt,pt&&pt.data&&(ft.data=pt.data),j[H]=ft,W++}s.attributes=j,s.attributesNum=W,s.index=q}function _(){const M=s.newAttributes;for(let L=0,V=M.length;L=0){let ct=j[k];if(ct===void 0&&(k==="instanceMatrix"&&M.instanceMatrix&&(ct=M.instanceMatrix),k==="instanceColor"&&M.instanceColor&&(ct=M.instanceColor)),ct!==void 0){const pt=ct.normalized,ft=ct.itemSize,kt=t.get(ct);if(kt===void 0)continue;const Lt=kt.buffer,Zt=kt.type,ue=kt.bytesPerElement,st=Zt===e.INT||Zt===e.UNSIGNED_INT||ct.gpuType===af;if(ct.isInterleavedBufferAttribute){const ot=ct.data,Pt=ot.stride,Vt=ct.offset;if(ot.isInstancedInterleavedBuffer){for(let Mt=0;Mt0&&e.getShaderPrecisionFormat(e.FRAGMENT_SHADER,e.HIGH_FLOAT).precision>0)return"highp";R="mediump"}return R==="mediump"&&e.getShaderPrecisionFormat(e.VERTEX_SHADER,e.MEDIUM_FLOAT).precision>0&&e.getShaderPrecisionFormat(e.FRAGMENT_SHADER,e.MEDIUM_FLOAT).precision>0?"mediump":"lowp"}let c=n.precision!==void 0?n.precision:"highp";const u=l(c);u!==c&&(Yt("WebGLRenderer:",c,"not supported, using",u,"instead."),c=u);const h=n.logarithmicDepthBuffer===!0,f=n.reversedDepthBuffer===!0&&t.has("EXT_clip_control"),p=e.getParameter(e.MAX_TEXTURE_IMAGE_UNITS),g=e.getParameter(e.MAX_VERTEX_TEXTURE_IMAGE_UNITS),_=e.getParameter(e.MAX_TEXTURE_SIZE),m=e.getParameter(e.MAX_CUBE_MAP_TEXTURE_SIZE),d=e.getParameter(e.MAX_VERTEX_ATTRIBS),S=e.getParameter(e.MAX_VERTEX_UNIFORM_VECTORS),x=e.getParameter(e.MAX_VARYING_VECTORS),y=e.getParameter(e.MAX_FRAGMENT_UNIFORM_VECTORS),T=e.getParameter(e.MAX_SAMPLES),P=e.getParameter(e.SAMPLES);return{isWebGL2:!0,getMaxAnisotropy:s,getMaxPrecision:l,textureFormatReadable:o,textureTypeReadable:a,precision:c,logarithmicDepthBuffer:h,reversedDepthBuffer:f,maxTextures:p,maxVertexTextures:g,maxTextureSize:_,maxCubemapSize:m,maxAttributes:d,maxVertexUniforms:S,maxVaryings:x,maxFragmentUniforms:y,maxSamples:T,samples:P}}function _1(e){const t=this;let n=null,i=0,r=!1,s=!1;const o=new Fi,a=new ie,l={value:null,needsUpdate:!1};this.uniform=l,this.numPlanes=0,this.numIntersection=0,this.init=function(h,f){const p=h.length!==0||f||i!==0||r;return r=f,i=h.length,p},this.beginShadows=function(){s=!0,u(null)},this.endShadows=function(){s=!1},this.setGlobalState=function(h,f){n=u(h,f,0)},this.setState=function(h,f,p){const g=h.clippingPlanes,_=h.clipIntersection,m=h.clipShadows,d=e.get(h);if(!r||g===null||g.length===0||s&&!m)s?u(null):c();else{const S=s?0:i,x=S*4;let y=d.clippingState||null;l.value=y,y=u(g,f,x,p);for(let T=0;T!==x;++T)y[T]=n[T];d.clippingState=y,this.numIntersection=_?this.numPlanes:0,this.numPlanes+=S}};function c(){l.value!==n&&(l.value=n,l.needsUpdate=i>0),t.numPlanes=i,t.numIntersection=0}function u(h,f,p,g){const _=h!==null?h.length:0;let m=null;if(_!==0){if(m=l.value,g!==!0||m===null){const d=p+_*4,S=f.matrixWorldInverse;a.getNormalMatrix(S),(m===null||m.length0){const c=new r_(l.height);return c.fromEquirectangularTexture(e,o),t.set(o,c),o.addEventListener("dispose",r),n(c.texture,o.mapping)}else return null}}return o}function r(o){const a=o.target;a.removeEventListener("dispose",r);const l=t.get(a);l!==void 0&&(t.delete(a),l.dispose())}function s(){t=new WeakMap}return{get:i,dispose:s}}const gr=4,hm=[.125,.215,.35,.446,.526,.582],kr=20,x1=256,co=new Cf,fm=new $t;let Fc=null,kc=0,Bc=0,zc=!1;const y1=new D;class dm{constructor(t){this._renderer=t,this._pingPongRenderTarget=null,this._lodMax=0,this._cubeSize=0,this._sizeLods=[],this._sigmas=[],this._lodMeshes=[],this._backgroundBox=null,this._cubemapMaterial=null,this._equirectMaterial=null,this._blurMaterial=null,this._ggxMaterial=null}fromScene(t,n=0,i=.1,r=100,s={}){const{size:o=256,position:a=y1}=s;Fc=this._renderer.getRenderTarget(),kc=this._renderer.getActiveCubeFace(),Bc=this._renderer.getActiveMipmapLevel(),zc=this._renderer.xr.enabled,this._renderer.xr.enabled=!1,this._setSize(o);const l=this._allocateTargets();return l.depthBuffer=!0,this._sceneToCubeUV(t,i,r,l,a),n>0&&this._blur(l,0,0,n),this._applyPMREM(l),this._cleanup(l),l}fromEquirectangular(t,n=null){return this._fromTexture(t,n)}fromCubemap(t,n=null){return this._fromTexture(t,n)}compileCubemapShader(){this._cubemapMaterial===null&&(this._cubemapMaterial=gm(),this._compileMaterial(this._cubemapMaterial))}compileEquirectangularShader(){this._equirectMaterial===null&&(this._equirectMaterial=mm(),this._compileMaterial(this._equirectMaterial))}dispose(){this._dispose(),this._cubemapMaterial!==null&&this._cubemapMaterial.dispose(),this._equirectMaterial!==null&&this._equirectMaterial.dispose(),this._backgroundBox!==null&&(this._backgroundBox.geometry.dispose(),this._backgroundBox.material.dispose())}_setSize(t){this._lodMax=Math.floor(Math.log2(t)),this._cubeSize=Math.pow(2,this._lodMax)}_dispose(){this._blurMaterial!==null&&this._blurMaterial.dispose(),this._ggxMaterial!==null&&this._ggxMaterial.dispose(),this._pingPongRenderTarget!==null&&this._pingPongRenderTarget.dispose();for(let t=0;t2?T:0,T,T),h.setRenderTarget(r),d&&h.render(_,l),h.render(t,l)}h.toneMapping=p,h.autoClear=f,t.background=S}_textureToCubeUV(t,n){const i=this._renderer,r=t.mapping===$r||t.mapping===ks;r?(this._cubemapMaterial===null&&(this._cubemapMaterial=gm()),this._cubemapMaterial.uniforms.flipEnvMap.value=t.isRenderTargetTexture===!1?-1:1):this._equirectMaterial===null&&(this._equirectMaterial=mm());const s=r?this._cubemapMaterial:this._equirectMaterial,o=this._lodMeshes[0];o.material=s;const a=s.uniforms;a.envMap.value=t;const l=this._cubeSize;vs(n,0,0,3*l,2*l),i.setRenderTarget(n),i.render(o,co)}_applyPMREM(t){const n=this._renderer,i=n.autoClear;n.autoClear=!1;const r=this._lodMeshes.length;for(let s=1;sg-gr?i-g+gr:0),d=4*(this._cubeSize-_);l.envMap.value=t.texture,l.roughness.value=p,l.mipInt.value=g-n,vs(s,m,d,3*_,2*_),r.setRenderTarget(s),r.render(a,co),l.envMap.value=s.texture,l.roughness.value=0,l.mipInt.value=g-i,vs(t,m,d,3*_,2*_),r.setRenderTarget(t),r.render(a,co)}_blur(t,n,i,r,s){const o=this._pingPongRenderTarget;this._halfBlur(t,o,n,i,r,"latitudinal",s),this._halfBlur(o,t,i,i,r,"longitudinal",s)}_halfBlur(t,n,i,r,s,o,a){const l=this._renderer,c=this._blurMaterial;o!=="latitudinal"&&o!=="longitudinal"&&de("blur direction must be either latitudinal or longitudinal!");const u=3,h=this._lodMeshes[r];h.material=c;const f=c.uniforms,p=this._sizeLods[i]-1,g=isFinite(s)?Math.PI/(2*p):2*Math.PI/(2*kr-1),_=s/g,m=isFinite(s)?1+Math.floor(u*_):kr;m>kr&&Yt(`sigmaRadians, ${s}, is too large and will clip, as it requested ${m} samples when the maximum is set to ${kr}`);const d=[];let S=0;for(let R=0;Rx-gr?r-x+gr:0),P=4*(this._cubeSize-y);vs(n,T,P,3*y,2*y),l.setRenderTarget(n),l.render(h,co)}}function S1(e){const t=[],n=[],i=[];let r=e;const s=e-gr+1+hm.length;for(let o=0;oe-gr?l=hm[o-e+gr-1]:o===0&&(l=0),n.push(l);const c=1/(a-2),u=-c,h=1+c,f=[u,u,h,u,h,h,u,u,h,h,u,h],p=6,g=6,_=3,m=2,d=1,S=new Float32Array(_*g*p),x=new Float32Array(m*g*p),y=new Float32Array(d*g*p);for(let P=0;P2?0:-1,b=[R,C,0,R+2/3,C,0,R+2/3,C+1,0,R,C,0,R+2/3,C+1,0,R,C+1,0];S.set(b,_*g*P),x.set(f,m*g*P);const M=[P,P,P,P,P,P];y.set(M,d*g*P)}const T=new fe;T.setAttribute("position",new pn(S,_)),T.setAttribute("uv",new pn(x,m)),T.setAttribute("faceIndex",new pn(y,d)),i.push(new _t(T,null)),r>gr&&r--}return{lodMeshes:i,sizeLods:t,sigmas:n}}function pm(e,t,n){const i=new xi(e,t,n);return i.texture.mapping=Ul,i.texture.name="PMREM.cubeUv",i.scissorTest=!0,i}function vs(e,t,n,i,r){e.viewport.set(t,n,i,r),e.scissor.set(t,n,i,r)}function b1(e,t,n){return new ii({name:"PMREMGGXConvolution",defines:{GGX_SAMPLES:x1,CUBEUV_TEXEL_WIDTH:1/t,CUBEUV_TEXEL_HEIGHT:1/n,CUBEUV_MAX_MIP:`${e}.0`},uniforms:{envMap:{value:null},roughness:{value:0},mipInt:{value:0}},vertexShader:Fl(),fragmentShader:` precision highp float; precision highp int; @@ -3710,7 +3710,7 @@ void main() { gl_FragColor = vec4(prefilteredColor, 1.0); } - `,blending:Vi,depthTest:!1,depthWrite:!1})}function M1(e,t,n){const i=new Float32Array(kr),r=new D(0,1,0);return new ii({name:"SphericalGaussianBlur",defines:{n:kr,CUBEUV_TEXEL_WIDTH:1/t,CUBEUV_TEXEL_HEIGHT:1/n,CUBEUV_MAX_MIP:`${e}.0`},uniforms:{envMap:{value:null},samples:{value:1},weights:{value:i},latitudinal:{value:!1},dTheta:{value:0},mipInt:{value:0},poleAxis:{value:r}},vertexShader:Ol(),fragmentShader:` + `,blending:Vi,depthTest:!1,depthWrite:!1})}function M1(e,t,n){const i=new Float32Array(kr),r=new D(0,1,0);return new ii({name:"SphericalGaussianBlur",defines:{n:kr,CUBEUV_TEXEL_WIDTH:1/t,CUBEUV_TEXEL_HEIGHT:1/n,CUBEUV_MAX_MIP:`${e}.0`},uniforms:{envMap:{value:null},samples:{value:1},weights:{value:i},latitudinal:{value:!1},dTheta:{value:0},mipInt:{value:0},poleAxis:{value:r}},vertexShader:Fl(),fragmentShader:` precision mediump float; precision mediump int; @@ -3770,7 +3770,7 @@ void main() { } } - `,blending:Vi,depthTest:!1,depthWrite:!1})}function mm(){return new ii({name:"EquirectangularToCubeUV",uniforms:{envMap:{value:null}},vertexShader:Ol(),fragmentShader:` + `,blending:Vi,depthTest:!1,depthWrite:!1})}function mm(){return new ii({name:"EquirectangularToCubeUV",uniforms:{envMap:{value:null}},vertexShader:Fl(),fragmentShader:` precision mediump float; precision mediump int; @@ -3789,7 +3789,7 @@ void main() { gl_FragColor = vec4( texture2D ( envMap, uv ).rgb, 1.0 ); } - `,blending:Vi,depthTest:!1,depthWrite:!1})}function gm(){return new ii({name:"CubemapToCubeUV",uniforms:{envMap:{value:null},flipEnvMap:{value:-1}},vertexShader:Ol(),fragmentShader:` + `,blending:Vi,depthTest:!1,depthWrite:!1})}function gm(){return new ii({name:"CubemapToCubeUV",uniforms:{envMap:{value:null},flipEnvMap:{value:-1}},vertexShader:Fl(),fragmentShader:` precision mediump float; precision mediump int; @@ -3805,7 +3805,7 @@ void main() { gl_FragColor = textureCube( envMap, vec3( flipEnvMap * vOutputDirection.x, vOutputDirection.yz ) ); } - `,blending:Vi,depthTest:!1,depthWrite:!1})}function Ol(){return` + `,blending:Vi,depthTest:!1,depthWrite:!1})}function Fl(){return` precision mediump float; precision mediump int; @@ -3860,7 +3860,7 @@ void main() { gl_Position = vec4( position, 1.0 ); } - `}function w1(e){let t=new WeakMap,n=null;function i(a){if(a&&a.isTexture){const l=a.mapping,c=l===_u||l===vu,u=l===$r||l===ks;if(c||u){let h=t.get(a);const f=h!==void 0?h.texture.pmremVersion:0;if(a.isRenderTargetTexture&&a.pmremVersion!==f)return n===null&&(n=new dm(e)),h=c?n.fromEquirectangular(a,h):n.fromCubemap(a,h),h.texture.pmremVersion=a.pmremVersion,t.set(a,h),h.texture;if(h!==void 0)return h.texture;{const p=a.image;return c&&p&&p.height>0||u&&p&&r(p)?(n===null&&(n=new dm(e)),h=c?n.fromEquirectangular(a):n.fromCubemap(a),h.texture.pmremVersion=a.pmremVersion,t.set(a,h),a.addEventListener("dispose",s),h.texture):null}}}return a}function r(a){let l=0;const c=6;for(let u=0;ut.maxTextureSize&&(P=Math.ceil(A/t.maxTextureSize),A=t.maxTextureSize);const C=new Float32Array(A*P*4*h),R=new Z0(C,A,P,h);R.type=mi,R.needsUpdate=!0;const b=x*4;for(let L=0;L0||u&&p&&r(p)?(n===null&&(n=new dm(e)),h=c?n.fromEquirectangular(a):n.fromCubemap(a),h.texture.pmremVersion=a.pmremVersion,t.set(a,h),a.addEventListener("dispose",s),h.texture):null}}}return a}function r(a){let l=0;const c=6;for(let u=0;ut.maxTextureSize&&(P=Math.ceil(T/t.maxTextureSize),T=t.maxTextureSize);const R=new Float32Array(T*P*4*h),C=new Z0(R,T,P,h);C.type=mi,C.needsUpdate=!0;const b=y*4;for(let L=0;L0&&m[0].isRenderPass===!0;const y=s.width,x=s.height;for(let A=0;A0)return e;const r=t*n;let s=_m[r];if(s===void 0&&(s=new Float32Array(r),_m[r]=s),t!==0){i.toArray(s,0);for(let o=1,a=0;o!==t;++o)a+=n,e[o].toArray(s,a)}return s}function Ke(e,t){if(e.length!==t.length)return!1;for(let n=0,i=e.length;n0&&(this.seq=r.concat(s))}setValue(t,n,i,r){const s=this.map[n];s!==void 0&&s.setValue(t,i,r)}setOptional(t,n,i){const r=n[i];r!==void 0&&this.setValue(t,i,r)}static upload(t,n,i,r){for(let s=0,o=n.length;s!==o;++s){const a=n[s],l=i[a.id];l.needsUpdate!==!1&&a.setValue(t,l.value,r)}}static seqWithValue(t,n){const i=[];for(let r=0,s=t.length;r!==s;++r){const o=t[r];o.id in n&&i.push(o)}return i}}function Mm(e,t,n){const i=e.createShader(t);return e.shaderSource(i,n),e.compileShader(i),i}const MA=37297;let wA=0;function EA(e,t){const n=e.split(` + }`,depthTest:!1,depthWrite:!1}),c=new _t(a,l),u=new Cf(-1,1,1,-1,0,1);let h=null,f=null,p=!1,g,_=null,m=[],d=!1;this.setSize=function(S,x){s.setSize(S,x),o.setSize(S,x);for(let y=0;y0&&m[0].isRenderPass===!0;const x=s.width,y=s.height;for(let T=0;T0)return e;const r=t*n;let s=_m[r];if(s===void 0&&(s=new Float32Array(r),_m[r]=s),t!==0){i.toArray(s,0);for(let o=1,a=0;o!==t;++o)a+=n,e[o].toArray(s,a)}return s}function Ke(e,t){if(e.length!==t.length)return!1;for(let n=0,i=e.length;n0&&(this.seq=r.concat(s))}setValue(t,n,i,r){const s=this.map[n];s!==void 0&&s.setValue(t,i,r)}setOptional(t,n,i){const r=n[i];r!==void 0&&this.setValue(t,i,r)}static upload(t,n,i,r){for(let s=0,o=n.length;s!==o;++s){const a=n[s],l=i[a.id];l.needsUpdate!==!1&&a.setValue(t,l.value,r)}}static seqWithValue(t,n){const i=[];for(let r=0,s=t.length;r!==s;++r){const o=t[r];o.id in n&&i.push(o)}return i}}function Mm(e,t,n){const i=e.createShader(t);return e.shaderSource(i,n),e.compileShader(i),i}const MA=37297;let wA=0;function EA(e,t){const n=e.split(` `),i=[],r=Math.max(t-6,0),s=Math.min(t+6,n.length);for(let o=r;o":" "} ${a}: ${n[o]}`)}return i.join(` `)}const wm=new ie;function TA(e){me._getMatrix(wm,me.workingColorSpace,e);const t=`mat3( ${wm.elements.map(n=>n.toFixed(4))} )`;switch(me.getTransfer(e)){case dl:return[t,"LinearTransferOETF"];case be:return[t,"sRGBTransferOETF"];default:return Yt("WebGLProgram: Unsupported color space: ",e),[t,"LinearTransferOETF"]}}function Em(e,t,n){const i=e.getShaderParameter(t,e.COMPILE_STATUS),s=(e.getShaderInfoLog(t)||"").trim();if(i&&s==="")return"";const o=/ERROR: 0:(\d+)/.exec(s);if(o){const a=parseInt(o[1]);return n.toUpperCase()+` @@ -3936,7 +3936,7 @@ void main() { `;return e.precision==="highp"?t+=` #define HIGH_PRECISION`:e.precision==="mediump"?t+=` #define MEDIUM_PRECISION`:e.precision==="lowp"&&(t+=` -#define LOW_PRECISION`),t}const BA={[Za]:"SHADOWMAP_TYPE_PCF",[_o]:"SHADOWMAP_TYPE_VSM"};function zA(e){return BA[e.shadowMapType]||"SHADOWMAP_TYPE_BASIC"}const VA={[$r]:"ENVMAP_TYPE_CUBE",[ks]:"ENVMAP_TYPE_CUBE",[Nl]:"ENVMAP_TYPE_CUBE_UV"};function HA(e){return e.envMap===!1?"ENVMAP_TYPE_CUBE":VA[e.envMapMode]||"ENVMAP_TYPE_CUBE"}const GA={[ks]:"ENVMAP_MODE_REFRACTION"};function WA(e){return e.envMap===!1?"ENVMAP_MODE_REFLECTION":GA[e.envMapMode]||"ENVMAP_MODE_REFLECTION"}const XA={[L0]:"ENVMAP_BLENDING_MULTIPLY",[Cb]:"ENVMAP_BLENDING_MIX",[Rb]:"ENVMAP_BLENDING_ADD"};function qA(e){return e.envMap===!1?"ENVMAP_BLENDING_NONE":XA[e.combine]||"ENVMAP_BLENDING_NONE"}function YA(e){const t=e.envMapCubeUVHeight;if(t===null)return null;const n=Math.log2(t)-2,i=1/t;return{texelWidth:1/(3*Math.max(Math.pow(2,n),112)),texelHeight:i,maxMip:n}}function JA(e,t,n,i){const r=e.getContext(),s=n.defines;let o=n.vertexShader,a=n.fragmentShader;const l=zA(n),c=HA(n),u=WA(n),h=qA(n),f=YA(n),p=DA(n),g=IA(s),v=r.createProgram();let m,d,S=n.glslVersion?"#version "+n.glslVersion+` +#define LOW_PRECISION`),t}const BA={[Za]:"SHADOWMAP_TYPE_PCF",[_o]:"SHADOWMAP_TYPE_VSM"};function zA(e){return BA[e.shadowMapType]||"SHADOWMAP_TYPE_BASIC"}const VA={[$r]:"ENVMAP_TYPE_CUBE",[ks]:"ENVMAP_TYPE_CUBE",[Ul]:"ENVMAP_TYPE_CUBE_UV"};function HA(e){return e.envMap===!1?"ENVMAP_TYPE_CUBE":VA[e.envMapMode]||"ENVMAP_TYPE_CUBE"}const GA={[ks]:"ENVMAP_MODE_REFRACTION"};function WA(e){return e.envMap===!1?"ENVMAP_MODE_REFLECTION":GA[e.envMapMode]||"ENVMAP_MODE_REFLECTION"}const XA={[L0]:"ENVMAP_BLENDING_MULTIPLY",[Cb]:"ENVMAP_BLENDING_MIX",[Rb]:"ENVMAP_BLENDING_ADD"};function qA(e){return e.envMap===!1?"ENVMAP_BLENDING_NONE":XA[e.combine]||"ENVMAP_BLENDING_NONE"}function YA(e){const t=e.envMapCubeUVHeight;if(t===null)return null;const n=Math.log2(t)-2,i=1/t;return{texelWidth:1/(3*Math.max(Math.pow(2,n),112)),texelHeight:i,maxMip:n}}function JA(e,t,n,i){const r=e.getContext(),s=n.defines;let o=n.vertexShader,a=n.fragmentShader;const l=zA(n),c=HA(n),u=WA(n),h=qA(n),f=YA(n),p=DA(n),g=IA(s),_=r.createProgram();let m,d,S=n.glslVersion?"#version "+n.glslVersion+` `:"";n.isRawShaderMaterial?(m=["#define SHADER_TYPE "+n.shaderType,"#define SHADER_NAME "+n.shaderName,g].filter(xo).join(` `),m.length>0&&(m+=` `),d=["#define SHADER_TYPE "+n.shaderType,"#define SHADER_NAME "+n.shaderName,g].filter(xo).join(` @@ -3950,14 +3950,14 @@ void main() { `)+` `+m,d=["#define varying in",n.glslVersion===wp?"":"layout(location = 0) out highp vec4 pc_fragColor;",n.glslVersion===wp?"":"#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(` `)+` -`+d);const y=S+m+o,x=S+d+a,A=Mm(r,r.VERTEX_SHADER,y),P=Mm(r,r.FRAGMENT_SHADER,x);r.attachShader(v,A),r.attachShader(v,P),n.index0AttributeName!==void 0?r.bindAttribLocation(v,0,n.index0AttributeName):n.morphTargets===!0&&r.bindAttribLocation(v,0,"position"),r.linkProgram(v);function C(L){if(e.debug.checkShaderErrors){const V=r.getProgramInfoLog(v)||"",q=r.getShaderInfoLog(A)||"",j=r.getShaderInfoLog(P)||"",J=V.trim(),W=q.trim(),k=j.trim();let H=!0,ct=!0;if(r.getProgramParameter(v,r.LINK_STATUS)===!1)if(H=!1,typeof e.debug.onShaderError=="function")e.debug.onShaderError(r,v,A,P);else{const pt=Em(r,A,"vertex"),ft=Em(r,P,"fragment");de("THREE.WebGLProgram: Shader Error "+r.getError()+" - VALIDATE_STATUS "+r.getProgramParameter(v,r.VALIDATE_STATUS)+` +`+d);const x=S+m+o,y=S+d+a,T=Mm(r,r.VERTEX_SHADER,x),P=Mm(r,r.FRAGMENT_SHADER,y);r.attachShader(_,T),r.attachShader(_,P),n.index0AttributeName!==void 0?r.bindAttribLocation(_,0,n.index0AttributeName):n.morphTargets===!0&&r.bindAttribLocation(_,0,"position"),r.linkProgram(_);function R(L){if(e.debug.checkShaderErrors){const V=r.getProgramInfoLog(_)||"",q=r.getShaderInfoLog(T)||"",j=r.getShaderInfoLog(P)||"",J=V.trim(),W=q.trim(),k=j.trim();let H=!0,ct=!0;if(r.getProgramParameter(_,r.LINK_STATUS)===!1)if(H=!1,typeof e.debug.onShaderError=="function")e.debug.onShaderError(r,_,T,P);else{const pt=Em(r,T,"vertex"),ft=Em(r,P,"fragment");de("THREE.WebGLProgram: Shader Error "+r.getError()+" - VALIDATE_STATUS "+r.getProgramParameter(_,r.VALIDATE_STATUS)+` Material Name: `+L.name+` Material Type: `+L.type+` Program Info Log: `+J+` `+pt+` -`+ft)}else J!==""?Yt("WebGLProgram: Program Info Log:",J):(W===""||k==="")&&(ct=!1);ct&&(L.diagnostics={runnable:H,programLog:J,vertexShader:{log:W,prefix:m},fragmentShader:{log:k,prefix:d}})}r.deleteShader(A),r.deleteShader(P),R=new nl(r,v),b=LA(r,v)}let R;this.getUniforms=function(){return R===void 0&&C(this),R};let b;this.getAttributes=function(){return b===void 0&&C(this),b};let M=n.rendererExtensionParallelShaderCompile===!1;return this.isReady=function(){return M===!1&&(M=r.getProgramParameter(v,MA)),M},this.destroy=function(){i.releaseStatesOfProgram(this),r.deleteProgram(v),this.program=void 0},this.type=n.shaderType,this.name=n.shaderName,this.id=wA++,this.cacheKey=t,this.usedTimes=1,this.program=v,this.vertexShader=A,this.fragmentShader=P,this}let $A=0;class ZA{constructor(){this.shaderCache=new Map,this.materialCache=new Map}update(t){const n=t.vertexShader,i=t.fragmentShader,r=this._getShaderStage(n),s=this._getShaderStage(i),o=this._getShaderCacheForMaterial(t);return o.has(r)===!1&&(o.add(r),r.usedTimes++),o.has(s)===!1&&(o.add(s),s.usedTimes++),this}remove(t){const n=this.materialCache.get(t);for(const i of n)i.usedTimes--,i.usedTimes===0&&this.shaderCache.delete(i.code);return this.materialCache.delete(t),this}getVertexShaderID(t){return this._getShaderStage(t.vertexShader).id}getFragmentShaderID(t){return this._getShaderStage(t.fragmentShader).id}dispose(){this.shaderCache.clear(),this.materialCache.clear()}_getShaderCacheForMaterial(t){const n=this.materialCache;let i=n.get(t);return i===void 0&&(i=new Set,n.set(t,i)),i}_getShaderStage(t){const n=this.shaderCache;let i=n.get(t);return i===void 0&&(i=new KA(t),n.set(t,i)),i}}class KA{constructor(t){this.id=$A++,this.code=t,this.usedTimes=0}}function QA(e,t,n,i,r,s,o){const a=new _f,l=new ZA,c=new Set,u=[],h=new Map,f=r.logarithmicDepthBuffer;let p=r.precision;const g={MeshDepthMaterial:"depth",MeshDistanceMaterial:"distance",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 v(b){return c.add(b),b===0?"uv":`uv${b}`}function m(b,M,L,V,q){const j=V.fog,J=q.geometry,W=b.isMeshStandardMaterial?V.environment:null,k=(b.isMeshStandardMaterial?n:t).get(b.envMap||W),H=k&&k.mapping===Nl?k.image.height:null,ct=g[b.type];b.precision!==null&&(p=r.getMaxPrecision(b.precision),p!==b.precision&&Yt("WebGLProgram.getParameters:",b.precision,"not supported, using",p,"instead."));const pt=J.morphAttributes.position||J.morphAttributes.normal||J.morphAttributes.color,ft=pt!==void 0?pt.length:0;let kt=0;J.morphAttributes.position!==void 0&&(kt=1),J.morphAttributes.normal!==void 0&&(kt=2),J.morphAttributes.color!==void 0&&(kt=3);let Lt,Zt,ue,st;if(ct){const ye=di[ct];Lt=ye.vertexShader,Zt=ye.fragmentShader}else Lt=b.vertexShader,Zt=b.fragmentShader,l.update(b),ue=l.getVertexShaderID(b),st=l.getFragmentShaderID(b);const ot=e.getRenderTarget(),Pt=e.state.buffers.depth.getReversed(),Vt=q.isInstancedMesh===!0,Mt=q.isBatchedMesh===!0,oe=!!b.map,I=!!b.matcap,O=!!k,U=!!b.aoMap,z=!!b.lightMap,F=!!b.bumpMap,X=!!b.normalMap,E=!!b.displacementMap,rt=!!b.emissiveMap,K=!!b.metalnessMap,Q=!!b.roughnessMap,it=b.anisotropy>0,w=b.clearcoat>0,_=b.dispersion>0,N=b.iridescence>0,Y=b.sheen>0,nt=b.transmission>0,$=it&&!!b.anisotropyMap,wt=w&&!!b.clearcoatMap,ht=w&&!!b.clearcoatNormalMap,Ct=w&&!!b.clearcoatRoughnessMap,zt=N&&!!b.iridescenceMap,ut=N&&!!b.iridescenceThicknessMap,St=Y&&!!b.sheenColorMap,Et=Y&&!!b.sheenRoughnessMap,It=!!b.specularMap,yt=!!b.specularColorMap,ee=!!b.specularIntensityMap,B=nt&&!!b.transmissionMap,Dt=nt&&!!b.thicknessMap,gt=!!b.gradientMap,Nt=!!b.alphaMap,dt=b.alphaTest>0,lt=!!b.alphaHash,bt=!!b.extensions;let Qt=vi;b.toneMapped&&(ot===null||ot.isXRRenderTarget===!0)&&(Qt=e.toneMapping);const Ce={shaderID:ct,shaderType:b.type,shaderName:b.name,vertexShader:Lt,fragmentShader:Zt,defines:b.defines,customVertexShaderID:ue,customFragmentShaderID:st,isRawShaderMaterial:b.isRawShaderMaterial===!0,glslVersion:b.glslVersion,precision:p,batching:Mt,batchingColor:Mt&&q._colorsTexture!==null,instancing:Vt,instancingColor:Vt&&q.instanceColor!==null,instancingMorph:Vt&&q.morphTexture!==null,outputColorSpace:ot===null?e.outputColorSpace:ot.isXRRenderTarget===!0?ot.texture.colorSpace:zs,alphaToCoverage:!!b.alphaToCoverage,map:oe,matcap:I,envMap:O,envMapMode:O&&k.mapping,envMapCubeUVHeight:H,aoMap:U,lightMap:z,bumpMap:F,normalMap:X,displacementMap:E,emissiveMap:rt,normalMapObjectSpace:X&&b.normalMapType===Lb,normalMapTangentSpace:X&&b.normalMapType===J0,metalnessMap:K,roughnessMap:Q,anisotropy:it,anisotropyMap:$,clearcoat:w,clearcoatMap:wt,clearcoatNormalMap:ht,clearcoatRoughnessMap:Ct,dispersion:_,iridescence:N,iridescenceMap:zt,iridescenceThicknessMap:ut,sheen:Y,sheenColorMap:St,sheenRoughnessMap:Et,specularMap:It,specularColorMap:yt,specularIntensityMap:ee,transmission:nt,transmissionMap:B,thicknessMap:Dt,gradientMap:gt,opaque:b.transparent===!1&&b.blending===Is&&b.alphaToCoverage===!1,alphaMap:Nt,alphaTest:dt,alphaHash:lt,combine:b.combine,mapUv:oe&&v(b.map.channel),aoMapUv:U&&v(b.aoMap.channel),lightMapUv:z&&v(b.lightMap.channel),bumpMapUv:F&&v(b.bumpMap.channel),normalMapUv:X&&v(b.normalMap.channel),displacementMapUv:E&&v(b.displacementMap.channel),emissiveMapUv:rt&&v(b.emissiveMap.channel),metalnessMapUv:K&&v(b.metalnessMap.channel),roughnessMapUv:Q&&v(b.roughnessMap.channel),anisotropyMapUv:$&&v(b.anisotropyMap.channel),clearcoatMapUv:wt&&v(b.clearcoatMap.channel),clearcoatNormalMapUv:ht&&v(b.clearcoatNormalMap.channel),clearcoatRoughnessMapUv:Ct&&v(b.clearcoatRoughnessMap.channel),iridescenceMapUv:zt&&v(b.iridescenceMap.channel),iridescenceThicknessMapUv:ut&&v(b.iridescenceThicknessMap.channel),sheenColorMapUv:St&&v(b.sheenColorMap.channel),sheenRoughnessMapUv:Et&&v(b.sheenRoughnessMap.channel),specularMapUv:It&&v(b.specularMap.channel),specularColorMapUv:yt&&v(b.specularColorMap.channel),specularIntensityMapUv:ee&&v(b.specularIntensityMap.channel),transmissionMapUv:B&&v(b.transmissionMap.channel),thicknessMapUv:Dt&&v(b.thicknessMap.channel),alphaMapUv:Nt&&v(b.alphaMap.channel),vertexTangents:!!J.attributes.tangent&&(X||it),vertexColors:b.vertexColors,vertexAlphas:b.vertexColors===!0&&!!J.attributes.color&&J.attributes.color.itemSize===4,pointsUvs:q.isPoints===!0&&!!J.attributes.uv&&(oe||Nt),fog:!!j,useFog:b.fog===!0,fogExp2:!!j&&j.isFogExp2,flatShading:b.flatShading===!0&&b.wireframe===!1,sizeAttenuation:b.sizeAttenuation===!0,logarithmicDepthBuffer:f,reversedDepthBuffer:Pt,skinning:q.isSkinnedMesh===!0,morphTargets:J.morphAttributes.position!==void 0,morphNormals:J.morphAttributes.normal!==void 0,morphColors:J.morphAttributes.color!==void 0,morphTargetsCount:ft,morphTextureStride:kt,numDirLights:M.directional.length,numPointLights:M.point.length,numSpotLights:M.spot.length,numSpotLightMaps:M.spotLightMap.length,numRectAreaLights:M.rectArea.length,numHemiLights:M.hemi.length,numDirLightShadows:M.directionalShadowMap.length,numPointLightShadows:M.pointShadowMap.length,numSpotLightShadows:M.spotShadowMap.length,numSpotLightShadowsWithMaps:M.numSpotLightShadowsWithMaps,numLightProbes:M.numLightProbes,numClippingPlanes:o.numPlanes,numClipIntersection:o.numIntersection,dithering:b.dithering,shadowMapEnabled:e.shadowMap.enabled&&L.length>0,shadowMapType:e.shadowMap.type,toneMapping:Qt,decodeVideoTexture:oe&&b.map.isVideoTexture===!0&&me.getTransfer(b.map.colorSpace)===be,decodeVideoTextureEmissive:rt&&b.emissiveMap.isVideoTexture===!0&&me.getTransfer(b.emissiveMap.colorSpace)===be,premultipliedAlpha:b.premultipliedAlpha,doubleSided:b.side===xn,flipSided:b.side===dn,useDepthPacking:b.depthPacking>=0,depthPacking:b.depthPacking||0,index0AttributeName:b.index0AttributeName,extensionClipCullDistance:bt&&b.extensions.clipCullDistance===!0&&i.has("WEBGL_clip_cull_distance"),extensionMultiDraw:(bt&&b.extensions.multiDraw===!0||Mt)&&i.has("WEBGL_multi_draw"),rendererExtensionParallelShaderCompile:i.has("KHR_parallel_shader_compile"),customProgramCacheKey:b.customProgramCacheKey()};return Ce.vertexUv1s=c.has(1),Ce.vertexUv2s=c.has(2),Ce.vertexUv3s=c.has(3),c.clear(),Ce}function d(b){const M=[];if(b.shaderID?M.push(b.shaderID):(M.push(b.customVertexShaderID),M.push(b.customFragmentShaderID)),b.defines!==void 0)for(const L in b.defines)M.push(L),M.push(b.defines[L]);return b.isRawShaderMaterial===!1&&(S(M,b),y(M,b),M.push(e.outputColorSpace)),M.push(b.customProgramCacheKey),M.join()}function S(b,M){b.push(M.precision),b.push(M.outputColorSpace),b.push(M.envMapMode),b.push(M.envMapCubeUVHeight),b.push(M.mapUv),b.push(M.alphaMapUv),b.push(M.lightMapUv),b.push(M.aoMapUv),b.push(M.bumpMapUv),b.push(M.normalMapUv),b.push(M.displacementMapUv),b.push(M.emissiveMapUv),b.push(M.metalnessMapUv),b.push(M.roughnessMapUv),b.push(M.anisotropyMapUv),b.push(M.clearcoatMapUv),b.push(M.clearcoatNormalMapUv),b.push(M.clearcoatRoughnessMapUv),b.push(M.iridescenceMapUv),b.push(M.iridescenceThicknessMapUv),b.push(M.sheenColorMapUv),b.push(M.sheenRoughnessMapUv),b.push(M.specularMapUv),b.push(M.specularColorMapUv),b.push(M.specularIntensityMapUv),b.push(M.transmissionMapUv),b.push(M.thicknessMapUv),b.push(M.combine),b.push(M.fogExp2),b.push(M.sizeAttenuation),b.push(M.morphTargetsCount),b.push(M.morphAttributeCount),b.push(M.numDirLights),b.push(M.numPointLights),b.push(M.numSpotLights),b.push(M.numSpotLightMaps),b.push(M.numHemiLights),b.push(M.numRectAreaLights),b.push(M.numDirLightShadows),b.push(M.numPointLightShadows),b.push(M.numSpotLightShadows),b.push(M.numSpotLightShadowsWithMaps),b.push(M.numLightProbes),b.push(M.shadowMapType),b.push(M.toneMapping),b.push(M.numClippingPlanes),b.push(M.numClipIntersection),b.push(M.depthPacking)}function y(b,M){a.disableAll(),M.instancing&&a.enable(0),M.instancingColor&&a.enable(1),M.instancingMorph&&a.enable(2),M.matcap&&a.enable(3),M.envMap&&a.enable(4),M.normalMapObjectSpace&&a.enable(5),M.normalMapTangentSpace&&a.enable(6),M.clearcoat&&a.enable(7),M.iridescence&&a.enable(8),M.alphaTest&&a.enable(9),M.vertexColors&&a.enable(10),M.vertexAlphas&&a.enable(11),M.vertexUv1s&&a.enable(12),M.vertexUv2s&&a.enable(13),M.vertexUv3s&&a.enable(14),M.vertexTangents&&a.enable(15),M.anisotropy&&a.enable(16),M.alphaHash&&a.enable(17),M.batching&&a.enable(18),M.dispersion&&a.enable(19),M.batchingColor&&a.enable(20),M.gradientMap&&a.enable(21),b.push(a.mask),a.disableAll(),M.fog&&a.enable(0),M.useFog&&a.enable(1),M.flatShading&&a.enable(2),M.logarithmicDepthBuffer&&a.enable(3),M.reversedDepthBuffer&&a.enable(4),M.skinning&&a.enable(5),M.morphTargets&&a.enable(6),M.morphNormals&&a.enable(7),M.morphColors&&a.enable(8),M.premultipliedAlpha&&a.enable(9),M.shadowMapEnabled&&a.enable(10),M.doubleSided&&a.enable(11),M.flipSided&&a.enable(12),M.useDepthPacking&&a.enable(13),M.dithering&&a.enable(14),M.transmission&&a.enable(15),M.sheen&&a.enable(16),M.opaque&&a.enable(17),M.pointsUvs&&a.enable(18),M.decodeVideoTexture&&a.enable(19),M.decodeVideoTextureEmissive&&a.enable(20),M.alphaToCoverage&&a.enable(21),b.push(a.mask)}function x(b){const M=g[b.type];let L;if(M){const V=di[M];L=e_.clone(V.uniforms)}else L=b.uniforms;return L}function A(b,M){let L=h.get(M);return L!==void 0?++L.usedTimes:(L=new JA(e,M,b,s),u.push(L),h.set(M,L)),L}function P(b){if(--b.usedTimes===0){const M=u.indexOf(b);u[M]=u[u.length-1],u.pop(),h.delete(b.cacheKey),b.destroy()}}function C(b){l.remove(b)}function R(){l.dispose()}return{getParameters:m,getProgramCacheKey:d,getUniforms:x,acquireProgram:A,releaseProgram:P,releaseShaderCache:C,programs:u,dispose:R}}function jA(){let e=new WeakMap;function t(o){return e.has(o)}function n(o){let a=e.get(o);return a===void 0&&(a={},e.set(o,a)),a}function i(o){e.delete(o)}function r(o,a,l){e.get(o)[a]=l}function s(){e=new WeakMap}return{has:t,get:n,remove:i,update:r,dispose:s}}function tP(e,t){return e.groupOrder!==t.groupOrder?e.groupOrder-t.groupOrder:e.renderOrder!==t.renderOrder?e.renderOrder-t.renderOrder:e.material.id!==t.material.id?e.material.id-t.material.id:e.z!==t.z?e.z-t.z:e.id-t.id}function Rm(e,t){return e.groupOrder!==t.groupOrder?e.groupOrder-t.groupOrder:e.renderOrder!==t.renderOrder?e.renderOrder-t.renderOrder:e.z!==t.z?t.z-e.z:e.id-t.id}function Dm(){const e=[];let t=0;const n=[],i=[],r=[];function s(){t=0,n.length=0,i.length=0,r.length=0}function o(h,f,p,g,v,m){let d=e[t];return d===void 0?(d={id:h.id,object:h,geometry:f,material:p,groupOrder:g,renderOrder:h.renderOrder,z:v,group:m},e[t]=d):(d.id=h.id,d.object=h,d.geometry=f,d.material=p,d.groupOrder=g,d.renderOrder=h.renderOrder,d.z=v,d.group=m),t++,d}function a(h,f,p,g,v,m){const d=o(h,f,p,g,v,m);p.transmission>0?i.push(d):p.transparent===!0?r.push(d):n.push(d)}function l(h,f,p,g,v,m){const d=o(h,f,p,g,v,m);p.transmission>0?i.unshift(d):p.transparent===!0?r.unshift(d):n.unshift(d)}function c(h,f){n.length>1&&n.sort(h||tP),i.length>1&&i.sort(f||Rm),r.length>1&&r.sort(f||Rm)}function u(){for(let h=t,f=e.length;h=s.length?(o=new Dm,s.push(o)):o=s[r],o}function n(){e=new WeakMap}return{get:t,dispose:n}}function nP(){const e={};return{get:function(t){if(e[t.id]!==void 0)return e[t.id];let n;switch(t.type){case"DirectionalLight":n={direction:new D,color:new $t};break;case"SpotLight":n={position:new D,direction:new D,color:new $t,distance:0,coneCos:0,penumbraCos:0,decay:0};break;case"PointLight":n={position:new D,color:new $t,distance:0,decay:0};break;case"HemisphereLight":n={direction:new D,skyColor:new $t,groundColor:new $t};break;case"RectAreaLight":n={color:new $t,position:new D,halfWidth:new D,halfHeight:new D};break}return e[t.id]=n,n}}}function iP(){const e={};return{get:function(t){if(e[t.id]!==void 0)return e[t.id];let n;switch(t.type){case"DirectionalLight":n={shadowIntensity:1,shadowBias:0,shadowNormalBias:0,shadowRadius:1,shadowMapSize:new mt};break;case"SpotLight":n={shadowIntensity:1,shadowBias:0,shadowNormalBias:0,shadowRadius:1,shadowMapSize:new mt};break;case"PointLight":n={shadowIntensity:1,shadowBias:0,shadowNormalBias:0,shadowRadius:1,shadowMapSize:new mt,shadowCameraNear:1,shadowCameraFar:1e3};break}return e[t.id]=n,n}}}let rP=0;function sP(e,t){return(t.castShadow?2:0)-(e.castShadow?2:0)+(t.map?1:0)-(e.map?1:0)}function oP(e){const t=new nP,n=iP(),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 D);const r=new D,s=new he,o=new he;function a(c){let u=0,h=0,f=0;for(let b=0;b<9;b++)i.probe[b].set(0,0,0);let p=0,g=0,v=0,m=0,d=0,S=0,y=0,x=0,A=0,P=0,C=0;c.sort(sP);for(let b=0,M=c.length;b0&&(e.has("OES_texture_float_linear")===!0?(i.rectAreaLTC1=At.LTC_FLOAT_1,i.rectAreaLTC2=At.LTC_FLOAT_2):(i.rectAreaLTC1=At.LTC_HALF_1,i.rectAreaLTC2=At.LTC_HALF_2)),i.ambient[0]=u,i.ambient[1]=h,i.ambient[2]=f;const R=i.hash;(R.directionalLength!==p||R.pointLength!==g||R.spotLength!==v||R.rectAreaLength!==m||R.hemiLength!==d||R.numDirectionalShadows!==S||R.numPointShadows!==y||R.numSpotShadows!==x||R.numSpotMaps!==A||R.numLightProbes!==C)&&(i.directional.length=p,i.spot.length=v,i.rectArea.length=m,i.point.length=g,i.hemi.length=d,i.directionalShadow.length=S,i.directionalShadowMap.length=S,i.pointShadow.length=y,i.pointShadowMap.length=y,i.spotShadow.length=x,i.spotShadowMap.length=x,i.directionalShadowMatrix.length=S,i.pointShadowMatrix.length=y,i.spotLightMatrix.length=x+A-P,i.spotLightMap.length=A,i.numSpotLightShadowsWithMaps=P,i.numLightProbes=C,R.directionalLength=p,R.pointLength=g,R.spotLength=v,R.rectAreaLength=m,R.hemiLength=d,R.numDirectionalShadows=S,R.numPointShadows=y,R.numSpotShadows=x,R.numSpotMaps=A,R.numLightProbes=C,i.version=rP++)}function l(c,u){let h=0,f=0,p=0,g=0,v=0;const m=u.matrixWorldInverse;for(let d=0,S=c.length;d=o.length?(a=new Im(e),o.push(a)):a=o[s],a}function i(){t=new WeakMap}return{get:n,dispose:i}}const lP=`void main() { +`+ft)}else J!==""?Yt("WebGLProgram: Program Info Log:",J):(W===""||k==="")&&(ct=!1);ct&&(L.diagnostics={runnable:H,programLog:J,vertexShader:{log:W,prefix:m},fragmentShader:{log:k,prefix:d}})}r.deleteShader(T),r.deleteShader(P),C=new nl(r,_),b=LA(r,_)}let C;this.getUniforms=function(){return C===void 0&&R(this),C};let b;this.getAttributes=function(){return b===void 0&&R(this),b};let M=n.rendererExtensionParallelShaderCompile===!1;return this.isReady=function(){return M===!1&&(M=r.getProgramParameter(_,MA)),M},this.destroy=function(){i.releaseStatesOfProgram(this),r.deleteProgram(_),this.program=void 0},this.type=n.shaderType,this.name=n.shaderName,this.id=wA++,this.cacheKey=t,this.usedTimes=1,this.program=_,this.vertexShader=T,this.fragmentShader=P,this}let $A=0;class ZA{constructor(){this.shaderCache=new Map,this.materialCache=new Map}update(t){const n=t.vertexShader,i=t.fragmentShader,r=this._getShaderStage(n),s=this._getShaderStage(i),o=this._getShaderCacheForMaterial(t);return o.has(r)===!1&&(o.add(r),r.usedTimes++),o.has(s)===!1&&(o.add(s),s.usedTimes++),this}remove(t){const n=this.materialCache.get(t);for(const i of n)i.usedTimes--,i.usedTimes===0&&this.shaderCache.delete(i.code);return this.materialCache.delete(t),this}getVertexShaderID(t){return this._getShaderStage(t.vertexShader).id}getFragmentShaderID(t){return this._getShaderStage(t.fragmentShader).id}dispose(){this.shaderCache.clear(),this.materialCache.clear()}_getShaderCacheForMaterial(t){const n=this.materialCache;let i=n.get(t);return i===void 0&&(i=new Set,n.set(t,i)),i}_getShaderStage(t){const n=this.shaderCache;let i=n.get(t);return i===void 0&&(i=new KA(t),n.set(t,i)),i}}class KA{constructor(t){this.id=$A++,this.code=t,this.usedTimes=0}}function QA(e,t,n,i,r,s,o){const a=new _f,l=new ZA,c=new Set,u=[],h=new Map,f=r.logarithmicDepthBuffer;let p=r.precision;const g={MeshDepthMaterial:"depth",MeshDistanceMaterial:"distance",MeshNormalMaterial:"normal",MeshBasicMaterial:"basic",MeshLambertMaterial:"lambert",MeshPhongMaterial:"phong",MeshToonMaterial:"toon",MeshStandardMaterial:"physical",MeshPhysicalMaterial:"physical",MeshMatcapMaterial:"matcap",LineBasicMaterial:"basic",LineDashedMaterial:"dashed",PointsMaterial:"points",ShadowMaterial:"shadow",SpriteMaterial:"sprite"};function _(b){return c.add(b),b===0?"uv":`uv${b}`}function m(b,M,L,V,q){const j=V.fog,J=q.geometry,W=b.isMeshStandardMaterial?V.environment:null,k=(b.isMeshStandardMaterial?n:t).get(b.envMap||W),H=k&&k.mapping===Ul?k.image.height:null,ct=g[b.type];b.precision!==null&&(p=r.getMaxPrecision(b.precision),p!==b.precision&&Yt("WebGLProgram.getParameters:",b.precision,"not supported, using",p,"instead."));const pt=J.morphAttributes.position||J.morphAttributes.normal||J.morphAttributes.color,ft=pt!==void 0?pt.length:0;let kt=0;J.morphAttributes.position!==void 0&&(kt=1),J.morphAttributes.normal!==void 0&&(kt=2),J.morphAttributes.color!==void 0&&(kt=3);let Lt,Zt,ue,st;if(ct){const ye=di[ct];Lt=ye.vertexShader,Zt=ye.fragmentShader}else Lt=b.vertexShader,Zt=b.fragmentShader,l.update(b),ue=l.getVertexShaderID(b),st=l.getFragmentShaderID(b);const ot=e.getRenderTarget(),Pt=e.state.buffers.depth.getReversed(),Vt=q.isInstancedMesh===!0,Mt=q.isBatchedMesh===!0,oe=!!b.map,I=!!b.matcap,O=!!k,U=!!b.aoMap,z=!!b.lightMap,F=!!b.bumpMap,X=!!b.normalMap,E=!!b.displacementMap,rt=!!b.emissiveMap,K=!!b.metalnessMap,Q=!!b.roughnessMap,it=b.anisotropy>0,w=b.clearcoat>0,v=b.dispersion>0,N=b.iridescence>0,Y=b.sheen>0,nt=b.transmission>0,$=it&&!!b.anisotropyMap,wt=w&&!!b.clearcoatMap,ht=w&&!!b.clearcoatNormalMap,Ct=w&&!!b.clearcoatRoughnessMap,zt=N&&!!b.iridescenceMap,ut=N&&!!b.iridescenceThicknessMap,St=Y&&!!b.sheenColorMap,Et=Y&&!!b.sheenRoughnessMap,It=!!b.specularMap,yt=!!b.specularColorMap,ee=!!b.specularIntensityMap,B=nt&&!!b.transmissionMap,Dt=nt&&!!b.thicknessMap,gt=!!b.gradientMap,Nt=!!b.alphaMap,dt=b.alphaTest>0,lt=!!b.alphaHash,bt=!!b.extensions;let Qt=vi;b.toneMapped&&(ot===null||ot.isXRRenderTarget===!0)&&(Qt=e.toneMapping);const Ce={shaderID:ct,shaderType:b.type,shaderName:b.name,vertexShader:Lt,fragmentShader:Zt,defines:b.defines,customVertexShaderID:ue,customFragmentShaderID:st,isRawShaderMaterial:b.isRawShaderMaterial===!0,glslVersion:b.glslVersion,precision:p,batching:Mt,batchingColor:Mt&&q._colorsTexture!==null,instancing:Vt,instancingColor:Vt&&q.instanceColor!==null,instancingMorph:Vt&&q.morphTexture!==null,outputColorSpace:ot===null?e.outputColorSpace:ot.isXRRenderTarget===!0?ot.texture.colorSpace:zs,alphaToCoverage:!!b.alphaToCoverage,map:oe,matcap:I,envMap:O,envMapMode:O&&k.mapping,envMapCubeUVHeight:H,aoMap:U,lightMap:z,bumpMap:F,normalMap:X,displacementMap:E,emissiveMap:rt,normalMapObjectSpace:X&&b.normalMapType===Lb,normalMapTangentSpace:X&&b.normalMapType===J0,metalnessMap:K,roughnessMap:Q,anisotropy:it,anisotropyMap:$,clearcoat:w,clearcoatMap:wt,clearcoatNormalMap:ht,clearcoatRoughnessMap:Ct,dispersion:v,iridescence:N,iridescenceMap:zt,iridescenceThicknessMap:ut,sheen:Y,sheenColorMap:St,sheenRoughnessMap:Et,specularMap:It,specularColorMap:yt,specularIntensityMap:ee,transmission:nt,transmissionMap:B,thicknessMap:Dt,gradientMap:gt,opaque:b.transparent===!1&&b.blending===Is&&b.alphaToCoverage===!1,alphaMap:Nt,alphaTest:dt,alphaHash:lt,combine:b.combine,mapUv:oe&&_(b.map.channel),aoMapUv:U&&_(b.aoMap.channel),lightMapUv:z&&_(b.lightMap.channel),bumpMapUv:F&&_(b.bumpMap.channel),normalMapUv:X&&_(b.normalMap.channel),displacementMapUv:E&&_(b.displacementMap.channel),emissiveMapUv:rt&&_(b.emissiveMap.channel),metalnessMapUv:K&&_(b.metalnessMap.channel),roughnessMapUv:Q&&_(b.roughnessMap.channel),anisotropyMapUv:$&&_(b.anisotropyMap.channel),clearcoatMapUv:wt&&_(b.clearcoatMap.channel),clearcoatNormalMapUv:ht&&_(b.clearcoatNormalMap.channel),clearcoatRoughnessMapUv:Ct&&_(b.clearcoatRoughnessMap.channel),iridescenceMapUv:zt&&_(b.iridescenceMap.channel),iridescenceThicknessMapUv:ut&&_(b.iridescenceThicknessMap.channel),sheenColorMapUv:St&&_(b.sheenColorMap.channel),sheenRoughnessMapUv:Et&&_(b.sheenRoughnessMap.channel),specularMapUv:It&&_(b.specularMap.channel),specularColorMapUv:yt&&_(b.specularColorMap.channel),specularIntensityMapUv:ee&&_(b.specularIntensityMap.channel),transmissionMapUv:B&&_(b.transmissionMap.channel),thicknessMapUv:Dt&&_(b.thicknessMap.channel),alphaMapUv:Nt&&_(b.alphaMap.channel),vertexTangents:!!J.attributes.tangent&&(X||it),vertexColors:b.vertexColors,vertexAlphas:b.vertexColors===!0&&!!J.attributes.color&&J.attributes.color.itemSize===4,pointsUvs:q.isPoints===!0&&!!J.attributes.uv&&(oe||Nt),fog:!!j,useFog:b.fog===!0,fogExp2:!!j&&j.isFogExp2,flatShading:b.flatShading===!0&&b.wireframe===!1,sizeAttenuation:b.sizeAttenuation===!0,logarithmicDepthBuffer:f,reversedDepthBuffer:Pt,skinning:q.isSkinnedMesh===!0,morphTargets:J.morphAttributes.position!==void 0,morphNormals:J.morphAttributes.normal!==void 0,morphColors:J.morphAttributes.color!==void 0,morphTargetsCount:ft,morphTextureStride:kt,numDirLights:M.directional.length,numPointLights:M.point.length,numSpotLights:M.spot.length,numSpotLightMaps:M.spotLightMap.length,numRectAreaLights:M.rectArea.length,numHemiLights:M.hemi.length,numDirLightShadows:M.directionalShadowMap.length,numPointLightShadows:M.pointShadowMap.length,numSpotLightShadows:M.spotShadowMap.length,numSpotLightShadowsWithMaps:M.numSpotLightShadowsWithMaps,numLightProbes:M.numLightProbes,numClippingPlanes:o.numPlanes,numClipIntersection:o.numIntersection,dithering:b.dithering,shadowMapEnabled:e.shadowMap.enabled&&L.length>0,shadowMapType:e.shadowMap.type,toneMapping:Qt,decodeVideoTexture:oe&&b.map.isVideoTexture===!0&&me.getTransfer(b.map.colorSpace)===be,decodeVideoTextureEmissive:rt&&b.emissiveMap.isVideoTexture===!0&&me.getTransfer(b.emissiveMap.colorSpace)===be,premultipliedAlpha:b.premultipliedAlpha,doubleSided:b.side===yn,flipSided:b.side===dn,useDepthPacking:b.depthPacking>=0,depthPacking:b.depthPacking||0,index0AttributeName:b.index0AttributeName,extensionClipCullDistance:bt&&b.extensions.clipCullDistance===!0&&i.has("WEBGL_clip_cull_distance"),extensionMultiDraw:(bt&&b.extensions.multiDraw===!0||Mt)&&i.has("WEBGL_multi_draw"),rendererExtensionParallelShaderCompile:i.has("KHR_parallel_shader_compile"),customProgramCacheKey:b.customProgramCacheKey()};return Ce.vertexUv1s=c.has(1),Ce.vertexUv2s=c.has(2),Ce.vertexUv3s=c.has(3),c.clear(),Ce}function d(b){const M=[];if(b.shaderID?M.push(b.shaderID):(M.push(b.customVertexShaderID),M.push(b.customFragmentShaderID)),b.defines!==void 0)for(const L in b.defines)M.push(L),M.push(b.defines[L]);return b.isRawShaderMaterial===!1&&(S(M,b),x(M,b),M.push(e.outputColorSpace)),M.push(b.customProgramCacheKey),M.join()}function S(b,M){b.push(M.precision),b.push(M.outputColorSpace),b.push(M.envMapMode),b.push(M.envMapCubeUVHeight),b.push(M.mapUv),b.push(M.alphaMapUv),b.push(M.lightMapUv),b.push(M.aoMapUv),b.push(M.bumpMapUv),b.push(M.normalMapUv),b.push(M.displacementMapUv),b.push(M.emissiveMapUv),b.push(M.metalnessMapUv),b.push(M.roughnessMapUv),b.push(M.anisotropyMapUv),b.push(M.clearcoatMapUv),b.push(M.clearcoatNormalMapUv),b.push(M.clearcoatRoughnessMapUv),b.push(M.iridescenceMapUv),b.push(M.iridescenceThicknessMapUv),b.push(M.sheenColorMapUv),b.push(M.sheenRoughnessMapUv),b.push(M.specularMapUv),b.push(M.specularColorMapUv),b.push(M.specularIntensityMapUv),b.push(M.transmissionMapUv),b.push(M.thicknessMapUv),b.push(M.combine),b.push(M.fogExp2),b.push(M.sizeAttenuation),b.push(M.morphTargetsCount),b.push(M.morphAttributeCount),b.push(M.numDirLights),b.push(M.numPointLights),b.push(M.numSpotLights),b.push(M.numSpotLightMaps),b.push(M.numHemiLights),b.push(M.numRectAreaLights),b.push(M.numDirLightShadows),b.push(M.numPointLightShadows),b.push(M.numSpotLightShadows),b.push(M.numSpotLightShadowsWithMaps),b.push(M.numLightProbes),b.push(M.shadowMapType),b.push(M.toneMapping),b.push(M.numClippingPlanes),b.push(M.numClipIntersection),b.push(M.depthPacking)}function x(b,M){a.disableAll(),M.instancing&&a.enable(0),M.instancingColor&&a.enable(1),M.instancingMorph&&a.enable(2),M.matcap&&a.enable(3),M.envMap&&a.enable(4),M.normalMapObjectSpace&&a.enable(5),M.normalMapTangentSpace&&a.enable(6),M.clearcoat&&a.enable(7),M.iridescence&&a.enable(8),M.alphaTest&&a.enable(9),M.vertexColors&&a.enable(10),M.vertexAlphas&&a.enable(11),M.vertexUv1s&&a.enable(12),M.vertexUv2s&&a.enable(13),M.vertexUv3s&&a.enable(14),M.vertexTangents&&a.enable(15),M.anisotropy&&a.enable(16),M.alphaHash&&a.enable(17),M.batching&&a.enable(18),M.dispersion&&a.enable(19),M.batchingColor&&a.enable(20),M.gradientMap&&a.enable(21),b.push(a.mask),a.disableAll(),M.fog&&a.enable(0),M.useFog&&a.enable(1),M.flatShading&&a.enable(2),M.logarithmicDepthBuffer&&a.enable(3),M.reversedDepthBuffer&&a.enable(4),M.skinning&&a.enable(5),M.morphTargets&&a.enable(6),M.morphNormals&&a.enable(7),M.morphColors&&a.enable(8),M.premultipliedAlpha&&a.enable(9),M.shadowMapEnabled&&a.enable(10),M.doubleSided&&a.enable(11),M.flipSided&&a.enable(12),M.useDepthPacking&&a.enable(13),M.dithering&&a.enable(14),M.transmission&&a.enable(15),M.sheen&&a.enable(16),M.opaque&&a.enable(17),M.pointsUvs&&a.enable(18),M.decodeVideoTexture&&a.enable(19),M.decodeVideoTextureEmissive&&a.enable(20),M.alphaToCoverage&&a.enable(21),b.push(a.mask)}function y(b){const M=g[b.type];let L;if(M){const V=di[M];L=e_.clone(V.uniforms)}else L=b.uniforms;return L}function T(b,M){let L=h.get(M);return L!==void 0?++L.usedTimes:(L=new JA(e,M,b,s),u.push(L),h.set(M,L)),L}function P(b){if(--b.usedTimes===0){const M=u.indexOf(b);u[M]=u[u.length-1],u.pop(),h.delete(b.cacheKey),b.destroy()}}function R(b){l.remove(b)}function C(){l.dispose()}return{getParameters:m,getProgramCacheKey:d,getUniforms:y,acquireProgram:T,releaseProgram:P,releaseShaderCache:R,programs:u,dispose:C}}function jA(){let e=new WeakMap;function t(o){return e.has(o)}function n(o){let a=e.get(o);return a===void 0&&(a={},e.set(o,a)),a}function i(o){e.delete(o)}function r(o,a,l){e.get(o)[a]=l}function s(){e=new WeakMap}return{has:t,get:n,remove:i,update:r,dispose:s}}function tP(e,t){return e.groupOrder!==t.groupOrder?e.groupOrder-t.groupOrder:e.renderOrder!==t.renderOrder?e.renderOrder-t.renderOrder:e.material.id!==t.material.id?e.material.id-t.material.id:e.z!==t.z?e.z-t.z:e.id-t.id}function Rm(e,t){return e.groupOrder!==t.groupOrder?e.groupOrder-t.groupOrder:e.renderOrder!==t.renderOrder?e.renderOrder-t.renderOrder:e.z!==t.z?t.z-e.z:e.id-t.id}function Dm(){const e=[];let t=0;const n=[],i=[],r=[];function s(){t=0,n.length=0,i.length=0,r.length=0}function o(h,f,p,g,_,m){let d=e[t];return d===void 0?(d={id:h.id,object:h,geometry:f,material:p,groupOrder:g,renderOrder:h.renderOrder,z:_,group:m},e[t]=d):(d.id=h.id,d.object=h,d.geometry=f,d.material=p,d.groupOrder=g,d.renderOrder=h.renderOrder,d.z=_,d.group=m),t++,d}function a(h,f,p,g,_,m){const d=o(h,f,p,g,_,m);p.transmission>0?i.push(d):p.transparent===!0?r.push(d):n.push(d)}function l(h,f,p,g,_,m){const d=o(h,f,p,g,_,m);p.transmission>0?i.unshift(d):p.transparent===!0?r.unshift(d):n.unshift(d)}function c(h,f){n.length>1&&n.sort(h||tP),i.length>1&&i.sort(f||Rm),r.length>1&&r.sort(f||Rm)}function u(){for(let h=t,f=e.length;h=s.length?(o=new Dm,s.push(o)):o=s[r],o}function n(){e=new WeakMap}return{get:t,dispose:n}}function nP(){const e={};return{get:function(t){if(e[t.id]!==void 0)return e[t.id];let n;switch(t.type){case"DirectionalLight":n={direction:new D,color:new $t};break;case"SpotLight":n={position:new D,direction:new D,color:new $t,distance:0,coneCos:0,penumbraCos:0,decay:0};break;case"PointLight":n={position:new D,color:new $t,distance:0,decay:0};break;case"HemisphereLight":n={direction:new D,skyColor:new $t,groundColor:new $t};break;case"RectAreaLight":n={color:new $t,position:new D,halfWidth:new D,halfHeight:new D};break}return e[t.id]=n,n}}}function iP(){const e={};return{get:function(t){if(e[t.id]!==void 0)return e[t.id];let n;switch(t.type){case"DirectionalLight":n={shadowIntensity:1,shadowBias:0,shadowNormalBias:0,shadowRadius:1,shadowMapSize:new mt};break;case"SpotLight":n={shadowIntensity:1,shadowBias:0,shadowNormalBias:0,shadowRadius:1,shadowMapSize:new mt};break;case"PointLight":n={shadowIntensity:1,shadowBias:0,shadowNormalBias:0,shadowRadius:1,shadowMapSize:new mt,shadowCameraNear:1,shadowCameraFar:1e3};break}return e[t.id]=n,n}}}let rP=0;function sP(e,t){return(t.castShadow?2:0)-(e.castShadow?2:0)+(t.map?1:0)-(e.map?1:0)}function oP(e){const t=new nP,n=iP(),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 D);const r=new D,s=new he,o=new he;function a(c){let u=0,h=0,f=0;for(let b=0;b<9;b++)i.probe[b].set(0,0,0);let p=0,g=0,_=0,m=0,d=0,S=0,x=0,y=0,T=0,P=0,R=0;c.sort(sP);for(let b=0,M=c.length;b0&&(e.has("OES_texture_float_linear")===!0?(i.rectAreaLTC1=At.LTC_FLOAT_1,i.rectAreaLTC2=At.LTC_FLOAT_2):(i.rectAreaLTC1=At.LTC_HALF_1,i.rectAreaLTC2=At.LTC_HALF_2)),i.ambient[0]=u,i.ambient[1]=h,i.ambient[2]=f;const C=i.hash;(C.directionalLength!==p||C.pointLength!==g||C.spotLength!==_||C.rectAreaLength!==m||C.hemiLength!==d||C.numDirectionalShadows!==S||C.numPointShadows!==x||C.numSpotShadows!==y||C.numSpotMaps!==T||C.numLightProbes!==R)&&(i.directional.length=p,i.spot.length=_,i.rectArea.length=m,i.point.length=g,i.hemi.length=d,i.directionalShadow.length=S,i.directionalShadowMap.length=S,i.pointShadow.length=x,i.pointShadowMap.length=x,i.spotShadow.length=y,i.spotShadowMap.length=y,i.directionalShadowMatrix.length=S,i.pointShadowMatrix.length=x,i.spotLightMatrix.length=y+T-P,i.spotLightMap.length=T,i.numSpotLightShadowsWithMaps=P,i.numLightProbes=R,C.directionalLength=p,C.pointLength=g,C.spotLength=_,C.rectAreaLength=m,C.hemiLength=d,C.numDirectionalShadows=S,C.numPointShadows=x,C.numSpotShadows=y,C.numSpotMaps=T,C.numLightProbes=R,i.version=rP++)}function l(c,u){let h=0,f=0,p=0,g=0,_=0;const m=u.matrixWorldInverse;for(let d=0,S=c.length;d=o.length?(a=new Im(e),o.push(a)):a=o[s],a}function i(){t=new WeakMap}return{get:n,dispose:i}}const lP=`void main() { gl_Position = vec4( position, 1.0 ); }`,cP=`uniform sampler2D shadow_pass; uniform vec2 resolution; @@ -3984,7 +3984,7 @@ void main() { squared_mean = squared_mean / samples; float std_dev = sqrt( max( 0.0, squared_mean - mean * mean ) ); gl_FragColor = vec4( mean, std_dev, 0.0, 1.0 ); -}`,uP=[new D(1,0,0),new D(-1,0,0),new D(0,1,0),new D(0,-1,0),new D(0,0,1),new D(0,0,-1)],hP=[new D(0,-1,0),new D(0,-1,0),new D(0,0,1),new D(0,0,-1),new D(0,-1,0),new D(0,-1,0)],Lm=new he,uo=new D,Vc=new D;function fP(e,t,n){let i=new vf;const r=new mt,s=new mt,o=new ze,a=new dw,l=new pw,c={},u=n.maxTextureSize,h={[yr]:dn,[dn]:yr,[xn]:xn},f=new ii({defines:{VSM_SAMPLES:8},uniforms:{shadow_pass:{value:null},resolution:{value:new mt},radius:{value:4}},vertexShader:lP,fragmentShader:cP}),p=f.clone();p.defines.HORIZONTAL_PASS=1;const g=new fe;g.setAttribute("position",new bn(new Float32Array([-1,-1,.5,3,-1,.5,-1,3,.5]),3));const v=new _t(g,f),m=this;this.enabled=!1,this.autoUpdate=!0,this.needsUpdate=!1,this.type=Za;let d=this.type;this.render=function(P,C,R){if(m.enabled===!1||m.autoUpdate===!1&&m.needsUpdate===!1||P.length===0)return;P.type===I0&&(Yt("WebGLShadowMap: PCFSoftShadowMap has been deprecated. Using PCFShadowMap instead."),P.type=Za);const b=e.getRenderTarget(),M=e.getActiveCubeFace(),L=e.getActiveMipmapLevel(),V=e.state;V.setBlending(Vi),V.buffers.depth.getReversed()===!0?V.buffers.color.setClear(0,0,0,0):V.buffers.color.setClear(1,1,1,1),V.buffers.depth.setTest(!0),V.setScissorTest(!1);const q=d!==this.type;q&&C.traverse(function(j){j.material&&(Array.isArray(j.material)?j.material.forEach(J=>J.needsUpdate=!0):j.material.needsUpdate=!0)});for(let j=0,J=P.length;ju||r.y>u)&&(r.x>u&&(s.x=Math.floor(u/H.x),r.x=s.x*H.x,k.mapSize.x=s.x),r.y>u&&(s.y=Math.floor(u/H.y),r.y=s.y*H.y,k.mapSize.y=s.y)),k.map===null||q===!0){if(k.map!==null&&(k.map.depthTexture!==null&&(k.map.depthTexture.dispose(),k.map.depthTexture=null),k.map.dispose()),this.type===_o){if(W.isPointLight){Yt("WebGLShadowMap: VSM shadow maps are not supported for PointLights. Use PCF or BasicShadowMap instead.");continue}k.map=new xi(r.x,r.y,{format:Bs,type:Yi,minFilter:fn,magFilter:fn,generateMipmaps:!1}),k.map.texture.name=W.name+".shadowMap",k.map.depthTexture=new Go(r.x,r.y,mi),k.map.depthTexture.name=W.name+".shadowMapDepth",k.map.depthTexture.format=Ji,k.map.depthTexture.compareFunction=null,k.map.depthTexture.minFilter=rn,k.map.depthTexture.magFilter=rn}else{W.isPointLight?(k.map=new r_(r.x),k.map.depthTexture=new DM(r.x,Mi)):(k.map=new xi(r.x,r.y),k.map.depthTexture=new Go(r.x,r.y,Mi)),k.map.depthTexture.name=W.name+".shadowMap",k.map.depthTexture.format=Ji;const pt=e.state.buffers.depth.getReversed();this.type===Za?(k.map.depthTexture.compareFunction=pt?pf:df,k.map.depthTexture.minFilter=fn,k.map.depthTexture.magFilter=fn):(k.map.depthTexture.compareFunction=null,k.map.depthTexture.minFilter=rn,k.map.depthTexture.magFilter=rn)}k.camera.updateProjectionMatrix()}const ct=k.map.isWebGLCubeRenderTarget?6:1;for(let pt=0;pt0||C.map&&C.alphaTest>0||C.alphaToCoverage===!0){const V=M.uuid,q=C.uuid;let j=c[V];j===void 0&&(j={},c[V]=j);let J=j[q];J===void 0&&(J=M.clone(),j[q]=J,C.addEventListener("dispose",A)),M=J}if(M.visible=C.visible,M.wireframe=C.wireframe,b===_o?M.side=C.shadowSide!==null?C.shadowSide:C.side:M.side=C.shadowSide!==null?C.shadowSide:h[C.side],M.alphaMap=C.alphaMap,M.alphaTest=C.alphaToCoverage===!0?.5:C.alphaTest,M.map=C.map,M.clipShadows=C.clipShadows,M.clippingPlanes=C.clippingPlanes,M.clipIntersection=C.clipIntersection,M.displacementMap=C.displacementMap,M.displacementScale=C.displacementScale,M.displacementBias=C.displacementBias,M.wireframeLinewidth=C.wireframeLinewidth,M.linewidth=C.linewidth,R.isPointLight===!0&&M.isMeshDistanceMaterial===!0){const V=e.properties.get(M);V.light=R}return M}function x(P,C,R,b,M){if(P.visible===!1)return;if(P.layers.test(C.layers)&&(P.isMesh||P.isLine||P.isPoints)&&(P.castShadow||P.receiveShadow&&M===_o)&&(!P.frustumCulled||i.intersectsObject(P))){P.modelViewMatrix.multiplyMatrices(R.matrixWorldInverse,P.matrixWorld);const q=t.update(P),j=P.material;if(Array.isArray(j)){const J=q.groups;for(let W=0,k=J.length;W=1):H.indexOf("OpenGL ES")!==-1&&(k=parseFloat(/^OpenGL ES (\d)/.exec(H)[1]),W=k>=2);let ct=null,pt={};const ft=e.getParameter(e.SCISSOR_BOX),kt=e.getParameter(e.VIEWPORT),Lt=new ze().fromArray(ft),Zt=new ze().fromArray(kt);function ue(B,Dt,gt,Nt){const dt=new Uint8Array(4),lt=e.createTexture();e.bindTexture(B,lt),e.texParameteri(B,e.TEXTURE_MIN_FILTER,e.NEAREST),e.texParameteri(B,e.TEXTURE_MAG_FILTER,e.NEAREST);for(let bt=0;bt"u"?!1:/OculusBrowser/g.test(navigator.userAgent),c=new mt,u=new WeakMap;let h;const f=new WeakMap;let p=!1;try{p=typeof OffscreenCanvas<"u"&&new OffscreenCanvas(1,1).getContext("2d")!==null}catch{}function g(w,_){return p?new OffscreenCanvas(w,_):ml("canvas")}function v(w,_,N){let Y=1;const nt=it(w);if((nt.width>N||nt.height>N)&&(Y=N/Math.max(nt.width,nt.height)),Y<1)if(typeof HTMLImageElement<"u"&&w instanceof HTMLImageElement||typeof HTMLCanvasElement<"u"&&w instanceof HTMLCanvasElement||typeof ImageBitmap<"u"&&w instanceof ImageBitmap||typeof VideoFrame<"u"&&w instanceof VideoFrame){const $=Math.floor(Y*nt.width),wt=Math.floor(Y*nt.height);h===void 0&&(h=g($,wt));const ht=_?g($,wt):h;return ht.width=$,ht.height=wt,ht.getContext("2d").drawImage(w,0,0,$,wt),Yt("WebGLRenderer: Texture has been resized from ("+nt.width+"x"+nt.height+") to ("+$+"x"+wt+")."),ht}else return"data"in w&&Yt("WebGLRenderer: Image in DataTexture is too big ("+nt.width+"x"+nt.height+")."),w;return w}function m(w){return w.generateMipmaps}function d(w){e.generateMipmap(w)}function S(w){return w.isWebGLCubeRenderTarget?e.TEXTURE_CUBE_MAP:w.isWebGL3DRenderTarget?e.TEXTURE_3D:w.isWebGLArrayRenderTarget||w.isCompressedArrayTexture?e.TEXTURE_2D_ARRAY:e.TEXTURE_2D}function y(w,_,N,Y,nt=!1){if(w!==null){if(e[w]!==void 0)return e[w];Yt("WebGLRenderer: Attempt to use non-existing WebGL internal format '"+w+"'")}let $=_;if(_===e.RED&&(N===e.FLOAT&&($=e.R32F),N===e.HALF_FLOAT&&($=e.R16F),N===e.UNSIGNED_BYTE&&($=e.R8)),_===e.RED_INTEGER&&(N===e.UNSIGNED_BYTE&&($=e.R8UI),N===e.UNSIGNED_SHORT&&($=e.R16UI),N===e.UNSIGNED_INT&&($=e.R32UI),N===e.BYTE&&($=e.R8I),N===e.SHORT&&($=e.R16I),N===e.INT&&($=e.R32I)),_===e.RG&&(N===e.FLOAT&&($=e.RG32F),N===e.HALF_FLOAT&&($=e.RG16F),N===e.UNSIGNED_BYTE&&($=e.RG8)),_===e.RG_INTEGER&&(N===e.UNSIGNED_BYTE&&($=e.RG8UI),N===e.UNSIGNED_SHORT&&($=e.RG16UI),N===e.UNSIGNED_INT&&($=e.RG32UI),N===e.BYTE&&($=e.RG8I),N===e.SHORT&&($=e.RG16I),N===e.INT&&($=e.RG32I)),_===e.RGB_INTEGER&&(N===e.UNSIGNED_BYTE&&($=e.RGB8UI),N===e.UNSIGNED_SHORT&&($=e.RGB16UI),N===e.UNSIGNED_INT&&($=e.RGB32UI),N===e.BYTE&&($=e.RGB8I),N===e.SHORT&&($=e.RGB16I),N===e.INT&&($=e.RGB32I)),_===e.RGBA_INTEGER&&(N===e.UNSIGNED_BYTE&&($=e.RGBA8UI),N===e.UNSIGNED_SHORT&&($=e.RGBA16UI),N===e.UNSIGNED_INT&&($=e.RGBA32UI),N===e.BYTE&&($=e.RGBA8I),N===e.SHORT&&($=e.RGBA16I),N===e.INT&&($=e.RGBA32I)),_===e.RGB&&(N===e.UNSIGNED_INT_5_9_9_9_REV&&($=e.RGB9_E5),N===e.UNSIGNED_INT_10F_11F_11F_REV&&($=e.R11F_G11F_B10F)),_===e.RGBA){const wt=nt?dl:me.getTransfer(Y);N===e.FLOAT&&($=e.RGBA32F),N===e.HALF_FLOAT&&($=e.RGBA16F),N===e.UNSIGNED_BYTE&&($=wt===be?e.SRGB8_ALPHA8:e.RGBA8),N===e.UNSIGNED_SHORT_4_4_4_4&&($=e.RGBA4),N===e.UNSIGNED_SHORT_5_5_5_1&&($=e.RGB5_A1)}return($===e.R16F||$===e.R32F||$===e.RG16F||$===e.RG32F||$===e.RGBA16F||$===e.RGBA32F)&&t.get("EXT_color_buffer_float"),$}function x(w,_){let N;return w?_===null||_===Mi||_===Vo?N=e.DEPTH24_STENCIL8:_===mi?N=e.DEPTH32F_STENCIL8:_===zo&&(N=e.DEPTH24_STENCIL8,Yt("DepthTexture: 16 bit depth attachment is not supported with stencil. Using 24-bit attachment.")):_===null||_===Mi||_===Vo?N=e.DEPTH_COMPONENT24:_===mi?N=e.DEPTH_COMPONENT32F:_===zo&&(N=e.DEPTH_COMPONENT16),N}function A(w,_){return m(w)===!0||w.isFramebufferTexture&&w.minFilter!==rn&&w.minFilter!==fn?Math.log2(Math.max(_.width,_.height))+1:w.mipmaps!==void 0&&w.mipmaps.length>0?w.mipmaps.length:w.isCompressedTexture&&Array.isArray(w.image)?_.mipmaps.length:1}function P(w){const _=w.target;_.removeEventListener("dispose",P),R(_),_.isVideoTexture&&u.delete(_)}function C(w){const _=w.target;_.removeEventListener("dispose",C),M(_)}function R(w){const _=i.get(w);if(_.__webglInit===void 0)return;const N=w.source,Y=f.get(N);if(Y){const nt=Y[_.__cacheKey];nt.usedTimes--,nt.usedTimes===0&&b(w),Object.keys(Y).length===0&&f.delete(N)}i.remove(w)}function b(w){const _=i.get(w);e.deleteTexture(_.__webglTexture);const N=w.source,Y=f.get(N);delete Y[_.__cacheKey],o.memory.textures--}function M(w){const _=i.get(w);if(w.depthTexture&&(w.depthTexture.dispose(),i.remove(w.depthTexture)),w.isWebGLCubeRenderTarget)for(let Y=0;Y<6;Y++){if(Array.isArray(_.__webglFramebuffer[Y]))for(let nt=0;nt<_.__webglFramebuffer[Y].length;nt++)e.deleteFramebuffer(_.__webglFramebuffer[Y][nt]);else e.deleteFramebuffer(_.__webglFramebuffer[Y]);_.__webglDepthbuffer&&e.deleteRenderbuffer(_.__webglDepthbuffer[Y])}else{if(Array.isArray(_.__webglFramebuffer))for(let Y=0;Y<_.__webglFramebuffer.length;Y++)e.deleteFramebuffer(_.__webglFramebuffer[Y]);else e.deleteFramebuffer(_.__webglFramebuffer);if(_.__webglDepthbuffer&&e.deleteRenderbuffer(_.__webglDepthbuffer),_.__webglMultisampledFramebuffer&&e.deleteFramebuffer(_.__webglMultisampledFramebuffer),_.__webglColorRenderbuffer)for(let Y=0;Y<_.__webglColorRenderbuffer.length;Y++)_.__webglColorRenderbuffer[Y]&&e.deleteRenderbuffer(_.__webglColorRenderbuffer[Y]);_.__webglDepthRenderbuffer&&e.deleteRenderbuffer(_.__webglDepthRenderbuffer)}const N=w.textures;for(let Y=0,nt=N.length;Y=r.maxTextures&&Yt("WebGLTextures: Trying to use "+w+" texture units while this GPU supports only "+r.maxTextures),L+=1,w}function j(w){const _=[];return _.push(w.wrapS),_.push(w.wrapT),_.push(w.wrapR||0),_.push(w.magFilter),_.push(w.minFilter),_.push(w.anisotropy),_.push(w.internalFormat),_.push(w.format),_.push(w.type),_.push(w.generateMipmaps),_.push(w.premultiplyAlpha),_.push(w.flipY),_.push(w.unpackAlignment),_.push(w.colorSpace),_.join()}function J(w,_){const N=i.get(w);if(w.isVideoTexture&&K(w),w.isRenderTargetTexture===!1&&w.isExternalTexture!==!0&&w.version>0&&N.__version!==w.version){const Y=w.image;if(Y===null)Yt("WebGLRenderer: Texture marked for update but no image data found.");else if(Y.complete===!1)Yt("WebGLRenderer: Texture marked for update but image is incomplete");else{st(N,w,_);return}}else w.isExternalTexture&&(N.__webglTexture=w.sourceTexture?w.sourceTexture:null);n.bindTexture(e.TEXTURE_2D,N.__webglTexture,e.TEXTURE0+_)}function W(w,_){const N=i.get(w);if(w.isRenderTargetTexture===!1&&w.version>0&&N.__version!==w.version){st(N,w,_);return}else w.isExternalTexture&&(N.__webglTexture=w.sourceTexture?w.sourceTexture:null);n.bindTexture(e.TEXTURE_2D_ARRAY,N.__webglTexture,e.TEXTURE0+_)}function k(w,_){const N=i.get(w);if(w.isRenderTargetTexture===!1&&w.version>0&&N.__version!==w.version){st(N,w,_);return}n.bindTexture(e.TEXTURE_3D,N.__webglTexture,e.TEXTURE0+_)}function H(w,_){const N=i.get(w);if(w.isCubeDepthTexture!==!0&&w.version>0&&N.__version!==w.version){ot(N,w,_);return}n.bindTexture(e.TEXTURE_CUBE_MAP,N.__webglTexture,e.TEXTURE0+_)}const ct={[xu]:e.REPEAT,[zi]:e.CLAMP_TO_EDGE,[yu]:e.MIRRORED_REPEAT},pt={[rn]:e.NEAREST,[Db]:e.NEAREST_MIPMAP_NEAREST,[ha]:e.NEAREST_MIPMAP_LINEAR,[fn]:e.LINEAR,[ac]:e.LINEAR_MIPMAP_NEAREST,[zr]:e.LINEAR_MIPMAP_LINEAR},ft={[Nb]:e.NEVER,[Bb]:e.ALWAYS,[Ub]:e.LESS,[df]:e.LEQUAL,[Ob]:e.EQUAL,[pf]:e.GEQUAL,[Fb]:e.GREATER,[kb]:e.NOTEQUAL};function kt(w,_){if(_.type===mi&&t.has("OES_texture_float_linear")===!1&&(_.magFilter===fn||_.magFilter===ac||_.magFilter===ha||_.magFilter===zr||_.minFilter===fn||_.minFilter===ac||_.minFilter===ha||_.minFilter===zr)&&Yt("WebGLRenderer: Unable to use linear filtering with floating point textures. OES_texture_float_linear not supported on this device."),e.texParameteri(w,e.TEXTURE_WRAP_S,ct[_.wrapS]),e.texParameteri(w,e.TEXTURE_WRAP_T,ct[_.wrapT]),(w===e.TEXTURE_3D||w===e.TEXTURE_2D_ARRAY)&&e.texParameteri(w,e.TEXTURE_WRAP_R,ct[_.wrapR]),e.texParameteri(w,e.TEXTURE_MAG_FILTER,pt[_.magFilter]),e.texParameteri(w,e.TEXTURE_MIN_FILTER,pt[_.minFilter]),_.compareFunction&&(e.texParameteri(w,e.TEXTURE_COMPARE_MODE,e.COMPARE_REF_TO_TEXTURE),e.texParameteri(w,e.TEXTURE_COMPARE_FUNC,ft[_.compareFunction])),t.has("EXT_texture_filter_anisotropic")===!0){if(_.magFilter===rn||_.minFilter!==ha&&_.minFilter!==zr||_.type===mi&&t.has("OES_texture_float_linear")===!1)return;if(_.anisotropy>1||i.get(_).__currentAnisotropy){const N=t.get("EXT_texture_filter_anisotropic");e.texParameterf(w,N.TEXTURE_MAX_ANISOTROPY_EXT,Math.min(_.anisotropy,r.getMaxAnisotropy())),i.get(_).__currentAnisotropy=_.anisotropy}}}function Lt(w,_){let N=!1;w.__webglInit===void 0&&(w.__webglInit=!0,_.addEventListener("dispose",P));const Y=_.source;let nt=f.get(Y);nt===void 0&&(nt={},f.set(Y,nt));const $=j(_);if($!==w.__cacheKey){nt[$]===void 0&&(nt[$]={texture:e.createTexture(),usedTimes:0},o.memory.textures++,N=!0),nt[$].usedTimes++;const wt=nt[w.__cacheKey];wt!==void 0&&(nt[w.__cacheKey].usedTimes--,wt.usedTimes===0&&b(_)),w.__cacheKey=$,w.__webglTexture=nt[$].texture}return N}function Zt(w,_,N){return Math.floor(Math.floor(w/N)/_)}function ue(w,_,N,Y){const $=w.updateRanges;if($.length===0)n.texSubImage2D(e.TEXTURE_2D,0,0,0,_.width,_.height,N,Y,_.data);else{$.sort((ut,St)=>ut.start-St.start);let wt=0;for(let ut=1;ut<$.length;ut++){const St=$[wt],Et=$[ut],It=St.start+St.count,yt=Zt(Et.start,_.width,4),ee=Zt(St.start,_.width,4);Et.start<=It+1&&yt===ee&&Zt(Et.start+Et.count-1,_.width,4)===yt?St.count=Math.max(St.count,Et.start+Et.count-St.start):(++wt,$[wt]=Et)}$.length=wt+1;const ht=e.getParameter(e.UNPACK_ROW_LENGTH),Ct=e.getParameter(e.UNPACK_SKIP_PIXELS),zt=e.getParameter(e.UNPACK_SKIP_ROWS);e.pixelStorei(e.UNPACK_ROW_LENGTH,_.width);for(let ut=0,St=$.length;ut0){B&&Dt&&n.texStorage2D(e.TEXTURE_2D,Nt,It,ee[0].width,ee[0].height);for(let dt=0,lt=ee.length;dt0){const bt=um(yt.width,yt.height,_.format,_.type);for(const Qt of _.layerUpdates){const Ce=yt.data.subarray(Qt*bt/yt.data.BYTES_PER_ELEMENT,(Qt+1)*bt/yt.data.BYTES_PER_ELEMENT);n.compressedTexSubImage3D(e.TEXTURE_2D_ARRAY,dt,0,0,Qt,yt.width,yt.height,1,St,Ce)}_.clearLayerUpdates()}else n.compressedTexSubImage3D(e.TEXTURE_2D_ARRAY,dt,0,0,0,yt.width,yt.height,ut.depth,St,yt.data)}else n.compressedTexImage3D(e.TEXTURE_2D_ARRAY,dt,It,yt.width,yt.height,ut.depth,0,yt.data,0,0);else Yt("WebGLRenderer: Attempt to load unsupported compressed texture format in .uploadTexture()");else B?gt&&n.texSubImage3D(e.TEXTURE_2D_ARRAY,dt,0,0,0,yt.width,yt.height,ut.depth,St,Et,yt.data):n.texImage3D(e.TEXTURE_2D_ARRAY,dt,It,yt.width,yt.height,ut.depth,0,St,Et,yt.data)}else{B&&Dt&&n.texStorage2D(e.TEXTURE_2D,Nt,It,ee[0].width,ee[0].height);for(let dt=0,lt=ee.length;dt0){const dt=um(ut.width,ut.height,_.format,_.type);for(const lt of _.layerUpdates){const bt=ut.data.subarray(lt*dt/ut.data.BYTES_PER_ELEMENT,(lt+1)*dt/ut.data.BYTES_PER_ELEMENT);n.texSubImage3D(e.TEXTURE_2D_ARRAY,0,0,0,lt,ut.width,ut.height,1,St,Et,bt)}_.clearLayerUpdates()}else n.texSubImage3D(e.TEXTURE_2D_ARRAY,0,0,0,0,ut.width,ut.height,ut.depth,St,Et,ut.data)}else n.texImage3D(e.TEXTURE_2D_ARRAY,0,It,ut.width,ut.height,ut.depth,0,St,Et,ut.data);else if(_.isData3DTexture)B?(Dt&&n.texStorage3D(e.TEXTURE_3D,Nt,It,ut.width,ut.height,ut.depth),gt&&n.texSubImage3D(e.TEXTURE_3D,0,0,0,0,ut.width,ut.height,ut.depth,St,Et,ut.data)):n.texImage3D(e.TEXTURE_3D,0,It,ut.width,ut.height,ut.depth,0,St,Et,ut.data);else if(_.isFramebufferTexture){if(Dt)if(B)n.texStorage2D(e.TEXTURE_2D,Nt,It,ut.width,ut.height);else{let dt=ut.width,lt=ut.height;for(let bt=0;bt>=1,lt>>=1}}else if(ee.length>0){if(B&&Dt){const dt=it(ee[0]);n.texStorage2D(e.TEXTURE_2D,Nt,It,dt.width,dt.height)}for(let dt=0,lt=ee.length;dt0&&Nt++;const lt=it(St[0]);n.texStorage2D(e.TEXTURE_CUBE_MAP,Nt,ee,lt.width,lt.height)}for(let lt=0;lt<6;lt++)if(ut){B?gt&&n.texSubImage2D(e.TEXTURE_CUBE_MAP_POSITIVE_X+lt,0,0,0,St[lt].width,St[lt].height,It,yt,St[lt].data):n.texImage2D(e.TEXTURE_CUBE_MAP_POSITIVE_X+lt,0,ee,St[lt].width,St[lt].height,0,It,yt,St[lt].data);for(let bt=0;bt>$),Et=Math.max(1,_.height>>$);nt===e.TEXTURE_3D||nt===e.TEXTURE_2D_ARRAY?n.texImage3D(nt,$,Ct,St,Et,_.depth,0,wt,ht,null):n.texImage2D(nt,$,Ct,St,Et,0,wt,ht,null)}n.bindFramebuffer(e.FRAMEBUFFER,w),rt(_)?a.framebufferTexture2DMultisampleEXT(e.FRAMEBUFFER,Y,nt,ut.__webglTexture,0,E(_)):(nt===e.TEXTURE_2D||nt>=e.TEXTURE_CUBE_MAP_POSITIVE_X&&nt<=e.TEXTURE_CUBE_MAP_NEGATIVE_Z)&&e.framebufferTexture2D(e.FRAMEBUFFER,Y,nt,ut.__webglTexture,$),n.bindFramebuffer(e.FRAMEBUFFER,null)}function Vt(w,_,N){if(e.bindRenderbuffer(e.RENDERBUFFER,w),_.depthBuffer){const Y=_.depthTexture,nt=Y&&Y.isDepthTexture?Y.type:null,$=x(_.stencilBuffer,nt),wt=_.stencilBuffer?e.DEPTH_STENCIL_ATTACHMENT:e.DEPTH_ATTACHMENT;rt(_)?a.renderbufferStorageMultisampleEXT(e.RENDERBUFFER,E(_),$,_.width,_.height):N?e.renderbufferStorageMultisample(e.RENDERBUFFER,E(_),$,_.width,_.height):e.renderbufferStorage(e.RENDERBUFFER,$,_.width,_.height),e.framebufferRenderbuffer(e.FRAMEBUFFER,wt,e.RENDERBUFFER,w)}else{const Y=_.textures;for(let nt=0;nt{delete _.__boundDepthTexture,delete _.__depthDisposeCallback,Y.removeEventListener("dispose",nt)};Y.addEventListener("dispose",nt),_.__depthDisposeCallback=nt}_.__boundDepthTexture=Y}if(w.depthTexture&&!_.__autoAllocateDepthBuffer)if(N)for(let Y=0;Y<6;Y++)Mt(_.__webglFramebuffer[Y],w,Y);else{const Y=w.texture.mipmaps;Y&&Y.length>0?Mt(_.__webglFramebuffer[0],w,0):Mt(_.__webglFramebuffer,w,0)}else if(N){_.__webglDepthbuffer=[];for(let Y=0;Y<6;Y++)if(n.bindFramebuffer(e.FRAMEBUFFER,_.__webglFramebuffer[Y]),_.__webglDepthbuffer[Y]===void 0)_.__webglDepthbuffer[Y]=e.createRenderbuffer(),Vt(_.__webglDepthbuffer[Y],w,!1);else{const nt=w.stencilBuffer?e.DEPTH_STENCIL_ATTACHMENT:e.DEPTH_ATTACHMENT,$=_.__webglDepthbuffer[Y];e.bindRenderbuffer(e.RENDERBUFFER,$),e.framebufferRenderbuffer(e.FRAMEBUFFER,nt,e.RENDERBUFFER,$)}}else{const Y=w.texture.mipmaps;if(Y&&Y.length>0?n.bindFramebuffer(e.FRAMEBUFFER,_.__webglFramebuffer[0]):n.bindFramebuffer(e.FRAMEBUFFER,_.__webglFramebuffer),_.__webglDepthbuffer===void 0)_.__webglDepthbuffer=e.createRenderbuffer(),Vt(_.__webglDepthbuffer,w,!1);else{const nt=w.stencilBuffer?e.DEPTH_STENCIL_ATTACHMENT:e.DEPTH_ATTACHMENT,$=_.__webglDepthbuffer;e.bindRenderbuffer(e.RENDERBUFFER,$),e.framebufferRenderbuffer(e.FRAMEBUFFER,nt,e.RENDERBUFFER,$)}}n.bindFramebuffer(e.FRAMEBUFFER,null)}function I(w,_,N){const Y=i.get(w);_!==void 0&&Pt(Y.__webglFramebuffer,w,w.texture,e.COLOR_ATTACHMENT0,e.TEXTURE_2D,0),N!==void 0&&oe(w)}function O(w){const _=w.texture,N=i.get(w),Y=i.get(_);w.addEventListener("dispose",C);const nt=w.textures,$=w.isWebGLCubeRenderTarget===!0,wt=nt.length>1;if(wt||(Y.__webglTexture===void 0&&(Y.__webglTexture=e.createTexture()),Y.__version=_.version,o.memory.textures++),$){N.__webglFramebuffer=[];for(let ht=0;ht<6;ht++)if(_.mipmaps&&_.mipmaps.length>0){N.__webglFramebuffer[ht]=[];for(let Ct=0;Ct<_.mipmaps.length;Ct++)N.__webglFramebuffer[ht][Ct]=e.createFramebuffer()}else N.__webglFramebuffer[ht]=e.createFramebuffer()}else{if(_.mipmaps&&_.mipmaps.length>0){N.__webglFramebuffer=[];for(let ht=0;ht<_.mipmaps.length;ht++)N.__webglFramebuffer[ht]=e.createFramebuffer()}else N.__webglFramebuffer=e.createFramebuffer();if(wt)for(let ht=0,Ct=nt.length;ht0&&rt(w)===!1){N.__webglMultisampledFramebuffer=e.createFramebuffer(),N.__webglColorRenderbuffer=[],n.bindFramebuffer(e.FRAMEBUFFER,N.__webglMultisampledFramebuffer);for(let ht=0;ht0)for(let Ct=0;Ct<_.mipmaps.length;Ct++)Pt(N.__webglFramebuffer[ht][Ct],w,_,e.COLOR_ATTACHMENT0,e.TEXTURE_CUBE_MAP_POSITIVE_X+ht,Ct);else Pt(N.__webglFramebuffer[ht],w,_,e.COLOR_ATTACHMENT0,e.TEXTURE_CUBE_MAP_POSITIVE_X+ht,0);m(_)&&d(e.TEXTURE_CUBE_MAP),n.unbindTexture()}else if(wt){for(let ht=0,Ct=nt.length;ht0)for(let Ct=0;Ct<_.mipmaps.length;Ct++)Pt(N.__webglFramebuffer[Ct],w,_,e.COLOR_ATTACHMENT0,ht,Ct);else Pt(N.__webglFramebuffer,w,_,e.COLOR_ATTACHMENT0,ht,0);m(_)&&d(ht),n.unbindTexture()}w.depthBuffer&&oe(w)}function U(w){const _=w.textures;for(let N=0,Y=_.length;N0){if(rt(w)===!1){const _=w.textures,N=w.width,Y=w.height;let nt=e.COLOR_BUFFER_BIT;const $=w.stencilBuffer?e.DEPTH_STENCIL_ATTACHMENT:e.DEPTH_ATTACHMENT,wt=i.get(w),ht=_.length>1;if(ht)for(let zt=0;zt<_.length;zt++)n.bindFramebuffer(e.FRAMEBUFFER,wt.__webglMultisampledFramebuffer),e.framebufferRenderbuffer(e.FRAMEBUFFER,e.COLOR_ATTACHMENT0+zt,e.RENDERBUFFER,null),n.bindFramebuffer(e.FRAMEBUFFER,wt.__webglFramebuffer),e.framebufferTexture2D(e.DRAW_FRAMEBUFFER,e.COLOR_ATTACHMENT0+zt,e.TEXTURE_2D,null,0);n.bindFramebuffer(e.READ_FRAMEBUFFER,wt.__webglMultisampledFramebuffer);const Ct=w.texture.mipmaps;Ct&&Ct.length>0?n.bindFramebuffer(e.DRAW_FRAMEBUFFER,wt.__webglFramebuffer[0]):n.bindFramebuffer(e.DRAW_FRAMEBUFFER,wt.__webglFramebuffer);for(let zt=0;zt<_.length;zt++){if(w.resolveDepthBuffer&&(w.depthBuffer&&(nt|=e.DEPTH_BUFFER_BIT),w.stencilBuffer&&w.resolveStencilBuffer&&(nt|=e.STENCIL_BUFFER_BIT)),ht){e.framebufferRenderbuffer(e.READ_FRAMEBUFFER,e.COLOR_ATTACHMENT0,e.RENDERBUFFER,wt.__webglColorRenderbuffer[zt]);const ut=i.get(_[zt]).__webglTexture;e.framebufferTexture2D(e.DRAW_FRAMEBUFFER,e.COLOR_ATTACHMENT0,e.TEXTURE_2D,ut,0)}e.blitFramebuffer(0,0,N,Y,0,0,N,Y,nt,e.NEAREST),l===!0&&(z.length=0,F.length=0,z.push(e.COLOR_ATTACHMENT0+zt),w.depthBuffer&&w.resolveDepthBuffer===!1&&(z.push($),F.push($),e.invalidateFramebuffer(e.DRAW_FRAMEBUFFER,F)),e.invalidateFramebuffer(e.READ_FRAMEBUFFER,z))}if(n.bindFramebuffer(e.READ_FRAMEBUFFER,null),n.bindFramebuffer(e.DRAW_FRAMEBUFFER,null),ht)for(let zt=0;zt<_.length;zt++){n.bindFramebuffer(e.FRAMEBUFFER,wt.__webglMultisampledFramebuffer),e.framebufferRenderbuffer(e.FRAMEBUFFER,e.COLOR_ATTACHMENT0+zt,e.RENDERBUFFER,wt.__webglColorRenderbuffer[zt]);const ut=i.get(_[zt]).__webglTexture;n.bindFramebuffer(e.FRAMEBUFFER,wt.__webglFramebuffer),e.framebufferTexture2D(e.DRAW_FRAMEBUFFER,e.COLOR_ATTACHMENT0+zt,e.TEXTURE_2D,ut,0)}n.bindFramebuffer(e.DRAW_FRAMEBUFFER,wt.__webglMultisampledFramebuffer)}else if(w.depthBuffer&&w.resolveDepthBuffer===!1&&l){const _=w.stencilBuffer?e.DEPTH_STENCIL_ATTACHMENT:e.DEPTH_ATTACHMENT;e.invalidateFramebuffer(e.DRAW_FRAMEBUFFER,[_])}}}function E(w){return Math.min(r.maxSamples,w.samples)}function rt(w){const _=i.get(w);return w.samples>0&&t.has("WEBGL_multisampled_render_to_texture")===!0&&_.__useRenderToTexture!==!1}function K(w){const _=o.render.frame;u.get(w)!==_&&(u.set(w,_),w.update())}function Q(w,_){const N=w.colorSpace,Y=w.format,nt=w.type;return w.isCompressedTexture===!0||w.isVideoTexture===!0||N!==zs&&N!==hr&&(me.getTransfer(N)===be?(Y!==Qn||nt!==kn)&&Yt("WebGLTextures: sRGB encoded textures have to use RGBAFormat and UnsignedByteType."):de("WebGLTextures: Unsupported texture color space:",N)),_}function it(w){return typeof HTMLImageElement<"u"&&w instanceof HTMLImageElement?(c.width=w.naturalWidth||w.width,c.height=w.naturalHeight||w.height):typeof VideoFrame<"u"&&w instanceof VideoFrame?(c.width=w.displayWidth,c.height=w.displayHeight):(c.width=w.width,c.height=w.height),c}this.allocateTextureUnit=q,this.resetTextureUnits=V,this.setTexture2D=J,this.setTexture2DArray=W,this.setTexture3D=k,this.setTextureCube=H,this.rebindTextures=I,this.setupRenderTarget=O,this.updateRenderTargetMipmap=U,this.updateMultisampleRenderTarget=X,this.setupDepthRenderbuffer=oe,this.setupFrameBufferTexture=Pt,this.useMultisampledRTT=rt,this.isReversedDepthBuffer=function(){return n.buffers.depth.getReversed()}}function gP(e,t){function n(i,r=hr){let s;const o=me.getTransfer(r);if(i===kn)return e.UNSIGNED_BYTE;if(i===lf)return e.UNSIGNED_SHORT_4_4_4_4;if(i===cf)return e.UNSIGNED_SHORT_5_5_5_1;if(i===G0)return e.UNSIGNED_INT_5_9_9_9_REV;if(i===W0)return e.UNSIGNED_INT_10F_11F_11F_REV;if(i===V0)return e.BYTE;if(i===H0)return e.SHORT;if(i===zo)return e.UNSIGNED_SHORT;if(i===af)return e.INT;if(i===Mi)return e.UNSIGNED_INT;if(i===mi)return e.FLOAT;if(i===Yi)return e.HALF_FLOAT;if(i===X0)return e.ALPHA;if(i===q0)return e.RGB;if(i===Qn)return e.RGBA;if(i===Ji)return e.DEPTH_COMPONENT;if(i===Vr)return e.DEPTH_STENCIL;if(i===Y0)return e.RED;if(i===uf)return e.RED_INTEGER;if(i===Bs)return e.RG;if(i===hf)return e.RG_INTEGER;if(i===ff)return e.RGBA_INTEGER;if(i===Ka||i===Qa||i===ja||i===tl)if(o===be)if(s=t.get("WEBGL_compressed_texture_s3tc_srgb"),s!==null){if(i===Ka)return s.COMPRESSED_SRGB_S3TC_DXT1_EXT;if(i===Qa)return s.COMPRESSED_SRGB_ALPHA_S3TC_DXT1_EXT;if(i===ja)return s.COMPRESSED_SRGB_ALPHA_S3TC_DXT3_EXT;if(i===tl)return s.COMPRESSED_SRGB_ALPHA_S3TC_DXT5_EXT}else return null;else if(s=t.get("WEBGL_compressed_texture_s3tc"),s!==null){if(i===Ka)return s.COMPRESSED_RGB_S3TC_DXT1_EXT;if(i===Qa)return s.COMPRESSED_RGBA_S3TC_DXT1_EXT;if(i===ja)return s.COMPRESSED_RGBA_S3TC_DXT3_EXT;if(i===tl)return s.COMPRESSED_RGBA_S3TC_DXT5_EXT}else return null;if(i===Su||i===bu||i===Mu||i===wu)if(s=t.get("WEBGL_compressed_texture_pvrtc"),s!==null){if(i===Su)return s.COMPRESSED_RGB_PVRTC_4BPPV1_IMG;if(i===bu)return s.COMPRESSED_RGB_PVRTC_2BPPV1_IMG;if(i===Mu)return s.COMPRESSED_RGBA_PVRTC_4BPPV1_IMG;if(i===wu)return s.COMPRESSED_RGBA_PVRTC_2BPPV1_IMG}else return null;if(i===Eu||i===Tu||i===Au||i===Pu||i===Cu||i===Ru||i===Du)if(s=t.get("WEBGL_compressed_texture_etc"),s!==null){if(i===Eu||i===Tu)return o===be?s.COMPRESSED_SRGB8_ETC2:s.COMPRESSED_RGB8_ETC2;if(i===Au)return o===be?s.COMPRESSED_SRGB8_ALPHA8_ETC2_EAC:s.COMPRESSED_RGBA8_ETC2_EAC;if(i===Pu)return s.COMPRESSED_R11_EAC;if(i===Cu)return s.COMPRESSED_SIGNED_R11_EAC;if(i===Ru)return s.COMPRESSED_RG11_EAC;if(i===Du)return s.COMPRESSED_SIGNED_RG11_EAC}else return null;if(i===Iu||i===Lu||i===Nu||i===Uu||i===Ou||i===Fu||i===ku||i===Bu||i===zu||i===Vu||i===Hu||i===Gu||i===Wu||i===Xu)if(s=t.get("WEBGL_compressed_texture_astc"),s!==null){if(i===Iu)return o===be?s.COMPRESSED_SRGB8_ALPHA8_ASTC_4x4_KHR:s.COMPRESSED_RGBA_ASTC_4x4_KHR;if(i===Lu)return o===be?s.COMPRESSED_SRGB8_ALPHA8_ASTC_5x4_KHR:s.COMPRESSED_RGBA_ASTC_5x4_KHR;if(i===Nu)return o===be?s.COMPRESSED_SRGB8_ALPHA8_ASTC_5x5_KHR:s.COMPRESSED_RGBA_ASTC_5x5_KHR;if(i===Uu)return o===be?s.COMPRESSED_SRGB8_ALPHA8_ASTC_6x5_KHR:s.COMPRESSED_RGBA_ASTC_6x5_KHR;if(i===Ou)return o===be?s.COMPRESSED_SRGB8_ALPHA8_ASTC_6x6_KHR:s.COMPRESSED_RGBA_ASTC_6x6_KHR;if(i===Fu)return o===be?s.COMPRESSED_SRGB8_ALPHA8_ASTC_8x5_KHR:s.COMPRESSED_RGBA_ASTC_8x5_KHR;if(i===ku)return o===be?s.COMPRESSED_SRGB8_ALPHA8_ASTC_8x6_KHR:s.COMPRESSED_RGBA_ASTC_8x6_KHR;if(i===Bu)return o===be?s.COMPRESSED_SRGB8_ALPHA8_ASTC_8x8_KHR:s.COMPRESSED_RGBA_ASTC_8x8_KHR;if(i===zu)return o===be?s.COMPRESSED_SRGB8_ALPHA8_ASTC_10x5_KHR:s.COMPRESSED_RGBA_ASTC_10x5_KHR;if(i===Vu)return o===be?s.COMPRESSED_SRGB8_ALPHA8_ASTC_10x6_KHR:s.COMPRESSED_RGBA_ASTC_10x6_KHR;if(i===Hu)return o===be?s.COMPRESSED_SRGB8_ALPHA8_ASTC_10x8_KHR:s.COMPRESSED_RGBA_ASTC_10x8_KHR;if(i===Gu)return o===be?s.COMPRESSED_SRGB8_ALPHA8_ASTC_10x10_KHR:s.COMPRESSED_RGBA_ASTC_10x10_KHR;if(i===Wu)return o===be?s.COMPRESSED_SRGB8_ALPHA8_ASTC_12x10_KHR:s.COMPRESSED_RGBA_ASTC_12x10_KHR;if(i===Xu)return o===be?s.COMPRESSED_SRGB8_ALPHA8_ASTC_12x12_KHR:s.COMPRESSED_RGBA_ASTC_12x12_KHR}else return null;if(i===qu||i===Yu||i===Ju)if(s=t.get("EXT_texture_compression_bptc"),s!==null){if(i===qu)return o===be?s.COMPRESSED_SRGB_ALPHA_BPTC_UNORM_EXT:s.COMPRESSED_RGBA_BPTC_UNORM_EXT;if(i===Yu)return s.COMPRESSED_RGB_BPTC_SIGNED_FLOAT_EXT;if(i===Ju)return s.COMPRESSED_RGB_BPTC_UNSIGNED_FLOAT_EXT}else return null;if(i===$u||i===Zu||i===Ku||i===Qu)if(s=t.get("EXT_texture_compression_rgtc"),s!==null){if(i===$u)return s.COMPRESSED_RED_RGTC1_EXT;if(i===Zu)return s.COMPRESSED_SIGNED_RED_RGTC1_EXT;if(i===Ku)return s.COMPRESSED_RED_GREEN_RGTC2_EXT;if(i===Qu)return s.COMPRESSED_SIGNED_RED_GREEN_RGTC2_EXT}else return null;return i===Vo?e.UNSIGNED_INT_24_8:e[i]!==void 0?e[i]:null}return{convert:n}}const _P=` +}`,uP=[new D(1,0,0),new D(-1,0,0),new D(0,1,0),new D(0,-1,0),new D(0,0,1),new D(0,0,-1)],hP=[new D(0,-1,0),new D(0,-1,0),new D(0,0,1),new D(0,0,-1),new D(0,-1,0),new D(0,-1,0)],Lm=new he,uo=new D,Hc=new D;function fP(e,t,n){let i=new vf;const r=new mt,s=new mt,o=new ze,a=new dw,l=new pw,c={},u=n.maxTextureSize,h={[yr]:dn,[dn]:yr,[yn]:yn},f=new ii({defines:{VSM_SAMPLES:8},uniforms:{shadow_pass:{value:null},resolution:{value:new mt},radius:{value:4}},vertexShader:lP,fragmentShader:cP}),p=f.clone();p.defines.HORIZONTAL_PASS=1;const g=new fe;g.setAttribute("position",new pn(new Float32Array([-1,-1,.5,3,-1,.5,-1,3,.5]),3));const _=new _t(g,f),m=this;this.enabled=!1,this.autoUpdate=!0,this.needsUpdate=!1,this.type=Za;let d=this.type;this.render=function(P,R,C){if(m.enabled===!1||m.autoUpdate===!1&&m.needsUpdate===!1||P.length===0)return;P.type===I0&&(Yt("WebGLShadowMap: PCFSoftShadowMap has been deprecated. Using PCFShadowMap instead."),P.type=Za);const b=e.getRenderTarget(),M=e.getActiveCubeFace(),L=e.getActiveMipmapLevel(),V=e.state;V.setBlending(Vi),V.buffers.depth.getReversed()===!0?V.buffers.color.setClear(0,0,0,0):V.buffers.color.setClear(1,1,1,1),V.buffers.depth.setTest(!0),V.setScissorTest(!1);const q=d!==this.type;q&&R.traverse(function(j){j.material&&(Array.isArray(j.material)?j.material.forEach(J=>J.needsUpdate=!0):j.material.needsUpdate=!0)});for(let j=0,J=P.length;ju||r.y>u)&&(r.x>u&&(s.x=Math.floor(u/H.x),r.x=s.x*H.x,k.mapSize.x=s.x),r.y>u&&(s.y=Math.floor(u/H.y),r.y=s.y*H.y,k.mapSize.y=s.y)),k.map===null||q===!0){if(k.map!==null&&(k.map.depthTexture!==null&&(k.map.depthTexture.dispose(),k.map.depthTexture=null),k.map.dispose()),this.type===_o){if(W.isPointLight){Yt("WebGLShadowMap: VSM shadow maps are not supported for PointLights. Use PCF or BasicShadowMap instead.");continue}k.map=new xi(r.x,r.y,{format:Bs,type:Yi,minFilter:fn,magFilter:fn,generateMipmaps:!1}),k.map.texture.name=W.name+".shadowMap",k.map.depthTexture=new Go(r.x,r.y,mi),k.map.depthTexture.name=W.name+".shadowMapDepth",k.map.depthTexture.format=Ji,k.map.depthTexture.compareFunction=null,k.map.depthTexture.minFilter=rn,k.map.depthTexture.magFilter=rn}else{W.isPointLight?(k.map=new r_(r.x),k.map.depthTexture=new DM(r.x,Mi)):(k.map=new xi(r.x,r.y),k.map.depthTexture=new Go(r.x,r.y,Mi)),k.map.depthTexture.name=W.name+".shadowMap",k.map.depthTexture.format=Ji;const pt=e.state.buffers.depth.getReversed();this.type===Za?(k.map.depthTexture.compareFunction=pt?pf:df,k.map.depthTexture.minFilter=fn,k.map.depthTexture.magFilter=fn):(k.map.depthTexture.compareFunction=null,k.map.depthTexture.minFilter=rn,k.map.depthTexture.magFilter=rn)}k.camera.updateProjectionMatrix()}const ct=k.map.isWebGLCubeRenderTarget?6:1;for(let pt=0;pt0||R.map&&R.alphaTest>0||R.alphaToCoverage===!0){const V=M.uuid,q=R.uuid;let j=c[V];j===void 0&&(j={},c[V]=j);let J=j[q];J===void 0&&(J=M.clone(),j[q]=J,R.addEventListener("dispose",T)),M=J}if(M.visible=R.visible,M.wireframe=R.wireframe,b===_o?M.side=R.shadowSide!==null?R.shadowSide:R.side:M.side=R.shadowSide!==null?R.shadowSide:h[R.side],M.alphaMap=R.alphaMap,M.alphaTest=R.alphaToCoverage===!0?.5:R.alphaTest,M.map=R.map,M.clipShadows=R.clipShadows,M.clippingPlanes=R.clippingPlanes,M.clipIntersection=R.clipIntersection,M.displacementMap=R.displacementMap,M.displacementScale=R.displacementScale,M.displacementBias=R.displacementBias,M.wireframeLinewidth=R.wireframeLinewidth,M.linewidth=R.linewidth,C.isPointLight===!0&&M.isMeshDistanceMaterial===!0){const V=e.properties.get(M);V.light=C}return M}function y(P,R,C,b,M){if(P.visible===!1)return;if(P.layers.test(R.layers)&&(P.isMesh||P.isLine||P.isPoints)&&(P.castShadow||P.receiveShadow&&M===_o)&&(!P.frustumCulled||i.intersectsObject(P))){P.modelViewMatrix.multiplyMatrices(C.matrixWorldInverse,P.matrixWorld);const q=t.update(P),j=P.material;if(Array.isArray(j)){const J=q.groups;for(let W=0,k=J.length;W=1):H.indexOf("OpenGL ES")!==-1&&(k=parseFloat(/^OpenGL ES (\d)/.exec(H)[1]),W=k>=2);let ct=null,pt={};const ft=e.getParameter(e.SCISSOR_BOX),kt=e.getParameter(e.VIEWPORT),Lt=new ze().fromArray(ft),Zt=new ze().fromArray(kt);function ue(B,Dt,gt,Nt){const dt=new Uint8Array(4),lt=e.createTexture();e.bindTexture(B,lt),e.texParameteri(B,e.TEXTURE_MIN_FILTER,e.NEAREST),e.texParameteri(B,e.TEXTURE_MAG_FILTER,e.NEAREST);for(let bt=0;bt"u"?!1:/OculusBrowser/g.test(navigator.userAgent),c=new mt,u=new WeakMap;let h;const f=new WeakMap;let p=!1;try{p=typeof OffscreenCanvas<"u"&&new OffscreenCanvas(1,1).getContext("2d")!==null}catch{}function g(w,v){return p?new OffscreenCanvas(w,v):ml("canvas")}function _(w,v,N){let Y=1;const nt=it(w);if((nt.width>N||nt.height>N)&&(Y=N/Math.max(nt.width,nt.height)),Y<1)if(typeof HTMLImageElement<"u"&&w instanceof HTMLImageElement||typeof HTMLCanvasElement<"u"&&w instanceof HTMLCanvasElement||typeof ImageBitmap<"u"&&w instanceof ImageBitmap||typeof VideoFrame<"u"&&w instanceof VideoFrame){const $=Math.floor(Y*nt.width),wt=Math.floor(Y*nt.height);h===void 0&&(h=g($,wt));const ht=v?g($,wt):h;return ht.width=$,ht.height=wt,ht.getContext("2d").drawImage(w,0,0,$,wt),Yt("WebGLRenderer: Texture has been resized from ("+nt.width+"x"+nt.height+") to ("+$+"x"+wt+")."),ht}else return"data"in w&&Yt("WebGLRenderer: Image in DataTexture is too big ("+nt.width+"x"+nt.height+")."),w;return w}function m(w){return w.generateMipmaps}function d(w){e.generateMipmap(w)}function S(w){return w.isWebGLCubeRenderTarget?e.TEXTURE_CUBE_MAP:w.isWebGL3DRenderTarget?e.TEXTURE_3D:w.isWebGLArrayRenderTarget||w.isCompressedArrayTexture?e.TEXTURE_2D_ARRAY:e.TEXTURE_2D}function x(w,v,N,Y,nt=!1){if(w!==null){if(e[w]!==void 0)return e[w];Yt("WebGLRenderer: Attempt to use non-existing WebGL internal format '"+w+"'")}let $=v;if(v===e.RED&&(N===e.FLOAT&&($=e.R32F),N===e.HALF_FLOAT&&($=e.R16F),N===e.UNSIGNED_BYTE&&($=e.R8)),v===e.RED_INTEGER&&(N===e.UNSIGNED_BYTE&&($=e.R8UI),N===e.UNSIGNED_SHORT&&($=e.R16UI),N===e.UNSIGNED_INT&&($=e.R32UI),N===e.BYTE&&($=e.R8I),N===e.SHORT&&($=e.R16I),N===e.INT&&($=e.R32I)),v===e.RG&&(N===e.FLOAT&&($=e.RG32F),N===e.HALF_FLOAT&&($=e.RG16F),N===e.UNSIGNED_BYTE&&($=e.RG8)),v===e.RG_INTEGER&&(N===e.UNSIGNED_BYTE&&($=e.RG8UI),N===e.UNSIGNED_SHORT&&($=e.RG16UI),N===e.UNSIGNED_INT&&($=e.RG32UI),N===e.BYTE&&($=e.RG8I),N===e.SHORT&&($=e.RG16I),N===e.INT&&($=e.RG32I)),v===e.RGB_INTEGER&&(N===e.UNSIGNED_BYTE&&($=e.RGB8UI),N===e.UNSIGNED_SHORT&&($=e.RGB16UI),N===e.UNSIGNED_INT&&($=e.RGB32UI),N===e.BYTE&&($=e.RGB8I),N===e.SHORT&&($=e.RGB16I),N===e.INT&&($=e.RGB32I)),v===e.RGBA_INTEGER&&(N===e.UNSIGNED_BYTE&&($=e.RGBA8UI),N===e.UNSIGNED_SHORT&&($=e.RGBA16UI),N===e.UNSIGNED_INT&&($=e.RGBA32UI),N===e.BYTE&&($=e.RGBA8I),N===e.SHORT&&($=e.RGBA16I),N===e.INT&&($=e.RGBA32I)),v===e.RGB&&(N===e.UNSIGNED_INT_5_9_9_9_REV&&($=e.RGB9_E5),N===e.UNSIGNED_INT_10F_11F_11F_REV&&($=e.R11F_G11F_B10F)),v===e.RGBA){const wt=nt?dl:me.getTransfer(Y);N===e.FLOAT&&($=e.RGBA32F),N===e.HALF_FLOAT&&($=e.RGBA16F),N===e.UNSIGNED_BYTE&&($=wt===be?e.SRGB8_ALPHA8:e.RGBA8),N===e.UNSIGNED_SHORT_4_4_4_4&&($=e.RGBA4),N===e.UNSIGNED_SHORT_5_5_5_1&&($=e.RGB5_A1)}return($===e.R16F||$===e.R32F||$===e.RG16F||$===e.RG32F||$===e.RGBA16F||$===e.RGBA32F)&&t.get("EXT_color_buffer_float"),$}function y(w,v){let N;return w?v===null||v===Mi||v===Vo?N=e.DEPTH24_STENCIL8:v===mi?N=e.DEPTH32F_STENCIL8:v===zo&&(N=e.DEPTH24_STENCIL8,Yt("DepthTexture: 16 bit depth attachment is not supported with stencil. Using 24-bit attachment.")):v===null||v===Mi||v===Vo?N=e.DEPTH_COMPONENT24:v===mi?N=e.DEPTH_COMPONENT32F:v===zo&&(N=e.DEPTH_COMPONENT16),N}function T(w,v){return m(w)===!0||w.isFramebufferTexture&&w.minFilter!==rn&&w.minFilter!==fn?Math.log2(Math.max(v.width,v.height))+1:w.mipmaps!==void 0&&w.mipmaps.length>0?w.mipmaps.length:w.isCompressedTexture&&Array.isArray(w.image)?v.mipmaps.length:1}function P(w){const v=w.target;v.removeEventListener("dispose",P),C(v),v.isVideoTexture&&u.delete(v)}function R(w){const v=w.target;v.removeEventListener("dispose",R),M(v)}function C(w){const v=i.get(w);if(v.__webglInit===void 0)return;const N=w.source,Y=f.get(N);if(Y){const nt=Y[v.__cacheKey];nt.usedTimes--,nt.usedTimes===0&&b(w),Object.keys(Y).length===0&&f.delete(N)}i.remove(w)}function b(w){const v=i.get(w);e.deleteTexture(v.__webglTexture);const N=w.source,Y=f.get(N);delete Y[v.__cacheKey],o.memory.textures--}function M(w){const v=i.get(w);if(w.depthTexture&&(w.depthTexture.dispose(),i.remove(w.depthTexture)),w.isWebGLCubeRenderTarget)for(let Y=0;Y<6;Y++){if(Array.isArray(v.__webglFramebuffer[Y]))for(let nt=0;nt=r.maxTextures&&Yt("WebGLTextures: Trying to use "+w+" texture units while this GPU supports only "+r.maxTextures),L+=1,w}function j(w){const v=[];return v.push(w.wrapS),v.push(w.wrapT),v.push(w.wrapR||0),v.push(w.magFilter),v.push(w.minFilter),v.push(w.anisotropy),v.push(w.internalFormat),v.push(w.format),v.push(w.type),v.push(w.generateMipmaps),v.push(w.premultiplyAlpha),v.push(w.flipY),v.push(w.unpackAlignment),v.push(w.colorSpace),v.join()}function J(w,v){const N=i.get(w);if(w.isVideoTexture&&K(w),w.isRenderTargetTexture===!1&&w.isExternalTexture!==!0&&w.version>0&&N.__version!==w.version){const Y=w.image;if(Y===null)Yt("WebGLRenderer: Texture marked for update but no image data found.");else if(Y.complete===!1)Yt("WebGLRenderer: Texture marked for update but image is incomplete");else{st(N,w,v);return}}else w.isExternalTexture&&(N.__webglTexture=w.sourceTexture?w.sourceTexture:null);n.bindTexture(e.TEXTURE_2D,N.__webglTexture,e.TEXTURE0+v)}function W(w,v){const N=i.get(w);if(w.isRenderTargetTexture===!1&&w.version>0&&N.__version!==w.version){st(N,w,v);return}else w.isExternalTexture&&(N.__webglTexture=w.sourceTexture?w.sourceTexture:null);n.bindTexture(e.TEXTURE_2D_ARRAY,N.__webglTexture,e.TEXTURE0+v)}function k(w,v){const N=i.get(w);if(w.isRenderTargetTexture===!1&&w.version>0&&N.__version!==w.version){st(N,w,v);return}n.bindTexture(e.TEXTURE_3D,N.__webglTexture,e.TEXTURE0+v)}function H(w,v){const N=i.get(w);if(w.isCubeDepthTexture!==!0&&w.version>0&&N.__version!==w.version){ot(N,w,v);return}n.bindTexture(e.TEXTURE_CUBE_MAP,N.__webglTexture,e.TEXTURE0+v)}const ct={[yu]:e.REPEAT,[zi]:e.CLAMP_TO_EDGE,[Su]:e.MIRRORED_REPEAT},pt={[rn]:e.NEAREST,[Db]:e.NEAREST_MIPMAP_NEAREST,[ha]:e.NEAREST_MIPMAP_LINEAR,[fn]:e.LINEAR,[lc]:e.LINEAR_MIPMAP_NEAREST,[zr]:e.LINEAR_MIPMAP_LINEAR},ft={[Nb]:e.NEVER,[Bb]:e.ALWAYS,[Ub]:e.LESS,[df]:e.LEQUAL,[Ob]:e.EQUAL,[pf]:e.GEQUAL,[Fb]:e.GREATER,[kb]:e.NOTEQUAL};function kt(w,v){if(v.type===mi&&t.has("OES_texture_float_linear")===!1&&(v.magFilter===fn||v.magFilter===lc||v.magFilter===ha||v.magFilter===zr||v.minFilter===fn||v.minFilter===lc||v.minFilter===ha||v.minFilter===zr)&&Yt("WebGLRenderer: Unable to use linear filtering with floating point textures. OES_texture_float_linear not supported on this device."),e.texParameteri(w,e.TEXTURE_WRAP_S,ct[v.wrapS]),e.texParameteri(w,e.TEXTURE_WRAP_T,ct[v.wrapT]),(w===e.TEXTURE_3D||w===e.TEXTURE_2D_ARRAY)&&e.texParameteri(w,e.TEXTURE_WRAP_R,ct[v.wrapR]),e.texParameteri(w,e.TEXTURE_MAG_FILTER,pt[v.magFilter]),e.texParameteri(w,e.TEXTURE_MIN_FILTER,pt[v.minFilter]),v.compareFunction&&(e.texParameteri(w,e.TEXTURE_COMPARE_MODE,e.COMPARE_REF_TO_TEXTURE),e.texParameteri(w,e.TEXTURE_COMPARE_FUNC,ft[v.compareFunction])),t.has("EXT_texture_filter_anisotropic")===!0){if(v.magFilter===rn||v.minFilter!==ha&&v.minFilter!==zr||v.type===mi&&t.has("OES_texture_float_linear")===!1)return;if(v.anisotropy>1||i.get(v).__currentAnisotropy){const N=t.get("EXT_texture_filter_anisotropic");e.texParameterf(w,N.TEXTURE_MAX_ANISOTROPY_EXT,Math.min(v.anisotropy,r.getMaxAnisotropy())),i.get(v).__currentAnisotropy=v.anisotropy}}}function Lt(w,v){let N=!1;w.__webglInit===void 0&&(w.__webglInit=!0,v.addEventListener("dispose",P));const Y=v.source;let nt=f.get(Y);nt===void 0&&(nt={},f.set(Y,nt));const $=j(v);if($!==w.__cacheKey){nt[$]===void 0&&(nt[$]={texture:e.createTexture(),usedTimes:0},o.memory.textures++,N=!0),nt[$].usedTimes++;const wt=nt[w.__cacheKey];wt!==void 0&&(nt[w.__cacheKey].usedTimes--,wt.usedTimes===0&&b(v)),w.__cacheKey=$,w.__webglTexture=nt[$].texture}return N}function Zt(w,v,N){return Math.floor(Math.floor(w/N)/v)}function ue(w,v,N,Y){const $=w.updateRanges;if($.length===0)n.texSubImage2D(e.TEXTURE_2D,0,0,0,v.width,v.height,N,Y,v.data);else{$.sort((ut,St)=>ut.start-St.start);let wt=0;for(let ut=1;ut<$.length;ut++){const St=$[wt],Et=$[ut],It=St.start+St.count,yt=Zt(Et.start,v.width,4),ee=Zt(St.start,v.width,4);Et.start<=It+1&&yt===ee&&Zt(Et.start+Et.count-1,v.width,4)===yt?St.count=Math.max(St.count,Et.start+Et.count-St.start):(++wt,$[wt]=Et)}$.length=wt+1;const ht=e.getParameter(e.UNPACK_ROW_LENGTH),Ct=e.getParameter(e.UNPACK_SKIP_PIXELS),zt=e.getParameter(e.UNPACK_SKIP_ROWS);e.pixelStorei(e.UNPACK_ROW_LENGTH,v.width);for(let ut=0,St=$.length;ut0){B&&Dt&&n.texStorage2D(e.TEXTURE_2D,Nt,It,ee[0].width,ee[0].height);for(let dt=0,lt=ee.length;dt0){const bt=um(yt.width,yt.height,v.format,v.type);for(const Qt of v.layerUpdates){const Ce=yt.data.subarray(Qt*bt/yt.data.BYTES_PER_ELEMENT,(Qt+1)*bt/yt.data.BYTES_PER_ELEMENT);n.compressedTexSubImage3D(e.TEXTURE_2D_ARRAY,dt,0,0,Qt,yt.width,yt.height,1,St,Ce)}v.clearLayerUpdates()}else n.compressedTexSubImage3D(e.TEXTURE_2D_ARRAY,dt,0,0,0,yt.width,yt.height,ut.depth,St,yt.data)}else n.compressedTexImage3D(e.TEXTURE_2D_ARRAY,dt,It,yt.width,yt.height,ut.depth,0,yt.data,0,0);else Yt("WebGLRenderer: Attempt to load unsupported compressed texture format in .uploadTexture()");else B?gt&&n.texSubImage3D(e.TEXTURE_2D_ARRAY,dt,0,0,0,yt.width,yt.height,ut.depth,St,Et,yt.data):n.texImage3D(e.TEXTURE_2D_ARRAY,dt,It,yt.width,yt.height,ut.depth,0,St,Et,yt.data)}else{B&&Dt&&n.texStorage2D(e.TEXTURE_2D,Nt,It,ee[0].width,ee[0].height);for(let dt=0,lt=ee.length;dt0){const dt=um(ut.width,ut.height,v.format,v.type);for(const lt of v.layerUpdates){const bt=ut.data.subarray(lt*dt/ut.data.BYTES_PER_ELEMENT,(lt+1)*dt/ut.data.BYTES_PER_ELEMENT);n.texSubImage3D(e.TEXTURE_2D_ARRAY,0,0,0,lt,ut.width,ut.height,1,St,Et,bt)}v.clearLayerUpdates()}else n.texSubImage3D(e.TEXTURE_2D_ARRAY,0,0,0,0,ut.width,ut.height,ut.depth,St,Et,ut.data)}else n.texImage3D(e.TEXTURE_2D_ARRAY,0,It,ut.width,ut.height,ut.depth,0,St,Et,ut.data);else if(v.isData3DTexture)B?(Dt&&n.texStorage3D(e.TEXTURE_3D,Nt,It,ut.width,ut.height,ut.depth),gt&&n.texSubImage3D(e.TEXTURE_3D,0,0,0,0,ut.width,ut.height,ut.depth,St,Et,ut.data)):n.texImage3D(e.TEXTURE_3D,0,It,ut.width,ut.height,ut.depth,0,St,Et,ut.data);else if(v.isFramebufferTexture){if(Dt)if(B)n.texStorage2D(e.TEXTURE_2D,Nt,It,ut.width,ut.height);else{let dt=ut.width,lt=ut.height;for(let bt=0;bt>=1,lt>>=1}}else if(ee.length>0){if(B&&Dt){const dt=it(ee[0]);n.texStorage2D(e.TEXTURE_2D,Nt,It,dt.width,dt.height)}for(let dt=0,lt=ee.length;dt0&&Nt++;const lt=it(St[0]);n.texStorage2D(e.TEXTURE_CUBE_MAP,Nt,ee,lt.width,lt.height)}for(let lt=0;lt<6;lt++)if(ut){B?gt&&n.texSubImage2D(e.TEXTURE_CUBE_MAP_POSITIVE_X+lt,0,0,0,St[lt].width,St[lt].height,It,yt,St[lt].data):n.texImage2D(e.TEXTURE_CUBE_MAP_POSITIVE_X+lt,0,ee,St[lt].width,St[lt].height,0,It,yt,St[lt].data);for(let bt=0;bt>$),Et=Math.max(1,v.height>>$);nt===e.TEXTURE_3D||nt===e.TEXTURE_2D_ARRAY?n.texImage3D(nt,$,Ct,St,Et,v.depth,0,wt,ht,null):n.texImage2D(nt,$,Ct,St,Et,0,wt,ht,null)}n.bindFramebuffer(e.FRAMEBUFFER,w),rt(v)?a.framebufferTexture2DMultisampleEXT(e.FRAMEBUFFER,Y,nt,ut.__webglTexture,0,E(v)):(nt===e.TEXTURE_2D||nt>=e.TEXTURE_CUBE_MAP_POSITIVE_X&&nt<=e.TEXTURE_CUBE_MAP_NEGATIVE_Z)&&e.framebufferTexture2D(e.FRAMEBUFFER,Y,nt,ut.__webglTexture,$),n.bindFramebuffer(e.FRAMEBUFFER,null)}function Vt(w,v,N){if(e.bindRenderbuffer(e.RENDERBUFFER,w),v.depthBuffer){const Y=v.depthTexture,nt=Y&&Y.isDepthTexture?Y.type:null,$=y(v.stencilBuffer,nt),wt=v.stencilBuffer?e.DEPTH_STENCIL_ATTACHMENT:e.DEPTH_ATTACHMENT;rt(v)?a.renderbufferStorageMultisampleEXT(e.RENDERBUFFER,E(v),$,v.width,v.height):N?e.renderbufferStorageMultisample(e.RENDERBUFFER,E(v),$,v.width,v.height):e.renderbufferStorage(e.RENDERBUFFER,$,v.width,v.height),e.framebufferRenderbuffer(e.FRAMEBUFFER,wt,e.RENDERBUFFER,w)}else{const Y=v.textures;for(let nt=0;nt{delete v.__boundDepthTexture,delete v.__depthDisposeCallback,Y.removeEventListener("dispose",nt)};Y.addEventListener("dispose",nt),v.__depthDisposeCallback=nt}v.__boundDepthTexture=Y}if(w.depthTexture&&!v.__autoAllocateDepthBuffer)if(N)for(let Y=0;Y<6;Y++)Mt(v.__webglFramebuffer[Y],w,Y);else{const Y=w.texture.mipmaps;Y&&Y.length>0?Mt(v.__webglFramebuffer[0],w,0):Mt(v.__webglFramebuffer,w,0)}else if(N){v.__webglDepthbuffer=[];for(let Y=0;Y<6;Y++)if(n.bindFramebuffer(e.FRAMEBUFFER,v.__webglFramebuffer[Y]),v.__webglDepthbuffer[Y]===void 0)v.__webglDepthbuffer[Y]=e.createRenderbuffer(),Vt(v.__webglDepthbuffer[Y],w,!1);else{const nt=w.stencilBuffer?e.DEPTH_STENCIL_ATTACHMENT:e.DEPTH_ATTACHMENT,$=v.__webglDepthbuffer[Y];e.bindRenderbuffer(e.RENDERBUFFER,$),e.framebufferRenderbuffer(e.FRAMEBUFFER,nt,e.RENDERBUFFER,$)}}else{const Y=w.texture.mipmaps;if(Y&&Y.length>0?n.bindFramebuffer(e.FRAMEBUFFER,v.__webglFramebuffer[0]):n.bindFramebuffer(e.FRAMEBUFFER,v.__webglFramebuffer),v.__webglDepthbuffer===void 0)v.__webglDepthbuffer=e.createRenderbuffer(),Vt(v.__webglDepthbuffer,w,!1);else{const nt=w.stencilBuffer?e.DEPTH_STENCIL_ATTACHMENT:e.DEPTH_ATTACHMENT,$=v.__webglDepthbuffer;e.bindRenderbuffer(e.RENDERBUFFER,$),e.framebufferRenderbuffer(e.FRAMEBUFFER,nt,e.RENDERBUFFER,$)}}n.bindFramebuffer(e.FRAMEBUFFER,null)}function I(w,v,N){const Y=i.get(w);v!==void 0&&Pt(Y.__webglFramebuffer,w,w.texture,e.COLOR_ATTACHMENT0,e.TEXTURE_2D,0),N!==void 0&&oe(w)}function O(w){const v=w.texture,N=i.get(w),Y=i.get(v);w.addEventListener("dispose",R);const nt=w.textures,$=w.isWebGLCubeRenderTarget===!0,wt=nt.length>1;if(wt||(Y.__webglTexture===void 0&&(Y.__webglTexture=e.createTexture()),Y.__version=v.version,o.memory.textures++),$){N.__webglFramebuffer=[];for(let ht=0;ht<6;ht++)if(v.mipmaps&&v.mipmaps.length>0){N.__webglFramebuffer[ht]=[];for(let Ct=0;Ct0){N.__webglFramebuffer=[];for(let ht=0;ht0&&rt(w)===!1){N.__webglMultisampledFramebuffer=e.createFramebuffer(),N.__webglColorRenderbuffer=[],n.bindFramebuffer(e.FRAMEBUFFER,N.__webglMultisampledFramebuffer);for(let ht=0;ht0)for(let Ct=0;Ct0)for(let Ct=0;Ct0){if(rt(w)===!1){const v=w.textures,N=w.width,Y=w.height;let nt=e.COLOR_BUFFER_BIT;const $=w.stencilBuffer?e.DEPTH_STENCIL_ATTACHMENT:e.DEPTH_ATTACHMENT,wt=i.get(w),ht=v.length>1;if(ht)for(let zt=0;zt0?n.bindFramebuffer(e.DRAW_FRAMEBUFFER,wt.__webglFramebuffer[0]):n.bindFramebuffer(e.DRAW_FRAMEBUFFER,wt.__webglFramebuffer);for(let zt=0;zt0&&t.has("WEBGL_multisampled_render_to_texture")===!0&&v.__useRenderToTexture!==!1}function K(w){const v=o.render.frame;u.get(w)!==v&&(u.set(w,v),w.update())}function Q(w,v){const N=w.colorSpace,Y=w.format,nt=w.type;return w.isCompressedTexture===!0||w.isVideoTexture===!0||N!==zs&&N!==hr&&(me.getTransfer(N)===be?(Y!==Qn||nt!==kn)&&Yt("WebGLTextures: sRGB encoded textures have to use RGBAFormat and UnsignedByteType."):de("WebGLTextures: Unsupported texture color space:",N)),v}function it(w){return typeof HTMLImageElement<"u"&&w instanceof HTMLImageElement?(c.width=w.naturalWidth||w.width,c.height=w.naturalHeight||w.height):typeof VideoFrame<"u"&&w instanceof VideoFrame?(c.width=w.displayWidth,c.height=w.displayHeight):(c.width=w.width,c.height=w.height),c}this.allocateTextureUnit=q,this.resetTextureUnits=V,this.setTexture2D=J,this.setTexture2DArray=W,this.setTexture3D=k,this.setTextureCube=H,this.rebindTextures=I,this.setupRenderTarget=O,this.updateRenderTargetMipmap=U,this.updateMultisampleRenderTarget=X,this.setupDepthRenderbuffer=oe,this.setupFrameBufferTexture=Pt,this.useMultisampledRTT=rt,this.isReversedDepthBuffer=function(){return n.buffers.depth.getReversed()}}function gP(e,t){function n(i,r=hr){let s;const o=me.getTransfer(r);if(i===kn)return e.UNSIGNED_BYTE;if(i===lf)return e.UNSIGNED_SHORT_4_4_4_4;if(i===cf)return e.UNSIGNED_SHORT_5_5_5_1;if(i===G0)return e.UNSIGNED_INT_5_9_9_9_REV;if(i===W0)return e.UNSIGNED_INT_10F_11F_11F_REV;if(i===V0)return e.BYTE;if(i===H0)return e.SHORT;if(i===zo)return e.UNSIGNED_SHORT;if(i===af)return e.INT;if(i===Mi)return e.UNSIGNED_INT;if(i===mi)return e.FLOAT;if(i===Yi)return e.HALF_FLOAT;if(i===X0)return e.ALPHA;if(i===q0)return e.RGB;if(i===Qn)return e.RGBA;if(i===Ji)return e.DEPTH_COMPONENT;if(i===Vr)return e.DEPTH_STENCIL;if(i===Y0)return e.RED;if(i===uf)return e.RED_INTEGER;if(i===Bs)return e.RG;if(i===hf)return e.RG_INTEGER;if(i===ff)return e.RGBA_INTEGER;if(i===Ka||i===Qa||i===ja||i===tl)if(o===be)if(s=t.get("WEBGL_compressed_texture_s3tc_srgb"),s!==null){if(i===Ka)return s.COMPRESSED_SRGB_S3TC_DXT1_EXT;if(i===Qa)return s.COMPRESSED_SRGB_ALPHA_S3TC_DXT1_EXT;if(i===ja)return s.COMPRESSED_SRGB_ALPHA_S3TC_DXT3_EXT;if(i===tl)return s.COMPRESSED_SRGB_ALPHA_S3TC_DXT5_EXT}else return null;else if(s=t.get("WEBGL_compressed_texture_s3tc"),s!==null){if(i===Ka)return s.COMPRESSED_RGB_S3TC_DXT1_EXT;if(i===Qa)return s.COMPRESSED_RGBA_S3TC_DXT1_EXT;if(i===ja)return s.COMPRESSED_RGBA_S3TC_DXT3_EXT;if(i===tl)return s.COMPRESSED_RGBA_S3TC_DXT5_EXT}else return null;if(i===bu||i===Mu||i===wu||i===Eu)if(s=t.get("WEBGL_compressed_texture_pvrtc"),s!==null){if(i===bu)return s.COMPRESSED_RGB_PVRTC_4BPPV1_IMG;if(i===Mu)return s.COMPRESSED_RGB_PVRTC_2BPPV1_IMG;if(i===wu)return s.COMPRESSED_RGBA_PVRTC_4BPPV1_IMG;if(i===Eu)return s.COMPRESSED_RGBA_PVRTC_2BPPV1_IMG}else return null;if(i===Tu||i===Au||i===Pu||i===Cu||i===Ru||i===Du||i===Iu)if(s=t.get("WEBGL_compressed_texture_etc"),s!==null){if(i===Tu||i===Au)return o===be?s.COMPRESSED_SRGB8_ETC2:s.COMPRESSED_RGB8_ETC2;if(i===Pu)return o===be?s.COMPRESSED_SRGB8_ALPHA8_ETC2_EAC:s.COMPRESSED_RGBA8_ETC2_EAC;if(i===Cu)return s.COMPRESSED_R11_EAC;if(i===Ru)return s.COMPRESSED_SIGNED_R11_EAC;if(i===Du)return s.COMPRESSED_RG11_EAC;if(i===Iu)return s.COMPRESSED_SIGNED_RG11_EAC}else return null;if(i===Lu||i===Nu||i===Uu||i===Ou||i===Fu||i===ku||i===Bu||i===zu||i===Vu||i===Hu||i===Gu||i===Wu||i===Xu||i===qu)if(s=t.get("WEBGL_compressed_texture_astc"),s!==null){if(i===Lu)return o===be?s.COMPRESSED_SRGB8_ALPHA8_ASTC_4x4_KHR:s.COMPRESSED_RGBA_ASTC_4x4_KHR;if(i===Nu)return o===be?s.COMPRESSED_SRGB8_ALPHA8_ASTC_5x4_KHR:s.COMPRESSED_RGBA_ASTC_5x4_KHR;if(i===Uu)return o===be?s.COMPRESSED_SRGB8_ALPHA8_ASTC_5x5_KHR:s.COMPRESSED_RGBA_ASTC_5x5_KHR;if(i===Ou)return o===be?s.COMPRESSED_SRGB8_ALPHA8_ASTC_6x5_KHR:s.COMPRESSED_RGBA_ASTC_6x5_KHR;if(i===Fu)return o===be?s.COMPRESSED_SRGB8_ALPHA8_ASTC_6x6_KHR:s.COMPRESSED_RGBA_ASTC_6x6_KHR;if(i===ku)return o===be?s.COMPRESSED_SRGB8_ALPHA8_ASTC_8x5_KHR:s.COMPRESSED_RGBA_ASTC_8x5_KHR;if(i===Bu)return o===be?s.COMPRESSED_SRGB8_ALPHA8_ASTC_8x6_KHR:s.COMPRESSED_RGBA_ASTC_8x6_KHR;if(i===zu)return o===be?s.COMPRESSED_SRGB8_ALPHA8_ASTC_8x8_KHR:s.COMPRESSED_RGBA_ASTC_8x8_KHR;if(i===Vu)return o===be?s.COMPRESSED_SRGB8_ALPHA8_ASTC_10x5_KHR:s.COMPRESSED_RGBA_ASTC_10x5_KHR;if(i===Hu)return o===be?s.COMPRESSED_SRGB8_ALPHA8_ASTC_10x6_KHR:s.COMPRESSED_RGBA_ASTC_10x6_KHR;if(i===Gu)return o===be?s.COMPRESSED_SRGB8_ALPHA8_ASTC_10x8_KHR:s.COMPRESSED_RGBA_ASTC_10x8_KHR;if(i===Wu)return o===be?s.COMPRESSED_SRGB8_ALPHA8_ASTC_10x10_KHR:s.COMPRESSED_RGBA_ASTC_10x10_KHR;if(i===Xu)return o===be?s.COMPRESSED_SRGB8_ALPHA8_ASTC_12x10_KHR:s.COMPRESSED_RGBA_ASTC_12x10_KHR;if(i===qu)return o===be?s.COMPRESSED_SRGB8_ALPHA8_ASTC_12x12_KHR:s.COMPRESSED_RGBA_ASTC_12x12_KHR}else return null;if(i===Yu||i===Ju||i===$u)if(s=t.get("EXT_texture_compression_bptc"),s!==null){if(i===Yu)return o===be?s.COMPRESSED_SRGB_ALPHA_BPTC_UNORM_EXT:s.COMPRESSED_RGBA_BPTC_UNORM_EXT;if(i===Ju)return s.COMPRESSED_RGB_BPTC_SIGNED_FLOAT_EXT;if(i===$u)return s.COMPRESSED_RGB_BPTC_UNSIGNED_FLOAT_EXT}else return null;if(i===Zu||i===Ku||i===Qu||i===ju)if(s=t.get("EXT_texture_compression_rgtc"),s!==null){if(i===Zu)return s.COMPRESSED_RED_RGTC1_EXT;if(i===Ku)return s.COMPRESSED_SIGNED_RED_RGTC1_EXT;if(i===Qu)return s.COMPRESSED_RED_GREEN_RGTC2_EXT;if(i===ju)return s.COMPRESSED_SIGNED_RED_GREEN_RGTC2_EXT}else return null;return i===Vo?e.UNSIGNED_INT_24_8:e[i]!==void 0?e[i]:null}return{convert:n}}const _P=` void main() { gl_Position = vec4( position, 1.0 ); @@ -4008,7 +4008,7 @@ void main() { } -}`;class xP{constructor(){this.texture=null,this.mesh=null,this.depthNear=0,this.depthFar=0}init(t,n){if(this.texture===null){const i=new o_(t.texture);(t.depthNear!==n.depthNear||t.depthFar!==n.depthFar)&&(this.depthNear=t.depthNear,this.depthFar=t.depthFar),this.texture=i}}getMesh(t){if(this.texture!==null&&this.mesh===null){const n=t.cameras[0].viewport,i=new ii({vertexShader:_P,fragmentShader:vP,uniforms:{depthColor:{value:this.texture},depthWidth:{value:n.z},depthHeight:{value:n.w}}});this.mesh=new _t(new ta(20,20),i)}return this.mesh}reset(){this.texture=null,this.mesh=null}getDepthTexture(){return this.texture}}class yP extends jr{constructor(t,n){super();const i=this;let r=null,s=1,o=null,a="local-floor",l=1,c=null,u=null,h=null,f=null,p=null,g=null;const v=typeof XRWebGLBinding<"u",m=new xP,d={},S=n.getContextAttributes();let y=null,x=null;const A=[],P=[],C=new mt;let R=null;const b=new Pn;b.viewport=new ze;const M=new Pn;M.viewport=new ze;const L=[b,M],V=new Ew;let q=null,j=null;this.cameraAutoUpdate=!0,this.enabled=!1,this.isPresenting=!1,this.getController=function(st){let ot=A[st];return ot===void 0&&(ot=new Pc,A[st]=ot),ot.getTargetRaySpace()},this.getControllerGrip=function(st){let ot=A[st];return ot===void 0&&(ot=new Pc,A[st]=ot),ot.getGripSpace()},this.getHand=function(st){let ot=A[st];return ot===void 0&&(ot=new Pc,A[st]=ot),ot.getHandSpace()};function J(st){const ot=P.indexOf(st.inputSource);if(ot===-1)return;const Pt=A[ot];Pt!==void 0&&(Pt.update(st.inputSource,st.frame,c||o),Pt.dispatchEvent({type:st.type,data:st.inputSource}))}function W(){r.removeEventListener("select",J),r.removeEventListener("selectstart",J),r.removeEventListener("selectend",J),r.removeEventListener("squeeze",J),r.removeEventListener("squeezestart",J),r.removeEventListener("squeezeend",J),r.removeEventListener("end",W),r.removeEventListener("inputsourceschange",k);for(let st=0;st=0&&(P[Vt]=null,A[Vt].disconnect(Pt))}for(let ot=0;ot=P.length){P.push(Pt),Vt=oe;break}else if(P[oe]===null){P[oe]=Pt,Vt=oe;break}if(Vt===-1)break}const Mt=A[Vt];Mt&&Mt.connect(Pt)}}const H=new D,ct=new D;function pt(st,ot,Pt){H.setFromMatrixPosition(ot.matrixWorld),ct.setFromMatrixPosition(Pt.matrixWorld);const Vt=H.distanceTo(ct),Mt=ot.projectionMatrix.elements,oe=Pt.projectionMatrix.elements,I=Mt[14]/(Mt[10]-1),O=Mt[14]/(Mt[10]+1),U=(Mt[9]+1)/Mt[5],z=(Mt[9]-1)/Mt[5],F=(Mt[8]-1)/Mt[0],X=(oe[8]+1)/oe[0],E=I*F,rt=I*X,K=Vt/(-F+X),Q=K*-F;if(ot.matrixWorld.decompose(st.position,st.quaternion,st.scale),st.translateX(Q),st.translateZ(K),st.matrixWorld.compose(st.position,st.quaternion,st.scale),st.matrixWorldInverse.copy(st.matrixWorld).invert(),Mt[10]===-1)st.projectionMatrix.copy(ot.projectionMatrix),st.projectionMatrixInverse.copy(ot.projectionMatrixInverse);else{const it=I+K,w=O+K,_=E-Q,N=rt+(Vt-Q),Y=U*O/w*it,nt=z*O/w*it;st.projectionMatrix.makePerspective(_,N,Y,nt,it,w),st.projectionMatrixInverse.copy(st.projectionMatrix).invert()}}function ft(st,ot){ot===null?st.matrixWorld.copy(st.matrix):st.matrixWorld.multiplyMatrices(ot.matrixWorld,st.matrix),st.matrixWorldInverse.copy(st.matrixWorld).invert()}this.updateCamera=function(st){if(r===null)return;let ot=st.near,Pt=st.far;m.texture!==null&&(m.depthNear>0&&(ot=m.depthNear),m.depthFar>0&&(Pt=m.depthFar)),V.near=M.near=b.near=ot,V.far=M.far=b.far=Pt,(q!==V.near||j!==V.far)&&(r.updateRenderState({depthNear:V.near,depthFar:V.far}),q=V.near,j=V.far),V.layers.mask=st.layers.mask|6,b.layers.mask=V.layers.mask&3,M.layers.mask=V.layers.mask&5;const Vt=st.parent,Mt=V.cameras;ft(V,Vt);for(let oe=0;oe0&&(m.alphaTest.value=d.alphaTest);const S=t.get(d),y=S.envMap,x=S.envMapRotation;y&&(m.envMap.value=y,Lr.copy(x),Lr.x*=-1,Lr.y*=-1,Lr.z*=-1,y.isCubeTexture&&y.isRenderTargetTexture===!1&&(Lr.y*=-1,Lr.z*=-1),m.envMapRotation.value.setFromMatrix4(SP.makeRotationFromEuler(Lr)),m.flipEnvMap.value=y.isCubeTexture&&y.isRenderTargetTexture===!1?-1:1,m.reflectivity.value=d.reflectivity,m.ior.value=d.ior,m.refractionRatio.value=d.refractionRatio),d.lightMap&&(m.lightMap.value=d.lightMap,m.lightMapIntensity.value=d.lightMapIntensity,n(d.lightMap,m.lightMapTransform)),d.aoMap&&(m.aoMap.value=d.aoMap,m.aoMapIntensity.value=d.aoMapIntensity,n(d.aoMap,m.aoMapTransform))}function o(m,d){m.diffuse.value.copy(d.color),m.opacity.value=d.opacity,d.map&&(m.map.value=d.map,n(d.map,m.mapTransform))}function a(m,d){m.dashSize.value=d.dashSize,m.totalSize.value=d.dashSize+d.gapSize,m.scale.value=d.scale}function l(m,d,S,y){m.diffuse.value.copy(d.color),m.opacity.value=d.opacity,m.size.value=d.size*S,m.scale.value=y*.5,d.map&&(m.map.value=d.map,n(d.map,m.uvTransform)),d.alphaMap&&(m.alphaMap.value=d.alphaMap,n(d.alphaMap,m.alphaMapTransform)),d.alphaTest>0&&(m.alphaTest.value=d.alphaTest)}function c(m,d){m.diffuse.value.copy(d.color),m.opacity.value=d.opacity,m.rotation.value=d.rotation,d.map&&(m.map.value=d.map,n(d.map,m.mapTransform)),d.alphaMap&&(m.alphaMap.value=d.alphaMap,n(d.alphaMap,m.alphaMapTransform)),d.alphaTest>0&&(m.alphaTest.value=d.alphaTest)}function u(m,d){m.specular.value.copy(d.specular),m.shininess.value=Math.max(d.shininess,1e-4)}function h(m,d){d.gradientMap&&(m.gradientMap.value=d.gradientMap)}function f(m,d){m.metalness.value=d.metalness,d.metalnessMap&&(m.metalnessMap.value=d.metalnessMap,n(d.metalnessMap,m.metalnessMapTransform)),m.roughness.value=d.roughness,d.roughnessMap&&(m.roughnessMap.value=d.roughnessMap,n(d.roughnessMap,m.roughnessMapTransform)),d.envMap&&(m.envMapIntensity.value=d.envMapIntensity)}function p(m,d,S){m.ior.value=d.ior,d.sheen>0&&(m.sheenColor.value.copy(d.sheenColor).multiplyScalar(d.sheen),m.sheenRoughness.value=d.sheenRoughness,d.sheenColorMap&&(m.sheenColorMap.value=d.sheenColorMap,n(d.sheenColorMap,m.sheenColorMapTransform)),d.sheenRoughnessMap&&(m.sheenRoughnessMap.value=d.sheenRoughnessMap,n(d.sheenRoughnessMap,m.sheenRoughnessMapTransform))),d.clearcoat>0&&(m.clearcoat.value=d.clearcoat,m.clearcoatRoughness.value=d.clearcoatRoughness,d.clearcoatMap&&(m.clearcoatMap.value=d.clearcoatMap,n(d.clearcoatMap,m.clearcoatMapTransform)),d.clearcoatRoughnessMap&&(m.clearcoatRoughnessMap.value=d.clearcoatRoughnessMap,n(d.clearcoatRoughnessMap,m.clearcoatRoughnessMapTransform)),d.clearcoatNormalMap&&(m.clearcoatNormalMap.value=d.clearcoatNormalMap,n(d.clearcoatNormalMap,m.clearcoatNormalMapTransform),m.clearcoatNormalScale.value.copy(d.clearcoatNormalScale),d.side===dn&&m.clearcoatNormalScale.value.negate())),d.dispersion>0&&(m.dispersion.value=d.dispersion),d.iridescence>0&&(m.iridescence.value=d.iridescence,m.iridescenceIOR.value=d.iridescenceIOR,m.iridescenceThicknessMinimum.value=d.iridescenceThicknessRange[0],m.iridescenceThicknessMaximum.value=d.iridescenceThicknessRange[1],d.iridescenceMap&&(m.iridescenceMap.value=d.iridescenceMap,n(d.iridescenceMap,m.iridescenceMapTransform)),d.iridescenceThicknessMap&&(m.iridescenceThicknessMap.value=d.iridescenceThicknessMap,n(d.iridescenceThicknessMap,m.iridescenceThicknessMapTransform))),d.transmission>0&&(m.transmission.value=d.transmission,m.transmissionSamplerMap.value=S.texture,m.transmissionSamplerSize.value.set(S.width,S.height),d.transmissionMap&&(m.transmissionMap.value=d.transmissionMap,n(d.transmissionMap,m.transmissionMapTransform)),m.thickness.value=d.thickness,d.thicknessMap&&(m.thicknessMap.value=d.thicknessMap,n(d.thicknessMap,m.thicknessMapTransform)),m.attenuationDistance.value=d.attenuationDistance,m.attenuationColor.value.copy(d.attenuationColor)),d.anisotropy>0&&(m.anisotropyVector.value.set(d.anisotropy*Math.cos(d.anisotropyRotation),d.anisotropy*Math.sin(d.anisotropyRotation)),d.anisotropyMap&&(m.anisotropyMap.value=d.anisotropyMap,n(d.anisotropyMap,m.anisotropyMapTransform))),m.specularIntensity.value=d.specularIntensity,m.specularColor.value.copy(d.specularColor),d.specularColorMap&&(m.specularColorMap.value=d.specularColorMap,n(d.specularColorMap,m.specularColorMapTransform)),d.specularIntensityMap&&(m.specularIntensityMap.value=d.specularIntensityMap,n(d.specularIntensityMap,m.specularIntensityMapTransform))}function g(m,d){d.matcap&&(m.matcap.value=d.matcap)}function v(m,d){const S=t.get(d).light;m.referencePosition.value.setFromMatrixPosition(S.matrixWorld),m.nearDistance.value=S.shadow.camera.near,m.farDistance.value=S.shadow.camera.far}return{refreshFogUniforms:i,refreshMaterialUniforms:r}}function MP(e,t,n,i){let r={},s={},o=[];const a=e.getParameter(e.MAX_UNIFORM_BUFFER_BINDINGS);function l(S,y){const x=y.program;i.uniformBlockBinding(S,x)}function c(S,y){let x=r[S.id];x===void 0&&(g(S),x=u(S),r[S.id]=x,S.addEventListener("dispose",m));const A=y.program;i.updateUBOMapping(S,A);const P=t.render.frame;s[S.id]!==P&&(f(S),s[S.id]=P)}function u(S){const y=h();S.__bindingPointIndex=y;const x=e.createBuffer(),A=S.__size,P=S.usage;return e.bindBuffer(e.UNIFORM_BUFFER,x),e.bufferData(e.UNIFORM_BUFFER,A,P),e.bindBuffer(e.UNIFORM_BUFFER,null),e.bindBufferBase(e.UNIFORM_BUFFER,y,x),x}function h(){for(let S=0;S0&&(x+=A-P),S.__size=x,S.__cache={},this}function v(S){const y={boundary:0,storage:0};return typeof S=="number"||typeof S=="boolean"?(y.boundary=4,y.storage=4):S.isVector2?(y.boundary=8,y.storage=8):S.isVector3||S.isColor?(y.boundary=16,y.storage=12):S.isVector4?(y.boundary=16,y.storage=16):S.isMatrix3?(y.boundary=48,y.storage=48):S.isMatrix4?(y.boundary=64,y.storage=64):S.isTexture?Yt("WebGLRenderer: Texture samplers can not be part of an uniforms group."):Yt("WebGLRenderer: Unsupported uniform value type.",S),y}function m(S){const y=S.target;y.removeEventListener("dispose",m);const x=o.indexOf(y.__bindingPointIndex);o.splice(x,1),e.deleteBuffer(r[y.id]),delete r[y.id],delete s[y.id]}function d(){for(const S in r)e.deleteBuffer(r[S]);o=[],r={},s={}}return{bind:l,update:c,dispose:d}}const wP=new Uint16Array([12469,15057,12620,14925,13266,14620,13807,14376,14323,13990,14545,13625,14713,13328,14840,12882,14931,12528,14996,12233,15039,11829,15066,11525,15080,11295,15085,10976,15082,10705,15073,10495,13880,14564,13898,14542,13977,14430,14158,14124,14393,13732,14556,13410,14702,12996,14814,12596,14891,12291,14937,11834,14957,11489,14958,11194,14943,10803,14921,10506,14893,10278,14858,9960,14484,14039,14487,14025,14499,13941,14524,13740,14574,13468,14654,13106,14743,12678,14818,12344,14867,11893,14889,11509,14893,11180,14881,10751,14852,10428,14812,10128,14765,9754,14712,9466,14764,13480,14764,13475,14766,13440,14766,13347,14769,13070,14786,12713,14816,12387,14844,11957,14860,11549,14868,11215,14855,10751,14825,10403,14782,10044,14729,9651,14666,9352,14599,9029,14967,12835,14966,12831,14963,12804,14954,12723,14936,12564,14917,12347,14900,11958,14886,11569,14878,11247,14859,10765,14828,10401,14784,10011,14727,9600,14660,9289,14586,8893,14508,8533,15111,12234,15110,12234,15104,12216,15092,12156,15067,12010,15028,11776,14981,11500,14942,11205,14902,10752,14861,10393,14812,9991,14752,9570,14682,9252,14603,8808,14519,8445,14431,8145,15209,11449,15208,11451,15202,11451,15190,11438,15163,11384,15117,11274,15055,10979,14994,10648,14932,10343,14871,9936,14803,9532,14729,9218,14645,8742,14556,8381,14461,8020,14365,7603,15273,10603,15272,10607,15267,10619,15256,10631,15231,10614,15182,10535,15118,10389,15042,10167,14963,9787,14883,9447,14800,9115,14710,8665,14615,8318,14514,7911,14411,7507,14279,7198,15314,9675,15313,9683,15309,9712,15298,9759,15277,9797,15229,9773,15166,9668,15084,9487,14995,9274,14898,8910,14800,8539,14697,8234,14590,7790,14479,7409,14367,7067,14178,6621,15337,8619,15337,8631,15333,8677,15325,8769,15305,8871,15264,8940,15202,8909,15119,8775,15022,8565,14916,8328,14804,8009,14688,7614,14569,7287,14448,6888,14321,6483,14088,6171,15350,7402,15350,7419,15347,7480,15340,7613,15322,7804,15287,7973,15229,8057,15148,8012,15046,7846,14933,7611,14810,7357,14682,7069,14552,6656,14421,6316,14251,5948,14007,5528,15356,5942,15356,5977,15353,6119,15348,6294,15332,6551,15302,6824,15249,7044,15171,7122,15070,7050,14949,6861,14818,6611,14679,6349,14538,6067,14398,5651,14189,5311,13935,4958,15359,4123,15359,4153,15356,4296,15353,4646,15338,5160,15311,5508,15263,5829,15188,6042,15088,6094,14966,6001,14826,5796,14678,5543,14527,5287,14377,4985,14133,4586,13869,4257,15360,1563,15360,1642,15358,2076,15354,2636,15341,3350,15317,4019,15273,4429,15203,4732,15105,4911,14981,4932,14836,4818,14679,4621,14517,4386,14359,4156,14083,3795,13808,3437,15360,122,15360,137,15358,285,15355,636,15344,1274,15322,2177,15281,2765,15215,3223,15120,3451,14995,3569,14846,3567,14681,3466,14511,3305,14344,3121,14037,2800,13753,2467,15360,0,15360,1,15359,21,15355,89,15346,253,15325,479,15287,796,15225,1148,15133,1492,15008,1749,14856,1882,14685,1886,14506,1783,14324,1608,13996,1398,13702,1183]);let li=null;function EP(){return li===null&&(li=new AM(wP,16,16,Bs,Yi),li.name="DFG_LUT",li.minFilter=fn,li.magFilter=fn,li.wrapS=zi,li.wrapT=zi,li.generateMipmaps=!1,li.needsUpdate=!0),li}class TP{constructor(t={}){const{canvas:n=zb(),context:i=null,depth:r=!0,stencil:s=!1,alpha:o=!1,antialias:a=!1,premultipliedAlpha:l=!0,preserveDrawingBuffer:c=!1,powerPreference:u="default",failIfMajorPerformanceCaveat:h=!1,reversedDepthBuffer:f=!1,outputBufferType:p=kn}=t;this.isWebGLRenderer=!0;let g;if(i!==null){if(typeof WebGLRenderingContext<"u"&&i instanceof WebGLRenderingContext)throw new Error("THREE.WebGLRenderer: WebGL 1 is not supported since r163.");g=i.getContextAttributes().alpha}else g=o;const v=p,m=new Set([ff,hf,uf]),d=new Set([kn,Mi,zo,Vo,lf,cf]),S=new Uint32Array(4),y=new Int32Array(4);let x=null,A=null;const P=[],C=[];let R=null;this.domElement=n,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=vi,this.toneMappingExposure=1,this.transmissionResolutionScale=1;const b=this;let M=!1;this._outputColorSpace=On;let L=0,V=0,q=null,j=-1,J=null;const W=new ze,k=new ze;let H=null;const ct=new $t(0);let pt=0,ft=n.width,kt=n.height,Lt=1,Zt=null,ue=null;const st=new ze(0,0,ft,kt),ot=new ze(0,0,ft,kt);let Pt=!1;const Vt=new vf;let Mt=!1,oe=!1;const I=new he,O=new D,U=new ze,z={background:null,fog:null,environment:null,overrideMaterial:null,isScene:!0};let F=!1;function X(){return q===null?Lt:1}let E=i;function rt(T,G){return n.getContext(T,G)}try{const T={alpha:!0,depth:r,stencil:s,antialias:a,premultipliedAlpha:l,preserveDrawingBuffer:c,powerPreference:u,failIfMajorPerformanceCaveat:h};if("setAttribute"in n&&n.setAttribute("data-engine",`three.js r${sf}`),n.addEventListener("webglcontextlost",Qt,!1),n.addEventListener("webglcontextrestored",Ce,!1),n.addEventListener("webglcontextcreationerror",ye,!1),E===null){const G="webgl2";if(E=rt(G,T),E===null)throw rt(G)?new Error("Error creating WebGL context with your selected attributes."):new Error("Error creating WebGL context.")}}catch(T){throw de("WebGLRenderer: "+T.message),T}let K,Q,it,w,_,N,Y,nt,$,wt,ht,Ct,zt,ut,St,Et,It,yt,ee,B,Dt,gt,Nt,dt;function lt(){K=new E1(E),K.init(),gt=new gP(E,K),Q=new g1(E,K,t,gt),it=new pP(E,K),Q.reversedDepthBuffer&&f&&it.buffers.depth.setReversed(!0),w=new P1(E),_=new jA,N=new mP(E,K,it,_,Q,gt,w),Y=new v1(b),nt=new w1(b),$=new Iw(E),Nt=new p1(E,$),wt=new T1(E,$,w,Nt),ht=new R1(E,wt,$,w),ee=new C1(E,Q,N),Et=new _1(_),Ct=new QA(b,Y,nt,K,Q,Nt,Et),zt=new bP(b,_),ut=new eP,St=new aP(K),yt=new d1(b,Y,nt,it,ht,g,l),It=new fP(b,ht,Q),dt=new MP(E,w,Q,it),B=new m1(E,K,w),Dt=new A1(E,K,w),w.programs=Ct.programs,b.capabilities=Q,b.extensions=K,b.properties=_,b.renderLists=ut,b.shadowMap=It,b.state=it,b.info=w}lt(),v!==kn&&(R=new I1(v,n.width,n.height,r,s));const bt=new yP(b,E);this.xr=bt,this.getContext=function(){return E},this.getContextAttributes=function(){return E.getContextAttributes()},this.forceContextLoss=function(){const T=K.get("WEBGL_lose_context");T&&T.loseContext()},this.forceContextRestore=function(){const T=K.get("WEBGL_lose_context");T&&T.restoreContext()},this.getPixelRatio=function(){return Lt},this.setPixelRatio=function(T){T!==void 0&&(Lt=T,this.setSize(ft,kt,!1))},this.getSize=function(T){return T.set(ft,kt)},this.setSize=function(T,G,et=!0){if(bt.isPresenting){Yt("WebGLRenderer: Can't change size while VR device is presenting.");return}ft=T,kt=G,n.width=Math.floor(T*Lt),n.height=Math.floor(G*Lt),et===!0&&(n.style.width=T+"px",n.style.height=G+"px"),R!==null&&R.setSize(n.width,n.height),this.setViewport(0,0,T,G)},this.getDrawingBufferSize=function(T){return T.set(ft*Lt,kt*Lt).floor()},this.setDrawingBufferSize=function(T,G,et){ft=T,kt=G,Lt=et,n.width=Math.floor(T*et),n.height=Math.floor(G*et),this.setViewport(0,0,T,G)},this.setEffects=function(T){if(v===kn){console.error("THREE.WebGLRenderer: setEffects() requires outputBufferType set to HalfFloatType or FloatType.");return}if(T){for(let G=0;G{function Tt(){if(tt.forEach(function(Ut){_.get(Ut).currentProgram.isReady()&&tt.delete(Ut)}),tt.size===0){Z(T);return}setTimeout(Tt,10)}K.get("KHR_parallel_shader_compile")!==null?Tt():setTimeout(Tt,10)})};let Bl=null;function O_(T){Bl&&Bl(T)}function Ff(){Mr.stop()}function kf(){Mr.start()}const Mr=new y_;Mr.setAnimationLoop(O_),typeof self<"u"&&Mr.setContext(self),this.setAnimationLoop=function(T){Bl=T,bt.setAnimationLoop(T),T===null?Mr.stop():Mr.start()},bt.addEventListener("sessionstart",Ff),bt.addEventListener("sessionend",kf),this.render=function(T,G){if(G!==void 0&&G.isCamera!==!0){de("WebGLRenderer.render: camera is not an instance of THREE.Camera.");return}if(M===!0)return;const et=bt.enabled===!0&&bt.isPresenting===!0,tt=R!==null&&(q===null||et)&&R.begin(b,q);if(T.matrixWorldAutoUpdate===!0&&T.updateMatrixWorld(),G.parent===null&&G.matrixWorldAutoUpdate===!0&&G.updateMatrixWorld(),bt.enabled===!0&&bt.isPresenting===!0&&(R===null||R.isCompositing()===!1)&&(bt.cameraAutoUpdate===!0&&bt.updateCamera(G),G=bt.getCamera()),T.isScene===!0&&T.onBeforeRender(b,T,G,q),A=St.get(T,C.length),A.init(G),C.push(A),I.multiplyMatrices(G.projectionMatrix,G.matrixWorldInverse),Vt.setFromProjectionMatrix(I,gi,G.reversedDepth),oe=this.localClippingEnabled,Mt=Et.init(this.clippingPlanes,oe),x=ut.get(T,P.length),x.init(),P.push(x),bt.enabled===!0&&bt.isPresenting===!0){const Ut=b.xr.getDepthSensingMesh();Ut!==null&&zl(Ut,G,-1/0,b.sortObjects)}zl(T,G,0,b.sortObjects),x.finish(),b.sortObjects===!0&&x.sort(Zt,ue),F=bt.enabled===!1||bt.isPresenting===!1||bt.hasDepthSensing()===!1,F&&yt.addToRenderList(x,T),this.info.render.frame++,Mt===!0&&Et.beginShadows();const Z=A.state.shadowsArray;if(It.render(Z,T,G),Mt===!0&&Et.endShadows(),this.info.autoReset===!0&&this.info.reset(),(tt&&R.hasRenderPass())===!1){const Ut=x.opaque,Rt=x.transmissive;if(A.setupLights(),G.isArrayCamera){const Bt=G.cameras;if(Rt.length>0)for(let Gt=0,Jt=Bt.length;Gt0&&zf(Ut,Rt,T,G),F&&yt.render(T),Bf(x,T,G)}q!==null&&V===0&&(N.updateMultisampleRenderTarget(q),N.updateRenderTargetMipmap(q)),tt&&R.end(b),T.isScene===!0&&T.onAfterRender(b,T,G),Nt.resetDefaultState(),j=-1,J=null,C.pop(),C.length>0?(A=C[C.length-1],Mt===!0&&Et.setGlobalState(b.clippingPlanes,A.state.camera)):A=null,P.pop(),P.length>0?x=P[P.length-1]:x=null};function zl(T,G,et,tt){if(T.visible===!1)return;if(T.layers.test(G.layers)){if(T.isGroup)et=T.renderOrder;else if(T.isLOD)T.autoUpdate===!0&&T.update(G);else if(T.isLight)A.pushLight(T),T.castShadow&&A.pushShadow(T);else if(T.isSprite){if(!T.frustumCulled||Vt.intersectsSprite(T)){tt&&U.setFromMatrixPosition(T.matrixWorld).applyMatrix4(I);const Ut=ht.update(T),Rt=T.material;Rt.visible&&x.push(T,Ut,Rt,et,U.z,null)}}else if((T.isMesh||T.isLine||T.isPoints)&&(!T.frustumCulled||Vt.intersectsObject(T))){const Ut=ht.update(T),Rt=T.material;if(tt&&(T.boundingSphere!==void 0?(T.boundingSphere===null&&T.computeBoundingSphere(),U.copy(T.boundingSphere.center)):(Ut.boundingSphere===null&&Ut.computeBoundingSphere(),U.copy(Ut.boundingSphere.center)),U.applyMatrix4(T.matrixWorld).applyMatrix4(I)),Array.isArray(Rt)){const Bt=Ut.groups;for(let Gt=0,Jt=Bt.length;Gt0&&ra(Z,G,et),Tt.length>0&&ra(Tt,G,et),Ut.length>0&&ra(Ut,G,et),it.buffers.depth.setTest(!0),it.buffers.depth.setMask(!0),it.buffers.color.setMask(!0),it.setPolygonOffset(!1)}function zf(T,G,et,tt){if((et.isScene===!0?et.overrideMaterial:null)!==null)return;if(A.state.transmissionRenderTarget[tt.id]===void 0){const le=K.has("EXT_color_buffer_half_float")||K.has("EXT_color_buffer_float");A.state.transmissionRenderTarget[tt.id]=new xi(1,1,{generateMipmaps:!0,type:le?Yi:kn,minFilter:zr,samples:Q.samples,stencilBuffer:s,resolveDepthBuffer:!1,resolveStencilBuffer:!1,colorSpace:me.workingColorSpace})}const Tt=A.state.transmissionRenderTarget[tt.id],Ut=tt.viewport||W;Tt.setSize(Ut.z*b.transmissionResolutionScale,Ut.w*b.transmissionResolutionScale);const Rt=b.getRenderTarget(),Bt=b.getActiveCubeFace(),Gt=b.getActiveMipmapLevel();b.setRenderTarget(Tt),b.getClearColor(ct),pt=b.getClearAlpha(),pt<1&&b.setClearColor(16777215,.5),b.clear(),F&&yt.render(et);const Jt=b.toneMapping;b.toneMapping=vi;const Xt=tt.viewport;if(tt.viewport!==void 0&&(tt.viewport=void 0),A.setupLightsView(tt),Mt===!0&&Et.setGlobalState(b.clippingPlanes,tt),ra(T,et,tt),N.updateMultisampleRenderTarget(Tt),N.updateRenderTargetMipmap(Tt),K.has("WEBGL_multisampled_render_to_texture")===!1){let le=!1;for(let we=0,Fe=G.length;we0),Xt=!!et.morphAttributes.position,le=!!et.morphAttributes.normal,we=!!et.morphAttributes.color;let Fe=vi;tt.toneMapped&&(q===null||q.isXRRenderTarget===!0)&&(Fe=b.toneMapping);const ke=et.morphAttributes.position||et.morphAttributes.normal||et.morphAttributes.color,Ae=ke!==void 0?ke.length:0,qt=_.get(tt),Se=A.state.lights;if(Mt===!0&&(oe===!0||T!==J)){const pn=T===J&&tt.id===j;Et.setState(tt,T,pn)}let ge=!1;tt.version===qt.__version?(qt.needsLights&&qt.lightsStateVersion!==Se.state.version||qt.outputColorSpace!==Rt||Z.isBatchedMesh&&qt.batching===!1||!Z.isBatchedMesh&&qt.batching===!0||Z.isBatchedMesh&&qt.batchingColor===!0&&Z.colorTexture===null||Z.isBatchedMesh&&qt.batchingColor===!1&&Z.colorTexture!==null||Z.isInstancedMesh&&qt.instancing===!1||!Z.isInstancedMesh&&qt.instancing===!0||Z.isSkinnedMesh&&qt.skinning===!1||!Z.isSkinnedMesh&&qt.skinning===!0||Z.isInstancedMesh&&qt.instancingColor===!0&&Z.instanceColor===null||Z.isInstancedMesh&&qt.instancingColor===!1&&Z.instanceColor!==null||Z.isInstancedMesh&&qt.instancingMorph===!0&&Z.morphTexture===null||Z.isInstancedMesh&&qt.instancingMorph===!1&&Z.morphTexture!==null||qt.envMap!==Bt||tt.fog===!0&&qt.fog!==Tt||qt.numClippingPlanes!==void 0&&(qt.numClippingPlanes!==Et.numPlanes||qt.numIntersection!==Et.numIntersection)||qt.vertexAlphas!==Gt||qt.vertexTangents!==Jt||qt.morphTargets!==Xt||qt.morphNormals!==le||qt.morphColors!==we||qt.toneMapping!==Fe||qt.morphTargetsCount!==Ae)&&(ge=!0):(ge=!0,qt.__version=tt.version);let In=qt.currentProgram;ge===!0&&(In=sa(tt,G,Z));let ns=!1,Ln=!1,to=!1;const Re=In.getUniforms(),Mn=qt.uniforms;if(it.useProgram(In.program)&&(ns=!0,Ln=!0,to=!0),tt.id!==j&&(j=tt.id,Ln=!0),ns||J!==T){it.buffers.depth.getReversed()&&T.reversedDepth!==!0&&(T._reversedDepth=!0,T.updateProjectionMatrix()),Re.setValue(E,"projectionMatrix",T.projectionMatrix),Re.setValue(E,"viewMatrix",T.matrixWorldInverse);const wn=Re.map.cameraPosition;wn!==void 0&&wn.setValue(E,O.setFromMatrixPosition(T.matrixWorld)),Q.logarithmicDepthBuffer&&Re.setValue(E,"logDepthBufFC",2/(Math.log(T.far+1)/Math.LN2)),(tt.isMeshPhongMaterial||tt.isMeshToonMaterial||tt.isMeshLambertMaterial||tt.isMeshBasicMaterial||tt.isMeshStandardMaterial||tt.isShaderMaterial)&&Re.setValue(E,"isOrthographic",T.isOrthographicCamera===!0),J!==T&&(J=T,Ln=!0,to=!0)}if(qt.needsLights&&(Se.state.directionalShadowMap.length>0&&Re.setValue(E,"directionalShadowMap",Se.state.directionalShadowMap,N),Se.state.spotShadowMap.length>0&&Re.setValue(E,"spotShadowMap",Se.state.spotShadowMap,N),Se.state.pointShadowMap.length>0&&Re.setValue(E,"pointShadowMap",Se.state.pointShadowMap,N)),Z.isSkinnedMesh){Re.setOptional(E,Z,"bindMatrix"),Re.setOptional(E,Z,"bindMatrixInverse");const pn=Z.skeleton;pn&&(pn.boneTexture===null&&pn.computeBoneTexture(),Re.setValue(E,"boneTexture",pn.boneTexture,N))}Z.isBatchedMesh&&(Re.setOptional(E,Z,"batchingTexture"),Re.setValue(E,"batchingTexture",Z._matricesTexture,N),Re.setOptional(E,Z,"batchingIdTexture"),Re.setValue(E,"batchingIdTexture",Z._indirectTexture,N),Re.setOptional(E,Z,"batchingColorTexture"),Z._colorsTexture!==null&&Re.setValue(E,"batchingColorTexture",Z._colorsTexture,N));const Hn=et.morphAttributes;if((Hn.position!==void 0||Hn.normal!==void 0||Hn.color!==void 0)&&ee.update(Z,et,In),(Ln||qt.receiveShadow!==Z.receiveShadow)&&(qt.receiveShadow=Z.receiveShadow,Re.setValue(E,"receiveShadow",Z.receiveShadow)),tt.isMeshGouraudMaterial&&tt.envMap!==null&&(Mn.envMap.value=Bt,Mn.flipEnvMap.value=Bt.isCubeTexture&&Bt.isRenderTargetTexture===!1?-1:1),tt.isMeshStandardMaterial&&tt.envMap===null&&G.environment!==null&&(Mn.envMapIntensity.value=G.environmentIntensity),Mn.dfgLUT!==void 0&&(Mn.dfgLUT.value=EP()),Ln&&(Re.setValue(E,"toneMappingExposure",b.toneMappingExposure),qt.needsLights&&k_(Mn,to),Tt&&tt.fog===!0&&zt.refreshFogUniforms(Mn,Tt),zt.refreshMaterialUniforms(Mn,tt,Lt,kt,A.state.transmissionRenderTarget[T.id]),nl.upload(E,Hf(qt),Mn,N)),tt.isShaderMaterial&&tt.uniformsNeedUpdate===!0&&(nl.upload(E,Hf(qt),Mn,N),tt.uniformsNeedUpdate=!1),tt.isSpriteMaterial&&Re.setValue(E,"center",Z.center),Re.setValue(E,"modelViewMatrix",Z.modelViewMatrix),Re.setValue(E,"normalMatrix",Z.normalMatrix),Re.setValue(E,"modelMatrix",Z.matrixWorld),tt.isShaderMaterial||tt.isRawShaderMaterial){const pn=tt.uniformsGroups;for(let wn=0,Vl=pn.length;wn0&&N.useMultisampledRTT(T)===!1?tt=_.get(T).__webglMultisampledFramebuffer:Array.isArray(Gt)?tt=Gt[et]:tt=Gt,W.copy(T.viewport),k.copy(T.scissor),H=T.scissorTest}else W.copy(st).multiplyScalar(Lt).floor(),k.copy(ot).multiplyScalar(Lt).floor(),H=Pt;if(et!==0&&(tt=z_),it.bindFramebuffer(E.FRAMEBUFFER,tt)&&it.drawBuffers(T,tt),it.viewport(W),it.scissor(k),it.setScissorTest(H),Z){const Rt=_.get(T.texture);E.framebufferTexture2D(E.FRAMEBUFFER,E.COLOR_ATTACHMENT0,E.TEXTURE_CUBE_MAP_POSITIVE_X+G,Rt.__webglTexture,et)}else if(Tt){const Rt=G;for(let Bt=0;Bt=0&&G<=T.width-tt&&et>=0&&et<=T.height-Z&&(T.textures.length>1&&E.readBuffer(E.COLOR_ATTACHMENT0+Rt),E.readPixels(G,et,tt,Z,gt.convert(Jt),gt.convert(Xt),Tt))}finally{const Gt=q!==null?_.get(q).__webglFramebuffer:null;it.bindFramebuffer(E.FRAMEBUFFER,Gt)}}},this.readRenderTargetPixelsAsync=async function(T,G,et,tt,Z,Tt,Ut,Rt=0){if(!(T&&T.isWebGLRenderTarget))throw new Error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not THREE.WebGLRenderTarget.");let Bt=_.get(T).__webglFramebuffer;if(T.isWebGLCubeRenderTarget&&Ut!==void 0&&(Bt=Bt[Ut]),Bt)if(G>=0&&G<=T.width-tt&&et>=0&&et<=T.height-Z){it.bindFramebuffer(E.FRAMEBUFFER,Bt);const Gt=T.textures[Rt],Jt=Gt.format,Xt=Gt.type;if(!Q.textureFormatReadable(Jt))throw new Error("THREE.WebGLRenderer.readRenderTargetPixelsAsync: renderTarget is not in RGBA or implementation defined format.");if(!Q.textureTypeReadable(Xt))throw new Error("THREE.WebGLRenderer.readRenderTargetPixelsAsync: renderTarget is not in UnsignedByteType or implementation defined type.");const le=E.createBuffer();E.bindBuffer(E.PIXEL_PACK_BUFFER,le),E.bufferData(E.PIXEL_PACK_BUFFER,Tt.byteLength,E.STREAM_READ),T.textures.length>1&&E.readBuffer(E.COLOR_ATTACHMENT0+Rt),E.readPixels(G,et,tt,Z,gt.convert(Jt),gt.convert(Xt),0);const we=q!==null?_.get(q).__webglFramebuffer:null;it.bindFramebuffer(E.FRAMEBUFFER,we);const Fe=E.fenceSync(E.SYNC_GPU_COMMANDS_COMPLETE,0);return E.flush(),await Vb(E,Fe,4),E.bindBuffer(E.PIXEL_PACK_BUFFER,le),E.getBufferSubData(E.PIXEL_PACK_BUFFER,0,Tt),E.deleteBuffer(le),E.deleteSync(Fe),Tt}else throw new Error("THREE.WebGLRenderer.readRenderTargetPixelsAsync: requested read bounds are out of range.")},this.copyFramebufferToTexture=function(T,G=null,et=0){const tt=Math.pow(2,-et),Z=Math.floor(T.image.width*tt),Tt=Math.floor(T.image.height*tt),Ut=G!==null?G.x:0,Rt=G!==null?G.y:0;N.setTexture2D(T,0),E.copyTexSubImage2D(E.TEXTURE_2D,et,0,0,Ut,Rt,Z,Tt),it.unbindTexture()};const V_=E.createFramebuffer(),H_=E.createFramebuffer();this.copyTextureToTexture=function(T,G,et=null,tt=null,Z=0,Tt=null){Tt===null&&(Z!==0?(Ho("WebGLRenderer: copyTextureToTexture function signature has changed to support src and dst mipmap levels."),Tt=Z,Z=0):Tt=0);let Ut,Rt,Bt,Gt,Jt,Xt,le,we,Fe;const ke=T.isCompressedTexture?T.mipmaps[Tt]:T.image;if(et!==null)Ut=et.max.x-et.min.x,Rt=et.max.y-et.min.y,Bt=et.isBox3?et.max.z-et.min.z:1,Gt=et.min.x,Jt=et.min.y,Xt=et.isBox3?et.min.z:0;else{const Hn=Math.pow(2,-Z);Ut=Math.floor(ke.width*Hn),Rt=Math.floor(ke.height*Hn),T.isDataArrayTexture?Bt=ke.depth:T.isData3DTexture?Bt=Math.floor(ke.depth*Hn):Bt=1,Gt=0,Jt=0,Xt=0}tt!==null?(le=tt.x,we=tt.y,Fe=tt.z):(le=0,we=0,Fe=0);const Ae=gt.convert(G.format),qt=gt.convert(G.type);let Se;G.isData3DTexture?(N.setTexture3D(G,0),Se=E.TEXTURE_3D):G.isDataArrayTexture||G.isCompressedArrayTexture?(N.setTexture2DArray(G,0),Se=E.TEXTURE_2D_ARRAY):(N.setTexture2D(G,0),Se=E.TEXTURE_2D),E.pixelStorei(E.UNPACK_FLIP_Y_WEBGL,G.flipY),E.pixelStorei(E.UNPACK_PREMULTIPLY_ALPHA_WEBGL,G.premultiplyAlpha),E.pixelStorei(E.UNPACK_ALIGNMENT,G.unpackAlignment);const ge=E.getParameter(E.UNPACK_ROW_LENGTH),In=E.getParameter(E.UNPACK_IMAGE_HEIGHT),ns=E.getParameter(E.UNPACK_SKIP_PIXELS),Ln=E.getParameter(E.UNPACK_SKIP_ROWS),to=E.getParameter(E.UNPACK_SKIP_IMAGES);E.pixelStorei(E.UNPACK_ROW_LENGTH,ke.width),E.pixelStorei(E.UNPACK_IMAGE_HEIGHT,ke.height),E.pixelStorei(E.UNPACK_SKIP_PIXELS,Gt),E.pixelStorei(E.UNPACK_SKIP_ROWS,Jt),E.pixelStorei(E.UNPACK_SKIP_IMAGES,Xt);const Re=T.isDataArrayTexture||T.isData3DTexture,Mn=G.isDataArrayTexture||G.isData3DTexture;if(T.isDepthTexture){const Hn=_.get(T),pn=_.get(G),wn=_.get(Hn.__renderTarget),Vl=_.get(pn.__renderTarget);it.bindFramebuffer(E.READ_FRAMEBUFFER,wn.__webglFramebuffer),it.bindFramebuffer(E.DRAW_FRAMEBUFFER,Vl.__webglFramebuffer);for(let wr=0;wr>>3){case 1:{if(s===8){r.indices.push(n.uint32());continue}if(s===10){const o=n.uint32()+n.pos;for(;n.posglobalThis.Number(t)):[]}},toJSON(e){const t={};return e.indices?.length&&(t.indices=e.indices.map(n=>Math.round(n))),t},create(e){return dr.fromPartial(e??{})},fromPartial(e){const t=Nm();return t.indices=e.indices?.map(n=>n)||[],t}};function Um(){return{guid:void 0,name:void 0,vertices:[],faces:[]}}const Df={encode(e,t=new ne){e.guid!==void 0&&t.uint32(10).string(e.guid),e.name!==void 0&&t.uint32(18).string(e.name);for(const n of e.vertices)Ht.encode(n,t.uint32(26).fork()).join();for(const n of e.faces)dr.encode(n,t.uint32(34).fork()).join();return t},decode(e,t){const n=e instanceof xt?e:new xt(e),i=t===void 0?n.len:n.pos+t,r=Um();for(;n.pos>>3){case 1:{if(s!==10)break;r.guid=n.string();continue}case 2:{if(s!==18)break;r.name=n.string();continue}case 3:{if(s!==26)break;r.vertices.push(Ht.decode(n,n.uint32()));continue}case 4:{if(s!==34)break;r.faces.push(dr.decode(n,n.uint32()));continue}}if((s&7)===4||s===0)break;n.skip(s&7)}return r},fromJSON(e){return{guid:vl(e.guid)?globalThis.String(e.guid):void 0,name:vl(e.name)?globalThis.String(e.name):void 0,vertices:globalThis.Array.isArray(e?.vertices)?e.vertices.map(t=>Ht.fromJSON(t)):[],faces:globalThis.Array.isArray(e?.faces)?e.faces.map(t=>dr.fromJSON(t)):[]}},toJSON(e){const t={};return e.guid!==void 0&&(t.guid=e.guid),e.name!==void 0&&(t.name=e.name),e.vertices?.length&&(t.vertices=e.vertices.map(n=>Ht.toJSON(n))),e.faces?.length&&(t.faces=e.faces.map(n=>dr.toJSON(n))),t},create(e){return Df.fromPartial(e??{})},fromPartial(e){const t=Um();return t.guid=e.guid??void 0,t.name=e.name??void 0,t.vertices=e.vertices?.map(n=>Ht.fromPartial(n))||[],t.faces=e.faces?.map(n=>dr.fromPartial(n))||[],t}};function Om(){return{vertexIndices:[]}}const pr={encode(e,t=new ne){t.uint32(10).fork();for(const n of e.vertexIndices)t.int32(n);return t.join(),t},decode(e,t){const n=e instanceof xt?e:new xt(e),i=t===void 0?n.len:n.pos+t,r=Om();for(;n.pos>>3){case 1:{if(s===8){r.vertexIndices.push(n.int32());continue}if(s===10){const o=n.uint32()+n.pos;for(;n.posglobalThis.Number(t)):globalThis.Array.isArray(e?.vertex_indices)?e.vertex_indices.map(t=>globalThis.Number(t)):[]}},toJSON(e){const t={};return e.vertexIndices?.length&&(t.vertexIndices=e.vertexIndices.map(n=>Math.round(n))),t},create(e){return pr.fromPartial(e??{})},fromPartial(e){const t=Om();return t.vertexIndices=e.vertexIndices?.map(n=>n)||[],t}};function Fm(){return{guid:void 0,name:void 0,vertices:[],faces:[]}}const If={encode(e,t=new ne){e.guid!==void 0&&t.uint32(10).string(e.guid),e.name!==void 0&&t.uint32(18).string(e.name);for(const n of e.vertices)Ht.encode(n,t.uint32(26).fork()).join();for(const n of e.faces)pr.encode(n,t.uint32(34).fork()).join();return t},decode(e,t){const n=e instanceof xt?e:new xt(e),i=t===void 0?n.len:n.pos+t,r=Fm();for(;n.pos>>3){case 1:{if(s!==10)break;r.guid=n.string();continue}case 2:{if(s!==18)break;r.name=n.string();continue}case 3:{if(s!==26)break;r.vertices.push(Ht.decode(n,n.uint32()));continue}case 4:{if(s!==34)break;r.faces.push(pr.decode(n,n.uint32()));continue}}if((s&7)===4||s===0)break;n.skip(s&7)}return r},fromJSON(e){return{guid:vl(e.guid)?globalThis.String(e.guid):void 0,name:vl(e.name)?globalThis.String(e.name):void 0,vertices:globalThis.Array.isArray(e?.vertices)?e.vertices.map(t=>Ht.fromJSON(t)):[],faces:globalThis.Array.isArray(e?.faces)?e.faces.map(t=>pr.fromJSON(t)):[]}},toJSON(e){const t={};return e.guid!==void 0&&(t.guid=e.guid),e.name!==void 0&&(t.name=e.name),e.vertices?.length&&(t.vertices=e.vertices.map(n=>Ht.toJSON(n))),e.faces?.length&&(t.faces=e.faces.map(n=>pr.toJSON(n))),t},create(e){return If.fromPartial(e??{})},fromPartial(e){const t=Fm();return t.guid=e.guid??void 0,t.name=e.name??void 0,t.vertices=e.vertices?.map(n=>Ht.fromPartial(n))||[],t.faces=e.faces?.map(n=>pr.fromPartial(n))||[],t}};function vl(e){return e!=null}class jC{data;constructor(t){let n;if("bytes"in t?n=tR(t.bytes):n=t.data,!n.vertexIndices)throw new Error("Invalid FaceData: Missing required property 'vertices'.");this.data=n}get bytes(){return eR(this.data)}get vertexIndices(){return this.data.vertexIndices}}function tR(e){return pr.decode(e)}function eR(e){return pr.encode(e).finish()}class nR{data;_points;_faces;constructor(t){let n;if("bytes"in t?n=iR(t.bytes):n=t.data,!n.vertices||!n.faces)throw new Error("Invalid PolyhedronData: Missing required properties (vertices or faces).");this.data=n}get bytes(){return rR(this.data)}get guid(){return this.data.guid?this.data.guid:""}get name(){return this.data.name?this.data.name:""}get vertices(){if(!this._points){this._points=[];for(const t of this.data.vertices){const n=new Yn({data:t});this._points.push(n)}}return this._points}get faces(){if(!this._faces){this._faces=[];for(const t of this.data.faces){const n=new jC({data:t});this._faces.push(n)}}return this._faces}buildGeometry(){const t=new fe,n=new Float32Array(this.vertices.length*3);for(let o=0;o{n[o*3]=s.x,n[o*3+1]=s.y,n[o*3+2]=s.z});const i=[];for(const s of this.faces){const o=s.indices;for(let a=1;aMath.PI&&(i-=En),r<-Math.PI?r+=En:r>Math.PI&&(r-=En),i<=r?this._spherical.theta=Math.max(i,Math.min(r,this._spherical.theta)):this._spherical.theta=this._spherical.theta>(i+r)/2?Math.max(i,this._spherical.theta):Math.min(r,this._spherical.theta)),this._spherical.phi=Math.max(this.minPolarAngle,Math.min(this.maxPolarAngle,this._spherical.phi)),this._spherical.makeSafe(),this.enableDamping===!0?this.target.addScaledVector(this._panOffset,this.dampingFactor):this.target.add(this._panOffset),this.target.sub(this.cursor),this.target.clampLength(this.minTargetRadius,this.maxTargetRadius),this.target.add(this.cursor);let s=!1;if(this.zoomToCursor&&this._performCursorZoom||this.object.isOrthographicCamera)this._spherical.radius=this._clampDistance(this._spherical.radius);else{const o=this._spherical.radius;this._spherical.radius=this._clampDistance(this._spherical.radius*this._scale),s=o!=this._spherical.radius}if(Ye.setFromSpherical(this._spherical),Ye.applyQuaternion(this._quatInverse),n.copy(this.target).add(Ye),this.object.lookAt(this.target),this.enableDamping===!0?(this._sphericalDelta.theta*=1-this.dampingFactor,this._sphericalDelta.phi*=1-this.dampingFactor,this._panOffset.multiplyScalar(1-this.dampingFactor)):(this._sphericalDelta.set(0,0,0),this._panOffset.set(0,0,0)),this.zoomToCursor&&this._performCursorZoom){let o=null;if(this.object.isPerspectiveCamera){const a=Ye.length();o=this._clampDistance(a*this._scale);const l=a-o;this.object.position.addScaledVector(this._dollyDirection,l),this.object.updateMatrixWorld(),s=!!l}else if(this.object.isOrthographicCamera){const a=new D(this._mouse.x,this._mouse.y,0);a.unproject(this.object);const l=this.object.zoom;this.object.zoom=Math.max(this.minZoom,Math.min(this.maxZoom,this.object.zoom/this._scale)),this.object.updateProjectionMatrix(),s=l!==this.object.zoom;const c=new D(this._mouse.x,this._mouse.y,0);c.unproject(this.object),this.object.position.sub(c).add(a),this.object.updateMatrixWorld(),o=Ye.length()}else console.warn("WARNING: OrbitControls.js encountered an unknown camera type - zoom to cursor disabled."),this.zoomToCursor=!1;o!==null&&(this.screenSpacePanning?this.target.set(0,0,-1).transformDirection(this.object.matrix).multiplyScalar(o).add(this.object.position):(Va.origin.copy(this.object.position),Va.direction.set(0,0,-1).transformDirection(this.object.matrix),Math.abs(this.object.up.dot(Va.direction))Hc||8*(1-this._lastQuaternion.dot(this.object.quaternion))>Hc||this._lastTargetPosition.distanceToSquared(this.target)>Hc?(this.dispatchEvent(km),this._lastPosition.copy(this.object.position),this._lastQuaternion.copy(this.object.quaternion),this._lastTargetPosition.copy(this.target),!0):!1}_getAutoRotationAngle(t){return t!==null?En/60*this.autoRotateSpeed*t:En/60/60*this.autoRotateSpeed}_getZoomScale(t){const n=Math.abs(t*.01);return Math.pow(.95,this.zoomSpeed*n)}_rotateLeft(t){this._sphericalDelta.theta-=t}_rotateUp(t){this._sphericalDelta.phi-=t}_panLeft(t,n){Ye.setFromMatrixColumn(n,0),Ye.multiplyScalar(-t),this._panOffset.add(Ye)}_panUp(t,n){this.screenSpacePanning===!0?Ye.setFromMatrixColumn(n,1):(Ye.setFromMatrixColumn(n,0),Ye.crossVectors(this.object.up,Ye)),Ye.multiplyScalar(t),this._panOffset.add(Ye)}_pan(t,n){const i=this.domElement;if(this.object.isPerspectiveCamera){const r=this.object.position;Ye.copy(r).sub(this.target);let s=Ye.length();s*=Math.tan(this.object.fov/2*Math.PI/180),this._panLeft(2*t*s/i.clientHeight,this.object.matrix),this._panUp(2*n*s/i.clientHeight,this.object.matrix)}else this.object.isOrthographicCamera?(this._panLeft(t*(this.object.right-this.object.left)/this.object.zoom/i.clientWidth,this.object.matrix),this._panUp(n*(this.object.top-this.object.bottom)/this.object.zoom/i.clientHeight,this.object.matrix)):(console.warn("WARNING: OrbitControls.js encountered an unknown camera type - pan disabled."),this.enablePan=!1)}_dollyOut(t){this.object.isPerspectiveCamera||this.object.isOrthographicCamera?this._scale/=t:(console.warn("WARNING: OrbitControls.js encountered an unknown camera type - dolly/zoom disabled."),this.enableZoom=!1)}_dollyIn(t){this.object.isPerspectiveCamera||this.object.isOrthographicCamera?this._scale*=t:(console.warn("WARNING: OrbitControls.js encountered an unknown camera type - dolly/zoom disabled."),this.enableZoom=!1)}_updateZoomParameters(t,n){if(!this.zoomToCursor)return;this._performCursorZoom=!0;const i=this.domElement.getBoundingClientRect(),r=t-i.left,s=n-i.top,o=i.width,a=i.height;this._mouse.x=r/o*2-1,this._mouse.y=-(s/a)*2+1,this._dollyDirection.set(this._mouse.x,this._mouse.y,1).unproject(this.object).sub(this.object.position).normalize()}_clampDistance(t){return Math.max(this.minDistance,Math.min(this.maxDistance,t))}_handleMouseDownRotate(t){this._rotateStart.set(t.clientX,t.clientY)}_handleMouseDownDolly(t){this._updateZoomParameters(t.clientX,t.clientX),this._dollyStart.set(t.clientX,t.clientY)}_handleMouseDownPan(t){this._panStart.set(t.clientX,t.clientY)}_handleMouseMoveRotate(t){this._rotateEnd.set(t.clientX,t.clientY),this._rotateDelta.subVectors(this._rotateEnd,this._rotateStart).multiplyScalar(this.rotateSpeed);const n=this.domElement;this._rotateLeft(En*this._rotateDelta.x/n.clientHeight),this._rotateUp(En*this._rotateDelta.y/n.clientHeight),this._rotateStart.copy(this._rotateEnd),this.update()}_handleMouseMoveDolly(t){this._dollyEnd.set(t.clientX,t.clientY),this._dollyDelta.subVectors(this._dollyEnd,this._dollyStart),this._dollyDelta.y>0?this._dollyOut(this._getZoomScale(this._dollyDelta.y)):this._dollyDelta.y<0&&this._dollyIn(this._getZoomScale(this._dollyDelta.y)),this._dollyStart.copy(this._dollyEnd),this.update()}_handleMouseMovePan(t){this._panEnd.set(t.clientX,t.clientY),this._panDelta.subVectors(this._panEnd,this._panStart).multiplyScalar(this.panSpeed),this._pan(this._panDelta.x,this._panDelta.y),this._panStart.copy(this._panEnd),this.update()}_handleMouseWheel(t){this._updateZoomParameters(t.clientX,t.clientY),t.deltaY<0?this._dollyIn(this._getZoomScale(t.deltaY)):t.deltaY>0&&this._dollyOut(this._getZoomScale(t.deltaY)),this.update()}_handleKeyDown(t){let n=!1;switch(t.code){case this.keys.UP:t.ctrlKey||t.metaKey||t.shiftKey?this.enableRotate&&this._rotateUp(En*this.keyRotateSpeed/this.domElement.clientHeight):this.enablePan&&this._pan(0,this.keyPanSpeed),n=!0;break;case this.keys.BOTTOM:t.ctrlKey||t.metaKey||t.shiftKey?this.enableRotate&&this._rotateUp(-En*this.keyRotateSpeed/this.domElement.clientHeight):this.enablePan&&this._pan(0,-this.keyPanSpeed),n=!0;break;case this.keys.LEFT:t.ctrlKey||t.metaKey||t.shiftKey?this.enableRotate&&this._rotateLeft(En*this.keyRotateSpeed/this.domElement.clientHeight):this.enablePan&&this._pan(this.keyPanSpeed,0),n=!0;break;case this.keys.RIGHT:t.ctrlKey||t.metaKey||t.shiftKey?this.enableRotate&&this._rotateLeft(-En*this.keyRotateSpeed/this.domElement.clientHeight):this.enablePan&&this._pan(-this.keyPanSpeed,0),n=!0;break}n&&(t.preventDefault(),this.update())}_handleTouchStartRotate(t){if(this._pointers.length===1)this._rotateStart.set(t.pageX,t.pageY);else{const n=this._getSecondPointerPosition(t),i=.5*(t.pageX+n.x),r=.5*(t.pageY+n.y);this._rotateStart.set(i,r)}}_handleTouchStartPan(t){if(this._pointers.length===1)this._panStart.set(t.pageX,t.pageY);else{const n=this._getSecondPointerPosition(t),i=.5*(t.pageX+n.x),r=.5*(t.pageY+n.y);this._panStart.set(i,r)}}_handleTouchStartDolly(t){const n=this._getSecondPointerPosition(t),i=t.pageX-n.x,r=t.pageY-n.y,s=Math.sqrt(i*i+r*r);this._dollyStart.set(0,s)}_handleTouchStartDollyPan(t){this.enableZoom&&this._handleTouchStartDolly(t),this.enablePan&&this._handleTouchStartPan(t)}_handleTouchStartDollyRotate(t){this.enableZoom&&this._handleTouchStartDolly(t),this.enableRotate&&this._handleTouchStartRotate(t)}_handleTouchMoveRotate(t){if(this._pointers.length==1)this._rotateEnd.set(t.pageX,t.pageY);else{const i=this._getSecondPointerPosition(t),r=.5*(t.pageX+i.x),s=.5*(t.pageY+i.y);this._rotateEnd.set(r,s)}this._rotateDelta.subVectors(this._rotateEnd,this._rotateStart).multiplyScalar(this.rotateSpeed);const n=this.domElement;this._rotateLeft(En*this._rotateDelta.x/n.clientHeight),this._rotateUp(En*this._rotateDelta.y/n.clientHeight),this._rotateStart.copy(this._rotateEnd)}_handleTouchMovePan(t){if(this._pointers.length===1)this._panEnd.set(t.pageX,t.pageY);else{const n=this._getSecondPointerPosition(t),i=.5*(t.pageX+n.x),r=.5*(t.pageY+n.y);this._panEnd.set(i,r)}this._panDelta.subVectors(this._panEnd,this._panStart).multiplyScalar(this.panSpeed),this._pan(this._panDelta.x,this._panDelta.y),this._panStart.copy(this._panEnd)}_handleTouchMoveDolly(t){const n=this._getSecondPointerPosition(t),i=t.pageX-n.x,r=t.pageY-n.y,s=Math.sqrt(i*i+r*r);this._dollyEnd.set(0,s),this._dollyDelta.set(0,Math.pow(this._dollyEnd.y/this._dollyStart.y,this.zoomSpeed)),this._dollyOut(this._dollyDelta.y),this._dollyStart.copy(this._dollyEnd);const o=(t.pageX+n.x)*.5,a=(t.pageY+n.y)*.5;this._updateZoomParameters(o,a)}_handleTouchMoveDollyPan(t){this.enableZoom&&this._handleTouchMoveDolly(t),this.enablePan&&this._handleTouchMovePan(t)}_handleTouchMoveDollyRotate(t){this.enableZoom&&this._handleTouchMoveDolly(t),this.enableRotate&&this._handleTouchMoveRotate(t)}_addPointer(t){this._pointers.push(t.pointerId)}_removePointer(t){delete this._pointerPositions[t.pointerId];for(let n=0;n.9&&(o.visible=!1)),this.axis==="Y"&&(Le.setFromEuler(Ha.set(0,0,Math.PI/2)),o.quaternion.copy(i).multiply(Le),Math.abs(Pe.copy(Or).applyQuaternion(i).dot(this.eye))>.9&&(o.visible=!1)),this.axis==="Z"&&(Le.setFromEuler(Ha.set(0,Math.PI/2,0)),o.quaternion.copy(i).multiply(Le),Math.abs(Pe.copy(So).applyQuaternion(i).dot(this.eye))>.9&&(o.visible=!1)),this.axis==="XYZE"&&(Le.setFromEuler(Ha.set(0,Math.PI/2,0)),Pe.copy(this.rotationAxis),o.quaternion.setFromRotationMatrix(Xm.lookAt(Wm,Pe,Or)),o.quaternion.multiply(Le),o.visible=this.dragging),this.axis==="E"&&(o.visible=!1)):o.name==="START"?(o.position.copy(this.worldPositionStart),o.visible=this.dragging):o.name==="END"?(o.position.copy(this.worldPosition),o.visible=this.dragging):o.name==="DELTA"?(o.position.copy(this.worldPositionStart),o.quaternion.copy(this.worldQuaternionStart),cn.set(1e-10,1e-10,1e-10).add(this.worldPositionStart).sub(this.worldPosition).multiplyScalar(-1),cn.applyQuaternion(this.worldQuaternionStart.clone().invert()),o.scale.copy(cn),o.visible=this.dragging):(o.quaternion.copy(i),this.dragging?o.position.copy(this.worldPositionStart):o.position.copy(this.worldPosition),this.axis&&(o.visible=this.axis.search(o.name)!==-1));continue}o.quaternion.copy(i),this.mode==="translate"||this.mode==="scale"?(o.name==="X"&&Math.abs(Pe.copy(yo).applyQuaternion(i).dot(this.eye))>.99&&(o.scale.set(1e-10,1e-10,1e-10),o.visible=!1),o.name==="Y"&&Math.abs(Pe.copy(Or).applyQuaternion(i).dot(this.eye))>.99&&(o.scale.set(1e-10,1e-10,1e-10),o.visible=!1),o.name==="Z"&&Math.abs(Pe.copy(So).applyQuaternion(i).dot(this.eye))>.99&&(o.scale.set(1e-10,1e-10,1e-10),o.visible=!1),o.name==="XY"&&Math.abs(Pe.copy(So).applyQuaternion(i).dot(this.eye))<.2&&(o.scale.set(1e-10,1e-10,1e-10),o.visible=!1),o.name==="YZ"&&Math.abs(Pe.copy(yo).applyQuaternion(i).dot(this.eye))<.2&&(o.scale.set(1e-10,1e-10,1e-10),o.visible=!1),o.name==="XZ"&&Math.abs(Pe.copy(Or).applyQuaternion(i).dot(this.eye))<.2&&(o.scale.set(1e-10,1e-10,1e-10),o.visible=!1)):this.mode==="rotate"&&(Ga.copy(i),Pe.copy(this.eye).applyQuaternion(Le.copy(i).invert()),o.name.search("E")!==-1&&o.quaternion.setFromRotationMatrix(Xm.lookAt(this.eye,Wm,Or)),o.name==="X"&&(Le.setFromAxisAngle(yo,Math.atan2(-Pe.y,Pe.z)),Le.multiplyQuaternions(Ga,Le),o.quaternion.copy(Le)),o.name==="Y"&&(Le.setFromAxisAngle(Or,Math.atan2(Pe.x,Pe.z)),Le.multiplyQuaternions(Ga,Le),o.quaternion.copy(Le)),o.name==="Z"&&(Le.setFromAxisAngle(So,Math.atan2(Pe.y,Pe.x)),Le.multiplyQuaternions(Ga,Le),o.quaternion.copy(Le))),o.visible=o.visible&&(o.name.indexOf("X")===-1||this.showX),o.visible=o.visible&&(o.name.indexOf("Y")===-1||this.showY),o.visible=o.visible&&(o.name.indexOf("Z")===-1||this.showZ),o.visible=o.visible&&(o.name.indexOf("E")===-1||this.showX&&this.showY&&this.showZ),o.material._color=o.material._color||o.material.color.clone(),o.material._opacity=o.material._opacity||o.material.opacity,o.material.color.copy(o.material._color),o.material.opacity=o.material._opacity,this.enabled&&this.axis&&(o.name===this.axis?(o.material.color.copy(this.materialLib.active.color),o.material.opacity=1):this.axis.split("").some(function(l){return o.name===l})&&(o.material.color.copy(this.materialLib.active.color),o.material.opacity=1))}super.updateMatrixWorld(t)}}class kR extends _t{constructor(){super(new ta(1e5,1e5,2,2),new Sr({visible:!1,wireframe:!0,side:xn,transparent:!0,opacity:.1,toneMapped:!1})),this.isTransformControlsPlane=!0,this.type="TransformControlsPlane"}updateMatrixWorld(t){let n=this.space;switch(this.position.copy(this.worldPosition),this.mode==="scale"&&(n="local"),Wa.copy(yo).applyQuaternion(n==="local"?this.worldQuaternion:il),ho.copy(Or).applyQuaternion(n==="local"?this.worldQuaternion:il),fo.copy(So).applyQuaternion(n==="local"?this.worldQuaternion:il),Pe.copy(ho),this.mode){case"translate":case"scale":switch(this.axis){case"X":Pe.copy(this.eye).cross(Wa),ci.copy(Wa).cross(Pe);break;case"Y":Pe.copy(this.eye).cross(ho),ci.copy(ho).cross(Pe);break;case"Z":Pe.copy(this.eye).cross(fo),ci.copy(fo).cross(Pe);break;case"XY":ci.copy(fo);break;case"YZ":ci.copy(Wa);break;case"XZ":Pe.copy(fo),ci.copy(ho);break;case"XYZ":case"E":ci.set(0,0,0);break}break;default:ci.set(0,0,0)}ci.length()===0?this.quaternion.copy(this.cameraQuaternion):(qm.lookAt(cn.set(0,0,0),ci,Pe),this.quaternion.setFromRotationMatrix(qm)),super.updateMatrixWorld(t)}}const $i={},Xs={};function Ym(e){let t;switch(e.type.value){case"standard_material":t=BR(e);break;case"line_material":t=zR(e);break;case"point_material":t=VR(e);break;case"physical_material":t=HR(e);break}Xs[e.guid.value]=t,$i[e.geometry_guid.value]=e.guid.value,qR(e.geometry_guid.value,t)}function BR(e){let t=e.color.value;t=t.replace("#","0x");let n=e.emissive.value;return n=n.replace("#","0x"),new Qs({color:parseInt(t),metalness:e.metalness.value,roughness:e.roughness.value,emissive:parseInt(n),emissiveIntensity:e.emissive_intensity.value,flatShading:e.flat_shading.value,wireframe:e.wireframe.value,side:xn})}function zR(e){let t=e.color.value;return t=t.replace("#","0x"),new ri({color:parseInt(t)})}function VR(e){let t=e.color.value;return t=t.replace("#","0x"),new xf({color:parseInt(t),size:e.size.value})}function HR(e){let t=e.color.value;t=t.replace("#","0x");let n=e.emissive.value;n=n.replace("#","0x");let i=e.attenuation_color.value;i=i.replace("#","0x");let r=e.sheen_color.value;r=r.replace("#","0x");let s=e.specular_color.value;return s=s.replace("#","0x"),new fw({color:parseInt(t),metalness:e.metalness.value,roughness:e.roughness.value,emissive:parseInt(n),emissiveIntensity:e.emissive_intensity.value,flatShading:e.flat_shading.value,wireframe:e.wireframe.value,side:xn,anisotropy:e.anisotropy.value,anisotropyRotation:e.anisotropy_rotation.value,attenuationColor:parseInt(i),attenuationDistance:e.attenuation_distance.value,clearcoat:e.clearcoat.value,clearcoatRoughness:e.clearcoat_roughness.value,dispersion:e.dispersion.value,ior:e.ior.value,iridescence:e.iridescence.value,iridescenceIOR:e.iridescence_ior.value,iridescenceThicknessRange:[e.iridescence_thickness_start.value,e.iridescence_thickness_end.value],reflectivity:e.reflectivity.value,sheen:e.sheen.value,sheenColor:parseInt(r),specularColor:parseInt(s),sheenRoughness:e.sheen_roughness.value,specularIntensity:e.specular_intensity.value,thickness:e.thickness.value,transmission:e.transmission.value})}const Wn={},GR=["Line","Point","Vector","Frame","Plane","Polyline"];function WR(e){console.log(e.name),GR.includes(e.name)&&XR(e);const t=e.guid,n=Wn[t],i=e.buildGeometry();if(!i||!(i instanceof _t))return;const r=i.geometry;if(r.computeBoundingSphere(),r.computeBoundingBox(),n instanceof _t){const s=n.geometry;n.geometry=r,n.position.copy(i.position),n.quaternion.copy(i.quaternion),n.scale.copy(i.scale),s&&s.dispose()}else{if($i[t]){const s=$i[t];Xs[s]&&(i.material=Xs[s])}else i.material=new Qs({color:35071,roughness:.5,metalness:.5});Ne.add(i),Wn[t]=i}}function XR(e){const t=e.buildGeometry(),n=e.guid;let i;if($i[n]){const r=$i[n];Xs[r]&&(i=Xs[r])}else return;t instanceof en||t instanceof yf?t.material=i:(t instanceof Rf||t instanceof void 0)&&t.setColor(i.color),Ne.add(t),Wn[n]=t}function qR(e,t){const n=Wn[e];if(n){if(n){n.material=t;return}(n instanceof Rf||n instanceof void 0)&&n.setColor(t.color)}}const xr=Xi({title:"Object Infos",isVisible:!1,data:null}),lh=Xi({title:"Sidebar Infos",isVisible:!1,data:null}),C_=Xi({value:!0});function YR(){xr.isVisible=!0}function R_(){xr.isVisible=!1}function D_(e){delete e.dispatch,xr.data=e}document.addEventListener("keydown",e=>{(e.key==="I"||e.key==="i")&&(xr.isVisible?R_():YR())});let xl,Ns,yl;class JR{tControl;constructor(){this.tControl=new RR(Xn,Dn.domElement),Ne.add(this.tControl.getHelper()),this.setupEventListeners()}setupEventListeners(){this.tControl.addEventListener("dragging-changed",t=>{ia.enabled=!t.value}),window.addEventListener("keydown",t=>{switch(t.key){case"w":this.tControl.setMode("translate");break;case"e":this.tControl.setMode("rotate");break;case"r":this.tControl.setMode("scale");break;case"Escape":this.tControl.detach();break}})}get controls(){return this.tControl}}class $R{raycaster;pickedObject;constructor(){this.raycaster=new __,this.pickedObject=null}pick(t,n){if(!C_.value)return;this.raycaster.setFromCamera(t,Xn);const i=this.raycaster.intersectObjects(Wn?Object.values(Wn):[],!0);if(i.length){this.pickedObject=i[0].object,yl.attach(this.pickedObject);const r=Object.keys(Wn).find(o=>Wn[o]===this.pickedObject);N_({dispatch:"object_picked",guid:r}),console.log("Picked object key:",r)}else this.pickedObject&&(this.pickedObject=null,yl.detach(),D_(null))}}function ZR(e){const t=Ns.getBoundingClientRect();return{x:(e.clientX-t.left)*(Ns.width/t.width),y:(e.clientY-t.top)*(Ns.height/t.height)}}function KR(e){const t=ZR(e);xl.x=t.x/Ns.width*2-1,xl.y=t.y/Ns.height*-2+1}function QR(e){return Ns=document.querySelector("canvas"),xl={x:0,y:0},yl=new JR().controls,window.addEventListener("mousedown",n=>{n.button===0&&(yl.dragging||(KR(n),e.pick(xl,Ne)))}),e}Te.DEFAULT_UP.set(0,0,1);const Ne=new TM,Xn=new Pn(60,window.innerWidth/window.innerHeight,.1,1e3);Xn.position.set(8,-15,15);Xn.zoom=1;const Dn=new TP({antialias:!0});Dn.setSize(window.innerWidth,window.innerHeight);Dn.setPixelRatio(window.devicePixelRatio);Dn.toneMapping=of;Dn.shadowMap.enabled=!0;Dn.shadowMap.type=I0;Dn.toneMappingExposure=2.5;Dn.physicallyCorrectLights=!0;Dn.outputColorSpace=On;document.body.appendChild(Dn.domElement);const ia=new _R(Xn,Dn.domElement);ia.enableDamping=!0;ia.mouseButtons={LEFT:null,MIDDLE:null,RIGHT:Yr.ROTATE};const I_=new v_(5);Ne.add(I_);const jR=new $R;QR(jR);function L_(){requestAnimationFrame(L_),ia.update(),Dn.render(Ne,Xn)}L_();window.addEventListener("resize",()=>{Xn.aspect=window.innerWidth/window.innerHeight,Xn.updateProjectionMatrix(),Dn.setSize(window.innerWidth,window.innerHeight)});function t3(e){switch(e.type.value){case"background_color":e3(e);break;case"controls_damping":ia.enableDamping=e.damping.value;break;case"world_axis":I_.visible=e.show.value;break;case"picker":C_.value=e.enabled.value;break;case"camera_fov":Xn.fov=e.fov.value,Xn.updateProjectionMatrix();break;case"camera_zoom":Xn.zoom=e.zoom.value,Xn.updateProjectionMatrix();break;default:console.warn("Unknown scene type:",e.type.value)}}function e3(e){let t=e.color.value;t=t.replace("#","0x"),t=parseInt(t),Ne.background=new $t(t)}function n3(e){const t=e.guid.value;if(t in Wn){const n=Wn[t];Ne.remove(n),delete Wn[t]}t in $i&&delete $i[t]}class i3 extends en{constructor(t,n){const i=[1,1,0,-1,1,0,-1,-1,0,1,-1,0,1,1,0],r=new fe;r.setAttribute("position",new te(i,3)),r.computeBoundingSphere();const s=new ri({fog:!1});super(r,s),this.light=t,this.color=n,this.type="RectAreaLightHelper";const o=[1,1,0,-1,1,0,-1,-1,0,1,1,0,-1,-1,0,1,-1,0],a=new fe;a.setAttribute("position",new te(o,3)),a.computeBoundingSphere(),this.add(new _t(a,new Sr({side:dn,fog:!1})))}updateMatrixWorld(){if(this.scale.set(.5*this.light.width,.5*this.light.height,1),this.color!==void 0)this.material.color.set(this.color),this.children[0].material.color.set(this.color);else{this.material.color.copy(this.light.color).multiplyScalar(this.light.intensity);const t=this.material.color,n=Math.max(t.r,t.g,t.b);n>1&&t.multiplyScalar(1/n),this.children[0].material.color.copy(this.material.color)}this.matrixWorld.extractRotation(this.light.matrixWorld).scale(this.scale).copyPosition(this.light.matrixWorld),this.children[0].matrixWorld.copy(this.matrixWorld)}dispose(){this.geometry.dispose(),this.material.dispose(),this.children[0].geometry.dispose(),this.children[0].material.dispose()}}class kl extends _t{constructor(){const t=kl.SkyShader,n=new ii({name:t.name,uniforms:e_.clone(t.uniforms),vertexShader:t.vertexShader,fragmentShader:t.fragmentShader,side:dn,depthWrite:!1});super(new Be(1,1,1),n),this.isSky=!0}}kl.SkyShader={name:"SkyShader",uniforms:{turbidity:{value:2},rayleigh:{value:1},mieCoefficient:{value:.005},mieDirectionalG:{value:.8},sunPosition:{value:new D},up:{value:new D(0,1,0)}},vertexShader:` +}`;class xP{constructor(){this.texture=null,this.mesh=null,this.depthNear=0,this.depthFar=0}init(t,n){if(this.texture===null){const i=new o_(t.texture);(t.depthNear!==n.depthNear||t.depthFar!==n.depthFar)&&(this.depthNear=t.depthNear,this.depthFar=t.depthFar),this.texture=i}}getMesh(t){if(this.texture!==null&&this.mesh===null){const n=t.cameras[0].viewport,i=new ii({vertexShader:_P,fragmentShader:vP,uniforms:{depthColor:{value:this.texture},depthWidth:{value:n.z},depthHeight:{value:n.w}}});this.mesh=new _t(new ta(20,20),i)}return this.mesh}reset(){this.texture=null,this.mesh=null}getDepthTexture(){return this.texture}}class yP extends jr{constructor(t,n){super();const i=this;let r=null,s=1,o=null,a="local-floor",l=1,c=null,u=null,h=null,f=null,p=null,g=null;const _=typeof XRWebGLBinding<"u",m=new xP,d={},S=n.getContextAttributes();let x=null,y=null;const T=[],P=[],R=new mt;let C=null;const b=new Pn;b.viewport=new ze;const M=new Pn;M.viewport=new ze;const L=[b,M],V=new Ew;let q=null,j=null;this.cameraAutoUpdate=!0,this.enabled=!1,this.isPresenting=!1,this.getController=function(st){let ot=T[st];return ot===void 0&&(ot=new Cc,T[st]=ot),ot.getTargetRaySpace()},this.getControllerGrip=function(st){let ot=T[st];return ot===void 0&&(ot=new Cc,T[st]=ot),ot.getGripSpace()},this.getHand=function(st){let ot=T[st];return ot===void 0&&(ot=new Cc,T[st]=ot),ot.getHandSpace()};function J(st){const ot=P.indexOf(st.inputSource);if(ot===-1)return;const Pt=T[ot];Pt!==void 0&&(Pt.update(st.inputSource,st.frame,c||o),Pt.dispatchEvent({type:st.type,data:st.inputSource}))}function W(){r.removeEventListener("select",J),r.removeEventListener("selectstart",J),r.removeEventListener("selectend",J),r.removeEventListener("squeeze",J),r.removeEventListener("squeezestart",J),r.removeEventListener("squeezeend",J),r.removeEventListener("end",W),r.removeEventListener("inputsourceschange",k);for(let st=0;st=0&&(P[Vt]=null,T[Vt].disconnect(Pt))}for(let ot=0;ot=P.length){P.push(Pt),Vt=oe;break}else if(P[oe]===null){P[oe]=Pt,Vt=oe;break}if(Vt===-1)break}const Mt=T[Vt];Mt&&Mt.connect(Pt)}}const H=new D,ct=new D;function pt(st,ot,Pt){H.setFromMatrixPosition(ot.matrixWorld),ct.setFromMatrixPosition(Pt.matrixWorld);const Vt=H.distanceTo(ct),Mt=ot.projectionMatrix.elements,oe=Pt.projectionMatrix.elements,I=Mt[14]/(Mt[10]-1),O=Mt[14]/(Mt[10]+1),U=(Mt[9]+1)/Mt[5],z=(Mt[9]-1)/Mt[5],F=(Mt[8]-1)/Mt[0],X=(oe[8]+1)/oe[0],E=I*F,rt=I*X,K=Vt/(-F+X),Q=K*-F;if(ot.matrixWorld.decompose(st.position,st.quaternion,st.scale),st.translateX(Q),st.translateZ(K),st.matrixWorld.compose(st.position,st.quaternion,st.scale),st.matrixWorldInverse.copy(st.matrixWorld).invert(),Mt[10]===-1)st.projectionMatrix.copy(ot.projectionMatrix),st.projectionMatrixInverse.copy(ot.projectionMatrixInverse);else{const it=I+K,w=O+K,v=E-Q,N=rt+(Vt-Q),Y=U*O/w*it,nt=z*O/w*it;st.projectionMatrix.makePerspective(v,N,Y,nt,it,w),st.projectionMatrixInverse.copy(st.projectionMatrix).invert()}}function ft(st,ot){ot===null?st.matrixWorld.copy(st.matrix):st.matrixWorld.multiplyMatrices(ot.matrixWorld,st.matrix),st.matrixWorldInverse.copy(st.matrixWorld).invert()}this.updateCamera=function(st){if(r===null)return;let ot=st.near,Pt=st.far;m.texture!==null&&(m.depthNear>0&&(ot=m.depthNear),m.depthFar>0&&(Pt=m.depthFar)),V.near=M.near=b.near=ot,V.far=M.far=b.far=Pt,(q!==V.near||j!==V.far)&&(r.updateRenderState({depthNear:V.near,depthFar:V.far}),q=V.near,j=V.far),V.layers.mask=st.layers.mask|6,b.layers.mask=V.layers.mask&3,M.layers.mask=V.layers.mask&5;const Vt=st.parent,Mt=V.cameras;ft(V,Vt);for(let oe=0;oe0&&(m.alphaTest.value=d.alphaTest);const S=t.get(d),x=S.envMap,y=S.envMapRotation;x&&(m.envMap.value=x,Lr.copy(y),Lr.x*=-1,Lr.y*=-1,Lr.z*=-1,x.isCubeTexture&&x.isRenderTargetTexture===!1&&(Lr.y*=-1,Lr.z*=-1),m.envMapRotation.value.setFromMatrix4(SP.makeRotationFromEuler(Lr)),m.flipEnvMap.value=x.isCubeTexture&&x.isRenderTargetTexture===!1?-1:1,m.reflectivity.value=d.reflectivity,m.ior.value=d.ior,m.refractionRatio.value=d.refractionRatio),d.lightMap&&(m.lightMap.value=d.lightMap,m.lightMapIntensity.value=d.lightMapIntensity,n(d.lightMap,m.lightMapTransform)),d.aoMap&&(m.aoMap.value=d.aoMap,m.aoMapIntensity.value=d.aoMapIntensity,n(d.aoMap,m.aoMapTransform))}function o(m,d){m.diffuse.value.copy(d.color),m.opacity.value=d.opacity,d.map&&(m.map.value=d.map,n(d.map,m.mapTransform))}function a(m,d){m.dashSize.value=d.dashSize,m.totalSize.value=d.dashSize+d.gapSize,m.scale.value=d.scale}function l(m,d,S,x){m.diffuse.value.copy(d.color),m.opacity.value=d.opacity,m.size.value=d.size*S,m.scale.value=x*.5,d.map&&(m.map.value=d.map,n(d.map,m.uvTransform)),d.alphaMap&&(m.alphaMap.value=d.alphaMap,n(d.alphaMap,m.alphaMapTransform)),d.alphaTest>0&&(m.alphaTest.value=d.alphaTest)}function c(m,d){m.diffuse.value.copy(d.color),m.opacity.value=d.opacity,m.rotation.value=d.rotation,d.map&&(m.map.value=d.map,n(d.map,m.mapTransform)),d.alphaMap&&(m.alphaMap.value=d.alphaMap,n(d.alphaMap,m.alphaMapTransform)),d.alphaTest>0&&(m.alphaTest.value=d.alphaTest)}function u(m,d){m.specular.value.copy(d.specular),m.shininess.value=Math.max(d.shininess,1e-4)}function h(m,d){d.gradientMap&&(m.gradientMap.value=d.gradientMap)}function f(m,d){m.metalness.value=d.metalness,d.metalnessMap&&(m.metalnessMap.value=d.metalnessMap,n(d.metalnessMap,m.metalnessMapTransform)),m.roughness.value=d.roughness,d.roughnessMap&&(m.roughnessMap.value=d.roughnessMap,n(d.roughnessMap,m.roughnessMapTransform)),d.envMap&&(m.envMapIntensity.value=d.envMapIntensity)}function p(m,d,S){m.ior.value=d.ior,d.sheen>0&&(m.sheenColor.value.copy(d.sheenColor).multiplyScalar(d.sheen),m.sheenRoughness.value=d.sheenRoughness,d.sheenColorMap&&(m.sheenColorMap.value=d.sheenColorMap,n(d.sheenColorMap,m.sheenColorMapTransform)),d.sheenRoughnessMap&&(m.sheenRoughnessMap.value=d.sheenRoughnessMap,n(d.sheenRoughnessMap,m.sheenRoughnessMapTransform))),d.clearcoat>0&&(m.clearcoat.value=d.clearcoat,m.clearcoatRoughness.value=d.clearcoatRoughness,d.clearcoatMap&&(m.clearcoatMap.value=d.clearcoatMap,n(d.clearcoatMap,m.clearcoatMapTransform)),d.clearcoatRoughnessMap&&(m.clearcoatRoughnessMap.value=d.clearcoatRoughnessMap,n(d.clearcoatRoughnessMap,m.clearcoatRoughnessMapTransform)),d.clearcoatNormalMap&&(m.clearcoatNormalMap.value=d.clearcoatNormalMap,n(d.clearcoatNormalMap,m.clearcoatNormalMapTransform),m.clearcoatNormalScale.value.copy(d.clearcoatNormalScale),d.side===dn&&m.clearcoatNormalScale.value.negate())),d.dispersion>0&&(m.dispersion.value=d.dispersion),d.iridescence>0&&(m.iridescence.value=d.iridescence,m.iridescenceIOR.value=d.iridescenceIOR,m.iridescenceThicknessMinimum.value=d.iridescenceThicknessRange[0],m.iridescenceThicknessMaximum.value=d.iridescenceThicknessRange[1],d.iridescenceMap&&(m.iridescenceMap.value=d.iridescenceMap,n(d.iridescenceMap,m.iridescenceMapTransform)),d.iridescenceThicknessMap&&(m.iridescenceThicknessMap.value=d.iridescenceThicknessMap,n(d.iridescenceThicknessMap,m.iridescenceThicknessMapTransform))),d.transmission>0&&(m.transmission.value=d.transmission,m.transmissionSamplerMap.value=S.texture,m.transmissionSamplerSize.value.set(S.width,S.height),d.transmissionMap&&(m.transmissionMap.value=d.transmissionMap,n(d.transmissionMap,m.transmissionMapTransform)),m.thickness.value=d.thickness,d.thicknessMap&&(m.thicknessMap.value=d.thicknessMap,n(d.thicknessMap,m.thicknessMapTransform)),m.attenuationDistance.value=d.attenuationDistance,m.attenuationColor.value.copy(d.attenuationColor)),d.anisotropy>0&&(m.anisotropyVector.value.set(d.anisotropy*Math.cos(d.anisotropyRotation),d.anisotropy*Math.sin(d.anisotropyRotation)),d.anisotropyMap&&(m.anisotropyMap.value=d.anisotropyMap,n(d.anisotropyMap,m.anisotropyMapTransform))),m.specularIntensity.value=d.specularIntensity,m.specularColor.value.copy(d.specularColor),d.specularColorMap&&(m.specularColorMap.value=d.specularColorMap,n(d.specularColorMap,m.specularColorMapTransform)),d.specularIntensityMap&&(m.specularIntensityMap.value=d.specularIntensityMap,n(d.specularIntensityMap,m.specularIntensityMapTransform))}function g(m,d){d.matcap&&(m.matcap.value=d.matcap)}function _(m,d){const S=t.get(d).light;m.referencePosition.value.setFromMatrixPosition(S.matrixWorld),m.nearDistance.value=S.shadow.camera.near,m.farDistance.value=S.shadow.camera.far}return{refreshFogUniforms:i,refreshMaterialUniforms:r}}function MP(e,t,n,i){let r={},s={},o=[];const a=e.getParameter(e.MAX_UNIFORM_BUFFER_BINDINGS);function l(S,x){const y=x.program;i.uniformBlockBinding(S,y)}function c(S,x){let y=r[S.id];y===void 0&&(g(S),y=u(S),r[S.id]=y,S.addEventListener("dispose",m));const T=x.program;i.updateUBOMapping(S,T);const P=t.render.frame;s[S.id]!==P&&(f(S),s[S.id]=P)}function u(S){const x=h();S.__bindingPointIndex=x;const y=e.createBuffer(),T=S.__size,P=S.usage;return e.bindBuffer(e.UNIFORM_BUFFER,y),e.bufferData(e.UNIFORM_BUFFER,T,P),e.bindBuffer(e.UNIFORM_BUFFER,null),e.bindBufferBase(e.UNIFORM_BUFFER,x,y),y}function h(){for(let S=0;S0&&(y+=T-P),S.__size=y,S.__cache={},this}function _(S){const x={boundary:0,storage:0};return typeof S=="number"||typeof S=="boolean"?(x.boundary=4,x.storage=4):S.isVector2?(x.boundary=8,x.storage=8):S.isVector3||S.isColor?(x.boundary=16,x.storage=12):S.isVector4?(x.boundary=16,x.storage=16):S.isMatrix3?(x.boundary=48,x.storage=48):S.isMatrix4?(x.boundary=64,x.storage=64):S.isTexture?Yt("WebGLRenderer: Texture samplers can not be part of an uniforms group."):Yt("WebGLRenderer: Unsupported uniform value type.",S),x}function m(S){const x=S.target;x.removeEventListener("dispose",m);const y=o.indexOf(x.__bindingPointIndex);o.splice(y,1),e.deleteBuffer(r[x.id]),delete r[x.id],delete s[x.id]}function d(){for(const S in r)e.deleteBuffer(r[S]);o=[],r={},s={}}return{bind:l,update:c,dispose:d}}const wP=new Uint16Array([12469,15057,12620,14925,13266,14620,13807,14376,14323,13990,14545,13625,14713,13328,14840,12882,14931,12528,14996,12233,15039,11829,15066,11525,15080,11295,15085,10976,15082,10705,15073,10495,13880,14564,13898,14542,13977,14430,14158,14124,14393,13732,14556,13410,14702,12996,14814,12596,14891,12291,14937,11834,14957,11489,14958,11194,14943,10803,14921,10506,14893,10278,14858,9960,14484,14039,14487,14025,14499,13941,14524,13740,14574,13468,14654,13106,14743,12678,14818,12344,14867,11893,14889,11509,14893,11180,14881,10751,14852,10428,14812,10128,14765,9754,14712,9466,14764,13480,14764,13475,14766,13440,14766,13347,14769,13070,14786,12713,14816,12387,14844,11957,14860,11549,14868,11215,14855,10751,14825,10403,14782,10044,14729,9651,14666,9352,14599,9029,14967,12835,14966,12831,14963,12804,14954,12723,14936,12564,14917,12347,14900,11958,14886,11569,14878,11247,14859,10765,14828,10401,14784,10011,14727,9600,14660,9289,14586,8893,14508,8533,15111,12234,15110,12234,15104,12216,15092,12156,15067,12010,15028,11776,14981,11500,14942,11205,14902,10752,14861,10393,14812,9991,14752,9570,14682,9252,14603,8808,14519,8445,14431,8145,15209,11449,15208,11451,15202,11451,15190,11438,15163,11384,15117,11274,15055,10979,14994,10648,14932,10343,14871,9936,14803,9532,14729,9218,14645,8742,14556,8381,14461,8020,14365,7603,15273,10603,15272,10607,15267,10619,15256,10631,15231,10614,15182,10535,15118,10389,15042,10167,14963,9787,14883,9447,14800,9115,14710,8665,14615,8318,14514,7911,14411,7507,14279,7198,15314,9675,15313,9683,15309,9712,15298,9759,15277,9797,15229,9773,15166,9668,15084,9487,14995,9274,14898,8910,14800,8539,14697,8234,14590,7790,14479,7409,14367,7067,14178,6621,15337,8619,15337,8631,15333,8677,15325,8769,15305,8871,15264,8940,15202,8909,15119,8775,15022,8565,14916,8328,14804,8009,14688,7614,14569,7287,14448,6888,14321,6483,14088,6171,15350,7402,15350,7419,15347,7480,15340,7613,15322,7804,15287,7973,15229,8057,15148,8012,15046,7846,14933,7611,14810,7357,14682,7069,14552,6656,14421,6316,14251,5948,14007,5528,15356,5942,15356,5977,15353,6119,15348,6294,15332,6551,15302,6824,15249,7044,15171,7122,15070,7050,14949,6861,14818,6611,14679,6349,14538,6067,14398,5651,14189,5311,13935,4958,15359,4123,15359,4153,15356,4296,15353,4646,15338,5160,15311,5508,15263,5829,15188,6042,15088,6094,14966,6001,14826,5796,14678,5543,14527,5287,14377,4985,14133,4586,13869,4257,15360,1563,15360,1642,15358,2076,15354,2636,15341,3350,15317,4019,15273,4429,15203,4732,15105,4911,14981,4932,14836,4818,14679,4621,14517,4386,14359,4156,14083,3795,13808,3437,15360,122,15360,137,15358,285,15355,636,15344,1274,15322,2177,15281,2765,15215,3223,15120,3451,14995,3569,14846,3567,14681,3466,14511,3305,14344,3121,14037,2800,13753,2467,15360,0,15360,1,15359,21,15355,89,15346,253,15325,479,15287,796,15225,1148,15133,1492,15008,1749,14856,1882,14685,1886,14506,1783,14324,1608,13996,1398,13702,1183]);let li=null;function EP(){return li===null&&(li=new AM(wP,16,16,Bs,Yi),li.name="DFG_LUT",li.minFilter=fn,li.magFilter=fn,li.wrapS=zi,li.wrapT=zi,li.generateMipmaps=!1,li.needsUpdate=!0),li}class TP{constructor(t={}){const{canvas:n=zb(),context:i=null,depth:r=!0,stencil:s=!1,alpha:o=!1,antialias:a=!1,premultipliedAlpha:l=!0,preserveDrawingBuffer:c=!1,powerPreference:u="default",failIfMajorPerformanceCaveat:h=!1,reversedDepthBuffer:f=!1,outputBufferType:p=kn}=t;this.isWebGLRenderer=!0;let g;if(i!==null){if(typeof WebGLRenderingContext<"u"&&i instanceof WebGLRenderingContext)throw new Error("THREE.WebGLRenderer: WebGL 1 is not supported since r163.");g=i.getContextAttributes().alpha}else g=o;const _=p,m=new Set([ff,hf,uf]),d=new Set([kn,Mi,zo,Vo,lf,cf]),S=new Uint32Array(4),x=new Int32Array(4);let y=null,T=null;const P=[],R=[];let C=null;this.domElement=n,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=vi,this.toneMappingExposure=1,this.transmissionResolutionScale=1;const b=this;let M=!1;this._outputColorSpace=On;let L=0,V=0,q=null,j=-1,J=null;const W=new ze,k=new ze;let H=null;const ct=new $t(0);let pt=0,ft=n.width,kt=n.height,Lt=1,Zt=null,ue=null;const st=new ze(0,0,ft,kt),ot=new ze(0,0,ft,kt);let Pt=!1;const Vt=new vf;let Mt=!1,oe=!1;const I=new he,O=new D,U=new ze,z={background:null,fog:null,environment:null,overrideMaterial:null,isScene:!0};let F=!1;function X(){return q===null?Lt:1}let E=i;function rt(A,G){return n.getContext(A,G)}try{const A={alpha:!0,depth:r,stencil:s,antialias:a,premultipliedAlpha:l,preserveDrawingBuffer:c,powerPreference:u,failIfMajorPerformanceCaveat:h};if("setAttribute"in n&&n.setAttribute("data-engine",`three.js r${sf}`),n.addEventListener("webglcontextlost",Qt,!1),n.addEventListener("webglcontextrestored",Ce,!1),n.addEventListener("webglcontextcreationerror",ye,!1),E===null){const G="webgl2";if(E=rt(G,A),E===null)throw rt(G)?new Error("Error creating WebGL context with your selected attributes."):new Error("Error creating WebGL context.")}}catch(A){throw de("WebGLRenderer: "+A.message),A}let K,Q,it,w,v,N,Y,nt,$,wt,ht,Ct,zt,ut,St,Et,It,yt,ee,B,Dt,gt,Nt,dt;function lt(){K=new E1(E),K.init(),gt=new gP(E,K),Q=new g1(E,K,t,gt),it=new pP(E,K),Q.reversedDepthBuffer&&f&&it.buffers.depth.setReversed(!0),w=new P1(E),v=new jA,N=new mP(E,K,it,v,Q,gt,w),Y=new v1(b),nt=new w1(b),$=new Iw(E),Nt=new p1(E,$),wt=new T1(E,$,w,Nt),ht=new R1(E,wt,$,w),ee=new C1(E,Q,N),Et=new _1(v),Ct=new QA(b,Y,nt,K,Q,Nt,Et),zt=new bP(b,v),ut=new eP,St=new aP(K),yt=new d1(b,Y,nt,it,ht,g,l),It=new fP(b,ht,Q),dt=new MP(E,w,Q,it),B=new m1(E,K,w),Dt=new A1(E,K,w),w.programs=Ct.programs,b.capabilities=Q,b.extensions=K,b.properties=v,b.renderLists=ut,b.shadowMap=It,b.state=it,b.info=w}lt(),_!==kn&&(C=new I1(_,n.width,n.height,r,s));const bt=new yP(b,E);this.xr=bt,this.getContext=function(){return E},this.getContextAttributes=function(){return E.getContextAttributes()},this.forceContextLoss=function(){const A=K.get("WEBGL_lose_context");A&&A.loseContext()},this.forceContextRestore=function(){const A=K.get("WEBGL_lose_context");A&&A.restoreContext()},this.getPixelRatio=function(){return Lt},this.setPixelRatio=function(A){A!==void 0&&(Lt=A,this.setSize(ft,kt,!1))},this.getSize=function(A){return A.set(ft,kt)},this.setSize=function(A,G,et=!0){if(bt.isPresenting){Yt("WebGLRenderer: Can't change size while VR device is presenting.");return}ft=A,kt=G,n.width=Math.floor(A*Lt),n.height=Math.floor(G*Lt),et===!0&&(n.style.width=A+"px",n.style.height=G+"px"),C!==null&&C.setSize(n.width,n.height),this.setViewport(0,0,A,G)},this.getDrawingBufferSize=function(A){return A.set(ft*Lt,kt*Lt).floor()},this.setDrawingBufferSize=function(A,G,et){ft=A,kt=G,Lt=et,n.width=Math.floor(A*et),n.height=Math.floor(G*et),this.setViewport(0,0,A,G)},this.setEffects=function(A){if(_===kn){console.error("THREE.WebGLRenderer: setEffects() requires outputBufferType set to HalfFloatType or FloatType.");return}if(A){for(let G=0;G{function Tt(){if(tt.forEach(function(Ut){v.get(Ut).currentProgram.isReady()&&tt.delete(Ut)}),tt.size===0){Z(A);return}setTimeout(Tt,10)}K.get("KHR_parallel_shader_compile")!==null?Tt():setTimeout(Tt,10)})};let zl=null;function O_(A){zl&&zl(A)}function Ff(){Mr.stop()}function kf(){Mr.start()}const Mr=new y_;Mr.setAnimationLoop(O_),typeof self<"u"&&Mr.setContext(self),this.setAnimationLoop=function(A){zl=A,bt.setAnimationLoop(A),A===null?Mr.stop():Mr.start()},bt.addEventListener("sessionstart",Ff),bt.addEventListener("sessionend",kf),this.render=function(A,G){if(G!==void 0&&G.isCamera!==!0){de("WebGLRenderer.render: camera is not an instance of THREE.Camera.");return}if(M===!0)return;const et=bt.enabled===!0&&bt.isPresenting===!0,tt=C!==null&&(q===null||et)&&C.begin(b,q);if(A.matrixWorldAutoUpdate===!0&&A.updateMatrixWorld(),G.parent===null&&G.matrixWorldAutoUpdate===!0&&G.updateMatrixWorld(),bt.enabled===!0&&bt.isPresenting===!0&&(C===null||C.isCompositing()===!1)&&(bt.cameraAutoUpdate===!0&&bt.updateCamera(G),G=bt.getCamera()),A.isScene===!0&&A.onBeforeRender(b,A,G,q),T=St.get(A,R.length),T.init(G),R.push(T),I.multiplyMatrices(G.projectionMatrix,G.matrixWorldInverse),Vt.setFromProjectionMatrix(I,gi,G.reversedDepth),oe=this.localClippingEnabled,Mt=Et.init(this.clippingPlanes,oe),y=ut.get(A,P.length),y.init(),P.push(y),bt.enabled===!0&&bt.isPresenting===!0){const Ut=b.xr.getDepthSensingMesh();Ut!==null&&Vl(Ut,G,-1/0,b.sortObjects)}Vl(A,G,0,b.sortObjects),y.finish(),b.sortObjects===!0&&y.sort(Zt,ue),F=bt.enabled===!1||bt.isPresenting===!1||bt.hasDepthSensing()===!1,F&&yt.addToRenderList(y,A),this.info.render.frame++,Mt===!0&&Et.beginShadows();const Z=T.state.shadowsArray;if(It.render(Z,A,G),Mt===!0&&Et.endShadows(),this.info.autoReset===!0&&this.info.reset(),(tt&&C.hasRenderPass())===!1){const Ut=y.opaque,Rt=y.transmissive;if(T.setupLights(),G.isArrayCamera){const Bt=G.cameras;if(Rt.length>0)for(let Gt=0,Jt=Bt.length;Gt0&&zf(Ut,Rt,A,G),F&&yt.render(A),Bf(y,A,G)}q!==null&&V===0&&(N.updateMultisampleRenderTarget(q),N.updateRenderTargetMipmap(q)),tt&&C.end(b),A.isScene===!0&&A.onAfterRender(b,A,G),Nt.resetDefaultState(),j=-1,J=null,R.pop(),R.length>0?(T=R[R.length-1],Mt===!0&&Et.setGlobalState(b.clippingPlanes,T.state.camera)):T=null,P.pop(),P.length>0?y=P[P.length-1]:y=null};function Vl(A,G,et,tt){if(A.visible===!1)return;if(A.layers.test(G.layers)){if(A.isGroup)et=A.renderOrder;else if(A.isLOD)A.autoUpdate===!0&&A.update(G);else if(A.isLight)T.pushLight(A),A.castShadow&&T.pushShadow(A);else if(A.isSprite){if(!A.frustumCulled||Vt.intersectsSprite(A)){tt&&U.setFromMatrixPosition(A.matrixWorld).applyMatrix4(I);const Ut=ht.update(A),Rt=A.material;Rt.visible&&y.push(A,Ut,Rt,et,U.z,null)}}else if((A.isMesh||A.isLine||A.isPoints)&&(!A.frustumCulled||Vt.intersectsObject(A))){const Ut=ht.update(A),Rt=A.material;if(tt&&(A.boundingSphere!==void 0?(A.boundingSphere===null&&A.computeBoundingSphere(),U.copy(A.boundingSphere.center)):(Ut.boundingSphere===null&&Ut.computeBoundingSphere(),U.copy(Ut.boundingSphere.center)),U.applyMatrix4(A.matrixWorld).applyMatrix4(I)),Array.isArray(Rt)){const Bt=Ut.groups;for(let Gt=0,Jt=Bt.length;Gt0&&ra(Z,G,et),Tt.length>0&&ra(Tt,G,et),Ut.length>0&&ra(Ut,G,et),it.buffers.depth.setTest(!0),it.buffers.depth.setMask(!0),it.buffers.color.setMask(!0),it.setPolygonOffset(!1)}function zf(A,G,et,tt){if((et.isScene===!0?et.overrideMaterial:null)!==null)return;if(T.state.transmissionRenderTarget[tt.id]===void 0){const le=K.has("EXT_color_buffer_half_float")||K.has("EXT_color_buffer_float");T.state.transmissionRenderTarget[tt.id]=new xi(1,1,{generateMipmaps:!0,type:le?Yi:kn,minFilter:zr,samples:Q.samples,stencilBuffer:s,resolveDepthBuffer:!1,resolveStencilBuffer:!1,colorSpace:me.workingColorSpace})}const Tt=T.state.transmissionRenderTarget[tt.id],Ut=tt.viewport||W;Tt.setSize(Ut.z*b.transmissionResolutionScale,Ut.w*b.transmissionResolutionScale);const Rt=b.getRenderTarget(),Bt=b.getActiveCubeFace(),Gt=b.getActiveMipmapLevel();b.setRenderTarget(Tt),b.getClearColor(ct),pt=b.getClearAlpha(),pt<1&&b.setClearColor(16777215,.5),b.clear(),F&&yt.render(et);const Jt=b.toneMapping;b.toneMapping=vi;const Xt=tt.viewport;if(tt.viewport!==void 0&&(tt.viewport=void 0),T.setupLightsView(tt),Mt===!0&&Et.setGlobalState(b.clippingPlanes,tt),ra(A,et,tt),N.updateMultisampleRenderTarget(Tt),N.updateRenderTargetMipmap(Tt),K.has("WEBGL_multisampled_render_to_texture")===!1){let le=!1;for(let we=0,Fe=G.length;we0),Xt=!!et.morphAttributes.position,le=!!et.morphAttributes.normal,we=!!et.morphAttributes.color;let Fe=vi;tt.toneMapped&&(q===null||q.isXRRenderTarget===!0)&&(Fe=b.toneMapping);const ke=et.morphAttributes.position||et.morphAttributes.normal||et.morphAttributes.color,Ae=ke!==void 0?ke.length:0,qt=v.get(tt),Se=T.state.lights;if(Mt===!0&&(oe===!0||A!==J)){const mn=A===J&&tt.id===j;Et.setState(tt,A,mn)}let ge=!1;tt.version===qt.__version?(qt.needsLights&&qt.lightsStateVersion!==Se.state.version||qt.outputColorSpace!==Rt||Z.isBatchedMesh&&qt.batching===!1||!Z.isBatchedMesh&&qt.batching===!0||Z.isBatchedMesh&&qt.batchingColor===!0&&Z.colorTexture===null||Z.isBatchedMesh&&qt.batchingColor===!1&&Z.colorTexture!==null||Z.isInstancedMesh&&qt.instancing===!1||!Z.isInstancedMesh&&qt.instancing===!0||Z.isSkinnedMesh&&qt.skinning===!1||!Z.isSkinnedMesh&&qt.skinning===!0||Z.isInstancedMesh&&qt.instancingColor===!0&&Z.instanceColor===null||Z.isInstancedMesh&&qt.instancingColor===!1&&Z.instanceColor!==null||Z.isInstancedMesh&&qt.instancingMorph===!0&&Z.morphTexture===null||Z.isInstancedMesh&&qt.instancingMorph===!1&&Z.morphTexture!==null||qt.envMap!==Bt||tt.fog===!0&&qt.fog!==Tt||qt.numClippingPlanes!==void 0&&(qt.numClippingPlanes!==Et.numPlanes||qt.numIntersection!==Et.numIntersection)||qt.vertexAlphas!==Gt||qt.vertexTangents!==Jt||qt.morphTargets!==Xt||qt.morphNormals!==le||qt.morphColors!==we||qt.toneMapping!==Fe||qt.morphTargetsCount!==Ae)&&(ge=!0):(ge=!0,qt.__version=tt.version);let In=qt.currentProgram;ge===!0&&(In=sa(tt,G,Z));let ns=!1,Ln=!1,to=!1;const Re=In.getUniforms(),Mn=qt.uniforms;if(it.useProgram(In.program)&&(ns=!0,Ln=!0,to=!0),tt.id!==j&&(j=tt.id,Ln=!0),ns||J!==A){it.buffers.depth.getReversed()&&A.reversedDepth!==!0&&(A._reversedDepth=!0,A.updateProjectionMatrix()),Re.setValue(E,"projectionMatrix",A.projectionMatrix),Re.setValue(E,"viewMatrix",A.matrixWorldInverse);const wn=Re.map.cameraPosition;wn!==void 0&&wn.setValue(E,O.setFromMatrixPosition(A.matrixWorld)),Q.logarithmicDepthBuffer&&Re.setValue(E,"logDepthBufFC",2/(Math.log(A.far+1)/Math.LN2)),(tt.isMeshPhongMaterial||tt.isMeshToonMaterial||tt.isMeshLambertMaterial||tt.isMeshBasicMaterial||tt.isMeshStandardMaterial||tt.isShaderMaterial)&&Re.setValue(E,"isOrthographic",A.isOrthographicCamera===!0),J!==A&&(J=A,Ln=!0,to=!0)}if(qt.needsLights&&(Se.state.directionalShadowMap.length>0&&Re.setValue(E,"directionalShadowMap",Se.state.directionalShadowMap,N),Se.state.spotShadowMap.length>0&&Re.setValue(E,"spotShadowMap",Se.state.spotShadowMap,N),Se.state.pointShadowMap.length>0&&Re.setValue(E,"pointShadowMap",Se.state.pointShadowMap,N)),Z.isSkinnedMesh){Re.setOptional(E,Z,"bindMatrix"),Re.setOptional(E,Z,"bindMatrixInverse");const mn=Z.skeleton;mn&&(mn.boneTexture===null&&mn.computeBoneTexture(),Re.setValue(E,"boneTexture",mn.boneTexture,N))}Z.isBatchedMesh&&(Re.setOptional(E,Z,"batchingTexture"),Re.setValue(E,"batchingTexture",Z._matricesTexture,N),Re.setOptional(E,Z,"batchingIdTexture"),Re.setValue(E,"batchingIdTexture",Z._indirectTexture,N),Re.setOptional(E,Z,"batchingColorTexture"),Z._colorsTexture!==null&&Re.setValue(E,"batchingColorTexture",Z._colorsTexture,N));const Hn=et.morphAttributes;if((Hn.position!==void 0||Hn.normal!==void 0||Hn.color!==void 0)&&ee.update(Z,et,In),(Ln||qt.receiveShadow!==Z.receiveShadow)&&(qt.receiveShadow=Z.receiveShadow,Re.setValue(E,"receiveShadow",Z.receiveShadow)),tt.isMeshGouraudMaterial&&tt.envMap!==null&&(Mn.envMap.value=Bt,Mn.flipEnvMap.value=Bt.isCubeTexture&&Bt.isRenderTargetTexture===!1?-1:1),tt.isMeshStandardMaterial&&tt.envMap===null&&G.environment!==null&&(Mn.envMapIntensity.value=G.environmentIntensity),Mn.dfgLUT!==void 0&&(Mn.dfgLUT.value=EP()),Ln&&(Re.setValue(E,"toneMappingExposure",b.toneMappingExposure),qt.needsLights&&k_(Mn,to),Tt&&tt.fog===!0&&zt.refreshFogUniforms(Mn,Tt),zt.refreshMaterialUniforms(Mn,tt,Lt,kt,T.state.transmissionRenderTarget[A.id]),nl.upload(E,Hf(qt),Mn,N)),tt.isShaderMaterial&&tt.uniformsNeedUpdate===!0&&(nl.upload(E,Hf(qt),Mn,N),tt.uniformsNeedUpdate=!1),tt.isSpriteMaterial&&Re.setValue(E,"center",Z.center),Re.setValue(E,"modelViewMatrix",Z.modelViewMatrix),Re.setValue(E,"normalMatrix",Z.normalMatrix),Re.setValue(E,"modelMatrix",Z.matrixWorld),tt.isShaderMaterial||tt.isRawShaderMaterial){const mn=tt.uniformsGroups;for(let wn=0,Hl=mn.length;wn0&&N.useMultisampledRTT(A)===!1?tt=v.get(A).__webglMultisampledFramebuffer:Array.isArray(Gt)?tt=Gt[et]:tt=Gt,W.copy(A.viewport),k.copy(A.scissor),H=A.scissorTest}else W.copy(st).multiplyScalar(Lt).floor(),k.copy(ot).multiplyScalar(Lt).floor(),H=Pt;if(et!==0&&(tt=z_),it.bindFramebuffer(E.FRAMEBUFFER,tt)&&it.drawBuffers(A,tt),it.viewport(W),it.scissor(k),it.setScissorTest(H),Z){const Rt=v.get(A.texture);E.framebufferTexture2D(E.FRAMEBUFFER,E.COLOR_ATTACHMENT0,E.TEXTURE_CUBE_MAP_POSITIVE_X+G,Rt.__webglTexture,et)}else if(Tt){const Rt=G;for(let Bt=0;Bt=0&&G<=A.width-tt&&et>=0&&et<=A.height-Z&&(A.textures.length>1&&E.readBuffer(E.COLOR_ATTACHMENT0+Rt),E.readPixels(G,et,tt,Z,gt.convert(Jt),gt.convert(Xt),Tt))}finally{const Gt=q!==null?v.get(q).__webglFramebuffer:null;it.bindFramebuffer(E.FRAMEBUFFER,Gt)}}},this.readRenderTargetPixelsAsync=async function(A,G,et,tt,Z,Tt,Ut,Rt=0){if(!(A&&A.isWebGLRenderTarget))throw new Error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not THREE.WebGLRenderTarget.");let Bt=v.get(A).__webglFramebuffer;if(A.isWebGLCubeRenderTarget&&Ut!==void 0&&(Bt=Bt[Ut]),Bt)if(G>=0&&G<=A.width-tt&&et>=0&&et<=A.height-Z){it.bindFramebuffer(E.FRAMEBUFFER,Bt);const Gt=A.textures[Rt],Jt=Gt.format,Xt=Gt.type;if(!Q.textureFormatReadable(Jt))throw new Error("THREE.WebGLRenderer.readRenderTargetPixelsAsync: renderTarget is not in RGBA or implementation defined format.");if(!Q.textureTypeReadable(Xt))throw new Error("THREE.WebGLRenderer.readRenderTargetPixelsAsync: renderTarget is not in UnsignedByteType or implementation defined type.");const le=E.createBuffer();E.bindBuffer(E.PIXEL_PACK_BUFFER,le),E.bufferData(E.PIXEL_PACK_BUFFER,Tt.byteLength,E.STREAM_READ),A.textures.length>1&&E.readBuffer(E.COLOR_ATTACHMENT0+Rt),E.readPixels(G,et,tt,Z,gt.convert(Jt),gt.convert(Xt),0);const we=q!==null?v.get(q).__webglFramebuffer:null;it.bindFramebuffer(E.FRAMEBUFFER,we);const Fe=E.fenceSync(E.SYNC_GPU_COMMANDS_COMPLETE,0);return E.flush(),await Vb(E,Fe,4),E.bindBuffer(E.PIXEL_PACK_BUFFER,le),E.getBufferSubData(E.PIXEL_PACK_BUFFER,0,Tt),E.deleteBuffer(le),E.deleteSync(Fe),Tt}else throw new Error("THREE.WebGLRenderer.readRenderTargetPixelsAsync: requested read bounds are out of range.")},this.copyFramebufferToTexture=function(A,G=null,et=0){const tt=Math.pow(2,-et),Z=Math.floor(A.image.width*tt),Tt=Math.floor(A.image.height*tt),Ut=G!==null?G.x:0,Rt=G!==null?G.y:0;N.setTexture2D(A,0),E.copyTexSubImage2D(E.TEXTURE_2D,et,0,0,Ut,Rt,Z,Tt),it.unbindTexture()};const V_=E.createFramebuffer(),H_=E.createFramebuffer();this.copyTextureToTexture=function(A,G,et=null,tt=null,Z=0,Tt=null){Tt===null&&(Z!==0?(Ho("WebGLRenderer: copyTextureToTexture function signature has changed to support src and dst mipmap levels."),Tt=Z,Z=0):Tt=0);let Ut,Rt,Bt,Gt,Jt,Xt,le,we,Fe;const ke=A.isCompressedTexture?A.mipmaps[Tt]:A.image;if(et!==null)Ut=et.max.x-et.min.x,Rt=et.max.y-et.min.y,Bt=et.isBox3?et.max.z-et.min.z:1,Gt=et.min.x,Jt=et.min.y,Xt=et.isBox3?et.min.z:0;else{const Hn=Math.pow(2,-Z);Ut=Math.floor(ke.width*Hn),Rt=Math.floor(ke.height*Hn),A.isDataArrayTexture?Bt=ke.depth:A.isData3DTexture?Bt=Math.floor(ke.depth*Hn):Bt=1,Gt=0,Jt=0,Xt=0}tt!==null?(le=tt.x,we=tt.y,Fe=tt.z):(le=0,we=0,Fe=0);const Ae=gt.convert(G.format),qt=gt.convert(G.type);let Se;G.isData3DTexture?(N.setTexture3D(G,0),Se=E.TEXTURE_3D):G.isDataArrayTexture||G.isCompressedArrayTexture?(N.setTexture2DArray(G,0),Se=E.TEXTURE_2D_ARRAY):(N.setTexture2D(G,0),Se=E.TEXTURE_2D),E.pixelStorei(E.UNPACK_FLIP_Y_WEBGL,G.flipY),E.pixelStorei(E.UNPACK_PREMULTIPLY_ALPHA_WEBGL,G.premultiplyAlpha),E.pixelStorei(E.UNPACK_ALIGNMENT,G.unpackAlignment);const ge=E.getParameter(E.UNPACK_ROW_LENGTH),In=E.getParameter(E.UNPACK_IMAGE_HEIGHT),ns=E.getParameter(E.UNPACK_SKIP_PIXELS),Ln=E.getParameter(E.UNPACK_SKIP_ROWS),to=E.getParameter(E.UNPACK_SKIP_IMAGES);E.pixelStorei(E.UNPACK_ROW_LENGTH,ke.width),E.pixelStorei(E.UNPACK_IMAGE_HEIGHT,ke.height),E.pixelStorei(E.UNPACK_SKIP_PIXELS,Gt),E.pixelStorei(E.UNPACK_SKIP_ROWS,Jt),E.pixelStorei(E.UNPACK_SKIP_IMAGES,Xt);const Re=A.isDataArrayTexture||A.isData3DTexture,Mn=G.isDataArrayTexture||G.isData3DTexture;if(A.isDepthTexture){const Hn=v.get(A),mn=v.get(G),wn=v.get(Hn.__renderTarget),Hl=v.get(mn.__renderTarget);it.bindFramebuffer(E.READ_FRAMEBUFFER,wn.__webglFramebuffer),it.bindFramebuffer(E.DRAW_FRAMEBUFFER,Hl.__webglFramebuffer);for(let wr=0;wr>>3){case 1:{if(s===8){r.indices.push(n.uint32());continue}if(s===10){const o=n.uint32()+n.pos;for(;n.posglobalThis.Number(t)):[]}},toJSON(e){const t={};return e.indices?.length&&(t.indices=e.indices.map(n=>Math.round(n))),t},create(e){return dr.fromPartial(e??{})},fromPartial(e){const t=Nm();return t.indices=e.indices?.map(n=>n)||[],t}};function Um(){return{guid:void 0,name:void 0,vertices:[],faces:[]}}const Df={encode(e,t=new ne){e.guid!==void 0&&t.uint32(10).string(e.guid),e.name!==void 0&&t.uint32(18).string(e.name);for(const n of e.vertices)Ht.encode(n,t.uint32(26).fork()).join();for(const n of e.faces)dr.encode(n,t.uint32(34).fork()).join();return t},decode(e,t){const n=e instanceof xt?e:new xt(e),i=t===void 0?n.len:n.pos+t,r=Um();for(;n.pos>>3){case 1:{if(s!==10)break;r.guid=n.string();continue}case 2:{if(s!==18)break;r.name=n.string();continue}case 3:{if(s!==26)break;r.vertices.push(Ht.decode(n,n.uint32()));continue}case 4:{if(s!==34)break;r.faces.push(dr.decode(n,n.uint32()));continue}}if((s&7)===4||s===0)break;n.skip(s&7)}return r},fromJSON(e){return{guid:xl(e.guid)?globalThis.String(e.guid):void 0,name:xl(e.name)?globalThis.String(e.name):void 0,vertices:globalThis.Array.isArray(e?.vertices)?e.vertices.map(t=>Ht.fromJSON(t)):[],faces:globalThis.Array.isArray(e?.faces)?e.faces.map(t=>dr.fromJSON(t)):[]}},toJSON(e){const t={};return e.guid!==void 0&&(t.guid=e.guid),e.name!==void 0&&(t.name=e.name),e.vertices?.length&&(t.vertices=e.vertices.map(n=>Ht.toJSON(n))),e.faces?.length&&(t.faces=e.faces.map(n=>dr.toJSON(n))),t},create(e){return Df.fromPartial(e??{})},fromPartial(e){const t=Um();return t.guid=e.guid??void 0,t.name=e.name??void 0,t.vertices=e.vertices?.map(n=>Ht.fromPartial(n))||[],t.faces=e.faces?.map(n=>dr.fromPartial(n))||[],t}};function Om(){return{vertexIndices:[]}}const pr={encode(e,t=new ne){t.uint32(10).fork();for(const n of e.vertexIndices)t.int32(n);return t.join(),t},decode(e,t){const n=e instanceof xt?e:new xt(e),i=t===void 0?n.len:n.pos+t,r=Om();for(;n.pos>>3){case 1:{if(s===8){r.vertexIndices.push(n.int32());continue}if(s===10){const o=n.uint32()+n.pos;for(;n.posglobalThis.Number(t)):globalThis.Array.isArray(e?.vertex_indices)?e.vertex_indices.map(t=>globalThis.Number(t)):[]}},toJSON(e){const t={};return e.vertexIndices?.length&&(t.vertexIndices=e.vertexIndices.map(n=>Math.round(n))),t},create(e){return pr.fromPartial(e??{})},fromPartial(e){const t=Om();return t.vertexIndices=e.vertexIndices?.map(n=>n)||[],t}};function Fm(){return{guid:void 0,name:void 0,vertices:[],faces:[]}}const If={encode(e,t=new ne){e.guid!==void 0&&t.uint32(10).string(e.guid),e.name!==void 0&&t.uint32(18).string(e.name);for(const n of e.vertices)Ht.encode(n,t.uint32(26).fork()).join();for(const n of e.faces)pr.encode(n,t.uint32(34).fork()).join();return t},decode(e,t){const n=e instanceof xt?e:new xt(e),i=t===void 0?n.len:n.pos+t,r=Fm();for(;n.pos>>3){case 1:{if(s!==10)break;r.guid=n.string();continue}case 2:{if(s!==18)break;r.name=n.string();continue}case 3:{if(s!==26)break;r.vertices.push(Ht.decode(n,n.uint32()));continue}case 4:{if(s!==34)break;r.faces.push(pr.decode(n,n.uint32()));continue}}if((s&7)===4||s===0)break;n.skip(s&7)}return r},fromJSON(e){return{guid:xl(e.guid)?globalThis.String(e.guid):void 0,name:xl(e.name)?globalThis.String(e.name):void 0,vertices:globalThis.Array.isArray(e?.vertices)?e.vertices.map(t=>Ht.fromJSON(t)):[],faces:globalThis.Array.isArray(e?.faces)?e.faces.map(t=>pr.fromJSON(t)):[]}},toJSON(e){const t={};return e.guid!==void 0&&(t.guid=e.guid),e.name!==void 0&&(t.name=e.name),e.vertices?.length&&(t.vertices=e.vertices.map(n=>Ht.toJSON(n))),e.faces?.length&&(t.faces=e.faces.map(n=>pr.toJSON(n))),t},create(e){return If.fromPartial(e??{})},fromPartial(e){const t=Fm();return t.guid=e.guid??void 0,t.name=e.name??void 0,t.vertices=e.vertices?.map(n=>Ht.fromPartial(n))||[],t.faces=e.faces?.map(n=>pr.fromPartial(n))||[],t}};function xl(e){return e!=null}class jC{data;constructor(t){let n;if("bytes"in t?n=tR(t.bytes):n=t.data,!n.vertexIndices)throw new Error("Invalid FaceData: Missing required property 'vertices'.");this.data=n}get bytes(){return eR(this.data)}get vertexIndices(){return this.data.vertexIndices}}function tR(e){return pr.decode(e)}function eR(e){return pr.encode(e).finish()}class nR{data;_points;_faces;constructor(t){let n;if("bytes"in t?n=iR(t.bytes):n=t.data,!n.vertices||!n.faces)throw new Error("Invalid PolyhedronData: Missing required properties (vertices or faces).");this.data=n}get bytes(){return rR(this.data)}get guid(){return this.data.guid?this.data.guid:""}get name(){return this.data.name?this.data.name:""}get vertices(){if(!this._points){this._points=[];for(const t of this.data.vertices){const n=new Yn({data:t});this._points.push(n)}}return this._points}get faces(){if(!this._faces){this._faces=[];for(const t of this.data.faces){const n=new jC({data:t});this._faces.push(n)}}return this._faces}buildGeometry(){const t=new fe,n=new Float32Array(this.vertices.length*3);for(let o=0;on&&l.add(L)}l.normalize(),g.setXYZ(d+T,l.x,l.y,l.z)}}return u.setAttribute("normal",g),u}class cR{data;_vertices;constructor(t){let n;if("bytes"in t?n=uR(t.bytes):n=t.data,!n.vertices||!n.faces)throw new Error("Invalid MeshData: Missing required properties (vertices or faces).");this.data=n}get bytes(){return hR(this.data)}get guid(){return this.data.guid?this.data.guid:""}get name(){return this.data.name?this.data.name:""}get vertices(){if(!this._vertices){this._vertices=[];for(const t of this.data.vertices){const n=new Yn({data:t});this._vertices.push(n)}}return this._vertices}get faces(){const t=[];for(const n of this.data.faces){const i=new sR({data:n});t.push(i)}return t}buildGeometry(){let t=new fe;const n=new Float32Array(this.vertices.length*3);this.vertices.forEach((o,a)=>{n[a*3]=o.x,n[a*3+1]=o.y,n[a*3+2]=o.z});const i=[];for(const o of this.faces){const a=o.indices;for(let l=1;lMath.PI&&(i-=En),r<-Math.PI?r+=En:r>Math.PI&&(r-=En),i<=r?this._spherical.theta=Math.max(i,Math.min(r,this._spherical.theta)):this._spherical.theta=this._spherical.theta>(i+r)/2?Math.max(i,this._spherical.theta):Math.min(r,this._spherical.theta)),this._spherical.phi=Math.max(this.minPolarAngle,Math.min(this.maxPolarAngle,this._spherical.phi)),this._spherical.makeSafe(),this.enableDamping===!0?this.target.addScaledVector(this._panOffset,this.dampingFactor):this.target.add(this._panOffset),this.target.sub(this.cursor),this.target.clampLength(this.minTargetRadius,this.maxTargetRadius),this.target.add(this.cursor);let s=!1;if(this.zoomToCursor&&this._performCursorZoom||this.object.isOrthographicCamera)this._spherical.radius=this._clampDistance(this._spherical.radius);else{const o=this._spherical.radius;this._spherical.radius=this._clampDistance(this._spherical.radius*this._scale),s=o!=this._spherical.radius}if(Ye.setFromSpherical(this._spherical),Ye.applyQuaternion(this._quatInverse),n.copy(this.target).add(Ye),this.object.lookAt(this.target),this.enableDamping===!0?(this._sphericalDelta.theta*=1-this.dampingFactor,this._sphericalDelta.phi*=1-this.dampingFactor,this._panOffset.multiplyScalar(1-this.dampingFactor)):(this._sphericalDelta.set(0,0,0),this._panOffset.set(0,0,0)),this.zoomToCursor&&this._performCursorZoom){let o=null;if(this.object.isPerspectiveCamera){const a=Ye.length();o=this._clampDistance(a*this._scale);const l=a-o;this.object.position.addScaledVector(this._dollyDirection,l),this.object.updateMatrixWorld(),s=!!l}else if(this.object.isOrthographicCamera){const a=new D(this._mouse.x,this._mouse.y,0);a.unproject(this.object);const l=this.object.zoom;this.object.zoom=Math.max(this.minZoom,Math.min(this.maxZoom,this.object.zoom/this._scale)),this.object.updateProjectionMatrix(),s=l!==this.object.zoom;const c=new D(this._mouse.x,this._mouse.y,0);c.unproject(this.object),this.object.position.sub(c).add(a),this.object.updateMatrixWorld(),o=Ye.length()}else console.warn("WARNING: OrbitControls.js encountered an unknown camera type - zoom to cursor disabled."),this.zoomToCursor=!1;o!==null&&(this.screenSpacePanning?this.target.set(0,0,-1).transformDirection(this.object.matrix).multiplyScalar(o).add(this.object.position):(Va.origin.copy(this.object.position),Va.direction.set(0,0,-1).transformDirection(this.object.matrix),Math.abs(this.object.up.dot(Va.direction))<_R?this.object.lookAt(this.target):(Bm.setFromNormalAndCoplanarPoint(this.object.up,this.target),Va.intersectPlane(Bm,this.target))))}else if(this.object.isOrthographicCamera){const o=this.object.zoom;this.object.zoom=Math.max(this.minZoom,Math.min(this.maxZoom,this.object.zoom/this._scale)),o!==this.object.zoom&&(this.object.updateProjectionMatrix(),s=!0)}return this._scale=1,this._performCursorZoom=!1,s||this._lastPosition.distanceToSquared(this.object.position)>Gc||8*(1-this._lastQuaternion.dot(this.object.quaternion))>Gc||this._lastTargetPosition.distanceToSquared(this.target)>Gc?(this.dispatchEvent(km),this._lastPosition.copy(this.object.position),this._lastQuaternion.copy(this.object.quaternion),this._lastTargetPosition.copy(this.target),!0):!1}_getAutoRotationAngle(t){return t!==null?En/60*this.autoRotateSpeed*t:En/60/60*this.autoRotateSpeed}_getZoomScale(t){const n=Math.abs(t*.01);return Math.pow(.95,this.zoomSpeed*n)}_rotateLeft(t){this._sphericalDelta.theta-=t}_rotateUp(t){this._sphericalDelta.phi-=t}_panLeft(t,n){Ye.setFromMatrixColumn(n,0),Ye.multiplyScalar(-t),this._panOffset.add(Ye)}_panUp(t,n){this.screenSpacePanning===!0?Ye.setFromMatrixColumn(n,1):(Ye.setFromMatrixColumn(n,0),Ye.crossVectors(this.object.up,Ye)),Ye.multiplyScalar(t),this._panOffset.add(Ye)}_pan(t,n){const i=this.domElement;if(this.object.isPerspectiveCamera){const r=this.object.position;Ye.copy(r).sub(this.target);let s=Ye.length();s*=Math.tan(this.object.fov/2*Math.PI/180),this._panLeft(2*t*s/i.clientHeight,this.object.matrix),this._panUp(2*n*s/i.clientHeight,this.object.matrix)}else this.object.isOrthographicCamera?(this._panLeft(t*(this.object.right-this.object.left)/this.object.zoom/i.clientWidth,this.object.matrix),this._panUp(n*(this.object.top-this.object.bottom)/this.object.zoom/i.clientHeight,this.object.matrix)):(console.warn("WARNING: OrbitControls.js encountered an unknown camera type - pan disabled."),this.enablePan=!1)}_dollyOut(t){this.object.isPerspectiveCamera||this.object.isOrthographicCamera?this._scale/=t:(console.warn("WARNING: OrbitControls.js encountered an unknown camera type - dolly/zoom disabled."),this.enableZoom=!1)}_dollyIn(t){this.object.isPerspectiveCamera||this.object.isOrthographicCamera?this._scale*=t:(console.warn("WARNING: OrbitControls.js encountered an unknown camera type - dolly/zoom disabled."),this.enableZoom=!1)}_updateZoomParameters(t,n){if(!this.zoomToCursor)return;this._performCursorZoom=!0;const i=this.domElement.getBoundingClientRect(),r=t-i.left,s=n-i.top,o=i.width,a=i.height;this._mouse.x=r/o*2-1,this._mouse.y=-(s/a)*2+1,this._dollyDirection.set(this._mouse.x,this._mouse.y,1).unproject(this.object).sub(this.object.position).normalize()}_clampDistance(t){return Math.max(this.minDistance,Math.min(this.maxDistance,t))}_handleMouseDownRotate(t){this._rotateStart.set(t.clientX,t.clientY)}_handleMouseDownDolly(t){this._updateZoomParameters(t.clientX,t.clientX),this._dollyStart.set(t.clientX,t.clientY)}_handleMouseDownPan(t){this._panStart.set(t.clientX,t.clientY)}_handleMouseMoveRotate(t){this._rotateEnd.set(t.clientX,t.clientY),this._rotateDelta.subVectors(this._rotateEnd,this._rotateStart).multiplyScalar(this.rotateSpeed);const n=this.domElement;this._rotateLeft(En*this._rotateDelta.x/n.clientHeight),this._rotateUp(En*this._rotateDelta.y/n.clientHeight),this._rotateStart.copy(this._rotateEnd),this.update()}_handleMouseMoveDolly(t){this._dollyEnd.set(t.clientX,t.clientY),this._dollyDelta.subVectors(this._dollyEnd,this._dollyStart),this._dollyDelta.y>0?this._dollyOut(this._getZoomScale(this._dollyDelta.y)):this._dollyDelta.y<0&&this._dollyIn(this._getZoomScale(this._dollyDelta.y)),this._dollyStart.copy(this._dollyEnd),this.update()}_handleMouseMovePan(t){this._panEnd.set(t.clientX,t.clientY),this._panDelta.subVectors(this._panEnd,this._panStart).multiplyScalar(this.panSpeed),this._pan(this._panDelta.x,this._panDelta.y),this._panStart.copy(this._panEnd),this.update()}_handleMouseWheel(t){this._updateZoomParameters(t.clientX,t.clientY),t.deltaY<0?this._dollyIn(this._getZoomScale(t.deltaY)):t.deltaY>0&&this._dollyOut(this._getZoomScale(t.deltaY)),this.update()}_handleKeyDown(t){let n=!1;switch(t.code){case this.keys.UP:t.ctrlKey||t.metaKey||t.shiftKey?this.enableRotate&&this._rotateUp(En*this.keyRotateSpeed/this.domElement.clientHeight):this.enablePan&&this._pan(0,this.keyPanSpeed),n=!0;break;case this.keys.BOTTOM:t.ctrlKey||t.metaKey||t.shiftKey?this.enableRotate&&this._rotateUp(-En*this.keyRotateSpeed/this.domElement.clientHeight):this.enablePan&&this._pan(0,-this.keyPanSpeed),n=!0;break;case this.keys.LEFT:t.ctrlKey||t.metaKey||t.shiftKey?this.enableRotate&&this._rotateLeft(En*this.keyRotateSpeed/this.domElement.clientHeight):this.enablePan&&this._pan(this.keyPanSpeed,0),n=!0;break;case this.keys.RIGHT:t.ctrlKey||t.metaKey||t.shiftKey?this.enableRotate&&this._rotateLeft(-En*this.keyRotateSpeed/this.domElement.clientHeight):this.enablePan&&this._pan(-this.keyPanSpeed,0),n=!0;break}n&&(t.preventDefault(),this.update())}_handleTouchStartRotate(t){if(this._pointers.length===1)this._rotateStart.set(t.pageX,t.pageY);else{const n=this._getSecondPointerPosition(t),i=.5*(t.pageX+n.x),r=.5*(t.pageY+n.y);this._rotateStart.set(i,r)}}_handleTouchStartPan(t){if(this._pointers.length===1)this._panStart.set(t.pageX,t.pageY);else{const n=this._getSecondPointerPosition(t),i=.5*(t.pageX+n.x),r=.5*(t.pageY+n.y);this._panStart.set(i,r)}}_handleTouchStartDolly(t){const n=this._getSecondPointerPosition(t),i=t.pageX-n.x,r=t.pageY-n.y,s=Math.sqrt(i*i+r*r);this._dollyStart.set(0,s)}_handleTouchStartDollyPan(t){this.enableZoom&&this._handleTouchStartDolly(t),this.enablePan&&this._handleTouchStartPan(t)}_handleTouchStartDollyRotate(t){this.enableZoom&&this._handleTouchStartDolly(t),this.enableRotate&&this._handleTouchStartRotate(t)}_handleTouchMoveRotate(t){if(this._pointers.length==1)this._rotateEnd.set(t.pageX,t.pageY);else{const i=this._getSecondPointerPosition(t),r=.5*(t.pageX+i.x),s=.5*(t.pageY+i.y);this._rotateEnd.set(r,s)}this._rotateDelta.subVectors(this._rotateEnd,this._rotateStart).multiplyScalar(this.rotateSpeed);const n=this.domElement;this._rotateLeft(En*this._rotateDelta.x/n.clientHeight),this._rotateUp(En*this._rotateDelta.y/n.clientHeight),this._rotateStart.copy(this._rotateEnd)}_handleTouchMovePan(t){if(this._pointers.length===1)this._panEnd.set(t.pageX,t.pageY);else{const n=this._getSecondPointerPosition(t),i=.5*(t.pageX+n.x),r=.5*(t.pageY+n.y);this._panEnd.set(i,r)}this._panDelta.subVectors(this._panEnd,this._panStart).multiplyScalar(this.panSpeed),this._pan(this._panDelta.x,this._panDelta.y),this._panStart.copy(this._panEnd)}_handleTouchMoveDolly(t){const n=this._getSecondPointerPosition(t),i=t.pageX-n.x,r=t.pageY-n.y,s=Math.sqrt(i*i+r*r);this._dollyEnd.set(0,s),this._dollyDelta.set(0,Math.pow(this._dollyEnd.y/this._dollyStart.y,this.zoomSpeed)),this._dollyOut(this._dollyDelta.y),this._dollyStart.copy(this._dollyEnd);const o=(t.pageX+n.x)*.5,a=(t.pageY+n.y)*.5;this._updateZoomParameters(o,a)}_handleTouchMoveDollyPan(t){this.enableZoom&&this._handleTouchMoveDolly(t),this.enablePan&&this._handleTouchMovePan(t)}_handleTouchMoveDollyRotate(t){this.enableZoom&&this._handleTouchMoveDolly(t),this.enableRotate&&this._handleTouchMoveRotate(t)}_addPointer(t){this._pointers.push(t.pointerId)}_removePointer(t){delete this._pointerPositions[t.pointerId];for(let n=0;n.9&&(o.visible=!1)),this.axis==="Y"&&(Le.setFromEuler(Ha.set(0,0,Math.PI/2)),o.quaternion.copy(i).multiply(Le),Math.abs(Pe.copy(Or).applyQuaternion(i).dot(this.eye))>.9&&(o.visible=!1)),this.axis==="Z"&&(Le.setFromEuler(Ha.set(0,Math.PI/2,0)),o.quaternion.copy(i).multiply(Le),Math.abs(Pe.copy(So).applyQuaternion(i).dot(this.eye))>.9&&(o.visible=!1)),this.axis==="XYZE"&&(Le.setFromEuler(Ha.set(0,Math.PI/2,0)),Pe.copy(this.rotationAxis),o.quaternion.setFromRotationMatrix(Xm.lookAt(Wm,Pe,Or)),o.quaternion.multiply(Le),o.visible=this.dragging),this.axis==="E"&&(o.visible=!1)):o.name==="START"?(o.position.copy(this.worldPositionStart),o.visible=this.dragging):o.name==="END"?(o.position.copy(this.worldPosition),o.visible=this.dragging):o.name==="DELTA"?(o.position.copy(this.worldPositionStart),o.quaternion.copy(this.worldQuaternionStart),cn.set(1e-10,1e-10,1e-10).add(this.worldPositionStart).sub(this.worldPosition).multiplyScalar(-1),cn.applyQuaternion(this.worldQuaternionStart.clone().invert()),o.scale.copy(cn),o.visible=this.dragging):(o.quaternion.copy(i),this.dragging?o.position.copy(this.worldPositionStart):o.position.copy(this.worldPosition),this.axis&&(o.visible=this.axis.search(o.name)!==-1));continue}o.quaternion.copy(i),this.mode==="translate"||this.mode==="scale"?(o.name==="X"&&Math.abs(Pe.copy(yo).applyQuaternion(i).dot(this.eye))>.99&&(o.scale.set(1e-10,1e-10,1e-10),o.visible=!1),o.name==="Y"&&Math.abs(Pe.copy(Or).applyQuaternion(i).dot(this.eye))>.99&&(o.scale.set(1e-10,1e-10,1e-10),o.visible=!1),o.name==="Z"&&Math.abs(Pe.copy(So).applyQuaternion(i).dot(this.eye))>.99&&(o.scale.set(1e-10,1e-10,1e-10),o.visible=!1),o.name==="XY"&&Math.abs(Pe.copy(So).applyQuaternion(i).dot(this.eye))<.2&&(o.scale.set(1e-10,1e-10,1e-10),o.visible=!1),o.name==="YZ"&&Math.abs(Pe.copy(yo).applyQuaternion(i).dot(this.eye))<.2&&(o.scale.set(1e-10,1e-10,1e-10),o.visible=!1),o.name==="XZ"&&Math.abs(Pe.copy(Or).applyQuaternion(i).dot(this.eye))<.2&&(o.scale.set(1e-10,1e-10,1e-10),o.visible=!1)):this.mode==="rotate"&&(Ga.copy(i),Pe.copy(this.eye).applyQuaternion(Le.copy(i).invert()),o.name.search("E")!==-1&&o.quaternion.setFromRotationMatrix(Xm.lookAt(this.eye,Wm,Or)),o.name==="X"&&(Le.setFromAxisAngle(yo,Math.atan2(-Pe.y,Pe.z)),Le.multiplyQuaternions(Ga,Le),o.quaternion.copy(Le)),o.name==="Y"&&(Le.setFromAxisAngle(Or,Math.atan2(Pe.x,Pe.z)),Le.multiplyQuaternions(Ga,Le),o.quaternion.copy(Le)),o.name==="Z"&&(Le.setFromAxisAngle(So,Math.atan2(Pe.y,Pe.x)),Le.multiplyQuaternions(Ga,Le),o.quaternion.copy(Le))),o.visible=o.visible&&(o.name.indexOf("X")===-1||this.showX),o.visible=o.visible&&(o.name.indexOf("Y")===-1||this.showY),o.visible=o.visible&&(o.name.indexOf("Z")===-1||this.showZ),o.visible=o.visible&&(o.name.indexOf("E")===-1||this.showX&&this.showY&&this.showZ),o.material._color=o.material._color||o.material.color.clone(),o.material._opacity=o.material._opacity||o.material.opacity,o.material.color.copy(o.material._color),o.material.opacity=o.material._opacity,this.enabled&&this.axis&&(o.name===this.axis?(o.material.color.copy(this.materialLib.active.color),o.material.opacity=1):this.axis.split("").some(function(l){return o.name===l})&&(o.material.color.copy(this.materialLib.active.color),o.material.opacity=1))}super.updateMatrixWorld(t)}}class BR extends _t{constructor(){super(new ta(1e5,1e5,2,2),new Sr({visible:!1,wireframe:!0,side:yn,transparent:!0,opacity:.1,toneMapped:!1})),this.isTransformControlsPlane=!0,this.type="TransformControlsPlane"}updateMatrixWorld(t){let n=this.space;switch(this.position.copy(this.worldPosition),this.mode==="scale"&&(n="local"),Wa.copy(yo).applyQuaternion(n==="local"?this.worldQuaternion:il),ho.copy(Or).applyQuaternion(n==="local"?this.worldQuaternion:il),fo.copy(So).applyQuaternion(n==="local"?this.worldQuaternion:il),Pe.copy(ho),this.mode){case"translate":case"scale":switch(this.axis){case"X":Pe.copy(this.eye).cross(Wa),ci.copy(Wa).cross(Pe);break;case"Y":Pe.copy(this.eye).cross(ho),ci.copy(ho).cross(Pe);break;case"Z":Pe.copy(this.eye).cross(fo),ci.copy(fo).cross(Pe);break;case"XY":ci.copy(fo);break;case"YZ":ci.copy(Wa);break;case"XZ":Pe.copy(fo),ci.copy(ho);break;case"XYZ":case"E":ci.set(0,0,0);break}break;default:ci.set(0,0,0)}ci.length()===0?this.quaternion.copy(this.cameraQuaternion):(qm.lookAt(cn.set(0,0,0),ci,Pe),this.quaternion.setFromRotationMatrix(qm)),super.updateMatrixWorld(t)}}const $i={},Xs={};function Ym(e){let t;switch(e.type.value){case"standard_material":t=zR(e);break;case"line_material":t=VR(e);break;case"point_material":t=HR(e);break;case"physical_material":t=GR(e);break}Xs[e.guid.value]=t,$i[e.geometry_guid.value]=e.guid.value,YR(e.geometry_guid.value,t)}function zR(e){let t=e.color.value;t=t.replace("#","0x");let n=e.emissive.value;return n=n.replace("#","0x"),new Qs({color:parseInt(t),metalness:e.metalness.value,roughness:e.roughness.value,emissive:parseInt(n),emissiveIntensity:e.emissive_intensity.value,flatShading:e.flat_shading.value,wireframe:e.wireframe.value,side:yn})}function VR(e){let t=e.color.value;return t=t.replace("#","0x"),new ri({color:parseInt(t)})}function HR(e){let t=e.color.value;return t=t.replace("#","0x"),new xf({color:parseInt(t),size:e.size.value})}function GR(e){let t=e.color.value;t=t.replace("#","0x");let n=e.emissive.value;n=n.replace("#","0x");let i=e.attenuation_color.value;i=i.replace("#","0x");let r=e.sheen_color.value;r=r.replace("#","0x");let s=e.specular_color.value;return s=s.replace("#","0x"),new fw({color:parseInt(t),metalness:e.metalness.value,roughness:e.roughness.value,emissive:parseInt(n),emissiveIntensity:e.emissive_intensity.value,flatShading:e.flat_shading.value,wireframe:e.wireframe.value,side:yn,anisotropy:e.anisotropy.value,anisotropyRotation:e.anisotropy_rotation.value,attenuationColor:parseInt(i),attenuationDistance:e.attenuation_distance.value,clearcoat:e.clearcoat.value,clearcoatRoughness:e.clearcoat_roughness.value,dispersion:e.dispersion.value,ior:e.ior.value,iridescence:e.iridescence.value,iridescenceIOR:e.iridescence_ior.value,iridescenceThicknessRange:[e.iridescence_thickness_start.value,e.iridescence_thickness_end.value],reflectivity:e.reflectivity.value,sheen:e.sheen.value,sheenColor:parseInt(r),specularColor:parseInt(s),sheenRoughness:e.sheen_roughness.value,specularIntensity:e.specular_intensity.value,thickness:e.thickness.value,transmission:e.transmission.value})}const Wn={},WR=["Line","Point","Vector","Frame","Plane","Polyline"];function XR(e){console.log(e.name),WR.includes(e.name)&&qR(e);const t=e.guid,n=Wn[t],i=e.buildGeometry();if(!i||!(i instanceof _t))return;const r=i.geometry;if(r.computeBoundingSphere(),r.computeBoundingBox(),n instanceof _t){const s=n.geometry;n.geometry=r,n.position.copy(i.position),n.quaternion.copy(i.quaternion),n.scale.copy(i.scale),s&&s.dispose()}else{if($i[t]){const s=$i[t];Xs[s]&&(i.material=Xs[s])}else i.material=new Qs({color:35071,roughness:.5,metalness:.5});Ne.add(i),Wn[t]=i}}function qR(e){const t=e.buildGeometry(),n=e.guid;let i;if($i[n]){const r=$i[n];Xs[r]&&(i=Xs[r])}else return;t instanceof en||t instanceof yf?t.material=i:(t instanceof Rf||t instanceof void 0)&&t.setColor(i.color),Ne.add(t),Wn[n]=t}function YR(e,t){const n=Wn[e];if(n){if(n){n.material=t;return}(n instanceof Rf||n instanceof void 0)&&n.setColor(t.color)}}const xr=Xi({title:"Object Infos",isVisible:!1,data:null}),lh=Xi({title:"Sidebar Infos",isVisible:!1,data:null}),C_=Xi({value:!0});function JR(){xr.isVisible=!0}function R_(){xr.isVisible=!1}function D_(e){delete e.dispatch,xr.data=e}document.addEventListener("keydown",e=>{(e.key==="I"||e.key==="i")&&(xr.isVisible?R_():JR())});let yl,Ns,Sl;class $R{tControl;constructor(){this.tControl=new DR(Xn,Dn.domElement),Ne.add(this.tControl.getHelper()),this.setupEventListeners()}setupEventListeners(){this.tControl.addEventListener("dragging-changed",t=>{ia.enabled=!t.value}),window.addEventListener("keydown",t=>{switch(t.key){case"w":this.tControl.setMode("translate");break;case"e":this.tControl.setMode("rotate");break;case"r":this.tControl.setMode("scale");break;case"Escape":this.tControl.detach();break}})}get controls(){return this.tControl}}class ZR{raycaster;pickedObject;constructor(){this.raycaster=new __,this.pickedObject=null}pick(t,n){if(!C_.value)return;this.raycaster.setFromCamera(t,Xn);const i=this.raycaster.intersectObjects(Wn?Object.values(Wn):[],!0);if(i.length){this.pickedObject=i[0].object,Sl.attach(this.pickedObject);const r=Object.keys(Wn).find(o=>Wn[o]===this.pickedObject);N_({dispatch:"object_picked",guid:r}),console.log("Picked object key:",r)}else this.pickedObject&&(this.pickedObject=null,Sl.detach(),D_(null))}}function KR(e){const t=Ns.getBoundingClientRect();return{x:(e.clientX-t.left)*(Ns.width/t.width),y:(e.clientY-t.top)*(Ns.height/t.height)}}function QR(e){const t=KR(e);yl.x=t.x/Ns.width*2-1,yl.y=t.y/Ns.height*-2+1}function jR(e){return Ns=document.querySelector("canvas"),yl={x:0,y:0},Sl=new $R().controls,window.addEventListener("mousedown",n=>{n.button===0&&(Sl.dragging||(QR(n),e.pick(yl,Ne)))}),e}Te.DEFAULT_UP.set(0,0,1);const Ne=new TM,Xn=new Pn(60,window.innerWidth/window.innerHeight,.1,1e3);Xn.position.set(8,-15,15);Xn.zoom=1;const Dn=new TP({antialias:!0});Dn.setSize(window.innerWidth,window.innerHeight);Dn.setPixelRatio(window.devicePixelRatio);Dn.toneMapping=of;Dn.shadowMap.enabled=!0;Dn.shadowMap.type=I0;Dn.toneMappingExposure=2.5;Dn.physicallyCorrectLights=!0;Dn.outputColorSpace=On;document.body.appendChild(Dn.domElement);const ia=new vR(Xn,Dn.domElement);ia.enableDamping=!0;ia.mouseButtons={LEFT:null,MIDDLE:null,RIGHT:Yr.ROTATE};const I_=new v_(5);Ne.add(I_);const t3=new ZR;jR(t3);function L_(){requestAnimationFrame(L_),ia.update(),Dn.render(Ne,Xn)}L_();window.addEventListener("resize",()=>{Xn.aspect=window.innerWidth/window.innerHeight,Xn.updateProjectionMatrix(),Dn.setSize(window.innerWidth,window.innerHeight)});function e3(e){switch(e.type.value){case"background_color":n3(e);break;case"controls_damping":ia.enableDamping=e.damping.value;break;case"world_axis":I_.visible=e.show.value;break;case"picker":C_.value=e.enabled.value;break;case"camera_fov":Xn.fov=e.fov.value,Xn.updateProjectionMatrix();break;case"camera_zoom":Xn.zoom=e.zoom.value,Xn.updateProjectionMatrix();break;default:console.warn("Unknown scene type:",e.type.value)}}function n3(e){let t=e.color.value;t=t.replace("#","0x"),t=parseInt(t),Ne.background=new $t(t)}function i3(e){const t=e.guid.value;if(t in Wn){const n=Wn[t];Ne.remove(n),delete Wn[t]}t in $i&&delete $i[t]}class r3 extends en{constructor(t,n){const i=[1,1,0,-1,1,0,-1,-1,0,1,-1,0,1,1,0],r=new fe;r.setAttribute("position",new te(i,3)),r.computeBoundingSphere();const s=new ri({fog:!1});super(r,s),this.light=t,this.color=n,this.type="RectAreaLightHelper";const o=[1,1,0,-1,1,0,-1,-1,0,1,1,0,-1,-1,0,1,-1,0],a=new fe;a.setAttribute("position",new te(o,3)),a.computeBoundingSphere(),this.add(new _t(a,new Sr({side:dn,fog:!1})))}updateMatrixWorld(){if(this.scale.set(.5*this.light.width,.5*this.light.height,1),this.color!==void 0)this.material.color.set(this.color),this.children[0].material.color.set(this.color);else{this.material.color.copy(this.light.color).multiplyScalar(this.light.intensity);const t=this.material.color,n=Math.max(t.r,t.g,t.b);n>1&&t.multiplyScalar(1/n),this.children[0].material.color.copy(this.material.color)}this.matrixWorld.extractRotation(this.light.matrixWorld).scale(this.scale).copyPosition(this.light.matrixWorld),this.children[0].matrixWorld.copy(this.matrixWorld)}dispose(){this.geometry.dispose(),this.material.dispose(),this.children[0].geometry.dispose(),this.children[0].material.dispose()}}class Bl extends _t{constructor(){const t=Bl.SkyShader,n=new ii({name:t.name,uniforms:e_.clone(t.uniforms),vertexShader:t.vertexShader,fragmentShader:t.fragmentShader,side:dn,depthWrite:!1});super(new Be(1,1,1),n),this.isSky=!0}}Bl.SkyShader={name:"SkyShader",uniforms:{turbidity:{value:2},rayleigh:{value:1},mieCoefficient:{value:.005},mieDirectionalG:{value:.8},sunPosition:{value:new D},up:{value:new D(0,1,0)}},vertexShader:` uniform vec3 sunPosition; uniform float rayleigh; uniform float turbidity; @@ -4161,5 +4161,5 @@ void main() { #include #include - }`};const He={},qn={};function Jm(e){e.type.value=="point_light"?r3(e):e.type.value=="spot_light"?s3(e):e.type.value=="rect_light"?o3(e):e.type.value=="sunlight"?a3(e):e.type.value=="sky"?l3(e):e.type.value=="ambient_light"&&c3(e)}function r3(e){let t,n;He[e.guid.value]?t=He[e.guid.value]:(t=new bw,Ne.add(t));let i=e.color.value;i=i.replace("#","0x"),i=parseInt(i),t.color.set(i),t.intensity=e.intensity.value,t.distance=e.distance.value,t.decay=e.decay.value,t.position.set(e.x.value,e.y.value,e.z.value),t.castShadow=!0,t.shadow.bias=-.002,t.shadow.normalBias=.02,qn[e.guid.value]&&e.helper.value?(n=qn[e.guid.value],n.update()):e.helper.value&&(n=new Aw(t,.5),Ne.add(n)),He[e.guid.value]=t,n&&(qn[e.guid.value]=n)}function s3(e){let t,n;He[e.guid.value]?(t=He[e.guid.value],Ne.remove(t.target)):(t=new yw,Ne.add(t));let i=e.color.value;i=i.replace("#","0x"),i=parseInt(i),t.color.set(i),t.intensity=e.intensity.value,t.distance=e.distance.value,t.angle=e.angle.value,t.penumbra=e.penumbra.value,t.decay=e.decay.value,t.position.set(e.x.value,e.y.value,e.z.value);const r=new Te;r.position.set(e.tx.value,e.ty.value,e.tz.value),Ne.add(r),t.target=r,Ne.remove(r),t.castShadow=!0,t.shadow.bias=-.002,t.shadow.normalBias=.02,qn[e.guid.value]&&e.helper.value?(n=qn[e.guid.value],n.update()):e.helper.value&&(n=new Tw(t),Ne.add(n)),He[e.guid.value]=t,n&&(qn[e.guid.value]=n)}function o3(e){let t,n;He[e.guid.value]?t=He[e.guid.value]:(t=new ww,Ne.add(t));let i=e.color.value;i=i.replace("#","0x"),i=parseInt(i),t.color.set(i),t.intensity=e.intensity.value,t.width=e.width.value,t.height=e.height.value,t.position.set(e.x.value,e.y.value,e.z.value),t.lookAt(e.tx.value,e.ty.value,e.tz.value),qn[e.guid.value]&&e.helper.value?n=qn[e.guid.value]:e.helper.value&&(n=new i3(t),Ne.add(n)),He[e.guid.value]=t,n&&(qn[e.guid.value]=n)}function a3(e){let t,n;He[e.guid.value]?t=He[e.guid.value]:(t=new m_,Ne.add(t));let i=e.color.value;if(i=i.replace("#","0x"),i=parseInt(i),t.color.set(i),t.intensity=e.intensity.value,t.position.set(e.x.value,e.y.value,e.z.value),t.target.position.set(e.tx.value,e.ty.value,e.tz.value),t.castShadow=!0,qn[e.guid.value]&&e.helper.value)n=qn[e.guid.value],n.update();else if(e.helper.value){const r=new Pw(t);Ne.add(r)}He[e.guid.value]=t,n&&(qn[e.guid.value]=n)}function l3(e){let t,n,i;He[e.guid.value]?(t=He[e.guid.value],n=He[e.guid.value+"_sun"],i=He[e.guid.value+"_ambient"]):(t=new kl,n=new m_(16777215,1),i=new g_(16777215,.6),Ne.add(t),Ne.add(n),Ne.add(i)),t.scale.setScalar(1e3),t.material.uniforms.up.value=new D(0,0,1),t.material.uniforms.turbidity.value=e.turbidity.value,t.material.uniforms.rayleigh.value=e.rayleigh.value,t.material.uniforms.mieCoefficient.value=e.mie_coefficient.value,t.material.uniforms.mieDirectionalG.value=e.mie_directional_g.value;let r=new D;const s=ju.degToRad(90-e.elevation.value),o=ju.degToRad(e.azimuth.value);r.setFromSphericalCoords(1,s,o),t.material.uniforms.sunPosition.value=r,n.position.copy(t.material.uniforms.sunPosition.value),n.color.copy($m(e.elevation.value)),i.color.copy($m(e.elevation.value)).multiplyScalar(.6),He[e.guid.value]=t,He[e.guid.value+"_sun"]=n,He[e.guid.value+"_ambient"]=i}function $m(e){if(e>10)return new $t(16777215);if(e>0){const t=e/10;return new $t(16777164).lerp(new $t(16777215),t)}if(e>-5){const t=(e+5)/5;return new $t(16764006).lerp(new $t(16777164),t)}return new $t(16764006)}function c3(e){let t;He[e.guid.value]?t=He[e.guid.value]:(t=new g_,Ne.add(t));let n=e.color.value;n=n.replace("#","0x"),n=parseInt(n),t.color.set(n),t.intensity=e.intensity.value,t.color.needsUpdate=!0,console.log(e.intensity.value)}class u3 extends Tf{constructor(t,n={}){const i=n.font;if(i===void 0)super();else{const r=i.generateShapes(t,n.size,n.direction);n.depth===void 0&&(n.depth=50),n.bevelThickness===void 0&&(n.bevelThickness=10),n.bevelSize===void 0&&(n.bevelSize=8),n.bevelEnabled===void 0&&(n.bevelEnabled=!1),super(r,n)}this.type="TextGeometry"}}class h3 extends Af{constructor(t){super(t)}load(t,n,i,r){const s=this,o=new vw(this.manager);o.setPath(this.path),o.setRequestHeader(this.requestHeader),o.setWithCredentials(this.withCredentials),o.load(t,function(a){const l=s.parse(JSON.parse(a));n&&n(l)},i,r)}parse(t){return new f3(t)}}class f3{constructor(t){this.isFont=!0,this.type="Font",this.data=t}generateShapes(t,n=100,i="ltr"){const r=[],s=d3(t,n,this.data,i);for(let o=0,a=s.length;o{i.load(r,a=>{Xc[n]=a,s(a)},void 0,a=>o(a))})}async function _3(e){const t=e.text.value,n=e.font.value,i=e.weight.value,r=e.depth.value,s=e.size.value,o=await g3(n,i),a=new u3(t,{font:o,size:s,depth:r});let l;if($i[e.guid.value]){const S=$i[e.guid.value];l=Xs[S]}else l=new Qs({color:65535,side:xn});let c;e.centered.value?(a.computeBoundingBox(),c=-.5*(a.boundingBox.max.x-a.boundingBox.min.x)):c=0;const u=new D(e.point_x.value,e.point_y.value,e.point_z.value),h=new D(e.direction_x.value,e.direction_y.value,e.direction_z.value),f=new D(e.up_x.value,e.up_y.value,e.up_z.value),p=new D().crossVectors(h,f).normalize(),g=h.clone().normalize(),v=f.clone().normalize(),m=new he().makeBasis(g,v,p);m.setPosition(u);const d=new _t(a,l);d.position.x=c,d.applyMatrix4(m),Wn[e.guid.value]=d,Ne.add(d)}function v3(e){A_(e);const t=pR(e);if(t instanceof T_){x3(t);return}else WR(t)}function x3(e){const t=e.data.items;switch(t.dispatch.value){case"material":Ym(t);break;case"light":Jm(t);break;case"scene":t3(t);break;case"ui":M3(t);break;case"text":m3(t);break;case"object_infos":D_(t);break;case"remove_object":n3(t);break;default:console.warn("Unknown dispatch value:",t.dispatch.value)}t.dispatch.value=="material"?Ym(t):t.dispatch.value=="light"&&Jm(t)}let ki=null;function y3(){const e=()=>{ki=new WebSocket("ws://127.0.0.1:9001/ws"),ki.binaryType="arraybuffer",ki.onopen=()=>{sessionStorage.getItem("reloaded")||(sessionStorage.setItem("reloaded","true"),window.location.reload())},ki.onmessage=t=>{if(t.data instanceof ArrayBuffer){const n=new Uint8Array(t.data);v3(n)}else console.warn("❓ Received non-binary data:",t.data)},ki.onerror=t=>{console.error("WebSocket error:",t)},ki.onclose=()=>{sessionStorage.removeItem("reloaded"),setTimeout(e,1e3)}};e()}function S3(e){ki&&ki.readyState===WebSocket.OPEN?ki.send(e):console.error("WebSocket is not open. Unable to send message.")}function N_(e){try{const t=JSON.stringify(e),n=b3(t);S3(n)}catch{}}function b3(e){return new TextEncoder().encode(e).buffer}const Nf=Xi([]);function M3(e){const t=e.type.value;switch(t){case"button":w3(e),lh.isVisible=!0;break;case"slider":E3(e),lh.isVisible=!0;break;default:console.warn("Unknown component type:",t)}}function w3(e){const t={id:Date.now(),component:"Button",label:e.label?.value,props:{text:e.text.value,variant:e.variant.value},action:e.guid.value};Nf.push(t)}function E3(e){const t={id:Date.now(),component:"Slider",label:e.label?.value,props:{min:e.min.value,max:e.max.value,step:e.step.value,defaultValue:[e.default_value.value]},action:e.guid.value};Nf.push(t)}function Zm(e,t){const n={dispatch:"ui_callback",action:e,value:null};t!==void 0&&(n.value=t),N_(n)}const T3={key:0,class:"dynamic-label"},A3={key:2,class:"slider-container"},P3={key:0,class:"slider-value"},C3=Ze({__name:"Sidebar",setup(e){const t=sn(!0);function n(){t.value=!t.value}return document.addEventListener("keydown",i=>{(i.key==="Q"||i.key==="q")&&n()}),(i,r)=>(ce(),Fn(Je,null,[mr("div",{class:Us(["fixed-sidebar",{"is-hidden":!t.value}])},[(ce(!0),Fn(Je,null,Rl(vt(Nf),s=>(ce(),Fn("div",{key:s.id,class:"dynamic-item"},[s.label?(ce(),Fn("label",T3,Br(s.label),1)):qr("",!0),s.component==="Button"?(ce(),Oe(vt(Ja),{key:1,variant:"secondary",onClick:o=>vt(Zm)(s.action)},{default:$e(()=>[Ds(Br(s.props.text),1)]),_:2},1032,["onClick"])):s.component==="Slider"?(ce(),Fn("div",A3,[Ge(vt(YS),{min:s.props.min,max:s.props.max,step:s.props.step,"default-value":s.props.defaultValue,modelValue:s.props.defaultValue,"onUpdate:modelValue":[o=>s.props.defaultValue=o,o=>vt(Zm)(s.action,o)],class:"w-[80%]"},null,8,["min","max","step","default-value","modelValue","onUpdate:modelValue"]),s.props.defaultValue?(ce(),Fn("span",P3,Br(s.props.defaultValue[0]),1)):qr("",!0)])):qr("",!0)]))),128)),Ge(vt(Ja),{variant:"secondary",size:"icon",class:"mb-4",onClick:r[0]||(r[0]=s=>n())},{default:$e(()=>[Ds(Br(t.value?"<<":">>"),1)]),_:1})],2),Ge(vt(Ja),{variant:"secondary",size:"icon",class:Us(["mb-5",{"is-hidden":!t.value}]),onClick:r[1]||(r[1]=s=>n())},{default:$e(()=>[...r[2]||(r[2]=[Ds(" >> ",-1)])]),_:1},8,["class"])],64))}}),Uf=(e,t)=>{const n=e.__vccOpts||e;for(const[i,r]of t)n[i]=r;return n},R3=Uf(C3,[["__scopeId","data-v-d28ab6b5"]]),D3={class:"info-module",id:"info-panel"},I3={class:"metadata"},L3={__name:"ObjectInfo",setup(e){return xr.data&&Object.fromEntries(Object.entries(xr.data).filter(([t])=>t!=="dispatch")),(t,n)=>(ce(),Fn("div",D3,[Ge(vt(Ja),{variant:"ghost",onClick:n[0]||(n[0]=i=>vt(R_)())},{default:$e(()=>[...n[1]||(n[1]=[Ds(" X ",-1)])]),_:1}),mr("div",I3,[n[2]||(n[2]=mr("h1",null,"METADATA",-1)),(ce(!0),Fn(Je,null,Rl(vt(xr).data,(i,r)=>(ce(),Fn("div",{key:r,class:"single_data"},[mr("p",null,[mr("strong",null,Br(r)+":",1),Ds(" "+Br(i.value),1)])]))),128))])]))}},N3=Uf(L3,[["__scopeId","data-v-ff5fa631"]]),U3={class:"app-container"},O3=Ze({__name:"App",setup(e){const t=sn(null);return $o(()=>{t.value&&(t.value.appendChild(Dn.domElement),y3())}),(n,i)=>(ce(),Fn("div",U3,[vt(lh).isVisible?(ce(),Oe(R3,{key:0})):qr("",!0),mr("div",{ref_key:"threeContainer",ref:t,class:"three-container"},null,512),vt(xr).isVisible?(ce(),Oe(N3,{key:1})):qr("",!0)]))}}),F3=Uf(O3,[["__scopeId","data-v-26be444e"]]),k3=uy(F3);k3.mount("#app"); + }`};const He={},qn={};function Jm(e){e.type.value=="point_light"?s3(e):e.type.value=="spot_light"?o3(e):e.type.value=="rect_light"?a3(e):e.type.value=="sunlight"?l3(e):e.type.value=="sky"?c3(e):e.type.value=="ambient_light"&&u3(e)}function s3(e){let t,n;He[e.guid.value]?t=He[e.guid.value]:(t=new bw,Ne.add(t));let i=e.color.value;i=i.replace("#","0x"),i=parseInt(i),t.color.set(i),t.intensity=e.intensity.value,t.distance=e.distance.value,t.decay=e.decay.value,t.position.set(e.x.value,e.y.value,e.z.value),t.castShadow=!0,t.shadow.bias=-.002,t.shadow.normalBias=.02,qn[e.guid.value]&&e.helper.value?(n=qn[e.guid.value],n.update()):e.helper.value&&(n=new Aw(t,.5),Ne.add(n)),He[e.guid.value]=t,n&&(qn[e.guid.value]=n)}function o3(e){let t,n;He[e.guid.value]?(t=He[e.guid.value],Ne.remove(t.target)):(t=new yw,Ne.add(t));let i=e.color.value;i=i.replace("#","0x"),i=parseInt(i),t.color.set(i),t.intensity=e.intensity.value,t.distance=e.distance.value,t.angle=e.angle.value,t.penumbra=e.penumbra.value,t.decay=e.decay.value,t.position.set(e.x.value,e.y.value,e.z.value);const r=new Te;r.position.set(e.tx.value,e.ty.value,e.tz.value),Ne.add(r),t.target=r,Ne.remove(r),t.castShadow=!0,t.shadow.bias=-.002,t.shadow.normalBias=.02,qn[e.guid.value]&&e.helper.value?(n=qn[e.guid.value],n.update()):e.helper.value&&(n=new Tw(t),Ne.add(n)),He[e.guid.value]=t,n&&(qn[e.guid.value]=n)}function a3(e){let t,n;He[e.guid.value]?t=He[e.guid.value]:(t=new ww,Ne.add(t));let i=e.color.value;i=i.replace("#","0x"),i=parseInt(i),t.color.set(i),t.intensity=e.intensity.value,t.width=e.width.value,t.height=e.height.value,t.position.set(e.x.value,e.y.value,e.z.value),t.lookAt(e.tx.value,e.ty.value,e.tz.value),qn[e.guid.value]&&e.helper.value?n=qn[e.guid.value]:e.helper.value&&(n=new r3(t),Ne.add(n)),He[e.guid.value]=t,n&&(qn[e.guid.value]=n)}function l3(e){let t,n;He[e.guid.value]?t=He[e.guid.value]:(t=new m_,Ne.add(t));let i=e.color.value;if(i=i.replace("#","0x"),i=parseInt(i),t.color.set(i),t.intensity=e.intensity.value,t.position.set(e.x.value,e.y.value,e.z.value),t.target.position.set(e.tx.value,e.ty.value,e.tz.value),t.castShadow=!0,qn[e.guid.value]&&e.helper.value)n=qn[e.guid.value],n.update();else if(e.helper.value){const r=new Pw(t);Ne.add(r)}He[e.guid.value]=t,n&&(qn[e.guid.value]=n)}function c3(e){let t,n,i;He[e.guid.value]?(t=He[e.guid.value],n=He[e.guid.value+"_sun"],i=He[e.guid.value+"_ambient"]):(t=new Bl,n=new m_(16777215,1),i=new g_(16777215,.6),Ne.add(t),Ne.add(n),Ne.add(i)),t.scale.setScalar(1e3),t.material.uniforms.up.value=new D(0,0,1),t.material.uniforms.turbidity.value=e.turbidity.value,t.material.uniforms.rayleigh.value=e.rayleigh.value,t.material.uniforms.mieCoefficient.value=e.mie_coefficient.value,t.material.uniforms.mieDirectionalG.value=e.mie_directional_g.value;let r=new D;const s=gl.degToRad(90-e.elevation.value),o=gl.degToRad(e.azimuth.value);r.setFromSphericalCoords(1,s,o),t.material.uniforms.sunPosition.value=r,n.position.copy(t.material.uniforms.sunPosition.value),n.color.copy($m(e.elevation.value)),i.color.copy($m(e.elevation.value)).multiplyScalar(.6),He[e.guid.value]=t,He[e.guid.value+"_sun"]=n,He[e.guid.value+"_ambient"]=i}function $m(e){if(e>10)return new $t(16777215);if(e>0){const t=e/10;return new $t(16777164).lerp(new $t(16777215),t)}if(e>-5){const t=(e+5)/5;return new $t(16764006).lerp(new $t(16777164),t)}return new $t(16764006)}function u3(e){let t;He[e.guid.value]?t=He[e.guid.value]:(t=new g_,Ne.add(t));let n=e.color.value;n=n.replace("#","0x"),n=parseInt(n),t.color.set(n),t.intensity=e.intensity.value,t.color.needsUpdate=!0,console.log(e.intensity.value)}class h3 extends Tf{constructor(t,n={}){const i=n.font;if(i===void 0)super();else{const r=i.generateShapes(t,n.size,n.direction);n.depth===void 0&&(n.depth=50),n.bevelThickness===void 0&&(n.bevelThickness=10),n.bevelSize===void 0&&(n.bevelSize=8),n.bevelEnabled===void 0&&(n.bevelEnabled=!1),super(r,n)}this.type="TextGeometry"}}class f3 extends Af{constructor(t){super(t)}load(t,n,i,r){const s=this,o=new vw(this.manager);o.setPath(this.path),o.setRequestHeader(this.requestHeader),o.setWithCredentials(this.withCredentials),o.load(t,function(a){const l=s.parse(JSON.parse(a));n&&n(l)},i,r)}parse(t){return new d3(t)}}class d3{constructor(t){this.isFont=!0,this.type="Font",this.data=t}generateShapes(t,n=100,i="ltr"){const r=[],s=p3(t,n,this.data,i);for(let o=0,a=s.length;o{i.load(r,a=>{qc[n]=a,s(a)},void 0,a=>o(a))})}async function v3(e){const t=e.text.value,n=e.font.value,i=e.weight.value,r=e.depth.value,s=e.size.value,o=await _3(n,i),a=new h3(t,{font:o,size:s,depth:r});let l;if($i[e.guid.value]){const S=$i[e.guid.value];l=Xs[S]}else l=new Qs({color:65535,side:yn});let c;e.centered.value?(a.computeBoundingBox(),c=-.5*(a.boundingBox.max.x-a.boundingBox.min.x)):c=0;const u=new D(e.point_x.value,e.point_y.value,e.point_z.value),h=new D(e.direction_x.value,e.direction_y.value,e.direction_z.value),f=new D(e.up_x.value,e.up_y.value,e.up_z.value),p=new D().crossVectors(h,f).normalize(),g=h.clone().normalize(),_=f.clone().normalize(),m=new he().makeBasis(g,_,p);m.setPosition(u);const d=new _t(a,l);d.position.x=c,d.applyMatrix4(m),Wn[e.guid.value]=d,Ne.add(d)}function x3(e){A_(e);const t=mR(e);if(t instanceof T_){y3(t);return}else XR(t)}function y3(e){const t=e.data.items;switch(t.dispatch.value){case"material":Ym(t);break;case"light":Jm(t);break;case"scene":e3(t);break;case"ui":w3(t);break;case"text":g3(t);break;case"object_infos":D_(t);break;case"remove_object":i3(t);break;default:console.warn("Unknown dispatch value:",t.dispatch.value)}t.dispatch.value=="material"?Ym(t):t.dispatch.value=="light"&&Jm(t)}let ki=null;function S3(){const e=()=>{ki=new WebSocket("ws://127.0.0.1:9001/ws"),ki.binaryType="arraybuffer",ki.onopen=()=>{sessionStorage.getItem("reloaded")||(sessionStorage.setItem("reloaded","true"),window.location.reload())},ki.onmessage=t=>{if(t.data instanceof ArrayBuffer){const n=new Uint8Array(t.data);x3(n)}else console.warn("❓ Received non-binary data:",t.data)},ki.onerror=t=>{console.error("WebSocket error:",t)},ki.onclose=()=>{sessionStorage.removeItem("reloaded"),setTimeout(e,1e3)}};e()}function b3(e){ki&&ki.readyState===WebSocket.OPEN?ki.send(e):console.error("WebSocket is not open. Unable to send message.")}function N_(e){try{const t=JSON.stringify(e),n=M3(t);b3(n)}catch{}}function M3(e){return new TextEncoder().encode(e).buffer}const Nf=Xi([]);function w3(e){const t=e.type.value;switch(t){case"button":E3(e),lh.isVisible=!0;break;case"slider":T3(e),lh.isVisible=!0;break;default:console.warn("Unknown component type:",t)}}function E3(e){const t={id:Date.now(),component:"Button",label:e.label?.value,props:{text:e.text.value,variant:e.variant.value},action:e.guid.value};Nf.push(t)}function T3(e){const t={id:Date.now(),component:"Slider",label:e.label?.value,props:{min:e.min.value,max:e.max.value,step:e.step.value,defaultValue:[e.default_value.value]},action:e.guid.value};Nf.push(t)}function Zm(e,t){const n={dispatch:"ui_callback",action:e,value:null};t!==void 0&&(n.value=t),N_(n)}const A3={key:0,class:"dynamic-label"},P3={key:2,class:"slider-container"},C3={key:0,class:"slider-value"},R3=Ze({__name:"Sidebar",setup(e){const t=sn(!0);function n(){t.value=!t.value}return document.addEventListener("keydown",i=>{(i.key==="Q"||i.key==="q")&&n()}),(i,r)=>(ce(),Fn(Je,null,[mr("div",{class:Us(["fixed-sidebar",{"is-hidden":!t.value}])},[(ce(!0),Fn(Je,null,Dl(vt(Nf),s=>(ce(),Fn("div",{key:s.id,class:"dynamic-item"},[s.label?(ce(),Fn("label",A3,Br(s.label),1)):qr("",!0),s.component==="Button"?(ce(),Oe(vt(Ja),{key:1,variant:"secondary",onClick:o=>vt(Zm)(s.action)},{default:$e(()=>[Ds(Br(s.props.text),1)]),_:2},1032,["onClick"])):s.component==="Slider"?(ce(),Fn("div",P3,[Ge(vt(YS),{min:s.props.min,max:s.props.max,step:s.props.step,"default-value":s.props.defaultValue,modelValue:s.props.defaultValue,"onUpdate:modelValue":[o=>s.props.defaultValue=o,o=>vt(Zm)(s.action,o)],class:"w-[80%]"},null,8,["min","max","step","default-value","modelValue","onUpdate:modelValue"]),s.props.defaultValue?(ce(),Fn("span",C3,Br(s.props.defaultValue[0]),1)):qr("",!0)])):qr("",!0)]))),128)),Ge(vt(Ja),{variant:"secondary",size:"icon",class:"mb-4",onClick:r[0]||(r[0]=s=>n())},{default:$e(()=>[Ds(Br(t.value?"<<":">>"),1)]),_:1})],2),Ge(vt(Ja),{variant:"secondary",size:"icon",class:Us(["mb-5",{"is-hidden":!t.value}]),onClick:r[1]||(r[1]=s=>n())},{default:$e(()=>[...r[2]||(r[2]=[Ds(" >> ",-1)])]),_:1},8,["class"])],64))}}),Uf=(e,t)=>{const n=e.__vccOpts||e;for(const[i,r]of t)n[i]=r;return n},D3=Uf(R3,[["__scopeId","data-v-d28ab6b5"]]),I3={class:"info-module",id:"info-panel"},L3={class:"metadata"},N3={__name:"ObjectInfo",setup(e){return xr.data&&Object.fromEntries(Object.entries(xr.data).filter(([t])=>t!=="dispatch")),(t,n)=>(ce(),Fn("div",I3,[Ge(vt(Ja),{variant:"ghost",onClick:n[0]||(n[0]=i=>vt(R_)())},{default:$e(()=>[...n[1]||(n[1]=[Ds(" X ",-1)])]),_:1}),mr("div",L3,[n[2]||(n[2]=mr("h1",null,"METADATA",-1)),(ce(!0),Fn(Je,null,Dl(vt(xr).data,(i,r)=>(ce(),Fn("div",{key:r,class:"single_data"},[mr("p",null,[mr("strong",null,Br(r)+":",1),Ds(" "+Br(i.value),1)])]))),128))])]))}},U3=Uf(N3,[["__scopeId","data-v-ff5fa631"]]),O3={class:"app-container"},F3=Ze({__name:"App",setup(e){const t=sn(null);return $o(()=>{t.value&&(t.value.appendChild(Dn.domElement),S3())}),(n,i)=>(ce(),Fn("div",O3,[vt(lh).isVisible?(ce(),Oe(D3,{key:0})):qr("",!0),mr("div",{ref_key:"threeContainer",ref:t,class:"three-container"},null,512),vt(xr).isVisible?(ce(),Oe(U3,{key:1})):qr("",!0)]))}}),k3=Uf(F3,[["__scopeId","data-v-26be444e"]]),B3=uy(k3);B3.mount("#app"); diff --git a/src/compas_threejs/viewer/frontend/index.html b/src/compas_threejs/viewer/frontend/index.html index d9120fc..bbc075d 100644 --- a/src/compas_threejs/viewer/frontend/index.html +++ b/src/compas_threejs/viewer/frontend/index.html @@ -7,7 +7,7 @@ COMPAS ThreeJS - +