diff --git a/frontend/compas_threejs/package-lock.json b/frontend/compas_threejs/package-lock.json index 2478eb5..3d8d076 100644 --- a/frontend/compas_threejs/package-lock.json +++ b/frontend/compas_threejs/package-lock.json @@ -9,7 +9,7 @@ "version": "0.0.0", "dependencies": { "@bufbuild/protobuf": "^2.11.0", - "@gramaziokohler/compas-pb-ts": "^1.1.3", + "@gramaziokohler/compas-pb-ts": "^1.1.5", "@radix-ui/react-tooltip": "^1.2.8", "@vueuse/core": "^14.2.1", "class-variance-authority": "^0.7.1", @@ -606,9 +606,9 @@ } }, "node_modules/@gramaziokohler/compas-pb-ts": { - "version": "1.1.3", - "resolved": "https://registry.npmjs.org/@gramaziokohler/compas-pb-ts/-/compas-pb-ts-1.1.3.tgz", - "integrity": "sha512-QmnTQbcTlYlYU6X0UHOm/05sZOqLg6mylUuCBe7aRFve+NOyXHrinXam6hl9ZSpyqpa9QvLpfZn/8iQdAMct1w==", + "version": "1.1.5", + "resolved": "https://registry.npmjs.org/@gramaziokohler/compas-pb-ts/-/compas-pb-ts-1.1.5.tgz", + "integrity": "sha512-tsyt4xEDRA1CTTNyGlMRvwo0p9q0B1hCGPjfm+BvKh+zo1fmOgPcDcZ30LEgYm2ECFuCoKyocA98InolI/ddhQ==", "license": "MIT", "dependencies": { "@bufbuild/protobuf": "^2.10.1", diff --git a/frontend/compas_threejs/package.json b/frontend/compas_threejs/package.json index c63f76d..d22224a 100644 --- a/frontend/compas_threejs/package.json +++ b/frontend/compas_threejs/package.json @@ -10,7 +10,7 @@ }, "dependencies": { "@bufbuild/protobuf": "^2.11.0", - "@gramaziokohler/compas-pb-ts": "^1.1.3", + "@gramaziokohler/compas-pb-ts": "^1.1.5", "@radix-ui/react-tooltip": "^1.2.8", "@vueuse/core": "^14.2.1", "class-variance-authority": "^0.7.1", diff --git a/frontend/compas_threejs/src/communications/messages.ts b/frontend/compas_threejs/src/communications/messages.ts index b89ed6d..34d4239 100644 --- a/frontend/compas_threejs/src/communications/messages.ts +++ b/frontend/compas_threejs/src/communications/messages.ts @@ -1,4 +1,3 @@ -import { scene } from "../viewer/scene_builder"; import { unpackMessageToGeometry, unpackMessage, diff --git a/frontend/compas_threejs/src/viewer/geometry_manager.ts b/frontend/compas_threejs/src/viewer/geometry_manager.ts index 40b6508..91e6ba8 100644 --- a/frontend/compas_threejs/src/viewer/geometry_manager.ts +++ b/frontend/compas_threejs/src/viewer/geometry_manager.ts @@ -17,7 +17,6 @@ const ABSTRACT_GEOMETRIES = [ export function geometryManager(obj: any) { // FILTER // if the geometry is abstract, than send it to another workflow\ - console.log(obj.name); if (ABSTRACT_GEOMETRIES.includes(obj.name)) { abstractGeometryManager(obj); } @@ -27,7 +26,13 @@ export function geometryManager(obj: any) { // 1. Get the new Mesh from your API const newMesh = obj.buildGeometry(); - if (!newMesh || !(newMesh instanceof THREE.Mesh)) return; + if (newMesh instanceof THREE.Mesh) { + console.log("True"); + } else { + console.log("False"); + return; + } + if (!(newMesh instanceof THREE.Mesh)) return; // 2. Extract and prepare the geometry from the new mesh const newGeo = newMesh.geometry; diff --git a/frontend/compas_threejs/src/viewer/scene_builder.ts b/frontend/compas_threejs/src/viewer/scene_builder.ts deleted file mode 100644 index c97fc7a..0000000 --- a/frontend/compas_threejs/src/viewer/scene_builder.ts +++ /dev/null @@ -1,51 +0,0 @@ -import * as THREE from "three"; -import { OrbitControls } from "three/examples/jsm/controls/OrbitControls.js"; -import { RoomEnvironment } from "three/examples/jsm/environments/RoomEnvironment.js"; - -// Initialize Scene -export const scene = new THREE.Scene(); -scene.background = new THREE.Color(0x222222); - -// Initialize Camera -export const camera = new THREE.PerspectiveCamera( - 60, - window.innerWidth / window.innerHeight, - 0.1, - 1000, -); -camera.position.set(5, 5, 5); - -// Initialize Renderer -export const renderer = new THREE.WebGLRenderer({ antialias: true }); -renderer.setSize(window.innerWidth, window.innerHeight); -renderer.setPixelRatio(window.devicePixelRatio); -document.body.appendChild(renderer.domElement); - -// Environment & Lighting; -// const pmremGenerator = new THREE.PMREMGenerator(renderer); -// scene.environment = pmremGenerator.fromScene(new RoomEnvironment()).texture; - -export const controls = new OrbitControls(camera, renderer.domElement); -controls.enableDamping = true; - -// scene.add(new THREE.AmbientLight(0xffffff, 0.5)); -// const dirLight = new THREE.DirectionalLight(0xffffff, 1.0); -// dirLight.position.set(10, 10, 10); -// scene.add(dirLight); - -// The Loop -export function startAnimation() { - function animate() { - requestAnimationFrame(animate); - controls.update(); - renderer.render(scene, camera); - } - animate(); -} - -// Resize Handling -window.addEventListener("resize", () => { - camera.aspect = window.innerWidth / window.innerHeight; - camera.updateProjectionMatrix(); - renderer.setSize(window.innerWidth, window.innerHeight); -}); diff --git a/src/compas_threejs/viewer/frontend/assets/index.js b/src/compas_threejs/viewer/frontend/assets/index.js index b5f2217..1166679 100644 --- a/src/compas_threejs/viewer/frontend/assets/index.js +++ b/src/compas_threejs/viewer/frontend/assets/index.js @@ -1,6 +1,6 @@ -(function(){const e=document.createElement("link").relList;if(e&&e.supports&&e.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 gp(t){const e=Object.create(null);for(const n of t.split(","))e[n]=1;return n=>n in e}const Bt={},Vo=[],Qi=()=>{},P_=()=>!1,gu=t=>t.charCodeAt(0)===111&&t.charCodeAt(1)===110&&(t.charCodeAt(2)>122||t.charCodeAt(2)<97),vp=t=>t.startsWith("onUpdate:"),dn=Object.assign,_p=(t,e)=>{const n=t.indexOf(e);n>-1&&t.splice(n,1)},_S=Object.prototype.hasOwnProperty,Tt=(t,e)=>_S.call(t,e),Qe=Array.isArray,Ho=t=>vl(t)==="[object Map]",vu=t=>vl(t)==="[object Set]",Fm=t=>vl(t)==="[object Date]",ot=t=>typeof t=="function",Xt=t=>typeof t=="string",Ri=t=>typeof t=="symbol",Et=t=>t!==null&&typeof t=="object",R_=t=>(Et(t)||ot(t))&&ot(t.then)&&ot(t.catch),D_=Object.prototype.toString,vl=t=>D_.call(t),xS=t=>vl(t).slice(8,-1),I_=t=>vl(t)==="[object Object]",_u=t=>Xt(t)&&t!=="NaN"&&t[0]!=="-"&&""+parseInt(t,10)===t,Ga=gp(",key,ref,ref_for,ref_key,onVnodeBeforeMount,onVnodeMounted,onVnodeBeforeUpdate,onVnodeUpdated,onVnodeBeforeUnmount,onVnodeUnmounted"),xu=t=>{const e=Object.create(null);return(n=>e[n]||(e[n]=t(n)))},yS=/-\w/g,ei=xu(t=>t.replace(yS,e=>e.slice(1).toUpperCase())),bS=/\B([A-Z])/g,bs=xu(t=>t.replace(bS,"-$1").toLowerCase()),yu=xu(t=>t.charAt(0).toUpperCase()+t.slice(1)),Wa=xu(t=>t?`on${yu(t)}`:""),gs=(t,e)=>!Object.is(t,e),Ac=(t,...e)=>{for(let n=0;n{Object.defineProperty(t,e,{configurable:!0,enumerable:!1,writable:i,value:n})},bu=t=>{const e=parseFloat(t);return isNaN(e)?t:e},SS=t=>{const e=Xt(t)?Number(t):NaN;return isNaN(e)?t:e};let Um;const Su=()=>Um||(Um=typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:typeof global<"u"?global:{});function $r(t){if(Qe(t)){const e={};for(let n=0;n{if(n){const i=n.split(MS);i.length>1&&(e[i[0].trim()]=i[1].trim())}}),e}function Qt(t){let e="";if(Xt(t))e=t;else if(Qe(t))for(let n=0;n_l(n,e))}const O_=t=>!!(t&&t.__v_isRef===!0),Ci=t=>Xt(t)?t:t==null?"":Qe(t)||Et(t)&&(t.toString===D_||!ot(t.toString))?O_(t)?Ci(t.value):JSON.stringify(t,F_,2):String(t),F_=(t,e)=>O_(e)?F_(t,e.value):Ho(e)?{[`Map(${e.size})`]:[...e.entries()].reduce((n,[i,r],s)=>(n[Cd(i,s)+" =>"]=r,n),{})}:vu(e)?{[`Set(${e.size})`]:[...e.values()].map(n=>Cd(n))}:Ri(e)?Cd(e):Et(e)&&!Qe(e)&&!I_(e)?String(e):e,Cd=(t,e="")=>{var n;return Ri(t)?`Symbol(${(n=t.description)!=null?n:e})`:t};let Cn;class U_{constructor(e=!1){this.detached=e,this._active=!0,this._on=0,this.effects=[],this.cleanups=[],this._isPaused=!1,this.__v_skip=!0,this.parent=Cn,!e&&Cn&&(this.index=(Cn.scopes||(Cn.scopes=[])).push(this)-1)}get active(){return this._active}pause(){if(this._active){this._isPaused=!0;let e,n;if(this.scopes)for(e=0,n=this.scopes.length;e0&&--this._on===0&&(Cn=this.prevScope,this.prevScope=void 0)}stop(e){if(this._active){this._active=!1;let n,i;for(n=0,i=this.effects.length;n0)return;if(Xa){let e=Xa;for(Xa=void 0;e;){const n=e.next;e.next=void 0,e.flags&=-9,e=n}}let t;for(;qa;){let e=qa;for(qa=void 0;e;){const n=e.next;if(e.next=void 0,e.flags&=-9,e.flags&1)try{e.trigger()}catch(i){t||(t=i)}e=n}}if(t)throw t}function G_(t){for(let e=t.deps;e;e=e.nextDep)e.version=-1,e.prevActiveLink=e.dep.activeLink,e.dep.activeLink=e}function W_(t){let e,n=t.depsTail,i=n;for(;i;){const r=i.prevDep;i.version===-1?(i===n&&(n=r),Sp(i),DS(i)):e=i,i.dep.activeLink=i.prevActiveLink,i.prevActiveLink=void 0,i=r}t.deps=e,t.depsTail=n}function Xf(t){for(let e=t.deps;e;e=e.nextDep)if(e.dep.version!==e.version||e.dep.computed&&(q_(e.dep.computed)||e.dep.version!==e.version))return!0;return!!t._dirty}function q_(t){if(t.flags&4&&!(t.flags&16)||(t.flags&=-17,t.globalVersion===el)||(t.globalVersion=el,!t.isSSR&&t.flags&128&&(!t.deps&&!t._dirty||!Xf(t))))return;t.flags|=2;const e=t.dep,n=Gt,i=Pi;Gt=t,Pi=!0;try{G_(t);const r=t.fn(t._value);(e.version===0||gs(r,t._value))&&(t.flags|=128,t._value=r,e.version++)}catch(r){throw e.version++,r}finally{Gt=n,Pi=i,W_(t),t.flags&=-3}}function Sp(t,e=!1){const{dep:n,prevSub:i,nextSub:r}=t;if(i&&(i.nextSub=r,t.prevSub=void 0),r&&(r.prevSub=i,t.nextSub=void 0),n.subs===t&&(n.subs=i,!i&&n.computed)){n.computed.flags&=-5;for(let s=n.computed.deps;s;s=s.nextDep)Sp(s,!0)}!e&&!--n.sc&&n.map&&n.map.delete(n.key)}function DS(t){const{prevDep:e,nextDep:n}=t;e&&(e.nextDep=n,t.prevDep=void 0),n&&(n.prevDep=e,t.nextDep=void 0)}let Pi=!0;const X_=[];function Ur(){X_.push(Pi),Pi=!1}function kr(){const t=X_.pop();Pi=t===void 0?!0:t}function km(t){const{cleanup:e}=t;if(t.cleanup=void 0,e){const n=Gt;Gt=void 0;try{e()}finally{Gt=n}}}let el=0;class IS{constructor(e,n){this.sub=e,this.dep=n,this.version=n.version,this.nextDep=this.prevDep=this.nextSub=this.prevSub=this.prevActiveLink=void 0}}class wu{constructor(e){this.computed=e,this.version=0,this.activeLink=void 0,this.subs=void 0,this.map=void 0,this.key=void 0,this.sc=0,this.__v_skip=!0}track(e){if(!Gt||!Pi||Gt===this.computed)return;let n=this.activeLink;if(n===void 0||n.sub!==Gt)n=this.activeLink=new IS(Gt,this),Gt.deps?(n.prevDep=Gt.depsTail,Gt.depsTail.nextDep=n,Gt.depsTail=n):Gt.deps=Gt.depsTail=n,$_(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=Gt.depsTail,n.nextDep=void 0,Gt.depsTail.nextDep=n,Gt.depsTail=n,Gt.deps===n&&(Gt.deps=i)}return n}trigger(e){this.version++,el++,this.notify(e)}notify(e){yp();try{for(let n=this.subs;n;n=n.prevSub)n.sub.notify()&&n.sub.dep.notify()}finally{bp()}}}function $_(t){if(t.dep.sc++,t.sub.flags&4){const e=t.dep.computed;if(e&&!t.dep.subs){e.flags|=20;for(let i=e.deps;i;i=i.nextDep)$_(i)}const n=t.dep.subs;n!==t&&(t.prevSub=n,n&&(n.nextSub=t)),t.dep.subs=t}}const Wc=new WeakMap,Qs=Symbol(""),$f=Symbol(""),tl=Symbol("");function Pn(t,e,n){if(Pi&&Gt){let i=Wc.get(t);i||Wc.set(t,i=new Map);let r=i.get(n);r||(i.set(n,r=new wu),r.map=i,r.key=n),r.track()}}function Tr(t,e,n,i,r,s){const o=Wc.get(t);if(!o){el++;return}const a=l=>{l&&l.trigger()};if(yp(),e==="clear")o.forEach(a);else{const l=Qe(t),c=l&&_u(n);if(l&&n==="length"){const u=Number(i);o.forEach((d,f)=>{(f==="length"||f===tl||!Ri(f)&&f>=u)&&a(d)})}else switch((n!==void 0||o.has(void 0))&&a(o.get(n)),c&&a(o.get(tl)),e){case"add":l?c&&a(o.get("length")):(a(o.get(Qs)),Ho(t)&&a(o.get($f)));break;case"delete":l||(a(o.get(Qs)),Ho(t)&&a(o.get($f)));break;case"set":Ho(t)&&a(o.get(Qs));break}}bp()}function NS(t,e){const n=Wc.get(t);return n&&n.get(e)}function vo(t){const e=St(t);return e===t?e:(Pn(e,"iterate",tl),di(t)?e:e.map(Di))}function Mu(t){return Pn(t=St(t),"iterate",tl),t}function cs(t,e){return Br(t)?ea(eo(t)?Di(e):e):Di(e)}const LS={__proto__:null,[Symbol.iterator](){return Rd(this,Symbol.iterator,t=>cs(this,t))},concat(...t){return vo(this).concat(...t.map(e=>Qe(e)?vo(e):e))},entries(){return Rd(this,"entries",t=>(t[1]=cs(this,t[1]),t))},every(t,e){return hr(this,"every",t,e,void 0,arguments)},filter(t,e){return hr(this,"filter",t,e,n=>n.map(i=>cs(this,i)),arguments)},find(t,e){return hr(this,"find",t,e,n=>cs(this,n),arguments)},findIndex(t,e){return hr(this,"findIndex",t,e,void 0,arguments)},findLast(t,e){return hr(this,"findLast",t,e,n=>cs(this,n),arguments)},findLastIndex(t,e){return hr(this,"findLastIndex",t,e,void 0,arguments)},forEach(t,e){return hr(this,"forEach",t,e,void 0,arguments)},includes(...t){return Dd(this,"includes",t)},indexOf(...t){return Dd(this,"indexOf",t)},join(t){return vo(this).join(t)},lastIndexOf(...t){return Dd(this,"lastIndexOf",t)},map(t,e){return hr(this,"map",t,e,void 0,arguments)},pop(){return xa(this,"pop")},push(...t){return xa(this,"push",t)},reduce(t,...e){return Bm(this,"reduce",t,e)},reduceRight(t,...e){return Bm(this,"reduceRight",t,e)},shift(){return xa(this,"shift")},some(t,e){return hr(this,"some",t,e,void 0,arguments)},splice(...t){return xa(this,"splice",t)},toReversed(){return vo(this).toReversed()},toSorted(t){return vo(this).toSorted(t)},toSpliced(...t){return vo(this).toSpliced(...t)},unshift(...t){return xa(this,"unshift",t)},values(){return Rd(this,"values",t=>cs(this,t))}};function Rd(t,e,n){const i=Mu(t),r=i[e]();return i!==t&&!di(t)&&(r._next=r.next,r.next=()=>{const s=r._next();return s.done||(s.value=n(s.value)),s}),r}const OS=Array.prototype;function hr(t,e,n,i,r,s){const o=Mu(t),a=o!==t&&!di(t),l=o[e];if(l!==OS[e]){const d=l.apply(t,s);return a?Di(d):d}let c=n;o!==t&&(a?c=function(d,f){return n.call(this,cs(t,d),f,t)}:n.length>2&&(c=function(d,f){return n.call(this,d,f,t)}));const u=l.call(o,c,i);return a&&r?r(u):u}function Bm(t,e,n,i){const r=Mu(t);let s=n;return r!==t&&(di(t)?n.length>3&&(s=function(o,a,l){return n.call(this,o,a,l,t)}):s=function(o,a,l){return n.call(this,o,cs(t,a),l,t)}),r[e](s,...i)}function Dd(t,e,n){const i=St(t);Pn(i,"iterate",tl);const r=i[e](...n);return(r===-1||r===!1)&&Au(n[0])?(n[0]=St(n[0]),i[e](...n)):r}function xa(t,e,n=[]){Ur(),yp();const i=St(t)[e].apply(t,n);return bp(),kr(),i}const FS=gp("__proto__,__v_isRef,__isVue"),j_=new Set(Object.getOwnPropertyNames(Symbol).filter(t=>t!=="arguments"&&t!=="caller").map(t=>Symbol[t]).filter(Ri));function US(t){Ri(t)||(t=String(t));const e=St(this);return Pn(e,"has",t),e.hasOwnProperty(t)}class Y_{constructor(e=!1,n=!1){this._isReadonly=e,this._isShallow=n}get(e,n,i){if(n==="__v_skip")return e.__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?tx:ex:s?Q_:Z_).get(e)||Object.getPrototypeOf(e)===Object.getPrototypeOf(i)?e:void 0;const o=Qe(e);if(!r){let l;if(o&&(l=LS[n]))return l;if(n==="hasOwnProperty")return US}const a=Reflect.get(e,n,en(e)?e:i);if((Ri(n)?j_.has(n):FS(n))||(r||Pn(e,"get",n),s))return a;if(en(a)){const l=o&&_u(n)?a:a.value;return r&&Et(l)?qc(l):l}return Et(a)?r?qc(a):On(a):a}}class J_ extends Y_{constructor(e=!1){super(!1,e)}set(e,n,i,r){let s=e[n];const o=Qe(e)&&_u(n);if(!this._isShallow){const c=Br(s);if(!di(i)&&!Br(i)&&(s=St(s),i=St(i)),!o&&en(s)&&!en(i))return c||(s.value=i),!0}const a=o?Number(n)t,Nl=t=>Reflect.getPrototypeOf(t);function HS(t,e,n){return function(...i){const r=this.__v_raw,s=St(r),o=Ho(s),a=t==="entries"||t===Symbol.iterator&&o,l=t==="keys"&&o,c=r[t](...i),u=n?jf:e?ea:Di;return!e&&Pn(s,"iterate",l?$f:Qs),dn(Object.create(c),{next(){const{value:d,done:f}=c.next();return f?{value:d,done:f}:{value:a?[u(d[0]),u(d[1])]:u(d),done:f}}})}}function Ll(t){return function(...e){return t==="delete"?!1:t==="clear"?void 0:this}}function GS(t,e){const n={get(r){const s=this.__v_raw,o=St(s),a=St(r);t||(gs(r,a)&&Pn(o,"get",r),Pn(o,"get",a));const{has:l}=Nl(o),c=e?jf:t?ea:Di;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!t&&Pn(St(r),"iterate",Qs),r.size},has(r){const s=this.__v_raw,o=St(s),a=St(r);return t||(gs(r,a)&&Pn(o,"has",r),Pn(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=St(a),c=e?jf:t?ea:Di;return!t&&Pn(l,"iterate",Qs),a.forEach((u,d)=>r.call(s,c(u),c(d),o))}};return dn(n,t?{add:Ll("add"),set:Ll("set"),delete:Ll("delete"),clear:Ll("clear")}:{add(r){!e&&!di(r)&&!Br(r)&&(r=St(r));const s=St(this);return Nl(s).has.call(s,r)||(s.add(r),Tr(s,"add",r,r)),this},set(r,s){!e&&!di(s)&&!Br(s)&&(s=St(s));const o=St(this),{has:a,get:l}=Nl(o);let c=a.call(o,r);c||(r=St(r),c=a.call(o,r));const u=l.call(o,r);return o.set(r,s),c?gs(s,u)&&Tr(o,"set",r,s):Tr(o,"add",r,s),this},delete(r){const s=St(this),{has:o,get:a}=Nl(s);let l=o.call(s,r);l||(r=St(r),l=o.call(s,r)),a&&a.call(s,r);const c=s.delete(r);return l&&Tr(s,"delete",r,void 0),c},clear(){const r=St(this),s=r.size!==0,o=r.clear();return s&&Tr(r,"clear",void 0,void 0),o}}),["keys","values","entries",Symbol.iterator].forEach(r=>{n[r]=HS(r,t,e)}),n}function Eu(t,e){const n=GS(t,e);return(i,r,s)=>r==="__v_isReactive"?!t:r==="__v_isReadonly"?t:r==="__v_raw"?i:Reflect.get(Tt(n,r)&&r in i?n:i,r,s)}const WS={get:Eu(!1,!1)},qS={get:Eu(!1,!0)},XS={get:Eu(!0,!1)},$S={get:Eu(!0,!0)},Z_=new WeakMap,Q_=new WeakMap,ex=new WeakMap,tx=new WeakMap;function jS(t){switch(t){case"Object":case"Array":return 1;case"Map":case"Set":case"WeakMap":case"WeakSet":return 2;default:return 0}}function YS(t){return t.__v_skip||!Object.isExtensible(t)?0:jS(xS(t))}function On(t){return Br(t)?t:Tu(t,!1,kS,WS,Z_)}function JS(t){return Tu(t,!1,zS,qS,Q_)}function qc(t){return Tu(t,!0,BS,XS,ex)}function Hs(t){return Tu(t,!0,VS,$S,tx)}function Tu(t,e,n,i,r){if(!Et(t)||t.__v_raw&&!(e&&t.__v_isReactive))return t;const s=YS(t);if(s===0)return t;const o=r.get(t);if(o)return o;const a=new Proxy(t,s===2?i:n);return r.set(t,a),a}function eo(t){return Br(t)?eo(t.__v_raw):!!(t&&t.__v_isReactive)}function Br(t){return!!(t&&t.__v_isReadonly)}function di(t){return!!(t&&t.__v_isShallow)}function Au(t){return t?!!t.__v_raw:!1}function St(t){const e=t&&t.__v_raw;return e?St(e):t}function nx(t){return!Tt(t,"__v_skip")&&Object.isExtensible(t)&&N_(t,"__v_skip",!0),t}const Di=t=>Et(t)?On(t):t,ea=t=>Et(t)?qc(t):t;function en(t){return t?t.__v_isRef===!0:!1}function ke(t){return ix(t,!1)}function Cu(t){return ix(t,!0)}function ix(t,e){return en(t)?t:new KS(t,e)}class KS{constructor(e,n){this.dep=new wu,this.__v_isRef=!0,this.__v_isShallow=!1,this._rawValue=n?e:St(e),this._value=n?e:Di(e),this.__v_isShallow=n}get value(){return this.dep.track(),this._value}set value(e){const n=this._rawValue,i=this.__v_isShallow||di(e)||Br(e);e=i?e:St(e),gs(e,n)&&(this._rawValue=e,this._value=i?e:Di(e),this.dep.trigger())}}function ZS(t){t.dep&&t.dep.trigger()}function E(t){return en(t)?t.value:t}function Nn(t){return ot(t)?t():E(t)}const QS={get:(t,e,n)=>e==="__v_raw"?t:E(Reflect.get(t,e,n)),set:(t,e,n,i)=>{const r=t[e];return en(r)&&!en(n)?(r.value=n,!0):Reflect.set(t,e,n,i)}};function rx(t){return eo(t)?t:new Proxy(t,QS)}class ew{constructor(e){this.__v_isRef=!0,this._value=void 0;const n=this.dep=new wu,{get:i,set:r}=e(n.track.bind(n),n.trigger.bind(n));this._get=i,this._set=r}get value(){return this._value=this._get()}set value(e){this._set(e)}}function tw(t){return new ew(t)}function zr(t){const e=Qe(t)?new Array(t.length):{};for(const n in t)e[n]=sx(t,n);return e}class nw{constructor(e,n,i){this._object=e,this._key=n,this._defaultValue=i,this.__v_isRef=!0,this._value=void 0,this._raw=St(e);let r=!0,s=e;if(!Qe(e)||!_u(String(n)))do r=!Au(s)||di(s);while(r&&(s=s.__v_raw));this._shallow=r}get value(){let e=this._object[this._key];return this._shallow&&(e=E(e)),this._value=e===void 0?this._defaultValue:e}set value(e){if(this._shallow&&en(this._raw[this._key])){const n=this._object[this._key];if(en(n)){n.value=e;return}}this._object[this._key]=e}get dep(){return NS(this._raw,this._key)}}class iw{constructor(e){this._getter=e,this.__v_isRef=!0,this.__v_isReadonly=!0,this._value=void 0}get value(){return this._value=this._getter()}}function rw(t,e,n){return en(t)?t:ot(t)?new iw(t):Et(t)&&arguments.length>1?sx(t,e,n):ke(t)}function sx(t,e,n){return new nw(t,e,n)}class sw{constructor(e,n,i){this.fn=e,this.setter=n,this._value=void 0,this.dep=new wu(this),this.__v_isRef=!0,this.deps=void 0,this.depsTail=void 0,this.flags=16,this.globalVersion=el-1,this.next=void 0,this.effect=this,this.__v_isReadonly=!n,this.isSSR=i}notify(){if(this.flags|=16,!(this.flags&8)&&Gt!==this)return H_(this,!0),!0}get value(){const e=this.dep.track();return q_(this),e&&(e.version=this.dep.version),this._value}set value(e){this.setter&&this.setter(e)}}function ow(t,e,n=!1){let i,r;return ot(t)?i=t:(i=t.get,r=t.set),new sw(i,r,n)}const Ol={},Xc=new WeakMap;let Gs;function aw(t,e=!1,n=Gs){if(n){let i=Xc.get(n);i||Xc.set(n,i=[]),i.push(t)}}function lw(t,e,n=Bt){const{immediate:i,deep:r,once:s,scheduler:o,augmentJob:a,call:l}=n,c=x=>r?x:di(x)||r===!1||r===0?Ar(x,1):Ar(x);let u,d,f,h,g=!1,v=!1;if(en(t)?(d=()=>t.value,g=di(t)):eo(t)?(d=()=>c(t),g=!0):Qe(t)?(v=!0,g=t.some(x=>eo(x)||di(x)),d=()=>t.map(x=>{if(en(x))return x.value;if(eo(x))return c(x);if(ot(x))return l?l(x,2):x()})):ot(t)?e?d=l?()=>l(t,2):t:d=()=>{if(f){Ur();try{f()}finally{kr()}}const x=Gs;Gs=u;try{return l?l(t,3,[h]):t(h)}finally{Gs=x}}:d=Qi,e&&r){const x=d,M=r===!0?1/0:r;d=()=>Ar(x(),M)}const m=xp(),p=()=>{u.stop(),m&&m.active&&_p(m.effects,u)};if(s&&e){const x=e;e=(...M)=>{x(...M),p()}}let _=v?new Array(t.length).fill(Ol):Ol;const y=x=>{if(!(!(u.flags&1)||!u.dirty&&!x))if(e){const M=u.run();if(r||g||(v?M.some((A,P)=>gs(A,_[P])):gs(M,_))){f&&f();const A=Gs;Gs=u;try{const P=[M,_===Ol?void 0:v&&_[0]===Ol?[]:_,h];_=M,l?l(e,3,P):e(...P)}finally{Gs=A}}}else u.run()};return a&&a(y),u=new z_(d),u.scheduler=o?()=>o(y,!1):y,h=x=>aw(x,!1,u),f=u.onStop=()=>{const x=Xc.get(u);if(x){if(l)l(x,4);else for(const M of x)M();Xc.delete(u)}},e?i?y(!0):_=u.run():o?o(y.bind(null,!0),!0):u.run(),p.pause=u.pause.bind(u),p.resume=u.resume.bind(u),p.stop=p,p}function Ar(t,e=1/0,n){if(e<=0||!Et(t)||t.__v_skip||(n=n||new Map,(n.get(t)||0)>=e))return t;if(n.set(t,e),e--,en(t))Ar(t.value,e,n);else if(Qe(t))for(let i=0;i{Ar(i,e,n)});else if(I_(t)){for(const i in t)Ar(t[i],e,n);for(const i of Object.getOwnPropertySymbols(t))Object.prototype.propertyIsEnumerable.call(t,i)&&Ar(t[i],e,n)}return t}function xl(t,e,n,i){try{return i?t(...i):t()}catch(r){Pu(r,e,n)}}function Ii(t,e,n,i){if(ot(t)){const r=xl(t,e,n,i);return r&&R_(r)&&r.catch(s=>{Pu(s,e,n)}),r}if(Qe(t)){const r=[];for(let s=0;s>>1,r=zn[i],s=nl(r);s=nl(n)?zn.push(t):zn.splice(uw(e),0,t),t.flags|=1,ax()}}function ax(){$c||($c=ox.then(cx))}function dw(t){Qe(t)?Go.push(...t):us&&t.id===-1?us.splice(Oo+1,0,t):t.flags&1||(Go.push(t),t.flags|=1),ax()}function zm(t,e,n=Wi+1){for(;nnl(n)-nl(i));if(Go.length=0,us){us.push(...e);return}for(us=e,Oo=0;Oot.id==null?t.flags&2?-1:1/0:t.id;function cx(t){try{for(Wi=0;Wi{i._d&&Kc(-1);const s=jc(e);let o;try{o=t(...r)}finally{jc(s),i._d&&Kc(1)}return o};return i._n=!0,i._c=!0,i._d=!0,i}function Cc(t,e){if(bn===null)return t;const n=Ou(bn),i=t.dirs||(t.dirs=[]);for(let r=0;r1)return n&&ot(e)?e.call(i&&i.proxy):e}}const fw=Symbol.for("v-scx"),hw=()=>Wo(fw);function Wn(t,e){return Ru(t,null,e)}function dx(t,e){return Ru(t,null,{flush:"post"})}function rn(t,e,n){return Ru(t,e,n)}function Ru(t,e,n=Bt){const{immediate:i,deep:r,flush:s,once:o}=n,a=dn({},n),l=e&&i||!e&&s!=="post";let c;if(ol){if(s==="sync"){const h=hw();c=h.__watcherHandles||(h.__watcherHandles=[])}else if(!l){const h=()=>{};return h.stop=Qi,h.resume=Qi,h.pause=Qi,h}}const u=Rn;a.call=(h,g,v)=>Ii(h,u,g,v);let d=!1;s==="post"?a.scheduler=h=>{Tn(h,u&&u.suspense)}:s!=="sync"&&(d=!0,a.scheduler=(h,g)=>{g?h():wp(h)}),a.augmentJob=h=>{e&&(h.flags|=4),d&&(h.flags|=2,u&&(h.id=u.uid,h.i=u))};const f=lw(t,e,a);return ol&&(c?c.push(f):l&&f()),f}function pw(t,e,n){const i=this.proxy,r=Xt(t)?t.includes(".")?fx(i,t):()=>i[t]:t.bind(i,i);let s;ot(e)?s=e:(s=e.handler,n=e);const o=yl(this),a=Ru(r,s.bind(i),n);return o(),a}function fx(t,e){const n=e.split(".");return()=>{let i=t;for(let r=0;rt.__isTeleport,$a=t=>t&&(t.disabled||t.disabled===""),Vm=t=>t&&(t.defer||t.defer===""),Hm=t=>typeof SVGElement<"u"&&t instanceof SVGElement,Gm=t=>typeof MathMLElement=="function"&&t instanceof MathMLElement,Yf=(t,e)=>{const n=t&&t.to;return Xt(n)?e?e(n):null:n},mx={name:"Teleport",__isTeleport:!0,process(t,e,n,i,r,s,o,a,l,c){const{mc:u,pc:d,pbc:f,o:{insert:h,querySelector:g,createText:v,createComment:m}}=c,p=$a(e.props);let{shapeFlag:_,children:y,dynamicChildren:x}=e;if(t==null){const M=e.el=v(""),A=e.anchor=v("");h(M,n,i),h(A,n,i);const P=(b,w)=>{_&16&&u(y,b,w,r,s,o,a,l)},D=()=>{const b=e.target=Yf(e.props,g),w=Jf(b,e,v,h);b&&(o!=="svg"&&Hm(b)?o="svg":o!=="mathml"&&Gm(b)&&(o="mathml"),r&&r.isCE&&(r.ce._teleportTargets||(r.ce._teleportTargets=new Set)).add(b),p||(P(b,w),Pc(e,!1)))};p&&(P(n,A),Pc(e,!0)),Vm(e.props)?(e.el.__isMounted=!1,Tn(()=>{D(),delete e.el.__isMounted},s)):D()}else{if(Vm(e.props)&&t.el.__isMounted===!1){Tn(()=>{mx.process(t,e,n,i,r,s,o,a,l,c)},s);return}e.el=t.el,e.targetStart=t.targetStart;const M=e.anchor=t.anchor,A=e.target=t.target,P=e.targetAnchor=t.targetAnchor,D=$a(t.props),b=D?n:A,w=D?M:P;if(o==="svg"||Hm(A)?o="svg":(o==="mathml"||Gm(A))&&(o="mathml"),x?(f(t.dynamicChildren,x,b,r,s,o,a),Cp(t,e,!0)):l||d(t,e,b,w,r,s,o,a,!1),p)D?e.props&&t.props&&e.props.to!==t.props.to&&(e.props.to=t.props.to):Fl(e,n,M,c,1);else if((e.props&&e.props.to)!==(t.props&&t.props.to)){const I=e.target=Yf(e.props,g);I&&Fl(e,I,null,c,0)}else D&&Fl(e,A,P,c,1);Pc(e,p)}},remove(t,e,n,{um:i,o:{remove:r}},s){const{shapeFlag:o,children:a,anchor:l,targetStart:c,targetAnchor:u,target:d,props:f}=t;if(d&&(r(c),r(u)),s&&r(l),o&16){const h=s||!$a(f);for(let g=0;g{t.isMounted=!0}),da(()=>{t.isUnmounting=!0}),t}const mi=[Function,Array],gx={mode:String,appear:Boolean,persisted:Boolean,onBeforeEnter:mi,onEnter:mi,onAfterEnter:mi,onEnterCancelled:mi,onBeforeLeave:mi,onLeave:mi,onAfterLeave:mi,onLeaveCancelled:mi,onBeforeAppear:mi,onAppear:mi,onAfterAppear:mi,onAppearCancelled:mi},vx=t=>{const e=t.subTree;return e.component?vx(e.component):e},_w={name:"BaseTransition",props:gx,setup(t,{slots:e}){const n=or(),i=vw();return()=>{const r=e.default&&yx(e.default(),!0);if(!r||!r.length)return;const s=_x(r),o=St(t),{mode:a}=o;if(i.isLeaving)return Id(s);const l=Wm(s);if(!l)return Id(s);let c=Kf(l,o,i,n,d=>c=d);l.type!==xn&&il(l,c);let u=n.subTree&&Wm(n.subTree);if(u&&u.type!==xn&&!qs(u,l)&&vx(n).type!==xn){let d=Kf(u,o,i,n);if(il(u,d),a==="out-in"&&l.type!==xn)return i.isLeaving=!0,d.afterLeave=()=>{i.isLeaving=!1,n.job.flags&8||n.update(),delete d.afterLeave,u=void 0},Id(s);a==="in-out"&&l.type!==xn?d.delayLeave=(f,h,g)=>{const v=xx(i,u);v[String(u.key)]=u,f[Xi]=()=>{h(),f[Xi]=void 0,delete c.delayedLeave,u=void 0},c.delayedLeave=()=>{g(),delete c.delayedLeave,u=void 0}}:u=void 0}else u&&(u=void 0);return s}}};function _x(t){let e=t[0];if(t.length>1){for(const n of t)if(n.type!==xn){e=n;break}}return e}const xw=_w;function xx(t,e){const{leavingVNodes:n}=t;let i=n.get(e.type);return i||(i=Object.create(null),n.set(e.type,i)),i}function Kf(t,e,n,i,r){const{appear:s,mode:o,persisted:a=!1,onBeforeEnter:l,onEnter:c,onAfterEnter:u,onEnterCancelled:d,onBeforeLeave:f,onLeave:h,onAfterLeave:g,onLeaveCancelled:v,onBeforeAppear:m,onAppear:p,onAfterAppear:_,onAppearCancelled:y}=e,x=String(t.key),M=xx(n,t),A=(b,w)=>{b&&Ii(b,i,9,w)},P=(b,w)=>{const I=w[1];A(b,w),Qe(b)?b.every(L=>L.length<=1)&&I():b.length<=1&&I()},D={mode:o,persisted:a,beforeEnter(b){let w=l;if(!n.isMounted)if(s)w=m||l;else return;b[Xi]&&b[Xi](!0);const I=M[x];I&&qs(t,I)&&I.el[Xi]&&I.el[Xi](),A(w,[b])},enter(b){let w=c,I=u,L=d;if(!n.isMounted)if(s)w=p||c,I=_||u,L=y||d;else return;let V=!1;b[ya]=X=>{V||(V=!0,X?A(L,[b]):A(I,[b]),D.delayedLeave&&D.delayedLeave(),b[ya]=void 0)};const $=b[ya].bind(null,!1);w?P(w,[b,$]):$()},leave(b,w){const I=String(t.key);if(b[ya]&&b[ya](!0),n.isUnmounting)return w();A(f,[b]);let L=!1;b[Xi]=$=>{L||(L=!0,w(),$?A(v,[b]):A(g,[b]),b[Xi]=void 0,M[I]===t&&delete M[I])};const V=b[Xi].bind(null,!1);M[I]=t,h?P(h,[b,V]):V()},clone(b){const w=Kf(b,e,n,i,r);return r&&r(w),w}};return D}function Id(t){if(Du(t))return t=Hr(t),t.children=null,t}function Wm(t){if(!Du(t))return px(t.type)&&t.children?_x(t.children):t;if(t.component)return t.component.subTree;const{shapeFlag:e,children:n}=t;if(n){if(e&16)return n[0];if(e&32&&ot(n.default))return n.default()}}function il(t,e){t.shapeFlag&6&&t.component?(t.transition=e,il(t.component.subTree,e)):t.shapeFlag&128?(t.ssContent.transition=e.clone(t.ssContent),t.ssFallback.transition=e.clone(t.ssFallback)):t.transition=e}function yx(t,e=!1,n){let i=[],r=0;for(let s=0;s1)for(let s=0;sja(v,e&&(Qe(e)?e[m]:e),n,i,r));return}if(qo(i)&&!r){i.shapeFlag&512&&i.type.__asyncResolved&&i.component.subTree.component&&ja(t,e,n,i.component.subTree);return}const s=i.shapeFlag&4?Ou(i.component):i.el,o=r?null:s,{i:a,r:l}=t,c=e&&e.r,u=a.refs===Bt?a.refs={}:a.refs,d=a.setupState,f=St(d),h=d===Bt?P_:v=>qm(u,v)?!1:Tt(f,v),g=(v,m)=>!(m&&qm(u,m));if(c!=null&&c!==l){if(Xm(e),Xt(c))u[c]=null,h(c)&&(d[c]=null);else if(en(c)){const v=e;g(c,v.k)&&(c.value=null),v.k&&(u[v.k]=null)}}if(ot(l))xl(l,a,12,[o,u]);else{const v=Xt(l),m=en(l);if(v||m){const p=()=>{if(t.f){const _=v?h(l)?d[l]:u[l]:g()||!t.k?l.value:u[t.k];if(r)Qe(_)&&_p(_,s);else if(Qe(_))_.includes(s)||_.push(s);else if(v)u[l]=[s],h(l)&&(d[l]=u[l]);else{const y=[s];g(l,t.k)&&(l.value=y),t.k&&(u[t.k]=y)}}else v?(u[l]=o,h(l)&&(d[l]=o)):m&&(g(l,t.k)&&(l.value=o),t.k&&(u[t.k]=o))};if(o){const _=()=>{p(),Yc.delete(t)};_.id=-1,Yc.set(t,_),Tn(_,n)}else Xm(t),p()}}}function Xm(t){const e=Yc.get(t);e&&(e.flags|=8,Yc.delete(t))}Su().requestIdleCallback;Su().cancelIdleCallback;const qo=t=>!!t.type.__asyncLoader,Du=t=>t.type.__isKeepAlive;function bw(t,e){Sx(t,"a",e)}function Sw(t,e){Sx(t,"da",e)}function Sx(t,e,n=Rn){const i=t.__wdc||(t.__wdc=()=>{let r=n;for(;r;){if(r.isDeactivated)return;r=r.parent}return t()});if(Iu(e,i,n),n){let r=n.parent;for(;r&&r.parent;)Du(r.parent.vnode)&&ww(i,e,n,r),r=r.parent}}function ww(t,e,n,i){const r=Iu(e,t,i,!0);fa(()=>{_p(i[e],r)},n)}function Iu(t,e,n=Rn,i=!1){if(n){const r=n[t]||(n[t]=[]),s=e.__weh||(e.__weh=(...o)=>{Ur();const a=yl(n),l=Ii(e,n,t,o);return a(),kr(),l});return i?r.unshift(s):r.push(s),s}}const jr=t=>(e,n=Rn)=>{(!ol||t==="sp")&&Iu(t,(...i)=>e(...i),n)},Mw=jr("bm"),ti=jr("m"),Ew=jr("bu"),wx=jr("u"),da=jr("bum"),fa=jr("um"),Tw=jr("sp"),Aw=jr("rtg"),Cw=jr("rtc");function Pw(t,e=Rn){Iu("ec",t,e)}const Rw="components",Mx=Symbol.for("v-ndc");function Ep(t){return Xt(t)?Dw(Rw,t,!1)||t:t||Mx}function Dw(t,e,n=!0,i=!1){const r=bn||Rn;if(r){const s=r.type;{const a=mM(s,!1);if(a&&(a===e||a===ei(e)||a===yu(ei(e))))return s}const o=$m(r[t]||s[t],e)||$m(r.appContext[t],e);return!o&&i?s:o}}function $m(t,e){return t&&(t[e]||t[ei(e)]||t[yu(ei(e))])}function ta(t,e,n,i){let r;const s=n,o=Qe(t);if(o||Xt(t)){const a=o&&eo(t);let l=!1,c=!1;a&&(l=!di(t),c=Br(t),t=Mu(t)),r=new Array(t.length);for(let u=0,d=t.length;ue(a,l,void 0,s));else{const a=Object.keys(t);r=new Array(a.length);for(let l=0,c=a.length;l0;return me(),Ie(Kt,null,[ie("slot",n,i&&i())],c?-2:64)}let s=t[e];s&&s._c&&(s._d=!1),me();const o=s&&Ex(s(n)),a=n.key||o&&o.key,l=Ie(Kt,{key:(a&&!Ri(a)?a:`_${e}`)+(!o&&i?"_fb":"")},o||(i?i():[]),o&&t._===1?64:-2);return l.scopeId&&(l.slotScopeIds=[l.scopeId+"-s"]),s&&s._c&&(s._d=!0),l}function Ex(t){return t.some(e=>sl(e)?!(e.type===xn||e.type===Kt&&!Ex(e.children)):!0)?t:null}function Iw(t,e){const n={};for(const i in t)n[Wa(i)]=t[i];return n}const Zf=t=>t?Wx(t)?Ou(t):Zf(t.parent):null,Ya=dn(Object.create(null),{$:t=>t,$el:t=>t.vnode.el,$data:t=>t.data,$props:t=>t.props,$attrs:t=>t.attrs,$slots:t=>t.slots,$refs:t=>t.refs,$parent:t=>Zf(t.parent),$root:t=>Zf(t.root),$host:t=>t.ce,$emit:t=>t.emit,$options:t=>Ax(t),$forceUpdate:t=>t.f||(t.f=()=>{wp(t.update)}),$nextTick:t=>t.n||(t.n=Vr.bind(t.proxy)),$watch:t=>pw.bind(t)}),Nd=(t,e)=>t!==Bt&&!t.__isScriptSetup&&Tt(t,e),Nw={get({_:t},e){if(e==="__v_skip")return!0;const{ctx:n,setupState:i,data:r,props:s,accessCache:o,type:a,appContext:l}=t;if(e[0]!=="$"){const f=o[e];if(f!==void 0)switch(f){case 1:return i[e];case 2:return r[e];case 4:return n[e];case 3:return s[e]}else{if(Nd(i,e))return o[e]=1,i[e];if(r!==Bt&&Tt(r,e))return o[e]=2,r[e];if(Tt(s,e))return o[e]=3,s[e];if(n!==Bt&&Tt(n,e))return o[e]=4,n[e];eh&&(o[e]=0)}}const c=Ya[e];let u,d;if(c)return e==="$attrs"&&Pn(t.attrs,"get",""),c(t);if((u=a.__cssModules)&&(u=u[e]))return u;if(n!==Bt&&Tt(n,e))return o[e]=4,n[e];if(d=l.config.globalProperties,Tt(d,e))return d[e]},set({_:t},e,n){const{data:i,setupState:r,ctx:s}=t;return Nd(r,e)?(r[e]=n,!0):i!==Bt&&Tt(i,e)?(i[e]=n,!0):Tt(t.props,e)||e[0]==="$"&&e.slice(1)in t?!1:(s[e]=n,!0)},has({_:{data:t,setupState:e,accessCache:n,ctx:i,appContext:r,props:s,type:o}},a){let l;return!!(n[a]||t!==Bt&&a[0]!=="$"&&Tt(t,a)||Nd(e,a)||Tt(s,a)||Tt(i,a)||Tt(Ya,a)||Tt(r.config.globalProperties,a)||(l=o.__cssModules)&&l[a])},defineProperty(t,e,n){return n.get!=null?t._.accessCache[e]=0:Tt(n,"value")&&this.set(t,e,n.value,null),Reflect.defineProperty(t,e,n)}};function Qf(t){return Qe(t)?t.reduce((e,n)=>(e[n]=null,e),{}):t}function Lw(t,e){const n=Qf(t);for(const i in e){if(i.startsWith("__skip"))continue;let r=n[i];r?Qe(r)||ot(r)?r=n[i]={type:r,default:e[i]}:r.default=e[i]:r===null&&(r=n[i]={default:e[i]}),r&&e[`__skip_${i}`]&&(r.skipFactory=!0)}return n}let eh=!0;function Ow(t){const e=Ax(t),n=t.proxy,i=t.ctx;eh=!1,e.beforeCreate&&jm(e.beforeCreate,t,"bc");const{data:r,computed:s,methods:o,watch:a,provide:l,inject:c,created:u,beforeMount:d,mounted:f,beforeUpdate:h,updated:g,activated:v,deactivated:m,beforeDestroy:p,beforeUnmount:_,destroyed:y,unmounted:x,render:M,renderTracked:A,renderTriggered:P,errorCaptured:D,serverPrefetch:b,expose:w,inheritAttrs:I,components:L,directives:V,filters:$}=e;if(c&&Fw(c,i,null),o)for(const B in o){const z=o[B];ot(z)&&(i[B]=z.bind(n))}if(r){const B=r.call(n,n);Et(B)&&(t.data=On(B))}if(eh=!0,s)for(const B in s){const z=s[B],de=ot(z)?z.bind(n,n):ot(z.get)?z.get.bind(n,n):Qi,le=!ot(z)&&ot(z.set)?z.set.bind(n):Qi,pe=we({get:de,set:le});Object.defineProperty(i,B,{enumerable:!0,configurable:!0,get:()=>pe.value,set:He=>pe.value=He})}if(a)for(const B in a)Tx(a[B],i,n,B);if(l){const B=ot(l)?l.call(n):l;Reflect.ownKeys(B).forEach(z=>{Mp(z,B[z])})}u&&jm(u,t,"c");function W(B,z){Qe(z)?z.forEach(de=>B(de.bind(n))):z&&B(z.bind(n))}if(W(Mw,d),W(ti,f),W(Ew,h),W(wx,g),W(bw,v),W(Sw,m),W(Pw,D),W(Cw,A),W(Aw,P),W(da,_),W(fa,x),W(Tw,b),Qe(w))if(w.length){const B=t.exposed||(t.exposed={});w.forEach(z=>{Object.defineProperty(B,z,{get:()=>n[z],set:de=>n[z]=de,enumerable:!0})})}else t.exposed||(t.exposed={});M&&t.render===Qi&&(t.render=M),I!=null&&(t.inheritAttrs=I),L&&(t.components=L),V&&(t.directives=V),b&&bx(t)}function Fw(t,e,n=Qi){Qe(t)&&(t=th(t));for(const i in t){const r=t[i];let s;Et(r)?"default"in r?s=Wo(r.from||i,r.default,!0):s=Wo(r.from||i):s=Wo(r),en(s)?Object.defineProperty(e,i,{enumerable:!0,configurable:!0,get:()=>s.value,set:o=>s.value=o}):e[i]=s}}function jm(t,e,n){Ii(Qe(t)?t.map(i=>i.bind(e.proxy)):t.bind(e.proxy),e,n)}function Tx(t,e,n,i){let r=i.includes(".")?fx(n,i):()=>n[i];if(Xt(t)){const s=e[t];ot(s)&&rn(r,s)}else if(ot(t))rn(r,t.bind(n));else if(Et(t))if(Qe(t))t.forEach(s=>Tx(s,e,n,i));else{const s=ot(t.handler)?t.handler.bind(n):e[t.handler];ot(s)&&rn(r,s,t)}}function Ax(t){const e=t.type,{mixins:n,extends:i}=e,{mixins:r,optionsCache:s,config:{optionMergeStrategies:o}}=t.appContext,a=s.get(e);let l;return a?l=a:!r.length&&!n&&!i?l=e:(l={},r.length&&r.forEach(c=>Jc(l,c,o,!0)),Jc(l,e,o)),Et(e)&&s.set(e,l),l}function Jc(t,e,n,i=!1){const{mixins:r,extends:s}=e;s&&Jc(t,s,n,!0),r&&r.forEach(o=>Jc(t,o,n,!0));for(const o in e)if(!(i&&o==="expose")){const a=Uw[o]||n&&n[o];t[o]=a?a(t[o],e[o]):e[o]}return t}const Uw={data:Ym,props:Jm,emits:Jm,methods:Oa,computed:Oa,beforeCreate:Un,created:Un,beforeMount:Un,mounted:Un,beforeUpdate:Un,updated:Un,beforeDestroy:Un,beforeUnmount:Un,destroyed:Un,unmounted:Un,activated:Un,deactivated:Un,errorCaptured:Un,serverPrefetch:Un,components:Oa,directives:Oa,watch:Bw,provide:Ym,inject:kw};function Ym(t,e){return e?t?function(){return dn(ot(t)?t.call(this,this):t,ot(e)?e.call(this,this):e)}:e:t}function kw(t,e){return Oa(th(t),th(e))}function th(t){if(Qe(t)){const e={};for(let n=0;ne==="modelValue"||e==="model-value"?t.modelModifiers:t[`${e}Modifiers`]||t[`${ei(e)}Modifiers`]||t[`${bs(e)}Modifiers`];function Gw(t,e,...n){if(t.isUnmounted)return;const i=t.vnode.props||Bt;let r=n;const s=e.startsWith("update:"),o=s&&Hw(i,e.slice(7));o&&(o.trim&&(r=n.map(u=>Xt(u)?u.trim():u)),o.number&&(r=n.map(bu)));let a,l=i[a=Wa(e)]||i[a=Wa(ei(e))];!l&&s&&(l=i[a=Wa(bs(e))]),l&&Ii(l,t,6,r);const c=i[a+"Once"];if(c){if(!t.emitted)t.emitted={};else if(t.emitted[a])return;t.emitted[a]=!0,Ii(c,t,6,r)}}const Ww=new WeakMap;function Px(t,e,n=!1){const i=n?Ww:e.emitsCache,r=i.get(t);if(r!==void 0)return r;const s=t.emits;let o={},a=!1;if(!ot(t)){const l=c=>{const u=Px(c,e,!0);u&&(a=!0,dn(o,u))};!n&&e.mixins.length&&e.mixins.forEach(l),t.extends&&l(t.extends),t.mixins&&t.mixins.forEach(l)}return!s&&!a?(Et(t)&&i.set(t,null),null):(Qe(s)?s.forEach(l=>o[l]=null):dn(o,s),Et(t)&&i.set(t,o),o)}function Nu(t,e){return!t||!gu(e)?!1:(e=e.slice(2).replace(/Once$/,""),Tt(t,e[0].toLowerCase()+e.slice(1))||Tt(t,bs(e))||Tt(t,e))}function Km(t){const{type:e,vnode:n,proxy:i,withProxy:r,propsOptions:[s],slots:o,attrs:a,emit:l,render:c,renderCache:u,props:d,data:f,setupState:h,ctx:g,inheritAttrs:v}=t,m=jc(t);let p,_;try{if(n.shapeFlag&4){const x=r||i,M=x;p=$i(c.call(M,x,u,d,h,f,g)),_=a}else{const x=e;p=$i(x.length>1?x(d,{attrs:a,slots:o,emit:l}):x(d,null)),_=e.props?a:qw(a)}}catch(x){Ja.length=0,Pu(x,t,1),p=ie(xn)}let y=p;if(_&&v!==!1){const x=Object.keys(_),{shapeFlag:M}=y;x.length&&M&7&&(s&&x.some(vp)&&(_=Xw(_,s)),y=Hr(y,_,!1,!0))}return n.dirs&&(y=Hr(y,null,!1,!0),y.dirs=y.dirs?y.dirs.concat(n.dirs):n.dirs),n.transition&&il(y,n.transition),p=y,jc(m),p}const qw=t=>{let e;for(const n in t)(n==="class"||n==="style"||gu(n))&&((e||(e={}))[n]=t[n]);return e},Xw=(t,e)=>{const n={};for(const i in t)(!vp(i)||!(i.slice(9)in e))&&(n[i]=t[i]);return n};function $w(t,e,n){const{props:i,children:r,component:s}=t,{props:o,children:a,patchFlag:l}=e,c=s.emitsOptions;if(e.dirs||e.transition)return!0;if(n&&l>=0){if(l&1024)return!0;if(l&16)return i?Zm(i,o,c):!!o;if(l&8){const u=e.dynamicProps;for(let d=0;dObject.create(Dx),Nx=t=>Object.getPrototypeOf(t)===Dx;function Yw(t,e,n,i=!1){const r={},s=Ix();t.propsDefaults=Object.create(null),Lx(t,e,r,s);for(const o in t.propsOptions[0])o in r||(r[o]=void 0);n?t.props=i?r:JS(r):t.type.props?t.props=r:t.props=s,t.attrs=s}function Jw(t,e,n,i){const{props:r,attrs:s,vnode:{patchFlag:o}}=t,a=St(r),[l]=t.propsOptions;let c=!1;if((i||o>0)&&!(o&16)){if(o&8){const u=t.vnode.dynamicProps;for(let d=0;d{l=!0;const[f,h]=Ox(d,e,!0);dn(o,f),h&&a.push(...h)};!n&&e.mixins.length&&e.mixins.forEach(u),t.extends&&u(t.extends),t.mixins&&t.mixins.forEach(u)}if(!s&&!l)return Et(t)&&i.set(t,Vo),Vo;if(Qe(s))for(let u=0;ut==="_"||t==="_ctx"||t==="$stable",Ap=t=>Qe(t)?t.map($i):[$i(t)],Zw=(t,e,n)=>{if(e._n)return e;const i=te((...r)=>Ap(e(...r)),n);return i._c=!1,i},Fx=(t,e,n)=>{const i=t._ctx;for(const r in t){if(Tp(r))continue;const s=t[r];if(ot(s))e[r]=Zw(r,s,i);else if(s!=null){const o=Ap(s);e[r]=()=>o}}},Ux=(t,e)=>{const n=Ap(e);t.slots.default=()=>n},kx=(t,e,n)=>{for(const i in e)(n||!Tp(i))&&(t[i]=e[i])},Qw=(t,e,n)=>{const i=t.slots=Ix();if(t.vnode.shapeFlag&32){const r=e._;r?(kx(i,e,n),n&&N_(i,"_",r,!0)):Fx(e,i)}else e&&Ux(t,e)},eM=(t,e,n)=>{const{vnode:i,slots:r}=t;let s=!0,o=Bt;if(i.shapeFlag&32){const a=e._;a?n&&a===1?s=!1:kx(r,e,n):(s=!e.$stable,Fx(e,r)),o=e}else e&&(Ux(t,e),o={default:1});if(s)for(const a in r)!Tp(a)&&o[a]==null&&delete r[a]},Tn=sM;function tM(t){return nM(t)}function nM(t,e){const n=Su();n.__VUE__=!0;const{insert:i,remove:r,patchProp:s,createElement:o,createText:a,createComment:l,setText:c,setElementText:u,parentNode:d,nextSibling:f,setScopeId:h=Qi,insertStaticContent:g}=t,v=(O,k,U,q=null,H=null,Y=null,C=void 0,ae=null,Q=!!k.dynamicChildren)=>{if(O===k)return;O&&!qs(O,k)&&(q=ue(O),He(O,H,Y,!0),O=null),k.patchFlag===-2&&(Q=!1,k.dynamicChildren=null);const{type:ee,ref:oe,shapeFlag:T}=k;switch(ee){case Lu:m(O,k,U,q);break;case xn:p(O,k,U,q);break;case Od:O==null&&_(k,U,q,C);break;case Kt:L(O,k,U,q,H,Y,C,ae,Q);break;default:T&1?M(O,k,U,q,H,Y,C,ae,Q):T&6?V(O,k,U,q,H,Y,C,ae,Q):(T&64||T&128)&&ee.process(O,k,U,q,H,Y,C,ae,Q,Ae)}oe!=null&&H?ja(oe,O&&O.ref,Y,k||O,!k):oe==null&&O&&O.ref!=null&&ja(O.ref,null,Y,O,!0)},m=(O,k,U,q)=>{if(O==null)i(k.el=a(k.children),U,q);else{const H=k.el=O.el;k.children!==O.children&&c(H,k.children)}},p=(O,k,U,q)=>{O==null?i(k.el=l(k.children||""),U,q):k.el=O.el},_=(O,k,U,q)=>{[O.el,O.anchor]=g(O.children,k,U,q,O.el,O.anchor)},y=({el:O,anchor:k},U,q)=>{let H;for(;O&&O!==k;)H=f(O),i(O,U,q),O=H;i(k,U,q)},x=({el:O,anchor:k})=>{let U;for(;O&&O!==k;)U=f(O),r(O),O=U;r(k)},M=(O,k,U,q,H,Y,C,ae,Q)=>{if(k.type==="svg"?C="svg":k.type==="math"&&(C="mathml"),O==null)A(k,U,q,H,Y,C,ae,Q);else{const ee=O.el&&O.el._isVueCE?O.el:null;try{ee&&ee._beginPatch(),b(O,k,H,Y,C,ae,Q)}finally{ee&&ee._endPatch()}}},A=(O,k,U,q,H,Y,C,ae)=>{let Q,ee;const{props:oe,shapeFlag:T,transition:S,dirs:F}=O;if(Q=O.el=o(O.type,Y,oe&&oe.is,oe),T&8?u(Q,O.children):T&16&&D(O.children,Q,null,q,H,Ld(O,Y),C,ae),F&&Cs(O,null,q,"created"),P(Q,O,O.scopeId,C,q),oe){for(const se in oe)se!=="value"&&!Ga(se)&&s(Q,se,null,oe[se],Y,q);"value"in oe&&s(Q,"value",null,oe.value,Y),(ee=oe.onVnodeBeforeMount)&&Vi(ee,q,O)}F&&Cs(O,null,q,"beforeMount");const J=iM(H,S);J&&S.beforeEnter(Q),i(Q,k,U),((ee=oe&&oe.onVnodeMounted)||J||F)&&Tn(()=>{ee&&Vi(ee,q,O),J&&S.enter(Q),F&&Cs(O,null,q,"mounted")},H)},P=(O,k,U,q,H)=>{if(U&&h(O,U),q)for(let Y=0;Y{for(let ee=Q;ee{const ae=k.el=O.el;let{patchFlag:Q,dynamicChildren:ee,dirs:oe}=k;Q|=O.patchFlag&16;const T=O.props||Bt,S=k.props||Bt;let F;if(U&&Ps(U,!1),(F=S.onVnodeBeforeUpdate)&&Vi(F,U,k,O),oe&&Cs(k,O,U,"beforeUpdate"),U&&Ps(U,!0),(T.innerHTML&&S.innerHTML==null||T.textContent&&S.textContent==null)&&u(ae,""),ee?w(O.dynamicChildren,ee,ae,U,q,Ld(k,H),Y):C||z(O,k,ae,null,U,q,Ld(k,H),Y,!1),Q>0){if(Q&16)I(ae,T,S,U,H);else if(Q&2&&T.class!==S.class&&s(ae,"class",null,S.class,H),Q&4&&s(ae,"style",T.style,S.style,H),Q&8){const J=k.dynamicProps;for(let se=0;se{F&&Vi(F,U,k,O),oe&&Cs(k,O,U,"updated")},q)},w=(O,k,U,q,H,Y,C)=>{for(let ae=0;ae{if(k!==U){if(k!==Bt)for(const Y in k)!Ga(Y)&&!(Y in U)&&s(O,Y,k[Y],null,H,q);for(const Y in U){if(Ga(Y))continue;const C=U[Y],ae=k[Y];C!==ae&&Y!=="value"&&s(O,Y,ae,C,H,q)}"value"in U&&s(O,"value",k.value,U.value,H)}},L=(O,k,U,q,H,Y,C,ae,Q)=>{const ee=k.el=O?O.el:a(""),oe=k.anchor=O?O.anchor:a("");let{patchFlag:T,dynamicChildren:S,slotScopeIds:F}=k;F&&(ae=ae?ae.concat(F):F),O==null?(i(ee,U,q),i(oe,U,q),D(k.children||[],U,oe,H,Y,C,ae,Q)):T>0&&T&64&&S&&O.dynamicChildren&&O.dynamicChildren.length===S.length?(w(O.dynamicChildren,S,U,H,Y,C,ae),(k.key!=null||H&&k===H.subTree)&&Cp(O,k,!0)):z(O,k,U,oe,H,Y,C,ae,Q)},V=(O,k,U,q,H,Y,C,ae,Q)=>{k.slotScopeIds=ae,O==null?k.shapeFlag&512?H.ctx.activate(k,U,q,C,Q):$(k,U,q,H,Y,C,Q):X(O,k,Q)},$=(O,k,U,q,H,Y,C)=>{const ae=O.component=uM(O,q,H);if(Du(O)&&(ae.ctx.renderer=Ae),dM(ae,!1,C),ae.asyncDep){if(H&&H.registerDep(ae,W,C),!O.el){const Q=ae.subTree=ie(xn);p(null,Q,k,U),O.placeholder=Q.el}}else W(ae,O,k,U,H,Y,C)},X=(O,k,U)=>{const q=k.component=O.component;if($w(O,k,U))if(q.asyncDep&&!q.asyncResolved){B(q,k,U);return}else q.next=k,q.update();else k.el=O.el,q.vnode=k},W=(O,k,U,q,H,Y,C)=>{const ae=()=>{if(O.isMounted){let{next:T,bu:S,u:F,parent:J,vnode:se}=O;{const $e=Bx(O);if($e){T&&(T.el=se.el,B(O,T,C)),$e.asyncDep.then(()=>{Tn(()=>{O.isUnmounted||ee()},H)});return}}let K=T,Ce;Ps(O,!1),T?(T.el=se.el,B(O,T,C)):T=se,S&&Ac(S),(Ce=T.props&&T.props.onVnodeBeforeUpdate)&&Vi(Ce,J,T,se),Ps(O,!0);const ve=Km(O),Oe=O.subTree;O.subTree=ve,v(Oe,ve,d(Oe.el),ue(Oe),O,H,Y),T.el=ve.el,K===null&&jw(O,ve.el),F&&Tn(F,H),(Ce=T.props&&T.props.onVnodeUpdated)&&Tn(()=>Vi(Ce,J,T,se),H)}else{let T;const{el:S,props:F}=k,{bm:J,m:se,parent:K,root:Ce,type:ve}=O,Oe=qo(k);Ps(O,!1),J&&Ac(J),!Oe&&(T=F&&F.onVnodeBeforeMount)&&Vi(T,K,k),Ps(O,!0);{Ce.ce&&Ce.ce._hasShadowRoot()&&Ce.ce._injectChildStyle(ve);const $e=O.subTree=Km(O);v(null,$e,U,q,O,H,Y),k.el=$e.el}if(se&&Tn(se,H),!Oe&&(T=F&&F.onVnodeMounted)){const $e=k;Tn(()=>Vi(T,K,$e),H)}(k.shapeFlag&256||K&&qo(K.vnode)&&K.vnode.shapeFlag&256)&&O.a&&Tn(O.a,H),O.isMounted=!0,k=U=q=null}};O.scope.on();const Q=O.effect=new z_(ae);O.scope.off();const ee=O.update=Q.run.bind(Q),oe=O.job=Q.runIfDirty.bind(Q);oe.i=O,oe.id=O.uid,Q.scheduler=()=>wp(oe),Ps(O,!0),ee()},B=(O,k,U)=>{k.component=O;const q=O.vnode.props;O.vnode=k,O.next=null,Jw(O,k.props,q,U),eM(O,k.children,U),Ur(),zm(O),kr()},z=(O,k,U,q,H,Y,C,ae,Q=!1)=>{const ee=O&&O.children,oe=O?O.shapeFlag:0,T=k.children,{patchFlag:S,shapeFlag:F}=k;if(S>0){if(S&128){le(ee,T,U,q,H,Y,C,ae,Q);return}else if(S&256){de(ee,T,U,q,H,Y,C,ae,Q);return}}F&8?(oe&16&&ce(ee,H,Y),T!==ee&&u(U,T)):oe&16?F&16?le(ee,T,U,q,H,Y,C,ae,Q):ce(ee,H,Y,!0):(oe&8&&u(U,""),F&16&&D(T,U,q,H,Y,C,ae,Q))},de=(O,k,U,q,H,Y,C,ae,Q)=>{O=O||Vo,k=k||Vo;const ee=O.length,oe=k.length,T=Math.min(ee,oe);let S;for(S=0;Soe?ce(O,H,Y,!0,!1,T):D(k,U,q,H,Y,C,ae,Q,T)},le=(O,k,U,q,H,Y,C,ae,Q)=>{let ee=0;const oe=k.length;let T=O.length-1,S=oe-1;for(;ee<=T&&ee<=S;){const F=O[ee],J=k[ee]=Q?wr(k[ee]):$i(k[ee]);if(qs(F,J))v(F,J,U,null,H,Y,C,ae,Q);else break;ee++}for(;ee<=T&&ee<=S;){const F=O[T],J=k[S]=Q?wr(k[S]):$i(k[S]);if(qs(F,J))v(F,J,U,null,H,Y,C,ae,Q);else break;T--,S--}if(ee>T){if(ee<=S){const F=S+1,J=FS)for(;ee<=T;)He(O[ee],H,Y,!0),ee++;else{const F=ee,J=ee,se=new Map;for(ee=J;ee<=S;ee++){const Pe=k[ee]=Q?wr(k[ee]):$i(k[ee]);Pe.key!=null&&se.set(Pe.key,ee)}let K,Ce=0;const ve=S-J+1;let Oe=!1,$e=0;const ge=new Array(ve);for(ee=0;ee=ve){He(Pe,H,Y,!0);continue}let Be;if(Pe.key!=null)Be=se.get(Pe.key);else for(K=J;K<=S;K++)if(ge[K-J]===0&&qs(Pe,k[K])){Be=K;break}Be===void 0?He(Pe,H,Y,!0):(ge[Be-J]=ee+1,Be>=$e?$e=Be:Oe=!0,v(Pe,k[Be],U,null,H,Y,C,ae,Q),Ce++)}const Me=Oe?rM(ge):Vo;for(K=Me.length-1,ee=ve-1;ee>=0;ee--){const Pe=J+ee,Be=k[Pe],Se=k[Pe+1],dt=Pe+1{const{el:Y,type:C,transition:ae,children:Q,shapeFlag:ee}=O;if(ee&6){pe(O.component.subTree,k,U,q);return}if(ee&128){O.suspense.move(k,U,q);return}if(ee&64){C.move(O,k,U,Ae);return}if(C===Kt){i(Y,k,U);for(let T=0;Tae.enter(Y),H);else{const{leave:T,delayLeave:S,afterLeave:F}=ae,J=()=>{O.ctx.isUnmounted?r(Y):i(Y,k,U)},se=()=>{Y._isLeaving&&Y[Xi](!0),T(Y,()=>{J(),F&&F()})};S?S(Y,J,se):se()}else i(Y,k,U)},He=(O,k,U,q=!1,H=!1)=>{const{type:Y,props:C,ref:ae,children:Q,dynamicChildren:ee,shapeFlag:oe,patchFlag:T,dirs:S,cacheIndex:F}=O;if(T===-2&&(H=!1),ae!=null&&(Ur(),ja(ae,null,U,O,!0),kr()),F!=null&&(k.renderCache[F]=void 0),oe&256){k.ctx.deactivate(O);return}const J=oe&1&&S,se=!qo(O);let K;if(se&&(K=C&&C.onVnodeBeforeUnmount)&&Vi(K,k,O),oe&6)xt(O.component,U,q);else{if(oe&128){O.suspense.unmount(U,q);return}J&&Cs(O,null,k,"beforeUnmount"),oe&64?O.type.remove(O,k,U,Ae,q):ee&&!ee.hasOnce&&(Y!==Kt||T>0&&T&64)?ce(ee,k,U,!1,!0):(Y===Kt&&T&384||!H&&oe&16)&&ce(Q,k,U),q&&ze(O)}(se&&(K=C&&C.onVnodeUnmounted)||J)&&Tn(()=>{K&&Vi(K,k,O),J&&Cs(O,null,k,"unmounted")},U)},ze=O=>{const{type:k,el:U,anchor:q,transition:H}=O;if(k===Kt){st(U,q);return}if(k===Od){x(O);return}const Y=()=>{r(U),H&&!H.persisted&&H.afterLeave&&H.afterLeave()};if(O.shapeFlag&1&&H&&!H.persisted){const{leave:C,delayLeave:ae}=H,Q=()=>C(U,Y);ae?ae(O.el,Y,Q):Q()}else Y()},st=(O,k)=>{let U;for(;O!==k;)U=f(O),r(O),O=U;r(k)},xt=(O,k,U)=>{const{bum:q,scope:H,job:Y,subTree:C,um:ae,m:Q,a:ee}=O;eg(Q),eg(ee),q&&Ac(q),H.stop(),Y&&(Y.flags|=8,He(C,O,k,U)),ae&&Tn(ae,k),Tn(()=>{O.isUnmounted=!0},k)},ce=(O,k,U,q=!1,H=!1,Y=0)=>{for(let C=Y;C{if(O.shapeFlag&6)return ue(O.component.subTree);if(O.shapeFlag&128)return O.suspense.next();const k=f(O.anchor||O.el),U=k&&k[hx];return U?f(U):k};let Le=!1;const je=(O,k,U)=>{let q;O==null?k._vnode&&(He(k._vnode,null,null,!0),q=k._vnode.component):v(k._vnode||null,O,k,null,null,null,U),k._vnode=O,Le||(Le=!0,zm(q),lx(),Le=!1)},Ae={p:v,um:He,m:pe,r:ze,mt:$,mc:D,pc:z,pbc:w,n:ue,o:t};return{render:je,hydrate:void 0,createApp:Vw(je)}}function Ld({type:t,props:e},n){return n==="svg"&&t==="foreignObject"||n==="mathml"&&t==="annotation-xml"&&e&&e.encoding&&e.encoding.includes("html")?void 0:n}function Ps({effect:t,job:e},n){n?(t.flags|=32,e.flags|=4):(t.flags&=-33,e.flags&=-5)}function iM(t,e){return(!t||t&&!t.pendingBranch)&&e&&!e.persisted}function Cp(t,e,n=!1){const i=t.children,r=e.children;if(Qe(i)&&Qe(r))for(let s=0;s>1,t[n[a]]0&&(e[i]=n[s-1]),n[s]=i)}}for(s=n.length,o=n[s-1];s-- >0;)n[s]=o,o=e[o];return n}function Bx(t){const e=t.subTree.component;if(e)return e.asyncDep&&!e.asyncResolved?e:Bx(e)}function eg(t){if(t)for(let e=0;et.__isSuspense;function sM(t,e){e&&e.pendingBranch?Qe(t)?e.effects.push(...t):e.effects.push(t):dw(t)}const Kt=Symbol.for("v-fgt"),Lu=Symbol.for("v-txt"),xn=Symbol.for("v-cmt"),Od=Symbol.for("v-stc"),Ja=[];let ci=null;function me(t=!1){Ja.push(ci=t?null:[])}function oM(){Ja.pop(),ci=Ja[Ja.length-1]||null}let rl=1;function Kc(t,e=!1){rl+=t,t<0&&ci&&e&&(ci.hasOnce=!0)}function Hx(t){return t.dynamicChildren=rl>0?ci||Vo:null,oM(),rl>0&&ci&&ci.push(t),t}function Ct(t,e,n,i,r,s){return Hx(Ye(t,e,n,i,r,s,!0))}function Ie(t,e,n,i,r){return Hx(ie(t,e,n,i,r,!0))}function sl(t){return t?t.__v_isVNode===!0:!1}function qs(t,e){return t.type===e.type&&t.key===e.key}const Gx=({key:t})=>t??null,Rc=({ref:t,ref_key:e,ref_for:n})=>(typeof t=="number"&&(t=""+t),t!=null?Xt(t)||en(t)||ot(t)?{i:bn,r:t,k:e,f:!!n}:t:null);function Ye(t,e=null,n=null,i=0,r=null,s=t===Kt?0:1,o=!1,a=!1){const l={__v_isVNode:!0,__v_skip:!0,type:t,props:e,key:e&&Gx(e),ref:e&&Rc(e),scopeId:ux,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:bn};return a?(Pp(l,n),s&128&&t.normalize(l)):n&&(l.shapeFlag|=Xt(n)?8:16),rl>0&&!o&&ci&&(l.patchFlag>0||s&6)&&l.patchFlag!==32&&ci.push(l),l}const ie=aM;function aM(t,e=null,n=null,i=0,r=null,s=!1){if((!t||t===Mx)&&(t=xn),sl(t)){const a=Hr(t,e,!0);return n&&Pp(a,n),rl>0&&!s&&ci&&(a.shapeFlag&6?ci[ci.indexOf(t)]=a:ci.push(a)),a.patchFlag=-2,a}if(gM(t)&&(t=t.__vccOpts),e){e=Yr(e);let{class:a,style:l}=e;a&&!Xt(a)&&(e.class=Qt(a)),Et(l)&&(Au(l)&&!Qe(l)&&(l=dn({},l)),e.style=$r(l))}const o=Xt(t)?1:Vx(t)?128:px(t)?64:Et(t)?4:ot(t)?2:0;return Ye(t,e,n,i,r,o,s,!0)}function Yr(t){return t?Au(t)||Nx(t)?dn({},t):t:null}function Hr(t,e,n=!1,i=!1){const{props:r,ref:s,patchFlag:o,children:a,transition:l}=t,c=e?It(r||{},e):r,u={__v_isVNode:!0,__v_skip:!0,type:t.type,props:c,key:c&&Gx(c),ref:e&&e.ref?n&&s?Qe(s)?s.concat(Rc(e)):[s,Rc(e)]:Rc(e):s,scopeId:t.scopeId,slotScopeIds:t.slotScopeIds,children:a,target:t.target,targetStart:t.targetStart,targetAnchor:t.targetAnchor,staticCount:t.staticCount,shapeFlag:t.shapeFlag,patchFlag:e&&t.type!==Kt?o===-1?16:o|16:o,dynamicProps:t.dynamicProps,dynamicChildren:t.dynamicChildren,appContext:t.appContext,dirs:t.dirs,transition:l,component:t.component,suspense:t.suspense,ssContent:t.ssContent&&Hr(t.ssContent),ssFallback:t.ssFallback&&Hr(t.ssFallback),placeholder:t.placeholder,el:t.el,anchor:t.anchor,ctx:t.ctx,ce:t.ce};return l&&i&&il(u,l.clone(u)),u}function zt(t=" ",e=0){return ie(Lu,null,t,e)}function fi(t="",e=!1){return e?(me(),Ie(xn,null,t)):ie(xn,null,t)}function $i(t){return t==null||typeof t=="boolean"?ie(xn):Qe(t)?ie(Kt,null,t.slice()):sl(t)?wr(t):ie(Lu,null,String(t))}function wr(t){return t.el===null&&t.patchFlag!==-1||t.memo?t:Hr(t)}function Pp(t,e){let n=0;const{shapeFlag:i}=t;if(e==null)e=null;else if(Qe(e))n=16;else if(typeof e=="object")if(i&65){const r=e.default;r&&(r._c&&(r._d=!1),Pp(t,r()),r._c&&(r._d=!0));return}else{n=32;const r=e._;!r&&!Nx(e)?e._ctx=bn:r===3&&bn&&(bn.slots._===1?e._=1:(e._=2,t.patchFlag|=1024))}else ot(e)?(e={default:e,_ctx:bn},n=32):(e=String(e),i&64?(n=16,e=[zt(e)]):n=8);t.children=e,t.shapeFlag|=n}function It(...t){const e={};for(let n=0;nRn||bn;let Zc,ih;{const t=Su(),e=(n,i)=>{let r;return(r=t[n])||(r=t[n]=[]),r.push(i),s=>{r.length>1?r.forEach(o=>o(s)):r[0](s)}};Zc=e("__VUE_INSTANCE_SETTERS__",n=>Rn=n),ih=e("__VUE_SSR_SETTERS__",n=>ol=n)}const yl=t=>{const e=Rn;return Zc(t),t.scope.on(),()=>{t.scope.off(),Zc(e)}},tg=()=>{Rn&&Rn.scope.off(),Zc(null)};function Wx(t){return t.vnode.shapeFlag&4}let ol=!1;function dM(t,e=!1,n=!1){e&&ih(e);const{props:i,children:r}=t.vnode,s=Wx(t);Yw(t,i,s,e),Qw(t,r,n||e);const o=s?fM(t,e):void 0;return e&&ih(!1),o}function fM(t,e){const n=t.type;t.accessCache=Object.create(null),t.proxy=new Proxy(t.ctx,Nw);const{setup:i}=n;if(i){Ur();const r=t.setupContext=i.length>1?pM(t):null,s=yl(t),o=xl(i,t,0,[t.props,r]),a=R_(o);if(kr(),s(),(a||t.sp)&&!qo(t)&&bx(t),a){if(o.then(tg,tg),e)return o.then(l=>{ng(t,l)}).catch(l=>{Pu(l,t,0)});t.asyncDep=o}else ng(t,o)}else qx(t)}function ng(t,e,n){ot(e)?t.type.__ssrInlineRender?t.ssrRender=e:t.render=e:Et(e)&&(t.setupState=rx(e)),qx(t)}function qx(t,e,n){const i=t.type;t.render||(t.render=i.render||Qi);{const r=yl(t);Ur();try{Ow(t)}finally{kr(),r()}}}const hM={get(t,e){return Pn(t,"get",""),t[e]}};function pM(t){const e=n=>{t.exposed=n||{}};return{attrs:new Proxy(t.attrs,hM),slots:t.slots,emit:t.emit,expose:e}}function Ou(t){return t.exposed?t.exposeProxy||(t.exposeProxy=new Proxy(rx(nx(t.exposed)),{get(e,n){if(n in e)return e[n];if(n in Ya)return Ya[n](t)},has(e,n){return n in e||n in Ya}})):t.proxy}function mM(t,e=!0){return ot(t)?t.displayName||t.name:t.name||e&&t.__name}function gM(t){return ot(t)&&"__vccOpts"in t}const we=(t,e)=>ow(t,e,ol);function er(t,e,n){try{Kc(-1);const i=arguments.length;return i===2?Et(e)&&!Qe(e)?sl(e)?ie(t,null,[e]):ie(t,e):ie(t,null,e):(i>3?n=Array.prototype.slice.call(arguments,2):i===3&&sl(n)&&(n=[n]),ie(t,e,n))}finally{Kc(1)}}const vM="3.5.28";let rh;const ig=typeof window<"u"&&window.trustedTypes;if(ig)try{rh=ig.createPolicy("vue",{createHTML:t=>t})}catch{}const Xx=rh?t=>rh.createHTML(t):t=>t,_M="http://www.w3.org/2000/svg",xM="http://www.w3.org/1998/Math/MathML",Sr=typeof document<"u"?document:null,rg=Sr&&Sr.createElement("template"),yM={insert:(t,e,n)=>{e.insertBefore(t,n||null)},remove:t=>{const e=t.parentNode;e&&e.removeChild(t)},createElement:(t,e,n,i)=>{const r=e==="svg"?Sr.createElementNS(_M,t):e==="mathml"?Sr.createElementNS(xM,t):n?Sr.createElement(t,{is:n}):Sr.createElement(t);return t==="select"&&i&&i.multiple!=null&&r.setAttribute("multiple",i.multiple),r},createText:t=>Sr.createTextNode(t),createComment:t=>Sr.createComment(t),setText:(t,e)=>{t.nodeValue=e},setElementText:(t,e)=>{t.textContent=e},parentNode:t=>t.parentNode,nextSibling:t=>t.nextSibling,querySelector:t=>Sr.querySelector(t),setScopeId(t,e){t.setAttribute(e,"")},insertStaticContent(t,e,n,i,r,s){const o=n?n.previousSibling:e.lastChild;if(r&&(r===s||r.nextSibling))for(;e.insertBefore(r.cloneNode(!0),n),!(r===s||!(r=r.nextSibling)););else{rg.innerHTML=Xx(i==="svg"?`${t}`:i==="mathml"?`${t}`:t);const a=rg.content;if(i==="svg"||i==="mathml"){const l=a.firstChild;for(;l.firstChild;)a.appendChild(l.firstChild);a.removeChild(l)}e.insertBefore(a,n)}return[o?o.nextSibling:e.firstChild,n?n.previousSibling:e.lastChild]}},Qr="transition",ba="animation",al=Symbol("_vtc"),$x={name:String,type:String,css:{type:Boolean,default:!0},duration:[String,Number,Object],enterFromClass:String,enterActiveClass:String,enterToClass:String,appearFromClass:String,appearActiveClass:String,appearToClass:String,leaveFromClass:String,leaveActiveClass:String,leaveToClass:String},bM=dn({},gx,$x),SM=t=>(t.displayName="Transition",t.props=bM,t),wM=SM((t,{slots:e})=>er(xw,MM(t),e)),Rs=(t,e=[])=>{Qe(t)?t.forEach(n=>n(...e)):t&&t(...e)},sg=t=>t?Qe(t)?t.some(e=>e.length>1):t.length>1:!1;function MM(t){const e={};for(const L in t)L in $x||(e[L]=t[L]);if(t.css===!1)return e;const{name:n="v",type:i,duration:r,enterFromClass:s=`${n}-enter-from`,enterActiveClass:o=`${n}-enter-active`,enterToClass:a=`${n}-enter-to`,appearFromClass:l=s,appearActiveClass:c=o,appearToClass:u=a,leaveFromClass:d=`${n}-leave-from`,leaveActiveClass:f=`${n}-leave-active`,leaveToClass:h=`${n}-leave-to`}=t,g=EM(r),v=g&&g[0],m=g&&g[1],{onBeforeEnter:p,onEnter:_,onEnterCancelled:y,onLeave:x,onLeaveCancelled:M,onBeforeAppear:A=p,onAppear:P=_,onAppearCancelled:D=y}=e,b=(L,V,$,X)=>{L._enterCancelled=X,Ds(L,V?u:a),Ds(L,V?c:o),$&&$()},w=(L,V)=>{L._isLeaving=!1,Ds(L,d),Ds(L,h),Ds(L,f),V&&V()},I=L=>(V,$)=>{const X=L?P:_,W=()=>b(V,L,$);Rs(X,[V,W]),og(()=>{Ds(V,L?l:s),pr(V,L?u:a),sg(X)||ag(V,i,v,W)})};return dn(e,{onBeforeEnter(L){Rs(p,[L]),pr(L,s),pr(L,o)},onBeforeAppear(L){Rs(A,[L]),pr(L,l),pr(L,c)},onEnter:I(!1),onAppear:I(!0),onLeave(L,V){L._isLeaving=!0;const $=()=>w(L,V);pr(L,d),L._enterCancelled?(pr(L,f),ug(L)):(ug(L),pr(L,f)),og(()=>{L._isLeaving&&(Ds(L,d),pr(L,h),sg(x)||ag(L,i,m,$))}),Rs(x,[L,$])},onEnterCancelled(L){b(L,!1,void 0,!0),Rs(y,[L])},onAppearCancelled(L){b(L,!0,void 0,!0),Rs(D,[L])},onLeaveCancelled(L){w(L),Rs(M,[L])}})}function EM(t){if(t==null)return null;if(Et(t))return[Fd(t.enter),Fd(t.leave)];{const e=Fd(t);return[e,e]}}function Fd(t){return SS(t)}function pr(t,e){e.split(/\s+/).forEach(n=>n&&t.classList.add(n)),(t[al]||(t[al]=new Set)).add(e)}function Ds(t,e){e.split(/\s+/).forEach(i=>i&&t.classList.remove(i));const n=t[al];n&&(n.delete(e),n.size||(t[al]=void 0))}function og(t){requestAnimationFrame(()=>{requestAnimationFrame(t)})}let TM=0;function ag(t,e,n,i){const r=t._endId=++TM,s=()=>{r===t._endId&&i()};if(n!=null)return setTimeout(s,n);const{type:o,timeout:a,propCount:l}=AM(t,e);if(!o)return i();const c=o+"end";let u=0;const d=()=>{t.removeEventListener(c,f),s()},f=h=>{h.target===t&&++u>=l&&d()};setTimeout(()=>{u(n[g]||"").split(", "),r=i(`${Qr}Delay`),s=i(`${Qr}Duration`),o=lg(r,s),a=i(`${ba}Delay`),l=i(`${ba}Duration`),c=lg(a,l);let u=null,d=0,f=0;e===Qr?o>0&&(u=Qr,d=o,f=s.length):e===ba?c>0&&(u=ba,d=c,f=l.length):(d=Math.max(o,c),u=d>0?o>c?Qr:ba:null,f=u?u===Qr?s.length:l.length:0);const h=u===Qr&&/\b(?:transform|all)(?:,|$)/.test(i(`${Qr}Property`).toString());return{type:u,timeout:d,propCount:f,hasTransform:h}}function lg(t,e){for(;t.lengthcg(n)+cg(t[i])))}function cg(t){return t==="auto"?0:Number(t.slice(0,-1).replace(",","."))*1e3}function ug(t){return(t?t.ownerDocument:document).body.offsetHeight}function CM(t,e,n){const i=t[al];i&&(e=(e?[e,...i]:[...i]).join(" ")),e==null?t.removeAttribute("class"):n?t.setAttribute("class",e):t.className=e}const dg=Symbol("_vod"),PM=Symbol("_vsh"),RM=Symbol(""),DM=/(?:^|;)\s*display\s*:/;function IM(t,e,n){const i=t.style,r=Xt(n);let s=!1;if(n&&!r){if(e)if(Xt(e))for(const o of e.split(";")){const a=o.slice(0,o.indexOf(":")).trim();n[a]==null&&Dc(i,a,"")}else for(const o in e)n[o]==null&&Dc(i,o,"");for(const o in n)o==="display"&&(s=!0),Dc(i,o,n[o])}else if(r){if(e!==n){const o=i[RM];o&&(n+=";"+o),i.cssText=n,s=DM.test(n)}}else e&&t.removeAttribute("style");dg in t&&(t[dg]=s?i.display:"",t[PM]&&(i.display="none"))}const fg=/\s*!important$/;function Dc(t,e,n){if(Qe(n))n.forEach(i=>Dc(t,e,i));else if(n==null&&(n=""),e.startsWith("--"))t.setProperty(e,n);else{const i=NM(t,e);fg.test(n)?t.setProperty(bs(i),n.replace(fg,""),"important"):t[i]=n}}const hg=["Webkit","Moz","ms"],Ud={};function NM(t,e){const n=Ud[e];if(n)return n;let i=ei(e);if(i!=="filter"&&i in t)return Ud[e]=i;i=yu(i);for(let r=0;rkd||(UM.then(()=>kd=0),kd=Date.now());function BM(t,e){const n=i=>{if(!i._vts)i._vts=Date.now();else if(i._vts<=n.attached)return;Ii(zM(i,n.value),e,5,[i])};return n.value=t,n.attached=kM(),n}function zM(t,e){if(Qe(e)){const n=t.stopImmediatePropagation;return t.stopImmediatePropagation=()=>{n.call(t),t._stopped=!0},e.map(i=>r=>!r._stopped&&i&&i(r))}else return e}const xg=t=>t.charCodeAt(0)===111&&t.charCodeAt(1)===110&&t.charCodeAt(2)>96&&t.charCodeAt(2)<123,VM=(t,e,n,i,r,s)=>{const o=r==="svg";e==="class"?CM(t,i,o):e==="style"?IM(t,n,i):gu(e)?vp(e)||OM(t,e,n,i,s):(e[0]==="."?(e=e.slice(1),!0):e[0]==="^"?(e=e.slice(1),!1):HM(t,e,i,o))?(gg(t,e,i),!t.tagName.includes("-")&&(e==="value"||e==="checked"||e==="selected")&&mg(t,e,i,o,s,e!=="value")):t._isVueCE&&(/[A-Z]/.test(e)||!Xt(i))?gg(t,ei(e),i,s,e):(e==="true-value"?t._trueValue=i:e==="false-value"&&(t._falseValue=i),mg(t,e,i,o))};function HM(t,e,n,i){if(i)return!!(e==="innerHTML"||e==="textContent"||e in t&&xg(e)&&ot(n));if(e==="spellcheck"||e==="draggable"||e==="translate"||e==="autocorrect"||e==="sandbox"&&t.tagName==="IFRAME"||e==="form"||e==="list"&&t.tagName==="INPUT"||e==="type"&&t.tagName==="TEXTAREA")return!1;if(e==="width"||e==="height"){const r=t.tagName;if(r==="IMG"||r==="VIDEO"||r==="CANVAS"||r==="SOURCE")return!1}return xg(e)&&Xt(n)?!1:e in t}const Qc=t=>{const e=t.props["onUpdate:modelValue"]||!1;return Qe(e)?n=>Ac(e,n):e};function GM(t){t.target.composing=!0}function yg(t){const e=t.target;e.composing&&(e.composing=!1,e.dispatchEvent(new Event("input")))}const $o=Symbol("_assign");function bg(t,e,n){return e&&(t=t.trim()),n&&(t=bu(t)),t}const Sg={created(t,{modifiers:{lazy:e,trim:n,number:i}},r){t[$o]=Qc(r);const s=i||r.props&&r.props.type==="number";Xs(t,e?"change":"input",o=>{o.target.composing||t[$o](bg(t.value,n,s))}),(n||s)&&Xs(t,"change",()=>{t.value=bg(t.value,n,s)}),e||(Xs(t,"compositionstart",GM),Xs(t,"compositionend",yg),Xs(t,"change",yg))},mounted(t,{value:e}){t.value=e??""},beforeUpdate(t,{value:e,oldValue:n,modifiers:{lazy:i,trim:r,number:s}},o){if(t[$o]=Qc(o),t.composing)return;const a=(s||t.type==="number")&&!/^0\d/.test(t.value)?bu(t.value):t.value,l=e??"";a!==l&&(document.activeElement===t&&t.type!=="range"&&(i&&e===n||r&&t.value.trim()===l)||(t.value=l))}},jx={deep:!0,created(t,{value:e,modifiers:{number:n}},i){const r=vu(e);Xs(t,"change",()=>{const s=Array.prototype.filter.call(t.options,o=>o.selected).map(o=>n?bu(eu(o)):eu(o));t[$o](t.multiple?r?new Set(s):s:s[0]),t._assigning=!0,Vr(()=>{t._assigning=!1})}),t[$o]=Qc(i)},mounted(t,{value:e}){wg(t,e)},beforeUpdate(t,e,n){t[$o]=Qc(n)},updated(t,{value:e}){t._assigning||wg(t,e)}};function wg(t,e){const n=t.multiple,i=Qe(e);if(!(n&&!i&&!vu(e))){for(let r=0,s=t.options.length;rString(c)===String(a)):o.selected=RS(e,a)>-1}else o.selected=e.has(a);else if(_l(eu(o),e)){t.selectedIndex!==r&&(t.selectedIndex=r);return}}!n&&t.selectedIndex!==-1&&(t.selectedIndex=-1)}}function eu(t){return"_value"in t?t._value:t.value}const WM=["ctrl","shift","alt","meta"],qM={stop:t=>t.stopPropagation(),prevent:t=>t.preventDefault(),self:t=>t.target!==t.currentTarget,ctrl:t=>!t.ctrlKey,shift:t=>!t.shiftKey,alt:t=>!t.altKey,meta:t=>!t.metaKey,left:t=>"button"in t&&t.button!==0,middle:t=>"button"in t&&t.button!==1,right:t=>"button"in t&&t.button!==2,exact:(t,e)=>WM.some(n=>t[`${n}Key`]&&!e.includes(n))},_i=(t,e)=>{if(!t)return t;const n=t._withMods||(t._withMods={}),i=e.join(".");return n[i]||(n[i]=((r,...s)=>{for(let o=0;o{const n=t._withKeys||(t._withKeys={}),i=e.join(".");return n[i]||(n[i]=(r=>{if(!("key"in r))return;const s=bs(r.key);if(e.some(o=>o===s||XM[o]===s))return t(r)}))},$M=dn({patchProp:VM},yM);let Mg;function jM(){return Mg||(Mg=tM($M))}const YM=((...t)=>{const e=jM().createApp(...t),{mount:n}=e;return e.mount=i=>{const r=KM(i);if(!r)return;const s=e._component;!ot(s)&&!s.render&&!s.template&&(s.template=r.innerHTML),r.nodeType===1&&(r.textContent="");const o=n(r,!1,JM(r));return r instanceof Element&&(r.removeAttribute("v-cloak"),r.setAttribute("data-v-app","")),o},e});function JM(t){if(t instanceof SVGElement)return"svg";if(typeof MathMLElement=="function"&&t instanceof MathMLElement)return"mathml"}function KM(t){return Xt(t)?document.querySelector(t):t}const Ti=On({title:"Object Infos",isVisible:!1,data:null}),Rp=On([]),Ic=On({title:"Sidebar Infos",isVisible:!1,data:null}),yn=On({value:!0}),Nr=On({value:"translate"}),Fu=On({value:!1}),Yx=On({value:!1}),qn=On({value:"light"});function Jx(t){var e,n,i="";if(typeof t=="string"||typeof t=="number")i+=t;else if(typeof t=="object")if(Array.isArray(t)){var r=t.length;for(e=0;etypeof t=="boolean"?`${t}`:t===0?"0":t,Tg=Kx,ZM=(t,e)=>n=>{var i;if(e?.variants==null)return Tg(t,n?.class,n?.className);const{variants:r,defaultVariants:s}=e,o=Object.keys(r).map(c=>{const u=n?.[c],d=s?.[c];if(u===null)return null;const f=Eg(u)||Eg(d);return r[c][f]}),a=n&&Object.entries(n).reduce((c,u)=>{let[d,f]=u;return f===void 0||(c[d]=f),c},{}),l=e==null||(i=e.compoundVariants)===null||i===void 0?void 0:i.reduce((c,u)=>{let{class:d,className:f,...h}=u;return Object.entries(h).every(g=>{let[v,m]=g;return Array.isArray(m)?m.includes({...s,...a}[v]):{...s,...a}[v]===m})?[...c,d,f]:c},[]);return Tg(t,o,l,n?.class,n?.className)};function Dp(t,e=Number.NEGATIVE_INFINITY,n=Number.POSITIVE_INFINITY){return Math.min(n,Math.max(e,t))}function Ul(t,e){let n=t;const i=e.toString(),r=i.indexOf("."),s=r>=0?i.length-r:0;if(s>0){const o=10**s;n=Math.round(n*o)/o}return n}function QM(t,e,n,i){e=Number(e),n=Number(n);const r=(t-(Number.isNaN(e)?0:e))%i;let s=Ul(Math.abs(r)*2>=i?t+Math.sign(r)*(i-Math.abs(r)):t-r,i);return Number.isNaN(e)?!Number.isNaN(n)&&s>n&&(s=Math.floor(Ul(n/i,i))*i):sn&&(s=e+Math.floor(Ul((n-e)/i,i))*i),s=Ul(s,i),s}function Jr(t,e){const n=typeof t=="string"&&!e?`${t}Context`:e,i=Symbol(n);return[o=>{const a=Wo(i,o);if(a||a===null)return a;throw new Error(`Injection \`${i.toString()}\` not found. Component must be used within ${Array.isArray(t)?`one of the following components: ${t.join(", ")}`:`\`${t}\``}`)},o=>(Mp(i,o),o)]}function to(){let t=document.activeElement;if(t==null)return null;for(;t!=null&&t.shadowRoot!=null&&t.shadowRoot.activeElement!=null;)t=t.shadowRoot.activeElement;return t}function Zx(t,e,n){const i=n.originalEvent.target,r=new CustomEvent(t,{bubbles:!1,cancelable:!0,detail:n});e&&i.addEventListener(t,e,{once:!0}),i.dispatchEvent(r)}function Nc(t){return t==null}function e1(t,e){var n;const i=Cu();return Wn(()=>{i.value=t()},{...e,flush:(n=e?.flush)!==null&&n!==void 0?n:"sync"}),qc(i)}function bl(t,e){return xp()?(B_(t,e),!0):!1}function Qx(){const t=new Set,e=s=>{t.delete(s)};return{on:s=>{t.add(s);const o=()=>e(s);return bl(o),{off:o}},off:e,trigger:(...s)=>Promise.all(Array.from(t).map(o=>o(...s))),clear:()=>{t.clear()}}}function t1(t){let e=!1,n;const i=k_(!0);return((...r)=>(e||(n=i.run(()=>t(...r)),e=!0),n))}const Ui=typeof window<"u"&&typeof document<"u";typeof WorkerGlobalScope<"u"&&globalThis instanceof WorkerGlobalScope;const n1=t=>typeof t<"u",i1=Object.prototype.toString,r1=t=>i1.call(t)==="[object Object]",Ag=s1();function s1(){var t,e,n;return Ui&&!!(!((t=window)===null||t===void 0||(t=t.navigator)===null||t===void 0)&&t.userAgent)&&(/iP(?:ad|hone|od)/.test(window.navigator.userAgent)||((e=window)===null||e===void 0||(e=e.navigator)===null||e===void 0?void 0:e.maxTouchPoints)>2&&/iPad|Macintosh/.test((n=window)===null||n===void 0?void 0:n.navigator.userAgent))}function Bd(t){return Array.isArray(t)?t:[t]}function o1(t){return or()}function a1(t){if(!Ui)return t;let e=0,n,i;const r=()=>{e-=1,i&&e<=0&&(i.stop(),n=void 0,i=void 0)};return((...s)=>(e+=1,i||(i=k_(!0),n=i.run(()=>t(...s))),bl(r),n))}function l1(t){return On(en(t)?new Proxy({},{get(e,n,i){return E(Reflect.get(t.value,n,i))},set(e,n,i){return en(t.value[n])&&!en(i)?t.value[n].value=i:t.value[n]=i,!0},deleteProperty(e,n){return Reflect.deleteProperty(t.value,n)},has(e,n){return Reflect.has(t.value,n)},ownKeys(){return Object.keys(t.value)},getOwnPropertyDescriptor(){return{enumerable:!0,configurable:!0}}}):t)}function Ip(t){return l1(we(t))}function co(t,...e){const n=e.flat(),i=n[0];return Ip(()=>Object.fromEntries(typeof i=="function"?Object.entries(zr(t)).filter(([r,s])=>!i(Nn(s),r)):Object.entries(zr(t)).filter(r=>!n.includes(r[0]))))}function c1(t,e=1e4){return tw((n,i)=>{let r=Nn(t),s;const o=()=>setTimeout(()=>{r=Nn(t),i()},Nn(e));return bl(()=>{clearTimeout(s)}),{get(){return n(),r},set(a){r=a,i(),clearTimeout(s),s=o()}}})}function u1(t,e){o1()&&da(t,e)}function ey(t,e,n={}){const{immediate:i=!0,immediateCallback:r=!1}=n,s=Cu(!1);let o;function a(){o&&(clearTimeout(o),o=void 0)}function l(){s.value=!1,a()}function c(...u){r&&t(),a(),s.value=!0,o=setTimeout(()=>{s.value=!1,o=void 0,t(...u)},Nn(e))}return i&&(s.value=!0,Ui&&c()),bl(l),{isPending:Hs(s),start:c,stop:l}}function d1(t,e,n){return rn(t,e,{...n,immediate:!0})}const Np=Ui?window:void 0;function ws(t){var e;const n=Nn(t);return(e=n?.$el)!==null&&e!==void 0?e:n}function no(...t){const e=(i,r,s,o)=>(i.addEventListener(r,s,o),()=>i.removeEventListener(r,s,o)),n=we(()=>{const i=Bd(Nn(t[0])).filter(r=>r!=null);return i.every(r=>typeof r!="string")?i:void 0});return d1(()=>{var i,r;return[(i=(r=n.value)===null||r===void 0?void 0:r.map(s=>ws(s)))!==null&&i!==void 0?i:[Np].filter(s=>s!=null),Bd(Nn(n.value?t[1]:t[0])),Bd(E(n.value?t[2]:t[1])),Nn(n.value?t[3]:t[2])]},([i,r,s,o],a,l)=>{if(!i?.length||!r?.length||!s?.length)return;const c=r1(o)?{...o}:o,u=i.flatMap(d=>r.flatMap(f=>s.map(h=>e(d,f,h,c))));l(()=>{u.forEach(d=>d())})},{flush:"post"})}function ty(){const t=Cu(!1),e=or();return e&&ti(()=>{t.value=!0},e),t}function f1(t){return typeof t=="function"?t:typeof t=="string"?e=>e.key===t:Array.isArray(t)?e=>t.includes(e.key):()=>!0}function h1(...t){let e,n,i={};t.length===3?(e=t[0],n=t[1],i=t[2]):t.length===2?typeof t[1]=="object"?(e=!0,n=t[0],i=t[1]):(e=t[0],n=t[1]):(e=!0,n=t[0]);const{target:r=Np,eventName:s="keydown",passive:o=!1,dedupe:a=!1}=i,l=f1(e);return no(r,s,u=>{u.repeat&&Nn(a)||l(u)&&n(u)},o)}function p1(t){return JSON.parse(JSON.stringify(t))}function Uu(t,e,n,i={}){var r,s;const{clone:o=!1,passive:a=!1,eventName:l,deep:c=!1,defaultValue:u,shouldEmit:d}=i,f=or(),h=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;e||(e="modelValue"),g=g||`update:${e.toString()}`;const v=_=>o?typeof o=="function"?o(_):p1(_):_,m=()=>n1(t[e])?v(t[e]):u,p=_=>{d?d(_)&&h(g,_):h(g,_)};if(a){const _=ke(m());let y=!1;return rn(()=>t[e],x=>{y||(y=!0,_.value=v(x),Vr(()=>y=!1))}),rn(_,x=>{!y&&(x!==t[e]||c)&&p(x)},{deep:c}),_}else return we({get(){return m()},set(_){p(_)}})}function Lp(t){return t?t.flatMap(e=>e.type===Kt?Lp(e.children):[e]):[]}const[Op]=Jr("ConfigProvider");function zd(t){if(t===null||typeof t!="object")return!1;const e=Object.getPrototypeOf(t);return e!==null&&e!==Object.prototype&&Object.getPrototypeOf(e)!==null||Symbol.iterator in t?!1:Symbol.toStringTag in t?Object.prototype.toString.call(t)==="[object Module]":!0}function sh(t,e,n=".",i){if(!zd(e))return sh(t,{},n,i);const r={...e};for(const s of Object.keys(t)){if(s==="__proto__"||s==="constructor")continue;const o=t[s];o!=null&&(i&&i(r,s,o,n)||(Array.isArray(o)&&Array.isArray(r[s])?r[s]=[...o,...r[s]]:zd(o)&&zd(r[s])?r[s]=sh(o,r[s],(n?`${n}.`:"")+s.toString(),i):r[s]=o))}return r}function m1(t){return(...e)=>e.reduce((n,i)=>sh(n,i,"",t),{})}const ny=m1(),g1=a1(()=>{const t=ke(new Map),e=ke(),n=we(()=>{for(const o of t.value.values())if(o)return!0;return!1}),i=Op({scrollBody:ke(!0)});let r=null;const s=()=>{document.body.style.paddingRight="",document.body.style.marginRight="",document.body.style.pointerEvents="",document.documentElement.style.removeProperty("--scrollbar-width"),document.body.style.overflow=e.value??"",Ag&&r?.(),e.value=void 0};return rn(n,(o,a)=>{if(!Ui)return;if(!o){a&&s();return}e.value===void 0&&(e.value=document.body.style.overflow);const l=window.innerWidth-document.documentElement.clientWidth,c={padding:l,margin:0},u=i.scrollBody?.value?typeof i.scrollBody.value=="object"?ny({padding:i.scrollBody.value.padding===!0?l:i.scrollBody.value.padding,margin:i.scrollBody.value.margin===!0?l:i.scrollBody.value.margin},c):c:{padding:0,margin:0};l>0&&(document.body.style.paddingRight=typeof u.padding=="number"?`${u.padding}px`:String(u.padding),document.body.style.marginRight=typeof u.margin=="number"?`${u.margin}px`:String(u.margin),document.documentElement.style.setProperty("--scrollbar-width",`${l}px`),document.body.style.overflow="hidden"),Ag&&(r=no(document,"touchmove",d=>_1(d),{passive:!1})),Vr(()=>{n.value&&(document.body.style.pointerEvents="none",document.body.style.overflow="hidden")})},{immediate:!0,flush:"sync"}),t});function v1(t){const e=Math.random().toString(36).substring(2,7),n=g1();n.value.set(e,t);const i=we({get:()=>n.value.get(e)??!1,set:r=>n.value.set(e,r)});return u1(()=>{n.value.delete(e)}),i}function iy(t){const e=window.getComputedStyle(t);if(e.overflowX==="scroll"||e.overflowY==="scroll"||e.overflowX==="auto"&&t.clientWidth1?!0:(e.preventDefault&&e.cancelable&&e.preventDefault(),!1)}function x1(t){const e=Op({dir:ke("ltr")});return we(()=>t?.value||e.dir?.value||"ltr")}function y1(t){const e=or(),n=e?.type.emits,i={};return n?.length||console.warn(`No emitted event found. Please check component: ${e?.type.__name}`),n?.forEach(r=>{i[Wa(ei(r))]=(...s)=>t(r,...s)}),i}let Vd=0;function b1(){Wn(t=>{if(!Ui)return;const e=document.querySelectorAll("[data-reka-focus-guard]");document.body.insertAdjacentElement("afterbegin",e[0]??Cg()),document.body.insertAdjacentElement("beforeend",e[1]??Cg()),Vd++,t(()=>{Vd===1&&document.querySelectorAll("[data-reka-focus-guard]").forEach(n=>n.remove()),Vd--})})}function Cg(){const t=document.createElement("span");return t.setAttribute("data-reka-focus-guard",""),t.tabIndex=0,t.style.outline="none",t.style.opacity="0",t.style.position="fixed",t.style.pointerEvents="none",t}function ry(t){return we(()=>Nn(t)?!!ws(t)?.closest("form"):!0)}function sn(){const t=or(),e=ke(),n=we(()=>i());wx(()=>{n.value!==i()&&ZS(e)});function i(){return e.value&&"$el"in e.value&&["#text","#comment"].includes(e.value.$el.nodeName)?e.value.$el.nextElementSibling:ws(e)}const r=Object.assign({},t.exposed),s={};for(const a in t.props)Object.defineProperty(s,a,{enumerable:!0,configurable:!0,get:()=>t.props[a]});if(Object.keys(r).length>0)for(const a in r)Object.defineProperty(s,a,{enumerable:!0,configurable:!0,get:()=>r[a]});Object.defineProperty(s,"$el",{enumerable:!0,configurable:!0,get:()=>t.vnode.el}),t.exposed=s;function o(a){if(e.value=a,!!a&&(Object.defineProperty(s,"$el",{enumerable:!0,configurable:!0,get:()=>a instanceof Element?a:a.$el}),!(a instanceof Element)&&!Object.hasOwn(a,"$el"))){const l=a.$.exposed,c=Object.assign({},s);for(const u in l)Object.defineProperty(c,u,{enumerable:!0,configurable:!0,get:()=>l[u]});t.exposed=c}}return{forwardRef:o,currentRef:e,currentElement:n}}function Sl(t){const e=or(),n=Object.keys(e?.type.props??{}).reduce((r,s)=>{const o=(e?.type.props[s]).default;return o!==void 0&&(r[s]=o),r},{}),i=rw(t);return we(()=>{const r={},s=e?.vnode.props??{};return Object.keys(s).forEach(o=>{r[ei(o)]=s[o]}),Object.keys({...n,...r}).reduce((o,a)=>(i.value[a]!==void 0&&(o[a]=i.value[a]),o),{})})}function ar(t,e){const n=Sl(t),i=e?y1(e):{};return we(()=>({...n.value,...i}))}function S1(t,e){const n=c1(!1,300);bl(()=>{n.value=!1});const i=ke(null),r=Qx();function s(){i.value=null,n.value=!1}function o(a,l){if(!l)return;const c=a.currentTarget,u={x:a.clientX,y:a.clientY},d=w1(u,c.getBoundingClientRect()),f=M1(u,d,1),h=E1(l.getBoundingClientRect()),g=A1([...f,...h]);i.value=g,n.value=!0}return Wn(a=>{if(t.value&&e.value){const l=u=>o(u,e.value),c=u=>o(u,t.value);t.value.addEventListener("pointerleave",l),e.value.addEventListener("pointerleave",c),a(()=>{t.value?.removeEventListener("pointerleave",l),e.value?.removeEventListener("pointerleave",c)})}}),Wn(a=>{if(i.value){const l=c=>{if(!i.value||!(c.target instanceof Element))return;const u=c.target,d={x:c.clientX,y:c.clientY},f=t.value?.contains(u)||e.value?.contains(u),h=!T1(d,i.value),g=!!u.closest("[data-grace-area-trigger]");f?s():(h||g)&&(s(),r.trigger())};t.value?.ownerDocument.addEventListener("pointermove",l),a(()=>t.value?.ownerDocument.removeEventListener("pointermove",l))}}),{isPointerInTransit:n,onPointerExit:r.on}}function w1(t,e){const n=Math.abs(e.top-t.y),i=Math.abs(e.bottom-t.y),r=Math.abs(e.right-t.x),s=Math.abs(e.left-t.x);switch(Math.min(n,i,r,s)){case s:return"left";case r:return"right";case n:return"top";case i:return"bottom";default:throw new Error("unreachable")}}function M1(t,e,n=5){const i=[];switch(e){case"top":i.push({x:t.x-n,y:t.y+n},{x:t.x+n,y:t.y+n});break;case"bottom":i.push({x:t.x-n,y:t.y-n},{x:t.x+n,y:t.y-n});break;case"left":i.push({x:t.x+n,y:t.y-n},{x:t.x+n,y:t.y+n});break;case"right":i.push({x:t.x-n,y:t.y-n},{x:t.x-n,y:t.y+n});break}return i}function E1(t){const{top:e,right:n,bottom:i,left:r}=t;return[{x:r,y:e},{x:n,y:e},{x:n,y:i},{x:r,y:i}]}function T1(t,e){const{x:n,y:i}=t;let r=!1;for(let s=0,o=e.length-1;si!=u>i&&n<(c-a)*(i-l)/(u-l)+a&&(r=!r)}return r}function A1(t){const e=t.slice();return e.sort((n,i)=>n.xi.x?1:n.yi.y?1:0),C1(e)}function C1(t){if(t.length<=1)return t.slice();const e=[];for(let i=0;i=2;){const s=e.at(-1),o=e[e.length-2];if((s.x-o.x)*(r.y-o.y)>=(s.y-o.y)*(r.x-o.x))e.pop();else break}e.push(r)}e.pop();const n=[];for(let i=t.length-1;i>=0;i--){const r=t[i];for(;n.length>=2;){const s=n.at(-1),o=n[n.length-2];if((s.x-o.x)*(r.y-o.y)>=(s.y-o.y)*(r.x-o.x))n.pop();else break}n.push(r)}return n.pop(),e.length===1&&n.length===1&&e[0].x===n[0].x&&e[0].y===n[0].y?e:e.concat(n)}var P1=function(t){if(typeof document>"u")return null;var e=Array.isArray(t)?t[0]:t;return e.ownerDocument.body},_o=new WeakMap,kl=new WeakMap,Bl={},Hd=0,sy=function(t){return t&&(t.host||sy(t.parentNode))},R1=function(t,e){return e.map(function(n){if(t.contains(n))return n;var i=sy(n);return i&&t.contains(i)?i:(console.error("aria-hidden",n,"in not contained inside",t,". Doing nothing"),null)}).filter(function(n){return!!n})},D1=function(t,e,n,i){var r=R1(e,Array.isArray(t)?t:[t]);Bl[n]||(Bl[n]=new WeakMap);var s=Bl[n],o=[],a=new Set,l=new Set(r),c=function(d){!d||a.has(d)||(a.add(d),c(d.parentNode))};r.forEach(c);var u=function(d){!d||l.has(d)||Array.prototype.forEach.call(d.children,function(f){if(a.has(f))u(f);else try{var h=f.getAttribute(i),g=h!==null&&h!=="false",v=(_o.get(f)||0)+1,m=(s.get(f)||0)+1;_o.set(f,v),s.set(f,m),o.push(f),v===1&&g&&kl.set(f,!0),m===1&&f.setAttribute(n,"true"),g||f.setAttribute(i,"true")}catch(p){console.error("aria-hidden: cannot operate on ",f,p)}})};return u(e),a.clear(),Hd++,function(){o.forEach(function(d){var f=_o.get(d)-1,h=s.get(d)-1;_o.set(d,f),s.set(d,h),f||(kl.has(d)||d.removeAttribute(i),kl.delete(d)),h||d.removeAttribute(n)}),Hd--,Hd||(_o=new WeakMap,_o=new WeakMap,kl=new WeakMap,Bl={})}},I1=function(t,e,n){n===void 0&&(n="data-aria-hidden");var i=Array.from(Array.isArray(t)?t:[t]),r=P1(t);return r?(i.push.apply(i,Array.from(r.querySelectorAll("[aria-live], script"))),D1(i,r,n,"aria-hidden")):function(){return null}};function N1(t){let e;rn(()=>ws(t),n=>{let i=!1;try{i=!!n?.closest("[popover]:not(:popover-open)")}catch{}n&&!i?e=I1(n):e&&e()}),fa(()=>{e&&e()})}function Fp(t,e="reka"){let n;return n=yw?.(),e?`${e}-${n}`:n}function L1(t){const e=Op({locale:ke("en")});return we(()=>t?.value||e.locale?.value||"en")}function oy(t){const e=ke(),n=we(()=>e.value?.width??0),i=we(()=>e.value?.height??0);return ti(()=>{const r=ws(t);if(r){e.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,d=Array.isArray(u)?u[0]:u;l=d.inlineSize,c=d.blockSize}else l=r.offsetWidth,c=r.offsetHeight;e.value={width:l,height:c}});return s.observe(r,{box:"border-box"}),()=>s.unobserve(r)}else e.value=void 0}),{width:n,height:i}}function O1(t,e){const n=ke(t);function i(s){return e[n.value][s]??n.value}return{state:n,dispatch:s=>{n.value=i(s)}}}function F1(t,e){const n=ke({}),i=ke("none"),r=ke(t),s=t.value?"mounted":"unmounted";let o;const a=e.value?.ownerDocument.defaultView??Np,{state:l,dispatch:c}=O1(s,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}}),u=m=>{if(Ui){const p=new CustomEvent(m,{bubbles:!1,cancelable:!1});e.value?.dispatchEvent(p)}};rn(t,async(m,p)=>{const _=p!==m;if(await Vr(),_){const y=i.value,x=zl(e.value);m?(c("MOUNT"),u("enter"),x==="none"&&u("after-enter")):x==="none"||x==="undefined"||n.value?.display==="none"?(c("UNMOUNT"),u("leave"),u("after-leave")):p&&y!==x?(c("ANIMATION_OUT"),u("leave")):(c("UNMOUNT"),u("after-leave"))}},{immediate:!0});const d=m=>{const p=zl(e.value),_=p.includes(CSS.escape(m.animationName)),y=l.value==="mounted"?"enter":"leave";if(m.target===e.value&&_&&(u(`after-${y}`),c("ANIMATION_END"),!r.value)){const x=e.value.style.animationFillMode;e.value.style.animationFillMode="forwards",o=a?.setTimeout(()=>{e.value?.style.animationFillMode==="forwards"&&(e.value.style.animationFillMode=x)})}m.target===e.value&&p==="none"&&c("ANIMATION_END")},f=m=>{m.target===e.value&&(i.value=zl(e.value))},h=rn(e,(m,p)=>{m?(n.value=getComputedStyle(m),m.addEventListener("animationstart",f),m.addEventListener("animationcancel",d),m.addEventListener("animationend",d)):(c("ANIMATION_END"),o!==void 0&&a?.clearTimeout(o),p?.removeEventListener("animationstart",f),p?.removeEventListener("animationcancel",d),p?.removeEventListener("animationend",d))},{immediate:!0}),g=rn(l,()=>{const m=zl(e.value);i.value=l.value==="mounted"?m:"none"});return fa(()=>{h(),g()}),{isPresent:we(()=>["mounted","unmountSuspended"].includes(l.value))}}function zl(t){return t&&getComputedStyle(t).animationName||"none"}var ay=Ne({name:"Presence",props:{present:{type:Boolean,required:!0},forceMount:{type:Boolean}},slots:{},setup(t,{slots:e,expose:n}){const{present:i,forceMount:r}=zr(t),s=ke(),{isPresent:o}=F1(i,s);n({present:o});let a=e.default({present:o.value});a=Lp(a||[]);const l=or();if(a&&a?.length>1){const c=l?.parent?.type.name?`<${l.parent.type.name} />`:"component";throw new Error([`Detected an invalid children for \`${c}\` for \`Presence\` component.`,"","Note: Presence works similarly to `v-if` directly, but it waits for animation/transition to finished before unmounting. So it expect only one direct child of valid VNode type.","You can apply a few solutions:",["Provide a single child element so that `presence` directive attach correctly.","Ensure the first child is an actual element instead of a raw text node or comment node."].map(u=>` - ${u}`).join(` +(function(){const e=document.createElement("link").relList;if(e&&e.supports&&e.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 gp(t){const e=Object.create(null);for(const n of t.split(","))e[n]=1;return n=>n in e}const Bt={},Vo=[],Qi=()=>{},P_=()=>!1,gu=t=>t.charCodeAt(0)===111&&t.charCodeAt(1)===110&&(t.charCodeAt(2)>122||t.charCodeAt(2)<97),vp=t=>t.startsWith("onUpdate:"),dn=Object.assign,_p=(t,e)=>{const n=t.indexOf(e);n>-1&&t.splice(n,1)},_S=Object.prototype.hasOwnProperty,Tt=(t,e)=>_S.call(t,e),Qe=Array.isArray,Ho=t=>vl(t)==="[object Map]",vu=t=>vl(t)==="[object Set]",Fm=t=>vl(t)==="[object Date]",ot=t=>typeof t=="function",Xt=t=>typeof t=="string",Ri=t=>typeof t=="symbol",Et=t=>t!==null&&typeof t=="object",R_=t=>(Et(t)||ot(t))&&ot(t.then)&&ot(t.catch),D_=Object.prototype.toString,vl=t=>D_.call(t),xS=t=>vl(t).slice(8,-1),I_=t=>vl(t)==="[object Object]",_u=t=>Xt(t)&&t!=="NaN"&&t[0]!=="-"&&""+parseInt(t,10)===t,Ga=gp(",key,ref,ref_for,ref_key,onVnodeBeforeMount,onVnodeMounted,onVnodeBeforeUpdate,onVnodeUpdated,onVnodeBeforeUnmount,onVnodeUnmounted"),xu=t=>{const e=Object.create(null);return(n=>e[n]||(e[n]=t(n)))},yS=/-\w/g,ei=xu(t=>t.replace(yS,e=>e.slice(1).toUpperCase())),bS=/\B([A-Z])/g,bs=xu(t=>t.replace(bS,"-$1").toLowerCase()),yu=xu(t=>t.charAt(0).toUpperCase()+t.slice(1)),Wa=xu(t=>t?`on${yu(t)}`:""),gs=(t,e)=>!Object.is(t,e),Ac=(t,...e)=>{for(let n=0;n{Object.defineProperty(t,e,{configurable:!0,enumerable:!1,writable:i,value:n})},bu=t=>{const e=parseFloat(t);return isNaN(e)?t:e},SS=t=>{const e=Xt(t)?Number(t):NaN;return isNaN(e)?t:e};let Um;const Su=()=>Um||(Um=typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:typeof global<"u"?global:{});function $r(t){if(Qe(t)){const e={};for(let n=0;n{if(n){const i=n.split(MS);i.length>1&&(e[i[0].trim()]=i[1].trim())}}),e}function Qt(t){let e="";if(Xt(t))e=t;else if(Qe(t))for(let n=0;n_l(n,e))}const O_=t=>!!(t&&t.__v_isRef===!0),Ci=t=>Xt(t)?t:t==null?"":Qe(t)||Et(t)&&(t.toString===D_||!ot(t.toString))?O_(t)?Ci(t.value):JSON.stringify(t,F_,2):String(t),F_=(t,e)=>O_(e)?F_(t,e.value):Ho(e)?{[`Map(${e.size})`]:[...e.entries()].reduce((n,[i,r],s)=>(n[Cd(i,s)+" =>"]=r,n),{})}:vu(e)?{[`Set(${e.size})`]:[...e.values()].map(n=>Cd(n))}:Ri(e)?Cd(e):Et(e)&&!Qe(e)&&!I_(e)?String(e):e,Cd=(t,e="")=>{var n;return Ri(t)?`Symbol(${(n=t.description)!=null?n:e})`:t};let Cn;class U_{constructor(e=!1){this.detached=e,this._active=!0,this._on=0,this.effects=[],this.cleanups=[],this._isPaused=!1,this.__v_skip=!0,this.parent=Cn,!e&&Cn&&(this.index=(Cn.scopes||(Cn.scopes=[])).push(this)-1)}get active(){return this._active}pause(){if(this._active){this._isPaused=!0;let e,n;if(this.scopes)for(e=0,n=this.scopes.length;e0&&--this._on===0&&(Cn=this.prevScope,this.prevScope=void 0)}stop(e){if(this._active){this._active=!1;let n,i;for(n=0,i=this.effects.length;n0)return;if(Xa){let e=Xa;for(Xa=void 0;e;){const n=e.next;e.next=void 0,e.flags&=-9,e=n}}let t;for(;qa;){let e=qa;for(qa=void 0;e;){const n=e.next;if(e.next=void 0,e.flags&=-9,e.flags&1)try{e.trigger()}catch(i){t||(t=i)}e=n}}if(t)throw t}function G_(t){for(let e=t.deps;e;e=e.nextDep)e.version=-1,e.prevActiveLink=e.dep.activeLink,e.dep.activeLink=e}function W_(t){let e,n=t.depsTail,i=n;for(;i;){const r=i.prevDep;i.version===-1?(i===n&&(n=r),Sp(i),DS(i)):e=i,i.dep.activeLink=i.prevActiveLink,i.prevActiveLink=void 0,i=r}t.deps=e,t.depsTail=n}function Xf(t){for(let e=t.deps;e;e=e.nextDep)if(e.dep.version!==e.version||e.dep.computed&&(q_(e.dep.computed)||e.dep.version!==e.version))return!0;return!!t._dirty}function q_(t){if(t.flags&4&&!(t.flags&16)||(t.flags&=-17,t.globalVersion===el)||(t.globalVersion=el,!t.isSSR&&t.flags&128&&(!t.deps&&!t._dirty||!Xf(t))))return;t.flags|=2;const e=t.dep,n=Gt,i=Pi;Gt=t,Pi=!0;try{G_(t);const r=t.fn(t._value);(e.version===0||gs(r,t._value))&&(t.flags|=128,t._value=r,e.version++)}catch(r){throw e.version++,r}finally{Gt=n,Pi=i,W_(t),t.flags&=-3}}function Sp(t,e=!1){const{dep:n,prevSub:i,nextSub:r}=t;if(i&&(i.nextSub=r,t.prevSub=void 0),r&&(r.prevSub=i,t.nextSub=void 0),n.subs===t&&(n.subs=i,!i&&n.computed)){n.computed.flags&=-5;for(let s=n.computed.deps;s;s=s.nextDep)Sp(s,!0)}!e&&!--n.sc&&n.map&&n.map.delete(n.key)}function DS(t){const{prevDep:e,nextDep:n}=t;e&&(e.nextDep=n,t.prevDep=void 0),n&&(n.prevDep=e,t.nextDep=void 0)}let Pi=!0;const X_=[];function Ur(){X_.push(Pi),Pi=!1}function kr(){const t=X_.pop();Pi=t===void 0?!0:t}function km(t){const{cleanup:e}=t;if(t.cleanup=void 0,e){const n=Gt;Gt=void 0;try{e()}finally{Gt=n}}}let el=0;class IS{constructor(e,n){this.sub=e,this.dep=n,this.version=n.version,this.nextDep=this.prevDep=this.nextSub=this.prevSub=this.prevActiveLink=void 0}}class wu{constructor(e){this.computed=e,this.version=0,this.activeLink=void 0,this.subs=void 0,this.map=void 0,this.key=void 0,this.sc=0,this.__v_skip=!0}track(e){if(!Gt||!Pi||Gt===this.computed)return;let n=this.activeLink;if(n===void 0||n.sub!==Gt)n=this.activeLink=new IS(Gt,this),Gt.deps?(n.prevDep=Gt.depsTail,Gt.depsTail.nextDep=n,Gt.depsTail=n):Gt.deps=Gt.depsTail=n,$_(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=Gt.depsTail,n.nextDep=void 0,Gt.depsTail.nextDep=n,Gt.depsTail=n,Gt.deps===n&&(Gt.deps=i)}return n}trigger(e){this.version++,el++,this.notify(e)}notify(e){yp();try{for(let n=this.subs;n;n=n.prevSub)n.sub.notify()&&n.sub.dep.notify()}finally{bp()}}}function $_(t){if(t.dep.sc++,t.sub.flags&4){const e=t.dep.computed;if(e&&!t.dep.subs){e.flags|=20;for(let i=e.deps;i;i=i.nextDep)$_(i)}const n=t.dep.subs;n!==t&&(t.prevSub=n,n&&(n.nextSub=t)),t.dep.subs=t}}const Wc=new WeakMap,Qs=Symbol(""),$f=Symbol(""),tl=Symbol("");function Pn(t,e,n){if(Pi&&Gt){let i=Wc.get(t);i||Wc.set(t,i=new Map);let r=i.get(n);r||(i.set(n,r=new wu),r.map=i,r.key=n),r.track()}}function Tr(t,e,n,i,r,s){const o=Wc.get(t);if(!o){el++;return}const a=l=>{l&&l.trigger()};if(yp(),e==="clear")o.forEach(a);else{const l=Qe(t),c=l&&_u(n);if(l&&n==="length"){const u=Number(i);o.forEach((d,f)=>{(f==="length"||f===tl||!Ri(f)&&f>=u)&&a(d)})}else switch((n!==void 0||o.has(void 0))&&a(o.get(n)),c&&a(o.get(tl)),e){case"add":l?c&&a(o.get("length")):(a(o.get(Qs)),Ho(t)&&a(o.get($f)));break;case"delete":l||(a(o.get(Qs)),Ho(t)&&a(o.get($f)));break;case"set":Ho(t)&&a(o.get(Qs));break}}bp()}function NS(t,e){const n=Wc.get(t);return n&&n.get(e)}function vo(t){const e=St(t);return e===t?e:(Pn(e,"iterate",tl),di(t)?e:e.map(Di))}function Mu(t){return Pn(t=St(t),"iterate",tl),t}function cs(t,e){return Br(t)?ea(eo(t)?Di(e):e):Di(e)}const LS={__proto__:null,[Symbol.iterator](){return Rd(this,Symbol.iterator,t=>cs(this,t))},concat(...t){return vo(this).concat(...t.map(e=>Qe(e)?vo(e):e))},entries(){return Rd(this,"entries",t=>(t[1]=cs(this,t[1]),t))},every(t,e){return hr(this,"every",t,e,void 0,arguments)},filter(t,e){return hr(this,"filter",t,e,n=>n.map(i=>cs(this,i)),arguments)},find(t,e){return hr(this,"find",t,e,n=>cs(this,n),arguments)},findIndex(t,e){return hr(this,"findIndex",t,e,void 0,arguments)},findLast(t,e){return hr(this,"findLast",t,e,n=>cs(this,n),arguments)},findLastIndex(t,e){return hr(this,"findLastIndex",t,e,void 0,arguments)},forEach(t,e){return hr(this,"forEach",t,e,void 0,arguments)},includes(...t){return Dd(this,"includes",t)},indexOf(...t){return Dd(this,"indexOf",t)},join(t){return vo(this).join(t)},lastIndexOf(...t){return Dd(this,"lastIndexOf",t)},map(t,e){return hr(this,"map",t,e,void 0,arguments)},pop(){return xa(this,"pop")},push(...t){return xa(this,"push",t)},reduce(t,...e){return Bm(this,"reduce",t,e)},reduceRight(t,...e){return Bm(this,"reduceRight",t,e)},shift(){return xa(this,"shift")},some(t,e){return hr(this,"some",t,e,void 0,arguments)},splice(...t){return xa(this,"splice",t)},toReversed(){return vo(this).toReversed()},toSorted(t){return vo(this).toSorted(t)},toSpliced(...t){return vo(this).toSpliced(...t)},unshift(...t){return xa(this,"unshift",t)},values(){return Rd(this,"values",t=>cs(this,t))}};function Rd(t,e,n){const i=Mu(t),r=i[e]();return i!==t&&!di(t)&&(r._next=r.next,r.next=()=>{const s=r._next();return s.done||(s.value=n(s.value)),s}),r}const OS=Array.prototype;function hr(t,e,n,i,r,s){const o=Mu(t),a=o!==t&&!di(t),l=o[e];if(l!==OS[e]){const d=l.apply(t,s);return a?Di(d):d}let c=n;o!==t&&(a?c=function(d,f){return n.call(this,cs(t,d),f,t)}:n.length>2&&(c=function(d,f){return n.call(this,d,f,t)}));const u=l.call(o,c,i);return a&&r?r(u):u}function Bm(t,e,n,i){const r=Mu(t);let s=n;return r!==t&&(di(t)?n.length>3&&(s=function(o,a,l){return n.call(this,o,a,l,t)}):s=function(o,a,l){return n.call(this,o,cs(t,a),l,t)}),r[e](s,...i)}function Dd(t,e,n){const i=St(t);Pn(i,"iterate",tl);const r=i[e](...n);return(r===-1||r===!1)&&Au(n[0])?(n[0]=St(n[0]),i[e](...n)):r}function xa(t,e,n=[]){Ur(),yp();const i=St(t)[e].apply(t,n);return bp(),kr(),i}const FS=gp("__proto__,__v_isRef,__isVue"),j_=new Set(Object.getOwnPropertyNames(Symbol).filter(t=>t!=="arguments"&&t!=="caller").map(t=>Symbol[t]).filter(Ri));function US(t){Ri(t)||(t=String(t));const e=St(this);return Pn(e,"has",t),e.hasOwnProperty(t)}class Y_{constructor(e=!1,n=!1){this._isReadonly=e,this._isShallow=n}get(e,n,i){if(n==="__v_skip")return e.__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?tx:ex:s?Q_:Z_).get(e)||Object.getPrototypeOf(e)===Object.getPrototypeOf(i)?e:void 0;const o=Qe(e);if(!r){let l;if(o&&(l=LS[n]))return l;if(n==="hasOwnProperty")return US}const a=Reflect.get(e,n,en(e)?e:i);if((Ri(n)?j_.has(n):FS(n))||(r||Pn(e,"get",n),s))return a;if(en(a)){const l=o&&_u(n)?a:a.value;return r&&Et(l)?qc(l):l}return Et(a)?r?qc(a):On(a):a}}class J_ extends Y_{constructor(e=!1){super(!1,e)}set(e,n,i,r){let s=e[n];const o=Qe(e)&&_u(n);if(!this._isShallow){const c=Br(s);if(!di(i)&&!Br(i)&&(s=St(s),i=St(i)),!o&&en(s)&&!en(i))return c||(s.value=i),!0}const a=o?Number(n)t,Nl=t=>Reflect.getPrototypeOf(t);function HS(t,e,n){return function(...i){const r=this.__v_raw,s=St(r),o=Ho(s),a=t==="entries"||t===Symbol.iterator&&o,l=t==="keys"&&o,c=r[t](...i),u=n?jf:e?ea:Di;return!e&&Pn(s,"iterate",l?$f:Qs),dn(Object.create(c),{next(){const{value:d,done:f}=c.next();return f?{value:d,done:f}:{value:a?[u(d[0]),u(d[1])]:u(d),done:f}}})}}function Ll(t){return function(...e){return t==="delete"?!1:t==="clear"?void 0:this}}function GS(t,e){const n={get(r){const s=this.__v_raw,o=St(s),a=St(r);t||(gs(r,a)&&Pn(o,"get",r),Pn(o,"get",a));const{has:l}=Nl(o),c=e?jf:t?ea:Di;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!t&&Pn(St(r),"iterate",Qs),r.size},has(r){const s=this.__v_raw,o=St(s),a=St(r);return t||(gs(r,a)&&Pn(o,"has",r),Pn(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=St(a),c=e?jf:t?ea:Di;return!t&&Pn(l,"iterate",Qs),a.forEach((u,d)=>r.call(s,c(u),c(d),o))}};return dn(n,t?{add:Ll("add"),set:Ll("set"),delete:Ll("delete"),clear:Ll("clear")}:{add(r){!e&&!di(r)&&!Br(r)&&(r=St(r));const s=St(this);return Nl(s).has.call(s,r)||(s.add(r),Tr(s,"add",r,r)),this},set(r,s){!e&&!di(s)&&!Br(s)&&(s=St(s));const o=St(this),{has:a,get:l}=Nl(o);let c=a.call(o,r);c||(r=St(r),c=a.call(o,r));const u=l.call(o,r);return o.set(r,s),c?gs(s,u)&&Tr(o,"set",r,s):Tr(o,"add",r,s),this},delete(r){const s=St(this),{has:o,get:a}=Nl(s);let l=o.call(s,r);l||(r=St(r),l=o.call(s,r)),a&&a.call(s,r);const c=s.delete(r);return l&&Tr(s,"delete",r,void 0),c},clear(){const r=St(this),s=r.size!==0,o=r.clear();return s&&Tr(r,"clear",void 0,void 0),o}}),["keys","values","entries",Symbol.iterator].forEach(r=>{n[r]=HS(r,t,e)}),n}function Eu(t,e){const n=GS(t,e);return(i,r,s)=>r==="__v_isReactive"?!t:r==="__v_isReadonly"?t:r==="__v_raw"?i:Reflect.get(Tt(n,r)&&r in i?n:i,r,s)}const WS={get:Eu(!1,!1)},qS={get:Eu(!1,!0)},XS={get:Eu(!0,!1)},$S={get:Eu(!0,!0)},Z_=new WeakMap,Q_=new WeakMap,ex=new WeakMap,tx=new WeakMap;function jS(t){switch(t){case"Object":case"Array":return 1;case"Map":case"Set":case"WeakMap":case"WeakSet":return 2;default:return 0}}function YS(t){return t.__v_skip||!Object.isExtensible(t)?0:jS(xS(t))}function On(t){return Br(t)?t:Tu(t,!1,kS,WS,Z_)}function JS(t){return Tu(t,!1,zS,qS,Q_)}function qc(t){return Tu(t,!0,BS,XS,ex)}function Hs(t){return Tu(t,!0,VS,$S,tx)}function Tu(t,e,n,i,r){if(!Et(t)||t.__v_raw&&!(e&&t.__v_isReactive))return t;const s=YS(t);if(s===0)return t;const o=r.get(t);if(o)return o;const a=new Proxy(t,s===2?i:n);return r.set(t,a),a}function eo(t){return Br(t)?eo(t.__v_raw):!!(t&&t.__v_isReactive)}function Br(t){return!!(t&&t.__v_isReadonly)}function di(t){return!!(t&&t.__v_isShallow)}function Au(t){return t?!!t.__v_raw:!1}function St(t){const e=t&&t.__v_raw;return e?St(e):t}function nx(t){return!Tt(t,"__v_skip")&&Object.isExtensible(t)&&N_(t,"__v_skip",!0),t}const Di=t=>Et(t)?On(t):t,ea=t=>Et(t)?qc(t):t;function en(t){return t?t.__v_isRef===!0:!1}function ke(t){return ix(t,!1)}function Cu(t){return ix(t,!0)}function ix(t,e){return en(t)?t:new KS(t,e)}class KS{constructor(e,n){this.dep=new wu,this.__v_isRef=!0,this.__v_isShallow=!1,this._rawValue=n?e:St(e),this._value=n?e:Di(e),this.__v_isShallow=n}get value(){return this.dep.track(),this._value}set value(e){const n=this._rawValue,i=this.__v_isShallow||di(e)||Br(e);e=i?e:St(e),gs(e,n)&&(this._rawValue=e,this._value=i?e:Di(e),this.dep.trigger())}}function ZS(t){t.dep&&t.dep.trigger()}function E(t){return en(t)?t.value:t}function Nn(t){return ot(t)?t():E(t)}const QS={get:(t,e,n)=>e==="__v_raw"?t:E(Reflect.get(t,e,n)),set:(t,e,n,i)=>{const r=t[e];return en(r)&&!en(n)?(r.value=n,!0):Reflect.set(t,e,n,i)}};function rx(t){return eo(t)?t:new Proxy(t,QS)}class ew{constructor(e){this.__v_isRef=!0,this._value=void 0;const n=this.dep=new wu,{get:i,set:r}=e(n.track.bind(n),n.trigger.bind(n));this._get=i,this._set=r}get value(){return this._value=this._get()}set value(e){this._set(e)}}function tw(t){return new ew(t)}function zr(t){const e=Qe(t)?new Array(t.length):{};for(const n in t)e[n]=sx(t,n);return e}class nw{constructor(e,n,i){this._object=e,this._key=n,this._defaultValue=i,this.__v_isRef=!0,this._value=void 0,this._raw=St(e);let r=!0,s=e;if(!Qe(e)||!_u(String(n)))do r=!Au(s)||di(s);while(r&&(s=s.__v_raw));this._shallow=r}get value(){let e=this._object[this._key];return this._shallow&&(e=E(e)),this._value=e===void 0?this._defaultValue:e}set value(e){if(this._shallow&&en(this._raw[this._key])){const n=this._object[this._key];if(en(n)){n.value=e;return}}this._object[this._key]=e}get dep(){return NS(this._raw,this._key)}}class iw{constructor(e){this._getter=e,this.__v_isRef=!0,this.__v_isReadonly=!0,this._value=void 0}get value(){return this._value=this._getter()}}function rw(t,e,n){return en(t)?t:ot(t)?new iw(t):Et(t)&&arguments.length>1?sx(t,e,n):ke(t)}function sx(t,e,n){return new nw(t,e,n)}class sw{constructor(e,n,i){this.fn=e,this.setter=n,this._value=void 0,this.dep=new wu(this),this.__v_isRef=!0,this.deps=void 0,this.depsTail=void 0,this.flags=16,this.globalVersion=el-1,this.next=void 0,this.effect=this,this.__v_isReadonly=!n,this.isSSR=i}notify(){if(this.flags|=16,!(this.flags&8)&&Gt!==this)return H_(this,!0),!0}get value(){const e=this.dep.track();return q_(this),e&&(e.version=this.dep.version),this._value}set value(e){this.setter&&this.setter(e)}}function ow(t,e,n=!1){let i,r;return ot(t)?i=t:(i=t.get,r=t.set),new sw(i,r,n)}const Ol={},Xc=new WeakMap;let Gs;function aw(t,e=!1,n=Gs){if(n){let i=Xc.get(n);i||Xc.set(n,i=[]),i.push(t)}}function lw(t,e,n=Bt){const{immediate:i,deep:r,once:s,scheduler:o,augmentJob:a,call:l}=n,c=x=>r?x:di(x)||r===!1||r===0?Ar(x,1):Ar(x);let u,d,f,h,g=!1,v=!1;if(en(t)?(d=()=>t.value,g=di(t)):eo(t)?(d=()=>c(t),g=!0):Qe(t)?(v=!0,g=t.some(x=>eo(x)||di(x)),d=()=>t.map(x=>{if(en(x))return x.value;if(eo(x))return c(x);if(ot(x))return l?l(x,2):x()})):ot(t)?e?d=l?()=>l(t,2):t:d=()=>{if(f){Ur();try{f()}finally{kr()}}const x=Gs;Gs=u;try{return l?l(t,3,[h]):t(h)}finally{Gs=x}}:d=Qi,e&&r){const x=d,M=r===!0?1/0:r;d=()=>Ar(x(),M)}const m=xp(),p=()=>{u.stop(),m&&m.active&&_p(m.effects,u)};if(s&&e){const x=e;e=(...M)=>{x(...M),p()}}let _=v?new Array(t.length).fill(Ol):Ol;const y=x=>{if(!(!(u.flags&1)||!u.dirty&&!x))if(e){const M=u.run();if(r||g||(v?M.some((A,P)=>gs(A,_[P])):gs(M,_))){f&&f();const A=Gs;Gs=u;try{const P=[M,_===Ol?void 0:v&&_[0]===Ol?[]:_,h];_=M,l?l(e,3,P):e(...P)}finally{Gs=A}}}else u.run()};return a&&a(y),u=new z_(d),u.scheduler=o?()=>o(y,!1):y,h=x=>aw(x,!1,u),f=u.onStop=()=>{const x=Xc.get(u);if(x){if(l)l(x,4);else for(const M of x)M();Xc.delete(u)}},e?i?y(!0):_=u.run():o?o(y.bind(null,!0),!0):u.run(),p.pause=u.pause.bind(u),p.resume=u.resume.bind(u),p.stop=p,p}function Ar(t,e=1/0,n){if(e<=0||!Et(t)||t.__v_skip||(n=n||new Map,(n.get(t)||0)>=e))return t;if(n.set(t,e),e--,en(t))Ar(t.value,e,n);else if(Qe(t))for(let i=0;i{Ar(i,e,n)});else if(I_(t)){for(const i in t)Ar(t[i],e,n);for(const i of Object.getOwnPropertySymbols(t))Object.prototype.propertyIsEnumerable.call(t,i)&&Ar(t[i],e,n)}return t}function xl(t,e,n,i){try{return i?t(...i):t()}catch(r){Pu(r,e,n)}}function Ii(t,e,n,i){if(ot(t)){const r=xl(t,e,n,i);return r&&R_(r)&&r.catch(s=>{Pu(s,e,n)}),r}if(Qe(t)){const r=[];for(let s=0;s>>1,r=zn[i],s=nl(r);s=nl(n)?zn.push(t):zn.splice(uw(e),0,t),t.flags|=1,ax()}}function ax(){$c||($c=ox.then(cx))}function dw(t){Qe(t)?Go.push(...t):us&&t.id===-1?us.splice(Oo+1,0,t):t.flags&1||(Go.push(t),t.flags|=1),ax()}function zm(t,e,n=Wi+1){for(;nnl(n)-nl(i));if(Go.length=0,us){us.push(...e);return}for(us=e,Oo=0;Oot.id==null?t.flags&2?-1:1/0:t.id;function cx(t){try{for(Wi=0;Wi{i._d&&Kc(-1);const s=jc(e);let o;try{o=t(...r)}finally{jc(s),i._d&&Kc(1)}return o};return i._n=!0,i._c=!0,i._d=!0,i}function Cc(t,e){if(bn===null)return t;const n=Ou(bn),i=t.dirs||(t.dirs=[]);for(let r=0;r1)return n&&ot(e)?e.call(i&&i.proxy):e}}const fw=Symbol.for("v-scx"),hw=()=>Wo(fw);function Wn(t,e){return Ru(t,null,e)}function dx(t,e){return Ru(t,null,{flush:"post"})}function rn(t,e,n){return Ru(t,e,n)}function Ru(t,e,n=Bt){const{immediate:i,deep:r,flush:s,once:o}=n,a=dn({},n),l=e&&i||!e&&s!=="post";let c;if(ol){if(s==="sync"){const h=hw();c=h.__watcherHandles||(h.__watcherHandles=[])}else if(!l){const h=()=>{};return h.stop=Qi,h.resume=Qi,h.pause=Qi,h}}const u=Rn;a.call=(h,g,v)=>Ii(h,u,g,v);let d=!1;s==="post"?a.scheduler=h=>{Tn(h,u&&u.suspense)}:s!=="sync"&&(d=!0,a.scheduler=(h,g)=>{g?h():wp(h)}),a.augmentJob=h=>{e&&(h.flags|=4),d&&(h.flags|=2,u&&(h.id=u.uid,h.i=u))};const f=lw(t,e,a);return ol&&(c?c.push(f):l&&f()),f}function pw(t,e,n){const i=this.proxy,r=Xt(t)?t.includes(".")?fx(i,t):()=>i[t]:t.bind(i,i);let s;ot(e)?s=e:(s=e.handler,n=e);const o=yl(this),a=Ru(r,s.bind(i),n);return o(),a}function fx(t,e){const n=e.split(".");return()=>{let i=t;for(let r=0;rt.__isTeleport,$a=t=>t&&(t.disabled||t.disabled===""),Vm=t=>t&&(t.defer||t.defer===""),Hm=t=>typeof SVGElement<"u"&&t instanceof SVGElement,Gm=t=>typeof MathMLElement=="function"&&t instanceof MathMLElement,Yf=(t,e)=>{const n=t&&t.to;return Xt(n)?e?e(n):null:n},mx={name:"Teleport",__isTeleport:!0,process(t,e,n,i,r,s,o,a,l,c){const{mc:u,pc:d,pbc:f,o:{insert:h,querySelector:g,createText:v,createComment:m}}=c,p=$a(e.props);let{shapeFlag:_,children:y,dynamicChildren:x}=e;if(t==null){const M=e.el=v(""),A=e.anchor=v("");h(M,n,i),h(A,n,i);const P=(b,w)=>{_&16&&u(y,b,w,r,s,o,a,l)},D=()=>{const b=e.target=Yf(e.props,g),w=Jf(b,e,v,h);b&&(o!=="svg"&&Hm(b)?o="svg":o!=="mathml"&&Gm(b)&&(o="mathml"),r&&r.isCE&&(r.ce._teleportTargets||(r.ce._teleportTargets=new Set)).add(b),p||(P(b,w),Pc(e,!1)))};p&&(P(n,A),Pc(e,!0)),Vm(e.props)?(e.el.__isMounted=!1,Tn(()=>{D(),delete e.el.__isMounted},s)):D()}else{if(Vm(e.props)&&t.el.__isMounted===!1){Tn(()=>{mx.process(t,e,n,i,r,s,o,a,l,c)},s);return}e.el=t.el,e.targetStart=t.targetStart;const M=e.anchor=t.anchor,A=e.target=t.target,P=e.targetAnchor=t.targetAnchor,D=$a(t.props),b=D?n:A,w=D?M:P;if(o==="svg"||Hm(A)?o="svg":(o==="mathml"||Gm(A))&&(o="mathml"),x?(f(t.dynamicChildren,x,b,r,s,o,a),Cp(t,e,!0)):l||d(t,e,b,w,r,s,o,a,!1),p)D?e.props&&t.props&&e.props.to!==t.props.to&&(e.props.to=t.props.to):Fl(e,n,M,c,1);else if((e.props&&e.props.to)!==(t.props&&t.props.to)){const I=e.target=Yf(e.props,g);I&&Fl(e,I,null,c,0)}else D&&Fl(e,A,P,c,1);Pc(e,p)}},remove(t,e,n,{um:i,o:{remove:r}},s){const{shapeFlag:o,children:a,anchor:l,targetStart:c,targetAnchor:u,target:d,props:f}=t;if(d&&(r(c),r(u)),s&&r(l),o&16){const h=s||!$a(f);for(let g=0;g{t.isMounted=!0}),da(()=>{t.isUnmounting=!0}),t}const mi=[Function,Array],gx={mode:String,appear:Boolean,persisted:Boolean,onBeforeEnter:mi,onEnter:mi,onAfterEnter:mi,onEnterCancelled:mi,onBeforeLeave:mi,onLeave:mi,onAfterLeave:mi,onLeaveCancelled:mi,onBeforeAppear:mi,onAppear:mi,onAfterAppear:mi,onAppearCancelled:mi},vx=t=>{const e=t.subTree;return e.component?vx(e.component):e},_w={name:"BaseTransition",props:gx,setup(t,{slots:e}){const n=or(),i=vw();return()=>{const r=e.default&&yx(e.default(),!0);if(!r||!r.length)return;const s=_x(r),o=St(t),{mode:a}=o;if(i.isLeaving)return Id(s);const l=Wm(s);if(!l)return Id(s);let c=Kf(l,o,i,n,d=>c=d);l.type!==xn&&il(l,c);let u=n.subTree&&Wm(n.subTree);if(u&&u.type!==xn&&!qs(u,l)&&vx(n).type!==xn){let d=Kf(u,o,i,n);if(il(u,d),a==="out-in"&&l.type!==xn)return i.isLeaving=!0,d.afterLeave=()=>{i.isLeaving=!1,n.job.flags&8||n.update(),delete d.afterLeave,u=void 0},Id(s);a==="in-out"&&l.type!==xn?d.delayLeave=(f,h,g)=>{const v=xx(i,u);v[String(u.key)]=u,f[Xi]=()=>{h(),f[Xi]=void 0,delete c.delayedLeave,u=void 0},c.delayedLeave=()=>{g(),delete c.delayedLeave,u=void 0}}:u=void 0}else u&&(u=void 0);return s}}};function _x(t){let e=t[0];if(t.length>1){for(const n of t)if(n.type!==xn){e=n;break}}return e}const xw=_w;function xx(t,e){const{leavingVNodes:n}=t;let i=n.get(e.type);return i||(i=Object.create(null),n.set(e.type,i)),i}function Kf(t,e,n,i,r){const{appear:s,mode:o,persisted:a=!1,onBeforeEnter:l,onEnter:c,onAfterEnter:u,onEnterCancelled:d,onBeforeLeave:f,onLeave:h,onAfterLeave:g,onLeaveCancelled:v,onBeforeAppear:m,onAppear:p,onAfterAppear:_,onAppearCancelled:y}=e,x=String(t.key),M=xx(n,t),A=(b,w)=>{b&&Ii(b,i,9,w)},P=(b,w)=>{const I=w[1];A(b,w),Qe(b)?b.every(L=>L.length<=1)&&I():b.length<=1&&I()},D={mode:o,persisted:a,beforeEnter(b){let w=l;if(!n.isMounted)if(s)w=m||l;else return;b[Xi]&&b[Xi](!0);const I=M[x];I&&qs(t,I)&&I.el[Xi]&&I.el[Xi](),A(w,[b])},enter(b){let w=c,I=u,L=d;if(!n.isMounted)if(s)w=p||c,I=_||u,L=y||d;else return;let V=!1;b[ya]=X=>{V||(V=!0,X?A(L,[b]):A(I,[b]),D.delayedLeave&&D.delayedLeave(),b[ya]=void 0)};const $=b[ya].bind(null,!1);w?P(w,[b,$]):$()},leave(b,w){const I=String(t.key);if(b[ya]&&b[ya](!0),n.isUnmounting)return w();A(f,[b]);let L=!1;b[Xi]=$=>{L||(L=!0,w(),$?A(v,[b]):A(g,[b]),b[Xi]=void 0,M[I]===t&&delete M[I])};const V=b[Xi].bind(null,!1);M[I]=t,h?P(h,[b,V]):V()},clone(b){const w=Kf(b,e,n,i,r);return r&&r(w),w}};return D}function Id(t){if(Du(t))return t=Hr(t),t.children=null,t}function Wm(t){if(!Du(t))return px(t.type)&&t.children?_x(t.children):t;if(t.component)return t.component.subTree;const{shapeFlag:e,children:n}=t;if(n){if(e&16)return n[0];if(e&32&&ot(n.default))return n.default()}}function il(t,e){t.shapeFlag&6&&t.component?(t.transition=e,il(t.component.subTree,e)):t.shapeFlag&128?(t.ssContent.transition=e.clone(t.ssContent),t.ssFallback.transition=e.clone(t.ssFallback)):t.transition=e}function yx(t,e=!1,n){let i=[],r=0;for(let s=0;s1)for(let s=0;sja(v,e&&(Qe(e)?e[m]:e),n,i,r));return}if(qo(i)&&!r){i.shapeFlag&512&&i.type.__asyncResolved&&i.component.subTree.component&&ja(t,e,n,i.component.subTree);return}const s=i.shapeFlag&4?Ou(i.component):i.el,o=r?null:s,{i:a,r:l}=t,c=e&&e.r,u=a.refs===Bt?a.refs={}:a.refs,d=a.setupState,f=St(d),h=d===Bt?P_:v=>qm(u,v)?!1:Tt(f,v),g=(v,m)=>!(m&&qm(u,m));if(c!=null&&c!==l){if(Xm(e),Xt(c))u[c]=null,h(c)&&(d[c]=null);else if(en(c)){const v=e;g(c,v.k)&&(c.value=null),v.k&&(u[v.k]=null)}}if(ot(l))xl(l,a,12,[o,u]);else{const v=Xt(l),m=en(l);if(v||m){const p=()=>{if(t.f){const _=v?h(l)?d[l]:u[l]:g()||!t.k?l.value:u[t.k];if(r)Qe(_)&&_p(_,s);else if(Qe(_))_.includes(s)||_.push(s);else if(v)u[l]=[s],h(l)&&(d[l]=u[l]);else{const y=[s];g(l,t.k)&&(l.value=y),t.k&&(u[t.k]=y)}}else v?(u[l]=o,h(l)&&(d[l]=o)):m&&(g(l,t.k)&&(l.value=o),t.k&&(u[t.k]=o))};if(o){const _=()=>{p(),Yc.delete(t)};_.id=-1,Yc.set(t,_),Tn(_,n)}else Xm(t),p()}}}function Xm(t){const e=Yc.get(t);e&&(e.flags|=8,Yc.delete(t))}Su().requestIdleCallback;Su().cancelIdleCallback;const qo=t=>!!t.type.__asyncLoader,Du=t=>t.type.__isKeepAlive;function bw(t,e){Sx(t,"a",e)}function Sw(t,e){Sx(t,"da",e)}function Sx(t,e,n=Rn){const i=t.__wdc||(t.__wdc=()=>{let r=n;for(;r;){if(r.isDeactivated)return;r=r.parent}return t()});if(Iu(e,i,n),n){let r=n.parent;for(;r&&r.parent;)Du(r.parent.vnode)&&ww(i,e,n,r),r=r.parent}}function ww(t,e,n,i){const r=Iu(e,t,i,!0);fa(()=>{_p(i[e],r)},n)}function Iu(t,e,n=Rn,i=!1){if(n){const r=n[t]||(n[t]=[]),s=e.__weh||(e.__weh=(...o)=>{Ur();const a=yl(n),l=Ii(e,n,t,o);return a(),kr(),l});return i?r.unshift(s):r.push(s),s}}const jr=t=>(e,n=Rn)=>{(!ol||t==="sp")&&Iu(t,(...i)=>e(...i),n)},Mw=jr("bm"),ti=jr("m"),Ew=jr("bu"),wx=jr("u"),da=jr("bum"),fa=jr("um"),Tw=jr("sp"),Aw=jr("rtg"),Cw=jr("rtc");function Pw(t,e=Rn){Iu("ec",t,e)}const Rw="components",Mx=Symbol.for("v-ndc");function Ep(t){return Xt(t)?Dw(Rw,t,!1)||t:t||Mx}function Dw(t,e,n=!0,i=!1){const r=bn||Rn;if(r){const s=r.type;{const a=mM(s,!1);if(a&&(a===e||a===ei(e)||a===yu(ei(e))))return s}const o=$m(r[t]||s[t],e)||$m(r.appContext[t],e);return!o&&i?s:o}}function $m(t,e){return t&&(t[e]||t[ei(e)]||t[yu(ei(e))])}function ta(t,e,n,i){let r;const s=n,o=Qe(t);if(o||Xt(t)){const a=o&&eo(t);let l=!1,c=!1;a&&(l=!di(t),c=Br(t),t=Mu(t)),r=new Array(t.length);for(let u=0,d=t.length;ue(a,l,void 0,s));else{const a=Object.keys(t);r=new Array(a.length);for(let l=0,c=a.length;l0;return me(),Ie(Kt,null,[ie("slot",n,i&&i())],c?-2:64)}let s=t[e];s&&s._c&&(s._d=!1),me();const o=s&&Ex(s(n)),a=n.key||o&&o.key,l=Ie(Kt,{key:(a&&!Ri(a)?a:`_${e}`)+(!o&&i?"_fb":"")},o||(i?i():[]),o&&t._===1?64:-2);return l.scopeId&&(l.slotScopeIds=[l.scopeId+"-s"]),s&&s._c&&(s._d=!0),l}function Ex(t){return t.some(e=>sl(e)?!(e.type===xn||e.type===Kt&&!Ex(e.children)):!0)?t:null}function Iw(t,e){const n={};for(const i in t)n[Wa(i)]=t[i];return n}const Zf=t=>t?Wx(t)?Ou(t):Zf(t.parent):null,Ya=dn(Object.create(null),{$:t=>t,$el:t=>t.vnode.el,$data:t=>t.data,$props:t=>t.props,$attrs:t=>t.attrs,$slots:t=>t.slots,$refs:t=>t.refs,$parent:t=>Zf(t.parent),$root:t=>Zf(t.root),$host:t=>t.ce,$emit:t=>t.emit,$options:t=>Ax(t),$forceUpdate:t=>t.f||(t.f=()=>{wp(t.update)}),$nextTick:t=>t.n||(t.n=Vr.bind(t.proxy)),$watch:t=>pw.bind(t)}),Nd=(t,e)=>t!==Bt&&!t.__isScriptSetup&&Tt(t,e),Nw={get({_:t},e){if(e==="__v_skip")return!0;const{ctx:n,setupState:i,data:r,props:s,accessCache:o,type:a,appContext:l}=t;if(e[0]!=="$"){const f=o[e];if(f!==void 0)switch(f){case 1:return i[e];case 2:return r[e];case 4:return n[e];case 3:return s[e]}else{if(Nd(i,e))return o[e]=1,i[e];if(r!==Bt&&Tt(r,e))return o[e]=2,r[e];if(Tt(s,e))return o[e]=3,s[e];if(n!==Bt&&Tt(n,e))return o[e]=4,n[e];eh&&(o[e]=0)}}const c=Ya[e];let u,d;if(c)return e==="$attrs"&&Pn(t.attrs,"get",""),c(t);if((u=a.__cssModules)&&(u=u[e]))return u;if(n!==Bt&&Tt(n,e))return o[e]=4,n[e];if(d=l.config.globalProperties,Tt(d,e))return d[e]},set({_:t},e,n){const{data:i,setupState:r,ctx:s}=t;return Nd(r,e)?(r[e]=n,!0):i!==Bt&&Tt(i,e)?(i[e]=n,!0):Tt(t.props,e)||e[0]==="$"&&e.slice(1)in t?!1:(s[e]=n,!0)},has({_:{data:t,setupState:e,accessCache:n,ctx:i,appContext:r,props:s,type:o}},a){let l;return!!(n[a]||t!==Bt&&a[0]!=="$"&&Tt(t,a)||Nd(e,a)||Tt(s,a)||Tt(i,a)||Tt(Ya,a)||Tt(r.config.globalProperties,a)||(l=o.__cssModules)&&l[a])},defineProperty(t,e,n){return n.get!=null?t._.accessCache[e]=0:Tt(n,"value")&&this.set(t,e,n.value,null),Reflect.defineProperty(t,e,n)}};function Qf(t){return Qe(t)?t.reduce((e,n)=>(e[n]=null,e),{}):t}function Lw(t,e){const n=Qf(t);for(const i in e){if(i.startsWith("__skip"))continue;let r=n[i];r?Qe(r)||ot(r)?r=n[i]={type:r,default:e[i]}:r.default=e[i]:r===null&&(r=n[i]={default:e[i]}),r&&e[`__skip_${i}`]&&(r.skipFactory=!0)}return n}let eh=!0;function Ow(t){const e=Ax(t),n=t.proxy,i=t.ctx;eh=!1,e.beforeCreate&&jm(e.beforeCreate,t,"bc");const{data:r,computed:s,methods:o,watch:a,provide:l,inject:c,created:u,beforeMount:d,mounted:f,beforeUpdate:h,updated:g,activated:v,deactivated:m,beforeDestroy:p,beforeUnmount:_,destroyed:y,unmounted:x,render:M,renderTracked:A,renderTriggered:P,errorCaptured:D,serverPrefetch:b,expose:w,inheritAttrs:I,components:L,directives:V,filters:$}=e;if(c&&Fw(c,i,null),o)for(const B in o){const z=o[B];ot(z)&&(i[B]=z.bind(n))}if(r){const B=r.call(n,n);Et(B)&&(t.data=On(B))}if(eh=!0,s)for(const B in s){const z=s[B],de=ot(z)?z.bind(n,n):ot(z.get)?z.get.bind(n,n):Qi,le=!ot(z)&&ot(z.set)?z.set.bind(n):Qi,pe=Me({get:de,set:le});Object.defineProperty(i,B,{enumerable:!0,configurable:!0,get:()=>pe.value,set:He=>pe.value=He})}if(a)for(const B in a)Tx(a[B],i,n,B);if(l){const B=ot(l)?l.call(n):l;Reflect.ownKeys(B).forEach(z=>{Mp(z,B[z])})}u&&jm(u,t,"c");function W(B,z){Qe(z)?z.forEach(de=>B(de.bind(n))):z&&B(z.bind(n))}if(W(Mw,d),W(ti,f),W(Ew,h),W(wx,g),W(bw,v),W(Sw,m),W(Pw,D),W(Cw,A),W(Aw,P),W(da,_),W(fa,x),W(Tw,b),Qe(w))if(w.length){const B=t.exposed||(t.exposed={});w.forEach(z=>{Object.defineProperty(B,z,{get:()=>n[z],set:de=>n[z]=de,enumerable:!0})})}else t.exposed||(t.exposed={});M&&t.render===Qi&&(t.render=M),I!=null&&(t.inheritAttrs=I),L&&(t.components=L),V&&(t.directives=V),b&&bx(t)}function Fw(t,e,n=Qi){Qe(t)&&(t=th(t));for(const i in t){const r=t[i];let s;Et(r)?"default"in r?s=Wo(r.from||i,r.default,!0):s=Wo(r.from||i):s=Wo(r),en(s)?Object.defineProperty(e,i,{enumerable:!0,configurable:!0,get:()=>s.value,set:o=>s.value=o}):e[i]=s}}function jm(t,e,n){Ii(Qe(t)?t.map(i=>i.bind(e.proxy)):t.bind(e.proxy),e,n)}function Tx(t,e,n,i){let r=i.includes(".")?fx(n,i):()=>n[i];if(Xt(t)){const s=e[t];ot(s)&&rn(r,s)}else if(ot(t))rn(r,t.bind(n));else if(Et(t))if(Qe(t))t.forEach(s=>Tx(s,e,n,i));else{const s=ot(t.handler)?t.handler.bind(n):e[t.handler];ot(s)&&rn(r,s,t)}}function Ax(t){const e=t.type,{mixins:n,extends:i}=e,{mixins:r,optionsCache:s,config:{optionMergeStrategies:o}}=t.appContext,a=s.get(e);let l;return a?l=a:!r.length&&!n&&!i?l=e:(l={},r.length&&r.forEach(c=>Jc(l,c,o,!0)),Jc(l,e,o)),Et(e)&&s.set(e,l),l}function Jc(t,e,n,i=!1){const{mixins:r,extends:s}=e;s&&Jc(t,s,n,!0),r&&r.forEach(o=>Jc(t,o,n,!0));for(const o in e)if(!(i&&o==="expose")){const a=Uw[o]||n&&n[o];t[o]=a?a(t[o],e[o]):e[o]}return t}const Uw={data:Ym,props:Jm,emits:Jm,methods:Oa,computed:Oa,beforeCreate:Un,created:Un,beforeMount:Un,mounted:Un,beforeUpdate:Un,updated:Un,beforeDestroy:Un,beforeUnmount:Un,destroyed:Un,unmounted:Un,activated:Un,deactivated:Un,errorCaptured:Un,serverPrefetch:Un,components:Oa,directives:Oa,watch:Bw,provide:Ym,inject:kw};function Ym(t,e){return e?t?function(){return dn(ot(t)?t.call(this,this):t,ot(e)?e.call(this,this):e)}:e:t}function kw(t,e){return Oa(th(t),th(e))}function th(t){if(Qe(t)){const e={};for(let n=0;ne==="modelValue"||e==="model-value"?t.modelModifiers:t[`${e}Modifiers`]||t[`${ei(e)}Modifiers`]||t[`${bs(e)}Modifiers`];function Gw(t,e,...n){if(t.isUnmounted)return;const i=t.vnode.props||Bt;let r=n;const s=e.startsWith("update:"),o=s&&Hw(i,e.slice(7));o&&(o.trim&&(r=n.map(u=>Xt(u)?u.trim():u)),o.number&&(r=n.map(bu)));let a,l=i[a=Wa(e)]||i[a=Wa(ei(e))];!l&&s&&(l=i[a=Wa(bs(e))]),l&&Ii(l,t,6,r);const c=i[a+"Once"];if(c){if(!t.emitted)t.emitted={};else if(t.emitted[a])return;t.emitted[a]=!0,Ii(c,t,6,r)}}const Ww=new WeakMap;function Px(t,e,n=!1){const i=n?Ww:e.emitsCache,r=i.get(t);if(r!==void 0)return r;const s=t.emits;let o={},a=!1;if(!ot(t)){const l=c=>{const u=Px(c,e,!0);u&&(a=!0,dn(o,u))};!n&&e.mixins.length&&e.mixins.forEach(l),t.extends&&l(t.extends),t.mixins&&t.mixins.forEach(l)}return!s&&!a?(Et(t)&&i.set(t,null),null):(Qe(s)?s.forEach(l=>o[l]=null):dn(o,s),Et(t)&&i.set(t,o),o)}function Nu(t,e){return!t||!gu(e)?!1:(e=e.slice(2).replace(/Once$/,""),Tt(t,e[0].toLowerCase()+e.slice(1))||Tt(t,bs(e))||Tt(t,e))}function Km(t){const{type:e,vnode:n,proxy:i,withProxy:r,propsOptions:[s],slots:o,attrs:a,emit:l,render:c,renderCache:u,props:d,data:f,setupState:h,ctx:g,inheritAttrs:v}=t,m=jc(t);let p,_;try{if(n.shapeFlag&4){const x=r||i,M=x;p=$i(c.call(M,x,u,d,h,f,g)),_=a}else{const x=e;p=$i(x.length>1?x(d,{attrs:a,slots:o,emit:l}):x(d,null)),_=e.props?a:qw(a)}}catch(x){Ja.length=0,Pu(x,t,1),p=ie(xn)}let y=p;if(_&&v!==!1){const x=Object.keys(_),{shapeFlag:M}=y;x.length&&M&7&&(s&&x.some(vp)&&(_=Xw(_,s)),y=Hr(y,_,!1,!0))}return n.dirs&&(y=Hr(y,null,!1,!0),y.dirs=y.dirs?y.dirs.concat(n.dirs):n.dirs),n.transition&&il(y,n.transition),p=y,jc(m),p}const qw=t=>{let e;for(const n in t)(n==="class"||n==="style"||gu(n))&&((e||(e={}))[n]=t[n]);return e},Xw=(t,e)=>{const n={};for(const i in t)(!vp(i)||!(i.slice(9)in e))&&(n[i]=t[i]);return n};function $w(t,e,n){const{props:i,children:r,component:s}=t,{props:o,children:a,patchFlag:l}=e,c=s.emitsOptions;if(e.dirs||e.transition)return!0;if(n&&l>=0){if(l&1024)return!0;if(l&16)return i?Zm(i,o,c):!!o;if(l&8){const u=e.dynamicProps;for(let d=0;dObject.create(Dx),Nx=t=>Object.getPrototypeOf(t)===Dx;function Yw(t,e,n,i=!1){const r={},s=Ix();t.propsDefaults=Object.create(null),Lx(t,e,r,s);for(const o in t.propsOptions[0])o in r||(r[o]=void 0);n?t.props=i?r:JS(r):t.type.props?t.props=r:t.props=s,t.attrs=s}function Jw(t,e,n,i){const{props:r,attrs:s,vnode:{patchFlag:o}}=t,a=St(r),[l]=t.propsOptions;let c=!1;if((i||o>0)&&!(o&16)){if(o&8){const u=t.vnode.dynamicProps;for(let d=0;d{l=!0;const[f,h]=Ox(d,e,!0);dn(o,f),h&&a.push(...h)};!n&&e.mixins.length&&e.mixins.forEach(u),t.extends&&u(t.extends),t.mixins&&t.mixins.forEach(u)}if(!s&&!l)return Et(t)&&i.set(t,Vo),Vo;if(Qe(s))for(let u=0;ut==="_"||t==="_ctx"||t==="$stable",Ap=t=>Qe(t)?t.map($i):[$i(t)],Zw=(t,e,n)=>{if(e._n)return e;const i=te((...r)=>Ap(e(...r)),n);return i._c=!1,i},Fx=(t,e,n)=>{const i=t._ctx;for(const r in t){if(Tp(r))continue;const s=t[r];if(ot(s))e[r]=Zw(r,s,i);else if(s!=null){const o=Ap(s);e[r]=()=>o}}},Ux=(t,e)=>{const n=Ap(e);t.slots.default=()=>n},kx=(t,e,n)=>{for(const i in e)(n||!Tp(i))&&(t[i]=e[i])},Qw=(t,e,n)=>{const i=t.slots=Ix();if(t.vnode.shapeFlag&32){const r=e._;r?(kx(i,e,n),n&&N_(i,"_",r,!0)):Fx(e,i)}else e&&Ux(t,e)},eM=(t,e,n)=>{const{vnode:i,slots:r}=t;let s=!0,o=Bt;if(i.shapeFlag&32){const a=e._;a?n&&a===1?s=!1:kx(r,e,n):(s=!e.$stable,Fx(e,r)),o=e}else e&&(Ux(t,e),o={default:1});if(s)for(const a in r)!Tp(a)&&o[a]==null&&delete r[a]},Tn=sM;function tM(t){return nM(t)}function nM(t,e){const n=Su();n.__VUE__=!0;const{insert:i,remove:r,patchProp:s,createElement:o,createText:a,createComment:l,setText:c,setElementText:u,parentNode:d,nextSibling:f,setScopeId:h=Qi,insertStaticContent:g}=t,v=(O,k,U,q=null,H=null,Y=null,C=void 0,ae=null,Q=!!k.dynamicChildren)=>{if(O===k)return;O&&!qs(O,k)&&(q=ue(O),He(O,H,Y,!0),O=null),k.patchFlag===-2&&(Q=!1,k.dynamicChildren=null);const{type:ee,ref:oe,shapeFlag:T}=k;switch(ee){case Lu:m(O,k,U,q);break;case xn:p(O,k,U,q);break;case Od:O==null&&_(k,U,q,C);break;case Kt:L(O,k,U,q,H,Y,C,ae,Q);break;default:T&1?M(O,k,U,q,H,Y,C,ae,Q):T&6?V(O,k,U,q,H,Y,C,ae,Q):(T&64||T&128)&&ee.process(O,k,U,q,H,Y,C,ae,Q,Ae)}oe!=null&&H?ja(oe,O&&O.ref,Y,k||O,!k):oe==null&&O&&O.ref!=null&&ja(O.ref,null,Y,O,!0)},m=(O,k,U,q)=>{if(O==null)i(k.el=a(k.children),U,q);else{const H=k.el=O.el;k.children!==O.children&&c(H,k.children)}},p=(O,k,U,q)=>{O==null?i(k.el=l(k.children||""),U,q):k.el=O.el},_=(O,k,U,q)=>{[O.el,O.anchor]=g(O.children,k,U,q,O.el,O.anchor)},y=({el:O,anchor:k},U,q)=>{let H;for(;O&&O!==k;)H=f(O),i(O,U,q),O=H;i(k,U,q)},x=({el:O,anchor:k})=>{let U;for(;O&&O!==k;)U=f(O),r(O),O=U;r(k)},M=(O,k,U,q,H,Y,C,ae,Q)=>{if(k.type==="svg"?C="svg":k.type==="math"&&(C="mathml"),O==null)A(k,U,q,H,Y,C,ae,Q);else{const ee=O.el&&O.el._isVueCE?O.el:null;try{ee&&ee._beginPatch(),b(O,k,H,Y,C,ae,Q)}finally{ee&&ee._endPatch()}}},A=(O,k,U,q,H,Y,C,ae)=>{let Q,ee;const{props:oe,shapeFlag:T,transition:S,dirs:F}=O;if(Q=O.el=o(O.type,Y,oe&&oe.is,oe),T&8?u(Q,O.children):T&16&&D(O.children,Q,null,q,H,Ld(O,Y),C,ae),F&&Cs(O,null,q,"created"),P(Q,O,O.scopeId,C,q),oe){for(const se in oe)se!=="value"&&!Ga(se)&&s(Q,se,null,oe[se],Y,q);"value"in oe&&s(Q,"value",null,oe.value,Y),(ee=oe.onVnodeBeforeMount)&&Vi(ee,q,O)}F&&Cs(O,null,q,"beforeMount");const J=iM(H,S);J&&S.beforeEnter(Q),i(Q,k,U),((ee=oe&&oe.onVnodeMounted)||J||F)&&Tn(()=>{ee&&Vi(ee,q,O),J&&S.enter(Q),F&&Cs(O,null,q,"mounted")},H)},P=(O,k,U,q,H)=>{if(U&&h(O,U),q)for(let Y=0;Y{for(let ee=Q;ee{const ae=k.el=O.el;let{patchFlag:Q,dynamicChildren:ee,dirs:oe}=k;Q|=O.patchFlag&16;const T=O.props||Bt,S=k.props||Bt;let F;if(U&&Ps(U,!1),(F=S.onVnodeBeforeUpdate)&&Vi(F,U,k,O),oe&&Cs(k,O,U,"beforeUpdate"),U&&Ps(U,!0),(T.innerHTML&&S.innerHTML==null||T.textContent&&S.textContent==null)&&u(ae,""),ee?w(O.dynamicChildren,ee,ae,U,q,Ld(k,H),Y):C||z(O,k,ae,null,U,q,Ld(k,H),Y,!1),Q>0){if(Q&16)I(ae,T,S,U,H);else if(Q&2&&T.class!==S.class&&s(ae,"class",null,S.class,H),Q&4&&s(ae,"style",T.style,S.style,H),Q&8){const J=k.dynamicProps;for(let se=0;se{F&&Vi(F,U,k,O),oe&&Cs(k,O,U,"updated")},q)},w=(O,k,U,q,H,Y,C)=>{for(let ae=0;ae{if(k!==U){if(k!==Bt)for(const Y in k)!Ga(Y)&&!(Y in U)&&s(O,Y,k[Y],null,H,q);for(const Y in U){if(Ga(Y))continue;const C=U[Y],ae=k[Y];C!==ae&&Y!=="value"&&s(O,Y,ae,C,H,q)}"value"in U&&s(O,"value",k.value,U.value,H)}},L=(O,k,U,q,H,Y,C,ae,Q)=>{const ee=k.el=O?O.el:a(""),oe=k.anchor=O?O.anchor:a("");let{patchFlag:T,dynamicChildren:S,slotScopeIds:F}=k;F&&(ae=ae?ae.concat(F):F),O==null?(i(ee,U,q),i(oe,U,q),D(k.children||[],U,oe,H,Y,C,ae,Q)):T>0&&T&64&&S&&O.dynamicChildren&&O.dynamicChildren.length===S.length?(w(O.dynamicChildren,S,U,H,Y,C,ae),(k.key!=null||H&&k===H.subTree)&&Cp(O,k,!0)):z(O,k,U,oe,H,Y,C,ae,Q)},V=(O,k,U,q,H,Y,C,ae,Q)=>{k.slotScopeIds=ae,O==null?k.shapeFlag&512?H.ctx.activate(k,U,q,C,Q):$(k,U,q,H,Y,C,Q):X(O,k,Q)},$=(O,k,U,q,H,Y,C)=>{const ae=O.component=uM(O,q,H);if(Du(O)&&(ae.ctx.renderer=Ae),dM(ae,!1,C),ae.asyncDep){if(H&&H.registerDep(ae,W,C),!O.el){const Q=ae.subTree=ie(xn);p(null,Q,k,U),O.placeholder=Q.el}}else W(ae,O,k,U,H,Y,C)},X=(O,k,U)=>{const q=k.component=O.component;if($w(O,k,U))if(q.asyncDep&&!q.asyncResolved){B(q,k,U);return}else q.next=k,q.update();else k.el=O.el,q.vnode=k},W=(O,k,U,q,H,Y,C)=>{const ae=()=>{if(O.isMounted){let{next:T,bu:S,u:F,parent:J,vnode:se}=O;{const $e=Bx(O);if($e){T&&(T.el=se.el,B(O,T,C)),$e.asyncDep.then(()=>{Tn(()=>{O.isUnmounted||ee()},H)});return}}let K=T,Ce;Ps(O,!1),T?(T.el=se.el,B(O,T,C)):T=se,S&&Ac(S),(Ce=T.props&&T.props.onVnodeBeforeUpdate)&&Vi(Ce,J,T,se),Ps(O,!0);const ve=Km(O),Oe=O.subTree;O.subTree=ve,v(Oe,ve,d(Oe.el),ue(Oe),O,H,Y),T.el=ve.el,K===null&&jw(O,ve.el),F&&Tn(F,H),(Ce=T.props&&T.props.onVnodeUpdated)&&Tn(()=>Vi(Ce,J,T,se),H)}else{let T;const{el:S,props:F}=k,{bm:J,m:se,parent:K,root:Ce,type:ve}=O,Oe=qo(k);Ps(O,!1),J&&Ac(J),!Oe&&(T=F&&F.onVnodeBeforeMount)&&Vi(T,K,k),Ps(O,!0);{Ce.ce&&Ce.ce._hasShadowRoot()&&Ce.ce._injectChildStyle(ve);const $e=O.subTree=Km(O);v(null,$e,U,q,O,H,Y),k.el=$e.el}if(se&&Tn(se,H),!Oe&&(T=F&&F.onVnodeMounted)){const $e=k;Tn(()=>Vi(T,K,$e),H)}(k.shapeFlag&256||K&&qo(K.vnode)&&K.vnode.shapeFlag&256)&&O.a&&Tn(O.a,H),O.isMounted=!0,k=U=q=null}};O.scope.on();const Q=O.effect=new z_(ae);O.scope.off();const ee=O.update=Q.run.bind(Q),oe=O.job=Q.runIfDirty.bind(Q);oe.i=O,oe.id=O.uid,Q.scheduler=()=>wp(oe),Ps(O,!0),ee()},B=(O,k,U)=>{k.component=O;const q=O.vnode.props;O.vnode=k,O.next=null,Jw(O,k.props,q,U),eM(O,k.children,U),Ur(),zm(O),kr()},z=(O,k,U,q,H,Y,C,ae,Q=!1)=>{const ee=O&&O.children,oe=O?O.shapeFlag:0,T=k.children,{patchFlag:S,shapeFlag:F}=k;if(S>0){if(S&128){le(ee,T,U,q,H,Y,C,ae,Q);return}else if(S&256){de(ee,T,U,q,H,Y,C,ae,Q);return}}F&8?(oe&16&&ce(ee,H,Y),T!==ee&&u(U,T)):oe&16?F&16?le(ee,T,U,q,H,Y,C,ae,Q):ce(ee,H,Y,!0):(oe&8&&u(U,""),F&16&&D(T,U,q,H,Y,C,ae,Q))},de=(O,k,U,q,H,Y,C,ae,Q)=>{O=O||Vo,k=k||Vo;const ee=O.length,oe=k.length,T=Math.min(ee,oe);let S;for(S=0;Soe?ce(O,H,Y,!0,!1,T):D(k,U,q,H,Y,C,ae,Q,T)},le=(O,k,U,q,H,Y,C,ae,Q)=>{let ee=0;const oe=k.length;let T=O.length-1,S=oe-1;for(;ee<=T&&ee<=S;){const F=O[ee],J=k[ee]=Q?wr(k[ee]):$i(k[ee]);if(qs(F,J))v(F,J,U,null,H,Y,C,ae,Q);else break;ee++}for(;ee<=T&&ee<=S;){const F=O[T],J=k[S]=Q?wr(k[S]):$i(k[S]);if(qs(F,J))v(F,J,U,null,H,Y,C,ae,Q);else break;T--,S--}if(ee>T){if(ee<=S){const F=S+1,J=FS)for(;ee<=T;)He(O[ee],H,Y,!0),ee++;else{const F=ee,J=ee,se=new Map;for(ee=J;ee<=S;ee++){const Pe=k[ee]=Q?wr(k[ee]):$i(k[ee]);Pe.key!=null&&se.set(Pe.key,ee)}let K,Ce=0;const ve=S-J+1;let Oe=!1,$e=0;const ge=new Array(ve);for(ee=0;ee=ve){He(Pe,H,Y,!0);continue}let Be;if(Pe.key!=null)Be=se.get(Pe.key);else for(K=J;K<=S;K++)if(ge[K-J]===0&&qs(Pe,k[K])){Be=K;break}Be===void 0?He(Pe,H,Y,!0):(ge[Be-J]=ee+1,Be>=$e?$e=Be:Oe=!0,v(Pe,k[Be],U,null,H,Y,C,ae,Q),Ce++)}const Ee=Oe?rM(ge):Vo;for(K=Ee.length-1,ee=ve-1;ee>=0;ee--){const Pe=J+ee,Be=k[Pe],we=k[Pe+1],dt=Pe+1{const{el:Y,type:C,transition:ae,children:Q,shapeFlag:ee}=O;if(ee&6){pe(O.component.subTree,k,U,q);return}if(ee&128){O.suspense.move(k,U,q);return}if(ee&64){C.move(O,k,U,Ae);return}if(C===Kt){i(Y,k,U);for(let T=0;Tae.enter(Y),H);else{const{leave:T,delayLeave:S,afterLeave:F}=ae,J=()=>{O.ctx.isUnmounted?r(Y):i(Y,k,U)},se=()=>{Y._isLeaving&&Y[Xi](!0),T(Y,()=>{J(),F&&F()})};S?S(Y,J,se):se()}else i(Y,k,U)},He=(O,k,U,q=!1,H=!1)=>{const{type:Y,props:C,ref:ae,children:Q,dynamicChildren:ee,shapeFlag:oe,patchFlag:T,dirs:S,cacheIndex:F}=O;if(T===-2&&(H=!1),ae!=null&&(Ur(),ja(ae,null,U,O,!0),kr()),F!=null&&(k.renderCache[F]=void 0),oe&256){k.ctx.deactivate(O);return}const J=oe&1&&S,se=!qo(O);let K;if(se&&(K=C&&C.onVnodeBeforeUnmount)&&Vi(K,k,O),oe&6)xt(O.component,U,q);else{if(oe&128){O.suspense.unmount(U,q);return}J&&Cs(O,null,k,"beforeUnmount"),oe&64?O.type.remove(O,k,U,Ae,q):ee&&!ee.hasOnce&&(Y!==Kt||T>0&&T&64)?ce(ee,k,U,!1,!0):(Y===Kt&&T&384||!H&&oe&16)&&ce(Q,k,U),q&&ze(O)}(se&&(K=C&&C.onVnodeUnmounted)||J)&&Tn(()=>{K&&Vi(K,k,O),J&&Cs(O,null,k,"unmounted")},U)},ze=O=>{const{type:k,el:U,anchor:q,transition:H}=O;if(k===Kt){st(U,q);return}if(k===Od){x(O);return}const Y=()=>{r(U),H&&!H.persisted&&H.afterLeave&&H.afterLeave()};if(O.shapeFlag&1&&H&&!H.persisted){const{leave:C,delayLeave:ae}=H,Q=()=>C(U,Y);ae?ae(O.el,Y,Q):Q()}else Y()},st=(O,k)=>{let U;for(;O!==k;)U=f(O),r(O),O=U;r(k)},xt=(O,k,U)=>{const{bum:q,scope:H,job:Y,subTree:C,um:ae,m:Q,a:ee}=O;eg(Q),eg(ee),q&&Ac(q),H.stop(),Y&&(Y.flags|=8,He(C,O,k,U)),ae&&Tn(ae,k),Tn(()=>{O.isUnmounted=!0},k)},ce=(O,k,U,q=!1,H=!1,Y=0)=>{for(let C=Y;C{if(O.shapeFlag&6)return ue(O.component.subTree);if(O.shapeFlag&128)return O.suspense.next();const k=f(O.anchor||O.el),U=k&&k[hx];return U?f(U):k};let Le=!1;const je=(O,k,U)=>{let q;O==null?k._vnode&&(He(k._vnode,null,null,!0),q=k._vnode.component):v(k._vnode||null,O,k,null,null,null,U),k._vnode=O,Le||(Le=!0,zm(q),lx(),Le=!1)},Ae={p:v,um:He,m:pe,r:ze,mt:$,mc:D,pc:z,pbc:w,n:ue,o:t};return{render:je,hydrate:void 0,createApp:Vw(je)}}function Ld({type:t,props:e},n){return n==="svg"&&t==="foreignObject"||n==="mathml"&&t==="annotation-xml"&&e&&e.encoding&&e.encoding.includes("html")?void 0:n}function Ps({effect:t,job:e},n){n?(t.flags|=32,e.flags|=4):(t.flags&=-33,e.flags&=-5)}function iM(t,e){return(!t||t&&!t.pendingBranch)&&e&&!e.persisted}function Cp(t,e,n=!1){const i=t.children,r=e.children;if(Qe(i)&&Qe(r))for(let s=0;s>1,t[n[a]]0&&(e[i]=n[s-1]),n[s]=i)}}for(s=n.length,o=n[s-1];s-- >0;)n[s]=o,o=e[o];return n}function Bx(t){const e=t.subTree.component;if(e)return e.asyncDep&&!e.asyncResolved?e:Bx(e)}function eg(t){if(t)for(let e=0;et.__isSuspense;function sM(t,e){e&&e.pendingBranch?Qe(t)?e.effects.push(...t):e.effects.push(t):dw(t)}const Kt=Symbol.for("v-fgt"),Lu=Symbol.for("v-txt"),xn=Symbol.for("v-cmt"),Od=Symbol.for("v-stc"),Ja=[];let ci=null;function me(t=!1){Ja.push(ci=t?null:[])}function oM(){Ja.pop(),ci=Ja[Ja.length-1]||null}let rl=1;function Kc(t,e=!1){rl+=t,t<0&&ci&&e&&(ci.hasOnce=!0)}function Hx(t){return t.dynamicChildren=rl>0?ci||Vo:null,oM(),rl>0&&ci&&ci.push(t),t}function Ct(t,e,n,i,r,s){return Hx(Ye(t,e,n,i,r,s,!0))}function Ie(t,e,n,i,r){return Hx(ie(t,e,n,i,r,!0))}function sl(t){return t?t.__v_isVNode===!0:!1}function qs(t,e){return t.type===e.type&&t.key===e.key}const Gx=({key:t})=>t??null,Rc=({ref:t,ref_key:e,ref_for:n})=>(typeof t=="number"&&(t=""+t),t!=null?Xt(t)||en(t)||ot(t)?{i:bn,r:t,k:e,f:!!n}:t:null);function Ye(t,e=null,n=null,i=0,r=null,s=t===Kt?0:1,o=!1,a=!1){const l={__v_isVNode:!0,__v_skip:!0,type:t,props:e,key:e&&Gx(e),ref:e&&Rc(e),scopeId:ux,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:bn};return a?(Pp(l,n),s&128&&t.normalize(l)):n&&(l.shapeFlag|=Xt(n)?8:16),rl>0&&!o&&ci&&(l.patchFlag>0||s&6)&&l.patchFlag!==32&&ci.push(l),l}const ie=aM;function aM(t,e=null,n=null,i=0,r=null,s=!1){if((!t||t===Mx)&&(t=xn),sl(t)){const a=Hr(t,e,!0);return n&&Pp(a,n),rl>0&&!s&&ci&&(a.shapeFlag&6?ci[ci.indexOf(t)]=a:ci.push(a)),a.patchFlag=-2,a}if(gM(t)&&(t=t.__vccOpts),e){e=Yr(e);let{class:a,style:l}=e;a&&!Xt(a)&&(e.class=Qt(a)),Et(l)&&(Au(l)&&!Qe(l)&&(l=dn({},l)),e.style=$r(l))}const o=Xt(t)?1:Vx(t)?128:px(t)?64:Et(t)?4:ot(t)?2:0;return Ye(t,e,n,i,r,o,s,!0)}function Yr(t){return t?Au(t)||Nx(t)?dn({},t):t:null}function Hr(t,e,n=!1,i=!1){const{props:r,ref:s,patchFlag:o,children:a,transition:l}=t,c=e?It(r||{},e):r,u={__v_isVNode:!0,__v_skip:!0,type:t.type,props:c,key:c&&Gx(c),ref:e&&e.ref?n&&s?Qe(s)?s.concat(Rc(e)):[s,Rc(e)]:Rc(e):s,scopeId:t.scopeId,slotScopeIds:t.slotScopeIds,children:a,target:t.target,targetStart:t.targetStart,targetAnchor:t.targetAnchor,staticCount:t.staticCount,shapeFlag:t.shapeFlag,patchFlag:e&&t.type!==Kt?o===-1?16:o|16:o,dynamicProps:t.dynamicProps,dynamicChildren:t.dynamicChildren,appContext:t.appContext,dirs:t.dirs,transition:l,component:t.component,suspense:t.suspense,ssContent:t.ssContent&&Hr(t.ssContent),ssFallback:t.ssFallback&&Hr(t.ssFallback),placeholder:t.placeholder,el:t.el,anchor:t.anchor,ctx:t.ctx,ce:t.ce};return l&&i&&il(u,l.clone(u)),u}function zt(t=" ",e=0){return ie(Lu,null,t,e)}function fi(t="",e=!1){return e?(me(),Ie(xn,null,t)):ie(xn,null,t)}function $i(t){return t==null||typeof t=="boolean"?ie(xn):Qe(t)?ie(Kt,null,t.slice()):sl(t)?wr(t):ie(Lu,null,String(t))}function wr(t){return t.el===null&&t.patchFlag!==-1||t.memo?t:Hr(t)}function Pp(t,e){let n=0;const{shapeFlag:i}=t;if(e==null)e=null;else if(Qe(e))n=16;else if(typeof e=="object")if(i&65){const r=e.default;r&&(r._c&&(r._d=!1),Pp(t,r()),r._c&&(r._d=!0));return}else{n=32;const r=e._;!r&&!Nx(e)?e._ctx=bn:r===3&&bn&&(bn.slots._===1?e._=1:(e._=2,t.patchFlag|=1024))}else ot(e)?(e={default:e,_ctx:bn},n=32):(e=String(e),i&64?(n=16,e=[zt(e)]):n=8);t.children=e,t.shapeFlag|=n}function It(...t){const e={};for(let n=0;nRn||bn;let Zc,ih;{const t=Su(),e=(n,i)=>{let r;return(r=t[n])||(r=t[n]=[]),r.push(i),s=>{r.length>1?r.forEach(o=>o(s)):r[0](s)}};Zc=e("__VUE_INSTANCE_SETTERS__",n=>Rn=n),ih=e("__VUE_SSR_SETTERS__",n=>ol=n)}const yl=t=>{const e=Rn;return Zc(t),t.scope.on(),()=>{t.scope.off(),Zc(e)}},tg=()=>{Rn&&Rn.scope.off(),Zc(null)};function Wx(t){return t.vnode.shapeFlag&4}let ol=!1;function dM(t,e=!1,n=!1){e&&ih(e);const{props:i,children:r}=t.vnode,s=Wx(t);Yw(t,i,s,e),Qw(t,r,n||e);const o=s?fM(t,e):void 0;return e&&ih(!1),o}function fM(t,e){const n=t.type;t.accessCache=Object.create(null),t.proxy=new Proxy(t.ctx,Nw);const{setup:i}=n;if(i){Ur();const r=t.setupContext=i.length>1?pM(t):null,s=yl(t),o=xl(i,t,0,[t.props,r]),a=R_(o);if(kr(),s(),(a||t.sp)&&!qo(t)&&bx(t),a){if(o.then(tg,tg),e)return o.then(l=>{ng(t,l)}).catch(l=>{Pu(l,t,0)});t.asyncDep=o}else ng(t,o)}else qx(t)}function ng(t,e,n){ot(e)?t.type.__ssrInlineRender?t.ssrRender=e:t.render=e:Et(e)&&(t.setupState=rx(e)),qx(t)}function qx(t,e,n){const i=t.type;t.render||(t.render=i.render||Qi);{const r=yl(t);Ur();try{Ow(t)}finally{kr(),r()}}}const hM={get(t,e){return Pn(t,"get",""),t[e]}};function pM(t){const e=n=>{t.exposed=n||{}};return{attrs:new Proxy(t.attrs,hM),slots:t.slots,emit:t.emit,expose:e}}function Ou(t){return t.exposed?t.exposeProxy||(t.exposeProxy=new Proxy(rx(nx(t.exposed)),{get(e,n){if(n in e)return e[n];if(n in Ya)return Ya[n](t)},has(e,n){return n in e||n in Ya}})):t.proxy}function mM(t,e=!0){return ot(t)?t.displayName||t.name:t.name||e&&t.__name}function gM(t){return ot(t)&&"__vccOpts"in t}const Me=(t,e)=>ow(t,e,ol);function er(t,e,n){try{Kc(-1);const i=arguments.length;return i===2?Et(e)&&!Qe(e)?sl(e)?ie(t,null,[e]):ie(t,e):ie(t,null,e):(i>3?n=Array.prototype.slice.call(arguments,2):i===3&&sl(n)&&(n=[n]),ie(t,e,n))}finally{Kc(1)}}const vM="3.5.28";let rh;const ig=typeof window<"u"&&window.trustedTypes;if(ig)try{rh=ig.createPolicy("vue",{createHTML:t=>t})}catch{}const Xx=rh?t=>rh.createHTML(t):t=>t,_M="http://www.w3.org/2000/svg",xM="http://www.w3.org/1998/Math/MathML",Sr=typeof document<"u"?document:null,rg=Sr&&Sr.createElement("template"),yM={insert:(t,e,n)=>{e.insertBefore(t,n||null)},remove:t=>{const e=t.parentNode;e&&e.removeChild(t)},createElement:(t,e,n,i)=>{const r=e==="svg"?Sr.createElementNS(_M,t):e==="mathml"?Sr.createElementNS(xM,t):n?Sr.createElement(t,{is:n}):Sr.createElement(t);return t==="select"&&i&&i.multiple!=null&&r.setAttribute("multiple",i.multiple),r},createText:t=>Sr.createTextNode(t),createComment:t=>Sr.createComment(t),setText:(t,e)=>{t.nodeValue=e},setElementText:(t,e)=>{t.textContent=e},parentNode:t=>t.parentNode,nextSibling:t=>t.nextSibling,querySelector:t=>Sr.querySelector(t),setScopeId(t,e){t.setAttribute(e,"")},insertStaticContent(t,e,n,i,r,s){const o=n?n.previousSibling:e.lastChild;if(r&&(r===s||r.nextSibling))for(;e.insertBefore(r.cloneNode(!0),n),!(r===s||!(r=r.nextSibling)););else{rg.innerHTML=Xx(i==="svg"?`${t}`:i==="mathml"?`${t}`:t);const a=rg.content;if(i==="svg"||i==="mathml"){const l=a.firstChild;for(;l.firstChild;)a.appendChild(l.firstChild);a.removeChild(l)}e.insertBefore(a,n)}return[o?o.nextSibling:e.firstChild,n?n.previousSibling:e.lastChild]}},Qr="transition",ba="animation",al=Symbol("_vtc"),$x={name:String,type:String,css:{type:Boolean,default:!0},duration:[String,Number,Object],enterFromClass:String,enterActiveClass:String,enterToClass:String,appearFromClass:String,appearActiveClass:String,appearToClass:String,leaveFromClass:String,leaveActiveClass:String,leaveToClass:String},bM=dn({},gx,$x),SM=t=>(t.displayName="Transition",t.props=bM,t),wM=SM((t,{slots:e})=>er(xw,MM(t),e)),Rs=(t,e=[])=>{Qe(t)?t.forEach(n=>n(...e)):t&&t(...e)},sg=t=>t?Qe(t)?t.some(e=>e.length>1):t.length>1:!1;function MM(t){const e={};for(const L in t)L in $x||(e[L]=t[L]);if(t.css===!1)return e;const{name:n="v",type:i,duration:r,enterFromClass:s=`${n}-enter-from`,enterActiveClass:o=`${n}-enter-active`,enterToClass:a=`${n}-enter-to`,appearFromClass:l=s,appearActiveClass:c=o,appearToClass:u=a,leaveFromClass:d=`${n}-leave-from`,leaveActiveClass:f=`${n}-leave-active`,leaveToClass:h=`${n}-leave-to`}=t,g=EM(r),v=g&&g[0],m=g&&g[1],{onBeforeEnter:p,onEnter:_,onEnterCancelled:y,onLeave:x,onLeaveCancelled:M,onBeforeAppear:A=p,onAppear:P=_,onAppearCancelled:D=y}=e,b=(L,V,$,X)=>{L._enterCancelled=X,Ds(L,V?u:a),Ds(L,V?c:o),$&&$()},w=(L,V)=>{L._isLeaving=!1,Ds(L,d),Ds(L,h),Ds(L,f),V&&V()},I=L=>(V,$)=>{const X=L?P:_,W=()=>b(V,L,$);Rs(X,[V,W]),og(()=>{Ds(V,L?l:s),pr(V,L?u:a),sg(X)||ag(V,i,v,W)})};return dn(e,{onBeforeEnter(L){Rs(p,[L]),pr(L,s),pr(L,o)},onBeforeAppear(L){Rs(A,[L]),pr(L,l),pr(L,c)},onEnter:I(!1),onAppear:I(!0),onLeave(L,V){L._isLeaving=!0;const $=()=>w(L,V);pr(L,d),L._enterCancelled?(pr(L,f),ug(L)):(ug(L),pr(L,f)),og(()=>{L._isLeaving&&(Ds(L,d),pr(L,h),sg(x)||ag(L,i,m,$))}),Rs(x,[L,$])},onEnterCancelled(L){b(L,!1,void 0,!0),Rs(y,[L])},onAppearCancelled(L){b(L,!0,void 0,!0),Rs(D,[L])},onLeaveCancelled(L){w(L),Rs(M,[L])}})}function EM(t){if(t==null)return null;if(Et(t))return[Fd(t.enter),Fd(t.leave)];{const e=Fd(t);return[e,e]}}function Fd(t){return SS(t)}function pr(t,e){e.split(/\s+/).forEach(n=>n&&t.classList.add(n)),(t[al]||(t[al]=new Set)).add(e)}function Ds(t,e){e.split(/\s+/).forEach(i=>i&&t.classList.remove(i));const n=t[al];n&&(n.delete(e),n.size||(t[al]=void 0))}function og(t){requestAnimationFrame(()=>{requestAnimationFrame(t)})}let TM=0;function ag(t,e,n,i){const r=t._endId=++TM,s=()=>{r===t._endId&&i()};if(n!=null)return setTimeout(s,n);const{type:o,timeout:a,propCount:l}=AM(t,e);if(!o)return i();const c=o+"end";let u=0;const d=()=>{t.removeEventListener(c,f),s()},f=h=>{h.target===t&&++u>=l&&d()};setTimeout(()=>{u(n[g]||"").split(", "),r=i(`${Qr}Delay`),s=i(`${Qr}Duration`),o=lg(r,s),a=i(`${ba}Delay`),l=i(`${ba}Duration`),c=lg(a,l);let u=null,d=0,f=0;e===Qr?o>0&&(u=Qr,d=o,f=s.length):e===ba?c>0&&(u=ba,d=c,f=l.length):(d=Math.max(o,c),u=d>0?o>c?Qr:ba:null,f=u?u===Qr?s.length:l.length:0);const h=u===Qr&&/\b(?:transform|all)(?:,|$)/.test(i(`${Qr}Property`).toString());return{type:u,timeout:d,propCount:f,hasTransform:h}}function lg(t,e){for(;t.lengthcg(n)+cg(t[i])))}function cg(t){return t==="auto"?0:Number(t.slice(0,-1).replace(",","."))*1e3}function ug(t){return(t?t.ownerDocument:document).body.offsetHeight}function CM(t,e,n){const i=t[al];i&&(e=(e?[e,...i]:[...i]).join(" ")),e==null?t.removeAttribute("class"):n?t.setAttribute("class",e):t.className=e}const dg=Symbol("_vod"),PM=Symbol("_vsh"),RM=Symbol(""),DM=/(?:^|;)\s*display\s*:/;function IM(t,e,n){const i=t.style,r=Xt(n);let s=!1;if(n&&!r){if(e)if(Xt(e))for(const o of e.split(";")){const a=o.slice(0,o.indexOf(":")).trim();n[a]==null&&Dc(i,a,"")}else for(const o in e)n[o]==null&&Dc(i,o,"");for(const o in n)o==="display"&&(s=!0),Dc(i,o,n[o])}else if(r){if(e!==n){const o=i[RM];o&&(n+=";"+o),i.cssText=n,s=DM.test(n)}}else e&&t.removeAttribute("style");dg in t&&(t[dg]=s?i.display:"",t[PM]&&(i.display="none"))}const fg=/\s*!important$/;function Dc(t,e,n){if(Qe(n))n.forEach(i=>Dc(t,e,i));else if(n==null&&(n=""),e.startsWith("--"))t.setProperty(e,n);else{const i=NM(t,e);fg.test(n)?t.setProperty(bs(i),n.replace(fg,""),"important"):t[i]=n}}const hg=["Webkit","Moz","ms"],Ud={};function NM(t,e){const n=Ud[e];if(n)return n;let i=ei(e);if(i!=="filter"&&i in t)return Ud[e]=i;i=yu(i);for(let r=0;rkd||(UM.then(()=>kd=0),kd=Date.now());function BM(t,e){const n=i=>{if(!i._vts)i._vts=Date.now();else if(i._vts<=n.attached)return;Ii(zM(i,n.value),e,5,[i])};return n.value=t,n.attached=kM(),n}function zM(t,e){if(Qe(e)){const n=t.stopImmediatePropagation;return t.stopImmediatePropagation=()=>{n.call(t),t._stopped=!0},e.map(i=>r=>!r._stopped&&i&&i(r))}else return e}const xg=t=>t.charCodeAt(0)===111&&t.charCodeAt(1)===110&&t.charCodeAt(2)>96&&t.charCodeAt(2)<123,VM=(t,e,n,i,r,s)=>{const o=r==="svg";e==="class"?CM(t,i,o):e==="style"?IM(t,n,i):gu(e)?vp(e)||OM(t,e,n,i,s):(e[0]==="."?(e=e.slice(1),!0):e[0]==="^"?(e=e.slice(1),!1):HM(t,e,i,o))?(gg(t,e,i),!t.tagName.includes("-")&&(e==="value"||e==="checked"||e==="selected")&&mg(t,e,i,o,s,e!=="value")):t._isVueCE&&(/[A-Z]/.test(e)||!Xt(i))?gg(t,ei(e),i,s,e):(e==="true-value"?t._trueValue=i:e==="false-value"&&(t._falseValue=i),mg(t,e,i,o))};function HM(t,e,n,i){if(i)return!!(e==="innerHTML"||e==="textContent"||e in t&&xg(e)&&ot(n));if(e==="spellcheck"||e==="draggable"||e==="translate"||e==="autocorrect"||e==="sandbox"&&t.tagName==="IFRAME"||e==="form"||e==="list"&&t.tagName==="INPUT"||e==="type"&&t.tagName==="TEXTAREA")return!1;if(e==="width"||e==="height"){const r=t.tagName;if(r==="IMG"||r==="VIDEO"||r==="CANVAS"||r==="SOURCE")return!1}return xg(e)&&Xt(n)?!1:e in t}const Qc=t=>{const e=t.props["onUpdate:modelValue"]||!1;return Qe(e)?n=>Ac(e,n):e};function GM(t){t.target.composing=!0}function yg(t){const e=t.target;e.composing&&(e.composing=!1,e.dispatchEvent(new Event("input")))}const $o=Symbol("_assign");function bg(t,e,n){return e&&(t=t.trim()),n&&(t=bu(t)),t}const Sg={created(t,{modifiers:{lazy:e,trim:n,number:i}},r){t[$o]=Qc(r);const s=i||r.props&&r.props.type==="number";Xs(t,e?"change":"input",o=>{o.target.composing||t[$o](bg(t.value,n,s))}),(n||s)&&Xs(t,"change",()=>{t.value=bg(t.value,n,s)}),e||(Xs(t,"compositionstart",GM),Xs(t,"compositionend",yg),Xs(t,"change",yg))},mounted(t,{value:e}){t.value=e??""},beforeUpdate(t,{value:e,oldValue:n,modifiers:{lazy:i,trim:r,number:s}},o){if(t[$o]=Qc(o),t.composing)return;const a=(s||t.type==="number")&&!/^0\d/.test(t.value)?bu(t.value):t.value,l=e??"";a!==l&&(document.activeElement===t&&t.type!=="range"&&(i&&e===n||r&&t.value.trim()===l)||(t.value=l))}},jx={deep:!0,created(t,{value:e,modifiers:{number:n}},i){const r=vu(e);Xs(t,"change",()=>{const s=Array.prototype.filter.call(t.options,o=>o.selected).map(o=>n?bu(eu(o)):eu(o));t[$o](t.multiple?r?new Set(s):s:s[0]),t._assigning=!0,Vr(()=>{t._assigning=!1})}),t[$o]=Qc(i)},mounted(t,{value:e}){wg(t,e)},beforeUpdate(t,e,n){t[$o]=Qc(n)},updated(t,{value:e}){t._assigning||wg(t,e)}};function wg(t,e){const n=t.multiple,i=Qe(e);if(!(n&&!i&&!vu(e))){for(let r=0,s=t.options.length;rString(c)===String(a)):o.selected=RS(e,a)>-1}else o.selected=e.has(a);else if(_l(eu(o),e)){t.selectedIndex!==r&&(t.selectedIndex=r);return}}!n&&t.selectedIndex!==-1&&(t.selectedIndex=-1)}}function eu(t){return"_value"in t?t._value:t.value}const WM=["ctrl","shift","alt","meta"],qM={stop:t=>t.stopPropagation(),prevent:t=>t.preventDefault(),self:t=>t.target!==t.currentTarget,ctrl:t=>!t.ctrlKey,shift:t=>!t.shiftKey,alt:t=>!t.altKey,meta:t=>!t.metaKey,left:t=>"button"in t&&t.button!==0,middle:t=>"button"in t&&t.button!==1,right:t=>"button"in t&&t.button!==2,exact:(t,e)=>WM.some(n=>t[`${n}Key`]&&!e.includes(n))},_i=(t,e)=>{if(!t)return t;const n=t._withMods||(t._withMods={}),i=e.join(".");return n[i]||(n[i]=((r,...s)=>{for(let o=0;o{const n=t._withKeys||(t._withKeys={}),i=e.join(".");return n[i]||(n[i]=(r=>{if(!("key"in r))return;const s=bs(r.key);if(e.some(o=>o===s||XM[o]===s))return t(r)}))},$M=dn({patchProp:VM},yM);let Mg;function jM(){return Mg||(Mg=tM($M))}const YM=((...t)=>{const e=jM().createApp(...t),{mount:n}=e;return e.mount=i=>{const r=KM(i);if(!r)return;const s=e._component;!ot(s)&&!s.render&&!s.template&&(s.template=r.innerHTML),r.nodeType===1&&(r.textContent="");const o=n(r,!1,JM(r));return r instanceof Element&&(r.removeAttribute("v-cloak"),r.setAttribute("data-v-app","")),o},e});function JM(t){if(t instanceof SVGElement)return"svg";if(typeof MathMLElement=="function"&&t instanceof MathMLElement)return"mathml"}function KM(t){return Xt(t)?document.querySelector(t):t}const Ti=On({title:"Object Infos",isVisible:!1,data:null}),Rp=On([]),Ic=On({title:"Sidebar Infos",isVisible:!1,data:null}),yn=On({value:!0}),Nr=On({value:"translate"}),Fu=On({value:!1}),Yx=On({value:!1}),qn=On({value:"light"});function Jx(t){var e,n,i="";if(typeof t=="string"||typeof t=="number")i+=t;else if(typeof t=="object")if(Array.isArray(t)){var r=t.length;for(e=0;etypeof t=="boolean"?`${t}`:t===0?"0":t,Tg=Kx,ZM=(t,e)=>n=>{var i;if(e?.variants==null)return Tg(t,n?.class,n?.className);const{variants:r,defaultVariants:s}=e,o=Object.keys(r).map(c=>{const u=n?.[c],d=s?.[c];if(u===null)return null;const f=Eg(u)||Eg(d);return r[c][f]}),a=n&&Object.entries(n).reduce((c,u)=>{let[d,f]=u;return f===void 0||(c[d]=f),c},{}),l=e==null||(i=e.compoundVariants)===null||i===void 0?void 0:i.reduce((c,u)=>{let{class:d,className:f,...h}=u;return Object.entries(h).every(g=>{let[v,m]=g;return Array.isArray(m)?m.includes({...s,...a}[v]):{...s,...a}[v]===m})?[...c,d,f]:c},[]);return Tg(t,o,l,n?.class,n?.className)};function Dp(t,e=Number.NEGATIVE_INFINITY,n=Number.POSITIVE_INFINITY){return Math.min(n,Math.max(e,t))}function Ul(t,e){let n=t;const i=e.toString(),r=i.indexOf("."),s=r>=0?i.length-r:0;if(s>0){const o=10**s;n=Math.round(n*o)/o}return n}function QM(t,e,n,i){e=Number(e),n=Number(n);const r=(t-(Number.isNaN(e)?0:e))%i;let s=Ul(Math.abs(r)*2>=i?t+Math.sign(r)*(i-Math.abs(r)):t-r,i);return Number.isNaN(e)?!Number.isNaN(n)&&s>n&&(s=Math.floor(Ul(n/i,i))*i):sn&&(s=e+Math.floor(Ul((n-e)/i,i))*i),s=Ul(s,i),s}function Jr(t,e){const n=typeof t=="string"&&!e?`${t}Context`:e,i=Symbol(n);return[o=>{const a=Wo(i,o);if(a||a===null)return a;throw new Error(`Injection \`${i.toString()}\` not found. Component must be used within ${Array.isArray(t)?`one of the following components: ${t.join(", ")}`:`\`${t}\``}`)},o=>(Mp(i,o),o)]}function to(){let t=document.activeElement;if(t==null)return null;for(;t!=null&&t.shadowRoot!=null&&t.shadowRoot.activeElement!=null;)t=t.shadowRoot.activeElement;return t}function Zx(t,e,n){const i=n.originalEvent.target,r=new CustomEvent(t,{bubbles:!1,cancelable:!0,detail:n});e&&i.addEventListener(t,e,{once:!0}),i.dispatchEvent(r)}function Nc(t){return t==null}function e1(t,e){var n;const i=Cu();return Wn(()=>{i.value=t()},{...e,flush:(n=e?.flush)!==null&&n!==void 0?n:"sync"}),qc(i)}function bl(t,e){return xp()?(B_(t,e),!0):!1}function Qx(){const t=new Set,e=s=>{t.delete(s)};return{on:s=>{t.add(s);const o=()=>e(s);return bl(o),{off:o}},off:e,trigger:(...s)=>Promise.all(Array.from(t).map(o=>o(...s))),clear:()=>{t.clear()}}}function t1(t){let e=!1,n;const i=k_(!0);return((...r)=>(e||(n=i.run(()=>t(...r)),e=!0),n))}const Ui=typeof window<"u"&&typeof document<"u";typeof WorkerGlobalScope<"u"&&globalThis instanceof WorkerGlobalScope;const n1=t=>typeof t<"u",i1=Object.prototype.toString,r1=t=>i1.call(t)==="[object Object]",Ag=s1();function s1(){var t,e,n;return Ui&&!!(!((t=window)===null||t===void 0||(t=t.navigator)===null||t===void 0)&&t.userAgent)&&(/iP(?:ad|hone|od)/.test(window.navigator.userAgent)||((e=window)===null||e===void 0||(e=e.navigator)===null||e===void 0?void 0:e.maxTouchPoints)>2&&/iPad|Macintosh/.test((n=window)===null||n===void 0?void 0:n.navigator.userAgent))}function Bd(t){return Array.isArray(t)?t:[t]}function o1(t){return or()}function a1(t){if(!Ui)return t;let e=0,n,i;const r=()=>{e-=1,i&&e<=0&&(i.stop(),n=void 0,i=void 0)};return((...s)=>(e+=1,i||(i=k_(!0),n=i.run(()=>t(...s))),bl(r),n))}function l1(t){return On(en(t)?new Proxy({},{get(e,n,i){return E(Reflect.get(t.value,n,i))},set(e,n,i){return en(t.value[n])&&!en(i)?t.value[n].value=i:t.value[n]=i,!0},deleteProperty(e,n){return Reflect.deleteProperty(t.value,n)},has(e,n){return Reflect.has(t.value,n)},ownKeys(){return Object.keys(t.value)},getOwnPropertyDescriptor(){return{enumerable:!0,configurable:!0}}}):t)}function Ip(t){return l1(Me(t))}function co(t,...e){const n=e.flat(),i=n[0];return Ip(()=>Object.fromEntries(typeof i=="function"?Object.entries(zr(t)).filter(([r,s])=>!i(Nn(s),r)):Object.entries(zr(t)).filter(r=>!n.includes(r[0]))))}function c1(t,e=1e4){return tw((n,i)=>{let r=Nn(t),s;const o=()=>setTimeout(()=>{r=Nn(t),i()},Nn(e));return bl(()=>{clearTimeout(s)}),{get(){return n(),r},set(a){r=a,i(),clearTimeout(s),s=o()}}})}function u1(t,e){o1()&&da(t,e)}function ey(t,e,n={}){const{immediate:i=!0,immediateCallback:r=!1}=n,s=Cu(!1);let o;function a(){o&&(clearTimeout(o),o=void 0)}function l(){s.value=!1,a()}function c(...u){r&&t(),a(),s.value=!0,o=setTimeout(()=>{s.value=!1,o=void 0,t(...u)},Nn(e))}return i&&(s.value=!0,Ui&&c()),bl(l),{isPending:Hs(s),start:c,stop:l}}function d1(t,e,n){return rn(t,e,{...n,immediate:!0})}const Np=Ui?window:void 0;function ws(t){var e;const n=Nn(t);return(e=n?.$el)!==null&&e!==void 0?e:n}function no(...t){const e=(i,r,s,o)=>(i.addEventListener(r,s,o),()=>i.removeEventListener(r,s,o)),n=Me(()=>{const i=Bd(Nn(t[0])).filter(r=>r!=null);return i.every(r=>typeof r!="string")?i:void 0});return d1(()=>{var i,r;return[(i=(r=n.value)===null||r===void 0?void 0:r.map(s=>ws(s)))!==null&&i!==void 0?i:[Np].filter(s=>s!=null),Bd(Nn(n.value?t[1]:t[0])),Bd(E(n.value?t[2]:t[1])),Nn(n.value?t[3]:t[2])]},([i,r,s,o],a,l)=>{if(!i?.length||!r?.length||!s?.length)return;const c=r1(o)?{...o}:o,u=i.flatMap(d=>r.flatMap(f=>s.map(h=>e(d,f,h,c))));l(()=>{u.forEach(d=>d())})},{flush:"post"})}function ty(){const t=Cu(!1),e=or();return e&&ti(()=>{t.value=!0},e),t}function f1(t){return typeof t=="function"?t:typeof t=="string"?e=>e.key===t:Array.isArray(t)?e=>t.includes(e.key):()=>!0}function h1(...t){let e,n,i={};t.length===3?(e=t[0],n=t[1],i=t[2]):t.length===2?typeof t[1]=="object"?(e=!0,n=t[0],i=t[1]):(e=t[0],n=t[1]):(e=!0,n=t[0]);const{target:r=Np,eventName:s="keydown",passive:o=!1,dedupe:a=!1}=i,l=f1(e);return no(r,s,u=>{u.repeat&&Nn(a)||l(u)&&n(u)},o)}function p1(t){return JSON.parse(JSON.stringify(t))}function Uu(t,e,n,i={}){var r,s;const{clone:o=!1,passive:a=!1,eventName:l,deep:c=!1,defaultValue:u,shouldEmit:d}=i,f=or(),h=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;e||(e="modelValue"),g=g||`update:${e.toString()}`;const v=_=>o?typeof o=="function"?o(_):p1(_):_,m=()=>n1(t[e])?v(t[e]):u,p=_=>{d?d(_)&&h(g,_):h(g,_)};if(a){const _=ke(m());let y=!1;return rn(()=>t[e],x=>{y||(y=!0,_.value=v(x),Vr(()=>y=!1))}),rn(_,x=>{!y&&(x!==t[e]||c)&&p(x)},{deep:c}),_}else return Me({get(){return m()},set(_){p(_)}})}function Lp(t){return t?t.flatMap(e=>e.type===Kt?Lp(e.children):[e]):[]}const[Op]=Jr("ConfigProvider");function zd(t){if(t===null||typeof t!="object")return!1;const e=Object.getPrototypeOf(t);return e!==null&&e!==Object.prototype&&Object.getPrototypeOf(e)!==null||Symbol.iterator in t?!1:Symbol.toStringTag in t?Object.prototype.toString.call(t)==="[object Module]":!0}function sh(t,e,n=".",i){if(!zd(e))return sh(t,{},n,i);const r={...e};for(const s of Object.keys(t)){if(s==="__proto__"||s==="constructor")continue;const o=t[s];o!=null&&(i&&i(r,s,o,n)||(Array.isArray(o)&&Array.isArray(r[s])?r[s]=[...o,...r[s]]:zd(o)&&zd(r[s])?r[s]=sh(o,r[s],(n?`${n}.`:"")+s.toString(),i):r[s]=o))}return r}function m1(t){return(...e)=>e.reduce((n,i)=>sh(n,i,"",t),{})}const ny=m1(),g1=a1(()=>{const t=ke(new Map),e=ke(),n=Me(()=>{for(const o of t.value.values())if(o)return!0;return!1}),i=Op({scrollBody:ke(!0)});let r=null;const s=()=>{document.body.style.paddingRight="",document.body.style.marginRight="",document.body.style.pointerEvents="",document.documentElement.style.removeProperty("--scrollbar-width"),document.body.style.overflow=e.value??"",Ag&&r?.(),e.value=void 0};return rn(n,(o,a)=>{if(!Ui)return;if(!o){a&&s();return}e.value===void 0&&(e.value=document.body.style.overflow);const l=window.innerWidth-document.documentElement.clientWidth,c={padding:l,margin:0},u=i.scrollBody?.value?typeof i.scrollBody.value=="object"?ny({padding:i.scrollBody.value.padding===!0?l:i.scrollBody.value.padding,margin:i.scrollBody.value.margin===!0?l:i.scrollBody.value.margin},c):c:{padding:0,margin:0};l>0&&(document.body.style.paddingRight=typeof u.padding=="number"?`${u.padding}px`:String(u.padding),document.body.style.marginRight=typeof u.margin=="number"?`${u.margin}px`:String(u.margin),document.documentElement.style.setProperty("--scrollbar-width",`${l}px`),document.body.style.overflow="hidden"),Ag&&(r=no(document,"touchmove",d=>_1(d),{passive:!1})),Vr(()=>{n.value&&(document.body.style.pointerEvents="none",document.body.style.overflow="hidden")})},{immediate:!0,flush:"sync"}),t});function v1(t){const e=Math.random().toString(36).substring(2,7),n=g1();n.value.set(e,t);const i=Me({get:()=>n.value.get(e)??!1,set:r=>n.value.set(e,r)});return u1(()=>{n.value.delete(e)}),i}function iy(t){const e=window.getComputedStyle(t);if(e.overflowX==="scroll"||e.overflowY==="scroll"||e.overflowX==="auto"&&t.clientWidth1?!0:(e.preventDefault&&e.cancelable&&e.preventDefault(),!1)}function x1(t){const e=Op({dir:ke("ltr")});return Me(()=>t?.value||e.dir?.value||"ltr")}function y1(t){const e=or(),n=e?.type.emits,i={};return n?.length||console.warn(`No emitted event found. Please check component: ${e?.type.__name}`),n?.forEach(r=>{i[Wa(ei(r))]=(...s)=>t(r,...s)}),i}let Vd=0;function b1(){Wn(t=>{if(!Ui)return;const e=document.querySelectorAll("[data-reka-focus-guard]");document.body.insertAdjacentElement("afterbegin",e[0]??Cg()),document.body.insertAdjacentElement("beforeend",e[1]??Cg()),Vd++,t(()=>{Vd===1&&document.querySelectorAll("[data-reka-focus-guard]").forEach(n=>n.remove()),Vd--})})}function Cg(){const t=document.createElement("span");return t.setAttribute("data-reka-focus-guard",""),t.tabIndex=0,t.style.outline="none",t.style.opacity="0",t.style.position="fixed",t.style.pointerEvents="none",t}function ry(t){return Me(()=>Nn(t)?!!ws(t)?.closest("form"):!0)}function sn(){const t=or(),e=ke(),n=Me(()=>i());wx(()=>{n.value!==i()&&ZS(e)});function i(){return e.value&&"$el"in e.value&&["#text","#comment"].includes(e.value.$el.nodeName)?e.value.$el.nextElementSibling:ws(e)}const r=Object.assign({},t.exposed),s={};for(const a in t.props)Object.defineProperty(s,a,{enumerable:!0,configurable:!0,get:()=>t.props[a]});if(Object.keys(r).length>0)for(const a in r)Object.defineProperty(s,a,{enumerable:!0,configurable:!0,get:()=>r[a]});Object.defineProperty(s,"$el",{enumerable:!0,configurable:!0,get:()=>t.vnode.el}),t.exposed=s;function o(a){if(e.value=a,!!a&&(Object.defineProperty(s,"$el",{enumerable:!0,configurable:!0,get:()=>a instanceof Element?a:a.$el}),!(a instanceof Element)&&!Object.hasOwn(a,"$el"))){const l=a.$.exposed,c=Object.assign({},s);for(const u in l)Object.defineProperty(c,u,{enumerable:!0,configurable:!0,get:()=>l[u]});t.exposed=c}}return{forwardRef:o,currentRef:e,currentElement:n}}function Sl(t){const e=or(),n=Object.keys(e?.type.props??{}).reduce((r,s)=>{const o=(e?.type.props[s]).default;return o!==void 0&&(r[s]=o),r},{}),i=rw(t);return Me(()=>{const r={},s=e?.vnode.props??{};return Object.keys(s).forEach(o=>{r[ei(o)]=s[o]}),Object.keys({...n,...r}).reduce((o,a)=>(i.value[a]!==void 0&&(o[a]=i.value[a]),o),{})})}function ar(t,e){const n=Sl(t),i=e?y1(e):{};return Me(()=>({...n.value,...i}))}function S1(t,e){const n=c1(!1,300);bl(()=>{n.value=!1});const i=ke(null),r=Qx();function s(){i.value=null,n.value=!1}function o(a,l){if(!l)return;const c=a.currentTarget,u={x:a.clientX,y:a.clientY},d=w1(u,c.getBoundingClientRect()),f=M1(u,d,1),h=E1(l.getBoundingClientRect()),g=A1([...f,...h]);i.value=g,n.value=!0}return Wn(a=>{if(t.value&&e.value){const l=u=>o(u,e.value),c=u=>o(u,t.value);t.value.addEventListener("pointerleave",l),e.value.addEventListener("pointerleave",c),a(()=>{t.value?.removeEventListener("pointerleave",l),e.value?.removeEventListener("pointerleave",c)})}}),Wn(a=>{if(i.value){const l=c=>{if(!i.value||!(c.target instanceof Element))return;const u=c.target,d={x:c.clientX,y:c.clientY},f=t.value?.contains(u)||e.value?.contains(u),h=!T1(d,i.value),g=!!u.closest("[data-grace-area-trigger]");f?s():(h||g)&&(s(),r.trigger())};t.value?.ownerDocument.addEventListener("pointermove",l),a(()=>t.value?.ownerDocument.removeEventListener("pointermove",l))}}),{isPointerInTransit:n,onPointerExit:r.on}}function w1(t,e){const n=Math.abs(e.top-t.y),i=Math.abs(e.bottom-t.y),r=Math.abs(e.right-t.x),s=Math.abs(e.left-t.x);switch(Math.min(n,i,r,s)){case s:return"left";case r:return"right";case n:return"top";case i:return"bottom";default:throw new Error("unreachable")}}function M1(t,e,n=5){const i=[];switch(e){case"top":i.push({x:t.x-n,y:t.y+n},{x:t.x+n,y:t.y+n});break;case"bottom":i.push({x:t.x-n,y:t.y-n},{x:t.x+n,y:t.y-n});break;case"left":i.push({x:t.x+n,y:t.y-n},{x:t.x+n,y:t.y+n});break;case"right":i.push({x:t.x-n,y:t.y-n},{x:t.x-n,y:t.y+n});break}return i}function E1(t){const{top:e,right:n,bottom:i,left:r}=t;return[{x:r,y:e},{x:n,y:e},{x:n,y:i},{x:r,y:i}]}function T1(t,e){const{x:n,y:i}=t;let r=!1;for(let s=0,o=e.length-1;si!=u>i&&n<(c-a)*(i-l)/(u-l)+a&&(r=!r)}return r}function A1(t){const e=t.slice();return e.sort((n,i)=>n.xi.x?1:n.yi.y?1:0),C1(e)}function C1(t){if(t.length<=1)return t.slice();const e=[];for(let i=0;i=2;){const s=e.at(-1),o=e[e.length-2];if((s.x-o.x)*(r.y-o.y)>=(s.y-o.y)*(r.x-o.x))e.pop();else break}e.push(r)}e.pop();const n=[];for(let i=t.length-1;i>=0;i--){const r=t[i];for(;n.length>=2;){const s=n.at(-1),o=n[n.length-2];if((s.x-o.x)*(r.y-o.y)>=(s.y-o.y)*(r.x-o.x))n.pop();else break}n.push(r)}return n.pop(),e.length===1&&n.length===1&&e[0].x===n[0].x&&e[0].y===n[0].y?e:e.concat(n)}var P1=function(t){if(typeof document>"u")return null;var e=Array.isArray(t)?t[0]:t;return e.ownerDocument.body},_o=new WeakMap,kl=new WeakMap,Bl={},Hd=0,sy=function(t){return t&&(t.host||sy(t.parentNode))},R1=function(t,e){return e.map(function(n){if(t.contains(n))return n;var i=sy(n);return i&&t.contains(i)?i:(console.error("aria-hidden",n,"in not contained inside",t,". Doing nothing"),null)}).filter(function(n){return!!n})},D1=function(t,e,n,i){var r=R1(e,Array.isArray(t)?t:[t]);Bl[n]||(Bl[n]=new WeakMap);var s=Bl[n],o=[],a=new Set,l=new Set(r),c=function(d){!d||a.has(d)||(a.add(d),c(d.parentNode))};r.forEach(c);var u=function(d){!d||l.has(d)||Array.prototype.forEach.call(d.children,function(f){if(a.has(f))u(f);else try{var h=f.getAttribute(i),g=h!==null&&h!=="false",v=(_o.get(f)||0)+1,m=(s.get(f)||0)+1;_o.set(f,v),s.set(f,m),o.push(f),v===1&&g&&kl.set(f,!0),m===1&&f.setAttribute(n,"true"),g||f.setAttribute(i,"true")}catch(p){console.error("aria-hidden: cannot operate on ",f,p)}})};return u(e),a.clear(),Hd++,function(){o.forEach(function(d){var f=_o.get(d)-1,h=s.get(d)-1;_o.set(d,f),s.set(d,h),f||(kl.has(d)||d.removeAttribute(i),kl.delete(d)),h||d.removeAttribute(n)}),Hd--,Hd||(_o=new WeakMap,_o=new WeakMap,kl=new WeakMap,Bl={})}},I1=function(t,e,n){n===void 0&&(n="data-aria-hidden");var i=Array.from(Array.isArray(t)?t:[t]),r=P1(t);return r?(i.push.apply(i,Array.from(r.querySelectorAll("[aria-live], script"))),D1(i,r,n,"aria-hidden")):function(){return null}};function N1(t){let e;rn(()=>ws(t),n=>{let i=!1;try{i=!!n?.closest("[popover]:not(:popover-open)")}catch{}n&&!i?e=I1(n):e&&e()}),fa(()=>{e&&e()})}function Fp(t,e="reka"){let n;return n=yw?.(),e?`${e}-${n}`:n}function L1(t){const e=Op({locale:ke("en")});return Me(()=>t?.value||e.locale?.value||"en")}function oy(t){const e=ke(),n=Me(()=>e.value?.width??0),i=Me(()=>e.value?.height??0);return ti(()=>{const r=ws(t);if(r){e.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,d=Array.isArray(u)?u[0]:u;l=d.inlineSize,c=d.blockSize}else l=r.offsetWidth,c=r.offsetHeight;e.value={width:l,height:c}});return s.observe(r,{box:"border-box"}),()=>s.unobserve(r)}else e.value=void 0}),{width:n,height:i}}function O1(t,e){const n=ke(t);function i(s){return e[n.value][s]??n.value}return{state:n,dispatch:s=>{n.value=i(s)}}}function F1(t,e){const n=ke({}),i=ke("none"),r=ke(t),s=t.value?"mounted":"unmounted";let o;const a=e.value?.ownerDocument.defaultView??Np,{state:l,dispatch:c}=O1(s,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}}),u=m=>{if(Ui){const p=new CustomEvent(m,{bubbles:!1,cancelable:!1});e.value?.dispatchEvent(p)}};rn(t,async(m,p)=>{const _=p!==m;if(await Vr(),_){const y=i.value,x=zl(e.value);m?(c("MOUNT"),u("enter"),x==="none"&&u("after-enter")):x==="none"||x==="undefined"||n.value?.display==="none"?(c("UNMOUNT"),u("leave"),u("after-leave")):p&&y!==x?(c("ANIMATION_OUT"),u("leave")):(c("UNMOUNT"),u("after-leave"))}},{immediate:!0});const d=m=>{const p=zl(e.value),_=p.includes(CSS.escape(m.animationName)),y=l.value==="mounted"?"enter":"leave";if(m.target===e.value&&_&&(u(`after-${y}`),c("ANIMATION_END"),!r.value)){const x=e.value.style.animationFillMode;e.value.style.animationFillMode="forwards",o=a?.setTimeout(()=>{e.value?.style.animationFillMode==="forwards"&&(e.value.style.animationFillMode=x)})}m.target===e.value&&p==="none"&&c("ANIMATION_END")},f=m=>{m.target===e.value&&(i.value=zl(e.value))},h=rn(e,(m,p)=>{m?(n.value=getComputedStyle(m),m.addEventListener("animationstart",f),m.addEventListener("animationcancel",d),m.addEventListener("animationend",d)):(c("ANIMATION_END"),o!==void 0&&a?.clearTimeout(o),p?.removeEventListener("animationstart",f),p?.removeEventListener("animationcancel",d),p?.removeEventListener("animationend",d))},{immediate:!0}),g=rn(l,()=>{const m=zl(e.value);i.value=l.value==="mounted"?m:"none"});return fa(()=>{h(),g()}),{isPresent:Me(()=>["mounted","unmountSuspended"].includes(l.value))}}function zl(t){return t&&getComputedStyle(t).animationName||"none"}var ay=Ne({name:"Presence",props:{present:{type:Boolean,required:!0},forceMount:{type:Boolean}},slots:{},setup(t,{slots:e,expose:n}){const{present:i,forceMount:r}=zr(t),s=ke(),{isPresent:o}=F1(i,s);n({present:o});let a=e.default({present:o.value});a=Lp(a||[]);const l=or();if(a&&a?.length>1){const c=l?.parent?.type.name?`<${l.parent.type.name} />`:"component";throw new Error([`Detected an invalid children for \`${c}\` for \`Presence\` component.`,"","Note: Presence works similarly to `v-if` directly, but it waits for animation/transition to finished before unmounting. So it expect only one direct child of valid VNode type.","You can apply a few solutions:",["Provide a single child element so that `presence` directive attach correctly.","Ensure the first child is an actual element instead of a raw text node or comment node."].map(u=>` - ${u}`).join(` `)].join(` -`))}return()=>r.value||i.value||o.value?er(e.default({present:o.value})[0],{ref:c=>{const u=ws(c);return typeof u?.hasAttribute>"u"||(u?.hasAttribute("data-reka-popper-content-wrapper")?s.value=u.firstElementChild:s.value=u),u}}):null}});const oh=Ne({name:"PrimitiveSlot",inheritAttrs:!1,setup(t,{attrs:e,slots:n}){return()=>{if(!n.default)return null;const i=Lp(n.default()),r=i.findIndex(l=>l.type!==xn);if(r===-1)return i;const s=i[r];delete s.props?.ref;const o=s.props?It(e,s.props):e,a=Hr({...s,props:{}},o);return i.length===1?a:(i[r]=a,i)}}}),U1=["area","img","input"],wn=Ne({name:"Primitive",inheritAttrs:!1,props:{asChild:{type:Boolean,default:!1},as:{type:[String,Object],default:"div"}},setup(t,{attrs:e,slots:n}){const i=t.asChild?"template":t.as;return typeof i=="string"&&U1.includes(i)?()=>er(i,e):i!=="template"?()=>er(t.as,e,{default:n.default}):()=>er(oh,e,{default:n.default})}});function ro(){const t=ke(),e=we(()=>["#text","#comment"].includes(t.value?.$el.nodeName)?t.value?.$el.nextElementSibling:ws(t));return{primitiveElement:t,currentElement:e}}const k1="dismissableLayer.pointerDownOutside",B1="dismissableLayer.focusOutside";function ly(t,e){if(!(e instanceof Element))return!1;const n=e.closest("[data-dismissable-layer]"),i=t.dataset.dismissableLayer===""?t:t.querySelector("[data-dismissable-layer]"),r=Array.from(t.ownerDocument.querySelectorAll("[data-dismissable-layer]"));return!!(n&&(i===n||r.indexOf(i){});return Wn(o=>{if(!Ui||!Nn(n))return;const a=async c=>{const u=c.target;if(!(!e?.value||!u)){if(ly(e.value,u)){r.value=!1;return}if(c.target&&!r.value){let h=function(){Zx(k1,t,f)};var d=h;const f={originalEvent:c};c.pointerType==="touch"?(i.removeEventListener("click",s.value),s.value=h,i.addEventListener("click",s.value,{once:!0})):h()}else i.removeEventListener("click",s.value);r.value=!1}},l=window.setTimeout(()=>{i.addEventListener("pointerdown",a)},0);o(()=>{window.clearTimeout(l),i.removeEventListener("pointerdown",a),i.removeEventListener("click",s.value)})}),{onPointerDownCapture:()=>{Nn(n)&&(r.value=!0)}}}function V1(t,e,n=!0){const i=e?.value?.ownerDocument??globalThis?.document,r=ke(!1);return Wn(s=>{if(!Ui||!Nn(n))return;const o=async a=>{if(!e?.value)return;await Vr(),await Vr();const l=a.target;!e.value||!l||ly(e.value,l)||a.target&&!r.value&&Zx(B1,t,{originalEvent:a})};i.addEventListener("focusin",o),s(()=>i.removeEventListener("focusin",o))}),{onFocusCapture:()=>{Nn(n)&&(r.value=!0)},onBlurCapture:()=>{Nn(n)&&(r.value=!1)}}}const gi=On({layersRoot:new Set,layersWithOutsidePointerEventsDisabled:new Set,originalBodyPointerEvents:void 0,branches:new Set});var H1=Ne({__name:"DismissableLayer",props:{disableOutsidePointerEvents:{type:Boolean,required:!1,default:!1},asChild:{type:Boolean,required:!1},as:{type:null,required:!1}},emits:["escapeKeyDown","pointerDownOutside","focusOutside","interactOutside","dismiss"],setup(t,{emit:e}){const n=t,i=e,{forwardRef:r,currentElement:s}=sn(),o=we(()=>s.value?.ownerDocument??globalThis.document),a=we(()=>gi.layersRoot),l=we(()=>s.value?Array.from(a.value).indexOf(s.value):-1),c=we(()=>gi.layersWithOutsidePointerEventsDisabled.size>0),u=we(()=>{const h=Array.from(a.value),[g]=[...gi.layersWithOutsidePointerEventsDisabled].slice(-1),v=h.indexOf(g);return l.value>=v}),d=z1(async h=>{const g=[...gi.branches].some(v=>v?.contains(h.target));!u.value||g||(i("pointerDownOutside",h),i("interactOutside",h),await Vr(),h.defaultPrevented||i("dismiss"))},s),f=V1(h=>{[...gi.branches].some(v=>v?.contains(h.target))||(i("focusOutside",h),i("interactOutside",h),h.defaultPrevented||i("dismiss"))},s);return h1("Escape",h=>{l.value===a.value.size-1&&(i("escapeKeyDown",h),h.defaultPrevented||i("dismiss"))}),Wn(h=>{s.value&&(n.disableOutsidePointerEvents&&(gi.layersWithOutsidePointerEventsDisabled.size===0&&(gi.originalBodyPointerEvents=o.value.body.style.pointerEvents,o.value.body.style.pointerEvents="none"),gi.layersWithOutsidePointerEventsDisabled.add(s.value)),a.value.add(s.value),h(()=>{n.disableOutsidePointerEvents&&gi.layersWithOutsidePointerEventsDisabled.size===1&&!Nc(gi.originalBodyPointerEvents)&&(o.value.body.style.pointerEvents=gi.originalBodyPointerEvents)}))}),Wn(h=>{h(()=>{s.value&&(a.value.delete(s.value),gi.layersWithOutsidePointerEventsDisabled.delete(s.value))})}),(h,g)=>(me(),Ie(E(wn),{ref:E(r),"as-child":h.asChild,as:h.as,"data-dismissable-layer":"",style:$r({pointerEvents:c.value?u.value?"auto":"none":void 0}),onFocusCapture:E(f).onFocusCapture,onBlurCapture:E(f).onBlurCapture,onPointerdownCapture:E(d).onPointerDownCapture},{default:te(()=>[at(h.$slots,"default")]),_:3},8,["as-child","as","style","onFocusCapture","onBlurCapture","onPointerdownCapture"]))}}),cy=H1;const G1=t1(()=>ke([]));function W1(){const t=G1();return{add(e){const n=t.value[0];e!==n&&n?.pause(),t.value=Pg(t.value,e),t.value.unshift(e)},remove(e){t.value=Pg(t.value,e),t.value[0]?.resume()}}}function Pg(t,e){const n=[...t],i=n.indexOf(e);return i!==-1&&n.splice(i,1),n}const Gd="focusScope.autoFocusOnMount",Wd="focusScope.autoFocusOnUnmount",Rg={bubbles:!1,cancelable:!0};function q1(t,{select:e=!1}={}){const n=to();for(const i of t)if(ls(i,{select:e}),to()!==n)return!0}function X1(t){const e=uy(t),n=Dg(e,t),i=Dg(e.reverse(),t);return[n,i]}function uy(t){const e=[],n=document.createTreeWalker(t,NodeFilter.SHOW_ELEMENT,{acceptNode:i=>{const r=i.tagName==="INPUT"&&i.type==="hidden";return i.disabled||i.hidden||r?NodeFilter.FILTER_SKIP:i.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;n.nextNode();)e.push(n.currentNode);return e}function Dg(t,e){for(const n of t)if(!$1(n,{upTo:e}))return n}function $1(t,{upTo:e}){if(getComputedStyle(t).visibility==="hidden")return!0;for(;t;){if(e!==void 0&&t===e)return!1;if(getComputedStyle(t).display==="none")return!0;t=t.parentElement}return!1}function j1(t){return t instanceof HTMLInputElement&&"select"in t}function ls(t,{select:e=!1}={}){if(t&&t.focus){const n=to();t.focus({preventScroll:!0}),t!==n&&j1(t)&&e&&t.select()}}var Y1=Ne({__name:"FocusScope",props:{loop:{type:Boolean,required:!1,default:!1},trapped:{type:Boolean,required:!1,default:!1},asChild:{type:Boolean,required:!1},as:{type:null,required:!1}},emits:["mountAutoFocus","unmountAutoFocus"],setup(t,{emit:e}){const n=t,i=e,{currentRef:r,currentElement:s}=sn(),o=ke(null),a=W1(),l=On({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}});Wn(u=>{if(!Ui)return;const d=s.value;if(!n.trapped)return;function f(m){if(l.paused||!d)return;const p=m.target;d.contains(p)?o.value=p:ls(o.value,{select:!0})}function h(m){if(l.paused||!d)return;const p=m.relatedTarget;p!==null&&(d.contains(p)||ls(o.value,{select:!0}))}function g(m){const p=o.value;if(p===null||!m.some(x=>x.removedNodes.length>0))return;d.contains(p)||ls(d)}document.addEventListener("focusin",f),document.addEventListener("focusout",h);const v=new MutationObserver(g);d&&v.observe(d,{childList:!0,subtree:!0}),u(()=>{document.removeEventListener("focusin",f),document.removeEventListener("focusout",h),v.disconnect()})}),Wn(async u=>{const d=s.value;if(await Vr(),!d)return;a.add(l);const f=to();if(!d.contains(f)){const g=new CustomEvent(Gd,Rg);d.addEventListener(Gd,v=>i("mountAutoFocus",v)),d.dispatchEvent(g),g.defaultPrevented||(q1(uy(d),{select:!0}),to()===f&&ls(d))}u(()=>{d.removeEventListener(Gd,m=>i("mountAutoFocus",m));const g=new CustomEvent(Wd,Rg),v=m=>{i("unmountAutoFocus",m)};d.addEventListener(Wd,v),d.dispatchEvent(g),setTimeout(()=>{g.defaultPrevented||ls(f??document.body,{select:!0}),d.removeEventListener(Wd,v),a.remove(l)},0)})});function c(u){if(!n.loop&&!n.trapped||l.paused)return;const d=u.key==="Tab"&&!u.altKey&&!u.ctrlKey&&!u.metaKey,f=to();if(d&&f){const h=u.currentTarget,[g,v]=X1(h);g&&v?!u.shiftKey&&f===v?(u.preventDefault(),n.loop&&ls(g,{select:!0})):u.shiftKey&&f===g&&(u.preventDefault(),n.loop&&ls(v,{select:!0})):f===h&&u.preventDefault()}}return(u,d)=>(me(),Ie(E(wn),{ref_key:"currentRef",ref:r,tabindex:"-1","as-child":u.asChild,as:u.as,onKeydown:c},{default:te(()=>[at(u.$slots,"default")]),_:3},8,["as-child","as"]))}}),J1=Y1,K1=Ne({__name:"Teleport",props:{to:{type:null,required:!1,default:"body"},disabled:{type:Boolean,required:!1},defer:{type:Boolean,required:!1},forceMount:{type:Boolean,required:!1}},setup(t){const e=ty();return(n,i)=>E(e)||n.forceMount?(me(),Ie(gw,{key:0,to:n.to,disabled:n.disabled,defer:n.defer},[at(n.$slots,"default")],8,["to","disabled","defer"])):fi("v-if",!0)}}),dy=K1;const Ig="data-reka-collection-item";function Up(t={}){const{key:e="",isProvider:n=!1}=t,i=`${e}CollectionProvider`;let r;n?(r={collectionRef:ke(),itemMap:ke(new Map)},Mp(i,r)):r=Wo(i);const s=(u=!1)=>{const d=r.collectionRef.value;if(!d)return[];const f=Array.from(d.querySelectorAll(`[${Ig}]`)),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=Ne({name:"CollectionSlot",inheritAttrs:!1,setup(u,{slots:d,attrs:f}){const{primitiveElement:h,currentElement:g}=ro();return rn(g,()=>{r.collectionRef.value=g.value}),()=>er(oh,{ref:h,...f},d)}}),a=Ne({name:"CollectionItem",inheritAttrs:!1,props:{value:{validator:()=>!0}},setup(u,{slots:d,attrs:f}){const{primitiveElement:h,currentElement:g}=ro();return Wn(v=>{if(g.value){const m=nx(g.value);r.itemMap.value.set(m,{ref:g.value,value:u.value}),v(()=>r.itemMap.value.delete(m))}}),()=>er(oh,{...f,[Ig]:"",ref:h},d)}}),l=we(()=>Array.from(r.itemMap.value.values())),c=we(()=>r.itemMap.value.size);return{getItems:s,reactiveItems:l,itemMapSize:c,CollectionSlot:o,CollectionItem:a}}var Z1=Ne({__name:"VisuallyHidden",props:{feature:{type:String,required:!1,default:"focusable"},asChild:{type:Boolean,required:!1},as:{type:null,required:!1,default:"span"}},setup(t){return(e,n)=>(me(),Ie(E(wn),{as:e.as,"as-child":e.asChild,"aria-hidden":e.feature==="focusable"?"true":void 0,"data-hidden":e.feature==="fully-hidden"?"":void 0,tabindex:e.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:te(()=>[at(e.$slots,"default")]),_:3},8,["as","as-child","aria-hidden","data-hidden","tabindex"]))}}),fy=Z1,Q1=Ne({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(t){const e=t,{primitiveElement:n,currentElement:i}=ro(),r=we(()=>e.checked??e.value);return rn(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 d=new Event("input",{bubbles:!0}),f=new Event("change",{bubbles:!0});u.call(a,s),a.dispatchEvent(d),a.dispatchEvent(f)}}),(s,o)=>(me(),Ie(fy,It({ref_key:"primitiveElement",ref:n},{...e,...s.$attrs},{as:"input"}),null,16))}}),Ng=Q1,eE=Ne({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(t){const e=t,n=we(()=>typeof e.value=="object"&&Array.isArray(e.value)&&e.value.length===0&&e.required),i=we(()=>typeof e.value=="string"||typeof e.value=="number"||typeof e.value=="boolean"||e.value===null||e.value===void 0?[{name:e.name,value:e.value}]:typeof e.value=="object"&&Array.isArray(e.value)?e.value.flatMap((r,s)=>typeof r=="object"?Object.entries(r).map(([o,a])=>({name:`${e.name}[${s}][${o}]`,value:a})):{name:`${e.name}[${s}]`,value:r}):e.value!==null&&typeof e.value=="object"&&!Array.isArray(e.value)?Object.entries(e.value).map(([r,s])=>({name:`${e.name}[${r}]`,value:s})):[]);return(r,s)=>(me(),Ct(Kt,null,[fi(" We render single input if it's required "),n.value?(me(),Ie(Ng,It({key:r.name},{...e,...r.$attrs},{name:r.name,value:r.value}),null,16,["name","value"])):(me(!0),Ct(Kt,{key:1},ta(i.value,o=>(me(),Ie(Ng,It({key:o.name},{ref_for:!0},{...e,...r.$attrs},{name:o.name,value:o.value}),null,16,["name","value"]))),128))],2112))}}),hy=eE;const[py,tE]=Jr("PopperRoot");var nE=Ne({inheritAttrs:!1,__name:"PopperRoot",setup(t){const e=ke();return tE({anchor:e,onAnchorChange:n=>e.value=n}),(n,i)=>at(n.$slots,"default")}}),my=nE,iE=Ne({__name:"PopperAnchor",props:{reference:{type:null,required:!1},asChild:{type:Boolean,required:!1},as:{type:null,required:!1}},setup(t){const e=t,{forwardRef:n,currentElement:i}=sn(),r=py();return dx(()=>{r.onAnchorChange(e.reference??i.value)}),(s,o)=>(me(),Ie(E(wn),{ref:E(n),as:s.as,"as-child":s.asChild},{default:te(()=>[at(s.$slots,"default")]),_:3},8,["as","as-child"]))}}),gy=iE;function rE(t){return t!==null}function sE(t){return{name:"transformOrigin",options:t,fn(e){const{placement:n,rects:i,middlewareData:r}=e,o=r.arrow?.centerOffset!==0,a=o?0:t.arrowWidth,l=o?0:t.arrowHeight,[c,u]=ah(n),d={start:"0%",center:"50%",end:"100%"}[u],f=(r.arrow?.x??0)+a/2,h=(r.arrow?.y??0)+l/2;let g="",v="";return c==="bottom"?(g=o?d:`${f}px`,v=`${-l}px`):c==="top"?(g=o?d:`${f}px`,v=`${i.floating.height+l}px`):c==="right"?(g=`${-l}px`,v=o?d:`${h}px`):c==="left"&&(g=`${i.floating.width+l}px`,v=o?d:`${h}px`),{data:{x:g,y:v}}}}}function ah(t){const[e,n="center"]=t.split("-");return[e,n]}const oE=["top","right","bottom","left"],_s=Math.min,ai=Math.max,tu=Math.round,Vl=Math.floor,tr=t=>({x:t,y:t}),aE={left:"right",right:"left",bottom:"top",top:"bottom"};function lh(t,e,n){return ai(t,_s(e,n))}function Gr(t,e){return typeof t=="function"?t(e):t}function Wr(t){return t.split("-")[0]}function ha(t){return t.split("-")[1]}function kp(t){return t==="x"?"y":"x"}function Bp(t){return t==="y"?"height":"width"}function Ji(t){const e=t[0];return e==="t"||e==="b"?"y":"x"}function zp(t){return kp(Ji(t))}function lE(t,e,n){n===void 0&&(n=!1);const i=ha(t),r=zp(t),s=Bp(r);let o=r==="x"?i===(n?"end":"start")?"right":"left":i==="start"?"bottom":"top";return e.reference[s]>e.floating[s]&&(o=nu(o)),[o,nu(o)]}function cE(t){const e=nu(t);return[ch(t),e,ch(e)]}function ch(t){return t.includes("start")?t.replace("start","end"):t.replace("end","start")}const Lg=["left","right"],Og=["right","left"],uE=["top","bottom"],dE=["bottom","top"];function fE(t,e,n){switch(t){case"top":case"bottom":return n?e?Og:Lg:e?Lg:Og;case"left":case"right":return e?uE:dE;default:return[]}}function hE(t,e,n,i){const r=ha(t);let s=fE(Wr(t),n==="start",i);return r&&(s=s.map(o=>o+"-"+r),e&&(s=s.concat(s.map(ch)))),s}function nu(t){const e=Wr(t);return aE[e]+t.slice(e.length)}function pE(t){return{top:0,right:0,bottom:0,left:0,...t}}function vy(t){return typeof t!="number"?pE(t):{top:t,right:t,bottom:t,left:t}}function iu(t){const{x:e,y:n,width:i,height:r}=t;return{width:i,height:r,top:n,left:e,right:e+i,bottom:n+r,x:e,y:n}}function Fg(t,e,n){let{reference:i,floating:r}=t;const s=Ji(e),o=zp(e),a=Bp(o),l=Wr(e),c=s==="y",u=i.x+i.width/2-r.width/2,d=i.y+i.height/2-r.height/2,f=i[a]/2-r[a]/2;let h;switch(l){case"top":h={x:u,y:i.y-r.height};break;case"bottom":h={x:u,y:i.y+i.height};break;case"right":h={x:i.x+i.width,y:d};break;case"left":h={x:i.x-r.width,y:d};break;default:h={x:i.x,y:i.y}}switch(ha(e)){case"start":h[o]-=f*(n&&c?-1:1);break;case"end":h[o]+=f*(n&&c?-1:1);break}return h}async function mE(t,e){var n;e===void 0&&(e={});const{x:i,y:r,platform:s,rects:o,elements:a,strategy:l}=t,{boundary:c="clippingAncestors",rootBoundary:u="viewport",elementContext:d="floating",altBoundary:f=!1,padding:h=0}=Gr(e,t),g=vy(h),m=a[f?d==="floating"?"reference":"floating":d],p=iu(await s.getClippingRect({element:(n=await(s.isElement==null?void 0:s.isElement(m)))==null||n?m:m.contextElement||await(s.getDocumentElement==null?void 0:s.getDocumentElement(a.floating)),boundary:c,rootBoundary:u,strategy:l})),_=d==="floating"?{x:i,y:r,width:o.floating.width,height:o.floating.height}:o.reference,y=await(s.getOffsetParent==null?void 0:s.getOffsetParent(a.floating)),x=await(s.isElement==null?void 0:s.isElement(y))?await(s.getScale==null?void 0:s.getScale(y))||{x:1,y:1}:{x:1,y:1},M=iu(s.convertOffsetParentRelativeRectToViewportRelativeRect?await s.convertOffsetParentRelativeRectToViewportRelativeRect({elements:a,rect:_,offsetParent:y,strategy:l}):_);return{top:(p.top-M.top+g.top)/x.y,bottom:(M.bottom-p.bottom+g.bottom)/x.y,left:(p.left-M.left+g.left)/x.x,right:(M.right-p.right+g.right)/x.x}}const gE=50,vE=async(t,e,n)=>{const{placement:i="bottom",strategy:r="absolute",middleware:s=[],platform:o}=n,a=o.detectOverflow?o:{...o,detectOverflow:mE},l=await(o.isRTL==null?void 0:o.isRTL(e));let c=await o.getElementRects({reference:t,floating:e,strategy:r}),{x:u,y:d}=Fg(c,i,l),f=i,h=0;const g={};for(let v=0;v({name:"arrow",options:t,async fn(e){const{x:n,y:i,placement:r,rects:s,platform:o,elements:a,middlewareData:l}=e,{element:c,padding:u=0}=Gr(t,e)||{};if(c==null)return{};const d=vy(u),f={x:n,y:i},h=zp(r),g=Bp(h),v=await o.getDimensions(c),m=h==="y",p=m?"top":"left",_=m?"bottom":"right",y=m?"clientHeight":"clientWidth",x=s.reference[g]+s.reference[h]-f[h]-s.floating[g],M=f[h]-s.reference[h],A=await(o.getOffsetParent==null?void 0:o.getOffsetParent(c));let P=A?A[y]:0;(!P||!await(o.isElement==null?void 0:o.isElement(A)))&&(P=a.floating[y]||s.floating[g]);const D=x/2-M/2,b=P/2-v[g]/2-1,w=_s(d[p],b),I=_s(d[_],b),L=w,V=P-v[g]-I,$=P/2-v[g]/2+D,X=lh(L,$,V),W=!l.arrow&&ha(r)!=null&&$!==X&&s.reference[g]/2-($$<=0)){var I,L;const $=(((I=s.flip)==null?void 0:I.index)||0)+1,X=P[$];if(X&&(!(d==="alignment"?_!==Ji(X):!1)||w.every(z=>Ji(z.placement)===_?z.overflows[0]>0:!0)))return{data:{index:$,overflows:w},reset:{placement:X}};let W=(L=w.filter(B=>B.overflows[0]<=0).sort((B,z)=>B.overflows[1]-z.overflows[1])[0])==null?void 0:L.placement;if(!W)switch(h){case"bestFit":{var V;const B=(V=w.filter(z=>{if(A){const de=Ji(z.placement);return de===_||de==="y"}return!0}).map(z=>[z.placement,z.overflows.filter(de=>de>0).reduce((de,le)=>de+le,0)]).sort((z,de)=>z[1]-de[1])[0])==null?void 0:V[0];B&&(W=B);break}case"initialPlacement":W=a;break}if(r!==W)return{reset:{placement:W}}}return{}}}};function Ug(t,e){return{top:t.top-e.height,right:t.right-e.width,bottom:t.bottom-e.height,left:t.left-e.width}}function kg(t){return oE.some(e=>t[e]>=0)}const yE=function(t){return t===void 0&&(t={}),{name:"hide",options:t,async fn(e){const{rects:n,platform:i}=e,{strategy:r="referenceHidden",...s}=Gr(t,e);switch(r){case"referenceHidden":{const o=await i.detectOverflow(e,{...s,elementContext:"reference"}),a=Ug(o,n.reference);return{data:{referenceHiddenOffsets:a,referenceHidden:kg(a)}}}case"escaped":{const o=await i.detectOverflow(e,{...s,altBoundary:!0}),a=Ug(o,n.floating);return{data:{escapedOffsets:a,escaped:kg(a)}}}default:return{}}}}},_y=new Set(["left","top"]);async function bE(t,e){const{placement:n,platform:i,elements:r}=t,s=await(i.isRTL==null?void 0:i.isRTL(r.floating)),o=Wr(n),a=ha(n),l=Ji(n)==="y",c=_y.has(o)?-1:1,u=s&&l?-1:1,d=Gr(e,t);let{mainAxis:f,crossAxis:h,alignmentAxis:g}=typeof d=="number"?{mainAxis:d,crossAxis:0,alignmentAxis:null}:{mainAxis:d.mainAxis||0,crossAxis:d.crossAxis||0,alignmentAxis:d.alignmentAxis};return a&&typeof g=="number"&&(h=a==="end"?g*-1:g),l?{x:h*u,y:f*c}:{x:f*c,y:h*u}}const SE=function(t){return t===void 0&&(t=0),{name:"offset",options:t,async fn(e){var n,i;const{x:r,y:s,placement:o,middlewareData:a}=e,l=await bE(e,t);return o===((n=a.offset)==null?void 0:n.placement)&&(i=a.arrow)!=null&&i.alignmentOffset?{}:{x:r+l.x,y:s+l.y,data:{...l,placement:o}}}}},wE=function(t){return t===void 0&&(t={}),{name:"shift",options:t,async fn(e){const{x:n,y:i,placement:r,platform:s}=e,{mainAxis:o=!0,crossAxis:a=!1,limiter:l={fn:p=>{let{x:_,y}=p;return{x:_,y}}},...c}=Gr(t,e),u={x:n,y:i},d=await s.detectOverflow(e,c),f=Ji(Wr(r)),h=kp(f);let g=u[h],v=u[f];if(o){const p=h==="y"?"top":"left",_=h==="y"?"bottom":"right",y=g+d[p],x=g-d[_];g=lh(y,g,x)}if(a){const p=f==="y"?"top":"left",_=f==="y"?"bottom":"right",y=v+d[p],x=v-d[_];v=lh(y,v,x)}const m=l.fn({...e,[h]:g,[f]:v});return{...m,data:{x:m.x-n,y:m.y-i,enabled:{[h]:o,[f]:a}}}}}},ME=function(t){return t===void 0&&(t={}),{options:t,fn(e){const{x:n,y:i,placement:r,rects:s,middlewareData:o}=e,{offset:a=0,mainAxis:l=!0,crossAxis:c=!0}=Gr(t,e),u={x:n,y:i},d=Ji(r),f=kp(d);let h=u[f],g=u[d];const v=Gr(a,e),m=typeof v=="number"?{mainAxis:v,crossAxis:0}:{mainAxis:0,crossAxis:0,...v};if(l){const y=f==="y"?"height":"width",x=s.reference[f]-s.floating[y]+m.mainAxis,M=s.reference[f]+s.reference[y]-m.mainAxis;hM&&(h=M)}if(c){var p,_;const y=f==="y"?"width":"height",x=_y.has(Wr(r)),M=s.reference[d]-s.floating[y]+(x&&((p=o.offset)==null?void 0:p[d])||0)+(x?0:m.crossAxis),A=s.reference[d]+s.reference[y]+(x?0:((_=o.offset)==null?void 0:_[d])||0)-(x?m.crossAxis:0);gA&&(g=A)}return{[f]:h,[d]:g}}}},EE=function(t){return t===void 0&&(t={}),{name:"size",options:t,async fn(e){var n,i;const{placement:r,rects:s,platform:o,elements:a}=e,{apply:l=()=>{},...c}=Gr(t,e),u=await o.detectOverflow(e,c),d=Wr(r),f=ha(r),h=Ji(r)==="y",{width:g,height:v}=s.floating;let m,p;d==="top"||d==="bottom"?(m=d,p=f===(await(o.isRTL==null?void 0:o.isRTL(a.floating))?"start":"end")?"left":"right"):(p=d,m=f==="end"?"top":"bottom");const _=v-u.top-u.bottom,y=g-u.left-u.right,x=_s(v-u[m],_),M=_s(g-u[p],y),A=!e.middlewareData.shift;let P=x,D=M;if((n=e.middlewareData.shift)!=null&&n.enabled.x&&(D=y),(i=e.middlewareData.shift)!=null&&i.enabled.y&&(P=_),A&&!f){const w=ai(u.left,0),I=ai(u.right,0),L=ai(u.top,0),V=ai(u.bottom,0);h?D=g-2*(w!==0||I!==0?w+I:ai(u.left,u.right)):P=v-2*(L!==0||V!==0?L+V:ai(u.top,u.bottom))}await l({...e,availableWidth:D,availableHeight:P});const b=await o.getDimensions(a.floating);return g!==b.width||v!==b.height?{reset:{rects:!0}}:{}}}};function ku(){return typeof window<"u"}function uo(t){return Vp(t)?(t.nodeName||"").toLowerCase():"#document"}function hi(t){var e;return(t==null||(e=t.ownerDocument)==null?void 0:e.defaultView)||window}function lr(t){var e;return(e=(Vp(t)?t.ownerDocument:t.document)||window.document)==null?void 0:e.documentElement}function Vp(t){return ku()?t instanceof Node||t instanceof hi(t).Node:!1}function Ni(t){return ku()?t instanceof Element||t instanceof hi(t).Element:!1}function Kr(t){return ku()?t instanceof HTMLElement||t instanceof hi(t).HTMLElement:!1}function Bg(t){return!ku()||typeof ShadowRoot>"u"?!1:t instanceof ShadowRoot||t instanceof hi(t).ShadowRoot}function wl(t){const{overflow:e,overflowX:n,overflowY:i,display:r}=Li(t);return/auto|scroll|overlay|hidden|clip/.test(e+i+n)&&r!=="inline"&&r!=="contents"}function TE(t){return/^(table|td|th)$/.test(uo(t))}function Bu(t){try{if(t.matches(":popover-open"))return!0}catch{}try{return t.matches(":modal")}catch{return!1}}const AE=/transform|translate|scale|rotate|perspective|filter/,CE=/paint|layout|strict|content/,Ns=t=>!!t&&t!=="none";let qd;function Hp(t){const e=Ni(t)?Li(t):t;return Ns(e.transform)||Ns(e.translate)||Ns(e.scale)||Ns(e.rotate)||Ns(e.perspective)||!Gp()&&(Ns(e.backdropFilter)||Ns(e.filter))||AE.test(e.willChange||"")||CE.test(e.contain||"")}function PE(t){let e=xs(t);for(;Kr(e)&&!na(e);){if(Hp(e))return e;if(Bu(e))return null;e=xs(e)}return null}function Gp(){return qd==null&&(qd=typeof CSS<"u"&&CSS.supports&&CSS.supports("-webkit-backdrop-filter","none")),qd}function na(t){return/^(html|body|#document)$/.test(uo(t))}function Li(t){return hi(t).getComputedStyle(t)}function zu(t){return Ni(t)?{scrollLeft:t.scrollLeft,scrollTop:t.scrollTop}:{scrollLeft:t.scrollX,scrollTop:t.scrollY}}function xs(t){if(uo(t)==="html")return t;const e=t.assignedSlot||t.parentNode||Bg(t)&&t.host||lr(t);return Bg(e)?e.host:e}function xy(t){const e=xs(t);return na(e)?t.ownerDocument?t.ownerDocument.body:t.body:Kr(e)&&wl(e)?e:xy(e)}function ll(t,e,n){var i;e===void 0&&(e=[]),n===void 0&&(n=!0);const r=xy(t),s=r===((i=t.ownerDocument)==null?void 0:i.body),o=hi(r);if(s){const a=uh(o);return e.concat(o,o.visualViewport||[],wl(r)?r:[],a&&n?ll(a):[])}else return e.concat(r,ll(r,[],n))}function uh(t){return t.parent&&Object.getPrototypeOf(t.parent)?t.frameElement:null}function yy(t){const e=Li(t);let n=parseFloat(e.width)||0,i=parseFloat(e.height)||0;const r=Kr(t),s=r?t.offsetWidth:n,o=r?t.offsetHeight:i,a=tu(n)!==s||tu(i)!==o;return a&&(n=s,i=o),{width:n,height:i,$:a}}function Wp(t){return Ni(t)?t:t.contextElement}function jo(t){const e=Wp(t);if(!Kr(e))return tr(1);const n=e.getBoundingClientRect(),{width:i,height:r,$:s}=yy(e);let o=(s?tu(n.width):n.width)/i,a=(s?tu(n.height):n.height)/r;return(!o||!Number.isFinite(o))&&(o=1),(!a||!Number.isFinite(a))&&(a=1),{x:o,y:a}}const RE=tr(0);function by(t){const e=hi(t);return!Gp()||!e.visualViewport?RE:{x:e.visualViewport.offsetLeft,y:e.visualViewport.offsetTop}}function DE(t,e,n){return e===void 0&&(e=!1),!n||e&&n!==hi(t)?!1:e}function so(t,e,n,i){e===void 0&&(e=!1),n===void 0&&(n=!1);const r=t.getBoundingClientRect(),s=Wp(t);let o=tr(1);e&&(i?Ni(i)&&(o=jo(i)):o=jo(t));const a=DE(s,n,i)?by(s):tr(0);let l=(r.left+a.x)/o.x,c=(r.top+a.y)/o.y,u=r.width/o.x,d=r.height/o.y;if(s){const f=hi(s),h=i&&Ni(i)?hi(i):i;let g=f,v=uh(g);for(;v&&i&&h!==g;){const m=jo(v),p=v.getBoundingClientRect(),_=Li(v),y=p.left+(v.clientLeft+parseFloat(_.paddingLeft))*m.x,x=p.top+(v.clientTop+parseFloat(_.paddingTop))*m.y;l*=m.x,c*=m.y,u*=m.x,d*=m.y,l+=y,c+=x,g=hi(v),v=uh(g)}}return iu({width:u,height:d,x:l,y:c})}function Vu(t,e){const n=zu(t).scrollLeft;return e?e.left+n:so(lr(t)).left+n}function Sy(t,e){const n=t.getBoundingClientRect(),i=n.left+e.scrollLeft-Vu(t,n),r=n.top+e.scrollTop;return{x:i,y:r}}function IE(t){let{elements:e,rect:n,offsetParent:i,strategy:r}=t;const s=r==="fixed",o=lr(i),a=e?Bu(e.floating):!1;if(i===o||a&&s)return n;let l={scrollLeft:0,scrollTop:0},c=tr(1);const u=tr(0),d=Kr(i);if((d||!d&&!s)&&((uo(i)!=="body"||wl(o))&&(l=zu(i)),d)){const h=so(i);c=jo(i),u.x=h.x+i.clientLeft,u.y=h.y+i.clientTop}const f=o&&!d&&!s?Sy(o,l):tr(0);return{width:n.width*c.x,height:n.height*c.y,x:n.x*c.x-l.scrollLeft*c.x+u.x+f.x,y:n.y*c.y-l.scrollTop*c.y+u.y+f.y}}function NE(t){return Array.from(t.getClientRects())}function LE(t){const e=lr(t),n=zu(t),i=t.ownerDocument.body,r=ai(e.scrollWidth,e.clientWidth,i.scrollWidth,i.clientWidth),s=ai(e.scrollHeight,e.clientHeight,i.scrollHeight,i.clientHeight);let o=-n.scrollLeft+Vu(t);const a=-n.scrollTop;return Li(i).direction==="rtl"&&(o+=ai(e.clientWidth,i.clientWidth)-r),{width:r,height:s,x:o,y:a}}const zg=25;function OE(t,e){const n=hi(t),i=lr(t),r=n.visualViewport;let s=i.clientWidth,o=i.clientHeight,a=0,l=0;if(r){s=r.width,o=r.height;const u=Gp();(!u||u&&e==="fixed")&&(a=r.offsetLeft,l=r.offsetTop)}const c=Vu(i);if(c<=0){const u=i.ownerDocument,d=u.body,f=getComputedStyle(d),h=u.compatMode==="CSS1Compat"&&parseFloat(f.marginLeft)+parseFloat(f.marginRight)||0,g=Math.abs(i.clientWidth-d.clientWidth-h);g<=zg&&(s-=g)}else c<=zg&&(s+=c);return{width:s,height:o,x:a,y:l}}function FE(t,e){const n=so(t,!0,e==="fixed"),i=n.top+t.clientTop,r=n.left+t.clientLeft,s=Kr(t)?jo(t):tr(1),o=t.clientWidth*s.x,a=t.clientHeight*s.y,l=r*s.x,c=i*s.y;return{width:o,height:a,x:l,y:c}}function Vg(t,e,n){let i;if(e==="viewport")i=OE(t,n);else if(e==="document")i=LE(lr(t));else if(Ni(e))i=FE(e,n);else{const r=by(t);i={x:e.x-r.x,y:e.y-r.y,width:e.width,height:e.height}}return iu(i)}function wy(t,e){const n=xs(t);return n===e||!Ni(n)||na(n)?!1:Li(n).position==="fixed"||wy(n,e)}function UE(t,e){const n=e.get(t);if(n)return n;let i=ll(t,[],!1).filter(a=>Ni(a)&&uo(a)!=="body"),r=null;const s=Li(t).position==="fixed";let o=s?xs(t):t;for(;Ni(o)&&!na(o);){const a=Li(o),l=Hp(o);!l&&a.position==="fixed"&&(r=null),(s?!l&&!r:!l&&a.position==="static"&&!!r&&(r.position==="absolute"||r.position==="fixed")||wl(o)&&!l&&wy(t,o))?i=i.filter(u=>u!==o):r=a,o=xs(o)}return e.set(t,i),i}function kE(t){let{element:e,boundary:n,rootBoundary:i,strategy:r}=t;const o=[...n==="clippingAncestors"?Bu(e)?[]:UE(e,this._c):[].concat(n),i],a=Vg(e,o[0],r);let l=a.top,c=a.right,u=a.bottom,d=a.left;for(let f=1;f{o(!1,1e-7)},1e3)}P===1&&!Ey(c,t.getBoundingClientRect())&&o(),x=!1}try{n=new IntersectionObserver(M,{...y,root:r.ownerDocument})}catch{n=new IntersectionObserver(M,y)}n.observe(t)}return o(!0),s}function qE(t,e,n,i){i===void 0&&(i={});const{ancestorScroll:r=!0,ancestorResize:s=!0,elementResize:o=typeof ResizeObserver=="function",layoutShift:a=typeof IntersectionObserver=="function",animationFrame:l=!1}=i,c=Wp(t),u=r||s?[...c?ll(c):[],...e?ll(e):[]]:[];u.forEach(p=>{r&&p.addEventListener("scroll",n,{passive:!0}),s&&p.addEventListener("resize",n)});const d=c&&a?WE(c,n):null;let f=-1,h=null;o&&(h=new ResizeObserver(p=>{let[_]=p;_&&_.target===c&&h&&e&&(h.unobserve(e),cancelAnimationFrame(f),f=requestAnimationFrame(()=>{var y;(y=h)==null||y.observe(e)})),n()}),c&&!l&&h.observe(c),e&&h.observe(e));let g,v=l?so(t):null;l&&m();function m(){const p=so(t);v&&!Ey(v,p)&&n(),v=p,g=requestAnimationFrame(m)}return n(),()=>{var p;u.forEach(_=>{r&&_.removeEventListener("scroll",n),s&&_.removeEventListener("resize",n)}),d?.(),(p=h)==null||p.disconnect(),h=null,l&&cancelAnimationFrame(g)}}const XE=SE,$E=wE,Gg=xE,jE=EE,YE=yE,JE=_E,KE=ME,ZE=(t,e,n)=>{const i=new Map,r={platform:GE,...n},s={...r.platform,_c:i};return vE(t,e,{...r,platform:s})};function QE(t){return t!=null&&typeof t=="object"&&"$el"in t}function dh(t){if(QE(t)){const e=t.$el;return Vp(e)&&uo(e)==="#comment"?null:e}return t}function Fo(t){return typeof t=="function"?t():E(t)}function eT(t){return{name:"arrow",options:t,fn(e){const n=dh(Fo(t.element));return n==null?{}:JE({element:n,padding:t.padding}).fn(e)}}}function Ty(t){return typeof window>"u"?1:(t.ownerDocument.defaultView||window).devicePixelRatio||1}function Wg(t,e){const n=Ty(t);return Math.round(e*n)/n}function tT(t,e,n){n===void 0&&(n={});const i=n.whileElementsMounted,r=we(()=>{var P;return(P=Fo(n.open))!=null?P:!0}),s=we(()=>Fo(n.middleware)),o=we(()=>{var P;return(P=Fo(n.placement))!=null?P:"bottom"}),a=we(()=>{var P;return(P=Fo(n.strategy))!=null?P:"absolute"}),l=we(()=>{var P;return(P=Fo(n.transform))!=null?P:!0}),c=we(()=>dh(t.value)),u=we(()=>dh(e.value)),d=ke(0),f=ke(0),h=ke(a.value),g=ke(o.value),v=Cu({}),m=ke(!1),p=we(()=>{const P={position:h.value,left:"0",top:"0"};if(!u.value)return P;const D=Wg(u.value,d.value),b=Wg(u.value,f.value);return l.value?{...P,transform:"translate("+D+"px, "+b+"px)",...Ty(u.value)>=1.5&&{willChange:"transform"}}:{position:h.value,left:D+"px",top:b+"px"}});let _;function y(){if(c.value==null||u.value==null)return;const P=r.value;ZE(c.value,u.value,{middleware:s.value,placement:o.value,strategy:a.value}).then(D=>{d.value=D.x,f.value=D.y,h.value=D.strategy,g.value=D.placement,v.value=D.middlewareData,m.value=P!==!1})}function x(){typeof _=="function"&&(_(),_=void 0)}function M(){if(x(),i===void 0){y();return}if(c.value!=null&&u.value!=null){_=i(c.value,u.value,y);return}}function A(){r.value||(m.value=!1)}return rn([s,o,a,r],y,{flush:"sync"}),rn([c,u],M,{flush:"sync"}),rn(r,A,{flush:"sync"}),xp()&&B_(x),{x:Hs(d),y:Hs(f),strategy:Hs(h),placement:Hs(g),middlewareData:Hs(v),isPositioned:Hs(m),floatingStyles:p,update:y}}const nT={side:"bottom",sideOffset:0,sideFlip:!0,align:"center",alignOffset:0,alignFlip:!0,arrowPadding:0,hideShiftedArrow:!0,avoidCollisions:!0,collisionBoundary:()=>[],collisionPadding:0,sticky:"partial",hideWhenDetached:!1,positionStrategy:"fixed",updatePositionStrategy:"optimized",prioritizePosition:!1},[eB,iT]=Jr("PopperContent");var rT=Ne({inheritAttrs:!1,__name:"PopperContent",props:Lw({side:{type:null,required:!1},sideOffset:{type:Number,required:!1},sideFlip:{type:Boolean,required:!1},align:{type:null,required:!1},alignOffset:{type:Number,required:!1},alignFlip:{type:Boolean,required:!1},avoidCollisions:{type:Boolean,required:!1},collisionBoundary:{type:null,required:!1},collisionPadding:{type:[Number,Object],required:!1},arrowPadding:{type:Number,required:!1},hideShiftedArrow:{type:Boolean,required:!1},sticky:{type:String,required:!1},hideWhenDetached:{type:Boolean,required:!1},positionStrategy:{type:String,required:!1},updatePositionStrategy:{type:String,required:!1},disableUpdateOnLayoutShift:{type:Boolean,required:!1},prioritizePosition:{type:Boolean,required:!1},reference:{type:null,required:!1},asChild:{type:Boolean,required:!1},as:{type:null,required:!1}},{...nT}),emits:["placed"],setup(t,{emit:e}){const n=t,i=e,r=py(),{forwardRef:s,currentElement:o}=sn(),a=ke(),l=ke(),{width:c,height:u}=oy(l),d=we(()=>n.side+(n.align!=="center"?`-${n.align}`:"")),f=we(()=>typeof n.collisionPadding=="number"?n.collisionPadding:{top:0,right:0,bottom:0,left:0,...n.collisionPadding}),h=we(()=>Array.isArray(n.collisionBoundary)?n.collisionBoundary:[n.collisionBoundary]),g=we(()=>({padding:f.value,boundary:h.value.filter(rE),altBoundary:h.value.length>0})),v=we(()=>({mainAxis:n.sideFlip,crossAxis:n.alignFlip})),m=e1(()=>[XE({mainAxis:n.sideOffset+u.value,alignmentAxis:n.alignOffset}),n.prioritizePosition&&n.avoidCollisions&&Gg({...g.value,...v.value}),n.avoidCollisions&&$E({mainAxis:!0,crossAxis:!!n.prioritizePosition,limiter:n.sticky==="partial"?KE():void 0,...g.value}),!n.prioritizePosition&&n.avoidCollisions&&Gg({...g.value,...v.value}),jE({...g.value,apply:({elements:L,rects:V,availableWidth:$,availableHeight:X})=>{const{width:W,height:B}=V.reference,z=L.floating.style;z.setProperty("--reka-popper-available-width",`${$}px`),z.setProperty("--reka-popper-available-height",`${X}px`),z.setProperty("--reka-popper-anchor-width",`${W}px`),z.setProperty("--reka-popper-anchor-height",`${B}px`)}}),l.value&&eT({element:l.value,padding:n.arrowPadding}),sE({arrowWidth:c.value,arrowHeight:u.value}),n.hideWhenDetached&&YE({strategy:"referenceHidden",...g.value})]),p=we(()=>n.reference??r.anchor.value),{floatingStyles:_,placement:y,isPositioned:x,middlewareData:M}=tT(p,a,{strategy:n.positionStrategy,placement:d,whileElementsMounted:(...L)=>qE(...L,{layoutShift:!n.disableUpdateOnLayoutShift,animationFrame:n.updatePositionStrategy==="always"}),middleware:m}),A=we(()=>ah(y.value)[0]),P=we(()=>ah(y.value)[1]);dx(()=>{x.value&&i("placed")});const D=we(()=>{const L=M.value.arrow?.centerOffset!==0;return n.hideShiftedArrow&&L}),b=ke("");Wn(()=>{o.value&&(b.value=window.getComputedStyle(o.value).zIndex)});const w=we(()=>M.value.arrow?.x??0),I=we(()=>M.value.arrow?.y??0);return iT({placedSide:A,onArrowChange:L=>l.value=L,arrowX:w,arrowY:I,shouldHideArrow:D}),(L,V)=>(me(),Ct("div",{ref_key:"floatingRef",ref:a,"data-reka-popper-content-wrapper":"",style:$r({...E(_),transform:E(x)?E(_).transform:"translate(0, -200%)",minWidth:"max-content",zIndex:b.value,"--reka-popper-transform-origin":[E(M).transformOrigin?.x,E(M).transformOrigin?.y].join(" "),...E(M).hide?.referenceHidden&&{visibility:"hidden",pointerEvents:"none"}})},[ie(E(wn),It({ref:E(s)},L.$attrs,{"as-child":n.asChild,as:L.as,"data-side":A.value,"data-align":P.value,style:{animation:E(x)?void 0:"none"}}),{default:te(()=>[at(L.$slots,"default")]),_:3},16,["as-child","as","data-side","data-align","style"])],4))}}),Ay=rT;function sT(t=[],e,n){const i=[...t];return i[n]=e,i.sort((r,s)=>r-s)}function Cy(t,e,n){const s=100/(n-e)*(t-e);return Dp(s,0,100)}function oT(t,e){return e>2?`Value ${t+1} of ${e}`:e===2?["Minimum","Maximum"][t]:void 0}function aT(t,e){if(t.length===1)return 0;const n=t.map(r=>Math.abs(r-e)),i=Math.min(...n);return n.indexOf(i)}function lT(t,e,n){const i=t/2,s=qp([0,50],[0,i]);return(i-s(e)*n)*n}function cT(t){return t.slice(0,-1).map((e,n)=>t[n+1]-e)}function uT(t,e){if(e>0){const n=cT(t);return Math.min(...n)>=e}return!0}function qp(t,e){return n=>{if(t[0]===t[1]||e[0]===e[1])return e[0];const i=(e[1]-e[0])/(t[1]-t[0]);return e[0]+i*(n-t[0])}}function dT(t){return(String(t).split(".")[1]||"").length}function fT(t,e){const n=10**e;return Math.round(t*n)/n}const Py=["PageUp","PageDown"],Ry=["ArrowUp","ArrowDown","ArrowLeft","ArrowRight"],Dy={"from-left":["Home","PageDown","ArrowDown","ArrowLeft"],"from-right":["Home","PageDown","ArrowDown","ArrowRight"],"from-bottom":["Home","PageDown","ArrowDown","ArrowLeft"],"from-top":["Home","PageUp","ArrowUp","ArrowLeft"]},[Iy,Ny]=Jr(["SliderVertical","SliderHorizontal"]);var hT=Ne({__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(t,{emit:e}){const n=t,i=e,{max:r,min:s,dir:o,inverted:a}=zr(n),{forwardRef:l,currentElement:c}=sn(),u=pa(),d=ke(),f=ke(),h=we(()=>o?.value!=="rtl"&&!a.value||o?.value!=="ltr"&&a.value);function g(_,y){const x=f.value||c.value.getBoundingClientRect(),M=[...u.thumbElements.value][u.valueIndexToChangeRef.value],A=u.thumbAlignment.value==="contain"?M.clientWidth:0;!d.value&&!y&&u.thumbAlignment.value==="contain"&&(d.value=_.clientX-M.getBoundingClientRect().left);const P=[0,x.width-A],D=h.value?[s.value,r.value]:[r.value,s.value],b=qp(P,D);f.value=x;const w=y?_.clientX-x.left-A/2:_.clientX-x.left-(d.value??0);return b(w)}const v=we(()=>h.value?"left":"right"),m=we(()=>h.value?"right":"left"),p=we(()=>h.value?1:-1);return Ny({startEdge:v,endEdge:m,direction:p,size:"width"}),(_,y)=>(me(),Ie(Ly,{ref:E(l),dir:E(o),"data-orientation":"horizontal",style:$r({"--reka-slider-thumb-transform":!h.value&&E(u).thumbAlignment.value==="overflow"?"translateX(50%)":"translateX(-50%)"}),onSlideStart:y[0]||(y[0]=x=>{const M=g(x,!0);i("slideStart",M)}),onSlideMove:y[1]||(y[1]=x=>{const M=g(x);i("slideMove",M)}),onSlideEnd:y[2]||(y[2]=()=>{f.value=void 0,d.value=void 0,i("slideEnd")}),onStepKeyDown:y[3]||(y[3]=x=>{const M=h.value?"from-left":"from-right",A=E(Dy)[M].includes(x.key);i("stepKeyDown",x,A?-1:1)}),onEndKeyDown:y[4]||(y[4]=x=>i("endKeyDown",x)),onHomeKeyDown:y[5]||(y[5]=x=>i("homeKeyDown",x))},{default:te(()=>[at(_.$slots,"default")]),_:3},8,["dir","style"]))}}),pT=hT,mT=Ne({__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(t,{emit:e}){const n=t,i=e,{max:r,min:s,inverted:o}=zr(n),a=pa(),{forwardRef:l,currentElement:c}=sn(),u=ke(),d=ke(),f=we(()=>!o.value);function h(p,_){const y=d.value||c.value.getBoundingClientRect(),x=[...a.thumbElements.value][a.valueIndexToChangeRef.value],M=a.thumbAlignment.value==="contain"?x.clientHeight:0;!u.value&&!_&&a.thumbAlignment.value==="contain"&&(u.value=p.clientY-x.getBoundingClientRect().top);const A=[0,y.height-M],P=f.value?[r.value,s.value]:[s.value,r.value],D=qp(A,P),b=_?p.clientY-y.top-M/2:p.clientY-y.top-(u.value??0);return d.value=y,D(b)}const g=we(()=>f.value?"bottom":"top"),v=we(()=>f.value?"top":"bottom"),m=we(()=>f.value?1:-1);return Ny({startEdge:g,endEdge:v,direction:m,size:"height"}),(p,_)=>(me(),Ie(Ly,{ref:E(l),"data-orientation":"vertical",style:$r({"--reka-slider-thumb-transform":!f.value&&E(a).thumbAlignment.value==="overflow"?"translateY(-50%)":"translateY(50%)"}),onSlideStart:_[0]||(_[0]=y=>{const x=h(y,!0);i("slideStart",x)}),onSlideMove:_[1]||(_[1]=y=>{const x=h(y);i("slideMove",x)}),onSlideEnd:_[2]||(_[2]=()=>{d.value=void 0,u.value=void 0,i("slideEnd")}),onStepKeyDown:_[3]||(_[3]=y=>{const x=f.value?"from-bottom":"from-top",M=E(Dy)[x].includes(y.key);i("stepKeyDown",y,M?-1:1)}),onEndKeyDown:_[4]||(_[4]=y=>i("endKeyDown",y)),onHomeKeyDown:_[5]||(_[5]=y=>i("homeKeyDown",y))},{default:te(()=>[at(p.$slots,"default")]),_:3},8,["style"]))}}),gT=mT;const[pa,vT]=Jr("SliderRoot");var _T=Ne({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(t,{emit:e}){const n=t,i=e,{min:r,max:s,step:o,minStepsBetweenThumbs:a,orientation:l,disabled:c,thumbAlignment:u,dir:d}=zr(n),f=x1(d),{forwardRef:h,currentElement:g}=sn(),v=ry(g),{CollectionSlot:m}=Up({isProvider:!0}),p=Uu(n,"modelValue",i,{defaultValue:n.defaultValue,passive:n.modelValue===void 0}),_=we(()=>Array.isArray(p.value)?[...p.value]:[]),y=ke(0),x=ke(_.value);function M(w){const I=aT(_.value,w);D(w,I)}function A(w){D(w,y.value)}function P(){const w=x.value[y.value];_.value[y.value]!==w&&i("valueCommit",St(_.value))}function D(w,I,{commit:L}={commit:!1}){const V=dT(o.value),$=fT(Math.round((w-r.value)/o.value)*o.value+r.value,V),X=Dp($,r.value,s.value),W=sT(_.value,X,I);if(uT(W,a.value*o.value)){y.value=W.indexOf(X);const B=String(W)!==String(p.value);B&&L&&i("valueCommit",W),B&&(b.value[y.value]?.focus(),p.value=W)}}const b=ke([]);return vT({modelValue:p,currentModelValue:_,valueIndexToChangeRef:y,thumbElements:b,orientation:l,min:r,max:s,disabled:c,thumbAlignment:u}),(w,I)=>(me(),Ie(E(m),null,{default:te(()=>[(me(),Ie(Ep(E(l)==="horizontal"?pT:gT),It(w.$attrs,{ref:E(h),"as-child":w.asChild,as:w.as,min:E(r),max:E(s),dir:E(f),inverted:w.inverted,"aria-disabled":E(c),"data-disabled":E(c)?"":void 0,onPointerdown:I[0]||(I[0]=()=>{E(c)||(x.value=_.value)}),onSlideStart:I[1]||(I[1]=L=>!E(c)&&M(L)),onSlideMove:I[2]||(I[2]=L=>!E(c)&&A(L)),onSlideEnd:I[3]||(I[3]=L=>!E(c)&&P()),onHomeKeyDown:I[4]||(I[4]=L=>!E(c)&&D(E(r),0,{commit:!0})),onEndKeyDown:I[5]||(I[5]=L=>!E(c)&&D(E(s),_.value.length-1,{commit:!0})),onStepKeyDown:I[6]||(I[6]=(L,V)=>{if(!E(c)){const W=E(Py).includes(L.key)||L.shiftKey&&E(Ry).includes(L.key)?10:1,B=y.value,z=_.value[B],de=E(o)*W*V;D(z+de,B,{commit:!0})}})}),{default:te(()=>[at(w.$slots,"default",{modelValue:E(p)}),E(v)&&w.name?(me(),Ie(E(hy),{key:0,type:"number",value:E(p),name:w.name,required:w.required,disabled:E(c),step:E(o)},null,8,["value","name","required","disabled","step"])):fi("v-if",!0)]),_:3},16,["as-child","as","min","max","dir","inverted","aria-disabled","data-disabled"]))]),_:3}))}}),xT=_T,yT=Ne({__name:"SliderImpl",props:{asChild:{type:Boolean,required:!1},as:{type:null,required:!1,default:"span"}},emits:["slideStart","slideMove","slideEnd","homeKeyDown","endKeyDown","stepKeyDown"],setup(t,{emit:e}){const n=t,i=e,r=pa();return(s,o)=>(me(),Ie(E(wn),It({"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()):E(Py).concat(E(Ry)).includes(a.key)&&(i("stepKeyDown",a),a.preventDefault())}),onPointerdown:o[1]||(o[1]=a=>{const l=a.target;l.setPointerCapture(a.pointerId),a.preventDefault(),E(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:te(()=>[at(s.$slots,"default")]),_:3},16))}}),Ly=yT,bT=Ne({__name:"SliderRange",props:{asChild:{type:Boolean,required:!1},as:{type:null,required:!1,default:"span"}},setup(t){const e=pa(),n=Iy();sn();const i=we(()=>e.currentModelValue.value.map(o=>Cy(o,e.min.value,e.max.value))),r=we(()=>e.currentModelValue.value.length>1?Math.min(...i.value):0),s=we(()=>100-Math.max(...i.value,0));return(o,a)=>(me(),Ie(E(wn),{"data-disabled":E(e).disabled.value?"":void 0,"data-orientation":E(e).orientation.value,"as-child":o.asChild,as:o.as,style:$r({[E(n).startEdge.value]:`${r.value}%`,[E(n).endEdge.value]:`${s.value}%`})},{default:te(()=>[at(o.$slots,"default")]),_:3},8,["data-disabled","data-orientation","as-child","as","style"]))}}),ST=bT,wT=Ne({inheritAttrs:!1,__name:"SliderThumbImpl",props:{index:{type:Number,required:!0},asChild:{type:Boolean,required:!1},as:{type:null,required:!1}},setup(t){const e=t,n=pa(),i=Iy(),{forwardRef:r,currentElement:s}=sn(),{CollectionItem:o}=Up(),a=we(()=>n.modelValue?.value?.[e.index]),l=we(()=>a.value===void 0?0:Cy(a.value,n.min.value??0,n.max.value??100)),c=we(()=>oT(e.index,n.modelValue?.value?.length??0)),u=oy(s),d=we(()=>u[i.size].value),f=we(()=>n.thumbAlignment.value==="overflow"||!d.value?0:lT(d.value,l.value,i.direction.value)),h=ty();return ti(()=>{n.thumbElements.value.push(s.value)}),fa(()=>{const g=n.thumbElements.value.findIndex(v=>v===s.value)??-1;n.thumbElements.value.splice(g,1)}),(g,v)=>(me(),Ie(E(o),null,{default:te(()=>[ie(E(wn),It(g.$attrs,{ref:E(r),role:"slider",tabindex:E(n).disabled.value?void 0:0,"aria-label":g.$attrs["aria-label"]||c.value,"data-disabled":E(n).disabled.value?"":void 0,"data-orientation":E(n).orientation.value,"aria-valuenow":a.value,"aria-valuemin":E(n).min.value,"aria-valuemax":E(n).max.value,"aria-orientation":E(n).orientation.value,"as-child":g.asChild,as:g.as,style:{transform:"var(--reka-slider-thumb-transform)",position:"absolute",[E(i).startEdge.value]:`calc(${l.value}% + ${f.value}px)`,display:!E(h)&&a.value===void 0?"none":void 0},onFocus:v[0]||(v[0]=()=>{E(n).valueIndexToChangeRef.value=g.index})}),{default:te(()=>[at(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}))}}),MT=wT,ET=Ne({__name:"SliderThumb",props:{asChild:{type:Boolean,required:!1},as:{type:null,required:!1,default:"span"}},setup(t){const e=t,{getItems:n}=Up(),{forwardRef:i,currentElement:r}=sn(),s=we(()=>r.value?n(!0).findIndex(o=>o.ref===r.value):-1);return(o,a)=>(me(),Ie(MT,It({ref:E(i)},e,{index:s.value}),{default:te(()=>[at(o.$slots,"default")]),_:3},16,["index"]))}}),TT=ET,AT=Ne({__name:"SliderTrack",props:{asChild:{type:Boolean,required:!1},as:{type:null,required:!1,default:"span"}},setup(t){const e=pa();return sn(),(n,i)=>(me(),Ie(E(wn),{"as-child":n.asChild,as:n.as,"data-disabled":E(e).disabled.value?"":void 0,"data-orientation":E(e).orientation.value},{default:te(()=>[at(n.$slots,"default")]),_:3},8,["as-child","as","data-disabled","data-orientation"]))}}),CT=AT;const[Ml,PT]=Jr("PopoverRoot");var RT=Ne({__name:"PopoverRoot",props:{defaultOpen:{type:Boolean,required:!1,default:!1},open:{type:Boolean,required:!1,default:void 0},modal:{type:Boolean,required:!1,default:!1}},emits:["update:open"],setup(t,{emit:e}){const n=t,i=e,{modal:r}=zr(n),s=Uu(n,"open",i,{defaultValue:n.defaultOpen,passive:n.open===void 0});return PT({contentId:"",triggerId:"",modal:r,open:s,onOpenChange:l=>{s.value=l},onOpenToggle:()=>{s.value=!s.value},triggerElement:ke(),hasCustomAnchor:ke(!1)}),(l,c)=>(me(),Ie(E(my),null,{default:te(()=>[at(l.$slots,"default",{open:E(s),close:()=>s.value=!1})]),_:3}))}}),DT=RT,IT=Ne({__name:"PopoverContentImpl",props:{trapFocus:{type:Boolean,required:!1},side:{type:null,required:!1},sideOffset:{type:Number,required:!1},sideFlip:{type:Boolean,required:!1},align:{type:null,required:!1},alignOffset:{type:Number,required:!1},alignFlip:{type:Boolean,required:!1},avoidCollisions:{type:Boolean,required:!1},collisionBoundary:{type:null,required:!1},collisionPadding:{type:[Number,Object],required:!1},arrowPadding:{type:Number,required:!1},hideShiftedArrow:{type:Boolean,required:!1},sticky:{type:String,required:!1},hideWhenDetached:{type:Boolean,required:!1},positionStrategy:{type:String,required:!1},updatePositionStrategy:{type:String,required:!1},disableUpdateOnLayoutShift:{type:Boolean,required:!1},prioritizePosition:{type:Boolean,required:!1},reference:{type:null,required:!1},asChild:{type:Boolean,required:!1},as:{type:null,required:!1},disableOutsidePointerEvents:{type:Boolean,required:!1}},emits:["escapeKeyDown","pointerDownOutside","focusOutside","interactOutside","openAutoFocus","closeAutoFocus"],setup(t,{emit:e}){const n=t,i=e,r=Sl(co(n,"trapFocus","disableOutsidePointerEvents")),{forwardRef:s}=sn(),o=Ml();return b1(),(a,l)=>(me(),Ie(E(J1),{"as-child":"",loop:"",trapped:a.trapFocus,onMountAutoFocus:l[5]||(l[5]=c=>i("openAutoFocus",c)),onUnmountAutoFocus:l[6]||(l[6]=c=>i("closeAutoFocus",c))},{default:te(()=>[ie(E(cy),{"as-child":"","disable-outside-pointer-events":a.disableOutsidePointerEvents,onPointerDownOutside:l[0]||(l[0]=c=>i("pointerDownOutside",c)),onInteractOutside:l[1]||(l[1]=c=>i("interactOutside",c)),onEscapeKeyDown:l[2]||(l[2]=c=>i("escapeKeyDown",c)),onFocusOutside:l[3]||(l[3]=c=>i("focusOutside",c)),onDismiss:l[4]||(l[4]=c=>E(o).onOpenChange(!1))},{default:te(()=>[ie(E(Ay),It(E(r),{id:E(o).contentId,ref:E(s),"data-state":E(o).open.value?"open":"closed","aria-labelledby":E(o).triggerId,style:{"--reka-popover-content-transform-origin":"var(--reka-popper-transform-origin)","--reka-popover-content-available-width":"var(--reka-popper-available-width)","--reka-popover-content-available-height":"var(--reka-popper-available-height)","--reka-popover-trigger-width":"var(--reka-popper-anchor-width)","--reka-popover-trigger-height":"var(--reka-popper-anchor-height)"},role:"dialog"}),{default:te(()=>[at(a.$slots,"default")]),_:3},16,["id","data-state","aria-labelledby"])]),_:3},8,["disable-outside-pointer-events"])]),_:3},8,["trapped"]))}}),Oy=IT,NT=Ne({__name:"PopoverContentModal",props:{side:{type:null,required:!1},sideOffset:{type:Number,required:!1},sideFlip:{type:Boolean,required:!1},align:{type:null,required:!1},alignOffset:{type:Number,required:!1},alignFlip:{type:Boolean,required:!1},avoidCollisions:{type:Boolean,required:!1},collisionBoundary:{type:null,required:!1},collisionPadding:{type:[Number,Object],required:!1},arrowPadding:{type:Number,required:!1},hideShiftedArrow:{type:Boolean,required:!1},sticky:{type:String,required:!1},hideWhenDetached:{type:Boolean,required:!1},positionStrategy:{type:String,required:!1},updatePositionStrategy:{type:String,required:!1},disableUpdateOnLayoutShift:{type:Boolean,required:!1},prioritizePosition:{type:Boolean,required:!1},reference:{type:null,required:!1},asChild:{type:Boolean,required:!1},as:{type:null,required:!1},disableOutsidePointerEvents:{type:Boolean,required:!1}},emits:["escapeKeyDown","pointerDownOutside","focusOutside","interactOutside","openAutoFocus","closeAutoFocus"],setup(t,{emit:e}){const n=t,i=e,r=Ml(),s=ke(!1);v1(!0);const o=ar(n,i),{forwardRef:a,currentElement:l}=sn();return N1(l),(c,u)=>(me(),Ie(Oy,It(E(o),{ref:E(a),"trap-focus":E(r).open.value,"disable-outside-pointer-events":"",onCloseAutoFocus:u[0]||(u[0]=_i(d=>{i("closeAutoFocus",d),s.value||E(r).triggerElement.value?.focus()},["prevent"])),onPointerDownOutside:u[1]||(u[1]=d=>{i("pointerDownOutside",d);const f=d.detail.originalEvent,h=f.button===0&&f.ctrlKey===!0,g=f.button===2||h;s.value=g}),onFocusOutside:u[2]||(u[2]=_i(()=>{},["prevent"]))}),{default:te(()=>[at(c.$slots,"default")]),_:3},16,["trap-focus"]))}}),LT=NT,OT=Ne({__name:"PopoverContentNonModal",props:{side:{type:null,required:!1},sideOffset:{type:Number,required:!1},sideFlip:{type:Boolean,required:!1},align:{type:null,required:!1},alignOffset:{type:Number,required:!1},alignFlip:{type:Boolean,required:!1},avoidCollisions:{type:Boolean,required:!1},collisionBoundary:{type:null,required:!1},collisionPadding:{type:[Number,Object],required:!1},arrowPadding:{type:Number,required:!1},hideShiftedArrow:{type:Boolean,required:!1},sticky:{type:String,required:!1},hideWhenDetached:{type:Boolean,required:!1},positionStrategy:{type:String,required:!1},updatePositionStrategy:{type:String,required:!1},disableUpdateOnLayoutShift:{type:Boolean,required:!1},prioritizePosition:{type:Boolean,required:!1},reference:{type:null,required:!1},asChild:{type:Boolean,required:!1},as:{type:null,required:!1},disableOutsidePointerEvents:{type:Boolean,required:!1}},emits:["escapeKeyDown","pointerDownOutside","focusOutside","interactOutside","openAutoFocus","closeAutoFocus"],setup(t,{emit:e}){const n=t,i=e,r=Ml(),s=ke(!1),o=ke(!1),a=ar(n,i);return(l,c)=>(me(),Ie(Oy,It(E(a),{"trap-focus":!1,"disable-outside-pointer-events":!1,onCloseAutoFocus:c[0]||(c[0]=u=>{i("closeAutoFocus",u),u.defaultPrevented||(s.value||E(r).triggerElement.value?.focus(),u.preventDefault()),s.value=!1,o.value=!1}),onInteractOutside:c[1]||(c[1]=async u=>{i("interactOutside",u),u.defaultPrevented||(s.value=!0,u.detail.originalEvent.type==="pointerdown"&&(o.value=!0));const d=u.target;E(r).triggerElement.value?.contains(d)&&u.preventDefault(),u.detail.originalEvent.type==="focusin"&&o.value&&u.preventDefault()})}),{default:te(()=>[at(l.$slots,"default")]),_:3},16))}}),FT=OT,UT=Ne({__name:"PopoverContent",props:{forceMount:{type:Boolean,required:!1},side:{type:null,required:!1},sideOffset:{type:Number,required:!1},sideFlip:{type:Boolean,required:!1},align:{type:null,required:!1},alignOffset:{type:Number,required:!1},alignFlip:{type:Boolean,required:!1},avoidCollisions:{type:Boolean,required:!1},collisionBoundary:{type:null,required:!1},collisionPadding:{type:[Number,Object],required:!1},arrowPadding:{type:Number,required:!1},hideShiftedArrow:{type:Boolean,required:!1},sticky:{type:String,required:!1},hideWhenDetached:{type:Boolean,required:!1},positionStrategy:{type:String,required:!1},updatePositionStrategy:{type:String,required:!1},disableUpdateOnLayoutShift:{type:Boolean,required:!1},prioritizePosition:{type:Boolean,required:!1},reference:{type:null,required:!1},asChild:{type:Boolean,required:!1},as:{type:null,required:!1},disableOutsidePointerEvents:{type:Boolean,required:!1}},emits:["escapeKeyDown","pointerDownOutside","focusOutside","interactOutside","openAutoFocus","closeAutoFocus"],setup(t,{emit:e}){const n=t,i=e,r=Ml(),s=ar(n,i),{forwardRef:o}=sn();return r.contentId||=Fp(void 0,"reka-popover-content"),(a,l)=>(me(),Ie(E(ay),{present:a.forceMount||E(r).open.value},{default:te(()=>[E(r).modal.value?(me(),Ie(LT,It({key:0},E(s),{ref:E(o)}),{default:te(()=>[at(a.$slots,"default")]),_:3},16)):(me(),Ie(FT,It({key:1},E(s),{ref:E(o)}),{default:te(()=>[at(a.$slots,"default")]),_:3},16))]),_:3},8,["present"]))}}),kT=UT,BT=Ne({__name:"PopoverPortal",props:{to:{type:null,required:!1},disabled:{type:Boolean,required:!1},defer:{type:Boolean,required:!1},forceMount:{type:Boolean,required:!1}},setup(t){const e=t;return(n,i)=>(me(),Ie(E(dy),Ss(Yr(e)),{default:te(()=>[at(n.$slots,"default")]),_:3},16))}}),zT=BT,VT=Ne({__name:"PopoverTrigger",props:{asChild:{type:Boolean,required:!1},as:{type:null,required:!1,default:"button"}},setup(t){const e=t,n=Ml(),{forwardRef:i,currentElement:r}=sn();return n.triggerId||=Fp(void 0,"reka-popover-trigger"),ti(()=>{n.triggerElement.value=r.value}),(s,o)=>(me(),Ie(Ep(E(n).hasCustomAnchor.value?E(wn):E(gy)),{"as-child":""},{default:te(()=>[ie(E(wn),{id:E(n).triggerId,ref:E(i),type:s.as==="button"?"button":void 0,"aria-haspopup":"dialog","aria-expanded":E(n).open.value,"aria-controls":E(n).contentId,"data-state":E(n).open.value?"open":"closed",as:s.as,"as-child":e.asChild,onClick:E(n).onOpenToggle},{default:te(()=>[at(s.$slots,"default")]),_:3},8,["id","type","aria-expanded","aria-controls","data-state","as","as-child","onClick"])]),_:3}))}}),HT=VT;let $d=new Map,fh=!1;try{fh=new Intl.NumberFormat("de-DE",{signDisplay:"exceptZero"}).resolvedOptions().signDisplay==="exceptZero"}catch{}let ru=!1;try{ru=new Intl.NumberFormat("de-DE",{style:"unit",unit:"degree"}).resolvedOptions().style==="unit"}catch{}const Fy={degree:{narrow:{default:"°","ja-JP":" 度","zh-TW":"度","sl-SI":" °"}}};class Uy{format(e){let n="";if(!fh&&this.options.signDisplay!=null?n=WT(this.numberFormatter,this.options.signDisplay,e):n=this.numberFormatter.format(e),this.options.style==="unit"&&!ru){var i;let{unit:r,unitDisplay:s="short",locale:o}=this.resolvedOptions();if(!r)return n;let a=(i=Fy[r])===null||i===void 0?void 0:i[s];n+=a[o]||a.default}return n}formatToParts(e){return this.numberFormatter.formatToParts(e)}formatRange(e,n){if(typeof this.numberFormatter.formatRange=="function")return this.numberFormatter.formatRange(e,n);if(n= start date");return`${this.format(e)} – ${this.format(n)}`}formatRangeToParts(e,n){if(typeof this.numberFormatter.formatRangeToParts=="function")return this.numberFormatter.formatRangeToParts(e,n);if(n= start date");let i=this.numberFormatter.formatToParts(e),r=this.numberFormatter.formatToParts(n);return[...i.map(s=>({...s,source:"startRange"})),{type:"literal",value:" – ",source:"shared"},...r.map(s=>({...s,source:"endRange"}))]}resolvedOptions(){let e=this.numberFormatter.resolvedOptions();return!fh&&this.options.signDisplay!=null&&(e={...e,signDisplay:this.options.signDisplay}),!ru&&this.options.style==="unit"&&(e={...e,style:"unit",unit:this.options.unit,unitDisplay:this.options.unitDisplay}),e}constructor(e,n={}){this.numberFormatter=GT(e,n),this.options=n}}function GT(t,e={}){let{numberingSystem:n}=e;if(n&&t.includes("-nu-")&&(t.includes("-u-")||(t+="-u-"),t+=`-nu-${n}`),e.style==="unit"&&!ru){var i;let{unit:o,unitDisplay:a="short"}=e;if(!o)throw new Error('unit option must be provided with style: "unit"');if(!(!((i=Fy[o])===null||i===void 0)&&i[a]))throw new Error(`Unsupported unit ${o} with unitDisplay = ${a}`);e={...e,style:"decimal"}}let r=t+(e?Object.entries(e).sort((o,a)=>o[0]0||Object.is(n,0):e==="exceptZero"&&(Object.is(n,-0)||Object.is(n,0)?n=Math.abs(n):i=n>0),i){let r=t.format(-n),s=t.format(n),o=r.replace(s,"").replace(/\u200e|\u061C/,"");return[...o].length!==1&&console.warn("@react-aria/i18n polyfill for NumberFormat signDisplay: Unsupported case"),r.replace(s,"!!!").replace(o,"+").replace("!!!",s)}else return t.format(n)}}const qT=new RegExp("^.*\\(.*\\).*$"),XT=["latn","arab","hanidec","deva","beng","fullwide"];class ky{parse(e){return jd(this.locale,this.options,e).parse(e)}isValidPartialNumber(e,n,i){return jd(this.locale,this.options,e).isValidPartialNumber(e,n,i)}getNumberingSystem(e){return jd(this.locale,this.options,e).options.numberingSystem}constructor(e,n={}){this.locale=e,this.options=n}}const qg=new Map;function jd(t,e,n){let i=Xg(t,e);if(!t.includes("-nu-")&&!i.isValidPartialNumber(n)){for(let r of XT)if(r!==i.options.numberingSystem){let s=Xg(t+(t.includes("-u-")?"-nu-":"-u-nu-")+r,e);if(s.isValidPartialNumber(n))return s}}return i}function Xg(t,e){let n=t+(e?Object.entries(e).sort((r,s)=>r[0]-1&&(n=`-${n}`)}let i=n?+n:NaN;if(isNaN(i))return NaN;if(this.options.style==="percent"){var r,s;let o={...this.options,style:"decimal",minimumFractionDigits:Math.min(((r=this.options.minimumFractionDigits)!==null&&r!==void 0?r:0)+2,20),maximumFractionDigits:Math.min(((s=this.options.maximumFractionDigits)!==null&&s!==void 0?s:0)+2,20)};return new ky(this.locale,o).parse(new Uy(this.locale,o).format(i))}return this.options.currencySign==="accounting"&&qT.test(e)&&(i=-1*i),i}sanitize(e){return e=e.replace(this.symbols.literals,""),this.symbols.minusSign&&(e=e.replace("-",this.symbols.minusSign)),this.options.numberingSystem==="arab"&&(this.symbols.decimal&&(e=e.replace(",",this.symbols.decimal),e=e.replace("،",this.symbols.decimal)),this.symbols.group&&(e=xo(e,".",this.symbols.group))),this.symbols.group==="’"&&e.includes("'")&&(e=xo(e,"'",this.symbols.group)),this.options.locale==="fr-FR"&&this.symbols.group&&(e=xo(e," ",this.symbols.group),e=xo(e,/\u00A0/g,this.symbols.group)),e}isValidPartialNumber(e,n=-1/0,i=1/0){return e=this.sanitize(e),this.symbols.minusSign&&e.startsWith(this.symbols.minusSign)&&n<0?e=e.slice(this.symbols.minusSign.length):this.symbols.plusSign&&e.startsWith(this.symbols.plusSign)&&i>0&&(e=e.slice(this.symbols.plusSign.length)),this.symbols.group&&e.startsWith(this.symbols.group)||this.symbols.decimal&&e.indexOf(this.symbols.decimal)>-1&&this.options.maximumFractionDigits===0?!1:(this.symbols.group&&(e=xo(e,this.symbols.group,"")),e=e.replace(this.symbols.numeral,""),this.symbols.decimal&&(e=e.replace(this.symbols.decimal,"")),e.length===0)}constructor(e,n={}){this.locale=e,n.roundingIncrement!==1&&n.roundingIncrement!=null&&(n.maximumFractionDigits==null&&n.minimumFractionDigits==null?(n.maximumFractionDigits=0,n.minimumFractionDigits=0):n.maximumFractionDigits==null?n.maximumFractionDigits=n.minimumFractionDigits:n.minimumFractionDigits==null&&(n.minimumFractionDigits=n.maximumFractionDigits)),this.formatter=new Intl.NumberFormat(e,n),this.options=this.formatter.resolvedOptions(),this.symbols=YT(e,this.formatter,this.options,n);var i,r;this.options.style==="percent"&&(((i=this.options.minimumFractionDigits)!==null&&i!==void 0?i:0)>18||((r=this.options.maximumFractionDigits)!==null&&r!==void 0?r:0)>18)&&console.warn("NumberParser cannot handle percentages with greater than 18 decimal places, please reduce the number in your options.")}}const $g=new Set(["decimal","fraction","integer","minusSign","plusSign","group"]),jT=[0,4,2,1,11,20,3,7,100,21,.1,1.1];function YT(t,e,n,i){var r,s,o,a;let l=new Intl.NumberFormat(t,{...n,minimumSignificantDigits:1,maximumSignificantDigits:21,roundingIncrement:1,roundingPriority:"auto",roundingMode:"halfExpand"}),c=l.formatToParts(-10000.111),u=l.formatToParts(10000.111),d=jT.map(w=>l.formatToParts(w));var f;let h=(f=(r=c.find(w=>w.type==="minusSign"))===null||r===void 0?void 0:r.value)!==null&&f!==void 0?f:"-",g=(s=u.find(w=>w.type==="plusSign"))===null||s===void 0?void 0:s.value;!g&&(i?.signDisplay==="exceptZero"||i?.signDisplay==="always")&&(g="+");let m=(o=new Intl.NumberFormat(t,{...n,minimumFractionDigits:2,maximumFractionDigits:2}).formatToParts(.001).find(w=>w.type==="decimal"))===null||o===void 0?void 0:o.value,p=(a=c.find(w=>w.type==="group"))===null||a===void 0?void 0:a.value,_=c.filter(w=>!$g.has(w.type)).map(w=>jg(w.value)),y=d.flatMap(w=>w.filter(I=>!$g.has(I.type)).map(I=>jg(I.value))),x=[...new Set([..._,...y])].sort((w,I)=>I.length-w.length),M=x.length===0?new RegExp("[\\p{White_Space}]","gu"):new RegExp(`${x.join("|")}|[\\p{White_Space}]`,"gu"),A=[...new Intl.NumberFormat(n.locale,{useGrouping:!1}).format(9876543210)].reverse(),P=new Map(A.map((w,I)=>[w,I])),D=new RegExp(`[${A.join("")}]`,"g");return{minusSign:h,plusSign:g,decimal:m,group:p,literals:M,numeral:D,index:w=>String(P.get(w))}}function xo(t,e,n){return t.replaceAll?t.replaceAll(e,n):t.split(e).join(n)}function jg(t){return t.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function By(t){const{disabled:e}=t,n=ke(),i=Qx(),r=()=>window.clearTimeout(n.value),s=f=>{r(),!e.value&&(i.trigger(),n.value=window.setTimeout(()=>{s(60)},f))},o=()=>{s(400)},a=()=>{r()},l=ke(!1),c=we(()=>ws(t.target)),u=f=>{f.button!==0||l.value||(f.preventDefault(),l.value=!0,o())},d=()=>{l.value=!1,a()};return Ui&&(no(c||window,"pointerdown",u),no(window,"pointerup",d),no(window,"pointercancel",d)),{isPressed:l,onTrigger:i.on}}function Yg(t,e=ke({})){return Ip(()=>new Uy(t.value,e.value))}function JT(t,e=ke({})){return Ip(()=>new ky(t.value,e.value))}function Jg(t,e,n){let i=t==="+"?e+n:e-n;if(e%1!==0||n%1!==0){const r=e.toString().split("."),s=n.toString().split("."),o=r[1]&&r[1].length||0,a=s[1]&&s[1].length||0,l=10**Math.max(o,a);e=Math.round(e*l),n=Math.round(n*l),i=t==="+"?e+n:e-n,i/=l}return i}const[Xp,KT]=Jr("NumberFieldRoot");var ZT=Ne({inheritAttrs:!1,__name:"NumberFieldRoot",props:{defaultValue:{type:Number,required:!1,default:void 0},modelValue:{type:[Number,null],required:!1},min:{type:Number,required:!1},max:{type:Number,required:!1},step:{type:Number,required:!1,default:1},stepSnapping:{type:Boolean,required:!1,default:!0},focusOnChange:{type:Boolean,required:!1,default:!0},formatOptions:{type:null,required:!1},locale:{type:String,required:!1},disabled:{type:Boolean,required:!1},readonly:{type:Boolean,required:!1},disableWheelChange:{type:Boolean,required:!1},invertWheelChange:{type:Boolean,required:!1},id:{type:String,required:!1},asChild:{type:Boolean,required:!1},as:{type:null,required:!1,default:"div"},name:{type:String,required:!1},required:{type:Boolean,required:!1}},emits:["update:modelValue"],setup(t,{emit:e}){const n=t,i=e,{disabled:r,readonly:s,disableWheelChange:o,invertWheelChange:a,min:l,max:c,step:u,stepSnapping:d,formatOptions:f,id:h,locale:g}=zr(n),v=Uu(n,"modelValue",i,{defaultValue:n.defaultValue,passive:n.modelValue===void 0}),{primitiveElement:m,currentElement:p}=ro(),_=L1(g),y=ry(p),x=ke(),M=we(()=>!Nc(v.value)&&(z(v.value)===l.value||l.value&&!isNaN(v.value)?Jg("-",v.value,u.value)!Nc(v.value)&&(z(v.value)===c.value||c.value&&!isNaN(v.value)?Jg("+",v.value,u.value)>c.value:!1));function P(le,pe=1){if(n.focusOnChange&&x.value?.focus(),n.disabled||n.readonly)return;const He=L.parse(x.value?.value??"");isNaN(He)?v.value=l.value??0:le==="increase"?v.value=z(He+(u.value??1)*pe):v.value=z(He-(u.value??1)*pe)}function D(le=1){P("increase",le)}function b(le=1){P("decrease",le)}function w(le){le==="min"&&l.value!==void 0?v.value=z(l.value):le==="max"&&c.value!==void 0&&(v.value=z(c.value))}const I=Yg(_,f),L=JT(_,f),V=we(()=>I.resolvedOptions().maximumFractionDigits>0?"decimal":"numeric"),$=Yg(_,f),X=we(()=>Nc(v.value)||isNaN(v.value)?"":$.format(v.value));function W(le){return L.isValidPartialNumber(le,l.value,c.value)}function B(le){x.value&&(x.value.value=le)}function z(le){let pe;return u.value===void 0||isNaN(u.value)||!d.value?pe=Dp(le,l.value,c.value):pe=QM(le,l.value,c.value,u.value),pe=L.parse(I.format(pe)),pe}function de(le){const pe=L.parse(le);return v.value=isNaN(pe)?void 0:z(pe),le.length?(isNaN(pe),B(X.value)):B(le)}return KT({modelValue:v,handleDecrease:b,handleIncrease:D,handleMinMaxValue:w,inputMode:V,inputEl:x,onInputElement:le=>x.value=le,textValue:X,readonly:s,validate:W,applyInputValue:de,disabled:r,disableWheelChange:o,invertWheelChange:a,max:c,min:l,isDecreaseDisabled:M,isIncreaseDisabled:A,id:h}),(le,pe)=>(me(),Ie(E(wn),It(le.$attrs,{ref_key:"primitiveElement",ref:m,role:"group",as:le.as,"as-child":le.asChild,"data-disabled":E(r)?"":void 0,"data-readonly":E(s)?"":void 0}),{default:te(()=>[at(le.$slots,"default",{modelValue:E(v),textValue:X.value,readonly:E(s)}),E(y)&&le.name?(me(),Ie(E(hy),{key:0,type:"text",value:E(v),name:le.name,disabled:E(r),readonly:E(s),required:le.required},null,8,["value","name","disabled","readonly","required"])):fi("v-if",!0)]),_:3},16,["as","as-child","data-disabled","data-readonly"]))}}),QT=ZT,eA=Ne({__name:"NumberFieldDecrement",props:{disabled:{type:Boolean,required:!1},asChild:{type:Boolean,required:!1},as:{type:null,required:!1,default:"button"}},setup(t){const e=t,n=Xp(),i=we(()=>n.disabled?.value||n.readonly.value||e.disabled||n.isDecreaseDisabled.value),{primitiveElement:r,currentElement:s}=ro(),{isPressed:o,onTrigger:a}=By({target:s,disabled:i});return a(()=>{n.handleDecrease()}),(l,c)=>(me(),Ie(E(wn),It(e,{ref_key:"primitiveElement",ref:r,tabindex:"-1","aria-label":"Decrease",type:l.as==="button"?"button":void 0,style:{userSelect:E(o)?"none":void 0},disabled:i.value?"":void 0,"data-disabled":i.value?"":void 0,"data-pressed":E(o)?"true":void 0,onContextmenu:c[0]||(c[0]=_i(()=>{},["prevent"]))}),{default:te(()=>[at(l.$slots,"default")]),_:3},16,["type","style","disabled","data-disabled","data-pressed"]))}}),tA=eA,nA=Ne({__name:"NumberFieldIncrement",props:{disabled:{type:Boolean,required:!1},asChild:{type:Boolean,required:!1},as:{type:null,required:!1,default:"button"}},setup(t){const e=t,n=Xp(),i=we(()=>n.disabled?.value||n.readonly.value||e.disabled||n.isIncreaseDisabled.value),{primitiveElement:r,currentElement:s}=ro(),{isPressed:o,onTrigger:a}=By({target:s,disabled:i});return a(()=>{n.handleIncrease()}),(l,c)=>(me(),Ie(E(wn),It(e,{ref_key:"primitiveElement",ref:r,tabindex:"-1","aria-label":"Increase",type:l.as==="button"?"button":void 0,style:{userSelect:E(o)?"none":void 0},disabled:i.value?"":void 0,"data-disabled":i.value?"":void 0,"data-pressed":E(o)?"true":void 0,onContextmenu:c[0]||(c[0]=_i(()=>{},["prevent"]))}),{default:te(()=>[at(l.$slots,"default")]),_:3},16,["type","style","disabled","data-disabled","data-pressed"]))}}),iA=nA,rA=Ne({__name:"NumberFieldInput",props:{asChild:{type:Boolean,required:!1},as:{type:null,required:!1,default:"input"}},setup(t){const e=t,{primitiveElement:n,currentElement:i}=ro(),r=Xp();function s(l){r.disableWheelChange.value||l.target===to()&&(Math.abs(l.deltaY)<=Math.abs(l.deltaX)||(l.preventDefault(),l.deltaY>0?r.invertWheelChange.value?r.handleDecrease():r.handleIncrease():l.deltaY<0&&(r.invertWheelChange.value?r.handleIncrease():r.handleDecrease())))}ti(()=>{r.onInputElement(i.value)});const o=ke(r.textValue.value);rn(()=>r.textValue.value,()=>{o.value=r.textValue.value},{immediate:!0,deep:!0});function a(){requestAnimationFrame(()=>{o.value=r.textValue.value})}return(l,c)=>(me(),Ie(E(wn),It(e,{id:E(r).id.value,ref_key:"primitiveElement",ref:n,value:o.value,role:"spinbutton",type:"text",tabindex:"0",inputmode:E(r).inputMode.value,disabled:E(r).disabled.value?"":void 0,"data-disabled":E(r).disabled.value?"":void 0,readonly:E(r).readonly.value?"":void 0,"data-readonly":E(r).readonly.value?"":void 0,autocomplete:"off",autocorrect:"off",spellcheck:"false","aria-roledescription":"Number field","aria-valuenow":E(r).modelValue.value,"aria-valuemin":E(r).min.value,"aria-valuemax":E(r).max.value,onKeydown:[c[0]||(c[0]=Is(_i(u=>E(r).handleIncrease(),["prevent"]),["up"])),c[1]||(c[1]=Is(_i(u=>E(r).handleDecrease(),["prevent"]),["down"])),c[2]||(c[2]=Is(_i(u=>E(r).handleIncrease(10),["prevent"]),["page-up"])),c[3]||(c[3]=Is(_i(u=>E(r).handleDecrease(10),["prevent"]),["page-down"])),c[4]||(c[4]=Is(_i(u=>E(r).handleMinMaxValue("min"),["prevent"]),["home"])),c[5]||(c[5]=Is(_i(u=>E(r).handleMinMaxValue("max"),["prevent"]),["end"])),c[8]||(c[8]=Is(u=>E(r).applyInputValue(u.target?.value),["enter"]))],onWheel:s,onBeforeinput:c[6]||(c[6]=u=>{const d=u.target;let f=d.value.slice(0,d.selectionStart??void 0)+(u.data??"")+d.value.slice(d.selectionEnd??void 0);E(r).validate(f)||u.preventDefault()}),onInput:c[7]||(c[7]=u=>{const d=u.target;o.value=d.value}),onChange:a,onBlur:c[9]||(c[9]=u=>E(r).applyInputValue(u.target?.value))}),{default:te(()=>[at(l.$slots,"default")]),_:3},16,["id","value","inputmode","disabled","data-disabled","readonly","data-readonly","aria-valuenow","aria-valuemin","aria-valuemax"]))}}),sA=rA;const[Hu,oA]=Jr("TooltipProvider");var aA=Ne({inheritAttrs:!1,__name:"TooltipProvider",props:{delayDuration:{type:Number,required:!1,default:700},skipDelayDuration:{type:Number,required:!1,default:300},disableHoverableContent:{type:Boolean,required:!1,default:!1},disableClosingTrigger:{type:Boolean,required:!1},disabled:{type:Boolean,required:!1},ignoreNonKeyboardFocus:{type:Boolean,required:!1,default:!1},content:{type:Object,required:!1}},setup(t){const e=t,{delayDuration:n,skipDelayDuration:i,disableHoverableContent:r,disableClosingTrigger:s,ignoreNonKeyboardFocus:o,disabled:a,content:l}=zr(e);sn();const c=ke(!0),u=ke(!1),{start:d,stop:f}=ey(()=>{c.value=!0},i,{immediate:!1});return oA({isOpenDelayed:c,delayDuration:n,onOpen(){f(),c.value=!1},onClose(){d()},isPointerInTransitRef:u,disableHoverableContent:r,disableClosingTrigger:s,disabled:a,ignoreNonKeyboardFocus:o,content:l}),(h,g)=>at(h.$slots,"default")}}),lA=aA;const zy="tooltip.open",[Gu,cA]=Jr("TooltipRoot");var uA=Ne({__name:"TooltipRoot",props:{defaultOpen:{type:Boolean,required:!1,default:!1},open:{type:Boolean,required:!1,default:void 0},delayDuration:{type:Number,required:!1,default:void 0},disableHoverableContent:{type:Boolean,required:!1,default:void 0},disableClosingTrigger:{type:Boolean,required:!1,default:void 0},disabled:{type:Boolean,required:!1,default:void 0},ignoreNonKeyboardFocus:{type:Boolean,required:!1,default:void 0}},emits:["update:open"],setup(t,{emit:e}){const n=t,i=e;sn();const r=Hu(),s=we(()=>n.disableHoverableContent??r.disableHoverableContent.value),o=we(()=>n.disableClosingTrigger??r.disableClosingTrigger.value),a=we(()=>n.disabled??r.disabled.value),l=we(()=>n.delayDuration??r.delayDuration.value),c=we(()=>n.ignoreNonKeyboardFocus??r.ignoreNonKeyboardFocus.value),u=Uu(n,"open",i,{defaultValue:n.defaultOpen,passive:n.open===void 0});rn(u,y=>{r.onClose&&(y?(r.onOpen(),document.dispatchEvent(new CustomEvent(zy))):r.onClose())});const d=ke(!1),f=ke(),h=we(()=>u.value?d.value?"delayed-open":"instant-open":"closed"),{start:g,stop:v}=ey(()=>{d.value=!0,u.value=!0},l,{immediate:!1});function m(){v(),d.value=!1,u.value=!0}function p(){v(),u.value=!1}function _(){g()}return cA({contentId:"",open:u,stateAttribute:h,trigger:f,onTriggerChange(y){f.value=y},onTriggerEnter(){r.isOpenDelayed.value?_():m()},onTriggerLeave(){s.value?p():v()},onOpen:m,onClose:p,disableHoverableContent:s,disableClosingTrigger:o,disabled:a,ignoreNonKeyboardFocus:c}),(y,x)=>(me(),Ie(E(my),null,{default:te(()=>[at(y.$slots,"default",{open:E(u)})]),_:3}))}}),dA=uA,fA=Ne({__name:"TooltipContentImpl",props:{ariaLabel:{type:String,required:!1},asChild:{type:Boolean,required:!1,default:void 0},as:{type:null,required:!1},side:{type:null,required:!1},sideOffset:{type:Number,required:!1},align:{type:null,required:!1},alignOffset:{type:Number,required:!1},avoidCollisions:{type:Boolean,required:!1,default:void 0},collisionBoundary:{type:null,required:!1},collisionPadding:{type:[Number,Object],required:!1},arrowPadding:{type:Number,required:!1},sticky:{type:String,required:!1},hideWhenDetached:{type:Boolean,required:!1,default:void 0},positionStrategy:{type:String,required:!1},updatePositionStrategy:{type:String,required:!1}},emits:["escapeKeyDown","pointerDownOutside"],setup(t,{emit:e}){const n=t,i=e,r=Gu(),s=Hu(),{forwardRef:o,currentElement:a}=sn(),l=we(()=>n.ariaLabel||a.value?.textContent),c=we(()=>{const{ariaLabel:u,...d}=n;return ny(d,s.content.value??{},{side:"top",sideOffset:0,align:"center",avoidCollisions:!0,collisionBoundary:[],collisionPadding:0,arrowPadding:0,sticky:"partial",hideWhenDetached:!1})});return ti(()=>{no(window,"scroll",u=>{u.target?.contains(r.trigger.value)&&r.onClose()},{capture:!0}),no(window,zy,r.onClose)}),(u,d)=>(me(),Ie(E(cy),{"as-child":"","disable-outside-pointer-events":!1,onEscapeKeyDown:d[0]||(d[0]=f=>i("escapeKeyDown",f)),onPointerDownOutside:d[1]||(d[1]=f=>{E(r).disableClosingTrigger.value&&E(r).trigger.value?.contains(f.target)&&f.preventDefault(),i("pointerDownOutside",f)}),onFocusOutside:d[2]||(d[2]=_i(()=>{},["prevent"])),onDismiss:d[3]||(d[3]=f=>E(r).onClose())},{default:te(()=>[ie(E(Ay),It({ref:E(o),"data-state":E(r).stateAttribute.value},{...u.$attrs,...c.value},{style:{"--reka-tooltip-content-transform-origin":"var(--reka-popper-transform-origin)","--reka-tooltip-content-available-width":"var(--reka-popper-available-width)","--reka-tooltip-content-available-height":"var(--reka-popper-available-height)","--reka-tooltip-trigger-width":"var(--reka-popper-anchor-width)","--reka-tooltip-trigger-height":"var(--reka-popper-anchor-height)"}}),{default:te(()=>[at(u.$slots,"default"),ie(E(fy),{id:E(r).contentId,role:"tooltip"},{default:te(()=>[zt(Ci(l.value),1)]),_:1},8,["id"])]),_:3},16,["data-state"])]),_:3}))}}),Vy=fA,hA=Ne({__name:"TooltipContentHoverable",props:{ariaLabel:{type:String,required:!1},asChild:{type:Boolean,required:!1},as:{type:null,required:!1},side:{type:null,required:!1},sideOffset:{type:Number,required:!1},align:{type:null,required:!1},alignOffset:{type:Number,required:!1},avoidCollisions:{type:Boolean,required:!1},collisionBoundary:{type:null,required:!1},collisionPadding:{type:[Number,Object],required:!1},arrowPadding:{type:Number,required:!1},sticky:{type:String,required:!1},hideWhenDetached:{type:Boolean,required:!1},positionStrategy:{type:String,required:!1},updatePositionStrategy:{type:String,required:!1}},setup(t){const n=Sl(t),{forwardRef:i,currentElement:r}=sn(),{trigger:s,onClose:o}=Gu(),a=Hu(),{isPointerInTransit:l,onPointerExit:c}=S1(s,r);return a.isPointerInTransitRef=l,c(()=>{o()}),(u,d)=>(me(),Ie(Vy,It({ref:E(i)},E(n)),{default:te(()=>[at(u.$slots,"default")]),_:3},16))}}),pA=hA,mA=Ne({__name:"TooltipContent",props:{forceMount:{type:Boolean,required:!1},ariaLabel:{type:String,required:!1},asChild:{type:Boolean,required:!1},as:{type:null,required:!1},side:{type:null,required:!1},sideOffset:{type:Number,required:!1},align:{type:null,required:!1},alignOffset:{type:Number,required:!1},avoidCollisions:{type:Boolean,required:!1},collisionBoundary:{type:null,required:!1},collisionPadding:{type:[Number,Object],required:!1},arrowPadding:{type:Number,required:!1},sticky:{type:String,required:!1},hideWhenDetached:{type:Boolean,required:!1},positionStrategy:{type:String,required:!1},updatePositionStrategy:{type:String,required:!1}},emits:["escapeKeyDown","pointerDownOutside"],setup(t,{emit:e}){const n=t,i=e,r=Gu(),s=ar(n,i),{forwardRef:o}=sn();return(a,l)=>(me(),Ie(E(ay),{present:a.forceMount||E(r).open.value},{default:te(()=>[(me(),Ie(Ep(E(r).disableHoverableContent.value?Vy:pA),It({ref:E(o)},E(s)),{default:te(()=>[at(a.$slots,"default")]),_:3},16))]),_:3},8,["present"]))}}),gA=mA,vA=Ne({__name:"TooltipPortal",props:{to:{type:null,required:!1},disabled:{type:Boolean,required:!1},defer:{type:Boolean,required:!1},forceMount:{type:Boolean,required:!1}},setup(t){const e=t;return(n,i)=>(me(),Ie(E(dy),Ss(Yr(e)),{default:te(()=>[at(n.$slots,"default")]),_:3},16))}}),_A=vA,xA=Ne({__name:"TooltipTrigger",props:{reference:{type:null,required:!1},asChild:{type:Boolean,required:!1},as:{type:null,required:!1,default:"button"}},setup(t){const e=t,n=Gu(),i=Hu();n.contentId||=Fp(void 0,"reka-tooltip-content");const{forwardRef:r,currentElement:s}=sn(),o=ke(!1),a=ke(!1),l=we(()=>n.disabled.value?{}:{click:v,focus:h,pointermove:d,pointerleave:f,pointerdown:u,blur:g});ti(()=>{n.onTriggerChange(s.value)});function c(){setTimeout(()=>{o.value=!1},1)}function u(){n.open&&!n.disableClosingTrigger.value&&n.onClose(),o.value=!0,document.addEventListener("pointerup",c,{once:!0})}function d(m){m.pointerType!=="touch"&&!a.value&&!i.isPointerInTransitRef.value&&(n.onTriggerEnter(),a.value=!0)}function f(){n.onTriggerLeave(),a.value=!1}function h(m){o.value||n.ignoreNonKeyboardFocus.value&&!m.target.matches?.(":focus-visible")||n.onOpen()}function g(){n.onClose()}function v(){n.disableClosingTrigger.value||n.onClose()}return(m,p)=>(me(),Ie(E(gy),{"as-child":"",reference:m.reference},{default:te(()=>[ie(E(wn),It({ref:E(r),"aria-describedby":E(n).open.value?E(n).contentId:void 0,"data-state":E(n).stateAttribute.value,as:m.as,"as-child":e.asChild,"data-grace-area-trigger":""},Iw(l.value)),{default:te(()=>[at(m.$slots,"default")]),_:3},16,["aria-describedby","data-state","as","as-child"])]),_:3},8,["reference"]))}}),yA=xA;const bA=(t,e)=>{const n=new Array(t.length+e.length);for(let i=0;i({classGroupId:t,validator:e}),Hy=(t=new Map,e=null,n)=>({nextPart:t,validators:e,classGroupId:n}),su="-",Kg=[],wA="arbitrary..",MA=t=>{const e=TA(t),{conflictingClassGroups:n,conflictingClassGroupModifiers:i}=t;return{getClassGroupId:o=>{if(o.startsWith("[")&&o.endsWith("]"))return EA(o);const a=o.split(su),l=a[0]===""&&a.length>1?1:0;return Gy(a,l,e)},getConflictingClassGroupIds:(o,a)=>{if(a){const l=i[o],c=n[o];return l?c?bA(c,l):l:c||Kg}return n[o]||Kg}}},Gy=(t,e,n)=>{if(t.length-e===0)return n.classGroupId;const r=t[e],s=n.nextPart.get(r);if(s){const c=Gy(t,e+1,s);if(c)return c}const o=n.validators;if(o===null)return;const a=e===0?t.join(su):t.slice(e).join(su),l=o.length;for(let c=0;ct.slice(1,-1).indexOf(":")===-1?void 0:(()=>{const e=t.slice(1,-1),n=e.indexOf(":"),i=e.slice(0,n);return i?wA+i:void 0})(),TA=t=>{const{theme:e,classGroups:n}=t;return AA(n,e)},AA=(t,e)=>{const n=Hy();for(const i in t){const r=t[i];$p(r,n,i,e)}return n},$p=(t,e,n,i)=>{const r=t.length;for(let s=0;s{if(typeof t=="string"){PA(t,e,n);return}if(typeof t=="function"){RA(t,e,n,i);return}DA(t,e,n,i)},PA=(t,e,n)=>{const i=t===""?e:Wy(e,t);i.classGroupId=n},RA=(t,e,n,i)=>{if(IA(t)){$p(t(i),e,n,i);return}e.validators===null&&(e.validators=[]),e.validators.push(SA(n,t))},DA=(t,e,n,i)=>{const r=Object.entries(t),s=r.length;for(let o=0;o{let n=t;const i=e.split(su),r=i.length;for(let s=0;s"isThemeGetter"in t&&t.isThemeGetter===!0,NA=t=>{if(t<1)return{get:()=>{},set:()=>{}};let e=0,n=Object.create(null),i=Object.create(null);const r=(s,o)=>{n[s]=o,e++,e>t&&(e=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)}}},hh="!",Zg=":",LA=[],Qg=(t,e,n,i,r)=>({modifiers:t,hasImportantModifier:e,baseClassName:n,maybePostfixModifierPosition:i,isExternal:r}),OA=t=>{const{prefix:e,experimentalParseClassName:n}=t;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 Qg(s,h,f,g)};if(e){const r=e+Zg,s=i;i=o=>o.startsWith(r)?s(o.slice(r.length)):Qg(LA,!1,o,void 0,!0)}if(n){const r=i;i=s=>n({className:s,parseClassName:r})}return i},FA=t=>{const e=new Map;return t.orderSensitiveModifiers.forEach((n,i)=>{e.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}},UA=t=>({cache:NA(t.cacheSize),parseClassName:OA(t),sortModifiers:FA(t),...MA(t)}),kA=/\s+/,BA=(t,e)=>{const{parseClassName:n,getClassGroupId:i,getConflictingClassGroupIds:r,sortModifiers:s}=e,o=[],a=t.trim().split(kA);let l="";for(let c=a.length-1;c>=0;c-=1){const u=a[c],{isExternal:d,modifiers:f,hasImportantModifier:h,baseClassName:g,maybePostfixModifierPosition:v}=n(u);if(d){l=u+(l.length>0?" "+l:l);continue}let m=!!v,p=i(m?g.substring(0,v):g);if(!p){if(!m){l=u+(l.length>0?" "+l:l);continue}if(p=i(g),!p){l=u+(l.length>0?" "+l:l);continue}m=!1}const _=f.length===0?"":f.length===1?f[0]:s(f).join(":"),y=h?_+hh:_,x=y+p;if(o.indexOf(x)>-1)continue;o.push(x);const M=r(p,m);for(let A=0;A0?" "+l:l)}return l},zA=(...t)=>{let e=0,n,i,r="";for(;e{if(typeof t=="string")return t;let e,n="";for(let i=0;i{let n,i,r,s;const o=l=>{const c=e.reduce((u,d)=>d(u),t());return n=UA(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=BA(l,n);return r(l,u),u};return s=o,(...l)=>s(zA(...l))},HA=[],cn=t=>{const e=n=>n[t]||HA;return e.isThemeGetter=!0,e},Xy=/^\[(?:(\w[\w-]*):)?(.+)\]$/i,$y=/^\((?:(\w[\w-]*):)?(.+)\)$/i,GA=/^\d+\/\d+$/,WA=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,qA=/\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$/,XA=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix)\(.+\)$/,$A=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,jA=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,yo=t=>GA.test(t),gt=t=>!!t&&!Number.isNaN(Number(t)),es=t=>!!t&&Number.isInteger(Number(t)),Yd=t=>t.endsWith("%")&>(t.slice(0,-1)),mr=t=>WA.test(t),YA=()=>!0,JA=t=>qA.test(t)&&!XA.test(t),jy=()=>!1,KA=t=>$A.test(t),ZA=t=>jA.test(t),QA=t=>!We(t)&&!qe(t),eC=t=>ma(t,Ky,jy),We=t=>Xy.test(t),Ls=t=>ma(t,Zy,JA),Jd=t=>ma(t,sC,gt),e0=t=>ma(t,Yy,jy),tC=t=>ma(t,Jy,ZA),Hl=t=>ma(t,Qy,KA),qe=t=>$y.test(t),Sa=t=>ga(t,Zy),nC=t=>ga(t,oC),t0=t=>ga(t,Yy),iC=t=>ga(t,Ky),rC=t=>ga(t,Jy),Gl=t=>ga(t,Qy,!0),ma=(t,e,n)=>{const i=Xy.exec(t);return i?i[1]?e(i[1]):n(i[2]):!1},ga=(t,e,n=!1)=>{const i=$y.exec(t);return i?i[1]?e(i[1]):n:!1},Yy=t=>t==="position"||t==="percentage",Jy=t=>t==="image"||t==="url",Ky=t=>t==="length"||t==="size"||t==="bg-size",Zy=t=>t==="length",sC=t=>t==="number",oC=t=>t==="family-name",Qy=t=>t==="shadow",aC=()=>{const t=cn("color"),e=cn("font"),n=cn("text"),i=cn("font-weight"),r=cn("tracking"),s=cn("leading"),o=cn("breakpoint"),a=cn("container"),l=cn("spacing"),c=cn("radius"),u=cn("shadow"),d=cn("inset-shadow"),f=cn("text-shadow"),h=cn("drop-shadow"),g=cn("blur"),v=cn("perspective"),m=cn("aspect"),p=cn("ease"),_=cn("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"],M=()=>[...x(),qe,We],A=()=>["auto","hidden","clip","visible","scroll"],P=()=>["auto","contain","none"],D=()=>[qe,We,l],b=()=>[yo,"full","auto",...D()],w=()=>[es,"none","subgrid",qe,We],I=()=>["auto",{span:["full",es,qe,We]},es,qe,We],L=()=>[es,"auto",qe,We],V=()=>["auto","min","max","fr",qe,We],$=()=>["start","end","center","between","around","evenly","stretch","baseline","center-safe","end-safe"],X=()=>["start","end","center","stretch","center-safe","end-safe"],W=()=>["auto",...D()],B=()=>[yo,"auto","full","dvw","dvh","lvw","lvh","svw","svh","min","max","fit",...D()],z=()=>[t,qe,We],de=()=>[...x(),t0,e0,{position:[qe,We]}],le=()=>["no-repeat",{repeat:["","x","y","space","round"]}],pe=()=>["auto","cover","contain",iC,eC,{size:[qe,We]}],He=()=>[Yd,Sa,Ls],ze=()=>["","none","full",c,qe,We],st=()=>["",gt,Sa,Ls],xt=()=>["solid","dashed","dotted","double"],ce=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],ue=()=>[gt,Yd,t0,e0],Le=()=>["","none",g,qe,We],je=()=>["none",gt,qe,We],Ae=()=>["none",gt,qe,We],mt=()=>[gt,qe,We],O=()=>[yo,"full",...D()];return{cacheSize:500,theme:{animate:["spin","ping","pulse","bounce"],aspect:["video"],blur:[mr],breakpoint:[mr],color:[YA],container:[mr],"drop-shadow":[mr],ease:["in","out","in-out"],font:[QA],"font-weight":["thin","extralight","light","normal","medium","semibold","bold","extrabold","black"],"inset-shadow":[mr],leading:["none","tight","snug","normal","relaxed","loose"],perspective:["dramatic","near","normal","midrange","distant","none"],radius:[mr],shadow:[mr],spacing:["px",gt],text:[mr],"text-shadow":[mr],tracking:["tighter","tight","normal","wide","wider","widest"]},classGroups:{aspect:[{aspect:["auto","square",yo,We,qe,m]}],container:["container"],columns:[{columns:[gt,We,qe,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:M()}],overflow:[{overflow:A()}],"overflow-x":[{"overflow-x":A()}],"overflow-y":[{"overflow-y":A()}],overscroll:[{overscroll:P()}],"overscroll-x":[{"overscroll-x":P()}],"overscroll-y":[{"overscroll-y":P()}],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:[es,"auto",qe,We]}],basis:[{basis:[yo,"full","auto",a,...D()]}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["nowrap","wrap","wrap-reverse"]}],flex:[{flex:[gt,yo,"auto","initial","none",We]}],grow:[{grow:["",gt,qe,We]}],shrink:[{shrink:["",gt,qe,We]}],order:[{order:[es,"first","last","none",qe,We]}],"grid-cols":[{"grid-cols":w()}],"col-start-end":[{col:I()}],"col-start":[{"col-start":L()}],"col-end":[{"col-end":L()}],"grid-rows":[{"grid-rows":w()}],"row-start-end":[{row:I()}],"row-start":[{"row-start":L()}],"row-end":[{"row-end":L()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":V()}],"auto-rows":[{"auto-rows":V()}],gap:[{gap:D()}],"gap-x":[{"gap-x":D()}],"gap-y":[{"gap-y":D()}],"justify-content":[{justify:[...$(),"normal"]}],"justify-items":[{"justify-items":[...X(),"normal"]}],"justify-self":[{"justify-self":["auto",...X()]}],"align-content":[{content:["normal",...$()]}],"align-items":[{items:[...X(),{baseline:["","last"]}]}],"align-self":[{self:["auto",...X(),{baseline:["","last"]}]}],"place-content":[{"place-content":$()}],"place-items":[{"place-items":[...X(),"baseline"]}],"place-self":[{"place-self":["auto",...X()]}],p:[{p:D()}],px:[{px:D()}],py:[{py:D()}],ps:[{ps:D()}],pe:[{pe:D()}],pt:[{pt:D()}],pr:[{pr:D()}],pb:[{pb:D()}],pl:[{pl:D()}],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":D()}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":D()}],"space-y-reverse":["space-y-reverse"],size:[{size:B()}],w:[{w:[a,"screen",...B()]}],"min-w":[{"min-w":[a,"screen","none",...B()]}],"max-w":[{"max-w":[a,"screen","none","prose",{screen:[o]},...B()]}],h:[{h:["screen","lh",...B()]}],"min-h":[{"min-h":["screen","lh","none",...B()]}],"max-h":[{"max-h":["screen","lh",...B()]}],"font-size":[{text:["base",n,Sa,Ls]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:[i,qe,Jd]}],"font-stretch":[{"font-stretch":["ultra-condensed","extra-condensed","condensed","semi-condensed","normal","semi-expanded","expanded","extra-expanded","ultra-expanded",Yd,We]}],"font-family":[{font:[nC,We,e]}],"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,qe,We]}],"line-clamp":[{"line-clamp":[gt,"none",qe,Jd]}],leading:[{leading:[s,...D()]}],"list-image":[{"list-image":["none",qe,We]}],"list-style-position":[{list:["inside","outside"]}],"list-style-type":[{list:["disc","decimal","none",qe,We]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"placeholder-color":[{placeholder:z()}],"text-color":[{text:z()}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...xt(),"wavy"]}],"text-decoration-thickness":[{decoration:[gt,"from-font","auto",qe,Ls]}],"text-decoration-color":[{decoration:z()}],"underline-offset":[{"underline-offset":[gt,"auto",qe,We]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],"text-wrap":[{text:["wrap","nowrap","balance","pretty"]}],indent:[{indent:D()}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",qe,We]}],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",qe,We]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:de()}],"bg-repeat":[{bg:le()}],"bg-size":[{bg:pe()}],"bg-image":[{bg:["none",{linear:[{to:["t","tr","r","br","b","bl","l","tl"]},es,qe,We],radial:["",qe,We],conic:[es,qe,We]},rC,tC]}],"bg-color":[{bg:z()}],"gradient-from-pos":[{from:He()}],"gradient-via-pos":[{via:He()}],"gradient-to-pos":[{to:He()}],"gradient-from":[{from:z()}],"gradient-via":[{via:z()}],"gradient-to":[{to:z()}],rounded:[{rounded:ze()}],"rounded-s":[{"rounded-s":ze()}],"rounded-e":[{"rounded-e":ze()}],"rounded-t":[{"rounded-t":ze()}],"rounded-r":[{"rounded-r":ze()}],"rounded-b":[{"rounded-b":ze()}],"rounded-l":[{"rounded-l":ze()}],"rounded-ss":[{"rounded-ss":ze()}],"rounded-se":[{"rounded-se":ze()}],"rounded-ee":[{"rounded-ee":ze()}],"rounded-es":[{"rounded-es":ze()}],"rounded-tl":[{"rounded-tl":ze()}],"rounded-tr":[{"rounded-tr":ze()}],"rounded-br":[{"rounded-br":ze()}],"rounded-bl":[{"rounded-bl":ze()}],"border-w":[{border:st()}],"border-w-x":[{"border-x":st()}],"border-w-y":[{"border-y":st()}],"border-w-s":[{"border-s":st()}],"border-w-e":[{"border-e":st()}],"border-w-t":[{"border-t":st()}],"border-w-r":[{"border-r":st()}],"border-w-b":[{"border-b":st()}],"border-w-l":[{"border-l":st()}],"divide-x":[{"divide-x":st()}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":st()}],"divide-y-reverse":["divide-y-reverse"],"border-style":[{border:[...xt(),"hidden","none"]}],"divide-style":[{divide:[...xt(),"hidden","none"]}],"border-color":[{border:z()}],"border-color-x":[{"border-x":z()}],"border-color-y":[{"border-y":z()}],"border-color-s":[{"border-s":z()}],"border-color-e":[{"border-e":z()}],"border-color-t":[{"border-t":z()}],"border-color-r":[{"border-r":z()}],"border-color-b":[{"border-b":z()}],"border-color-l":[{"border-l":z()}],"divide-color":[{divide:z()}],"outline-style":[{outline:[...xt(),"none","hidden"]}],"outline-offset":[{"outline-offset":[gt,qe,We]}],"outline-w":[{outline:["",gt,Sa,Ls]}],"outline-color":[{outline:z()}],shadow:[{shadow:["","none",u,Gl,Hl]}],"shadow-color":[{shadow:z()}],"inset-shadow":[{"inset-shadow":["none",d,Gl,Hl]}],"inset-shadow-color":[{"inset-shadow":z()}],"ring-w":[{ring:st()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:z()}],"ring-offset-w":[{"ring-offset":[gt,Ls]}],"ring-offset-color":[{"ring-offset":z()}],"inset-ring-w":[{"inset-ring":st()}],"inset-ring-color":[{"inset-ring":z()}],"text-shadow":[{"text-shadow":["none",f,Gl,Hl]}],"text-shadow-color":[{"text-shadow":z()}],opacity:[{opacity:[gt,qe,We]}],"mix-blend":[{"mix-blend":[...ce(),"plus-darker","plus-lighter"]}],"bg-blend":[{"bg-blend":ce()}],"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":[gt]}],"mask-image-linear-from-pos":[{"mask-linear-from":ue()}],"mask-image-linear-to-pos":[{"mask-linear-to":ue()}],"mask-image-linear-from-color":[{"mask-linear-from":z()}],"mask-image-linear-to-color":[{"mask-linear-to":z()}],"mask-image-t-from-pos":[{"mask-t-from":ue()}],"mask-image-t-to-pos":[{"mask-t-to":ue()}],"mask-image-t-from-color":[{"mask-t-from":z()}],"mask-image-t-to-color":[{"mask-t-to":z()}],"mask-image-r-from-pos":[{"mask-r-from":ue()}],"mask-image-r-to-pos":[{"mask-r-to":ue()}],"mask-image-r-from-color":[{"mask-r-from":z()}],"mask-image-r-to-color":[{"mask-r-to":z()}],"mask-image-b-from-pos":[{"mask-b-from":ue()}],"mask-image-b-to-pos":[{"mask-b-to":ue()}],"mask-image-b-from-color":[{"mask-b-from":z()}],"mask-image-b-to-color":[{"mask-b-to":z()}],"mask-image-l-from-pos":[{"mask-l-from":ue()}],"mask-image-l-to-pos":[{"mask-l-to":ue()}],"mask-image-l-from-color":[{"mask-l-from":z()}],"mask-image-l-to-color":[{"mask-l-to":z()}],"mask-image-x-from-pos":[{"mask-x-from":ue()}],"mask-image-x-to-pos":[{"mask-x-to":ue()}],"mask-image-x-from-color":[{"mask-x-from":z()}],"mask-image-x-to-color":[{"mask-x-to":z()}],"mask-image-y-from-pos":[{"mask-y-from":ue()}],"mask-image-y-to-pos":[{"mask-y-to":ue()}],"mask-image-y-from-color":[{"mask-y-from":z()}],"mask-image-y-to-color":[{"mask-y-to":z()}],"mask-image-radial":[{"mask-radial":[qe,We]}],"mask-image-radial-from-pos":[{"mask-radial-from":ue()}],"mask-image-radial-to-pos":[{"mask-radial-to":ue()}],"mask-image-radial-from-color":[{"mask-radial-from":z()}],"mask-image-radial-to-color":[{"mask-radial-to":z()}],"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":[gt]}],"mask-image-conic-from-pos":[{"mask-conic-from":ue()}],"mask-image-conic-to-pos":[{"mask-conic-to":ue()}],"mask-image-conic-from-color":[{"mask-conic-from":z()}],"mask-image-conic-to-color":[{"mask-conic-to":z()}],"mask-mode":[{mask:["alpha","luminance","match"]}],"mask-origin":[{"mask-origin":["border","padding","content","fill","stroke","view"]}],"mask-position":[{mask:de()}],"mask-repeat":[{mask:le()}],"mask-size":[{mask:pe()}],"mask-type":[{"mask-type":["alpha","luminance"]}],"mask-image":[{mask:["none",qe,We]}],filter:[{filter:["","none",qe,We]}],blur:[{blur:Le()}],brightness:[{brightness:[gt,qe,We]}],contrast:[{contrast:[gt,qe,We]}],"drop-shadow":[{"drop-shadow":["","none",h,Gl,Hl]}],"drop-shadow-color":[{"drop-shadow":z()}],grayscale:[{grayscale:["",gt,qe,We]}],"hue-rotate":[{"hue-rotate":[gt,qe,We]}],invert:[{invert:["",gt,qe,We]}],saturate:[{saturate:[gt,qe,We]}],sepia:[{sepia:["",gt,qe,We]}],"backdrop-filter":[{"backdrop-filter":["","none",qe,We]}],"backdrop-blur":[{"backdrop-blur":Le()}],"backdrop-brightness":[{"backdrop-brightness":[gt,qe,We]}],"backdrop-contrast":[{"backdrop-contrast":[gt,qe,We]}],"backdrop-grayscale":[{"backdrop-grayscale":["",gt,qe,We]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[gt,qe,We]}],"backdrop-invert":[{"backdrop-invert":["",gt,qe,We]}],"backdrop-opacity":[{"backdrop-opacity":[gt,qe,We]}],"backdrop-saturate":[{"backdrop-saturate":[gt,qe,We]}],"backdrop-sepia":[{"backdrop-sepia":["",gt,qe,We]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":D()}],"border-spacing-x":[{"border-spacing-x":D()}],"border-spacing-y":[{"border-spacing-y":D()}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["","all","colors","opacity","shadow","transform","none",qe,We]}],"transition-behavior":[{transition:["normal","discrete"]}],duration:[{duration:[gt,"initial",qe,We]}],ease:[{ease:["linear","initial",p,qe,We]}],delay:[{delay:[gt,qe,We]}],animate:[{animate:["none",_,qe,We]}],backface:[{backface:["hidden","visible"]}],perspective:[{perspective:[v,qe,We]}],"perspective-origin":[{"perspective-origin":M()}],rotate:[{rotate:je()}],"rotate-x":[{"rotate-x":je()}],"rotate-y":[{"rotate-y":je()}],"rotate-z":[{"rotate-z":je()}],scale:[{scale:Ae()}],"scale-x":[{"scale-x":Ae()}],"scale-y":[{"scale-y":Ae()}],"scale-z":[{"scale-z":Ae()}],"scale-3d":["scale-3d"],skew:[{skew:mt()}],"skew-x":[{"skew-x":mt()}],"skew-y":[{"skew-y":mt()}],transform:[{transform:[qe,We,"","none","gpu","cpu"]}],"transform-origin":[{origin:M()}],"transform-style":[{transform:["3d","flat"]}],translate:[{translate:O()}],"translate-x":[{"translate-x":O()}],"translate-y":[{"translate-y":O()}],"translate-z":[{"translate-z":O()}],"translate-none":["translate-none"],accent:[{accent:z()}],appearance:[{appearance:["none","auto"]}],"caret-color":[{caret:z()}],"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",qe,We]}],"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":D()}],"scroll-mx":[{"scroll-mx":D()}],"scroll-my":[{"scroll-my":D()}],"scroll-ms":[{"scroll-ms":D()}],"scroll-me":[{"scroll-me":D()}],"scroll-mt":[{"scroll-mt":D()}],"scroll-mr":[{"scroll-mr":D()}],"scroll-mb":[{"scroll-mb":D()}],"scroll-ml":[{"scroll-ml":D()}],"scroll-p":[{"scroll-p":D()}],"scroll-px":[{"scroll-px":D()}],"scroll-py":[{"scroll-py":D()}],"scroll-ps":[{"scroll-ps":D()}],"scroll-pe":[{"scroll-pe":D()}],"scroll-pt":[{"scroll-pt":D()}],"scroll-pr":[{"scroll-pr":D()}],"scroll-pb":[{"scroll-pb":D()}],"scroll-pl":[{"scroll-pl":D()}],"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",qe,We]}],fill:[{fill:["none",...z()]}],"stroke-w":[{stroke:[gt,Sa,Ls,Jd]}],stroke:[{stroke:["none",...z()]}],"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"]}},lC=VA(aC);function cr(...t){return lC(Kx(t))}const ln=Ne({__name:"Button",props:{variant:{},size:{},class:{},asChild:{type:Boolean},as:{default:"button"}},setup(t){const e=t;return(n,i)=>(me(),Ie(E(wn),{"data-slot":"button",as:t.as,"as-child":t.asChild,class:Qt(E(cr)(E(cC)({variant:t.variant,size:t.size}),e.class,{dark:E(qn).value==="dark"}))},{default:te(()=>[at(n.$slots,"default")]),_:3},8,["as","as-child","class"]))}}),cC=ZM("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"}}),uC=Ne({__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(t,{emit:e}){const n=t,i=e,r=co(n,"class"),s=ar(r,i);return(o,a)=>(me(),Ie(E(xT),It({"data-slot":"slider",class:E(cr)("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)},E(s)),{default:te(({modelValue:l})=>[ie(E(CT),{"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:te(()=>[ie(E(ST),{"data-slot":"slider-range",class:"bg-primary absolute data-[orientation=horizontal]:h-full data-[orientation=vertical]:w-full"})]),_:1}),(me(!0),Ct(Kt,null,ta(l,(c,u)=>(me(),Ie(E(TT),{key:u,"data-slot":"slider-thumb",class:"bg-secondary-foreground 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"]))}});var dC=Object.defineProperty,jp=t=>{let e={};for(var n in t)dC(e,n,{get:t[n],enumerable:!0});return e};function fC(){let t=0,e=0;for(let i=0;i<28;i+=7){let r=this.buf[this.pos++];if(t|=(r&127)<>4,(n&128)==0)return this.assertBounds(),[t,e];for(let i=3;i<=31;i+=7){let r=this.buf[this.pos++];if(e|=(r&127)<>>s,a=!(!(o>>>7)&&e==0),l=(a?o|128:o)&255;if(n.push(l),!a)return}const i=t>>>28&15|(e&7)<<4,r=e>>3!=0;if(n.push((r?i|128:i)&255),!!r){for(let s=3;s<31;s=s+7){const o=e>>>s,a=!!(o>>>7),l=(a?o|128:o)&255;if(n.push(l),!a)return}n.push(e>>>31&1)}}const Lc=4294967296;function n0(t){const e=t[0]==="-";e&&(t=t.slice(1));const n=1e6;let i=0,r=0;function s(o,a){const l=Number(t.slice(o,a));r*=n,i=i*n+l,i>=Lc&&(r=r+(i/Lc|0),i=i%Lc)}return s(-24,-18),s(-18,-12),s(-12,-6),s(-6),e?tb(i,r):Yp(i,r)}function hC(t,e){let n=Yp(t,e);const i=n.hi&2147483648;i&&(n=tb(n.lo,n.hi));const r=eb(n.lo,n.hi);return i?"-"+r:r}function eb(t,e){if({lo:t,hi:e}=pC(t,e),e<=2097151)return String(Lc*e+t);const n=t&16777215,i=(t>>>24|e<<8)&16777215,r=e>>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()+i0(o)+i0(s)}function pC(t,e){return{lo:t>>>0,hi:e>>>0}}function Yp(t,e){return{lo:t|0,hi:e|0}}function tb(t,e){return e=~e,t?t=~t+1:e+=1,Yp(t,e)}const i0=t=>{const e=String(t);return"0000000".slice(e.length)+e};function r0(t,e){if(t>=0){for(;t>127;)e.push(t&127|128),t=t>>>7;e.push(t)}else{for(let n=0;n<9;n++)e.push(t&127|128),t=t>>7;e.push(1)}}function mC(){let t=this.buf[this.pos++],e=t&127;if((t&128)==0)return this.assertBounds(),e;if(t=this.buf[this.pos++],e|=(t&127)<<7,(t&128)==0)return this.assertBounds(),e;if(t=this.buf[this.pos++],e|=(t&127)<<14,(t&128)==0)return this.assertBounds(),e;if(t=this.buf[this.pos++],e|=(t&127)<<21,(t&128)==0)return this.assertBounds(),e;t=this.buf[this.pos++],e|=(t&15)<<28;for(let n=5;(t&128)!==0&&n<10;n++)t=this.buf[this.pos++];if((t&128)!=0)throw new Error("invalid varint");return this.assertBounds(),e>>>0}var s0={};const Yi=gC();function gC(){const t=new DataView(new ArrayBuffer(8));if(typeof BigInt=="function"&&typeof t.getBigInt64=="function"&&typeof t.getBigUint64=="function"&&typeof t.setBigInt64=="function"&&typeof t.setBigUint64=="function"&&(!!globalThis.Deno||typeof process!="object"||typeof s0!="object"||s0.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(e){return this.buf.length&&(this.chunks.push(new Uint8Array(this.buf)),this.buf=[]),this.chunks.push(e),this}uint32(e){for(l0(e);e>127;)this.buf.push(e&127|128),e=e>>>7;return this.buf.push(e),this}int32(e){return Qd(e),r0(e,this.buf),this}bool(e){return this.buf.push(e?1:0),this}bytes(e){return this.uint32(e.byteLength),this.raw(e)}string(e){let n=this.encodeUtf8(e);return this.uint32(n.byteLength),this.raw(n)}float(e){SC(e);let n=new Uint8Array(4);return new DataView(n.buffer).setFloat32(0,e,!0),this.raw(n)}double(e){let n=new Uint8Array(8);return new DataView(n.buffer).setFloat64(0,e,!0),this.raw(n)}fixed32(e){l0(e);let n=new Uint8Array(4);return new DataView(n.buffer).setUint32(0,e,!0),this.raw(n)}sfixed32(e){Qd(e);let n=new Uint8Array(4);return new DataView(n.buffer).setInt32(0,e,!0),this.raw(n)}sint32(e){return Qd(e),e=(e<<1^e>>31)>>>0,r0(e,this.buf),this}sfixed64(e){let n=new Uint8Array(8),i=new DataView(n.buffer),r=Yi.enc(e);return i.setInt32(0,r.lo,!0),i.setInt32(4,r.hi,!0),this.raw(n)}fixed64(e){let n=new Uint8Array(8),i=new DataView(n.buffer),r=Yi.uEnc(e);return i.setInt32(0,r.lo,!0),i.setInt32(4,r.hi,!0),this.raw(n)}int64(e){let n=Yi.enc(e);return Kd(n.lo,n.hi,this.buf),this}sint64(e){const n=Yi.enc(e),i=n.hi>>31,r=n.lo<<1^i,s=(n.hi<<1|n.lo>>>31)^i;return Kd(r,s,this.buf),this}uint64(e){const n=Yi.uEnc(e);return Kd(n.lo,n.hi,this.buf),this}}class be{constructor(e,n=nb().decodeUtf8){this.decodeUtf8=n,this.varint64=fC,this.uint32=mC,this.buf=e,this.len=e.length,this.pos=0,this.view=new DataView(e.buffer,e.byteOffset,e.byteLength)}tag(){let e=this.uint32(),n=e>>>3,i=e&7;if(n<=0||i<0||i>5)throw new Error("illegal tag: field no "+n+" wire type "+i);return[n,i]}skip(e,n){let i=this.pos;switch(e){case ds.Varint:for(;this.buf[this.pos++]&128;);break;case ds.Bit64:this.pos+=4;case ds.Bit32:this.pos+=4;break;case ds.LengthDelimited:let r=this.uint32();this.pos+=r;break;case ds.StartGroup:for(;;){const[s,o]=this.tag();if(o===ds.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 "+e)}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 e=this.uint32();return e>>>1^-(e&1)}int64(){return Yi.dec(...this.varint64())}uint64(){return Yi.uDec(...this.varint64())}sint64(){let[e,n]=this.varint64(),i=-(e&1);return e=(e>>>1|(n&1)<<31)^i,n=n>>>1^i,Yi.dec(e,n)}bool(){let[e,n]=this.varint64();return e!==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 Yi.uDec(this.sfixed32(),this.sfixed32())}sfixed64(){return Yi.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 e=this.uint32(),n=this.pos;return this.pos+=e,this.assertBounds(),this.buf.subarray(n,n+e)}string(){return this.decodeUtf8(this.bytes())}}function Qd(t){if(typeof t=="string")t=Number(t);else if(typeof t!="number")throw new Error("invalid int32: "+typeof t);if(!Number.isInteger(t)||t>yC||txC||t<0)throw new Error("invalid uint32: "+t)}function SC(t){if(typeof t=="string"){const e=t;if(t=Number(t),Number.isNaN(t)&&e!=="NaN")throw new Error("invalid float32: "+e)}else if(typeof t!="number")throw new Error("invalid float32: "+typeof t);if(Number.isFinite(t)&&(t>vC||t<_C))throw new Error("invalid float32: "+t)}const Jp="182",io={ROTATE:0,DOLLY:1,PAN:2},Bo={ROTATE:0,PAN:1,DOLLY_PAN:2,DOLLY_ROTATE:3},wC=0,c0=1,MC=2,Oc=1,ib=2,Fa=3,ys=0,Ln=1,Vn=2,Lr=0,Yo=1,u0=2,d0=3,f0=4,EC=5,$s=100,TC=101,AC=102,CC=103,PC=104,RC=200,DC=201,IC=202,NC=203,ph=204,mh=205,LC=206,OC=207,FC=208,UC=209,kC=210,BC=211,zC=212,VC=213,HC=214,gh=0,vh=1,_h=2,ia=3,xh=4,yh=5,bh=6,Sh=7,rb=0,GC=1,WC=2,nr=0,sb=1,ob=2,ab=3,Kp=4,lb=5,cb=6,ub=7,db=300,oo=301,ra=302,wh=303,Mh=304,Wu=306,Eh=1e3,Ir=1001,Th=1002,Sn=1003,qC=1004,Wl=1005,Dn=1006,ef=1007,Js=1008,li=1009,fb=1010,hb=1011,cl=1012,Zp=1013,rr=1014,Ki=1015,qr=1016,Qp=1017,em=1018,ul=1020,pb=35902,mb=35899,gb=1021,vb=1022,Ai=1023,Xr=1026,Ks=1027,_b=1028,tm=1029,sa=1030,nm=1031,im=1033,Fc=33776,Uc=33777,kc=33778,Bc=33779,Ah=35840,Ch=35841,Ph=35842,Rh=35843,Dh=36196,Ih=37492,Nh=37496,Lh=37488,Oh=37489,Fh=37490,Uh=37491,kh=37808,Bh=37809,zh=37810,Vh=37811,Hh=37812,Gh=37813,Wh=37814,qh=37815,Xh=37816,$h=37817,jh=37818,Yh=37819,Jh=37820,Kh=37821,Zh=36492,Qh=36494,ep=36495,tp=36283,np=36284,ip=36285,rp=36286,XC=3200,xb=0,$C=1,fs="",oi="srgb",oa="srgb-linear",ou="linear",Dt="srgb",bo=7680,h0=519,jC=512,YC=513,JC=514,rm=515,KC=516,ZC=517,sm=518,QC=519,p0=35044,m0="300 es",Zi=2e3,au=2001;function yb(t){for(let e=t.length-1;e>=0;--e)if(t[e]>=65535)return!0;return!1}function lu(t){return document.createElementNS("http://www.w3.org/1999/xhtml",t)}function eP(){const t=lu("canvas");return t.style.display="block",t}const g0={};function v0(...t){const e="THREE."+t.shift();console.log(e,...t)}function it(...t){const e="THREE."+t.shift();console.warn(e,...t)}function bt(...t){const e="THREE."+t.shift();console.error(e,...t)}function dl(...t){const e=t.join(" ");e in g0||(g0[e]=!0,it(...t))}function tP(t,e,n){return new Promise(function(i,r){function s(){switch(t.clientWaitSync(e,t.SYNC_FLUSH_COMMANDS_BIT,0)){case t.WAIT_FAILED:r();break;case t.TIMEOUT_EXPIRED:setTimeout(s,n);break;default:i()}}setTimeout(s,n)})}class fo{addEventListener(e,n){this._listeners===void 0&&(this._listeners={});const i=this._listeners;i[e]===void 0&&(i[e]=[]),i[e].indexOf(n)===-1&&i[e].push(n)}hasEventListener(e,n){const i=this._listeners;return i===void 0?!1:i[e]!==void 0&&i[e].indexOf(n)!==-1}removeEventListener(e,n){const i=this._listeners;if(i===void 0)return;const r=i[e];if(r!==void 0){const s=r.indexOf(n);s!==-1&&r.splice(s,1)}}dispatchEvent(e){const n=this._listeners;if(n===void 0)return;const i=n[e.type];if(i!==void 0){e.target=this;const r=i.slice(0);for(let s=0,o=r.length;s>8&255]+Mn[t>>16&255]+Mn[t>>24&255]+"-"+Mn[e&255]+Mn[e>>8&255]+"-"+Mn[e>>16&15|64]+Mn[e>>24&255]+"-"+Mn[n&63|128]+Mn[n>>8&255]+"-"+Mn[n>>16&255]+Mn[n>>24&255]+Mn[i&255]+Mn[i>>8&255]+Mn[i>>16&255]+Mn[i>>24&255]).toLowerCase()}function ht(t,e,n){return Math.max(e,Math.min(n,t))}function om(t,e){return(t%e+e)%e}function nP(t,e,n,i,r){return i+(t-e)*(r-i)/(n-e)}function iP(t,e,n){return t!==e?(n-t)/(e-t):0}function Ka(t,e,n){return(1-n)*t+n*e}function rP(t,e,n,i){return Ka(t,e,1-Math.exp(-n*i))}function sP(t,e=1){return e-Math.abs(om(t,e*2)-e)}function oP(t,e,n){return t<=e?0:t>=n?1:(t=(t-e)/(n-e),t*t*(3-2*t))}function aP(t,e,n){return t<=e?0:t>=n?1:(t=(t-e)/(n-e),t*t*t*(t*(t*6-15)+10))}function lP(t,e){return t+Math.floor(Math.random()*(e-t+1))}function cP(t,e){return t+Math.random()*(e-t)}function uP(t){return t*(.5-Math.random())}function dP(t){t!==void 0&&(_0=t);let e=_0+=1831565813;return e=Math.imul(e^e>>>15,e|1),e^=e+Math.imul(e^e>>>7,e|61),((e^e>>>14)>>>0)/4294967296}function fP(t){return t*Jo}function hP(t){return t*aa}function pP(t){return(t&t-1)===0&&t!==0}function mP(t){return Math.pow(2,Math.ceil(Math.log(t)/Math.LN2))}function gP(t){return Math.pow(2,Math.floor(Math.log(t)/Math.LN2))}function vP(t,e,n,i,r){const s=Math.cos,o=Math.sin,a=s(n/2),l=o(n/2),c=s((e+i)/2),u=o((e+i)/2),d=s((e-i)/2),f=o((e-i)/2),h=s((i-e)/2),g=o((i-e)/2);switch(r){case"XYX":t.set(a*u,l*d,l*f,a*c);break;case"YZY":t.set(l*f,a*u,l*d,a*c);break;case"ZXZ":t.set(l*d,l*f,a*u,a*c);break;case"XZX":t.set(a*u,l*g,l*h,a*c);break;case"YXY":t.set(l*h,a*u,l*g,a*c);break;case"ZYZ":t.set(l*g,l*h,a*u,a*c);break;default:it("MathUtils: .setQuaternionFromProperEuler() encountered an unknown order: "+r)}}function Uo(t,e){switch(e.constructor){case Float32Array:return t;case Uint32Array:return t/4294967295;case Uint16Array:return t/65535;case Uint8Array:return t/255;case Int32Array:return Math.max(t/2147483647,-1);case Int16Array:return Math.max(t/32767,-1);case Int8Array:return Math.max(t/127,-1);default:throw new Error("Invalid component type.")}}function kn(t,e){switch(e.constructor){case Float32Array:return t;case Uint32Array:return Math.round(t*4294967295);case Uint16Array:return Math.round(t*65535);case Uint8Array:return Math.round(t*255);case Int32Array:return Math.round(t*2147483647);case Int16Array:return Math.round(t*32767);case Int8Array:return Math.round(t*127);default:throw new Error("Invalid component type.")}}const sp={DEG2RAD:Jo,RAD2DEG:aa,generateUUID:ho,clamp:ht,euclideanModulo:om,mapLinear:nP,inverseLerp:iP,lerp:Ka,damp:rP,pingpong:sP,smoothstep:oP,smootherstep:aP,randInt:lP,randFloat:cP,randFloatSpread:uP,seededRandom:dP,degToRad:fP,radToDeg:hP,isPowerOfTwo:pP,ceilPowerOfTwo:mP,floorPowerOfTwo:gP,setQuaternionFromProperEuler:vP,normalize:kn,denormalize:Uo};class xe{constructor(e=0,n=0){xe.prototype.isVector2=!0,this.x=e,this.y=n}get width(){return this.x}set width(e){this.x=e}get height(){return this.y}set height(e){this.y=e}set(e,n){return this.x=e,this.y=n,this}setScalar(e){return this.x=e,this.y=e,this}setX(e){return this.x=e,this}setY(e){return this.y=e,this}setComponent(e,n){switch(e){case 0:this.x=n;break;case 1:this.y=n;break;default:throw new Error("index is out of range: "+e)}return this}getComponent(e){switch(e){case 0:return this.x;case 1:return this.y;default:throw new Error("index is out of range: "+e)}}clone(){return new this.constructor(this.x,this.y)}copy(e){return this.x=e.x,this.y=e.y,this}add(e){return this.x+=e.x,this.y+=e.y,this}addScalar(e){return this.x+=e,this.y+=e,this}addVectors(e,n){return this.x=e.x+n.x,this.y=e.y+n.y,this}addScaledVector(e,n){return this.x+=e.x*n,this.y+=e.y*n,this}sub(e){return this.x-=e.x,this.y-=e.y,this}subScalar(e){return this.x-=e,this.y-=e,this}subVectors(e,n){return this.x=e.x-n.x,this.y=e.y-n.y,this}multiply(e){return this.x*=e.x,this.y*=e.y,this}multiplyScalar(e){return this.x*=e,this.y*=e,this}divide(e){return this.x/=e.x,this.y/=e.y,this}divideScalar(e){return this.multiplyScalar(1/e)}applyMatrix3(e){const n=this.x,i=this.y,r=e.elements;return this.x=r[0]*n+r[3]*i+r[6],this.y=r[1]*n+r[4]*i+r[7],this}min(e){return this.x=Math.min(this.x,e.x),this.y=Math.min(this.y,e.y),this}max(e){return this.x=Math.max(this.x,e.x),this.y=Math.max(this.y,e.y),this}clamp(e,n){return this.x=ht(this.x,e.x,n.x),this.y=ht(this.y,e.y,n.y),this}clampScalar(e,n){return this.x=ht(this.x,e,n),this.y=ht(this.y,e,n),this}clampLength(e,n){const i=this.length();return this.divideScalar(i||1).multiplyScalar(ht(i,e,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(e){return this.x*e.x+this.y*e.y}cross(e){return this.x*e.y-this.y*e.x}lengthSq(){return this.x*this.x+this.y*this.y}length(){return Math.sqrt(this.x*this.x+this.y*this.y)}manhattanLength(){return Math.abs(this.x)+Math.abs(this.y)}normalize(){return this.divideScalar(this.length()||1)}angle(){return Math.atan2(-this.y,-this.x)+Math.PI}angleTo(e){const n=Math.sqrt(this.lengthSq()*e.lengthSq());if(n===0)return Math.PI/2;const i=this.dot(e)/n;return Math.acos(ht(i,-1,1))}distanceTo(e){return Math.sqrt(this.distanceToSquared(e))}distanceToSquared(e){const n=this.x-e.x,i=this.y-e.y;return n*n+i*i}manhattanDistanceTo(e){return Math.abs(this.x-e.x)+Math.abs(this.y-e.y)}setLength(e){return this.normalize().multiplyScalar(e)}lerp(e,n){return this.x+=(e.x-this.x)*n,this.y+=(e.y-this.y)*n,this}lerpVectors(e,n,i){return this.x=e.x+(n.x-e.x)*i,this.y=e.y+(n.y-e.y)*i,this}equals(e){return e.x===this.x&&e.y===this.y}fromArray(e,n=0){return this.x=e[n],this.y=e[n+1],this}toArray(e=[],n=0){return e[n]=this.x,e[n+1]=this.y,e}fromBufferAttribute(e,n){return this.x=e.getX(n),this.y=e.getY(n),this}rotateAround(e,n){const i=Math.cos(n),r=Math.sin(n),s=this.x-e.x,o=this.y-e.y;return this.x=s*i-o*r+e.x,this.y=s*r+o*i+e.y,this}random(){return this.x=Math.random(),this.y=Math.random(),this}*[Symbol.iterator](){yield this.x,yield this.y}}class _n{constructor(e=0,n=0,i=0,r=1){this.isQuaternion=!0,this._x=e,this._y=n,this._z=i,this._w=r}static slerpFlat(e,n,i,r,s,o,a){let l=i[r+0],c=i[r+1],u=i[r+2],d=i[r+3],f=s[o+0],h=s[o+1],g=s[o+2],v=s[o+3];if(a<=0){e[n+0]=l,e[n+1]=c,e[n+2]=u,e[n+3]=d;return}if(a>=1){e[n+0]=f,e[n+1]=h,e[n+2]=g,e[n+3]=v;return}if(d!==v||l!==f||c!==h||u!==g){let m=l*f+c*h+u*g+d*v;m<0&&(f=-f,h=-h,g=-g,v=-v,m=-m);let p=1-a;if(m<.9995){const _=Math.acos(m),y=Math.sin(_);p=Math.sin(p*_)/y,a=Math.sin(a*_)/y,l=l*p+f*a,c=c*p+h*a,u=u*p+g*a,d=d*p+v*a}else{l=l*p+f*a,c=c*p+h*a,u=u*p+g*a,d=d*p+v*a;const _=1/Math.sqrt(l*l+c*c+u*u+d*d);l*=_,c*=_,u*=_,d*=_}}e[n]=l,e[n+1]=c,e[n+2]=u,e[n+3]=d}static multiplyQuaternionsFlat(e,n,i,r,s,o){const a=i[r],l=i[r+1],c=i[r+2],u=i[r+3],d=s[o],f=s[o+1],h=s[o+2],g=s[o+3];return e[n]=a*g+u*d+l*h-c*f,e[n+1]=l*g+u*f+c*d-a*h,e[n+2]=c*g+u*h+a*f-l*d,e[n+3]=u*g-a*d-l*f-c*h,e}get x(){return this._x}set x(e){this._x=e,this._onChangeCallback()}get y(){return this._y}set y(e){this._y=e,this._onChangeCallback()}get z(){return this._z}set z(e){this._z=e,this._onChangeCallback()}get w(){return this._w}set w(e){this._w=e,this._onChangeCallback()}set(e,n,i,r){return this._x=e,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(e){return this._x=e.x,this._y=e.y,this._z=e.z,this._w=e.w,this._onChangeCallback(),this}setFromEuler(e,n=!0){const i=e._x,r=e._y,s=e._z,o=e._order,a=Math.cos,l=Math.sin,c=a(i/2),u=a(r/2),d=a(s/2),f=l(i/2),h=l(r/2),g=l(s/2);switch(o){case"XYZ":this._x=f*u*d+c*h*g,this._y=c*h*d-f*u*g,this._z=c*u*g+f*h*d,this._w=c*u*d-f*h*g;break;case"YXZ":this._x=f*u*d+c*h*g,this._y=c*h*d-f*u*g,this._z=c*u*g-f*h*d,this._w=c*u*d+f*h*g;break;case"ZXY":this._x=f*u*d-c*h*g,this._y=c*h*d+f*u*g,this._z=c*u*g+f*h*d,this._w=c*u*d-f*h*g;break;case"ZYX":this._x=f*u*d-c*h*g,this._y=c*h*d+f*u*g,this._z=c*u*g-f*h*d,this._w=c*u*d+f*h*g;break;case"YZX":this._x=f*u*d+c*h*g,this._y=c*h*d+f*u*g,this._z=c*u*g-f*h*d,this._w=c*u*d-f*h*g;break;case"XZY":this._x=f*u*d-c*h*g,this._y=c*h*d-f*u*g,this._z=c*u*g+f*h*d,this._w=c*u*d+f*h*g;break;default:it("Quaternion: .setFromEuler() encountered an unknown order: "+o)}return n===!0&&this._onChangeCallback(),this}setFromAxisAngle(e,n){const i=n/2,r=Math.sin(i);return this._x=e.x*r,this._y=e.y*r,this._z=e.z*r,this._w=Math.cos(i),this._onChangeCallback(),this}setFromRotationMatrix(e){const n=e.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],d=n[10],f=i+a+d;if(f>0){const h=.5/Math.sqrt(f+1);this._w=.25/h,this._x=(u-l)*h,this._y=(s-c)*h,this._z=(o-r)*h}else if(i>a&&i>d){const h=2*Math.sqrt(1+i-a-d);this._w=(u-l)/h,this._x=.25*h,this._y=(r+o)/h,this._z=(s+c)/h}else if(a>d){const h=2*Math.sqrt(1+a-i-d);this._w=(s-c)/h,this._x=(r+o)/h,this._y=.25*h,this._z=(l+u)/h}else{const h=2*Math.sqrt(1+d-i-a);this._w=(o-r)/h,this._x=(s+c)/h,this._y=(l+u)/h,this._z=.25*h}return this._onChangeCallback(),this}setFromUnitVectors(e,n){let i=e.dot(n)+1;return i<1e-8?(i=0,Math.abs(e.x)>Math.abs(e.z)?(this._x=-e.y,this._y=e.x,this._z=0,this._w=i):(this._x=0,this._y=-e.z,this._z=e.y,this._w=i)):(this._x=e.y*n.z-e.z*n.y,this._y=e.z*n.x-e.x*n.z,this._z=e.x*n.y-e.y*n.x,this._w=i),this.normalize()}angleTo(e){return 2*Math.acos(Math.abs(ht(this.dot(e),-1,1)))}rotateTowards(e,n){const i=this.angleTo(e);if(i===0)return this;const r=Math.min(1,n/i);return this.slerp(e,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(e){return this._x*e._x+this._y*e._y+this._z*e._z+this._w*e._w}lengthSq(){return this._x*this._x+this._y*this._y+this._z*this._z+this._w*this._w}length(){return Math.sqrt(this._x*this._x+this._y*this._y+this._z*this._z+this._w*this._w)}normalize(){let e=this.length();return e===0?(this._x=0,this._y=0,this._z=0,this._w=1):(e=1/e,this._x=this._x*e,this._y=this._y*e,this._z=this._z*e,this._w=this._w*e),this._onChangeCallback(),this}multiply(e){return this.multiplyQuaternions(this,e)}premultiply(e){return this.multiplyQuaternions(e,this)}multiplyQuaternions(e,n){const i=e._x,r=e._y,s=e._z,o=e._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(e,n){if(n<=0)return this;if(n>=1)return this.copy(e);let i=e._x,r=e._y,s=e._z,o=e._w,a=this.dot(e);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(e,n,i){return this.copy(e).slerp(n,i)}random(){const e=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(e),r*Math.cos(e),s*Math.sin(n),s*Math.cos(n))}equals(e){return e._x===this._x&&e._y===this._y&&e._z===this._z&&e._w===this._w}fromArray(e,n=0){return this._x=e[n],this._y=e[n+1],this._z=e[n+2],this._w=e[n+3],this._onChangeCallback(),this}toArray(e=[],n=0){return e[n]=this._x,e[n+1]=this._y,e[n+2]=this._z,e[n+3]=this._w,e}fromBufferAttribute(e,n){return this._x=e.getX(n),this._y=e.getY(n),this._z=e.getZ(n),this._w=e.getW(n),this._onChangeCallback(),this}toJSON(){return this.toArray()}_onChange(e){return this._onChangeCallback=e,this}_onChangeCallback(){}*[Symbol.iterator](){yield this._x,yield this._y,yield this._z,yield this._w}}class N{constructor(e=0,n=0,i=0){N.prototype.isVector3=!0,this.x=e,this.y=n,this.z=i}set(e,n,i){return i===void 0&&(i=this.z),this.x=e,this.y=n,this.z=i,this}setScalar(e){return this.x=e,this.y=e,this.z=e,this}setX(e){return this.x=e,this}setY(e){return this.y=e,this}setZ(e){return this.z=e,this}setComponent(e,n){switch(e){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: "+e)}return this}getComponent(e){switch(e){case 0:return this.x;case 1:return this.y;case 2:return this.z;default:throw new Error("index is out of range: "+e)}}clone(){return new this.constructor(this.x,this.y,this.z)}copy(e){return this.x=e.x,this.y=e.y,this.z=e.z,this}add(e){return this.x+=e.x,this.y+=e.y,this.z+=e.z,this}addScalar(e){return this.x+=e,this.y+=e,this.z+=e,this}addVectors(e,n){return this.x=e.x+n.x,this.y=e.y+n.y,this.z=e.z+n.z,this}addScaledVector(e,n){return this.x+=e.x*n,this.y+=e.y*n,this.z+=e.z*n,this}sub(e){return this.x-=e.x,this.y-=e.y,this.z-=e.z,this}subScalar(e){return this.x-=e,this.y-=e,this.z-=e,this}subVectors(e,n){return this.x=e.x-n.x,this.y=e.y-n.y,this.z=e.z-n.z,this}multiply(e){return this.x*=e.x,this.y*=e.y,this.z*=e.z,this}multiplyScalar(e){return this.x*=e,this.y*=e,this.z*=e,this}multiplyVectors(e,n){return this.x=e.x*n.x,this.y=e.y*n.y,this.z=e.z*n.z,this}applyEuler(e){return this.applyQuaternion(x0.setFromEuler(e))}applyAxisAngle(e,n){return this.applyQuaternion(x0.setFromAxisAngle(e,n))}applyMatrix3(e){const n=this.x,i=this.y,r=this.z,s=e.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(e){return this.applyMatrix3(e).normalize()}applyMatrix4(e){const n=this.x,i=this.y,r=this.z,s=e.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(e){const n=this.x,i=this.y,r=this.z,s=e.x,o=e.y,a=e.z,l=e.w,c=2*(o*r-a*i),u=2*(a*n-s*r),d=2*(s*i-o*n);return this.x=n+l*c+o*d-a*u,this.y=i+l*u+a*c-s*d,this.z=r+l*d+s*u-o*c,this}project(e){return this.applyMatrix4(e.matrixWorldInverse).applyMatrix4(e.projectionMatrix)}unproject(e){return this.applyMatrix4(e.projectionMatrixInverse).applyMatrix4(e.matrixWorld)}transformDirection(e){const n=this.x,i=this.y,r=this.z,s=e.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(e){return this.x/=e.x,this.y/=e.y,this.z/=e.z,this}divideScalar(e){return this.multiplyScalar(1/e)}min(e){return this.x=Math.min(this.x,e.x),this.y=Math.min(this.y,e.y),this.z=Math.min(this.z,e.z),this}max(e){return this.x=Math.max(this.x,e.x),this.y=Math.max(this.y,e.y),this.z=Math.max(this.z,e.z),this}clamp(e,n){return this.x=ht(this.x,e.x,n.x),this.y=ht(this.y,e.y,n.y),this.z=ht(this.z,e.z,n.z),this}clampScalar(e,n){return this.x=ht(this.x,e,n),this.y=ht(this.y,e,n),this.z=ht(this.z,e,n),this}clampLength(e,n){const i=this.length();return this.divideScalar(i||1).multiplyScalar(ht(i,e,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(e){return this.x*e.x+this.y*e.y+this.z*e.z}lengthSq(){return this.x*this.x+this.y*this.y+this.z*this.z}length(){return Math.sqrt(this.x*this.x+this.y*this.y+this.z*this.z)}manhattanLength(){return Math.abs(this.x)+Math.abs(this.y)+Math.abs(this.z)}normalize(){return this.divideScalar(this.length()||1)}setLength(e){return this.normalize().multiplyScalar(e)}lerp(e,n){return this.x+=(e.x-this.x)*n,this.y+=(e.y-this.y)*n,this.z+=(e.z-this.z)*n,this}lerpVectors(e,n,i){return this.x=e.x+(n.x-e.x)*i,this.y=e.y+(n.y-e.y)*i,this.z=e.z+(n.z-e.z)*i,this}cross(e){return this.crossVectors(this,e)}crossVectors(e,n){const i=e.x,r=e.y,s=e.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(e){const n=e.lengthSq();if(n===0)return this.set(0,0,0);const i=e.dot(this)/n;return this.copy(e).multiplyScalar(i)}projectOnPlane(e){return tf.copy(this).projectOnVector(e),this.sub(tf)}reflect(e){return this.sub(tf.copy(e).multiplyScalar(2*this.dot(e)))}angleTo(e){const n=Math.sqrt(this.lengthSq()*e.lengthSq());if(n===0)return Math.PI/2;const i=this.dot(e)/n;return Math.acos(ht(i,-1,1))}distanceTo(e){return Math.sqrt(this.distanceToSquared(e))}distanceToSquared(e){const n=this.x-e.x,i=this.y-e.y,r=this.z-e.z;return n*n+i*i+r*r}manhattanDistanceTo(e){return Math.abs(this.x-e.x)+Math.abs(this.y-e.y)+Math.abs(this.z-e.z)}setFromSpherical(e){return this.setFromSphericalCoords(e.radius,e.phi,e.theta)}setFromSphericalCoords(e,n,i){const r=Math.sin(n)*e;return this.x=r*Math.sin(i),this.y=Math.cos(n)*e,this.z=r*Math.cos(i),this}setFromCylindrical(e){return this.setFromCylindricalCoords(e.radius,e.theta,e.y)}setFromCylindricalCoords(e,n,i){return this.x=e*Math.sin(n),this.y=i,this.z=e*Math.cos(n),this}setFromMatrixPosition(e){const n=e.elements;return this.x=n[12],this.y=n[13],this.z=n[14],this}setFromMatrixScale(e){const n=this.setFromMatrixColumn(e,0).length(),i=this.setFromMatrixColumn(e,1).length(),r=this.setFromMatrixColumn(e,2).length();return this.x=n,this.y=i,this.z=r,this}setFromMatrixColumn(e,n){return this.fromArray(e.elements,n*4)}setFromMatrix3Column(e,n){return this.fromArray(e.elements,n*3)}setFromEuler(e){return this.x=e._x,this.y=e._y,this.z=e._z,this}setFromColor(e){return this.x=e.r,this.y=e.g,this.z=e.b,this}equals(e){return e.x===this.x&&e.y===this.y&&e.z===this.z}fromArray(e,n=0){return this.x=e[n],this.y=e[n+1],this.z=e[n+2],this}toArray(e=[],n=0){return e[n]=this.x,e[n+1]=this.y,e[n+2]=this.z,e}fromBufferAttribute(e,n){return this.x=e.getX(n),this.y=e.getY(n),this.z=e.getZ(n),this}random(){return this.x=Math.random(),this.y=Math.random(),this.z=Math.random(),this}randomDirection(){const e=Math.random()*Math.PI*2,n=Math.random()*2-1,i=Math.sqrt(1-n*n);return this.x=i*Math.cos(e),this.y=n,this.z=i*Math.sin(e),this}*[Symbol.iterator](){yield this.x,yield this.y,yield this.z}}const tf=new N,x0=new _n;class ft{constructor(e,n,i,r,s,o,a,l,c){ft.prototype.isMatrix3=!0,this.elements=[1,0,0,0,1,0,0,0,1],e!==void 0&&this.set(e,n,i,r,s,o,a,l,c)}set(e,n,i,r,s,o,a,l,c){const u=this.elements;return u[0]=e,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(e){const n=this.elements,i=e.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(e,n,i){return e.setFromMatrix3Column(this,0),n.setFromMatrix3Column(this,1),i.setFromMatrix3Column(this,2),this}setFromMatrix4(e){const n=e.elements;return this.set(n[0],n[4],n[8],n[1],n[5],n[9],n[2],n[6],n[10]),this}multiply(e){return this.multiplyMatrices(this,e)}premultiply(e){return this.multiplyMatrices(e,this)}multiplyMatrices(e,n){const i=e.elements,r=n.elements,s=this.elements,o=i[0],a=i[3],l=i[6],c=i[1],u=i[4],d=i[7],f=i[2],h=i[5],g=i[8],v=r[0],m=r[3],p=r[6],_=r[1],y=r[4],x=r[7],M=r[2],A=r[5],P=r[8];return s[0]=o*v+a*_+l*M,s[3]=o*m+a*y+l*A,s[6]=o*p+a*x+l*P,s[1]=c*v+u*_+d*M,s[4]=c*m+u*y+d*A,s[7]=c*p+u*x+d*P,s[2]=f*v+h*_+g*M,s[5]=f*m+h*y+g*A,s[8]=f*p+h*x+g*P,this}multiplyScalar(e){const n=this.elements;return n[0]*=e,n[3]*=e,n[6]*=e,n[1]*=e,n[4]*=e,n[7]*=e,n[2]*=e,n[5]*=e,n[8]*=e,this}determinant(){const e=this.elements,n=e[0],i=e[1],r=e[2],s=e[3],o=e[4],a=e[5],l=e[6],c=e[7],u=e[8];return n*o*u-n*a*c-i*s*u+i*a*l+r*s*c-r*o*l}invert(){const e=this.elements,n=e[0],i=e[1],r=e[2],s=e[3],o=e[4],a=e[5],l=e[6],c=e[7],u=e[8],d=u*o-a*c,f=a*l-u*s,h=c*s-o*l,g=n*d+i*f+r*h;if(g===0)return this.set(0,0,0,0,0,0,0,0,0);const v=1/g;return e[0]=d*v,e[1]=(r*c-u*i)*v,e[2]=(a*i-r*o)*v,e[3]=f*v,e[4]=(u*n-r*l)*v,e[5]=(r*s-a*n)*v,e[6]=h*v,e[7]=(i*l-c*n)*v,e[8]=(o*n-i*s)*v,this}transpose(){let e;const n=this.elements;return e=n[1],n[1]=n[3],n[3]=e,e=n[2],n[2]=n[6],n[6]=e,e=n[5],n[5]=n[7],n[7]=e,this}getNormalMatrix(e){return this.setFromMatrix4(e).invert().transpose()}transposeIntoArray(e){const n=this.elements;return e[0]=n[0],e[1]=n[3],e[2]=n[6],e[3]=n[1],e[4]=n[4],e[5]=n[7],e[6]=n[2],e[7]=n[5],e[8]=n[8],this}setUvTransform(e,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+e,-r*c,r*l,-r*(-c*o+l*a)+a+n,0,0,1),this}scale(e,n){return this.premultiply(nf.makeScale(e,n)),this}rotate(e){return this.premultiply(nf.makeRotation(-e)),this}translate(e,n){return this.premultiply(nf.makeTranslation(e,n)),this}makeTranslation(e,n){return e.isVector2?this.set(1,0,e.x,0,1,e.y,0,0,1):this.set(1,0,e,0,1,n,0,0,1),this}makeRotation(e){const n=Math.cos(e),i=Math.sin(e);return this.set(n,-i,0,i,n,0,0,0,1),this}makeScale(e,n){return this.set(e,0,0,0,n,0,0,0,1),this}equals(e){const n=this.elements,i=e.elements;for(let r=0;r<9;r++)if(n[r]!==i[r])return!1;return!0}fromArray(e,n=0){for(let i=0;i<9;i++)this.elements[i]=e[i+n];return this}toArray(e=[],n=0){const i=this.elements;return e[n]=i[0],e[n+1]=i[1],e[n+2]=i[2],e[n+3]=i[3],e[n+4]=i[4],e[n+5]=i[5],e[n+6]=i[6],e[n+7]=i[7],e[n+8]=i[8],e}clone(){return new this.constructor().fromArray(this.elements)}}const nf=new ft,y0=new ft().set(.4123908,.3575843,.1804808,.212639,.7151687,.0721923,.0193308,.1191948,.9505322),b0=new ft().set(3.2409699,-1.5373832,-.4986108,-.9692436,1.8759675,.0415551,.0556301,-.203977,1.0569715);function _P(){const t={enabled:!0,workingColorSpace:oa,spaces:{},convert:function(r,s,o){return this.enabled===!1||s===o||!s||!o||(this.spaces[s].transfer===Dt&&(r.r=Or(r.r),r.g=Or(r.g),r.b=Or(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===Dt&&(r.r=Ko(r.r),r.g=Ko(r.g),r.b=Ko(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===fs?ou: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 dl("ColorManagement: .fromWorkingColorSpace() has been renamed to .workingToColorSpace()."),t.workingToColorSpace(r,s)},toWorkingColorSpace:function(r,s){return dl("ColorManagement: .toWorkingColorSpace() has been renamed to .colorSpaceToWorking()."),t.colorSpaceToWorking(r,s)}},e=[.64,.33,.3,.6,.15,.06],n=[.2126,.7152,.0722],i=[.3127,.329];return t.define({[oa]:{primaries:e,whitePoint:i,transfer:ou,toXYZ:y0,fromXYZ:b0,luminanceCoefficients:n,workingColorSpaceConfig:{unpackColorSpace:oi},outputColorSpaceConfig:{drawingBufferColorSpace:oi}},[oi]:{primaries:e,whitePoint:i,transfer:Dt,toXYZ:y0,fromXYZ:b0,luminanceCoefficients:n,outputColorSpaceConfig:{drawingBufferColorSpace:oi}}}),t}const wt=_P();function Or(t){return t<.04045?t*.0773993808:Math.pow(t*.9478672986+.0521327014,2.4)}function Ko(t){return t<.0031308?t*12.92:1.055*Math.pow(t,.41666)-.055}let So;class xP{static getDataURL(e,n="image/png"){if(/^data:/i.test(e.src)||typeof HTMLCanvasElement>"u")return e.src;let i;if(e instanceof HTMLCanvasElement)i=e;else{So===void 0&&(So=lu("canvas")),So.width=e.width,So.height=e.height;const r=So.getContext("2d");e instanceof ImageData?r.putImageData(e,0,0):r.drawImage(e,0,0,e.width,e.height),i=So}return i.toDataURL(n)}static sRGBToLinear(e){if(typeof HTMLImageElement<"u"&&e instanceof HTMLImageElement||typeof HTMLCanvasElement<"u"&&e instanceof HTMLCanvasElement||typeof ImageBitmap<"u"&&e instanceof ImageBitmap){const n=lu("canvas");n.width=e.width,n.height=e.height;const i=n.getContext("2d");i.drawImage(e,0,0,e.width,e.height);const r=i.getImageData(0,0,e.width,e.height),s=r.data;for(let o=0;o1),this.pmremVersion=0}get width(){return this.source.getSize(sf).x}get height(){return this.source.getSize(sf).y}get depth(){return this.source.getSize(sf).z}get image(){return this.source.data}set image(e=null){this.source.data=e}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(e,n){this.updateRanges.push({start:e,count:n})}clearUpdateRanges(){this.updateRanges.length=0}clone(){return new this.constructor().copy(this)}copy(e){return this.name=e.name,this.source=e.source,this.mipmaps=e.mipmaps.slice(0),this.mapping=e.mapping,this.channel=e.channel,this.wrapS=e.wrapS,this.wrapT=e.wrapT,this.magFilter=e.magFilter,this.minFilter=e.minFilter,this.anisotropy=e.anisotropy,this.format=e.format,this.internalFormat=e.internalFormat,this.type=e.type,this.offset.copy(e.offset),this.repeat.copy(e.repeat),this.center.copy(e.center),this.rotation=e.rotation,this.matrixAutoUpdate=e.matrixAutoUpdate,this.matrix.copy(e.matrix),this.generateMipmaps=e.generateMipmaps,this.premultiplyAlpha=e.premultiplyAlpha,this.flipY=e.flipY,this.unpackAlignment=e.unpackAlignment,this.colorSpace=e.colorSpace,this.renderTarget=e.renderTarget,this.isRenderTargetTexture=e.isRenderTargetTexture,this.isArrayTexture=e.isArrayTexture,this.userData=JSON.parse(JSON.stringify(e.userData)),this.needsUpdate=!0,this}setValues(e){for(const n in e){const i=e[n];if(i===void 0){it(`Texture.setValues(): parameter '${n}' has value of undefined.`);continue}const r=this[n];if(r===void 0){it(`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(e){const n=e===void 0||typeof e=="string";if(!n&&e.textures[this.uuid]!==void 0)return e.textures[this.uuid];const i={metadata:{version:4.7,type:"Texture",generator:"Texture.toJSON"},uuid:this.uuid,name:this.name,image:this.source.toJSON(e).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||(e.textures[this.uuid]=i),i}dispose(){this.dispatchEvent({type:"dispose"})}transformUv(e){if(this.mapping!==db)return e;if(e.applyMatrix3(this.matrix),e.x<0||e.x>1)switch(this.wrapS){case Eh:e.x=e.x-Math.floor(e.x);break;case Ir:e.x=e.x<0?0:1;break;case Th:Math.abs(Math.floor(e.x)%2)===1?e.x=Math.ceil(e.x)-e.x:e.x=e.x-Math.floor(e.x);break}if(e.y<0||e.y>1)switch(this.wrapT){case Eh:e.y=e.y-Math.floor(e.y);break;case Ir:e.y=e.y<0?0:1;break;case Th:Math.abs(Math.floor(e.y)%2)===1?e.y=Math.ceil(e.y)-e.y:e.y=e.y-Math.floor(e.y);break}return this.flipY&&(e.y=1-e.y),e}set needsUpdate(e){e===!0&&(this.version++,this.source.needsUpdate=!0)}set needsPMREMUpdate(e){e===!0&&this.pmremVersion++}}Hn.DEFAULT_IMAGE=null;Hn.DEFAULT_MAPPING=db;Hn.DEFAULT_ANISOTROPY=1;class Zt{constructor(e=0,n=0,i=0,r=1){Zt.prototype.isVector4=!0,this.x=e,this.y=n,this.z=i,this.w=r}get width(){return this.z}set width(e){this.z=e}get height(){return this.w}set height(e){this.w=e}set(e,n,i,r){return this.x=e,this.y=n,this.z=i,this.w=r,this}setScalar(e){return this.x=e,this.y=e,this.z=e,this.w=e,this}setX(e){return this.x=e,this}setY(e){return this.y=e,this}setZ(e){return this.z=e,this}setW(e){return this.w=e,this}setComponent(e,n){switch(e){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: "+e)}return this}getComponent(e){switch(e){case 0:return this.x;case 1:return this.y;case 2:return this.z;case 3:return this.w;default:throw new Error("index is out of range: "+e)}}clone(){return new this.constructor(this.x,this.y,this.z,this.w)}copy(e){return this.x=e.x,this.y=e.y,this.z=e.z,this.w=e.w!==void 0?e.w:1,this}add(e){return this.x+=e.x,this.y+=e.y,this.z+=e.z,this.w+=e.w,this}addScalar(e){return this.x+=e,this.y+=e,this.z+=e,this.w+=e,this}addVectors(e,n){return this.x=e.x+n.x,this.y=e.y+n.y,this.z=e.z+n.z,this.w=e.w+n.w,this}addScaledVector(e,n){return this.x+=e.x*n,this.y+=e.y*n,this.z+=e.z*n,this.w+=e.w*n,this}sub(e){return this.x-=e.x,this.y-=e.y,this.z-=e.z,this.w-=e.w,this}subScalar(e){return this.x-=e,this.y-=e,this.z-=e,this.w-=e,this}subVectors(e,n){return this.x=e.x-n.x,this.y=e.y-n.y,this.z=e.z-n.z,this.w=e.w-n.w,this}multiply(e){return this.x*=e.x,this.y*=e.y,this.z*=e.z,this.w*=e.w,this}multiplyScalar(e){return this.x*=e,this.y*=e,this.z*=e,this.w*=e,this}applyMatrix4(e){const n=this.x,i=this.y,r=this.z,s=this.w,o=e.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(e){return this.x/=e.x,this.y/=e.y,this.z/=e.z,this.w/=e.w,this}divideScalar(e){return this.multiplyScalar(1/e)}setAxisAngleFromQuaternion(e){this.w=2*Math.acos(e.w);const n=Math.sqrt(1-e.w*e.w);return n<1e-4?(this.x=1,this.y=0,this.z=0):(this.x=e.x/n,this.y=e.y/n,this.z=e.z/n),this}setAxisAngleFromRotationMatrix(e){let n,i,r,s;const l=e.elements,c=l[0],u=l[4],d=l[8],f=l[1],h=l[5],g=l[9],v=l[2],m=l[6],p=l[10];if(Math.abs(u-f)<.01&&Math.abs(d-v)<.01&&Math.abs(g-m)<.01){if(Math.abs(u+f)<.1&&Math.abs(d+v)<.1&&Math.abs(g+m)<.1&&Math.abs(c+h+p-3)<.1)return this.set(1,0,0,0),this;n=Math.PI;const y=(c+1)/2,x=(h+1)/2,M=(p+1)/2,A=(u+f)/4,P=(d+v)/4,D=(g+m)/4;return y>x&&y>M?y<.01?(i=0,r=.707106781,s=.707106781):(i=Math.sqrt(y),r=A/i,s=P/i):x>M?x<.01?(i=.707106781,r=0,s=.707106781):(r=Math.sqrt(x),i=A/r,s=D/r):M<.01?(i=.707106781,r=.707106781,s=0):(s=Math.sqrt(M),i=P/s,r=D/s),this.set(i,r,s,n),this}let _=Math.sqrt((m-g)*(m-g)+(d-v)*(d-v)+(f-u)*(f-u));return Math.abs(_)<.001&&(_=1),this.x=(m-g)/_,this.y=(d-v)/_,this.z=(f-u)/_,this.w=Math.acos((c+h+p-1)/2),this}setFromMatrixPosition(e){const n=e.elements;return this.x=n[12],this.y=n[13],this.z=n[14],this.w=n[15],this}min(e){return this.x=Math.min(this.x,e.x),this.y=Math.min(this.y,e.y),this.z=Math.min(this.z,e.z),this.w=Math.min(this.w,e.w),this}max(e){return this.x=Math.max(this.x,e.x),this.y=Math.max(this.y,e.y),this.z=Math.max(this.z,e.z),this.w=Math.max(this.w,e.w),this}clamp(e,n){return this.x=ht(this.x,e.x,n.x),this.y=ht(this.y,e.y,n.y),this.z=ht(this.z,e.z,n.z),this.w=ht(this.w,e.w,n.w),this}clampScalar(e,n){return this.x=ht(this.x,e,n),this.y=ht(this.y,e,n),this.z=ht(this.z,e,n),this.w=ht(this.w,e,n),this}clampLength(e,n){const i=this.length();return this.divideScalar(i||1).multiplyScalar(ht(i,e,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(e){return this.x*e.x+this.y*e.y+this.z*e.z+this.w*e.w}lengthSq(){return this.x*this.x+this.y*this.y+this.z*this.z+this.w*this.w}length(){return Math.sqrt(this.x*this.x+this.y*this.y+this.z*this.z+this.w*this.w)}manhattanLength(){return Math.abs(this.x)+Math.abs(this.y)+Math.abs(this.z)+Math.abs(this.w)}normalize(){return this.divideScalar(this.length()||1)}setLength(e){return this.normalize().multiplyScalar(e)}lerp(e,n){return this.x+=(e.x-this.x)*n,this.y+=(e.y-this.y)*n,this.z+=(e.z-this.z)*n,this.w+=(e.w-this.w)*n,this}lerpVectors(e,n,i){return this.x=e.x+(n.x-e.x)*i,this.y=e.y+(n.y-e.y)*i,this.z=e.z+(n.z-e.z)*i,this.w=e.w+(n.w-e.w)*i,this}equals(e){return e.x===this.x&&e.y===this.y&&e.z===this.z&&e.w===this.w}fromArray(e,n=0){return this.x=e[n],this.y=e[n+1],this.z=e[n+2],this.w=e[n+3],this}toArray(e=[],n=0){return e[n]=this.x,e[n+1]=this.y,e[n+2]=this.z,e[n+3]=this.w,e}fromBufferAttribute(e,n){return this.x=e.getX(n),this.y=e.getY(n),this.z=e.getZ(n),this.w=e.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 SP extends fo{constructor(e=1,n=1,i={}){super(),i=Object.assign({generateMipmaps:!1,internalFormat:null,minFilter:Dn,depthBuffer:!0,stencilBuffer:!1,resolveDepthBuffer:!0,resolveStencilBuffer:!0,depthTexture:null,samples:0,count:1,depth:1,multiview:!1},i),this.isRenderTarget=!0,this.width=e,this.height=n,this.depth=i.depth,this.scissor=new Zt(0,0,e,n),this.scissorTest=!1,this.viewport=new Zt(0,0,e,n);const r={width:e,height:n,depth:i.depth},s=new Hn(r);this.textures=[];const o=i.count;for(let a=0;a1);this.dispose()}this.viewport.set(0,0,e,n),this.scissor.set(0,0,e,n)}clone(){return new this.constructor().copy(this)}copy(e){this.width=e.width,this.height=e.height,this.depth=e.depth,this.scissor.copy(e.scissor),this.scissorTest=e.scissorTest,this.viewport.copy(e.viewport),this.textures.length=0;for(let n=0,i=e.textures.length;n=this.min.x&&e.x<=this.max.x&&e.y>=this.min.y&&e.y<=this.max.y&&e.z>=this.min.z&&e.z<=this.max.z}containsBox(e){return this.min.x<=e.min.x&&e.max.x<=this.max.x&&this.min.y<=e.min.y&&e.max.y<=this.max.y&&this.min.z<=e.min.z&&e.max.z<=this.max.z}getParameter(e,n){return n.set((e.x-this.min.x)/(this.max.x-this.min.x),(e.y-this.min.y)/(this.max.y-this.min.y),(e.z-this.min.z)/(this.max.z-this.min.z))}intersectsBox(e){return e.max.x>=this.min.x&&e.min.x<=this.max.x&&e.max.y>=this.min.y&&e.min.y<=this.max.y&&e.max.z>=this.min.z&&e.min.z<=this.max.z}intersectsSphere(e){return this.clampPoint(e.center,wi),wi.distanceToSquared(e.center)<=e.radius*e.radius}intersectsPlane(e){let n,i;return e.normal.x>0?(n=e.normal.x*this.min.x,i=e.normal.x*this.max.x):(n=e.normal.x*this.max.x,i=e.normal.x*this.min.x),e.normal.y>0?(n+=e.normal.y*this.min.y,i+=e.normal.y*this.max.y):(n+=e.normal.y*this.max.y,i+=e.normal.y*this.min.y),e.normal.z>0?(n+=e.normal.z*this.min.z,i+=e.normal.z*this.max.z):(n+=e.normal.z*this.max.z,i+=e.normal.z*this.min.z),n<=-e.constant&&i>=-e.constant}intersectsTriangle(e){if(this.isEmpty())return!1;this.getCenter(wa),Xl.subVectors(this.max,wa),wo.subVectors(e.a,wa),Mo.subVectors(e.b,wa),Eo.subVectors(e.c,wa),ts.subVectors(Mo,wo),ns.subVectors(Eo,Mo),Os.subVectors(wo,Eo);let n=[0,-ts.z,ts.y,0,-ns.z,ns.y,0,-Os.z,Os.y,ts.z,0,-ts.x,ns.z,0,-ns.x,Os.z,0,-Os.x,-ts.y,ts.x,0,-ns.y,ns.x,0,-Os.y,Os.x,0];return!of(n,wo,Mo,Eo,Xl)||(n=[1,0,0,0,1,0,0,0,1],!of(n,wo,Mo,Eo,Xl))?!1:($l.crossVectors(ts,ns),n=[$l.x,$l.y,$l.z],of(n,wo,Mo,Eo,Xl))}clampPoint(e,n){return n.copy(e).clamp(this.min,this.max)}distanceToPoint(e){return this.clampPoint(e,wi).distanceTo(e)}getBoundingSphere(e){return this.isEmpty()?e.makeEmpty():(this.getCenter(e.center),e.radius=this.getSize(wi).length()*.5),e}intersect(e){return this.min.max(e.min),this.max.min(e.max),this.isEmpty()&&this.makeEmpty(),this}union(e){return this.min.min(e.min),this.max.max(e.max),this}applyMatrix4(e){return this.isEmpty()?this:(gr[0].set(this.min.x,this.min.y,this.min.z).applyMatrix4(e),gr[1].set(this.min.x,this.min.y,this.max.z).applyMatrix4(e),gr[2].set(this.min.x,this.max.y,this.min.z).applyMatrix4(e),gr[3].set(this.min.x,this.max.y,this.max.z).applyMatrix4(e),gr[4].set(this.max.x,this.min.y,this.min.z).applyMatrix4(e),gr[5].set(this.max.x,this.min.y,this.max.z).applyMatrix4(e),gr[6].set(this.max.x,this.max.y,this.min.z).applyMatrix4(e),gr[7].set(this.max.x,this.max.y,this.max.z).applyMatrix4(e),this.setFromPoints(gr),this)}translate(e){return this.min.add(e),this.max.add(e),this}equals(e){return e.min.equals(this.min)&&e.max.equals(this.max)}toJSON(){return{min:this.min.toArray(),max:this.max.toArray()}}fromJSON(e){return this.min.fromArray(e.min),this.max.fromArray(e.max),this}}const gr=[new N,new N,new N,new N,new N,new N,new N,new N],wi=new N,ql=new El,wo=new N,Mo=new N,Eo=new N,ts=new N,ns=new N,Os=new N,wa=new N,Xl=new N,$l=new N,Fs=new N;function of(t,e,n,i,r){for(let s=0,o=t.length-3;s<=o;s+=3){Fs.fromArray(t,s);const a=r.x*Math.abs(Fs.x)+r.y*Math.abs(Fs.y)+r.z*Math.abs(Fs.z),l=e.dot(Fs),c=n.dot(Fs),u=i.dot(Fs);if(Math.max(-Math.max(l,c,u),Math.min(l,c,u))>a)return!1}return!0}const MP=new El,Ma=new N,af=new N;class Tl{constructor(e=new N,n=-1){this.isSphere=!0,this.center=e,this.radius=n}set(e,n){return this.center.copy(e),this.radius=n,this}setFromPoints(e,n){const i=this.center;n!==void 0?i.copy(n):MP.setFromPoints(e).getCenter(i);let r=0;for(let s=0,o=e.length;sthis.radius*this.radius&&(n.sub(this.center).normalize(),n.multiplyScalar(this.radius).add(this.center)),n}getBoundingBox(e){return this.isEmpty()?(e.makeEmpty(),e):(e.set(this.center,this.center),e.expandByScalar(this.radius),e)}applyMatrix4(e){return this.center.applyMatrix4(e),this.radius=this.radius*e.getMaxScaleOnAxis(),this}translate(e){return this.center.add(e),this}expandByPoint(e){if(this.isEmpty())return this.center.copy(e),this.radius=0,this;Ma.subVectors(e,this.center);const n=Ma.lengthSq();if(n>this.radius*this.radius){const i=Math.sqrt(n),r=(i-this.radius)*.5;this.center.addScaledVector(Ma,r/i),this.radius+=r}return this}union(e){return e.isEmpty()?this:this.isEmpty()?(this.copy(e),this):(this.center.equals(e.center)===!0?this.radius=Math.max(this.radius,e.radius):(af.subVectors(e.center,this.center).setLength(e.radius),this.expandByPoint(Ma.copy(e.center).add(af)),this.expandByPoint(Ma.copy(e.center).sub(af))),this)}equals(e){return e.center.equals(this.center)&&e.radius===this.radius}clone(){return new this.constructor().copy(this)}toJSON(){return{radius:this.radius,center:this.center.toArray()}}fromJSON(e){return this.radius=e.radius,this.center.fromArray(e.center),this}}const vr=new N,lf=new N,jl=new N,is=new N,cf=new N,Yl=new N,uf=new N;class Al{constructor(e=new N,n=new N(0,0,-1)){this.origin=e,this.direction=n}set(e,n){return this.origin.copy(e),this.direction.copy(n),this}copy(e){return this.origin.copy(e.origin),this.direction.copy(e.direction),this}at(e,n){return n.copy(this.origin).addScaledVector(this.direction,e)}lookAt(e){return this.direction.copy(e).sub(this.origin).normalize(),this}recast(e){return this.origin.copy(this.at(e,vr)),this}closestPointToPoint(e,n){n.subVectors(e,this.origin);const i=n.dot(this.direction);return i<0?n.copy(this.origin):n.copy(this.origin).addScaledVector(this.direction,i)}distanceToPoint(e){return Math.sqrt(this.distanceSqToPoint(e))}distanceSqToPoint(e){const n=vr.subVectors(e,this.origin).dot(this.direction);return n<0?this.origin.distanceToSquared(e):(vr.copy(this.origin).addScaledVector(this.direction,n),vr.distanceToSquared(e))}distanceSqToSegment(e,n,i,r){lf.copy(e).add(n).multiplyScalar(.5),jl.copy(n).sub(e).normalize(),is.copy(this.origin).sub(lf);const s=e.distanceTo(n)*.5,o=-this.direction.dot(jl),a=is.dot(this.direction),l=-is.dot(jl),c=is.lengthSq(),u=Math.abs(1-o*o);let d,f,h,g;if(u>0)if(d=o*l-a,f=o*a-l,g=s*u,d>=0)if(f>=-g)if(f<=g){const v=1/u;d*=v,f*=v,h=d*(d+o*f+2*a)+f*(o*d+f+2*l)+c}else f=s,d=Math.max(0,-(o*f+a)),h=-d*d+f*(f+2*l)+c;else f=-s,d=Math.max(0,-(o*f+a)),h=-d*d+f*(f+2*l)+c;else f<=-g?(d=Math.max(0,-(-o*s+a)),f=d>0?-s:Math.min(Math.max(-s,-l),s),h=-d*d+f*(f+2*l)+c):f<=g?(d=0,f=Math.min(Math.max(-s,-l),s),h=f*(f+2*l)+c):(d=Math.max(0,-(o*s+a)),f=d>0?s:Math.min(Math.max(-s,-l),s),h=-d*d+f*(f+2*l)+c);else f=o>0?-s:s,d=Math.max(0,-(o*f+a)),h=-d*d+f*(f+2*l)+c;return i&&i.copy(this.origin).addScaledVector(this.direction,d),r&&r.copy(lf).addScaledVector(jl,f),h}intersectSphere(e,n){vr.subVectors(e.center,this.origin);const i=vr.dot(this.direction),r=vr.dot(vr)-i*i,s=e.radius*e.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(e){return e.radius<0?!1:this.distanceSqToPoint(e.center)<=e.radius*e.radius}distanceToPlane(e){const n=e.normal.dot(this.direction);if(n===0)return e.distanceToPoint(this.origin)===0?0:null;const i=-(this.origin.dot(e.normal)+e.constant)/n;return i>=0?i:null}intersectPlane(e,n){const i=this.distanceToPlane(e);return i===null?null:this.at(i,n)}intersectsPlane(e){const n=e.distanceToPoint(this.origin);return n===0||e.normal.dot(this.direction)*n<0}intersectBox(e,n){let i,r,s,o,a,l;const c=1/this.direction.x,u=1/this.direction.y,d=1/this.direction.z,f=this.origin;return c>=0?(i=(e.min.x-f.x)*c,r=(e.max.x-f.x)*c):(i=(e.max.x-f.x)*c,r=(e.min.x-f.x)*c),u>=0?(s=(e.min.y-f.y)*u,o=(e.max.y-f.y)*u):(s=(e.max.y-f.y)*u,o=(e.min.y-f.y)*u),i>o||s>r||((s>i||isNaN(i))&&(i=s),(o=0?(a=(e.min.z-f.z)*d,l=(e.max.z-f.z)*d):(a=(e.max.z-f.z)*d,l=(e.min.z-f.z)*d),i>l||a>r)||((a>i||i!==i)&&(i=a),(l=0?i:r,n)}intersectsBox(e){return this.intersectBox(e,vr)!==null}intersectTriangle(e,n,i,r,s){cf.subVectors(n,e),Yl.subVectors(i,e),uf.crossVectors(cf,Yl);let o=this.direction.dot(uf),a;if(o>0){if(r)return null;a=1}else if(o<0)a=-1,o=-o;else return null;is.subVectors(this.origin,e);const l=a*this.direction.dot(Yl.crossVectors(is,Yl));if(l<0)return null;const c=a*this.direction.dot(cf.cross(is));if(c<0||l+c>o)return null;const u=-a*is.dot(uf);return u<0?null:this.at(u/o,s)}applyMatrix4(e){return this.origin.applyMatrix4(e),this.direction.transformDirection(e),this}equals(e){return e.origin.equals(this.origin)&&e.direction.equals(this.direction)}clone(){return new this.constructor().copy(this)}}class yt{constructor(e,n,i,r,s,o,a,l,c,u,d,f,h,g,v,m){yt.prototype.isMatrix4=!0,this.elements=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1],e!==void 0&&this.set(e,n,i,r,s,o,a,l,c,u,d,f,h,g,v,m)}set(e,n,i,r,s,o,a,l,c,u,d,f,h,g,v,m){const p=this.elements;return p[0]=e,p[4]=n,p[8]=i,p[12]=r,p[1]=s,p[5]=o,p[9]=a,p[13]=l,p[2]=c,p[6]=u,p[10]=d,p[14]=f,p[3]=h,p[7]=g,p[11]=v,p[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 yt().fromArray(this.elements)}copy(e){const n=this.elements,i=e.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(e){const n=this.elements,i=e.elements;return n[12]=i[12],n[13]=i[13],n[14]=i[14],this}setFromMatrix3(e){const n=e.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(e,n,i){return this.determinant()===0?(e.set(1,0,0),n.set(0,1,0),i.set(0,0,1),this):(e.setFromMatrixColumn(this,0),n.setFromMatrixColumn(this,1),i.setFromMatrixColumn(this,2),this)}makeBasis(e,n,i){return this.set(e.x,n.x,i.x,0,e.y,n.y,i.y,0,e.z,n.z,i.z,0,0,0,0,1),this}extractRotation(e){if(e.determinant()===0)return this.identity();const n=this.elements,i=e.elements,r=1/To.setFromMatrixColumn(e,0).length(),s=1/To.setFromMatrixColumn(e,1).length(),o=1/To.setFromMatrixColumn(e,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(e){const n=this.elements,i=e.x,r=e.y,s=e.z,o=Math.cos(i),a=Math.sin(i),l=Math.cos(r),c=Math.sin(r),u=Math.cos(s),d=Math.sin(s);if(e.order==="XYZ"){const f=o*u,h=o*d,g=a*u,v=a*d;n[0]=l*u,n[4]=-l*d,n[8]=c,n[1]=h+g*c,n[5]=f-v*c,n[9]=-a*l,n[2]=v-f*c,n[6]=g+h*c,n[10]=o*l}else if(e.order==="YXZ"){const f=l*u,h=l*d,g=c*u,v=c*d;n[0]=f+v*a,n[4]=g*a-h,n[8]=o*c,n[1]=o*d,n[5]=o*u,n[9]=-a,n[2]=h*a-g,n[6]=v+f*a,n[10]=o*l}else if(e.order==="ZXY"){const f=l*u,h=l*d,g=c*u,v=c*d;n[0]=f-v*a,n[4]=-o*d,n[8]=g+h*a,n[1]=h+g*a,n[5]=o*u,n[9]=v-f*a,n[2]=-o*c,n[6]=a,n[10]=o*l}else if(e.order==="ZYX"){const f=o*u,h=o*d,g=a*u,v=a*d;n[0]=l*u,n[4]=g*c-h,n[8]=f*c+v,n[1]=l*d,n[5]=v*c+f,n[9]=h*c-g,n[2]=-c,n[6]=a*l,n[10]=o*l}else if(e.order==="YZX"){const f=o*l,h=o*c,g=a*l,v=a*c;n[0]=l*u,n[4]=v-f*d,n[8]=g*d+h,n[1]=d,n[5]=o*u,n[9]=-a*u,n[2]=-c*u,n[6]=h*d+g,n[10]=f-v*d}else if(e.order==="XZY"){const f=o*l,h=o*c,g=a*l,v=a*c;n[0]=l*u,n[4]=-d,n[8]=c*u,n[1]=f*d+v,n[5]=o*u,n[9]=h*d-g,n[2]=g*d-h,n[6]=a*u,n[10]=v*d+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(e){return this.compose(EP,e,TP)}lookAt(e,n,i){const r=this.elements;return ri.subVectors(e,n),ri.lengthSq()===0&&(ri.z=1),ri.normalize(),rs.crossVectors(i,ri),rs.lengthSq()===0&&(Math.abs(i.z)===1?ri.x+=1e-4:ri.z+=1e-4,ri.normalize(),rs.crossVectors(i,ri)),rs.normalize(),Jl.crossVectors(ri,rs),r[0]=rs.x,r[4]=Jl.x,r[8]=ri.x,r[1]=rs.y,r[5]=Jl.y,r[9]=ri.y,r[2]=rs.z,r[6]=Jl.z,r[10]=ri.z,this}multiply(e){return this.multiplyMatrices(this,e)}premultiply(e){return this.multiplyMatrices(e,this)}multiplyMatrices(e,n){const i=e.elements,r=n.elements,s=this.elements,o=i[0],a=i[4],l=i[8],c=i[12],u=i[1],d=i[5],f=i[9],h=i[13],g=i[2],v=i[6],m=i[10],p=i[14],_=i[3],y=i[7],x=i[11],M=i[15],A=r[0],P=r[4],D=r[8],b=r[12],w=r[1],I=r[5],L=r[9],V=r[13],$=r[2],X=r[6],W=r[10],B=r[14],z=r[3],de=r[7],le=r[11],pe=r[15];return s[0]=o*A+a*w+l*$+c*z,s[4]=o*P+a*I+l*X+c*de,s[8]=o*D+a*L+l*W+c*le,s[12]=o*b+a*V+l*B+c*pe,s[1]=u*A+d*w+f*$+h*z,s[5]=u*P+d*I+f*X+h*de,s[9]=u*D+d*L+f*W+h*le,s[13]=u*b+d*V+f*B+h*pe,s[2]=g*A+v*w+m*$+p*z,s[6]=g*P+v*I+m*X+p*de,s[10]=g*D+v*L+m*W+p*le,s[14]=g*b+v*V+m*B+p*pe,s[3]=_*A+y*w+x*$+M*z,s[7]=_*P+y*I+x*X+M*de,s[11]=_*D+y*L+x*W+M*le,s[15]=_*b+y*V+x*B+M*pe,this}multiplyScalar(e){const n=this.elements;return n[0]*=e,n[4]*=e,n[8]*=e,n[12]*=e,n[1]*=e,n[5]*=e,n[9]*=e,n[13]*=e,n[2]*=e,n[6]*=e,n[10]*=e,n[14]*=e,n[3]*=e,n[7]*=e,n[11]*=e,n[15]*=e,this}determinant(){const e=this.elements,n=e[0],i=e[4],r=e[8],s=e[12],o=e[1],a=e[5],l=e[9],c=e[13],u=e[2],d=e[6],f=e[10],h=e[14],g=e[3],v=e[7],m=e[11],p=e[15],_=l*h-c*f,y=a*h-c*d,x=a*f-l*d,M=o*h-c*u,A=o*f-l*u,P=o*d-a*u;return n*(v*_-m*y+p*x)-i*(g*_-m*M+p*A)+r*(g*y-v*M+p*P)-s*(g*x-v*A+m*P)}transpose(){const e=this.elements;let n;return n=e[1],e[1]=e[4],e[4]=n,n=e[2],e[2]=e[8],e[8]=n,n=e[6],e[6]=e[9],e[9]=n,n=e[3],e[3]=e[12],e[12]=n,n=e[7],e[7]=e[13],e[13]=n,n=e[11],e[11]=e[14],e[14]=n,this}setPosition(e,n,i){const r=this.elements;return e.isVector3?(r[12]=e.x,r[13]=e.y,r[14]=e.z):(r[12]=e,r[13]=n,r[14]=i),this}invert(){const e=this.elements,n=e[0],i=e[1],r=e[2],s=e[3],o=e[4],a=e[5],l=e[6],c=e[7],u=e[8],d=e[9],f=e[10],h=e[11],g=e[12],v=e[13],m=e[14],p=e[15],_=d*m*c-v*f*c+v*l*h-a*m*h-d*l*p+a*f*p,y=g*f*c-u*m*c-g*l*h+o*m*h+u*l*p-o*f*p,x=u*v*c-g*d*c+g*a*h-o*v*h-u*a*p+o*d*p,M=g*d*l-u*v*l-g*a*f+o*v*f+u*a*m-o*d*m,A=n*_+i*y+r*x+s*M;if(A===0)return this.set(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0);const P=1/A;return e[0]=_*P,e[1]=(v*f*s-d*m*s-v*r*h+i*m*h+d*r*p-i*f*p)*P,e[2]=(a*m*s-v*l*s+v*r*c-i*m*c-a*r*p+i*l*p)*P,e[3]=(d*l*s-a*f*s-d*r*c+i*f*c+a*r*h-i*l*h)*P,e[4]=y*P,e[5]=(u*m*s-g*f*s+g*r*h-n*m*h-u*r*p+n*f*p)*P,e[6]=(g*l*s-o*m*s-g*r*c+n*m*c+o*r*p-n*l*p)*P,e[7]=(o*f*s-u*l*s+u*r*c-n*f*c-o*r*h+n*l*h)*P,e[8]=x*P,e[9]=(g*d*s-u*v*s-g*i*h+n*v*h+u*i*p-n*d*p)*P,e[10]=(o*v*s-g*a*s+g*i*c-n*v*c-o*i*p+n*a*p)*P,e[11]=(u*a*s-o*d*s-u*i*c+n*d*c+o*i*h-n*a*h)*P,e[12]=M*P,e[13]=(u*v*r-g*d*r+g*i*f-n*v*f-u*i*m+n*d*m)*P,e[14]=(g*a*r-o*v*r-g*i*l+n*v*l+o*i*m-n*a*m)*P,e[15]=(o*d*r-u*a*r+u*i*l-n*d*l-o*i*f+n*a*f)*P,this}scale(e){const n=this.elements,i=e.x,r=e.y,s=e.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 e=this.elements,n=e[0]*e[0]+e[1]*e[1]+e[2]*e[2],i=e[4]*e[4]+e[5]*e[5]+e[6]*e[6],r=e[8]*e[8]+e[9]*e[9]+e[10]*e[10];return Math.sqrt(Math.max(n,i,r))}makeTranslation(e,n,i){return e.isVector3?this.set(1,0,0,e.x,0,1,0,e.y,0,0,1,e.z,0,0,0,1):this.set(1,0,0,e,0,1,0,n,0,0,1,i,0,0,0,1),this}makeRotationX(e){const n=Math.cos(e),i=Math.sin(e);return this.set(1,0,0,0,0,n,-i,0,0,i,n,0,0,0,0,1),this}makeRotationY(e){const n=Math.cos(e),i=Math.sin(e);return this.set(n,0,i,0,0,1,0,0,-i,0,n,0,0,0,0,1),this}makeRotationZ(e){const n=Math.cos(e),i=Math.sin(e);return this.set(n,-i,0,0,i,n,0,0,0,0,1,0,0,0,0,1),this}makeRotationAxis(e,n){const i=Math.cos(n),r=Math.sin(n),s=1-i,o=e.x,a=e.y,l=e.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(e,n,i){return this.set(e,0,0,0,0,n,0,0,0,0,i,0,0,0,0,1),this}makeShear(e,n,i,r,s,o){return this.set(1,i,s,0,e,1,o,0,n,r,1,0,0,0,0,1),this}compose(e,n,i){const r=this.elements,s=n._x,o=n._y,a=n._z,l=n._w,c=s+s,u=o+o,d=a+a,f=s*c,h=s*u,g=s*d,v=o*u,m=o*d,p=a*d,_=l*c,y=l*u,x=l*d,M=i.x,A=i.y,P=i.z;return r[0]=(1-(v+p))*M,r[1]=(h+x)*M,r[2]=(g-y)*M,r[3]=0,r[4]=(h-x)*A,r[5]=(1-(f+p))*A,r[6]=(m+_)*A,r[7]=0,r[8]=(g+y)*P,r[9]=(m-_)*P,r[10]=(1-(f+v))*P,r[11]=0,r[12]=e.x,r[13]=e.y,r[14]=e.z,r[15]=1,this}decompose(e,n,i){const r=this.elements;if(e.x=r[12],e.y=r[13],e.z=r[14],this.determinant()===0)return i.set(1,1,1),n.identity(),this;let s=To.set(r[0],r[1],r[2]).length();const o=To.set(r[4],r[5],r[6]).length(),a=To.set(r[8],r[9],r[10]).length();this.determinant()<0&&(s=-s),Mi.copy(this);const c=1/s,u=1/o,d=1/a;return Mi.elements[0]*=c,Mi.elements[1]*=c,Mi.elements[2]*=c,Mi.elements[4]*=u,Mi.elements[5]*=u,Mi.elements[6]*=u,Mi.elements[8]*=d,Mi.elements[9]*=d,Mi.elements[10]*=d,n.setFromRotationMatrix(Mi),i.x=s,i.y=o,i.z=a,this}makePerspective(e,n,i,r,s,o,a=Zi,l=!1){const c=this.elements,u=2*s/(n-e),d=2*s/(i-r),f=(n+e)/(n-e),h=(i+r)/(i-r);let g,v;if(l)g=s/(o-s),v=o*s/(o-s);else if(a===Zi)g=-(o+s)/(o-s),v=-2*o*s/(o-s);else if(a===au)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]=d,c[9]=h,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(e,n,i,r,s,o,a=Zi,l=!1){const c=this.elements,u=2/(n-e),d=2/(i-r),f=-(n+e)/(n-e),h=-(i+r)/(i-r);let g,v;if(l)g=1/(o-s),v=o/(o-s);else if(a===Zi)g=-2/(o-s),v=-(o+s)/(o-s);else if(a===au)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]=d,c[9]=0,c[13]=h,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(e){const n=this.elements,i=e.elements;for(let r=0;r<16;r++)if(n[r]!==i[r])return!1;return!0}fromArray(e,n=0){for(let i=0;i<16;i++)this.elements[i]=e[i+n];return this}toArray(e=[],n=0){const i=this.elements;return e[n]=i[0],e[n+1]=i[1],e[n+2]=i[2],e[n+3]=i[3],e[n+4]=i[4],e[n+5]=i[5],e[n+6]=i[6],e[n+7]=i[7],e[n+8]=i[8],e[n+9]=i[9],e[n+10]=i[10],e[n+11]=i[11],e[n+12]=i[12],e[n+13]=i[13],e[n+14]=i[14],e[n+15]=i[15],e}}const To=new N,Mi=new yt,EP=new N(0,0,0),TP=new N(1,1,1),rs=new N,Jl=new N,ri=new N,S0=new yt,w0=new _n;class Oi{constructor(e=0,n=0,i=0,r=Oi.DEFAULT_ORDER){this.isEuler=!0,this._x=e,this._y=n,this._z=i,this._order=r}get x(){return this._x}set x(e){this._x=e,this._onChangeCallback()}get y(){return this._y}set y(e){this._y=e,this._onChangeCallback()}get z(){return this._z}set z(e){this._z=e,this._onChangeCallback()}get order(){return this._order}set order(e){this._order=e,this._onChangeCallback()}set(e,n,i,r=this._order){return this._x=e,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(e){return this._x=e._x,this._y=e._y,this._z=e._z,this._order=e._order,this._onChangeCallback(),this}setFromRotationMatrix(e,n=this._order,i=!0){const r=e.elements,s=r[0],o=r[4],a=r[8],l=r[1],c=r[5],u=r[9],d=r[2],f=r[6],h=r[10];switch(n){case"XYZ":this._y=Math.asin(ht(a,-1,1)),Math.abs(a)<.9999999?(this._x=Math.atan2(-u,h),this._z=Math.atan2(-o,s)):(this._x=Math.atan2(f,c),this._z=0);break;case"YXZ":this._x=Math.asin(-ht(u,-1,1)),Math.abs(u)<.9999999?(this._y=Math.atan2(a,h),this._z=Math.atan2(l,c)):(this._y=Math.atan2(-d,s),this._z=0);break;case"ZXY":this._x=Math.asin(ht(f,-1,1)),Math.abs(f)<.9999999?(this._y=Math.atan2(-d,h),this._z=Math.atan2(-o,c)):(this._y=0,this._z=Math.atan2(l,s));break;case"ZYX":this._y=Math.asin(-ht(d,-1,1)),Math.abs(d)<.9999999?(this._x=Math.atan2(f,h),this._z=Math.atan2(l,s)):(this._x=0,this._z=Math.atan2(-o,c));break;case"YZX":this._z=Math.asin(ht(l,-1,1)),Math.abs(l)<.9999999?(this._x=Math.atan2(-u,c),this._y=Math.atan2(-d,s)):(this._x=0,this._y=Math.atan2(a,h));break;case"XZY":this._z=Math.asin(-ht(o,-1,1)),Math.abs(o)<.9999999?(this._x=Math.atan2(f,c),this._y=Math.atan2(a,s)):(this._x=Math.atan2(-u,h),this._y=0);break;default:it("Euler: .setFromRotationMatrix() encountered an unknown order: "+n)}return this._order=n,i===!0&&this._onChangeCallback(),this}setFromQuaternion(e,n,i){return S0.makeRotationFromQuaternion(e),this.setFromRotationMatrix(S0,n,i)}setFromVector3(e,n=this._order){return this.set(e.x,e.y,e.z,n)}reorder(e){return w0.setFromEuler(this),this.setFromQuaternion(w0,e)}equals(e){return e._x===this._x&&e._y===this._y&&e._z===this._z&&e._order===this._order}fromArray(e){return this._x=e[0],this._y=e[1],this._z=e[2],e[3]!==void 0&&(this._order=e[3]),this._onChangeCallback(),this}toArray(e=[],n=0){return e[n]=this._x,e[n+1]=this._y,e[n+2]=this._z,e[n+3]=this._order,e}_onChange(e){return this._onChangeCallback=e,this}_onChangeCallback(){}*[Symbol.iterator](){yield this._x,yield this._y,yield this._z,yield this._order}}Oi.DEFAULT_ORDER="XYZ";class lm{constructor(){this.mask=1}set(e){this.mask=(1<>>0}enable(e){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(e),r.indirectTexture=this._indirectTexture.toJSON(e),this._colorsTexture!==null&&(r.colorsTexture=this._colorsTexture.toJSON(e)),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(e)),l.uuid}if(this.isScene)this.background&&(this.background.isColor?r.background=this.background.toJSON():this.background.isTexture&&(r.background=this.background.toJSON(e).uuid)),this.environment&&this.environment.isTexture&&this.environment.isRenderTargetTexture!==!0&&(r.environment=this.environment.toJSON(e).uuid);else if(this.isMesh||this.isLine||this.isPoints){r.geometry=s(e.geometries,this.geometry);const a=this.geometry.parameters;if(a!==void 0&&a.shapes!==void 0){const l=a.shapes;if(Array.isArray(l))for(let c=0,u=l.length;c0){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),d.length>0&&(i.shapes=d),f.length>0&&(i.skeletons=f),h.length>0&&(i.animations=h),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(e){return new this.constructor().copy(this,e)}copy(e,n=!0){if(this.name=e.name,this.up.copy(e.up),this.position.copy(e.position),this.rotation.order=e.rotation.order,this.quaternion.copy(e.quaternion),this.scale.copy(e.scale),this.matrix.copy(e.matrix),this.matrixWorld.copy(e.matrixWorld),this.matrixAutoUpdate=e.matrixAutoUpdate,this.matrixWorldAutoUpdate=e.matrixWorldAutoUpdate,this.matrixWorldNeedsUpdate=e.matrixWorldNeedsUpdate,this.layers.mask=e.layers.mask,this.visible=e.visible,this.castShadow=e.castShadow,this.receiveShadow=e.receiveShadow,this.frustumCulled=e.frustumCulled,this.renderOrder=e.renderOrder,this.animations=e.animations.slice(),this.userData=JSON.parse(JSON.stringify(e.userData)),n===!0)for(let i=0;i0?r.multiplyScalar(1/Math.sqrt(s)):r.set(0,0,0)}static getBarycoord(e,n,i,r,s){Ei.subVectors(r,n),xr.subVectors(i,n),ff.subVectors(e,n);const o=Ei.dot(Ei),a=Ei.dot(xr),l=Ei.dot(ff),c=xr.dot(xr),u=xr.dot(ff),d=o*c-a*a;if(d===0)return s.set(0,0,0),null;const f=1/d,h=(c*l-a*u)*f,g=(o*u-a*l)*f;return s.set(1-h-g,g,h)}static containsPoint(e,n,i,r){return this.getBarycoord(e,n,i,r,yr)===null?!1:yr.x>=0&&yr.y>=0&&yr.x+yr.y<=1}static getInterpolation(e,n,i,r,s,o,a,l){return this.getBarycoord(e,n,i,r,yr)===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,yr.x),l.addScaledVector(o,yr.y),l.addScaledVector(a,yr.z),l)}static getInterpolatedAttribute(e,n,i,r,s,o){return gf.setScalar(0),vf.setScalar(0),_f.setScalar(0),gf.fromBufferAttribute(e,n),vf.fromBufferAttribute(e,i),_f.fromBufferAttribute(e,r),o.setScalar(0),o.addScaledVector(gf,s.x),o.addScaledVector(vf,s.y),o.addScaledVector(_f,s.z),o}static isFrontFacing(e,n,i,r){return Ei.subVectors(i,n),xr.subVectors(e,n),Ei.cross(xr).dot(r)<0}set(e,n,i){return this.a.copy(e),this.b.copy(n),this.c.copy(i),this}setFromPointsAndIndices(e,n,i,r){return this.a.copy(e[n]),this.b.copy(e[i]),this.c.copy(e[r]),this}setFromAttributeAndIndices(e,n,i,r){return this.a.fromBufferAttribute(e,n),this.b.fromBufferAttribute(e,i),this.c.fromBufferAttribute(e,r),this}clone(){return new this.constructor().copy(this)}copy(e){return this.a.copy(e.a),this.b.copy(e.b),this.c.copy(e.c),this}getArea(){return Ei.subVectors(this.c,this.b),xr.subVectors(this.a,this.b),Ei.cross(xr).length()*.5}getMidpoint(e){return e.addVectors(this.a,this.b).add(this.c).multiplyScalar(1/3)}getNormal(e){return xi.getNormal(this.a,this.b,this.c,e)}getPlane(e){return e.setFromCoplanarPoints(this.a,this.b,this.c)}getBarycoord(e,n){return xi.getBarycoord(e,this.a,this.b,this.c,n)}getInterpolation(e,n,i,r,s){return xi.getInterpolation(e,this.a,this.b,this.c,n,i,r,s)}containsPoint(e){return xi.containsPoint(e,this.a,this.b,this.c)}isFrontFacing(e){return xi.isFrontFacing(this.a,this.b,this.c,e)}intersectsBox(e){return e.intersectsTriangle(this)}closestPointToPoint(e,n){const i=this.a,r=this.b,s=this.c;let o,a;Po.subVectors(r,i),Ro.subVectors(s,i),hf.subVectors(e,i);const l=Po.dot(hf),c=Ro.dot(hf);if(l<=0&&c<=0)return n.copy(i);pf.subVectors(e,r);const u=Po.dot(pf),d=Ro.dot(pf);if(u>=0&&d<=u)return n.copy(r);const f=l*d-u*c;if(f<=0&&l>=0&&u<=0)return o=l/(l-u),n.copy(i).addScaledVector(Po,o);mf.subVectors(e,s);const h=Po.dot(mf),g=Ro.dot(mf);if(g>=0&&h<=g)return n.copy(s);const v=h*c-l*g;if(v<=0&&c>=0&&g<=0)return a=c/(c-g),n.copy(i).addScaledVector(Ro,a);const m=u*g-h*d;if(m<=0&&d-u>=0&&h-g>=0)return P0.subVectors(s,r),a=(d-u)/(d-u+(h-g)),n.copy(r).addScaledVector(P0,a);const p=1/(m+v+f);return o=v*p,a=f*p,n.copy(i).addScaledVector(Po,o).addScaledVector(Ro,a)}equals(e){return e.a.equals(this.a)&&e.b.equals(this.b)&&e.c.equals(this.c)}}const Sb={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},ss={h:0,s:0,l:0},Zl={h:0,s:0,l:0};function xf(t,e,n){return n<0&&(n+=1),n>1&&(n-=1),n<1/6?t+(e-t)*6*n:n<1/2?e:n<2/3?t+(e-t)*6*(2/3-n):t}class nt{constructor(e,n,i){return this.isColor=!0,this.r=1,this.g=1,this.b=1,this.set(e,n,i)}set(e,n,i){if(n===void 0&&i===void 0){const r=e;r&&r.isColor?this.copy(r):typeof r=="number"?this.setHex(r):typeof r=="string"&&this.setStyle(r)}else this.setRGB(e,n,i);return this}setScalar(e){return this.r=e,this.g=e,this.b=e,this}setHex(e,n=oi){return e=Math.floor(e),this.r=(e>>16&255)/255,this.g=(e>>8&255)/255,this.b=(e&255)/255,wt.colorSpaceToWorking(this,n),this}setRGB(e,n,i,r=wt.workingColorSpace){return this.r=e,this.g=n,this.b=i,wt.colorSpaceToWorking(this,r),this}setHSL(e,n,i,r=wt.workingColorSpace){if(e=om(e,1),n=ht(n,0,1),i=ht(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=xf(o,s,e+1/3),this.g=xf(o,s,e),this.b=xf(o,s,e-1/3)}return wt.colorSpaceToWorking(this,r),this}setStyle(e,n=oi){function i(s){s!==void 0&&parseFloat(s)<1&&it("Color: Alpha component of "+e+" will be ignored.")}let r;if(r=/^(\w+)\(([^\)]*)\)/.exec(e)){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:it("Color: Unknown color model "+e)}}else if(r=/^\#([A-Fa-f\d]+)$/.exec(e)){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);it("Color: Invalid hex color "+e)}else if(e&&e.length>0)return this.setColorName(e,n);return this}setColorName(e,n=oi){const i=Sb[e.toLowerCase()];return i!==void 0?this.setHex(i,n):it("Color: Unknown color "+e),this}clone(){return new this.constructor(this.r,this.g,this.b)}copy(e){return this.r=e.r,this.g=e.g,this.b=e.b,this}copySRGBToLinear(e){return this.r=Or(e.r),this.g=Or(e.g),this.b=Or(e.b),this}copyLinearToSRGB(e){return this.r=Ko(e.r),this.g=Ko(e.g),this.b=Ko(e.b),this}convertSRGBToLinear(){return this.copySRGBToLinear(this),this}convertLinearToSRGB(){return this.copyLinearToSRGB(this),this}getHex(e=oi){return wt.workingToColorSpace(En.copy(this),e),Math.round(ht(En.r*255,0,255))*65536+Math.round(ht(En.g*255,0,255))*256+Math.round(ht(En.b*255,0,255))}getHexString(e=oi){return("000000"+this.getHex(e).toString(16)).slice(-6)}getHSL(e,n=wt.workingColorSpace){wt.workingToColorSpace(En.copy(this),n);const i=En.r,r=En.g,s=En.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 d=o-a;switch(c=u<=.5?d/(o+a):d/(2-o-a),o){case i:l=(r-s)/d+(r0!=e>0&&this.version++,this._alphaTest=e}onBeforeRender(){}onBeforeCompile(){}customProgramCacheKey(){return this.onBeforeCompile.toString()}setValues(e){if(e!==void 0)for(const n in e){const i=e[n];if(i===void 0){it(`Material: parameter '${n}' has value of undefined.`);continue}const r=this[n];if(r===void 0){it(`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(e){const n=e===void 0||typeof e=="string";n&&(e={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(e).uuid),this.clearcoatRoughnessMap&&this.clearcoatRoughnessMap.isTexture&&(i.clearcoatRoughnessMap=this.clearcoatRoughnessMap.toJSON(e).uuid),this.clearcoatNormalMap&&this.clearcoatNormalMap.isTexture&&(i.clearcoatNormalMap=this.clearcoatNormalMap.toJSON(e).uuid,i.clearcoatNormalScale=this.clearcoatNormalScale.toArray()),this.sheenColorMap&&this.sheenColorMap.isTexture&&(i.sheenColorMap=this.sheenColorMap.toJSON(e).uuid),this.sheenRoughnessMap&&this.sheenRoughnessMap.isTexture&&(i.sheenRoughnessMap=this.sheenRoughnessMap.toJSON(e).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(e).uuid),this.iridescenceThicknessMap&&this.iridescenceThicknessMap.isTexture&&(i.iridescenceThicknessMap=this.iridescenceThicknessMap.toJSON(e).uuid),this.anisotropy!==void 0&&(i.anisotropy=this.anisotropy),this.anisotropyRotation!==void 0&&(i.anisotropyRotation=this.anisotropyRotation),this.anisotropyMap&&this.anisotropyMap.isTexture&&(i.anisotropyMap=this.anisotropyMap.toJSON(e).uuid),this.map&&this.map.isTexture&&(i.map=this.map.toJSON(e).uuid),this.matcap&&this.matcap.isTexture&&(i.matcap=this.matcap.toJSON(e).uuid),this.alphaMap&&this.alphaMap.isTexture&&(i.alphaMap=this.alphaMap.toJSON(e).uuid),this.lightMap&&this.lightMap.isTexture&&(i.lightMap=this.lightMap.toJSON(e).uuid,i.lightMapIntensity=this.lightMapIntensity),this.aoMap&&this.aoMap.isTexture&&(i.aoMap=this.aoMap.toJSON(e).uuid,i.aoMapIntensity=this.aoMapIntensity),this.bumpMap&&this.bumpMap.isTexture&&(i.bumpMap=this.bumpMap.toJSON(e).uuid,i.bumpScale=this.bumpScale),this.normalMap&&this.normalMap.isTexture&&(i.normalMap=this.normalMap.toJSON(e).uuid,i.normalMapType=this.normalMapType,i.normalScale=this.normalScale.toArray()),this.displacementMap&&this.displacementMap.isTexture&&(i.displacementMap=this.displacementMap.toJSON(e).uuid,i.displacementScale=this.displacementScale,i.displacementBias=this.displacementBias),this.roughnessMap&&this.roughnessMap.isTexture&&(i.roughnessMap=this.roughnessMap.toJSON(e).uuid),this.metalnessMap&&this.metalnessMap.isTexture&&(i.metalnessMap=this.metalnessMap.toJSON(e).uuid),this.emissiveMap&&this.emissiveMap.isTexture&&(i.emissiveMap=this.emissiveMap.toJSON(e).uuid),this.specularMap&&this.specularMap.isTexture&&(i.specularMap=this.specularMap.toJSON(e).uuid),this.specularIntensityMap&&this.specularIntensityMap.isTexture&&(i.specularIntensityMap=this.specularIntensityMap.toJSON(e).uuid),this.specularColorMap&&this.specularColorMap.isTexture&&(i.specularColorMap=this.specularColorMap.toJSON(e).uuid),this.envMap&&this.envMap.isTexture&&(i.envMap=this.envMap.toJSON(e).uuid,this.combine!==void 0&&(i.combine=this.combine)),this.envMapRotation!==void 0&&(i.envMapRotation=this.envMapRotation.toArray()),this.envMapIntensity!==void 0&&(i.envMapIntensity=this.envMapIntensity),this.reflectivity!==void 0&&(i.reflectivity=this.reflectivity),this.refractionRatio!==void 0&&(i.refractionRatio=this.refractionRatio),this.gradientMap&&this.gradientMap.isTexture&&(i.gradientMap=this.gradientMap.toJSON(e).uuid),this.transmission!==void 0&&(i.transmission=this.transmission),this.transmissionMap&&this.transmissionMap.isTexture&&(i.transmissionMap=this.transmissionMap.toJSON(e).uuid),this.thickness!==void 0&&(i.thickness=this.thickness),this.thicknessMap&&this.thicknessMap.isTexture&&(i.thicknessMap=this.thicknessMap.toJSON(e).uuid),this.attenuationDistance!==void 0&&this.attenuationDistance!==1/0&&(i.attenuationDistance=this.attenuationDistance),this.attenuationColor!==void 0&&(i.attenuationColor=this.attenuationColor.getHex()),this.size!==void 0&&(i.size=this.size),this.shadowSide!==null&&(i.shadowSide=this.shadowSide),this.sizeAttenuation!==void 0&&(i.sizeAttenuation=this.sizeAttenuation),this.blending!==Yo&&(i.blending=this.blending),this.side!==ys&&(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!==ph&&(i.blendSrc=this.blendSrc),this.blendDst!==mh&&(i.blendDst=this.blendDst),this.blendEquation!==$s&&(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!==ia&&(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!==h0&&(i.stencilFunc=this.stencilFunc),this.stencilRef!==0&&(i.stencilRef=this.stencilRef),this.stencilFuncMask!==255&&(i.stencilFuncMask=this.stencilFuncMask),this.stencilFail!==bo&&(i.stencilFail=this.stencilFail),this.stencilZFail!==bo&&(i.stencilZFail=this.stencilZFail),this.stencilZPass!==bo&&(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(e.textures),o=r(e.images);s.length>0&&(i.textures=s),o.length>0&&(i.images=o)}return i}clone(){return new this.constructor().copy(this)}copy(e){this.name=e.name,this.blending=e.blending,this.side=e.side,this.vertexColors=e.vertexColors,this.opacity=e.opacity,this.transparent=e.transparent,this.blendSrc=e.blendSrc,this.blendDst=e.blendDst,this.blendEquation=e.blendEquation,this.blendSrcAlpha=e.blendSrcAlpha,this.blendDstAlpha=e.blendDstAlpha,this.blendEquationAlpha=e.blendEquationAlpha,this.blendColor.copy(e.blendColor),this.blendAlpha=e.blendAlpha,this.depthFunc=e.depthFunc,this.depthTest=e.depthTest,this.depthWrite=e.depthWrite,this.stencilWriteMask=e.stencilWriteMask,this.stencilFunc=e.stencilFunc,this.stencilRef=e.stencilRef,this.stencilFuncMask=e.stencilFuncMask,this.stencilFail=e.stencilFail,this.stencilZFail=e.stencilZFail,this.stencilZPass=e.stencilZPass,this.stencilWrite=e.stencilWrite;const n=e.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=e.clipIntersection,this.clipShadows=e.clipShadows,this.shadowSide=e.shadowSide,this.colorWrite=e.colorWrite,this.precision=e.precision,this.polygonOffset=e.polygonOffset,this.polygonOffsetFactor=e.polygonOffsetFactor,this.polygonOffsetUnits=e.polygonOffsetUnits,this.dithering=e.dithering,this.alphaTest=e.alphaTest,this.alphaHash=e.alphaHash,this.alphaToCoverage=e.alphaToCoverage,this.premultipliedAlpha=e.premultipliedAlpha,this.forceSinglePass=e.forceSinglePass,this.allowOverride=e.allowOverride,this.visible=e.visible,this.toneMapped=e.toneMapped,this.userData=JSON.parse(JSON.stringify(e.userData)),this}dispose(){this.dispatchEvent({type:"dispose"})}set needsUpdate(e){e===!0&&this.version++}}class Ms extends po{constructor(e){super(),this.isMeshBasicMaterial=!0,this.type="MeshBasicMaterial",this.color=new nt(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 Oi,this.combine=rb,this.reflectivity=1,this.refractionRatio=.98,this.wireframe=!1,this.wireframeLinewidth=1,this.wireframeLinecap="round",this.wireframeLinejoin="round",this.fog=!0,this.setValues(e)}copy(e){return super.copy(e),this.color.copy(e.color),this.map=e.map,this.lightMap=e.lightMap,this.lightMapIntensity=e.lightMapIntensity,this.aoMap=e.aoMap,this.aoMapIntensity=e.aoMapIntensity,this.specularMap=e.specularMap,this.alphaMap=e.alphaMap,this.envMap=e.envMap,this.envMapRotation.copy(e.envMapRotation),this.combine=e.combine,this.reflectivity=e.reflectivity,this.refractionRatio=e.refractionRatio,this.wireframe=e.wireframe,this.wireframeLinewidth=e.wireframeLinewidth,this.wireframeLinecap=e.wireframeLinecap,this.wireframeLinejoin=e.wireframeLinejoin,this.fog=e.fog,this}}const on=new N,Ql=new xe;let IP=0;class Gn{constructor(e,n,i=!1){if(Array.isArray(e))throw new TypeError("THREE.BufferAttribute: array should be a Typed Array.");this.isBufferAttribute=!0,Object.defineProperty(this,"id",{value:IP++}),this.name="",this.array=e,this.itemSize=n,this.count=e!==void 0?e.length/n:0,this.normalized=i,this.usage=p0,this.updateRanges=[],this.gpuType=Ki,this.version=0}onUploadCallback(){}set needsUpdate(e){e===!0&&this.version++}setUsage(e){return this.usage=e,this}addUpdateRange(e,n){this.updateRanges.push({start:e,count:n})}clearUpdateRanges(){this.updateRanges.length=0}copy(e){return this.name=e.name,this.array=new e.array.constructor(e.array),this.itemSize=e.itemSize,this.count=e.count,this.normalized=e.normalized,this.usage=e.usage,this.gpuType=e.gpuType,this}copyAt(e,n,i){e*=this.itemSize,i*=n.itemSize;for(let r=0,s=this.itemSize;rn.count&&it("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 El);const e=this.attributes.position,n=this.morphAttributes.position;if(e&&e.isGLBufferAttribute){bt("BufferGeometry.computeBoundingBox(): GLBufferAttribute requires a manual bounding box.",this),this.boundingBox.set(new N(-1/0,-1/0,-1/0),new N(1/0,1/0,1/0));return}if(e!==void 0){if(this.boundingBox.setFromBufferAttribute(e),n)for(let i=0,r=n.length;i0&&(e.userData=this.userData),this.parameters!==void 0){const l=this.parameters;for(const c in l)l[c]!==void 0&&(e[c]=l[c]);return e}e.data={attributes:{}};const n=this.index;n!==null&&(e.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];e.data.attributes[l]=c.toJSON(e.data)}const r={};let s=!1;for(const l in this.morphAttributes){const c=this.morphAttributes[l],u=[];for(let d=0,f=c.length;d0&&(r[l]=u,s=!0)}s&&(e.data.morphAttributes=r,e.data.morphTargetsRelative=this.morphTargetsRelative);const o=this.groups;o.length>0&&(e.data.groups=JSON.parse(JSON.stringify(o)));const a=this.boundingSphere;return a!==null&&(e.data.boundingSphere=a.toJSON()),e}clone(){return new this.constructor().copy(this)}copy(e){this.index=null,this.attributes={},this.morphAttributes={},this.groups=[],this.boundingBox=null,this.boundingSphere=null;const n={};this.name=e.name;const i=e.index;i!==null&&this.setIndex(i.clone());const r=e.attributes;for(const c in r){const u=r[c];this.setAttribute(c,u.clone(n))}const s=e.morphAttributes;for(const c in s){const u=[],d=s[c];for(let f=0,h=d.length;f0){const r=n[i[0]];if(r!==void 0){this.morphTargetInfluences=[],this.morphTargetDictionary={};for(let s=0,o=r.length;s(e.far-e.near)**2))&&(R0.copy(s).invert(),Us.copy(e.ray).applyMatrix4(R0),!(i.boundingBox!==null&&Us.intersectsBox(i.boundingBox)===!1)&&this._computeIntersections(e,n,Us)))}_computeIntersections(e,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,d=s.attributes.normal,f=s.groups,h=s.drawRange;if(a!==null)if(Array.isArray(o))for(let g=0,v=f.length;gn.far?null:{distance:c,point:sc.clone(),object:t}}function oc(t,e,n,i,r,s,o,a,l,c){t.getVertexPosition(a,tc),t.getVertexPosition(l,nc),t.getVertexPosition(c,ic);const u=LP(t,e,n,i,tc,nc,ic,I0);if(u){const d=new N;xi.getBarycoord(I0,tc,nc,ic,d),r&&(u.uv=xi.getInterpolatedAttribute(r,a,l,c,d,new xe)),s&&(u.uv1=xi.getInterpolatedAttribute(s,a,l,c,d,new xe)),o&&(u.normal=xi.getInterpolatedAttribute(o,a,l,c,d,new N),u.normal.dot(i.direction)>0&&u.normal.multiplyScalar(-1));const f={a,b:l,c,normal:new N,materialIndex:0};xi.getNormal(tc,nc,ic,f.normal),u.face=f,u.barycoord=d}return u}class Jt extends _t{constructor(e=1,n=1,i=1,r=1,s=1,o=1){super(),this.type="BoxGeometry",this.parameters={width:e,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=[],d=[];let f=0,h=0;g("z","y","x",-1,-1,i,n,e,o,s,0),g("z","y","x",1,-1,i,n,-e,o,s,1),g("x","z","y",1,1,e,i,n,r,o,2),g("x","z","y",1,-1,e,i,-n,r,o,3),g("x","y","z",1,-1,e,n,i,r,s,4),g("x","y","z",-1,-1,e,n,-i,r,s,5),this.setIndex(l),this.setAttribute("position",new ct(c,3)),this.setAttribute("normal",new ct(u,3)),this.setAttribute("uv",new ct(d,2));function g(v,m,p,_,y,x,M,A,P,D,b){const w=x/P,I=M/D,L=x/2,V=M/2,$=A/2,X=P+1,W=D+1;let B=0,z=0;const de=new N;for(let le=0;le0?1:-1,u.push(de.x,de.y,de.z),d.push(He/P),d.push(1-le/D),B+=1}}for(let le=0;ler.value||i.value||o.value?er(e.default({present:o.value})[0],{ref:c=>{const u=ws(c);return typeof u?.hasAttribute>"u"||(u?.hasAttribute("data-reka-popper-content-wrapper")?s.value=u.firstElementChild:s.value=u),u}}):null}});const oh=Ne({name:"PrimitiveSlot",inheritAttrs:!1,setup(t,{attrs:e,slots:n}){return()=>{if(!n.default)return null;const i=Lp(n.default()),r=i.findIndex(l=>l.type!==xn);if(r===-1)return i;const s=i[r];delete s.props?.ref;const o=s.props?It(e,s.props):e,a=Hr({...s,props:{}},o);return i.length===1?a:(i[r]=a,i)}}}),U1=["area","img","input"],wn=Ne({name:"Primitive",inheritAttrs:!1,props:{asChild:{type:Boolean,default:!1},as:{type:[String,Object],default:"div"}},setup(t,{attrs:e,slots:n}){const i=t.asChild?"template":t.as;return typeof i=="string"&&U1.includes(i)?()=>er(i,e):i!=="template"?()=>er(t.as,e,{default:n.default}):()=>er(oh,e,{default:n.default})}});function ro(){const t=ke(),e=Me(()=>["#text","#comment"].includes(t.value?.$el.nodeName)?t.value?.$el.nextElementSibling:ws(t));return{primitiveElement:t,currentElement:e}}const k1="dismissableLayer.pointerDownOutside",B1="dismissableLayer.focusOutside";function ly(t,e){if(!(e instanceof Element))return!1;const n=e.closest("[data-dismissable-layer]"),i=t.dataset.dismissableLayer===""?t:t.querySelector("[data-dismissable-layer]"),r=Array.from(t.ownerDocument.querySelectorAll("[data-dismissable-layer]"));return!!(n&&(i===n||r.indexOf(i){});return Wn(o=>{if(!Ui||!Nn(n))return;const a=async c=>{const u=c.target;if(!(!e?.value||!u)){if(ly(e.value,u)){r.value=!1;return}if(c.target&&!r.value){let h=function(){Zx(k1,t,f)};var d=h;const f={originalEvent:c};c.pointerType==="touch"?(i.removeEventListener("click",s.value),s.value=h,i.addEventListener("click",s.value,{once:!0})):h()}else i.removeEventListener("click",s.value);r.value=!1}},l=window.setTimeout(()=>{i.addEventListener("pointerdown",a)},0);o(()=>{window.clearTimeout(l),i.removeEventListener("pointerdown",a),i.removeEventListener("click",s.value)})}),{onPointerDownCapture:()=>{Nn(n)&&(r.value=!0)}}}function V1(t,e,n=!0){const i=e?.value?.ownerDocument??globalThis?.document,r=ke(!1);return Wn(s=>{if(!Ui||!Nn(n))return;const o=async a=>{if(!e?.value)return;await Vr(),await Vr();const l=a.target;!e.value||!l||ly(e.value,l)||a.target&&!r.value&&Zx(B1,t,{originalEvent:a})};i.addEventListener("focusin",o),s(()=>i.removeEventListener("focusin",o))}),{onFocusCapture:()=>{Nn(n)&&(r.value=!0)},onBlurCapture:()=>{Nn(n)&&(r.value=!1)}}}const gi=On({layersRoot:new Set,layersWithOutsidePointerEventsDisabled:new Set,originalBodyPointerEvents:void 0,branches:new Set});var H1=Ne({__name:"DismissableLayer",props:{disableOutsidePointerEvents:{type:Boolean,required:!1,default:!1},asChild:{type:Boolean,required:!1},as:{type:null,required:!1}},emits:["escapeKeyDown","pointerDownOutside","focusOutside","interactOutside","dismiss"],setup(t,{emit:e}){const n=t,i=e,{forwardRef:r,currentElement:s}=sn(),o=Me(()=>s.value?.ownerDocument??globalThis.document),a=Me(()=>gi.layersRoot),l=Me(()=>s.value?Array.from(a.value).indexOf(s.value):-1),c=Me(()=>gi.layersWithOutsidePointerEventsDisabled.size>0),u=Me(()=>{const h=Array.from(a.value),[g]=[...gi.layersWithOutsidePointerEventsDisabled].slice(-1),v=h.indexOf(g);return l.value>=v}),d=z1(async h=>{const g=[...gi.branches].some(v=>v?.contains(h.target));!u.value||g||(i("pointerDownOutside",h),i("interactOutside",h),await Vr(),h.defaultPrevented||i("dismiss"))},s),f=V1(h=>{[...gi.branches].some(v=>v?.contains(h.target))||(i("focusOutside",h),i("interactOutside",h),h.defaultPrevented||i("dismiss"))},s);return h1("Escape",h=>{l.value===a.value.size-1&&(i("escapeKeyDown",h),h.defaultPrevented||i("dismiss"))}),Wn(h=>{s.value&&(n.disableOutsidePointerEvents&&(gi.layersWithOutsidePointerEventsDisabled.size===0&&(gi.originalBodyPointerEvents=o.value.body.style.pointerEvents,o.value.body.style.pointerEvents="none"),gi.layersWithOutsidePointerEventsDisabled.add(s.value)),a.value.add(s.value),h(()=>{n.disableOutsidePointerEvents&&gi.layersWithOutsidePointerEventsDisabled.size===1&&!Nc(gi.originalBodyPointerEvents)&&(o.value.body.style.pointerEvents=gi.originalBodyPointerEvents)}))}),Wn(h=>{h(()=>{s.value&&(a.value.delete(s.value),gi.layersWithOutsidePointerEventsDisabled.delete(s.value))})}),(h,g)=>(me(),Ie(E(wn),{ref:E(r),"as-child":h.asChild,as:h.as,"data-dismissable-layer":"",style:$r({pointerEvents:c.value?u.value?"auto":"none":void 0}),onFocusCapture:E(f).onFocusCapture,onBlurCapture:E(f).onBlurCapture,onPointerdownCapture:E(d).onPointerDownCapture},{default:te(()=>[at(h.$slots,"default")]),_:3},8,["as-child","as","style","onFocusCapture","onBlurCapture","onPointerdownCapture"]))}}),cy=H1;const G1=t1(()=>ke([]));function W1(){const t=G1();return{add(e){const n=t.value[0];e!==n&&n?.pause(),t.value=Pg(t.value,e),t.value.unshift(e)},remove(e){t.value=Pg(t.value,e),t.value[0]?.resume()}}}function Pg(t,e){const n=[...t],i=n.indexOf(e);return i!==-1&&n.splice(i,1),n}const Gd="focusScope.autoFocusOnMount",Wd="focusScope.autoFocusOnUnmount",Rg={bubbles:!1,cancelable:!0};function q1(t,{select:e=!1}={}){const n=to();for(const i of t)if(ls(i,{select:e}),to()!==n)return!0}function X1(t){const e=uy(t),n=Dg(e,t),i=Dg(e.reverse(),t);return[n,i]}function uy(t){const e=[],n=document.createTreeWalker(t,NodeFilter.SHOW_ELEMENT,{acceptNode:i=>{const r=i.tagName==="INPUT"&&i.type==="hidden";return i.disabled||i.hidden||r?NodeFilter.FILTER_SKIP:i.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;n.nextNode();)e.push(n.currentNode);return e}function Dg(t,e){for(const n of t)if(!$1(n,{upTo:e}))return n}function $1(t,{upTo:e}){if(getComputedStyle(t).visibility==="hidden")return!0;for(;t;){if(e!==void 0&&t===e)return!1;if(getComputedStyle(t).display==="none")return!0;t=t.parentElement}return!1}function j1(t){return t instanceof HTMLInputElement&&"select"in t}function ls(t,{select:e=!1}={}){if(t&&t.focus){const n=to();t.focus({preventScroll:!0}),t!==n&&j1(t)&&e&&t.select()}}var Y1=Ne({__name:"FocusScope",props:{loop:{type:Boolean,required:!1,default:!1},trapped:{type:Boolean,required:!1,default:!1},asChild:{type:Boolean,required:!1},as:{type:null,required:!1}},emits:["mountAutoFocus","unmountAutoFocus"],setup(t,{emit:e}){const n=t,i=e,{currentRef:r,currentElement:s}=sn(),o=ke(null),a=W1(),l=On({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}});Wn(u=>{if(!Ui)return;const d=s.value;if(!n.trapped)return;function f(m){if(l.paused||!d)return;const p=m.target;d.contains(p)?o.value=p:ls(o.value,{select:!0})}function h(m){if(l.paused||!d)return;const p=m.relatedTarget;p!==null&&(d.contains(p)||ls(o.value,{select:!0}))}function g(m){const p=o.value;if(p===null||!m.some(x=>x.removedNodes.length>0))return;d.contains(p)||ls(d)}document.addEventListener("focusin",f),document.addEventListener("focusout",h);const v=new MutationObserver(g);d&&v.observe(d,{childList:!0,subtree:!0}),u(()=>{document.removeEventListener("focusin",f),document.removeEventListener("focusout",h),v.disconnect()})}),Wn(async u=>{const d=s.value;if(await Vr(),!d)return;a.add(l);const f=to();if(!d.contains(f)){const g=new CustomEvent(Gd,Rg);d.addEventListener(Gd,v=>i("mountAutoFocus",v)),d.dispatchEvent(g),g.defaultPrevented||(q1(uy(d),{select:!0}),to()===f&&ls(d))}u(()=>{d.removeEventListener(Gd,m=>i("mountAutoFocus",m));const g=new CustomEvent(Wd,Rg),v=m=>{i("unmountAutoFocus",m)};d.addEventListener(Wd,v),d.dispatchEvent(g),setTimeout(()=>{g.defaultPrevented||ls(f??document.body,{select:!0}),d.removeEventListener(Wd,v),a.remove(l)},0)})});function c(u){if(!n.loop&&!n.trapped||l.paused)return;const d=u.key==="Tab"&&!u.altKey&&!u.ctrlKey&&!u.metaKey,f=to();if(d&&f){const h=u.currentTarget,[g,v]=X1(h);g&&v?!u.shiftKey&&f===v?(u.preventDefault(),n.loop&&ls(g,{select:!0})):u.shiftKey&&f===g&&(u.preventDefault(),n.loop&&ls(v,{select:!0})):f===h&&u.preventDefault()}}return(u,d)=>(me(),Ie(E(wn),{ref_key:"currentRef",ref:r,tabindex:"-1","as-child":u.asChild,as:u.as,onKeydown:c},{default:te(()=>[at(u.$slots,"default")]),_:3},8,["as-child","as"]))}}),J1=Y1,K1=Ne({__name:"Teleport",props:{to:{type:null,required:!1,default:"body"},disabled:{type:Boolean,required:!1},defer:{type:Boolean,required:!1},forceMount:{type:Boolean,required:!1}},setup(t){const e=ty();return(n,i)=>E(e)||n.forceMount?(me(),Ie(gw,{key:0,to:n.to,disabled:n.disabled,defer:n.defer},[at(n.$slots,"default")],8,["to","disabled","defer"])):fi("v-if",!0)}}),dy=K1;const Ig="data-reka-collection-item";function Up(t={}){const{key:e="",isProvider:n=!1}=t,i=`${e}CollectionProvider`;let r;n?(r={collectionRef:ke(),itemMap:ke(new Map)},Mp(i,r)):r=Wo(i);const s=(u=!1)=>{const d=r.collectionRef.value;if(!d)return[];const f=Array.from(d.querySelectorAll(`[${Ig}]`)),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=Ne({name:"CollectionSlot",inheritAttrs:!1,setup(u,{slots:d,attrs:f}){const{primitiveElement:h,currentElement:g}=ro();return rn(g,()=>{r.collectionRef.value=g.value}),()=>er(oh,{ref:h,...f},d)}}),a=Ne({name:"CollectionItem",inheritAttrs:!1,props:{value:{validator:()=>!0}},setup(u,{slots:d,attrs:f}){const{primitiveElement:h,currentElement:g}=ro();return Wn(v=>{if(g.value){const m=nx(g.value);r.itemMap.value.set(m,{ref:g.value,value:u.value}),v(()=>r.itemMap.value.delete(m))}}),()=>er(oh,{...f,[Ig]:"",ref:h},d)}}),l=Me(()=>Array.from(r.itemMap.value.values())),c=Me(()=>r.itemMap.value.size);return{getItems:s,reactiveItems:l,itemMapSize:c,CollectionSlot:o,CollectionItem:a}}var Z1=Ne({__name:"VisuallyHidden",props:{feature:{type:String,required:!1,default:"focusable"},asChild:{type:Boolean,required:!1},as:{type:null,required:!1,default:"span"}},setup(t){return(e,n)=>(me(),Ie(E(wn),{as:e.as,"as-child":e.asChild,"aria-hidden":e.feature==="focusable"?"true":void 0,"data-hidden":e.feature==="fully-hidden"?"":void 0,tabindex:e.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:te(()=>[at(e.$slots,"default")]),_:3},8,["as","as-child","aria-hidden","data-hidden","tabindex"]))}}),fy=Z1,Q1=Ne({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(t){const e=t,{primitiveElement:n,currentElement:i}=ro(),r=Me(()=>e.checked??e.value);return rn(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 d=new Event("input",{bubbles:!0}),f=new Event("change",{bubbles:!0});u.call(a,s),a.dispatchEvent(d),a.dispatchEvent(f)}}),(s,o)=>(me(),Ie(fy,It({ref_key:"primitiveElement",ref:n},{...e,...s.$attrs},{as:"input"}),null,16))}}),Ng=Q1,eE=Ne({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(t){const e=t,n=Me(()=>typeof e.value=="object"&&Array.isArray(e.value)&&e.value.length===0&&e.required),i=Me(()=>typeof e.value=="string"||typeof e.value=="number"||typeof e.value=="boolean"||e.value===null||e.value===void 0?[{name:e.name,value:e.value}]:typeof e.value=="object"&&Array.isArray(e.value)?e.value.flatMap((r,s)=>typeof r=="object"?Object.entries(r).map(([o,a])=>({name:`${e.name}[${s}][${o}]`,value:a})):{name:`${e.name}[${s}]`,value:r}):e.value!==null&&typeof e.value=="object"&&!Array.isArray(e.value)?Object.entries(e.value).map(([r,s])=>({name:`${e.name}[${r}]`,value:s})):[]);return(r,s)=>(me(),Ct(Kt,null,[fi(" We render single input if it's required "),n.value?(me(),Ie(Ng,It({key:r.name},{...e,...r.$attrs},{name:r.name,value:r.value}),null,16,["name","value"])):(me(!0),Ct(Kt,{key:1},ta(i.value,o=>(me(),Ie(Ng,It({key:o.name},{ref_for:!0},{...e,...r.$attrs},{name:o.name,value:o.value}),null,16,["name","value"]))),128))],2112))}}),hy=eE;const[py,tE]=Jr("PopperRoot");var nE=Ne({inheritAttrs:!1,__name:"PopperRoot",setup(t){const e=ke();return tE({anchor:e,onAnchorChange:n=>e.value=n}),(n,i)=>at(n.$slots,"default")}}),my=nE,iE=Ne({__name:"PopperAnchor",props:{reference:{type:null,required:!1},asChild:{type:Boolean,required:!1},as:{type:null,required:!1}},setup(t){const e=t,{forwardRef:n,currentElement:i}=sn(),r=py();return dx(()=>{r.onAnchorChange(e.reference??i.value)}),(s,o)=>(me(),Ie(E(wn),{ref:E(n),as:s.as,"as-child":s.asChild},{default:te(()=>[at(s.$slots,"default")]),_:3},8,["as","as-child"]))}}),gy=iE;function rE(t){return t!==null}function sE(t){return{name:"transformOrigin",options:t,fn(e){const{placement:n,rects:i,middlewareData:r}=e,o=r.arrow?.centerOffset!==0,a=o?0:t.arrowWidth,l=o?0:t.arrowHeight,[c,u]=ah(n),d={start:"0%",center:"50%",end:"100%"}[u],f=(r.arrow?.x??0)+a/2,h=(r.arrow?.y??0)+l/2;let g="",v="";return c==="bottom"?(g=o?d:`${f}px`,v=`${-l}px`):c==="top"?(g=o?d:`${f}px`,v=`${i.floating.height+l}px`):c==="right"?(g=`${-l}px`,v=o?d:`${h}px`):c==="left"&&(g=`${i.floating.width+l}px`,v=o?d:`${h}px`),{data:{x:g,y:v}}}}}function ah(t){const[e,n="center"]=t.split("-");return[e,n]}const oE=["top","right","bottom","left"],_s=Math.min,ai=Math.max,tu=Math.round,Vl=Math.floor,tr=t=>({x:t,y:t}),aE={left:"right",right:"left",bottom:"top",top:"bottom"};function lh(t,e,n){return ai(t,_s(e,n))}function Gr(t,e){return typeof t=="function"?t(e):t}function Wr(t){return t.split("-")[0]}function ha(t){return t.split("-")[1]}function kp(t){return t==="x"?"y":"x"}function Bp(t){return t==="y"?"height":"width"}function Ji(t){const e=t[0];return e==="t"||e==="b"?"y":"x"}function zp(t){return kp(Ji(t))}function lE(t,e,n){n===void 0&&(n=!1);const i=ha(t),r=zp(t),s=Bp(r);let o=r==="x"?i===(n?"end":"start")?"right":"left":i==="start"?"bottom":"top";return e.reference[s]>e.floating[s]&&(o=nu(o)),[o,nu(o)]}function cE(t){const e=nu(t);return[ch(t),e,ch(e)]}function ch(t){return t.includes("start")?t.replace("start","end"):t.replace("end","start")}const Lg=["left","right"],Og=["right","left"],uE=["top","bottom"],dE=["bottom","top"];function fE(t,e,n){switch(t){case"top":case"bottom":return n?e?Og:Lg:e?Lg:Og;case"left":case"right":return e?uE:dE;default:return[]}}function hE(t,e,n,i){const r=ha(t);let s=fE(Wr(t),n==="start",i);return r&&(s=s.map(o=>o+"-"+r),e&&(s=s.concat(s.map(ch)))),s}function nu(t){const e=Wr(t);return aE[e]+t.slice(e.length)}function pE(t){return{top:0,right:0,bottom:0,left:0,...t}}function vy(t){return typeof t!="number"?pE(t):{top:t,right:t,bottom:t,left:t}}function iu(t){const{x:e,y:n,width:i,height:r}=t;return{width:i,height:r,top:n,left:e,right:e+i,bottom:n+r,x:e,y:n}}function Fg(t,e,n){let{reference:i,floating:r}=t;const s=Ji(e),o=zp(e),a=Bp(o),l=Wr(e),c=s==="y",u=i.x+i.width/2-r.width/2,d=i.y+i.height/2-r.height/2,f=i[a]/2-r[a]/2;let h;switch(l){case"top":h={x:u,y:i.y-r.height};break;case"bottom":h={x:u,y:i.y+i.height};break;case"right":h={x:i.x+i.width,y:d};break;case"left":h={x:i.x-r.width,y:d};break;default:h={x:i.x,y:i.y}}switch(ha(e)){case"start":h[o]-=f*(n&&c?-1:1);break;case"end":h[o]+=f*(n&&c?-1:1);break}return h}async function mE(t,e){var n;e===void 0&&(e={});const{x:i,y:r,platform:s,rects:o,elements:a,strategy:l}=t,{boundary:c="clippingAncestors",rootBoundary:u="viewport",elementContext:d="floating",altBoundary:f=!1,padding:h=0}=Gr(e,t),g=vy(h),m=a[f?d==="floating"?"reference":"floating":d],p=iu(await s.getClippingRect({element:(n=await(s.isElement==null?void 0:s.isElement(m)))==null||n?m:m.contextElement||await(s.getDocumentElement==null?void 0:s.getDocumentElement(a.floating)),boundary:c,rootBoundary:u,strategy:l})),_=d==="floating"?{x:i,y:r,width:o.floating.width,height:o.floating.height}:o.reference,y=await(s.getOffsetParent==null?void 0:s.getOffsetParent(a.floating)),x=await(s.isElement==null?void 0:s.isElement(y))?await(s.getScale==null?void 0:s.getScale(y))||{x:1,y:1}:{x:1,y:1},M=iu(s.convertOffsetParentRelativeRectToViewportRelativeRect?await s.convertOffsetParentRelativeRectToViewportRelativeRect({elements:a,rect:_,offsetParent:y,strategy:l}):_);return{top:(p.top-M.top+g.top)/x.y,bottom:(M.bottom-p.bottom+g.bottom)/x.y,left:(p.left-M.left+g.left)/x.x,right:(M.right-p.right+g.right)/x.x}}const gE=50,vE=async(t,e,n)=>{const{placement:i="bottom",strategy:r="absolute",middleware:s=[],platform:o}=n,a=o.detectOverflow?o:{...o,detectOverflow:mE},l=await(o.isRTL==null?void 0:o.isRTL(e));let c=await o.getElementRects({reference:t,floating:e,strategy:r}),{x:u,y:d}=Fg(c,i,l),f=i,h=0;const g={};for(let v=0;v({name:"arrow",options:t,async fn(e){const{x:n,y:i,placement:r,rects:s,platform:o,elements:a,middlewareData:l}=e,{element:c,padding:u=0}=Gr(t,e)||{};if(c==null)return{};const d=vy(u),f={x:n,y:i},h=zp(r),g=Bp(h),v=await o.getDimensions(c),m=h==="y",p=m?"top":"left",_=m?"bottom":"right",y=m?"clientHeight":"clientWidth",x=s.reference[g]+s.reference[h]-f[h]-s.floating[g],M=f[h]-s.reference[h],A=await(o.getOffsetParent==null?void 0:o.getOffsetParent(c));let P=A?A[y]:0;(!P||!await(o.isElement==null?void 0:o.isElement(A)))&&(P=a.floating[y]||s.floating[g]);const D=x/2-M/2,b=P/2-v[g]/2-1,w=_s(d[p],b),I=_s(d[_],b),L=w,V=P-v[g]-I,$=P/2-v[g]/2+D,X=lh(L,$,V),W=!l.arrow&&ha(r)!=null&&$!==X&&s.reference[g]/2-($$<=0)){var I,L;const $=(((I=s.flip)==null?void 0:I.index)||0)+1,X=P[$];if(X&&(!(d==="alignment"?_!==Ji(X):!1)||w.every(z=>Ji(z.placement)===_?z.overflows[0]>0:!0)))return{data:{index:$,overflows:w},reset:{placement:X}};let W=(L=w.filter(B=>B.overflows[0]<=0).sort((B,z)=>B.overflows[1]-z.overflows[1])[0])==null?void 0:L.placement;if(!W)switch(h){case"bestFit":{var V;const B=(V=w.filter(z=>{if(A){const de=Ji(z.placement);return de===_||de==="y"}return!0}).map(z=>[z.placement,z.overflows.filter(de=>de>0).reduce((de,le)=>de+le,0)]).sort((z,de)=>z[1]-de[1])[0])==null?void 0:V[0];B&&(W=B);break}case"initialPlacement":W=a;break}if(r!==W)return{reset:{placement:W}}}return{}}}};function Ug(t,e){return{top:t.top-e.height,right:t.right-e.width,bottom:t.bottom-e.height,left:t.left-e.width}}function kg(t){return oE.some(e=>t[e]>=0)}const yE=function(t){return t===void 0&&(t={}),{name:"hide",options:t,async fn(e){const{rects:n,platform:i}=e,{strategy:r="referenceHidden",...s}=Gr(t,e);switch(r){case"referenceHidden":{const o=await i.detectOverflow(e,{...s,elementContext:"reference"}),a=Ug(o,n.reference);return{data:{referenceHiddenOffsets:a,referenceHidden:kg(a)}}}case"escaped":{const o=await i.detectOverflow(e,{...s,altBoundary:!0}),a=Ug(o,n.floating);return{data:{escapedOffsets:a,escaped:kg(a)}}}default:return{}}}}},_y=new Set(["left","top"]);async function bE(t,e){const{placement:n,platform:i,elements:r}=t,s=await(i.isRTL==null?void 0:i.isRTL(r.floating)),o=Wr(n),a=ha(n),l=Ji(n)==="y",c=_y.has(o)?-1:1,u=s&&l?-1:1,d=Gr(e,t);let{mainAxis:f,crossAxis:h,alignmentAxis:g}=typeof d=="number"?{mainAxis:d,crossAxis:0,alignmentAxis:null}:{mainAxis:d.mainAxis||0,crossAxis:d.crossAxis||0,alignmentAxis:d.alignmentAxis};return a&&typeof g=="number"&&(h=a==="end"?g*-1:g),l?{x:h*u,y:f*c}:{x:f*c,y:h*u}}const SE=function(t){return t===void 0&&(t=0),{name:"offset",options:t,async fn(e){var n,i;const{x:r,y:s,placement:o,middlewareData:a}=e,l=await bE(e,t);return o===((n=a.offset)==null?void 0:n.placement)&&(i=a.arrow)!=null&&i.alignmentOffset?{}:{x:r+l.x,y:s+l.y,data:{...l,placement:o}}}}},wE=function(t){return t===void 0&&(t={}),{name:"shift",options:t,async fn(e){const{x:n,y:i,placement:r,platform:s}=e,{mainAxis:o=!0,crossAxis:a=!1,limiter:l={fn:p=>{let{x:_,y}=p;return{x:_,y}}},...c}=Gr(t,e),u={x:n,y:i},d=await s.detectOverflow(e,c),f=Ji(Wr(r)),h=kp(f);let g=u[h],v=u[f];if(o){const p=h==="y"?"top":"left",_=h==="y"?"bottom":"right",y=g+d[p],x=g-d[_];g=lh(y,g,x)}if(a){const p=f==="y"?"top":"left",_=f==="y"?"bottom":"right",y=v+d[p],x=v-d[_];v=lh(y,v,x)}const m=l.fn({...e,[h]:g,[f]:v});return{...m,data:{x:m.x-n,y:m.y-i,enabled:{[h]:o,[f]:a}}}}}},ME=function(t){return t===void 0&&(t={}),{options:t,fn(e){const{x:n,y:i,placement:r,rects:s,middlewareData:o}=e,{offset:a=0,mainAxis:l=!0,crossAxis:c=!0}=Gr(t,e),u={x:n,y:i},d=Ji(r),f=kp(d);let h=u[f],g=u[d];const v=Gr(a,e),m=typeof v=="number"?{mainAxis:v,crossAxis:0}:{mainAxis:0,crossAxis:0,...v};if(l){const y=f==="y"?"height":"width",x=s.reference[f]-s.floating[y]+m.mainAxis,M=s.reference[f]+s.reference[y]-m.mainAxis;hM&&(h=M)}if(c){var p,_;const y=f==="y"?"width":"height",x=_y.has(Wr(r)),M=s.reference[d]-s.floating[y]+(x&&((p=o.offset)==null?void 0:p[d])||0)+(x?0:m.crossAxis),A=s.reference[d]+s.reference[y]+(x?0:((_=o.offset)==null?void 0:_[d])||0)-(x?m.crossAxis:0);gA&&(g=A)}return{[f]:h,[d]:g}}}},EE=function(t){return t===void 0&&(t={}),{name:"size",options:t,async fn(e){var n,i;const{placement:r,rects:s,platform:o,elements:a}=e,{apply:l=()=>{},...c}=Gr(t,e),u=await o.detectOverflow(e,c),d=Wr(r),f=ha(r),h=Ji(r)==="y",{width:g,height:v}=s.floating;let m,p;d==="top"||d==="bottom"?(m=d,p=f===(await(o.isRTL==null?void 0:o.isRTL(a.floating))?"start":"end")?"left":"right"):(p=d,m=f==="end"?"top":"bottom");const _=v-u.top-u.bottom,y=g-u.left-u.right,x=_s(v-u[m],_),M=_s(g-u[p],y),A=!e.middlewareData.shift;let P=x,D=M;if((n=e.middlewareData.shift)!=null&&n.enabled.x&&(D=y),(i=e.middlewareData.shift)!=null&&i.enabled.y&&(P=_),A&&!f){const w=ai(u.left,0),I=ai(u.right,0),L=ai(u.top,0),V=ai(u.bottom,0);h?D=g-2*(w!==0||I!==0?w+I:ai(u.left,u.right)):P=v-2*(L!==0||V!==0?L+V:ai(u.top,u.bottom))}await l({...e,availableWidth:D,availableHeight:P});const b=await o.getDimensions(a.floating);return g!==b.width||v!==b.height?{reset:{rects:!0}}:{}}}};function ku(){return typeof window<"u"}function uo(t){return Vp(t)?(t.nodeName||"").toLowerCase():"#document"}function hi(t){var e;return(t==null||(e=t.ownerDocument)==null?void 0:e.defaultView)||window}function lr(t){var e;return(e=(Vp(t)?t.ownerDocument:t.document)||window.document)==null?void 0:e.documentElement}function Vp(t){return ku()?t instanceof Node||t instanceof hi(t).Node:!1}function Ni(t){return ku()?t instanceof Element||t instanceof hi(t).Element:!1}function Kr(t){return ku()?t instanceof HTMLElement||t instanceof hi(t).HTMLElement:!1}function Bg(t){return!ku()||typeof ShadowRoot>"u"?!1:t instanceof ShadowRoot||t instanceof hi(t).ShadowRoot}function wl(t){const{overflow:e,overflowX:n,overflowY:i,display:r}=Li(t);return/auto|scroll|overlay|hidden|clip/.test(e+i+n)&&r!=="inline"&&r!=="contents"}function TE(t){return/^(table|td|th)$/.test(uo(t))}function Bu(t){try{if(t.matches(":popover-open"))return!0}catch{}try{return t.matches(":modal")}catch{return!1}}const AE=/transform|translate|scale|rotate|perspective|filter/,CE=/paint|layout|strict|content/,Ns=t=>!!t&&t!=="none";let qd;function Hp(t){const e=Ni(t)?Li(t):t;return Ns(e.transform)||Ns(e.translate)||Ns(e.scale)||Ns(e.rotate)||Ns(e.perspective)||!Gp()&&(Ns(e.backdropFilter)||Ns(e.filter))||AE.test(e.willChange||"")||CE.test(e.contain||"")}function PE(t){let e=xs(t);for(;Kr(e)&&!na(e);){if(Hp(e))return e;if(Bu(e))return null;e=xs(e)}return null}function Gp(){return qd==null&&(qd=typeof CSS<"u"&&CSS.supports&&CSS.supports("-webkit-backdrop-filter","none")),qd}function na(t){return/^(html|body|#document)$/.test(uo(t))}function Li(t){return hi(t).getComputedStyle(t)}function zu(t){return Ni(t)?{scrollLeft:t.scrollLeft,scrollTop:t.scrollTop}:{scrollLeft:t.scrollX,scrollTop:t.scrollY}}function xs(t){if(uo(t)==="html")return t;const e=t.assignedSlot||t.parentNode||Bg(t)&&t.host||lr(t);return Bg(e)?e.host:e}function xy(t){const e=xs(t);return na(e)?t.ownerDocument?t.ownerDocument.body:t.body:Kr(e)&&wl(e)?e:xy(e)}function ll(t,e,n){var i;e===void 0&&(e=[]),n===void 0&&(n=!0);const r=xy(t),s=r===((i=t.ownerDocument)==null?void 0:i.body),o=hi(r);if(s){const a=uh(o);return e.concat(o,o.visualViewport||[],wl(r)?r:[],a&&n?ll(a):[])}else return e.concat(r,ll(r,[],n))}function uh(t){return t.parent&&Object.getPrototypeOf(t.parent)?t.frameElement:null}function yy(t){const e=Li(t);let n=parseFloat(e.width)||0,i=parseFloat(e.height)||0;const r=Kr(t),s=r?t.offsetWidth:n,o=r?t.offsetHeight:i,a=tu(n)!==s||tu(i)!==o;return a&&(n=s,i=o),{width:n,height:i,$:a}}function Wp(t){return Ni(t)?t:t.contextElement}function jo(t){const e=Wp(t);if(!Kr(e))return tr(1);const n=e.getBoundingClientRect(),{width:i,height:r,$:s}=yy(e);let o=(s?tu(n.width):n.width)/i,a=(s?tu(n.height):n.height)/r;return(!o||!Number.isFinite(o))&&(o=1),(!a||!Number.isFinite(a))&&(a=1),{x:o,y:a}}const RE=tr(0);function by(t){const e=hi(t);return!Gp()||!e.visualViewport?RE:{x:e.visualViewport.offsetLeft,y:e.visualViewport.offsetTop}}function DE(t,e,n){return e===void 0&&(e=!1),!n||e&&n!==hi(t)?!1:e}function so(t,e,n,i){e===void 0&&(e=!1),n===void 0&&(n=!1);const r=t.getBoundingClientRect(),s=Wp(t);let o=tr(1);e&&(i?Ni(i)&&(o=jo(i)):o=jo(t));const a=DE(s,n,i)?by(s):tr(0);let l=(r.left+a.x)/o.x,c=(r.top+a.y)/o.y,u=r.width/o.x,d=r.height/o.y;if(s){const f=hi(s),h=i&&Ni(i)?hi(i):i;let g=f,v=uh(g);for(;v&&i&&h!==g;){const m=jo(v),p=v.getBoundingClientRect(),_=Li(v),y=p.left+(v.clientLeft+parseFloat(_.paddingLeft))*m.x,x=p.top+(v.clientTop+parseFloat(_.paddingTop))*m.y;l*=m.x,c*=m.y,u*=m.x,d*=m.y,l+=y,c+=x,g=hi(v),v=uh(g)}}return iu({width:u,height:d,x:l,y:c})}function Vu(t,e){const n=zu(t).scrollLeft;return e?e.left+n:so(lr(t)).left+n}function Sy(t,e){const n=t.getBoundingClientRect(),i=n.left+e.scrollLeft-Vu(t,n),r=n.top+e.scrollTop;return{x:i,y:r}}function IE(t){let{elements:e,rect:n,offsetParent:i,strategy:r}=t;const s=r==="fixed",o=lr(i),a=e?Bu(e.floating):!1;if(i===o||a&&s)return n;let l={scrollLeft:0,scrollTop:0},c=tr(1);const u=tr(0),d=Kr(i);if((d||!d&&!s)&&((uo(i)!=="body"||wl(o))&&(l=zu(i)),d)){const h=so(i);c=jo(i),u.x=h.x+i.clientLeft,u.y=h.y+i.clientTop}const f=o&&!d&&!s?Sy(o,l):tr(0);return{width:n.width*c.x,height:n.height*c.y,x:n.x*c.x-l.scrollLeft*c.x+u.x+f.x,y:n.y*c.y-l.scrollTop*c.y+u.y+f.y}}function NE(t){return Array.from(t.getClientRects())}function LE(t){const e=lr(t),n=zu(t),i=t.ownerDocument.body,r=ai(e.scrollWidth,e.clientWidth,i.scrollWidth,i.clientWidth),s=ai(e.scrollHeight,e.clientHeight,i.scrollHeight,i.clientHeight);let o=-n.scrollLeft+Vu(t);const a=-n.scrollTop;return Li(i).direction==="rtl"&&(o+=ai(e.clientWidth,i.clientWidth)-r),{width:r,height:s,x:o,y:a}}const zg=25;function OE(t,e){const n=hi(t),i=lr(t),r=n.visualViewport;let s=i.clientWidth,o=i.clientHeight,a=0,l=0;if(r){s=r.width,o=r.height;const u=Gp();(!u||u&&e==="fixed")&&(a=r.offsetLeft,l=r.offsetTop)}const c=Vu(i);if(c<=0){const u=i.ownerDocument,d=u.body,f=getComputedStyle(d),h=u.compatMode==="CSS1Compat"&&parseFloat(f.marginLeft)+parseFloat(f.marginRight)||0,g=Math.abs(i.clientWidth-d.clientWidth-h);g<=zg&&(s-=g)}else c<=zg&&(s+=c);return{width:s,height:o,x:a,y:l}}function FE(t,e){const n=so(t,!0,e==="fixed"),i=n.top+t.clientTop,r=n.left+t.clientLeft,s=Kr(t)?jo(t):tr(1),o=t.clientWidth*s.x,a=t.clientHeight*s.y,l=r*s.x,c=i*s.y;return{width:o,height:a,x:l,y:c}}function Vg(t,e,n){let i;if(e==="viewport")i=OE(t,n);else if(e==="document")i=LE(lr(t));else if(Ni(e))i=FE(e,n);else{const r=by(t);i={x:e.x-r.x,y:e.y-r.y,width:e.width,height:e.height}}return iu(i)}function wy(t,e){const n=xs(t);return n===e||!Ni(n)||na(n)?!1:Li(n).position==="fixed"||wy(n,e)}function UE(t,e){const n=e.get(t);if(n)return n;let i=ll(t,[],!1).filter(a=>Ni(a)&&uo(a)!=="body"),r=null;const s=Li(t).position==="fixed";let o=s?xs(t):t;for(;Ni(o)&&!na(o);){const a=Li(o),l=Hp(o);!l&&a.position==="fixed"&&(r=null),(s?!l&&!r:!l&&a.position==="static"&&!!r&&(r.position==="absolute"||r.position==="fixed")||wl(o)&&!l&&wy(t,o))?i=i.filter(u=>u!==o):r=a,o=xs(o)}return e.set(t,i),i}function kE(t){let{element:e,boundary:n,rootBoundary:i,strategy:r}=t;const o=[...n==="clippingAncestors"?Bu(e)?[]:UE(e,this._c):[].concat(n),i],a=Vg(e,o[0],r);let l=a.top,c=a.right,u=a.bottom,d=a.left;for(let f=1;f{o(!1,1e-7)},1e3)}P===1&&!Ey(c,t.getBoundingClientRect())&&o(),x=!1}try{n=new IntersectionObserver(M,{...y,root:r.ownerDocument})}catch{n=new IntersectionObserver(M,y)}n.observe(t)}return o(!0),s}function qE(t,e,n,i){i===void 0&&(i={});const{ancestorScroll:r=!0,ancestorResize:s=!0,elementResize:o=typeof ResizeObserver=="function",layoutShift:a=typeof IntersectionObserver=="function",animationFrame:l=!1}=i,c=Wp(t),u=r||s?[...c?ll(c):[],...e?ll(e):[]]:[];u.forEach(p=>{r&&p.addEventListener("scroll",n,{passive:!0}),s&&p.addEventListener("resize",n)});const d=c&&a?WE(c,n):null;let f=-1,h=null;o&&(h=new ResizeObserver(p=>{let[_]=p;_&&_.target===c&&h&&e&&(h.unobserve(e),cancelAnimationFrame(f),f=requestAnimationFrame(()=>{var y;(y=h)==null||y.observe(e)})),n()}),c&&!l&&h.observe(c),e&&h.observe(e));let g,v=l?so(t):null;l&&m();function m(){const p=so(t);v&&!Ey(v,p)&&n(),v=p,g=requestAnimationFrame(m)}return n(),()=>{var p;u.forEach(_=>{r&&_.removeEventListener("scroll",n),s&&_.removeEventListener("resize",n)}),d?.(),(p=h)==null||p.disconnect(),h=null,l&&cancelAnimationFrame(g)}}const XE=SE,$E=wE,Gg=xE,jE=EE,YE=yE,JE=_E,KE=ME,ZE=(t,e,n)=>{const i=new Map,r={platform:GE,...n},s={...r.platform,_c:i};return vE(t,e,{...r,platform:s})};function QE(t){return t!=null&&typeof t=="object"&&"$el"in t}function dh(t){if(QE(t)){const e=t.$el;return Vp(e)&&uo(e)==="#comment"?null:e}return t}function Fo(t){return typeof t=="function"?t():E(t)}function eT(t){return{name:"arrow",options:t,fn(e){const n=dh(Fo(t.element));return n==null?{}:JE({element:n,padding:t.padding}).fn(e)}}}function Ty(t){return typeof window>"u"?1:(t.ownerDocument.defaultView||window).devicePixelRatio||1}function Wg(t,e){const n=Ty(t);return Math.round(e*n)/n}function tT(t,e,n){n===void 0&&(n={});const i=n.whileElementsMounted,r=Me(()=>{var P;return(P=Fo(n.open))!=null?P:!0}),s=Me(()=>Fo(n.middleware)),o=Me(()=>{var P;return(P=Fo(n.placement))!=null?P:"bottom"}),a=Me(()=>{var P;return(P=Fo(n.strategy))!=null?P:"absolute"}),l=Me(()=>{var P;return(P=Fo(n.transform))!=null?P:!0}),c=Me(()=>dh(t.value)),u=Me(()=>dh(e.value)),d=ke(0),f=ke(0),h=ke(a.value),g=ke(o.value),v=Cu({}),m=ke(!1),p=Me(()=>{const P={position:h.value,left:"0",top:"0"};if(!u.value)return P;const D=Wg(u.value,d.value),b=Wg(u.value,f.value);return l.value?{...P,transform:"translate("+D+"px, "+b+"px)",...Ty(u.value)>=1.5&&{willChange:"transform"}}:{position:h.value,left:D+"px",top:b+"px"}});let _;function y(){if(c.value==null||u.value==null)return;const P=r.value;ZE(c.value,u.value,{middleware:s.value,placement:o.value,strategy:a.value}).then(D=>{d.value=D.x,f.value=D.y,h.value=D.strategy,g.value=D.placement,v.value=D.middlewareData,m.value=P!==!1})}function x(){typeof _=="function"&&(_(),_=void 0)}function M(){if(x(),i===void 0){y();return}if(c.value!=null&&u.value!=null){_=i(c.value,u.value,y);return}}function A(){r.value||(m.value=!1)}return rn([s,o,a,r],y,{flush:"sync"}),rn([c,u],M,{flush:"sync"}),rn(r,A,{flush:"sync"}),xp()&&B_(x),{x:Hs(d),y:Hs(f),strategy:Hs(h),placement:Hs(g),middlewareData:Hs(v),isPositioned:Hs(m),floatingStyles:p,update:y}}const nT={side:"bottom",sideOffset:0,sideFlip:!0,align:"center",alignOffset:0,alignFlip:!0,arrowPadding:0,hideShiftedArrow:!0,avoidCollisions:!0,collisionBoundary:()=>[],collisionPadding:0,sticky:"partial",hideWhenDetached:!1,positionStrategy:"fixed",updatePositionStrategy:"optimized",prioritizePosition:!1},[eB,iT]=Jr("PopperContent");var rT=Ne({inheritAttrs:!1,__name:"PopperContent",props:Lw({side:{type:null,required:!1},sideOffset:{type:Number,required:!1},sideFlip:{type:Boolean,required:!1},align:{type:null,required:!1},alignOffset:{type:Number,required:!1},alignFlip:{type:Boolean,required:!1},avoidCollisions:{type:Boolean,required:!1},collisionBoundary:{type:null,required:!1},collisionPadding:{type:[Number,Object],required:!1},arrowPadding:{type:Number,required:!1},hideShiftedArrow:{type:Boolean,required:!1},sticky:{type:String,required:!1},hideWhenDetached:{type:Boolean,required:!1},positionStrategy:{type:String,required:!1},updatePositionStrategy:{type:String,required:!1},disableUpdateOnLayoutShift:{type:Boolean,required:!1},prioritizePosition:{type:Boolean,required:!1},reference:{type:null,required:!1},asChild:{type:Boolean,required:!1},as:{type:null,required:!1}},{...nT}),emits:["placed"],setup(t,{emit:e}){const n=t,i=e,r=py(),{forwardRef:s,currentElement:o}=sn(),a=ke(),l=ke(),{width:c,height:u}=oy(l),d=Me(()=>n.side+(n.align!=="center"?`-${n.align}`:"")),f=Me(()=>typeof n.collisionPadding=="number"?n.collisionPadding:{top:0,right:0,bottom:0,left:0,...n.collisionPadding}),h=Me(()=>Array.isArray(n.collisionBoundary)?n.collisionBoundary:[n.collisionBoundary]),g=Me(()=>({padding:f.value,boundary:h.value.filter(rE),altBoundary:h.value.length>0})),v=Me(()=>({mainAxis:n.sideFlip,crossAxis:n.alignFlip})),m=e1(()=>[XE({mainAxis:n.sideOffset+u.value,alignmentAxis:n.alignOffset}),n.prioritizePosition&&n.avoidCollisions&&Gg({...g.value,...v.value}),n.avoidCollisions&&$E({mainAxis:!0,crossAxis:!!n.prioritizePosition,limiter:n.sticky==="partial"?KE():void 0,...g.value}),!n.prioritizePosition&&n.avoidCollisions&&Gg({...g.value,...v.value}),jE({...g.value,apply:({elements:L,rects:V,availableWidth:$,availableHeight:X})=>{const{width:W,height:B}=V.reference,z=L.floating.style;z.setProperty("--reka-popper-available-width",`${$}px`),z.setProperty("--reka-popper-available-height",`${X}px`),z.setProperty("--reka-popper-anchor-width",`${W}px`),z.setProperty("--reka-popper-anchor-height",`${B}px`)}}),l.value&&eT({element:l.value,padding:n.arrowPadding}),sE({arrowWidth:c.value,arrowHeight:u.value}),n.hideWhenDetached&&YE({strategy:"referenceHidden",...g.value})]),p=Me(()=>n.reference??r.anchor.value),{floatingStyles:_,placement:y,isPositioned:x,middlewareData:M}=tT(p,a,{strategy:n.positionStrategy,placement:d,whileElementsMounted:(...L)=>qE(...L,{layoutShift:!n.disableUpdateOnLayoutShift,animationFrame:n.updatePositionStrategy==="always"}),middleware:m}),A=Me(()=>ah(y.value)[0]),P=Me(()=>ah(y.value)[1]);dx(()=>{x.value&&i("placed")});const D=Me(()=>{const L=M.value.arrow?.centerOffset!==0;return n.hideShiftedArrow&&L}),b=ke("");Wn(()=>{o.value&&(b.value=window.getComputedStyle(o.value).zIndex)});const w=Me(()=>M.value.arrow?.x??0),I=Me(()=>M.value.arrow?.y??0);return iT({placedSide:A,onArrowChange:L=>l.value=L,arrowX:w,arrowY:I,shouldHideArrow:D}),(L,V)=>(me(),Ct("div",{ref_key:"floatingRef",ref:a,"data-reka-popper-content-wrapper":"",style:$r({...E(_),transform:E(x)?E(_).transform:"translate(0, -200%)",minWidth:"max-content",zIndex:b.value,"--reka-popper-transform-origin":[E(M).transformOrigin?.x,E(M).transformOrigin?.y].join(" "),...E(M).hide?.referenceHidden&&{visibility:"hidden",pointerEvents:"none"}})},[ie(E(wn),It({ref:E(s)},L.$attrs,{"as-child":n.asChild,as:L.as,"data-side":A.value,"data-align":P.value,style:{animation:E(x)?void 0:"none"}}),{default:te(()=>[at(L.$slots,"default")]),_:3},16,["as-child","as","data-side","data-align","style"])],4))}}),Ay=rT;function sT(t=[],e,n){const i=[...t];return i[n]=e,i.sort((r,s)=>r-s)}function Cy(t,e,n){const s=100/(n-e)*(t-e);return Dp(s,0,100)}function oT(t,e){return e>2?`Value ${t+1} of ${e}`:e===2?["Minimum","Maximum"][t]:void 0}function aT(t,e){if(t.length===1)return 0;const n=t.map(r=>Math.abs(r-e)),i=Math.min(...n);return n.indexOf(i)}function lT(t,e,n){const i=t/2,s=qp([0,50],[0,i]);return(i-s(e)*n)*n}function cT(t){return t.slice(0,-1).map((e,n)=>t[n+1]-e)}function uT(t,e){if(e>0){const n=cT(t);return Math.min(...n)>=e}return!0}function qp(t,e){return n=>{if(t[0]===t[1]||e[0]===e[1])return e[0];const i=(e[1]-e[0])/(t[1]-t[0]);return e[0]+i*(n-t[0])}}function dT(t){return(String(t).split(".")[1]||"").length}function fT(t,e){const n=10**e;return Math.round(t*n)/n}const Py=["PageUp","PageDown"],Ry=["ArrowUp","ArrowDown","ArrowLeft","ArrowRight"],Dy={"from-left":["Home","PageDown","ArrowDown","ArrowLeft"],"from-right":["Home","PageDown","ArrowDown","ArrowRight"],"from-bottom":["Home","PageDown","ArrowDown","ArrowLeft"],"from-top":["Home","PageUp","ArrowUp","ArrowLeft"]},[Iy,Ny]=Jr(["SliderVertical","SliderHorizontal"]);var hT=Ne({__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(t,{emit:e}){const n=t,i=e,{max:r,min:s,dir:o,inverted:a}=zr(n),{forwardRef:l,currentElement:c}=sn(),u=pa(),d=ke(),f=ke(),h=Me(()=>o?.value!=="rtl"&&!a.value||o?.value!=="ltr"&&a.value);function g(_,y){const x=f.value||c.value.getBoundingClientRect(),M=[...u.thumbElements.value][u.valueIndexToChangeRef.value],A=u.thumbAlignment.value==="contain"?M.clientWidth:0;!d.value&&!y&&u.thumbAlignment.value==="contain"&&(d.value=_.clientX-M.getBoundingClientRect().left);const P=[0,x.width-A],D=h.value?[s.value,r.value]:[r.value,s.value],b=qp(P,D);f.value=x;const w=y?_.clientX-x.left-A/2:_.clientX-x.left-(d.value??0);return b(w)}const v=Me(()=>h.value?"left":"right"),m=Me(()=>h.value?"right":"left"),p=Me(()=>h.value?1:-1);return Ny({startEdge:v,endEdge:m,direction:p,size:"width"}),(_,y)=>(me(),Ie(Ly,{ref:E(l),dir:E(o),"data-orientation":"horizontal",style:$r({"--reka-slider-thumb-transform":!h.value&&E(u).thumbAlignment.value==="overflow"?"translateX(50%)":"translateX(-50%)"}),onSlideStart:y[0]||(y[0]=x=>{const M=g(x,!0);i("slideStart",M)}),onSlideMove:y[1]||(y[1]=x=>{const M=g(x);i("slideMove",M)}),onSlideEnd:y[2]||(y[2]=()=>{f.value=void 0,d.value=void 0,i("slideEnd")}),onStepKeyDown:y[3]||(y[3]=x=>{const M=h.value?"from-left":"from-right",A=E(Dy)[M].includes(x.key);i("stepKeyDown",x,A?-1:1)}),onEndKeyDown:y[4]||(y[4]=x=>i("endKeyDown",x)),onHomeKeyDown:y[5]||(y[5]=x=>i("homeKeyDown",x))},{default:te(()=>[at(_.$slots,"default")]),_:3},8,["dir","style"]))}}),pT=hT,mT=Ne({__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(t,{emit:e}){const n=t,i=e,{max:r,min:s,inverted:o}=zr(n),a=pa(),{forwardRef:l,currentElement:c}=sn(),u=ke(),d=ke(),f=Me(()=>!o.value);function h(p,_){const y=d.value||c.value.getBoundingClientRect(),x=[...a.thumbElements.value][a.valueIndexToChangeRef.value],M=a.thumbAlignment.value==="contain"?x.clientHeight:0;!u.value&&!_&&a.thumbAlignment.value==="contain"&&(u.value=p.clientY-x.getBoundingClientRect().top);const A=[0,y.height-M],P=f.value?[r.value,s.value]:[s.value,r.value],D=qp(A,P),b=_?p.clientY-y.top-M/2:p.clientY-y.top-(u.value??0);return d.value=y,D(b)}const g=Me(()=>f.value?"bottom":"top"),v=Me(()=>f.value?"top":"bottom"),m=Me(()=>f.value?1:-1);return Ny({startEdge:g,endEdge:v,direction:m,size:"height"}),(p,_)=>(me(),Ie(Ly,{ref:E(l),"data-orientation":"vertical",style:$r({"--reka-slider-thumb-transform":!f.value&&E(a).thumbAlignment.value==="overflow"?"translateY(-50%)":"translateY(50%)"}),onSlideStart:_[0]||(_[0]=y=>{const x=h(y,!0);i("slideStart",x)}),onSlideMove:_[1]||(_[1]=y=>{const x=h(y);i("slideMove",x)}),onSlideEnd:_[2]||(_[2]=()=>{d.value=void 0,u.value=void 0,i("slideEnd")}),onStepKeyDown:_[3]||(_[3]=y=>{const x=f.value?"from-bottom":"from-top",M=E(Dy)[x].includes(y.key);i("stepKeyDown",y,M?-1:1)}),onEndKeyDown:_[4]||(_[4]=y=>i("endKeyDown",y)),onHomeKeyDown:_[5]||(_[5]=y=>i("homeKeyDown",y))},{default:te(()=>[at(p.$slots,"default")]),_:3},8,["style"]))}}),gT=mT;const[pa,vT]=Jr("SliderRoot");var _T=Ne({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(t,{emit:e}){const n=t,i=e,{min:r,max:s,step:o,minStepsBetweenThumbs:a,orientation:l,disabled:c,thumbAlignment:u,dir:d}=zr(n),f=x1(d),{forwardRef:h,currentElement:g}=sn(),v=ry(g),{CollectionSlot:m}=Up({isProvider:!0}),p=Uu(n,"modelValue",i,{defaultValue:n.defaultValue,passive:n.modelValue===void 0}),_=Me(()=>Array.isArray(p.value)?[...p.value]:[]),y=ke(0),x=ke(_.value);function M(w){const I=aT(_.value,w);D(w,I)}function A(w){D(w,y.value)}function P(){const w=x.value[y.value];_.value[y.value]!==w&&i("valueCommit",St(_.value))}function D(w,I,{commit:L}={commit:!1}){const V=dT(o.value),$=fT(Math.round((w-r.value)/o.value)*o.value+r.value,V),X=Dp($,r.value,s.value),W=sT(_.value,X,I);if(uT(W,a.value*o.value)){y.value=W.indexOf(X);const B=String(W)!==String(p.value);B&&L&&i("valueCommit",W),B&&(b.value[y.value]?.focus(),p.value=W)}}const b=ke([]);return vT({modelValue:p,currentModelValue:_,valueIndexToChangeRef:y,thumbElements:b,orientation:l,min:r,max:s,disabled:c,thumbAlignment:u}),(w,I)=>(me(),Ie(E(m),null,{default:te(()=>[(me(),Ie(Ep(E(l)==="horizontal"?pT:gT),It(w.$attrs,{ref:E(h),"as-child":w.asChild,as:w.as,min:E(r),max:E(s),dir:E(f),inverted:w.inverted,"aria-disabled":E(c),"data-disabled":E(c)?"":void 0,onPointerdown:I[0]||(I[0]=()=>{E(c)||(x.value=_.value)}),onSlideStart:I[1]||(I[1]=L=>!E(c)&&M(L)),onSlideMove:I[2]||(I[2]=L=>!E(c)&&A(L)),onSlideEnd:I[3]||(I[3]=L=>!E(c)&&P()),onHomeKeyDown:I[4]||(I[4]=L=>!E(c)&&D(E(r),0,{commit:!0})),onEndKeyDown:I[5]||(I[5]=L=>!E(c)&&D(E(s),_.value.length-1,{commit:!0})),onStepKeyDown:I[6]||(I[6]=(L,V)=>{if(!E(c)){const W=E(Py).includes(L.key)||L.shiftKey&&E(Ry).includes(L.key)?10:1,B=y.value,z=_.value[B],de=E(o)*W*V;D(z+de,B,{commit:!0})}})}),{default:te(()=>[at(w.$slots,"default",{modelValue:E(p)}),E(v)&&w.name?(me(),Ie(E(hy),{key:0,type:"number",value:E(p),name:w.name,required:w.required,disabled:E(c),step:E(o)},null,8,["value","name","required","disabled","step"])):fi("v-if",!0)]),_:3},16,["as-child","as","min","max","dir","inverted","aria-disabled","data-disabled"]))]),_:3}))}}),xT=_T,yT=Ne({__name:"SliderImpl",props:{asChild:{type:Boolean,required:!1},as:{type:null,required:!1,default:"span"}},emits:["slideStart","slideMove","slideEnd","homeKeyDown","endKeyDown","stepKeyDown"],setup(t,{emit:e}){const n=t,i=e,r=pa();return(s,o)=>(me(),Ie(E(wn),It({"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()):E(Py).concat(E(Ry)).includes(a.key)&&(i("stepKeyDown",a),a.preventDefault())}),onPointerdown:o[1]||(o[1]=a=>{const l=a.target;l.setPointerCapture(a.pointerId),a.preventDefault(),E(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:te(()=>[at(s.$slots,"default")]),_:3},16))}}),Ly=yT,bT=Ne({__name:"SliderRange",props:{asChild:{type:Boolean,required:!1},as:{type:null,required:!1,default:"span"}},setup(t){const e=pa(),n=Iy();sn();const i=Me(()=>e.currentModelValue.value.map(o=>Cy(o,e.min.value,e.max.value))),r=Me(()=>e.currentModelValue.value.length>1?Math.min(...i.value):0),s=Me(()=>100-Math.max(...i.value,0));return(o,a)=>(me(),Ie(E(wn),{"data-disabled":E(e).disabled.value?"":void 0,"data-orientation":E(e).orientation.value,"as-child":o.asChild,as:o.as,style:$r({[E(n).startEdge.value]:`${r.value}%`,[E(n).endEdge.value]:`${s.value}%`})},{default:te(()=>[at(o.$slots,"default")]),_:3},8,["data-disabled","data-orientation","as-child","as","style"]))}}),ST=bT,wT=Ne({inheritAttrs:!1,__name:"SliderThumbImpl",props:{index:{type:Number,required:!0},asChild:{type:Boolean,required:!1},as:{type:null,required:!1}},setup(t){const e=t,n=pa(),i=Iy(),{forwardRef:r,currentElement:s}=sn(),{CollectionItem:o}=Up(),a=Me(()=>n.modelValue?.value?.[e.index]),l=Me(()=>a.value===void 0?0:Cy(a.value,n.min.value??0,n.max.value??100)),c=Me(()=>oT(e.index,n.modelValue?.value?.length??0)),u=oy(s),d=Me(()=>u[i.size].value),f=Me(()=>n.thumbAlignment.value==="overflow"||!d.value?0:lT(d.value,l.value,i.direction.value)),h=ty();return ti(()=>{n.thumbElements.value.push(s.value)}),fa(()=>{const g=n.thumbElements.value.findIndex(v=>v===s.value)??-1;n.thumbElements.value.splice(g,1)}),(g,v)=>(me(),Ie(E(o),null,{default:te(()=>[ie(E(wn),It(g.$attrs,{ref:E(r),role:"slider",tabindex:E(n).disabled.value?void 0:0,"aria-label":g.$attrs["aria-label"]||c.value,"data-disabled":E(n).disabled.value?"":void 0,"data-orientation":E(n).orientation.value,"aria-valuenow":a.value,"aria-valuemin":E(n).min.value,"aria-valuemax":E(n).max.value,"aria-orientation":E(n).orientation.value,"as-child":g.asChild,as:g.as,style:{transform:"var(--reka-slider-thumb-transform)",position:"absolute",[E(i).startEdge.value]:`calc(${l.value}% + ${f.value}px)`,display:!E(h)&&a.value===void 0?"none":void 0},onFocus:v[0]||(v[0]=()=>{E(n).valueIndexToChangeRef.value=g.index})}),{default:te(()=>[at(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}))}}),MT=wT,ET=Ne({__name:"SliderThumb",props:{asChild:{type:Boolean,required:!1},as:{type:null,required:!1,default:"span"}},setup(t){const e=t,{getItems:n}=Up(),{forwardRef:i,currentElement:r}=sn(),s=Me(()=>r.value?n(!0).findIndex(o=>o.ref===r.value):-1);return(o,a)=>(me(),Ie(MT,It({ref:E(i)},e,{index:s.value}),{default:te(()=>[at(o.$slots,"default")]),_:3},16,["index"]))}}),TT=ET,AT=Ne({__name:"SliderTrack",props:{asChild:{type:Boolean,required:!1},as:{type:null,required:!1,default:"span"}},setup(t){const e=pa();return sn(),(n,i)=>(me(),Ie(E(wn),{"as-child":n.asChild,as:n.as,"data-disabled":E(e).disabled.value?"":void 0,"data-orientation":E(e).orientation.value},{default:te(()=>[at(n.$slots,"default")]),_:3},8,["as-child","as","data-disabled","data-orientation"]))}}),CT=AT;const[Ml,PT]=Jr("PopoverRoot");var RT=Ne({__name:"PopoverRoot",props:{defaultOpen:{type:Boolean,required:!1,default:!1},open:{type:Boolean,required:!1,default:void 0},modal:{type:Boolean,required:!1,default:!1}},emits:["update:open"],setup(t,{emit:e}){const n=t,i=e,{modal:r}=zr(n),s=Uu(n,"open",i,{defaultValue:n.defaultOpen,passive:n.open===void 0});return PT({contentId:"",triggerId:"",modal:r,open:s,onOpenChange:l=>{s.value=l},onOpenToggle:()=>{s.value=!s.value},triggerElement:ke(),hasCustomAnchor:ke(!1)}),(l,c)=>(me(),Ie(E(my),null,{default:te(()=>[at(l.$slots,"default",{open:E(s),close:()=>s.value=!1})]),_:3}))}}),DT=RT,IT=Ne({__name:"PopoverContentImpl",props:{trapFocus:{type:Boolean,required:!1},side:{type:null,required:!1},sideOffset:{type:Number,required:!1},sideFlip:{type:Boolean,required:!1},align:{type:null,required:!1},alignOffset:{type:Number,required:!1},alignFlip:{type:Boolean,required:!1},avoidCollisions:{type:Boolean,required:!1},collisionBoundary:{type:null,required:!1},collisionPadding:{type:[Number,Object],required:!1},arrowPadding:{type:Number,required:!1},hideShiftedArrow:{type:Boolean,required:!1},sticky:{type:String,required:!1},hideWhenDetached:{type:Boolean,required:!1},positionStrategy:{type:String,required:!1},updatePositionStrategy:{type:String,required:!1},disableUpdateOnLayoutShift:{type:Boolean,required:!1},prioritizePosition:{type:Boolean,required:!1},reference:{type:null,required:!1},asChild:{type:Boolean,required:!1},as:{type:null,required:!1},disableOutsidePointerEvents:{type:Boolean,required:!1}},emits:["escapeKeyDown","pointerDownOutside","focusOutside","interactOutside","openAutoFocus","closeAutoFocus"],setup(t,{emit:e}){const n=t,i=e,r=Sl(co(n,"trapFocus","disableOutsidePointerEvents")),{forwardRef:s}=sn(),o=Ml();return b1(),(a,l)=>(me(),Ie(E(J1),{"as-child":"",loop:"",trapped:a.trapFocus,onMountAutoFocus:l[5]||(l[5]=c=>i("openAutoFocus",c)),onUnmountAutoFocus:l[6]||(l[6]=c=>i("closeAutoFocus",c))},{default:te(()=>[ie(E(cy),{"as-child":"","disable-outside-pointer-events":a.disableOutsidePointerEvents,onPointerDownOutside:l[0]||(l[0]=c=>i("pointerDownOutside",c)),onInteractOutside:l[1]||(l[1]=c=>i("interactOutside",c)),onEscapeKeyDown:l[2]||(l[2]=c=>i("escapeKeyDown",c)),onFocusOutside:l[3]||(l[3]=c=>i("focusOutside",c)),onDismiss:l[4]||(l[4]=c=>E(o).onOpenChange(!1))},{default:te(()=>[ie(E(Ay),It(E(r),{id:E(o).contentId,ref:E(s),"data-state":E(o).open.value?"open":"closed","aria-labelledby":E(o).triggerId,style:{"--reka-popover-content-transform-origin":"var(--reka-popper-transform-origin)","--reka-popover-content-available-width":"var(--reka-popper-available-width)","--reka-popover-content-available-height":"var(--reka-popper-available-height)","--reka-popover-trigger-width":"var(--reka-popper-anchor-width)","--reka-popover-trigger-height":"var(--reka-popper-anchor-height)"},role:"dialog"}),{default:te(()=>[at(a.$slots,"default")]),_:3},16,["id","data-state","aria-labelledby"])]),_:3},8,["disable-outside-pointer-events"])]),_:3},8,["trapped"]))}}),Oy=IT,NT=Ne({__name:"PopoverContentModal",props:{side:{type:null,required:!1},sideOffset:{type:Number,required:!1},sideFlip:{type:Boolean,required:!1},align:{type:null,required:!1},alignOffset:{type:Number,required:!1},alignFlip:{type:Boolean,required:!1},avoidCollisions:{type:Boolean,required:!1},collisionBoundary:{type:null,required:!1},collisionPadding:{type:[Number,Object],required:!1},arrowPadding:{type:Number,required:!1},hideShiftedArrow:{type:Boolean,required:!1},sticky:{type:String,required:!1},hideWhenDetached:{type:Boolean,required:!1},positionStrategy:{type:String,required:!1},updatePositionStrategy:{type:String,required:!1},disableUpdateOnLayoutShift:{type:Boolean,required:!1},prioritizePosition:{type:Boolean,required:!1},reference:{type:null,required:!1},asChild:{type:Boolean,required:!1},as:{type:null,required:!1},disableOutsidePointerEvents:{type:Boolean,required:!1}},emits:["escapeKeyDown","pointerDownOutside","focusOutside","interactOutside","openAutoFocus","closeAutoFocus"],setup(t,{emit:e}){const n=t,i=e,r=Ml(),s=ke(!1);v1(!0);const o=ar(n,i),{forwardRef:a,currentElement:l}=sn();return N1(l),(c,u)=>(me(),Ie(Oy,It(E(o),{ref:E(a),"trap-focus":E(r).open.value,"disable-outside-pointer-events":"",onCloseAutoFocus:u[0]||(u[0]=_i(d=>{i("closeAutoFocus",d),s.value||E(r).triggerElement.value?.focus()},["prevent"])),onPointerDownOutside:u[1]||(u[1]=d=>{i("pointerDownOutside",d);const f=d.detail.originalEvent,h=f.button===0&&f.ctrlKey===!0,g=f.button===2||h;s.value=g}),onFocusOutside:u[2]||(u[2]=_i(()=>{},["prevent"]))}),{default:te(()=>[at(c.$slots,"default")]),_:3},16,["trap-focus"]))}}),LT=NT,OT=Ne({__name:"PopoverContentNonModal",props:{side:{type:null,required:!1},sideOffset:{type:Number,required:!1},sideFlip:{type:Boolean,required:!1},align:{type:null,required:!1},alignOffset:{type:Number,required:!1},alignFlip:{type:Boolean,required:!1},avoidCollisions:{type:Boolean,required:!1},collisionBoundary:{type:null,required:!1},collisionPadding:{type:[Number,Object],required:!1},arrowPadding:{type:Number,required:!1},hideShiftedArrow:{type:Boolean,required:!1},sticky:{type:String,required:!1},hideWhenDetached:{type:Boolean,required:!1},positionStrategy:{type:String,required:!1},updatePositionStrategy:{type:String,required:!1},disableUpdateOnLayoutShift:{type:Boolean,required:!1},prioritizePosition:{type:Boolean,required:!1},reference:{type:null,required:!1},asChild:{type:Boolean,required:!1},as:{type:null,required:!1},disableOutsidePointerEvents:{type:Boolean,required:!1}},emits:["escapeKeyDown","pointerDownOutside","focusOutside","interactOutside","openAutoFocus","closeAutoFocus"],setup(t,{emit:e}){const n=t,i=e,r=Ml(),s=ke(!1),o=ke(!1),a=ar(n,i);return(l,c)=>(me(),Ie(Oy,It(E(a),{"trap-focus":!1,"disable-outside-pointer-events":!1,onCloseAutoFocus:c[0]||(c[0]=u=>{i("closeAutoFocus",u),u.defaultPrevented||(s.value||E(r).triggerElement.value?.focus(),u.preventDefault()),s.value=!1,o.value=!1}),onInteractOutside:c[1]||(c[1]=async u=>{i("interactOutside",u),u.defaultPrevented||(s.value=!0,u.detail.originalEvent.type==="pointerdown"&&(o.value=!0));const d=u.target;E(r).triggerElement.value?.contains(d)&&u.preventDefault(),u.detail.originalEvent.type==="focusin"&&o.value&&u.preventDefault()})}),{default:te(()=>[at(l.$slots,"default")]),_:3},16))}}),FT=OT,UT=Ne({__name:"PopoverContent",props:{forceMount:{type:Boolean,required:!1},side:{type:null,required:!1},sideOffset:{type:Number,required:!1},sideFlip:{type:Boolean,required:!1},align:{type:null,required:!1},alignOffset:{type:Number,required:!1},alignFlip:{type:Boolean,required:!1},avoidCollisions:{type:Boolean,required:!1},collisionBoundary:{type:null,required:!1},collisionPadding:{type:[Number,Object],required:!1},arrowPadding:{type:Number,required:!1},hideShiftedArrow:{type:Boolean,required:!1},sticky:{type:String,required:!1},hideWhenDetached:{type:Boolean,required:!1},positionStrategy:{type:String,required:!1},updatePositionStrategy:{type:String,required:!1},disableUpdateOnLayoutShift:{type:Boolean,required:!1},prioritizePosition:{type:Boolean,required:!1},reference:{type:null,required:!1},asChild:{type:Boolean,required:!1},as:{type:null,required:!1},disableOutsidePointerEvents:{type:Boolean,required:!1}},emits:["escapeKeyDown","pointerDownOutside","focusOutside","interactOutside","openAutoFocus","closeAutoFocus"],setup(t,{emit:e}){const n=t,i=e,r=Ml(),s=ar(n,i),{forwardRef:o}=sn();return r.contentId||=Fp(void 0,"reka-popover-content"),(a,l)=>(me(),Ie(E(ay),{present:a.forceMount||E(r).open.value},{default:te(()=>[E(r).modal.value?(me(),Ie(LT,It({key:0},E(s),{ref:E(o)}),{default:te(()=>[at(a.$slots,"default")]),_:3},16)):(me(),Ie(FT,It({key:1},E(s),{ref:E(o)}),{default:te(()=>[at(a.$slots,"default")]),_:3},16))]),_:3},8,["present"]))}}),kT=UT,BT=Ne({__name:"PopoverPortal",props:{to:{type:null,required:!1},disabled:{type:Boolean,required:!1},defer:{type:Boolean,required:!1},forceMount:{type:Boolean,required:!1}},setup(t){const e=t;return(n,i)=>(me(),Ie(E(dy),Ss(Yr(e)),{default:te(()=>[at(n.$slots,"default")]),_:3},16))}}),zT=BT,VT=Ne({__name:"PopoverTrigger",props:{asChild:{type:Boolean,required:!1},as:{type:null,required:!1,default:"button"}},setup(t){const e=t,n=Ml(),{forwardRef:i,currentElement:r}=sn();return n.triggerId||=Fp(void 0,"reka-popover-trigger"),ti(()=>{n.triggerElement.value=r.value}),(s,o)=>(me(),Ie(Ep(E(n).hasCustomAnchor.value?E(wn):E(gy)),{"as-child":""},{default:te(()=>[ie(E(wn),{id:E(n).triggerId,ref:E(i),type:s.as==="button"?"button":void 0,"aria-haspopup":"dialog","aria-expanded":E(n).open.value,"aria-controls":E(n).contentId,"data-state":E(n).open.value?"open":"closed",as:s.as,"as-child":e.asChild,onClick:E(n).onOpenToggle},{default:te(()=>[at(s.$slots,"default")]),_:3},8,["id","type","aria-expanded","aria-controls","data-state","as","as-child","onClick"])]),_:3}))}}),HT=VT;let $d=new Map,fh=!1;try{fh=new Intl.NumberFormat("de-DE",{signDisplay:"exceptZero"}).resolvedOptions().signDisplay==="exceptZero"}catch{}let ru=!1;try{ru=new Intl.NumberFormat("de-DE",{style:"unit",unit:"degree"}).resolvedOptions().style==="unit"}catch{}const Fy={degree:{narrow:{default:"°","ja-JP":" 度","zh-TW":"度","sl-SI":" °"}}};class Uy{format(e){let n="";if(!fh&&this.options.signDisplay!=null?n=WT(this.numberFormatter,this.options.signDisplay,e):n=this.numberFormatter.format(e),this.options.style==="unit"&&!ru){var i;let{unit:r,unitDisplay:s="short",locale:o}=this.resolvedOptions();if(!r)return n;let a=(i=Fy[r])===null||i===void 0?void 0:i[s];n+=a[o]||a.default}return n}formatToParts(e){return this.numberFormatter.formatToParts(e)}formatRange(e,n){if(typeof this.numberFormatter.formatRange=="function")return this.numberFormatter.formatRange(e,n);if(n= start date");return`${this.format(e)} – ${this.format(n)}`}formatRangeToParts(e,n){if(typeof this.numberFormatter.formatRangeToParts=="function")return this.numberFormatter.formatRangeToParts(e,n);if(n= start date");let i=this.numberFormatter.formatToParts(e),r=this.numberFormatter.formatToParts(n);return[...i.map(s=>({...s,source:"startRange"})),{type:"literal",value:" – ",source:"shared"},...r.map(s=>({...s,source:"endRange"}))]}resolvedOptions(){let e=this.numberFormatter.resolvedOptions();return!fh&&this.options.signDisplay!=null&&(e={...e,signDisplay:this.options.signDisplay}),!ru&&this.options.style==="unit"&&(e={...e,style:"unit",unit:this.options.unit,unitDisplay:this.options.unitDisplay}),e}constructor(e,n={}){this.numberFormatter=GT(e,n),this.options=n}}function GT(t,e={}){let{numberingSystem:n}=e;if(n&&t.includes("-nu-")&&(t.includes("-u-")||(t+="-u-"),t+=`-nu-${n}`),e.style==="unit"&&!ru){var i;let{unit:o,unitDisplay:a="short"}=e;if(!o)throw new Error('unit option must be provided with style: "unit"');if(!(!((i=Fy[o])===null||i===void 0)&&i[a]))throw new Error(`Unsupported unit ${o} with unitDisplay = ${a}`);e={...e,style:"decimal"}}let r=t+(e?Object.entries(e).sort((o,a)=>o[0]0||Object.is(n,0):e==="exceptZero"&&(Object.is(n,-0)||Object.is(n,0)?n=Math.abs(n):i=n>0),i){let r=t.format(-n),s=t.format(n),o=r.replace(s,"").replace(/\u200e|\u061C/,"");return[...o].length!==1&&console.warn("@react-aria/i18n polyfill for NumberFormat signDisplay: Unsupported case"),r.replace(s,"!!!").replace(o,"+").replace("!!!",s)}else return t.format(n)}}const qT=new RegExp("^.*\\(.*\\).*$"),XT=["latn","arab","hanidec","deva","beng","fullwide"];class ky{parse(e){return jd(this.locale,this.options,e).parse(e)}isValidPartialNumber(e,n,i){return jd(this.locale,this.options,e).isValidPartialNumber(e,n,i)}getNumberingSystem(e){return jd(this.locale,this.options,e).options.numberingSystem}constructor(e,n={}){this.locale=e,this.options=n}}const qg=new Map;function jd(t,e,n){let i=Xg(t,e);if(!t.includes("-nu-")&&!i.isValidPartialNumber(n)){for(let r of XT)if(r!==i.options.numberingSystem){let s=Xg(t+(t.includes("-u-")?"-nu-":"-u-nu-")+r,e);if(s.isValidPartialNumber(n))return s}}return i}function Xg(t,e){let n=t+(e?Object.entries(e).sort((r,s)=>r[0]-1&&(n=`-${n}`)}let i=n?+n:NaN;if(isNaN(i))return NaN;if(this.options.style==="percent"){var r,s;let o={...this.options,style:"decimal",minimumFractionDigits:Math.min(((r=this.options.minimumFractionDigits)!==null&&r!==void 0?r:0)+2,20),maximumFractionDigits:Math.min(((s=this.options.maximumFractionDigits)!==null&&s!==void 0?s:0)+2,20)};return new ky(this.locale,o).parse(new Uy(this.locale,o).format(i))}return this.options.currencySign==="accounting"&&qT.test(e)&&(i=-1*i),i}sanitize(e){return e=e.replace(this.symbols.literals,""),this.symbols.minusSign&&(e=e.replace("-",this.symbols.minusSign)),this.options.numberingSystem==="arab"&&(this.symbols.decimal&&(e=e.replace(",",this.symbols.decimal),e=e.replace("،",this.symbols.decimal)),this.symbols.group&&(e=xo(e,".",this.symbols.group))),this.symbols.group==="’"&&e.includes("'")&&(e=xo(e,"'",this.symbols.group)),this.options.locale==="fr-FR"&&this.symbols.group&&(e=xo(e," ",this.symbols.group),e=xo(e,/\u00A0/g,this.symbols.group)),e}isValidPartialNumber(e,n=-1/0,i=1/0){return e=this.sanitize(e),this.symbols.minusSign&&e.startsWith(this.symbols.minusSign)&&n<0?e=e.slice(this.symbols.minusSign.length):this.symbols.plusSign&&e.startsWith(this.symbols.plusSign)&&i>0&&(e=e.slice(this.symbols.plusSign.length)),this.symbols.group&&e.startsWith(this.symbols.group)||this.symbols.decimal&&e.indexOf(this.symbols.decimal)>-1&&this.options.maximumFractionDigits===0?!1:(this.symbols.group&&(e=xo(e,this.symbols.group,"")),e=e.replace(this.symbols.numeral,""),this.symbols.decimal&&(e=e.replace(this.symbols.decimal,"")),e.length===0)}constructor(e,n={}){this.locale=e,n.roundingIncrement!==1&&n.roundingIncrement!=null&&(n.maximumFractionDigits==null&&n.minimumFractionDigits==null?(n.maximumFractionDigits=0,n.minimumFractionDigits=0):n.maximumFractionDigits==null?n.maximumFractionDigits=n.minimumFractionDigits:n.minimumFractionDigits==null&&(n.minimumFractionDigits=n.maximumFractionDigits)),this.formatter=new Intl.NumberFormat(e,n),this.options=this.formatter.resolvedOptions(),this.symbols=YT(e,this.formatter,this.options,n);var i,r;this.options.style==="percent"&&(((i=this.options.minimumFractionDigits)!==null&&i!==void 0?i:0)>18||((r=this.options.maximumFractionDigits)!==null&&r!==void 0?r:0)>18)&&console.warn("NumberParser cannot handle percentages with greater than 18 decimal places, please reduce the number in your options.")}}const $g=new Set(["decimal","fraction","integer","minusSign","plusSign","group"]),jT=[0,4,2,1,11,20,3,7,100,21,.1,1.1];function YT(t,e,n,i){var r,s,o,a;let l=new Intl.NumberFormat(t,{...n,minimumSignificantDigits:1,maximumSignificantDigits:21,roundingIncrement:1,roundingPriority:"auto",roundingMode:"halfExpand"}),c=l.formatToParts(-10000.111),u=l.formatToParts(10000.111),d=jT.map(w=>l.formatToParts(w));var f;let h=(f=(r=c.find(w=>w.type==="minusSign"))===null||r===void 0?void 0:r.value)!==null&&f!==void 0?f:"-",g=(s=u.find(w=>w.type==="plusSign"))===null||s===void 0?void 0:s.value;!g&&(i?.signDisplay==="exceptZero"||i?.signDisplay==="always")&&(g="+");let m=(o=new Intl.NumberFormat(t,{...n,minimumFractionDigits:2,maximumFractionDigits:2}).formatToParts(.001).find(w=>w.type==="decimal"))===null||o===void 0?void 0:o.value,p=(a=c.find(w=>w.type==="group"))===null||a===void 0?void 0:a.value,_=c.filter(w=>!$g.has(w.type)).map(w=>jg(w.value)),y=d.flatMap(w=>w.filter(I=>!$g.has(I.type)).map(I=>jg(I.value))),x=[...new Set([..._,...y])].sort((w,I)=>I.length-w.length),M=x.length===0?new RegExp("[\\p{White_Space}]","gu"):new RegExp(`${x.join("|")}|[\\p{White_Space}]`,"gu"),A=[...new Intl.NumberFormat(n.locale,{useGrouping:!1}).format(9876543210)].reverse(),P=new Map(A.map((w,I)=>[w,I])),D=new RegExp(`[${A.join("")}]`,"g");return{minusSign:h,plusSign:g,decimal:m,group:p,literals:M,numeral:D,index:w=>String(P.get(w))}}function xo(t,e,n){return t.replaceAll?t.replaceAll(e,n):t.split(e).join(n)}function jg(t){return t.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function By(t){const{disabled:e}=t,n=ke(),i=Qx(),r=()=>window.clearTimeout(n.value),s=f=>{r(),!e.value&&(i.trigger(),n.value=window.setTimeout(()=>{s(60)},f))},o=()=>{s(400)},a=()=>{r()},l=ke(!1),c=Me(()=>ws(t.target)),u=f=>{f.button!==0||l.value||(f.preventDefault(),l.value=!0,o())},d=()=>{l.value=!1,a()};return Ui&&(no(c||window,"pointerdown",u),no(window,"pointerup",d),no(window,"pointercancel",d)),{isPressed:l,onTrigger:i.on}}function Yg(t,e=ke({})){return Ip(()=>new Uy(t.value,e.value))}function JT(t,e=ke({})){return Ip(()=>new ky(t.value,e.value))}function Jg(t,e,n){let i=t==="+"?e+n:e-n;if(e%1!==0||n%1!==0){const r=e.toString().split("."),s=n.toString().split("."),o=r[1]&&r[1].length||0,a=s[1]&&s[1].length||0,l=10**Math.max(o,a);e=Math.round(e*l),n=Math.round(n*l),i=t==="+"?e+n:e-n,i/=l}return i}const[Xp,KT]=Jr("NumberFieldRoot");var ZT=Ne({inheritAttrs:!1,__name:"NumberFieldRoot",props:{defaultValue:{type:Number,required:!1,default:void 0},modelValue:{type:[Number,null],required:!1},min:{type:Number,required:!1},max:{type:Number,required:!1},step:{type:Number,required:!1,default:1},stepSnapping:{type:Boolean,required:!1,default:!0},focusOnChange:{type:Boolean,required:!1,default:!0},formatOptions:{type:null,required:!1},locale:{type:String,required:!1},disabled:{type:Boolean,required:!1},readonly:{type:Boolean,required:!1},disableWheelChange:{type:Boolean,required:!1},invertWheelChange:{type:Boolean,required:!1},id:{type:String,required:!1},asChild:{type:Boolean,required:!1},as:{type:null,required:!1,default:"div"},name:{type:String,required:!1},required:{type:Boolean,required:!1}},emits:["update:modelValue"],setup(t,{emit:e}){const n=t,i=e,{disabled:r,readonly:s,disableWheelChange:o,invertWheelChange:a,min:l,max:c,step:u,stepSnapping:d,formatOptions:f,id:h,locale:g}=zr(n),v=Uu(n,"modelValue",i,{defaultValue:n.defaultValue,passive:n.modelValue===void 0}),{primitiveElement:m,currentElement:p}=ro(),_=L1(g),y=ry(p),x=ke(),M=Me(()=>!Nc(v.value)&&(z(v.value)===l.value||l.value&&!isNaN(v.value)?Jg("-",v.value,u.value)!Nc(v.value)&&(z(v.value)===c.value||c.value&&!isNaN(v.value)?Jg("+",v.value,u.value)>c.value:!1));function P(le,pe=1){if(n.focusOnChange&&x.value?.focus(),n.disabled||n.readonly)return;const He=L.parse(x.value?.value??"");isNaN(He)?v.value=l.value??0:le==="increase"?v.value=z(He+(u.value??1)*pe):v.value=z(He-(u.value??1)*pe)}function D(le=1){P("increase",le)}function b(le=1){P("decrease",le)}function w(le){le==="min"&&l.value!==void 0?v.value=z(l.value):le==="max"&&c.value!==void 0&&(v.value=z(c.value))}const I=Yg(_,f),L=JT(_,f),V=Me(()=>I.resolvedOptions().maximumFractionDigits>0?"decimal":"numeric"),$=Yg(_,f),X=Me(()=>Nc(v.value)||isNaN(v.value)?"":$.format(v.value));function W(le){return L.isValidPartialNumber(le,l.value,c.value)}function B(le){x.value&&(x.value.value=le)}function z(le){let pe;return u.value===void 0||isNaN(u.value)||!d.value?pe=Dp(le,l.value,c.value):pe=QM(le,l.value,c.value,u.value),pe=L.parse(I.format(pe)),pe}function de(le){const pe=L.parse(le);return v.value=isNaN(pe)?void 0:z(pe),le.length?(isNaN(pe),B(X.value)):B(le)}return KT({modelValue:v,handleDecrease:b,handleIncrease:D,handleMinMaxValue:w,inputMode:V,inputEl:x,onInputElement:le=>x.value=le,textValue:X,readonly:s,validate:W,applyInputValue:de,disabled:r,disableWheelChange:o,invertWheelChange:a,max:c,min:l,isDecreaseDisabled:M,isIncreaseDisabled:A,id:h}),(le,pe)=>(me(),Ie(E(wn),It(le.$attrs,{ref_key:"primitiveElement",ref:m,role:"group",as:le.as,"as-child":le.asChild,"data-disabled":E(r)?"":void 0,"data-readonly":E(s)?"":void 0}),{default:te(()=>[at(le.$slots,"default",{modelValue:E(v),textValue:X.value,readonly:E(s)}),E(y)&&le.name?(me(),Ie(E(hy),{key:0,type:"text",value:E(v),name:le.name,disabled:E(r),readonly:E(s),required:le.required},null,8,["value","name","disabled","readonly","required"])):fi("v-if",!0)]),_:3},16,["as","as-child","data-disabled","data-readonly"]))}}),QT=ZT,eA=Ne({__name:"NumberFieldDecrement",props:{disabled:{type:Boolean,required:!1},asChild:{type:Boolean,required:!1},as:{type:null,required:!1,default:"button"}},setup(t){const e=t,n=Xp(),i=Me(()=>n.disabled?.value||n.readonly.value||e.disabled||n.isDecreaseDisabled.value),{primitiveElement:r,currentElement:s}=ro(),{isPressed:o,onTrigger:a}=By({target:s,disabled:i});return a(()=>{n.handleDecrease()}),(l,c)=>(me(),Ie(E(wn),It(e,{ref_key:"primitiveElement",ref:r,tabindex:"-1","aria-label":"Decrease",type:l.as==="button"?"button":void 0,style:{userSelect:E(o)?"none":void 0},disabled:i.value?"":void 0,"data-disabled":i.value?"":void 0,"data-pressed":E(o)?"true":void 0,onContextmenu:c[0]||(c[0]=_i(()=>{},["prevent"]))}),{default:te(()=>[at(l.$slots,"default")]),_:3},16,["type","style","disabled","data-disabled","data-pressed"]))}}),tA=eA,nA=Ne({__name:"NumberFieldIncrement",props:{disabled:{type:Boolean,required:!1},asChild:{type:Boolean,required:!1},as:{type:null,required:!1,default:"button"}},setup(t){const e=t,n=Xp(),i=Me(()=>n.disabled?.value||n.readonly.value||e.disabled||n.isIncreaseDisabled.value),{primitiveElement:r,currentElement:s}=ro(),{isPressed:o,onTrigger:a}=By({target:s,disabled:i});return a(()=>{n.handleIncrease()}),(l,c)=>(me(),Ie(E(wn),It(e,{ref_key:"primitiveElement",ref:r,tabindex:"-1","aria-label":"Increase",type:l.as==="button"?"button":void 0,style:{userSelect:E(o)?"none":void 0},disabled:i.value?"":void 0,"data-disabled":i.value?"":void 0,"data-pressed":E(o)?"true":void 0,onContextmenu:c[0]||(c[0]=_i(()=>{},["prevent"]))}),{default:te(()=>[at(l.$slots,"default")]),_:3},16,["type","style","disabled","data-disabled","data-pressed"]))}}),iA=nA,rA=Ne({__name:"NumberFieldInput",props:{asChild:{type:Boolean,required:!1},as:{type:null,required:!1,default:"input"}},setup(t){const e=t,{primitiveElement:n,currentElement:i}=ro(),r=Xp();function s(l){r.disableWheelChange.value||l.target===to()&&(Math.abs(l.deltaY)<=Math.abs(l.deltaX)||(l.preventDefault(),l.deltaY>0?r.invertWheelChange.value?r.handleDecrease():r.handleIncrease():l.deltaY<0&&(r.invertWheelChange.value?r.handleIncrease():r.handleDecrease())))}ti(()=>{r.onInputElement(i.value)});const o=ke(r.textValue.value);rn(()=>r.textValue.value,()=>{o.value=r.textValue.value},{immediate:!0,deep:!0});function a(){requestAnimationFrame(()=>{o.value=r.textValue.value})}return(l,c)=>(me(),Ie(E(wn),It(e,{id:E(r).id.value,ref_key:"primitiveElement",ref:n,value:o.value,role:"spinbutton",type:"text",tabindex:"0",inputmode:E(r).inputMode.value,disabled:E(r).disabled.value?"":void 0,"data-disabled":E(r).disabled.value?"":void 0,readonly:E(r).readonly.value?"":void 0,"data-readonly":E(r).readonly.value?"":void 0,autocomplete:"off",autocorrect:"off",spellcheck:"false","aria-roledescription":"Number field","aria-valuenow":E(r).modelValue.value,"aria-valuemin":E(r).min.value,"aria-valuemax":E(r).max.value,onKeydown:[c[0]||(c[0]=Is(_i(u=>E(r).handleIncrease(),["prevent"]),["up"])),c[1]||(c[1]=Is(_i(u=>E(r).handleDecrease(),["prevent"]),["down"])),c[2]||(c[2]=Is(_i(u=>E(r).handleIncrease(10),["prevent"]),["page-up"])),c[3]||(c[3]=Is(_i(u=>E(r).handleDecrease(10),["prevent"]),["page-down"])),c[4]||(c[4]=Is(_i(u=>E(r).handleMinMaxValue("min"),["prevent"]),["home"])),c[5]||(c[5]=Is(_i(u=>E(r).handleMinMaxValue("max"),["prevent"]),["end"])),c[8]||(c[8]=Is(u=>E(r).applyInputValue(u.target?.value),["enter"]))],onWheel:s,onBeforeinput:c[6]||(c[6]=u=>{const d=u.target;let f=d.value.slice(0,d.selectionStart??void 0)+(u.data??"")+d.value.slice(d.selectionEnd??void 0);E(r).validate(f)||u.preventDefault()}),onInput:c[7]||(c[7]=u=>{const d=u.target;o.value=d.value}),onChange:a,onBlur:c[9]||(c[9]=u=>E(r).applyInputValue(u.target?.value))}),{default:te(()=>[at(l.$slots,"default")]),_:3},16,["id","value","inputmode","disabled","data-disabled","readonly","data-readonly","aria-valuenow","aria-valuemin","aria-valuemax"]))}}),sA=rA;const[Hu,oA]=Jr("TooltipProvider");var aA=Ne({inheritAttrs:!1,__name:"TooltipProvider",props:{delayDuration:{type:Number,required:!1,default:700},skipDelayDuration:{type:Number,required:!1,default:300},disableHoverableContent:{type:Boolean,required:!1,default:!1},disableClosingTrigger:{type:Boolean,required:!1},disabled:{type:Boolean,required:!1},ignoreNonKeyboardFocus:{type:Boolean,required:!1,default:!1},content:{type:Object,required:!1}},setup(t){const e=t,{delayDuration:n,skipDelayDuration:i,disableHoverableContent:r,disableClosingTrigger:s,ignoreNonKeyboardFocus:o,disabled:a,content:l}=zr(e);sn();const c=ke(!0),u=ke(!1),{start:d,stop:f}=ey(()=>{c.value=!0},i,{immediate:!1});return oA({isOpenDelayed:c,delayDuration:n,onOpen(){f(),c.value=!1},onClose(){d()},isPointerInTransitRef:u,disableHoverableContent:r,disableClosingTrigger:s,disabled:a,ignoreNonKeyboardFocus:o,content:l}),(h,g)=>at(h.$slots,"default")}}),lA=aA;const zy="tooltip.open",[Gu,cA]=Jr("TooltipRoot");var uA=Ne({__name:"TooltipRoot",props:{defaultOpen:{type:Boolean,required:!1,default:!1},open:{type:Boolean,required:!1,default:void 0},delayDuration:{type:Number,required:!1,default:void 0},disableHoverableContent:{type:Boolean,required:!1,default:void 0},disableClosingTrigger:{type:Boolean,required:!1,default:void 0},disabled:{type:Boolean,required:!1,default:void 0},ignoreNonKeyboardFocus:{type:Boolean,required:!1,default:void 0}},emits:["update:open"],setup(t,{emit:e}){const n=t,i=e;sn();const r=Hu(),s=Me(()=>n.disableHoverableContent??r.disableHoverableContent.value),o=Me(()=>n.disableClosingTrigger??r.disableClosingTrigger.value),a=Me(()=>n.disabled??r.disabled.value),l=Me(()=>n.delayDuration??r.delayDuration.value),c=Me(()=>n.ignoreNonKeyboardFocus??r.ignoreNonKeyboardFocus.value),u=Uu(n,"open",i,{defaultValue:n.defaultOpen,passive:n.open===void 0});rn(u,y=>{r.onClose&&(y?(r.onOpen(),document.dispatchEvent(new CustomEvent(zy))):r.onClose())});const d=ke(!1),f=ke(),h=Me(()=>u.value?d.value?"delayed-open":"instant-open":"closed"),{start:g,stop:v}=ey(()=>{d.value=!0,u.value=!0},l,{immediate:!1});function m(){v(),d.value=!1,u.value=!0}function p(){v(),u.value=!1}function _(){g()}return cA({contentId:"",open:u,stateAttribute:h,trigger:f,onTriggerChange(y){f.value=y},onTriggerEnter(){r.isOpenDelayed.value?_():m()},onTriggerLeave(){s.value?p():v()},onOpen:m,onClose:p,disableHoverableContent:s,disableClosingTrigger:o,disabled:a,ignoreNonKeyboardFocus:c}),(y,x)=>(me(),Ie(E(my),null,{default:te(()=>[at(y.$slots,"default",{open:E(u)})]),_:3}))}}),dA=uA,fA=Ne({__name:"TooltipContentImpl",props:{ariaLabel:{type:String,required:!1},asChild:{type:Boolean,required:!1,default:void 0},as:{type:null,required:!1},side:{type:null,required:!1},sideOffset:{type:Number,required:!1},align:{type:null,required:!1},alignOffset:{type:Number,required:!1},avoidCollisions:{type:Boolean,required:!1,default:void 0},collisionBoundary:{type:null,required:!1},collisionPadding:{type:[Number,Object],required:!1},arrowPadding:{type:Number,required:!1},sticky:{type:String,required:!1},hideWhenDetached:{type:Boolean,required:!1,default:void 0},positionStrategy:{type:String,required:!1},updatePositionStrategy:{type:String,required:!1}},emits:["escapeKeyDown","pointerDownOutside"],setup(t,{emit:e}){const n=t,i=e,r=Gu(),s=Hu(),{forwardRef:o,currentElement:a}=sn(),l=Me(()=>n.ariaLabel||a.value?.textContent),c=Me(()=>{const{ariaLabel:u,...d}=n;return ny(d,s.content.value??{},{side:"top",sideOffset:0,align:"center",avoidCollisions:!0,collisionBoundary:[],collisionPadding:0,arrowPadding:0,sticky:"partial",hideWhenDetached:!1})});return ti(()=>{no(window,"scroll",u=>{u.target?.contains(r.trigger.value)&&r.onClose()},{capture:!0}),no(window,zy,r.onClose)}),(u,d)=>(me(),Ie(E(cy),{"as-child":"","disable-outside-pointer-events":!1,onEscapeKeyDown:d[0]||(d[0]=f=>i("escapeKeyDown",f)),onPointerDownOutside:d[1]||(d[1]=f=>{E(r).disableClosingTrigger.value&&E(r).trigger.value?.contains(f.target)&&f.preventDefault(),i("pointerDownOutside",f)}),onFocusOutside:d[2]||(d[2]=_i(()=>{},["prevent"])),onDismiss:d[3]||(d[3]=f=>E(r).onClose())},{default:te(()=>[ie(E(Ay),It({ref:E(o),"data-state":E(r).stateAttribute.value},{...u.$attrs,...c.value},{style:{"--reka-tooltip-content-transform-origin":"var(--reka-popper-transform-origin)","--reka-tooltip-content-available-width":"var(--reka-popper-available-width)","--reka-tooltip-content-available-height":"var(--reka-popper-available-height)","--reka-tooltip-trigger-width":"var(--reka-popper-anchor-width)","--reka-tooltip-trigger-height":"var(--reka-popper-anchor-height)"}}),{default:te(()=>[at(u.$slots,"default"),ie(E(fy),{id:E(r).contentId,role:"tooltip"},{default:te(()=>[zt(Ci(l.value),1)]),_:1},8,["id"])]),_:3},16,["data-state"])]),_:3}))}}),Vy=fA,hA=Ne({__name:"TooltipContentHoverable",props:{ariaLabel:{type:String,required:!1},asChild:{type:Boolean,required:!1},as:{type:null,required:!1},side:{type:null,required:!1},sideOffset:{type:Number,required:!1},align:{type:null,required:!1},alignOffset:{type:Number,required:!1},avoidCollisions:{type:Boolean,required:!1},collisionBoundary:{type:null,required:!1},collisionPadding:{type:[Number,Object],required:!1},arrowPadding:{type:Number,required:!1},sticky:{type:String,required:!1},hideWhenDetached:{type:Boolean,required:!1},positionStrategy:{type:String,required:!1},updatePositionStrategy:{type:String,required:!1}},setup(t){const n=Sl(t),{forwardRef:i,currentElement:r}=sn(),{trigger:s,onClose:o}=Gu(),a=Hu(),{isPointerInTransit:l,onPointerExit:c}=S1(s,r);return a.isPointerInTransitRef=l,c(()=>{o()}),(u,d)=>(me(),Ie(Vy,It({ref:E(i)},E(n)),{default:te(()=>[at(u.$slots,"default")]),_:3},16))}}),pA=hA,mA=Ne({__name:"TooltipContent",props:{forceMount:{type:Boolean,required:!1},ariaLabel:{type:String,required:!1},asChild:{type:Boolean,required:!1},as:{type:null,required:!1},side:{type:null,required:!1},sideOffset:{type:Number,required:!1},align:{type:null,required:!1},alignOffset:{type:Number,required:!1},avoidCollisions:{type:Boolean,required:!1},collisionBoundary:{type:null,required:!1},collisionPadding:{type:[Number,Object],required:!1},arrowPadding:{type:Number,required:!1},sticky:{type:String,required:!1},hideWhenDetached:{type:Boolean,required:!1},positionStrategy:{type:String,required:!1},updatePositionStrategy:{type:String,required:!1}},emits:["escapeKeyDown","pointerDownOutside"],setup(t,{emit:e}){const n=t,i=e,r=Gu(),s=ar(n,i),{forwardRef:o}=sn();return(a,l)=>(me(),Ie(E(ay),{present:a.forceMount||E(r).open.value},{default:te(()=>[(me(),Ie(Ep(E(r).disableHoverableContent.value?Vy:pA),It({ref:E(o)},E(s)),{default:te(()=>[at(a.$slots,"default")]),_:3},16))]),_:3},8,["present"]))}}),gA=mA,vA=Ne({__name:"TooltipPortal",props:{to:{type:null,required:!1},disabled:{type:Boolean,required:!1},defer:{type:Boolean,required:!1},forceMount:{type:Boolean,required:!1}},setup(t){const e=t;return(n,i)=>(me(),Ie(E(dy),Ss(Yr(e)),{default:te(()=>[at(n.$slots,"default")]),_:3},16))}}),_A=vA,xA=Ne({__name:"TooltipTrigger",props:{reference:{type:null,required:!1},asChild:{type:Boolean,required:!1},as:{type:null,required:!1,default:"button"}},setup(t){const e=t,n=Gu(),i=Hu();n.contentId||=Fp(void 0,"reka-tooltip-content");const{forwardRef:r,currentElement:s}=sn(),o=ke(!1),a=ke(!1),l=Me(()=>n.disabled.value?{}:{click:v,focus:h,pointermove:d,pointerleave:f,pointerdown:u,blur:g});ti(()=>{n.onTriggerChange(s.value)});function c(){setTimeout(()=>{o.value=!1},1)}function u(){n.open&&!n.disableClosingTrigger.value&&n.onClose(),o.value=!0,document.addEventListener("pointerup",c,{once:!0})}function d(m){m.pointerType!=="touch"&&!a.value&&!i.isPointerInTransitRef.value&&(n.onTriggerEnter(),a.value=!0)}function f(){n.onTriggerLeave(),a.value=!1}function h(m){o.value||n.ignoreNonKeyboardFocus.value&&!m.target.matches?.(":focus-visible")||n.onOpen()}function g(){n.onClose()}function v(){n.disableClosingTrigger.value||n.onClose()}return(m,p)=>(me(),Ie(E(gy),{"as-child":"",reference:m.reference},{default:te(()=>[ie(E(wn),It({ref:E(r),"aria-describedby":E(n).open.value?E(n).contentId:void 0,"data-state":E(n).stateAttribute.value,as:m.as,"as-child":e.asChild,"data-grace-area-trigger":""},Iw(l.value)),{default:te(()=>[at(m.$slots,"default")]),_:3},16,["aria-describedby","data-state","as","as-child"])]),_:3},8,["reference"]))}}),yA=xA;const bA=(t,e)=>{const n=new Array(t.length+e.length);for(let i=0;i({classGroupId:t,validator:e}),Hy=(t=new Map,e=null,n)=>({nextPart:t,validators:e,classGroupId:n}),su="-",Kg=[],wA="arbitrary..",MA=t=>{const e=TA(t),{conflictingClassGroups:n,conflictingClassGroupModifiers:i}=t;return{getClassGroupId:o=>{if(o.startsWith("[")&&o.endsWith("]"))return EA(o);const a=o.split(su),l=a[0]===""&&a.length>1?1:0;return Gy(a,l,e)},getConflictingClassGroupIds:(o,a)=>{if(a){const l=i[o],c=n[o];return l?c?bA(c,l):l:c||Kg}return n[o]||Kg}}},Gy=(t,e,n)=>{if(t.length-e===0)return n.classGroupId;const r=t[e],s=n.nextPart.get(r);if(s){const c=Gy(t,e+1,s);if(c)return c}const o=n.validators;if(o===null)return;const a=e===0?t.join(su):t.slice(e).join(su),l=o.length;for(let c=0;ct.slice(1,-1).indexOf(":")===-1?void 0:(()=>{const e=t.slice(1,-1),n=e.indexOf(":"),i=e.slice(0,n);return i?wA+i:void 0})(),TA=t=>{const{theme:e,classGroups:n}=t;return AA(n,e)},AA=(t,e)=>{const n=Hy();for(const i in t){const r=t[i];$p(r,n,i,e)}return n},$p=(t,e,n,i)=>{const r=t.length;for(let s=0;s{if(typeof t=="string"){PA(t,e,n);return}if(typeof t=="function"){RA(t,e,n,i);return}DA(t,e,n,i)},PA=(t,e,n)=>{const i=t===""?e:Wy(e,t);i.classGroupId=n},RA=(t,e,n,i)=>{if(IA(t)){$p(t(i),e,n,i);return}e.validators===null&&(e.validators=[]),e.validators.push(SA(n,t))},DA=(t,e,n,i)=>{const r=Object.entries(t),s=r.length;for(let o=0;o{let n=t;const i=e.split(su),r=i.length;for(let s=0;s"isThemeGetter"in t&&t.isThemeGetter===!0,NA=t=>{if(t<1)return{get:()=>{},set:()=>{}};let e=0,n=Object.create(null),i=Object.create(null);const r=(s,o)=>{n[s]=o,e++,e>t&&(e=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)}}},hh="!",Zg=":",LA=[],Qg=(t,e,n,i,r)=>({modifiers:t,hasImportantModifier:e,baseClassName:n,maybePostfixModifierPosition:i,isExternal:r}),OA=t=>{const{prefix:e,experimentalParseClassName:n}=t;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 Qg(s,h,f,g)};if(e){const r=e+Zg,s=i;i=o=>o.startsWith(r)?s(o.slice(r.length)):Qg(LA,!1,o,void 0,!0)}if(n){const r=i;i=s=>n({className:s,parseClassName:r})}return i},FA=t=>{const e=new Map;return t.orderSensitiveModifiers.forEach((n,i)=>{e.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}},UA=t=>({cache:NA(t.cacheSize),parseClassName:OA(t),sortModifiers:FA(t),...MA(t)}),kA=/\s+/,BA=(t,e)=>{const{parseClassName:n,getClassGroupId:i,getConflictingClassGroupIds:r,sortModifiers:s}=e,o=[],a=t.trim().split(kA);let l="";for(let c=a.length-1;c>=0;c-=1){const u=a[c],{isExternal:d,modifiers:f,hasImportantModifier:h,baseClassName:g,maybePostfixModifierPosition:v}=n(u);if(d){l=u+(l.length>0?" "+l:l);continue}let m=!!v,p=i(m?g.substring(0,v):g);if(!p){if(!m){l=u+(l.length>0?" "+l:l);continue}if(p=i(g),!p){l=u+(l.length>0?" "+l:l);continue}m=!1}const _=f.length===0?"":f.length===1?f[0]:s(f).join(":"),y=h?_+hh:_,x=y+p;if(o.indexOf(x)>-1)continue;o.push(x);const M=r(p,m);for(let A=0;A0?" "+l:l)}return l},zA=(...t)=>{let e=0,n,i,r="";for(;e{if(typeof t=="string")return t;let e,n="";for(let i=0;i{let n,i,r,s;const o=l=>{const c=e.reduce((u,d)=>d(u),t());return n=UA(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=BA(l,n);return r(l,u),u};return s=o,(...l)=>s(zA(...l))},HA=[],cn=t=>{const e=n=>n[t]||HA;return e.isThemeGetter=!0,e},Xy=/^\[(?:(\w[\w-]*):)?(.+)\]$/i,$y=/^\((?:(\w[\w-]*):)?(.+)\)$/i,GA=/^\d+\/\d+$/,WA=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,qA=/\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$/,XA=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix)\(.+\)$/,$A=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,jA=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,yo=t=>GA.test(t),gt=t=>!!t&&!Number.isNaN(Number(t)),es=t=>!!t&&Number.isInteger(Number(t)),Yd=t=>t.endsWith("%")&>(t.slice(0,-1)),mr=t=>WA.test(t),YA=()=>!0,JA=t=>qA.test(t)&&!XA.test(t),jy=()=>!1,KA=t=>$A.test(t),ZA=t=>jA.test(t),QA=t=>!We(t)&&!qe(t),eC=t=>ma(t,Ky,jy),We=t=>Xy.test(t),Ls=t=>ma(t,Zy,JA),Jd=t=>ma(t,sC,gt),e0=t=>ma(t,Yy,jy),tC=t=>ma(t,Jy,ZA),Hl=t=>ma(t,Qy,KA),qe=t=>$y.test(t),Sa=t=>ga(t,Zy),nC=t=>ga(t,oC),t0=t=>ga(t,Yy),iC=t=>ga(t,Ky),rC=t=>ga(t,Jy),Gl=t=>ga(t,Qy,!0),ma=(t,e,n)=>{const i=Xy.exec(t);return i?i[1]?e(i[1]):n(i[2]):!1},ga=(t,e,n=!1)=>{const i=$y.exec(t);return i?i[1]?e(i[1]):n:!1},Yy=t=>t==="position"||t==="percentage",Jy=t=>t==="image"||t==="url",Ky=t=>t==="length"||t==="size"||t==="bg-size",Zy=t=>t==="length",sC=t=>t==="number",oC=t=>t==="family-name",Qy=t=>t==="shadow",aC=()=>{const t=cn("color"),e=cn("font"),n=cn("text"),i=cn("font-weight"),r=cn("tracking"),s=cn("leading"),o=cn("breakpoint"),a=cn("container"),l=cn("spacing"),c=cn("radius"),u=cn("shadow"),d=cn("inset-shadow"),f=cn("text-shadow"),h=cn("drop-shadow"),g=cn("blur"),v=cn("perspective"),m=cn("aspect"),p=cn("ease"),_=cn("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"],M=()=>[...x(),qe,We],A=()=>["auto","hidden","clip","visible","scroll"],P=()=>["auto","contain","none"],D=()=>[qe,We,l],b=()=>[yo,"full","auto",...D()],w=()=>[es,"none","subgrid",qe,We],I=()=>["auto",{span:["full",es,qe,We]},es,qe,We],L=()=>[es,"auto",qe,We],V=()=>["auto","min","max","fr",qe,We],$=()=>["start","end","center","between","around","evenly","stretch","baseline","center-safe","end-safe"],X=()=>["start","end","center","stretch","center-safe","end-safe"],W=()=>["auto",...D()],B=()=>[yo,"auto","full","dvw","dvh","lvw","lvh","svw","svh","min","max","fit",...D()],z=()=>[t,qe,We],de=()=>[...x(),t0,e0,{position:[qe,We]}],le=()=>["no-repeat",{repeat:["","x","y","space","round"]}],pe=()=>["auto","cover","contain",iC,eC,{size:[qe,We]}],He=()=>[Yd,Sa,Ls],ze=()=>["","none","full",c,qe,We],st=()=>["",gt,Sa,Ls],xt=()=>["solid","dashed","dotted","double"],ce=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],ue=()=>[gt,Yd,t0,e0],Le=()=>["","none",g,qe,We],je=()=>["none",gt,qe,We],Ae=()=>["none",gt,qe,We],mt=()=>[gt,qe,We],O=()=>[yo,"full",...D()];return{cacheSize:500,theme:{animate:["spin","ping","pulse","bounce"],aspect:["video"],blur:[mr],breakpoint:[mr],color:[YA],container:[mr],"drop-shadow":[mr],ease:["in","out","in-out"],font:[QA],"font-weight":["thin","extralight","light","normal","medium","semibold","bold","extrabold","black"],"inset-shadow":[mr],leading:["none","tight","snug","normal","relaxed","loose"],perspective:["dramatic","near","normal","midrange","distant","none"],radius:[mr],shadow:[mr],spacing:["px",gt],text:[mr],"text-shadow":[mr],tracking:["tighter","tight","normal","wide","wider","widest"]},classGroups:{aspect:[{aspect:["auto","square",yo,We,qe,m]}],container:["container"],columns:[{columns:[gt,We,qe,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:M()}],overflow:[{overflow:A()}],"overflow-x":[{"overflow-x":A()}],"overflow-y":[{"overflow-y":A()}],overscroll:[{overscroll:P()}],"overscroll-x":[{"overscroll-x":P()}],"overscroll-y":[{"overscroll-y":P()}],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:[es,"auto",qe,We]}],basis:[{basis:[yo,"full","auto",a,...D()]}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["nowrap","wrap","wrap-reverse"]}],flex:[{flex:[gt,yo,"auto","initial","none",We]}],grow:[{grow:["",gt,qe,We]}],shrink:[{shrink:["",gt,qe,We]}],order:[{order:[es,"first","last","none",qe,We]}],"grid-cols":[{"grid-cols":w()}],"col-start-end":[{col:I()}],"col-start":[{"col-start":L()}],"col-end":[{"col-end":L()}],"grid-rows":[{"grid-rows":w()}],"row-start-end":[{row:I()}],"row-start":[{"row-start":L()}],"row-end":[{"row-end":L()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":V()}],"auto-rows":[{"auto-rows":V()}],gap:[{gap:D()}],"gap-x":[{"gap-x":D()}],"gap-y":[{"gap-y":D()}],"justify-content":[{justify:[...$(),"normal"]}],"justify-items":[{"justify-items":[...X(),"normal"]}],"justify-self":[{"justify-self":["auto",...X()]}],"align-content":[{content:["normal",...$()]}],"align-items":[{items:[...X(),{baseline:["","last"]}]}],"align-self":[{self:["auto",...X(),{baseline:["","last"]}]}],"place-content":[{"place-content":$()}],"place-items":[{"place-items":[...X(),"baseline"]}],"place-self":[{"place-self":["auto",...X()]}],p:[{p:D()}],px:[{px:D()}],py:[{py:D()}],ps:[{ps:D()}],pe:[{pe:D()}],pt:[{pt:D()}],pr:[{pr:D()}],pb:[{pb:D()}],pl:[{pl:D()}],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":D()}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":D()}],"space-y-reverse":["space-y-reverse"],size:[{size:B()}],w:[{w:[a,"screen",...B()]}],"min-w":[{"min-w":[a,"screen","none",...B()]}],"max-w":[{"max-w":[a,"screen","none","prose",{screen:[o]},...B()]}],h:[{h:["screen","lh",...B()]}],"min-h":[{"min-h":["screen","lh","none",...B()]}],"max-h":[{"max-h":["screen","lh",...B()]}],"font-size":[{text:["base",n,Sa,Ls]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:[i,qe,Jd]}],"font-stretch":[{"font-stretch":["ultra-condensed","extra-condensed","condensed","semi-condensed","normal","semi-expanded","expanded","extra-expanded","ultra-expanded",Yd,We]}],"font-family":[{font:[nC,We,e]}],"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,qe,We]}],"line-clamp":[{"line-clamp":[gt,"none",qe,Jd]}],leading:[{leading:[s,...D()]}],"list-image":[{"list-image":["none",qe,We]}],"list-style-position":[{list:["inside","outside"]}],"list-style-type":[{list:["disc","decimal","none",qe,We]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"placeholder-color":[{placeholder:z()}],"text-color":[{text:z()}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...xt(),"wavy"]}],"text-decoration-thickness":[{decoration:[gt,"from-font","auto",qe,Ls]}],"text-decoration-color":[{decoration:z()}],"underline-offset":[{"underline-offset":[gt,"auto",qe,We]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],"text-wrap":[{text:["wrap","nowrap","balance","pretty"]}],indent:[{indent:D()}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",qe,We]}],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",qe,We]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:de()}],"bg-repeat":[{bg:le()}],"bg-size":[{bg:pe()}],"bg-image":[{bg:["none",{linear:[{to:["t","tr","r","br","b","bl","l","tl"]},es,qe,We],radial:["",qe,We],conic:[es,qe,We]},rC,tC]}],"bg-color":[{bg:z()}],"gradient-from-pos":[{from:He()}],"gradient-via-pos":[{via:He()}],"gradient-to-pos":[{to:He()}],"gradient-from":[{from:z()}],"gradient-via":[{via:z()}],"gradient-to":[{to:z()}],rounded:[{rounded:ze()}],"rounded-s":[{"rounded-s":ze()}],"rounded-e":[{"rounded-e":ze()}],"rounded-t":[{"rounded-t":ze()}],"rounded-r":[{"rounded-r":ze()}],"rounded-b":[{"rounded-b":ze()}],"rounded-l":[{"rounded-l":ze()}],"rounded-ss":[{"rounded-ss":ze()}],"rounded-se":[{"rounded-se":ze()}],"rounded-ee":[{"rounded-ee":ze()}],"rounded-es":[{"rounded-es":ze()}],"rounded-tl":[{"rounded-tl":ze()}],"rounded-tr":[{"rounded-tr":ze()}],"rounded-br":[{"rounded-br":ze()}],"rounded-bl":[{"rounded-bl":ze()}],"border-w":[{border:st()}],"border-w-x":[{"border-x":st()}],"border-w-y":[{"border-y":st()}],"border-w-s":[{"border-s":st()}],"border-w-e":[{"border-e":st()}],"border-w-t":[{"border-t":st()}],"border-w-r":[{"border-r":st()}],"border-w-b":[{"border-b":st()}],"border-w-l":[{"border-l":st()}],"divide-x":[{"divide-x":st()}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":st()}],"divide-y-reverse":["divide-y-reverse"],"border-style":[{border:[...xt(),"hidden","none"]}],"divide-style":[{divide:[...xt(),"hidden","none"]}],"border-color":[{border:z()}],"border-color-x":[{"border-x":z()}],"border-color-y":[{"border-y":z()}],"border-color-s":[{"border-s":z()}],"border-color-e":[{"border-e":z()}],"border-color-t":[{"border-t":z()}],"border-color-r":[{"border-r":z()}],"border-color-b":[{"border-b":z()}],"border-color-l":[{"border-l":z()}],"divide-color":[{divide:z()}],"outline-style":[{outline:[...xt(),"none","hidden"]}],"outline-offset":[{"outline-offset":[gt,qe,We]}],"outline-w":[{outline:["",gt,Sa,Ls]}],"outline-color":[{outline:z()}],shadow:[{shadow:["","none",u,Gl,Hl]}],"shadow-color":[{shadow:z()}],"inset-shadow":[{"inset-shadow":["none",d,Gl,Hl]}],"inset-shadow-color":[{"inset-shadow":z()}],"ring-w":[{ring:st()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:z()}],"ring-offset-w":[{"ring-offset":[gt,Ls]}],"ring-offset-color":[{"ring-offset":z()}],"inset-ring-w":[{"inset-ring":st()}],"inset-ring-color":[{"inset-ring":z()}],"text-shadow":[{"text-shadow":["none",f,Gl,Hl]}],"text-shadow-color":[{"text-shadow":z()}],opacity:[{opacity:[gt,qe,We]}],"mix-blend":[{"mix-blend":[...ce(),"plus-darker","plus-lighter"]}],"bg-blend":[{"bg-blend":ce()}],"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":[gt]}],"mask-image-linear-from-pos":[{"mask-linear-from":ue()}],"mask-image-linear-to-pos":[{"mask-linear-to":ue()}],"mask-image-linear-from-color":[{"mask-linear-from":z()}],"mask-image-linear-to-color":[{"mask-linear-to":z()}],"mask-image-t-from-pos":[{"mask-t-from":ue()}],"mask-image-t-to-pos":[{"mask-t-to":ue()}],"mask-image-t-from-color":[{"mask-t-from":z()}],"mask-image-t-to-color":[{"mask-t-to":z()}],"mask-image-r-from-pos":[{"mask-r-from":ue()}],"mask-image-r-to-pos":[{"mask-r-to":ue()}],"mask-image-r-from-color":[{"mask-r-from":z()}],"mask-image-r-to-color":[{"mask-r-to":z()}],"mask-image-b-from-pos":[{"mask-b-from":ue()}],"mask-image-b-to-pos":[{"mask-b-to":ue()}],"mask-image-b-from-color":[{"mask-b-from":z()}],"mask-image-b-to-color":[{"mask-b-to":z()}],"mask-image-l-from-pos":[{"mask-l-from":ue()}],"mask-image-l-to-pos":[{"mask-l-to":ue()}],"mask-image-l-from-color":[{"mask-l-from":z()}],"mask-image-l-to-color":[{"mask-l-to":z()}],"mask-image-x-from-pos":[{"mask-x-from":ue()}],"mask-image-x-to-pos":[{"mask-x-to":ue()}],"mask-image-x-from-color":[{"mask-x-from":z()}],"mask-image-x-to-color":[{"mask-x-to":z()}],"mask-image-y-from-pos":[{"mask-y-from":ue()}],"mask-image-y-to-pos":[{"mask-y-to":ue()}],"mask-image-y-from-color":[{"mask-y-from":z()}],"mask-image-y-to-color":[{"mask-y-to":z()}],"mask-image-radial":[{"mask-radial":[qe,We]}],"mask-image-radial-from-pos":[{"mask-radial-from":ue()}],"mask-image-radial-to-pos":[{"mask-radial-to":ue()}],"mask-image-radial-from-color":[{"mask-radial-from":z()}],"mask-image-radial-to-color":[{"mask-radial-to":z()}],"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":[gt]}],"mask-image-conic-from-pos":[{"mask-conic-from":ue()}],"mask-image-conic-to-pos":[{"mask-conic-to":ue()}],"mask-image-conic-from-color":[{"mask-conic-from":z()}],"mask-image-conic-to-color":[{"mask-conic-to":z()}],"mask-mode":[{mask:["alpha","luminance","match"]}],"mask-origin":[{"mask-origin":["border","padding","content","fill","stroke","view"]}],"mask-position":[{mask:de()}],"mask-repeat":[{mask:le()}],"mask-size":[{mask:pe()}],"mask-type":[{"mask-type":["alpha","luminance"]}],"mask-image":[{mask:["none",qe,We]}],filter:[{filter:["","none",qe,We]}],blur:[{blur:Le()}],brightness:[{brightness:[gt,qe,We]}],contrast:[{contrast:[gt,qe,We]}],"drop-shadow":[{"drop-shadow":["","none",h,Gl,Hl]}],"drop-shadow-color":[{"drop-shadow":z()}],grayscale:[{grayscale:["",gt,qe,We]}],"hue-rotate":[{"hue-rotate":[gt,qe,We]}],invert:[{invert:["",gt,qe,We]}],saturate:[{saturate:[gt,qe,We]}],sepia:[{sepia:["",gt,qe,We]}],"backdrop-filter":[{"backdrop-filter":["","none",qe,We]}],"backdrop-blur":[{"backdrop-blur":Le()}],"backdrop-brightness":[{"backdrop-brightness":[gt,qe,We]}],"backdrop-contrast":[{"backdrop-contrast":[gt,qe,We]}],"backdrop-grayscale":[{"backdrop-grayscale":["",gt,qe,We]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[gt,qe,We]}],"backdrop-invert":[{"backdrop-invert":["",gt,qe,We]}],"backdrop-opacity":[{"backdrop-opacity":[gt,qe,We]}],"backdrop-saturate":[{"backdrop-saturate":[gt,qe,We]}],"backdrop-sepia":[{"backdrop-sepia":["",gt,qe,We]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":D()}],"border-spacing-x":[{"border-spacing-x":D()}],"border-spacing-y":[{"border-spacing-y":D()}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["","all","colors","opacity","shadow","transform","none",qe,We]}],"transition-behavior":[{transition:["normal","discrete"]}],duration:[{duration:[gt,"initial",qe,We]}],ease:[{ease:["linear","initial",p,qe,We]}],delay:[{delay:[gt,qe,We]}],animate:[{animate:["none",_,qe,We]}],backface:[{backface:["hidden","visible"]}],perspective:[{perspective:[v,qe,We]}],"perspective-origin":[{"perspective-origin":M()}],rotate:[{rotate:je()}],"rotate-x":[{"rotate-x":je()}],"rotate-y":[{"rotate-y":je()}],"rotate-z":[{"rotate-z":je()}],scale:[{scale:Ae()}],"scale-x":[{"scale-x":Ae()}],"scale-y":[{"scale-y":Ae()}],"scale-z":[{"scale-z":Ae()}],"scale-3d":["scale-3d"],skew:[{skew:mt()}],"skew-x":[{"skew-x":mt()}],"skew-y":[{"skew-y":mt()}],transform:[{transform:[qe,We,"","none","gpu","cpu"]}],"transform-origin":[{origin:M()}],"transform-style":[{transform:["3d","flat"]}],translate:[{translate:O()}],"translate-x":[{"translate-x":O()}],"translate-y":[{"translate-y":O()}],"translate-z":[{"translate-z":O()}],"translate-none":["translate-none"],accent:[{accent:z()}],appearance:[{appearance:["none","auto"]}],"caret-color":[{caret:z()}],"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",qe,We]}],"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":D()}],"scroll-mx":[{"scroll-mx":D()}],"scroll-my":[{"scroll-my":D()}],"scroll-ms":[{"scroll-ms":D()}],"scroll-me":[{"scroll-me":D()}],"scroll-mt":[{"scroll-mt":D()}],"scroll-mr":[{"scroll-mr":D()}],"scroll-mb":[{"scroll-mb":D()}],"scroll-ml":[{"scroll-ml":D()}],"scroll-p":[{"scroll-p":D()}],"scroll-px":[{"scroll-px":D()}],"scroll-py":[{"scroll-py":D()}],"scroll-ps":[{"scroll-ps":D()}],"scroll-pe":[{"scroll-pe":D()}],"scroll-pt":[{"scroll-pt":D()}],"scroll-pr":[{"scroll-pr":D()}],"scroll-pb":[{"scroll-pb":D()}],"scroll-pl":[{"scroll-pl":D()}],"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",qe,We]}],fill:[{fill:["none",...z()]}],"stroke-w":[{stroke:[gt,Sa,Ls,Jd]}],stroke:[{stroke:["none",...z()]}],"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"]}},lC=VA(aC);function cr(...t){return lC(Kx(t))}const ln=Ne({__name:"Button",props:{variant:{},size:{},class:{},asChild:{type:Boolean},as:{default:"button"}},setup(t){const e=t;return(n,i)=>(me(),Ie(E(wn),{"data-slot":"button",as:t.as,"as-child":t.asChild,class:Qt(E(cr)(E(cC)({variant:t.variant,size:t.size}),e.class,{dark:E(qn).value==="dark"}))},{default:te(()=>[at(n.$slots,"default")]),_:3},8,["as","as-child","class"]))}}),cC=ZM("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"}}),uC=Ne({__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(t,{emit:e}){const n=t,i=e,r=co(n,"class"),s=ar(r,i);return(o,a)=>(me(),Ie(E(xT),It({"data-slot":"slider",class:E(cr)("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)},E(s)),{default:te(({modelValue:l})=>[ie(E(CT),{"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:te(()=>[ie(E(ST),{"data-slot":"slider-range",class:"bg-primary absolute data-[orientation=horizontal]:h-full data-[orientation=vertical]:w-full"})]),_:1}),(me(!0),Ct(Kt,null,ta(l,(c,u)=>(me(),Ie(E(TT),{key:u,"data-slot":"slider-thumb",class:"bg-secondary-foreground 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"]))}});var dC=Object.defineProperty,jp=t=>{let e={};for(var n in t)dC(e,n,{get:t[n],enumerable:!0});return e};function fC(){let t=0,e=0;for(let i=0;i<28;i+=7){let r=this.buf[this.pos++];if(t|=(r&127)<>4,(n&128)==0)return this.assertBounds(),[t,e];for(let i=3;i<=31;i+=7){let r=this.buf[this.pos++];if(e|=(r&127)<>>s,a=!(!(o>>>7)&&e==0),l=(a?o|128:o)&255;if(n.push(l),!a)return}const i=t>>>28&15|(e&7)<<4,r=e>>3!=0;if(n.push((r?i|128:i)&255),!!r){for(let s=3;s<31;s=s+7){const o=e>>>s,a=!!(o>>>7),l=(a?o|128:o)&255;if(n.push(l),!a)return}n.push(e>>>31&1)}}const Lc=4294967296;function n0(t){const e=t[0]==="-";e&&(t=t.slice(1));const n=1e6;let i=0,r=0;function s(o,a){const l=Number(t.slice(o,a));r*=n,i=i*n+l,i>=Lc&&(r=r+(i/Lc|0),i=i%Lc)}return s(-24,-18),s(-18,-12),s(-12,-6),s(-6),e?tb(i,r):Yp(i,r)}function hC(t,e){let n=Yp(t,e);const i=n.hi&2147483648;i&&(n=tb(n.lo,n.hi));const r=eb(n.lo,n.hi);return i?"-"+r:r}function eb(t,e){if({lo:t,hi:e}=pC(t,e),e<=2097151)return String(Lc*e+t);const n=t&16777215,i=(t>>>24|e<<8)&16777215,r=e>>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()+i0(o)+i0(s)}function pC(t,e){return{lo:t>>>0,hi:e>>>0}}function Yp(t,e){return{lo:t|0,hi:e|0}}function tb(t,e){return e=~e,t?t=~t+1:e+=1,Yp(t,e)}const i0=t=>{const e=String(t);return"0000000".slice(e.length)+e};function r0(t,e){if(t>=0){for(;t>127;)e.push(t&127|128),t=t>>>7;e.push(t)}else{for(let n=0;n<9;n++)e.push(t&127|128),t=t>>7;e.push(1)}}function mC(){let t=this.buf[this.pos++],e=t&127;if((t&128)==0)return this.assertBounds(),e;if(t=this.buf[this.pos++],e|=(t&127)<<7,(t&128)==0)return this.assertBounds(),e;if(t=this.buf[this.pos++],e|=(t&127)<<14,(t&128)==0)return this.assertBounds(),e;if(t=this.buf[this.pos++],e|=(t&127)<<21,(t&128)==0)return this.assertBounds(),e;t=this.buf[this.pos++],e|=(t&15)<<28;for(let n=5;(t&128)!==0&&n<10;n++)t=this.buf[this.pos++];if((t&128)!=0)throw new Error("invalid varint");return this.assertBounds(),e>>>0}var s0={};const Yi=gC();function gC(){const t=new DataView(new ArrayBuffer(8));if(typeof BigInt=="function"&&typeof t.getBigInt64=="function"&&typeof t.getBigUint64=="function"&&typeof t.setBigInt64=="function"&&typeof t.setBigUint64=="function"&&(!!globalThis.Deno||typeof process!="object"||typeof s0!="object"||s0.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(e){return this.buf.length&&(this.chunks.push(new Uint8Array(this.buf)),this.buf=[]),this.chunks.push(e),this}uint32(e){for(l0(e);e>127;)this.buf.push(e&127|128),e=e>>>7;return this.buf.push(e),this}int32(e){return Qd(e),r0(e,this.buf),this}bool(e){return this.buf.push(e?1:0),this}bytes(e){return this.uint32(e.byteLength),this.raw(e)}string(e){let n=this.encodeUtf8(e);return this.uint32(n.byteLength),this.raw(n)}float(e){SC(e);let n=new Uint8Array(4);return new DataView(n.buffer).setFloat32(0,e,!0),this.raw(n)}double(e){let n=new Uint8Array(8);return new DataView(n.buffer).setFloat64(0,e,!0),this.raw(n)}fixed32(e){l0(e);let n=new Uint8Array(4);return new DataView(n.buffer).setUint32(0,e,!0),this.raw(n)}sfixed32(e){Qd(e);let n=new Uint8Array(4);return new DataView(n.buffer).setInt32(0,e,!0),this.raw(n)}sint32(e){return Qd(e),e=(e<<1^e>>31)>>>0,r0(e,this.buf),this}sfixed64(e){let n=new Uint8Array(8),i=new DataView(n.buffer),r=Yi.enc(e);return i.setInt32(0,r.lo,!0),i.setInt32(4,r.hi,!0),this.raw(n)}fixed64(e){let n=new Uint8Array(8),i=new DataView(n.buffer),r=Yi.uEnc(e);return i.setInt32(0,r.lo,!0),i.setInt32(4,r.hi,!0),this.raw(n)}int64(e){let n=Yi.enc(e);return Kd(n.lo,n.hi,this.buf),this}sint64(e){const n=Yi.enc(e),i=n.hi>>31,r=n.lo<<1^i,s=(n.hi<<1|n.lo>>>31)^i;return Kd(r,s,this.buf),this}uint64(e){const n=Yi.uEnc(e);return Kd(n.lo,n.hi,this.buf),this}}class Se{constructor(e,n=nb().decodeUtf8){this.decodeUtf8=n,this.varint64=fC,this.uint32=mC,this.buf=e,this.len=e.length,this.pos=0,this.view=new DataView(e.buffer,e.byteOffset,e.byteLength)}tag(){let e=this.uint32(),n=e>>>3,i=e&7;if(n<=0||i<0||i>5)throw new Error("illegal tag: field no "+n+" wire type "+i);return[n,i]}skip(e,n){let i=this.pos;switch(e){case ds.Varint:for(;this.buf[this.pos++]&128;);break;case ds.Bit64:this.pos+=4;case ds.Bit32:this.pos+=4;break;case ds.LengthDelimited:let r=this.uint32();this.pos+=r;break;case ds.StartGroup:for(;;){const[s,o]=this.tag();if(o===ds.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 "+e)}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 e=this.uint32();return e>>>1^-(e&1)}int64(){return Yi.dec(...this.varint64())}uint64(){return Yi.uDec(...this.varint64())}sint64(){let[e,n]=this.varint64(),i=-(e&1);return e=(e>>>1|(n&1)<<31)^i,n=n>>>1^i,Yi.dec(e,n)}bool(){let[e,n]=this.varint64();return e!==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 Yi.uDec(this.sfixed32(),this.sfixed32())}sfixed64(){return Yi.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 e=this.uint32(),n=this.pos;return this.pos+=e,this.assertBounds(),this.buf.subarray(n,n+e)}string(){return this.decodeUtf8(this.bytes())}}function Qd(t){if(typeof t=="string")t=Number(t);else if(typeof t!="number")throw new Error("invalid int32: "+typeof t);if(!Number.isInteger(t)||t>yC||txC||t<0)throw new Error("invalid uint32: "+t)}function SC(t){if(typeof t=="string"){const e=t;if(t=Number(t),Number.isNaN(t)&&e!=="NaN")throw new Error("invalid float32: "+e)}else if(typeof t!="number")throw new Error("invalid float32: "+typeof t);if(Number.isFinite(t)&&(t>vC||t<_C))throw new Error("invalid float32: "+t)}const Jp="182",io={ROTATE:0,DOLLY:1,PAN:2},Bo={ROTATE:0,PAN:1,DOLLY_PAN:2,DOLLY_ROTATE:3},wC=0,c0=1,MC=2,Oc=1,ib=2,Fa=3,ys=0,Ln=1,Vn=2,Lr=0,Yo=1,u0=2,d0=3,f0=4,EC=5,$s=100,TC=101,AC=102,CC=103,PC=104,RC=200,DC=201,IC=202,NC=203,ph=204,mh=205,LC=206,OC=207,FC=208,UC=209,kC=210,BC=211,zC=212,VC=213,HC=214,gh=0,vh=1,_h=2,ia=3,xh=4,yh=5,bh=6,Sh=7,rb=0,GC=1,WC=2,nr=0,sb=1,ob=2,ab=3,Kp=4,lb=5,cb=6,ub=7,db=300,oo=301,ra=302,wh=303,Mh=304,Wu=306,Eh=1e3,Ir=1001,Th=1002,Sn=1003,qC=1004,Wl=1005,Dn=1006,ef=1007,Js=1008,li=1009,fb=1010,hb=1011,cl=1012,Zp=1013,rr=1014,Ki=1015,qr=1016,Qp=1017,em=1018,ul=1020,pb=35902,mb=35899,gb=1021,vb=1022,Ai=1023,Xr=1026,Ks=1027,_b=1028,tm=1029,sa=1030,nm=1031,im=1033,Fc=33776,Uc=33777,kc=33778,Bc=33779,Ah=35840,Ch=35841,Ph=35842,Rh=35843,Dh=36196,Ih=37492,Nh=37496,Lh=37488,Oh=37489,Fh=37490,Uh=37491,kh=37808,Bh=37809,zh=37810,Vh=37811,Hh=37812,Gh=37813,Wh=37814,qh=37815,Xh=37816,$h=37817,jh=37818,Yh=37819,Jh=37820,Kh=37821,Zh=36492,Qh=36494,ep=36495,tp=36283,np=36284,ip=36285,rp=36286,XC=3200,xb=0,$C=1,fs="",oi="srgb",oa="srgb-linear",ou="linear",Dt="srgb",bo=7680,h0=519,jC=512,YC=513,JC=514,rm=515,KC=516,ZC=517,sm=518,QC=519,p0=35044,m0="300 es",Zi=2e3,au=2001;function yb(t){for(let e=t.length-1;e>=0;--e)if(t[e]>=65535)return!0;return!1}function lu(t){return document.createElementNS("http://www.w3.org/1999/xhtml",t)}function eP(){const t=lu("canvas");return t.style.display="block",t}const g0={};function v0(...t){const e="THREE."+t.shift();console.log(e,...t)}function it(...t){const e="THREE."+t.shift();console.warn(e,...t)}function bt(...t){const e="THREE."+t.shift();console.error(e,...t)}function dl(...t){const e=t.join(" ");e in g0||(g0[e]=!0,it(...t))}function tP(t,e,n){return new Promise(function(i,r){function s(){switch(t.clientWaitSync(e,t.SYNC_FLUSH_COMMANDS_BIT,0)){case t.WAIT_FAILED:r();break;case t.TIMEOUT_EXPIRED:setTimeout(s,n);break;default:i()}}setTimeout(s,n)})}class fo{addEventListener(e,n){this._listeners===void 0&&(this._listeners={});const i=this._listeners;i[e]===void 0&&(i[e]=[]),i[e].indexOf(n)===-1&&i[e].push(n)}hasEventListener(e,n){const i=this._listeners;return i===void 0?!1:i[e]!==void 0&&i[e].indexOf(n)!==-1}removeEventListener(e,n){const i=this._listeners;if(i===void 0)return;const r=i[e];if(r!==void 0){const s=r.indexOf(n);s!==-1&&r.splice(s,1)}}dispatchEvent(e){const n=this._listeners;if(n===void 0)return;const i=n[e.type];if(i!==void 0){e.target=this;const r=i.slice(0);for(let s=0,o=r.length;s>8&255]+Mn[t>>16&255]+Mn[t>>24&255]+"-"+Mn[e&255]+Mn[e>>8&255]+"-"+Mn[e>>16&15|64]+Mn[e>>24&255]+"-"+Mn[n&63|128]+Mn[n>>8&255]+"-"+Mn[n>>16&255]+Mn[n>>24&255]+Mn[i&255]+Mn[i>>8&255]+Mn[i>>16&255]+Mn[i>>24&255]).toLowerCase()}function ht(t,e,n){return Math.max(e,Math.min(n,t))}function om(t,e){return(t%e+e)%e}function nP(t,e,n,i,r){return i+(t-e)*(r-i)/(n-e)}function iP(t,e,n){return t!==e?(n-t)/(e-t):0}function Ka(t,e,n){return(1-n)*t+n*e}function rP(t,e,n,i){return Ka(t,e,1-Math.exp(-n*i))}function sP(t,e=1){return e-Math.abs(om(t,e*2)-e)}function oP(t,e,n){return t<=e?0:t>=n?1:(t=(t-e)/(n-e),t*t*(3-2*t))}function aP(t,e,n){return t<=e?0:t>=n?1:(t=(t-e)/(n-e),t*t*t*(t*(t*6-15)+10))}function lP(t,e){return t+Math.floor(Math.random()*(e-t+1))}function cP(t,e){return t+Math.random()*(e-t)}function uP(t){return t*(.5-Math.random())}function dP(t){t!==void 0&&(_0=t);let e=_0+=1831565813;return e=Math.imul(e^e>>>15,e|1),e^=e+Math.imul(e^e>>>7,e|61),((e^e>>>14)>>>0)/4294967296}function fP(t){return t*Jo}function hP(t){return t*aa}function pP(t){return(t&t-1)===0&&t!==0}function mP(t){return Math.pow(2,Math.ceil(Math.log(t)/Math.LN2))}function gP(t){return Math.pow(2,Math.floor(Math.log(t)/Math.LN2))}function vP(t,e,n,i,r){const s=Math.cos,o=Math.sin,a=s(n/2),l=o(n/2),c=s((e+i)/2),u=o((e+i)/2),d=s((e-i)/2),f=o((e-i)/2),h=s((i-e)/2),g=o((i-e)/2);switch(r){case"XYX":t.set(a*u,l*d,l*f,a*c);break;case"YZY":t.set(l*f,a*u,l*d,a*c);break;case"ZXZ":t.set(l*d,l*f,a*u,a*c);break;case"XZX":t.set(a*u,l*g,l*h,a*c);break;case"YXY":t.set(l*h,a*u,l*g,a*c);break;case"ZYZ":t.set(l*g,l*h,a*u,a*c);break;default:it("MathUtils: .setQuaternionFromProperEuler() encountered an unknown order: "+r)}}function Uo(t,e){switch(e.constructor){case Float32Array:return t;case Uint32Array:return t/4294967295;case Uint16Array:return t/65535;case Uint8Array:return t/255;case Int32Array:return Math.max(t/2147483647,-1);case Int16Array:return Math.max(t/32767,-1);case Int8Array:return Math.max(t/127,-1);default:throw new Error("Invalid component type.")}}function kn(t,e){switch(e.constructor){case Float32Array:return t;case Uint32Array:return Math.round(t*4294967295);case Uint16Array:return Math.round(t*65535);case Uint8Array:return Math.round(t*255);case Int32Array:return Math.round(t*2147483647);case Int16Array:return Math.round(t*32767);case Int8Array:return Math.round(t*127);default:throw new Error("Invalid component type.")}}const sp={DEG2RAD:Jo,RAD2DEG:aa,generateUUID:ho,clamp:ht,euclideanModulo:om,mapLinear:nP,inverseLerp:iP,lerp:Ka,damp:rP,pingpong:sP,smoothstep:oP,smootherstep:aP,randInt:lP,randFloat:cP,randFloatSpread:uP,seededRandom:dP,degToRad:fP,radToDeg:hP,isPowerOfTwo:pP,ceilPowerOfTwo:mP,floorPowerOfTwo:gP,setQuaternionFromProperEuler:vP,normalize:kn,denormalize:Uo};class xe{constructor(e=0,n=0){xe.prototype.isVector2=!0,this.x=e,this.y=n}get width(){return this.x}set width(e){this.x=e}get height(){return this.y}set height(e){this.y=e}set(e,n){return this.x=e,this.y=n,this}setScalar(e){return this.x=e,this.y=e,this}setX(e){return this.x=e,this}setY(e){return this.y=e,this}setComponent(e,n){switch(e){case 0:this.x=n;break;case 1:this.y=n;break;default:throw new Error("index is out of range: "+e)}return this}getComponent(e){switch(e){case 0:return this.x;case 1:return this.y;default:throw new Error("index is out of range: "+e)}}clone(){return new this.constructor(this.x,this.y)}copy(e){return this.x=e.x,this.y=e.y,this}add(e){return this.x+=e.x,this.y+=e.y,this}addScalar(e){return this.x+=e,this.y+=e,this}addVectors(e,n){return this.x=e.x+n.x,this.y=e.y+n.y,this}addScaledVector(e,n){return this.x+=e.x*n,this.y+=e.y*n,this}sub(e){return this.x-=e.x,this.y-=e.y,this}subScalar(e){return this.x-=e,this.y-=e,this}subVectors(e,n){return this.x=e.x-n.x,this.y=e.y-n.y,this}multiply(e){return this.x*=e.x,this.y*=e.y,this}multiplyScalar(e){return this.x*=e,this.y*=e,this}divide(e){return this.x/=e.x,this.y/=e.y,this}divideScalar(e){return this.multiplyScalar(1/e)}applyMatrix3(e){const n=this.x,i=this.y,r=e.elements;return this.x=r[0]*n+r[3]*i+r[6],this.y=r[1]*n+r[4]*i+r[7],this}min(e){return this.x=Math.min(this.x,e.x),this.y=Math.min(this.y,e.y),this}max(e){return this.x=Math.max(this.x,e.x),this.y=Math.max(this.y,e.y),this}clamp(e,n){return this.x=ht(this.x,e.x,n.x),this.y=ht(this.y,e.y,n.y),this}clampScalar(e,n){return this.x=ht(this.x,e,n),this.y=ht(this.y,e,n),this}clampLength(e,n){const i=this.length();return this.divideScalar(i||1).multiplyScalar(ht(i,e,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(e){return this.x*e.x+this.y*e.y}cross(e){return this.x*e.y-this.y*e.x}lengthSq(){return this.x*this.x+this.y*this.y}length(){return Math.sqrt(this.x*this.x+this.y*this.y)}manhattanLength(){return Math.abs(this.x)+Math.abs(this.y)}normalize(){return this.divideScalar(this.length()||1)}angle(){return Math.atan2(-this.y,-this.x)+Math.PI}angleTo(e){const n=Math.sqrt(this.lengthSq()*e.lengthSq());if(n===0)return Math.PI/2;const i=this.dot(e)/n;return Math.acos(ht(i,-1,1))}distanceTo(e){return Math.sqrt(this.distanceToSquared(e))}distanceToSquared(e){const n=this.x-e.x,i=this.y-e.y;return n*n+i*i}manhattanDistanceTo(e){return Math.abs(this.x-e.x)+Math.abs(this.y-e.y)}setLength(e){return this.normalize().multiplyScalar(e)}lerp(e,n){return this.x+=(e.x-this.x)*n,this.y+=(e.y-this.y)*n,this}lerpVectors(e,n,i){return this.x=e.x+(n.x-e.x)*i,this.y=e.y+(n.y-e.y)*i,this}equals(e){return e.x===this.x&&e.y===this.y}fromArray(e,n=0){return this.x=e[n],this.y=e[n+1],this}toArray(e=[],n=0){return e[n]=this.x,e[n+1]=this.y,e}fromBufferAttribute(e,n){return this.x=e.getX(n),this.y=e.getY(n),this}rotateAround(e,n){const i=Math.cos(n),r=Math.sin(n),s=this.x-e.x,o=this.y-e.y;return this.x=s*i-o*r+e.x,this.y=s*r+o*i+e.y,this}random(){return this.x=Math.random(),this.y=Math.random(),this}*[Symbol.iterator](){yield this.x,yield this.y}}class _n{constructor(e=0,n=0,i=0,r=1){this.isQuaternion=!0,this._x=e,this._y=n,this._z=i,this._w=r}static slerpFlat(e,n,i,r,s,o,a){let l=i[r+0],c=i[r+1],u=i[r+2],d=i[r+3],f=s[o+0],h=s[o+1],g=s[o+2],v=s[o+3];if(a<=0){e[n+0]=l,e[n+1]=c,e[n+2]=u,e[n+3]=d;return}if(a>=1){e[n+0]=f,e[n+1]=h,e[n+2]=g,e[n+3]=v;return}if(d!==v||l!==f||c!==h||u!==g){let m=l*f+c*h+u*g+d*v;m<0&&(f=-f,h=-h,g=-g,v=-v,m=-m);let p=1-a;if(m<.9995){const _=Math.acos(m),y=Math.sin(_);p=Math.sin(p*_)/y,a=Math.sin(a*_)/y,l=l*p+f*a,c=c*p+h*a,u=u*p+g*a,d=d*p+v*a}else{l=l*p+f*a,c=c*p+h*a,u=u*p+g*a,d=d*p+v*a;const _=1/Math.sqrt(l*l+c*c+u*u+d*d);l*=_,c*=_,u*=_,d*=_}}e[n]=l,e[n+1]=c,e[n+2]=u,e[n+3]=d}static multiplyQuaternionsFlat(e,n,i,r,s,o){const a=i[r],l=i[r+1],c=i[r+2],u=i[r+3],d=s[o],f=s[o+1],h=s[o+2],g=s[o+3];return e[n]=a*g+u*d+l*h-c*f,e[n+1]=l*g+u*f+c*d-a*h,e[n+2]=c*g+u*h+a*f-l*d,e[n+3]=u*g-a*d-l*f-c*h,e}get x(){return this._x}set x(e){this._x=e,this._onChangeCallback()}get y(){return this._y}set y(e){this._y=e,this._onChangeCallback()}get z(){return this._z}set z(e){this._z=e,this._onChangeCallback()}get w(){return this._w}set w(e){this._w=e,this._onChangeCallback()}set(e,n,i,r){return this._x=e,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(e){return this._x=e.x,this._y=e.y,this._z=e.z,this._w=e.w,this._onChangeCallback(),this}setFromEuler(e,n=!0){const i=e._x,r=e._y,s=e._z,o=e._order,a=Math.cos,l=Math.sin,c=a(i/2),u=a(r/2),d=a(s/2),f=l(i/2),h=l(r/2),g=l(s/2);switch(o){case"XYZ":this._x=f*u*d+c*h*g,this._y=c*h*d-f*u*g,this._z=c*u*g+f*h*d,this._w=c*u*d-f*h*g;break;case"YXZ":this._x=f*u*d+c*h*g,this._y=c*h*d-f*u*g,this._z=c*u*g-f*h*d,this._w=c*u*d+f*h*g;break;case"ZXY":this._x=f*u*d-c*h*g,this._y=c*h*d+f*u*g,this._z=c*u*g+f*h*d,this._w=c*u*d-f*h*g;break;case"ZYX":this._x=f*u*d-c*h*g,this._y=c*h*d+f*u*g,this._z=c*u*g-f*h*d,this._w=c*u*d+f*h*g;break;case"YZX":this._x=f*u*d+c*h*g,this._y=c*h*d+f*u*g,this._z=c*u*g-f*h*d,this._w=c*u*d-f*h*g;break;case"XZY":this._x=f*u*d-c*h*g,this._y=c*h*d-f*u*g,this._z=c*u*g+f*h*d,this._w=c*u*d+f*h*g;break;default:it("Quaternion: .setFromEuler() encountered an unknown order: "+o)}return n===!0&&this._onChangeCallback(),this}setFromAxisAngle(e,n){const i=n/2,r=Math.sin(i);return this._x=e.x*r,this._y=e.y*r,this._z=e.z*r,this._w=Math.cos(i),this._onChangeCallback(),this}setFromRotationMatrix(e){const n=e.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],d=n[10],f=i+a+d;if(f>0){const h=.5/Math.sqrt(f+1);this._w=.25/h,this._x=(u-l)*h,this._y=(s-c)*h,this._z=(o-r)*h}else if(i>a&&i>d){const h=2*Math.sqrt(1+i-a-d);this._w=(u-l)/h,this._x=.25*h,this._y=(r+o)/h,this._z=(s+c)/h}else if(a>d){const h=2*Math.sqrt(1+a-i-d);this._w=(s-c)/h,this._x=(r+o)/h,this._y=.25*h,this._z=(l+u)/h}else{const h=2*Math.sqrt(1+d-i-a);this._w=(o-r)/h,this._x=(s+c)/h,this._y=(l+u)/h,this._z=.25*h}return this._onChangeCallback(),this}setFromUnitVectors(e,n){let i=e.dot(n)+1;return i<1e-8?(i=0,Math.abs(e.x)>Math.abs(e.z)?(this._x=-e.y,this._y=e.x,this._z=0,this._w=i):(this._x=0,this._y=-e.z,this._z=e.y,this._w=i)):(this._x=e.y*n.z-e.z*n.y,this._y=e.z*n.x-e.x*n.z,this._z=e.x*n.y-e.y*n.x,this._w=i),this.normalize()}angleTo(e){return 2*Math.acos(Math.abs(ht(this.dot(e),-1,1)))}rotateTowards(e,n){const i=this.angleTo(e);if(i===0)return this;const r=Math.min(1,n/i);return this.slerp(e,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(e){return this._x*e._x+this._y*e._y+this._z*e._z+this._w*e._w}lengthSq(){return this._x*this._x+this._y*this._y+this._z*this._z+this._w*this._w}length(){return Math.sqrt(this._x*this._x+this._y*this._y+this._z*this._z+this._w*this._w)}normalize(){let e=this.length();return e===0?(this._x=0,this._y=0,this._z=0,this._w=1):(e=1/e,this._x=this._x*e,this._y=this._y*e,this._z=this._z*e,this._w=this._w*e),this._onChangeCallback(),this}multiply(e){return this.multiplyQuaternions(this,e)}premultiply(e){return this.multiplyQuaternions(e,this)}multiplyQuaternions(e,n){const i=e._x,r=e._y,s=e._z,o=e._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(e,n){if(n<=0)return this;if(n>=1)return this.copy(e);let i=e._x,r=e._y,s=e._z,o=e._w,a=this.dot(e);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(e,n,i){return this.copy(e).slerp(n,i)}random(){const e=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(e),r*Math.cos(e),s*Math.sin(n),s*Math.cos(n))}equals(e){return e._x===this._x&&e._y===this._y&&e._z===this._z&&e._w===this._w}fromArray(e,n=0){return this._x=e[n],this._y=e[n+1],this._z=e[n+2],this._w=e[n+3],this._onChangeCallback(),this}toArray(e=[],n=0){return e[n]=this._x,e[n+1]=this._y,e[n+2]=this._z,e[n+3]=this._w,e}fromBufferAttribute(e,n){return this._x=e.getX(n),this._y=e.getY(n),this._z=e.getZ(n),this._w=e.getW(n),this._onChangeCallback(),this}toJSON(){return this.toArray()}_onChange(e){return this._onChangeCallback=e,this}_onChangeCallback(){}*[Symbol.iterator](){yield this._x,yield this._y,yield this._z,yield this._w}}class N{constructor(e=0,n=0,i=0){N.prototype.isVector3=!0,this.x=e,this.y=n,this.z=i}set(e,n,i){return i===void 0&&(i=this.z),this.x=e,this.y=n,this.z=i,this}setScalar(e){return this.x=e,this.y=e,this.z=e,this}setX(e){return this.x=e,this}setY(e){return this.y=e,this}setZ(e){return this.z=e,this}setComponent(e,n){switch(e){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: "+e)}return this}getComponent(e){switch(e){case 0:return this.x;case 1:return this.y;case 2:return this.z;default:throw new Error("index is out of range: "+e)}}clone(){return new this.constructor(this.x,this.y,this.z)}copy(e){return this.x=e.x,this.y=e.y,this.z=e.z,this}add(e){return this.x+=e.x,this.y+=e.y,this.z+=e.z,this}addScalar(e){return this.x+=e,this.y+=e,this.z+=e,this}addVectors(e,n){return this.x=e.x+n.x,this.y=e.y+n.y,this.z=e.z+n.z,this}addScaledVector(e,n){return this.x+=e.x*n,this.y+=e.y*n,this.z+=e.z*n,this}sub(e){return this.x-=e.x,this.y-=e.y,this.z-=e.z,this}subScalar(e){return this.x-=e,this.y-=e,this.z-=e,this}subVectors(e,n){return this.x=e.x-n.x,this.y=e.y-n.y,this.z=e.z-n.z,this}multiply(e){return this.x*=e.x,this.y*=e.y,this.z*=e.z,this}multiplyScalar(e){return this.x*=e,this.y*=e,this.z*=e,this}multiplyVectors(e,n){return this.x=e.x*n.x,this.y=e.y*n.y,this.z=e.z*n.z,this}applyEuler(e){return this.applyQuaternion(x0.setFromEuler(e))}applyAxisAngle(e,n){return this.applyQuaternion(x0.setFromAxisAngle(e,n))}applyMatrix3(e){const n=this.x,i=this.y,r=this.z,s=e.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(e){return this.applyMatrix3(e).normalize()}applyMatrix4(e){const n=this.x,i=this.y,r=this.z,s=e.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(e){const n=this.x,i=this.y,r=this.z,s=e.x,o=e.y,a=e.z,l=e.w,c=2*(o*r-a*i),u=2*(a*n-s*r),d=2*(s*i-o*n);return this.x=n+l*c+o*d-a*u,this.y=i+l*u+a*c-s*d,this.z=r+l*d+s*u-o*c,this}project(e){return this.applyMatrix4(e.matrixWorldInverse).applyMatrix4(e.projectionMatrix)}unproject(e){return this.applyMatrix4(e.projectionMatrixInverse).applyMatrix4(e.matrixWorld)}transformDirection(e){const n=this.x,i=this.y,r=this.z,s=e.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(e){return this.x/=e.x,this.y/=e.y,this.z/=e.z,this}divideScalar(e){return this.multiplyScalar(1/e)}min(e){return this.x=Math.min(this.x,e.x),this.y=Math.min(this.y,e.y),this.z=Math.min(this.z,e.z),this}max(e){return this.x=Math.max(this.x,e.x),this.y=Math.max(this.y,e.y),this.z=Math.max(this.z,e.z),this}clamp(e,n){return this.x=ht(this.x,e.x,n.x),this.y=ht(this.y,e.y,n.y),this.z=ht(this.z,e.z,n.z),this}clampScalar(e,n){return this.x=ht(this.x,e,n),this.y=ht(this.y,e,n),this.z=ht(this.z,e,n),this}clampLength(e,n){const i=this.length();return this.divideScalar(i||1).multiplyScalar(ht(i,e,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(e){return this.x*e.x+this.y*e.y+this.z*e.z}lengthSq(){return this.x*this.x+this.y*this.y+this.z*this.z}length(){return Math.sqrt(this.x*this.x+this.y*this.y+this.z*this.z)}manhattanLength(){return Math.abs(this.x)+Math.abs(this.y)+Math.abs(this.z)}normalize(){return this.divideScalar(this.length()||1)}setLength(e){return this.normalize().multiplyScalar(e)}lerp(e,n){return this.x+=(e.x-this.x)*n,this.y+=(e.y-this.y)*n,this.z+=(e.z-this.z)*n,this}lerpVectors(e,n,i){return this.x=e.x+(n.x-e.x)*i,this.y=e.y+(n.y-e.y)*i,this.z=e.z+(n.z-e.z)*i,this}cross(e){return this.crossVectors(this,e)}crossVectors(e,n){const i=e.x,r=e.y,s=e.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(e){const n=e.lengthSq();if(n===0)return this.set(0,0,0);const i=e.dot(this)/n;return this.copy(e).multiplyScalar(i)}projectOnPlane(e){return tf.copy(this).projectOnVector(e),this.sub(tf)}reflect(e){return this.sub(tf.copy(e).multiplyScalar(2*this.dot(e)))}angleTo(e){const n=Math.sqrt(this.lengthSq()*e.lengthSq());if(n===0)return Math.PI/2;const i=this.dot(e)/n;return Math.acos(ht(i,-1,1))}distanceTo(e){return Math.sqrt(this.distanceToSquared(e))}distanceToSquared(e){const n=this.x-e.x,i=this.y-e.y,r=this.z-e.z;return n*n+i*i+r*r}manhattanDistanceTo(e){return Math.abs(this.x-e.x)+Math.abs(this.y-e.y)+Math.abs(this.z-e.z)}setFromSpherical(e){return this.setFromSphericalCoords(e.radius,e.phi,e.theta)}setFromSphericalCoords(e,n,i){const r=Math.sin(n)*e;return this.x=r*Math.sin(i),this.y=Math.cos(n)*e,this.z=r*Math.cos(i),this}setFromCylindrical(e){return this.setFromCylindricalCoords(e.radius,e.theta,e.y)}setFromCylindricalCoords(e,n,i){return this.x=e*Math.sin(n),this.y=i,this.z=e*Math.cos(n),this}setFromMatrixPosition(e){const n=e.elements;return this.x=n[12],this.y=n[13],this.z=n[14],this}setFromMatrixScale(e){const n=this.setFromMatrixColumn(e,0).length(),i=this.setFromMatrixColumn(e,1).length(),r=this.setFromMatrixColumn(e,2).length();return this.x=n,this.y=i,this.z=r,this}setFromMatrixColumn(e,n){return this.fromArray(e.elements,n*4)}setFromMatrix3Column(e,n){return this.fromArray(e.elements,n*3)}setFromEuler(e){return this.x=e._x,this.y=e._y,this.z=e._z,this}setFromColor(e){return this.x=e.r,this.y=e.g,this.z=e.b,this}equals(e){return e.x===this.x&&e.y===this.y&&e.z===this.z}fromArray(e,n=0){return this.x=e[n],this.y=e[n+1],this.z=e[n+2],this}toArray(e=[],n=0){return e[n]=this.x,e[n+1]=this.y,e[n+2]=this.z,e}fromBufferAttribute(e,n){return this.x=e.getX(n),this.y=e.getY(n),this.z=e.getZ(n),this}random(){return this.x=Math.random(),this.y=Math.random(),this.z=Math.random(),this}randomDirection(){const e=Math.random()*Math.PI*2,n=Math.random()*2-1,i=Math.sqrt(1-n*n);return this.x=i*Math.cos(e),this.y=n,this.z=i*Math.sin(e),this}*[Symbol.iterator](){yield this.x,yield this.y,yield this.z}}const tf=new N,x0=new _n;class ft{constructor(e,n,i,r,s,o,a,l,c){ft.prototype.isMatrix3=!0,this.elements=[1,0,0,0,1,0,0,0,1],e!==void 0&&this.set(e,n,i,r,s,o,a,l,c)}set(e,n,i,r,s,o,a,l,c){const u=this.elements;return u[0]=e,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(e){const n=this.elements,i=e.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(e,n,i){return e.setFromMatrix3Column(this,0),n.setFromMatrix3Column(this,1),i.setFromMatrix3Column(this,2),this}setFromMatrix4(e){const n=e.elements;return this.set(n[0],n[4],n[8],n[1],n[5],n[9],n[2],n[6],n[10]),this}multiply(e){return this.multiplyMatrices(this,e)}premultiply(e){return this.multiplyMatrices(e,this)}multiplyMatrices(e,n){const i=e.elements,r=n.elements,s=this.elements,o=i[0],a=i[3],l=i[6],c=i[1],u=i[4],d=i[7],f=i[2],h=i[5],g=i[8],v=r[0],m=r[3],p=r[6],_=r[1],y=r[4],x=r[7],M=r[2],A=r[5],P=r[8];return s[0]=o*v+a*_+l*M,s[3]=o*m+a*y+l*A,s[6]=o*p+a*x+l*P,s[1]=c*v+u*_+d*M,s[4]=c*m+u*y+d*A,s[7]=c*p+u*x+d*P,s[2]=f*v+h*_+g*M,s[5]=f*m+h*y+g*A,s[8]=f*p+h*x+g*P,this}multiplyScalar(e){const n=this.elements;return n[0]*=e,n[3]*=e,n[6]*=e,n[1]*=e,n[4]*=e,n[7]*=e,n[2]*=e,n[5]*=e,n[8]*=e,this}determinant(){const e=this.elements,n=e[0],i=e[1],r=e[2],s=e[3],o=e[4],a=e[5],l=e[6],c=e[7],u=e[8];return n*o*u-n*a*c-i*s*u+i*a*l+r*s*c-r*o*l}invert(){const e=this.elements,n=e[0],i=e[1],r=e[2],s=e[3],o=e[4],a=e[5],l=e[6],c=e[7],u=e[8],d=u*o-a*c,f=a*l-u*s,h=c*s-o*l,g=n*d+i*f+r*h;if(g===0)return this.set(0,0,0,0,0,0,0,0,0);const v=1/g;return e[0]=d*v,e[1]=(r*c-u*i)*v,e[2]=(a*i-r*o)*v,e[3]=f*v,e[4]=(u*n-r*l)*v,e[5]=(r*s-a*n)*v,e[6]=h*v,e[7]=(i*l-c*n)*v,e[8]=(o*n-i*s)*v,this}transpose(){let e;const n=this.elements;return e=n[1],n[1]=n[3],n[3]=e,e=n[2],n[2]=n[6],n[6]=e,e=n[5],n[5]=n[7],n[7]=e,this}getNormalMatrix(e){return this.setFromMatrix4(e).invert().transpose()}transposeIntoArray(e){const n=this.elements;return e[0]=n[0],e[1]=n[3],e[2]=n[6],e[3]=n[1],e[4]=n[4],e[5]=n[7],e[6]=n[2],e[7]=n[5],e[8]=n[8],this}setUvTransform(e,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+e,-r*c,r*l,-r*(-c*o+l*a)+a+n,0,0,1),this}scale(e,n){return this.premultiply(nf.makeScale(e,n)),this}rotate(e){return this.premultiply(nf.makeRotation(-e)),this}translate(e,n){return this.premultiply(nf.makeTranslation(e,n)),this}makeTranslation(e,n){return e.isVector2?this.set(1,0,e.x,0,1,e.y,0,0,1):this.set(1,0,e,0,1,n,0,0,1),this}makeRotation(e){const n=Math.cos(e),i=Math.sin(e);return this.set(n,-i,0,i,n,0,0,0,1),this}makeScale(e,n){return this.set(e,0,0,0,n,0,0,0,1),this}equals(e){const n=this.elements,i=e.elements;for(let r=0;r<9;r++)if(n[r]!==i[r])return!1;return!0}fromArray(e,n=0){for(let i=0;i<9;i++)this.elements[i]=e[i+n];return this}toArray(e=[],n=0){const i=this.elements;return e[n]=i[0],e[n+1]=i[1],e[n+2]=i[2],e[n+3]=i[3],e[n+4]=i[4],e[n+5]=i[5],e[n+6]=i[6],e[n+7]=i[7],e[n+8]=i[8],e}clone(){return new this.constructor().fromArray(this.elements)}}const nf=new ft,y0=new ft().set(.4123908,.3575843,.1804808,.212639,.7151687,.0721923,.0193308,.1191948,.9505322),b0=new ft().set(3.2409699,-1.5373832,-.4986108,-.9692436,1.8759675,.0415551,.0556301,-.203977,1.0569715);function _P(){const t={enabled:!0,workingColorSpace:oa,spaces:{},convert:function(r,s,o){return this.enabled===!1||s===o||!s||!o||(this.spaces[s].transfer===Dt&&(r.r=Or(r.r),r.g=Or(r.g),r.b=Or(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===Dt&&(r.r=Ko(r.r),r.g=Ko(r.g),r.b=Ko(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===fs?ou: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 dl("ColorManagement: .fromWorkingColorSpace() has been renamed to .workingToColorSpace()."),t.workingToColorSpace(r,s)},toWorkingColorSpace:function(r,s){return dl("ColorManagement: .toWorkingColorSpace() has been renamed to .colorSpaceToWorking()."),t.colorSpaceToWorking(r,s)}},e=[.64,.33,.3,.6,.15,.06],n=[.2126,.7152,.0722],i=[.3127,.329];return t.define({[oa]:{primaries:e,whitePoint:i,transfer:ou,toXYZ:y0,fromXYZ:b0,luminanceCoefficients:n,workingColorSpaceConfig:{unpackColorSpace:oi},outputColorSpaceConfig:{drawingBufferColorSpace:oi}},[oi]:{primaries:e,whitePoint:i,transfer:Dt,toXYZ:y0,fromXYZ:b0,luminanceCoefficients:n,outputColorSpaceConfig:{drawingBufferColorSpace:oi}}}),t}const wt=_P();function Or(t){return t<.04045?t*.0773993808:Math.pow(t*.9478672986+.0521327014,2.4)}function Ko(t){return t<.0031308?t*12.92:1.055*Math.pow(t,.41666)-.055}let So;class xP{static getDataURL(e,n="image/png"){if(/^data:/i.test(e.src)||typeof HTMLCanvasElement>"u")return e.src;let i;if(e instanceof HTMLCanvasElement)i=e;else{So===void 0&&(So=lu("canvas")),So.width=e.width,So.height=e.height;const r=So.getContext("2d");e instanceof ImageData?r.putImageData(e,0,0):r.drawImage(e,0,0,e.width,e.height),i=So}return i.toDataURL(n)}static sRGBToLinear(e){if(typeof HTMLImageElement<"u"&&e instanceof HTMLImageElement||typeof HTMLCanvasElement<"u"&&e instanceof HTMLCanvasElement||typeof ImageBitmap<"u"&&e instanceof ImageBitmap){const n=lu("canvas");n.width=e.width,n.height=e.height;const i=n.getContext("2d");i.drawImage(e,0,0,e.width,e.height);const r=i.getImageData(0,0,e.width,e.height),s=r.data;for(let o=0;o1),this.pmremVersion=0}get width(){return this.source.getSize(sf).x}get height(){return this.source.getSize(sf).y}get depth(){return this.source.getSize(sf).z}get image(){return this.source.data}set image(e=null){this.source.data=e}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(e,n){this.updateRanges.push({start:e,count:n})}clearUpdateRanges(){this.updateRanges.length=0}clone(){return new this.constructor().copy(this)}copy(e){return this.name=e.name,this.source=e.source,this.mipmaps=e.mipmaps.slice(0),this.mapping=e.mapping,this.channel=e.channel,this.wrapS=e.wrapS,this.wrapT=e.wrapT,this.magFilter=e.magFilter,this.minFilter=e.minFilter,this.anisotropy=e.anisotropy,this.format=e.format,this.internalFormat=e.internalFormat,this.type=e.type,this.offset.copy(e.offset),this.repeat.copy(e.repeat),this.center.copy(e.center),this.rotation=e.rotation,this.matrixAutoUpdate=e.matrixAutoUpdate,this.matrix.copy(e.matrix),this.generateMipmaps=e.generateMipmaps,this.premultiplyAlpha=e.premultiplyAlpha,this.flipY=e.flipY,this.unpackAlignment=e.unpackAlignment,this.colorSpace=e.colorSpace,this.renderTarget=e.renderTarget,this.isRenderTargetTexture=e.isRenderTargetTexture,this.isArrayTexture=e.isArrayTexture,this.userData=JSON.parse(JSON.stringify(e.userData)),this.needsUpdate=!0,this}setValues(e){for(const n in e){const i=e[n];if(i===void 0){it(`Texture.setValues(): parameter '${n}' has value of undefined.`);continue}const r=this[n];if(r===void 0){it(`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(e){const n=e===void 0||typeof e=="string";if(!n&&e.textures[this.uuid]!==void 0)return e.textures[this.uuid];const i={metadata:{version:4.7,type:"Texture",generator:"Texture.toJSON"},uuid:this.uuid,name:this.name,image:this.source.toJSON(e).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||(e.textures[this.uuid]=i),i}dispose(){this.dispatchEvent({type:"dispose"})}transformUv(e){if(this.mapping!==db)return e;if(e.applyMatrix3(this.matrix),e.x<0||e.x>1)switch(this.wrapS){case Eh:e.x=e.x-Math.floor(e.x);break;case Ir:e.x=e.x<0?0:1;break;case Th:Math.abs(Math.floor(e.x)%2)===1?e.x=Math.ceil(e.x)-e.x:e.x=e.x-Math.floor(e.x);break}if(e.y<0||e.y>1)switch(this.wrapT){case Eh:e.y=e.y-Math.floor(e.y);break;case Ir:e.y=e.y<0?0:1;break;case Th:Math.abs(Math.floor(e.y)%2)===1?e.y=Math.ceil(e.y)-e.y:e.y=e.y-Math.floor(e.y);break}return this.flipY&&(e.y=1-e.y),e}set needsUpdate(e){e===!0&&(this.version++,this.source.needsUpdate=!0)}set needsPMREMUpdate(e){e===!0&&this.pmremVersion++}}Hn.DEFAULT_IMAGE=null;Hn.DEFAULT_MAPPING=db;Hn.DEFAULT_ANISOTROPY=1;class Zt{constructor(e=0,n=0,i=0,r=1){Zt.prototype.isVector4=!0,this.x=e,this.y=n,this.z=i,this.w=r}get width(){return this.z}set width(e){this.z=e}get height(){return this.w}set height(e){this.w=e}set(e,n,i,r){return this.x=e,this.y=n,this.z=i,this.w=r,this}setScalar(e){return this.x=e,this.y=e,this.z=e,this.w=e,this}setX(e){return this.x=e,this}setY(e){return this.y=e,this}setZ(e){return this.z=e,this}setW(e){return this.w=e,this}setComponent(e,n){switch(e){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: "+e)}return this}getComponent(e){switch(e){case 0:return this.x;case 1:return this.y;case 2:return this.z;case 3:return this.w;default:throw new Error("index is out of range: "+e)}}clone(){return new this.constructor(this.x,this.y,this.z,this.w)}copy(e){return this.x=e.x,this.y=e.y,this.z=e.z,this.w=e.w!==void 0?e.w:1,this}add(e){return this.x+=e.x,this.y+=e.y,this.z+=e.z,this.w+=e.w,this}addScalar(e){return this.x+=e,this.y+=e,this.z+=e,this.w+=e,this}addVectors(e,n){return this.x=e.x+n.x,this.y=e.y+n.y,this.z=e.z+n.z,this.w=e.w+n.w,this}addScaledVector(e,n){return this.x+=e.x*n,this.y+=e.y*n,this.z+=e.z*n,this.w+=e.w*n,this}sub(e){return this.x-=e.x,this.y-=e.y,this.z-=e.z,this.w-=e.w,this}subScalar(e){return this.x-=e,this.y-=e,this.z-=e,this.w-=e,this}subVectors(e,n){return this.x=e.x-n.x,this.y=e.y-n.y,this.z=e.z-n.z,this.w=e.w-n.w,this}multiply(e){return this.x*=e.x,this.y*=e.y,this.z*=e.z,this.w*=e.w,this}multiplyScalar(e){return this.x*=e,this.y*=e,this.z*=e,this.w*=e,this}applyMatrix4(e){const n=this.x,i=this.y,r=this.z,s=this.w,o=e.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(e){return this.x/=e.x,this.y/=e.y,this.z/=e.z,this.w/=e.w,this}divideScalar(e){return this.multiplyScalar(1/e)}setAxisAngleFromQuaternion(e){this.w=2*Math.acos(e.w);const n=Math.sqrt(1-e.w*e.w);return n<1e-4?(this.x=1,this.y=0,this.z=0):(this.x=e.x/n,this.y=e.y/n,this.z=e.z/n),this}setAxisAngleFromRotationMatrix(e){let n,i,r,s;const l=e.elements,c=l[0],u=l[4],d=l[8],f=l[1],h=l[5],g=l[9],v=l[2],m=l[6],p=l[10];if(Math.abs(u-f)<.01&&Math.abs(d-v)<.01&&Math.abs(g-m)<.01){if(Math.abs(u+f)<.1&&Math.abs(d+v)<.1&&Math.abs(g+m)<.1&&Math.abs(c+h+p-3)<.1)return this.set(1,0,0,0),this;n=Math.PI;const y=(c+1)/2,x=(h+1)/2,M=(p+1)/2,A=(u+f)/4,P=(d+v)/4,D=(g+m)/4;return y>x&&y>M?y<.01?(i=0,r=.707106781,s=.707106781):(i=Math.sqrt(y),r=A/i,s=P/i):x>M?x<.01?(i=.707106781,r=0,s=.707106781):(r=Math.sqrt(x),i=A/r,s=D/r):M<.01?(i=.707106781,r=.707106781,s=0):(s=Math.sqrt(M),i=P/s,r=D/s),this.set(i,r,s,n),this}let _=Math.sqrt((m-g)*(m-g)+(d-v)*(d-v)+(f-u)*(f-u));return Math.abs(_)<.001&&(_=1),this.x=(m-g)/_,this.y=(d-v)/_,this.z=(f-u)/_,this.w=Math.acos((c+h+p-1)/2),this}setFromMatrixPosition(e){const n=e.elements;return this.x=n[12],this.y=n[13],this.z=n[14],this.w=n[15],this}min(e){return this.x=Math.min(this.x,e.x),this.y=Math.min(this.y,e.y),this.z=Math.min(this.z,e.z),this.w=Math.min(this.w,e.w),this}max(e){return this.x=Math.max(this.x,e.x),this.y=Math.max(this.y,e.y),this.z=Math.max(this.z,e.z),this.w=Math.max(this.w,e.w),this}clamp(e,n){return this.x=ht(this.x,e.x,n.x),this.y=ht(this.y,e.y,n.y),this.z=ht(this.z,e.z,n.z),this.w=ht(this.w,e.w,n.w),this}clampScalar(e,n){return this.x=ht(this.x,e,n),this.y=ht(this.y,e,n),this.z=ht(this.z,e,n),this.w=ht(this.w,e,n),this}clampLength(e,n){const i=this.length();return this.divideScalar(i||1).multiplyScalar(ht(i,e,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(e){return this.x*e.x+this.y*e.y+this.z*e.z+this.w*e.w}lengthSq(){return this.x*this.x+this.y*this.y+this.z*this.z+this.w*this.w}length(){return Math.sqrt(this.x*this.x+this.y*this.y+this.z*this.z+this.w*this.w)}manhattanLength(){return Math.abs(this.x)+Math.abs(this.y)+Math.abs(this.z)+Math.abs(this.w)}normalize(){return this.divideScalar(this.length()||1)}setLength(e){return this.normalize().multiplyScalar(e)}lerp(e,n){return this.x+=(e.x-this.x)*n,this.y+=(e.y-this.y)*n,this.z+=(e.z-this.z)*n,this.w+=(e.w-this.w)*n,this}lerpVectors(e,n,i){return this.x=e.x+(n.x-e.x)*i,this.y=e.y+(n.y-e.y)*i,this.z=e.z+(n.z-e.z)*i,this.w=e.w+(n.w-e.w)*i,this}equals(e){return e.x===this.x&&e.y===this.y&&e.z===this.z&&e.w===this.w}fromArray(e,n=0){return this.x=e[n],this.y=e[n+1],this.z=e[n+2],this.w=e[n+3],this}toArray(e=[],n=0){return e[n]=this.x,e[n+1]=this.y,e[n+2]=this.z,e[n+3]=this.w,e}fromBufferAttribute(e,n){return this.x=e.getX(n),this.y=e.getY(n),this.z=e.getZ(n),this.w=e.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 SP extends fo{constructor(e=1,n=1,i={}){super(),i=Object.assign({generateMipmaps:!1,internalFormat:null,minFilter:Dn,depthBuffer:!0,stencilBuffer:!1,resolveDepthBuffer:!0,resolveStencilBuffer:!0,depthTexture:null,samples:0,count:1,depth:1,multiview:!1},i),this.isRenderTarget=!0,this.width=e,this.height=n,this.depth=i.depth,this.scissor=new Zt(0,0,e,n),this.scissorTest=!1,this.viewport=new Zt(0,0,e,n);const r={width:e,height:n,depth:i.depth},s=new Hn(r);this.textures=[];const o=i.count;for(let a=0;a1);this.dispose()}this.viewport.set(0,0,e,n),this.scissor.set(0,0,e,n)}clone(){return new this.constructor().copy(this)}copy(e){this.width=e.width,this.height=e.height,this.depth=e.depth,this.scissor.copy(e.scissor),this.scissorTest=e.scissorTest,this.viewport.copy(e.viewport),this.textures.length=0;for(let n=0,i=e.textures.length;n=this.min.x&&e.x<=this.max.x&&e.y>=this.min.y&&e.y<=this.max.y&&e.z>=this.min.z&&e.z<=this.max.z}containsBox(e){return this.min.x<=e.min.x&&e.max.x<=this.max.x&&this.min.y<=e.min.y&&e.max.y<=this.max.y&&this.min.z<=e.min.z&&e.max.z<=this.max.z}getParameter(e,n){return n.set((e.x-this.min.x)/(this.max.x-this.min.x),(e.y-this.min.y)/(this.max.y-this.min.y),(e.z-this.min.z)/(this.max.z-this.min.z))}intersectsBox(e){return e.max.x>=this.min.x&&e.min.x<=this.max.x&&e.max.y>=this.min.y&&e.min.y<=this.max.y&&e.max.z>=this.min.z&&e.min.z<=this.max.z}intersectsSphere(e){return this.clampPoint(e.center,wi),wi.distanceToSquared(e.center)<=e.radius*e.radius}intersectsPlane(e){let n,i;return e.normal.x>0?(n=e.normal.x*this.min.x,i=e.normal.x*this.max.x):(n=e.normal.x*this.max.x,i=e.normal.x*this.min.x),e.normal.y>0?(n+=e.normal.y*this.min.y,i+=e.normal.y*this.max.y):(n+=e.normal.y*this.max.y,i+=e.normal.y*this.min.y),e.normal.z>0?(n+=e.normal.z*this.min.z,i+=e.normal.z*this.max.z):(n+=e.normal.z*this.max.z,i+=e.normal.z*this.min.z),n<=-e.constant&&i>=-e.constant}intersectsTriangle(e){if(this.isEmpty())return!1;this.getCenter(wa),Xl.subVectors(this.max,wa),wo.subVectors(e.a,wa),Mo.subVectors(e.b,wa),Eo.subVectors(e.c,wa),ts.subVectors(Mo,wo),ns.subVectors(Eo,Mo),Os.subVectors(wo,Eo);let n=[0,-ts.z,ts.y,0,-ns.z,ns.y,0,-Os.z,Os.y,ts.z,0,-ts.x,ns.z,0,-ns.x,Os.z,0,-Os.x,-ts.y,ts.x,0,-ns.y,ns.x,0,-Os.y,Os.x,0];return!of(n,wo,Mo,Eo,Xl)||(n=[1,0,0,0,1,0,0,0,1],!of(n,wo,Mo,Eo,Xl))?!1:($l.crossVectors(ts,ns),n=[$l.x,$l.y,$l.z],of(n,wo,Mo,Eo,Xl))}clampPoint(e,n){return n.copy(e).clamp(this.min,this.max)}distanceToPoint(e){return this.clampPoint(e,wi).distanceTo(e)}getBoundingSphere(e){return this.isEmpty()?e.makeEmpty():(this.getCenter(e.center),e.radius=this.getSize(wi).length()*.5),e}intersect(e){return this.min.max(e.min),this.max.min(e.max),this.isEmpty()&&this.makeEmpty(),this}union(e){return this.min.min(e.min),this.max.max(e.max),this}applyMatrix4(e){return this.isEmpty()?this:(gr[0].set(this.min.x,this.min.y,this.min.z).applyMatrix4(e),gr[1].set(this.min.x,this.min.y,this.max.z).applyMatrix4(e),gr[2].set(this.min.x,this.max.y,this.min.z).applyMatrix4(e),gr[3].set(this.min.x,this.max.y,this.max.z).applyMatrix4(e),gr[4].set(this.max.x,this.min.y,this.min.z).applyMatrix4(e),gr[5].set(this.max.x,this.min.y,this.max.z).applyMatrix4(e),gr[6].set(this.max.x,this.max.y,this.min.z).applyMatrix4(e),gr[7].set(this.max.x,this.max.y,this.max.z).applyMatrix4(e),this.setFromPoints(gr),this)}translate(e){return this.min.add(e),this.max.add(e),this}equals(e){return e.min.equals(this.min)&&e.max.equals(this.max)}toJSON(){return{min:this.min.toArray(),max:this.max.toArray()}}fromJSON(e){return this.min.fromArray(e.min),this.max.fromArray(e.max),this}}const gr=[new N,new N,new N,new N,new N,new N,new N,new N],wi=new N,ql=new El,wo=new N,Mo=new N,Eo=new N,ts=new N,ns=new N,Os=new N,wa=new N,Xl=new N,$l=new N,Fs=new N;function of(t,e,n,i,r){for(let s=0,o=t.length-3;s<=o;s+=3){Fs.fromArray(t,s);const a=r.x*Math.abs(Fs.x)+r.y*Math.abs(Fs.y)+r.z*Math.abs(Fs.z),l=e.dot(Fs),c=n.dot(Fs),u=i.dot(Fs);if(Math.max(-Math.max(l,c,u),Math.min(l,c,u))>a)return!1}return!0}const MP=new El,Ma=new N,af=new N;class Tl{constructor(e=new N,n=-1){this.isSphere=!0,this.center=e,this.radius=n}set(e,n){return this.center.copy(e),this.radius=n,this}setFromPoints(e,n){const i=this.center;n!==void 0?i.copy(n):MP.setFromPoints(e).getCenter(i);let r=0;for(let s=0,o=e.length;sthis.radius*this.radius&&(n.sub(this.center).normalize(),n.multiplyScalar(this.radius).add(this.center)),n}getBoundingBox(e){return this.isEmpty()?(e.makeEmpty(),e):(e.set(this.center,this.center),e.expandByScalar(this.radius),e)}applyMatrix4(e){return this.center.applyMatrix4(e),this.radius=this.radius*e.getMaxScaleOnAxis(),this}translate(e){return this.center.add(e),this}expandByPoint(e){if(this.isEmpty())return this.center.copy(e),this.radius=0,this;Ma.subVectors(e,this.center);const n=Ma.lengthSq();if(n>this.radius*this.radius){const i=Math.sqrt(n),r=(i-this.radius)*.5;this.center.addScaledVector(Ma,r/i),this.radius+=r}return this}union(e){return e.isEmpty()?this:this.isEmpty()?(this.copy(e),this):(this.center.equals(e.center)===!0?this.radius=Math.max(this.radius,e.radius):(af.subVectors(e.center,this.center).setLength(e.radius),this.expandByPoint(Ma.copy(e.center).add(af)),this.expandByPoint(Ma.copy(e.center).sub(af))),this)}equals(e){return e.center.equals(this.center)&&e.radius===this.radius}clone(){return new this.constructor().copy(this)}toJSON(){return{radius:this.radius,center:this.center.toArray()}}fromJSON(e){return this.radius=e.radius,this.center.fromArray(e.center),this}}const vr=new N,lf=new N,jl=new N,is=new N,cf=new N,Yl=new N,uf=new N;class Al{constructor(e=new N,n=new N(0,0,-1)){this.origin=e,this.direction=n}set(e,n){return this.origin.copy(e),this.direction.copy(n),this}copy(e){return this.origin.copy(e.origin),this.direction.copy(e.direction),this}at(e,n){return n.copy(this.origin).addScaledVector(this.direction,e)}lookAt(e){return this.direction.copy(e).sub(this.origin).normalize(),this}recast(e){return this.origin.copy(this.at(e,vr)),this}closestPointToPoint(e,n){n.subVectors(e,this.origin);const i=n.dot(this.direction);return i<0?n.copy(this.origin):n.copy(this.origin).addScaledVector(this.direction,i)}distanceToPoint(e){return Math.sqrt(this.distanceSqToPoint(e))}distanceSqToPoint(e){const n=vr.subVectors(e,this.origin).dot(this.direction);return n<0?this.origin.distanceToSquared(e):(vr.copy(this.origin).addScaledVector(this.direction,n),vr.distanceToSquared(e))}distanceSqToSegment(e,n,i,r){lf.copy(e).add(n).multiplyScalar(.5),jl.copy(n).sub(e).normalize(),is.copy(this.origin).sub(lf);const s=e.distanceTo(n)*.5,o=-this.direction.dot(jl),a=is.dot(this.direction),l=-is.dot(jl),c=is.lengthSq(),u=Math.abs(1-o*o);let d,f,h,g;if(u>0)if(d=o*l-a,f=o*a-l,g=s*u,d>=0)if(f>=-g)if(f<=g){const v=1/u;d*=v,f*=v,h=d*(d+o*f+2*a)+f*(o*d+f+2*l)+c}else f=s,d=Math.max(0,-(o*f+a)),h=-d*d+f*(f+2*l)+c;else f=-s,d=Math.max(0,-(o*f+a)),h=-d*d+f*(f+2*l)+c;else f<=-g?(d=Math.max(0,-(-o*s+a)),f=d>0?-s:Math.min(Math.max(-s,-l),s),h=-d*d+f*(f+2*l)+c):f<=g?(d=0,f=Math.min(Math.max(-s,-l),s),h=f*(f+2*l)+c):(d=Math.max(0,-(o*s+a)),f=d>0?s:Math.min(Math.max(-s,-l),s),h=-d*d+f*(f+2*l)+c);else f=o>0?-s:s,d=Math.max(0,-(o*f+a)),h=-d*d+f*(f+2*l)+c;return i&&i.copy(this.origin).addScaledVector(this.direction,d),r&&r.copy(lf).addScaledVector(jl,f),h}intersectSphere(e,n){vr.subVectors(e.center,this.origin);const i=vr.dot(this.direction),r=vr.dot(vr)-i*i,s=e.radius*e.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(e){return e.radius<0?!1:this.distanceSqToPoint(e.center)<=e.radius*e.radius}distanceToPlane(e){const n=e.normal.dot(this.direction);if(n===0)return e.distanceToPoint(this.origin)===0?0:null;const i=-(this.origin.dot(e.normal)+e.constant)/n;return i>=0?i:null}intersectPlane(e,n){const i=this.distanceToPlane(e);return i===null?null:this.at(i,n)}intersectsPlane(e){const n=e.distanceToPoint(this.origin);return n===0||e.normal.dot(this.direction)*n<0}intersectBox(e,n){let i,r,s,o,a,l;const c=1/this.direction.x,u=1/this.direction.y,d=1/this.direction.z,f=this.origin;return c>=0?(i=(e.min.x-f.x)*c,r=(e.max.x-f.x)*c):(i=(e.max.x-f.x)*c,r=(e.min.x-f.x)*c),u>=0?(s=(e.min.y-f.y)*u,o=(e.max.y-f.y)*u):(s=(e.max.y-f.y)*u,o=(e.min.y-f.y)*u),i>o||s>r||((s>i||isNaN(i))&&(i=s),(o=0?(a=(e.min.z-f.z)*d,l=(e.max.z-f.z)*d):(a=(e.max.z-f.z)*d,l=(e.min.z-f.z)*d),i>l||a>r)||((a>i||i!==i)&&(i=a),(l=0?i:r,n)}intersectsBox(e){return this.intersectBox(e,vr)!==null}intersectTriangle(e,n,i,r,s){cf.subVectors(n,e),Yl.subVectors(i,e),uf.crossVectors(cf,Yl);let o=this.direction.dot(uf),a;if(o>0){if(r)return null;a=1}else if(o<0)a=-1,o=-o;else return null;is.subVectors(this.origin,e);const l=a*this.direction.dot(Yl.crossVectors(is,Yl));if(l<0)return null;const c=a*this.direction.dot(cf.cross(is));if(c<0||l+c>o)return null;const u=-a*is.dot(uf);return u<0?null:this.at(u/o,s)}applyMatrix4(e){return this.origin.applyMatrix4(e),this.direction.transformDirection(e),this}equals(e){return e.origin.equals(this.origin)&&e.direction.equals(this.direction)}clone(){return new this.constructor().copy(this)}}class yt{constructor(e,n,i,r,s,o,a,l,c,u,d,f,h,g,v,m){yt.prototype.isMatrix4=!0,this.elements=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1],e!==void 0&&this.set(e,n,i,r,s,o,a,l,c,u,d,f,h,g,v,m)}set(e,n,i,r,s,o,a,l,c,u,d,f,h,g,v,m){const p=this.elements;return p[0]=e,p[4]=n,p[8]=i,p[12]=r,p[1]=s,p[5]=o,p[9]=a,p[13]=l,p[2]=c,p[6]=u,p[10]=d,p[14]=f,p[3]=h,p[7]=g,p[11]=v,p[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 yt().fromArray(this.elements)}copy(e){const n=this.elements,i=e.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(e){const n=this.elements,i=e.elements;return n[12]=i[12],n[13]=i[13],n[14]=i[14],this}setFromMatrix3(e){const n=e.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(e,n,i){return this.determinant()===0?(e.set(1,0,0),n.set(0,1,0),i.set(0,0,1),this):(e.setFromMatrixColumn(this,0),n.setFromMatrixColumn(this,1),i.setFromMatrixColumn(this,2),this)}makeBasis(e,n,i){return this.set(e.x,n.x,i.x,0,e.y,n.y,i.y,0,e.z,n.z,i.z,0,0,0,0,1),this}extractRotation(e){if(e.determinant()===0)return this.identity();const n=this.elements,i=e.elements,r=1/To.setFromMatrixColumn(e,0).length(),s=1/To.setFromMatrixColumn(e,1).length(),o=1/To.setFromMatrixColumn(e,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(e){const n=this.elements,i=e.x,r=e.y,s=e.z,o=Math.cos(i),a=Math.sin(i),l=Math.cos(r),c=Math.sin(r),u=Math.cos(s),d=Math.sin(s);if(e.order==="XYZ"){const f=o*u,h=o*d,g=a*u,v=a*d;n[0]=l*u,n[4]=-l*d,n[8]=c,n[1]=h+g*c,n[5]=f-v*c,n[9]=-a*l,n[2]=v-f*c,n[6]=g+h*c,n[10]=o*l}else if(e.order==="YXZ"){const f=l*u,h=l*d,g=c*u,v=c*d;n[0]=f+v*a,n[4]=g*a-h,n[8]=o*c,n[1]=o*d,n[5]=o*u,n[9]=-a,n[2]=h*a-g,n[6]=v+f*a,n[10]=o*l}else if(e.order==="ZXY"){const f=l*u,h=l*d,g=c*u,v=c*d;n[0]=f-v*a,n[4]=-o*d,n[8]=g+h*a,n[1]=h+g*a,n[5]=o*u,n[9]=v-f*a,n[2]=-o*c,n[6]=a,n[10]=o*l}else if(e.order==="ZYX"){const f=o*u,h=o*d,g=a*u,v=a*d;n[0]=l*u,n[4]=g*c-h,n[8]=f*c+v,n[1]=l*d,n[5]=v*c+f,n[9]=h*c-g,n[2]=-c,n[6]=a*l,n[10]=o*l}else if(e.order==="YZX"){const f=o*l,h=o*c,g=a*l,v=a*c;n[0]=l*u,n[4]=v-f*d,n[8]=g*d+h,n[1]=d,n[5]=o*u,n[9]=-a*u,n[2]=-c*u,n[6]=h*d+g,n[10]=f-v*d}else if(e.order==="XZY"){const f=o*l,h=o*c,g=a*l,v=a*c;n[0]=l*u,n[4]=-d,n[8]=c*u,n[1]=f*d+v,n[5]=o*u,n[9]=h*d-g,n[2]=g*d-h,n[6]=a*u,n[10]=v*d+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(e){return this.compose(EP,e,TP)}lookAt(e,n,i){const r=this.elements;return ri.subVectors(e,n),ri.lengthSq()===0&&(ri.z=1),ri.normalize(),rs.crossVectors(i,ri),rs.lengthSq()===0&&(Math.abs(i.z)===1?ri.x+=1e-4:ri.z+=1e-4,ri.normalize(),rs.crossVectors(i,ri)),rs.normalize(),Jl.crossVectors(ri,rs),r[0]=rs.x,r[4]=Jl.x,r[8]=ri.x,r[1]=rs.y,r[5]=Jl.y,r[9]=ri.y,r[2]=rs.z,r[6]=Jl.z,r[10]=ri.z,this}multiply(e){return this.multiplyMatrices(this,e)}premultiply(e){return this.multiplyMatrices(e,this)}multiplyMatrices(e,n){const i=e.elements,r=n.elements,s=this.elements,o=i[0],a=i[4],l=i[8],c=i[12],u=i[1],d=i[5],f=i[9],h=i[13],g=i[2],v=i[6],m=i[10],p=i[14],_=i[3],y=i[7],x=i[11],M=i[15],A=r[0],P=r[4],D=r[8],b=r[12],w=r[1],I=r[5],L=r[9],V=r[13],$=r[2],X=r[6],W=r[10],B=r[14],z=r[3],de=r[7],le=r[11],pe=r[15];return s[0]=o*A+a*w+l*$+c*z,s[4]=o*P+a*I+l*X+c*de,s[8]=o*D+a*L+l*W+c*le,s[12]=o*b+a*V+l*B+c*pe,s[1]=u*A+d*w+f*$+h*z,s[5]=u*P+d*I+f*X+h*de,s[9]=u*D+d*L+f*W+h*le,s[13]=u*b+d*V+f*B+h*pe,s[2]=g*A+v*w+m*$+p*z,s[6]=g*P+v*I+m*X+p*de,s[10]=g*D+v*L+m*W+p*le,s[14]=g*b+v*V+m*B+p*pe,s[3]=_*A+y*w+x*$+M*z,s[7]=_*P+y*I+x*X+M*de,s[11]=_*D+y*L+x*W+M*le,s[15]=_*b+y*V+x*B+M*pe,this}multiplyScalar(e){const n=this.elements;return n[0]*=e,n[4]*=e,n[8]*=e,n[12]*=e,n[1]*=e,n[5]*=e,n[9]*=e,n[13]*=e,n[2]*=e,n[6]*=e,n[10]*=e,n[14]*=e,n[3]*=e,n[7]*=e,n[11]*=e,n[15]*=e,this}determinant(){const e=this.elements,n=e[0],i=e[4],r=e[8],s=e[12],o=e[1],a=e[5],l=e[9],c=e[13],u=e[2],d=e[6],f=e[10],h=e[14],g=e[3],v=e[7],m=e[11],p=e[15],_=l*h-c*f,y=a*h-c*d,x=a*f-l*d,M=o*h-c*u,A=o*f-l*u,P=o*d-a*u;return n*(v*_-m*y+p*x)-i*(g*_-m*M+p*A)+r*(g*y-v*M+p*P)-s*(g*x-v*A+m*P)}transpose(){const e=this.elements;let n;return n=e[1],e[1]=e[4],e[4]=n,n=e[2],e[2]=e[8],e[8]=n,n=e[6],e[6]=e[9],e[9]=n,n=e[3],e[3]=e[12],e[12]=n,n=e[7],e[7]=e[13],e[13]=n,n=e[11],e[11]=e[14],e[14]=n,this}setPosition(e,n,i){const r=this.elements;return e.isVector3?(r[12]=e.x,r[13]=e.y,r[14]=e.z):(r[12]=e,r[13]=n,r[14]=i),this}invert(){const e=this.elements,n=e[0],i=e[1],r=e[2],s=e[3],o=e[4],a=e[5],l=e[6],c=e[7],u=e[8],d=e[9],f=e[10],h=e[11],g=e[12],v=e[13],m=e[14],p=e[15],_=d*m*c-v*f*c+v*l*h-a*m*h-d*l*p+a*f*p,y=g*f*c-u*m*c-g*l*h+o*m*h+u*l*p-o*f*p,x=u*v*c-g*d*c+g*a*h-o*v*h-u*a*p+o*d*p,M=g*d*l-u*v*l-g*a*f+o*v*f+u*a*m-o*d*m,A=n*_+i*y+r*x+s*M;if(A===0)return this.set(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0);const P=1/A;return e[0]=_*P,e[1]=(v*f*s-d*m*s-v*r*h+i*m*h+d*r*p-i*f*p)*P,e[2]=(a*m*s-v*l*s+v*r*c-i*m*c-a*r*p+i*l*p)*P,e[3]=(d*l*s-a*f*s-d*r*c+i*f*c+a*r*h-i*l*h)*P,e[4]=y*P,e[5]=(u*m*s-g*f*s+g*r*h-n*m*h-u*r*p+n*f*p)*P,e[6]=(g*l*s-o*m*s-g*r*c+n*m*c+o*r*p-n*l*p)*P,e[7]=(o*f*s-u*l*s+u*r*c-n*f*c-o*r*h+n*l*h)*P,e[8]=x*P,e[9]=(g*d*s-u*v*s-g*i*h+n*v*h+u*i*p-n*d*p)*P,e[10]=(o*v*s-g*a*s+g*i*c-n*v*c-o*i*p+n*a*p)*P,e[11]=(u*a*s-o*d*s-u*i*c+n*d*c+o*i*h-n*a*h)*P,e[12]=M*P,e[13]=(u*v*r-g*d*r+g*i*f-n*v*f-u*i*m+n*d*m)*P,e[14]=(g*a*r-o*v*r-g*i*l+n*v*l+o*i*m-n*a*m)*P,e[15]=(o*d*r-u*a*r+u*i*l-n*d*l-o*i*f+n*a*f)*P,this}scale(e){const n=this.elements,i=e.x,r=e.y,s=e.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 e=this.elements,n=e[0]*e[0]+e[1]*e[1]+e[2]*e[2],i=e[4]*e[4]+e[5]*e[5]+e[6]*e[6],r=e[8]*e[8]+e[9]*e[9]+e[10]*e[10];return Math.sqrt(Math.max(n,i,r))}makeTranslation(e,n,i){return e.isVector3?this.set(1,0,0,e.x,0,1,0,e.y,0,0,1,e.z,0,0,0,1):this.set(1,0,0,e,0,1,0,n,0,0,1,i,0,0,0,1),this}makeRotationX(e){const n=Math.cos(e),i=Math.sin(e);return this.set(1,0,0,0,0,n,-i,0,0,i,n,0,0,0,0,1),this}makeRotationY(e){const n=Math.cos(e),i=Math.sin(e);return this.set(n,0,i,0,0,1,0,0,-i,0,n,0,0,0,0,1),this}makeRotationZ(e){const n=Math.cos(e),i=Math.sin(e);return this.set(n,-i,0,0,i,n,0,0,0,0,1,0,0,0,0,1),this}makeRotationAxis(e,n){const i=Math.cos(n),r=Math.sin(n),s=1-i,o=e.x,a=e.y,l=e.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(e,n,i){return this.set(e,0,0,0,0,n,0,0,0,0,i,0,0,0,0,1),this}makeShear(e,n,i,r,s,o){return this.set(1,i,s,0,e,1,o,0,n,r,1,0,0,0,0,1),this}compose(e,n,i){const r=this.elements,s=n._x,o=n._y,a=n._z,l=n._w,c=s+s,u=o+o,d=a+a,f=s*c,h=s*u,g=s*d,v=o*u,m=o*d,p=a*d,_=l*c,y=l*u,x=l*d,M=i.x,A=i.y,P=i.z;return r[0]=(1-(v+p))*M,r[1]=(h+x)*M,r[2]=(g-y)*M,r[3]=0,r[4]=(h-x)*A,r[5]=(1-(f+p))*A,r[6]=(m+_)*A,r[7]=0,r[8]=(g+y)*P,r[9]=(m-_)*P,r[10]=(1-(f+v))*P,r[11]=0,r[12]=e.x,r[13]=e.y,r[14]=e.z,r[15]=1,this}decompose(e,n,i){const r=this.elements;if(e.x=r[12],e.y=r[13],e.z=r[14],this.determinant()===0)return i.set(1,1,1),n.identity(),this;let s=To.set(r[0],r[1],r[2]).length();const o=To.set(r[4],r[5],r[6]).length(),a=To.set(r[8],r[9],r[10]).length();this.determinant()<0&&(s=-s),Mi.copy(this);const c=1/s,u=1/o,d=1/a;return Mi.elements[0]*=c,Mi.elements[1]*=c,Mi.elements[2]*=c,Mi.elements[4]*=u,Mi.elements[5]*=u,Mi.elements[6]*=u,Mi.elements[8]*=d,Mi.elements[9]*=d,Mi.elements[10]*=d,n.setFromRotationMatrix(Mi),i.x=s,i.y=o,i.z=a,this}makePerspective(e,n,i,r,s,o,a=Zi,l=!1){const c=this.elements,u=2*s/(n-e),d=2*s/(i-r),f=(n+e)/(n-e),h=(i+r)/(i-r);let g,v;if(l)g=s/(o-s),v=o*s/(o-s);else if(a===Zi)g=-(o+s)/(o-s),v=-2*o*s/(o-s);else if(a===au)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]=d,c[9]=h,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(e,n,i,r,s,o,a=Zi,l=!1){const c=this.elements,u=2/(n-e),d=2/(i-r),f=-(n+e)/(n-e),h=-(i+r)/(i-r);let g,v;if(l)g=1/(o-s),v=o/(o-s);else if(a===Zi)g=-2/(o-s),v=-(o+s)/(o-s);else if(a===au)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]=d,c[9]=0,c[13]=h,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(e){const n=this.elements,i=e.elements;for(let r=0;r<16;r++)if(n[r]!==i[r])return!1;return!0}fromArray(e,n=0){for(let i=0;i<16;i++)this.elements[i]=e[i+n];return this}toArray(e=[],n=0){const i=this.elements;return e[n]=i[0],e[n+1]=i[1],e[n+2]=i[2],e[n+3]=i[3],e[n+4]=i[4],e[n+5]=i[5],e[n+6]=i[6],e[n+7]=i[7],e[n+8]=i[8],e[n+9]=i[9],e[n+10]=i[10],e[n+11]=i[11],e[n+12]=i[12],e[n+13]=i[13],e[n+14]=i[14],e[n+15]=i[15],e}}const To=new N,Mi=new yt,EP=new N(0,0,0),TP=new N(1,1,1),rs=new N,Jl=new N,ri=new N,S0=new yt,w0=new _n;class Oi{constructor(e=0,n=0,i=0,r=Oi.DEFAULT_ORDER){this.isEuler=!0,this._x=e,this._y=n,this._z=i,this._order=r}get x(){return this._x}set x(e){this._x=e,this._onChangeCallback()}get y(){return this._y}set y(e){this._y=e,this._onChangeCallback()}get z(){return this._z}set z(e){this._z=e,this._onChangeCallback()}get order(){return this._order}set order(e){this._order=e,this._onChangeCallback()}set(e,n,i,r=this._order){return this._x=e,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(e){return this._x=e._x,this._y=e._y,this._z=e._z,this._order=e._order,this._onChangeCallback(),this}setFromRotationMatrix(e,n=this._order,i=!0){const r=e.elements,s=r[0],o=r[4],a=r[8],l=r[1],c=r[5],u=r[9],d=r[2],f=r[6],h=r[10];switch(n){case"XYZ":this._y=Math.asin(ht(a,-1,1)),Math.abs(a)<.9999999?(this._x=Math.atan2(-u,h),this._z=Math.atan2(-o,s)):(this._x=Math.atan2(f,c),this._z=0);break;case"YXZ":this._x=Math.asin(-ht(u,-1,1)),Math.abs(u)<.9999999?(this._y=Math.atan2(a,h),this._z=Math.atan2(l,c)):(this._y=Math.atan2(-d,s),this._z=0);break;case"ZXY":this._x=Math.asin(ht(f,-1,1)),Math.abs(f)<.9999999?(this._y=Math.atan2(-d,h),this._z=Math.atan2(-o,c)):(this._y=0,this._z=Math.atan2(l,s));break;case"ZYX":this._y=Math.asin(-ht(d,-1,1)),Math.abs(d)<.9999999?(this._x=Math.atan2(f,h),this._z=Math.atan2(l,s)):(this._x=0,this._z=Math.atan2(-o,c));break;case"YZX":this._z=Math.asin(ht(l,-1,1)),Math.abs(l)<.9999999?(this._x=Math.atan2(-u,c),this._y=Math.atan2(-d,s)):(this._x=0,this._y=Math.atan2(a,h));break;case"XZY":this._z=Math.asin(-ht(o,-1,1)),Math.abs(o)<.9999999?(this._x=Math.atan2(f,c),this._y=Math.atan2(a,s)):(this._x=Math.atan2(-u,h),this._y=0);break;default:it("Euler: .setFromRotationMatrix() encountered an unknown order: "+n)}return this._order=n,i===!0&&this._onChangeCallback(),this}setFromQuaternion(e,n,i){return S0.makeRotationFromQuaternion(e),this.setFromRotationMatrix(S0,n,i)}setFromVector3(e,n=this._order){return this.set(e.x,e.y,e.z,n)}reorder(e){return w0.setFromEuler(this),this.setFromQuaternion(w0,e)}equals(e){return e._x===this._x&&e._y===this._y&&e._z===this._z&&e._order===this._order}fromArray(e){return this._x=e[0],this._y=e[1],this._z=e[2],e[3]!==void 0&&(this._order=e[3]),this._onChangeCallback(),this}toArray(e=[],n=0){return e[n]=this._x,e[n+1]=this._y,e[n+2]=this._z,e[n+3]=this._order,e}_onChange(e){return this._onChangeCallback=e,this}_onChangeCallback(){}*[Symbol.iterator](){yield this._x,yield this._y,yield this._z,yield this._order}}Oi.DEFAULT_ORDER="XYZ";class lm{constructor(){this.mask=1}set(e){this.mask=(1<>>0}enable(e){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(e),r.indirectTexture=this._indirectTexture.toJSON(e),this._colorsTexture!==null&&(r.colorsTexture=this._colorsTexture.toJSON(e)),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(e)),l.uuid}if(this.isScene)this.background&&(this.background.isColor?r.background=this.background.toJSON():this.background.isTexture&&(r.background=this.background.toJSON(e).uuid)),this.environment&&this.environment.isTexture&&this.environment.isRenderTargetTexture!==!0&&(r.environment=this.environment.toJSON(e).uuid);else if(this.isMesh||this.isLine||this.isPoints){r.geometry=s(e.geometries,this.geometry);const a=this.geometry.parameters;if(a!==void 0&&a.shapes!==void 0){const l=a.shapes;if(Array.isArray(l))for(let c=0,u=l.length;c0){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),d.length>0&&(i.shapes=d),f.length>0&&(i.skeletons=f),h.length>0&&(i.animations=h),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(e){return new this.constructor().copy(this,e)}copy(e,n=!0){if(this.name=e.name,this.up.copy(e.up),this.position.copy(e.position),this.rotation.order=e.rotation.order,this.quaternion.copy(e.quaternion),this.scale.copy(e.scale),this.matrix.copy(e.matrix),this.matrixWorld.copy(e.matrixWorld),this.matrixAutoUpdate=e.matrixAutoUpdate,this.matrixWorldAutoUpdate=e.matrixWorldAutoUpdate,this.matrixWorldNeedsUpdate=e.matrixWorldNeedsUpdate,this.layers.mask=e.layers.mask,this.visible=e.visible,this.castShadow=e.castShadow,this.receiveShadow=e.receiveShadow,this.frustumCulled=e.frustumCulled,this.renderOrder=e.renderOrder,this.animations=e.animations.slice(),this.userData=JSON.parse(JSON.stringify(e.userData)),n===!0)for(let i=0;i0?r.multiplyScalar(1/Math.sqrt(s)):r.set(0,0,0)}static getBarycoord(e,n,i,r,s){Ei.subVectors(r,n),xr.subVectors(i,n),ff.subVectors(e,n);const o=Ei.dot(Ei),a=Ei.dot(xr),l=Ei.dot(ff),c=xr.dot(xr),u=xr.dot(ff),d=o*c-a*a;if(d===0)return s.set(0,0,0),null;const f=1/d,h=(c*l-a*u)*f,g=(o*u-a*l)*f;return s.set(1-h-g,g,h)}static containsPoint(e,n,i,r){return this.getBarycoord(e,n,i,r,yr)===null?!1:yr.x>=0&&yr.y>=0&&yr.x+yr.y<=1}static getInterpolation(e,n,i,r,s,o,a,l){return this.getBarycoord(e,n,i,r,yr)===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,yr.x),l.addScaledVector(o,yr.y),l.addScaledVector(a,yr.z),l)}static getInterpolatedAttribute(e,n,i,r,s,o){return gf.setScalar(0),vf.setScalar(0),_f.setScalar(0),gf.fromBufferAttribute(e,n),vf.fromBufferAttribute(e,i),_f.fromBufferAttribute(e,r),o.setScalar(0),o.addScaledVector(gf,s.x),o.addScaledVector(vf,s.y),o.addScaledVector(_f,s.z),o}static isFrontFacing(e,n,i,r){return Ei.subVectors(i,n),xr.subVectors(e,n),Ei.cross(xr).dot(r)<0}set(e,n,i){return this.a.copy(e),this.b.copy(n),this.c.copy(i),this}setFromPointsAndIndices(e,n,i,r){return this.a.copy(e[n]),this.b.copy(e[i]),this.c.copy(e[r]),this}setFromAttributeAndIndices(e,n,i,r){return this.a.fromBufferAttribute(e,n),this.b.fromBufferAttribute(e,i),this.c.fromBufferAttribute(e,r),this}clone(){return new this.constructor().copy(this)}copy(e){return this.a.copy(e.a),this.b.copy(e.b),this.c.copy(e.c),this}getArea(){return Ei.subVectors(this.c,this.b),xr.subVectors(this.a,this.b),Ei.cross(xr).length()*.5}getMidpoint(e){return e.addVectors(this.a,this.b).add(this.c).multiplyScalar(1/3)}getNormal(e){return xi.getNormal(this.a,this.b,this.c,e)}getPlane(e){return e.setFromCoplanarPoints(this.a,this.b,this.c)}getBarycoord(e,n){return xi.getBarycoord(e,this.a,this.b,this.c,n)}getInterpolation(e,n,i,r,s){return xi.getInterpolation(e,this.a,this.b,this.c,n,i,r,s)}containsPoint(e){return xi.containsPoint(e,this.a,this.b,this.c)}isFrontFacing(e){return xi.isFrontFacing(this.a,this.b,this.c,e)}intersectsBox(e){return e.intersectsTriangle(this)}closestPointToPoint(e,n){const i=this.a,r=this.b,s=this.c;let o,a;Po.subVectors(r,i),Ro.subVectors(s,i),hf.subVectors(e,i);const l=Po.dot(hf),c=Ro.dot(hf);if(l<=0&&c<=0)return n.copy(i);pf.subVectors(e,r);const u=Po.dot(pf),d=Ro.dot(pf);if(u>=0&&d<=u)return n.copy(r);const f=l*d-u*c;if(f<=0&&l>=0&&u<=0)return o=l/(l-u),n.copy(i).addScaledVector(Po,o);mf.subVectors(e,s);const h=Po.dot(mf),g=Ro.dot(mf);if(g>=0&&h<=g)return n.copy(s);const v=h*c-l*g;if(v<=0&&c>=0&&g<=0)return a=c/(c-g),n.copy(i).addScaledVector(Ro,a);const m=u*g-h*d;if(m<=0&&d-u>=0&&h-g>=0)return P0.subVectors(s,r),a=(d-u)/(d-u+(h-g)),n.copy(r).addScaledVector(P0,a);const p=1/(m+v+f);return o=v*p,a=f*p,n.copy(i).addScaledVector(Po,o).addScaledVector(Ro,a)}equals(e){return e.a.equals(this.a)&&e.b.equals(this.b)&&e.c.equals(this.c)}}const Sb={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},ss={h:0,s:0,l:0},Zl={h:0,s:0,l:0};function xf(t,e,n){return n<0&&(n+=1),n>1&&(n-=1),n<1/6?t+(e-t)*6*n:n<1/2?e:n<2/3?t+(e-t)*6*(2/3-n):t}class nt{constructor(e,n,i){return this.isColor=!0,this.r=1,this.g=1,this.b=1,this.set(e,n,i)}set(e,n,i){if(n===void 0&&i===void 0){const r=e;r&&r.isColor?this.copy(r):typeof r=="number"?this.setHex(r):typeof r=="string"&&this.setStyle(r)}else this.setRGB(e,n,i);return this}setScalar(e){return this.r=e,this.g=e,this.b=e,this}setHex(e,n=oi){return e=Math.floor(e),this.r=(e>>16&255)/255,this.g=(e>>8&255)/255,this.b=(e&255)/255,wt.colorSpaceToWorking(this,n),this}setRGB(e,n,i,r=wt.workingColorSpace){return this.r=e,this.g=n,this.b=i,wt.colorSpaceToWorking(this,r),this}setHSL(e,n,i,r=wt.workingColorSpace){if(e=om(e,1),n=ht(n,0,1),i=ht(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=xf(o,s,e+1/3),this.g=xf(o,s,e),this.b=xf(o,s,e-1/3)}return wt.colorSpaceToWorking(this,r),this}setStyle(e,n=oi){function i(s){s!==void 0&&parseFloat(s)<1&&it("Color: Alpha component of "+e+" will be ignored.")}let r;if(r=/^(\w+)\(([^\)]*)\)/.exec(e)){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:it("Color: Unknown color model "+e)}}else if(r=/^\#([A-Fa-f\d]+)$/.exec(e)){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);it("Color: Invalid hex color "+e)}else if(e&&e.length>0)return this.setColorName(e,n);return this}setColorName(e,n=oi){const i=Sb[e.toLowerCase()];return i!==void 0?this.setHex(i,n):it("Color: Unknown color "+e),this}clone(){return new this.constructor(this.r,this.g,this.b)}copy(e){return this.r=e.r,this.g=e.g,this.b=e.b,this}copySRGBToLinear(e){return this.r=Or(e.r),this.g=Or(e.g),this.b=Or(e.b),this}copyLinearToSRGB(e){return this.r=Ko(e.r),this.g=Ko(e.g),this.b=Ko(e.b),this}convertSRGBToLinear(){return this.copySRGBToLinear(this),this}convertLinearToSRGB(){return this.copyLinearToSRGB(this),this}getHex(e=oi){return wt.workingToColorSpace(En.copy(this),e),Math.round(ht(En.r*255,0,255))*65536+Math.round(ht(En.g*255,0,255))*256+Math.round(ht(En.b*255,0,255))}getHexString(e=oi){return("000000"+this.getHex(e).toString(16)).slice(-6)}getHSL(e,n=wt.workingColorSpace){wt.workingToColorSpace(En.copy(this),n);const i=En.r,r=En.g,s=En.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 d=o-a;switch(c=u<=.5?d/(o+a):d/(2-o-a),o){case i:l=(r-s)/d+(r0!=e>0&&this.version++,this._alphaTest=e}onBeforeRender(){}onBeforeCompile(){}customProgramCacheKey(){return this.onBeforeCompile.toString()}setValues(e){if(e!==void 0)for(const n in e){const i=e[n];if(i===void 0){it(`Material: parameter '${n}' has value of undefined.`);continue}const r=this[n];if(r===void 0){it(`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(e){const n=e===void 0||typeof e=="string";n&&(e={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(e).uuid),this.clearcoatRoughnessMap&&this.clearcoatRoughnessMap.isTexture&&(i.clearcoatRoughnessMap=this.clearcoatRoughnessMap.toJSON(e).uuid),this.clearcoatNormalMap&&this.clearcoatNormalMap.isTexture&&(i.clearcoatNormalMap=this.clearcoatNormalMap.toJSON(e).uuid,i.clearcoatNormalScale=this.clearcoatNormalScale.toArray()),this.sheenColorMap&&this.sheenColorMap.isTexture&&(i.sheenColorMap=this.sheenColorMap.toJSON(e).uuid),this.sheenRoughnessMap&&this.sheenRoughnessMap.isTexture&&(i.sheenRoughnessMap=this.sheenRoughnessMap.toJSON(e).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(e).uuid),this.iridescenceThicknessMap&&this.iridescenceThicknessMap.isTexture&&(i.iridescenceThicknessMap=this.iridescenceThicknessMap.toJSON(e).uuid),this.anisotropy!==void 0&&(i.anisotropy=this.anisotropy),this.anisotropyRotation!==void 0&&(i.anisotropyRotation=this.anisotropyRotation),this.anisotropyMap&&this.anisotropyMap.isTexture&&(i.anisotropyMap=this.anisotropyMap.toJSON(e).uuid),this.map&&this.map.isTexture&&(i.map=this.map.toJSON(e).uuid),this.matcap&&this.matcap.isTexture&&(i.matcap=this.matcap.toJSON(e).uuid),this.alphaMap&&this.alphaMap.isTexture&&(i.alphaMap=this.alphaMap.toJSON(e).uuid),this.lightMap&&this.lightMap.isTexture&&(i.lightMap=this.lightMap.toJSON(e).uuid,i.lightMapIntensity=this.lightMapIntensity),this.aoMap&&this.aoMap.isTexture&&(i.aoMap=this.aoMap.toJSON(e).uuid,i.aoMapIntensity=this.aoMapIntensity),this.bumpMap&&this.bumpMap.isTexture&&(i.bumpMap=this.bumpMap.toJSON(e).uuid,i.bumpScale=this.bumpScale),this.normalMap&&this.normalMap.isTexture&&(i.normalMap=this.normalMap.toJSON(e).uuid,i.normalMapType=this.normalMapType,i.normalScale=this.normalScale.toArray()),this.displacementMap&&this.displacementMap.isTexture&&(i.displacementMap=this.displacementMap.toJSON(e).uuid,i.displacementScale=this.displacementScale,i.displacementBias=this.displacementBias),this.roughnessMap&&this.roughnessMap.isTexture&&(i.roughnessMap=this.roughnessMap.toJSON(e).uuid),this.metalnessMap&&this.metalnessMap.isTexture&&(i.metalnessMap=this.metalnessMap.toJSON(e).uuid),this.emissiveMap&&this.emissiveMap.isTexture&&(i.emissiveMap=this.emissiveMap.toJSON(e).uuid),this.specularMap&&this.specularMap.isTexture&&(i.specularMap=this.specularMap.toJSON(e).uuid),this.specularIntensityMap&&this.specularIntensityMap.isTexture&&(i.specularIntensityMap=this.specularIntensityMap.toJSON(e).uuid),this.specularColorMap&&this.specularColorMap.isTexture&&(i.specularColorMap=this.specularColorMap.toJSON(e).uuid),this.envMap&&this.envMap.isTexture&&(i.envMap=this.envMap.toJSON(e).uuid,this.combine!==void 0&&(i.combine=this.combine)),this.envMapRotation!==void 0&&(i.envMapRotation=this.envMapRotation.toArray()),this.envMapIntensity!==void 0&&(i.envMapIntensity=this.envMapIntensity),this.reflectivity!==void 0&&(i.reflectivity=this.reflectivity),this.refractionRatio!==void 0&&(i.refractionRatio=this.refractionRatio),this.gradientMap&&this.gradientMap.isTexture&&(i.gradientMap=this.gradientMap.toJSON(e).uuid),this.transmission!==void 0&&(i.transmission=this.transmission),this.transmissionMap&&this.transmissionMap.isTexture&&(i.transmissionMap=this.transmissionMap.toJSON(e).uuid),this.thickness!==void 0&&(i.thickness=this.thickness),this.thicknessMap&&this.thicknessMap.isTexture&&(i.thicknessMap=this.thicknessMap.toJSON(e).uuid),this.attenuationDistance!==void 0&&this.attenuationDistance!==1/0&&(i.attenuationDistance=this.attenuationDistance),this.attenuationColor!==void 0&&(i.attenuationColor=this.attenuationColor.getHex()),this.size!==void 0&&(i.size=this.size),this.shadowSide!==null&&(i.shadowSide=this.shadowSide),this.sizeAttenuation!==void 0&&(i.sizeAttenuation=this.sizeAttenuation),this.blending!==Yo&&(i.blending=this.blending),this.side!==ys&&(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!==ph&&(i.blendSrc=this.blendSrc),this.blendDst!==mh&&(i.blendDst=this.blendDst),this.blendEquation!==$s&&(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!==ia&&(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!==h0&&(i.stencilFunc=this.stencilFunc),this.stencilRef!==0&&(i.stencilRef=this.stencilRef),this.stencilFuncMask!==255&&(i.stencilFuncMask=this.stencilFuncMask),this.stencilFail!==bo&&(i.stencilFail=this.stencilFail),this.stencilZFail!==bo&&(i.stencilZFail=this.stencilZFail),this.stencilZPass!==bo&&(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(e.textures),o=r(e.images);s.length>0&&(i.textures=s),o.length>0&&(i.images=o)}return i}clone(){return new this.constructor().copy(this)}copy(e){this.name=e.name,this.blending=e.blending,this.side=e.side,this.vertexColors=e.vertexColors,this.opacity=e.opacity,this.transparent=e.transparent,this.blendSrc=e.blendSrc,this.blendDst=e.blendDst,this.blendEquation=e.blendEquation,this.blendSrcAlpha=e.blendSrcAlpha,this.blendDstAlpha=e.blendDstAlpha,this.blendEquationAlpha=e.blendEquationAlpha,this.blendColor.copy(e.blendColor),this.blendAlpha=e.blendAlpha,this.depthFunc=e.depthFunc,this.depthTest=e.depthTest,this.depthWrite=e.depthWrite,this.stencilWriteMask=e.stencilWriteMask,this.stencilFunc=e.stencilFunc,this.stencilRef=e.stencilRef,this.stencilFuncMask=e.stencilFuncMask,this.stencilFail=e.stencilFail,this.stencilZFail=e.stencilZFail,this.stencilZPass=e.stencilZPass,this.stencilWrite=e.stencilWrite;const n=e.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=e.clipIntersection,this.clipShadows=e.clipShadows,this.shadowSide=e.shadowSide,this.colorWrite=e.colorWrite,this.precision=e.precision,this.polygonOffset=e.polygonOffset,this.polygonOffsetFactor=e.polygonOffsetFactor,this.polygonOffsetUnits=e.polygonOffsetUnits,this.dithering=e.dithering,this.alphaTest=e.alphaTest,this.alphaHash=e.alphaHash,this.alphaToCoverage=e.alphaToCoverage,this.premultipliedAlpha=e.premultipliedAlpha,this.forceSinglePass=e.forceSinglePass,this.allowOverride=e.allowOverride,this.visible=e.visible,this.toneMapped=e.toneMapped,this.userData=JSON.parse(JSON.stringify(e.userData)),this}dispose(){this.dispatchEvent({type:"dispose"})}set needsUpdate(e){e===!0&&this.version++}}class Ms extends po{constructor(e){super(),this.isMeshBasicMaterial=!0,this.type="MeshBasicMaterial",this.color=new nt(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 Oi,this.combine=rb,this.reflectivity=1,this.refractionRatio=.98,this.wireframe=!1,this.wireframeLinewidth=1,this.wireframeLinecap="round",this.wireframeLinejoin="round",this.fog=!0,this.setValues(e)}copy(e){return super.copy(e),this.color.copy(e.color),this.map=e.map,this.lightMap=e.lightMap,this.lightMapIntensity=e.lightMapIntensity,this.aoMap=e.aoMap,this.aoMapIntensity=e.aoMapIntensity,this.specularMap=e.specularMap,this.alphaMap=e.alphaMap,this.envMap=e.envMap,this.envMapRotation.copy(e.envMapRotation),this.combine=e.combine,this.reflectivity=e.reflectivity,this.refractionRatio=e.refractionRatio,this.wireframe=e.wireframe,this.wireframeLinewidth=e.wireframeLinewidth,this.wireframeLinecap=e.wireframeLinecap,this.wireframeLinejoin=e.wireframeLinejoin,this.fog=e.fog,this}}const on=new N,Ql=new xe;let IP=0;class Gn{constructor(e,n,i=!1){if(Array.isArray(e))throw new TypeError("THREE.BufferAttribute: array should be a Typed Array.");this.isBufferAttribute=!0,Object.defineProperty(this,"id",{value:IP++}),this.name="",this.array=e,this.itemSize=n,this.count=e!==void 0?e.length/n:0,this.normalized=i,this.usage=p0,this.updateRanges=[],this.gpuType=Ki,this.version=0}onUploadCallback(){}set needsUpdate(e){e===!0&&this.version++}setUsage(e){return this.usage=e,this}addUpdateRange(e,n){this.updateRanges.push({start:e,count:n})}clearUpdateRanges(){this.updateRanges.length=0}copy(e){return this.name=e.name,this.array=new e.array.constructor(e.array),this.itemSize=e.itemSize,this.count=e.count,this.normalized=e.normalized,this.usage=e.usage,this.gpuType=e.gpuType,this}copyAt(e,n,i){e*=this.itemSize,i*=n.itemSize;for(let r=0,s=this.itemSize;rn.count&&it("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 El);const e=this.attributes.position,n=this.morphAttributes.position;if(e&&e.isGLBufferAttribute){bt("BufferGeometry.computeBoundingBox(): GLBufferAttribute requires a manual bounding box.",this),this.boundingBox.set(new N(-1/0,-1/0,-1/0),new N(1/0,1/0,1/0));return}if(e!==void 0){if(this.boundingBox.setFromBufferAttribute(e),n)for(let i=0,r=n.length;i0&&(e.userData=this.userData),this.parameters!==void 0){const l=this.parameters;for(const c in l)l[c]!==void 0&&(e[c]=l[c]);return e}e.data={attributes:{}};const n=this.index;n!==null&&(e.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];e.data.attributes[l]=c.toJSON(e.data)}const r={};let s=!1;for(const l in this.morphAttributes){const c=this.morphAttributes[l],u=[];for(let d=0,f=c.length;d0&&(r[l]=u,s=!0)}s&&(e.data.morphAttributes=r,e.data.morphTargetsRelative=this.morphTargetsRelative);const o=this.groups;o.length>0&&(e.data.groups=JSON.parse(JSON.stringify(o)));const a=this.boundingSphere;return a!==null&&(e.data.boundingSphere=a.toJSON()),e}clone(){return new this.constructor().copy(this)}copy(e){this.index=null,this.attributes={},this.morphAttributes={},this.groups=[],this.boundingBox=null,this.boundingSphere=null;const n={};this.name=e.name;const i=e.index;i!==null&&this.setIndex(i.clone());const r=e.attributes;for(const c in r){const u=r[c];this.setAttribute(c,u.clone(n))}const s=e.morphAttributes;for(const c in s){const u=[],d=s[c];for(let f=0,h=d.length;f0){const r=n[i[0]];if(r!==void 0){this.morphTargetInfluences=[],this.morphTargetDictionary={};for(let s=0,o=r.length;s(e.far-e.near)**2))&&(R0.copy(s).invert(),Us.copy(e.ray).applyMatrix4(R0),!(i.boundingBox!==null&&Us.intersectsBox(i.boundingBox)===!1)&&this._computeIntersections(e,n,Us)))}_computeIntersections(e,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,d=s.attributes.normal,f=s.groups,h=s.drawRange;if(a!==null)if(Array.isArray(o))for(let g=0,v=f.length;gn.far?null:{distance:c,point:sc.clone(),object:t}}function oc(t,e,n,i,r,s,o,a,l,c){t.getVertexPosition(a,tc),t.getVertexPosition(l,nc),t.getVertexPosition(c,ic);const u=LP(t,e,n,i,tc,nc,ic,I0);if(u){const d=new N;xi.getBarycoord(I0,tc,nc,ic,d),r&&(u.uv=xi.getInterpolatedAttribute(r,a,l,c,d,new xe)),s&&(u.uv1=xi.getInterpolatedAttribute(s,a,l,c,d,new xe)),o&&(u.normal=xi.getInterpolatedAttribute(o,a,l,c,d,new N),u.normal.dot(i.direction)>0&&u.normal.multiplyScalar(-1));const f={a,b:l,c,normal:new N,materialIndex:0};xi.getNormal(tc,nc,ic,f.normal),u.face=f,u.barycoord=d}return u}class Jt extends _t{constructor(e=1,n=1,i=1,r=1,s=1,o=1){super(),this.type="BoxGeometry",this.parameters={width:e,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=[],d=[];let f=0,h=0;g("z","y","x",-1,-1,i,n,e,o,s,0),g("z","y","x",1,-1,i,n,-e,o,s,1),g("x","z","y",1,1,e,i,n,r,o,2),g("x","z","y",1,-1,e,i,-n,r,o,3),g("x","y","z",1,-1,e,n,i,r,s,4),g("x","y","z",-1,-1,e,n,-i,r,s,5),this.setIndex(l),this.setAttribute("position",new ct(c,3)),this.setAttribute("normal",new ct(u,3)),this.setAttribute("uv",new ct(d,2));function g(v,m,p,_,y,x,M,A,P,D,b){const w=x/P,I=M/D,L=x/2,V=M/2,$=A/2,X=P+1,W=D+1;let B=0,z=0;const de=new N;for(let le=0;le0?1:-1,u.push(de.x,de.y,de.z),d.push(He/P),d.push(1-le/D),B+=1}}for(let le=0;leh+g?(c.inputState.pinching=!1,this.dispatchEvent({type:"pinchend",handedness:e.handedness,target:this})):!c.inputState.pinching&&f<=h-g&&(c.inputState.pinching=!0,this.dispatchEvent({type:"pinchstart",handedness:e.handedness,target:this}))}else l!==null&&e.gripSpace&&(s=n.getPose(e.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(e.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(BP)))}return a!==null&&(a.visible=r!==null),l!==null&&(l.visible=s!==null),c!==null&&(c.visible=o!==null),this}_getHandJoint(e,n){if(e.joints[n.jointName]===void 0){const i=new ac;i.matrixAutoUpdate=!1,i.visible=!1,e.joints[n.jointName]=i,e.add(i)}return e.joints[n.jointName]}}class zP extends Ft{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 Oi,this.environmentIntensity=1,this.environmentRotation=new Oi,this.overrideMaterial=null,typeof __THREE_DEVTOOLS__<"u"&&__THREE_DEVTOOLS__.dispatchEvent(new CustomEvent("observe",{detail:this}))}copy(e,n){return super.copy(e,n),e.background!==null&&(this.background=e.background.clone()),e.environment!==null&&(this.environment=e.environment.clone()),e.fog!==null&&(this.fog=e.fog.clone()),this.backgroundBlurriness=e.backgroundBlurriness,this.backgroundIntensity=e.backgroundIntensity,this.backgroundRotation.copy(e.backgroundRotation),this.environmentIntensity=e.environmentIntensity,this.environmentRotation.copy(e.environmentRotation),e.overrideMaterial!==null&&(this.overrideMaterial=e.overrideMaterial.clone()),this.matrixAutoUpdate=e.matrixAutoUpdate,this}toJSON(e){const n=super.toJSON(e);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 VP extends Hn{constructor(e=null,n=1,i=1,r,s,o,a,l,c=Sn,u=Sn,d,f){super(null,o,a,l,c,u,r,s,d,f),this.isDataTexture=!0,this.image={data:e,width:n,height:i},this.generateMipmaps=!1,this.flipY=!1,this.unpackAlignment=1}}const wf=new N,HP=new N,GP=new ft;let Mr=class{constructor(e=new N(1,0,0),n=0){this.isPlane=!0,this.normal=e,this.constant=n}set(e,n){return this.normal.copy(e),this.constant=n,this}setComponents(e,n,i,r){return this.normal.set(e,n,i),this.constant=r,this}setFromNormalAndCoplanarPoint(e,n){return this.normal.copy(e),this.constant=-n.dot(this.normal),this}setFromCoplanarPoints(e,n,i){const r=wf.subVectors(i,n).cross(HP.subVectors(e,n)).normalize();return this.setFromNormalAndCoplanarPoint(r,e),this}copy(e){return this.normal.copy(e.normal),this.constant=e.constant,this}normalize(){const e=1/this.normal.length();return this.normal.multiplyScalar(e),this.constant*=e,this}negate(){return this.constant*=-1,this.normal.negate(),this}distanceToPoint(e){return this.normal.dot(e)+this.constant}distanceToSphere(e){return this.distanceToPoint(e.center)-e.radius}projectPoint(e,n){return n.copy(e).addScaledVector(this.normal,-this.distanceToPoint(e))}intersectLine(e,n){const i=e.delta(wf),r=this.normal.dot(i);if(r===0)return this.distanceToPoint(e.start)===0?n.copy(e.start):null;const s=-(e.start.dot(this.normal)+this.constant)/r;return s<0||s>1?null:n.copy(e.start).addScaledVector(i,s)}intersectsLine(e){const n=this.distanceToPoint(e.start),i=this.distanceToPoint(e.end);return n<0&&i>0||i<0&&n>0}intersectsBox(e){return e.intersectsPlane(this)}intersectsSphere(e){return e.intersectsPlane(this)}coplanarPoint(e){return e.copy(this.normal).multiplyScalar(-this.constant)}applyMatrix4(e,n){const i=n||GP.getNormalMatrix(e),r=this.coplanarPoint(wf).applyMatrix4(e),s=this.normal.applyMatrix3(i).normalize();return this.constant=-r.dot(s),this}translate(e){return this.constant-=e.dot(this.normal),this}equals(e){return e.normal.equals(this.normal)&&e.constant===this.constant}clone(){return new this.constructor().copy(this)}};const ks=new Tl,WP=new xe(.5,.5),lc=new N;class cm{constructor(e=new Mr,n=new Mr,i=new Mr,r=new Mr,s=new Mr,o=new Mr){this.planes=[e,n,i,r,s,o]}set(e,n,i,r,s,o){const a=this.planes;return a[0].copy(e),a[1].copy(n),a[2].copy(i),a[3].copy(r),a[4].copy(s),a[5].copy(o),this}copy(e){const n=this.planes;for(let i=0;i<6;i++)n[i].copy(e.planes[i]);return this}setFromProjectionMatrix(e,n=Zi,i=!1){const r=this.planes,s=e.elements,o=s[0],a=s[1],l=s[2],c=s[3],u=s[4],d=s[5],f=s[6],h=s[7],g=s[8],v=s[9],m=s[10],p=s[11],_=s[12],y=s[13],x=s[14],M=s[15];if(r[0].setComponents(c-o,h-u,p-g,M-_).normalize(),r[1].setComponents(c+o,h+u,p+g,M+_).normalize(),r[2].setComponents(c+a,h+d,p+v,M+y).normalize(),r[3].setComponents(c-a,h-d,p-v,M-y).normalize(),i)r[4].setComponents(l,f,m,x).normalize(),r[5].setComponents(c-l,h-f,p-m,M-x).normalize();else if(r[4].setComponents(c-l,h-f,p-m,M-x).normalize(),n===Zi)r[5].setComponents(c+l,h+f,p+m,M+x).normalize();else if(n===au)r[5].setComponents(l,f,m,x).normalize();else throw new Error("THREE.Frustum.setFromProjectionMatrix(): Invalid coordinate system: "+n);return this}intersectsObject(e){if(e.boundingSphere!==void 0)e.boundingSphere===null&&e.computeBoundingSphere(),ks.copy(e.boundingSphere).applyMatrix4(e.matrixWorld);else{const n=e.geometry;n.boundingSphere===null&&n.computeBoundingSphere(),ks.copy(n.boundingSphere).applyMatrix4(e.matrixWorld)}return this.intersectsSphere(ks)}intersectsSprite(e){ks.center.set(0,0,0);const n=WP.distanceTo(e.center);return ks.radius=.7071067811865476+n,ks.applyMatrix4(e.matrixWorld),this.intersectsSphere(ks)}intersectsSphere(e){const n=this.planes,i=e.center,r=-e.radius;for(let s=0;s<6;s++)if(n[s].distanceToPoint(i)0?e.max.x:e.min.x,lc.y=r.normal.y>0?e.max.y:e.min.y,lc.z=r.normal.z>0?e.max.z:e.min.z,r.distanceToPoint(lc)<0)return!1}return!0}containsPoint(e){const n=this.planes;for(let i=0;i<6;i++)if(n[i].distanceToPoint(e)<0)return!1;return!0}clone(){return new this.constructor().copy(this)}}class Si extends po{constructor(e){super(),this.isLineBasicMaterial=!0,this.type="LineBasicMaterial",this.color=new nt(16777215),this.map=null,this.linewidth=1,this.linecap="round",this.linejoin="round",this.fog=!0,this.setValues(e)}copy(e){return super.copy(e),this.color.copy(e.color),this.map=e.map,this.linewidth=e.linewidth,this.linecap=e.linecap,this.linejoin=e.linejoin,this.fog=e.fog,this}}const cu=new N,uu=new N,O0=new yt,Aa=new Al,cc=new Tl,Mf=new N,F0=new N;class vn extends Ft{constructor(e=new _t,n=new Si){super(),this.isLine=!0,this.type="Line",this.geometry=e,this.material=n,this.morphTargetDictionary=void 0,this.morphTargetInfluences=void 0,this.updateMorphTargets()}copy(e,n){return super.copy(e,n),this.material=Array.isArray(e.material)?e.material.slice():e.material,this.geometry=e.geometry,this}computeLineDistances(){const e=this.geometry;if(e.index===null){const n=e.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;Mf.applyMatrix4(t.matrixWorld);const c=e.ray.origin.distanceTo(Mf);if(!(ce.far))return{distance:c,point:F0.clone().applyMatrix4(t.matrixWorld),index:o,face:null,faceIndex:null,barycoord:null,object:t}}const U0=new N,k0=new N;class um extends vn{constructor(e,n){super(e,n),this.isLineSegments=!0,this.type="LineSegments"}computeLineDistances(){const e=this.geometry;if(e.index===null){const n=e.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:e,face:null,faceIndex:null,barycoord:null,object:o})}}class fl extends Hn{constructor(e,n,i=rr,r,s,o,a=Sn,l=Sn,c,u=Xr,d=1){if(u!==Xr&&u!==Ks)throw new Error("DepthTexture format must be either THREE.DepthFormat or THREE.DepthStencilFormat");const f={width:e,height:n,depth:d};super(f,r,s,o,a,l,u,i,c),this.isDepthTexture=!0,this.flipY=!1,this.generateMipmaps=!1,this.compareFunction=null}copy(e){return super.copy(e),this.source=new am(Object.assign({},e.image)),this.compareFunction=e.compareFunction,this}toJSON(e){const n=super.toJSON(e);return this.compareFunction!==null&&(n.compareFunction=this.compareFunction),n}}class qP extends fl{constructor(e,n=rr,i=oo,r,s,o=Sn,a=Sn,l,c=Xr){const u={width:e,height:e,depth:1},d=[u,u,u,u,u,u];super(e,e,n,i,r,s,o,a,l,c),this.image=d,this.isCubeDepthTexture=!0,this.isCubeTexture=!0}get images(){return this.image}set images(e){this.image=e}}class Rb extends Hn{constructor(e=null){super(),this.sourceTexture=e,this.isExternalTexture=!0}copy(e){return super.copy(e),this.sourceTexture=e.sourceTexture,this}}class fm extends _t{constructor(e=1,n=1,i=4,r=8,s=1){super(),this.type="CapsuleGeometry",this.parameters={radius:e,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,d=Math.PI/2*e,f=n,h=2*d+f,g=i*2+s,v=r+1,m=new N,p=new N;for(let _=0;_<=g;_++){let y=0,x=0,M=0,A=0;if(_<=i){const b=_/i,w=b*Math.PI/2;x=-u-e*Math.cos(w),M=e*Math.sin(w),A=-e*Math.cos(w),y=b*d}else if(_<=i+s){const b=(_-i)/s;x=-u+b*n,M=e,A=0,y=d+b*f}else{const b=(_-i-s)/i,w=b*Math.PI/2;x=u+e*Math.sin(w),M=e*Math.cos(w),A=e*Math.sin(w),y=d+f+b*d}const P=Math.max(0,Math.min(1,y/h));let D=0;_===0?D=.5/r:_===g&&(D=-.5/r);for(let b=0;b<=r;b++){const w=b/r,I=w*Math.PI*2,L=Math.sin(I),V=Math.cos(I);p.x=-M*V,p.y=x,p.z=M*L,a.push(p.x,p.y,p.z),m.set(-M*V,A,M*L),m.normalize(),l.push(m.x,m.y,m.z),c.push(w+D,P)}if(_>0){const b=(_-1)*v;for(let w=0;w0&&y(!0),n>0&&y(!1)),this.setIndex(u),this.setAttribute("position",new ct(d,3)),this.setAttribute("normal",new ct(f,3)),this.setAttribute("uv",new ct(h,2));function _(){const x=new N,M=new N;let A=0;const P=(n-e)/i;for(let D=0;D<=s;D++){const b=[],w=D/s,I=w*(n-e)+e;for(let L=0;L<=r;L++){const V=L/r,$=V*l+a,X=Math.sin($),W=Math.cos($);M.x=I*X,M.y=-w*i+m,M.z=I*W,d.push(M.x,M.y,M.z),x.set(X,P,W).normalize(),f.push(x.x,x.y,x.z),h.push(V,1-w),b.push(g++)}v.push(b)}for(let D=0;D0||b!==0)&&(u.push(w,I,V),A+=3),(n>0||b!==s-1)&&(u.push(I,L,V),A+=3)}c.addGroup(p,A,0),p+=A}function y(x){const M=g,A=new xe,P=new N;let D=0;const b=x===!0?e:n,w=x===!0?1:-1;for(let L=1;L<=r;L++)d.push(0,m*w,0),f.push(0,w,0),h.push(.5,.5),g++;const I=g;for(let L=0;L<=r;L++){const $=L/r*l+a,X=Math.cos($),W=Math.sin($);P.x=b*W,P.y=m*w,P.z=b*X,d.push(P.x,P.y,P.z),f.push(0,w,0),A.x=X*.5+.5,A.y=W*.5*w+.5,h.push(A.x,A.y),g++}for(let L=0;L.9&&P<.1&&(y<.2&&(o[_+0]+=1),x<.2&&(o[_+2]+=1),M<.2&&(o[_+4]+=1))}}function f(_){s.push(_.x,_.y,_.z)}function h(_,y){const x=_*3;y.x=e[x+0],y.y=e[x+1],y.z=e[x+2]}function g(){const _=new N,y=new N,x=new N,M=new N,A=new xe,P=new xe,D=new xe;for(let b=0,w=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,h=(o-u)/f;return(r+h)/(s-1)}getTangent(e,n){let r=e-1e-4,s=e+1e-4;r<0&&(r=0),s>1&&(s=1);const o=this.getPoint(r),a=this.getPoint(s),l=n||(o.isVector2?new xe:new N);return l.copy(a).sub(o).normalize(),l}getTangentAt(e,n){const i=this.getUtoTmapping(e);return this.getTangent(i,n)}computeFrenetFrames(e,n=!1){const i=new N,r=[],s=[],o=[],a=new N,l=new yt;for(let h=0;h<=e;h++){const g=h/e;r[h]=this.getTangentAt(g,new N)}s[0]=new N,o[0]=new N;let c=Number.MAX_VALUE;const u=Math.abs(r[0].x),d=Math.abs(r[0].y),f=Math.abs(r[0].z);u<=c&&(c=u,i.set(1,0,0)),d<=c&&(c=d,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 h=1;h<=e;h++){if(s[h]=s[h-1].clone(),o[h]=o[h-1].clone(),a.crossVectors(r[h-1],r[h]),a.length()>Number.EPSILON){a.normalize();const g=Math.acos(ht(r[h-1].dot(r[h]),-1,1));s[h].applyMatrix4(l.makeRotationAxis(a,g))}o[h].crossVectors(r[h],s[h])}if(n===!0){let h=Math.acos(ht(s[0].dot(s[e]),-1,1));h/=e,r[0].dot(a.crossVectors(s[0],s[e]))>0&&(h=-h);for(let g=1;g<=e;g++)s[g].applyMatrix4(l.makeRotationAxis(r[g],h*g)),o[g].crossVectors(r[g],s[g])}return{tangents:r,normals:s,binormals:o}}clone(){return new this.constructor().copy(this)}copy(e){return this.arcLengthDivisions=e.arcLengthDivisions,this}toJSON(){const e={metadata:{version:4.7,type:"Curve",generator:"Curve.toJSON"}};return e.arcLengthDivisions=this.arcLengthDivisions,e.type=this.type,e}fromJSON(e){return this.arcLengthDivisions=e.arcLengthDivisions,this}}class mm extends ur{constructor(e=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=e,this.aY=n,this.xRadius=i,this.yRadius=r,this.aStartAngle=s,this.aEndAngle=o,this.aClockwise=a,this.aRotation=l}getPoint(e,n=new xe){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]:(gc.subVectors(r[0],r[1]).add(r[0]),c=gc);const d=r[a%s],f=r[(a+1)%s];if(this.closed||a+2r.length-2?r.length-1:o+1],d=r[o>r.length-3?r.length-1:o+2];return i.set(V0(a,l.x,c.x,u.x,d.x),V0(a,l.y,c.y,u.y,d.y)),i}copy(e){super.copy(e),this.points=[];for(let n=0,i=e.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 e=this.getCurveLengths();return e[e.length-1]}updateArcLengths(){this.needsUpdate=!0,this.cacheLengths=null,this.getCurveLengths()}getCurveLengths(){if(this.cacheLengths&&this.cacheLengths.length===this.curves.length)return this.cacheLengths;const e=[];let n=0;for(let i=0,r=this.curves.length;i1&&!n[n.length-1].equals(n[0])&&n.push(n[0]),n}copy(e){super.copy(e),this.curves=[];for(let n=0,i=e.curves.length;n0){const d=c.getPoint(0);d.equals(this.currentPoint)||this.lineTo(d.x,d.y)}this.curves.push(c);const u=c.getPoint(1);return this.currentPoint.copy(u),this}copy(e){return super.copy(e),this.currentPoint.copy(e.currentPoint),this}toJSON(){const e=super.toJSON();return e.currentPoint=this.currentPoint.toArray(),e}fromJSON(e){return super.fromJSON(e),this.currentPoint.fromArray(e.currentPoint),this}}class zc extends lp{constructor(e){super(e),this.uuid=ho(),this.type="Shape",this.holes=[]}getPointsHoles(e){const n=[];for(let i=0,r=this.holes.length;i80*n){a=t[0],l=t[1];let u=a,d=l;for(let f=n;fu&&(u=h),g>d&&(d=g)}c=Math.max(u-a,d-l),c=c!==0?32767/c:0}return hl(s,o,n,a,l,c,0),o}function Ob(t,e,n,i,r){let s;if(r===S2(t,e,n,i)>0)for(let o=e;o=e;o-=i)s=H0(o/i|0,t[o],t[o+1],s);return s&&ca(s,s.next)&&(ml(s),s=s.next),s}function ao(t,e){if(!t)return t;e||(e=t);let n=t,i;do if(i=!1,!n.steiner&&(ca(n,n.next)||$t(n.prev,n,n.next)===0)){if(ml(n),n=e=n.prev,n===n.next)break;i=!0}else n=n.next;while(i||n!==e);return e}function hl(t,e,n,i,r,s,o){if(!t)return;!o&&s&&g2(t,i,r,s);let a=t;for(;t.prev!==t.next;){const l=t.prev,c=t.next;if(s?l2(t,i,r,s):a2(t)){e.push(l.i,t.i,c.i),ml(t),t=c.next,a=c.next;continue}if(t=c,t===a){o?o===1?(t=c2(ao(t),e),hl(t,e,n,i,r,s,2)):o===2&&u2(t,e,n,i,r,s):hl(ao(t),e,n,i,r,s,1);break}}}function a2(t){const e=t.prev,n=t,i=t.next;if($t(e,n,i)>=0)return!1;const r=e.x,s=n.x,o=i.x,a=e.y,l=n.y,c=i.y,u=Math.min(r,s,o),d=Math.min(a,l,c),f=Math.max(r,s,o),h=Math.max(a,l,c);let g=i.next;for(;g!==e;){if(g.x>=u&&g.x<=f&&g.y>=d&&g.y<=h&&Ua(r,a,s,l,o,c,g.x,g.y)&&$t(g.prev,g,g.next)>=0)return!1;g=g.next}return!0}function l2(t,e,n,i){const r=t.prev,s=t,o=t.next;if($t(r,s,o)>=0)return!1;const a=r.x,l=s.x,c=o.x,u=r.y,d=s.y,f=o.y,h=Math.min(a,l,c),g=Math.min(u,d,f),v=Math.max(a,l,c),m=Math.max(u,d,f),p=cp(h,g,e,n,i),_=cp(v,m,e,n,i);let y=t.prevZ,x=t.nextZ;for(;y&&y.z>=p&&x&&x.z<=_;){if(y.x>=h&&y.x<=v&&y.y>=g&&y.y<=m&&y!==r&&y!==o&&Ua(a,u,l,d,c,f,y.x,y.y)&&$t(y.prev,y,y.next)>=0||(y=y.prevZ,x.x>=h&&x.x<=v&&x.y>=g&&x.y<=m&&x!==r&&x!==o&&Ua(a,u,l,d,c,f,x.x,x.y)&&$t(x.prev,x,x.next)>=0))return!1;x=x.nextZ}for(;y&&y.z>=p;){if(y.x>=h&&y.x<=v&&y.y>=g&&y.y<=m&&y!==r&&y!==o&&Ua(a,u,l,d,c,f,y.x,y.y)&&$t(y.prev,y,y.next)>=0)return!1;y=y.prevZ}for(;x&&x.z<=_;){if(x.x>=h&&x.x<=v&&x.y>=g&&x.y<=m&&x!==r&&x!==o&&Ua(a,u,l,d,c,f,x.x,x.y)&&$t(x.prev,x,x.next)>=0)return!1;x=x.nextZ}return!0}function c2(t,e){let n=t;do{const i=n.prev,r=n.next.next;!ca(i,r)&&Ub(i,n,n.next,r)&&pl(i,r)&&pl(r,i)&&(e.push(i.i,n.i,r.i),ml(n),ml(n.next),n=t=r),n=n.next}while(n!==t);return ao(n)}function u2(t,e,n,i,r,s){let o=t;do{let a=o.next.next;for(;a!==o.prev;){if(o.i!==a.i&&x2(o,a)){let l=kb(o,a);o=ao(o,o.next),l=ao(l,l.next),hl(o,e,n,i,r,s,0),hl(l,e,n,i,r,s,0);return}a=a.next}o=o.next}while(o!==t)}function d2(t,e,n,i){const r=[];for(let s=0,o=e.length;s=n.next.y&&n.next.y!==n.y){const d=n.x+(r-n.y)*(n.next.x-n.x)/(n.next.y-n.y);if(d<=i&&d>s&&(s=d,o=n.x=n.x&&n.x>=l&&i!==n.x&&Fb(ro.x||n.x===o.x&&m2(o,n)))&&(o=n,u=d)}n=n.next}while(n!==a);return o}function m2(t,e){return $t(t.prev,t,e.prev)<0&&$t(e.next,t,t.next)<0}function g2(t,e,n,i){let r=t;do r.z===0&&(r.z=cp(r.x,r.y,e,n,i)),r.prevZ=r.prev,r.nextZ=r.next,r=r.next;while(r!==t);r.prevZ.nextZ=null,r.prevZ=null,v2(r)}function v2(t){let e,n=1;do{let i=t,r;t=null;let s=null;for(e=0;i;){e++;let o=i,a=0;for(let c=0;c0||l>0&&o;)a!==0&&(l===0||!o||i.z<=o.z)?(r=i,i=i.nextZ,a--):(r=o,o=o.nextZ,l--),s?s.nextZ=r:t=r,r.prevZ=s,s=r;i=o}s.nextZ=null,n*=2}while(e>1);return t}function cp(t,e,n,i,r){return t=(t-n)*r|0,e=(e-i)*r|0,t=(t|t<<8)&16711935,t=(t|t<<4)&252645135,t=(t|t<<2)&858993459,t=(t|t<<1)&1431655765,e=(e|e<<8)&16711935,e=(e|e<<4)&252645135,e=(e|e<<2)&858993459,e=(e|e<<1)&1431655765,t|e<<1}function _2(t){let e=t,n=t;do(e.x=(t-o)*(s-a)&&(t-o)*(i-a)>=(n-o)*(e-a)&&(n-o)*(s-a)>=(r-o)*(i-a)}function Ua(t,e,n,i,r,s,o,a){return!(t===o&&e===a)&&Fb(t,e,n,i,r,s,o,a)}function x2(t,e){return t.next.i!==e.i&&t.prev.i!==e.i&&!y2(t,e)&&(pl(t,e)&&pl(e,t)&&b2(t,e)&&($t(t.prev,t,e.prev)||$t(t,e.prev,e))||ca(t,e)&&$t(t.prev,t,t.next)>0&&$t(e.prev,e,e.next)>0)}function $t(t,e,n){return(e.y-t.y)*(n.x-e.x)-(e.x-t.x)*(n.y-e.y)}function ca(t,e){return t.x===e.x&&t.y===e.y}function Ub(t,e,n,i){const r=_c($t(t,e,n)),s=_c($t(t,e,i)),o=_c($t(n,i,t)),a=_c($t(n,i,e));return!!(r!==s&&o!==a||r===0&&vc(t,n,e)||s===0&&vc(t,i,e)||o===0&&vc(n,t,i)||a===0&&vc(n,e,i))}function vc(t,e,n){return e.x<=Math.max(t.x,n.x)&&e.x>=Math.min(t.x,n.x)&&e.y<=Math.max(t.y,n.y)&&e.y>=Math.min(t.y,n.y)}function _c(t){return t>0?1:t<0?-1:0}function y2(t,e){let n=t;do{if(n.i!==t.i&&n.next.i!==t.i&&n.i!==e.i&&n.next.i!==e.i&&Ub(n,n.next,t,e))return!0;n=n.next}while(n!==t);return!1}function pl(t,e){return $t(t.prev,t,t.next)<0?$t(t,e,t.next)>=0&&$t(t,t.prev,e)>=0:$t(t,e,t.prev)<0||$t(t,t.next,e)<0}function b2(t,e){let n=t,i=!1;const r=(t.x+e.x)/2,s=(t.y+e.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!==t);return i}function kb(t,e){const n=up(t.i,t.x,t.y),i=up(e.i,e.x,e.y),r=t.next,s=e.prev;return t.next=e,e.prev=t,n.next=r,r.prev=n,i.next=n,n.prev=i,s.next=i,i.prev=s,i}function H0(t,e,n,i){const r=up(t,e,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 ml(t){t.next.prev=t.prev,t.prev.next=t.next,t.prevZ&&(t.prevZ.nextZ=t.nextZ),t.nextZ&&(t.nextZ.prevZ=t.prevZ)}function up(t,e,n){return{i:t,x:e,y:n,prev:null,next:null,z:0,prevZ:null,nextZ:null,steiner:!1}}function S2(t,e,n,i){let r=0;for(let s=e,o=n-i;s2&&t[e-1].equals(t[0])&&t.pop()}function W0(t,e){for(let n=0;nNumber.EPSILON){const J=Math.sqrt(S),se=Math.sqrt(oe*oe+T*T),K=q.x-ee/J,Ce=q.y+Q/J,ve=H.x-T/se,Oe=H.y+oe/se,$e=((ve-K)*T-(Oe-Ce)*oe)/(Q*T-ee*oe);Y=K+Q*$e-U.x,C=Ce+ee*$e-U.y;const ge=Y*Y+C*C;if(ge<=2)return new xe(Y,C);ae=Math.sqrt(ge/2)}else{let J=!1;Q>Number.EPSILON?oe>Number.EPSILON&&(J=!0):Q<-Number.EPSILON?oe<-Number.EPSILON&&(J=!0):Math.sign(ee)===Math.sign(T)&&(J=!0),J?(Y=-ee,C=Q,ae=Math.sqrt(S)):(Y=Q,C=ee,ae=Math.sqrt(S/2))}return new xe(Y/ae,C/ae)}const de=[];for(let U=0,q=X.length,H=q-1,Y=U+1;U=0;U--){const q=U/m,H=h*Math.cos(q*Math.PI/2),Y=g*Math.sin(q*Math.PI/2)+v;for(let C=0,ae=X.length;C=0;){const Y=H;let C=H-1;C<0&&(C=U.length-1);for(let ae=0,Q=u+m*2;ae0)&&h.push(y,x,A),(p!==i-1||l0!=e>0&&this.version++,this._anisotropy=e}get clearcoat(){return this._clearcoat}set clearcoat(e){this._clearcoat>0!=e>0&&this.version++,this._clearcoat=e}get iridescence(){return this._iridescence}set iridescence(e){this._iridescence>0!=e>0&&this.version++,this._iridescence=e}get dispersion(){return this._dispersion}set dispersion(e){this._dispersion>0!=e>0&&this.version++,this._dispersion=e}get sheen(){return this._sheen}set sheen(e){this._sheen>0!=e>0&&this.version++,this._sheen=e}get transmission(){return this._transmission}set transmission(e){this._transmission>0!=e>0&&this.version++,this._transmission=e}copy(e){return super.copy(e),this.defines={STANDARD:"",PHYSICAL:""},this.anisotropy=e.anisotropy,this.anisotropyRotation=e.anisotropyRotation,this.anisotropyMap=e.anisotropyMap,this.clearcoat=e.clearcoat,this.clearcoatMap=e.clearcoatMap,this.clearcoatRoughness=e.clearcoatRoughness,this.clearcoatRoughnessMap=e.clearcoatRoughnessMap,this.clearcoatNormalMap=e.clearcoatNormalMap,this.clearcoatNormalScale.copy(e.clearcoatNormalScale),this.dispersion=e.dispersion,this.ior=e.ior,this.iridescence=e.iridescence,this.iridescenceMap=e.iridescenceMap,this.iridescenceIOR=e.iridescenceIOR,this.iridescenceThicknessRange=[...e.iridescenceThicknessRange],this.iridescenceThicknessMap=e.iridescenceThicknessMap,this.sheen=e.sheen,this.sheenColor.copy(e.sheenColor),this.sheenColorMap=e.sheenColorMap,this.sheenRoughness=e.sheenRoughness,this.sheenRoughnessMap=e.sheenRoughnessMap,this.transmission=e.transmission,this.transmissionMap=e.transmissionMap,this.thickness=e.thickness,this.thicknessMap=e.thicknessMap,this.attenuationDistance=e.attenuationDistance,this.attenuationColor.copy(e.attenuationColor),this.specularIntensity=e.specularIntensity,this.specularIntensityMap=e.specularIntensityMap,this.specularColor.copy(e.specularColor),this.specularColorMap=e.specularColorMap,this}}class C2 extends po{constructor(e){super(),this.isMeshDepthMaterial=!0,this.type="MeshDepthMaterial",this.depthPacking=XC,this.map=null,this.alphaMap=null,this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.wireframe=!1,this.wireframeLinewidth=1,this.setValues(e)}copy(e){return super.copy(e),this.depthPacking=e.depthPacking,this.map=e.map,this.alphaMap=e.alphaMap,this.displacementMap=e.displacementMap,this.displacementScale=e.displacementScale,this.displacementBias=e.displacementBias,this.wireframe=e.wireframe,this.wireframeLinewidth=e.wireframeLinewidth,this}}class P2 extends po{constructor(e){super(),this.isMeshDistanceMaterial=!0,this.type="MeshDistanceMaterial",this.map=null,this.alphaMap=null,this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.setValues(e)}copy(e){return super.copy(e),this.map=e.map,this.alphaMap=e.alphaMap,this.displacementMap=e.displacementMap,this.displacementScale=e.displacementScale,this.displacementBias=e.displacementBias,this}}const q0={enabled:!1,files:{},add:function(t,e){this.enabled!==!1&&(this.files[t]=e)},get:function(t){if(this.enabled!==!1)return this.files[t]},remove:function(t){delete this.files[t]},clear:function(){this.files={}}};class R2{constructor(e,n,i){const r=this;let s=!1,o=0,a=0,l;const c=[];this.onStart=void 0,this.onLoad=e,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,d){return c.push(u,d),this},this.removeHandler=function(u){const d=c.indexOf(u);return d!==-1&&c.splice(d,2),this},this.getHandler=function(u){for(let d=0,f=c.length;d{n&&n(s),this.manager.itemEnd(e)},0),s;if(br[e]!==void 0){br[e].push({onLoad:n,onProgress:i,onError:r});return}br[e]=[],br[e].push({onLoad:n,onProgress:i,onError:r});const o=new Request(e,{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&&it("FileLoader: HTTP Status 0 received."),typeof ReadableStream>"u"||c.body===void 0||c.body.getReader===void 0)return c;const u=br[e],d=c.body.getReader(),f=c.headers.get("X-File-Size")||c.headers.get("Content-Length"),h=f?parseInt(f):0,g=h!==0;let v=0;const m=new ReadableStream({start(p){_();function _(){d.read().then(({done:y,value:x})=>{if(y)p.close();else{v+=x.byteLength;const M=new ProgressEvent("progress",{lengthComputable:g,loaded:v,total:h});for(let A=0,P=u.length;A{p.error(y)})}}});return new Response(m)}else throw new I2(`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 d=/charset="?([^;"\s]*)"?/i.exec(a),f=d&&d[1]?d[1].toLowerCase():void 0,h=new TextDecoder(f);return c.arrayBuffer().then(g=>h.decode(g))}}}).then(c=>{q0.add(`file:${e}`,c);const u=br[e];delete br[e];for(let d=0,f=u.length;d{const u=br[e];if(u===void 0)throw this.manager.itemError(e),c;delete br[e];for(let d=0,f=u.length;d{this.manager.itemEnd(e)}),this.manager.itemStart(e)}setResponseType(e){return this.responseType=e,this}setMimeType(e){return this.mimeType=e,this}abort(){return this._abortController.abort(),this._abortController=new AbortController,this}}class Rl extends Ft{constructor(e,n=1){super(),this.isLight=!0,this.type="Light",this.color=new nt(e),this.intensity=n}dispose(){this.dispatchEvent({type:"dispose"})}copy(e,n){return super.copy(e,n),this.color.copy(e.color),this.intensity=e.intensity,this}toJSON(e){const n=super.toJSON(e);return n.object.color=this.color.getHex(),n.object.intensity=this.intensity,n}}const Pf=new yt,X0=new N,$0=new N;class xm{constructor(e){this.camera=e,this.intensity=1,this.bias=0,this.normalBias=0,this.radius=1,this.blurSamples=8,this.mapSize=new xe(512,512),this.mapType=li,this.map=null,this.mapPass=null,this.matrix=new yt,this.autoUpdate=!0,this.needsUpdate=!1,this._frustum=new cm,this._frameExtents=new xe(1,1),this._viewportCount=1,this._viewports=[new Zt(0,0,1,1)]}getViewportCount(){return this._viewportCount}getFrustum(){return this._frustum}updateMatrices(e){const n=this.camera,i=this.matrix;X0.setFromMatrixPosition(e.matrixWorld),n.position.copy(X0),$0.setFromMatrixPosition(e.target.matrixWorld),n.lookAt($0),n.updateMatrixWorld(),Pf.multiplyMatrices(n.projectionMatrix,n.matrixWorldInverse),this._frustum.setFromProjectionMatrix(Pf,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(Pf)}getViewport(e){return this._viewports[e]}getFrameExtents(){return this._frameExtents}dispose(){this.map&&this.map.dispose(),this.mapPass&&this.mapPass.dispose()}copy(e){return this.camera=e.camera.clone(),this.intensity=e.intensity,this.bias=e.bias,this.radius=e.radius,this.autoUpdate=e.autoUpdate,this.needsUpdate=e.needsUpdate,this.normalBias=e.normalBias,this.blurSamples=e.blurSamples,this.mapSize.copy(e.mapSize),this}clone(){return new this.constructor().copy(this)}toJSON(){const e={};return this.intensity!==1&&(e.intensity=this.intensity),this.bias!==0&&(e.bias=this.bias),this.normalBias!==0&&(e.normalBias=this.normalBias),this.radius!==1&&(e.radius=this.radius),(this.mapSize.x!==512||this.mapSize.y!==512)&&(e.mapSize=this.mapSize.toArray()),e.camera=this.camera.toJSON(!1).object,delete e.camera.matrix,e}}class L2 extends xm{constructor(){super(new Yn(50,1,.5,500)),this.isSpotLightShadow=!0,this.focus=1,this.aspect=1}updateMatrices(e){const n=this.camera,i=aa*2*e.angle*this.focus,r=this.mapSize.width/this.mapSize.height*this.aspect,s=e.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(e)}copy(e){return super.copy(e),this.focus=e.focus,this}}class O2 extends Rl{constructor(e,n,i=0,r=Math.PI/3,s=0,o=2){super(e,n),this.isSpotLight=!0,this.type="SpotLight",this.position.copy(Ft.DEFAULT_UP),this.updateMatrix(),this.target=new Ft,this.distance=i,this.angle=r,this.penumbra=s,this.decay=o,this.map=null,this.shadow=new L2}get power(){return this.intensity*Math.PI}set power(e){this.intensity=e/Math.PI}dispose(){super.dispose(),this.shadow.dispose()}copy(e,n){return super.copy(e,n),this.distance=e.distance,this.angle=e.angle,this.penumbra=e.penumbra,this.decay=e.decay,this.target=e.target.clone(),this.map=e.map,this.shadow=e.shadow.clone(),this}toJSON(e){const n=super.toJSON(e);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(e).uuid),n.object.shadow=this.shadow.toJSON(),n}}class F2 extends xm{constructor(){super(new Yn(90,1,.5,500)),this.isPointLightShadow=!0}}class U2 extends Rl{constructor(e,n,i=0,r=2){super(e,n),this.isPointLight=!0,this.type="PointLight",this.distance=i,this.decay=r,this.shadow=new F2}get power(){return this.intensity*4*Math.PI}set power(e){this.intensity=e/(4*Math.PI)}dispose(){super.dispose(),this.shadow.dispose()}copy(e,n){return super.copy(e,n),this.distance=e.distance,this.decay=e.decay,this.shadow=e.shadow.clone(),this}toJSON(e){const n=super.toJSON(e);return n.object.distance=this.distance,n.object.decay=this.decay,n.object.shadow=this.shadow.toJSON(),n}}class ym extends Ab{constructor(e=-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=e,this.right=n,this.top=i,this.bottom=r,this.near=s,this.far=o,this.updateProjectionMatrix()}copy(e,n){return super.copy(e,n),this.left=e.left,this.right=e.right,this.top=e.top,this.bottom=e.bottom,this.near=e.near,this.far=e.far,this.zoom=e.zoom,this.view=e.view===null?null:Object.assign({},e.view),this}setViewOffset(e,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=e,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 e=(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-e,o=i+e,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(e){const n=super.toJSON(e);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 k2 extends xm{constructor(){super(new ym(-5,5,5,-5,.5,500)),this.isDirectionalLightShadow=!0}}class Bb extends Rl{constructor(e,n){super(e,n),this.isDirectionalLight=!0,this.type="DirectionalLight",this.position.copy(Ft.DEFAULT_UP),this.updateMatrix(),this.target=new Ft,this.shadow=new k2}dispose(){super.dispose(),this.shadow.dispose()}copy(e){return super.copy(e),this.target=e.target.clone(),this.shadow=e.shadow.clone(),this}toJSON(e){const n=super.toJSON(e);return n.object.shadow=this.shadow.toJSON(),n.object.target=this.target.uuid,n}}class zb extends Rl{constructor(e,n){super(e,n),this.isAmbientLight=!0,this.type="AmbientLight"}}class B2 extends Rl{constructor(e,n,i=10,r=10){super(e,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(e){this.intensity=e/(this.width*this.height*Math.PI)}copy(e){return super.copy(e),this.width=e.width,this.height=e.height,this}toJSON(e){const n=super.toJSON(e);return n.object.width=this.width,n.object.height=this.height,n}}class z2 extends Yn{constructor(e=[]){super(),this.isArrayCamera=!0,this.isMultiViewCamera=!1,this.cameras=e}}const j0=new yt;class Vb{constructor(e,n,i=0,r=1/0){this.ray=new Al(e,n),this.near=i,this.far=r,this.camera=null,this.layers=new lm,this.params={Mesh:{},Line:{threshold:1},LOD:{},Points:{threshold:1},Sprite:{}}}set(e,n){this.ray.set(e,n)}setFromCamera(e,n){n.isPerspectiveCamera?(this.ray.origin.setFromMatrixPosition(n.matrixWorld),this.ray.direction.set(e.x,e.y,.5).unproject(n).sub(this.ray.origin).normalize(),this.camera=n):n.isOrthographicCamera?(this.ray.origin.set(e.x,e.y,(n.near+n.far)/(n.near-n.far)).unproject(n),this.ray.direction.set(0,0,-1).transformDirection(n.matrixWorld),this.camera=n):bt("Raycaster: Unsupported camera type: "+n.type)}setFromXRController(e){return j0.identity().extractRotation(e.matrixWorld),this.ray.origin.setFromMatrixPosition(e.matrixWorld),this.ray.direction.set(0,0,-1).applyMatrix4(j0),this}intersectObject(e,n=!0,i=[]){return dp(e,this,i,n),i.sort(Y0),i}intersectObjects(e,n=!0,i=[]){for(let r=0,s=e.length;r.99999)this.quaternion.set(0,0,0,1);else if(e.y<-.99999)this.quaternion.set(1,0,0,0);else{ev.set(e.z,0,-e.x).normalize();const n=Math.acos(e.y);this.quaternion.setFromAxisAngle(ev,n)}}setLength(e,n=e*.2,i=n*.2){this.line.scale.set(1,Math.max(1e-4,e-n),1),this.line.updateMatrix(),this.cone.scale.set(i,n,i),this.cone.position.y=e,this.cone.updateMatrix()}setColor(e){this.line.material.color.set(e),this.cone.material.color.set(e)}copy(e){return super.copy(e,!1),this.line.copy(e.line),this.cone.copy(e.cone),this}dispose(){this.line.geometry.dispose(),this.line.material.dispose(),this.cone.geometry.dispose(),this.cone.material.dispose()}}class Hb extends um{constructor(e=1){const n=[0,0,0,e,0,0,0,0,0,0,e,0,0,0,0,0,0,e],i=[1,0,0,1,.6,0,0,1,0,.6,1,0,0,0,1,0,.6,1],r=new _t;r.setAttribute("position",new ct(n,3)),r.setAttribute("color",new ct(i,3));const s=new Si({vertexColors:!0,toneMapped:!1});super(r,s),this.type="AxesHelper"}setColors(e,n,i){const r=new nt,s=this.geometry.attributes.color.array;return r.set(e),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 q2{constructor(){this.type="ShapePath",this.color=new nt,this.subPaths=[],this.currentPath=null}moveTo(e,n){return this.currentPath=new lp,this.subPaths.push(this.currentPath),this.currentPath.moveTo(e,n),this}lineTo(e,n){return this.currentPath.lineTo(e,n),this}quadraticCurveTo(e,n,i,r){return this.currentPath.quadraticCurveTo(e,n,i,r),this}bezierCurveTo(e,n,i,r,s,o){return this.currentPath.bezierCurveTo(e,n,i,r,s,o),this}splineThru(e){return this.currentPath.splineThru(e),this}toShapes(e){function n(p){const _=[];for(let y=0,x=p.length;yNumber.EPSILON){if(w<0&&(P=_[A],b=-b,D=_[M],w=-w),p.yD.y)continue;if(p.y===P.y){if(p.x===P.x)return!0}else{const I=w*(p.x-P.x)-b*(p.y-P.y);if(I===0)return!0;if(I<0)continue;x=!x}}else{if(p.y!==P.y)continue;if(D.x<=p.x&&p.x<=P.x||P.x<=p.x&&p.x<=D.x)return!0}}return x}const r=Zs.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 zc,l.curves=a.curves,c.push(l),c;let u=!r(s[0].getPoints());u=e?!u:u;const d=[],f=[];let h=[],g=0,v;f[g]=void 0,h[g]=[];for(let p=0,_=s.length;p<_;p++)a=s[p],v=a.getPoints(),o=r(v),o=e?!o:o,o?(!u&&f[g]&&g++,f[g]={s:new zc,p:v},f[g].s.curves=a.curves,u&&g++,h[g]=[]):h[g].push({h:a,p:v[0]});if(!f[0])return n(s);if(f.length>1){let p=!1,_=0;for(let y=0,x=f.length;y0&&p===!1&&(h=d)}let m;for(let p=0,_=f.length;p<_;p++){l=f[p].s,c.push(l),m=h[p];for(let y=0,x=m.length;yh.start-g.start);let f=0;for(let h=1;hh+g?(c.inputState.pinching=!1,this.dispatchEvent({type:"pinchend",handedness:e.handedness,target:this})):!c.inputState.pinching&&f<=h-g&&(c.inputState.pinching=!0,this.dispatchEvent({type:"pinchstart",handedness:e.handedness,target:this}))}else l!==null&&e.gripSpace&&(s=n.getPose(e.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(e.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(BP)))}return a!==null&&(a.visible=r!==null),l!==null&&(l.visible=s!==null),c!==null&&(c.visible=o!==null),this}_getHandJoint(e,n){if(e.joints[n.jointName]===void 0){const i=new ac;i.matrixAutoUpdate=!1,i.visible=!1,e.joints[n.jointName]=i,e.add(i)}return e.joints[n.jointName]}}class zP extends Ft{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 Oi,this.environmentIntensity=1,this.environmentRotation=new Oi,this.overrideMaterial=null,typeof __THREE_DEVTOOLS__<"u"&&__THREE_DEVTOOLS__.dispatchEvent(new CustomEvent("observe",{detail:this}))}copy(e,n){return super.copy(e,n),e.background!==null&&(this.background=e.background.clone()),e.environment!==null&&(this.environment=e.environment.clone()),e.fog!==null&&(this.fog=e.fog.clone()),this.backgroundBlurriness=e.backgroundBlurriness,this.backgroundIntensity=e.backgroundIntensity,this.backgroundRotation.copy(e.backgroundRotation),this.environmentIntensity=e.environmentIntensity,this.environmentRotation.copy(e.environmentRotation),e.overrideMaterial!==null&&(this.overrideMaterial=e.overrideMaterial.clone()),this.matrixAutoUpdate=e.matrixAutoUpdate,this}toJSON(e){const n=super.toJSON(e);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 VP extends Hn{constructor(e=null,n=1,i=1,r,s,o,a,l,c=Sn,u=Sn,d,f){super(null,o,a,l,c,u,r,s,d,f),this.isDataTexture=!0,this.image={data:e,width:n,height:i},this.generateMipmaps=!1,this.flipY=!1,this.unpackAlignment=1}}const wf=new N,HP=new N,GP=new ft;let Mr=class{constructor(e=new N(1,0,0),n=0){this.isPlane=!0,this.normal=e,this.constant=n}set(e,n){return this.normal.copy(e),this.constant=n,this}setComponents(e,n,i,r){return this.normal.set(e,n,i),this.constant=r,this}setFromNormalAndCoplanarPoint(e,n){return this.normal.copy(e),this.constant=-n.dot(this.normal),this}setFromCoplanarPoints(e,n,i){const r=wf.subVectors(i,n).cross(HP.subVectors(e,n)).normalize();return this.setFromNormalAndCoplanarPoint(r,e),this}copy(e){return this.normal.copy(e.normal),this.constant=e.constant,this}normalize(){const e=1/this.normal.length();return this.normal.multiplyScalar(e),this.constant*=e,this}negate(){return this.constant*=-1,this.normal.negate(),this}distanceToPoint(e){return this.normal.dot(e)+this.constant}distanceToSphere(e){return this.distanceToPoint(e.center)-e.radius}projectPoint(e,n){return n.copy(e).addScaledVector(this.normal,-this.distanceToPoint(e))}intersectLine(e,n){const i=e.delta(wf),r=this.normal.dot(i);if(r===0)return this.distanceToPoint(e.start)===0?n.copy(e.start):null;const s=-(e.start.dot(this.normal)+this.constant)/r;return s<0||s>1?null:n.copy(e.start).addScaledVector(i,s)}intersectsLine(e){const n=this.distanceToPoint(e.start),i=this.distanceToPoint(e.end);return n<0&&i>0||i<0&&n>0}intersectsBox(e){return e.intersectsPlane(this)}intersectsSphere(e){return e.intersectsPlane(this)}coplanarPoint(e){return e.copy(this.normal).multiplyScalar(-this.constant)}applyMatrix4(e,n){const i=n||GP.getNormalMatrix(e),r=this.coplanarPoint(wf).applyMatrix4(e),s=this.normal.applyMatrix3(i).normalize();return this.constant=-r.dot(s),this}translate(e){return this.constant-=e.dot(this.normal),this}equals(e){return e.normal.equals(this.normal)&&e.constant===this.constant}clone(){return new this.constructor().copy(this)}};const ks=new Tl,WP=new xe(.5,.5),lc=new N;class cm{constructor(e=new Mr,n=new Mr,i=new Mr,r=new Mr,s=new Mr,o=new Mr){this.planes=[e,n,i,r,s,o]}set(e,n,i,r,s,o){const a=this.planes;return a[0].copy(e),a[1].copy(n),a[2].copy(i),a[3].copy(r),a[4].copy(s),a[5].copy(o),this}copy(e){const n=this.planes;for(let i=0;i<6;i++)n[i].copy(e.planes[i]);return this}setFromProjectionMatrix(e,n=Zi,i=!1){const r=this.planes,s=e.elements,o=s[0],a=s[1],l=s[2],c=s[3],u=s[4],d=s[5],f=s[6],h=s[7],g=s[8],v=s[9],m=s[10],p=s[11],_=s[12],y=s[13],x=s[14],M=s[15];if(r[0].setComponents(c-o,h-u,p-g,M-_).normalize(),r[1].setComponents(c+o,h+u,p+g,M+_).normalize(),r[2].setComponents(c+a,h+d,p+v,M+y).normalize(),r[3].setComponents(c-a,h-d,p-v,M-y).normalize(),i)r[4].setComponents(l,f,m,x).normalize(),r[5].setComponents(c-l,h-f,p-m,M-x).normalize();else if(r[4].setComponents(c-l,h-f,p-m,M-x).normalize(),n===Zi)r[5].setComponents(c+l,h+f,p+m,M+x).normalize();else if(n===au)r[5].setComponents(l,f,m,x).normalize();else throw new Error("THREE.Frustum.setFromProjectionMatrix(): Invalid coordinate system: "+n);return this}intersectsObject(e){if(e.boundingSphere!==void 0)e.boundingSphere===null&&e.computeBoundingSphere(),ks.copy(e.boundingSphere).applyMatrix4(e.matrixWorld);else{const n=e.geometry;n.boundingSphere===null&&n.computeBoundingSphere(),ks.copy(n.boundingSphere).applyMatrix4(e.matrixWorld)}return this.intersectsSphere(ks)}intersectsSprite(e){ks.center.set(0,0,0);const n=WP.distanceTo(e.center);return ks.radius=.7071067811865476+n,ks.applyMatrix4(e.matrixWorld),this.intersectsSphere(ks)}intersectsSphere(e){const n=this.planes,i=e.center,r=-e.radius;for(let s=0;s<6;s++)if(n[s].distanceToPoint(i)0?e.max.x:e.min.x,lc.y=r.normal.y>0?e.max.y:e.min.y,lc.z=r.normal.z>0?e.max.z:e.min.z,r.distanceToPoint(lc)<0)return!1}return!0}containsPoint(e){const n=this.planes;for(let i=0;i<6;i++)if(n[i].distanceToPoint(e)<0)return!1;return!0}clone(){return new this.constructor().copy(this)}}class Si extends po{constructor(e){super(),this.isLineBasicMaterial=!0,this.type="LineBasicMaterial",this.color=new nt(16777215),this.map=null,this.linewidth=1,this.linecap="round",this.linejoin="round",this.fog=!0,this.setValues(e)}copy(e){return super.copy(e),this.color.copy(e.color),this.map=e.map,this.linewidth=e.linewidth,this.linecap=e.linecap,this.linejoin=e.linejoin,this.fog=e.fog,this}}const cu=new N,uu=new N,O0=new yt,Aa=new Al,cc=new Tl,Mf=new N,F0=new N;class vn extends Ft{constructor(e=new _t,n=new Si){super(),this.isLine=!0,this.type="Line",this.geometry=e,this.material=n,this.morphTargetDictionary=void 0,this.morphTargetInfluences=void 0,this.updateMorphTargets()}copy(e,n){return super.copy(e,n),this.material=Array.isArray(e.material)?e.material.slice():e.material,this.geometry=e.geometry,this}computeLineDistances(){const e=this.geometry;if(e.index===null){const n=e.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;Mf.applyMatrix4(t.matrixWorld);const c=e.ray.origin.distanceTo(Mf);if(!(ce.far))return{distance:c,point:F0.clone().applyMatrix4(t.matrixWorld),index:o,face:null,faceIndex:null,barycoord:null,object:t}}const U0=new N,k0=new N;class um extends vn{constructor(e,n){super(e,n),this.isLineSegments=!0,this.type="LineSegments"}computeLineDistances(){const e=this.geometry;if(e.index===null){const n=e.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:e,face:null,faceIndex:null,barycoord:null,object:o})}}class fl extends Hn{constructor(e,n,i=rr,r,s,o,a=Sn,l=Sn,c,u=Xr,d=1){if(u!==Xr&&u!==Ks)throw new Error("DepthTexture format must be either THREE.DepthFormat or THREE.DepthStencilFormat");const f={width:e,height:n,depth:d};super(f,r,s,o,a,l,u,i,c),this.isDepthTexture=!0,this.flipY=!1,this.generateMipmaps=!1,this.compareFunction=null}copy(e){return super.copy(e),this.source=new am(Object.assign({},e.image)),this.compareFunction=e.compareFunction,this}toJSON(e){const n=super.toJSON(e);return this.compareFunction!==null&&(n.compareFunction=this.compareFunction),n}}class qP extends fl{constructor(e,n=rr,i=oo,r,s,o=Sn,a=Sn,l,c=Xr){const u={width:e,height:e,depth:1},d=[u,u,u,u,u,u];super(e,e,n,i,r,s,o,a,l,c),this.image=d,this.isCubeDepthTexture=!0,this.isCubeTexture=!0}get images(){return this.image}set images(e){this.image=e}}class Rb extends Hn{constructor(e=null){super(),this.sourceTexture=e,this.isExternalTexture=!0}copy(e){return super.copy(e),this.sourceTexture=e.sourceTexture,this}}class fm extends _t{constructor(e=1,n=1,i=4,r=8,s=1){super(),this.type="CapsuleGeometry",this.parameters={radius:e,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,d=Math.PI/2*e,f=n,h=2*d+f,g=i*2+s,v=r+1,m=new N,p=new N;for(let _=0;_<=g;_++){let y=0,x=0,M=0,A=0;if(_<=i){const b=_/i,w=b*Math.PI/2;x=-u-e*Math.cos(w),M=e*Math.sin(w),A=-e*Math.cos(w),y=b*d}else if(_<=i+s){const b=(_-i)/s;x=-u+b*n,M=e,A=0,y=d+b*f}else{const b=(_-i-s)/i,w=b*Math.PI/2;x=u+e*Math.sin(w),M=e*Math.cos(w),A=e*Math.sin(w),y=d+f+b*d}const P=Math.max(0,Math.min(1,y/h));let D=0;_===0?D=.5/r:_===g&&(D=-.5/r);for(let b=0;b<=r;b++){const w=b/r,I=w*Math.PI*2,L=Math.sin(I),V=Math.cos(I);p.x=-M*V,p.y=x,p.z=M*L,a.push(p.x,p.y,p.z),m.set(-M*V,A,M*L),m.normalize(),l.push(m.x,m.y,m.z),c.push(w+D,P)}if(_>0){const b=(_-1)*v;for(let w=0;w0&&y(!0),n>0&&y(!1)),this.setIndex(u),this.setAttribute("position",new ct(d,3)),this.setAttribute("normal",new ct(f,3)),this.setAttribute("uv",new ct(h,2));function _(){const x=new N,M=new N;let A=0;const P=(n-e)/i;for(let D=0;D<=s;D++){const b=[],w=D/s,I=w*(n-e)+e;for(let L=0;L<=r;L++){const V=L/r,$=V*l+a,X=Math.sin($),W=Math.cos($);M.x=I*X,M.y=-w*i+m,M.z=I*W,d.push(M.x,M.y,M.z),x.set(X,P,W).normalize(),f.push(x.x,x.y,x.z),h.push(V,1-w),b.push(g++)}v.push(b)}for(let D=0;D0||b!==0)&&(u.push(w,I,V),A+=3),(n>0||b!==s-1)&&(u.push(I,L,V),A+=3)}c.addGroup(p,A,0),p+=A}function y(x){const M=g,A=new xe,P=new N;let D=0;const b=x===!0?e:n,w=x===!0?1:-1;for(let L=1;L<=r;L++)d.push(0,m*w,0),f.push(0,w,0),h.push(.5,.5),g++;const I=g;for(let L=0;L<=r;L++){const $=L/r*l+a,X=Math.cos($),W=Math.sin($);P.x=b*W,P.y=m*w,P.z=b*X,d.push(P.x,P.y,P.z),f.push(0,w,0),A.x=X*.5+.5,A.y=W*.5*w+.5,h.push(A.x,A.y),g++}for(let L=0;L.9&&P<.1&&(y<.2&&(o[_+0]+=1),x<.2&&(o[_+2]+=1),M<.2&&(o[_+4]+=1))}}function f(_){s.push(_.x,_.y,_.z)}function h(_,y){const x=_*3;y.x=e[x+0],y.y=e[x+1],y.z=e[x+2]}function g(){const _=new N,y=new N,x=new N,M=new N,A=new xe,P=new xe,D=new xe;for(let b=0,w=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,h=(o-u)/f;return(r+h)/(s-1)}getTangent(e,n){let r=e-1e-4,s=e+1e-4;r<0&&(r=0),s>1&&(s=1);const o=this.getPoint(r),a=this.getPoint(s),l=n||(o.isVector2?new xe:new N);return l.copy(a).sub(o).normalize(),l}getTangentAt(e,n){const i=this.getUtoTmapping(e);return this.getTangent(i,n)}computeFrenetFrames(e,n=!1){const i=new N,r=[],s=[],o=[],a=new N,l=new yt;for(let h=0;h<=e;h++){const g=h/e;r[h]=this.getTangentAt(g,new N)}s[0]=new N,o[0]=new N;let c=Number.MAX_VALUE;const u=Math.abs(r[0].x),d=Math.abs(r[0].y),f=Math.abs(r[0].z);u<=c&&(c=u,i.set(1,0,0)),d<=c&&(c=d,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 h=1;h<=e;h++){if(s[h]=s[h-1].clone(),o[h]=o[h-1].clone(),a.crossVectors(r[h-1],r[h]),a.length()>Number.EPSILON){a.normalize();const g=Math.acos(ht(r[h-1].dot(r[h]),-1,1));s[h].applyMatrix4(l.makeRotationAxis(a,g))}o[h].crossVectors(r[h],s[h])}if(n===!0){let h=Math.acos(ht(s[0].dot(s[e]),-1,1));h/=e,r[0].dot(a.crossVectors(s[0],s[e]))>0&&(h=-h);for(let g=1;g<=e;g++)s[g].applyMatrix4(l.makeRotationAxis(r[g],h*g)),o[g].crossVectors(r[g],s[g])}return{tangents:r,normals:s,binormals:o}}clone(){return new this.constructor().copy(this)}copy(e){return this.arcLengthDivisions=e.arcLengthDivisions,this}toJSON(){const e={metadata:{version:4.7,type:"Curve",generator:"Curve.toJSON"}};return e.arcLengthDivisions=this.arcLengthDivisions,e.type=this.type,e}fromJSON(e){return this.arcLengthDivisions=e.arcLengthDivisions,this}}class mm extends ur{constructor(e=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=e,this.aY=n,this.xRadius=i,this.yRadius=r,this.aStartAngle=s,this.aEndAngle=o,this.aClockwise=a,this.aRotation=l}getPoint(e,n=new xe){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]:(gc.subVectors(r[0],r[1]).add(r[0]),c=gc);const d=r[a%s],f=r[(a+1)%s];if(this.closed||a+2r.length-2?r.length-1:o+1],d=r[o>r.length-3?r.length-1:o+2];return i.set(V0(a,l.x,c.x,u.x,d.x),V0(a,l.y,c.y,u.y,d.y)),i}copy(e){super.copy(e),this.points=[];for(let n=0,i=e.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 e=this.getCurveLengths();return e[e.length-1]}updateArcLengths(){this.needsUpdate=!0,this.cacheLengths=null,this.getCurveLengths()}getCurveLengths(){if(this.cacheLengths&&this.cacheLengths.length===this.curves.length)return this.cacheLengths;const e=[];let n=0;for(let i=0,r=this.curves.length;i1&&!n[n.length-1].equals(n[0])&&n.push(n[0]),n}copy(e){super.copy(e),this.curves=[];for(let n=0,i=e.curves.length;n0){const d=c.getPoint(0);d.equals(this.currentPoint)||this.lineTo(d.x,d.y)}this.curves.push(c);const u=c.getPoint(1);return this.currentPoint.copy(u),this}copy(e){return super.copy(e),this.currentPoint.copy(e.currentPoint),this}toJSON(){const e=super.toJSON();return e.currentPoint=this.currentPoint.toArray(),e}fromJSON(e){return super.fromJSON(e),this.currentPoint.fromArray(e.currentPoint),this}}class zc extends lp{constructor(e){super(e),this.uuid=ho(),this.type="Shape",this.holes=[]}getPointsHoles(e){const n=[];for(let i=0,r=this.holes.length;i80*n){a=t[0],l=t[1];let u=a,d=l;for(let f=n;fu&&(u=h),g>d&&(d=g)}c=Math.max(u-a,d-l),c=c!==0?32767/c:0}return hl(s,o,n,a,l,c,0),o}function Ob(t,e,n,i,r){let s;if(r===S2(t,e,n,i)>0)for(let o=e;o=e;o-=i)s=H0(o/i|0,t[o],t[o+1],s);return s&&ca(s,s.next)&&(ml(s),s=s.next),s}function ao(t,e){if(!t)return t;e||(e=t);let n=t,i;do if(i=!1,!n.steiner&&(ca(n,n.next)||$t(n.prev,n,n.next)===0)){if(ml(n),n=e=n.prev,n===n.next)break;i=!0}else n=n.next;while(i||n!==e);return e}function hl(t,e,n,i,r,s,o){if(!t)return;!o&&s&&g2(t,i,r,s);let a=t;for(;t.prev!==t.next;){const l=t.prev,c=t.next;if(s?l2(t,i,r,s):a2(t)){e.push(l.i,t.i,c.i),ml(t),t=c.next,a=c.next;continue}if(t=c,t===a){o?o===1?(t=c2(ao(t),e),hl(t,e,n,i,r,s,2)):o===2&&u2(t,e,n,i,r,s):hl(ao(t),e,n,i,r,s,1);break}}}function a2(t){const e=t.prev,n=t,i=t.next;if($t(e,n,i)>=0)return!1;const r=e.x,s=n.x,o=i.x,a=e.y,l=n.y,c=i.y,u=Math.min(r,s,o),d=Math.min(a,l,c),f=Math.max(r,s,o),h=Math.max(a,l,c);let g=i.next;for(;g!==e;){if(g.x>=u&&g.x<=f&&g.y>=d&&g.y<=h&&Ua(r,a,s,l,o,c,g.x,g.y)&&$t(g.prev,g,g.next)>=0)return!1;g=g.next}return!0}function l2(t,e,n,i){const r=t.prev,s=t,o=t.next;if($t(r,s,o)>=0)return!1;const a=r.x,l=s.x,c=o.x,u=r.y,d=s.y,f=o.y,h=Math.min(a,l,c),g=Math.min(u,d,f),v=Math.max(a,l,c),m=Math.max(u,d,f),p=cp(h,g,e,n,i),_=cp(v,m,e,n,i);let y=t.prevZ,x=t.nextZ;for(;y&&y.z>=p&&x&&x.z<=_;){if(y.x>=h&&y.x<=v&&y.y>=g&&y.y<=m&&y!==r&&y!==o&&Ua(a,u,l,d,c,f,y.x,y.y)&&$t(y.prev,y,y.next)>=0||(y=y.prevZ,x.x>=h&&x.x<=v&&x.y>=g&&x.y<=m&&x!==r&&x!==o&&Ua(a,u,l,d,c,f,x.x,x.y)&&$t(x.prev,x,x.next)>=0))return!1;x=x.nextZ}for(;y&&y.z>=p;){if(y.x>=h&&y.x<=v&&y.y>=g&&y.y<=m&&y!==r&&y!==o&&Ua(a,u,l,d,c,f,y.x,y.y)&&$t(y.prev,y,y.next)>=0)return!1;y=y.prevZ}for(;x&&x.z<=_;){if(x.x>=h&&x.x<=v&&x.y>=g&&x.y<=m&&x!==r&&x!==o&&Ua(a,u,l,d,c,f,x.x,x.y)&&$t(x.prev,x,x.next)>=0)return!1;x=x.nextZ}return!0}function c2(t,e){let n=t;do{const i=n.prev,r=n.next.next;!ca(i,r)&&Ub(i,n,n.next,r)&&pl(i,r)&&pl(r,i)&&(e.push(i.i,n.i,r.i),ml(n),ml(n.next),n=t=r),n=n.next}while(n!==t);return ao(n)}function u2(t,e,n,i,r,s){let o=t;do{let a=o.next.next;for(;a!==o.prev;){if(o.i!==a.i&&x2(o,a)){let l=kb(o,a);o=ao(o,o.next),l=ao(l,l.next),hl(o,e,n,i,r,s,0),hl(l,e,n,i,r,s,0);return}a=a.next}o=o.next}while(o!==t)}function d2(t,e,n,i){const r=[];for(let s=0,o=e.length;s=n.next.y&&n.next.y!==n.y){const d=n.x+(r-n.y)*(n.next.x-n.x)/(n.next.y-n.y);if(d<=i&&d>s&&(s=d,o=n.x=n.x&&n.x>=l&&i!==n.x&&Fb(ro.x||n.x===o.x&&m2(o,n)))&&(o=n,u=d)}n=n.next}while(n!==a);return o}function m2(t,e){return $t(t.prev,t,e.prev)<0&&$t(e.next,t,t.next)<0}function g2(t,e,n,i){let r=t;do r.z===0&&(r.z=cp(r.x,r.y,e,n,i)),r.prevZ=r.prev,r.nextZ=r.next,r=r.next;while(r!==t);r.prevZ.nextZ=null,r.prevZ=null,v2(r)}function v2(t){let e,n=1;do{let i=t,r;t=null;let s=null;for(e=0;i;){e++;let o=i,a=0;for(let c=0;c0||l>0&&o;)a!==0&&(l===0||!o||i.z<=o.z)?(r=i,i=i.nextZ,a--):(r=o,o=o.nextZ,l--),s?s.nextZ=r:t=r,r.prevZ=s,s=r;i=o}s.nextZ=null,n*=2}while(e>1);return t}function cp(t,e,n,i,r){return t=(t-n)*r|0,e=(e-i)*r|0,t=(t|t<<8)&16711935,t=(t|t<<4)&252645135,t=(t|t<<2)&858993459,t=(t|t<<1)&1431655765,e=(e|e<<8)&16711935,e=(e|e<<4)&252645135,e=(e|e<<2)&858993459,e=(e|e<<1)&1431655765,t|e<<1}function _2(t){let e=t,n=t;do(e.x=(t-o)*(s-a)&&(t-o)*(i-a)>=(n-o)*(e-a)&&(n-o)*(s-a)>=(r-o)*(i-a)}function Ua(t,e,n,i,r,s,o,a){return!(t===o&&e===a)&&Fb(t,e,n,i,r,s,o,a)}function x2(t,e){return t.next.i!==e.i&&t.prev.i!==e.i&&!y2(t,e)&&(pl(t,e)&&pl(e,t)&&b2(t,e)&&($t(t.prev,t,e.prev)||$t(t,e.prev,e))||ca(t,e)&&$t(t.prev,t,t.next)>0&&$t(e.prev,e,e.next)>0)}function $t(t,e,n){return(e.y-t.y)*(n.x-e.x)-(e.x-t.x)*(n.y-e.y)}function ca(t,e){return t.x===e.x&&t.y===e.y}function Ub(t,e,n,i){const r=_c($t(t,e,n)),s=_c($t(t,e,i)),o=_c($t(n,i,t)),a=_c($t(n,i,e));return!!(r!==s&&o!==a||r===0&&vc(t,n,e)||s===0&&vc(t,i,e)||o===0&&vc(n,t,i)||a===0&&vc(n,e,i))}function vc(t,e,n){return e.x<=Math.max(t.x,n.x)&&e.x>=Math.min(t.x,n.x)&&e.y<=Math.max(t.y,n.y)&&e.y>=Math.min(t.y,n.y)}function _c(t){return t>0?1:t<0?-1:0}function y2(t,e){let n=t;do{if(n.i!==t.i&&n.next.i!==t.i&&n.i!==e.i&&n.next.i!==e.i&&Ub(n,n.next,t,e))return!0;n=n.next}while(n!==t);return!1}function pl(t,e){return $t(t.prev,t,t.next)<0?$t(t,e,t.next)>=0&&$t(t,t.prev,e)>=0:$t(t,e,t.prev)<0||$t(t,t.next,e)<0}function b2(t,e){let n=t,i=!1;const r=(t.x+e.x)/2,s=(t.y+e.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!==t);return i}function kb(t,e){const n=up(t.i,t.x,t.y),i=up(e.i,e.x,e.y),r=t.next,s=e.prev;return t.next=e,e.prev=t,n.next=r,r.prev=n,i.next=n,n.prev=i,s.next=i,i.prev=s,i}function H0(t,e,n,i){const r=up(t,e,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 ml(t){t.next.prev=t.prev,t.prev.next=t.next,t.prevZ&&(t.prevZ.nextZ=t.nextZ),t.nextZ&&(t.nextZ.prevZ=t.prevZ)}function up(t,e,n){return{i:t,x:e,y:n,prev:null,next:null,z:0,prevZ:null,nextZ:null,steiner:!1}}function S2(t,e,n,i){let r=0;for(let s=e,o=n-i;s2&&t[e-1].equals(t[0])&&t.pop()}function W0(t,e){for(let n=0;nNumber.EPSILON){const J=Math.sqrt(S),se=Math.sqrt(oe*oe+T*T),K=q.x-ee/J,Ce=q.y+Q/J,ve=H.x-T/se,Oe=H.y+oe/se,$e=((ve-K)*T-(Oe-Ce)*oe)/(Q*T-ee*oe);Y=K+Q*$e-U.x,C=Ce+ee*$e-U.y;const ge=Y*Y+C*C;if(ge<=2)return new xe(Y,C);ae=Math.sqrt(ge/2)}else{let J=!1;Q>Number.EPSILON?oe>Number.EPSILON&&(J=!0):Q<-Number.EPSILON?oe<-Number.EPSILON&&(J=!0):Math.sign(ee)===Math.sign(T)&&(J=!0),J?(Y=-ee,C=Q,ae=Math.sqrt(S)):(Y=Q,C=ee,ae=Math.sqrt(S/2))}return new xe(Y/ae,C/ae)}const de=[];for(let U=0,q=X.length,H=q-1,Y=U+1;U=0;U--){const q=U/m,H=h*Math.cos(q*Math.PI/2),Y=g*Math.sin(q*Math.PI/2)+v;for(let C=0,ae=X.length;C=0;){const Y=H;let C=H-1;C<0&&(C=U.length-1);for(let ae=0,Q=u+m*2;ae0)&&h.push(y,x,A),(p!==i-1||l0!=e>0&&this.version++,this._anisotropy=e}get clearcoat(){return this._clearcoat}set clearcoat(e){this._clearcoat>0!=e>0&&this.version++,this._clearcoat=e}get iridescence(){return this._iridescence}set iridescence(e){this._iridescence>0!=e>0&&this.version++,this._iridescence=e}get dispersion(){return this._dispersion}set dispersion(e){this._dispersion>0!=e>0&&this.version++,this._dispersion=e}get sheen(){return this._sheen}set sheen(e){this._sheen>0!=e>0&&this.version++,this._sheen=e}get transmission(){return this._transmission}set transmission(e){this._transmission>0!=e>0&&this.version++,this._transmission=e}copy(e){return super.copy(e),this.defines={STANDARD:"",PHYSICAL:""},this.anisotropy=e.anisotropy,this.anisotropyRotation=e.anisotropyRotation,this.anisotropyMap=e.anisotropyMap,this.clearcoat=e.clearcoat,this.clearcoatMap=e.clearcoatMap,this.clearcoatRoughness=e.clearcoatRoughness,this.clearcoatRoughnessMap=e.clearcoatRoughnessMap,this.clearcoatNormalMap=e.clearcoatNormalMap,this.clearcoatNormalScale.copy(e.clearcoatNormalScale),this.dispersion=e.dispersion,this.ior=e.ior,this.iridescence=e.iridescence,this.iridescenceMap=e.iridescenceMap,this.iridescenceIOR=e.iridescenceIOR,this.iridescenceThicknessRange=[...e.iridescenceThicknessRange],this.iridescenceThicknessMap=e.iridescenceThicknessMap,this.sheen=e.sheen,this.sheenColor.copy(e.sheenColor),this.sheenColorMap=e.sheenColorMap,this.sheenRoughness=e.sheenRoughness,this.sheenRoughnessMap=e.sheenRoughnessMap,this.transmission=e.transmission,this.transmissionMap=e.transmissionMap,this.thickness=e.thickness,this.thicknessMap=e.thicknessMap,this.attenuationDistance=e.attenuationDistance,this.attenuationColor.copy(e.attenuationColor),this.specularIntensity=e.specularIntensity,this.specularIntensityMap=e.specularIntensityMap,this.specularColor.copy(e.specularColor),this.specularColorMap=e.specularColorMap,this}}class C2 extends po{constructor(e){super(),this.isMeshDepthMaterial=!0,this.type="MeshDepthMaterial",this.depthPacking=XC,this.map=null,this.alphaMap=null,this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.wireframe=!1,this.wireframeLinewidth=1,this.setValues(e)}copy(e){return super.copy(e),this.depthPacking=e.depthPacking,this.map=e.map,this.alphaMap=e.alphaMap,this.displacementMap=e.displacementMap,this.displacementScale=e.displacementScale,this.displacementBias=e.displacementBias,this.wireframe=e.wireframe,this.wireframeLinewidth=e.wireframeLinewidth,this}}class P2 extends po{constructor(e){super(),this.isMeshDistanceMaterial=!0,this.type="MeshDistanceMaterial",this.map=null,this.alphaMap=null,this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.setValues(e)}copy(e){return super.copy(e),this.map=e.map,this.alphaMap=e.alphaMap,this.displacementMap=e.displacementMap,this.displacementScale=e.displacementScale,this.displacementBias=e.displacementBias,this}}const q0={enabled:!1,files:{},add:function(t,e){this.enabled!==!1&&(this.files[t]=e)},get:function(t){if(this.enabled!==!1)return this.files[t]},remove:function(t){delete this.files[t]},clear:function(){this.files={}}};class R2{constructor(e,n,i){const r=this;let s=!1,o=0,a=0,l;const c=[];this.onStart=void 0,this.onLoad=e,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,d){return c.push(u,d),this},this.removeHandler=function(u){const d=c.indexOf(u);return d!==-1&&c.splice(d,2),this},this.getHandler=function(u){for(let d=0,f=c.length;d{n&&n(s),this.manager.itemEnd(e)},0),s;if(br[e]!==void 0){br[e].push({onLoad:n,onProgress:i,onError:r});return}br[e]=[],br[e].push({onLoad:n,onProgress:i,onError:r});const o=new Request(e,{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&&it("FileLoader: HTTP Status 0 received."),typeof ReadableStream>"u"||c.body===void 0||c.body.getReader===void 0)return c;const u=br[e],d=c.body.getReader(),f=c.headers.get("X-File-Size")||c.headers.get("Content-Length"),h=f?parseInt(f):0,g=h!==0;let v=0;const m=new ReadableStream({start(p){_();function _(){d.read().then(({done:y,value:x})=>{if(y)p.close();else{v+=x.byteLength;const M=new ProgressEvent("progress",{lengthComputable:g,loaded:v,total:h});for(let A=0,P=u.length;A{p.error(y)})}}});return new Response(m)}else throw new I2(`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 d=/charset="?([^;"\s]*)"?/i.exec(a),f=d&&d[1]?d[1].toLowerCase():void 0,h=new TextDecoder(f);return c.arrayBuffer().then(g=>h.decode(g))}}}).then(c=>{q0.add(`file:${e}`,c);const u=br[e];delete br[e];for(let d=0,f=u.length;d{const u=br[e];if(u===void 0)throw this.manager.itemError(e),c;delete br[e];for(let d=0,f=u.length;d{this.manager.itemEnd(e)}),this.manager.itemStart(e)}setResponseType(e){return this.responseType=e,this}setMimeType(e){return this.mimeType=e,this}abort(){return this._abortController.abort(),this._abortController=new AbortController,this}}class Rl extends Ft{constructor(e,n=1){super(),this.isLight=!0,this.type="Light",this.color=new nt(e),this.intensity=n}dispose(){this.dispatchEvent({type:"dispose"})}copy(e,n){return super.copy(e,n),this.color.copy(e.color),this.intensity=e.intensity,this}toJSON(e){const n=super.toJSON(e);return n.object.color=this.color.getHex(),n.object.intensity=this.intensity,n}}const Pf=new yt,X0=new N,$0=new N;class xm{constructor(e){this.camera=e,this.intensity=1,this.bias=0,this.normalBias=0,this.radius=1,this.blurSamples=8,this.mapSize=new xe(512,512),this.mapType=li,this.map=null,this.mapPass=null,this.matrix=new yt,this.autoUpdate=!0,this.needsUpdate=!1,this._frustum=new cm,this._frameExtents=new xe(1,1),this._viewportCount=1,this._viewports=[new Zt(0,0,1,1)]}getViewportCount(){return this._viewportCount}getFrustum(){return this._frustum}updateMatrices(e){const n=this.camera,i=this.matrix;X0.setFromMatrixPosition(e.matrixWorld),n.position.copy(X0),$0.setFromMatrixPosition(e.target.matrixWorld),n.lookAt($0),n.updateMatrixWorld(),Pf.multiplyMatrices(n.projectionMatrix,n.matrixWorldInverse),this._frustum.setFromProjectionMatrix(Pf,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(Pf)}getViewport(e){return this._viewports[e]}getFrameExtents(){return this._frameExtents}dispose(){this.map&&this.map.dispose(),this.mapPass&&this.mapPass.dispose()}copy(e){return this.camera=e.camera.clone(),this.intensity=e.intensity,this.bias=e.bias,this.radius=e.radius,this.autoUpdate=e.autoUpdate,this.needsUpdate=e.needsUpdate,this.normalBias=e.normalBias,this.blurSamples=e.blurSamples,this.mapSize.copy(e.mapSize),this}clone(){return new this.constructor().copy(this)}toJSON(){const e={};return this.intensity!==1&&(e.intensity=this.intensity),this.bias!==0&&(e.bias=this.bias),this.normalBias!==0&&(e.normalBias=this.normalBias),this.radius!==1&&(e.radius=this.radius),(this.mapSize.x!==512||this.mapSize.y!==512)&&(e.mapSize=this.mapSize.toArray()),e.camera=this.camera.toJSON(!1).object,delete e.camera.matrix,e}}class L2 extends xm{constructor(){super(new Yn(50,1,.5,500)),this.isSpotLightShadow=!0,this.focus=1,this.aspect=1}updateMatrices(e){const n=this.camera,i=aa*2*e.angle*this.focus,r=this.mapSize.width/this.mapSize.height*this.aspect,s=e.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(e)}copy(e){return super.copy(e),this.focus=e.focus,this}}class O2 extends Rl{constructor(e,n,i=0,r=Math.PI/3,s=0,o=2){super(e,n),this.isSpotLight=!0,this.type="SpotLight",this.position.copy(Ft.DEFAULT_UP),this.updateMatrix(),this.target=new Ft,this.distance=i,this.angle=r,this.penumbra=s,this.decay=o,this.map=null,this.shadow=new L2}get power(){return this.intensity*Math.PI}set power(e){this.intensity=e/Math.PI}dispose(){super.dispose(),this.shadow.dispose()}copy(e,n){return super.copy(e,n),this.distance=e.distance,this.angle=e.angle,this.penumbra=e.penumbra,this.decay=e.decay,this.target=e.target.clone(),this.map=e.map,this.shadow=e.shadow.clone(),this}toJSON(e){const n=super.toJSON(e);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(e).uuid),n.object.shadow=this.shadow.toJSON(),n}}class F2 extends xm{constructor(){super(new Yn(90,1,.5,500)),this.isPointLightShadow=!0}}class U2 extends Rl{constructor(e,n,i=0,r=2){super(e,n),this.isPointLight=!0,this.type="PointLight",this.distance=i,this.decay=r,this.shadow=new F2}get power(){return this.intensity*4*Math.PI}set power(e){this.intensity=e/(4*Math.PI)}dispose(){super.dispose(),this.shadow.dispose()}copy(e,n){return super.copy(e,n),this.distance=e.distance,this.decay=e.decay,this.shadow=e.shadow.clone(),this}toJSON(e){const n=super.toJSON(e);return n.object.distance=this.distance,n.object.decay=this.decay,n.object.shadow=this.shadow.toJSON(),n}}class ym extends Ab{constructor(e=-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=e,this.right=n,this.top=i,this.bottom=r,this.near=s,this.far=o,this.updateProjectionMatrix()}copy(e,n){return super.copy(e,n),this.left=e.left,this.right=e.right,this.top=e.top,this.bottom=e.bottom,this.near=e.near,this.far=e.far,this.zoom=e.zoom,this.view=e.view===null?null:Object.assign({},e.view),this}setViewOffset(e,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=e,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 e=(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-e,o=i+e,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(e){const n=super.toJSON(e);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 k2 extends xm{constructor(){super(new ym(-5,5,5,-5,.5,500)),this.isDirectionalLightShadow=!0}}class Bb extends Rl{constructor(e,n){super(e,n),this.isDirectionalLight=!0,this.type="DirectionalLight",this.position.copy(Ft.DEFAULT_UP),this.updateMatrix(),this.target=new Ft,this.shadow=new k2}dispose(){super.dispose(),this.shadow.dispose()}copy(e){return super.copy(e),this.target=e.target.clone(),this.shadow=e.shadow.clone(),this}toJSON(e){const n=super.toJSON(e);return n.object.shadow=this.shadow.toJSON(),n.object.target=this.target.uuid,n}}class zb extends Rl{constructor(e,n){super(e,n),this.isAmbientLight=!0,this.type="AmbientLight"}}class B2 extends Rl{constructor(e,n,i=10,r=10){super(e,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(e){this.intensity=e/(this.width*this.height*Math.PI)}copy(e){return super.copy(e),this.width=e.width,this.height=e.height,this}toJSON(e){const n=super.toJSON(e);return n.object.width=this.width,n.object.height=this.height,n}}class z2 extends Yn{constructor(e=[]){super(),this.isArrayCamera=!0,this.isMultiViewCamera=!1,this.cameras=e}}const j0=new yt;class Vb{constructor(e,n,i=0,r=1/0){this.ray=new Al(e,n),this.near=i,this.far=r,this.camera=null,this.layers=new lm,this.params={Mesh:{},Line:{threshold:1},LOD:{},Points:{threshold:1},Sprite:{}}}set(e,n){this.ray.set(e,n)}setFromCamera(e,n){n.isPerspectiveCamera?(this.ray.origin.setFromMatrixPosition(n.matrixWorld),this.ray.direction.set(e.x,e.y,.5).unproject(n).sub(this.ray.origin).normalize(),this.camera=n):n.isOrthographicCamera?(this.ray.origin.set(e.x,e.y,(n.near+n.far)/(n.near-n.far)).unproject(n),this.ray.direction.set(0,0,-1).transformDirection(n.matrixWorld),this.camera=n):bt("Raycaster: Unsupported camera type: "+n.type)}setFromXRController(e){return j0.identity().extractRotation(e.matrixWorld),this.ray.origin.setFromMatrixPosition(e.matrixWorld),this.ray.direction.set(0,0,-1).applyMatrix4(j0),this}intersectObject(e,n=!0,i=[]){return dp(e,this,i,n),i.sort(Y0),i}intersectObjects(e,n=!0,i=[]){for(let r=0,s=e.length;r.99999)this.quaternion.set(0,0,0,1);else if(e.y<-.99999)this.quaternion.set(1,0,0,0);else{ev.set(e.z,0,-e.x).normalize();const n=Math.acos(e.y);this.quaternion.setFromAxisAngle(ev,n)}}setLength(e,n=e*.2,i=n*.2){this.line.scale.set(1,Math.max(1e-4,e-n),1),this.line.updateMatrix(),this.cone.scale.set(i,n,i),this.cone.position.y=e,this.cone.updateMatrix()}setColor(e){this.line.material.color.set(e),this.cone.material.color.set(e)}copy(e){return super.copy(e,!1),this.line.copy(e.line),this.cone.copy(e.cone),this}dispose(){this.line.geometry.dispose(),this.line.material.dispose(),this.cone.geometry.dispose(),this.cone.material.dispose()}}class Hb extends um{constructor(e=1){const n=[0,0,0,e,0,0,0,0,0,0,e,0,0,0,0,0,0,e],i=[1,0,0,1,.6,0,0,1,0,.6,1,0,0,0,1,0,.6,1],r=new _t;r.setAttribute("position",new ct(n,3)),r.setAttribute("color",new ct(i,3));const s=new Si({vertexColors:!0,toneMapped:!1});super(r,s),this.type="AxesHelper"}setColors(e,n,i){const r=new nt,s=this.geometry.attributes.color.array;return r.set(e),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 q2{constructor(){this.type="ShapePath",this.color=new nt,this.subPaths=[],this.currentPath=null}moveTo(e,n){return this.currentPath=new lp,this.subPaths.push(this.currentPath),this.currentPath.moveTo(e,n),this}lineTo(e,n){return this.currentPath.lineTo(e,n),this}quadraticCurveTo(e,n,i,r){return this.currentPath.quadraticCurveTo(e,n,i,r),this}bezierCurveTo(e,n,i,r,s,o){return this.currentPath.bezierCurveTo(e,n,i,r,s,o),this}splineThru(e){return this.currentPath.splineThru(e),this}toShapes(e){function n(p){const _=[];for(let y=0,x=p.length;yNumber.EPSILON){if(w<0&&(P=_[A],b=-b,D=_[M],w=-w),p.yD.y)continue;if(p.y===P.y){if(p.x===P.x)return!0}else{const I=w*(p.x-P.x)-b*(p.y-P.y);if(I===0)return!0;if(I<0)continue;x=!x}}else{if(p.y!==P.y)continue;if(D.x<=p.x&&p.x<=P.x||P.x<=p.x&&p.x<=D.x)return!0}}return x}const r=Zs.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 zc,l.curves=a.curves,c.push(l),c;let u=!r(s[0].getPoints());u=e?!u:u;const d=[],f=[];let h=[],g=0,v;f[g]=void 0,h[g]=[];for(let p=0,_=s.length;p<_;p++)a=s[p],v=a.getPoints(),o=r(v),o=e?!o:o,o?(!u&&f[g]&&g++,f[g]={s:new zc,p:v},f[g].s.curves=a.curves,u&&g++,h[g]=[]):h[g].push({h:a,p:v[0]});if(!f[0])return n(s);if(f.length>1){let p=!1,_=0;for(let y=0,x=f.length;y0&&p===!1&&(h=d)}let m;for(let p=0,_=f.length;p<_;p++){l=f[p].s,c.push(l),m=h[p];for(let y=0,x=m.length;yh.start-g.start);let f=0;for(let h=1;h #include #include -}`,pt={alphahash_fragment:j2,alphahash_pars_fragment:Y2,alphamap_fragment:J2,alphamap_pars_fragment:K2,alphatest_fragment:Z2,alphatest_pars_fragment:Q2,aomap_fragment:eR,aomap_pars_fragment:tR,batching_pars_vertex:nR,batching_vertex:iR,begin_vertex:rR,beginnormal_vertex:sR,bsdfs:oR,iridescence_fragment:aR,bumpmap_pars_fragment:lR,clipping_planes_fragment:cR,clipping_planes_pars_fragment:uR,clipping_planes_pars_vertex:dR,clipping_planes_vertex:fR,color_fragment:hR,color_pars_fragment:pR,color_pars_vertex:mR,color_vertex:gR,common:vR,cube_uv_reflection_fragment:_R,defaultnormal_vertex:xR,displacementmap_pars_vertex:yR,displacementmap_vertex:bR,emissivemap_fragment:SR,emissivemap_pars_fragment:wR,colorspace_fragment:MR,colorspace_pars_fragment:ER,envmap_fragment:TR,envmap_common_pars_fragment:AR,envmap_pars_fragment:CR,envmap_pars_vertex:PR,envmap_physical_pars_fragment:zR,envmap_vertex:RR,fog_vertex:DR,fog_pars_vertex:IR,fog_fragment:NR,fog_pars_fragment:LR,gradientmap_pars_fragment:OR,lightmap_pars_fragment:FR,lights_lambert_fragment:UR,lights_lambert_pars_fragment:kR,lights_pars_begin:BR,lights_toon_fragment:VR,lights_toon_pars_fragment:HR,lights_phong_fragment:GR,lights_phong_pars_fragment:WR,lights_physical_fragment:qR,lights_physical_pars_fragment:XR,lights_fragment_begin:$R,lights_fragment_maps:jR,lights_fragment_end:YR,logdepthbuf_fragment:JR,logdepthbuf_pars_fragment:KR,logdepthbuf_pars_vertex:ZR,logdepthbuf_vertex:QR,map_fragment:e3,map_pars_fragment:t3,map_particle_fragment:n3,map_particle_pars_fragment:i3,metalnessmap_fragment:r3,metalnessmap_pars_fragment:s3,morphinstance_vertex:o3,morphcolor_vertex:a3,morphnormal_vertex:l3,morphtarget_pars_vertex:c3,morphtarget_vertex:u3,normal_fragment_begin:d3,normal_fragment_maps:f3,normal_pars_fragment:h3,normal_pars_vertex:p3,normal_vertex:m3,normalmap_pars_fragment:g3,clearcoat_normal_fragment_begin:v3,clearcoat_normal_fragment_maps:_3,clearcoat_pars_fragment:x3,iridescence_pars_fragment:y3,opaque_fragment:b3,packing:S3,premultiplied_alpha_fragment:w3,project_vertex:M3,dithering_fragment:E3,dithering_pars_fragment:T3,roughnessmap_fragment:A3,roughnessmap_pars_fragment:C3,shadowmap_pars_fragment:P3,shadowmap_pars_vertex:R3,shadowmap_vertex:D3,shadowmask_pars_fragment:I3,skinbase_vertex:N3,skinning_pars_vertex:L3,skinning_vertex:O3,skinnormal_vertex:F3,specularmap_fragment:U3,specularmap_pars_fragment:k3,tonemapping_fragment:B3,tonemapping_pars_fragment:z3,transmission_fragment:V3,transmission_pars_fragment:H3,uv_pars_fragment:G3,uv_pars_vertex:W3,uv_vertex:q3,worldpos_vertex:X3,background_vert:$3,background_frag:j3,backgroundCube_vert:Y3,backgroundCube_frag:J3,cube_vert:K3,cube_frag:Z3,depth_vert:Q3,depth_frag:eD,distance_vert:tD,distance_frag:nD,equirect_vert:iD,equirect_frag:rD,linedashed_vert:sD,linedashed_frag:oD,meshbasic_vert:aD,meshbasic_frag:lD,meshlambert_vert:cD,meshlambert_frag:uD,meshmatcap_vert:dD,meshmatcap_frag:fD,meshnormal_vert:hD,meshnormal_frag:pD,meshphong_vert:mD,meshphong_frag:gD,meshphysical_vert:vD,meshphysical_frag:_D,meshtoon_vert:xD,meshtoon_frag:yD,points_vert:bD,points_frag:SD,shadow_vert:wD,shadow_frag:MD,sprite_vert:ED,sprite_frag:TD},De={common:{diffuse:{value:new nt(16777215)},opacity:{value:1},map:{value:null},mapTransform:{value:new ft},alphaMap:{value:null},alphaMapTransform:{value:new ft},alphaTest:{value:0}},specularmap:{specularMap:{value:null},specularMapTransform:{value:new ft}},envmap:{envMap:{value:null},envMapRotation:{value:new ft},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 ft}},lightmap:{lightMap:{value:null},lightMapIntensity:{value:1},lightMapTransform:{value:new ft}},bumpmap:{bumpMap:{value:null},bumpMapTransform:{value:new ft},bumpScale:{value:1}},normalmap:{normalMap:{value:null},normalMapTransform:{value:new ft},normalScale:{value:new xe(1,1)}},displacementmap:{displacementMap:{value:null},displacementMapTransform:{value:new ft},displacementScale:{value:1},displacementBias:{value:0}},emissivemap:{emissiveMap:{value:null},emissiveMapTransform:{value:new ft}},metalnessmap:{metalnessMap:{value:null},metalnessMapTransform:{value:new ft}},roughnessmap:{roughnessMap:{value:null},roughnessMapTransform:{value:new ft}},gradientmap:{gradientMap:{value:null}},fog:{fogDensity:{value:25e-5},fogNear:{value:1},fogFar:{value:2e3},fogColor:{value:new nt(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 nt(16777215)},opacity:{value:1},size:{value:1},scale:{value:1},map:{value:null},alphaMap:{value:null},alphaMapTransform:{value:new ft},alphaTest:{value:0},uvTransform:{value:new ft}},sprite:{diffuse:{value:new nt(16777215)},opacity:{value:1},center:{value:new xe(.5,.5)},rotation:{value:0},map:{value:null},mapTransform:{value:new ft},alphaMap:{value:null},alphaMapTransform:{value:new ft},alphaTest:{value:0}}},ji={basic:{uniforms:Bn([De.common,De.specularmap,De.envmap,De.aomap,De.lightmap,De.fog]),vertexShader:pt.meshbasic_vert,fragmentShader:pt.meshbasic_frag},lambert:{uniforms:Bn([De.common,De.specularmap,De.envmap,De.aomap,De.lightmap,De.emissivemap,De.bumpmap,De.normalmap,De.displacementmap,De.fog,De.lights,{emissive:{value:new nt(0)}}]),vertexShader:pt.meshlambert_vert,fragmentShader:pt.meshlambert_frag},phong:{uniforms:Bn([De.common,De.specularmap,De.envmap,De.aomap,De.lightmap,De.emissivemap,De.bumpmap,De.normalmap,De.displacementmap,De.fog,De.lights,{emissive:{value:new nt(0)},specular:{value:new nt(1118481)},shininess:{value:30}}]),vertexShader:pt.meshphong_vert,fragmentShader:pt.meshphong_frag},standard:{uniforms:Bn([De.common,De.envmap,De.aomap,De.lightmap,De.emissivemap,De.bumpmap,De.normalmap,De.displacementmap,De.roughnessmap,De.metalnessmap,De.fog,De.lights,{emissive:{value:new nt(0)},roughness:{value:1},metalness:{value:0},envMapIntensity:{value:1}}]),vertexShader:pt.meshphysical_vert,fragmentShader:pt.meshphysical_frag},toon:{uniforms:Bn([De.common,De.aomap,De.lightmap,De.emissivemap,De.bumpmap,De.normalmap,De.displacementmap,De.gradientmap,De.fog,De.lights,{emissive:{value:new nt(0)}}]),vertexShader:pt.meshtoon_vert,fragmentShader:pt.meshtoon_frag},matcap:{uniforms:Bn([De.common,De.bumpmap,De.normalmap,De.displacementmap,De.fog,{matcap:{value:null}}]),vertexShader:pt.meshmatcap_vert,fragmentShader:pt.meshmatcap_frag},points:{uniforms:Bn([De.points,De.fog]),vertexShader:pt.points_vert,fragmentShader:pt.points_frag},dashed:{uniforms:Bn([De.common,De.fog,{scale:{value:1},dashSize:{value:1},totalSize:{value:2}}]),vertexShader:pt.linedashed_vert,fragmentShader:pt.linedashed_frag},depth:{uniforms:Bn([De.common,De.displacementmap]),vertexShader:pt.depth_vert,fragmentShader:pt.depth_frag},normal:{uniforms:Bn([De.common,De.bumpmap,De.normalmap,De.displacementmap,{opacity:{value:1}}]),vertexShader:pt.meshnormal_vert,fragmentShader:pt.meshnormal_frag},sprite:{uniforms:Bn([De.sprite,De.fog]),vertexShader:pt.sprite_vert,fragmentShader:pt.sprite_frag},background:{uniforms:{uvTransform:{value:new ft},t2D:{value:null},backgroundIntensity:{value:1}},vertexShader:pt.background_vert,fragmentShader:pt.background_frag},backgroundCube:{uniforms:{envMap:{value:null},flipEnvMap:{value:-1},backgroundBlurriness:{value:0},backgroundIntensity:{value:1},backgroundRotation:{value:new ft}},vertexShader:pt.backgroundCube_vert,fragmentShader:pt.backgroundCube_frag},cube:{uniforms:{tCube:{value:null},tFlip:{value:-1},opacity:{value:1}},vertexShader:pt.cube_vert,fragmentShader:pt.cube_frag},equirect:{uniforms:{tEquirect:{value:null}},vertexShader:pt.equirect_vert,fragmentShader:pt.equirect_frag},distance:{uniforms:Bn([De.common,De.displacementmap,{referencePosition:{value:new N},nearDistance:{value:1},farDistance:{value:1e3}}]),vertexShader:pt.distance_vert,fragmentShader:pt.distance_frag},shadow:{uniforms:Bn([De.lights,De.fog,{color:{value:new nt(0)},opacity:{value:1}}]),vertexShader:pt.shadow_vert,fragmentShader:pt.shadow_frag}};ji.physical={uniforms:Bn([ji.standard.uniforms,{clearcoat:{value:0},clearcoatMap:{value:null},clearcoatMapTransform:{value:new ft},clearcoatNormalMap:{value:null},clearcoatNormalMapTransform:{value:new ft},clearcoatNormalScale:{value:new xe(1,1)},clearcoatRoughness:{value:0},clearcoatRoughnessMap:{value:null},clearcoatRoughnessMapTransform:{value:new ft},dispersion:{value:0},iridescence:{value:0},iridescenceMap:{value:null},iridescenceMapTransform:{value:new ft},iridescenceIOR:{value:1.3},iridescenceThicknessMinimum:{value:100},iridescenceThicknessMaximum:{value:400},iridescenceThicknessMap:{value:null},iridescenceThicknessMapTransform:{value:new ft},sheen:{value:0},sheenColor:{value:new nt(0)},sheenColorMap:{value:null},sheenColorMapTransform:{value:new ft},sheenRoughness:{value:1},sheenRoughnessMap:{value:null},sheenRoughnessMapTransform:{value:new ft},transmission:{value:0},transmissionMap:{value:null},transmissionMapTransform:{value:new ft},transmissionSamplerSize:{value:new xe},transmissionSamplerMap:{value:null},thickness:{value:0},thicknessMap:{value:null},thicknessMapTransform:{value:new ft},attenuationDistance:{value:0},attenuationColor:{value:new nt(0)},specularColor:{value:new nt(1,1,1)},specularColorMap:{value:null},specularColorMapTransform:{value:new ft},specularIntensity:{value:1},specularIntensityMap:{value:null},specularIntensityMapTransform:{value:new ft},anisotropyVector:{value:new xe},anisotropyMap:{value:null},anisotropyMapTransform:{value:new ft}}]),vertexShader:pt.meshphysical_vert,fragmentShader:pt.meshphysical_frag};const bc={r:0,b:0,g:0},Bs=new Oi,AD=new yt;function CD(t,e,n,i,r,s,o){const a=new nt(0);let l=s===!0?0:1,c,u,d=null,f=0,h=null;function g(y){let x=y.isScene===!0?y.background:null;return x&&x.isTexture&&(x=(y.backgroundBlurriness>0?n:e).get(x)),x}function v(y){let x=!1;const M=g(y);M===null?p(a,l):M&&M.isColor&&(p(M,1),x=!0);const A=t.xr.getEnvironmentBlendMode();A==="additive"?i.buffers.color.setClear(0,0,0,1,o):A==="alpha-blend"&&i.buffers.color.setClear(0,0,0,0,o),(t.autoClear||x)&&(i.buffers.depth.setTest(!0),i.buffers.depth.setMask(!0),i.buffers.color.setMask(!0),t.clear(t.autoClearColor,t.autoClearDepth,t.autoClearStencil))}function m(y,x){const M=g(x);M&&(M.isCubeTexture||M.mapping===Wu)?(u===void 0&&(u=new Te(new Jt(1,1,1),new Fi({name:"BackgroundCubeMaterial",uniforms:la(ji.backgroundCube.uniforms),vertexShader:ji.backgroundCube.vertexShader,fragmentShader:ji.backgroundCube.fragmentShader,side:Ln,depthTest:!1,depthWrite:!1,fog:!1,allowOverride:!1})),u.geometry.deleteAttribute("normal"),u.geometry.deleteAttribute("uv"),u.onBeforeRender=function(A,P,D){this.matrixWorld.copyPosition(D.matrixWorld)},Object.defineProperty(u.material,"envMap",{get:function(){return this.uniforms.envMap.value}}),r.update(u)),Bs.copy(x.backgroundRotation),Bs.x*=-1,Bs.y*=-1,Bs.z*=-1,M.isCubeTexture&&M.isRenderTargetTexture===!1&&(Bs.y*=-1,Bs.z*=-1),u.material.uniforms.envMap.value=M,u.material.uniforms.flipEnvMap.value=M.isCubeTexture&&M.isRenderTargetTexture===!1?-1:1,u.material.uniforms.backgroundBlurriness.value=x.backgroundBlurriness,u.material.uniforms.backgroundIntensity.value=x.backgroundIntensity,u.material.uniforms.backgroundRotation.value.setFromMatrix4(AD.makeRotationFromEuler(Bs)),u.material.toneMapped=wt.getTransfer(M.colorSpace)!==Dt,(d!==M||f!==M.version||h!==t.toneMapping)&&(u.material.needsUpdate=!0,d=M,f=M.version,h=t.toneMapping),u.layers.enableAll(),y.unshift(u,u.geometry,u.material,0,0,null)):M&&M.isTexture&&(c===void 0&&(c=new Te(new Cl(2,2),new Fi({name:"BackgroundMaterial",uniforms:la(ji.background.uniforms),vertexShader:ji.background.vertexShader,fragmentShader:ji.background.fragmentShader,side:ys,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=M,c.material.uniforms.backgroundIntensity.value=x.backgroundIntensity,c.material.toneMapped=wt.getTransfer(M.colorSpace)!==Dt,M.matrixAutoUpdate===!0&&M.updateMatrix(),c.material.uniforms.uvTransform.value.copy(M.matrix),(d!==M||f!==M.version||h!==t.toneMapping)&&(c.material.needsUpdate=!0,d=M,f=M.version,h=t.toneMapping),c.layers.enableAll(),y.unshift(c,c.geometry,c.material,0,0,null))}function p(y,x){y.getRGB(bc,Eb(t)),i.buffers.color.setClear(bc.r,bc.g,bc.b,x,o)}function _(){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,p(a,l)},getClearAlpha:function(){return l},setClearAlpha:function(y){l=y,p(a,l)},render:v,addToRenderList:m,dispose:_}}function PD(t,e){const n=t.getParameter(t.MAX_VERTEX_ATTRIBS),i={},r=f(null);let s=r,o=!1;function a(w,I,L,V,$){let X=!1;const W=d(V,L,I);s!==W&&(s=W,c(s.object)),X=h(w,V,L,$),X&&g(w,V,L,$),$!==null&&e.update($,t.ELEMENT_ARRAY_BUFFER),(X||o)&&(o=!1,x(w,I,L,V),$!==null&&t.bindBuffer(t.ELEMENT_ARRAY_BUFFER,e.get($).buffer))}function l(){return t.createVertexArray()}function c(w){return t.bindVertexArray(w)}function u(w){return t.deleteVertexArray(w)}function d(w,I,L){const V=L.wireframe===!0;let $=i[w.id];$===void 0&&($={},i[w.id]=$);let X=$[I.id];X===void 0&&(X={},$[I.id]=X);let W=X[V];return W===void 0&&(W=f(l()),X[V]=W),W}function f(w){const I=[],L=[],V=[];for(let $=0;$=0){const le=$[z];let pe=X[z];if(pe===void 0&&(z==="instanceMatrix"&&w.instanceMatrix&&(pe=w.instanceMatrix),z==="instanceColor"&&w.instanceColor&&(pe=w.instanceColor)),le===void 0||le.attribute!==pe||pe&&le.data!==pe.data)return!0;W++}return s.attributesNum!==W||s.index!==V}function g(w,I,L,V){const $={},X=I.attributes;let W=0;const B=L.getAttributes();for(const z in B)if(B[z].location>=0){let le=X[z];le===void 0&&(z==="instanceMatrix"&&w.instanceMatrix&&(le=w.instanceMatrix),z==="instanceColor"&&w.instanceColor&&(le=w.instanceColor));const pe={};pe.attribute=le,le&&le.data&&(pe.data=le.data),$[z]=pe,W++}s.attributes=$,s.attributesNum=W,s.index=V}function v(){const w=s.newAttributes;for(let I=0,L=w.length;I=0){let de=$[B];if(de===void 0&&(B==="instanceMatrix"&&w.instanceMatrix&&(de=w.instanceMatrix),B==="instanceColor"&&w.instanceColor&&(de=w.instanceColor)),de!==void 0){const le=de.normalized,pe=de.itemSize,He=e.get(de);if(He===void 0)continue;const ze=He.buffer,st=He.type,xt=He.bytesPerElement,ce=st===t.INT||st===t.UNSIGNED_INT||de.gpuType===Zp;if(de.isInterleavedBufferAttribute){const ue=de.data,Le=ue.stride,je=de.offset;if(ue.isInstancedInterleavedBuffer){for(let Ae=0;Ae0&&t.getShaderPrecisionFormat(t.FRAGMENT_SHADER,t.HIGH_FLOAT).precision>0)return"highp";P="mediump"}return P==="mediump"&&t.getShaderPrecisionFormat(t.VERTEX_SHADER,t.MEDIUM_FLOAT).precision>0&&t.getShaderPrecisionFormat(t.FRAGMENT_SHADER,t.MEDIUM_FLOAT).precision>0?"mediump":"lowp"}let c=n.precision!==void 0?n.precision:"highp";const u=l(c);u!==c&&(it("WebGLRenderer:",c,"not supported, using",u,"instead."),c=u);const d=n.logarithmicDepthBuffer===!0,f=n.reversedDepthBuffer===!0&&e.has("EXT_clip_control"),h=t.getParameter(t.MAX_TEXTURE_IMAGE_UNITS),g=t.getParameter(t.MAX_VERTEX_TEXTURE_IMAGE_UNITS),v=t.getParameter(t.MAX_TEXTURE_SIZE),m=t.getParameter(t.MAX_CUBE_MAP_TEXTURE_SIZE),p=t.getParameter(t.MAX_VERTEX_ATTRIBS),_=t.getParameter(t.MAX_VERTEX_UNIFORM_VECTORS),y=t.getParameter(t.MAX_VARYING_VECTORS),x=t.getParameter(t.MAX_FRAGMENT_UNIFORM_VECTORS),M=t.getParameter(t.MAX_SAMPLES),A=t.getParameter(t.SAMPLES);return{isWebGL2:!0,getMaxAnisotropy:s,getMaxPrecision:l,textureFormatReadable:o,textureTypeReadable:a,precision:c,logarithmicDepthBuffer:d,reversedDepthBuffer:f,maxTextures:h,maxVertexTextures:g,maxTextureSize:v,maxCubemapSize:m,maxAttributes:p,maxVertexUniforms:_,maxVaryings:y,maxFragmentUniforms:x,maxSamples:M,samples:A}}function ID(t){const e=this;let n=null,i=0,r=!1,s=!1;const o=new Mr,a=new ft,l={value:null,needsUpdate:!1};this.uniform=l,this.numPlanes=0,this.numIntersection=0,this.init=function(d,f){const h=d.length!==0||f||i!==0||r;return r=f,i=d.length,h},this.beginShadows=function(){s=!0,u(null)},this.endShadows=function(){s=!1},this.setGlobalState=function(d,f){n=u(d,f,0)},this.setState=function(d,f,h){const g=d.clippingPlanes,v=d.clipIntersection,m=d.clipShadows,p=t.get(d);if(!r||g===null||g.length===0||s&&!m)s?u(null):c();else{const _=s?0:i,y=_*4;let x=p.clippingState||null;l.value=x,x=u(g,f,y,h);for(let M=0;M!==y;++M)x[M]=n[M];p.clippingState=x,this.numIntersection=v?this.numPlanes:0,this.numPlanes+=_}};function c(){l.value!==n&&(l.value=n,l.needsUpdate=i>0),e.numPlanes=i,e.numIntersection=0}function u(d,f,h,g){const v=d!==null?d.length:0;let m=null;if(v!==0){if(m=l.value,g!==!0||m===null){const p=h+v*4,_=f.matrixWorldInverse;a.getNormalMatrix(_),(m===null||m.length0){const c=new Pb(l.height);return c.fromEquirectangularTexture(t,o),e.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=e.get(a);l!==void 0&&(e.delete(a),l.dispose())}function s(){e=new WeakMap}return{get:i,dispose:s}}const ps=4,nv=[.125,.215,.35,.446,.526,.582],js=20,LD=256,Ca=new ym,iv=new nt;let Df=null,If=0,Nf=0,Lf=!1;const OD=new N;class rv{constructor(e){this._renderer=e,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(e,n=0,i=.1,r=100,s={}){const{size:o=256,position:a=OD}=s;Df=this._renderer.getRenderTarget(),If=this._renderer.getActiveCubeFace(),Nf=this._renderer.getActiveMipmapLevel(),Lf=this._renderer.xr.enabled,this._renderer.xr.enabled=!1,this._setSize(o);const l=this._allocateTargets();return l.depthBuffer=!0,this._sceneToCubeUV(e,i,r,l,a),n>0&&this._blur(l,0,0,n),this._applyPMREM(l),this._cleanup(l),l}fromEquirectangular(e,n=null){return this._fromTexture(e,n)}fromCubemap(e,n=null){return this._fromTexture(e,n)}compileCubemapShader(){this._cubemapMaterial===null&&(this._cubemapMaterial=av(),this._compileMaterial(this._cubemapMaterial))}compileEquirectangularShader(){this._equirectMaterial===null&&(this._equirectMaterial=ov(),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(e){this._lodMax=Math.floor(Math.log2(e)),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 e=0;e2?M:0,M,M),d.setRenderTarget(r),p&&d.render(v,l),d.render(e,l)}d.toneMapping=h,d.autoClear=f,e.background=_}_textureToCubeUV(e,n){const i=this._renderer,r=e.mapping===oo||e.mapping===ra;r?(this._cubemapMaterial===null&&(this._cubemapMaterial=av()),this._cubemapMaterial.uniforms.flipEnvMap.value=e.isRenderTargetTexture===!1?-1:1):this._equirectMaterial===null&&(this._equirectMaterial=ov());const s=r?this._cubemapMaterial:this._equirectMaterial,o=this._lodMeshes[0];o.material=s;const a=s.uniforms;a.envMap.value=e;const l=this._cubeSize;Lo(n,0,0,3*l,2*l),i.setRenderTarget(n),i.render(o,Ca)}_applyPMREM(e){const n=this._renderer,i=n.autoClear;n.autoClear=!1;const r=this._lodMeshes.length;for(let s=1;sg-ps?i-g+ps:0),p=4*(this._cubeSize-v);l.envMap.value=e.texture,l.roughness.value=h,l.mipInt.value=g-n,Lo(s,m,p,3*v,2*v),r.setRenderTarget(s),r.render(a,Ca),l.envMap.value=s.texture,l.roughness.value=0,l.mipInt.value=g-i,Lo(e,m,p,3*v,2*v),r.setRenderTarget(e),r.render(a,Ca)}_blur(e,n,i,r,s){const o=this._pingPongRenderTarget;this._halfBlur(e,o,n,i,r,"latitudinal",s),this._halfBlur(o,e,i,i,r,"longitudinal",s)}_halfBlur(e,n,i,r,s,o,a){const l=this._renderer,c=this._blurMaterial;o!=="latitudinal"&&o!=="longitudinal"&&bt("blur direction must be either latitudinal or longitudinal!");const u=3,d=this._lodMeshes[r];d.material=c;const f=c.uniforms,h=this._sizeLods[i]-1,g=isFinite(s)?Math.PI/(2*h):2*Math.PI/(2*js-1),v=s/g,m=isFinite(s)?1+Math.floor(u*v):js;m>js&&it(`sigmaRadians, ${s}, is too large and will clip, as it requested ${m} samples when the maximum is set to ${js}`);const p=[];let _=0;for(let P=0;Py-ps?r-y+ps:0),A=4*(this._cubeSize-x);Lo(n,M,A,3*x,2*x),l.setRenderTarget(n),l.render(d,Ca)}}function FD(t){const e=[],n=[],i=[];let r=t;const s=t-ps+1+nv.length;for(let o=0;ot-ps?l=nv[o-t+ps-1]:o===0&&(l=0),n.push(l);const c=1/(a-2),u=-c,d=1+c,f=[u,u,d,u,d,d,u,u,d,d,u,d],h=6,g=6,v=3,m=2,p=1,_=new Float32Array(v*g*h),y=new Float32Array(m*g*h),x=new Float32Array(p*g*h);for(let A=0;A2?0:-1,b=[P,D,0,P+2/3,D,0,P+2/3,D+1,0,P,D,0,P+2/3,D+1,0,P,D+1,0];_.set(b,v*g*A),y.set(f,m*g*A);const w=[A,A,A,A,A,A];x.set(w,p*g*A)}const M=new _t;M.setAttribute("position",new Gn(_,v)),M.setAttribute("uv",new Gn(y,m)),M.setAttribute("faceIndex",new Gn(x,p)),i.push(new Te(M,null)),r>ps&&r--}return{lodMeshes:i,sizeLods:e,sigmas:n}}function sv(t,e,n){const i=new ir(t,e,n);return i.texture.mapping=Wu,i.texture.name="PMREM.cubeUv",i.scissorTest=!0,i}function Lo(t,e,n,i,r){t.viewport.set(e,n,i,r),t.scissor.set(e,n,i,r)}function UD(t,e,n){return new Fi({name:"PMREMGGXConvolution",defines:{GGX_SAMPLES:LD,CUBEUV_TEXEL_WIDTH:1/e,CUBEUV_TEXEL_HEIGHT:1/n,CUBEUV_MAX_MIP:`${t}.0`},uniforms:{envMap:{value:null},roughness:{value:0},mipInt:{value:0}},vertexShader:$u(),fragmentShader:` +}`,pt={alphahash_fragment:j2,alphahash_pars_fragment:Y2,alphamap_fragment:J2,alphamap_pars_fragment:K2,alphatest_fragment:Z2,alphatest_pars_fragment:Q2,aomap_fragment:eR,aomap_pars_fragment:tR,batching_pars_vertex:nR,batching_vertex:iR,begin_vertex:rR,beginnormal_vertex:sR,bsdfs:oR,iridescence_fragment:aR,bumpmap_pars_fragment:lR,clipping_planes_fragment:cR,clipping_planes_pars_fragment:uR,clipping_planes_pars_vertex:dR,clipping_planes_vertex:fR,color_fragment:hR,color_pars_fragment:pR,color_pars_vertex:mR,color_vertex:gR,common:vR,cube_uv_reflection_fragment:_R,defaultnormal_vertex:xR,displacementmap_pars_vertex:yR,displacementmap_vertex:bR,emissivemap_fragment:SR,emissivemap_pars_fragment:wR,colorspace_fragment:MR,colorspace_pars_fragment:ER,envmap_fragment:TR,envmap_common_pars_fragment:AR,envmap_pars_fragment:CR,envmap_pars_vertex:PR,envmap_physical_pars_fragment:zR,envmap_vertex:RR,fog_vertex:DR,fog_pars_vertex:IR,fog_fragment:NR,fog_pars_fragment:LR,gradientmap_pars_fragment:OR,lightmap_pars_fragment:FR,lights_lambert_fragment:UR,lights_lambert_pars_fragment:kR,lights_pars_begin:BR,lights_toon_fragment:VR,lights_toon_pars_fragment:HR,lights_phong_fragment:GR,lights_phong_pars_fragment:WR,lights_physical_fragment:qR,lights_physical_pars_fragment:XR,lights_fragment_begin:$R,lights_fragment_maps:jR,lights_fragment_end:YR,logdepthbuf_fragment:JR,logdepthbuf_pars_fragment:KR,logdepthbuf_pars_vertex:ZR,logdepthbuf_vertex:QR,map_fragment:e3,map_pars_fragment:t3,map_particle_fragment:n3,map_particle_pars_fragment:i3,metalnessmap_fragment:r3,metalnessmap_pars_fragment:s3,morphinstance_vertex:o3,morphcolor_vertex:a3,morphnormal_vertex:l3,morphtarget_pars_vertex:c3,morphtarget_vertex:u3,normal_fragment_begin:d3,normal_fragment_maps:f3,normal_pars_fragment:h3,normal_pars_vertex:p3,normal_vertex:m3,normalmap_pars_fragment:g3,clearcoat_normal_fragment_begin:v3,clearcoat_normal_fragment_maps:_3,clearcoat_pars_fragment:x3,iridescence_pars_fragment:y3,opaque_fragment:b3,packing:S3,premultiplied_alpha_fragment:w3,project_vertex:M3,dithering_fragment:E3,dithering_pars_fragment:T3,roughnessmap_fragment:A3,roughnessmap_pars_fragment:C3,shadowmap_pars_fragment:P3,shadowmap_pars_vertex:R3,shadowmap_vertex:D3,shadowmask_pars_fragment:I3,skinbase_vertex:N3,skinning_pars_vertex:L3,skinning_vertex:O3,skinnormal_vertex:F3,specularmap_fragment:U3,specularmap_pars_fragment:k3,tonemapping_fragment:B3,tonemapping_pars_fragment:z3,transmission_fragment:V3,transmission_pars_fragment:H3,uv_pars_fragment:G3,uv_pars_vertex:W3,uv_vertex:q3,worldpos_vertex:X3,background_vert:$3,background_frag:j3,backgroundCube_vert:Y3,backgroundCube_frag:J3,cube_vert:K3,cube_frag:Z3,depth_vert:Q3,depth_frag:eD,distance_vert:tD,distance_frag:nD,equirect_vert:iD,equirect_frag:rD,linedashed_vert:sD,linedashed_frag:oD,meshbasic_vert:aD,meshbasic_frag:lD,meshlambert_vert:cD,meshlambert_frag:uD,meshmatcap_vert:dD,meshmatcap_frag:fD,meshnormal_vert:hD,meshnormal_frag:pD,meshphong_vert:mD,meshphong_frag:gD,meshphysical_vert:vD,meshphysical_frag:_D,meshtoon_vert:xD,meshtoon_frag:yD,points_vert:bD,points_frag:SD,shadow_vert:wD,shadow_frag:MD,sprite_vert:ED,sprite_frag:TD},De={common:{diffuse:{value:new nt(16777215)},opacity:{value:1},map:{value:null},mapTransform:{value:new ft},alphaMap:{value:null},alphaMapTransform:{value:new ft},alphaTest:{value:0}},specularmap:{specularMap:{value:null},specularMapTransform:{value:new ft}},envmap:{envMap:{value:null},envMapRotation:{value:new ft},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 ft}},lightmap:{lightMap:{value:null},lightMapIntensity:{value:1},lightMapTransform:{value:new ft}},bumpmap:{bumpMap:{value:null},bumpMapTransform:{value:new ft},bumpScale:{value:1}},normalmap:{normalMap:{value:null},normalMapTransform:{value:new ft},normalScale:{value:new xe(1,1)}},displacementmap:{displacementMap:{value:null},displacementMapTransform:{value:new ft},displacementScale:{value:1},displacementBias:{value:0}},emissivemap:{emissiveMap:{value:null},emissiveMapTransform:{value:new ft}},metalnessmap:{metalnessMap:{value:null},metalnessMapTransform:{value:new ft}},roughnessmap:{roughnessMap:{value:null},roughnessMapTransform:{value:new ft}},gradientmap:{gradientMap:{value:null}},fog:{fogDensity:{value:25e-5},fogNear:{value:1},fogFar:{value:2e3},fogColor:{value:new nt(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 nt(16777215)},opacity:{value:1},size:{value:1},scale:{value:1},map:{value:null},alphaMap:{value:null},alphaMapTransform:{value:new ft},alphaTest:{value:0},uvTransform:{value:new ft}},sprite:{diffuse:{value:new nt(16777215)},opacity:{value:1},center:{value:new xe(.5,.5)},rotation:{value:0},map:{value:null},mapTransform:{value:new ft},alphaMap:{value:null},alphaMapTransform:{value:new ft},alphaTest:{value:0}}},ji={basic:{uniforms:Bn([De.common,De.specularmap,De.envmap,De.aomap,De.lightmap,De.fog]),vertexShader:pt.meshbasic_vert,fragmentShader:pt.meshbasic_frag},lambert:{uniforms:Bn([De.common,De.specularmap,De.envmap,De.aomap,De.lightmap,De.emissivemap,De.bumpmap,De.normalmap,De.displacementmap,De.fog,De.lights,{emissive:{value:new nt(0)}}]),vertexShader:pt.meshlambert_vert,fragmentShader:pt.meshlambert_frag},phong:{uniforms:Bn([De.common,De.specularmap,De.envmap,De.aomap,De.lightmap,De.emissivemap,De.bumpmap,De.normalmap,De.displacementmap,De.fog,De.lights,{emissive:{value:new nt(0)},specular:{value:new nt(1118481)},shininess:{value:30}}]),vertexShader:pt.meshphong_vert,fragmentShader:pt.meshphong_frag},standard:{uniforms:Bn([De.common,De.envmap,De.aomap,De.lightmap,De.emissivemap,De.bumpmap,De.normalmap,De.displacementmap,De.roughnessmap,De.metalnessmap,De.fog,De.lights,{emissive:{value:new nt(0)},roughness:{value:1},metalness:{value:0},envMapIntensity:{value:1}}]),vertexShader:pt.meshphysical_vert,fragmentShader:pt.meshphysical_frag},toon:{uniforms:Bn([De.common,De.aomap,De.lightmap,De.emissivemap,De.bumpmap,De.normalmap,De.displacementmap,De.gradientmap,De.fog,De.lights,{emissive:{value:new nt(0)}}]),vertexShader:pt.meshtoon_vert,fragmentShader:pt.meshtoon_frag},matcap:{uniforms:Bn([De.common,De.bumpmap,De.normalmap,De.displacementmap,De.fog,{matcap:{value:null}}]),vertexShader:pt.meshmatcap_vert,fragmentShader:pt.meshmatcap_frag},points:{uniforms:Bn([De.points,De.fog]),vertexShader:pt.points_vert,fragmentShader:pt.points_frag},dashed:{uniforms:Bn([De.common,De.fog,{scale:{value:1},dashSize:{value:1},totalSize:{value:2}}]),vertexShader:pt.linedashed_vert,fragmentShader:pt.linedashed_frag},depth:{uniforms:Bn([De.common,De.displacementmap]),vertexShader:pt.depth_vert,fragmentShader:pt.depth_frag},normal:{uniforms:Bn([De.common,De.bumpmap,De.normalmap,De.displacementmap,{opacity:{value:1}}]),vertexShader:pt.meshnormal_vert,fragmentShader:pt.meshnormal_frag},sprite:{uniforms:Bn([De.sprite,De.fog]),vertexShader:pt.sprite_vert,fragmentShader:pt.sprite_frag},background:{uniforms:{uvTransform:{value:new ft},t2D:{value:null},backgroundIntensity:{value:1}},vertexShader:pt.background_vert,fragmentShader:pt.background_frag},backgroundCube:{uniforms:{envMap:{value:null},flipEnvMap:{value:-1},backgroundBlurriness:{value:0},backgroundIntensity:{value:1},backgroundRotation:{value:new ft}},vertexShader:pt.backgroundCube_vert,fragmentShader:pt.backgroundCube_frag},cube:{uniforms:{tCube:{value:null},tFlip:{value:-1},opacity:{value:1}},vertexShader:pt.cube_vert,fragmentShader:pt.cube_frag},equirect:{uniforms:{tEquirect:{value:null}},vertexShader:pt.equirect_vert,fragmentShader:pt.equirect_frag},distance:{uniforms:Bn([De.common,De.displacementmap,{referencePosition:{value:new N},nearDistance:{value:1},farDistance:{value:1e3}}]),vertexShader:pt.distance_vert,fragmentShader:pt.distance_frag},shadow:{uniforms:Bn([De.lights,De.fog,{color:{value:new nt(0)},opacity:{value:1}}]),vertexShader:pt.shadow_vert,fragmentShader:pt.shadow_frag}};ji.physical={uniforms:Bn([ji.standard.uniforms,{clearcoat:{value:0},clearcoatMap:{value:null},clearcoatMapTransform:{value:new ft},clearcoatNormalMap:{value:null},clearcoatNormalMapTransform:{value:new ft},clearcoatNormalScale:{value:new xe(1,1)},clearcoatRoughness:{value:0},clearcoatRoughnessMap:{value:null},clearcoatRoughnessMapTransform:{value:new ft},dispersion:{value:0},iridescence:{value:0},iridescenceMap:{value:null},iridescenceMapTransform:{value:new ft},iridescenceIOR:{value:1.3},iridescenceThicknessMinimum:{value:100},iridescenceThicknessMaximum:{value:400},iridescenceThicknessMap:{value:null},iridescenceThicknessMapTransform:{value:new ft},sheen:{value:0},sheenColor:{value:new nt(0)},sheenColorMap:{value:null},sheenColorMapTransform:{value:new ft},sheenRoughness:{value:1},sheenRoughnessMap:{value:null},sheenRoughnessMapTransform:{value:new ft},transmission:{value:0},transmissionMap:{value:null},transmissionMapTransform:{value:new ft},transmissionSamplerSize:{value:new xe},transmissionSamplerMap:{value:null},thickness:{value:0},thicknessMap:{value:null},thicknessMapTransform:{value:new ft},attenuationDistance:{value:0},attenuationColor:{value:new nt(0)},specularColor:{value:new nt(1,1,1)},specularColorMap:{value:null},specularColorMapTransform:{value:new ft},specularIntensity:{value:1},specularIntensityMap:{value:null},specularIntensityMapTransform:{value:new ft},anisotropyVector:{value:new xe},anisotropyMap:{value:null},anisotropyMapTransform:{value:new ft}}]),vertexShader:pt.meshphysical_vert,fragmentShader:pt.meshphysical_frag};const bc={r:0,b:0,g:0},Bs=new Oi,AD=new yt;function CD(t,e,n,i,r,s,o){const a=new nt(0);let l=s===!0?0:1,c,u,d=null,f=0,h=null;function g(y){let x=y.isScene===!0?y.background:null;return x&&x.isTexture&&(x=(y.backgroundBlurriness>0?n:e).get(x)),x}function v(y){let x=!1;const M=g(y);M===null?p(a,l):M&&M.isColor&&(p(M,1),x=!0);const A=t.xr.getEnvironmentBlendMode();A==="additive"?i.buffers.color.setClear(0,0,0,1,o):A==="alpha-blend"&&i.buffers.color.setClear(0,0,0,0,o),(t.autoClear||x)&&(i.buffers.depth.setTest(!0),i.buffers.depth.setMask(!0),i.buffers.color.setMask(!0),t.clear(t.autoClearColor,t.autoClearDepth,t.autoClearStencil))}function m(y,x){const M=g(x);M&&(M.isCubeTexture||M.mapping===Wu)?(u===void 0&&(u=new be(new Jt(1,1,1),new Fi({name:"BackgroundCubeMaterial",uniforms:la(ji.backgroundCube.uniforms),vertexShader:ji.backgroundCube.vertexShader,fragmentShader:ji.backgroundCube.fragmentShader,side:Ln,depthTest:!1,depthWrite:!1,fog:!1,allowOverride:!1})),u.geometry.deleteAttribute("normal"),u.geometry.deleteAttribute("uv"),u.onBeforeRender=function(A,P,D){this.matrixWorld.copyPosition(D.matrixWorld)},Object.defineProperty(u.material,"envMap",{get:function(){return this.uniforms.envMap.value}}),r.update(u)),Bs.copy(x.backgroundRotation),Bs.x*=-1,Bs.y*=-1,Bs.z*=-1,M.isCubeTexture&&M.isRenderTargetTexture===!1&&(Bs.y*=-1,Bs.z*=-1),u.material.uniforms.envMap.value=M,u.material.uniforms.flipEnvMap.value=M.isCubeTexture&&M.isRenderTargetTexture===!1?-1:1,u.material.uniforms.backgroundBlurriness.value=x.backgroundBlurriness,u.material.uniforms.backgroundIntensity.value=x.backgroundIntensity,u.material.uniforms.backgroundRotation.value.setFromMatrix4(AD.makeRotationFromEuler(Bs)),u.material.toneMapped=wt.getTransfer(M.colorSpace)!==Dt,(d!==M||f!==M.version||h!==t.toneMapping)&&(u.material.needsUpdate=!0,d=M,f=M.version,h=t.toneMapping),u.layers.enableAll(),y.unshift(u,u.geometry,u.material,0,0,null)):M&&M.isTexture&&(c===void 0&&(c=new be(new Cl(2,2),new Fi({name:"BackgroundMaterial",uniforms:la(ji.background.uniforms),vertexShader:ji.background.vertexShader,fragmentShader:ji.background.fragmentShader,side:ys,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=M,c.material.uniforms.backgroundIntensity.value=x.backgroundIntensity,c.material.toneMapped=wt.getTransfer(M.colorSpace)!==Dt,M.matrixAutoUpdate===!0&&M.updateMatrix(),c.material.uniforms.uvTransform.value.copy(M.matrix),(d!==M||f!==M.version||h!==t.toneMapping)&&(c.material.needsUpdate=!0,d=M,f=M.version,h=t.toneMapping),c.layers.enableAll(),y.unshift(c,c.geometry,c.material,0,0,null))}function p(y,x){y.getRGB(bc,Eb(t)),i.buffers.color.setClear(bc.r,bc.g,bc.b,x,o)}function _(){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,p(a,l)},getClearAlpha:function(){return l},setClearAlpha:function(y){l=y,p(a,l)},render:v,addToRenderList:m,dispose:_}}function PD(t,e){const n=t.getParameter(t.MAX_VERTEX_ATTRIBS),i={},r=f(null);let s=r,o=!1;function a(w,I,L,V,$){let X=!1;const W=d(V,L,I);s!==W&&(s=W,c(s.object)),X=h(w,V,L,$),X&&g(w,V,L,$),$!==null&&e.update($,t.ELEMENT_ARRAY_BUFFER),(X||o)&&(o=!1,x(w,I,L,V),$!==null&&t.bindBuffer(t.ELEMENT_ARRAY_BUFFER,e.get($).buffer))}function l(){return t.createVertexArray()}function c(w){return t.bindVertexArray(w)}function u(w){return t.deleteVertexArray(w)}function d(w,I,L){const V=L.wireframe===!0;let $=i[w.id];$===void 0&&($={},i[w.id]=$);let X=$[I.id];X===void 0&&(X={},$[I.id]=X);let W=X[V];return W===void 0&&(W=f(l()),X[V]=W),W}function f(w){const I=[],L=[],V=[];for(let $=0;$=0){const le=$[z];let pe=X[z];if(pe===void 0&&(z==="instanceMatrix"&&w.instanceMatrix&&(pe=w.instanceMatrix),z==="instanceColor"&&w.instanceColor&&(pe=w.instanceColor)),le===void 0||le.attribute!==pe||pe&&le.data!==pe.data)return!0;W++}return s.attributesNum!==W||s.index!==V}function g(w,I,L,V){const $={},X=I.attributes;let W=0;const B=L.getAttributes();for(const z in B)if(B[z].location>=0){let le=X[z];le===void 0&&(z==="instanceMatrix"&&w.instanceMatrix&&(le=w.instanceMatrix),z==="instanceColor"&&w.instanceColor&&(le=w.instanceColor));const pe={};pe.attribute=le,le&&le.data&&(pe.data=le.data),$[z]=pe,W++}s.attributes=$,s.attributesNum=W,s.index=V}function v(){const w=s.newAttributes;for(let I=0,L=w.length;I=0){let de=$[B];if(de===void 0&&(B==="instanceMatrix"&&w.instanceMatrix&&(de=w.instanceMatrix),B==="instanceColor"&&w.instanceColor&&(de=w.instanceColor)),de!==void 0){const le=de.normalized,pe=de.itemSize,He=e.get(de);if(He===void 0)continue;const ze=He.buffer,st=He.type,xt=He.bytesPerElement,ce=st===t.INT||st===t.UNSIGNED_INT||de.gpuType===Zp;if(de.isInterleavedBufferAttribute){const ue=de.data,Le=ue.stride,je=de.offset;if(ue.isInstancedInterleavedBuffer){for(let Ae=0;Ae0&&t.getShaderPrecisionFormat(t.FRAGMENT_SHADER,t.HIGH_FLOAT).precision>0)return"highp";P="mediump"}return P==="mediump"&&t.getShaderPrecisionFormat(t.VERTEX_SHADER,t.MEDIUM_FLOAT).precision>0&&t.getShaderPrecisionFormat(t.FRAGMENT_SHADER,t.MEDIUM_FLOAT).precision>0?"mediump":"lowp"}let c=n.precision!==void 0?n.precision:"highp";const u=l(c);u!==c&&(it("WebGLRenderer:",c,"not supported, using",u,"instead."),c=u);const d=n.logarithmicDepthBuffer===!0,f=n.reversedDepthBuffer===!0&&e.has("EXT_clip_control"),h=t.getParameter(t.MAX_TEXTURE_IMAGE_UNITS),g=t.getParameter(t.MAX_VERTEX_TEXTURE_IMAGE_UNITS),v=t.getParameter(t.MAX_TEXTURE_SIZE),m=t.getParameter(t.MAX_CUBE_MAP_TEXTURE_SIZE),p=t.getParameter(t.MAX_VERTEX_ATTRIBS),_=t.getParameter(t.MAX_VERTEX_UNIFORM_VECTORS),y=t.getParameter(t.MAX_VARYING_VECTORS),x=t.getParameter(t.MAX_FRAGMENT_UNIFORM_VECTORS),M=t.getParameter(t.MAX_SAMPLES),A=t.getParameter(t.SAMPLES);return{isWebGL2:!0,getMaxAnisotropy:s,getMaxPrecision:l,textureFormatReadable:o,textureTypeReadable:a,precision:c,logarithmicDepthBuffer:d,reversedDepthBuffer:f,maxTextures:h,maxVertexTextures:g,maxTextureSize:v,maxCubemapSize:m,maxAttributes:p,maxVertexUniforms:_,maxVaryings:y,maxFragmentUniforms:x,maxSamples:M,samples:A}}function ID(t){const e=this;let n=null,i=0,r=!1,s=!1;const o=new Mr,a=new ft,l={value:null,needsUpdate:!1};this.uniform=l,this.numPlanes=0,this.numIntersection=0,this.init=function(d,f){const h=d.length!==0||f||i!==0||r;return r=f,i=d.length,h},this.beginShadows=function(){s=!0,u(null)},this.endShadows=function(){s=!1},this.setGlobalState=function(d,f){n=u(d,f,0)},this.setState=function(d,f,h){const g=d.clippingPlanes,v=d.clipIntersection,m=d.clipShadows,p=t.get(d);if(!r||g===null||g.length===0||s&&!m)s?u(null):c();else{const _=s?0:i,y=_*4;let x=p.clippingState||null;l.value=x,x=u(g,f,y,h);for(let M=0;M!==y;++M)x[M]=n[M];p.clippingState=x,this.numIntersection=v?this.numPlanes:0,this.numPlanes+=_}};function c(){l.value!==n&&(l.value=n,l.needsUpdate=i>0),e.numPlanes=i,e.numIntersection=0}function u(d,f,h,g){const v=d!==null?d.length:0;let m=null;if(v!==0){if(m=l.value,g!==!0||m===null){const p=h+v*4,_=f.matrixWorldInverse;a.getNormalMatrix(_),(m===null||m.length0){const c=new Pb(l.height);return c.fromEquirectangularTexture(t,o),e.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=e.get(a);l!==void 0&&(e.delete(a),l.dispose())}function s(){e=new WeakMap}return{get:i,dispose:s}}const ps=4,nv=[.125,.215,.35,.446,.526,.582],js=20,LD=256,Ca=new ym,iv=new nt;let Df=null,If=0,Nf=0,Lf=!1;const OD=new N;class rv{constructor(e){this._renderer=e,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(e,n=0,i=.1,r=100,s={}){const{size:o=256,position:a=OD}=s;Df=this._renderer.getRenderTarget(),If=this._renderer.getActiveCubeFace(),Nf=this._renderer.getActiveMipmapLevel(),Lf=this._renderer.xr.enabled,this._renderer.xr.enabled=!1,this._setSize(o);const l=this._allocateTargets();return l.depthBuffer=!0,this._sceneToCubeUV(e,i,r,l,a),n>0&&this._blur(l,0,0,n),this._applyPMREM(l),this._cleanup(l),l}fromEquirectangular(e,n=null){return this._fromTexture(e,n)}fromCubemap(e,n=null){return this._fromTexture(e,n)}compileCubemapShader(){this._cubemapMaterial===null&&(this._cubemapMaterial=av(),this._compileMaterial(this._cubemapMaterial))}compileEquirectangularShader(){this._equirectMaterial===null&&(this._equirectMaterial=ov(),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(e){this._lodMax=Math.floor(Math.log2(e)),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 e=0;e2?M:0,M,M),d.setRenderTarget(r),p&&d.render(v,l),d.render(e,l)}d.toneMapping=h,d.autoClear=f,e.background=_}_textureToCubeUV(e,n){const i=this._renderer,r=e.mapping===oo||e.mapping===ra;r?(this._cubemapMaterial===null&&(this._cubemapMaterial=av()),this._cubemapMaterial.uniforms.flipEnvMap.value=e.isRenderTargetTexture===!1?-1:1):this._equirectMaterial===null&&(this._equirectMaterial=ov());const s=r?this._cubemapMaterial:this._equirectMaterial,o=this._lodMeshes[0];o.material=s;const a=s.uniforms;a.envMap.value=e;const l=this._cubeSize;Lo(n,0,0,3*l,2*l),i.setRenderTarget(n),i.render(o,Ca)}_applyPMREM(e){const n=this._renderer,i=n.autoClear;n.autoClear=!1;const r=this._lodMeshes.length;for(let s=1;sg-ps?i-g+ps:0),p=4*(this._cubeSize-v);l.envMap.value=e.texture,l.roughness.value=h,l.mipInt.value=g-n,Lo(s,m,p,3*v,2*v),r.setRenderTarget(s),r.render(a,Ca),l.envMap.value=s.texture,l.roughness.value=0,l.mipInt.value=g-i,Lo(e,m,p,3*v,2*v),r.setRenderTarget(e),r.render(a,Ca)}_blur(e,n,i,r,s){const o=this._pingPongRenderTarget;this._halfBlur(e,o,n,i,r,"latitudinal",s),this._halfBlur(o,e,i,i,r,"longitudinal",s)}_halfBlur(e,n,i,r,s,o,a){const l=this._renderer,c=this._blurMaterial;o!=="latitudinal"&&o!=="longitudinal"&&bt("blur direction must be either latitudinal or longitudinal!");const u=3,d=this._lodMeshes[r];d.material=c;const f=c.uniforms,h=this._sizeLods[i]-1,g=isFinite(s)?Math.PI/(2*h):2*Math.PI/(2*js-1),v=s/g,m=isFinite(s)?1+Math.floor(u*v):js;m>js&&it(`sigmaRadians, ${s}, is too large and will clip, as it requested ${m} samples when the maximum is set to ${js}`);const p=[];let _=0;for(let P=0;Py-ps?r-y+ps:0),A=4*(this._cubeSize-x);Lo(n,M,A,3*x,2*x),l.setRenderTarget(n),l.render(d,Ca)}}function FD(t){const e=[],n=[],i=[];let r=t;const s=t-ps+1+nv.length;for(let o=0;ot-ps?l=nv[o-t+ps-1]:o===0&&(l=0),n.push(l);const c=1/(a-2),u=-c,d=1+c,f=[u,u,d,u,d,d,u,u,d,d,u,d],h=6,g=6,v=3,m=2,p=1,_=new Float32Array(v*g*h),y=new Float32Array(m*g*h),x=new Float32Array(p*g*h);for(let A=0;A2?0:-1,b=[P,D,0,P+2/3,D,0,P+2/3,D+1,0,P,D,0,P+2/3,D+1,0,P,D+1,0];_.set(b,v*g*A),y.set(f,m*g*A);const w=[A,A,A,A,A,A];x.set(w,p*g*A)}const M=new _t;M.setAttribute("position",new Gn(_,v)),M.setAttribute("uv",new Gn(y,m)),M.setAttribute("faceIndex",new Gn(x,p)),i.push(new be(M,null)),r>ps&&r--}return{lodMeshes:i,sizeLods:e,sigmas:n}}function sv(t,e,n){const i=new ir(t,e,n);return i.texture.mapping=Wu,i.texture.name="PMREM.cubeUv",i.scissorTest=!0,i}function Lo(t,e,n,i,r){t.viewport.set(e,n,i,r),t.scissor.set(e,n,i,r)}function UD(t,e,n){return new Fi({name:"PMREMGGXConvolution",defines:{GGX_SAMPLES:LD,CUBEUV_TEXEL_WIDTH:1/e,CUBEUV_TEXEL_HEIGHT:1/n,CUBEUV_MAX_MIP:`${t}.0`},uniforms:{envMap:{value:null},roughness:{value:0},mipInt:{value:0}},vertexShader:$u(),fragmentShader:` precision highp float; precision highp int; @@ -3908,7 +3908,7 @@ void main() { #ifdef SRGB_TRANSFER gl_FragColor = sRGBTransferOETF( gl_FragColor ); #endif - }`,depthTest:!1,depthWrite:!1}),c=new Te(a,l),u=new ym(-1,1,1,-1,0,1);let d=null,f=null,h=!1,g,v=null,m=[],p=!1;this.setSize=function(_,y){s.setSize(_,y),o.setSize(_,y);for(let x=0;x0&&m[0].isRenderPass===!0;const y=s.width,x=s.height;for(let M=0;M0)return t;const r=e*n;let s=lv[r];if(s===void 0&&(s=new Float32Array(r),lv[r]=s),e!==0){i.toArray(s,0);for(let o=1,a=0;o!==e;++o)a+=n,t[o].toArray(s,a)}return s}function fn(t,e){if(t.length!==e.length)return!1;for(let n=0,i=t.length;n0&&(this.seq=r.concat(s))}setValue(e,n,i,r){const s=this.map[n];s!==void 0&&s.setValue(e,i,r)}setOptional(e,n,i){const r=n[i];r!==void 0&&this.setValue(e,i,r)}static upload(e,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(e,l.value,r)}}static seqWithValue(e,n){const i=[];for(let r=0,s=e.length;r!==s;++r){const o=e[r];o.id in n&&i.push(o)}return i}}function pv(t,e,n){const i=t.createShader(e);return t.shaderSource(i,n),t.compileShader(i),i}const kI=37297;let BI=0;function zI(t,e){const n=t.split(` + }`,depthTest:!1,depthWrite:!1}),c=new be(a,l),u=new ym(-1,1,1,-1,0,1);let d=null,f=null,h=!1,g,v=null,m=[],p=!1;this.setSize=function(_,y){s.setSize(_,y),o.setSize(_,y);for(let x=0;x0&&m[0].isRenderPass===!0;const y=s.width,x=s.height;for(let M=0;M0)return t;const r=e*n;let s=lv[r];if(s===void 0&&(s=new Float32Array(r),lv[r]=s),e!==0){i.toArray(s,0);for(let o=1,a=0;o!==e;++o)a+=n,t[o].toArray(s,a)}return s}function fn(t,e){if(t.length!==e.length)return!1;for(let n=0,i=t.length;n0&&(this.seq=r.concat(s))}setValue(e,n,i,r){const s=this.map[n];s!==void 0&&s.setValue(e,i,r)}setOptional(e,n,i){const r=n[i];r!==void 0&&this.setValue(e,i,r)}static upload(e,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(e,l.value,r)}}static seqWithValue(e,n){const i=[];for(let r=0,s=e.length;r!==s;++r){const o=e[r];o.id in n&&i.push(o)}return i}}function pv(t,e,n){const i=t.createShader(e);return t.shaderSource(i,n),t.compileShader(i),i}const kI=37297;let BI=0;function zI(t,e){const n=t.split(` `),i=[],r=Math.max(e-6,0),s=Math.min(e+6,n.length);for(let o=r;o":" "} ${a}: ${n[o]}`)}return i.join(` `)}const mv=new ft;function VI(t){wt._getMatrix(mv,wt.workingColorSpace,t);const e=`mat3( ${mv.elements.map(n=>n.toFixed(4))} )`;switch(wt.getTransfer(t)){case ou:return[e,"LinearTransferOETF"];case Dt:return[e,"sRGBTransferOETF"];default:return it("WebGLProgram: Unsupported color space: ",t),[e,"LinearTransferOETF"]}}function gv(t,e,n){const i=t.getShaderParameter(e,t.COMPILE_STATUS),s=(t.getShaderInfoLog(e)||"").trim();if(i&&s==="")return"";const o=/ERROR: 0:(\d+)/.exec(s);if(o){const a=parseInt(o[1]);return n.toUpperCase()+` @@ -3959,7 +3959,7 @@ Material Type: `+I.type+` Program Info Log: `+X+` `+le+` -`+pe)}else X!==""?it("WebGLProgram: Program Info Log:",X):(W===""||B==="")&&(de=!1);de&&(I.diagnostics={runnable:z,programLog:X,vertexShader:{log:W,prefix:m},fragmentShader:{log:B,prefix:p}})}r.deleteShader(M),r.deleteShader(A),D=new Vc(r,v),b=jI(r,v)}let D;this.getUniforms=function(){return D===void 0&&P(this),D};let b;this.getAttributes=function(){return b===void 0&&P(this),b};let w=n.rendererExtensionParallelShaderCompile===!1;return this.isReady=function(){return w===!1&&(w=r.getProgramParameter(v,kI)),w},this.destroy=function(){i.releaseStatesOfProgram(this),r.deleteProgram(v),this.program=void 0},this.type=n.shaderType,this.name=n.shaderName,this.id=BI++,this.cacheKey=e,this.usedTimes=1,this.program=v,this.vertexShader=M,this.fragmentShader=A,this}let uN=0;class dN{constructor(){this.shaderCache=new Map,this.materialCache=new Map}update(e){const n=e.vertexShader,i=e.fragmentShader,r=this._getShaderStage(n),s=this._getShaderStage(i),o=this._getShaderCacheForMaterial(e);return o.has(r)===!1&&(o.add(r),r.usedTimes++),o.has(s)===!1&&(o.add(s),s.usedTimes++),this}remove(e){const n=this.materialCache.get(e);for(const i of n)i.usedTimes--,i.usedTimes===0&&this.shaderCache.delete(i.code);return this.materialCache.delete(e),this}getVertexShaderID(e){return this._getShaderStage(e.vertexShader).id}getFragmentShaderID(e){return this._getShaderStage(e.fragmentShader).id}dispose(){this.shaderCache.clear(),this.materialCache.clear()}_getShaderCacheForMaterial(e){const n=this.materialCache;let i=n.get(e);return i===void 0&&(i=new Set,n.set(e,i)),i}_getShaderStage(e){const n=this.shaderCache;let i=n.get(e);return i===void 0&&(i=new fN(e),n.set(e,i)),i}}class fN{constructor(e){this.id=uN++,this.code=e,this.usedTimes=0}}function hN(t,e,n,i,r,s,o){const a=new lm,l=new dN,c=new Set,u=[],d=new Map,f=r.logarithmicDepthBuffer;let h=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,w,I,L,V){const $=L.fog,X=V.geometry,W=b.isMeshStandardMaterial?L.environment:null,B=(b.isMeshStandardMaterial?n:e).get(b.envMap||W),z=B&&B.mapping===Wu?B.image.height:null,de=g[b.type];b.precision!==null&&(h=r.getMaxPrecision(b.precision),h!==b.precision&&it("WebGLProgram.getParameters:",b.precision,"not supported, using",h,"instead."));const le=X.morphAttributes.position||X.morphAttributes.normal||X.morphAttributes.color,pe=le!==void 0?le.length:0;let He=0;X.morphAttributes.position!==void 0&&(He=1),X.morphAttributes.normal!==void 0&&(He=2),X.morphAttributes.color!==void 0&&(He=3);let ze,st,xt,ce;if(de){const Pt=ji[de];ze=Pt.vertexShader,st=Pt.fragmentShader}else ze=b.vertexShader,st=b.fragmentShader,l.update(b),xt=l.getVertexShaderID(b),ce=l.getFragmentShaderID(b);const ue=t.getRenderTarget(),Le=t.state.buffers.depth.getReversed(),je=V.isInstancedMesh===!0,Ae=V.isBatchedMesh===!0,mt=!!b.map,O=!!b.matcap,k=!!B,U=!!b.aoMap,q=!!b.lightMap,H=!!b.bumpMap,Y=!!b.normalMap,C=!!b.displacementMap,ae=!!b.emissiveMap,Q=!!b.metalnessMap,ee=!!b.roughnessMap,oe=b.anisotropy>0,T=b.clearcoat>0,S=b.dispersion>0,F=b.iridescence>0,J=b.sheen>0,se=b.transmission>0,K=oe&&!!b.anisotropyMap,Ce=T&&!!b.clearcoatMap,ve=T&&!!b.clearcoatNormalMap,Oe=T&&!!b.clearcoatRoughnessMap,$e=F&&!!b.iridescenceMap,ge=F&&!!b.iridescenceThicknessMap,Me=J&&!!b.sheenColorMap,Pe=J&&!!b.sheenRoughnessMap,Be=!!b.specularMap,Se=!!b.specularColorMap,dt=!!b.specularIntensityMap,G=se&&!!b.transmissionMap,Ue=se&&!!b.thicknessMap,ye=!!b.gradientMap,Ve=!!b.alphaMap,_e=b.alphaTest>0,he=!!b.alphaHash,Ee=!!b.extensions;let lt=nr;b.toneMapped&&(ue===null||ue.isXRRenderTarget===!0)&&(lt=t.toneMapping);const Vt={shaderID:de,shaderType:b.type,shaderName:b.name,vertexShader:ze,fragmentShader:st,defines:b.defines,customVertexShaderID:xt,customFragmentShaderID:ce,isRawShaderMaterial:b.isRawShaderMaterial===!0,glslVersion:b.glslVersion,precision:h,batching:Ae,batchingColor:Ae&&V._colorsTexture!==null,instancing:je,instancingColor:je&&V.instanceColor!==null,instancingMorph:je&&V.morphTexture!==null,outputColorSpace:ue===null?t.outputColorSpace:ue.isXRRenderTarget===!0?ue.texture.colorSpace:oa,alphaToCoverage:!!b.alphaToCoverage,map:mt,matcap:O,envMap:k,envMapMode:k&&B.mapping,envMapCubeUVHeight:z,aoMap:U,lightMap:q,bumpMap:H,normalMap:Y,displacementMap:C,emissiveMap:ae,normalMapObjectSpace:Y&&b.normalMapType===$C,normalMapTangentSpace:Y&&b.normalMapType===xb,metalnessMap:Q,roughnessMap:ee,anisotropy:oe,anisotropyMap:K,clearcoat:T,clearcoatMap:Ce,clearcoatNormalMap:ve,clearcoatRoughnessMap:Oe,dispersion:S,iridescence:F,iridescenceMap:$e,iridescenceThicknessMap:ge,sheen:J,sheenColorMap:Me,sheenRoughnessMap:Pe,specularMap:Be,specularColorMap:Se,specularIntensityMap:dt,transmission:se,transmissionMap:G,thicknessMap:Ue,gradientMap:ye,opaque:b.transparent===!1&&b.blending===Yo&&b.alphaToCoverage===!1,alphaMap:Ve,alphaTest:_e,alphaHash:he,combine:b.combine,mapUv:mt&&v(b.map.channel),aoMapUv:U&&v(b.aoMap.channel),lightMapUv:q&&v(b.lightMap.channel),bumpMapUv:H&&v(b.bumpMap.channel),normalMapUv:Y&&v(b.normalMap.channel),displacementMapUv:C&&v(b.displacementMap.channel),emissiveMapUv:ae&&v(b.emissiveMap.channel),metalnessMapUv:Q&&v(b.metalnessMap.channel),roughnessMapUv:ee&&v(b.roughnessMap.channel),anisotropyMapUv:K&&v(b.anisotropyMap.channel),clearcoatMapUv:Ce&&v(b.clearcoatMap.channel),clearcoatNormalMapUv:ve&&v(b.clearcoatNormalMap.channel),clearcoatRoughnessMapUv:Oe&&v(b.clearcoatRoughnessMap.channel),iridescenceMapUv:$e&&v(b.iridescenceMap.channel),iridescenceThicknessMapUv:ge&&v(b.iridescenceThicknessMap.channel),sheenColorMapUv:Me&&v(b.sheenColorMap.channel),sheenRoughnessMapUv:Pe&&v(b.sheenRoughnessMap.channel),specularMapUv:Be&&v(b.specularMap.channel),specularColorMapUv:Se&&v(b.specularColorMap.channel),specularIntensityMapUv:dt&&v(b.specularIntensityMap.channel),transmissionMapUv:G&&v(b.transmissionMap.channel),thicknessMapUv:Ue&&v(b.thicknessMap.channel),alphaMapUv:Ve&&v(b.alphaMap.channel),vertexTangents:!!X.attributes.tangent&&(Y||oe),vertexColors:b.vertexColors,vertexAlphas:b.vertexColors===!0&&!!X.attributes.color&&X.attributes.color.itemSize===4,pointsUvs:V.isPoints===!0&&!!X.attributes.uv&&(mt||Ve),fog:!!$,useFog:b.fog===!0,fogExp2:!!$&&$.isFogExp2,flatShading:b.flatShading===!0&&b.wireframe===!1,sizeAttenuation:b.sizeAttenuation===!0,logarithmicDepthBuffer:f,reversedDepthBuffer:Le,skinning:V.isSkinnedMesh===!0,morphTargets:X.morphAttributes.position!==void 0,morphNormals:X.morphAttributes.normal!==void 0,morphColors:X.morphAttributes.color!==void 0,morphTargetsCount:pe,morphTextureStride:He,numDirLights:w.directional.length,numPointLights:w.point.length,numSpotLights:w.spot.length,numSpotLightMaps:w.spotLightMap.length,numRectAreaLights:w.rectArea.length,numHemiLights:w.hemi.length,numDirLightShadows:w.directionalShadowMap.length,numPointLightShadows:w.pointShadowMap.length,numSpotLightShadows:w.spotShadowMap.length,numSpotLightShadowsWithMaps:w.numSpotLightShadowsWithMaps,numLightProbes:w.numLightProbes,numClippingPlanes:o.numPlanes,numClipIntersection:o.numIntersection,dithering:b.dithering,shadowMapEnabled:t.shadowMap.enabled&&I.length>0,shadowMapType:t.shadowMap.type,toneMapping:lt,decodeVideoTexture:mt&&b.map.isVideoTexture===!0&&wt.getTransfer(b.map.colorSpace)===Dt,decodeVideoTextureEmissive:ae&&b.emissiveMap.isVideoTexture===!0&&wt.getTransfer(b.emissiveMap.colorSpace)===Dt,premultipliedAlpha:b.premultipliedAlpha,doubleSided:b.side===Vn,flipSided:b.side===Ln,useDepthPacking:b.depthPacking>=0,depthPacking:b.depthPacking||0,index0AttributeName:b.index0AttributeName,extensionClipCullDistance:Ee&&b.extensions.clipCullDistance===!0&&i.has("WEBGL_clip_cull_distance"),extensionMultiDraw:(Ee&&b.extensions.multiDraw===!0||Ae)&&i.has("WEBGL_multi_draw"),rendererExtensionParallelShaderCompile:i.has("KHR_parallel_shader_compile"),customProgramCacheKey:b.customProgramCacheKey()};return Vt.vertexUv1s=c.has(1),Vt.vertexUv2s=c.has(2),Vt.vertexUv3s=c.has(3),c.clear(),Vt}function p(b){const w=[];if(b.shaderID?w.push(b.shaderID):(w.push(b.customVertexShaderID),w.push(b.customFragmentShaderID)),b.defines!==void 0)for(const I in b.defines)w.push(I),w.push(b.defines[I]);return b.isRawShaderMaterial===!1&&(_(w,b),y(w,b),w.push(t.outputColorSpace)),w.push(b.customProgramCacheKey),w.join()}function _(b,w){b.push(w.precision),b.push(w.outputColorSpace),b.push(w.envMapMode),b.push(w.envMapCubeUVHeight),b.push(w.mapUv),b.push(w.alphaMapUv),b.push(w.lightMapUv),b.push(w.aoMapUv),b.push(w.bumpMapUv),b.push(w.normalMapUv),b.push(w.displacementMapUv),b.push(w.emissiveMapUv),b.push(w.metalnessMapUv),b.push(w.roughnessMapUv),b.push(w.anisotropyMapUv),b.push(w.clearcoatMapUv),b.push(w.clearcoatNormalMapUv),b.push(w.clearcoatRoughnessMapUv),b.push(w.iridescenceMapUv),b.push(w.iridescenceThicknessMapUv),b.push(w.sheenColorMapUv),b.push(w.sheenRoughnessMapUv),b.push(w.specularMapUv),b.push(w.specularColorMapUv),b.push(w.specularIntensityMapUv),b.push(w.transmissionMapUv),b.push(w.thicknessMapUv),b.push(w.combine),b.push(w.fogExp2),b.push(w.sizeAttenuation),b.push(w.morphTargetsCount),b.push(w.morphAttributeCount),b.push(w.numDirLights),b.push(w.numPointLights),b.push(w.numSpotLights),b.push(w.numSpotLightMaps),b.push(w.numHemiLights),b.push(w.numRectAreaLights),b.push(w.numDirLightShadows),b.push(w.numPointLightShadows),b.push(w.numSpotLightShadows),b.push(w.numSpotLightShadowsWithMaps),b.push(w.numLightProbes),b.push(w.shadowMapType),b.push(w.toneMapping),b.push(w.numClippingPlanes),b.push(w.numClipIntersection),b.push(w.depthPacking)}function y(b,w){a.disableAll(),w.instancing&&a.enable(0),w.instancingColor&&a.enable(1),w.instancingMorph&&a.enable(2),w.matcap&&a.enable(3),w.envMap&&a.enable(4),w.normalMapObjectSpace&&a.enable(5),w.normalMapTangentSpace&&a.enable(6),w.clearcoat&&a.enable(7),w.iridescence&&a.enable(8),w.alphaTest&&a.enable(9),w.vertexColors&&a.enable(10),w.vertexAlphas&&a.enable(11),w.vertexUv1s&&a.enable(12),w.vertexUv2s&&a.enable(13),w.vertexUv3s&&a.enable(14),w.vertexTangents&&a.enable(15),w.anisotropy&&a.enable(16),w.alphaHash&&a.enable(17),w.batching&&a.enable(18),w.dispersion&&a.enable(19),w.batchingColor&&a.enable(20),w.gradientMap&&a.enable(21),b.push(a.mask),a.disableAll(),w.fog&&a.enable(0),w.useFog&&a.enable(1),w.flatShading&&a.enable(2),w.logarithmicDepthBuffer&&a.enable(3),w.reversedDepthBuffer&&a.enable(4),w.skinning&&a.enable(5),w.morphTargets&&a.enable(6),w.morphNormals&&a.enable(7),w.morphColors&&a.enable(8),w.premultipliedAlpha&&a.enable(9),w.shadowMapEnabled&&a.enable(10),w.doubleSided&&a.enable(11),w.flipSided&&a.enable(12),w.useDepthPacking&&a.enable(13),w.dithering&&a.enable(14),w.transmission&&a.enable(15),w.sheen&&a.enable(16),w.opaque&&a.enable(17),w.pointsUvs&&a.enable(18),w.decodeVideoTexture&&a.enable(19),w.decodeVideoTextureEmissive&&a.enable(20),w.alphaToCoverage&&a.enable(21),b.push(a.mask)}function x(b){const w=g[b.type];let I;if(w){const L=ji[w];I=Tb.clone(L.uniforms)}else I=b.uniforms;return I}function M(b,w){let I=d.get(w);return I!==void 0?++I.usedTimes:(I=new cN(t,w,b,s),u.push(I),d.set(w,I)),I}function A(b){if(--b.usedTimes===0){const w=u.indexOf(b);u[w]=u[u.length-1],u.pop(),d.delete(b.cacheKey),b.destroy()}}function P(b){l.remove(b)}function D(){l.dispose()}return{getParameters:m,getProgramCacheKey:p,getUniforms:x,acquireProgram:M,releaseProgram:A,releaseShaderCache:P,programs:u,dispose:D}}function pN(){let t=new WeakMap;function e(o){return t.has(o)}function n(o){let a=t.get(o);return a===void 0&&(a={},t.set(o,a)),a}function i(o){t.delete(o)}function r(o,a,l){t.get(o)[a]=l}function s(){t=new WeakMap}return{has:e,get:n,remove:i,update:r,dispose:s}}function mN(t,e){return t.groupOrder!==e.groupOrder?t.groupOrder-e.groupOrder:t.renderOrder!==e.renderOrder?t.renderOrder-e.renderOrder:t.material.id!==e.material.id?t.material.id-e.material.id:t.z!==e.z?t.z-e.z:t.id-e.id}function bv(t,e){return t.groupOrder!==e.groupOrder?t.groupOrder-e.groupOrder:t.renderOrder!==e.renderOrder?t.renderOrder-e.renderOrder:t.z!==e.z?e.z-t.z:t.id-e.id}function Sv(){const t=[];let e=0;const n=[],i=[],r=[];function s(){e=0,n.length=0,i.length=0,r.length=0}function o(d,f,h,g,v,m){let p=t[e];return p===void 0?(p={id:d.id,object:d,geometry:f,material:h,groupOrder:g,renderOrder:d.renderOrder,z:v,group:m},t[e]=p):(p.id=d.id,p.object=d,p.geometry=f,p.material=h,p.groupOrder=g,p.renderOrder=d.renderOrder,p.z=v,p.group=m),e++,p}function a(d,f,h,g,v,m){const p=o(d,f,h,g,v,m);h.transmission>0?i.push(p):h.transparent===!0?r.push(p):n.push(p)}function l(d,f,h,g,v,m){const p=o(d,f,h,g,v,m);h.transmission>0?i.unshift(p):h.transparent===!0?r.unshift(p):n.unshift(p)}function c(d,f){n.length>1&&n.sort(d||mN),i.length>1&&i.sort(f||bv),r.length>1&&r.sort(f||bv)}function u(){for(let d=e,f=t.length;d=s.length?(o=new Sv,s.push(o)):o=s[r],o}function n(){t=new WeakMap}return{get:e,dispose:n}}function vN(){const t={};return{get:function(e){if(t[e.id]!==void 0)return t[e.id];let n;switch(e.type){case"DirectionalLight":n={direction:new N,color:new nt};break;case"SpotLight":n={position:new N,direction:new N,color:new nt,distance:0,coneCos:0,penumbraCos:0,decay:0};break;case"PointLight":n={position:new N,color:new nt,distance:0,decay:0};break;case"HemisphereLight":n={direction:new N,skyColor:new nt,groundColor:new nt};break;case"RectAreaLight":n={color:new nt,position:new N,halfWidth:new N,halfHeight:new N};break}return t[e.id]=n,n}}}function _N(){const t={};return{get:function(e){if(t[e.id]!==void 0)return t[e.id];let n;switch(e.type){case"DirectionalLight":n={shadowIntensity:1,shadowBias:0,shadowNormalBias:0,shadowRadius:1,shadowMapSize:new xe};break;case"SpotLight":n={shadowIntensity:1,shadowBias:0,shadowNormalBias:0,shadowRadius:1,shadowMapSize:new xe};break;case"PointLight":n={shadowIntensity:1,shadowBias:0,shadowNormalBias:0,shadowRadius:1,shadowMapSize:new xe,shadowCameraNear:1,shadowCameraFar:1e3};break}return t[e.id]=n,n}}}let xN=0;function yN(t,e){return(e.castShadow?2:0)-(t.castShadow?2:0)+(e.map?1:0)-(t.map?1:0)}function bN(t){const e=new vN,n=_N(),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 N);const r=new N,s=new yt,o=new yt;function a(c){let u=0,d=0,f=0;for(let b=0;b<9;b++)i.probe[b].set(0,0,0);let h=0,g=0,v=0,m=0,p=0,_=0,y=0,x=0,M=0,A=0,P=0;c.sort(yN);for(let b=0,w=c.length;b0&&(t.has("OES_texture_float_linear")===!0?(i.rectAreaLTC1=De.LTC_FLOAT_1,i.rectAreaLTC2=De.LTC_FLOAT_2):(i.rectAreaLTC1=De.LTC_HALF_1,i.rectAreaLTC2=De.LTC_HALF_2)),i.ambient[0]=u,i.ambient[1]=d,i.ambient[2]=f;const D=i.hash;(D.directionalLength!==h||D.pointLength!==g||D.spotLength!==v||D.rectAreaLength!==m||D.hemiLength!==p||D.numDirectionalShadows!==_||D.numPointShadows!==y||D.numSpotShadows!==x||D.numSpotMaps!==M||D.numLightProbes!==P)&&(i.directional.length=h,i.spot.length=v,i.rectArea.length=m,i.point.length=g,i.hemi.length=p,i.directionalShadow.length=_,i.directionalShadowMap.length=_,i.pointShadow.length=y,i.pointShadowMap.length=y,i.spotShadow.length=x,i.spotShadowMap.length=x,i.directionalShadowMatrix.length=_,i.pointShadowMatrix.length=y,i.spotLightMatrix.length=x+M-A,i.spotLightMap.length=M,i.numSpotLightShadowsWithMaps=A,i.numLightProbes=P,D.directionalLength=h,D.pointLength=g,D.spotLength=v,D.rectAreaLength=m,D.hemiLength=p,D.numDirectionalShadows=_,D.numPointShadows=y,D.numSpotShadows=x,D.numSpotMaps=M,D.numLightProbes=P,i.version=xN++)}function l(c,u){let d=0,f=0,h=0,g=0,v=0;const m=u.matrixWorldInverse;for(let p=0,_=c.length;p<_;p++){const y=c[p];if(y.isDirectionalLight){const x=i.directional[d];x.direction.setFromMatrixPosition(y.matrixWorld),r.setFromMatrixPosition(y.target.matrixWorld),x.direction.sub(r),x.direction.transformDirection(m),d++}else if(y.isSpotLight){const x=i.spot[h];x.position.setFromMatrixPosition(y.matrixWorld),x.position.applyMatrix4(m),x.direction.setFromMatrixPosition(y.matrixWorld),r.setFromMatrixPosition(y.target.matrixWorld),x.direction.sub(r),x.direction.transformDirection(m),h++}else if(y.isRectAreaLight){const x=i.rectArea[g];x.position.setFromMatrixPosition(y.matrixWorld),x.position.applyMatrix4(m),o.identity(),s.copy(y.matrixWorld),s.premultiply(m),o.extractRotation(s),x.halfWidth.set(y.width*.5,0,0),x.halfHeight.set(0,y.height*.5,0),x.halfWidth.applyMatrix4(o),x.halfHeight.applyMatrix4(o),g++}else if(y.isPointLight){const x=i.point[f];x.position.setFromMatrixPosition(y.matrixWorld),x.position.applyMatrix4(m),f++}else if(y.isHemisphereLight){const x=i.hemi[v];x.direction.setFromMatrixPosition(y.matrixWorld),x.direction.transformDirection(m),v++}}}return{setup:a,setupView:l,state:i}}function wv(t){const e=new bN(t),n=[],i=[];function r(u){c.camera=u,n.length=0,i.length=0}function s(u){n.push(u)}function o(u){i.push(u)}function a(){e.setup(n)}function l(u){e.setupView(n,u)}const c={lightsArray:n,shadowsArray:i,camera:null,lights:e,transmissionRenderTarget:{}};return{init:r,state:c,setupLights:a,setupLightsView:l,pushLight:s,pushShadow:o}}function SN(t){let e=new WeakMap;function n(r,s=0){const o=e.get(r);let a;return o===void 0?(a=new wv(t),e.set(r,[a])):s>=o.length?(a=new wv(t),o.push(a)):a=o[s],a}function i(){e=new WeakMap}return{get:n,dispose:i}}const wN=`void main() { +`+pe)}else X!==""?it("WebGLProgram: Program Info Log:",X):(W===""||B==="")&&(de=!1);de&&(I.diagnostics={runnable:z,programLog:X,vertexShader:{log:W,prefix:m},fragmentShader:{log:B,prefix:p}})}r.deleteShader(M),r.deleteShader(A),D=new Vc(r,v),b=jI(r,v)}let D;this.getUniforms=function(){return D===void 0&&P(this),D};let b;this.getAttributes=function(){return b===void 0&&P(this),b};let w=n.rendererExtensionParallelShaderCompile===!1;return this.isReady=function(){return w===!1&&(w=r.getProgramParameter(v,kI)),w},this.destroy=function(){i.releaseStatesOfProgram(this),r.deleteProgram(v),this.program=void 0},this.type=n.shaderType,this.name=n.shaderName,this.id=BI++,this.cacheKey=e,this.usedTimes=1,this.program=v,this.vertexShader=M,this.fragmentShader=A,this}let uN=0;class dN{constructor(){this.shaderCache=new Map,this.materialCache=new Map}update(e){const n=e.vertexShader,i=e.fragmentShader,r=this._getShaderStage(n),s=this._getShaderStage(i),o=this._getShaderCacheForMaterial(e);return o.has(r)===!1&&(o.add(r),r.usedTimes++),o.has(s)===!1&&(o.add(s),s.usedTimes++),this}remove(e){const n=this.materialCache.get(e);for(const i of n)i.usedTimes--,i.usedTimes===0&&this.shaderCache.delete(i.code);return this.materialCache.delete(e),this}getVertexShaderID(e){return this._getShaderStage(e.vertexShader).id}getFragmentShaderID(e){return this._getShaderStage(e.fragmentShader).id}dispose(){this.shaderCache.clear(),this.materialCache.clear()}_getShaderCacheForMaterial(e){const n=this.materialCache;let i=n.get(e);return i===void 0&&(i=new Set,n.set(e,i)),i}_getShaderStage(e){const n=this.shaderCache;let i=n.get(e);return i===void 0&&(i=new fN(e),n.set(e,i)),i}}class fN{constructor(e){this.id=uN++,this.code=e,this.usedTimes=0}}function hN(t,e,n,i,r,s,o){const a=new lm,l=new dN,c=new Set,u=[],d=new Map,f=r.logarithmicDepthBuffer;let h=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,w,I,L,V){const $=L.fog,X=V.geometry,W=b.isMeshStandardMaterial?L.environment:null,B=(b.isMeshStandardMaterial?n:e).get(b.envMap||W),z=B&&B.mapping===Wu?B.image.height:null,de=g[b.type];b.precision!==null&&(h=r.getMaxPrecision(b.precision),h!==b.precision&&it("WebGLProgram.getParameters:",b.precision,"not supported, using",h,"instead."));const le=X.morphAttributes.position||X.morphAttributes.normal||X.morphAttributes.color,pe=le!==void 0?le.length:0;let He=0;X.morphAttributes.position!==void 0&&(He=1),X.morphAttributes.normal!==void 0&&(He=2),X.morphAttributes.color!==void 0&&(He=3);let ze,st,xt,ce;if(de){const Pt=ji[de];ze=Pt.vertexShader,st=Pt.fragmentShader}else ze=b.vertexShader,st=b.fragmentShader,l.update(b),xt=l.getVertexShaderID(b),ce=l.getFragmentShaderID(b);const ue=t.getRenderTarget(),Le=t.state.buffers.depth.getReversed(),je=V.isInstancedMesh===!0,Ae=V.isBatchedMesh===!0,mt=!!b.map,O=!!b.matcap,k=!!B,U=!!b.aoMap,q=!!b.lightMap,H=!!b.bumpMap,Y=!!b.normalMap,C=!!b.displacementMap,ae=!!b.emissiveMap,Q=!!b.metalnessMap,ee=!!b.roughnessMap,oe=b.anisotropy>0,T=b.clearcoat>0,S=b.dispersion>0,F=b.iridescence>0,J=b.sheen>0,se=b.transmission>0,K=oe&&!!b.anisotropyMap,Ce=T&&!!b.clearcoatMap,ve=T&&!!b.clearcoatNormalMap,Oe=T&&!!b.clearcoatRoughnessMap,$e=F&&!!b.iridescenceMap,ge=F&&!!b.iridescenceThicknessMap,Ee=J&&!!b.sheenColorMap,Pe=J&&!!b.sheenRoughnessMap,Be=!!b.specularMap,we=!!b.specularColorMap,dt=!!b.specularIntensityMap,G=se&&!!b.transmissionMap,Ue=se&&!!b.thicknessMap,ye=!!b.gradientMap,Ve=!!b.alphaMap,_e=b.alphaTest>0,he=!!b.alphaHash,Te=!!b.extensions;let lt=nr;b.toneMapped&&(ue===null||ue.isXRRenderTarget===!0)&&(lt=t.toneMapping);const Vt={shaderID:de,shaderType:b.type,shaderName:b.name,vertexShader:ze,fragmentShader:st,defines:b.defines,customVertexShaderID:xt,customFragmentShaderID:ce,isRawShaderMaterial:b.isRawShaderMaterial===!0,glslVersion:b.glslVersion,precision:h,batching:Ae,batchingColor:Ae&&V._colorsTexture!==null,instancing:je,instancingColor:je&&V.instanceColor!==null,instancingMorph:je&&V.morphTexture!==null,outputColorSpace:ue===null?t.outputColorSpace:ue.isXRRenderTarget===!0?ue.texture.colorSpace:oa,alphaToCoverage:!!b.alphaToCoverage,map:mt,matcap:O,envMap:k,envMapMode:k&&B.mapping,envMapCubeUVHeight:z,aoMap:U,lightMap:q,bumpMap:H,normalMap:Y,displacementMap:C,emissiveMap:ae,normalMapObjectSpace:Y&&b.normalMapType===$C,normalMapTangentSpace:Y&&b.normalMapType===xb,metalnessMap:Q,roughnessMap:ee,anisotropy:oe,anisotropyMap:K,clearcoat:T,clearcoatMap:Ce,clearcoatNormalMap:ve,clearcoatRoughnessMap:Oe,dispersion:S,iridescence:F,iridescenceMap:$e,iridescenceThicknessMap:ge,sheen:J,sheenColorMap:Ee,sheenRoughnessMap:Pe,specularMap:Be,specularColorMap:we,specularIntensityMap:dt,transmission:se,transmissionMap:G,thicknessMap:Ue,gradientMap:ye,opaque:b.transparent===!1&&b.blending===Yo&&b.alphaToCoverage===!1,alphaMap:Ve,alphaTest:_e,alphaHash:he,combine:b.combine,mapUv:mt&&v(b.map.channel),aoMapUv:U&&v(b.aoMap.channel),lightMapUv:q&&v(b.lightMap.channel),bumpMapUv:H&&v(b.bumpMap.channel),normalMapUv:Y&&v(b.normalMap.channel),displacementMapUv:C&&v(b.displacementMap.channel),emissiveMapUv:ae&&v(b.emissiveMap.channel),metalnessMapUv:Q&&v(b.metalnessMap.channel),roughnessMapUv:ee&&v(b.roughnessMap.channel),anisotropyMapUv:K&&v(b.anisotropyMap.channel),clearcoatMapUv:Ce&&v(b.clearcoatMap.channel),clearcoatNormalMapUv:ve&&v(b.clearcoatNormalMap.channel),clearcoatRoughnessMapUv:Oe&&v(b.clearcoatRoughnessMap.channel),iridescenceMapUv:$e&&v(b.iridescenceMap.channel),iridescenceThicknessMapUv:ge&&v(b.iridescenceThicknessMap.channel),sheenColorMapUv:Ee&&v(b.sheenColorMap.channel),sheenRoughnessMapUv:Pe&&v(b.sheenRoughnessMap.channel),specularMapUv:Be&&v(b.specularMap.channel),specularColorMapUv:we&&v(b.specularColorMap.channel),specularIntensityMapUv:dt&&v(b.specularIntensityMap.channel),transmissionMapUv:G&&v(b.transmissionMap.channel),thicknessMapUv:Ue&&v(b.thicknessMap.channel),alphaMapUv:Ve&&v(b.alphaMap.channel),vertexTangents:!!X.attributes.tangent&&(Y||oe),vertexColors:b.vertexColors,vertexAlphas:b.vertexColors===!0&&!!X.attributes.color&&X.attributes.color.itemSize===4,pointsUvs:V.isPoints===!0&&!!X.attributes.uv&&(mt||Ve),fog:!!$,useFog:b.fog===!0,fogExp2:!!$&&$.isFogExp2,flatShading:b.flatShading===!0&&b.wireframe===!1,sizeAttenuation:b.sizeAttenuation===!0,logarithmicDepthBuffer:f,reversedDepthBuffer:Le,skinning:V.isSkinnedMesh===!0,morphTargets:X.morphAttributes.position!==void 0,morphNormals:X.morphAttributes.normal!==void 0,morphColors:X.morphAttributes.color!==void 0,morphTargetsCount:pe,morphTextureStride:He,numDirLights:w.directional.length,numPointLights:w.point.length,numSpotLights:w.spot.length,numSpotLightMaps:w.spotLightMap.length,numRectAreaLights:w.rectArea.length,numHemiLights:w.hemi.length,numDirLightShadows:w.directionalShadowMap.length,numPointLightShadows:w.pointShadowMap.length,numSpotLightShadows:w.spotShadowMap.length,numSpotLightShadowsWithMaps:w.numSpotLightShadowsWithMaps,numLightProbes:w.numLightProbes,numClippingPlanes:o.numPlanes,numClipIntersection:o.numIntersection,dithering:b.dithering,shadowMapEnabled:t.shadowMap.enabled&&I.length>0,shadowMapType:t.shadowMap.type,toneMapping:lt,decodeVideoTexture:mt&&b.map.isVideoTexture===!0&&wt.getTransfer(b.map.colorSpace)===Dt,decodeVideoTextureEmissive:ae&&b.emissiveMap.isVideoTexture===!0&&wt.getTransfer(b.emissiveMap.colorSpace)===Dt,premultipliedAlpha:b.premultipliedAlpha,doubleSided:b.side===Vn,flipSided:b.side===Ln,useDepthPacking:b.depthPacking>=0,depthPacking:b.depthPacking||0,index0AttributeName:b.index0AttributeName,extensionClipCullDistance:Te&&b.extensions.clipCullDistance===!0&&i.has("WEBGL_clip_cull_distance"),extensionMultiDraw:(Te&&b.extensions.multiDraw===!0||Ae)&&i.has("WEBGL_multi_draw"),rendererExtensionParallelShaderCompile:i.has("KHR_parallel_shader_compile"),customProgramCacheKey:b.customProgramCacheKey()};return Vt.vertexUv1s=c.has(1),Vt.vertexUv2s=c.has(2),Vt.vertexUv3s=c.has(3),c.clear(),Vt}function p(b){const w=[];if(b.shaderID?w.push(b.shaderID):(w.push(b.customVertexShaderID),w.push(b.customFragmentShaderID)),b.defines!==void 0)for(const I in b.defines)w.push(I),w.push(b.defines[I]);return b.isRawShaderMaterial===!1&&(_(w,b),y(w,b),w.push(t.outputColorSpace)),w.push(b.customProgramCacheKey),w.join()}function _(b,w){b.push(w.precision),b.push(w.outputColorSpace),b.push(w.envMapMode),b.push(w.envMapCubeUVHeight),b.push(w.mapUv),b.push(w.alphaMapUv),b.push(w.lightMapUv),b.push(w.aoMapUv),b.push(w.bumpMapUv),b.push(w.normalMapUv),b.push(w.displacementMapUv),b.push(w.emissiveMapUv),b.push(w.metalnessMapUv),b.push(w.roughnessMapUv),b.push(w.anisotropyMapUv),b.push(w.clearcoatMapUv),b.push(w.clearcoatNormalMapUv),b.push(w.clearcoatRoughnessMapUv),b.push(w.iridescenceMapUv),b.push(w.iridescenceThicknessMapUv),b.push(w.sheenColorMapUv),b.push(w.sheenRoughnessMapUv),b.push(w.specularMapUv),b.push(w.specularColorMapUv),b.push(w.specularIntensityMapUv),b.push(w.transmissionMapUv),b.push(w.thicknessMapUv),b.push(w.combine),b.push(w.fogExp2),b.push(w.sizeAttenuation),b.push(w.morphTargetsCount),b.push(w.morphAttributeCount),b.push(w.numDirLights),b.push(w.numPointLights),b.push(w.numSpotLights),b.push(w.numSpotLightMaps),b.push(w.numHemiLights),b.push(w.numRectAreaLights),b.push(w.numDirLightShadows),b.push(w.numPointLightShadows),b.push(w.numSpotLightShadows),b.push(w.numSpotLightShadowsWithMaps),b.push(w.numLightProbes),b.push(w.shadowMapType),b.push(w.toneMapping),b.push(w.numClippingPlanes),b.push(w.numClipIntersection),b.push(w.depthPacking)}function y(b,w){a.disableAll(),w.instancing&&a.enable(0),w.instancingColor&&a.enable(1),w.instancingMorph&&a.enable(2),w.matcap&&a.enable(3),w.envMap&&a.enable(4),w.normalMapObjectSpace&&a.enable(5),w.normalMapTangentSpace&&a.enable(6),w.clearcoat&&a.enable(7),w.iridescence&&a.enable(8),w.alphaTest&&a.enable(9),w.vertexColors&&a.enable(10),w.vertexAlphas&&a.enable(11),w.vertexUv1s&&a.enable(12),w.vertexUv2s&&a.enable(13),w.vertexUv3s&&a.enable(14),w.vertexTangents&&a.enable(15),w.anisotropy&&a.enable(16),w.alphaHash&&a.enable(17),w.batching&&a.enable(18),w.dispersion&&a.enable(19),w.batchingColor&&a.enable(20),w.gradientMap&&a.enable(21),b.push(a.mask),a.disableAll(),w.fog&&a.enable(0),w.useFog&&a.enable(1),w.flatShading&&a.enable(2),w.logarithmicDepthBuffer&&a.enable(3),w.reversedDepthBuffer&&a.enable(4),w.skinning&&a.enable(5),w.morphTargets&&a.enable(6),w.morphNormals&&a.enable(7),w.morphColors&&a.enable(8),w.premultipliedAlpha&&a.enable(9),w.shadowMapEnabled&&a.enable(10),w.doubleSided&&a.enable(11),w.flipSided&&a.enable(12),w.useDepthPacking&&a.enable(13),w.dithering&&a.enable(14),w.transmission&&a.enable(15),w.sheen&&a.enable(16),w.opaque&&a.enable(17),w.pointsUvs&&a.enable(18),w.decodeVideoTexture&&a.enable(19),w.decodeVideoTextureEmissive&&a.enable(20),w.alphaToCoverage&&a.enable(21),b.push(a.mask)}function x(b){const w=g[b.type];let I;if(w){const L=ji[w];I=Tb.clone(L.uniforms)}else I=b.uniforms;return I}function M(b,w){let I=d.get(w);return I!==void 0?++I.usedTimes:(I=new cN(t,w,b,s),u.push(I),d.set(w,I)),I}function A(b){if(--b.usedTimes===0){const w=u.indexOf(b);u[w]=u[u.length-1],u.pop(),d.delete(b.cacheKey),b.destroy()}}function P(b){l.remove(b)}function D(){l.dispose()}return{getParameters:m,getProgramCacheKey:p,getUniforms:x,acquireProgram:M,releaseProgram:A,releaseShaderCache:P,programs:u,dispose:D}}function pN(){let t=new WeakMap;function e(o){return t.has(o)}function n(o){let a=t.get(o);return a===void 0&&(a={},t.set(o,a)),a}function i(o){t.delete(o)}function r(o,a,l){t.get(o)[a]=l}function s(){t=new WeakMap}return{has:e,get:n,remove:i,update:r,dispose:s}}function mN(t,e){return t.groupOrder!==e.groupOrder?t.groupOrder-e.groupOrder:t.renderOrder!==e.renderOrder?t.renderOrder-e.renderOrder:t.material.id!==e.material.id?t.material.id-e.material.id:t.z!==e.z?t.z-e.z:t.id-e.id}function bv(t,e){return t.groupOrder!==e.groupOrder?t.groupOrder-e.groupOrder:t.renderOrder!==e.renderOrder?t.renderOrder-e.renderOrder:t.z!==e.z?e.z-t.z:t.id-e.id}function Sv(){const t=[];let e=0;const n=[],i=[],r=[];function s(){e=0,n.length=0,i.length=0,r.length=0}function o(d,f,h,g,v,m){let p=t[e];return p===void 0?(p={id:d.id,object:d,geometry:f,material:h,groupOrder:g,renderOrder:d.renderOrder,z:v,group:m},t[e]=p):(p.id=d.id,p.object=d,p.geometry=f,p.material=h,p.groupOrder=g,p.renderOrder=d.renderOrder,p.z=v,p.group=m),e++,p}function a(d,f,h,g,v,m){const p=o(d,f,h,g,v,m);h.transmission>0?i.push(p):h.transparent===!0?r.push(p):n.push(p)}function l(d,f,h,g,v,m){const p=o(d,f,h,g,v,m);h.transmission>0?i.unshift(p):h.transparent===!0?r.unshift(p):n.unshift(p)}function c(d,f){n.length>1&&n.sort(d||mN),i.length>1&&i.sort(f||bv),r.length>1&&r.sort(f||bv)}function u(){for(let d=e,f=t.length;d=s.length?(o=new Sv,s.push(o)):o=s[r],o}function n(){t=new WeakMap}return{get:e,dispose:n}}function vN(){const t={};return{get:function(e){if(t[e.id]!==void 0)return t[e.id];let n;switch(e.type){case"DirectionalLight":n={direction:new N,color:new nt};break;case"SpotLight":n={position:new N,direction:new N,color:new nt,distance:0,coneCos:0,penumbraCos:0,decay:0};break;case"PointLight":n={position:new N,color:new nt,distance:0,decay:0};break;case"HemisphereLight":n={direction:new N,skyColor:new nt,groundColor:new nt};break;case"RectAreaLight":n={color:new nt,position:new N,halfWidth:new N,halfHeight:new N};break}return t[e.id]=n,n}}}function _N(){const t={};return{get:function(e){if(t[e.id]!==void 0)return t[e.id];let n;switch(e.type){case"DirectionalLight":n={shadowIntensity:1,shadowBias:0,shadowNormalBias:0,shadowRadius:1,shadowMapSize:new xe};break;case"SpotLight":n={shadowIntensity:1,shadowBias:0,shadowNormalBias:0,shadowRadius:1,shadowMapSize:new xe};break;case"PointLight":n={shadowIntensity:1,shadowBias:0,shadowNormalBias:0,shadowRadius:1,shadowMapSize:new xe,shadowCameraNear:1,shadowCameraFar:1e3};break}return t[e.id]=n,n}}}let xN=0;function yN(t,e){return(e.castShadow?2:0)-(t.castShadow?2:0)+(e.map?1:0)-(t.map?1:0)}function bN(t){const e=new vN,n=_N(),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 N);const r=new N,s=new yt,o=new yt;function a(c){let u=0,d=0,f=0;for(let b=0;b<9;b++)i.probe[b].set(0,0,0);let h=0,g=0,v=0,m=0,p=0,_=0,y=0,x=0,M=0,A=0,P=0;c.sort(yN);for(let b=0,w=c.length;b0&&(t.has("OES_texture_float_linear")===!0?(i.rectAreaLTC1=De.LTC_FLOAT_1,i.rectAreaLTC2=De.LTC_FLOAT_2):(i.rectAreaLTC1=De.LTC_HALF_1,i.rectAreaLTC2=De.LTC_HALF_2)),i.ambient[0]=u,i.ambient[1]=d,i.ambient[2]=f;const D=i.hash;(D.directionalLength!==h||D.pointLength!==g||D.spotLength!==v||D.rectAreaLength!==m||D.hemiLength!==p||D.numDirectionalShadows!==_||D.numPointShadows!==y||D.numSpotShadows!==x||D.numSpotMaps!==M||D.numLightProbes!==P)&&(i.directional.length=h,i.spot.length=v,i.rectArea.length=m,i.point.length=g,i.hemi.length=p,i.directionalShadow.length=_,i.directionalShadowMap.length=_,i.pointShadow.length=y,i.pointShadowMap.length=y,i.spotShadow.length=x,i.spotShadowMap.length=x,i.directionalShadowMatrix.length=_,i.pointShadowMatrix.length=y,i.spotLightMatrix.length=x+M-A,i.spotLightMap.length=M,i.numSpotLightShadowsWithMaps=A,i.numLightProbes=P,D.directionalLength=h,D.pointLength=g,D.spotLength=v,D.rectAreaLength=m,D.hemiLength=p,D.numDirectionalShadows=_,D.numPointShadows=y,D.numSpotShadows=x,D.numSpotMaps=M,D.numLightProbes=P,i.version=xN++)}function l(c,u){let d=0,f=0,h=0,g=0,v=0;const m=u.matrixWorldInverse;for(let p=0,_=c.length;p<_;p++){const y=c[p];if(y.isDirectionalLight){const x=i.directional[d];x.direction.setFromMatrixPosition(y.matrixWorld),r.setFromMatrixPosition(y.target.matrixWorld),x.direction.sub(r),x.direction.transformDirection(m),d++}else if(y.isSpotLight){const x=i.spot[h];x.position.setFromMatrixPosition(y.matrixWorld),x.position.applyMatrix4(m),x.direction.setFromMatrixPosition(y.matrixWorld),r.setFromMatrixPosition(y.target.matrixWorld),x.direction.sub(r),x.direction.transformDirection(m),h++}else if(y.isRectAreaLight){const x=i.rectArea[g];x.position.setFromMatrixPosition(y.matrixWorld),x.position.applyMatrix4(m),o.identity(),s.copy(y.matrixWorld),s.premultiply(m),o.extractRotation(s),x.halfWidth.set(y.width*.5,0,0),x.halfHeight.set(0,y.height*.5,0),x.halfWidth.applyMatrix4(o),x.halfHeight.applyMatrix4(o),g++}else if(y.isPointLight){const x=i.point[f];x.position.setFromMatrixPosition(y.matrixWorld),x.position.applyMatrix4(m),f++}else if(y.isHemisphereLight){const x=i.hemi[v];x.direction.setFromMatrixPosition(y.matrixWorld),x.direction.transformDirection(m),v++}}}return{setup:a,setupView:l,state:i}}function wv(t){const e=new bN(t),n=[],i=[];function r(u){c.camera=u,n.length=0,i.length=0}function s(u){n.push(u)}function o(u){i.push(u)}function a(){e.setup(n)}function l(u){e.setupView(n,u)}const c={lightsArray:n,shadowsArray:i,camera:null,lights:e,transmissionRenderTarget:{}};return{init:r,state:c,setupLights:a,setupLightsView:l,pushLight:s,pushShadow:o}}function SN(t){let e=new WeakMap;function n(r,s=0){const o=e.get(r);let a;return o===void 0?(a=new wv(t),e.set(r,[a])):s>=o.length?(a=new wv(t),o.push(a)):a=o[s],a}function i(){e=new WeakMap}return{get:n,dispose:i}}const wN=`void main() { gl_Position = vec4( position, 1.0 ); }`,MN=`uniform sampler2D shadow_pass; uniform vec2 resolution; @@ -3986,7 +3986,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 ); -}`,EN=[new N(1,0,0),new N(-1,0,0),new N(0,1,0),new N(0,-1,0),new N(0,0,1),new N(0,0,-1)],TN=[new N(0,-1,0),new N(0,-1,0),new N(0,0,1),new N(0,0,-1),new N(0,-1,0),new N(0,-1,0)],Mv=new yt,Pa=new N,Ff=new N;function AN(t,e,n){let i=new cm;const r=new xe,s=new xe,o=new Zt,a=new C2,l=new P2,c={},u=n.maxTextureSize,d={[ys]:Ln,[Ln]:ys,[Vn]:Vn},f=new Fi({defines:{VSM_SAMPLES:8},uniforms:{shadow_pass:{value:null},resolution:{value:new xe},radius:{value:4}},vertexShader:wN,fragmentShader:MN}),h=f.clone();h.defines.HORIZONTAL_PASS=1;const g=new _t;g.setAttribute("position",new Gn(new Float32Array([-1,-1,.5,3,-1,.5,-1,3,.5]),3));const v=new Te(g,f),m=this;this.enabled=!1,this.autoUpdate=!0,this.needsUpdate=!1,this.type=Oc;let p=this.type;this.render=function(A,P,D){if(m.enabled===!1||m.autoUpdate===!1&&m.needsUpdate===!1||A.length===0)return;A.type===ib&&(it("WebGLShadowMap: PCFSoftShadowMap has been deprecated. Using PCFShadowMap instead."),A.type=Oc);const b=t.getRenderTarget(),w=t.getActiveCubeFace(),I=t.getActiveMipmapLevel(),L=t.state;L.setBlending(Lr),L.buffers.depth.getReversed()===!0?L.buffers.color.setClear(0,0,0,0):L.buffers.color.setClear(1,1,1,1),L.buffers.depth.setTest(!0),L.setScissorTest(!1);const V=p!==this.type;V&&P.traverse(function($){$.material&&(Array.isArray($.material)?$.material.forEach(X=>X.needsUpdate=!0):$.material.needsUpdate=!0)});for(let $=0,X=A.length;$u||r.y>u)&&(r.x>u&&(s.x=Math.floor(u/z.x),r.x=s.x*z.x,B.mapSize.x=s.x),r.y>u&&(s.y=Math.floor(u/z.y),r.y=s.y*z.y,B.mapSize.y=s.y)),B.map===null||V===!0){if(B.map!==null&&(B.map.depthTexture!==null&&(B.map.depthTexture.dispose(),B.map.depthTexture=null),B.map.dispose()),this.type===Fa){if(W.isPointLight){it("WebGLShadowMap: VSM shadow maps are not supported for PointLights. Use PCF or BasicShadowMap instead.");continue}B.map=new ir(r.x,r.y,{format:sa,type:qr,minFilter:Dn,magFilter:Dn,generateMipmaps:!1}),B.map.texture.name=W.name+".shadowMap",B.map.depthTexture=new fl(r.x,r.y,Ki),B.map.depthTexture.name=W.name+".shadowMapDepth",B.map.depthTexture.format=Xr,B.map.depthTexture.compareFunction=null,B.map.depthTexture.minFilter=Sn,B.map.depthTexture.magFilter=Sn}else{W.isPointLight?(B.map=new Pb(r.x),B.map.depthTexture=new qP(r.x,rr)):(B.map=new ir(r.x,r.y),B.map.depthTexture=new fl(r.x,r.y,rr)),B.map.depthTexture.name=W.name+".shadowMap",B.map.depthTexture.format=Xr;const le=t.state.buffers.depth.getReversed();this.type===Oc?(B.map.depthTexture.compareFunction=le?sm:rm,B.map.depthTexture.minFilter=Dn,B.map.depthTexture.magFilter=Dn):(B.map.depthTexture.compareFunction=null,B.map.depthTexture.minFilter=Sn,B.map.depthTexture.magFilter=Sn)}B.camera.updateProjectionMatrix()}const de=B.map.isWebGLCubeRenderTarget?6:1;for(let le=0;le0||P.map&&P.alphaTest>0||P.alphaToCoverage===!0){const L=w.uuid,V=P.uuid;let $=c[L];$===void 0&&($={},c[L]=$);let X=$[V];X===void 0&&(X=w.clone(),$[V]=X,P.addEventListener("dispose",M)),w=X}if(w.visible=P.visible,w.wireframe=P.wireframe,b===Fa?w.side=P.shadowSide!==null?P.shadowSide:P.side:w.side=P.shadowSide!==null?P.shadowSide:d[P.side],w.alphaMap=P.alphaMap,w.alphaTest=P.alphaToCoverage===!0?.5:P.alphaTest,w.map=P.map,w.clipShadows=P.clipShadows,w.clippingPlanes=P.clippingPlanes,w.clipIntersection=P.clipIntersection,w.displacementMap=P.displacementMap,w.displacementScale=P.displacementScale,w.displacementBias=P.displacementBias,w.wireframeLinewidth=P.wireframeLinewidth,w.linewidth=P.linewidth,D.isPointLight===!0&&w.isMeshDistanceMaterial===!0){const L=t.properties.get(w);L.light=D}return w}function x(A,P,D,b,w){if(A.visible===!1)return;if(A.layers.test(P.layers)&&(A.isMesh||A.isLine||A.isPoints)&&(A.castShadow||A.receiveShadow&&w===Fa)&&(!A.frustumCulled||i.intersectsObject(A))){A.modelViewMatrix.multiplyMatrices(D.matrixWorldInverse,A.matrixWorld);const V=e.update(A),$=A.material;if(Array.isArray($)){const X=V.groups;for(let W=0,B=X.length;W=1):z.indexOf("OpenGL ES")!==-1&&(B=parseFloat(/^OpenGL ES (\d)/.exec(z)[1]),W=B>=2);let de=null,le={};const pe=t.getParameter(t.SCISSOR_BOX),He=t.getParameter(t.VIEWPORT),ze=new Zt().fromArray(pe),st=new Zt().fromArray(He);function xt(G,Ue,ye,Ve){const _e=new Uint8Array(4),he=t.createTexture();t.bindTexture(G,he),t.texParameteri(G,t.TEXTURE_MIN_FILTER,t.NEAREST),t.texParameteri(G,t.TEXTURE_MAG_FILTER,t.NEAREST);for(let Ee=0;Ee"u"?!1:/OculusBrowser/g.test(navigator.userAgent),c=new xe,u=new WeakMap;let d;const f=new WeakMap;let h=!1;try{h=typeof OffscreenCanvas<"u"&&new OffscreenCanvas(1,1).getContext("2d")!==null}catch{}function g(T,S){return h?new OffscreenCanvas(T,S):lu("canvas")}function v(T,S,F){let J=1;const se=oe(T);if((se.width>F||se.height>F)&&(J=F/Math.max(se.width,se.height)),J<1)if(typeof HTMLImageElement<"u"&&T instanceof HTMLImageElement||typeof HTMLCanvasElement<"u"&&T instanceof HTMLCanvasElement||typeof ImageBitmap<"u"&&T instanceof ImageBitmap||typeof VideoFrame<"u"&&T instanceof VideoFrame){const K=Math.floor(J*se.width),Ce=Math.floor(J*se.height);d===void 0&&(d=g(K,Ce));const ve=S?g(K,Ce):d;return ve.width=K,ve.height=Ce,ve.getContext("2d").drawImage(T,0,0,K,Ce),it("WebGLRenderer: Texture has been resized from ("+se.width+"x"+se.height+") to ("+K+"x"+Ce+")."),ve}else return"data"in T&&it("WebGLRenderer: Image in DataTexture is too big ("+se.width+"x"+se.height+")."),T;return T}function m(T){return T.generateMipmaps}function p(T){t.generateMipmap(T)}function _(T){return T.isWebGLCubeRenderTarget?t.TEXTURE_CUBE_MAP:T.isWebGL3DRenderTarget?t.TEXTURE_3D:T.isWebGLArrayRenderTarget||T.isCompressedArrayTexture?t.TEXTURE_2D_ARRAY:t.TEXTURE_2D}function y(T,S,F,J,se=!1){if(T!==null){if(t[T]!==void 0)return t[T];it("WebGLRenderer: Attempt to use non-existing WebGL internal format '"+T+"'")}let K=S;if(S===t.RED&&(F===t.FLOAT&&(K=t.R32F),F===t.HALF_FLOAT&&(K=t.R16F),F===t.UNSIGNED_BYTE&&(K=t.R8)),S===t.RED_INTEGER&&(F===t.UNSIGNED_BYTE&&(K=t.R8UI),F===t.UNSIGNED_SHORT&&(K=t.R16UI),F===t.UNSIGNED_INT&&(K=t.R32UI),F===t.BYTE&&(K=t.R8I),F===t.SHORT&&(K=t.R16I),F===t.INT&&(K=t.R32I)),S===t.RG&&(F===t.FLOAT&&(K=t.RG32F),F===t.HALF_FLOAT&&(K=t.RG16F),F===t.UNSIGNED_BYTE&&(K=t.RG8)),S===t.RG_INTEGER&&(F===t.UNSIGNED_BYTE&&(K=t.RG8UI),F===t.UNSIGNED_SHORT&&(K=t.RG16UI),F===t.UNSIGNED_INT&&(K=t.RG32UI),F===t.BYTE&&(K=t.RG8I),F===t.SHORT&&(K=t.RG16I),F===t.INT&&(K=t.RG32I)),S===t.RGB_INTEGER&&(F===t.UNSIGNED_BYTE&&(K=t.RGB8UI),F===t.UNSIGNED_SHORT&&(K=t.RGB16UI),F===t.UNSIGNED_INT&&(K=t.RGB32UI),F===t.BYTE&&(K=t.RGB8I),F===t.SHORT&&(K=t.RGB16I),F===t.INT&&(K=t.RGB32I)),S===t.RGBA_INTEGER&&(F===t.UNSIGNED_BYTE&&(K=t.RGBA8UI),F===t.UNSIGNED_SHORT&&(K=t.RGBA16UI),F===t.UNSIGNED_INT&&(K=t.RGBA32UI),F===t.BYTE&&(K=t.RGBA8I),F===t.SHORT&&(K=t.RGBA16I),F===t.INT&&(K=t.RGBA32I)),S===t.RGB&&(F===t.UNSIGNED_INT_5_9_9_9_REV&&(K=t.RGB9_E5),F===t.UNSIGNED_INT_10F_11F_11F_REV&&(K=t.R11F_G11F_B10F)),S===t.RGBA){const Ce=se?ou:wt.getTransfer(J);F===t.FLOAT&&(K=t.RGBA32F),F===t.HALF_FLOAT&&(K=t.RGBA16F),F===t.UNSIGNED_BYTE&&(K=Ce===Dt?t.SRGB8_ALPHA8:t.RGBA8),F===t.UNSIGNED_SHORT_4_4_4_4&&(K=t.RGBA4),F===t.UNSIGNED_SHORT_5_5_5_1&&(K=t.RGB5_A1)}return(K===t.R16F||K===t.R32F||K===t.RG16F||K===t.RG32F||K===t.RGBA16F||K===t.RGBA32F)&&e.get("EXT_color_buffer_float"),K}function x(T,S){let F;return T?S===null||S===rr||S===ul?F=t.DEPTH24_STENCIL8:S===Ki?F=t.DEPTH32F_STENCIL8:S===cl&&(F=t.DEPTH24_STENCIL8,it("DepthTexture: 16 bit depth attachment is not supported with stencil. Using 24-bit attachment.")):S===null||S===rr||S===ul?F=t.DEPTH_COMPONENT24:S===Ki?F=t.DEPTH_COMPONENT32F:S===cl&&(F=t.DEPTH_COMPONENT16),F}function M(T,S){return m(T)===!0||T.isFramebufferTexture&&T.minFilter!==Sn&&T.minFilter!==Dn?Math.log2(Math.max(S.width,S.height))+1:T.mipmaps!==void 0&&T.mipmaps.length>0?T.mipmaps.length:T.isCompressedTexture&&Array.isArray(T.image)?S.mipmaps.length:1}function A(T){const S=T.target;S.removeEventListener("dispose",A),D(S),S.isVideoTexture&&u.delete(S)}function P(T){const S=T.target;S.removeEventListener("dispose",P),w(S)}function D(T){const S=i.get(T);if(S.__webglInit===void 0)return;const F=T.source,J=f.get(F);if(J){const se=J[S.__cacheKey];se.usedTimes--,se.usedTimes===0&&b(T),Object.keys(J).length===0&&f.delete(F)}i.remove(T)}function b(T){const S=i.get(T);t.deleteTexture(S.__webglTexture);const F=T.source,J=f.get(F);delete J[S.__cacheKey],o.memory.textures--}function w(T){const S=i.get(T);if(T.depthTexture&&(T.depthTexture.dispose(),i.remove(T.depthTexture)),T.isWebGLCubeRenderTarget)for(let J=0;J<6;J++){if(Array.isArray(S.__webglFramebuffer[J]))for(let se=0;se=r.maxTextures&&it("WebGLTextures: Trying to use "+T+" texture units while this GPU supports only "+r.maxTextures),I+=1,T}function $(T){const S=[];return S.push(T.wrapS),S.push(T.wrapT),S.push(T.wrapR||0),S.push(T.magFilter),S.push(T.minFilter),S.push(T.anisotropy),S.push(T.internalFormat),S.push(T.format),S.push(T.type),S.push(T.generateMipmaps),S.push(T.premultiplyAlpha),S.push(T.flipY),S.push(T.unpackAlignment),S.push(T.colorSpace),S.join()}function X(T,S){const F=i.get(T);if(T.isVideoTexture&&Q(T),T.isRenderTargetTexture===!1&&T.isExternalTexture!==!0&&T.version>0&&F.__version!==T.version){const J=T.image;if(J===null)it("WebGLRenderer: Texture marked for update but no image data found.");else if(J.complete===!1)it("WebGLRenderer: Texture marked for update but image is incomplete");else{ce(F,T,S);return}}else T.isExternalTexture&&(F.__webglTexture=T.sourceTexture?T.sourceTexture:null);n.bindTexture(t.TEXTURE_2D,F.__webglTexture,t.TEXTURE0+S)}function W(T,S){const F=i.get(T);if(T.isRenderTargetTexture===!1&&T.version>0&&F.__version!==T.version){ce(F,T,S);return}else T.isExternalTexture&&(F.__webglTexture=T.sourceTexture?T.sourceTexture:null);n.bindTexture(t.TEXTURE_2D_ARRAY,F.__webglTexture,t.TEXTURE0+S)}function B(T,S){const F=i.get(T);if(T.isRenderTargetTexture===!1&&T.version>0&&F.__version!==T.version){ce(F,T,S);return}n.bindTexture(t.TEXTURE_3D,F.__webglTexture,t.TEXTURE0+S)}function z(T,S){const F=i.get(T);if(T.isCubeDepthTexture!==!0&&T.version>0&&F.__version!==T.version){ue(F,T,S);return}n.bindTexture(t.TEXTURE_CUBE_MAP,F.__webglTexture,t.TEXTURE0+S)}const de={[Eh]:t.REPEAT,[Ir]:t.CLAMP_TO_EDGE,[Th]:t.MIRRORED_REPEAT},le={[Sn]:t.NEAREST,[qC]:t.NEAREST_MIPMAP_NEAREST,[Wl]:t.NEAREST_MIPMAP_LINEAR,[Dn]:t.LINEAR,[ef]:t.LINEAR_MIPMAP_NEAREST,[Js]:t.LINEAR_MIPMAP_LINEAR},pe={[jC]:t.NEVER,[QC]:t.ALWAYS,[YC]:t.LESS,[rm]:t.LEQUAL,[JC]:t.EQUAL,[sm]:t.GEQUAL,[KC]:t.GREATER,[ZC]:t.NOTEQUAL};function He(T,S){if(S.type===Ki&&e.has("OES_texture_float_linear")===!1&&(S.magFilter===Dn||S.magFilter===ef||S.magFilter===Wl||S.magFilter===Js||S.minFilter===Dn||S.minFilter===ef||S.minFilter===Wl||S.minFilter===Js)&&it("WebGLRenderer: Unable to use linear filtering with floating point textures. OES_texture_float_linear not supported on this device."),t.texParameteri(T,t.TEXTURE_WRAP_S,de[S.wrapS]),t.texParameteri(T,t.TEXTURE_WRAP_T,de[S.wrapT]),(T===t.TEXTURE_3D||T===t.TEXTURE_2D_ARRAY)&&t.texParameteri(T,t.TEXTURE_WRAP_R,de[S.wrapR]),t.texParameteri(T,t.TEXTURE_MAG_FILTER,le[S.magFilter]),t.texParameteri(T,t.TEXTURE_MIN_FILTER,le[S.minFilter]),S.compareFunction&&(t.texParameteri(T,t.TEXTURE_COMPARE_MODE,t.COMPARE_REF_TO_TEXTURE),t.texParameteri(T,t.TEXTURE_COMPARE_FUNC,pe[S.compareFunction])),e.has("EXT_texture_filter_anisotropic")===!0){if(S.magFilter===Sn||S.minFilter!==Wl&&S.minFilter!==Js||S.type===Ki&&e.has("OES_texture_float_linear")===!1)return;if(S.anisotropy>1||i.get(S).__currentAnisotropy){const F=e.get("EXT_texture_filter_anisotropic");t.texParameterf(T,F.TEXTURE_MAX_ANISOTROPY_EXT,Math.min(S.anisotropy,r.getMaxAnisotropy())),i.get(S).__currentAnisotropy=S.anisotropy}}}function ze(T,S){let F=!1;T.__webglInit===void 0&&(T.__webglInit=!0,S.addEventListener("dispose",A));const J=S.source;let se=f.get(J);se===void 0&&(se={},f.set(J,se));const K=$(S);if(K!==T.__cacheKey){se[K]===void 0&&(se[K]={texture:t.createTexture(),usedTimes:0},o.memory.textures++,F=!0),se[K].usedTimes++;const Ce=se[T.__cacheKey];Ce!==void 0&&(se[T.__cacheKey].usedTimes--,Ce.usedTimes===0&&b(S)),T.__cacheKey=K,T.__webglTexture=se[K].texture}return F}function st(T,S,F){return Math.floor(Math.floor(T/F)/S)}function xt(T,S,F,J){const K=T.updateRanges;if(K.length===0)n.texSubImage2D(t.TEXTURE_2D,0,0,0,S.width,S.height,F,J,S.data);else{K.sort((ge,Me)=>ge.start-Me.start);let Ce=0;for(let ge=1;ge0){G&&Ue&&n.texStorage2D(t.TEXTURE_2D,Ve,Be,dt[0].width,dt[0].height);for(let _e=0,he=dt.length;_e0){const Ee=tv(Se.width,Se.height,S.format,S.type);for(const lt of S.layerUpdates){const Vt=Se.data.subarray(lt*Ee/Se.data.BYTES_PER_ELEMENT,(lt+1)*Ee/Se.data.BYTES_PER_ELEMENT);n.compressedTexSubImage3D(t.TEXTURE_2D_ARRAY,_e,0,0,lt,Se.width,Se.height,1,Me,Vt)}S.clearLayerUpdates()}else n.compressedTexSubImage3D(t.TEXTURE_2D_ARRAY,_e,0,0,0,Se.width,Se.height,ge.depth,Me,Se.data)}else n.compressedTexImage3D(t.TEXTURE_2D_ARRAY,_e,Be,Se.width,Se.height,ge.depth,0,Se.data,0,0);else it("WebGLRenderer: Attempt to load unsupported compressed texture format in .uploadTexture()");else G?ye&&n.texSubImage3D(t.TEXTURE_2D_ARRAY,_e,0,0,0,Se.width,Se.height,ge.depth,Me,Pe,Se.data):n.texImage3D(t.TEXTURE_2D_ARRAY,_e,Be,Se.width,Se.height,ge.depth,0,Me,Pe,Se.data)}else{G&&Ue&&n.texStorage2D(t.TEXTURE_2D,Ve,Be,dt[0].width,dt[0].height);for(let _e=0,he=dt.length;_e0){const _e=tv(ge.width,ge.height,S.format,S.type);for(const he of S.layerUpdates){const Ee=ge.data.subarray(he*_e/ge.data.BYTES_PER_ELEMENT,(he+1)*_e/ge.data.BYTES_PER_ELEMENT);n.texSubImage3D(t.TEXTURE_2D_ARRAY,0,0,0,he,ge.width,ge.height,1,Me,Pe,Ee)}S.clearLayerUpdates()}else n.texSubImage3D(t.TEXTURE_2D_ARRAY,0,0,0,0,ge.width,ge.height,ge.depth,Me,Pe,ge.data)}else n.texImage3D(t.TEXTURE_2D_ARRAY,0,Be,ge.width,ge.height,ge.depth,0,Me,Pe,ge.data);else if(S.isData3DTexture)G?(Ue&&n.texStorage3D(t.TEXTURE_3D,Ve,Be,ge.width,ge.height,ge.depth),ye&&n.texSubImage3D(t.TEXTURE_3D,0,0,0,0,ge.width,ge.height,ge.depth,Me,Pe,ge.data)):n.texImage3D(t.TEXTURE_3D,0,Be,ge.width,ge.height,ge.depth,0,Me,Pe,ge.data);else if(S.isFramebufferTexture){if(Ue)if(G)n.texStorage2D(t.TEXTURE_2D,Ve,Be,ge.width,ge.height);else{let _e=ge.width,he=ge.height;for(let Ee=0;Ee>=1,he>>=1}}else if(dt.length>0){if(G&&Ue){const _e=oe(dt[0]);n.texStorage2D(t.TEXTURE_2D,Ve,Be,_e.width,_e.height)}for(let _e=0,he=dt.length;_e0&&Ve++;const he=oe(Me[0]);n.texStorage2D(t.TEXTURE_CUBE_MAP,Ve,dt,he.width,he.height)}for(let he=0;he<6;he++)if(ge){G?ye&&n.texSubImage2D(t.TEXTURE_CUBE_MAP_POSITIVE_X+he,0,0,0,Me[he].width,Me[he].height,Be,Se,Me[he].data):n.texImage2D(t.TEXTURE_CUBE_MAP_POSITIVE_X+he,0,dt,Me[he].width,Me[he].height,0,Be,Se,Me[he].data);for(let Ee=0;Ee<_e.length;Ee++){const Vt=_e[Ee].image[he].image;G?ye&&n.texSubImage2D(t.TEXTURE_CUBE_MAP_POSITIVE_X+he,Ee+1,0,0,Vt.width,Vt.height,Be,Se,Vt.data):n.texImage2D(t.TEXTURE_CUBE_MAP_POSITIVE_X+he,Ee+1,dt,Vt.width,Vt.height,0,Be,Se,Vt.data)}}else{G?ye&&n.texSubImage2D(t.TEXTURE_CUBE_MAP_POSITIVE_X+he,0,0,0,Be,Se,Me[he]):n.texImage2D(t.TEXTURE_CUBE_MAP_POSITIVE_X+he,0,dt,Be,Se,Me[he]);for(let Ee=0;Ee<_e.length;Ee++){const lt=_e[Ee];G?ye&&n.texSubImage2D(t.TEXTURE_CUBE_MAP_POSITIVE_X+he,Ee+1,0,0,Be,Se,lt.image[he]):n.texImage2D(t.TEXTURE_CUBE_MAP_POSITIVE_X+he,Ee+1,dt,Be,Se,lt.image[he])}}}m(S)&&p(t.TEXTURE_CUBE_MAP),K.__version=se.version,S.onUpdate&&S.onUpdate(S)}T.__version=S.version}function Le(T,S,F,J,se,K){const Ce=s.convert(F.format,F.colorSpace),ve=s.convert(F.type),Oe=y(F.internalFormat,Ce,ve,F.colorSpace),$e=i.get(S),ge=i.get(F);if(ge.__renderTarget=S,!$e.__hasExternalTextures){const Me=Math.max(1,S.width>>K),Pe=Math.max(1,S.height>>K);se===t.TEXTURE_3D||se===t.TEXTURE_2D_ARRAY?n.texImage3D(se,K,Oe,Me,Pe,S.depth,0,Ce,ve,null):n.texImage2D(se,K,Oe,Me,Pe,0,Ce,ve,null)}n.bindFramebuffer(t.FRAMEBUFFER,T),ae(S)?a.framebufferTexture2DMultisampleEXT(t.FRAMEBUFFER,J,se,ge.__webglTexture,0,C(S)):(se===t.TEXTURE_2D||se>=t.TEXTURE_CUBE_MAP_POSITIVE_X&&se<=t.TEXTURE_CUBE_MAP_NEGATIVE_Z)&&t.framebufferTexture2D(t.FRAMEBUFFER,J,se,ge.__webglTexture,K),n.bindFramebuffer(t.FRAMEBUFFER,null)}function je(T,S,F){if(t.bindRenderbuffer(t.RENDERBUFFER,T),S.depthBuffer){const J=S.depthTexture,se=J&&J.isDepthTexture?J.type:null,K=x(S.stencilBuffer,se),Ce=S.stencilBuffer?t.DEPTH_STENCIL_ATTACHMENT:t.DEPTH_ATTACHMENT;ae(S)?a.renderbufferStorageMultisampleEXT(t.RENDERBUFFER,C(S),K,S.width,S.height):F?t.renderbufferStorageMultisample(t.RENDERBUFFER,C(S),K,S.width,S.height):t.renderbufferStorage(t.RENDERBUFFER,K,S.width,S.height),t.framebufferRenderbuffer(t.FRAMEBUFFER,Ce,t.RENDERBUFFER,T)}else{const J=S.textures;for(let se=0;se{delete S.__boundDepthTexture,delete S.__depthDisposeCallback,J.removeEventListener("dispose",se)};J.addEventListener("dispose",se),S.__depthDisposeCallback=se}S.__boundDepthTexture=J}if(T.depthTexture&&!S.__autoAllocateDepthBuffer)if(F)for(let J=0;J<6;J++)Ae(S.__webglFramebuffer[J],T,J);else{const J=T.texture.mipmaps;J&&J.length>0?Ae(S.__webglFramebuffer[0],T,0):Ae(S.__webglFramebuffer,T,0)}else if(F){S.__webglDepthbuffer=[];for(let J=0;J<6;J++)if(n.bindFramebuffer(t.FRAMEBUFFER,S.__webglFramebuffer[J]),S.__webglDepthbuffer[J]===void 0)S.__webglDepthbuffer[J]=t.createRenderbuffer(),je(S.__webglDepthbuffer[J],T,!1);else{const se=T.stencilBuffer?t.DEPTH_STENCIL_ATTACHMENT:t.DEPTH_ATTACHMENT,K=S.__webglDepthbuffer[J];t.bindRenderbuffer(t.RENDERBUFFER,K),t.framebufferRenderbuffer(t.FRAMEBUFFER,se,t.RENDERBUFFER,K)}}else{const J=T.texture.mipmaps;if(J&&J.length>0?n.bindFramebuffer(t.FRAMEBUFFER,S.__webglFramebuffer[0]):n.bindFramebuffer(t.FRAMEBUFFER,S.__webglFramebuffer),S.__webglDepthbuffer===void 0)S.__webglDepthbuffer=t.createRenderbuffer(),je(S.__webglDepthbuffer,T,!1);else{const se=T.stencilBuffer?t.DEPTH_STENCIL_ATTACHMENT:t.DEPTH_ATTACHMENT,K=S.__webglDepthbuffer;t.bindRenderbuffer(t.RENDERBUFFER,K),t.framebufferRenderbuffer(t.FRAMEBUFFER,se,t.RENDERBUFFER,K)}}n.bindFramebuffer(t.FRAMEBUFFER,null)}function O(T,S,F){const J=i.get(T);S!==void 0&&Le(J.__webglFramebuffer,T,T.texture,t.COLOR_ATTACHMENT0,t.TEXTURE_2D,0),F!==void 0&&mt(T)}function k(T){const S=T.texture,F=i.get(T),J=i.get(S);T.addEventListener("dispose",P);const se=T.textures,K=T.isWebGLCubeRenderTarget===!0,Ce=se.length>1;if(Ce||(J.__webglTexture===void 0&&(J.__webglTexture=t.createTexture()),J.__version=S.version,o.memory.textures++),K){F.__webglFramebuffer=[];for(let ve=0;ve<6;ve++)if(S.mipmaps&&S.mipmaps.length>0){F.__webglFramebuffer[ve]=[];for(let Oe=0;Oe0){F.__webglFramebuffer=[];for(let ve=0;ve0&&ae(T)===!1){F.__webglMultisampledFramebuffer=t.createFramebuffer(),F.__webglColorRenderbuffer=[],n.bindFramebuffer(t.FRAMEBUFFER,F.__webglMultisampledFramebuffer);for(let ve=0;ve0)for(let Oe=0;Oe0)for(let Oe=0;Oe0){if(ae(T)===!1){const S=T.textures,F=T.width,J=T.height;let se=t.COLOR_BUFFER_BIT;const K=T.stencilBuffer?t.DEPTH_STENCIL_ATTACHMENT:t.DEPTH_ATTACHMENT,Ce=i.get(T),ve=S.length>1;if(ve)for(let $e=0;$e0?n.bindFramebuffer(t.DRAW_FRAMEBUFFER,Ce.__webglFramebuffer[0]):n.bindFramebuffer(t.DRAW_FRAMEBUFFER,Ce.__webglFramebuffer);for(let $e=0;$e0&&e.has("WEBGL_multisampled_render_to_texture")===!0&&S.__useRenderToTexture!==!1}function Q(T){const S=o.render.frame;u.get(T)!==S&&(u.set(T,S),T.update())}function ee(T,S){const F=T.colorSpace,J=T.format,se=T.type;return T.isCompressedTexture===!0||T.isVideoTexture===!0||F!==oa&&F!==fs&&(wt.getTransfer(F)===Dt?(J!==Ai||se!==li)&&it("WebGLTextures: sRGB encoded textures have to use RGBAFormat and UnsignedByteType."):bt("WebGLTextures: Unsupported texture color space:",F)),S}function oe(T){return typeof HTMLImageElement<"u"&&T instanceof HTMLImageElement?(c.width=T.naturalWidth||T.width,c.height=T.naturalHeight||T.height):typeof VideoFrame<"u"&&T instanceof VideoFrame?(c.width=T.displayWidth,c.height=T.displayHeight):(c.width=T.width,c.height=T.height),c}this.allocateTextureUnit=V,this.resetTextureUnits=L,this.setTexture2D=X,this.setTexture2DArray=W,this.setTexture3D=B,this.setTextureCube=z,this.rebindTextures=O,this.setupRenderTarget=k,this.updateRenderTargetMipmap=U,this.updateMultisampleRenderTarget=Y,this.setupDepthRenderbuffer=mt,this.setupFrameBufferTexture=Le,this.useMultisampledRTT=ae,this.isReversedDepthBuffer=function(){return n.buffers.depth.getReversed()}}function DN(t,e){function n(i,r=fs){let s;const o=wt.getTransfer(r);if(i===li)return t.UNSIGNED_BYTE;if(i===Qp)return t.UNSIGNED_SHORT_4_4_4_4;if(i===em)return t.UNSIGNED_SHORT_5_5_5_1;if(i===pb)return t.UNSIGNED_INT_5_9_9_9_REV;if(i===mb)return t.UNSIGNED_INT_10F_11F_11F_REV;if(i===fb)return t.BYTE;if(i===hb)return t.SHORT;if(i===cl)return t.UNSIGNED_SHORT;if(i===Zp)return t.INT;if(i===rr)return t.UNSIGNED_INT;if(i===Ki)return t.FLOAT;if(i===qr)return t.HALF_FLOAT;if(i===gb)return t.ALPHA;if(i===vb)return t.RGB;if(i===Ai)return t.RGBA;if(i===Xr)return t.DEPTH_COMPONENT;if(i===Ks)return t.DEPTH_STENCIL;if(i===_b)return t.RED;if(i===tm)return t.RED_INTEGER;if(i===sa)return t.RG;if(i===nm)return t.RG_INTEGER;if(i===im)return t.RGBA_INTEGER;if(i===Fc||i===Uc||i===kc||i===Bc)if(o===Dt)if(s=e.get("WEBGL_compressed_texture_s3tc_srgb"),s!==null){if(i===Fc)return s.COMPRESSED_SRGB_S3TC_DXT1_EXT;if(i===Uc)return s.COMPRESSED_SRGB_ALPHA_S3TC_DXT1_EXT;if(i===kc)return s.COMPRESSED_SRGB_ALPHA_S3TC_DXT3_EXT;if(i===Bc)return s.COMPRESSED_SRGB_ALPHA_S3TC_DXT5_EXT}else return null;else if(s=e.get("WEBGL_compressed_texture_s3tc"),s!==null){if(i===Fc)return s.COMPRESSED_RGB_S3TC_DXT1_EXT;if(i===Uc)return s.COMPRESSED_RGBA_S3TC_DXT1_EXT;if(i===kc)return s.COMPRESSED_RGBA_S3TC_DXT3_EXT;if(i===Bc)return s.COMPRESSED_RGBA_S3TC_DXT5_EXT}else return null;if(i===Ah||i===Ch||i===Ph||i===Rh)if(s=e.get("WEBGL_compressed_texture_pvrtc"),s!==null){if(i===Ah)return s.COMPRESSED_RGB_PVRTC_4BPPV1_IMG;if(i===Ch)return s.COMPRESSED_RGB_PVRTC_2BPPV1_IMG;if(i===Ph)return s.COMPRESSED_RGBA_PVRTC_4BPPV1_IMG;if(i===Rh)return s.COMPRESSED_RGBA_PVRTC_2BPPV1_IMG}else return null;if(i===Dh||i===Ih||i===Nh||i===Lh||i===Oh||i===Fh||i===Uh)if(s=e.get("WEBGL_compressed_texture_etc"),s!==null){if(i===Dh||i===Ih)return o===Dt?s.COMPRESSED_SRGB8_ETC2:s.COMPRESSED_RGB8_ETC2;if(i===Nh)return o===Dt?s.COMPRESSED_SRGB8_ALPHA8_ETC2_EAC:s.COMPRESSED_RGBA8_ETC2_EAC;if(i===Lh)return s.COMPRESSED_R11_EAC;if(i===Oh)return s.COMPRESSED_SIGNED_R11_EAC;if(i===Fh)return s.COMPRESSED_RG11_EAC;if(i===Uh)return s.COMPRESSED_SIGNED_RG11_EAC}else return null;if(i===kh||i===Bh||i===zh||i===Vh||i===Hh||i===Gh||i===Wh||i===qh||i===Xh||i===$h||i===jh||i===Yh||i===Jh||i===Kh)if(s=e.get("WEBGL_compressed_texture_astc"),s!==null){if(i===kh)return o===Dt?s.COMPRESSED_SRGB8_ALPHA8_ASTC_4x4_KHR:s.COMPRESSED_RGBA_ASTC_4x4_KHR;if(i===Bh)return o===Dt?s.COMPRESSED_SRGB8_ALPHA8_ASTC_5x4_KHR:s.COMPRESSED_RGBA_ASTC_5x4_KHR;if(i===zh)return o===Dt?s.COMPRESSED_SRGB8_ALPHA8_ASTC_5x5_KHR:s.COMPRESSED_RGBA_ASTC_5x5_KHR;if(i===Vh)return o===Dt?s.COMPRESSED_SRGB8_ALPHA8_ASTC_6x5_KHR:s.COMPRESSED_RGBA_ASTC_6x5_KHR;if(i===Hh)return o===Dt?s.COMPRESSED_SRGB8_ALPHA8_ASTC_6x6_KHR:s.COMPRESSED_RGBA_ASTC_6x6_KHR;if(i===Gh)return o===Dt?s.COMPRESSED_SRGB8_ALPHA8_ASTC_8x5_KHR:s.COMPRESSED_RGBA_ASTC_8x5_KHR;if(i===Wh)return o===Dt?s.COMPRESSED_SRGB8_ALPHA8_ASTC_8x6_KHR:s.COMPRESSED_RGBA_ASTC_8x6_KHR;if(i===qh)return o===Dt?s.COMPRESSED_SRGB8_ALPHA8_ASTC_8x8_KHR:s.COMPRESSED_RGBA_ASTC_8x8_KHR;if(i===Xh)return o===Dt?s.COMPRESSED_SRGB8_ALPHA8_ASTC_10x5_KHR:s.COMPRESSED_RGBA_ASTC_10x5_KHR;if(i===$h)return o===Dt?s.COMPRESSED_SRGB8_ALPHA8_ASTC_10x6_KHR:s.COMPRESSED_RGBA_ASTC_10x6_KHR;if(i===jh)return o===Dt?s.COMPRESSED_SRGB8_ALPHA8_ASTC_10x8_KHR:s.COMPRESSED_RGBA_ASTC_10x8_KHR;if(i===Yh)return o===Dt?s.COMPRESSED_SRGB8_ALPHA8_ASTC_10x10_KHR:s.COMPRESSED_RGBA_ASTC_10x10_KHR;if(i===Jh)return o===Dt?s.COMPRESSED_SRGB8_ALPHA8_ASTC_12x10_KHR:s.COMPRESSED_RGBA_ASTC_12x10_KHR;if(i===Kh)return o===Dt?s.COMPRESSED_SRGB8_ALPHA8_ASTC_12x12_KHR:s.COMPRESSED_RGBA_ASTC_12x12_KHR}else return null;if(i===Zh||i===Qh||i===ep)if(s=e.get("EXT_texture_compression_bptc"),s!==null){if(i===Zh)return o===Dt?s.COMPRESSED_SRGB_ALPHA_BPTC_UNORM_EXT:s.COMPRESSED_RGBA_BPTC_UNORM_EXT;if(i===Qh)return s.COMPRESSED_RGB_BPTC_SIGNED_FLOAT_EXT;if(i===ep)return s.COMPRESSED_RGB_BPTC_UNSIGNED_FLOAT_EXT}else return null;if(i===tp||i===np||i===ip||i===rp)if(s=e.get("EXT_texture_compression_rgtc"),s!==null){if(i===tp)return s.COMPRESSED_RED_RGTC1_EXT;if(i===np)return s.COMPRESSED_SIGNED_RED_RGTC1_EXT;if(i===ip)return s.COMPRESSED_RED_GREEN_RGTC2_EXT;if(i===rp)return s.COMPRESSED_SIGNED_RED_GREEN_RGTC2_EXT}else return null;return i===ul?t.UNSIGNED_INT_24_8:t[i]!==void 0?t[i]:null}return{convert:n}}const IN=` +}`,EN=[new N(1,0,0),new N(-1,0,0),new N(0,1,0),new N(0,-1,0),new N(0,0,1),new N(0,0,-1)],TN=[new N(0,-1,0),new N(0,-1,0),new N(0,0,1),new N(0,0,-1),new N(0,-1,0),new N(0,-1,0)],Mv=new yt,Pa=new N,Ff=new N;function AN(t,e,n){let i=new cm;const r=new xe,s=new xe,o=new Zt,a=new C2,l=new P2,c={},u=n.maxTextureSize,d={[ys]:Ln,[Ln]:ys,[Vn]:Vn},f=new Fi({defines:{VSM_SAMPLES:8},uniforms:{shadow_pass:{value:null},resolution:{value:new xe},radius:{value:4}},vertexShader:wN,fragmentShader:MN}),h=f.clone();h.defines.HORIZONTAL_PASS=1;const g=new _t;g.setAttribute("position",new Gn(new Float32Array([-1,-1,.5,3,-1,.5,-1,3,.5]),3));const v=new be(g,f),m=this;this.enabled=!1,this.autoUpdate=!0,this.needsUpdate=!1,this.type=Oc;let p=this.type;this.render=function(A,P,D){if(m.enabled===!1||m.autoUpdate===!1&&m.needsUpdate===!1||A.length===0)return;A.type===ib&&(it("WebGLShadowMap: PCFSoftShadowMap has been deprecated. Using PCFShadowMap instead."),A.type=Oc);const b=t.getRenderTarget(),w=t.getActiveCubeFace(),I=t.getActiveMipmapLevel(),L=t.state;L.setBlending(Lr),L.buffers.depth.getReversed()===!0?L.buffers.color.setClear(0,0,0,0):L.buffers.color.setClear(1,1,1,1),L.buffers.depth.setTest(!0),L.setScissorTest(!1);const V=p!==this.type;V&&P.traverse(function($){$.material&&(Array.isArray($.material)?$.material.forEach(X=>X.needsUpdate=!0):$.material.needsUpdate=!0)});for(let $=0,X=A.length;$u||r.y>u)&&(r.x>u&&(s.x=Math.floor(u/z.x),r.x=s.x*z.x,B.mapSize.x=s.x),r.y>u&&(s.y=Math.floor(u/z.y),r.y=s.y*z.y,B.mapSize.y=s.y)),B.map===null||V===!0){if(B.map!==null&&(B.map.depthTexture!==null&&(B.map.depthTexture.dispose(),B.map.depthTexture=null),B.map.dispose()),this.type===Fa){if(W.isPointLight){it("WebGLShadowMap: VSM shadow maps are not supported for PointLights. Use PCF or BasicShadowMap instead.");continue}B.map=new ir(r.x,r.y,{format:sa,type:qr,minFilter:Dn,magFilter:Dn,generateMipmaps:!1}),B.map.texture.name=W.name+".shadowMap",B.map.depthTexture=new fl(r.x,r.y,Ki),B.map.depthTexture.name=W.name+".shadowMapDepth",B.map.depthTexture.format=Xr,B.map.depthTexture.compareFunction=null,B.map.depthTexture.minFilter=Sn,B.map.depthTexture.magFilter=Sn}else{W.isPointLight?(B.map=new Pb(r.x),B.map.depthTexture=new qP(r.x,rr)):(B.map=new ir(r.x,r.y),B.map.depthTexture=new fl(r.x,r.y,rr)),B.map.depthTexture.name=W.name+".shadowMap",B.map.depthTexture.format=Xr;const le=t.state.buffers.depth.getReversed();this.type===Oc?(B.map.depthTexture.compareFunction=le?sm:rm,B.map.depthTexture.minFilter=Dn,B.map.depthTexture.magFilter=Dn):(B.map.depthTexture.compareFunction=null,B.map.depthTexture.minFilter=Sn,B.map.depthTexture.magFilter=Sn)}B.camera.updateProjectionMatrix()}const de=B.map.isWebGLCubeRenderTarget?6:1;for(let le=0;le0||P.map&&P.alphaTest>0||P.alphaToCoverage===!0){const L=w.uuid,V=P.uuid;let $=c[L];$===void 0&&($={},c[L]=$);let X=$[V];X===void 0&&(X=w.clone(),$[V]=X,P.addEventListener("dispose",M)),w=X}if(w.visible=P.visible,w.wireframe=P.wireframe,b===Fa?w.side=P.shadowSide!==null?P.shadowSide:P.side:w.side=P.shadowSide!==null?P.shadowSide:d[P.side],w.alphaMap=P.alphaMap,w.alphaTest=P.alphaToCoverage===!0?.5:P.alphaTest,w.map=P.map,w.clipShadows=P.clipShadows,w.clippingPlanes=P.clippingPlanes,w.clipIntersection=P.clipIntersection,w.displacementMap=P.displacementMap,w.displacementScale=P.displacementScale,w.displacementBias=P.displacementBias,w.wireframeLinewidth=P.wireframeLinewidth,w.linewidth=P.linewidth,D.isPointLight===!0&&w.isMeshDistanceMaterial===!0){const L=t.properties.get(w);L.light=D}return w}function x(A,P,D,b,w){if(A.visible===!1)return;if(A.layers.test(P.layers)&&(A.isMesh||A.isLine||A.isPoints)&&(A.castShadow||A.receiveShadow&&w===Fa)&&(!A.frustumCulled||i.intersectsObject(A))){A.modelViewMatrix.multiplyMatrices(D.matrixWorldInverse,A.matrixWorld);const V=e.update(A),$=A.material;if(Array.isArray($)){const X=V.groups;for(let W=0,B=X.length;W=1):z.indexOf("OpenGL ES")!==-1&&(B=parseFloat(/^OpenGL ES (\d)/.exec(z)[1]),W=B>=2);let de=null,le={};const pe=t.getParameter(t.SCISSOR_BOX),He=t.getParameter(t.VIEWPORT),ze=new Zt().fromArray(pe),st=new Zt().fromArray(He);function xt(G,Ue,ye,Ve){const _e=new Uint8Array(4),he=t.createTexture();t.bindTexture(G,he),t.texParameteri(G,t.TEXTURE_MIN_FILTER,t.NEAREST),t.texParameteri(G,t.TEXTURE_MAG_FILTER,t.NEAREST);for(let Te=0;Te"u"?!1:/OculusBrowser/g.test(navigator.userAgent),c=new xe,u=new WeakMap;let d;const f=new WeakMap;let h=!1;try{h=typeof OffscreenCanvas<"u"&&new OffscreenCanvas(1,1).getContext("2d")!==null}catch{}function g(T,S){return h?new OffscreenCanvas(T,S):lu("canvas")}function v(T,S,F){let J=1;const se=oe(T);if((se.width>F||se.height>F)&&(J=F/Math.max(se.width,se.height)),J<1)if(typeof HTMLImageElement<"u"&&T instanceof HTMLImageElement||typeof HTMLCanvasElement<"u"&&T instanceof HTMLCanvasElement||typeof ImageBitmap<"u"&&T instanceof ImageBitmap||typeof VideoFrame<"u"&&T instanceof VideoFrame){const K=Math.floor(J*se.width),Ce=Math.floor(J*se.height);d===void 0&&(d=g(K,Ce));const ve=S?g(K,Ce):d;return ve.width=K,ve.height=Ce,ve.getContext("2d").drawImage(T,0,0,K,Ce),it("WebGLRenderer: Texture has been resized from ("+se.width+"x"+se.height+") to ("+K+"x"+Ce+")."),ve}else return"data"in T&&it("WebGLRenderer: Image in DataTexture is too big ("+se.width+"x"+se.height+")."),T;return T}function m(T){return T.generateMipmaps}function p(T){t.generateMipmap(T)}function _(T){return T.isWebGLCubeRenderTarget?t.TEXTURE_CUBE_MAP:T.isWebGL3DRenderTarget?t.TEXTURE_3D:T.isWebGLArrayRenderTarget||T.isCompressedArrayTexture?t.TEXTURE_2D_ARRAY:t.TEXTURE_2D}function y(T,S,F,J,se=!1){if(T!==null){if(t[T]!==void 0)return t[T];it("WebGLRenderer: Attempt to use non-existing WebGL internal format '"+T+"'")}let K=S;if(S===t.RED&&(F===t.FLOAT&&(K=t.R32F),F===t.HALF_FLOAT&&(K=t.R16F),F===t.UNSIGNED_BYTE&&(K=t.R8)),S===t.RED_INTEGER&&(F===t.UNSIGNED_BYTE&&(K=t.R8UI),F===t.UNSIGNED_SHORT&&(K=t.R16UI),F===t.UNSIGNED_INT&&(K=t.R32UI),F===t.BYTE&&(K=t.R8I),F===t.SHORT&&(K=t.R16I),F===t.INT&&(K=t.R32I)),S===t.RG&&(F===t.FLOAT&&(K=t.RG32F),F===t.HALF_FLOAT&&(K=t.RG16F),F===t.UNSIGNED_BYTE&&(K=t.RG8)),S===t.RG_INTEGER&&(F===t.UNSIGNED_BYTE&&(K=t.RG8UI),F===t.UNSIGNED_SHORT&&(K=t.RG16UI),F===t.UNSIGNED_INT&&(K=t.RG32UI),F===t.BYTE&&(K=t.RG8I),F===t.SHORT&&(K=t.RG16I),F===t.INT&&(K=t.RG32I)),S===t.RGB_INTEGER&&(F===t.UNSIGNED_BYTE&&(K=t.RGB8UI),F===t.UNSIGNED_SHORT&&(K=t.RGB16UI),F===t.UNSIGNED_INT&&(K=t.RGB32UI),F===t.BYTE&&(K=t.RGB8I),F===t.SHORT&&(K=t.RGB16I),F===t.INT&&(K=t.RGB32I)),S===t.RGBA_INTEGER&&(F===t.UNSIGNED_BYTE&&(K=t.RGBA8UI),F===t.UNSIGNED_SHORT&&(K=t.RGBA16UI),F===t.UNSIGNED_INT&&(K=t.RGBA32UI),F===t.BYTE&&(K=t.RGBA8I),F===t.SHORT&&(K=t.RGBA16I),F===t.INT&&(K=t.RGBA32I)),S===t.RGB&&(F===t.UNSIGNED_INT_5_9_9_9_REV&&(K=t.RGB9_E5),F===t.UNSIGNED_INT_10F_11F_11F_REV&&(K=t.R11F_G11F_B10F)),S===t.RGBA){const Ce=se?ou:wt.getTransfer(J);F===t.FLOAT&&(K=t.RGBA32F),F===t.HALF_FLOAT&&(K=t.RGBA16F),F===t.UNSIGNED_BYTE&&(K=Ce===Dt?t.SRGB8_ALPHA8:t.RGBA8),F===t.UNSIGNED_SHORT_4_4_4_4&&(K=t.RGBA4),F===t.UNSIGNED_SHORT_5_5_5_1&&(K=t.RGB5_A1)}return(K===t.R16F||K===t.R32F||K===t.RG16F||K===t.RG32F||K===t.RGBA16F||K===t.RGBA32F)&&e.get("EXT_color_buffer_float"),K}function x(T,S){let F;return T?S===null||S===rr||S===ul?F=t.DEPTH24_STENCIL8:S===Ki?F=t.DEPTH32F_STENCIL8:S===cl&&(F=t.DEPTH24_STENCIL8,it("DepthTexture: 16 bit depth attachment is not supported with stencil. Using 24-bit attachment.")):S===null||S===rr||S===ul?F=t.DEPTH_COMPONENT24:S===Ki?F=t.DEPTH_COMPONENT32F:S===cl&&(F=t.DEPTH_COMPONENT16),F}function M(T,S){return m(T)===!0||T.isFramebufferTexture&&T.minFilter!==Sn&&T.minFilter!==Dn?Math.log2(Math.max(S.width,S.height))+1:T.mipmaps!==void 0&&T.mipmaps.length>0?T.mipmaps.length:T.isCompressedTexture&&Array.isArray(T.image)?S.mipmaps.length:1}function A(T){const S=T.target;S.removeEventListener("dispose",A),D(S),S.isVideoTexture&&u.delete(S)}function P(T){const S=T.target;S.removeEventListener("dispose",P),w(S)}function D(T){const S=i.get(T);if(S.__webglInit===void 0)return;const F=T.source,J=f.get(F);if(J){const se=J[S.__cacheKey];se.usedTimes--,se.usedTimes===0&&b(T),Object.keys(J).length===0&&f.delete(F)}i.remove(T)}function b(T){const S=i.get(T);t.deleteTexture(S.__webglTexture);const F=T.source,J=f.get(F);delete J[S.__cacheKey],o.memory.textures--}function w(T){const S=i.get(T);if(T.depthTexture&&(T.depthTexture.dispose(),i.remove(T.depthTexture)),T.isWebGLCubeRenderTarget)for(let J=0;J<6;J++){if(Array.isArray(S.__webglFramebuffer[J]))for(let se=0;se=r.maxTextures&&it("WebGLTextures: Trying to use "+T+" texture units while this GPU supports only "+r.maxTextures),I+=1,T}function $(T){const S=[];return S.push(T.wrapS),S.push(T.wrapT),S.push(T.wrapR||0),S.push(T.magFilter),S.push(T.minFilter),S.push(T.anisotropy),S.push(T.internalFormat),S.push(T.format),S.push(T.type),S.push(T.generateMipmaps),S.push(T.premultiplyAlpha),S.push(T.flipY),S.push(T.unpackAlignment),S.push(T.colorSpace),S.join()}function X(T,S){const F=i.get(T);if(T.isVideoTexture&&Q(T),T.isRenderTargetTexture===!1&&T.isExternalTexture!==!0&&T.version>0&&F.__version!==T.version){const J=T.image;if(J===null)it("WebGLRenderer: Texture marked for update but no image data found.");else if(J.complete===!1)it("WebGLRenderer: Texture marked for update but image is incomplete");else{ce(F,T,S);return}}else T.isExternalTexture&&(F.__webglTexture=T.sourceTexture?T.sourceTexture:null);n.bindTexture(t.TEXTURE_2D,F.__webglTexture,t.TEXTURE0+S)}function W(T,S){const F=i.get(T);if(T.isRenderTargetTexture===!1&&T.version>0&&F.__version!==T.version){ce(F,T,S);return}else T.isExternalTexture&&(F.__webglTexture=T.sourceTexture?T.sourceTexture:null);n.bindTexture(t.TEXTURE_2D_ARRAY,F.__webglTexture,t.TEXTURE0+S)}function B(T,S){const F=i.get(T);if(T.isRenderTargetTexture===!1&&T.version>0&&F.__version!==T.version){ce(F,T,S);return}n.bindTexture(t.TEXTURE_3D,F.__webglTexture,t.TEXTURE0+S)}function z(T,S){const F=i.get(T);if(T.isCubeDepthTexture!==!0&&T.version>0&&F.__version!==T.version){ue(F,T,S);return}n.bindTexture(t.TEXTURE_CUBE_MAP,F.__webglTexture,t.TEXTURE0+S)}const de={[Eh]:t.REPEAT,[Ir]:t.CLAMP_TO_EDGE,[Th]:t.MIRRORED_REPEAT},le={[Sn]:t.NEAREST,[qC]:t.NEAREST_MIPMAP_NEAREST,[Wl]:t.NEAREST_MIPMAP_LINEAR,[Dn]:t.LINEAR,[ef]:t.LINEAR_MIPMAP_NEAREST,[Js]:t.LINEAR_MIPMAP_LINEAR},pe={[jC]:t.NEVER,[QC]:t.ALWAYS,[YC]:t.LESS,[rm]:t.LEQUAL,[JC]:t.EQUAL,[sm]:t.GEQUAL,[KC]:t.GREATER,[ZC]:t.NOTEQUAL};function He(T,S){if(S.type===Ki&&e.has("OES_texture_float_linear")===!1&&(S.magFilter===Dn||S.magFilter===ef||S.magFilter===Wl||S.magFilter===Js||S.minFilter===Dn||S.minFilter===ef||S.minFilter===Wl||S.minFilter===Js)&&it("WebGLRenderer: Unable to use linear filtering with floating point textures. OES_texture_float_linear not supported on this device."),t.texParameteri(T,t.TEXTURE_WRAP_S,de[S.wrapS]),t.texParameteri(T,t.TEXTURE_WRAP_T,de[S.wrapT]),(T===t.TEXTURE_3D||T===t.TEXTURE_2D_ARRAY)&&t.texParameteri(T,t.TEXTURE_WRAP_R,de[S.wrapR]),t.texParameteri(T,t.TEXTURE_MAG_FILTER,le[S.magFilter]),t.texParameteri(T,t.TEXTURE_MIN_FILTER,le[S.minFilter]),S.compareFunction&&(t.texParameteri(T,t.TEXTURE_COMPARE_MODE,t.COMPARE_REF_TO_TEXTURE),t.texParameteri(T,t.TEXTURE_COMPARE_FUNC,pe[S.compareFunction])),e.has("EXT_texture_filter_anisotropic")===!0){if(S.magFilter===Sn||S.minFilter!==Wl&&S.minFilter!==Js||S.type===Ki&&e.has("OES_texture_float_linear")===!1)return;if(S.anisotropy>1||i.get(S).__currentAnisotropy){const F=e.get("EXT_texture_filter_anisotropic");t.texParameterf(T,F.TEXTURE_MAX_ANISOTROPY_EXT,Math.min(S.anisotropy,r.getMaxAnisotropy())),i.get(S).__currentAnisotropy=S.anisotropy}}}function ze(T,S){let F=!1;T.__webglInit===void 0&&(T.__webglInit=!0,S.addEventListener("dispose",A));const J=S.source;let se=f.get(J);se===void 0&&(se={},f.set(J,se));const K=$(S);if(K!==T.__cacheKey){se[K]===void 0&&(se[K]={texture:t.createTexture(),usedTimes:0},o.memory.textures++,F=!0),se[K].usedTimes++;const Ce=se[T.__cacheKey];Ce!==void 0&&(se[T.__cacheKey].usedTimes--,Ce.usedTimes===0&&b(S)),T.__cacheKey=K,T.__webglTexture=se[K].texture}return F}function st(T,S,F){return Math.floor(Math.floor(T/F)/S)}function xt(T,S,F,J){const K=T.updateRanges;if(K.length===0)n.texSubImage2D(t.TEXTURE_2D,0,0,0,S.width,S.height,F,J,S.data);else{K.sort((ge,Ee)=>ge.start-Ee.start);let Ce=0;for(let ge=1;ge0){G&&Ue&&n.texStorage2D(t.TEXTURE_2D,Ve,Be,dt[0].width,dt[0].height);for(let _e=0,he=dt.length;_e0){const Te=tv(we.width,we.height,S.format,S.type);for(const lt of S.layerUpdates){const Vt=we.data.subarray(lt*Te/we.data.BYTES_PER_ELEMENT,(lt+1)*Te/we.data.BYTES_PER_ELEMENT);n.compressedTexSubImage3D(t.TEXTURE_2D_ARRAY,_e,0,0,lt,we.width,we.height,1,Ee,Vt)}S.clearLayerUpdates()}else n.compressedTexSubImage3D(t.TEXTURE_2D_ARRAY,_e,0,0,0,we.width,we.height,ge.depth,Ee,we.data)}else n.compressedTexImage3D(t.TEXTURE_2D_ARRAY,_e,Be,we.width,we.height,ge.depth,0,we.data,0,0);else it("WebGLRenderer: Attempt to load unsupported compressed texture format in .uploadTexture()");else G?ye&&n.texSubImage3D(t.TEXTURE_2D_ARRAY,_e,0,0,0,we.width,we.height,ge.depth,Ee,Pe,we.data):n.texImage3D(t.TEXTURE_2D_ARRAY,_e,Be,we.width,we.height,ge.depth,0,Ee,Pe,we.data)}else{G&&Ue&&n.texStorage2D(t.TEXTURE_2D,Ve,Be,dt[0].width,dt[0].height);for(let _e=0,he=dt.length;_e0){const _e=tv(ge.width,ge.height,S.format,S.type);for(const he of S.layerUpdates){const Te=ge.data.subarray(he*_e/ge.data.BYTES_PER_ELEMENT,(he+1)*_e/ge.data.BYTES_PER_ELEMENT);n.texSubImage3D(t.TEXTURE_2D_ARRAY,0,0,0,he,ge.width,ge.height,1,Ee,Pe,Te)}S.clearLayerUpdates()}else n.texSubImage3D(t.TEXTURE_2D_ARRAY,0,0,0,0,ge.width,ge.height,ge.depth,Ee,Pe,ge.data)}else n.texImage3D(t.TEXTURE_2D_ARRAY,0,Be,ge.width,ge.height,ge.depth,0,Ee,Pe,ge.data);else if(S.isData3DTexture)G?(Ue&&n.texStorage3D(t.TEXTURE_3D,Ve,Be,ge.width,ge.height,ge.depth),ye&&n.texSubImage3D(t.TEXTURE_3D,0,0,0,0,ge.width,ge.height,ge.depth,Ee,Pe,ge.data)):n.texImage3D(t.TEXTURE_3D,0,Be,ge.width,ge.height,ge.depth,0,Ee,Pe,ge.data);else if(S.isFramebufferTexture){if(Ue)if(G)n.texStorage2D(t.TEXTURE_2D,Ve,Be,ge.width,ge.height);else{let _e=ge.width,he=ge.height;for(let Te=0;Te>=1,he>>=1}}else if(dt.length>0){if(G&&Ue){const _e=oe(dt[0]);n.texStorage2D(t.TEXTURE_2D,Ve,Be,_e.width,_e.height)}for(let _e=0,he=dt.length;_e0&&Ve++;const he=oe(Ee[0]);n.texStorage2D(t.TEXTURE_CUBE_MAP,Ve,dt,he.width,he.height)}for(let he=0;he<6;he++)if(ge){G?ye&&n.texSubImage2D(t.TEXTURE_CUBE_MAP_POSITIVE_X+he,0,0,0,Ee[he].width,Ee[he].height,Be,we,Ee[he].data):n.texImage2D(t.TEXTURE_CUBE_MAP_POSITIVE_X+he,0,dt,Ee[he].width,Ee[he].height,0,Be,we,Ee[he].data);for(let Te=0;Te<_e.length;Te++){const Vt=_e[Te].image[he].image;G?ye&&n.texSubImage2D(t.TEXTURE_CUBE_MAP_POSITIVE_X+he,Te+1,0,0,Vt.width,Vt.height,Be,we,Vt.data):n.texImage2D(t.TEXTURE_CUBE_MAP_POSITIVE_X+he,Te+1,dt,Vt.width,Vt.height,0,Be,we,Vt.data)}}else{G?ye&&n.texSubImage2D(t.TEXTURE_CUBE_MAP_POSITIVE_X+he,0,0,0,Be,we,Ee[he]):n.texImage2D(t.TEXTURE_CUBE_MAP_POSITIVE_X+he,0,dt,Be,we,Ee[he]);for(let Te=0;Te<_e.length;Te++){const lt=_e[Te];G?ye&&n.texSubImage2D(t.TEXTURE_CUBE_MAP_POSITIVE_X+he,Te+1,0,0,Be,we,lt.image[he]):n.texImage2D(t.TEXTURE_CUBE_MAP_POSITIVE_X+he,Te+1,dt,Be,we,lt.image[he])}}}m(S)&&p(t.TEXTURE_CUBE_MAP),K.__version=se.version,S.onUpdate&&S.onUpdate(S)}T.__version=S.version}function Le(T,S,F,J,se,K){const Ce=s.convert(F.format,F.colorSpace),ve=s.convert(F.type),Oe=y(F.internalFormat,Ce,ve,F.colorSpace),$e=i.get(S),ge=i.get(F);if(ge.__renderTarget=S,!$e.__hasExternalTextures){const Ee=Math.max(1,S.width>>K),Pe=Math.max(1,S.height>>K);se===t.TEXTURE_3D||se===t.TEXTURE_2D_ARRAY?n.texImage3D(se,K,Oe,Ee,Pe,S.depth,0,Ce,ve,null):n.texImage2D(se,K,Oe,Ee,Pe,0,Ce,ve,null)}n.bindFramebuffer(t.FRAMEBUFFER,T),ae(S)?a.framebufferTexture2DMultisampleEXT(t.FRAMEBUFFER,J,se,ge.__webglTexture,0,C(S)):(se===t.TEXTURE_2D||se>=t.TEXTURE_CUBE_MAP_POSITIVE_X&&se<=t.TEXTURE_CUBE_MAP_NEGATIVE_Z)&&t.framebufferTexture2D(t.FRAMEBUFFER,J,se,ge.__webglTexture,K),n.bindFramebuffer(t.FRAMEBUFFER,null)}function je(T,S,F){if(t.bindRenderbuffer(t.RENDERBUFFER,T),S.depthBuffer){const J=S.depthTexture,se=J&&J.isDepthTexture?J.type:null,K=x(S.stencilBuffer,se),Ce=S.stencilBuffer?t.DEPTH_STENCIL_ATTACHMENT:t.DEPTH_ATTACHMENT;ae(S)?a.renderbufferStorageMultisampleEXT(t.RENDERBUFFER,C(S),K,S.width,S.height):F?t.renderbufferStorageMultisample(t.RENDERBUFFER,C(S),K,S.width,S.height):t.renderbufferStorage(t.RENDERBUFFER,K,S.width,S.height),t.framebufferRenderbuffer(t.FRAMEBUFFER,Ce,t.RENDERBUFFER,T)}else{const J=S.textures;for(let se=0;se{delete S.__boundDepthTexture,delete S.__depthDisposeCallback,J.removeEventListener("dispose",se)};J.addEventListener("dispose",se),S.__depthDisposeCallback=se}S.__boundDepthTexture=J}if(T.depthTexture&&!S.__autoAllocateDepthBuffer)if(F)for(let J=0;J<6;J++)Ae(S.__webglFramebuffer[J],T,J);else{const J=T.texture.mipmaps;J&&J.length>0?Ae(S.__webglFramebuffer[0],T,0):Ae(S.__webglFramebuffer,T,0)}else if(F){S.__webglDepthbuffer=[];for(let J=0;J<6;J++)if(n.bindFramebuffer(t.FRAMEBUFFER,S.__webglFramebuffer[J]),S.__webglDepthbuffer[J]===void 0)S.__webglDepthbuffer[J]=t.createRenderbuffer(),je(S.__webglDepthbuffer[J],T,!1);else{const se=T.stencilBuffer?t.DEPTH_STENCIL_ATTACHMENT:t.DEPTH_ATTACHMENT,K=S.__webglDepthbuffer[J];t.bindRenderbuffer(t.RENDERBUFFER,K),t.framebufferRenderbuffer(t.FRAMEBUFFER,se,t.RENDERBUFFER,K)}}else{const J=T.texture.mipmaps;if(J&&J.length>0?n.bindFramebuffer(t.FRAMEBUFFER,S.__webglFramebuffer[0]):n.bindFramebuffer(t.FRAMEBUFFER,S.__webglFramebuffer),S.__webglDepthbuffer===void 0)S.__webglDepthbuffer=t.createRenderbuffer(),je(S.__webglDepthbuffer,T,!1);else{const se=T.stencilBuffer?t.DEPTH_STENCIL_ATTACHMENT:t.DEPTH_ATTACHMENT,K=S.__webglDepthbuffer;t.bindRenderbuffer(t.RENDERBUFFER,K),t.framebufferRenderbuffer(t.FRAMEBUFFER,se,t.RENDERBUFFER,K)}}n.bindFramebuffer(t.FRAMEBUFFER,null)}function O(T,S,F){const J=i.get(T);S!==void 0&&Le(J.__webglFramebuffer,T,T.texture,t.COLOR_ATTACHMENT0,t.TEXTURE_2D,0),F!==void 0&&mt(T)}function k(T){const S=T.texture,F=i.get(T),J=i.get(S);T.addEventListener("dispose",P);const se=T.textures,K=T.isWebGLCubeRenderTarget===!0,Ce=se.length>1;if(Ce||(J.__webglTexture===void 0&&(J.__webglTexture=t.createTexture()),J.__version=S.version,o.memory.textures++),K){F.__webglFramebuffer=[];for(let ve=0;ve<6;ve++)if(S.mipmaps&&S.mipmaps.length>0){F.__webglFramebuffer[ve]=[];for(let Oe=0;Oe0){F.__webglFramebuffer=[];for(let ve=0;ve0&&ae(T)===!1){F.__webglMultisampledFramebuffer=t.createFramebuffer(),F.__webglColorRenderbuffer=[],n.bindFramebuffer(t.FRAMEBUFFER,F.__webglMultisampledFramebuffer);for(let ve=0;ve0)for(let Oe=0;Oe0)for(let Oe=0;Oe0){if(ae(T)===!1){const S=T.textures,F=T.width,J=T.height;let se=t.COLOR_BUFFER_BIT;const K=T.stencilBuffer?t.DEPTH_STENCIL_ATTACHMENT:t.DEPTH_ATTACHMENT,Ce=i.get(T),ve=S.length>1;if(ve)for(let $e=0;$e0?n.bindFramebuffer(t.DRAW_FRAMEBUFFER,Ce.__webglFramebuffer[0]):n.bindFramebuffer(t.DRAW_FRAMEBUFFER,Ce.__webglFramebuffer);for(let $e=0;$e0&&e.has("WEBGL_multisampled_render_to_texture")===!0&&S.__useRenderToTexture!==!1}function Q(T){const S=o.render.frame;u.get(T)!==S&&(u.set(T,S),T.update())}function ee(T,S){const F=T.colorSpace,J=T.format,se=T.type;return T.isCompressedTexture===!0||T.isVideoTexture===!0||F!==oa&&F!==fs&&(wt.getTransfer(F)===Dt?(J!==Ai||se!==li)&&it("WebGLTextures: sRGB encoded textures have to use RGBAFormat and UnsignedByteType."):bt("WebGLTextures: Unsupported texture color space:",F)),S}function oe(T){return typeof HTMLImageElement<"u"&&T instanceof HTMLImageElement?(c.width=T.naturalWidth||T.width,c.height=T.naturalHeight||T.height):typeof VideoFrame<"u"&&T instanceof VideoFrame?(c.width=T.displayWidth,c.height=T.displayHeight):(c.width=T.width,c.height=T.height),c}this.allocateTextureUnit=V,this.resetTextureUnits=L,this.setTexture2D=X,this.setTexture2DArray=W,this.setTexture3D=B,this.setTextureCube=z,this.rebindTextures=O,this.setupRenderTarget=k,this.updateRenderTargetMipmap=U,this.updateMultisampleRenderTarget=Y,this.setupDepthRenderbuffer=mt,this.setupFrameBufferTexture=Le,this.useMultisampledRTT=ae,this.isReversedDepthBuffer=function(){return n.buffers.depth.getReversed()}}function DN(t,e){function n(i,r=fs){let s;const o=wt.getTransfer(r);if(i===li)return t.UNSIGNED_BYTE;if(i===Qp)return t.UNSIGNED_SHORT_4_4_4_4;if(i===em)return t.UNSIGNED_SHORT_5_5_5_1;if(i===pb)return t.UNSIGNED_INT_5_9_9_9_REV;if(i===mb)return t.UNSIGNED_INT_10F_11F_11F_REV;if(i===fb)return t.BYTE;if(i===hb)return t.SHORT;if(i===cl)return t.UNSIGNED_SHORT;if(i===Zp)return t.INT;if(i===rr)return t.UNSIGNED_INT;if(i===Ki)return t.FLOAT;if(i===qr)return t.HALF_FLOAT;if(i===gb)return t.ALPHA;if(i===vb)return t.RGB;if(i===Ai)return t.RGBA;if(i===Xr)return t.DEPTH_COMPONENT;if(i===Ks)return t.DEPTH_STENCIL;if(i===_b)return t.RED;if(i===tm)return t.RED_INTEGER;if(i===sa)return t.RG;if(i===nm)return t.RG_INTEGER;if(i===im)return t.RGBA_INTEGER;if(i===Fc||i===Uc||i===kc||i===Bc)if(o===Dt)if(s=e.get("WEBGL_compressed_texture_s3tc_srgb"),s!==null){if(i===Fc)return s.COMPRESSED_SRGB_S3TC_DXT1_EXT;if(i===Uc)return s.COMPRESSED_SRGB_ALPHA_S3TC_DXT1_EXT;if(i===kc)return s.COMPRESSED_SRGB_ALPHA_S3TC_DXT3_EXT;if(i===Bc)return s.COMPRESSED_SRGB_ALPHA_S3TC_DXT5_EXT}else return null;else if(s=e.get("WEBGL_compressed_texture_s3tc"),s!==null){if(i===Fc)return s.COMPRESSED_RGB_S3TC_DXT1_EXT;if(i===Uc)return s.COMPRESSED_RGBA_S3TC_DXT1_EXT;if(i===kc)return s.COMPRESSED_RGBA_S3TC_DXT3_EXT;if(i===Bc)return s.COMPRESSED_RGBA_S3TC_DXT5_EXT}else return null;if(i===Ah||i===Ch||i===Ph||i===Rh)if(s=e.get("WEBGL_compressed_texture_pvrtc"),s!==null){if(i===Ah)return s.COMPRESSED_RGB_PVRTC_4BPPV1_IMG;if(i===Ch)return s.COMPRESSED_RGB_PVRTC_2BPPV1_IMG;if(i===Ph)return s.COMPRESSED_RGBA_PVRTC_4BPPV1_IMG;if(i===Rh)return s.COMPRESSED_RGBA_PVRTC_2BPPV1_IMG}else return null;if(i===Dh||i===Ih||i===Nh||i===Lh||i===Oh||i===Fh||i===Uh)if(s=e.get("WEBGL_compressed_texture_etc"),s!==null){if(i===Dh||i===Ih)return o===Dt?s.COMPRESSED_SRGB8_ETC2:s.COMPRESSED_RGB8_ETC2;if(i===Nh)return o===Dt?s.COMPRESSED_SRGB8_ALPHA8_ETC2_EAC:s.COMPRESSED_RGBA8_ETC2_EAC;if(i===Lh)return s.COMPRESSED_R11_EAC;if(i===Oh)return s.COMPRESSED_SIGNED_R11_EAC;if(i===Fh)return s.COMPRESSED_RG11_EAC;if(i===Uh)return s.COMPRESSED_SIGNED_RG11_EAC}else return null;if(i===kh||i===Bh||i===zh||i===Vh||i===Hh||i===Gh||i===Wh||i===qh||i===Xh||i===$h||i===jh||i===Yh||i===Jh||i===Kh)if(s=e.get("WEBGL_compressed_texture_astc"),s!==null){if(i===kh)return o===Dt?s.COMPRESSED_SRGB8_ALPHA8_ASTC_4x4_KHR:s.COMPRESSED_RGBA_ASTC_4x4_KHR;if(i===Bh)return o===Dt?s.COMPRESSED_SRGB8_ALPHA8_ASTC_5x4_KHR:s.COMPRESSED_RGBA_ASTC_5x4_KHR;if(i===zh)return o===Dt?s.COMPRESSED_SRGB8_ALPHA8_ASTC_5x5_KHR:s.COMPRESSED_RGBA_ASTC_5x5_KHR;if(i===Vh)return o===Dt?s.COMPRESSED_SRGB8_ALPHA8_ASTC_6x5_KHR:s.COMPRESSED_RGBA_ASTC_6x5_KHR;if(i===Hh)return o===Dt?s.COMPRESSED_SRGB8_ALPHA8_ASTC_6x6_KHR:s.COMPRESSED_RGBA_ASTC_6x6_KHR;if(i===Gh)return o===Dt?s.COMPRESSED_SRGB8_ALPHA8_ASTC_8x5_KHR:s.COMPRESSED_RGBA_ASTC_8x5_KHR;if(i===Wh)return o===Dt?s.COMPRESSED_SRGB8_ALPHA8_ASTC_8x6_KHR:s.COMPRESSED_RGBA_ASTC_8x6_KHR;if(i===qh)return o===Dt?s.COMPRESSED_SRGB8_ALPHA8_ASTC_8x8_KHR:s.COMPRESSED_RGBA_ASTC_8x8_KHR;if(i===Xh)return o===Dt?s.COMPRESSED_SRGB8_ALPHA8_ASTC_10x5_KHR:s.COMPRESSED_RGBA_ASTC_10x5_KHR;if(i===$h)return o===Dt?s.COMPRESSED_SRGB8_ALPHA8_ASTC_10x6_KHR:s.COMPRESSED_RGBA_ASTC_10x6_KHR;if(i===jh)return o===Dt?s.COMPRESSED_SRGB8_ALPHA8_ASTC_10x8_KHR:s.COMPRESSED_RGBA_ASTC_10x8_KHR;if(i===Yh)return o===Dt?s.COMPRESSED_SRGB8_ALPHA8_ASTC_10x10_KHR:s.COMPRESSED_RGBA_ASTC_10x10_KHR;if(i===Jh)return o===Dt?s.COMPRESSED_SRGB8_ALPHA8_ASTC_12x10_KHR:s.COMPRESSED_RGBA_ASTC_12x10_KHR;if(i===Kh)return o===Dt?s.COMPRESSED_SRGB8_ALPHA8_ASTC_12x12_KHR:s.COMPRESSED_RGBA_ASTC_12x12_KHR}else return null;if(i===Zh||i===Qh||i===ep)if(s=e.get("EXT_texture_compression_bptc"),s!==null){if(i===Zh)return o===Dt?s.COMPRESSED_SRGB_ALPHA_BPTC_UNORM_EXT:s.COMPRESSED_RGBA_BPTC_UNORM_EXT;if(i===Qh)return s.COMPRESSED_RGB_BPTC_SIGNED_FLOAT_EXT;if(i===ep)return s.COMPRESSED_RGB_BPTC_UNSIGNED_FLOAT_EXT}else return null;if(i===tp||i===np||i===ip||i===rp)if(s=e.get("EXT_texture_compression_rgtc"),s!==null){if(i===tp)return s.COMPRESSED_RED_RGTC1_EXT;if(i===np)return s.COMPRESSED_SIGNED_RED_RGTC1_EXT;if(i===ip)return s.COMPRESSED_RED_GREEN_RGTC2_EXT;if(i===rp)return s.COMPRESSED_SIGNED_RED_GREEN_RGTC2_EXT}else return null;return i===ul?t.UNSIGNED_INT_24_8:t[i]!==void 0?t[i]:null}return{convert:n}}const IN=` void main() { gl_Position = vec4( position, 1.0 ); @@ -4010,7 +4010,7 @@ void main() { } -}`;class LN{constructor(){this.texture=null,this.mesh=null,this.depthNear=0,this.depthFar=0}init(e,n){if(this.texture===null){const i=new Rb(e.texture);(e.depthNear!==n.depthNear||e.depthFar!==n.depthFar)&&(this.depthNear=e.depthNear,this.depthFar=e.depthFar),this.texture=i}}getMesh(e){if(this.texture!==null&&this.mesh===null){const n=e.cameras[0].viewport,i=new Fi({vertexShader:IN,fragmentShader:NN,uniforms:{depthColor:{value:this.texture},depthWidth:{value:n.z},depthHeight:{value:n.w}}});this.mesh=new Te(new Cl(20,20),i)}return this.mesh}reset(){this.texture=null,this.mesh=null}getDepthTexture(){return this.texture}}class ON extends fo{constructor(e,n){super();const i=this;let r=null,s=1,o=null,a="local-floor",l=1,c=null,u=null,d=null,f=null,h=null,g=null;const v=typeof XRWebGLBinding<"u",m=new LN,p={},_=n.getContextAttributes();let y=null,x=null;const M=[],A=[],P=new xe;let D=null;const b=new Yn;b.viewport=new Zt;const w=new Yn;w.viewport=new Zt;const I=[b,w],L=new z2;let V=null,$=null;this.cameraAutoUpdate=!0,this.enabled=!1,this.isPresenting=!1,this.getController=function(ce){let ue=M[ce];return ue===void 0&&(ue=new Sf,M[ce]=ue),ue.getTargetRaySpace()},this.getControllerGrip=function(ce){let ue=M[ce];return ue===void 0&&(ue=new Sf,M[ce]=ue),ue.getGripSpace()},this.getHand=function(ce){let ue=M[ce];return ue===void 0&&(ue=new Sf,M[ce]=ue),ue.getHandSpace()};function X(ce){const ue=A.indexOf(ce.inputSource);if(ue===-1)return;const Le=M[ue];Le!==void 0&&(Le.update(ce.inputSource,ce.frame,c||o),Le.dispatchEvent({type:ce.type,data:ce.inputSource}))}function W(){r.removeEventListener("select",X),r.removeEventListener("selectstart",X),r.removeEventListener("selectend",X),r.removeEventListener("squeeze",X),r.removeEventListener("squeezestart",X),r.removeEventListener("squeezeend",X),r.removeEventListener("end",W),r.removeEventListener("inputsourceschange",B);for(let ce=0;ce=0&&(A[je]=null,M[je].disconnect(Le))}for(let ue=0;ue=A.length){A.push(Le),je=mt;break}else if(A[mt]===null){A[mt]=Le,je=mt;break}if(je===-1)break}const Ae=M[je];Ae&&Ae.connect(Le)}}const z=new N,de=new N;function le(ce,ue,Le){z.setFromMatrixPosition(ue.matrixWorld),de.setFromMatrixPosition(Le.matrixWorld);const je=z.distanceTo(de),Ae=ue.projectionMatrix.elements,mt=Le.projectionMatrix.elements,O=Ae[14]/(Ae[10]-1),k=Ae[14]/(Ae[10]+1),U=(Ae[9]+1)/Ae[5],q=(Ae[9]-1)/Ae[5],H=(Ae[8]-1)/Ae[0],Y=(mt[8]+1)/mt[0],C=O*H,ae=O*Y,Q=je/(-H+Y),ee=Q*-H;if(ue.matrixWorld.decompose(ce.position,ce.quaternion,ce.scale),ce.translateX(ee),ce.translateZ(Q),ce.matrixWorld.compose(ce.position,ce.quaternion,ce.scale),ce.matrixWorldInverse.copy(ce.matrixWorld).invert(),Ae[10]===-1)ce.projectionMatrix.copy(ue.projectionMatrix),ce.projectionMatrixInverse.copy(ue.projectionMatrixInverse);else{const oe=O+Q,T=k+Q,S=C-ee,F=ae+(je-ee),J=U*k/T*oe,se=q*k/T*oe;ce.projectionMatrix.makePerspective(S,F,J,se,oe,T),ce.projectionMatrixInverse.copy(ce.projectionMatrix).invert()}}function pe(ce,ue){ue===null?ce.matrixWorld.copy(ce.matrix):ce.matrixWorld.multiplyMatrices(ue.matrixWorld,ce.matrix),ce.matrixWorldInverse.copy(ce.matrixWorld).invert()}this.updateCamera=function(ce){if(r===null)return;let ue=ce.near,Le=ce.far;m.texture!==null&&(m.depthNear>0&&(ue=m.depthNear),m.depthFar>0&&(Le=m.depthFar)),L.near=w.near=b.near=ue,L.far=w.far=b.far=Le,(V!==L.near||$!==L.far)&&(r.updateRenderState({depthNear:L.near,depthFar:L.far}),V=L.near,$=L.far),L.layers.mask=ce.layers.mask|6,b.layers.mask=L.layers.mask&3,w.layers.mask=L.layers.mask&5;const je=ce.parent,Ae=L.cameras;pe(L,je);for(let mt=0;mt0&&(m.alphaTest.value=p.alphaTest);const _=e.get(p),y=_.envMap,x=_.envMapRotation;y&&(m.envMap.value=y,zs.copy(x),zs.x*=-1,zs.y*=-1,zs.z*=-1,y.isCubeTexture&&y.isRenderTargetTexture===!1&&(zs.y*=-1,zs.z*=-1),m.envMapRotation.value.setFromMatrix4(FN.makeRotationFromEuler(zs)),m.flipEnvMap.value=y.isCubeTexture&&y.isRenderTargetTexture===!1?-1:1,m.reflectivity.value=p.reflectivity,m.ior.value=p.ior,m.refractionRatio.value=p.refractionRatio),p.lightMap&&(m.lightMap.value=p.lightMap,m.lightMapIntensity.value=p.lightMapIntensity,n(p.lightMap,m.lightMapTransform)),p.aoMap&&(m.aoMap.value=p.aoMap,m.aoMapIntensity.value=p.aoMapIntensity,n(p.aoMap,m.aoMapTransform))}function o(m,p){m.diffuse.value.copy(p.color),m.opacity.value=p.opacity,p.map&&(m.map.value=p.map,n(p.map,m.mapTransform))}function a(m,p){m.dashSize.value=p.dashSize,m.totalSize.value=p.dashSize+p.gapSize,m.scale.value=p.scale}function l(m,p,_,y){m.diffuse.value.copy(p.color),m.opacity.value=p.opacity,m.size.value=p.size*_,m.scale.value=y*.5,p.map&&(m.map.value=p.map,n(p.map,m.uvTransform)),p.alphaMap&&(m.alphaMap.value=p.alphaMap,n(p.alphaMap,m.alphaMapTransform)),p.alphaTest>0&&(m.alphaTest.value=p.alphaTest)}function c(m,p){m.diffuse.value.copy(p.color),m.opacity.value=p.opacity,m.rotation.value=p.rotation,p.map&&(m.map.value=p.map,n(p.map,m.mapTransform)),p.alphaMap&&(m.alphaMap.value=p.alphaMap,n(p.alphaMap,m.alphaMapTransform)),p.alphaTest>0&&(m.alphaTest.value=p.alphaTest)}function u(m,p){m.specular.value.copy(p.specular),m.shininess.value=Math.max(p.shininess,1e-4)}function d(m,p){p.gradientMap&&(m.gradientMap.value=p.gradientMap)}function f(m,p){m.metalness.value=p.metalness,p.metalnessMap&&(m.metalnessMap.value=p.metalnessMap,n(p.metalnessMap,m.metalnessMapTransform)),m.roughness.value=p.roughness,p.roughnessMap&&(m.roughnessMap.value=p.roughnessMap,n(p.roughnessMap,m.roughnessMapTransform)),p.envMap&&(m.envMapIntensity.value=p.envMapIntensity)}function h(m,p,_){m.ior.value=p.ior,p.sheen>0&&(m.sheenColor.value.copy(p.sheenColor).multiplyScalar(p.sheen),m.sheenRoughness.value=p.sheenRoughness,p.sheenColorMap&&(m.sheenColorMap.value=p.sheenColorMap,n(p.sheenColorMap,m.sheenColorMapTransform)),p.sheenRoughnessMap&&(m.sheenRoughnessMap.value=p.sheenRoughnessMap,n(p.sheenRoughnessMap,m.sheenRoughnessMapTransform))),p.clearcoat>0&&(m.clearcoat.value=p.clearcoat,m.clearcoatRoughness.value=p.clearcoatRoughness,p.clearcoatMap&&(m.clearcoatMap.value=p.clearcoatMap,n(p.clearcoatMap,m.clearcoatMapTransform)),p.clearcoatRoughnessMap&&(m.clearcoatRoughnessMap.value=p.clearcoatRoughnessMap,n(p.clearcoatRoughnessMap,m.clearcoatRoughnessMapTransform)),p.clearcoatNormalMap&&(m.clearcoatNormalMap.value=p.clearcoatNormalMap,n(p.clearcoatNormalMap,m.clearcoatNormalMapTransform),m.clearcoatNormalScale.value.copy(p.clearcoatNormalScale),p.side===Ln&&m.clearcoatNormalScale.value.negate())),p.dispersion>0&&(m.dispersion.value=p.dispersion),p.iridescence>0&&(m.iridescence.value=p.iridescence,m.iridescenceIOR.value=p.iridescenceIOR,m.iridescenceThicknessMinimum.value=p.iridescenceThicknessRange[0],m.iridescenceThicknessMaximum.value=p.iridescenceThicknessRange[1],p.iridescenceMap&&(m.iridescenceMap.value=p.iridescenceMap,n(p.iridescenceMap,m.iridescenceMapTransform)),p.iridescenceThicknessMap&&(m.iridescenceThicknessMap.value=p.iridescenceThicknessMap,n(p.iridescenceThicknessMap,m.iridescenceThicknessMapTransform))),p.transmission>0&&(m.transmission.value=p.transmission,m.transmissionSamplerMap.value=_.texture,m.transmissionSamplerSize.value.set(_.width,_.height),p.transmissionMap&&(m.transmissionMap.value=p.transmissionMap,n(p.transmissionMap,m.transmissionMapTransform)),m.thickness.value=p.thickness,p.thicknessMap&&(m.thicknessMap.value=p.thicknessMap,n(p.thicknessMap,m.thicknessMapTransform)),m.attenuationDistance.value=p.attenuationDistance,m.attenuationColor.value.copy(p.attenuationColor)),p.anisotropy>0&&(m.anisotropyVector.value.set(p.anisotropy*Math.cos(p.anisotropyRotation),p.anisotropy*Math.sin(p.anisotropyRotation)),p.anisotropyMap&&(m.anisotropyMap.value=p.anisotropyMap,n(p.anisotropyMap,m.anisotropyMapTransform))),m.specularIntensity.value=p.specularIntensity,m.specularColor.value.copy(p.specularColor),p.specularColorMap&&(m.specularColorMap.value=p.specularColorMap,n(p.specularColorMap,m.specularColorMapTransform)),p.specularIntensityMap&&(m.specularIntensityMap.value=p.specularIntensityMap,n(p.specularIntensityMap,m.specularIntensityMapTransform))}function g(m,p){p.matcap&&(m.matcap.value=p.matcap)}function v(m,p){const _=e.get(p).light;m.referencePosition.value.setFromMatrixPosition(_.matrixWorld),m.nearDistance.value=_.shadow.camera.near,m.farDistance.value=_.shadow.camera.far}return{refreshFogUniforms:i,refreshMaterialUniforms:r}}function kN(t,e,n,i){let r={},s={},o=[];const a=t.getParameter(t.MAX_UNIFORM_BUFFER_BINDINGS);function l(_,y){const x=y.program;i.uniformBlockBinding(_,x)}function c(_,y){let x=r[_.id];x===void 0&&(g(_),x=u(_),r[_.id]=x,_.addEventListener("dispose",m));const M=y.program;i.updateUBOMapping(_,M);const A=e.render.frame;s[_.id]!==A&&(f(_),s[_.id]=A)}function u(_){const y=d();_.__bindingPointIndex=y;const x=t.createBuffer(),M=_.__size,A=_.usage;return t.bindBuffer(t.UNIFORM_BUFFER,x),t.bufferData(t.UNIFORM_BUFFER,M,A),t.bindBuffer(t.UNIFORM_BUFFER,null),t.bindBufferBase(t.UNIFORM_BUFFER,y,x),x}function d(){for(let _=0;_0&&(x+=M-A),_.__size=x,_.__cache={},this}function v(_){const y={boundary:0,storage:0};return typeof _=="number"||typeof _=="boolean"?(y.boundary=4,y.storage=4):_.isVector2?(y.boundary=8,y.storage=8):_.isVector3||_.isColor?(y.boundary=16,y.storage=12):_.isVector4?(y.boundary=16,y.storage=16):_.isMatrix3?(y.boundary=48,y.storage=48):_.isMatrix4?(y.boundary=64,y.storage=64):_.isTexture?it("WebGLRenderer: Texture samplers can not be part of an uniforms group."):it("WebGLRenderer: Unsupported uniform value type.",_),y}function m(_){const y=_.target;y.removeEventListener("dispose",m);const x=o.indexOf(y.__bindingPointIndex);o.splice(x,1),t.deleteBuffer(r[y.id]),delete r[y.id],delete s[y.id]}function p(){for(const _ in r)t.deleteBuffer(r[_]);o=[],r={},s={}}return{bind:l,update:c,dispose:p}}const BN=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 Hi=null;function zN(){return Hi===null&&(Hi=new VP(BN,16,16,sa,qr),Hi.name="DFG_LUT",Hi.minFilter=Dn,Hi.magFilter=Dn,Hi.wrapS=Ir,Hi.wrapT=Ir,Hi.generateMipmaps=!1,Hi.needsUpdate=!0),Hi}class VN{constructor(e={}){const{canvas:n=eP(),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:d=!1,reversedDepthBuffer:f=!1,outputBufferType:h=li}=e;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=h,m=new Set([im,nm,tm]),p=new Set([li,rr,cl,ul,Qp,em]),_=new Uint32Array(4),y=new Int32Array(4);let x=null,M=null;const A=[],P=[];let D=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=nr,this.toneMappingExposure=1,this.transmissionResolutionScale=1;const b=this;let w=!1;this._outputColorSpace=oi;let I=0,L=0,V=null,$=-1,X=null;const W=new Zt,B=new Zt;let z=null;const de=new nt(0);let le=0,pe=n.width,He=n.height,ze=1,st=null,xt=null;const ce=new Zt(0,0,pe,He),ue=new Zt(0,0,pe,He);let Le=!1;const je=new cm;let Ae=!1,mt=!1;const O=new yt,k=new N,U=new Zt,q={background:null,fog:null,environment:null,overrideMaterial:null,isScene:!0};let H=!1;function Y(){return V===null?ze:1}let C=i;function ae(R,j){return n.getContext(R,j)}try{const R={alpha:!0,depth:r,stencil:s,antialias:a,premultipliedAlpha:l,preserveDrawingBuffer:c,powerPreference:u,failIfMajorPerformanceCaveat:d};if("setAttribute"in n&&n.setAttribute("data-engine",`three.js r${Jp}`),n.addEventListener("webglcontextlost",lt,!1),n.addEventListener("webglcontextrestored",Vt,!1),n.addEventListener("webglcontextcreationerror",Pt,!1),C===null){const j="webgl2";if(C=ae(j,R),C===null)throw ae(j)?new Error("Error creating WebGL context with your selected attributes."):new Error("Error creating WebGL context.")}}catch(R){throw bt("WebGLRenderer: "+R.message),R}let Q,ee,oe,T,S,F,J,se,K,Ce,ve,Oe,$e,ge,Me,Pe,Be,Se,dt,G,Ue,ye,Ve,_e;function he(){Q=new zD(C),Q.init(),ye=new DN(C,Q),ee=new DD(C,Q,e,ye),oe=new PN(C,Q),ee.reversedDepthBuffer&&f&&oe.buffers.depth.setReversed(!0),T=new GD(C),S=new pN,F=new RN(C,Q,oe,S,ee,ye,T),J=new ND(b),se=new BD(b),K=new $2(C),Ve=new PD(C,K),Ce=new VD(C,K,T,Ve),ve=new qD(C,Ce,K,T),dt=new WD(C,ee,F),Pe=new ID(S),Oe=new hN(b,J,se,Q,ee,Ve,Pe),$e=new UN(b,S),ge=new gN,Me=new SN(Q),Se=new CD(b,J,se,oe,ve,g,l),Be=new AN(b,ve,ee),_e=new kN(C,T,ee,oe),G=new RD(C,Q,T),Ue=new HD(C,Q,T),T.programs=Oe.programs,b.capabilities=ee,b.extensions=Q,b.properties=S,b.renderLists=ge,b.shadowMap=Be,b.state=oe,b.info=T}he(),v!==li&&(D=new $D(v,n.width,n.height,r,s));const Ee=new ON(b,C);this.xr=Ee,this.getContext=function(){return C},this.getContextAttributes=function(){return C.getContextAttributes()},this.forceContextLoss=function(){const R=Q.get("WEBGL_lose_context");R&&R.loseContext()},this.forceContextRestore=function(){const R=Q.get("WEBGL_lose_context");R&&R.restoreContext()},this.getPixelRatio=function(){return ze},this.setPixelRatio=function(R){R!==void 0&&(ze=R,this.setSize(pe,He,!1))},this.getSize=function(R){return R.set(pe,He)},this.setSize=function(R,j,re=!0){if(Ee.isPresenting){it("WebGLRenderer: Can't change size while VR device is presenting.");return}pe=R,He=j,n.width=Math.floor(R*ze),n.height=Math.floor(j*ze),re===!0&&(n.style.width=R+"px",n.style.height=j+"px"),D!==null&&D.setSize(n.width,n.height),this.setViewport(0,0,R,j)},this.getDrawingBufferSize=function(R){return R.set(pe*ze,He*ze).floor()},this.setDrawingBufferSize=function(R,j,re){pe=R,He=j,ze=re,n.width=Math.floor(R*re),n.height=Math.floor(j*re),this.setViewport(0,0,R,j)},this.setEffects=function(R){if(v===li){console.error("THREE.WebGLRenderer: setEffects() requires outputBufferType set to HalfFloatType or FloatType.");return}if(R){for(let j=0;j{function Re(){if(ne.forEach(function(Ge){S.get(Ge).currentProgram.isReady()&&ne.delete(Ge)}),ne.size===0){Z(R);return}setTimeout(Re,10)}Q.get("KHR_parallel_shader_compile")!==null?Re():setTimeout(Re,10)})};let Ed=null;function dS(R){Ed&&Ed(R)}function Pm(){Ts.stop()}function Rm(){Ts.start()}const Ts=new Wb;Ts.setAnimationLoop(dS),typeof self<"u"&&Ts.setContext(self),this.setAnimationLoop=function(R){Ed=R,Ee.setAnimationLoop(R),R===null?Ts.stop():Ts.start()},Ee.addEventListener("sessionstart",Pm),Ee.addEventListener("sessionend",Rm),this.render=function(R,j){if(j!==void 0&&j.isCamera!==!0){bt("WebGLRenderer.render: camera is not an instance of THREE.Camera.");return}if(w===!0)return;const re=Ee.enabled===!0&&Ee.isPresenting===!0,ne=D!==null&&(V===null||re)&&D.begin(b,V);if(R.matrixWorldAutoUpdate===!0&&R.updateMatrixWorld(),j.parent===null&&j.matrixWorldAutoUpdate===!0&&j.updateMatrixWorld(),Ee.enabled===!0&&Ee.isPresenting===!0&&(D===null||D.isCompositing()===!1)&&(Ee.cameraAutoUpdate===!0&&Ee.updateCamera(j),j=Ee.getCamera()),R.isScene===!0&&R.onBeforeRender(b,R,j,V),M=Me.get(R,P.length),M.init(j),P.push(M),O.multiplyMatrices(j.projectionMatrix,j.matrixWorldInverse),je.setFromProjectionMatrix(O,Zi,j.reversedDepth),mt=this.localClippingEnabled,Ae=Pe.init(this.clippingPlanes,mt),x=ge.get(R,A.length),x.init(),A.push(x),Ee.enabled===!0&&Ee.isPresenting===!0){const Ge=b.xr.getDepthSensingMesh();Ge!==null&&Td(Ge,j,-1/0,b.sortObjects)}Td(R,j,0,b.sortObjects),x.finish(),b.sortObjects===!0&&x.sort(st,xt),H=Ee.enabled===!1||Ee.isPresenting===!1||Ee.hasDepthSensing()===!1,H&&Se.addToRenderList(x,R),this.info.render.frame++,Ae===!0&&Pe.beginShadows();const Z=M.state.shadowsArray;if(Be.render(Z,R,j),Ae===!0&&Pe.endShadows(),this.info.autoReset===!0&&this.info.reset(),(ne&&D.hasRenderPass())===!1){const Ge=x.opaque,Fe=x.transmissive;if(M.setupLights(),j.isArrayCamera){const Xe=j.cameras;if(Fe.length>0)for(let Ke=0,rt=Xe.length;Ke0&&Im(Ge,Fe,R,j),H&&Se.render(R),Dm(x,R,j)}V!==null&&L===0&&(F.updateMultisampleRenderTarget(V),F.updateRenderTargetMipmap(V)),ne&&D.end(b),R.isScene===!0&&R.onAfterRender(b,R,j),Ve.resetDefaultState(),$=-1,X=null,P.pop(),P.length>0?(M=P[P.length-1],Ae===!0&&Pe.setGlobalState(b.clippingPlanes,M.state.camera)):M=null,A.pop(),A.length>0?x=A[A.length-1]:x=null};function Td(R,j,re,ne){if(R.visible===!1)return;if(R.layers.test(j.layers)){if(R.isGroup)re=R.renderOrder;else if(R.isLOD)R.autoUpdate===!0&&R.update(j);else if(R.isLight)M.pushLight(R),R.castShadow&&M.pushShadow(R);else if(R.isSprite){if(!R.frustumCulled||je.intersectsSprite(R)){ne&&U.setFromMatrixPosition(R.matrixWorld).applyMatrix4(O);const Ge=ve.update(R),Fe=R.material;Fe.visible&&x.push(R,Ge,Fe,re,U.z,null)}}else if((R.isMesh||R.isLine||R.isPoints)&&(!R.frustumCulled||je.intersectsObject(R))){const Ge=ve.update(R),Fe=R.material;if(ne&&(R.boundingSphere!==void 0?(R.boundingSphere===null&&R.computeBoundingSphere(),U.copy(R.boundingSphere.center)):(Ge.boundingSphere===null&&Ge.computeBoundingSphere(),U.copy(Ge.boundingSphere.center)),U.applyMatrix4(R.matrixWorld).applyMatrix4(O)),Array.isArray(Fe)){const Xe=Ge.groups;for(let Ke=0,rt=Xe.length;Ke0&&Dl(Z,j,re),Re.length>0&&Dl(Re,j,re),Ge.length>0&&Dl(Ge,j,re),oe.buffers.depth.setTest(!0),oe.buffers.depth.setMask(!0),oe.buffers.color.setMask(!0),oe.setPolygonOffset(!1)}function Im(R,j,re,ne){if((re.isScene===!0?re.overrideMaterial:null)!==null)return;if(M.state.transmissionRenderTarget[ne.id]===void 0){const vt=Q.has("EXT_color_buffer_half_float")||Q.has("EXT_color_buffer_float");M.state.transmissionRenderTarget[ne.id]=new ir(1,1,{generateMipmaps:!0,type:vt?qr:li,minFilter:Js,samples:ee.samples,stencilBuffer:s,resolveDepthBuffer:!1,resolveStencilBuffer:!1,colorSpace:wt.workingColorSpace})}const Re=M.state.transmissionRenderTarget[ne.id],Ge=ne.viewport||W;Re.setSize(Ge.z*b.transmissionResolutionScale,Ge.w*b.transmissionResolutionScale);const Fe=b.getRenderTarget(),Xe=b.getActiveCubeFace(),Ke=b.getActiveMipmapLevel();b.setRenderTarget(Re),b.getClearColor(de),le=b.getClearAlpha(),le<1&&b.setClearColor(16777215,.5),b.clear(),H&&Se.render(re);const rt=b.toneMapping;b.toneMapping=nr;const et=ne.viewport;if(ne.viewport!==void 0&&(ne.viewport=void 0),M.setupLightsView(ne),Ae===!0&&Pe.setGlobalState(b.clippingPlanes,ne),Dl(R,re,ne),F.updateMultisampleRenderTarget(Re),F.updateRenderTargetMipmap(Re),Q.has("WEBGL_multisampled_render_to_texture")===!1){let vt=!1;for(let Nt=0,jt=j.length;Nt0),et=!!re.morphAttributes.position,vt=!!re.morphAttributes.normal,Nt=!!re.morphAttributes.color;let jt=nr;ne.toneMapped&&(V===null||V.isXRRenderTarget===!0)&&(jt=b.toneMapping);const Yt=re.morphAttributes.position||re.morphAttributes.normal||re.morphAttributes.color,Ut=Yt!==void 0?Yt.length:0,tt=S.get(ne),Rt=M.state.lights;if(Ae===!0&&(mt===!0||R!==X)){const Fn=R===X&&ne.id===$;Pe.setState(ne,R,Fn)}let Mt=!1;ne.version===tt.__version?(tt.needsLights&&tt.lightsStateVersion!==Rt.state.version||tt.outputColorSpace!==Fe||Z.isBatchedMesh&&tt.batching===!1||!Z.isBatchedMesh&&tt.batching===!0||Z.isBatchedMesh&&tt.batchingColor===!0&&Z.colorTexture===null||Z.isBatchedMesh&&tt.batchingColor===!1&&Z.colorTexture!==null||Z.isInstancedMesh&&tt.instancing===!1||!Z.isInstancedMesh&&tt.instancing===!0||Z.isSkinnedMesh&&tt.skinning===!1||!Z.isSkinnedMesh&&tt.skinning===!0||Z.isInstancedMesh&&tt.instancingColor===!0&&Z.instanceColor===null||Z.isInstancedMesh&&tt.instancingColor===!1&&Z.instanceColor!==null||Z.isInstancedMesh&&tt.instancingMorph===!0&&Z.morphTexture===null||Z.isInstancedMesh&&tt.instancingMorph===!1&&Z.morphTexture!==null||tt.envMap!==Xe||ne.fog===!0&&tt.fog!==Re||tt.numClippingPlanes!==void 0&&(tt.numClippingPlanes!==Pe.numPlanes||tt.numIntersection!==Pe.numIntersection)||tt.vertexAlphas!==Ke||tt.vertexTangents!==rt||tt.morphTargets!==et||tt.morphNormals!==vt||tt.morphColors!==Nt||tt.toneMapping!==jt||tt.morphTargetsCount!==Ut)&&(Mt=!0):(Mt=!0,tt.__version=ne.version);let ni=tt.currentProgram;Mt===!0&&(ni=Il(ne,j,Z));let go=!1,ii=!1,_a=!1;const Ht=ni.getUniforms(),Xn=tt.uniforms;if(oe.useProgram(ni.program)&&(go=!0,ii=!0,_a=!0),ne.id!==$&&($=ne.id,ii=!0),go||X!==R){oe.buffers.depth.getReversed()&&R.reversedDepth!==!0&&(R._reversedDepth=!0,R.updateProjectionMatrix()),Ht.setValue(C,"projectionMatrix",R.projectionMatrix),Ht.setValue(C,"viewMatrix",R.matrixWorldInverse);const $n=Ht.map.cameraPosition;$n!==void 0&&$n.setValue(C,k.setFromMatrixPosition(R.matrixWorld)),ee.logarithmicDepthBuffer&&Ht.setValue(C,"logDepthBufFC",2/(Math.log(R.far+1)/Math.LN2)),(ne.isMeshPhongMaterial||ne.isMeshToonMaterial||ne.isMeshLambertMaterial||ne.isMeshBasicMaterial||ne.isMeshStandardMaterial||ne.isShaderMaterial)&&Ht.setValue(C,"isOrthographic",R.isOrthographicCamera===!0),X!==R&&(X=R,ii=!0,_a=!0)}if(tt.needsLights&&(Rt.state.directionalShadowMap.length>0&&Ht.setValue(C,"directionalShadowMap",Rt.state.directionalShadowMap,F),Rt.state.spotShadowMap.length>0&&Ht.setValue(C,"spotShadowMap",Rt.state.spotShadowMap,F),Rt.state.pointShadowMap.length>0&&Ht.setValue(C,"pointShadowMap",Rt.state.pointShadowMap,F)),Z.isSkinnedMesh){Ht.setOptional(C,Z,"bindMatrix"),Ht.setOptional(C,Z,"bindMatrixInverse");const Fn=Z.skeleton;Fn&&(Fn.boneTexture===null&&Fn.computeBoneTexture(),Ht.setValue(C,"boneTexture",Fn.boneTexture,F))}Z.isBatchedMesh&&(Ht.setOptional(C,Z,"batchingTexture"),Ht.setValue(C,"batchingTexture",Z._matricesTexture,F),Ht.setOptional(C,Z,"batchingIdTexture"),Ht.setValue(C,"batchingIdTexture",Z._indirectTexture,F),Ht.setOptional(C,Z,"batchingColorTexture"),Z._colorsTexture!==null&&Ht.setValue(C,"batchingColorTexture",Z._colorsTexture,F));const pi=re.morphAttributes;if((pi.position!==void 0||pi.normal!==void 0||pi.color!==void 0)&&dt.update(Z,re,ni),(ii||tt.receiveShadow!==Z.receiveShadow)&&(tt.receiveShadow=Z.receiveShadow,Ht.setValue(C,"receiveShadow",Z.receiveShadow)),ne.isMeshGouraudMaterial&&ne.envMap!==null&&(Xn.envMap.value=Xe,Xn.flipEnvMap.value=Xe.isCubeTexture&&Xe.isRenderTargetTexture===!1?-1:1),ne.isMeshStandardMaterial&&ne.envMap===null&&j.environment!==null&&(Xn.envMapIntensity.value=j.environmentIntensity),Xn.dfgLUT!==void 0&&(Xn.dfgLUT.value=zN()),ii&&(Ht.setValue(C,"toneMappingExposure",b.toneMappingExposure),tt.needsLights&&hS(Xn,_a),Re&&ne.fog===!0&&$e.refreshFogUniforms(Xn,Re),$e.refreshMaterialUniforms(Xn,ne,ze,He,M.state.transmissionRenderTarget[R.id]),Vc.upload(C,Lm(tt),Xn,F)),ne.isShaderMaterial&&ne.uniformsNeedUpdate===!0&&(Vc.upload(C,Lm(tt),Xn,F),ne.uniformsNeedUpdate=!1),ne.isSpriteMaterial&&Ht.setValue(C,"center",Z.center),Ht.setValue(C,"modelViewMatrix",Z.modelViewMatrix),Ht.setValue(C,"normalMatrix",Z.normalMatrix),Ht.setValue(C,"modelMatrix",Z.matrixWorld),ne.isShaderMaterial||ne.isRawShaderMaterial){const Fn=ne.uniformsGroups;for(let $n=0,Ad=Fn.length;$n0&&F.useMultisampledRTT(R)===!1?ne=S.get(R).__webglMultisampledFramebuffer:Array.isArray(Ke)?ne=Ke[re]:ne=Ke,W.copy(R.viewport),B.copy(R.scissor),z=R.scissorTest}else W.copy(ce).multiplyScalar(ze).floor(),B.copy(ue).multiplyScalar(ze).floor(),z=Le;if(re!==0&&(ne=mS),oe.bindFramebuffer(C.FRAMEBUFFER,ne)&&oe.drawBuffers(R,ne),oe.viewport(W),oe.scissor(B),oe.setScissorTest(z),Z){const Fe=S.get(R.texture);C.framebufferTexture2D(C.FRAMEBUFFER,C.COLOR_ATTACHMENT0,C.TEXTURE_CUBE_MAP_POSITIVE_X+j,Fe.__webglTexture,re)}else if(Re){const Fe=j;for(let Xe=0;Xe=0&&j<=R.width-ne&&re>=0&&re<=R.height-Z&&(R.textures.length>1&&C.readBuffer(C.COLOR_ATTACHMENT0+Fe),C.readPixels(j,re,ne,Z,ye.convert(rt),ye.convert(et),Re))}finally{const Ke=V!==null?S.get(V).__webglFramebuffer:null;oe.bindFramebuffer(C.FRAMEBUFFER,Ke)}}},this.readRenderTargetPixelsAsync=async function(R,j,re,ne,Z,Re,Ge,Fe=0){if(!(R&&R.isWebGLRenderTarget))throw new Error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not THREE.WebGLRenderTarget.");let Xe=S.get(R).__webglFramebuffer;if(R.isWebGLCubeRenderTarget&&Ge!==void 0&&(Xe=Xe[Ge]),Xe)if(j>=0&&j<=R.width-ne&&re>=0&&re<=R.height-Z){oe.bindFramebuffer(C.FRAMEBUFFER,Xe);const Ke=R.textures[Fe],rt=Ke.format,et=Ke.type;if(!ee.textureFormatReadable(rt))throw new Error("THREE.WebGLRenderer.readRenderTargetPixelsAsync: renderTarget is not in RGBA or implementation defined format.");if(!ee.textureTypeReadable(et))throw new Error("THREE.WebGLRenderer.readRenderTargetPixelsAsync: renderTarget is not in UnsignedByteType or implementation defined type.");const vt=C.createBuffer();C.bindBuffer(C.PIXEL_PACK_BUFFER,vt),C.bufferData(C.PIXEL_PACK_BUFFER,Re.byteLength,C.STREAM_READ),R.textures.length>1&&C.readBuffer(C.COLOR_ATTACHMENT0+Fe),C.readPixels(j,re,ne,Z,ye.convert(rt),ye.convert(et),0);const Nt=V!==null?S.get(V).__webglFramebuffer:null;oe.bindFramebuffer(C.FRAMEBUFFER,Nt);const jt=C.fenceSync(C.SYNC_GPU_COMMANDS_COMPLETE,0);return C.flush(),await tP(C,jt,4),C.bindBuffer(C.PIXEL_PACK_BUFFER,vt),C.getBufferSubData(C.PIXEL_PACK_BUFFER,0,Re),C.deleteBuffer(vt),C.deleteSync(jt),Re}else throw new Error("THREE.WebGLRenderer.readRenderTargetPixelsAsync: requested read bounds are out of range.")},this.copyFramebufferToTexture=function(R,j=null,re=0){const ne=Math.pow(2,-re),Z=Math.floor(R.image.width*ne),Re=Math.floor(R.image.height*ne),Ge=j!==null?j.x:0,Fe=j!==null?j.y:0;F.setTexture2D(R,0),C.copyTexSubImage2D(C.TEXTURE_2D,re,0,0,Ge,Fe,Z,Re),oe.unbindTexture()};const gS=C.createFramebuffer(),vS=C.createFramebuffer();this.copyTextureToTexture=function(R,j,re=null,ne=null,Z=0,Re=null){Re===null&&(Z!==0?(dl("WebGLRenderer: copyTextureToTexture function signature has changed to support src and dst mipmap levels."),Re=Z,Z=0):Re=0);let Ge,Fe,Xe,Ke,rt,et,vt,Nt,jt;const Yt=R.isCompressedTexture?R.mipmaps[Re]:R.image;if(re!==null)Ge=re.max.x-re.min.x,Fe=re.max.y-re.min.y,Xe=re.isBox3?re.max.z-re.min.z:1,Ke=re.min.x,rt=re.min.y,et=re.isBox3?re.min.z:0;else{const pi=Math.pow(2,-Z);Ge=Math.floor(Yt.width*pi),Fe=Math.floor(Yt.height*pi),R.isDataArrayTexture?Xe=Yt.depth:R.isData3DTexture?Xe=Math.floor(Yt.depth*pi):Xe=1,Ke=0,rt=0,et=0}ne!==null?(vt=ne.x,Nt=ne.y,jt=ne.z):(vt=0,Nt=0,jt=0);const Ut=ye.convert(j.format),tt=ye.convert(j.type);let Rt;j.isData3DTexture?(F.setTexture3D(j,0),Rt=C.TEXTURE_3D):j.isDataArrayTexture||j.isCompressedArrayTexture?(F.setTexture2DArray(j,0),Rt=C.TEXTURE_2D_ARRAY):(F.setTexture2D(j,0),Rt=C.TEXTURE_2D),C.pixelStorei(C.UNPACK_FLIP_Y_WEBGL,j.flipY),C.pixelStorei(C.UNPACK_PREMULTIPLY_ALPHA_WEBGL,j.premultiplyAlpha),C.pixelStorei(C.UNPACK_ALIGNMENT,j.unpackAlignment);const Mt=C.getParameter(C.UNPACK_ROW_LENGTH),ni=C.getParameter(C.UNPACK_IMAGE_HEIGHT),go=C.getParameter(C.UNPACK_SKIP_PIXELS),ii=C.getParameter(C.UNPACK_SKIP_ROWS),_a=C.getParameter(C.UNPACK_SKIP_IMAGES);C.pixelStorei(C.UNPACK_ROW_LENGTH,Yt.width),C.pixelStorei(C.UNPACK_IMAGE_HEIGHT,Yt.height),C.pixelStorei(C.UNPACK_SKIP_PIXELS,Ke),C.pixelStorei(C.UNPACK_SKIP_ROWS,rt),C.pixelStorei(C.UNPACK_SKIP_IMAGES,et);const Ht=R.isDataArrayTexture||R.isData3DTexture,Xn=j.isDataArrayTexture||j.isData3DTexture;if(R.isDepthTexture){const pi=S.get(R),Fn=S.get(j),$n=S.get(pi.__renderTarget),Ad=S.get(Fn.__renderTarget);oe.bindFramebuffer(C.READ_FRAMEBUFFER,$n.__webglFramebuffer),oe.bindFramebuffer(C.DRAW_FRAMEBUFFER,Ad.__webglFramebuffer);for(let As=0;As>>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(t){return{typeUrl:Uf(t.typeUrl)?globalThis.String(t.typeUrl):Uf(t.type_url)?globalThis.String(t.type_url):"",value:Uf(t.value)?HN(t.value):new Uint8Array}},toJSON(t){let e={};return t.typeUrl!==""&&(e.typeUrl=t.typeUrl),t.value.length!==0&&(e.value=GN(t.value)),e},create(t){return ko.fromPartial(t??{})},fromPartial(t){let e=Ev();return e.typeUrl=t.typeUrl??"",e.value=t.value??new Uint8Array,e}};function HN(t){if(globalThis.Buffer)return Uint8Array.from(globalThis.Buffer.from(t,"base64"));{let e=globalThis.atob(t),n=new Uint8Array(e.length);for(let i=0;i{e.push(globalThis.String.fromCharCode(n))}),globalThis.btoa(e.join(""))}}function Uf(t){return t!=null}let gl=(function(t){return t[t.NULL_VALUE=0]="NULL_VALUE",t[t.UNRECOGNIZED=-1]="UNRECOGNIZED",t})({});function Tv(t){switch(t){case 0:case"NULL_VALUE":return gl.NULL_VALUE;default:return gl.UNRECOGNIZED}}function WN(t){switch(t){case gl.NULL_VALUE:return"NULL_VALUE";case gl.UNRECOGNIZED:default:return"UNRECOGNIZED"}}function kf(){return{fields:{}}}const Ba={encode(t,e=new ut){return globalThis.Object.entries(t.fields).forEach(([n,i])=>{i!==void 0&&pp.encode({key:n,value:i},e.uint32(10).fork()).join()}),e},decode(t,e){let n=t instanceof be?t:new be(t),i=e===void 0?n.len:n.pos+e,r=kf();for(;n.pos>>3){case 1:{if(s!==10)break;let o=pp.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(t){return{fields:mp(t.fields)?globalThis.Object.entries(t.fields).reduce((e,[n,i])=>(e[n]=i,e),{}):{}}},toJSON(t){let e={};if(t.fields){let n=globalThis.Object.entries(t.fields);n.length>0&&(e.fields={},n.forEach(([i,r])=>{e.fields[i]=r}))}return e},create(t){return Ba.fromPartial(t??{})},fromPartial(t){let e=kf();return e.fields=globalThis.Object.entries(t.fields??{}).reduce((n,[i,r])=>(r!==void 0&&(n[i]=r),n),{}),e},wrap(t){let e=kf();if(t!==void 0)for(let n of globalThis.Object.keys(t))e.fields[n]=t[n];return e},unwrap(t){let e={};if(t.fields)for(let n of globalThis.Object.keys(t.fields))e[n]=t.fields[n];return e}};function Av(){return{key:"",value:void 0}}const pp={encode(t,e=new ut){return t.key!==""&&e.uint32(10).string(t.key),t.value!==void 0&&ui.encode(ui.wrap(t.value),e.uint32(18).fork()).join(),e},decode(t,e){let n=t instanceof be?t:new be(t),i=e===void 0?n.len:n.pos+e,r=Av();for(;n.pos>>3){case 1:if(s!==10)break;r.key=n.string();continue;case 2:if(s!==18)break;r.value=ui.unwrap(ui.decode(n,n.uint32()));continue}if((s&7)==4||s===0)break;n.skip(s&7)}return r},fromJSON(t){return{key:qi(t.key)?globalThis.String(t.key):"",value:qi(t?.value)?t.value:void 0}},toJSON(t){let e={};return t.key!==""&&(e.key=t.key),t.value!==void 0&&(e.value=t.value),e},create(t){return pp.fromPartial(t??{})},fromPartial(t){let e=Av();return e.key=t.key??"",e.value=t.value??void 0,e}};function Bf(){return{nullValue:void 0,numberValue:void 0,stringValue:void 0,boolValue:void 0,structValue:void 0,listValue:void 0}}const ui={encode(t,e=new ut){return t.nullValue!==void 0&&e.uint32(8).int32(t.nullValue),t.numberValue!==void 0&&e.uint32(17).double(t.numberValue),t.stringValue!==void 0&&e.uint32(26).string(t.stringValue),t.boolValue!==void 0&&e.uint32(32).bool(t.boolValue),t.structValue!==void 0&&Ba.encode(Ba.wrap(t.structValue),e.uint32(42).fork()).join(),t.listValue!==void 0&&za.encode(za.wrap(t.listValue),e.uint32(50).fork()).join(),e},decode(t,e){let n=t instanceof be?t:new be(t),i=e===void 0?n.len:n.pos+e,r=Bf();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=Ba.unwrap(Ba.decode(n,n.uint32()));continue;case 6:if(s!==50)break;r.listValue=za.unwrap(za.decode(n,n.uint32()));continue}if((s&7)==4||s===0)break;n.skip(s&7)}return r},fromJSON(t){return{nullValue:qi(t.nullValue)?Tv(t.nullValue):qi(t.null_value)?Tv(t.null_value):void 0,numberValue:qi(t.numberValue)?globalThis.Number(t.numberValue):qi(t.number_value)?globalThis.Number(t.number_value):void 0,stringValue:qi(t.stringValue)?globalThis.String(t.stringValue):qi(t.string_value)?globalThis.String(t.string_value):void 0,boolValue:qi(t.boolValue)?globalThis.Boolean(t.boolValue):qi(t.bool_value)?globalThis.Boolean(t.bool_value):void 0,structValue:mp(t.structValue)?t.structValue:mp(t.struct_value)?t.struct_value:void 0,listValue:globalThis.Array.isArray(t.listValue)?[...t.listValue]:globalThis.Array.isArray(t.list_value)?[...t.list_value]:void 0}},toJSON(t){let e={};return t.nullValue!==void 0&&(e.nullValue=WN(t.nullValue)),t.numberValue!==void 0&&(e.numberValue=t.numberValue),t.stringValue!==void 0&&(e.stringValue=t.stringValue),t.boolValue!==void 0&&(e.boolValue=t.boolValue),t.structValue!==void 0&&(e.structValue=t.structValue),t.listValue!==void 0&&(e.listValue=t.listValue),e},create(t){return ui.fromPartial(t??{})},fromPartial(t){let e=Bf();return e.nullValue=t.nullValue??void 0,e.numberValue=t.numberValue??void 0,e.stringValue=t.stringValue??void 0,e.boolValue=t.boolValue??void 0,e.structValue=t.structValue??void 0,e.listValue=t.listValue??void 0,e},wrap(t){let e=Bf();if(t===null)e.nullValue=gl.NULL_VALUE;else if(typeof t=="boolean")e.boolValue=t;else if(typeof t=="number")e.numberValue=t;else if(typeof t=="string")e.stringValue=t;else if(globalThis.Array.isArray(t))e.listValue=t;else if(typeof t=="object")e.structValue=t;else if(t!==void 0)throw new globalThis.Error("Unsupported any value type: "+typeof t);return e},unwrap(t){if(t.stringValue!==void 0)return t.stringValue;if(t?.numberValue!==void 0)return t.numberValue;if(t?.boolValue!==void 0)return t.boolValue;if(t?.structValue!==void 0)return t.structValue;if(t?.listValue!==void 0)return t.listValue;if(t?.nullValue!==void 0)return null}};function zf(){return{values:[]}}const za={encode(t,e=new ut){for(let n of t.values)ui.encode(ui.wrap(n),e.uint32(10).fork()).join();return e},decode(t,e){let n=t instanceof be?t:new be(t),i=e===void 0?n.len:n.pos+e,r=zf();for(;n.pos>>3){case 1:if(s!==10)break;r.values.push(ui.unwrap(ui.decode(n,n.uint32())));continue}if((s&7)==4||s===0)break;n.skip(s&7)}return r},fromJSON(t){return{values:globalThis.Array.isArray(t?.values)?[...t.values]:[]}},toJSON(t){let e={};return t.values?.length&&(e.values=t.values),e},create(t){return za.fromPartial(t??{})},fromPartial(t){let e=zf();return e.values=t.values?.map(n=>n)||[],e},wrap(t){let e=zf();return e.values=t??[],e},unwrap(t){return t?.hasOwnProperty("values")&&globalThis.Array.isArray(t.values)?t.values:t}};function mp(t){return typeof t=="object"&&!!t}function qi(t){return t!=null}jp({AnyData:()=>an,DictData:()=>Cr,DictData_ItemsEntry:()=>du,FallbackData:()=>Ys,ListData:()=>Yb,MessageData:()=>Sm,protobufPackage:()=>qN});const qN="compas_pb.data";function Cv(){return{message:void 0,value:void 0,fallback:void 0}}const an={encode(t,e=new ut){return t.message!==void 0&&ko.encode(t.message,e.uint32(10).fork()).join(),t.value!==void 0&&ui.encode(ui.wrap(t.value),e.uint32(18).fork()).join(),t.fallback!==void 0&&Ys.encode(t.fallback,e.uint32(26).fork()).join(),e},decode(t,e){let n=t instanceof be?t:new be(t),i=e===void 0?n.len:n.pos+e,r=Cv();for(;n.pos>>3){case 1:if(s!==10)break;r.message=ko.decode(n,n.uint32());continue;case 2:if(s!==18)break;r.value=ui.unwrap(ui.decode(n,n.uint32()));continue;case 3:if(s!==26)break;r.fallback=Ys.decode(n,n.uint32());continue}if((s&7)==4||s===0)break;n.skip(s&7)}return r},fromJSON(t){return{message:vs(t.message)?ko.fromJSON(t.message):void 0,value:vs(t?.value)?t.value:void 0,fallback:vs(t.fallback)?Ys.fromJSON(t.fallback):void 0}},toJSON(t){let e={};return t.message!==void 0&&(e.message=ko.toJSON(t.message)),t.value!==void 0&&(e.value=t.value),t.fallback!==void 0&&(e.fallback=Ys.toJSON(t.fallback)),e},create(t){return an.fromPartial(t??{})},fromPartial(t){let e=Cv();return e.message=t.message!==void 0&&t.message!==null?ko.fromPartial(t.message):void 0,e.value=t.value??void 0,e.fallback=t.fallback!==void 0&&t.fallback!==null?Ys.fromPartial(t.fallback):void 0,e}};function Pv(){return{data:void 0}}const Ys={encode(t,e=new ut){return t.data!==void 0&&Cr.encode(t.data,e.uint32(10).fork()).join(),e},decode(t,e){let n=t instanceof be?t:new be(t),i=e===void 0?n.len:n.pos+e,r=Pv();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(t){return{data:vs(t.data)?Cr.fromJSON(t.data):void 0}},toJSON(t){let e={};return t.data!==void 0&&(e.data=Cr.toJSON(t.data)),e},create(t){return Ys.fromPartial(t??{})},fromPartial(t){let e=Pv();return e.data=t.data!==void 0&&t.data!==null?Cr.fromPartial(t.data):void 0,e}};function Rv(){return{items:[]}}const Yb={encode(t,e=new ut){for(let n of t.items)an.encode(n,e.uint32(10).fork()).join();return e},decode(t,e){let n=t instanceof be?t:new be(t),i=e===void 0?n.len:n.pos+e,r=Rv();for(;n.pos>>3){case 1:if(s!==10)break;r.items.push(an.decode(n,n.uint32()));continue}if((s&7)==4||s===0)break;n.skip(s&7)}return r},fromJSON(t){return{items:globalThis.Array.isArray(t?.items)?t.items.map(e=>an.fromJSON(e)):[]}},toJSON(t){let e={};return t.items?.length&&(e.items=t.items.map(n=>an.toJSON(n))),e},create(t){return Yb.fromPartial(t??{})},fromPartial(t){let e=Rv();return e.items=t.items?.map(n=>an.fromPartial(n))||[],e}};function Dv(){return{items:{}}}const Cr={encode(t,e=new ut){return globalThis.Object.entries(t.items).forEach(([n,i])=>{du.encode({key:n,value:i},e.uint32(10).fork()).join()}),e},decode(t,e){let n=t instanceof be?t:new be(t),i=e===void 0?n.len:n.pos+e,r=Dv();for(;n.pos>>3){case 1:{if(s!==10)break;let o=du.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(t){return{items:XN(t.items)?globalThis.Object.entries(t.items).reduce((e,[n,i])=>(e[n]=an.fromJSON(i),e),{}):{}}},toJSON(t){let e={};if(t.items){let n=globalThis.Object.entries(t.items);n.length>0&&(e.items={},n.forEach(([i,r])=>{e.items[i]=an.toJSON(r)}))}return e},create(t){return Cr.fromPartial(t??{})},fromPartial(t){let e=Dv();return e.items=globalThis.Object.entries(t.items??{}).reduce((n,[i,r])=>(r!==void 0&&(n[i]=an.fromPartial(r)),n),{}),e}};function Iv(){return{key:"",value:void 0}}const du={encode(t,e=new ut){return t.key!==""&&e.uint32(10).string(t.key),t.value!==void 0&&an.encode(t.value,e.uint32(18).fork()).join(),e},decode(t,e){let n=t instanceof be?t:new be(t),i=e===void 0?n.len:n.pos+e,r=Iv();for(;n.pos>>3){case 1:if(s!==10)break;r.key=n.string();continue;case 2:if(s!==18)break;r.value=an.decode(n,n.uint32());continue}if((s&7)==4||s===0)break;n.skip(s&7)}return r},fromJSON(t){return{key:vs(t.key)?globalThis.String(t.key):"",value:vs(t.value)?an.fromJSON(t.value):void 0}},toJSON(t){let e={};return t.key!==""&&(e.key=t.key),t.value!==void 0&&(e.value=an.toJSON(t.value)),e},create(t){return du.fromPartial(t??{})},fromPartial(t){let e=Iv();return e.key=t.key??"",e.value=t.value!==void 0&&t.value!==null?an.fromPartial(t.value):void 0,e}};function Nv(){return{data:void 0,version:void 0}}const Sm={encode(t,e=new ut){return t.data!==void 0&&an.encode(t.data,e.uint32(10).fork()).join(),t.version!==void 0&&e.uint32(18).string(t.version),e},decode(t,e){let n=t instanceof be?t:new be(t),i=e===void 0?n.len:n.pos+e,r=Nv();for(;n.pos>>3){case 1:if(s!==10)break;r.data=an.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(t){return{data:vs(t.data)?an.fromJSON(t.data):void 0,version:vs(t.version)?globalThis.String(t.version):void 0}},toJSON(t){let e={};return t.data!==void 0&&(e.data=an.toJSON(t.data)),t.version!==void 0&&(e.version=t.version),e},create(t){return Sm.fromPartial(t??{})},fromPartial(t){let e=Nv();return e.data=t.data!==void 0&&t.data!==null?an.fromPartial(t.data):void 0,e.version=t.version??void 0,e}};function XN(t){return typeof t=="object"&&!!t}function vs(t){return t!=null}jp({ArcData:()=>Zu,BezierData:()=>nd,BoxData:()=>sd,CapsuleData:()=>cd,CircleData:()=>Pr,ConeData:()=>ld,CylinderData:()=>ad,EllipseData:()=>Qu,FrameData:()=>Ze,HyperbolaData:()=>td,LineData:()=>Ku,ParabolaData:()=>ed,PlaneData:()=>Yu,PointData:()=>Je,PointcloudData:()=>dd,PolygonData:()=>rd,PolylineData:()=>id,ProjectionData:()=>_d,QuaternionData:()=>Ju,ReflectionData:()=>gd,RotationData:()=>pd,ScaleData:()=>md,ShearData:()=>vd,SphereData:()=>od,TorusData:()=>ud,TransformationData:()=>fd,TranslationData:()=>hd,VectorData:()=>At,protobufPackage:()=>$N});const $N="compas_pb.data";function Lv(){return{guid:"",name:"",x:0,y:0,z:0}}const Je={encode(t,e=new ut){return t.guid!==""&&e.uint32(10).string(t.guid),t.name!==""&&e.uint32(18).string(t.name),t.x!==0&&e.uint32(29).float(t.x),t.y!==0&&e.uint32(37).float(t.y),t.z!==0&&e.uint32(45).float(t.z),e},decode(t,e){let n=t instanceof be?t:new be(t),i=e===void 0?n.len:n.pos+e,r=Lv();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(t){return{guid:fe(t.guid)?globalThis.String(t.guid):"",name:fe(t.name)?globalThis.String(t.name):"",x:fe(t.x)?globalThis.Number(t.x):0,y:fe(t.y)?globalThis.Number(t.y):0,z:fe(t.z)?globalThis.Number(t.z):0}},toJSON(t){let e={};return t.guid!==""&&(e.guid=t.guid),t.name!==""&&(e.name=t.name),t.x!==0&&(e.x=t.x),t.y!==0&&(e.y=t.y),t.z!==0&&(e.z=t.z),e},create(t){return Je.fromPartial(t??{})},fromPartial(t){let e=Lv();return e.guid=t.guid??"",e.name=t.name??"",e.x=t.x??0,e.y=t.y??0,e.z=t.z??0,e}};function Ov(){return{guid:"",name:"",x:0,y:0,z:0}}const At={encode(t,e=new ut){return t.guid!==""&&e.uint32(10).string(t.guid),t.name!==""&&e.uint32(18).string(t.name),t.x!==0&&e.uint32(29).float(t.x),t.y!==0&&e.uint32(37).float(t.y),t.z!==0&&e.uint32(45).float(t.z),e},decode(t,e){let n=t instanceof be?t:new be(t),i=e===void 0?n.len:n.pos+e,r=Ov();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(t){return{guid:fe(t.guid)?globalThis.String(t.guid):"",name:fe(t.name)?globalThis.String(t.name):"",x:fe(t.x)?globalThis.Number(t.x):0,y:fe(t.y)?globalThis.Number(t.y):0,z:fe(t.z)?globalThis.Number(t.z):0}},toJSON(t){let e={};return t.guid!==""&&(e.guid=t.guid),t.name!==""&&(e.name=t.name),t.x!==0&&(e.x=t.x),t.y!==0&&(e.y=t.y),t.z!==0&&(e.z=t.z),e},create(t){return At.fromPartial(t??{})},fromPartial(t){let e=Ov();return e.guid=t.guid??"",e.name=t.name??"",e.x=t.x??0,e.y=t.y??0,e.z=t.z??0,e}};function Fv(){return{guid:"",name:"",point:void 0,xaxis:void 0,yaxis:void 0}}const Ze={encode(t,e=new ut){return t.guid!==""&&e.uint32(10).string(t.guid),t.name!==""&&e.uint32(18).string(t.name),t.point!==void 0&&Je.encode(t.point,e.uint32(26).fork()).join(),t.xaxis!==void 0&&At.encode(t.xaxis,e.uint32(34).fork()).join(),t.yaxis!==void 0&&At.encode(t.yaxis,e.uint32(42).fork()).join(),e},decode(t,e){let n=t instanceof be?t:new be(t),i=e===void 0?n.len:n.pos+e,r=Fv();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=Je.decode(n,n.uint32());continue;case 4:if(s!==34)break;r.xaxis=At.decode(n,n.uint32());continue;case 5:if(s!==42)break;r.yaxis=At.decode(n,n.uint32());continue}if((s&7)==4||s===0)break;n.skip(s&7)}return r},fromJSON(t){return{guid:fe(t.guid)?globalThis.String(t.guid):"",name:fe(t.name)?globalThis.String(t.name):"",point:fe(t.point)?Je.fromJSON(t.point):void 0,xaxis:fe(t.xaxis)?At.fromJSON(t.xaxis):void 0,yaxis:fe(t.yaxis)?At.fromJSON(t.yaxis):void 0}},toJSON(t){let e={};return t.guid!==""&&(e.guid=t.guid),t.name!==""&&(e.name=t.name),t.point!==void 0&&(e.point=Je.toJSON(t.point)),t.xaxis!==void 0&&(e.xaxis=At.toJSON(t.xaxis)),t.yaxis!==void 0&&(e.yaxis=At.toJSON(t.yaxis)),e},create(t){return Ze.fromPartial(t??{})},fromPartial(t){let e=Fv();return e.guid=t.guid??"",e.name=t.name??"",e.point=t.point!==void 0&&t.point!==null?Je.fromPartial(t.point):void 0,e.xaxis=t.xaxis!==void 0&&t.xaxis!==null?At.fromPartial(t.xaxis):void 0,e.yaxis=t.yaxis!==void 0&&t.yaxis!==null?At.fromPartial(t.yaxis):void 0,e}};function Uv(){return{guid:"",name:"",point:void 0,normal:void 0}}const Yu={encode(t,e=new ut){return t.guid!==""&&e.uint32(10).string(t.guid),t.name!==""&&e.uint32(18).string(t.name),t.point!==void 0&&Je.encode(t.point,e.uint32(26).fork()).join(),t.normal!==void 0&&At.encode(t.normal,e.uint32(34).fork()).join(),e},decode(t,e){let n=t instanceof be?t:new be(t),i=e===void 0?n.len:n.pos+e,r=Uv();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=Je.decode(n,n.uint32());continue;case 4:if(s!==34)break;r.normal=At.decode(n,n.uint32());continue}if((s&7)==4||s===0)break;n.skip(s&7)}return r},fromJSON(t){return{guid:fe(t.guid)?globalThis.String(t.guid):"",name:fe(t.name)?globalThis.String(t.name):"",point:fe(t.point)?Je.fromJSON(t.point):void 0,normal:fe(t.normal)?At.fromJSON(t.normal):void 0}},toJSON(t){let e={};return t.guid!==""&&(e.guid=t.guid),t.name!==""&&(e.name=t.name),t.point!==void 0&&(e.point=Je.toJSON(t.point)),t.normal!==void 0&&(e.normal=At.toJSON(t.normal)),e},create(t){return Yu.fromPartial(t??{})},fromPartial(t){let e=Uv();return e.guid=t.guid??"",e.name=t.name??"",e.point=t.point!==void 0&&t.point!==null?Je.fromPartial(t.point):void 0,e.normal=t.normal!==void 0&&t.normal!==null?At.fromPartial(t.normal):void 0,e}};function kv(){return{guid:"",name:"",w:0,x:0,y:0,z:0}}const Ju={encode(t,e=new ut){return t.guid!==""&&e.uint32(10).string(t.guid),t.name!==""&&e.uint32(18).string(t.name),t.w!==0&&e.uint32(29).float(t.w),t.x!==0&&e.uint32(37).float(t.x),t.y!==0&&e.uint32(45).float(t.y),t.z!==0&&e.uint32(53).float(t.z),e},decode(t,e){let n=t instanceof be?t:new be(t),i=e===void 0?n.len:n.pos+e,r=kv();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(t){return{guid:fe(t.guid)?globalThis.String(t.guid):"",name:fe(t.name)?globalThis.String(t.name):"",w:fe(t.w)?globalThis.Number(t.w):0,x:fe(t.x)?globalThis.Number(t.x):0,y:fe(t.y)?globalThis.Number(t.y):0,z:fe(t.z)?globalThis.Number(t.z):0}},toJSON(t){let e={};return t.guid!==""&&(e.guid=t.guid),t.name!==""&&(e.name=t.name),t.w!==0&&(e.w=t.w),t.x!==0&&(e.x=t.x),t.y!==0&&(e.y=t.y),t.z!==0&&(e.z=t.z),e},create(t){return Ju.fromPartial(t??{})},fromPartial(t){let e=kv();return e.guid=t.guid??"",e.name=t.name??"",e.w=t.w??0,e.x=t.x??0,e.y=t.y??0,e.z=t.z??0,e}};function Bv(){return{guid:"",name:"",start:void 0,end:void 0}}const Ku={encode(t,e=new ut){return t.guid!==""&&e.uint32(10).string(t.guid),t.name!==""&&e.uint32(18).string(t.name),t.start!==void 0&&Je.encode(t.start,e.uint32(26).fork()).join(),t.end!==void 0&&Je.encode(t.end,e.uint32(34).fork()).join(),e},decode(t,e){let n=t instanceof be?t:new be(t),i=e===void 0?n.len:n.pos+e,r=Bv();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=Je.decode(n,n.uint32());continue;case 4:if(s!==34)break;r.end=Je.decode(n,n.uint32());continue}if((s&7)==4||s===0)break;n.skip(s&7)}return r},fromJSON(t){return{guid:fe(t.guid)?globalThis.String(t.guid):"",name:fe(t.name)?globalThis.String(t.name):"",start:fe(t.start)?Je.fromJSON(t.start):void 0,end:fe(t.end)?Je.fromJSON(t.end):void 0}},toJSON(t){let e={};return t.guid!==""&&(e.guid=t.guid),t.name!==""&&(e.name=t.name),t.start!==void 0&&(e.start=Je.toJSON(t.start)),t.end!==void 0&&(e.end=Je.toJSON(t.end)),e},create(t){return Ku.fromPartial(t??{})},fromPartial(t){let e=Bv();return e.guid=t.guid??"",e.name=t.name??"",e.start=t.start!==void 0&&t.start!==null?Je.fromPartial(t.start):void 0,e.end=t.end!==void 0&&t.end!==null?Je.fromPartial(t.end):void 0,e}};function zv(){return{guid:"",name:"",radius:0,frame:void 0}}const Pr={encode(t,e=new ut){return t.guid!==""&&e.uint32(10).string(t.guid),t.name!==""&&e.uint32(18).string(t.name),t.radius!==0&&e.uint32(29).float(t.radius),t.frame!==void 0&&Ze.encode(t.frame,e.uint32(34).fork()).join(),e},decode(t,e){let n=t instanceof be?t:new be(t),i=e===void 0?n.len:n.pos+e,r=zv();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=Ze.decode(n,n.uint32());continue}if((s&7)==4||s===0)break;n.skip(s&7)}return r},fromJSON(t){return{guid:fe(t.guid)?globalThis.String(t.guid):"",name:fe(t.name)?globalThis.String(t.name):"",radius:fe(t.radius)?globalThis.Number(t.radius):0,frame:fe(t.frame)?Ze.fromJSON(t.frame):void 0}},toJSON(t){let e={};return t.guid!==""&&(e.guid=t.guid),t.name!==""&&(e.name=t.name),t.radius!==0&&(e.radius=t.radius),t.frame!==void 0&&(e.frame=Ze.toJSON(t.frame)),e},create(t){return Pr.fromPartial(t??{})},fromPartial(t){let e=zv();return e.guid=t.guid??"",e.name=t.name??"",e.radius=t.radius??0,e.frame=t.frame!==void 0&&t.frame!==null?Ze.fromPartial(t.frame):void 0,e}};function Vv(){return{guid:"",name:"",circle:void 0,startAngle:0,endAngle:0}}const Zu={encode(t,e=new ut){return t.guid!==""&&e.uint32(10).string(t.guid),t.name!==""&&e.uint32(18).string(t.name),t.circle!==void 0&&Pr.encode(t.circle,e.uint32(26).fork()).join(),t.startAngle!==0&&e.uint32(37).float(t.startAngle),t.endAngle!==0&&e.uint32(45).float(t.endAngle),e},decode(t,e){let n=t instanceof be?t:new be(t),i=e===void 0?n.len:n.pos+e,r=Vv();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=Pr.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(t){return{guid:fe(t.guid)?globalThis.String(t.guid):"",name:fe(t.name)?globalThis.String(t.name):"",circle:fe(t.circle)?Pr.fromJSON(t.circle):void 0,startAngle:fe(t.startAngle)?globalThis.Number(t.startAngle):fe(t.start_angle)?globalThis.Number(t.start_angle):0,endAngle:fe(t.endAngle)?globalThis.Number(t.endAngle):fe(t.end_angle)?globalThis.Number(t.end_angle):0}},toJSON(t){let e={};return t.guid!==""&&(e.guid=t.guid),t.name!==""&&(e.name=t.name),t.circle!==void 0&&(e.circle=Pr.toJSON(t.circle)),t.startAngle!==0&&(e.startAngle=t.startAngle),t.endAngle!==0&&(e.endAngle=t.endAngle),e},create(t){return Zu.fromPartial(t??{})},fromPartial(t){let e=Vv();return e.guid=t.guid??"",e.name=t.name??"",e.circle=t.circle!==void 0&&t.circle!==null?Pr.fromPartial(t.circle):void 0,e.startAngle=t.startAngle??0,e.endAngle=t.endAngle??0,e}};function Hv(){return{guid:"",name:"",major:0,minor:0,frame:void 0}}const Qu={encode(t,e=new ut){return t.guid!==""&&e.uint32(10).string(t.guid),t.name!==""&&e.uint32(18).string(t.name),t.major!==0&&e.uint32(29).float(t.major),t.minor!==0&&e.uint32(37).float(t.minor),t.frame!==void 0&&Ze.encode(t.frame,e.uint32(42).fork()).join(),e},decode(t,e){let n=t instanceof be?t:new be(t),i=e===void 0?n.len:n.pos+e,r=Hv();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=Ze.decode(n,n.uint32());continue}if((s&7)==4||s===0)break;n.skip(s&7)}return r},fromJSON(t){return{guid:fe(t.guid)?globalThis.String(t.guid):"",name:fe(t.name)?globalThis.String(t.name):"",major:fe(t.major)?globalThis.Number(t.major):0,minor:fe(t.minor)?globalThis.Number(t.minor):0,frame:fe(t.frame)?Ze.fromJSON(t.frame):void 0}},toJSON(t){let e={};return t.guid!==""&&(e.guid=t.guid),t.name!==""&&(e.name=t.name),t.major!==0&&(e.major=t.major),t.minor!==0&&(e.minor=t.minor),t.frame!==void 0&&(e.frame=Ze.toJSON(t.frame)),e},create(t){return Qu.fromPartial(t??{})},fromPartial(t){let e=Hv();return e.guid=t.guid??"",e.name=t.name??"",e.major=t.major??0,e.minor=t.minor??0,e.frame=t.frame!==void 0&&t.frame!==null?Ze.fromPartial(t.frame):void 0,e}};function Gv(){return{guid:"",name:"",focal:0,frame:void 0}}const ed={encode(t,e=new ut){return t.guid!==""&&e.uint32(10).string(t.guid),t.name!==""&&e.uint32(18).string(t.name),t.focal!==0&&e.uint32(29).float(t.focal),t.frame!==void 0&&Ze.encode(t.frame,e.uint32(34).fork()).join(),e},decode(t,e){let n=t instanceof be?t:new be(t),i=e===void 0?n.len:n.pos+e,r=Gv();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=Ze.decode(n,n.uint32());continue}if((s&7)==4||s===0)break;n.skip(s&7)}return r},fromJSON(t){return{guid:fe(t.guid)?globalThis.String(t.guid):"",name:fe(t.name)?globalThis.String(t.name):"",focal:fe(t.focal)?globalThis.Number(t.focal):0,frame:fe(t.frame)?Ze.fromJSON(t.frame):void 0}},toJSON(t){let e={};return t.guid!==""&&(e.guid=t.guid),t.name!==""&&(e.name=t.name),t.focal!==0&&(e.focal=t.focal),t.frame!==void 0&&(e.frame=Ze.toJSON(t.frame)),e},create(t){return ed.fromPartial(t??{})},fromPartial(t){let e=Gv();return e.guid=t.guid??"",e.name=t.name??"",e.focal=t.focal??0,e.frame=t.frame!==void 0&&t.frame!==null?Ze.fromPartial(t.frame):void 0,e}};function Wv(){return{guid:"",name:"",major:0,minor:0,frame:void 0}}const td={encode(t,e=new ut){return t.guid!==""&&e.uint32(10).string(t.guid),t.name!==""&&e.uint32(18).string(t.name),t.major!==0&&e.uint32(29).float(t.major),t.minor!==0&&e.uint32(37).float(t.minor),t.frame!==void 0&&Ze.encode(t.frame,e.uint32(42).fork()).join(),e},decode(t,e){let n=t instanceof be?t:new be(t),i=e===void 0?n.len:n.pos+e,r=Wv();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=Ze.decode(n,n.uint32());continue}if((s&7)==4||s===0)break;n.skip(s&7)}return r},fromJSON(t){return{guid:fe(t.guid)?globalThis.String(t.guid):"",name:fe(t.name)?globalThis.String(t.name):"",major:fe(t.major)?globalThis.Number(t.major):0,minor:fe(t.minor)?globalThis.Number(t.minor):0,frame:fe(t.frame)?Ze.fromJSON(t.frame):void 0}},toJSON(t){let e={};return t.guid!==""&&(e.guid=t.guid),t.name!==""&&(e.name=t.name),t.major!==0&&(e.major=t.major),t.minor!==0&&(e.minor=t.minor),t.frame!==void 0&&(e.frame=Ze.toJSON(t.frame)),e},create(t){return td.fromPartial(t??{})},fromPartial(t){let e=Wv();return e.guid=t.guid??"",e.name=t.name??"",e.major=t.major??0,e.minor=t.minor??0,e.frame=t.frame!==void 0&&t.frame!==null?Ze.fromPartial(t.frame):void 0,e}};function qv(){return{guid:"",name:"",points:[],degree:0}}const nd={encode(t,e=new ut){t.guid!==""&&e.uint32(10).string(t.guid),t.name!==""&&e.uint32(18).string(t.name);for(let n of t.points)Je.encode(n,e.uint32(26).fork()).join();return t.degree!==0&&e.uint32(32).int32(t.degree),e},decode(t,e){let n=t instanceof be?t:new be(t),i=e===void 0?n.len:n.pos+e,r=qv();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(Je.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(t){return{guid:fe(t.guid)?globalThis.String(t.guid):"",name:fe(t.name)?globalThis.String(t.name):"",points:globalThis.Array.isArray(t?.points)?t.points.map(e=>Je.fromJSON(e)):[],degree:fe(t.degree)?globalThis.Number(t.degree):0}},toJSON(t){let e={};return t.guid!==""&&(e.guid=t.guid),t.name!==""&&(e.name=t.name),t.points?.length&&(e.points=t.points.map(n=>Je.toJSON(n))),t.degree!==0&&(e.degree=Math.round(t.degree)),e},create(t){return nd.fromPartial(t??{})},fromPartial(t){let e=qv();return e.guid=t.guid??"",e.name=t.name??"",e.points=t.points?.map(n=>Je.fromPartial(n))||[],e.degree=t.degree??0,e}};function Xv(){return{guid:"",name:"",points:[]}}const id={encode(t,e=new ut){t.guid!==""&&e.uint32(10).string(t.guid),t.name!==""&&e.uint32(18).string(t.name);for(let n of t.points)Je.encode(n,e.uint32(26).fork()).join();return e},decode(t,e){let n=t instanceof be?t:new be(t),i=e===void 0?n.len:n.pos+e,r=Xv();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(Je.decode(n,n.uint32()));continue}if((s&7)==4||s===0)break;n.skip(s&7)}return r},fromJSON(t){return{guid:fe(t.guid)?globalThis.String(t.guid):"",name:fe(t.name)?globalThis.String(t.name):"",points:globalThis.Array.isArray(t?.points)?t.points.map(e=>Je.fromJSON(e)):[]}},toJSON(t){let e={};return t.guid!==""&&(e.guid=t.guid),t.name!==""&&(e.name=t.name),t.points?.length&&(e.points=t.points.map(n=>Je.toJSON(n))),e},create(t){return id.fromPartial(t??{})},fromPartial(t){let e=Xv();return e.guid=t.guid??"",e.name=t.name??"",e.points=t.points?.map(n=>Je.fromPartial(n))||[],e}};function $v(){return{guid:"",name:"",points:[]}}const rd={encode(t,e=new ut){t.guid!==""&&e.uint32(10).string(t.guid),t.name!==""&&e.uint32(18).string(t.name);for(let n of t.points)Je.encode(n,e.uint32(26).fork()).join();return e},decode(t,e){let n=t instanceof be?t:new be(t),i=e===void 0?n.len:n.pos+e,r=$v();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(Je.decode(n,n.uint32()));continue}if((s&7)==4||s===0)break;n.skip(s&7)}return r},fromJSON(t){return{guid:fe(t.guid)?globalThis.String(t.guid):"",name:fe(t.name)?globalThis.String(t.name):"",points:globalThis.Array.isArray(t?.points)?t.points.map(e=>Je.fromJSON(e)):[]}},toJSON(t){let e={};return t.guid!==""&&(e.guid=t.guid),t.name!==""&&(e.name=t.name),t.points?.length&&(e.points=t.points.map(n=>Je.toJSON(n))),e},create(t){return rd.fromPartial(t??{})},fromPartial(t){let e=$v();return e.guid=t.guid??"",e.name=t.name??"",e.points=t.points?.map(n=>Je.fromPartial(n))||[],e}};function jv(){return{guid:"",name:"",frame:void 0,xsize:0,ysize:0,zsize:0}}const sd={encode(t,e=new ut){return t.guid!==""&&e.uint32(10).string(t.guid),t.name!==""&&e.uint32(18).string(t.name),t.frame!==void 0&&Ze.encode(t.frame,e.uint32(26).fork()).join(),t.xsize!==0&&e.uint32(37).float(t.xsize),t.ysize!==0&&e.uint32(45).float(t.ysize),t.zsize!==0&&e.uint32(53).float(t.zsize),e},decode(t,e){let n=t instanceof be?t:new be(t),i=e===void 0?n.len:n.pos+e,r=jv();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=Ze.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(t){return{guid:fe(t.guid)?globalThis.String(t.guid):"",name:fe(t.name)?globalThis.String(t.name):"",frame:fe(t.frame)?Ze.fromJSON(t.frame):void 0,xsize:fe(t.xsize)?globalThis.Number(t.xsize):0,ysize:fe(t.ysize)?globalThis.Number(t.ysize):0,zsize:fe(t.zsize)?globalThis.Number(t.zsize):0}},toJSON(t){let e={};return t.guid!==""&&(e.guid=t.guid),t.name!==""&&(e.name=t.name),t.frame!==void 0&&(e.frame=Ze.toJSON(t.frame)),t.xsize!==0&&(e.xsize=t.xsize),t.ysize!==0&&(e.ysize=t.ysize),t.zsize!==0&&(e.zsize=t.zsize),e},create(t){return sd.fromPartial(t??{})},fromPartial(t){let e=jv();return e.guid=t.guid??"",e.name=t.name??"",e.frame=t.frame!==void 0&&t.frame!==null?Ze.fromPartial(t.frame):void 0,e.xsize=t.xsize??0,e.ysize=t.ysize??0,e.zsize=t.zsize??0,e}};function Yv(){return{guid:"",name:"",radius:0,frame:void 0}}const od={encode(t,e=new ut){return t.guid!==""&&e.uint32(10).string(t.guid),t.name!==""&&e.uint32(18).string(t.name),t.radius!==0&&e.uint32(29).float(t.radius),t.frame!==void 0&&Ze.encode(t.frame,e.uint32(34).fork()).join(),e},decode(t,e){let n=t instanceof be?t:new be(t),i=e===void 0?n.len:n.pos+e,r=Yv();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=Ze.decode(n,n.uint32());continue}if((s&7)==4||s===0)break;n.skip(s&7)}return r},fromJSON(t){return{guid:fe(t.guid)?globalThis.String(t.guid):"",name:fe(t.name)?globalThis.String(t.name):"",radius:fe(t.radius)?globalThis.Number(t.radius):0,frame:fe(t.frame)?Ze.fromJSON(t.frame):void 0}},toJSON(t){let e={};return t.guid!==""&&(e.guid=t.guid),t.name!==""&&(e.name=t.name),t.radius!==0&&(e.radius=t.radius),t.frame!==void 0&&(e.frame=Ze.toJSON(t.frame)),e},create(t){return od.fromPartial(t??{})},fromPartial(t){let e=Yv();return e.guid=t.guid??"",e.name=t.name??"",e.radius=t.radius??0,e.frame=t.frame!==void 0&&t.frame!==null?Ze.fromPartial(t.frame):void 0,e}};function Jv(){return{guid:"",name:"",radius:0,height:0,frame:void 0}}const ad={encode(t,e=new ut){return t.guid!==""&&e.uint32(10).string(t.guid),t.name!==""&&e.uint32(18).string(t.name),t.radius!==0&&e.uint32(29).float(t.radius),t.height!==0&&e.uint32(37).float(t.height),t.frame!==void 0&&Ze.encode(t.frame,e.uint32(42).fork()).join(),e},decode(t,e){let n=t instanceof be?t:new be(t),i=e===void 0?n.len:n.pos+e,r=Jv();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=Ze.decode(n,n.uint32());continue}if((s&7)==4||s===0)break;n.skip(s&7)}return r},fromJSON(t){return{guid:fe(t.guid)?globalThis.String(t.guid):"",name:fe(t.name)?globalThis.String(t.name):"",radius:fe(t.radius)?globalThis.Number(t.radius):0,height:fe(t.height)?globalThis.Number(t.height):0,frame:fe(t.frame)?Ze.fromJSON(t.frame):void 0}},toJSON(t){let e={};return t.guid!==""&&(e.guid=t.guid),t.name!==""&&(e.name=t.name),t.radius!==0&&(e.radius=t.radius),t.height!==0&&(e.height=t.height),t.frame!==void 0&&(e.frame=Ze.toJSON(t.frame)),e},create(t){return ad.fromPartial(t??{})},fromPartial(t){let e=Jv();return e.guid=t.guid??"",e.name=t.name??"",e.radius=t.radius??0,e.height=t.height??0,e.frame=t.frame!==void 0&&t.frame!==null?Ze.fromPartial(t.frame):void 0,e}};function Kv(){return{guid:"",name:"",radius:0,height:0,frame:void 0}}const ld={encode(t,e=new ut){return t.guid!==""&&e.uint32(10).string(t.guid),t.name!==""&&e.uint32(18).string(t.name),t.radius!==0&&e.uint32(29).float(t.radius),t.height!==0&&e.uint32(37).float(t.height),t.frame!==void 0&&Ze.encode(t.frame,e.uint32(42).fork()).join(),e},decode(t,e){let n=t instanceof be?t:new be(t),i=e===void 0?n.len:n.pos+e,r=Kv();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=Ze.decode(n,n.uint32());continue}if((s&7)==4||s===0)break;n.skip(s&7)}return r},fromJSON(t){return{guid:fe(t.guid)?globalThis.String(t.guid):"",name:fe(t.name)?globalThis.String(t.name):"",radius:fe(t.radius)?globalThis.Number(t.radius):0,height:fe(t.height)?globalThis.Number(t.height):0,frame:fe(t.frame)?Ze.fromJSON(t.frame):void 0}},toJSON(t){let e={};return t.guid!==""&&(e.guid=t.guid),t.name!==""&&(e.name=t.name),t.radius!==0&&(e.radius=t.radius),t.height!==0&&(e.height=t.height),t.frame!==void 0&&(e.frame=Ze.toJSON(t.frame)),e},create(t){return ld.fromPartial(t??{})},fromPartial(t){let e=Kv();return e.guid=t.guid??"",e.name=t.name??"",e.radius=t.radius??0,e.height=t.height??0,e.frame=t.frame!==void 0&&t.frame!==null?Ze.fromPartial(t.frame):void 0,e}};function Zv(){return{guid:"",name:"",radius:0,height:0,frame:void 0}}const cd={encode(t,e=new ut){return t.guid!==""&&e.uint32(10).string(t.guid),t.name!==""&&e.uint32(18).string(t.name),t.radius!==0&&e.uint32(29).float(t.radius),t.height!==0&&e.uint32(37).float(t.height),t.frame!==void 0&&Ze.encode(t.frame,e.uint32(42).fork()).join(),e},decode(t,e){let n=t instanceof be?t:new be(t),i=e===void 0?n.len:n.pos+e,r=Zv();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=Ze.decode(n,n.uint32());continue}if((s&7)==4||s===0)break;n.skip(s&7)}return r},fromJSON(t){return{guid:fe(t.guid)?globalThis.String(t.guid):"",name:fe(t.name)?globalThis.String(t.name):"",radius:fe(t.radius)?globalThis.Number(t.radius):0,height:fe(t.height)?globalThis.Number(t.height):0,frame:fe(t.frame)?Ze.fromJSON(t.frame):void 0}},toJSON(t){let e={};return t.guid!==""&&(e.guid=t.guid),t.name!==""&&(e.name=t.name),t.radius!==0&&(e.radius=t.radius),t.height!==0&&(e.height=t.height),t.frame!==void 0&&(e.frame=Ze.toJSON(t.frame)),e},create(t){return cd.fromPartial(t??{})},fromPartial(t){let e=Zv();return e.guid=t.guid??"",e.name=t.name??"",e.radius=t.radius??0,e.height=t.height??0,e.frame=t.frame!==void 0&&t.frame!==null?Ze.fromPartial(t.frame):void 0,e}};function Qv(){return{guid:"",name:"",radiusAxis:0,radiusPipe:0,frame:void 0}}const ud={encode(t,e=new ut){return t.guid!==""&&e.uint32(10).string(t.guid),t.name!==""&&e.uint32(18).string(t.name),t.radiusAxis!==0&&e.uint32(29).float(t.radiusAxis),t.radiusPipe!==0&&e.uint32(37).float(t.radiusPipe),t.frame!==void 0&&Ze.encode(t.frame,e.uint32(42).fork()).join(),e},decode(t,e){let n=t instanceof be?t:new be(t),i=e===void 0?n.len:n.pos+e,r=Qv();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=Ze.decode(n,n.uint32());continue}if((s&7)==4||s===0)break;n.skip(s&7)}return r},fromJSON(t){return{guid:fe(t.guid)?globalThis.String(t.guid):"",name:fe(t.name)?globalThis.String(t.name):"",radiusAxis:fe(t.radiusAxis)?globalThis.Number(t.radiusAxis):fe(t.radius_axis)?globalThis.Number(t.radius_axis):0,radiusPipe:fe(t.radiusPipe)?globalThis.Number(t.radiusPipe):fe(t.radius_pipe)?globalThis.Number(t.radius_pipe):0,frame:fe(t.frame)?Ze.fromJSON(t.frame):void 0}},toJSON(t){let e={};return t.guid!==""&&(e.guid=t.guid),t.name!==""&&(e.name=t.name),t.radiusAxis!==0&&(e.radiusAxis=t.radiusAxis),t.radiusPipe!==0&&(e.radiusPipe=t.radiusPipe),t.frame!==void 0&&(e.frame=Ze.toJSON(t.frame)),e},create(t){return ud.fromPartial(t??{})},fromPartial(t){let e=Qv();return e.guid=t.guid??"",e.name=t.name??"",e.radiusAxis=t.radiusAxis??0,e.radiusPipe=t.radiusPipe??0,e.frame=t.frame!==void 0&&t.frame!==null?Ze.fromPartial(t.frame):void 0,e}};function e_(){return{guid:"",name:"",points:[]}}const dd={encode(t,e=new ut){t.guid!==""&&e.uint32(10).string(t.guid),t.name!==""&&e.uint32(18).string(t.name);for(let n of t.points)Je.encode(n,e.uint32(26).fork()).join();return e},decode(t,e){let n=t instanceof be?t:new be(t),i=e===void 0?n.len:n.pos+e,r=e_();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(Je.decode(n,n.uint32()));continue}if((s&7)==4||s===0)break;n.skip(s&7)}return r},fromJSON(t){return{guid:fe(t.guid)?globalThis.String(t.guid):"",name:fe(t.name)?globalThis.String(t.name):"",points:globalThis.Array.isArray(t?.points)?t.points.map(e=>Je.fromJSON(e)):[]}},toJSON(t){let e={};return t.guid!==""&&(e.guid=t.guid),t.name!==""&&(e.name=t.name),t.points?.length&&(e.points=t.points.map(n=>Je.toJSON(n))),e},create(t){return dd.fromPartial(t??{})},fromPartial(t){let e=e_();return e.guid=t.guid??"",e.name=t.name??"",e.points=t.points?.map(n=>Je.fromPartial(n))||[],e}};function t_(){return{guid:"",name:"",matrix:[]}}const fd={encode(t,e=new ut){t.guid!==""&&e.uint32(10).string(t.guid),t.name!==""&&e.uint32(18).string(t.name),e.uint32(26).fork();for(let n of t.matrix)e.float(n);return e.join(),e},decode(t,e){let n=t instanceof be?t:new be(t),i=e===void 0?n.len:n.pos+e,r=t_();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){let o=n.uint32()+n.pos;for(;n.posglobalThis.Number(e)):[]}},toJSON(t){let e={};return t.guid!==""&&(e.guid=t.guid),t.name!==""&&(e.name=t.name),t.matrix?.length&&(e.matrix=t.matrix),e},create(t){return fd.fromPartial(t??{})},fromPartial(t){let e=t_();return e.guid=t.guid??"",e.name=t.name??"",e.matrix=t.matrix?.map(n=>n)||[],e}};function n_(){return{guid:"",name:"",translationVector:void 0}}const hd={encode(t,e=new ut){return t.guid!==""&&e.uint32(10).string(t.guid),t.name!==""&&e.uint32(18).string(t.name),t.translationVector!==void 0&&At.encode(t.translationVector,e.uint32(26).fork()).join(),e},decode(t,e){let n=t instanceof be?t:new be(t),i=e===void 0?n.len:n.pos+e,r=n_();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=At.decode(n,n.uint32());continue}if((s&7)==4||s===0)break;n.skip(s&7)}return r},fromJSON(t){return{guid:fe(t.guid)?globalThis.String(t.guid):"",name:fe(t.name)?globalThis.String(t.name):"",translationVector:fe(t.translationVector)?At.fromJSON(t.translationVector):fe(t.translation_vector)?At.fromJSON(t.translation_vector):void 0}},toJSON(t){let e={};return t.guid!==""&&(e.guid=t.guid),t.name!==""&&(e.name=t.name),t.translationVector!==void 0&&(e.translationVector=At.toJSON(t.translationVector)),e},create(t){return hd.fromPartial(t??{})},fromPartial(t){let e=n_();return e.guid=t.guid??"",e.name=t.name??"",e.translationVector=t.translationVector!==void 0&&t.translationVector!==null?At.fromPartial(t.translationVector):void 0,e}};function i_(){return{guid:"",name:"",axis:void 0,angle:0,point:void 0}}const pd={encode(t,e=new ut){return t.guid!==""&&e.uint32(10).string(t.guid),t.name!==""&&e.uint32(18).string(t.name),t.axis!==void 0&&At.encode(t.axis,e.uint32(26).fork()).join(),t.angle!==0&&e.uint32(37).float(t.angle),t.point!==void 0&&Je.encode(t.point,e.uint32(42).fork()).join(),e},decode(t,e){let n=t instanceof be?t:new be(t),i=e===void 0?n.len:n.pos+e,r=i_();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=At.decode(n,n.uint32());continue;case 4:if(s!==37)break;r.angle=n.float();continue;case 5:if(s!==42)break;r.point=Je.decode(n,n.uint32());continue}if((s&7)==4||s===0)break;n.skip(s&7)}return r},fromJSON(t){return{guid:fe(t.guid)?globalThis.String(t.guid):"",name:fe(t.name)?globalThis.String(t.name):"",axis:fe(t.axis)?At.fromJSON(t.axis):void 0,angle:fe(t.angle)?globalThis.Number(t.angle):0,point:fe(t.point)?Je.fromJSON(t.point):void 0}},toJSON(t){let e={};return t.guid!==""&&(e.guid=t.guid),t.name!==""&&(e.name=t.name),t.axis!==void 0&&(e.axis=At.toJSON(t.axis)),t.angle!==0&&(e.angle=t.angle),t.point!==void 0&&(e.point=Je.toJSON(t.point)),e},create(t){return pd.fromPartial(t??{})},fromPartial(t){let e=i_();return e.guid=t.guid??"",e.name=t.name??"",e.axis=t.axis!==void 0&&t.axis!==null?At.fromPartial(t.axis):void 0,e.angle=t.angle??0,e.point=t.point!==void 0&&t.point!==null?Je.fromPartial(t.point):void 0,e}};function r_(){return{guid:"",name:"",matrix:[]}}const md={encode(t,e=new ut){t.guid!==""&&e.uint32(10).string(t.guid),t.name!==""&&e.uint32(18).string(t.name),e.uint32(26).fork();for(let n of t.matrix)e.float(n);return e.join(),e},decode(t,e){let n=t instanceof be?t:new be(t),i=e===void 0?n.len:n.pos+e,r=r_();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){let o=n.uint32()+n.pos;for(;n.posglobalThis.Number(e)):[]}},toJSON(t){let e={};return t.guid!==""&&(e.guid=t.guid),t.name!==""&&(e.name=t.name),t.matrix?.length&&(e.matrix=t.matrix),e},create(t){return md.fromPartial(t??{})},fromPartial(t){let e=r_();return e.guid=t.guid??"",e.name=t.name??"",e.matrix=t.matrix?.map(n=>n)||[],e}};function s_(){return{guid:"",name:"",matrix:[]}}const gd={encode(t,e=new ut){t.guid!==""&&e.uint32(10).string(t.guid),t.name!==""&&e.uint32(18).string(t.name),e.uint32(26).fork();for(let n of t.matrix)e.float(n);return e.join(),e},decode(t,e){let n=t instanceof be?t:new be(t),i=e===void 0?n.len:n.pos+e,r=s_();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){let o=n.uint32()+n.pos;for(;n.posglobalThis.Number(e)):[]}},toJSON(t){let e={};return t.guid!==""&&(e.guid=t.guid),t.name!==""&&(e.name=t.name),t.matrix?.length&&(e.matrix=t.matrix),e},create(t){return gd.fromPartial(t??{})},fromPartial(t){let e=s_();return e.guid=t.guid??"",e.name=t.name??"",e.matrix=t.matrix?.map(n=>n)||[],e}};function o_(){return{guid:"",name:"",matrix:[]}}const vd={encode(t,e=new ut){t.guid!==""&&e.uint32(10).string(t.guid),t.name!==""&&e.uint32(18).string(t.name),e.uint32(26).fork();for(let n of t.matrix)e.float(n);return e.join(),e},decode(t,e){let n=t instanceof be?t:new be(t),i=e===void 0?n.len:n.pos+e,r=o_();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){let o=n.uint32()+n.pos;for(;n.posglobalThis.Number(e)):[]}},toJSON(t){let e={};return t.guid!==""&&(e.guid=t.guid),t.name!==""&&(e.name=t.name),t.matrix?.length&&(e.matrix=t.matrix),e},create(t){return vd.fromPartial(t??{})},fromPartial(t){let e=o_();return e.guid=t.guid??"",e.name=t.name??"",e.matrix=t.matrix?.map(n=>n)||[],e}};function a_(){return{guid:"",name:"",matrix:[]}}const _d={encode(t,e=new ut){t.guid!==""&&e.uint32(10).string(t.guid),t.name!==""&&e.uint32(18).string(t.name),e.uint32(26).fork();for(let n of t.matrix)e.float(n);return e.join(),e},decode(t,e){let n=t instanceof be?t:new be(t),i=e===void 0?n.len:n.pos+e,r=a_();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){let o=n.uint32()+n.pos;for(;n.posglobalThis.Number(e)):[]}},toJSON(t){let e={};return t.guid!==""&&(e.guid=t.guid),t.name!==""&&(e.name=t.name),t.matrix?.length&&(e.matrix=t.matrix),e},create(t){return _d.fromPartial(t??{})},fromPartial(t){let e=a_();return e.guid=t.guid??"",e.name=t.name??"",e.matrix=t.matrix?.map(n=>n)||[],e}};function fe(t){return t!=null}jp({FaceData:()=>Dr,FaceList:()=>Rr,MeshData:()=>xd,PolyhedronData:()=>yd,protobufPackage:()=>jN});const jN="compas_pb.data";function l_(){return{indices:[]}}const Rr={encode(t,e=new ut){e.uint32(10).fork();for(let n of t.indices)e.uint32(n);return e.join(),e},decode(t,e){let n=t instanceof be?t:new be(t),i=e===void 0?n.len:n.pos+e,r=l_();for(;n.pos>>3){case 1:if(s===8){r.indices.push(n.uint32());continue}if(s===10){let o=n.uint32()+n.pos;for(;n.posglobalThis.Number(e)):[]}},toJSON(t){let e={};return t.indices?.length&&(e.indices=t.indices.map(n=>Math.round(n))),e},create(t){return Rr.fromPartial(t??{})},fromPartial(t){let e=l_();return e.indices=t.indices?.map(n=>n)||[],e}};function c_(){return{guid:void 0,name:void 0,vertices:[],faces:[]}}const xd={encode(t,e=new ut){t.guid!==void 0&&e.uint32(10).string(t.guid),t.name!==void 0&&e.uint32(18).string(t.name);for(let n of t.vertices)Je.encode(n,e.uint32(26).fork()).join();for(let n of t.faces)Rr.encode(n,e.uint32(34).fork()).join();return e},decode(t,e){let n=t instanceof be?t:new be(t),i=e===void 0?n.len:n.pos+e,r=c_();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(Je.decode(n,n.uint32()));continue;case 4:if(s!==34)break;r.faces.push(Rr.decode(n,n.uint32()));continue}if((s&7)==4||s===0)break;n.skip(s&7)}return r},fromJSON(t){return{guid:fu(t.guid)?globalThis.String(t.guid):void 0,name:fu(t.name)?globalThis.String(t.name):void 0,vertices:globalThis.Array.isArray(t?.vertices)?t.vertices.map(e=>Je.fromJSON(e)):[],faces:globalThis.Array.isArray(t?.faces)?t.faces.map(e=>Rr.fromJSON(e)):[]}},toJSON(t){let e={};return t.guid!==void 0&&(e.guid=t.guid),t.name!==void 0&&(e.name=t.name),t.vertices?.length&&(e.vertices=t.vertices.map(n=>Je.toJSON(n))),t.faces?.length&&(e.faces=t.faces.map(n=>Rr.toJSON(n))),e},create(t){return xd.fromPartial(t??{})},fromPartial(t){let e=c_();return e.guid=t.guid??void 0,e.name=t.name??void 0,e.vertices=t.vertices?.map(n=>Je.fromPartial(n))||[],e.faces=t.faces?.map(n=>Rr.fromPartial(n))||[],e}};function u_(){return{vertexIndices:[]}}const Dr={encode(t,e=new ut){e.uint32(10).fork();for(let n of t.vertexIndices)e.int32(n);return e.join(),e},decode(t,e){let n=t instanceof be?t:new be(t),i=e===void 0?n.len:n.pos+e,r=u_();for(;n.pos>>3){case 1:if(s===8){r.vertexIndices.push(n.int32());continue}if(s===10){let o=n.uint32()+n.pos;for(;n.posglobalThis.Number(e)):globalThis.Array.isArray(t?.vertex_indices)?t.vertex_indices.map(e=>globalThis.Number(e)):[]}},toJSON(t){let e={};return t.vertexIndices?.length&&(e.vertexIndices=t.vertexIndices.map(n=>Math.round(n))),e},create(t){return Dr.fromPartial(t??{})},fromPartial(t){let e=u_();return e.vertexIndices=t.vertexIndices?.map(n=>n)||[],e}};function d_(){return{guid:void 0,name:void 0,vertices:[],faces:[]}}const yd={encode(t,e=new ut){t.guid!==void 0&&e.uint32(10).string(t.guid),t.name!==void 0&&e.uint32(18).string(t.name);for(let n of t.vertices)Je.encode(n,e.uint32(26).fork()).join();for(let n of t.faces)Dr.encode(n,e.uint32(34).fork()).join();return e},decode(t,e){let n=t instanceof be?t:new be(t),i=e===void 0?n.len:n.pos+e,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.vertices.push(Je.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(t){return{guid:fu(t.guid)?globalThis.String(t.guid):void 0,name:fu(t.name)?globalThis.String(t.name):void 0,vertices:globalThis.Array.isArray(t?.vertices)?t.vertices.map(e=>Je.fromJSON(e)):[],faces:globalThis.Array.isArray(t?.faces)?t.faces.map(e=>Dr.fromJSON(e)):[]}},toJSON(t){let e={};return t.guid!==void 0&&(e.guid=t.guid),t.name!==void 0&&(e.name=t.name),t.vertices?.length&&(e.vertices=t.vertices.map(n=>Je.toJSON(n))),t.faces?.length&&(e.faces=t.faces.map(n=>Dr.toJSON(n))),e},create(t){return yd.fromPartial(t??{})},fromPartial(t){let e=d_();return e.guid=t.guid??void 0,e.name=t.name??void 0,e.vertices=t.vertices?.map(n=>Je.fromPartial(n))||[],e.faces=t.faces?.map(n=>Dr.fromPartial(n))||[],e}};function fu(t){return t!=null}var bi=class{data;constructor(t){let e;if(e="bytes"in t?YN(t.bytes):t.data,e.x===void 0||e.y===void 0||e.z===void 0)throw Error("Invalid PointData: Missing required properties (x, y, or z).");this.data=e}get bytes(){return JN(this.data)}get guid(){return this.data.guid}get name(){return this.data.name}get x(){return this.data.x}get y(){return this.data.y}get z(){return this.data.z}buildGeometry(){let t=new _t,e=new Float32Array([this.x,this.y,this.z]);t.setAttribute("position",new Gn(e,3));let n=new qu({size:.2,color:255});return new dm(t,n)}};function YN(t){return Je.decode(t)}function JN(t){return Je.encode(t).finish()}var KN=class{data;constructor(t){let e;if(e="bytes"in t?ZN(t.bytes):t.data,!e.vertexIndices)throw Error("Invalid FaceData: Missing required property 'vertices'.");this.data=e}get bytes(){return QN(this.data)}get vertexIndices(){return this.data.vertexIndices}};function ZN(t){return Dr.decode(t)}function QN(t){return Dr.encode(t).finish()}var eL=class{data;_points;_faces;constructor(t){let e;if(e="bytes"in t?tL(t.bytes):t.data,!e.vertices||!e.faces)throw Error("Invalid PolyhedronData: Missing required properties (vertices or faces).");this.data=e}get bytes(){return nL(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(let t of this.data.vertices){let e=new bi({data:t});this._points.push(e)}}return this._points}get faces(){if(!this._faces){this._faces=[];for(let t of this.data.faces){let e=new KN({data:t});this._faces.push(e)}}return this._faces}buildGeometry(){let t=new _t,e=new Float32Array(this.vertices.length*3);for(let r=0;r{e[s*3]=r.x,e[s*3+1]=r.y,e[s*3+2]=r.z});let n=[];for(let r of this.faces){let s=r.indices;for(let o=1;oMath.PI&&(i-=jn),r<-Math.PI?r+=jn:r>Math.PI&&(r-=jn),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(un.setFromSpherical(this._spherical),un.applyQuaternion(this._quatInverse),n.copy(this.target).add(un),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=un.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 N(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 N(this._mouse.x,this._mouse.y,0);c.unproject(this.object),this.object.position.sub(c).add(a),this.object.updateMatrixWorld(),o=un.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):(wc.origin.copy(this.object.position),wc.direction.set(0,0,-1).transformDirection(this.object.matrix),Math.abs(this.object.up.dot(wc.direction))Vf||8*(1-this._lastQuaternion.dot(this.object.quaternion))>Vf||this._lastTargetPosition.distanceToSquared(this.target)>Vf?(this.dispatchEvent(f_),this._lastPosition.copy(this.object.position),this._lastQuaternion.copy(this.object.quaternion),this._lastTargetPosition.copy(this.target),!0):!1}_getAutoRotationAngle(e){return e!==null?jn/60*this.autoRotateSpeed*e:jn/60/60*this.autoRotateSpeed}_getZoomScale(e){const n=Math.abs(e*.01);return Math.pow(.95,this.zoomSpeed*n)}_rotateLeft(e){this._sphericalDelta.theta-=e}_rotateUp(e){this._sphericalDelta.phi-=e}_panLeft(e,n){un.setFromMatrixColumn(n,0),un.multiplyScalar(-e),this._panOffset.add(un)}_panUp(e,n){this.screenSpacePanning===!0?un.setFromMatrixColumn(n,1):(un.setFromMatrixColumn(n,0),un.crossVectors(this.object.up,un)),un.multiplyScalar(e),this._panOffset.add(un)}_pan(e,n){const i=this.domElement;if(this.object.isPerspectiveCamera){const r=this.object.position;un.copy(r).sub(this.target);let s=un.length();s*=Math.tan(this.object.fov/2*Math.PI/180),this._panLeft(2*e*s/i.clientHeight,this.object.matrix),this._panUp(2*n*s/i.clientHeight,this.object.matrix)}else this.object.isOrthographicCamera?(this._panLeft(e*(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(e){this.object.isPerspectiveCamera||this.object.isOrthographicCamera?this._scale/=e:(console.warn("WARNING: OrbitControls.js encountered an unknown camera type - dolly/zoom disabled."),this.enableZoom=!1)}_dollyIn(e){this.object.isPerspectiveCamera||this.object.isOrthographicCamera?this._scale*=e:(console.warn("WARNING: OrbitControls.js encountered an unknown camera type - dolly/zoom disabled."),this.enableZoom=!1)}_updateZoomParameters(e,n){if(!this.zoomToCursor)return;this._performCursorZoom=!0;const i=this.domElement.getBoundingClientRect(),r=e-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(e){return Math.max(this.minDistance,Math.min(this.maxDistance,e))}_handleMouseDownRotate(e){this._rotateStart.set(e.clientX,e.clientY)}_handleMouseDownDolly(e){this._updateZoomParameters(e.clientX,e.clientX),this._dollyStart.set(e.clientX,e.clientY)}_handleMouseDownPan(e){this._panStart.set(e.clientX,e.clientY)}_handleMouseMoveRotate(e){this._rotateEnd.set(e.clientX,e.clientY),this._rotateDelta.subVectors(this._rotateEnd,this._rotateStart).multiplyScalar(this.rotateSpeed);const n=this.domElement;this._rotateLeft(jn*this._rotateDelta.x/n.clientHeight),this._rotateUp(jn*this._rotateDelta.y/n.clientHeight),this._rotateStart.copy(this._rotateEnd),this.update()}_handleMouseMoveDolly(e){this._dollyEnd.set(e.clientX,e.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(e){this._panEnd.set(e.clientX,e.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(e){this._updateZoomParameters(e.clientX,e.clientY),e.deltaY<0?this._dollyIn(this._getZoomScale(e.deltaY)):e.deltaY>0&&this._dollyOut(this._getZoomScale(e.deltaY)),this.update()}_handleKeyDown(e){let n=!1;switch(e.code){case this.keys.UP:e.ctrlKey||e.metaKey||e.shiftKey?this.enableRotate&&this._rotateUp(jn*this.keyRotateSpeed/this.domElement.clientHeight):this.enablePan&&this._pan(0,this.keyPanSpeed),n=!0;break;case this.keys.BOTTOM:e.ctrlKey||e.metaKey||e.shiftKey?this.enableRotate&&this._rotateUp(-jn*this.keyRotateSpeed/this.domElement.clientHeight):this.enablePan&&this._pan(0,-this.keyPanSpeed),n=!0;break;case this.keys.LEFT:e.ctrlKey||e.metaKey||e.shiftKey?this.enableRotate&&this._rotateLeft(jn*this.keyRotateSpeed/this.domElement.clientHeight):this.enablePan&&this._pan(this.keyPanSpeed,0),n=!0;break;case this.keys.RIGHT:e.ctrlKey||e.metaKey||e.shiftKey?this.enableRotate&&this._rotateLeft(-jn*this.keyRotateSpeed/this.domElement.clientHeight):this.enablePan&&this._pan(-this.keyPanSpeed,0),n=!0;break}n&&(e.preventDefault(),this.update())}_handleTouchStartRotate(e){if(this._pointers.length===1)this._rotateStart.set(e.pageX,e.pageY);else{const n=this._getSecondPointerPosition(e),i=.5*(e.pageX+n.x),r=.5*(e.pageY+n.y);this._rotateStart.set(i,r)}}_handleTouchStartPan(e){if(this._pointers.length===1)this._panStart.set(e.pageX,e.pageY);else{const n=this._getSecondPointerPosition(e),i=.5*(e.pageX+n.x),r=.5*(e.pageY+n.y);this._panStart.set(i,r)}}_handleTouchStartDolly(e){const n=this._getSecondPointerPosition(e),i=e.pageX-n.x,r=e.pageY-n.y,s=Math.sqrt(i*i+r*r);this._dollyStart.set(0,s)}_handleTouchStartDollyPan(e){this.enableZoom&&this._handleTouchStartDolly(e),this.enablePan&&this._handleTouchStartPan(e)}_handleTouchStartDollyRotate(e){this.enableZoom&&this._handleTouchStartDolly(e),this.enableRotate&&this._handleTouchStartRotate(e)}_handleTouchMoveRotate(e){if(this._pointers.length==1)this._rotateEnd.set(e.pageX,e.pageY);else{const i=this._getSecondPointerPosition(e),r=.5*(e.pageX+i.x),s=.5*(e.pageY+i.y);this._rotateEnd.set(r,s)}this._rotateDelta.subVectors(this._rotateEnd,this._rotateStart).multiplyScalar(this.rotateSpeed);const n=this.domElement;this._rotateLeft(jn*this._rotateDelta.x/n.clientHeight),this._rotateUp(jn*this._rotateDelta.y/n.clientHeight),this._rotateStart.copy(this._rotateEnd)}_handleTouchMovePan(e){if(this._pointers.length===1)this._panEnd.set(e.pageX,e.pageY);else{const n=this._getSecondPointerPosition(e),i=.5*(e.pageX+n.x),r=.5*(e.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(e){const n=this._getSecondPointerPosition(e),i=e.pageX-n.x,r=e.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=(e.pageX+n.x)*.5,a=(e.pageY+n.y)*.5;this._updateZoomParameters(o,a)}_handleTouchMoveDollyPan(e){this.enableZoom&&this._handleTouchMoveDolly(e),this.enablePan&&this._handleTouchMovePan(e)}_handleTouchMoveDollyRotate(e){this.enableZoom&&this._handleTouchMoveDolly(e),this.enableRotate&&this._handleTouchMoveRotate(e)}_addPointer(e){this._pointers.push(e.pointerId)}_removePointer(e){delete this._pointerPositions[e.pointerId];for(let n=0;n.9&&(o.visible=!1)),this.axis==="Y"&&(qt.setFromEuler(Mc.set(0,0,Math.PI/2)),o.quaternion.copy(i).multiply(qt),Math.abs(kt.copy(Ws).applyQuaternion(i).dot(this.eye))>.9&&(o.visible=!1)),this.axis==="Z"&&(qt.setFromEuler(Mc.set(0,Math.PI/2,0)),o.quaternion.copy(i).multiply(qt),Math.abs(kt.copy(Ha).applyQuaternion(i).dot(this.eye))>.9&&(o.visible=!1)),this.axis==="XYZE"&&(qt.setFromEuler(Mc.set(0,Math.PI/2,0)),kt.copy(this.rotationAxis),o.quaternion.setFromRotationMatrix(x_.lookAt(__,kt,Ws)),o.quaternion.multiply(qt),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),An.set(1e-10,1e-10,1e-10).add(this.worldPositionStart).sub(this.worldPosition).multiplyScalar(-1),An.applyQuaternion(this.worldQuaternionStart.clone().invert()),o.scale.copy(An),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(kt.copy(Va).applyQuaternion(i).dot(this.eye))>.99&&(o.scale.set(1e-10,1e-10,1e-10),o.visible=!1),o.name==="Y"&&Math.abs(kt.copy(Ws).applyQuaternion(i).dot(this.eye))>.99&&(o.scale.set(1e-10,1e-10,1e-10),o.visible=!1),o.name==="Z"&&Math.abs(kt.copy(Ha).applyQuaternion(i).dot(this.eye))>.99&&(o.scale.set(1e-10,1e-10,1e-10),o.visible=!1),o.name==="XY"&&Math.abs(kt.copy(Ha).applyQuaternion(i).dot(this.eye))<.2&&(o.scale.set(1e-10,1e-10,1e-10),o.visible=!1),o.name==="YZ"&&Math.abs(kt.copy(Va).applyQuaternion(i).dot(this.eye))<.2&&(o.scale.set(1e-10,1e-10,1e-10),o.visible=!1),o.name==="XZ"&&Math.abs(kt.copy(Ws).applyQuaternion(i).dot(this.eye))<.2&&(o.scale.set(1e-10,1e-10,1e-10),o.visible=!1)):this.mode==="rotate"&&(Ec.copy(i),kt.copy(this.eye).applyQuaternion(qt.copy(i).invert()),o.name.search("E")!==-1&&o.quaternion.setFromRotationMatrix(x_.lookAt(this.eye,__,Ws)),o.name==="X"&&(qt.setFromAxisAngle(Va,Math.atan2(-kt.y,kt.z)),qt.multiplyQuaternions(Ec,qt),o.quaternion.copy(qt)),o.name==="Y"&&(qt.setFromAxisAngle(Ws,Math.atan2(kt.x,kt.z)),qt.multiplyQuaternions(Ec,qt),o.quaternion.copy(qt)),o.name==="Z"&&(qt.setFromAxisAngle(Ha,Math.atan2(kt.y,kt.x)),qt.multiplyQuaternions(Ec,qt),o.quaternion.copy(qt))),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(e)}}class aF extends Te{constructor(){super(new Cl(1e5,1e5,2,2),new Ms({visible:!1,wireframe:!0,side:Vn,transparent:!0,opacity:.1,toneMapped:!1})),this.isTransformControlsPlane=!0,this.type="TransformControlsPlane"}updateMatrixWorld(e){let n=this.space;switch(this.position.copy(this.worldPosition),this.mode==="scale"&&(n="local"),Tc.copy(Va).applyQuaternion(n==="local"?this.worldQuaternion:Hc),Ra.copy(Ws).applyQuaternion(n==="local"?this.worldQuaternion:Hc),Da.copy(Ha).applyQuaternion(n==="local"?this.worldQuaternion:Hc),kt.copy(Ra),this.mode){case"translate":case"scale":switch(this.axis){case"X":kt.copy(this.eye).cross(Tc),Gi.copy(Tc).cross(kt);break;case"Y":kt.copy(this.eye).cross(Ra),Gi.copy(Ra).cross(kt);break;case"Z":kt.copy(this.eye).cross(Da),Gi.copy(Da).cross(kt);break;case"XY":Gi.copy(Da);break;case"YZ":Gi.copy(Tc);break;case"XZ":kt.copy(Da),Gi.copy(Ra);break;case"XYZ":case"E":Gi.set(0,0,0);break}break;default:Gi.set(0,0,0)}Gi.length()===0?this.quaternion.copy(this.cameraQuaternion):(y_.lookAt(An.set(0,0,0),Gi,kt),this.quaternion.setFromRotationMatrix(y_)),super.updateMatrixWorld(e)}}const sr={},lo={};function lF(t){let e;switch(t.type.value){case"standard_material":e=cF(t);break;case"line_material":e=uF(t);break;case"point_material":e=dF(t);break;case"physical_material":e=fF(t);break}lo[t.guid.value]=e,sr[t.geometry_guid.value]=t.guid.value,gF(t.geometry_guid.value,e)}function cF(t){let e=t.color.value;e=e.replace("#","0x");let n=t.emissive.value;return n=n.replace("#","0x"),new mo({color:parseInt(e),metalness:t.metalness.value,roughness:t.roughness.value,emissive:parseInt(n),emissiveIntensity:t.emissive_intensity.value,flatShading:t.flat_shading.value,wireframe:t.wireframe.value,side:Vn})}function uF(t){let e=t.color.value;return e=e.replace("#","0x"),new Si({color:parseInt(e)})}function dF(t){let e=t.color.value;return e=e.replace("#","0x"),new qu({color:parseInt(e),size:t.size.value})}function fF(t){let e=t.color.value;e=e.replace("#","0x");let n=t.emissive.value;n=n.replace("#","0x");let i=t.attenuation_color.value;i=i.replace("#","0x");let r=t.sheen_color.value;r=r.replace("#","0x");let s=t.specular_color.value;return s=s.replace("#","0x"),new A2({color:parseInt(e),metalness:t.metalness.value,roughness:t.roughness.value,emissive:parseInt(n),emissiveIntensity:t.emissive_intensity.value,flatShading:t.flat_shading.value,wireframe:t.wireframe.value,side:Vn,anisotropy:t.anisotropy.value,anisotropyRotation:t.anisotropy_rotation.value,attenuationColor:parseInt(i),attenuationDistance:t.attenuation_distance.value,clearcoat:t.clearcoat.value,clearcoatRoughness:t.clearcoat_roughness.value,dispersion:t.dispersion.value,ior:t.ior.value,iridescence:t.iridescence.value,iridescenceIOR:t.iridescence_ior.value,iridescenceThicknessRange:[t.iridescence_thickness_start.value,t.iridescence_thickness_end.value],reflectivity:t.reflectivity.value,sheen:t.sheen.value,sheenColor:parseInt(r),specularColor:parseInt(s),sheenRoughness:t.sheen_roughness.value,specularIntensity:t.specular_intensity.value,thickness:t.thickness.value,transmission:t.transmission.value})}const Jn={},hF=["Line","Point","Vector","Frame","Plane","Polyline"];function pF(t){console.log(t.name),hF.includes(t.name)&&mF(t);const e=t.guid,n=Jn[e],i=t.buildGeometry();if(!i||!(i instanceof Te))return;const r=i.geometry;if(r.computeBoundingSphere(),r.computeBoundingBox(),n instanceof Te){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(sr[e]){const s=sr[e];lo[s]&&(i.material=lo[s])}else i.material=new mo({color:35071,roughness:.5,metalness:.5});if(Ot.add(i),Jn[e]=i,Yx.value){const s=new XP(i.geometry),o=new um(s,new Si({color:0}));o.layers.set(1),i.add(o)}}}function mF(t){const e=t.buildGeometry(),n=t.guid;let i;if(sr[n]){const r=sr[n];lo[r]&&(i=lo[r])}else return;e instanceof vn||e instanceof dm?e.material=i:(e instanceof bm||e instanceof void 0)&&e.setColor(i.color),Ot.add(e),Jn[n]=e}function gF(t,e){const n=Jn[t];if(n){if(n){n.material=e;return}(n instanceof bm||n instanceof void 0)&&n.setColor(e.color)}}let hu,Zo,Qo,b_=!1,S_=!1,w_;const vF=new mo({color:"orange",emissive:"yellow",emissiveIntensity:.1});function Fr(t){Qo&&Qo.setMode(t)}class _F{tControl;constructor(e){if(b_)throw new Error("TransformControlsManager has already been initialized.");this.tControl=new QO(Wt,nn.domElement),Ot.add(this.tControl.getHelper()),this.setupEventListeners(),b_=!0}setupEventListeners(){this.tControl.addEventListener("dragging-changed",e=>{In.enabled=!e.value}),window.addEventListener("keydown",e=>{if(!(e.altKey||e.ctrlKey||e.metaKey))switch(e.key){case"w":if(!yn.value)break;Fr("translate"),Nr.value="translate";break;case"e":if(!yn.value)break;Fr("rotate"),Nr.value="rotate";break;case"r":if(!yn.value)break;Fr("scale"),Nr.value="scale";break;case"p":yn.value=!yn.value;break;case"Escape":this.tControl.detach(),Gc();break}})}get controls(){return this.tControl}}class xF{raycaster;pickedObject;constructor(){if(S_)throw new Error("PickHelper has already been initialized.");this.raycaster=new Vb,this.raycaster.layers.set(0),this.pickedObject=null,this.setupEventListeners(),S_=!0}setupEventListeners(){window.addEventListener("keydown",e=>{e.key==="Escape"&&this.pickedObject&&(this.dehighlightObject(this.pickedObject),Gc())}),hu={x:0,y:0},window.addEventListener("mousedown",e=>{e.button===0&&(Qo.dragging||(bF(e),this.pick(hu,Ot)))})}getPickedObject(e){this.raycaster.setFromCamera(e,Wt);const n=this.raycaster.intersectObjects(Jn?Object.values(Jn):[],!0);return n.length?n[0].object:null}getPickedObjectKey(e){return Object.keys(Jn).find(n=>Jn[n]===e)}sendMessage(e){Em({dispatch:"object_picked",guid:e})}pick(e,n){if(!yn.value||Fu.value)return;const i=this.getPickedObject(e);if(i){this.pickedObject!==i&&this.pickedObject!==null&&(this.dehighlightObject(this.pickedObject),Gc()),this.pickedObject=i,Qo.attach(this.pickedObject);const r=this.getPickedObjectKey(this.pickedObject);r&&this.sendMessage(r),this.highlightObject(this.pickedObject)}else this.pickedObject&&(this.dehighlightObject(this.pickedObject),this.pickedObject=null,Qo.detach(),Gc())}dehighlightObject(e){const n=lo[w_];e.material=n}highlightObject(e){const n=Object.keys(Jn).find(i=>Jn[i]===e);w_=sr[n],e.material=vF}}function Gc(){tS({}),Rp.splice(0)}function yF(t){const e=Zo.getBoundingClientRect();return{x:(t.clientX-e.left)*(Zo.width/e.width),y:(t.clientY-e.top)*(Zo.height/e.height)}}function bF(t){const e=yF(t);hu.x=e.x/Zo.width*2-1,hu.y=e.y/Zo.height*-2+1}function SF(t){return Zo=document.querySelector("canvas"),Qo=new _F().controls,t}const wF=.5;let MF=15132390,EF=0,pu=null,mu=null;function TF(t){const e=t>>16&255,n=t>>8&255,i=t&255;return(e+n+i)/765}function AF(t){return TF(t){if(t.altKey||t.ctrlKey||t.metaKey)return;const e=LF(t.code);e&&(Mm(e),t.preventDefault())});window.addEventListener("resize",()=>{Wt.aspect=window.innerWidth/window.innerHeight,Wt.updateProjectionMatrix(),nn.setSize(window.innerWidth,window.innerHeight)});function Mm(t){const e=In.target.clone(),n=DF[t].clone().normalize(),i=Wt.position.distanceTo(e);Wt.position.copy(e.clone().add(n.multiplyScalar(i))),In.update()}function ms(t){Mm(t)}function LF(t){return IF.get(t)??null}function OF(t){switch(t.type.value){case"background_color":FF(t);break;case"controls_damping":In.enableDamping=t.damping.value;break;case"world_axis":Qb.visible=t.show.value;break;case"picker":yn.value=t.enabled.value;break;case"camera_fov":Wt.fov=t.fov.value,Wt.updateProjectionMatrix();break;case"camera_zoom":Wt.zoom=t.zoom.value,Wt.updateProjectionMatrix();break;case"camera_position":Wt.position.set(t.x.value,t.y.value,t.z.value),In.update();break;case"camera_target":In.target.set(t.x.value,t.y.value,t.z.value),In.update();break;case"camera_view":{const e=t.preset.value;e&&Mm(e);break}case"show_edges":Yx.value=t.show.value;break;default:console.warn("Unknown scene type:",t.type.value)}}function FF(t){let e=t.color.value;e=e.replace("#","0x"),e=parseInt(e),PF(e)}function UF(t){const e=t.guid.value;if(e in Jn){const n=Jn[e];Ot.remove(n),delete Jn[e]}e in sr&&delete sr[e]}class kF extends vn{constructor(e,n){const i=[1,1,0,-1,1,0,-1,-1,0,1,-1,0,1,1,0],r=new _t;r.setAttribute("position",new ct(i,3)),r.computeBoundingSphere();const s=new Si({fog:!1});super(r,s),this.light=e,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 _t;a.setAttribute("position",new ct(o,3)),a.computeBoundingSphere(),this.add(new Te(a,new Ms({side:Ln,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 e=this.material.color,n=Math.max(e.r,e.g,e.b);n>1&&e.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 wd extends Te{constructor(){const e=wd.SkyShader,n=new Fi({name:e.name,uniforms:Tb.clone(e.uniforms),vertexShader:e.vertexShader,fragmentShader:e.fragmentShader,side:Ln,depthWrite:!1});super(new Jt(1,1,1),n),this.isSky=!0}}wd.SkyShader={name:"SkyShader",uniforms:{turbidity:{value:2},rayleigh:{value:1},mieCoefficient:{value:.005},mieDirectionalG:{value:.8},sunPosition:{value:new N},up:{value:new N(0,1,0)}},vertexShader:` +}`;class LN{constructor(){this.texture=null,this.mesh=null,this.depthNear=0,this.depthFar=0}init(e,n){if(this.texture===null){const i=new Rb(e.texture);(e.depthNear!==n.depthNear||e.depthFar!==n.depthFar)&&(this.depthNear=e.depthNear,this.depthFar=e.depthFar),this.texture=i}}getMesh(e){if(this.texture!==null&&this.mesh===null){const n=e.cameras[0].viewport,i=new Fi({vertexShader:IN,fragmentShader:NN,uniforms:{depthColor:{value:this.texture},depthWidth:{value:n.z},depthHeight:{value:n.w}}});this.mesh=new be(new Cl(20,20),i)}return this.mesh}reset(){this.texture=null,this.mesh=null}getDepthTexture(){return this.texture}}class ON extends fo{constructor(e,n){super();const i=this;let r=null,s=1,o=null,a="local-floor",l=1,c=null,u=null,d=null,f=null,h=null,g=null;const v=typeof XRWebGLBinding<"u",m=new LN,p={},_=n.getContextAttributes();let y=null,x=null;const M=[],A=[],P=new xe;let D=null;const b=new Yn;b.viewport=new Zt;const w=new Yn;w.viewport=new Zt;const I=[b,w],L=new z2;let V=null,$=null;this.cameraAutoUpdate=!0,this.enabled=!1,this.isPresenting=!1,this.getController=function(ce){let ue=M[ce];return ue===void 0&&(ue=new Sf,M[ce]=ue),ue.getTargetRaySpace()},this.getControllerGrip=function(ce){let ue=M[ce];return ue===void 0&&(ue=new Sf,M[ce]=ue),ue.getGripSpace()},this.getHand=function(ce){let ue=M[ce];return ue===void 0&&(ue=new Sf,M[ce]=ue),ue.getHandSpace()};function X(ce){const ue=A.indexOf(ce.inputSource);if(ue===-1)return;const Le=M[ue];Le!==void 0&&(Le.update(ce.inputSource,ce.frame,c||o),Le.dispatchEvent({type:ce.type,data:ce.inputSource}))}function W(){r.removeEventListener("select",X),r.removeEventListener("selectstart",X),r.removeEventListener("selectend",X),r.removeEventListener("squeeze",X),r.removeEventListener("squeezestart",X),r.removeEventListener("squeezeend",X),r.removeEventListener("end",W),r.removeEventListener("inputsourceschange",B);for(let ce=0;ce=0&&(A[je]=null,M[je].disconnect(Le))}for(let ue=0;ue=A.length){A.push(Le),je=mt;break}else if(A[mt]===null){A[mt]=Le,je=mt;break}if(je===-1)break}const Ae=M[je];Ae&&Ae.connect(Le)}}const z=new N,de=new N;function le(ce,ue,Le){z.setFromMatrixPosition(ue.matrixWorld),de.setFromMatrixPosition(Le.matrixWorld);const je=z.distanceTo(de),Ae=ue.projectionMatrix.elements,mt=Le.projectionMatrix.elements,O=Ae[14]/(Ae[10]-1),k=Ae[14]/(Ae[10]+1),U=(Ae[9]+1)/Ae[5],q=(Ae[9]-1)/Ae[5],H=(Ae[8]-1)/Ae[0],Y=(mt[8]+1)/mt[0],C=O*H,ae=O*Y,Q=je/(-H+Y),ee=Q*-H;if(ue.matrixWorld.decompose(ce.position,ce.quaternion,ce.scale),ce.translateX(ee),ce.translateZ(Q),ce.matrixWorld.compose(ce.position,ce.quaternion,ce.scale),ce.matrixWorldInverse.copy(ce.matrixWorld).invert(),Ae[10]===-1)ce.projectionMatrix.copy(ue.projectionMatrix),ce.projectionMatrixInverse.copy(ue.projectionMatrixInverse);else{const oe=O+Q,T=k+Q,S=C-ee,F=ae+(je-ee),J=U*k/T*oe,se=q*k/T*oe;ce.projectionMatrix.makePerspective(S,F,J,se,oe,T),ce.projectionMatrixInverse.copy(ce.projectionMatrix).invert()}}function pe(ce,ue){ue===null?ce.matrixWorld.copy(ce.matrix):ce.matrixWorld.multiplyMatrices(ue.matrixWorld,ce.matrix),ce.matrixWorldInverse.copy(ce.matrixWorld).invert()}this.updateCamera=function(ce){if(r===null)return;let ue=ce.near,Le=ce.far;m.texture!==null&&(m.depthNear>0&&(ue=m.depthNear),m.depthFar>0&&(Le=m.depthFar)),L.near=w.near=b.near=ue,L.far=w.far=b.far=Le,(V!==L.near||$!==L.far)&&(r.updateRenderState({depthNear:L.near,depthFar:L.far}),V=L.near,$=L.far),L.layers.mask=ce.layers.mask|6,b.layers.mask=L.layers.mask&3,w.layers.mask=L.layers.mask&5;const je=ce.parent,Ae=L.cameras;pe(L,je);for(let mt=0;mt0&&(m.alphaTest.value=p.alphaTest);const _=e.get(p),y=_.envMap,x=_.envMapRotation;y&&(m.envMap.value=y,zs.copy(x),zs.x*=-1,zs.y*=-1,zs.z*=-1,y.isCubeTexture&&y.isRenderTargetTexture===!1&&(zs.y*=-1,zs.z*=-1),m.envMapRotation.value.setFromMatrix4(FN.makeRotationFromEuler(zs)),m.flipEnvMap.value=y.isCubeTexture&&y.isRenderTargetTexture===!1?-1:1,m.reflectivity.value=p.reflectivity,m.ior.value=p.ior,m.refractionRatio.value=p.refractionRatio),p.lightMap&&(m.lightMap.value=p.lightMap,m.lightMapIntensity.value=p.lightMapIntensity,n(p.lightMap,m.lightMapTransform)),p.aoMap&&(m.aoMap.value=p.aoMap,m.aoMapIntensity.value=p.aoMapIntensity,n(p.aoMap,m.aoMapTransform))}function o(m,p){m.diffuse.value.copy(p.color),m.opacity.value=p.opacity,p.map&&(m.map.value=p.map,n(p.map,m.mapTransform))}function a(m,p){m.dashSize.value=p.dashSize,m.totalSize.value=p.dashSize+p.gapSize,m.scale.value=p.scale}function l(m,p,_,y){m.diffuse.value.copy(p.color),m.opacity.value=p.opacity,m.size.value=p.size*_,m.scale.value=y*.5,p.map&&(m.map.value=p.map,n(p.map,m.uvTransform)),p.alphaMap&&(m.alphaMap.value=p.alphaMap,n(p.alphaMap,m.alphaMapTransform)),p.alphaTest>0&&(m.alphaTest.value=p.alphaTest)}function c(m,p){m.diffuse.value.copy(p.color),m.opacity.value=p.opacity,m.rotation.value=p.rotation,p.map&&(m.map.value=p.map,n(p.map,m.mapTransform)),p.alphaMap&&(m.alphaMap.value=p.alphaMap,n(p.alphaMap,m.alphaMapTransform)),p.alphaTest>0&&(m.alphaTest.value=p.alphaTest)}function u(m,p){m.specular.value.copy(p.specular),m.shininess.value=Math.max(p.shininess,1e-4)}function d(m,p){p.gradientMap&&(m.gradientMap.value=p.gradientMap)}function f(m,p){m.metalness.value=p.metalness,p.metalnessMap&&(m.metalnessMap.value=p.metalnessMap,n(p.metalnessMap,m.metalnessMapTransform)),m.roughness.value=p.roughness,p.roughnessMap&&(m.roughnessMap.value=p.roughnessMap,n(p.roughnessMap,m.roughnessMapTransform)),p.envMap&&(m.envMapIntensity.value=p.envMapIntensity)}function h(m,p,_){m.ior.value=p.ior,p.sheen>0&&(m.sheenColor.value.copy(p.sheenColor).multiplyScalar(p.sheen),m.sheenRoughness.value=p.sheenRoughness,p.sheenColorMap&&(m.sheenColorMap.value=p.sheenColorMap,n(p.sheenColorMap,m.sheenColorMapTransform)),p.sheenRoughnessMap&&(m.sheenRoughnessMap.value=p.sheenRoughnessMap,n(p.sheenRoughnessMap,m.sheenRoughnessMapTransform))),p.clearcoat>0&&(m.clearcoat.value=p.clearcoat,m.clearcoatRoughness.value=p.clearcoatRoughness,p.clearcoatMap&&(m.clearcoatMap.value=p.clearcoatMap,n(p.clearcoatMap,m.clearcoatMapTransform)),p.clearcoatRoughnessMap&&(m.clearcoatRoughnessMap.value=p.clearcoatRoughnessMap,n(p.clearcoatRoughnessMap,m.clearcoatRoughnessMapTransform)),p.clearcoatNormalMap&&(m.clearcoatNormalMap.value=p.clearcoatNormalMap,n(p.clearcoatNormalMap,m.clearcoatNormalMapTransform),m.clearcoatNormalScale.value.copy(p.clearcoatNormalScale),p.side===Ln&&m.clearcoatNormalScale.value.negate())),p.dispersion>0&&(m.dispersion.value=p.dispersion),p.iridescence>0&&(m.iridescence.value=p.iridescence,m.iridescenceIOR.value=p.iridescenceIOR,m.iridescenceThicknessMinimum.value=p.iridescenceThicknessRange[0],m.iridescenceThicknessMaximum.value=p.iridescenceThicknessRange[1],p.iridescenceMap&&(m.iridescenceMap.value=p.iridescenceMap,n(p.iridescenceMap,m.iridescenceMapTransform)),p.iridescenceThicknessMap&&(m.iridescenceThicknessMap.value=p.iridescenceThicknessMap,n(p.iridescenceThicknessMap,m.iridescenceThicknessMapTransform))),p.transmission>0&&(m.transmission.value=p.transmission,m.transmissionSamplerMap.value=_.texture,m.transmissionSamplerSize.value.set(_.width,_.height),p.transmissionMap&&(m.transmissionMap.value=p.transmissionMap,n(p.transmissionMap,m.transmissionMapTransform)),m.thickness.value=p.thickness,p.thicknessMap&&(m.thicknessMap.value=p.thicknessMap,n(p.thicknessMap,m.thicknessMapTransform)),m.attenuationDistance.value=p.attenuationDistance,m.attenuationColor.value.copy(p.attenuationColor)),p.anisotropy>0&&(m.anisotropyVector.value.set(p.anisotropy*Math.cos(p.anisotropyRotation),p.anisotropy*Math.sin(p.anisotropyRotation)),p.anisotropyMap&&(m.anisotropyMap.value=p.anisotropyMap,n(p.anisotropyMap,m.anisotropyMapTransform))),m.specularIntensity.value=p.specularIntensity,m.specularColor.value.copy(p.specularColor),p.specularColorMap&&(m.specularColorMap.value=p.specularColorMap,n(p.specularColorMap,m.specularColorMapTransform)),p.specularIntensityMap&&(m.specularIntensityMap.value=p.specularIntensityMap,n(p.specularIntensityMap,m.specularIntensityMapTransform))}function g(m,p){p.matcap&&(m.matcap.value=p.matcap)}function v(m,p){const _=e.get(p).light;m.referencePosition.value.setFromMatrixPosition(_.matrixWorld),m.nearDistance.value=_.shadow.camera.near,m.farDistance.value=_.shadow.camera.far}return{refreshFogUniforms:i,refreshMaterialUniforms:r}}function kN(t,e,n,i){let r={},s={},o=[];const a=t.getParameter(t.MAX_UNIFORM_BUFFER_BINDINGS);function l(_,y){const x=y.program;i.uniformBlockBinding(_,x)}function c(_,y){let x=r[_.id];x===void 0&&(g(_),x=u(_),r[_.id]=x,_.addEventListener("dispose",m));const M=y.program;i.updateUBOMapping(_,M);const A=e.render.frame;s[_.id]!==A&&(f(_),s[_.id]=A)}function u(_){const y=d();_.__bindingPointIndex=y;const x=t.createBuffer(),M=_.__size,A=_.usage;return t.bindBuffer(t.UNIFORM_BUFFER,x),t.bufferData(t.UNIFORM_BUFFER,M,A),t.bindBuffer(t.UNIFORM_BUFFER,null),t.bindBufferBase(t.UNIFORM_BUFFER,y,x),x}function d(){for(let _=0;_0&&(x+=M-A),_.__size=x,_.__cache={},this}function v(_){const y={boundary:0,storage:0};return typeof _=="number"||typeof _=="boolean"?(y.boundary=4,y.storage=4):_.isVector2?(y.boundary=8,y.storage=8):_.isVector3||_.isColor?(y.boundary=16,y.storage=12):_.isVector4?(y.boundary=16,y.storage=16):_.isMatrix3?(y.boundary=48,y.storage=48):_.isMatrix4?(y.boundary=64,y.storage=64):_.isTexture?it("WebGLRenderer: Texture samplers can not be part of an uniforms group."):it("WebGLRenderer: Unsupported uniform value type.",_),y}function m(_){const y=_.target;y.removeEventListener("dispose",m);const x=o.indexOf(y.__bindingPointIndex);o.splice(x,1),t.deleteBuffer(r[y.id]),delete r[y.id],delete s[y.id]}function p(){for(const _ in r)t.deleteBuffer(r[_]);o=[],r={},s={}}return{bind:l,update:c,dispose:p}}const BN=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 Hi=null;function zN(){return Hi===null&&(Hi=new VP(BN,16,16,sa,qr),Hi.name="DFG_LUT",Hi.minFilter=Dn,Hi.magFilter=Dn,Hi.wrapS=Ir,Hi.wrapT=Ir,Hi.generateMipmaps=!1,Hi.needsUpdate=!0),Hi}class VN{constructor(e={}){const{canvas:n=eP(),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:d=!1,reversedDepthBuffer:f=!1,outputBufferType:h=li}=e;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=h,m=new Set([im,nm,tm]),p=new Set([li,rr,cl,ul,Qp,em]),_=new Uint32Array(4),y=new Int32Array(4);let x=null,M=null;const A=[],P=[];let D=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=nr,this.toneMappingExposure=1,this.transmissionResolutionScale=1;const b=this;let w=!1;this._outputColorSpace=oi;let I=0,L=0,V=null,$=-1,X=null;const W=new Zt,B=new Zt;let z=null;const de=new nt(0);let le=0,pe=n.width,He=n.height,ze=1,st=null,xt=null;const ce=new Zt(0,0,pe,He),ue=new Zt(0,0,pe,He);let Le=!1;const je=new cm;let Ae=!1,mt=!1;const O=new yt,k=new N,U=new Zt,q={background:null,fog:null,environment:null,overrideMaterial:null,isScene:!0};let H=!1;function Y(){return V===null?ze:1}let C=i;function ae(R,j){return n.getContext(R,j)}try{const R={alpha:!0,depth:r,stencil:s,antialias:a,premultipliedAlpha:l,preserveDrawingBuffer:c,powerPreference:u,failIfMajorPerformanceCaveat:d};if("setAttribute"in n&&n.setAttribute("data-engine",`three.js r${Jp}`),n.addEventListener("webglcontextlost",lt,!1),n.addEventListener("webglcontextrestored",Vt,!1),n.addEventListener("webglcontextcreationerror",Pt,!1),C===null){const j="webgl2";if(C=ae(j,R),C===null)throw ae(j)?new Error("Error creating WebGL context with your selected attributes."):new Error("Error creating WebGL context.")}}catch(R){throw bt("WebGLRenderer: "+R.message),R}let Q,ee,oe,T,S,F,J,se,K,Ce,ve,Oe,$e,ge,Ee,Pe,Be,we,dt,G,Ue,ye,Ve,_e;function he(){Q=new zD(C),Q.init(),ye=new DN(C,Q),ee=new DD(C,Q,e,ye),oe=new PN(C,Q),ee.reversedDepthBuffer&&f&&oe.buffers.depth.setReversed(!0),T=new GD(C),S=new pN,F=new RN(C,Q,oe,S,ee,ye,T),J=new ND(b),se=new BD(b),K=new $2(C),Ve=new PD(C,K),Ce=new VD(C,K,T,Ve),ve=new qD(C,Ce,K,T),dt=new WD(C,ee,F),Pe=new ID(S),Oe=new hN(b,J,se,Q,ee,Ve,Pe),$e=new UN(b,S),ge=new gN,Ee=new SN(Q),we=new CD(b,J,se,oe,ve,g,l),Be=new AN(b,ve,ee),_e=new kN(C,T,ee,oe),G=new RD(C,Q,T),Ue=new HD(C,Q,T),T.programs=Oe.programs,b.capabilities=ee,b.extensions=Q,b.properties=S,b.renderLists=ge,b.shadowMap=Be,b.state=oe,b.info=T}he(),v!==li&&(D=new $D(v,n.width,n.height,r,s));const Te=new ON(b,C);this.xr=Te,this.getContext=function(){return C},this.getContextAttributes=function(){return C.getContextAttributes()},this.forceContextLoss=function(){const R=Q.get("WEBGL_lose_context");R&&R.loseContext()},this.forceContextRestore=function(){const R=Q.get("WEBGL_lose_context");R&&R.restoreContext()},this.getPixelRatio=function(){return ze},this.setPixelRatio=function(R){R!==void 0&&(ze=R,this.setSize(pe,He,!1))},this.getSize=function(R){return R.set(pe,He)},this.setSize=function(R,j,re=!0){if(Te.isPresenting){it("WebGLRenderer: Can't change size while VR device is presenting.");return}pe=R,He=j,n.width=Math.floor(R*ze),n.height=Math.floor(j*ze),re===!0&&(n.style.width=R+"px",n.style.height=j+"px"),D!==null&&D.setSize(n.width,n.height),this.setViewport(0,0,R,j)},this.getDrawingBufferSize=function(R){return R.set(pe*ze,He*ze).floor()},this.setDrawingBufferSize=function(R,j,re){pe=R,He=j,ze=re,n.width=Math.floor(R*re),n.height=Math.floor(j*re),this.setViewport(0,0,R,j)},this.setEffects=function(R){if(v===li){console.error("THREE.WebGLRenderer: setEffects() requires outputBufferType set to HalfFloatType or FloatType.");return}if(R){for(let j=0;j{function Re(){if(ne.forEach(function(Ge){S.get(Ge).currentProgram.isReady()&&ne.delete(Ge)}),ne.size===0){Z(R);return}setTimeout(Re,10)}Q.get("KHR_parallel_shader_compile")!==null?Re():setTimeout(Re,10)})};let Ed=null;function dS(R){Ed&&Ed(R)}function Pm(){Ts.stop()}function Rm(){Ts.start()}const Ts=new Wb;Ts.setAnimationLoop(dS),typeof self<"u"&&Ts.setContext(self),this.setAnimationLoop=function(R){Ed=R,Te.setAnimationLoop(R),R===null?Ts.stop():Ts.start()},Te.addEventListener("sessionstart",Pm),Te.addEventListener("sessionend",Rm),this.render=function(R,j){if(j!==void 0&&j.isCamera!==!0){bt("WebGLRenderer.render: camera is not an instance of THREE.Camera.");return}if(w===!0)return;const re=Te.enabled===!0&&Te.isPresenting===!0,ne=D!==null&&(V===null||re)&&D.begin(b,V);if(R.matrixWorldAutoUpdate===!0&&R.updateMatrixWorld(),j.parent===null&&j.matrixWorldAutoUpdate===!0&&j.updateMatrixWorld(),Te.enabled===!0&&Te.isPresenting===!0&&(D===null||D.isCompositing()===!1)&&(Te.cameraAutoUpdate===!0&&Te.updateCamera(j),j=Te.getCamera()),R.isScene===!0&&R.onBeforeRender(b,R,j,V),M=Ee.get(R,P.length),M.init(j),P.push(M),O.multiplyMatrices(j.projectionMatrix,j.matrixWorldInverse),je.setFromProjectionMatrix(O,Zi,j.reversedDepth),mt=this.localClippingEnabled,Ae=Pe.init(this.clippingPlanes,mt),x=ge.get(R,A.length),x.init(),A.push(x),Te.enabled===!0&&Te.isPresenting===!0){const Ge=b.xr.getDepthSensingMesh();Ge!==null&&Td(Ge,j,-1/0,b.sortObjects)}Td(R,j,0,b.sortObjects),x.finish(),b.sortObjects===!0&&x.sort(st,xt),H=Te.enabled===!1||Te.isPresenting===!1||Te.hasDepthSensing()===!1,H&&we.addToRenderList(x,R),this.info.render.frame++,Ae===!0&&Pe.beginShadows();const Z=M.state.shadowsArray;if(Be.render(Z,R,j),Ae===!0&&Pe.endShadows(),this.info.autoReset===!0&&this.info.reset(),(ne&&D.hasRenderPass())===!1){const Ge=x.opaque,Fe=x.transmissive;if(M.setupLights(),j.isArrayCamera){const Xe=j.cameras;if(Fe.length>0)for(let Ke=0,rt=Xe.length;Ke0&&Im(Ge,Fe,R,j),H&&we.render(R),Dm(x,R,j)}V!==null&&L===0&&(F.updateMultisampleRenderTarget(V),F.updateRenderTargetMipmap(V)),ne&&D.end(b),R.isScene===!0&&R.onAfterRender(b,R,j),Ve.resetDefaultState(),$=-1,X=null,P.pop(),P.length>0?(M=P[P.length-1],Ae===!0&&Pe.setGlobalState(b.clippingPlanes,M.state.camera)):M=null,A.pop(),A.length>0?x=A[A.length-1]:x=null};function Td(R,j,re,ne){if(R.visible===!1)return;if(R.layers.test(j.layers)){if(R.isGroup)re=R.renderOrder;else if(R.isLOD)R.autoUpdate===!0&&R.update(j);else if(R.isLight)M.pushLight(R),R.castShadow&&M.pushShadow(R);else if(R.isSprite){if(!R.frustumCulled||je.intersectsSprite(R)){ne&&U.setFromMatrixPosition(R.matrixWorld).applyMatrix4(O);const Ge=ve.update(R),Fe=R.material;Fe.visible&&x.push(R,Ge,Fe,re,U.z,null)}}else if((R.isMesh||R.isLine||R.isPoints)&&(!R.frustumCulled||je.intersectsObject(R))){const Ge=ve.update(R),Fe=R.material;if(ne&&(R.boundingSphere!==void 0?(R.boundingSphere===null&&R.computeBoundingSphere(),U.copy(R.boundingSphere.center)):(Ge.boundingSphere===null&&Ge.computeBoundingSphere(),U.copy(Ge.boundingSphere.center)),U.applyMatrix4(R.matrixWorld).applyMatrix4(O)),Array.isArray(Fe)){const Xe=Ge.groups;for(let Ke=0,rt=Xe.length;Ke0&&Dl(Z,j,re),Re.length>0&&Dl(Re,j,re),Ge.length>0&&Dl(Ge,j,re),oe.buffers.depth.setTest(!0),oe.buffers.depth.setMask(!0),oe.buffers.color.setMask(!0),oe.setPolygonOffset(!1)}function Im(R,j,re,ne){if((re.isScene===!0?re.overrideMaterial:null)!==null)return;if(M.state.transmissionRenderTarget[ne.id]===void 0){const vt=Q.has("EXT_color_buffer_half_float")||Q.has("EXT_color_buffer_float");M.state.transmissionRenderTarget[ne.id]=new ir(1,1,{generateMipmaps:!0,type:vt?qr:li,minFilter:Js,samples:ee.samples,stencilBuffer:s,resolveDepthBuffer:!1,resolveStencilBuffer:!1,colorSpace:wt.workingColorSpace})}const Re=M.state.transmissionRenderTarget[ne.id],Ge=ne.viewport||W;Re.setSize(Ge.z*b.transmissionResolutionScale,Ge.w*b.transmissionResolutionScale);const Fe=b.getRenderTarget(),Xe=b.getActiveCubeFace(),Ke=b.getActiveMipmapLevel();b.setRenderTarget(Re),b.getClearColor(de),le=b.getClearAlpha(),le<1&&b.setClearColor(16777215,.5),b.clear(),H&&we.render(re);const rt=b.toneMapping;b.toneMapping=nr;const et=ne.viewport;if(ne.viewport!==void 0&&(ne.viewport=void 0),M.setupLightsView(ne),Ae===!0&&Pe.setGlobalState(b.clippingPlanes,ne),Dl(R,re,ne),F.updateMultisampleRenderTarget(Re),F.updateRenderTargetMipmap(Re),Q.has("WEBGL_multisampled_render_to_texture")===!1){let vt=!1;for(let Nt=0,jt=j.length;Nt0),et=!!re.morphAttributes.position,vt=!!re.morphAttributes.normal,Nt=!!re.morphAttributes.color;let jt=nr;ne.toneMapped&&(V===null||V.isXRRenderTarget===!0)&&(jt=b.toneMapping);const Yt=re.morphAttributes.position||re.morphAttributes.normal||re.morphAttributes.color,Ut=Yt!==void 0?Yt.length:0,tt=S.get(ne),Rt=M.state.lights;if(Ae===!0&&(mt===!0||R!==X)){const Fn=R===X&&ne.id===$;Pe.setState(ne,R,Fn)}let Mt=!1;ne.version===tt.__version?(tt.needsLights&&tt.lightsStateVersion!==Rt.state.version||tt.outputColorSpace!==Fe||Z.isBatchedMesh&&tt.batching===!1||!Z.isBatchedMesh&&tt.batching===!0||Z.isBatchedMesh&&tt.batchingColor===!0&&Z.colorTexture===null||Z.isBatchedMesh&&tt.batchingColor===!1&&Z.colorTexture!==null||Z.isInstancedMesh&&tt.instancing===!1||!Z.isInstancedMesh&&tt.instancing===!0||Z.isSkinnedMesh&&tt.skinning===!1||!Z.isSkinnedMesh&&tt.skinning===!0||Z.isInstancedMesh&&tt.instancingColor===!0&&Z.instanceColor===null||Z.isInstancedMesh&&tt.instancingColor===!1&&Z.instanceColor!==null||Z.isInstancedMesh&&tt.instancingMorph===!0&&Z.morphTexture===null||Z.isInstancedMesh&&tt.instancingMorph===!1&&Z.morphTexture!==null||tt.envMap!==Xe||ne.fog===!0&&tt.fog!==Re||tt.numClippingPlanes!==void 0&&(tt.numClippingPlanes!==Pe.numPlanes||tt.numIntersection!==Pe.numIntersection)||tt.vertexAlphas!==Ke||tt.vertexTangents!==rt||tt.morphTargets!==et||tt.morphNormals!==vt||tt.morphColors!==Nt||tt.toneMapping!==jt||tt.morphTargetsCount!==Ut)&&(Mt=!0):(Mt=!0,tt.__version=ne.version);let ni=tt.currentProgram;Mt===!0&&(ni=Il(ne,j,Z));let go=!1,ii=!1,_a=!1;const Ht=ni.getUniforms(),Xn=tt.uniforms;if(oe.useProgram(ni.program)&&(go=!0,ii=!0,_a=!0),ne.id!==$&&($=ne.id,ii=!0),go||X!==R){oe.buffers.depth.getReversed()&&R.reversedDepth!==!0&&(R._reversedDepth=!0,R.updateProjectionMatrix()),Ht.setValue(C,"projectionMatrix",R.projectionMatrix),Ht.setValue(C,"viewMatrix",R.matrixWorldInverse);const $n=Ht.map.cameraPosition;$n!==void 0&&$n.setValue(C,k.setFromMatrixPosition(R.matrixWorld)),ee.logarithmicDepthBuffer&&Ht.setValue(C,"logDepthBufFC",2/(Math.log(R.far+1)/Math.LN2)),(ne.isMeshPhongMaterial||ne.isMeshToonMaterial||ne.isMeshLambertMaterial||ne.isMeshBasicMaterial||ne.isMeshStandardMaterial||ne.isShaderMaterial)&&Ht.setValue(C,"isOrthographic",R.isOrthographicCamera===!0),X!==R&&(X=R,ii=!0,_a=!0)}if(tt.needsLights&&(Rt.state.directionalShadowMap.length>0&&Ht.setValue(C,"directionalShadowMap",Rt.state.directionalShadowMap,F),Rt.state.spotShadowMap.length>0&&Ht.setValue(C,"spotShadowMap",Rt.state.spotShadowMap,F),Rt.state.pointShadowMap.length>0&&Ht.setValue(C,"pointShadowMap",Rt.state.pointShadowMap,F)),Z.isSkinnedMesh){Ht.setOptional(C,Z,"bindMatrix"),Ht.setOptional(C,Z,"bindMatrixInverse");const Fn=Z.skeleton;Fn&&(Fn.boneTexture===null&&Fn.computeBoneTexture(),Ht.setValue(C,"boneTexture",Fn.boneTexture,F))}Z.isBatchedMesh&&(Ht.setOptional(C,Z,"batchingTexture"),Ht.setValue(C,"batchingTexture",Z._matricesTexture,F),Ht.setOptional(C,Z,"batchingIdTexture"),Ht.setValue(C,"batchingIdTexture",Z._indirectTexture,F),Ht.setOptional(C,Z,"batchingColorTexture"),Z._colorsTexture!==null&&Ht.setValue(C,"batchingColorTexture",Z._colorsTexture,F));const pi=re.morphAttributes;if((pi.position!==void 0||pi.normal!==void 0||pi.color!==void 0)&&dt.update(Z,re,ni),(ii||tt.receiveShadow!==Z.receiveShadow)&&(tt.receiveShadow=Z.receiveShadow,Ht.setValue(C,"receiveShadow",Z.receiveShadow)),ne.isMeshGouraudMaterial&&ne.envMap!==null&&(Xn.envMap.value=Xe,Xn.flipEnvMap.value=Xe.isCubeTexture&&Xe.isRenderTargetTexture===!1?-1:1),ne.isMeshStandardMaterial&&ne.envMap===null&&j.environment!==null&&(Xn.envMapIntensity.value=j.environmentIntensity),Xn.dfgLUT!==void 0&&(Xn.dfgLUT.value=zN()),ii&&(Ht.setValue(C,"toneMappingExposure",b.toneMappingExposure),tt.needsLights&&hS(Xn,_a),Re&&ne.fog===!0&&$e.refreshFogUniforms(Xn,Re),$e.refreshMaterialUniforms(Xn,ne,ze,He,M.state.transmissionRenderTarget[R.id]),Vc.upload(C,Lm(tt),Xn,F)),ne.isShaderMaterial&&ne.uniformsNeedUpdate===!0&&(Vc.upload(C,Lm(tt),Xn,F),ne.uniformsNeedUpdate=!1),ne.isSpriteMaterial&&Ht.setValue(C,"center",Z.center),Ht.setValue(C,"modelViewMatrix",Z.modelViewMatrix),Ht.setValue(C,"normalMatrix",Z.normalMatrix),Ht.setValue(C,"modelMatrix",Z.matrixWorld),ne.isShaderMaterial||ne.isRawShaderMaterial){const Fn=ne.uniformsGroups;for(let $n=0,Ad=Fn.length;$n0&&F.useMultisampledRTT(R)===!1?ne=S.get(R).__webglMultisampledFramebuffer:Array.isArray(Ke)?ne=Ke[re]:ne=Ke,W.copy(R.viewport),B.copy(R.scissor),z=R.scissorTest}else W.copy(ce).multiplyScalar(ze).floor(),B.copy(ue).multiplyScalar(ze).floor(),z=Le;if(re!==0&&(ne=mS),oe.bindFramebuffer(C.FRAMEBUFFER,ne)&&oe.drawBuffers(R,ne),oe.viewport(W),oe.scissor(B),oe.setScissorTest(z),Z){const Fe=S.get(R.texture);C.framebufferTexture2D(C.FRAMEBUFFER,C.COLOR_ATTACHMENT0,C.TEXTURE_CUBE_MAP_POSITIVE_X+j,Fe.__webglTexture,re)}else if(Re){const Fe=j;for(let Xe=0;Xe=0&&j<=R.width-ne&&re>=0&&re<=R.height-Z&&(R.textures.length>1&&C.readBuffer(C.COLOR_ATTACHMENT0+Fe),C.readPixels(j,re,ne,Z,ye.convert(rt),ye.convert(et),Re))}finally{const Ke=V!==null?S.get(V).__webglFramebuffer:null;oe.bindFramebuffer(C.FRAMEBUFFER,Ke)}}},this.readRenderTargetPixelsAsync=async function(R,j,re,ne,Z,Re,Ge,Fe=0){if(!(R&&R.isWebGLRenderTarget))throw new Error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not THREE.WebGLRenderTarget.");let Xe=S.get(R).__webglFramebuffer;if(R.isWebGLCubeRenderTarget&&Ge!==void 0&&(Xe=Xe[Ge]),Xe)if(j>=0&&j<=R.width-ne&&re>=0&&re<=R.height-Z){oe.bindFramebuffer(C.FRAMEBUFFER,Xe);const Ke=R.textures[Fe],rt=Ke.format,et=Ke.type;if(!ee.textureFormatReadable(rt))throw new Error("THREE.WebGLRenderer.readRenderTargetPixelsAsync: renderTarget is not in RGBA or implementation defined format.");if(!ee.textureTypeReadable(et))throw new Error("THREE.WebGLRenderer.readRenderTargetPixelsAsync: renderTarget is not in UnsignedByteType or implementation defined type.");const vt=C.createBuffer();C.bindBuffer(C.PIXEL_PACK_BUFFER,vt),C.bufferData(C.PIXEL_PACK_BUFFER,Re.byteLength,C.STREAM_READ),R.textures.length>1&&C.readBuffer(C.COLOR_ATTACHMENT0+Fe),C.readPixels(j,re,ne,Z,ye.convert(rt),ye.convert(et),0);const Nt=V!==null?S.get(V).__webglFramebuffer:null;oe.bindFramebuffer(C.FRAMEBUFFER,Nt);const jt=C.fenceSync(C.SYNC_GPU_COMMANDS_COMPLETE,0);return C.flush(),await tP(C,jt,4),C.bindBuffer(C.PIXEL_PACK_BUFFER,vt),C.getBufferSubData(C.PIXEL_PACK_BUFFER,0,Re),C.deleteBuffer(vt),C.deleteSync(jt),Re}else throw new Error("THREE.WebGLRenderer.readRenderTargetPixelsAsync: requested read bounds are out of range.")},this.copyFramebufferToTexture=function(R,j=null,re=0){const ne=Math.pow(2,-re),Z=Math.floor(R.image.width*ne),Re=Math.floor(R.image.height*ne),Ge=j!==null?j.x:0,Fe=j!==null?j.y:0;F.setTexture2D(R,0),C.copyTexSubImage2D(C.TEXTURE_2D,re,0,0,Ge,Fe,Z,Re),oe.unbindTexture()};const gS=C.createFramebuffer(),vS=C.createFramebuffer();this.copyTextureToTexture=function(R,j,re=null,ne=null,Z=0,Re=null){Re===null&&(Z!==0?(dl("WebGLRenderer: copyTextureToTexture function signature has changed to support src and dst mipmap levels."),Re=Z,Z=0):Re=0);let Ge,Fe,Xe,Ke,rt,et,vt,Nt,jt;const Yt=R.isCompressedTexture?R.mipmaps[Re]:R.image;if(re!==null)Ge=re.max.x-re.min.x,Fe=re.max.y-re.min.y,Xe=re.isBox3?re.max.z-re.min.z:1,Ke=re.min.x,rt=re.min.y,et=re.isBox3?re.min.z:0;else{const pi=Math.pow(2,-Z);Ge=Math.floor(Yt.width*pi),Fe=Math.floor(Yt.height*pi),R.isDataArrayTexture?Xe=Yt.depth:R.isData3DTexture?Xe=Math.floor(Yt.depth*pi):Xe=1,Ke=0,rt=0,et=0}ne!==null?(vt=ne.x,Nt=ne.y,jt=ne.z):(vt=0,Nt=0,jt=0);const Ut=ye.convert(j.format),tt=ye.convert(j.type);let Rt;j.isData3DTexture?(F.setTexture3D(j,0),Rt=C.TEXTURE_3D):j.isDataArrayTexture||j.isCompressedArrayTexture?(F.setTexture2DArray(j,0),Rt=C.TEXTURE_2D_ARRAY):(F.setTexture2D(j,0),Rt=C.TEXTURE_2D),C.pixelStorei(C.UNPACK_FLIP_Y_WEBGL,j.flipY),C.pixelStorei(C.UNPACK_PREMULTIPLY_ALPHA_WEBGL,j.premultiplyAlpha),C.pixelStorei(C.UNPACK_ALIGNMENT,j.unpackAlignment);const Mt=C.getParameter(C.UNPACK_ROW_LENGTH),ni=C.getParameter(C.UNPACK_IMAGE_HEIGHT),go=C.getParameter(C.UNPACK_SKIP_PIXELS),ii=C.getParameter(C.UNPACK_SKIP_ROWS),_a=C.getParameter(C.UNPACK_SKIP_IMAGES);C.pixelStorei(C.UNPACK_ROW_LENGTH,Yt.width),C.pixelStorei(C.UNPACK_IMAGE_HEIGHT,Yt.height),C.pixelStorei(C.UNPACK_SKIP_PIXELS,Ke),C.pixelStorei(C.UNPACK_SKIP_ROWS,rt),C.pixelStorei(C.UNPACK_SKIP_IMAGES,et);const Ht=R.isDataArrayTexture||R.isData3DTexture,Xn=j.isDataArrayTexture||j.isData3DTexture;if(R.isDepthTexture){const pi=S.get(R),Fn=S.get(j),$n=S.get(pi.__renderTarget),Ad=S.get(Fn.__renderTarget);oe.bindFramebuffer(C.READ_FRAMEBUFFER,$n.__webglFramebuffer),oe.bindFramebuffer(C.DRAW_FRAMEBUFFER,Ad.__webglFramebuffer);for(let As=0;As>>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(t){return{typeUrl:Uf(t.typeUrl)?globalThis.String(t.typeUrl):Uf(t.type_url)?globalThis.String(t.type_url):"",value:Uf(t.value)?HN(t.value):new Uint8Array}},toJSON(t){let e={};return t.typeUrl!==""&&(e.typeUrl=t.typeUrl),t.value.length!==0&&(e.value=GN(t.value)),e},create(t){return ko.fromPartial(t??{})},fromPartial(t){let e=Ev();return e.typeUrl=t.typeUrl??"",e.value=t.value??new Uint8Array,e}};function HN(t){if(globalThis.Buffer)return Uint8Array.from(globalThis.Buffer.from(t,"base64"));{let e=globalThis.atob(t),n=new Uint8Array(e.length);for(let i=0;i{e.push(globalThis.String.fromCharCode(n))}),globalThis.btoa(e.join(""))}}function Uf(t){return t!=null}let gl=(function(t){return t[t.NULL_VALUE=0]="NULL_VALUE",t[t.UNRECOGNIZED=-1]="UNRECOGNIZED",t})({});function Tv(t){switch(t){case 0:case"NULL_VALUE":return gl.NULL_VALUE;default:return gl.UNRECOGNIZED}}function WN(t){switch(t){case gl.NULL_VALUE:return"NULL_VALUE";case gl.UNRECOGNIZED:default:return"UNRECOGNIZED"}}function kf(){return{fields:{}}}const Ba={encode(t,e=new ut){return globalThis.Object.entries(t.fields).forEach(([n,i])=>{i!==void 0&&pp.encode({key:n,value:i},e.uint32(10).fork()).join()}),e},decode(t,e){let n=t instanceof Se?t:new Se(t),i=e===void 0?n.len:n.pos+e,r=kf();for(;n.pos>>3){case 1:{if(s!==10)break;let o=pp.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(t){return{fields:mp(t.fields)?globalThis.Object.entries(t.fields).reduce((e,[n,i])=>(e[n]=i,e),{}):{}}},toJSON(t){let e={};if(t.fields){let n=globalThis.Object.entries(t.fields);n.length>0&&(e.fields={},n.forEach(([i,r])=>{e.fields[i]=r}))}return e},create(t){return Ba.fromPartial(t??{})},fromPartial(t){let e=kf();return e.fields=globalThis.Object.entries(t.fields??{}).reduce((n,[i,r])=>(r!==void 0&&(n[i]=r),n),{}),e},wrap(t){let e=kf();if(t!==void 0)for(let n of globalThis.Object.keys(t))e.fields[n]=t[n];return e},unwrap(t){let e={};if(t.fields)for(let n of globalThis.Object.keys(t.fields))e[n]=t.fields[n];return e}};function Av(){return{key:"",value:void 0}}const pp={encode(t,e=new ut){return t.key!==""&&e.uint32(10).string(t.key),t.value!==void 0&&ui.encode(ui.wrap(t.value),e.uint32(18).fork()).join(),e},decode(t,e){let n=t instanceof Se?t:new Se(t),i=e===void 0?n.len:n.pos+e,r=Av();for(;n.pos>>3){case 1:if(s!==10)break;r.key=n.string();continue;case 2:if(s!==18)break;r.value=ui.unwrap(ui.decode(n,n.uint32()));continue}if((s&7)==4||s===0)break;n.skip(s&7)}return r},fromJSON(t){return{key:qi(t.key)?globalThis.String(t.key):"",value:qi(t?.value)?t.value:void 0}},toJSON(t){let e={};return t.key!==""&&(e.key=t.key),t.value!==void 0&&(e.value=t.value),e},create(t){return pp.fromPartial(t??{})},fromPartial(t){let e=Av();return e.key=t.key??"",e.value=t.value??void 0,e}};function Bf(){return{nullValue:void 0,numberValue:void 0,stringValue:void 0,boolValue:void 0,structValue:void 0,listValue:void 0}}const ui={encode(t,e=new ut){return t.nullValue!==void 0&&e.uint32(8).int32(t.nullValue),t.numberValue!==void 0&&e.uint32(17).double(t.numberValue),t.stringValue!==void 0&&e.uint32(26).string(t.stringValue),t.boolValue!==void 0&&e.uint32(32).bool(t.boolValue),t.structValue!==void 0&&Ba.encode(Ba.wrap(t.structValue),e.uint32(42).fork()).join(),t.listValue!==void 0&&za.encode(za.wrap(t.listValue),e.uint32(50).fork()).join(),e},decode(t,e){let n=t instanceof Se?t:new Se(t),i=e===void 0?n.len:n.pos+e,r=Bf();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=Ba.unwrap(Ba.decode(n,n.uint32()));continue;case 6:if(s!==50)break;r.listValue=za.unwrap(za.decode(n,n.uint32()));continue}if((s&7)==4||s===0)break;n.skip(s&7)}return r},fromJSON(t){return{nullValue:qi(t.nullValue)?Tv(t.nullValue):qi(t.null_value)?Tv(t.null_value):void 0,numberValue:qi(t.numberValue)?globalThis.Number(t.numberValue):qi(t.number_value)?globalThis.Number(t.number_value):void 0,stringValue:qi(t.stringValue)?globalThis.String(t.stringValue):qi(t.string_value)?globalThis.String(t.string_value):void 0,boolValue:qi(t.boolValue)?globalThis.Boolean(t.boolValue):qi(t.bool_value)?globalThis.Boolean(t.bool_value):void 0,structValue:mp(t.structValue)?t.structValue:mp(t.struct_value)?t.struct_value:void 0,listValue:globalThis.Array.isArray(t.listValue)?[...t.listValue]:globalThis.Array.isArray(t.list_value)?[...t.list_value]:void 0}},toJSON(t){let e={};return t.nullValue!==void 0&&(e.nullValue=WN(t.nullValue)),t.numberValue!==void 0&&(e.numberValue=t.numberValue),t.stringValue!==void 0&&(e.stringValue=t.stringValue),t.boolValue!==void 0&&(e.boolValue=t.boolValue),t.structValue!==void 0&&(e.structValue=t.structValue),t.listValue!==void 0&&(e.listValue=t.listValue),e},create(t){return ui.fromPartial(t??{})},fromPartial(t){let e=Bf();return e.nullValue=t.nullValue??void 0,e.numberValue=t.numberValue??void 0,e.stringValue=t.stringValue??void 0,e.boolValue=t.boolValue??void 0,e.structValue=t.structValue??void 0,e.listValue=t.listValue??void 0,e},wrap(t){let e=Bf();if(t===null)e.nullValue=gl.NULL_VALUE;else if(typeof t=="boolean")e.boolValue=t;else if(typeof t=="number")e.numberValue=t;else if(typeof t=="string")e.stringValue=t;else if(globalThis.Array.isArray(t))e.listValue=t;else if(typeof t=="object")e.structValue=t;else if(t!==void 0)throw new globalThis.Error("Unsupported any value type: "+typeof t);return e},unwrap(t){if(t.stringValue!==void 0)return t.stringValue;if(t?.numberValue!==void 0)return t.numberValue;if(t?.boolValue!==void 0)return t.boolValue;if(t?.structValue!==void 0)return t.structValue;if(t?.listValue!==void 0)return t.listValue;if(t?.nullValue!==void 0)return null}};function zf(){return{values:[]}}const za={encode(t,e=new ut){for(let n of t.values)ui.encode(ui.wrap(n),e.uint32(10).fork()).join();return e},decode(t,e){let n=t instanceof Se?t:new Se(t),i=e===void 0?n.len:n.pos+e,r=zf();for(;n.pos>>3){case 1:if(s!==10)break;r.values.push(ui.unwrap(ui.decode(n,n.uint32())));continue}if((s&7)==4||s===0)break;n.skip(s&7)}return r},fromJSON(t){return{values:globalThis.Array.isArray(t?.values)?[...t.values]:[]}},toJSON(t){let e={};return t.values?.length&&(e.values=t.values),e},create(t){return za.fromPartial(t??{})},fromPartial(t){let e=zf();return e.values=t.values?.map(n=>n)||[],e},wrap(t){let e=zf();return e.values=t??[],e},unwrap(t){return t?.hasOwnProperty("values")&&globalThis.Array.isArray(t.values)?t.values:t}};function mp(t){return typeof t=="object"&&!!t}function qi(t){return t!=null}jp({AnyData:()=>an,DictData:()=>Cr,DictData_ItemsEntry:()=>du,FallbackData:()=>Ys,ListData:()=>Yb,MessageData:()=>Sm,protobufPackage:()=>qN});const qN="compas_pb.data";function Cv(){return{message:void 0,value:void 0,fallback:void 0}}const an={encode(t,e=new ut){return t.message!==void 0&&ko.encode(t.message,e.uint32(10).fork()).join(),t.value!==void 0&&ui.encode(ui.wrap(t.value),e.uint32(18).fork()).join(),t.fallback!==void 0&&Ys.encode(t.fallback,e.uint32(26).fork()).join(),e},decode(t,e){let n=t instanceof Se?t:new Se(t),i=e===void 0?n.len:n.pos+e,r=Cv();for(;n.pos>>3){case 1:if(s!==10)break;r.message=ko.decode(n,n.uint32());continue;case 2:if(s!==18)break;r.value=ui.unwrap(ui.decode(n,n.uint32()));continue;case 3:if(s!==26)break;r.fallback=Ys.decode(n,n.uint32());continue}if((s&7)==4||s===0)break;n.skip(s&7)}return r},fromJSON(t){return{message:vs(t.message)?ko.fromJSON(t.message):void 0,value:vs(t?.value)?t.value:void 0,fallback:vs(t.fallback)?Ys.fromJSON(t.fallback):void 0}},toJSON(t){let e={};return t.message!==void 0&&(e.message=ko.toJSON(t.message)),t.value!==void 0&&(e.value=t.value),t.fallback!==void 0&&(e.fallback=Ys.toJSON(t.fallback)),e},create(t){return an.fromPartial(t??{})},fromPartial(t){let e=Cv();return e.message=t.message!==void 0&&t.message!==null?ko.fromPartial(t.message):void 0,e.value=t.value??void 0,e.fallback=t.fallback!==void 0&&t.fallback!==null?Ys.fromPartial(t.fallback):void 0,e}};function Pv(){return{data:void 0}}const Ys={encode(t,e=new ut){return t.data!==void 0&&Cr.encode(t.data,e.uint32(10).fork()).join(),e},decode(t,e){let n=t instanceof Se?t:new Se(t),i=e===void 0?n.len:n.pos+e,r=Pv();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(t){return{data:vs(t.data)?Cr.fromJSON(t.data):void 0}},toJSON(t){let e={};return t.data!==void 0&&(e.data=Cr.toJSON(t.data)),e},create(t){return Ys.fromPartial(t??{})},fromPartial(t){let e=Pv();return e.data=t.data!==void 0&&t.data!==null?Cr.fromPartial(t.data):void 0,e}};function Rv(){return{items:[]}}const Yb={encode(t,e=new ut){for(let n of t.items)an.encode(n,e.uint32(10).fork()).join();return e},decode(t,e){let n=t instanceof Se?t:new Se(t),i=e===void 0?n.len:n.pos+e,r=Rv();for(;n.pos>>3){case 1:if(s!==10)break;r.items.push(an.decode(n,n.uint32()));continue}if((s&7)==4||s===0)break;n.skip(s&7)}return r},fromJSON(t){return{items:globalThis.Array.isArray(t?.items)?t.items.map(e=>an.fromJSON(e)):[]}},toJSON(t){let e={};return t.items?.length&&(e.items=t.items.map(n=>an.toJSON(n))),e},create(t){return Yb.fromPartial(t??{})},fromPartial(t){let e=Rv();return e.items=t.items?.map(n=>an.fromPartial(n))||[],e}};function Dv(){return{items:{}}}const Cr={encode(t,e=new ut){return globalThis.Object.entries(t.items).forEach(([n,i])=>{du.encode({key:n,value:i},e.uint32(10).fork()).join()}),e},decode(t,e){let n=t instanceof Se?t:new Se(t),i=e===void 0?n.len:n.pos+e,r=Dv();for(;n.pos>>3){case 1:{if(s!==10)break;let o=du.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(t){return{items:XN(t.items)?globalThis.Object.entries(t.items).reduce((e,[n,i])=>(e[n]=an.fromJSON(i),e),{}):{}}},toJSON(t){let e={};if(t.items){let n=globalThis.Object.entries(t.items);n.length>0&&(e.items={},n.forEach(([i,r])=>{e.items[i]=an.toJSON(r)}))}return e},create(t){return Cr.fromPartial(t??{})},fromPartial(t){let e=Dv();return e.items=globalThis.Object.entries(t.items??{}).reduce((n,[i,r])=>(r!==void 0&&(n[i]=an.fromPartial(r)),n),{}),e}};function Iv(){return{key:"",value:void 0}}const du={encode(t,e=new ut){return t.key!==""&&e.uint32(10).string(t.key),t.value!==void 0&&an.encode(t.value,e.uint32(18).fork()).join(),e},decode(t,e){let n=t instanceof Se?t:new Se(t),i=e===void 0?n.len:n.pos+e,r=Iv();for(;n.pos>>3){case 1:if(s!==10)break;r.key=n.string();continue;case 2:if(s!==18)break;r.value=an.decode(n,n.uint32());continue}if((s&7)==4||s===0)break;n.skip(s&7)}return r},fromJSON(t){return{key:vs(t.key)?globalThis.String(t.key):"",value:vs(t.value)?an.fromJSON(t.value):void 0}},toJSON(t){let e={};return t.key!==""&&(e.key=t.key),t.value!==void 0&&(e.value=an.toJSON(t.value)),e},create(t){return du.fromPartial(t??{})},fromPartial(t){let e=Iv();return e.key=t.key??"",e.value=t.value!==void 0&&t.value!==null?an.fromPartial(t.value):void 0,e}};function Nv(){return{data:void 0,version:void 0}}const Sm={encode(t,e=new ut){return t.data!==void 0&&an.encode(t.data,e.uint32(10).fork()).join(),t.version!==void 0&&e.uint32(18).string(t.version),e},decode(t,e){let n=t instanceof Se?t:new Se(t),i=e===void 0?n.len:n.pos+e,r=Nv();for(;n.pos>>3){case 1:if(s!==10)break;r.data=an.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(t){return{data:vs(t.data)?an.fromJSON(t.data):void 0,version:vs(t.version)?globalThis.String(t.version):void 0}},toJSON(t){let e={};return t.data!==void 0&&(e.data=an.toJSON(t.data)),t.version!==void 0&&(e.version=t.version),e},create(t){return Sm.fromPartial(t??{})},fromPartial(t){let e=Nv();return e.data=t.data!==void 0&&t.data!==null?an.fromPartial(t.data):void 0,e.version=t.version??void 0,e}};function XN(t){return typeof t=="object"&&!!t}function vs(t){return t!=null}jp({ArcData:()=>Zu,BezierData:()=>nd,BoxData:()=>sd,CapsuleData:()=>cd,CircleData:()=>Pr,ConeData:()=>ld,CylinderData:()=>ad,EllipseData:()=>Qu,FrameData:()=>Ze,HyperbolaData:()=>td,LineData:()=>Ku,ParabolaData:()=>ed,PlaneData:()=>Yu,PointData:()=>Je,PointcloudData:()=>dd,PolygonData:()=>rd,PolylineData:()=>id,ProjectionData:()=>_d,QuaternionData:()=>Ju,ReflectionData:()=>gd,RotationData:()=>pd,ScaleData:()=>md,ShearData:()=>vd,SphereData:()=>od,TorusData:()=>ud,TransformationData:()=>fd,TranslationData:()=>hd,VectorData:()=>At,protobufPackage:()=>$N});const $N="compas_pb.data";function Lv(){return{guid:"",name:"",x:0,y:0,z:0}}const Je={encode(t,e=new ut){return t.guid!==""&&e.uint32(10).string(t.guid),t.name!==""&&e.uint32(18).string(t.name),t.x!==0&&e.uint32(29).float(t.x),t.y!==0&&e.uint32(37).float(t.y),t.z!==0&&e.uint32(45).float(t.z),e},decode(t,e){let n=t instanceof Se?t:new Se(t),i=e===void 0?n.len:n.pos+e,r=Lv();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(t){return{guid:fe(t.guid)?globalThis.String(t.guid):"",name:fe(t.name)?globalThis.String(t.name):"",x:fe(t.x)?globalThis.Number(t.x):0,y:fe(t.y)?globalThis.Number(t.y):0,z:fe(t.z)?globalThis.Number(t.z):0}},toJSON(t){let e={};return t.guid!==""&&(e.guid=t.guid),t.name!==""&&(e.name=t.name),t.x!==0&&(e.x=t.x),t.y!==0&&(e.y=t.y),t.z!==0&&(e.z=t.z),e},create(t){return Je.fromPartial(t??{})},fromPartial(t){let e=Lv();return e.guid=t.guid??"",e.name=t.name??"",e.x=t.x??0,e.y=t.y??0,e.z=t.z??0,e}};function Ov(){return{guid:"",name:"",x:0,y:0,z:0}}const At={encode(t,e=new ut){return t.guid!==""&&e.uint32(10).string(t.guid),t.name!==""&&e.uint32(18).string(t.name),t.x!==0&&e.uint32(29).float(t.x),t.y!==0&&e.uint32(37).float(t.y),t.z!==0&&e.uint32(45).float(t.z),e},decode(t,e){let n=t instanceof Se?t:new Se(t),i=e===void 0?n.len:n.pos+e,r=Ov();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(t){return{guid:fe(t.guid)?globalThis.String(t.guid):"",name:fe(t.name)?globalThis.String(t.name):"",x:fe(t.x)?globalThis.Number(t.x):0,y:fe(t.y)?globalThis.Number(t.y):0,z:fe(t.z)?globalThis.Number(t.z):0}},toJSON(t){let e={};return t.guid!==""&&(e.guid=t.guid),t.name!==""&&(e.name=t.name),t.x!==0&&(e.x=t.x),t.y!==0&&(e.y=t.y),t.z!==0&&(e.z=t.z),e},create(t){return At.fromPartial(t??{})},fromPartial(t){let e=Ov();return e.guid=t.guid??"",e.name=t.name??"",e.x=t.x??0,e.y=t.y??0,e.z=t.z??0,e}};function Fv(){return{guid:"",name:"",point:void 0,xaxis:void 0,yaxis:void 0}}const Ze={encode(t,e=new ut){return t.guid!==""&&e.uint32(10).string(t.guid),t.name!==""&&e.uint32(18).string(t.name),t.point!==void 0&&Je.encode(t.point,e.uint32(26).fork()).join(),t.xaxis!==void 0&&At.encode(t.xaxis,e.uint32(34).fork()).join(),t.yaxis!==void 0&&At.encode(t.yaxis,e.uint32(42).fork()).join(),e},decode(t,e){let n=t instanceof Se?t:new Se(t),i=e===void 0?n.len:n.pos+e,r=Fv();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=Je.decode(n,n.uint32());continue;case 4:if(s!==34)break;r.xaxis=At.decode(n,n.uint32());continue;case 5:if(s!==42)break;r.yaxis=At.decode(n,n.uint32());continue}if((s&7)==4||s===0)break;n.skip(s&7)}return r},fromJSON(t){return{guid:fe(t.guid)?globalThis.String(t.guid):"",name:fe(t.name)?globalThis.String(t.name):"",point:fe(t.point)?Je.fromJSON(t.point):void 0,xaxis:fe(t.xaxis)?At.fromJSON(t.xaxis):void 0,yaxis:fe(t.yaxis)?At.fromJSON(t.yaxis):void 0}},toJSON(t){let e={};return t.guid!==""&&(e.guid=t.guid),t.name!==""&&(e.name=t.name),t.point!==void 0&&(e.point=Je.toJSON(t.point)),t.xaxis!==void 0&&(e.xaxis=At.toJSON(t.xaxis)),t.yaxis!==void 0&&(e.yaxis=At.toJSON(t.yaxis)),e},create(t){return Ze.fromPartial(t??{})},fromPartial(t){let e=Fv();return e.guid=t.guid??"",e.name=t.name??"",e.point=t.point!==void 0&&t.point!==null?Je.fromPartial(t.point):void 0,e.xaxis=t.xaxis!==void 0&&t.xaxis!==null?At.fromPartial(t.xaxis):void 0,e.yaxis=t.yaxis!==void 0&&t.yaxis!==null?At.fromPartial(t.yaxis):void 0,e}};function Uv(){return{guid:"",name:"",point:void 0,normal:void 0}}const Yu={encode(t,e=new ut){return t.guid!==""&&e.uint32(10).string(t.guid),t.name!==""&&e.uint32(18).string(t.name),t.point!==void 0&&Je.encode(t.point,e.uint32(26).fork()).join(),t.normal!==void 0&&At.encode(t.normal,e.uint32(34).fork()).join(),e},decode(t,e){let n=t instanceof Se?t:new Se(t),i=e===void 0?n.len:n.pos+e,r=Uv();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=Je.decode(n,n.uint32());continue;case 4:if(s!==34)break;r.normal=At.decode(n,n.uint32());continue}if((s&7)==4||s===0)break;n.skip(s&7)}return r},fromJSON(t){return{guid:fe(t.guid)?globalThis.String(t.guid):"",name:fe(t.name)?globalThis.String(t.name):"",point:fe(t.point)?Je.fromJSON(t.point):void 0,normal:fe(t.normal)?At.fromJSON(t.normal):void 0}},toJSON(t){let e={};return t.guid!==""&&(e.guid=t.guid),t.name!==""&&(e.name=t.name),t.point!==void 0&&(e.point=Je.toJSON(t.point)),t.normal!==void 0&&(e.normal=At.toJSON(t.normal)),e},create(t){return Yu.fromPartial(t??{})},fromPartial(t){let e=Uv();return e.guid=t.guid??"",e.name=t.name??"",e.point=t.point!==void 0&&t.point!==null?Je.fromPartial(t.point):void 0,e.normal=t.normal!==void 0&&t.normal!==null?At.fromPartial(t.normal):void 0,e}};function kv(){return{guid:"",name:"",w:0,x:0,y:0,z:0}}const Ju={encode(t,e=new ut){return t.guid!==""&&e.uint32(10).string(t.guid),t.name!==""&&e.uint32(18).string(t.name),t.w!==0&&e.uint32(29).float(t.w),t.x!==0&&e.uint32(37).float(t.x),t.y!==0&&e.uint32(45).float(t.y),t.z!==0&&e.uint32(53).float(t.z),e},decode(t,e){let n=t instanceof Se?t:new Se(t),i=e===void 0?n.len:n.pos+e,r=kv();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(t){return{guid:fe(t.guid)?globalThis.String(t.guid):"",name:fe(t.name)?globalThis.String(t.name):"",w:fe(t.w)?globalThis.Number(t.w):0,x:fe(t.x)?globalThis.Number(t.x):0,y:fe(t.y)?globalThis.Number(t.y):0,z:fe(t.z)?globalThis.Number(t.z):0}},toJSON(t){let e={};return t.guid!==""&&(e.guid=t.guid),t.name!==""&&(e.name=t.name),t.w!==0&&(e.w=t.w),t.x!==0&&(e.x=t.x),t.y!==0&&(e.y=t.y),t.z!==0&&(e.z=t.z),e},create(t){return Ju.fromPartial(t??{})},fromPartial(t){let e=kv();return e.guid=t.guid??"",e.name=t.name??"",e.w=t.w??0,e.x=t.x??0,e.y=t.y??0,e.z=t.z??0,e}};function Bv(){return{guid:"",name:"",start:void 0,end:void 0}}const Ku={encode(t,e=new ut){return t.guid!==""&&e.uint32(10).string(t.guid),t.name!==""&&e.uint32(18).string(t.name),t.start!==void 0&&Je.encode(t.start,e.uint32(26).fork()).join(),t.end!==void 0&&Je.encode(t.end,e.uint32(34).fork()).join(),e},decode(t,e){let n=t instanceof Se?t:new Se(t),i=e===void 0?n.len:n.pos+e,r=Bv();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=Je.decode(n,n.uint32());continue;case 4:if(s!==34)break;r.end=Je.decode(n,n.uint32());continue}if((s&7)==4||s===0)break;n.skip(s&7)}return r},fromJSON(t){return{guid:fe(t.guid)?globalThis.String(t.guid):"",name:fe(t.name)?globalThis.String(t.name):"",start:fe(t.start)?Je.fromJSON(t.start):void 0,end:fe(t.end)?Je.fromJSON(t.end):void 0}},toJSON(t){let e={};return t.guid!==""&&(e.guid=t.guid),t.name!==""&&(e.name=t.name),t.start!==void 0&&(e.start=Je.toJSON(t.start)),t.end!==void 0&&(e.end=Je.toJSON(t.end)),e},create(t){return Ku.fromPartial(t??{})},fromPartial(t){let e=Bv();return e.guid=t.guid??"",e.name=t.name??"",e.start=t.start!==void 0&&t.start!==null?Je.fromPartial(t.start):void 0,e.end=t.end!==void 0&&t.end!==null?Je.fromPartial(t.end):void 0,e}};function zv(){return{guid:"",name:"",radius:0,frame:void 0}}const Pr={encode(t,e=new ut){return t.guid!==""&&e.uint32(10).string(t.guid),t.name!==""&&e.uint32(18).string(t.name),t.radius!==0&&e.uint32(29).float(t.radius),t.frame!==void 0&&Ze.encode(t.frame,e.uint32(34).fork()).join(),e},decode(t,e){let n=t instanceof Se?t:new Se(t),i=e===void 0?n.len:n.pos+e,r=zv();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=Ze.decode(n,n.uint32());continue}if((s&7)==4||s===0)break;n.skip(s&7)}return r},fromJSON(t){return{guid:fe(t.guid)?globalThis.String(t.guid):"",name:fe(t.name)?globalThis.String(t.name):"",radius:fe(t.radius)?globalThis.Number(t.radius):0,frame:fe(t.frame)?Ze.fromJSON(t.frame):void 0}},toJSON(t){let e={};return t.guid!==""&&(e.guid=t.guid),t.name!==""&&(e.name=t.name),t.radius!==0&&(e.radius=t.radius),t.frame!==void 0&&(e.frame=Ze.toJSON(t.frame)),e},create(t){return Pr.fromPartial(t??{})},fromPartial(t){let e=zv();return e.guid=t.guid??"",e.name=t.name??"",e.radius=t.radius??0,e.frame=t.frame!==void 0&&t.frame!==null?Ze.fromPartial(t.frame):void 0,e}};function Vv(){return{guid:"",name:"",circle:void 0,startAngle:0,endAngle:0}}const Zu={encode(t,e=new ut){return t.guid!==""&&e.uint32(10).string(t.guid),t.name!==""&&e.uint32(18).string(t.name),t.circle!==void 0&&Pr.encode(t.circle,e.uint32(26).fork()).join(),t.startAngle!==0&&e.uint32(37).float(t.startAngle),t.endAngle!==0&&e.uint32(45).float(t.endAngle),e},decode(t,e){let n=t instanceof Se?t:new Se(t),i=e===void 0?n.len:n.pos+e,r=Vv();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=Pr.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(t){return{guid:fe(t.guid)?globalThis.String(t.guid):"",name:fe(t.name)?globalThis.String(t.name):"",circle:fe(t.circle)?Pr.fromJSON(t.circle):void 0,startAngle:fe(t.startAngle)?globalThis.Number(t.startAngle):fe(t.start_angle)?globalThis.Number(t.start_angle):0,endAngle:fe(t.endAngle)?globalThis.Number(t.endAngle):fe(t.end_angle)?globalThis.Number(t.end_angle):0}},toJSON(t){let e={};return t.guid!==""&&(e.guid=t.guid),t.name!==""&&(e.name=t.name),t.circle!==void 0&&(e.circle=Pr.toJSON(t.circle)),t.startAngle!==0&&(e.startAngle=t.startAngle),t.endAngle!==0&&(e.endAngle=t.endAngle),e},create(t){return Zu.fromPartial(t??{})},fromPartial(t){let e=Vv();return e.guid=t.guid??"",e.name=t.name??"",e.circle=t.circle!==void 0&&t.circle!==null?Pr.fromPartial(t.circle):void 0,e.startAngle=t.startAngle??0,e.endAngle=t.endAngle??0,e}};function Hv(){return{guid:"",name:"",major:0,minor:0,frame:void 0}}const Qu={encode(t,e=new ut){return t.guid!==""&&e.uint32(10).string(t.guid),t.name!==""&&e.uint32(18).string(t.name),t.major!==0&&e.uint32(29).float(t.major),t.minor!==0&&e.uint32(37).float(t.minor),t.frame!==void 0&&Ze.encode(t.frame,e.uint32(42).fork()).join(),e},decode(t,e){let n=t instanceof Se?t:new Se(t),i=e===void 0?n.len:n.pos+e,r=Hv();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=Ze.decode(n,n.uint32());continue}if((s&7)==4||s===0)break;n.skip(s&7)}return r},fromJSON(t){return{guid:fe(t.guid)?globalThis.String(t.guid):"",name:fe(t.name)?globalThis.String(t.name):"",major:fe(t.major)?globalThis.Number(t.major):0,minor:fe(t.minor)?globalThis.Number(t.minor):0,frame:fe(t.frame)?Ze.fromJSON(t.frame):void 0}},toJSON(t){let e={};return t.guid!==""&&(e.guid=t.guid),t.name!==""&&(e.name=t.name),t.major!==0&&(e.major=t.major),t.minor!==0&&(e.minor=t.minor),t.frame!==void 0&&(e.frame=Ze.toJSON(t.frame)),e},create(t){return Qu.fromPartial(t??{})},fromPartial(t){let e=Hv();return e.guid=t.guid??"",e.name=t.name??"",e.major=t.major??0,e.minor=t.minor??0,e.frame=t.frame!==void 0&&t.frame!==null?Ze.fromPartial(t.frame):void 0,e}};function Gv(){return{guid:"",name:"",focal:0,frame:void 0}}const ed={encode(t,e=new ut){return t.guid!==""&&e.uint32(10).string(t.guid),t.name!==""&&e.uint32(18).string(t.name),t.focal!==0&&e.uint32(29).float(t.focal),t.frame!==void 0&&Ze.encode(t.frame,e.uint32(34).fork()).join(),e},decode(t,e){let n=t instanceof Se?t:new Se(t),i=e===void 0?n.len:n.pos+e,r=Gv();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=Ze.decode(n,n.uint32());continue}if((s&7)==4||s===0)break;n.skip(s&7)}return r},fromJSON(t){return{guid:fe(t.guid)?globalThis.String(t.guid):"",name:fe(t.name)?globalThis.String(t.name):"",focal:fe(t.focal)?globalThis.Number(t.focal):0,frame:fe(t.frame)?Ze.fromJSON(t.frame):void 0}},toJSON(t){let e={};return t.guid!==""&&(e.guid=t.guid),t.name!==""&&(e.name=t.name),t.focal!==0&&(e.focal=t.focal),t.frame!==void 0&&(e.frame=Ze.toJSON(t.frame)),e},create(t){return ed.fromPartial(t??{})},fromPartial(t){let e=Gv();return e.guid=t.guid??"",e.name=t.name??"",e.focal=t.focal??0,e.frame=t.frame!==void 0&&t.frame!==null?Ze.fromPartial(t.frame):void 0,e}};function Wv(){return{guid:"",name:"",major:0,minor:0,frame:void 0}}const td={encode(t,e=new ut){return t.guid!==""&&e.uint32(10).string(t.guid),t.name!==""&&e.uint32(18).string(t.name),t.major!==0&&e.uint32(29).float(t.major),t.minor!==0&&e.uint32(37).float(t.minor),t.frame!==void 0&&Ze.encode(t.frame,e.uint32(42).fork()).join(),e},decode(t,e){let n=t instanceof Se?t:new Se(t),i=e===void 0?n.len:n.pos+e,r=Wv();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=Ze.decode(n,n.uint32());continue}if((s&7)==4||s===0)break;n.skip(s&7)}return r},fromJSON(t){return{guid:fe(t.guid)?globalThis.String(t.guid):"",name:fe(t.name)?globalThis.String(t.name):"",major:fe(t.major)?globalThis.Number(t.major):0,minor:fe(t.minor)?globalThis.Number(t.minor):0,frame:fe(t.frame)?Ze.fromJSON(t.frame):void 0}},toJSON(t){let e={};return t.guid!==""&&(e.guid=t.guid),t.name!==""&&(e.name=t.name),t.major!==0&&(e.major=t.major),t.minor!==0&&(e.minor=t.minor),t.frame!==void 0&&(e.frame=Ze.toJSON(t.frame)),e},create(t){return td.fromPartial(t??{})},fromPartial(t){let e=Wv();return e.guid=t.guid??"",e.name=t.name??"",e.major=t.major??0,e.minor=t.minor??0,e.frame=t.frame!==void 0&&t.frame!==null?Ze.fromPartial(t.frame):void 0,e}};function qv(){return{guid:"",name:"",points:[],degree:0}}const nd={encode(t,e=new ut){t.guid!==""&&e.uint32(10).string(t.guid),t.name!==""&&e.uint32(18).string(t.name);for(let n of t.points)Je.encode(n,e.uint32(26).fork()).join();return t.degree!==0&&e.uint32(32).int32(t.degree),e},decode(t,e){let n=t instanceof Se?t:new Se(t),i=e===void 0?n.len:n.pos+e,r=qv();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(Je.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(t){return{guid:fe(t.guid)?globalThis.String(t.guid):"",name:fe(t.name)?globalThis.String(t.name):"",points:globalThis.Array.isArray(t?.points)?t.points.map(e=>Je.fromJSON(e)):[],degree:fe(t.degree)?globalThis.Number(t.degree):0}},toJSON(t){let e={};return t.guid!==""&&(e.guid=t.guid),t.name!==""&&(e.name=t.name),t.points?.length&&(e.points=t.points.map(n=>Je.toJSON(n))),t.degree!==0&&(e.degree=Math.round(t.degree)),e},create(t){return nd.fromPartial(t??{})},fromPartial(t){let e=qv();return e.guid=t.guid??"",e.name=t.name??"",e.points=t.points?.map(n=>Je.fromPartial(n))||[],e.degree=t.degree??0,e}};function Xv(){return{guid:"",name:"",points:[]}}const id={encode(t,e=new ut){t.guid!==""&&e.uint32(10).string(t.guid),t.name!==""&&e.uint32(18).string(t.name);for(let n of t.points)Je.encode(n,e.uint32(26).fork()).join();return e},decode(t,e){let n=t instanceof Se?t:new Se(t),i=e===void 0?n.len:n.pos+e,r=Xv();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(Je.decode(n,n.uint32()));continue}if((s&7)==4||s===0)break;n.skip(s&7)}return r},fromJSON(t){return{guid:fe(t.guid)?globalThis.String(t.guid):"",name:fe(t.name)?globalThis.String(t.name):"",points:globalThis.Array.isArray(t?.points)?t.points.map(e=>Je.fromJSON(e)):[]}},toJSON(t){let e={};return t.guid!==""&&(e.guid=t.guid),t.name!==""&&(e.name=t.name),t.points?.length&&(e.points=t.points.map(n=>Je.toJSON(n))),e},create(t){return id.fromPartial(t??{})},fromPartial(t){let e=Xv();return e.guid=t.guid??"",e.name=t.name??"",e.points=t.points?.map(n=>Je.fromPartial(n))||[],e}};function $v(){return{guid:"",name:"",points:[]}}const rd={encode(t,e=new ut){t.guid!==""&&e.uint32(10).string(t.guid),t.name!==""&&e.uint32(18).string(t.name);for(let n of t.points)Je.encode(n,e.uint32(26).fork()).join();return e},decode(t,e){let n=t instanceof Se?t:new Se(t),i=e===void 0?n.len:n.pos+e,r=$v();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(Je.decode(n,n.uint32()));continue}if((s&7)==4||s===0)break;n.skip(s&7)}return r},fromJSON(t){return{guid:fe(t.guid)?globalThis.String(t.guid):"",name:fe(t.name)?globalThis.String(t.name):"",points:globalThis.Array.isArray(t?.points)?t.points.map(e=>Je.fromJSON(e)):[]}},toJSON(t){let e={};return t.guid!==""&&(e.guid=t.guid),t.name!==""&&(e.name=t.name),t.points?.length&&(e.points=t.points.map(n=>Je.toJSON(n))),e},create(t){return rd.fromPartial(t??{})},fromPartial(t){let e=$v();return e.guid=t.guid??"",e.name=t.name??"",e.points=t.points?.map(n=>Je.fromPartial(n))||[],e}};function jv(){return{guid:"",name:"",frame:void 0,xsize:0,ysize:0,zsize:0}}const sd={encode(t,e=new ut){return t.guid!==""&&e.uint32(10).string(t.guid),t.name!==""&&e.uint32(18).string(t.name),t.frame!==void 0&&Ze.encode(t.frame,e.uint32(26).fork()).join(),t.xsize!==0&&e.uint32(37).float(t.xsize),t.ysize!==0&&e.uint32(45).float(t.ysize),t.zsize!==0&&e.uint32(53).float(t.zsize),e},decode(t,e){let n=t instanceof Se?t:new Se(t),i=e===void 0?n.len:n.pos+e,r=jv();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=Ze.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(t){return{guid:fe(t.guid)?globalThis.String(t.guid):"",name:fe(t.name)?globalThis.String(t.name):"",frame:fe(t.frame)?Ze.fromJSON(t.frame):void 0,xsize:fe(t.xsize)?globalThis.Number(t.xsize):0,ysize:fe(t.ysize)?globalThis.Number(t.ysize):0,zsize:fe(t.zsize)?globalThis.Number(t.zsize):0}},toJSON(t){let e={};return t.guid!==""&&(e.guid=t.guid),t.name!==""&&(e.name=t.name),t.frame!==void 0&&(e.frame=Ze.toJSON(t.frame)),t.xsize!==0&&(e.xsize=t.xsize),t.ysize!==0&&(e.ysize=t.ysize),t.zsize!==0&&(e.zsize=t.zsize),e},create(t){return sd.fromPartial(t??{})},fromPartial(t){let e=jv();return e.guid=t.guid??"",e.name=t.name??"",e.frame=t.frame!==void 0&&t.frame!==null?Ze.fromPartial(t.frame):void 0,e.xsize=t.xsize??0,e.ysize=t.ysize??0,e.zsize=t.zsize??0,e}};function Yv(){return{guid:"",name:"",radius:0,frame:void 0}}const od={encode(t,e=new ut){return t.guid!==""&&e.uint32(10).string(t.guid),t.name!==""&&e.uint32(18).string(t.name),t.radius!==0&&e.uint32(29).float(t.radius),t.frame!==void 0&&Ze.encode(t.frame,e.uint32(34).fork()).join(),e},decode(t,e){let n=t instanceof Se?t:new Se(t),i=e===void 0?n.len:n.pos+e,r=Yv();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=Ze.decode(n,n.uint32());continue}if((s&7)==4||s===0)break;n.skip(s&7)}return r},fromJSON(t){return{guid:fe(t.guid)?globalThis.String(t.guid):"",name:fe(t.name)?globalThis.String(t.name):"",radius:fe(t.radius)?globalThis.Number(t.radius):0,frame:fe(t.frame)?Ze.fromJSON(t.frame):void 0}},toJSON(t){let e={};return t.guid!==""&&(e.guid=t.guid),t.name!==""&&(e.name=t.name),t.radius!==0&&(e.radius=t.radius),t.frame!==void 0&&(e.frame=Ze.toJSON(t.frame)),e},create(t){return od.fromPartial(t??{})},fromPartial(t){let e=Yv();return e.guid=t.guid??"",e.name=t.name??"",e.radius=t.radius??0,e.frame=t.frame!==void 0&&t.frame!==null?Ze.fromPartial(t.frame):void 0,e}};function Jv(){return{guid:"",name:"",radius:0,height:0,frame:void 0}}const ad={encode(t,e=new ut){return t.guid!==""&&e.uint32(10).string(t.guid),t.name!==""&&e.uint32(18).string(t.name),t.radius!==0&&e.uint32(29).float(t.radius),t.height!==0&&e.uint32(37).float(t.height),t.frame!==void 0&&Ze.encode(t.frame,e.uint32(42).fork()).join(),e},decode(t,e){let n=t instanceof Se?t:new Se(t),i=e===void 0?n.len:n.pos+e,r=Jv();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=Ze.decode(n,n.uint32());continue}if((s&7)==4||s===0)break;n.skip(s&7)}return r},fromJSON(t){return{guid:fe(t.guid)?globalThis.String(t.guid):"",name:fe(t.name)?globalThis.String(t.name):"",radius:fe(t.radius)?globalThis.Number(t.radius):0,height:fe(t.height)?globalThis.Number(t.height):0,frame:fe(t.frame)?Ze.fromJSON(t.frame):void 0}},toJSON(t){let e={};return t.guid!==""&&(e.guid=t.guid),t.name!==""&&(e.name=t.name),t.radius!==0&&(e.radius=t.radius),t.height!==0&&(e.height=t.height),t.frame!==void 0&&(e.frame=Ze.toJSON(t.frame)),e},create(t){return ad.fromPartial(t??{})},fromPartial(t){let e=Jv();return e.guid=t.guid??"",e.name=t.name??"",e.radius=t.radius??0,e.height=t.height??0,e.frame=t.frame!==void 0&&t.frame!==null?Ze.fromPartial(t.frame):void 0,e}};function Kv(){return{guid:"",name:"",radius:0,height:0,frame:void 0}}const ld={encode(t,e=new ut){return t.guid!==""&&e.uint32(10).string(t.guid),t.name!==""&&e.uint32(18).string(t.name),t.radius!==0&&e.uint32(29).float(t.radius),t.height!==0&&e.uint32(37).float(t.height),t.frame!==void 0&&Ze.encode(t.frame,e.uint32(42).fork()).join(),e},decode(t,e){let n=t instanceof Se?t:new Se(t),i=e===void 0?n.len:n.pos+e,r=Kv();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=Ze.decode(n,n.uint32());continue}if((s&7)==4||s===0)break;n.skip(s&7)}return r},fromJSON(t){return{guid:fe(t.guid)?globalThis.String(t.guid):"",name:fe(t.name)?globalThis.String(t.name):"",radius:fe(t.radius)?globalThis.Number(t.radius):0,height:fe(t.height)?globalThis.Number(t.height):0,frame:fe(t.frame)?Ze.fromJSON(t.frame):void 0}},toJSON(t){let e={};return t.guid!==""&&(e.guid=t.guid),t.name!==""&&(e.name=t.name),t.radius!==0&&(e.radius=t.radius),t.height!==0&&(e.height=t.height),t.frame!==void 0&&(e.frame=Ze.toJSON(t.frame)),e},create(t){return ld.fromPartial(t??{})},fromPartial(t){let e=Kv();return e.guid=t.guid??"",e.name=t.name??"",e.radius=t.radius??0,e.height=t.height??0,e.frame=t.frame!==void 0&&t.frame!==null?Ze.fromPartial(t.frame):void 0,e}};function Zv(){return{guid:"",name:"",radius:0,height:0,frame:void 0}}const cd={encode(t,e=new ut){return t.guid!==""&&e.uint32(10).string(t.guid),t.name!==""&&e.uint32(18).string(t.name),t.radius!==0&&e.uint32(29).float(t.radius),t.height!==0&&e.uint32(37).float(t.height),t.frame!==void 0&&Ze.encode(t.frame,e.uint32(42).fork()).join(),e},decode(t,e){let n=t instanceof Se?t:new Se(t),i=e===void 0?n.len:n.pos+e,r=Zv();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=Ze.decode(n,n.uint32());continue}if((s&7)==4||s===0)break;n.skip(s&7)}return r},fromJSON(t){return{guid:fe(t.guid)?globalThis.String(t.guid):"",name:fe(t.name)?globalThis.String(t.name):"",radius:fe(t.radius)?globalThis.Number(t.radius):0,height:fe(t.height)?globalThis.Number(t.height):0,frame:fe(t.frame)?Ze.fromJSON(t.frame):void 0}},toJSON(t){let e={};return t.guid!==""&&(e.guid=t.guid),t.name!==""&&(e.name=t.name),t.radius!==0&&(e.radius=t.radius),t.height!==0&&(e.height=t.height),t.frame!==void 0&&(e.frame=Ze.toJSON(t.frame)),e},create(t){return cd.fromPartial(t??{})},fromPartial(t){let e=Zv();return e.guid=t.guid??"",e.name=t.name??"",e.radius=t.radius??0,e.height=t.height??0,e.frame=t.frame!==void 0&&t.frame!==null?Ze.fromPartial(t.frame):void 0,e}};function Qv(){return{guid:"",name:"",radiusAxis:0,radiusPipe:0,frame:void 0}}const ud={encode(t,e=new ut){return t.guid!==""&&e.uint32(10).string(t.guid),t.name!==""&&e.uint32(18).string(t.name),t.radiusAxis!==0&&e.uint32(29).float(t.radiusAxis),t.radiusPipe!==0&&e.uint32(37).float(t.radiusPipe),t.frame!==void 0&&Ze.encode(t.frame,e.uint32(42).fork()).join(),e},decode(t,e){let n=t instanceof Se?t:new Se(t),i=e===void 0?n.len:n.pos+e,r=Qv();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=Ze.decode(n,n.uint32());continue}if((s&7)==4||s===0)break;n.skip(s&7)}return r},fromJSON(t){return{guid:fe(t.guid)?globalThis.String(t.guid):"",name:fe(t.name)?globalThis.String(t.name):"",radiusAxis:fe(t.radiusAxis)?globalThis.Number(t.radiusAxis):fe(t.radius_axis)?globalThis.Number(t.radius_axis):0,radiusPipe:fe(t.radiusPipe)?globalThis.Number(t.radiusPipe):fe(t.radius_pipe)?globalThis.Number(t.radius_pipe):0,frame:fe(t.frame)?Ze.fromJSON(t.frame):void 0}},toJSON(t){let e={};return t.guid!==""&&(e.guid=t.guid),t.name!==""&&(e.name=t.name),t.radiusAxis!==0&&(e.radiusAxis=t.radiusAxis),t.radiusPipe!==0&&(e.radiusPipe=t.radiusPipe),t.frame!==void 0&&(e.frame=Ze.toJSON(t.frame)),e},create(t){return ud.fromPartial(t??{})},fromPartial(t){let e=Qv();return e.guid=t.guid??"",e.name=t.name??"",e.radiusAxis=t.radiusAxis??0,e.radiusPipe=t.radiusPipe??0,e.frame=t.frame!==void 0&&t.frame!==null?Ze.fromPartial(t.frame):void 0,e}};function e_(){return{guid:"",name:"",points:[]}}const dd={encode(t,e=new ut){t.guid!==""&&e.uint32(10).string(t.guid),t.name!==""&&e.uint32(18).string(t.name);for(let n of t.points)Je.encode(n,e.uint32(26).fork()).join();return e},decode(t,e){let n=t instanceof Se?t:new Se(t),i=e===void 0?n.len:n.pos+e,r=e_();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(Je.decode(n,n.uint32()));continue}if((s&7)==4||s===0)break;n.skip(s&7)}return r},fromJSON(t){return{guid:fe(t.guid)?globalThis.String(t.guid):"",name:fe(t.name)?globalThis.String(t.name):"",points:globalThis.Array.isArray(t?.points)?t.points.map(e=>Je.fromJSON(e)):[]}},toJSON(t){let e={};return t.guid!==""&&(e.guid=t.guid),t.name!==""&&(e.name=t.name),t.points?.length&&(e.points=t.points.map(n=>Je.toJSON(n))),e},create(t){return dd.fromPartial(t??{})},fromPartial(t){let e=e_();return e.guid=t.guid??"",e.name=t.name??"",e.points=t.points?.map(n=>Je.fromPartial(n))||[],e}};function t_(){return{guid:"",name:"",matrix:[]}}const fd={encode(t,e=new ut){t.guid!==""&&e.uint32(10).string(t.guid),t.name!==""&&e.uint32(18).string(t.name),e.uint32(26).fork();for(let n of t.matrix)e.float(n);return e.join(),e},decode(t,e){let n=t instanceof Se?t:new Se(t),i=e===void 0?n.len:n.pos+e,r=t_();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){let o=n.uint32()+n.pos;for(;n.posglobalThis.Number(e)):[]}},toJSON(t){let e={};return t.guid!==""&&(e.guid=t.guid),t.name!==""&&(e.name=t.name),t.matrix?.length&&(e.matrix=t.matrix),e},create(t){return fd.fromPartial(t??{})},fromPartial(t){let e=t_();return e.guid=t.guid??"",e.name=t.name??"",e.matrix=t.matrix?.map(n=>n)||[],e}};function n_(){return{guid:"",name:"",translationVector:void 0}}const hd={encode(t,e=new ut){return t.guid!==""&&e.uint32(10).string(t.guid),t.name!==""&&e.uint32(18).string(t.name),t.translationVector!==void 0&&At.encode(t.translationVector,e.uint32(26).fork()).join(),e},decode(t,e){let n=t instanceof Se?t:new Se(t),i=e===void 0?n.len:n.pos+e,r=n_();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=At.decode(n,n.uint32());continue}if((s&7)==4||s===0)break;n.skip(s&7)}return r},fromJSON(t){return{guid:fe(t.guid)?globalThis.String(t.guid):"",name:fe(t.name)?globalThis.String(t.name):"",translationVector:fe(t.translationVector)?At.fromJSON(t.translationVector):fe(t.translation_vector)?At.fromJSON(t.translation_vector):void 0}},toJSON(t){let e={};return t.guid!==""&&(e.guid=t.guid),t.name!==""&&(e.name=t.name),t.translationVector!==void 0&&(e.translationVector=At.toJSON(t.translationVector)),e},create(t){return hd.fromPartial(t??{})},fromPartial(t){let e=n_();return e.guid=t.guid??"",e.name=t.name??"",e.translationVector=t.translationVector!==void 0&&t.translationVector!==null?At.fromPartial(t.translationVector):void 0,e}};function i_(){return{guid:"",name:"",axis:void 0,angle:0,point:void 0}}const pd={encode(t,e=new ut){return t.guid!==""&&e.uint32(10).string(t.guid),t.name!==""&&e.uint32(18).string(t.name),t.axis!==void 0&&At.encode(t.axis,e.uint32(26).fork()).join(),t.angle!==0&&e.uint32(37).float(t.angle),t.point!==void 0&&Je.encode(t.point,e.uint32(42).fork()).join(),e},decode(t,e){let n=t instanceof Se?t:new Se(t),i=e===void 0?n.len:n.pos+e,r=i_();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=At.decode(n,n.uint32());continue;case 4:if(s!==37)break;r.angle=n.float();continue;case 5:if(s!==42)break;r.point=Je.decode(n,n.uint32());continue}if((s&7)==4||s===0)break;n.skip(s&7)}return r},fromJSON(t){return{guid:fe(t.guid)?globalThis.String(t.guid):"",name:fe(t.name)?globalThis.String(t.name):"",axis:fe(t.axis)?At.fromJSON(t.axis):void 0,angle:fe(t.angle)?globalThis.Number(t.angle):0,point:fe(t.point)?Je.fromJSON(t.point):void 0}},toJSON(t){let e={};return t.guid!==""&&(e.guid=t.guid),t.name!==""&&(e.name=t.name),t.axis!==void 0&&(e.axis=At.toJSON(t.axis)),t.angle!==0&&(e.angle=t.angle),t.point!==void 0&&(e.point=Je.toJSON(t.point)),e},create(t){return pd.fromPartial(t??{})},fromPartial(t){let e=i_();return e.guid=t.guid??"",e.name=t.name??"",e.axis=t.axis!==void 0&&t.axis!==null?At.fromPartial(t.axis):void 0,e.angle=t.angle??0,e.point=t.point!==void 0&&t.point!==null?Je.fromPartial(t.point):void 0,e}};function r_(){return{guid:"",name:"",matrix:[]}}const md={encode(t,e=new ut){t.guid!==""&&e.uint32(10).string(t.guid),t.name!==""&&e.uint32(18).string(t.name),e.uint32(26).fork();for(let n of t.matrix)e.float(n);return e.join(),e},decode(t,e){let n=t instanceof Se?t:new Se(t),i=e===void 0?n.len:n.pos+e,r=r_();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){let o=n.uint32()+n.pos;for(;n.posglobalThis.Number(e)):[]}},toJSON(t){let e={};return t.guid!==""&&(e.guid=t.guid),t.name!==""&&(e.name=t.name),t.matrix?.length&&(e.matrix=t.matrix),e},create(t){return md.fromPartial(t??{})},fromPartial(t){let e=r_();return e.guid=t.guid??"",e.name=t.name??"",e.matrix=t.matrix?.map(n=>n)||[],e}};function s_(){return{guid:"",name:"",matrix:[]}}const gd={encode(t,e=new ut){t.guid!==""&&e.uint32(10).string(t.guid),t.name!==""&&e.uint32(18).string(t.name),e.uint32(26).fork();for(let n of t.matrix)e.float(n);return e.join(),e},decode(t,e){let n=t instanceof Se?t:new Se(t),i=e===void 0?n.len:n.pos+e,r=s_();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){let o=n.uint32()+n.pos;for(;n.posglobalThis.Number(e)):[]}},toJSON(t){let e={};return t.guid!==""&&(e.guid=t.guid),t.name!==""&&(e.name=t.name),t.matrix?.length&&(e.matrix=t.matrix),e},create(t){return gd.fromPartial(t??{})},fromPartial(t){let e=s_();return e.guid=t.guid??"",e.name=t.name??"",e.matrix=t.matrix?.map(n=>n)||[],e}};function o_(){return{guid:"",name:"",matrix:[]}}const vd={encode(t,e=new ut){t.guid!==""&&e.uint32(10).string(t.guid),t.name!==""&&e.uint32(18).string(t.name),e.uint32(26).fork();for(let n of t.matrix)e.float(n);return e.join(),e},decode(t,e){let n=t instanceof Se?t:new Se(t),i=e===void 0?n.len:n.pos+e,r=o_();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){let o=n.uint32()+n.pos;for(;n.posglobalThis.Number(e)):[]}},toJSON(t){let e={};return t.guid!==""&&(e.guid=t.guid),t.name!==""&&(e.name=t.name),t.matrix?.length&&(e.matrix=t.matrix),e},create(t){return vd.fromPartial(t??{})},fromPartial(t){let e=o_();return e.guid=t.guid??"",e.name=t.name??"",e.matrix=t.matrix?.map(n=>n)||[],e}};function a_(){return{guid:"",name:"",matrix:[]}}const _d={encode(t,e=new ut){t.guid!==""&&e.uint32(10).string(t.guid),t.name!==""&&e.uint32(18).string(t.name),e.uint32(26).fork();for(let n of t.matrix)e.float(n);return e.join(),e},decode(t,e){let n=t instanceof Se?t:new Se(t),i=e===void 0?n.len:n.pos+e,r=a_();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){let o=n.uint32()+n.pos;for(;n.posglobalThis.Number(e)):[]}},toJSON(t){let e={};return t.guid!==""&&(e.guid=t.guid),t.name!==""&&(e.name=t.name),t.matrix?.length&&(e.matrix=t.matrix),e},create(t){return _d.fromPartial(t??{})},fromPartial(t){let e=a_();return e.guid=t.guid??"",e.name=t.name??"",e.matrix=t.matrix?.map(n=>n)||[],e}};function fe(t){return t!=null}jp({FaceData:()=>Dr,FaceList:()=>Rr,MeshData:()=>xd,PolyhedronData:()=>yd,protobufPackage:()=>jN});const jN="compas_pb.data";function l_(){return{indices:[]}}const Rr={encode(t,e=new ut){e.uint32(10).fork();for(let n of t.indices)e.uint32(n);return e.join(),e},decode(t,e){let n=t instanceof Se?t:new Se(t),i=e===void 0?n.len:n.pos+e,r=l_();for(;n.pos>>3){case 1:if(s===8){r.indices.push(n.uint32());continue}if(s===10){let o=n.uint32()+n.pos;for(;n.posglobalThis.Number(e)):[]}},toJSON(t){let e={};return t.indices?.length&&(e.indices=t.indices.map(n=>Math.round(n))),e},create(t){return Rr.fromPartial(t??{})},fromPartial(t){let e=l_();return e.indices=t.indices?.map(n=>n)||[],e}};function c_(){return{guid:void 0,name:void 0,vertices:[],faces:[]}}const xd={encode(t,e=new ut){t.guid!==void 0&&e.uint32(10).string(t.guid),t.name!==void 0&&e.uint32(18).string(t.name);for(let n of t.vertices)Je.encode(n,e.uint32(26).fork()).join();for(let n of t.faces)Rr.encode(n,e.uint32(34).fork()).join();return e},decode(t,e){let n=t instanceof Se?t:new Se(t),i=e===void 0?n.len:n.pos+e,r=c_();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(Je.decode(n,n.uint32()));continue;case 4:if(s!==34)break;r.faces.push(Rr.decode(n,n.uint32()));continue}if((s&7)==4||s===0)break;n.skip(s&7)}return r},fromJSON(t){return{guid:fu(t.guid)?globalThis.String(t.guid):void 0,name:fu(t.name)?globalThis.String(t.name):void 0,vertices:globalThis.Array.isArray(t?.vertices)?t.vertices.map(e=>Je.fromJSON(e)):[],faces:globalThis.Array.isArray(t?.faces)?t.faces.map(e=>Rr.fromJSON(e)):[]}},toJSON(t){let e={};return t.guid!==void 0&&(e.guid=t.guid),t.name!==void 0&&(e.name=t.name),t.vertices?.length&&(e.vertices=t.vertices.map(n=>Je.toJSON(n))),t.faces?.length&&(e.faces=t.faces.map(n=>Rr.toJSON(n))),e},create(t){return xd.fromPartial(t??{})},fromPartial(t){let e=c_();return e.guid=t.guid??void 0,e.name=t.name??void 0,e.vertices=t.vertices?.map(n=>Je.fromPartial(n))||[],e.faces=t.faces?.map(n=>Rr.fromPartial(n))||[],e}};function u_(){return{vertexIndices:[]}}const Dr={encode(t,e=new ut){e.uint32(10).fork();for(let n of t.vertexIndices)e.int32(n);return e.join(),e},decode(t,e){let n=t instanceof Se?t:new Se(t),i=e===void 0?n.len:n.pos+e,r=u_();for(;n.pos>>3){case 1:if(s===8){r.vertexIndices.push(n.int32());continue}if(s===10){let o=n.uint32()+n.pos;for(;n.posglobalThis.Number(e)):globalThis.Array.isArray(t?.vertex_indices)?t.vertex_indices.map(e=>globalThis.Number(e)):[]}},toJSON(t){let e={};return t.vertexIndices?.length&&(e.vertexIndices=t.vertexIndices.map(n=>Math.round(n))),e},create(t){return Dr.fromPartial(t??{})},fromPartial(t){let e=u_();return e.vertexIndices=t.vertexIndices?.map(n=>n)||[],e}};function d_(){return{guid:void 0,name:void 0,vertices:[],faces:[]}}const yd={encode(t,e=new ut){t.guid!==void 0&&e.uint32(10).string(t.guid),t.name!==void 0&&e.uint32(18).string(t.name);for(let n of t.vertices)Je.encode(n,e.uint32(26).fork()).join();for(let n of t.faces)Dr.encode(n,e.uint32(34).fork()).join();return e},decode(t,e){let n=t instanceof Se?t:new Se(t),i=e===void 0?n.len:n.pos+e,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.vertices.push(Je.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(t){return{guid:fu(t.guid)?globalThis.String(t.guid):void 0,name:fu(t.name)?globalThis.String(t.name):void 0,vertices:globalThis.Array.isArray(t?.vertices)?t.vertices.map(e=>Je.fromJSON(e)):[],faces:globalThis.Array.isArray(t?.faces)?t.faces.map(e=>Dr.fromJSON(e)):[]}},toJSON(t){let e={};return t.guid!==void 0&&(e.guid=t.guid),t.name!==void 0&&(e.name=t.name),t.vertices?.length&&(e.vertices=t.vertices.map(n=>Je.toJSON(n))),t.faces?.length&&(e.faces=t.faces.map(n=>Dr.toJSON(n))),e},create(t){return yd.fromPartial(t??{})},fromPartial(t){let e=d_();return e.guid=t.guid??void 0,e.name=t.name??void 0,e.vertices=t.vertices?.map(n=>Je.fromPartial(n))||[],e.faces=t.faces?.map(n=>Dr.fromPartial(n))||[],e}};function fu(t){return t!=null}var bi=class{data;constructor(t){let e;if(e="bytes"in t?YN(t.bytes):t.data,e.x===void 0||e.y===void 0||e.z===void 0)throw Error("Invalid PointData: Missing required properties (x, y, or z).");this.data=e}get bytes(){return JN(this.data)}get guid(){return this.data.guid}get name(){return this.data.name}get x(){return this.data.x}get y(){return this.data.y}get z(){return this.data.z}buildGeometry(){let t=new _t,e=new Float32Array([this.x,this.y,this.z]);t.setAttribute("position",new Gn(e,3));let n=new qu({size:.2,color:255});return new dm(t,n)}};function YN(t){return Je.decode(t)}function JN(t){return Je.encode(t).finish()}var KN=class{data;constructor(t){let e;if(e="bytes"in t?ZN(t.bytes):t.data,!e.vertexIndices)throw Error("Invalid FaceData: Missing required property 'vertices'.");this.data=e}get bytes(){return QN(this.data)}get vertexIndices(){return this.data.vertexIndices}};function ZN(t){return Dr.decode(t)}function QN(t){return Dr.encode(t).finish()}var eL=class{data;_points;_faces;constructor(t){let e;if(e="bytes"in t?tL(t.bytes):t.data,!e.vertices||!e.faces)throw Error("Invalid PolyhedronData: Missing required properties (vertices or faces).");this.data=e}get bytes(){return nL(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(let t of this.data.vertices){let e=new bi({data:t});this._points.push(e)}}return this._points}get faces(){if(!this._faces){this._faces=[];for(let t of this.data.faces){let e=new KN({data:t});this._faces.push(e)}}return this._faces}buildGeometry(){let t=new _t,e=new Float32Array(this.vertices.length*3);for(let r=0;r{e[s*3]=r.x,e[s*3+1]=r.y,e[s*3+2]=r.z});let n=[];for(let r of this.faces){let s=r.indices;for(let o=1;oMath.PI&&(i-=jn),r<-Math.PI?r+=jn:r>Math.PI&&(r-=jn),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(un.setFromSpherical(this._spherical),un.applyQuaternion(this._quatInverse),n.copy(this.target).add(un),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=un.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 N(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 N(this._mouse.x,this._mouse.y,0);c.unproject(this.object),this.object.position.sub(c).add(a),this.object.updateMatrixWorld(),o=un.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):(wc.origin.copy(this.object.position),wc.direction.set(0,0,-1).transformDirection(this.object.matrix),Math.abs(this.object.up.dot(wc.direction))Vf||8*(1-this._lastQuaternion.dot(this.object.quaternion))>Vf||this._lastTargetPosition.distanceToSquared(this.target)>Vf?(this.dispatchEvent(f_),this._lastPosition.copy(this.object.position),this._lastQuaternion.copy(this.object.quaternion),this._lastTargetPosition.copy(this.target),!0):!1}_getAutoRotationAngle(e){return e!==null?jn/60*this.autoRotateSpeed*e:jn/60/60*this.autoRotateSpeed}_getZoomScale(e){const n=Math.abs(e*.01);return Math.pow(.95,this.zoomSpeed*n)}_rotateLeft(e){this._sphericalDelta.theta-=e}_rotateUp(e){this._sphericalDelta.phi-=e}_panLeft(e,n){un.setFromMatrixColumn(n,0),un.multiplyScalar(-e),this._panOffset.add(un)}_panUp(e,n){this.screenSpacePanning===!0?un.setFromMatrixColumn(n,1):(un.setFromMatrixColumn(n,0),un.crossVectors(this.object.up,un)),un.multiplyScalar(e),this._panOffset.add(un)}_pan(e,n){const i=this.domElement;if(this.object.isPerspectiveCamera){const r=this.object.position;un.copy(r).sub(this.target);let s=un.length();s*=Math.tan(this.object.fov/2*Math.PI/180),this._panLeft(2*e*s/i.clientHeight,this.object.matrix),this._panUp(2*n*s/i.clientHeight,this.object.matrix)}else this.object.isOrthographicCamera?(this._panLeft(e*(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(e){this.object.isPerspectiveCamera||this.object.isOrthographicCamera?this._scale/=e:(console.warn("WARNING: OrbitControls.js encountered an unknown camera type - dolly/zoom disabled."),this.enableZoom=!1)}_dollyIn(e){this.object.isPerspectiveCamera||this.object.isOrthographicCamera?this._scale*=e:(console.warn("WARNING: OrbitControls.js encountered an unknown camera type - dolly/zoom disabled."),this.enableZoom=!1)}_updateZoomParameters(e,n){if(!this.zoomToCursor)return;this._performCursorZoom=!0;const i=this.domElement.getBoundingClientRect(),r=e-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(e){return Math.max(this.minDistance,Math.min(this.maxDistance,e))}_handleMouseDownRotate(e){this._rotateStart.set(e.clientX,e.clientY)}_handleMouseDownDolly(e){this._updateZoomParameters(e.clientX,e.clientX),this._dollyStart.set(e.clientX,e.clientY)}_handleMouseDownPan(e){this._panStart.set(e.clientX,e.clientY)}_handleMouseMoveRotate(e){this._rotateEnd.set(e.clientX,e.clientY),this._rotateDelta.subVectors(this._rotateEnd,this._rotateStart).multiplyScalar(this.rotateSpeed);const n=this.domElement;this._rotateLeft(jn*this._rotateDelta.x/n.clientHeight),this._rotateUp(jn*this._rotateDelta.y/n.clientHeight),this._rotateStart.copy(this._rotateEnd),this.update()}_handleMouseMoveDolly(e){this._dollyEnd.set(e.clientX,e.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(e){this._panEnd.set(e.clientX,e.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(e){this._updateZoomParameters(e.clientX,e.clientY),e.deltaY<0?this._dollyIn(this._getZoomScale(e.deltaY)):e.deltaY>0&&this._dollyOut(this._getZoomScale(e.deltaY)),this.update()}_handleKeyDown(e){let n=!1;switch(e.code){case this.keys.UP:e.ctrlKey||e.metaKey||e.shiftKey?this.enableRotate&&this._rotateUp(jn*this.keyRotateSpeed/this.domElement.clientHeight):this.enablePan&&this._pan(0,this.keyPanSpeed),n=!0;break;case this.keys.BOTTOM:e.ctrlKey||e.metaKey||e.shiftKey?this.enableRotate&&this._rotateUp(-jn*this.keyRotateSpeed/this.domElement.clientHeight):this.enablePan&&this._pan(0,-this.keyPanSpeed),n=!0;break;case this.keys.LEFT:e.ctrlKey||e.metaKey||e.shiftKey?this.enableRotate&&this._rotateLeft(jn*this.keyRotateSpeed/this.domElement.clientHeight):this.enablePan&&this._pan(this.keyPanSpeed,0),n=!0;break;case this.keys.RIGHT:e.ctrlKey||e.metaKey||e.shiftKey?this.enableRotate&&this._rotateLeft(-jn*this.keyRotateSpeed/this.domElement.clientHeight):this.enablePan&&this._pan(-this.keyPanSpeed,0),n=!0;break}n&&(e.preventDefault(),this.update())}_handleTouchStartRotate(e){if(this._pointers.length===1)this._rotateStart.set(e.pageX,e.pageY);else{const n=this._getSecondPointerPosition(e),i=.5*(e.pageX+n.x),r=.5*(e.pageY+n.y);this._rotateStart.set(i,r)}}_handleTouchStartPan(e){if(this._pointers.length===1)this._panStart.set(e.pageX,e.pageY);else{const n=this._getSecondPointerPosition(e),i=.5*(e.pageX+n.x),r=.5*(e.pageY+n.y);this._panStart.set(i,r)}}_handleTouchStartDolly(e){const n=this._getSecondPointerPosition(e),i=e.pageX-n.x,r=e.pageY-n.y,s=Math.sqrt(i*i+r*r);this._dollyStart.set(0,s)}_handleTouchStartDollyPan(e){this.enableZoom&&this._handleTouchStartDolly(e),this.enablePan&&this._handleTouchStartPan(e)}_handleTouchStartDollyRotate(e){this.enableZoom&&this._handleTouchStartDolly(e),this.enableRotate&&this._handleTouchStartRotate(e)}_handleTouchMoveRotate(e){if(this._pointers.length==1)this._rotateEnd.set(e.pageX,e.pageY);else{const i=this._getSecondPointerPosition(e),r=.5*(e.pageX+i.x),s=.5*(e.pageY+i.y);this._rotateEnd.set(r,s)}this._rotateDelta.subVectors(this._rotateEnd,this._rotateStart).multiplyScalar(this.rotateSpeed);const n=this.domElement;this._rotateLeft(jn*this._rotateDelta.x/n.clientHeight),this._rotateUp(jn*this._rotateDelta.y/n.clientHeight),this._rotateStart.copy(this._rotateEnd)}_handleTouchMovePan(e){if(this._pointers.length===1)this._panEnd.set(e.pageX,e.pageY);else{const n=this._getSecondPointerPosition(e),i=.5*(e.pageX+n.x),r=.5*(e.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(e){const n=this._getSecondPointerPosition(e),i=e.pageX-n.x,r=e.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=(e.pageX+n.x)*.5,a=(e.pageY+n.y)*.5;this._updateZoomParameters(o,a)}_handleTouchMoveDollyPan(e){this.enableZoom&&this._handleTouchMoveDolly(e),this.enablePan&&this._handleTouchMovePan(e)}_handleTouchMoveDollyRotate(e){this.enableZoom&&this._handleTouchMoveDolly(e),this.enableRotate&&this._handleTouchMoveRotate(e)}_addPointer(e){this._pointers.push(e.pointerId)}_removePointer(e){delete this._pointerPositions[e.pointerId];for(let n=0;n.9&&(o.visible=!1)),this.axis==="Y"&&(qt.setFromEuler(Mc.set(0,0,Math.PI/2)),o.quaternion.copy(i).multiply(qt),Math.abs(kt.copy(Ws).applyQuaternion(i).dot(this.eye))>.9&&(o.visible=!1)),this.axis==="Z"&&(qt.setFromEuler(Mc.set(0,Math.PI/2,0)),o.quaternion.copy(i).multiply(qt),Math.abs(kt.copy(Ha).applyQuaternion(i).dot(this.eye))>.9&&(o.visible=!1)),this.axis==="XYZE"&&(qt.setFromEuler(Mc.set(0,Math.PI/2,0)),kt.copy(this.rotationAxis),o.quaternion.setFromRotationMatrix(x_.lookAt(__,kt,Ws)),o.quaternion.multiply(qt),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),An.set(1e-10,1e-10,1e-10).add(this.worldPositionStart).sub(this.worldPosition).multiplyScalar(-1),An.applyQuaternion(this.worldQuaternionStart.clone().invert()),o.scale.copy(An),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(kt.copy(Va).applyQuaternion(i).dot(this.eye))>.99&&(o.scale.set(1e-10,1e-10,1e-10),o.visible=!1),o.name==="Y"&&Math.abs(kt.copy(Ws).applyQuaternion(i).dot(this.eye))>.99&&(o.scale.set(1e-10,1e-10,1e-10),o.visible=!1),o.name==="Z"&&Math.abs(kt.copy(Ha).applyQuaternion(i).dot(this.eye))>.99&&(o.scale.set(1e-10,1e-10,1e-10),o.visible=!1),o.name==="XY"&&Math.abs(kt.copy(Ha).applyQuaternion(i).dot(this.eye))<.2&&(o.scale.set(1e-10,1e-10,1e-10),o.visible=!1),o.name==="YZ"&&Math.abs(kt.copy(Va).applyQuaternion(i).dot(this.eye))<.2&&(o.scale.set(1e-10,1e-10,1e-10),o.visible=!1),o.name==="XZ"&&Math.abs(kt.copy(Ws).applyQuaternion(i).dot(this.eye))<.2&&(o.scale.set(1e-10,1e-10,1e-10),o.visible=!1)):this.mode==="rotate"&&(Ec.copy(i),kt.copy(this.eye).applyQuaternion(qt.copy(i).invert()),o.name.search("E")!==-1&&o.quaternion.setFromRotationMatrix(x_.lookAt(this.eye,__,Ws)),o.name==="X"&&(qt.setFromAxisAngle(Va,Math.atan2(-kt.y,kt.z)),qt.multiplyQuaternions(Ec,qt),o.quaternion.copy(qt)),o.name==="Y"&&(qt.setFromAxisAngle(Ws,Math.atan2(kt.x,kt.z)),qt.multiplyQuaternions(Ec,qt),o.quaternion.copy(qt)),o.name==="Z"&&(qt.setFromAxisAngle(Ha,Math.atan2(kt.y,kt.x)),qt.multiplyQuaternions(Ec,qt),o.quaternion.copy(qt))),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(e)}}class aF extends be{constructor(){super(new Cl(1e5,1e5,2,2),new Ms({visible:!1,wireframe:!0,side:Vn,transparent:!0,opacity:.1,toneMapped:!1})),this.isTransformControlsPlane=!0,this.type="TransformControlsPlane"}updateMatrixWorld(e){let n=this.space;switch(this.position.copy(this.worldPosition),this.mode==="scale"&&(n="local"),Tc.copy(Va).applyQuaternion(n==="local"?this.worldQuaternion:Hc),Ra.copy(Ws).applyQuaternion(n==="local"?this.worldQuaternion:Hc),Da.copy(Ha).applyQuaternion(n==="local"?this.worldQuaternion:Hc),kt.copy(Ra),this.mode){case"translate":case"scale":switch(this.axis){case"X":kt.copy(this.eye).cross(Tc),Gi.copy(Tc).cross(kt);break;case"Y":kt.copy(this.eye).cross(Ra),Gi.copy(Ra).cross(kt);break;case"Z":kt.copy(this.eye).cross(Da),Gi.copy(Da).cross(kt);break;case"XY":Gi.copy(Da);break;case"YZ":Gi.copy(Tc);break;case"XZ":kt.copy(Da),Gi.copy(Ra);break;case"XYZ":case"E":Gi.set(0,0,0);break}break;default:Gi.set(0,0,0)}Gi.length()===0?this.quaternion.copy(this.cameraQuaternion):(y_.lookAt(An.set(0,0,0),Gi,kt),this.quaternion.setFromRotationMatrix(y_)),super.updateMatrixWorld(e)}}const sr={},lo={};function lF(t){let e;switch(t.type.value){case"standard_material":e=cF(t);break;case"line_material":e=uF(t);break;case"point_material":e=dF(t);break;case"physical_material":e=fF(t);break}lo[t.guid.value]=e,sr[t.geometry_guid.value]=t.guid.value,gF(t.geometry_guid.value,e)}function cF(t){let e=t.color.value;e=e.replace("#","0x");let n=t.emissive.value;return n=n.replace("#","0x"),new mo({color:parseInt(e),metalness:t.metalness.value,roughness:t.roughness.value,emissive:parseInt(n),emissiveIntensity:t.emissive_intensity.value,flatShading:t.flat_shading.value,wireframe:t.wireframe.value,side:Vn})}function uF(t){let e=t.color.value;return e=e.replace("#","0x"),new Si({color:parseInt(e)})}function dF(t){let e=t.color.value;return e=e.replace("#","0x"),new qu({color:parseInt(e),size:t.size.value})}function fF(t){let e=t.color.value;e=e.replace("#","0x");let n=t.emissive.value;n=n.replace("#","0x");let i=t.attenuation_color.value;i=i.replace("#","0x");let r=t.sheen_color.value;r=r.replace("#","0x");let s=t.specular_color.value;return s=s.replace("#","0x"),new A2({color:parseInt(e),metalness:t.metalness.value,roughness:t.roughness.value,emissive:parseInt(n),emissiveIntensity:t.emissive_intensity.value,flatShading:t.flat_shading.value,wireframe:t.wireframe.value,side:Vn,anisotropy:t.anisotropy.value,anisotropyRotation:t.anisotropy_rotation.value,attenuationColor:parseInt(i),attenuationDistance:t.attenuation_distance.value,clearcoat:t.clearcoat.value,clearcoatRoughness:t.clearcoat_roughness.value,dispersion:t.dispersion.value,ior:t.ior.value,iridescence:t.iridescence.value,iridescenceIOR:t.iridescence_ior.value,iridescenceThicknessRange:[t.iridescence_thickness_start.value,t.iridescence_thickness_end.value],reflectivity:t.reflectivity.value,sheen:t.sheen.value,sheenColor:parseInt(r),specularColor:parseInt(s),sheenRoughness:t.sheen_roughness.value,specularIntensity:t.specular_intensity.value,thickness:t.thickness.value,transmission:t.transmission.value})}const Jn={},hF=["Line","Point","Vector","Frame","Plane","Polyline"];function pF(t){hF.includes(t.name)&&mF(t);const e=t.guid,n=Jn[e],i=t.buildGeometry();if(i instanceof be)console.log("True");else{console.log("False");return}if(!(i instanceof be))return;const r=i.geometry;if(r.computeBoundingSphere(),r.computeBoundingBox(),n instanceof be){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(sr[e]){const s=sr[e];lo[s]&&(i.material=lo[s])}else i.material=new mo({color:35071,roughness:.5,metalness:.5});if(Ot.add(i),Jn[e]=i,Yx.value){const s=new XP(i.geometry),o=new um(s,new Si({color:0}));o.layers.set(1),i.add(o)}}}function mF(t){const e=t.buildGeometry(),n=t.guid;let i;if(sr[n]){const r=sr[n];lo[r]&&(i=lo[r])}else return;e instanceof vn||e instanceof dm?e.material=i:(e instanceof bm||e instanceof void 0)&&e.setColor(i.color),Ot.add(e),Jn[n]=e}function gF(t,e){const n=Jn[t];if(n){if(n){n.material=e;return}(n instanceof bm||n instanceof void 0)&&n.setColor(e.color)}}let hu,Zo,Qo,b_=!1,S_=!1,w_;const vF=new mo({color:"orange",emissive:"yellow",emissiveIntensity:.1});function Fr(t){Qo&&Qo.setMode(t)}class _F{tControl;constructor(e){if(b_)throw new Error("TransformControlsManager has already been initialized.");this.tControl=new QO(Wt,nn.domElement),Ot.add(this.tControl.getHelper()),this.setupEventListeners(),b_=!0}setupEventListeners(){this.tControl.addEventListener("dragging-changed",e=>{In.enabled=!e.value}),window.addEventListener("keydown",e=>{if(!(e.altKey||e.ctrlKey||e.metaKey))switch(e.key){case"w":if(!yn.value)break;Fr("translate"),Nr.value="translate";break;case"e":if(!yn.value)break;Fr("rotate"),Nr.value="rotate";break;case"r":if(!yn.value)break;Fr("scale"),Nr.value="scale";break;case"p":yn.value=!yn.value;break;case"Escape":this.tControl.detach(),Gc();break}})}get controls(){return this.tControl}}class xF{raycaster;pickedObject;constructor(){if(S_)throw new Error("PickHelper has already been initialized.");this.raycaster=new Vb,this.raycaster.layers.set(0),this.pickedObject=null,this.setupEventListeners(),S_=!0}setupEventListeners(){window.addEventListener("keydown",e=>{e.key==="Escape"&&this.pickedObject&&(this.dehighlightObject(this.pickedObject),Gc())}),hu={x:0,y:0},window.addEventListener("mousedown",e=>{e.button===0&&(Qo.dragging||(bF(e),this.pick(hu,Ot)))})}getPickedObject(e){this.raycaster.setFromCamera(e,Wt);const n=this.raycaster.intersectObjects(Jn?Object.values(Jn):[],!0);return n.length?n[0].object:null}getPickedObjectKey(e){return Object.keys(Jn).find(n=>Jn[n]===e)}sendMessage(e){Em({dispatch:"object_picked",guid:e})}pick(e,n){if(!yn.value||Fu.value)return;const i=this.getPickedObject(e);if(i){this.pickedObject!==i&&this.pickedObject!==null&&(this.dehighlightObject(this.pickedObject),Gc()),this.pickedObject=i,Qo.attach(this.pickedObject);const r=this.getPickedObjectKey(this.pickedObject);r&&this.sendMessage(r),this.highlightObject(this.pickedObject)}else this.pickedObject&&(this.dehighlightObject(this.pickedObject),this.pickedObject=null,Qo.detach(),Gc())}dehighlightObject(e){const n=lo[w_];e.material=n}highlightObject(e){const n=Object.keys(Jn).find(i=>Jn[i]===e);w_=sr[n],e.material=vF}}function Gc(){tS({}),Rp.splice(0)}function yF(t){const e=Zo.getBoundingClientRect();return{x:(t.clientX-e.left)*(Zo.width/e.width),y:(t.clientY-e.top)*(Zo.height/e.height)}}function bF(t){const e=yF(t);hu.x=e.x/Zo.width*2-1,hu.y=e.y/Zo.height*-2+1}function SF(t){return Zo=document.querySelector("canvas"),Qo=new _F().controls,t}const wF=.5;let MF=15132390,EF=0,pu=null,mu=null;function TF(t){const e=t>>16&255,n=t>>8&255,i=t&255;return(e+n+i)/765}function AF(t){return TF(t){if(t.altKey||t.ctrlKey||t.metaKey)return;const e=LF(t.code);e&&(Mm(e),t.preventDefault())});window.addEventListener("resize",()=>{Wt.aspect=window.innerWidth/window.innerHeight,Wt.updateProjectionMatrix(),nn.setSize(window.innerWidth,window.innerHeight)});function Mm(t){const e=In.target.clone(),n=DF[t].clone().normalize(),i=Wt.position.distanceTo(e);Wt.position.copy(e.clone().add(n.multiplyScalar(i))),In.update()}function ms(t){Mm(t)}function LF(t){return IF.get(t)??null}function OF(t){switch(t.type.value){case"background_color":FF(t);break;case"controls_damping":In.enableDamping=t.damping.value;break;case"world_axis":Qb.visible=t.show.value;break;case"picker":yn.value=t.enabled.value;break;case"camera_fov":Wt.fov=t.fov.value,Wt.updateProjectionMatrix();break;case"camera_zoom":Wt.zoom=t.zoom.value,Wt.updateProjectionMatrix();break;case"camera_position":Wt.position.set(t.x.value,t.y.value,t.z.value),In.update();break;case"camera_target":In.target.set(t.x.value,t.y.value,t.z.value),In.update();break;case"camera_view":{const e=t.preset.value;e&&Mm(e);break}case"show_edges":Yx.value=t.show.value;break;default:console.warn("Unknown scene type:",t.type.value)}}function FF(t){let e=t.color.value;e=e.replace("#","0x"),e=parseInt(e),PF(e)}function UF(t){const e=t.guid.value;if(e in Jn){const n=Jn[e];Ot.remove(n),delete Jn[e]}e in sr&&delete sr[e]}class kF extends vn{constructor(e,n){const i=[1,1,0,-1,1,0,-1,-1,0,1,-1,0,1,1,0],r=new _t;r.setAttribute("position",new ct(i,3)),r.computeBoundingSphere();const s=new Si({fog:!1});super(r,s),this.light=e,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 _t;a.setAttribute("position",new ct(o,3)),a.computeBoundingSphere(),this.add(new be(a,new Ms({side:Ln,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 e=this.material.color,n=Math.max(e.r,e.g,e.b);n>1&&e.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 wd extends be{constructor(){const e=wd.SkyShader,n=new Fi({name:e.name,uniforms:Tb.clone(e.uniforms),vertexShader:e.vertexShader,fragmentShader:e.fragmentShader,side:Ln,depthWrite:!1});super(new Jt(1,1,1),n),this.isSky=!0}}wd.SkyShader={name:"SkyShader",uniforms:{turbidity:{value:2},rayleigh:{value:1},mieCoefficient:{value:.005},mieDirectionalG:{value:.8},sunPosition:{value:new N},up:{value:new N(0,1,0)}},vertexShader:` uniform vec3 sunPosition; uniform float rayleigh; uniform float turbidity; @@ -4164,4 +4164,4 @@ void main() { #include }`};const tn={},yi={};function BF(t){t.type.value=="point_light"?zF(t):t.type.value=="spot_light"?VF(t):t.type.value=="rect_light"?HF(t):t.type.value=="sunlight"?GF(t):t.type.value=="sky"?WF(t):t.type.value=="ambient_light"&&qF(t)}function zF(t){let e,n;tn[t.guid.value]?e=tn[t.guid.value]:(e=new U2,Ot.add(e));let i=t.color.value;i=i.replace("#","0x"),i=parseInt(i),e.color.set(i),e.intensity=t.intensity.value,e.distance=t.distance.value,e.decay=t.decay.value,e.position.set(t.x.value,t.y.value,t.z.value),e.castShadow=!0,e.shadow.bias=-.002,e.shadow.normalBias=.02,yi[t.guid.value]&&t.helper.value?(n=yi[t.guid.value],n.update()):t.helper.value&&(n=new H2(e,.5),Ot.add(n)),tn[t.guid.value]=e,n&&(yi[t.guid.value]=n)}function VF(t){let e,n;tn[t.guid.value]?(e=tn[t.guid.value],Ot.remove(e.target)):(e=new O2,Ot.add(e));let i=t.color.value;i=i.replace("#","0x"),i=parseInt(i),e.color.set(i),e.intensity=t.intensity.value,e.distance=t.distance.value,e.angle=t.angle.value,e.penumbra=t.penumbra.value,e.decay=t.decay.value,e.position.set(t.x.value,t.y.value,t.z.value);const r=new Ft;r.position.set(t.tx.value,t.ty.value,t.tz.value),Ot.add(r),e.target=r,Ot.remove(r),e.castShadow=!0,e.shadow.bias=-.002,e.shadow.normalBias=.02,yi[t.guid.value]&&t.helper.value?(n=yi[t.guid.value],n.update()):t.helper.value&&(n=new V2(e),Ot.add(n)),tn[t.guid.value]=e,n&&(yi[t.guid.value]=n)}function HF(t){let e,n;tn[t.guid.value]?e=tn[t.guid.value]:(e=new B2,Ot.add(e));let i=t.color.value;i=i.replace("#","0x"),i=parseInt(i),e.color.set(i),e.intensity=t.intensity.value,e.width=t.width.value,e.height=t.height.value,e.position.set(t.x.value,t.y.value,t.z.value),e.lookAt(t.tx.value,t.ty.value,t.tz.value),yi[t.guid.value]&&t.helper.value?n=yi[t.guid.value]:t.helper.value&&(n=new kF(e),Ot.add(n)),tn[t.guid.value]=e,n&&(yi[t.guid.value]=n)}function GF(t){let e,n;tn[t.guid.value]?e=tn[t.guid.value]:(e=new Bb,Ot.add(e));let i=t.color.value;if(i=i.replace("#","0x"),i=parseInt(i),e.color.set(i),e.intensity=t.intensity.value,e.position.set(t.x.value,t.y.value,t.z.value),e.target.position.set(t.tx.value,t.ty.value,t.tz.value),e.castShadow=!0,yi[t.guid.value]&&t.helper.value)n=yi[t.guid.value],n.update();else if(t.helper.value){const r=new G2(e);Ot.add(r)}tn[t.guid.value]=e,n&&(yi[t.guid.value]=n)}function WF(t){let e,n,i;tn[t.guid.value]?(e=tn[t.guid.value],n=tn[t.guid.value+"_sun"],i=tn[t.guid.value+"_ambient"]):(e=new wd,n=new Bb(16777215,1),i=new zb(16777215,.6),Ot.add(e),Ot.add(n),Ot.add(i)),e.scale.setScalar(1e3),e.material.uniforms.up.value=new N(0,0,1),e.material.uniforms.turbidity.value=t.turbidity.value,e.material.uniforms.rayleigh.value=t.rayleigh.value,e.material.uniforms.mieCoefficient.value=t.mie_coefficient.value,e.material.uniforms.mieDirectionalG.value=t.mie_directional_g.value;let r=new N;const s=sp.degToRad(90-t.elevation.value),o=sp.degToRad(t.azimuth.value);r.setFromSphericalCoords(1,s,o),e.material.uniforms.sunPosition.value=r,n.position.copy(e.material.uniforms.sunPosition.value),n.color.copy(M_(t.elevation.value)),i.color.copy(M_(t.elevation.value)).multiplyScalar(.6),tn[t.guid.value]=e,tn[t.guid.value+"_sun"]=n,tn[t.guid.value+"_ambient"]=i}function M_(t){if(t>10)return new nt(16777215);if(t>0){const e=t/10;return new nt(16777164).lerp(new nt(16777215),e)}if(t>-5){const e=(t+5)/5;return new nt(16764006).lerp(new nt(16777164),e)}return new nt(16764006)}function qF(t){let e;tn[t.guid.value]?e=tn[t.guid.value]:(e=new zb,Ot.add(e));let n=t.color.value;n=n.replace("#","0x"),n=parseInt(n),e.color.set(n),e.intensity=t.intensity.value,e.color.needsUpdate=!0,console.log(t.intensity.value)}const Md=On([]);function XF(t){const e=t.type.value;switch(e){case"button":$F(t),Ic.isVisible=!0;break;case"slider":jF(t),Ic.isVisible=!0;break;case"number_field":YF(t),Ic.isVisible=!0;break;default:console.warn("Unknown component type:",e)}}function $F(t){const e={id:Date.now(),component:"Button",label:t.label?.value,props:{text:t.text.value,variant:t.variant.value},action:t.guid.value};Md.push(e)}function jF(t){const e={id:Date.now(),component:"Slider",label:t.label?.value,props:{min:t.min.value,max:t.max.value,step:t.step.value,defaultValue:[t.default_value.value]},action:t.guid.value};Md.push(e)}function YF(t){const e={id:Date.now(),component:"NumberField",label:t.label?.value,props:{min:t.min.value,max:t.max.value,step:t.step.value,value:t.value.value},action:t.guid.value};Md.push(e)}function Wf(t,e){const n={dispatch:"ui_callback",action:t,value:null};e!==void 0&&(n.value=e),Em(n)}class JF extends vm{constructor(e,n={}){const i=n.font;if(i===void 0)super();else{const r=i.generateShapes(e,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 KF extends _m{constructor(e){super(e)}load(e,n,i,r){const s=this,o=new N2(this.manager);o.setPath(this.path),o.setRequestHeader(this.requestHeader),o.setWithCredentials(this.withCredentials),o.load(e,function(a){const l=s.parse(JSON.parse(a));n&&n(l)},i,r)}parse(e){return new ZF(e)}}class ZF{constructor(e){this.isFont=!0,this.type="Font",this.data=e}generateShapes(e,n=100,i="ltr"){const r=[],s=QF(e,n,this.data,i);for(let o=0,a=s.length;o{i.load(r,a=>{qf[n]=a,s(a)},void 0,a=>o(a))})}async function iU(t){const e=t.text.value,n=t.font.value,i=t.weight.value,r=t.depth.value,s=t.size.value,o=await nU(n,i),a=new JF(e,{font:o,size:s,depth:r});let l;if(sr[t.guid.value]){const _=sr[t.guid.value];l=lo[_]}else l=new mo({color:65535,side:Vn});let c;t.centered.value?(a.computeBoundingBox(),c=-.5*(a.boundingBox.max.x-a.boundingBox.min.x)):c=0;const u=new N(t.point_x.value,t.point_y.value,t.point_z.value),d=new N(t.direction_x.value,t.direction_y.value,t.direction_z.value),f=new N(t.up_x.value,t.up_y.value,t.up_z.value),h=new N().crossVectors(d,f).normalize(),g=d.clone().normalize(),v=f.clone().normalize(),m=new yt().makeBasis(g,v,h);m.setPosition(u);const p=new Te(a,l);p.position.x=c,p.applyMatrix4(m),Jn[t.guid.value]=p,Ot.add(p)}function rU(t){const e=FO(t);if(e instanceof Kb){sU(e);return}else pF(e)}function sU(t){const e=t.data.items;switch(e.dispatch.value){case"material":lF(e);break;case"light":BF(e);break;case"scene":OF(e);break;case"theme":CF(e);break;case"ui":XF(e);break;case"text":tU(e);break;case"object_infos":tS(e);break;case"object_action":dU(e);break;case"remove_object":UF(e);break;default:console.warn("Unknown dispatch value:",e.dispatch.value)}}let Er=null;function oU(){const t=()=>{Er=new WebSocket("ws://127.0.0.1:9001/ws"),Er.binaryType="arraybuffer",Er.onopen=()=>{sessionStorage.getItem("reloaded")||(sessionStorage.setItem("reloaded","true"),window.location.reload())},Er.onmessage=e=>{if(e.data instanceof ArrayBuffer){const n=new Uint8Array(e.data);rU(n)}else console.warn("❓ Received non-binary data:",e.data)},Er.onerror=e=>{console.error("WebSocket error:",e)},Er.onclose=()=>{sessionStorage.removeItem("reloaded"),setTimeout(t,1e3)}};t()}function aU(t){Er&&Er.readyState===WebSocket.OPEN?Er.send(t):console.error("WebSocket is not open. Unable to send message.")}function Em(t){try{const e=JSON.stringify(t),n=lU(e);aU(n)}catch{}}function lU(t){return new TextEncoder().encode(t).buffer}function cU(){Ti.isVisible=!0}function uU(){Ti.isVisible=!1}function tS(t){delete t.dispatch,t!=null&&(Ti.data=t)}function dU(t){console.log("Received object action:",t);const e={guid:t.guid.value,label:t.label.value,type:t.type.value,objectGuid:t.object_guid.value,text:t.text.value};Rp.push(e)}function fU(t,e){const n={dispatch:"object_action_callback",action_guid:t.guid,value:null,object_guid:t.objectGuid};e!==void 0&&(n.value=e),Em(n)}document.addEventListener("keydown",t=>{(t.key==="I"||t.key==="i")&&(Ti.isVisible?uU():cU())});function Tm(t){const e=ke(!1);function n(i){const r=document.getElementById(t),s=r&&r.matches(":hover");e.value=s}return ti(()=>{window.addEventListener("mousemove",n)}),fa(()=>{window.removeEventListener("mousemove",n)}),{isHovered:e}}const hU=t=>{for(const e in t)if(e.startsWith("aria-")||e==="role"||e==="title")return!0;return!1};const E_=t=>t==="";const pU=(...t)=>t.filter((e,n,i)=>!!e&&e.trim()!==""&&i.indexOf(e)===n).join(" ").trim();const T_=t=>t.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase();const mU=t=>t.replace(/^([A-Z])|[\s-_]+(\w)/g,(e,n,i)=>i?i.toUpperCase():n.toLowerCase());const gU=t=>{const e=mU(t);return e.charAt(0).toUpperCase()+e.slice(1)};var Ia={xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":2,"stroke-linecap":"round","stroke-linejoin":"round"};const vU=({name:t,iconNode:e,absoluteStrokeWidth:n,"absolute-stroke-width":i,strokeWidth:r,"stroke-width":s,size:o=Ia.width,color:a=Ia.stroke,...l},{slots:c})=>er("svg",{...Ia,...l,width:o,height:o,stroke:a,"stroke-width":E_(n)||E_(i)||n===!0||i===!0?Number(r||s||Ia["stroke-width"])*24/Number(o):r||s||Ia["stroke-width"],class:pU("lucide",l.class,...t?[`lucide-${T_(gU(t))}-icon`,`lucide-${T_(t)}`]:["lucide-icon"]),...!c.default&&!hU(l)&&{"aria-hidden":"true"}},[...e.map(u=>er(...u)),...c.default?[c.default()]:[]]);const pn=(t,e)=>(n,{slots:i,attrs:r})=>er(vU,{...r,...n,iconNode:e,name:t},i);const nS=pn("arrow-big-left-dash",[["path",{d:"M13 9a1 1 0 0 1-1-1V5.061a1 1 0 0 0-1.811-.75l-6.835 6.836a1.207 1.207 0 0 0 0 1.707l6.835 6.835a1 1 0 0 0 1.811-.75V16a1 1 0 0 1 1-1h2a1 1 0 0 0 1-1v-4a1 1 0 0 0-1-1z",key:"p8w4w5"}],["path",{d:"M20 9v6",key:"14roy0"}]]);const iS=pn("arrow-big-right-dash",[["path",{d:"M11 9a1 1 0 0 0 1-1V5.061a1 1 0 0 1 1.811-.75l6.836 6.836a1.207 1.207 0 0 1 0 1.707l-6.836 6.835a1 1 0 0 1-1.811-.75V16a1 1 0 0 0-1-1H9a1 1 0 0 1-1-1v-4a1 1 0 0 1 1-1z",key:"67vhrh"}],["path",{d:"M4 9v6",key:"bns7oa"}]]);const _U=pn("box",[["path",{d:"M21 8a2 2 0 0 0-1-1.73l-7-4a2 2 0 0 0-2 0l-7 4A2 2 0 0 0 3 8v8a2 2 0 0 0 1 1.73l7 4a2 2 0 0 0 2 0l7-4A2 2 0 0 0 21 16Z",key:"hh9hay"}],["path",{d:"m3.3 7 8.7 5 8.7-5",key:"g66t2b"}],["path",{d:"M12 22V12",key:"d0xqtd"}]]);const xU=pn("camera",[["path",{d:"M13.997 4a2 2 0 0 1 1.76 1.05l.486.9A2 2 0 0 0 18.003 7H20a2 2 0 0 1 2 2v9a2 2 0 0 1-2 2H4a2 2 0 0 1-2-2V9a2 2 0 0 1 2-2h1.997a2 2 0 0 0 1.759-1.048l.489-.904A2 2 0 0 1 10.004 4z",key:"18u6gg"}],["circle",{cx:"12",cy:"13",r:"3",key:"1vg3eu"}]]);const yU=pn("clipboard-list",[["rect",{width:"8",height:"4",x:"8",y:"2",rx:"1",ry:"1",key:"tgr4d6"}],["path",{d:"M16 4h2a2 2 0 0 1 2 2v14a2 2 0 0 1-2 2H6a2 2 0 0 1-2-2V6a2 2 0 0 1 2-2h2",key:"116196"}],["path",{d:"M12 11h4",key:"1jrz19"}],["path",{d:"M12 16h4",key:"n85exb"}],["path",{d:"M8 11h.01",key:"1dfujw"}],["path",{d:"M8 16h.01",key:"18s6g9"}]]);const bU=pn("house",[["path",{d:"M15 21v-8a1 1 0 0 0-1-1h-4a1 1 0 0 0-1 1v8",key:"5wwlr5"}],["path",{d:"M3 10a2 2 0 0 1 .709-1.528l7-6a2 2 0 0 1 2.582 0l7 6A2 2 0 0 1 21 10v9a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2z",key:"r6nss1"}]]);const SU=pn("image-down",[["path",{d:"M10.3 21H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h14a2 2 0 0 1 2 2v10l-3.1-3.1a2 2 0 0 0-2.814.014L6 21",key:"9csbqa"}],["path",{d:"m14 19 3 3v-5.5",key:"9ldu5r"}],["path",{d:"m17 22 3-3",key:"1nkfve"}],["circle",{cx:"9",cy:"9",r:"2",key:"af1f0g"}]]);const wU=pn("minus",[["path",{d:"M5 12h14",key:"1ays0h"}]]);const MU=pn("moon",[["path",{d:"M20.985 12.486a9 9 0 1 1-9.473-9.472c.405-.022.617.46.402.803a6 6 0 0 0 8.268 8.268c.344-.215.825-.004.803.401",key:"kfwtm"}]]);const EU=pn("move-3d",[["path",{d:"M5 3v16h16",key:"1mqmf9"}],["path",{d:"m5 19 6-6",key:"jh6hbb"}],["path",{d:"m2 6 3-3 3 3",key:"tkyvxa"}],["path",{d:"m18 16 3 3-3 3",key:"1d4glt"}]]);const TU=pn("plane",[["path",{d:"M17.8 19.2 16 11l3.5-3.5C21 6 21.5 4 21 3c-1-.5-3 0-4.5 1.5L13 8 4.8 6.2c-.5-.1-.9.1-1.1.5l-.3.5c-.2.5-.1 1 .3 1.3L9 12l-2 3H4l-1 1 3 2 2 3 1-1v-3l3-2 3.5 5.3c.3.4.8.5 1.3.3l.5-.2c.4-.3.6-.7.5-1.2z",key:"1v9wt8"}]]);const rS=pn("plus",[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]]);const AU=pn("pointer-off",[["path",{d:"M10 4.5V4a2 2 0 0 0-2.41-1.957",key:"jsi14n"}],["path",{d:"M13.9 8.4a2 2 0 0 0-1.26-1.295",key:"hirc7f"}],["path",{d:"M21.7 16.2A8 8 0 0 0 22 14v-3a2 2 0 1 0-4 0v-1a2 2 0 0 0-3.63-1.158",key:"1jxb2e"}],["path",{d:"m7 15-1.8-1.8a2 2 0 0 0-2.79 2.86L6 19.7a7.74 7.74 0 0 0 6 2.3h2a8 8 0 0 0 5.657-2.343",key:"10r7hm"}],["path",{d:"M6 6v8",key:"tv5xkp"}],["path",{d:"m2 2 20 20",key:"1ooewy"}]]);const CU=pn("pointer",[["path",{d:"M22 14a8 8 0 0 1-8 8",key:"56vcr3"}],["path",{d:"M18 11v-1a2 2 0 0 0-2-2a2 2 0 0 0-2 2",key:"1agjmk"}],["path",{d:"M14 10V9a2 2 0 0 0-2-2a2 2 0 0 0-2 2v1",key:"wdbh2u"}],["path",{d:"M10 9.5V4a2 2 0 0 0-2-2a2 2 0 0 0-2 2v10",key:"1ibuk9"}],["path",{d:"M18 11a2 2 0 1 1 4 0v3a8 8 0 0 1-8 8h-2c-2.8 0-4.5-.86-5.99-2.34l-3.6-3.6a2 2 0 0 1 2.83-2.82L7 15",key:"g6ys72"}]]);const PU=pn("rabbit",[["path",{d:"M13 16a3 3 0 0 1 2.24 5",key:"1epib5"}],["path",{d:"M18 12h.01",key:"yjnet6"}],["path",{d:"M18 21h-8a4 4 0 0 1-4-4 7 7 0 0 1 7-7h.2L9.6 6.4a1 1 0 1 1 2.8-2.8L15.8 7h.2c3.3 0 6 2.7 6 6v1a2 2 0 0 1-2 2h-1a3 3 0 0 0-3 3",key:"ue9ozu"}],["path",{d:"M20 8.54V4a2 2 0 1 0-4 0v3",key:"49iql8"}],["path",{d:"M7.612 12.524a3 3 0 1 0-1.6 4.3",key:"1e33i0"}]]);const RU=pn("rotate-3d",[["path",{d:"M16.466 7.5C15.643 4.237 13.952 2 12 2 9.239 2 7 6.477 7 12s2.239 10 5 10c.342 0 .677-.069 1-.2",key:"10n0gc"}],["path",{d:"m15.194 13.707 3.814 1.86-1.86 3.814",key:"16shm9"}],["path",{d:"M19 15.57c-1.804.885-4.274 1.43-7 1.43-5.523 0-10-2.239-10-5s4.477-5 10-5c4.838 0 8.873 1.718 9.8 4",key:"1lxi77"}]]);const DU=pn("scale-3d",[["path",{d:"M5 7v11a1 1 0 0 0 1 1h11",key:"13dt1j"}],["path",{d:"M5.293 18.707 11 13",key:"ezgbsx"}],["circle",{cx:"19",cy:"19",r:"2",key:"17f5cg"}],["circle",{cx:"5",cy:"5",r:"2",key:"1gwv83"}]]);const IU=pn("sun-medium",[["circle",{cx:"12",cy:"12",r:"4",key:"4exip2"}],["path",{d:"M12 3v1",key:"1asbbs"}],["path",{d:"M12 20v1",key:"1wcdkc"}],["path",{d:"M3 12h1",key:"lp3yf2"}],["path",{d:"M20 12h1",key:"1vloll"}],["path",{d:"m18.364 5.636-.707.707",key:"1hakh0"}],["path",{d:"m6.343 17.657-.707.707",key:"18m9nf"}],["path",{d:"m5.636 5.636.707.707",key:"1xv1c5"}],["path",{d:"m17.657 17.657.707.707",key:"vl76zb"}]]);const NU=pn("trash-2",[["path",{d:"M10 11v6",key:"nco0om"}],["path",{d:"M14 11v6",key:"outv1u"}],["path",{d:"M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6",key:"miytrc"}],["path",{d:"M3 6h18",key:"d0wm0j"}],["path",{d:"M8 6V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2",key:"e791ji"}]]),Zr=(t,e)=>{const n=t.__vccOpts||t;for(const[i,r]of e)n[i]=r;return n},LU={class:"right-bar"},OU={id:"data-container"},FU={class:"metadata item"},UU={class:"data-container"},kU={__name:"ObjectInfo",setup(t){Ti.data&&Object.fromEntries(Object.entries(Ti.data).filter(([i])=>i!=="dispatch"));const{isHovered:e}=Tm("info-panel");Wn(()=>{Fu.value=e.value});const n=()=>{Ti.isVisible=!Ti.isVisible};return(i,r)=>(me(),Ct("div",LU,[Ye("div",{class:Qt(["theme object-info",{"is-hidden":!E(Ti).isVisible}]),id:"info-panel"},[Ye("div",OU,[Ye("div",FU,[Ye("h1",{class:Qt(["text-lg font-bold section-title",{dark:E(qn).value==="dark"}])}," METADATA ",2),(me(!0),Ct(Kt,null,ta(E(Ti).data,(s,o)=>(me(),Ct("div",{key:o,class:"data-entry"},[Ye("p",null,[Ye("strong",null,Ci(o)+":",1),zt(" "+Ci(s.value),1)])]))),128))])]),Ye("div",UU,[Ye("h1",{class:Qt(["text-lg font-bold section-title",{dark:E(qn).value==="dark"}])}," FUNCTIONS ",2),(me(!0),Ct(Kt,null,ta(E(Rp),s=>(me(),Ct("div",{key:s,class:"single_data"},[s.type==="button"?(me(),Ie(E(ln),{key:0,variant:"outline",onClick:o=>E(fU)(s),class:"w-full"},{default:te(()=>[zt(Ci(s.text),1)]),_:2},1032,["onClick"])):fi("",!0)]))),128))]),ie(E(ln),{variant:"secondary",size:"icon",id:"closeObjectBar",onClick:r[0]||(r[0]=s=>n())},{default:te(()=>[ie(E(iS))]),_:1})],2),ie(E(ln),{variant:"secondary",size:"icon",id:"openObjectBar",class:Qt({"is-hidden":!E(Ti).isVisible}),onClick:r[1]||(r[1]=s=>n())},{default:te(()=>[ie(E(nS))]),_:1},8,["class"])]))}},BU=Zr(kU,[["__scopeId","data-v-95874573"]]);function sS(t){return{id:`view-${Date.now()}`,name:t,cameraPosition:{x:Wt.position.x,y:Wt.position.y,z:Wt.position.z},target:{x:In.target.x,y:In.target.y,z:In.target.z},zoom:Wt.zoom,fov:Wt.fov}}function zU(t){Wt.position.set(t.cameraPosition.x,t.cameraPosition.y,t.cameraPosition.z),In.target.set(t.target.x,t.target.y,t.target.z),Wt.zoom=t.zoom,Wt.fov=t.fov,Wt.updateProjectionMatrix(),In.update()}function A_(t,e){return!Number.isFinite(t)||t<=0?e:Math.max(16,Math.round(t))}function VU(t,e,n){const i=document.createElement("canvas");i.width=t,i.height=e;const r=i.getContext("2d");if(!r)throw new Error("Unable to create screenshot canvas context");const s=nn.domElement,o=s.getBoundingClientRect(),a=Math.round(o.width)||s.clientWidth||s.width,l=Math.round(o.height)||s.clientHeight||s.height;n==="jpg"?(r.fillStyle="#ffffff",r.fillRect(0,0,t,e)):r.clearRect(0,0,t,e);const c=Math.max(t/a,e/l),u=Math.round(a*c),d=Math.round(l*c),f=Math.floor((t-u)/2),h=Math.floor((e-d)/2);return r.drawImage(s,f,h,u,d),i}function HU(t,e){const n=document.createElement("a");n.download=e,n.href=t,n.click()}function GU(t){return`compas-view-${new Date().toISOString().replace(/[:.]/g,"-")}.${t}`}function oS(t={}){In.update(),nn.render(Ot,Wt);const e=t.format??"png",n=nn.domElement.width||nn.domElement.clientWidth,i=nn.domElement.height||nn.domElement.clientHeight,r=A_(t.width??n,n),s=A_(t.height??i,i),o=VU(r,s,e),a=e==="jpg"?"image/jpeg":e==="webp"?"image/webp":"image/png",l=e==="jpg"?t.quality??.92:void 0,c=e==="jpg"?"jpg":e==="webp"?"webp":"png",u=t.fileName??GU(c),d=o.toDataURL(a,l);HU(d,u)}function WU(t){if(t.ctrlKey||t.metaKey||t.altKey)return!0;const e=t.target;if(!e)return!1;const n=e.tagName;return n==="INPUT"||n==="TEXTAREA"||n==="SELECT"?!0:e.isContentEditable}function Am(t){const e=n=>{if(WU(n))return;const i=n.key.toLowerCase(),r=t[i];r&&(n.preventDefault(),r(n))};ti(()=>{document.addEventListener("keydown",e)}),da(()=>{document.removeEventListener("keydown",e)})}const dr=Ne({__name:"Kbd",props:{class:{}},setup(t){const e=t;return(n,i)=>(me(),Ct("kbd",{class:Qt(E(cr)("bg-muted text-muted-foreground pointer-events-none inline-flex h-5 w-fit min-w-5 items-center justify-center gap-1 rounded-sm px-1 font-sans text-xs font-medium select-none","[&_svg:not([class*='size-'])]:size-3","[[data-slot=tooltip-content]_&]:bg-background/20 [[data-slot=tooltip-content]_&]:text-background dark:[[data-slot=tooltip-content]_&]:bg-background/10",e.class))},[at(n.$slots,"default")],2))}}),Kn=Ne({__name:"Tooltip",props:{defaultOpen:{type:Boolean},open:{type:Boolean},delayDuration:{},disableHoverableContent:{type:Boolean},disableClosingTrigger:{type:Boolean},disabled:{type:Boolean},ignoreNonKeyboardFocus:{type:Boolean}},emits:["update:open"],setup(t,{emit:e}){const r=ar(t,e);return(s,o)=>(me(),Ie(E(dA),Ss(Yr(E(r))),{default:te(()=>[at(s.$slots,"default")]),_:3},16))}}),Zn=Ne({inheritAttrs:!1,__name:"TooltipContent",props:{forceMount:{type:Boolean},ariaLabel:{},asChild:{type:Boolean},as:{},side:{},sideOffset:{default:4},align:{},alignOffset:{},avoidCollisions:{type:Boolean},collisionBoundary:{},collisionPadding:{},arrowPadding:{},sticky:{},hideWhenDetached:{type:Boolean},positionStrategy:{},updatePositionStrategy:{},class:{}},emits:["escapeKeyDown","pointerDownOutside"],setup(t,{emit:e}){const n=t,i=e,r=co(n,"class"),s=ar(r,i);return(o,a)=>(me(),Ie(E(_A),null,{default:te(()=>[ie(E(gA),It({...E(s),...o.$attrs},{class:E(cr)("z-50 overflow-hidden rounded-md bg-primary px-3 py-1.5 text-xs text-primary-foreground animate-in fade-in-0 zoom-in-95 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",n.class,{dark:E(qn).value==="dark"})}),{default:te(()=>[at(o.$slots,"default")]),_:3},16,["class"])]),_:3}))}}),Bi=Ne({__name:"TooltipProvider",props:{delayDuration:{},skipDelayDuration:{},disableHoverableContent:{type:Boolean},disableClosingTrigger:{type:Boolean},disabled:{type:Boolean},ignoreNonKeyboardFocus:{type:Boolean},content:{}},setup(t){const e=t;return(n,i)=>(me(),Ie(E(lA),Ss(Yr(e)),{default:te(()=>[at(n.$slots,"default")]),_:3},16))}}),Qn=Ne({__name:"TooltipTrigger",props:{reference:{},asChild:{type:Boolean},as:{}},setup(t){const e=t;return(n,i)=>(me(),Ie(E(yA),Ss(Yr(e)),{default:te(()=>[at(n.$slots,"default")]),_:3},16))}}),qU=Ne({__name:"MoveButton",setup(t){function e(){Fr("translate"),Nr.value="translate"}return(n,i)=>(me(),Ie(E(Bi),{"delay-duration":600},{default:te(()=>[ie(E(Kn),null,{default:te(()=>[ie(E(Qn),null,{default:te(()=>[ie(E(ln),{variant:"secondary",size:"icon",class:Qt({active:E(Nr).value=="translate",disabled:!E(yn).value}),onClick:e,disabled:!E(yn).value},{default:te(()=>[ie(E(EU))]),_:1},8,["class","disabled"])]),_:1}),ie(E(Zn),{class:"z-1000",side:"bottom"},{default:te(()=>[Ye("p",null,[i[1]||(i[1]=zt("Move mode ",-1)),ie(E(dr),null,{default:te(()=>[...i[0]||(i[0]=[zt("W",-1)])]),_:1})])]),_:1})]),_:1})]),_:1}))}}),XU=Ne({__name:"RotateButton",setup(t){function e(){Fr("rotate"),Nr.value="rotate"}return(n,i)=>(me(),Ie(E(Bi),{"delay-duration":600},{default:te(()=>[ie(E(Kn),null,{default:te(()=>[ie(E(Qn),null,{default:te(()=>[ie(E(ln),{variant:"secondary",size:"icon",class:Qt({active:E(Nr).value=="rotate",disabled:!E(yn).value}),onClick:e,disabled:!E(yn).value},{default:te(()=>[ie(E(RU),{size:16,"stroke-width":2,"aria-hidden":"true"})]),_:1},8,["class","disabled"])]),_:1}),ie(E(Zn),{class:"z-1000",side:"bottom"},{default:te(()=>[Ye("p",null,[i[1]||(i[1]=zt("Rotate mode ",-1)),ie(E(dr),null,{default:te(()=>[...i[0]||(i[0]=[zt("E",-1)])]),_:1})])]),_:1})]),_:1})]),_:1}))}}),$U={class:"button-icon"},jU=Ne({__name:"ScaleButton",props:{active:{type:Boolean}},emits:["activated"],setup(t,{emit:e}){function n(){Fr("scale"),Nr.value="scale"}return(i,r)=>(me(),Ie(E(Bi),{"delay-duration":600},{default:te(()=>[ie(E(Kn),null,{default:te(()=>[ie(E(Qn),null,{default:te(()=>[ie(E(ln),{variant:"secondary",size:"icon",class:Qt(["toolbar-button",{active:E(Nr).value=="scale",disabled:!E(yn).value}]),onClick:n,disabled:!E(yn).value},{default:te(()=>[Ye("span",$U,[ie(E(DU),{size:16,"stroke-width":2,"aria-hidden":"true"})])]),_:1},8,["class","disabled"])]),_:1}),ie(E(Zn),{class:"z-1000",side:"bottom"},{default:te(()=>[Ye("p",null,[r[1]||(r[1]=zt("Rotate mode ",-1)),ie(E(dr),null,{default:te(()=>[...r[0]||(r[0]=[zt("R",-1)])]),_:1})])]),_:1})]),_:1})]),_:1}))}}),YU={key:0},JU={key:1},KU=Ne({__name:"EnablePicker",setup(t){function e(){yn.value=!yn.value}return(n,i)=>(me(),Ie(E(Bi),{"delay-duration":600},{default:te(()=>[ie(E(Kn),null,{default:te(()=>[ie(E(Qn),null,{default:te(()=>[ie(E(ln),{variant:"secondary",size:"icon",onClick:e,class:Qt({active:!E(yn).value})},{default:te(()=>[E(yn).value?(me(),Ct("span",YU,[ie(E(CU))])):(me(),Ct("span",JU,[ie(E(AU))]))]),_:1},8,["class"])]),_:1}),ie(E(Zn),{class:"z-1000",side:"bottom"},{default:te(()=>[Ye("p",null,[i[1]||(i[1]=zt("Enable/Disable object selection ",-1)),ie(E(dr),null,{default:te(()=>[...i[0]||(i[0]=[zt("P",-1)])]),_:1})])]),_:1})]),_:1})]),_:1}))}}),ZU={class:"toolbar-group"},QU=Ne({__name:"TransformGroup",setup(t){const e=ke(null);function n(i){e.value=i}return Am({w:()=>{Fr("translate"),n("move")},e:()=>{Fr("rotate"),n("rotate")},r:()=>{Fr("scale"),n("scale")}}),(i,r)=>(me(),Ct("div",ZU,[ie(E(KU),{active:e.value==="move",onActivated:r[0]||(r[0]=s=>n("move"))},null,8,["active"]),ie(E(qU),{active:e.value==="move",onActivated:r[1]||(r[1]=s=>n("move"))},null,8,["active"]),ie(E(XU),{active:e.value==="rotate",onActivated:r[2]||(r[2]=s=>n("rotate"))},null,8,["active"]),ie(E(jU),{active:e.value==="scale",onActivated:r[3]||(r[3]=s=>n("scale"))},null,8,["active"])]))}}),ek=Ne({__name:"TopViewButton",setup(t){function e(){ms("top")}return(n,i)=>(me(),Ie(E(Bi),{"delay-duration":600},{default:te(()=>[ie(E(Kn),null,{default:te(()=>[ie(E(Qn),null,{default:te(()=>[ie(E(ln),{variant:"secondary",size:"icon",class:"toolbar-button",onClick:e},{default:te(()=>[ie(E(TU))]),_:1})]),_:1}),ie(E(Zn),{class:"z-1000",side:"bottom"},{default:te(()=>[Ye("p",null,[i[1]||(i[1]=zt("Top view ",-1)),ie(E(dr),null,{default:te(()=>[...i[0]||(i[0]=[zt("5",-1)])]),_:1})])]),_:1})]),_:1})]),_:1}))}}),tk=Ne({__name:"FrontViewButton",setup(t){function e(){ms("front")}return(n,i)=>(me(),Ie(E(Bi),{"delay-duration":600},{default:te(()=>[ie(E(Kn),null,{default:te(()=>[ie(E(Qn),null,{default:te(()=>[ie(E(ln),{variant:"secondary",size:"icon",onClick:e},{default:te(()=>[ie(E(bU))]),_:1})]),_:1}),ie(E(Zn),{class:"z-1000",side:"bottom"},{default:te(()=>[Ye("p",null,[i[1]||(i[1]=zt("Front view ",-1)),ie(E(dr),null,{default:te(()=>[...i[0]||(i[0]=[zt("2",-1)])]),_:1})])]),_:1})]),_:1})]),_:1}))}}),nk={class:"button-icon"},ik=Ne({__name:"RightViewButton",setup(t){function e(){ms("right")}return(n,i)=>(me(),Ie(E(Bi),{"delay-duration":600},{default:te(()=>[ie(E(Kn),null,{default:te(()=>[ie(E(Qn),null,{default:te(()=>[ie(E(ln),{variant:"secondary",size:"icon",class:"toolbar-button",onClick:e},{default:te(()=>[Ye("span",nk,[ie(E(PU),{size:16,"stroke-width":2,"aria-hidden":"true"})])]),_:1})]),_:1}),ie(E(Zn),{class:"z-1000",side:"bottom"},{default:te(()=>[Ye("p",null,[i[1]||(i[1]=zt("Right view ",-1)),ie(E(dr),null,{default:te(()=>[...i[0]||(i[0]=[zt("6",-1)])]),_:1})])]),_:1})]),_:1})]),_:1}))}}),rk={class:"button-icon"},sk=Ne({__name:"PerspectiveViewButton",setup(t){function e(){ms("front_right")}return(n,i)=>(me(),Ie(E(Bi),{"delay-duration":600},{default:te(()=>[ie(E(Kn),null,{default:te(()=>[ie(E(Qn),null,{default:te(()=>[ie(E(ln),{variant:"secondary",size:"icon",class:"toolbar-button",onClick:e},{default:te(()=>[Ye("span",rk,[ie(E(_U),{size:16,"stroke-width":2,"aria-hidden":"true"})])]),_:1})]),_:1}),ie(E(Zn),{class:"z-1000",side:"bottom"},{default:te(()=>[Ye("p",null,[i[1]||(i[1]=zt("Perspective view ",-1)),ie(E(dr),null,{default:te(()=>[...i[0]||(i[0]=[zt("3",-1)])]),_:1})])]),_:1})]),_:1})]),_:1}))}}),ok={class:"toolbar-group"},ak=Ne({__name:"ViewGroup",setup(t){return Am({2:()=>{ms("front")},3:()=>{ms("front_right")},5:()=>{ms("top")},6:()=>{ms("right")}}),(e,n)=>(me(),Ct("div",ok,[ie(E(ek)),ie(E(tk)),ie(E(ik)),ie(E(sk))]))}}),lk={class:"button-icon save-view-icon"},ck={class:"save-view-overlay","aria-hidden":"true"},uk=Ne({__name:"SaveViewButton",props:{defaultName:{}},emits:["saved"],setup(t,{emit:e}){const n=t,i=e;function r(){const s=window.prompt("Name for saved view",n.defaultName);if(s===null)return;const o=s.trim()||n.defaultName,a=sS(o);i("saved",a)}return(s,o)=>(me(),Ie(E(Bi),{"delay-duration":600},{default:te(()=>[ie(E(Kn),null,{default:te(()=>[ie(E(Qn),null,{default:te(()=>[ie(E(ln),{variant:"secondary",size:"icon",onClick:r},{default:te(()=>[Ye("span",lk,[ie(E(xU),{size:15,"stroke-width":2,"aria-hidden":"true"}),Ye("span",ck,[ie(E(rS),{class:"save-view-overlay-icon"})])])]),_:1})]),_:1}),ie(E(Zn),{class:"z-1000",side:"bottom"},{default:te(()=>[Ye("p",null,[o[1]||(o[1]=zt("Save Current View ",-1)),ie(E(dr),null,{default:te(()=>[...o[0]||(o[0]=[zt("S",-1)])]),_:1})])]),_:1})]),_:1})]),_:1}))}}),dk=Zr(uk,[["__scopeId","data-v-49e45054"]]),aS=Ne({__name:"Popover",props:{defaultOpen:{type:Boolean},open:{type:Boolean},modal:{type:Boolean}},emits:["update:open"],setup(t,{emit:e}){const r=ar(t,e);return(s,o)=>(me(),Ie(E(DT),Ss(Yr(E(r))),{default:te(()=>[at(s.$slots,"default")]),_:3},16))}}),lS=Ne({__name:"PopoverTrigger",props:{asChild:{type:Boolean},as:{}},setup(t){const e=t;return(n,i)=>(me(),Ie(E(HT),Ss(Yr(e)),{default:te(()=>[at(n.$slots,"default")]),_:3},16))}}),cS=Ne({inheritAttrs:!1,__name:"PopoverContent",props:{forceMount:{type:Boolean},side:{},sideOffset:{default:8},sideFlip:{type:Boolean},align:{},alignOffset:{},alignFlip:{type:Boolean},avoidCollisions:{type:Boolean},collisionBoundary:{},collisionPadding:{},arrowPadding:{},hideShiftedArrow:{type:Boolean},sticky:{},hideWhenDetached:{type:Boolean},positionStrategy:{},updatePositionStrategy:{},disableUpdateOnLayoutShift:{type:Boolean},prioritizePosition:{type:Boolean},reference:{},asChild:{type:Boolean},as:{},disableOutsidePointerEvents:{type:Boolean},class:{}},emits:["escapeKeyDown","pointerDownOutside","focusOutside","interactOutside","openAutoFocus","closeAutoFocus"],setup(t,{emit:e}){const n=t,i=e,r=co(n,"class"),s=ar(r,i);return(o,a)=>(me(),Ie(E(zT),null,{default:te(()=>[ie(E(kT),It({...E(s),...o.$attrs},{class:E(cr)("z-50 rounded-md border bg-popover text-popover-foreground shadow-md outline-none animate-in fade-in-0 zoom-in-95 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",n.class,{dark:E(qn).value==="dark"})}),{default:te(()=>[at(o.$slots,"default")]),_:3},16,["class"])]),_:3}))}}),fk={class:"inline-flex h-full w-full items-center justify-center"},hk={class:"flex h-8 items-stretch overflow-hidden rounded-lg border border-input bg-secondary"},pk={key:0,disabled:"",value:""},mk=["value"],gk=Ne({__name:"SavedViewsButton",props:{views:{},selectedViewId:{}},emits:["select","delete"],setup(t,{emit:e}){const n=t,i=e,r=ke(!1),s=ke(""),o=ke(!1);let a=null;rn(()=>[n.selectedViewId,n.views],([u,d])=>{if(d.length===0){s.value="";return}const f=d.some(h=>h.id===u);s.value=f?u:d[0].id},{immediate:!0});function l(){s.value&&i("select",s.value)}function c(){s.value&&(o.value=!0,a&&clearTimeout(a),a=setTimeout(()=>{o.value=!1,a=null},160),i("delete",s.value))}return da(()=>{a&&clearTimeout(a)}),(u,d)=>(me(),Ie(E(Bi),{"delay-duration":600},{default:te(()=>[ie(E(aS),{open:r.value,"onUpdate:open":d[1]||(d[1]=f=>r.value=f),modal:!0},{default:te(()=>[ie(E(lS),{"as-child":""},{default:te(()=>[ie(E(ln),{variant:"secondary",size:"icon"},{default:te(()=>[ie(E(Kn),null,{default:te(()=>[ie(E(Qn),{"as-child":""},{default:te(()=>[Ye("span",fk,[ie(E(yU))])]),_:1}),ie(E(Zn),{class:"z-1000",side:"bottom"},{default:te(()=>[...d[2]||(d[2]=[Ye("p",null,"Saved views",-1)])]),_:1})]),_:1})]),_:1})]),_:1}),ie(E(cS),{class:"theme z-[4000] w-72 rounded-xl p-2 text-secondary-foreground",side:"bottom",align:"start"},{default:te(()=>[Ye("div",hk,[Cc(Ye("select",{"onUpdate:modelValue":d[0]||(d[0]=f=>s.value=f),class:"h-full min-w-0 flex-1 truncate border-0 bg-secondary px-3 py-1 text-sm text-secondary-foreground outline-none",onChange:l},[t.views.length===0?(me(),Ct("option",pk," No saved views ")):fi("",!0),(me(!0),Ct(Kt,null,ta(t.views,f=>(me(),Ct("option",{key:f.id,value:f.id},Ci(f.name),9,mk))),128))],544),[[jx,s.value]]),ie(E(Kn),null,{default:te(()=>[ie(E(Qn),{"as-child":""},{default:te(()=>[ie(E(ln),{variant:"secondary",size:"icon-sm",class:Qt(["h-full w-8 rounded-none border-l border-input transition-[background-color,color,box-shadow]",{"saved-view-delete-pressed":o.value}]),disabled:!s.value,onClick:_i(c,["stop"])},{default:te(()=>[ie(E(NU),{class:"h-3 w-3"})]),_:1},8,["class","disabled"])]),_:1}),ie(E(Zn),{class:"z-[4100]",side:"bottom"},{default:te(()=>[...d[3]||(d[3]=[Ye("p",null,"Delete saved view",-1)])]),_:1})]),_:1})])]),_:1})]),_:1},8,["open"])]),_:1}))}}),vk=Zr(gk,[["__scopeId","data-v-574e0859"]]),_k={class:"inline-flex h-full w-full items-center justify-center"},xk={class:"grid gap-5"},yk={class:"grid gap-3"},bk={class:"grid grid-cols-3 items-center gap-4"},Sk={class:"flex items-center gap-2"},wk={class:"grid grid-cols-3 items-center gap-4"},Mk={class:"flex items-center gap-2"},Ek={class:"grid grid-cols-3 items-center gap-4"},Tk={class:"flex justify-end gap-2"},Na=64,La=8192,Ak=Ne({__name:"SaveScreenshotButton",setup(t){const e=ke(!1),n=ke(1920),i=ke(1080),r=ke("png"),s=ke(!1),o=we(()=>Number.isFinite(n.value)?n.valueLa?`Width must be between ${Na} and ${La} px.`:"":"Width must be a number."),a=we(()=>Number.isFinite(i.value)?i.valueLa?`Height must be between ${Na} and ${La} px.`:"":"Height must be a number.");function l(g,v){return Number.isFinite(g)?Math.min(La,Math.max(Na,Math.round(g))):v}function c(){s.value=!0}function u(){n.value=l(n.value,1920)}function d(){i.value=l(i.value,1080)}function f(){const g=nn.domElement;if(!g)return;const v=g.getBoundingClientRect(),m=Math.round(v.width)||g.clientWidth||g.width,p=Math.round(v.height)||g.clientHeight||g.height;n.value=l(m,n.value),i.value=l(p,i.value)}function h(){u(),d(),!(o.value||a.value)&&(oS({width:n.value,height:i.value,format:r.value}),e.value=!1)}return rn(e,g=>{g&&!s.value&&f()}),(g,v)=>(me(),Ie(E(Bi),{"delay-duration":600},{default:te(()=>[ie(E(aS),{open:e.value,"onUpdate:open":v[4]||(v[4]=m=>e.value=m),modal:!0},{default:te(()=>[ie(E(lS),{"as-child":""},{default:te(()=>[ie(E(ln),{variant:"secondary",size:"icon"},{default:te(()=>[ie(E(Kn),null,{default:te(()=>[ie(E(Qn),{"as-child":""},{default:te(()=>[Ye("span",_k,[ie(E(SU))])]),_:1}),ie(E(Zn),{class:"z-1000",side:"bottom"},{default:te(()=>[Ye("p",null,[v[6]||(v[6]=zt("Save screenshot ",-1)),ie(E(dr),null,{default:te(()=>[...v[5]||(v[5]=[zt("F",-1)])]),_:1})])]),_:1})]),_:1})]),_:1})]),_:1}),ie(E(cS),{class:"theme z-[4000] w-84 rounded-xl p-5 text-secondary-foreground",side:"bottom",align:"start"},{default:te(()=>[Ye("div",xk,[v[15]||(v[15]=Ye("div",{class:"space-y-2"},[Ye("h4",{class:"font-medium leading-none"}," Export Screenshot "),Ye("p",{class:"text-sm text-muted-foreground"}," Set width, height, and image format. ")],-1)),Ye("div",yk,[Ye("div",bk,[Ye("div",Sk,[v[8]||(v[8]=Ye("label",{for:"screenshot-width",class:"text-sm"},"Width",-1)),o.value?(me(),Ie(E(Kn),{key:0},{default:te(()=>[ie(E(Qn),{"as-child":""},{default:te(()=>[...v[7]||(v[7]=[Ye("span",{class:"error-pill","aria-label":"Width error"},"!",-1)])]),_:1}),ie(E(Zn),{class:"z-[5000]",side:"top"},{default:te(()=>[Ye("p",null,Ci(o.value),1)]),_:1})]),_:1})):fi("",!0)]),Cc(Ye("input",{id:"screenshot-width","onUpdate:modelValue":v[0]||(v[0]=m=>n.value=m),type:"number",onInput:c,onBlur:u,class:"themed-number col-span-2 h-8 rounded-lg border border-input bg-secondary px-3 py-1 text-sm text-secondary-foreground shadow-xs transition-[color,box-shadow] outline-none focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px]"},null,544),[[Sg,n.value,void 0,{number:!0}]])]),Ye("div",wk,[Ye("div",Mk,[v[10]||(v[10]=Ye("label",{for:"screenshot-height",class:"text-sm"},"Height",-1)),a.value?(me(),Ie(E(Kn),{key:0},{default:te(()=>[ie(E(Qn),{"as-child":""},{default:te(()=>[...v[9]||(v[9]=[Ye("span",{class:"error-pill","aria-label":"Height error"},"!",-1)])]),_:1}),ie(E(Zn),{class:"z-[5000]",side:"top"},{default:te(()=>[Ye("p",null,Ci(a.value),1)]),_:1})]),_:1})):fi("",!0)]),Cc(Ye("input",{id:"screenshot-height","onUpdate:modelValue":v[1]||(v[1]=m=>i.value=m),type:"number",onInput:c,onBlur:d,class:"themed-number col-span-2 h-8 rounded-lg border border-input bg-secondary px-3 py-1 text-sm text-secondary-foreground shadow-xs transition-[color,box-shadow] outline-none focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px]"},null,544),[[Sg,i.value,void 0,{number:!0}]])]),Ye("div",Ek,[v[12]||(v[12]=Ye("label",{for:"screenshot-format",class:"text-sm"},"Format",-1)),Cc(Ye("select",{id:"screenshot-format","onUpdate:modelValue":v[2]||(v[2]=m=>r.value=m),class:"col-span-2 h-8 rounded-lg border border-input bg-secondary px-3 py-1 text-sm text-secondary-foreground shadow-xs transition-[color,box-shadow] outline-none focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px]"},[...v[11]||(v[11]=[Ye("option",{value:"png"},"PNG",-1),Ye("option",{value:"jpg"},"JPG",-1),Ye("option",{value:"webp"},"WEBP",-1)])],512),[[jx,r.value]])])]),Ye("div",Tk,[ie(E(ln),{variant:"secondary",size:"sm",onClick:v[3]||(v[3]=m=>e.value=!1)},{default:te(()=>[...v[13]||(v[13]=[zt("Cancel",-1)])]),_:1}),ie(E(ln),{variant:"secondary",size:"sm",onClick:h},{default:te(()=>[...v[14]||(v[14]=[zt("Save",-1)])]),_:1})])])]),_:1})]),_:1},8,["open"])]),_:1}))}}),Ck=Zr(Ak,[["__scopeId","data-v-5496204e"]]),Pk={class:"display-tools-wrapper"},Rk={class:"toolbar-group"},C_="compas_threejs_saved_views",Dk=Ne({__name:"DisplayGroup",setup(t){const e=ke([]),n=ke("");function i(){localStorage.setItem(C_,JSON.stringify(e.value))}function r(){const c=localStorage.getItem(C_);if(c)try{const u=JSON.parse(c);Array.isArray(u)&&(e.value=u)}catch{e.value=[]}}function s(c){e.value=[...e.value,c],n.value=c.id,i()}function o(){const c=`View ${e.value.length+1}`,u=window.prompt("Name for saved view",c);if(u===null)return;const d=u.trim()||c,f=sS(d);s(f)}function a(c){n.value=c;const u=e.value.find(d=>d.id===c);u&&zU(u)}function l(c){const u=e.value.filter(d=>d.id!==c);e.value=u,n.value===c&&(n.value=u[0]?.id??""),i()}return ti(()=>{r()}),Am({s:()=>{o()},f:()=>{oS({format:"png"})},d:()=>{RF()}}),(c,u)=>(me(),Ct("div",Pk,[Ye("div",Rk,[ie(E(dk),{"default-name":`View ${e.value.length+1}`,onSaved:s},null,8,["default-name"]),ie(E(vk),{views:e.value,"selected-view-id":n.value,onSelect:a,onDelete:l},null,8,["views","selected-view-id"]),ie(E(Ck))])]))}}),Ik={class:"toolbar theme",id:"toolbar"},Nk=Ne({__name:"Toolbar",setup(t){const{isHovered:e}=Tm("toolbar");return Wn(()=>{Fu.value=e.value}),(n,i)=>(me(),Ct("div",Ik,[Ye("h1",{class:Qt(["text-lg font-bold",{dark:E(qn).value==="dark"}])}," COMPAS ThreeJs ",2),ie(QU),ie(ak),ie(Dk)]))}}),Lk=Zr(Nk,[["__scopeId","data-v-5d46c60d"]]),Ok=Ne({__name:"NumberField",props:{defaultValue:{},modelValue:{},min:{},max:{},step:{},stepSnapping:{type:Boolean},focusOnChange:{type:Boolean},formatOptions:{},locale:{},disabled:{type:Boolean},readonly:{type:Boolean},disableWheelChange:{type:Boolean},invertWheelChange:{type:Boolean},id:{},asChild:{type:Boolean},as:{},name:{},required:{type:Boolean},class:{}},emits:["update:modelValue"],setup(t,{emit:e}){const n=t,i=e,r=co(n,"class"),s=ar(r,i);return(o,a)=>(me(),Ie(E(QT),It(E(s),{class:E(cr)("grid gap-1.5",n.class)}),{default:te(l=>[at(o.$slots,"default",Ss(Yr(l)))]),_:3},16,["class"]))}}),Fk=Ne({__name:"NumberFieldContent",props:{class:{}},setup(t){const e=t;return(n,i)=>(me(),Ct("div",{class:Qt(E(cr)("relative [&>[data-slot=input]]:has-[[data-slot=increment]]:pr-5 [&>[data-slot=input]]:has-[[data-slot=decrement]]:pl-5",e.class))},[at(n.$slots,"default")],2))}}),Uk=Ne({__name:"NumberFieldDecrement",props:{disabled:{type:Boolean},asChild:{type:Boolean},as:{},class:{}},setup(t){const e=t,n=co(e,"class"),i=Sl(n);return(r,s)=>(me(),Ie(E(tA),It({"data-slot":"decrement"},E(i),{class:E(cr)("absolute top-1/2 -translate-y-1/2 left-0 p-3 disabled:cursor-not-allowed disabled:opacity-20",e.class)}),{default:te(()=>[at(r.$slots,"default",{},()=>[ie(E(wU),{class:"h-4 w-4"})])]),_:3},16,["class"]))}}),kk=Ne({__name:"NumberFieldIncrement",props:{disabled:{type:Boolean},asChild:{type:Boolean},as:{},class:{}},setup(t){const e=t,n=co(e,"class"),i=Sl(n);return(r,s)=>(me(),Ie(E(iA),It({"data-slot":"increment"},E(i),{class:E(cr)("absolute top-1/2 -translate-y-1/2 right-0 disabled:cursor-not-allowed disabled:opacity-20 p-3",e.class)}),{default:te(()=>[at(r.$slots,"default",{},()=>[ie(E(rS),{class:"h-4 w-4"})])]),_:3},16,["class"]))}}),Bk=Ne({__name:"NumberFieldInput",props:{class:{}},setup(t){const e=t;return(n,i)=>(me(),Ie(E(sA),{"data-slot":"input",class:Qt(E(cr)("flex h-9 w-full rounded-md border border-input bg-transparent py-1 text-sm text-center text-foreground shadow-sm transition-colors placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:cursor-not-allowed disabled:opacity-50",e.class))},null,8,["class"]))}}),zk={key:2,class:"slider-container"},Vk={key:0,class:"slider-value"},Hk={key:3,class:"number-field-container"},Gk=Ne({__name:"Openbar",setup(t){const e=ke(!0);function n(){e.value=!e.value}document.addEventListener("keydown",r=>{(r.key==="Q"||r.key==="q")&&n()});const{isHovered:i}=Tm("openbar");return Wn(()=>{Fu.value=i.value}),(r,s)=>(me(),Ct(Kt,null,[Ye("div",{id:"openbar",class:Qt(["fixed-openbar theme",{"is-hidden":!e.value}])},[(me(!0),Ct(Kt,null,ta(E(Md),o=>(me(),Ct("div",{key:o.id,class:"dynamic-item"},[o.label?(me(),Ct("label",{key:0,class:Qt(["dynamic-label",{dark:E(qn).value==="dark"}])},Ci(o.label),3)):fi("",!0),o.component==="Button"?(me(),Ie(E(ln),{key:1,variant:"secondary",onClick:a=>E(Wf)(o.action)},{default:te(()=>[zt(Ci(o.props.text),1)]),_:2},1032,["onClick"])):o.component==="Slider"?(me(),Ct("div",zk,[ie(E(uC),{min:o.props.min,max:o.props.max,step:o.props.step,"default-value":o.props.defaultValue,modelValue:o.props.defaultValue,"onUpdate:modelValue":[a=>o.props.defaultValue=a,a=>E(Wf)(o.action,a[0])],class:"w-[80%]"},null,8,["min","max","step","default-value","modelValue","onUpdate:modelValue"]),o.props.defaultValue?(me(),Ct("span",Vk,Ci(o.props.defaultValue[0]),1)):fi("",!0)])):o.component==="NumberField"?(me(),Ct("div",Hk,[ie(E(Ok),{min:o.props.min,max:o.props.max,step:o.props.step,"default-value":o.props.value,modelValue:o.props.value,"onUpdate:modelValue":[a=>o.props.value=a,a=>E(Wf)(o.action,a)],class:"w-full"},{default:te(()=>[ie(E(Fk),null,{default:te(()=>[ie(E(Uk)),ie(E(Bk)),ie(E(kk))]),_:1})]),_:1},8,["min","max","step","default-value","modelValue","onUpdate:modelValue"])])):fi("",!0)]))),128)),ie(E(ln),{variant:"secondary",size:"icon",class:"mb-4",onClick:s[0]||(s[0]=o=>n())},{default:te(()=>[ie(E(nS))]),_:1})],2),ie(E(ln),{variant:"secondary",size:"icon",class:Qt(["mb-5",{"is-hidden":!e.value}]),onClick:s[1]||(s[1]=o=>n())},{default:te(()=>[ie(E(iS))]),_:1},8,["class"])],64))}}),Wk=Zr(Gk,[["__scopeId","data-v-5425abcf"]]),qk={id:"sidebar"},Xk=Ne({__name:"Sidebar",setup(t){return(e,n)=>(me(),Ct("div",qk,[ie(Lk),E(Ic).isVisible?(me(),Ie(Wk,{key:0})):fi("",!0)]))}}),$k=Zr(Xk,[["__scopeId","data-v-23dc3866"]]),jk={key:0,class:"theme-indicator","aria-hidden":"true"},Yk=Ne({__name:"ThemeIndicator",setup(t){const e=ke(!1),n=ke(qn.value);let i=null,r=!0;function s(a){n.value=a,e.value=!0,i&&window.clearTimeout(i),i=window.setTimeout(()=>{e.value=!1,i=null},900)}const o=rn(()=>qn.value,a=>{if(r){n.value=a,r=!1;return}a!==n.value&&s(a)},{immediate:!0});return da(()=>{i&&(window.clearTimeout(i),i=null),o()}),ti(()=>{}),(a,l)=>(me(),Ie(wM,{name:"theme-indicator"},{default:te(()=>[e.value?(me(),Ct("div",jk,[n.value==="dark"?(me(),Ie(E(MU),{key:0,class:"theme-indicator-icon"})):(me(),Ie(E(IU),{key:1,class:"theme-indicator-icon"}))])):fi("",!0)]),_:1}))}}),Jk=Zr(Yk,[["__scopeId","data-v-7535998e"]]),Kk=Ne({__name:"App",setup(t){const e=ke(null);return ti(()=>{e.value&&(e.value.appendChild(nn.domElement),oU())}),(n,i)=>(me(),Ct("div",{class:Qt(["app-container",{dark:E(qn).value==="dark"}])},[ie($k),Ye("div",{ref_key:"threeContainer",ref:e,class:"three-container"},null,512),ie(Jk),ie(BU)],2))}}),Zk=Zr(Kk,[["__scopeId","data-v-cbc799be"]]),Qk=YM(Zk);Qk.mount("#app"); +`)l=0,c-=o;else{const f=eU(d,s,l,c,n);i=="tb"?(l=0,c+=n.ascender*s):l+=f.offsetX,a.push(f.path)}}return a}function eU(t,e,n,i,r){const s=r.glyphs[t]||r.glyphs["?"];if(!s){console.error('THREE.Font: character "'+t+'" does not exists in font family '+r.familyName+".");return}const o=new q2;let a,l,c,u,d,f,h,g;if(s.o){const v=s._cachedOutline||(s._cachedOutline=s.o.split(" "));for(let m=0,p=v.length;m{i.load(r,a=>{qf[n]=a,s(a)},void 0,a=>o(a))})}async function iU(t){const e=t.text.value,n=t.font.value,i=t.weight.value,r=t.depth.value,s=t.size.value,o=await nU(n,i),a=new JF(e,{font:o,size:s,depth:r});let l;if(sr[t.guid.value]){const _=sr[t.guid.value];l=lo[_]}else l=new mo({color:65535,side:Vn});let c;t.centered.value?(a.computeBoundingBox(),c=-.5*(a.boundingBox.max.x-a.boundingBox.min.x)):c=0;const u=new N(t.point_x.value,t.point_y.value,t.point_z.value),d=new N(t.direction_x.value,t.direction_y.value,t.direction_z.value),f=new N(t.up_x.value,t.up_y.value,t.up_z.value),h=new N().crossVectors(d,f).normalize(),g=d.clone().normalize(),v=f.clone().normalize(),m=new yt().makeBasis(g,v,h);m.setPosition(u);const p=new be(a,l);p.position.x=c,p.applyMatrix4(m),Jn[t.guid.value]=p,Ot.add(p)}function rU(t){const e=FO(t);if(e instanceof Kb){sU(e);return}else pF(e)}function sU(t){const e=t.data.items;switch(e.dispatch.value){case"material":lF(e);break;case"light":BF(e);break;case"scene":OF(e);break;case"theme":CF(e);break;case"ui":XF(e);break;case"text":tU(e);break;case"object_infos":tS(e);break;case"object_action":dU(e);break;case"remove_object":UF(e);break;default:console.warn("Unknown dispatch value:",e.dispatch.value)}}let Er=null;function oU(){const t=()=>{Er=new WebSocket("ws://127.0.0.1:9001/ws"),Er.binaryType="arraybuffer",Er.onopen=()=>{sessionStorage.getItem("reloaded")||(sessionStorage.setItem("reloaded","true"),window.location.reload())},Er.onmessage=e=>{if(e.data instanceof ArrayBuffer){const n=new Uint8Array(e.data);rU(n)}else console.warn("❓ Received non-binary data:",e.data)},Er.onerror=e=>{console.error("WebSocket error:",e)},Er.onclose=()=>{sessionStorage.removeItem("reloaded"),setTimeout(t,1e3)}};t()}function aU(t){Er&&Er.readyState===WebSocket.OPEN?Er.send(t):console.error("WebSocket is not open. Unable to send message.")}function Em(t){try{const e=JSON.stringify(t),n=lU(e);aU(n)}catch{}}function lU(t){return new TextEncoder().encode(t).buffer}function cU(){Ti.isVisible=!0}function uU(){Ti.isVisible=!1}function tS(t){delete t.dispatch,t!=null&&(Ti.data=t)}function dU(t){console.log("Received object action:",t);const e={guid:t.guid.value,label:t.label.value,type:t.type.value,objectGuid:t.object_guid.value,text:t.text.value};Rp.push(e)}function fU(t,e){const n={dispatch:"object_action_callback",action_guid:t.guid,value:null,object_guid:t.objectGuid};e!==void 0&&(n.value=e),Em(n)}document.addEventListener("keydown",t=>{(t.key==="I"||t.key==="i")&&(Ti.isVisible?uU():cU())});function Tm(t){const e=ke(!1);function n(i){const r=document.getElementById(t),s=r&&r.matches(":hover");e.value=s}return ti(()=>{window.addEventListener("mousemove",n)}),fa(()=>{window.removeEventListener("mousemove",n)}),{isHovered:e}}const hU=t=>{for(const e in t)if(e.startsWith("aria-")||e==="role"||e==="title")return!0;return!1};const E_=t=>t==="";const pU=(...t)=>t.filter((e,n,i)=>!!e&&e.trim()!==""&&i.indexOf(e)===n).join(" ").trim();const T_=t=>t.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase();const mU=t=>t.replace(/^([A-Z])|[\s-_]+(\w)/g,(e,n,i)=>i?i.toUpperCase():n.toLowerCase());const gU=t=>{const e=mU(t);return e.charAt(0).toUpperCase()+e.slice(1)};var Ia={xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":2,"stroke-linecap":"round","stroke-linejoin":"round"};const vU=({name:t,iconNode:e,absoluteStrokeWidth:n,"absolute-stroke-width":i,strokeWidth:r,"stroke-width":s,size:o=Ia.width,color:a=Ia.stroke,...l},{slots:c})=>er("svg",{...Ia,...l,width:o,height:o,stroke:a,"stroke-width":E_(n)||E_(i)||n===!0||i===!0?Number(r||s||Ia["stroke-width"])*24/Number(o):r||s||Ia["stroke-width"],class:pU("lucide",l.class,...t?[`lucide-${T_(gU(t))}-icon`,`lucide-${T_(t)}`]:["lucide-icon"]),...!c.default&&!hU(l)&&{"aria-hidden":"true"}},[...e.map(u=>er(...u)),...c.default?[c.default()]:[]]);const pn=(t,e)=>(n,{slots:i,attrs:r})=>er(vU,{...r,...n,iconNode:e,name:t},i);const nS=pn("arrow-big-left-dash",[["path",{d:"M13 9a1 1 0 0 1-1-1V5.061a1 1 0 0 0-1.811-.75l-6.835 6.836a1.207 1.207 0 0 0 0 1.707l6.835 6.835a1 1 0 0 0 1.811-.75V16a1 1 0 0 1 1-1h2a1 1 0 0 0 1-1v-4a1 1 0 0 0-1-1z",key:"p8w4w5"}],["path",{d:"M20 9v6",key:"14roy0"}]]);const iS=pn("arrow-big-right-dash",[["path",{d:"M11 9a1 1 0 0 0 1-1V5.061a1 1 0 0 1 1.811-.75l6.836 6.836a1.207 1.207 0 0 1 0 1.707l-6.836 6.835a1 1 0 0 1-1.811-.75V16a1 1 0 0 0-1-1H9a1 1 0 0 1-1-1v-4a1 1 0 0 1 1-1z",key:"67vhrh"}],["path",{d:"M4 9v6",key:"bns7oa"}]]);const _U=pn("box",[["path",{d:"M21 8a2 2 0 0 0-1-1.73l-7-4a2 2 0 0 0-2 0l-7 4A2 2 0 0 0 3 8v8a2 2 0 0 0 1 1.73l7 4a2 2 0 0 0 2 0l7-4A2 2 0 0 0 21 16Z",key:"hh9hay"}],["path",{d:"m3.3 7 8.7 5 8.7-5",key:"g66t2b"}],["path",{d:"M12 22V12",key:"d0xqtd"}]]);const xU=pn("camera",[["path",{d:"M13.997 4a2 2 0 0 1 1.76 1.05l.486.9A2 2 0 0 0 18.003 7H20a2 2 0 0 1 2 2v9a2 2 0 0 1-2 2H4a2 2 0 0 1-2-2V9a2 2 0 0 1 2-2h1.997a2 2 0 0 0 1.759-1.048l.489-.904A2 2 0 0 1 10.004 4z",key:"18u6gg"}],["circle",{cx:"12",cy:"13",r:"3",key:"1vg3eu"}]]);const yU=pn("clipboard-list",[["rect",{width:"8",height:"4",x:"8",y:"2",rx:"1",ry:"1",key:"tgr4d6"}],["path",{d:"M16 4h2a2 2 0 0 1 2 2v14a2 2 0 0 1-2 2H6a2 2 0 0 1-2-2V6a2 2 0 0 1 2-2h2",key:"116196"}],["path",{d:"M12 11h4",key:"1jrz19"}],["path",{d:"M12 16h4",key:"n85exb"}],["path",{d:"M8 11h.01",key:"1dfujw"}],["path",{d:"M8 16h.01",key:"18s6g9"}]]);const bU=pn("house",[["path",{d:"M15 21v-8a1 1 0 0 0-1-1h-4a1 1 0 0 0-1 1v8",key:"5wwlr5"}],["path",{d:"M3 10a2 2 0 0 1 .709-1.528l7-6a2 2 0 0 1 2.582 0l7 6A2 2 0 0 1 21 10v9a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2z",key:"r6nss1"}]]);const SU=pn("image-down",[["path",{d:"M10.3 21H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h14a2 2 0 0 1 2 2v10l-3.1-3.1a2 2 0 0 0-2.814.014L6 21",key:"9csbqa"}],["path",{d:"m14 19 3 3v-5.5",key:"9ldu5r"}],["path",{d:"m17 22 3-3",key:"1nkfve"}],["circle",{cx:"9",cy:"9",r:"2",key:"af1f0g"}]]);const wU=pn("minus",[["path",{d:"M5 12h14",key:"1ays0h"}]]);const MU=pn("moon",[["path",{d:"M20.985 12.486a9 9 0 1 1-9.473-9.472c.405-.022.617.46.402.803a6 6 0 0 0 8.268 8.268c.344-.215.825-.004.803.401",key:"kfwtm"}]]);const EU=pn("move-3d",[["path",{d:"M5 3v16h16",key:"1mqmf9"}],["path",{d:"m5 19 6-6",key:"jh6hbb"}],["path",{d:"m2 6 3-3 3 3",key:"tkyvxa"}],["path",{d:"m18 16 3 3-3 3",key:"1d4glt"}]]);const TU=pn("plane",[["path",{d:"M17.8 19.2 16 11l3.5-3.5C21 6 21.5 4 21 3c-1-.5-3 0-4.5 1.5L13 8 4.8 6.2c-.5-.1-.9.1-1.1.5l-.3.5c-.2.5-.1 1 .3 1.3L9 12l-2 3H4l-1 1 3 2 2 3 1-1v-3l3-2 3.5 5.3c.3.4.8.5 1.3.3l.5-.2c.4-.3.6-.7.5-1.2z",key:"1v9wt8"}]]);const rS=pn("plus",[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]]);const AU=pn("pointer-off",[["path",{d:"M10 4.5V4a2 2 0 0 0-2.41-1.957",key:"jsi14n"}],["path",{d:"M13.9 8.4a2 2 0 0 0-1.26-1.295",key:"hirc7f"}],["path",{d:"M21.7 16.2A8 8 0 0 0 22 14v-3a2 2 0 1 0-4 0v-1a2 2 0 0 0-3.63-1.158",key:"1jxb2e"}],["path",{d:"m7 15-1.8-1.8a2 2 0 0 0-2.79 2.86L6 19.7a7.74 7.74 0 0 0 6 2.3h2a8 8 0 0 0 5.657-2.343",key:"10r7hm"}],["path",{d:"M6 6v8",key:"tv5xkp"}],["path",{d:"m2 2 20 20",key:"1ooewy"}]]);const CU=pn("pointer",[["path",{d:"M22 14a8 8 0 0 1-8 8",key:"56vcr3"}],["path",{d:"M18 11v-1a2 2 0 0 0-2-2a2 2 0 0 0-2 2",key:"1agjmk"}],["path",{d:"M14 10V9a2 2 0 0 0-2-2a2 2 0 0 0-2 2v1",key:"wdbh2u"}],["path",{d:"M10 9.5V4a2 2 0 0 0-2-2a2 2 0 0 0-2 2v10",key:"1ibuk9"}],["path",{d:"M18 11a2 2 0 1 1 4 0v3a8 8 0 0 1-8 8h-2c-2.8 0-4.5-.86-5.99-2.34l-3.6-3.6a2 2 0 0 1 2.83-2.82L7 15",key:"g6ys72"}]]);const PU=pn("rabbit",[["path",{d:"M13 16a3 3 0 0 1 2.24 5",key:"1epib5"}],["path",{d:"M18 12h.01",key:"yjnet6"}],["path",{d:"M18 21h-8a4 4 0 0 1-4-4 7 7 0 0 1 7-7h.2L9.6 6.4a1 1 0 1 1 2.8-2.8L15.8 7h.2c3.3 0 6 2.7 6 6v1a2 2 0 0 1-2 2h-1a3 3 0 0 0-3 3",key:"ue9ozu"}],["path",{d:"M20 8.54V4a2 2 0 1 0-4 0v3",key:"49iql8"}],["path",{d:"M7.612 12.524a3 3 0 1 0-1.6 4.3",key:"1e33i0"}]]);const RU=pn("rotate-3d",[["path",{d:"M16.466 7.5C15.643 4.237 13.952 2 12 2 9.239 2 7 6.477 7 12s2.239 10 5 10c.342 0 .677-.069 1-.2",key:"10n0gc"}],["path",{d:"m15.194 13.707 3.814 1.86-1.86 3.814",key:"16shm9"}],["path",{d:"M19 15.57c-1.804.885-4.274 1.43-7 1.43-5.523 0-10-2.239-10-5s4.477-5 10-5c4.838 0 8.873 1.718 9.8 4",key:"1lxi77"}]]);const DU=pn("scale-3d",[["path",{d:"M5 7v11a1 1 0 0 0 1 1h11",key:"13dt1j"}],["path",{d:"M5.293 18.707 11 13",key:"ezgbsx"}],["circle",{cx:"19",cy:"19",r:"2",key:"17f5cg"}],["circle",{cx:"5",cy:"5",r:"2",key:"1gwv83"}]]);const IU=pn("sun-medium",[["circle",{cx:"12",cy:"12",r:"4",key:"4exip2"}],["path",{d:"M12 3v1",key:"1asbbs"}],["path",{d:"M12 20v1",key:"1wcdkc"}],["path",{d:"M3 12h1",key:"lp3yf2"}],["path",{d:"M20 12h1",key:"1vloll"}],["path",{d:"m18.364 5.636-.707.707",key:"1hakh0"}],["path",{d:"m6.343 17.657-.707.707",key:"18m9nf"}],["path",{d:"m5.636 5.636.707.707",key:"1xv1c5"}],["path",{d:"m17.657 17.657.707.707",key:"vl76zb"}]]);const NU=pn("trash-2",[["path",{d:"M10 11v6",key:"nco0om"}],["path",{d:"M14 11v6",key:"outv1u"}],["path",{d:"M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6",key:"miytrc"}],["path",{d:"M3 6h18",key:"d0wm0j"}],["path",{d:"M8 6V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2",key:"e791ji"}]]),Zr=(t,e)=>{const n=t.__vccOpts||t;for(const[i,r]of e)n[i]=r;return n},LU={class:"right-bar"},OU={id:"data-container"},FU={class:"metadata item"},UU={class:"data-container"},kU={__name:"ObjectInfo",setup(t){Ti.data&&Object.fromEntries(Object.entries(Ti.data).filter(([i])=>i!=="dispatch"));const{isHovered:e}=Tm("info-panel");Wn(()=>{Fu.value=e.value});const n=()=>{Ti.isVisible=!Ti.isVisible};return(i,r)=>(me(),Ct("div",LU,[Ye("div",{class:Qt(["theme object-info",{"is-hidden":!E(Ti).isVisible}]),id:"info-panel"},[Ye("div",OU,[Ye("div",FU,[Ye("h1",{class:Qt(["text-lg font-bold section-title",{dark:E(qn).value==="dark"}])}," METADATA ",2),(me(!0),Ct(Kt,null,ta(E(Ti).data,(s,o)=>(me(),Ct("div",{key:o,class:"data-entry"},[Ye("p",null,[Ye("strong",null,Ci(o)+":",1),zt(" "+Ci(s.value),1)])]))),128))])]),Ye("div",UU,[Ye("h1",{class:Qt(["text-lg font-bold section-title",{dark:E(qn).value==="dark"}])}," FUNCTIONS ",2),(me(!0),Ct(Kt,null,ta(E(Rp),s=>(me(),Ct("div",{key:s,class:"single_data"},[s.type==="button"?(me(),Ie(E(ln),{key:0,variant:"outline",onClick:o=>E(fU)(s),class:"w-full"},{default:te(()=>[zt(Ci(s.text),1)]),_:2},1032,["onClick"])):fi("",!0)]))),128))]),ie(E(ln),{variant:"secondary",size:"icon",id:"closeObjectBar",onClick:r[0]||(r[0]=s=>n())},{default:te(()=>[ie(E(iS))]),_:1})],2),ie(E(ln),{variant:"secondary",size:"icon",id:"openObjectBar",class:Qt({"is-hidden":!E(Ti).isVisible}),onClick:r[1]||(r[1]=s=>n())},{default:te(()=>[ie(E(nS))]),_:1},8,["class"])]))}},BU=Zr(kU,[["__scopeId","data-v-95874573"]]);function sS(t){return{id:`view-${Date.now()}`,name:t,cameraPosition:{x:Wt.position.x,y:Wt.position.y,z:Wt.position.z},target:{x:In.target.x,y:In.target.y,z:In.target.z},zoom:Wt.zoom,fov:Wt.fov}}function zU(t){Wt.position.set(t.cameraPosition.x,t.cameraPosition.y,t.cameraPosition.z),In.target.set(t.target.x,t.target.y,t.target.z),Wt.zoom=t.zoom,Wt.fov=t.fov,Wt.updateProjectionMatrix(),In.update()}function A_(t,e){return!Number.isFinite(t)||t<=0?e:Math.max(16,Math.round(t))}function VU(t,e,n){const i=document.createElement("canvas");i.width=t,i.height=e;const r=i.getContext("2d");if(!r)throw new Error("Unable to create screenshot canvas context");const s=nn.domElement,o=s.getBoundingClientRect(),a=Math.round(o.width)||s.clientWidth||s.width,l=Math.round(o.height)||s.clientHeight||s.height;n==="jpg"?(r.fillStyle="#ffffff",r.fillRect(0,0,t,e)):r.clearRect(0,0,t,e);const c=Math.max(t/a,e/l),u=Math.round(a*c),d=Math.round(l*c),f=Math.floor((t-u)/2),h=Math.floor((e-d)/2);return r.drawImage(s,f,h,u,d),i}function HU(t,e){const n=document.createElement("a");n.download=e,n.href=t,n.click()}function GU(t){return`compas-view-${new Date().toISOString().replace(/[:.]/g,"-")}.${t}`}function oS(t={}){In.update(),nn.render(Ot,Wt);const e=t.format??"png",n=nn.domElement.width||nn.domElement.clientWidth,i=nn.domElement.height||nn.domElement.clientHeight,r=A_(t.width??n,n),s=A_(t.height??i,i),o=VU(r,s,e),a=e==="jpg"?"image/jpeg":e==="webp"?"image/webp":"image/png",l=e==="jpg"?t.quality??.92:void 0,c=e==="jpg"?"jpg":e==="webp"?"webp":"png",u=t.fileName??GU(c),d=o.toDataURL(a,l);HU(d,u)}function WU(t){if(t.ctrlKey||t.metaKey||t.altKey)return!0;const e=t.target;if(!e)return!1;const n=e.tagName;return n==="INPUT"||n==="TEXTAREA"||n==="SELECT"?!0:e.isContentEditable}function Am(t){const e=n=>{if(WU(n))return;const i=n.key.toLowerCase(),r=t[i];r&&(n.preventDefault(),r(n))};ti(()=>{document.addEventListener("keydown",e)}),da(()=>{document.removeEventListener("keydown",e)})}const dr=Ne({__name:"Kbd",props:{class:{}},setup(t){const e=t;return(n,i)=>(me(),Ct("kbd",{class:Qt(E(cr)("bg-muted text-muted-foreground pointer-events-none inline-flex h-5 w-fit min-w-5 items-center justify-center gap-1 rounded-sm px-1 font-sans text-xs font-medium select-none","[&_svg:not([class*='size-'])]:size-3","[[data-slot=tooltip-content]_&]:bg-background/20 [[data-slot=tooltip-content]_&]:text-background dark:[[data-slot=tooltip-content]_&]:bg-background/10",e.class))},[at(n.$slots,"default")],2))}}),Kn=Ne({__name:"Tooltip",props:{defaultOpen:{type:Boolean},open:{type:Boolean},delayDuration:{},disableHoverableContent:{type:Boolean},disableClosingTrigger:{type:Boolean},disabled:{type:Boolean},ignoreNonKeyboardFocus:{type:Boolean}},emits:["update:open"],setup(t,{emit:e}){const r=ar(t,e);return(s,o)=>(me(),Ie(E(dA),Ss(Yr(E(r))),{default:te(()=>[at(s.$slots,"default")]),_:3},16))}}),Zn=Ne({inheritAttrs:!1,__name:"TooltipContent",props:{forceMount:{type:Boolean},ariaLabel:{},asChild:{type:Boolean},as:{},side:{},sideOffset:{default:4},align:{},alignOffset:{},avoidCollisions:{type:Boolean},collisionBoundary:{},collisionPadding:{},arrowPadding:{},sticky:{},hideWhenDetached:{type:Boolean},positionStrategy:{},updatePositionStrategy:{},class:{}},emits:["escapeKeyDown","pointerDownOutside"],setup(t,{emit:e}){const n=t,i=e,r=co(n,"class"),s=ar(r,i);return(o,a)=>(me(),Ie(E(_A),null,{default:te(()=>[ie(E(gA),It({...E(s),...o.$attrs},{class:E(cr)("z-50 overflow-hidden rounded-md bg-primary px-3 py-1.5 text-xs text-primary-foreground animate-in fade-in-0 zoom-in-95 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",n.class,{dark:E(qn).value==="dark"})}),{default:te(()=>[at(o.$slots,"default")]),_:3},16,["class"])]),_:3}))}}),Bi=Ne({__name:"TooltipProvider",props:{delayDuration:{},skipDelayDuration:{},disableHoverableContent:{type:Boolean},disableClosingTrigger:{type:Boolean},disabled:{type:Boolean},ignoreNonKeyboardFocus:{type:Boolean},content:{}},setup(t){const e=t;return(n,i)=>(me(),Ie(E(lA),Ss(Yr(e)),{default:te(()=>[at(n.$slots,"default")]),_:3},16))}}),Qn=Ne({__name:"TooltipTrigger",props:{reference:{},asChild:{type:Boolean},as:{}},setup(t){const e=t;return(n,i)=>(me(),Ie(E(yA),Ss(Yr(e)),{default:te(()=>[at(n.$slots,"default")]),_:3},16))}}),qU=Ne({__name:"MoveButton",setup(t){function e(){Fr("translate"),Nr.value="translate"}return(n,i)=>(me(),Ie(E(Bi),{"delay-duration":600},{default:te(()=>[ie(E(Kn),null,{default:te(()=>[ie(E(Qn),null,{default:te(()=>[ie(E(ln),{variant:"secondary",size:"icon",class:Qt({active:E(Nr).value=="translate",disabled:!E(yn).value}),onClick:e,disabled:!E(yn).value},{default:te(()=>[ie(E(EU))]),_:1},8,["class","disabled"])]),_:1}),ie(E(Zn),{class:"z-1000",side:"bottom"},{default:te(()=>[Ye("p",null,[i[1]||(i[1]=zt("Move mode ",-1)),ie(E(dr),null,{default:te(()=>[...i[0]||(i[0]=[zt("W",-1)])]),_:1})])]),_:1})]),_:1})]),_:1}))}}),XU=Ne({__name:"RotateButton",setup(t){function e(){Fr("rotate"),Nr.value="rotate"}return(n,i)=>(me(),Ie(E(Bi),{"delay-duration":600},{default:te(()=>[ie(E(Kn),null,{default:te(()=>[ie(E(Qn),null,{default:te(()=>[ie(E(ln),{variant:"secondary",size:"icon",class:Qt({active:E(Nr).value=="rotate",disabled:!E(yn).value}),onClick:e,disabled:!E(yn).value},{default:te(()=>[ie(E(RU),{size:16,"stroke-width":2,"aria-hidden":"true"})]),_:1},8,["class","disabled"])]),_:1}),ie(E(Zn),{class:"z-1000",side:"bottom"},{default:te(()=>[Ye("p",null,[i[1]||(i[1]=zt("Rotate mode ",-1)),ie(E(dr),null,{default:te(()=>[...i[0]||(i[0]=[zt("E",-1)])]),_:1})])]),_:1})]),_:1})]),_:1}))}}),$U={class:"button-icon"},jU=Ne({__name:"ScaleButton",props:{active:{type:Boolean}},emits:["activated"],setup(t,{emit:e}){function n(){Fr("scale"),Nr.value="scale"}return(i,r)=>(me(),Ie(E(Bi),{"delay-duration":600},{default:te(()=>[ie(E(Kn),null,{default:te(()=>[ie(E(Qn),null,{default:te(()=>[ie(E(ln),{variant:"secondary",size:"icon",class:Qt(["toolbar-button",{active:E(Nr).value=="scale",disabled:!E(yn).value}]),onClick:n,disabled:!E(yn).value},{default:te(()=>[Ye("span",$U,[ie(E(DU),{size:16,"stroke-width":2,"aria-hidden":"true"})])]),_:1},8,["class","disabled"])]),_:1}),ie(E(Zn),{class:"z-1000",side:"bottom"},{default:te(()=>[Ye("p",null,[r[1]||(r[1]=zt("Rotate mode ",-1)),ie(E(dr),null,{default:te(()=>[...r[0]||(r[0]=[zt("R",-1)])]),_:1})])]),_:1})]),_:1})]),_:1}))}}),YU={key:0},JU={key:1},KU=Ne({__name:"EnablePicker",setup(t){function e(){yn.value=!yn.value}return(n,i)=>(me(),Ie(E(Bi),{"delay-duration":600},{default:te(()=>[ie(E(Kn),null,{default:te(()=>[ie(E(Qn),null,{default:te(()=>[ie(E(ln),{variant:"secondary",size:"icon",onClick:e,class:Qt({active:!E(yn).value})},{default:te(()=>[E(yn).value?(me(),Ct("span",YU,[ie(E(CU))])):(me(),Ct("span",JU,[ie(E(AU))]))]),_:1},8,["class"])]),_:1}),ie(E(Zn),{class:"z-1000",side:"bottom"},{default:te(()=>[Ye("p",null,[i[1]||(i[1]=zt("Enable/Disable object selection ",-1)),ie(E(dr),null,{default:te(()=>[...i[0]||(i[0]=[zt("P",-1)])]),_:1})])]),_:1})]),_:1})]),_:1}))}}),ZU={class:"toolbar-group"},QU=Ne({__name:"TransformGroup",setup(t){const e=ke(null);function n(i){e.value=i}return Am({w:()=>{Fr("translate"),n("move")},e:()=>{Fr("rotate"),n("rotate")},r:()=>{Fr("scale"),n("scale")}}),(i,r)=>(me(),Ct("div",ZU,[ie(E(KU),{active:e.value==="move",onActivated:r[0]||(r[0]=s=>n("move"))},null,8,["active"]),ie(E(qU),{active:e.value==="move",onActivated:r[1]||(r[1]=s=>n("move"))},null,8,["active"]),ie(E(XU),{active:e.value==="rotate",onActivated:r[2]||(r[2]=s=>n("rotate"))},null,8,["active"]),ie(E(jU),{active:e.value==="scale",onActivated:r[3]||(r[3]=s=>n("scale"))},null,8,["active"])]))}}),ek=Ne({__name:"TopViewButton",setup(t){function e(){ms("top")}return(n,i)=>(me(),Ie(E(Bi),{"delay-duration":600},{default:te(()=>[ie(E(Kn),null,{default:te(()=>[ie(E(Qn),null,{default:te(()=>[ie(E(ln),{variant:"secondary",size:"icon",class:"toolbar-button",onClick:e},{default:te(()=>[ie(E(TU))]),_:1})]),_:1}),ie(E(Zn),{class:"z-1000",side:"bottom"},{default:te(()=>[Ye("p",null,[i[1]||(i[1]=zt("Top view ",-1)),ie(E(dr),null,{default:te(()=>[...i[0]||(i[0]=[zt("5",-1)])]),_:1})])]),_:1})]),_:1})]),_:1}))}}),tk=Ne({__name:"FrontViewButton",setup(t){function e(){ms("front")}return(n,i)=>(me(),Ie(E(Bi),{"delay-duration":600},{default:te(()=>[ie(E(Kn),null,{default:te(()=>[ie(E(Qn),null,{default:te(()=>[ie(E(ln),{variant:"secondary",size:"icon",onClick:e},{default:te(()=>[ie(E(bU))]),_:1})]),_:1}),ie(E(Zn),{class:"z-1000",side:"bottom"},{default:te(()=>[Ye("p",null,[i[1]||(i[1]=zt("Front view ",-1)),ie(E(dr),null,{default:te(()=>[...i[0]||(i[0]=[zt("2",-1)])]),_:1})])]),_:1})]),_:1})]),_:1}))}}),nk={class:"button-icon"},ik=Ne({__name:"RightViewButton",setup(t){function e(){ms("right")}return(n,i)=>(me(),Ie(E(Bi),{"delay-duration":600},{default:te(()=>[ie(E(Kn),null,{default:te(()=>[ie(E(Qn),null,{default:te(()=>[ie(E(ln),{variant:"secondary",size:"icon",class:"toolbar-button",onClick:e},{default:te(()=>[Ye("span",nk,[ie(E(PU),{size:16,"stroke-width":2,"aria-hidden":"true"})])]),_:1})]),_:1}),ie(E(Zn),{class:"z-1000",side:"bottom"},{default:te(()=>[Ye("p",null,[i[1]||(i[1]=zt("Right view ",-1)),ie(E(dr),null,{default:te(()=>[...i[0]||(i[0]=[zt("6",-1)])]),_:1})])]),_:1})]),_:1})]),_:1}))}}),rk={class:"button-icon"},sk=Ne({__name:"PerspectiveViewButton",setup(t){function e(){ms("front_right")}return(n,i)=>(me(),Ie(E(Bi),{"delay-duration":600},{default:te(()=>[ie(E(Kn),null,{default:te(()=>[ie(E(Qn),null,{default:te(()=>[ie(E(ln),{variant:"secondary",size:"icon",class:"toolbar-button",onClick:e},{default:te(()=>[Ye("span",rk,[ie(E(_U),{size:16,"stroke-width":2,"aria-hidden":"true"})])]),_:1})]),_:1}),ie(E(Zn),{class:"z-1000",side:"bottom"},{default:te(()=>[Ye("p",null,[i[1]||(i[1]=zt("Perspective view ",-1)),ie(E(dr),null,{default:te(()=>[...i[0]||(i[0]=[zt("3",-1)])]),_:1})])]),_:1})]),_:1})]),_:1}))}}),ok={class:"toolbar-group"},ak=Ne({__name:"ViewGroup",setup(t){return Am({2:()=>{ms("front")},3:()=>{ms("front_right")},5:()=>{ms("top")},6:()=>{ms("right")}}),(e,n)=>(me(),Ct("div",ok,[ie(E(ek)),ie(E(tk)),ie(E(ik)),ie(E(sk))]))}}),lk={class:"button-icon save-view-icon"},ck={class:"save-view-overlay","aria-hidden":"true"},uk=Ne({__name:"SaveViewButton",props:{defaultName:{}},emits:["saved"],setup(t,{emit:e}){const n=t,i=e;function r(){const s=window.prompt("Name for saved view",n.defaultName);if(s===null)return;const o=s.trim()||n.defaultName,a=sS(o);i("saved",a)}return(s,o)=>(me(),Ie(E(Bi),{"delay-duration":600},{default:te(()=>[ie(E(Kn),null,{default:te(()=>[ie(E(Qn),null,{default:te(()=>[ie(E(ln),{variant:"secondary",size:"icon",onClick:r},{default:te(()=>[Ye("span",lk,[ie(E(xU),{size:15,"stroke-width":2,"aria-hidden":"true"}),Ye("span",ck,[ie(E(rS),{class:"save-view-overlay-icon"})])])]),_:1})]),_:1}),ie(E(Zn),{class:"z-1000",side:"bottom"},{default:te(()=>[Ye("p",null,[o[1]||(o[1]=zt("Save Current View ",-1)),ie(E(dr),null,{default:te(()=>[...o[0]||(o[0]=[zt("S",-1)])]),_:1})])]),_:1})]),_:1})]),_:1}))}}),dk=Zr(uk,[["__scopeId","data-v-49e45054"]]),aS=Ne({__name:"Popover",props:{defaultOpen:{type:Boolean},open:{type:Boolean},modal:{type:Boolean}},emits:["update:open"],setup(t,{emit:e}){const r=ar(t,e);return(s,o)=>(me(),Ie(E(DT),Ss(Yr(E(r))),{default:te(()=>[at(s.$slots,"default")]),_:3},16))}}),lS=Ne({__name:"PopoverTrigger",props:{asChild:{type:Boolean},as:{}},setup(t){const e=t;return(n,i)=>(me(),Ie(E(HT),Ss(Yr(e)),{default:te(()=>[at(n.$slots,"default")]),_:3},16))}}),cS=Ne({inheritAttrs:!1,__name:"PopoverContent",props:{forceMount:{type:Boolean},side:{},sideOffset:{default:8},sideFlip:{type:Boolean},align:{},alignOffset:{},alignFlip:{type:Boolean},avoidCollisions:{type:Boolean},collisionBoundary:{},collisionPadding:{},arrowPadding:{},hideShiftedArrow:{type:Boolean},sticky:{},hideWhenDetached:{type:Boolean},positionStrategy:{},updatePositionStrategy:{},disableUpdateOnLayoutShift:{type:Boolean},prioritizePosition:{type:Boolean},reference:{},asChild:{type:Boolean},as:{},disableOutsidePointerEvents:{type:Boolean},class:{}},emits:["escapeKeyDown","pointerDownOutside","focusOutside","interactOutside","openAutoFocus","closeAutoFocus"],setup(t,{emit:e}){const n=t,i=e,r=co(n,"class"),s=ar(r,i);return(o,a)=>(me(),Ie(E(zT),null,{default:te(()=>[ie(E(kT),It({...E(s),...o.$attrs},{class:E(cr)("z-50 rounded-md border bg-popover text-popover-foreground shadow-md outline-none animate-in fade-in-0 zoom-in-95 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",n.class,{dark:E(qn).value==="dark"})}),{default:te(()=>[at(o.$slots,"default")]),_:3},16,["class"])]),_:3}))}}),fk={class:"inline-flex h-full w-full items-center justify-center"},hk={class:"flex h-8 items-stretch overflow-hidden rounded-lg border border-input bg-secondary"},pk={key:0,disabled:"",value:""},mk=["value"],gk=Ne({__name:"SavedViewsButton",props:{views:{},selectedViewId:{}},emits:["select","delete"],setup(t,{emit:e}){const n=t,i=e,r=ke(!1),s=ke(""),o=ke(!1);let a=null;rn(()=>[n.selectedViewId,n.views],([u,d])=>{if(d.length===0){s.value="";return}const f=d.some(h=>h.id===u);s.value=f?u:d[0].id},{immediate:!0});function l(){s.value&&i("select",s.value)}function c(){s.value&&(o.value=!0,a&&clearTimeout(a),a=setTimeout(()=>{o.value=!1,a=null},160),i("delete",s.value))}return da(()=>{a&&clearTimeout(a)}),(u,d)=>(me(),Ie(E(Bi),{"delay-duration":600},{default:te(()=>[ie(E(aS),{open:r.value,"onUpdate:open":d[1]||(d[1]=f=>r.value=f),modal:!0},{default:te(()=>[ie(E(lS),{"as-child":""},{default:te(()=>[ie(E(ln),{variant:"secondary",size:"icon"},{default:te(()=>[ie(E(Kn),null,{default:te(()=>[ie(E(Qn),{"as-child":""},{default:te(()=>[Ye("span",fk,[ie(E(yU))])]),_:1}),ie(E(Zn),{class:"z-1000",side:"bottom"},{default:te(()=>[...d[2]||(d[2]=[Ye("p",null,"Saved views",-1)])]),_:1})]),_:1})]),_:1})]),_:1}),ie(E(cS),{class:"theme z-[4000] w-72 rounded-xl p-2 text-secondary-foreground",side:"bottom",align:"start"},{default:te(()=>[Ye("div",hk,[Cc(Ye("select",{"onUpdate:modelValue":d[0]||(d[0]=f=>s.value=f),class:"h-full min-w-0 flex-1 truncate border-0 bg-secondary px-3 py-1 text-sm text-secondary-foreground outline-none",onChange:l},[t.views.length===0?(me(),Ct("option",pk," No saved views ")):fi("",!0),(me(!0),Ct(Kt,null,ta(t.views,f=>(me(),Ct("option",{key:f.id,value:f.id},Ci(f.name),9,mk))),128))],544),[[jx,s.value]]),ie(E(Kn),null,{default:te(()=>[ie(E(Qn),{"as-child":""},{default:te(()=>[ie(E(ln),{variant:"secondary",size:"icon-sm",class:Qt(["h-full w-8 rounded-none border-l border-input transition-[background-color,color,box-shadow]",{"saved-view-delete-pressed":o.value}]),disabled:!s.value,onClick:_i(c,["stop"])},{default:te(()=>[ie(E(NU),{class:"h-3 w-3"})]),_:1},8,["class","disabled"])]),_:1}),ie(E(Zn),{class:"z-[4100]",side:"bottom"},{default:te(()=>[...d[3]||(d[3]=[Ye("p",null,"Delete saved view",-1)])]),_:1})]),_:1})])]),_:1})]),_:1},8,["open"])]),_:1}))}}),vk=Zr(gk,[["__scopeId","data-v-574e0859"]]),_k={class:"inline-flex h-full w-full items-center justify-center"},xk={class:"grid gap-5"},yk={class:"grid gap-3"},bk={class:"grid grid-cols-3 items-center gap-4"},Sk={class:"flex items-center gap-2"},wk={class:"grid grid-cols-3 items-center gap-4"},Mk={class:"flex items-center gap-2"},Ek={class:"grid grid-cols-3 items-center gap-4"},Tk={class:"flex justify-end gap-2"},Na=64,La=8192,Ak=Ne({__name:"SaveScreenshotButton",setup(t){const e=ke(!1),n=ke(1920),i=ke(1080),r=ke("png"),s=ke(!1),o=Me(()=>Number.isFinite(n.value)?n.valueLa?`Width must be between ${Na} and ${La} px.`:"":"Width must be a number."),a=Me(()=>Number.isFinite(i.value)?i.valueLa?`Height must be between ${Na} and ${La} px.`:"":"Height must be a number.");function l(g,v){return Number.isFinite(g)?Math.min(La,Math.max(Na,Math.round(g))):v}function c(){s.value=!0}function u(){n.value=l(n.value,1920)}function d(){i.value=l(i.value,1080)}function f(){const g=nn.domElement;if(!g)return;const v=g.getBoundingClientRect(),m=Math.round(v.width)||g.clientWidth||g.width,p=Math.round(v.height)||g.clientHeight||g.height;n.value=l(m,n.value),i.value=l(p,i.value)}function h(){u(),d(),!(o.value||a.value)&&(oS({width:n.value,height:i.value,format:r.value}),e.value=!1)}return rn(e,g=>{g&&!s.value&&f()}),(g,v)=>(me(),Ie(E(Bi),{"delay-duration":600},{default:te(()=>[ie(E(aS),{open:e.value,"onUpdate:open":v[4]||(v[4]=m=>e.value=m),modal:!0},{default:te(()=>[ie(E(lS),{"as-child":""},{default:te(()=>[ie(E(ln),{variant:"secondary",size:"icon"},{default:te(()=>[ie(E(Kn),null,{default:te(()=>[ie(E(Qn),{"as-child":""},{default:te(()=>[Ye("span",_k,[ie(E(SU))])]),_:1}),ie(E(Zn),{class:"z-1000",side:"bottom"},{default:te(()=>[Ye("p",null,[v[6]||(v[6]=zt("Save screenshot ",-1)),ie(E(dr),null,{default:te(()=>[...v[5]||(v[5]=[zt("F",-1)])]),_:1})])]),_:1})]),_:1})]),_:1})]),_:1}),ie(E(cS),{class:"theme z-[4000] w-84 rounded-xl p-5 text-secondary-foreground",side:"bottom",align:"start"},{default:te(()=>[Ye("div",xk,[v[15]||(v[15]=Ye("div",{class:"space-y-2"},[Ye("h4",{class:"font-medium leading-none"}," Export Screenshot "),Ye("p",{class:"text-sm text-muted-foreground"}," Set width, height, and image format. ")],-1)),Ye("div",yk,[Ye("div",bk,[Ye("div",Sk,[v[8]||(v[8]=Ye("label",{for:"screenshot-width",class:"text-sm"},"Width",-1)),o.value?(me(),Ie(E(Kn),{key:0},{default:te(()=>[ie(E(Qn),{"as-child":""},{default:te(()=>[...v[7]||(v[7]=[Ye("span",{class:"error-pill","aria-label":"Width error"},"!",-1)])]),_:1}),ie(E(Zn),{class:"z-[5000]",side:"top"},{default:te(()=>[Ye("p",null,Ci(o.value),1)]),_:1})]),_:1})):fi("",!0)]),Cc(Ye("input",{id:"screenshot-width","onUpdate:modelValue":v[0]||(v[0]=m=>n.value=m),type:"number",onInput:c,onBlur:u,class:"themed-number col-span-2 h-8 rounded-lg border border-input bg-secondary px-3 py-1 text-sm text-secondary-foreground shadow-xs transition-[color,box-shadow] outline-none focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px]"},null,544),[[Sg,n.value,void 0,{number:!0}]])]),Ye("div",wk,[Ye("div",Mk,[v[10]||(v[10]=Ye("label",{for:"screenshot-height",class:"text-sm"},"Height",-1)),a.value?(me(),Ie(E(Kn),{key:0},{default:te(()=>[ie(E(Qn),{"as-child":""},{default:te(()=>[...v[9]||(v[9]=[Ye("span",{class:"error-pill","aria-label":"Height error"},"!",-1)])]),_:1}),ie(E(Zn),{class:"z-[5000]",side:"top"},{default:te(()=>[Ye("p",null,Ci(a.value),1)]),_:1})]),_:1})):fi("",!0)]),Cc(Ye("input",{id:"screenshot-height","onUpdate:modelValue":v[1]||(v[1]=m=>i.value=m),type:"number",onInput:c,onBlur:d,class:"themed-number col-span-2 h-8 rounded-lg border border-input bg-secondary px-3 py-1 text-sm text-secondary-foreground shadow-xs transition-[color,box-shadow] outline-none focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px]"},null,544),[[Sg,i.value,void 0,{number:!0}]])]),Ye("div",Ek,[v[12]||(v[12]=Ye("label",{for:"screenshot-format",class:"text-sm"},"Format",-1)),Cc(Ye("select",{id:"screenshot-format","onUpdate:modelValue":v[2]||(v[2]=m=>r.value=m),class:"col-span-2 h-8 rounded-lg border border-input bg-secondary px-3 py-1 text-sm text-secondary-foreground shadow-xs transition-[color,box-shadow] outline-none focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px]"},[...v[11]||(v[11]=[Ye("option",{value:"png"},"PNG",-1),Ye("option",{value:"jpg"},"JPG",-1),Ye("option",{value:"webp"},"WEBP",-1)])],512),[[jx,r.value]])])]),Ye("div",Tk,[ie(E(ln),{variant:"secondary",size:"sm",onClick:v[3]||(v[3]=m=>e.value=!1)},{default:te(()=>[...v[13]||(v[13]=[zt("Cancel",-1)])]),_:1}),ie(E(ln),{variant:"secondary",size:"sm",onClick:h},{default:te(()=>[...v[14]||(v[14]=[zt("Save",-1)])]),_:1})])])]),_:1})]),_:1},8,["open"])]),_:1}))}}),Ck=Zr(Ak,[["__scopeId","data-v-5496204e"]]),Pk={class:"display-tools-wrapper"},Rk={class:"toolbar-group"},C_="compas_threejs_saved_views",Dk=Ne({__name:"DisplayGroup",setup(t){const e=ke([]),n=ke("");function i(){localStorage.setItem(C_,JSON.stringify(e.value))}function r(){const c=localStorage.getItem(C_);if(c)try{const u=JSON.parse(c);Array.isArray(u)&&(e.value=u)}catch{e.value=[]}}function s(c){e.value=[...e.value,c],n.value=c.id,i()}function o(){const c=`View ${e.value.length+1}`,u=window.prompt("Name for saved view",c);if(u===null)return;const d=u.trim()||c,f=sS(d);s(f)}function a(c){n.value=c;const u=e.value.find(d=>d.id===c);u&&zU(u)}function l(c){const u=e.value.filter(d=>d.id!==c);e.value=u,n.value===c&&(n.value=u[0]?.id??""),i()}return ti(()=>{r()}),Am({s:()=>{o()},f:()=>{oS({format:"png"})},d:()=>{RF()}}),(c,u)=>(me(),Ct("div",Pk,[Ye("div",Rk,[ie(E(dk),{"default-name":`View ${e.value.length+1}`,onSaved:s},null,8,["default-name"]),ie(E(vk),{views:e.value,"selected-view-id":n.value,onSelect:a,onDelete:l},null,8,["views","selected-view-id"]),ie(E(Ck))])]))}}),Ik={class:"toolbar theme",id:"toolbar"},Nk=Ne({__name:"Toolbar",setup(t){const{isHovered:e}=Tm("toolbar");return Wn(()=>{Fu.value=e.value}),(n,i)=>(me(),Ct("div",Ik,[Ye("h1",{class:Qt(["text-lg font-bold",{dark:E(qn).value==="dark"}])}," COMPAS ThreeJs ",2),ie(QU),ie(ak),ie(Dk)]))}}),Lk=Zr(Nk,[["__scopeId","data-v-5d46c60d"]]),Ok=Ne({__name:"NumberField",props:{defaultValue:{},modelValue:{},min:{},max:{},step:{},stepSnapping:{type:Boolean},focusOnChange:{type:Boolean},formatOptions:{},locale:{},disabled:{type:Boolean},readonly:{type:Boolean},disableWheelChange:{type:Boolean},invertWheelChange:{type:Boolean},id:{},asChild:{type:Boolean},as:{},name:{},required:{type:Boolean},class:{}},emits:["update:modelValue"],setup(t,{emit:e}){const n=t,i=e,r=co(n,"class"),s=ar(r,i);return(o,a)=>(me(),Ie(E(QT),It(E(s),{class:E(cr)("grid gap-1.5",n.class)}),{default:te(l=>[at(o.$slots,"default",Ss(Yr(l)))]),_:3},16,["class"]))}}),Fk=Ne({__name:"NumberFieldContent",props:{class:{}},setup(t){const e=t;return(n,i)=>(me(),Ct("div",{class:Qt(E(cr)("relative [&>[data-slot=input]]:has-[[data-slot=increment]]:pr-5 [&>[data-slot=input]]:has-[[data-slot=decrement]]:pl-5",e.class))},[at(n.$slots,"default")],2))}}),Uk=Ne({__name:"NumberFieldDecrement",props:{disabled:{type:Boolean},asChild:{type:Boolean},as:{},class:{}},setup(t){const e=t,n=co(e,"class"),i=Sl(n);return(r,s)=>(me(),Ie(E(tA),It({"data-slot":"decrement"},E(i),{class:E(cr)("absolute top-1/2 -translate-y-1/2 left-0 p-3 disabled:cursor-not-allowed disabled:opacity-20",e.class)}),{default:te(()=>[at(r.$slots,"default",{},()=>[ie(E(wU),{class:"h-4 w-4"})])]),_:3},16,["class"]))}}),kk=Ne({__name:"NumberFieldIncrement",props:{disabled:{type:Boolean},asChild:{type:Boolean},as:{},class:{}},setup(t){const e=t,n=co(e,"class"),i=Sl(n);return(r,s)=>(me(),Ie(E(iA),It({"data-slot":"increment"},E(i),{class:E(cr)("absolute top-1/2 -translate-y-1/2 right-0 disabled:cursor-not-allowed disabled:opacity-20 p-3",e.class)}),{default:te(()=>[at(r.$slots,"default",{},()=>[ie(E(rS),{class:"h-4 w-4"})])]),_:3},16,["class"]))}}),Bk=Ne({__name:"NumberFieldInput",props:{class:{}},setup(t){const e=t;return(n,i)=>(me(),Ie(E(sA),{"data-slot":"input",class:Qt(E(cr)("flex h-9 w-full rounded-md border border-input bg-transparent py-1 text-sm text-center text-foreground shadow-sm transition-colors placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:cursor-not-allowed disabled:opacity-50",e.class))},null,8,["class"]))}}),zk={key:2,class:"slider-container"},Vk={key:0,class:"slider-value"},Hk={key:3,class:"number-field-container"},Gk=Ne({__name:"Openbar",setup(t){const e=ke(!0);function n(){e.value=!e.value}document.addEventListener("keydown",r=>{(r.key==="Q"||r.key==="q")&&n()});const{isHovered:i}=Tm("openbar");return Wn(()=>{Fu.value=i.value}),(r,s)=>(me(),Ct(Kt,null,[Ye("div",{id:"openbar",class:Qt(["fixed-openbar theme",{"is-hidden":!e.value}])},[(me(!0),Ct(Kt,null,ta(E(Md),o=>(me(),Ct("div",{key:o.id,class:"dynamic-item"},[o.label?(me(),Ct("label",{key:0,class:Qt(["dynamic-label",{dark:E(qn).value==="dark"}])},Ci(o.label),3)):fi("",!0),o.component==="Button"?(me(),Ie(E(ln),{key:1,variant:"secondary",onClick:a=>E(Wf)(o.action)},{default:te(()=>[zt(Ci(o.props.text),1)]),_:2},1032,["onClick"])):o.component==="Slider"?(me(),Ct("div",zk,[ie(E(uC),{min:o.props.min,max:o.props.max,step:o.props.step,"default-value":o.props.defaultValue,modelValue:o.props.defaultValue,"onUpdate:modelValue":[a=>o.props.defaultValue=a,a=>E(Wf)(o.action,a[0])],class:"w-[80%]"},null,8,["min","max","step","default-value","modelValue","onUpdate:modelValue"]),o.props.defaultValue?(me(),Ct("span",Vk,Ci(o.props.defaultValue[0]),1)):fi("",!0)])):o.component==="NumberField"?(me(),Ct("div",Hk,[ie(E(Ok),{min:o.props.min,max:o.props.max,step:o.props.step,"default-value":o.props.value,modelValue:o.props.value,"onUpdate:modelValue":[a=>o.props.value=a,a=>E(Wf)(o.action,a)],class:"w-full"},{default:te(()=>[ie(E(Fk),null,{default:te(()=>[ie(E(Uk)),ie(E(Bk)),ie(E(kk))]),_:1})]),_:1},8,["min","max","step","default-value","modelValue","onUpdate:modelValue"])])):fi("",!0)]))),128)),ie(E(ln),{variant:"secondary",size:"icon",class:"mb-4",onClick:s[0]||(s[0]=o=>n())},{default:te(()=>[ie(E(nS))]),_:1})],2),ie(E(ln),{variant:"secondary",size:"icon",class:Qt(["mb-5",{"is-hidden":!e.value}]),onClick:s[1]||(s[1]=o=>n())},{default:te(()=>[ie(E(iS))]),_:1},8,["class"])],64))}}),Wk=Zr(Gk,[["__scopeId","data-v-5425abcf"]]),qk={id:"sidebar"},Xk=Ne({__name:"Sidebar",setup(t){return(e,n)=>(me(),Ct("div",qk,[ie(Lk),E(Ic).isVisible?(me(),Ie(Wk,{key:0})):fi("",!0)]))}}),$k=Zr(Xk,[["__scopeId","data-v-23dc3866"]]),jk={key:0,class:"theme-indicator","aria-hidden":"true"},Yk=Ne({__name:"ThemeIndicator",setup(t){const e=ke(!1),n=ke(qn.value);let i=null,r=!0;function s(a){n.value=a,e.value=!0,i&&window.clearTimeout(i),i=window.setTimeout(()=>{e.value=!1,i=null},900)}const o=rn(()=>qn.value,a=>{if(r){n.value=a,r=!1;return}a!==n.value&&s(a)},{immediate:!0});return da(()=>{i&&(window.clearTimeout(i),i=null),o()}),ti(()=>{}),(a,l)=>(me(),Ie(wM,{name:"theme-indicator"},{default:te(()=>[e.value?(me(),Ct("div",jk,[n.value==="dark"?(me(),Ie(E(MU),{key:0,class:"theme-indicator-icon"})):(me(),Ie(E(IU),{key:1,class:"theme-indicator-icon"}))])):fi("",!0)]),_:1}))}}),Jk=Zr(Yk,[["__scopeId","data-v-7535998e"]]),Kk=Ne({__name:"App",setup(t){const e=ke(null);return ti(()=>{e.value&&(e.value.appendChild(nn.domElement),oU())}),(n,i)=>(me(),Ct("div",{class:Qt(["app-container",{dark:E(qn).value==="dark"}])},[ie($k),Ye("div",{ref_key:"threeContainer",ref:e,class:"three-container"},null,512),ie(Jk),ie(BU)],2))}}),Zk=Zr(Kk,[["__scopeId","data-v-cbc799be"]]),Qk=YM(Zk);Qk.mount("#app");