From bed1a1afa2f2e723676a5e6c63dbb27df1f1079d Mon Sep 17 00:00:00 2001 From: wodeni Date: Tue, 23 Jan 2024 05:36:36 +0000 Subject: [PATCH] =?UTF-8?q?Deploy=20preview=20for=20PR=2022=20=F0=9F=9B=AB?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../{index-5ad880d1.js => index-da7cdf0e.js} | 98 +++++++++---------- pr-preview/pr-22/index.html | 2 +- 2 files changed, 50 insertions(+), 50 deletions(-) rename pr-preview/pr-22/assets/{index-5ad880d1.js => index-da7cdf0e.js} (96%) diff --git a/pr-preview/pr-22/assets/index-5ad880d1.js b/pr-preview/pr-22/assets/index-da7cdf0e.js similarity index 96% rename from pr-preview/pr-22/assets/index-5ad880d1.js rename to pr-preview/pr-22/assets/index-da7cdf0e.js index 2362a78..5e11a1a 100644 --- a/pr-preview/pr-22/assets/index-5ad880d1.js +++ b/pr-preview/pr-22/assets/index-da7cdf0e.js @@ -6,7 +6,7 @@ * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. - */var Ou=Symbol.for("react.element"),E5=Symbol.for("react.portal"),T5=Symbol.for("react.fragment"),k5=Symbol.for("react.strict_mode"),D5=Symbol.for("react.profiler"),U5=Symbol.for("react.provider"),P5=Symbol.for("react.context"),_5=Symbol.for("react.forward_ref"),J5=Symbol.for("react.suspense"),O5=Symbol.for("react.memo"),Q5=Symbol.for("react.lazy"),xB=Symbol.iterator;function j5(n){return n===null||typeof n!="object"?null:(n=xB&&n[xB]||n["@@iterator"],typeof n=="function"?n:null)}var lx={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},gx=Object.assign,cx={};function Gc(n,e,t){this.props=n,this.context=e,this.refs=cx,this.updater=t||lx}Gc.prototype.isReactComponent={};Gc.prototype.setState=function(n,e){if(typeof n!="object"&&typeof n!="function"&&n!=null)throw Error("setState(...): takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,n,e,"setState")};Gc.prototype.forceUpdate=function(n){this.updater.enqueueForceUpdate(this,n,"forceUpdate")};function Ix(){}Ix.prototype=Gc.prototype;function Ub(n,e,t){this.props=n,this.context=e,this.refs=cx,this.updater=t||lx}var Pb=Ub.prototype=new Ix;Pb.constructor=Ub;gx(Pb,Gc.prototype);Pb.isPureReactComponent=!0;var RB=Array.isArray,ux=Object.prototype.hasOwnProperty,_b={current:null},Cx={key:!0,ref:!0,__self:!0,__source:!0};function dx(n,e,t){var i,s={},r=null,o=null;if(e!=null)for(i in e.ref!==void 0&&(o=e.ref),e.key!==void 0&&(r=""+e.key),e)ux.call(e,i)&&!Cx.hasOwnProperty(i)&&(s[i]=e[i]);var a=arguments.length-2;if(a===1)s.children=t;else if(1"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),$m=Object.prototype.hasOwnProperty,gN=/^[:A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD][:A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD\-.0-9\u00B7\u0300-\u036F\u203F-\u2040]*$/,VB={},MB={};function cN(n){return $m.call(MB,n)?!0:$m.call(VB,n)?!1:gN.test(n)?MB[n]=!0:(VB[n]=!0,!1)}function IN(n,e,t,i){if(t!==null&&t.type===0)return!1;switch(typeof e){case"function":case"symbol":return!0;case"boolean":return i?!1:t!==null?!t.acceptsBooleans:(n=n.toLowerCase().slice(0,5),n!=="data-"&&n!=="aria-");default:return!1}}function uN(n,e,t,i){if(e===null||typeof e>"u"||IN(n,e,t,i))return!0;if(i)return!1;if(t!==null)switch(t.type){case 3:return!e;case 4:return e===!1;case 5:return isNaN(e);case 6:return isNaN(e)||1>e}return!1}function Ei(n,e,t,i,s,r,o){this.acceptsBooleans=e===2||e===3||e===4,this.attributeName=i,this.attributeNamespace=s,this.mustUseProperty=t,this.propertyName=n,this.type=e,this.sanitizeURL=r,this.removeEmptyString=o}var Ci={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(n){Ci[n]=new Ei(n,0,!1,n,null,!1,!1)});[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(function(n){var e=n[0];Ci[e]=new Ei(e,1,!1,n[1],null,!1,!1)});["contentEditable","draggable","spellCheck","value"].forEach(function(n){Ci[n]=new Ei(n,2,!1,n.toLowerCase(),null,!1,!1)});["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(n){Ci[n]=new Ei(n,2,!1,n,null,!1,!1)});"allowFullScreen async autoFocus autoPlay controls default defer disabled disablePictureInPicture disableRemotePlayback formNoValidate hidden loop noModule noValidate open playsInline readOnly required reversed scoped seamless itemScope".split(" ").forEach(function(n){Ci[n]=new Ei(n,3,!1,n.toLowerCase(),null,!1,!1)});["checked","multiple","muted","selected"].forEach(function(n){Ci[n]=new Ei(n,3,!0,n,null,!1,!1)});["capture","download"].forEach(function(n){Ci[n]=new Ei(n,4,!1,n,null,!1,!1)});["cols","rows","size","span"].forEach(function(n){Ci[n]=new Ei(n,6,!1,n,null,!1,!1)});["rowSpan","start"].forEach(function(n){Ci[n]=new Ei(n,5,!1,n.toLowerCase(),null,!1,!1)});var Ob=/[\-:]([a-z])/g;function Qb(n){return n[1].toUpperCase()}"accent-height alignment-baseline arabic-form baseline-shift cap-height clip-path clip-rule color-interpolation color-interpolation-filters color-profile color-rendering dominant-baseline enable-background fill-opacity fill-rule flood-color flood-opacity font-family font-size font-size-adjust font-stretch font-style font-variant font-weight glyph-name glyph-orientation-horizontal glyph-orientation-vertical horiz-adv-x horiz-origin-x image-rendering letter-spacing lighting-color marker-end marker-mid marker-start overline-position overline-thickness paint-order panose-1 pointer-events rendering-intent shape-rendering stop-color stop-opacity strikethrough-position strikethrough-thickness stroke-dasharray stroke-dashoffset stroke-linecap stroke-linejoin stroke-miterlimit stroke-opacity stroke-width text-anchor text-decoration text-rendering underline-position underline-thickness unicode-bidi unicode-range units-per-em v-alphabetic v-hanging v-ideographic v-mathematical vector-effect vert-adv-y vert-origin-x vert-origin-y word-spacing writing-mode xmlns:xlink x-height".split(" ").forEach(function(n){var e=n.replace(Ob,Qb);Ci[e]=new Ei(e,1,!1,n,null,!1,!1)});"xlink:actuate xlink:arcrole xlink:role xlink:show xlink:title xlink:type".split(" ").forEach(function(n){var e=n.replace(Ob,Qb);Ci[e]=new Ei(e,1,!1,n,"http://www.w3.org/1999/xlink",!1,!1)});["xml:base","xml:lang","xml:space"].forEach(function(n){var e=n.replace(Ob,Qb);Ci[e]=new Ei(e,1,!1,n,"http://www.w3.org/XML/1998/namespace",!1,!1)});["tabIndex","crossOrigin"].forEach(function(n){Ci[n]=new Ei(n,1,!1,n.toLowerCase(),null,!1,!1)});Ci.xlinkHref=new Ei("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1);["src","href","action","formAction"].forEach(function(n){Ci[n]=new Ei(n,1,!1,n.toLowerCase(),null,!0,!0)});function jb(n,e,t,i){var s=Ci.hasOwnProperty(e)?Ci[e]:null;(s!==null?s.type!==0:i||!(2"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),$m=Object.prototype.hasOwnProperty,gN=/^[:A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD][:A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD\-.0-9\u00B7\u0300-\u036F\u203F-\u2040]*$/,VB={},MB={};function cN(n){return $m.call(MB,n)?!0:$m.call(VB,n)?!1:gN.test(n)?MB[n]=!0:(VB[n]=!0,!1)}function IN(n,e,t,i){if(t!==null&&t.type===0)return!1;switch(typeof e){case"function":case"symbol":return!0;case"boolean":return i?!1:t!==null?!t.acceptsBooleans:(n=n.toLowerCase().slice(0,5),n!=="data-"&&n!=="aria-");default:return!1}}function uN(n,e,t,i){if(e===null||typeof e>"u"||IN(n,e,t,i))return!0;if(i)return!1;if(t!==null)switch(t.type){case 3:return!e;case 4:return e===!1;case 5:return isNaN(e);case 6:return isNaN(e)||1>e}return!1}function Ei(n,e,t,i,s,r,o){this.acceptsBooleans=e===2||e===3||e===4,this.attributeName=i,this.attributeNamespace=s,this.mustUseProperty=t,this.propertyName=n,this.type=e,this.sanitizeURL=r,this.removeEmptyString=o}var Ci={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(n){Ci[n]=new Ei(n,0,!1,n,null,!1,!1)});[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(function(n){var e=n[0];Ci[e]=new Ei(e,1,!1,n[1],null,!1,!1)});["contentEditable","draggable","spellCheck","value"].forEach(function(n){Ci[n]=new Ei(n,2,!1,n.toLowerCase(),null,!1,!1)});["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(n){Ci[n]=new Ei(n,2,!1,n,null,!1,!1)});"allowFullScreen async autoFocus autoPlay controls default defer disabled disablePictureInPicture disableRemotePlayback formNoValidate hidden loop noModule noValidate open playsInline readOnly required reversed scoped seamless itemScope".split(" ").forEach(function(n){Ci[n]=new Ei(n,3,!1,n.toLowerCase(),null,!1,!1)});["checked","multiple","muted","selected"].forEach(function(n){Ci[n]=new Ei(n,3,!0,n,null,!1,!1)});["capture","download"].forEach(function(n){Ci[n]=new Ei(n,4,!1,n,null,!1,!1)});["cols","rows","size","span"].forEach(function(n){Ci[n]=new Ei(n,6,!1,n,null,!1,!1)});["rowSpan","start"].forEach(function(n){Ci[n]=new Ei(n,5,!1,n.toLowerCase(),null,!1,!1)});var Ob=/[\-:]([a-z])/g;function Qb(n){return n[1].toUpperCase()}"accent-height alignment-baseline arabic-form baseline-shift cap-height clip-path clip-rule color-interpolation color-interpolation-filters color-profile color-rendering dominant-baseline enable-background fill-opacity fill-rule flood-color flood-opacity font-family font-size font-size-adjust font-stretch font-style font-variant font-weight glyph-name glyph-orientation-horizontal glyph-orientation-vertical horiz-adv-x horiz-origin-x image-rendering letter-spacing lighting-color marker-end marker-mid marker-start overline-position overline-thickness paint-order panose-1 pointer-events rendering-intent shape-rendering stop-color stop-opacity strikethrough-position strikethrough-thickness stroke-dasharray stroke-dashoffset stroke-linecap stroke-linejoin stroke-miterlimit stroke-opacity stroke-width text-anchor text-decoration text-rendering underline-position underline-thickness unicode-bidi unicode-range units-per-em v-alphabetic v-hanging v-ideographic v-mathematical vector-effect vert-adv-y vert-origin-x vert-origin-y word-spacing writing-mode xmlns:xlink x-height".split(" ").forEach(function(n){var e=n.replace(Ob,Qb);Ci[e]=new Ei(e,1,!1,n,null,!1,!1)});"xlink:actuate xlink:arcrole xlink:role xlink:show xlink:title xlink:type".split(" ").forEach(function(n){var e=n.replace(Ob,Qb);Ci[e]=new Ei(e,1,!1,n,"http://www.w3.org/1999/xlink",!1,!1)});["xml:base","xml:lang","xml:space"].forEach(function(n){var e=n.replace(Ob,Qb);Ci[e]=new Ei(e,1,!1,n,"http://www.w3.org/XML/1998/namespace",!1,!1)});["tabIndex","crossOrigin"].forEach(function(n){Ci[n]=new Ei(n,1,!1,n.toLowerCase(),null,!1,!1)});Ci.xlinkHref=new Ei("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1);["src","href","action","formAction"].forEach(function(n){Ci[n]=new Ei(n,1,!1,n.toLowerCase(),null,!0,!0)});function jb(n,e,t,i){var s=Ci.hasOwnProperty(e)?Ci[e]:null;(s!==null?s.type!==0:i||!(2a||s[o]!==r[a]){var l=` -`+s[o].replace(" at new "," at ");return n.displayName&&l.includes("")&&(l=l.replace("",n.displayName)),l}while(1<=o&&0<=a);break}}}finally{Rf=!1,Error.prepareStackTrace=t}return(n=n?n.displayName||n.name:"")?XI(n):""}function CN(n){switch(n.tag){case 5:return XI(n.type);case 16:return XI("Lazy");case 13:return XI("Suspense");case 19:return XI("SuspenseList");case 0:case 2:case 15:return n=Wf(n.type,!1),n;case 11:return n=Wf(n.type.render,!1),n;case 1:return n=Wf(n.type,!0),n;default:return""}}function i0(n){if(n==null)return null;if(typeof n=="function")return n.displayName||n.name||null;if(typeof n=="string")return n;switch(n){case Wg:return"Fragment";case Rg:return"Portal";case e0:return"Profiler";case qb:return"StrictMode";case t0:return"Suspense";case n0:return"SuspenseList"}if(typeof n=="object")switch(n.$$typeof){case yx:return(n.displayName||"Context")+".Consumer";case vx:return(n._context.displayName||"Context")+".Provider";case $b:var e=n.render;return n=n.displayName,n||(n=e.displayName||e.name||"",n=n!==""?"ForwardRef("+n+")":"ForwardRef"),n;case ev:return e=n.displayName||null,e!==null?e:i0(n.type)||"Memo";case jo:e=n._payload,n=n._init;try{return i0(n(e))}catch{}}return null}function dN(n){var e=n.type;switch(n.tag){case 24:return"Cache";case 9:return(e.displayName||"Context")+".Consumer";case 10:return(e._context.displayName||"Context")+".Provider";case 18:return"DehydratedFragment";case 11:return n=e.render,n=n.displayName||n.name||"",e.displayName||(n!==""?"ForwardRef("+n+")":"ForwardRef");case 7:return"Fragment";case 5:return e;case 4:return"Portal";case 3:return"Root";case 6:return"Text";case 16:return i0(e);case 8:return e===qb?"StrictMode":"Mode";case 22:return"Offscreen";case 12:return"Profiler";case 21:return"Scope";case 13:return"Suspense";case 19:return"SuspenseList";case 25:return"TracingMarker";case 1:case 0:case 17:case 2:case 14:case 15:if(typeof e=="function")return e.displayName||e.name||null;if(typeof e=="string")return e}return null}function Aa(n){switch(typeof n){case"boolean":case"number":case"string":case"undefined":return n;case"object":return n;default:return""}}function Bx(n){var e=n.type;return(n=n.nodeName)&&n.toLowerCase()==="input"&&(e==="checkbox"||e==="radio")}function hN(n){var e=Bx(n)?"checked":"value",t=Object.getOwnPropertyDescriptor(n.constructor.prototype,e),i=""+n[e];if(!n.hasOwnProperty(e)&&typeof t<"u"&&typeof t.get=="function"&&typeof t.set=="function"){var s=t.get,r=t.set;return Object.defineProperty(n,e,{configurable:!0,get:function(){return s.call(this)},set:function(o){i=""+o,r.call(this,o)}}),Object.defineProperty(n,e,{enumerable:t.enumerable}),{getValue:function(){return i},setValue:function(o){i=""+o},stopTracking:function(){n._valueTracker=null,delete n[e]}}}}function pd(n){n._valueTracker||(n._valueTracker=hN(n))}function Zx(n){if(!n)return!1;var e=n._valueTracker;if(!e)return!0;var t=e.getValue(),i="";return n&&(i=Bx(n)?n.checked?"true":"false":n.value),n=i,n!==t?(e.setValue(n),!0):!1}function tA(n){if(n=n||(typeof document<"u"?document:void 0),typeof n>"u")return null;try{return n.activeElement||n.body}catch{return n.body}}function s0(n,e){var t=e.checked;return yn({},e,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:t??n._wrapperState.initialChecked})}function HB(n,e){var t=e.defaultValue==null?"":e.defaultValue,i=e.checked!=null?e.checked:e.defaultChecked;t=Aa(e.value!=null?e.value:t),n._wrapperState={initialChecked:i,initialValue:t,controlled:e.type==="checkbox"||e.type==="radio"?e.checked!=null:e.value!=null}}function wx(n,e){e=e.checked,e!=null&&jb(n,"checked",e,!1)}function r0(n,e){wx(n,e);var t=Aa(e.value),i=e.type;if(t!=null)i==="number"?(t===0&&n.value===""||n.value!=t)&&(n.value=""+t):n.value!==""+t&&(n.value=""+t);else if(i==="submit"||i==="reset"){n.removeAttribute("value");return}e.hasOwnProperty("value")?o0(n,e.type,t):e.hasOwnProperty("defaultValue")&&o0(n,e.type,Aa(e.defaultValue)),e.checked==null&&e.defaultChecked!=null&&(n.defaultChecked=!!e.defaultChecked)}function XB(n,e,t){if(e.hasOwnProperty("value")||e.hasOwnProperty("defaultValue")){var i=e.type;if(!(i!=="submit"&&i!=="reset"||e.value!==void 0&&e.value!==null))return;e=""+n._wrapperState.initialValue,t||e===n.value||(n.value=e),n.defaultValue=e}t=n.name,t!==""&&(n.name=""),n.defaultChecked=!!n._wrapperState.initialChecked,t!==""&&(n.name=t)}function o0(n,e,t){(e!=="number"||tA(n.ownerDocument)!==n)&&(t==null?n.defaultValue=""+n._wrapperState.initialValue:n.defaultValue!==""+t&&(n.defaultValue=""+t))}var FI=Array.isArray;function jg(n,e,t,i){if(n=n.options,e){e={};for(var s=0;s"+e.valueOf().toString()+"",e=fd.firstChild;n.firstChild;)n.removeChild(n.firstChild);for(;e.firstChild;)n.appendChild(e.firstChild)}});function Iu(n,e){if(e){var t=n.firstChild;if(t&&t===n.lastChild&&t.nodeType===3){t.nodeValue=e;return}}n.textContent=e}var DI={animationIterationCount:!0,aspectRatio:!0,borderImageOutset:!0,borderImageSlice:!0,borderImageWidth:!0,boxFlex:!0,boxFlexGroup:!0,boxOrdinalGroup:!0,columnCount:!0,columns:!0,flex:!0,flexGrow:!0,flexPositive:!0,flexShrink:!0,flexNegative:!0,flexOrder:!0,gridArea:!0,gridRow:!0,gridRowEnd:!0,gridRowSpan:!0,gridRowStart:!0,gridColumn:!0,gridColumnEnd:!0,gridColumnSpan:!0,gridColumnStart:!0,fontWeight:!0,lineClamp:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,tabSize:!0,widows:!0,zIndex:!0,zoom:!0,fillOpacity:!0,floodOpacity:!0,stopOpacity:!0,strokeDasharray:!0,strokeDashoffset:!0,strokeMiterlimit:!0,strokeOpacity:!0,strokeWidth:!0},AN=["Webkit","ms","Moz","O"];Object.keys(DI).forEach(function(n){AN.forEach(function(e){e=e+n.charAt(0).toUpperCase()+n.substring(1),DI[e]=DI[n]})});function Wx(n,e,t){return e==null||typeof e=="boolean"||e===""?"":t||typeof e!="number"||e===0||DI.hasOwnProperty(n)&&DI[n]?(""+e).trim():e+"px"}function Vx(n,e){n=n.style;for(var t in e)if(e.hasOwnProperty(t)){var i=t.indexOf("--")===0,s=Wx(t,e[t],i);t==="float"&&(t="cssFloat"),i?n.setProperty(t,s):n[t]=s}}var pN=yn({menuitem:!0},{area:!0,base:!0,br:!0,col:!0,embed:!0,hr:!0,img:!0,input:!0,keygen:!0,link:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0});function g0(n,e){if(e){if(pN[n]&&(e.children!=null||e.dangerouslySetInnerHTML!=null))throw Error(Ve(137,n));if(e.dangerouslySetInnerHTML!=null){if(e.children!=null)throw Error(Ve(60));if(typeof e.dangerouslySetInnerHTML!="object"||!("__html"in e.dangerouslySetInnerHTML))throw Error(Ve(61))}if(e.style!=null&&typeof e.style!="object")throw Error(Ve(62))}}function c0(n,e){if(n.indexOf("-")===-1)return typeof e.is=="string";switch(n){case"annotation-xml":case"color-profile":case"font-face":case"font-face-src":case"font-face-uri":case"font-face-format":case"font-face-name":case"missing-glyph":return!1;default:return!0}}var I0=null;function tv(n){return n=n.target||n.srcElement||window,n.correspondingUseElement&&(n=n.correspondingUseElement),n.nodeType===3?n.parentNode:n}var u0=null,qg=null,$g=null;function KB(n){if(n=qu(n)){if(typeof u0!="function")throw Error(Ve(280));var e=n.stateNode;e&&(e=YA(e),u0(n.stateNode,n.type,e))}}function Mx(n){qg?$g?$g.push(n):$g=[n]:qg=n}function Nx(){if(qg){var n=qg,e=$g;if($g=qg=null,KB(n),e)for(n=0;n>>=0,n===0?32:31-(xN(n)/RN|0)|0}var md=64,bd=4194304;function YI(n){switch(n&-n){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return n&4194240;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return n&130023424;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 1073741824;default:return n}}function rA(n,e){var t=n.pendingLanes;if(t===0)return 0;var i=0,s=n.suspendedLanes,r=n.pingedLanes,o=t&268435455;if(o!==0){var a=o&~s;a!==0?i=YI(a):(r&=o,r!==0&&(i=YI(r)))}else o=t&~s,o!==0?i=YI(o):r!==0&&(i=YI(r));if(i===0)return 0;if(e!==0&&e!==i&&!(e&s)&&(s=i&-i,r=e&-e,s>=r||s===16&&(r&4194240)!==0))return e;if(i&4&&(i|=t&16),e=n.entangledLanes,e!==0)for(n=n.entanglements,e&=i;0t;t++)e.push(n);return e}function Qu(n,e,t){n.pendingLanes|=e,e!==536870912&&(n.suspendedLanes=0,n.pingedLanes=0),n=n.eventTimes,e=31-dr(e),n[e]=t}function NN(n,e){var t=n.pendingLanes&~e;n.pendingLanes=e,n.suspendedLanes=0,n.pingedLanes=0,n.expiredLanes&=e,n.mutableReadLanes&=e,n.entangledLanes&=e,e=n.entanglements;var i=n.eventTimes;for(n=n.expirationTimes;0=PI),_B=String.fromCharCode(32),JB=!1;function $x(n,e){switch(n){case"keyup":return a3.indexOf(e.keyCode)!==-1;case"keydown":return e.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function eR(n){return n=n.detail,typeof n=="object"&&"data"in n?n.data:null}var Vg=!1;function g3(n,e){switch(n){case"compositionend":return eR(e);case"keypress":return e.which!==32?null:(JB=!0,_B);case"textInput":return n=e.data,n===_B&&JB?null:n;default:return null}}function c3(n,e){if(Vg)return n==="compositionend"||!gv&&$x(n,e)?(n=jx(),Xh=ov=na=null,Vg=!1,n):null;switch(n){case"paste":return null;case"keypress":if(!(e.ctrlKey||e.altKey||e.metaKey)||e.ctrlKey&&e.altKey){if(e.char&&1=e)return{node:t,offset:e-n};n=i}e:{for(;t;){if(t.nextSibling){t=t.nextSibling;break e}t=t.parentNode}t=void 0}t=qB(t)}}function sR(n,e){return n&&e?n===e?!0:n&&n.nodeType===3?!1:e&&e.nodeType===3?sR(n,e.parentNode):"contains"in n?n.contains(e):n.compareDocumentPosition?!!(n.compareDocumentPosition(e)&16):!1:!1}function rR(){for(var n=window,e=tA();e instanceof n.HTMLIFrameElement;){try{var t=typeof e.contentWindow.location.href=="string"}catch{t=!1}if(t)n=e.contentWindow;else break;e=tA(n.document)}return e}function cv(n){var e=n&&n.nodeName&&n.nodeName.toLowerCase();return e&&(e==="input"&&(n.type==="text"||n.type==="search"||n.type==="tel"||n.type==="url"||n.type==="password")||e==="textarea"||n.contentEditable==="true")}function m3(n){var e=rR(),t=n.focusedElem,i=n.selectionRange;if(e!==t&&t&&t.ownerDocument&&sR(t.ownerDocument.documentElement,t)){if(i!==null&&cv(t)){if(e=i.start,n=i.end,n===void 0&&(n=e),"selectionStart"in t)t.selectionStart=e,t.selectionEnd=Math.min(n,t.value.length);else if(n=(e=t.ownerDocument||document)&&e.defaultView||window,n.getSelection){n=n.getSelection();var s=t.textContent.length,r=Math.min(i.start,s);i=i.end===void 0?r:Math.min(i.end,s),!n.extend&&r>i&&(s=i,i=r,r=s),s=$B(t,r);var o=$B(t,i);s&&o&&(n.rangeCount!==1||n.anchorNode!==s.node||n.anchorOffset!==s.offset||n.focusNode!==o.node||n.focusOffset!==o.offset)&&(e=e.createRange(),e.setStart(s.node,s.offset),n.removeAllRanges(),r>i?(n.addRange(e),n.extend(o.node,o.offset)):(e.setEnd(o.node,o.offset),n.addRange(e)))}}for(e=[],n=t;n=n.parentNode;)n.nodeType===1&&e.push({element:n,left:n.scrollLeft,top:n.scrollTop});for(typeof t.focus=="function"&&t.focus(),t=0;t=document.documentMode,Mg=null,f0=null,JI=null,m0=!1;function e2(n,e,t){var i=t.window===t?t.document:t.nodeType===9?t:t.ownerDocument;m0||Mg==null||Mg!==tA(i)||(i=Mg,"selectionStart"in i&&cv(i)?i={start:i.selectionStart,end:i.selectionEnd}:(i=(i.ownerDocument&&i.ownerDocument.defaultView||window).getSelection(),i={anchorNode:i.anchorNode,anchorOffset:i.anchorOffset,focusNode:i.focusNode,focusOffset:i.focusOffset}),JI&&pu(JI,i)||(JI=i,i=lA(f0,"onSelect"),0Xg||(n.current=Z0[Xg],Z0[Xg]=null,Xg--)}function gn(n,e){Xg++,Z0[Xg]=n.current,n.current=e}var pa={},Wi=Ba(pa),is=Ba(!1),vl=pa;function cc(n,e){var t=n.type.contextTypes;if(!t)return pa;var i=n.stateNode;if(i&&i.__reactInternalMemoizedUnmaskedChildContext===e)return i.__reactInternalMemoizedMaskedChildContext;var s={},r;for(r in t)s[r]=e[r];return i&&(n=n.stateNode,n.__reactInternalMemoizedUnmaskedChildContext=e,n.__reactInternalMemoizedMaskedChildContext=s),s}function ss(n){return n=n.childContextTypes,n!=null}function cA(){Cn(is),Cn(Wi)}function a2(n,e,t){if(Wi.current!==pa)throw Error(Ve(168));gn(Wi,e),gn(is,t)}function dR(n,e,t){var i=n.stateNode;if(e=e.childContextTypes,typeof i.getChildContext!="function")return t;i=i.getChildContext();for(var s in i)if(!(s in e))throw Error(Ve(108,dN(n)||"Unknown",s));return yn({},t,i)}function IA(n){return n=(n=n.stateNode)&&n.__reactInternalMemoizedMergedChildContext||pa,vl=Wi.current,gn(Wi,n),gn(is,is.current),!0}function l2(n,e,t){var i=n.stateNode;if(!i)throw Error(Ve(169));t?(n=dR(n,e,vl),i.__reactInternalMemoizedMergedChildContext=n,Cn(is),Cn(Wi),gn(Wi,n)):Cn(is),gn(is,t)}var co=null,KA=!1,Df=!1;function hR(n){co===null?co=[n]:co.push(n)}function V3(n){KA=!0,hR(n)}function Za(){if(!Df&&co!==null){Df=!0;var n=0,e=tn;try{var t=co;for(tn=1;n>=o,s-=o,Co=1<<32-dr(e)+s|t<M?(Z=R,R=null):Z=R.sibling;var V=d(A,R,m[M],B);if(V===null){R===null&&(R=Z);break}n&&R&&V.alternate===null&&e(A,R),b=r(V,b,M),x===null?S=V:x.sibling=V,x=V,R=Z}if(M===m.length)return t(A,R),hn&&Qa(A,M),S;if(R===null){for(;MM?(Z=R,R=null):Z=R.sibling;var N=d(A,R,V.value,B);if(N===null){R===null&&(R=Z);break}n&&R&&N.alternate===null&&e(A,R),b=r(N,b,M),x===null?S=N:x.sibling=N,x=N,R=Z}if(V.done)return t(A,R),hn&&Qa(A,M),S;if(R===null){for(;!V.done;M++,V=m.next())V=C(A,V.value,B),V!==null&&(b=r(V,b,M),x===null?S=V:x.sibling=V,x=V);return hn&&Qa(A,M),S}for(R=i(A,R);!V.done;M++,V=m.next())V=h(R,A,M,V.value,B),V!==null&&(n&&V.alternate!==null&&R.delete(V.key===null?M:V.key),b=r(V,b,M),x===null?S=V:x.sibling=V,x=V);return n&&R.forEach(function(P){return e(A,P)}),hn&&Qa(A,M),S}function y(A,b,m,B){if(typeof m=="object"&&m!==null&&m.type===Wg&&m.key===null&&(m=m.props.children),typeof m=="object"&&m!==null){switch(m.$$typeof){case Ad:e:{for(var S=m.key,x=b;x!==null;){if(x.key===S){if(S=m.type,S===Wg){if(x.tag===7){t(A,x.sibling),b=s(x,m.props.children),b.return=A,A=b;break e}}else if(x.elementType===S||typeof S=="object"&&S!==null&&S.$$typeof===jo&&h2(S)===x.type){t(A,x.sibling),b=s(x,m.props),b.ref=lI(A,x,m),b.return=A,A=b;break e}t(A,x);break}else e(A,x);x=x.sibling}m.type===Wg?(b=hl(m.props.children,A.mode,B,m.key),b.return=A,A=b):(B=kh(m.type,m.key,m.props,null,A.mode,B),B.ref=lI(A,b,m),B.return=A,A=B)}return o(A);case Rg:e:{for(x=m.key;b!==null;){if(b.key===x)if(b.tag===4&&b.stateNode.containerInfo===m.containerInfo&&b.stateNode.implementation===m.implementation){t(A,b.sibling),b=s(b,m.children||[]),b.return=A,A=b;break e}else{t(A,b);break}else e(A,b);b=b.sibling}b=qf(m,A.mode,B),b.return=A,A=b}return o(A);case jo:return x=m._init,y(A,b,x(m._payload),B)}if(FI(m))return f(A,b,m,B);if(iI(m))return v(A,b,m,B);Sd(A,m)}return typeof m=="string"&&m!==""||typeof m=="number"?(m=""+m,b!==null&&b.tag===6?(t(A,b.sibling),b=s(b,m),b.return=A,A=b):(t(A,b),b=jf(m,A.mode,B),b.return=A,A=b),o(A)):t(A,b)}return y}var uc=GR(!0),BR=GR(!1),$u={},Kr=Ba($u),vu=Ba($u),yu=Ba($u);function al(n){if(n===$u)throw Error(Ve(174));return n}function mv(n,e){switch(gn(yu,e),gn(vu,n),gn(Kr,$u),n=e.nodeType,n){case 9:case 11:e=(e=e.documentElement)?e.namespaceURI:l0(null,"");break;default:n=n===8?e.parentNode:e,e=n.namespaceURI||null,n=n.tagName,e=l0(e,n)}Cn(Kr),gn(Kr,e)}function Cc(){Cn(Kr),Cn(vu),Cn(yu)}function ZR(n){al(yu.current);var e=al(Kr.current),t=l0(e,n.type);e!==t&&(gn(vu,n),gn(Kr,t))}function bv(n){vu.current===n&&(Cn(Kr),Cn(vu))}var fn=Ba(0);function pA(n){for(var e=n;e!==null;){if(e.tag===13){var t=e.memoizedState;if(t!==null&&(t=t.dehydrated,t===null||t.data==="$?"||t.data==="$!"))return e}else if(e.tag===19&&e.memoizedProps.revealOrder!==void 0){if(e.flags&128)return e}else if(e.child!==null){e.child.return=e,e=e.child;continue}if(e===n)break;for(;e.sibling===null;){if(e.return===null||e.return===n)return null;e=e.return}e.sibling.return=e.return,e=e.sibling}return null}var Uf=[];function vv(){for(var n=0;nt?t:4,n(!0);var i=Pf.transition;Pf.transition={};try{n(!1),e()}finally{tn=t,Pf.transition=i}}function ER(){return Us().memoizedState}function X3(n,e,t){var i=Ia(n);if(t={lane:i,action:t,hasEagerState:!1,eagerState:null,next:null},TR(n))kR(e,t);else if(t=mR(n,e,t,i),t!==null){var s=zi();hr(t,n,i,s),DR(t,e,i)}}function F3(n,e,t){var i=Ia(n),s={lane:i,action:t,hasEagerState:!1,eagerState:null,next:null};if(TR(n))kR(e,s);else{var r=n.alternate;if(n.lanes===0&&(r===null||r.lanes===0)&&(r=e.lastRenderedReducer,r!==null))try{var o=e.lastRenderedState,a=r(o,t);if(s.hasEagerState=!0,s.eagerState=a,pr(a,o)){var l=e.interleaved;l===null?(s.next=s,pv(e)):(s.next=l.next,l.next=s),e.interleaved=s;return}}catch{}finally{}t=mR(n,e,s,i),t!==null&&(s=zi(),hr(t,n,i,s),DR(t,e,i))}}function TR(n){var e=n.alternate;return n===vn||e!==null&&e===vn}function kR(n,e){OI=fA=!0;var t=n.pending;t===null?e.next=e:(e.next=t.next,t.next=e),n.pending=e}function DR(n,e,t){if(t&4194240){var i=e.lanes;i&=n.pendingLanes,t|=i,e.lanes=t,iv(n,t)}}var mA={readContext:Ds,useCallback:Gi,useContext:Gi,useEffect:Gi,useImperativeHandle:Gi,useInsertionEffect:Gi,useLayoutEffect:Gi,useMemo:Gi,useReducer:Gi,useRef:Gi,useState:Gi,useDebugValue:Gi,useDeferredValue:Gi,useTransition:Gi,useMutableSource:Gi,useSyncExternalStore:Gi,useId:Gi,unstable_isNewReconciler:!1},Y3={readContext:Ds,useCallback:function(n,e){return Xr().memoizedState=[n,e===void 0?null:e],n},useContext:Ds,useEffect:p2,useImperativeHandle:function(n,e,t){return t=t!=null?t.concat([n]):null,zh(4194308,4,FR.bind(null,e,n),t)},useLayoutEffect:function(n,e){return zh(4194308,4,n,e)},useInsertionEffect:function(n,e){return zh(4,2,n,e)},useMemo:function(n,e){var t=Xr();return e=e===void 0?null:e,n=n(),t.memoizedState=[n,e],n},useReducer:function(n,e,t){var i=Xr();return e=t!==void 0?t(e):e,i.memoizedState=i.baseState=e,n={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:n,lastRenderedState:e},i.queue=n,n=n.dispatch=X3.bind(null,vn,n),[i.memoizedState,n]},useRef:function(n){var e=Xr();return n={current:n},e.memoizedState=n},useState:A2,useDebugValue:wv,useDeferredValue:function(n){return Xr().memoizedState=n},useTransition:function(){var n=A2(!1),e=n[0];return n=H3.bind(null,n[1]),Xr().memoizedState=n,[e,n]},useMutableSource:function(){},useSyncExternalStore:function(n,e,t){var i=vn,s=Xr();if(hn){if(t===void 0)throw Error(Ve(407));t=t()}else{if(t=e(),oi===null)throw Error(Ve(349));Gl&30||xR(i,e,t)}s.memoizedState=t;var r={value:t,getSnapshot:e};return s.queue=r,p2(WR.bind(null,i,r,n),[n]),i.flags|=2048,Zu(9,RR.bind(null,i,r,t,e),void 0,null),t},useId:function(){var n=Xr(),e=oi.identifierPrefix;if(hn){var t=ho,i=Co;t=(i&~(1<<32-dr(i)-1)).toString(32)+t,e=":"+e+"R"+t,t=Gu++,0")&&(l=l.replace("",n.displayName)),l}while(1<=o&&0<=a);break}}}finally{Rf=!1,Error.prepareStackTrace=t}return(n=n?n.displayName||n.name:"")?FI(n):""}function CN(n){switch(n.tag){case 5:return FI(n.type);case 16:return FI("Lazy");case 13:return FI("Suspense");case 19:return FI("SuspenseList");case 0:case 2:case 15:return n=Wf(n.type,!1),n;case 11:return n=Wf(n.type.render,!1),n;case 1:return n=Wf(n.type,!0),n;default:return""}}function i0(n){if(n==null)return null;if(typeof n=="function")return n.displayName||n.name||null;if(typeof n=="string")return n;switch(n){case Wg:return"Fragment";case Rg:return"Portal";case e0:return"Profiler";case qb:return"StrictMode";case t0:return"Suspense";case n0:return"SuspenseList"}if(typeof n=="object")switch(n.$$typeof){case yx:return(n.displayName||"Context")+".Consumer";case vx:return(n._context.displayName||"Context")+".Provider";case $b:var e=n.render;return n=n.displayName,n||(n=e.displayName||e.name||"",n=n!==""?"ForwardRef("+n+")":"ForwardRef"),n;case ev:return e=n.displayName||null,e!==null?e:i0(n.type)||"Memo";case jo:e=n._payload,n=n._init;try{return i0(n(e))}catch{}}return null}function dN(n){var e=n.type;switch(n.tag){case 24:return"Cache";case 9:return(e.displayName||"Context")+".Consumer";case 10:return(e._context.displayName||"Context")+".Provider";case 18:return"DehydratedFragment";case 11:return n=e.render,n=n.displayName||n.name||"",e.displayName||(n!==""?"ForwardRef("+n+")":"ForwardRef");case 7:return"Fragment";case 5:return e;case 4:return"Portal";case 3:return"Root";case 6:return"Text";case 16:return i0(e);case 8:return e===qb?"StrictMode":"Mode";case 22:return"Offscreen";case 12:return"Profiler";case 21:return"Scope";case 13:return"Suspense";case 19:return"SuspenseList";case 25:return"TracingMarker";case 1:case 0:case 17:case 2:case 14:case 15:if(typeof e=="function")return e.displayName||e.name||null;if(typeof e=="string")return e}return null}function Aa(n){switch(typeof n){case"boolean":case"number":case"string":case"undefined":return n;case"object":return n;default:return""}}function Bx(n){var e=n.type;return(n=n.nodeName)&&n.toLowerCase()==="input"&&(e==="checkbox"||e==="radio")}function hN(n){var e=Bx(n)?"checked":"value",t=Object.getOwnPropertyDescriptor(n.constructor.prototype,e),i=""+n[e];if(!n.hasOwnProperty(e)&&typeof t<"u"&&typeof t.get=="function"&&typeof t.set=="function"){var s=t.get,r=t.set;return Object.defineProperty(n,e,{configurable:!0,get:function(){return s.call(this)},set:function(o){i=""+o,r.call(this,o)}}),Object.defineProperty(n,e,{enumerable:t.enumerable}),{getValue:function(){return i},setValue:function(o){i=""+o},stopTracking:function(){n._valueTracker=null,delete n[e]}}}}function pd(n){n._valueTracker||(n._valueTracker=hN(n))}function Zx(n){if(!n)return!1;var e=n._valueTracker;if(!e)return!0;var t=e.getValue(),i="";return n&&(i=Bx(n)?n.checked?"true":"false":n.value),n=i,n!==t?(e.setValue(n),!0):!1}function tA(n){if(n=n||(typeof document<"u"?document:void 0),typeof n>"u")return null;try{return n.activeElement||n.body}catch{return n.body}}function s0(n,e){var t=e.checked;return yn({},e,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:t??n._wrapperState.initialChecked})}function HB(n,e){var t=e.defaultValue==null?"":e.defaultValue,i=e.checked!=null?e.checked:e.defaultChecked;t=Aa(e.value!=null?e.value:t),n._wrapperState={initialChecked:i,initialValue:t,controlled:e.type==="checkbox"||e.type==="radio"?e.checked!=null:e.value!=null}}function wx(n,e){e=e.checked,e!=null&&jb(n,"checked",e,!1)}function r0(n,e){wx(n,e);var t=Aa(e.value),i=e.type;if(t!=null)i==="number"?(t===0&&n.value===""||n.value!=t)&&(n.value=""+t):n.value!==""+t&&(n.value=""+t);else if(i==="submit"||i==="reset"){n.removeAttribute("value");return}e.hasOwnProperty("value")?o0(n,e.type,t):e.hasOwnProperty("defaultValue")&&o0(n,e.type,Aa(e.defaultValue)),e.checked==null&&e.defaultChecked!=null&&(n.defaultChecked=!!e.defaultChecked)}function XB(n,e,t){if(e.hasOwnProperty("value")||e.hasOwnProperty("defaultValue")){var i=e.type;if(!(i!=="submit"&&i!=="reset"||e.value!==void 0&&e.value!==null))return;e=""+n._wrapperState.initialValue,t||e===n.value||(n.value=e),n.defaultValue=e}t=n.name,t!==""&&(n.name=""),n.defaultChecked=!!n._wrapperState.initialChecked,t!==""&&(n.name=t)}function o0(n,e,t){(e!=="number"||tA(n.ownerDocument)!==n)&&(t==null?n.defaultValue=""+n._wrapperState.initialValue:n.defaultValue!==""+t&&(n.defaultValue=""+t))}var YI=Array.isArray;function jg(n,e,t,i){if(n=n.options,e){e={};for(var s=0;s"+e.valueOf().toString()+"",e=fd.firstChild;n.firstChild;)n.removeChild(n.firstChild);for(;e.firstChild;)n.appendChild(e.firstChild)}});function uu(n,e){if(e){var t=n.firstChild;if(t&&t===n.lastChild&&t.nodeType===3){t.nodeValue=e;return}}n.textContent=e}var UI={animationIterationCount:!0,aspectRatio:!0,borderImageOutset:!0,borderImageSlice:!0,borderImageWidth:!0,boxFlex:!0,boxFlexGroup:!0,boxOrdinalGroup:!0,columnCount:!0,columns:!0,flex:!0,flexGrow:!0,flexPositive:!0,flexShrink:!0,flexNegative:!0,flexOrder:!0,gridArea:!0,gridRow:!0,gridRowEnd:!0,gridRowSpan:!0,gridRowStart:!0,gridColumn:!0,gridColumnEnd:!0,gridColumnSpan:!0,gridColumnStart:!0,fontWeight:!0,lineClamp:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,tabSize:!0,widows:!0,zIndex:!0,zoom:!0,fillOpacity:!0,floodOpacity:!0,stopOpacity:!0,strokeDasharray:!0,strokeDashoffset:!0,strokeMiterlimit:!0,strokeOpacity:!0,strokeWidth:!0},AN=["Webkit","ms","Moz","O"];Object.keys(UI).forEach(function(n){AN.forEach(function(e){e=e+n.charAt(0).toUpperCase()+n.substring(1),UI[e]=UI[n]})});function Wx(n,e,t){return e==null||typeof e=="boolean"||e===""?"":t||typeof e!="number"||e===0||UI.hasOwnProperty(n)&&UI[n]?(""+e).trim():e+"px"}function Vx(n,e){n=n.style;for(var t in e)if(e.hasOwnProperty(t)){var i=t.indexOf("--")===0,s=Wx(t,e[t],i);t==="float"&&(t="cssFloat"),i?n.setProperty(t,s):n[t]=s}}var pN=yn({menuitem:!0},{area:!0,base:!0,br:!0,col:!0,embed:!0,hr:!0,img:!0,input:!0,keygen:!0,link:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0});function g0(n,e){if(e){if(pN[n]&&(e.children!=null||e.dangerouslySetInnerHTML!=null))throw Error(Ve(137,n));if(e.dangerouslySetInnerHTML!=null){if(e.children!=null)throw Error(Ve(60));if(typeof e.dangerouslySetInnerHTML!="object"||!("__html"in e.dangerouslySetInnerHTML))throw Error(Ve(61))}if(e.style!=null&&typeof e.style!="object")throw Error(Ve(62))}}function c0(n,e){if(n.indexOf("-")===-1)return typeof e.is=="string";switch(n){case"annotation-xml":case"color-profile":case"font-face":case"font-face-src":case"font-face-uri":case"font-face-format":case"font-face-name":case"missing-glyph":return!1;default:return!0}}var I0=null;function tv(n){return n=n.target||n.srcElement||window,n.correspondingUseElement&&(n=n.correspondingUseElement),n.nodeType===3?n.parentNode:n}var u0=null,qg=null,$g=null;function KB(n){if(n=$u(n)){if(typeof u0!="function")throw Error(Ve(280));var e=n.stateNode;e&&(e=YA(e),u0(n.stateNode,n.type,e))}}function Mx(n){qg?$g?$g.push(n):$g=[n]:qg=n}function Nx(){if(qg){var n=qg,e=$g;if($g=qg=null,KB(n),e)for(n=0;n>>=0,n===0?32:31-(xN(n)/RN|0)|0}var md=64,bd=4194304;function KI(n){switch(n&-n){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return n&4194240;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return n&130023424;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 1073741824;default:return n}}function rA(n,e){var t=n.pendingLanes;if(t===0)return 0;var i=0,s=n.suspendedLanes,r=n.pingedLanes,o=t&268435455;if(o!==0){var a=o&~s;a!==0?i=KI(a):(r&=o,r!==0&&(i=KI(r)))}else o=t&~s,o!==0?i=KI(o):r!==0&&(i=KI(r));if(i===0)return 0;if(e!==0&&e!==i&&!(e&s)&&(s=i&-i,r=e&-e,s>=r||s===16&&(r&4194240)!==0))return e;if(i&4&&(i|=t&16),e=n.entangledLanes,e!==0)for(n=n.entanglements,e&=i;0t;t++)e.push(n);return e}function ju(n,e,t){n.pendingLanes|=e,e!==536870912&&(n.suspendedLanes=0,n.pingedLanes=0),n=n.eventTimes,e=31-dr(e),n[e]=t}function NN(n,e){var t=n.pendingLanes&~e;n.pendingLanes=e,n.suspendedLanes=0,n.pingedLanes=0,n.expiredLanes&=e,n.mutableReadLanes&=e,n.entangledLanes&=e,e=n.entanglements;var i=n.eventTimes;for(n=n.expirationTimes;0=_I),_B=String.fromCharCode(32),JB=!1;function $x(n,e){switch(n){case"keyup":return a3.indexOf(e.keyCode)!==-1;case"keydown":return e.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function eR(n){return n=n.detail,typeof n=="object"&&"data"in n?n.data:null}var Vg=!1;function g3(n,e){switch(n){case"compositionend":return eR(e);case"keypress":return e.which!==32?null:(JB=!0,_B);case"textInput":return n=e.data,n===_B&&JB?null:n;default:return null}}function c3(n,e){if(Vg)return n==="compositionend"||!gv&&$x(n,e)?(n=jx(),Xh=ov=na=null,Vg=!1,n):null;switch(n){case"paste":return null;case"keypress":if(!(e.ctrlKey||e.altKey||e.metaKey)||e.ctrlKey&&e.altKey){if(e.char&&1=e)return{node:t,offset:e-n};n=i}e:{for(;t;){if(t.nextSibling){t=t.nextSibling;break e}t=t.parentNode}t=void 0}t=qB(t)}}function sR(n,e){return n&&e?n===e?!0:n&&n.nodeType===3?!1:e&&e.nodeType===3?sR(n,e.parentNode):"contains"in n?n.contains(e):n.compareDocumentPosition?!!(n.compareDocumentPosition(e)&16):!1:!1}function rR(){for(var n=window,e=tA();e instanceof n.HTMLIFrameElement;){try{var t=typeof e.contentWindow.location.href=="string"}catch{t=!1}if(t)n=e.contentWindow;else break;e=tA(n.document)}return e}function cv(n){var e=n&&n.nodeName&&n.nodeName.toLowerCase();return e&&(e==="input"&&(n.type==="text"||n.type==="search"||n.type==="tel"||n.type==="url"||n.type==="password")||e==="textarea"||n.contentEditable==="true")}function m3(n){var e=rR(),t=n.focusedElem,i=n.selectionRange;if(e!==t&&t&&t.ownerDocument&&sR(t.ownerDocument.documentElement,t)){if(i!==null&&cv(t)){if(e=i.start,n=i.end,n===void 0&&(n=e),"selectionStart"in t)t.selectionStart=e,t.selectionEnd=Math.min(n,t.value.length);else if(n=(e=t.ownerDocument||document)&&e.defaultView||window,n.getSelection){n=n.getSelection();var s=t.textContent.length,r=Math.min(i.start,s);i=i.end===void 0?r:Math.min(i.end,s),!n.extend&&r>i&&(s=i,i=r,r=s),s=$B(t,r);var o=$B(t,i);s&&o&&(n.rangeCount!==1||n.anchorNode!==s.node||n.anchorOffset!==s.offset||n.focusNode!==o.node||n.focusOffset!==o.offset)&&(e=e.createRange(),e.setStart(s.node,s.offset),n.removeAllRanges(),r>i?(n.addRange(e),n.extend(o.node,o.offset)):(e.setEnd(o.node,o.offset),n.addRange(e)))}}for(e=[],n=t;n=n.parentNode;)n.nodeType===1&&e.push({element:n,left:n.scrollLeft,top:n.scrollTop});for(typeof t.focus=="function"&&t.focus(),t=0;t=document.documentMode,Mg=null,f0=null,OI=null,m0=!1;function e2(n,e,t){var i=t.window===t?t.document:t.nodeType===9?t:t.ownerDocument;m0||Mg==null||Mg!==tA(i)||(i=Mg,"selectionStart"in i&&cv(i)?i={start:i.selectionStart,end:i.selectionEnd}:(i=(i.ownerDocument&&i.ownerDocument.defaultView||window).getSelection(),i={anchorNode:i.anchorNode,anchorOffset:i.anchorOffset,focusNode:i.focusNode,focusOffset:i.focusOffset}),OI&&fu(OI,i)||(OI=i,i=lA(f0,"onSelect"),0Xg||(n.current=Z0[Xg],Z0[Xg]=null,Xg--)}function gn(n,e){Xg++,Z0[Xg]=n.current,n.current=e}var pa={},Wi=Ba(pa),is=Ba(!1),vl=pa;function cc(n,e){var t=n.type.contextTypes;if(!t)return pa;var i=n.stateNode;if(i&&i.__reactInternalMemoizedUnmaskedChildContext===e)return i.__reactInternalMemoizedMaskedChildContext;var s={},r;for(r in t)s[r]=e[r];return i&&(n=n.stateNode,n.__reactInternalMemoizedUnmaskedChildContext=e,n.__reactInternalMemoizedMaskedChildContext=s),s}function ss(n){return n=n.childContextTypes,n!=null}function cA(){Cn(is),Cn(Wi)}function a2(n,e,t){if(Wi.current!==pa)throw Error(Ve(168));gn(Wi,e),gn(is,t)}function dR(n,e,t){var i=n.stateNode;if(e=e.childContextTypes,typeof i.getChildContext!="function")return t;i=i.getChildContext();for(var s in i)if(!(s in e))throw Error(Ve(108,dN(n)||"Unknown",s));return yn({},t,i)}function IA(n){return n=(n=n.stateNode)&&n.__reactInternalMemoizedMergedChildContext||pa,vl=Wi.current,gn(Wi,n),gn(is,is.current),!0}function l2(n,e,t){var i=n.stateNode;if(!i)throw Error(Ve(169));t?(n=dR(n,e,vl),i.__reactInternalMemoizedMergedChildContext=n,Cn(is),Cn(Wi),gn(Wi,n)):Cn(is),gn(is,t)}var co=null,KA=!1,Df=!1;function hR(n){co===null?co=[n]:co.push(n)}function V3(n){KA=!0,hR(n)}function Za(){if(!Df&&co!==null){Df=!0;var n=0,e=tn;try{var t=co;for(tn=1;n>=o,s-=o,Co=1<<32-dr(e)+s|t<M?(Z=R,R=null):Z=R.sibling;var V=d(A,R,m[M],B);if(V===null){R===null&&(R=Z);break}n&&R&&V.alternate===null&&e(A,R),b=r(V,b,M),x===null?S=V:x.sibling=V,x=V,R=Z}if(M===m.length)return t(A,R),hn&&Qa(A,M),S;if(R===null){for(;MM?(Z=R,R=null):Z=R.sibling;var N=d(A,R,V.value,B);if(N===null){R===null&&(R=Z);break}n&&R&&N.alternate===null&&e(A,R),b=r(N,b,M),x===null?S=N:x.sibling=N,x=N,R=Z}if(V.done)return t(A,R),hn&&Qa(A,M),S;if(R===null){for(;!V.done;M++,V=m.next())V=C(A,V.value,B),V!==null&&(b=r(V,b,M),x===null?S=V:x.sibling=V,x=V);return hn&&Qa(A,M),S}for(R=i(A,R);!V.done;M++,V=m.next())V=h(R,A,M,V.value,B),V!==null&&(n&&V.alternate!==null&&R.delete(V.key===null?M:V.key),b=r(V,b,M),x===null?S=V:x.sibling=V,x=V);return n&&R.forEach(function(P){return e(A,P)}),hn&&Qa(A,M),S}function y(A,b,m,B){if(typeof m=="object"&&m!==null&&m.type===Wg&&m.key===null&&(m=m.props.children),typeof m=="object"&&m!==null){switch(m.$$typeof){case Ad:e:{for(var S=m.key,x=b;x!==null;){if(x.key===S){if(S=m.type,S===Wg){if(x.tag===7){t(A,x.sibling),b=s(x,m.props.children),b.return=A,A=b;break e}}else if(x.elementType===S||typeof S=="object"&&S!==null&&S.$$typeof===jo&&h2(S)===x.type){t(A,x.sibling),b=s(x,m.props),b.ref=gI(A,x,m),b.return=A,A=b;break e}t(A,x);break}else e(A,x);x=x.sibling}m.type===Wg?(b=hl(m.props.children,A.mode,B,m.key),b.return=A,A=b):(B=kh(m.type,m.key,m.props,null,A.mode,B),B.ref=gI(A,b,m),B.return=A,A=B)}return o(A);case Rg:e:{for(x=m.key;b!==null;){if(b.key===x)if(b.tag===4&&b.stateNode.containerInfo===m.containerInfo&&b.stateNode.implementation===m.implementation){t(A,b.sibling),b=s(b,m.children||[]),b.return=A,A=b;break e}else{t(A,b);break}else e(A,b);b=b.sibling}b=qf(m,A.mode,B),b.return=A,A=b}return o(A);case jo:return x=m._init,y(A,b,x(m._payload),B)}if(YI(m))return f(A,b,m,B);if(sI(m))return v(A,b,m,B);Sd(A,m)}return typeof m=="string"&&m!==""||typeof m=="number"?(m=""+m,b!==null&&b.tag===6?(t(A,b.sibling),b=s(b,m),b.return=A,A=b):(t(A,b),b=jf(m,A.mode,B),b.return=A,A=b),o(A)):t(A,b)}return y}var uc=GR(!0),BR=GR(!1),eC={},Kr=Ba(eC),yu=Ba(eC),Gu=Ba(eC);function al(n){if(n===eC)throw Error(Ve(174));return n}function mv(n,e){switch(gn(Gu,e),gn(yu,n),gn(Kr,eC),n=e.nodeType,n){case 9:case 11:e=(e=e.documentElement)?e.namespaceURI:l0(null,"");break;default:n=n===8?e.parentNode:e,e=n.namespaceURI||null,n=n.tagName,e=l0(e,n)}Cn(Kr),gn(Kr,e)}function Cc(){Cn(Kr),Cn(yu),Cn(Gu)}function ZR(n){al(Gu.current);var e=al(Kr.current),t=l0(e,n.type);e!==t&&(gn(yu,n),gn(Kr,t))}function bv(n){yu.current===n&&(Cn(Kr),Cn(yu))}var fn=Ba(0);function pA(n){for(var e=n;e!==null;){if(e.tag===13){var t=e.memoizedState;if(t!==null&&(t=t.dehydrated,t===null||t.data==="$?"||t.data==="$!"))return e}else if(e.tag===19&&e.memoizedProps.revealOrder!==void 0){if(e.flags&128)return e}else if(e.child!==null){e.child.return=e,e=e.child;continue}if(e===n)break;for(;e.sibling===null;){if(e.return===null||e.return===n)return null;e=e.return}e.sibling.return=e.return,e=e.sibling}return null}var Uf=[];function vv(){for(var n=0;nt?t:4,n(!0);var i=Pf.transition;Pf.transition={};try{n(!1),e()}finally{tn=t,Pf.transition=i}}function ER(){return Us().memoizedState}function X3(n,e,t){var i=Ia(n);if(t={lane:i,action:t,hasEagerState:!1,eagerState:null,next:null},TR(n))kR(e,t);else if(t=mR(n,e,t,i),t!==null){var s=zi();hr(t,n,i,s),DR(t,e,i)}}function F3(n,e,t){var i=Ia(n),s={lane:i,action:t,hasEagerState:!1,eagerState:null,next:null};if(TR(n))kR(e,s);else{var r=n.alternate;if(n.lanes===0&&(r===null||r.lanes===0)&&(r=e.lastRenderedReducer,r!==null))try{var o=e.lastRenderedState,a=r(o,t);if(s.hasEagerState=!0,s.eagerState=a,pr(a,o)){var l=e.interleaved;l===null?(s.next=s,pv(e)):(s.next=l.next,l.next=s),e.interleaved=s;return}}catch{}finally{}t=mR(n,e,s,i),t!==null&&(s=zi(),hr(t,n,i,s),DR(t,e,i))}}function TR(n){var e=n.alternate;return n===vn||e!==null&&e===vn}function kR(n,e){QI=fA=!0;var t=n.pending;t===null?e.next=e:(e.next=t.next,t.next=e),n.pending=e}function DR(n,e,t){if(t&4194240){var i=e.lanes;i&=n.pendingLanes,t|=i,e.lanes=t,iv(n,t)}}var mA={readContext:Ds,useCallback:Gi,useContext:Gi,useEffect:Gi,useImperativeHandle:Gi,useInsertionEffect:Gi,useLayoutEffect:Gi,useMemo:Gi,useReducer:Gi,useRef:Gi,useState:Gi,useDebugValue:Gi,useDeferredValue:Gi,useTransition:Gi,useMutableSource:Gi,useSyncExternalStore:Gi,useId:Gi,unstable_isNewReconciler:!1},Y3={readContext:Ds,useCallback:function(n,e){return Xr().memoizedState=[n,e===void 0?null:e],n},useContext:Ds,useEffect:p2,useImperativeHandle:function(n,e,t){return t=t!=null?t.concat([n]):null,zh(4194308,4,FR.bind(null,e,n),t)},useLayoutEffect:function(n,e){return zh(4194308,4,n,e)},useInsertionEffect:function(n,e){return zh(4,2,n,e)},useMemo:function(n,e){var t=Xr();return e=e===void 0?null:e,n=n(),t.memoizedState=[n,e],n},useReducer:function(n,e,t){var i=Xr();return e=t!==void 0?t(e):e,i.memoizedState=i.baseState=e,n={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:n,lastRenderedState:e},i.queue=n,n=n.dispatch=X3.bind(null,vn,n),[i.memoizedState,n]},useRef:function(n){var e=Xr();return n={current:n},e.memoizedState=n},useState:A2,useDebugValue:wv,useDeferredValue:function(n){return Xr().memoizedState=n},useTransition:function(){var n=A2(!1),e=n[0];return n=H3.bind(null,n[1]),Xr().memoizedState=n,[e,n]},useMutableSource:function(){},useSyncExternalStore:function(n,e,t){var i=vn,s=Xr();if(hn){if(t===void 0)throw Error(Ve(407));t=t()}else{if(t=e(),oi===null)throw Error(Ve(349));Gl&30||xR(i,e,t)}s.memoizedState=t;var r={value:t,getSnapshot:e};return s.queue=r,p2(WR.bind(null,i,r,n),[n]),i.flags|=2048,wu(9,RR.bind(null,i,r,t,e),void 0,null),t},useId:function(){var n=Xr(),e=oi.identifierPrefix;if(hn){var t=ho,i=Co;t=(i&~(1<<32-dr(i)-1)).toString(32)+t,e=":"+e+"R"+t,t=Bu++,0<\/script>",n=n.removeChild(n.firstChild)):typeof i.is=="string"?n=o.createElement(t,{is:i.is}):(n=o.createElement(t),t==="select"&&(o=n,i.multiple?o.multiple=!0:i.size&&(o.size=i.size))):n=o.createElementNS(n,t),n[Fr]=e,n[bu]=i,$R(n,e,!1,!1),e.stateNode=n;e:{switch(o=c0(t,i),t){case"dialog":In("cancel",n),In("close",n),s=i;break;case"iframe":case"object":case"embed":In("load",n),s=i;break;case"video":case"audio":for(s=0;shc&&(e.flags|=128,i=!0,gI(r,!1),e.lanes=4194304)}else{if(!i)if(n=pA(o),n!==null){if(e.flags|=128,i=!0,t=n.updateQueue,t!==null&&(e.updateQueue=t,e.flags|=4),gI(r,!0),r.tail===null&&r.tailMode==="hidden"&&!o.alternate&&!hn)return Bi(e),null}else 2*Vn()-r.renderingStartTime>hc&&t!==1073741824&&(e.flags|=128,i=!0,gI(r,!1),e.lanes=4194304);r.isBackwards?(o.sibling=e.child,e.child=o):(t=r.last,t!==null?t.sibling=o:e.child=o,r.last=o)}return r.tail!==null?(e=r.tail,r.rendering=e,r.tail=e.sibling,r.renderingStartTime=Vn(),e.sibling=null,t=fn.current,gn(fn,i?t&1|2:t&1),e):(Bi(e),null);case 22:case 23:return Mv(),i=e.memoizedState!==null,n!==null&&n.memoizedState!==null!==i&&(e.flags|=8192),i&&e.mode&1?hs&1073741824&&(Bi(e),e.subtreeFlags&6&&(e.flags|=8192)):Bi(e),null;case 24:return null;case 25:return null}throw Error(Ve(156,e.tag))}function U3(n,e){switch(uv(e),e.tag){case 1:return ss(e.type)&&cA(),n=e.flags,n&65536?(e.flags=n&-65537|128,e):null;case 3:return Cc(),Cn(is),Cn(Wi),vv(),n=e.flags,n&65536&&!(n&128)?(e.flags=n&-65537|128,e):null;case 5:return bv(e),null;case 13:if(Cn(fn),n=e.memoizedState,n!==null&&n.dehydrated!==null){if(e.alternate===null)throw Error(Ve(340));Ic()}return n=e.flags,n&65536?(e.flags=n&-65537|128,e):null;case 19:return Cn(fn),null;case 4:return Cc(),null;case 10:return Av(e.type._context),null;case 22:case 23:return Mv(),null;case 24:return null;default:return null}}var Rd=!1,Ri=!1,P3=typeof WeakSet=="function"?WeakSet:Set,Oe=null;function zg(n,e){var t=n.ref;if(t!==null)if(typeof t=="function")try{t(null)}catch(i){wn(n,e,i)}else t.current=null}function Y0(n,e,t){try{t()}catch(i){wn(n,e,i)}}var w2=!1;function _3(n,e){if(b0=oA,n=rR(),cv(n)){if("selectionStart"in n)var t={start:n.selectionStart,end:n.selectionEnd};else e:{t=(t=n.ownerDocument)&&t.defaultView||window;var i=t.getSelection&&t.getSelection();if(i&&i.rangeCount!==0){t=i.anchorNode;var s=i.anchorOffset,r=i.focusNode;i=i.focusOffset;try{t.nodeType,r.nodeType}catch{t=null;break e}var o=0,a=-1,l=-1,g=0,u=0,C=n,d=null;t:for(;;){for(var h;C!==t||s!==0&&C.nodeType!==3||(a=o+s),C!==r||i!==0&&C.nodeType!==3||(l=o+i),C.nodeType===3&&(o+=C.nodeValue.length),(h=C.firstChild)!==null;)d=C,C=h;for(;;){if(C===n)break t;if(d===t&&++g===s&&(a=o),d===r&&++u===i&&(l=o),(h=C.nextSibling)!==null)break;C=d,d=C.parentNode}C=h}t=a===-1||l===-1?null:{start:a,end:l}}else t=null}t=t||{start:0,end:0}}else t=null;for(v0={focusedElem:n,selectionRange:t},oA=!1,Oe=e;Oe!==null;)if(e=Oe,n=e.child,(e.subtreeFlags&1028)!==0&&n!==null)n.return=e,Oe=n;else for(;Oe!==null;){e=Oe;try{var f=e.alternate;if(e.flags&1024)switch(e.tag){case 0:case 11:case 15:break;case 1:if(f!==null){var v=f.memoizedProps,y=f.memoizedState,A=e.stateNode,b=A.getSnapshotBeforeUpdate(e.elementType===e.type?v:lr(e.type,v),y);A.__reactInternalSnapshotBeforeUpdate=b}break;case 3:var m=e.stateNode.containerInfo;m.nodeType===1?m.textContent="":m.nodeType===9&&m.documentElement&&m.removeChild(m.documentElement);break;case 5:case 6:case 4:case 17:break;default:throw Error(Ve(163))}}catch(B){wn(e,e.return,B)}if(n=e.sibling,n!==null){n.return=e.return,Oe=n;break}Oe=e.return}return f=w2,w2=!1,f}function QI(n,e,t){var i=e.updateQueue;if(i=i!==null?i.lastEffect:null,i!==null){var s=i=i.next;do{if((s.tag&n)===n){var r=s.destroy;s.destroy=void 0,r!==void 0&&Y0(e,t,r)}s=s.next}while(s!==i)}}function EA(n,e){if(e=e.updateQueue,e=e!==null?e.lastEffect:null,e!==null){var t=e=e.next;do{if((t.tag&n)===n){var i=t.create;t.destroy=i()}t=t.next}while(t!==e)}}function K0(n){var e=n.ref;if(e!==null){var t=n.stateNode;switch(n.tag){case 5:n=t;break;default:n=t}typeof e=="function"?e(n):e.current=n}}function n1(n){var e=n.alternate;e!==null&&(n.alternate=null,n1(e)),n.child=null,n.deletions=null,n.sibling=null,n.tag===5&&(e=n.stateNode,e!==null&&(delete e[Fr],delete e[bu],delete e[B0],delete e[R3],delete e[W3])),n.stateNode=null,n.return=null,n.dependencies=null,n.memoizedProps=null,n.memoizedState=null,n.pendingProps=null,n.stateNode=null,n.updateQueue=null}function i1(n){return n.tag===5||n.tag===3||n.tag===4}function S2(n){e:for(;;){for(;n.sibling===null;){if(n.return===null||i1(n.return))return null;n=n.return}for(n.sibling.return=n.return,n=n.sibling;n.tag!==5&&n.tag!==6&&n.tag!==18;){if(n.flags&2||n.child===null||n.tag===4)continue e;n.child.return=n,n=n.child}if(!(n.flags&2))return n.stateNode}}function z0(n,e,t){var i=n.tag;if(i===5||i===6)n=n.stateNode,e?t.nodeType===8?t.parentNode.insertBefore(n,e):t.insertBefore(n,e):(t.nodeType===8?(e=t.parentNode,e.insertBefore(n,t)):(e=t,e.appendChild(n)),t=t._reactRootContainer,t!=null||e.onclick!==null||(e.onclick=gA));else if(i!==4&&(n=n.child,n!==null))for(z0(n,e,t),n=n.sibling;n!==null;)z0(n,e,t),n=n.sibling}function L0(n,e,t){var i=n.tag;if(i===5||i===6)n=n.stateNode,e?t.insertBefore(n,e):t.appendChild(n);else if(i!==4&&(n=n.child,n!==null))for(L0(n,e,t),n=n.sibling;n!==null;)L0(n,e,t),n=n.sibling}var Ii=null,Ir=!1;function ko(n,e,t){for(t=t.child;t!==null;)s1(n,e,t),t=t.sibling}function s1(n,e,t){if(Yr&&typeof Yr.onCommitFiberUnmount=="function")try{Yr.onCommitFiberUnmount(NA,t)}catch{}switch(t.tag){case 5:Ri||zg(t,e);case 6:var i=Ii,s=Ir;Ii=null,ko(n,e,t),Ii=i,Ir=s,Ii!==null&&(Ir?(n=Ii,t=t.stateNode,n.nodeType===8?n.parentNode.removeChild(t):n.removeChild(t)):Ii.removeChild(t.stateNode));break;case 18:Ii!==null&&(Ir?(n=Ii,t=t.stateNode,n.nodeType===8?kf(n.parentNode,t):n.nodeType===1&&kf(n,t),hu(n)):kf(Ii,t.stateNode));break;case 4:i=Ii,s=Ir,Ii=t.stateNode.containerInfo,Ir=!0,ko(n,e,t),Ii=i,Ir=s;break;case 0:case 11:case 14:case 15:if(!Ri&&(i=t.updateQueue,i!==null&&(i=i.lastEffect,i!==null))){s=i=i.next;do{var r=s,o=r.destroy;r=r.tag,o!==void 0&&(r&2||r&4)&&Y0(t,e,o),s=s.next}while(s!==i)}ko(n,e,t);break;case 1:if(!Ri&&(zg(t,e),i=t.stateNode,typeof i.componentWillUnmount=="function"))try{i.props=t.memoizedProps,i.state=t.memoizedState,i.componentWillUnmount()}catch(a){wn(t,e,a)}ko(n,e,t);break;case 21:ko(n,e,t);break;case 22:t.mode&1?(Ri=(i=Ri)||t.memoizedState!==null,ko(n,e,t),Ri=i):ko(n,e,t);break;default:ko(n,e,t)}}function x2(n){var e=n.updateQueue;if(e!==null){n.updateQueue=null;var t=n.stateNode;t===null&&(t=n.stateNode=new P3),e.forEach(function(i){var s=nH.bind(null,n,i);t.has(i)||(t.add(i),i.then(s,s))})}}function tr(n,e){var t=e.deletions;if(t!==null)for(var i=0;is&&(s=o),i&=~r}if(i=s,i=Vn()-i,i=(120>i?120:480>i?480:1080>i?1080:1920>i?1920:3e3>i?3e3:4320>i?4320:1960*O3(i/1960))-i,10n?16:n,ia===null)var i=!1;else{if(n=ia,ia=null,yA=0,Tt&6)throw Error(Ve(331));var s=Tt;for(Tt|=4,Oe=n.current;Oe!==null;){var r=Oe,o=r.child;if(Oe.flags&16){var a=r.deletions;if(a!==null){for(var l=0;lVn()-Wv?dl(n,0):Rv|=t),rs(n,e)}function u1(n,e){e===0&&(n.mode&1?(e=bd,bd<<=1,!(bd&130023424)&&(bd=4194304)):e=1);var t=zi();n=Bo(n,e),n!==null&&(Qu(n,e,t),rs(n,t))}function tH(n){var e=n.memoizedState,t=0;e!==null&&(t=e.retryLane),u1(n,t)}function nH(n,e){var t=0;switch(n.tag){case 13:var i=n.stateNode,s=n.memoizedState;s!==null&&(t=s.retryLane);break;case 19:i=n.stateNode;break;default:throw Error(Ve(314))}i!==null&&i.delete(e),u1(n,t)}var C1;C1=function(n,e,t){if(n!==null)if(n.memoizedProps!==e.pendingProps||is.current)ns=!0;else{if(!(n.lanes&t)&&!(e.flags&128))return ns=!1,k3(n,e,t);ns=!!(n.flags&131072)}else ns=!1,hn&&e.flags&1048576&&AR(e,CA,e.index);switch(e.lanes=0,e.tag){case 2:var i=e.type;Lh(n,e),n=e.pendingProps;var s=cc(e,Wi.current);tc(e,t),s=Gv(null,e,i,n,s,t);var r=Bv();return e.flags|=1,typeof s=="object"&&s!==null&&typeof s.render=="function"&&s.$$typeof===void 0?(e.tag=1,e.memoizedState=null,e.updateQueue=null,ss(i)?(r=!0,IA(e)):r=!1,e.memoizedState=s.state!==null&&s.state!==void 0?s.state:null,fv(e),s.updater=zA,e.stateNode=s,s._reactInternals=e,W0(e,i,n,t),e=N0(null,e,i,!0,r,t)):(e.tag=0,hn&&r&&Iv(e),Xi(null,e,s,t),e=e.child),e;case 16:i=e.elementType;e:{switch(Lh(n,e),n=e.pendingProps,s=i._init,i=s(i._payload),e.type=i,s=e.tag=sH(i),n=lr(i,n),s){case 0:e=M0(null,e,i,n,t);break e;case 1:e=G2(null,e,i,n,t);break e;case 11:e=v2(null,e,i,n,t);break e;case 14:e=y2(null,e,i,lr(i.type,n),t);break e}throw Error(Ve(306,i,""))}return e;case 0:return i=e.type,s=e.pendingProps,s=e.elementType===i?s:lr(i,s),M0(n,e,i,s,t);case 1:return i=e.type,s=e.pendingProps,s=e.elementType===i?s:lr(i,s),G2(n,e,i,s,t);case 3:e:{if(QR(e),n===null)throw Error(Ve(387));i=e.pendingProps,r=e.memoizedState,s=r.element,bR(n,e),AA(e,i,null,t);var o=e.memoizedState;if(i=o.element,r.isDehydrated)if(r={element:i,isDehydrated:!1,cache:o.cache,pendingSuspenseBoundaries:o.pendingSuspenseBoundaries,transitions:o.transitions},e.updateQueue.baseState=r,e.memoizedState=r,e.flags&256){s=dc(Error(Ve(423)),e),e=B2(n,e,i,t,s);break e}else if(i!==s){s=dc(Error(Ve(424)),e),e=B2(n,e,i,t,s);break e}else for(ps=la(e.stateNode.containerInfo.firstChild),ms=e,hn=!0,ur=null,t=BR(e,null,i,t),e.child=t;t;)t.flags=t.flags&-3|4096,t=t.sibling;else{if(Ic(),i===s){e=Zo(n,e,t);break e}Xi(n,e,i,t)}e=e.child}return e;case 5:return ZR(e),n===null&&S0(e),i=e.type,s=e.pendingProps,r=n!==null?n.memoizedProps:null,o=s.children,y0(i,s)?o=null:r!==null&&y0(i,r)&&(e.flags|=32),OR(n,e),Xi(n,e,o,t),e.child;case 6:return n===null&&S0(e),null;case 13:return jR(n,e,t);case 4:return mv(e,e.stateNode.containerInfo),i=e.pendingProps,n===null?e.child=uc(e,null,i,t):Xi(n,e,i,t),e.child;case 11:return i=e.type,s=e.pendingProps,s=e.elementType===i?s:lr(i,s),v2(n,e,i,s,t);case 7:return Xi(n,e,e.pendingProps,t),e.child;case 8:return Xi(n,e,e.pendingProps.children,t),e.child;case 12:return Xi(n,e,e.pendingProps.children,t),e.child;case 10:e:{if(i=e.type._context,s=e.pendingProps,r=e.memoizedProps,o=s.value,gn(dA,i._currentValue),i._currentValue=o,r!==null)if(pr(r.value,o)){if(r.children===s.children&&!is.current){e=Zo(n,e,t);break e}}else for(r=e.child,r!==null&&(r.return=e);r!==null;){var a=r.dependencies;if(a!==null){o=r.child;for(var l=a.firstContext;l!==null;){if(l.context===i){if(r.tag===1){l=mo(-1,t&-t),l.tag=2;var g=r.updateQueue;if(g!==null){g=g.shared;var u=g.pending;u===null?l.next=l:(l.next=u.next,u.next=l),g.pending=l}}r.lanes|=t,l=r.alternate,l!==null&&(l.lanes|=t),x0(r.return,t,e),a.lanes|=t;break}l=l.next}}else if(r.tag===10)o=r.type===e.type?null:r.child;else if(r.tag===18){if(o=r.return,o===null)throw Error(Ve(341));o.lanes|=t,a=o.alternate,a!==null&&(a.lanes|=t),x0(o,t,e),o=r.sibling}else o=r.child;if(o!==null)o.return=r;else for(o=r;o!==null;){if(o===e){o=null;break}if(r=o.sibling,r!==null){r.return=o.return,o=r;break}o=o.return}r=o}Xi(n,e,s.children,t),e=e.child}return e;case 9:return s=e.type,i=e.pendingProps.children,tc(e,t),s=Ds(s),i=i(s),e.flags|=1,Xi(n,e,i,t),e.child;case 14:return i=e.type,s=lr(i,e.pendingProps),s=lr(i.type,s),y2(n,e,i,s,t);case 15:return _R(n,e,e.type,e.pendingProps,t);case 17:return i=e.type,s=e.pendingProps,s=e.elementType===i?s:lr(i,s),Lh(n,e),e.tag=1,ss(i)?(n=!0,IA(e)):n=!1,tc(e,t),yR(e,i,s),W0(e,i,s,t),N0(null,e,i,!0,n,t);case 19:return qR(n,e,t);case 22:return JR(n,e,t)}throw Error(Ve(156,e.tag))};function d1(n,e){return Lx(n,e)}function iH(n,e,t,i){this.tag=n,this.key=t,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.ref=null,this.pendingProps=e,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=i,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function Es(n,e,t,i){return new iH(n,e,t,i)}function Hv(n){return n=n.prototype,!(!n||!n.isReactComponent)}function sH(n){if(typeof n=="function")return Hv(n)?1:0;if(n!=null){if(n=n.$$typeof,n===$b)return 11;if(n===ev)return 14}return 2}function ua(n,e){var t=n.alternate;return t===null?(t=Es(n.tag,e,n.key,n.mode),t.elementType=n.elementType,t.type=n.type,t.stateNode=n.stateNode,t.alternate=n,n.alternate=t):(t.pendingProps=e,t.type=n.type,t.flags=0,t.subtreeFlags=0,t.deletions=null),t.flags=n.flags&14680064,t.childLanes=n.childLanes,t.lanes=n.lanes,t.child=n.child,t.memoizedProps=n.memoizedProps,t.memoizedState=n.memoizedState,t.updateQueue=n.updateQueue,e=n.dependencies,t.dependencies=e===null?null:{lanes:e.lanes,firstContext:e.firstContext},t.sibling=n.sibling,t.index=n.index,t.ref=n.ref,t}function kh(n,e,t,i,s,r){var o=2;if(i=n,typeof n=="function")Hv(n)&&(o=1);else if(typeof n=="string")o=5;else e:switch(n){case Wg:return hl(t.children,s,r,e);case qb:o=8,s|=8;break;case e0:return n=Es(12,t,e,s|2),n.elementType=e0,n.lanes=r,n;case t0:return n=Es(13,t,e,s),n.elementType=t0,n.lanes=r,n;case n0:return n=Es(19,t,e,s),n.elementType=n0,n.lanes=r,n;case Gx:return kA(t,s,r,e);default:if(typeof n=="object"&&n!==null)switch(n.$$typeof){case vx:o=10;break e;case yx:o=9;break e;case $b:o=11;break e;case ev:o=14;break e;case jo:o=16,i=null;break e}throw Error(Ve(130,n==null?n:typeof n,""))}return e=Es(o,t,e,s),e.elementType=n,e.type=i,e.lanes=r,e}function hl(n,e,t,i){return n=Es(7,n,i,e),n.lanes=t,n}function kA(n,e,t,i){return n=Es(22,n,i,e),n.elementType=Gx,n.lanes=t,n.stateNode={isHidden:!1},n}function jf(n,e,t){return n=Es(6,n,null,e),n.lanes=t,n}function qf(n,e,t){return e=Es(4,n.children!==null?n.children:[],n.key,e),e.lanes=t,e.stateNode={containerInfo:n.containerInfo,pendingChildren:null,implementation:n.implementation},e}function rH(n,e,t,i,s){this.tag=e,this.containerInfo=n,this.finishedWork=this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.pendingContext=this.context=null,this.callbackPriority=0,this.eventTimes=Mf(0),this.expirationTimes=Mf(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=Mf(0),this.identifierPrefix=i,this.onRecoverableError=s,this.mutableSourceEagerHydrationData=null}function Xv(n,e,t,i,s,r,o,a,l){return n=new rH(n,e,t,a,l),e===1?(e=1,r===!0&&(e|=8)):e=0,r=Es(3,null,null,e),n.current=r,r.stateNode=n,r.memoizedState={element:i,isDehydrated:t,cache:null,transitions:null,pendingSuspenseBoundaries:null},fv(r),n}function oH(n,e,t){var i=3"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(f1)}catch(n){console.error(n)}}f1(),Ax.exports=Bs;var IH=Ax.exports,F2=IH;qm.createRoot=F2.createRoot,qm.hydrateRoot=F2.hydrateRoot;var m1={color:void 0,size:void 0,className:void 0,style:void 0,attr:void 0},Y2=Ki.createContext&&Ki.createContext(m1),Ca=globalThis&&globalThis.__assign||function(){return Ca=Object.assign||function(n){for(var e,t=1,i=arguments.length;t{}});/** +`+r.stack}return{value:n,source:e,stack:s,digest:null}}function Of(n,e,t){return{value:n,source:null,stack:t??null,digest:e??null}}function V0(n,e){try{console.error(e.value)}catch(t){setTimeout(function(){throw t})}}var L3=typeof WeakMap=="function"?WeakMap:Map;function UR(n,e,t){t=mo(-1,t),t.tag=3,t.payload={element:null};var i=e.value;return t.callback=function(){vA||(vA=!0,E0=i),V0(n,e)},t}function PR(n,e,t){t=mo(-1,t),t.tag=3;var i=n.type.getDerivedStateFromError;if(typeof i=="function"){var s=e.value;t.payload=function(){return i(s)},t.callback=function(){V0(n,e)}}var r=n.stateNode;return r!==null&&typeof r.componentDidCatch=="function"&&(t.callback=function(){V0(n,e),typeof i!="function"&&(ca===null?ca=new Set([this]):ca.add(this));var o=e.stack;this.componentDidCatch(e.value,{componentStack:o!==null?o:""})}),t}function f2(n,e,t){var i=n.pingCache;if(i===null){i=n.pingCache=new L3;var s=new Set;i.set(e,s)}else s=i.get(e),s===void 0&&(s=new Set,i.set(e,s));s.has(t)||(s.add(t),n=eH.bind(null,n,e,t),e.then(n,n))}function m2(n){do{var e;if((e=n.tag===13)&&(e=n.memoizedState,e=e!==null?e.dehydrated!==null:!0),e)return n;n=n.return}while(n!==null);return null}function b2(n,e,t,i,s){return n.mode&1?(n.flags|=65536,n.lanes=s,n):(n===e?n.flags|=65536:(n.flags|=128,t.flags|=131072,t.flags&=-52805,t.tag===1&&(t.alternate===null?t.tag=17:(e=mo(-1,1),e.tag=2,ga(t,e,1))),t.lanes|=1),n)}var E3=xo.ReactCurrentOwner,ns=!1;function Xi(n,e,t,i){e.child=n===null?BR(e,null,t,i):uc(e,n.child,t,i)}function v2(n,e,t,i,s){t=t.render;var r=e.ref;return tc(e,s),i=Gv(n,e,t,i,r,s),t=Bv(),n!==null&&!ns?(e.updateQueue=n.updateQueue,e.flags&=-2053,n.lanes&=~s,Zo(n,e,s)):(hn&&t&&Iv(e),e.flags|=1,Xi(n,e,i,s),e.child)}function y2(n,e,t,i,s){if(n===null){var r=t.type;return typeof r=="function"&&!Hv(r)&&r.defaultProps===void 0&&t.compare===null&&t.defaultProps===void 0?(e.tag=15,e.type=r,_R(n,e,r,i,s)):(n=kh(t.type,null,i,e,e.mode,s),n.ref=e.ref,n.return=e,e.child=n)}if(r=n.child,!(n.lanes&s)){var o=r.memoizedProps;if(t=t.compare,t=t!==null?t:fu,t(o,i)&&n.ref===e.ref)return Zo(n,e,s)}return e.flags|=1,n=ua(r,i),n.ref=e.ref,n.return=e,e.child=n}function _R(n,e,t,i,s){if(n!==null){var r=n.memoizedProps;if(fu(r,i)&&n.ref===e.ref)if(ns=!1,e.pendingProps=i=r,(n.lanes&s)!==0)n.flags&131072&&(ns=!0);else return e.lanes=n.lanes,Zo(n,e,s)}return M0(n,e,t,i,s)}function JR(n,e,t){var i=e.pendingProps,s=i.children,r=n!==null?n.memoizedState:null;if(i.mode==="hidden")if(!(e.mode&1))e.memoizedState={baseLanes:0,cachePool:null,transitions:null},gn(Lg,hs),hs|=t;else{if(!(t&1073741824))return n=r!==null?r.baseLanes|t:t,e.lanes=e.childLanes=1073741824,e.memoizedState={baseLanes:n,cachePool:null,transitions:null},e.updateQueue=null,gn(Lg,hs),hs|=n,null;e.memoizedState={baseLanes:0,cachePool:null,transitions:null},i=r!==null?r.baseLanes:t,gn(Lg,hs),hs|=i}else r!==null?(i=r.baseLanes|t,e.memoizedState=null):i=t,gn(Lg,hs),hs|=i;return Xi(n,e,s,t),e.child}function OR(n,e){var t=e.ref;(n===null&&t!==null||n!==null&&n.ref!==t)&&(e.flags|=512,e.flags|=2097152)}function M0(n,e,t,i,s){var r=ss(t)?vl:Wi.current;return r=cc(e,r),tc(e,s),t=Gv(n,e,t,i,r,s),i=Bv(),n!==null&&!ns?(e.updateQueue=n.updateQueue,e.flags&=-2053,n.lanes&=~s,Zo(n,e,s)):(hn&&i&&Iv(e),e.flags|=1,Xi(n,e,t,s),e.child)}function G2(n,e,t,i,s){if(ss(t)){var r=!0;IA(e)}else r=!1;if(tc(e,s),e.stateNode===null)Lh(n,e),yR(e,t,i),W0(e,t,i,s),i=!0;else if(n===null){var o=e.stateNode,a=e.memoizedProps;o.props=a;var l=o.context,g=t.contextType;typeof g=="object"&&g!==null?g=Ds(g):(g=ss(t)?vl:Wi.current,g=cc(e,g));var u=t.getDerivedStateFromProps,C=typeof u=="function"||typeof o.getSnapshotBeforeUpdate=="function";C||typeof o.UNSAFE_componentWillReceiveProps!="function"&&typeof o.componentWillReceiveProps!="function"||(a!==i||l!==g)&&d2(e,o,i,g),qo=!1;var d=e.memoizedState;o.state=d,AA(e,i,o,s),l=e.memoizedState,a!==i||d!==l||is.current||qo?(typeof u=="function"&&(R0(e,t,u,i),l=e.memoizedState),(a=qo||C2(e,t,a,i,d,l,g))?(C||typeof o.UNSAFE_componentWillMount!="function"&&typeof o.componentWillMount!="function"||(typeof o.componentWillMount=="function"&&o.componentWillMount(),typeof o.UNSAFE_componentWillMount=="function"&&o.UNSAFE_componentWillMount()),typeof o.componentDidMount=="function"&&(e.flags|=4194308)):(typeof o.componentDidMount=="function"&&(e.flags|=4194308),e.memoizedProps=i,e.memoizedState=l),o.props=i,o.state=l,o.context=g,i=a):(typeof o.componentDidMount=="function"&&(e.flags|=4194308),i=!1)}else{o=e.stateNode,bR(n,e),a=e.memoizedProps,g=e.type===e.elementType?a:lr(e.type,a),o.props=g,C=e.pendingProps,d=o.context,l=t.contextType,typeof l=="object"&&l!==null?l=Ds(l):(l=ss(t)?vl:Wi.current,l=cc(e,l));var h=t.getDerivedStateFromProps;(u=typeof h=="function"||typeof o.getSnapshotBeforeUpdate=="function")||typeof o.UNSAFE_componentWillReceiveProps!="function"&&typeof o.componentWillReceiveProps!="function"||(a!==C||d!==l)&&d2(e,o,i,l),qo=!1,d=e.memoizedState,o.state=d,AA(e,i,o,s);var f=e.memoizedState;a!==C||d!==f||is.current||qo?(typeof h=="function"&&(R0(e,t,h,i),f=e.memoizedState),(g=qo||C2(e,t,g,i,d,f,l)||!1)?(u||typeof o.UNSAFE_componentWillUpdate!="function"&&typeof o.componentWillUpdate!="function"||(typeof o.componentWillUpdate=="function"&&o.componentWillUpdate(i,f,l),typeof o.UNSAFE_componentWillUpdate=="function"&&o.UNSAFE_componentWillUpdate(i,f,l)),typeof o.componentDidUpdate=="function"&&(e.flags|=4),typeof o.getSnapshotBeforeUpdate=="function"&&(e.flags|=1024)):(typeof o.componentDidUpdate!="function"||a===n.memoizedProps&&d===n.memoizedState||(e.flags|=4),typeof o.getSnapshotBeforeUpdate!="function"||a===n.memoizedProps&&d===n.memoizedState||(e.flags|=1024),e.memoizedProps=i,e.memoizedState=f),o.props=i,o.state=f,o.context=l,i=g):(typeof o.componentDidUpdate!="function"||a===n.memoizedProps&&d===n.memoizedState||(e.flags|=4),typeof o.getSnapshotBeforeUpdate!="function"||a===n.memoizedProps&&d===n.memoizedState||(e.flags|=1024),i=!1)}return N0(n,e,t,i,r,s)}function N0(n,e,t,i,s,r){OR(n,e);var o=(e.flags&128)!==0;if(!i&&!o)return s&&l2(e,t,!1),Zo(n,e,r);i=e.stateNode,E3.current=e;var a=o&&typeof t.getDerivedStateFromError!="function"?null:i.render();return e.flags|=1,n!==null&&o?(e.child=uc(e,n.child,null,r),e.child=uc(e,null,a,r)):Xi(n,e,a,r),e.memoizedState=i.state,s&&l2(e,t,!0),e.child}function QR(n){var e=n.stateNode;e.pendingContext?a2(n,e.pendingContext,e.pendingContext!==e.context):e.context&&a2(n,e.context,!1),mv(n,e.containerInfo)}function B2(n,e,t,i,s){return Ic(),Cv(s),e.flags|=256,Xi(n,e,t,i),e.child}var H0={dehydrated:null,treeContext:null,retryLane:0};function X0(n){return{baseLanes:n,cachePool:null,transitions:null}}function jR(n,e,t){var i=e.pendingProps,s=fn.current,r=!1,o=(e.flags&128)!==0,a;if((a=o)||(a=n!==null&&n.memoizedState===null?!1:(s&2)!==0),a?(r=!0,e.flags&=-129):(n===null||n.memoizedState!==null)&&(s|=1),gn(fn,s&1),n===null)return S0(e),n=e.memoizedState,n!==null&&(n=n.dehydrated,n!==null)?(e.mode&1?n.data==="$!"?e.lanes=8:e.lanes=1073741824:e.lanes=1,null):(o=i.children,n=i.fallback,r?(i=e.mode,r=e.child,o={mode:"hidden",children:o},!(i&1)&&r!==null?(r.childLanes=0,r.pendingProps=o):r=kA(o,i,0,null),n=hl(n,i,t,null),r.return=e,n.return=e,r.sibling=n,e.child=r,e.child.memoizedState=X0(t),e.memoizedState=H0,n):Sv(e,o));if(s=n.memoizedState,s!==null&&(a=s.dehydrated,a!==null))return T3(n,e,o,i,a,s,t);if(r){r=i.fallback,o=e.mode,s=n.child,a=s.sibling;var l={mode:"hidden",children:i.children};return!(o&1)&&e.child!==s?(i=e.child,i.childLanes=0,i.pendingProps=l,e.deletions=null):(i=ua(s,l),i.subtreeFlags=s.subtreeFlags&14680064),a!==null?r=ua(a,r):(r=hl(r,o,t,null),r.flags|=2),r.return=e,i.return=e,i.sibling=r,e.child=i,i=r,r=e.child,o=n.child.memoizedState,o=o===null?X0(t):{baseLanes:o.baseLanes|t,cachePool:null,transitions:o.transitions},r.memoizedState=o,r.childLanes=n.childLanes&~t,e.memoizedState=H0,i}return r=n.child,n=r.sibling,i=ua(r,{mode:"visible",children:i.children}),!(e.mode&1)&&(i.lanes=t),i.return=e,i.sibling=null,n!==null&&(t=e.deletions,t===null?(e.deletions=[n],e.flags|=16):t.push(n)),e.child=i,e.memoizedState=null,i}function Sv(n,e){return e=kA({mode:"visible",children:e},n.mode,0,null),e.return=n,n.child=e}function xd(n,e,t,i){return i!==null&&Cv(i),uc(e,n.child,null,t),n=Sv(e,e.pendingProps.children),n.flags|=2,e.memoizedState=null,n}function T3(n,e,t,i,s,r,o){if(t)return e.flags&256?(e.flags&=-257,i=Of(Error(Ve(422))),xd(n,e,o,i)):e.memoizedState!==null?(e.child=n.child,e.flags|=128,null):(r=i.fallback,s=e.mode,i=kA({mode:"visible",children:i.children},s,0,null),r=hl(r,s,o,null),r.flags|=2,i.return=e,r.return=e,i.sibling=r,e.child=i,e.mode&1&&uc(e,n.child,null,o),e.child.memoizedState=X0(o),e.memoizedState=H0,r);if(!(e.mode&1))return xd(n,e,o,null);if(s.data==="$!"){if(i=s.nextSibling&&s.nextSibling.dataset,i)var a=i.dgst;return i=a,r=Error(Ve(419)),i=Of(r,i,void 0),xd(n,e,o,i)}if(a=(o&n.childLanes)!==0,ns||a){if(i=oi,i!==null){switch(o&-o){case 4:s=2;break;case 16:s=8;break;case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:s=32;break;case 536870912:s=268435456;break;default:s=0}s=s&(i.suspendedLanes|o)?0:s,s!==0&&s!==r.retryLane&&(r.retryLane=s,Bo(n,s),hr(i,n,s,-1))}return Nv(),i=Of(Error(Ve(421))),xd(n,e,o,i)}return s.data==="$?"?(e.flags|=128,e.child=n.child,e=tH.bind(null,n),s._reactRetry=e,null):(n=r.treeContext,ps=la(s.nextSibling),ms=e,hn=!0,ur=null,n!==null&&(zs[Ls++]=Co,zs[Ls++]=ho,zs[Ls++]=yl,Co=n.id,ho=n.overflow,yl=e),e=Sv(e,i.children),e.flags|=4096,e)}function Z2(n,e,t){n.lanes|=e;var i=n.alternate;i!==null&&(i.lanes|=e),x0(n.return,e,t)}function Qf(n,e,t,i,s){var r=n.memoizedState;r===null?n.memoizedState={isBackwards:e,rendering:null,renderingStartTime:0,last:i,tail:t,tailMode:s}:(r.isBackwards=e,r.rendering=null,r.renderingStartTime=0,r.last=i,r.tail=t,r.tailMode=s)}function qR(n,e,t){var i=e.pendingProps,s=i.revealOrder,r=i.tail;if(Xi(n,e,i.children,t),i=fn.current,i&2)i=i&1|2,e.flags|=128;else{if(n!==null&&n.flags&128)e:for(n=e.child;n!==null;){if(n.tag===13)n.memoizedState!==null&&Z2(n,t,e);else if(n.tag===19)Z2(n,t,e);else if(n.child!==null){n.child.return=n,n=n.child;continue}if(n===e)break e;for(;n.sibling===null;){if(n.return===null||n.return===e)break e;n=n.return}n.sibling.return=n.return,n=n.sibling}i&=1}if(gn(fn,i),!(e.mode&1))e.memoizedState=null;else switch(s){case"forwards":for(t=e.child,s=null;t!==null;)n=t.alternate,n!==null&&pA(n)===null&&(s=t),t=t.sibling;t=s,t===null?(s=e.child,e.child=null):(s=t.sibling,t.sibling=null),Qf(e,!1,s,t,r);break;case"backwards":for(t=null,s=e.child,e.child=null;s!==null;){if(n=s.alternate,n!==null&&pA(n)===null){e.child=s;break}n=s.sibling,s.sibling=t,t=s,s=n}Qf(e,!0,t,null,r);break;case"together":Qf(e,!1,null,null,void 0);break;default:e.memoizedState=null}return e.child}function Lh(n,e){!(e.mode&1)&&n!==null&&(n.alternate=null,e.alternate=null,e.flags|=2)}function Zo(n,e,t){if(n!==null&&(e.dependencies=n.dependencies),Bl|=e.lanes,!(t&e.childLanes))return null;if(n!==null&&e.child!==n.child)throw Error(Ve(153));if(e.child!==null){for(n=e.child,t=ua(n,n.pendingProps),e.child=t,t.return=e;n.sibling!==null;)n=n.sibling,t=t.sibling=ua(n,n.pendingProps),t.return=e;t.sibling=null}return e.child}function k3(n,e,t){switch(e.tag){case 3:QR(e),Ic();break;case 5:ZR(e);break;case 1:ss(e.type)&&IA(e);break;case 4:mv(e,e.stateNode.containerInfo);break;case 10:var i=e.type._context,s=e.memoizedProps.value;gn(dA,i._currentValue),i._currentValue=s;break;case 13:if(i=e.memoizedState,i!==null)return i.dehydrated!==null?(gn(fn,fn.current&1),e.flags|=128,null):t&e.child.childLanes?jR(n,e,t):(gn(fn,fn.current&1),n=Zo(n,e,t),n!==null?n.sibling:null);gn(fn,fn.current&1);break;case 19:if(i=(t&e.childLanes)!==0,n.flags&128){if(i)return qR(n,e,t);e.flags|=128}if(s=e.memoizedState,s!==null&&(s.rendering=null,s.tail=null,s.lastEffect=null),gn(fn,fn.current),i)break;return null;case 22:case 23:return e.lanes=0,JR(n,e,t)}return Zo(n,e,t)}var $R,F0,e1,t1;$R=function(n,e){for(var t=e.child;t!==null;){if(t.tag===5||t.tag===6)n.appendChild(t.stateNode);else if(t.tag!==4&&t.child!==null){t.child.return=t,t=t.child;continue}if(t===e)break;for(;t.sibling===null;){if(t.return===null||t.return===e)return;t=t.return}t.sibling.return=t.return,t=t.sibling}};F0=function(){};e1=function(n,e,t,i){var s=n.memoizedProps;if(s!==i){n=e.stateNode,al(Kr.current);var r=null;switch(t){case"input":s=s0(n,s),i=s0(n,i),r=[];break;case"select":s=yn({},s,{value:void 0}),i=yn({},i,{value:void 0}),r=[];break;case"textarea":s=a0(n,s),i=a0(n,i),r=[];break;default:typeof s.onClick!="function"&&typeof i.onClick=="function"&&(n.onclick=gA)}g0(t,i);var o;t=null;for(g in s)if(!i.hasOwnProperty(g)&&s.hasOwnProperty(g)&&s[g]!=null)if(g==="style"){var a=s[g];for(o in a)a.hasOwnProperty(o)&&(t||(t={}),t[o]="")}else g!=="dangerouslySetInnerHTML"&&g!=="children"&&g!=="suppressContentEditableWarning"&&g!=="suppressHydrationWarning"&&g!=="autoFocus"&&(Iu.hasOwnProperty(g)?r||(r=[]):(r=r||[]).push(g,null));for(g in i){var l=i[g];if(a=s?.[g],i.hasOwnProperty(g)&&l!==a&&(l!=null||a!=null))if(g==="style")if(a){for(o in a)!a.hasOwnProperty(o)||l&&l.hasOwnProperty(o)||(t||(t={}),t[o]="");for(o in l)l.hasOwnProperty(o)&&a[o]!==l[o]&&(t||(t={}),t[o]=l[o])}else t||(r||(r=[]),r.push(g,t)),t=l;else g==="dangerouslySetInnerHTML"?(l=l?l.__html:void 0,a=a?a.__html:void 0,l!=null&&a!==l&&(r=r||[]).push(g,l)):g==="children"?typeof l!="string"&&typeof l!="number"||(r=r||[]).push(g,""+l):g!=="suppressContentEditableWarning"&&g!=="suppressHydrationWarning"&&(Iu.hasOwnProperty(g)?(l!=null&&g==="onScroll"&&In("scroll",n),r||a===l||(r=[])):(r=r||[]).push(g,l))}t&&(r=r||[]).push("style",t);var g=r;(e.updateQueue=g)&&(e.flags|=4)}};t1=function(n,e,t,i){t!==i&&(e.flags|=4)};function cI(n,e){if(!hn)switch(n.tailMode){case"hidden":e=n.tail;for(var t=null;e!==null;)e.alternate!==null&&(t=e),e=e.sibling;t===null?n.tail=null:t.sibling=null;break;case"collapsed":t=n.tail;for(var i=null;t!==null;)t.alternate!==null&&(i=t),t=t.sibling;i===null?e||n.tail===null?n.tail=null:n.tail.sibling=null:i.sibling=null}}function Bi(n){var e=n.alternate!==null&&n.alternate.child===n.child,t=0,i=0;if(e)for(var s=n.child;s!==null;)t|=s.lanes|s.childLanes,i|=s.subtreeFlags&14680064,i|=s.flags&14680064,s.return=n,s=s.sibling;else for(s=n.child;s!==null;)t|=s.lanes|s.childLanes,i|=s.subtreeFlags,i|=s.flags,s.return=n,s=s.sibling;return n.subtreeFlags|=i,n.childLanes=t,e}function D3(n,e,t){var i=e.pendingProps;switch(uv(e),e.tag){case 2:case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return Bi(e),null;case 1:return ss(e.type)&&cA(),Bi(e),null;case 3:return i=e.stateNode,Cc(),Cn(is),Cn(Wi),vv(),i.pendingContext&&(i.context=i.pendingContext,i.pendingContext=null),(n===null||n.child===null)&&(wd(e)?e.flags|=4:n===null||n.memoizedState.isDehydrated&&!(e.flags&256)||(e.flags|=1024,ur!==null&&(D0(ur),ur=null))),F0(n,e),Bi(e),null;case 5:bv(e);var s=al(Gu.current);if(t=e.type,n!==null&&e.stateNode!=null)e1(n,e,t,i,s),n.ref!==e.ref&&(e.flags|=512,e.flags|=2097152);else{if(!i){if(e.stateNode===null)throw Error(Ve(166));return Bi(e),null}if(n=al(Kr.current),wd(e)){i=e.stateNode,t=e.type;var r=e.memoizedProps;switch(i[Fr]=e,i[vu]=r,n=(e.mode&1)!==0,t){case"dialog":In("cancel",i),In("close",i);break;case"iframe":case"object":case"embed":In("load",i);break;case"video":case"audio":for(s=0;s<\/script>",n=n.removeChild(n.firstChild)):typeof i.is=="string"?n=o.createElement(t,{is:i.is}):(n=o.createElement(t),t==="select"&&(o=n,i.multiple?o.multiple=!0:i.size&&(o.size=i.size))):n=o.createElementNS(n,t),n[Fr]=e,n[vu]=i,$R(n,e,!1,!1),e.stateNode=n;e:{switch(o=c0(t,i),t){case"dialog":In("cancel",n),In("close",n),s=i;break;case"iframe":case"object":case"embed":In("load",n),s=i;break;case"video":case"audio":for(s=0;shc&&(e.flags|=128,i=!0,cI(r,!1),e.lanes=4194304)}else{if(!i)if(n=pA(o),n!==null){if(e.flags|=128,i=!0,t=n.updateQueue,t!==null&&(e.updateQueue=t,e.flags|=4),cI(r,!0),r.tail===null&&r.tailMode==="hidden"&&!o.alternate&&!hn)return Bi(e),null}else 2*Vn()-r.renderingStartTime>hc&&t!==1073741824&&(e.flags|=128,i=!0,cI(r,!1),e.lanes=4194304);r.isBackwards?(o.sibling=e.child,e.child=o):(t=r.last,t!==null?t.sibling=o:e.child=o,r.last=o)}return r.tail!==null?(e=r.tail,r.rendering=e,r.tail=e.sibling,r.renderingStartTime=Vn(),e.sibling=null,t=fn.current,gn(fn,i?t&1|2:t&1),e):(Bi(e),null);case 22:case 23:return Mv(),i=e.memoizedState!==null,n!==null&&n.memoizedState!==null!==i&&(e.flags|=8192),i&&e.mode&1?hs&1073741824&&(Bi(e),e.subtreeFlags&6&&(e.flags|=8192)):Bi(e),null;case 24:return null;case 25:return null}throw Error(Ve(156,e.tag))}function U3(n,e){switch(uv(e),e.tag){case 1:return ss(e.type)&&cA(),n=e.flags,n&65536?(e.flags=n&-65537|128,e):null;case 3:return Cc(),Cn(is),Cn(Wi),vv(),n=e.flags,n&65536&&!(n&128)?(e.flags=n&-65537|128,e):null;case 5:return bv(e),null;case 13:if(Cn(fn),n=e.memoizedState,n!==null&&n.dehydrated!==null){if(e.alternate===null)throw Error(Ve(340));Ic()}return n=e.flags,n&65536?(e.flags=n&-65537|128,e):null;case 19:return Cn(fn),null;case 4:return Cc(),null;case 10:return Av(e.type._context),null;case 22:case 23:return Mv(),null;case 24:return null;default:return null}}var Rd=!1,Ri=!1,P3=typeof WeakSet=="function"?WeakSet:Set,Oe=null;function zg(n,e){var t=n.ref;if(t!==null)if(typeof t=="function")try{t(null)}catch(i){wn(n,e,i)}else t.current=null}function Y0(n,e,t){try{t()}catch(i){wn(n,e,i)}}var w2=!1;function _3(n,e){if(b0=oA,n=rR(),cv(n)){if("selectionStart"in n)var t={start:n.selectionStart,end:n.selectionEnd};else e:{t=(t=n.ownerDocument)&&t.defaultView||window;var i=t.getSelection&&t.getSelection();if(i&&i.rangeCount!==0){t=i.anchorNode;var s=i.anchorOffset,r=i.focusNode;i=i.focusOffset;try{t.nodeType,r.nodeType}catch{t=null;break e}var o=0,a=-1,l=-1,g=0,u=0,C=n,d=null;t:for(;;){for(var h;C!==t||s!==0&&C.nodeType!==3||(a=o+s),C!==r||i!==0&&C.nodeType!==3||(l=o+i),C.nodeType===3&&(o+=C.nodeValue.length),(h=C.firstChild)!==null;)d=C,C=h;for(;;){if(C===n)break t;if(d===t&&++g===s&&(a=o),d===r&&++u===i&&(l=o),(h=C.nextSibling)!==null)break;C=d,d=C.parentNode}C=h}t=a===-1||l===-1?null:{start:a,end:l}}else t=null}t=t||{start:0,end:0}}else t=null;for(v0={focusedElem:n,selectionRange:t},oA=!1,Oe=e;Oe!==null;)if(e=Oe,n=e.child,(e.subtreeFlags&1028)!==0&&n!==null)n.return=e,Oe=n;else for(;Oe!==null;){e=Oe;try{var f=e.alternate;if(e.flags&1024)switch(e.tag){case 0:case 11:case 15:break;case 1:if(f!==null){var v=f.memoizedProps,y=f.memoizedState,A=e.stateNode,b=A.getSnapshotBeforeUpdate(e.elementType===e.type?v:lr(e.type,v),y);A.__reactInternalSnapshotBeforeUpdate=b}break;case 3:var m=e.stateNode.containerInfo;m.nodeType===1?m.textContent="":m.nodeType===9&&m.documentElement&&m.removeChild(m.documentElement);break;case 5:case 6:case 4:case 17:break;default:throw Error(Ve(163))}}catch(B){wn(e,e.return,B)}if(n=e.sibling,n!==null){n.return=e.return,Oe=n;break}Oe=e.return}return f=w2,w2=!1,f}function jI(n,e,t){var i=e.updateQueue;if(i=i!==null?i.lastEffect:null,i!==null){var s=i=i.next;do{if((s.tag&n)===n){var r=s.destroy;s.destroy=void 0,r!==void 0&&Y0(e,t,r)}s=s.next}while(s!==i)}}function EA(n,e){if(e=e.updateQueue,e=e!==null?e.lastEffect:null,e!==null){var t=e=e.next;do{if((t.tag&n)===n){var i=t.create;t.destroy=i()}t=t.next}while(t!==e)}}function K0(n){var e=n.ref;if(e!==null){var t=n.stateNode;switch(n.tag){case 5:n=t;break;default:n=t}typeof e=="function"?e(n):e.current=n}}function n1(n){var e=n.alternate;e!==null&&(n.alternate=null,n1(e)),n.child=null,n.deletions=null,n.sibling=null,n.tag===5&&(e=n.stateNode,e!==null&&(delete e[Fr],delete e[vu],delete e[B0],delete e[R3],delete e[W3])),n.stateNode=null,n.return=null,n.dependencies=null,n.memoizedProps=null,n.memoizedState=null,n.pendingProps=null,n.stateNode=null,n.updateQueue=null}function i1(n){return n.tag===5||n.tag===3||n.tag===4}function S2(n){e:for(;;){for(;n.sibling===null;){if(n.return===null||i1(n.return))return null;n=n.return}for(n.sibling.return=n.return,n=n.sibling;n.tag!==5&&n.tag!==6&&n.tag!==18;){if(n.flags&2||n.child===null||n.tag===4)continue e;n.child.return=n,n=n.child}if(!(n.flags&2))return n.stateNode}}function z0(n,e,t){var i=n.tag;if(i===5||i===6)n=n.stateNode,e?t.nodeType===8?t.parentNode.insertBefore(n,e):t.insertBefore(n,e):(t.nodeType===8?(e=t.parentNode,e.insertBefore(n,t)):(e=t,e.appendChild(n)),t=t._reactRootContainer,t!=null||e.onclick!==null||(e.onclick=gA));else if(i!==4&&(n=n.child,n!==null))for(z0(n,e,t),n=n.sibling;n!==null;)z0(n,e,t),n=n.sibling}function L0(n,e,t){var i=n.tag;if(i===5||i===6)n=n.stateNode,e?t.insertBefore(n,e):t.appendChild(n);else if(i!==4&&(n=n.child,n!==null))for(L0(n,e,t),n=n.sibling;n!==null;)L0(n,e,t),n=n.sibling}var Ii=null,Ir=!1;function ko(n,e,t){for(t=t.child;t!==null;)s1(n,e,t),t=t.sibling}function s1(n,e,t){if(Yr&&typeof Yr.onCommitFiberUnmount=="function")try{Yr.onCommitFiberUnmount(NA,t)}catch{}switch(t.tag){case 5:Ri||zg(t,e);case 6:var i=Ii,s=Ir;Ii=null,ko(n,e,t),Ii=i,Ir=s,Ii!==null&&(Ir?(n=Ii,t=t.stateNode,n.nodeType===8?n.parentNode.removeChild(t):n.removeChild(t)):Ii.removeChild(t.stateNode));break;case 18:Ii!==null&&(Ir?(n=Ii,t=t.stateNode,n.nodeType===8?kf(n.parentNode,t):n.nodeType===1&&kf(n,t),Au(n)):kf(Ii,t.stateNode));break;case 4:i=Ii,s=Ir,Ii=t.stateNode.containerInfo,Ir=!0,ko(n,e,t),Ii=i,Ir=s;break;case 0:case 11:case 14:case 15:if(!Ri&&(i=t.updateQueue,i!==null&&(i=i.lastEffect,i!==null))){s=i=i.next;do{var r=s,o=r.destroy;r=r.tag,o!==void 0&&(r&2||r&4)&&Y0(t,e,o),s=s.next}while(s!==i)}ko(n,e,t);break;case 1:if(!Ri&&(zg(t,e),i=t.stateNode,typeof i.componentWillUnmount=="function"))try{i.props=t.memoizedProps,i.state=t.memoizedState,i.componentWillUnmount()}catch(a){wn(t,e,a)}ko(n,e,t);break;case 21:ko(n,e,t);break;case 22:t.mode&1?(Ri=(i=Ri)||t.memoizedState!==null,ko(n,e,t),Ri=i):ko(n,e,t);break;default:ko(n,e,t)}}function x2(n){var e=n.updateQueue;if(e!==null){n.updateQueue=null;var t=n.stateNode;t===null&&(t=n.stateNode=new P3),e.forEach(function(i){var s=nH.bind(null,n,i);t.has(i)||(t.add(i),i.then(s,s))})}}function tr(n,e){var t=e.deletions;if(t!==null)for(var i=0;is&&(s=o),i&=~r}if(i=s,i=Vn()-i,i=(120>i?120:480>i?480:1080>i?1080:1920>i?1920:3e3>i?3e3:4320>i?4320:1960*O3(i/1960))-i,10n?16:n,ia===null)var i=!1;else{if(n=ia,ia=null,yA=0,Tt&6)throw Error(Ve(331));var s=Tt;for(Tt|=4,Oe=n.current;Oe!==null;){var r=Oe,o=r.child;if(Oe.flags&16){var a=r.deletions;if(a!==null){for(var l=0;lVn()-Wv?dl(n,0):Rv|=t),rs(n,e)}function u1(n,e){e===0&&(n.mode&1?(e=bd,bd<<=1,!(bd&130023424)&&(bd=4194304)):e=1);var t=zi();n=Bo(n,e),n!==null&&(ju(n,e,t),rs(n,t))}function tH(n){var e=n.memoizedState,t=0;e!==null&&(t=e.retryLane),u1(n,t)}function nH(n,e){var t=0;switch(n.tag){case 13:var i=n.stateNode,s=n.memoizedState;s!==null&&(t=s.retryLane);break;case 19:i=n.stateNode;break;default:throw Error(Ve(314))}i!==null&&i.delete(e),u1(n,t)}var C1;C1=function(n,e,t){if(n!==null)if(n.memoizedProps!==e.pendingProps||is.current)ns=!0;else{if(!(n.lanes&t)&&!(e.flags&128))return ns=!1,k3(n,e,t);ns=!!(n.flags&131072)}else ns=!1,hn&&e.flags&1048576&&AR(e,CA,e.index);switch(e.lanes=0,e.tag){case 2:var i=e.type;Lh(n,e),n=e.pendingProps;var s=cc(e,Wi.current);tc(e,t),s=Gv(null,e,i,n,s,t);var r=Bv();return e.flags|=1,typeof s=="object"&&s!==null&&typeof s.render=="function"&&s.$$typeof===void 0?(e.tag=1,e.memoizedState=null,e.updateQueue=null,ss(i)?(r=!0,IA(e)):r=!1,e.memoizedState=s.state!==null&&s.state!==void 0?s.state:null,fv(e),s.updater=zA,e.stateNode=s,s._reactInternals=e,W0(e,i,n,t),e=N0(null,e,i,!0,r,t)):(e.tag=0,hn&&r&&Iv(e),Xi(null,e,s,t),e=e.child),e;case 16:i=e.elementType;e:{switch(Lh(n,e),n=e.pendingProps,s=i._init,i=s(i._payload),e.type=i,s=e.tag=sH(i),n=lr(i,n),s){case 0:e=M0(null,e,i,n,t);break e;case 1:e=G2(null,e,i,n,t);break e;case 11:e=v2(null,e,i,n,t);break e;case 14:e=y2(null,e,i,lr(i.type,n),t);break e}throw Error(Ve(306,i,""))}return e;case 0:return i=e.type,s=e.pendingProps,s=e.elementType===i?s:lr(i,s),M0(n,e,i,s,t);case 1:return i=e.type,s=e.pendingProps,s=e.elementType===i?s:lr(i,s),G2(n,e,i,s,t);case 3:e:{if(QR(e),n===null)throw Error(Ve(387));i=e.pendingProps,r=e.memoizedState,s=r.element,bR(n,e),AA(e,i,null,t);var o=e.memoizedState;if(i=o.element,r.isDehydrated)if(r={element:i,isDehydrated:!1,cache:o.cache,pendingSuspenseBoundaries:o.pendingSuspenseBoundaries,transitions:o.transitions},e.updateQueue.baseState=r,e.memoizedState=r,e.flags&256){s=dc(Error(Ve(423)),e),e=B2(n,e,i,t,s);break e}else if(i!==s){s=dc(Error(Ve(424)),e),e=B2(n,e,i,t,s);break e}else for(ps=la(e.stateNode.containerInfo.firstChild),ms=e,hn=!0,ur=null,t=BR(e,null,i,t),e.child=t;t;)t.flags=t.flags&-3|4096,t=t.sibling;else{if(Ic(),i===s){e=Zo(n,e,t);break e}Xi(n,e,i,t)}e=e.child}return e;case 5:return ZR(e),n===null&&S0(e),i=e.type,s=e.pendingProps,r=n!==null?n.memoizedProps:null,o=s.children,y0(i,s)?o=null:r!==null&&y0(i,r)&&(e.flags|=32),OR(n,e),Xi(n,e,o,t),e.child;case 6:return n===null&&S0(e),null;case 13:return jR(n,e,t);case 4:return mv(e,e.stateNode.containerInfo),i=e.pendingProps,n===null?e.child=uc(e,null,i,t):Xi(n,e,i,t),e.child;case 11:return i=e.type,s=e.pendingProps,s=e.elementType===i?s:lr(i,s),v2(n,e,i,s,t);case 7:return Xi(n,e,e.pendingProps,t),e.child;case 8:return Xi(n,e,e.pendingProps.children,t),e.child;case 12:return Xi(n,e,e.pendingProps.children,t),e.child;case 10:e:{if(i=e.type._context,s=e.pendingProps,r=e.memoizedProps,o=s.value,gn(dA,i._currentValue),i._currentValue=o,r!==null)if(pr(r.value,o)){if(r.children===s.children&&!is.current){e=Zo(n,e,t);break e}}else for(r=e.child,r!==null&&(r.return=e);r!==null;){var a=r.dependencies;if(a!==null){o=r.child;for(var l=a.firstContext;l!==null;){if(l.context===i){if(r.tag===1){l=mo(-1,t&-t),l.tag=2;var g=r.updateQueue;if(g!==null){g=g.shared;var u=g.pending;u===null?l.next=l:(l.next=u.next,u.next=l),g.pending=l}}r.lanes|=t,l=r.alternate,l!==null&&(l.lanes|=t),x0(r.return,t,e),a.lanes|=t;break}l=l.next}}else if(r.tag===10)o=r.type===e.type?null:r.child;else if(r.tag===18){if(o=r.return,o===null)throw Error(Ve(341));o.lanes|=t,a=o.alternate,a!==null&&(a.lanes|=t),x0(o,t,e),o=r.sibling}else o=r.child;if(o!==null)o.return=r;else for(o=r;o!==null;){if(o===e){o=null;break}if(r=o.sibling,r!==null){r.return=o.return,o=r;break}o=o.return}r=o}Xi(n,e,s.children,t),e=e.child}return e;case 9:return s=e.type,i=e.pendingProps.children,tc(e,t),s=Ds(s),i=i(s),e.flags|=1,Xi(n,e,i,t),e.child;case 14:return i=e.type,s=lr(i,e.pendingProps),s=lr(i.type,s),y2(n,e,i,s,t);case 15:return _R(n,e,e.type,e.pendingProps,t);case 17:return i=e.type,s=e.pendingProps,s=e.elementType===i?s:lr(i,s),Lh(n,e),e.tag=1,ss(i)?(n=!0,IA(e)):n=!1,tc(e,t),yR(e,i,s),W0(e,i,s,t),N0(null,e,i,!0,n,t);case 19:return qR(n,e,t);case 22:return JR(n,e,t)}throw Error(Ve(156,e.tag))};function d1(n,e){return Lx(n,e)}function iH(n,e,t,i){this.tag=n,this.key=t,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.ref=null,this.pendingProps=e,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=i,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function Es(n,e,t,i){return new iH(n,e,t,i)}function Hv(n){return n=n.prototype,!(!n||!n.isReactComponent)}function sH(n){if(typeof n=="function")return Hv(n)?1:0;if(n!=null){if(n=n.$$typeof,n===$b)return 11;if(n===ev)return 14}return 2}function ua(n,e){var t=n.alternate;return t===null?(t=Es(n.tag,e,n.key,n.mode),t.elementType=n.elementType,t.type=n.type,t.stateNode=n.stateNode,t.alternate=n,n.alternate=t):(t.pendingProps=e,t.type=n.type,t.flags=0,t.subtreeFlags=0,t.deletions=null),t.flags=n.flags&14680064,t.childLanes=n.childLanes,t.lanes=n.lanes,t.child=n.child,t.memoizedProps=n.memoizedProps,t.memoizedState=n.memoizedState,t.updateQueue=n.updateQueue,e=n.dependencies,t.dependencies=e===null?null:{lanes:e.lanes,firstContext:e.firstContext},t.sibling=n.sibling,t.index=n.index,t.ref=n.ref,t}function kh(n,e,t,i,s,r){var o=2;if(i=n,typeof n=="function")Hv(n)&&(o=1);else if(typeof n=="string")o=5;else e:switch(n){case Wg:return hl(t.children,s,r,e);case qb:o=8,s|=8;break;case e0:return n=Es(12,t,e,s|2),n.elementType=e0,n.lanes=r,n;case t0:return n=Es(13,t,e,s),n.elementType=t0,n.lanes=r,n;case n0:return n=Es(19,t,e,s),n.elementType=n0,n.lanes=r,n;case Gx:return kA(t,s,r,e);default:if(typeof n=="object"&&n!==null)switch(n.$$typeof){case vx:o=10;break e;case yx:o=9;break e;case $b:o=11;break e;case ev:o=14;break e;case jo:o=16,i=null;break e}throw Error(Ve(130,n==null?n:typeof n,""))}return e=Es(o,t,e,s),e.elementType=n,e.type=i,e.lanes=r,e}function hl(n,e,t,i){return n=Es(7,n,i,e),n.lanes=t,n}function kA(n,e,t,i){return n=Es(22,n,i,e),n.elementType=Gx,n.lanes=t,n.stateNode={isHidden:!1},n}function jf(n,e,t){return n=Es(6,n,null,e),n.lanes=t,n}function qf(n,e,t){return e=Es(4,n.children!==null?n.children:[],n.key,e),e.lanes=t,e.stateNode={containerInfo:n.containerInfo,pendingChildren:null,implementation:n.implementation},e}function rH(n,e,t,i,s){this.tag=e,this.containerInfo=n,this.finishedWork=this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.pendingContext=this.context=null,this.callbackPriority=0,this.eventTimes=Mf(0),this.expirationTimes=Mf(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=Mf(0),this.identifierPrefix=i,this.onRecoverableError=s,this.mutableSourceEagerHydrationData=null}function Xv(n,e,t,i,s,r,o,a,l){return n=new rH(n,e,t,a,l),e===1?(e=1,r===!0&&(e|=8)):e=0,r=Es(3,null,null,e),n.current=r,r.stateNode=n,r.memoizedState={element:i,isDehydrated:t,cache:null,transitions:null,pendingSuspenseBoundaries:null},fv(r),n}function oH(n,e,t){var i=3"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(f1)}catch(n){console.error(n)}}f1(),Ax.exports=Bs;var IH=Ax.exports,F2=IH;qm.createRoot=F2.createRoot,qm.hydrateRoot=F2.hydrateRoot;var m1={color:void 0,size:void 0,className:void 0,style:void 0,attr:void 0},Y2=Ki.createContext&&Ki.createContext(m1),Ca=globalThis&&globalThis.__assign||function(){return Ca=Object.assign||function(n){for(var e,t=1,i=arguments.length;t{}});/** * @remix-run/router v1.6.2 * * Copyright (c) Remix Software Inc. @@ -46,7 +46,7 @@ Error generating stack: `+r.message+` * LICENSE.md file in the root directory of this source tree. * * @license MIT - */function _t(){return _t=Object.assign?Object.assign.bind():function(n){for(var e=1;e"u")throw new Error(e)}function Ac(n,e){if(!n){typeof console<"u"&&console.warn(e);try{throw new Error(e)}catch{}}}function vH(){return Math.random().toString(36).substr(2,8)}function z2(n,e){return{usr:n.state,key:n.key,idx:e}}function Su(n,e,t,i){return t===void 0&&(t=null),_t({pathname:typeof n=="string"?n:n.pathname,search:"",hash:""},typeof e=="string"?Wo(e):e,{state:t,key:e&&e.key||i||vH()})}function wl(n){let{pathname:e="/",search:t="",hash:i=""}=n;return t&&t!=="?"&&(e+=t.charAt(0)==="?"?t:"?"+t),i&&i!=="#"&&(e+=i.charAt(0)==="#"?i:"#"+i),e}function Wo(n){let e={};if(n){let t=n.indexOf("#");t>=0&&(e.hash=n.substr(t),n=n.substr(0,t));let i=n.indexOf("?");i>=0&&(e.search=n.substr(i),n=n.substr(0,i)),n&&(e.pathname=n)}return e}function yH(n,e,t,i){i===void 0&&(i={});let{window:s=document.defaultView,v5Compat:r=!1}=i,o=s.history,a=Ln.Pop,l=null,g=u();g==null&&(g=0,o.replaceState(_t({},o.state,{idx:g}),""));function u(){return(o.state||{idx:null}).idx}function C(){a=Ln.Pop;let y=u(),A=y==null?null:y-g;g=y,l&&l({action:a,location:v.location,delta:A})}function d(y,A){a=Ln.Push;let b=Su(v.location,y,A);t&&t(b,y),g=u()+1;let m=z2(b,g),B=v.createHref(b);try{o.pushState(m,"",B)}catch{s.location.assign(B)}r&&l&&l({action:a,location:v.location,delta:1})}function h(y,A){a=Ln.Replace;let b=Su(v.location,y,A);t&&t(b,y),g=u();let m=z2(b,g),B=v.createHref(b);o.replaceState(m,"",B),r&&l&&l({action:a,location:v.location,delta:0})}function f(y){let A=s.location.origin!=="null"?s.location.origin:s.location.href,b=typeof y=="string"?y:wl(y);return Ft(A,"No window.location.(origin|href) available to create URL for href: "+b),new URL(b,A)}let v={get action(){return a},get location(){return n(s,o)},listen(y){if(l)throw new Error("A history only accepts one active listener");return s.addEventListener(K2,C),l=y,()=>{s.removeEventListener(K2,C),l=null}},createHref(y){return e(s,y)},createURL:f,encodeLocation(y){let A=f(y);return{pathname:A.pathname,search:A.search,hash:A.hash}},push:d,replace:h,go(y){return o.go(y)}};return v}var Dn;(function(n){n.data="data",n.deferred="deferred",n.redirect="redirect",n.error="error"})(Dn||(Dn={}));const GH=new Set(["lazy","caseSensitive","path","id","index","children"]);function BH(n){return n.index===!0}function U0(n,e,t,i){return t===void 0&&(t=[]),i===void 0&&(i={}),n.map((s,r)=>{let o=[...t,r],a=typeof s.id=="string"?s.id:o.join("-");if(Ft(s.index!==!0||!s.children,"Cannot specify children on an index route"),Ft(!i[a],'Found a route id collision on id "'+a+`". Route id's must be globally unique within Data Router usages`),BH(s)){let l=_t({},s,e(s),{id:a});return i[a]=l,l}else{let l=_t({},s,e(s),{id:a,children:void 0});return i[a]=l,s.children&&(l.children=U0(s.children,e,o,i)),l}})}function Eg(n,e,t){t===void 0&&(t="/");let i=typeof e=="string"?Wo(e):e,s=wc(i.pathname||"/",t);if(s==null)return null;let r=v1(n);ZH(r);let o=null;for(let a=0;o==null&&a{let l={relativePath:a===void 0?r.path||"":a,caseSensitive:r.caseSensitive===!0,childrenIndex:o,route:r};l.relativePath.startsWith("/")&&(Ft(l.relativePath.startsWith(i),'Absolute route path "'+l.relativePath+'" nested under path '+('"'+i+'" is not valid. An absolute child route path ')+"must start with the combined path of all its parent routes."),l.relativePath=l.relativePath.slice(i.length));let g=bo([i,l.relativePath]),u=t.concat(l);r.children&&r.children.length>0&&(Ft(r.index!==!0,"Index routes must not have child routes. Please remove "+('all child routes from route path "'+g+'".')),v1(r.children,e,u,g)),!(r.path==null&&!r.index)&&e.push({path:g,score:MH(g,r.index),routesMeta:u})};return n.forEach((r,o)=>{var a;if(r.path===""||!((a=r.path)!=null&&a.includes("?")))s(r,o);else for(let l of y1(r.path))s(r,o,l)}),e}function y1(n){let e=n.split("/");if(e.length===0)return[];let[t,...i]=e,s=t.endsWith("?"),r=t.replace(/\?$/,"");if(i.length===0)return s?[r,""]:[r];let o=y1(i.join("/")),a=[];return a.push(...o.map(l=>l===""?r:[r,l].join("/"))),s&&a.push(...o),a.map(l=>n.startsWith("/")&&l===""?"/":l)}function ZH(n){n.sort((e,t)=>e.score!==t.score?t.score-e.score:NH(e.routesMeta.map(i=>i.childrenIndex),t.routesMeta.map(i=>i.childrenIndex)))}const wH=/^:\w+$/,SH=3,xH=2,RH=1,WH=10,VH=-2,L2=n=>n==="*";function MH(n,e){let t=n.split("/"),i=t.length;return t.some(L2)&&(i+=VH),e&&(i+=xH),t.filter(s=>!L2(s)).reduce((s,r)=>s+(wH.test(r)?SH:r===""?RH:WH),i)}function NH(n,e){return n.length===e.length&&n.slice(0,-1).every((i,s)=>i===e[s])?n[n.length-1]-e[e.length-1]:0}function HH(n,e){let{routesMeta:t}=n,i={},s="/",r=[];for(let o=0;o{if(u==="*"){let d=a[C]||"";o=r.slice(0,r.length-d.length).replace(/(.)\/+$/,"$1")}return g[u]=KH(a[C]||"",u),g},{}),pathname:r,pathnameBase:o,pattern:n}}function FH(n,e,t){e===void 0&&(e=!1),t===void 0&&(t=!0),Ac(n==="*"||!n.endsWith("*")||n.endsWith("/*"),'Route path "'+n+'" will be treated as if it were '+('"'+n.replace(/\*$/,"/*")+'" because the `*` character must ')+"always follow a `/` in the pattern. To get rid of this warning, "+('please change the route path to "'+n.replace(/\*$/,"/*")+'".'));let i=[],s="^"+n.replace(/\/*\*?$/,"").replace(/^\/*/,"/").replace(/[\\.*+^$?{}|()[\]]/g,"\\$&").replace(/\/:(\w+)/g,(o,a)=>(i.push(a),"/([^\\/]+)"));return n.endsWith("*")?(i.push("*"),s+=n==="*"||n==="/*"?"(.*)$":"(?:\\/(.+)|\\/*)$"):t?s+="\\/*$":n!==""&&n!=="/"&&(s+="(?:(?=\\/|$))"),[new RegExp(s,e?void 0:"i"),i]}function YH(n){try{return decodeURI(n)}catch(e){return Ac(!1,'The URL path "'+n+'" could not be decoded because it is is a malformed URL segment. This is probably due to a bad percent '+("encoding ("+e+").")),n}}function KH(n,e){try{return decodeURIComponent(n)}catch(t){return Ac(!1,'The value for the URL param "'+e+'" will not be decoded because'+(' the string "'+n+'" is a malformed URL segment. This is probably')+(" due to a bad percent encoding ("+t+").")),n}}function wc(n,e){if(e==="/")return n;if(!n.toLowerCase().startsWith(e.toLowerCase()))return null;let t=e.endsWith("/")?e.length-1:e.length,i=n.charAt(t);return i&&i!=="/"?null:n.slice(t)||"/"}function zH(n,e){e===void 0&&(e="/");let{pathname:t,search:i="",hash:s=""}=typeof n=="string"?Wo(n):n;return{pathname:t?t.startsWith("/")?t:LH(t,e):e,search:TH(i),hash:kH(s)}}function LH(n,e){let t=e.replace(/\/+$/,"").split("/");return n.split("/").forEach(s=>{s===".."?t.length>1&&t.pop():s!=="."&&t.push(s)}),t.length>1?t.join("/"):"/"}function $f(n,e,t,i){return"Cannot include a '"+n+"' character in a manually specified "+("`to."+e+"` field ["+JSON.stringify(i)+"]. Please separate it out to the ")+("`to."+t+"` field. Alternatively you may provide the full path as ")+'a string in and the router will parse it for you.'}function OA(n){return n.filter((e,t)=>t===0||e.route.path&&e.route.path.length>0)}function zv(n,e,t,i){i===void 0&&(i=!1);let s;typeof n=="string"?s=Wo(n):(s=_t({},n),Ft(!s.pathname||!s.pathname.includes("?"),$f("?","pathname","search",s)),Ft(!s.pathname||!s.pathname.includes("#"),$f("#","pathname","hash",s)),Ft(!s.search||!s.search.includes("#"),$f("#","search","hash",s)));let r=n===""||s.pathname==="",o=r?"/":s.pathname,a;if(i||o==null)a=t;else{let C=e.length-1;if(o.startsWith("..")){let d=o.split("/");for(;d[0]==="..";)d.shift(),C-=1;s.pathname=d.join("/")}a=C>=0?e[C]:"/"}let l=zH(s,a),g=o&&o!=="/"&&o.endsWith("/"),u=(r||o===".")&&t.endsWith("/");return!l.pathname.endsWith("/")&&(g||u)&&(l.pathname+="/"),l}const bo=n=>n.join("/").replace(/\/\/+/g,"/"),EH=n=>n.replace(/\/+$/,"").replace(/^\/*/,"/"),TH=n=>!n||n==="?"?"":n.startsWith("?")?n:"?"+n,kH=n=>!n||n==="#"?"":n.startsWith("#")?n:"#"+n;class Lv{constructor(e,t,i,s){s===void 0&&(s=!1),this.status=e,this.statusText=t||"",this.internal=s,i instanceof Error?(this.data=i.toString(),this.error=i):this.data=i}}function G1(n){return n!=null&&typeof n.status=="number"&&typeof n.statusText=="string"&&typeof n.internal=="boolean"&&"data"in n}const B1=["post","put","patch","delete"],DH=new Set(B1),UH=["get",...B1],PH=new Set(UH),_H=new Set([301,302,303,307,308]),JH=new Set([307,308]),em={state:"idle",location:void 0,formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0},OH={state:"idle",data:void 0,formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0},E2={state:"unblocked",proceed:void 0,reset:void 0,location:void 0},Z1=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,w1=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u",QH=!w1,jH=n=>({hasErrorBoundary:!!n.hasErrorBoundary});function qH(n){Ft(n.routes.length>0,"You must provide a non-empty routes array to createRouter");let e;if(n.mapRouteProperties)e=n.mapRouteProperties;else if(n.detectErrorBoundary){let D=n.detectErrorBoundary;e=$=>({hasErrorBoundary:D($)})}else e=jH;let t={},i=U0(n.routes,e,void 0,t),s,r=n.basename||"/",o=_t({v7_normalizeFormMethod:!1,v7_prependBasename:!1},n.future),a=null,l=new Set,g=null,u=null,C=null,d=n.hydrationData!=null,h=Eg(i,n.history.location,r),f=null;if(h==null){let D=gr(404,{pathname:n.history.location.pathname}),{matches:$,route:Ie}=J2(i);h=$,f={[Ie.id]:D}}let v=!h.some(D=>D.route.lazy)&&(!h.some(D=>D.route.loader)||n.hydrationData!=null),y,A={historyAction:n.history.action,location:n.history.location,matches:h,initialized:v,navigation:em,restoreScrollPosition:n.hydrationData!=null?!1:null,preventScrollReset:!1,revalidation:"idle",loaderData:n.hydrationData&&n.hydrationData.loaderData||{},actionData:n.hydrationData&&n.hydrationData.actionData||null,errors:n.hydrationData&&n.hydrationData.errors||f,fetchers:new Map,blockers:new Map},b=Ln.Pop,m=!1,B,S=!1,x=!1,R=[],M=[],Z=new Map,V=0,N=-1,P=new Map,U=new Set,q=new Map,ie=new Map,he=new Map,Ce=!1;function z(){return a=n.history.listen(D=>{let{action:$,location:Ie,delta:ye}=D;if(Ce){Ce=!1;return}Ac(he.size===0||ye!=null,"You are trying to use a blocker on a POP navigation to a location that was not created by @remix-run/router. This will fail silently in production. This can happen if you are navigating outside the router via `window.history.pushState`/`window.location.hash` instead of using router navigation APIs. This can also happen if you are using createHashRouter and the user manually changes the URL.");let be=de({currentLocation:A.location,nextLocation:Ie,historyAction:$});if(be&&ye!=null){Ce=!0,n.history.go(ye*-1),X(be,{state:"blocked",location:Ie,proceed(){X(be,{state:"proceeding",proceed:void 0,reset:void 0,location:Ie}),n.history.go(ye)},reset(){T(be),le({blockers:new Map(y.state.blockers)})}});return}return Ze($,Ie)}),A.initialized||Ze(Ln.Pop,A.location),y}function Q(){a&&a(),l.clear(),B&&B.abort(),A.fetchers.forEach((D,$)=>Fe($)),A.blockers.forEach((D,$)=>T($))}function J(D){return l.add(D),()=>l.delete(D)}function le(D){A=_t({},A,D),l.forEach($=>$(A))}function se(D,$){var Ie,ye;let be=A.actionData!=null&&A.navigation.formMethod!=null&&go(A.navigation.formMethod)&&A.navigation.state==="loading"&&((Ie=D.state)==null?void 0:Ie._isRedirect)!==!0,Se;$.actionData?Object.keys($.actionData).length>0?Se=$.actionData:Se=null:be?Se=A.actionData:Se=null;let ze=$.loaderData?_2(A.loaderData,$.loaderData,$.matches||[],$.errors):A.loaderData;for(let[Ke]of he)T(Ke);let Ye=m===!0||A.navigation.formMethod!=null&&go(A.navigation.formMethod)&&((ye=D.state)==null?void 0:ye._isRedirect)!==!0;s&&(i=s,s=void 0),le(_t({},$,{actionData:Se,loaderData:ze,historyAction:b,location:D,initialized:!0,navigation:em,revalidation:"idle",restoreScrollPosition:lt(D,$.matches||A.matches),preventScrollReset:Ye,blockers:new Map(A.blockers)})),S||b===Ln.Pop||(b===Ln.Push?n.history.push(D,D.state):b===Ln.Replace&&n.history.replace(D,D.state)),b=Ln.Pop,m=!1,S=!1,x=!1,R=[],M=[]}async function te(D,$){if(typeof D=="number"){n.history.go(D);return}let Ie=P0(A.location,A.matches,r,o.v7_prependBasename,D,$?.fromRouteId,$?.relative),{path:ye,submission:be,error:Se}=T2(o.v7_normalizeFormMethod,!1,Ie,$),ze=A.location,Ye=Su(A.location,ye,$&&$.state);Ye=_t({},Ye,n.history.encodeLocation(Ye));let Ke=$&&$.replace!=null?$.replace:void 0,_=Ln.Push;Ke===!0?_=Ln.Replace:Ke===!1||be!=null&&go(be.formMethod)&&be.formAction===A.location.pathname+A.location.search&&(_=Ln.Replace);let ce=$&&"preventScrollReset"in $?$.preventScrollReset===!0:void 0,Ge=de({currentLocation:ze,nextLocation:Ye,historyAction:_});if(Ge){X(Ge,{state:"blocked",location:Ye,proceed(){X(Ge,{state:"proceeding",proceed:void 0,reset:void 0,location:Ye}),te(D,$)},reset(){T(Ge),le({blockers:new Map(A.blockers)})}});return}return await Ze(_,Ye,{submission:be,pendingError:Se,preventScrollReset:ce,replace:$&&$.replace})}function ge(){if(we(),le({revalidation:"loading"}),A.navigation.state!=="submitting"){if(A.navigation.state==="idle"){Ze(A.historyAction,A.location,{startUninterruptedRevalidation:!0});return}Ze(b||A.historyAction,A.navigation.location,{overrideNavigation:A.navigation})}}async function Ze(D,$,Ie){B&&B.abort(),B=null,b=D,S=(Ie&&Ie.startUninterruptedRevalidation)===!0,Ee(A.location,A.matches),m=(Ie&&Ie.preventScrollReset)===!0;let ye=s||i,be=Ie&&Ie.overrideNavigation,Se=Eg(ye,$,r);if(!Se){let Ne=gr(404,{pathname:$.pathname}),{matches:Te,route:At}=J2(ye);xe(),se($,{matches:Te,loaderData:{},errors:{[At.id]:Ne}});return}if(A.initialized&&iX(A.location,$)&&!(Ie&&Ie.submission&&go(Ie.submission.formMethod))){se($,{matches:Se});return}B=new AbortController;let ze=uI(n.history,$,B.signal,Ie&&Ie.submission),Ye,Ke;if(Ie&&Ie.pendingError)Ke={[Tg(Se).route.id]:Ie.pendingError};else if(Ie&&Ie.submission&&go(Ie.submission.formMethod)){let Ne=await Re(ze,$,Ie.submission,Se,{replace:Ie.replace});if(Ne.shortCircuited)return;Ye=Ne.pendingActionData,Ke=Ne.pendingActionError,be=_t({state:"loading",location:$},Ie.submission),ze=new Request(ze.url,{signal:ze.signal})}let{shortCircuited:_,loaderData:ce,errors:Ge}=await O(ze,$,Se,be,Ie&&Ie.submission,Ie&&Ie.fetcherSubmission,Ie&&Ie.replace,Ye,Ke);_||(B=null,se($,_t({matches:Se},Ye?{actionData:Ye}:{},{loaderData:ce,errors:Ge})))}async function Re(D,$,Ie,ye,be){we();let Se=_t({state:"submitting",location:$},Ie);le({navigation:Se});let ze,Ye=_0(ye,$);if(!Ye.route.action&&!Ye.route.lazy)ze={type:Dn.error,error:gr(405,{method:D.method,pathname:$.pathname,routeId:Ye.route.id})};else if(ze=await II("action",D,Ye,ye,t,e,r),D.signal.aborted)return{shortCircuited:!0};if(ic(ze)){let Ke;return be&&be.replace!=null?Ke=be.replace:Ke=ze.location===A.location.pathname+A.location.search,await Be(A,ze,{submission:Ie,replace:Ke}),{shortCircuited:!0}}if($I(ze)){let Ke=Tg(ye,Ye.route.id);return(be&&be.replace)!==!0&&(b=Ln.Push),{pendingActionData:{},pendingActionError:{[Ke.route.id]:ze.error}}}if(ll(ze))throw gr(400,{type:"defer-action"});return{pendingActionData:{[Ye.route.id]:ze.data}}}async function O(D,$,Ie,ye,be,Se,ze,Ye,Ke){let _=ye;_||(_=_t({state:"loading",location:$,formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0},be));let ce=be||Se?be||Se:_.formMethod&&_.formAction&&_.formData&&_.formEncType?{formMethod:_.formMethod,formAction:_.formAction,formData:_.formData,formEncType:_.formEncType}:void 0,Ge=s||i,[Ne,Te]=k2(n.history,A,Ie,ce,$,x,R,M,q,Ge,r,Ye,Ke);if(xe($t=>!(Ie&&Ie.some(pi=>pi.route.id===$t))||Ne&&Ne.some(pi=>pi.route.id===$t)),Ne.length===0&&Te.length===0){let $t=nt();return se($,_t({matches:Ie,loaderData:{},errors:Ke||null},Ye?{actionData:Ye}:{},$t?{fetchers:new Map(A.fetchers)}:{})),{shortCircuited:!0}}if(!S){Te.forEach(pi=>{let F=A.fetchers.get(pi.key),ae={state:"loading",data:F&&F.data,formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0," _hasFetcherDoneAnything ":!0};A.fetchers.set(pi.key,ae)});let $t=Ye||A.actionData;le(_t({navigation:_},$t?Object.keys($t).length===0?{actionData:null}:{actionData:$t}:{},Te.length>0?{fetchers:new Map(A.fetchers)}:{}))}N=++V,Te.forEach($t=>{$t.controller&&Z.set($t.key,$t.controller)});let At=()=>Te.forEach($t=>qe($t.key));B&&B.signal.addEventListener("abort",At);let{results:Xt,loaderResults:Gn,fetcherResults:hi}=await fe(A.matches,Ie,Ne,Te,D);if(D.signal.aborted)return{shortCircuited:!0};B&&B.signal.removeEventListener("abort",At),Te.forEach($t=>Z.delete($t.key));let Lt=O2(Xt);if(Lt)return await Be(A,Lt,{replace:ze}),{shortCircuited:!0};let{loaderData:Hn,errors:Ai}=P2(A,Ie,Ne,Gn,Ke,Te,hi,ie);ie.forEach(($t,pi)=>{$t.subscribe(F=>{(F||$t.done)&&ie.delete(pi)})});let vr=nt(),No=Ct(N),Pr=vr||No||Te.length>0;return _t({loaderData:Hn,errors:Ai},Pr?{fetchers:new Map(A.fetchers)}:{})}function ot(D){return A.fetchers.get(D)||OH}function ct(D,$,Ie,ye){if(QH)throw new Error("router.fetch() was called during the server render, but it shouldn't be. You are likely calling a useFetcher() method in the body of your component. Try moving it to a useEffect or a callback.");Z.has(D)&&qe(D);let be=s||i,Se=P0(A.location,A.matches,r,o.v7_prependBasename,Ie,$,ye?.relative),ze=Eg(be,Se,r);if(!ze){Pe(D,$,gr(404,{pathname:Se}));return}let{path:Ye,submission:Ke}=T2(o.v7_normalizeFormMethod,!0,Se,ye),_=_0(ze,Ye);if(m=(ye&&ye.preventScrollReset)===!0,Ke&&go(Ke.formMethod)){Me(D,$,Ye,_,ze,Ke);return}q.set(D,{routeId:$,path:Ye}),Ue(D,$,Ye,_,ze,Ke)}async function Me(D,$,Ie,ye,be,Se){if(we(),q.delete(D),!ye.route.action&&!ye.route.lazy){let Ae=gr(405,{method:Se.formMethod,pathname:Ie,routeId:$});Pe(D,$,Ae);return}let ze=A.fetchers.get(D),Ye=_t({state:"submitting"},Se,{data:ze&&ze.data," _hasFetcherDoneAnything ":!0});A.fetchers.set(D,Ye),le({fetchers:new Map(A.fetchers)});let Ke=new AbortController,_=uI(n.history,Ie,Ke.signal,Se);Z.set(D,Ke);let ce=await II("action",_,ye,be,t,e,r);if(_.signal.aborted){Z.get(D)===Ke&&Z.delete(D);return}if(ic(ce)){Z.delete(D),U.add(D);let Ae=_t({state:"loading"},Se,{data:void 0," _hasFetcherDoneAnything ":!0});return A.fetchers.set(D,Ae),le({fetchers:new Map(A.fetchers)}),Be(A,ce,{submission:Se,isFetchActionRedirect:!0})}if($I(ce)){Pe(D,$,ce.error);return}if(ll(ce))throw gr(400,{type:"defer-action"});let Ge=A.navigation.location||A.location,Ne=uI(n.history,Ge,Ke.signal),Te=s||i,At=A.navigation.state!=="idle"?Eg(Te,A.navigation.location,r):A.matches;Ft(At,"Didn't find any matches after fetcher action");let Xt=++V;P.set(D,Xt);let Gn=_t({state:"loading",data:ce.data},Se,{" _hasFetcherDoneAnything ":!0});A.fetchers.set(D,Gn);let[hi,Lt]=k2(n.history,A,At,Se,Ge,x,R,M,q,Te,r,{[ye.route.id]:ce.data},void 0);Lt.filter(Ae=>Ae.key!==D).forEach(Ae=>{let re=Ae.key,ve=A.fetchers.get(re),rt={state:"loading",data:ve&&ve.data,formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0," _hasFetcherDoneAnything ":!0};A.fetchers.set(re,rt),Ae.controller&&Z.set(re,Ae.controller)}),le({fetchers:new Map(A.fetchers)});let Hn=()=>Lt.forEach(Ae=>qe(Ae.key));Ke.signal.addEventListener("abort",Hn);let{results:Ai,loaderResults:vr,fetcherResults:No}=await fe(A.matches,At,hi,Lt,Ne);if(Ke.signal.aborted)return;Ke.signal.removeEventListener("abort",Hn),P.delete(D),Z.delete(D),Lt.forEach(Ae=>Z.delete(Ae.key));let Pr=O2(Ai);if(Pr)return Be(A,Pr);let{loaderData:$t,errors:pi}=P2(A,A.matches,hi,vr,void 0,Lt,No,ie),F={state:"idle",data:ce.data,formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0," _hasFetcherDoneAnything ":!0};A.fetchers.set(D,F);let ae=Ct(Xt);A.navigation.state==="loading"&&Xt>N?(Ft(b,"Expected pending action"),B&&B.abort(),se(A.navigation.location,{matches:At,loaderData:$t,errors:pi,fetchers:new Map(A.fetchers)})):(le(_t({errors:pi,loaderData:_2(A.loaderData,$t,At,pi)},ae?{fetchers:new Map(A.fetchers)}:{})),x=!1)}async function Ue(D,$,Ie,ye,be,Se){let ze=A.fetchers.get(D),Ye=_t({state:"loading",formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0},Se,{data:ze&&ze.data," _hasFetcherDoneAnything ":!0});A.fetchers.set(D,Ye),le({fetchers:new Map(A.fetchers)});let Ke=new AbortController,_=uI(n.history,Ie,Ke.signal);Z.set(D,Ke);let ce=await II("loader",_,ye,be,t,e,r);if(ll(ce)&&(ce=await W1(ce,_.signal,!0)||ce),Z.get(D)===Ke&&Z.delete(D),_.signal.aborted)return;if(ic(ce)){U.add(D),await Be(A,ce);return}if($I(ce)){let Ne=Tg(A.matches,$);A.fetchers.delete(D),le({fetchers:new Map(A.fetchers),errors:{[Ne.route.id]:ce.error}});return}Ft(!ll(ce),"Unhandled fetcher deferred data");let Ge={state:"idle",data:ce.data,formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0," _hasFetcherDoneAnything ":!0};A.fetchers.set(D,Ge),le({fetchers:new Map(A.fetchers)})}async function Be(D,$,Ie){var ye;let{submission:be,replace:Se,isFetchActionRedirect:ze}=Ie===void 0?{}:Ie;$.revalidate&&(x=!0);let Ye=Su(D.location,$.location,_t({_isRedirect:!0},ze?{_isFetchActionRedirect:!0}:{}));if(Ft(Ye,"Expected a location on the redirect navigation"),Z1.test($.location)&&w1&&typeof((ye=window)==null?void 0:ye.location)<"u"){let Te=n.history.createURL($.location),At=wc(Te.pathname,r)==null;if(window.location.origin!==Te.origin||At){Se?window.location.replace($.location):window.location.assign($.location);return}}B=null;let Ke=Se===!0?Ln.Replace:Ln.Push,{formMethod:_,formAction:ce,formEncType:Ge,formData:Ne}=D.navigation;!be&&_&&ce&&Ne&&Ge&&(be={formMethod:_,formAction:ce,formEncType:Ge,formData:Ne}),JH.has($.status)&&be&&go(be.formMethod)?await Ze(Ke,Ye,{submission:_t({},be,{formAction:$.location}),preventScrollReset:m}):ze?await Ze(Ke,Ye,{overrideNavigation:{state:"loading",location:Ye,formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0},fetcherSubmission:be,preventScrollReset:m}):await Ze(Ke,Ye,{overrideNavigation:{state:"loading",location:Ye,formMethod:be?be.formMethod:void 0,formAction:be?be.formAction:void 0,formEncType:be?be.formEncType:void 0,formData:be?be.formData:void 0},preventScrollReset:m})}async function fe(D,$,Ie,ye,be){let Se=await Promise.all([...Ie.map(Ke=>II("loader",be,Ke,$,t,e,r)),...ye.map(Ke=>Ke.matches&&Ke.match&&Ke.controller?II("loader",uI(n.history,Ke.path,Ke.controller.signal),Ke.match,Ke.matches,t,e,r):{type:Dn.error,error:gr(404,{pathname:Ke.path})})]),ze=Se.slice(0,Ie.length),Ye=Se.slice(Ie.length);return await Promise.all([Q2(D,Ie,ze,ze.map(()=>be.signal),!1,A.loaderData),Q2(D,ye.map(Ke=>Ke.match),Ye,ye.map(Ke=>Ke.controller?Ke.controller.signal:null),!0)]),{results:Se,loaderResults:ze,fetcherResults:Ye}}function we(){x=!0,R.push(...xe()),q.forEach((D,$)=>{Z.has($)&&(M.push($),qe($))})}function Pe(D,$,Ie){let ye=Tg(A.matches,$);Fe(D),le({errors:{[ye.route.id]:Ie},fetchers:new Map(A.fetchers)})}function Fe(D){Z.has(D)&&qe(D),q.delete(D),P.delete(D),U.delete(D),A.fetchers.delete(D)}function qe(D){let $=Z.get(D);Ft($,"Expected fetch controller: "+D),$.abort(),Z.delete(D)}function at(D){for(let $ of D){let ye={state:"idle",data:ot($).data,formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0," _hasFetcherDoneAnything ":!0};A.fetchers.set($,ye)}}function nt(){let D=[],$=!1;for(let Ie of U){let ye=A.fetchers.get(Ie);Ft(ye,"Expected fetcher: "+Ie),ye.state==="loading"&&(U.delete(Ie),D.push(Ie),$=!0)}return at(D),$}function Ct(D){let $=[];for(let[Ie,ye]of P)if(ye0}function Ht(D,$){let Ie=A.blockers.get(D)||E2;return he.get(D)!==$&&he.set(D,$),Ie}function T(D){A.blockers.delete(D),he.delete(D)}function X(D,$){let Ie=A.blockers.get(D)||E2;Ft(Ie.state==="unblocked"&&$.state==="blocked"||Ie.state==="blocked"&&$.state==="blocked"||Ie.state==="blocked"&&$.state==="proceeding"||Ie.state==="blocked"&&$.state==="unblocked"||Ie.state==="proceeding"&&$.state==="unblocked","Invalid blocker state transition: "+Ie.state+" -> "+$.state),A.blockers.set(D,$),le({blockers:new Map(A.blockers)})}function de(D){let{currentLocation:$,nextLocation:Ie,historyAction:ye}=D;if(he.size===0)return;he.size>1&&Ac(!1,"A router only supports one blocker at a time");let be=Array.from(he.entries()),[Se,ze]=be[be.length-1],Ye=A.blockers.get(Se);if(!(Ye&&Ye.state==="proceeding")&&ze({currentLocation:$,nextLocation:Ie,historyAction:ye}))return Se}function xe(D){let $=[];return ie.forEach((Ie,ye)=>{(!D||D(ye))&&(Ie.cancel(),$.push(ye),ie.delete(ye))}),$}function We(D,$,Ie){if(g=D,C=$,u=Ie||(ye=>ye.key),!d&&A.navigation===em){d=!0;let ye=lt(A.location,A.matches);ye!=null&&le({restoreScrollPosition:ye})}return()=>{g=null,C=null,u=null}}function Ee(D,$){if(g&&u&&C){let Ie=$.map(be=>j2(be,A.loaderData)),ye=u(D,Ie)||D.key;g[ye]=C()}}function lt(D,$){if(g&&u&&C){let Ie=$.map(Se=>j2(Se,A.loaderData)),ye=u(D,Ie)||D.key,be=g[ye];if(typeof be=="number")return be}return null}function Je(D){t={},s=U0(D,e,void 0,t)}return y={get basename(){return r},get state(){return A},get routes(){return i},initialize:z,subscribe:J,enableScrollRestoration:We,navigate:te,fetch:ct,revalidate:ge,createHref:D=>n.history.createHref(D),encodeLocation:D=>n.history.encodeLocation(D),getFetcher:ot,deleteFetcher:Fe,dispose:Q,getBlocker:Ht,deleteBlocker:T,_internalFetchControllers:Z,_internalActiveDeferreds:ie,_internalSetRoutes:Je},y}function $H(n){return n!=null&&"formData"in n}function P0(n,e,t,i,s,r,o){let a,l;if(r!=null&&o!=="path"){a=[];for(let u of e)if(a.push(u),u.route.id===r){l=u;break}}else a=e,l=e[e.length-1];let g=zv(s||".",OA(a).map(u=>u.pathnameBase),wc(n.pathname,t)||n.pathname,o==="path");return s==null&&(g.search=n.search,g.hash=n.hash),(s==null||s===""||s===".")&&l&&l.route.index&&!Ev(g.search)&&(g.search=g.search?g.search.replace(/^\?/,"?index&"):"?index"),i&&t!=="/"&&(g.pathname=g.pathname==="/"?t:bo([t,g.pathname])),wl(g)}function T2(n,e,t,i){if(!i||!$H(i))return{path:t};if(i.formMethod&&!oX(i.formMethod))return{path:t,error:gr(405,{method:i.formMethod})};let s;if(i.formData){let a=i.formMethod||"get";if(s={formMethod:n?a.toUpperCase():a.toLowerCase(),formAction:R1(t),formEncType:i&&i.formEncType||"application/x-www-form-urlencoded",formData:i.formData},go(s.formMethod))return{path:t,submission:s}}let r=Wo(t),o=x1(i.formData);return e&&r.search&&Ev(r.search)&&o.append("index",""),r.search="?"+o,{path:wl(r),submission:s}}function eX(n,e){let t=n;if(e){let i=n.findIndex(s=>s.route.id===e);i>=0&&(t=n.slice(0,i))}return t}function k2(n,e,t,i,s,r,o,a,l,g,u,C,d){let h=d?Object.values(d)[0]:C?Object.values(C)[0]:void 0,f=n.createURL(e.location),v=n.createURL(s),y=d?Object.keys(d)[0]:void 0,b=eX(t,y).filter((B,S)=>{if(B.route.lazy)return!0;if(B.route.loader==null)return!1;if(tX(e.loaderData,e.matches[S],B)||o.some(M=>M===B.route.id))return!0;let x=e.matches[S],R=B;return D2(B,_t({currentUrl:f,currentParams:x.params,nextUrl:v,nextParams:R.params},i,{actionResult:h,defaultShouldRevalidate:r||f.pathname+f.search===v.pathname+v.search||f.search!==v.search||S1(x,R)}))}),m=[];return l.forEach((B,S)=>{if(!t.some(Z=>Z.route.id===B.routeId))return;let x=Eg(g,B.path,u);if(!x){m.push({key:S,routeId:B.routeId,path:B.path,matches:null,match:null,controller:null});return}let R=_0(x,B.path);if(a.includes(S)){m.push({key:S,routeId:B.routeId,path:B.path,matches:x,match:R,controller:new AbortController});return}D2(R,_t({currentUrl:f,currentParams:e.matches[e.matches.length-1].params,nextUrl:v,nextParams:t[t.length-1].params},i,{actionResult:h,defaultShouldRevalidate:r}))&&m.push({key:S,routeId:B.routeId,path:B.path,matches:x,match:R,controller:new AbortController})}),[b,m]}function tX(n,e,t){let i=!e||t.route.id!==e.route.id,s=n[t.route.id]===void 0;return i||s}function S1(n,e){let t=n.route.path;return n.pathname!==e.pathname||t!=null&&t.endsWith("*")&&n.params["*"]!==e.params["*"]}function D2(n,e){if(n.route.shouldRevalidate){let t=n.route.shouldRevalidate(e);if(typeof t=="boolean")return t}return e.defaultShouldRevalidate}async function U2(n,e,t){if(!n.lazy)return;let i=await n.lazy();if(!n.lazy)return;let s=t[n.id];Ft(s,"No route found in manifest");let r={};for(let o in i){let l=s[o]!==void 0&&o!=="hasErrorBoundary";Ac(!l,'Route "'+s.id+'" has a static property "'+o+'" defined but its lazy function is also returning a value for this property. '+('The lazy route property "'+o+'" will be ignored.')),!l&&!GH.has(o)&&(r[o]=i[o])}Object.assign(s,r),Object.assign(s,_t({},e(s),{lazy:void 0}))}async function II(n,e,t,i,s,r,o,a,l,g){a===void 0&&(a=!1),l===void 0&&(l=!1);let u,C,d,h=y=>{let A,b=new Promise((m,B)=>A=B);return d=()=>A(),e.signal.addEventListener("abort",d),Promise.race([y({request:e,params:t.params,context:g}),b])};try{let y=t.route[n];if(t.route.lazy)if(y)C=(await Promise.all([h(y),U2(t.route,r,s)]))[0];else if(await U2(t.route,r,s),y=t.route[n],y)C=await h(y);else if(n==="action"){let A=new URL(e.url),b=A.pathname+A.search;throw gr(405,{method:e.method,pathname:b,routeId:t.route.id})}else return{type:Dn.data,data:void 0};else if(y)C=await h(y);else{let A=new URL(e.url),b=A.pathname+A.search;throw gr(404,{pathname:b})}Ft(C!==void 0,"You defined "+(n==="action"?"an action":"a loader")+" for route "+('"'+t.route.id+"\" but didn't return anything from your `"+n+"` ")+"function. Please return a value or `null`.")}catch(y){u=Dn.error,C=y}finally{d&&e.signal.removeEventListener("abort",d)}if(rX(C)){let y=C.status;if(_H.has(y)){let m=C.headers.get("Location");if(Ft(m,"Redirects returned/thrown from loaders/actions must have a Location header"),!Z1.test(m))m=P0(new URL(e.url),i.slice(0,i.indexOf(t)+1),o,!0,m);else if(!a){let B=new URL(e.url),S=m.startsWith("//")?new URL(B.protocol+m):new URL(m),x=wc(S.pathname,o)!=null;S.origin===B.origin&&x&&(m=S.pathname+S.search+S.hash)}if(a)throw C.headers.set("Location",m),C;return{type:Dn.redirect,status:y,location:m,revalidate:C.headers.get("X-Remix-Revalidate")!==null}}if(l)throw{type:u||Dn.data,response:C};let A,b=C.headers.get("Content-Type");return b&&/\bapplication\/json\b/.test(b)?A=await C.json():A=await C.text(),u===Dn.error?{type:u,error:new Lv(y,C.statusText,A),headers:C.headers}:{type:Dn.data,data:A,statusCode:C.status,headers:C.headers}}if(u===Dn.error)return{type:u,error:C};if(sX(C)){var f,v;return{type:Dn.deferred,deferredData:C,statusCode:(f=C.init)==null?void 0:f.status,headers:((v=C.init)==null?void 0:v.headers)&&new Headers(C.init.headers)}}return{type:Dn.data,data:C}}function uI(n,e,t,i){let s=n.createURL(R1(e)).toString(),r={signal:t};if(i&&go(i.formMethod)){let{formMethod:o,formEncType:a,formData:l}=i;r.method=o.toUpperCase(),r.body=a==="application/x-www-form-urlencoded"?x1(l):l}return new Request(s,r)}function x1(n){let e=new URLSearchParams;for(let[t,i]of n.entries())e.append(t,i instanceof File?i.name:i);return e}function nX(n,e,t,i,s){let r={},o=null,a,l=!1,g={};return t.forEach((u,C)=>{let d=e[C].route.id;if(Ft(!ic(u),"Cannot handle redirect results in processLoaderData"),$I(u)){let h=Tg(n,d),f=u.error;i&&(f=Object.values(i)[0],i=void 0),o=o||{},o[h.route.id]==null&&(o[h.route.id]=f),r[d]=void 0,l||(l=!0,a=G1(u.error)?u.error.status:500),u.headers&&(g[d]=u.headers)}else ll(u)?(s.set(d,u.deferredData),r[d]=u.deferredData.data):r[d]=u.data,u.statusCode!=null&&u.statusCode!==200&&!l&&(a=u.statusCode),u.headers&&(g[d]=u.headers)}),i&&(o=i,r[Object.keys(i)[0]]=void 0),{loaderData:r,errors:o,statusCode:a||200,loaderHeaders:g}}function P2(n,e,t,i,s,r,o,a){let{loaderData:l,errors:g}=nX(e,t,i,s,a);for(let u=0;ui.route.id===e)+1):[...n]).reverse().find(i=>i.route.hasErrorBoundary===!0)||n[0]}function J2(n){let e=n.find(t=>t.index||!t.path||t.path==="/")||{id:"__shim-error-route__"};return{matches:[{params:{},pathname:"",pathnameBase:"",route:e}],route:e}}function gr(n,e){let{pathname:t,routeId:i,method:s,type:r}=e===void 0?{}:e,o="Unknown Server Error",a="Unknown @remix-run/router error";return n===400?(o="Bad Request",s&&t&&i?a="You made a "+s+' request to "'+t+'" but '+('did not provide a `loader` for route "'+i+'", ')+"so there is no way to handle the request.":r==="defer-action"&&(a="defer() is not supported in actions")):n===403?(o="Forbidden",a='Route "'+i+'" does not match URL "'+t+'"'):n===404?(o="Not Found",a='No route matches URL "'+t+'"'):n===405&&(o="Method Not Allowed",s&&t&&i?a="You made a "+s.toUpperCase()+' request to "'+t+'" but '+('did not provide an `action` for route "'+i+'", ')+"so there is no way to handle the request.":s&&(a='Invalid request method "'+s.toUpperCase()+'"')),new Lv(n||500,o,new Error(a),!0)}function O2(n){for(let e=n.length-1;e>=0;e--){let t=n[e];if(ic(t))return t}}function R1(n){let e=typeof n=="string"?Wo(n):n;return wl(_t({},e,{hash:""}))}function iX(n,e){return n.pathname!==e.pathname||n.search!==e.search?!1:n.hash===""?e.hash!=="":n.hash===e.hash?!0:e.hash!==""}function ll(n){return n.type===Dn.deferred}function $I(n){return n.type===Dn.error}function ic(n){return(n&&n.type)===Dn.redirect}function sX(n){let e=n;return e&&typeof e=="object"&&typeof e.data=="object"&&typeof e.subscribe=="function"&&typeof e.cancel=="function"&&typeof e.resolveData=="function"}function rX(n){return n!=null&&typeof n.status=="number"&&typeof n.statusText=="string"&&typeof n.headers=="object"&&typeof n.body<"u"}function oX(n){return PH.has(n.toLowerCase())}function go(n){return DH.has(n.toLowerCase())}async function Q2(n,e,t,i,s,r){for(let o=0;oC.route.id===l.route.id),u=g!=null&&!S1(g,l)&&(r&&r[l.route.id])!==void 0;if(ll(a)&&(s||u)){let C=i[o];Ft(C,"Expected an AbortSignal for revalidating fetcher deferred result"),await W1(a,C,s).then(d=>{d&&(t[o]=d||t[o])})}}}async function W1(n,e,t){if(t===void 0&&(t=!1),!await n.deferredData.resolveData(e)){if(t)try{return{type:Dn.data,data:n.deferredData.unwrappedData}}catch(s){return{type:Dn.error,error:s}}return{type:Dn.data,data:n.deferredData.data}}}function Ev(n){return new URLSearchParams(n).getAll("index").some(e=>e==="")}function j2(n,e){let{route:t,pathname:i,params:s}=n;return{id:t.id,pathname:i,params:s,data:e[t.id],handle:t.handle}}function _0(n,e){let t=typeof e=="string"?Wo(e).search:e.search;if(n[n.length-1].route.index&&Ev(t||""))return n[n.length-1];let i=OA(n);return i[i.length-1]}/** + */function _t(){return _t=Object.assign?Object.assign.bind():function(n){for(var e=1;e"u")throw new Error(e)}function Ac(n,e){if(!n){typeof console<"u"&&console.warn(e);try{throw new Error(e)}catch{}}}function vH(){return Math.random().toString(36).substr(2,8)}function z2(n,e){return{usr:n.state,key:n.key,idx:e}}function xu(n,e,t,i){return t===void 0&&(t=null),_t({pathname:typeof n=="string"?n:n.pathname,search:"",hash:""},typeof e=="string"?Wo(e):e,{state:t,key:e&&e.key||i||vH()})}function wl(n){let{pathname:e="/",search:t="",hash:i=""}=n;return t&&t!=="?"&&(e+=t.charAt(0)==="?"?t:"?"+t),i&&i!=="#"&&(e+=i.charAt(0)==="#"?i:"#"+i),e}function Wo(n){let e={};if(n){let t=n.indexOf("#");t>=0&&(e.hash=n.substr(t),n=n.substr(0,t));let i=n.indexOf("?");i>=0&&(e.search=n.substr(i),n=n.substr(0,i)),n&&(e.pathname=n)}return e}function yH(n,e,t,i){i===void 0&&(i={});let{window:s=document.defaultView,v5Compat:r=!1}=i,o=s.history,a=Ln.Pop,l=null,g=u();g==null&&(g=0,o.replaceState(_t({},o.state,{idx:g}),""));function u(){return(o.state||{idx:null}).idx}function C(){a=Ln.Pop;let y=u(),A=y==null?null:y-g;g=y,l&&l({action:a,location:v.location,delta:A})}function d(y,A){a=Ln.Push;let b=xu(v.location,y,A);t&&t(b,y),g=u()+1;let m=z2(b,g),B=v.createHref(b);try{o.pushState(m,"",B)}catch{s.location.assign(B)}r&&l&&l({action:a,location:v.location,delta:1})}function h(y,A){a=Ln.Replace;let b=xu(v.location,y,A);t&&t(b,y),g=u();let m=z2(b,g),B=v.createHref(b);o.replaceState(m,"",B),r&&l&&l({action:a,location:v.location,delta:0})}function f(y){let A=s.location.origin!=="null"?s.location.origin:s.location.href,b=typeof y=="string"?y:wl(y);return Ft(A,"No window.location.(origin|href) available to create URL for href: "+b),new URL(b,A)}let v={get action(){return a},get location(){return n(s,o)},listen(y){if(l)throw new Error("A history only accepts one active listener");return s.addEventListener(K2,C),l=y,()=>{s.removeEventListener(K2,C),l=null}},createHref(y){return e(s,y)},createURL:f,encodeLocation(y){let A=f(y);return{pathname:A.pathname,search:A.search,hash:A.hash}},push:d,replace:h,go(y){return o.go(y)}};return v}var Dn;(function(n){n.data="data",n.deferred="deferred",n.redirect="redirect",n.error="error"})(Dn||(Dn={}));const GH=new Set(["lazy","caseSensitive","path","id","index","children"]);function BH(n){return n.index===!0}function U0(n,e,t,i){return t===void 0&&(t=[]),i===void 0&&(i={}),n.map((s,r)=>{let o=[...t,r],a=typeof s.id=="string"?s.id:o.join("-");if(Ft(s.index!==!0||!s.children,"Cannot specify children on an index route"),Ft(!i[a],'Found a route id collision on id "'+a+`". Route id's must be globally unique within Data Router usages`),BH(s)){let l=_t({},s,e(s),{id:a});return i[a]=l,l}else{let l=_t({},s,e(s),{id:a,children:void 0});return i[a]=l,s.children&&(l.children=U0(s.children,e,o,i)),l}})}function Eg(n,e,t){t===void 0&&(t="/");let i=typeof e=="string"?Wo(e):e,s=wc(i.pathname||"/",t);if(s==null)return null;let r=v1(n);ZH(r);let o=null;for(let a=0;o==null&&a{let l={relativePath:a===void 0?r.path||"":a,caseSensitive:r.caseSensitive===!0,childrenIndex:o,route:r};l.relativePath.startsWith("/")&&(Ft(l.relativePath.startsWith(i),'Absolute route path "'+l.relativePath+'" nested under path '+('"'+i+'" is not valid. An absolute child route path ')+"must start with the combined path of all its parent routes."),l.relativePath=l.relativePath.slice(i.length));let g=bo([i,l.relativePath]),u=t.concat(l);r.children&&r.children.length>0&&(Ft(r.index!==!0,"Index routes must not have child routes. Please remove "+('all child routes from route path "'+g+'".')),v1(r.children,e,u,g)),!(r.path==null&&!r.index)&&e.push({path:g,score:MH(g,r.index),routesMeta:u})};return n.forEach((r,o)=>{var a;if(r.path===""||!((a=r.path)!=null&&a.includes("?")))s(r,o);else for(let l of y1(r.path))s(r,o,l)}),e}function y1(n){let e=n.split("/");if(e.length===0)return[];let[t,...i]=e,s=t.endsWith("?"),r=t.replace(/\?$/,"");if(i.length===0)return s?[r,""]:[r];let o=y1(i.join("/")),a=[];return a.push(...o.map(l=>l===""?r:[r,l].join("/"))),s&&a.push(...o),a.map(l=>n.startsWith("/")&&l===""?"/":l)}function ZH(n){n.sort((e,t)=>e.score!==t.score?t.score-e.score:NH(e.routesMeta.map(i=>i.childrenIndex),t.routesMeta.map(i=>i.childrenIndex)))}const wH=/^:\w+$/,SH=3,xH=2,RH=1,WH=10,VH=-2,L2=n=>n==="*";function MH(n,e){let t=n.split("/"),i=t.length;return t.some(L2)&&(i+=VH),e&&(i+=xH),t.filter(s=>!L2(s)).reduce((s,r)=>s+(wH.test(r)?SH:r===""?RH:WH),i)}function NH(n,e){return n.length===e.length&&n.slice(0,-1).every((i,s)=>i===e[s])?n[n.length-1]-e[e.length-1]:0}function HH(n,e){let{routesMeta:t}=n,i={},s="/",r=[];for(let o=0;o{if(u==="*"){let d=a[C]||"";o=r.slice(0,r.length-d.length).replace(/(.)\/+$/,"$1")}return g[u]=KH(a[C]||"",u),g},{}),pathname:r,pathnameBase:o,pattern:n}}function FH(n,e,t){e===void 0&&(e=!1),t===void 0&&(t=!0),Ac(n==="*"||!n.endsWith("*")||n.endsWith("/*"),'Route path "'+n+'" will be treated as if it were '+('"'+n.replace(/\*$/,"/*")+'" because the `*` character must ')+"always follow a `/` in the pattern. To get rid of this warning, "+('please change the route path to "'+n.replace(/\*$/,"/*")+'".'));let i=[],s="^"+n.replace(/\/*\*?$/,"").replace(/^\/*/,"/").replace(/[\\.*+^$?{}|()[\]]/g,"\\$&").replace(/\/:(\w+)/g,(o,a)=>(i.push(a),"/([^\\/]+)"));return n.endsWith("*")?(i.push("*"),s+=n==="*"||n==="/*"?"(.*)$":"(?:\\/(.+)|\\/*)$"):t?s+="\\/*$":n!==""&&n!=="/"&&(s+="(?:(?=\\/|$))"),[new RegExp(s,e?void 0:"i"),i]}function YH(n){try{return decodeURI(n)}catch(e){return Ac(!1,'The URL path "'+n+'" could not be decoded because it is is a malformed URL segment. This is probably due to a bad percent '+("encoding ("+e+").")),n}}function KH(n,e){try{return decodeURIComponent(n)}catch(t){return Ac(!1,'The value for the URL param "'+e+'" will not be decoded because'+(' the string "'+n+'" is a malformed URL segment. This is probably')+(" due to a bad percent encoding ("+t+").")),n}}function wc(n,e){if(e==="/")return n;if(!n.toLowerCase().startsWith(e.toLowerCase()))return null;let t=e.endsWith("/")?e.length-1:e.length,i=n.charAt(t);return i&&i!=="/"?null:n.slice(t)||"/"}function zH(n,e){e===void 0&&(e="/");let{pathname:t,search:i="",hash:s=""}=typeof n=="string"?Wo(n):n;return{pathname:t?t.startsWith("/")?t:LH(t,e):e,search:TH(i),hash:kH(s)}}function LH(n,e){let t=e.replace(/\/+$/,"").split("/");return n.split("/").forEach(s=>{s===".."?t.length>1&&t.pop():s!=="."&&t.push(s)}),t.length>1?t.join("/"):"/"}function $f(n,e,t,i){return"Cannot include a '"+n+"' character in a manually specified "+("`to."+e+"` field ["+JSON.stringify(i)+"]. Please separate it out to the ")+("`to."+t+"` field. Alternatively you may provide the full path as ")+'a string in and the router will parse it for you.'}function OA(n){return n.filter((e,t)=>t===0||e.route.path&&e.route.path.length>0)}function zv(n,e,t,i){i===void 0&&(i=!1);let s;typeof n=="string"?s=Wo(n):(s=_t({},n),Ft(!s.pathname||!s.pathname.includes("?"),$f("?","pathname","search",s)),Ft(!s.pathname||!s.pathname.includes("#"),$f("#","pathname","hash",s)),Ft(!s.search||!s.search.includes("#"),$f("#","search","hash",s)));let r=n===""||s.pathname==="",o=r?"/":s.pathname,a;if(i||o==null)a=t;else{let C=e.length-1;if(o.startsWith("..")){let d=o.split("/");for(;d[0]==="..";)d.shift(),C-=1;s.pathname=d.join("/")}a=C>=0?e[C]:"/"}let l=zH(s,a),g=o&&o!=="/"&&o.endsWith("/"),u=(r||o===".")&&t.endsWith("/");return!l.pathname.endsWith("/")&&(g||u)&&(l.pathname+="/"),l}const bo=n=>n.join("/").replace(/\/\/+/g,"/"),EH=n=>n.replace(/\/+$/,"").replace(/^\/*/,"/"),TH=n=>!n||n==="?"?"":n.startsWith("?")?n:"?"+n,kH=n=>!n||n==="#"?"":n.startsWith("#")?n:"#"+n;class Lv{constructor(e,t,i,s){s===void 0&&(s=!1),this.status=e,this.statusText=t||"",this.internal=s,i instanceof Error?(this.data=i.toString(),this.error=i):this.data=i}}function G1(n){return n!=null&&typeof n.status=="number"&&typeof n.statusText=="string"&&typeof n.internal=="boolean"&&"data"in n}const B1=["post","put","patch","delete"],DH=new Set(B1),UH=["get",...B1],PH=new Set(UH),_H=new Set([301,302,303,307,308]),JH=new Set([307,308]),em={state:"idle",location:void 0,formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0},OH={state:"idle",data:void 0,formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0},E2={state:"unblocked",proceed:void 0,reset:void 0,location:void 0},Z1=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,w1=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u",QH=!w1,jH=n=>({hasErrorBoundary:!!n.hasErrorBoundary});function qH(n){Ft(n.routes.length>0,"You must provide a non-empty routes array to createRouter");let e;if(n.mapRouteProperties)e=n.mapRouteProperties;else if(n.detectErrorBoundary){let D=n.detectErrorBoundary;e=$=>({hasErrorBoundary:D($)})}else e=jH;let t={},i=U0(n.routes,e,void 0,t),s,r=n.basename||"/",o=_t({v7_normalizeFormMethod:!1,v7_prependBasename:!1},n.future),a=null,l=new Set,g=null,u=null,C=null,d=n.hydrationData!=null,h=Eg(i,n.history.location,r),f=null;if(h==null){let D=gr(404,{pathname:n.history.location.pathname}),{matches:$,route:Ie}=J2(i);h=$,f={[Ie.id]:D}}let v=!h.some(D=>D.route.lazy)&&(!h.some(D=>D.route.loader)||n.hydrationData!=null),y,A={historyAction:n.history.action,location:n.history.location,matches:h,initialized:v,navigation:em,restoreScrollPosition:n.hydrationData!=null?!1:null,preventScrollReset:!1,revalidation:"idle",loaderData:n.hydrationData&&n.hydrationData.loaderData||{},actionData:n.hydrationData&&n.hydrationData.actionData||null,errors:n.hydrationData&&n.hydrationData.errors||f,fetchers:new Map,blockers:new Map},b=Ln.Pop,m=!1,B,S=!1,x=!1,R=[],M=[],Z=new Map,V=0,N=-1,P=new Map,U=new Set,q=new Map,ie=new Map,he=new Map,Ce=!1;function z(){return a=n.history.listen(D=>{let{action:$,location:Ie,delta:ye}=D;if(Ce){Ce=!1;return}Ac(he.size===0||ye!=null,"You are trying to use a blocker on a POP navigation to a location that was not created by @remix-run/router. This will fail silently in production. This can happen if you are navigating outside the router via `window.history.pushState`/`window.location.hash` instead of using router navigation APIs. This can also happen if you are using createHashRouter and the user manually changes the URL.");let be=de({currentLocation:A.location,nextLocation:Ie,historyAction:$});if(be&&ye!=null){Ce=!0,n.history.go(ye*-1),X(be,{state:"blocked",location:Ie,proceed(){X(be,{state:"proceeding",proceed:void 0,reset:void 0,location:Ie}),n.history.go(ye)},reset(){T(be),le({blockers:new Map(y.state.blockers)})}});return}return Ze($,Ie)}),A.initialized||Ze(Ln.Pop,A.location),y}function Q(){a&&a(),l.clear(),B&&B.abort(),A.fetchers.forEach((D,$)=>Fe($)),A.blockers.forEach((D,$)=>T($))}function J(D){return l.add(D),()=>l.delete(D)}function le(D){A=_t({},A,D),l.forEach($=>$(A))}function se(D,$){var Ie,ye;let be=A.actionData!=null&&A.navigation.formMethod!=null&&go(A.navigation.formMethod)&&A.navigation.state==="loading"&&((Ie=D.state)==null?void 0:Ie._isRedirect)!==!0,Se;$.actionData?Object.keys($.actionData).length>0?Se=$.actionData:Se=null:be?Se=A.actionData:Se=null;let ze=$.loaderData?_2(A.loaderData,$.loaderData,$.matches||[],$.errors):A.loaderData;for(let[Ke]of he)T(Ke);let Ye=m===!0||A.navigation.formMethod!=null&&go(A.navigation.formMethod)&&((ye=D.state)==null?void 0:ye._isRedirect)!==!0;s&&(i=s,s=void 0),le(_t({},$,{actionData:Se,loaderData:ze,historyAction:b,location:D,initialized:!0,navigation:em,revalidation:"idle",restoreScrollPosition:lt(D,$.matches||A.matches),preventScrollReset:Ye,blockers:new Map(A.blockers)})),S||b===Ln.Pop||(b===Ln.Push?n.history.push(D,D.state):b===Ln.Replace&&n.history.replace(D,D.state)),b=Ln.Pop,m=!1,S=!1,x=!1,R=[],M=[]}async function te(D,$){if(typeof D=="number"){n.history.go(D);return}let Ie=P0(A.location,A.matches,r,o.v7_prependBasename,D,$?.fromRouteId,$?.relative),{path:ye,submission:be,error:Se}=T2(o.v7_normalizeFormMethod,!1,Ie,$),ze=A.location,Ye=xu(A.location,ye,$&&$.state);Ye=_t({},Ye,n.history.encodeLocation(Ye));let Ke=$&&$.replace!=null?$.replace:void 0,_=Ln.Push;Ke===!0?_=Ln.Replace:Ke===!1||be!=null&&go(be.formMethod)&&be.formAction===A.location.pathname+A.location.search&&(_=Ln.Replace);let ce=$&&"preventScrollReset"in $?$.preventScrollReset===!0:void 0,Ge=de({currentLocation:ze,nextLocation:Ye,historyAction:_});if(Ge){X(Ge,{state:"blocked",location:Ye,proceed(){X(Ge,{state:"proceeding",proceed:void 0,reset:void 0,location:Ye}),te(D,$)},reset(){T(Ge),le({blockers:new Map(A.blockers)})}});return}return await Ze(_,Ye,{submission:be,pendingError:Se,preventScrollReset:ce,replace:$&&$.replace})}function ge(){if(we(),le({revalidation:"loading"}),A.navigation.state!=="submitting"){if(A.navigation.state==="idle"){Ze(A.historyAction,A.location,{startUninterruptedRevalidation:!0});return}Ze(b||A.historyAction,A.navigation.location,{overrideNavigation:A.navigation})}}async function Ze(D,$,Ie){B&&B.abort(),B=null,b=D,S=(Ie&&Ie.startUninterruptedRevalidation)===!0,Ee(A.location,A.matches),m=(Ie&&Ie.preventScrollReset)===!0;let ye=s||i,be=Ie&&Ie.overrideNavigation,Se=Eg(ye,$,r);if(!Se){let Ne=gr(404,{pathname:$.pathname}),{matches:Te,route:At}=J2(ye);xe(),se($,{matches:Te,loaderData:{},errors:{[At.id]:Ne}});return}if(A.initialized&&iX(A.location,$)&&!(Ie&&Ie.submission&&go(Ie.submission.formMethod))){se($,{matches:Se});return}B=new AbortController;let ze=CI(n.history,$,B.signal,Ie&&Ie.submission),Ye,Ke;if(Ie&&Ie.pendingError)Ke={[Tg(Se).route.id]:Ie.pendingError};else if(Ie&&Ie.submission&&go(Ie.submission.formMethod)){let Ne=await Re(ze,$,Ie.submission,Se,{replace:Ie.replace});if(Ne.shortCircuited)return;Ye=Ne.pendingActionData,Ke=Ne.pendingActionError,be=_t({state:"loading",location:$},Ie.submission),ze=new Request(ze.url,{signal:ze.signal})}let{shortCircuited:_,loaderData:ce,errors:Ge}=await O(ze,$,Se,be,Ie&&Ie.submission,Ie&&Ie.fetcherSubmission,Ie&&Ie.replace,Ye,Ke);_||(B=null,se($,_t({matches:Se},Ye?{actionData:Ye}:{},{loaderData:ce,errors:Ge})))}async function Re(D,$,Ie,ye,be){we();let Se=_t({state:"submitting",location:$},Ie);le({navigation:Se});let ze,Ye=_0(ye,$);if(!Ye.route.action&&!Ye.route.lazy)ze={type:Dn.error,error:gr(405,{method:D.method,pathname:$.pathname,routeId:Ye.route.id})};else if(ze=await uI("action",D,Ye,ye,t,e,r),D.signal.aborted)return{shortCircuited:!0};if(ic(ze)){let Ke;return be&&be.replace!=null?Ke=be.replace:Ke=ze.location===A.location.pathname+A.location.search,await Be(A,ze,{submission:Ie,replace:Ke}),{shortCircuited:!0}}if(eu(ze)){let Ke=Tg(ye,Ye.route.id);return(be&&be.replace)!==!0&&(b=Ln.Push),{pendingActionData:{},pendingActionError:{[Ke.route.id]:ze.error}}}if(ll(ze))throw gr(400,{type:"defer-action"});return{pendingActionData:{[Ye.route.id]:ze.data}}}async function O(D,$,Ie,ye,be,Se,ze,Ye,Ke){let _=ye;_||(_=_t({state:"loading",location:$,formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0},be));let ce=be||Se?be||Se:_.formMethod&&_.formAction&&_.formData&&_.formEncType?{formMethod:_.formMethod,formAction:_.formAction,formData:_.formData,formEncType:_.formEncType}:void 0,Ge=s||i,[Ne,Te]=k2(n.history,A,Ie,ce,$,x,R,M,q,Ge,r,Ye,Ke);if(xe($t=>!(Ie&&Ie.some(pi=>pi.route.id===$t))||Ne&&Ne.some(pi=>pi.route.id===$t)),Ne.length===0&&Te.length===0){let $t=nt();return se($,_t({matches:Ie,loaderData:{},errors:Ke||null},Ye?{actionData:Ye}:{},$t?{fetchers:new Map(A.fetchers)}:{})),{shortCircuited:!0}}if(!S){Te.forEach(pi=>{let F=A.fetchers.get(pi.key),ae={state:"loading",data:F&&F.data,formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0," _hasFetcherDoneAnything ":!0};A.fetchers.set(pi.key,ae)});let $t=Ye||A.actionData;le(_t({navigation:_},$t?Object.keys($t).length===0?{actionData:null}:{actionData:$t}:{},Te.length>0?{fetchers:new Map(A.fetchers)}:{}))}N=++V,Te.forEach($t=>{$t.controller&&Z.set($t.key,$t.controller)});let At=()=>Te.forEach($t=>qe($t.key));B&&B.signal.addEventListener("abort",At);let{results:Xt,loaderResults:Gn,fetcherResults:hi}=await fe(A.matches,Ie,Ne,Te,D);if(D.signal.aborted)return{shortCircuited:!0};B&&B.signal.removeEventListener("abort",At),Te.forEach($t=>Z.delete($t.key));let Lt=O2(Xt);if(Lt)return await Be(A,Lt,{replace:ze}),{shortCircuited:!0};let{loaderData:Hn,errors:Ai}=P2(A,Ie,Ne,Gn,Ke,Te,hi,ie);ie.forEach(($t,pi)=>{$t.subscribe(F=>{(F||$t.done)&&ie.delete(pi)})});let vr=nt(),No=Ct(N),Pr=vr||No||Te.length>0;return _t({loaderData:Hn,errors:Ai},Pr?{fetchers:new Map(A.fetchers)}:{})}function ot(D){return A.fetchers.get(D)||OH}function ct(D,$,Ie,ye){if(QH)throw new Error("router.fetch() was called during the server render, but it shouldn't be. You are likely calling a useFetcher() method in the body of your component. Try moving it to a useEffect or a callback.");Z.has(D)&&qe(D);let be=s||i,Se=P0(A.location,A.matches,r,o.v7_prependBasename,Ie,$,ye?.relative),ze=Eg(be,Se,r);if(!ze){Pe(D,$,gr(404,{pathname:Se}));return}let{path:Ye,submission:Ke}=T2(o.v7_normalizeFormMethod,!0,Se,ye),_=_0(ze,Ye);if(m=(ye&&ye.preventScrollReset)===!0,Ke&&go(Ke.formMethod)){Me(D,$,Ye,_,ze,Ke);return}q.set(D,{routeId:$,path:Ye}),Ue(D,$,Ye,_,ze,Ke)}async function Me(D,$,Ie,ye,be,Se){if(we(),q.delete(D),!ye.route.action&&!ye.route.lazy){let Ae=gr(405,{method:Se.formMethod,pathname:Ie,routeId:$});Pe(D,$,Ae);return}let ze=A.fetchers.get(D),Ye=_t({state:"submitting"},Se,{data:ze&&ze.data," _hasFetcherDoneAnything ":!0});A.fetchers.set(D,Ye),le({fetchers:new Map(A.fetchers)});let Ke=new AbortController,_=CI(n.history,Ie,Ke.signal,Se);Z.set(D,Ke);let ce=await uI("action",_,ye,be,t,e,r);if(_.signal.aborted){Z.get(D)===Ke&&Z.delete(D);return}if(ic(ce)){Z.delete(D),U.add(D);let Ae=_t({state:"loading"},Se,{data:void 0," _hasFetcherDoneAnything ":!0});return A.fetchers.set(D,Ae),le({fetchers:new Map(A.fetchers)}),Be(A,ce,{submission:Se,isFetchActionRedirect:!0})}if(eu(ce)){Pe(D,$,ce.error);return}if(ll(ce))throw gr(400,{type:"defer-action"});let Ge=A.navigation.location||A.location,Ne=CI(n.history,Ge,Ke.signal),Te=s||i,At=A.navigation.state!=="idle"?Eg(Te,A.navigation.location,r):A.matches;Ft(At,"Didn't find any matches after fetcher action");let Xt=++V;P.set(D,Xt);let Gn=_t({state:"loading",data:ce.data},Se,{" _hasFetcherDoneAnything ":!0});A.fetchers.set(D,Gn);let[hi,Lt]=k2(n.history,A,At,Se,Ge,x,R,M,q,Te,r,{[ye.route.id]:ce.data},void 0);Lt.filter(Ae=>Ae.key!==D).forEach(Ae=>{let re=Ae.key,ve=A.fetchers.get(re),rt={state:"loading",data:ve&&ve.data,formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0," _hasFetcherDoneAnything ":!0};A.fetchers.set(re,rt),Ae.controller&&Z.set(re,Ae.controller)}),le({fetchers:new Map(A.fetchers)});let Hn=()=>Lt.forEach(Ae=>qe(Ae.key));Ke.signal.addEventListener("abort",Hn);let{results:Ai,loaderResults:vr,fetcherResults:No}=await fe(A.matches,At,hi,Lt,Ne);if(Ke.signal.aborted)return;Ke.signal.removeEventListener("abort",Hn),P.delete(D),Z.delete(D),Lt.forEach(Ae=>Z.delete(Ae.key));let Pr=O2(Ai);if(Pr)return Be(A,Pr);let{loaderData:$t,errors:pi}=P2(A,A.matches,hi,vr,void 0,Lt,No,ie),F={state:"idle",data:ce.data,formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0," _hasFetcherDoneAnything ":!0};A.fetchers.set(D,F);let ae=Ct(Xt);A.navigation.state==="loading"&&Xt>N?(Ft(b,"Expected pending action"),B&&B.abort(),se(A.navigation.location,{matches:At,loaderData:$t,errors:pi,fetchers:new Map(A.fetchers)})):(le(_t({errors:pi,loaderData:_2(A.loaderData,$t,At,pi)},ae?{fetchers:new Map(A.fetchers)}:{})),x=!1)}async function Ue(D,$,Ie,ye,be,Se){let ze=A.fetchers.get(D),Ye=_t({state:"loading",formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0},Se,{data:ze&&ze.data," _hasFetcherDoneAnything ":!0});A.fetchers.set(D,Ye),le({fetchers:new Map(A.fetchers)});let Ke=new AbortController,_=CI(n.history,Ie,Ke.signal);Z.set(D,Ke);let ce=await uI("loader",_,ye,be,t,e,r);if(ll(ce)&&(ce=await W1(ce,_.signal,!0)||ce),Z.get(D)===Ke&&Z.delete(D),_.signal.aborted)return;if(ic(ce)){U.add(D),await Be(A,ce);return}if(eu(ce)){let Ne=Tg(A.matches,$);A.fetchers.delete(D),le({fetchers:new Map(A.fetchers),errors:{[Ne.route.id]:ce.error}});return}Ft(!ll(ce),"Unhandled fetcher deferred data");let Ge={state:"idle",data:ce.data,formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0," _hasFetcherDoneAnything ":!0};A.fetchers.set(D,Ge),le({fetchers:new Map(A.fetchers)})}async function Be(D,$,Ie){var ye;let{submission:be,replace:Se,isFetchActionRedirect:ze}=Ie===void 0?{}:Ie;$.revalidate&&(x=!0);let Ye=xu(D.location,$.location,_t({_isRedirect:!0},ze?{_isFetchActionRedirect:!0}:{}));if(Ft(Ye,"Expected a location on the redirect navigation"),Z1.test($.location)&&w1&&typeof((ye=window)==null?void 0:ye.location)<"u"){let Te=n.history.createURL($.location),At=wc(Te.pathname,r)==null;if(window.location.origin!==Te.origin||At){Se?window.location.replace($.location):window.location.assign($.location);return}}B=null;let Ke=Se===!0?Ln.Replace:Ln.Push,{formMethod:_,formAction:ce,formEncType:Ge,formData:Ne}=D.navigation;!be&&_&&ce&&Ne&&Ge&&(be={formMethod:_,formAction:ce,formEncType:Ge,formData:Ne}),JH.has($.status)&&be&&go(be.formMethod)?await Ze(Ke,Ye,{submission:_t({},be,{formAction:$.location}),preventScrollReset:m}):ze?await Ze(Ke,Ye,{overrideNavigation:{state:"loading",location:Ye,formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0},fetcherSubmission:be,preventScrollReset:m}):await Ze(Ke,Ye,{overrideNavigation:{state:"loading",location:Ye,formMethod:be?be.formMethod:void 0,formAction:be?be.formAction:void 0,formEncType:be?be.formEncType:void 0,formData:be?be.formData:void 0},preventScrollReset:m})}async function fe(D,$,Ie,ye,be){let Se=await Promise.all([...Ie.map(Ke=>uI("loader",be,Ke,$,t,e,r)),...ye.map(Ke=>Ke.matches&&Ke.match&&Ke.controller?uI("loader",CI(n.history,Ke.path,Ke.controller.signal),Ke.match,Ke.matches,t,e,r):{type:Dn.error,error:gr(404,{pathname:Ke.path})})]),ze=Se.slice(0,Ie.length),Ye=Se.slice(Ie.length);return await Promise.all([Q2(D,Ie,ze,ze.map(()=>be.signal),!1,A.loaderData),Q2(D,ye.map(Ke=>Ke.match),Ye,ye.map(Ke=>Ke.controller?Ke.controller.signal:null),!0)]),{results:Se,loaderResults:ze,fetcherResults:Ye}}function we(){x=!0,R.push(...xe()),q.forEach((D,$)=>{Z.has($)&&(M.push($),qe($))})}function Pe(D,$,Ie){let ye=Tg(A.matches,$);Fe(D),le({errors:{[ye.route.id]:Ie},fetchers:new Map(A.fetchers)})}function Fe(D){Z.has(D)&&qe(D),q.delete(D),P.delete(D),U.delete(D),A.fetchers.delete(D)}function qe(D){let $=Z.get(D);Ft($,"Expected fetch controller: "+D),$.abort(),Z.delete(D)}function at(D){for(let $ of D){let ye={state:"idle",data:ot($).data,formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0," _hasFetcherDoneAnything ":!0};A.fetchers.set($,ye)}}function nt(){let D=[],$=!1;for(let Ie of U){let ye=A.fetchers.get(Ie);Ft(ye,"Expected fetcher: "+Ie),ye.state==="loading"&&(U.delete(Ie),D.push(Ie),$=!0)}return at(D),$}function Ct(D){let $=[];for(let[Ie,ye]of P)if(ye0}function Ht(D,$){let Ie=A.blockers.get(D)||E2;return he.get(D)!==$&&he.set(D,$),Ie}function T(D){A.blockers.delete(D),he.delete(D)}function X(D,$){let Ie=A.blockers.get(D)||E2;Ft(Ie.state==="unblocked"&&$.state==="blocked"||Ie.state==="blocked"&&$.state==="blocked"||Ie.state==="blocked"&&$.state==="proceeding"||Ie.state==="blocked"&&$.state==="unblocked"||Ie.state==="proceeding"&&$.state==="unblocked","Invalid blocker state transition: "+Ie.state+" -> "+$.state),A.blockers.set(D,$),le({blockers:new Map(A.blockers)})}function de(D){let{currentLocation:$,nextLocation:Ie,historyAction:ye}=D;if(he.size===0)return;he.size>1&&Ac(!1,"A router only supports one blocker at a time");let be=Array.from(he.entries()),[Se,ze]=be[be.length-1],Ye=A.blockers.get(Se);if(!(Ye&&Ye.state==="proceeding")&&ze({currentLocation:$,nextLocation:Ie,historyAction:ye}))return Se}function xe(D){let $=[];return ie.forEach((Ie,ye)=>{(!D||D(ye))&&(Ie.cancel(),$.push(ye),ie.delete(ye))}),$}function We(D,$,Ie){if(g=D,C=$,u=Ie||(ye=>ye.key),!d&&A.navigation===em){d=!0;let ye=lt(A.location,A.matches);ye!=null&&le({restoreScrollPosition:ye})}return()=>{g=null,C=null,u=null}}function Ee(D,$){if(g&&u&&C){let Ie=$.map(be=>j2(be,A.loaderData)),ye=u(D,Ie)||D.key;g[ye]=C()}}function lt(D,$){if(g&&u&&C){let Ie=$.map(Se=>j2(Se,A.loaderData)),ye=u(D,Ie)||D.key,be=g[ye];if(typeof be=="number")return be}return null}function Je(D){t={},s=U0(D,e,void 0,t)}return y={get basename(){return r},get state(){return A},get routes(){return i},initialize:z,subscribe:J,enableScrollRestoration:We,navigate:te,fetch:ct,revalidate:ge,createHref:D=>n.history.createHref(D),encodeLocation:D=>n.history.encodeLocation(D),getFetcher:ot,deleteFetcher:Fe,dispose:Q,getBlocker:Ht,deleteBlocker:T,_internalFetchControllers:Z,_internalActiveDeferreds:ie,_internalSetRoutes:Je},y}function $H(n){return n!=null&&"formData"in n}function P0(n,e,t,i,s,r,o){let a,l;if(r!=null&&o!=="path"){a=[];for(let u of e)if(a.push(u),u.route.id===r){l=u;break}}else a=e,l=e[e.length-1];let g=zv(s||".",OA(a).map(u=>u.pathnameBase),wc(n.pathname,t)||n.pathname,o==="path");return s==null&&(g.search=n.search,g.hash=n.hash),(s==null||s===""||s===".")&&l&&l.route.index&&!Ev(g.search)&&(g.search=g.search?g.search.replace(/^\?/,"?index&"):"?index"),i&&t!=="/"&&(g.pathname=g.pathname==="/"?t:bo([t,g.pathname])),wl(g)}function T2(n,e,t,i){if(!i||!$H(i))return{path:t};if(i.formMethod&&!oX(i.formMethod))return{path:t,error:gr(405,{method:i.formMethod})};let s;if(i.formData){let a=i.formMethod||"get";if(s={formMethod:n?a.toUpperCase():a.toLowerCase(),formAction:R1(t),formEncType:i&&i.formEncType||"application/x-www-form-urlencoded",formData:i.formData},go(s.formMethod))return{path:t,submission:s}}let r=Wo(t),o=x1(i.formData);return e&&r.search&&Ev(r.search)&&o.append("index",""),r.search="?"+o,{path:wl(r),submission:s}}function eX(n,e){let t=n;if(e){let i=n.findIndex(s=>s.route.id===e);i>=0&&(t=n.slice(0,i))}return t}function k2(n,e,t,i,s,r,o,a,l,g,u,C,d){let h=d?Object.values(d)[0]:C?Object.values(C)[0]:void 0,f=n.createURL(e.location),v=n.createURL(s),y=d?Object.keys(d)[0]:void 0,b=eX(t,y).filter((B,S)=>{if(B.route.lazy)return!0;if(B.route.loader==null)return!1;if(tX(e.loaderData,e.matches[S],B)||o.some(M=>M===B.route.id))return!0;let x=e.matches[S],R=B;return D2(B,_t({currentUrl:f,currentParams:x.params,nextUrl:v,nextParams:R.params},i,{actionResult:h,defaultShouldRevalidate:r||f.pathname+f.search===v.pathname+v.search||f.search!==v.search||S1(x,R)}))}),m=[];return l.forEach((B,S)=>{if(!t.some(Z=>Z.route.id===B.routeId))return;let x=Eg(g,B.path,u);if(!x){m.push({key:S,routeId:B.routeId,path:B.path,matches:null,match:null,controller:null});return}let R=_0(x,B.path);if(a.includes(S)){m.push({key:S,routeId:B.routeId,path:B.path,matches:x,match:R,controller:new AbortController});return}D2(R,_t({currentUrl:f,currentParams:e.matches[e.matches.length-1].params,nextUrl:v,nextParams:t[t.length-1].params},i,{actionResult:h,defaultShouldRevalidate:r}))&&m.push({key:S,routeId:B.routeId,path:B.path,matches:x,match:R,controller:new AbortController})}),[b,m]}function tX(n,e,t){let i=!e||t.route.id!==e.route.id,s=n[t.route.id]===void 0;return i||s}function S1(n,e){let t=n.route.path;return n.pathname!==e.pathname||t!=null&&t.endsWith("*")&&n.params["*"]!==e.params["*"]}function D2(n,e){if(n.route.shouldRevalidate){let t=n.route.shouldRevalidate(e);if(typeof t=="boolean")return t}return e.defaultShouldRevalidate}async function U2(n,e,t){if(!n.lazy)return;let i=await n.lazy();if(!n.lazy)return;let s=t[n.id];Ft(s,"No route found in manifest");let r={};for(let o in i){let l=s[o]!==void 0&&o!=="hasErrorBoundary";Ac(!l,'Route "'+s.id+'" has a static property "'+o+'" defined but its lazy function is also returning a value for this property. '+('The lazy route property "'+o+'" will be ignored.')),!l&&!GH.has(o)&&(r[o]=i[o])}Object.assign(s,r),Object.assign(s,_t({},e(s),{lazy:void 0}))}async function uI(n,e,t,i,s,r,o,a,l,g){a===void 0&&(a=!1),l===void 0&&(l=!1);let u,C,d,h=y=>{let A,b=new Promise((m,B)=>A=B);return d=()=>A(),e.signal.addEventListener("abort",d),Promise.race([y({request:e,params:t.params,context:g}),b])};try{let y=t.route[n];if(t.route.lazy)if(y)C=(await Promise.all([h(y),U2(t.route,r,s)]))[0];else if(await U2(t.route,r,s),y=t.route[n],y)C=await h(y);else if(n==="action"){let A=new URL(e.url),b=A.pathname+A.search;throw gr(405,{method:e.method,pathname:b,routeId:t.route.id})}else return{type:Dn.data,data:void 0};else if(y)C=await h(y);else{let A=new URL(e.url),b=A.pathname+A.search;throw gr(404,{pathname:b})}Ft(C!==void 0,"You defined "+(n==="action"?"an action":"a loader")+" for route "+('"'+t.route.id+"\" but didn't return anything from your `"+n+"` ")+"function. Please return a value or `null`.")}catch(y){u=Dn.error,C=y}finally{d&&e.signal.removeEventListener("abort",d)}if(rX(C)){let y=C.status;if(_H.has(y)){let m=C.headers.get("Location");if(Ft(m,"Redirects returned/thrown from loaders/actions must have a Location header"),!Z1.test(m))m=P0(new URL(e.url),i.slice(0,i.indexOf(t)+1),o,!0,m);else if(!a){let B=new URL(e.url),S=m.startsWith("//")?new URL(B.protocol+m):new URL(m),x=wc(S.pathname,o)!=null;S.origin===B.origin&&x&&(m=S.pathname+S.search+S.hash)}if(a)throw C.headers.set("Location",m),C;return{type:Dn.redirect,status:y,location:m,revalidate:C.headers.get("X-Remix-Revalidate")!==null}}if(l)throw{type:u||Dn.data,response:C};let A,b=C.headers.get("Content-Type");return b&&/\bapplication\/json\b/.test(b)?A=await C.json():A=await C.text(),u===Dn.error?{type:u,error:new Lv(y,C.statusText,A),headers:C.headers}:{type:Dn.data,data:A,statusCode:C.status,headers:C.headers}}if(u===Dn.error)return{type:u,error:C};if(sX(C)){var f,v;return{type:Dn.deferred,deferredData:C,statusCode:(f=C.init)==null?void 0:f.status,headers:((v=C.init)==null?void 0:v.headers)&&new Headers(C.init.headers)}}return{type:Dn.data,data:C}}function CI(n,e,t,i){let s=n.createURL(R1(e)).toString(),r={signal:t};if(i&&go(i.formMethod)){let{formMethod:o,formEncType:a,formData:l}=i;r.method=o.toUpperCase(),r.body=a==="application/x-www-form-urlencoded"?x1(l):l}return new Request(s,r)}function x1(n){let e=new URLSearchParams;for(let[t,i]of n.entries())e.append(t,i instanceof File?i.name:i);return e}function nX(n,e,t,i,s){let r={},o=null,a,l=!1,g={};return t.forEach((u,C)=>{let d=e[C].route.id;if(Ft(!ic(u),"Cannot handle redirect results in processLoaderData"),eu(u)){let h=Tg(n,d),f=u.error;i&&(f=Object.values(i)[0],i=void 0),o=o||{},o[h.route.id]==null&&(o[h.route.id]=f),r[d]=void 0,l||(l=!0,a=G1(u.error)?u.error.status:500),u.headers&&(g[d]=u.headers)}else ll(u)?(s.set(d,u.deferredData),r[d]=u.deferredData.data):r[d]=u.data,u.statusCode!=null&&u.statusCode!==200&&!l&&(a=u.statusCode),u.headers&&(g[d]=u.headers)}),i&&(o=i,r[Object.keys(i)[0]]=void 0),{loaderData:r,errors:o,statusCode:a||200,loaderHeaders:g}}function P2(n,e,t,i,s,r,o,a){let{loaderData:l,errors:g}=nX(e,t,i,s,a);for(let u=0;ui.route.id===e)+1):[...n]).reverse().find(i=>i.route.hasErrorBoundary===!0)||n[0]}function J2(n){let e=n.find(t=>t.index||!t.path||t.path==="/")||{id:"__shim-error-route__"};return{matches:[{params:{},pathname:"",pathnameBase:"",route:e}],route:e}}function gr(n,e){let{pathname:t,routeId:i,method:s,type:r}=e===void 0?{}:e,o="Unknown Server Error",a="Unknown @remix-run/router error";return n===400?(o="Bad Request",s&&t&&i?a="You made a "+s+' request to "'+t+'" but '+('did not provide a `loader` for route "'+i+'", ')+"so there is no way to handle the request.":r==="defer-action"&&(a="defer() is not supported in actions")):n===403?(o="Forbidden",a='Route "'+i+'" does not match URL "'+t+'"'):n===404?(o="Not Found",a='No route matches URL "'+t+'"'):n===405&&(o="Method Not Allowed",s&&t&&i?a="You made a "+s.toUpperCase()+' request to "'+t+'" but '+('did not provide an `action` for route "'+i+'", ')+"so there is no way to handle the request.":s&&(a='Invalid request method "'+s.toUpperCase()+'"')),new Lv(n||500,o,new Error(a),!0)}function O2(n){for(let e=n.length-1;e>=0;e--){let t=n[e];if(ic(t))return t}}function R1(n){let e=typeof n=="string"?Wo(n):n;return wl(_t({},e,{hash:""}))}function iX(n,e){return n.pathname!==e.pathname||n.search!==e.search?!1:n.hash===""?e.hash!=="":n.hash===e.hash?!0:e.hash!==""}function ll(n){return n.type===Dn.deferred}function eu(n){return n.type===Dn.error}function ic(n){return(n&&n.type)===Dn.redirect}function sX(n){let e=n;return e&&typeof e=="object"&&typeof e.data=="object"&&typeof e.subscribe=="function"&&typeof e.cancel=="function"&&typeof e.resolveData=="function"}function rX(n){return n!=null&&typeof n.status=="number"&&typeof n.statusText=="string"&&typeof n.headers=="object"&&typeof n.body<"u"}function oX(n){return PH.has(n.toLowerCase())}function go(n){return DH.has(n.toLowerCase())}async function Q2(n,e,t,i,s,r){for(let o=0;oC.route.id===l.route.id),u=g!=null&&!S1(g,l)&&(r&&r[l.route.id])!==void 0;if(ll(a)&&(s||u)){let C=i[o];Ft(C,"Expected an AbortSignal for revalidating fetcher deferred result"),await W1(a,C,s).then(d=>{d&&(t[o]=d||t[o])})}}}async function W1(n,e,t){if(t===void 0&&(t=!1),!await n.deferredData.resolveData(e)){if(t)try{return{type:Dn.data,data:n.deferredData.unwrappedData}}catch(s){return{type:Dn.error,error:s}}return{type:Dn.data,data:n.deferredData.data}}}function Ev(n){return new URLSearchParams(n).getAll("index").some(e=>e==="")}function j2(n,e){let{route:t,pathname:i,params:s}=n;return{id:t.id,pathname:i,params:s,data:e[t.id],handle:t.handle}}function _0(n,e){let t=typeof e=="string"?Wo(e).search:e.search;if(n[n.length-1].route.index&&Ev(t||""))return n[n.length-1];let i=OA(n);return i[i.length-1]}/** * React Router v6.11.2 * * Copyright (c) Remix Software Inc. @@ -55,7 +55,7 @@ Error generating stack: `+r.message+` * LICENSE.md file in the root directory of this source tree. * * @license MIT - */function ZA(){return ZA=Object.assign?Object.assign.bind():function(n){for(var e=1;el.pathnameBase)),o=k.useRef(!1);return M1(()=>{o.current=!0}),k.useCallback(function(l,g){if(g===void 0&&(g={}),!o.current)return;if(typeof l=="number"){t.go(l);return}let u=zv(l,JSON.parse(r),s,g.relative==="path");n==null&&e!=="/"&&(u.pathname=u.pathname==="/"?e:bo([e,u.pathname])),(g.replace?t.replace:t.push)(u,g.state,g)},[e,t,r,s,n])}function kv(n,e){let{relative:t}=e===void 0?{}:e,{matches:i}=k.useContext(Hl),{pathname:s}=tC(),r=JSON.stringify(OA(i).map(o=>o.pathnameBase));return k.useMemo(()=>zv(n,JSON.parse(r),s,t==="path"),[n,r,s,t])}function cX(n,e,t){eC()||Ft(!1);let{navigator:i}=k.useContext(Nl),{matches:s}=k.useContext(Hl),r=s[s.length-1],o=r?r.params:{};r&&r.pathname;let a=r?r.pathnameBase:"/";r&&r.route;let l=tC(),g;if(e){var u;let v=typeof e=="string"?Wo(e):e;a==="/"||(u=v.pathname)!=null&&u.startsWith(a)||Ft(!1),g=v}else g=l;let C=g.pathname||"/",d=a==="/"?C:C.slice(a.length)||"/",h=Eg(n,{pathname:d}),f=hX(h&&h.map(v=>Object.assign({},v,{params:Object.assign({},o,v.params),pathname:bo([a,i.encodeLocation?i.encodeLocation(v.pathname).pathname:v.pathname]),pathnameBase:v.pathnameBase==="/"?a:bo([a,i.encodeLocation?i.encodeLocation(v.pathnameBase).pathname:v.pathnameBase])})),s,t);return e&&f?k.createElement(jA.Provider,{value:{location:ZA({pathname:"/",search:"",hash:"",state:null,key:"default"},g),navigationType:Ln.Pop}},f):f}function IX(){let n=mX(),e=G1(n)?n.status+" "+n.statusText:n instanceof Error?n.message:JSON.stringify(n),t=n instanceof Error?n.stack:null,s={padding:"0.5rem",backgroundColor:"rgba(200,200,200, 0.5)"},r=null;return k.createElement(k.Fragment,null,k.createElement("h2",null,"Unexpected Application Error!"),k.createElement("h3",{style:{fontStyle:"italic"}},e),t?k.createElement("pre",{style:s},t):null,r)}const uX=k.createElement(IX,null);class CX extends k.Component{constructor(e){super(e),this.state={location:e.location,revalidation:e.revalidation,error:e.error}}static getDerivedStateFromError(e){return{error:e}}static getDerivedStateFromProps(e,t){return t.location!==e.location||t.revalidation!=="idle"&&e.revalidation==="idle"?{error:e.error,location:e.location,revalidation:e.revalidation}:{error:e.error||t.error,location:t.location,revalidation:e.revalidation||t.revalidation}}componentDidCatch(e,t){console.error("React Router caught the following error during render",e,t)}render(){return this.state.error?k.createElement(Hl.Provider,{value:this.props.routeContext},k.createElement(V1.Provider,{value:this.state.error,children:this.props.component})):this.props.children}}function dX(n){let{routeContext:e,match:t,children:i}=n,s=k.useContext(QA);return s&&s.static&&s.staticContext&&(t.route.errorElement||t.route.ErrorBoundary)&&(s.staticContext._deepestRenderedBoundaryId=t.route.id),k.createElement(Hl.Provider,{value:e},i)}function hX(n,e,t){var i;if(e===void 0&&(e=[]),t===void 0&&(t=null),n==null){var s;if((s=t)!=null&&s.errors)n=t.matches;else return null}let r=n,o=(i=t)==null?void 0:i.errors;if(o!=null){let a=r.findIndex(l=>l.route.id&&o?.[l.route.id]);a>=0||Ft(!1),r=r.slice(0,Math.min(r.length,a+1))}return r.reduceRight((a,l,g)=>{let u=l.route.id?o?.[l.route.id]:null,C=null;t&&(C=l.route.errorElement||uX);let d=e.concat(r.slice(0,g+1)),h=()=>{let f;return u?f=C:l.route.Component?f=k.createElement(l.route.Component,null):l.route.element?f=l.route.element:f=a,k.createElement(dX,{match:l,routeContext:{outlet:a,matches:d,isDataRoute:t!=null},children:f})};return t&&(l.route.ErrorBoundary||l.route.errorElement||g===0)?k.createElement(CX,{location:t.location,revalidation:t.revalidation,component:C,error:u,children:h(),routeContext:{outlet:null,matches:d,isDataRoute:!0}}):h()},null)}var J0;(function(n){n.UseBlocker="useBlocker",n.UseRevalidator="useRevalidator",n.UseNavigateStable="useNavigate"})(J0||(J0={}));var xu;(function(n){n.UseBlocker="useBlocker",n.UseLoaderData="useLoaderData",n.UseActionData="useActionData",n.UseRouteError="useRouteError",n.UseNavigation="useNavigation",n.UseRouteLoaderData="useRouteLoaderData",n.UseMatches="useMatches",n.UseRevalidator="useRevalidator",n.UseNavigateStable="useNavigate",n.UseRouteId="useRouteId"})(xu||(xu={}));function AX(n){let e=k.useContext(QA);return e||Ft(!1),e}function pX(n){let e=k.useContext(Tv);return e||Ft(!1),e}function fX(n){let e=k.useContext(Hl);return e||Ft(!1),e}function N1(n){let e=fX(),t=e.matches[e.matches.length-1];return t.route.id||Ft(!1),t.route.id}function mX(){var n;let e=k.useContext(V1),t=pX(xu.UseRouteError),i=N1(xu.UseRouteError);return e||((n=t.errors)==null?void 0:n[i])}function bX(){let{router:n}=AX(J0.UseNavigateStable),e=N1(xu.UseNavigateStable),t=k.useRef(!1);return M1(()=>{t.current=!0}),k.useCallback(function(s,r){r===void 0&&(r={}),t.current&&(typeof s=="number"?n.navigate(s):n.navigate(s,ZA({fromRouteId:e},r)))},[n,e])}function vX(n){let{fallbackElement:e,router:t}=n,[i,s]=k.useState(t.state);k.useLayoutEffect(()=>t.subscribe(s),[t,s]);let r=k.useMemo(()=>({createHref:t.createHref,encodeLocation:t.encodeLocation,go:l=>t.navigate(l),push:(l,g,u)=>t.navigate(l,{state:g,preventScrollReset:u?.preventScrollReset}),replace:(l,g,u)=>t.navigate(l,{replace:!0,state:g,preventScrollReset:u?.preventScrollReset})}),[t]),o=t.basename||"/",a=k.useMemo(()=>({router:t,navigator:r,static:!1,basename:o}),[t,r,o]);return k.createElement(k.Fragment,null,k.createElement(QA.Provider,{value:a},k.createElement(Tv.Provider,{value:i},k.createElement(GX,{basename:t.basename,location:t.state.location,navigationType:t.state.historyAction,navigator:r},t.state.initialized?k.createElement(yX,{routes:t.routes,state:i}):e))),null)}function yX(n){let{routes:e,state:t}=n;return cX(e,void 0,t)}function GX(n){let{basename:e="/",children:t=null,location:i,navigationType:s=Ln.Pop,navigator:r,static:o=!1}=n;eC()&&Ft(!1);let a=e.replace(/^\/*/,"/"),l=k.useMemo(()=>({basename:a,navigator:r,static:o}),[a,r,o]);typeof i=="string"&&(i=Wo(i));let{pathname:g="/",search:u="",hash:C="",state:d=null,key:h="default"}=i,f=k.useMemo(()=>{let v=wc(g,a);return v==null?null:{location:{pathname:v,search:u,hash:C,state:d,key:h},navigationType:s}},[a,g,u,C,d,h,s]);return f==null?null:k.createElement(Nl.Provider,{value:l},k.createElement(jA.Provider,{children:t,value:f}))}var q2;(function(n){n[n.pending=0]="pending",n[n.success=1]="success",n[n.error=2]="error"})(q2||(q2={}));new Promise(()=>{});function BX(n){let e={hasErrorBoundary:n.ErrorBoundary!=null||n.errorElement!=null};return n.Component&&Object.assign(e,{element:k.createElement(n.Component),Component:void 0}),n.ErrorBoundary&&Object.assign(e,{errorElement:k.createElement(n.ErrorBoundary),ErrorBoundary:void 0}),e}/** + */function ZA(){return ZA=Object.assign?Object.assign.bind():function(n){for(var e=1;el.pathnameBase)),o=k.useRef(!1);return M1(()=>{o.current=!0}),k.useCallback(function(l,g){if(g===void 0&&(g={}),!o.current)return;if(typeof l=="number"){t.go(l);return}let u=zv(l,JSON.parse(r),s,g.relative==="path");n==null&&e!=="/"&&(u.pathname=u.pathname==="/"?e:bo([e,u.pathname])),(g.replace?t.replace:t.push)(u,g.state,g)},[e,t,r,s,n])}function kv(n,e){let{relative:t}=e===void 0?{}:e,{matches:i}=k.useContext(Hl),{pathname:s}=Sc(),r=JSON.stringify(OA(i).map(o=>o.pathnameBase));return k.useMemo(()=>zv(n,JSON.parse(r),s,t==="path"),[n,r,s,t])}function cX(n,e,t){tC()||Ft(!1);let{navigator:i}=k.useContext(Nl),{matches:s}=k.useContext(Hl),r=s[s.length-1],o=r?r.params:{};r&&r.pathname;let a=r?r.pathnameBase:"/";r&&r.route;let l=Sc(),g;if(e){var u;let v=typeof e=="string"?Wo(e):e;a==="/"||(u=v.pathname)!=null&&u.startsWith(a)||Ft(!1),g=v}else g=l;let C=g.pathname||"/",d=a==="/"?C:C.slice(a.length)||"/",h=Eg(n,{pathname:d}),f=hX(h&&h.map(v=>Object.assign({},v,{params:Object.assign({},o,v.params),pathname:bo([a,i.encodeLocation?i.encodeLocation(v.pathname).pathname:v.pathname]),pathnameBase:v.pathnameBase==="/"?a:bo([a,i.encodeLocation?i.encodeLocation(v.pathnameBase).pathname:v.pathnameBase])})),s,t);return e&&f?k.createElement(jA.Provider,{value:{location:ZA({pathname:"/",search:"",hash:"",state:null,key:"default"},g),navigationType:Ln.Pop}},f):f}function IX(){let n=mX(),e=G1(n)?n.status+" "+n.statusText:n instanceof Error?n.message:JSON.stringify(n),t=n instanceof Error?n.stack:null,s={padding:"0.5rem",backgroundColor:"rgba(200,200,200, 0.5)"},r=null;return k.createElement(k.Fragment,null,k.createElement("h2",null,"Unexpected Application Error!"),k.createElement("h3",{style:{fontStyle:"italic"}},e),t?k.createElement("pre",{style:s},t):null,r)}const uX=k.createElement(IX,null);class CX extends k.Component{constructor(e){super(e),this.state={location:e.location,revalidation:e.revalidation,error:e.error}}static getDerivedStateFromError(e){return{error:e}}static getDerivedStateFromProps(e,t){return t.location!==e.location||t.revalidation!=="idle"&&e.revalidation==="idle"?{error:e.error,location:e.location,revalidation:e.revalidation}:{error:e.error||t.error,location:t.location,revalidation:e.revalidation||t.revalidation}}componentDidCatch(e,t){console.error("React Router caught the following error during render",e,t)}render(){return this.state.error?k.createElement(Hl.Provider,{value:this.props.routeContext},k.createElement(V1.Provider,{value:this.state.error,children:this.props.component})):this.props.children}}function dX(n){let{routeContext:e,match:t,children:i}=n,s=k.useContext(QA);return s&&s.static&&s.staticContext&&(t.route.errorElement||t.route.ErrorBoundary)&&(s.staticContext._deepestRenderedBoundaryId=t.route.id),k.createElement(Hl.Provider,{value:e},i)}function hX(n,e,t){var i;if(e===void 0&&(e=[]),t===void 0&&(t=null),n==null){var s;if((s=t)!=null&&s.errors)n=t.matches;else return null}let r=n,o=(i=t)==null?void 0:i.errors;if(o!=null){let a=r.findIndex(l=>l.route.id&&o?.[l.route.id]);a>=0||Ft(!1),r=r.slice(0,Math.min(r.length,a+1))}return r.reduceRight((a,l,g)=>{let u=l.route.id?o?.[l.route.id]:null,C=null;t&&(C=l.route.errorElement||uX);let d=e.concat(r.slice(0,g+1)),h=()=>{let f;return u?f=C:l.route.Component?f=k.createElement(l.route.Component,null):l.route.element?f=l.route.element:f=a,k.createElement(dX,{match:l,routeContext:{outlet:a,matches:d,isDataRoute:t!=null},children:f})};return t&&(l.route.ErrorBoundary||l.route.errorElement||g===0)?k.createElement(CX,{location:t.location,revalidation:t.revalidation,component:C,error:u,children:h(),routeContext:{outlet:null,matches:d,isDataRoute:!0}}):h()},null)}var J0;(function(n){n.UseBlocker="useBlocker",n.UseRevalidator="useRevalidator",n.UseNavigateStable="useNavigate"})(J0||(J0={}));var Ru;(function(n){n.UseBlocker="useBlocker",n.UseLoaderData="useLoaderData",n.UseActionData="useActionData",n.UseRouteError="useRouteError",n.UseNavigation="useNavigation",n.UseRouteLoaderData="useRouteLoaderData",n.UseMatches="useMatches",n.UseRevalidator="useRevalidator",n.UseNavigateStable="useNavigate",n.UseRouteId="useRouteId"})(Ru||(Ru={}));function AX(n){let e=k.useContext(QA);return e||Ft(!1),e}function pX(n){let e=k.useContext(Tv);return e||Ft(!1),e}function fX(n){let e=k.useContext(Hl);return e||Ft(!1),e}function N1(n){let e=fX(),t=e.matches[e.matches.length-1];return t.route.id||Ft(!1),t.route.id}function mX(){var n;let e=k.useContext(V1),t=pX(Ru.UseRouteError),i=N1(Ru.UseRouteError);return e||((n=t.errors)==null?void 0:n[i])}function bX(){let{router:n}=AX(J0.UseNavigateStable),e=N1(Ru.UseNavigateStable),t=k.useRef(!1);return M1(()=>{t.current=!0}),k.useCallback(function(s,r){r===void 0&&(r={}),t.current&&(typeof s=="number"?n.navigate(s):n.navigate(s,ZA({fromRouteId:e},r)))},[n,e])}function vX(n){let{fallbackElement:e,router:t}=n,[i,s]=k.useState(t.state);k.useLayoutEffect(()=>t.subscribe(s),[t,s]);let r=k.useMemo(()=>({createHref:t.createHref,encodeLocation:t.encodeLocation,go:l=>t.navigate(l),push:(l,g,u)=>t.navigate(l,{state:g,preventScrollReset:u?.preventScrollReset}),replace:(l,g,u)=>t.navigate(l,{replace:!0,state:g,preventScrollReset:u?.preventScrollReset})}),[t]),o=t.basename||"/",a=k.useMemo(()=>({router:t,navigator:r,static:!1,basename:o}),[t,r,o]);return k.createElement(k.Fragment,null,k.createElement(QA.Provider,{value:a},k.createElement(Tv.Provider,{value:i},k.createElement(GX,{basename:t.basename,location:t.state.location,navigationType:t.state.historyAction,navigator:r},t.state.initialized?k.createElement(yX,{routes:t.routes,state:i}):e))),null)}function yX(n){let{routes:e,state:t}=n;return cX(e,void 0,t)}function GX(n){let{basename:e="/",children:t=null,location:i,navigationType:s=Ln.Pop,navigator:r,static:o=!1}=n;tC()&&Ft(!1);let a=e.replace(/^\/*/,"/"),l=k.useMemo(()=>({basename:a,navigator:r,static:o}),[a,r,o]);typeof i=="string"&&(i=Wo(i));let{pathname:g="/",search:u="",hash:C="",state:d=null,key:h="default"}=i,f=k.useMemo(()=>{let v=wc(g,a);return v==null?null:{location:{pathname:v,search:u,hash:C,state:d,key:h},navigationType:s}},[a,g,u,C,d,h,s]);return f==null?null:k.createElement(Nl.Provider,{value:l},k.createElement(jA.Provider,{children:t,value:f}))}var q2;(function(n){n[n.pending=0]="pending",n[n.success=1]="success",n[n.error=2]="error"})(q2||(q2={}));new Promise(()=>{});function BX(n){let e={hasErrorBoundary:n.ErrorBoundary!=null||n.errorElement!=null};return n.Component&&Object.assign(e,{element:k.createElement(n.Component),Component:void 0}),n.ErrorBoundary&&Object.assign(e,{errorElement:k.createElement(n.ErrorBoundary),ErrorBoundary:void 0}),e}/** * React Router DOM v6.11.2 * * Copyright (c) Remix Software Inc. @@ -64,7 +64,7 @@ Error generating stack: `+r.message+` * LICENSE.md file in the root directory of this source tree. * * @license MIT - */function pc(){return pc=Object.assign?Object.assign.bind():function(n){for(var e=1;e=0)&&(t[s]=n[s]);return t}function ZX(n){return!!(n.metaKey||n.altKey||n.ctrlKey||n.shiftKey)}function wX(n,e){return n.button===0&&(!e||e==="_self")&&!ZX(n)}const SX=["onClick","relative","reloadDocument","replace","state","target","to","preventScrollReset"],xX=["aria-current","caseSensitive","className","end","style","to","children"];function RX(n,e){return qH({basename:e?.basename,future:pc({},e?.future,{v7_prependBasename:!0}),history:bH({window:e?.window}),hydrationData:e?.hydrationData||WX(),routes:n,mapRouteProperties:BX}).initialize()}function WX(){var n;let e=(n=window)==null?void 0:n.__staticRouterHydrationData;return e&&e.errors&&(e=pc({},e,{errors:VX(e.errors)})),e}function VX(n){if(!n)return null;let e=Object.entries(n),t={};for(let[i,s]of e)if(s&&s.__type==="RouteErrorResponse")t[i]=new Lv(s.status,s.statusText,s.data,s.internal===!0);else if(s&&s.__type==="Error"){let r=new Error(s.message);r.stack="",t[i]=r}else t[i]=s;return t}const MX=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u",NX=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,X1=k.forwardRef(function(e,t){let{onClick:i,relative:s,reloadDocument:r,replace:o,state:a,target:l,to:g,preventScrollReset:u}=e,C=H1(e,SX),{basename:d}=k.useContext(Nl),h,f=!1;if(typeof g=="string"&&NX.test(g)&&(h=g,MX))try{let b=new URL(window.location.href),m=g.startsWith("//")?new URL(b.protocol+g):new URL(g),B=wc(m.pathname,d);m.origin===b.origin&&B!=null?g=B+m.search+m.hash:f=!0}catch{}let v=aX(g,{relative:s}),y=HX(g,{replace:o,state:a,target:l,preventScrollReset:u,relative:s});function A(b){i&&i(b),b.defaultPrevented||y(b)}return k.createElement("a",pc({},C,{href:h||v,onClick:f||r?i:A,ref:t,target:l}))}),F1=k.forwardRef(function(e,t){let{"aria-current":i="page",caseSensitive:s=!1,className:r="",end:o=!1,style:a,to:l,children:g}=e,u=H1(e,xX),C=kv(l,{relative:u.relative}),d=tC(),h=k.useContext(Tv),{navigator:f}=k.useContext(Nl),v=f.encodeLocation?f.encodeLocation(C).pathname:C.pathname,y=d.pathname,A=h&&h.navigation&&h.navigation.location?h.navigation.location.pathname:null;s||(y=y.toLowerCase(),A=A?A.toLowerCase():null,v=v.toLowerCase());let b=y===v||!o&&y.startsWith(v)&&y.charAt(v.length)==="/",m=A!=null&&(A===v||!o&&A.startsWith(v)&&A.charAt(v.length)==="/"),B=b?i:void 0,S;typeof r=="function"?S=r({isActive:b,isPending:m}):S=[r,b?"active":null,m?"pending":null].filter(Boolean).join(" ");let x=typeof a=="function"?a({isActive:b,isPending:m}):a;return k.createElement(X1,pc({},u,{"aria-current":B,className:S,ref:t,style:x,to:l}),typeof g=="function"?g({isActive:b,isPending:m}):g)});var $2;(function(n){n.UseScrollRestoration="useScrollRestoration",n.UseSubmitImpl="useSubmitImpl",n.UseFetcher="useFetcher"})($2||($2={}));var eZ;(function(n){n.UseFetchers="useFetchers",n.UseScrollRestoration="useScrollRestoration"})(eZ||(eZ={}));function HX(n,e){let{target:t,replace:i,state:s,preventScrollReset:r,relative:o}=e===void 0?{}:e,a=lX(),l=tC(),g=kv(n,{relative:o});return k.useCallback(u=>{if(wX(u,t)){u.preventDefault();let C=i!==void 0?i:wl(l)===wl(g);a(n,{replace:C,state:s,preventScrollReset:r,relative:o})}},[l,a,g,i,s,t,n,r,o])}/*! ***************************************************************************** + */function pc(){return pc=Object.assign?Object.assign.bind():function(n){for(var e=1;e=0)&&(t[s]=n[s]);return t}function ZX(n){return!!(n.metaKey||n.altKey||n.ctrlKey||n.shiftKey)}function wX(n,e){return n.button===0&&(!e||e==="_self")&&!ZX(n)}const SX=["onClick","relative","reloadDocument","replace","state","target","to","preventScrollReset"],xX=["aria-current","caseSensitive","className","end","style","to","children"];function RX(n,e){return qH({basename:e?.basename,future:pc({},e?.future,{v7_prependBasename:!0}),history:bH({window:e?.window}),hydrationData:e?.hydrationData||WX(),routes:n,mapRouteProperties:BX}).initialize()}function WX(){var n;let e=(n=window)==null?void 0:n.__staticRouterHydrationData;return e&&e.errors&&(e=pc({},e,{errors:VX(e.errors)})),e}function VX(n){if(!n)return null;let e=Object.entries(n),t={};for(let[i,s]of e)if(s&&s.__type==="RouteErrorResponse")t[i]=new Lv(s.status,s.statusText,s.data,s.internal===!0);else if(s&&s.__type==="Error"){let r=new Error(s.message);r.stack="",t[i]=r}else t[i]=s;return t}const MX=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u",NX=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,X1=k.forwardRef(function(e,t){let{onClick:i,relative:s,reloadDocument:r,replace:o,state:a,target:l,to:g,preventScrollReset:u}=e,C=H1(e,SX),{basename:d}=k.useContext(Nl),h,f=!1;if(typeof g=="string"&&NX.test(g)&&(h=g,MX))try{let b=new URL(window.location.href),m=g.startsWith("//")?new URL(b.protocol+g):new URL(g),B=wc(m.pathname,d);m.origin===b.origin&&B!=null?g=B+m.search+m.hash:f=!0}catch{}let v=aX(g,{relative:s}),y=HX(g,{replace:o,state:a,target:l,preventScrollReset:u,relative:s});function A(b){i&&i(b),b.defaultPrevented||y(b)}return k.createElement("a",pc({},C,{href:h||v,onClick:f||r?i:A,ref:t,target:l}))}),F1=k.forwardRef(function(e,t){let{"aria-current":i="page",caseSensitive:s=!1,className:r="",end:o=!1,style:a,to:l,children:g}=e,u=H1(e,xX),C=kv(l,{relative:u.relative}),d=Sc(),h=k.useContext(Tv),{navigator:f}=k.useContext(Nl),v=f.encodeLocation?f.encodeLocation(C).pathname:C.pathname,y=d.pathname,A=h&&h.navigation&&h.navigation.location?h.navigation.location.pathname:null;s||(y=y.toLowerCase(),A=A?A.toLowerCase():null,v=v.toLowerCase());let b=y===v||!o&&y.startsWith(v)&&y.charAt(v.length)==="/",m=A!=null&&(A===v||!o&&A.startsWith(v)&&A.charAt(v.length)==="/"),B=b?i:void 0,S;typeof r=="function"?S=r({isActive:b,isPending:m}):S=[r,b?"active":null,m?"pending":null].filter(Boolean).join(" ");let x=typeof a=="function"?a({isActive:b,isPending:m}):a;return k.createElement(X1,pc({},u,{"aria-current":B,className:S,ref:t,style:x,to:l}),typeof g=="function"?g({isActive:b,isPending:m}):g)});var $2;(function(n){n.UseScrollRestoration="useScrollRestoration",n.UseSubmitImpl="useSubmitImpl",n.UseFetcher="useFetcher"})($2||($2={}));var eZ;(function(n){n.UseFetchers="useFetchers",n.UseScrollRestoration="useScrollRestoration"})(eZ||(eZ={}));function HX(n,e){let{target:t,replace:i,state:s,preventScrollReset:r,relative:o}=e===void 0?{}:e,a=lX(),l=Sc(),g=kv(n,{relative:o});return k.useCallback(u=>{if(wX(u,t)){u.preventDefault();let C=i!==void 0?i:wl(l)===wl(g);a(n,{replace:C,state:s,preventScrollReset:r,relative:o})}},[l,a,g,i,s,t,n,r,o])}/*! ***************************************************************************** Copyright (c) Microsoft Corporation. Permission to use, copy, modify, and/or distribute this software for any @@ -77,15 +77,15 @@ INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. -***************************************************************************** */var O0=function(){return O0=Object.assign||function(e){for(var t,i=1,s=arguments.length;iE.jsx("div",{className:"mx-1 w-6 h-6 text-xl flex cursor-pointer justify-center hover:opacity-50 ease-in-out duration-200",...e,children:n}),nC=({url:n,icon:e})=>E.jsx(z1,{children:E.jsx("a",{href:n,children:e})}),EX=()=>E.jsx(nC,{url:"https://goo.gl/maps/Zp92ofs6ze3y8hc19",icon:E.jsx(LX,{className:"fill-icon dark:fill-icon-dark "})}),L1=()=>E.jsx(nC,{url:"https://twitter.com/wodenimoni",icon:E.jsx(pH,{className:"fill-icon dark:fill-icon-dark"})}),E1=()=>E.jsx(nC,{url:"https://github.com/wodeni",icon:E.jsx(AH,{className:"fill-icon dark:fill-icon-dark"})}),TX=()=>E.jsx(nC,{url:"http://wodenimoni.com/nimo-markdown-cv/",icon:E.jsx("span",{className:"font-extralight leading-5 text-icon top-[-4px] left-[-3px] relative",children:"CV"})}),T1=()=>E.jsx(nC,{url:"mailto:nimo@cmu.edu",icon:E.jsx(KX,{className:"fill-icon dark:fill-icon-dark grow"})}),Uv=({className:n,toggleDark:e})=>E.jsxs("div",{className:`${n} flex items-start md:items-top md:ml-auto mb-0 color-primary`,children:[E.jsx(TX,{}),E.jsx(L1,{}),E.jsx(E1,{}),E.jsx(T1,{}),E.jsx(EX,{}),E.jsx(kX,{toggleDark:e})]}),zI=({className:n,children:e})=>E.jsx("p",{className:`${n} font-sans font-extralight text-lg my-2 dark:text-neutral-100`,children:e}),kg=({header:n,children:e})=>{const t=n.toLowerCase();return E.jsxs("div",{id:t,className:"my-4 md:my-8",children:[E.jsxs("span",{className:"group font-bold text-3xl tracking-tight curosr-pointer relative ",children:[E.jsxs("svg",{height:30,className:"w-full translate-y-1 absolute top-0 left-0",children:[E.jsx("rect",{x:0,y:0,width:5,height:50,className:"group-hover:opacity-30 group-hover:scale-x-[400] transition-transform transform fill-primary"}),E.jsx("rect",{x:0,y:0,width:5,height:50,className:"fill-primary"})]}),E.jsx(YX,{className:"ml-[10px] w-full dark:text-neutral-100",smooth:!0,to:`/#${t}`,children:n})]}),e]})},Qt=({href:n,children:e})=>E.jsx("a",{className:"underline decoration-primary/50 dark:decoration-primary/70 decoration-2 cursor-pointer hover:decoration-primary hover:decoration-3 ease-in-out duration-100",href:n,children:e}),kX=({toggleDark:n})=>E.jsx(z1,{onClick:n,children:E.jsx(zX,{className:"fill-icon dark:fill-icon-dark"})}),DX=[{time:new Date("2024-01-02"),msg:"New year, new round of rewriting this site. Used Tailwind this time and we have dark mode now!"},{time:new Date("2023-12-08"),msg:E.jsxs(E.Fragment,{children:["Invited to attend an"," ",E.jsx(Qt,{href:"https://aimath.org/pastworkshops/cyberinfrastructure.html",children:"AIM workshop"})," ","on"," ",E.jsx(Qt,{href:"https://code4math.org/",children:"Digital Ecosystems for Mathematics"})," ","and started ",E.jsx(Qt,{href:"https://mathdiagrams.com",children:"mathdiagrams.com"}),"!"]})},{time:new Date("2023-07-14"),msg:E.jsxs(E.Fragment,{children:["Released ",E.jsx(Qt,{href:"https://penrose.cs.cmu.edu/blog/v3",children:"Penrose 3.0"}),"!"]})},{time:new Date("2023-06-01"),msg:E.jsxs(E.Fragment,{children:[E.jsx(Qt,{href:"https://www.cmu.edu/scs/s3d/reuse/",children:"REUSE"})," students"," ",E.jsx(Qt,{href:"https://www.linkedin.com/in/rijul-jain-585a62191",children:"Rijul Jain"})," ","and ",E.jsx(Qt,{href:"https://ravenrothkopf.github.io/",children:"Raven Rothkopf"})," joined Penrose this summer. Welcome!"]})},{time:new Date("2022-08-30"),msg:"Spent the summer as an intern in Machine Intelligence at Apple. Stay tuned for more updates on our work!"},{time:new Date("2022-04-30"),msg:E.jsxs(E.Fragment,{children:["I"," ",E.jsx(Qt,{href:new URL("/pr-preview/pr-22/assets/thesis-proposal-talk.pdf",self.location).href,children:"proposed"})," ","my dissertation. Officially a PhD candidate now!"]})},{time:new Date("2021-07-01"),msg:E.jsxs(E.Fragment,{children:["My work at Microsoft,"," ",E.jsx("i",{children:'"reCode: A Lightweight Find-and-Replace Interaction in the IDE for Transforming Code by Example,"'})," ","was conditionally accepted by"," ",E.jsx(Qt,{href:"https://uist.acm.org/uist2021/",children:"UIST 2021"}),"!"]})},{time:new Date("2020-05-01"),msg:E.jsxs(E.Fragment,{children:["I'll join ",E.jsx(Qt,{href:"https://microsoft.github.io/prose/",children:"PROSE"})," @ Microsoft Research as a Research Intern this summer!"]})},{time:new Date("2020-04-01"),msg:E.jsxs(E.Fragment,{children:["The first conference paper on"," ",E.jsx(Qt,{href:"https://penrose.cs.cm",children:"Penrose"}),","," ",E.jsx("i",{children:'"Penrose: From Mathematical Notation to Beautiful Diagrams,"'})," was accepted by ",E.jsx(Qt,{href:"https://s2020.siggraph.org/",children:"SIGGRAPH 2020"}),"!"]})},{time:new Date("2020-03-01"),msg:E.jsxs(E.Fragment,{children:["The CHI paper won a ",E.jsx("b",{children:"Best Paper Honourable Mention award"})," 🏆!"]})},{time:new Date("2020-01-01"),msg:E.jsxs(E.Fragment,{children:["Our paper"," ",E.jsx("i",{children:'"How Domain Experts Create Conceptual Diagrams and Implications for Tool Design"'})," ","was accepted by ",E.jsx(Qt,{href:"http://chi2020.acm.org/",children:"CHI 2020"})," 🏖️!"]})},{time:new Date("2019-10-01"),msg:E.jsxs(E.Fragment,{children:["I presented our papers at"," ",E.jsx(Qt,{href:"http://plateau-workshop.org/",children:"PLATEAU 2019"})," with Max and Anael!"]})},{time:new Date("2019-05-01"),msg:E.jsxs(E.Fragment,{children:["I finished 7th at the 2019"," ",E.jsx(Qt,{href:"https://en.wikipedia.org/wiki/ACUI_Collegiate_Pocket_Billiards_National_Championship",children:"ACUI Collegiate Nine-ball National Championship"})," ","🎱!"]})},{time:new Date("2019-05-01"),msg:E.jsxs(E.Fragment,{children:["Anael Kuperwajs,"," ",E.jsx(Qt,{href:"https://www.linkedin.com/in/courtney-e-miller/",children:"Courtney Miller"}),", ",E.jsx(Qt,{href:"https://a9.io/",children:"Max Krieger"})," will join us as"," ",E.jsx(Qt,{href:"https://www.cmu.edu/scs/isr/reuse/",children:"REUSE"})," students this summer. Welcome!"]})},{time:new Date("2018-04-01"),msg:E.jsx(E.Fragment,{children:"I will join CMU as a Ph.D. student!"})},{time:new Date("2018-01-01"),msg:E.jsx(E.Fragment,{children:"I will be one of the TAs for COMS 4115 again in Spring 2018."})},{time:new Date("2017-10-01"),msg:E.jsxs(E.Fragment,{children:["Gave a talk at"," ",E.jsx(Qt,{href:"https://2017.splashcon.org/event/dsldi-2017-substance-and-style-domain-specific-languages-for-mathematical-diagrams",children:"DSLDI 2017"})," ","in Vancouver, Canada."]})},{time:new Date("2017-05-01"),msg:E.jsxs(E.Fragment,{children:["Joined ",E.jsx(Qt,{href:"http://isri.cmu.edu/education/reu-se/",children:"REU-SE"}),", a summer research program, at Carnegie Mellon University."]})}];/** +***************************************************************************** */var O0=function(){return O0=Object.assign||function(e){for(var t,i=1,s=arguments.length;iL.jsx("div",{className:"mx-1 w-6 h-6 text-xl flex cursor-pointer justify-center hover:opacity-50 ease-in-out duration-200",...e,children:n}),nC=({url:n,icon:e})=>L.jsx(z1,{children:L.jsx("a",{href:n,children:e})}),EX=()=>L.jsx(nC,{url:"https://goo.gl/maps/Zp92ofs6ze3y8hc19",icon:L.jsx(LX,{className:"fill-icon dark:fill-icon-dark "})}),L1=()=>L.jsx(nC,{url:"https://twitter.com/wodenimoni",icon:L.jsx(pH,{className:"fill-icon dark:fill-icon-dark"})}),E1=()=>L.jsx(nC,{url:"https://github.com/wodeni",icon:L.jsx(AH,{className:"fill-icon dark:fill-icon-dark"})}),TX=()=>L.jsx(nC,{url:"http://wodenimoni.com/nimo-markdown-cv/",icon:L.jsx("span",{className:"font-extralight leading-5 text-icon top-[-4px] left-[-3px] relative",children:"CV"})}),T1=()=>L.jsx(nC,{url:"mailto:nimo@cmu.edu",icon:L.jsx(KX,{className:"fill-icon dark:fill-icon-dark grow"})}),Uv=({className:n,toggleDark:e})=>L.jsxs("div",{className:`${n} flex items-start md:items-top md:ml-auto mb-0 color-primary`,children:[L.jsx(TX,{}),L.jsx(L1,{}),L.jsx(E1,{}),L.jsx(T1,{}),L.jsx(EX,{}),L.jsx(kX,{toggleDark:e})]}),LI=({className:n,children:e})=>L.jsx("p",{className:`${n} font-sans font-extralight text-lg my-2 dark:text-neutral-100`,children:e}),kg=({header:n,children:e})=>{const t=n.toLowerCase().replace(/ /g,"-"),i=Sc();return L.jsxs("div",{id:t,className:"my-4 md:my-8",children:[L.jsx(YX,{smooth:!0,to:`${i.pathname}#${t}`,children:L.jsxs("span",{className:"group font-bold text-3xl tracking-tight curosr-pointer relative ",children:[L.jsx("span",{className:"ml-[10px] w-full dark:text-neutral-100",children:n}),L.jsxs("svg",{height:30,className:"w-full translate-y-1 absolute top-0 left-0",children:[L.jsx("rect",{x:0,y:0,width:5,height:50,className:"group-hover:opacity-30 group-hover:scale-x-[400] transition-transform transform fill-primary"}),L.jsx("rect",{x:0,y:0,width:5,height:50,className:"fill-primary"})]})]})}),e]})},Qt=({href:n,children:e})=>L.jsx("a",{className:"underline decoration-primary/50 dark:decoration-primary/70 decoration-2 cursor-pointer hover:decoration-primary hover:decoration-3 ease-in-out duration-100",href:n,children:e}),kX=({toggleDark:n})=>L.jsx(z1,{onClick:n,children:L.jsx(zX,{className:"fill-icon dark:fill-icon-dark"})}),DX=[{time:new Date("2024-01-02"),msg:"New year, new round of rewriting this site. Used Tailwind this time and we have dark mode now!"},{time:new Date("2023-12-08"),msg:L.jsxs(L.Fragment,{children:["Invited to attend an"," ",L.jsx(Qt,{href:"https://aimath.org/pastworkshops/cyberinfrastructure.html",children:"AIM workshop"})," ","on"," ",L.jsx(Qt,{href:"https://code4math.org/",children:"Digital Ecosystems for Mathematics"})," ","and started ",L.jsx(Qt,{href:"https://mathdiagrams.com",children:"mathdiagrams.com"}),"!"]})},{time:new Date("2023-07-14"),msg:L.jsxs(L.Fragment,{children:["Released ",L.jsx(Qt,{href:"https://penrose.cs.cmu.edu/blog/v3",children:"Penrose 3.0"}),"!"]})},{time:new Date("2023-06-01"),msg:L.jsxs(L.Fragment,{children:[L.jsx(Qt,{href:"https://www.cmu.edu/scs/s3d/reuse/",children:"REUSE"})," students"," ",L.jsx(Qt,{href:"https://www.linkedin.com/in/rijul-jain-585a62191",children:"Rijul Jain"})," ","and ",L.jsx(Qt,{href:"https://ravenrothkopf.github.io/",children:"Raven Rothkopf"})," joined Penrose this summer. Welcome!"]})},{time:new Date("2022-08-30"),msg:"Spent the summer as an intern in Machine Intelligence at Apple. Stay tuned for more updates on our work!"},{time:new Date("2022-04-30"),msg:L.jsxs(L.Fragment,{children:["I"," ",L.jsx(Qt,{href:new URL("/pr-preview/pr-22/assets/thesis-proposal-talk.pdf",self.location).href,children:"proposed"})," ","my dissertation. Officially a PhD candidate now!"]})},{time:new Date("2021-07-01"),msg:L.jsxs(L.Fragment,{children:["My work at Microsoft,"," ",L.jsx("i",{children:'"reCode: A Lightweight Find-and-Replace Interaction in the IDE for Transforming Code by Example,"'})," ","was conditionally accepted by"," ",L.jsx(Qt,{href:"https://uist.acm.org/uist2021/",children:"UIST 2021"}),"!"]})},{time:new Date("2020-05-01"),msg:L.jsxs(L.Fragment,{children:["I'll join ",L.jsx(Qt,{href:"https://microsoft.github.io/prose/",children:"PROSE"})," @ Microsoft Research as a Research Intern this summer!"]})},{time:new Date("2020-04-01"),msg:L.jsxs(L.Fragment,{children:["The first conference paper on"," ",L.jsx(Qt,{href:"https://penrose.cs.cm",children:"Penrose"}),","," ",L.jsx("i",{children:'"Penrose: From Mathematical Notation to Beautiful Diagrams,"'})," was accepted by ",L.jsx(Qt,{href:"https://s2020.siggraph.org/",children:"SIGGRAPH 2020"}),"!"]})},{time:new Date("2020-03-01"),msg:L.jsxs(L.Fragment,{children:["The CHI paper won a ",L.jsx("b",{children:"Best Paper Honourable Mention award"})," 🏆!"]})},{time:new Date("2020-01-01"),msg:L.jsxs(L.Fragment,{children:["Our paper"," ",L.jsx("i",{children:'"How Domain Experts Create Conceptual Diagrams and Implications for Tool Design"'})," ","was accepted by ",L.jsx(Qt,{href:"http://chi2020.acm.org/",children:"CHI 2020"})," 🏖️!"]})},{time:new Date("2019-10-01"),msg:L.jsxs(L.Fragment,{children:["I presented our papers at"," ",L.jsx(Qt,{href:"http://plateau-workshop.org/",children:"PLATEAU 2019"})," with Max and Anael!"]})},{time:new Date("2019-05-01"),msg:L.jsxs(L.Fragment,{children:["I finished 7th at the 2019"," ",L.jsx(Qt,{href:"https://en.wikipedia.org/wiki/ACUI_Collegiate_Pocket_Billiards_National_Championship",children:"ACUI Collegiate Nine-ball National Championship"})," ","🎱!"]})},{time:new Date("2019-05-01"),msg:L.jsxs(L.Fragment,{children:["Anael Kuperwajs,"," ",L.jsx(Qt,{href:"https://www.linkedin.com/in/courtney-e-miller/",children:"Courtney Miller"}),", ",L.jsx(Qt,{href:"https://a9.io/",children:"Max Krieger"})," will join us as"," ",L.jsx(Qt,{href:"https://www.cmu.edu/scs/isr/reuse/",children:"REUSE"})," students this summer. Welcome!"]})},{time:new Date("2018-04-01"),msg:L.jsx(L.Fragment,{children:"I will join CMU as a Ph.D. student!"})},{time:new Date("2018-01-01"),msg:L.jsx(L.Fragment,{children:"I will be one of the TAs for COMS 4115 again in Spring 2018."})},{time:new Date("2017-10-01"),msg:L.jsxs(L.Fragment,{children:["Gave a talk at"," ",L.jsx(Qt,{href:"https://2017.splashcon.org/event/dsldi-2017-substance-and-style-domain-specific-languages-for-mathematical-diagrams",children:"DSLDI 2017"})," ","in Vancouver, Canada."]})},{time:new Date("2017-05-01"),msg:L.jsxs(L.Fragment,{children:["Joined ",L.jsx(Qt,{href:"http://isri.cmu.edu/education/reu-se/",children:"REU-SE"}),", a summer research program, at Carnegie Mellon University."]})}];/** * @license * Copyright 2010-2023 Three.js Authors * SPDX-License-Identifier: MIT - */const wa="152",UX={LEFT:0,MIDDLE:1,RIGHT:2,ROTATE:0,DOLLY:1,PAN:2},PX={ROTATE:0,PAN:1,DOLLY_PAN:2,DOLLY_ROTATE:3},k1=0,Q0=1,D1=2,_X=3,U1=0,qA=1,tu=2,cr=3,Er=0,Jn=1,ts=2,JX=2,an=0,Al=1,j0=2,q0=3,$0=4,P1=5,el=100,_1=101,J1=102,eb=103,tb=104,O1=200,Q1=201,j1=202,q1=203,Pv=204,_v=205,$1=206,eW=207,tW=208,nW=209,iW=210,Jv=0,Ov=1,wA=2,Ru=3,Wu=4,Qv=5,jv=6,$A=7,iC=0,sW=1,rW=2,Ar=0,oW=1,aW=2,lW=3,qv=4,gW=5,ep=300,fa=301,ma=302,Vu=303,Mu=304,Sc=306,Gs=1e3,Pn=1001,Nu=1002,vt=1003,SA=1004,OX=1004,nu=1005,QX=1005,st=1006,$v=1007,jX=1007,ba=1008,qX=1008,cn=1009,cW=1010,IW=1011,ey=1012,uW=1013,Ao=1014,Wn=1015,bs=1016,CW=1017,dW=1018,da=1020,hW=1021,An=1023,tp=1024,AW=1025,ha=1026,va=1027,ty=1028,pW=1029,ny=1030,fW=1031,mW=1033,Uh=33776,Ph=33777,_h=33778,Jh=33779,nb=35840,ib=35841,sb=35842,rb=35843,bW=36196,ob=37492,ab=37496,lb=37808,gb=37809,cb=37810,Ib=37811,ub=37812,Cb=37813,db=37814,hb=37815,Ab=37816,pb=37817,fb=37818,mb=37819,bb=37820,vb=37821,Oh=36492,vW=36283,yb=36284,Gb=36285,Bb=36286,yW=2200,GW=2201,BW=2202,Hu=2300,Xu=2301,Qh=2302,gl=2400,cl=2401,Fu=2402,np=2500,iy=2501,$X=0,eF=1,tF=2,sC=3e3,ks=3001,Tn=3200,Tr=3201,Vo=0,ZW=1,vo="",yt="srgb",fr="srgb-linear",sy="display-p3",nF=0,jh=7680,iF=7681,sF=7682,rF=7683,oF=34055,aF=34056,lF=5386,gF=512,cF=513,IF=514,uF=515,CF=516,dF=517,hF=518,wW=519,Yu=35044,SW=35048,AF=35040,pF=35045,fF=35049,mF=35041,bF=35046,vF=35050,yF=35042,GF="100",xA="300 es",RA=1035;class Ps{addEventListener(e,t){this._listeners===void 0&&(this._listeners={});const i=this._listeners;i[e]===void 0&&(i[e]=[]),i[e].indexOf(t)===-1&&i[e].push(t)}hasEventListener(e,t){if(this._listeners===void 0)return!1;const i=this._listeners;return i[e]!==void 0&&i[e].indexOf(t)!==-1}removeEventListener(e,t){if(this._listeners===void 0)return;const s=this._listeners[e];if(s!==void 0){const r=s.indexOf(t);r!==-1&&s.splice(r,1)}}dispatchEvent(e){if(this._listeners===void 0)return;const i=this._listeners[e.type];if(i!==void 0){e.target=this;const s=i.slice(0);for(let r=0,o=s.length;r>8&255]+Zi[n>>16&255]+Zi[n>>24&255]+"-"+Zi[e&255]+Zi[e>>8&255]+"-"+Zi[e>>16&15|64]+Zi[e>>24&255]+"-"+Zi[t&63|128]+Zi[t>>8&255]+"-"+Zi[t>>16&255]+Zi[t>>24&255]+Zi[i&255]+Zi[i>>8&255]+Zi[i>>16&255]+Zi[i>>24&255]).toLowerCase()}function Sn(n,e,t){return Math.max(e,Math.min(t,n))}function ry(n,e){return(n%e+e)%e}function BF(n,e,t,i,s){return i+(n-e)*(s-i)/(t-e)}function ZF(n,e,t){return n!==e?(t-n)/(e-n):0}function iu(n,e,t){return(1-t)*n+t*e}function wF(n,e,t,i){return iu(n,e,1-Math.exp(-t*i))}function SF(n,e=1){return e-Math.abs(ry(n,e*2)-e)}function xF(n,e,t){return n<=e?0:n>=t?1:(n=(n-e)/(t-e),n*n*(3-2*n))}function RF(n,e,t){return n<=e?0:n>=t?1:(n=(n-e)/(t-e),n*n*n*(n*(n*6-15)+10))}function WF(n,e){return n+Math.floor(Math.random()*(e-n+1))}function VF(n,e){return n+Math.random()*(e-n)}function MF(n){return n*(.5-Math.random())}function NF(n){n!==void 0&&(iZ=n);let e=iZ+=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 HF(n){return n*pl}function XF(n){return n*fc}function Zb(n){return(n&n-1)===0&&n!==0}function xW(n){return Math.pow(2,Math.ceil(Math.log(n)/Math.LN2))}function RW(n){return Math.pow(2,Math.floor(Math.log(n)/Math.LN2))}function FF(n,e,t,i,s){const r=Math.cos,o=Math.sin,a=r(t/2),l=o(t/2),g=r((e+i)/2),u=o((e+i)/2),C=r((e-i)/2),d=o((e-i)/2),h=r((i-e)/2),f=o((i-e)/2);switch(s){case"XYX":n.set(a*u,l*C,l*d,a*g);break;case"YZY":n.set(l*d,a*u,l*C,a*g);break;case"ZXZ":n.set(l*C,l*d,a*u,a*g);break;case"XZX":n.set(a*u,l*f,l*h,a*g);break;case"YXY":n.set(l*h,a*u,l*f,a*g);break;case"ZYZ":n.set(l*f,l*h,a*u,a*g);break;default:console.warn("THREE.MathUtils: .setQuaternionFromProperEuler() encountered an unknown order: "+s)}}function fs(n,e){switch(e.constructor){case Float32Array:return n;case Uint16Array:return n/65535;case Uint8Array:return n/255;case Int16Array:return Math.max(n/32767,-1);case Int8Array:return Math.max(n/127,-1);default:throw new Error("Invalid component type.")}}function Zt(n,e){switch(e.constructor){case Float32Array:return n;case Uint16Array:return Math.round(n*65535);case Uint8Array:return Math.round(n*255);case Int16Array:return Math.round(n*32767);case Int8Array:return Math.round(n*127);default:throw new Error("Invalid component type.")}}const WW={DEG2RAD:pl,RAD2DEG:fc,generateUUID:vs,clamp:Sn,euclideanModulo:ry,mapLinear:BF,inverseLerp:ZF,lerp:iu,damp:wF,pingpong:SF,smoothstep:xF,smootherstep:RF,randInt:WF,randFloat:VF,randFloatSpread:MF,seededRandom:NF,degToRad:HF,radToDeg:XF,isPowerOfTwo:Zb,ceilPowerOfTwo:xW,floorPowerOfTwo:RW,setQuaternionFromProperEuler:FF,normalize:Zt,denormalize:fs};class oe{constructor(e=0,t=0){oe.prototype.isVector2=!0,this.x=e,this.y=t}get width(){return this.x}set width(e){this.x=e}get height(){return this.y}set height(e){this.y=e}set(e,t){return this.x=e,this.y=t,this}setScalar(e){return this.x=e,this.y=e,this}setX(e){return this.x=e,this}setY(e){return this.y=e,this}setComponent(e,t){switch(e){case 0:this.x=t;break;case 1:this.y=t;break;default:throw new Error("index is out of range: "+e)}return this}getComponent(e){switch(e){case 0:return this.x;case 1:return this.y;default:throw new Error("index is out of range: "+e)}}clone(){return new this.constructor(this.x,this.y)}copy(e){return this.x=e.x,this.y=e.y,this}add(e){return this.x+=e.x,this.y+=e.y,this}addScalar(e){return this.x+=e,this.y+=e,this}addVectors(e,t){return this.x=e.x+t.x,this.y=e.y+t.y,this}addScaledVector(e,t){return this.x+=e.x*t,this.y+=e.y*t,this}sub(e){return this.x-=e.x,this.y-=e.y,this}subScalar(e){return this.x-=e,this.y-=e,this}subVectors(e,t){return this.x=e.x-t.x,this.y=e.y-t.y,this}multiply(e){return this.x*=e.x,this.y*=e.y,this}multiplyScalar(e){return this.x*=e,this.y*=e,this}divide(e){return this.x/=e.x,this.y/=e.y,this}divideScalar(e){return this.multiplyScalar(1/e)}applyMatrix3(e){const t=this.x,i=this.y,s=e.elements;return this.x=s[0]*t+s[3]*i+s[6],this.y=s[1]*t+s[4]*i+s[7],this}min(e){return this.x=Math.min(this.x,e.x),this.y=Math.min(this.y,e.y),this}max(e){return this.x=Math.max(this.x,e.x),this.y=Math.max(this.y,e.y),this}clamp(e,t){return this.x=Math.max(e.x,Math.min(t.x,this.x)),this.y=Math.max(e.y,Math.min(t.y,this.y)),this}clampScalar(e,t){return this.x=Math.max(e,Math.min(t,this.x)),this.y=Math.max(e,Math.min(t,this.y)),this}clampLength(e,t){const i=this.length();return this.divideScalar(i||1).multiplyScalar(Math.max(e,Math.min(t,i)))}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=this.x<0?Math.ceil(this.x):Math.floor(this.x),this.y=this.y<0?Math.ceil(this.y):Math.floor(this.y),this}negate(){return this.x=-this.x,this.y=-this.y,this}dot(e){return this.x*e.x+this.y*e.y}cross(e){return this.x*e.y-this.y*e.x}lengthSq(){return this.x*this.x+this.y*this.y}length(){return Math.sqrt(this.x*this.x+this.y*this.y)}manhattanLength(){return Math.abs(this.x)+Math.abs(this.y)}normalize(){return this.divideScalar(this.length()||1)}angle(){return Math.atan2(-this.y,-this.x)+Math.PI}angleTo(e){const t=Math.sqrt(this.lengthSq()*e.lengthSq());if(t===0)return Math.PI/2;const i=this.dot(e)/t;return Math.acos(Sn(i,-1,1))}distanceTo(e){return Math.sqrt(this.distanceToSquared(e))}distanceToSquared(e){const t=this.x-e.x,i=this.y-e.y;return t*t+i*i}manhattanDistanceTo(e){return Math.abs(this.x-e.x)+Math.abs(this.y-e.y)}setLength(e){return this.normalize().multiplyScalar(e)}lerp(e,t){return this.x+=(e.x-this.x)*t,this.y+=(e.y-this.y)*t,this}lerpVectors(e,t,i){return this.x=e.x+(t.x-e.x)*i,this.y=e.y+(t.y-e.y)*i,this}equals(e){return e.x===this.x&&e.y===this.y}fromArray(e,t=0){return this.x=e[t],this.y=e[t+1],this}toArray(e=[],t=0){return e[t]=this.x,e[t+1]=this.y,e}fromBufferAttribute(e,t){return this.x=e.getX(t),this.y=e.getY(t),this}rotateAround(e,t){const i=Math.cos(t),s=Math.sin(t),r=this.x-e.x,o=this.y-e.y;return this.x=r*i-o*s+e.x,this.y=r*s+o*i+e.y,this}random(){return this.x=Math.random(),this.y=Math.random(),this}*[Symbol.iterator](){yield this.x,yield this.y}}class Mt{constructor(){Mt.prototype.isMatrix3=!0,this.elements=[1,0,0,0,1,0,0,0,1]}set(e,t,i,s,r,o,a,l,g){const u=this.elements;return u[0]=e,u[1]=s,u[2]=a,u[3]=t,u[4]=r,u[5]=l,u[6]=i,u[7]=o,u[8]=g,this}identity(){return this.set(1,0,0,0,1,0,0,0,1),this}copy(e){const t=this.elements,i=e.elements;return t[0]=i[0],t[1]=i[1],t[2]=i[2],t[3]=i[3],t[4]=i[4],t[5]=i[5],t[6]=i[6],t[7]=i[7],t[8]=i[8],this}extractBasis(e,t,i){return e.setFromMatrix3Column(this,0),t.setFromMatrix3Column(this,1),i.setFromMatrix3Column(this,2),this}setFromMatrix4(e){const t=e.elements;return this.set(t[0],t[4],t[8],t[1],t[5],t[9],t[2],t[6],t[10]),this}multiply(e){return this.multiplyMatrices(this,e)}premultiply(e){return this.multiplyMatrices(e,this)}multiplyMatrices(e,t){const i=e.elements,s=t.elements,r=this.elements,o=i[0],a=i[3],l=i[6],g=i[1],u=i[4],C=i[7],d=i[2],h=i[5],f=i[8],v=s[0],y=s[3],A=s[6],b=s[1],m=s[4],B=s[7],S=s[2],x=s[5],R=s[8];return r[0]=o*v+a*b+l*S,r[3]=o*y+a*m+l*x,r[6]=o*A+a*B+l*R,r[1]=g*v+u*b+C*S,r[4]=g*y+u*m+C*x,r[7]=g*A+u*B+C*R,r[2]=d*v+h*b+f*S,r[5]=d*y+h*m+f*x,r[8]=d*A+h*B+f*R,this}multiplyScalar(e){const t=this.elements;return t[0]*=e,t[3]*=e,t[6]*=e,t[1]*=e,t[4]*=e,t[7]*=e,t[2]*=e,t[5]*=e,t[8]*=e,this}determinant(){const e=this.elements,t=e[0],i=e[1],s=e[2],r=e[3],o=e[4],a=e[5],l=e[6],g=e[7],u=e[8];return t*o*u-t*a*g-i*r*u+i*a*l+s*r*g-s*o*l}invert(){const e=this.elements,t=e[0],i=e[1],s=e[2],r=e[3],o=e[4],a=e[5],l=e[6],g=e[7],u=e[8],C=u*o-a*g,d=a*l-u*r,h=g*r-o*l,f=t*C+i*d+s*h;if(f===0)return this.set(0,0,0,0,0,0,0,0,0);const v=1/f;return e[0]=C*v,e[1]=(s*g-u*i)*v,e[2]=(a*i-s*o)*v,e[3]=d*v,e[4]=(u*t-s*l)*v,e[5]=(s*r-a*t)*v,e[6]=h*v,e[7]=(i*l-g*t)*v,e[8]=(o*t-i*r)*v,this}transpose(){let e;const t=this.elements;return e=t[1],t[1]=t[3],t[3]=e,e=t[2],t[2]=t[6],t[6]=e,e=t[5],t[5]=t[7],t[7]=e,this}getNormalMatrix(e){return this.setFromMatrix4(e).invert().transpose()}transposeIntoArray(e){const t=this.elements;return e[0]=t[0],e[1]=t[3],e[2]=t[6],e[3]=t[1],e[4]=t[4],e[5]=t[7],e[6]=t[2],e[7]=t[5],e[8]=t[8],this}setUvTransform(e,t,i,s,r,o,a){const l=Math.cos(r),g=Math.sin(r);return this.set(i*l,i*g,-i*(l*o+g*a)+o+e,-s*g,s*l,-s*(-g*o+l*a)+a+t,0,0,1),this}scale(e,t){return this.premultiply(tm.makeScale(e,t)),this}rotate(e){return this.premultiply(tm.makeRotation(-e)),this}translate(e,t){return this.premultiply(tm.makeTranslation(e,t)),this}makeTranslation(e,t){return this.set(1,0,e,0,1,t,0,0,1),this}makeRotation(e){const t=Math.cos(e),i=Math.sin(e);return this.set(t,-i,0,i,t,0,0,0,1),this}makeScale(e,t){return this.set(e,0,0,0,t,0,0,0,1),this}equals(e){const t=this.elements,i=e.elements;for(let s=0;s<9;s++)if(t[s]!==i[s])return!1;return!0}fromArray(e,t=0){for(let i=0;i<9;i++)this.elements[i]=e[i+t];return this}toArray(e=[],t=0){const i=this.elements;return e[t]=i[0],e[t+1]=i[1],e[t+2]=i[2],e[t+3]=i[3],e[t+4]=i[4],e[t+5]=i[5],e[t+6]=i[6],e[t+7]=i[7],e[t+8]=i[8],e}clone(){return new this.constructor().fromArray(this.elements)}}const tm=new Mt;function VW(n){for(let e=n.length-1;e>=0;--e)if(n[e]>=65535)return!0;return!1}const YF={Int8Array,Uint8Array,Uint8ClampedArray,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array};function Dg(n,e){return new YF[n](e)}function Ku(n){return document.createElementNS("http://www.w3.org/1999/xhtml",n)}const sZ={};function su(n){n in sZ||(sZ[n]=!0,console.warn(n))}function rc(n){return n<.04045?n*.0773993808:Math.pow(n*.9478672986+.0521327014,2.4)}function nm(n){return n<.0031308?n*12.92:1.055*Math.pow(n,.41666)-.055}const KF=new Mt().fromArray([.8224621,.0331941,.0170827,.177538,.9668058,.0723974,-1e-7,1e-7,.9105199]),zF=new Mt().fromArray([1.2249401,-.0420569,-.0196376,-.2249404,1.0420571,-.0786361,1e-7,0,1.0982735]);function LF(n){return n.convertSRGBToLinear().applyMatrix3(zF)}function EF(n){return n.applyMatrix3(KF).convertLinearToSRGB()}const TF={[fr]:n=>n,[yt]:n=>n.convertSRGBToLinear(),[sy]:LF},kF={[fr]:n=>n,[yt]:n=>n.convertLinearToSRGB(),[sy]:EF},Ys={enabled:!0,get legacyMode(){return console.warn("THREE.ColorManagement: .legacyMode=false renamed to .enabled=true in r150."),!this.enabled},set legacyMode(n){console.warn("THREE.ColorManagement: .legacyMode=false renamed to .enabled=true in r150."),this.enabled=!n},get workingColorSpace(){return fr},set workingColorSpace(n){console.warn("THREE.ColorManagement: .workingColorSpace is readonly.")},convert:function(n,e,t){if(this.enabled===!1||e===t||!e||!t)return n;const i=TF[e],s=kF[t];if(i===void 0||s===void 0)throw new Error(`Unsupported color space conversion, "${e}" to "${t}".`);return s(i(n))},fromWorkingColorSpace:function(n,e){return this.convert(n,this.workingColorSpace,e)},toWorkingColorSpace:function(n,e){return this.convert(n,e,this.workingColorSpace)}};let ng;class oy{static getDataURL(e){if(/^data:/i.test(e.src)||typeof HTMLCanvasElement>"u")return e.src;let t;if(e instanceof HTMLCanvasElement)t=e;else{ng===void 0&&(ng=Ku("canvas")),ng.width=e.width,ng.height=e.height;const i=ng.getContext("2d");e instanceof ImageData?i.putImageData(e,0,0):i.drawImage(e,0,0,e.width,e.height),t=ng}return t.width>2048||t.height>2048?(console.warn("THREE.ImageUtils.getDataURL: Image converted to jpg for performance reasons",e),t.toDataURL("image/jpeg",.6)):t.toDataURL("image/png")}static sRGBToLinear(e){if(typeof HTMLImageElement<"u"&&e instanceof HTMLImageElement||typeof HTMLCanvasElement<"u"&&e instanceof HTMLCanvasElement||typeof ImageBitmap<"u"&&e instanceof ImageBitmap){const t=Ku("canvas");t.width=e.width,t.height=e.height;const i=t.getContext("2d");i.drawImage(e,0,0,e.width,e.height);const s=i.getImageData(0,0,e.width,e.height),r=s.data;for(let o=0;o0&&(i.userData=this.userData),t||(e.textures[this.uuid]=i),i}dispose(){this.dispatchEvent({type:"dispose"})}transformUv(e){if(this.mapping!==ep)return e;if(e.applyMatrix3(this.matrix),e.x<0||e.x>1)switch(this.wrapS){case Gs:e.x=e.x-Math.floor(e.x);break;case Pn:e.x=e.x<0?0:1;break;case Nu: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 Gs:e.y=e.y-Math.floor(e.y);break;case Pn:e.y=e.y<0?0:1;break;case Nu: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)}get encoding(){return su("THREE.Texture: Property .encoding has been replaced by .colorSpace."),this.colorSpace===yt?ks:sC}set encoding(e){su("THREE.Texture: Property .encoding has been replaced by .colorSpace."),this.colorSpace=e===ks?yt:vo}}sn.DEFAULT_IMAGE=null;sn.DEFAULT_MAPPING=ep;sn.DEFAULT_ANISOTROPY=1;class Yt{constructor(e=0,t=0,i=0,s=1){Yt.prototype.isVector4=!0,this.x=e,this.y=t,this.z=i,this.w=s}get width(){return this.z}set width(e){this.z=e}get height(){return this.w}set height(e){this.w=e}set(e,t,i,s){return this.x=e,this.y=t,this.z=i,this.w=s,this}setScalar(e){return this.x=e,this.y=e,this.z=e,this.w=e,this}setX(e){return this.x=e,this}setY(e){return this.y=e,this}setZ(e){return this.z=e,this}setW(e){return this.w=e,this}setComponent(e,t){switch(e){case 0:this.x=t;break;case 1:this.y=t;break;case 2:this.z=t;break;case 3:this.w=t;break;default:throw new Error("index is out of range: "+e)}return this}getComponent(e){switch(e){case 0:return this.x;case 1:return this.y;case 2:return this.z;case 3:return this.w;default:throw new Error("index is out of range: "+e)}}clone(){return new this.constructor(this.x,this.y,this.z,this.w)}copy(e){return this.x=e.x,this.y=e.y,this.z=e.z,this.w=e.w!==void 0?e.w:1,this}add(e){return this.x+=e.x,this.y+=e.y,this.z+=e.z,this.w+=e.w,this}addScalar(e){return this.x+=e,this.y+=e,this.z+=e,this.w+=e,this}addVectors(e,t){return this.x=e.x+t.x,this.y=e.y+t.y,this.z=e.z+t.z,this.w=e.w+t.w,this}addScaledVector(e,t){return this.x+=e.x*t,this.y+=e.y*t,this.z+=e.z*t,this.w+=e.w*t,this}sub(e){return this.x-=e.x,this.y-=e.y,this.z-=e.z,this.w-=e.w,this}subScalar(e){return this.x-=e,this.y-=e,this.z-=e,this.w-=e,this}subVectors(e,t){return this.x=e.x-t.x,this.y=e.y-t.y,this.z=e.z-t.z,this.w=e.w-t.w,this}multiply(e){return this.x*=e.x,this.y*=e.y,this.z*=e.z,this.w*=e.w,this}multiplyScalar(e){return this.x*=e,this.y*=e,this.z*=e,this.w*=e,this}applyMatrix4(e){const t=this.x,i=this.y,s=this.z,r=this.w,o=e.elements;return this.x=o[0]*t+o[4]*i+o[8]*s+o[12]*r,this.y=o[1]*t+o[5]*i+o[9]*s+o[13]*r,this.z=o[2]*t+o[6]*i+o[10]*s+o[14]*r,this.w=o[3]*t+o[7]*i+o[11]*s+o[15]*r,this}divideScalar(e){return this.multiplyScalar(1/e)}setAxisAngleFromQuaternion(e){this.w=2*Math.acos(e.w);const t=Math.sqrt(1-e.w*e.w);return t<1e-4?(this.x=1,this.y=0,this.z=0):(this.x=e.x/t,this.y=e.y/t,this.z=e.z/t),this}setAxisAngleFromRotationMatrix(e){let t,i,s,r;const l=e.elements,g=l[0],u=l[4],C=l[8],d=l[1],h=l[5],f=l[9],v=l[2],y=l[6],A=l[10];if(Math.abs(u-d)<.01&&Math.abs(C-v)<.01&&Math.abs(f-y)<.01){if(Math.abs(u+d)<.1&&Math.abs(C+v)<.1&&Math.abs(f+y)<.1&&Math.abs(g+h+A-3)<.1)return this.set(1,0,0,0),this;t=Math.PI;const m=(g+1)/2,B=(h+1)/2,S=(A+1)/2,x=(u+d)/4,R=(C+v)/4,M=(f+y)/4;return m>B&&m>S?m<.01?(i=0,s=.707106781,r=.707106781):(i=Math.sqrt(m),s=x/i,r=R/i):B>S?B<.01?(i=.707106781,s=0,r=.707106781):(s=Math.sqrt(B),i=x/s,r=M/s):S<.01?(i=.707106781,s=.707106781,r=0):(r=Math.sqrt(S),i=R/r,s=M/r),this.set(i,s,r,t),this}let b=Math.sqrt((y-f)*(y-f)+(C-v)*(C-v)+(d-u)*(d-u));return Math.abs(b)<.001&&(b=1),this.x=(y-f)/b,this.y=(C-v)/b,this.z=(d-u)/b,this.w=Math.acos((g+h+A-1)/2),this}min(e){return this.x=Math.min(this.x,e.x),this.y=Math.min(this.y,e.y),this.z=Math.min(this.z,e.z),this.w=Math.min(this.w,e.w),this}max(e){return this.x=Math.max(this.x,e.x),this.y=Math.max(this.y,e.y),this.z=Math.max(this.z,e.z),this.w=Math.max(this.w,e.w),this}clamp(e,t){return this.x=Math.max(e.x,Math.min(t.x,this.x)),this.y=Math.max(e.y,Math.min(t.y,this.y)),this.z=Math.max(e.z,Math.min(t.z,this.z)),this.w=Math.max(e.w,Math.min(t.w,this.w)),this}clampScalar(e,t){return this.x=Math.max(e,Math.min(t,this.x)),this.y=Math.max(e,Math.min(t,this.y)),this.z=Math.max(e,Math.min(t,this.z)),this.w=Math.max(e,Math.min(t,this.w)),this}clampLength(e,t){const i=this.length();return this.divideScalar(i||1).multiplyScalar(Math.max(e,Math.min(t,i)))}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=this.x<0?Math.ceil(this.x):Math.floor(this.x),this.y=this.y<0?Math.ceil(this.y):Math.floor(this.y),this.z=this.z<0?Math.ceil(this.z):Math.floor(this.z),this.w=this.w<0?Math.ceil(this.w):Math.floor(this.w),this}negate(){return this.x=-this.x,this.y=-this.y,this.z=-this.z,this.w=-this.w,this}dot(e){return this.x*e.x+this.y*e.y+this.z*e.z+this.w*e.w}lengthSq(){return this.x*this.x+this.y*this.y+this.z*this.z+this.w*this.w}length(){return Math.sqrt(this.x*this.x+this.y*this.y+this.z*this.z+this.w*this.w)}manhattanLength(){return Math.abs(this.x)+Math.abs(this.y)+Math.abs(this.z)+Math.abs(this.w)}normalize(){return this.divideScalar(this.length()||1)}setLength(e){return this.normalize().multiplyScalar(e)}lerp(e,t){return this.x+=(e.x-this.x)*t,this.y+=(e.y-this.y)*t,this.z+=(e.z-this.z)*t,this.w+=(e.w-this.w)*t,this}lerpVectors(e,t,i){return this.x=e.x+(t.x-e.x)*i,this.y=e.y+(t.y-e.y)*i,this.z=e.z+(t.z-e.z)*i,this.w=e.w+(t.w-e.w)*i,this}equals(e){return e.x===this.x&&e.y===this.y&&e.z===this.z&&e.w===this.w}fromArray(e,t=0){return this.x=e[t],this.y=e[t+1],this.z=e[t+2],this.w=e[t+3],this}toArray(e=[],t=0){return e[t]=this.x,e[t+1]=this.y,e[t+2]=this.z,e[t+3]=this.w,e}fromBufferAttribute(e,t){return this.x=e.getX(t),this.y=e.getY(t),this.z=e.getZ(t),this.w=e.getW(t),this}random(){return this.x=Math.random(),this.y=Math.random(),this.z=Math.random(),this.w=Math.random(),this}*[Symbol.iterator](){yield this.x,yield this.y,yield this.z,yield this.w}}class Nt extends Ps{constructor(e=1,t=1,i={}){super(),this.isWebGLRenderTarget=!0,this.width=e,this.height=t,this.depth=1,this.scissor=new Yt(0,0,e,t),this.scissorTest=!1,this.viewport=new Yt(0,0,e,t);const s={width:e,height:t,depth:1};i.encoding!==void 0&&(su("THREE.WebGLRenderTarget: option.encoding has been replaced by option.colorSpace."),i.colorSpace=i.encoding===ks?yt:vo),this.texture=new sn(s,i.mapping,i.wrapS,i.wrapT,i.magFilter,i.minFilter,i.format,i.type,i.anisotropy,i.colorSpace),this.texture.isRenderTargetTexture=!0,this.texture.flipY=!1,this.texture.generateMipmaps=i.generateMipmaps!==void 0?i.generateMipmaps:!1,this.texture.internalFormat=i.internalFormat!==void 0?i.internalFormat:null,this.texture.minFilter=i.minFilter!==void 0?i.minFilter:st,this.depthBuffer=i.depthBuffer!==void 0?i.depthBuffer:!0,this.stencilBuffer=i.stencilBuffer!==void 0?i.stencilBuffer:!1,this.depthTexture=i.depthTexture!==void 0?i.depthTexture:null,this.samples=i.samples!==void 0?i.samples:0}setSize(e,t,i=1){(this.width!==e||this.height!==t||this.depth!==i)&&(this.width=e,this.height=t,this.depth=i,this.texture.image.width=e,this.texture.image.height=t,this.texture.image.depth=i,this.dispose()),this.viewport.set(0,0,e,t),this.scissor.set(0,0,e,t)}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.texture=e.texture.clone(),this.texture.isRenderTargetTexture=!0;const t=Object.assign({},e.texture.image);return this.texture.source=new Il(t),this.depthBuffer=e.depthBuffer,this.stencilBuffer=e.stencilBuffer,e.depthTexture!==null&&(this.depthTexture=e.depthTexture.clone()),this.samples=e.samples,this}dispose(){this.dispatchEvent({type:"dispose"})}}class ip extends sn{constructor(e=null,t=1,i=1,s=1){super(null),this.isDataArrayTexture=!0,this.image={data:e,width:t,height:i,depth:s},this.magFilter=vt,this.minFilter=vt,this.wrapR=Pn,this.generateMipmaps=!1,this.flipY=!1,this.unpackAlignment=1}}class UF extends Nt{constructor(e=1,t=1,i=1){super(e,t),this.isWebGLArrayRenderTarget=!0,this.depth=i,this.texture=new ip(null,e,t,i),this.texture.isRenderTargetTexture=!0}}class fl extends sn{constructor(e=null,t=1,i=1,s=1){super(null),this.isData3DTexture=!0,this.image={data:e,width:t,height:i,depth:s},this.magFilter=vt,this.minFilter=vt,this.wrapR=Pn,this.generateMipmaps=!1,this.flipY=!1,this.unpackAlignment=1}}class PF extends Nt{constructor(e=1,t=1,i=1){super(e,t),this.isWebGL3DRenderTarget=!0,this.depth=i,this.texture=new fl(null,e,t,i),this.texture.isRenderTargetTexture=!0}}class MW extends Nt{constructor(e=1,t=1,i=1,s={}){super(e,t,s),this.isWebGLMultipleRenderTargets=!0;const r=this.texture;this.texture=[];for(let o=0;o=0?1:-1,m=1-A*A;if(m>Number.EPSILON){const S=Math.sqrt(m),x=Math.atan2(S,A*b);y=Math.sin(y*x)/S,a=Math.sin(a*x)/S}const B=a*b;if(l=l*y+d*B,g=g*y+h*B,u=u*y+f*B,C=C*y+v*B,y===1-a){const S=1/Math.sqrt(l*l+g*g+u*u+C*C);l*=S,g*=S,u*=S,C*=S}}e[t]=l,e[t+1]=g,e[t+2]=u,e[t+3]=C}static multiplyQuaternionsFlat(e,t,i,s,r,o){const a=i[s],l=i[s+1],g=i[s+2],u=i[s+3],C=r[o],d=r[o+1],h=r[o+2],f=r[o+3];return e[t]=a*f+u*C+l*h-g*d,e[t+1]=l*f+u*d+g*C-a*h,e[t+2]=g*f+u*h+a*d-l*C,e[t+3]=u*f-a*C-l*d-g*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,t,i,s){return this._x=e,this._y=t,this._z=i,this._w=s,this._onChangeCallback(),this}clone(){return new this.constructor(this._x,this._y,this._z,this._w)}copy(e){return this._x=e.x,this._y=e.y,this._z=e.z,this._w=e.w,this._onChangeCallback(),this}setFromEuler(e,t){const i=e._x,s=e._y,r=e._z,o=e._order,a=Math.cos,l=Math.sin,g=a(i/2),u=a(s/2),C=a(r/2),d=l(i/2),h=l(s/2),f=l(r/2);switch(o){case"XYZ":this._x=d*u*C+g*h*f,this._y=g*h*C-d*u*f,this._z=g*u*f+d*h*C,this._w=g*u*C-d*h*f;break;case"YXZ":this._x=d*u*C+g*h*f,this._y=g*h*C-d*u*f,this._z=g*u*f-d*h*C,this._w=g*u*C+d*h*f;break;case"ZXY":this._x=d*u*C-g*h*f,this._y=g*h*C+d*u*f,this._z=g*u*f+d*h*C,this._w=g*u*C-d*h*f;break;case"ZYX":this._x=d*u*C-g*h*f,this._y=g*h*C+d*u*f,this._z=g*u*f-d*h*C,this._w=g*u*C+d*h*f;break;case"YZX":this._x=d*u*C+g*h*f,this._y=g*h*C+d*u*f,this._z=g*u*f-d*h*C,this._w=g*u*C-d*h*f;break;case"XZY":this._x=d*u*C-g*h*f,this._y=g*h*C-d*u*f,this._z=g*u*f+d*h*C,this._w=g*u*C+d*h*f;break;default:console.warn("THREE.Quaternion: .setFromEuler() encountered an unknown order: "+o)}return t!==!1&&this._onChangeCallback(),this}setFromAxisAngle(e,t){const i=t/2,s=Math.sin(i);return this._x=e.x*s,this._y=e.y*s,this._z=e.z*s,this._w=Math.cos(i),this._onChangeCallback(),this}setFromRotationMatrix(e){const t=e.elements,i=t[0],s=t[4],r=t[8],o=t[1],a=t[5],l=t[9],g=t[2],u=t[6],C=t[10],d=i+a+C;if(d>0){const h=.5/Math.sqrt(d+1);this._w=.25/h,this._x=(u-l)*h,this._y=(r-g)*h,this._z=(o-s)*h}else if(i>a&&i>C){const h=2*Math.sqrt(1+i-a-C);this._w=(u-l)/h,this._x=.25*h,this._y=(s+o)/h,this._z=(r+g)/h}else if(a>C){const h=2*Math.sqrt(1+a-i-C);this._w=(r-g)/h,this._x=(s+o)/h,this._y=.25*h,this._z=(l+u)/h}else{const h=2*Math.sqrt(1+C-i-a);this._w=(o-s)/h,this._x=(r+g)/h,this._y=(l+u)/h,this._z=.25*h}return this._onChangeCallback(),this}setFromUnitVectors(e,t){let i=e.dot(t)+1;return iMath.abs(e.z)?(this._x=-e.y,this._y=e.x,this._z=0,this._w=i):(this._x=0,this._y=-e.z,this._z=e.y,this._w=i)):(this._x=e.y*t.z-e.z*t.y,this._y=e.z*t.x-e.x*t.z,this._z=e.x*t.y-e.y*t.x,this._w=i),this.normalize()}angleTo(e){return 2*Math.acos(Math.abs(Sn(this.dot(e),-1,1)))}rotateTowards(e,t){const i=this.angleTo(e);if(i===0)return this;const s=Math.min(1,t/i);return this.slerp(e,s),this}identity(){return this.set(0,0,0,1)}invert(){return this.conjugate()}conjugate(){return this._x*=-1,this._y*=-1,this._z*=-1,this._onChangeCallback(),this}dot(e){return this._x*e._x+this._y*e._y+this._z*e._z+this._w*e._w}lengthSq(){return this._x*this._x+this._y*this._y+this._z*this._z+this._w*this._w}length(){return Math.sqrt(this._x*this._x+this._y*this._y+this._z*this._z+this._w*this._w)}normalize(){let e=this.length();return e===0?(this._x=0,this._y=0,this._z=0,this._w=1):(e=1/e,this._x=this._x*e,this._y=this._y*e,this._z=this._z*e,this._w=this._w*e),this._onChangeCallback(),this}multiply(e){return this.multiplyQuaternions(this,e)}premultiply(e){return this.multiplyQuaternions(e,this)}multiplyQuaternions(e,t){const i=e._x,s=e._y,r=e._z,o=e._w,a=t._x,l=t._y,g=t._z,u=t._w;return this._x=i*u+o*a+s*g-r*l,this._y=s*u+o*l+r*a-i*g,this._z=r*u+o*g+i*l-s*a,this._w=o*u-i*a-s*l-r*g,this._onChangeCallback(),this}slerp(e,t){if(t===0)return this;if(t===1)return this.copy(e);const i=this._x,s=this._y,r=this._z,o=this._w;let a=o*e._w+i*e._x+s*e._y+r*e._z;if(a<0?(this._w=-e._w,this._x=-e._x,this._y=-e._y,this._z=-e._z,a=-a):this.copy(e),a>=1)return this._w=o,this._x=i,this._y=s,this._z=r,this;const l=1-a*a;if(l<=Number.EPSILON){const h=1-t;return this._w=h*o+t*this._w,this._x=h*i+t*this._x,this._y=h*s+t*this._y,this._z=h*r+t*this._z,this.normalize(),this._onChangeCallback(),this}const g=Math.sqrt(l),u=Math.atan2(g,a),C=Math.sin((1-t)*u)/g,d=Math.sin(t*u)/g;return this._w=o*C+this._w*d,this._x=i*C+this._x*d,this._y=s*C+this._y*d,this._z=r*C+this._z*d,this._onChangeCallback(),this}slerpQuaternions(e,t,i){return this.copy(e).slerp(t,i)}random(){const e=Math.random(),t=Math.sqrt(1-e),i=Math.sqrt(e),s=2*Math.PI*Math.random(),r=2*Math.PI*Math.random();return this.set(t*Math.cos(s),i*Math.sin(r),i*Math.cos(r),t*Math.sin(s))}equals(e){return e._x===this._x&&e._y===this._y&&e._z===this._z&&e._w===this._w}fromArray(e,t=0){return this._x=e[t],this._y=e[t+1],this._z=e[t+2],this._w=e[t+3],this._onChangeCallback(),this}toArray(e=[],t=0){return e[t]=this._x,e[t+1]=this._y,e[t+2]=this._z,e[t+3]=this._w,e}fromBufferAttribute(e,t){return this._x=e.getX(t),this._y=e.getY(t),this._z=e.getZ(t),this._w=e.getW(t),this}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 H{constructor(e=0,t=0,i=0){H.prototype.isVector3=!0,this.x=e,this.y=t,this.z=i}set(e,t,i){return i===void 0&&(i=this.z),this.x=e,this.y=t,this.z=i,this}setScalar(e){return this.x=e,this.y=e,this.z=e,this}setX(e){return this.x=e,this}setY(e){return this.y=e,this}setZ(e){return this.z=e,this}setComponent(e,t){switch(e){case 0:this.x=t;break;case 1:this.y=t;break;case 2:this.z=t;break;default:throw new Error("index is out of range: "+e)}return this}getComponent(e){switch(e){case 0:return this.x;case 1:return this.y;case 2:return this.z;default:throw new Error("index is out of range: "+e)}}clone(){return new this.constructor(this.x,this.y,this.z)}copy(e){return this.x=e.x,this.y=e.y,this.z=e.z,this}add(e){return this.x+=e.x,this.y+=e.y,this.z+=e.z,this}addScalar(e){return this.x+=e,this.y+=e,this.z+=e,this}addVectors(e,t){return this.x=e.x+t.x,this.y=e.y+t.y,this.z=e.z+t.z,this}addScaledVector(e,t){return this.x+=e.x*t,this.y+=e.y*t,this.z+=e.z*t,this}sub(e){return this.x-=e.x,this.y-=e.y,this.z-=e.z,this}subScalar(e){return this.x-=e,this.y-=e,this.z-=e,this}subVectors(e,t){return this.x=e.x-t.x,this.y=e.y-t.y,this.z=e.z-t.z,this}multiply(e){return this.x*=e.x,this.y*=e.y,this.z*=e.z,this}multiplyScalar(e){return this.x*=e,this.y*=e,this.z*=e,this}multiplyVectors(e,t){return this.x=e.x*t.x,this.y=e.y*t.y,this.z=e.z*t.z,this}applyEuler(e){return this.applyQuaternion(rZ.setFromEuler(e))}applyAxisAngle(e,t){return this.applyQuaternion(rZ.setFromAxisAngle(e,t))}applyMatrix3(e){const t=this.x,i=this.y,s=this.z,r=e.elements;return this.x=r[0]*t+r[3]*i+r[6]*s,this.y=r[1]*t+r[4]*i+r[7]*s,this.z=r[2]*t+r[5]*i+r[8]*s,this}applyNormalMatrix(e){return this.applyMatrix3(e).normalize()}applyMatrix4(e){const t=this.x,i=this.y,s=this.z,r=e.elements,o=1/(r[3]*t+r[7]*i+r[11]*s+r[15]);return this.x=(r[0]*t+r[4]*i+r[8]*s+r[12])*o,this.y=(r[1]*t+r[5]*i+r[9]*s+r[13])*o,this.z=(r[2]*t+r[6]*i+r[10]*s+r[14])*o,this}applyQuaternion(e){const t=this.x,i=this.y,s=this.z,r=e.x,o=e.y,a=e.z,l=e.w,g=l*t+o*s-a*i,u=l*i+a*t-r*s,C=l*s+r*i-o*t,d=-r*t-o*i-a*s;return this.x=g*l+d*-r+u*-a-C*-o,this.y=u*l+d*-o+C*-r-g*-a,this.z=C*l+d*-a+g*-o-u*-r,this}project(e){return this.applyMatrix4(e.matrixWorldInverse).applyMatrix4(e.projectionMatrix)}unproject(e){return this.applyMatrix4(e.projectionMatrixInverse).applyMatrix4(e.matrixWorld)}transformDirection(e){const t=this.x,i=this.y,s=this.z,r=e.elements;return this.x=r[0]*t+r[4]*i+r[8]*s,this.y=r[1]*t+r[5]*i+r[9]*s,this.z=r[2]*t+r[6]*i+r[10]*s,this.normalize()}divide(e){return this.x/=e.x,this.y/=e.y,this.z/=e.z,this}divideScalar(e){return this.multiplyScalar(1/e)}min(e){return this.x=Math.min(this.x,e.x),this.y=Math.min(this.y,e.y),this.z=Math.min(this.z,e.z),this}max(e){return this.x=Math.max(this.x,e.x),this.y=Math.max(this.y,e.y),this.z=Math.max(this.z,e.z),this}clamp(e,t){return this.x=Math.max(e.x,Math.min(t.x,this.x)),this.y=Math.max(e.y,Math.min(t.y,this.y)),this.z=Math.max(e.z,Math.min(t.z,this.z)),this}clampScalar(e,t){return this.x=Math.max(e,Math.min(t,this.x)),this.y=Math.max(e,Math.min(t,this.y)),this.z=Math.max(e,Math.min(t,this.z)),this}clampLength(e,t){const i=this.length();return this.divideScalar(i||1).multiplyScalar(Math.max(e,Math.min(t,i)))}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=this.x<0?Math.ceil(this.x):Math.floor(this.x),this.y=this.y<0?Math.ceil(this.y):Math.floor(this.y),this.z=this.z<0?Math.ceil(this.z):Math.floor(this.z),this}negate(){return this.x=-this.x,this.y=-this.y,this.z=-this.z,this}dot(e){return this.x*e.x+this.y*e.y+this.z*e.z}lengthSq(){return this.x*this.x+this.y*this.y+this.z*this.z}length(){return Math.sqrt(this.x*this.x+this.y*this.y+this.z*this.z)}manhattanLength(){return Math.abs(this.x)+Math.abs(this.y)+Math.abs(this.z)}normalize(){return this.divideScalar(this.length()||1)}setLength(e){return this.normalize().multiplyScalar(e)}lerp(e,t){return this.x+=(e.x-this.x)*t,this.y+=(e.y-this.y)*t,this.z+=(e.z-this.z)*t,this}lerpVectors(e,t,i){return this.x=e.x+(t.x-e.x)*i,this.y=e.y+(t.y-e.y)*i,this.z=e.z+(t.z-e.z)*i,this}cross(e){return this.crossVectors(this,e)}crossVectors(e,t){const i=e.x,s=e.y,r=e.z,o=t.x,a=t.y,l=t.z;return this.x=s*l-r*a,this.y=r*o-i*l,this.z=i*a-s*o,this}projectOnVector(e){const t=e.lengthSq();if(t===0)return this.set(0,0,0);const i=e.dot(this)/t;return this.copy(e).multiplyScalar(i)}projectOnPlane(e){return sm.copy(this).projectOnVector(e),this.sub(sm)}reflect(e){return this.sub(sm.copy(e).multiplyScalar(2*this.dot(e)))}angleTo(e){const t=Math.sqrt(this.lengthSq()*e.lengthSq());if(t===0)return Math.PI/2;const i=this.dot(e)/t;return Math.acos(Sn(i,-1,1))}distanceTo(e){return Math.sqrt(this.distanceToSquared(e))}distanceToSquared(e){const t=this.x-e.x,i=this.y-e.y,s=this.z-e.z;return t*t+i*i+s*s}manhattanDistanceTo(e){return Math.abs(this.x-e.x)+Math.abs(this.y-e.y)+Math.abs(this.z-e.z)}setFromSpherical(e){return this.setFromSphericalCoords(e.radius,e.phi,e.theta)}setFromSphericalCoords(e,t,i){const s=Math.sin(t)*e;return this.x=s*Math.sin(i),this.y=Math.cos(t)*e,this.z=s*Math.cos(i),this}setFromCylindrical(e){return this.setFromCylindricalCoords(e.radius,e.theta,e.y)}setFromCylindricalCoords(e,t,i){return this.x=e*Math.sin(t),this.y=i,this.z=e*Math.cos(t),this}setFromMatrixPosition(e){const t=e.elements;return this.x=t[12],this.y=t[13],this.z=t[14],this}setFromMatrixScale(e){const t=this.setFromMatrixColumn(e,0).length(),i=this.setFromMatrixColumn(e,1).length(),s=this.setFromMatrixColumn(e,2).length();return this.x=t,this.y=i,this.z=s,this}setFromMatrixColumn(e,t){return this.fromArray(e.elements,t*4)}setFromMatrix3Column(e,t){return this.fromArray(e.elements,t*3)}setFromEuler(e){return this.x=e._x,this.y=e._y,this.z=e._z,this}setFromColor(e){return this.x=e.r,this.y=e.g,this.z=e.b,this}equals(e){return e.x===this.x&&e.y===this.y&&e.z===this.z}fromArray(e,t=0){return this.x=e[t],this.y=e[t+1],this.z=e[t+2],this}toArray(e=[],t=0){return e[t]=this.x,e[t+1]=this.y,e[t+2]=this.z,e}fromBufferAttribute(e,t){return this.x=e.getX(t),this.y=e.getY(t),this.z=e.getZ(t),this}random(){return this.x=Math.random(),this.y=Math.random(),this.z=Math.random(),this}randomDirection(){const e=(Math.random()-.5)*2,t=Math.random()*Math.PI*2,i=Math.sqrt(1-e**2);return this.x=i*Math.cos(t),this.y=i*Math.sin(t),this.z=e,this}*[Symbol.iterator](){yield this.x,yield this.y,yield this.z}}const sm=new H,rZ=new Mn;class kr{constructor(e=new H(1/0,1/0,1/0),t=new H(-1/0,-1/0,-1/0)){this.isBox3=!0,this.min=e,this.max=t}set(e,t){return this.min.copy(e),this.max.copy(t),this}setFromArray(e){this.makeEmpty();for(let t=0,i=e.length;tthis.max.x||e.ythis.max.y||e.zthis.max.z)}containsBox(e){return this.min.x<=e.min.x&&e.max.x<=this.max.x&&this.min.y<=e.min.y&&e.max.y<=this.max.y&&this.min.z<=e.min.z&&e.max.z<=this.max.z}getParameter(e,t){return t.set((e.x-this.min.x)/(this.max.x-this.min.x),(e.y-this.min.y)/(this.max.y-this.min.y),(e.z-this.min.z)/(this.max.z-this.min.z))}intersectsBox(e){return!(e.max.xthis.max.x||e.max.ythis.max.y||e.max.zthis.max.z)}intersectsSphere(e){return this.clampPoint(e.center,to),to.distanceToSquared(e.center)<=e.radius*e.radius}intersectsPlane(e){let t,i;return e.normal.x>0?(t=e.normal.x*this.min.x,i=e.normal.x*this.max.x):(t=e.normal.x*this.max.x,i=e.normal.x*this.min.x),e.normal.y>0?(t+=e.normal.y*this.min.y,i+=e.normal.y*this.max.y):(t+=e.normal.y*this.max.y,i+=e.normal.y*this.min.y),e.normal.z>0?(t+=e.normal.z*this.min.z,i+=e.normal.z*this.max.z):(t+=e.normal.z*this.max.z,i+=e.normal.z*this.min.z),t<=-e.constant&&i>=-e.constant}intersectsTriangle(e){if(this.isEmpty())return!1;this.getCenter(CI),Md.subVectors(this.max,CI),sg.subVectors(e.a,CI),rg.subVectors(e.b,CI),og.subVectors(e.c,CI),Do.subVectors(rg,sg),Uo.subVectors(og,rg),Ea.subVectors(sg,og);let t=[0,-Do.z,Do.y,0,-Uo.z,Uo.y,0,-Ea.z,Ea.y,Do.z,0,-Do.x,Uo.z,0,-Uo.x,Ea.z,0,-Ea.x,-Do.y,Do.x,0,-Uo.y,Uo.x,0,-Ea.y,Ea.x,0];return!rm(t,sg,rg,og,Md)||(t=[1,0,0,0,1,0,0,0,1],!rm(t,sg,rg,og,Md))?!1:(Nd.crossVectors(Do,Uo),t=[Nd.x,Nd.y,Nd.z],rm(t,sg,rg,og,Md))}clampPoint(e,t){return t.copy(e).clamp(this.min,this.max)}distanceToPoint(e){return this.clampPoint(e,to).distanceTo(e)}getBoundingSphere(e){return this.isEmpty()?e.makeEmpty():(this.getCenter(e.center),e.radius=this.getSize(to).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:(eo[0].set(this.min.x,this.min.y,this.min.z).applyMatrix4(e),eo[1].set(this.min.x,this.min.y,this.max.z).applyMatrix4(e),eo[2].set(this.min.x,this.max.y,this.min.z).applyMatrix4(e),eo[3].set(this.min.x,this.max.y,this.max.z).applyMatrix4(e),eo[4].set(this.max.x,this.min.y,this.min.z).applyMatrix4(e),eo[5].set(this.max.x,this.min.y,this.max.z).applyMatrix4(e),eo[6].set(this.max.x,this.max.y,this.min.z).applyMatrix4(e),eo[7].set(this.max.x,this.max.y,this.max.z).applyMatrix4(e),this.setFromPoints(eo),this)}translate(e){return this.min.add(e),this.max.add(e),this}equals(e){return e.min.equals(this.min)&&e.max.equals(this.max)}}const eo=[new H,new H,new H,new H,new H,new H,new H,new H],to=new H,ig=new kr,sg=new H,rg=new H,og=new H,Do=new H,Uo=new H,Ea=new H,CI=new H,Md=new H,Nd=new H,Ta=new H;function rm(n,e,t,i,s){for(let r=0,o=n.length-3;r<=o;r+=3){Ta.fromArray(n,r);const a=s.x*Math.abs(Ta.x)+s.y*Math.abs(Ta.y)+s.z*Math.abs(Ta.z),l=e.dot(Ta),g=t.dot(Ta),u=i.dot(Ta);if(Math.max(-Math.max(l,g,u),Math.min(l,g,u))>a)return!1}return!0}const _F=new kr,dI=new H,om=new H;class Dr{constructor(e=new H,t=-1){this.center=e,this.radius=t}set(e,t){return this.center.copy(e),this.radius=t,this}setFromPoints(e,t){const i=this.center;t!==void 0?i.copy(t):_F.setFromPoints(e).getCenter(i);let s=0;for(let r=0,o=e.length;rthis.radius*this.radius&&(t.sub(this.center).normalize(),t.multiplyScalar(this.radius).add(this.center)),t}getBoundingBox(e){return this.isEmpty()?(e.makeEmpty(),e):(e.set(this.center,this.center),e.expandByScalar(this.radius),e)}applyMatrix4(e){return this.center.applyMatrix4(e),this.radius=this.radius*e.getMaxScaleOnAxis(),this}translate(e){return this.center.add(e),this}expandByPoint(e){if(this.isEmpty())return this.center.copy(e),this.radius=0,this;dI.subVectors(e,this.center);const t=dI.lengthSq();if(t>this.radius*this.radius){const i=Math.sqrt(t),s=(i-this.radius)*.5;this.center.addScaledVector(dI,s/i),this.radius+=s}return this}union(e){return e.isEmpty()?this:this.isEmpty()?(this.copy(e),this):(this.center.equals(e.center)===!0?this.radius=Math.max(this.radius,e.radius):(om.subVectors(e.center,this.center).setLength(e.radius),this.expandByPoint(dI.copy(e.center).add(om)),this.expandByPoint(dI.copy(e.center).sub(om))),this)}equals(e){return e.center.equals(this.center)&&e.radius===this.radius}clone(){return new this.constructor().copy(this)}}const no=new H,am=new H,Hd=new H,Po=new H,lm=new H,Xd=new H,gm=new H;let rC=class{constructor(e=new H,t=new H(0,0,-1)){this.origin=e,this.direction=t}set(e,t){return this.origin.copy(e),this.direction.copy(t),this}copy(e){return this.origin.copy(e.origin),this.direction.copy(e.direction),this}at(e,t){return t.copy(this.origin).addScaledVector(this.direction,e)}lookAt(e){return this.direction.copy(e).sub(this.origin).normalize(),this}recast(e){return this.origin.copy(this.at(e,no)),this}closestPointToPoint(e,t){t.subVectors(e,this.origin);const i=t.dot(this.direction);return i<0?t.copy(this.origin):t.copy(this.origin).addScaledVector(this.direction,i)}distanceToPoint(e){return Math.sqrt(this.distanceSqToPoint(e))}distanceSqToPoint(e){const t=no.subVectors(e,this.origin).dot(this.direction);return t<0?this.origin.distanceToSquared(e):(no.copy(this.origin).addScaledVector(this.direction,t),no.distanceToSquared(e))}distanceSqToSegment(e,t,i,s){am.copy(e).add(t).multiplyScalar(.5),Hd.copy(t).sub(e).normalize(),Po.copy(this.origin).sub(am);const r=e.distanceTo(t)*.5,o=-this.direction.dot(Hd),a=Po.dot(this.direction),l=-Po.dot(Hd),g=Po.lengthSq(),u=Math.abs(1-o*o);let C,d,h,f;if(u>0)if(C=o*l-a,d=o*a-l,f=r*u,C>=0)if(d>=-f)if(d<=f){const v=1/u;C*=v,d*=v,h=C*(C+o*d+2*a)+d*(o*C+d+2*l)+g}else d=r,C=Math.max(0,-(o*d+a)),h=-C*C+d*(d+2*l)+g;else d=-r,C=Math.max(0,-(o*d+a)),h=-C*C+d*(d+2*l)+g;else d<=-f?(C=Math.max(0,-(-o*r+a)),d=C>0?-r:Math.min(Math.max(-r,-l),r),h=-C*C+d*(d+2*l)+g):d<=f?(C=0,d=Math.min(Math.max(-r,-l),r),h=d*(d+2*l)+g):(C=Math.max(0,-(o*r+a)),d=C>0?r:Math.min(Math.max(-r,-l),r),h=-C*C+d*(d+2*l)+g);else d=o>0?-r:r,C=Math.max(0,-(o*d+a)),h=-C*C+d*(d+2*l)+g;return i&&i.copy(this.origin).addScaledVector(this.direction,C),s&&s.copy(am).addScaledVector(Hd,d),h}intersectSphere(e,t){no.subVectors(e.center,this.origin);const i=no.dot(this.direction),s=no.dot(no)-i*i,r=e.radius*e.radius;if(s>r)return null;const o=Math.sqrt(r-s),a=i-o,l=i+o;return l<0?null:a<0?this.at(l,t):this.at(a,t)}intersectsSphere(e){return this.distanceSqToPoint(e.center)<=e.radius*e.radius}distanceToPlane(e){const t=e.normal.dot(this.direction);if(t===0)return e.distanceToPoint(this.origin)===0?0:null;const i=-(this.origin.dot(e.normal)+e.constant)/t;return i>=0?i:null}intersectPlane(e,t){const i=this.distanceToPlane(e);return i===null?null:this.at(i,t)}intersectsPlane(e){const t=e.distanceToPoint(this.origin);return t===0||e.normal.dot(this.direction)*t<0}intersectBox(e,t){let i,s,r,o,a,l;const g=1/this.direction.x,u=1/this.direction.y,C=1/this.direction.z,d=this.origin;return g>=0?(i=(e.min.x-d.x)*g,s=(e.max.x-d.x)*g):(i=(e.max.x-d.x)*g,s=(e.min.x-d.x)*g),u>=0?(r=(e.min.y-d.y)*u,o=(e.max.y-d.y)*u):(r=(e.max.y-d.y)*u,o=(e.min.y-d.y)*u),i>o||r>s||((r>i||isNaN(i))&&(i=r),(o=0?(a=(e.min.z-d.z)*C,l=(e.max.z-d.z)*C):(a=(e.max.z-d.z)*C,l=(e.min.z-d.z)*C),i>l||a>s)||((a>i||i!==i)&&(i=a),(l=0?i:s,t)}intersectsBox(e){return this.intersectBox(e,no)!==null}intersectTriangle(e,t,i,s,r){lm.subVectors(t,e),Xd.subVectors(i,e),gm.crossVectors(lm,Xd);let o=this.direction.dot(gm),a;if(o>0){if(s)return null;a=1}else if(o<0)a=-1,o=-o;else return null;Po.subVectors(this.origin,e);const l=a*this.direction.dot(Xd.crossVectors(Po,Xd));if(l<0)return null;const g=a*this.direction.dot(lm.cross(Po));if(g<0||l+g>o)return null;const u=-a*Po.dot(gm);return u<0?null:this.at(u/o,r)}applyMatrix4(e){return this.origin.applyMatrix4(e),this.direction.transformDirection(e),this}equals(e){return e.origin.equals(this.origin)&&e.direction.equals(this.direction)}clone(){return new this.constructor().copy(this)}};class _e{constructor(){_e.prototype.isMatrix4=!0,this.elements=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1]}set(e,t,i,s,r,o,a,l,g,u,C,d,h,f,v,y){const A=this.elements;return A[0]=e,A[4]=t,A[8]=i,A[12]=s,A[1]=r,A[5]=o,A[9]=a,A[13]=l,A[2]=g,A[6]=u,A[10]=C,A[14]=d,A[3]=h,A[7]=f,A[11]=v,A[15]=y,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 _e().fromArray(this.elements)}copy(e){const t=this.elements,i=e.elements;return t[0]=i[0],t[1]=i[1],t[2]=i[2],t[3]=i[3],t[4]=i[4],t[5]=i[5],t[6]=i[6],t[7]=i[7],t[8]=i[8],t[9]=i[9],t[10]=i[10],t[11]=i[11],t[12]=i[12],t[13]=i[13],t[14]=i[14],t[15]=i[15],this}copyPosition(e){const t=this.elements,i=e.elements;return t[12]=i[12],t[13]=i[13],t[14]=i[14],this}setFromMatrix3(e){const t=e.elements;return this.set(t[0],t[3],t[6],0,t[1],t[4],t[7],0,t[2],t[5],t[8],0,0,0,0,1),this}extractBasis(e,t,i){return e.setFromMatrixColumn(this,0),t.setFromMatrixColumn(this,1),i.setFromMatrixColumn(this,2),this}makeBasis(e,t,i){return this.set(e.x,t.x,i.x,0,e.y,t.y,i.y,0,e.z,t.z,i.z,0,0,0,0,1),this}extractRotation(e){const t=this.elements,i=e.elements,s=1/ag.setFromMatrixColumn(e,0).length(),r=1/ag.setFromMatrixColumn(e,1).length(),o=1/ag.setFromMatrixColumn(e,2).length();return t[0]=i[0]*s,t[1]=i[1]*s,t[2]=i[2]*s,t[3]=0,t[4]=i[4]*r,t[5]=i[5]*r,t[6]=i[6]*r,t[7]=0,t[8]=i[8]*o,t[9]=i[9]*o,t[10]=i[10]*o,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,this}makeRotationFromEuler(e){const t=this.elements,i=e.x,s=e.y,r=e.z,o=Math.cos(i),a=Math.sin(i),l=Math.cos(s),g=Math.sin(s),u=Math.cos(r),C=Math.sin(r);if(e.order==="XYZ"){const d=o*u,h=o*C,f=a*u,v=a*C;t[0]=l*u,t[4]=-l*C,t[8]=g,t[1]=h+f*g,t[5]=d-v*g,t[9]=-a*l,t[2]=v-d*g,t[6]=f+h*g,t[10]=o*l}else if(e.order==="YXZ"){const d=l*u,h=l*C,f=g*u,v=g*C;t[0]=d+v*a,t[4]=f*a-h,t[8]=o*g,t[1]=o*C,t[5]=o*u,t[9]=-a,t[2]=h*a-f,t[6]=v+d*a,t[10]=o*l}else if(e.order==="ZXY"){const d=l*u,h=l*C,f=g*u,v=g*C;t[0]=d-v*a,t[4]=-o*C,t[8]=f+h*a,t[1]=h+f*a,t[5]=o*u,t[9]=v-d*a,t[2]=-o*g,t[6]=a,t[10]=o*l}else if(e.order==="ZYX"){const d=o*u,h=o*C,f=a*u,v=a*C;t[0]=l*u,t[4]=f*g-h,t[8]=d*g+v,t[1]=l*C,t[5]=v*g+d,t[9]=h*g-f,t[2]=-g,t[6]=a*l,t[10]=o*l}else if(e.order==="YZX"){const d=o*l,h=o*g,f=a*l,v=a*g;t[0]=l*u,t[4]=v-d*C,t[8]=f*C+h,t[1]=C,t[5]=o*u,t[9]=-a*u,t[2]=-g*u,t[6]=h*C+f,t[10]=d-v*C}else if(e.order==="XZY"){const d=o*l,h=o*g,f=a*l,v=a*g;t[0]=l*u,t[4]=-C,t[8]=g*u,t[1]=d*C+v,t[5]=o*u,t[9]=h*C-f,t[2]=f*C-h,t[6]=a*u,t[10]=v*C+d}return t[3]=0,t[7]=0,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,this}makeRotationFromQuaternion(e){return this.compose(JF,e,OF)}lookAt(e,t,i){const s=this.elements;return Cs.subVectors(e,t),Cs.lengthSq()===0&&(Cs.z=1),Cs.normalize(),_o.crossVectors(i,Cs),_o.lengthSq()===0&&(Math.abs(i.z)===1?Cs.x+=1e-4:Cs.z+=1e-4,Cs.normalize(),_o.crossVectors(i,Cs)),_o.normalize(),Fd.crossVectors(Cs,_o),s[0]=_o.x,s[4]=Fd.x,s[8]=Cs.x,s[1]=_o.y,s[5]=Fd.y,s[9]=Cs.y,s[2]=_o.z,s[6]=Fd.z,s[10]=Cs.z,this}multiply(e){return this.multiplyMatrices(this,e)}premultiply(e){return this.multiplyMatrices(e,this)}multiplyMatrices(e,t){const i=e.elements,s=t.elements,r=this.elements,o=i[0],a=i[4],l=i[8],g=i[12],u=i[1],C=i[5],d=i[9],h=i[13],f=i[2],v=i[6],y=i[10],A=i[14],b=i[3],m=i[7],B=i[11],S=i[15],x=s[0],R=s[4],M=s[8],Z=s[12],V=s[1],N=s[5],P=s[9],U=s[13],q=s[2],ie=s[6],he=s[10],Ce=s[14],z=s[3],Q=s[7],J=s[11],le=s[15];return r[0]=o*x+a*V+l*q+g*z,r[4]=o*R+a*N+l*ie+g*Q,r[8]=o*M+a*P+l*he+g*J,r[12]=o*Z+a*U+l*Ce+g*le,r[1]=u*x+C*V+d*q+h*z,r[5]=u*R+C*N+d*ie+h*Q,r[9]=u*M+C*P+d*he+h*J,r[13]=u*Z+C*U+d*Ce+h*le,r[2]=f*x+v*V+y*q+A*z,r[6]=f*R+v*N+y*ie+A*Q,r[10]=f*M+v*P+y*he+A*J,r[14]=f*Z+v*U+y*Ce+A*le,r[3]=b*x+m*V+B*q+S*z,r[7]=b*R+m*N+B*ie+S*Q,r[11]=b*M+m*P+B*he+S*J,r[15]=b*Z+m*U+B*Ce+S*le,this}multiplyScalar(e){const t=this.elements;return t[0]*=e,t[4]*=e,t[8]*=e,t[12]*=e,t[1]*=e,t[5]*=e,t[9]*=e,t[13]*=e,t[2]*=e,t[6]*=e,t[10]*=e,t[14]*=e,t[3]*=e,t[7]*=e,t[11]*=e,t[15]*=e,this}determinant(){const e=this.elements,t=e[0],i=e[4],s=e[8],r=e[12],o=e[1],a=e[5],l=e[9],g=e[13],u=e[2],C=e[6],d=e[10],h=e[14],f=e[3],v=e[7],y=e[11],A=e[15];return f*(+r*l*C-s*g*C-r*a*d+i*g*d+s*a*h-i*l*h)+v*(+t*l*h-t*g*d+r*o*d-s*o*h+s*g*u-r*l*u)+y*(+t*g*C-t*a*h-r*o*C+i*o*h+r*a*u-i*g*u)+A*(-s*a*u-t*l*C+t*a*d+s*o*C-i*o*d+i*l*u)}transpose(){const e=this.elements;let t;return t=e[1],e[1]=e[4],e[4]=t,t=e[2],e[2]=e[8],e[8]=t,t=e[6],e[6]=e[9],e[9]=t,t=e[3],e[3]=e[12],e[12]=t,t=e[7],e[7]=e[13],e[13]=t,t=e[11],e[11]=e[14],e[14]=t,this}setPosition(e,t,i){const s=this.elements;return e.isVector3?(s[12]=e.x,s[13]=e.y,s[14]=e.z):(s[12]=e,s[13]=t,s[14]=i),this}invert(){const e=this.elements,t=e[0],i=e[1],s=e[2],r=e[3],o=e[4],a=e[5],l=e[6],g=e[7],u=e[8],C=e[9],d=e[10],h=e[11],f=e[12],v=e[13],y=e[14],A=e[15],b=C*y*g-v*d*g+v*l*h-a*y*h-C*l*A+a*d*A,m=f*d*g-u*y*g-f*l*h+o*y*h+u*l*A-o*d*A,B=u*v*g-f*C*g+f*a*h-o*v*h-u*a*A+o*C*A,S=f*C*l-u*v*l-f*a*d+o*v*d+u*a*y-o*C*y,x=t*b+i*m+s*B+r*S;if(x===0)return this.set(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0);const R=1/x;return e[0]=b*R,e[1]=(v*d*r-C*y*r-v*s*h+i*y*h+C*s*A-i*d*A)*R,e[2]=(a*y*r-v*l*r+v*s*g-i*y*g-a*s*A+i*l*A)*R,e[3]=(C*l*r-a*d*r-C*s*g+i*d*g+a*s*h-i*l*h)*R,e[4]=m*R,e[5]=(u*y*r-f*d*r+f*s*h-t*y*h-u*s*A+t*d*A)*R,e[6]=(f*l*r-o*y*r-f*s*g+t*y*g+o*s*A-t*l*A)*R,e[7]=(o*d*r-u*l*r+u*s*g-t*d*g-o*s*h+t*l*h)*R,e[8]=B*R,e[9]=(f*C*r-u*v*r-f*i*h+t*v*h+u*i*A-t*C*A)*R,e[10]=(o*v*r-f*a*r+f*i*g-t*v*g-o*i*A+t*a*A)*R,e[11]=(u*a*r-o*C*r-u*i*g+t*C*g+o*i*h-t*a*h)*R,e[12]=S*R,e[13]=(u*v*s-f*C*s+f*i*d-t*v*d-u*i*y+t*C*y)*R,e[14]=(f*a*s-o*v*s-f*i*l+t*v*l+o*i*y-t*a*y)*R,e[15]=(o*C*s-u*a*s+u*i*l-t*C*l-o*i*d+t*a*d)*R,this}scale(e){const t=this.elements,i=e.x,s=e.y,r=e.z;return t[0]*=i,t[4]*=s,t[8]*=r,t[1]*=i,t[5]*=s,t[9]*=r,t[2]*=i,t[6]*=s,t[10]*=r,t[3]*=i,t[7]*=s,t[11]*=r,this}getMaxScaleOnAxis(){const e=this.elements,t=e[0]*e[0]+e[1]*e[1]+e[2]*e[2],i=e[4]*e[4]+e[5]*e[5]+e[6]*e[6],s=e[8]*e[8]+e[9]*e[9]+e[10]*e[10];return Math.sqrt(Math.max(t,i,s))}makeTranslation(e,t,i){return this.set(1,0,0,e,0,1,0,t,0,0,1,i,0,0,0,1),this}makeRotationX(e){const t=Math.cos(e),i=Math.sin(e);return this.set(1,0,0,0,0,t,-i,0,0,i,t,0,0,0,0,1),this}makeRotationY(e){const t=Math.cos(e),i=Math.sin(e);return this.set(t,0,i,0,0,1,0,0,-i,0,t,0,0,0,0,1),this}makeRotationZ(e){const t=Math.cos(e),i=Math.sin(e);return this.set(t,-i,0,0,i,t,0,0,0,0,1,0,0,0,0,1),this}makeRotationAxis(e,t){const i=Math.cos(t),s=Math.sin(t),r=1-i,o=e.x,a=e.y,l=e.z,g=r*o,u=r*a;return this.set(g*o+i,g*a-s*l,g*l+s*a,0,g*a+s*l,u*a+i,u*l-s*o,0,g*l-s*a,u*l+s*o,r*l*l+i,0,0,0,0,1),this}makeScale(e,t,i){return this.set(e,0,0,0,0,t,0,0,0,0,i,0,0,0,0,1),this}makeShear(e,t,i,s,r,o){return this.set(1,i,r,0,e,1,o,0,t,s,1,0,0,0,0,1),this}compose(e,t,i){const s=this.elements,r=t._x,o=t._y,a=t._z,l=t._w,g=r+r,u=o+o,C=a+a,d=r*g,h=r*u,f=r*C,v=o*u,y=o*C,A=a*C,b=l*g,m=l*u,B=l*C,S=i.x,x=i.y,R=i.z;return s[0]=(1-(v+A))*S,s[1]=(h+B)*S,s[2]=(f-m)*S,s[3]=0,s[4]=(h-B)*x,s[5]=(1-(d+A))*x,s[6]=(y+b)*x,s[7]=0,s[8]=(f+m)*R,s[9]=(y-b)*R,s[10]=(1-(d+v))*R,s[11]=0,s[12]=e.x,s[13]=e.y,s[14]=e.z,s[15]=1,this}decompose(e,t,i){const s=this.elements;let r=ag.set(s[0],s[1],s[2]).length();const o=ag.set(s[4],s[5],s[6]).length(),a=ag.set(s[8],s[9],s[10]).length();this.determinant()<0&&(r=-r),e.x=s[12],e.y=s[13],e.z=s[14],nr.copy(this);const g=1/r,u=1/o,C=1/a;return nr.elements[0]*=g,nr.elements[1]*=g,nr.elements[2]*=g,nr.elements[4]*=u,nr.elements[5]*=u,nr.elements[6]*=u,nr.elements[8]*=C,nr.elements[9]*=C,nr.elements[10]*=C,t.setFromRotationMatrix(nr),i.x=r,i.y=o,i.z=a,this}makePerspective(e,t,i,s,r,o){const a=this.elements,l=2*r/(t-e),g=2*r/(i-s),u=(t+e)/(t-e),C=(i+s)/(i-s),d=-(o+r)/(o-r),h=-2*o*r/(o-r);return a[0]=l,a[4]=0,a[8]=u,a[12]=0,a[1]=0,a[5]=g,a[9]=C,a[13]=0,a[2]=0,a[6]=0,a[10]=d,a[14]=h,a[3]=0,a[7]=0,a[11]=-1,a[15]=0,this}makeOrthographic(e,t,i,s,r,o){const a=this.elements,l=1/(t-e),g=1/(i-s),u=1/(o-r),C=(t+e)*l,d=(i+s)*g,h=(o+r)*u;return a[0]=2*l,a[4]=0,a[8]=0,a[12]=-C,a[1]=0,a[5]=2*g,a[9]=0,a[13]=-d,a[2]=0,a[6]=0,a[10]=-2*u,a[14]=-h,a[3]=0,a[7]=0,a[11]=0,a[15]=1,this}equals(e){const t=this.elements,i=e.elements;for(let s=0;s<16;s++)if(t[s]!==i[s])return!1;return!0}fromArray(e,t=0){for(let i=0;i<16;i++)this.elements[i]=e[i+t];return this}toArray(e=[],t=0){const i=this.elements;return e[t]=i[0],e[t+1]=i[1],e[t+2]=i[2],e[t+3]=i[3],e[t+4]=i[4],e[t+5]=i[5],e[t+6]=i[6],e[t+7]=i[7],e[t+8]=i[8],e[t+9]=i[9],e[t+10]=i[10],e[t+11]=i[11],e[t+12]=i[12],e[t+13]=i[13],e[t+14]=i[14],e[t+15]=i[15],e}}const ag=new H,nr=new _e,JF=new H(0,0,0),OF=new H(1,1,1),_o=new H,Fd=new H,Cs=new H,oZ=new _e,aZ=new Mn;class Xl{constructor(e=0,t=0,i=0,s=Xl.DEFAULT_ORDER){this.isEuler=!0,this._x=e,this._y=t,this._z=i,this._order=s}get x(){return this._x}set x(e){this._x=e,this._onChangeCallback()}get y(){return this._y}set y(e){this._y=e,this._onChangeCallback()}get z(){return this._z}set z(e){this._z=e,this._onChangeCallback()}get order(){return this._order}set order(e){this._order=e,this._onChangeCallback()}set(e,t,i,s=this._order){return this._x=e,this._y=t,this._z=i,this._order=s,this._onChangeCallback(),this}clone(){return new this.constructor(this._x,this._y,this._z,this._order)}copy(e){return this._x=e._x,this._y=e._y,this._z=e._z,this._order=e._order,this._onChangeCallback(),this}setFromRotationMatrix(e,t=this._order,i=!0){const s=e.elements,r=s[0],o=s[4],a=s[8],l=s[1],g=s[5],u=s[9],C=s[2],d=s[6],h=s[10];switch(t){case"XYZ":this._y=Math.asin(Sn(a,-1,1)),Math.abs(a)<.9999999?(this._x=Math.atan2(-u,h),this._z=Math.atan2(-o,r)):(this._x=Math.atan2(d,g),this._z=0);break;case"YXZ":this._x=Math.asin(-Sn(u,-1,1)),Math.abs(u)<.9999999?(this._y=Math.atan2(a,h),this._z=Math.atan2(l,g)):(this._y=Math.atan2(-C,r),this._z=0);break;case"ZXY":this._x=Math.asin(Sn(d,-1,1)),Math.abs(d)<.9999999?(this._y=Math.atan2(-C,h),this._z=Math.atan2(-o,g)):(this._y=0,this._z=Math.atan2(l,r));break;case"ZYX":this._y=Math.asin(-Sn(C,-1,1)),Math.abs(C)<.9999999?(this._x=Math.atan2(d,h),this._z=Math.atan2(l,r)):(this._x=0,this._z=Math.atan2(-o,g));break;case"YZX":this._z=Math.asin(Sn(l,-1,1)),Math.abs(l)<.9999999?(this._x=Math.atan2(-u,g),this._y=Math.atan2(-C,r)):(this._x=0,this._y=Math.atan2(a,h));break;case"XZY":this._z=Math.asin(-Sn(o,-1,1)),Math.abs(o)<.9999999?(this._x=Math.atan2(d,g),this._y=Math.atan2(a,r)):(this._x=Math.atan2(-u,h),this._y=0);break;default:console.warn("THREE.Euler: .setFromRotationMatrix() encountered an unknown order: "+t)}return this._order=t,i===!0&&this._onChangeCallback(),this}setFromQuaternion(e,t,i){return oZ.makeRotationFromQuaternion(e),this.setFromRotationMatrix(oZ,t,i)}setFromVector3(e,t=this._order){return this.set(e.x,e.y,e.z,t)}reorder(e){return aZ.setFromEuler(this),this.setFromQuaternion(aZ,e)}equals(e){return e._x===this._x&&e._y===this._y&&e._z===this._z&&e._order===this._order}fromArray(e){return this._x=e[0],this._y=e[1],this._z=e[2],e[3]!==void 0&&(this._order=e[3]),this._onChangeCallback(),this}toArray(e=[],t=0){return e[t]=this._x,e[t+1]=this._y,e[t+2]=this._z,e[t+3]=this._order,e}_onChange(e){return this._onChangeCallback=e,this}_onChangeCallback(){}*[Symbol.iterator](){yield this._x,yield this._y,yield this._z,yield this._order}}Xl.DEFAULT_ORDER="XYZ";class ml{constructor(){this.mask=1}set(e){this.mask=(1<>>0}enable(e){this.mask|=1<1){for(let t=0;t1){for(let i=0;i0&&(i=i.concat(o))}return i}getWorldPosition(e){return this.updateWorldMatrix(!0,!1),e.setFromMatrixPosition(this.matrixWorld)}getWorldQuaternion(e){return this.updateWorldMatrix(!0,!1),this.matrixWorld.decompose(hI,e,jF),e}getWorldScale(e){return this.updateWorldMatrix(!0,!1),this.matrixWorld.decompose(hI,qF,e),e}getWorldDirection(e){this.updateWorldMatrix(!0,!1);const t=this.matrixWorld.elements;return e.set(t[8],t[9],t[10]).normalize()}raycast(){}traverse(e){e(this);const t=this.children;for(let i=0,s=t.length;i0&&(s.userData=this.userData),s.layers=this.layers.mask,s.matrix=this.matrix.toArray(),s.up=this.up.toArray(),this.matrixAutoUpdate===!1&&(s.matrixAutoUpdate=!1),this.isInstancedMesh&&(s.type="InstancedMesh",s.count=this.count,s.instanceMatrix=this.instanceMatrix.toJSON(),this.instanceColor!==null&&(s.instanceColor=this.instanceColor.toJSON()));function r(a,l){return a[l.uuid]===void 0&&(a[l.uuid]=l.toJSON(e)),l.uuid}if(this.isScene)this.background&&(this.background.isColor?s.background=this.background.toJSON():this.background.isTexture&&(s.background=this.background.toJSON(e).uuid)),this.environment&&this.environment.isTexture&&this.environment.isRenderTargetTexture!==!0&&(s.environment=this.environment.toJSON(e).uuid);else if(this.isMesh||this.isLine||this.isPoints){s.geometry=r(e.geometries,this.geometry);const a=this.geometry.parameters;if(a!==void 0&&a.shapes!==void 0){const l=a.shapes;if(Array.isArray(l))for(let g=0,u=l.length;g0){s.children=[];for(let a=0;a0){s.animations=[];for(let a=0;a0&&(i.geometries=a),l.length>0&&(i.materials=l),g.length>0&&(i.textures=g),u.length>0&&(i.images=u),C.length>0&&(i.shapes=C),d.length>0&&(i.skeletons=d),h.length>0&&(i.animations=h),f.length>0&&(i.nodes=f)}return i.object=s,i;function o(a){const l=[];for(const g in a){const u=a[g];delete u.metadata,l.push(u)}return l}}clone(e){return new this.constructor().copy(this,e)}copy(e,t=!0){if(this.name=e.name,this.up.copy(e.up),this.position.copy(e.position),this.rotation.order=e.rotation.order,this.quaternion.copy(e.quaternion),this.scale.copy(e.scale),this.matrix.copy(e.matrix),this.matrixWorld.copy(e.matrixWorld),this.matrixAutoUpdate=e.matrixAutoUpdate,this.matrixWorldNeedsUpdate=e.matrixWorldNeedsUpdate,this.matrixWorldAutoUpdate=e.matrixWorldAutoUpdate,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,this.userData=JSON.parse(JSON.stringify(e.userData)),t===!0)for(let i=0;i0?s.multiplyScalar(1/Math.sqrt(r)):s.set(0,0,0)}static getBarycoord(e,t,i,s,r){ir.subVectors(s,t),so.subVectors(i,t),cm.subVectors(e,t);const o=ir.dot(ir),a=ir.dot(so),l=ir.dot(cm),g=so.dot(so),u=so.dot(cm),C=o*g-a*a;if(C===0)return r.set(-2,-1,-1);const d=1/C,h=(g*l-a*u)*d,f=(o*u-a*l)*d;return r.set(1-h-f,f,h)}static containsPoint(e,t,i,s){return this.getBarycoord(e,t,i,s,ro),ro.x>=0&&ro.y>=0&&ro.x+ro.y<=1}static getUV(e,t,i,s,r,o,a,l){return Kd===!1&&(console.warn("THREE.Triangle.getUV() has been renamed to THREE.Triangle.getInterpolation()."),Kd=!0),this.getInterpolation(e,t,i,s,r,o,a,l)}static getInterpolation(e,t,i,s,r,o,a,l){return this.getBarycoord(e,t,i,s,ro),l.setScalar(0),l.addScaledVector(r,ro.x),l.addScaledVector(o,ro.y),l.addScaledVector(a,ro.z),l}static isFrontFacing(e,t,i,s){return ir.subVectors(i,t),so.subVectors(e,t),ir.cross(so).dot(s)<0}set(e,t,i){return this.a.copy(e),this.b.copy(t),this.c.copy(i),this}setFromPointsAndIndices(e,t,i,s){return this.a.copy(e[t]),this.b.copy(e[i]),this.c.copy(e[s]),this}setFromAttributeAndIndices(e,t,i,s){return this.a.fromBufferAttribute(e,t),this.b.fromBufferAttribute(e,i),this.c.fromBufferAttribute(e,s),this}clone(){return new this.constructor().copy(this)}copy(e){return this.a.copy(e.a),this.b.copy(e.b),this.c.copy(e.c),this}getArea(){return ir.subVectors(this.c,this.b),so.subVectors(this.a,this.b),ir.cross(so).length()*.5}getMidpoint(e){return e.addVectors(this.a,this.b).add(this.c).multiplyScalar(1/3)}getNormal(e){return es.getNormal(this.a,this.b,this.c,e)}getPlane(e){return e.setFromCoplanarPoints(this.a,this.b,this.c)}getBarycoord(e,t){return es.getBarycoord(e,this.a,this.b,this.c,t)}getUV(e,t,i,s,r){return Kd===!1&&(console.warn("THREE.Triangle.getUV() has been renamed to THREE.Triangle.getInterpolation()."),Kd=!0),es.getInterpolation(e,this.a,this.b,this.c,t,i,s,r)}getInterpolation(e,t,i,s,r){return es.getInterpolation(e,this.a,this.b,this.c,t,i,s,r)}containsPoint(e){return es.containsPoint(e,this.a,this.b,this.c)}isFrontFacing(e){return es.isFrontFacing(this.a,this.b,this.c,e)}intersectsBox(e){return e.intersectsTriangle(this)}closestPointToPoint(e,t){const i=this.a,s=this.b,r=this.c;let o,a;gg.subVectors(s,i),cg.subVectors(r,i),Im.subVectors(e,i);const l=gg.dot(Im),g=cg.dot(Im);if(l<=0&&g<=0)return t.copy(i);um.subVectors(e,s);const u=gg.dot(um),C=cg.dot(um);if(u>=0&&C<=u)return t.copy(s);const d=l*C-u*g;if(d<=0&&l>=0&&u<=0)return o=l/(l-u),t.copy(i).addScaledVector(gg,o);Cm.subVectors(e,r);const h=gg.dot(Cm),f=cg.dot(Cm);if(f>=0&&h<=f)return t.copy(r);const v=h*g-l*f;if(v<=0&&g>=0&&f<=0)return a=g/(g-f),t.copy(i).addScaledVector(cg,a);const y=u*f-h*C;if(y<=0&&C-u>=0&&h-f>=0)return CZ.subVectors(r,s),a=(C-u)/(C-u+(h-f)),t.copy(s).addScaledVector(CZ,a);const A=1/(y+v+d);return o=v*A,a=d*A,t.copy(i).addScaledVector(gg,o).addScaledVector(cg,a)}equals(e){return e.a.equals(this.a)&&e.b.equals(this.b)&&e.c.equals(this.c)}}let eY=0;class ei extends Ps{constructor(){super(),this.isMaterial=!0,Object.defineProperty(this,"id",{value:eY++}),this.uuid=vs(),this.name="",this.type="Material",this.blending=Al,this.side=Er,this.vertexColors=!1,this.opacity=1,this.transparent=!1,this.blendSrc=Pv,this.blendDst=_v,this.blendEquation=el,this.blendSrcAlpha=null,this.blendDstAlpha=null,this.blendEquationAlpha=null,this.depthFunc=Ru,this.depthTest=!0,this.depthWrite=!0,this.stencilWriteMask=255,this.stencilFunc=wW,this.stencilRef=0,this.stencilFuncMask=255,this.stencilFail=jh,this.stencilZFail=jh,this.stencilZPass=jh,this.stencilWrite=!1,this.clippingPlanes=null,this.clipIntersection=!1,this.clipShadows=!1,this.shadowSide=null,this.colorWrite=!0,this.precision=null,this.polygonOffset=!1,this.polygonOffsetFactor=0,this.polygonOffsetUnits=0,this.dithering=!1,this.alphaToCoverage=!1,this.premultipliedAlpha=!1,this.forceSinglePass=!1,this.visible=!0,this.toneMapped=!0,this.userData={},this.version=0,this._alphaTest=0}get alphaTest(){return this._alphaTest}set alphaTest(e){this._alphaTest>0!=e>0&&this.version++,this._alphaTest=e}onBuild(){}onBeforeRender(){}onBeforeCompile(){}customProgramCacheKey(){return this.onBeforeCompile.toString()}setValues(e){if(e!==void 0)for(const t in e){const i=e[t];if(i===void 0){console.warn(`THREE.Material: parameter '${t}' has value of undefined.`);continue}const s=this[t];if(s===void 0){console.warn(`THREE.Material: '${t}' is not a property of THREE.${this.type}.`);continue}s&&s.isColor?s.set(i):s&&s.isVector3&&i&&i.isVector3?s.copy(i):this[t]=i}}toJSON(e){const t=e===void 0||typeof e=="string";t&&(e={textures:{},images:{}});const i={metadata:{version:4.5,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&&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.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.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.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!==Al&&(i.blending=this.blending),this.side!==Er&&(i.side=this.side),this.vertexColors&&(i.vertexColors=!0),this.opacity<1&&(i.opacity=this.opacity),this.transparent===!0&&(i.transparent=this.transparent),i.depthFunc=this.depthFunc,i.depthTest=this.depthTest,i.depthWrite=this.depthWrite,i.colorWrite=this.colorWrite,i.stencilWrite=this.stencilWrite,i.stencilWriteMask=this.stencilWriteMask,i.stencilFunc=this.stencilFunc,i.stencilRef=this.stencilRef,i.stencilFuncMask=this.stencilFuncMask,i.stencilFail=this.stencilFail,i.stencilZFail=this.stencilZFail,i.stencilZPass=this.stencilZPass,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.alphaToCoverage===!0&&(i.alphaToCoverage=this.alphaToCoverage),this.premultipliedAlpha===!0&&(i.premultipliedAlpha=this.premultipliedAlpha),this.forceSinglePass===!0&&(i.forceSinglePass=this.forceSinglePass),this.wireframe===!0&&(i.wireframe=this.wireframe),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=this.flatShading),this.visible===!1&&(i.visible=!1),this.toneMapped===!1&&(i.toneMapped=!1),this.fog===!1&&(i.fog=!1),Object.keys(this.userData).length>0&&(i.userData=this.userData);function s(r){const o=[];for(const a in r){const l=r[a];delete l.metadata,o.push(l)}return o}if(t){const r=s(e.textures),o=s(e.images);r.length>0&&(i.textures=r),o.length>0&&(i.images=o)}return i}clone(){return new this.constructor().copy(this)}copy(e){this.name=e.name,this.blending=e.blending,this.side=e.side,this.vertexColors=e.vertexColors,this.opacity=e.opacity,this.transparent=e.transparent,this.blendSrc=e.blendSrc,this.blendDst=e.blendDst,this.blendEquation=e.blendEquation,this.blendSrcAlpha=e.blendSrcAlpha,this.blendDstAlpha=e.blendDstAlpha,this.blendEquationAlpha=e.blendEquationAlpha,this.depthFunc=e.depthFunc,this.depthTest=e.depthTest,this.depthWrite=e.depthWrite,this.stencilWriteMask=e.stencilWriteMask,this.stencilFunc=e.stencilFunc,this.stencilRef=e.stencilRef,this.stencilFuncMask=e.stencilFuncMask,this.stencilFail=e.stencilFail,this.stencilZFail=e.stencilZFail,this.stencilZPass=e.stencilZPass,this.stencilWrite=e.stencilWrite;const t=e.clippingPlanes;let i=null;if(t!==null){const s=t.length;i=new Array(s);for(let r=0;r!==s;++r)i[r]=t[r].clone()}return this.clippingPlanes=i,this.clipIntersection=e.clipIntersection,this.clipShadows=e.clipShadows,this.shadowSide=e.shadowSide,this.colorWrite=e.colorWrite,this.precision=e.precision,this.polygonOffset=e.polygonOffset,this.polygonOffsetFactor=e.polygonOffsetFactor,this.polygonOffsetUnits=e.polygonOffsetUnits,this.dithering=e.dithering,this.alphaTest=e.alphaTest,this.alphaToCoverage=e.alphaToCoverage,this.premultipliedAlpha=e.premultipliedAlpha,this.forceSinglePass=e.forceSinglePass,this.visible=e.visible,this.toneMapped=e.toneMapped,this.userData=JSON.parse(JSON.stringify(e.userData)),this}dispose(){this.dispatchEvent({type:"dispose"})}set needsUpdate(e){e===!0&&this.version++}}const NW={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},sr={h:0,s:0,l:0},zd={h:0,s:0,l:0};function dm(n,e,t){return t<0&&(t+=1),t>1&&(t-=1),t<1/6?n+(e-n)*6*t:t<1/2?e:t<2/3?n+(e-n)*6*(2/3-t):n}class Xe{constructor(e,t,i){return this.isColor=!0,this.r=1,this.g=1,this.b=1,t===void 0&&i===void 0?this.set(e):this.setRGB(e,t,i)}set(e){return e&&e.isColor?this.copy(e):typeof e=="number"?this.setHex(e):typeof e=="string"&&this.setStyle(e),this}setScalar(e){return this.r=e,this.g=e,this.b=e,this}setHex(e,t=yt){return e=Math.floor(e),this.r=(e>>16&255)/255,this.g=(e>>8&255)/255,this.b=(e&255)/255,Ys.toWorkingColorSpace(this,t),this}setRGB(e,t,i,s=Ys.workingColorSpace){return this.r=e,this.g=t,this.b=i,Ys.toWorkingColorSpace(this,s),this}setHSL(e,t,i,s=Ys.workingColorSpace){if(e=ry(e,1),t=Sn(t,0,1),i=Sn(i,0,1),t===0)this.r=this.g=this.b=i;else{const r=i<=.5?i*(1+t):i+t-i*t,o=2*i-r;this.r=dm(o,r,e+1/3),this.g=dm(o,r,e),this.b=dm(o,r,e-1/3)}return Ys.toWorkingColorSpace(this,s),this}setStyle(e,t=yt){function i(r){r!==void 0&&parseFloat(r)<1&&console.warn("THREE.Color: Alpha component of "+e+" will be ignored.")}let s;if(s=/^(\w+)\(([^\)]*)\)/.exec(e)){let r;const o=s[1],a=s[2];switch(o){case"rgb":case"rgba":if(r=/^\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec(a))return i(r[4]),this.setRGB(Math.min(255,parseInt(r[1],10))/255,Math.min(255,parseInt(r[2],10))/255,Math.min(255,parseInt(r[3],10))/255,t);if(r=/^\s*(\d+)\%\s*,\s*(\d+)\%\s*,\s*(\d+)\%\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec(a))return i(r[4]),this.setRGB(Math.min(100,parseInt(r[1],10))/100,Math.min(100,parseInt(r[2],10))/100,Math.min(100,parseInt(r[3],10))/100,t);break;case"hsl":case"hsla":if(r=/^\s*(\d*\.?\d+)\s*,\s*(\d*\.?\d+)\%\s*,\s*(\d*\.?\d+)\%\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec(a))return i(r[4]),this.setHSL(parseFloat(r[1])/360,parseFloat(r[2])/100,parseFloat(r[3])/100,t);break;default:console.warn("THREE.Color: Unknown color model "+e)}}else if(s=/^\#([A-Fa-f\d]+)$/.exec(e)){const r=s[1],o=r.length;if(o===3)return this.setRGB(parseInt(r.charAt(0),16)/15,parseInt(r.charAt(1),16)/15,parseInt(r.charAt(2),16)/15,t);if(o===6)return this.setHex(parseInt(r,16),t);console.warn("THREE.Color: Invalid hex color "+e)}else if(e&&e.length>0)return this.setColorName(e,t);return this}setColorName(e,t=yt){const i=NW[e.toLowerCase()];return i!==void 0?this.setHex(i,t):console.warn("THREE.Color: Unknown color "+e),this}clone(){return new this.constructor(this.r,this.g,this.b)}copy(e){return this.r=e.r,this.g=e.g,this.b=e.b,this}copySRGBToLinear(e){return this.r=rc(e.r),this.g=rc(e.g),this.b=rc(e.b),this}copyLinearToSRGB(e){return this.r=nm(e.r),this.g=nm(e.g),this.b=nm(e.b),this}convertSRGBToLinear(){return this.copySRGBToLinear(this),this}convertLinearToSRGB(){return this.copyLinearToSRGB(this),this}getHex(e=yt){return Ys.fromWorkingColorSpace(wi.copy(this),e),Math.round(Sn(wi.r*255,0,255))*65536+Math.round(Sn(wi.g*255,0,255))*256+Math.round(Sn(wi.b*255,0,255))}getHexString(e=yt){return("000000"+this.getHex(e).toString(16)).slice(-6)}getHSL(e,t=Ys.workingColorSpace){Ys.fromWorkingColorSpace(wi.copy(this),t);const i=wi.r,s=wi.g,r=wi.b,o=Math.max(i,s,r),a=Math.min(i,s,r);let l,g;const u=(a+o)/2;if(a===o)l=0,g=0;else{const C=o-a;switch(g=u<=.5?C/(o+a):C/(2-o-a),o){case i:l=(s-r)/C+(s>-g-14,i[l|256]=1024>>-g-14|32768,s[l]=-g-1,s[l|256]=-g-1):g<=15?(i[l]=g+15<<10,i[l|256]=g+15<<10|32768,s[l]=13,s[l|256]=13):g<128?(i[l]=31744,i[l|256]=64512,s[l]=24,s[l|256]=24):(i[l]=31744,i[l|256]=64512,s[l]=13,s[l|256]=13)}const r=new Uint32Array(2048),o=new Uint32Array(64),a=new Uint32Array(64);for(let l=1;l<1024;++l){let g=l<<13,u=0;for(;!(g&8388608);)g<<=1,u-=8388608;g&=-8388609,u+=947912704,r[l]=g|u}for(let l=1024;l<2048;++l)r[l]=939524096+(l-1024<<13);for(let l=1;l<31;++l)o[l]=l<<23;o[31]=1199570944,o[32]=2147483648;for(let l=33;l<63;++l)o[l]=2147483648+(l-32<<23);o[63]=3347054592;for(let l=1;l<64;++l)l!==32&&(a[l]=1024);return{floatView:e,uint32View:t,baseTable:i,shiftTable:s,mantissaTable:r,exponentTable:o,offsetTable:a}}function Qi(n){Math.abs(n)>65504&&console.warn("THREE.DataUtils.toHalfFloat(): Value out of range."),n=Sn(n,-65504,65504),Io.floatView[0]=n;const e=Io.uint32View[0],t=e>>23&511;return Io.baseTable[t]+((e&8388607)>>Io.shiftTable[t])}function LI(n){const e=n>>10;return Io.uint32View[0]=Io.mantissaTable[Io.offsetTable[e]+(n&1023)]+Io.exponentTable[e],Io.floatView[0]}const nY={toHalfFloat:Qi,fromHalfFloat:LI},zn=new H,Ld=new oe;class Jt{constructor(e,t,i=!1){if(Array.isArray(e))throw new TypeError("THREE.BufferAttribute: array should be a Typed Array.");this.isBufferAttribute=!0,this.name="",this.array=e,this.itemSize=t,this.count=e!==void 0?e.length/t:0,this.normalized=i,this.usage=Yu,this.updateRange={offset:0,count:-1},this.version=0}onUploadCallback(){}set needsUpdate(e){e===!0&&this.version++}setUsage(e){return this.usage=e,this}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}copyAt(e,t,i){e*=this.itemSize,i*=t.itemSize;for(let s=0,r=this.itemSize;s0&&(e.userData=this.userData),this.parameters!==void 0){const l=this.parameters;for(const g in l)l[g]!==void 0&&(e[g]=l[g]);return e}e.data={attributes:{}};const t=this.index;t!==null&&(e.data.index={type:t.array.constructor.name,array:Array.prototype.slice.call(t.array)});const i=this.attributes;for(const l in i){const g=i[l];e.data.attributes[l]=g.toJSON(e.data)}const s={};let r=!1;for(const l in this.morphAttributes){const g=this.morphAttributes[l],u=[];for(let C=0,d=g.length;C0&&(s[l]=u,r=!0)}r&&(e.data.morphAttributes=s,e.data.morphTargetsRelative=this.morphTargetsRelative);const o=this.groups;o.length>0&&(e.data.groups=JSON.parse(JSON.stringify(o)));const a=this.boundingSphere;return a!==null&&(e.data.boundingSphere={center:a.center.toArray(),radius:a.radius}),e}clone(){return new this.constructor().copy(this)}copy(e){this.index=null,this.attributes={},this.morphAttributes={},this.groups=[],this.boundingBox=null,this.boundingSphere=null;const t={};this.name=e.name;const i=e.index;i!==null&&this.setIndex(i.clone(t));const s=e.attributes;for(const g in s){const u=s[g];this.setAttribute(g,u.clone(t))}const r=e.morphAttributes;for(const g in r){const u=[],C=r[g];for(let d=0,h=C.length;d0){const s=t[i[0]];if(s!==void 0){this.morphTargetInfluences=[],this.morphTargetDictionary={};for(let r=0,o=s.length;r(e.far-e.near)**2))&&(dZ.copy(r).invert(),Wr.copy(e.ray).applyMatrix4(dZ),!(i.boundingBox!==null&&Wr.intersectsBox(i.boundingBox)===!1)&&this._computeIntersections(e,t)))}_computeIntersections(e,t){let i;const s=this.geometry,r=this.material,o=s.index,a=s.attributes.position,l=s.attributes.uv,g=s.attributes.uv1,u=s.attributes.normal,C=s.groups,d=s.drawRange;if(o!==null)if(Array.isArray(r))for(let h=0,f=C.length;ht.far?null:{distance:g,point:_d.clone(),object:n}}function Jd(n,e,t,i,s,r,o,a,l,g){n.getVertexPosition(a,ug),n.getVertexPosition(l,Cg),n.getVertexPosition(g,dg);const u=IY(n,e,t,i,ug,Cg,dg,Pd);if(u){s&&(kd.fromBufferAttribute(s,a),Dd.fromBufferAttribute(s,l),Ud.fromBufferAttribute(s,g),u.uv=es.getInterpolation(Pd,ug,Cg,dg,kd,Dd,Ud,new oe)),r&&(kd.fromBufferAttribute(r,a),Dd.fromBufferAttribute(r,l),Ud.fromBufferAttribute(r,g),u.uv1=es.getInterpolation(Pd,ug,Cg,dg,kd,Dd,Ud,new oe),u.uv2=u.uv1),o&&(AZ.fromBufferAttribute(o,a),pZ.fromBufferAttribute(o,l),fZ.fromBufferAttribute(o,g),u.normal=es.getInterpolation(Pd,ug,Cg,dg,AZ,pZ,fZ,new H),u.normal.dot(i.direction)>0&&u.normal.multiplyScalar(-1));const C={a,b:l,c:g,normal:new H,materialIndex:0};es.getNormal(ug,Cg,dg,C.normal),u.face=C}return u}class xa extends Gt{constructor(e=1,t=1,i=1,s=1,r=1,o=1){super(),this.type="BoxGeometry",this.parameters={width:e,height:t,depth:i,widthSegments:s,heightSegments:r,depthSegments:o};const a=this;s=Math.floor(s),r=Math.floor(r),o=Math.floor(o);const l=[],g=[],u=[],C=[];let d=0,h=0;f("z","y","x",-1,-1,i,t,e,o,r,0),f("z","y","x",1,-1,i,t,-e,o,r,1),f("x","z","y",1,1,e,i,t,s,o,2),f("x","z","y",1,-1,e,i,-t,s,o,3),f("x","y","z",1,-1,e,t,i,s,r,4),f("x","y","z",-1,-1,e,t,-i,s,r,5),this.setIndex(l),this.setAttribute("position",new je(g,3)),this.setAttribute("normal",new je(u,3)),this.setAttribute("uv",new je(C,2));function f(v,y,A,b,m,B,S,x,R,M,Z){const V=B/R,N=S/M,P=B/2,U=S/2,q=x/2,ie=R+1,he=M+1;let Ce=0,z=0;const Q=new H;for(let J=0;J0?1:-1,u.push(Q.x,Q.y,Q.z),C.push(se/R),C.push(1-J/M),Ce+=1}}for(let J=0;J>8&255]+Zi[n>>16&255]+Zi[n>>24&255]+"-"+Zi[e&255]+Zi[e>>8&255]+"-"+Zi[e>>16&15|64]+Zi[e>>24&255]+"-"+Zi[t&63|128]+Zi[t>>8&255]+"-"+Zi[t>>16&255]+Zi[t>>24&255]+Zi[i&255]+Zi[i>>8&255]+Zi[i>>16&255]+Zi[i>>24&255]).toLowerCase()}function Sn(n,e,t){return Math.max(e,Math.min(t,n))}function ry(n,e){return(n%e+e)%e}function BF(n,e,t,i,s){return i+(n-e)*(s-i)/(t-e)}function ZF(n,e,t){return n!==e?(t-n)/(e-n):0}function su(n,e,t){return(1-t)*n+t*e}function wF(n,e,t,i){return su(n,e,1-Math.exp(-t*i))}function SF(n,e=1){return e-Math.abs(ry(n,e*2)-e)}function xF(n,e,t){return n<=e?0:n>=t?1:(n=(n-e)/(t-e),n*n*(3-2*n))}function RF(n,e,t){return n<=e?0:n>=t?1:(n=(n-e)/(t-e),n*n*n*(n*(n*6-15)+10))}function WF(n,e){return n+Math.floor(Math.random()*(e-n+1))}function VF(n,e){return n+Math.random()*(e-n)}function MF(n){return n*(.5-Math.random())}function NF(n){n!==void 0&&(iZ=n);let e=iZ+=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 HF(n){return n*pl}function XF(n){return n*fc}function Zb(n){return(n&n-1)===0&&n!==0}function xW(n){return Math.pow(2,Math.ceil(Math.log(n)/Math.LN2))}function RW(n){return Math.pow(2,Math.floor(Math.log(n)/Math.LN2))}function FF(n,e,t,i,s){const r=Math.cos,o=Math.sin,a=r(t/2),l=o(t/2),g=r((e+i)/2),u=o((e+i)/2),C=r((e-i)/2),d=o((e-i)/2),h=r((i-e)/2),f=o((i-e)/2);switch(s){case"XYX":n.set(a*u,l*C,l*d,a*g);break;case"YZY":n.set(l*d,a*u,l*C,a*g);break;case"ZXZ":n.set(l*C,l*d,a*u,a*g);break;case"XZX":n.set(a*u,l*f,l*h,a*g);break;case"YXY":n.set(l*h,a*u,l*f,a*g);break;case"ZYZ":n.set(l*f,l*h,a*u,a*g);break;default:console.warn("THREE.MathUtils: .setQuaternionFromProperEuler() encountered an unknown order: "+s)}}function fs(n,e){switch(e.constructor){case Float32Array:return n;case Uint16Array:return n/65535;case Uint8Array:return n/255;case Int16Array:return Math.max(n/32767,-1);case Int8Array:return Math.max(n/127,-1);default:throw new Error("Invalid component type.")}}function Zt(n,e){switch(e.constructor){case Float32Array:return n;case Uint16Array:return Math.round(n*65535);case Uint8Array:return Math.round(n*255);case Int16Array:return Math.round(n*32767);case Int8Array:return Math.round(n*127);default:throw new Error("Invalid component type.")}}const WW={DEG2RAD:pl,RAD2DEG:fc,generateUUID:vs,clamp:Sn,euclideanModulo:ry,mapLinear:BF,inverseLerp:ZF,lerp:su,damp:wF,pingpong:SF,smoothstep:xF,smootherstep:RF,randInt:WF,randFloat:VF,randFloatSpread:MF,seededRandom:NF,degToRad:HF,radToDeg:XF,isPowerOfTwo:Zb,ceilPowerOfTwo:xW,floorPowerOfTwo:RW,setQuaternionFromProperEuler:FF,normalize:Zt,denormalize:fs};class oe{constructor(e=0,t=0){oe.prototype.isVector2=!0,this.x=e,this.y=t}get width(){return this.x}set width(e){this.x=e}get height(){return this.y}set height(e){this.y=e}set(e,t){return this.x=e,this.y=t,this}setScalar(e){return this.x=e,this.y=e,this}setX(e){return this.x=e,this}setY(e){return this.y=e,this}setComponent(e,t){switch(e){case 0:this.x=t;break;case 1:this.y=t;break;default:throw new Error("index is out of range: "+e)}return this}getComponent(e){switch(e){case 0:return this.x;case 1:return this.y;default:throw new Error("index is out of range: "+e)}}clone(){return new this.constructor(this.x,this.y)}copy(e){return this.x=e.x,this.y=e.y,this}add(e){return this.x+=e.x,this.y+=e.y,this}addScalar(e){return this.x+=e,this.y+=e,this}addVectors(e,t){return this.x=e.x+t.x,this.y=e.y+t.y,this}addScaledVector(e,t){return this.x+=e.x*t,this.y+=e.y*t,this}sub(e){return this.x-=e.x,this.y-=e.y,this}subScalar(e){return this.x-=e,this.y-=e,this}subVectors(e,t){return this.x=e.x-t.x,this.y=e.y-t.y,this}multiply(e){return this.x*=e.x,this.y*=e.y,this}multiplyScalar(e){return this.x*=e,this.y*=e,this}divide(e){return this.x/=e.x,this.y/=e.y,this}divideScalar(e){return this.multiplyScalar(1/e)}applyMatrix3(e){const t=this.x,i=this.y,s=e.elements;return this.x=s[0]*t+s[3]*i+s[6],this.y=s[1]*t+s[4]*i+s[7],this}min(e){return this.x=Math.min(this.x,e.x),this.y=Math.min(this.y,e.y),this}max(e){return this.x=Math.max(this.x,e.x),this.y=Math.max(this.y,e.y),this}clamp(e,t){return this.x=Math.max(e.x,Math.min(t.x,this.x)),this.y=Math.max(e.y,Math.min(t.y,this.y)),this}clampScalar(e,t){return this.x=Math.max(e,Math.min(t,this.x)),this.y=Math.max(e,Math.min(t,this.y)),this}clampLength(e,t){const i=this.length();return this.divideScalar(i||1).multiplyScalar(Math.max(e,Math.min(t,i)))}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=this.x<0?Math.ceil(this.x):Math.floor(this.x),this.y=this.y<0?Math.ceil(this.y):Math.floor(this.y),this}negate(){return this.x=-this.x,this.y=-this.y,this}dot(e){return this.x*e.x+this.y*e.y}cross(e){return this.x*e.y-this.y*e.x}lengthSq(){return this.x*this.x+this.y*this.y}length(){return Math.sqrt(this.x*this.x+this.y*this.y)}manhattanLength(){return Math.abs(this.x)+Math.abs(this.y)}normalize(){return this.divideScalar(this.length()||1)}angle(){return Math.atan2(-this.y,-this.x)+Math.PI}angleTo(e){const t=Math.sqrt(this.lengthSq()*e.lengthSq());if(t===0)return Math.PI/2;const i=this.dot(e)/t;return Math.acos(Sn(i,-1,1))}distanceTo(e){return Math.sqrt(this.distanceToSquared(e))}distanceToSquared(e){const t=this.x-e.x,i=this.y-e.y;return t*t+i*i}manhattanDistanceTo(e){return Math.abs(this.x-e.x)+Math.abs(this.y-e.y)}setLength(e){return this.normalize().multiplyScalar(e)}lerp(e,t){return this.x+=(e.x-this.x)*t,this.y+=(e.y-this.y)*t,this}lerpVectors(e,t,i){return this.x=e.x+(t.x-e.x)*i,this.y=e.y+(t.y-e.y)*i,this}equals(e){return e.x===this.x&&e.y===this.y}fromArray(e,t=0){return this.x=e[t],this.y=e[t+1],this}toArray(e=[],t=0){return e[t]=this.x,e[t+1]=this.y,e}fromBufferAttribute(e,t){return this.x=e.getX(t),this.y=e.getY(t),this}rotateAround(e,t){const i=Math.cos(t),s=Math.sin(t),r=this.x-e.x,o=this.y-e.y;return this.x=r*i-o*s+e.x,this.y=r*s+o*i+e.y,this}random(){return this.x=Math.random(),this.y=Math.random(),this}*[Symbol.iterator](){yield this.x,yield this.y}}class Mt{constructor(){Mt.prototype.isMatrix3=!0,this.elements=[1,0,0,0,1,0,0,0,1]}set(e,t,i,s,r,o,a,l,g){const u=this.elements;return u[0]=e,u[1]=s,u[2]=a,u[3]=t,u[4]=r,u[5]=l,u[6]=i,u[7]=o,u[8]=g,this}identity(){return this.set(1,0,0,0,1,0,0,0,1),this}copy(e){const t=this.elements,i=e.elements;return t[0]=i[0],t[1]=i[1],t[2]=i[2],t[3]=i[3],t[4]=i[4],t[5]=i[5],t[6]=i[6],t[7]=i[7],t[8]=i[8],this}extractBasis(e,t,i){return e.setFromMatrix3Column(this,0),t.setFromMatrix3Column(this,1),i.setFromMatrix3Column(this,2),this}setFromMatrix4(e){const t=e.elements;return this.set(t[0],t[4],t[8],t[1],t[5],t[9],t[2],t[6],t[10]),this}multiply(e){return this.multiplyMatrices(this,e)}premultiply(e){return this.multiplyMatrices(e,this)}multiplyMatrices(e,t){const i=e.elements,s=t.elements,r=this.elements,o=i[0],a=i[3],l=i[6],g=i[1],u=i[4],C=i[7],d=i[2],h=i[5],f=i[8],v=s[0],y=s[3],A=s[6],b=s[1],m=s[4],B=s[7],S=s[2],x=s[5],R=s[8];return r[0]=o*v+a*b+l*S,r[3]=o*y+a*m+l*x,r[6]=o*A+a*B+l*R,r[1]=g*v+u*b+C*S,r[4]=g*y+u*m+C*x,r[7]=g*A+u*B+C*R,r[2]=d*v+h*b+f*S,r[5]=d*y+h*m+f*x,r[8]=d*A+h*B+f*R,this}multiplyScalar(e){const t=this.elements;return t[0]*=e,t[3]*=e,t[6]*=e,t[1]*=e,t[4]*=e,t[7]*=e,t[2]*=e,t[5]*=e,t[8]*=e,this}determinant(){const e=this.elements,t=e[0],i=e[1],s=e[2],r=e[3],o=e[4],a=e[5],l=e[6],g=e[7],u=e[8];return t*o*u-t*a*g-i*r*u+i*a*l+s*r*g-s*o*l}invert(){const e=this.elements,t=e[0],i=e[1],s=e[2],r=e[3],o=e[4],a=e[5],l=e[6],g=e[7],u=e[8],C=u*o-a*g,d=a*l-u*r,h=g*r-o*l,f=t*C+i*d+s*h;if(f===0)return this.set(0,0,0,0,0,0,0,0,0);const v=1/f;return e[0]=C*v,e[1]=(s*g-u*i)*v,e[2]=(a*i-s*o)*v,e[3]=d*v,e[4]=(u*t-s*l)*v,e[5]=(s*r-a*t)*v,e[6]=h*v,e[7]=(i*l-g*t)*v,e[8]=(o*t-i*r)*v,this}transpose(){let e;const t=this.elements;return e=t[1],t[1]=t[3],t[3]=e,e=t[2],t[2]=t[6],t[6]=e,e=t[5],t[5]=t[7],t[7]=e,this}getNormalMatrix(e){return this.setFromMatrix4(e).invert().transpose()}transposeIntoArray(e){const t=this.elements;return e[0]=t[0],e[1]=t[3],e[2]=t[6],e[3]=t[1],e[4]=t[4],e[5]=t[7],e[6]=t[2],e[7]=t[5],e[8]=t[8],this}setUvTransform(e,t,i,s,r,o,a){const l=Math.cos(r),g=Math.sin(r);return this.set(i*l,i*g,-i*(l*o+g*a)+o+e,-s*g,s*l,-s*(-g*o+l*a)+a+t,0,0,1),this}scale(e,t){return this.premultiply(tm.makeScale(e,t)),this}rotate(e){return this.premultiply(tm.makeRotation(-e)),this}translate(e,t){return this.premultiply(tm.makeTranslation(e,t)),this}makeTranslation(e,t){return this.set(1,0,e,0,1,t,0,0,1),this}makeRotation(e){const t=Math.cos(e),i=Math.sin(e);return this.set(t,-i,0,i,t,0,0,0,1),this}makeScale(e,t){return this.set(e,0,0,0,t,0,0,0,1),this}equals(e){const t=this.elements,i=e.elements;for(let s=0;s<9;s++)if(t[s]!==i[s])return!1;return!0}fromArray(e,t=0){for(let i=0;i<9;i++)this.elements[i]=e[i+t];return this}toArray(e=[],t=0){const i=this.elements;return e[t]=i[0],e[t+1]=i[1],e[t+2]=i[2],e[t+3]=i[3],e[t+4]=i[4],e[t+5]=i[5],e[t+6]=i[6],e[t+7]=i[7],e[t+8]=i[8],e}clone(){return new this.constructor().fromArray(this.elements)}}const tm=new Mt;function VW(n){for(let e=n.length-1;e>=0;--e)if(n[e]>=65535)return!0;return!1}const YF={Int8Array,Uint8Array,Uint8ClampedArray,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array};function Dg(n,e){return new YF[n](e)}function zu(n){return document.createElementNS("http://www.w3.org/1999/xhtml",n)}const sZ={};function ru(n){n in sZ||(sZ[n]=!0,console.warn(n))}function rc(n){return n<.04045?n*.0773993808:Math.pow(n*.9478672986+.0521327014,2.4)}function nm(n){return n<.0031308?n*12.92:1.055*Math.pow(n,.41666)-.055}const KF=new Mt().fromArray([.8224621,.0331941,.0170827,.177538,.9668058,.0723974,-1e-7,1e-7,.9105199]),zF=new Mt().fromArray([1.2249401,-.0420569,-.0196376,-.2249404,1.0420571,-.0786361,1e-7,0,1.0982735]);function LF(n){return n.convertSRGBToLinear().applyMatrix3(zF)}function EF(n){return n.applyMatrix3(KF).convertLinearToSRGB()}const TF={[fr]:n=>n,[yt]:n=>n.convertSRGBToLinear(),[sy]:LF},kF={[fr]:n=>n,[yt]:n=>n.convertLinearToSRGB(),[sy]:EF},Ys={enabled:!0,get legacyMode(){return console.warn("THREE.ColorManagement: .legacyMode=false renamed to .enabled=true in r150."),!this.enabled},set legacyMode(n){console.warn("THREE.ColorManagement: .legacyMode=false renamed to .enabled=true in r150."),this.enabled=!n},get workingColorSpace(){return fr},set workingColorSpace(n){console.warn("THREE.ColorManagement: .workingColorSpace is readonly.")},convert:function(n,e,t){if(this.enabled===!1||e===t||!e||!t)return n;const i=TF[e],s=kF[t];if(i===void 0||s===void 0)throw new Error(`Unsupported color space conversion, "${e}" to "${t}".`);return s(i(n))},fromWorkingColorSpace:function(n,e){return this.convert(n,this.workingColorSpace,e)},toWorkingColorSpace:function(n,e){return this.convert(n,e,this.workingColorSpace)}};let ng;class oy{static getDataURL(e){if(/^data:/i.test(e.src)||typeof HTMLCanvasElement>"u")return e.src;let t;if(e instanceof HTMLCanvasElement)t=e;else{ng===void 0&&(ng=zu("canvas")),ng.width=e.width,ng.height=e.height;const i=ng.getContext("2d");e instanceof ImageData?i.putImageData(e,0,0):i.drawImage(e,0,0,e.width,e.height),t=ng}return t.width>2048||t.height>2048?(console.warn("THREE.ImageUtils.getDataURL: Image converted to jpg for performance reasons",e),t.toDataURL("image/jpeg",.6)):t.toDataURL("image/png")}static sRGBToLinear(e){if(typeof HTMLImageElement<"u"&&e instanceof HTMLImageElement||typeof HTMLCanvasElement<"u"&&e instanceof HTMLCanvasElement||typeof ImageBitmap<"u"&&e instanceof ImageBitmap){const t=zu("canvas");t.width=e.width,t.height=e.height;const i=t.getContext("2d");i.drawImage(e,0,0,e.width,e.height);const s=i.getImageData(0,0,e.width,e.height),r=s.data;for(let o=0;o0&&(i.userData=this.userData),t||(e.textures[this.uuid]=i),i}dispose(){this.dispatchEvent({type:"dispose"})}transformUv(e){if(this.mapping!==ep)return e;if(e.applyMatrix3(this.matrix),e.x<0||e.x>1)switch(this.wrapS){case Gs:e.x=e.x-Math.floor(e.x);break;case Pn:e.x=e.x<0?0:1;break;case Hu: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 Gs:e.y=e.y-Math.floor(e.y);break;case Pn:e.y=e.y<0?0:1;break;case Hu: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)}get encoding(){return ru("THREE.Texture: Property .encoding has been replaced by .colorSpace."),this.colorSpace===yt?ks:sC}set encoding(e){ru("THREE.Texture: Property .encoding has been replaced by .colorSpace."),this.colorSpace=e===ks?yt:vo}}sn.DEFAULT_IMAGE=null;sn.DEFAULT_MAPPING=ep;sn.DEFAULT_ANISOTROPY=1;class Yt{constructor(e=0,t=0,i=0,s=1){Yt.prototype.isVector4=!0,this.x=e,this.y=t,this.z=i,this.w=s}get width(){return this.z}set width(e){this.z=e}get height(){return this.w}set height(e){this.w=e}set(e,t,i,s){return this.x=e,this.y=t,this.z=i,this.w=s,this}setScalar(e){return this.x=e,this.y=e,this.z=e,this.w=e,this}setX(e){return this.x=e,this}setY(e){return this.y=e,this}setZ(e){return this.z=e,this}setW(e){return this.w=e,this}setComponent(e,t){switch(e){case 0:this.x=t;break;case 1:this.y=t;break;case 2:this.z=t;break;case 3:this.w=t;break;default:throw new Error("index is out of range: "+e)}return this}getComponent(e){switch(e){case 0:return this.x;case 1:return this.y;case 2:return this.z;case 3:return this.w;default:throw new Error("index is out of range: "+e)}}clone(){return new this.constructor(this.x,this.y,this.z,this.w)}copy(e){return this.x=e.x,this.y=e.y,this.z=e.z,this.w=e.w!==void 0?e.w:1,this}add(e){return this.x+=e.x,this.y+=e.y,this.z+=e.z,this.w+=e.w,this}addScalar(e){return this.x+=e,this.y+=e,this.z+=e,this.w+=e,this}addVectors(e,t){return this.x=e.x+t.x,this.y=e.y+t.y,this.z=e.z+t.z,this.w=e.w+t.w,this}addScaledVector(e,t){return this.x+=e.x*t,this.y+=e.y*t,this.z+=e.z*t,this.w+=e.w*t,this}sub(e){return this.x-=e.x,this.y-=e.y,this.z-=e.z,this.w-=e.w,this}subScalar(e){return this.x-=e,this.y-=e,this.z-=e,this.w-=e,this}subVectors(e,t){return this.x=e.x-t.x,this.y=e.y-t.y,this.z=e.z-t.z,this.w=e.w-t.w,this}multiply(e){return this.x*=e.x,this.y*=e.y,this.z*=e.z,this.w*=e.w,this}multiplyScalar(e){return this.x*=e,this.y*=e,this.z*=e,this.w*=e,this}applyMatrix4(e){const t=this.x,i=this.y,s=this.z,r=this.w,o=e.elements;return this.x=o[0]*t+o[4]*i+o[8]*s+o[12]*r,this.y=o[1]*t+o[5]*i+o[9]*s+o[13]*r,this.z=o[2]*t+o[6]*i+o[10]*s+o[14]*r,this.w=o[3]*t+o[7]*i+o[11]*s+o[15]*r,this}divideScalar(e){return this.multiplyScalar(1/e)}setAxisAngleFromQuaternion(e){this.w=2*Math.acos(e.w);const t=Math.sqrt(1-e.w*e.w);return t<1e-4?(this.x=1,this.y=0,this.z=0):(this.x=e.x/t,this.y=e.y/t,this.z=e.z/t),this}setAxisAngleFromRotationMatrix(e){let t,i,s,r;const l=e.elements,g=l[0],u=l[4],C=l[8],d=l[1],h=l[5],f=l[9],v=l[2],y=l[6],A=l[10];if(Math.abs(u-d)<.01&&Math.abs(C-v)<.01&&Math.abs(f-y)<.01){if(Math.abs(u+d)<.1&&Math.abs(C+v)<.1&&Math.abs(f+y)<.1&&Math.abs(g+h+A-3)<.1)return this.set(1,0,0,0),this;t=Math.PI;const m=(g+1)/2,B=(h+1)/2,S=(A+1)/2,x=(u+d)/4,R=(C+v)/4,M=(f+y)/4;return m>B&&m>S?m<.01?(i=0,s=.707106781,r=.707106781):(i=Math.sqrt(m),s=x/i,r=R/i):B>S?B<.01?(i=.707106781,s=0,r=.707106781):(s=Math.sqrt(B),i=x/s,r=M/s):S<.01?(i=.707106781,s=.707106781,r=0):(r=Math.sqrt(S),i=R/r,s=M/r),this.set(i,s,r,t),this}let b=Math.sqrt((y-f)*(y-f)+(C-v)*(C-v)+(d-u)*(d-u));return Math.abs(b)<.001&&(b=1),this.x=(y-f)/b,this.y=(C-v)/b,this.z=(d-u)/b,this.w=Math.acos((g+h+A-1)/2),this}min(e){return this.x=Math.min(this.x,e.x),this.y=Math.min(this.y,e.y),this.z=Math.min(this.z,e.z),this.w=Math.min(this.w,e.w),this}max(e){return this.x=Math.max(this.x,e.x),this.y=Math.max(this.y,e.y),this.z=Math.max(this.z,e.z),this.w=Math.max(this.w,e.w),this}clamp(e,t){return this.x=Math.max(e.x,Math.min(t.x,this.x)),this.y=Math.max(e.y,Math.min(t.y,this.y)),this.z=Math.max(e.z,Math.min(t.z,this.z)),this.w=Math.max(e.w,Math.min(t.w,this.w)),this}clampScalar(e,t){return this.x=Math.max(e,Math.min(t,this.x)),this.y=Math.max(e,Math.min(t,this.y)),this.z=Math.max(e,Math.min(t,this.z)),this.w=Math.max(e,Math.min(t,this.w)),this}clampLength(e,t){const i=this.length();return this.divideScalar(i||1).multiplyScalar(Math.max(e,Math.min(t,i)))}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=this.x<0?Math.ceil(this.x):Math.floor(this.x),this.y=this.y<0?Math.ceil(this.y):Math.floor(this.y),this.z=this.z<0?Math.ceil(this.z):Math.floor(this.z),this.w=this.w<0?Math.ceil(this.w):Math.floor(this.w),this}negate(){return this.x=-this.x,this.y=-this.y,this.z=-this.z,this.w=-this.w,this}dot(e){return this.x*e.x+this.y*e.y+this.z*e.z+this.w*e.w}lengthSq(){return this.x*this.x+this.y*this.y+this.z*this.z+this.w*this.w}length(){return Math.sqrt(this.x*this.x+this.y*this.y+this.z*this.z+this.w*this.w)}manhattanLength(){return Math.abs(this.x)+Math.abs(this.y)+Math.abs(this.z)+Math.abs(this.w)}normalize(){return this.divideScalar(this.length()||1)}setLength(e){return this.normalize().multiplyScalar(e)}lerp(e,t){return this.x+=(e.x-this.x)*t,this.y+=(e.y-this.y)*t,this.z+=(e.z-this.z)*t,this.w+=(e.w-this.w)*t,this}lerpVectors(e,t,i){return this.x=e.x+(t.x-e.x)*i,this.y=e.y+(t.y-e.y)*i,this.z=e.z+(t.z-e.z)*i,this.w=e.w+(t.w-e.w)*i,this}equals(e){return e.x===this.x&&e.y===this.y&&e.z===this.z&&e.w===this.w}fromArray(e,t=0){return this.x=e[t],this.y=e[t+1],this.z=e[t+2],this.w=e[t+3],this}toArray(e=[],t=0){return e[t]=this.x,e[t+1]=this.y,e[t+2]=this.z,e[t+3]=this.w,e}fromBufferAttribute(e,t){return this.x=e.getX(t),this.y=e.getY(t),this.z=e.getZ(t),this.w=e.getW(t),this}random(){return this.x=Math.random(),this.y=Math.random(),this.z=Math.random(),this.w=Math.random(),this}*[Symbol.iterator](){yield this.x,yield this.y,yield this.z,yield this.w}}class Nt extends Ps{constructor(e=1,t=1,i={}){super(),this.isWebGLRenderTarget=!0,this.width=e,this.height=t,this.depth=1,this.scissor=new Yt(0,0,e,t),this.scissorTest=!1,this.viewport=new Yt(0,0,e,t);const s={width:e,height:t,depth:1};i.encoding!==void 0&&(ru("THREE.WebGLRenderTarget: option.encoding has been replaced by option.colorSpace."),i.colorSpace=i.encoding===ks?yt:vo),this.texture=new sn(s,i.mapping,i.wrapS,i.wrapT,i.magFilter,i.minFilter,i.format,i.type,i.anisotropy,i.colorSpace),this.texture.isRenderTargetTexture=!0,this.texture.flipY=!1,this.texture.generateMipmaps=i.generateMipmaps!==void 0?i.generateMipmaps:!1,this.texture.internalFormat=i.internalFormat!==void 0?i.internalFormat:null,this.texture.minFilter=i.minFilter!==void 0?i.minFilter:st,this.depthBuffer=i.depthBuffer!==void 0?i.depthBuffer:!0,this.stencilBuffer=i.stencilBuffer!==void 0?i.stencilBuffer:!1,this.depthTexture=i.depthTexture!==void 0?i.depthTexture:null,this.samples=i.samples!==void 0?i.samples:0}setSize(e,t,i=1){(this.width!==e||this.height!==t||this.depth!==i)&&(this.width=e,this.height=t,this.depth=i,this.texture.image.width=e,this.texture.image.height=t,this.texture.image.depth=i,this.dispose()),this.viewport.set(0,0,e,t),this.scissor.set(0,0,e,t)}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.texture=e.texture.clone(),this.texture.isRenderTargetTexture=!0;const t=Object.assign({},e.texture.image);return this.texture.source=new Il(t),this.depthBuffer=e.depthBuffer,this.stencilBuffer=e.stencilBuffer,e.depthTexture!==null&&(this.depthTexture=e.depthTexture.clone()),this.samples=e.samples,this}dispose(){this.dispatchEvent({type:"dispose"})}}class ip extends sn{constructor(e=null,t=1,i=1,s=1){super(null),this.isDataArrayTexture=!0,this.image={data:e,width:t,height:i,depth:s},this.magFilter=vt,this.minFilter=vt,this.wrapR=Pn,this.generateMipmaps=!1,this.flipY=!1,this.unpackAlignment=1}}class UF extends Nt{constructor(e=1,t=1,i=1){super(e,t),this.isWebGLArrayRenderTarget=!0,this.depth=i,this.texture=new ip(null,e,t,i),this.texture.isRenderTargetTexture=!0}}class fl extends sn{constructor(e=null,t=1,i=1,s=1){super(null),this.isData3DTexture=!0,this.image={data:e,width:t,height:i,depth:s},this.magFilter=vt,this.minFilter=vt,this.wrapR=Pn,this.generateMipmaps=!1,this.flipY=!1,this.unpackAlignment=1}}class PF extends Nt{constructor(e=1,t=1,i=1){super(e,t),this.isWebGL3DRenderTarget=!0,this.depth=i,this.texture=new fl(null,e,t,i),this.texture.isRenderTargetTexture=!0}}class MW extends Nt{constructor(e=1,t=1,i=1,s={}){super(e,t,s),this.isWebGLMultipleRenderTargets=!0;const r=this.texture;this.texture=[];for(let o=0;o=0?1:-1,m=1-A*A;if(m>Number.EPSILON){const S=Math.sqrt(m),x=Math.atan2(S,A*b);y=Math.sin(y*x)/S,a=Math.sin(a*x)/S}const B=a*b;if(l=l*y+d*B,g=g*y+h*B,u=u*y+f*B,C=C*y+v*B,y===1-a){const S=1/Math.sqrt(l*l+g*g+u*u+C*C);l*=S,g*=S,u*=S,C*=S}}e[t]=l,e[t+1]=g,e[t+2]=u,e[t+3]=C}static multiplyQuaternionsFlat(e,t,i,s,r,o){const a=i[s],l=i[s+1],g=i[s+2],u=i[s+3],C=r[o],d=r[o+1],h=r[o+2],f=r[o+3];return e[t]=a*f+u*C+l*h-g*d,e[t+1]=l*f+u*d+g*C-a*h,e[t+2]=g*f+u*h+a*d-l*C,e[t+3]=u*f-a*C-l*d-g*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,t,i,s){return this._x=e,this._y=t,this._z=i,this._w=s,this._onChangeCallback(),this}clone(){return new this.constructor(this._x,this._y,this._z,this._w)}copy(e){return this._x=e.x,this._y=e.y,this._z=e.z,this._w=e.w,this._onChangeCallback(),this}setFromEuler(e,t){const i=e._x,s=e._y,r=e._z,o=e._order,a=Math.cos,l=Math.sin,g=a(i/2),u=a(s/2),C=a(r/2),d=l(i/2),h=l(s/2),f=l(r/2);switch(o){case"XYZ":this._x=d*u*C+g*h*f,this._y=g*h*C-d*u*f,this._z=g*u*f+d*h*C,this._w=g*u*C-d*h*f;break;case"YXZ":this._x=d*u*C+g*h*f,this._y=g*h*C-d*u*f,this._z=g*u*f-d*h*C,this._w=g*u*C+d*h*f;break;case"ZXY":this._x=d*u*C-g*h*f,this._y=g*h*C+d*u*f,this._z=g*u*f+d*h*C,this._w=g*u*C-d*h*f;break;case"ZYX":this._x=d*u*C-g*h*f,this._y=g*h*C+d*u*f,this._z=g*u*f-d*h*C,this._w=g*u*C+d*h*f;break;case"YZX":this._x=d*u*C+g*h*f,this._y=g*h*C+d*u*f,this._z=g*u*f-d*h*C,this._w=g*u*C-d*h*f;break;case"XZY":this._x=d*u*C-g*h*f,this._y=g*h*C-d*u*f,this._z=g*u*f+d*h*C,this._w=g*u*C+d*h*f;break;default:console.warn("THREE.Quaternion: .setFromEuler() encountered an unknown order: "+o)}return t!==!1&&this._onChangeCallback(),this}setFromAxisAngle(e,t){const i=t/2,s=Math.sin(i);return this._x=e.x*s,this._y=e.y*s,this._z=e.z*s,this._w=Math.cos(i),this._onChangeCallback(),this}setFromRotationMatrix(e){const t=e.elements,i=t[0],s=t[4],r=t[8],o=t[1],a=t[5],l=t[9],g=t[2],u=t[6],C=t[10],d=i+a+C;if(d>0){const h=.5/Math.sqrt(d+1);this._w=.25/h,this._x=(u-l)*h,this._y=(r-g)*h,this._z=(o-s)*h}else if(i>a&&i>C){const h=2*Math.sqrt(1+i-a-C);this._w=(u-l)/h,this._x=.25*h,this._y=(s+o)/h,this._z=(r+g)/h}else if(a>C){const h=2*Math.sqrt(1+a-i-C);this._w=(r-g)/h,this._x=(s+o)/h,this._y=.25*h,this._z=(l+u)/h}else{const h=2*Math.sqrt(1+C-i-a);this._w=(o-s)/h,this._x=(r+g)/h,this._y=(l+u)/h,this._z=.25*h}return this._onChangeCallback(),this}setFromUnitVectors(e,t){let i=e.dot(t)+1;return iMath.abs(e.z)?(this._x=-e.y,this._y=e.x,this._z=0,this._w=i):(this._x=0,this._y=-e.z,this._z=e.y,this._w=i)):(this._x=e.y*t.z-e.z*t.y,this._y=e.z*t.x-e.x*t.z,this._z=e.x*t.y-e.y*t.x,this._w=i),this.normalize()}angleTo(e){return 2*Math.acos(Math.abs(Sn(this.dot(e),-1,1)))}rotateTowards(e,t){const i=this.angleTo(e);if(i===0)return this;const s=Math.min(1,t/i);return this.slerp(e,s),this}identity(){return this.set(0,0,0,1)}invert(){return this.conjugate()}conjugate(){return this._x*=-1,this._y*=-1,this._z*=-1,this._onChangeCallback(),this}dot(e){return this._x*e._x+this._y*e._y+this._z*e._z+this._w*e._w}lengthSq(){return this._x*this._x+this._y*this._y+this._z*this._z+this._w*this._w}length(){return Math.sqrt(this._x*this._x+this._y*this._y+this._z*this._z+this._w*this._w)}normalize(){let e=this.length();return e===0?(this._x=0,this._y=0,this._z=0,this._w=1):(e=1/e,this._x=this._x*e,this._y=this._y*e,this._z=this._z*e,this._w=this._w*e),this._onChangeCallback(),this}multiply(e){return this.multiplyQuaternions(this,e)}premultiply(e){return this.multiplyQuaternions(e,this)}multiplyQuaternions(e,t){const i=e._x,s=e._y,r=e._z,o=e._w,a=t._x,l=t._y,g=t._z,u=t._w;return this._x=i*u+o*a+s*g-r*l,this._y=s*u+o*l+r*a-i*g,this._z=r*u+o*g+i*l-s*a,this._w=o*u-i*a-s*l-r*g,this._onChangeCallback(),this}slerp(e,t){if(t===0)return this;if(t===1)return this.copy(e);const i=this._x,s=this._y,r=this._z,o=this._w;let a=o*e._w+i*e._x+s*e._y+r*e._z;if(a<0?(this._w=-e._w,this._x=-e._x,this._y=-e._y,this._z=-e._z,a=-a):this.copy(e),a>=1)return this._w=o,this._x=i,this._y=s,this._z=r,this;const l=1-a*a;if(l<=Number.EPSILON){const h=1-t;return this._w=h*o+t*this._w,this._x=h*i+t*this._x,this._y=h*s+t*this._y,this._z=h*r+t*this._z,this.normalize(),this._onChangeCallback(),this}const g=Math.sqrt(l),u=Math.atan2(g,a),C=Math.sin((1-t)*u)/g,d=Math.sin(t*u)/g;return this._w=o*C+this._w*d,this._x=i*C+this._x*d,this._y=s*C+this._y*d,this._z=r*C+this._z*d,this._onChangeCallback(),this}slerpQuaternions(e,t,i){return this.copy(e).slerp(t,i)}random(){const e=Math.random(),t=Math.sqrt(1-e),i=Math.sqrt(e),s=2*Math.PI*Math.random(),r=2*Math.PI*Math.random();return this.set(t*Math.cos(s),i*Math.sin(r),i*Math.cos(r),t*Math.sin(s))}equals(e){return e._x===this._x&&e._y===this._y&&e._z===this._z&&e._w===this._w}fromArray(e,t=0){return this._x=e[t],this._y=e[t+1],this._z=e[t+2],this._w=e[t+3],this._onChangeCallback(),this}toArray(e=[],t=0){return e[t]=this._x,e[t+1]=this._y,e[t+2]=this._z,e[t+3]=this._w,e}fromBufferAttribute(e,t){return this._x=e.getX(t),this._y=e.getY(t),this._z=e.getZ(t),this._w=e.getW(t),this}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 H{constructor(e=0,t=0,i=0){H.prototype.isVector3=!0,this.x=e,this.y=t,this.z=i}set(e,t,i){return i===void 0&&(i=this.z),this.x=e,this.y=t,this.z=i,this}setScalar(e){return this.x=e,this.y=e,this.z=e,this}setX(e){return this.x=e,this}setY(e){return this.y=e,this}setZ(e){return this.z=e,this}setComponent(e,t){switch(e){case 0:this.x=t;break;case 1:this.y=t;break;case 2:this.z=t;break;default:throw new Error("index is out of range: "+e)}return this}getComponent(e){switch(e){case 0:return this.x;case 1:return this.y;case 2:return this.z;default:throw new Error("index is out of range: "+e)}}clone(){return new this.constructor(this.x,this.y,this.z)}copy(e){return this.x=e.x,this.y=e.y,this.z=e.z,this}add(e){return this.x+=e.x,this.y+=e.y,this.z+=e.z,this}addScalar(e){return this.x+=e,this.y+=e,this.z+=e,this}addVectors(e,t){return this.x=e.x+t.x,this.y=e.y+t.y,this.z=e.z+t.z,this}addScaledVector(e,t){return this.x+=e.x*t,this.y+=e.y*t,this.z+=e.z*t,this}sub(e){return this.x-=e.x,this.y-=e.y,this.z-=e.z,this}subScalar(e){return this.x-=e,this.y-=e,this.z-=e,this}subVectors(e,t){return this.x=e.x-t.x,this.y=e.y-t.y,this.z=e.z-t.z,this}multiply(e){return this.x*=e.x,this.y*=e.y,this.z*=e.z,this}multiplyScalar(e){return this.x*=e,this.y*=e,this.z*=e,this}multiplyVectors(e,t){return this.x=e.x*t.x,this.y=e.y*t.y,this.z=e.z*t.z,this}applyEuler(e){return this.applyQuaternion(rZ.setFromEuler(e))}applyAxisAngle(e,t){return this.applyQuaternion(rZ.setFromAxisAngle(e,t))}applyMatrix3(e){const t=this.x,i=this.y,s=this.z,r=e.elements;return this.x=r[0]*t+r[3]*i+r[6]*s,this.y=r[1]*t+r[4]*i+r[7]*s,this.z=r[2]*t+r[5]*i+r[8]*s,this}applyNormalMatrix(e){return this.applyMatrix3(e).normalize()}applyMatrix4(e){const t=this.x,i=this.y,s=this.z,r=e.elements,o=1/(r[3]*t+r[7]*i+r[11]*s+r[15]);return this.x=(r[0]*t+r[4]*i+r[8]*s+r[12])*o,this.y=(r[1]*t+r[5]*i+r[9]*s+r[13])*o,this.z=(r[2]*t+r[6]*i+r[10]*s+r[14])*o,this}applyQuaternion(e){const t=this.x,i=this.y,s=this.z,r=e.x,o=e.y,a=e.z,l=e.w,g=l*t+o*s-a*i,u=l*i+a*t-r*s,C=l*s+r*i-o*t,d=-r*t-o*i-a*s;return this.x=g*l+d*-r+u*-a-C*-o,this.y=u*l+d*-o+C*-r-g*-a,this.z=C*l+d*-a+g*-o-u*-r,this}project(e){return this.applyMatrix4(e.matrixWorldInverse).applyMatrix4(e.projectionMatrix)}unproject(e){return this.applyMatrix4(e.projectionMatrixInverse).applyMatrix4(e.matrixWorld)}transformDirection(e){const t=this.x,i=this.y,s=this.z,r=e.elements;return this.x=r[0]*t+r[4]*i+r[8]*s,this.y=r[1]*t+r[5]*i+r[9]*s,this.z=r[2]*t+r[6]*i+r[10]*s,this.normalize()}divide(e){return this.x/=e.x,this.y/=e.y,this.z/=e.z,this}divideScalar(e){return this.multiplyScalar(1/e)}min(e){return this.x=Math.min(this.x,e.x),this.y=Math.min(this.y,e.y),this.z=Math.min(this.z,e.z),this}max(e){return this.x=Math.max(this.x,e.x),this.y=Math.max(this.y,e.y),this.z=Math.max(this.z,e.z),this}clamp(e,t){return this.x=Math.max(e.x,Math.min(t.x,this.x)),this.y=Math.max(e.y,Math.min(t.y,this.y)),this.z=Math.max(e.z,Math.min(t.z,this.z)),this}clampScalar(e,t){return this.x=Math.max(e,Math.min(t,this.x)),this.y=Math.max(e,Math.min(t,this.y)),this.z=Math.max(e,Math.min(t,this.z)),this}clampLength(e,t){const i=this.length();return this.divideScalar(i||1).multiplyScalar(Math.max(e,Math.min(t,i)))}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=this.x<0?Math.ceil(this.x):Math.floor(this.x),this.y=this.y<0?Math.ceil(this.y):Math.floor(this.y),this.z=this.z<0?Math.ceil(this.z):Math.floor(this.z),this}negate(){return this.x=-this.x,this.y=-this.y,this.z=-this.z,this}dot(e){return this.x*e.x+this.y*e.y+this.z*e.z}lengthSq(){return this.x*this.x+this.y*this.y+this.z*this.z}length(){return Math.sqrt(this.x*this.x+this.y*this.y+this.z*this.z)}manhattanLength(){return Math.abs(this.x)+Math.abs(this.y)+Math.abs(this.z)}normalize(){return this.divideScalar(this.length()||1)}setLength(e){return this.normalize().multiplyScalar(e)}lerp(e,t){return this.x+=(e.x-this.x)*t,this.y+=(e.y-this.y)*t,this.z+=(e.z-this.z)*t,this}lerpVectors(e,t,i){return this.x=e.x+(t.x-e.x)*i,this.y=e.y+(t.y-e.y)*i,this.z=e.z+(t.z-e.z)*i,this}cross(e){return this.crossVectors(this,e)}crossVectors(e,t){const i=e.x,s=e.y,r=e.z,o=t.x,a=t.y,l=t.z;return this.x=s*l-r*a,this.y=r*o-i*l,this.z=i*a-s*o,this}projectOnVector(e){const t=e.lengthSq();if(t===0)return this.set(0,0,0);const i=e.dot(this)/t;return this.copy(e).multiplyScalar(i)}projectOnPlane(e){return sm.copy(this).projectOnVector(e),this.sub(sm)}reflect(e){return this.sub(sm.copy(e).multiplyScalar(2*this.dot(e)))}angleTo(e){const t=Math.sqrt(this.lengthSq()*e.lengthSq());if(t===0)return Math.PI/2;const i=this.dot(e)/t;return Math.acos(Sn(i,-1,1))}distanceTo(e){return Math.sqrt(this.distanceToSquared(e))}distanceToSquared(e){const t=this.x-e.x,i=this.y-e.y,s=this.z-e.z;return t*t+i*i+s*s}manhattanDistanceTo(e){return Math.abs(this.x-e.x)+Math.abs(this.y-e.y)+Math.abs(this.z-e.z)}setFromSpherical(e){return this.setFromSphericalCoords(e.radius,e.phi,e.theta)}setFromSphericalCoords(e,t,i){const s=Math.sin(t)*e;return this.x=s*Math.sin(i),this.y=Math.cos(t)*e,this.z=s*Math.cos(i),this}setFromCylindrical(e){return this.setFromCylindricalCoords(e.radius,e.theta,e.y)}setFromCylindricalCoords(e,t,i){return this.x=e*Math.sin(t),this.y=i,this.z=e*Math.cos(t),this}setFromMatrixPosition(e){const t=e.elements;return this.x=t[12],this.y=t[13],this.z=t[14],this}setFromMatrixScale(e){const t=this.setFromMatrixColumn(e,0).length(),i=this.setFromMatrixColumn(e,1).length(),s=this.setFromMatrixColumn(e,2).length();return this.x=t,this.y=i,this.z=s,this}setFromMatrixColumn(e,t){return this.fromArray(e.elements,t*4)}setFromMatrix3Column(e,t){return this.fromArray(e.elements,t*3)}setFromEuler(e){return this.x=e._x,this.y=e._y,this.z=e._z,this}setFromColor(e){return this.x=e.r,this.y=e.g,this.z=e.b,this}equals(e){return e.x===this.x&&e.y===this.y&&e.z===this.z}fromArray(e,t=0){return this.x=e[t],this.y=e[t+1],this.z=e[t+2],this}toArray(e=[],t=0){return e[t]=this.x,e[t+1]=this.y,e[t+2]=this.z,e}fromBufferAttribute(e,t){return this.x=e.getX(t),this.y=e.getY(t),this.z=e.getZ(t),this}random(){return this.x=Math.random(),this.y=Math.random(),this.z=Math.random(),this}randomDirection(){const e=(Math.random()-.5)*2,t=Math.random()*Math.PI*2,i=Math.sqrt(1-e**2);return this.x=i*Math.cos(t),this.y=i*Math.sin(t),this.z=e,this}*[Symbol.iterator](){yield this.x,yield this.y,yield this.z}}const sm=new H,rZ=new Mn;class kr{constructor(e=new H(1/0,1/0,1/0),t=new H(-1/0,-1/0,-1/0)){this.isBox3=!0,this.min=e,this.max=t}set(e,t){return this.min.copy(e),this.max.copy(t),this}setFromArray(e){this.makeEmpty();for(let t=0,i=e.length;tthis.max.x||e.ythis.max.y||e.zthis.max.z)}containsBox(e){return this.min.x<=e.min.x&&e.max.x<=this.max.x&&this.min.y<=e.min.y&&e.max.y<=this.max.y&&this.min.z<=e.min.z&&e.max.z<=this.max.z}getParameter(e,t){return t.set((e.x-this.min.x)/(this.max.x-this.min.x),(e.y-this.min.y)/(this.max.y-this.min.y),(e.z-this.min.z)/(this.max.z-this.min.z))}intersectsBox(e){return!(e.max.xthis.max.x||e.max.ythis.max.y||e.max.zthis.max.z)}intersectsSphere(e){return this.clampPoint(e.center,to),to.distanceToSquared(e.center)<=e.radius*e.radius}intersectsPlane(e){let t,i;return e.normal.x>0?(t=e.normal.x*this.min.x,i=e.normal.x*this.max.x):(t=e.normal.x*this.max.x,i=e.normal.x*this.min.x),e.normal.y>0?(t+=e.normal.y*this.min.y,i+=e.normal.y*this.max.y):(t+=e.normal.y*this.max.y,i+=e.normal.y*this.min.y),e.normal.z>0?(t+=e.normal.z*this.min.z,i+=e.normal.z*this.max.z):(t+=e.normal.z*this.max.z,i+=e.normal.z*this.min.z),t<=-e.constant&&i>=-e.constant}intersectsTriangle(e){if(this.isEmpty())return!1;this.getCenter(dI),Md.subVectors(this.max,dI),sg.subVectors(e.a,dI),rg.subVectors(e.b,dI),og.subVectors(e.c,dI),Do.subVectors(rg,sg),Uo.subVectors(og,rg),Ea.subVectors(sg,og);let t=[0,-Do.z,Do.y,0,-Uo.z,Uo.y,0,-Ea.z,Ea.y,Do.z,0,-Do.x,Uo.z,0,-Uo.x,Ea.z,0,-Ea.x,-Do.y,Do.x,0,-Uo.y,Uo.x,0,-Ea.y,Ea.x,0];return!rm(t,sg,rg,og,Md)||(t=[1,0,0,0,1,0,0,0,1],!rm(t,sg,rg,og,Md))?!1:(Nd.crossVectors(Do,Uo),t=[Nd.x,Nd.y,Nd.z],rm(t,sg,rg,og,Md))}clampPoint(e,t){return t.copy(e).clamp(this.min,this.max)}distanceToPoint(e){return this.clampPoint(e,to).distanceTo(e)}getBoundingSphere(e){return this.isEmpty()?e.makeEmpty():(this.getCenter(e.center),e.radius=this.getSize(to).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:(eo[0].set(this.min.x,this.min.y,this.min.z).applyMatrix4(e),eo[1].set(this.min.x,this.min.y,this.max.z).applyMatrix4(e),eo[2].set(this.min.x,this.max.y,this.min.z).applyMatrix4(e),eo[3].set(this.min.x,this.max.y,this.max.z).applyMatrix4(e),eo[4].set(this.max.x,this.min.y,this.min.z).applyMatrix4(e),eo[5].set(this.max.x,this.min.y,this.max.z).applyMatrix4(e),eo[6].set(this.max.x,this.max.y,this.min.z).applyMatrix4(e),eo[7].set(this.max.x,this.max.y,this.max.z).applyMatrix4(e),this.setFromPoints(eo),this)}translate(e){return this.min.add(e),this.max.add(e),this}equals(e){return e.min.equals(this.min)&&e.max.equals(this.max)}}const eo=[new H,new H,new H,new H,new H,new H,new H,new H],to=new H,ig=new kr,sg=new H,rg=new H,og=new H,Do=new H,Uo=new H,Ea=new H,dI=new H,Md=new H,Nd=new H,Ta=new H;function rm(n,e,t,i,s){for(let r=0,o=n.length-3;r<=o;r+=3){Ta.fromArray(n,r);const a=s.x*Math.abs(Ta.x)+s.y*Math.abs(Ta.y)+s.z*Math.abs(Ta.z),l=e.dot(Ta),g=t.dot(Ta),u=i.dot(Ta);if(Math.max(-Math.max(l,g,u),Math.min(l,g,u))>a)return!1}return!0}const _F=new kr,hI=new H,om=new H;class Dr{constructor(e=new H,t=-1){this.center=e,this.radius=t}set(e,t){return this.center.copy(e),this.radius=t,this}setFromPoints(e,t){const i=this.center;t!==void 0?i.copy(t):_F.setFromPoints(e).getCenter(i);let s=0;for(let r=0,o=e.length;rthis.radius*this.radius&&(t.sub(this.center).normalize(),t.multiplyScalar(this.radius).add(this.center)),t}getBoundingBox(e){return this.isEmpty()?(e.makeEmpty(),e):(e.set(this.center,this.center),e.expandByScalar(this.radius),e)}applyMatrix4(e){return this.center.applyMatrix4(e),this.radius=this.radius*e.getMaxScaleOnAxis(),this}translate(e){return this.center.add(e),this}expandByPoint(e){if(this.isEmpty())return this.center.copy(e),this.radius=0,this;hI.subVectors(e,this.center);const t=hI.lengthSq();if(t>this.radius*this.radius){const i=Math.sqrt(t),s=(i-this.radius)*.5;this.center.addScaledVector(hI,s/i),this.radius+=s}return this}union(e){return e.isEmpty()?this:this.isEmpty()?(this.copy(e),this):(this.center.equals(e.center)===!0?this.radius=Math.max(this.radius,e.radius):(om.subVectors(e.center,this.center).setLength(e.radius),this.expandByPoint(hI.copy(e.center).add(om)),this.expandByPoint(hI.copy(e.center).sub(om))),this)}equals(e){return e.center.equals(this.center)&&e.radius===this.radius}clone(){return new this.constructor().copy(this)}}const no=new H,am=new H,Hd=new H,Po=new H,lm=new H,Xd=new H,gm=new H;let rC=class{constructor(e=new H,t=new H(0,0,-1)){this.origin=e,this.direction=t}set(e,t){return this.origin.copy(e),this.direction.copy(t),this}copy(e){return this.origin.copy(e.origin),this.direction.copy(e.direction),this}at(e,t){return t.copy(this.origin).addScaledVector(this.direction,e)}lookAt(e){return this.direction.copy(e).sub(this.origin).normalize(),this}recast(e){return this.origin.copy(this.at(e,no)),this}closestPointToPoint(e,t){t.subVectors(e,this.origin);const i=t.dot(this.direction);return i<0?t.copy(this.origin):t.copy(this.origin).addScaledVector(this.direction,i)}distanceToPoint(e){return Math.sqrt(this.distanceSqToPoint(e))}distanceSqToPoint(e){const t=no.subVectors(e,this.origin).dot(this.direction);return t<0?this.origin.distanceToSquared(e):(no.copy(this.origin).addScaledVector(this.direction,t),no.distanceToSquared(e))}distanceSqToSegment(e,t,i,s){am.copy(e).add(t).multiplyScalar(.5),Hd.copy(t).sub(e).normalize(),Po.copy(this.origin).sub(am);const r=e.distanceTo(t)*.5,o=-this.direction.dot(Hd),a=Po.dot(this.direction),l=-Po.dot(Hd),g=Po.lengthSq(),u=Math.abs(1-o*o);let C,d,h,f;if(u>0)if(C=o*l-a,d=o*a-l,f=r*u,C>=0)if(d>=-f)if(d<=f){const v=1/u;C*=v,d*=v,h=C*(C+o*d+2*a)+d*(o*C+d+2*l)+g}else d=r,C=Math.max(0,-(o*d+a)),h=-C*C+d*(d+2*l)+g;else d=-r,C=Math.max(0,-(o*d+a)),h=-C*C+d*(d+2*l)+g;else d<=-f?(C=Math.max(0,-(-o*r+a)),d=C>0?-r:Math.min(Math.max(-r,-l),r),h=-C*C+d*(d+2*l)+g):d<=f?(C=0,d=Math.min(Math.max(-r,-l),r),h=d*(d+2*l)+g):(C=Math.max(0,-(o*r+a)),d=C>0?r:Math.min(Math.max(-r,-l),r),h=-C*C+d*(d+2*l)+g);else d=o>0?-r:r,C=Math.max(0,-(o*d+a)),h=-C*C+d*(d+2*l)+g;return i&&i.copy(this.origin).addScaledVector(this.direction,C),s&&s.copy(am).addScaledVector(Hd,d),h}intersectSphere(e,t){no.subVectors(e.center,this.origin);const i=no.dot(this.direction),s=no.dot(no)-i*i,r=e.radius*e.radius;if(s>r)return null;const o=Math.sqrt(r-s),a=i-o,l=i+o;return l<0?null:a<0?this.at(l,t):this.at(a,t)}intersectsSphere(e){return this.distanceSqToPoint(e.center)<=e.radius*e.radius}distanceToPlane(e){const t=e.normal.dot(this.direction);if(t===0)return e.distanceToPoint(this.origin)===0?0:null;const i=-(this.origin.dot(e.normal)+e.constant)/t;return i>=0?i:null}intersectPlane(e,t){const i=this.distanceToPlane(e);return i===null?null:this.at(i,t)}intersectsPlane(e){const t=e.distanceToPoint(this.origin);return t===0||e.normal.dot(this.direction)*t<0}intersectBox(e,t){let i,s,r,o,a,l;const g=1/this.direction.x,u=1/this.direction.y,C=1/this.direction.z,d=this.origin;return g>=0?(i=(e.min.x-d.x)*g,s=(e.max.x-d.x)*g):(i=(e.max.x-d.x)*g,s=(e.min.x-d.x)*g),u>=0?(r=(e.min.y-d.y)*u,o=(e.max.y-d.y)*u):(r=(e.max.y-d.y)*u,o=(e.min.y-d.y)*u),i>o||r>s||((r>i||isNaN(i))&&(i=r),(o=0?(a=(e.min.z-d.z)*C,l=(e.max.z-d.z)*C):(a=(e.max.z-d.z)*C,l=(e.min.z-d.z)*C),i>l||a>s)||((a>i||i!==i)&&(i=a),(l=0?i:s,t)}intersectsBox(e){return this.intersectBox(e,no)!==null}intersectTriangle(e,t,i,s,r){lm.subVectors(t,e),Xd.subVectors(i,e),gm.crossVectors(lm,Xd);let o=this.direction.dot(gm),a;if(o>0){if(s)return null;a=1}else if(o<0)a=-1,o=-o;else return null;Po.subVectors(this.origin,e);const l=a*this.direction.dot(Xd.crossVectors(Po,Xd));if(l<0)return null;const g=a*this.direction.dot(lm.cross(Po));if(g<0||l+g>o)return null;const u=-a*Po.dot(gm);return u<0?null:this.at(u/o,r)}applyMatrix4(e){return this.origin.applyMatrix4(e),this.direction.transformDirection(e),this}equals(e){return e.origin.equals(this.origin)&&e.direction.equals(this.direction)}clone(){return new this.constructor().copy(this)}};class _e{constructor(){_e.prototype.isMatrix4=!0,this.elements=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1]}set(e,t,i,s,r,o,a,l,g,u,C,d,h,f,v,y){const A=this.elements;return A[0]=e,A[4]=t,A[8]=i,A[12]=s,A[1]=r,A[5]=o,A[9]=a,A[13]=l,A[2]=g,A[6]=u,A[10]=C,A[14]=d,A[3]=h,A[7]=f,A[11]=v,A[15]=y,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 _e().fromArray(this.elements)}copy(e){const t=this.elements,i=e.elements;return t[0]=i[0],t[1]=i[1],t[2]=i[2],t[3]=i[3],t[4]=i[4],t[5]=i[5],t[6]=i[6],t[7]=i[7],t[8]=i[8],t[9]=i[9],t[10]=i[10],t[11]=i[11],t[12]=i[12],t[13]=i[13],t[14]=i[14],t[15]=i[15],this}copyPosition(e){const t=this.elements,i=e.elements;return t[12]=i[12],t[13]=i[13],t[14]=i[14],this}setFromMatrix3(e){const t=e.elements;return this.set(t[0],t[3],t[6],0,t[1],t[4],t[7],0,t[2],t[5],t[8],0,0,0,0,1),this}extractBasis(e,t,i){return e.setFromMatrixColumn(this,0),t.setFromMatrixColumn(this,1),i.setFromMatrixColumn(this,2),this}makeBasis(e,t,i){return this.set(e.x,t.x,i.x,0,e.y,t.y,i.y,0,e.z,t.z,i.z,0,0,0,0,1),this}extractRotation(e){const t=this.elements,i=e.elements,s=1/ag.setFromMatrixColumn(e,0).length(),r=1/ag.setFromMatrixColumn(e,1).length(),o=1/ag.setFromMatrixColumn(e,2).length();return t[0]=i[0]*s,t[1]=i[1]*s,t[2]=i[2]*s,t[3]=0,t[4]=i[4]*r,t[5]=i[5]*r,t[6]=i[6]*r,t[7]=0,t[8]=i[8]*o,t[9]=i[9]*o,t[10]=i[10]*o,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,this}makeRotationFromEuler(e){const t=this.elements,i=e.x,s=e.y,r=e.z,o=Math.cos(i),a=Math.sin(i),l=Math.cos(s),g=Math.sin(s),u=Math.cos(r),C=Math.sin(r);if(e.order==="XYZ"){const d=o*u,h=o*C,f=a*u,v=a*C;t[0]=l*u,t[4]=-l*C,t[8]=g,t[1]=h+f*g,t[5]=d-v*g,t[9]=-a*l,t[2]=v-d*g,t[6]=f+h*g,t[10]=o*l}else if(e.order==="YXZ"){const d=l*u,h=l*C,f=g*u,v=g*C;t[0]=d+v*a,t[4]=f*a-h,t[8]=o*g,t[1]=o*C,t[5]=o*u,t[9]=-a,t[2]=h*a-f,t[6]=v+d*a,t[10]=o*l}else if(e.order==="ZXY"){const d=l*u,h=l*C,f=g*u,v=g*C;t[0]=d-v*a,t[4]=-o*C,t[8]=f+h*a,t[1]=h+f*a,t[5]=o*u,t[9]=v-d*a,t[2]=-o*g,t[6]=a,t[10]=o*l}else if(e.order==="ZYX"){const d=o*u,h=o*C,f=a*u,v=a*C;t[0]=l*u,t[4]=f*g-h,t[8]=d*g+v,t[1]=l*C,t[5]=v*g+d,t[9]=h*g-f,t[2]=-g,t[6]=a*l,t[10]=o*l}else if(e.order==="YZX"){const d=o*l,h=o*g,f=a*l,v=a*g;t[0]=l*u,t[4]=v-d*C,t[8]=f*C+h,t[1]=C,t[5]=o*u,t[9]=-a*u,t[2]=-g*u,t[6]=h*C+f,t[10]=d-v*C}else if(e.order==="XZY"){const d=o*l,h=o*g,f=a*l,v=a*g;t[0]=l*u,t[4]=-C,t[8]=g*u,t[1]=d*C+v,t[5]=o*u,t[9]=h*C-f,t[2]=f*C-h,t[6]=a*u,t[10]=v*C+d}return t[3]=0,t[7]=0,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,this}makeRotationFromQuaternion(e){return this.compose(JF,e,OF)}lookAt(e,t,i){const s=this.elements;return Cs.subVectors(e,t),Cs.lengthSq()===0&&(Cs.z=1),Cs.normalize(),_o.crossVectors(i,Cs),_o.lengthSq()===0&&(Math.abs(i.z)===1?Cs.x+=1e-4:Cs.z+=1e-4,Cs.normalize(),_o.crossVectors(i,Cs)),_o.normalize(),Fd.crossVectors(Cs,_o),s[0]=_o.x,s[4]=Fd.x,s[8]=Cs.x,s[1]=_o.y,s[5]=Fd.y,s[9]=Cs.y,s[2]=_o.z,s[6]=Fd.z,s[10]=Cs.z,this}multiply(e){return this.multiplyMatrices(this,e)}premultiply(e){return this.multiplyMatrices(e,this)}multiplyMatrices(e,t){const i=e.elements,s=t.elements,r=this.elements,o=i[0],a=i[4],l=i[8],g=i[12],u=i[1],C=i[5],d=i[9],h=i[13],f=i[2],v=i[6],y=i[10],A=i[14],b=i[3],m=i[7],B=i[11],S=i[15],x=s[0],R=s[4],M=s[8],Z=s[12],V=s[1],N=s[5],P=s[9],U=s[13],q=s[2],ie=s[6],he=s[10],Ce=s[14],z=s[3],Q=s[7],J=s[11],le=s[15];return r[0]=o*x+a*V+l*q+g*z,r[4]=o*R+a*N+l*ie+g*Q,r[8]=o*M+a*P+l*he+g*J,r[12]=o*Z+a*U+l*Ce+g*le,r[1]=u*x+C*V+d*q+h*z,r[5]=u*R+C*N+d*ie+h*Q,r[9]=u*M+C*P+d*he+h*J,r[13]=u*Z+C*U+d*Ce+h*le,r[2]=f*x+v*V+y*q+A*z,r[6]=f*R+v*N+y*ie+A*Q,r[10]=f*M+v*P+y*he+A*J,r[14]=f*Z+v*U+y*Ce+A*le,r[3]=b*x+m*V+B*q+S*z,r[7]=b*R+m*N+B*ie+S*Q,r[11]=b*M+m*P+B*he+S*J,r[15]=b*Z+m*U+B*Ce+S*le,this}multiplyScalar(e){const t=this.elements;return t[0]*=e,t[4]*=e,t[8]*=e,t[12]*=e,t[1]*=e,t[5]*=e,t[9]*=e,t[13]*=e,t[2]*=e,t[6]*=e,t[10]*=e,t[14]*=e,t[3]*=e,t[7]*=e,t[11]*=e,t[15]*=e,this}determinant(){const e=this.elements,t=e[0],i=e[4],s=e[8],r=e[12],o=e[1],a=e[5],l=e[9],g=e[13],u=e[2],C=e[6],d=e[10],h=e[14],f=e[3],v=e[7],y=e[11],A=e[15];return f*(+r*l*C-s*g*C-r*a*d+i*g*d+s*a*h-i*l*h)+v*(+t*l*h-t*g*d+r*o*d-s*o*h+s*g*u-r*l*u)+y*(+t*g*C-t*a*h-r*o*C+i*o*h+r*a*u-i*g*u)+A*(-s*a*u-t*l*C+t*a*d+s*o*C-i*o*d+i*l*u)}transpose(){const e=this.elements;let t;return t=e[1],e[1]=e[4],e[4]=t,t=e[2],e[2]=e[8],e[8]=t,t=e[6],e[6]=e[9],e[9]=t,t=e[3],e[3]=e[12],e[12]=t,t=e[7],e[7]=e[13],e[13]=t,t=e[11],e[11]=e[14],e[14]=t,this}setPosition(e,t,i){const s=this.elements;return e.isVector3?(s[12]=e.x,s[13]=e.y,s[14]=e.z):(s[12]=e,s[13]=t,s[14]=i),this}invert(){const e=this.elements,t=e[0],i=e[1],s=e[2],r=e[3],o=e[4],a=e[5],l=e[6],g=e[7],u=e[8],C=e[9],d=e[10],h=e[11],f=e[12],v=e[13],y=e[14],A=e[15],b=C*y*g-v*d*g+v*l*h-a*y*h-C*l*A+a*d*A,m=f*d*g-u*y*g-f*l*h+o*y*h+u*l*A-o*d*A,B=u*v*g-f*C*g+f*a*h-o*v*h-u*a*A+o*C*A,S=f*C*l-u*v*l-f*a*d+o*v*d+u*a*y-o*C*y,x=t*b+i*m+s*B+r*S;if(x===0)return this.set(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0);const R=1/x;return e[0]=b*R,e[1]=(v*d*r-C*y*r-v*s*h+i*y*h+C*s*A-i*d*A)*R,e[2]=(a*y*r-v*l*r+v*s*g-i*y*g-a*s*A+i*l*A)*R,e[3]=(C*l*r-a*d*r-C*s*g+i*d*g+a*s*h-i*l*h)*R,e[4]=m*R,e[5]=(u*y*r-f*d*r+f*s*h-t*y*h-u*s*A+t*d*A)*R,e[6]=(f*l*r-o*y*r-f*s*g+t*y*g+o*s*A-t*l*A)*R,e[7]=(o*d*r-u*l*r+u*s*g-t*d*g-o*s*h+t*l*h)*R,e[8]=B*R,e[9]=(f*C*r-u*v*r-f*i*h+t*v*h+u*i*A-t*C*A)*R,e[10]=(o*v*r-f*a*r+f*i*g-t*v*g-o*i*A+t*a*A)*R,e[11]=(u*a*r-o*C*r-u*i*g+t*C*g+o*i*h-t*a*h)*R,e[12]=S*R,e[13]=(u*v*s-f*C*s+f*i*d-t*v*d-u*i*y+t*C*y)*R,e[14]=(f*a*s-o*v*s-f*i*l+t*v*l+o*i*y-t*a*y)*R,e[15]=(o*C*s-u*a*s+u*i*l-t*C*l-o*i*d+t*a*d)*R,this}scale(e){const t=this.elements,i=e.x,s=e.y,r=e.z;return t[0]*=i,t[4]*=s,t[8]*=r,t[1]*=i,t[5]*=s,t[9]*=r,t[2]*=i,t[6]*=s,t[10]*=r,t[3]*=i,t[7]*=s,t[11]*=r,this}getMaxScaleOnAxis(){const e=this.elements,t=e[0]*e[0]+e[1]*e[1]+e[2]*e[2],i=e[4]*e[4]+e[5]*e[5]+e[6]*e[6],s=e[8]*e[8]+e[9]*e[9]+e[10]*e[10];return Math.sqrt(Math.max(t,i,s))}makeTranslation(e,t,i){return this.set(1,0,0,e,0,1,0,t,0,0,1,i,0,0,0,1),this}makeRotationX(e){const t=Math.cos(e),i=Math.sin(e);return this.set(1,0,0,0,0,t,-i,0,0,i,t,0,0,0,0,1),this}makeRotationY(e){const t=Math.cos(e),i=Math.sin(e);return this.set(t,0,i,0,0,1,0,0,-i,0,t,0,0,0,0,1),this}makeRotationZ(e){const t=Math.cos(e),i=Math.sin(e);return this.set(t,-i,0,0,i,t,0,0,0,0,1,0,0,0,0,1),this}makeRotationAxis(e,t){const i=Math.cos(t),s=Math.sin(t),r=1-i,o=e.x,a=e.y,l=e.z,g=r*o,u=r*a;return this.set(g*o+i,g*a-s*l,g*l+s*a,0,g*a+s*l,u*a+i,u*l-s*o,0,g*l-s*a,u*l+s*o,r*l*l+i,0,0,0,0,1),this}makeScale(e,t,i){return this.set(e,0,0,0,0,t,0,0,0,0,i,0,0,0,0,1),this}makeShear(e,t,i,s,r,o){return this.set(1,i,r,0,e,1,o,0,t,s,1,0,0,0,0,1),this}compose(e,t,i){const s=this.elements,r=t._x,o=t._y,a=t._z,l=t._w,g=r+r,u=o+o,C=a+a,d=r*g,h=r*u,f=r*C,v=o*u,y=o*C,A=a*C,b=l*g,m=l*u,B=l*C,S=i.x,x=i.y,R=i.z;return s[0]=(1-(v+A))*S,s[1]=(h+B)*S,s[2]=(f-m)*S,s[3]=0,s[4]=(h-B)*x,s[5]=(1-(d+A))*x,s[6]=(y+b)*x,s[7]=0,s[8]=(f+m)*R,s[9]=(y-b)*R,s[10]=(1-(d+v))*R,s[11]=0,s[12]=e.x,s[13]=e.y,s[14]=e.z,s[15]=1,this}decompose(e,t,i){const s=this.elements;let r=ag.set(s[0],s[1],s[2]).length();const o=ag.set(s[4],s[5],s[6]).length(),a=ag.set(s[8],s[9],s[10]).length();this.determinant()<0&&(r=-r),e.x=s[12],e.y=s[13],e.z=s[14],nr.copy(this);const g=1/r,u=1/o,C=1/a;return nr.elements[0]*=g,nr.elements[1]*=g,nr.elements[2]*=g,nr.elements[4]*=u,nr.elements[5]*=u,nr.elements[6]*=u,nr.elements[8]*=C,nr.elements[9]*=C,nr.elements[10]*=C,t.setFromRotationMatrix(nr),i.x=r,i.y=o,i.z=a,this}makePerspective(e,t,i,s,r,o){const a=this.elements,l=2*r/(t-e),g=2*r/(i-s),u=(t+e)/(t-e),C=(i+s)/(i-s),d=-(o+r)/(o-r),h=-2*o*r/(o-r);return a[0]=l,a[4]=0,a[8]=u,a[12]=0,a[1]=0,a[5]=g,a[9]=C,a[13]=0,a[2]=0,a[6]=0,a[10]=d,a[14]=h,a[3]=0,a[7]=0,a[11]=-1,a[15]=0,this}makeOrthographic(e,t,i,s,r,o){const a=this.elements,l=1/(t-e),g=1/(i-s),u=1/(o-r),C=(t+e)*l,d=(i+s)*g,h=(o+r)*u;return a[0]=2*l,a[4]=0,a[8]=0,a[12]=-C,a[1]=0,a[5]=2*g,a[9]=0,a[13]=-d,a[2]=0,a[6]=0,a[10]=-2*u,a[14]=-h,a[3]=0,a[7]=0,a[11]=0,a[15]=1,this}equals(e){const t=this.elements,i=e.elements;for(let s=0;s<16;s++)if(t[s]!==i[s])return!1;return!0}fromArray(e,t=0){for(let i=0;i<16;i++)this.elements[i]=e[i+t];return this}toArray(e=[],t=0){const i=this.elements;return e[t]=i[0],e[t+1]=i[1],e[t+2]=i[2],e[t+3]=i[3],e[t+4]=i[4],e[t+5]=i[5],e[t+6]=i[6],e[t+7]=i[7],e[t+8]=i[8],e[t+9]=i[9],e[t+10]=i[10],e[t+11]=i[11],e[t+12]=i[12],e[t+13]=i[13],e[t+14]=i[14],e[t+15]=i[15],e}}const ag=new H,nr=new _e,JF=new H(0,0,0),OF=new H(1,1,1),_o=new H,Fd=new H,Cs=new H,oZ=new _e,aZ=new Mn;class Xl{constructor(e=0,t=0,i=0,s=Xl.DEFAULT_ORDER){this.isEuler=!0,this._x=e,this._y=t,this._z=i,this._order=s}get x(){return this._x}set x(e){this._x=e,this._onChangeCallback()}get y(){return this._y}set y(e){this._y=e,this._onChangeCallback()}get z(){return this._z}set z(e){this._z=e,this._onChangeCallback()}get order(){return this._order}set order(e){this._order=e,this._onChangeCallback()}set(e,t,i,s=this._order){return this._x=e,this._y=t,this._z=i,this._order=s,this._onChangeCallback(),this}clone(){return new this.constructor(this._x,this._y,this._z,this._order)}copy(e){return this._x=e._x,this._y=e._y,this._z=e._z,this._order=e._order,this._onChangeCallback(),this}setFromRotationMatrix(e,t=this._order,i=!0){const s=e.elements,r=s[0],o=s[4],a=s[8],l=s[1],g=s[5],u=s[9],C=s[2],d=s[6],h=s[10];switch(t){case"XYZ":this._y=Math.asin(Sn(a,-1,1)),Math.abs(a)<.9999999?(this._x=Math.atan2(-u,h),this._z=Math.atan2(-o,r)):(this._x=Math.atan2(d,g),this._z=0);break;case"YXZ":this._x=Math.asin(-Sn(u,-1,1)),Math.abs(u)<.9999999?(this._y=Math.atan2(a,h),this._z=Math.atan2(l,g)):(this._y=Math.atan2(-C,r),this._z=0);break;case"ZXY":this._x=Math.asin(Sn(d,-1,1)),Math.abs(d)<.9999999?(this._y=Math.atan2(-C,h),this._z=Math.atan2(-o,g)):(this._y=0,this._z=Math.atan2(l,r));break;case"ZYX":this._y=Math.asin(-Sn(C,-1,1)),Math.abs(C)<.9999999?(this._x=Math.atan2(d,h),this._z=Math.atan2(l,r)):(this._x=0,this._z=Math.atan2(-o,g));break;case"YZX":this._z=Math.asin(Sn(l,-1,1)),Math.abs(l)<.9999999?(this._x=Math.atan2(-u,g),this._y=Math.atan2(-C,r)):(this._x=0,this._y=Math.atan2(a,h));break;case"XZY":this._z=Math.asin(-Sn(o,-1,1)),Math.abs(o)<.9999999?(this._x=Math.atan2(d,g),this._y=Math.atan2(a,r)):(this._x=Math.atan2(-u,h),this._y=0);break;default:console.warn("THREE.Euler: .setFromRotationMatrix() encountered an unknown order: "+t)}return this._order=t,i===!0&&this._onChangeCallback(),this}setFromQuaternion(e,t,i){return oZ.makeRotationFromQuaternion(e),this.setFromRotationMatrix(oZ,t,i)}setFromVector3(e,t=this._order){return this.set(e.x,e.y,e.z,t)}reorder(e){return aZ.setFromEuler(this),this.setFromQuaternion(aZ,e)}equals(e){return e._x===this._x&&e._y===this._y&&e._z===this._z&&e._order===this._order}fromArray(e){return this._x=e[0],this._y=e[1],this._z=e[2],e[3]!==void 0&&(this._order=e[3]),this._onChangeCallback(),this}toArray(e=[],t=0){return e[t]=this._x,e[t+1]=this._y,e[t+2]=this._z,e[t+3]=this._order,e}_onChange(e){return this._onChangeCallback=e,this}_onChangeCallback(){}*[Symbol.iterator](){yield this._x,yield this._y,yield this._z,yield this._order}}Xl.DEFAULT_ORDER="XYZ";class ml{constructor(){this.mask=1}set(e){this.mask=(1<>>0}enable(e){this.mask|=1<1){for(let t=0;t1){for(let i=0;i0&&(i=i.concat(o))}return i}getWorldPosition(e){return this.updateWorldMatrix(!0,!1),e.setFromMatrixPosition(this.matrixWorld)}getWorldQuaternion(e){return this.updateWorldMatrix(!0,!1),this.matrixWorld.decompose(AI,e,jF),e}getWorldScale(e){return this.updateWorldMatrix(!0,!1),this.matrixWorld.decompose(AI,qF,e),e}getWorldDirection(e){this.updateWorldMatrix(!0,!1);const t=this.matrixWorld.elements;return e.set(t[8],t[9],t[10]).normalize()}raycast(){}traverse(e){e(this);const t=this.children;for(let i=0,s=t.length;i0&&(s.userData=this.userData),s.layers=this.layers.mask,s.matrix=this.matrix.toArray(),s.up=this.up.toArray(),this.matrixAutoUpdate===!1&&(s.matrixAutoUpdate=!1),this.isInstancedMesh&&(s.type="InstancedMesh",s.count=this.count,s.instanceMatrix=this.instanceMatrix.toJSON(),this.instanceColor!==null&&(s.instanceColor=this.instanceColor.toJSON()));function r(a,l){return a[l.uuid]===void 0&&(a[l.uuid]=l.toJSON(e)),l.uuid}if(this.isScene)this.background&&(this.background.isColor?s.background=this.background.toJSON():this.background.isTexture&&(s.background=this.background.toJSON(e).uuid)),this.environment&&this.environment.isTexture&&this.environment.isRenderTargetTexture!==!0&&(s.environment=this.environment.toJSON(e).uuid);else if(this.isMesh||this.isLine||this.isPoints){s.geometry=r(e.geometries,this.geometry);const a=this.geometry.parameters;if(a!==void 0&&a.shapes!==void 0){const l=a.shapes;if(Array.isArray(l))for(let g=0,u=l.length;g0){s.children=[];for(let a=0;a0){s.animations=[];for(let a=0;a0&&(i.geometries=a),l.length>0&&(i.materials=l),g.length>0&&(i.textures=g),u.length>0&&(i.images=u),C.length>0&&(i.shapes=C),d.length>0&&(i.skeletons=d),h.length>0&&(i.animations=h),f.length>0&&(i.nodes=f)}return i.object=s,i;function o(a){const l=[];for(const g in a){const u=a[g];delete u.metadata,l.push(u)}return l}}clone(e){return new this.constructor().copy(this,e)}copy(e,t=!0){if(this.name=e.name,this.up.copy(e.up),this.position.copy(e.position),this.rotation.order=e.rotation.order,this.quaternion.copy(e.quaternion),this.scale.copy(e.scale),this.matrix.copy(e.matrix),this.matrixWorld.copy(e.matrixWorld),this.matrixAutoUpdate=e.matrixAutoUpdate,this.matrixWorldNeedsUpdate=e.matrixWorldNeedsUpdate,this.matrixWorldAutoUpdate=e.matrixWorldAutoUpdate,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,this.userData=JSON.parse(JSON.stringify(e.userData)),t===!0)for(let i=0;i0?s.multiplyScalar(1/Math.sqrt(r)):s.set(0,0,0)}static getBarycoord(e,t,i,s,r){ir.subVectors(s,t),so.subVectors(i,t),cm.subVectors(e,t);const o=ir.dot(ir),a=ir.dot(so),l=ir.dot(cm),g=so.dot(so),u=so.dot(cm),C=o*g-a*a;if(C===0)return r.set(-2,-1,-1);const d=1/C,h=(g*l-a*u)*d,f=(o*u-a*l)*d;return r.set(1-h-f,f,h)}static containsPoint(e,t,i,s){return this.getBarycoord(e,t,i,s,ro),ro.x>=0&&ro.y>=0&&ro.x+ro.y<=1}static getUV(e,t,i,s,r,o,a,l){return Kd===!1&&(console.warn("THREE.Triangle.getUV() has been renamed to THREE.Triangle.getInterpolation()."),Kd=!0),this.getInterpolation(e,t,i,s,r,o,a,l)}static getInterpolation(e,t,i,s,r,o,a,l){return this.getBarycoord(e,t,i,s,ro),l.setScalar(0),l.addScaledVector(r,ro.x),l.addScaledVector(o,ro.y),l.addScaledVector(a,ro.z),l}static isFrontFacing(e,t,i,s){return ir.subVectors(i,t),so.subVectors(e,t),ir.cross(so).dot(s)<0}set(e,t,i){return this.a.copy(e),this.b.copy(t),this.c.copy(i),this}setFromPointsAndIndices(e,t,i,s){return this.a.copy(e[t]),this.b.copy(e[i]),this.c.copy(e[s]),this}setFromAttributeAndIndices(e,t,i,s){return this.a.fromBufferAttribute(e,t),this.b.fromBufferAttribute(e,i),this.c.fromBufferAttribute(e,s),this}clone(){return new this.constructor().copy(this)}copy(e){return this.a.copy(e.a),this.b.copy(e.b),this.c.copy(e.c),this}getArea(){return ir.subVectors(this.c,this.b),so.subVectors(this.a,this.b),ir.cross(so).length()*.5}getMidpoint(e){return e.addVectors(this.a,this.b).add(this.c).multiplyScalar(1/3)}getNormal(e){return es.getNormal(this.a,this.b,this.c,e)}getPlane(e){return e.setFromCoplanarPoints(this.a,this.b,this.c)}getBarycoord(e,t){return es.getBarycoord(e,this.a,this.b,this.c,t)}getUV(e,t,i,s,r){return Kd===!1&&(console.warn("THREE.Triangle.getUV() has been renamed to THREE.Triangle.getInterpolation()."),Kd=!0),es.getInterpolation(e,this.a,this.b,this.c,t,i,s,r)}getInterpolation(e,t,i,s,r){return es.getInterpolation(e,this.a,this.b,this.c,t,i,s,r)}containsPoint(e){return es.containsPoint(e,this.a,this.b,this.c)}isFrontFacing(e){return es.isFrontFacing(this.a,this.b,this.c,e)}intersectsBox(e){return e.intersectsTriangle(this)}closestPointToPoint(e,t){const i=this.a,s=this.b,r=this.c;let o,a;gg.subVectors(s,i),cg.subVectors(r,i),Im.subVectors(e,i);const l=gg.dot(Im),g=cg.dot(Im);if(l<=0&&g<=0)return t.copy(i);um.subVectors(e,s);const u=gg.dot(um),C=cg.dot(um);if(u>=0&&C<=u)return t.copy(s);const d=l*C-u*g;if(d<=0&&l>=0&&u<=0)return o=l/(l-u),t.copy(i).addScaledVector(gg,o);Cm.subVectors(e,r);const h=gg.dot(Cm),f=cg.dot(Cm);if(f>=0&&h<=f)return t.copy(r);const v=h*g-l*f;if(v<=0&&g>=0&&f<=0)return a=g/(g-f),t.copy(i).addScaledVector(cg,a);const y=u*f-h*C;if(y<=0&&C-u>=0&&h-f>=0)return CZ.subVectors(r,s),a=(C-u)/(C-u+(h-f)),t.copy(s).addScaledVector(CZ,a);const A=1/(y+v+d);return o=v*A,a=d*A,t.copy(i).addScaledVector(gg,o).addScaledVector(cg,a)}equals(e){return e.a.equals(this.a)&&e.b.equals(this.b)&&e.c.equals(this.c)}}let eY=0;class ei extends Ps{constructor(){super(),this.isMaterial=!0,Object.defineProperty(this,"id",{value:eY++}),this.uuid=vs(),this.name="",this.type="Material",this.blending=Al,this.side=Er,this.vertexColors=!1,this.opacity=1,this.transparent=!1,this.blendSrc=Pv,this.blendDst=_v,this.blendEquation=el,this.blendSrcAlpha=null,this.blendDstAlpha=null,this.blendEquationAlpha=null,this.depthFunc=Wu,this.depthTest=!0,this.depthWrite=!0,this.stencilWriteMask=255,this.stencilFunc=wW,this.stencilRef=0,this.stencilFuncMask=255,this.stencilFail=jh,this.stencilZFail=jh,this.stencilZPass=jh,this.stencilWrite=!1,this.clippingPlanes=null,this.clipIntersection=!1,this.clipShadows=!1,this.shadowSide=null,this.colorWrite=!0,this.precision=null,this.polygonOffset=!1,this.polygonOffsetFactor=0,this.polygonOffsetUnits=0,this.dithering=!1,this.alphaToCoverage=!1,this.premultipliedAlpha=!1,this.forceSinglePass=!1,this.visible=!0,this.toneMapped=!0,this.userData={},this.version=0,this._alphaTest=0}get alphaTest(){return this._alphaTest}set alphaTest(e){this._alphaTest>0!=e>0&&this.version++,this._alphaTest=e}onBuild(){}onBeforeRender(){}onBeforeCompile(){}customProgramCacheKey(){return this.onBeforeCompile.toString()}setValues(e){if(e!==void 0)for(const t in e){const i=e[t];if(i===void 0){console.warn(`THREE.Material: parameter '${t}' has value of undefined.`);continue}const s=this[t];if(s===void 0){console.warn(`THREE.Material: '${t}' is not a property of THREE.${this.type}.`);continue}s&&s.isColor?s.set(i):s&&s.isVector3&&i&&i.isVector3?s.copy(i):this[t]=i}}toJSON(e){const t=e===void 0||typeof e=="string";t&&(e={textures:{},images:{}});const i={metadata:{version:4.5,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&&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.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.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.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!==Al&&(i.blending=this.blending),this.side!==Er&&(i.side=this.side),this.vertexColors&&(i.vertexColors=!0),this.opacity<1&&(i.opacity=this.opacity),this.transparent===!0&&(i.transparent=this.transparent),i.depthFunc=this.depthFunc,i.depthTest=this.depthTest,i.depthWrite=this.depthWrite,i.colorWrite=this.colorWrite,i.stencilWrite=this.stencilWrite,i.stencilWriteMask=this.stencilWriteMask,i.stencilFunc=this.stencilFunc,i.stencilRef=this.stencilRef,i.stencilFuncMask=this.stencilFuncMask,i.stencilFail=this.stencilFail,i.stencilZFail=this.stencilZFail,i.stencilZPass=this.stencilZPass,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.alphaToCoverage===!0&&(i.alphaToCoverage=this.alphaToCoverage),this.premultipliedAlpha===!0&&(i.premultipliedAlpha=this.premultipliedAlpha),this.forceSinglePass===!0&&(i.forceSinglePass=this.forceSinglePass),this.wireframe===!0&&(i.wireframe=this.wireframe),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=this.flatShading),this.visible===!1&&(i.visible=!1),this.toneMapped===!1&&(i.toneMapped=!1),this.fog===!1&&(i.fog=!1),Object.keys(this.userData).length>0&&(i.userData=this.userData);function s(r){const o=[];for(const a in r){const l=r[a];delete l.metadata,o.push(l)}return o}if(t){const r=s(e.textures),o=s(e.images);r.length>0&&(i.textures=r),o.length>0&&(i.images=o)}return i}clone(){return new this.constructor().copy(this)}copy(e){this.name=e.name,this.blending=e.blending,this.side=e.side,this.vertexColors=e.vertexColors,this.opacity=e.opacity,this.transparent=e.transparent,this.blendSrc=e.blendSrc,this.blendDst=e.blendDst,this.blendEquation=e.blendEquation,this.blendSrcAlpha=e.blendSrcAlpha,this.blendDstAlpha=e.blendDstAlpha,this.blendEquationAlpha=e.blendEquationAlpha,this.depthFunc=e.depthFunc,this.depthTest=e.depthTest,this.depthWrite=e.depthWrite,this.stencilWriteMask=e.stencilWriteMask,this.stencilFunc=e.stencilFunc,this.stencilRef=e.stencilRef,this.stencilFuncMask=e.stencilFuncMask,this.stencilFail=e.stencilFail,this.stencilZFail=e.stencilZFail,this.stencilZPass=e.stencilZPass,this.stencilWrite=e.stencilWrite;const t=e.clippingPlanes;let i=null;if(t!==null){const s=t.length;i=new Array(s);for(let r=0;r!==s;++r)i[r]=t[r].clone()}return this.clippingPlanes=i,this.clipIntersection=e.clipIntersection,this.clipShadows=e.clipShadows,this.shadowSide=e.shadowSide,this.colorWrite=e.colorWrite,this.precision=e.precision,this.polygonOffset=e.polygonOffset,this.polygonOffsetFactor=e.polygonOffsetFactor,this.polygonOffsetUnits=e.polygonOffsetUnits,this.dithering=e.dithering,this.alphaTest=e.alphaTest,this.alphaToCoverage=e.alphaToCoverage,this.premultipliedAlpha=e.premultipliedAlpha,this.forceSinglePass=e.forceSinglePass,this.visible=e.visible,this.toneMapped=e.toneMapped,this.userData=JSON.parse(JSON.stringify(e.userData)),this}dispose(){this.dispatchEvent({type:"dispose"})}set needsUpdate(e){e===!0&&this.version++}}const NW={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},sr={h:0,s:0,l:0},zd={h:0,s:0,l:0};function dm(n,e,t){return t<0&&(t+=1),t>1&&(t-=1),t<1/6?n+(e-n)*6*t:t<1/2?e:t<2/3?n+(e-n)*6*(2/3-t):n}class Xe{constructor(e,t,i){return this.isColor=!0,this.r=1,this.g=1,this.b=1,t===void 0&&i===void 0?this.set(e):this.setRGB(e,t,i)}set(e){return e&&e.isColor?this.copy(e):typeof e=="number"?this.setHex(e):typeof e=="string"&&this.setStyle(e),this}setScalar(e){return this.r=e,this.g=e,this.b=e,this}setHex(e,t=yt){return e=Math.floor(e),this.r=(e>>16&255)/255,this.g=(e>>8&255)/255,this.b=(e&255)/255,Ys.toWorkingColorSpace(this,t),this}setRGB(e,t,i,s=Ys.workingColorSpace){return this.r=e,this.g=t,this.b=i,Ys.toWorkingColorSpace(this,s),this}setHSL(e,t,i,s=Ys.workingColorSpace){if(e=ry(e,1),t=Sn(t,0,1),i=Sn(i,0,1),t===0)this.r=this.g=this.b=i;else{const r=i<=.5?i*(1+t):i+t-i*t,o=2*i-r;this.r=dm(o,r,e+1/3),this.g=dm(o,r,e),this.b=dm(o,r,e-1/3)}return Ys.toWorkingColorSpace(this,s),this}setStyle(e,t=yt){function i(r){r!==void 0&&parseFloat(r)<1&&console.warn("THREE.Color: Alpha component of "+e+" will be ignored.")}let s;if(s=/^(\w+)\(([^\)]*)\)/.exec(e)){let r;const o=s[1],a=s[2];switch(o){case"rgb":case"rgba":if(r=/^\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec(a))return i(r[4]),this.setRGB(Math.min(255,parseInt(r[1],10))/255,Math.min(255,parseInt(r[2],10))/255,Math.min(255,parseInt(r[3],10))/255,t);if(r=/^\s*(\d+)\%\s*,\s*(\d+)\%\s*,\s*(\d+)\%\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec(a))return i(r[4]),this.setRGB(Math.min(100,parseInt(r[1],10))/100,Math.min(100,parseInt(r[2],10))/100,Math.min(100,parseInt(r[3],10))/100,t);break;case"hsl":case"hsla":if(r=/^\s*(\d*\.?\d+)\s*,\s*(\d*\.?\d+)\%\s*,\s*(\d*\.?\d+)\%\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec(a))return i(r[4]),this.setHSL(parseFloat(r[1])/360,parseFloat(r[2])/100,parseFloat(r[3])/100,t);break;default:console.warn("THREE.Color: Unknown color model "+e)}}else if(s=/^\#([A-Fa-f\d]+)$/.exec(e)){const r=s[1],o=r.length;if(o===3)return this.setRGB(parseInt(r.charAt(0),16)/15,parseInt(r.charAt(1),16)/15,parseInt(r.charAt(2),16)/15,t);if(o===6)return this.setHex(parseInt(r,16),t);console.warn("THREE.Color: Invalid hex color "+e)}else if(e&&e.length>0)return this.setColorName(e,t);return this}setColorName(e,t=yt){const i=NW[e.toLowerCase()];return i!==void 0?this.setHex(i,t):console.warn("THREE.Color: Unknown color "+e),this}clone(){return new this.constructor(this.r,this.g,this.b)}copy(e){return this.r=e.r,this.g=e.g,this.b=e.b,this}copySRGBToLinear(e){return this.r=rc(e.r),this.g=rc(e.g),this.b=rc(e.b),this}copyLinearToSRGB(e){return this.r=nm(e.r),this.g=nm(e.g),this.b=nm(e.b),this}convertSRGBToLinear(){return this.copySRGBToLinear(this),this}convertLinearToSRGB(){return this.copyLinearToSRGB(this),this}getHex(e=yt){return Ys.fromWorkingColorSpace(wi.copy(this),e),Math.round(Sn(wi.r*255,0,255))*65536+Math.round(Sn(wi.g*255,0,255))*256+Math.round(Sn(wi.b*255,0,255))}getHexString(e=yt){return("000000"+this.getHex(e).toString(16)).slice(-6)}getHSL(e,t=Ys.workingColorSpace){Ys.fromWorkingColorSpace(wi.copy(this),t);const i=wi.r,s=wi.g,r=wi.b,o=Math.max(i,s,r),a=Math.min(i,s,r);let l,g;const u=(a+o)/2;if(a===o)l=0,g=0;else{const C=o-a;switch(g=u<=.5?C/(o+a):C/(2-o-a),o){case i:l=(s-r)/C+(s>-g-14,i[l|256]=1024>>-g-14|32768,s[l]=-g-1,s[l|256]=-g-1):g<=15?(i[l]=g+15<<10,i[l|256]=g+15<<10|32768,s[l]=13,s[l|256]=13):g<128?(i[l]=31744,i[l|256]=64512,s[l]=24,s[l|256]=24):(i[l]=31744,i[l|256]=64512,s[l]=13,s[l|256]=13)}const r=new Uint32Array(2048),o=new Uint32Array(64),a=new Uint32Array(64);for(let l=1;l<1024;++l){let g=l<<13,u=0;for(;!(g&8388608);)g<<=1,u-=8388608;g&=-8388609,u+=947912704,r[l]=g|u}for(let l=1024;l<2048;++l)r[l]=939524096+(l-1024<<13);for(let l=1;l<31;++l)o[l]=l<<23;o[31]=1199570944,o[32]=2147483648;for(let l=33;l<63;++l)o[l]=2147483648+(l-32<<23);o[63]=3347054592;for(let l=1;l<64;++l)l!==32&&(a[l]=1024);return{floatView:e,uint32View:t,baseTable:i,shiftTable:s,mantissaTable:r,exponentTable:o,offsetTable:a}}function Qi(n){Math.abs(n)>65504&&console.warn("THREE.DataUtils.toHalfFloat(): Value out of range."),n=Sn(n,-65504,65504),Io.floatView[0]=n;const e=Io.uint32View[0],t=e>>23&511;return Io.baseTable[t]+((e&8388607)>>Io.shiftTable[t])}function EI(n){const e=n>>10;return Io.uint32View[0]=Io.mantissaTable[Io.offsetTable[e]+(n&1023)]+Io.exponentTable[e],Io.floatView[0]}const nY={toHalfFloat:Qi,fromHalfFloat:EI},zn=new H,Ld=new oe;class Jt{constructor(e,t,i=!1){if(Array.isArray(e))throw new TypeError("THREE.BufferAttribute: array should be a Typed Array.");this.isBufferAttribute=!0,this.name="",this.array=e,this.itemSize=t,this.count=e!==void 0?e.length/t:0,this.normalized=i,this.usage=Ku,this.updateRange={offset:0,count:-1},this.version=0}onUploadCallback(){}set needsUpdate(e){e===!0&&this.version++}setUsage(e){return this.usage=e,this}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}copyAt(e,t,i){e*=this.itemSize,i*=t.itemSize;for(let s=0,r=this.itemSize;s0&&(e.userData=this.userData),this.parameters!==void 0){const l=this.parameters;for(const g in l)l[g]!==void 0&&(e[g]=l[g]);return e}e.data={attributes:{}};const t=this.index;t!==null&&(e.data.index={type:t.array.constructor.name,array:Array.prototype.slice.call(t.array)});const i=this.attributes;for(const l in i){const g=i[l];e.data.attributes[l]=g.toJSON(e.data)}const s={};let r=!1;for(const l in this.morphAttributes){const g=this.morphAttributes[l],u=[];for(let C=0,d=g.length;C0&&(s[l]=u,r=!0)}r&&(e.data.morphAttributes=s,e.data.morphTargetsRelative=this.morphTargetsRelative);const o=this.groups;o.length>0&&(e.data.groups=JSON.parse(JSON.stringify(o)));const a=this.boundingSphere;return a!==null&&(e.data.boundingSphere={center:a.center.toArray(),radius:a.radius}),e}clone(){return new this.constructor().copy(this)}copy(e){this.index=null,this.attributes={},this.morphAttributes={},this.groups=[],this.boundingBox=null,this.boundingSphere=null;const t={};this.name=e.name;const i=e.index;i!==null&&this.setIndex(i.clone(t));const s=e.attributes;for(const g in s){const u=s[g];this.setAttribute(g,u.clone(t))}const r=e.morphAttributes;for(const g in r){const u=[],C=r[g];for(let d=0,h=C.length;d0){const s=t[i[0]];if(s!==void 0){this.morphTargetInfluences=[],this.morphTargetDictionary={};for(let r=0,o=s.length;r(e.far-e.near)**2))&&(dZ.copy(r).invert(),Wr.copy(e.ray).applyMatrix4(dZ),!(i.boundingBox!==null&&Wr.intersectsBox(i.boundingBox)===!1)&&this._computeIntersections(e,t)))}_computeIntersections(e,t){let i;const s=this.geometry,r=this.material,o=s.index,a=s.attributes.position,l=s.attributes.uv,g=s.attributes.uv1,u=s.attributes.normal,C=s.groups,d=s.drawRange;if(o!==null)if(Array.isArray(r))for(let h=0,f=C.length;ht.far?null:{distance:g,point:_d.clone(),object:n}}function Jd(n,e,t,i,s,r,o,a,l,g){n.getVertexPosition(a,ug),n.getVertexPosition(l,Cg),n.getVertexPosition(g,dg);const u=IY(n,e,t,i,ug,Cg,dg,Pd);if(u){s&&(kd.fromBufferAttribute(s,a),Dd.fromBufferAttribute(s,l),Ud.fromBufferAttribute(s,g),u.uv=es.getInterpolation(Pd,ug,Cg,dg,kd,Dd,Ud,new oe)),r&&(kd.fromBufferAttribute(r,a),Dd.fromBufferAttribute(r,l),Ud.fromBufferAttribute(r,g),u.uv1=es.getInterpolation(Pd,ug,Cg,dg,kd,Dd,Ud,new oe),u.uv2=u.uv1),o&&(AZ.fromBufferAttribute(o,a),pZ.fromBufferAttribute(o,l),fZ.fromBufferAttribute(o,g),u.normal=es.getInterpolation(Pd,ug,Cg,dg,AZ,pZ,fZ,new H),u.normal.dot(i.direction)>0&&u.normal.multiplyScalar(-1));const C={a,b:l,c:g,normal:new H,materialIndex:0};es.getNormal(ug,Cg,dg,C.normal),u.face=C}return u}class xa extends Gt{constructor(e=1,t=1,i=1,s=1,r=1,o=1){super(),this.type="BoxGeometry",this.parameters={width:e,height:t,depth:i,widthSegments:s,heightSegments:r,depthSegments:o};const a=this;s=Math.floor(s),r=Math.floor(r),o=Math.floor(o);const l=[],g=[],u=[],C=[];let d=0,h=0;f("z","y","x",-1,-1,i,t,e,o,r,0),f("z","y","x",1,-1,i,t,-e,o,r,1),f("x","z","y",1,1,e,i,t,s,o,2),f("x","z","y",1,-1,e,i,-t,s,o,3),f("x","y","z",1,-1,e,t,i,s,r,4),f("x","y","z",-1,-1,e,t,-i,s,r,5),this.setIndex(l),this.setAttribute("position",new je(g,3)),this.setAttribute("normal",new je(u,3)),this.setAttribute("uv",new je(C,2));function f(v,y,A,b,m,B,S,x,R,M,Z){const V=B/R,N=S/M,P=B/2,U=S/2,q=x/2,ie=R+1,he=M+1;let Ce=0,z=0;const Q=new H;for(let J=0;J0?1:-1,u.push(Q.x,Q.y,Q.z),C.push(se/R),C.push(1-J/M),Ce+=1}}for(let J=0;J0&&(t.defines=this.defines),t.vertexShader=this.vertexShader,t.fragmentShader=this.fragmentShader,t.lights=this.lights,t.clipping=this.clipping;const i={};for(const s in this.extensions)this.extensions[s]===!0&&(i[s]=!0);return Object.keys(i).length>0&&(t.extensions=i),t}}class xc extends zt{constructor(){super(),this.isCamera=!0,this.type="Camera",this.matrixWorldInverse=new _e,this.projectionMatrix=new _e,this.projectionMatrixInverse=new _e}copy(e,t){return super.copy(e,t),this.matrixWorldInverse.copy(e.matrixWorldInverse),this.projectionMatrix.copy(e.projectionMatrix),this.projectionMatrixInverse.copy(e.projectionMatrixInverse),this}getWorldDirection(e){this.updateWorldMatrix(!0,!1);const t=this.matrixWorld.elements;return e.set(-t[8],-t[9],-t[10]).normalize()}updateMatrixWorld(e){super.updateMatrixWorld(e),this.matrixWorldInverse.copy(this.matrixWorld).invert()}updateWorldMatrix(e,t){super.updateWorldMatrix(e,t),this.matrixWorldInverse.copy(this.matrixWorld).invert()}clone(){return new this.constructor().copy(this)}}class mn extends xc{constructor(e=50,t=1,i=.1,s=2e3){super(),this.isPerspectiveCamera=!0,this.type="PerspectiveCamera",this.fov=e,this.zoom=1,this.near=i,this.far=s,this.focus=10,this.aspect=t,this.view=null,this.filmGauge=35,this.filmOffset=0,this.updateProjectionMatrix()}copy(e,t){return super.copy(e,t),this.fov=e.fov,this.zoom=e.zoom,this.near=e.near,this.far=e.far,this.focus=e.focus,this.aspect=e.aspect,this.view=e.view===null?null:Object.assign({},e.view),this.filmGauge=e.filmGauge,this.filmOffset=e.filmOffset,this}setFocalLength(e){const t=.5*this.getFilmHeight()/e;this.fov=fc*2*Math.atan(t),this.updateProjectionMatrix()}getFocalLength(){const e=Math.tan(pl*.5*this.fov);return .5*this.getFilmHeight()/e}getEffectiveFOV(){return fc*2*Math.atan(Math.tan(pl*.5*this.fov)/this.zoom)}getFilmWidth(){return this.filmGauge*Math.min(this.aspect,1)}getFilmHeight(){return this.filmGauge/Math.max(this.aspect,1)}setViewOffset(e,t,i,s,r,o){this.aspect=e/t,this.view===null&&(this.view={enabled:!0,fullWidth:1,fullHeight:1,offsetX:0,offsetY:0,width:1,height:1}),this.view.enabled=!0,this.view.fullWidth=e,this.view.fullHeight=t,this.view.offsetX=i,this.view.offsetY=s,this.view.width=r,this.view.height=o,this.updateProjectionMatrix()}clearViewOffset(){this.view!==null&&(this.view.enabled=!1),this.updateProjectionMatrix()}updateProjectionMatrix(){const e=this.near;let t=e*Math.tan(pl*.5*this.fov)/this.zoom,i=2*t,s=this.aspect*i,r=-.5*s;const o=this.view;if(this.view!==null&&this.view.enabled){const l=o.fullWidth,g=o.fullHeight;r+=o.offsetX*s/l,t-=o.offsetY*i/g,s*=o.width/l,i*=o.height/g}const a=this.filmOffset;a!==0&&(r+=e*a/this.getFilmWidth()),this.projectionMatrix.makePerspective(r,r+s,t,t-i,e,this.far),this.projectionMatrixInverse.copy(this.projectionMatrix).invert()}toJSON(e){const t=super.toJSON(e);return t.object.fov=this.fov,t.object.zoom=this.zoom,t.object.near=this.near,t.object.far=this.far,t.object.focus=this.focus,t.object.aspect=this.aspect,this.view!==null&&(t.object.view=Object.assign({},this.view)),t.object.filmGauge=this.filmGauge,t.object.filmOffset=this.filmOffset,t}}const hg=-90,Ag=1;class gy extends zt{constructor(e,t,i){super(),this.type="CubeCamera",this.renderTarget=i;const s=new mn(hg,Ag,e,t);s.layers=this.layers,s.up.set(0,1,0),s.lookAt(1,0,0),this.add(s);const r=new mn(hg,Ag,e,t);r.layers=this.layers,r.up.set(0,1,0),r.lookAt(-1,0,0),this.add(r);const o=new mn(hg,Ag,e,t);o.layers=this.layers,o.up.set(0,0,-1),o.lookAt(0,1,0),this.add(o);const a=new mn(hg,Ag,e,t);a.layers=this.layers,a.up.set(0,0,1),a.lookAt(0,-1,0),this.add(a);const l=new mn(hg,Ag,e,t);l.layers=this.layers,l.up.set(0,1,0),l.lookAt(0,0,1),this.add(l);const g=new mn(hg,Ag,e,t);g.layers=this.layers,g.up.set(0,1,0),g.lookAt(0,0,-1),this.add(g)}update(e,t){this.parent===null&&this.updateMatrixWorld();const i=this.renderTarget,[s,r,o,a,l,g]=this.children,u=e.getRenderTarget(),C=e.toneMapping,d=e.xr.enabled;e.toneMapping=Ar,e.xr.enabled=!1;const h=i.texture.generateMipmaps;i.texture.generateMipmaps=!1,e.setRenderTarget(i,0),e.render(t,s),e.setRenderTarget(i,1),e.render(t,r),e.setRenderTarget(i,2),e.render(t,o),e.setRenderTarget(i,3),e.render(t,a),e.setRenderTarget(i,4),e.render(t,l),i.texture.generateMipmaps=h,e.setRenderTarget(i,5),e.render(t,g),e.setRenderTarget(u),e.toneMapping=C,e.xr.enabled=d,i.texture.needsPMREMUpdate=!0}}class oC extends sn{constructor(e,t,i,s,r,o,a,l,g,u){e=e!==void 0?e:[],t=t!==void 0?t:fa,super(e,t,i,s,r,o,a,l,g,u),this.isCubeTexture=!0,this.flipY=!1}get images(){return this.image}set images(e){this.image=e}}class sp extends Nt{constructor(e=1,t={}){super(e,e,t),this.isWebGLCubeRenderTarget=!0;const i={width:e,height:e,depth:1},s=[i,i,i,i,i,i];t.encoding!==void 0&&(su("THREE.WebGLCubeRenderTarget: option.encoding has been replaced by option.colorSpace."),t.colorSpace=t.encoding===ks?yt:vo),this.texture=new oC(s,t.mapping,t.wrapS,t.wrapT,t.magFilter,t.minFilter,t.format,t.type,t.anisotropy,t.colorSpace),this.texture.isRenderTargetTexture=!0,this.texture.generateMipmaps=t.generateMipmaps!==void 0?t.generateMipmaps:!1,this.texture.minFilter=t.minFilter!==void 0?t.minFilter:st}fromEquirectangularTexture(e,t){this.texture.type=t.type,this.texture.colorSpace=t.colorSpace,this.texture.generateMipmaps=t.generateMipmaps,this.texture.minFilter=t.minFilter,this.texture.magFilter=t.magFilter;const i={uniforms:{tEquirect:{value:null}},vertexShader:` +}`;class Rt extends ei{constructor(e){super(),this.isShaderMaterial=!0,this.type="ShaderMaterial",this.defines={},this.uniforms={},this.uniformsGroups=[],this.vertexShader=CY,this.fragmentShader=dY,this.linewidth=1,this.wireframe=!1,this.wireframeLinewidth=1,this.fog=!1,this.lights=!1,this.clipping=!1,this.forceSinglePass=!0,this.extensions={derivatives:!1,fragDepth:!1,drawBuffers:!1,shaderTextureLOD:!1},this.defaultAttributeValues={color:[1,1,1],uv:[0,0],uv1:[0,0]},this.index0AttributeName=void 0,this.uniformsNeedUpdate=!1,this.glslVersion=null,e!==void 0&&this.setValues(e)}copy(e){return super.copy(e),this.fragmentShader=e.fragmentShader,this.vertexShader=e.vertexShader,this.uniforms=mc(e.uniforms),this.uniformsGroups=uY(e.uniformsGroups),this.defines=Object.assign({},e.defines),this.wireframe=e.wireframe,this.wireframeLinewidth=e.wireframeLinewidth,this.fog=e.fog,this.lights=e.lights,this.clipping=e.clipping,this.extensions=Object.assign({},e.extensions),this.glslVersion=e.glslVersion,this}toJSON(e){const t=super.toJSON(e);t.glslVersion=this.glslVersion,t.uniforms={};for(const s in this.uniforms){const o=this.uniforms[s].value;o&&o.isTexture?t.uniforms[s]={type:"t",value:o.toJSON(e).uuid}:o&&o.isColor?t.uniforms[s]={type:"c",value:o.getHex()}:o&&o.isVector2?t.uniforms[s]={type:"v2",value:o.toArray()}:o&&o.isVector3?t.uniforms[s]={type:"v3",value:o.toArray()}:o&&o.isVector4?t.uniforms[s]={type:"v4",value:o.toArray()}:o&&o.isMatrix3?t.uniforms[s]={type:"m3",value:o.toArray()}:o&&o.isMatrix4?t.uniforms[s]={type:"m4",value:o.toArray()}:t.uniforms[s]={value:o}}Object.keys(this.defines).length>0&&(t.defines=this.defines),t.vertexShader=this.vertexShader,t.fragmentShader=this.fragmentShader,t.lights=this.lights,t.clipping=this.clipping;const i={};for(const s in this.extensions)this.extensions[s]===!0&&(i[s]=!0);return Object.keys(i).length>0&&(t.extensions=i),t}}class Rc extends zt{constructor(){super(),this.isCamera=!0,this.type="Camera",this.matrixWorldInverse=new _e,this.projectionMatrix=new _e,this.projectionMatrixInverse=new _e}copy(e,t){return super.copy(e,t),this.matrixWorldInverse.copy(e.matrixWorldInverse),this.projectionMatrix.copy(e.projectionMatrix),this.projectionMatrixInverse.copy(e.projectionMatrixInverse),this}getWorldDirection(e){this.updateWorldMatrix(!0,!1);const t=this.matrixWorld.elements;return e.set(-t[8],-t[9],-t[10]).normalize()}updateMatrixWorld(e){super.updateMatrixWorld(e),this.matrixWorldInverse.copy(this.matrixWorld).invert()}updateWorldMatrix(e,t){super.updateWorldMatrix(e,t),this.matrixWorldInverse.copy(this.matrixWorld).invert()}clone(){return new this.constructor().copy(this)}}class mn extends Rc{constructor(e=50,t=1,i=.1,s=2e3){super(),this.isPerspectiveCamera=!0,this.type="PerspectiveCamera",this.fov=e,this.zoom=1,this.near=i,this.far=s,this.focus=10,this.aspect=t,this.view=null,this.filmGauge=35,this.filmOffset=0,this.updateProjectionMatrix()}copy(e,t){return super.copy(e,t),this.fov=e.fov,this.zoom=e.zoom,this.near=e.near,this.far=e.far,this.focus=e.focus,this.aspect=e.aspect,this.view=e.view===null?null:Object.assign({},e.view),this.filmGauge=e.filmGauge,this.filmOffset=e.filmOffset,this}setFocalLength(e){const t=.5*this.getFilmHeight()/e;this.fov=fc*2*Math.atan(t),this.updateProjectionMatrix()}getFocalLength(){const e=Math.tan(pl*.5*this.fov);return .5*this.getFilmHeight()/e}getEffectiveFOV(){return fc*2*Math.atan(Math.tan(pl*.5*this.fov)/this.zoom)}getFilmWidth(){return this.filmGauge*Math.min(this.aspect,1)}getFilmHeight(){return this.filmGauge/Math.max(this.aspect,1)}setViewOffset(e,t,i,s,r,o){this.aspect=e/t,this.view===null&&(this.view={enabled:!0,fullWidth:1,fullHeight:1,offsetX:0,offsetY:0,width:1,height:1}),this.view.enabled=!0,this.view.fullWidth=e,this.view.fullHeight=t,this.view.offsetX=i,this.view.offsetY=s,this.view.width=r,this.view.height=o,this.updateProjectionMatrix()}clearViewOffset(){this.view!==null&&(this.view.enabled=!1),this.updateProjectionMatrix()}updateProjectionMatrix(){const e=this.near;let t=e*Math.tan(pl*.5*this.fov)/this.zoom,i=2*t,s=this.aspect*i,r=-.5*s;const o=this.view;if(this.view!==null&&this.view.enabled){const l=o.fullWidth,g=o.fullHeight;r+=o.offsetX*s/l,t-=o.offsetY*i/g,s*=o.width/l,i*=o.height/g}const a=this.filmOffset;a!==0&&(r+=e*a/this.getFilmWidth()),this.projectionMatrix.makePerspective(r,r+s,t,t-i,e,this.far),this.projectionMatrixInverse.copy(this.projectionMatrix).invert()}toJSON(e){const t=super.toJSON(e);return t.object.fov=this.fov,t.object.zoom=this.zoom,t.object.near=this.near,t.object.far=this.far,t.object.focus=this.focus,t.object.aspect=this.aspect,this.view!==null&&(t.object.view=Object.assign({},this.view)),t.object.filmGauge=this.filmGauge,t.object.filmOffset=this.filmOffset,t}}const hg=-90,Ag=1;class gy extends zt{constructor(e,t,i){super(),this.type="CubeCamera",this.renderTarget=i;const s=new mn(hg,Ag,e,t);s.layers=this.layers,s.up.set(0,1,0),s.lookAt(1,0,0),this.add(s);const r=new mn(hg,Ag,e,t);r.layers=this.layers,r.up.set(0,1,0),r.lookAt(-1,0,0),this.add(r);const o=new mn(hg,Ag,e,t);o.layers=this.layers,o.up.set(0,0,-1),o.lookAt(0,1,0),this.add(o);const a=new mn(hg,Ag,e,t);a.layers=this.layers,a.up.set(0,0,1),a.lookAt(0,-1,0),this.add(a);const l=new mn(hg,Ag,e,t);l.layers=this.layers,l.up.set(0,1,0),l.lookAt(0,0,1),this.add(l);const g=new mn(hg,Ag,e,t);g.layers=this.layers,g.up.set(0,1,0),g.lookAt(0,0,-1),this.add(g)}update(e,t){this.parent===null&&this.updateMatrixWorld();const i=this.renderTarget,[s,r,o,a,l,g]=this.children,u=e.getRenderTarget(),C=e.toneMapping,d=e.xr.enabled;e.toneMapping=Ar,e.xr.enabled=!1;const h=i.texture.generateMipmaps;i.texture.generateMipmaps=!1,e.setRenderTarget(i,0),e.render(t,s),e.setRenderTarget(i,1),e.render(t,r),e.setRenderTarget(i,2),e.render(t,o),e.setRenderTarget(i,3),e.render(t,a),e.setRenderTarget(i,4),e.render(t,l),i.texture.generateMipmaps=h,e.setRenderTarget(i,5),e.render(t,g),e.setRenderTarget(u),e.toneMapping=C,e.xr.enabled=d,i.texture.needsPMREMUpdate=!0}}class oC extends sn{constructor(e,t,i,s,r,o,a,l,g,u){e=e!==void 0?e:[],t=t!==void 0?t:fa,super(e,t,i,s,r,o,a,l,g,u),this.isCubeTexture=!0,this.flipY=!1}get images(){return this.image}set images(e){this.image=e}}class sp extends Nt{constructor(e=1,t={}){super(e,e,t),this.isWebGLCubeRenderTarget=!0;const i={width:e,height:e,depth:1},s=[i,i,i,i,i,i];t.encoding!==void 0&&(ru("THREE.WebGLCubeRenderTarget: option.encoding has been replaced by option.colorSpace."),t.colorSpace=t.encoding===ks?yt:vo),this.texture=new oC(s,t.mapping,t.wrapS,t.wrapT,t.magFilter,t.minFilter,t.format,t.type,t.anisotropy,t.colorSpace),this.texture.isRenderTargetTexture=!0,this.texture.generateMipmaps=t.generateMipmaps!==void 0?t.generateMipmaps:!1,this.texture.minFilter=t.minFilter!==void 0?t.minFilter:st}fromEquirectangularTexture(e,t){this.texture.type=t.type,this.texture.colorSpace=t.colorSpace,this.texture.generateMipmaps=t.generateMipmaps,this.texture.minFilter=t.minFilter,this.texture.magFilter=t.magFilter;const i={uniforms:{tEquirect:{value:null}},vertexShader:` varying vec3 vWorldDirection; @@ -3271,7 +3271,7 @@ void main() { #include #include #include -}`,gt={alphamap_fragment:fY,alphamap_pars_fragment:mY,alphatest_fragment:bY,alphatest_pars_fragment:vY,aomap_fragment:yY,aomap_pars_fragment:GY,begin_vertex:BY,beginnormal_vertex:ZY,bsdfs:wY,iridescence_fragment:SY,bumpmap_pars_fragment:xY,clipping_planes_fragment:RY,clipping_planes_pars_fragment:WY,clipping_planes_pars_vertex:VY,clipping_planes_vertex:MY,color_fragment:NY,color_pars_fragment:HY,color_pars_vertex:XY,color_vertex:FY,common:YY,cube_uv_reflection_fragment:KY,defaultnormal_vertex:zY,displacementmap_pars_vertex:LY,displacementmap_vertex:EY,emissivemap_fragment:TY,emissivemap_pars_fragment:kY,encodings_fragment:DY,encodings_pars_fragment:UY,envmap_fragment:PY,envmap_common_pars_fragment:_Y,envmap_pars_fragment:JY,envmap_pars_vertex:OY,envmap_physical_pars_fragment:a9,envmap_vertex:QY,fog_vertex:jY,fog_pars_vertex:qY,fog_fragment:$Y,fog_pars_fragment:e9,gradientmap_pars_fragment:t9,lightmap_fragment:n9,lightmap_pars_fragment:i9,lights_lambert_fragment:s9,lights_lambert_pars_fragment:r9,lights_pars_begin:o9,lights_toon_fragment:l9,lights_toon_pars_fragment:g9,lights_phong_fragment:c9,lights_phong_pars_fragment:I9,lights_physical_fragment:u9,lights_physical_pars_fragment:C9,lights_fragment_begin:d9,lights_fragment_maps:h9,lights_fragment_end:A9,logdepthbuf_fragment:p9,logdepthbuf_pars_fragment:f9,logdepthbuf_pars_vertex:m9,logdepthbuf_vertex:b9,map_fragment:v9,map_pars_fragment:y9,map_particle_fragment:G9,map_particle_pars_fragment:B9,metalnessmap_fragment:Z9,metalnessmap_pars_fragment:w9,morphcolor_vertex:S9,morphnormal_vertex:x9,morphtarget_pars_vertex:R9,morphtarget_vertex:W9,normal_fragment_begin:V9,normal_fragment_maps:M9,normal_pars_fragment:N9,normal_pars_vertex:H9,normal_vertex:X9,normalmap_pars_fragment:F9,clearcoat_normal_fragment_begin:Y9,clearcoat_normal_fragment_maps:K9,clearcoat_pars_fragment:z9,iridescence_pars_fragment:L9,output_fragment:E9,packing:T9,premultiplied_alpha_fragment:k9,project_vertex:D9,dithering_fragment:U9,dithering_pars_fragment:P9,roughnessmap_fragment:_9,roughnessmap_pars_fragment:J9,shadowmap_pars_fragment:O9,shadowmap_pars_vertex:Q9,shadowmap_vertex:j9,shadowmask_pars_fragment:q9,skinbase_vertex:$9,skinning_pars_vertex:eK,skinning_vertex:tK,skinnormal_vertex:nK,specularmap_fragment:iK,specularmap_pars_fragment:sK,tonemapping_fragment:rK,tonemapping_pars_fragment:oK,transmission_fragment:aK,transmission_pars_fragment:lK,uv_pars_fragment:gK,uv_pars_vertex:cK,uv_vertex:IK,worldpos_vertex:uK,background_vert:CK,background_frag:dK,backgroundCube_vert:hK,backgroundCube_frag:AK,cube_vert:pK,cube_frag:fK,depth_vert:mK,depth_frag:bK,distanceRGBA_vert:vK,distanceRGBA_frag:yK,equirect_vert:GK,equirect_frag:BK,linedashed_vert:ZK,linedashed_frag:wK,meshbasic_vert:SK,meshbasic_frag:xK,meshlambert_vert:RK,meshlambert_frag:WK,meshmatcap_vert:VK,meshmatcap_frag:MK,meshnormal_vert:NK,meshnormal_frag:HK,meshphong_vert:XK,meshphong_frag:FK,meshphysical_vert:YK,meshphysical_frag:KK,meshtoon_vert:zK,meshtoon_frag:LK,points_vert:EK,points_frag:TK,shadow_vert:kK,shadow_frag:DK,sprite_vert:UK,sprite_frag:PK},Le={common:{diffuse:{value:new Xe(16777215)},opacity:{value:1},map:{value:null},mapTransform:{value:new Mt},alphaMap:{value:null},alphaMapTransform:{value:new Mt},alphaTest:{value:0}},specularmap:{specularMap:{value:null},specularMapTransform:{value:new Mt}},envmap:{envMap:{value:null},flipEnvMap:{value:-1},reflectivity:{value:1},ior:{value:1.5},refractionRatio:{value:.98}},aomap:{aoMap:{value:null},aoMapIntensity:{value:1},aoMapTransform:{value:new Mt}},lightmap:{lightMap:{value:null},lightMapIntensity:{value:1},lightMapTransform:{value:new Mt}},bumpmap:{bumpMap:{value:null},bumpMapTransform:{value:new Mt},bumpScale:{value:1}},normalmap:{normalMap:{value:null},normalMapTransform:{value:new Mt},normalScale:{value:new oe(1,1)}},displacementmap:{displacementMap:{value:null},displacementMapTransform:{value:new Mt},displacementScale:{value:1},displacementBias:{value:0}},emissivemap:{emissiveMap:{value:null},emissiveMapTransform:{value:new Mt}},metalnessmap:{metalnessMap:{value:null},metalnessMapTransform:{value:new Mt}},roughnessmap:{roughnessMap:{value:null},roughnessMapTransform:{value:new Mt}},gradientmap:{gradientMap:{value:null}},fog:{fogDensity:{value:25e-5},fogNear:{value:1},fogFar:{value:2e3},fogColor:{value:new Xe(16777215)}},lights:{ambientLightColor:{value:[]},lightProbe:{value:[]},directionalLights:{value:[],properties:{direction:{},color:{}}},directionalLightShadows:{value:[],properties:{shadowBias:{},shadowNormalBias:{},shadowRadius:{},shadowMapSize:{}}},directionalShadowMap:{value:[]},directionalShadowMatrix:{value:[]},spotLights:{value:[],properties:{color:{},position:{},direction:{},distance:{},coneCos:{},penumbraCos:{},decay:{}}},spotLightShadows:{value:[],properties:{shadowBias:{},shadowNormalBias:{},shadowRadius:{},shadowMapSize:{}}},spotLightMap:{value:[]},spotShadowMap:{value:[]},spotLightMatrix:{value:[]},pointLights:{value:[],properties:{color:{},position:{},decay:{},distance:{}}},pointLightShadows:{value:[],properties:{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 Xe(16777215)},opacity:{value:1},size:{value:1},scale:{value:1},map:{value:null},alphaMap:{value:null},alphaTest:{value:0},uvTransform:{value:new Mt}},sprite:{diffuse:{value:new Xe(16777215)},opacity:{value:1},center:{value:new oe(.5,.5)},rotation:{value:0},map:{value:null},mapTransform:{value:new Mt},alphaMap:{value:null},alphaTest:{value:0}}},Cr={basic:{uniforms:Hi([Le.common,Le.specularmap,Le.envmap,Le.aomap,Le.lightmap,Le.fog]),vertexShader:gt.meshbasic_vert,fragmentShader:gt.meshbasic_frag},lambert:{uniforms:Hi([Le.common,Le.specularmap,Le.envmap,Le.aomap,Le.lightmap,Le.emissivemap,Le.bumpmap,Le.normalmap,Le.displacementmap,Le.fog,Le.lights,{emissive:{value:new Xe(0)}}]),vertexShader:gt.meshlambert_vert,fragmentShader:gt.meshlambert_frag},phong:{uniforms:Hi([Le.common,Le.specularmap,Le.envmap,Le.aomap,Le.lightmap,Le.emissivemap,Le.bumpmap,Le.normalmap,Le.displacementmap,Le.fog,Le.lights,{emissive:{value:new Xe(0)},specular:{value:new Xe(1118481)},shininess:{value:30}}]),vertexShader:gt.meshphong_vert,fragmentShader:gt.meshphong_frag},standard:{uniforms:Hi([Le.common,Le.envmap,Le.aomap,Le.lightmap,Le.emissivemap,Le.bumpmap,Le.normalmap,Le.displacementmap,Le.roughnessmap,Le.metalnessmap,Le.fog,Le.lights,{emissive:{value:new Xe(0)},roughness:{value:1},metalness:{value:0},envMapIntensity:{value:1}}]),vertexShader:gt.meshphysical_vert,fragmentShader:gt.meshphysical_frag},toon:{uniforms:Hi([Le.common,Le.aomap,Le.lightmap,Le.emissivemap,Le.bumpmap,Le.normalmap,Le.displacementmap,Le.gradientmap,Le.fog,Le.lights,{emissive:{value:new Xe(0)}}]),vertexShader:gt.meshtoon_vert,fragmentShader:gt.meshtoon_frag},matcap:{uniforms:Hi([Le.common,Le.bumpmap,Le.normalmap,Le.displacementmap,Le.fog,{matcap:{value:null}}]),vertexShader:gt.meshmatcap_vert,fragmentShader:gt.meshmatcap_frag},points:{uniforms:Hi([Le.points,Le.fog]),vertexShader:gt.points_vert,fragmentShader:gt.points_frag},dashed:{uniforms:Hi([Le.common,Le.fog,{scale:{value:1},dashSize:{value:1},totalSize:{value:2}}]),vertexShader:gt.linedashed_vert,fragmentShader:gt.linedashed_frag},depth:{uniforms:Hi([Le.common,Le.displacementmap]),vertexShader:gt.depth_vert,fragmentShader:gt.depth_frag},normal:{uniforms:Hi([Le.common,Le.bumpmap,Le.normalmap,Le.displacementmap,{opacity:{value:1}}]),vertexShader:gt.meshnormal_vert,fragmentShader:gt.meshnormal_frag},sprite:{uniforms:Hi([Le.sprite,Le.fog]),vertexShader:gt.sprite_vert,fragmentShader:gt.sprite_frag},background:{uniforms:{uvTransform:{value:new Mt},t2D:{value:null},backgroundIntensity:{value:1}},vertexShader:gt.background_vert,fragmentShader:gt.background_frag},backgroundCube:{uniforms:{envMap:{value:null},flipEnvMap:{value:-1},backgroundBlurriness:{value:0},backgroundIntensity:{value:1}},vertexShader:gt.backgroundCube_vert,fragmentShader:gt.backgroundCube_frag},cube:{uniforms:{tCube:{value:null},tFlip:{value:-1},opacity:{value:1}},vertexShader:gt.cube_vert,fragmentShader:gt.cube_frag},equirect:{uniforms:{tEquirect:{value:null}},vertexShader:gt.equirect_vert,fragmentShader:gt.equirect_frag},distanceRGBA:{uniforms:Hi([Le.common,Le.displacementmap,{referencePosition:{value:new H},nearDistance:{value:1},farDistance:{value:1e3}}]),vertexShader:gt.distanceRGBA_vert,fragmentShader:gt.distanceRGBA_frag},shadow:{uniforms:Hi([Le.lights,Le.fog,{color:{value:new Xe(0)},opacity:{value:1}}]),vertexShader:gt.shadow_vert,fragmentShader:gt.shadow_frag}};Cr.physical={uniforms:Hi([Cr.standard.uniforms,{clearcoat:{value:0},clearcoatMap:{value:null},clearcoatMapTransform:{value:new Mt},clearcoatNormalMap:{value:null},clearcoatNormalMapTransform:{value:new Mt},clearcoatNormalScale:{value:new oe(1,1)},clearcoatRoughness:{value:0},clearcoatRoughnessMap:{value:null},clearcoatRoughnessMapTransform:{value:new Mt},iridescence:{value:0},iridescenceMap:{value:null},iridescenceMapTransform:{value:new Mt},iridescenceIOR:{value:1.3},iridescenceThicknessMinimum:{value:100},iridescenceThicknessMaximum:{value:400},iridescenceThicknessMap:{value:null},iridescenceThicknessMapTransform:{value:new Mt},sheen:{value:0},sheenColor:{value:new Xe(0)},sheenColorMap:{value:null},sheenColorMapTransform:{value:new Mt},sheenRoughness:{value:1},sheenRoughnessMap:{value:null},sheenRoughnessMapTransform:{value:new Mt},transmission:{value:0},transmissionMap:{value:null},transmissionMapTransform:{value:new Mt},transmissionSamplerSize:{value:new oe},transmissionSamplerMap:{value:null},thickness:{value:0},thicknessMap:{value:null},thicknessMapTransform:{value:new Mt},attenuationDistance:{value:0},attenuationColor:{value:new Xe(0)},specularColor:{value:new Xe(1,1,1)},specularColorMap:{value:null},specularColorMapTransform:{value:new Mt},specularIntensity:{value:1},specularIntensityMap:{value:null},specularIntensityMapTransform:{value:new Mt}}]),vertexShader:gt.meshphysical_vert,fragmentShader:gt.meshphysical_frag};const Qd={r:0,b:0,g:0};function _K(n,e,t,i,s,r,o){const a=new Xe(0);let l=r===!0?0:1,g,u,C=null,d=0,h=null;function f(y,A){let b=!1,m=A.isScene===!0?A.background:null;switch(m&&m.isTexture&&(m=(A.backgroundBlurriness>0?t:e).get(m)),m===null?v(a,l):m&&m.isColor&&(v(m,1),b=!0),n.xr.getEnvironmentBlendMode()){case"opaque":b=!0;break;case"additive":i.buffers.color.setClear(0,0,0,1,o),b=!0;break;case"alpha-blend":i.buffers.color.setClear(0,0,0,0,o),b=!0;break}(n.autoClear||b)&&n.clear(n.autoClearColor,n.autoClearDepth,n.autoClearStencil),m&&(m.isCubeTexture||m.mapping===Sc)?(u===void 0&&(u=new On(new xa(1,1,1),new Rt({name:"BackgroundCubeMaterial",uniforms:mc(Cr.backgroundCube.uniforms),vertexShader:Cr.backgroundCube.vertexShader,fragmentShader:Cr.backgroundCube.fragmentShader,side:Jn,depthTest:!1,depthWrite:!1,fog:!1})),u.geometry.deleteAttribute("normal"),u.geometry.deleteAttribute("uv"),u.onBeforeRender=function(x,R,M){this.matrixWorld.copyPosition(M.matrixWorld)},Object.defineProperty(u.material,"envMap",{get:function(){return this.uniforms.envMap.value}}),s.update(u)),u.material.uniforms.envMap.value=m,u.material.uniforms.flipEnvMap.value=m.isCubeTexture&&m.isRenderTargetTexture===!1?-1:1,u.material.uniforms.backgroundBlurriness.value=A.backgroundBlurriness,u.material.uniforms.backgroundIntensity.value=A.backgroundIntensity,u.material.toneMapped=m.colorSpace!==yt,(C!==m||d!==m.version||h!==n.toneMapping)&&(u.material.needsUpdate=!0,C=m,d=m.version,h=n.toneMapping),u.layers.enableAll(),y.unshift(u,u.geometry,u.material,0,0,null)):m&&m.isTexture&&(g===void 0&&(g=new On(new Fl(2,2),new Rt({name:"BackgroundMaterial",uniforms:mc(Cr.background.uniforms),vertexShader:Cr.background.vertexShader,fragmentShader:Cr.background.fragmentShader,side:Er,depthTest:!1,depthWrite:!1,fog:!1})),g.geometry.deleteAttribute("normal"),Object.defineProperty(g.material,"map",{get:function(){return this.uniforms.t2D.value}}),s.update(g)),g.material.uniforms.t2D.value=m,g.material.uniforms.backgroundIntensity.value=A.backgroundIntensity,g.material.toneMapped=m.colorSpace!==yt,m.matrixAutoUpdate===!0&&m.updateMatrix(),g.material.uniforms.uvTransform.value.copy(m.matrix),(C!==m||d!==m.version||h!==n.toneMapping)&&(g.material.needsUpdate=!0,C=m,d=m.version,h=n.toneMapping),g.layers.enableAll(),y.unshift(g,g.geometry,g.material,0,0,null))}function v(y,A){y.getRGB(Qd,HW(n)),i.buffers.color.setClear(Qd.r,Qd.g,Qd.b,A,o)}return{getClearColor:function(){return a},setClearColor:function(y,A=1){a.set(y),l=A,v(a,l)},getClearAlpha:function(){return l},setClearAlpha:function(y){l=y,v(a,l)},render:f}}function JK(n,e,t,i){const s=n.getParameter(n.MAX_VERTEX_ATTRIBS),r=i.isWebGL2?null:e.get("OES_vertex_array_object"),o=i.isWebGL2||r!==null,a={},l=y(null);let g=l,u=!1;function C(q,ie,he,Ce,z){let Q=!1;if(o){const J=v(Ce,he,ie);g!==J&&(g=J,h(g.object)),Q=A(q,Ce,he,z),Q&&b(q,Ce,he,z)}else{const J=ie.wireframe===!0;(g.geometry!==Ce.id||g.program!==he.id||g.wireframe!==J)&&(g.geometry=Ce.id,g.program=he.id,g.wireframe=J,Q=!0)}z!==null&&t.update(z,n.ELEMENT_ARRAY_BUFFER),(Q||u)&&(u=!1,M(q,ie,he,Ce),z!==null&&n.bindBuffer(n.ELEMENT_ARRAY_BUFFER,t.get(z).buffer))}function d(){return i.isWebGL2?n.createVertexArray():r.createVertexArrayOES()}function h(q){return i.isWebGL2?n.bindVertexArray(q):r.bindVertexArrayOES(q)}function f(q){return i.isWebGL2?n.deleteVertexArray(q):r.deleteVertexArrayOES(q)}function v(q,ie,he){const Ce=he.wireframe===!0;let z=a[q.id];z===void 0&&(z={},a[q.id]=z);let Q=z[ie.id];Q===void 0&&(Q={},z[ie.id]=Q);let J=Q[Ce];return J===void 0&&(J=y(d()),Q[Ce]=J),J}function y(q){const ie=[],he=[],Ce=[];for(let z=0;z=0){const ge=z[se];let Ze=Q[se];if(Ze===void 0&&(se==="instanceMatrix"&&q.instanceMatrix&&(Ze=q.instanceMatrix),se==="instanceColor"&&q.instanceColor&&(Ze=q.instanceColor)),ge===void 0||ge.attribute!==Ze||Ze&&ge.data!==Ze.data)return!0;J++}return g.attributesNum!==J||g.index!==Ce}function b(q,ie,he,Ce){const z={},Q=ie.attributes;let J=0;const le=he.getAttributes();for(const se in le)if(le[se].location>=0){let ge=Q[se];ge===void 0&&(se==="instanceMatrix"&&q.instanceMatrix&&(ge=q.instanceMatrix),se==="instanceColor"&&q.instanceColor&&(ge=q.instanceColor));const Ze={};Ze.attribute=ge,ge&&ge.data&&(Ze.data=ge.data),z[se]=Ze,J++}g.attributes=z,g.attributesNum=J,g.index=Ce}function m(){const q=g.newAttributes;for(let ie=0,he=q.length;ie=0){let te=z[le];if(te===void 0&&(le==="instanceMatrix"&&q.instanceMatrix&&(te=q.instanceMatrix),le==="instanceColor"&&q.instanceColor&&(te=q.instanceColor)),te!==void 0){const ge=te.normalized,Ze=te.itemSize,Re=t.get(te);if(Re===void 0)continue;const O=Re.buffer,ot=Re.type,ct=Re.bytesPerElement;if(te.isInterleavedBufferAttribute){const Me=te.data,Ue=Me.stride,Be=te.offset;if(Me.isInstancedInterleavedBuffer){for(let fe=0;fe0&&n.getShaderPrecisionFormat(n.FRAGMENT_SHADER,n.HIGH_FLOAT).precision>0)return"highp";R="mediump"}return R==="mediump"&&n.getShaderPrecisionFormat(n.VERTEX_SHADER,n.MEDIUM_FLOAT).precision>0&&n.getShaderPrecisionFormat(n.FRAGMENT_SHADER,n.MEDIUM_FLOAT).precision>0?"mediump":"lowp"}const o=typeof WebGL2RenderingContext<"u"&&n.constructor.name==="WebGL2RenderingContext";let a=t.precision!==void 0?t.precision:"highp";const l=r(a);l!==a&&(console.warn("THREE.WebGLRenderer:",a,"not supported, using",l,"instead."),a=l);const g=o||e.has("WEBGL_draw_buffers"),u=t.logarithmicDepthBuffer===!0,C=n.getParameter(n.MAX_TEXTURE_IMAGE_UNITS),d=n.getParameter(n.MAX_VERTEX_TEXTURE_IMAGE_UNITS),h=n.getParameter(n.MAX_TEXTURE_SIZE),f=n.getParameter(n.MAX_CUBE_MAP_TEXTURE_SIZE),v=n.getParameter(n.MAX_VERTEX_ATTRIBS),y=n.getParameter(n.MAX_VERTEX_UNIFORM_VECTORS),A=n.getParameter(n.MAX_VARYING_VECTORS),b=n.getParameter(n.MAX_FRAGMENT_UNIFORM_VECTORS),m=d>0,B=o||e.has("OES_texture_float"),S=m&&B,x=o?n.getParameter(n.MAX_SAMPLES):0;return{isWebGL2:o,drawBuffers:g,getMaxAnisotropy:s,getMaxPrecision:r,precision:a,logarithmicDepthBuffer:u,maxTextures:C,maxVertexTextures:d,maxTextureSize:h,maxCubemapSize:f,maxAttributes:v,maxVertexUniforms:y,maxVaryings:A,maxFragmentUniforms:b,vertexTextures:m,floatFragmentTextures:B,floatVertexTextures:S,maxSamples:x}}function jK(n){const e=this;let t=null,i=0,s=!1,r=!1;const o=new $o,a=new Mt,l={value:null,needsUpdate:!1};this.uniform=l,this.numPlanes=0,this.numIntersection=0,this.init=function(C,d){const h=C.length!==0||d||i!==0||s;return s=d,i=C.length,h},this.beginShadows=function(){r=!0,u(null)},this.endShadows=function(){r=!1},this.setGlobalState=function(C,d){t=u(C,d,0)},this.setState=function(C,d,h){const f=C.clippingPlanes,v=C.clipIntersection,y=C.clipShadows,A=n.get(C);if(!s||f===null||f.length===0||r&&!y)r?u(null):g();else{const b=r?0:i,m=b*4;let B=A.clippingState||null;l.value=B,B=u(f,d,m,h);for(let S=0;S!==m;++S)B[S]=t[S];A.clippingState=B,this.numIntersection=v?this.numPlanes:0,this.numPlanes+=b}};function g(){l.value!==t&&(l.value=t,l.needsUpdate=i>0),e.numPlanes=i,e.numIntersection=0}function u(C,d,h,f){const v=C!==null?C.length:0;let y=null;if(v!==0){if(y=l.value,f!==!0||y===null){const A=h+v*4,b=d.matrixWorldInverse;a.getNormalMatrix(b),(y===null||y.length0){const g=new sp(l.height/2);return g.fromEquirectangularTexture(n,o),e.set(o,g),o.addEventListener("dispose",s),t(g.texture,o.mapping)}else return null}}return o}function s(o){const a=o.target;a.removeEventListener("dispose",s);const l=e.get(a);l!==void 0&&(e.delete(a),l.dispose())}function r(){e=new WeakMap}return{get:i,dispose:r}}class Rc extends xc{constructor(e=-1,t=1,i=1,s=-1,r=.1,o=2e3){super(),this.isOrthographicCamera=!0,this.type="OrthographicCamera",this.zoom=1,this.view=null,this.left=e,this.right=t,this.top=i,this.bottom=s,this.near=r,this.far=o,this.updateProjectionMatrix()}copy(e,t){return super.copy(e,t),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,t,i,s,r,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=t,this.view.offsetX=i,this.view.offsetY=s,this.view.width=r,this.view.height=o,this.updateProjectionMatrix()}clearViewOffset(){this.view!==null&&(this.view.enabled=!1),this.updateProjectionMatrix()}updateProjectionMatrix(){const e=(this.right-this.left)/(2*this.zoom),t=(this.top-this.bottom)/(2*this.zoom),i=(this.right+this.left)/2,s=(this.top+this.bottom)/2;let r=i-e,o=i+e,a=s+t,l=s-t;if(this.view!==null&&this.view.enabled){const g=(this.right-this.left)/this.view.fullWidth/this.zoom,u=(this.top-this.bottom)/this.view.fullHeight/this.zoom;r+=g*this.view.offsetX,o=r+g*this.view.width,a-=u*this.view.offsetY,l=a-u*this.view.height}this.projectionMatrix.makeOrthographic(r,o,a,l,this.near,this.far),this.projectionMatrixInverse.copy(this.projectionMatrix).invert()}toJSON(e){const t=super.toJSON(e);return t.object.zoom=this.zoom,t.object.left=this.left,t.object.right=this.right,t.object.top=this.top,t.object.bottom=this.bottom,t.object.near=this.near,t.object.far=this.far,this.view!==null&&(t.object.view=Object.assign({},this.view)),t}}const Ug=4,mZ=[.125,.215,.35,.446,.526,.582],tl=20,fm=new Rc,bZ=new Xe;let mm=null;const qa=(1+Math.sqrt(5))/2,pg=1/qa,vZ=[new H(1,1,1),new H(-1,1,1),new H(1,1,-1),new H(-1,1,-1),new H(0,qa,pg),new H(0,qa,-pg),new H(pg,0,qa),new H(-pg,0,qa),new H(qa,pg,0),new H(-qa,pg,0)];class WA{constructor(e){this._renderer=e,this._pingPongRenderTarget=null,this._lodMax=0,this._cubeSize=0,this._lodPlanes=[],this._sizeLods=[],this._sigmas=[],this._blurMaterial=null,this._cubemapMaterial=null,this._equirectMaterial=null,this._compileMaterial(this._blurMaterial)}fromScene(e,t=0,i=.1,s=100){mm=this._renderer.getRenderTarget(),this._setSize(256);const r=this._allocateTargets();return r.depthBuffer=!0,this._sceneToCubeUV(e,i,s,r),t>0&&this._blur(r,0,0,t),this._applyPMREM(r),this._cleanup(r),r}fromEquirectangular(e,t=null){return this._fromTexture(e,t)}fromCubemap(e,t=null){return this._fromTexture(e,t)}compileCubemapShader(){this._cubemapMaterial===null&&(this._cubemapMaterial=BZ(),this._compileMaterial(this._cubemapMaterial))}compileEquirectangularShader(){this._equirectMaterial===null&&(this._equirectMaterial=GZ(),this._compileMaterial(this._equirectMaterial))}dispose(){this._dispose(),this._cubemapMaterial!==null&&this._cubemapMaterial.dispose(),this._equirectMaterial!==null&&this._equirectMaterial.dispose()}_setSize(e){this._lodMax=Math.floor(Math.log2(e)),this._cubeSize=Math.pow(2,this._lodMax)}_dispose(){this._blurMaterial!==null&&this._blurMaterial.dispose(),this._pingPongRenderTarget!==null&&this._pingPongRenderTarget.dispose();for(let e=0;e2?m:0,m,m),u.setRenderTarget(s),v&&u.render(f,a),u.render(e,a)}f.geometry.dispose(),f.material.dispose(),u.toneMapping=d,u.autoClear=C,e.background=y}_textureToCubeUV(e,t){const i=this._renderer,s=e.mapping===fa||e.mapping===ma;s?(this._cubemapMaterial===null&&(this._cubemapMaterial=BZ()),this._cubemapMaterial.uniforms.flipEnvMap.value=e.isRenderTargetTexture===!1?-1:1):this._equirectMaterial===null&&(this._equirectMaterial=GZ());const r=s?this._cubemapMaterial:this._equirectMaterial,o=new On(this._lodPlanes[0],r),a=r.uniforms;a.envMap.value=e;const l=this._cubeSize;jd(t,0,0,3*l,2*l),i.setRenderTarget(t),i.render(o,fm)}_applyPMREM(e){const t=this._renderer,i=t.autoClear;t.autoClear=!1;for(let s=1;stl&&console.warn(`sigmaRadians, ${r}, is too large and will clip, as it requested ${y} samples when the maximum is set to ${tl}`);const A=[];let b=0;for(let R=0;Rm-Ug?s-m+Ug:0),x=4*(this._cubeSize-B);jd(t,S,x,3*B,2*B),l.setRenderTarget(t),l.render(C,fm)}}function $K(n){const e=[],t=[],i=[];let s=n;const r=n-Ug+1+mZ.length;for(let o=0;on-Ug?l=mZ[o-n+Ug-1]:o===0&&(l=0),i.push(l);const g=1/(a-2),u=-g,C=1+g,d=[u,u,C,u,C,C,u,u,C,C,u,C],h=6,f=6,v=3,y=2,A=1,b=new Float32Array(v*f*h),m=new Float32Array(y*f*h),B=new Float32Array(A*f*h);for(let x=0;x2?0:-1,Z=[R,M,0,R+2/3,M,0,R+2/3,M+1,0,R,M,0,R+2/3,M+1,0,R,M+1,0];b.set(Z,v*f*x),m.set(d,y*f*x);const V=[x,x,x,x,x,x];B.set(V,A*f*x)}const S=new Gt;S.setAttribute("position",new Jt(b,v)),S.setAttribute("uv",new Jt(m,y)),S.setAttribute("faceIndex",new Jt(B,A)),e.push(S),s>Ug&&s--}return{lodPlanes:e,sizeLods:t,sigmas:i}}function yZ(n,e,t){const i=new Nt(n,e,t);return i.texture.mapping=Sc,i.texture.name="PMREM.cubeUv",i.scissorTest=!0,i}function jd(n,e,t,i,s){n.viewport.set(e,t,i,s),n.scissor.set(e,t,i,s)}function ez(n,e,t){const i=new Float32Array(tl),s=new H(0,1,0);return new Rt({name:"SphericalGaussianBlur",defines:{n:tl,CUBEUV_TEXEL_WIDTH:1/e,CUBEUV_TEXEL_HEIGHT:1/t,CUBEUV_MAX_MIP:`${n}.0`},uniforms:{envMap:{value:null},samples:{value:1},weights:{value:i},latitudinal:{value:!1},dTheta:{value:0},mipInt:{value:0},poleAxis:{value:s}},vertexShader:cy(),fragmentShader:` +}`,gt={alphamap_fragment:fY,alphamap_pars_fragment:mY,alphatest_fragment:bY,alphatest_pars_fragment:vY,aomap_fragment:yY,aomap_pars_fragment:GY,begin_vertex:BY,beginnormal_vertex:ZY,bsdfs:wY,iridescence_fragment:SY,bumpmap_pars_fragment:xY,clipping_planes_fragment:RY,clipping_planes_pars_fragment:WY,clipping_planes_pars_vertex:VY,clipping_planes_vertex:MY,color_fragment:NY,color_pars_fragment:HY,color_pars_vertex:XY,color_vertex:FY,common:YY,cube_uv_reflection_fragment:KY,defaultnormal_vertex:zY,displacementmap_pars_vertex:LY,displacementmap_vertex:EY,emissivemap_fragment:TY,emissivemap_pars_fragment:kY,encodings_fragment:DY,encodings_pars_fragment:UY,envmap_fragment:PY,envmap_common_pars_fragment:_Y,envmap_pars_fragment:JY,envmap_pars_vertex:OY,envmap_physical_pars_fragment:a9,envmap_vertex:QY,fog_vertex:jY,fog_pars_vertex:qY,fog_fragment:$Y,fog_pars_fragment:e9,gradientmap_pars_fragment:t9,lightmap_fragment:n9,lightmap_pars_fragment:i9,lights_lambert_fragment:s9,lights_lambert_pars_fragment:r9,lights_pars_begin:o9,lights_toon_fragment:l9,lights_toon_pars_fragment:g9,lights_phong_fragment:c9,lights_phong_pars_fragment:I9,lights_physical_fragment:u9,lights_physical_pars_fragment:C9,lights_fragment_begin:d9,lights_fragment_maps:h9,lights_fragment_end:A9,logdepthbuf_fragment:p9,logdepthbuf_pars_fragment:f9,logdepthbuf_pars_vertex:m9,logdepthbuf_vertex:b9,map_fragment:v9,map_pars_fragment:y9,map_particle_fragment:G9,map_particle_pars_fragment:B9,metalnessmap_fragment:Z9,metalnessmap_pars_fragment:w9,morphcolor_vertex:S9,morphnormal_vertex:x9,morphtarget_pars_vertex:R9,morphtarget_vertex:W9,normal_fragment_begin:V9,normal_fragment_maps:M9,normal_pars_fragment:N9,normal_pars_vertex:H9,normal_vertex:X9,normalmap_pars_fragment:F9,clearcoat_normal_fragment_begin:Y9,clearcoat_normal_fragment_maps:K9,clearcoat_pars_fragment:z9,iridescence_pars_fragment:L9,output_fragment:E9,packing:T9,premultiplied_alpha_fragment:k9,project_vertex:D9,dithering_fragment:U9,dithering_pars_fragment:P9,roughnessmap_fragment:_9,roughnessmap_pars_fragment:J9,shadowmap_pars_fragment:O9,shadowmap_pars_vertex:Q9,shadowmap_vertex:j9,shadowmask_pars_fragment:q9,skinbase_vertex:$9,skinning_pars_vertex:eK,skinning_vertex:tK,skinnormal_vertex:nK,specularmap_fragment:iK,specularmap_pars_fragment:sK,tonemapping_fragment:rK,tonemapping_pars_fragment:oK,transmission_fragment:aK,transmission_pars_fragment:lK,uv_pars_fragment:gK,uv_pars_vertex:cK,uv_vertex:IK,worldpos_vertex:uK,background_vert:CK,background_frag:dK,backgroundCube_vert:hK,backgroundCube_frag:AK,cube_vert:pK,cube_frag:fK,depth_vert:mK,depth_frag:bK,distanceRGBA_vert:vK,distanceRGBA_frag:yK,equirect_vert:GK,equirect_frag:BK,linedashed_vert:ZK,linedashed_frag:wK,meshbasic_vert:SK,meshbasic_frag:xK,meshlambert_vert:RK,meshlambert_frag:WK,meshmatcap_vert:VK,meshmatcap_frag:MK,meshnormal_vert:NK,meshnormal_frag:HK,meshphong_vert:XK,meshphong_frag:FK,meshphysical_vert:YK,meshphysical_frag:KK,meshtoon_vert:zK,meshtoon_frag:LK,points_vert:EK,points_frag:TK,shadow_vert:kK,shadow_frag:DK,sprite_vert:UK,sprite_frag:PK},Le={common:{diffuse:{value:new Xe(16777215)},opacity:{value:1},map:{value:null},mapTransform:{value:new Mt},alphaMap:{value:null},alphaMapTransform:{value:new Mt},alphaTest:{value:0}},specularmap:{specularMap:{value:null},specularMapTransform:{value:new Mt}},envmap:{envMap:{value:null},flipEnvMap:{value:-1},reflectivity:{value:1},ior:{value:1.5},refractionRatio:{value:.98}},aomap:{aoMap:{value:null},aoMapIntensity:{value:1},aoMapTransform:{value:new Mt}},lightmap:{lightMap:{value:null},lightMapIntensity:{value:1},lightMapTransform:{value:new Mt}},bumpmap:{bumpMap:{value:null},bumpMapTransform:{value:new Mt},bumpScale:{value:1}},normalmap:{normalMap:{value:null},normalMapTransform:{value:new Mt},normalScale:{value:new oe(1,1)}},displacementmap:{displacementMap:{value:null},displacementMapTransform:{value:new Mt},displacementScale:{value:1},displacementBias:{value:0}},emissivemap:{emissiveMap:{value:null},emissiveMapTransform:{value:new Mt}},metalnessmap:{metalnessMap:{value:null},metalnessMapTransform:{value:new Mt}},roughnessmap:{roughnessMap:{value:null},roughnessMapTransform:{value:new Mt}},gradientmap:{gradientMap:{value:null}},fog:{fogDensity:{value:25e-5},fogNear:{value:1},fogFar:{value:2e3},fogColor:{value:new Xe(16777215)}},lights:{ambientLightColor:{value:[]},lightProbe:{value:[]},directionalLights:{value:[],properties:{direction:{},color:{}}},directionalLightShadows:{value:[],properties:{shadowBias:{},shadowNormalBias:{},shadowRadius:{},shadowMapSize:{}}},directionalShadowMap:{value:[]},directionalShadowMatrix:{value:[]},spotLights:{value:[],properties:{color:{},position:{},direction:{},distance:{},coneCos:{},penumbraCos:{},decay:{}}},spotLightShadows:{value:[],properties:{shadowBias:{},shadowNormalBias:{},shadowRadius:{},shadowMapSize:{}}},spotLightMap:{value:[]},spotShadowMap:{value:[]},spotLightMatrix:{value:[]},pointLights:{value:[],properties:{color:{},position:{},decay:{},distance:{}}},pointLightShadows:{value:[],properties:{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 Xe(16777215)},opacity:{value:1},size:{value:1},scale:{value:1},map:{value:null},alphaMap:{value:null},alphaTest:{value:0},uvTransform:{value:new Mt}},sprite:{diffuse:{value:new Xe(16777215)},opacity:{value:1},center:{value:new oe(.5,.5)},rotation:{value:0},map:{value:null},mapTransform:{value:new Mt},alphaMap:{value:null},alphaTest:{value:0}}},Cr={basic:{uniforms:Hi([Le.common,Le.specularmap,Le.envmap,Le.aomap,Le.lightmap,Le.fog]),vertexShader:gt.meshbasic_vert,fragmentShader:gt.meshbasic_frag},lambert:{uniforms:Hi([Le.common,Le.specularmap,Le.envmap,Le.aomap,Le.lightmap,Le.emissivemap,Le.bumpmap,Le.normalmap,Le.displacementmap,Le.fog,Le.lights,{emissive:{value:new Xe(0)}}]),vertexShader:gt.meshlambert_vert,fragmentShader:gt.meshlambert_frag},phong:{uniforms:Hi([Le.common,Le.specularmap,Le.envmap,Le.aomap,Le.lightmap,Le.emissivemap,Le.bumpmap,Le.normalmap,Le.displacementmap,Le.fog,Le.lights,{emissive:{value:new Xe(0)},specular:{value:new Xe(1118481)},shininess:{value:30}}]),vertexShader:gt.meshphong_vert,fragmentShader:gt.meshphong_frag},standard:{uniforms:Hi([Le.common,Le.envmap,Le.aomap,Le.lightmap,Le.emissivemap,Le.bumpmap,Le.normalmap,Le.displacementmap,Le.roughnessmap,Le.metalnessmap,Le.fog,Le.lights,{emissive:{value:new Xe(0)},roughness:{value:1},metalness:{value:0},envMapIntensity:{value:1}}]),vertexShader:gt.meshphysical_vert,fragmentShader:gt.meshphysical_frag},toon:{uniforms:Hi([Le.common,Le.aomap,Le.lightmap,Le.emissivemap,Le.bumpmap,Le.normalmap,Le.displacementmap,Le.gradientmap,Le.fog,Le.lights,{emissive:{value:new Xe(0)}}]),vertexShader:gt.meshtoon_vert,fragmentShader:gt.meshtoon_frag},matcap:{uniforms:Hi([Le.common,Le.bumpmap,Le.normalmap,Le.displacementmap,Le.fog,{matcap:{value:null}}]),vertexShader:gt.meshmatcap_vert,fragmentShader:gt.meshmatcap_frag},points:{uniforms:Hi([Le.points,Le.fog]),vertexShader:gt.points_vert,fragmentShader:gt.points_frag},dashed:{uniforms:Hi([Le.common,Le.fog,{scale:{value:1},dashSize:{value:1},totalSize:{value:2}}]),vertexShader:gt.linedashed_vert,fragmentShader:gt.linedashed_frag},depth:{uniforms:Hi([Le.common,Le.displacementmap]),vertexShader:gt.depth_vert,fragmentShader:gt.depth_frag},normal:{uniforms:Hi([Le.common,Le.bumpmap,Le.normalmap,Le.displacementmap,{opacity:{value:1}}]),vertexShader:gt.meshnormal_vert,fragmentShader:gt.meshnormal_frag},sprite:{uniforms:Hi([Le.sprite,Le.fog]),vertexShader:gt.sprite_vert,fragmentShader:gt.sprite_frag},background:{uniforms:{uvTransform:{value:new Mt},t2D:{value:null},backgroundIntensity:{value:1}},vertexShader:gt.background_vert,fragmentShader:gt.background_frag},backgroundCube:{uniforms:{envMap:{value:null},flipEnvMap:{value:-1},backgroundBlurriness:{value:0},backgroundIntensity:{value:1}},vertexShader:gt.backgroundCube_vert,fragmentShader:gt.backgroundCube_frag},cube:{uniforms:{tCube:{value:null},tFlip:{value:-1},opacity:{value:1}},vertexShader:gt.cube_vert,fragmentShader:gt.cube_frag},equirect:{uniforms:{tEquirect:{value:null}},vertexShader:gt.equirect_vert,fragmentShader:gt.equirect_frag},distanceRGBA:{uniforms:Hi([Le.common,Le.displacementmap,{referencePosition:{value:new H},nearDistance:{value:1},farDistance:{value:1e3}}]),vertexShader:gt.distanceRGBA_vert,fragmentShader:gt.distanceRGBA_frag},shadow:{uniforms:Hi([Le.lights,Le.fog,{color:{value:new Xe(0)},opacity:{value:1}}]),vertexShader:gt.shadow_vert,fragmentShader:gt.shadow_frag}};Cr.physical={uniforms:Hi([Cr.standard.uniforms,{clearcoat:{value:0},clearcoatMap:{value:null},clearcoatMapTransform:{value:new Mt},clearcoatNormalMap:{value:null},clearcoatNormalMapTransform:{value:new Mt},clearcoatNormalScale:{value:new oe(1,1)},clearcoatRoughness:{value:0},clearcoatRoughnessMap:{value:null},clearcoatRoughnessMapTransform:{value:new Mt},iridescence:{value:0},iridescenceMap:{value:null},iridescenceMapTransform:{value:new Mt},iridescenceIOR:{value:1.3},iridescenceThicknessMinimum:{value:100},iridescenceThicknessMaximum:{value:400},iridescenceThicknessMap:{value:null},iridescenceThicknessMapTransform:{value:new Mt},sheen:{value:0},sheenColor:{value:new Xe(0)},sheenColorMap:{value:null},sheenColorMapTransform:{value:new Mt},sheenRoughness:{value:1},sheenRoughnessMap:{value:null},sheenRoughnessMapTransform:{value:new Mt},transmission:{value:0},transmissionMap:{value:null},transmissionMapTransform:{value:new Mt},transmissionSamplerSize:{value:new oe},transmissionSamplerMap:{value:null},thickness:{value:0},thicknessMap:{value:null},thicknessMapTransform:{value:new Mt},attenuationDistance:{value:0},attenuationColor:{value:new Xe(0)},specularColor:{value:new Xe(1,1,1)},specularColorMap:{value:null},specularColorMapTransform:{value:new Mt},specularIntensity:{value:1},specularIntensityMap:{value:null},specularIntensityMapTransform:{value:new Mt}}]),vertexShader:gt.meshphysical_vert,fragmentShader:gt.meshphysical_frag};const Qd={r:0,b:0,g:0};function _K(n,e,t,i,s,r,o){const a=new Xe(0);let l=r===!0?0:1,g,u,C=null,d=0,h=null;function f(y,A){let b=!1,m=A.isScene===!0?A.background:null;switch(m&&m.isTexture&&(m=(A.backgroundBlurriness>0?t:e).get(m)),m===null?v(a,l):m&&m.isColor&&(v(m,1),b=!0),n.xr.getEnvironmentBlendMode()){case"opaque":b=!0;break;case"additive":i.buffers.color.setClear(0,0,0,1,o),b=!0;break;case"alpha-blend":i.buffers.color.setClear(0,0,0,0,o),b=!0;break}(n.autoClear||b)&&n.clear(n.autoClearColor,n.autoClearDepth,n.autoClearStencil),m&&(m.isCubeTexture||m.mapping===xc)?(u===void 0&&(u=new On(new xa(1,1,1),new Rt({name:"BackgroundCubeMaterial",uniforms:mc(Cr.backgroundCube.uniforms),vertexShader:Cr.backgroundCube.vertexShader,fragmentShader:Cr.backgroundCube.fragmentShader,side:Jn,depthTest:!1,depthWrite:!1,fog:!1})),u.geometry.deleteAttribute("normal"),u.geometry.deleteAttribute("uv"),u.onBeforeRender=function(x,R,M){this.matrixWorld.copyPosition(M.matrixWorld)},Object.defineProperty(u.material,"envMap",{get:function(){return this.uniforms.envMap.value}}),s.update(u)),u.material.uniforms.envMap.value=m,u.material.uniforms.flipEnvMap.value=m.isCubeTexture&&m.isRenderTargetTexture===!1?-1:1,u.material.uniforms.backgroundBlurriness.value=A.backgroundBlurriness,u.material.uniforms.backgroundIntensity.value=A.backgroundIntensity,u.material.toneMapped=m.colorSpace!==yt,(C!==m||d!==m.version||h!==n.toneMapping)&&(u.material.needsUpdate=!0,C=m,d=m.version,h=n.toneMapping),u.layers.enableAll(),y.unshift(u,u.geometry,u.material,0,0,null)):m&&m.isTexture&&(g===void 0&&(g=new On(new Fl(2,2),new Rt({name:"BackgroundMaterial",uniforms:mc(Cr.background.uniforms),vertexShader:Cr.background.vertexShader,fragmentShader:Cr.background.fragmentShader,side:Er,depthTest:!1,depthWrite:!1,fog:!1})),g.geometry.deleteAttribute("normal"),Object.defineProperty(g.material,"map",{get:function(){return this.uniforms.t2D.value}}),s.update(g)),g.material.uniforms.t2D.value=m,g.material.uniforms.backgroundIntensity.value=A.backgroundIntensity,g.material.toneMapped=m.colorSpace!==yt,m.matrixAutoUpdate===!0&&m.updateMatrix(),g.material.uniforms.uvTransform.value.copy(m.matrix),(C!==m||d!==m.version||h!==n.toneMapping)&&(g.material.needsUpdate=!0,C=m,d=m.version,h=n.toneMapping),g.layers.enableAll(),y.unshift(g,g.geometry,g.material,0,0,null))}function v(y,A){y.getRGB(Qd,HW(n)),i.buffers.color.setClear(Qd.r,Qd.g,Qd.b,A,o)}return{getClearColor:function(){return a},setClearColor:function(y,A=1){a.set(y),l=A,v(a,l)},getClearAlpha:function(){return l},setClearAlpha:function(y){l=y,v(a,l)},render:f}}function JK(n,e,t,i){const s=n.getParameter(n.MAX_VERTEX_ATTRIBS),r=i.isWebGL2?null:e.get("OES_vertex_array_object"),o=i.isWebGL2||r!==null,a={},l=y(null);let g=l,u=!1;function C(q,ie,he,Ce,z){let Q=!1;if(o){const J=v(Ce,he,ie);g!==J&&(g=J,h(g.object)),Q=A(q,Ce,he,z),Q&&b(q,Ce,he,z)}else{const J=ie.wireframe===!0;(g.geometry!==Ce.id||g.program!==he.id||g.wireframe!==J)&&(g.geometry=Ce.id,g.program=he.id,g.wireframe=J,Q=!0)}z!==null&&t.update(z,n.ELEMENT_ARRAY_BUFFER),(Q||u)&&(u=!1,M(q,ie,he,Ce),z!==null&&n.bindBuffer(n.ELEMENT_ARRAY_BUFFER,t.get(z).buffer))}function d(){return i.isWebGL2?n.createVertexArray():r.createVertexArrayOES()}function h(q){return i.isWebGL2?n.bindVertexArray(q):r.bindVertexArrayOES(q)}function f(q){return i.isWebGL2?n.deleteVertexArray(q):r.deleteVertexArrayOES(q)}function v(q,ie,he){const Ce=he.wireframe===!0;let z=a[q.id];z===void 0&&(z={},a[q.id]=z);let Q=z[ie.id];Q===void 0&&(Q={},z[ie.id]=Q);let J=Q[Ce];return J===void 0&&(J=y(d()),Q[Ce]=J),J}function y(q){const ie=[],he=[],Ce=[];for(let z=0;z=0){const ge=z[se];let Ze=Q[se];if(Ze===void 0&&(se==="instanceMatrix"&&q.instanceMatrix&&(Ze=q.instanceMatrix),se==="instanceColor"&&q.instanceColor&&(Ze=q.instanceColor)),ge===void 0||ge.attribute!==Ze||Ze&&ge.data!==Ze.data)return!0;J++}return g.attributesNum!==J||g.index!==Ce}function b(q,ie,he,Ce){const z={},Q=ie.attributes;let J=0;const le=he.getAttributes();for(const se in le)if(le[se].location>=0){let ge=Q[se];ge===void 0&&(se==="instanceMatrix"&&q.instanceMatrix&&(ge=q.instanceMatrix),se==="instanceColor"&&q.instanceColor&&(ge=q.instanceColor));const Ze={};Ze.attribute=ge,ge&&ge.data&&(Ze.data=ge.data),z[se]=Ze,J++}g.attributes=z,g.attributesNum=J,g.index=Ce}function m(){const q=g.newAttributes;for(let ie=0,he=q.length;ie=0){let te=z[le];if(te===void 0&&(le==="instanceMatrix"&&q.instanceMatrix&&(te=q.instanceMatrix),le==="instanceColor"&&q.instanceColor&&(te=q.instanceColor)),te!==void 0){const ge=te.normalized,Ze=te.itemSize,Re=t.get(te);if(Re===void 0)continue;const O=Re.buffer,ot=Re.type,ct=Re.bytesPerElement;if(te.isInterleavedBufferAttribute){const Me=te.data,Ue=Me.stride,Be=te.offset;if(Me.isInstancedInterleavedBuffer){for(let fe=0;fe0&&n.getShaderPrecisionFormat(n.FRAGMENT_SHADER,n.HIGH_FLOAT).precision>0)return"highp";R="mediump"}return R==="mediump"&&n.getShaderPrecisionFormat(n.VERTEX_SHADER,n.MEDIUM_FLOAT).precision>0&&n.getShaderPrecisionFormat(n.FRAGMENT_SHADER,n.MEDIUM_FLOAT).precision>0?"mediump":"lowp"}const o=typeof WebGL2RenderingContext<"u"&&n.constructor.name==="WebGL2RenderingContext";let a=t.precision!==void 0?t.precision:"highp";const l=r(a);l!==a&&(console.warn("THREE.WebGLRenderer:",a,"not supported, using",l,"instead."),a=l);const g=o||e.has("WEBGL_draw_buffers"),u=t.logarithmicDepthBuffer===!0,C=n.getParameter(n.MAX_TEXTURE_IMAGE_UNITS),d=n.getParameter(n.MAX_VERTEX_TEXTURE_IMAGE_UNITS),h=n.getParameter(n.MAX_TEXTURE_SIZE),f=n.getParameter(n.MAX_CUBE_MAP_TEXTURE_SIZE),v=n.getParameter(n.MAX_VERTEX_ATTRIBS),y=n.getParameter(n.MAX_VERTEX_UNIFORM_VECTORS),A=n.getParameter(n.MAX_VARYING_VECTORS),b=n.getParameter(n.MAX_FRAGMENT_UNIFORM_VECTORS),m=d>0,B=o||e.has("OES_texture_float"),S=m&&B,x=o?n.getParameter(n.MAX_SAMPLES):0;return{isWebGL2:o,drawBuffers:g,getMaxAnisotropy:s,getMaxPrecision:r,precision:a,logarithmicDepthBuffer:u,maxTextures:C,maxVertexTextures:d,maxTextureSize:h,maxCubemapSize:f,maxAttributes:v,maxVertexUniforms:y,maxVaryings:A,maxFragmentUniforms:b,vertexTextures:m,floatFragmentTextures:B,floatVertexTextures:S,maxSamples:x}}function jK(n){const e=this;let t=null,i=0,s=!1,r=!1;const o=new $o,a=new Mt,l={value:null,needsUpdate:!1};this.uniform=l,this.numPlanes=0,this.numIntersection=0,this.init=function(C,d){const h=C.length!==0||d||i!==0||s;return s=d,i=C.length,h},this.beginShadows=function(){r=!0,u(null)},this.endShadows=function(){r=!1},this.setGlobalState=function(C,d){t=u(C,d,0)},this.setState=function(C,d,h){const f=C.clippingPlanes,v=C.clipIntersection,y=C.clipShadows,A=n.get(C);if(!s||f===null||f.length===0||r&&!y)r?u(null):g();else{const b=r?0:i,m=b*4;let B=A.clippingState||null;l.value=B,B=u(f,d,m,h);for(let S=0;S!==m;++S)B[S]=t[S];A.clippingState=B,this.numIntersection=v?this.numPlanes:0,this.numPlanes+=b}};function g(){l.value!==t&&(l.value=t,l.needsUpdate=i>0),e.numPlanes=i,e.numIntersection=0}function u(C,d,h,f){const v=C!==null?C.length:0;let y=null;if(v!==0){if(y=l.value,f!==!0||y===null){const A=h+v*4,b=d.matrixWorldInverse;a.getNormalMatrix(b),(y===null||y.length0){const g=new sp(l.height/2);return g.fromEquirectangularTexture(n,o),e.set(o,g),o.addEventListener("dispose",s),t(g.texture,o.mapping)}else return null}}return o}function s(o){const a=o.target;a.removeEventListener("dispose",s);const l=e.get(a);l!==void 0&&(e.delete(a),l.dispose())}function r(){e=new WeakMap}return{get:i,dispose:r}}class Wc extends Rc{constructor(e=-1,t=1,i=1,s=-1,r=.1,o=2e3){super(),this.isOrthographicCamera=!0,this.type="OrthographicCamera",this.zoom=1,this.view=null,this.left=e,this.right=t,this.top=i,this.bottom=s,this.near=r,this.far=o,this.updateProjectionMatrix()}copy(e,t){return super.copy(e,t),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,t,i,s,r,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=t,this.view.offsetX=i,this.view.offsetY=s,this.view.width=r,this.view.height=o,this.updateProjectionMatrix()}clearViewOffset(){this.view!==null&&(this.view.enabled=!1),this.updateProjectionMatrix()}updateProjectionMatrix(){const e=(this.right-this.left)/(2*this.zoom),t=(this.top-this.bottom)/(2*this.zoom),i=(this.right+this.left)/2,s=(this.top+this.bottom)/2;let r=i-e,o=i+e,a=s+t,l=s-t;if(this.view!==null&&this.view.enabled){const g=(this.right-this.left)/this.view.fullWidth/this.zoom,u=(this.top-this.bottom)/this.view.fullHeight/this.zoom;r+=g*this.view.offsetX,o=r+g*this.view.width,a-=u*this.view.offsetY,l=a-u*this.view.height}this.projectionMatrix.makeOrthographic(r,o,a,l,this.near,this.far),this.projectionMatrixInverse.copy(this.projectionMatrix).invert()}toJSON(e){const t=super.toJSON(e);return t.object.zoom=this.zoom,t.object.left=this.left,t.object.right=this.right,t.object.top=this.top,t.object.bottom=this.bottom,t.object.near=this.near,t.object.far=this.far,this.view!==null&&(t.object.view=Object.assign({},this.view)),t}}const Ug=4,mZ=[.125,.215,.35,.446,.526,.582],tl=20,fm=new Wc,bZ=new Xe;let mm=null;const qa=(1+Math.sqrt(5))/2,pg=1/qa,vZ=[new H(1,1,1),new H(-1,1,1),new H(1,1,-1),new H(-1,1,-1),new H(0,qa,pg),new H(0,qa,-pg),new H(pg,0,qa),new H(-pg,0,qa),new H(qa,pg,0),new H(-qa,pg,0)];class WA{constructor(e){this._renderer=e,this._pingPongRenderTarget=null,this._lodMax=0,this._cubeSize=0,this._lodPlanes=[],this._sizeLods=[],this._sigmas=[],this._blurMaterial=null,this._cubemapMaterial=null,this._equirectMaterial=null,this._compileMaterial(this._blurMaterial)}fromScene(e,t=0,i=.1,s=100){mm=this._renderer.getRenderTarget(),this._setSize(256);const r=this._allocateTargets();return r.depthBuffer=!0,this._sceneToCubeUV(e,i,s,r),t>0&&this._blur(r,0,0,t),this._applyPMREM(r),this._cleanup(r),r}fromEquirectangular(e,t=null){return this._fromTexture(e,t)}fromCubemap(e,t=null){return this._fromTexture(e,t)}compileCubemapShader(){this._cubemapMaterial===null&&(this._cubemapMaterial=BZ(),this._compileMaterial(this._cubemapMaterial))}compileEquirectangularShader(){this._equirectMaterial===null&&(this._equirectMaterial=GZ(),this._compileMaterial(this._equirectMaterial))}dispose(){this._dispose(),this._cubemapMaterial!==null&&this._cubemapMaterial.dispose(),this._equirectMaterial!==null&&this._equirectMaterial.dispose()}_setSize(e){this._lodMax=Math.floor(Math.log2(e)),this._cubeSize=Math.pow(2,this._lodMax)}_dispose(){this._blurMaterial!==null&&this._blurMaterial.dispose(),this._pingPongRenderTarget!==null&&this._pingPongRenderTarget.dispose();for(let e=0;e2?m:0,m,m),u.setRenderTarget(s),v&&u.render(f,a),u.render(e,a)}f.geometry.dispose(),f.material.dispose(),u.toneMapping=d,u.autoClear=C,e.background=y}_textureToCubeUV(e,t){const i=this._renderer,s=e.mapping===fa||e.mapping===ma;s?(this._cubemapMaterial===null&&(this._cubemapMaterial=BZ()),this._cubemapMaterial.uniforms.flipEnvMap.value=e.isRenderTargetTexture===!1?-1:1):this._equirectMaterial===null&&(this._equirectMaterial=GZ());const r=s?this._cubemapMaterial:this._equirectMaterial,o=new On(this._lodPlanes[0],r),a=r.uniforms;a.envMap.value=e;const l=this._cubeSize;jd(t,0,0,3*l,2*l),i.setRenderTarget(t),i.render(o,fm)}_applyPMREM(e){const t=this._renderer,i=t.autoClear;t.autoClear=!1;for(let s=1;stl&&console.warn(`sigmaRadians, ${r}, is too large and will clip, as it requested ${y} samples when the maximum is set to ${tl}`);const A=[];let b=0;for(let R=0;Rm-Ug?s-m+Ug:0),x=4*(this._cubeSize-B);jd(t,S,x,3*B,2*B),l.setRenderTarget(t),l.render(C,fm)}}function $K(n){const e=[],t=[],i=[];let s=n;const r=n-Ug+1+mZ.length;for(let o=0;on-Ug?l=mZ[o-n+Ug-1]:o===0&&(l=0),i.push(l);const g=1/(a-2),u=-g,C=1+g,d=[u,u,C,u,C,C,u,u,C,C,u,C],h=6,f=6,v=3,y=2,A=1,b=new Float32Array(v*f*h),m=new Float32Array(y*f*h),B=new Float32Array(A*f*h);for(let x=0;x2?0:-1,Z=[R,M,0,R+2/3,M,0,R+2/3,M+1,0,R,M,0,R+2/3,M+1,0,R,M+1,0];b.set(Z,v*f*x),m.set(d,y*f*x);const V=[x,x,x,x,x,x];B.set(V,A*f*x)}const S=new Gt;S.setAttribute("position",new Jt(b,v)),S.setAttribute("uv",new Jt(m,y)),S.setAttribute("faceIndex",new Jt(B,A)),e.push(S),s>Ug&&s--}return{lodPlanes:e,sizeLods:t,sigmas:i}}function yZ(n,e,t){const i=new Nt(n,e,t);return i.texture.mapping=xc,i.texture.name="PMREM.cubeUv",i.scissorTest=!0,i}function jd(n,e,t,i,s){n.viewport.set(e,t,i,s),n.scissor.set(e,t,i,s)}function ez(n,e,t){const i=new Float32Array(tl),s=new H(0,1,0);return new Rt({name:"SphericalGaussianBlur",defines:{n:tl,CUBEUV_TEXEL_WIDTH:1/e,CUBEUV_TEXEL_HEIGHT:1/t,CUBEUV_MAX_MIP:`${n}.0`},uniforms:{envMap:{value:null},samples:{value:1},weights:{value:i},latitudinal:{value:!1},dTheta:{value:0},mipInt:{value:0},poleAxis:{value:s}},vertexShader:cy(),fragmentShader:` precision mediump float; precision mediump int; @@ -3421,27 +3421,27 @@ void main() { gl_Position = vec4( position, 1.0 ); } - `}function tz(n){let e=new WeakMap,t=null;function i(a){if(a&&a.isTexture){const l=a.mapping,g=l===Vu||l===Mu,u=l===fa||l===ma;if(g||u)if(a.isRenderTargetTexture&&a.needsPMREMUpdate===!0){a.needsPMREMUpdate=!1;let C=e.get(a);return t===null&&(t=new WA(n)),C=g?t.fromEquirectangular(a,C):t.fromCubemap(a,C),e.set(a,C),C.texture}else{if(e.has(a))return e.get(a).texture;{const C=a.image;if(g&&C&&C.height>0||u&&C&&s(C)){t===null&&(t=new WA(n));const d=g?t.fromEquirectangular(a):t.fromCubemap(a);return e.set(a,d),a.addEventListener("dispose",r),d.texture}else return null}}}return a}function s(a){let l=0;const g=6;for(let u=0;ue.maxTextureSize&&(N=Math.ceil(V/e.maxTextureSize),V=e.maxTextureSize);const P=new Float32Array(V*N*4*v),U=new ip(P,V,N,v);U.type=Wn,U.needsUpdate=!0;const q=Z*4;for(let he=0;he0)return n;const s=e*t;let r=ZZ[s];if(r===void 0&&(r=new Float32Array(s),ZZ[s]=r),e!==0){i.toArray(r,0);for(let o=1,a=0;o!==e;++o)a+=t,n[o].toArray(r,a)}return r}function qn(n,e){if(n.length!==e.length)return!1;for(let t=0,i=n.length;t0||u&&C&&s(C)){t===null&&(t=new WA(n));const d=g?t.fromEquirectangular(a):t.fromCubemap(a);return e.set(a,d),a.addEventListener("dispose",r),d.texture}else return null}}}return a}function s(a){let l=0;const g=6;for(let u=0;ue.maxTextureSize&&(N=Math.ceil(V/e.maxTextureSize),V=e.maxTextureSize);const P=new Float32Array(V*N*4*v),U=new ip(P,V,N,v);U.type=Wn,U.needsUpdate=!0;const q=Z*4;for(let he=0;he0)return n;const s=e*t;let r=ZZ[s];if(r===void 0&&(r=new Float32Array(s),ZZ[s]=r),e!==0){i.toArray(r,0);for(let o=1,a=0;o!==e;++o)a+=t,n[o].toArray(r,a)}return r}function qn(n,e){if(n.length!==e.length)return!1;for(let t=0,i=n.length;t":" "} ${a}: ${t[o]}`)}return i.join(` `)}function nL(n){switch(n){case fr:return["Linear","( value )"];case yt:return["sRGB","( value )"];default:return console.warn("THREE.WebGLProgram: Unsupported color space:",n),["Linear","( value )"]}}function MZ(n,e,t){const i=n.getShaderParameter(e,n.COMPILE_STATUS),s=n.getShaderInfoLog(e).trim();if(i&&s==="")return"";const r=/ERROR: 0:(\d+)/.exec(s);if(r){const o=parseInt(r[1]);return t.toUpperCase()+` `+s+` -`+tL(n.getShaderSource(e),o)}else return s}function iL(n,e){const t=nL(e);return"vec4 "+n+"( vec4 value ) { return LinearTo"+t[0]+t[1]+"; }"}function sL(n,e){let t;switch(e){case oW:t="Linear";break;case aW:t="Reinhard";break;case lW:t="OptimizedCineon";break;case qv:t="ACESFilmic";break;case gW:t="Custom";break;default:console.warn("THREE.WebGLProgram: Unsupported toneMapping:",e),t="Linear"}return"vec3 "+n+"( vec3 color ) { return "+t+"ToneMapping( color ); }"}function rL(n){return[n.extensionDerivatives||n.envMapCubeUVHeight||n.bumpMap||n.normalMapTangentSpace||n.clearcoatNormalMap||n.flatShading||n.shaderID==="physical"?"#extension GL_OES_standard_derivatives : enable":"",(n.extensionFragDepth||n.logarithmicDepthBuffer)&&n.rendererExtensionFragDepth?"#extension GL_EXT_frag_depth : enable":"",n.extensionDrawBuffers&&n.rendererExtensionDrawBuffers?"#extension GL_EXT_draw_buffers : require":"",(n.extensionShaderTextureLOD||n.envMap||n.transmission)&&n.rendererExtensionShaderTextureLod?"#extension GL_EXT_shader_texture_lod : enable":""].filter(EI).join(` +`+tL(n.getShaderSource(e),o)}else return s}function iL(n,e){const t=nL(e);return"vec4 "+n+"( vec4 value ) { return LinearTo"+t[0]+t[1]+"; }"}function sL(n,e){let t;switch(e){case oW:t="Linear";break;case aW:t="Reinhard";break;case lW:t="OptimizedCineon";break;case qv:t="ACESFilmic";break;case gW:t="Custom";break;default:console.warn("THREE.WebGLProgram: Unsupported toneMapping:",e),t="Linear"}return"vec3 "+n+"( vec3 color ) { return "+t+"ToneMapping( color ); }"}function rL(n){return[n.extensionDerivatives||n.envMapCubeUVHeight||n.bumpMap||n.normalMapTangentSpace||n.clearcoatNormalMap||n.flatShading||n.shaderID==="physical"?"#extension GL_OES_standard_derivatives : enable":"",(n.extensionFragDepth||n.logarithmicDepthBuffer)&&n.rendererExtensionFragDepth?"#extension GL_EXT_frag_depth : enable":"",n.extensionDrawBuffers&&n.rendererExtensionDrawBuffers?"#extension GL_EXT_draw_buffers : require":"",(n.extensionShaderTextureLOD||n.envMap||n.transmission)&&n.rendererExtensionShaderTextureLod?"#extension GL_EXT_shader_texture_lod : enable":""].filter(TI).join(` `)}function oL(n){const e=[];for(const t in n){const i=n[t];i!==!1&&e.push("#define "+t+" "+i)}return e.join(` -`)}function aL(n,e){const t={},i=n.getProgramParameter(e,n.ACTIVE_ATTRIBUTES);for(let s=0;s/gm;function wb(n){return n.replace(lL,gL)}function gL(n,e){const t=gt[e];if(t===void 0)throw new Error("Can not resolve #include <"+e+">");return wb(t)}const cL=/#pragma unroll_loop_start\s+for\s*\(\s*int\s+i\s*=\s*(\d+)\s*;\s*i\s*<\s*(\d+)\s*;\s*i\s*\+\+\s*\)\s*{([\s\S]+?)}\s+#pragma unroll_loop_end/g;function XZ(n){return n.replace(cL,IL)}function IL(n,e,t,i){let s="";for(let r=parseInt(e);r/gm;function wb(n){return n.replace(lL,gL)}function gL(n,e){const t=gt[e];if(t===void 0)throw new Error("Can not resolve #include <"+e+">");return wb(t)}const cL=/#pragma unroll_loop_start\s+for\s*\(\s*int\s+i\s*=\s*(\d+)\s*;\s*i\s*<\s*(\d+)\s*;\s*i\s*\+\+\s*\)\s*{([\s\S]+?)}\s+#pragma unroll_loop_end/g;function XZ(n){return n.replace(cL,IL)}function IL(n,e,t,i){let s="";for(let r=parseInt(e);r0&&(y+=` -`),A=[h,f].filter(EI).join(` +`),A=[h,f].filter(TI).join(` `),A.length>0&&(A+=` `)):(y=[FZ(t),"#define SHADER_NAME "+t.shaderName,f,t.instancing?"#define USE_INSTANCING":"",t.instancingColor?"#define USE_INSTANCING_COLOR":"",t.useFog&&t.fog?"#define USE_FOG":"",t.useFog&&t.fogExp2?"#define FOG_EXP2":"",t.map?"#define USE_MAP":"",t.envMap?"#define USE_ENVMAP":"",t.envMap?"#define "+u:"",t.lightMap?"#define USE_LIGHTMAP":"",t.aoMap?"#define USE_AOMAP":"",t.bumpMap?"#define USE_BUMPMAP":"",t.normalMap?"#define USE_NORMALMAP":"",t.normalMapObjectSpace?"#define USE_NORMALMAP_OBJECTSPACE":"",t.normalMapTangentSpace?"#define USE_NORMALMAP_TANGENTSPACE":"",t.displacementMap?"#define USE_DISPLACEMENTMAP":"",t.emissiveMap?"#define USE_EMISSIVEMAP":"",t.clearcoatMap?"#define USE_CLEARCOATMAP":"",t.clearcoatRoughnessMap?"#define USE_CLEARCOAT_ROUGHNESSMAP":"",t.clearcoatNormalMap?"#define USE_CLEARCOAT_NORMALMAP":"",t.iridescenceMap?"#define USE_IRIDESCENCEMAP":"",t.iridescenceThicknessMap?"#define USE_IRIDESCENCE_THICKNESSMAP":"",t.specularMap?"#define USE_SPECULARMAP":"",t.specularColorMap?"#define USE_SPECULAR_COLORMAP":"",t.specularIntensityMap?"#define USE_SPECULAR_INTENSITYMAP":"",t.roughnessMap?"#define USE_ROUGHNESSMAP":"",t.metalnessMap?"#define USE_METALNESSMAP":"",t.alphaMap?"#define USE_ALPHAMAP":"",t.transmission?"#define USE_TRANSMISSION":"",t.transmissionMap?"#define USE_TRANSMISSIONMAP":"",t.thicknessMap?"#define USE_THICKNESSMAP":"",t.sheenColorMap?"#define USE_SHEEN_COLORMAP":"",t.sheenRoughnessMap?"#define USE_SHEEN_ROUGHNESSMAP":"",t.mapUv?"#define MAP_UV "+t.mapUv:"",t.alphaMapUv?"#define ALPHAMAP_UV "+t.alphaMapUv:"",t.lightMapUv?"#define LIGHTMAP_UV "+t.lightMapUv:"",t.aoMapUv?"#define AOMAP_UV "+t.aoMapUv:"",t.emissiveMapUv?"#define EMISSIVEMAP_UV "+t.emissiveMapUv:"",t.bumpMapUv?"#define BUMPMAP_UV "+t.bumpMapUv:"",t.normalMapUv?"#define NORMALMAP_UV "+t.normalMapUv:"",t.displacementMapUv?"#define DISPLACEMENTMAP_UV "+t.displacementMapUv:"",t.metalnessMapUv?"#define METALNESSMAP_UV "+t.metalnessMapUv:"",t.roughnessMapUv?"#define ROUGHNESSMAP_UV "+t.roughnessMapUv:"",t.clearcoatMapUv?"#define CLEARCOATMAP_UV "+t.clearcoatMapUv:"",t.clearcoatNormalMapUv?"#define CLEARCOAT_NORMALMAP_UV "+t.clearcoatNormalMapUv:"",t.clearcoatRoughnessMapUv?"#define CLEARCOAT_ROUGHNESSMAP_UV "+t.clearcoatRoughnessMapUv:"",t.iridescenceMapUv?"#define IRIDESCENCEMAP_UV "+t.iridescenceMapUv:"",t.iridescenceThicknessMapUv?"#define IRIDESCENCE_THICKNESSMAP_UV "+t.iridescenceThicknessMapUv:"",t.sheenColorMapUv?"#define SHEEN_COLORMAP_UV "+t.sheenColorMapUv:"",t.sheenRoughnessMapUv?"#define SHEEN_ROUGHNESSMAP_UV "+t.sheenRoughnessMapUv:"",t.specularMapUv?"#define SPECULARMAP_UV "+t.specularMapUv:"",t.specularColorMapUv?"#define SPECULAR_COLORMAP_UV "+t.specularColorMapUv:"",t.specularIntensityMapUv?"#define SPECULAR_INTENSITYMAP_UV "+t.specularIntensityMapUv:"",t.transmissionMapUv?"#define TRANSMISSIONMAP_UV "+t.transmissionMapUv:"",t.thicknessMapUv?"#define THICKNESSMAP_UV "+t.thicknessMapUv:"",t.vertexTangents?"#define USE_TANGENT":"",t.vertexColors?"#define USE_COLOR":"",t.vertexAlphas?"#define USE_COLOR_ALPHA":"",t.vertexUv1s?"#define USE_UV1":"",t.vertexUv2s?"#define USE_UV2":"",t.vertexUv3s?"#define USE_UV3":"",t.pointsUvs?"#define USE_POINTS_UV":"",t.flatShading?"#define FLAT_SHADED":"",t.skinning?"#define USE_SKINNING":"",t.morphTargets?"#define USE_MORPHTARGETS":"",t.morphNormals&&t.flatShading===!1?"#define USE_MORPHNORMALS":"",t.morphColors&&t.isWebGL2?"#define USE_MORPHCOLORS":"",t.morphTargetsCount>0&&t.isWebGL2?"#define MORPHTARGETS_TEXTURE":"",t.morphTargetsCount>0&&t.isWebGL2?"#define MORPHTARGETS_TEXTURE_STRIDE "+t.morphTextureStride:"",t.morphTargetsCount>0&&t.isWebGL2?"#define MORPHTARGETS_COUNT "+t.morphTargetsCount:"",t.doubleSided?"#define DOUBLE_SIDED":"",t.flipSided?"#define FLIP_SIDED":"",t.shadowMapEnabled?"#define USE_SHADOWMAP":"",t.shadowMapEnabled?"#define "+l:"",t.sizeAttenuation?"#define USE_SIZEATTENUATION":"",t.logarithmicDepthBuffer?"#define USE_LOGDEPTHBUF":"",t.logarithmicDepthBuffer&&t.rendererExtensionFragDepth?"#define USE_LOGDEPTHBUF_EXT":"","uniform mat4 modelMatrix;","uniform mat4 modelViewMatrix;","uniform mat4 projectionMatrix;","uniform mat4 viewMatrix;","uniform mat3 normalMatrix;","uniform vec3 cameraPosition;","uniform bool isOrthographic;","#ifdef USE_INSTANCING"," attribute mat4 instanceMatrix;","#endif","#ifdef USE_INSTANCING_COLOR"," attribute vec3 instanceColor;","#endif","attribute vec3 position;","attribute vec3 normal;","attribute vec2 uv;","#ifdef USE_UV1"," attribute vec2 uv1;","#endif","#ifdef USE_UV2"," attribute vec2 uv2;","#endif","#ifdef USE_UV3"," attribute vec2 uv3;","#endif","#ifdef USE_TANGENT"," attribute vec4 tangent;","#endif","#if defined( USE_COLOR_ALPHA )"," attribute vec4 color;","#elif defined( USE_COLOR )"," attribute vec3 color;","#endif","#if ( defined( USE_MORPHTARGETS ) && ! defined( MORPHTARGETS_TEXTURE ) )"," attribute vec3 morphTarget0;"," attribute vec3 morphTarget1;"," attribute vec3 morphTarget2;"," attribute vec3 morphTarget3;"," #ifdef USE_MORPHNORMALS"," attribute vec3 morphNormal0;"," attribute vec3 morphNormal1;"," attribute vec3 morphNormal2;"," attribute vec3 morphNormal3;"," #else"," attribute vec3 morphTarget4;"," attribute vec3 morphTarget5;"," attribute vec3 morphTarget6;"," attribute vec3 morphTarget7;"," #endif","#endif","#ifdef USE_SKINNING"," attribute vec4 skinIndex;"," attribute vec4 skinWeight;","#endif",` -`].filter(EI).join(` +`].filter(TI).join(` `),A=[h,FZ(t),"#define SHADER_NAME "+t.shaderName,f,t.useFog&&t.fog?"#define USE_FOG":"",t.useFog&&t.fogExp2?"#define FOG_EXP2":"",t.map?"#define USE_MAP":"",t.matcap?"#define USE_MATCAP":"",t.envMap?"#define USE_ENVMAP":"",t.envMap?"#define "+g:"",t.envMap?"#define "+u:"",t.envMap?"#define "+C:"",d?"#define CUBEUV_TEXEL_WIDTH "+d.texelWidth:"",d?"#define CUBEUV_TEXEL_HEIGHT "+d.texelHeight:"",d?"#define CUBEUV_MAX_MIP "+d.maxMip+".0":"",t.lightMap?"#define USE_LIGHTMAP":"",t.aoMap?"#define USE_AOMAP":"",t.bumpMap?"#define USE_BUMPMAP":"",t.normalMap?"#define USE_NORMALMAP":"",t.normalMapObjectSpace?"#define USE_NORMALMAP_OBJECTSPACE":"",t.normalMapTangentSpace?"#define USE_NORMALMAP_TANGENTSPACE":"",t.emissiveMap?"#define USE_EMISSIVEMAP":"",t.clearcoat?"#define USE_CLEARCOAT":"",t.clearcoatMap?"#define USE_CLEARCOATMAP":"",t.clearcoatRoughnessMap?"#define USE_CLEARCOAT_ROUGHNESSMAP":"",t.clearcoatNormalMap?"#define USE_CLEARCOAT_NORMALMAP":"",t.iridescence?"#define USE_IRIDESCENCE":"",t.iridescenceMap?"#define USE_IRIDESCENCEMAP":"",t.iridescenceThicknessMap?"#define USE_IRIDESCENCE_THICKNESSMAP":"",t.specularMap?"#define USE_SPECULARMAP":"",t.specularColorMap?"#define USE_SPECULAR_COLORMAP":"",t.specularIntensityMap?"#define USE_SPECULAR_INTENSITYMAP":"",t.roughnessMap?"#define USE_ROUGHNESSMAP":"",t.metalnessMap?"#define USE_METALNESSMAP":"",t.alphaMap?"#define USE_ALPHAMAP":"",t.alphaTest?"#define USE_ALPHATEST":"",t.sheen?"#define USE_SHEEN":"",t.sheenColorMap?"#define USE_SHEEN_COLORMAP":"",t.sheenRoughnessMap?"#define USE_SHEEN_ROUGHNESSMAP":"",t.transmission?"#define USE_TRANSMISSION":"",t.transmissionMap?"#define USE_TRANSMISSIONMAP":"",t.thicknessMap?"#define USE_THICKNESSMAP":"",t.vertexTangents?"#define USE_TANGENT":"",t.vertexColors||t.instancingColor?"#define USE_COLOR":"",t.vertexAlphas?"#define USE_COLOR_ALPHA":"",t.vertexUv1s?"#define USE_UV1":"",t.vertexUv2s?"#define USE_UV2":"",t.vertexUv3s?"#define USE_UV3":"",t.pointsUvs?"#define USE_POINTS_UV":"",t.gradientMap?"#define USE_GRADIENTMAP":"",t.flatShading?"#define FLAT_SHADED":"",t.doubleSided?"#define DOUBLE_SIDED":"",t.flipSided?"#define FLIP_SIDED":"",t.shadowMapEnabled?"#define USE_SHADOWMAP":"",t.shadowMapEnabled?"#define "+l:"",t.premultipliedAlpha?"#define PREMULTIPLIED_ALPHA":"",t.useLegacyLights?"#define LEGACY_LIGHTS":"",t.logarithmicDepthBuffer?"#define USE_LOGDEPTHBUF":"",t.logarithmicDepthBuffer&&t.rendererExtensionFragDepth?"#define USE_LOGDEPTHBUF_EXT":"","uniform mat4 viewMatrix;","uniform vec3 cameraPosition;","uniform bool isOrthographic;",t.toneMapping!==Ar?"#define TONE_MAPPING":"",t.toneMapping!==Ar?gt.tonemapping_pars_fragment:"",t.toneMapping!==Ar?sL("toneMapping",t.toneMapping):"",t.dithering?"#define DITHERING":"",t.opaque?"#define OPAQUE":"",gt.encodings_pars_fragment,iL("linearToOutputTexel",t.outputColorSpace),t.useDepthPacking?"#define DEPTH_PACKING "+t.depthPacking:"",` -`].filter(EI).join(` +`].filter(TI).join(` `)),o=wb(o),o=NZ(o,t),o=HZ(o,t),a=wb(a),a=NZ(a,t),a=HZ(a,t),o=XZ(o),a=XZ(a),t.isWebGL2&&t.isRawShaderMaterial!==!0&&(b=`#version 300 es `,y=["precision mediump sampler2DArray;","#define attribute in","#define varying out","#define texture2D texture"].join(` `)+` @@ -3451,7 +3451,7 @@ precision `+n.precision+" int;";return n.precision==="highp"?e+=` Program Info Log: `+Z+` `+q+` -`+ie)}else Z!==""?console.warn("THREE.WebGLProgram: Program Info Log:",Z):(V===""||N==="")&&(U=!1);U&&(this.diagnostics={runnable:P,programLog:Z,vertexShader:{log:V,prefix:y},fragmentShader:{log:N,prefix:A}})}s.deleteShader(S),s.deleteShader(x);let R;this.getUniforms=function(){return R===void 0&&(R=new qh(s,v)),R};let M;return this.getAttributes=function(){return M===void 0&&(M=aL(s,v)),M},this.destroy=function(){i.releaseStatesOfProgram(this),s.deleteProgram(v),this.program=void 0},this.name=t.shaderName,this.id=eL++,this.cacheKey=e,this.usedTimes=1,this.program=v,this.vertexShader=S,this.fragmentShader=x,this}let fL=0;class mL{constructor(){this.shaderCache=new Map,this.materialCache=new Map}update(e){const t=e.vertexShader,i=e.fragmentShader,s=this._getShaderStage(t),r=this._getShaderStage(i),o=this._getShaderCacheForMaterial(e);return o.has(s)===!1&&(o.add(s),s.usedTimes++),o.has(r)===!1&&(o.add(r),r.usedTimes++),this}remove(e){const t=this.materialCache.get(e);for(const i of t)i.usedTimes--,i.usedTimes===0&&this.shaderCache.delete(i.code);return this.materialCache.delete(e),this}getVertexShaderID(e){return this._getShaderStage(e.vertexShader).id}getFragmentShaderID(e){return this._getShaderStage(e.fragmentShader).id}dispose(){this.shaderCache.clear(),this.materialCache.clear()}_getShaderCacheForMaterial(e){const t=this.materialCache;let i=t.get(e);return i===void 0&&(i=new Set,t.set(e,i)),i}_getShaderStage(e){const t=this.shaderCache;let i=t.get(e);return i===void 0&&(i=new bL(e),t.set(e,i)),i}}class bL{constructor(e){this.id=fL++,this.code=e,this.usedTimes=0}}function vL(n,e,t,i,s,r,o){const a=new ml,l=new mL,g=[],u=s.isWebGL2,C=s.logarithmicDepthBuffer,d=s.vertexTextures;let h=s.precision;const f={MeshDepthMaterial:"depth",MeshDistanceMaterial:"distanceRGBA",MeshNormalMaterial:"normal",MeshBasicMaterial:"basic",MeshLambertMaterial:"lambert",MeshPhongMaterial:"phong",MeshToonMaterial:"toon",MeshStandardMaterial:"physical",MeshPhysicalMaterial:"physical",MeshMatcapMaterial:"matcap",LineBasicMaterial:"basic",LineDashedMaterial:"dashed",PointsMaterial:"points",ShadowMaterial:"shadow",SpriteMaterial:"sprite"};function v(Z){return Z===1?"uv1":Z===2?"uv2":Z===3?"uv3":"uv"}function y(Z,V,N,P,U){const q=P.fog,ie=U.geometry,he=Z.isMeshStandardMaterial?P.environment:null,Ce=(Z.isMeshStandardMaterial?t:e).get(Z.envMap||he),z=Ce&&Ce.mapping===Sc?Ce.image.height:null,Q=f[Z.type];Z.precision!==null&&(h=s.getMaxPrecision(Z.precision),h!==Z.precision&&console.warn("THREE.WebGLProgram.getParameters:",Z.precision,"not supported, using",h,"instead."));const J=ie.morphAttributes.position||ie.morphAttributes.normal||ie.morphAttributes.color,le=J!==void 0?J.length:0;let se=0;ie.morphAttributes.position!==void 0&&(se=1),ie.morphAttributes.normal!==void 0&&(se=2),ie.morphAttributes.color!==void 0&&(se=3);let te,ge,Ze,Re;if(Q){const At=Cr[Q];te=At.vertexShader,ge=At.fragmentShader}else te=Z.vertexShader,ge=Z.fragmentShader,l.update(Z),Ze=l.getVertexShaderID(Z),Re=l.getFragmentShaderID(Z);const O=n.getRenderTarget(),ot=U.isInstancedMesh===!0,ct=!!Z.map,Me=!!Z.matcap,Ue=!!Ce,Be=!!Z.aoMap,fe=!!Z.lightMap,we=!!Z.bumpMap,Pe=!!Z.normalMap,Fe=!!Z.displacementMap,qe=!!Z.emissiveMap,at=!!Z.metalnessMap,nt=!!Z.roughnessMap,Ct=Z.clearcoat>0,Ht=Z.iridescence>0,T=Z.sheen>0,X=Z.transmission>0,de=Ct&&!!Z.clearcoatMap,xe=Ct&&!!Z.clearcoatNormalMap,We=Ct&&!!Z.clearcoatRoughnessMap,Ee=Ht&&!!Z.iridescenceMap,lt=Ht&&!!Z.iridescenceThicknessMap,Je=T&&!!Z.sheenColorMap,D=T&&!!Z.sheenRoughnessMap,$=!!Z.specularMap,Ie=!!Z.specularColorMap,ye=!!Z.specularIntensityMap,be=X&&!!Z.transmissionMap,Se=X&&!!Z.thicknessMap,ze=!!Z.gradientMap,Ye=!!Z.alphaMap,Ke=Z.alphaTest>0,_=!!Z.extensions,ce=!!ie.attributes.uv1,Ge=!!ie.attributes.uv2,Ne=!!ie.attributes.uv3;return{isWebGL2:u,shaderID:Q,shaderName:Z.type,vertexShader:te,fragmentShader:ge,defines:Z.defines,customVertexShaderID:Ze,customFragmentShaderID:Re,isRawShaderMaterial:Z.isRawShaderMaterial===!0,glslVersion:Z.glslVersion,precision:h,instancing:ot,instancingColor:ot&&U.instanceColor!==null,supportsVertexTextures:d,outputColorSpace:O===null?n.outputColorSpace:O.isXRRenderTarget===!0?O.texture.colorSpace:fr,map:ct,matcap:Me,envMap:Ue,envMapMode:Ue&&Ce.mapping,envMapCubeUVHeight:z,aoMap:Be,lightMap:fe,bumpMap:we,normalMap:Pe,displacementMap:d&&Fe,emissiveMap:qe,normalMapObjectSpace:Pe&&Z.normalMapType===ZW,normalMapTangentSpace:Pe&&Z.normalMapType===Vo,metalnessMap:at,roughnessMap:nt,clearcoat:Ct,clearcoatMap:de,clearcoatNormalMap:xe,clearcoatRoughnessMap:We,iridescence:Ht,iridescenceMap:Ee,iridescenceThicknessMap:lt,sheen:T,sheenColorMap:Je,sheenRoughnessMap:D,specularMap:$,specularColorMap:Ie,specularIntensityMap:ye,transmission:X,transmissionMap:be,thicknessMap:Se,gradientMap:ze,opaque:Z.transparent===!1&&Z.blending===Al,alphaMap:Ye,alphaTest:Ke,combine:Z.combine,mapUv:ct&&v(Z.map.channel),aoMapUv:Be&&v(Z.aoMap.channel),lightMapUv:fe&&v(Z.lightMap.channel),bumpMapUv:we&&v(Z.bumpMap.channel),normalMapUv:Pe&&v(Z.normalMap.channel),displacementMapUv:Fe&&v(Z.displacementMap.channel),emissiveMapUv:qe&&v(Z.emissiveMap.channel),metalnessMapUv:at&&v(Z.metalnessMap.channel),roughnessMapUv:nt&&v(Z.roughnessMap.channel),clearcoatMapUv:de&&v(Z.clearcoatMap.channel),clearcoatNormalMapUv:xe&&v(Z.clearcoatNormalMap.channel),clearcoatRoughnessMapUv:We&&v(Z.clearcoatRoughnessMap.channel),iridescenceMapUv:Ee&&v(Z.iridescenceMap.channel),iridescenceThicknessMapUv:lt&&v(Z.iridescenceThicknessMap.channel),sheenColorMapUv:Je&&v(Z.sheenColorMap.channel),sheenRoughnessMapUv:D&&v(Z.sheenRoughnessMap.channel),specularMapUv:$&&v(Z.specularMap.channel),specularColorMapUv:Ie&&v(Z.specularColorMap.channel),specularIntensityMapUv:ye&&v(Z.specularIntensityMap.channel),transmissionMapUv:be&&v(Z.transmissionMap.channel),thicknessMapUv:Se&&v(Z.thicknessMap.channel),alphaMapUv:Ye&&v(Z.alphaMap.channel),vertexTangents:Pe&&!!ie.attributes.tangent,vertexColors:Z.vertexColors,vertexAlphas:Z.vertexColors===!0&&!!ie.attributes.color&&ie.attributes.color.itemSize===4,vertexUv1s:ce,vertexUv2s:Ge,vertexUv3s:Ne,pointsUvs:U.isPoints===!0&&!!ie.attributes.uv&&(ct||Ye),fog:!!q,useFog:Z.fog===!0,fogExp2:q&&q.isFogExp2,flatShading:Z.flatShading===!0,sizeAttenuation:Z.sizeAttenuation===!0,logarithmicDepthBuffer:C,skinning:U.isSkinnedMesh===!0,morphTargets:ie.morphAttributes.position!==void 0,morphNormals:ie.morphAttributes.normal!==void 0,morphColors:ie.morphAttributes.color!==void 0,morphTargetsCount:le,morphTextureStride:se,numDirLights:V.directional.length,numPointLights:V.point.length,numSpotLights:V.spot.length,numSpotLightMaps:V.spotLightMap.length,numRectAreaLights:V.rectArea.length,numHemiLights:V.hemi.length,numDirLightShadows:V.directionalShadowMap.length,numPointLightShadows:V.pointShadowMap.length,numSpotLightShadows:V.spotShadowMap.length,numSpotLightShadowsWithMaps:V.numSpotLightShadowsWithMaps,numClippingPlanes:o.numPlanes,numClipIntersection:o.numIntersection,dithering:Z.dithering,shadowMapEnabled:n.shadowMap.enabled&&N.length>0,shadowMapType:n.shadowMap.type,toneMapping:Z.toneMapped?n.toneMapping:Ar,useLegacyLights:n.useLegacyLights,premultipliedAlpha:Z.premultipliedAlpha,doubleSided:Z.side===ts,flipSided:Z.side===Jn,useDepthPacking:Z.depthPacking>=0,depthPacking:Z.depthPacking||0,index0AttributeName:Z.index0AttributeName,extensionDerivatives:_&&Z.extensions.derivatives===!0,extensionFragDepth:_&&Z.extensions.fragDepth===!0,extensionDrawBuffers:_&&Z.extensions.drawBuffers===!0,extensionShaderTextureLOD:_&&Z.extensions.shaderTextureLOD===!0,rendererExtensionFragDepth:u||i.has("EXT_frag_depth"),rendererExtensionDrawBuffers:u||i.has("WEBGL_draw_buffers"),rendererExtensionShaderTextureLod:u||i.has("EXT_shader_texture_lod"),customProgramCacheKey:Z.customProgramCacheKey()}}function A(Z){const V=[];if(Z.shaderID?V.push(Z.shaderID):(V.push(Z.customVertexShaderID),V.push(Z.customFragmentShaderID)),Z.defines!==void 0)for(const N in Z.defines)V.push(N),V.push(Z.defines[N]);return Z.isRawShaderMaterial===!1&&(b(V,Z),m(V,Z),V.push(n.outputColorSpace)),V.push(Z.customProgramCacheKey),V.join()}function b(Z,V){Z.push(V.precision),Z.push(V.outputColorSpace),Z.push(V.envMapMode),Z.push(V.envMapCubeUVHeight),Z.push(V.mapUv),Z.push(V.alphaMapUv),Z.push(V.lightMapUv),Z.push(V.aoMapUv),Z.push(V.bumpMapUv),Z.push(V.normalMapUv),Z.push(V.displacementMapUv),Z.push(V.emissiveMapUv),Z.push(V.metalnessMapUv),Z.push(V.roughnessMapUv),Z.push(V.clearcoatMapUv),Z.push(V.clearcoatNormalMapUv),Z.push(V.clearcoatRoughnessMapUv),Z.push(V.iridescenceMapUv),Z.push(V.iridescenceThicknessMapUv),Z.push(V.sheenColorMapUv),Z.push(V.sheenRoughnessMapUv),Z.push(V.specularMapUv),Z.push(V.specularColorMapUv),Z.push(V.specularIntensityMapUv),Z.push(V.transmissionMapUv),Z.push(V.thicknessMapUv),Z.push(V.combine),Z.push(V.fogExp2),Z.push(V.sizeAttenuation),Z.push(V.morphTargetsCount),Z.push(V.morphAttributeCount),Z.push(V.numDirLights),Z.push(V.numPointLights),Z.push(V.numSpotLights),Z.push(V.numSpotLightMaps),Z.push(V.numHemiLights),Z.push(V.numRectAreaLights),Z.push(V.numDirLightShadows),Z.push(V.numPointLightShadows),Z.push(V.numSpotLightShadows),Z.push(V.numSpotLightShadowsWithMaps),Z.push(V.shadowMapType),Z.push(V.toneMapping),Z.push(V.numClippingPlanes),Z.push(V.numClipIntersection),Z.push(V.depthPacking)}function m(Z,V){a.disableAll(),V.isWebGL2&&a.enable(0),V.supportsVertexTextures&&a.enable(1),V.instancing&&a.enable(2),V.instancingColor&&a.enable(3),V.matcap&&a.enable(4),V.envMap&&a.enable(5),V.normalMapObjectSpace&&a.enable(6),V.normalMapTangentSpace&&a.enable(7),V.clearcoat&&a.enable(8),V.iridescence&&a.enable(9),V.alphaTest&&a.enable(10),V.vertexColors&&a.enable(11),V.vertexAlphas&&a.enable(12),V.vertexUv1s&&a.enable(13),V.vertexUv2s&&a.enable(14),V.vertexUv3s&&a.enable(15),V.vertexTangents&&a.enable(16),Z.push(a.mask),a.disableAll(),V.fog&&a.enable(0),V.useFog&&a.enable(1),V.flatShading&&a.enable(2),V.logarithmicDepthBuffer&&a.enable(3),V.skinning&&a.enable(4),V.morphTargets&&a.enable(5),V.morphNormals&&a.enable(6),V.morphColors&&a.enable(7),V.premultipliedAlpha&&a.enable(8),V.shadowMapEnabled&&a.enable(9),V.useLegacyLights&&a.enable(10),V.doubleSided&&a.enable(11),V.flipSided&&a.enable(12),V.useDepthPacking&&a.enable(13),V.dithering&&a.enable(14),V.transmission&&a.enable(15),V.sheen&&a.enable(16),V.opaque&&a.enable(17),V.pointsUvs&&a.enable(18),Z.push(a.mask)}function B(Z){const V=f[Z.type];let N;if(V){const P=Cr[V];N=XW.clone(P.uniforms)}else N=Z.uniforms;return N}function S(Z,V){let N;for(let P=0,U=g.length;P0?i.push(A):h.transparent===!0?s.push(A):t.push(A)}function l(C,d,h,f,v,y){const A=o(C,d,h,f,v,y);h.transmission>0?i.unshift(A):h.transparent===!0?s.unshift(A):t.unshift(A)}function g(C,d){t.length>1&&t.sort(C||GL),i.length>1&&i.sort(d||YZ),s.length>1&&s.sort(d||YZ)}function u(){for(let C=e,d=n.length;C=r.length?(o=new KZ,r.push(o)):o=r[s],o}function t(){n=new WeakMap}return{get:e,dispose:t}}function ZL(){const n={};return{get:function(e){if(n[e.id]!==void 0)return n[e.id];let t;switch(e.type){case"DirectionalLight":t={direction:new H,color:new Xe};break;case"SpotLight":t={position:new H,direction:new H,color:new Xe,distance:0,coneCos:0,penumbraCos:0,decay:0};break;case"PointLight":t={position:new H,color:new Xe,distance:0,decay:0};break;case"HemisphereLight":t={direction:new H,skyColor:new Xe,groundColor:new Xe};break;case"RectAreaLight":t={color:new Xe,position:new H,halfWidth:new H,halfHeight:new H};break}return n[e.id]=t,t}}}function wL(){const n={};return{get:function(e){if(n[e.id]!==void 0)return n[e.id];let t;switch(e.type){case"DirectionalLight":t={shadowBias:0,shadowNormalBias:0,shadowRadius:1,shadowMapSize:new oe};break;case"SpotLight":t={shadowBias:0,shadowNormalBias:0,shadowRadius:1,shadowMapSize:new oe};break;case"PointLight":t={shadowBias:0,shadowNormalBias:0,shadowRadius:1,shadowMapSize:new oe,shadowCameraNear:1,shadowCameraFar:1e3};break}return n[e.id]=t,t}}}let SL=0;function xL(n,e){return(e.castShadow?2:0)-(n.castShadow?2:0)+(e.map?1:0)-(n.map?1:0)}function RL(n,e){const t=new ZL,i=wL(),s={version:0,hash:{directionalLength:-1,pointLength:-1,spotLength:-1,rectAreaLength:-1,hemiLength:-1,numDirectionalShadows:-1,numPointShadows:-1,numSpotShadows:-1,numSpotMaps:-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};for(let u=0;u<9;u++)s.probe.push(new H);const r=new H,o=new _e,a=new _e;function l(u,C){let d=0,h=0,f=0;for(let N=0;N<9;N++)s.probe[N].set(0,0,0);let v=0,y=0,A=0,b=0,m=0,B=0,S=0,x=0,R=0,M=0;u.sort(xL);const Z=C===!0?Math.PI:1;for(let N=0,P=u.length;N0&&(e.isWebGL2||n.has("OES_texture_float_linear")===!0?(s.rectAreaLTC1=Le.LTC_FLOAT_1,s.rectAreaLTC2=Le.LTC_FLOAT_2):n.has("OES_texture_half_float_linear")===!0?(s.rectAreaLTC1=Le.LTC_HALF_1,s.rectAreaLTC2=Le.LTC_HALF_2):console.error("THREE.WebGLRenderer: Unable to use RectAreaLight. Missing WebGL extensions.")),s.ambient[0]=d,s.ambient[1]=h,s.ambient[2]=f;const V=s.hash;(V.directionalLength!==v||V.pointLength!==y||V.spotLength!==A||V.rectAreaLength!==b||V.hemiLength!==m||V.numDirectionalShadows!==B||V.numPointShadows!==S||V.numSpotShadows!==x||V.numSpotMaps!==R)&&(s.directional.length=v,s.spot.length=A,s.rectArea.length=b,s.point.length=y,s.hemi.length=m,s.directionalShadow.length=B,s.directionalShadowMap.length=B,s.pointShadow.length=S,s.pointShadowMap.length=S,s.spotShadow.length=x,s.spotShadowMap.length=x,s.directionalShadowMatrix.length=B,s.pointShadowMatrix.length=S,s.spotLightMatrix.length=x+R-M,s.spotLightMap.length=R,s.numSpotLightShadowsWithMaps=M,V.directionalLength=v,V.pointLength=y,V.spotLength=A,V.rectAreaLength=b,V.hemiLength=m,V.numDirectionalShadows=B,V.numPointShadows=S,V.numSpotShadows=x,V.numSpotMaps=R,s.version=SL++)}function g(u,C){let d=0,h=0,f=0,v=0,y=0;const A=C.matrixWorldInverse;for(let b=0,m=u.length;b=a.length?(l=new zZ(n,e),a.push(l)):l=a[o],l}function s(){t=new WeakMap}return{get:i,dispose:s}}class ap extends ei{constructor(e){super(),this.isMeshDepthMaterial=!0,this.type="MeshDepthMaterial",this.depthPacking=Tn,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 Iy extends ei{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 VL=`void main() { +`+ie)}else Z!==""?console.warn("THREE.WebGLProgram: Program Info Log:",Z):(V===""||N==="")&&(U=!1);U&&(this.diagnostics={runnable:P,programLog:Z,vertexShader:{log:V,prefix:y},fragmentShader:{log:N,prefix:A}})}s.deleteShader(S),s.deleteShader(x);let R;this.getUniforms=function(){return R===void 0&&(R=new qh(s,v)),R};let M;return this.getAttributes=function(){return M===void 0&&(M=aL(s,v)),M},this.destroy=function(){i.releaseStatesOfProgram(this),s.deleteProgram(v),this.program=void 0},this.name=t.shaderName,this.id=eL++,this.cacheKey=e,this.usedTimes=1,this.program=v,this.vertexShader=S,this.fragmentShader=x,this}let fL=0;class mL{constructor(){this.shaderCache=new Map,this.materialCache=new Map}update(e){const t=e.vertexShader,i=e.fragmentShader,s=this._getShaderStage(t),r=this._getShaderStage(i),o=this._getShaderCacheForMaterial(e);return o.has(s)===!1&&(o.add(s),s.usedTimes++),o.has(r)===!1&&(o.add(r),r.usedTimes++),this}remove(e){const t=this.materialCache.get(e);for(const i of t)i.usedTimes--,i.usedTimes===0&&this.shaderCache.delete(i.code);return this.materialCache.delete(e),this}getVertexShaderID(e){return this._getShaderStage(e.vertexShader).id}getFragmentShaderID(e){return this._getShaderStage(e.fragmentShader).id}dispose(){this.shaderCache.clear(),this.materialCache.clear()}_getShaderCacheForMaterial(e){const t=this.materialCache;let i=t.get(e);return i===void 0&&(i=new Set,t.set(e,i)),i}_getShaderStage(e){const t=this.shaderCache;let i=t.get(e);return i===void 0&&(i=new bL(e),t.set(e,i)),i}}class bL{constructor(e){this.id=fL++,this.code=e,this.usedTimes=0}}function vL(n,e,t,i,s,r,o){const a=new ml,l=new mL,g=[],u=s.isWebGL2,C=s.logarithmicDepthBuffer,d=s.vertexTextures;let h=s.precision;const f={MeshDepthMaterial:"depth",MeshDistanceMaterial:"distanceRGBA",MeshNormalMaterial:"normal",MeshBasicMaterial:"basic",MeshLambertMaterial:"lambert",MeshPhongMaterial:"phong",MeshToonMaterial:"toon",MeshStandardMaterial:"physical",MeshPhysicalMaterial:"physical",MeshMatcapMaterial:"matcap",LineBasicMaterial:"basic",LineDashedMaterial:"dashed",PointsMaterial:"points",ShadowMaterial:"shadow",SpriteMaterial:"sprite"};function v(Z){return Z===1?"uv1":Z===2?"uv2":Z===3?"uv3":"uv"}function y(Z,V,N,P,U){const q=P.fog,ie=U.geometry,he=Z.isMeshStandardMaterial?P.environment:null,Ce=(Z.isMeshStandardMaterial?t:e).get(Z.envMap||he),z=Ce&&Ce.mapping===xc?Ce.image.height:null,Q=f[Z.type];Z.precision!==null&&(h=s.getMaxPrecision(Z.precision),h!==Z.precision&&console.warn("THREE.WebGLProgram.getParameters:",Z.precision,"not supported, using",h,"instead."));const J=ie.morphAttributes.position||ie.morphAttributes.normal||ie.morphAttributes.color,le=J!==void 0?J.length:0;let se=0;ie.morphAttributes.position!==void 0&&(se=1),ie.morphAttributes.normal!==void 0&&(se=2),ie.morphAttributes.color!==void 0&&(se=3);let te,ge,Ze,Re;if(Q){const At=Cr[Q];te=At.vertexShader,ge=At.fragmentShader}else te=Z.vertexShader,ge=Z.fragmentShader,l.update(Z),Ze=l.getVertexShaderID(Z),Re=l.getFragmentShaderID(Z);const O=n.getRenderTarget(),ot=U.isInstancedMesh===!0,ct=!!Z.map,Me=!!Z.matcap,Ue=!!Ce,Be=!!Z.aoMap,fe=!!Z.lightMap,we=!!Z.bumpMap,Pe=!!Z.normalMap,Fe=!!Z.displacementMap,qe=!!Z.emissiveMap,at=!!Z.metalnessMap,nt=!!Z.roughnessMap,Ct=Z.clearcoat>0,Ht=Z.iridescence>0,T=Z.sheen>0,X=Z.transmission>0,de=Ct&&!!Z.clearcoatMap,xe=Ct&&!!Z.clearcoatNormalMap,We=Ct&&!!Z.clearcoatRoughnessMap,Ee=Ht&&!!Z.iridescenceMap,lt=Ht&&!!Z.iridescenceThicknessMap,Je=T&&!!Z.sheenColorMap,D=T&&!!Z.sheenRoughnessMap,$=!!Z.specularMap,Ie=!!Z.specularColorMap,ye=!!Z.specularIntensityMap,be=X&&!!Z.transmissionMap,Se=X&&!!Z.thicknessMap,ze=!!Z.gradientMap,Ye=!!Z.alphaMap,Ke=Z.alphaTest>0,_=!!Z.extensions,ce=!!ie.attributes.uv1,Ge=!!ie.attributes.uv2,Ne=!!ie.attributes.uv3;return{isWebGL2:u,shaderID:Q,shaderName:Z.type,vertexShader:te,fragmentShader:ge,defines:Z.defines,customVertexShaderID:Ze,customFragmentShaderID:Re,isRawShaderMaterial:Z.isRawShaderMaterial===!0,glslVersion:Z.glslVersion,precision:h,instancing:ot,instancingColor:ot&&U.instanceColor!==null,supportsVertexTextures:d,outputColorSpace:O===null?n.outputColorSpace:O.isXRRenderTarget===!0?O.texture.colorSpace:fr,map:ct,matcap:Me,envMap:Ue,envMapMode:Ue&&Ce.mapping,envMapCubeUVHeight:z,aoMap:Be,lightMap:fe,bumpMap:we,normalMap:Pe,displacementMap:d&&Fe,emissiveMap:qe,normalMapObjectSpace:Pe&&Z.normalMapType===ZW,normalMapTangentSpace:Pe&&Z.normalMapType===Vo,metalnessMap:at,roughnessMap:nt,clearcoat:Ct,clearcoatMap:de,clearcoatNormalMap:xe,clearcoatRoughnessMap:We,iridescence:Ht,iridescenceMap:Ee,iridescenceThicknessMap:lt,sheen:T,sheenColorMap:Je,sheenRoughnessMap:D,specularMap:$,specularColorMap:Ie,specularIntensityMap:ye,transmission:X,transmissionMap:be,thicknessMap:Se,gradientMap:ze,opaque:Z.transparent===!1&&Z.blending===Al,alphaMap:Ye,alphaTest:Ke,combine:Z.combine,mapUv:ct&&v(Z.map.channel),aoMapUv:Be&&v(Z.aoMap.channel),lightMapUv:fe&&v(Z.lightMap.channel),bumpMapUv:we&&v(Z.bumpMap.channel),normalMapUv:Pe&&v(Z.normalMap.channel),displacementMapUv:Fe&&v(Z.displacementMap.channel),emissiveMapUv:qe&&v(Z.emissiveMap.channel),metalnessMapUv:at&&v(Z.metalnessMap.channel),roughnessMapUv:nt&&v(Z.roughnessMap.channel),clearcoatMapUv:de&&v(Z.clearcoatMap.channel),clearcoatNormalMapUv:xe&&v(Z.clearcoatNormalMap.channel),clearcoatRoughnessMapUv:We&&v(Z.clearcoatRoughnessMap.channel),iridescenceMapUv:Ee&&v(Z.iridescenceMap.channel),iridescenceThicknessMapUv:lt&&v(Z.iridescenceThicknessMap.channel),sheenColorMapUv:Je&&v(Z.sheenColorMap.channel),sheenRoughnessMapUv:D&&v(Z.sheenRoughnessMap.channel),specularMapUv:$&&v(Z.specularMap.channel),specularColorMapUv:Ie&&v(Z.specularColorMap.channel),specularIntensityMapUv:ye&&v(Z.specularIntensityMap.channel),transmissionMapUv:be&&v(Z.transmissionMap.channel),thicknessMapUv:Se&&v(Z.thicknessMap.channel),alphaMapUv:Ye&&v(Z.alphaMap.channel),vertexTangents:Pe&&!!ie.attributes.tangent,vertexColors:Z.vertexColors,vertexAlphas:Z.vertexColors===!0&&!!ie.attributes.color&&ie.attributes.color.itemSize===4,vertexUv1s:ce,vertexUv2s:Ge,vertexUv3s:Ne,pointsUvs:U.isPoints===!0&&!!ie.attributes.uv&&(ct||Ye),fog:!!q,useFog:Z.fog===!0,fogExp2:q&&q.isFogExp2,flatShading:Z.flatShading===!0,sizeAttenuation:Z.sizeAttenuation===!0,logarithmicDepthBuffer:C,skinning:U.isSkinnedMesh===!0,morphTargets:ie.morphAttributes.position!==void 0,morphNormals:ie.morphAttributes.normal!==void 0,morphColors:ie.morphAttributes.color!==void 0,morphTargetsCount:le,morphTextureStride:se,numDirLights:V.directional.length,numPointLights:V.point.length,numSpotLights:V.spot.length,numSpotLightMaps:V.spotLightMap.length,numRectAreaLights:V.rectArea.length,numHemiLights:V.hemi.length,numDirLightShadows:V.directionalShadowMap.length,numPointLightShadows:V.pointShadowMap.length,numSpotLightShadows:V.spotShadowMap.length,numSpotLightShadowsWithMaps:V.numSpotLightShadowsWithMaps,numClippingPlanes:o.numPlanes,numClipIntersection:o.numIntersection,dithering:Z.dithering,shadowMapEnabled:n.shadowMap.enabled&&N.length>0,shadowMapType:n.shadowMap.type,toneMapping:Z.toneMapped?n.toneMapping:Ar,useLegacyLights:n.useLegacyLights,premultipliedAlpha:Z.premultipliedAlpha,doubleSided:Z.side===ts,flipSided:Z.side===Jn,useDepthPacking:Z.depthPacking>=0,depthPacking:Z.depthPacking||0,index0AttributeName:Z.index0AttributeName,extensionDerivatives:_&&Z.extensions.derivatives===!0,extensionFragDepth:_&&Z.extensions.fragDepth===!0,extensionDrawBuffers:_&&Z.extensions.drawBuffers===!0,extensionShaderTextureLOD:_&&Z.extensions.shaderTextureLOD===!0,rendererExtensionFragDepth:u||i.has("EXT_frag_depth"),rendererExtensionDrawBuffers:u||i.has("WEBGL_draw_buffers"),rendererExtensionShaderTextureLod:u||i.has("EXT_shader_texture_lod"),customProgramCacheKey:Z.customProgramCacheKey()}}function A(Z){const V=[];if(Z.shaderID?V.push(Z.shaderID):(V.push(Z.customVertexShaderID),V.push(Z.customFragmentShaderID)),Z.defines!==void 0)for(const N in Z.defines)V.push(N),V.push(Z.defines[N]);return Z.isRawShaderMaterial===!1&&(b(V,Z),m(V,Z),V.push(n.outputColorSpace)),V.push(Z.customProgramCacheKey),V.join()}function b(Z,V){Z.push(V.precision),Z.push(V.outputColorSpace),Z.push(V.envMapMode),Z.push(V.envMapCubeUVHeight),Z.push(V.mapUv),Z.push(V.alphaMapUv),Z.push(V.lightMapUv),Z.push(V.aoMapUv),Z.push(V.bumpMapUv),Z.push(V.normalMapUv),Z.push(V.displacementMapUv),Z.push(V.emissiveMapUv),Z.push(V.metalnessMapUv),Z.push(V.roughnessMapUv),Z.push(V.clearcoatMapUv),Z.push(V.clearcoatNormalMapUv),Z.push(V.clearcoatRoughnessMapUv),Z.push(V.iridescenceMapUv),Z.push(V.iridescenceThicknessMapUv),Z.push(V.sheenColorMapUv),Z.push(V.sheenRoughnessMapUv),Z.push(V.specularMapUv),Z.push(V.specularColorMapUv),Z.push(V.specularIntensityMapUv),Z.push(V.transmissionMapUv),Z.push(V.thicknessMapUv),Z.push(V.combine),Z.push(V.fogExp2),Z.push(V.sizeAttenuation),Z.push(V.morphTargetsCount),Z.push(V.morphAttributeCount),Z.push(V.numDirLights),Z.push(V.numPointLights),Z.push(V.numSpotLights),Z.push(V.numSpotLightMaps),Z.push(V.numHemiLights),Z.push(V.numRectAreaLights),Z.push(V.numDirLightShadows),Z.push(V.numPointLightShadows),Z.push(V.numSpotLightShadows),Z.push(V.numSpotLightShadowsWithMaps),Z.push(V.shadowMapType),Z.push(V.toneMapping),Z.push(V.numClippingPlanes),Z.push(V.numClipIntersection),Z.push(V.depthPacking)}function m(Z,V){a.disableAll(),V.isWebGL2&&a.enable(0),V.supportsVertexTextures&&a.enable(1),V.instancing&&a.enable(2),V.instancingColor&&a.enable(3),V.matcap&&a.enable(4),V.envMap&&a.enable(5),V.normalMapObjectSpace&&a.enable(6),V.normalMapTangentSpace&&a.enable(7),V.clearcoat&&a.enable(8),V.iridescence&&a.enable(9),V.alphaTest&&a.enable(10),V.vertexColors&&a.enable(11),V.vertexAlphas&&a.enable(12),V.vertexUv1s&&a.enable(13),V.vertexUv2s&&a.enable(14),V.vertexUv3s&&a.enable(15),V.vertexTangents&&a.enable(16),Z.push(a.mask),a.disableAll(),V.fog&&a.enable(0),V.useFog&&a.enable(1),V.flatShading&&a.enable(2),V.logarithmicDepthBuffer&&a.enable(3),V.skinning&&a.enable(4),V.morphTargets&&a.enable(5),V.morphNormals&&a.enable(6),V.morphColors&&a.enable(7),V.premultipliedAlpha&&a.enable(8),V.shadowMapEnabled&&a.enable(9),V.useLegacyLights&&a.enable(10),V.doubleSided&&a.enable(11),V.flipSided&&a.enable(12),V.useDepthPacking&&a.enable(13),V.dithering&&a.enable(14),V.transmission&&a.enable(15),V.sheen&&a.enable(16),V.opaque&&a.enable(17),V.pointsUvs&&a.enable(18),Z.push(a.mask)}function B(Z){const V=f[Z.type];let N;if(V){const P=Cr[V];N=XW.clone(P.uniforms)}else N=Z.uniforms;return N}function S(Z,V){let N;for(let P=0,U=g.length;P0?i.push(A):h.transparent===!0?s.push(A):t.push(A)}function l(C,d,h,f,v,y){const A=o(C,d,h,f,v,y);h.transmission>0?i.unshift(A):h.transparent===!0?s.unshift(A):t.unshift(A)}function g(C,d){t.length>1&&t.sort(C||GL),i.length>1&&i.sort(d||YZ),s.length>1&&s.sort(d||YZ)}function u(){for(let C=e,d=n.length;C=r.length?(o=new KZ,r.push(o)):o=r[s],o}function t(){n=new WeakMap}return{get:e,dispose:t}}function ZL(){const n={};return{get:function(e){if(n[e.id]!==void 0)return n[e.id];let t;switch(e.type){case"DirectionalLight":t={direction:new H,color:new Xe};break;case"SpotLight":t={position:new H,direction:new H,color:new Xe,distance:0,coneCos:0,penumbraCos:0,decay:0};break;case"PointLight":t={position:new H,color:new Xe,distance:0,decay:0};break;case"HemisphereLight":t={direction:new H,skyColor:new Xe,groundColor:new Xe};break;case"RectAreaLight":t={color:new Xe,position:new H,halfWidth:new H,halfHeight:new H};break}return n[e.id]=t,t}}}function wL(){const n={};return{get:function(e){if(n[e.id]!==void 0)return n[e.id];let t;switch(e.type){case"DirectionalLight":t={shadowBias:0,shadowNormalBias:0,shadowRadius:1,shadowMapSize:new oe};break;case"SpotLight":t={shadowBias:0,shadowNormalBias:0,shadowRadius:1,shadowMapSize:new oe};break;case"PointLight":t={shadowBias:0,shadowNormalBias:0,shadowRadius:1,shadowMapSize:new oe,shadowCameraNear:1,shadowCameraFar:1e3};break}return n[e.id]=t,t}}}let SL=0;function xL(n,e){return(e.castShadow?2:0)-(n.castShadow?2:0)+(e.map?1:0)-(n.map?1:0)}function RL(n,e){const t=new ZL,i=wL(),s={version:0,hash:{directionalLength:-1,pointLength:-1,spotLength:-1,rectAreaLength:-1,hemiLength:-1,numDirectionalShadows:-1,numPointShadows:-1,numSpotShadows:-1,numSpotMaps:-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};for(let u=0;u<9;u++)s.probe.push(new H);const r=new H,o=new _e,a=new _e;function l(u,C){let d=0,h=0,f=0;for(let N=0;N<9;N++)s.probe[N].set(0,0,0);let v=0,y=0,A=0,b=0,m=0,B=0,S=0,x=0,R=0,M=0;u.sort(xL);const Z=C===!0?Math.PI:1;for(let N=0,P=u.length;N0&&(e.isWebGL2||n.has("OES_texture_float_linear")===!0?(s.rectAreaLTC1=Le.LTC_FLOAT_1,s.rectAreaLTC2=Le.LTC_FLOAT_2):n.has("OES_texture_half_float_linear")===!0?(s.rectAreaLTC1=Le.LTC_HALF_1,s.rectAreaLTC2=Le.LTC_HALF_2):console.error("THREE.WebGLRenderer: Unable to use RectAreaLight. Missing WebGL extensions.")),s.ambient[0]=d,s.ambient[1]=h,s.ambient[2]=f;const V=s.hash;(V.directionalLength!==v||V.pointLength!==y||V.spotLength!==A||V.rectAreaLength!==b||V.hemiLength!==m||V.numDirectionalShadows!==B||V.numPointShadows!==S||V.numSpotShadows!==x||V.numSpotMaps!==R)&&(s.directional.length=v,s.spot.length=A,s.rectArea.length=b,s.point.length=y,s.hemi.length=m,s.directionalShadow.length=B,s.directionalShadowMap.length=B,s.pointShadow.length=S,s.pointShadowMap.length=S,s.spotShadow.length=x,s.spotShadowMap.length=x,s.directionalShadowMatrix.length=B,s.pointShadowMatrix.length=S,s.spotLightMatrix.length=x+R-M,s.spotLightMap.length=R,s.numSpotLightShadowsWithMaps=M,V.directionalLength=v,V.pointLength=y,V.spotLength=A,V.rectAreaLength=b,V.hemiLength=m,V.numDirectionalShadows=B,V.numPointShadows=S,V.numSpotShadows=x,V.numSpotMaps=R,s.version=SL++)}function g(u,C){let d=0,h=0,f=0,v=0,y=0;const A=C.matrixWorldInverse;for(let b=0,m=u.length;b=a.length?(l=new zZ(n,e),a.push(l)):l=a[o],l}function s(){t=new WeakMap}return{get:i,dispose:s}}class ap extends ei{constructor(e){super(),this.isMeshDepthMaterial=!0,this.type="MeshDepthMaterial",this.depthPacking=Tn,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 Iy extends ei{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 VL=`void main() { gl_Position = vec4( position, 1.0 ); }`,ML=`uniform sampler2D shadow_pass; uniform vec2 resolution; @@ -3479,7 +3479,7 @@ void main() { squared_mean = squared_mean / samples; float std_dev = sqrt( squared_mean - mean * mean ); gl_FragColor = pack2HalfToRGBA( vec2( mean, std_dev ) ); -}`;function NL(n,e,t){let i=new rp;const s=new oe,r=new oe,o=new Yt,a=new ap({depthPacking:Tr}),l=new Iy,g={},u=t.maxTextureSize,C={[Er]:Jn,[Jn]:Er,[ts]:ts},d=new Rt({defines:{VSM_SAMPLES:8},uniforms:{shadow_pass:{value:null},resolution:{value:new oe},radius:{value:4}},vertexShader:VL,fragmentShader:ML}),h=d.clone();h.defines.HORIZONTAL_PASS=1;const f=new Gt;f.setAttribute("position",new Jt(new Float32Array([-1,-1,.5,3,-1,.5,-1,3,.5]),3));const v=new On(f,d),y=this;this.enabled=!1,this.autoUpdate=!0,this.needsUpdate=!1,this.type=qA;let A=this.type;this.render=function(S,x,R){if(y.enabled===!1||y.autoUpdate===!1&&y.needsUpdate===!1||S.length===0)return;const M=n.getRenderTarget(),Z=n.getActiveCubeFace(),V=n.getActiveMipmapLevel(),N=n.state;N.setBlending(an),N.buffers.color.setClear(1,1,1,1),N.buffers.depth.setTest(!0),N.setScissorTest(!1);const P=A!==cr&&this.type===cr,U=A===cr&&this.type!==cr;for(let q=0,ie=S.length;qu||s.y>u)&&(s.x>u&&(r.x=Math.floor(u/z.x),s.x=r.x*z.x,Ce.mapSize.x=r.x),s.y>u&&(r.y=Math.floor(u/z.y),s.y=r.y*z.y,Ce.mapSize.y=r.y)),Ce.map===null||P===!0||U===!0){const J=this.type!==cr?{minFilter:vt,magFilter:vt}:{};Ce.map!==null&&Ce.map.dispose(),Ce.map=new Nt(s.x,s.y,J),Ce.map.texture.name=he.name+".shadowMap",Ce.camera.updateProjectionMatrix()}n.setRenderTarget(Ce.map),n.clear();const Q=Ce.getViewportCount();for(let J=0;J0||x.map&&x.alphaTest>0){const N=Z.uuid,P=x.uuid;let U=g[N];U===void 0&&(U={},g[N]=U);let q=U[P];q===void 0&&(q=Z.clone(),U[P]=q),Z=q}if(Z.visible=x.visible,Z.wireframe=x.wireframe,M===cr?Z.side=x.shadowSide!==null?x.shadowSide:x.side:Z.side=x.shadowSide!==null?x.shadowSide:C[x.side],Z.alphaMap=x.alphaMap,Z.alphaTest=x.alphaTest,Z.map=x.map,Z.clipShadows=x.clipShadows,Z.clippingPlanes=x.clippingPlanes,Z.clipIntersection=x.clipIntersection,Z.displacementMap=x.displacementMap,Z.displacementScale=x.displacementScale,Z.displacementBias=x.displacementBias,Z.wireframeLinewidth=x.wireframeLinewidth,Z.linewidth=x.linewidth,R.isPointLight===!0&&Z.isMeshDistanceMaterial===!0){const N=n.properties.get(Z);N.light=R}return Z}function B(S,x,R,M,Z){if(S.visible===!1)return;if(S.layers.test(x.layers)&&(S.isMesh||S.isLine||S.isPoints)&&(S.castShadow||S.receiveShadow&&Z===cr)&&(!S.frustumCulled||i.intersectsObject(S))){S.modelViewMatrix.multiplyMatrices(R.matrixWorldInverse,S.matrixWorld);const P=e.update(S),U=S.material;if(Array.isArray(U)){const q=P.groups;for(let ie=0,he=q.length;ie=1):z.indexOf("OpenGL ES")!==-1&&(Ce=parseFloat(/^OpenGL ES (\d)/.exec(z)[1]),he=Ce>=2);let Q=null,J={};const le=n.getParameter(n.SCISSOR_BOX),se=n.getParameter(n.VIEWPORT),te=new Yt().fromArray(le),ge=new Yt().fromArray(se);function Ze(_,ce,Ge,Ne){const Te=new Uint8Array(4),At=n.createTexture();n.bindTexture(_,At),n.texParameteri(_,n.TEXTURE_MIN_FILTER,n.NEAREST),n.texParameteri(_,n.TEXTURE_MAG_FILTER,n.NEAREST);for(let Xt=0;Xt"u"?!1:/OculusBrowser/g.test(navigator.userAgent),f=new WeakMap;let v;const y=new WeakMap;let A=!1;try{A=typeof OffscreenCanvas<"u"&&new OffscreenCanvas(1,1).getContext("2d")!==null}catch{}function b(T,X){return A?new OffscreenCanvas(T,X):Ku("canvas")}function m(T,X,de,xe){let We=1;if((T.width>xe||T.height>xe)&&(We=xe/Math.max(T.width,T.height)),We<1||X===!0)if(typeof HTMLImageElement<"u"&&T instanceof HTMLImageElement||typeof HTMLCanvasElement<"u"&&T instanceof HTMLCanvasElement||typeof ImageBitmap<"u"&&T instanceof ImageBitmap){const Ee=X?RW:Math.floor,lt=Ee(We*T.width),Je=Ee(We*T.height);v===void 0&&(v=b(lt,Je));const D=de?b(lt,Je):v;return D.width=lt,D.height=Je,D.getContext("2d").drawImage(T,0,0,lt,Je),console.warn("THREE.WebGLRenderer: Texture has been resized from ("+T.width+"x"+T.height+") to ("+lt+"x"+Je+")."),D}else return"data"in T&&console.warn("THREE.WebGLRenderer: Image in DataTexture is too big ("+T.width+"x"+T.height+")."),T;return T}function B(T){return Zb(T.width)&&Zb(T.height)}function S(T){return a?!1:T.wrapS!==Pn||T.wrapT!==Pn||T.minFilter!==vt&&T.minFilter!==st}function x(T,X){return T.generateMipmaps&&X&&T.minFilter!==vt&&T.minFilter!==st}function R(T){n.generateMipmap(T)}function M(T,X,de,xe,We=!1){if(a===!1)return X;if(T!==null){if(n[T]!==void 0)return n[T];console.warn("THREE.WebGLRenderer: Attempt to use non-existing WebGL internal format '"+T+"'")}let Ee=X;return X===n.RED&&(de===n.FLOAT&&(Ee=n.R32F),de===n.HALF_FLOAT&&(Ee=n.R16F),de===n.UNSIGNED_BYTE&&(Ee=n.R8)),X===n.RG&&(de===n.FLOAT&&(Ee=n.RG32F),de===n.HALF_FLOAT&&(Ee=n.RG16F),de===n.UNSIGNED_BYTE&&(Ee=n.RG8)),X===n.RGBA&&(de===n.FLOAT&&(Ee=n.RGBA32F),de===n.HALF_FLOAT&&(Ee=n.RGBA16F),de===n.UNSIGNED_BYTE&&(Ee=xe===yt&&We===!1?n.SRGB8_ALPHA8:n.RGBA8),de===n.UNSIGNED_SHORT_4_4_4_4&&(Ee=n.RGBA4),de===n.UNSIGNED_SHORT_5_5_5_1&&(Ee=n.RGB5_A1)),(Ee===n.R16F||Ee===n.R32F||Ee===n.RG16F||Ee===n.RG32F||Ee===n.RGBA16F||Ee===n.RGBA32F)&&e.get("EXT_color_buffer_float"),Ee}function Z(T,X,de){return x(T,de)===!0||T.isFramebufferTexture&&T.minFilter!==vt&&T.minFilter!==st?Math.log2(Math.max(X.width,X.height))+1:T.mipmaps!==void 0&&T.mipmaps.length>0?T.mipmaps.length:T.isCompressedTexture&&Array.isArray(T.image)?X.mipmaps.length:1}function V(T){return T===vt||T===SA||T===nu?n.NEAREST:n.LINEAR}function N(T){const X=T.target;X.removeEventListener("dispose",N),U(X),X.isVideoTexture&&f.delete(X)}function P(T){const X=T.target;X.removeEventListener("dispose",P),ie(X)}function U(T){const X=i.get(T);if(X.__webglInit===void 0)return;const de=T.source,xe=y.get(de);if(xe){const We=xe[X.__cacheKey];We.usedTimes--,We.usedTimes===0&&q(T),Object.keys(xe).length===0&&y.delete(de)}i.remove(T)}function q(T){const X=i.get(T);n.deleteTexture(X.__webglTexture);const de=T.source,xe=y.get(de);delete xe[X.__cacheKey],o.memory.textures--}function ie(T){const X=T.texture,de=i.get(T),xe=i.get(X);if(xe.__webglTexture!==void 0&&(n.deleteTexture(xe.__webglTexture),o.memory.textures--),T.depthTexture&&T.depthTexture.dispose(),T.isWebGLCubeRenderTarget)for(let We=0;We<6;We++)n.deleteFramebuffer(de.__webglFramebuffer[We]),de.__webglDepthbuffer&&n.deleteRenderbuffer(de.__webglDepthbuffer[We]);else{if(n.deleteFramebuffer(de.__webglFramebuffer),de.__webglDepthbuffer&&n.deleteRenderbuffer(de.__webglDepthbuffer),de.__webglMultisampledFramebuffer&&n.deleteFramebuffer(de.__webglMultisampledFramebuffer),de.__webglColorRenderbuffer)for(let We=0;We=l&&console.warn("THREE.WebGLTextures: Trying to use "+T+" texture units while this GPU supports only "+l),he+=1,T}function Q(T){const X=[];return X.push(T.wrapS),X.push(T.wrapT),X.push(T.wrapR||0),X.push(T.magFilter),X.push(T.minFilter),X.push(T.anisotropy),X.push(T.internalFormat),X.push(T.format),X.push(T.type),X.push(T.generateMipmaps),X.push(T.premultiplyAlpha),X.push(T.flipY),X.push(T.unpackAlignment),X.push(T.colorSpace),X.join()}function J(T,X){const de=i.get(T);if(T.isVideoTexture&&Ct(T),T.isRenderTargetTexture===!1&&T.version>0&&de.__version!==T.version){const xe=T.image;if(xe===null)console.warn("THREE.WebGLRenderer: Texture marked for update but no image data found.");else if(xe.complete===!1)console.warn("THREE.WebGLRenderer: Texture marked for update but image is incomplete");else{ot(de,T,X);return}}t.bindTexture(n.TEXTURE_2D,de.__webglTexture,n.TEXTURE0+X)}function le(T,X){const de=i.get(T);if(T.version>0&&de.__version!==T.version){ot(de,T,X);return}t.bindTexture(n.TEXTURE_2D_ARRAY,de.__webglTexture,n.TEXTURE0+X)}function se(T,X){const de=i.get(T);if(T.version>0&&de.__version!==T.version){ot(de,T,X);return}t.bindTexture(n.TEXTURE_3D,de.__webglTexture,n.TEXTURE0+X)}function te(T,X){const de=i.get(T);if(T.version>0&&de.__version!==T.version){ct(de,T,X);return}t.bindTexture(n.TEXTURE_CUBE_MAP,de.__webglTexture,n.TEXTURE0+X)}const ge={[Gs]:n.REPEAT,[Pn]:n.CLAMP_TO_EDGE,[Nu]:n.MIRRORED_REPEAT},Ze={[vt]:n.NEAREST,[SA]:n.NEAREST_MIPMAP_NEAREST,[nu]:n.NEAREST_MIPMAP_LINEAR,[st]:n.LINEAR,[$v]:n.LINEAR_MIPMAP_NEAREST,[ba]:n.LINEAR_MIPMAP_LINEAR};function Re(T,X,de){if(de?(n.texParameteri(T,n.TEXTURE_WRAP_S,ge[X.wrapS]),n.texParameteri(T,n.TEXTURE_WRAP_T,ge[X.wrapT]),(T===n.TEXTURE_3D||T===n.TEXTURE_2D_ARRAY)&&n.texParameteri(T,n.TEXTURE_WRAP_R,ge[X.wrapR]),n.texParameteri(T,n.TEXTURE_MAG_FILTER,Ze[X.magFilter]),n.texParameteri(T,n.TEXTURE_MIN_FILTER,Ze[X.minFilter])):(n.texParameteri(T,n.TEXTURE_WRAP_S,n.CLAMP_TO_EDGE),n.texParameteri(T,n.TEXTURE_WRAP_T,n.CLAMP_TO_EDGE),(T===n.TEXTURE_3D||T===n.TEXTURE_2D_ARRAY)&&n.texParameteri(T,n.TEXTURE_WRAP_R,n.CLAMP_TO_EDGE),(X.wrapS!==Pn||X.wrapT!==Pn)&&console.warn("THREE.WebGLRenderer: Texture is not power of two. Texture.wrapS and Texture.wrapT should be set to THREE.ClampToEdgeWrapping."),n.texParameteri(T,n.TEXTURE_MAG_FILTER,V(X.magFilter)),n.texParameteri(T,n.TEXTURE_MIN_FILTER,V(X.minFilter)),X.minFilter!==vt&&X.minFilter!==st&&console.warn("THREE.WebGLRenderer: Texture is not power of two. Texture.minFilter should be set to THREE.NearestFilter or THREE.LinearFilter.")),e.has("EXT_texture_filter_anisotropic")===!0){const xe=e.get("EXT_texture_filter_anisotropic");if(X.magFilter===vt||X.minFilter!==nu&&X.minFilter!==ba||X.type===Wn&&e.has("OES_texture_float_linear")===!1||a===!1&&X.type===bs&&e.has("OES_texture_half_float_linear")===!1)return;(X.anisotropy>1||i.get(X).__currentAnisotropy)&&(n.texParameterf(T,xe.TEXTURE_MAX_ANISOTROPY_EXT,Math.min(X.anisotropy,s.getMaxAnisotropy())),i.get(X).__currentAnisotropy=X.anisotropy)}}function O(T,X){let de=!1;T.__webglInit===void 0&&(T.__webglInit=!0,X.addEventListener("dispose",N));const xe=X.source;let We=y.get(xe);We===void 0&&(We={},y.set(xe,We));const Ee=Q(X);if(Ee!==T.__cacheKey){We[Ee]===void 0&&(We[Ee]={texture:n.createTexture(),usedTimes:0},o.memory.textures++,de=!0),We[Ee].usedTimes++;const lt=We[T.__cacheKey];lt!==void 0&&(We[T.__cacheKey].usedTimes--,lt.usedTimes===0&&q(X)),T.__cacheKey=Ee,T.__webglTexture=We[Ee].texture}return de}function ot(T,X,de){let xe=n.TEXTURE_2D;(X.isDataArrayTexture||X.isCompressedArrayTexture)&&(xe=n.TEXTURE_2D_ARRAY),X.isData3DTexture&&(xe=n.TEXTURE_3D);const We=O(T,X),Ee=X.source;t.bindTexture(xe,T.__webglTexture,n.TEXTURE0+de);const lt=i.get(Ee);if(Ee.version!==lt.__version||We===!0){t.activeTexture(n.TEXTURE0+de),n.pixelStorei(n.UNPACK_FLIP_Y_WEBGL,X.flipY),n.pixelStorei(n.UNPACK_PREMULTIPLY_ALPHA_WEBGL,X.premultiplyAlpha),n.pixelStorei(n.UNPACK_ALIGNMENT,X.unpackAlignment),n.pixelStorei(n.UNPACK_COLORSPACE_CONVERSION_WEBGL,n.NONE);const Je=S(X)&&B(X.image)===!1;let D=m(X.image,Je,!1,u);D=Ht(X,D);const $=B(D)||a,Ie=r.convert(X.format,X.colorSpace);let ye=r.convert(X.type),be=M(X.internalFormat,Ie,ye,X.colorSpace);Re(xe,X,$);let Se;const ze=X.mipmaps,Ye=a&&X.isVideoTexture!==!0,Ke=lt.__version===void 0||We===!0,_=Z(X,D,$);if(X.isDepthTexture)be=n.DEPTH_COMPONENT,a?X.type===Wn?be=n.DEPTH_COMPONENT32F:X.type===Ao?be=n.DEPTH_COMPONENT24:X.type===da?be=n.DEPTH24_STENCIL8:be=n.DEPTH_COMPONENT16:X.type===Wn&&console.error("WebGLRenderer: Floating point depth texture requires WebGL2."),X.format===ha&&be===n.DEPTH_COMPONENT&&X.type!==ey&&X.type!==Ao&&(console.warn("THREE.WebGLRenderer: Use UnsignedShortType or UnsignedIntType for DepthFormat DepthTexture."),X.type=Ao,ye=r.convert(X.type)),X.format===va&&be===n.DEPTH_COMPONENT&&(be=n.DEPTH_STENCIL,X.type!==da&&(console.warn("THREE.WebGLRenderer: Use UnsignedInt248Type for DepthStencilFormat DepthTexture."),X.type=da,ye=r.convert(X.type))),Ke&&(Ye?t.texStorage2D(n.TEXTURE_2D,1,be,D.width,D.height):t.texImage2D(n.TEXTURE_2D,0,be,D.width,D.height,0,Ie,ye,null));else if(X.isDataTexture)if(ze.length>0&&$){Ye&&Ke&&t.texStorage2D(n.TEXTURE_2D,_,be,ze[0].width,ze[0].height);for(let ce=0,Ge=ze.length;ce>=1,Ge>>=1}}else if(ze.length>0&&$){Ye&&Ke&&t.texStorage2D(n.TEXTURE_2D,_,be,ze[0].width,ze[0].height);for(let ce=0,Ge=ze.length;ce0&&Ke++,t.texStorage2D(n.TEXTURE_CUBE_MAP,Ke,Se,D[0].width,D[0].height));for(let ce=0;ce<6;ce++)if(Je){ze?t.texSubImage2D(n.TEXTURE_CUBE_MAP_POSITIVE_X+ce,0,0,0,D[ce].width,D[ce].height,ye,be,D[ce].data):t.texImage2D(n.TEXTURE_CUBE_MAP_POSITIVE_X+ce,0,Se,D[ce].width,D[ce].height,0,ye,be,D[ce].data);for(let Ge=0;Ge<_.length;Ge++){const Te=_[Ge].image[ce].image;ze?t.texSubImage2D(n.TEXTURE_CUBE_MAP_POSITIVE_X+ce,Ge+1,0,0,Te.width,Te.height,ye,be,Te.data):t.texImage2D(n.TEXTURE_CUBE_MAP_POSITIVE_X+ce,Ge+1,Se,Te.width,Te.height,0,ye,be,Te.data)}}else{ze?t.texSubImage2D(n.TEXTURE_CUBE_MAP_POSITIVE_X+ce,0,0,0,ye,be,D[ce]):t.texImage2D(n.TEXTURE_CUBE_MAP_POSITIVE_X+ce,0,Se,ye,be,D[ce]);for(let Ge=0;Ge<_.length;Ge++){const Ne=_[Ge];ze?t.texSubImage2D(n.TEXTURE_CUBE_MAP_POSITIVE_X+ce,Ge+1,0,0,ye,be,Ne.image[ce]):t.texImage2D(n.TEXTURE_CUBE_MAP_POSITIVE_X+ce,Ge+1,Se,ye,be,Ne.image[ce])}}}x(X,Ie)&&R(n.TEXTURE_CUBE_MAP),Ee.__version=We.version,X.onUpdate&&X.onUpdate(X)}T.__version=X.version}function Me(T,X,de,xe,We){const Ee=r.convert(de.format,de.colorSpace),lt=r.convert(de.type),Je=M(de.internalFormat,Ee,lt,de.colorSpace);i.get(X).__hasExternalTextures||(We===n.TEXTURE_3D||We===n.TEXTURE_2D_ARRAY?t.texImage3D(We,0,Je,X.width,X.height,X.depth,0,Ee,lt,null):t.texImage2D(We,0,Je,X.width,X.height,0,Ee,lt,null)),t.bindFramebuffer(n.FRAMEBUFFER,T),nt(X)?d.framebufferTexture2DMultisampleEXT(n.FRAMEBUFFER,xe,We,i.get(de).__webglTexture,0,at(X)):(We===n.TEXTURE_2D||We>=n.TEXTURE_CUBE_MAP_POSITIVE_X&&We<=n.TEXTURE_CUBE_MAP_NEGATIVE_Z)&&n.framebufferTexture2D(n.FRAMEBUFFER,xe,We,i.get(de).__webglTexture,0),t.bindFramebuffer(n.FRAMEBUFFER,null)}function Ue(T,X,de){if(n.bindRenderbuffer(n.RENDERBUFFER,T),X.depthBuffer&&!X.stencilBuffer){let xe=n.DEPTH_COMPONENT16;if(de||nt(X)){const We=X.depthTexture;We&&We.isDepthTexture&&(We.type===Wn?xe=n.DEPTH_COMPONENT32F:We.type===Ao&&(xe=n.DEPTH_COMPONENT24));const Ee=at(X);nt(X)?d.renderbufferStorageMultisampleEXT(n.RENDERBUFFER,Ee,xe,X.width,X.height):n.renderbufferStorageMultisample(n.RENDERBUFFER,Ee,xe,X.width,X.height)}else n.renderbufferStorage(n.RENDERBUFFER,xe,X.width,X.height);n.framebufferRenderbuffer(n.FRAMEBUFFER,n.DEPTH_ATTACHMENT,n.RENDERBUFFER,T)}else if(X.depthBuffer&&X.stencilBuffer){const xe=at(X);de&&nt(X)===!1?n.renderbufferStorageMultisample(n.RENDERBUFFER,xe,n.DEPTH24_STENCIL8,X.width,X.height):nt(X)?d.renderbufferStorageMultisampleEXT(n.RENDERBUFFER,xe,n.DEPTH24_STENCIL8,X.width,X.height):n.renderbufferStorage(n.RENDERBUFFER,n.DEPTH_STENCIL,X.width,X.height),n.framebufferRenderbuffer(n.FRAMEBUFFER,n.DEPTH_STENCIL_ATTACHMENT,n.RENDERBUFFER,T)}else{const xe=X.isWebGLMultipleRenderTargets===!0?X.texture:[X.texture];for(let We=0;We0&&nt(T)===!1){const Je=Ee?X:[X];de.__webglMultisampledFramebuffer=n.createFramebuffer(),de.__webglColorRenderbuffer=[],t.bindFramebuffer(n.FRAMEBUFFER,de.__webglMultisampledFramebuffer);for(let D=0;D0&&nt(T)===!1){const X=T.isWebGLMultipleRenderTargets?T.texture:[T.texture],de=T.width,xe=T.height;let We=n.COLOR_BUFFER_BIT;const Ee=[],lt=T.stencilBuffer?n.DEPTH_STENCIL_ATTACHMENT:n.DEPTH_ATTACHMENT,Je=i.get(T),D=T.isWebGLMultipleRenderTargets===!0;if(D)for(let $=0;$0&&e.has("WEBGL_multisampled_render_to_texture")===!0&&X.__useRenderToTexture!==!1}function Ct(T){const X=o.render.frame;f.get(T)!==X&&(f.set(T,X),T.update())}function Ht(T,X){const de=T.colorSpace,xe=T.format,We=T.type;return T.isCompressedTexture===!0||T.format===RA||de!==fr&&de!==vo&&(de===yt?a===!1?e.has("EXT_sRGB")===!0&&xe===An?(T.format=RA,T.minFilter=st,T.generateMipmaps=!1):X=oy.sRGBToLinear(X):(xe!==An||We!==cn)&&console.warn("THREE.WebGLTextures: sRGB encoded textures have to use RGBAFormat and UnsignedByteType."):console.error("THREE.WebGLTextures: Unsupported texture color space:",de)),X}this.allocateTextureUnit=z,this.resetTextureUnits=Ce,this.setTexture2D=J,this.setTexture2DArray=le,this.setTexture3D=se,this.setTextureCube=te,this.rebindTextures=we,this.setupRenderTarget=Pe,this.updateRenderTargetMipmap=Fe,this.updateMultisampleRenderTarget=qe,this.setupDepthRenderbuffer=fe,this.setupFrameBufferTexture=Me,this.useMultisampledRTT=nt}function EW(n,e,t){const i=t.isWebGL2;function s(r,o=vo){let a;if(r===cn)return n.UNSIGNED_BYTE;if(r===CW)return n.UNSIGNED_SHORT_4_4_4_4;if(r===dW)return n.UNSIGNED_SHORT_5_5_5_1;if(r===cW)return n.BYTE;if(r===IW)return n.SHORT;if(r===ey)return n.UNSIGNED_SHORT;if(r===uW)return n.INT;if(r===Ao)return n.UNSIGNED_INT;if(r===Wn)return n.FLOAT;if(r===bs)return i?n.HALF_FLOAT:(a=e.get("OES_texture_half_float"),a!==null?a.HALF_FLOAT_OES:null);if(r===hW)return n.ALPHA;if(r===An)return n.RGBA;if(r===tp)return n.LUMINANCE;if(r===AW)return n.LUMINANCE_ALPHA;if(r===ha)return n.DEPTH_COMPONENT;if(r===va)return n.DEPTH_STENCIL;if(r===RA)return a=e.get("EXT_sRGB"),a!==null?a.SRGB_ALPHA_EXT:null;if(r===ty)return n.RED;if(r===pW)return n.RED_INTEGER;if(r===ny)return n.RG;if(r===fW)return n.RG_INTEGER;if(r===mW)return n.RGBA_INTEGER;if(r===Uh||r===Ph||r===_h||r===Jh)if(o===yt)if(a=e.get("WEBGL_compressed_texture_s3tc_srgb"),a!==null){if(r===Uh)return a.COMPRESSED_SRGB_S3TC_DXT1_EXT;if(r===Ph)return a.COMPRESSED_SRGB_ALPHA_S3TC_DXT1_EXT;if(r===_h)return a.COMPRESSED_SRGB_ALPHA_S3TC_DXT3_EXT;if(r===Jh)return a.COMPRESSED_SRGB_ALPHA_S3TC_DXT5_EXT}else return null;else if(a=e.get("WEBGL_compressed_texture_s3tc"),a!==null){if(r===Uh)return a.COMPRESSED_RGB_S3TC_DXT1_EXT;if(r===Ph)return a.COMPRESSED_RGBA_S3TC_DXT1_EXT;if(r===_h)return a.COMPRESSED_RGBA_S3TC_DXT3_EXT;if(r===Jh)return a.COMPRESSED_RGBA_S3TC_DXT5_EXT}else return null;if(r===nb||r===ib||r===sb||r===rb)if(a=e.get("WEBGL_compressed_texture_pvrtc"),a!==null){if(r===nb)return a.COMPRESSED_RGB_PVRTC_4BPPV1_IMG;if(r===ib)return a.COMPRESSED_RGB_PVRTC_2BPPV1_IMG;if(r===sb)return a.COMPRESSED_RGBA_PVRTC_4BPPV1_IMG;if(r===rb)return a.COMPRESSED_RGBA_PVRTC_2BPPV1_IMG}else return null;if(r===bW)return a=e.get("WEBGL_compressed_texture_etc1"),a!==null?a.COMPRESSED_RGB_ETC1_WEBGL:null;if(r===ob||r===ab)if(a=e.get("WEBGL_compressed_texture_etc"),a!==null){if(r===ob)return o===yt?a.COMPRESSED_SRGB8_ETC2:a.COMPRESSED_RGB8_ETC2;if(r===ab)return o===yt?a.COMPRESSED_SRGB8_ALPHA8_ETC2_EAC:a.COMPRESSED_RGBA8_ETC2_EAC}else return null;if(r===lb||r===gb||r===cb||r===Ib||r===ub||r===Cb||r===db||r===hb||r===Ab||r===pb||r===fb||r===mb||r===bb||r===vb)if(a=e.get("WEBGL_compressed_texture_astc"),a!==null){if(r===lb)return o===yt?a.COMPRESSED_SRGB8_ALPHA8_ASTC_4x4_KHR:a.COMPRESSED_RGBA_ASTC_4x4_KHR;if(r===gb)return o===yt?a.COMPRESSED_SRGB8_ALPHA8_ASTC_5x4_KHR:a.COMPRESSED_RGBA_ASTC_5x4_KHR;if(r===cb)return o===yt?a.COMPRESSED_SRGB8_ALPHA8_ASTC_5x5_KHR:a.COMPRESSED_RGBA_ASTC_5x5_KHR;if(r===Ib)return o===yt?a.COMPRESSED_SRGB8_ALPHA8_ASTC_6x5_KHR:a.COMPRESSED_RGBA_ASTC_6x5_KHR;if(r===ub)return o===yt?a.COMPRESSED_SRGB8_ALPHA8_ASTC_6x6_KHR:a.COMPRESSED_RGBA_ASTC_6x6_KHR;if(r===Cb)return o===yt?a.COMPRESSED_SRGB8_ALPHA8_ASTC_8x5_KHR:a.COMPRESSED_RGBA_ASTC_8x5_KHR;if(r===db)return o===yt?a.COMPRESSED_SRGB8_ALPHA8_ASTC_8x6_KHR:a.COMPRESSED_RGBA_ASTC_8x6_KHR;if(r===hb)return o===yt?a.COMPRESSED_SRGB8_ALPHA8_ASTC_8x8_KHR:a.COMPRESSED_RGBA_ASTC_8x8_KHR;if(r===Ab)return o===yt?a.COMPRESSED_SRGB8_ALPHA8_ASTC_10x5_KHR:a.COMPRESSED_RGBA_ASTC_10x5_KHR;if(r===pb)return o===yt?a.COMPRESSED_SRGB8_ALPHA8_ASTC_10x6_KHR:a.COMPRESSED_RGBA_ASTC_10x6_KHR;if(r===fb)return o===yt?a.COMPRESSED_SRGB8_ALPHA8_ASTC_10x8_KHR:a.COMPRESSED_RGBA_ASTC_10x8_KHR;if(r===mb)return o===yt?a.COMPRESSED_SRGB8_ALPHA8_ASTC_10x10_KHR:a.COMPRESSED_RGBA_ASTC_10x10_KHR;if(r===bb)return o===yt?a.COMPRESSED_SRGB8_ALPHA8_ASTC_12x10_KHR:a.COMPRESSED_RGBA_ASTC_12x10_KHR;if(r===vb)return o===yt?a.COMPRESSED_SRGB8_ALPHA8_ASTC_12x12_KHR:a.COMPRESSED_RGBA_ASTC_12x12_KHR}else return null;if(r===Oh)if(a=e.get("EXT_texture_compression_bptc"),a!==null){if(r===Oh)return o===yt?a.COMPRESSED_SRGB_ALPHA_BPTC_UNORM_EXT:a.COMPRESSED_RGBA_BPTC_UNORM_EXT}else return null;if(r===vW||r===yb||r===Gb||r===Bb)if(a=e.get("EXT_texture_compression_rgtc"),a!==null){if(r===Oh)return a.COMPRESSED_RED_RGTC1_EXT;if(r===yb)return a.COMPRESSED_SIGNED_RED_RGTC1_EXT;if(r===Gb)return a.COMPRESSED_RED_GREEN_RGTC2_EXT;if(r===Bb)return a.COMPRESSED_SIGNED_RED_GREEN_RGTC2_EXT}else return null;return r===da?i?n.UNSIGNED_INT_24_8:(a=e.get("WEBGL_depth_texture"),a!==null?a.UNSIGNED_INT_24_8_WEBGL:null):n[r]!==void 0?n[r]:null}return{convert:s}}class TW extends mn{constructor(e=[]){super(),this.isArrayCamera=!0,this.cameras=e}}class Pg extends zt{constructor(){super(),this.isGroup=!0,this.type="Group"}}const FL={type:"move"};class vm{constructor(){this._targetRay=null,this._grip=null,this._hand=null}getHandSpace(){return this._hand===null&&(this._hand=new Pg,this._hand.matrixAutoUpdate=!1,this._hand.visible=!1,this._hand.joints={},this._hand.inputState={pinching:!1}),this._hand}getTargetRaySpace(){return this._targetRay===null&&(this._targetRay=new Pg,this._targetRay.matrixAutoUpdate=!1,this._targetRay.visible=!1,this._targetRay.hasLinearVelocity=!1,this._targetRay.linearVelocity=new H,this._targetRay.hasAngularVelocity=!1,this._targetRay.angularVelocity=new H),this._targetRay}getGripSpace(){return this._grip===null&&(this._grip=new Pg,this._grip.matrixAutoUpdate=!1,this._grip.visible=!1,this._grip.hasLinearVelocity=!1,this._grip.linearVelocity=new H,this._grip.hasAngularVelocity=!1,this._grip.angularVelocity=new H),this._grip}dispatchEvent(e){return this._targetRay!==null&&this._targetRay.dispatchEvent(e),this._grip!==null&&this._grip.dispatchEvent(e),this._hand!==null&&this._hand.dispatchEvent(e),this}connect(e){if(e&&e.hand){const t=this._hand;if(t)for(const i of e.hand.values())this._getHandJoint(t,i)}return this.dispatchEvent({type:"connected",data:e}),this}disconnect(e){return this.dispatchEvent({type:"disconnected",data:e}),this._targetRay!==null&&(this._targetRay.visible=!1),this._grip!==null&&(this._grip.visible=!1),this._hand!==null&&(this._hand.visible=!1),this}update(e,t,i){let s=null,r=null,o=null;const a=this._targetRay,l=this._grip,g=this._hand;if(e&&t.session.visibilityState!=="visible-blurred"){if(g&&e.hand){o=!0;for(const v of e.hand.values()){const y=t.getJointPose(v,i),A=this._getHandJoint(g,v);y!==null&&(A.matrix.fromArray(y.transform.matrix),A.matrix.decompose(A.position,A.rotation,A.scale),A.matrixWorldNeedsUpdate=!0,A.jointRadius=y.radius),A.visible=y!==null}const u=g.joints["index-finger-tip"],C=g.joints["thumb-tip"],d=u.position.distanceTo(C.position),h=.02,f=.005;g.inputState.pinching&&d>h+f?(g.inputState.pinching=!1,this.dispatchEvent({type:"pinchend",handedness:e.handedness,target:this})):!g.inputState.pinching&&d<=h-f&&(g.inputState.pinching=!0,this.dispatchEvent({type:"pinchstart",handedness:e.handedness,target:this}))}else l!==null&&e.gripSpace&&(r=t.getPose(e.gripSpace,i),r!==null&&(l.matrix.fromArray(r.transform.matrix),l.matrix.decompose(l.position,l.rotation,l.scale),l.matrixWorldNeedsUpdate=!0,r.linearVelocity?(l.hasLinearVelocity=!0,l.linearVelocity.copy(r.linearVelocity)):l.hasLinearVelocity=!1,r.angularVelocity?(l.hasAngularVelocity=!0,l.angularVelocity.copy(r.angularVelocity)):l.hasAngularVelocity=!1));a!==null&&(s=t.getPose(e.targetRaySpace,i),s===null&&r!==null&&(s=r),s!==null&&(a.matrix.fromArray(s.transform.matrix),a.matrix.decompose(a.position,a.rotation,a.scale),a.matrixWorldNeedsUpdate=!0,s.linearVelocity?(a.hasLinearVelocity=!0,a.linearVelocity.copy(s.linearVelocity)):a.hasLinearVelocity=!1,s.angularVelocity?(a.hasAngularVelocity=!0,a.angularVelocity.copy(s.angularVelocity)):a.hasAngularVelocity=!1,this.dispatchEvent(FL)))}return a!==null&&(a.visible=s!==null),l!==null&&(l.visible=r!==null),g!==null&&(g.visible=o!==null),this}_getHandJoint(e,t){if(e.joints[t.jointName]===void 0){const i=new Pg;i.matrixAutoUpdate=!1,i.visible=!1,e.joints[t.jointName]=i,e.add(i)}return e.joints[t.jointName]}}class lp extends sn{constructor(e,t,i,s,r,o,a,l,g,u){if(u=u!==void 0?u:ha,u!==ha&&u!==va)throw new Error("DepthTexture format must be either THREE.DepthFormat or THREE.DepthStencilFormat");i===void 0&&u===ha&&(i=Ao),i===void 0&&u===va&&(i=da),super(null,s,r,o,a,l,u,i,g),this.isDepthTexture=!0,this.image={width:e,height:t},this.magFilter=a!==void 0?a:vt,this.minFilter=l!==void 0?l:vt,this.flipY=!1,this.generateMipmaps=!1}}class YL extends Ps{constructor(e,t){super();const i=this;let s=null,r=1,o=null,a="local-floor",l=1,g=null,u=null,C=null,d=null,h=null,f=null;const v=t.getContextAttributes();let y=null,A=null;const b=[],m=[],B=new Set,S=new Map,x=new mn;x.layers.enable(1),x.viewport=new Yt;const R=new mn;R.layers.enable(2),R.viewport=new Yt;const M=[x,R],Z=new TW;Z.layers.enable(1),Z.layers.enable(2);let V=null,N=null;this.cameraAutoUpdate=!0,this.enabled=!1,this.isPresenting=!1,this.getController=function(te){let ge=b[te];return ge===void 0&&(ge=new vm,b[te]=ge),ge.getTargetRaySpace()},this.getControllerGrip=function(te){let ge=b[te];return ge===void 0&&(ge=new vm,b[te]=ge),ge.getGripSpace()},this.getHand=function(te){let ge=b[te];return ge===void 0&&(ge=new vm,b[te]=ge),ge.getHandSpace()};function P(te){const ge=m.indexOf(te.inputSource);if(ge===-1)return;const Ze=b[ge];Ze!==void 0&&(Ze.update(te.inputSource,te.frame,g||o),Ze.dispatchEvent({type:te.type,data:te.inputSource}))}function U(){s.removeEventListener("select",P),s.removeEventListener("selectstart",P),s.removeEventListener("selectend",P),s.removeEventListener("squeeze",P),s.removeEventListener("squeezestart",P),s.removeEventListener("squeezeend",P),s.removeEventListener("end",U),s.removeEventListener("inputsourceschange",q);for(let te=0;te=0&&(m[Re]=null,b[Re].disconnect(Ze))}for(let ge=0;ge=m.length){m.push(Ze),Re=ot;break}else if(m[ot]===null){m[ot]=Ze,Re=ot;break}if(Re===-1)break}const O=b[Re];O&&O.connect(Ze)}}const ie=new H,he=new H;function Ce(te,ge,Ze){ie.setFromMatrixPosition(ge.matrixWorld),he.setFromMatrixPosition(Ze.matrixWorld);const Re=ie.distanceTo(he),O=ge.projectionMatrix.elements,ot=Ze.projectionMatrix.elements,ct=O[14]/(O[10]-1),Me=O[14]/(O[10]+1),Ue=(O[9]+1)/O[5],Be=(O[9]-1)/O[5],fe=(O[8]-1)/O[0],we=(ot[8]+1)/ot[0],Pe=ct*fe,Fe=ct*we,qe=Re/(-fe+we),at=qe*-fe;ge.matrixWorld.decompose(te.position,te.quaternion,te.scale),te.translateX(at),te.translateZ(qe),te.matrixWorld.compose(te.position,te.quaternion,te.scale),te.matrixWorldInverse.copy(te.matrixWorld).invert();const nt=ct+qe,Ct=Me+qe,Ht=Pe-at,T=Fe+(Re-at),X=Ue*Me/Ct*nt,de=Be*Me/Ct*nt;te.projectionMatrix.makePerspective(Ht,T,X,de,nt,Ct),te.projectionMatrixInverse.copy(te.projectionMatrix).invert()}function z(te,ge){ge===null?te.matrixWorld.copy(te.matrix):te.matrixWorld.multiplyMatrices(ge.matrixWorld,te.matrix),te.matrixWorldInverse.copy(te.matrixWorld).invert()}this.updateCamera=function(te){if(s===null)return;Z.near=R.near=x.near=te.near,Z.far=R.far=x.far=te.far,(V!==Z.near||N!==Z.far)&&(s.updateRenderState({depthNear:Z.near,depthFar:Z.far}),V=Z.near,N=Z.far);const ge=te.parent,Ze=Z.cameras;z(Z,ge);for(let Re=0;ReO&&(S.set(Re,Re.lastChangedTime),i.dispatchEvent({type:"planechanged",data:Re}))}}f=null}const se=new FW;se.setAnimationLoop(le),this.setAnimationLoop=function(te){J=te},this.dispose=function(){}}}function KL(n,e){function t(y,A){y.matrixAutoUpdate===!0&&y.updateMatrix(),A.value.copy(y.matrix)}function i(y,A){A.color.getRGB(y.fogColor.value,HW(n)),A.isFog?(y.fogNear.value=A.near,y.fogFar.value=A.far):A.isFogExp2&&(y.fogDensity.value=A.density)}function s(y,A,b,m,B){A.isMeshBasicMaterial||A.isMeshLambertMaterial?r(y,A):A.isMeshToonMaterial?(r(y,A),C(y,A)):A.isMeshPhongMaterial?(r(y,A),u(y,A)):A.isMeshStandardMaterial?(r(y,A),d(y,A),A.isMeshPhysicalMaterial&&h(y,A,B)):A.isMeshMatcapMaterial?(r(y,A),f(y,A)):A.isMeshDepthMaterial?r(y,A):A.isMeshDistanceMaterial?(r(y,A),v(y,A)):A.isMeshNormalMaterial?r(y,A):A.isLineBasicMaterial?(o(y,A),A.isLineDashedMaterial&&a(y,A)):A.isPointsMaterial?l(y,A,b,m):A.isSpriteMaterial?g(y,A):A.isShadowMaterial?(y.color.value.copy(A.color),y.opacity.value=A.opacity):A.isShaderMaterial&&(A.uniformsNeedUpdate=!1)}function r(y,A){y.opacity.value=A.opacity,A.color&&y.diffuse.value.copy(A.color),A.emissive&&y.emissive.value.copy(A.emissive).multiplyScalar(A.emissiveIntensity),A.map&&(y.map.value=A.map,t(A.map,y.mapTransform)),A.alphaMap&&(y.alphaMap.value=A.alphaMap,t(A.alphaMap,y.alphaMapTransform)),A.bumpMap&&(y.bumpMap.value=A.bumpMap,t(A.bumpMap,y.bumpMapTransform),y.bumpScale.value=A.bumpScale,A.side===Jn&&(y.bumpScale.value*=-1)),A.normalMap&&(y.normalMap.value=A.normalMap,t(A.normalMap,y.normalMapTransform),y.normalScale.value.copy(A.normalScale),A.side===Jn&&y.normalScale.value.negate()),A.displacementMap&&(y.displacementMap.value=A.displacementMap,t(A.displacementMap,y.displacementMapTransform),y.displacementScale.value=A.displacementScale,y.displacementBias.value=A.displacementBias),A.emissiveMap&&(y.emissiveMap.value=A.emissiveMap,t(A.emissiveMap,y.emissiveMapTransform)),A.specularMap&&(y.specularMap.value=A.specularMap,t(A.specularMap,y.specularMapTransform)),A.alphaTest>0&&(y.alphaTest.value=A.alphaTest);const b=e.get(A).envMap;if(b&&(y.envMap.value=b,y.flipEnvMap.value=b.isCubeTexture&&b.isRenderTargetTexture===!1?-1:1,y.reflectivity.value=A.reflectivity,y.ior.value=A.ior,y.refractionRatio.value=A.refractionRatio),A.lightMap){y.lightMap.value=A.lightMap;const m=n.useLegacyLights===!0?Math.PI:1;y.lightMapIntensity.value=A.lightMapIntensity*m,t(A.lightMap,y.lightMapTransform)}A.aoMap&&(y.aoMap.value=A.aoMap,y.aoMapIntensity.value=A.aoMapIntensity,t(A.aoMap,y.aoMapTransform))}function o(y,A){y.diffuse.value.copy(A.color),y.opacity.value=A.opacity,A.map&&(y.map.value=A.map,t(A.map,y.mapTransform))}function a(y,A){y.dashSize.value=A.dashSize,y.totalSize.value=A.dashSize+A.gapSize,y.scale.value=A.scale}function l(y,A,b,m){y.diffuse.value.copy(A.color),y.opacity.value=A.opacity,y.size.value=A.size*b,y.scale.value=m*.5,A.map&&(y.map.value=A.map,t(A.map,y.uvTransform)),A.alphaMap&&(y.alphaMap.value=A.alphaMap),A.alphaTest>0&&(y.alphaTest.value=A.alphaTest)}function g(y,A){y.diffuse.value.copy(A.color),y.opacity.value=A.opacity,y.rotation.value=A.rotation,A.map&&(y.map.value=A.map,t(A.map,y.mapTransform)),A.alphaMap&&(y.alphaMap.value=A.alphaMap),A.alphaTest>0&&(y.alphaTest.value=A.alphaTest)}function u(y,A){y.specular.value.copy(A.specular),y.shininess.value=Math.max(A.shininess,1e-4)}function C(y,A){A.gradientMap&&(y.gradientMap.value=A.gradientMap)}function d(y,A){y.metalness.value=A.metalness,A.metalnessMap&&(y.metalnessMap.value=A.metalnessMap,t(A.metalnessMap,y.metalnessMapTransform)),y.roughness.value=A.roughness,A.roughnessMap&&(y.roughnessMap.value=A.roughnessMap,t(A.roughnessMap,y.roughnessMapTransform)),e.get(A).envMap&&(y.envMapIntensity.value=A.envMapIntensity)}function h(y,A,b){y.ior.value=A.ior,A.sheen>0&&(y.sheenColor.value.copy(A.sheenColor).multiplyScalar(A.sheen),y.sheenRoughness.value=A.sheenRoughness,A.sheenColorMap&&(y.sheenColorMap.value=A.sheenColorMap,t(A.sheenColorMap,y.sheenColorMapTransform)),A.sheenRoughnessMap&&(y.sheenRoughnessMap.value=A.sheenRoughnessMap,t(A.sheenRoughnessMap,y.sheenRoughnessMapTransform))),A.clearcoat>0&&(y.clearcoat.value=A.clearcoat,y.clearcoatRoughness.value=A.clearcoatRoughness,A.clearcoatMap&&(y.clearcoatMap.value=A.clearcoatMap,t(A.clearcoatMap,y.clearcoatMapTransform)),A.clearcoatRoughnessMap&&(y.clearcoatRoughnessMap.value=A.clearcoatRoughnessMap,t(A.clearcoatRoughnessMap,y.clearcoatRoughnessMapTransform)),A.clearcoatNormalMap&&(y.clearcoatNormalMap.value=A.clearcoatNormalMap,t(A.clearcoatNormalMap,y.clearcoatNormalMapTransform),y.clearcoatNormalScale.value.copy(A.clearcoatNormalScale),A.side===Jn&&y.clearcoatNormalScale.value.negate())),A.iridescence>0&&(y.iridescence.value=A.iridescence,y.iridescenceIOR.value=A.iridescenceIOR,y.iridescenceThicknessMinimum.value=A.iridescenceThicknessRange[0],y.iridescenceThicknessMaximum.value=A.iridescenceThicknessRange[1],A.iridescenceMap&&(y.iridescenceMap.value=A.iridescenceMap,t(A.iridescenceMap,y.iridescenceMapTransform)),A.iridescenceThicknessMap&&(y.iridescenceThicknessMap.value=A.iridescenceThicknessMap,t(A.iridescenceThicknessMap,y.iridescenceThicknessMapTransform))),A.transmission>0&&(y.transmission.value=A.transmission,y.transmissionSamplerMap.value=b.texture,y.transmissionSamplerSize.value.set(b.width,b.height),A.transmissionMap&&(y.transmissionMap.value=A.transmissionMap,t(A.transmissionMap,y.transmissionMapTransform)),y.thickness.value=A.thickness,A.thicknessMap&&(y.thicknessMap.value=A.thicknessMap,t(A.thicknessMap,y.thicknessMapTransform)),y.attenuationDistance.value=A.attenuationDistance,y.attenuationColor.value.copy(A.attenuationColor)),y.specularIntensity.value=A.specularIntensity,y.specularColor.value.copy(A.specularColor),A.specularColorMap&&(y.specularColorMap.value=A.specularColorMap,t(A.specularColorMap,y.specularColorMapTransform)),A.specularIntensityMap&&(y.specularIntensityMap.value=A.specularIntensityMap,t(A.specularIntensityMap,y.specularIntensityMapTransform))}function f(y,A){A.matcap&&(y.matcap.value=A.matcap)}function v(y,A){const b=e.get(A).light;y.referencePosition.value.setFromMatrixPosition(b.matrixWorld),y.nearDistance.value=b.shadow.camera.near,y.farDistance.value=b.shadow.camera.far}return{refreshFogUniforms:i,refreshMaterialUniforms:s}}function zL(n,e,t,i){let s={},r={},o=[];const a=t.isWebGL2?n.getParameter(n.MAX_UNIFORM_BUFFER_BINDINGS):0;function l(b,m){const B=m.program;i.uniformBlockBinding(b,B)}function g(b,m){let B=s[b.id];B===void 0&&(f(b),B=u(b),s[b.id]=B,b.addEventListener("dispose",y));const S=m.program;i.updateUBOMapping(b,S);const x=e.render.frame;r[b.id]!==x&&(d(b),r[b.id]=x)}function u(b){const m=C();b.__bindingPointIndex=m;const B=n.createBuffer(),S=b.__size,x=b.usage;return n.bindBuffer(n.UNIFORM_BUFFER,B),n.bufferData(n.UNIFORM_BUFFER,S,x),n.bindBuffer(n.UNIFORM_BUFFER,null),n.bindBufferBase(n.UNIFORM_BUFFER,m,B),B}function C(){for(let b=0;b0){x=B%S;const P=S-x;x!==0&&P-V.boundary<0&&(B+=S-x,Z.__offset=B)}B+=V.storage}return x=B%S,x>0&&(B+=S-x),b.__size=B,b.__cache={},this}function v(b){const m={boundary:0,storage:0};return typeof b=="number"?(m.boundary=4,m.storage=4):b.isVector2?(m.boundary=8,m.storage=8):b.isVector3||b.isColor?(m.boundary=16,m.storage=12):b.isVector4?(m.boundary=16,m.storage=16):b.isMatrix3?(m.boundary=48,m.storage=48):b.isMatrix4?(m.boundary=64,m.storage=64):b.isTexture?console.warn("THREE.WebGLRenderer: Texture samplers can not be part of an uniforms group."):console.warn("THREE.WebGLRenderer: Unsupported uniform value type.",b),m}function y(b){const m=b.target;m.removeEventListener("dispose",y);const B=o.indexOf(m.__bindingPointIndex);o.splice(B,1),n.deleteBuffer(s[m.id]),delete s[m.id],delete r[m.id]}function A(){for(const b in s)n.deleteBuffer(s[b]);o=[],s={},r={}}return{bind:l,update:g,dispose:A}}function LL(){const n=Ku("canvas");return n.style.display="block",n}class uy{constructor(e={}){const{canvas:t=LL(),context:i=null,depth:s=!0,stencil:r=!0,alpha:o=!1,antialias:a=!1,premultipliedAlpha:l=!0,preserveDrawingBuffer:g=!1,powerPreference:u="default",failIfMajorPerformanceCaveat:C=!1}=e;this.isWebGLRenderer=!0;let d;i!==null?d=i.getContextAttributes().alpha:d=o;let h=null,f=null;const v=[],y=[];this.domElement=t,this.debug={checkShaderErrors:!0,onShaderError:null},this.autoClear=!0,this.autoClearColor=!0,this.autoClearDepth=!0,this.autoClearStencil=!0,this.sortObjects=!0,this.clippingPlanes=[],this.localClippingEnabled=!1,this.outputColorSpace=yt,this.useLegacyLights=!0,this.toneMapping=Ar,this.toneMappingExposure=1;const A=this;let b=!1,m=0,B=0,S=null,x=-1,R=null;const M=new Yt,Z=new Yt;let V=null,N=t.width,P=t.height,U=1,q=null,ie=null;const he=new Yt(0,0,N,P),Ce=new Yt(0,0,N,P);let z=!1;const Q=new rp;let J=!1,le=!1,se=null;const te=new _e,ge=new H,Ze={background:null,fog:null,environment:null,overrideMaterial:null,isScene:!0};function Re(){return S===null?U:1}let O=i;function ot(F,ae){for(let Ae=0;Ae0?f=y[y.length-1]:f=null,v.pop(),v.length>0?h=v[v.length-1]:h=null};function Gn(F,ae,Ae,re){if(F.visible===!1)return;if(F.layers.test(ae.layers)){if(F.isGroup)Ae=F.renderOrder;else if(F.isLOD)F.autoUpdate===!0&&F.update(ae);else if(F.isLight)f.pushLight(F),F.castShadow&&f.pushShadow(F);else if(F.isSprite){if(!F.frustumCulled||Q.intersectsSprite(F)){re&&ge.setFromMatrixPosition(F.matrixWorld).applyMatrix4(te);const ut=nt.update(F),dt=F.material;dt.visible&&h.push(F,ut,dt,Ae,ge.z,null)}}else if((F.isMesh||F.isLine||F.isPoints)&&(!F.frustumCulled||Q.intersectsObject(F))){F.isSkinnedMesh&&F.skeleton.frame!==Be.render.frame&&(F.skeleton.update(),F.skeleton.frame=Be.render.frame);const ut=nt.update(F),dt=F.material;if(re&&(ut.boundingSphere===null&&ut.computeBoundingSphere(),ge.copy(ut.boundingSphere.center).applyMatrix4(F.matrixWorld).applyMatrix4(te)),Array.isArray(dt)){const mt=ut.groups;for(let wt=0,St=mt.length;wt0&&Lt(ve,rt,ae,Ae),re&&Ue.viewport(M.copy(re)),ve.length>0&&Hn(ve,ae,Ae),rt.length>0&&Hn(rt,ae,Ae),ut.length>0&&Hn(ut,ae,Ae),Ue.buffers.depth.setTest(!0),Ue.buffers.depth.setMask(!0),Ue.buffers.color.setMask(!0),Ue.setPolygonOffset(!1)}function Lt(F,ae,Ae,re){if(se===null){const dt=Me.isWebGL2;se=new Nt(1024,1024,{generateMipmaps:!0,type:ct.has("EXT_color_buffer_half_float")?bs:cn,minFilter:ba,samples:dt&&a===!0?4:0})}const ve=A.getRenderTarget();A.setRenderTarget(se),A.clear();const rt=A.toneMapping;A.toneMapping=Ar,Hn(F,Ae,re),we.updateMultisampleRenderTarget(se),we.updateRenderTargetMipmap(se);let ut=!1;for(let dt=0,mt=ae.length;dt0&&we.useMultisampledRTT(F)===!1?ve=fe.get(F).__webglMultisampledFramebuffer:ve=St,M.copy(F.viewport),Z.copy(F.scissor),V=F.scissorTest}else M.copy(he).multiplyScalar(U).floor(),Z.copy(Ce).multiplyScalar(U).floor(),V=z;if(Ue.bindFramebuffer(O.FRAMEBUFFER,ve)&&Me.drawBuffers&&re&&Ue.drawBuffers(F,ve),Ue.viewport(M),Ue.scissor(Z),Ue.setScissorTest(V),rt){const mt=fe.get(F.texture);O.framebufferTexture2D(O.FRAMEBUFFER,O.COLOR_ATTACHMENT0,O.TEXTURE_CUBE_MAP_POSITIVE_X+ae,mt.__webglTexture,Ae)}else if(ut){const mt=fe.get(F.texture),wt=ae||0;O.framebufferTextureLayer(O.FRAMEBUFFER,O.COLOR_ATTACHMENT0,mt.__webglTexture,Ae||0,wt)}x=-1},this.readRenderTargetPixels=function(F,ae,Ae,re,ve,rt,ut){if(!(F&&F.isWebGLRenderTarget)){console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not THREE.WebGLRenderTarget.");return}let dt=fe.get(F).__webglFramebuffer;if(F.isWebGLCubeRenderTarget&&ut!==void 0&&(dt=dt[ut]),dt){Ue.bindFramebuffer(O.FRAMEBUFFER,dt);try{const mt=F.texture,wt=mt.format,St=mt.type;if(wt!==An&&D.convert(wt)!==O.getParameter(O.IMPLEMENTATION_COLOR_READ_FORMAT)){console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not in RGBA or implementation defined format.");return}const Wt=St===bs&&(ct.has("EXT_color_buffer_half_float")||Me.isWebGL2&&ct.has("EXT_color_buffer_float"));if(St!==cn&&D.convert(St)!==O.getParameter(O.IMPLEMENTATION_COLOR_READ_TYPE)&&!(St===Wn&&(Me.isWebGL2||ct.has("OES_texture_float")||ct.has("WEBGL_color_buffer_float")))&&!Wt){console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not in UnsignedByteType or implementation defined type.");return}ae>=0&&ae<=F.width-re&&Ae>=0&&Ae<=F.height-ve&&O.readPixels(ae,Ae,re,ve,D.convert(wt),D.convert(St),rt)}finally{const mt=S!==null?fe.get(S).__webglFramebuffer:null;Ue.bindFramebuffer(O.FRAMEBUFFER,mt)}}},this.copyFramebufferToTexture=function(F,ae,Ae=0){const re=Math.pow(2,-Ae),ve=Math.floor(ae.image.width*re),rt=Math.floor(ae.image.height*re);we.setTexture2D(ae,0),O.copyTexSubImage2D(O.TEXTURE_2D,Ae,0,0,F.x,F.y,ve,rt),Ue.unbindTexture()},this.copyTextureToTexture=function(F,ae,Ae,re=0){const ve=ae.image.width,rt=ae.image.height,ut=D.convert(Ae.format),dt=D.convert(Ae.type);we.setTexture2D(Ae,0),O.pixelStorei(O.UNPACK_FLIP_Y_WEBGL,Ae.flipY),O.pixelStorei(O.UNPACK_PREMULTIPLY_ALPHA_WEBGL,Ae.premultiplyAlpha),O.pixelStorei(O.UNPACK_ALIGNMENT,Ae.unpackAlignment),ae.isDataTexture?O.texSubImage2D(O.TEXTURE_2D,re,F.x,F.y,ve,rt,ut,dt,ae.image.data):ae.isCompressedTexture?O.compressedTexSubImage2D(O.TEXTURE_2D,re,F.x,F.y,ae.mipmaps[0].width,ae.mipmaps[0].height,ut,ae.mipmaps[0].data):O.texSubImage2D(O.TEXTURE_2D,re,F.x,F.y,ut,dt,ae.image),re===0&&Ae.generateMipmaps&&O.generateMipmap(O.TEXTURE_2D),Ue.unbindTexture()},this.copyTextureToTexture3D=function(F,ae,Ae,re,ve=0){if(A.isWebGL1Renderer){console.warn("THREE.WebGLRenderer.copyTextureToTexture3D: can only be used with WebGL2.");return}const rt=F.max.x-F.min.x+1,ut=F.max.y-F.min.y+1,dt=F.max.z-F.min.z+1,mt=D.convert(re.format),wt=D.convert(re.type);let St;if(re.isData3DTexture)we.setTexture3D(re,0),St=O.TEXTURE_3D;else if(re.isDataArrayTexture)we.setTexture2DArray(re,0),St=O.TEXTURE_2D_ARRAY;else{console.warn("THREE.WebGLRenderer.copyTextureToTexture3D: only supports THREE.DataTexture3D and THREE.DataTexture2DArray.");return}O.pixelStorei(O.UNPACK_FLIP_Y_WEBGL,re.flipY),O.pixelStorei(O.UNPACK_PREMULTIPLY_ALPHA_WEBGL,re.premultiplyAlpha),O.pixelStorei(O.UNPACK_ALIGNMENT,re.unpackAlignment);const Wt=O.getParameter(O.UNPACK_ROW_LENGTH),Ot=O.getParameter(O.UNPACK_IMAGE_HEIGHT),ai=O.getParameter(O.UNPACK_SKIP_PIXELS),ls=O.getParameter(O.UNPACK_SKIP_ROWS),Os=O.getParameter(O.UNPACK_SKIP_IMAGES),ln=Ae.isCompressedTexture?Ae.mipmaps[0]:Ae.image;O.pixelStorei(O.UNPACK_ROW_LENGTH,ln.width),O.pixelStorei(O.UNPACK_IMAGE_HEIGHT,ln.height),O.pixelStorei(O.UNPACK_SKIP_PIXELS,F.min.x),O.pixelStorei(O.UNPACK_SKIP_ROWS,F.min.y),O.pixelStorei(O.UNPACK_SKIP_IMAGES,F.min.z),Ae.isDataTexture||Ae.isData3DTexture?O.texSubImage3D(St,ve,ae.x,ae.y,ae.z,rt,ut,dt,mt,wt,ln.data):Ae.isCompressedArrayTexture?(console.warn("THREE.WebGLRenderer.copyTextureToTexture3D: untested support for compressed srcTexture."),O.compressedTexSubImage3D(St,ve,ae.x,ae.y,ae.z,rt,ut,dt,mt,ln.data)):O.texSubImage3D(St,ve,ae.x,ae.y,ae.z,rt,ut,dt,mt,wt,ln),O.pixelStorei(O.UNPACK_ROW_LENGTH,Wt),O.pixelStorei(O.UNPACK_IMAGE_HEIGHT,Ot),O.pixelStorei(O.UNPACK_SKIP_PIXELS,ai),O.pixelStorei(O.UNPACK_SKIP_ROWS,ls),O.pixelStorei(O.UNPACK_SKIP_IMAGES,Os),ve===0&&re.generateMipmaps&&O.generateMipmap(St),Ue.unbindTexture()},this.initTexture=function(F){F.isCubeTexture?we.setTextureCube(F,0):F.isData3DTexture?we.setTexture3D(F,0):F.isDataArrayTexture||F.isCompressedArrayTexture?we.setTexture2DArray(F,0):we.setTexture2D(F,0),Ue.unbindTexture()},this.resetState=function(){m=0,B=0,S=null,Ue.reset(),$.reset()},typeof __THREE_DEVTOOLS__<"u"&&__THREE_DEVTOOLS__.dispatchEvent(new CustomEvent("observe",{detail:this}))}get physicallyCorrectLights(){return console.warn("THREE.WebGLRenderer: the property .physicallyCorrectLights has been removed. Set renderer.useLegacyLights instead."),!this.useLegacyLights}set physicallyCorrectLights(e){console.warn("THREE.WebGLRenderer: the property .physicallyCorrectLights has been removed. Set renderer.useLegacyLights instead."),this.useLegacyLights=!e}get outputEncoding(){return console.warn("THREE.WebGLRenderer: Property .outputEncoding has been removed. Use .outputColorSpace instead."),this.outputColorSpace===yt?ks:sC}set outputEncoding(e){console.warn("THREE.WebGLRenderer: Property .outputEncoding has been removed. Use .outputColorSpace instead."),this.outputColorSpace=e===ks?yt:fr}}class kW extends uy{}kW.prototype.isWebGL1Renderer=!0;class gp{constructor(e,t=25e-5){this.isFogExp2=!0,this.name="",this.color=new Xe(e),this.density=t}clone(){return new gp(this.color,this.density)}toJSON(){return{type:"FogExp2",color:this.color.getHex(),density:this.density}}}class cp{constructor(e,t=1,i=1e3){this.isFog=!0,this.name="",this.color=new Xe(e),this.near=t,this.far=i}clone(){return new cp(this.color,this.near,this.far)}toJSON(){return{type:"Fog",color:this.color.getHex(),near:this.near,far:this.far}}}class Sl extends zt{constructor(){super(),this.isScene=!0,this.type="Scene",this.background=null,this.environment=null,this.fog=null,this.backgroundBlurriness=0,this.backgroundIntensity=1,this.overrideMaterial=null,typeof __THREE_DEVTOOLS__<"u"&&__THREE_DEVTOOLS__.dispatchEvent(new CustomEvent("observe",{detail:this}))}copy(e,t){return super.copy(e,t),e.background!==null&&(this.background=e.background.clone()),e.environment!==null&&(this.environment=e.environment.clone()),e.fog!==null&&(this.fog=e.fog.clone()),this.backgroundBlurriness=e.backgroundBlurriness,this.backgroundIntensity=e.backgroundIntensity,e.overrideMaterial!==null&&(this.overrideMaterial=e.overrideMaterial.clone()),this.matrixAutoUpdate=e.matrixAutoUpdate,this}toJSON(e){const t=super.toJSON(e);return this.fog!==null&&(t.object.fog=this.fog.toJSON()),this.backgroundBlurriness>0&&(t.object.backgroundBlurriness=this.backgroundBlurriness),this.backgroundIntensity!==1&&(t.object.backgroundIntensity=this.backgroundIntensity),t}get autoUpdate(){return console.warn("THREE.Scene: autoUpdate was renamed to matrixWorldAutoUpdate in r144."),this.matrixWorldAutoUpdate}set autoUpdate(e){console.warn("THREE.Scene: autoUpdate was renamed to matrixWorldAutoUpdate in r144."),this.matrixWorldAutoUpdate=e}}class Ip{constructor(e,t){this.isInterleavedBuffer=!0,this.array=e,this.stride=t,this.count=e!==void 0?e.length/t:0,this.usage=Yu,this.updateRange={offset:0,count:-1},this.version=0,this.uuid=vs()}onUploadCallback(){}set needsUpdate(e){e===!0&&this.version++}setUsage(e){return this.usage=e,this}copy(e){return this.array=new e.array.constructor(e.array),this.count=e.count,this.stride=e.stride,this.usage=e.usage,this}copyAt(e,t,i){e*=this.stride,i*=t.stride;for(let s=0,r=this.stride;se.far||t.push({distance:l,point:pI.clone(),uv:es.getInterpolation(pI,qd,mI,$d,LZ,ym,EZ,new oe),face:null,object:this})}copy(e,t){return super.copy(e,t),e.center!==void 0&&this.center.copy(e.center),this.material=e.material,this}}function eh(n,e,t,i,s,r){vg.subVectors(n,t).addScalar(.5).multiply(i),s!==void 0?(fI.x=r*vg.x-s*vg.y,fI.y=s*vg.x+r*vg.y):fI.copy(vg),n.copy(e),n.x+=fI.x,n.y+=fI.y,n.applyMatrix4(DW)}const th=new H,TZ=new H;class PW extends zt{constructor(){super(),this._currentLevel=0,this.type="LOD",Object.defineProperties(this,{levels:{enumerable:!0,value:[]},isLOD:{value:!0}}),this.autoUpdate=!0}copy(e){super.copy(e,!1);const t=e.levels;for(let i=0,s=t.length;i0){let i,s;for(i=1,s=t.length;i0){th.setFromMatrixPosition(this.matrixWorld);const s=e.ray.origin.distanceTo(th);this.getObjectForDistance(s).raycast(e,t)}}update(e){const t=this.levels;if(t.length>1){th.setFromMatrixPosition(e.matrixWorld),TZ.setFromMatrixPosition(this.matrixWorld);const i=th.distanceTo(TZ)/e.zoom;t[0].object.visible=!0;let s,r;for(s=1,r=t.length;s=o)t[s-1].object.visible=!1,t[s].object.visible=!0;else break}for(this._currentLevel=s-1;sl)continue;d.applyMatrix4(this.matrixWorld);const M=e.ray.origin.distanceTo(d);Me.far||t.push({distance:M,point:C.clone().applyMatrix4(this.matrixWorld),index:m,face:null,faceIndex:null,object:this})}}else{const A=Math.max(0,o.start),b=Math.min(y.count,o.start+o.count);for(let m=A,B=b-1;ml)continue;d.applyMatrix4(this.matrixWorld);const x=e.ray.origin.distanceTo(d);xe.far||t.push({distance:x,point:C.clone().applyMatrix4(this.matrixWorld),index:m,face:null,faceIndex:null,object:this})}}}updateMorphTargets(){const t=this.geometry.morphAttributes,i=Object.keys(t);if(i.length>0){const s=t[i[0]];if(s!==void 0){this.morphTargetInfluences=[],this.morphTargetDictionary={};for(let r=0,o=s.length;r0){const s=t[i[0]];if(s!==void 0){this.morphTargetInfluences=[],this.morphTargetDictionary={};for(let r=0,o=s.length;rs.far)return;r.push({distance:g,distanceToRay:Math.sqrt(a),point:l,index:e,face:null,object:o})}}class QW extends sn{constructor(e,t,i,s,r,o,a,l,g){super(e,t,i,s,r,o,a,l,g),this.isVideoTexture=!0,this.minFilter=o!==void 0?o:st,this.magFilter=r!==void 0?r:st,this.generateMipmaps=!1;const u=this;function C(){u.needsUpdate=!0,e.requestVideoFrameCallback(C)}"requestVideoFrameCallback"in e&&e.requestVideoFrameCallback(C)}clone(){return new this.constructor(this.image).copy(this)}update(){const e=this.image;"requestVideoFrameCallback"in e===!1&&e.readyState>=e.HAVE_CURRENT_DATA&&(this.needsUpdate=!0)}}class xb extends sn{constructor(e,t,i){super({width:e,height:t}),this.isFramebufferTexture=!0,this.format=i,this.magFilter=vt,this.minFilter=vt,this.generateMipmaps=!1,this.needsUpdate=!0}}class Ay extends sn{constructor(e,t,i,s,r,o,a,l,g,u,C,d){super(null,o,a,l,g,u,s,r,C,d),this.isCompressedTexture=!0,this.image={width:t,height:i},this.mipmaps=e,this.flipY=!1,this.generateMipmaps=!1}}class DL extends Ay{constructor(e,t,i,s,r,o){super(e,t,i,r,o),this.isCompressedArrayTexture=!0,this.image.depth=s,this.wrapR=Pn}}class jW extends sn{constructor(e,t,i,s,r,o,a,l,g){super(e,t,i,s,r,o,a,l,g),this.isCanvasTexture=!0,this.needsUpdate=!0}}class mr{constructor(){this.type="Curve",this.arcLengthDivisions=200}getPoint(){return console.warn("THREE.Curve: .getPoint() not implemented."),null}getPointAt(e,t){const i=this.getUtoTmapping(e);return this.getPoint(i,t)}getPoints(e=5){const t=[];for(let i=0;i<=e;i++)t.push(this.getPoint(i/e));return t}getSpacedPoints(e=5){const t=[];for(let i=0;i<=e;i++)t.push(this.getPointAt(i/e));return t}getLength(){const e=this.getLengths();return e[e.length-1]}getLengths(e=this.arcLengthDivisions){if(this.cacheArcLengths&&this.cacheArcLengths.length===e+1&&!this.needsUpdate)return this.cacheArcLengths;this.needsUpdate=!1;const t=[];let i,s=this.getPoint(0),r=0;t.push(0);for(let o=1;o<=e;o++)i=this.getPoint(o/e),r+=i.distanceTo(s),t.push(r),s=i;return this.cacheArcLengths=t,t}updateArcLengths(){this.needsUpdate=!0,this.getLengths()}getUtoTmapping(e,t){const i=this.getLengths();let s=0;const r=i.length;let o;t?o=t:o=e*i[r-1];let a=0,l=r-1,g;for(;a<=l;)if(s=Math.floor(a+(l-a)/2),g=i[s]-o,g<0)a=s+1;else if(g>0)l=s-1;else{l=s;break}if(s=l,i[s]===o)return s/(r-1);const u=i[s],d=i[s+1]-u,h=(o-u)/d;return(s+h)/(r-1)}getTangent(e,t){let s=e-1e-4,r=e+1e-4;s<0&&(s=0),r>1&&(r=1);const o=this.getPoint(s),a=this.getPoint(r),l=t||(o.isVector2?new oe:new H);return l.copy(a).sub(o).normalize(),l}getTangentAt(e,t){const i=this.getUtoTmapping(e);return this.getTangent(i,t)}computeFrenetFrames(e,t){const i=new H,s=[],r=[],o=[],a=new H,l=new _e;for(let h=0;h<=e;h++){const f=h/e;s[h]=this.getTangentAt(f,new H)}r[0]=new H,o[0]=new H;let g=Number.MAX_VALUE;const u=Math.abs(s[0].x),C=Math.abs(s[0].y),d=Math.abs(s[0].z);u<=g&&(g=u,i.set(1,0,0)),C<=g&&(g=C,i.set(0,1,0)),d<=g&&i.set(0,0,1),a.crossVectors(s[0],i).normalize(),r[0].crossVectors(s[0],a),o[0].crossVectors(s[0],r[0]);for(let h=1;h<=e;h++){if(r[h]=r[h-1].clone(),o[h]=o[h-1].clone(),a.crossVectors(s[h-1],s[h]),a.length()>Number.EPSILON){a.normalize();const f=Math.acos(Sn(s[h-1].dot(s[h]),-1,1));r[h].applyMatrix4(l.makeRotationAxis(a,f))}o[h].crossVectors(s[h],r[h])}if(t===!0){let h=Math.acos(Sn(r[0].dot(r[e]),-1,1));h/=e,s[0].dot(a.crossVectors(r[0],r[e]))>0&&(h=-h);for(let f=1;f<=e;f++)r[f].applyMatrix4(l.makeRotationAxis(s[f],h*f)),o[f].crossVectors(s[f],r[f])}return{tangents:s,normals:r,binormals:o}}clone(){return new this.constructor().copy(this)}copy(e){return this.arcLengthDivisions=e.arcLengthDivisions,this}toJSON(){const e={metadata:{version:4.5,type:"Curve",generator:"Curve.toJSON"}};return e.arcLengthDivisions=this.arcLengthDivisions,e.type=this.type,e}fromJSON(e){return this.arcLengthDivisions=e.arcLengthDivisions,this}}class Cp extends mr{constructor(e=0,t=0,i=1,s=1,r=0,o=Math.PI*2,a=!1,l=0){super(),this.isEllipseCurve=!0,this.type="EllipseCurve",this.aX=e,this.aY=t,this.xRadius=i,this.yRadius=s,this.aStartAngle=r,this.aEndAngle=o,this.aClockwise=a,this.aRotation=l}getPoint(e,t){const i=t||new oe,s=Math.PI*2;let r=this.aEndAngle-this.aStartAngle;const o=Math.abs(r)s;)r-=s;r0?0:(Math.floor(Math.abs(a)/r)+1)*r:l===0&&a===r-1&&(a=r-2,l=1);let g,u;this.closed||a>0?g=s[(a-1)%r]:(oh.subVectors(s[0],s[1]).add(s[0]),g=oh);const C=s[a%r],d=s[(a+1)%r];if(this.closed||a+2s.length-2?s.length-1:o+1],C=s[o>s.length-3?s.length-1:o+2];return i.set(iw(a,l.x,g.x,u.x,C.x),iw(a,l.y,g.y,u.y,C.y)),i}copy(e){super.copy(e),this.points=[];for(let t=0,i=e.points.length;t=i){const o=s[r]-i,a=this.curves[r],l=a.getLength(),g=l===0?0:1-o/l;return a.getPointAt(g,t)}r++}return null}getLength(){const e=this.getCurveLengths();return e[e.length-1]}updateArcLengths(){this.needsUpdate=!0,this.cacheLengths=null,this.getCurveLengths()}getCurveLengths(){if(this.cacheLengths&&this.cacheLengths.length===this.curves.length)return this.cacheLengths;const e=[];let t=0;for(let i=0,s=this.curves.length;i1&&!t[t.length-1].equals(t[0])&&t.push(t[0]),t}copy(e){super.copy(e),this.curves=[];for(let t=0,i=e.curves.length;t0){const C=g.getPoint(0);C.equals(this.currentPoint)||this.lineTo(C.x,C.y)}this.curves.push(g);const u=g.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 Vc extends Gt{constructor(e=[new oe(0,-.5),new oe(.5,0),new oe(0,.5)],t=12,i=0,s=Math.PI*2){super(),this.type="LatheGeometry",this.parameters={points:e,segments:t,phiStart:i,phiLength:s},t=Math.floor(t),s=Sn(s,0,Math.PI*2);const r=[],o=[],a=[],l=[],g=[],u=1/t,C=new H,d=new oe,h=new H,f=new H,v=new H;let y=0,A=0;for(let b=0;b<=e.length-1;b++)switch(b){case 0:y=e[b+1].x-e[b].x,A=e[b+1].y-e[b].y,h.x=A*1,h.y=-y,h.z=A*0,v.copy(h),h.normalize(),l.push(h.x,h.y,h.z);break;case e.length-1:l.push(v.x,v.y,v.z);break;default:y=e[b+1].x-e[b].x,A=e[b+1].y-e[b].y,h.x=A*1,h.y=-y,h.z=A*0,f.copy(h),h.x+=v.x,h.y+=v.y,h.z+=v.z,h.normalize(),l.push(h.x,h.y,h.z),v.copy(f)}for(let b=0;b<=t;b++){const m=i+b*u*s,B=Math.sin(m),S=Math.cos(m);for(let x=0;x<=e.length-1;x++){C.x=e[x].x*B,C.y=e[x].y,C.z=e[x].x*S,o.push(C.x,C.y,C.z),d.x=b/t,d.y=x/(e.length-1),a.push(d.x,d.y);const R=l[3*x+0]*B,M=l[3*x+1],Z=l[3*x+0]*S;g.push(R,M,Z)}}for(let b=0;b0&&m(!0),t>0&&m(!1)),this.setIndex(u),this.setAttribute("position",new je(C,3)),this.setAttribute("normal",new je(d,3)),this.setAttribute("uv",new je(h,2));function b(){const B=new H,S=new H;let x=0;const R=(t-e)/i;for(let M=0;M<=r;M++){const Z=[],V=M/r,N=V*(t-e)+e;for(let P=0;P<=s;P++){const U=P/s,q=U*l+a,ie=Math.sin(q),he=Math.cos(q);S.x=N*ie,S.y=-V*i+y,S.z=N*he,C.push(S.x,S.y,S.z),B.set(ie,R,he).normalize(),d.push(B.x,B.y,B.z),h.push(U,1-V),Z.push(f++)}v.push(Z)}for(let M=0;M.9&&R<.1&&(m<.2&&(o[b+0]+=1),B<.2&&(o[b+2]+=1),S<.2&&(o[b+4]+=1))}}function d(b){r.push(b.x,b.y,b.z)}function h(b,m){const B=b*3;m.x=e[B+0],m.y=e[B+1],m.z=e[B+2]}function f(){const b=new H,m=new H,B=new H,S=new H,x=new oe,R=new oe,M=new oe;for(let Z=0,V=0;Z80*t){a=g=n[0],l=u=n[1];for(let f=t;fg&&(g=C),d>u&&(u=d);h=Math.max(g-a,u-l),h=h!==0?32767/h:0}return Lu(r,o,t,a,l,h,0),o}};function sV(n,e,t,i,s){let r,o;if(s===dE(n,e,t,i)>0)for(r=e;r=e;r-=i)o=sw(r,n[r],n[r+1],o);return o&&hp(o,o.next)&&(Tu(o),o=o.next),o}function Rl(n,e){if(!n)return n;e||(e=n);let t=n,i;do if(i=!1,!t.steiner&&(hp(t,t.next)||bn(t.prev,t,t.next)===0)){if(Tu(t),t=e=t.prev,t===t.next)break;i=!0}else t=t.next;while(i||t!==e);return e}function Lu(n,e,t,i,s,r,o){if(!n)return;!o&&r&&lE(n,i,s,r);let a=n,l,g;for(;n.prev!==n.next;){if(l=n.prev,g=n.next,r?eE(n,i,s,r):$L(n)){e.push(l.i/t|0),e.push(n.i/t|0),e.push(g.i/t|0),Tu(n),n=g.next,a=g.next;continue}if(n=g,n===a){o?o===1?(n=tE(Rl(n),e,t),Lu(n,e,t,i,s,r,2)):o===2&&nE(n,e,t,i,s,r):Lu(Rl(n),e,t,i,s,r,1);break}}}function $L(n){const e=n.prev,t=n,i=n.next;if(bn(e,t,i)>=0)return!1;const s=e.x,r=t.x,o=i.x,a=e.y,l=t.y,g=i.y,u=sr?s>o?s:o:r>o?r:o,h=a>l?a>g?a:g:l>g?l:g;let f=i.next;for(;f!==e;){if(f.x>=u&&f.x<=d&&f.y>=C&&f.y<=h&&_g(s,a,r,l,o,g,f.x,f.y)&&bn(f.prev,f,f.next)>=0)return!1;f=f.next}return!0}function eE(n,e,t,i){const s=n.prev,r=n,o=n.next;if(bn(s,r,o)>=0)return!1;const a=s.x,l=r.x,g=o.x,u=s.y,C=r.y,d=o.y,h=al?a>g?a:g:l>g?l:g,y=u>C?u>d?u:d:C>d?C:d,A=Rb(h,f,e,t,i),b=Rb(v,y,e,t,i);let m=n.prevZ,B=n.nextZ;for(;m&&m.z>=A&&B&&B.z<=b;){if(m.x>=h&&m.x<=v&&m.y>=f&&m.y<=y&&m!==s&&m!==o&&_g(a,u,l,C,g,d,m.x,m.y)&&bn(m.prev,m,m.next)>=0||(m=m.prevZ,B.x>=h&&B.x<=v&&B.y>=f&&B.y<=y&&B!==s&&B!==o&&_g(a,u,l,C,g,d,B.x,B.y)&&bn(B.prev,B,B.next)>=0))return!1;B=B.nextZ}for(;m&&m.z>=A;){if(m.x>=h&&m.x<=v&&m.y>=f&&m.y<=y&&m!==s&&m!==o&&_g(a,u,l,C,g,d,m.x,m.y)&&bn(m.prev,m,m.next)>=0)return!1;m=m.prevZ}for(;B&&B.z<=b;){if(B.x>=h&&B.x<=v&&B.y>=f&&B.y<=y&&B!==s&&B!==o&&_g(a,u,l,C,g,d,B.x,B.y)&&bn(B.prev,B,B.next)>=0)return!1;B=B.nextZ}return!0}function tE(n,e,t){let i=n;do{const s=i.prev,r=i.next.next;!hp(s,r)&&rV(s,i,i.next,r)&&Eu(s,r)&&Eu(r,s)&&(e.push(s.i/t|0),e.push(i.i/t|0),e.push(r.i/t|0),Tu(i),Tu(i.next),i=n=r),i=i.next}while(i!==n);return Rl(i)}function nE(n,e,t,i,s,r){let o=n;do{let a=o.next.next;for(;a!==o.prev;){if(o.i!==a.i&&IE(o,a)){let l=oV(o,a);o=Rl(o,o.next),l=Rl(l,l.next),Lu(o,e,t,i,s,r,0),Lu(l,e,t,i,s,r,0);return}a=a.next}o=o.next}while(o!==n)}function iE(n,e,t,i){const s=[];let r,o,a,l,g;for(r=0,o=e.length;r=t.next.y&&t.next.y!==t.y){const d=t.x+(o-t.y)*(t.next.x-t.x)/(t.next.y-t.y);if(d<=r&&d>i&&(i=d,s=t.x=t.x&&t.x>=l&&r!==t.x&&_g(os.x||t.x===s.x&&aE(s,t)))&&(s=t,u=C)),t=t.next;while(t!==a);return s}function aE(n,e){return bn(n.prev,n,e.prev)<0&&bn(e.next,n,n.next)<0}function lE(n,e,t,i){let s=n;do s.z===0&&(s.z=Rb(s.x,s.y,e,t,i)),s.prevZ=s.prev,s.nextZ=s.next,s=s.next;while(s!==n);s.prevZ.nextZ=null,s.prevZ=null,gE(s)}function gE(n){let e,t,i,s,r,o,a,l,g=1;do{for(t=n,n=null,r=null,o=0;t;){for(o++,i=t,a=0,e=0;e0||l>0&&i;)a!==0&&(l===0||!i||t.z<=i.z)?(s=t,t=t.nextZ,a--):(s=i,i=i.nextZ,l--),r?r.nextZ=s:n=s,s.prevZ=r,r=s;t=i}r.nextZ=null,g*=2}while(o>1);return n}function Rb(n,e,t,i,s){return n=(n-t)*s|0,e=(e-i)*s|0,n=(n|n<<8)&16711935,n=(n|n<<4)&252645135,n=(n|n<<2)&858993459,n=(n|n<<1)&1431655765,e=(e|e<<8)&16711935,e=(e|e<<4)&252645135,e=(e|e<<2)&858993459,e=(e|e<<1)&1431655765,n|e<<1}function cE(n){let e=n,t=n;do(e.x=(n-o)*(r-a)&&(n-o)*(i-a)>=(t-o)*(e-a)&&(t-o)*(r-a)>=(s-o)*(i-a)}function IE(n,e){return n.next.i!==e.i&&n.prev.i!==e.i&&!uE(n,e)&&(Eu(n,e)&&Eu(e,n)&&CE(n,e)&&(bn(n.prev,n,e.prev)||bn(n,e.prev,e))||hp(n,e)&&bn(n.prev,n,n.next)>0&&bn(e.prev,e,e.next)>0)}function bn(n,e,t){return(e.y-n.y)*(t.x-e.x)-(e.x-n.x)*(t.y-e.y)}function hp(n,e){return n.x===e.x&&n.y===e.y}function rV(n,e,t,i){const s=Ih(bn(n,e,t)),r=Ih(bn(n,e,i)),o=Ih(bn(t,i,n)),a=Ih(bn(t,i,e));return!!(s!==r&&o!==a||s===0&&ch(n,t,e)||r===0&&ch(n,i,e)||o===0&&ch(t,n,i)||a===0&&ch(t,e,i))}function ch(n,e,t){return e.x<=Math.max(n.x,t.x)&&e.x>=Math.min(n.x,t.x)&&e.y<=Math.max(n.y,t.y)&&e.y>=Math.min(n.y,t.y)}function Ih(n){return n>0?1:n<0?-1:0}function uE(n,e){let t=n;do{if(t.i!==n.i&&t.next.i!==n.i&&t.i!==e.i&&t.next.i!==e.i&&rV(t,t.next,n,e))return!0;t=t.next}while(t!==n);return!1}function Eu(n,e){return bn(n.prev,n,n.next)<0?bn(n,e,n.next)>=0&&bn(n,n.prev,e)>=0:bn(n,e,n.prev)<0||bn(n,n.next,e)<0}function CE(n,e){let t=n,i=!1;const s=(n.x+e.x)/2,r=(n.y+e.y)/2;do t.y>r!=t.next.y>r&&t.next.y!==t.y&&s<(t.next.x-t.x)*(r-t.y)/(t.next.y-t.y)+t.x&&(i=!i),t=t.next;while(t!==n);return i}function oV(n,e){const t=new Wb(n.i,n.x,n.y),i=new Wb(e.i,e.x,e.y),s=n.next,r=e.prev;return n.next=e,e.prev=n,t.next=s,s.prev=t,i.next=t,t.prev=i,r.next=i,i.prev=r,i}function sw(n,e,t,i){const s=new Wb(n,e,t);return i?(s.next=i.next,s.prev=i,i.next.prev=s,i.next=s):(s.prev=s,s.next=s),s}function Tu(n){n.next.prev=n.prev,n.prev.next=n.next,n.prevZ&&(n.prevZ.nextZ=n.nextZ),n.nextZ&&(n.nextZ.prevZ=n.prevZ)}function Wb(n,e,t){this.i=n,this.x=e,this.y=t,this.prev=null,this.next=null,this.z=0,this.prevZ=null,this.nextZ=null,this.steiner=!1}function dE(n,e,t,i){let s=0;for(let r=e,o=t-i;r2&&n[e-1].equals(n[0])&&n.pop()}function ow(n,e){for(let t=0;tNumber.EPSILON){const de=Math.sqrt(T),xe=Math.sqrt(Ct*Ct+Ht*Ht),We=fe.x-nt/de,Ee=fe.y+at/de,lt=we.x-Ht/xe,Je=we.y+Ct/xe,D=((lt-We)*Ht-(Je-Ee)*Ct)/(at*Ht-nt*Ct);Pe=We+at*D-Be.x,Fe=Ee+nt*D-Be.y;const $=Pe*Pe+Fe*Fe;if($<=2)return new oe(Pe,Fe);qe=Math.sqrt($/2)}else{let de=!1;at>Number.EPSILON?Ct>Number.EPSILON&&(de=!0):at<-Number.EPSILON?Ct<-Number.EPSILON&&(de=!0):Math.sign(nt)===Math.sign(Ht)&&(de=!0),de?(Pe=-nt,Fe=at,qe=Math.sqrt(T)):(Pe=at,Fe=nt,qe=Math.sqrt(T/2))}return new oe(Pe/qe,Fe/qe)}const Q=[];for(let Be=0,fe=q.length,we=fe-1,Pe=Be+1;Be=0;Be--){const fe=Be/y,we=h*Math.cos(fe*Math.PI/2),Pe=f*Math.sin(fe*Math.PI/2)+v;for(let Fe=0,qe=q.length;Fe=0;){const Pe=we;let Fe=we-1;Fe<0&&(Fe=Be.length-1);for(let qe=0,at=u+y*2;qe0)&&h.push(m,B,x),(A!==i-1||l0!=e>0&&this.version++,this._sheen=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 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.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.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 IV extends ei{constructor(e){super(),this.isMeshPhongMaterial=!0,this.type="MeshPhongMaterial",this.color=new Xe(16777215),this.specular=new Xe(1118481),this.shininess=30,this.map=null,this.lightMap=null,this.lightMapIntensity=1,this.aoMap=null,this.aoMapIntensity=1,this.emissive=new Xe(0),this.emissiveIntensity=1,this.emissiveMap=null,this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=Vo,this.normalScale=new oe(1,1),this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.specularMap=null,this.alphaMap=null,this.envMap=null,this.combine=iC,this.reflectivity=1,this.refractionRatio=.98,this.wireframe=!1,this.wireframeLinewidth=1,this.wireframeLinecap="round",this.wireframeLinejoin="round",this.flatShading=!1,this.fog=!0,this.setValues(e)}copy(e){return super.copy(e),this.color.copy(e.color),this.specular.copy(e.specular),this.shininess=e.shininess,this.map=e.map,this.lightMap=e.lightMap,this.lightMapIntensity=e.lightMapIntensity,this.aoMap=e.aoMap,this.aoMapIntensity=e.aoMapIntensity,this.emissive.copy(e.emissive),this.emissiveMap=e.emissiveMap,this.emissiveIntensity=e.emissiveIntensity,this.bumpMap=e.bumpMap,this.bumpScale=e.bumpScale,this.normalMap=e.normalMap,this.normalMapType=e.normalMapType,this.normalScale.copy(e.normalScale),this.displacementMap=e.displacementMap,this.displacementScale=e.displacementScale,this.displacementBias=e.displacementBias,this.specularMap=e.specularMap,this.alphaMap=e.alphaMap,this.envMap=e.envMap,this.combine=e.combine,this.reflectivity=e.reflectivity,this.refractionRatio=e.refractionRatio,this.wireframe=e.wireframe,this.wireframeLinewidth=e.wireframeLinewidth,this.wireframeLinecap=e.wireframeLinecap,this.wireframeLinejoin=e.wireframeLinejoin,this.flatShading=e.flatShading,this.fog=e.fog,this}}class uV extends ei{constructor(e){super(),this.isMeshToonMaterial=!0,this.defines={TOON:""},this.type="MeshToonMaterial",this.color=new Xe(16777215),this.map=null,this.gradientMap=null,this.lightMap=null,this.lightMapIntensity=1,this.aoMap=null,this.aoMapIntensity=1,this.emissive=new Xe(0),this.emissiveIntensity=1,this.emissiveMap=null,this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=Vo,this.normalScale=new oe(1,1),this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.alphaMap=null,this.wireframe=!1,this.wireframeLinewidth=1,this.wireframeLinecap="round",this.wireframeLinejoin="round",this.fog=!0,this.setValues(e)}copy(e){return super.copy(e),this.color.copy(e.color),this.map=e.map,this.gradientMap=e.gradientMap,this.lightMap=e.lightMap,this.lightMapIntensity=e.lightMapIntensity,this.aoMap=e.aoMap,this.aoMapIntensity=e.aoMapIntensity,this.emissive.copy(e.emissive),this.emissiveMap=e.emissiveMap,this.emissiveIntensity=e.emissiveIntensity,this.bumpMap=e.bumpMap,this.bumpScale=e.bumpScale,this.normalMap=e.normalMap,this.normalMapType=e.normalMapType,this.normalScale.copy(e.normalScale),this.displacementMap=e.displacementMap,this.displacementScale=e.displacementScale,this.displacementBias=e.displacementBias,this.alphaMap=e.alphaMap,this.wireframe=e.wireframe,this.wireframeLinewidth=e.wireframeLinewidth,this.wireframeLinecap=e.wireframeLinecap,this.wireframeLinejoin=e.wireframeLinejoin,this.fog=e.fog,this}}class Gy extends ei{constructor(e){super(),this.isMeshNormalMaterial=!0,this.type="MeshNormalMaterial",this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=Vo,this.normalScale=new oe(1,1),this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.wireframe=!1,this.wireframeLinewidth=1,this.flatShading=!1,this.setValues(e)}copy(e){return super.copy(e),this.bumpMap=e.bumpMap,this.bumpScale=e.bumpScale,this.normalMap=e.normalMap,this.normalMapType=e.normalMapType,this.normalScale.copy(e.normalScale),this.displacementMap=e.displacementMap,this.displacementScale=e.displacementScale,this.displacementBias=e.displacementBias,this.wireframe=e.wireframe,this.wireframeLinewidth=e.wireframeLinewidth,this.flatShading=e.flatShading,this}}class CV extends ei{constructor(e){super(),this.isMeshLambertMaterial=!0,this.type="MeshLambertMaterial",this.color=new Xe(16777215),this.map=null,this.lightMap=null,this.lightMapIntensity=1,this.aoMap=null,this.aoMapIntensity=1,this.emissive=new Xe(0),this.emissiveIntensity=1,this.emissiveMap=null,this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=Vo,this.normalScale=new oe(1,1),this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.specularMap=null,this.alphaMap=null,this.envMap=null,this.combine=iC,this.reflectivity=1,this.refractionRatio=.98,this.wireframe=!1,this.wireframeLinewidth=1,this.wireframeLinecap="round",this.wireframeLinejoin="round",this.flatShading=!1,this.fog=!0,this.setValues(e)}copy(e){return super.copy(e),this.color.copy(e.color),this.map=e.map,this.lightMap=e.lightMap,this.lightMapIntensity=e.lightMapIntensity,this.aoMap=e.aoMap,this.aoMapIntensity=e.aoMapIntensity,this.emissive.copy(e.emissive),this.emissiveMap=e.emissiveMap,this.emissiveIntensity=e.emissiveIntensity,this.bumpMap=e.bumpMap,this.bumpScale=e.bumpScale,this.normalMap=e.normalMap,this.normalMapType=e.normalMapType,this.normalScale.copy(e.normalScale),this.displacementMap=e.displacementMap,this.displacementScale=e.displacementScale,this.displacementBias=e.displacementBias,this.specularMap=e.specularMap,this.alphaMap=e.alphaMap,this.envMap=e.envMap,this.combine=e.combine,this.reflectivity=e.reflectivity,this.refractionRatio=e.refractionRatio,this.wireframe=e.wireframe,this.wireframeLinewidth=e.wireframeLinewidth,this.wireframeLinecap=e.wireframeLinecap,this.wireframeLinejoin=e.wireframeLinejoin,this.flatShading=e.flatShading,this.fog=e.fog,this}}class dV extends ei{constructor(e){super(),this.isMeshMatcapMaterial=!0,this.defines={MATCAP:""},this.type="MeshMatcapMaterial",this.color=new Xe(16777215),this.matcap=null,this.map=null,this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=Vo,this.normalScale=new oe(1,1),this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.alphaMap=null,this.flatShading=!1,this.fog=!0,this.setValues(e)}copy(e){return super.copy(e),this.defines={MATCAP:""},this.color.copy(e.color),this.matcap=e.matcap,this.map=e.map,this.bumpMap=e.bumpMap,this.bumpScale=e.bumpScale,this.normalMap=e.normalMap,this.normalMapType=e.normalMapType,this.normalScale.copy(e.normalScale),this.displacementMap=e.displacementMap,this.displacementScale=e.displacementScale,this.displacementBias=e.displacementBias,this.alphaMap=e.alphaMap,this.flatShading=e.flatShading,this.fog=e.fog,this}}class hV extends Ti{constructor(e){super(),this.isLineDashedMaterial=!0,this.type="LineDashedMaterial",this.scale=1,this.dashSize=3,this.gapSize=1,this.setValues(e)}copy(e){return super.copy(e),this.scale=e.scale,this.dashSize=e.dashSize,this.gapSize=e.gapSize,this}}function Ks(n,e,t){return By(n)?new n.constructor(n.subarray(e,t!==void 0?t:n.length)):n.slice(e,t)}function ul(n,e,t){return!n||!t&&n.constructor===e?n:typeof e.BYTES_PER_ELEMENT=="number"?new e(n):Array.prototype.slice.call(n)}function By(n){return ArrayBuffer.isView(n)&&!(n instanceof DataView)}function AV(n){function e(s,r){return n[s]-n[r]}const t=n.length,i=new Array(t);for(let s=0;s!==t;++s)i[s]=s;return i.sort(e),i}function Vb(n,e,t){const i=n.length,s=new n.constructor(i);for(let r=0,o=0;o!==i;++r){const a=t[r]*e;for(let l=0;l!==e;++l)s[o++]=n[a+l]}return s}function Zy(n,e,t,i){let s=1,r=n[0];for(;r!==void 0&&r[i]===void 0;)r=n[s++];if(r===void 0)return;let o=r[i];if(o!==void 0)if(Array.isArray(o))do o=r[i],o!==void 0&&(e.push(r.time),t.push.apply(t,o)),r=n[s++];while(r!==void 0);else if(o.toArray!==void 0)do o=r[i],o!==void 0&&(e.push(r.time),o.toArray(t,t.length)),r=n[s++];while(r!==void 0);else do o=r[i],o!==void 0&&(e.push(r.time),t.push(o)),r=n[s++];while(r!==void 0)}function fE(n,e,t,i,s=30){const r=n.clone();r.name=e;const o=[];for(let l=0;l=i)){C.push(g.times[h]);for(let v=0;vr.tracks[l].times[0]&&(a=r.tracks[l].times[0]);for(let l=0;l=a.times[f]){const A=f*C+u,b=A+C-u;v=Ks(a.values,A,b)}else{const A=a.createInterpolant(),b=u,m=C-u;A.evaluate(r),v=Ks(A.resultBuffer,b,m)}l==="quaternion"&&new Mn().fromArray(v).normalize().conjugate().toArray(v);const y=g.times.length;for(let A=0;A=r)){const a=t[1];e=r)break t}o=i,i=0;break n}break e}for(;i>>1;et;)--o;if(++o,r!==0||o!==s){r>=o&&(o=Math.max(o,1),r=o-1);const a=this.getValueSize();this.times=Ks(i,r,o),this.values=Ks(this.values,r*a,o*a)}return this}validate(){let e=!0;const t=this.getValueSize();t-Math.floor(t)!==0&&(console.error("THREE.KeyframeTrack: Invalid value size in track.",this),e=!1);const i=this.times,s=this.values,r=i.length;r===0&&(console.error("THREE.KeyframeTrack: Track is empty.",this),e=!1);let o=null;for(let a=0;a!==r;a++){const l=i[a];if(typeof l=="number"&&isNaN(l)){console.error("THREE.KeyframeTrack: Time is not a valid number.",this,a,l),e=!1;break}if(o!==null&&o>l){console.error("THREE.KeyframeTrack: Out of order keys.",this,a,l,o),e=!1;break}o=l}if(s!==void 0&&By(s))for(let a=0,l=s.length;a!==l;++a){const g=s[a];if(isNaN(g)){console.error("THREE.KeyframeTrack: Value is not a valid number.",this,a,g),e=!1;break}}return e}optimize(){const e=Ks(this.times),t=Ks(this.values),i=this.getValueSize(),s=this.getInterpolation()===Qh,r=e.length-1;let o=1;for(let a=1;a0){e[o]=e[r];for(let a=r*i,l=o*i,g=0;g!==i;++g)t[l+g]=t[a+g];++o}return o!==e.length?(this.times=Ks(e,0,o),this.values=Ks(t,0,o*i)):(this.times=e,this.values=t),this}clone(){const e=Ks(this.times,0),t=Ks(this.values,0),i=this.constructor,s=new i(this.name,e,t);return s.createInterpolant=this.createInterpolant,s}}br.prototype.TimeBufferType=Float32Array;br.prototype.ValueBufferType=Float32Array;br.prototype.DefaultInterpolation=Xu;class zl extends br{}zl.prototype.ValueTypeName="bool";zl.prototype.ValueBufferType=Array;zl.prototype.DefaultInterpolation=Hu;zl.prototype.InterpolantFactoryMethodLinear=void 0;zl.prototype.InterpolantFactoryMethodSmooth=void 0;class Sy extends br{}Sy.prototype.ValueTypeName="color";class ku extends br{}ku.prototype.ValueTypeName="number";class mV extends mC{constructor(e,t,i,s){super(e,t,i,s)}interpolate_(e,t,i,s){const r=this.resultBuffer,o=this.sampleValues,a=this.valueSize,l=(i-t)/(s-t);let g=e*a;for(let u=g+a;g!==u;g+=4)Mn.slerpFlat(r,0,o,g-a,o,g,l);return r}}class Nc extends br{InterpolantFactoryMethodLinear(e){return new mV(this.times,this.values,this.getValueSize(),e)}}Nc.prototype.ValueTypeName="quaternion";Nc.prototype.DefaultInterpolation=Xu;Nc.prototype.InterpolantFactoryMethodSmooth=void 0;class Ll extends br{}Ll.prototype.ValueTypeName="string";Ll.prototype.ValueBufferType=Array;Ll.prototype.DefaultInterpolation=Hu;Ll.prototype.InterpolantFactoryMethodLinear=void 0;Ll.prototype.InterpolantFactoryMethodSmooth=void 0;class Du extends br{}Du.prototype.ValueTypeName="vector";class Uu{constructor(e,t=-1,i,s=np){this.name=e,this.tracks=i,this.duration=t,this.blendMode=s,this.uuid=vs(),this.duration<0&&this.resetDuration()}static parse(e){const t=[],i=e.tracks,s=1/(e.fps||1);for(let o=0,a=i.length;o!==a;++o)t.push(yE(i[o]).scale(s));const r=new this(e.name,e.duration,t,e.blendMode);return r.uuid=e.uuid,r}static toJSON(e){const t=[],i=e.tracks,s={name:e.name,duration:e.duration,tracks:t,uuid:e.uuid,blendMode:e.blendMode};for(let r=0,o=i.length;r!==o;++r)t.push(br.toJSON(i[r]));return s}static CreateFromMorphTargetSequence(e,t,i,s){const r=t.length,o=[];for(let a=0;a1){const C=u[1];let d=s[C];d||(s[C]=d=[]),d.push(g)}}const o=[];for(const a in s)o.push(this.CreateFromMorphTargetSequence(a,s[a],t,i));return o}static parseAnimation(e,t){if(!e)return console.error("THREE.AnimationClip: No animation in JSONLoader data."),null;const i=function(C,d,h,f,v){if(h.length!==0){const y=[],A=[];Zy(h,y,A,f),y.length!==0&&v.push(new C(d,y,A))}},s=[],r=e.name||"default",o=e.fps||30,a=e.blendMode;let l=e.length||-1;const g=e.hierarchy||[];for(let C=0;C{t&&t(r),this.manager.itemEnd(e)},0),r;if(oo[e]!==void 0){oo[e].push({onLoad:t,onProgress:i,onError:s});return}oo[e]=[],oo[e].push({onLoad:t,onProgress:i,onError:s});const o=new Request(e,{headers:new Headers(this.requestHeader),credentials:this.withCredentials?"include":"same-origin"}),a=this.mimeType,l=this.responseType;fetch(o).then(g=>{if(g.status===200||g.status===0){if(g.status===0&&console.warn("THREE.FileLoader: HTTP Status 0 received."),typeof ReadableStream>"u"||g.body===void 0||g.body.getReader===void 0)return g;const u=oo[e],C=g.body.getReader(),d=g.headers.get("Content-Length")||g.headers.get("X-File-Size"),h=d?parseInt(d):0,f=h!==0;let v=0;const y=new ReadableStream({start(A){b();function b(){C.read().then(({done:m,value:B})=>{if(m)A.close();else{v+=B.byteLength;const S=new ProgressEvent("progress",{lengthComputable:f,loaded:v,total:h});for(let x=0,R=u.length;x{switch(l){case"arraybuffer":return g.arrayBuffer();case"blob":return g.blob();case"document":return g.text().then(u=>new DOMParser().parseFromString(u,a));case"json":return g.json();default:if(a===void 0)return g.text();{const C=/charset="?([^;"\s]*)"?/i.exec(a),d=C&&C[1]?C[1].toLowerCase():void 0,h=new TextDecoder(d);return g.arrayBuffer().then(f=>h.decode(f))}}}).then(g=>{Wl.add(e,g);const u=oo[e];delete oo[e];for(let C=0,d=u.length;C{const u=oo[e];if(u===void 0)throw this.manager.itemError(e),g;delete oo[e];for(let C=0,d=u.length;C{this.manager.itemEnd(e)}),this.manager.itemStart(e)}setResponseType(e){return this.responseType=e,this}setMimeType(e){return this.mimeType=e,this}}class BE extends ws{constructor(e){super(e)}load(e,t,i,s){const r=this,o=new wo(this.manager);o.setPath(this.path),o.setRequestHeader(this.requestHeader),o.setWithCredentials(this.withCredentials),o.load(e,function(a){try{t(r.parse(JSON.parse(a)))}catch(l){s?s(l):console.error(l),r.manager.itemError(e)}},i,s)}parse(e){const t=[];for(let i=0;i0:s.vertexColors=e.vertexColors),e.uniforms!==void 0)for(const r in e.uniforms){const o=e.uniforms[r];switch(s.uniforms[r]={},o.type){case"t":s.uniforms[r].value=i(o.value);break;case"c":s.uniforms[r].value=new Xe().setHex(o.value);break;case"v2":s.uniforms[r].value=new oe().fromArray(o.value);break;case"v3":s.uniforms[r].value=new H().fromArray(o.value);break;case"v4":s.uniforms[r].value=new Yt().fromArray(o.value);break;case"m3":s.uniforms[r].value=new Mt().fromArray(o.value);break;case"m4":s.uniforms[r].value=new _e().fromArray(o.value);break;default:s.uniforms[r].value=o.value}}if(e.defines!==void 0&&(s.defines=e.defines),e.vertexShader!==void 0&&(s.vertexShader=e.vertexShader),e.fragmentShader!==void 0&&(s.fragmentShader=e.fragmentShader),e.glslVersion!==void 0&&(s.glslVersion=e.glslVersion),e.extensions!==void 0)for(const r in e.extensions)s.extensions[r]=e.extensions[r];if(e.lights!==void 0&&(s.lights=e.lights),e.clipping!==void 0&&(s.clipping=e.clipping),e.size!==void 0&&(s.size=e.size),e.sizeAttenuation!==void 0&&(s.sizeAttenuation=e.sizeAttenuation),e.map!==void 0&&(s.map=i(e.map)),e.matcap!==void 0&&(s.matcap=i(e.matcap)),e.alphaMap!==void 0&&(s.alphaMap=i(e.alphaMap)),e.bumpMap!==void 0&&(s.bumpMap=i(e.bumpMap)),e.bumpScale!==void 0&&(s.bumpScale=e.bumpScale),e.normalMap!==void 0&&(s.normalMap=i(e.normalMap)),e.normalMapType!==void 0&&(s.normalMapType=e.normalMapType),e.normalScale!==void 0){let r=e.normalScale;Array.isArray(r)===!1&&(r=[r,r]),s.normalScale=new oe().fromArray(r)}return e.displacementMap!==void 0&&(s.displacementMap=i(e.displacementMap)),e.displacementScale!==void 0&&(s.displacementScale=e.displacementScale),e.displacementBias!==void 0&&(s.displacementBias=e.displacementBias),e.roughnessMap!==void 0&&(s.roughnessMap=i(e.roughnessMap)),e.metalnessMap!==void 0&&(s.metalnessMap=i(e.metalnessMap)),e.emissiveMap!==void 0&&(s.emissiveMap=i(e.emissiveMap)),e.emissiveIntensity!==void 0&&(s.emissiveIntensity=e.emissiveIntensity),e.specularMap!==void 0&&(s.specularMap=i(e.specularMap)),e.specularIntensityMap!==void 0&&(s.specularIntensityMap=i(e.specularIntensityMap)),e.specularColorMap!==void 0&&(s.specularColorMap=i(e.specularColorMap)),e.envMap!==void 0&&(s.envMap=i(e.envMap)),e.envMapIntensity!==void 0&&(s.envMapIntensity=e.envMapIntensity),e.reflectivity!==void 0&&(s.reflectivity=e.reflectivity),e.refractionRatio!==void 0&&(s.refractionRatio=e.refractionRatio),e.lightMap!==void 0&&(s.lightMap=i(e.lightMap)),e.lightMapIntensity!==void 0&&(s.lightMapIntensity=e.lightMapIntensity),e.aoMap!==void 0&&(s.aoMap=i(e.aoMap)),e.aoMapIntensity!==void 0&&(s.aoMapIntensity=e.aoMapIntensity),e.gradientMap!==void 0&&(s.gradientMap=i(e.gradientMap)),e.clearcoatMap!==void 0&&(s.clearcoatMap=i(e.clearcoatMap)),e.clearcoatRoughnessMap!==void 0&&(s.clearcoatRoughnessMap=i(e.clearcoatRoughnessMap)),e.clearcoatNormalMap!==void 0&&(s.clearcoatNormalMap=i(e.clearcoatNormalMap)),e.clearcoatNormalScale!==void 0&&(s.clearcoatNormalScale=new oe().fromArray(e.clearcoatNormalScale)),e.iridescenceMap!==void 0&&(s.iridescenceMap=i(e.iridescenceMap)),e.iridescenceThicknessMap!==void 0&&(s.iridescenceThicknessMap=i(e.iridescenceThicknessMap)),e.transmissionMap!==void 0&&(s.transmissionMap=i(e.transmissionMap)),e.thicknessMap!==void 0&&(s.thicknessMap=i(e.thicknessMap)),e.sheenColorMap!==void 0&&(s.sheenColorMap=i(e.sheenColorMap)),e.sheenRoughnessMap!==void 0&&(s.sheenRoughnessMap=i(e.sheenRoughnessMap)),s}setTextures(e){return this.textures=e,this}static createMaterialFromType(e){const t={ShadowMaterial:lV,SpriteMaterial:Cy,RawShaderMaterial:gV,ShaderMaterial:Rt,PointsMaterial:hy,MeshPhysicalMaterial:cV,MeshStandardMaterial:Ap,MeshPhongMaterial:IV,MeshToonMaterial:uV,MeshNormalMaterial:Gy,MeshLambertMaterial:CV,MeshDepthMaterial:ap,MeshDistanceMaterial:Iy,MeshBasicMaterial:Sa,MeshMatcapMaterial:dV,LineDashedMaterial:hV,LineBasicMaterial:Ti,Material:ei};return new t[e]}}class Mb{static decodeText(e){if(typeof TextDecoder<"u")return new TextDecoder().decode(e);let t="";for(let i=0,s=e.length;i0){const l=new pp(t);r=new Pu(l),r.setCrossOrigin(this.crossOrigin);for(let g=0,u=e.length;g0){s=new Pu(this.manager),s.setCrossOrigin(this.crossOrigin);for(let o=0,a=e.length;o"u"&&console.warn("THREE.ImageBitmapLoader: createImageBitmap() not supported."),typeof fetch>"u"&&console.warn("THREE.ImageBitmapLoader: fetch() not supported."),this.options={premultiplyAlpha:"none"}}setOptions(e){return this.options=e,this}load(e,t,i,s){e===void 0&&(e=""),this.path!==void 0&&(e=this.path+e),e=this.manager.resolveURL(e);const r=this,o=Wl.get(e);if(o!==void 0)return r.manager.itemStart(e),setTimeout(function(){t&&t(o),r.manager.itemEnd(e)},0),o;const a={};a.credentials=this.crossOrigin==="anonymous"?"same-origin":"include",a.headers=this.requestHeader,fetch(e,a).then(function(l){return l.blob()}).then(function(l){return createImageBitmap(l,Object.assign(r.options,{colorSpaceConversion:"none"}))}).then(function(l){Wl.add(e,l),t&&t(l),r.manager.itemEnd(e)}).catch(function(l){s&&s(l),r.manager.itemError(e),r.manager.itemEnd(e)}),r.manager.itemStart(e)}}let uh;class Ry{static getContext(){return uh===void 0&&(uh=new(window.AudioContext||window.webkitAudioContext)),uh}static setContext(e){uh=e}}class HE extends ws{constructor(e){super(e)}load(e,t,i,s){const r=this,o=new wo(this.manager);o.setResponseType("arraybuffer"),o.setPath(this.path),o.setRequestHeader(this.requestHeader),o.setWithCredentials(this.withCredentials),o.load(e,function(l){try{const g=l.slice(0);Ry.getContext().decodeAudioData(g,function(C){t(C)},a)}catch(g){a(g)}},i,s);function a(l){s?s(l):console.error(l),r.manager.itemError(e)}}}class XE extends fp{constructor(e,t,i=1){super(void 0,i),this.isHemisphereLightProbe=!0;const s=new Xe().set(e),r=new Xe().set(t),o=new H(s.r,s.g,s.b),a=new H(r.r,r.g,r.b),l=Math.sqrt(Math.PI),g=l*Math.sqrt(.75);this.sh.coefficients[0].copy(o).add(a).multiplyScalar(l),this.sh.coefficients[1].copy(o).sub(a).multiplyScalar(g)}}class FE extends fp{constructor(e,t=1){super(void 0,t),this.isAmbientLightProbe=!0;const i=new Xe().set(e);this.sh.coefficients[0].set(i.r,i.g,i.b).multiplyScalar(2*Math.sqrt(Math.PI))}}const dw=new _e,hw=new _e,Da=new _e;class YE{constructor(){this.type="StereoCamera",this.aspect=1,this.eyeSep=.064,this.cameraL=new mn,this.cameraL.layers.enable(1),this.cameraL.matrixAutoUpdate=!1,this.cameraR=new mn,this.cameraR.layers.enable(2),this.cameraR.matrixAutoUpdate=!1,this._cache={focus:null,fov:null,aspect:null,near:null,far:null,zoom:null,eyeSep:null}}update(e){const t=this._cache;if(t.focus!==e.focus||t.fov!==e.fov||t.aspect!==e.aspect*this.aspect||t.near!==e.near||t.far!==e.far||t.zoom!==e.zoom||t.eyeSep!==this.eyeSep){t.focus=e.focus,t.fov=e.fov,t.aspect=e.aspect*this.aspect,t.near=e.near,t.far=e.far,t.zoom=e.zoom,t.eyeSep=this.eyeSep,Da.copy(e.projectionMatrix);const s=t.eyeSep/2,r=s*t.near/t.focus,o=t.near*Math.tan(pl*t.fov*.5)/t.zoom;let a,l;hw.elements[12]=-s,dw.elements[12]=s,a=-o*t.aspect+r,l=o*t.aspect+r,Da.elements[0]=2*t.near/(l-a),Da.elements[8]=(l+a)/(l-a),this.cameraL.projectionMatrix.copy(Da),a=-o*t.aspect-r,l=o*t.aspect-r,Da.elements[0]=2*t.near/(l-a),Da.elements[8]=(l+a)/(l-a),this.cameraR.projectionMatrix.copy(Da)}this.cameraL.matrixWorld.copy(e.matrixWorld).multiply(hw),this.cameraR.matrixWorld.copy(e.matrixWorld).multiply(dw)}}class Wy{constructor(e=!0){this.autoStart=e,this.startTime=0,this.oldTime=0,this.elapsedTime=0,this.running=!1}start(){this.startTime=Aw(),this.oldTime=this.startTime,this.elapsedTime=0,this.running=!0}stop(){this.getElapsedTime(),this.running=!1,this.autoStart=!1}getElapsedTime(){return this.getDelta(),this.elapsedTime}getDelta(){let e=0;if(this.autoStart&&!this.running)return this.start(),0;if(this.running){const t=Aw();e=(t-this.oldTime)/1e3,this.oldTime=t,this.elapsedTime+=e}return e}}function Aw(){return(typeof performance>"u"?Date:performance).now()}const Ua=new H,pw=new Mn,KE=new H,Pa=new H;class zE extends zt{constructor(){super(),this.type="AudioListener",this.context=Ry.getContext(),this.gain=this.context.createGain(),this.gain.connect(this.context.destination),this.filter=null,this.timeDelta=0,this._clock=new Wy}getInput(){return this.gain}removeFilter(){return this.filter!==null&&(this.gain.disconnect(this.filter),this.filter.disconnect(this.context.destination),this.gain.connect(this.context.destination),this.filter=null),this}getFilter(){return this.filter}setFilter(e){return this.filter!==null?(this.gain.disconnect(this.filter),this.filter.disconnect(this.context.destination)):this.gain.disconnect(this.context.destination),this.filter=e,this.gain.connect(this.filter),this.filter.connect(this.context.destination),this}getMasterVolume(){return this.gain.gain.value}setMasterVolume(e){return this.gain.gain.setTargetAtTime(e,this.context.currentTime,.01),this}updateMatrixWorld(e){super.updateMatrixWorld(e);const t=this.context.listener,i=this.up;if(this.timeDelta=this._clock.getDelta(),this.matrixWorld.decompose(Ua,pw,KE),Pa.set(0,0,-1).applyQuaternion(pw),t.positionX){const s=this.context.currentTime+this.timeDelta;t.positionX.linearRampToValueAtTime(Ua.x,s),t.positionY.linearRampToValueAtTime(Ua.y,s),t.positionZ.linearRampToValueAtTime(Ua.z,s),t.forwardX.linearRampToValueAtTime(Pa.x,s),t.forwardY.linearRampToValueAtTime(Pa.y,s),t.forwardZ.linearRampToValueAtTime(Pa.z,s),t.upX.linearRampToValueAtTime(i.x,s),t.upY.linearRampToValueAtTime(i.y,s),t.upZ.linearRampToValueAtTime(i.z,s)}else t.setPosition(Ua.x,Ua.y,Ua.z),t.setOrientation(Pa.x,Pa.y,Pa.z,i.x,i.y,i.z)}}class VV extends zt{constructor(e){super(),this.type="Audio",this.listener=e,this.context=e.context,this.gain=this.context.createGain(),this.gain.connect(e.getInput()),this.autoplay=!1,this.buffer=null,this.detune=0,this.loop=!1,this.loopStart=0,this.loopEnd=0,this.offset=0,this.duration=void 0,this.playbackRate=1,this.isPlaying=!1,this.hasPlaybackControl=!0,this.source=null,this.sourceType="empty",this._startedAt=0,this._progress=0,this._connected=!1,this.filters=[]}getOutput(){return this.gain}setNodeSource(e){return this.hasPlaybackControl=!1,this.sourceType="audioNode",this.source=e,this.connect(),this}setMediaElementSource(e){return this.hasPlaybackControl=!1,this.sourceType="mediaNode",this.source=this.context.createMediaElementSource(e),this.connect(),this}setMediaStreamSource(e){return this.hasPlaybackControl=!1,this.sourceType="mediaStreamNode",this.source=this.context.createMediaStreamSource(e),this.connect(),this}setBuffer(e){return this.buffer=e,this.sourceType="buffer",this.autoplay&&this.play(),this}play(e=0){if(this.isPlaying===!0){console.warn("THREE.Audio: Audio is already playing.");return}if(this.hasPlaybackControl===!1){console.warn("THREE.Audio: this Audio has no playback control.");return}this._startedAt=this.context.currentTime+e;const t=this.context.createBufferSource();return t.buffer=this.buffer,t.loop=this.loop,t.loopStart=this.loopStart,t.loopEnd=this.loopEnd,t.onended=this.onEnded.bind(this),t.start(this._startedAt,this._progress+this.offset,this.duration),this.isPlaying=!0,this.source=t,this.setDetune(this.detune),this.setPlaybackRate(this.playbackRate),this.connect()}pause(){if(this.hasPlaybackControl===!1){console.warn("THREE.Audio: this Audio has no playback control.");return}return this.isPlaying===!0&&(this._progress+=Math.max(this.context.currentTime-this._startedAt,0)*this.playbackRate,this.loop===!0&&(this._progress=this._progress%(this.duration||this.buffer.duration)),this.source.stop(),this.source.onended=null,this.isPlaying=!1),this}stop(){if(this.hasPlaybackControl===!1){console.warn("THREE.Audio: this Audio has no playback control.");return}return this._progress=0,this.source!==null&&(this.source.stop(),this.source.onended=null),this.isPlaying=!1,this}connect(){if(this.filters.length>0){this.source.connect(this.filters[0]);for(let e=1,t=this.filters.length;e0){this.source.disconnect(this.filters[0]);for(let e=1,t=this.filters.length;e0&&this._mixBufferRegionAdditive(i,s,this._addIndex*t,1,t);for(let l=t,g=t+t;l!==g;++l)if(i[l]!==i[l+t]){a.setValue(i,s);break}}saveOriginalState(){const e=this.binding,t=this.buffer,i=this.valueSize,s=i*this._origIndex;e.getValue(t,s);for(let r=i,o=s;r!==o;++r)t[r]=t[s+r%i];this._setIdentity(),this.cumulativeWeight=0,this.cumulativeWeightAdditive=0}restoreOriginalState(){const e=this.valueSize*3;this.binding.setValue(this.buffer,e)}_setAdditiveIdentityNumeric(){const e=this._addIndex*this.valueSize,t=e+this.valueSize;for(let i=e;i=.5)for(let o=0;o!==r;++o)e[t+o]=e[i+o]}_slerp(e,t,i,s){Mn.slerpFlat(e,t,e,t,e,i,s)}_slerpAdditive(e,t,i,s,r){const o=this._workIndex*r;Mn.multiplyQuaternionsFlat(e,o,e,t,e,i),Mn.slerpFlat(e,t,e,t,e,o,s)}_lerp(e,t,i,s,r){const o=1-s;for(let a=0;a!==r;++a){const l=t+a;e[l]=e[l]*o+e[i+a]*s}}_lerpAdditive(e,t,i,s,r){for(let o=0;o!==r;++o){const a=t+o;e[a]=e[a]+e[i+o]*s}}}const Vy="\\[\\]\\.:\\/",kE=new RegExp("["+Vy+"]","g"),My="[^"+Vy+"]",DE="[^"+Vy.replace("\\.","")+"]",UE=/((?:WC+[\/:])*)/.source.replace("WC",My),PE=/(WCOD+)?/.source.replace("WCOD",DE),_E=/(?:\.(WC+)(?:\[(.+)\])?)?/.source.replace("WC",My),JE=/\.(WC+)(?:\[(.+)\])?/.source.replace("WC",My),OE=new RegExp("^"+UE+PE+_E+JE+"$"),QE=["material","materials","bones","map"];class jE{constructor(e,t,i){const s=i||Et.parseTrackName(t);this._targetGroup=e,this._bindings=e.subscribe_(t,s)}getValue(e,t){this.bind();const i=this._targetGroup.nCachedObjects_,s=this._bindings[i];s!==void 0&&s.getValue(e,t)}setValue(e,t){const i=this._bindings;for(let s=this._targetGroup.nCachedObjects_,r=i.length;s!==r;++s)i[s].setValue(e,t)}bind(){const e=this._bindings;for(let t=this._targetGroup.nCachedObjects_,i=e.length;t!==i;++t)e[t].bind()}unbind(){const e=this._bindings;for(let t=this._targetGroup.nCachedObjects_,i=e.length;t!==i;++t)e[t].unbind()}}class Et{constructor(e,t,i){this.path=t,this.parsedPath=i||Et.parseTrackName(t),this.node=Et.findNode(e,this.parsedPath.nodeName),this.rootNode=e,this.getValue=this._getValue_unbound,this.setValue=this._setValue_unbound}static create(e,t,i){return e&&e.isAnimationObjectGroup?new Et.Composite(e,t,i):new Et(e,t,i)}static sanitizeNodeName(e){return e.replace(/\s/g,"_").replace(kE,"")}static parseTrackName(e){const t=OE.exec(e);if(t===null)throw new Error("PropertyBinding: Cannot parse trackName: "+e);const i={nodeName:t[2],objectName:t[3],objectIndex:t[4],propertyName:t[5],propertyIndex:t[6]},s=i.nodeName&&i.nodeName.lastIndexOf(".");if(s!==void 0&&s!==-1){const r=i.nodeName.substring(s+1);QE.indexOf(r)!==-1&&(i.nodeName=i.nodeName.substring(0,s),i.objectName=r)}if(i.propertyName===null||i.propertyName.length===0)throw new Error("PropertyBinding: can not parse propertyName from trackName: "+e);return i}static findNode(e,t){if(t===void 0||t===""||t==="."||t===-1||t===e.name||t===e.uuid)return e;if(e.skeleton){const i=e.skeleton.getBoneByName(t);if(i!==void 0)return i}if(e.children){const i=function(r){for(let o=0;o=r){const C=r++,d=e[C];t[d.uuid]=u,e[u]=d,t[g]=C,e[C]=l;for(let h=0,f=s;h!==f;++h){const v=i[h],y=v[C],A=v[u];v[u]=y,v[C]=A}}}this.nCachedObjects_=r}uncache(){const e=this._objects,t=this._indicesByUUID,i=this._bindings,s=i.length;let r=this.nCachedObjects_,o=e.length;for(let a=0,l=arguments.length;a!==l;++a){const g=arguments[a],u=g.uuid,C=t[u];if(C!==void 0)if(delete t[u],C0&&(t[h.uuid]=C),e[C]=h,e.pop();for(let f=0,v=s;f!==v;++f){const y=i[f];y[C]=y[d],y.pop()}}}this.nCachedObjects_=r}subscribe_(e,t){const i=this._bindingsIndicesByPath;let s=i[e];const r=this._bindings;if(s!==void 0)return r[s];const o=this._paths,a=this._parsedPaths,l=this._objects,g=l.length,u=this.nCachedObjects_,C=new Array(g);s=r.length,i[e]=s,o.push(e),a.push(t),r.push(C);for(let d=u,h=l.length;d!==h;++d){const f=l[d];C[d]=new Et(f,e,t)}return C}unsubscribe_(e){const t=this._bindingsIndicesByPath,i=t[e];if(i!==void 0){const s=this._paths,r=this._parsedPaths,o=this._bindings,a=o.length-1,l=o[a],g=e[a];t[g]=i,o[i]=l,o.pop(),r[i]=r[a],r.pop(),s[i]=s[a],s.pop()}}}class NV{constructor(e,t,i=null,s=t.blendMode){this._mixer=e,this._clip=t,this._localRoot=i,this.blendMode=s;const r=t.tracks,o=r.length,a=new Array(o),l={endingStart:gl,endingEnd:gl};for(let g=0;g!==o;++g){const u=r[g].createInterpolant(null);a[g]=u,u.settings=l}this._interpolantSettings=l,this._interpolants=a,this._propertyBindings=new Array(o),this._cacheIndex=null,this._byClipCacheIndex=null,this._timeScaleInterpolant=null,this._weightInterpolant=null,this.loop=GW,this._loopCount=-1,this._startTime=null,this.time=0,this.timeScale=1,this._effectiveTimeScale=1,this.weight=1,this._effectiveWeight=1,this.repetitions=1/0,this.paused=!1,this.enabled=!0,this.clampWhenFinished=!1,this.zeroSlopeAtStart=!0,this.zeroSlopeAtEnd=!0}play(){return this._mixer._activateAction(this),this}stop(){return this._mixer._deactivateAction(this),this.reset()}reset(){return this.paused=!1,this.enabled=!0,this.time=0,this._loopCount=-1,this._startTime=null,this.stopFading().stopWarping()}isRunning(){return this.enabled&&!this.paused&&this.timeScale!==0&&this._startTime===null&&this._mixer._isActiveAction(this)}isScheduled(){return this._mixer._isActiveAction(this)}startAt(e){return this._startTime=e,this}setLoop(e,t){return this.loop=e,this.repetitions=t,this}setEffectiveWeight(e){return this.weight=e,this._effectiveWeight=this.enabled?e:0,this.stopFading()}getEffectiveWeight(){return this._effectiveWeight}fadeIn(e){return this._scheduleFading(e,0,1)}fadeOut(e){return this._scheduleFading(e,1,0)}crossFadeFrom(e,t,i){if(e.fadeOut(t),this.fadeIn(t),i){const s=this._clip.duration,r=e._clip.duration,o=r/s,a=s/r;e.warp(1,o,t),this.warp(a,1,t)}return this}crossFadeTo(e,t,i){return e.crossFadeFrom(this,t,i)}stopFading(){const e=this._weightInterpolant;return e!==null&&(this._weightInterpolant=null,this._mixer._takeBackControlInterpolant(e)),this}setEffectiveTimeScale(e){return this.timeScale=e,this._effectiveTimeScale=this.paused?0:e,this.stopWarping()}getEffectiveTimeScale(){return this._effectiveTimeScale}setDuration(e){return this.timeScale=this._clip.duration/e,this.stopWarping()}syncWith(e){return this.time=e.time,this.timeScale=e.timeScale,this.stopWarping()}halt(e){return this.warp(this._effectiveTimeScale,0,e)}warp(e,t,i){const s=this._mixer,r=s.time,o=this.timeScale;let a=this._timeScaleInterpolant;a===null&&(a=s._lendControlInterpolant(),this._timeScaleInterpolant=a);const l=a.parameterPositions,g=a.sampleValues;return l[0]=r,l[1]=r+i,g[0]=e/o,g[1]=t/o,this}stopWarping(){const e=this._timeScaleInterpolant;return e!==null&&(this._timeScaleInterpolant=null,this._mixer._takeBackControlInterpolant(e)),this}getMixer(){return this._mixer}getClip(){return this._clip}getRoot(){return this._localRoot||this._mixer._root}_update(e,t,i,s){if(!this.enabled){this._updateWeight(e);return}const r=this._startTime;if(r!==null){const l=(e-r)*i;l<0||i===0?t=0:(this._startTime=null,t=i*l)}t*=this._updateTimeScale(e);const o=this._updateTime(t),a=this._updateWeight(e);if(a>0){const l=this._interpolants,g=this._propertyBindings;switch(this.blendMode){case iy:for(let u=0,C=l.length;u!==C;++u)l[u].evaluate(o),g[u].accumulateAdditive(a);break;case np:default:for(let u=0,C=l.length;u!==C;++u)l[u].evaluate(o),g[u].accumulate(s,a)}}}_updateWeight(e){let t=0;if(this.enabled){t=this.weight;const i=this._weightInterpolant;if(i!==null){const s=i.evaluate(e)[0];t*=s,e>i.parameterPositions[1]&&(this.stopFading(),s===0&&(this.enabled=!1))}}return this._effectiveWeight=t,t}_updateTimeScale(e){let t=0;if(!this.paused){t=this.timeScale;const i=this._timeScaleInterpolant;if(i!==null){const s=i.evaluate(e)[0];t*=s,e>i.parameterPositions[1]&&(this.stopWarping(),t===0?this.paused=!0:this.timeScale=t)}}return this._effectiveTimeScale=t,t}_updateTime(e){const t=this._clip.duration,i=this.loop;let s=this.time+e,r=this._loopCount;const o=i===BW;if(e===0)return r===-1?s:o&&(r&1)===1?t-s:s;if(i===yW){r===-1&&(this._loopCount=0,this._setEndings(!0,!0,!1));e:{if(s>=t)s=t;else if(s<0)s=0;else{this.time=s;break e}this.clampWhenFinished?this.paused=!0:this.enabled=!1,this.time=s,this._mixer.dispatchEvent({type:"finished",action:this,direction:e<0?-1:1})}}else{if(r===-1&&(e>=0?(r=0,this._setEndings(!0,this.repetitions===0,o)):this._setEndings(this.repetitions===0,!0,o)),s>=t||s<0){const a=Math.floor(s/t);s-=t*a,r+=Math.abs(a);const l=this.repetitions-r;if(l<=0)this.clampWhenFinished?this.paused=!0:this.enabled=!1,s=e>0?t:0,this.time=s,this._mixer.dispatchEvent({type:"finished",action:this,direction:e>0?1:-1});else{if(l===1){const g=e<0;this._setEndings(g,!g,o)}else this._setEndings(!1,!1,o);this._loopCount=r,this.time=s,this._mixer.dispatchEvent({type:"loop",action:this,loopDelta:a})}}else this.time=s;if(o&&(r&1)===1)return t-s}return s}_setEndings(e,t,i){const s=this._interpolantSettings;i?(s.endingStart=cl,s.endingEnd=cl):(e?s.endingStart=this.zeroSlopeAtStart?cl:gl:s.endingStart=Fu,t?s.endingEnd=this.zeroSlopeAtEnd?cl:gl:s.endingEnd=Fu)}_scheduleFading(e,t,i){const s=this._mixer,r=s.time;let o=this._weightInterpolant;o===null&&(o=s._lendControlInterpolant(),this._weightInterpolant=o);const a=o.parameterPositions,l=o.sampleValues;return a[0]=r,l[0]=t,a[1]=r+e,l[1]=i,this}}const $E=new Float32Array(1);class eT extends Ps{constructor(e){super(),this._root=e,this._initMemoryManager(),this._accuIndex=0,this.time=0,this.timeScale=1}_bindAction(e,t){const i=e._localRoot||this._root,s=e._clip.tracks,r=s.length,o=e._propertyBindings,a=e._interpolants,l=i.uuid,g=this._bindingsByRootAndName;let u=g[l];u===void 0&&(u={},g[l]=u);for(let C=0;C!==r;++C){const d=s[C],h=d.name;let f=u[h];if(f!==void 0)++f.referenceCount,o[C]=f;else{if(f=o[C],f!==void 0){f._cacheIndex===null&&(++f.referenceCount,this._addInactiveBinding(f,l,h));continue}const v=t&&t._propertyBindings[C].binding.parsedPath;f=new MV(Et.create(i,h,v),d.ValueTypeName,d.getValueSize()),++f.referenceCount,this._addInactiveBinding(f,l,h),o[C]=f}a[C].resultBuffer=f.buffer}}_activateAction(e){if(!this._isActiveAction(e)){if(e._cacheIndex===null){const i=(e._localRoot||this._root).uuid,s=e._clip.uuid,r=this._actionsByClip[s];this._bindAction(e,r&&r.knownActions[0]),this._addInactiveAction(e,s,i)}const t=e._propertyBindings;for(let i=0,s=t.length;i!==s;++i){const r=t[i];r.useCount++===0&&(this._lendBinding(r),r.saveOriginalState())}this._lendAction(e)}}_deactivateAction(e){if(this._isActiveAction(e)){const t=e._propertyBindings;for(let i=0,s=t.length;i!==s;++i){const r=t[i];--r.useCount===0&&(r.restoreOriginalState(),this._takeBackBinding(r))}this._takeBackAction(e)}}_initMemoryManager(){this._actions=[],this._nActiveActions=0,this._actionsByClip={},this._bindings=[],this._nActiveBindings=0,this._bindingsByRootAndName={},this._controlInterpolants=[],this._nActiveControlInterpolants=0;const e=this;this.stats={actions:{get total(){return e._actions.length},get inUse(){return e._nActiveActions}},bindings:{get total(){return e._bindings.length},get inUse(){return e._nActiveBindings}},controlInterpolants:{get total(){return e._controlInterpolants.length},get inUse(){return e._nActiveControlInterpolants}}}}_isActiveAction(e){const t=e._cacheIndex;return t!==null&&t=0;--i)e[i].stop();return this}update(e){e*=this.timeScale;const t=this._actions,i=this._nActiveActions,s=this.time+=e,r=Math.sign(e),o=this._accuIndex^=1;for(let g=0;g!==i;++g)t[g]._update(s,e,r,o);const a=this._bindings,l=this._nActiveBindings;for(let g=0;g!==l;++g)a[g].apply(o);return this}setTime(e){this.time=0;for(let t=0;tthis.max.x||e.ythis.max.y)}containsBox(e){return this.min.x<=e.min.x&&e.max.x<=this.max.x&&this.min.y<=e.min.y&&e.max.y<=this.max.y}getParameter(e,t){return t.set((e.x-this.min.x)/(this.max.x-this.min.x),(e.y-this.min.y)/(this.max.y-this.min.y))}intersectsBox(e){return!(e.max.xthis.max.x||e.max.ythis.max.y)}clampPoint(e,t){return t.copy(e).clamp(this.min,this.max)}distanceToPoint(e){return this.clampPoint(e,bw).distanceTo(e)}intersect(e){return this.min.max(e.min),this.max.min(e.max),this.isEmpty()&&this.makeEmpty(),this}union(e){return this.min.min(e.min),this.max.max(e.max),this}translate(e){return this.min.add(e),this.max.add(e),this}equals(e){return e.min.equals(this.min)&&e.max.equals(this.max)}}const vw=new H,Ch=new H;class aT{constructor(e=new H,t=new H){this.start=e,this.end=t}set(e,t){return this.start.copy(e),this.end.copy(t),this}copy(e){return this.start.copy(e.start),this.end.copy(e.end),this}getCenter(e){return e.addVectors(this.start,this.end).multiplyScalar(.5)}delta(e){return e.subVectors(this.end,this.start)}distanceSq(){return this.start.distanceToSquared(this.end)}distance(){return this.start.distanceTo(this.end)}at(e,t){return this.delta(t).multiplyScalar(e).add(this.start)}closestPointToPointParameter(e,t){vw.subVectors(e,this.start),Ch.subVectors(this.end,this.start);const i=Ch.dot(Ch);let r=Ch.dot(vw)/i;return t&&(r=Sn(r,0,1)),r}closestPointToPoint(e,t,i){const s=this.closestPointToPointParameter(e,t);return this.delta(i).multiplyScalar(s).add(this.start)}applyMatrix4(e){return this.start.applyMatrix4(e),this.end.applyMatrix4(e),this}equals(e){return e.start.equals(this.start)&&e.end.equals(this.end)}clone(){return new this.constructor().copy(this)}}const yw=new H;class lT extends zt{constructor(e,t){super(),this.light=e,this.matrix=e.matrixWorld,this.matrixAutoUpdate=!1,this.color=t,this.type="SpotLightHelper";const i=new Gt,s=[0,0,0,0,0,1,0,0,0,1,0,1,0,0,0,-1,0,1,0,0,0,0,1,1,0,0,0,0,-1,1];for(let o=0,a=1,l=32;o1)for(let C=0;C.99999)this.quaternion.set(0,0,0,1);else if(e.y<-.99999)this.quaternion.set(1,0,0,0);else{Sw.set(e.z,0,-e.x).normalize();const t=Math.acos(e.y);this.quaternion.setFromAxisAngle(Sw,t)}}setLength(e,t=e*.2,i=t*.2){this.line.scale.set(1,Math.max(1e-4,e-t),1),this.line.updateMatrix(),this.cone.scale.set(i,t,i),this.cone.position.y=e,this.cone.updateMatrix()}setColor(e){this.line.material.color.set(e),this.cone.material.color.set(e)}copy(e){return super.copy(e,!1),this.line.copy(e.line),this.cone.copy(e.cone),this}dispose(){this.line.geometry.dispose(),this.line.material.dispose(),this.cone.geometry.dispose(),this.cone.material.dispose()}}class vT extends Ur{constructor(e=1){const t=[0,0,0,e,0,0,0,0,0,0,e,0,0,0,0,0,0,e],i=[1,0,0,1,.6,0,0,1,0,.6,1,0,0,0,1,0,.6,1],s=new Gt;s.setAttribute("position",new je(t,3)),s.setAttribute("color",new je(i,3));const r=new Ti({vertexColors:!0,toneMapped:!1});super(s,r),this.type="AxesHelper"}setColors(e,t,i){const s=new Xe,r=this.geometry.attributes.color.array;return s.set(e),s.toArray(r,0),s.toArray(r,3),s.set(t),s.toArray(r,6),s.toArray(r,9),s.set(i),s.toArray(r,12),s.toArray(r,15),this.geometry.attributes.color.needsUpdate=!0,this}dispose(){this.geometry.dispose(),this.material.dispose()}}class yT{constructor(){this.type="ShapePath",this.color=new Xe,this.subPaths=[],this.currentPath=null}moveTo(e,t){return this.currentPath=new zu,this.subPaths.push(this.currentPath),this.currentPath.moveTo(e,t),this}lineTo(e,t){return this.currentPath.lineTo(e,t),this}quadraticCurveTo(e,t,i,s){return this.currentPath.quadraticCurveTo(e,t,i,s),this}bezierCurveTo(e,t,i,s,r,o){return this.currentPath.bezierCurveTo(e,t,i,s,r,o),this}splineThru(e){return this.currentPath.splineThru(e),this}toShapes(e){function t(A){const b=[];for(let m=0,B=A.length;mNumber.EPSILON){if(V<0&&(R=b[x],Z=-Z,M=b[S],V=-V),A.yM.y)continue;if(A.y===R.y){if(A.x===R.x)return!0}else{const N=V*(A.x-R.x)-Z*(A.y-R.y);if(N===0)return!0;if(N<0)continue;B=!B}}else{if(A.y!==R.y)continue;if(M.x<=A.x&&A.x<=R.x||R.x<=A.x&&A.x<=M.x)return!0}}return B}const s=Lr.isClockWise,r=this.subPaths;if(r.length===0)return[];let o,a,l;const g=[];if(r.length===1)return a=r[0],l=new bl,l.curves=a.curves,g.push(l),g;let u=!s(r[0].getPoints());u=e?!u:u;const C=[],d=[];let h=[],f=0,v;d[f]=void 0,h[f]=[];for(let A=0,b=r.length;A1){let A=!1,b=0;for(let m=0,B=d.length;m0&&A===!1&&(h=C)}let y;for(let A=0,b=d.length;Au||s.y>u)&&(s.x>u&&(r.x=Math.floor(u/z.x),s.x=r.x*z.x,Ce.mapSize.x=r.x),s.y>u&&(r.y=Math.floor(u/z.y),s.y=r.y*z.y,Ce.mapSize.y=r.y)),Ce.map===null||P===!0||U===!0){const J=this.type!==cr?{minFilter:vt,magFilter:vt}:{};Ce.map!==null&&Ce.map.dispose(),Ce.map=new Nt(s.x,s.y,J),Ce.map.texture.name=he.name+".shadowMap",Ce.camera.updateProjectionMatrix()}n.setRenderTarget(Ce.map),n.clear();const Q=Ce.getViewportCount();for(let J=0;J0||x.map&&x.alphaTest>0){const N=Z.uuid,P=x.uuid;let U=g[N];U===void 0&&(U={},g[N]=U);let q=U[P];q===void 0&&(q=Z.clone(),U[P]=q),Z=q}if(Z.visible=x.visible,Z.wireframe=x.wireframe,M===cr?Z.side=x.shadowSide!==null?x.shadowSide:x.side:Z.side=x.shadowSide!==null?x.shadowSide:C[x.side],Z.alphaMap=x.alphaMap,Z.alphaTest=x.alphaTest,Z.map=x.map,Z.clipShadows=x.clipShadows,Z.clippingPlanes=x.clippingPlanes,Z.clipIntersection=x.clipIntersection,Z.displacementMap=x.displacementMap,Z.displacementScale=x.displacementScale,Z.displacementBias=x.displacementBias,Z.wireframeLinewidth=x.wireframeLinewidth,Z.linewidth=x.linewidth,R.isPointLight===!0&&Z.isMeshDistanceMaterial===!0){const N=n.properties.get(Z);N.light=R}return Z}function B(S,x,R,M,Z){if(S.visible===!1)return;if(S.layers.test(x.layers)&&(S.isMesh||S.isLine||S.isPoints)&&(S.castShadow||S.receiveShadow&&Z===cr)&&(!S.frustumCulled||i.intersectsObject(S))){S.modelViewMatrix.multiplyMatrices(R.matrixWorldInverse,S.matrixWorld);const P=e.update(S),U=S.material;if(Array.isArray(U)){const q=P.groups;for(let ie=0,he=q.length;ie=1):z.indexOf("OpenGL ES")!==-1&&(Ce=parseFloat(/^OpenGL ES (\d)/.exec(z)[1]),he=Ce>=2);let Q=null,J={};const le=n.getParameter(n.SCISSOR_BOX),se=n.getParameter(n.VIEWPORT),te=new Yt().fromArray(le),ge=new Yt().fromArray(se);function Ze(_,ce,Ge,Ne){const Te=new Uint8Array(4),At=n.createTexture();n.bindTexture(_,At),n.texParameteri(_,n.TEXTURE_MIN_FILTER,n.NEAREST),n.texParameteri(_,n.TEXTURE_MAG_FILTER,n.NEAREST);for(let Xt=0;Xt"u"?!1:/OculusBrowser/g.test(navigator.userAgent),f=new WeakMap;let v;const y=new WeakMap;let A=!1;try{A=typeof OffscreenCanvas<"u"&&new OffscreenCanvas(1,1).getContext("2d")!==null}catch{}function b(T,X){return A?new OffscreenCanvas(T,X):zu("canvas")}function m(T,X,de,xe){let We=1;if((T.width>xe||T.height>xe)&&(We=xe/Math.max(T.width,T.height)),We<1||X===!0)if(typeof HTMLImageElement<"u"&&T instanceof HTMLImageElement||typeof HTMLCanvasElement<"u"&&T instanceof HTMLCanvasElement||typeof ImageBitmap<"u"&&T instanceof ImageBitmap){const Ee=X?RW:Math.floor,lt=Ee(We*T.width),Je=Ee(We*T.height);v===void 0&&(v=b(lt,Je));const D=de?b(lt,Je):v;return D.width=lt,D.height=Je,D.getContext("2d").drawImage(T,0,0,lt,Je),console.warn("THREE.WebGLRenderer: Texture has been resized from ("+T.width+"x"+T.height+") to ("+lt+"x"+Je+")."),D}else return"data"in T&&console.warn("THREE.WebGLRenderer: Image in DataTexture is too big ("+T.width+"x"+T.height+")."),T;return T}function B(T){return Zb(T.width)&&Zb(T.height)}function S(T){return a?!1:T.wrapS!==Pn||T.wrapT!==Pn||T.minFilter!==vt&&T.minFilter!==st}function x(T,X){return T.generateMipmaps&&X&&T.minFilter!==vt&&T.minFilter!==st}function R(T){n.generateMipmap(T)}function M(T,X,de,xe,We=!1){if(a===!1)return X;if(T!==null){if(n[T]!==void 0)return n[T];console.warn("THREE.WebGLRenderer: Attempt to use non-existing WebGL internal format '"+T+"'")}let Ee=X;return X===n.RED&&(de===n.FLOAT&&(Ee=n.R32F),de===n.HALF_FLOAT&&(Ee=n.R16F),de===n.UNSIGNED_BYTE&&(Ee=n.R8)),X===n.RG&&(de===n.FLOAT&&(Ee=n.RG32F),de===n.HALF_FLOAT&&(Ee=n.RG16F),de===n.UNSIGNED_BYTE&&(Ee=n.RG8)),X===n.RGBA&&(de===n.FLOAT&&(Ee=n.RGBA32F),de===n.HALF_FLOAT&&(Ee=n.RGBA16F),de===n.UNSIGNED_BYTE&&(Ee=xe===yt&&We===!1?n.SRGB8_ALPHA8:n.RGBA8),de===n.UNSIGNED_SHORT_4_4_4_4&&(Ee=n.RGBA4),de===n.UNSIGNED_SHORT_5_5_5_1&&(Ee=n.RGB5_A1)),(Ee===n.R16F||Ee===n.R32F||Ee===n.RG16F||Ee===n.RG32F||Ee===n.RGBA16F||Ee===n.RGBA32F)&&e.get("EXT_color_buffer_float"),Ee}function Z(T,X,de){return x(T,de)===!0||T.isFramebufferTexture&&T.minFilter!==vt&&T.minFilter!==st?Math.log2(Math.max(X.width,X.height))+1:T.mipmaps!==void 0&&T.mipmaps.length>0?T.mipmaps.length:T.isCompressedTexture&&Array.isArray(T.image)?X.mipmaps.length:1}function V(T){return T===vt||T===SA||T===iu?n.NEAREST:n.LINEAR}function N(T){const X=T.target;X.removeEventListener("dispose",N),U(X),X.isVideoTexture&&f.delete(X)}function P(T){const X=T.target;X.removeEventListener("dispose",P),ie(X)}function U(T){const X=i.get(T);if(X.__webglInit===void 0)return;const de=T.source,xe=y.get(de);if(xe){const We=xe[X.__cacheKey];We.usedTimes--,We.usedTimes===0&&q(T),Object.keys(xe).length===0&&y.delete(de)}i.remove(T)}function q(T){const X=i.get(T);n.deleteTexture(X.__webglTexture);const de=T.source,xe=y.get(de);delete xe[X.__cacheKey],o.memory.textures--}function ie(T){const X=T.texture,de=i.get(T),xe=i.get(X);if(xe.__webglTexture!==void 0&&(n.deleteTexture(xe.__webglTexture),o.memory.textures--),T.depthTexture&&T.depthTexture.dispose(),T.isWebGLCubeRenderTarget)for(let We=0;We<6;We++)n.deleteFramebuffer(de.__webglFramebuffer[We]),de.__webglDepthbuffer&&n.deleteRenderbuffer(de.__webglDepthbuffer[We]);else{if(n.deleteFramebuffer(de.__webglFramebuffer),de.__webglDepthbuffer&&n.deleteRenderbuffer(de.__webglDepthbuffer),de.__webglMultisampledFramebuffer&&n.deleteFramebuffer(de.__webglMultisampledFramebuffer),de.__webglColorRenderbuffer)for(let We=0;We=l&&console.warn("THREE.WebGLTextures: Trying to use "+T+" texture units while this GPU supports only "+l),he+=1,T}function Q(T){const X=[];return X.push(T.wrapS),X.push(T.wrapT),X.push(T.wrapR||0),X.push(T.magFilter),X.push(T.minFilter),X.push(T.anisotropy),X.push(T.internalFormat),X.push(T.format),X.push(T.type),X.push(T.generateMipmaps),X.push(T.premultiplyAlpha),X.push(T.flipY),X.push(T.unpackAlignment),X.push(T.colorSpace),X.join()}function J(T,X){const de=i.get(T);if(T.isVideoTexture&&Ct(T),T.isRenderTargetTexture===!1&&T.version>0&&de.__version!==T.version){const xe=T.image;if(xe===null)console.warn("THREE.WebGLRenderer: Texture marked for update but no image data found.");else if(xe.complete===!1)console.warn("THREE.WebGLRenderer: Texture marked for update but image is incomplete");else{ot(de,T,X);return}}t.bindTexture(n.TEXTURE_2D,de.__webglTexture,n.TEXTURE0+X)}function le(T,X){const de=i.get(T);if(T.version>0&&de.__version!==T.version){ot(de,T,X);return}t.bindTexture(n.TEXTURE_2D_ARRAY,de.__webglTexture,n.TEXTURE0+X)}function se(T,X){const de=i.get(T);if(T.version>0&&de.__version!==T.version){ot(de,T,X);return}t.bindTexture(n.TEXTURE_3D,de.__webglTexture,n.TEXTURE0+X)}function te(T,X){const de=i.get(T);if(T.version>0&&de.__version!==T.version){ct(de,T,X);return}t.bindTexture(n.TEXTURE_CUBE_MAP,de.__webglTexture,n.TEXTURE0+X)}const ge={[Gs]:n.REPEAT,[Pn]:n.CLAMP_TO_EDGE,[Hu]:n.MIRRORED_REPEAT},Ze={[vt]:n.NEAREST,[SA]:n.NEAREST_MIPMAP_NEAREST,[iu]:n.NEAREST_MIPMAP_LINEAR,[st]:n.LINEAR,[$v]:n.LINEAR_MIPMAP_NEAREST,[ba]:n.LINEAR_MIPMAP_LINEAR};function Re(T,X,de){if(de?(n.texParameteri(T,n.TEXTURE_WRAP_S,ge[X.wrapS]),n.texParameteri(T,n.TEXTURE_WRAP_T,ge[X.wrapT]),(T===n.TEXTURE_3D||T===n.TEXTURE_2D_ARRAY)&&n.texParameteri(T,n.TEXTURE_WRAP_R,ge[X.wrapR]),n.texParameteri(T,n.TEXTURE_MAG_FILTER,Ze[X.magFilter]),n.texParameteri(T,n.TEXTURE_MIN_FILTER,Ze[X.minFilter])):(n.texParameteri(T,n.TEXTURE_WRAP_S,n.CLAMP_TO_EDGE),n.texParameteri(T,n.TEXTURE_WRAP_T,n.CLAMP_TO_EDGE),(T===n.TEXTURE_3D||T===n.TEXTURE_2D_ARRAY)&&n.texParameteri(T,n.TEXTURE_WRAP_R,n.CLAMP_TO_EDGE),(X.wrapS!==Pn||X.wrapT!==Pn)&&console.warn("THREE.WebGLRenderer: Texture is not power of two. Texture.wrapS and Texture.wrapT should be set to THREE.ClampToEdgeWrapping."),n.texParameteri(T,n.TEXTURE_MAG_FILTER,V(X.magFilter)),n.texParameteri(T,n.TEXTURE_MIN_FILTER,V(X.minFilter)),X.minFilter!==vt&&X.minFilter!==st&&console.warn("THREE.WebGLRenderer: Texture is not power of two. Texture.minFilter should be set to THREE.NearestFilter or THREE.LinearFilter.")),e.has("EXT_texture_filter_anisotropic")===!0){const xe=e.get("EXT_texture_filter_anisotropic");if(X.magFilter===vt||X.minFilter!==iu&&X.minFilter!==ba||X.type===Wn&&e.has("OES_texture_float_linear")===!1||a===!1&&X.type===bs&&e.has("OES_texture_half_float_linear")===!1)return;(X.anisotropy>1||i.get(X).__currentAnisotropy)&&(n.texParameterf(T,xe.TEXTURE_MAX_ANISOTROPY_EXT,Math.min(X.anisotropy,s.getMaxAnisotropy())),i.get(X).__currentAnisotropy=X.anisotropy)}}function O(T,X){let de=!1;T.__webglInit===void 0&&(T.__webglInit=!0,X.addEventListener("dispose",N));const xe=X.source;let We=y.get(xe);We===void 0&&(We={},y.set(xe,We));const Ee=Q(X);if(Ee!==T.__cacheKey){We[Ee]===void 0&&(We[Ee]={texture:n.createTexture(),usedTimes:0},o.memory.textures++,de=!0),We[Ee].usedTimes++;const lt=We[T.__cacheKey];lt!==void 0&&(We[T.__cacheKey].usedTimes--,lt.usedTimes===0&&q(X)),T.__cacheKey=Ee,T.__webglTexture=We[Ee].texture}return de}function ot(T,X,de){let xe=n.TEXTURE_2D;(X.isDataArrayTexture||X.isCompressedArrayTexture)&&(xe=n.TEXTURE_2D_ARRAY),X.isData3DTexture&&(xe=n.TEXTURE_3D);const We=O(T,X),Ee=X.source;t.bindTexture(xe,T.__webglTexture,n.TEXTURE0+de);const lt=i.get(Ee);if(Ee.version!==lt.__version||We===!0){t.activeTexture(n.TEXTURE0+de),n.pixelStorei(n.UNPACK_FLIP_Y_WEBGL,X.flipY),n.pixelStorei(n.UNPACK_PREMULTIPLY_ALPHA_WEBGL,X.premultiplyAlpha),n.pixelStorei(n.UNPACK_ALIGNMENT,X.unpackAlignment),n.pixelStorei(n.UNPACK_COLORSPACE_CONVERSION_WEBGL,n.NONE);const Je=S(X)&&B(X.image)===!1;let D=m(X.image,Je,!1,u);D=Ht(X,D);const $=B(D)||a,Ie=r.convert(X.format,X.colorSpace);let ye=r.convert(X.type),be=M(X.internalFormat,Ie,ye,X.colorSpace);Re(xe,X,$);let Se;const ze=X.mipmaps,Ye=a&&X.isVideoTexture!==!0,Ke=lt.__version===void 0||We===!0,_=Z(X,D,$);if(X.isDepthTexture)be=n.DEPTH_COMPONENT,a?X.type===Wn?be=n.DEPTH_COMPONENT32F:X.type===Ao?be=n.DEPTH_COMPONENT24:X.type===da?be=n.DEPTH24_STENCIL8:be=n.DEPTH_COMPONENT16:X.type===Wn&&console.error("WebGLRenderer: Floating point depth texture requires WebGL2."),X.format===ha&&be===n.DEPTH_COMPONENT&&X.type!==ey&&X.type!==Ao&&(console.warn("THREE.WebGLRenderer: Use UnsignedShortType or UnsignedIntType for DepthFormat DepthTexture."),X.type=Ao,ye=r.convert(X.type)),X.format===va&&be===n.DEPTH_COMPONENT&&(be=n.DEPTH_STENCIL,X.type!==da&&(console.warn("THREE.WebGLRenderer: Use UnsignedInt248Type for DepthStencilFormat DepthTexture."),X.type=da,ye=r.convert(X.type))),Ke&&(Ye?t.texStorage2D(n.TEXTURE_2D,1,be,D.width,D.height):t.texImage2D(n.TEXTURE_2D,0,be,D.width,D.height,0,Ie,ye,null));else if(X.isDataTexture)if(ze.length>0&&$){Ye&&Ke&&t.texStorage2D(n.TEXTURE_2D,_,be,ze[0].width,ze[0].height);for(let ce=0,Ge=ze.length;ce>=1,Ge>>=1}}else if(ze.length>0&&$){Ye&&Ke&&t.texStorage2D(n.TEXTURE_2D,_,be,ze[0].width,ze[0].height);for(let ce=0,Ge=ze.length;ce0&&Ke++,t.texStorage2D(n.TEXTURE_CUBE_MAP,Ke,Se,D[0].width,D[0].height));for(let ce=0;ce<6;ce++)if(Je){ze?t.texSubImage2D(n.TEXTURE_CUBE_MAP_POSITIVE_X+ce,0,0,0,D[ce].width,D[ce].height,ye,be,D[ce].data):t.texImage2D(n.TEXTURE_CUBE_MAP_POSITIVE_X+ce,0,Se,D[ce].width,D[ce].height,0,ye,be,D[ce].data);for(let Ge=0;Ge<_.length;Ge++){const Te=_[Ge].image[ce].image;ze?t.texSubImage2D(n.TEXTURE_CUBE_MAP_POSITIVE_X+ce,Ge+1,0,0,Te.width,Te.height,ye,be,Te.data):t.texImage2D(n.TEXTURE_CUBE_MAP_POSITIVE_X+ce,Ge+1,Se,Te.width,Te.height,0,ye,be,Te.data)}}else{ze?t.texSubImage2D(n.TEXTURE_CUBE_MAP_POSITIVE_X+ce,0,0,0,ye,be,D[ce]):t.texImage2D(n.TEXTURE_CUBE_MAP_POSITIVE_X+ce,0,Se,ye,be,D[ce]);for(let Ge=0;Ge<_.length;Ge++){const Ne=_[Ge];ze?t.texSubImage2D(n.TEXTURE_CUBE_MAP_POSITIVE_X+ce,Ge+1,0,0,ye,be,Ne.image[ce]):t.texImage2D(n.TEXTURE_CUBE_MAP_POSITIVE_X+ce,Ge+1,Se,ye,be,Ne.image[ce])}}}x(X,Ie)&&R(n.TEXTURE_CUBE_MAP),Ee.__version=We.version,X.onUpdate&&X.onUpdate(X)}T.__version=X.version}function Me(T,X,de,xe,We){const Ee=r.convert(de.format,de.colorSpace),lt=r.convert(de.type),Je=M(de.internalFormat,Ee,lt,de.colorSpace);i.get(X).__hasExternalTextures||(We===n.TEXTURE_3D||We===n.TEXTURE_2D_ARRAY?t.texImage3D(We,0,Je,X.width,X.height,X.depth,0,Ee,lt,null):t.texImage2D(We,0,Je,X.width,X.height,0,Ee,lt,null)),t.bindFramebuffer(n.FRAMEBUFFER,T),nt(X)?d.framebufferTexture2DMultisampleEXT(n.FRAMEBUFFER,xe,We,i.get(de).__webglTexture,0,at(X)):(We===n.TEXTURE_2D||We>=n.TEXTURE_CUBE_MAP_POSITIVE_X&&We<=n.TEXTURE_CUBE_MAP_NEGATIVE_Z)&&n.framebufferTexture2D(n.FRAMEBUFFER,xe,We,i.get(de).__webglTexture,0),t.bindFramebuffer(n.FRAMEBUFFER,null)}function Ue(T,X,de){if(n.bindRenderbuffer(n.RENDERBUFFER,T),X.depthBuffer&&!X.stencilBuffer){let xe=n.DEPTH_COMPONENT16;if(de||nt(X)){const We=X.depthTexture;We&&We.isDepthTexture&&(We.type===Wn?xe=n.DEPTH_COMPONENT32F:We.type===Ao&&(xe=n.DEPTH_COMPONENT24));const Ee=at(X);nt(X)?d.renderbufferStorageMultisampleEXT(n.RENDERBUFFER,Ee,xe,X.width,X.height):n.renderbufferStorageMultisample(n.RENDERBUFFER,Ee,xe,X.width,X.height)}else n.renderbufferStorage(n.RENDERBUFFER,xe,X.width,X.height);n.framebufferRenderbuffer(n.FRAMEBUFFER,n.DEPTH_ATTACHMENT,n.RENDERBUFFER,T)}else if(X.depthBuffer&&X.stencilBuffer){const xe=at(X);de&&nt(X)===!1?n.renderbufferStorageMultisample(n.RENDERBUFFER,xe,n.DEPTH24_STENCIL8,X.width,X.height):nt(X)?d.renderbufferStorageMultisampleEXT(n.RENDERBUFFER,xe,n.DEPTH24_STENCIL8,X.width,X.height):n.renderbufferStorage(n.RENDERBUFFER,n.DEPTH_STENCIL,X.width,X.height),n.framebufferRenderbuffer(n.FRAMEBUFFER,n.DEPTH_STENCIL_ATTACHMENT,n.RENDERBUFFER,T)}else{const xe=X.isWebGLMultipleRenderTargets===!0?X.texture:[X.texture];for(let We=0;We0&&nt(T)===!1){const Je=Ee?X:[X];de.__webglMultisampledFramebuffer=n.createFramebuffer(),de.__webglColorRenderbuffer=[],t.bindFramebuffer(n.FRAMEBUFFER,de.__webglMultisampledFramebuffer);for(let D=0;D0&&nt(T)===!1){const X=T.isWebGLMultipleRenderTargets?T.texture:[T.texture],de=T.width,xe=T.height;let We=n.COLOR_BUFFER_BIT;const Ee=[],lt=T.stencilBuffer?n.DEPTH_STENCIL_ATTACHMENT:n.DEPTH_ATTACHMENT,Je=i.get(T),D=T.isWebGLMultipleRenderTargets===!0;if(D)for(let $=0;$0&&e.has("WEBGL_multisampled_render_to_texture")===!0&&X.__useRenderToTexture!==!1}function Ct(T){const X=o.render.frame;f.get(T)!==X&&(f.set(T,X),T.update())}function Ht(T,X){const de=T.colorSpace,xe=T.format,We=T.type;return T.isCompressedTexture===!0||T.format===RA||de!==fr&&de!==vo&&(de===yt?a===!1?e.has("EXT_sRGB")===!0&&xe===An?(T.format=RA,T.minFilter=st,T.generateMipmaps=!1):X=oy.sRGBToLinear(X):(xe!==An||We!==cn)&&console.warn("THREE.WebGLTextures: sRGB encoded textures have to use RGBAFormat and UnsignedByteType."):console.error("THREE.WebGLTextures: Unsupported texture color space:",de)),X}this.allocateTextureUnit=z,this.resetTextureUnits=Ce,this.setTexture2D=J,this.setTexture2DArray=le,this.setTexture3D=se,this.setTextureCube=te,this.rebindTextures=we,this.setupRenderTarget=Pe,this.updateRenderTargetMipmap=Fe,this.updateMultisampleRenderTarget=qe,this.setupDepthRenderbuffer=fe,this.setupFrameBufferTexture=Me,this.useMultisampledRTT=nt}function EW(n,e,t){const i=t.isWebGL2;function s(r,o=vo){let a;if(r===cn)return n.UNSIGNED_BYTE;if(r===CW)return n.UNSIGNED_SHORT_4_4_4_4;if(r===dW)return n.UNSIGNED_SHORT_5_5_5_1;if(r===cW)return n.BYTE;if(r===IW)return n.SHORT;if(r===ey)return n.UNSIGNED_SHORT;if(r===uW)return n.INT;if(r===Ao)return n.UNSIGNED_INT;if(r===Wn)return n.FLOAT;if(r===bs)return i?n.HALF_FLOAT:(a=e.get("OES_texture_half_float"),a!==null?a.HALF_FLOAT_OES:null);if(r===hW)return n.ALPHA;if(r===An)return n.RGBA;if(r===tp)return n.LUMINANCE;if(r===AW)return n.LUMINANCE_ALPHA;if(r===ha)return n.DEPTH_COMPONENT;if(r===va)return n.DEPTH_STENCIL;if(r===RA)return a=e.get("EXT_sRGB"),a!==null?a.SRGB_ALPHA_EXT:null;if(r===ty)return n.RED;if(r===pW)return n.RED_INTEGER;if(r===ny)return n.RG;if(r===fW)return n.RG_INTEGER;if(r===mW)return n.RGBA_INTEGER;if(r===Uh||r===Ph||r===_h||r===Jh)if(o===yt)if(a=e.get("WEBGL_compressed_texture_s3tc_srgb"),a!==null){if(r===Uh)return a.COMPRESSED_SRGB_S3TC_DXT1_EXT;if(r===Ph)return a.COMPRESSED_SRGB_ALPHA_S3TC_DXT1_EXT;if(r===_h)return a.COMPRESSED_SRGB_ALPHA_S3TC_DXT3_EXT;if(r===Jh)return a.COMPRESSED_SRGB_ALPHA_S3TC_DXT5_EXT}else return null;else if(a=e.get("WEBGL_compressed_texture_s3tc"),a!==null){if(r===Uh)return a.COMPRESSED_RGB_S3TC_DXT1_EXT;if(r===Ph)return a.COMPRESSED_RGBA_S3TC_DXT1_EXT;if(r===_h)return a.COMPRESSED_RGBA_S3TC_DXT3_EXT;if(r===Jh)return a.COMPRESSED_RGBA_S3TC_DXT5_EXT}else return null;if(r===nb||r===ib||r===sb||r===rb)if(a=e.get("WEBGL_compressed_texture_pvrtc"),a!==null){if(r===nb)return a.COMPRESSED_RGB_PVRTC_4BPPV1_IMG;if(r===ib)return a.COMPRESSED_RGB_PVRTC_2BPPV1_IMG;if(r===sb)return a.COMPRESSED_RGBA_PVRTC_4BPPV1_IMG;if(r===rb)return a.COMPRESSED_RGBA_PVRTC_2BPPV1_IMG}else return null;if(r===bW)return a=e.get("WEBGL_compressed_texture_etc1"),a!==null?a.COMPRESSED_RGB_ETC1_WEBGL:null;if(r===ob||r===ab)if(a=e.get("WEBGL_compressed_texture_etc"),a!==null){if(r===ob)return o===yt?a.COMPRESSED_SRGB8_ETC2:a.COMPRESSED_RGB8_ETC2;if(r===ab)return o===yt?a.COMPRESSED_SRGB8_ALPHA8_ETC2_EAC:a.COMPRESSED_RGBA8_ETC2_EAC}else return null;if(r===lb||r===gb||r===cb||r===Ib||r===ub||r===Cb||r===db||r===hb||r===Ab||r===pb||r===fb||r===mb||r===bb||r===vb)if(a=e.get("WEBGL_compressed_texture_astc"),a!==null){if(r===lb)return o===yt?a.COMPRESSED_SRGB8_ALPHA8_ASTC_4x4_KHR:a.COMPRESSED_RGBA_ASTC_4x4_KHR;if(r===gb)return o===yt?a.COMPRESSED_SRGB8_ALPHA8_ASTC_5x4_KHR:a.COMPRESSED_RGBA_ASTC_5x4_KHR;if(r===cb)return o===yt?a.COMPRESSED_SRGB8_ALPHA8_ASTC_5x5_KHR:a.COMPRESSED_RGBA_ASTC_5x5_KHR;if(r===Ib)return o===yt?a.COMPRESSED_SRGB8_ALPHA8_ASTC_6x5_KHR:a.COMPRESSED_RGBA_ASTC_6x5_KHR;if(r===ub)return o===yt?a.COMPRESSED_SRGB8_ALPHA8_ASTC_6x6_KHR:a.COMPRESSED_RGBA_ASTC_6x6_KHR;if(r===Cb)return o===yt?a.COMPRESSED_SRGB8_ALPHA8_ASTC_8x5_KHR:a.COMPRESSED_RGBA_ASTC_8x5_KHR;if(r===db)return o===yt?a.COMPRESSED_SRGB8_ALPHA8_ASTC_8x6_KHR:a.COMPRESSED_RGBA_ASTC_8x6_KHR;if(r===hb)return o===yt?a.COMPRESSED_SRGB8_ALPHA8_ASTC_8x8_KHR:a.COMPRESSED_RGBA_ASTC_8x8_KHR;if(r===Ab)return o===yt?a.COMPRESSED_SRGB8_ALPHA8_ASTC_10x5_KHR:a.COMPRESSED_RGBA_ASTC_10x5_KHR;if(r===pb)return o===yt?a.COMPRESSED_SRGB8_ALPHA8_ASTC_10x6_KHR:a.COMPRESSED_RGBA_ASTC_10x6_KHR;if(r===fb)return o===yt?a.COMPRESSED_SRGB8_ALPHA8_ASTC_10x8_KHR:a.COMPRESSED_RGBA_ASTC_10x8_KHR;if(r===mb)return o===yt?a.COMPRESSED_SRGB8_ALPHA8_ASTC_10x10_KHR:a.COMPRESSED_RGBA_ASTC_10x10_KHR;if(r===bb)return o===yt?a.COMPRESSED_SRGB8_ALPHA8_ASTC_12x10_KHR:a.COMPRESSED_RGBA_ASTC_12x10_KHR;if(r===vb)return o===yt?a.COMPRESSED_SRGB8_ALPHA8_ASTC_12x12_KHR:a.COMPRESSED_RGBA_ASTC_12x12_KHR}else return null;if(r===Oh)if(a=e.get("EXT_texture_compression_bptc"),a!==null){if(r===Oh)return o===yt?a.COMPRESSED_SRGB_ALPHA_BPTC_UNORM_EXT:a.COMPRESSED_RGBA_BPTC_UNORM_EXT}else return null;if(r===vW||r===yb||r===Gb||r===Bb)if(a=e.get("EXT_texture_compression_rgtc"),a!==null){if(r===Oh)return a.COMPRESSED_RED_RGTC1_EXT;if(r===yb)return a.COMPRESSED_SIGNED_RED_RGTC1_EXT;if(r===Gb)return a.COMPRESSED_RED_GREEN_RGTC2_EXT;if(r===Bb)return a.COMPRESSED_SIGNED_RED_GREEN_RGTC2_EXT}else return null;return r===da?i?n.UNSIGNED_INT_24_8:(a=e.get("WEBGL_depth_texture"),a!==null?a.UNSIGNED_INT_24_8_WEBGL:null):n[r]!==void 0?n[r]:null}return{convert:s}}class TW extends mn{constructor(e=[]){super(),this.isArrayCamera=!0,this.cameras=e}}class Pg extends zt{constructor(){super(),this.isGroup=!0,this.type="Group"}}const FL={type:"move"};class vm{constructor(){this._targetRay=null,this._grip=null,this._hand=null}getHandSpace(){return this._hand===null&&(this._hand=new Pg,this._hand.matrixAutoUpdate=!1,this._hand.visible=!1,this._hand.joints={},this._hand.inputState={pinching:!1}),this._hand}getTargetRaySpace(){return this._targetRay===null&&(this._targetRay=new Pg,this._targetRay.matrixAutoUpdate=!1,this._targetRay.visible=!1,this._targetRay.hasLinearVelocity=!1,this._targetRay.linearVelocity=new H,this._targetRay.hasAngularVelocity=!1,this._targetRay.angularVelocity=new H),this._targetRay}getGripSpace(){return this._grip===null&&(this._grip=new Pg,this._grip.matrixAutoUpdate=!1,this._grip.visible=!1,this._grip.hasLinearVelocity=!1,this._grip.linearVelocity=new H,this._grip.hasAngularVelocity=!1,this._grip.angularVelocity=new H),this._grip}dispatchEvent(e){return this._targetRay!==null&&this._targetRay.dispatchEvent(e),this._grip!==null&&this._grip.dispatchEvent(e),this._hand!==null&&this._hand.dispatchEvent(e),this}connect(e){if(e&&e.hand){const t=this._hand;if(t)for(const i of e.hand.values())this._getHandJoint(t,i)}return this.dispatchEvent({type:"connected",data:e}),this}disconnect(e){return this.dispatchEvent({type:"disconnected",data:e}),this._targetRay!==null&&(this._targetRay.visible=!1),this._grip!==null&&(this._grip.visible=!1),this._hand!==null&&(this._hand.visible=!1),this}update(e,t,i){let s=null,r=null,o=null;const a=this._targetRay,l=this._grip,g=this._hand;if(e&&t.session.visibilityState!=="visible-blurred"){if(g&&e.hand){o=!0;for(const v of e.hand.values()){const y=t.getJointPose(v,i),A=this._getHandJoint(g,v);y!==null&&(A.matrix.fromArray(y.transform.matrix),A.matrix.decompose(A.position,A.rotation,A.scale),A.matrixWorldNeedsUpdate=!0,A.jointRadius=y.radius),A.visible=y!==null}const u=g.joints["index-finger-tip"],C=g.joints["thumb-tip"],d=u.position.distanceTo(C.position),h=.02,f=.005;g.inputState.pinching&&d>h+f?(g.inputState.pinching=!1,this.dispatchEvent({type:"pinchend",handedness:e.handedness,target:this})):!g.inputState.pinching&&d<=h-f&&(g.inputState.pinching=!0,this.dispatchEvent({type:"pinchstart",handedness:e.handedness,target:this}))}else l!==null&&e.gripSpace&&(r=t.getPose(e.gripSpace,i),r!==null&&(l.matrix.fromArray(r.transform.matrix),l.matrix.decompose(l.position,l.rotation,l.scale),l.matrixWorldNeedsUpdate=!0,r.linearVelocity?(l.hasLinearVelocity=!0,l.linearVelocity.copy(r.linearVelocity)):l.hasLinearVelocity=!1,r.angularVelocity?(l.hasAngularVelocity=!0,l.angularVelocity.copy(r.angularVelocity)):l.hasAngularVelocity=!1));a!==null&&(s=t.getPose(e.targetRaySpace,i),s===null&&r!==null&&(s=r),s!==null&&(a.matrix.fromArray(s.transform.matrix),a.matrix.decompose(a.position,a.rotation,a.scale),a.matrixWorldNeedsUpdate=!0,s.linearVelocity?(a.hasLinearVelocity=!0,a.linearVelocity.copy(s.linearVelocity)):a.hasLinearVelocity=!1,s.angularVelocity?(a.hasAngularVelocity=!0,a.angularVelocity.copy(s.angularVelocity)):a.hasAngularVelocity=!1,this.dispatchEvent(FL)))}return a!==null&&(a.visible=s!==null),l!==null&&(l.visible=r!==null),g!==null&&(g.visible=o!==null),this}_getHandJoint(e,t){if(e.joints[t.jointName]===void 0){const i=new Pg;i.matrixAutoUpdate=!1,i.visible=!1,e.joints[t.jointName]=i,e.add(i)}return e.joints[t.jointName]}}class lp extends sn{constructor(e,t,i,s,r,o,a,l,g,u){if(u=u!==void 0?u:ha,u!==ha&&u!==va)throw new Error("DepthTexture format must be either THREE.DepthFormat or THREE.DepthStencilFormat");i===void 0&&u===ha&&(i=Ao),i===void 0&&u===va&&(i=da),super(null,s,r,o,a,l,u,i,g),this.isDepthTexture=!0,this.image={width:e,height:t},this.magFilter=a!==void 0?a:vt,this.minFilter=l!==void 0?l:vt,this.flipY=!1,this.generateMipmaps=!1}}class YL extends Ps{constructor(e,t){super();const i=this;let s=null,r=1,o=null,a="local-floor",l=1,g=null,u=null,C=null,d=null,h=null,f=null;const v=t.getContextAttributes();let y=null,A=null;const b=[],m=[],B=new Set,S=new Map,x=new mn;x.layers.enable(1),x.viewport=new Yt;const R=new mn;R.layers.enable(2),R.viewport=new Yt;const M=[x,R],Z=new TW;Z.layers.enable(1),Z.layers.enable(2);let V=null,N=null;this.cameraAutoUpdate=!0,this.enabled=!1,this.isPresenting=!1,this.getController=function(te){let ge=b[te];return ge===void 0&&(ge=new vm,b[te]=ge),ge.getTargetRaySpace()},this.getControllerGrip=function(te){let ge=b[te];return ge===void 0&&(ge=new vm,b[te]=ge),ge.getGripSpace()},this.getHand=function(te){let ge=b[te];return ge===void 0&&(ge=new vm,b[te]=ge),ge.getHandSpace()};function P(te){const ge=m.indexOf(te.inputSource);if(ge===-1)return;const Ze=b[ge];Ze!==void 0&&(Ze.update(te.inputSource,te.frame,g||o),Ze.dispatchEvent({type:te.type,data:te.inputSource}))}function U(){s.removeEventListener("select",P),s.removeEventListener("selectstart",P),s.removeEventListener("selectend",P),s.removeEventListener("squeeze",P),s.removeEventListener("squeezestart",P),s.removeEventListener("squeezeend",P),s.removeEventListener("end",U),s.removeEventListener("inputsourceschange",q);for(let te=0;te=0&&(m[Re]=null,b[Re].disconnect(Ze))}for(let ge=0;ge=m.length){m.push(Ze),Re=ot;break}else if(m[ot]===null){m[ot]=Ze,Re=ot;break}if(Re===-1)break}const O=b[Re];O&&O.connect(Ze)}}const ie=new H,he=new H;function Ce(te,ge,Ze){ie.setFromMatrixPosition(ge.matrixWorld),he.setFromMatrixPosition(Ze.matrixWorld);const Re=ie.distanceTo(he),O=ge.projectionMatrix.elements,ot=Ze.projectionMatrix.elements,ct=O[14]/(O[10]-1),Me=O[14]/(O[10]+1),Ue=(O[9]+1)/O[5],Be=(O[9]-1)/O[5],fe=(O[8]-1)/O[0],we=(ot[8]+1)/ot[0],Pe=ct*fe,Fe=ct*we,qe=Re/(-fe+we),at=qe*-fe;ge.matrixWorld.decompose(te.position,te.quaternion,te.scale),te.translateX(at),te.translateZ(qe),te.matrixWorld.compose(te.position,te.quaternion,te.scale),te.matrixWorldInverse.copy(te.matrixWorld).invert();const nt=ct+qe,Ct=Me+qe,Ht=Pe-at,T=Fe+(Re-at),X=Ue*Me/Ct*nt,de=Be*Me/Ct*nt;te.projectionMatrix.makePerspective(Ht,T,X,de,nt,Ct),te.projectionMatrixInverse.copy(te.projectionMatrix).invert()}function z(te,ge){ge===null?te.matrixWorld.copy(te.matrix):te.matrixWorld.multiplyMatrices(ge.matrixWorld,te.matrix),te.matrixWorldInverse.copy(te.matrixWorld).invert()}this.updateCamera=function(te){if(s===null)return;Z.near=R.near=x.near=te.near,Z.far=R.far=x.far=te.far,(V!==Z.near||N!==Z.far)&&(s.updateRenderState({depthNear:Z.near,depthFar:Z.far}),V=Z.near,N=Z.far);const ge=te.parent,Ze=Z.cameras;z(Z,ge);for(let Re=0;ReO&&(S.set(Re,Re.lastChangedTime),i.dispatchEvent({type:"planechanged",data:Re}))}}f=null}const se=new FW;se.setAnimationLoop(le),this.setAnimationLoop=function(te){J=te},this.dispose=function(){}}}function KL(n,e){function t(y,A){y.matrixAutoUpdate===!0&&y.updateMatrix(),A.value.copy(y.matrix)}function i(y,A){A.color.getRGB(y.fogColor.value,HW(n)),A.isFog?(y.fogNear.value=A.near,y.fogFar.value=A.far):A.isFogExp2&&(y.fogDensity.value=A.density)}function s(y,A,b,m,B){A.isMeshBasicMaterial||A.isMeshLambertMaterial?r(y,A):A.isMeshToonMaterial?(r(y,A),C(y,A)):A.isMeshPhongMaterial?(r(y,A),u(y,A)):A.isMeshStandardMaterial?(r(y,A),d(y,A),A.isMeshPhysicalMaterial&&h(y,A,B)):A.isMeshMatcapMaterial?(r(y,A),f(y,A)):A.isMeshDepthMaterial?r(y,A):A.isMeshDistanceMaterial?(r(y,A),v(y,A)):A.isMeshNormalMaterial?r(y,A):A.isLineBasicMaterial?(o(y,A),A.isLineDashedMaterial&&a(y,A)):A.isPointsMaterial?l(y,A,b,m):A.isSpriteMaterial?g(y,A):A.isShadowMaterial?(y.color.value.copy(A.color),y.opacity.value=A.opacity):A.isShaderMaterial&&(A.uniformsNeedUpdate=!1)}function r(y,A){y.opacity.value=A.opacity,A.color&&y.diffuse.value.copy(A.color),A.emissive&&y.emissive.value.copy(A.emissive).multiplyScalar(A.emissiveIntensity),A.map&&(y.map.value=A.map,t(A.map,y.mapTransform)),A.alphaMap&&(y.alphaMap.value=A.alphaMap,t(A.alphaMap,y.alphaMapTransform)),A.bumpMap&&(y.bumpMap.value=A.bumpMap,t(A.bumpMap,y.bumpMapTransform),y.bumpScale.value=A.bumpScale,A.side===Jn&&(y.bumpScale.value*=-1)),A.normalMap&&(y.normalMap.value=A.normalMap,t(A.normalMap,y.normalMapTransform),y.normalScale.value.copy(A.normalScale),A.side===Jn&&y.normalScale.value.negate()),A.displacementMap&&(y.displacementMap.value=A.displacementMap,t(A.displacementMap,y.displacementMapTransform),y.displacementScale.value=A.displacementScale,y.displacementBias.value=A.displacementBias),A.emissiveMap&&(y.emissiveMap.value=A.emissiveMap,t(A.emissiveMap,y.emissiveMapTransform)),A.specularMap&&(y.specularMap.value=A.specularMap,t(A.specularMap,y.specularMapTransform)),A.alphaTest>0&&(y.alphaTest.value=A.alphaTest);const b=e.get(A).envMap;if(b&&(y.envMap.value=b,y.flipEnvMap.value=b.isCubeTexture&&b.isRenderTargetTexture===!1?-1:1,y.reflectivity.value=A.reflectivity,y.ior.value=A.ior,y.refractionRatio.value=A.refractionRatio),A.lightMap){y.lightMap.value=A.lightMap;const m=n.useLegacyLights===!0?Math.PI:1;y.lightMapIntensity.value=A.lightMapIntensity*m,t(A.lightMap,y.lightMapTransform)}A.aoMap&&(y.aoMap.value=A.aoMap,y.aoMapIntensity.value=A.aoMapIntensity,t(A.aoMap,y.aoMapTransform))}function o(y,A){y.diffuse.value.copy(A.color),y.opacity.value=A.opacity,A.map&&(y.map.value=A.map,t(A.map,y.mapTransform))}function a(y,A){y.dashSize.value=A.dashSize,y.totalSize.value=A.dashSize+A.gapSize,y.scale.value=A.scale}function l(y,A,b,m){y.diffuse.value.copy(A.color),y.opacity.value=A.opacity,y.size.value=A.size*b,y.scale.value=m*.5,A.map&&(y.map.value=A.map,t(A.map,y.uvTransform)),A.alphaMap&&(y.alphaMap.value=A.alphaMap),A.alphaTest>0&&(y.alphaTest.value=A.alphaTest)}function g(y,A){y.diffuse.value.copy(A.color),y.opacity.value=A.opacity,y.rotation.value=A.rotation,A.map&&(y.map.value=A.map,t(A.map,y.mapTransform)),A.alphaMap&&(y.alphaMap.value=A.alphaMap),A.alphaTest>0&&(y.alphaTest.value=A.alphaTest)}function u(y,A){y.specular.value.copy(A.specular),y.shininess.value=Math.max(A.shininess,1e-4)}function C(y,A){A.gradientMap&&(y.gradientMap.value=A.gradientMap)}function d(y,A){y.metalness.value=A.metalness,A.metalnessMap&&(y.metalnessMap.value=A.metalnessMap,t(A.metalnessMap,y.metalnessMapTransform)),y.roughness.value=A.roughness,A.roughnessMap&&(y.roughnessMap.value=A.roughnessMap,t(A.roughnessMap,y.roughnessMapTransform)),e.get(A).envMap&&(y.envMapIntensity.value=A.envMapIntensity)}function h(y,A,b){y.ior.value=A.ior,A.sheen>0&&(y.sheenColor.value.copy(A.sheenColor).multiplyScalar(A.sheen),y.sheenRoughness.value=A.sheenRoughness,A.sheenColorMap&&(y.sheenColorMap.value=A.sheenColorMap,t(A.sheenColorMap,y.sheenColorMapTransform)),A.sheenRoughnessMap&&(y.sheenRoughnessMap.value=A.sheenRoughnessMap,t(A.sheenRoughnessMap,y.sheenRoughnessMapTransform))),A.clearcoat>0&&(y.clearcoat.value=A.clearcoat,y.clearcoatRoughness.value=A.clearcoatRoughness,A.clearcoatMap&&(y.clearcoatMap.value=A.clearcoatMap,t(A.clearcoatMap,y.clearcoatMapTransform)),A.clearcoatRoughnessMap&&(y.clearcoatRoughnessMap.value=A.clearcoatRoughnessMap,t(A.clearcoatRoughnessMap,y.clearcoatRoughnessMapTransform)),A.clearcoatNormalMap&&(y.clearcoatNormalMap.value=A.clearcoatNormalMap,t(A.clearcoatNormalMap,y.clearcoatNormalMapTransform),y.clearcoatNormalScale.value.copy(A.clearcoatNormalScale),A.side===Jn&&y.clearcoatNormalScale.value.negate())),A.iridescence>0&&(y.iridescence.value=A.iridescence,y.iridescenceIOR.value=A.iridescenceIOR,y.iridescenceThicknessMinimum.value=A.iridescenceThicknessRange[0],y.iridescenceThicknessMaximum.value=A.iridescenceThicknessRange[1],A.iridescenceMap&&(y.iridescenceMap.value=A.iridescenceMap,t(A.iridescenceMap,y.iridescenceMapTransform)),A.iridescenceThicknessMap&&(y.iridescenceThicknessMap.value=A.iridescenceThicknessMap,t(A.iridescenceThicknessMap,y.iridescenceThicknessMapTransform))),A.transmission>0&&(y.transmission.value=A.transmission,y.transmissionSamplerMap.value=b.texture,y.transmissionSamplerSize.value.set(b.width,b.height),A.transmissionMap&&(y.transmissionMap.value=A.transmissionMap,t(A.transmissionMap,y.transmissionMapTransform)),y.thickness.value=A.thickness,A.thicknessMap&&(y.thicknessMap.value=A.thicknessMap,t(A.thicknessMap,y.thicknessMapTransform)),y.attenuationDistance.value=A.attenuationDistance,y.attenuationColor.value.copy(A.attenuationColor)),y.specularIntensity.value=A.specularIntensity,y.specularColor.value.copy(A.specularColor),A.specularColorMap&&(y.specularColorMap.value=A.specularColorMap,t(A.specularColorMap,y.specularColorMapTransform)),A.specularIntensityMap&&(y.specularIntensityMap.value=A.specularIntensityMap,t(A.specularIntensityMap,y.specularIntensityMapTransform))}function f(y,A){A.matcap&&(y.matcap.value=A.matcap)}function v(y,A){const b=e.get(A).light;y.referencePosition.value.setFromMatrixPosition(b.matrixWorld),y.nearDistance.value=b.shadow.camera.near,y.farDistance.value=b.shadow.camera.far}return{refreshFogUniforms:i,refreshMaterialUniforms:s}}function zL(n,e,t,i){let s={},r={},o=[];const a=t.isWebGL2?n.getParameter(n.MAX_UNIFORM_BUFFER_BINDINGS):0;function l(b,m){const B=m.program;i.uniformBlockBinding(b,B)}function g(b,m){let B=s[b.id];B===void 0&&(f(b),B=u(b),s[b.id]=B,b.addEventListener("dispose",y));const S=m.program;i.updateUBOMapping(b,S);const x=e.render.frame;r[b.id]!==x&&(d(b),r[b.id]=x)}function u(b){const m=C();b.__bindingPointIndex=m;const B=n.createBuffer(),S=b.__size,x=b.usage;return n.bindBuffer(n.UNIFORM_BUFFER,B),n.bufferData(n.UNIFORM_BUFFER,S,x),n.bindBuffer(n.UNIFORM_BUFFER,null),n.bindBufferBase(n.UNIFORM_BUFFER,m,B),B}function C(){for(let b=0;b0){x=B%S;const P=S-x;x!==0&&P-V.boundary<0&&(B+=S-x,Z.__offset=B)}B+=V.storage}return x=B%S,x>0&&(B+=S-x),b.__size=B,b.__cache={},this}function v(b){const m={boundary:0,storage:0};return typeof b=="number"?(m.boundary=4,m.storage=4):b.isVector2?(m.boundary=8,m.storage=8):b.isVector3||b.isColor?(m.boundary=16,m.storage=12):b.isVector4?(m.boundary=16,m.storage=16):b.isMatrix3?(m.boundary=48,m.storage=48):b.isMatrix4?(m.boundary=64,m.storage=64):b.isTexture?console.warn("THREE.WebGLRenderer: Texture samplers can not be part of an uniforms group."):console.warn("THREE.WebGLRenderer: Unsupported uniform value type.",b),m}function y(b){const m=b.target;m.removeEventListener("dispose",y);const B=o.indexOf(m.__bindingPointIndex);o.splice(B,1),n.deleteBuffer(s[m.id]),delete s[m.id],delete r[m.id]}function A(){for(const b in s)n.deleteBuffer(s[b]);o=[],s={},r={}}return{bind:l,update:g,dispose:A}}function LL(){const n=zu("canvas");return n.style.display="block",n}class uy{constructor(e={}){const{canvas:t=LL(),context:i=null,depth:s=!0,stencil:r=!0,alpha:o=!1,antialias:a=!1,premultipliedAlpha:l=!0,preserveDrawingBuffer:g=!1,powerPreference:u="default",failIfMajorPerformanceCaveat:C=!1}=e;this.isWebGLRenderer=!0;let d;i!==null?d=i.getContextAttributes().alpha:d=o;let h=null,f=null;const v=[],y=[];this.domElement=t,this.debug={checkShaderErrors:!0,onShaderError:null},this.autoClear=!0,this.autoClearColor=!0,this.autoClearDepth=!0,this.autoClearStencil=!0,this.sortObjects=!0,this.clippingPlanes=[],this.localClippingEnabled=!1,this.outputColorSpace=yt,this.useLegacyLights=!0,this.toneMapping=Ar,this.toneMappingExposure=1;const A=this;let b=!1,m=0,B=0,S=null,x=-1,R=null;const M=new Yt,Z=new Yt;let V=null,N=t.width,P=t.height,U=1,q=null,ie=null;const he=new Yt(0,0,N,P),Ce=new Yt(0,0,N,P);let z=!1;const Q=new rp;let J=!1,le=!1,se=null;const te=new _e,ge=new H,Ze={background:null,fog:null,environment:null,overrideMaterial:null,isScene:!0};function Re(){return S===null?U:1}let O=i;function ot(F,ae){for(let Ae=0;Ae0?f=y[y.length-1]:f=null,v.pop(),v.length>0?h=v[v.length-1]:h=null};function Gn(F,ae,Ae,re){if(F.visible===!1)return;if(F.layers.test(ae.layers)){if(F.isGroup)Ae=F.renderOrder;else if(F.isLOD)F.autoUpdate===!0&&F.update(ae);else if(F.isLight)f.pushLight(F),F.castShadow&&f.pushShadow(F);else if(F.isSprite){if(!F.frustumCulled||Q.intersectsSprite(F)){re&&ge.setFromMatrixPosition(F.matrixWorld).applyMatrix4(te);const ut=nt.update(F),dt=F.material;dt.visible&&h.push(F,ut,dt,Ae,ge.z,null)}}else if((F.isMesh||F.isLine||F.isPoints)&&(!F.frustumCulled||Q.intersectsObject(F))){F.isSkinnedMesh&&F.skeleton.frame!==Be.render.frame&&(F.skeleton.update(),F.skeleton.frame=Be.render.frame);const ut=nt.update(F),dt=F.material;if(re&&(ut.boundingSphere===null&&ut.computeBoundingSphere(),ge.copy(ut.boundingSphere.center).applyMatrix4(F.matrixWorld).applyMatrix4(te)),Array.isArray(dt)){const mt=ut.groups;for(let wt=0,St=mt.length;wt0&&Lt(ve,rt,ae,Ae),re&&Ue.viewport(M.copy(re)),ve.length>0&&Hn(ve,ae,Ae),rt.length>0&&Hn(rt,ae,Ae),ut.length>0&&Hn(ut,ae,Ae),Ue.buffers.depth.setTest(!0),Ue.buffers.depth.setMask(!0),Ue.buffers.color.setMask(!0),Ue.setPolygonOffset(!1)}function Lt(F,ae,Ae,re){if(se===null){const dt=Me.isWebGL2;se=new Nt(1024,1024,{generateMipmaps:!0,type:ct.has("EXT_color_buffer_half_float")?bs:cn,minFilter:ba,samples:dt&&a===!0?4:0})}const ve=A.getRenderTarget();A.setRenderTarget(se),A.clear();const rt=A.toneMapping;A.toneMapping=Ar,Hn(F,Ae,re),we.updateMultisampleRenderTarget(se),we.updateRenderTargetMipmap(se);let ut=!1;for(let dt=0,mt=ae.length;dt0&&we.useMultisampledRTT(F)===!1?ve=fe.get(F).__webglMultisampledFramebuffer:ve=St,M.copy(F.viewport),Z.copy(F.scissor),V=F.scissorTest}else M.copy(he).multiplyScalar(U).floor(),Z.copy(Ce).multiplyScalar(U).floor(),V=z;if(Ue.bindFramebuffer(O.FRAMEBUFFER,ve)&&Me.drawBuffers&&re&&Ue.drawBuffers(F,ve),Ue.viewport(M),Ue.scissor(Z),Ue.setScissorTest(V),rt){const mt=fe.get(F.texture);O.framebufferTexture2D(O.FRAMEBUFFER,O.COLOR_ATTACHMENT0,O.TEXTURE_CUBE_MAP_POSITIVE_X+ae,mt.__webglTexture,Ae)}else if(ut){const mt=fe.get(F.texture),wt=ae||0;O.framebufferTextureLayer(O.FRAMEBUFFER,O.COLOR_ATTACHMENT0,mt.__webglTexture,Ae||0,wt)}x=-1},this.readRenderTargetPixels=function(F,ae,Ae,re,ve,rt,ut){if(!(F&&F.isWebGLRenderTarget)){console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not THREE.WebGLRenderTarget.");return}let dt=fe.get(F).__webglFramebuffer;if(F.isWebGLCubeRenderTarget&&ut!==void 0&&(dt=dt[ut]),dt){Ue.bindFramebuffer(O.FRAMEBUFFER,dt);try{const mt=F.texture,wt=mt.format,St=mt.type;if(wt!==An&&D.convert(wt)!==O.getParameter(O.IMPLEMENTATION_COLOR_READ_FORMAT)){console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not in RGBA or implementation defined format.");return}const Wt=St===bs&&(ct.has("EXT_color_buffer_half_float")||Me.isWebGL2&&ct.has("EXT_color_buffer_float"));if(St!==cn&&D.convert(St)!==O.getParameter(O.IMPLEMENTATION_COLOR_READ_TYPE)&&!(St===Wn&&(Me.isWebGL2||ct.has("OES_texture_float")||ct.has("WEBGL_color_buffer_float")))&&!Wt){console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not in UnsignedByteType or implementation defined type.");return}ae>=0&&ae<=F.width-re&&Ae>=0&&Ae<=F.height-ve&&O.readPixels(ae,Ae,re,ve,D.convert(wt),D.convert(St),rt)}finally{const mt=S!==null?fe.get(S).__webglFramebuffer:null;Ue.bindFramebuffer(O.FRAMEBUFFER,mt)}}},this.copyFramebufferToTexture=function(F,ae,Ae=0){const re=Math.pow(2,-Ae),ve=Math.floor(ae.image.width*re),rt=Math.floor(ae.image.height*re);we.setTexture2D(ae,0),O.copyTexSubImage2D(O.TEXTURE_2D,Ae,0,0,F.x,F.y,ve,rt),Ue.unbindTexture()},this.copyTextureToTexture=function(F,ae,Ae,re=0){const ve=ae.image.width,rt=ae.image.height,ut=D.convert(Ae.format),dt=D.convert(Ae.type);we.setTexture2D(Ae,0),O.pixelStorei(O.UNPACK_FLIP_Y_WEBGL,Ae.flipY),O.pixelStorei(O.UNPACK_PREMULTIPLY_ALPHA_WEBGL,Ae.premultiplyAlpha),O.pixelStorei(O.UNPACK_ALIGNMENT,Ae.unpackAlignment),ae.isDataTexture?O.texSubImage2D(O.TEXTURE_2D,re,F.x,F.y,ve,rt,ut,dt,ae.image.data):ae.isCompressedTexture?O.compressedTexSubImage2D(O.TEXTURE_2D,re,F.x,F.y,ae.mipmaps[0].width,ae.mipmaps[0].height,ut,ae.mipmaps[0].data):O.texSubImage2D(O.TEXTURE_2D,re,F.x,F.y,ut,dt,ae.image),re===0&&Ae.generateMipmaps&&O.generateMipmap(O.TEXTURE_2D),Ue.unbindTexture()},this.copyTextureToTexture3D=function(F,ae,Ae,re,ve=0){if(A.isWebGL1Renderer){console.warn("THREE.WebGLRenderer.copyTextureToTexture3D: can only be used with WebGL2.");return}const rt=F.max.x-F.min.x+1,ut=F.max.y-F.min.y+1,dt=F.max.z-F.min.z+1,mt=D.convert(re.format),wt=D.convert(re.type);let St;if(re.isData3DTexture)we.setTexture3D(re,0),St=O.TEXTURE_3D;else if(re.isDataArrayTexture)we.setTexture2DArray(re,0),St=O.TEXTURE_2D_ARRAY;else{console.warn("THREE.WebGLRenderer.copyTextureToTexture3D: only supports THREE.DataTexture3D and THREE.DataTexture2DArray.");return}O.pixelStorei(O.UNPACK_FLIP_Y_WEBGL,re.flipY),O.pixelStorei(O.UNPACK_PREMULTIPLY_ALPHA_WEBGL,re.premultiplyAlpha),O.pixelStorei(O.UNPACK_ALIGNMENT,re.unpackAlignment);const Wt=O.getParameter(O.UNPACK_ROW_LENGTH),Ot=O.getParameter(O.UNPACK_IMAGE_HEIGHT),ai=O.getParameter(O.UNPACK_SKIP_PIXELS),ls=O.getParameter(O.UNPACK_SKIP_ROWS),Os=O.getParameter(O.UNPACK_SKIP_IMAGES),ln=Ae.isCompressedTexture?Ae.mipmaps[0]:Ae.image;O.pixelStorei(O.UNPACK_ROW_LENGTH,ln.width),O.pixelStorei(O.UNPACK_IMAGE_HEIGHT,ln.height),O.pixelStorei(O.UNPACK_SKIP_PIXELS,F.min.x),O.pixelStorei(O.UNPACK_SKIP_ROWS,F.min.y),O.pixelStorei(O.UNPACK_SKIP_IMAGES,F.min.z),Ae.isDataTexture||Ae.isData3DTexture?O.texSubImage3D(St,ve,ae.x,ae.y,ae.z,rt,ut,dt,mt,wt,ln.data):Ae.isCompressedArrayTexture?(console.warn("THREE.WebGLRenderer.copyTextureToTexture3D: untested support for compressed srcTexture."),O.compressedTexSubImage3D(St,ve,ae.x,ae.y,ae.z,rt,ut,dt,mt,ln.data)):O.texSubImage3D(St,ve,ae.x,ae.y,ae.z,rt,ut,dt,mt,wt,ln),O.pixelStorei(O.UNPACK_ROW_LENGTH,Wt),O.pixelStorei(O.UNPACK_IMAGE_HEIGHT,Ot),O.pixelStorei(O.UNPACK_SKIP_PIXELS,ai),O.pixelStorei(O.UNPACK_SKIP_ROWS,ls),O.pixelStorei(O.UNPACK_SKIP_IMAGES,Os),ve===0&&re.generateMipmaps&&O.generateMipmap(St),Ue.unbindTexture()},this.initTexture=function(F){F.isCubeTexture?we.setTextureCube(F,0):F.isData3DTexture?we.setTexture3D(F,0):F.isDataArrayTexture||F.isCompressedArrayTexture?we.setTexture2DArray(F,0):we.setTexture2D(F,0),Ue.unbindTexture()},this.resetState=function(){m=0,B=0,S=null,Ue.reset(),$.reset()},typeof __THREE_DEVTOOLS__<"u"&&__THREE_DEVTOOLS__.dispatchEvent(new CustomEvent("observe",{detail:this}))}get physicallyCorrectLights(){return console.warn("THREE.WebGLRenderer: the property .physicallyCorrectLights has been removed. Set renderer.useLegacyLights instead."),!this.useLegacyLights}set physicallyCorrectLights(e){console.warn("THREE.WebGLRenderer: the property .physicallyCorrectLights has been removed. Set renderer.useLegacyLights instead."),this.useLegacyLights=!e}get outputEncoding(){return console.warn("THREE.WebGLRenderer: Property .outputEncoding has been removed. Use .outputColorSpace instead."),this.outputColorSpace===yt?ks:sC}set outputEncoding(e){console.warn("THREE.WebGLRenderer: Property .outputEncoding has been removed. Use .outputColorSpace instead."),this.outputColorSpace=e===ks?yt:fr}}class kW extends uy{}kW.prototype.isWebGL1Renderer=!0;class gp{constructor(e,t=25e-5){this.isFogExp2=!0,this.name="",this.color=new Xe(e),this.density=t}clone(){return new gp(this.color,this.density)}toJSON(){return{type:"FogExp2",color:this.color.getHex(),density:this.density}}}class cp{constructor(e,t=1,i=1e3){this.isFog=!0,this.name="",this.color=new Xe(e),this.near=t,this.far=i}clone(){return new cp(this.color,this.near,this.far)}toJSON(){return{type:"Fog",color:this.color.getHex(),near:this.near,far:this.far}}}class Sl extends zt{constructor(){super(),this.isScene=!0,this.type="Scene",this.background=null,this.environment=null,this.fog=null,this.backgroundBlurriness=0,this.backgroundIntensity=1,this.overrideMaterial=null,typeof __THREE_DEVTOOLS__<"u"&&__THREE_DEVTOOLS__.dispatchEvent(new CustomEvent("observe",{detail:this}))}copy(e,t){return super.copy(e,t),e.background!==null&&(this.background=e.background.clone()),e.environment!==null&&(this.environment=e.environment.clone()),e.fog!==null&&(this.fog=e.fog.clone()),this.backgroundBlurriness=e.backgroundBlurriness,this.backgroundIntensity=e.backgroundIntensity,e.overrideMaterial!==null&&(this.overrideMaterial=e.overrideMaterial.clone()),this.matrixAutoUpdate=e.matrixAutoUpdate,this}toJSON(e){const t=super.toJSON(e);return this.fog!==null&&(t.object.fog=this.fog.toJSON()),this.backgroundBlurriness>0&&(t.object.backgroundBlurriness=this.backgroundBlurriness),this.backgroundIntensity!==1&&(t.object.backgroundIntensity=this.backgroundIntensity),t}get autoUpdate(){return console.warn("THREE.Scene: autoUpdate was renamed to matrixWorldAutoUpdate in r144."),this.matrixWorldAutoUpdate}set autoUpdate(e){console.warn("THREE.Scene: autoUpdate was renamed to matrixWorldAutoUpdate in r144."),this.matrixWorldAutoUpdate=e}}class Ip{constructor(e,t){this.isInterleavedBuffer=!0,this.array=e,this.stride=t,this.count=e!==void 0?e.length/t:0,this.usage=Ku,this.updateRange={offset:0,count:-1},this.version=0,this.uuid=vs()}onUploadCallback(){}set needsUpdate(e){e===!0&&this.version++}setUsage(e){return this.usage=e,this}copy(e){return this.array=new e.array.constructor(e.array),this.count=e.count,this.stride=e.stride,this.usage=e.usage,this}copyAt(e,t,i){e*=this.stride,i*=t.stride;for(let s=0,r=this.stride;se.far||t.push({distance:l,point:fI.clone(),uv:es.getInterpolation(fI,qd,bI,$d,LZ,ym,EZ,new oe),face:null,object:this})}copy(e,t){return super.copy(e,t),e.center!==void 0&&this.center.copy(e.center),this.material=e.material,this}}function eh(n,e,t,i,s,r){vg.subVectors(n,t).addScalar(.5).multiply(i),s!==void 0?(mI.x=r*vg.x-s*vg.y,mI.y=s*vg.x+r*vg.y):mI.copy(vg),n.copy(e),n.x+=mI.x,n.y+=mI.y,n.applyMatrix4(DW)}const th=new H,TZ=new H;class PW extends zt{constructor(){super(),this._currentLevel=0,this.type="LOD",Object.defineProperties(this,{levels:{enumerable:!0,value:[]},isLOD:{value:!0}}),this.autoUpdate=!0}copy(e){super.copy(e,!1);const t=e.levels;for(let i=0,s=t.length;i0){let i,s;for(i=1,s=t.length;i0){th.setFromMatrixPosition(this.matrixWorld);const s=e.ray.origin.distanceTo(th);this.getObjectForDistance(s).raycast(e,t)}}update(e){const t=this.levels;if(t.length>1){th.setFromMatrixPosition(e.matrixWorld),TZ.setFromMatrixPosition(this.matrixWorld);const i=th.distanceTo(TZ)/e.zoom;t[0].object.visible=!0;let s,r;for(s=1,r=t.length;s=o)t[s-1].object.visible=!1,t[s].object.visible=!0;else break}for(this._currentLevel=s-1;sl)continue;d.applyMatrix4(this.matrixWorld);const M=e.ray.origin.distanceTo(d);Me.far||t.push({distance:M,point:C.clone().applyMatrix4(this.matrixWorld),index:m,face:null,faceIndex:null,object:this})}}else{const A=Math.max(0,o.start),b=Math.min(y.count,o.start+o.count);for(let m=A,B=b-1;ml)continue;d.applyMatrix4(this.matrixWorld);const x=e.ray.origin.distanceTo(d);xe.far||t.push({distance:x,point:C.clone().applyMatrix4(this.matrixWorld),index:m,face:null,faceIndex:null,object:this})}}}updateMorphTargets(){const t=this.geometry.morphAttributes,i=Object.keys(t);if(i.length>0){const s=t[i[0]];if(s!==void 0){this.morphTargetInfluences=[],this.morphTargetDictionary={};for(let r=0,o=s.length;r0){const s=t[i[0]];if(s!==void 0){this.morphTargetInfluences=[],this.morphTargetDictionary={};for(let r=0,o=s.length;rs.far)return;r.push({distance:g,distanceToRay:Math.sqrt(a),point:l,index:e,face:null,object:o})}}class QW extends sn{constructor(e,t,i,s,r,o,a,l,g){super(e,t,i,s,r,o,a,l,g),this.isVideoTexture=!0,this.minFilter=o!==void 0?o:st,this.magFilter=r!==void 0?r:st,this.generateMipmaps=!1;const u=this;function C(){u.needsUpdate=!0,e.requestVideoFrameCallback(C)}"requestVideoFrameCallback"in e&&e.requestVideoFrameCallback(C)}clone(){return new this.constructor(this.image).copy(this)}update(){const e=this.image;"requestVideoFrameCallback"in e===!1&&e.readyState>=e.HAVE_CURRENT_DATA&&(this.needsUpdate=!0)}}class xb extends sn{constructor(e,t,i){super({width:e,height:t}),this.isFramebufferTexture=!0,this.format=i,this.magFilter=vt,this.minFilter=vt,this.generateMipmaps=!1,this.needsUpdate=!0}}class Ay extends sn{constructor(e,t,i,s,r,o,a,l,g,u,C,d){super(null,o,a,l,g,u,s,r,C,d),this.isCompressedTexture=!0,this.image={width:t,height:i},this.mipmaps=e,this.flipY=!1,this.generateMipmaps=!1}}class DL extends Ay{constructor(e,t,i,s,r,o){super(e,t,i,r,o),this.isCompressedArrayTexture=!0,this.image.depth=s,this.wrapR=Pn}}class jW extends sn{constructor(e,t,i,s,r,o,a,l,g){super(e,t,i,s,r,o,a,l,g),this.isCanvasTexture=!0,this.needsUpdate=!0}}class mr{constructor(){this.type="Curve",this.arcLengthDivisions=200}getPoint(){return console.warn("THREE.Curve: .getPoint() not implemented."),null}getPointAt(e,t){const i=this.getUtoTmapping(e);return this.getPoint(i,t)}getPoints(e=5){const t=[];for(let i=0;i<=e;i++)t.push(this.getPoint(i/e));return t}getSpacedPoints(e=5){const t=[];for(let i=0;i<=e;i++)t.push(this.getPointAt(i/e));return t}getLength(){const e=this.getLengths();return e[e.length-1]}getLengths(e=this.arcLengthDivisions){if(this.cacheArcLengths&&this.cacheArcLengths.length===e+1&&!this.needsUpdate)return this.cacheArcLengths;this.needsUpdate=!1;const t=[];let i,s=this.getPoint(0),r=0;t.push(0);for(let o=1;o<=e;o++)i=this.getPoint(o/e),r+=i.distanceTo(s),t.push(r),s=i;return this.cacheArcLengths=t,t}updateArcLengths(){this.needsUpdate=!0,this.getLengths()}getUtoTmapping(e,t){const i=this.getLengths();let s=0;const r=i.length;let o;t?o=t:o=e*i[r-1];let a=0,l=r-1,g;for(;a<=l;)if(s=Math.floor(a+(l-a)/2),g=i[s]-o,g<0)a=s+1;else if(g>0)l=s-1;else{l=s;break}if(s=l,i[s]===o)return s/(r-1);const u=i[s],d=i[s+1]-u,h=(o-u)/d;return(s+h)/(r-1)}getTangent(e,t){let s=e-1e-4,r=e+1e-4;s<0&&(s=0),r>1&&(r=1);const o=this.getPoint(s),a=this.getPoint(r),l=t||(o.isVector2?new oe:new H);return l.copy(a).sub(o).normalize(),l}getTangentAt(e,t){const i=this.getUtoTmapping(e);return this.getTangent(i,t)}computeFrenetFrames(e,t){const i=new H,s=[],r=[],o=[],a=new H,l=new _e;for(let h=0;h<=e;h++){const f=h/e;s[h]=this.getTangentAt(f,new H)}r[0]=new H,o[0]=new H;let g=Number.MAX_VALUE;const u=Math.abs(s[0].x),C=Math.abs(s[0].y),d=Math.abs(s[0].z);u<=g&&(g=u,i.set(1,0,0)),C<=g&&(g=C,i.set(0,1,0)),d<=g&&i.set(0,0,1),a.crossVectors(s[0],i).normalize(),r[0].crossVectors(s[0],a),o[0].crossVectors(s[0],r[0]);for(let h=1;h<=e;h++){if(r[h]=r[h-1].clone(),o[h]=o[h-1].clone(),a.crossVectors(s[h-1],s[h]),a.length()>Number.EPSILON){a.normalize();const f=Math.acos(Sn(s[h-1].dot(s[h]),-1,1));r[h].applyMatrix4(l.makeRotationAxis(a,f))}o[h].crossVectors(s[h],r[h])}if(t===!0){let h=Math.acos(Sn(r[0].dot(r[e]),-1,1));h/=e,s[0].dot(a.crossVectors(r[0],r[e]))>0&&(h=-h);for(let f=1;f<=e;f++)r[f].applyMatrix4(l.makeRotationAxis(s[f],h*f)),o[f].crossVectors(s[f],r[f])}return{tangents:s,normals:r,binormals:o}}clone(){return new this.constructor().copy(this)}copy(e){return this.arcLengthDivisions=e.arcLengthDivisions,this}toJSON(){const e={metadata:{version:4.5,type:"Curve",generator:"Curve.toJSON"}};return e.arcLengthDivisions=this.arcLengthDivisions,e.type=this.type,e}fromJSON(e){return this.arcLengthDivisions=e.arcLengthDivisions,this}}class Cp extends mr{constructor(e=0,t=0,i=1,s=1,r=0,o=Math.PI*2,a=!1,l=0){super(),this.isEllipseCurve=!0,this.type="EllipseCurve",this.aX=e,this.aY=t,this.xRadius=i,this.yRadius=s,this.aStartAngle=r,this.aEndAngle=o,this.aClockwise=a,this.aRotation=l}getPoint(e,t){const i=t||new oe,s=Math.PI*2;let r=this.aEndAngle-this.aStartAngle;const o=Math.abs(r)s;)r-=s;r0?0:(Math.floor(Math.abs(a)/r)+1)*r:l===0&&a===r-1&&(a=r-2,l=1);let g,u;this.closed||a>0?g=s[(a-1)%r]:(oh.subVectors(s[0],s[1]).add(s[0]),g=oh);const C=s[a%r],d=s[(a+1)%r];if(this.closed||a+2s.length-2?s.length-1:o+1],C=s[o>s.length-3?s.length-1:o+2];return i.set(iw(a,l.x,g.x,u.x,C.x),iw(a,l.y,g.y,u.y,C.y)),i}copy(e){super.copy(e),this.points=[];for(let t=0,i=e.points.length;t=i){const o=s[r]-i,a=this.curves[r],l=a.getLength(),g=l===0?0:1-o/l;return a.getPointAt(g,t)}r++}return null}getLength(){const e=this.getCurveLengths();return e[e.length-1]}updateArcLengths(){this.needsUpdate=!0,this.cacheLengths=null,this.getCurveLengths()}getCurveLengths(){if(this.cacheLengths&&this.cacheLengths.length===this.curves.length)return this.cacheLengths;const e=[];let t=0;for(let i=0,s=this.curves.length;i1&&!t[t.length-1].equals(t[0])&&t.push(t[0]),t}copy(e){super.copy(e),this.curves=[];for(let t=0,i=e.curves.length;t0){const C=g.getPoint(0);C.equals(this.currentPoint)||this.lineTo(C.x,C.y)}this.curves.push(g);const u=g.getPoint(1);return this.currentPoint.copy(u),this}copy(e){return super.copy(e),this.currentPoint.copy(e.currentPoint),this}toJSON(){const e=super.toJSON();return e.currentPoint=this.currentPoint.toArray(),e}fromJSON(e){return super.fromJSON(e),this.currentPoint.fromArray(e.currentPoint),this}}class Mc extends Gt{constructor(e=[new oe(0,-.5),new oe(.5,0),new oe(0,.5)],t=12,i=0,s=Math.PI*2){super(),this.type="LatheGeometry",this.parameters={points:e,segments:t,phiStart:i,phiLength:s},t=Math.floor(t),s=Sn(s,0,Math.PI*2);const r=[],o=[],a=[],l=[],g=[],u=1/t,C=new H,d=new oe,h=new H,f=new H,v=new H;let y=0,A=0;for(let b=0;b<=e.length-1;b++)switch(b){case 0:y=e[b+1].x-e[b].x,A=e[b+1].y-e[b].y,h.x=A*1,h.y=-y,h.z=A*0,v.copy(h),h.normalize(),l.push(h.x,h.y,h.z);break;case e.length-1:l.push(v.x,v.y,v.z);break;default:y=e[b+1].x-e[b].x,A=e[b+1].y-e[b].y,h.x=A*1,h.y=-y,h.z=A*0,f.copy(h),h.x+=v.x,h.y+=v.y,h.z+=v.z,h.normalize(),l.push(h.x,h.y,h.z),v.copy(f)}for(let b=0;b<=t;b++){const m=i+b*u*s,B=Math.sin(m),S=Math.cos(m);for(let x=0;x<=e.length-1;x++){C.x=e[x].x*B,C.y=e[x].y,C.z=e[x].x*S,o.push(C.x,C.y,C.z),d.x=b/t,d.y=x/(e.length-1),a.push(d.x,d.y);const R=l[3*x+0]*B,M=l[3*x+1],Z=l[3*x+0]*S;g.push(R,M,Z)}}for(let b=0;b0&&m(!0),t>0&&m(!1)),this.setIndex(u),this.setAttribute("position",new je(C,3)),this.setAttribute("normal",new je(d,3)),this.setAttribute("uv",new je(h,2));function b(){const B=new H,S=new H;let x=0;const R=(t-e)/i;for(let M=0;M<=r;M++){const Z=[],V=M/r,N=V*(t-e)+e;for(let P=0;P<=s;P++){const U=P/s,q=U*l+a,ie=Math.sin(q),he=Math.cos(q);S.x=N*ie,S.y=-V*i+y,S.z=N*he,C.push(S.x,S.y,S.z),B.set(ie,R,he).normalize(),d.push(B.x,B.y,B.z),h.push(U,1-V),Z.push(f++)}v.push(Z)}for(let M=0;M.9&&R<.1&&(m<.2&&(o[b+0]+=1),B<.2&&(o[b+2]+=1),S<.2&&(o[b+4]+=1))}}function d(b){r.push(b.x,b.y,b.z)}function h(b,m){const B=b*3;m.x=e[B+0],m.y=e[B+1],m.z=e[B+2]}function f(){const b=new H,m=new H,B=new H,S=new H,x=new oe,R=new oe,M=new oe;for(let Z=0,V=0;Z80*t){a=g=n[0],l=u=n[1];for(let f=t;fg&&(g=C),d>u&&(u=d);h=Math.max(g-a,u-l),h=h!==0?32767/h:0}return Eu(r,o,t,a,l,h,0),o}};function sV(n,e,t,i,s){let r,o;if(s===dE(n,e,t,i)>0)for(r=e;r=e;r-=i)o=sw(r,n[r],n[r+1],o);return o&&hp(o,o.next)&&(ku(o),o=o.next),o}function Rl(n,e){if(!n)return n;e||(e=n);let t=n,i;do if(i=!1,!t.steiner&&(hp(t,t.next)||bn(t.prev,t,t.next)===0)){if(ku(t),t=e=t.prev,t===t.next)break;i=!0}else t=t.next;while(i||t!==e);return e}function Eu(n,e,t,i,s,r,o){if(!n)return;!o&&r&&lE(n,i,s,r);let a=n,l,g;for(;n.prev!==n.next;){if(l=n.prev,g=n.next,r?eE(n,i,s,r):$L(n)){e.push(l.i/t|0),e.push(n.i/t|0),e.push(g.i/t|0),ku(n),n=g.next,a=g.next;continue}if(n=g,n===a){o?o===1?(n=tE(Rl(n),e,t),Eu(n,e,t,i,s,r,2)):o===2&&nE(n,e,t,i,s,r):Eu(Rl(n),e,t,i,s,r,1);break}}}function $L(n){const e=n.prev,t=n,i=n.next;if(bn(e,t,i)>=0)return!1;const s=e.x,r=t.x,o=i.x,a=e.y,l=t.y,g=i.y,u=sr?s>o?s:o:r>o?r:o,h=a>l?a>g?a:g:l>g?l:g;let f=i.next;for(;f!==e;){if(f.x>=u&&f.x<=d&&f.y>=C&&f.y<=h&&_g(s,a,r,l,o,g,f.x,f.y)&&bn(f.prev,f,f.next)>=0)return!1;f=f.next}return!0}function eE(n,e,t,i){const s=n.prev,r=n,o=n.next;if(bn(s,r,o)>=0)return!1;const a=s.x,l=r.x,g=o.x,u=s.y,C=r.y,d=o.y,h=al?a>g?a:g:l>g?l:g,y=u>C?u>d?u:d:C>d?C:d,A=Rb(h,f,e,t,i),b=Rb(v,y,e,t,i);let m=n.prevZ,B=n.nextZ;for(;m&&m.z>=A&&B&&B.z<=b;){if(m.x>=h&&m.x<=v&&m.y>=f&&m.y<=y&&m!==s&&m!==o&&_g(a,u,l,C,g,d,m.x,m.y)&&bn(m.prev,m,m.next)>=0||(m=m.prevZ,B.x>=h&&B.x<=v&&B.y>=f&&B.y<=y&&B!==s&&B!==o&&_g(a,u,l,C,g,d,B.x,B.y)&&bn(B.prev,B,B.next)>=0))return!1;B=B.nextZ}for(;m&&m.z>=A;){if(m.x>=h&&m.x<=v&&m.y>=f&&m.y<=y&&m!==s&&m!==o&&_g(a,u,l,C,g,d,m.x,m.y)&&bn(m.prev,m,m.next)>=0)return!1;m=m.prevZ}for(;B&&B.z<=b;){if(B.x>=h&&B.x<=v&&B.y>=f&&B.y<=y&&B!==s&&B!==o&&_g(a,u,l,C,g,d,B.x,B.y)&&bn(B.prev,B,B.next)>=0)return!1;B=B.nextZ}return!0}function tE(n,e,t){let i=n;do{const s=i.prev,r=i.next.next;!hp(s,r)&&rV(s,i,i.next,r)&&Tu(s,r)&&Tu(r,s)&&(e.push(s.i/t|0),e.push(i.i/t|0),e.push(r.i/t|0),ku(i),ku(i.next),i=n=r),i=i.next}while(i!==n);return Rl(i)}function nE(n,e,t,i,s,r){let o=n;do{let a=o.next.next;for(;a!==o.prev;){if(o.i!==a.i&&IE(o,a)){let l=oV(o,a);o=Rl(o,o.next),l=Rl(l,l.next),Eu(o,e,t,i,s,r,0),Eu(l,e,t,i,s,r,0);return}a=a.next}o=o.next}while(o!==n)}function iE(n,e,t,i){const s=[];let r,o,a,l,g;for(r=0,o=e.length;r=t.next.y&&t.next.y!==t.y){const d=t.x+(o-t.y)*(t.next.x-t.x)/(t.next.y-t.y);if(d<=r&&d>i&&(i=d,s=t.x=t.x&&t.x>=l&&r!==t.x&&_g(os.x||t.x===s.x&&aE(s,t)))&&(s=t,u=C)),t=t.next;while(t!==a);return s}function aE(n,e){return bn(n.prev,n,e.prev)<0&&bn(e.next,n,n.next)<0}function lE(n,e,t,i){let s=n;do s.z===0&&(s.z=Rb(s.x,s.y,e,t,i)),s.prevZ=s.prev,s.nextZ=s.next,s=s.next;while(s!==n);s.prevZ.nextZ=null,s.prevZ=null,gE(s)}function gE(n){let e,t,i,s,r,o,a,l,g=1;do{for(t=n,n=null,r=null,o=0;t;){for(o++,i=t,a=0,e=0;e0||l>0&&i;)a!==0&&(l===0||!i||t.z<=i.z)?(s=t,t=t.nextZ,a--):(s=i,i=i.nextZ,l--),r?r.nextZ=s:n=s,s.prevZ=r,r=s;t=i}r.nextZ=null,g*=2}while(o>1);return n}function Rb(n,e,t,i,s){return n=(n-t)*s|0,e=(e-i)*s|0,n=(n|n<<8)&16711935,n=(n|n<<4)&252645135,n=(n|n<<2)&858993459,n=(n|n<<1)&1431655765,e=(e|e<<8)&16711935,e=(e|e<<4)&252645135,e=(e|e<<2)&858993459,e=(e|e<<1)&1431655765,n|e<<1}function cE(n){let e=n,t=n;do(e.x=(n-o)*(r-a)&&(n-o)*(i-a)>=(t-o)*(e-a)&&(t-o)*(r-a)>=(s-o)*(i-a)}function IE(n,e){return n.next.i!==e.i&&n.prev.i!==e.i&&!uE(n,e)&&(Tu(n,e)&&Tu(e,n)&&CE(n,e)&&(bn(n.prev,n,e.prev)||bn(n,e.prev,e))||hp(n,e)&&bn(n.prev,n,n.next)>0&&bn(e.prev,e,e.next)>0)}function bn(n,e,t){return(e.y-n.y)*(t.x-e.x)-(e.x-n.x)*(t.y-e.y)}function hp(n,e){return n.x===e.x&&n.y===e.y}function rV(n,e,t,i){const s=Ih(bn(n,e,t)),r=Ih(bn(n,e,i)),o=Ih(bn(t,i,n)),a=Ih(bn(t,i,e));return!!(s!==r&&o!==a||s===0&&ch(n,t,e)||r===0&&ch(n,i,e)||o===0&&ch(t,n,i)||a===0&&ch(t,e,i))}function ch(n,e,t){return e.x<=Math.max(n.x,t.x)&&e.x>=Math.min(n.x,t.x)&&e.y<=Math.max(n.y,t.y)&&e.y>=Math.min(n.y,t.y)}function Ih(n){return n>0?1:n<0?-1:0}function uE(n,e){let t=n;do{if(t.i!==n.i&&t.next.i!==n.i&&t.i!==e.i&&t.next.i!==e.i&&rV(t,t.next,n,e))return!0;t=t.next}while(t!==n);return!1}function Tu(n,e){return bn(n.prev,n,n.next)<0?bn(n,e,n.next)>=0&&bn(n,n.prev,e)>=0:bn(n,e,n.prev)<0||bn(n,n.next,e)<0}function CE(n,e){let t=n,i=!1;const s=(n.x+e.x)/2,r=(n.y+e.y)/2;do t.y>r!=t.next.y>r&&t.next.y!==t.y&&s<(t.next.x-t.x)*(r-t.y)/(t.next.y-t.y)+t.x&&(i=!i),t=t.next;while(t!==n);return i}function oV(n,e){const t=new Wb(n.i,n.x,n.y),i=new Wb(e.i,e.x,e.y),s=n.next,r=e.prev;return n.next=e,e.prev=n,t.next=s,s.prev=t,i.next=t,t.prev=i,r.next=i,i.prev=r,i}function sw(n,e,t,i){const s=new Wb(n,e,t);return i?(s.next=i.next,s.prev=i,i.next.prev=s,i.next=s):(s.prev=s,s.next=s),s}function ku(n){n.next.prev=n.prev,n.prev.next=n.next,n.prevZ&&(n.prevZ.nextZ=n.nextZ),n.nextZ&&(n.nextZ.prevZ=n.prevZ)}function Wb(n,e,t){this.i=n,this.x=e,this.y=t,this.prev=null,this.next=null,this.z=0,this.prevZ=null,this.nextZ=null,this.steiner=!1}function dE(n,e,t,i){let s=0;for(let r=e,o=t-i;r2&&n[e-1].equals(n[0])&&n.pop()}function ow(n,e){for(let t=0;tNumber.EPSILON){const de=Math.sqrt(T),xe=Math.sqrt(Ct*Ct+Ht*Ht),We=fe.x-nt/de,Ee=fe.y+at/de,lt=we.x-Ht/xe,Je=we.y+Ct/xe,D=((lt-We)*Ht-(Je-Ee)*Ct)/(at*Ht-nt*Ct);Pe=We+at*D-Be.x,Fe=Ee+nt*D-Be.y;const $=Pe*Pe+Fe*Fe;if($<=2)return new oe(Pe,Fe);qe=Math.sqrt($/2)}else{let de=!1;at>Number.EPSILON?Ct>Number.EPSILON&&(de=!0):at<-Number.EPSILON?Ct<-Number.EPSILON&&(de=!0):Math.sign(nt)===Math.sign(Ht)&&(de=!0),de?(Pe=-nt,Fe=at,qe=Math.sqrt(T)):(Pe=at,Fe=nt,qe=Math.sqrt(T/2))}return new oe(Pe/qe,Fe/qe)}const Q=[];for(let Be=0,fe=q.length,we=fe-1,Pe=Be+1;Be=0;Be--){const fe=Be/y,we=h*Math.cos(fe*Math.PI/2),Pe=f*Math.sin(fe*Math.PI/2)+v;for(let Fe=0,qe=q.length;Fe=0;){const Pe=we;let Fe=we-1;Fe<0&&(Fe=Be.length-1);for(let qe=0,at=u+y*2;qe0)&&h.push(m,B,x),(A!==i-1||l0!=e>0&&this.version++,this._sheen=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 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.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.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 IV extends ei{constructor(e){super(),this.isMeshPhongMaterial=!0,this.type="MeshPhongMaterial",this.color=new Xe(16777215),this.specular=new Xe(1118481),this.shininess=30,this.map=null,this.lightMap=null,this.lightMapIntensity=1,this.aoMap=null,this.aoMapIntensity=1,this.emissive=new Xe(0),this.emissiveIntensity=1,this.emissiveMap=null,this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=Vo,this.normalScale=new oe(1,1),this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.specularMap=null,this.alphaMap=null,this.envMap=null,this.combine=iC,this.reflectivity=1,this.refractionRatio=.98,this.wireframe=!1,this.wireframeLinewidth=1,this.wireframeLinecap="round",this.wireframeLinejoin="round",this.flatShading=!1,this.fog=!0,this.setValues(e)}copy(e){return super.copy(e),this.color.copy(e.color),this.specular.copy(e.specular),this.shininess=e.shininess,this.map=e.map,this.lightMap=e.lightMap,this.lightMapIntensity=e.lightMapIntensity,this.aoMap=e.aoMap,this.aoMapIntensity=e.aoMapIntensity,this.emissive.copy(e.emissive),this.emissiveMap=e.emissiveMap,this.emissiveIntensity=e.emissiveIntensity,this.bumpMap=e.bumpMap,this.bumpScale=e.bumpScale,this.normalMap=e.normalMap,this.normalMapType=e.normalMapType,this.normalScale.copy(e.normalScale),this.displacementMap=e.displacementMap,this.displacementScale=e.displacementScale,this.displacementBias=e.displacementBias,this.specularMap=e.specularMap,this.alphaMap=e.alphaMap,this.envMap=e.envMap,this.combine=e.combine,this.reflectivity=e.reflectivity,this.refractionRatio=e.refractionRatio,this.wireframe=e.wireframe,this.wireframeLinewidth=e.wireframeLinewidth,this.wireframeLinecap=e.wireframeLinecap,this.wireframeLinejoin=e.wireframeLinejoin,this.flatShading=e.flatShading,this.fog=e.fog,this}}class uV extends ei{constructor(e){super(),this.isMeshToonMaterial=!0,this.defines={TOON:""},this.type="MeshToonMaterial",this.color=new Xe(16777215),this.map=null,this.gradientMap=null,this.lightMap=null,this.lightMapIntensity=1,this.aoMap=null,this.aoMapIntensity=1,this.emissive=new Xe(0),this.emissiveIntensity=1,this.emissiveMap=null,this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=Vo,this.normalScale=new oe(1,1),this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.alphaMap=null,this.wireframe=!1,this.wireframeLinewidth=1,this.wireframeLinecap="round",this.wireframeLinejoin="round",this.fog=!0,this.setValues(e)}copy(e){return super.copy(e),this.color.copy(e.color),this.map=e.map,this.gradientMap=e.gradientMap,this.lightMap=e.lightMap,this.lightMapIntensity=e.lightMapIntensity,this.aoMap=e.aoMap,this.aoMapIntensity=e.aoMapIntensity,this.emissive.copy(e.emissive),this.emissiveMap=e.emissiveMap,this.emissiveIntensity=e.emissiveIntensity,this.bumpMap=e.bumpMap,this.bumpScale=e.bumpScale,this.normalMap=e.normalMap,this.normalMapType=e.normalMapType,this.normalScale.copy(e.normalScale),this.displacementMap=e.displacementMap,this.displacementScale=e.displacementScale,this.displacementBias=e.displacementBias,this.alphaMap=e.alphaMap,this.wireframe=e.wireframe,this.wireframeLinewidth=e.wireframeLinewidth,this.wireframeLinecap=e.wireframeLinecap,this.wireframeLinejoin=e.wireframeLinejoin,this.fog=e.fog,this}}class Gy extends ei{constructor(e){super(),this.isMeshNormalMaterial=!0,this.type="MeshNormalMaterial",this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=Vo,this.normalScale=new oe(1,1),this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.wireframe=!1,this.wireframeLinewidth=1,this.flatShading=!1,this.setValues(e)}copy(e){return super.copy(e),this.bumpMap=e.bumpMap,this.bumpScale=e.bumpScale,this.normalMap=e.normalMap,this.normalMapType=e.normalMapType,this.normalScale.copy(e.normalScale),this.displacementMap=e.displacementMap,this.displacementScale=e.displacementScale,this.displacementBias=e.displacementBias,this.wireframe=e.wireframe,this.wireframeLinewidth=e.wireframeLinewidth,this.flatShading=e.flatShading,this}}class CV extends ei{constructor(e){super(),this.isMeshLambertMaterial=!0,this.type="MeshLambertMaterial",this.color=new Xe(16777215),this.map=null,this.lightMap=null,this.lightMapIntensity=1,this.aoMap=null,this.aoMapIntensity=1,this.emissive=new Xe(0),this.emissiveIntensity=1,this.emissiveMap=null,this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=Vo,this.normalScale=new oe(1,1),this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.specularMap=null,this.alphaMap=null,this.envMap=null,this.combine=iC,this.reflectivity=1,this.refractionRatio=.98,this.wireframe=!1,this.wireframeLinewidth=1,this.wireframeLinecap="round",this.wireframeLinejoin="round",this.flatShading=!1,this.fog=!0,this.setValues(e)}copy(e){return super.copy(e),this.color.copy(e.color),this.map=e.map,this.lightMap=e.lightMap,this.lightMapIntensity=e.lightMapIntensity,this.aoMap=e.aoMap,this.aoMapIntensity=e.aoMapIntensity,this.emissive.copy(e.emissive),this.emissiveMap=e.emissiveMap,this.emissiveIntensity=e.emissiveIntensity,this.bumpMap=e.bumpMap,this.bumpScale=e.bumpScale,this.normalMap=e.normalMap,this.normalMapType=e.normalMapType,this.normalScale.copy(e.normalScale),this.displacementMap=e.displacementMap,this.displacementScale=e.displacementScale,this.displacementBias=e.displacementBias,this.specularMap=e.specularMap,this.alphaMap=e.alphaMap,this.envMap=e.envMap,this.combine=e.combine,this.reflectivity=e.reflectivity,this.refractionRatio=e.refractionRatio,this.wireframe=e.wireframe,this.wireframeLinewidth=e.wireframeLinewidth,this.wireframeLinecap=e.wireframeLinecap,this.wireframeLinejoin=e.wireframeLinejoin,this.flatShading=e.flatShading,this.fog=e.fog,this}}class dV extends ei{constructor(e){super(),this.isMeshMatcapMaterial=!0,this.defines={MATCAP:""},this.type="MeshMatcapMaterial",this.color=new Xe(16777215),this.matcap=null,this.map=null,this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=Vo,this.normalScale=new oe(1,1),this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.alphaMap=null,this.flatShading=!1,this.fog=!0,this.setValues(e)}copy(e){return super.copy(e),this.defines={MATCAP:""},this.color.copy(e.color),this.matcap=e.matcap,this.map=e.map,this.bumpMap=e.bumpMap,this.bumpScale=e.bumpScale,this.normalMap=e.normalMap,this.normalMapType=e.normalMapType,this.normalScale.copy(e.normalScale),this.displacementMap=e.displacementMap,this.displacementScale=e.displacementScale,this.displacementBias=e.displacementBias,this.alphaMap=e.alphaMap,this.flatShading=e.flatShading,this.fog=e.fog,this}}class hV extends Ti{constructor(e){super(),this.isLineDashedMaterial=!0,this.type="LineDashedMaterial",this.scale=1,this.dashSize=3,this.gapSize=1,this.setValues(e)}copy(e){return super.copy(e),this.scale=e.scale,this.dashSize=e.dashSize,this.gapSize=e.gapSize,this}}function Ks(n,e,t){return By(n)?new n.constructor(n.subarray(e,t!==void 0?t:n.length)):n.slice(e,t)}function ul(n,e,t){return!n||!t&&n.constructor===e?n:typeof e.BYTES_PER_ELEMENT=="number"?new e(n):Array.prototype.slice.call(n)}function By(n){return ArrayBuffer.isView(n)&&!(n instanceof DataView)}function AV(n){function e(s,r){return n[s]-n[r]}const t=n.length,i=new Array(t);for(let s=0;s!==t;++s)i[s]=s;return i.sort(e),i}function Vb(n,e,t){const i=n.length,s=new n.constructor(i);for(let r=0,o=0;o!==i;++r){const a=t[r]*e;for(let l=0;l!==e;++l)s[o++]=n[a+l]}return s}function Zy(n,e,t,i){let s=1,r=n[0];for(;r!==void 0&&r[i]===void 0;)r=n[s++];if(r===void 0)return;let o=r[i];if(o!==void 0)if(Array.isArray(o))do o=r[i],o!==void 0&&(e.push(r.time),t.push.apply(t,o)),r=n[s++];while(r!==void 0);else if(o.toArray!==void 0)do o=r[i],o!==void 0&&(e.push(r.time),o.toArray(t,t.length)),r=n[s++];while(r!==void 0);else do o=r[i],o!==void 0&&(e.push(r.time),t.push(o)),r=n[s++];while(r!==void 0)}function fE(n,e,t,i,s=30){const r=n.clone();r.name=e;const o=[];for(let l=0;l=i)){C.push(g.times[h]);for(let v=0;vr.tracks[l].times[0]&&(a=r.tracks[l].times[0]);for(let l=0;l=a.times[f]){const A=f*C+u,b=A+C-u;v=Ks(a.values,A,b)}else{const A=a.createInterpolant(),b=u,m=C-u;A.evaluate(r),v=Ks(A.resultBuffer,b,m)}l==="quaternion"&&new Mn().fromArray(v).normalize().conjugate().toArray(v);const y=g.times.length;for(let A=0;A=r)){const a=t[1];e=r)break t}o=i,i=0;break n}break e}for(;i>>1;et;)--o;if(++o,r!==0||o!==s){r>=o&&(o=Math.max(o,1),r=o-1);const a=this.getValueSize();this.times=Ks(i,r,o),this.values=Ks(this.values,r*a,o*a)}return this}validate(){let e=!0;const t=this.getValueSize();t-Math.floor(t)!==0&&(console.error("THREE.KeyframeTrack: Invalid value size in track.",this),e=!1);const i=this.times,s=this.values,r=i.length;r===0&&(console.error("THREE.KeyframeTrack: Track is empty.",this),e=!1);let o=null;for(let a=0;a!==r;a++){const l=i[a];if(typeof l=="number"&&isNaN(l)){console.error("THREE.KeyframeTrack: Time is not a valid number.",this,a,l),e=!1;break}if(o!==null&&o>l){console.error("THREE.KeyframeTrack: Out of order keys.",this,a,l,o),e=!1;break}o=l}if(s!==void 0&&By(s))for(let a=0,l=s.length;a!==l;++a){const g=s[a];if(isNaN(g)){console.error("THREE.KeyframeTrack: Value is not a valid number.",this,a,g),e=!1;break}}return e}optimize(){const e=Ks(this.times),t=Ks(this.values),i=this.getValueSize(),s=this.getInterpolation()===Qh,r=e.length-1;let o=1;for(let a=1;a0){e[o]=e[r];for(let a=r*i,l=o*i,g=0;g!==i;++g)t[l+g]=t[a+g];++o}return o!==e.length?(this.times=Ks(e,0,o),this.values=Ks(t,0,o*i)):(this.times=e,this.values=t),this}clone(){const e=Ks(this.times,0),t=Ks(this.values,0),i=this.constructor,s=new i(this.name,e,t);return s.createInterpolant=this.createInterpolant,s}}br.prototype.TimeBufferType=Float32Array;br.prototype.ValueBufferType=Float32Array;br.prototype.DefaultInterpolation=Fu;class zl extends br{}zl.prototype.ValueTypeName="bool";zl.prototype.ValueBufferType=Array;zl.prototype.DefaultInterpolation=Xu;zl.prototype.InterpolantFactoryMethodLinear=void 0;zl.prototype.InterpolantFactoryMethodSmooth=void 0;class Sy extends br{}Sy.prototype.ValueTypeName="color";class Du extends br{}Du.prototype.ValueTypeName="number";class mV extends mC{constructor(e,t,i,s){super(e,t,i,s)}interpolate_(e,t,i,s){const r=this.resultBuffer,o=this.sampleValues,a=this.valueSize,l=(i-t)/(s-t);let g=e*a;for(let u=g+a;g!==u;g+=4)Mn.slerpFlat(r,0,o,g-a,o,g,l);return r}}class Hc extends br{InterpolantFactoryMethodLinear(e){return new mV(this.times,this.values,this.getValueSize(),e)}}Hc.prototype.ValueTypeName="quaternion";Hc.prototype.DefaultInterpolation=Fu;Hc.prototype.InterpolantFactoryMethodSmooth=void 0;class Ll extends br{}Ll.prototype.ValueTypeName="string";Ll.prototype.ValueBufferType=Array;Ll.prototype.DefaultInterpolation=Xu;Ll.prototype.InterpolantFactoryMethodLinear=void 0;Ll.prototype.InterpolantFactoryMethodSmooth=void 0;class Uu extends br{}Uu.prototype.ValueTypeName="vector";class Pu{constructor(e,t=-1,i,s=np){this.name=e,this.tracks=i,this.duration=t,this.blendMode=s,this.uuid=vs(),this.duration<0&&this.resetDuration()}static parse(e){const t=[],i=e.tracks,s=1/(e.fps||1);for(let o=0,a=i.length;o!==a;++o)t.push(yE(i[o]).scale(s));const r=new this(e.name,e.duration,t,e.blendMode);return r.uuid=e.uuid,r}static toJSON(e){const t=[],i=e.tracks,s={name:e.name,duration:e.duration,tracks:t,uuid:e.uuid,blendMode:e.blendMode};for(let r=0,o=i.length;r!==o;++r)t.push(br.toJSON(i[r]));return s}static CreateFromMorphTargetSequence(e,t,i,s){const r=t.length,o=[];for(let a=0;a1){const C=u[1];let d=s[C];d||(s[C]=d=[]),d.push(g)}}const o=[];for(const a in s)o.push(this.CreateFromMorphTargetSequence(a,s[a],t,i));return o}static parseAnimation(e,t){if(!e)return console.error("THREE.AnimationClip: No animation in JSONLoader data."),null;const i=function(C,d,h,f,v){if(h.length!==0){const y=[],A=[];Zy(h,y,A,f),y.length!==0&&v.push(new C(d,y,A))}},s=[],r=e.name||"default",o=e.fps||30,a=e.blendMode;let l=e.length||-1;const g=e.hierarchy||[];for(let C=0;C{t&&t(r),this.manager.itemEnd(e)},0),r;if(oo[e]!==void 0){oo[e].push({onLoad:t,onProgress:i,onError:s});return}oo[e]=[],oo[e].push({onLoad:t,onProgress:i,onError:s});const o=new Request(e,{headers:new Headers(this.requestHeader),credentials:this.withCredentials?"include":"same-origin"}),a=this.mimeType,l=this.responseType;fetch(o).then(g=>{if(g.status===200||g.status===0){if(g.status===0&&console.warn("THREE.FileLoader: HTTP Status 0 received."),typeof ReadableStream>"u"||g.body===void 0||g.body.getReader===void 0)return g;const u=oo[e],C=g.body.getReader(),d=g.headers.get("Content-Length")||g.headers.get("X-File-Size"),h=d?parseInt(d):0,f=h!==0;let v=0;const y=new ReadableStream({start(A){b();function b(){C.read().then(({done:m,value:B})=>{if(m)A.close();else{v+=B.byteLength;const S=new ProgressEvent("progress",{lengthComputable:f,loaded:v,total:h});for(let x=0,R=u.length;x{switch(l){case"arraybuffer":return g.arrayBuffer();case"blob":return g.blob();case"document":return g.text().then(u=>new DOMParser().parseFromString(u,a));case"json":return g.json();default:if(a===void 0)return g.text();{const C=/charset="?([^;"\s]*)"?/i.exec(a),d=C&&C[1]?C[1].toLowerCase():void 0,h=new TextDecoder(d);return g.arrayBuffer().then(f=>h.decode(f))}}}).then(g=>{Wl.add(e,g);const u=oo[e];delete oo[e];for(let C=0,d=u.length;C{const u=oo[e];if(u===void 0)throw this.manager.itemError(e),g;delete oo[e];for(let C=0,d=u.length;C{this.manager.itemEnd(e)}),this.manager.itemStart(e)}setResponseType(e){return this.responseType=e,this}setMimeType(e){return this.mimeType=e,this}}class BE extends ws{constructor(e){super(e)}load(e,t,i,s){const r=this,o=new wo(this.manager);o.setPath(this.path),o.setRequestHeader(this.requestHeader),o.setWithCredentials(this.withCredentials),o.load(e,function(a){try{t(r.parse(JSON.parse(a)))}catch(l){s?s(l):console.error(l),r.manager.itemError(e)}},i,s)}parse(e){const t=[];for(let i=0;i0:s.vertexColors=e.vertexColors),e.uniforms!==void 0)for(const r in e.uniforms){const o=e.uniforms[r];switch(s.uniforms[r]={},o.type){case"t":s.uniforms[r].value=i(o.value);break;case"c":s.uniforms[r].value=new Xe().setHex(o.value);break;case"v2":s.uniforms[r].value=new oe().fromArray(o.value);break;case"v3":s.uniforms[r].value=new H().fromArray(o.value);break;case"v4":s.uniforms[r].value=new Yt().fromArray(o.value);break;case"m3":s.uniforms[r].value=new Mt().fromArray(o.value);break;case"m4":s.uniforms[r].value=new _e().fromArray(o.value);break;default:s.uniforms[r].value=o.value}}if(e.defines!==void 0&&(s.defines=e.defines),e.vertexShader!==void 0&&(s.vertexShader=e.vertexShader),e.fragmentShader!==void 0&&(s.fragmentShader=e.fragmentShader),e.glslVersion!==void 0&&(s.glslVersion=e.glslVersion),e.extensions!==void 0)for(const r in e.extensions)s.extensions[r]=e.extensions[r];if(e.lights!==void 0&&(s.lights=e.lights),e.clipping!==void 0&&(s.clipping=e.clipping),e.size!==void 0&&(s.size=e.size),e.sizeAttenuation!==void 0&&(s.sizeAttenuation=e.sizeAttenuation),e.map!==void 0&&(s.map=i(e.map)),e.matcap!==void 0&&(s.matcap=i(e.matcap)),e.alphaMap!==void 0&&(s.alphaMap=i(e.alphaMap)),e.bumpMap!==void 0&&(s.bumpMap=i(e.bumpMap)),e.bumpScale!==void 0&&(s.bumpScale=e.bumpScale),e.normalMap!==void 0&&(s.normalMap=i(e.normalMap)),e.normalMapType!==void 0&&(s.normalMapType=e.normalMapType),e.normalScale!==void 0){let r=e.normalScale;Array.isArray(r)===!1&&(r=[r,r]),s.normalScale=new oe().fromArray(r)}return e.displacementMap!==void 0&&(s.displacementMap=i(e.displacementMap)),e.displacementScale!==void 0&&(s.displacementScale=e.displacementScale),e.displacementBias!==void 0&&(s.displacementBias=e.displacementBias),e.roughnessMap!==void 0&&(s.roughnessMap=i(e.roughnessMap)),e.metalnessMap!==void 0&&(s.metalnessMap=i(e.metalnessMap)),e.emissiveMap!==void 0&&(s.emissiveMap=i(e.emissiveMap)),e.emissiveIntensity!==void 0&&(s.emissiveIntensity=e.emissiveIntensity),e.specularMap!==void 0&&(s.specularMap=i(e.specularMap)),e.specularIntensityMap!==void 0&&(s.specularIntensityMap=i(e.specularIntensityMap)),e.specularColorMap!==void 0&&(s.specularColorMap=i(e.specularColorMap)),e.envMap!==void 0&&(s.envMap=i(e.envMap)),e.envMapIntensity!==void 0&&(s.envMapIntensity=e.envMapIntensity),e.reflectivity!==void 0&&(s.reflectivity=e.reflectivity),e.refractionRatio!==void 0&&(s.refractionRatio=e.refractionRatio),e.lightMap!==void 0&&(s.lightMap=i(e.lightMap)),e.lightMapIntensity!==void 0&&(s.lightMapIntensity=e.lightMapIntensity),e.aoMap!==void 0&&(s.aoMap=i(e.aoMap)),e.aoMapIntensity!==void 0&&(s.aoMapIntensity=e.aoMapIntensity),e.gradientMap!==void 0&&(s.gradientMap=i(e.gradientMap)),e.clearcoatMap!==void 0&&(s.clearcoatMap=i(e.clearcoatMap)),e.clearcoatRoughnessMap!==void 0&&(s.clearcoatRoughnessMap=i(e.clearcoatRoughnessMap)),e.clearcoatNormalMap!==void 0&&(s.clearcoatNormalMap=i(e.clearcoatNormalMap)),e.clearcoatNormalScale!==void 0&&(s.clearcoatNormalScale=new oe().fromArray(e.clearcoatNormalScale)),e.iridescenceMap!==void 0&&(s.iridescenceMap=i(e.iridescenceMap)),e.iridescenceThicknessMap!==void 0&&(s.iridescenceThicknessMap=i(e.iridescenceThicknessMap)),e.transmissionMap!==void 0&&(s.transmissionMap=i(e.transmissionMap)),e.thicknessMap!==void 0&&(s.thicknessMap=i(e.thicknessMap)),e.sheenColorMap!==void 0&&(s.sheenColorMap=i(e.sheenColorMap)),e.sheenRoughnessMap!==void 0&&(s.sheenRoughnessMap=i(e.sheenRoughnessMap)),s}setTextures(e){return this.textures=e,this}static createMaterialFromType(e){const t={ShadowMaterial:lV,SpriteMaterial:Cy,RawShaderMaterial:gV,ShaderMaterial:Rt,PointsMaterial:hy,MeshPhysicalMaterial:cV,MeshStandardMaterial:Ap,MeshPhongMaterial:IV,MeshToonMaterial:uV,MeshNormalMaterial:Gy,MeshLambertMaterial:CV,MeshDepthMaterial:ap,MeshDistanceMaterial:Iy,MeshBasicMaterial:Sa,MeshMatcapMaterial:dV,LineDashedMaterial:hV,LineBasicMaterial:Ti,Material:ei};return new t[e]}}class Mb{static decodeText(e){if(typeof TextDecoder<"u")return new TextDecoder().decode(e);let t="";for(let i=0,s=e.length;i0){const l=new pp(t);r=new _u(l),r.setCrossOrigin(this.crossOrigin);for(let g=0,u=e.length;g0){s=new _u(this.manager),s.setCrossOrigin(this.crossOrigin);for(let o=0,a=e.length;o"u"&&console.warn("THREE.ImageBitmapLoader: createImageBitmap() not supported."),typeof fetch>"u"&&console.warn("THREE.ImageBitmapLoader: fetch() not supported."),this.options={premultiplyAlpha:"none"}}setOptions(e){return this.options=e,this}load(e,t,i,s){e===void 0&&(e=""),this.path!==void 0&&(e=this.path+e),e=this.manager.resolveURL(e);const r=this,o=Wl.get(e);if(o!==void 0)return r.manager.itemStart(e),setTimeout(function(){t&&t(o),r.manager.itemEnd(e)},0),o;const a={};a.credentials=this.crossOrigin==="anonymous"?"same-origin":"include",a.headers=this.requestHeader,fetch(e,a).then(function(l){return l.blob()}).then(function(l){return createImageBitmap(l,Object.assign(r.options,{colorSpaceConversion:"none"}))}).then(function(l){Wl.add(e,l),t&&t(l),r.manager.itemEnd(e)}).catch(function(l){s&&s(l),r.manager.itemError(e),r.manager.itemEnd(e)}),r.manager.itemStart(e)}}let uh;class Ry{static getContext(){return uh===void 0&&(uh=new(window.AudioContext||window.webkitAudioContext)),uh}static setContext(e){uh=e}}class HE extends ws{constructor(e){super(e)}load(e,t,i,s){const r=this,o=new wo(this.manager);o.setResponseType("arraybuffer"),o.setPath(this.path),o.setRequestHeader(this.requestHeader),o.setWithCredentials(this.withCredentials),o.load(e,function(l){try{const g=l.slice(0);Ry.getContext().decodeAudioData(g,function(C){t(C)},a)}catch(g){a(g)}},i,s);function a(l){s?s(l):console.error(l),r.manager.itemError(e)}}}class XE extends fp{constructor(e,t,i=1){super(void 0,i),this.isHemisphereLightProbe=!0;const s=new Xe().set(e),r=new Xe().set(t),o=new H(s.r,s.g,s.b),a=new H(r.r,r.g,r.b),l=Math.sqrt(Math.PI),g=l*Math.sqrt(.75);this.sh.coefficients[0].copy(o).add(a).multiplyScalar(l),this.sh.coefficients[1].copy(o).sub(a).multiplyScalar(g)}}class FE extends fp{constructor(e,t=1){super(void 0,t),this.isAmbientLightProbe=!0;const i=new Xe().set(e);this.sh.coefficients[0].set(i.r,i.g,i.b).multiplyScalar(2*Math.sqrt(Math.PI))}}const dw=new _e,hw=new _e,Da=new _e;class YE{constructor(){this.type="StereoCamera",this.aspect=1,this.eyeSep=.064,this.cameraL=new mn,this.cameraL.layers.enable(1),this.cameraL.matrixAutoUpdate=!1,this.cameraR=new mn,this.cameraR.layers.enable(2),this.cameraR.matrixAutoUpdate=!1,this._cache={focus:null,fov:null,aspect:null,near:null,far:null,zoom:null,eyeSep:null}}update(e){const t=this._cache;if(t.focus!==e.focus||t.fov!==e.fov||t.aspect!==e.aspect*this.aspect||t.near!==e.near||t.far!==e.far||t.zoom!==e.zoom||t.eyeSep!==this.eyeSep){t.focus=e.focus,t.fov=e.fov,t.aspect=e.aspect*this.aspect,t.near=e.near,t.far=e.far,t.zoom=e.zoom,t.eyeSep=this.eyeSep,Da.copy(e.projectionMatrix);const s=t.eyeSep/2,r=s*t.near/t.focus,o=t.near*Math.tan(pl*t.fov*.5)/t.zoom;let a,l;hw.elements[12]=-s,dw.elements[12]=s,a=-o*t.aspect+r,l=o*t.aspect+r,Da.elements[0]=2*t.near/(l-a),Da.elements[8]=(l+a)/(l-a),this.cameraL.projectionMatrix.copy(Da),a=-o*t.aspect-r,l=o*t.aspect-r,Da.elements[0]=2*t.near/(l-a),Da.elements[8]=(l+a)/(l-a),this.cameraR.projectionMatrix.copy(Da)}this.cameraL.matrixWorld.copy(e.matrixWorld).multiply(hw),this.cameraR.matrixWorld.copy(e.matrixWorld).multiply(dw)}}class Wy{constructor(e=!0){this.autoStart=e,this.startTime=0,this.oldTime=0,this.elapsedTime=0,this.running=!1}start(){this.startTime=Aw(),this.oldTime=this.startTime,this.elapsedTime=0,this.running=!0}stop(){this.getElapsedTime(),this.running=!1,this.autoStart=!1}getElapsedTime(){return this.getDelta(),this.elapsedTime}getDelta(){let e=0;if(this.autoStart&&!this.running)return this.start(),0;if(this.running){const t=Aw();e=(t-this.oldTime)/1e3,this.oldTime=t,this.elapsedTime+=e}return e}}function Aw(){return(typeof performance>"u"?Date:performance).now()}const Ua=new H,pw=new Mn,KE=new H,Pa=new H;class zE extends zt{constructor(){super(),this.type="AudioListener",this.context=Ry.getContext(),this.gain=this.context.createGain(),this.gain.connect(this.context.destination),this.filter=null,this.timeDelta=0,this._clock=new Wy}getInput(){return this.gain}removeFilter(){return this.filter!==null&&(this.gain.disconnect(this.filter),this.filter.disconnect(this.context.destination),this.gain.connect(this.context.destination),this.filter=null),this}getFilter(){return this.filter}setFilter(e){return this.filter!==null?(this.gain.disconnect(this.filter),this.filter.disconnect(this.context.destination)):this.gain.disconnect(this.context.destination),this.filter=e,this.gain.connect(this.filter),this.filter.connect(this.context.destination),this}getMasterVolume(){return this.gain.gain.value}setMasterVolume(e){return this.gain.gain.setTargetAtTime(e,this.context.currentTime,.01),this}updateMatrixWorld(e){super.updateMatrixWorld(e);const t=this.context.listener,i=this.up;if(this.timeDelta=this._clock.getDelta(),this.matrixWorld.decompose(Ua,pw,KE),Pa.set(0,0,-1).applyQuaternion(pw),t.positionX){const s=this.context.currentTime+this.timeDelta;t.positionX.linearRampToValueAtTime(Ua.x,s),t.positionY.linearRampToValueAtTime(Ua.y,s),t.positionZ.linearRampToValueAtTime(Ua.z,s),t.forwardX.linearRampToValueAtTime(Pa.x,s),t.forwardY.linearRampToValueAtTime(Pa.y,s),t.forwardZ.linearRampToValueAtTime(Pa.z,s),t.upX.linearRampToValueAtTime(i.x,s),t.upY.linearRampToValueAtTime(i.y,s),t.upZ.linearRampToValueAtTime(i.z,s)}else t.setPosition(Ua.x,Ua.y,Ua.z),t.setOrientation(Pa.x,Pa.y,Pa.z,i.x,i.y,i.z)}}class VV extends zt{constructor(e){super(),this.type="Audio",this.listener=e,this.context=e.context,this.gain=this.context.createGain(),this.gain.connect(e.getInput()),this.autoplay=!1,this.buffer=null,this.detune=0,this.loop=!1,this.loopStart=0,this.loopEnd=0,this.offset=0,this.duration=void 0,this.playbackRate=1,this.isPlaying=!1,this.hasPlaybackControl=!0,this.source=null,this.sourceType="empty",this._startedAt=0,this._progress=0,this._connected=!1,this.filters=[]}getOutput(){return this.gain}setNodeSource(e){return this.hasPlaybackControl=!1,this.sourceType="audioNode",this.source=e,this.connect(),this}setMediaElementSource(e){return this.hasPlaybackControl=!1,this.sourceType="mediaNode",this.source=this.context.createMediaElementSource(e),this.connect(),this}setMediaStreamSource(e){return this.hasPlaybackControl=!1,this.sourceType="mediaStreamNode",this.source=this.context.createMediaStreamSource(e),this.connect(),this}setBuffer(e){return this.buffer=e,this.sourceType="buffer",this.autoplay&&this.play(),this}play(e=0){if(this.isPlaying===!0){console.warn("THREE.Audio: Audio is already playing.");return}if(this.hasPlaybackControl===!1){console.warn("THREE.Audio: this Audio has no playback control.");return}this._startedAt=this.context.currentTime+e;const t=this.context.createBufferSource();return t.buffer=this.buffer,t.loop=this.loop,t.loopStart=this.loopStart,t.loopEnd=this.loopEnd,t.onended=this.onEnded.bind(this),t.start(this._startedAt,this._progress+this.offset,this.duration),this.isPlaying=!0,this.source=t,this.setDetune(this.detune),this.setPlaybackRate(this.playbackRate),this.connect()}pause(){if(this.hasPlaybackControl===!1){console.warn("THREE.Audio: this Audio has no playback control.");return}return this.isPlaying===!0&&(this._progress+=Math.max(this.context.currentTime-this._startedAt,0)*this.playbackRate,this.loop===!0&&(this._progress=this._progress%(this.duration||this.buffer.duration)),this.source.stop(),this.source.onended=null,this.isPlaying=!1),this}stop(){if(this.hasPlaybackControl===!1){console.warn("THREE.Audio: this Audio has no playback control.");return}return this._progress=0,this.source!==null&&(this.source.stop(),this.source.onended=null),this.isPlaying=!1,this}connect(){if(this.filters.length>0){this.source.connect(this.filters[0]);for(let e=1,t=this.filters.length;e0){this.source.disconnect(this.filters[0]);for(let e=1,t=this.filters.length;e0&&this._mixBufferRegionAdditive(i,s,this._addIndex*t,1,t);for(let l=t,g=t+t;l!==g;++l)if(i[l]!==i[l+t]){a.setValue(i,s);break}}saveOriginalState(){const e=this.binding,t=this.buffer,i=this.valueSize,s=i*this._origIndex;e.getValue(t,s);for(let r=i,o=s;r!==o;++r)t[r]=t[s+r%i];this._setIdentity(),this.cumulativeWeight=0,this.cumulativeWeightAdditive=0}restoreOriginalState(){const e=this.valueSize*3;this.binding.setValue(this.buffer,e)}_setAdditiveIdentityNumeric(){const e=this._addIndex*this.valueSize,t=e+this.valueSize;for(let i=e;i=.5)for(let o=0;o!==r;++o)e[t+o]=e[i+o]}_slerp(e,t,i,s){Mn.slerpFlat(e,t,e,t,e,i,s)}_slerpAdditive(e,t,i,s,r){const o=this._workIndex*r;Mn.multiplyQuaternionsFlat(e,o,e,t,e,i),Mn.slerpFlat(e,t,e,t,e,o,s)}_lerp(e,t,i,s,r){const o=1-s;for(let a=0;a!==r;++a){const l=t+a;e[l]=e[l]*o+e[i+a]*s}}_lerpAdditive(e,t,i,s,r){for(let o=0;o!==r;++o){const a=t+o;e[a]=e[a]+e[i+o]*s}}}const Vy="\\[\\]\\.:\\/",kE=new RegExp("["+Vy+"]","g"),My="[^"+Vy+"]",DE="[^"+Vy.replace("\\.","")+"]",UE=/((?:WC+[\/:])*)/.source.replace("WC",My),PE=/(WCOD+)?/.source.replace("WCOD",DE),_E=/(?:\.(WC+)(?:\[(.+)\])?)?/.source.replace("WC",My),JE=/\.(WC+)(?:\[(.+)\])?/.source.replace("WC",My),OE=new RegExp("^"+UE+PE+_E+JE+"$"),QE=["material","materials","bones","map"];class jE{constructor(e,t,i){const s=i||Et.parseTrackName(t);this._targetGroup=e,this._bindings=e.subscribe_(t,s)}getValue(e,t){this.bind();const i=this._targetGroup.nCachedObjects_,s=this._bindings[i];s!==void 0&&s.getValue(e,t)}setValue(e,t){const i=this._bindings;for(let s=this._targetGroup.nCachedObjects_,r=i.length;s!==r;++s)i[s].setValue(e,t)}bind(){const e=this._bindings;for(let t=this._targetGroup.nCachedObjects_,i=e.length;t!==i;++t)e[t].bind()}unbind(){const e=this._bindings;for(let t=this._targetGroup.nCachedObjects_,i=e.length;t!==i;++t)e[t].unbind()}}class Et{constructor(e,t,i){this.path=t,this.parsedPath=i||Et.parseTrackName(t),this.node=Et.findNode(e,this.parsedPath.nodeName),this.rootNode=e,this.getValue=this._getValue_unbound,this.setValue=this._setValue_unbound}static create(e,t,i){return e&&e.isAnimationObjectGroup?new Et.Composite(e,t,i):new Et(e,t,i)}static sanitizeNodeName(e){return e.replace(/\s/g,"_").replace(kE,"")}static parseTrackName(e){const t=OE.exec(e);if(t===null)throw new Error("PropertyBinding: Cannot parse trackName: "+e);const i={nodeName:t[2],objectName:t[3],objectIndex:t[4],propertyName:t[5],propertyIndex:t[6]},s=i.nodeName&&i.nodeName.lastIndexOf(".");if(s!==void 0&&s!==-1){const r=i.nodeName.substring(s+1);QE.indexOf(r)!==-1&&(i.nodeName=i.nodeName.substring(0,s),i.objectName=r)}if(i.propertyName===null||i.propertyName.length===0)throw new Error("PropertyBinding: can not parse propertyName from trackName: "+e);return i}static findNode(e,t){if(t===void 0||t===""||t==="."||t===-1||t===e.name||t===e.uuid)return e;if(e.skeleton){const i=e.skeleton.getBoneByName(t);if(i!==void 0)return i}if(e.children){const i=function(r){for(let o=0;o=r){const C=r++,d=e[C];t[d.uuid]=u,e[u]=d,t[g]=C,e[C]=l;for(let h=0,f=s;h!==f;++h){const v=i[h],y=v[C],A=v[u];v[u]=y,v[C]=A}}}this.nCachedObjects_=r}uncache(){const e=this._objects,t=this._indicesByUUID,i=this._bindings,s=i.length;let r=this.nCachedObjects_,o=e.length;for(let a=0,l=arguments.length;a!==l;++a){const g=arguments[a],u=g.uuid,C=t[u];if(C!==void 0)if(delete t[u],C0&&(t[h.uuid]=C),e[C]=h,e.pop();for(let f=0,v=s;f!==v;++f){const y=i[f];y[C]=y[d],y.pop()}}}this.nCachedObjects_=r}subscribe_(e,t){const i=this._bindingsIndicesByPath;let s=i[e];const r=this._bindings;if(s!==void 0)return r[s];const o=this._paths,a=this._parsedPaths,l=this._objects,g=l.length,u=this.nCachedObjects_,C=new Array(g);s=r.length,i[e]=s,o.push(e),a.push(t),r.push(C);for(let d=u,h=l.length;d!==h;++d){const f=l[d];C[d]=new Et(f,e,t)}return C}unsubscribe_(e){const t=this._bindingsIndicesByPath,i=t[e];if(i!==void 0){const s=this._paths,r=this._parsedPaths,o=this._bindings,a=o.length-1,l=o[a],g=e[a];t[g]=i,o[i]=l,o.pop(),r[i]=r[a],r.pop(),s[i]=s[a],s.pop()}}}class NV{constructor(e,t,i=null,s=t.blendMode){this._mixer=e,this._clip=t,this._localRoot=i,this.blendMode=s;const r=t.tracks,o=r.length,a=new Array(o),l={endingStart:gl,endingEnd:gl};for(let g=0;g!==o;++g){const u=r[g].createInterpolant(null);a[g]=u,u.settings=l}this._interpolantSettings=l,this._interpolants=a,this._propertyBindings=new Array(o),this._cacheIndex=null,this._byClipCacheIndex=null,this._timeScaleInterpolant=null,this._weightInterpolant=null,this.loop=GW,this._loopCount=-1,this._startTime=null,this.time=0,this.timeScale=1,this._effectiveTimeScale=1,this.weight=1,this._effectiveWeight=1,this.repetitions=1/0,this.paused=!1,this.enabled=!0,this.clampWhenFinished=!1,this.zeroSlopeAtStart=!0,this.zeroSlopeAtEnd=!0}play(){return this._mixer._activateAction(this),this}stop(){return this._mixer._deactivateAction(this),this.reset()}reset(){return this.paused=!1,this.enabled=!0,this.time=0,this._loopCount=-1,this._startTime=null,this.stopFading().stopWarping()}isRunning(){return this.enabled&&!this.paused&&this.timeScale!==0&&this._startTime===null&&this._mixer._isActiveAction(this)}isScheduled(){return this._mixer._isActiveAction(this)}startAt(e){return this._startTime=e,this}setLoop(e,t){return this.loop=e,this.repetitions=t,this}setEffectiveWeight(e){return this.weight=e,this._effectiveWeight=this.enabled?e:0,this.stopFading()}getEffectiveWeight(){return this._effectiveWeight}fadeIn(e){return this._scheduleFading(e,0,1)}fadeOut(e){return this._scheduleFading(e,1,0)}crossFadeFrom(e,t,i){if(e.fadeOut(t),this.fadeIn(t),i){const s=this._clip.duration,r=e._clip.duration,o=r/s,a=s/r;e.warp(1,o,t),this.warp(a,1,t)}return this}crossFadeTo(e,t,i){return e.crossFadeFrom(this,t,i)}stopFading(){const e=this._weightInterpolant;return e!==null&&(this._weightInterpolant=null,this._mixer._takeBackControlInterpolant(e)),this}setEffectiveTimeScale(e){return this.timeScale=e,this._effectiveTimeScale=this.paused?0:e,this.stopWarping()}getEffectiveTimeScale(){return this._effectiveTimeScale}setDuration(e){return this.timeScale=this._clip.duration/e,this.stopWarping()}syncWith(e){return this.time=e.time,this.timeScale=e.timeScale,this.stopWarping()}halt(e){return this.warp(this._effectiveTimeScale,0,e)}warp(e,t,i){const s=this._mixer,r=s.time,o=this.timeScale;let a=this._timeScaleInterpolant;a===null&&(a=s._lendControlInterpolant(),this._timeScaleInterpolant=a);const l=a.parameterPositions,g=a.sampleValues;return l[0]=r,l[1]=r+i,g[0]=e/o,g[1]=t/o,this}stopWarping(){const e=this._timeScaleInterpolant;return e!==null&&(this._timeScaleInterpolant=null,this._mixer._takeBackControlInterpolant(e)),this}getMixer(){return this._mixer}getClip(){return this._clip}getRoot(){return this._localRoot||this._mixer._root}_update(e,t,i,s){if(!this.enabled){this._updateWeight(e);return}const r=this._startTime;if(r!==null){const l=(e-r)*i;l<0||i===0?t=0:(this._startTime=null,t=i*l)}t*=this._updateTimeScale(e);const o=this._updateTime(t),a=this._updateWeight(e);if(a>0){const l=this._interpolants,g=this._propertyBindings;switch(this.blendMode){case iy:for(let u=0,C=l.length;u!==C;++u)l[u].evaluate(o),g[u].accumulateAdditive(a);break;case np:default:for(let u=0,C=l.length;u!==C;++u)l[u].evaluate(o),g[u].accumulate(s,a)}}}_updateWeight(e){let t=0;if(this.enabled){t=this.weight;const i=this._weightInterpolant;if(i!==null){const s=i.evaluate(e)[0];t*=s,e>i.parameterPositions[1]&&(this.stopFading(),s===0&&(this.enabled=!1))}}return this._effectiveWeight=t,t}_updateTimeScale(e){let t=0;if(!this.paused){t=this.timeScale;const i=this._timeScaleInterpolant;if(i!==null){const s=i.evaluate(e)[0];t*=s,e>i.parameterPositions[1]&&(this.stopWarping(),t===0?this.paused=!0:this.timeScale=t)}}return this._effectiveTimeScale=t,t}_updateTime(e){const t=this._clip.duration,i=this.loop;let s=this.time+e,r=this._loopCount;const o=i===BW;if(e===0)return r===-1?s:o&&(r&1)===1?t-s:s;if(i===yW){r===-1&&(this._loopCount=0,this._setEndings(!0,!0,!1));e:{if(s>=t)s=t;else if(s<0)s=0;else{this.time=s;break e}this.clampWhenFinished?this.paused=!0:this.enabled=!1,this.time=s,this._mixer.dispatchEvent({type:"finished",action:this,direction:e<0?-1:1})}}else{if(r===-1&&(e>=0?(r=0,this._setEndings(!0,this.repetitions===0,o)):this._setEndings(this.repetitions===0,!0,o)),s>=t||s<0){const a=Math.floor(s/t);s-=t*a,r+=Math.abs(a);const l=this.repetitions-r;if(l<=0)this.clampWhenFinished?this.paused=!0:this.enabled=!1,s=e>0?t:0,this.time=s,this._mixer.dispatchEvent({type:"finished",action:this,direction:e>0?1:-1});else{if(l===1){const g=e<0;this._setEndings(g,!g,o)}else this._setEndings(!1,!1,o);this._loopCount=r,this.time=s,this._mixer.dispatchEvent({type:"loop",action:this,loopDelta:a})}}else this.time=s;if(o&&(r&1)===1)return t-s}return s}_setEndings(e,t,i){const s=this._interpolantSettings;i?(s.endingStart=cl,s.endingEnd=cl):(e?s.endingStart=this.zeroSlopeAtStart?cl:gl:s.endingStart=Yu,t?s.endingEnd=this.zeroSlopeAtEnd?cl:gl:s.endingEnd=Yu)}_scheduleFading(e,t,i){const s=this._mixer,r=s.time;let o=this._weightInterpolant;o===null&&(o=s._lendControlInterpolant(),this._weightInterpolant=o);const a=o.parameterPositions,l=o.sampleValues;return a[0]=r,l[0]=t,a[1]=r+e,l[1]=i,this}}const $E=new Float32Array(1);class eT extends Ps{constructor(e){super(),this._root=e,this._initMemoryManager(),this._accuIndex=0,this.time=0,this.timeScale=1}_bindAction(e,t){const i=e._localRoot||this._root,s=e._clip.tracks,r=s.length,o=e._propertyBindings,a=e._interpolants,l=i.uuid,g=this._bindingsByRootAndName;let u=g[l];u===void 0&&(u={},g[l]=u);for(let C=0;C!==r;++C){const d=s[C],h=d.name;let f=u[h];if(f!==void 0)++f.referenceCount,o[C]=f;else{if(f=o[C],f!==void 0){f._cacheIndex===null&&(++f.referenceCount,this._addInactiveBinding(f,l,h));continue}const v=t&&t._propertyBindings[C].binding.parsedPath;f=new MV(Et.create(i,h,v),d.ValueTypeName,d.getValueSize()),++f.referenceCount,this._addInactiveBinding(f,l,h),o[C]=f}a[C].resultBuffer=f.buffer}}_activateAction(e){if(!this._isActiveAction(e)){if(e._cacheIndex===null){const i=(e._localRoot||this._root).uuid,s=e._clip.uuid,r=this._actionsByClip[s];this._bindAction(e,r&&r.knownActions[0]),this._addInactiveAction(e,s,i)}const t=e._propertyBindings;for(let i=0,s=t.length;i!==s;++i){const r=t[i];r.useCount++===0&&(this._lendBinding(r),r.saveOriginalState())}this._lendAction(e)}}_deactivateAction(e){if(this._isActiveAction(e)){const t=e._propertyBindings;for(let i=0,s=t.length;i!==s;++i){const r=t[i];--r.useCount===0&&(r.restoreOriginalState(),this._takeBackBinding(r))}this._takeBackAction(e)}}_initMemoryManager(){this._actions=[],this._nActiveActions=0,this._actionsByClip={},this._bindings=[],this._nActiveBindings=0,this._bindingsByRootAndName={},this._controlInterpolants=[],this._nActiveControlInterpolants=0;const e=this;this.stats={actions:{get total(){return e._actions.length},get inUse(){return e._nActiveActions}},bindings:{get total(){return e._bindings.length},get inUse(){return e._nActiveBindings}},controlInterpolants:{get total(){return e._controlInterpolants.length},get inUse(){return e._nActiveControlInterpolants}}}}_isActiveAction(e){const t=e._cacheIndex;return t!==null&&t=0;--i)e[i].stop();return this}update(e){e*=this.timeScale;const t=this._actions,i=this._nActiveActions,s=this.time+=e,r=Math.sign(e),o=this._accuIndex^=1;for(let g=0;g!==i;++g)t[g]._update(s,e,r,o);const a=this._bindings,l=this._nActiveBindings;for(let g=0;g!==l;++g)a[g].apply(o);return this}setTime(e){this.time=0;for(let t=0;tthis.max.x||e.ythis.max.y)}containsBox(e){return this.min.x<=e.min.x&&e.max.x<=this.max.x&&this.min.y<=e.min.y&&e.max.y<=this.max.y}getParameter(e,t){return t.set((e.x-this.min.x)/(this.max.x-this.min.x),(e.y-this.min.y)/(this.max.y-this.min.y))}intersectsBox(e){return!(e.max.xthis.max.x||e.max.ythis.max.y)}clampPoint(e,t){return t.copy(e).clamp(this.min,this.max)}distanceToPoint(e){return this.clampPoint(e,bw).distanceTo(e)}intersect(e){return this.min.max(e.min),this.max.min(e.max),this.isEmpty()&&this.makeEmpty(),this}union(e){return this.min.min(e.min),this.max.max(e.max),this}translate(e){return this.min.add(e),this.max.add(e),this}equals(e){return e.min.equals(this.min)&&e.max.equals(this.max)}}const vw=new H,Ch=new H;class aT{constructor(e=new H,t=new H){this.start=e,this.end=t}set(e,t){return this.start.copy(e),this.end.copy(t),this}copy(e){return this.start.copy(e.start),this.end.copy(e.end),this}getCenter(e){return e.addVectors(this.start,this.end).multiplyScalar(.5)}delta(e){return e.subVectors(this.end,this.start)}distanceSq(){return this.start.distanceToSquared(this.end)}distance(){return this.start.distanceTo(this.end)}at(e,t){return this.delta(t).multiplyScalar(e).add(this.start)}closestPointToPointParameter(e,t){vw.subVectors(e,this.start),Ch.subVectors(this.end,this.start);const i=Ch.dot(Ch);let r=Ch.dot(vw)/i;return t&&(r=Sn(r,0,1)),r}closestPointToPoint(e,t,i){const s=this.closestPointToPointParameter(e,t);return this.delta(i).multiplyScalar(s).add(this.start)}applyMatrix4(e){return this.start.applyMatrix4(e),this.end.applyMatrix4(e),this}equals(e){return e.start.equals(this.start)&&e.end.equals(this.end)}clone(){return new this.constructor().copy(this)}}const yw=new H;class lT extends zt{constructor(e,t){super(),this.light=e,this.matrix=e.matrixWorld,this.matrixAutoUpdate=!1,this.color=t,this.type="SpotLightHelper";const i=new Gt,s=[0,0,0,0,0,1,0,0,0,1,0,1,0,0,0,-1,0,1,0,0,0,0,1,1,0,0,0,0,-1,1];for(let o=0,a=1,l=32;o1)for(let C=0;C.99999)this.quaternion.set(0,0,0,1);else if(e.y<-.99999)this.quaternion.set(1,0,0,0);else{Sw.set(e.z,0,-e.x).normalize();const t=Math.acos(e.y);this.quaternion.setFromAxisAngle(Sw,t)}}setLength(e,t=e*.2,i=t*.2){this.line.scale.set(1,Math.max(1e-4,e-t),1),this.line.updateMatrix(),this.cone.scale.set(i,t,i),this.cone.position.y=e,this.cone.updateMatrix()}setColor(e){this.line.material.color.set(e),this.cone.material.color.set(e)}copy(e){return super.copy(e,!1),this.line.copy(e.line),this.cone.copy(e.cone),this}dispose(){this.line.geometry.dispose(),this.line.material.dispose(),this.cone.geometry.dispose(),this.cone.material.dispose()}}class vT extends Ur{constructor(e=1){const t=[0,0,0,e,0,0,0,0,0,0,e,0,0,0,0,0,0,e],i=[1,0,0,1,.6,0,0,1,0,.6,1,0,0,0,1,0,.6,1],s=new Gt;s.setAttribute("position",new je(t,3)),s.setAttribute("color",new je(i,3));const r=new Ti({vertexColors:!0,toneMapped:!1});super(s,r),this.type="AxesHelper"}setColors(e,t,i){const s=new Xe,r=this.geometry.attributes.color.array;return s.set(e),s.toArray(r,0),s.toArray(r,3),s.set(t),s.toArray(r,6),s.toArray(r,9),s.set(i),s.toArray(r,12),s.toArray(r,15),this.geometry.attributes.color.needsUpdate=!0,this}dispose(){this.geometry.dispose(),this.material.dispose()}}class yT{constructor(){this.type="ShapePath",this.color=new Xe,this.subPaths=[],this.currentPath=null}moveTo(e,t){return this.currentPath=new Lu,this.subPaths.push(this.currentPath),this.currentPath.moveTo(e,t),this}lineTo(e,t){return this.currentPath.lineTo(e,t),this}quadraticCurveTo(e,t,i,s){return this.currentPath.quadraticCurveTo(e,t,i,s),this}bezierCurveTo(e,t,i,s,r,o){return this.currentPath.bezierCurveTo(e,t,i,s,r,o),this}splineThru(e){return this.currentPath.splineThru(e),this}toShapes(e){function t(A){const b=[];for(let m=0,B=A.length;mNumber.EPSILON){if(V<0&&(R=b[x],Z=-Z,M=b[S],V=-V),A.yM.y)continue;if(A.y===R.y){if(A.x===R.x)return!0}else{const N=V*(A.x-R.x)-Z*(A.y-R.y);if(N===0)return!0;if(N<0)continue;B=!B}}else{if(A.y!==R.y)continue;if(M.x<=A.x&&A.x<=R.x||R.x<=A.x&&A.x<=M.x)return!0}}return B}const s=Lr.isClockWise,r=this.subPaths;if(r.length===0)return[];let o,a,l;const g=[];if(r.length===1)return a=r[0],l=new bl,l.curves=a.curves,g.push(l),g;let u=!s(r[0].getPoints());u=e?!u:u;const C=[],d=[];let h=[],f=0,v;d[f]=void 0,h[f]=[];for(let A=0,b=r.length;A1){let A=!1,b=0;for(let m=0,B=d.length;m0&&A===!1&&(h=C)}let y;for(let A=0,b=d.length;Aj||w[L]!==W[j]){var me=` -`+w[L].replace(" at new "," at ");return c.displayName&&me.includes("")&&(me=me.replace("",c.displayName)),me}while(1<=L&&0<=j);break}}}finally{Vt=!1,Error.prepareStackTrace=p}return(c=c?c.displayName||c.name:"")?ln(c):""}var Xn=Object.prototype.hasOwnProperty,Qs=[],_r=-1;function ki(c){return{current:c}}function en(c){0>_r||(c.current=Qs[_r],Qs[_r]=null,_r--)}function bt(c,I){_r++,Qs[_r]=c.current,c.current=I}var fi={},Fn=ki(fi),nn=ki(!1),js=fi;function Ho(c,I){var p=c.type.contextTypes;if(!p)return fi;var G=c.stateNode;if(G&&G.__reactInternalMemoizedUnmaskedChildContext===I)return G.__reactInternalMemoizedMaskedChildContext;var w={},W;for(W in p)w[W]=I[W];return G&&(c=c.stateNode,c.__reactInternalMemoizedUnmaskedChildContext=I,c.__reactInternalMemoizedMaskedChildContext=w),w}function li(c){return c=c.childContextTypes,c!=null}function vC(){en(nn),en(Fn)}function _y(c,I,p){if(Fn.current!==fi)throw Error(o(168));bt(Fn,I),bt(nn,p)}function Jy(c,I,p){var G=c.stateNode;if(I=I.childContextTypes,typeof G.getChildContext!="function")return p;G=G.getChildContext();for(var w in G)if(!(w in I))throw Error(o(108,M(c)||"Unknown",w));return r({},p,G)}function yC(c){return c=(c=c.stateNode)&&c.__reactInternalMemoizedMergedChildContext||fi,js=Fn.current,bt(Fn,c),bt(nn,nn.current),!0}function Oy(c,I,p){var G=c.stateNode;if(!G)throw Error(o(169));p?(c=Jy(c,I,js),G.__reactInternalMemoizedMergedChildContext=c,en(nn),en(Fn),bt(Fn,c)):en(nn),bt(nn,p)}var qs=Math.clz32?Math.clz32:OM,_M=Math.log,JM=Math.LN2;function OM(c){return c>>>=0,c===0?32:31-(_M(c)/JM|0)|0}var GC=64,BC=4194304;function Kc(c){switch(c&-c){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return c&4194240;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return c&130023424;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 1073741824;default:return c}}function ZC(c,I){var p=c.pendingLanes;if(p===0)return 0;var G=0,w=c.suspendedLanes,W=c.pingedLanes,L=p&268435455;if(L!==0){var j=L&~w;j!==0?G=Kc(j):(W&=L,W!==0&&(G=Kc(W)))}else L=p&~w,L!==0?G=Kc(L):W!==0&&(G=Kc(W));if(G===0)return 0;if(I!==0&&I!==G&&!(I&w)&&(w=G&-G,W=I&-I,w>=W||w===16&&(W&4194240)!==0))return I;if(G&4&&(G|=p&16),I=c.entangledLanes,I!==0)for(c=c.entanglements,I&=G;0p;p++)I.push(c);return I}function zc(c,I,p){c.pendingLanes|=I,I!==536870912&&(c.suspendedLanes=0,c.pingedLanes=0),c=c.eventTimes,I=31-qs(I),c[I]=p}function qM(c,I){var p=c.pendingLanes&~I;c.pendingLanes=I,c.suspendedLanes=0,c.pingedLanes=0,c.expiredLanes&=I,c.mutableReadLanes&=I,c.entangledLanes&=I,I=c.entanglements;var G=c.eventTimes;for(c=c.expirationTimes;0>=L,w-=L,Qr=1<<32-qs(I)+w|p<Dt?(ii=ft,ft=null):ii=ft.sibling;var Ut=It(ue,ft,pe[Dt],De);if(Ut===null){ft===null&&(ft=ii);break}c&&ft&&Ut.alternate===null&&I(ue,ft),ee=W(Ut,ee,Dt),Bt===null?$e=Ut:Bt.sibling=Ut,Bt=Ut,ft=ii}if(Dt===pe.length)return p(ue,ft),dn&&Na(ue,Dt),$e;if(ft===null){for(;DtDt?(ii=ft,ft=null):ii=ft.sibling;var To=It(ue,ft,Ut.value,De);if(To===null){ft===null&&(ft=ii);break}c&&ft&&To.alternate===null&&I(ue,ft),ee=W(To,ee,Dt),Bt===null?$e=To:Bt.sibling=To,Bt=To,ft=ii}if(Ut.done)return p(ue,ft),dn&&Na(ue,Dt),$e;if(ft===null){for(;!Ut.done;Dt++,Ut=pe.next())Ut=pt(ue,Ut.value,De),Ut!==null&&(ee=W(Ut,ee,Dt),Bt===null?$e=Ut:Bt.sibling=Ut,Bt=Ut);return dn&&Na(ue,Dt),$e}for(ft=G(ue,ft);!Ut.done;Dt++,Ut=pe.next())Ut=on(ft,ue,Dt,Ut.value,De),Ut!==null&&(c&&Ut.alternate!==null&&ft.delete(Ut.key===null?Dt:Ut.key),ee=W(Ut,ee,Dt),Bt===null?$e=Ut:Bt.sibling=Ut,Bt=Ut);return c&&ft.forEach(function(Y5){return I(ue,Y5)}),dn&&Na(ue,Dt),$e}function Hs(ue,ee,pe,De){if(typeof pe=="object"&&pe!==null&&pe.type===u&&pe.key===null&&(pe=pe.props.children),typeof pe=="object"&&pe!==null){switch(pe.$$typeof){case l:e:{for(var $e=pe.key,Bt=ee;Bt!==null;){if(Bt.key===$e){if($e=pe.type,$e===u){if(Bt.tag===7){p(ue,Bt.sibling),ee=w(Bt,pe.props.children),ee.return=ue,ue=ee;break e}}else if(Bt.elementType===$e||typeof $e=="object"&&$e!==null&&$e.$$typeof===m&&IG($e)===Bt.type){p(ue,Bt.sibling),ee=w(Bt,pe.props),ee.ref=Tc(ue,Bt,pe),ee.return=ue,ue=ee;break e}p(ue,Bt);break}else I(ue,Bt);Bt=Bt.sibling}pe.type===u?(ee=La(pe.props.children,ue.mode,De,pe.key),ee.return=ue,ue=ee):(De=Cd(pe.type,pe.key,pe.props,null,ue.mode,De),De.ref=Tc(ue,ee,pe),De.return=ue,ue=De)}return L(ue);case g:e:{for(Bt=pe.key;ee!==null;){if(ee.key===Bt)if(ee.tag===4&&ee.stateNode.containerInfo===pe.containerInfo&&ee.stateNode.implementation===pe.implementation){p(ue,ee.sibling),ee=w(ee,pe.children||[]),ee.return=ue,ue=ee;break e}else{p(ue,ee);break}else I(ue,ee);ee=ee.sibling}ee=Zf(pe,ue.mode,De),ee.return=ue,ue=ee}return L(ue);case m:return Bt=pe._init,Hs(ue,ee,Bt(pe._payload),De)}if(ie(pe))return it(ue,ee,pe,De);if(x(pe))return yi(ue,ee,pe,De);FC(ue,pe)}return typeof pe=="string"&&pe!==""||typeof pe=="number"?(pe=""+pe,ee!==null&&ee.tag===6?(p(ue,ee.sibling),ee=w(ee,pe),ee.return=ue,ue=ee):(p(ue,ee),ee=Bf(pe,ue.mode,De),ee.return=ue,ue=ee),L(ue)):p(ue,ee)}return Hs}var Jl=uG(!0),CG=uG(!1),kc={},Ws=ki(kc),Dc=ki(kc),Ol=ki(kc);function wr(c){if(c===kc)throw Error(o(174));return c}function Ep(c,I){bt(Ol,I),bt(Dc,c),bt(Ws,kc),c=Ce(I),en(Ws),bt(Ws,c)}function Ql(){en(Ws),en(Dc),en(Ol)}function dG(c){var I=wr(Ol.current),p=wr(Ws.current);I=z(p,c.type,I),p!==I&&(bt(Dc,c),bt(Ws,I))}function Tp(c){Dc.current===c&&(en(Ws),en(Dc))}var pn=ki(0);function YC(c){for(var I=c;I!==null;){if(I.tag===13){var p=I.memoizedState;if(p!==null&&(p=p.dehydrated,p===null||Pr(p)||$t(p)))return I}else if(I.tag===19&&I.memoizedProps.revealOrder!==void 0){if(I.flags&128)return I}else if(I.child!==null){I.child.return=I,I=I.child;continue}if(I===c)break;for(;I.sibling===null;){if(I.return===null||I.return===c)return null;I=I.return}I.sibling.return=I.return,I=I.sibling}return null}var kp=[];function Dp(){for(var c=0;cp?p:4,c(!0);var G=Vs.transition;Vs.transition={};try{c(!1),I()}finally{kt=p,Vs.transition=G}}function xG(){return Sr().memoizedState}function c5(c,I,p){var G=zo(c);p={lane:G,action:p,hasEagerState:!1,eagerState:null,next:null},RG(c)?WG(I,p):(VG(c,I,p),p=Mi(),c=Ms(c,G,p),c!==null&&MG(c,I,G))}function I5(c,I,p){var G=zo(c),w={lane:G,action:p,hasEagerState:!1,eagerState:null,next:null};if(RG(c))WG(I,w);else{VG(c,I,w);var W=c.alternate;if(c.lanes===0&&(W===null||W.lanes===0)&&(W=I.lastRenderedReducer,W!==null))try{var L=I.lastRenderedState,j=W(L,p);if(w.hasEagerState=!0,w.eagerState=j,Gr(j,L))return}catch{}finally{}p=Mi(),c=Ms(c,G,p),c!==null&&MG(c,I,G)}}function RG(c){var I=c.alternate;return c===Bn||I!==null&&I===Bn}function WG(c,I){Uc=zC=!0;var p=c.pending;p===null?I.next=I:(I.next=p.next,p.next=I),c.pending=I}function VG(c,I,p){Yn!==null&&c.mode&1&&!(xt&2)?(c=I.interleaved,c===null?(p.next=p,Zr===null?Zr=[I]:Zr.push(I)):(p.next=c.next,c.next=p),I.interleaved=p):(c=I.pending,c===null?p.next=p:(p.next=c.next,c.next=p),I.pending=p)}function MG(c,I,p){if(p&4194240){var G=I.lanes;G&=c.pendingLanes,p|=G,I.lanes=p,Bp(c,p)}}var DC={readContext:Ss,useCallback:bi,useContext:bi,useEffect:bi,useImperativeHandle:bi,useInsertionEffect:bi,useLayoutEffect:bi,useMemo:bi,useReducer:bi,useRef:bi,useState:bi,useDebugValue:bi,useDeferredValue:bi,useTransition:bi,useMutableSource:bi,useSyncExternalStore:bi,useId:bi,unstable_isNewReconciler:!1},u5={readContext:Ss,useCallback:function(c,I){return qr().memoizedState=[c,I===void 0?null:I],c},useContext:Ss,useEffect:Op,useImperativeHandle:function(c,I,p){return p=p!=null?p.concat([c]):null,TC(4194308,4,BG.bind(null,I,c),p)},useLayoutEffect:function(c,I){return TC(4194308,4,c,I)},useInsertionEffect:function(c,I){return TC(4,2,c,I)},useMemo:function(c,I){var p=qr();return I=I===void 0?null:I,c=c(),p.memoizedState=[c,I],c},useReducer:function(c,I,p){var G=qr();return I=p!==void 0?p(I):I,G.memoizedState=G.baseState=I,c={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:c,lastRenderedState:I},G.queue=c,c=c.dispatch=c5.bind(null,Bn,c),[G.memoizedState,c]},useRef:function(c){var I=qr();return c={current:c},I.memoizedState=c},useState:Jp,useDebugValue:Qp,useDeferredValue:function(c){var I=Jp(c),p=I[0],G=I[1];return Op(function(){var w=Vs.transition;Vs.transition={};try{G(c)}finally{Vs.transition=w}},[c]),p},useTransition:function(){var c=Jp(!1),I=c[0];return c=g5.bind(null,c[1]),qr().memoizedState=c,[I,c]},useMutableSource:function(){},useSyncExternalStore:function(c,I,p){var G=Bn,w=qr();if(dn){if(p===void 0)throw Error(o(407));p=p()}else{if(p=I(),Yn===null)throw Error(o(349));jl&30||pG(G,I,p)}w.memoizedState=p;var W={value:p,getSnapshot:I};return w.queue=W,Op(mG.bind(null,G,W,c),[c]),G.flags|=2048,_c(9,fG.bind(null,G,W,p,I),void 0,null),p},useId:function(){var c=qr(),I=Yn.identifierPrefix;if(dn){var p=jr,G=Qr;p=(G&~(1<<32-qs(G)-1)).toString(32)+p,I=":"+I+"R"+p,p=Pc++,0j||w[E]!==W[j]){var me=` +`+w[E].replace(" at new "," at ");return c.displayName&&me.includes("")&&(me=me.replace("",c.displayName)),me}while(1<=E&&0<=j);break}}}finally{Vt=!1,Error.prepareStackTrace=p}return(c=c?c.displayName||c.name:"")?ln(c):""}var Xn=Object.prototype.hasOwnProperty,Qs=[],_r=-1;function ki(c){return{current:c}}function en(c){0>_r||(c.current=Qs[_r],Qs[_r]=null,_r--)}function bt(c,I){_r++,Qs[_r]=c.current,c.current=I}var fi={},Fn=ki(fi),nn=ki(!1),js=fi;function Ho(c,I){var p=c.type.contextTypes;if(!p)return fi;var G=c.stateNode;if(G&&G.__reactInternalMemoizedUnmaskedChildContext===I)return G.__reactInternalMemoizedMaskedChildContext;var w={},W;for(W in p)w[W]=I[W];return G&&(c=c.stateNode,c.__reactInternalMemoizedUnmaskedChildContext=I,c.__reactInternalMemoizedMaskedChildContext=w),w}function li(c){return c=c.childContextTypes,c!=null}function vC(){en(nn),en(Fn)}function _y(c,I,p){if(Fn.current!==fi)throw Error(o(168));bt(Fn,I),bt(nn,p)}function Jy(c,I,p){var G=c.stateNode;if(I=I.childContextTypes,typeof G.getChildContext!="function")return p;G=G.getChildContext();for(var w in G)if(!(w in I))throw Error(o(108,M(c)||"Unknown",w));return r({},p,G)}function yC(c){return c=(c=c.stateNode)&&c.__reactInternalMemoizedMergedChildContext||fi,js=Fn.current,bt(Fn,c),bt(nn,nn.current),!0}function Oy(c,I,p){var G=c.stateNode;if(!G)throw Error(o(169));p?(c=Jy(c,I,js),G.__reactInternalMemoizedMergedChildContext=c,en(nn),en(Fn),bt(Fn,c)):en(nn),bt(nn,p)}var qs=Math.clz32?Math.clz32:OM,_M=Math.log,JM=Math.LN2;function OM(c){return c>>>=0,c===0?32:31-(_M(c)/JM|0)|0}var GC=64,BC=4194304;function zc(c){switch(c&-c){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return c&4194240;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return c&130023424;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 1073741824;default:return c}}function ZC(c,I){var p=c.pendingLanes;if(p===0)return 0;var G=0,w=c.suspendedLanes,W=c.pingedLanes,E=p&268435455;if(E!==0){var j=E&~w;j!==0?G=zc(j):(W&=E,W!==0&&(G=zc(W)))}else E=p&~w,E!==0?G=zc(E):W!==0&&(G=zc(W));if(G===0)return 0;if(I!==0&&I!==G&&!(I&w)&&(w=G&-G,W=I&-I,w>=W||w===16&&(W&4194240)!==0))return I;if(G&4&&(G|=p&16),I=c.entangledLanes,I!==0)for(c=c.entanglements,I&=G;0p;p++)I.push(c);return I}function Lc(c,I,p){c.pendingLanes|=I,I!==536870912&&(c.suspendedLanes=0,c.pingedLanes=0),c=c.eventTimes,I=31-qs(I),c[I]=p}function qM(c,I){var p=c.pendingLanes&~I;c.pendingLanes=I,c.suspendedLanes=0,c.pingedLanes=0,c.expiredLanes&=I,c.mutableReadLanes&=I,c.entangledLanes&=I,I=c.entanglements;var G=c.eventTimes;for(c=c.expirationTimes;0>=E,w-=E,Qr=1<<32-qs(I)+w|p<Dt?(ii=ft,ft=null):ii=ft.sibling;var Ut=It(ue,ft,pe[Dt],De);if(Ut===null){ft===null&&(ft=ii);break}c&&ft&&Ut.alternate===null&&I(ue,ft),ee=W(Ut,ee,Dt),Bt===null?$e=Ut:Bt.sibling=Ut,Bt=Ut,ft=ii}if(Dt===pe.length)return p(ue,ft),dn&&Na(ue,Dt),$e;if(ft===null){for(;DtDt?(ii=ft,ft=null):ii=ft.sibling;var To=It(ue,ft,Ut.value,De);if(To===null){ft===null&&(ft=ii);break}c&&ft&&To.alternate===null&&I(ue,ft),ee=W(To,ee,Dt),Bt===null?$e=To:Bt.sibling=To,Bt=To,ft=ii}if(Ut.done)return p(ue,ft),dn&&Na(ue,Dt),$e;if(ft===null){for(;!Ut.done;Dt++,Ut=pe.next())Ut=pt(ue,Ut.value,De),Ut!==null&&(ee=W(Ut,ee,Dt),Bt===null?$e=Ut:Bt.sibling=Ut,Bt=Ut);return dn&&Na(ue,Dt),$e}for(ft=G(ue,ft);!Ut.done;Dt++,Ut=pe.next())Ut=on(ft,ue,Dt,Ut.value,De),Ut!==null&&(c&&Ut.alternate!==null&&ft.delete(Ut.key===null?Dt:Ut.key),ee=W(Ut,ee,Dt),Bt===null?$e=Ut:Bt.sibling=Ut,Bt=Ut);return c&&ft.forEach(function(Y5){return I(ue,Y5)}),dn&&Na(ue,Dt),$e}function Hs(ue,ee,pe,De){if(typeof pe=="object"&&pe!==null&&pe.type===u&&pe.key===null&&(pe=pe.props.children),typeof pe=="object"&&pe!==null){switch(pe.$$typeof){case l:e:{for(var $e=pe.key,Bt=ee;Bt!==null;){if(Bt.key===$e){if($e=pe.type,$e===u){if(Bt.tag===7){p(ue,Bt.sibling),ee=w(Bt,pe.props.children),ee.return=ue,ue=ee;break e}}else if(Bt.elementType===$e||typeof $e=="object"&&$e!==null&&$e.$$typeof===m&&IG($e)===Bt.type){p(ue,Bt.sibling),ee=w(Bt,pe.props),ee.ref=kc(ue,Bt,pe),ee.return=ue,ue=ee;break e}p(ue,Bt);break}else I(ue,Bt);Bt=Bt.sibling}pe.type===u?(ee=La(pe.props.children,ue.mode,De,pe.key),ee.return=ue,ue=ee):(De=Cd(pe.type,pe.key,pe.props,null,ue.mode,De),De.ref=kc(ue,ee,pe),De.return=ue,ue=De)}return E(ue);case g:e:{for(Bt=pe.key;ee!==null;){if(ee.key===Bt)if(ee.tag===4&&ee.stateNode.containerInfo===pe.containerInfo&&ee.stateNode.implementation===pe.implementation){p(ue,ee.sibling),ee=w(ee,pe.children||[]),ee.return=ue,ue=ee;break e}else{p(ue,ee);break}else I(ue,ee);ee=ee.sibling}ee=Zf(pe,ue.mode,De),ee.return=ue,ue=ee}return E(ue);case m:return Bt=pe._init,Hs(ue,ee,Bt(pe._payload),De)}if(ie(pe))return it(ue,ee,pe,De);if(x(pe))return yi(ue,ee,pe,De);FC(ue,pe)}return typeof pe=="string"&&pe!==""||typeof pe=="number"?(pe=""+pe,ee!==null&&ee.tag===6?(p(ue,ee.sibling),ee=w(ee,pe),ee.return=ue,ue=ee):(p(ue,ee),ee=Bf(pe,ue.mode,De),ee.return=ue,ue=ee),E(ue)):p(ue,ee)}return Hs}var Jl=uG(!0),CG=uG(!1),Dc={},Ws=ki(Dc),Uc=ki(Dc),Ol=ki(Dc);function wr(c){if(c===Dc)throw Error(o(174));return c}function Ep(c,I){bt(Ol,I),bt(Uc,c),bt(Ws,Dc),c=Ce(I),en(Ws),bt(Ws,c)}function Ql(){en(Ws),en(Uc),en(Ol)}function dG(c){var I=wr(Ol.current),p=wr(Ws.current);I=z(p,c.type,I),p!==I&&(bt(Uc,c),bt(Ws,I))}function Tp(c){Uc.current===c&&(en(Ws),en(Uc))}var pn=ki(0);function YC(c){for(var I=c;I!==null;){if(I.tag===13){var p=I.memoizedState;if(p!==null&&(p=p.dehydrated,p===null||Pr(p)||$t(p)))return I}else if(I.tag===19&&I.memoizedProps.revealOrder!==void 0){if(I.flags&128)return I}else if(I.child!==null){I.child.return=I,I=I.child;continue}if(I===c)break;for(;I.sibling===null;){if(I.return===null||I.return===c)return null;I=I.return}I.sibling.return=I.return,I=I.sibling}return null}var kp=[];function Dp(){for(var c=0;cp?p:4,c(!0);var G=Vs.transition;Vs.transition={};try{c(!1),I()}finally{kt=p,Vs.transition=G}}function xG(){return Sr().memoizedState}function c5(c,I,p){var G=zo(c);p={lane:G,action:p,hasEagerState:!1,eagerState:null,next:null},RG(c)?WG(I,p):(VG(c,I,p),p=Mi(),c=Ms(c,G,p),c!==null&&MG(c,I,G))}function I5(c,I,p){var G=zo(c),w={lane:G,action:p,hasEagerState:!1,eagerState:null,next:null};if(RG(c))WG(I,w);else{VG(c,I,w);var W=c.alternate;if(c.lanes===0&&(W===null||W.lanes===0)&&(W=I.lastRenderedReducer,W!==null))try{var E=I.lastRenderedState,j=W(E,p);if(w.hasEagerState=!0,w.eagerState=j,Gr(j,E))return}catch{}finally{}p=Mi(),c=Ms(c,G,p),c!==null&&MG(c,I,G)}}function RG(c){var I=c.alternate;return c===Bn||I!==null&&I===Bn}function WG(c,I){Pc=zC=!0;var p=c.pending;p===null?I.next=I:(I.next=p.next,p.next=I),c.pending=I}function VG(c,I,p){Yn!==null&&c.mode&1&&!(xt&2)?(c=I.interleaved,c===null?(p.next=p,Zr===null?Zr=[I]:Zr.push(I)):(p.next=c.next,c.next=p),I.interleaved=p):(c=I.pending,c===null?p.next=p:(p.next=c.next,c.next=p),I.pending=p)}function MG(c,I,p){if(p&4194240){var G=I.lanes;G&=c.pendingLanes,p|=G,I.lanes=p,Bp(c,p)}}var DC={readContext:Ss,useCallback:bi,useContext:bi,useEffect:bi,useImperativeHandle:bi,useInsertionEffect:bi,useLayoutEffect:bi,useMemo:bi,useReducer:bi,useRef:bi,useState:bi,useDebugValue:bi,useDeferredValue:bi,useTransition:bi,useMutableSource:bi,useSyncExternalStore:bi,useId:bi,unstable_isNewReconciler:!1},u5={readContext:Ss,useCallback:function(c,I){return qr().memoizedState=[c,I===void 0?null:I],c},useContext:Ss,useEffect:Op,useImperativeHandle:function(c,I,p){return p=p!=null?p.concat([c]):null,TC(4194308,4,BG.bind(null,I,c),p)},useLayoutEffect:function(c,I){return TC(4194308,4,c,I)},useInsertionEffect:function(c,I){return TC(4,2,c,I)},useMemo:function(c,I){var p=qr();return I=I===void 0?null:I,c=c(),p.memoizedState=[c,I],c},useReducer:function(c,I,p){var G=qr();return I=p!==void 0?p(I):I,G.memoizedState=G.baseState=I,c={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:c,lastRenderedState:I},G.queue=c,c=c.dispatch=c5.bind(null,Bn,c),[G.memoizedState,c]},useRef:function(c){var I=qr();return c={current:c},I.memoizedState=c},useState:Jp,useDebugValue:Qp,useDeferredValue:function(c){var I=Jp(c),p=I[0],G=I[1];return Op(function(){var w=Vs.transition;Vs.transition={};try{G(c)}finally{Vs.transition=w}},[c]),p},useTransition:function(){var c=Jp(!1),I=c[0];return c=g5.bind(null,c[1]),qr().memoizedState=c,[I,c]},useMutableSource:function(){},useSyncExternalStore:function(c,I,p){var G=Bn,w=qr();if(dn){if(p===void 0)throw Error(o(407));p=p()}else{if(p=I(),Yn===null)throw Error(o(349));jl&30||pG(G,I,p)}w.memoizedState=p;var W={value:p,getSnapshot:I};return w.queue=W,Op(mG.bind(null,G,W,c),[c]),G.flags|=2048,Jc(9,fG.bind(null,G,W,p,I),void 0,null),p},useId:function(){var c=qr(),I=Yn.identifierPrefix;if(dn){var p=jr,G=Qr;p=(G&~(1<<32-qs(G)-1)).toString(32)+p,I=":"+I+"R"+p,p=_c++,0Af&&(I.flags|=128,G=!0,jc(w,!1),I.lanes=4194304)}else{if(!G)if(c=YC(W),c!==null){if(I.flags|=128,G=!0,c=c.updateQueue,c!==null&&(I.updateQueue=c,I.flags|=4),jc(w,!0),w.tail===null&&w.tailMode==="hidden"&&!W.alternate&&!dn)return vi(I),null}else 2*ti()-w.renderingStartTime>Af&&p!==1073741824&&(I.flags|=128,G=!0,jc(w,!1),I.lanes=4194304);w.isBackwards?(W.sibling=I.child,I.child=W):(c=w.last,c!==null?c.sibling=W:I.child=W,w.last=W)}return w.tail!==null?(I=w.tail,w.rendering=I,w.tail=I.sibling,w.renderingStartTime=ti(),I.sibling=null,c=pn.current,bt(pn,G?c&1|2:c&1),I):(vi(I),null);case 22:case 23:return vf(),G=I.memoizedState!==null,c!==null&&c.memoizedState!==null!==G&&(I.flags|=8192),G&&I.mode&1?us&1073741824&&(vi(I),Ue&&I.subtreeFlags&6&&(I.flags|=8192)):vi(I),null;case 24:return null;case 25:return null}throw Error(o(156,I.tag))}var p5=a.ReactCurrentOwner,Is=!1;function Vi(c,I,p,G){I.child=c===null?CG(I,null,p,G):Jl(I,c.child,p,G)}function LG(c,I,p,G,w){p=p.render;var W=I.ref;return Dl(I,w),G=Pp(c,I,p,G,W,w),p=_p(),c!==null&&!Is?(I.updateQueue=c.updateQueue,I.flags&=-2053,c.lanes&=~w,$r(c,I,w)):(dn&&p&&Fp(I),I.flags|=1,Vi(c,I,G,w),I.child)}function EG(c,I,p,G,w){if(c===null){var W=p.type;return typeof W=="function"&&!Gf(W)&&W.defaultProps===void 0&&p.compare===null&&p.defaultProps===void 0?(I.tag=15,I.type=W,TG(c,I,W,G,w)):(c=Cd(p.type,null,G,I,I.mode,w),c.ref=I.ref,c.return=I,I.child=c)}if(W=c.child,!(c.lanes&w)){var L=W.memoizedProps;if(p=p.compare,p=p!==null?p:xC,p(L,G)&&c.ref===I.ref)return $r(c,I,w)}return I.flags|=1,c=Eo(W,G),c.ref=I.ref,c.return=I,I.child=c}function TG(c,I,p,G,w){if(c!==null&&xC(c.memoizedProps,G)&&c.ref===I.ref)if(Is=!1,(c.lanes&w)!==0)c.flags&131072&&(Is=!0);else return I.lanes=c.lanes,$r(c,I,w);return $p(c,I,p,G,w)}function kG(c,I,p){var G=I.pendingProps,w=G.children,W=c!==null?c.memoizedState:null;if(G.mode==="hidden")if(!(I.mode&1))I.memoizedState={baseLanes:0,cachePool:null},bt(ql,us),us|=p;else if(p&1073741824)I.memoizedState={baseLanes:0,cachePool:null},G=W!==null?W.baseLanes:p,bt(ql,us),us|=G;else return c=W!==null?W.baseLanes|p:p,I.lanes=I.childLanes=1073741824,I.memoizedState={baseLanes:c,cachePool:null},I.updateQueue=null,bt(ql,us),us|=c,null;else W!==null?(G=W.baseLanes|p,I.memoizedState=null):G=p,bt(ql,us),us|=G;return Vi(c,I,w,p),I.child}function DG(c,I){var p=I.ref;(c===null&&p!==null||c!==null&&c.ref!==p)&&(I.flags|=512,I.flags|=2097152)}function $p(c,I,p,G,w){var W=li(p)?js:Fn.current;return W=Ho(I,W),Dl(I,w),p=Pp(c,I,p,G,W,w),G=_p(),c!==null&&!Is?(I.updateQueue=c.updateQueue,I.flags&=-2053,c.lanes&=~w,$r(c,I,w)):(dn&&G&&Fp(I),I.flags|=1,Vi(c,I,p,w),I.child)}function UG(c,I,p,G,w){if(li(p)){var W=!0;yC(I)}else W=!1;if(Dl(I,w),I.stateNode===null)c!==null&&(c.alternate=null,I.alternate=null,I.flags|=2),rG(I,p,G),Xp(I,p,G,w),G=!0;else if(c===null){var L=I.stateNode,j=I.memoizedProps;L.props=j;var me=L.context,He=p.contextType;typeof He=="object"&&He!==null?He=Ss(He):(He=li(p)?js:Fn.current,He=Ho(I,He));var Qe=p.getDerivedStateFromProps,pt=typeof Qe=="function"||typeof L.getSnapshotBeforeUpdate=="function";pt||typeof L.UNSAFE_componentWillReceiveProps!="function"&&typeof L.componentWillReceiveProps!="function"||(j!==G||me!==He)&&oG(I,L,G,He),Xo=!1;var It=I.memoizedState;L.state=It,MC(I,G,L,w),me=I.memoizedState,j!==G||It!==me||nn.current||Xo?(typeof Qe=="function"&&(Hp(I,p,Qe,G),me=I.memoizedState),(j=Xo||sG(I,p,j,G,It,me,He))?(pt||typeof L.UNSAFE_componentWillMount!="function"&&typeof L.componentWillMount!="function"||(typeof L.componentWillMount=="function"&&L.componentWillMount(),typeof L.UNSAFE_componentWillMount=="function"&&L.UNSAFE_componentWillMount()),typeof L.componentDidMount=="function"&&(I.flags|=4194308)):(typeof L.componentDidMount=="function"&&(I.flags|=4194308),I.memoizedProps=G,I.memoizedState=me),L.props=G,L.state=me,L.context=He,G=j):(typeof L.componentDidMount=="function"&&(I.flags|=4194308),G=!1)}else{L=I.stateNode,eG(c,I),j=I.memoizedProps,He=I.type===I.elementType?j:$s(I.type,j),L.props=He,pt=I.pendingProps,It=L.context,me=p.contextType,typeof me=="object"&&me!==null?me=Ss(me):(me=li(p)?js:Fn.current,me=Ho(I,me));var on=p.getDerivedStateFromProps;(Qe=typeof on=="function"||typeof L.getSnapshotBeforeUpdate=="function")||typeof L.UNSAFE_componentWillReceiveProps!="function"&&typeof L.componentWillReceiveProps!="function"||(j!==pt||It!==me)&&oG(I,L,G,me),Xo=!1,It=I.memoizedState,L.state=It,MC(I,G,L,w);var it=I.memoizedState;j!==pt||It!==it||nn.current||Xo?(typeof on=="function"&&(Hp(I,p,on,G),it=I.memoizedState),(He=Xo||sG(I,p,He,G,It,it,me)||!1)?(Qe||typeof L.UNSAFE_componentWillUpdate!="function"&&typeof L.componentWillUpdate!="function"||(typeof L.componentWillUpdate=="function"&&L.componentWillUpdate(G,it,me),typeof L.UNSAFE_componentWillUpdate=="function"&&L.UNSAFE_componentWillUpdate(G,it,me)),typeof L.componentDidUpdate=="function"&&(I.flags|=4),typeof L.getSnapshotBeforeUpdate=="function"&&(I.flags|=1024)):(typeof L.componentDidUpdate!="function"||j===c.memoizedProps&&It===c.memoizedState||(I.flags|=4),typeof L.getSnapshotBeforeUpdate!="function"||j===c.memoizedProps&&It===c.memoizedState||(I.flags|=1024),I.memoizedProps=G,I.memoizedState=it),L.props=G,L.state=it,L.context=me,G=He):(typeof L.componentDidUpdate!="function"||j===c.memoizedProps&&It===c.memoizedState||(I.flags|=4),typeof L.getSnapshotBeforeUpdate!="function"||j===c.memoizedProps&&It===c.memoizedState||(I.flags|=1024),G=!1)}return ef(c,I,p,G,W,w)}function ef(c,I,p,G,w,W){DG(c,I);var L=(I.flags&128)!==0;if(!G&&!L)return w&&Oy(I,p,!1),$r(c,I,W);G=I.stateNode,p5.current=I;var j=L&&typeof p.getDerivedStateFromError!="function"?null:G.render();return I.flags|=1,c!==null&&L?(I.child=Jl(I,c.child,null,W),I.child=Jl(I,null,j,W)):Vi(c,I,j,W),I.memoizedState=G.state,w&&Oy(I,p,!0),I.child}function PG(c){var I=c.stateNode;I.pendingContext?_y(c,I.pendingContext,I.pendingContext!==I.context):I.context&&_y(c,I.context,!1),Ep(c,I.containerInfo)}function _G(c,I,p,G,w){return _l(),Lp(w),I.flags|=256,Vi(c,I,p,G),I.child}var _C={dehydrated:null,treeContext:null,retryLane:0};function JC(c){return{baseLanes:c,cachePool:null}}function JG(c,I,p){var G=I.pendingProps,w=pn.current,W=!1,L=(I.flags&128)!==0,j;if((j=L)||(j=c!==null&&c.memoizedState===null?!1:(w&2)!==0),j?(W=!0,I.flags&=-129):(c===null||c.memoizedState!==null)&&(w|=1),bt(pn,w&1),c===null)return zp(I),c=I.memoizedState,c!==null&&(c=c.dehydrated,c!==null)?(I.mode&1?$t(c)?I.lanes=8:I.lanes=1073741824:I.lanes=1,null):(w=G.children,c=G.fallback,W?(G=I.mode,W=I.child,w={mode:"hidden",children:w},!(G&1)&&W!==null?(W.childLanes=0,W.pendingProps=w):W=dd(w,G,0,null),c=La(c,G,p,null),W.return=I,c.return=I,W.sibling=c,I.child=W,I.child.memoizedState=JC(p),I.memoizedState=_C,c):tf(I,w));if(w=c.memoizedState,w!==null){if(j=w.dehydrated,j!==null){if(L)return I.flags&256?(I.flags&=-257,OC(c,I,p,Error(o(422)))):I.memoizedState!==null?(I.child=c.child,I.flags|=128,null):(W=G.fallback,w=I.mode,G=dd({mode:"visible",children:G.children},w,0,null),W=La(W,w,p,null),W.flags|=2,G.return=I,W.return=I,G.sibling=W,I.child=G,I.mode&1&&Jl(I,c.child,null,p),I.child.memoizedState=JC(p),I.memoizedState=_C,W);if(!(I.mode&1))I=OC(c,I,p,null);else if($t(j))I=OC(c,I,p,Error(o(419)));else if(G=(p&c.childLanes)!==0,Is||G){if(G=Yn,G!==null){switch(p&-p){case 4:W=2;break;case 16:W=8;break;case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:W=32;break;case 536870912:W=268435456;break;default:W=0}G=W&(G.suspendedLanes|p)?0:W,G!==0&&G!==w.retryLane&&(w.retryLane=G,Ms(c,G,-1))}yf(),I=OC(c,I,p,Error(o(421)))}else Pr(j)?(I.flags|=128,I.child=c.child,I=W5.bind(null,c),pi(j,I),I=null):(p=w.treeContext,fe&&(cs=re(j),gs=I,dn=!0,er=null,Lc=!1,p!==null&&(xs[Rs++]=Qr,xs[Rs++]=jr,xs[Rs++]=Ma,Qr=p.id,jr=p.overflow,Ma=I)),I=tf(I,I.pendingProps.children),I.flags|=4096);return I}return W?(G=QG(c,I,G.children,G.fallback,p),W=I.child,w=c.child.memoizedState,W.memoizedState=w===null?JC(p):{baseLanes:w.baseLanes|p,cachePool:null},W.childLanes=c.childLanes&~p,I.memoizedState=_C,G):(p=OG(c,I,G.children,p),I.memoizedState=null,p)}return W?(G=QG(c,I,G.children,G.fallback,p),W=I.child,w=c.child.memoizedState,W.memoizedState=w===null?JC(p):{baseLanes:w.baseLanes|p,cachePool:null},W.childLanes=c.childLanes&~p,I.memoizedState=_C,G):(p=OG(c,I,G.children,p),I.memoizedState=null,p)}function tf(c,I){return I=dd({mode:"visible",children:I},c.mode,0,null),I.return=c,c.child=I}function OG(c,I,p,G){var w=c.child;return c=w.sibling,p=Eo(w,{mode:"visible",children:p}),!(I.mode&1)&&(p.lanes=G),p.return=I,p.sibling=null,c!==null&&(G=I.deletions,G===null?(I.deletions=[c],I.flags|=16):G.push(c)),I.child=p}function QG(c,I,p,G,w){var W=I.mode;c=c.child;var L=c.sibling,j={mode:"hidden",children:p};return!(W&1)&&I.child!==c?(p=I.child,p.childLanes=0,p.pendingProps=j,I.deletions=null):(p=Eo(c,j),p.subtreeFlags=c.subtreeFlags&14680064),L!==null?G=Eo(L,G):(G=La(G,W,w,null),G.flags|=2),G.return=I,p.return=I,p.sibling=G,I.child=p,G}function OC(c,I,p,G){return G!==null&&Lp(G),Jl(I,c.child,null,p),c=tf(I,I.pendingProps.children),c.flags|=2,I.memoizedState=null,c}function jG(c,I,p){c.lanes|=I;var G=c.alternate;G!==null&&(G.lanes|=I),Mp(c.return,I,p)}function nf(c,I,p,G,w){var W=c.memoizedState;W===null?c.memoizedState={isBackwards:I,rendering:null,renderingStartTime:0,last:G,tail:p,tailMode:w}:(W.isBackwards=I,W.rendering=null,W.renderingStartTime=0,W.last=G,W.tail=p,W.tailMode=w)}function qG(c,I,p){var G=I.pendingProps,w=G.revealOrder,W=G.tail;if(Vi(c,I,G.children,p),G=pn.current,G&2)G=G&1|2,I.flags|=128;else{if(c!==null&&c.flags&128)e:for(c=I.child;c!==null;){if(c.tag===13)c.memoizedState!==null&&jG(c,p,I);else if(c.tag===19)jG(c,p,I);else if(c.child!==null){c.child.return=c,c=c.child;continue}if(c===I)break e;for(;c.sibling===null;){if(c.return===null||c.return===I)break e;c=c.return}c.sibling.return=c.return,c=c.sibling}G&=1}if(bt(pn,G),!(I.mode&1))I.memoizedState=null;else switch(w){case"forwards":for(p=I.child,w=null;p!==null;)c=p.alternate,c!==null&&YC(c)===null&&(w=p),p=p.sibling;p=w,p===null?(w=I.child,I.child=null):(w=p.sibling,p.sibling=null),nf(I,!1,w,p,W);break;case"backwards":for(p=null,w=I.child,I.child=null;w!==null;){if(c=w.alternate,c!==null&&YC(c)===null){I.child=w;break}c=w.sibling,w.sibling=p,p=w,w=c}nf(I,!0,p,null,W);break;case"together":nf(I,!1,null,null,void 0);break;default:I.memoizedState=null}return I.child}function $r(c,I,p){if(c!==null&&(I.dependencies=c.dependencies),$l|=I.lanes,!(p&I.childLanes))return null;if(c!==null&&I.child!==c.child)throw Error(o(153));if(I.child!==null){for(c=I.child,p=Eo(c,c.pendingProps),I.child=p,p.return=I;c.sibling!==null;)c=c.sibling,p=p.sibling=Eo(c,c.pendingProps),p.return=I;p.sibling=null}return I.child}function f5(c,I,p){switch(I.tag){case 3:PG(I),_l();break;case 5:dG(I);break;case 1:li(I.type)&&yC(I);break;case 4:Ep(I,I.stateNode.containerInfo);break;case 10:$y(I,I.type._context,I.memoizedProps.value);break;case 13:var G=I.memoizedState;if(G!==null)return G.dehydrated!==null?(bt(pn,pn.current&1),I.flags|=128,null):p&I.child.childLanes?JG(c,I,p):(bt(pn,pn.current&1),c=$r(c,I,p),c!==null?c.sibling:null);bt(pn,pn.current&1);break;case 19:if(G=(p&I.childLanes)!==0,c.flags&128){if(G)return qG(c,I,p);I.flags|=128}var w=I.memoizedState;if(w!==null&&(w.rendering=null,w.tail=null,w.lastEffect=null),bt(pn,pn.current),G)break;return null;case 22:case 23:return I.lanes=0,kG(c,I,p)}return $r(c,I,p)}function m5(c,I){switch(Yp(I),I.tag){case 1:return li(I.type)&&vC(),c=I.flags,c&65536?(I.flags=c&-65537|128,I):null;case 3:return Ql(),en(nn),en(Fn),Dp(),c=I.flags,c&65536&&!(c&128)?(I.flags=c&-65537|128,I):null;case 5:return Tp(I),null;case 13:if(en(pn),c=I.memoizedState,c!==null&&c.dehydrated!==null){if(I.alternate===null)throw Error(o(340));_l()}return c=I.flags,c&65536?(I.flags=c&-65537|128,I):null;case 19:return en(pn),null;case 4:return Ql(),null;case 10:return Vp(I.type._context),null;case 22:case 23:return vf(),null;case 24:return null;default:return null}}var QC=!1,Xa=!1,b5=typeof WeakSet=="function"?WeakSet:Set,ke=null;function jC(c,I){var p=c.ref;if(p!==null)if(typeof p=="function")try{p(null)}catch(G){Pi(c,I,G)}else p.current=null}function sf(c,I,p){try{p()}catch(G){Pi(c,I,G)}}var $G=!1;function v5(c,I){for(Q(c.containerInfo),ke=I;ke!==null;)if(c=ke,I=c.child,(c.subtreeFlags&1028)!==0&&I!==null)I.return=c,ke=I;else for(;ke!==null;){c=ke;try{var p=c.alternate;if(c.flags&1024)switch(c.tag){case 0:case 11:case 15:break;case 1:if(p!==null){var G=p.memoizedProps,w=p.memoizedState,W=c.stateNode,L=W.getSnapshotBeforeUpdate(c.elementType===c.type?G:$s(c.type,G),w);W.__reactInternalSnapshotBeforeUpdate=L}break;case 3:Ue&&Ne(c.stateNode.containerInfo);break;case 5:case 6:case 4:case 17:break;default:throw Error(o(163))}}catch(j){Pi(c,c.return,j)}if(I=c.sibling,I!==null){I.return=c.return,ke=I;break}ke=c.return}return p=$G,$G=!1,p}function Fa(c,I,p){var G=I.updateQueue;if(G=G!==null?G.lastEffect:null,G!==null){var w=G=G.next;do{if((w.tag&c)===c){var W=w.destroy;w.destroy=void 0,W!==void 0&&sf(I,p,W)}w=w.next}while(w!==G)}}function qc(c,I){if(I=I.updateQueue,I=I!==null?I.lastEffect:null,I!==null){var p=I=I.next;do{if((p.tag&c)===c){var G=p.create;p.destroy=G()}p=p.next}while(p!==I)}}function rf(c){var I=c.ref;if(I!==null){var p=c.stateNode;switch(c.tag){case 5:c=he(p);break;default:c=p}typeof I=="function"?I(c):I.current=c}}function eB(c,I,p){if(yr&&typeof yr.onCommitFiberUnmount=="function")try{yr.onCommitFiberUnmount(wC,I)}catch{}switch(I.tag){case 0:case 11:case 14:case 15:if(c=I.updateQueue,c!==null&&(c=c.lastEffect,c!==null)){var G=c=c.next;do{var w=G,W=w.destroy;w=w.tag,W!==void 0&&(w&2||w&4)&&sf(I,p,W),G=G.next}while(G!==c)}break;case 1:if(jC(I,p),c=I.stateNode,typeof c.componentWillUnmount=="function")try{c.props=I.memoizedProps,c.state=I.memoizedState,c.componentWillUnmount()}catch(L){Pi(I,p,L)}break;case 5:jC(I,p);break;case 4:Ue?oB(c,I,p):Be&&Be&&(I=I.stateNode.containerInfo,p=At(I),hi(I,p))}}function tB(c,I,p){for(var G=I;;)if(eB(c,G,p),G.child===null||Ue&&G.tag===4){if(G===I)break;for(;G.sibling===null;){if(G.return===null||G.return===I)return;G=G.return}G.sibling.return=G.return,G=G.sibling}else G.child.return=G,G=G.child}function nB(c){var I=c.alternate;I!==null&&(c.alternate=null,nB(I)),c.child=null,c.deletions=null,c.sibling=null,c.tag===5&&(I=c.stateNode,I!==null&&qe(I)),c.stateNode=null,c.return=null,c.dependencies=null,c.memoizedProps=null,c.memoizedState=null,c.pendingProps=null,c.stateNode=null,c.updateQueue=null}function iB(c){return c.tag===5||c.tag===3||c.tag===4}function sB(c){e:for(;;){for(;c.sibling===null;){if(c.return===null||iB(c.return))return null;c=c.return}for(c.sibling.return=c.return,c=c.sibling;c.tag!==5&&c.tag!==6&&c.tag!==18;){if(c.flags&2||c.child===null||c.tag===4)continue e;c.child.return=c,c=c.child}if(!(c.flags&2))return c.stateNode}}function rB(c){if(Ue){e:{for(var I=c.return;I!==null;){if(iB(I))break e;I=I.return}throw Error(o(160))}var p=I;switch(p.tag){case 5:I=p.stateNode,p.flags&32&&(Ye(I),p.flags&=-33),p=sB(c),af(c,p,I);break;case 3:case 4:I=p.stateNode.containerInfo,p=sB(c),of(c,p,I);break;default:throw Error(o(161))}}}function of(c,I,p){var G=c.tag;if(G===5||G===6)c=c.stateNode,I?be(p,c,I):Je(p,c);else if(G!==4&&(c=c.child,c!==null))for(of(c,I,p),c=c.sibling;c!==null;)of(c,I,p),c=c.sibling}function af(c,I,p){var G=c.tag;if(G===5||G===6)c=c.stateNode,I?ye(p,c,I):lt(p,c);else if(G!==4&&(c=c.child,c!==null))for(af(c,I,p),c=c.sibling;c!==null;)af(c,I,p),c=c.sibling}function oB(c,I,p){for(var G=I,w=!1,W,L;;){if(!w){w=G.return;e:for(;;){if(w===null)throw Error(o(160));switch(W=w.stateNode,w.tag){case 5:L=!1;break e;case 3:W=W.containerInfo,L=!0;break e;case 4:W=W.containerInfo,L=!0;break e}w=w.return}w=!0}if(G.tag===5||G.tag===6)tB(c,G,p),L?ze(W,G.stateNode):Se(W,G.stateNode);else if(G.tag===18)L?Wt(W,G.stateNode):St(W,G.stateNode);else if(G.tag===4){if(G.child!==null){W=G.stateNode.containerInfo,L=!0,G.child.return=G,G=G.child;continue}}else if(eB(c,G,p),G.child!==null){G.child.return=G,G=G.child;continue}if(G===I)break;for(;G.sibling===null;){if(G.return===null||G.return===I)return;G=G.return,G.tag===4&&(w=!1)}G.sibling.return=G.return,G=G.sibling}}function lf(c,I){if(Ue){switch(I.tag){case 0:case 11:case 14:case 15:Fa(3,I,I.return),qc(3,I),Fa(5,I,I.return);return;case 1:return;case 5:var p=I.stateNode;if(p!=null){var G=I.memoizedProps;c=c!==null?c.memoizedProps:G;var w=I.type,W=I.updateQueue;I.updateQueue=null,W!==null&&Ie(p,W,w,c,G,I)}return;case 6:if(I.stateNode===null)throw Error(o(162));p=I.memoizedProps,D(I.stateNode,c!==null?c.memoizedProps:p,p);return;case 3:fe&&c!==null&&c.memoizedState.isDehydrated&&mt(I.stateNode.containerInfo);return;case 12:return;case 13:qC(I);return;case 19:qC(I);return;case 17:return}throw Error(o(163))}switch(I.tag){case 0:case 11:case 14:case 15:Fa(3,I,I.return),qc(3,I),Fa(5,I,I.return);return;case 12:return;case 13:qC(I);return;case 19:qC(I);return;case 3:fe&&c!==null&&c.memoizedState.isDehydrated&&mt(I.stateNode.containerInfo);break;case 22:case 23:return}e:if(Be){switch(I.tag){case 1:case 5:case 6:break e;case 3:case 4:I=I.stateNode,hi(I.containerInfo,I.pendingChildren);break e}throw Error(o(163))}}function qC(c){var I=c.updateQueue;if(I!==null){c.updateQueue=null;var p=c.stateNode;p===null&&(p=c.stateNode=new b5),I.forEach(function(G){var w=V5.bind(null,c,G);p.has(G)||(p.add(G),G.then(w,w))})}}function y5(c,I){for(ke=I;ke!==null;){I=ke;var p=I.deletions;if(p!==null)for(var G=0;G";case ed:return":has("+(If(c)||"")+")";case td:return'[role="'+c.value+'"]';case id:return'"'+c.value+'"';case nd:return'[data-testname="'+c.value+'"]';default:throw Error(o(365))}}function IB(c,I){var p=[];c=[c,0];for(var G=0;Gw&&(w=L),G&=~W}if(G=w,G=ti()-G,G=(120>G?120:480>G?480:1080>G?1080:1920>G?1920:3e3>G?3e3:4320>G?4320:1960*B5(G/1960))-G,10c?16:c,Ko===null)var G=!1;else{if(c=Ko,Ko=null,ld=0,xt&6)throw Error(o(331));var w=xt;for(xt|=4,ke=c.current;ke!==null;){var W=ke,L=W.child;if(ke.flags&16){var j=W.deletions;if(j!==null){for(var me=0;meti()-hf?Ya(c,0):df|=p),Ui(c,I)}function bB(c,I){I===0&&(c.mode&1?(I=BC,BC<<=1,!(BC&130023424)&&(BC=4194304)):I=1);var p=Mi();c=Id(c,I),c!==null&&(zc(c,I,p),Ui(c,p))}function W5(c){var I=c.memoizedState,p=0;I!==null&&(p=I.retryLane),bB(c,p)}function V5(c,I){var p=0;switch(c.tag){case 13:var G=c.stateNode,w=c.memoizedState;w!==null&&(p=w.retryLane);break;case 19:G=c.stateNode;break;default:throw Error(o(314))}G!==null&&G.delete(I),bB(c,p)}var vB;vB=function(c,I,p){if(c!==null)if(c.memoizedProps!==I.pendingProps||nn.current)Is=!0;else{if(!(c.lanes&p)&&!(I.flags&128))return Is=!1,f5(c,I,p);Is=!!(c.flags&131072)}else Is=!1,dn&&I.flags&1048576&&aG(I,XC,I.index);switch(I.lanes=0,I.tag){case 2:var G=I.type;c!==null&&(c.alternate=null,I.alternate=null,I.flags|=2),c=I.pendingProps;var w=Ho(I,Fn.current);Dl(I,p),w=Pp(null,I,G,c,w,p);var W=_p();return I.flags|=1,typeof w=="object"&&w!==null&&typeof w.render=="function"&&w.$$typeof===void 0?(I.tag=1,I.memoizedState=null,I.updateQueue=null,li(G)?(W=!0,yC(I)):W=!1,I.memoizedState=w.state!==null&&w.state!==void 0?w.state:null,Np(I),w.updater=NC,I.stateNode=w,w._reactInternals=I,Xp(I,G,c,p),I=ef(null,I,G,!0,W,p)):(I.tag=0,dn&&W&&Fp(I),Vi(null,I,w,p),I=I.child),I;case 16:G=I.elementType;e:{switch(c!==null&&(c.alternate=null,I.alternate=null,I.flags|=2),c=I.pendingProps,w=G._init,G=w(G._payload),I.type=G,w=I.tag=N5(G),c=$s(G,c),w){case 0:I=$p(null,I,G,c,p);break e;case 1:I=UG(null,I,G,c,p);break e;case 11:I=LG(null,I,G,c,p);break e;case 14:I=EG(null,I,G,$s(G.type,c),p);break e}throw Error(o(306,G,""))}return I;case 0:return G=I.type,w=I.pendingProps,w=I.elementType===G?w:$s(G,w),$p(c,I,G,w,p);case 1:return G=I.type,w=I.pendingProps,w=I.elementType===G?w:$s(G,w),UG(c,I,G,w,p);case 3:e:{if(PG(I),c===null)throw Error(o(387));G=I.pendingProps,W=I.memoizedState,w=W.element,eG(c,I),MC(I,G,null,p);var L=I.memoizedState;if(G=L.element,fe&&W.isDehydrated)if(W={element:G,isDehydrated:!1,cache:L.cache,transitions:L.transitions},I.updateQueue.baseState=W,I.memoizedState=W,I.flags&256){w=Error(o(423)),I=_G(c,I,G,p,w);break e}else if(G!==w){w=Error(o(424)),I=_G(c,I,G,p,w);break e}else for(fe&&(cs=Ae(I.stateNode.containerInfo),gs=I,dn=!0,er=null,Lc=!1),p=CG(I,null,G,p),I.child=p;p;)p.flags=p.flags&-3|4096,p=p.sibling;else{if(_l(),G===w){I=$r(c,I,p);break e}Vi(c,I,G,p)}I=I.child}return I;case 5:return dG(I),c===null&&zp(I),G=I.type,w=I.pendingProps,W=c!==null?c.memoizedProps:null,L=w.children,Ze(G,w)?L=null:W!==null&&Ze(G,W)&&(I.flags|=32),DG(c,I),Vi(c,I,L,p),I.child;case 6:return c===null&&zp(I),null;case 13:return JG(c,I,p);case 4:return Ep(I,I.stateNode.containerInfo),G=I.pendingProps,c===null?I.child=Jl(I,null,G,p):Vi(c,I,G,p),I.child;case 11:return G=I.type,w=I.pendingProps,w=I.elementType===G?w:$s(G,w),LG(c,I,G,w,p);case 7:return Vi(c,I,I.pendingProps,p),I.child;case 8:return Vi(c,I,I.pendingProps.children,p),I.child;case 12:return Vi(c,I,I.pendingProps.children,p),I.child;case 10:e:{if(G=I.type._context,w=I.pendingProps,W=I.memoizedProps,L=w.value,$y(I,G,L),W!==null)if(Gr(W.value,L)){if(W.children===w.children&&!nn.current){I=$r(c,I,p);break e}}else for(W=I.child,W!==null&&(W.return=I);W!==null;){var j=W.dependencies;if(j!==null){L=W.child;for(var me=j.firstContext;me!==null;){if(me.context===G){if(W.tag===1){me=Or(-1,p&-p),me.tag=2;var He=W.updateQueue;if(He!==null){He=He.shared;var Qe=He.pending;Qe===null?me.next=me:(me.next=Qe.next,Qe.next=me),He.pending=me}}W.lanes|=p,me=W.alternate,me!==null&&(me.lanes|=p),Mp(W.return,p,I),j.lanes|=p;break}me=me.next}}else if(W.tag===10)L=W.type===I.type?null:W.child;else if(W.tag===18){if(L=W.return,L===null)throw Error(o(341));L.lanes|=p,j=L.alternate,j!==null&&(j.lanes|=p),Mp(L,p,I),L=W.sibling}else L=W.child;if(L!==null)L.return=W;else for(L=W;L!==null;){if(L===I){L=null;break}if(W=L.sibling,W!==null){W.return=L.return,L=W;break}L=L.return}W=L}Vi(c,I,w.children,p),I=I.child}return I;case 9:return w=I.type,G=I.pendingProps.children,Dl(I,p),w=Ss(w),G=G(w),I.flags|=1,Vi(c,I,G,p),I.child;case 14:return G=I.type,w=$s(G,I.pendingProps),w=$s(G.type,w),EG(c,I,G,w,p);case 15:return TG(c,I,I.type,I.pendingProps,p);case 17:return G=I.type,w=I.pendingProps,w=I.elementType===G?w:$s(G,w),c!==null&&(c.alternate=null,I.alternate=null,I.flags|=2),I.tag=1,li(G)?(c=!0,yC(I)):c=!1,Dl(I,p),rG(I,G,w),Xp(I,G,w,p),ef(null,I,G,!0,c,p);case 19:return qG(c,I,p);case 22:return kG(c,I,p)}throw Error(o(156,I.tag))};function yB(c,I){return Zp(c,I)}function M5(c,I,p,G){this.tag=c,this.key=p,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.ref=null,this.pendingProps=I,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=G,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function Ns(c,I,p,G){return new M5(c,I,p,G)}function Gf(c){return c=c.prototype,!(!c||!c.isReactComponent)}function N5(c){if(typeof c=="function")return Gf(c)?1:0;if(c!=null){if(c=c.$$typeof,c===v)return 11;if(c===b)return 14}return 2}function Eo(c,I){var p=c.alternate;return p===null?(p=Ns(c.tag,I,c.key,c.mode),p.elementType=c.elementType,p.type=c.type,p.stateNode=c.stateNode,p.alternate=c,c.alternate=p):(p.pendingProps=I,p.type=c.type,p.flags=0,p.subtreeFlags=0,p.deletions=null),p.flags=c.flags&14680064,p.childLanes=c.childLanes,p.lanes=c.lanes,p.child=c.child,p.memoizedProps=c.memoizedProps,p.memoizedState=c.memoizedState,p.updateQueue=c.updateQueue,I=c.dependencies,p.dependencies=I===null?null:{lanes:I.lanes,firstContext:I.firstContext},p.sibling=c.sibling,p.index=c.index,p.ref=c.ref,p}function Cd(c,I,p,G,w,W){var L=2;if(G=c,typeof c=="function")Gf(c)&&(L=1);else if(typeof c=="string")L=5;else e:switch(c){case u:return La(p.children,w,W,I);case C:L=8,w|=8;break;case d:return c=Ns(12,p,I,w|2),c.elementType=d,c.lanes=W,c;case y:return c=Ns(13,p,I,w),c.elementType=y,c.lanes=W,c;case A:return c=Ns(19,p,I,w),c.elementType=A,c.lanes=W,c;case B:return dd(p,w,W,I);default:if(typeof c=="object"&&c!==null)switch(c.$$typeof){case h:L=10;break e;case f:L=9;break e;case v:L=11;break e;case b:L=14;break e;case m:L=16,G=null;break e}throw Error(o(130,c==null?c:typeof c,""))}return I=Ns(L,p,I,w),I.elementType=c,I.type=G,I.lanes=W,I}function La(c,I,p,G){return c=Ns(7,c,G,I),c.lanes=p,c}function dd(c,I,p,G){return c=Ns(22,c,G,I),c.elementType=B,c.lanes=p,c.stateNode={},c}function Bf(c,I,p){return c=Ns(6,c,null,I),c.lanes=p,c}function Zf(c,I,p){return I=Ns(4,c.children!==null?c.children:[],c.key,I),I.lanes=p,I.stateNode={containerInfo:c.containerInfo,pendingChildren:null,implementation:c.implementation},I}function H5(c,I,p,G,w){this.tag=I,this.containerInfo=c,this.finishedWork=this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=ct,this.callbackNode=this.pendingContext=this.context=null,this.callbackPriority=0,this.eventTimes=Gp(0),this.expirationTimes=Gp(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=Gp(0),this.identifierPrefix=G,this.onRecoverableError=w,fe&&(this.mutableSourceEagerHydrationData=null)}function GB(c,I,p,G,w,W,L,j,me){return c=new H5(c,I,p,j,me),I===1?(I=1,W===!0&&(I|=8)):I=0,W=Ns(3,null,null,I),c.current=W,W.stateNode=c,W.memoizedState={element:G,isDehydrated:p,cache:null,transitions:null},Np(W),c}function BB(c){if(!c)return fi;c=c._reactInternals;e:{if(Z(c)!==c||c.tag!==1)throw Error(o(170));var I=c;do{switch(I.tag){case 3:I=I.stateNode.context;break e;case 1:if(li(I.type)){I=I.stateNode.__reactInternalMemoizedMergedChildContext;break e}}I=I.return}while(I!==null);throw Error(o(171))}if(c.tag===1){var p=c.type;if(li(p))return Jy(c,p,I)}return I}function ZB(c){var I=c._reactInternals;if(I===void 0)throw typeof c.render=="function"?Error(o(188)):(c=Object.keys(c).join(","),Error(o(268,c)));return c=P(I),c===null?null:c.stateNode}function wB(c,I){if(c=c.memoizedState,c!==null&&c.dehydrated!==null){var p=c.retryLane;c.retryLane=p!==0&&p=He&&W>=pt&&w<=Qe&&L<=It){c.splice(I,1);break}else if(G!==He||p.width!==me.width||ItL){if(!(W!==pt||p.height!==me.height||Qew)){He>G&&(me.width+=He-G,me.x=G),QeW&&(me.height+=pt-W,me.y=W),Itp&&(p=L)),LAf&&(I.flags|=128,G=!0,qc(w,!1),I.lanes=4194304)}else{if(!G)if(c=YC(W),c!==null){if(I.flags|=128,G=!0,c=c.updateQueue,c!==null&&(I.updateQueue=c,I.flags|=4),qc(w,!0),w.tail===null&&w.tailMode==="hidden"&&!W.alternate&&!dn)return vi(I),null}else 2*ti()-w.renderingStartTime>Af&&p!==1073741824&&(I.flags|=128,G=!0,qc(w,!1),I.lanes=4194304);w.isBackwards?(W.sibling=I.child,I.child=W):(c=w.last,c!==null?c.sibling=W:I.child=W,w.last=W)}return w.tail!==null?(I=w.tail,w.rendering=I,w.tail=I.sibling,w.renderingStartTime=ti(),I.sibling=null,c=pn.current,bt(pn,G?c&1|2:c&1),I):(vi(I),null);case 22:case 23:return vf(),G=I.memoizedState!==null,c!==null&&c.memoizedState!==null!==G&&(I.flags|=8192),G&&I.mode&1?us&1073741824&&(vi(I),Ue&&I.subtreeFlags&6&&(I.flags|=8192)):vi(I),null;case 24:return null;case 25:return null}throw Error(o(156,I.tag))}var p5=a.ReactCurrentOwner,Is=!1;function Vi(c,I,p,G){I.child=c===null?CG(I,null,p,G):Jl(I,c.child,p,G)}function LG(c,I,p,G,w){p=p.render;var W=I.ref;return Dl(I,w),G=Pp(c,I,p,G,W,w),p=_p(),c!==null&&!Is?(I.updateQueue=c.updateQueue,I.flags&=-2053,c.lanes&=~w,$r(c,I,w)):(dn&&p&&Fp(I),I.flags|=1,Vi(c,I,G,w),I.child)}function EG(c,I,p,G,w){if(c===null){var W=p.type;return typeof W=="function"&&!Gf(W)&&W.defaultProps===void 0&&p.compare===null&&p.defaultProps===void 0?(I.tag=15,I.type=W,TG(c,I,W,G,w)):(c=Cd(p.type,null,G,I,I.mode,w),c.ref=I.ref,c.return=I,I.child=c)}if(W=c.child,!(c.lanes&w)){var E=W.memoizedProps;if(p=p.compare,p=p!==null?p:xC,p(E,G)&&c.ref===I.ref)return $r(c,I,w)}return I.flags|=1,c=Eo(W,G),c.ref=I.ref,c.return=I,I.child=c}function TG(c,I,p,G,w){if(c!==null&&xC(c.memoizedProps,G)&&c.ref===I.ref)if(Is=!1,(c.lanes&w)!==0)c.flags&131072&&(Is=!0);else return I.lanes=c.lanes,$r(c,I,w);return $p(c,I,p,G,w)}function kG(c,I,p){var G=I.pendingProps,w=G.children,W=c!==null?c.memoizedState:null;if(G.mode==="hidden")if(!(I.mode&1))I.memoizedState={baseLanes:0,cachePool:null},bt(ql,us),us|=p;else if(p&1073741824)I.memoizedState={baseLanes:0,cachePool:null},G=W!==null?W.baseLanes:p,bt(ql,us),us|=G;else return c=W!==null?W.baseLanes|p:p,I.lanes=I.childLanes=1073741824,I.memoizedState={baseLanes:c,cachePool:null},I.updateQueue=null,bt(ql,us),us|=c,null;else W!==null?(G=W.baseLanes|p,I.memoizedState=null):G=p,bt(ql,us),us|=G;return Vi(c,I,w,p),I.child}function DG(c,I){var p=I.ref;(c===null&&p!==null||c!==null&&c.ref!==p)&&(I.flags|=512,I.flags|=2097152)}function $p(c,I,p,G,w){var W=li(p)?js:Fn.current;return W=Ho(I,W),Dl(I,w),p=Pp(c,I,p,G,W,w),G=_p(),c!==null&&!Is?(I.updateQueue=c.updateQueue,I.flags&=-2053,c.lanes&=~w,$r(c,I,w)):(dn&&G&&Fp(I),I.flags|=1,Vi(c,I,p,w),I.child)}function UG(c,I,p,G,w){if(li(p)){var W=!0;yC(I)}else W=!1;if(Dl(I,w),I.stateNode===null)c!==null&&(c.alternate=null,I.alternate=null,I.flags|=2),rG(I,p,G),Xp(I,p,G,w),G=!0;else if(c===null){var E=I.stateNode,j=I.memoizedProps;E.props=j;var me=E.context,He=p.contextType;typeof He=="object"&&He!==null?He=Ss(He):(He=li(p)?js:Fn.current,He=Ho(I,He));var Qe=p.getDerivedStateFromProps,pt=typeof Qe=="function"||typeof E.getSnapshotBeforeUpdate=="function";pt||typeof E.UNSAFE_componentWillReceiveProps!="function"&&typeof E.componentWillReceiveProps!="function"||(j!==G||me!==He)&&oG(I,E,G,He),Xo=!1;var It=I.memoizedState;E.state=It,MC(I,G,E,w),me=I.memoizedState,j!==G||It!==me||nn.current||Xo?(typeof Qe=="function"&&(Hp(I,p,Qe,G),me=I.memoizedState),(j=Xo||sG(I,p,j,G,It,me,He))?(pt||typeof E.UNSAFE_componentWillMount!="function"&&typeof E.componentWillMount!="function"||(typeof E.componentWillMount=="function"&&E.componentWillMount(),typeof E.UNSAFE_componentWillMount=="function"&&E.UNSAFE_componentWillMount()),typeof E.componentDidMount=="function"&&(I.flags|=4194308)):(typeof E.componentDidMount=="function"&&(I.flags|=4194308),I.memoizedProps=G,I.memoizedState=me),E.props=G,E.state=me,E.context=He,G=j):(typeof E.componentDidMount=="function"&&(I.flags|=4194308),G=!1)}else{E=I.stateNode,eG(c,I),j=I.memoizedProps,He=I.type===I.elementType?j:$s(I.type,j),E.props=He,pt=I.pendingProps,It=E.context,me=p.contextType,typeof me=="object"&&me!==null?me=Ss(me):(me=li(p)?js:Fn.current,me=Ho(I,me));var on=p.getDerivedStateFromProps;(Qe=typeof on=="function"||typeof E.getSnapshotBeforeUpdate=="function")||typeof E.UNSAFE_componentWillReceiveProps!="function"&&typeof E.componentWillReceiveProps!="function"||(j!==pt||It!==me)&&oG(I,E,G,me),Xo=!1,It=I.memoizedState,E.state=It,MC(I,G,E,w);var it=I.memoizedState;j!==pt||It!==it||nn.current||Xo?(typeof on=="function"&&(Hp(I,p,on,G),it=I.memoizedState),(He=Xo||sG(I,p,He,G,It,it,me)||!1)?(Qe||typeof E.UNSAFE_componentWillUpdate!="function"&&typeof E.componentWillUpdate!="function"||(typeof E.componentWillUpdate=="function"&&E.componentWillUpdate(G,it,me),typeof E.UNSAFE_componentWillUpdate=="function"&&E.UNSAFE_componentWillUpdate(G,it,me)),typeof E.componentDidUpdate=="function"&&(I.flags|=4),typeof E.getSnapshotBeforeUpdate=="function"&&(I.flags|=1024)):(typeof E.componentDidUpdate!="function"||j===c.memoizedProps&&It===c.memoizedState||(I.flags|=4),typeof E.getSnapshotBeforeUpdate!="function"||j===c.memoizedProps&&It===c.memoizedState||(I.flags|=1024),I.memoizedProps=G,I.memoizedState=it),E.props=G,E.state=it,E.context=me,G=He):(typeof E.componentDidUpdate!="function"||j===c.memoizedProps&&It===c.memoizedState||(I.flags|=4),typeof E.getSnapshotBeforeUpdate!="function"||j===c.memoizedProps&&It===c.memoizedState||(I.flags|=1024),G=!1)}return ef(c,I,p,G,W,w)}function ef(c,I,p,G,w,W){DG(c,I);var E=(I.flags&128)!==0;if(!G&&!E)return w&&Oy(I,p,!1),$r(c,I,W);G=I.stateNode,p5.current=I;var j=E&&typeof p.getDerivedStateFromError!="function"?null:G.render();return I.flags|=1,c!==null&&E?(I.child=Jl(I,c.child,null,W),I.child=Jl(I,null,j,W)):Vi(c,I,j,W),I.memoizedState=G.state,w&&Oy(I,p,!0),I.child}function PG(c){var I=c.stateNode;I.pendingContext?_y(c,I.pendingContext,I.pendingContext!==I.context):I.context&&_y(c,I.context,!1),Ep(c,I.containerInfo)}function _G(c,I,p,G,w){return _l(),Lp(w),I.flags|=256,Vi(c,I,p,G),I.child}var _C={dehydrated:null,treeContext:null,retryLane:0};function JC(c){return{baseLanes:c,cachePool:null}}function JG(c,I,p){var G=I.pendingProps,w=pn.current,W=!1,E=(I.flags&128)!==0,j;if((j=E)||(j=c!==null&&c.memoizedState===null?!1:(w&2)!==0),j?(W=!0,I.flags&=-129):(c===null||c.memoizedState!==null)&&(w|=1),bt(pn,w&1),c===null)return zp(I),c=I.memoizedState,c!==null&&(c=c.dehydrated,c!==null)?(I.mode&1?$t(c)?I.lanes=8:I.lanes=1073741824:I.lanes=1,null):(w=G.children,c=G.fallback,W?(G=I.mode,W=I.child,w={mode:"hidden",children:w},!(G&1)&&W!==null?(W.childLanes=0,W.pendingProps=w):W=dd(w,G,0,null),c=La(c,G,p,null),W.return=I,c.return=I,W.sibling=c,I.child=W,I.child.memoizedState=JC(p),I.memoizedState=_C,c):tf(I,w));if(w=c.memoizedState,w!==null){if(j=w.dehydrated,j!==null){if(E)return I.flags&256?(I.flags&=-257,OC(c,I,p,Error(o(422)))):I.memoizedState!==null?(I.child=c.child,I.flags|=128,null):(W=G.fallback,w=I.mode,G=dd({mode:"visible",children:G.children},w,0,null),W=La(W,w,p,null),W.flags|=2,G.return=I,W.return=I,G.sibling=W,I.child=G,I.mode&1&&Jl(I,c.child,null,p),I.child.memoizedState=JC(p),I.memoizedState=_C,W);if(!(I.mode&1))I=OC(c,I,p,null);else if($t(j))I=OC(c,I,p,Error(o(419)));else if(G=(p&c.childLanes)!==0,Is||G){if(G=Yn,G!==null){switch(p&-p){case 4:W=2;break;case 16:W=8;break;case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:W=32;break;case 536870912:W=268435456;break;default:W=0}G=W&(G.suspendedLanes|p)?0:W,G!==0&&G!==w.retryLane&&(w.retryLane=G,Ms(c,G,-1))}yf(),I=OC(c,I,p,Error(o(421)))}else Pr(j)?(I.flags|=128,I.child=c.child,I=W5.bind(null,c),pi(j,I),I=null):(p=w.treeContext,fe&&(cs=re(j),gs=I,dn=!0,er=null,Ec=!1,p!==null&&(xs[Rs++]=Qr,xs[Rs++]=jr,xs[Rs++]=Ma,Qr=p.id,jr=p.overflow,Ma=I)),I=tf(I,I.pendingProps.children),I.flags|=4096);return I}return W?(G=QG(c,I,G.children,G.fallback,p),W=I.child,w=c.child.memoizedState,W.memoizedState=w===null?JC(p):{baseLanes:w.baseLanes|p,cachePool:null},W.childLanes=c.childLanes&~p,I.memoizedState=_C,G):(p=OG(c,I,G.children,p),I.memoizedState=null,p)}return W?(G=QG(c,I,G.children,G.fallback,p),W=I.child,w=c.child.memoizedState,W.memoizedState=w===null?JC(p):{baseLanes:w.baseLanes|p,cachePool:null},W.childLanes=c.childLanes&~p,I.memoizedState=_C,G):(p=OG(c,I,G.children,p),I.memoizedState=null,p)}function tf(c,I){return I=dd({mode:"visible",children:I},c.mode,0,null),I.return=c,c.child=I}function OG(c,I,p,G){var w=c.child;return c=w.sibling,p=Eo(w,{mode:"visible",children:p}),!(I.mode&1)&&(p.lanes=G),p.return=I,p.sibling=null,c!==null&&(G=I.deletions,G===null?(I.deletions=[c],I.flags|=16):G.push(c)),I.child=p}function QG(c,I,p,G,w){var W=I.mode;c=c.child;var E=c.sibling,j={mode:"hidden",children:p};return!(W&1)&&I.child!==c?(p=I.child,p.childLanes=0,p.pendingProps=j,I.deletions=null):(p=Eo(c,j),p.subtreeFlags=c.subtreeFlags&14680064),E!==null?G=Eo(E,G):(G=La(G,W,w,null),G.flags|=2),G.return=I,p.return=I,p.sibling=G,I.child=p,G}function OC(c,I,p,G){return G!==null&&Lp(G),Jl(I,c.child,null,p),c=tf(I,I.pendingProps.children),c.flags|=2,I.memoizedState=null,c}function jG(c,I,p){c.lanes|=I;var G=c.alternate;G!==null&&(G.lanes|=I),Mp(c.return,I,p)}function nf(c,I,p,G,w){var W=c.memoizedState;W===null?c.memoizedState={isBackwards:I,rendering:null,renderingStartTime:0,last:G,tail:p,tailMode:w}:(W.isBackwards=I,W.rendering=null,W.renderingStartTime=0,W.last=G,W.tail=p,W.tailMode=w)}function qG(c,I,p){var G=I.pendingProps,w=G.revealOrder,W=G.tail;if(Vi(c,I,G.children,p),G=pn.current,G&2)G=G&1|2,I.flags|=128;else{if(c!==null&&c.flags&128)e:for(c=I.child;c!==null;){if(c.tag===13)c.memoizedState!==null&&jG(c,p,I);else if(c.tag===19)jG(c,p,I);else if(c.child!==null){c.child.return=c,c=c.child;continue}if(c===I)break e;for(;c.sibling===null;){if(c.return===null||c.return===I)break e;c=c.return}c.sibling.return=c.return,c=c.sibling}G&=1}if(bt(pn,G),!(I.mode&1))I.memoizedState=null;else switch(w){case"forwards":for(p=I.child,w=null;p!==null;)c=p.alternate,c!==null&&YC(c)===null&&(w=p),p=p.sibling;p=w,p===null?(w=I.child,I.child=null):(w=p.sibling,p.sibling=null),nf(I,!1,w,p,W);break;case"backwards":for(p=null,w=I.child,I.child=null;w!==null;){if(c=w.alternate,c!==null&&YC(c)===null){I.child=w;break}c=w.sibling,w.sibling=p,p=w,w=c}nf(I,!0,p,null,W);break;case"together":nf(I,!1,null,null,void 0);break;default:I.memoizedState=null}return I.child}function $r(c,I,p){if(c!==null&&(I.dependencies=c.dependencies),$l|=I.lanes,!(p&I.childLanes))return null;if(c!==null&&I.child!==c.child)throw Error(o(153));if(I.child!==null){for(c=I.child,p=Eo(c,c.pendingProps),I.child=p,p.return=I;c.sibling!==null;)c=c.sibling,p=p.sibling=Eo(c,c.pendingProps),p.return=I;p.sibling=null}return I.child}function f5(c,I,p){switch(I.tag){case 3:PG(I),_l();break;case 5:dG(I);break;case 1:li(I.type)&&yC(I);break;case 4:Ep(I,I.stateNode.containerInfo);break;case 10:$y(I,I.type._context,I.memoizedProps.value);break;case 13:var G=I.memoizedState;if(G!==null)return G.dehydrated!==null?(bt(pn,pn.current&1),I.flags|=128,null):p&I.child.childLanes?JG(c,I,p):(bt(pn,pn.current&1),c=$r(c,I,p),c!==null?c.sibling:null);bt(pn,pn.current&1);break;case 19:if(G=(p&I.childLanes)!==0,c.flags&128){if(G)return qG(c,I,p);I.flags|=128}var w=I.memoizedState;if(w!==null&&(w.rendering=null,w.tail=null,w.lastEffect=null),bt(pn,pn.current),G)break;return null;case 22:case 23:return I.lanes=0,kG(c,I,p)}return $r(c,I,p)}function m5(c,I){switch(Yp(I),I.tag){case 1:return li(I.type)&&vC(),c=I.flags,c&65536?(I.flags=c&-65537|128,I):null;case 3:return Ql(),en(nn),en(Fn),Dp(),c=I.flags,c&65536&&!(c&128)?(I.flags=c&-65537|128,I):null;case 5:return Tp(I),null;case 13:if(en(pn),c=I.memoizedState,c!==null&&c.dehydrated!==null){if(I.alternate===null)throw Error(o(340));_l()}return c=I.flags,c&65536?(I.flags=c&-65537|128,I):null;case 19:return en(pn),null;case 4:return Ql(),null;case 10:return Vp(I.type._context),null;case 22:case 23:return vf(),null;case 24:return null;default:return null}}var QC=!1,Xa=!1,b5=typeof WeakSet=="function"?WeakSet:Set,ke=null;function jC(c,I){var p=c.ref;if(p!==null)if(typeof p=="function")try{p(null)}catch(G){Pi(c,I,G)}else p.current=null}function sf(c,I,p){try{p()}catch(G){Pi(c,I,G)}}var $G=!1;function v5(c,I){for(Q(c.containerInfo),ke=I;ke!==null;)if(c=ke,I=c.child,(c.subtreeFlags&1028)!==0&&I!==null)I.return=c,ke=I;else for(;ke!==null;){c=ke;try{var p=c.alternate;if(c.flags&1024)switch(c.tag){case 0:case 11:case 15:break;case 1:if(p!==null){var G=p.memoizedProps,w=p.memoizedState,W=c.stateNode,E=W.getSnapshotBeforeUpdate(c.elementType===c.type?G:$s(c.type,G),w);W.__reactInternalSnapshotBeforeUpdate=E}break;case 3:Ue&&Ne(c.stateNode.containerInfo);break;case 5:case 6:case 4:case 17:break;default:throw Error(o(163))}}catch(j){Pi(c,c.return,j)}if(I=c.sibling,I!==null){I.return=c.return,ke=I;break}ke=c.return}return p=$G,$G=!1,p}function Fa(c,I,p){var G=I.updateQueue;if(G=G!==null?G.lastEffect:null,G!==null){var w=G=G.next;do{if((w.tag&c)===c){var W=w.destroy;w.destroy=void 0,W!==void 0&&sf(I,p,W)}w=w.next}while(w!==G)}}function $c(c,I){if(I=I.updateQueue,I=I!==null?I.lastEffect:null,I!==null){var p=I=I.next;do{if((p.tag&c)===c){var G=p.create;p.destroy=G()}p=p.next}while(p!==I)}}function rf(c){var I=c.ref;if(I!==null){var p=c.stateNode;switch(c.tag){case 5:c=he(p);break;default:c=p}typeof I=="function"?I(c):I.current=c}}function eB(c,I,p){if(yr&&typeof yr.onCommitFiberUnmount=="function")try{yr.onCommitFiberUnmount(wC,I)}catch{}switch(I.tag){case 0:case 11:case 14:case 15:if(c=I.updateQueue,c!==null&&(c=c.lastEffect,c!==null)){var G=c=c.next;do{var w=G,W=w.destroy;w=w.tag,W!==void 0&&(w&2||w&4)&&sf(I,p,W),G=G.next}while(G!==c)}break;case 1:if(jC(I,p),c=I.stateNode,typeof c.componentWillUnmount=="function")try{c.props=I.memoizedProps,c.state=I.memoizedState,c.componentWillUnmount()}catch(E){Pi(I,p,E)}break;case 5:jC(I,p);break;case 4:Ue?oB(c,I,p):Be&&Be&&(I=I.stateNode.containerInfo,p=At(I),hi(I,p))}}function tB(c,I,p){for(var G=I;;)if(eB(c,G,p),G.child===null||Ue&&G.tag===4){if(G===I)break;for(;G.sibling===null;){if(G.return===null||G.return===I)return;G=G.return}G.sibling.return=G.return,G=G.sibling}else G.child.return=G,G=G.child}function nB(c){var I=c.alternate;I!==null&&(c.alternate=null,nB(I)),c.child=null,c.deletions=null,c.sibling=null,c.tag===5&&(I=c.stateNode,I!==null&&qe(I)),c.stateNode=null,c.return=null,c.dependencies=null,c.memoizedProps=null,c.memoizedState=null,c.pendingProps=null,c.stateNode=null,c.updateQueue=null}function iB(c){return c.tag===5||c.tag===3||c.tag===4}function sB(c){e:for(;;){for(;c.sibling===null;){if(c.return===null||iB(c.return))return null;c=c.return}for(c.sibling.return=c.return,c=c.sibling;c.tag!==5&&c.tag!==6&&c.tag!==18;){if(c.flags&2||c.child===null||c.tag===4)continue e;c.child.return=c,c=c.child}if(!(c.flags&2))return c.stateNode}}function rB(c){if(Ue){e:{for(var I=c.return;I!==null;){if(iB(I))break e;I=I.return}throw Error(o(160))}var p=I;switch(p.tag){case 5:I=p.stateNode,p.flags&32&&(Ye(I),p.flags&=-33),p=sB(c),af(c,p,I);break;case 3:case 4:I=p.stateNode.containerInfo,p=sB(c),of(c,p,I);break;default:throw Error(o(161))}}}function of(c,I,p){var G=c.tag;if(G===5||G===6)c=c.stateNode,I?be(p,c,I):Je(p,c);else if(G!==4&&(c=c.child,c!==null))for(of(c,I,p),c=c.sibling;c!==null;)of(c,I,p),c=c.sibling}function af(c,I,p){var G=c.tag;if(G===5||G===6)c=c.stateNode,I?ye(p,c,I):lt(p,c);else if(G!==4&&(c=c.child,c!==null))for(af(c,I,p),c=c.sibling;c!==null;)af(c,I,p),c=c.sibling}function oB(c,I,p){for(var G=I,w=!1,W,E;;){if(!w){w=G.return;e:for(;;){if(w===null)throw Error(o(160));switch(W=w.stateNode,w.tag){case 5:E=!1;break e;case 3:W=W.containerInfo,E=!0;break e;case 4:W=W.containerInfo,E=!0;break e}w=w.return}w=!0}if(G.tag===5||G.tag===6)tB(c,G,p),E?ze(W,G.stateNode):Se(W,G.stateNode);else if(G.tag===18)E?Wt(W,G.stateNode):St(W,G.stateNode);else if(G.tag===4){if(G.child!==null){W=G.stateNode.containerInfo,E=!0,G.child.return=G,G=G.child;continue}}else if(eB(c,G,p),G.child!==null){G.child.return=G,G=G.child;continue}if(G===I)break;for(;G.sibling===null;){if(G.return===null||G.return===I)return;G=G.return,G.tag===4&&(w=!1)}G.sibling.return=G.return,G=G.sibling}}function lf(c,I){if(Ue){switch(I.tag){case 0:case 11:case 14:case 15:Fa(3,I,I.return),$c(3,I),Fa(5,I,I.return);return;case 1:return;case 5:var p=I.stateNode;if(p!=null){var G=I.memoizedProps;c=c!==null?c.memoizedProps:G;var w=I.type,W=I.updateQueue;I.updateQueue=null,W!==null&&Ie(p,W,w,c,G,I)}return;case 6:if(I.stateNode===null)throw Error(o(162));p=I.memoizedProps,D(I.stateNode,c!==null?c.memoizedProps:p,p);return;case 3:fe&&c!==null&&c.memoizedState.isDehydrated&&mt(I.stateNode.containerInfo);return;case 12:return;case 13:qC(I);return;case 19:qC(I);return;case 17:return}throw Error(o(163))}switch(I.tag){case 0:case 11:case 14:case 15:Fa(3,I,I.return),$c(3,I),Fa(5,I,I.return);return;case 12:return;case 13:qC(I);return;case 19:qC(I);return;case 3:fe&&c!==null&&c.memoizedState.isDehydrated&&mt(I.stateNode.containerInfo);break;case 22:case 23:return}e:if(Be){switch(I.tag){case 1:case 5:case 6:break e;case 3:case 4:I=I.stateNode,hi(I.containerInfo,I.pendingChildren);break e}throw Error(o(163))}}function qC(c){var I=c.updateQueue;if(I!==null){c.updateQueue=null;var p=c.stateNode;p===null&&(p=c.stateNode=new b5),I.forEach(function(G){var w=V5.bind(null,c,G);p.has(G)||(p.add(G),G.then(w,w))})}}function y5(c,I){for(ke=I;ke!==null;){I=ke;var p=I.deletions;if(p!==null)for(var G=0;G";case ed:return":has("+(If(c)||"")+")";case td:return'[role="'+c.value+'"]';case id:return'"'+c.value+'"';case nd:return'[data-testname="'+c.value+'"]';default:throw Error(o(365))}}function IB(c,I){var p=[];c=[c,0];for(var G=0;Gw&&(w=E),G&=~W}if(G=w,G=ti()-G,G=(120>G?120:480>G?480:1080>G?1080:1920>G?1920:3e3>G?3e3:4320>G?4320:1960*B5(G/1960))-G,10c?16:c,Ko===null)var G=!1;else{if(c=Ko,Ko=null,ld=0,xt&6)throw Error(o(331));var w=xt;for(xt|=4,ke=c.current;ke!==null;){var W=ke,E=W.child;if(ke.flags&16){var j=W.deletions;if(j!==null){for(var me=0;meti()-hf?Ya(c,0):df|=p),Ui(c,I)}function bB(c,I){I===0&&(c.mode&1?(I=BC,BC<<=1,!(BC&130023424)&&(BC=4194304)):I=1);var p=Mi();c=Id(c,I),c!==null&&(Lc(c,I,p),Ui(c,p))}function W5(c){var I=c.memoizedState,p=0;I!==null&&(p=I.retryLane),bB(c,p)}function V5(c,I){var p=0;switch(c.tag){case 13:var G=c.stateNode,w=c.memoizedState;w!==null&&(p=w.retryLane);break;case 19:G=c.stateNode;break;default:throw Error(o(314))}G!==null&&G.delete(I),bB(c,p)}var vB;vB=function(c,I,p){if(c!==null)if(c.memoizedProps!==I.pendingProps||nn.current)Is=!0;else{if(!(c.lanes&p)&&!(I.flags&128))return Is=!1,f5(c,I,p);Is=!!(c.flags&131072)}else Is=!1,dn&&I.flags&1048576&&aG(I,XC,I.index);switch(I.lanes=0,I.tag){case 2:var G=I.type;c!==null&&(c.alternate=null,I.alternate=null,I.flags|=2),c=I.pendingProps;var w=Ho(I,Fn.current);Dl(I,p),w=Pp(null,I,G,c,w,p);var W=_p();return I.flags|=1,typeof w=="object"&&w!==null&&typeof w.render=="function"&&w.$$typeof===void 0?(I.tag=1,I.memoizedState=null,I.updateQueue=null,li(G)?(W=!0,yC(I)):W=!1,I.memoizedState=w.state!==null&&w.state!==void 0?w.state:null,Np(I),w.updater=NC,I.stateNode=w,w._reactInternals=I,Xp(I,G,c,p),I=ef(null,I,G,!0,W,p)):(I.tag=0,dn&&W&&Fp(I),Vi(null,I,w,p),I=I.child),I;case 16:G=I.elementType;e:{switch(c!==null&&(c.alternate=null,I.alternate=null,I.flags|=2),c=I.pendingProps,w=G._init,G=w(G._payload),I.type=G,w=I.tag=N5(G),c=$s(G,c),w){case 0:I=$p(null,I,G,c,p);break e;case 1:I=UG(null,I,G,c,p);break e;case 11:I=LG(null,I,G,c,p);break e;case 14:I=EG(null,I,G,$s(G.type,c),p);break e}throw Error(o(306,G,""))}return I;case 0:return G=I.type,w=I.pendingProps,w=I.elementType===G?w:$s(G,w),$p(c,I,G,w,p);case 1:return G=I.type,w=I.pendingProps,w=I.elementType===G?w:$s(G,w),UG(c,I,G,w,p);case 3:e:{if(PG(I),c===null)throw Error(o(387));G=I.pendingProps,W=I.memoizedState,w=W.element,eG(c,I),MC(I,G,null,p);var E=I.memoizedState;if(G=E.element,fe&&W.isDehydrated)if(W={element:G,isDehydrated:!1,cache:E.cache,transitions:E.transitions},I.updateQueue.baseState=W,I.memoizedState=W,I.flags&256){w=Error(o(423)),I=_G(c,I,G,p,w);break e}else if(G!==w){w=Error(o(424)),I=_G(c,I,G,p,w);break e}else for(fe&&(cs=Ae(I.stateNode.containerInfo),gs=I,dn=!0,er=null,Ec=!1),p=CG(I,null,G,p),I.child=p;p;)p.flags=p.flags&-3|4096,p=p.sibling;else{if(_l(),G===w){I=$r(c,I,p);break e}Vi(c,I,G,p)}I=I.child}return I;case 5:return dG(I),c===null&&zp(I),G=I.type,w=I.pendingProps,W=c!==null?c.memoizedProps:null,E=w.children,Ze(G,w)?E=null:W!==null&&Ze(G,W)&&(I.flags|=32),DG(c,I),Vi(c,I,E,p),I.child;case 6:return c===null&&zp(I),null;case 13:return JG(c,I,p);case 4:return Ep(I,I.stateNode.containerInfo),G=I.pendingProps,c===null?I.child=Jl(I,null,G,p):Vi(c,I,G,p),I.child;case 11:return G=I.type,w=I.pendingProps,w=I.elementType===G?w:$s(G,w),LG(c,I,G,w,p);case 7:return Vi(c,I,I.pendingProps,p),I.child;case 8:return Vi(c,I,I.pendingProps.children,p),I.child;case 12:return Vi(c,I,I.pendingProps.children,p),I.child;case 10:e:{if(G=I.type._context,w=I.pendingProps,W=I.memoizedProps,E=w.value,$y(I,G,E),W!==null)if(Gr(W.value,E)){if(W.children===w.children&&!nn.current){I=$r(c,I,p);break e}}else for(W=I.child,W!==null&&(W.return=I);W!==null;){var j=W.dependencies;if(j!==null){E=W.child;for(var me=j.firstContext;me!==null;){if(me.context===G){if(W.tag===1){me=Or(-1,p&-p),me.tag=2;var He=W.updateQueue;if(He!==null){He=He.shared;var Qe=He.pending;Qe===null?me.next=me:(me.next=Qe.next,Qe.next=me),He.pending=me}}W.lanes|=p,me=W.alternate,me!==null&&(me.lanes|=p),Mp(W.return,p,I),j.lanes|=p;break}me=me.next}}else if(W.tag===10)E=W.type===I.type?null:W.child;else if(W.tag===18){if(E=W.return,E===null)throw Error(o(341));E.lanes|=p,j=E.alternate,j!==null&&(j.lanes|=p),Mp(E,p,I),E=W.sibling}else E=W.child;if(E!==null)E.return=W;else for(E=W;E!==null;){if(E===I){E=null;break}if(W=E.sibling,W!==null){W.return=E.return,E=W;break}E=E.return}W=E}Vi(c,I,w.children,p),I=I.child}return I;case 9:return w=I.type,G=I.pendingProps.children,Dl(I,p),w=Ss(w),G=G(w),I.flags|=1,Vi(c,I,G,p),I.child;case 14:return G=I.type,w=$s(G,I.pendingProps),w=$s(G.type,w),EG(c,I,G,w,p);case 15:return TG(c,I,I.type,I.pendingProps,p);case 17:return G=I.type,w=I.pendingProps,w=I.elementType===G?w:$s(G,w),c!==null&&(c.alternate=null,I.alternate=null,I.flags|=2),I.tag=1,li(G)?(c=!0,yC(I)):c=!1,Dl(I,p),rG(I,G,w),Xp(I,G,w,p),ef(null,I,G,!0,c,p);case 19:return qG(c,I,p);case 22:return kG(c,I,p)}throw Error(o(156,I.tag))};function yB(c,I){return Zp(c,I)}function M5(c,I,p,G){this.tag=c,this.key=p,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.ref=null,this.pendingProps=I,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=G,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function Ns(c,I,p,G){return new M5(c,I,p,G)}function Gf(c){return c=c.prototype,!(!c||!c.isReactComponent)}function N5(c){if(typeof c=="function")return Gf(c)?1:0;if(c!=null){if(c=c.$$typeof,c===v)return 11;if(c===b)return 14}return 2}function Eo(c,I){var p=c.alternate;return p===null?(p=Ns(c.tag,I,c.key,c.mode),p.elementType=c.elementType,p.type=c.type,p.stateNode=c.stateNode,p.alternate=c,c.alternate=p):(p.pendingProps=I,p.type=c.type,p.flags=0,p.subtreeFlags=0,p.deletions=null),p.flags=c.flags&14680064,p.childLanes=c.childLanes,p.lanes=c.lanes,p.child=c.child,p.memoizedProps=c.memoizedProps,p.memoizedState=c.memoizedState,p.updateQueue=c.updateQueue,I=c.dependencies,p.dependencies=I===null?null:{lanes:I.lanes,firstContext:I.firstContext},p.sibling=c.sibling,p.index=c.index,p.ref=c.ref,p}function Cd(c,I,p,G,w,W){var E=2;if(G=c,typeof c=="function")Gf(c)&&(E=1);else if(typeof c=="string")E=5;else e:switch(c){case u:return La(p.children,w,W,I);case C:E=8,w|=8;break;case d:return c=Ns(12,p,I,w|2),c.elementType=d,c.lanes=W,c;case y:return c=Ns(13,p,I,w),c.elementType=y,c.lanes=W,c;case A:return c=Ns(19,p,I,w),c.elementType=A,c.lanes=W,c;case B:return dd(p,w,W,I);default:if(typeof c=="object"&&c!==null)switch(c.$$typeof){case h:E=10;break e;case f:E=9;break e;case v:E=11;break e;case b:E=14;break e;case m:E=16,G=null;break e}throw Error(o(130,c==null?c:typeof c,""))}return I=Ns(E,p,I,w),I.elementType=c,I.type=G,I.lanes=W,I}function La(c,I,p,G){return c=Ns(7,c,G,I),c.lanes=p,c}function dd(c,I,p,G){return c=Ns(22,c,G,I),c.elementType=B,c.lanes=p,c.stateNode={},c}function Bf(c,I,p){return c=Ns(6,c,null,I),c.lanes=p,c}function Zf(c,I,p){return I=Ns(4,c.children!==null?c.children:[],c.key,I),I.lanes=p,I.stateNode={containerInfo:c.containerInfo,pendingChildren:null,implementation:c.implementation},I}function H5(c,I,p,G,w){this.tag=I,this.containerInfo=c,this.finishedWork=this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=ct,this.callbackNode=this.pendingContext=this.context=null,this.callbackPriority=0,this.eventTimes=Gp(0),this.expirationTimes=Gp(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=Gp(0),this.identifierPrefix=G,this.onRecoverableError=w,fe&&(this.mutableSourceEagerHydrationData=null)}function GB(c,I,p,G,w,W,E,j,me){return c=new H5(c,I,p,j,me),I===1?(I=1,W===!0&&(I|=8)):I=0,W=Ns(3,null,null,I),c.current=W,W.stateNode=c,W.memoizedState={element:G,isDehydrated:p,cache:null,transitions:null},Np(W),c}function BB(c){if(!c)return fi;c=c._reactInternals;e:{if(Z(c)!==c||c.tag!==1)throw Error(o(170));var I=c;do{switch(I.tag){case 3:I=I.stateNode.context;break e;case 1:if(li(I.type)){I=I.stateNode.__reactInternalMemoizedMergedChildContext;break e}}I=I.return}while(I!==null);throw Error(o(171))}if(c.tag===1){var p=c.type;if(li(p))return Jy(c,p,I)}return I}function ZB(c){var I=c._reactInternals;if(I===void 0)throw typeof c.render=="function"?Error(o(188)):(c=Object.keys(c).join(","),Error(o(268,c)));return c=P(I),c===null?null:c.stateNode}function wB(c,I){if(c=c.memoizedState,c!==null&&c.dehydrated!==null){var p=c.retryLane;c.retryLane=p!==0&&p=He&&W>=pt&&w<=Qe&&E<=It){c.splice(I,1);break}else if(G!==He||p.width!==me.width||ItE){if(!(W!==pt||p.height!==me.height||Qew)){He>G&&(me.width+=He-G,me.x=G),QeW&&(me.height+=pt-W,me.y=W),Itp&&(p=E)),E ")+` No matching component was found for: - `)+c.join(" > ")}return null},t.getPublicRootInstance=function(c){if(c=c.current,!c.child)return null;switch(c.child.tag){case 5:return he(c.child.stateNode);default:return c.child.stateNode}},t.injectIntoDevTools=function(c){if(c={bundleType:c.bundleType,version:c.version,rendererPackageName:c.rendererPackageName,rendererConfig:c.rendererConfig,overrideHookState:null,overrideHookStateDeletePath:null,overrideHookStateRenamePath:null,overrideProps:null,overridePropsDeletePath:null,overridePropsRenamePath:null,setErrorHandler:null,setSuspenseHandler:null,scheduleUpdate:null,currentDispatcherRef:a.ReactCurrentDispatcher,findHostInstanceByFiber:X5,findFiberByHostInstance:c.findFiberByHostInstance||F5,findHostInstancesForRefresh:null,scheduleRefresh:null,scheduleRoot:null,setRefreshHandler:null,getCurrentFiber:null,reconcilerVersion:"18.0.0-fc46dba67-20220329"},typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u")c=!1;else{var I=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(I.isDisabled||!I.supportsFiber)c=!0;else{try{wC=I.inject(c),yr=I}catch{}c=!!I.checkDCE}}return c},t.isAlreadyRendering=function(){return!1},t.observeVisibleRects=function(c,I,p,G){if(!Ct)throw Error(o(363));c=uf(c,I);var w=Ee(c,p,G).disconnect;return{disconnect:function(){w()}}},t.registerMutableSourceForHydration=function(c,I){var p=I._getVersion;p=p(I._source),c.mutableSourceEagerHydrationData==null?c.mutableSourceEagerHydrationData=[I,p]:c.mutableSourceEagerHydrationData.push(I,p)},t.runWithPriority=function(c,I){var p=kt;try{return kt=c,I()}finally{kt=p}},t.shouldError=function(){return null},t.shouldSuspend=function(){return!1},t.updateContainer=function(c,I,p,G){var w=I.current,W=Mi(),L=zo(w);return p=BB(p),I.context===null?I.context=p:I.pendingContext=p,I=Or(W,L),I.payload={element:c},G=G===void 0?null:G,G!==null&&(I.callback=G),Fo(w,I),c=Ms(w,L,W),c!==null&&VC(c,w,L),L},t};KV.exports=UT;var PT=KV.exports;const _T=Db(PT);function EV(n,e,t=(i,s)=>i===s){if(n===e)return!0;if(!n||!e)return!1;const i=n.length;if(e.length!==i)return!1;for(let s=0;ss.response=r).then(()=>{i.lifespan&&i.lifespan>0&&setTimeout(()=>{const r=uo.indexOf(s);r!==-1&&uo.splice(r,1)},i.lifespan)}).catch(r=>s.error=r)};if(uo.push(s),!t)throw s.promise}const JT=(n,e,t)=>TV(n,e,!1,t),OT=(n,e,t)=>void TV(n,e,!0,t),QT=n=>{if(n===void 0||n.length===0)uo.splice(0,uo.length);else{const e=uo.find(t=>EV(n,t.keys,t.equal));if(e){const t=uo.indexOf(e);t!==-1&&uo.splice(t,1)}}},Hy={},kV=n=>void Object.assign(Hy,n);function jT(n,e){function t(u,{args:C=[],attach:d,...h},f){let v=`${u[0].toUpperCase()}${u.slice(1)}`,y;if(u==="primitive"){if(h.object===void 0)throw new Error("R3F: Primitives without 'object' are invalid!");const A=h.object;y=Sg(A,{type:u,root:f,attach:d,primitive:!0})}else{const A=Hy[v];if(!A)throw new Error(`R3F: ${v} is not part of the THREE namespace! Did you forget to extend? See: https://docs.pmnd.rs/react-three-fiber/api/objects#using-3rd-party-objects-declaratively`);if(!Array.isArray(C))throw new Error("R3F: The args prop must be an array!");y=Sg(new A(...C),{type:u,root:f,attach:d,memoizedProps:{args:C}})}return y.__r3f.attach===void 0&&(y instanceof Gt?y.__r3f.attach="geometry":y instanceof ei&&(y.__r3f.attach="material")),v!=="inject"&&Hm(y,h),y}function i(u,C){let d=!1;if(C){var h,f;(h=C.__r3f)!=null&&h.attach?Nm(u,C,C.__r3f.attach):C.isObject3D&&u.isObject3D&&(u.add(C),d=!0),d||(f=u.__r3f)==null||f.objects.push(C),C.__r3f||Sg(C,{}),C.__r3f.parent=u,Fb(C),xg(C)}}function s(u,C,d){let h=!1;if(C){var f,v;if((f=C.__r3f)!=null&&f.attach)Nm(u,C,C.__r3f.attach);else if(C.isObject3D&&u.isObject3D){C.parent=u,C.dispatchEvent({type:"added"});const y=u.children.filter(b=>b!==C),A=y.indexOf(d);u.children=[...y.slice(0,A),C,...y.slice(A)],h=!0}h||(v=u.__r3f)==null||v.objects.push(C),C.__r3f||Sg(C,{}),C.__r3f.parent=u,Fb(C),xg(C)}}function r(u,C,d=!1){u&&[...u].forEach(h=>o(C,h,d))}function o(u,C,d){if(C){var h,f,v;if(C.__r3f&&(C.__r3f.parent=null),(h=u.__r3f)!=null&&h.objects&&(u.__r3f.objects=u.__r3f.objects.filter(B=>B!==C)),(f=C.__r3f)!=null&&f.attach)Nw(u,C,C.__r3f.attach);else if(C.isObject3D&&u.isObject3D){var y;u.remove(C),(y=C.__r3f)!=null&&y.root&&sk(C.__r3f.root,C)}const b=(v=C.__r3f)==null?void 0:v.primitive,m=d===void 0?C.dispose!==null&&!b:d;if(!b){var A;r((A=C.__r3f)==null?void 0:A.objects,C,m),r(C.children,C,m)}C.__r3f&&(delete C.__r3f.root,delete C.__r3f.objects,delete C.__r3f.handlers,delete C.__r3f.memoizedProps,b||delete C.__r3f),m&&C.dispose&&C.type!=="Scene"&&Hb.unstable_scheduleCallback(Hb.unstable_IdlePriority,()=>{try{C.dispose()}catch{}}),xg(u)}}function a(u,C,d,h){var f;const v=(f=u.__r3f)==null?void 0:f.parent;if(!v)return;const y=t(C,d,u.__r3f.root);if(u.children){for(const A of u.children)A.__r3f&&i(y,A);u.children=u.children.filter(A=>!A.__r3f)}u.__r3f.objects.forEach(A=>i(y,A)),u.__r3f.objects=[],u.__r3f.autoRemovedBeforeAppend||o(v,u),y.parent&&(y.__r3f.autoRemovedBeforeAppend=!0),i(v,y),y.raycast&&y.__r3f.eventCount&&y.__r3f.root.getState().internal.interaction.push(y),[h,h.alternate].forEach(A=>{A!==null&&(A.stateNode=y,A.ref&&(typeof A.ref=="function"?A.ref(y):A.ref.current=y))})}const l=()=>console.warn("Text is not allowed in the R3F tree! This could be stray whitespace or characters.");return{reconciler:_T({createInstance:t,removeChild:o,appendChild:i,appendInitialChild:i,insertBefore:s,supportsMutation:!0,isPrimaryRenderer:!1,supportsPersistence:!1,supportsHydration:!1,noTimeout:-1,appendChildToContainer:(u,C)=>{if(!C)return;const d=u.getState().scene;d.__r3f&&(d.__r3f.root=u,i(d,C))},removeChildFromContainer:(u,C)=>{C&&o(u.getState().scene,C)},insertInContainerBefore:(u,C,d)=>{if(!C||!d)return;const h=u.getState().scene;h.__r3f&&s(h,C,d)},getRootHostContext:()=>null,getChildHostContext:u=>u,finalizeInitialChildren(u){var C;return!!((C=u?.__r3f)!=null?C:{}).handlers},prepareUpdate(u,C,d,h){if(u.__r3f.primitive&&h.object&&h.object!==u)return[!0];{const{args:f=[],children:v,...y}=h,{args:A=[],children:b,...m}=d;if(!Array.isArray(f))throw new Error("R3F: the args prop must be an array!");if(f.some((S,x)=>S!==A[x]))return[!0];const B=QV(u,y,m,!0);return B.changes.length?[!1,B]:null}},commitUpdate(u,[C,d],h,f,v,y){C?a(u,h,v,y):Hm(u,d)},commitMount(u,C,d,h){var f;const v=(f=u.__r3f)!=null?f:{};u.raycast&&v.handlers&&v.eventCount&&u.__r3f.root.getState().internal.interaction.push(u)},getPublicInstance:u=>u,prepareForCommit:()=>null,preparePortalMount:u=>Sg(u.getState().scene),resetAfterCommit:()=>{},shouldSetTextContent:()=>!1,clearContainer:()=>!1,hideInstance(u){var C;const{attach:d,parent:h}=(C=u.__r3f)!=null?C:{};d&&h&&Nw(h,u,d),u.isObject3D&&(u.visible=!1),xg(u)},unhideInstance(u,C){var d;const{attach:h,parent:f}=(d=u.__r3f)!=null?d:{};h&&f&&Nm(f,u,h),(u.isObject3D&&C.visible==null||C.visible)&&(u.visible=!0),xg(u)},createTextInstance:l,hideTextInstance:l,unhideTextInstance:l,getCurrentEventPriority:()=>e?e():Jg.DefaultEventPriority,beforeActiveInstanceBlur:()=>{},afterActiveInstanceBlur:()=>{},detachDeletedInstance:()=>{},now:typeof performance<"u"&&un.fun(performance.now)?performance.now:un.fun(Date.now)?Date.now:()=>0,scheduleTimeout:un.fun(setTimeout)?setTimeout:void 0,cancelTimeout:un.fun(clearTimeout)?clearTimeout:void 0}),applyProps:Hm}}var Rw,Ww;const Mm=n=>"colorSpace"in n||"outputColorSpace"in n,DV=()=>{var n;return(n=Hy.ColorManagement)!=null?n:null},UV=n=>n&&n.isOrthographicCamera,qT=n=>n&&n.hasOwnProperty("current"),Hc=typeof window<"u"&&((Rw=window.document)!=null&&Rw.createElement||((Ww=window.navigator)==null?void 0:Ww.product)==="ReactNative")?k.useLayoutEffect:k.useEffect;function PV(n){const e=k.useRef(n);return Hc(()=>void(e.current=n),[n]),e}function $T({set:n}){return Hc(()=>(n(new Promise(()=>null)),()=>n(!1)),[n]),null}class _V extends k.Component{constructor(...e){super(...e),this.state={error:!1}}componentDidCatch(e){this.props.set(e)}render(){return this.state.error?null:this.props.children}}_V.getDerivedStateFromError=()=>({error:!0});const JV="__default",Vw=new Map,ek=n=>n&&!!n.memoized&&!!n.changes;function OV(n){var e;const t=typeof window<"u"?(e=window.devicePixelRatio)!=null?e:2:1;return Array.isArray(n)?Math.min(Math.max(n[0],t),n[1]):n}const GI=n=>{var e;return(e=n.__r3f)==null?void 0:e.root.getState()},un={obj:n=>n===Object(n)&&!un.arr(n)&&typeof n!="function",fun:n=>typeof n=="function",str:n=>typeof n=="string",num:n=>typeof n=="number",boo:n=>typeof n=="boolean",und:n=>n===void 0,arr:n=>Array.isArray(n),equ(n,e,{arrays:t="shallow",objects:i="reference",strict:s=!0}={}){if(typeof n!=typeof e||!!n!=!!e)return!1;if(un.str(n)||un.num(n))return n===e;const r=un.obj(n);if(r&&i==="reference")return n===e;const o=un.arr(n);if(o&&t==="reference")return n===e;if((o||r)&&n===e)return!0;let a;for(a in n)if(!(a in e))return!1;if(r&&t==="shallow"&&i==="shallow"){for(a in s?e:n)if(!un.equ(n[a],e[a],{strict:s,objects:"reference"}))return!1}else for(a in s?e:n)if(n[a]!==e[a])return!1;if(un.und(a)){if(o&&n.length===0&&e.length===0||r&&Object.keys(n).length===0&&Object.keys(e).length===0)return!0;if(n!==e)return!1}return!0}};function tk(n){const e={nodes:{},materials:{}};return n&&n.traverse(t=>{t.name&&(e.nodes[t.name]=t),t.material&&!e.materials[t.material.name]&&(e.materials[t.material.name]=t.material)}),e}function nk(n){n.dispose&&n.type!=="Scene"&&n.dispose();for(const e in n)e.dispose==null||e.dispose(),delete n[e]}function Sg(n,e){const t=n;return(e!=null&&e.primitive||!t.__r3f)&&(t.__r3f={type:"",root:null,previousAttach:null,memoizedProps:{},eventCount:0,handlers:{},objects:[],parent:null,...e}),n}function Xb(n,e){let t=n;if(e.includes("-")){const i=e.split("-"),s=i.pop();return t=i.reduce((r,o)=>r[o],n),{target:t,key:s}}else return{target:t,key:e}}const Mw=/-\d+$/;function Nm(n,e,t){if(un.str(t)){if(Mw.test(t)){const r=t.replace(Mw,""),{target:o,key:a}=Xb(n,r);Array.isArray(o[a])||(o[a]=[])}const{target:i,key:s}=Xb(n,t);e.__r3f.previousAttach=i[s],i[s]=e}else e.__r3f.previousAttach=t(n,e)}function Nw(n,e,t){var i,s;if(un.str(t)){const{target:r,key:o}=Xb(n,t),a=e.__r3f.previousAttach;a===void 0?delete r[o]:r[o]=a}else(i=e.__r3f)==null||i.previousAttach==null||i.previousAttach(n,e);(s=e.__r3f)==null||delete s.previousAttach}function QV(n,{children:e,key:t,ref:i,...s},{children:r,key:o,ref:a,...l}={},g=!1){var u;const C=(u=n?.__r3f)!=null?u:{},d=Object.entries(s),h=[];if(g){const v=Object.keys(l);for(let y=0;y{var A;if((A=n.__r3f)!=null&&A.primitive&&v==="object"||un.equ(y,l[v]))return;if(/^on(Pointer|Click|DoubleClick|ContextMenu|Wheel)/.test(v))return h.push([v,y,!0,[]]);let b=[];v.includes("-")&&(b=v.split("-")),h.push([v,y,!1,b]);for(const m in s){const B=s[m];m.startsWith(`${v}-`)&&h.push([m,B,!1,m.split("-")])}});const f={...s};return C.memoizedProps&&C.memoizedProps.args&&(f.args=C.memoizedProps.args),C.memoizedProps&&C.memoizedProps.attach&&(f.attach=C.memoizedProps.attach),{memoized:f,changes:h}}function Hm(n,e){var t,i,s;const r=(t=n.__r3f)!=null?t:{},o=r.root,a=(i=o==null||o.getState==null?void 0:o.getState())!=null?i:{},{memoized:l,changes:g}=ek(e)?e:QV(n,e),u=r.eventCount;n.__r3f&&(n.__r3f.memoizedProps=l);for(let d=0;dm[B],n),!(b&&b.set))){const[m,...B]=y.reverse();A=B.reverse().reduce((S,x)=>S[x],n),h=m}if(f===JV+"remove")if(A.constructor){let m=Vw.get(A.constructor);m||(m=new A.constructor,Vw.set(A.constructor,m)),f=m[h]}else f=0;if(v)f?r.handlers[h]=f:delete r.handlers[h],r.eventCount=Object.keys(r.handlers).length;else if(b&&b.set&&(b.copy||b instanceof ml)){if(Array.isArray(f))b.fromArray?b.fromArray(f):b.set(...f);else if(b.copy&&f&&f.constructor&&b.constructor===f.constructor)b.copy(f);else if(f!==void 0){const m=b instanceof Xe;!m&&b.setScalar?b.setScalar(f):b instanceof ml&&f instanceof ml?b.mask=f.mask:b.set(f),!DV()&&!a.linear&&m&&b.convertSRGBToLinear()}}else if(A[h]=f,A[h]instanceof sn&&A[h].format===An&&A[h].type===cn){const m=A[h];Mm(m)&&Mm(a.gl)?m.colorSpace=a.gl.outputColorSpace:m.encoding=a.gl.outputEncoding}xg(n)}if(r.parent&&a.internal&&n.raycast&&u!==r.eventCount){const d=a.internal.interaction.indexOf(n);d>-1&&a.internal.interaction.splice(d,1),r.eventCount&&a.internal.interaction.push(n)}return!(g.length===1&&g[0][0]==="onUpdate")&&g.length&&(s=n.__r3f)!=null&&s.parent&&Fb(n),n}function xg(n){var e,t;const i=(e=n.__r3f)==null||(t=e.root)==null||t.getState==null?void 0:t.getState();i&&i.internal.frames===0&&i.invalidate()}function Fb(n){n.onUpdate==null||n.onUpdate(n)}function jV(n,e){n.manual||(UV(n)?(n.left=e.width/-2,n.right=e.width/2,n.top=e.height/2,n.bottom=e.height/-2):n.aspect=e.width/e.height,n.updateProjectionMatrix(),n.updateMatrixWorld())}function mh(n){return(n.eventObject||n.object).uuid+"/"+n.index+n.instanceId}function ik(){var n;const e=typeof self<"u"&&self||typeof window<"u"&&window;if(!e)return Jg.DefaultEventPriority;switch((n=e.event)==null?void 0:n.type){case"click":case"contextmenu":case"dblclick":case"pointercancel":case"pointerdown":case"pointerup":return Jg.DiscreteEventPriority;case"pointermove":case"pointerout":case"pointerover":case"pointerenter":case"pointerleave":case"wheel":return Jg.ContinuousEventPriority;default:return Jg.DefaultEventPriority}}function qV(n,e,t,i){const s=t.get(e);s&&(t.delete(e),t.size===0&&(n.delete(i),s.target.releasePointerCapture(i)))}function sk(n,e){const{internal:t}=n.getState();t.interaction=t.interaction.filter(i=>i!==e),t.initialHits=t.initialHits.filter(i=>i!==e),t.hovered.forEach((i,s)=>{(i.eventObject===e||i.object===e)&&t.hovered.delete(s)}),t.capturedMap.forEach((i,s)=>{qV(t.capturedMap,e,i,s)})}function rk(n){function e(l){const{internal:g}=n.getState(),u=l.offsetX-g.initialClick[0],C=l.offsetY-g.initialClick[1];return Math.round(Math.sqrt(u*u+C*C))}function t(l){return l.filter(g=>["Move","Over","Enter","Out","Leave"].some(u=>{var C;return(C=g.__r3f)==null?void 0:C.handlers["onPointer"+u]}))}function i(l,g){const u=n.getState(),C=new Set,d=[],h=g?g(u.internal.interaction):u.internal.interaction;for(let A=0;A{const m=GI(A.object),B=GI(b.object);return!m||!B?A.distance-b.distance:B.events.priority-m.events.priority||A.distance-b.distance}).filter(A=>{const b=mh(A);return C.has(b)?!1:(C.add(b),!0)});u.events.filter&&(v=u.events.filter(v,u));for(const A of v){let b=A.object;for(;b;){var y;(y=b.__r3f)!=null&&y.eventCount&&d.push({...A,eventObject:b}),b=b.parent}}if("pointerId"in l&&u.internal.capturedMap.has(l.pointerId))for(let A of u.internal.capturedMap.get(l.pointerId).values())C.has(mh(A.intersection))||d.push(A.intersection);return d}function s(l,g,u,C){const d=n.getState();if(l.length){const h={stopped:!1};for(const f of l){const v=GI(f.object)||d,{raycaster:y,pointer:A,camera:b,internal:m}=v,B=new H(A.x,A.y,0).unproject(b),S=V=>{var N,P;return(N=(P=m.capturedMap.get(V))==null?void 0:P.has(f.eventObject))!=null?N:!1},x=V=>{const N={intersection:f,target:g.target};m.capturedMap.has(V)?m.capturedMap.get(V).set(f.eventObject,N):m.capturedMap.set(V,new Map([[f.eventObject,N]])),g.target.setPointerCapture(V)},R=V=>{const N=m.capturedMap.get(V);N&&qV(m.capturedMap,f.eventObject,N,V)};let M={};for(let V in g){let N=g[V];typeof N!="function"&&(M[V]=N)}let Z={...f,...M,pointer:A,intersections:l,stopped:h.stopped,delta:u,unprojectedPoint:B,ray:y.ray,camera:b,stopPropagation(){const V="pointerId"in g&&m.capturedMap.get(g.pointerId);if((!V||V.has(f.eventObject))&&(Z.stopped=h.stopped=!0,m.hovered.size&&Array.from(m.hovered.values()).find(N=>N.eventObject===f.eventObject))){const N=l.slice(0,l.indexOf(f));r([...N,f])}},target:{hasPointerCapture:S,setPointerCapture:x,releasePointerCapture:R},currentTarget:{hasPointerCapture:S,setPointerCapture:x,releasePointerCapture:R},nativeEvent:g};if(C(Z),h.stopped===!0)break}}return l}function r(l){const{internal:g}=n.getState();for(const u of g.hovered.values())if(!l.length||!l.find(C=>C.object===u.object&&C.index===u.index&&C.instanceId===u.instanceId)){const d=u.eventObject.__r3f,h=d?.handlers;if(g.hovered.delete(mh(u)),d!=null&&d.eventCount){const f={...u,intersections:l};h.onPointerOut==null||h.onPointerOut(f),h.onPointerLeave==null||h.onPointerLeave(f)}}}function o(l,g){for(let u=0;ur([]);case"onLostPointerCapture":return g=>{const{internal:u}=n.getState();"pointerId"in g&&u.capturedMap.has(g.pointerId)&&requestAnimationFrame(()=>{u.capturedMap.has(g.pointerId)&&(u.capturedMap.delete(g.pointerId),r([]))})}}return function(u){const{onPointerMissed:C,internal:d}=n.getState();d.lastEvent.current=u;const h=l==="onPointerMove",f=l==="onClick"||l==="onContextMenu"||l==="onDoubleClick",y=i(u,h?t:void 0),A=f?e(u):0;l==="onPointerDown"&&(d.initialClick=[u.offsetX,u.offsetY],d.initialHits=y.map(m=>m.eventObject)),f&&!y.length&&A<=2&&(o(u,d.interaction),C&&C(u)),h&&r(y);function b(m){const B=m.eventObject,S=B.__r3f,x=S?.handlers;if(S!=null&&S.eventCount)if(h){if(x.onPointerOver||x.onPointerEnter||x.onPointerOut||x.onPointerLeave){const R=mh(m),M=d.hovered.get(R);M?M.stopped&&m.stopPropagation():(d.hovered.set(R,m),x.onPointerOver==null||x.onPointerOver(m),x.onPointerEnter==null||x.onPointerEnter(m))}x.onPointerMove==null||x.onPointerMove(m)}else{const R=x[l];R?(!f||d.initialHits.includes(B))&&(o(u,d.interaction.filter(M=>!d.initialHits.includes(M))),R(m)):f&&d.initialHits.includes(B)&&o(u,d.interaction.filter(M=>!d.initialHits.includes(M)))}}s(y,u,A,b)}}return{handlePointer:a}}const ok=["set","get","setSize","setFrameloop","setDpr","events","invalidate","advance","size","viewport"],$V=n=>!!(n!=null&&n.render),Xy=k.createContext(null),ak=(n,e)=>{const t=YV((a,l)=>{const g=new H,u=new H,C=new H;function d(A=l().camera,b=u,m=l().size){const{width:B,height:S,top:x,left:R}=m,M=B/S;b instanceof H?C.copy(b):C.set(...b);const Z=A.getWorldPosition(g).distanceTo(C);if(UV(A))return{width:B/A.zoom,height:S/A.zoom,top:x,left:R,factor:1,distance:Z,aspect:M};{const V=A.fov*Math.PI/180,N=2*Math.tan(V/2)*Z,P=N*(B/S);return{width:P,height:N,top:x,left:R,factor:B/P,distance:Z,aspect:M}}}let h;const f=A=>a(b=>({performance:{...b.performance,current:A}})),v=new oe;return{set:a,get:l,gl:null,camera:null,raycaster:null,events:{priority:1,enabled:!0,connected:!1},xr:null,scene:null,invalidate:(A=1)=>n(l(),A),advance:(A,b)=>e(A,b,l()),legacy:!1,linear:!1,flat:!1,controls:null,clock:new Wy,pointer:v,mouse:v,frameloop:"always",onPointerMissed:void 0,performance:{current:1,min:.5,max:1,debounce:200,regress:()=>{const A=l();h&&clearTimeout(h),A.performance.current!==A.performance.min&&f(A.performance.min),h=setTimeout(()=>f(l().performance.max),A.performance.debounce)}},size:{width:0,height:0,top:0,left:0,updateStyle:!1},viewport:{initialDpr:0,dpr:0,width:0,height:0,top:0,left:0,aspect:0,distance:0,factor:0,getCurrentViewport:d},setEvents:A=>a(b=>({...b,events:{...b.events,...A}})),setSize:(A,b,m,B,S)=>{const x=l().camera,R={width:A,height:b,top:B||0,left:S||0,updateStyle:m};a(M=>({size:R,viewport:{...M.viewport,...d(x,u,R)}}))},setDpr:A=>a(b=>{const m=OV(A);return{viewport:{...b.viewport,dpr:m,initialDpr:b.viewport.initialDpr||m}}}),setFrameloop:(A="always")=>{const b=l().clock;b.stop(),b.elapsedTime=0,A!=="never"&&(b.start(),b.elapsedTime=0),a(()=>({frameloop:A}))},previousRoot:void 0,internal:{active:!1,priority:0,frames:0,lastEvent:k.createRef(),interaction:[],hovered:new Map,subscribers:[],initialClick:[0,0],initialHits:[],capturedMap:new Map,subscribe:(A,b,m)=>{const B=l().internal;return B.priority=B.priority+(b>0?1:0),B.subscribers.push({ref:A,priority:b,store:m}),B.subscribers=B.subscribers.sort((S,x)=>S.priority-x.priority),()=>{const S=l().internal;S!=null&&S.subscribers&&(S.priority=S.priority-(b>0?1:0),S.subscribers=S.subscribers.filter(x=>x.ref!==A))}}}}}),i=t.getState();let s=i.size,r=i.viewport.dpr,o=i.camera;return t.subscribe(()=>{const{camera:a,size:l,viewport:g,gl:u,set:C}=t.getState();if(l!==s||g.dpr!==r){var d;s=l,r=g.dpr,jV(a,l),u.setPixelRatio(g.dpr);const h=(d=l.updateStyle)!=null?d:typeof HTMLCanvasElement<"u"&&u.domElement instanceof HTMLCanvasElement;u.setSize(l.width,l.height,h)}a!==o&&(o=a,C(h=>({viewport:{...h.viewport,...h.viewport.getCurrentViewport(a)}})))}),t.subscribe(a=>n(a)),t};let bh,lk=new Set,gk=new Set,ck=new Set;function Xm(n,e){if(n.size)for(const{callback:t}of n.values())t(e)}function BI(n,e){switch(n){case"before":return Xm(lk,e);case"after":return Xm(gk,e);case"tail":return Xm(ck,e)}}let Fm,Ym;function Km(n,e,t){let i=e.clock.getDelta();for(e.frameloop==="never"&&typeof n=="number"&&(i=n-e.clock.elapsedTime,e.clock.oldTime=e.clock.elapsedTime,e.clock.elapsedTime=n),Fm=e.internal.subscribers,bh=0;bh0)&&!((g=s.gl.xr)!=null&&g.isPresenting)&&(t+=Km(l,s))}if(BI("after",l),t===0)return BI("tail",l),e=!1,cancelAnimationFrame(i)}function o(l,g=1){var u;if(!l)return n.forEach(C=>o(C.store.getState()),g);(u=l.gl.xr)!=null&&u.isPresenting||!l.internal.active||l.frameloop==="never"||(l.internal.frames=Math.min(60,l.internal.frames+g),e||(e=!0,requestAnimationFrame(r)))}function a(l,g=!0,u,C){if(g&&BI("before",l),u)Km(l,u,C);else for(const d of n.values())Km(l,d.store.getState());g&&BI("after",l)}return{loop:r,invalidate:o,advance:a}}function uk(n){const e=k.useRef(null);return Hc(()=>void(e.current=n.current.__r3f),[n]),e}function Fy(){const n=k.useContext(Xy);if(!n)throw new Error("R3F: Hooks can only be used within the Canvas component!");return n}function as(n=t=>t,e){return Fy()(n,e)}function bC(n,e=0){const t=Fy(),i=t.getState().internal.subscribe,s=PV(n);return Hc(()=>i(s,e,t),[e,i,t]),null}function eM(n,e){return function(t,...i){const s=new t;return n&&n(s),Promise.all(i.map(r=>new Promise((o,a)=>s.load(r,l=>{l.scene&&Object.assign(l,tk(l.scene)),o(l)},e,l=>a(new Error(`Could not load ${r}: ${l.message})`))))))}}function Yy(n,e,t,i){const s=Array.isArray(e)?e:[e],r=JT(eM(t,i),[n,...s],{equal:un.equ});return Array.isArray(e)?r:r[0]}Yy.preload=function(n,e,t){const i=Array.isArray(e)?e:[e];return OT(eM(t),[n,...i])};Yy.clear=function(n,e){const t=Array.isArray(e)?e:[e];return QT([n,...t])};const vc=new Map,{invalidate:Hw,advance:Xw}=Ik(vc),{reconciler:_u,applyProps:$a}=jT(vc,ik),Bg={objects:"shallow",strict:!1},Ck=(n,e)=>{const t=typeof n=="function"?n(e):n;return $V(t)?t:new uy({powerPreference:"high-performance",canvas:e,antialias:!0,alpha:!0,...n})};function dk(n,e){if(e)return e;if(typeof HTMLCanvasElement<"u"&&n instanceof HTMLCanvasElement&&n.parentElement){const{width:t,height:i,top:s,left:r}=n.parentElement.getBoundingClientRect();return{width:t,height:i,top:s,left:r}}else if(typeof OffscreenCanvas<"u"&&n instanceof OffscreenCanvas)return{width:n.width,height:n.height,top:0,left:0};return{width:0,height:0,top:0,left:0}}function hk(n){const e=vc.get(n),t=e?.fiber,i=e?.store;e&&console.warn("R3F.createRoot should only be called once!");const s=typeof reportError=="function"?reportError:console.error,r=i||ak(Hw,Xw),o=t||_u.createContainer(r,Jg.ConcurrentRoot,null,!1,null,"",s,null);e||vc.set(n,{fiber:o,store:r});let a,l=!1,g;return{configure(u={}){let{gl:C,size:d,scene:h,events:f,onCreated:v,shadows:y=!1,linear:A=!1,flat:b=!1,legacy:m=!1,orthographic:B=!1,frameloop:S="always",dpr:x=[1,2],performance:R,raycaster:M,camera:Z,onPointerMissed:V}=u,N=r.getState(),P=N.gl;N.gl||N.set({gl:P=Ck(C,n)});let U=N.raycaster;U||N.set({raycaster:U=new Ny});const{params:q,...ie}=M||{};if(un.equ(ie,U,Bg)||$a(U,{...ie}),un.equ(q,U.params,Bg)||$a(U,{params:{...U.params,...q}}),!N.camera||N.camera===g&&!un.equ(g,Z,Bg)){g=Z;const le=Z instanceof xc,se=le?Z:B?new Rc(0,0,0,0,.1,1e3):new mn(75,0,.1,1e3);le||(se.position.z=5,Z&&$a(se,Z),!N.camera&&!(Z!=null&&Z.rotation)&&se.lookAt(0,0,0)),N.set({camera:se})}if(!N.scene){let le;h instanceof Sl?le=h:(le=new Sl,h&&$a(le,h)),N.set({scene:Sg(le)})}if(!N.xr){const le=(ge,Ze)=>{const Re=r.getState();Re.frameloop!=="never"&&Xw(ge,!0,Re,Ze)},se=()=>{const ge=r.getState();ge.gl.xr.enabled=ge.gl.xr.isPresenting,ge.gl.xr.setAnimationLoop(ge.gl.xr.isPresenting?le:null),ge.gl.xr.isPresenting||Hw(ge)},te={connect(){const ge=r.getState().gl;ge.xr.addEventListener("sessionstart",se),ge.xr.addEventListener("sessionend",se)},disconnect(){const ge=r.getState().gl;ge.xr.removeEventListener("sessionstart",se),ge.xr.removeEventListener("sessionend",se)}};P.xr&&te.connect(),N.set({xr:te})}if(P.shadowMap){const le=P.shadowMap.enabled,se=P.shadowMap.type;if(P.shadowMap.enabled=!!y,un.boo(y))P.shadowMap.type=tu;else if(un.str(y)){var he;const te={basic:U1,percentage:qA,soft:tu,variance:cr};P.shadowMap.type=(he=te[y])!=null?he:tu}else un.obj(y)&&Object.assign(P.shadowMap,y);(le!==P.shadowMap.enabled||se!==P.shadowMap.type)&&(P.shadowMap.needsUpdate=!0)}const Ce=DV();Ce&&("enabled"in Ce?Ce.enabled=!m:"legacyMode"in Ce&&(Ce.legacyMode=m)),$a(P,{outputEncoding:A?3e3:3001,toneMapping:b?Ar:qv}),N.legacy!==m&&N.set(()=>({legacy:m})),N.linear!==A&&N.set(()=>({linear:A})),N.flat!==b&&N.set(()=>({flat:b})),C&&!un.fun(C)&&!$V(C)&&!un.equ(C,P,Bg)&&$a(P,C),f&&!N.events.handlers&&N.set({events:f(r)});const J=dk(n,d);return un.equ(J,N.size,Bg)||N.setSize(J.width,J.height,J.updateStyle,J.top,J.left),x&&N.viewport.dpr!==OV(x)&&N.setDpr(x),N.frameloop!==S&&N.setFrameloop(S),N.onPointerMissed||N.set({onPointerMissed:V}),R&&!un.equ(R,N.performance,Bg)&&N.set(le=>({performance:{...le.performance,...R}})),a=v,l=!0,this},render(u){return l||this.configure(),_u.updateContainer(k.createElement(Ak,{store:r,children:u,onCreated:a,rootElement:n}),o,null,()=>{}),r},unmount(){tM(n)}}}function Ak({store:n,children:e,onCreated:t,rootElement:i}){return Hc(()=>{const s=n.getState();s.set(r=>({internal:{...r.internal,active:!0}})),t&&t(s),n.getState().events.connected||s.events.connect==null||s.events.connect(i)},[]),k.createElement(Xy.Provider,{value:n},e)}function tM(n,e){const t=vc.get(n),i=t?.fiber;if(i){const s=t?.store.getState();s&&(s.internal.active=!1),_u.updateContainer(null,i,null,()=>{s&&setTimeout(()=>{try{var r,o,a,l;s.events.disconnect==null||s.events.disconnect(),(r=s.gl)==null||(o=r.renderLists)==null||o.dispose==null||o.dispose(),(a=s.gl)==null||a.forceContextLoss==null||a.forceContextLoss(),(l=s.gl)!=null&&l.xr&&s.xr.disconnect(),nk(s),vc.delete(n),e&&e(n)}catch{}},500)})}}function pk(n,e,t){return k.createElement(fk,{key:e.uuid,children:n,container:e,state:t})}function fk({state:n={},children:e,container:t}){const{events:i,size:s,...r}=n,o=Fy(),[a]=k.useState(()=>new Ny),[l]=k.useState(()=>new oe),g=k.useCallback((C,d)=>{const h={...C};Object.keys(C).forEach(v=>{(ok.includes(v)||C[v]!==d[v]&&d[v])&&delete h[v]});let f;if(d&&s){const v=d.camera;f=C.viewport.getCurrentViewport(v,new H,s),v!==C.camera&&jV(v,s)}return{...h,scene:t,raycaster:a,pointer:l,mouse:l,previousRoot:o,events:{...C.events,...d?.events,...i},size:{...C.size,...s},viewport:{...C.viewport,...f},...r}},[n]),[u]=k.useState(()=>{const C=o.getState();return YV((h,f)=>({...C,scene:t,raycaster:a,pointer:l,mouse:l,previousRoot:o,events:{...C.events,...i},size:{...C.size,...s},...r,set:h,get:f,setEvents:v=>h(y=>({...y,events:{...y.events,...v}}))}))});return k.useEffect(()=>{const C=o.subscribe(d=>u.setState(h=>g(d,h)));return()=>{C(),u.destroy()}},[]),k.useEffect(()=>{u.setState(C=>g(o.getState(),C))},[g]),k.createElement(k.Fragment,null,_u.createPortal(k.createElement(Xy.Provider,{value:u},e),u,null))}_u.injectIntoDevTools({bundleType:0,rendererPackageName:"@react-three/fiber",version:k.version});function VA(){return VA=Object.assign?Object.assign.bind():function(n){for(var e=1;e=0?i=setTimeout(l,e-u):(i=null,t||(a=n.apply(r,s),r=s=null))}var g=function(){r=this,s=arguments,o=Date.now();var u=t&&!i;return i||(i=setTimeout(l,e)),u&&(a=n.apply(r,s),r=s=null),a};return g.clear=function(){i&&(clearTimeout(i),i=null)},g.flush=function(){i&&(a=n.apply(r,s),r=s=null,clearTimeout(i),i=null)},g}Yb.debounce=Yb;var mk=Yb;const Fw=Db(mk);function bk(n){let{debounce:e,scroll:t,polyfill:i,offsetSize:s}=n===void 0?{debounce:0,scroll:!1,offsetSize:!1}:n;const r=i||(typeof window>"u"?class{}:window.ResizeObserver);if(!r)throw new Error("This browser does not support ResizeObserver out of the box. See: https://github.com/react-spring/react-use-measure/#resize-observer-polyfills");const[o,a]=k.useState({left:0,top:0,width:0,height:0,bottom:0,right:0,x:0,y:0}),l=k.useRef({element:null,scrollContainers:null,resizeObserver:null,lastBounds:o}),g=e?typeof e=="number"?e:e.scroll:null,u=e?typeof e=="number"?e:e.resize:null,C=k.useRef(!1);k.useEffect(()=>(C.current=!0,()=>void(C.current=!1)));const[d,h,f]=k.useMemo(()=>{const b=()=>{if(!l.current.element)return;const{left:m,top:B,width:S,height:x,bottom:R,right:M,x:Z,y:V}=l.current.element.getBoundingClientRect(),N={left:m,top:B,width:S,height:x,bottom:R,right:M,x:Z,y:V};l.current.element instanceof HTMLElement&&s&&(N.height=l.current.element.offsetHeight,N.width=l.current.element.offsetWidth),Object.freeze(N),C.current&&!Bk(l.current.lastBounds,N)&&a(l.current.lastBounds=N)};return[b,u?Fw(b,u):b,g?Fw(b,g):b]},[a,s,g,u]);function v(){l.current.scrollContainers&&(l.current.scrollContainers.forEach(b=>b.removeEventListener("scroll",f,!0)),l.current.scrollContainers=null),l.current.resizeObserver&&(l.current.resizeObserver.disconnect(),l.current.resizeObserver=null)}function y(){l.current.element&&(l.current.resizeObserver=new r(f),l.current.resizeObserver.observe(l.current.element),t&&l.current.scrollContainers&&l.current.scrollContainers.forEach(b=>b.addEventListener("scroll",f,{capture:!0,passive:!0})))}const A=b=>{!b||b===l.current.element||(v(),l.current.element=b,l.current.scrollContainers=nM(b),y())};return yk(f,!!t),vk(h),k.useEffect(()=>{v(),y()},[t,f,h]),k.useEffect(()=>v,[]),[A,o,d]}function vk(n){k.useEffect(()=>{const e=n;return window.addEventListener("resize",e),()=>void window.removeEventListener("resize",e)},[n])}function yk(n,e){k.useEffect(()=>{if(e){const t=n;return window.addEventListener("scroll",t,{capture:!0,passive:!0}),()=>void window.removeEventListener("scroll",t,!0)}},[n,e])}function nM(n){const e=[];if(!n||n===document.body)return e;const{overflow:t,overflowX:i,overflowY:s}=window.getComputedStyle(n);return[t,i,s].some(r=>r==="auto"||r==="scroll")&&e.push(n),[...e,...nM(n.parentElement)]}const Gk=["x","y","top","bottom","left","right","width","height"],Bk=(n,e)=>Gk.every(t=>n[t]===e[t]);var Zk=Object.defineProperty,wk=Object.defineProperties,Sk=Object.getOwnPropertyDescriptors,Yw=Object.getOwnPropertySymbols,xk=Object.prototype.hasOwnProperty,Rk=Object.prototype.propertyIsEnumerable,Kw=(n,e,t)=>e in n?Zk(n,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):n[e]=t,zw=(n,e)=>{for(var t in e||(e={}))xk.call(e,t)&&Kw(n,t,e[t]);if(Yw)for(var t of Yw(e))Rk.call(e,t)&&Kw(n,t,e[t]);return n},Wk=(n,e)=>wk(n,Sk(e));function iM(n,e,t){if(!n)return;if(t(n)===!0)return n;let i=e?n.return:n.child;for(;i;){const s=iM(i,e,t);if(s)return s;i=e?null:i.sibling}}function sM(n){try{return Object.defineProperties(n,{_currentRenderer:{get(){return null},set(){}},_currentRenderer2:{get(){return null},set(){}}})}catch{return n}}const Ky=sM(k.createContext(null));class rM extends k.Component{render(){return k.createElement(Ky.Provider,{value:this._reactInternals},this.props.children)}}const{ReactCurrentOwner:Lw,ReactCurrentDispatcher:Ew}=k.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;function Vk(){const n=k.useContext(Ky);if(n===null)throw new Error("its-fine: useFiber must be called within a !");const e=k.useId();return k.useMemo(()=>{for(const i of[Lw?.current,n,n?.alternate]){if(!i)continue;const s=iM(i,!1,r=>{let o=r.memoizedState;for(;o;){if(o.memoizedState===e)return!0;o=o.next}});if(s)return s}},[n,e])}function Mk(){var n,e;const t=Vk(),[i]=k.useState(()=>new Map);i.clear();let s=t;for(;s;){const r=(n=s.type)==null?void 0:n._context;r&&r!==Ky&&!i.has(r)&&i.set(r,(e=Ew?.current)==null?void 0:e.readContext(sM(r))),s=s.return}return i}function Nk(){const n=Mk();return k.useMemo(()=>Array.from(n.keys()).reduce((e,t)=>i=>k.createElement(e,null,k.createElement(t.Provider,Wk(zw({},i),{value:n.get(t)}))),e=>k.createElement(rM,zw({},e))),[n])}const zm={onClick:["click",!1],onContextMenu:["contextmenu",!1],onDoubleClick:["dblclick",!1],onWheel:["wheel",!0],onPointerDown:["pointerdown",!0],onPointerUp:["pointerup",!0],onPointerLeave:["pointerleave",!0],onPointerMove:["pointermove",!0],onPointerCancel:["pointercancel",!0],onLostPointerCapture:["lostpointercapture",!0]};function Hk(n){const{handlePointer:e}=rk(n);return{priority:1,enabled:!0,compute(t,i,s){i.pointer.set(t.offsetX/i.size.width*2-1,-(t.offsetY/i.size.height)*2+1),i.raycaster.setFromCamera(i.pointer,i.camera)},connected:void 0,handlers:Object.keys(zm).reduce((t,i)=>({...t,[i]:e(i)}),{}),update:()=>{var t;const{events:i,internal:s}=n.getState();(t=s.lastEvent)!=null&&t.current&&i.handlers&&i.handlers.onPointerMove(s.lastEvent.current)},connect:t=>{var i;const{set:s,events:r}=n.getState();r.disconnect==null||r.disconnect(),s(o=>({events:{...o.events,connected:t}})),Object.entries((i=r.handlers)!=null?i:[]).forEach(([o,a])=>{const[l,g]=zm[o];t.addEventListener(l,a,{passive:g})})},disconnect:()=>{const{set:t,events:i}=n.getState();if(i.connected){var s;Object.entries((s=i.handlers)!=null?s:[]).forEach(([r,o])=>{if(i&&i.connected instanceof HTMLElement){const[a]=zm[r];i.connected.removeEventListener(a,o)}}),t(r=>({events:{...r.events,connected:void 0}}))}}}}const Xk=k.forwardRef(function({children:e,fallback:t,resize:i,style:s,gl:r,events:o=Hk,eventSource:a,eventPrefix:l,shadows:g,linear:u,flat:C,legacy:d,orthographic:h,frameloop:f,dpr:v,performance:y,raycaster:A,camera:b,onPointerMissed:m,onCreated:B,...S},x){k.useMemo(()=>kV(TT),[]);const R=Nk(),[M,Z]=bk({scroll:!0,debounce:{scroll:50,resize:0},...i}),V=k.useRef(null),N=k.useRef(null);k.useImperativeHandle(x,()=>V.current);const P=PV(m),[U,q]=k.useState(!1),[ie,he]=k.useState(!1);if(U)throw U;if(ie)throw ie;const Ce=k.useRef(null);Hc(()=>{const Q=V.current;Z.width>0&&Z.height>0&&Q&&(Ce.current||(Ce.current=hk(Q)),Ce.current.configure({gl:r,events:o,shadows:g,linear:u,flat:C,legacy:d,orthographic:h,frameloop:f,dpr:v,performance:y,raycaster:A,camera:b,size:Z,onPointerMissed:(...J)=>P.current==null?void 0:P.current(...J),onCreated:J=>{J.events.connect==null||J.events.connect(a?qT(a)?a.current:a:N.current),l&&J.setEvents({compute:(le,se)=>{const te=le[l+"X"],ge=le[l+"Y"];se.pointer.set(te/se.size.width*2-1,-(ge/se.size.height)*2+1),se.raycaster.setFromCamera(se.pointer,se.camera)}}),B?.(J)}}),Ce.current.render(k.createElement(R,null,k.createElement(_V,{set:he},k.createElement(k.Suspense,{fallback:k.createElement($T,{set:q})},e)))))}),k.useEffect(()=>{const Q=V.current;if(Q)return()=>tM(Q)},[]);const z=a?"none":"auto";return k.createElement("div",VA({ref:N,style:{position:"relative",width:"100%",height:"100%",overflow:"hidden",pointerEvents:z,...s}},S),k.createElement("div",{ref:M,style:{width:"100%",height:"100%"}},k.createElement("canvas",{ref:V,style:{display:"block"}},t)))}),Fk=k.forwardRef(function(e,t){return k.createElement(rM,null,k.createElement(Xk,VA({},e,{ref:t})))});var zy={exports:{}},ac=typeof Reflect=="object"?Reflect:null,Tw=ac&&typeof ac.apply=="function"?ac.apply:function(e,t,i){return Function.prototype.apply.call(e,t,i)},$h;ac&&typeof ac.ownKeys=="function"?$h=ac.ownKeys:Object.getOwnPropertySymbols?$h=function(e){return Object.getOwnPropertyNames(e).concat(Object.getOwnPropertySymbols(e))}:$h=function(e){return Object.getOwnPropertyNames(e)};function Yk(n){console&&console.warn&&console.warn(n)}var oM=Number.isNaN||function(e){return e!==e};function rn(){rn.init.call(this)}zy.exports=rn;zy.exports.once=Ek;rn.EventEmitter=rn;rn.prototype._events=void 0;rn.prototype._eventsCount=0;rn.prototype._maxListeners=void 0;var kw=10;function bp(n){if(typeof n!="function")throw new TypeError('The "listener" argument must be of type Function. Received type '+typeof n)}Object.defineProperty(rn,"defaultMaxListeners",{enumerable:!0,get:function(){return kw},set:function(n){if(typeof n!="number"||n<0||oM(n))throw new RangeError('The value of "defaultMaxListeners" is out of range. It must be a non-negative number. Received '+n+".");kw=n}});rn.init=function(){(this._events===void 0||this._events===Object.getPrototypeOf(this)._events)&&(this._events=Object.create(null),this._eventsCount=0),this._maxListeners=this._maxListeners||void 0};rn.prototype.setMaxListeners=function(e){if(typeof e!="number"||e<0||oM(e))throw new RangeError('The value of "n" is out of range. It must be a non-negative number. Received '+e+".");return this._maxListeners=e,this};function aM(n){return n._maxListeners===void 0?rn.defaultMaxListeners:n._maxListeners}rn.prototype.getMaxListeners=function(){return aM(this)};rn.prototype.emit=function(e){for(var t=[],i=1;i0&&(o=t[0]),o instanceof Error)throw o;var a=new Error("Unhandled error."+(o?" ("+o.message+")":""));throw a.context=o,a}var l=r[e];if(l===void 0)return!1;if(typeof l=="function")Tw(l,this,t);else for(var g=l.length,u=uM(l,g),i=0;i0&&o.length>s&&!o.warned){o.warned=!0;var a=new Error("Possible EventEmitter memory leak detected. "+o.length+" "+String(e)+" listeners added. Use emitter.setMaxListeners() to increase limit");a.name="MaxListenersExceededWarning",a.emitter=n,a.type=e,a.count=o.length,Yk(a)}return n}rn.prototype.addListener=function(e,t){return lM(this,e,t,!1)};rn.prototype.on=rn.prototype.addListener;rn.prototype.prependListener=function(e,t){return lM(this,e,t,!0)};function Kk(){if(!this.fired)return this.target.removeListener(this.type,this.wrapFn),this.fired=!0,arguments.length===0?this.listener.call(this.target):this.listener.apply(this.target,arguments)}function gM(n,e,t){var i={fired:!1,wrapFn:void 0,target:n,type:e,listener:t},s=Kk.bind(i);return s.listener=t,i.wrapFn=s,s}rn.prototype.once=function(e,t){return bp(t),this.on(e,gM(this,e,t)),this};rn.prototype.prependOnceListener=function(e,t){return bp(t),this.prependListener(e,gM(this,e,t)),this};rn.prototype.removeListener=function(e,t){var i,s,r,o,a;if(bp(t),s=this._events,s===void 0)return this;if(i=s[e],i===void 0)return this;if(i===t||i.listener===t)--this._eventsCount===0?this._events=Object.create(null):(delete s[e],s.removeListener&&this.emit("removeListener",e,i.listener||t));else if(typeof i!="function"){for(r=-1,o=i.length-1;o>=0;o--)if(i[o]===t||i[o].listener===t){a=i[o].listener,r=o;break}if(r<0)return this;r===0?i.shift():zk(i,r),i.length===1&&(s[e]=i[0]),s.removeListener!==void 0&&this.emit("removeListener",e,a||t)}return this};rn.prototype.off=rn.prototype.removeListener;rn.prototype.removeAllListeners=function(e){var t,i,s;if(i=this._events,i===void 0)return this;if(i.removeListener===void 0)return arguments.length===0?(this._events=Object.create(null),this._eventsCount=0):i[e]!==void 0&&(--this._eventsCount===0?this._events=Object.create(null):delete i[e]),this;if(arguments.length===0){var r=Object.keys(i),o;for(s=0;s=0;s--)this.removeListener(e,t[s]);return this};function cM(n,e,t){var i=n._events;if(i===void 0)return[];var s=i[e];return s===void 0?[]:typeof s=="function"?t?[s.listener||s]:[s]:t?Lk(s):uM(s,s.length)}rn.prototype.listeners=function(e){return cM(this,e,!0)};rn.prototype.rawListeners=function(e){return cM(this,e,!1)};rn.listenerCount=function(n,e){return typeof n.listenerCount=="function"?n.listenerCount(e):IM.call(n,e)};rn.prototype.listenerCount=IM;function IM(n){var e=this._events;if(e!==void 0){var t=e[n];if(typeof t=="function")return 1;if(t!==void 0)return t.length}return 0}rn.prototype.eventNames=function(){return this._eventsCount>0?$h(this._events):[]};function uM(n,e){for(var t=new Array(e),i=0;i{if(e.data.op==="frame"){this.buffers.positions=e.data.positions,this.buffers.quaternions=e.data.quaternions,this.emit(e.data.op,e.data);return}this.emit(e.data.type,e.data)};for(const e of this.messageQueue)this.worker.postMessage(e);this.messageQueue.length=0}disableConstraint(e){let{uuid:t}=e;this.postMessage({op:"disableConstraint",uuid:t})}disableConstraintMotor(e){let{uuid:t}=e;this.postMessage({op:"disableConstraintMotor",uuid:t})}disconnect(){this.worker&&(this.worker.onmessage=null)}enableConstraint(e){let{uuid:t}=e;this.postMessage({op:"enableConstraint",uuid:t})}enableConstraintMotor(e){let{uuid:t}=e;this.postMessage({op:"enableConstraintMotor",uuid:t})}init(){const{allowSleep:e,axisIndex:t,broadphase:i,defaultContactMaterial:s,frictionGravity:r,gravity:o,iterations:a,quatNormalizeFast:l,quatNormalizeSkip:g,solver:u,tolerance:C}=this.config;this.postMessage({op:"init",props:{allowSleep:e,axisIndex:t,broadphase:i,defaultContactMaterial:s,frictionGravity:r,gravity:o,iterations:a,quatNormalizeFast:l,quatNormalizeSkip:g,solver:u,tolerance:C}})}removeBodies(e){let{uuid:t}=e;this.postMessage({op:"removeBodies",uuid:t})}removeConstraint(e){let{uuid:t}=e;this.postMessage({op:"removeConstraint",uuid:t})}removeContactMaterial(e){let{uuid:t}=e;this.postMessage({op:"removeContactMaterial",uuid:t})}removeRay(e){let{uuid:t}=e;this.postMessage({op:"removeRay",uuid:t})}removeRaycastVehicle(e){let{uuid:t}=e;this.postMessage({op:"removeRaycastVehicle",uuid:t})}removeSpring(e){let{uuid:t}=e;this.postMessage({op:"removeSpring",uuid:t})}setAllowSleep(e){let{props:t,uuid:i}=e;this.postMessage({op:"setAllowSleep",props:t,uuid:i})}setAngularDamping(e){let{props:t,uuid:i}=e;this.postMessage({op:"setAngularDamping",props:t,uuid:i})}setAngularFactor(e){let{props:t,uuid:i}=e;this.postMessage({op:"setAngularFactor",props:t,uuid:i})}setAngularVelocity(e){let{props:t,uuid:i}=e;this.postMessage({op:"setAngularVelocity",props:t,uuid:i})}setCollisionFilterGroup(e){let{props:t,uuid:i}=e;this.postMessage({op:"setCollisionFilterGroup",props:t,uuid:i})}setCollisionFilterMask(e){let{props:t,uuid:i}=e;this.postMessage({op:"setCollisionFilterMask",props:t,uuid:i})}setCollisionResponse(e){let{props:t,uuid:i}=e;this.postMessage({op:"setCollisionResponse",props:t,uuid:i})}setConstraintMotorMaxForce(e){let{props:t,uuid:i}=e;this.postMessage({op:"setConstraintMotorMaxForce",props:t,uuid:i})}setConstraintMotorSpeed(e){let{props:t,uuid:i}=e;this.postMessage({op:"setConstraintMotorSpeed",props:t,uuid:i})}setFixedRotation(e){let{props:t,uuid:i}=e;this.postMessage({op:"setFixedRotation",props:t,uuid:i})}setIsTrigger(e){let{props:t,uuid:i}=e;this.postMessage({op:"setIsTrigger",props:t,uuid:i})}setLinearDamping(e){let{props:t,uuid:i}=e;this.postMessage({op:"setLinearDamping",props:t,uuid:i})}setLinearFactor(e){let{props:t,uuid:i}=e;this.postMessage({op:"setLinearFactor",props:t,uuid:i})}setMass(e){let{props:t,uuid:i}=e;this.postMessage({op:"setMass",props:t,uuid:i})}setMaterial(e){let{props:t,uuid:i}=e;this.postMessage({op:"setMaterial",props:t,uuid:i})}setPosition(e){let{props:t,uuid:i}=e;this.postMessage({op:"setPosition",props:t,uuid:i})}setQuaternion(e){let{props:[t,i,s,r],uuid:o}=e;this.postMessage({op:"setQuaternion",props:[t,i,s,r],uuid:o})}setRaycastVehicleBrake(e){let{props:t,uuid:i}=e;this.postMessage({op:"setRaycastVehicleBrake",props:t,uuid:i})}setRaycastVehicleSteeringValue(e){let{props:t,uuid:i}=e;this.postMessage({op:"setRaycastVehicleSteeringValue",props:t,uuid:i})}setRotation(e){let{props:t,uuid:i}=e;this.postMessage({op:"setRotation",props:t,uuid:i})}setSleepSpeedLimit(e){let{props:t,uuid:i}=e;this.postMessage({op:"setSleepSpeedLimit",props:t,uuid:i})}setSleepTimeLimit(e){let{props:t,uuid:i}=e;this.postMessage({op:"setSleepTimeLimit",props:t,uuid:i})}setSpringDamping(e){let{props:t,uuid:i}=e;this.postMessage({op:"setSpringDamping",props:t,uuid:i})}setSpringRestLength(e){let{props:t,uuid:i}=e;this.postMessage({op:"setSpringRestLength",props:t,uuid:i})}setSpringStiffness(e){let{props:t,uuid:i}=e;this.postMessage({op:"setSpringStiffness",props:t,uuid:i})}setUserData(e){let{props:t,uuid:i}=e;this.postMessage({op:"setUserData",props:t,uuid:i})}setVelocity(e){let{props:t,uuid:i}=e;this.postMessage({op:"setVelocity",props:t,uuid:i})}sleep(e){let{uuid:t}=e;this.postMessage({op:"sleep",uuid:t})}step(e){var t;const{buffers:{positions:i,quaternions:s}}=this;!i.byteLength&&!s.byteLength||(t=this.worker)==null||t.postMessage({op:"step",positions:i,props:e,quaternions:s},[i.buffer,s.buffer])}subscribe(e){let{props:{id:t,target:i,type:s},uuid:r}=e;this.postMessage({op:"subscribe",props:{id:t,target:i,type:s},uuid:r})}terminate(){var e;(e=this.worker)==null||e.terminate(),this.worker=null}unsubscribe(e){let{props:t}=e;this.postMessage({op:"unsubscribe",props:t})}wakeUp(e){let{uuid:t}=e;this.postMessage({op:"wakeUp",uuid:t})}postMessage(e){if(this.worker)return this.worker.postMessage(e);this.messageQueue.push(e)}}class po{constructor(e){e===void 0&&(e=[0,0,0,0,0,0,0,0,0]),this.elements=e}identity(){const e=this.elements;e[0]=1,e[1]=0,e[2]=0,e[3]=0,e[4]=1,e[5]=0,e[6]=0,e[7]=0,e[8]=1}setZero(){const e=this.elements;e[0]=0,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=0,e[6]=0,e[7]=0,e[8]=0}setTrace(e){const t=this.elements;t[0]=e.x,t[4]=e.y,t[8]=e.z}getTrace(e){e===void 0&&(e=new Y);const t=this.elements;return e.x=t[0],e.y=t[4],e.z=t[8],e}vmult(e,t){t===void 0&&(t=new Y);const i=this.elements,s=e.x,r=e.y,o=e.z;return t.x=i[0]*s+i[1]*r+i[2]*o,t.y=i[3]*s+i[4]*r+i[5]*o,t.z=i[6]*s+i[7]*r+i[8]*o,t}smult(e){for(let t=0;t0){const r=1/s;this.x*=r,this.y*=r,this.z*=r}else this.x=0,this.y=0,this.z=0;return s}unit(e){e===void 0&&(e=new Y);const t=this.x,i=this.y,s=this.z;let r=Math.sqrt(t*t+i*i+s*s);return r>0?(r=1/r,e.x=t*r,e.y=i*r,e.z=s*r):(e.x=1,e.y=0,e.z=0),e}length(){const e=this.x,t=this.y,i=this.z;return Math.sqrt(e*e+t*t+i*i)}lengthSquared(){return this.dot(this)}distanceTo(e){const t=this.x,i=this.y,s=this.z,r=e.x,o=e.y,a=e.z;return Math.sqrt((r-t)*(r-t)+(o-i)*(o-i)+(a-s)*(a-s))}distanceSquared(e){const t=this.x,i=this.y,s=this.z,r=e.x,o=e.y,a=e.z;return(r-t)*(r-t)+(o-i)*(o-i)+(a-s)*(a-s)}scale(e,t){t===void 0&&(t=new Y);const i=this.x,s=this.y,r=this.z;return t.x=e*i,t.y=e*s,t.z=e*r,t}vmul(e,t){return t===void 0&&(t=new Y),t.x=e.x*this.x,t.y=e.y*this.y,t.z=e.z*this.z,t}addScaledVector(e,t,i){return i===void 0&&(i=new Y),i.x=this.x+e*t.x,i.y=this.y+e*t.y,i.z=this.z+e*t.z,i}dot(e){return this.x*e.x+this.y*e.y+this.z*e.z}isZero(){return this.x===0&&this.y===0&&this.z===0}negate(e){return e===void 0&&(e=new Y),e.x=-this.x,e.y=-this.y,e.z=-this.z,e}tangents(e,t){const i=this.length();if(i>0){const s=Qk,r=1/i;s.set(this.x*r,this.y*r,this.z*r);const o=jk;Math.abs(s.x)<.9?(o.set(1,0,0),s.cross(o,e)):(o.set(0,1,0),s.cross(o,e)),s.cross(e,t)}else e.set(1,0,0),t.set(0,1,0)}toString(){return`${this.x},${this.y},${this.z}`}toArray(){return[this.x,this.y,this.z]}copy(e){return this.x=e.x,this.y=e.y,this.z=e.z,this}lerp(e,t,i){const s=this.x,r=this.y,o=this.z;i.x=s+(e.x-s)*t,i.y=r+(e.y-r)*t,i.z=o+(e.z-o)*t}almostEquals(e,t){return t===void 0&&(t=1e-6),!(Math.abs(this.x-e.x)>t||Math.abs(this.y-e.y)>t||Math.abs(this.z-e.z)>t)}almostZero(e){return e===void 0&&(e=1e-6),!(Math.abs(this.x)>e||Math.abs(this.y)>e||Math.abs(this.z)>e)}isAntiparallelTo(e,t){return this.negate(Dw),Dw.almostEquals(e,t)}clone(){return new Y(this.x,this.y,this.z)}}Y.ZERO=new Y(0,0,0);Y.UNIT_X=new Y(1,0,0);Y.UNIT_Y=new Y(0,1,0);Y.UNIT_Z=new Y(0,0,1);const Qk=new Y,jk=new Y,Dw=new Y;class _s{constructor(e){e===void 0&&(e={}),this.lowerBound=new Y,this.upperBound=new Y,e.lowerBound&&this.lowerBound.copy(e.lowerBound),e.upperBound&&this.upperBound.copy(e.upperBound)}setFromPoints(e,t,i,s){const r=this.lowerBound,o=this.upperBound,a=i;r.copy(e[0]),a&&a.vmult(r,r),o.copy(r);for(let l=1;lo.x&&(o.x=g.x),g.xo.y&&(o.y=g.y),g.yo.z&&(o.z=g.z),g.z=r.x&&t.y<=s.y&&i.y>=r.y&&t.z<=s.z&&i.z>=r.z}getCorners(e,t,i,s,r,o,a,l){const g=this.lowerBound,u=this.upperBound;e.copy(g),t.set(u.x,g.y,g.z),i.set(u.x,u.y,g.z),s.set(g.x,u.y,u.z),r.set(u.x,g.y,u.z),o.set(g.x,u.y,g.z),a.set(g.x,g.y,u.z),l.copy(u)}toLocalFrame(e,t){const i=Pw,s=i[0],r=i[1],o=i[2],a=i[3],l=i[4],g=i[5],u=i[6],C=i[7];this.getCorners(s,r,o,a,l,g,u,C);for(let d=0;d!==8;d++){const h=i[d];e.pointToLocal(h,h)}return t.setFromPoints(i)}toWorldFrame(e,t){const i=Pw,s=i[0],r=i[1],o=i[2],a=i[3],l=i[4],g=i[5],u=i[6],C=i[7];this.getCorners(s,r,o,a,l,g,u,C);for(let d=0;d!==8;d++){const h=i[d];e.pointToWorld(h,h)}return t.setFromPoints(i)}overlapsRay(e){const{direction:t,from:i}=e,s=1/t.x,r=1/t.y,o=1/t.z,a=(this.lowerBound.x-i.x)*s,l=(this.upperBound.x-i.x)*s,g=(this.lowerBound.y-i.y)*r,u=(this.upperBound.y-i.y)*r,C=(this.lowerBound.z-i.z)*o,d=(this.upperBound.z-i.z)*o,h=Math.max(Math.max(Math.min(a,l),Math.min(g,u)),Math.min(C,d)),f=Math.min(Math.min(Math.max(a,l),Math.max(g,u)),Math.max(C,d));return!(f<0||h>f)}}const Uw=new Y,Pw=[new Y,new Y,new Y,new Y,new Y,new Y,new Y,new Y];class Fi{constructor(e,t,i,s){e===void 0&&(e=0),t===void 0&&(t=0),i===void 0&&(i=0),s===void 0&&(s=1),this.x=e,this.y=t,this.z=i,this.w=s}set(e,t,i,s){return this.x=e,this.y=t,this.z=i,this.w=s,this}toString(){return`${this.x},${this.y},${this.z},${this.w}`}toArray(){return[this.x,this.y,this.z,this.w]}setFromAxisAngle(e,t){const i=Math.sin(t*.5);return this.x=e.x*i,this.y=e.y*i,this.z=e.z*i,this.w=Math.cos(t*.5),this}toAxisAngle(e){e===void 0&&(e=new Y),this.normalize();const t=2*Math.acos(this.w),i=Math.sqrt(1-this.w*this.w);return i<.001?(e.x=this.x,e.y=this.y,e.z=this.z):(e.x=this.x/i,e.y=this.y/i,e.z=this.z/i),[e,t]}setFromVectors(e,t){if(e.isAntiparallelTo(t)){const i=qk,s=$k;e.tangents(i,s),this.setFromAxisAngle(i,Math.PI)}else{const i=e.cross(t);this.x=i.x,this.y=i.y,this.z=i.z,this.w=Math.sqrt(e.length()**2*t.length()**2)+e.dot(t),this.normalize()}return this}mult(e,t){t===void 0&&(t=new Fi);const i=this.x,s=this.y,r=this.z,o=this.w,a=e.x,l=e.y,g=e.z,u=e.w;return t.x=i*u+o*a+s*g-r*l,t.y=s*u+o*l+r*a-i*g,t.z=r*u+o*g+i*l-s*a,t.w=o*u-i*a-s*l-r*g,t}inverse(e){e===void 0&&(e=new Fi);const t=this.x,i=this.y,s=this.z,r=this.w;this.conjugate(e);const o=1/(t*t+i*i+s*s+r*r);return e.x*=o,e.y*=o,e.z*=o,e.w*=o,e}conjugate(e){return e===void 0&&(e=new Fi),e.x=-this.x,e.y=-this.y,e.z=-this.z,e.w=this.w,e}normalize(){let e=Math.sqrt(this.x*this.x+this.y*this.y+this.z*this.z+this.w*this.w);return e===0?(this.x=0,this.y=0,this.z=0,this.w=0):(e=1/e,this.x*=e,this.y*=e,this.z*=e,this.w*=e),this}normalizeFast(){const e=(3-(this.x*this.x+this.y*this.y+this.z*this.z+this.w*this.w))/2;return e===0?(this.x=0,this.y=0,this.z=0,this.w=0):(this.x*=e,this.y*=e,this.z*=e,this.w*=e),this}vmult(e,t){t===void 0&&(t=new Y);const i=e.x,s=e.y,r=e.z,o=this.x,a=this.y,l=this.z,g=this.w,u=g*i+a*r-l*s,C=g*s+l*i-o*r,d=g*r+o*s-a*i,h=-o*i-a*s-l*r;return t.x=u*g+h*-o+C*-l-d*-a,t.y=C*g+h*-a+d*-o-u*-l,t.z=d*g+h*-l+u*-a-C*-o,t}copy(e){return this.x=e.x,this.y=e.y,this.z=e.z,this.w=e.w,this}toEuler(e,t){t===void 0&&(t="YZX");let i,s,r;const o=this.x,a=this.y,l=this.z,g=this.w;switch(t){case"YZX":const u=o*a+l*g;if(u>.499&&(i=2*Math.atan2(o,g),s=Math.PI/2,r=0),u<-.499&&(i=-2*Math.atan2(o,g),s=-Math.PI/2,r=0),i===void 0){const C=o*o,d=a*a,h=l*l;i=Math.atan2(2*a*g-2*o*l,1-2*d-2*h),s=Math.asin(2*u),r=Math.atan2(2*o*g-2*a*l,1-2*C-2*h)}break;default:throw new Error(`Euler order ${t} not supported yet.`)}e.y=i,e.z=s,e.x=r}setFromEuler(e,t,i,s){s===void 0&&(s="XYZ");const r=Math.cos(e/2),o=Math.cos(t/2),a=Math.cos(i/2),l=Math.sin(e/2),g=Math.sin(t/2),u=Math.sin(i/2);return s==="XYZ"?(this.x=l*o*a+r*g*u,this.y=r*g*a-l*o*u,this.z=r*o*u+l*g*a,this.w=r*o*a-l*g*u):s==="YXZ"?(this.x=l*o*a+r*g*u,this.y=r*g*a-l*o*u,this.z=r*o*u-l*g*a,this.w=r*o*a+l*g*u):s==="ZXY"?(this.x=l*o*a-r*g*u,this.y=r*g*a+l*o*u,this.z=r*o*u+l*g*a,this.w=r*o*a-l*g*u):s==="ZYX"?(this.x=l*o*a-r*g*u,this.y=r*g*a+l*o*u,this.z=r*o*u-l*g*a,this.w=r*o*a+l*g*u):s==="YZX"?(this.x=l*o*a+r*g*u,this.y=r*g*a+l*o*u,this.z=r*o*u-l*g*a,this.w=r*o*a-l*g*u):s==="XZY"&&(this.x=l*o*a-r*g*u,this.y=r*g*a-l*o*u,this.z=r*o*u+l*g*a,this.w=r*o*a+l*g*u),this}clone(){return new Fi(this.x,this.y,this.z,this.w)}slerp(e,t,i){i===void 0&&(i=new Fi);const s=this.x,r=this.y,o=this.z,a=this.w;let l=e.x,g=e.y,u=e.z,C=e.w,d,h,f,v,y;return h=s*l+r*g+o*u+a*C,h<0&&(h=-h,l=-l,g=-g,u=-u,C=-C),1-h>1e-6?(d=Math.acos(h),f=Math.sin(d),v=Math.sin((1-t)*d)/f,y=Math.sin(t*d)/f):(v=1-t,y=t),i.x=v*s+y*l,i.y=v*r+y*g,i.z=v*o+y*u,i.w=v*a+y*C,i}integrate(e,t,i,s){s===void 0&&(s=new Fi);const r=e.x*i.x,o=e.y*i.y,a=e.z*i.z,l=this.x,g=this.y,u=this.z,C=this.w,d=t*.5;return s.x+=d*(r*C+o*u-a*g),s.y+=d*(o*C+a*l-r*u),s.z+=d*(a*C+r*g-o*l),s.w+=d*(-r*l-o*g-a*u),s}}const qk=new Y,$k=new Y,eD={SPHERE:1,PLANE:2,BOX:4,COMPOUND:8,CONVEXPOLYHEDRON:16,HEIGHTFIELD:32,PARTICLE:64,CYLINDER:128,TRIMESH:256};class et{constructor(e){e===void 0&&(e={}),this.id=et.idCounter++,this.type=e.type||0,this.boundingSphereRadius=0,this.collisionResponse=e.collisionResponse?e.collisionResponse:!0,this.collisionFilterGroup=e.collisionFilterGroup!==void 0?e.collisionFilterGroup:1,this.collisionFilterMask=e.collisionFilterMask!==void 0?e.collisionFilterMask:-1,this.material=e.material?e.material:null,this.body=null}updateBoundingSphereRadius(){throw`computeBoundingSphereRadius() not implemented for shape type ${this.type}`}volume(){throw`volume() not implemented for shape type ${this.type}`}calculateLocalInertia(e,t){throw`calculateLocalInertia() not implemented for shape type ${this.type}`}calculateWorldAABB(e,t,i,s){throw`calculateWorldAABB() not implemented for shape type ${this.type}`}}et.idCounter=0;et.types=eD;class ji{constructor(e){e===void 0&&(e={}),this.position=new Y,this.quaternion=new Fi,e.position&&this.position.copy(e.position),e.quaternion&&this.quaternion.copy(e.quaternion)}pointToLocal(e,t){return ji.pointToLocalFrame(this.position,this.quaternion,e,t)}pointToWorld(e,t){return ji.pointToWorldFrame(this.position,this.quaternion,e,t)}vectorToWorldFrame(e,t){return t===void 0&&(t=new Y),this.quaternion.vmult(e,t),t}static pointToLocalFrame(e,t,i,s){return s===void 0&&(s=new Y),i.vsub(e,s),t.conjugate(_w),_w.vmult(s,s),s}static pointToWorldFrame(e,t,i,s){return s===void 0&&(s=new Y),t.vmult(i,s),s.vadd(e,s),s}static vectorToWorldFrame(e,t,i){return i===void 0&&(i=new Y),e.vmult(t,i),i}static vectorToLocalFrame(e,t,i,s){return s===void 0&&(s=new Y),t.w*=-1,t.vmult(i,s),t.w*=-1,s}}const _w=new Fi;new Y;new Y;new Y;new Y;new Y,new Y,new Y,new Y,new Y,new Y,new Y,new Y;new Y;new Fi;new _s;new po;new po;new po;new Y;new Y;new Y;new Y;new Y;new Y;new Y;new Y;new Y;new Y;new Fi;new Y;new Y;new Y;new Y;class Kb{constructor(){this.rayFromWorld=new Y,this.rayToWorld=new Y,this.hitNormalWorld=new Y,this.hitPointWorld=new Y,this.hasHit=!1,this.shape=null,this.body=null,this.hitFaceIndex=-1,this.distance=-1,this.shouldStop=!1}reset(){this.rayFromWorld.setZero(),this.rayToWorld.setZero(),this.hitNormalWorld.setZero(),this.hitPointWorld.setZero(),this.hasHit=!1,this.shape=null,this.body=null,this.hitFaceIndex=-1,this.distance=-1,this.shouldStop=!1}abort(){this.shouldStop=!0}set(e,t,i,s,r,o,a){this.rayFromWorld.copy(e),this.rayToWorld.copy(t),this.hitNormalWorld.copy(i),this.hitPointWorld.copy(s),this.shape=r,this.body=o,this.distance=a}}let dM,hM,AM,pM,fM,mM,bM;const Ly={CLOSEST:1,ANY:2,ALL:4};dM=et.types.SPHERE;hM=et.types.PLANE;AM=et.types.BOX;pM=et.types.CYLINDER;fM=et.types.CONVEXPOLYHEDRON;mM=et.types.HEIGHTFIELD;bM=et.types.TRIMESH;class Si{get[dM](){return this._intersectSphere}get[hM](){return this._intersectPlane}get[AM](){return this._intersectBox}get[pM](){return this._intersectConvex}get[fM](){return this._intersectConvex}get[mM](){return this._intersectHeightfield}get[bM](){return this._intersectTrimesh}constructor(e,t){e===void 0&&(e=new Y),t===void 0&&(t=new Y),this.from=e.clone(),this.to=t.clone(),this.direction=new Y,this.precision=1e-4,this.checkCollisionResponse=!0,this.skipBackfaces=!1,this.collisionFilterMask=-1,this.collisionFilterGroup=-1,this.mode=Si.ANY,this.result=new Kb,this.hasHit=!1,this.callback=i=>{}}intersectWorld(e,t){return this.mode=t.mode||Si.ANY,this.result=t.result||new Kb,this.skipBackfaces=!!t.skipBackfaces,this.collisionFilterMask=typeof t.collisionFilterMask<"u"?t.collisionFilterMask:-1,this.collisionFilterGroup=typeof t.collisionFilterGroup<"u"?t.collisionFilterGroup:-1,this.checkCollisionResponse=typeof t.checkCollisionResponse<"u"?t.checkCollisionResponse:!0,t.from&&this.from.copy(t.from),t.to&&this.to.copy(t.to),this.callback=t.callback||(()=>{}),this.hasHit=!1,this.result.reset(),this.updateDirection(),this.getAABB(Jw),Lm.length=0,e.broadphase.aabbQuery(e,Jw,Lm),this.intersectBodies(Lm),this.hasHit}intersectBody(e,t){t&&(this.result=t,this.updateDirection());const i=this.checkCollisionResponse;if(i&&!e.collisionResponse||!(this.collisionFilterGroup&e.collisionFilterMask)||!(e.collisionFilterGroup&this.collisionFilterMask))return;const s=tD,r=nD;for(let o=0,a=e.shapes.length;oe.boundingSphereRadius)return;const a=this[e.type];a&&a.call(this,e,t,i,s,e)}_intersectBox(e,t,i,s,r){return this._intersectConvex(e.convexPolyhedronRepresentation,t,i,s,r)}_intersectPlane(e,t,i,s,r){const o=this.from,a=this.to,l=this.direction,g=new Y(0,0,1);t.vmult(g,g);const u=new Y;o.vsub(i,u);const C=u.dot(g);a.vsub(i,u);const d=u.dot(g);if(C*d>0||o.distanceTo(a)=0&&v<=1&&(o.lerp(a,v,h),h.vsub(i,f),f.normalize(),this.reportIntersection(f,h,r,s,-1)),this.result.shouldStop)return;y>=0&&y<=1&&(o.lerp(a,y,h),h.vsub(i,f),f.normalize(),this.reportIntersection(f,h,r,s,-1))}}_intersectConvex(e,t,i,s,r,o){const a=aD,l=Qw,g=o&&o.faceList||null,u=e.faces,C=e.vertices,d=e.faceNormals,h=this.direction,f=this.from,v=this.to,y=f.distanceTo(v),A=g?g.length:u.length,b=this.result;for(let m=0;!b.shouldStop&&my||this.reportIntersection(a,_i,r,s,B)}}}}_intersectTrimesh(e,t,i,s,r,o){const a=lD,l=dD,g=hD,u=Qw,C=gD,d=cD,h=ID,f=CD,v=uD,y=e.indices;e.vertices;const A=this.from,b=this.to,m=this.direction;g.position.copy(i),g.quaternion.copy(t),ji.vectorToLocalFrame(i,t,m,C),ji.pointToLocalFrame(i,t,A,d),ji.pointToLocalFrame(i,t,b,h),h.x*=e.scale.x,h.y*=e.scale.y,h.z*=e.scale.z,d.x*=e.scale.x,d.y*=e.scale.y,d.z*=e.scale.z,h.vsub(d,C),C.normalize();const B=d.distanceSquared(h);e.tree.rayQuery(this,g,l);for(let S=0,x=l.length;!this.result.shouldStop&&S!==x;S++){const R=l[S];e.getNormal(R,a),e.getVertex(y[R*3],rr),rr.vsub(d,u);const M=C.dot(a),Z=a.dot(u)/M;if(Z<0)continue;C.scale(Z,_i),_i.vadd(d,_i),e.getVertex(y[R*3+1],Vr),e.getVertex(y[R*3+2],Mr);const V=_i.distanceSquared(d);!(Si.pointInTriangle(_i,Vr,rr,Mr)||Si.pointInTriangle(_i,rr,Vr,Mr))||V>B||(ji.vectorToWorldFrame(t,a,v),ji.pointToWorldFrame(i,t,_i,f),this.reportIntersection(v,f,r,s,R))}l.length=0}reportIntersection(e,t,i,s,r){const o=this.from,a=this.to,l=o.distanceTo(t),g=this.result;if(!(this.skipBackfaces&&e.dot(this.direction)>0))switch(g.hitFaceIndex=typeof r<"u"?r:-1,this.mode){case Si.ALL:this.hasHit=!0,g.set(o,a,e,t,i,s,l),g.hasHit=!0,this.callback(g);break;case Si.CLOSEST:(l=0&&(C=r*g-o*a)>=0&&u+CDate.now()-n}new Y;class fo{constructor(e){e===void 0&&(e=[0,0,0,0,0,0,0,0,0]),this.elements=e}identity(){const e=this.elements;e[0]=1,e[1]=0,e[2]=0,e[3]=0,e[4]=1,e[5]=0,e[6]=0,e[7]=0,e[8]=1}setZero(){const e=this.elements;e[0]=0,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=0,e[6]=0,e[7]=0,e[8]=0}setTrace(e){const t=this.elements;t[0]=e.x,t[4]=e.y,t[8]=e.z}getTrace(e){e===void 0&&(e=new K);const t=this.elements;return e.x=t[0],e.y=t[4],e.z=t[8],e}vmult(e,t){t===void 0&&(t=new K);const i=this.elements,s=e.x,r=e.y,o=e.z;return t.x=i[0]*s+i[1]*r+i[2]*o,t.y=i[3]*s+i[4]*r+i[5]*o,t.z=i[6]*s+i[7]*r+i[8]*o,t}smult(e){for(let t=0;t0){const r=1/s;this.x*=r,this.y*=r,this.z*=r}else this.x=0,this.y=0,this.z=0;return s}unit(e){e===void 0&&(e=new K);const t=this.x,i=this.y,s=this.z;let r=Math.sqrt(t*t+i*i+s*s);return r>0?(r=1/r,e.x=t*r,e.y=i*r,e.z=s*r):(e.x=1,e.y=0,e.z=0),e}length(){const e=this.x,t=this.y,i=this.z;return Math.sqrt(e*e+t*t+i*i)}lengthSquared(){return this.dot(this)}distanceTo(e){const t=this.x,i=this.y,s=this.z,r=e.x,o=e.y,a=e.z;return Math.sqrt((r-t)*(r-t)+(o-i)*(o-i)+(a-s)*(a-s))}distanceSquared(e){const t=this.x,i=this.y,s=this.z,r=e.x,o=e.y,a=e.z;return(r-t)*(r-t)+(o-i)*(o-i)+(a-s)*(a-s)}scale(e,t){t===void 0&&(t=new K);const i=this.x,s=this.y,r=this.z;return t.x=e*i,t.y=e*s,t.z=e*r,t}vmul(e,t){return t===void 0&&(t=new K),t.x=e.x*this.x,t.y=e.y*this.y,t.z=e.z*this.z,t}addScaledVector(e,t,i){return i===void 0&&(i=new K),i.x=this.x+e*t.x,i.y=this.y+e*t.y,i.z=this.z+e*t.z,i}dot(e){return this.x*e.x+this.y*e.y+this.z*e.z}isZero(){return this.x===0&&this.y===0&&this.z===0}negate(e){return e===void 0&&(e=new K),e.x=-this.x,e.y=-this.y,e.z=-this.z,e}tangents(e,t){const i=this.length();if(i>0){const s=fD,r=1/i;s.set(this.x*r,this.y*r,this.z*r);const o=mD;Math.abs(s.x)<.9?(o.set(1,0,0),s.cross(o,e)):(o.set(0,1,0),s.cross(o,e)),s.cross(e,t)}else e.set(1,0,0),t.set(0,1,0)}toString(){return`${this.x},${this.y},${this.z}`}toArray(){return[this.x,this.y,this.z]}copy(e){return this.x=e.x,this.y=e.y,this.z=e.z,this}lerp(e,t,i){const s=this.x,r=this.y,o=this.z;i.x=s+(e.x-s)*t,i.y=r+(e.y-r)*t,i.z=o+(e.z-o)*t}almostEquals(e,t){return t===void 0&&(t=1e-6),!(Math.abs(this.x-e.x)>t||Math.abs(this.y-e.y)>t||Math.abs(this.z-e.z)>t)}almostZero(e){return e===void 0&&(e=1e-6),!(Math.abs(this.x)>e||Math.abs(this.y)>e||Math.abs(this.z)>e)}isAntiparallelTo(e,t){return this.negate(jw),jw.almostEquals(e,t)}clone(){return new K(this.x,this.y,this.z)}}K.ZERO=new K(0,0,0);K.UNIT_X=new K(1,0,0);K.UNIT_Y=new K(0,1,0);K.UNIT_Z=new K(0,0,1);const fD=new K,mD=new K,jw=new K;class Js{constructor(e){e===void 0&&(e={}),this.lowerBound=new K,this.upperBound=new K,e.lowerBound&&this.lowerBound.copy(e.lowerBound),e.upperBound&&this.upperBound.copy(e.upperBound)}setFromPoints(e,t,i,s){const r=this.lowerBound,o=this.upperBound,a=i;r.copy(e[0]),a&&a.vmult(r,r),o.copy(r);for(let l=1;lo.x&&(o.x=g.x),g.xo.y&&(o.y=g.y),g.yo.z&&(o.z=g.z),g.z=r.x&&t.y<=s.y&&i.y>=r.y&&t.z<=s.z&&i.z>=r.z}getCorners(e,t,i,s,r,o,a,l){const g=this.lowerBound,u=this.upperBound;e.copy(g),t.set(u.x,g.y,g.z),i.set(u.x,u.y,g.z),s.set(g.x,u.y,u.z),r.set(u.x,g.y,u.z),o.set(g.x,u.y,g.z),a.set(g.x,g.y,u.z),l.copy(u)}toLocalFrame(e,t){const i=$w,s=i[0],r=i[1],o=i[2],a=i[3],l=i[4],g=i[5],u=i[6],C=i[7];this.getCorners(s,r,o,a,l,g,u,C);for(let d=0;d!==8;d++){const h=i[d];e.pointToLocal(h,h)}return t.setFromPoints(i)}toWorldFrame(e,t){const i=$w,s=i[0],r=i[1],o=i[2],a=i[3],l=i[4],g=i[5],u=i[6],C=i[7];this.getCorners(s,r,o,a,l,g,u,C);for(let d=0;d!==8;d++){const h=i[d];e.pointToWorld(h,h)}return t.setFromPoints(i)}overlapsRay(e){const{direction:t,from:i}=e,s=1/t.x,r=1/t.y,o=1/t.z,a=(this.lowerBound.x-i.x)*s,l=(this.upperBound.x-i.x)*s,g=(this.lowerBound.y-i.y)*r,u=(this.upperBound.y-i.y)*r,C=(this.lowerBound.z-i.z)*o,d=(this.upperBound.z-i.z)*o,h=Math.max(Math.max(Math.min(a,l),Math.min(g,u)),Math.min(C,d)),f=Math.min(Math.min(Math.max(a,l),Math.max(g,u)),Math.max(C,d));return!(f<0||h>f)}}const qw=new K,$w=[new K,new K,new K,new K,new K,new K,new K,new K];class Yi{constructor(e,t,i,s){e===void 0&&(e=0),t===void 0&&(t=0),i===void 0&&(i=0),s===void 0&&(s=1),this.x=e,this.y=t,this.z=i,this.w=s}set(e,t,i,s){return this.x=e,this.y=t,this.z=i,this.w=s,this}toString(){return`${this.x},${this.y},${this.z},${this.w}`}toArray(){return[this.x,this.y,this.z,this.w]}setFromAxisAngle(e,t){const i=Math.sin(t*.5);return this.x=e.x*i,this.y=e.y*i,this.z=e.z*i,this.w=Math.cos(t*.5),this}toAxisAngle(e){e===void 0&&(e=new K),this.normalize();const t=2*Math.acos(this.w),i=Math.sqrt(1-this.w*this.w);return i<.001?(e.x=this.x,e.y=this.y,e.z=this.z):(e.x=this.x/i,e.y=this.y/i,e.z=this.z/i),[e,t]}setFromVectors(e,t){if(e.isAntiparallelTo(t)){const i=bD,s=vD;e.tangents(i,s),this.setFromAxisAngle(i,Math.PI)}else{const i=e.cross(t);this.x=i.x,this.y=i.y,this.z=i.z,this.w=Math.sqrt(e.length()**2*t.length()**2)+e.dot(t),this.normalize()}return this}mult(e,t){t===void 0&&(t=new Yi);const i=this.x,s=this.y,r=this.z,o=this.w,a=e.x,l=e.y,g=e.z,u=e.w;return t.x=i*u+o*a+s*g-r*l,t.y=s*u+o*l+r*a-i*g,t.z=r*u+o*g+i*l-s*a,t.w=o*u-i*a-s*l-r*g,t}inverse(e){e===void 0&&(e=new Yi);const t=this.x,i=this.y,s=this.z,r=this.w;this.conjugate(e);const o=1/(t*t+i*i+s*s+r*r);return e.x*=o,e.y*=o,e.z*=o,e.w*=o,e}conjugate(e){return e===void 0&&(e=new Yi),e.x=-this.x,e.y=-this.y,e.z=-this.z,e.w=this.w,e}normalize(){let e=Math.sqrt(this.x*this.x+this.y*this.y+this.z*this.z+this.w*this.w);return e===0?(this.x=0,this.y=0,this.z=0,this.w=0):(e=1/e,this.x*=e,this.y*=e,this.z*=e,this.w*=e),this}normalizeFast(){const e=(3-(this.x*this.x+this.y*this.y+this.z*this.z+this.w*this.w))/2;return e===0?(this.x=0,this.y=0,this.z=0,this.w=0):(this.x*=e,this.y*=e,this.z*=e,this.w*=e),this}vmult(e,t){t===void 0&&(t=new K);const i=e.x,s=e.y,r=e.z,o=this.x,a=this.y,l=this.z,g=this.w,u=g*i+a*r-l*s,C=g*s+l*i-o*r,d=g*r+o*s-a*i,h=-o*i-a*s-l*r;return t.x=u*g+h*-o+C*-l-d*-a,t.y=C*g+h*-a+d*-o-u*-l,t.z=d*g+h*-l+u*-a-C*-o,t}copy(e){return this.x=e.x,this.y=e.y,this.z=e.z,this.w=e.w,this}toEuler(e,t){t===void 0&&(t="YZX");let i,s,r;const o=this.x,a=this.y,l=this.z,g=this.w;switch(t){case"YZX":const u=o*a+l*g;if(u>.499&&(i=2*Math.atan2(o,g),s=Math.PI/2,r=0),u<-.499&&(i=-2*Math.atan2(o,g),s=-Math.PI/2,r=0),i===void 0){const C=o*o,d=a*a,h=l*l;i=Math.atan2(2*a*g-2*o*l,1-2*d-2*h),s=Math.asin(2*u),r=Math.atan2(2*o*g-2*a*l,1-2*C-2*h)}break;default:throw new Error(`Euler order ${t} not supported yet.`)}e.y=i,e.z=s,e.x=r}setFromEuler(e,t,i,s){s===void 0&&(s="XYZ");const r=Math.cos(e/2),o=Math.cos(t/2),a=Math.cos(i/2),l=Math.sin(e/2),g=Math.sin(t/2),u=Math.sin(i/2);return s==="XYZ"?(this.x=l*o*a+r*g*u,this.y=r*g*a-l*o*u,this.z=r*o*u+l*g*a,this.w=r*o*a-l*g*u):s==="YXZ"?(this.x=l*o*a+r*g*u,this.y=r*g*a-l*o*u,this.z=r*o*u-l*g*a,this.w=r*o*a+l*g*u):s==="ZXY"?(this.x=l*o*a-r*g*u,this.y=r*g*a+l*o*u,this.z=r*o*u+l*g*a,this.w=r*o*a-l*g*u):s==="ZYX"?(this.x=l*o*a-r*g*u,this.y=r*g*a+l*o*u,this.z=r*o*u-l*g*a,this.w=r*o*a+l*g*u):s==="YZX"?(this.x=l*o*a+r*g*u,this.y=r*g*a+l*o*u,this.z=r*o*u-l*g*a,this.w=r*o*a-l*g*u):s==="XZY"&&(this.x=l*o*a-r*g*u,this.y=r*g*a-l*o*u,this.z=r*o*u+l*g*a,this.w=r*o*a+l*g*u),this}clone(){return new Yi(this.x,this.y,this.z,this.w)}slerp(e,t,i){i===void 0&&(i=new Yi);const s=this.x,r=this.y,o=this.z,a=this.w;let l=e.x,g=e.y,u=e.z,C=e.w,d,h,f,v,y;return h=s*l+r*g+o*u+a*C,h<0&&(h=-h,l=-l,g=-g,u=-u,C=-C),1-h>1e-6?(d=Math.acos(h),f=Math.sin(d),v=Math.sin((1-t)*d)/f,y=Math.sin(t*d)/f):(v=1-t,y=t),i.x=v*s+y*l,i.y=v*r+y*g,i.z=v*o+y*u,i.w=v*a+y*C,i}integrate(e,t,i,s){s===void 0&&(s=new Yi);const r=e.x*i.x,o=e.y*i.y,a=e.z*i.z,l=this.x,g=this.y,u=this.z,C=this.w,d=t*.5;return s.x+=d*(r*C+o*u-a*g),s.y+=d*(o*C+a*l-r*u),s.z+=d*(a*C+r*g-o*l),s.w+=d*(-r*l-o*g-a*u),s}}const bD=new K,vD=new K,yD={SPHERE:1,PLANE:2,BOX:4,COMPOUND:8,CONVEXPOLYHEDRON:16,HEIGHTFIELD:32,PARTICLE:64,CYLINDER:128,TRIMESH:256};class tt{constructor(e){e===void 0&&(e={}),this.id=tt.idCounter++,this.type=e.type||0,this.boundingSphereRadius=0,this.collisionResponse=e.collisionResponse?e.collisionResponse:!0,this.collisionFilterGroup=e.collisionFilterGroup!==void 0?e.collisionFilterGroup:1,this.collisionFilterMask=e.collisionFilterMask!==void 0?e.collisionFilterMask:-1,this.material=e.material?e.material:null,this.body=null}updateBoundingSphereRadius(){throw`computeBoundingSphereRadius() not implemented for shape type ${this.type}`}volume(){throw`volume() not implemented for shape type ${this.type}`}calculateLocalInertia(e,t){throw`calculateLocalInertia() not implemented for shape type ${this.type}`}calculateWorldAABB(e,t,i,s){throw`calculateWorldAABB() not implemented for shape type ${this.type}`}}tt.idCounter=0;tt.types=yD;class qi{constructor(e){e===void 0&&(e={}),this.position=new K,this.quaternion=new Yi,e.position&&this.position.copy(e.position),e.quaternion&&this.quaternion.copy(e.quaternion)}pointToLocal(e,t){return qi.pointToLocalFrame(this.position,this.quaternion,e,t)}pointToWorld(e,t){return qi.pointToWorldFrame(this.position,this.quaternion,e,t)}vectorToWorldFrame(e,t){return t===void 0&&(t=new K),this.quaternion.vmult(e,t),t}static pointToLocalFrame(e,t,i,s){return s===void 0&&(s=new K),i.vsub(e,s),t.conjugate(eS),eS.vmult(s,s),s}static pointToWorldFrame(e,t,i,s){return s===void 0&&(s=new K),t.vmult(i,s),s.vadd(e,s),s}static vectorToWorldFrame(e,t,i){return i===void 0&&(i=new K),e.vmult(t,i),i}static vectorToLocalFrame(e,t,i,s){return s===void 0&&(s=new K),t.w*=-1,t.vmult(i,s),t.w*=-1,s}}const eS=new Yi;new K;new K;new K;new K;new K,new K,new K,new K,new K,new K,new K,new K;new K;new Yi;new Js;new fo;new fo;new fo;new K;new K;new K;new K;new K;new K;new K;new K;new K;new K;new Yi;new K;new K;new K;new K;class zb{constructor(){this.rayFromWorld=new K,this.rayToWorld=new K,this.hitNormalWorld=new K,this.hitPointWorld=new K,this.hasHit=!1,this.shape=null,this.body=null,this.hitFaceIndex=-1,this.distance=-1,this.shouldStop=!1}reset(){this.rayFromWorld.setZero(),this.rayToWorld.setZero(),this.hitNormalWorld.setZero(),this.hitPointWorld.setZero(),this.hasHit=!1,this.shape=null,this.body=null,this.hitFaceIndex=-1,this.distance=-1,this.shouldStop=!1}abort(){this.shouldStop=!0}set(e,t,i,s,r,o,a){this.rayFromWorld.copy(e),this.rayToWorld.copy(t),this.hitNormalWorld.copy(i),this.hitPointWorld.copy(s),this.shape=r,this.body=o,this.distance=a}}let vM,yM,GM,BM,ZM,wM,SM;const Ey={CLOSEST:1,ANY:2,ALL:4};vM=tt.types.SPHERE;yM=tt.types.PLANE;GM=tt.types.BOX;BM=tt.types.CYLINDER;ZM=tt.types.CONVEXPOLYHEDRON;wM=tt.types.HEIGHTFIELD;SM=tt.types.TRIMESH;class xi{get[vM](){return this._intersectSphere}get[yM](){return this._intersectPlane}get[GM](){return this._intersectBox}get[BM](){return this._intersectConvex}get[ZM](){return this._intersectConvex}get[wM](){return this._intersectHeightfield}get[SM](){return this._intersectTrimesh}constructor(e,t){e===void 0&&(e=new K),t===void 0&&(t=new K),this.from=e.clone(),this.to=t.clone(),this.direction=new K,this.precision=1e-4,this.checkCollisionResponse=!0,this.skipBackfaces=!1,this.collisionFilterMask=-1,this.collisionFilterGroup=-1,this.mode=xi.ANY,this.result=new zb,this.hasHit=!1,this.callback=i=>{}}intersectWorld(e,t){return this.mode=t.mode||xi.ANY,this.result=t.result||new zb,this.skipBackfaces=!!t.skipBackfaces,this.collisionFilterMask=typeof t.collisionFilterMask<"u"?t.collisionFilterMask:-1,this.collisionFilterGroup=typeof t.collisionFilterGroup<"u"?t.collisionFilterGroup:-1,this.checkCollisionResponse=typeof t.checkCollisionResponse<"u"?t.checkCollisionResponse:!0,t.from&&this.from.copy(t.from),t.to&&this.to.copy(t.to),this.callback=t.callback||(()=>{}),this.hasHit=!1,this.result.reset(),this.updateDirection(),this.getAABB(tS),Tm.length=0,e.broadphase.aabbQuery(e,tS,Tm),this.intersectBodies(Tm),this.hasHit}intersectBody(e,t){t&&(this.result=t,this.updateDirection());const i=this.checkCollisionResponse;if(i&&!e.collisionResponse||!(this.collisionFilterGroup&e.collisionFilterMask)||!(e.collisionFilterGroup&this.collisionFilterMask))return;const s=GD,r=BD;for(let o=0,a=e.shapes.length;oe.boundingSphereRadius)return;const a=this[e.type];a&&a.call(this,e,t,i,s,e)}_intersectBox(e,t,i,s,r){return this._intersectConvex(e.convexPolyhedronRepresentation,t,i,s,r)}_intersectPlane(e,t,i,s,r){const o=this.from,a=this.to,l=this.direction,g=new K(0,0,1);t.vmult(g,g);const u=new K;o.vsub(i,u);const C=u.dot(g);a.vsub(i,u);const d=u.dot(g);if(C*d>0||o.distanceTo(a)=0&&v<=1&&(o.lerp(a,v,h),h.vsub(i,f),f.normalize(),this.reportIntersection(f,h,r,s,-1)),this.result.shouldStop)return;y>=0&&y<=1&&(o.lerp(a,y,h),h.vsub(i,f),f.normalize(),this.reportIntersection(f,h,r,s,-1))}}_intersectConvex(e,t,i,s,r,o){const a=RD,l=iS,g=o&&o.faceList||null,u=e.faces,C=e.vertices,d=e.faceNormals,h=this.direction,f=this.from,v=this.to,y=f.distanceTo(v),A=g?g.length:u.length,b=this.result;for(let m=0;!b.shouldStop&&my||this.reportIntersection(a,Ji,r,s,B)}}}}_intersectTrimesh(e,t,i,s,r,o){const a=WD,l=FD,g=YD,u=iS,C=VD,d=MD,h=ND,f=XD,v=HD,y=e.indices;e.vertices;const A=this.from,b=this.to,m=this.direction;g.position.copy(i),g.quaternion.copy(t),qi.vectorToLocalFrame(i,t,m,C),qi.pointToLocalFrame(i,t,A,d),qi.pointToLocalFrame(i,t,b,h),h.x*=e.scale.x,h.y*=e.scale.y,h.z*=e.scale.z,d.x*=e.scale.x,d.y*=e.scale.y,d.z*=e.scale.z,h.vsub(d,C),C.normalize();const B=d.distanceSquared(h);e.tree.rayQuery(this,g,l);for(let S=0,x=l.length;!this.result.shouldStop&&S!==x;S++){const R=l[S];e.getNormal(R,a),e.getVertex(y[R*3],or),or.vsub(d,u);const M=C.dot(a),Z=a.dot(u)/M;if(Z<0)continue;C.scale(Z,Ji),Ji.vadd(d,Ji),e.getVertex(y[R*3+1],Nr),e.getVertex(y[R*3+2],Hr);const V=Ji.distanceSquared(d);!(xi.pointInTriangle(Ji,Nr,or,Hr)||xi.pointInTriangle(Ji,or,Nr,Hr))||V>B||(qi.vectorToWorldFrame(t,a,v),qi.pointToWorldFrame(i,t,Ji,f),this.reportIntersection(v,f,r,s,R))}l.length=0}reportIntersection(e,t,i,s,r){const o=this.from,a=this.to,l=o.distanceTo(t),g=this.result;if(!(this.skipBackfaces&&e.dot(this.direction)>0))switch(g.hitFaceIndex=typeof r<"u"?r:-1,this.mode){case xi.ALL:this.hasHit=!0,g.set(o,a,e,t,i,s,l),g.hasHit=!0,this.callback(g);break;case xi.CLOSEST:(l=0&&(C=r*g-o*a)>=0&&u+CDate.now()-n}new K;const zD=k.createContext(null),LD=()=>k.useContext(zD),xM=k.createContext(null),ED=()=>{const n=k.useContext(xM);if(!n)throw new Error("Physics context not found. @react-three/cannon & components can only be used within a Physics provider");return n};new H(1,1,1);new H;new _e;const sS=new zt;function TD(n){const e=k.useRef(null);return n&&typeof n!="function"?n:e}function rS(n){return n.charAt(0).toUpperCase()+n.slice(1)}function ci(n,e){const t=e===void 0?"":`/${e}`;return typeof n=="function"?null:n&&n.current&&`${n.current.uuid}${t}`}const kD=new Xl,DD=new Mn,UD=n=>e=>n(kD.setFromQuaternion(DD.fromArray(e)).toArray());let RM=0;function Dm(n,e,t,i,s,r){return r===void 0&&(r="bodies"),o=>{const a=RM++;t[a]={[i]:o};const l=ci(n,s);return l&&e.subscribe({props:{id:a,target:r,type:i},uuid:l}),()=>{delete t[a],e.unsubscribe({props:a})}}}function oS(n,e){let{position:t=[0,0,0],rotation:i=[0,0,0],userData:s={}}=e;n.userData=s,n.position.set(...t),n.rotation.set(...i),n.updateMatrix()}function aS(n,e,t){let{onCollide:i,onCollideBegin:s,onCollideEnd:r}=e;n[t]={collide:i,collideBegin:s,collideEnd:r}}function PD(n,e,t,i,s){i===void 0&&(i=null),s===void 0&&(s=[]);const r=TD(i),{events:o,refs:a,scaleOverrides:l,subscriptions:g,worker:u}=ED(),C=LD();k.useLayoutEffect(()=>{r.current||(r.current=new zt);const h=r.current,f=u,v=h instanceof oc?(h.instanceMatrix.setUsage(SW),h.count):1,y=h instanceof oc?new Array(v).fill(0).map((b,m)=>`${h.uuid}/${m}`):[h.uuid],A=h instanceof oc?y.map((b,m)=>{const B=e(m);return oS(sS,B),h.setMatrixAt(m,sS.matrix),h.instanceMatrix.needsUpdate=!0,a[b]=h,C?.add(b,B,n),aS(o,B,b),{...B,args:t(B.args)}}):y.map((b,m)=>{const B=e(m);return oS(h,B),a[b]=h,C?.add(b,B,n),aS(o,B,b),{...B,args:t(B.args)}});return f.addBodies({props:A.map(b=>{let{onCollide:m,onCollideBegin:B,onCollideEnd:S,...x}=b;return{onCollide:!!m,...x}}),type:n,uuid:y}),()=>{y.forEach(b=>{delete a[b],C?.remove(b),delete o[b]}),f.removeBodies({uuid:y})}},s);const d=k.useMemo(()=>{const h=(m,B)=>{const S=`set${rS(m)}`;return{set:x=>{const R=ci(r,B);R&&u[S]({props:x,uuid:R})},subscribe:Dm(r,u,g,m,B)}},f=m=>({copy:S=>{let{w:x,x:R,y:M,z:Z}=S;const V=ci(r,m);V&&u.setQuaternion({props:[R,M,Z,x],uuid:V})},set:(S,x,R,M)=>{const Z=ci(r,m);Z&&u.setQuaternion({props:[S,x,R,M],uuid:Z})},subscribe:Dm(r,u,g,"quaternion",m)}),v=m=>({copy:B=>{let{x:S,y:x,z:R}=B;const M=ci(r,m);M&&u.setRotation({props:[S,x,R],uuid:M})},set:(B,S,x)=>{const R=ci(r,m);R&&u.setRotation({props:[B,S,x],uuid:R})},subscribe:B=>{const S=RM++,x="bodies",R="quaternion",M=ci(r,m);return g[S]={[R]:UD(B)},M&&u.subscribe({props:{id:S,target:x,type:R},uuid:M}),()=>{delete g[S],u.unsubscribe({props:S})}}}),y=(m,B)=>{const S=`set${rS(m)}`;return{copy:x=>{let{x:R,y:M,z:Z}=x;const V=ci(r,B);V&&u[S]({props:[R,M,Z],uuid:V})},set:(x,R,M)=>{const Z=ci(r,B);Z&&u[S]({props:[x,R,M],uuid:Z})},subscribe:Dm(r,u,g,m,B)}};function A(m){return{allowSleep:h("allowSleep",m),angularDamping:h("angularDamping",m),angularFactor:y("angularFactor",m),angularVelocity:y("angularVelocity",m),applyForce(B,S){const x=ci(r,m);x&&u.applyForce({props:[B,S],uuid:x})},applyImpulse(B,S){const x=ci(r,m);x&&u.applyImpulse({props:[B,S],uuid:x})},applyLocalForce(B,S){const x=ci(r,m);x&&u.applyLocalForce({props:[B,S],uuid:x})},applyLocalImpulse(B,S){const x=ci(r,m);x&&u.applyLocalImpulse({props:[B,S],uuid:x})},applyTorque(B){const S=ci(r,m);S&&u.applyTorque({props:[B],uuid:S})},collisionFilterGroup:h("collisionFilterGroup",m),collisionFilterMask:h("collisionFilterMask",m),collisionResponse:h("collisionResponse",m),fixedRotation:h("fixedRotation",m),isTrigger:h("isTrigger",m),linearDamping:h("linearDamping",m),linearFactor:y("linearFactor",m),mass:h("mass",m),material:h("material",m),position:y("position",m),quaternion:f(m),rotation:v(m),scaleOverride(B){const S=ci(r,m);S&&(l[S]=new H(...B))},sleep(){const B=ci(r,m);B&&u.sleep({uuid:B})},sleepSpeedLimit:h("sleepSpeedLimit",m),sleepTimeLimit:h("sleepTimeLimit",m),userData:h("userData",m),velocity:y("velocity",m),wakeUp(){const B=ci(r,m);B&&u.wakeUp({uuid:B})}}}const b={};return{...A(void 0),at:m=>b[m]||(b[m]=A(m))}},[]);return[r,d]}function WM(n,e,t){return PD("Sphere",n,function(i){if(i===void 0&&(i=[1]),!Array.isArray(i))throw new Error("useSphere args must be an array");return[i[0]]},e,t)}const _D=new H,JD=new H(1,1,1),OD=new Mn,Zh=new _e;function lS(n,e,t,i,s){return i===void 0&&(i=JD),n!==void 0?(Zh.compose(_D.fromArray(e,n*3),OD.fromArray(t,n*4),i),s&&(s.matrixAutoUpdate=!1,s.matrix.copy(Zh)),Zh):Zh.identity()}const QD=()=>{const n=[];return e=>n.includes(e)?!1:!!n.push(e)};function jD(n){let{allowSleep:e=!1,axisIndex:t=0,broadphase:i="Naive",children:s,defaultContactMaterial:r={contactEquationStiffness:1e6},frictionGravity:o=null,gravity:a=[0,-9.81,0],isPaused:l=!1,iterations:g=5,maxSubSteps:u=10,quatNormalizeFast:C=!1,quatNormalizeSkip:d=0,shouldInvalidate:h=!0,size:f=1e3,solver:v="GS",stepSize:y=1/60,tolerance:A=.001}=n;const{invalidate:b}=as(),[{bodies:m,events:B,refs:S,scaleOverrides:x,subscriptions:R,worker:M}]=k.useState(()=>({bodies:{},events:{},refs:{},scaleOverrides:{},subscriptions:{},worker:new Jk({allowSleep:e,axisIndex:t,broadphase:i,defaultContactMaterial:r,frictionGravity:o,gravity:a,iterations:g,quatNormalizeFast:C,quatNormalizeSkip:d,size:f,solver:v,tolerance:A})}));let Z=0;const V=k.useCallback((Ce,z)=>{l||(Z+=z,M.step({maxSubSteps:u,stepSize:y,timeSinceLastCalled:Z}),Z=0)},[l,u,y]),N=Ce=>{var z;let{body:Q,contact:{bi:J,bj:le,...se},target:te,...ge}=Ce;const Ze=(z=B[te])==null?void 0:z.collide;Ze&&Ze({body:S[Q],contact:{bi:S[J],bj:S[le],...se},target:S[te],...ge})},P=Ce=>{var z,Q;let{bodyA:J,bodyB:le}=Ce;const se=(z=B[J])==null?void 0:z.collideBegin;se&&se({body:S[le],op:"event",target:S[J],type:"collideBegin"});const te=(Q=B[le])==null?void 0:Q.collideBegin;te&&te({body:S[J],op:"event",target:S[le],type:"collideBegin"})},U=Ce=>{var z,Q;let{bodyA:J,bodyB:le}=Ce;const se=(z=B[J])==null?void 0:z.collideEnd;se&&se({body:S[le],op:"event",target:S[J],type:"collideEnd"});const te=(Q=B[le])==null?void 0:Q.collideEnd;te&&te({body:S[J],op:"event",target:S[le],type:"collideEnd"})},q=Ce=>{let{active:z,bodies:Q=[],observations:J,positions:le,quaternions:se}=Ce;for(let te=0;te{let[ge,Ze,Re]=te;const ot=(R[ge]||{})[Re];ot&&ot(Ze)}),!!z){for(const te of Object.values(S).filter(QD()))if(te instanceof oc)for(let ge=0;ge{var z;let{body:Q,ray:{uuid:J,...le},...se}=Ce;const te=(z=B[J])==null?void 0:z.rayhit;te&&te({body:Q?S[Q]:null,ray:{uuid:J,...le},...se})};bC(V),k.useEffect(()=>(M.connect(),M.init(),M.on("collide",N),M.on("collideBegin",P),M.on("collideEnd",U),M.on("frame",q),M.on("rayhit",ie),()=>{M.terminate(),M.removeAllListeners()}),[]),k.useEffect(()=>{M.axisIndex=t},[t]),k.useEffect(()=>{M.broadphase=i},[i]),k.useEffect(()=>{M.gravity=a},[a]),k.useEffect(()=>{M.iterations=g},[g]),k.useEffect(()=>{M.tolerance=A},[A]);const he=k.useMemo(()=>({bodies:m,events:B,refs:S,scaleOverrides:x,subscriptions:R,worker:M}),[m,B,S,R,M]);return E.jsx(xM.Provider,{value:he,children:s})}/** + `)+c.join(" > ")}return null},t.getPublicRootInstance=function(c){if(c=c.current,!c.child)return null;switch(c.child.tag){case 5:return he(c.child.stateNode);default:return c.child.stateNode}},t.injectIntoDevTools=function(c){if(c={bundleType:c.bundleType,version:c.version,rendererPackageName:c.rendererPackageName,rendererConfig:c.rendererConfig,overrideHookState:null,overrideHookStateDeletePath:null,overrideHookStateRenamePath:null,overrideProps:null,overridePropsDeletePath:null,overridePropsRenamePath:null,setErrorHandler:null,setSuspenseHandler:null,scheduleUpdate:null,currentDispatcherRef:a.ReactCurrentDispatcher,findHostInstanceByFiber:X5,findFiberByHostInstance:c.findFiberByHostInstance||F5,findHostInstancesForRefresh:null,scheduleRefresh:null,scheduleRoot:null,setRefreshHandler:null,getCurrentFiber:null,reconcilerVersion:"18.0.0-fc46dba67-20220329"},typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u")c=!1;else{var I=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(I.isDisabled||!I.supportsFiber)c=!0;else{try{wC=I.inject(c),yr=I}catch{}c=!!I.checkDCE}}return c},t.isAlreadyRendering=function(){return!1},t.observeVisibleRects=function(c,I,p,G){if(!Ct)throw Error(o(363));c=uf(c,I);var w=Ee(c,p,G).disconnect;return{disconnect:function(){w()}}},t.registerMutableSourceForHydration=function(c,I){var p=I._getVersion;p=p(I._source),c.mutableSourceEagerHydrationData==null?c.mutableSourceEagerHydrationData=[I,p]:c.mutableSourceEagerHydrationData.push(I,p)},t.runWithPriority=function(c,I){var p=kt;try{return kt=c,I()}finally{kt=p}},t.shouldError=function(){return null},t.shouldSuspend=function(){return!1},t.updateContainer=function(c,I,p,G){var w=I.current,W=Mi(),E=zo(w);return p=BB(p),I.context===null?I.context=p:I.pendingContext=p,I=Or(W,E),I.payload={element:c},G=G===void 0?null:G,G!==null&&(I.callback=G),Fo(w,I),c=Ms(w,E,W),c!==null&&VC(c,w,E),E},t};KV.exports=UT;var PT=KV.exports;const _T=Db(PT);function EV(n,e,t=(i,s)=>i===s){if(n===e)return!0;if(!n||!e)return!1;const i=n.length;if(e.length!==i)return!1;for(let s=0;ss.response=r).then(()=>{i.lifespan&&i.lifespan>0&&setTimeout(()=>{const r=uo.indexOf(s);r!==-1&&uo.splice(r,1)},i.lifespan)}).catch(r=>s.error=r)};if(uo.push(s),!t)throw s.promise}const JT=(n,e,t)=>TV(n,e,!1,t),OT=(n,e,t)=>void TV(n,e,!0,t),QT=n=>{if(n===void 0||n.length===0)uo.splice(0,uo.length);else{const e=uo.find(t=>EV(n,t.keys,t.equal));if(e){const t=uo.indexOf(e);t!==-1&&uo.splice(t,1)}}},Hy={},kV=n=>void Object.assign(Hy,n);function jT(n,e){function t(u,{args:C=[],attach:d,...h},f){let v=`${u[0].toUpperCase()}${u.slice(1)}`,y;if(u==="primitive"){if(h.object===void 0)throw new Error("R3F: Primitives without 'object' are invalid!");const A=h.object;y=Sg(A,{type:u,root:f,attach:d,primitive:!0})}else{const A=Hy[v];if(!A)throw new Error(`R3F: ${v} is not part of the THREE namespace! Did you forget to extend? See: https://docs.pmnd.rs/react-three-fiber/api/objects#using-3rd-party-objects-declaratively`);if(!Array.isArray(C))throw new Error("R3F: The args prop must be an array!");y=Sg(new A(...C),{type:u,root:f,attach:d,memoizedProps:{args:C}})}return y.__r3f.attach===void 0&&(y instanceof Gt?y.__r3f.attach="geometry":y instanceof ei&&(y.__r3f.attach="material")),v!=="inject"&&Hm(y,h),y}function i(u,C){let d=!1;if(C){var h,f;(h=C.__r3f)!=null&&h.attach?Nm(u,C,C.__r3f.attach):C.isObject3D&&u.isObject3D&&(u.add(C),d=!0),d||(f=u.__r3f)==null||f.objects.push(C),C.__r3f||Sg(C,{}),C.__r3f.parent=u,Fb(C),xg(C)}}function s(u,C,d){let h=!1;if(C){var f,v;if((f=C.__r3f)!=null&&f.attach)Nm(u,C,C.__r3f.attach);else if(C.isObject3D&&u.isObject3D){C.parent=u,C.dispatchEvent({type:"added"});const y=u.children.filter(b=>b!==C),A=y.indexOf(d);u.children=[...y.slice(0,A),C,...y.slice(A)],h=!0}h||(v=u.__r3f)==null||v.objects.push(C),C.__r3f||Sg(C,{}),C.__r3f.parent=u,Fb(C),xg(C)}}function r(u,C,d=!1){u&&[...u].forEach(h=>o(C,h,d))}function o(u,C,d){if(C){var h,f,v;if(C.__r3f&&(C.__r3f.parent=null),(h=u.__r3f)!=null&&h.objects&&(u.__r3f.objects=u.__r3f.objects.filter(B=>B!==C)),(f=C.__r3f)!=null&&f.attach)Nw(u,C,C.__r3f.attach);else if(C.isObject3D&&u.isObject3D){var y;u.remove(C),(y=C.__r3f)!=null&&y.root&&sk(C.__r3f.root,C)}const b=(v=C.__r3f)==null?void 0:v.primitive,m=d===void 0?C.dispose!==null&&!b:d;if(!b){var A;r((A=C.__r3f)==null?void 0:A.objects,C,m),r(C.children,C,m)}C.__r3f&&(delete C.__r3f.root,delete C.__r3f.objects,delete C.__r3f.handlers,delete C.__r3f.memoizedProps,b||delete C.__r3f),m&&C.dispose&&C.type!=="Scene"&&Hb.unstable_scheduleCallback(Hb.unstable_IdlePriority,()=>{try{C.dispose()}catch{}}),xg(u)}}function a(u,C,d,h){var f;const v=(f=u.__r3f)==null?void 0:f.parent;if(!v)return;const y=t(C,d,u.__r3f.root);if(u.children){for(const A of u.children)A.__r3f&&i(y,A);u.children=u.children.filter(A=>!A.__r3f)}u.__r3f.objects.forEach(A=>i(y,A)),u.__r3f.objects=[],u.__r3f.autoRemovedBeforeAppend||o(v,u),y.parent&&(y.__r3f.autoRemovedBeforeAppend=!0),i(v,y),y.raycast&&y.__r3f.eventCount&&y.__r3f.root.getState().internal.interaction.push(y),[h,h.alternate].forEach(A=>{A!==null&&(A.stateNode=y,A.ref&&(typeof A.ref=="function"?A.ref(y):A.ref.current=y))})}const l=()=>console.warn("Text is not allowed in the R3F tree! This could be stray whitespace or characters.");return{reconciler:_T({createInstance:t,removeChild:o,appendChild:i,appendInitialChild:i,insertBefore:s,supportsMutation:!0,isPrimaryRenderer:!1,supportsPersistence:!1,supportsHydration:!1,noTimeout:-1,appendChildToContainer:(u,C)=>{if(!C)return;const d=u.getState().scene;d.__r3f&&(d.__r3f.root=u,i(d,C))},removeChildFromContainer:(u,C)=>{C&&o(u.getState().scene,C)},insertInContainerBefore:(u,C,d)=>{if(!C||!d)return;const h=u.getState().scene;h.__r3f&&s(h,C,d)},getRootHostContext:()=>null,getChildHostContext:u=>u,finalizeInitialChildren(u){var C;return!!((C=u?.__r3f)!=null?C:{}).handlers},prepareUpdate(u,C,d,h){if(u.__r3f.primitive&&h.object&&h.object!==u)return[!0];{const{args:f=[],children:v,...y}=h,{args:A=[],children:b,...m}=d;if(!Array.isArray(f))throw new Error("R3F: the args prop must be an array!");if(f.some((S,x)=>S!==A[x]))return[!0];const B=QV(u,y,m,!0);return B.changes.length?[!1,B]:null}},commitUpdate(u,[C,d],h,f,v,y){C?a(u,h,v,y):Hm(u,d)},commitMount(u,C,d,h){var f;const v=(f=u.__r3f)!=null?f:{};u.raycast&&v.handlers&&v.eventCount&&u.__r3f.root.getState().internal.interaction.push(u)},getPublicInstance:u=>u,prepareForCommit:()=>null,preparePortalMount:u=>Sg(u.getState().scene),resetAfterCommit:()=>{},shouldSetTextContent:()=>!1,clearContainer:()=>!1,hideInstance(u){var C;const{attach:d,parent:h}=(C=u.__r3f)!=null?C:{};d&&h&&Nw(h,u,d),u.isObject3D&&(u.visible=!1),xg(u)},unhideInstance(u,C){var d;const{attach:h,parent:f}=(d=u.__r3f)!=null?d:{};h&&f&&Nm(f,u,h),(u.isObject3D&&C.visible==null||C.visible)&&(u.visible=!0),xg(u)},createTextInstance:l,hideTextInstance:l,unhideTextInstance:l,getCurrentEventPriority:()=>e?e():Jg.DefaultEventPriority,beforeActiveInstanceBlur:()=>{},afterActiveInstanceBlur:()=>{},detachDeletedInstance:()=>{},now:typeof performance<"u"&&un.fun(performance.now)?performance.now:un.fun(Date.now)?Date.now:()=>0,scheduleTimeout:un.fun(setTimeout)?setTimeout:void 0,cancelTimeout:un.fun(clearTimeout)?clearTimeout:void 0}),applyProps:Hm}}var Rw,Ww;const Mm=n=>"colorSpace"in n||"outputColorSpace"in n,DV=()=>{var n;return(n=Hy.ColorManagement)!=null?n:null},UV=n=>n&&n.isOrthographicCamera,qT=n=>n&&n.hasOwnProperty("current"),Xc=typeof window<"u"&&((Rw=window.document)!=null&&Rw.createElement||((Ww=window.navigator)==null?void 0:Ww.product)==="ReactNative")?k.useLayoutEffect:k.useEffect;function PV(n){const e=k.useRef(n);return Xc(()=>void(e.current=n),[n]),e}function $T({set:n}){return Xc(()=>(n(new Promise(()=>null)),()=>n(!1)),[n]),null}class _V extends k.Component{constructor(...e){super(...e),this.state={error:!1}}componentDidCatch(e){this.props.set(e)}render(){return this.state.error?null:this.props.children}}_V.getDerivedStateFromError=()=>({error:!0});const JV="__default",Vw=new Map,ek=n=>n&&!!n.memoized&&!!n.changes;function OV(n){var e;const t=typeof window<"u"?(e=window.devicePixelRatio)!=null?e:2:1;return Array.isArray(n)?Math.min(Math.max(n[0],t),n[1]):n}const BI=n=>{var e;return(e=n.__r3f)==null?void 0:e.root.getState()},un={obj:n=>n===Object(n)&&!un.arr(n)&&typeof n!="function",fun:n=>typeof n=="function",str:n=>typeof n=="string",num:n=>typeof n=="number",boo:n=>typeof n=="boolean",und:n=>n===void 0,arr:n=>Array.isArray(n),equ(n,e,{arrays:t="shallow",objects:i="reference",strict:s=!0}={}){if(typeof n!=typeof e||!!n!=!!e)return!1;if(un.str(n)||un.num(n))return n===e;const r=un.obj(n);if(r&&i==="reference")return n===e;const o=un.arr(n);if(o&&t==="reference")return n===e;if((o||r)&&n===e)return!0;let a;for(a in n)if(!(a in e))return!1;if(r&&t==="shallow"&&i==="shallow"){for(a in s?e:n)if(!un.equ(n[a],e[a],{strict:s,objects:"reference"}))return!1}else for(a in s?e:n)if(n[a]!==e[a])return!1;if(un.und(a)){if(o&&n.length===0&&e.length===0||r&&Object.keys(n).length===0&&Object.keys(e).length===0)return!0;if(n!==e)return!1}return!0}};function tk(n){const e={nodes:{},materials:{}};return n&&n.traverse(t=>{t.name&&(e.nodes[t.name]=t),t.material&&!e.materials[t.material.name]&&(e.materials[t.material.name]=t.material)}),e}function nk(n){n.dispose&&n.type!=="Scene"&&n.dispose();for(const e in n)e.dispose==null||e.dispose(),delete n[e]}function Sg(n,e){const t=n;return(e!=null&&e.primitive||!t.__r3f)&&(t.__r3f={type:"",root:null,previousAttach:null,memoizedProps:{},eventCount:0,handlers:{},objects:[],parent:null,...e}),n}function Xb(n,e){let t=n;if(e.includes("-")){const i=e.split("-"),s=i.pop();return t=i.reduce((r,o)=>r[o],n),{target:t,key:s}}else return{target:t,key:e}}const Mw=/-\d+$/;function Nm(n,e,t){if(un.str(t)){if(Mw.test(t)){const r=t.replace(Mw,""),{target:o,key:a}=Xb(n,r);Array.isArray(o[a])||(o[a]=[])}const{target:i,key:s}=Xb(n,t);e.__r3f.previousAttach=i[s],i[s]=e}else e.__r3f.previousAttach=t(n,e)}function Nw(n,e,t){var i,s;if(un.str(t)){const{target:r,key:o}=Xb(n,t),a=e.__r3f.previousAttach;a===void 0?delete r[o]:r[o]=a}else(i=e.__r3f)==null||i.previousAttach==null||i.previousAttach(n,e);(s=e.__r3f)==null||delete s.previousAttach}function QV(n,{children:e,key:t,ref:i,...s},{children:r,key:o,ref:a,...l}={},g=!1){var u;const C=(u=n?.__r3f)!=null?u:{},d=Object.entries(s),h=[];if(g){const v=Object.keys(l);for(let y=0;y{var A;if((A=n.__r3f)!=null&&A.primitive&&v==="object"||un.equ(y,l[v]))return;if(/^on(Pointer|Click|DoubleClick|ContextMenu|Wheel)/.test(v))return h.push([v,y,!0,[]]);let b=[];v.includes("-")&&(b=v.split("-")),h.push([v,y,!1,b]);for(const m in s){const B=s[m];m.startsWith(`${v}-`)&&h.push([m,B,!1,m.split("-")])}});const f={...s};return C.memoizedProps&&C.memoizedProps.args&&(f.args=C.memoizedProps.args),C.memoizedProps&&C.memoizedProps.attach&&(f.attach=C.memoizedProps.attach),{memoized:f,changes:h}}function Hm(n,e){var t,i,s;const r=(t=n.__r3f)!=null?t:{},o=r.root,a=(i=o==null||o.getState==null?void 0:o.getState())!=null?i:{},{memoized:l,changes:g}=ek(e)?e:QV(n,e),u=r.eventCount;n.__r3f&&(n.__r3f.memoizedProps=l);for(let d=0;dm[B],n),!(b&&b.set))){const[m,...B]=y.reverse();A=B.reverse().reduce((S,x)=>S[x],n),h=m}if(f===JV+"remove")if(A.constructor){let m=Vw.get(A.constructor);m||(m=new A.constructor,Vw.set(A.constructor,m)),f=m[h]}else f=0;if(v)f?r.handlers[h]=f:delete r.handlers[h],r.eventCount=Object.keys(r.handlers).length;else if(b&&b.set&&(b.copy||b instanceof ml)){if(Array.isArray(f))b.fromArray?b.fromArray(f):b.set(...f);else if(b.copy&&f&&f.constructor&&b.constructor===f.constructor)b.copy(f);else if(f!==void 0){const m=b instanceof Xe;!m&&b.setScalar?b.setScalar(f):b instanceof ml&&f instanceof ml?b.mask=f.mask:b.set(f),!DV()&&!a.linear&&m&&b.convertSRGBToLinear()}}else if(A[h]=f,A[h]instanceof sn&&A[h].format===An&&A[h].type===cn){const m=A[h];Mm(m)&&Mm(a.gl)?m.colorSpace=a.gl.outputColorSpace:m.encoding=a.gl.outputEncoding}xg(n)}if(r.parent&&a.internal&&n.raycast&&u!==r.eventCount){const d=a.internal.interaction.indexOf(n);d>-1&&a.internal.interaction.splice(d,1),r.eventCount&&a.internal.interaction.push(n)}return!(g.length===1&&g[0][0]==="onUpdate")&&g.length&&(s=n.__r3f)!=null&&s.parent&&Fb(n),n}function xg(n){var e,t;const i=(e=n.__r3f)==null||(t=e.root)==null||t.getState==null?void 0:t.getState();i&&i.internal.frames===0&&i.invalidate()}function Fb(n){n.onUpdate==null||n.onUpdate(n)}function jV(n,e){n.manual||(UV(n)?(n.left=e.width/-2,n.right=e.width/2,n.top=e.height/2,n.bottom=e.height/-2):n.aspect=e.width/e.height,n.updateProjectionMatrix(),n.updateMatrixWorld())}function mh(n){return(n.eventObject||n.object).uuid+"/"+n.index+n.instanceId}function ik(){var n;const e=typeof self<"u"&&self||typeof window<"u"&&window;if(!e)return Jg.DefaultEventPriority;switch((n=e.event)==null?void 0:n.type){case"click":case"contextmenu":case"dblclick":case"pointercancel":case"pointerdown":case"pointerup":return Jg.DiscreteEventPriority;case"pointermove":case"pointerout":case"pointerover":case"pointerenter":case"pointerleave":case"wheel":return Jg.ContinuousEventPriority;default:return Jg.DefaultEventPriority}}function qV(n,e,t,i){const s=t.get(e);s&&(t.delete(e),t.size===0&&(n.delete(i),s.target.releasePointerCapture(i)))}function sk(n,e){const{internal:t}=n.getState();t.interaction=t.interaction.filter(i=>i!==e),t.initialHits=t.initialHits.filter(i=>i!==e),t.hovered.forEach((i,s)=>{(i.eventObject===e||i.object===e)&&t.hovered.delete(s)}),t.capturedMap.forEach((i,s)=>{qV(t.capturedMap,e,i,s)})}function rk(n){function e(l){const{internal:g}=n.getState(),u=l.offsetX-g.initialClick[0],C=l.offsetY-g.initialClick[1];return Math.round(Math.sqrt(u*u+C*C))}function t(l){return l.filter(g=>["Move","Over","Enter","Out","Leave"].some(u=>{var C;return(C=g.__r3f)==null?void 0:C.handlers["onPointer"+u]}))}function i(l,g){const u=n.getState(),C=new Set,d=[],h=g?g(u.internal.interaction):u.internal.interaction;for(let A=0;A{const m=BI(A.object),B=BI(b.object);return!m||!B?A.distance-b.distance:B.events.priority-m.events.priority||A.distance-b.distance}).filter(A=>{const b=mh(A);return C.has(b)?!1:(C.add(b),!0)});u.events.filter&&(v=u.events.filter(v,u));for(const A of v){let b=A.object;for(;b;){var y;(y=b.__r3f)!=null&&y.eventCount&&d.push({...A,eventObject:b}),b=b.parent}}if("pointerId"in l&&u.internal.capturedMap.has(l.pointerId))for(let A of u.internal.capturedMap.get(l.pointerId).values())C.has(mh(A.intersection))||d.push(A.intersection);return d}function s(l,g,u,C){const d=n.getState();if(l.length){const h={stopped:!1};for(const f of l){const v=BI(f.object)||d,{raycaster:y,pointer:A,camera:b,internal:m}=v,B=new H(A.x,A.y,0).unproject(b),S=V=>{var N,P;return(N=(P=m.capturedMap.get(V))==null?void 0:P.has(f.eventObject))!=null?N:!1},x=V=>{const N={intersection:f,target:g.target};m.capturedMap.has(V)?m.capturedMap.get(V).set(f.eventObject,N):m.capturedMap.set(V,new Map([[f.eventObject,N]])),g.target.setPointerCapture(V)},R=V=>{const N=m.capturedMap.get(V);N&&qV(m.capturedMap,f.eventObject,N,V)};let M={};for(let V in g){let N=g[V];typeof N!="function"&&(M[V]=N)}let Z={...f,...M,pointer:A,intersections:l,stopped:h.stopped,delta:u,unprojectedPoint:B,ray:y.ray,camera:b,stopPropagation(){const V="pointerId"in g&&m.capturedMap.get(g.pointerId);if((!V||V.has(f.eventObject))&&(Z.stopped=h.stopped=!0,m.hovered.size&&Array.from(m.hovered.values()).find(N=>N.eventObject===f.eventObject))){const N=l.slice(0,l.indexOf(f));r([...N,f])}},target:{hasPointerCapture:S,setPointerCapture:x,releasePointerCapture:R},currentTarget:{hasPointerCapture:S,setPointerCapture:x,releasePointerCapture:R},nativeEvent:g};if(C(Z),h.stopped===!0)break}}return l}function r(l){const{internal:g}=n.getState();for(const u of g.hovered.values())if(!l.length||!l.find(C=>C.object===u.object&&C.index===u.index&&C.instanceId===u.instanceId)){const d=u.eventObject.__r3f,h=d?.handlers;if(g.hovered.delete(mh(u)),d!=null&&d.eventCount){const f={...u,intersections:l};h.onPointerOut==null||h.onPointerOut(f),h.onPointerLeave==null||h.onPointerLeave(f)}}}function o(l,g){for(let u=0;ur([]);case"onLostPointerCapture":return g=>{const{internal:u}=n.getState();"pointerId"in g&&u.capturedMap.has(g.pointerId)&&requestAnimationFrame(()=>{u.capturedMap.has(g.pointerId)&&(u.capturedMap.delete(g.pointerId),r([]))})}}return function(u){const{onPointerMissed:C,internal:d}=n.getState();d.lastEvent.current=u;const h=l==="onPointerMove",f=l==="onClick"||l==="onContextMenu"||l==="onDoubleClick",y=i(u,h?t:void 0),A=f?e(u):0;l==="onPointerDown"&&(d.initialClick=[u.offsetX,u.offsetY],d.initialHits=y.map(m=>m.eventObject)),f&&!y.length&&A<=2&&(o(u,d.interaction),C&&C(u)),h&&r(y);function b(m){const B=m.eventObject,S=B.__r3f,x=S?.handlers;if(S!=null&&S.eventCount)if(h){if(x.onPointerOver||x.onPointerEnter||x.onPointerOut||x.onPointerLeave){const R=mh(m),M=d.hovered.get(R);M?M.stopped&&m.stopPropagation():(d.hovered.set(R,m),x.onPointerOver==null||x.onPointerOver(m),x.onPointerEnter==null||x.onPointerEnter(m))}x.onPointerMove==null||x.onPointerMove(m)}else{const R=x[l];R?(!f||d.initialHits.includes(B))&&(o(u,d.interaction.filter(M=>!d.initialHits.includes(M))),R(m)):f&&d.initialHits.includes(B)&&o(u,d.interaction.filter(M=>!d.initialHits.includes(M)))}}s(y,u,A,b)}}return{handlePointer:a}}const ok=["set","get","setSize","setFrameloop","setDpr","events","invalidate","advance","size","viewport"],$V=n=>!!(n!=null&&n.render),Xy=k.createContext(null),ak=(n,e)=>{const t=YV((a,l)=>{const g=new H,u=new H,C=new H;function d(A=l().camera,b=u,m=l().size){const{width:B,height:S,top:x,left:R}=m,M=B/S;b instanceof H?C.copy(b):C.set(...b);const Z=A.getWorldPosition(g).distanceTo(C);if(UV(A))return{width:B/A.zoom,height:S/A.zoom,top:x,left:R,factor:1,distance:Z,aspect:M};{const V=A.fov*Math.PI/180,N=2*Math.tan(V/2)*Z,P=N*(B/S);return{width:P,height:N,top:x,left:R,factor:B/P,distance:Z,aspect:M}}}let h;const f=A=>a(b=>({performance:{...b.performance,current:A}})),v=new oe;return{set:a,get:l,gl:null,camera:null,raycaster:null,events:{priority:1,enabled:!0,connected:!1},xr:null,scene:null,invalidate:(A=1)=>n(l(),A),advance:(A,b)=>e(A,b,l()),legacy:!1,linear:!1,flat:!1,controls:null,clock:new Wy,pointer:v,mouse:v,frameloop:"always",onPointerMissed:void 0,performance:{current:1,min:.5,max:1,debounce:200,regress:()=>{const A=l();h&&clearTimeout(h),A.performance.current!==A.performance.min&&f(A.performance.min),h=setTimeout(()=>f(l().performance.max),A.performance.debounce)}},size:{width:0,height:0,top:0,left:0,updateStyle:!1},viewport:{initialDpr:0,dpr:0,width:0,height:0,top:0,left:0,aspect:0,distance:0,factor:0,getCurrentViewport:d},setEvents:A=>a(b=>({...b,events:{...b.events,...A}})),setSize:(A,b,m,B,S)=>{const x=l().camera,R={width:A,height:b,top:B||0,left:S||0,updateStyle:m};a(M=>({size:R,viewport:{...M.viewport,...d(x,u,R)}}))},setDpr:A=>a(b=>{const m=OV(A);return{viewport:{...b.viewport,dpr:m,initialDpr:b.viewport.initialDpr||m}}}),setFrameloop:(A="always")=>{const b=l().clock;b.stop(),b.elapsedTime=0,A!=="never"&&(b.start(),b.elapsedTime=0),a(()=>({frameloop:A}))},previousRoot:void 0,internal:{active:!1,priority:0,frames:0,lastEvent:k.createRef(),interaction:[],hovered:new Map,subscribers:[],initialClick:[0,0],initialHits:[],capturedMap:new Map,subscribe:(A,b,m)=>{const B=l().internal;return B.priority=B.priority+(b>0?1:0),B.subscribers.push({ref:A,priority:b,store:m}),B.subscribers=B.subscribers.sort((S,x)=>S.priority-x.priority),()=>{const S=l().internal;S!=null&&S.subscribers&&(S.priority=S.priority-(b>0?1:0),S.subscribers=S.subscribers.filter(x=>x.ref!==A))}}}}}),i=t.getState();let s=i.size,r=i.viewport.dpr,o=i.camera;return t.subscribe(()=>{const{camera:a,size:l,viewport:g,gl:u,set:C}=t.getState();if(l!==s||g.dpr!==r){var d;s=l,r=g.dpr,jV(a,l),u.setPixelRatio(g.dpr);const h=(d=l.updateStyle)!=null?d:typeof HTMLCanvasElement<"u"&&u.domElement instanceof HTMLCanvasElement;u.setSize(l.width,l.height,h)}a!==o&&(o=a,C(h=>({viewport:{...h.viewport,...h.viewport.getCurrentViewport(a)}})))}),t.subscribe(a=>n(a)),t};let bh,lk=new Set,gk=new Set,ck=new Set;function Xm(n,e){if(n.size)for(const{callback:t}of n.values())t(e)}function ZI(n,e){switch(n){case"before":return Xm(lk,e);case"after":return Xm(gk,e);case"tail":return Xm(ck,e)}}let Fm,Ym;function Km(n,e,t){let i=e.clock.getDelta();for(e.frameloop==="never"&&typeof n=="number"&&(i=n-e.clock.elapsedTime,e.clock.oldTime=e.clock.elapsedTime,e.clock.elapsedTime=n),Fm=e.internal.subscribers,bh=0;bh0)&&!((g=s.gl.xr)!=null&&g.isPresenting)&&(t+=Km(l,s))}if(ZI("after",l),t===0)return ZI("tail",l),e=!1,cancelAnimationFrame(i)}function o(l,g=1){var u;if(!l)return n.forEach(C=>o(C.store.getState()),g);(u=l.gl.xr)!=null&&u.isPresenting||!l.internal.active||l.frameloop==="never"||(l.internal.frames=Math.min(60,l.internal.frames+g),e||(e=!0,requestAnimationFrame(r)))}function a(l,g=!0,u,C){if(g&&ZI("before",l),u)Km(l,u,C);else for(const d of n.values())Km(l,d.store.getState());g&&ZI("after",l)}return{loop:r,invalidate:o,advance:a}}function uk(n){const e=k.useRef(null);return Xc(()=>void(e.current=n.current.__r3f),[n]),e}function Fy(){const n=k.useContext(Xy);if(!n)throw new Error("R3F: Hooks can only be used within the Canvas component!");return n}function as(n=t=>t,e){return Fy()(n,e)}function bC(n,e=0){const t=Fy(),i=t.getState().internal.subscribe,s=PV(n);return Xc(()=>i(s,e,t),[e,i,t]),null}function eM(n,e){return function(t,...i){const s=new t;return n&&n(s),Promise.all(i.map(r=>new Promise((o,a)=>s.load(r,l=>{l.scene&&Object.assign(l,tk(l.scene)),o(l)},e,l=>a(new Error(`Could not load ${r}: ${l.message})`))))))}}function Yy(n,e,t,i){const s=Array.isArray(e)?e:[e],r=JT(eM(t,i),[n,...s],{equal:un.equ});return Array.isArray(e)?r:r[0]}Yy.preload=function(n,e,t){const i=Array.isArray(e)?e:[e];return OT(eM(t),[n,...i])};Yy.clear=function(n,e){const t=Array.isArray(e)?e:[e];return QT([n,...t])};const vc=new Map,{invalidate:Hw,advance:Xw}=Ik(vc),{reconciler:Ju,applyProps:$a}=jT(vc,ik),Bg={objects:"shallow",strict:!1},Ck=(n,e)=>{const t=typeof n=="function"?n(e):n;return $V(t)?t:new uy({powerPreference:"high-performance",canvas:e,antialias:!0,alpha:!0,...n})};function dk(n,e){if(e)return e;if(typeof HTMLCanvasElement<"u"&&n instanceof HTMLCanvasElement&&n.parentElement){const{width:t,height:i,top:s,left:r}=n.parentElement.getBoundingClientRect();return{width:t,height:i,top:s,left:r}}else if(typeof OffscreenCanvas<"u"&&n instanceof OffscreenCanvas)return{width:n.width,height:n.height,top:0,left:0};return{width:0,height:0,top:0,left:0}}function hk(n){const e=vc.get(n),t=e?.fiber,i=e?.store;e&&console.warn("R3F.createRoot should only be called once!");const s=typeof reportError=="function"?reportError:console.error,r=i||ak(Hw,Xw),o=t||Ju.createContainer(r,Jg.ConcurrentRoot,null,!1,null,"",s,null);e||vc.set(n,{fiber:o,store:r});let a,l=!1,g;return{configure(u={}){let{gl:C,size:d,scene:h,events:f,onCreated:v,shadows:y=!1,linear:A=!1,flat:b=!1,legacy:m=!1,orthographic:B=!1,frameloop:S="always",dpr:x=[1,2],performance:R,raycaster:M,camera:Z,onPointerMissed:V}=u,N=r.getState(),P=N.gl;N.gl||N.set({gl:P=Ck(C,n)});let U=N.raycaster;U||N.set({raycaster:U=new Ny});const{params:q,...ie}=M||{};if(un.equ(ie,U,Bg)||$a(U,{...ie}),un.equ(q,U.params,Bg)||$a(U,{params:{...U.params,...q}}),!N.camera||N.camera===g&&!un.equ(g,Z,Bg)){g=Z;const le=Z instanceof Rc,se=le?Z:B?new Wc(0,0,0,0,.1,1e3):new mn(75,0,.1,1e3);le||(se.position.z=5,Z&&$a(se,Z),!N.camera&&!(Z!=null&&Z.rotation)&&se.lookAt(0,0,0)),N.set({camera:se})}if(!N.scene){let le;h instanceof Sl?le=h:(le=new Sl,h&&$a(le,h)),N.set({scene:Sg(le)})}if(!N.xr){const le=(ge,Ze)=>{const Re=r.getState();Re.frameloop!=="never"&&Xw(ge,!0,Re,Ze)},se=()=>{const ge=r.getState();ge.gl.xr.enabled=ge.gl.xr.isPresenting,ge.gl.xr.setAnimationLoop(ge.gl.xr.isPresenting?le:null),ge.gl.xr.isPresenting||Hw(ge)},te={connect(){const ge=r.getState().gl;ge.xr.addEventListener("sessionstart",se),ge.xr.addEventListener("sessionend",se)},disconnect(){const ge=r.getState().gl;ge.xr.removeEventListener("sessionstart",se),ge.xr.removeEventListener("sessionend",se)}};P.xr&&te.connect(),N.set({xr:te})}if(P.shadowMap){const le=P.shadowMap.enabled,se=P.shadowMap.type;if(P.shadowMap.enabled=!!y,un.boo(y))P.shadowMap.type=nu;else if(un.str(y)){var he;const te={basic:U1,percentage:qA,soft:nu,variance:cr};P.shadowMap.type=(he=te[y])!=null?he:nu}else un.obj(y)&&Object.assign(P.shadowMap,y);(le!==P.shadowMap.enabled||se!==P.shadowMap.type)&&(P.shadowMap.needsUpdate=!0)}const Ce=DV();Ce&&("enabled"in Ce?Ce.enabled=!m:"legacyMode"in Ce&&(Ce.legacyMode=m)),$a(P,{outputEncoding:A?3e3:3001,toneMapping:b?Ar:qv}),N.legacy!==m&&N.set(()=>({legacy:m})),N.linear!==A&&N.set(()=>({linear:A})),N.flat!==b&&N.set(()=>({flat:b})),C&&!un.fun(C)&&!$V(C)&&!un.equ(C,P,Bg)&&$a(P,C),f&&!N.events.handlers&&N.set({events:f(r)});const J=dk(n,d);return un.equ(J,N.size,Bg)||N.setSize(J.width,J.height,J.updateStyle,J.top,J.left),x&&N.viewport.dpr!==OV(x)&&N.setDpr(x),N.frameloop!==S&&N.setFrameloop(S),N.onPointerMissed||N.set({onPointerMissed:V}),R&&!un.equ(R,N.performance,Bg)&&N.set(le=>({performance:{...le.performance,...R}})),a=v,l=!0,this},render(u){return l||this.configure(),Ju.updateContainer(k.createElement(Ak,{store:r,children:u,onCreated:a,rootElement:n}),o,null,()=>{}),r},unmount(){tM(n)}}}function Ak({store:n,children:e,onCreated:t,rootElement:i}){return Xc(()=>{const s=n.getState();s.set(r=>({internal:{...r.internal,active:!0}})),t&&t(s),n.getState().events.connected||s.events.connect==null||s.events.connect(i)},[]),k.createElement(Xy.Provider,{value:n},e)}function tM(n,e){const t=vc.get(n),i=t?.fiber;if(i){const s=t?.store.getState();s&&(s.internal.active=!1),Ju.updateContainer(null,i,null,()=>{s&&setTimeout(()=>{try{var r,o,a,l;s.events.disconnect==null||s.events.disconnect(),(r=s.gl)==null||(o=r.renderLists)==null||o.dispose==null||o.dispose(),(a=s.gl)==null||a.forceContextLoss==null||a.forceContextLoss(),(l=s.gl)!=null&&l.xr&&s.xr.disconnect(),nk(s),vc.delete(n),e&&e(n)}catch{}},500)})}}function pk(n,e,t){return k.createElement(fk,{key:e.uuid,children:n,container:e,state:t})}function fk({state:n={},children:e,container:t}){const{events:i,size:s,...r}=n,o=Fy(),[a]=k.useState(()=>new Ny),[l]=k.useState(()=>new oe),g=k.useCallback((C,d)=>{const h={...C};Object.keys(C).forEach(v=>{(ok.includes(v)||C[v]!==d[v]&&d[v])&&delete h[v]});let f;if(d&&s){const v=d.camera;f=C.viewport.getCurrentViewport(v,new H,s),v!==C.camera&&jV(v,s)}return{...h,scene:t,raycaster:a,pointer:l,mouse:l,previousRoot:o,events:{...C.events,...d?.events,...i},size:{...C.size,...s},viewport:{...C.viewport,...f},...r}},[n]),[u]=k.useState(()=>{const C=o.getState();return YV((h,f)=>({...C,scene:t,raycaster:a,pointer:l,mouse:l,previousRoot:o,events:{...C.events,...i},size:{...C.size,...s},...r,set:h,get:f,setEvents:v=>h(y=>({...y,events:{...y.events,...v}}))}))});return k.useEffect(()=>{const C=o.subscribe(d=>u.setState(h=>g(d,h)));return()=>{C(),u.destroy()}},[]),k.useEffect(()=>{u.setState(C=>g(o.getState(),C))},[g]),k.createElement(k.Fragment,null,Ju.createPortal(k.createElement(Xy.Provider,{value:u},e),u,null))}Ju.injectIntoDevTools({bundleType:0,rendererPackageName:"@react-three/fiber",version:k.version});function VA(){return VA=Object.assign?Object.assign.bind():function(n){for(var e=1;e=0?i=setTimeout(l,e-u):(i=null,t||(a=n.apply(r,s),r=s=null))}var g=function(){r=this,s=arguments,o=Date.now();var u=t&&!i;return i||(i=setTimeout(l,e)),u&&(a=n.apply(r,s),r=s=null),a};return g.clear=function(){i&&(clearTimeout(i),i=null)},g.flush=function(){i&&(a=n.apply(r,s),r=s=null,clearTimeout(i),i=null)},g}Yb.debounce=Yb;var mk=Yb;const Fw=Db(mk);function bk(n){let{debounce:e,scroll:t,polyfill:i,offsetSize:s}=n===void 0?{debounce:0,scroll:!1,offsetSize:!1}:n;const r=i||(typeof window>"u"?class{}:window.ResizeObserver);if(!r)throw new Error("This browser does not support ResizeObserver out of the box. See: https://github.com/react-spring/react-use-measure/#resize-observer-polyfills");const[o,a]=k.useState({left:0,top:0,width:0,height:0,bottom:0,right:0,x:0,y:0}),l=k.useRef({element:null,scrollContainers:null,resizeObserver:null,lastBounds:o}),g=e?typeof e=="number"?e:e.scroll:null,u=e?typeof e=="number"?e:e.resize:null,C=k.useRef(!1);k.useEffect(()=>(C.current=!0,()=>void(C.current=!1)));const[d,h,f]=k.useMemo(()=>{const b=()=>{if(!l.current.element)return;const{left:m,top:B,width:S,height:x,bottom:R,right:M,x:Z,y:V}=l.current.element.getBoundingClientRect(),N={left:m,top:B,width:S,height:x,bottom:R,right:M,x:Z,y:V};l.current.element instanceof HTMLElement&&s&&(N.height=l.current.element.offsetHeight,N.width=l.current.element.offsetWidth),Object.freeze(N),C.current&&!Bk(l.current.lastBounds,N)&&a(l.current.lastBounds=N)};return[b,u?Fw(b,u):b,g?Fw(b,g):b]},[a,s,g,u]);function v(){l.current.scrollContainers&&(l.current.scrollContainers.forEach(b=>b.removeEventListener("scroll",f,!0)),l.current.scrollContainers=null),l.current.resizeObserver&&(l.current.resizeObserver.disconnect(),l.current.resizeObserver=null)}function y(){l.current.element&&(l.current.resizeObserver=new r(f),l.current.resizeObserver.observe(l.current.element),t&&l.current.scrollContainers&&l.current.scrollContainers.forEach(b=>b.addEventListener("scroll",f,{capture:!0,passive:!0})))}const A=b=>{!b||b===l.current.element||(v(),l.current.element=b,l.current.scrollContainers=nM(b),y())};return yk(f,!!t),vk(h),k.useEffect(()=>{v(),y()},[t,f,h]),k.useEffect(()=>v,[]),[A,o,d]}function vk(n){k.useEffect(()=>{const e=n;return window.addEventListener("resize",e),()=>void window.removeEventListener("resize",e)},[n])}function yk(n,e){k.useEffect(()=>{if(e){const t=n;return window.addEventListener("scroll",t,{capture:!0,passive:!0}),()=>void window.removeEventListener("scroll",t,!0)}},[n,e])}function nM(n){const e=[];if(!n||n===document.body)return e;const{overflow:t,overflowX:i,overflowY:s}=window.getComputedStyle(n);return[t,i,s].some(r=>r==="auto"||r==="scroll")&&e.push(n),[...e,...nM(n.parentElement)]}const Gk=["x","y","top","bottom","left","right","width","height"],Bk=(n,e)=>Gk.every(t=>n[t]===e[t]);var Zk=Object.defineProperty,wk=Object.defineProperties,Sk=Object.getOwnPropertyDescriptors,Yw=Object.getOwnPropertySymbols,xk=Object.prototype.hasOwnProperty,Rk=Object.prototype.propertyIsEnumerable,Kw=(n,e,t)=>e in n?Zk(n,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):n[e]=t,zw=(n,e)=>{for(var t in e||(e={}))xk.call(e,t)&&Kw(n,t,e[t]);if(Yw)for(var t of Yw(e))Rk.call(e,t)&&Kw(n,t,e[t]);return n},Wk=(n,e)=>wk(n,Sk(e));function iM(n,e,t){if(!n)return;if(t(n)===!0)return n;let i=e?n.return:n.child;for(;i;){const s=iM(i,e,t);if(s)return s;i=e?null:i.sibling}}function sM(n){try{return Object.defineProperties(n,{_currentRenderer:{get(){return null},set(){}},_currentRenderer2:{get(){return null},set(){}}})}catch{return n}}const Ky=sM(k.createContext(null));class rM extends k.Component{render(){return k.createElement(Ky.Provider,{value:this._reactInternals},this.props.children)}}const{ReactCurrentOwner:Lw,ReactCurrentDispatcher:Ew}=k.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;function Vk(){const n=k.useContext(Ky);if(n===null)throw new Error("its-fine: useFiber must be called within a !");const e=k.useId();return k.useMemo(()=>{for(const i of[Lw?.current,n,n?.alternate]){if(!i)continue;const s=iM(i,!1,r=>{let o=r.memoizedState;for(;o;){if(o.memoizedState===e)return!0;o=o.next}});if(s)return s}},[n,e])}function Mk(){var n,e;const t=Vk(),[i]=k.useState(()=>new Map);i.clear();let s=t;for(;s;){const r=(n=s.type)==null?void 0:n._context;r&&r!==Ky&&!i.has(r)&&i.set(r,(e=Ew?.current)==null?void 0:e.readContext(sM(r))),s=s.return}return i}function Nk(){const n=Mk();return k.useMemo(()=>Array.from(n.keys()).reduce((e,t)=>i=>k.createElement(e,null,k.createElement(t.Provider,Wk(zw({},i),{value:n.get(t)}))),e=>k.createElement(rM,zw({},e))),[n])}const zm={onClick:["click",!1],onContextMenu:["contextmenu",!1],onDoubleClick:["dblclick",!1],onWheel:["wheel",!0],onPointerDown:["pointerdown",!0],onPointerUp:["pointerup",!0],onPointerLeave:["pointerleave",!0],onPointerMove:["pointermove",!0],onPointerCancel:["pointercancel",!0],onLostPointerCapture:["lostpointercapture",!0]};function Hk(n){const{handlePointer:e}=rk(n);return{priority:1,enabled:!0,compute(t,i,s){i.pointer.set(t.offsetX/i.size.width*2-1,-(t.offsetY/i.size.height)*2+1),i.raycaster.setFromCamera(i.pointer,i.camera)},connected:void 0,handlers:Object.keys(zm).reduce((t,i)=>({...t,[i]:e(i)}),{}),update:()=>{var t;const{events:i,internal:s}=n.getState();(t=s.lastEvent)!=null&&t.current&&i.handlers&&i.handlers.onPointerMove(s.lastEvent.current)},connect:t=>{var i;const{set:s,events:r}=n.getState();r.disconnect==null||r.disconnect(),s(o=>({events:{...o.events,connected:t}})),Object.entries((i=r.handlers)!=null?i:[]).forEach(([o,a])=>{const[l,g]=zm[o];t.addEventListener(l,a,{passive:g})})},disconnect:()=>{const{set:t,events:i}=n.getState();if(i.connected){var s;Object.entries((s=i.handlers)!=null?s:[]).forEach(([r,o])=>{if(i&&i.connected instanceof HTMLElement){const[a]=zm[r];i.connected.removeEventListener(a,o)}}),t(r=>({events:{...r.events,connected:void 0}}))}}}}const Xk=k.forwardRef(function({children:e,fallback:t,resize:i,style:s,gl:r,events:o=Hk,eventSource:a,eventPrefix:l,shadows:g,linear:u,flat:C,legacy:d,orthographic:h,frameloop:f,dpr:v,performance:y,raycaster:A,camera:b,onPointerMissed:m,onCreated:B,...S},x){k.useMemo(()=>kV(TT),[]);const R=Nk(),[M,Z]=bk({scroll:!0,debounce:{scroll:50,resize:0},...i}),V=k.useRef(null),N=k.useRef(null);k.useImperativeHandle(x,()=>V.current);const P=PV(m),[U,q]=k.useState(!1),[ie,he]=k.useState(!1);if(U)throw U;if(ie)throw ie;const Ce=k.useRef(null);Xc(()=>{const Q=V.current;Z.width>0&&Z.height>0&&Q&&(Ce.current||(Ce.current=hk(Q)),Ce.current.configure({gl:r,events:o,shadows:g,linear:u,flat:C,legacy:d,orthographic:h,frameloop:f,dpr:v,performance:y,raycaster:A,camera:b,size:Z,onPointerMissed:(...J)=>P.current==null?void 0:P.current(...J),onCreated:J=>{J.events.connect==null||J.events.connect(a?qT(a)?a.current:a:N.current),l&&J.setEvents({compute:(le,se)=>{const te=le[l+"X"],ge=le[l+"Y"];se.pointer.set(te/se.size.width*2-1,-(ge/se.size.height)*2+1),se.raycaster.setFromCamera(se.pointer,se.camera)}}),B?.(J)}}),Ce.current.render(k.createElement(R,null,k.createElement(_V,{set:he},k.createElement(k.Suspense,{fallback:k.createElement($T,{set:q})},e)))))}),k.useEffect(()=>{const Q=V.current;if(Q)return()=>tM(Q)},[]);const z=a?"none":"auto";return k.createElement("div",VA({ref:N,style:{position:"relative",width:"100%",height:"100%",overflow:"hidden",pointerEvents:z,...s}},S),k.createElement("div",{ref:M,style:{width:"100%",height:"100%"}},k.createElement("canvas",{ref:V,style:{display:"block"}},t)))}),Fk=k.forwardRef(function(e,t){return k.createElement(rM,null,k.createElement(Xk,VA({},e,{ref:t})))});var zy={exports:{}},ac=typeof Reflect=="object"?Reflect:null,Tw=ac&&typeof ac.apply=="function"?ac.apply:function(e,t,i){return Function.prototype.apply.call(e,t,i)},$h;ac&&typeof ac.ownKeys=="function"?$h=ac.ownKeys:Object.getOwnPropertySymbols?$h=function(e){return Object.getOwnPropertyNames(e).concat(Object.getOwnPropertySymbols(e))}:$h=function(e){return Object.getOwnPropertyNames(e)};function Yk(n){console&&console.warn&&console.warn(n)}var oM=Number.isNaN||function(e){return e!==e};function rn(){rn.init.call(this)}zy.exports=rn;zy.exports.once=Ek;rn.EventEmitter=rn;rn.prototype._events=void 0;rn.prototype._eventsCount=0;rn.prototype._maxListeners=void 0;var kw=10;function bp(n){if(typeof n!="function")throw new TypeError('The "listener" argument must be of type Function. Received type '+typeof n)}Object.defineProperty(rn,"defaultMaxListeners",{enumerable:!0,get:function(){return kw},set:function(n){if(typeof n!="number"||n<0||oM(n))throw new RangeError('The value of "defaultMaxListeners" is out of range. It must be a non-negative number. Received '+n+".");kw=n}});rn.init=function(){(this._events===void 0||this._events===Object.getPrototypeOf(this)._events)&&(this._events=Object.create(null),this._eventsCount=0),this._maxListeners=this._maxListeners||void 0};rn.prototype.setMaxListeners=function(e){if(typeof e!="number"||e<0||oM(e))throw new RangeError('The value of "n" is out of range. It must be a non-negative number. Received '+e+".");return this._maxListeners=e,this};function aM(n){return n._maxListeners===void 0?rn.defaultMaxListeners:n._maxListeners}rn.prototype.getMaxListeners=function(){return aM(this)};rn.prototype.emit=function(e){for(var t=[],i=1;i0&&(o=t[0]),o instanceof Error)throw o;var a=new Error("Unhandled error."+(o?" ("+o.message+")":""));throw a.context=o,a}var l=r[e];if(l===void 0)return!1;if(typeof l=="function")Tw(l,this,t);else for(var g=l.length,u=uM(l,g),i=0;i0&&o.length>s&&!o.warned){o.warned=!0;var a=new Error("Possible EventEmitter memory leak detected. "+o.length+" "+String(e)+" listeners added. Use emitter.setMaxListeners() to increase limit");a.name="MaxListenersExceededWarning",a.emitter=n,a.type=e,a.count=o.length,Yk(a)}return n}rn.prototype.addListener=function(e,t){return lM(this,e,t,!1)};rn.prototype.on=rn.prototype.addListener;rn.prototype.prependListener=function(e,t){return lM(this,e,t,!0)};function Kk(){if(!this.fired)return this.target.removeListener(this.type,this.wrapFn),this.fired=!0,arguments.length===0?this.listener.call(this.target):this.listener.apply(this.target,arguments)}function gM(n,e,t){var i={fired:!1,wrapFn:void 0,target:n,type:e,listener:t},s=Kk.bind(i);return s.listener=t,i.wrapFn=s,s}rn.prototype.once=function(e,t){return bp(t),this.on(e,gM(this,e,t)),this};rn.prototype.prependOnceListener=function(e,t){return bp(t),this.prependListener(e,gM(this,e,t)),this};rn.prototype.removeListener=function(e,t){var i,s,r,o,a;if(bp(t),s=this._events,s===void 0)return this;if(i=s[e],i===void 0)return this;if(i===t||i.listener===t)--this._eventsCount===0?this._events=Object.create(null):(delete s[e],s.removeListener&&this.emit("removeListener",e,i.listener||t));else if(typeof i!="function"){for(r=-1,o=i.length-1;o>=0;o--)if(i[o]===t||i[o].listener===t){a=i[o].listener,r=o;break}if(r<0)return this;r===0?i.shift():zk(i,r),i.length===1&&(s[e]=i[0]),s.removeListener!==void 0&&this.emit("removeListener",e,a||t)}return this};rn.prototype.off=rn.prototype.removeListener;rn.prototype.removeAllListeners=function(e){var t,i,s;if(i=this._events,i===void 0)return this;if(i.removeListener===void 0)return arguments.length===0?(this._events=Object.create(null),this._eventsCount=0):i[e]!==void 0&&(--this._eventsCount===0?this._events=Object.create(null):delete i[e]),this;if(arguments.length===0){var r=Object.keys(i),o;for(s=0;s=0;s--)this.removeListener(e,t[s]);return this};function cM(n,e,t){var i=n._events;if(i===void 0)return[];var s=i[e];return s===void 0?[]:typeof s=="function"?t?[s.listener||s]:[s]:t?Lk(s):uM(s,s.length)}rn.prototype.listeners=function(e){return cM(this,e,!0)};rn.prototype.rawListeners=function(e){return cM(this,e,!1)};rn.listenerCount=function(n,e){return typeof n.listenerCount=="function"?n.listenerCount(e):IM.call(n,e)};rn.prototype.listenerCount=IM;function IM(n){var e=this._events;if(e!==void 0){var t=e[n];if(typeof t=="function")return 1;if(t!==void 0)return t.length}return 0}rn.prototype.eventNames=function(){return this._eventsCount>0?$h(this._events):[]};function uM(n,e){for(var t=new Array(e),i=0;i{if(e.data.op==="frame"){this.buffers.positions=e.data.positions,this.buffers.quaternions=e.data.quaternions,this.emit(e.data.op,e.data);return}this.emit(e.data.type,e.data)};for(const e of this.messageQueue)this.worker.postMessage(e);this.messageQueue.length=0}disableConstraint(e){let{uuid:t}=e;this.postMessage({op:"disableConstraint",uuid:t})}disableConstraintMotor(e){let{uuid:t}=e;this.postMessage({op:"disableConstraintMotor",uuid:t})}disconnect(){this.worker&&(this.worker.onmessage=null)}enableConstraint(e){let{uuid:t}=e;this.postMessage({op:"enableConstraint",uuid:t})}enableConstraintMotor(e){let{uuid:t}=e;this.postMessage({op:"enableConstraintMotor",uuid:t})}init(){const{allowSleep:e,axisIndex:t,broadphase:i,defaultContactMaterial:s,frictionGravity:r,gravity:o,iterations:a,quatNormalizeFast:l,quatNormalizeSkip:g,solver:u,tolerance:C}=this.config;this.postMessage({op:"init",props:{allowSleep:e,axisIndex:t,broadphase:i,defaultContactMaterial:s,frictionGravity:r,gravity:o,iterations:a,quatNormalizeFast:l,quatNormalizeSkip:g,solver:u,tolerance:C}})}removeBodies(e){let{uuid:t}=e;this.postMessage({op:"removeBodies",uuid:t})}removeConstraint(e){let{uuid:t}=e;this.postMessage({op:"removeConstraint",uuid:t})}removeContactMaterial(e){let{uuid:t}=e;this.postMessage({op:"removeContactMaterial",uuid:t})}removeRay(e){let{uuid:t}=e;this.postMessage({op:"removeRay",uuid:t})}removeRaycastVehicle(e){let{uuid:t}=e;this.postMessage({op:"removeRaycastVehicle",uuid:t})}removeSpring(e){let{uuid:t}=e;this.postMessage({op:"removeSpring",uuid:t})}setAllowSleep(e){let{props:t,uuid:i}=e;this.postMessage({op:"setAllowSleep",props:t,uuid:i})}setAngularDamping(e){let{props:t,uuid:i}=e;this.postMessage({op:"setAngularDamping",props:t,uuid:i})}setAngularFactor(e){let{props:t,uuid:i}=e;this.postMessage({op:"setAngularFactor",props:t,uuid:i})}setAngularVelocity(e){let{props:t,uuid:i}=e;this.postMessage({op:"setAngularVelocity",props:t,uuid:i})}setCollisionFilterGroup(e){let{props:t,uuid:i}=e;this.postMessage({op:"setCollisionFilterGroup",props:t,uuid:i})}setCollisionFilterMask(e){let{props:t,uuid:i}=e;this.postMessage({op:"setCollisionFilterMask",props:t,uuid:i})}setCollisionResponse(e){let{props:t,uuid:i}=e;this.postMessage({op:"setCollisionResponse",props:t,uuid:i})}setConstraintMotorMaxForce(e){let{props:t,uuid:i}=e;this.postMessage({op:"setConstraintMotorMaxForce",props:t,uuid:i})}setConstraintMotorSpeed(e){let{props:t,uuid:i}=e;this.postMessage({op:"setConstraintMotorSpeed",props:t,uuid:i})}setFixedRotation(e){let{props:t,uuid:i}=e;this.postMessage({op:"setFixedRotation",props:t,uuid:i})}setIsTrigger(e){let{props:t,uuid:i}=e;this.postMessage({op:"setIsTrigger",props:t,uuid:i})}setLinearDamping(e){let{props:t,uuid:i}=e;this.postMessage({op:"setLinearDamping",props:t,uuid:i})}setLinearFactor(e){let{props:t,uuid:i}=e;this.postMessage({op:"setLinearFactor",props:t,uuid:i})}setMass(e){let{props:t,uuid:i}=e;this.postMessage({op:"setMass",props:t,uuid:i})}setMaterial(e){let{props:t,uuid:i}=e;this.postMessage({op:"setMaterial",props:t,uuid:i})}setPosition(e){let{props:t,uuid:i}=e;this.postMessage({op:"setPosition",props:t,uuid:i})}setQuaternion(e){let{props:[t,i,s,r],uuid:o}=e;this.postMessage({op:"setQuaternion",props:[t,i,s,r],uuid:o})}setRaycastVehicleBrake(e){let{props:t,uuid:i}=e;this.postMessage({op:"setRaycastVehicleBrake",props:t,uuid:i})}setRaycastVehicleSteeringValue(e){let{props:t,uuid:i}=e;this.postMessage({op:"setRaycastVehicleSteeringValue",props:t,uuid:i})}setRotation(e){let{props:t,uuid:i}=e;this.postMessage({op:"setRotation",props:t,uuid:i})}setSleepSpeedLimit(e){let{props:t,uuid:i}=e;this.postMessage({op:"setSleepSpeedLimit",props:t,uuid:i})}setSleepTimeLimit(e){let{props:t,uuid:i}=e;this.postMessage({op:"setSleepTimeLimit",props:t,uuid:i})}setSpringDamping(e){let{props:t,uuid:i}=e;this.postMessage({op:"setSpringDamping",props:t,uuid:i})}setSpringRestLength(e){let{props:t,uuid:i}=e;this.postMessage({op:"setSpringRestLength",props:t,uuid:i})}setSpringStiffness(e){let{props:t,uuid:i}=e;this.postMessage({op:"setSpringStiffness",props:t,uuid:i})}setUserData(e){let{props:t,uuid:i}=e;this.postMessage({op:"setUserData",props:t,uuid:i})}setVelocity(e){let{props:t,uuid:i}=e;this.postMessage({op:"setVelocity",props:t,uuid:i})}sleep(e){let{uuid:t}=e;this.postMessage({op:"sleep",uuid:t})}step(e){var t;const{buffers:{positions:i,quaternions:s}}=this;!i.byteLength&&!s.byteLength||(t=this.worker)==null||t.postMessage({op:"step",positions:i,props:e,quaternions:s},[i.buffer,s.buffer])}subscribe(e){let{props:{id:t,target:i,type:s},uuid:r}=e;this.postMessage({op:"subscribe",props:{id:t,target:i,type:s},uuid:r})}terminate(){var e;(e=this.worker)==null||e.terminate(),this.worker=null}unsubscribe(e){let{props:t}=e;this.postMessage({op:"unsubscribe",props:t})}wakeUp(e){let{uuid:t}=e;this.postMessage({op:"wakeUp",uuid:t})}postMessage(e){if(this.worker)return this.worker.postMessage(e);this.messageQueue.push(e)}}class po{constructor(e){e===void 0&&(e=[0,0,0,0,0,0,0,0,0]),this.elements=e}identity(){const e=this.elements;e[0]=1,e[1]=0,e[2]=0,e[3]=0,e[4]=1,e[5]=0,e[6]=0,e[7]=0,e[8]=1}setZero(){const e=this.elements;e[0]=0,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=0,e[6]=0,e[7]=0,e[8]=0}setTrace(e){const t=this.elements;t[0]=e.x,t[4]=e.y,t[8]=e.z}getTrace(e){e===void 0&&(e=new Y);const t=this.elements;return e.x=t[0],e.y=t[4],e.z=t[8],e}vmult(e,t){t===void 0&&(t=new Y);const i=this.elements,s=e.x,r=e.y,o=e.z;return t.x=i[0]*s+i[1]*r+i[2]*o,t.y=i[3]*s+i[4]*r+i[5]*o,t.z=i[6]*s+i[7]*r+i[8]*o,t}smult(e){for(let t=0;t0){const r=1/s;this.x*=r,this.y*=r,this.z*=r}else this.x=0,this.y=0,this.z=0;return s}unit(e){e===void 0&&(e=new Y);const t=this.x,i=this.y,s=this.z;let r=Math.sqrt(t*t+i*i+s*s);return r>0?(r=1/r,e.x=t*r,e.y=i*r,e.z=s*r):(e.x=1,e.y=0,e.z=0),e}length(){const e=this.x,t=this.y,i=this.z;return Math.sqrt(e*e+t*t+i*i)}lengthSquared(){return this.dot(this)}distanceTo(e){const t=this.x,i=this.y,s=this.z,r=e.x,o=e.y,a=e.z;return Math.sqrt((r-t)*(r-t)+(o-i)*(o-i)+(a-s)*(a-s))}distanceSquared(e){const t=this.x,i=this.y,s=this.z,r=e.x,o=e.y,a=e.z;return(r-t)*(r-t)+(o-i)*(o-i)+(a-s)*(a-s)}scale(e,t){t===void 0&&(t=new Y);const i=this.x,s=this.y,r=this.z;return t.x=e*i,t.y=e*s,t.z=e*r,t}vmul(e,t){return t===void 0&&(t=new Y),t.x=e.x*this.x,t.y=e.y*this.y,t.z=e.z*this.z,t}addScaledVector(e,t,i){return i===void 0&&(i=new Y),i.x=this.x+e*t.x,i.y=this.y+e*t.y,i.z=this.z+e*t.z,i}dot(e){return this.x*e.x+this.y*e.y+this.z*e.z}isZero(){return this.x===0&&this.y===0&&this.z===0}negate(e){return e===void 0&&(e=new Y),e.x=-this.x,e.y=-this.y,e.z=-this.z,e}tangents(e,t){const i=this.length();if(i>0){const s=Qk,r=1/i;s.set(this.x*r,this.y*r,this.z*r);const o=jk;Math.abs(s.x)<.9?(o.set(1,0,0),s.cross(o,e)):(o.set(0,1,0),s.cross(o,e)),s.cross(e,t)}else e.set(1,0,0),t.set(0,1,0)}toString(){return`${this.x},${this.y},${this.z}`}toArray(){return[this.x,this.y,this.z]}copy(e){return this.x=e.x,this.y=e.y,this.z=e.z,this}lerp(e,t,i){const s=this.x,r=this.y,o=this.z;i.x=s+(e.x-s)*t,i.y=r+(e.y-r)*t,i.z=o+(e.z-o)*t}almostEquals(e,t){return t===void 0&&(t=1e-6),!(Math.abs(this.x-e.x)>t||Math.abs(this.y-e.y)>t||Math.abs(this.z-e.z)>t)}almostZero(e){return e===void 0&&(e=1e-6),!(Math.abs(this.x)>e||Math.abs(this.y)>e||Math.abs(this.z)>e)}isAntiparallelTo(e,t){return this.negate(Dw),Dw.almostEquals(e,t)}clone(){return new Y(this.x,this.y,this.z)}}Y.ZERO=new Y(0,0,0);Y.UNIT_X=new Y(1,0,0);Y.UNIT_Y=new Y(0,1,0);Y.UNIT_Z=new Y(0,0,1);const Qk=new Y,jk=new Y,Dw=new Y;class _s{constructor(e){e===void 0&&(e={}),this.lowerBound=new Y,this.upperBound=new Y,e.lowerBound&&this.lowerBound.copy(e.lowerBound),e.upperBound&&this.upperBound.copy(e.upperBound)}setFromPoints(e,t,i,s){const r=this.lowerBound,o=this.upperBound,a=i;r.copy(e[0]),a&&a.vmult(r,r),o.copy(r);for(let l=1;lo.x&&(o.x=g.x),g.xo.y&&(o.y=g.y),g.yo.z&&(o.z=g.z),g.z=r.x&&t.y<=s.y&&i.y>=r.y&&t.z<=s.z&&i.z>=r.z}getCorners(e,t,i,s,r,o,a,l){const g=this.lowerBound,u=this.upperBound;e.copy(g),t.set(u.x,g.y,g.z),i.set(u.x,u.y,g.z),s.set(g.x,u.y,u.z),r.set(u.x,g.y,u.z),o.set(g.x,u.y,g.z),a.set(g.x,g.y,u.z),l.copy(u)}toLocalFrame(e,t){const i=Pw,s=i[0],r=i[1],o=i[2],a=i[3],l=i[4],g=i[5],u=i[6],C=i[7];this.getCorners(s,r,o,a,l,g,u,C);for(let d=0;d!==8;d++){const h=i[d];e.pointToLocal(h,h)}return t.setFromPoints(i)}toWorldFrame(e,t){const i=Pw,s=i[0],r=i[1],o=i[2],a=i[3],l=i[4],g=i[5],u=i[6],C=i[7];this.getCorners(s,r,o,a,l,g,u,C);for(let d=0;d!==8;d++){const h=i[d];e.pointToWorld(h,h)}return t.setFromPoints(i)}overlapsRay(e){const{direction:t,from:i}=e,s=1/t.x,r=1/t.y,o=1/t.z,a=(this.lowerBound.x-i.x)*s,l=(this.upperBound.x-i.x)*s,g=(this.lowerBound.y-i.y)*r,u=(this.upperBound.y-i.y)*r,C=(this.lowerBound.z-i.z)*o,d=(this.upperBound.z-i.z)*o,h=Math.max(Math.max(Math.min(a,l),Math.min(g,u)),Math.min(C,d)),f=Math.min(Math.min(Math.max(a,l),Math.max(g,u)),Math.max(C,d));return!(f<0||h>f)}}const Uw=new Y,Pw=[new Y,new Y,new Y,new Y,new Y,new Y,new Y,new Y];class Fi{constructor(e,t,i,s){e===void 0&&(e=0),t===void 0&&(t=0),i===void 0&&(i=0),s===void 0&&(s=1),this.x=e,this.y=t,this.z=i,this.w=s}set(e,t,i,s){return this.x=e,this.y=t,this.z=i,this.w=s,this}toString(){return`${this.x},${this.y},${this.z},${this.w}`}toArray(){return[this.x,this.y,this.z,this.w]}setFromAxisAngle(e,t){const i=Math.sin(t*.5);return this.x=e.x*i,this.y=e.y*i,this.z=e.z*i,this.w=Math.cos(t*.5),this}toAxisAngle(e){e===void 0&&(e=new Y),this.normalize();const t=2*Math.acos(this.w),i=Math.sqrt(1-this.w*this.w);return i<.001?(e.x=this.x,e.y=this.y,e.z=this.z):(e.x=this.x/i,e.y=this.y/i,e.z=this.z/i),[e,t]}setFromVectors(e,t){if(e.isAntiparallelTo(t)){const i=qk,s=$k;e.tangents(i,s),this.setFromAxisAngle(i,Math.PI)}else{const i=e.cross(t);this.x=i.x,this.y=i.y,this.z=i.z,this.w=Math.sqrt(e.length()**2*t.length()**2)+e.dot(t),this.normalize()}return this}mult(e,t){t===void 0&&(t=new Fi);const i=this.x,s=this.y,r=this.z,o=this.w,a=e.x,l=e.y,g=e.z,u=e.w;return t.x=i*u+o*a+s*g-r*l,t.y=s*u+o*l+r*a-i*g,t.z=r*u+o*g+i*l-s*a,t.w=o*u-i*a-s*l-r*g,t}inverse(e){e===void 0&&(e=new Fi);const t=this.x,i=this.y,s=this.z,r=this.w;this.conjugate(e);const o=1/(t*t+i*i+s*s+r*r);return e.x*=o,e.y*=o,e.z*=o,e.w*=o,e}conjugate(e){return e===void 0&&(e=new Fi),e.x=-this.x,e.y=-this.y,e.z=-this.z,e.w=this.w,e}normalize(){let e=Math.sqrt(this.x*this.x+this.y*this.y+this.z*this.z+this.w*this.w);return e===0?(this.x=0,this.y=0,this.z=0,this.w=0):(e=1/e,this.x*=e,this.y*=e,this.z*=e,this.w*=e),this}normalizeFast(){const e=(3-(this.x*this.x+this.y*this.y+this.z*this.z+this.w*this.w))/2;return e===0?(this.x=0,this.y=0,this.z=0,this.w=0):(this.x*=e,this.y*=e,this.z*=e,this.w*=e),this}vmult(e,t){t===void 0&&(t=new Y);const i=e.x,s=e.y,r=e.z,o=this.x,a=this.y,l=this.z,g=this.w,u=g*i+a*r-l*s,C=g*s+l*i-o*r,d=g*r+o*s-a*i,h=-o*i-a*s-l*r;return t.x=u*g+h*-o+C*-l-d*-a,t.y=C*g+h*-a+d*-o-u*-l,t.z=d*g+h*-l+u*-a-C*-o,t}copy(e){return this.x=e.x,this.y=e.y,this.z=e.z,this.w=e.w,this}toEuler(e,t){t===void 0&&(t="YZX");let i,s,r;const o=this.x,a=this.y,l=this.z,g=this.w;switch(t){case"YZX":const u=o*a+l*g;if(u>.499&&(i=2*Math.atan2(o,g),s=Math.PI/2,r=0),u<-.499&&(i=-2*Math.atan2(o,g),s=-Math.PI/2,r=0),i===void 0){const C=o*o,d=a*a,h=l*l;i=Math.atan2(2*a*g-2*o*l,1-2*d-2*h),s=Math.asin(2*u),r=Math.atan2(2*o*g-2*a*l,1-2*C-2*h)}break;default:throw new Error(`Euler order ${t} not supported yet.`)}e.y=i,e.z=s,e.x=r}setFromEuler(e,t,i,s){s===void 0&&(s="XYZ");const r=Math.cos(e/2),o=Math.cos(t/2),a=Math.cos(i/2),l=Math.sin(e/2),g=Math.sin(t/2),u=Math.sin(i/2);return s==="XYZ"?(this.x=l*o*a+r*g*u,this.y=r*g*a-l*o*u,this.z=r*o*u+l*g*a,this.w=r*o*a-l*g*u):s==="YXZ"?(this.x=l*o*a+r*g*u,this.y=r*g*a-l*o*u,this.z=r*o*u-l*g*a,this.w=r*o*a+l*g*u):s==="ZXY"?(this.x=l*o*a-r*g*u,this.y=r*g*a+l*o*u,this.z=r*o*u+l*g*a,this.w=r*o*a-l*g*u):s==="ZYX"?(this.x=l*o*a-r*g*u,this.y=r*g*a+l*o*u,this.z=r*o*u-l*g*a,this.w=r*o*a+l*g*u):s==="YZX"?(this.x=l*o*a+r*g*u,this.y=r*g*a+l*o*u,this.z=r*o*u-l*g*a,this.w=r*o*a-l*g*u):s==="XZY"&&(this.x=l*o*a-r*g*u,this.y=r*g*a-l*o*u,this.z=r*o*u+l*g*a,this.w=r*o*a+l*g*u),this}clone(){return new Fi(this.x,this.y,this.z,this.w)}slerp(e,t,i){i===void 0&&(i=new Fi);const s=this.x,r=this.y,o=this.z,a=this.w;let l=e.x,g=e.y,u=e.z,C=e.w,d,h,f,v,y;return h=s*l+r*g+o*u+a*C,h<0&&(h=-h,l=-l,g=-g,u=-u,C=-C),1-h>1e-6?(d=Math.acos(h),f=Math.sin(d),v=Math.sin((1-t)*d)/f,y=Math.sin(t*d)/f):(v=1-t,y=t),i.x=v*s+y*l,i.y=v*r+y*g,i.z=v*o+y*u,i.w=v*a+y*C,i}integrate(e,t,i,s){s===void 0&&(s=new Fi);const r=e.x*i.x,o=e.y*i.y,a=e.z*i.z,l=this.x,g=this.y,u=this.z,C=this.w,d=t*.5;return s.x+=d*(r*C+o*u-a*g),s.y+=d*(o*C+a*l-r*u),s.z+=d*(a*C+r*g-o*l),s.w+=d*(-r*l-o*g-a*u),s}}const qk=new Y,$k=new Y,eD={SPHERE:1,PLANE:2,BOX:4,COMPOUND:8,CONVEXPOLYHEDRON:16,HEIGHTFIELD:32,PARTICLE:64,CYLINDER:128,TRIMESH:256};class et{constructor(e){e===void 0&&(e={}),this.id=et.idCounter++,this.type=e.type||0,this.boundingSphereRadius=0,this.collisionResponse=e.collisionResponse?e.collisionResponse:!0,this.collisionFilterGroup=e.collisionFilterGroup!==void 0?e.collisionFilterGroup:1,this.collisionFilterMask=e.collisionFilterMask!==void 0?e.collisionFilterMask:-1,this.material=e.material?e.material:null,this.body=null}updateBoundingSphereRadius(){throw`computeBoundingSphereRadius() not implemented for shape type ${this.type}`}volume(){throw`volume() not implemented for shape type ${this.type}`}calculateLocalInertia(e,t){throw`calculateLocalInertia() not implemented for shape type ${this.type}`}calculateWorldAABB(e,t,i,s){throw`calculateWorldAABB() not implemented for shape type ${this.type}`}}et.idCounter=0;et.types=eD;class ji{constructor(e){e===void 0&&(e={}),this.position=new Y,this.quaternion=new Fi,e.position&&this.position.copy(e.position),e.quaternion&&this.quaternion.copy(e.quaternion)}pointToLocal(e,t){return ji.pointToLocalFrame(this.position,this.quaternion,e,t)}pointToWorld(e,t){return ji.pointToWorldFrame(this.position,this.quaternion,e,t)}vectorToWorldFrame(e,t){return t===void 0&&(t=new Y),this.quaternion.vmult(e,t),t}static pointToLocalFrame(e,t,i,s){return s===void 0&&(s=new Y),i.vsub(e,s),t.conjugate(_w),_w.vmult(s,s),s}static pointToWorldFrame(e,t,i,s){return s===void 0&&(s=new Y),t.vmult(i,s),s.vadd(e,s),s}static vectorToWorldFrame(e,t,i){return i===void 0&&(i=new Y),e.vmult(t,i),i}static vectorToLocalFrame(e,t,i,s){return s===void 0&&(s=new Y),t.w*=-1,t.vmult(i,s),t.w*=-1,s}}const _w=new Fi;new Y;new Y;new Y;new Y;new Y,new Y,new Y,new Y,new Y,new Y,new Y,new Y;new Y;new Fi;new _s;new po;new po;new po;new Y;new Y;new Y;new Y;new Y;new Y;new Y;new Y;new Y;new Y;new Fi;new Y;new Y;new Y;new Y;class Kb{constructor(){this.rayFromWorld=new Y,this.rayToWorld=new Y,this.hitNormalWorld=new Y,this.hitPointWorld=new Y,this.hasHit=!1,this.shape=null,this.body=null,this.hitFaceIndex=-1,this.distance=-1,this.shouldStop=!1}reset(){this.rayFromWorld.setZero(),this.rayToWorld.setZero(),this.hitNormalWorld.setZero(),this.hitPointWorld.setZero(),this.hasHit=!1,this.shape=null,this.body=null,this.hitFaceIndex=-1,this.distance=-1,this.shouldStop=!1}abort(){this.shouldStop=!0}set(e,t,i,s,r,o,a){this.rayFromWorld.copy(e),this.rayToWorld.copy(t),this.hitNormalWorld.copy(i),this.hitPointWorld.copy(s),this.shape=r,this.body=o,this.distance=a}}let dM,hM,AM,pM,fM,mM,bM;const Ly={CLOSEST:1,ANY:2,ALL:4};dM=et.types.SPHERE;hM=et.types.PLANE;AM=et.types.BOX;pM=et.types.CYLINDER;fM=et.types.CONVEXPOLYHEDRON;mM=et.types.HEIGHTFIELD;bM=et.types.TRIMESH;class Si{get[dM](){return this._intersectSphere}get[hM](){return this._intersectPlane}get[AM](){return this._intersectBox}get[pM](){return this._intersectConvex}get[fM](){return this._intersectConvex}get[mM](){return this._intersectHeightfield}get[bM](){return this._intersectTrimesh}constructor(e,t){e===void 0&&(e=new Y),t===void 0&&(t=new Y),this.from=e.clone(),this.to=t.clone(),this.direction=new Y,this.precision=1e-4,this.checkCollisionResponse=!0,this.skipBackfaces=!1,this.collisionFilterMask=-1,this.collisionFilterGroup=-1,this.mode=Si.ANY,this.result=new Kb,this.hasHit=!1,this.callback=i=>{}}intersectWorld(e,t){return this.mode=t.mode||Si.ANY,this.result=t.result||new Kb,this.skipBackfaces=!!t.skipBackfaces,this.collisionFilterMask=typeof t.collisionFilterMask<"u"?t.collisionFilterMask:-1,this.collisionFilterGroup=typeof t.collisionFilterGroup<"u"?t.collisionFilterGroup:-1,this.checkCollisionResponse=typeof t.checkCollisionResponse<"u"?t.checkCollisionResponse:!0,t.from&&this.from.copy(t.from),t.to&&this.to.copy(t.to),this.callback=t.callback||(()=>{}),this.hasHit=!1,this.result.reset(),this.updateDirection(),this.getAABB(Jw),Lm.length=0,e.broadphase.aabbQuery(e,Jw,Lm),this.intersectBodies(Lm),this.hasHit}intersectBody(e,t){t&&(this.result=t,this.updateDirection());const i=this.checkCollisionResponse;if(i&&!e.collisionResponse||!(this.collisionFilterGroup&e.collisionFilterMask)||!(e.collisionFilterGroup&this.collisionFilterMask))return;const s=tD,r=nD;for(let o=0,a=e.shapes.length;oe.boundingSphereRadius)return;const a=this[e.type];a&&a.call(this,e,t,i,s,e)}_intersectBox(e,t,i,s,r){return this._intersectConvex(e.convexPolyhedronRepresentation,t,i,s,r)}_intersectPlane(e,t,i,s,r){const o=this.from,a=this.to,l=this.direction,g=new Y(0,0,1);t.vmult(g,g);const u=new Y;o.vsub(i,u);const C=u.dot(g);a.vsub(i,u);const d=u.dot(g);if(C*d>0||o.distanceTo(a)=0&&v<=1&&(o.lerp(a,v,h),h.vsub(i,f),f.normalize(),this.reportIntersection(f,h,r,s,-1)),this.result.shouldStop)return;y>=0&&y<=1&&(o.lerp(a,y,h),h.vsub(i,f),f.normalize(),this.reportIntersection(f,h,r,s,-1))}}_intersectConvex(e,t,i,s,r,o){const a=aD,l=Qw,g=o&&o.faceList||null,u=e.faces,C=e.vertices,d=e.faceNormals,h=this.direction,f=this.from,v=this.to,y=f.distanceTo(v),A=g?g.length:u.length,b=this.result;for(let m=0;!b.shouldStop&&my||this.reportIntersection(a,_i,r,s,B)}}}}_intersectTrimesh(e,t,i,s,r,o){const a=lD,l=dD,g=hD,u=Qw,C=gD,d=cD,h=ID,f=CD,v=uD,y=e.indices;e.vertices;const A=this.from,b=this.to,m=this.direction;g.position.copy(i),g.quaternion.copy(t),ji.vectorToLocalFrame(i,t,m,C),ji.pointToLocalFrame(i,t,A,d),ji.pointToLocalFrame(i,t,b,h),h.x*=e.scale.x,h.y*=e.scale.y,h.z*=e.scale.z,d.x*=e.scale.x,d.y*=e.scale.y,d.z*=e.scale.z,h.vsub(d,C),C.normalize();const B=d.distanceSquared(h);e.tree.rayQuery(this,g,l);for(let S=0,x=l.length;!this.result.shouldStop&&S!==x;S++){const R=l[S];e.getNormal(R,a),e.getVertex(y[R*3],rr),rr.vsub(d,u);const M=C.dot(a),Z=a.dot(u)/M;if(Z<0)continue;C.scale(Z,_i),_i.vadd(d,_i),e.getVertex(y[R*3+1],Vr),e.getVertex(y[R*3+2],Mr);const V=_i.distanceSquared(d);!(Si.pointInTriangle(_i,Vr,rr,Mr)||Si.pointInTriangle(_i,rr,Vr,Mr))||V>B||(ji.vectorToWorldFrame(t,a,v),ji.pointToWorldFrame(i,t,_i,f),this.reportIntersection(v,f,r,s,R))}l.length=0}reportIntersection(e,t,i,s,r){const o=this.from,a=this.to,l=o.distanceTo(t),g=this.result;if(!(this.skipBackfaces&&e.dot(this.direction)>0))switch(g.hitFaceIndex=typeof r<"u"?r:-1,this.mode){case Si.ALL:this.hasHit=!0,g.set(o,a,e,t,i,s,l),g.hasHit=!0,this.callback(g);break;case Si.CLOSEST:(l=0&&(C=r*g-o*a)>=0&&u+CDate.now()-n}new Y;class fo{constructor(e){e===void 0&&(e=[0,0,0,0,0,0,0,0,0]),this.elements=e}identity(){const e=this.elements;e[0]=1,e[1]=0,e[2]=0,e[3]=0,e[4]=1,e[5]=0,e[6]=0,e[7]=0,e[8]=1}setZero(){const e=this.elements;e[0]=0,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=0,e[6]=0,e[7]=0,e[8]=0}setTrace(e){const t=this.elements;t[0]=e.x,t[4]=e.y,t[8]=e.z}getTrace(e){e===void 0&&(e=new K);const t=this.elements;return e.x=t[0],e.y=t[4],e.z=t[8],e}vmult(e,t){t===void 0&&(t=new K);const i=this.elements,s=e.x,r=e.y,o=e.z;return t.x=i[0]*s+i[1]*r+i[2]*o,t.y=i[3]*s+i[4]*r+i[5]*o,t.z=i[6]*s+i[7]*r+i[8]*o,t}smult(e){for(let t=0;t0){const r=1/s;this.x*=r,this.y*=r,this.z*=r}else this.x=0,this.y=0,this.z=0;return s}unit(e){e===void 0&&(e=new K);const t=this.x,i=this.y,s=this.z;let r=Math.sqrt(t*t+i*i+s*s);return r>0?(r=1/r,e.x=t*r,e.y=i*r,e.z=s*r):(e.x=1,e.y=0,e.z=0),e}length(){const e=this.x,t=this.y,i=this.z;return Math.sqrt(e*e+t*t+i*i)}lengthSquared(){return this.dot(this)}distanceTo(e){const t=this.x,i=this.y,s=this.z,r=e.x,o=e.y,a=e.z;return Math.sqrt((r-t)*(r-t)+(o-i)*(o-i)+(a-s)*(a-s))}distanceSquared(e){const t=this.x,i=this.y,s=this.z,r=e.x,o=e.y,a=e.z;return(r-t)*(r-t)+(o-i)*(o-i)+(a-s)*(a-s)}scale(e,t){t===void 0&&(t=new K);const i=this.x,s=this.y,r=this.z;return t.x=e*i,t.y=e*s,t.z=e*r,t}vmul(e,t){return t===void 0&&(t=new K),t.x=e.x*this.x,t.y=e.y*this.y,t.z=e.z*this.z,t}addScaledVector(e,t,i){return i===void 0&&(i=new K),i.x=this.x+e*t.x,i.y=this.y+e*t.y,i.z=this.z+e*t.z,i}dot(e){return this.x*e.x+this.y*e.y+this.z*e.z}isZero(){return this.x===0&&this.y===0&&this.z===0}negate(e){return e===void 0&&(e=new K),e.x=-this.x,e.y=-this.y,e.z=-this.z,e}tangents(e,t){const i=this.length();if(i>0){const s=fD,r=1/i;s.set(this.x*r,this.y*r,this.z*r);const o=mD;Math.abs(s.x)<.9?(o.set(1,0,0),s.cross(o,e)):(o.set(0,1,0),s.cross(o,e)),s.cross(e,t)}else e.set(1,0,0),t.set(0,1,0)}toString(){return`${this.x},${this.y},${this.z}`}toArray(){return[this.x,this.y,this.z]}copy(e){return this.x=e.x,this.y=e.y,this.z=e.z,this}lerp(e,t,i){const s=this.x,r=this.y,o=this.z;i.x=s+(e.x-s)*t,i.y=r+(e.y-r)*t,i.z=o+(e.z-o)*t}almostEquals(e,t){return t===void 0&&(t=1e-6),!(Math.abs(this.x-e.x)>t||Math.abs(this.y-e.y)>t||Math.abs(this.z-e.z)>t)}almostZero(e){return e===void 0&&(e=1e-6),!(Math.abs(this.x)>e||Math.abs(this.y)>e||Math.abs(this.z)>e)}isAntiparallelTo(e,t){return this.negate(jw),jw.almostEquals(e,t)}clone(){return new K(this.x,this.y,this.z)}}K.ZERO=new K(0,0,0);K.UNIT_X=new K(1,0,0);K.UNIT_Y=new K(0,1,0);K.UNIT_Z=new K(0,0,1);const fD=new K,mD=new K,jw=new K;class Js{constructor(e){e===void 0&&(e={}),this.lowerBound=new K,this.upperBound=new K,e.lowerBound&&this.lowerBound.copy(e.lowerBound),e.upperBound&&this.upperBound.copy(e.upperBound)}setFromPoints(e,t,i,s){const r=this.lowerBound,o=this.upperBound,a=i;r.copy(e[0]),a&&a.vmult(r,r),o.copy(r);for(let l=1;lo.x&&(o.x=g.x),g.xo.y&&(o.y=g.y),g.yo.z&&(o.z=g.z),g.z=r.x&&t.y<=s.y&&i.y>=r.y&&t.z<=s.z&&i.z>=r.z}getCorners(e,t,i,s,r,o,a,l){const g=this.lowerBound,u=this.upperBound;e.copy(g),t.set(u.x,g.y,g.z),i.set(u.x,u.y,g.z),s.set(g.x,u.y,u.z),r.set(u.x,g.y,u.z),o.set(g.x,u.y,g.z),a.set(g.x,g.y,u.z),l.copy(u)}toLocalFrame(e,t){const i=$w,s=i[0],r=i[1],o=i[2],a=i[3],l=i[4],g=i[5],u=i[6],C=i[7];this.getCorners(s,r,o,a,l,g,u,C);for(let d=0;d!==8;d++){const h=i[d];e.pointToLocal(h,h)}return t.setFromPoints(i)}toWorldFrame(e,t){const i=$w,s=i[0],r=i[1],o=i[2],a=i[3],l=i[4],g=i[5],u=i[6],C=i[7];this.getCorners(s,r,o,a,l,g,u,C);for(let d=0;d!==8;d++){const h=i[d];e.pointToWorld(h,h)}return t.setFromPoints(i)}overlapsRay(e){const{direction:t,from:i}=e,s=1/t.x,r=1/t.y,o=1/t.z,a=(this.lowerBound.x-i.x)*s,l=(this.upperBound.x-i.x)*s,g=(this.lowerBound.y-i.y)*r,u=(this.upperBound.y-i.y)*r,C=(this.lowerBound.z-i.z)*o,d=(this.upperBound.z-i.z)*o,h=Math.max(Math.max(Math.min(a,l),Math.min(g,u)),Math.min(C,d)),f=Math.min(Math.min(Math.max(a,l),Math.max(g,u)),Math.max(C,d));return!(f<0||h>f)}}const qw=new K,$w=[new K,new K,new K,new K,new K,new K,new K,new K];class Yi{constructor(e,t,i,s){e===void 0&&(e=0),t===void 0&&(t=0),i===void 0&&(i=0),s===void 0&&(s=1),this.x=e,this.y=t,this.z=i,this.w=s}set(e,t,i,s){return this.x=e,this.y=t,this.z=i,this.w=s,this}toString(){return`${this.x},${this.y},${this.z},${this.w}`}toArray(){return[this.x,this.y,this.z,this.w]}setFromAxisAngle(e,t){const i=Math.sin(t*.5);return this.x=e.x*i,this.y=e.y*i,this.z=e.z*i,this.w=Math.cos(t*.5),this}toAxisAngle(e){e===void 0&&(e=new K),this.normalize();const t=2*Math.acos(this.w),i=Math.sqrt(1-this.w*this.w);return i<.001?(e.x=this.x,e.y=this.y,e.z=this.z):(e.x=this.x/i,e.y=this.y/i,e.z=this.z/i),[e,t]}setFromVectors(e,t){if(e.isAntiparallelTo(t)){const i=bD,s=vD;e.tangents(i,s),this.setFromAxisAngle(i,Math.PI)}else{const i=e.cross(t);this.x=i.x,this.y=i.y,this.z=i.z,this.w=Math.sqrt(e.length()**2*t.length()**2)+e.dot(t),this.normalize()}return this}mult(e,t){t===void 0&&(t=new Yi);const i=this.x,s=this.y,r=this.z,o=this.w,a=e.x,l=e.y,g=e.z,u=e.w;return t.x=i*u+o*a+s*g-r*l,t.y=s*u+o*l+r*a-i*g,t.z=r*u+o*g+i*l-s*a,t.w=o*u-i*a-s*l-r*g,t}inverse(e){e===void 0&&(e=new Yi);const t=this.x,i=this.y,s=this.z,r=this.w;this.conjugate(e);const o=1/(t*t+i*i+s*s+r*r);return e.x*=o,e.y*=o,e.z*=o,e.w*=o,e}conjugate(e){return e===void 0&&(e=new Yi),e.x=-this.x,e.y=-this.y,e.z=-this.z,e.w=this.w,e}normalize(){let e=Math.sqrt(this.x*this.x+this.y*this.y+this.z*this.z+this.w*this.w);return e===0?(this.x=0,this.y=0,this.z=0,this.w=0):(e=1/e,this.x*=e,this.y*=e,this.z*=e,this.w*=e),this}normalizeFast(){const e=(3-(this.x*this.x+this.y*this.y+this.z*this.z+this.w*this.w))/2;return e===0?(this.x=0,this.y=0,this.z=0,this.w=0):(this.x*=e,this.y*=e,this.z*=e,this.w*=e),this}vmult(e,t){t===void 0&&(t=new K);const i=e.x,s=e.y,r=e.z,o=this.x,a=this.y,l=this.z,g=this.w,u=g*i+a*r-l*s,C=g*s+l*i-o*r,d=g*r+o*s-a*i,h=-o*i-a*s-l*r;return t.x=u*g+h*-o+C*-l-d*-a,t.y=C*g+h*-a+d*-o-u*-l,t.z=d*g+h*-l+u*-a-C*-o,t}copy(e){return this.x=e.x,this.y=e.y,this.z=e.z,this.w=e.w,this}toEuler(e,t){t===void 0&&(t="YZX");let i,s,r;const o=this.x,a=this.y,l=this.z,g=this.w;switch(t){case"YZX":const u=o*a+l*g;if(u>.499&&(i=2*Math.atan2(o,g),s=Math.PI/2,r=0),u<-.499&&(i=-2*Math.atan2(o,g),s=-Math.PI/2,r=0),i===void 0){const C=o*o,d=a*a,h=l*l;i=Math.atan2(2*a*g-2*o*l,1-2*d-2*h),s=Math.asin(2*u),r=Math.atan2(2*o*g-2*a*l,1-2*C-2*h)}break;default:throw new Error(`Euler order ${t} not supported yet.`)}e.y=i,e.z=s,e.x=r}setFromEuler(e,t,i,s){s===void 0&&(s="XYZ");const r=Math.cos(e/2),o=Math.cos(t/2),a=Math.cos(i/2),l=Math.sin(e/2),g=Math.sin(t/2),u=Math.sin(i/2);return s==="XYZ"?(this.x=l*o*a+r*g*u,this.y=r*g*a-l*o*u,this.z=r*o*u+l*g*a,this.w=r*o*a-l*g*u):s==="YXZ"?(this.x=l*o*a+r*g*u,this.y=r*g*a-l*o*u,this.z=r*o*u-l*g*a,this.w=r*o*a+l*g*u):s==="ZXY"?(this.x=l*o*a-r*g*u,this.y=r*g*a+l*o*u,this.z=r*o*u+l*g*a,this.w=r*o*a-l*g*u):s==="ZYX"?(this.x=l*o*a-r*g*u,this.y=r*g*a+l*o*u,this.z=r*o*u-l*g*a,this.w=r*o*a+l*g*u):s==="YZX"?(this.x=l*o*a+r*g*u,this.y=r*g*a+l*o*u,this.z=r*o*u-l*g*a,this.w=r*o*a-l*g*u):s==="XZY"&&(this.x=l*o*a-r*g*u,this.y=r*g*a-l*o*u,this.z=r*o*u+l*g*a,this.w=r*o*a+l*g*u),this}clone(){return new Yi(this.x,this.y,this.z,this.w)}slerp(e,t,i){i===void 0&&(i=new Yi);const s=this.x,r=this.y,o=this.z,a=this.w;let l=e.x,g=e.y,u=e.z,C=e.w,d,h,f,v,y;return h=s*l+r*g+o*u+a*C,h<0&&(h=-h,l=-l,g=-g,u=-u,C=-C),1-h>1e-6?(d=Math.acos(h),f=Math.sin(d),v=Math.sin((1-t)*d)/f,y=Math.sin(t*d)/f):(v=1-t,y=t),i.x=v*s+y*l,i.y=v*r+y*g,i.z=v*o+y*u,i.w=v*a+y*C,i}integrate(e,t,i,s){s===void 0&&(s=new Yi);const r=e.x*i.x,o=e.y*i.y,a=e.z*i.z,l=this.x,g=this.y,u=this.z,C=this.w,d=t*.5;return s.x+=d*(r*C+o*u-a*g),s.y+=d*(o*C+a*l-r*u),s.z+=d*(a*C+r*g-o*l),s.w+=d*(-r*l-o*g-a*u),s}}const bD=new K,vD=new K,yD={SPHERE:1,PLANE:2,BOX:4,COMPOUND:8,CONVEXPOLYHEDRON:16,HEIGHTFIELD:32,PARTICLE:64,CYLINDER:128,TRIMESH:256};class tt{constructor(e){e===void 0&&(e={}),this.id=tt.idCounter++,this.type=e.type||0,this.boundingSphereRadius=0,this.collisionResponse=e.collisionResponse?e.collisionResponse:!0,this.collisionFilterGroup=e.collisionFilterGroup!==void 0?e.collisionFilterGroup:1,this.collisionFilterMask=e.collisionFilterMask!==void 0?e.collisionFilterMask:-1,this.material=e.material?e.material:null,this.body=null}updateBoundingSphereRadius(){throw`computeBoundingSphereRadius() not implemented for shape type ${this.type}`}volume(){throw`volume() not implemented for shape type ${this.type}`}calculateLocalInertia(e,t){throw`calculateLocalInertia() not implemented for shape type ${this.type}`}calculateWorldAABB(e,t,i,s){throw`calculateWorldAABB() not implemented for shape type ${this.type}`}}tt.idCounter=0;tt.types=yD;class qi{constructor(e){e===void 0&&(e={}),this.position=new K,this.quaternion=new Yi,e.position&&this.position.copy(e.position),e.quaternion&&this.quaternion.copy(e.quaternion)}pointToLocal(e,t){return qi.pointToLocalFrame(this.position,this.quaternion,e,t)}pointToWorld(e,t){return qi.pointToWorldFrame(this.position,this.quaternion,e,t)}vectorToWorldFrame(e,t){return t===void 0&&(t=new K),this.quaternion.vmult(e,t),t}static pointToLocalFrame(e,t,i,s){return s===void 0&&(s=new K),i.vsub(e,s),t.conjugate(eS),eS.vmult(s,s),s}static pointToWorldFrame(e,t,i,s){return s===void 0&&(s=new K),t.vmult(i,s),s.vadd(e,s),s}static vectorToWorldFrame(e,t,i){return i===void 0&&(i=new K),e.vmult(t,i),i}static vectorToLocalFrame(e,t,i,s){return s===void 0&&(s=new K),t.w*=-1,t.vmult(i,s),t.w*=-1,s}}const eS=new Yi;new K;new K;new K;new K;new K,new K,new K,new K,new K,new K,new K,new K;new K;new Yi;new Js;new fo;new fo;new fo;new K;new K;new K;new K;new K;new K;new K;new K;new K;new K;new Yi;new K;new K;new K;new K;class zb{constructor(){this.rayFromWorld=new K,this.rayToWorld=new K,this.hitNormalWorld=new K,this.hitPointWorld=new K,this.hasHit=!1,this.shape=null,this.body=null,this.hitFaceIndex=-1,this.distance=-1,this.shouldStop=!1}reset(){this.rayFromWorld.setZero(),this.rayToWorld.setZero(),this.hitNormalWorld.setZero(),this.hitPointWorld.setZero(),this.hasHit=!1,this.shape=null,this.body=null,this.hitFaceIndex=-1,this.distance=-1,this.shouldStop=!1}abort(){this.shouldStop=!0}set(e,t,i,s,r,o,a){this.rayFromWorld.copy(e),this.rayToWorld.copy(t),this.hitNormalWorld.copy(i),this.hitPointWorld.copy(s),this.shape=r,this.body=o,this.distance=a}}let vM,yM,GM,BM,ZM,wM,SM;const Ey={CLOSEST:1,ANY:2,ALL:4};vM=tt.types.SPHERE;yM=tt.types.PLANE;GM=tt.types.BOX;BM=tt.types.CYLINDER;ZM=tt.types.CONVEXPOLYHEDRON;wM=tt.types.HEIGHTFIELD;SM=tt.types.TRIMESH;class xi{get[vM](){return this._intersectSphere}get[yM](){return this._intersectPlane}get[GM](){return this._intersectBox}get[BM](){return this._intersectConvex}get[ZM](){return this._intersectConvex}get[wM](){return this._intersectHeightfield}get[SM](){return this._intersectTrimesh}constructor(e,t){e===void 0&&(e=new K),t===void 0&&(t=new K),this.from=e.clone(),this.to=t.clone(),this.direction=new K,this.precision=1e-4,this.checkCollisionResponse=!0,this.skipBackfaces=!1,this.collisionFilterMask=-1,this.collisionFilterGroup=-1,this.mode=xi.ANY,this.result=new zb,this.hasHit=!1,this.callback=i=>{}}intersectWorld(e,t){return this.mode=t.mode||xi.ANY,this.result=t.result||new zb,this.skipBackfaces=!!t.skipBackfaces,this.collisionFilterMask=typeof t.collisionFilterMask<"u"?t.collisionFilterMask:-1,this.collisionFilterGroup=typeof t.collisionFilterGroup<"u"?t.collisionFilterGroup:-1,this.checkCollisionResponse=typeof t.checkCollisionResponse<"u"?t.checkCollisionResponse:!0,t.from&&this.from.copy(t.from),t.to&&this.to.copy(t.to),this.callback=t.callback||(()=>{}),this.hasHit=!1,this.result.reset(),this.updateDirection(),this.getAABB(tS),Tm.length=0,e.broadphase.aabbQuery(e,tS,Tm),this.intersectBodies(Tm),this.hasHit}intersectBody(e,t){t&&(this.result=t,this.updateDirection());const i=this.checkCollisionResponse;if(i&&!e.collisionResponse||!(this.collisionFilterGroup&e.collisionFilterMask)||!(e.collisionFilterGroup&this.collisionFilterMask))return;const s=GD,r=BD;for(let o=0,a=e.shapes.length;oe.boundingSphereRadius)return;const a=this[e.type];a&&a.call(this,e,t,i,s,e)}_intersectBox(e,t,i,s,r){return this._intersectConvex(e.convexPolyhedronRepresentation,t,i,s,r)}_intersectPlane(e,t,i,s,r){const o=this.from,a=this.to,l=this.direction,g=new K(0,0,1);t.vmult(g,g);const u=new K;o.vsub(i,u);const C=u.dot(g);a.vsub(i,u);const d=u.dot(g);if(C*d>0||o.distanceTo(a)=0&&v<=1&&(o.lerp(a,v,h),h.vsub(i,f),f.normalize(),this.reportIntersection(f,h,r,s,-1)),this.result.shouldStop)return;y>=0&&y<=1&&(o.lerp(a,y,h),h.vsub(i,f),f.normalize(),this.reportIntersection(f,h,r,s,-1))}}_intersectConvex(e,t,i,s,r,o){const a=RD,l=iS,g=o&&o.faceList||null,u=e.faces,C=e.vertices,d=e.faceNormals,h=this.direction,f=this.from,v=this.to,y=f.distanceTo(v),A=g?g.length:u.length,b=this.result;for(let m=0;!b.shouldStop&&my||this.reportIntersection(a,Ji,r,s,B)}}}}_intersectTrimesh(e,t,i,s,r,o){const a=WD,l=FD,g=YD,u=iS,C=VD,d=MD,h=ND,f=XD,v=HD,y=e.indices;e.vertices;const A=this.from,b=this.to,m=this.direction;g.position.copy(i),g.quaternion.copy(t),qi.vectorToLocalFrame(i,t,m,C),qi.pointToLocalFrame(i,t,A,d),qi.pointToLocalFrame(i,t,b,h),h.x*=e.scale.x,h.y*=e.scale.y,h.z*=e.scale.z,d.x*=e.scale.x,d.y*=e.scale.y,d.z*=e.scale.z,h.vsub(d,C),C.normalize();const B=d.distanceSquared(h);e.tree.rayQuery(this,g,l);for(let S=0,x=l.length;!this.result.shouldStop&&S!==x;S++){const R=l[S];e.getNormal(R,a),e.getVertex(y[R*3],or),or.vsub(d,u);const M=C.dot(a),Z=a.dot(u)/M;if(Z<0)continue;C.scale(Z,Ji),Ji.vadd(d,Ji),e.getVertex(y[R*3+1],Nr),e.getVertex(y[R*3+2],Hr);const V=Ji.distanceSquared(d);!(xi.pointInTriangle(Ji,Nr,or,Hr)||xi.pointInTriangle(Ji,or,Nr,Hr))||V>B||(qi.vectorToWorldFrame(t,a,v),qi.pointToWorldFrame(i,t,Ji,f),this.reportIntersection(v,f,r,s,R))}l.length=0}reportIntersection(e,t,i,s,r){const o=this.from,a=this.to,l=o.distanceTo(t),g=this.result;if(!(this.skipBackfaces&&e.dot(this.direction)>0))switch(g.hitFaceIndex=typeof r<"u"?r:-1,this.mode){case xi.ALL:this.hasHit=!0,g.set(o,a,e,t,i,s,l),g.hasHit=!0,this.callback(g);break;case xi.CLOSEST:(l=0&&(C=r*g-o*a)>=0&&u+CDate.now()-n}new K;const zD=k.createContext(null),LD=()=>k.useContext(zD),xM=k.createContext(null),ED=()=>{const n=k.useContext(xM);if(!n)throw new Error("Physics context not found. @react-three/cannon & components can only be used within a Physics provider");return n};new H(1,1,1);new H;new _e;const sS=new zt;function TD(n){const e=k.useRef(null);return n&&typeof n!="function"?n:e}function rS(n){return n.charAt(0).toUpperCase()+n.slice(1)}function ci(n,e){const t=e===void 0?"":`/${e}`;return typeof n=="function"?null:n&&n.current&&`${n.current.uuid}${t}`}const kD=new Xl,DD=new Mn,UD=n=>e=>n(kD.setFromQuaternion(DD.fromArray(e)).toArray());let RM=0;function Dm(n,e,t,i,s,r){return r===void 0&&(r="bodies"),o=>{const a=RM++;t[a]={[i]:o};const l=ci(n,s);return l&&e.subscribe({props:{id:a,target:r,type:i},uuid:l}),()=>{delete t[a],e.unsubscribe({props:a})}}}function oS(n,e){let{position:t=[0,0,0],rotation:i=[0,0,0],userData:s={}}=e;n.userData=s,n.position.set(...t),n.rotation.set(...i),n.updateMatrix()}function aS(n,e,t){let{onCollide:i,onCollideBegin:s,onCollideEnd:r}=e;n[t]={collide:i,collideBegin:s,collideEnd:r}}function PD(n,e,t,i,s){i===void 0&&(i=null),s===void 0&&(s=[]);const r=TD(i),{events:o,refs:a,scaleOverrides:l,subscriptions:g,worker:u}=ED(),C=LD();k.useLayoutEffect(()=>{r.current||(r.current=new zt);const h=r.current,f=u,v=h instanceof oc?(h.instanceMatrix.setUsage(SW),h.count):1,y=h instanceof oc?new Array(v).fill(0).map((b,m)=>`${h.uuid}/${m}`):[h.uuid],A=h instanceof oc?y.map((b,m)=>{const B=e(m);return oS(sS,B),h.setMatrixAt(m,sS.matrix),h.instanceMatrix.needsUpdate=!0,a[b]=h,C?.add(b,B,n),aS(o,B,b),{...B,args:t(B.args)}}):y.map((b,m)=>{const B=e(m);return oS(h,B),a[b]=h,C?.add(b,B,n),aS(o,B,b),{...B,args:t(B.args)}});return f.addBodies({props:A.map(b=>{let{onCollide:m,onCollideBegin:B,onCollideEnd:S,...x}=b;return{onCollide:!!m,...x}}),type:n,uuid:y}),()=>{y.forEach(b=>{delete a[b],C?.remove(b),delete o[b]}),f.removeBodies({uuid:y})}},s);const d=k.useMemo(()=>{const h=(m,B)=>{const S=`set${rS(m)}`;return{set:x=>{const R=ci(r,B);R&&u[S]({props:x,uuid:R})},subscribe:Dm(r,u,g,m,B)}},f=m=>({copy:S=>{let{w:x,x:R,y:M,z:Z}=S;const V=ci(r,m);V&&u.setQuaternion({props:[R,M,Z,x],uuid:V})},set:(S,x,R,M)=>{const Z=ci(r,m);Z&&u.setQuaternion({props:[S,x,R,M],uuid:Z})},subscribe:Dm(r,u,g,"quaternion",m)}),v=m=>({copy:B=>{let{x:S,y:x,z:R}=B;const M=ci(r,m);M&&u.setRotation({props:[S,x,R],uuid:M})},set:(B,S,x)=>{const R=ci(r,m);R&&u.setRotation({props:[B,S,x],uuid:R})},subscribe:B=>{const S=RM++,x="bodies",R="quaternion",M=ci(r,m);return g[S]={[R]:UD(B)},M&&u.subscribe({props:{id:S,target:x,type:R},uuid:M}),()=>{delete g[S],u.unsubscribe({props:S})}}}),y=(m,B)=>{const S=`set${rS(m)}`;return{copy:x=>{let{x:R,y:M,z:Z}=x;const V=ci(r,B);V&&u[S]({props:[R,M,Z],uuid:V})},set:(x,R,M)=>{const Z=ci(r,B);Z&&u[S]({props:[x,R,M],uuid:Z})},subscribe:Dm(r,u,g,m,B)}};function A(m){return{allowSleep:h("allowSleep",m),angularDamping:h("angularDamping",m),angularFactor:y("angularFactor",m),angularVelocity:y("angularVelocity",m),applyForce(B,S){const x=ci(r,m);x&&u.applyForce({props:[B,S],uuid:x})},applyImpulse(B,S){const x=ci(r,m);x&&u.applyImpulse({props:[B,S],uuid:x})},applyLocalForce(B,S){const x=ci(r,m);x&&u.applyLocalForce({props:[B,S],uuid:x})},applyLocalImpulse(B,S){const x=ci(r,m);x&&u.applyLocalImpulse({props:[B,S],uuid:x})},applyTorque(B){const S=ci(r,m);S&&u.applyTorque({props:[B],uuid:S})},collisionFilterGroup:h("collisionFilterGroup",m),collisionFilterMask:h("collisionFilterMask",m),collisionResponse:h("collisionResponse",m),fixedRotation:h("fixedRotation",m),isTrigger:h("isTrigger",m),linearDamping:h("linearDamping",m),linearFactor:y("linearFactor",m),mass:h("mass",m),material:h("material",m),position:y("position",m),quaternion:f(m),rotation:v(m),scaleOverride(B){const S=ci(r,m);S&&(l[S]=new H(...B))},sleep(){const B=ci(r,m);B&&u.sleep({uuid:B})},sleepSpeedLimit:h("sleepSpeedLimit",m),sleepTimeLimit:h("sleepTimeLimit",m),userData:h("userData",m),velocity:y("velocity",m),wakeUp(){const B=ci(r,m);B&&u.wakeUp({uuid:B})}}}const b={};return{...A(void 0),at:m=>b[m]||(b[m]=A(m))}},[]);return[r,d]}function WM(n,e,t){return PD("Sphere",n,function(i){if(i===void 0&&(i=[1]),!Array.isArray(i))throw new Error("useSphere args must be an array");return[i[0]]},e,t)}const _D=new H,JD=new H(1,1,1),OD=new Mn,Zh=new _e;function lS(n,e,t,i,s){return i===void 0&&(i=JD),n!==void 0?(Zh.compose(_D.fromArray(e,n*3),OD.fromArray(t,n*4),i),s&&(s.matrixAutoUpdate=!1,s.matrix.copy(Zh)),Zh):Zh.identity()}const QD=()=>{const n=[];return e=>n.includes(e)?!1:!!n.push(e)};function jD(n){let{allowSleep:e=!1,axisIndex:t=0,broadphase:i="Naive",children:s,defaultContactMaterial:r={contactEquationStiffness:1e6},frictionGravity:o=null,gravity:a=[0,-9.81,0],isPaused:l=!1,iterations:g=5,maxSubSteps:u=10,quatNormalizeFast:C=!1,quatNormalizeSkip:d=0,shouldInvalidate:h=!0,size:f=1e3,solver:v="GS",stepSize:y=1/60,tolerance:A=.001}=n;const{invalidate:b}=as(),[{bodies:m,events:B,refs:S,scaleOverrides:x,subscriptions:R,worker:M}]=k.useState(()=>({bodies:{},events:{},refs:{},scaleOverrides:{},subscriptions:{},worker:new Jk({allowSleep:e,axisIndex:t,broadphase:i,defaultContactMaterial:r,frictionGravity:o,gravity:a,iterations:g,quatNormalizeFast:C,quatNormalizeSkip:d,size:f,solver:v,tolerance:A})}));let Z=0;const V=k.useCallback((Ce,z)=>{l||(Z+=z,M.step({maxSubSteps:u,stepSize:y,timeSinceLastCalled:Z}),Z=0)},[l,u,y]),N=Ce=>{var z;let{body:Q,contact:{bi:J,bj:le,...se},target:te,...ge}=Ce;const Ze=(z=B[te])==null?void 0:z.collide;Ze&&Ze({body:S[Q],contact:{bi:S[J],bj:S[le],...se},target:S[te],...ge})},P=Ce=>{var z,Q;let{bodyA:J,bodyB:le}=Ce;const se=(z=B[J])==null?void 0:z.collideBegin;se&&se({body:S[le],op:"event",target:S[J],type:"collideBegin"});const te=(Q=B[le])==null?void 0:Q.collideBegin;te&&te({body:S[J],op:"event",target:S[le],type:"collideBegin"})},U=Ce=>{var z,Q;let{bodyA:J,bodyB:le}=Ce;const se=(z=B[J])==null?void 0:z.collideEnd;se&&se({body:S[le],op:"event",target:S[J],type:"collideEnd"});const te=(Q=B[le])==null?void 0:Q.collideEnd;te&&te({body:S[J],op:"event",target:S[le],type:"collideEnd"})},q=Ce=>{let{active:z,bodies:Q=[],observations:J,positions:le,quaternions:se}=Ce;for(let te=0;te{let[ge,Ze,Re]=te;const ot=(R[ge]||{})[Re];ot&&ot(Ze)}),!!z){for(const te of Object.values(S).filter(QD()))if(te instanceof oc)for(let ge=0;ge{var z;let{body:Q,ray:{uuid:J,...le},...se}=Ce;const te=(z=B[J])==null?void 0:z.rayhit;te&&te({body:Q?S[Q]:null,ray:{uuid:J,...le},...se})};bC(V),k.useEffect(()=>(M.connect(),M.init(),M.on("collide",N),M.on("collideBegin",P),M.on("collideEnd",U),M.on("frame",q),M.on("rayhit",ie),()=>{M.terminate(),M.removeAllListeners()}),[]),k.useEffect(()=>{M.axisIndex=t},[t]),k.useEffect(()=>{M.broadphase=i},[i]),k.useEffect(()=>{M.gravity=a},[a]),k.useEffect(()=>{M.iterations=g},[g]),k.useEffect(()=>{M.tolerance=A},[A]);const he=k.useMemo(()=>({bodies:m,events:B,refs:S,scaleOverrides:x,subscriptions:R,worker:M}),[m,B,S,R,M]);return L.jsx(xM.Provider,{value:he,children:s})}/** * postprocessing v6.31.0 build Sun May 07 2023 * https://github.com/pmndrs/postprocessing * Copyright 2015-2023 Raoul van Rüschen @@ -3565,14 +3565,14 @@ float viewZ=perspectiveDepthToViewZ(depth,cameraNear,cameraFar);float linearDept #else float linearDepth=depth; #endif -float signedDistance=linearDepth-focusDistance;float magnitude=smoothstep(0.0,focusRange,abs(signedDistance));gl_FragColor.rg=magnitude*vec2(step(signedDistance,0.0),step(0.0,signedDistance));}`,nU=class extends Rt{constructor(n){super({name:"CircleOfConfusionMaterial",defines:{DEPTH_PACKING:"0"},uniforms:{depthBuffer:new ne(null),focusDistance:new ne(0),focusRange:new ne(0),cameraNear:new ne(.3),cameraFar:new ne(1e3)},blending:an,toneMapped:!1,depthWrite:!1,depthTest:!1,fragmentShader:tU,vertexShader:Tl}),this.uniforms.focalLength=this.uniforms.focusRange,this.copyCameraSettings(n)}get near(){return this.uniforms.cameraNear.value}get far(){return this.uniforms.cameraFar.value}set depthBuffer(n){this.uniforms.depthBuffer.value=n}set depthPacking(n){this.defines.DEPTH_PACKING=n.toFixed(0),this.needsUpdate=!0}setDepthBuffer(n,e=Tn){this.depthBuffer=n,this.depthPacking=e}get focusDistance(){return this.uniforms.focusDistance.value}set focusDistance(n){this.uniforms.focusDistance.value=n}get worldFocusDistance(){return-Og(this.focusDistance,this.near,this.far)}set worldFocusDistance(n){this.focusDistance=Cl(-n,this.near,this.far)}getFocusDistance(n){this.uniforms.focusDistance.value=n}setFocusDistance(n){this.uniforms.focusDistance.value=n}get focalLength(){return this.focusRange}set focalLength(n){this.focusRange=n}get focusRange(){return this.uniforms.focusRange.value}set focusRange(n){this.uniforms.focusRange.value=n}get worldFocusRange(){return-Og(this.focusRange,this.near,this.far)}set worldFocusRange(n){this.focusRange=Cl(-n,this.near,this.far)}getFocalLength(n){return this.focusRange}setFocalLength(n){this.focusRange=n}adoptCameraSettings(n){this.copyCameraSettings(n)}copyCameraSettings(n){n&&(this.uniforms.cameraNear.value=n.near,this.uniforms.cameraFar.value=n.far,n instanceof mn?this.defines.PERSPECTIVE_CAMERA="1":delete this.defines.PERSPECTIVE_CAMERA,this.needsUpdate=!0)}},ht={SKIP:9,SET:30,ADD:0,ALPHA:1,AVERAGE:2,COLOR:3,COLOR_BURN:4,COLOR_DODGE:5,DARKEN:6,DIFFERENCE:7,DIVIDE:8,DST:9,EXCLUSION:10,HARD_LIGHT:11,HARD_MIX:12,HUE:13,INVERT:14,INVERT_RGB:15,LIGHTEN:16,LINEAR_BURN:17,LINEAR_DODGE:18,LINEAR_LIGHT:19,LUMINOSITY:20,MULTIPLY:21,NEGATION:22,NORMAL:23,OVERLAY:24,PIN_LIGHT:25,REFLECT:26,SATURATION:27,SCREEN:28,SOFT_LIGHT:29,SRC:30,SUBTRACT:31,VIVID_LIGHT:32},Qg={RED:0,GREEN:1,BLUE:2,ALPHA:3},TI={FULL:0,SINGLE:1},au={DEFAULT:0,KEEP_MAX_DEPTH:1,DISCARD_MAX_DEPTH:2},NM={DEPTH:0,LUMA:1,COLOR:2},os={NONE:0,DEPTH:1,CONVOLUTION:2},Pt={FRAGMENT_HEAD:"FRAGMENT_HEAD",FRAGMENT_MAIN_UV:"FRAGMENT_MAIN_UV",FRAGMENT_MAIN_IMAGE:"FRAGMENT_MAIN_IMAGE",VERTEX_HEAD:"VERTEX_HEAD",VERTEX_MAIN_SUPPORT:"VERTEX_MAIN_SUPPORT"},sl={DISABLED:0,SPORADIC:1,CONSTANT_MILD:2,CONSTANT_WILD:3},Xc={VERY_SMALL:0,SMALL:1,MEDIUM:2,LARGE:3,VERY_LARGE:4,HUGE:5},iU={SCALE_UP:"lut.scaleup"},lu={DISCARD:0,MULTIPLY:1,MULTIPLY_RGB_SET_ALPHA:2},sU={DISABLED:0,DEPTH:1,CUSTOM:2},RI={LOW:0,MEDIUM:1,HIGH:2,ULTRA:3},rU=`#ifdef FRAMEBUFFER_PRECISION_HIGH +float signedDistance=linearDepth-focusDistance;float magnitude=smoothstep(0.0,focusRange,abs(signedDistance));gl_FragColor.rg=magnitude*vec2(step(signedDistance,0.0),step(0.0,signedDistance));}`,nU=class extends Rt{constructor(n){super({name:"CircleOfConfusionMaterial",defines:{DEPTH_PACKING:"0"},uniforms:{depthBuffer:new ne(null),focusDistance:new ne(0),focusRange:new ne(0),cameraNear:new ne(.3),cameraFar:new ne(1e3)},blending:an,toneMapped:!1,depthWrite:!1,depthTest:!1,fragmentShader:tU,vertexShader:Tl}),this.uniforms.focalLength=this.uniforms.focusRange,this.copyCameraSettings(n)}get near(){return this.uniforms.cameraNear.value}get far(){return this.uniforms.cameraFar.value}set depthBuffer(n){this.uniforms.depthBuffer.value=n}set depthPacking(n){this.defines.DEPTH_PACKING=n.toFixed(0),this.needsUpdate=!0}setDepthBuffer(n,e=Tn){this.depthBuffer=n,this.depthPacking=e}get focusDistance(){return this.uniforms.focusDistance.value}set focusDistance(n){this.uniforms.focusDistance.value=n}get worldFocusDistance(){return-Og(this.focusDistance,this.near,this.far)}set worldFocusDistance(n){this.focusDistance=Cl(-n,this.near,this.far)}getFocusDistance(n){this.uniforms.focusDistance.value=n}setFocusDistance(n){this.uniforms.focusDistance.value=n}get focalLength(){return this.focusRange}set focalLength(n){this.focusRange=n}get focusRange(){return this.uniforms.focusRange.value}set focusRange(n){this.uniforms.focusRange.value=n}get worldFocusRange(){return-Og(this.focusRange,this.near,this.far)}set worldFocusRange(n){this.focusRange=Cl(-n,this.near,this.far)}getFocalLength(n){return this.focusRange}setFocalLength(n){this.focusRange=n}adoptCameraSettings(n){this.copyCameraSettings(n)}copyCameraSettings(n){n&&(this.uniforms.cameraNear.value=n.near,this.uniforms.cameraFar.value=n.far,n instanceof mn?this.defines.PERSPECTIVE_CAMERA="1":delete this.defines.PERSPECTIVE_CAMERA,this.needsUpdate=!0)}},ht={SKIP:9,SET:30,ADD:0,ALPHA:1,AVERAGE:2,COLOR:3,COLOR_BURN:4,COLOR_DODGE:5,DARKEN:6,DIFFERENCE:7,DIVIDE:8,DST:9,EXCLUSION:10,HARD_LIGHT:11,HARD_MIX:12,HUE:13,INVERT:14,INVERT_RGB:15,LIGHTEN:16,LINEAR_BURN:17,LINEAR_DODGE:18,LINEAR_LIGHT:19,LUMINOSITY:20,MULTIPLY:21,NEGATION:22,NORMAL:23,OVERLAY:24,PIN_LIGHT:25,REFLECT:26,SATURATION:27,SCREEN:28,SOFT_LIGHT:29,SRC:30,SUBTRACT:31,VIVID_LIGHT:32},Qg={RED:0,GREEN:1,BLUE:2,ALPHA:3},kI={FULL:0,SINGLE:1},lu={DEFAULT:0,KEEP_MAX_DEPTH:1,DISCARD_MAX_DEPTH:2},NM={DEPTH:0,LUMA:1,COLOR:2},os={NONE:0,DEPTH:1,CONVOLUTION:2},Pt={FRAGMENT_HEAD:"FRAGMENT_HEAD",FRAGMENT_MAIN_UV:"FRAGMENT_MAIN_UV",FRAGMENT_MAIN_IMAGE:"FRAGMENT_MAIN_IMAGE",VERTEX_HEAD:"VERTEX_HEAD",VERTEX_MAIN_SUPPORT:"VERTEX_MAIN_SUPPORT"},sl={DISABLED:0,SPORADIC:1,CONSTANT_MILD:2,CONSTANT_WILD:3},Fc={VERY_SMALL:0,SMALL:1,MEDIUM:2,LARGE:3,VERY_LARGE:4,HUGE:5},iU={SCALE_UP:"lut.scaleup"},gu={DISCARD:0,MULTIPLY:1,MULTIPLY_RGB_SET_ALPHA:2},sU={DISABLED:0,DEPTH:1,CUSTOM:2},WI={LOW:0,MEDIUM:1,HIGH:2,ULTRA:3},rU=`#ifdef FRAMEBUFFER_PRECISION_HIGH uniform mediump sampler2D inputBuffer; #else uniform lowp sampler2D inputBuffer; #endif varying vec2 vUv0;varying vec2 vUv1;varying vec2 vUv2;varying vec2 vUv3;void main(){vec4 sum=texture2D(inputBuffer,vUv0);sum+=texture2D(inputBuffer,vUv1);sum+=texture2D(inputBuffer,vUv2);sum+=texture2D(inputBuffer,vUv3);gl_FragColor=sum*0.25; #include -}`,oU="uniform vec4 texelSize;uniform float kernel;uniform float scale;varying vec2 vUv0;varying vec2 vUv1;varying vec2 vUv2;varying vec2 vUv3;void main(){vec2 uv=position.xy*0.5+0.5;vec2 dUv=(texelSize.xy*vec2(kernel)+texelSize.zw)*scale;vUv0=vec2(uv.x-dUv.x,uv.y+dUv.y);vUv1=vec2(uv.x+dUv.x,uv.y+dUv.y);vUv2=vec2(uv.x+dUv.x,uv.y-dUv.y);vUv3=vec2(uv.x-dUv.x,uv.y-dUv.y);gl_Position=vec4(position.xy,1.0,1.0);}",aU=[new Float32Array([0,0]),new Float32Array([0,1,1]),new Float32Array([0,1,1,2]),new Float32Array([0,1,2,2,3]),new Float32Array([0,1,2,3,4,4,5]),new Float32Array([0,1,2,3,4,5,7,8,9,10])],lU=class extends Rt{constructor(n=new Yt){super({name:"KawaseBlurMaterial",uniforms:{inputBuffer:new ne(null),texelSize:new ne(new Yt),scale:new ne(1),kernel:new ne(0)},blending:an,toneMapped:!1,depthWrite:!1,depthTest:!1,fragmentShader:rU,vertexShader:oU}),this.setTexelSize(n.x,n.y),this.kernelSize=Xc.MEDIUM}set inputBuffer(n){this.uniforms.inputBuffer.value=n}setInputBuffer(n){this.inputBuffer=n}get kernelSequence(){return aU[this.kernelSize]}get scale(){return this.uniforms.scale.value}set scale(n){this.uniforms.scale.value=n}getScale(){return this.uniforms.scale.value}setScale(n){this.uniforms.scale.value=n}getKernel(){return null}get kernel(){return this.uniforms.kernel.value}set kernel(n){this.uniforms.kernel.value=n}setKernel(n){this.kernel=n}setTexelSize(n,e){this.uniforms.texelSize.value.set(n,e,n*.5,e*.5)}setSize(n,e){const t=1/n,i=1/e;this.uniforms.texelSize.value.set(t,i,t*.5,i*.5)}},gU=`#include +}`,oU="uniform vec4 texelSize;uniform float kernel;uniform float scale;varying vec2 vUv0;varying vec2 vUv1;varying vec2 vUv2;varying vec2 vUv3;void main(){vec2 uv=position.xy*0.5+0.5;vec2 dUv=(texelSize.xy*vec2(kernel)+texelSize.zw)*scale;vUv0=vec2(uv.x-dUv.x,uv.y+dUv.y);vUv1=vec2(uv.x+dUv.x,uv.y+dUv.y);vUv2=vec2(uv.x+dUv.x,uv.y-dUv.y);vUv3=vec2(uv.x-dUv.x,uv.y-dUv.y);gl_Position=vec4(position.xy,1.0,1.0);}",aU=[new Float32Array([0,0]),new Float32Array([0,1,1]),new Float32Array([0,1,1,2]),new Float32Array([0,1,2,2,3]),new Float32Array([0,1,2,3,4,4,5]),new Float32Array([0,1,2,3,4,5,7,8,9,10])],lU=class extends Rt{constructor(n=new Yt){super({name:"KawaseBlurMaterial",uniforms:{inputBuffer:new ne(null),texelSize:new ne(new Yt),scale:new ne(1),kernel:new ne(0)},blending:an,toneMapped:!1,depthWrite:!1,depthTest:!1,fragmentShader:rU,vertexShader:oU}),this.setTexelSize(n.x,n.y),this.kernelSize=Fc.MEDIUM}set inputBuffer(n){this.uniforms.inputBuffer.value=n}setInputBuffer(n){this.inputBuffer=n}get kernelSequence(){return aU[this.kernelSize]}get scale(){return this.uniforms.scale.value}set scale(n){this.uniforms.scale.value=n}getScale(){return this.uniforms.scale.value}setScale(n){this.uniforms.scale.value=n}getKernel(){return null}get kernel(){return this.uniforms.kernel.value}set kernel(n){this.uniforms.kernel.value=n}setKernel(n){this.kernel=n}setTexelSize(n,e){this.uniforms.texelSize.value.set(n,e,n*.5,e*.5)}setSize(n,e){const t=1/n,i=1/e;this.uniforms.texelSize.value.set(t,i,t*.5,i*.5)}},gU=`#include #include #ifdef FRAMEBUFFER_PRECISION_HIGH uniform mediump sampler2D inputBuffer; @@ -3660,7 +3660,7 @@ vUv=texelPosition; #else vUv=position.xy*0.5+0.5; #endif -gl_Position=vec4(position.xy,1.0,1.0);}`,hU=class extends Rt{constructor(){super({name:"DepthCopyMaterial",defines:{INPUT_DEPTH_PACKING:"0",OUTPUT_DEPTH_PACKING:"0",DEPTH_COPY_MODE:"0"},uniforms:{depthBuffer:new ne(null),texelPosition:new ne(new oe)},blending:an,toneMapped:!1,depthWrite:!1,depthTest:!1,fragmentShader:CU,vertexShader:dU}),this.depthCopyMode=TI.FULL}get depthBuffer(){return this.uniforms.depthBuffer.value}set depthBuffer(n){this.uniforms.depthBuffer.value=n}set inputDepthPacking(n){this.defines.INPUT_DEPTH_PACKING=n.toFixed(0),this.needsUpdate=!0}get outputDepthPacking(){return Number(this.defines.OUTPUT_DEPTH_PACKING)}set outputDepthPacking(n){this.defines.OUTPUT_DEPTH_PACKING=n.toFixed(0),this.needsUpdate=!0}setDepthBuffer(n,e=Tn){this.depthBuffer=n,this.inputDepthPacking=e}getInputDepthPacking(){return Number(this.defines.INPUT_DEPTH_PACKING)}setInputDepthPacking(n){this.defines.INPUT_DEPTH_PACKING=n.toFixed(0),this.needsUpdate=!0}getOutputDepthPacking(){return Number(this.defines.OUTPUT_DEPTH_PACKING)}setOutputDepthPacking(n){this.defines.OUTPUT_DEPTH_PACKING=n.toFixed(0),this.needsUpdate=!0}get texelPosition(){return this.uniforms.texelPosition.value}getTexelPosition(){return this.uniforms.texelPosition.value}setTexelPosition(n){this.uniforms.texelPosition.value=n}get mode(){return this.depthCopyMode}set mode(n){this.depthCopyMode=n,this.defines.DEPTH_COPY_MODE=n.toFixed(0),this.needsUpdate=!0}getMode(){return this.mode}setMode(n){this.mode=n}},AU=`#include +gl_Position=vec4(position.xy,1.0,1.0);}`,hU=class extends Rt{constructor(){super({name:"DepthCopyMaterial",defines:{INPUT_DEPTH_PACKING:"0",OUTPUT_DEPTH_PACKING:"0",DEPTH_COPY_MODE:"0"},uniforms:{depthBuffer:new ne(null),texelPosition:new ne(new oe)},blending:an,toneMapped:!1,depthWrite:!1,depthTest:!1,fragmentShader:CU,vertexShader:dU}),this.depthCopyMode=kI.FULL}get depthBuffer(){return this.uniforms.depthBuffer.value}set depthBuffer(n){this.uniforms.depthBuffer.value=n}set inputDepthPacking(n){this.defines.INPUT_DEPTH_PACKING=n.toFixed(0),this.needsUpdate=!0}get outputDepthPacking(){return Number(this.defines.OUTPUT_DEPTH_PACKING)}set outputDepthPacking(n){this.defines.OUTPUT_DEPTH_PACKING=n.toFixed(0),this.needsUpdate=!0}setDepthBuffer(n,e=Tn){this.depthBuffer=n,this.inputDepthPacking=e}getInputDepthPacking(){return Number(this.defines.INPUT_DEPTH_PACKING)}setInputDepthPacking(n){this.defines.INPUT_DEPTH_PACKING=n.toFixed(0),this.needsUpdate=!0}getOutputDepthPacking(){return Number(this.defines.OUTPUT_DEPTH_PACKING)}setOutputDepthPacking(n){this.defines.OUTPUT_DEPTH_PACKING=n.toFixed(0),this.needsUpdate=!0}get texelPosition(){return this.uniforms.texelPosition.value}getTexelPosition(){return this.uniforms.texelPosition.value}setTexelPosition(n){this.uniforms.texelPosition.value=n}get mode(){return this.depthCopyMode}set mode(n){this.depthCopyMode=n,this.defines.DEPTH_COPY_MODE=n.toFixed(0),this.needsUpdate=!0}getMode(){return this.mode}setMode(n){this.mode=n}},AU=`#include #ifdef GL_FRAGMENT_PRECISION_HIGH uniform highp sampler2D depthBuffer; #else @@ -3716,7 +3716,7 @@ bool keep=isMaxDepth||depthTest(depth.x,depth.y); #else bool keep=!isMaxDepth&&depthTest(depth.x,depth.y); #endif -if(keep){gl_FragColor=texture2D(inputBuffer,vUv);}else{discard;}}`,XM=class extends Rt{constructor(){super({name:"DepthMaskMaterial",defines:{DEPTH_EPSILON:"0.0001",DEPTH_PACKING_0:"0",DEPTH_PACKING_1:"0",DEPTH_TEST_STRATEGY:au.KEEP_MAX_DEPTH},uniforms:{inputBuffer:new ne(null),depthBuffer0:new ne(null),depthBuffer1:new ne(null),cameraNearFar:new ne(new oe(1,1))},blending:an,toneMapped:!1,depthWrite:!1,depthTest:!1,fragmentShader:mU,vertexShader:Tl}),this.depthMode=wA}set depthBuffer0(n){this.uniforms.depthBuffer0.value=n}set depthPacking0(n){this.defines.DEPTH_PACKING_0=n.toFixed(0),this.needsUpdate=!0}setDepthBuffer0(n,e=Tn){this.depthBuffer0=n,this.depthPacking0=e}set depthBuffer1(n){this.uniforms.depthBuffer1.value=n}set depthPacking1(n){this.defines.DEPTH_PACKING_1=n.toFixed(0),this.needsUpdate=!0}setDepthBuffer1(n,e=Tn){this.depthBuffer1=n,this.depthPacking1=e}get maxDepthStrategy(){return Number(this.defines.DEPTH_TEST_STRATEGY)}set maxDepthStrategy(n){this.defines.DEPTH_TEST_STRATEGY=n.toFixed(0),this.needsUpdate=!0}get keepFar(){return this.maxDepthStrategy}set keepFar(n){this.maxDepthStrategy=n?au.KEEP_MAX_DEPTH:au.DISCARD_MAX_DEPTH}getMaxDepthStrategy(){return this.maxDepthStrategy}setMaxDepthStrategy(n){this.maxDepthStrategy=n}get epsilon(){return Number(this.defines.DEPTH_EPSILON)}set epsilon(n){this.defines.DEPTH_EPSILON=n.toFixed(16),this.needsUpdate=!0}getEpsilon(){return this.epsilon}setEpsilon(n){this.epsilon=n}get depthMode(){return Number(this.defines.DEPTH_MODE)}set depthMode(n){let e;switch(n){case Jv:e="false";break;case Ov:e="true";break;case Wu:e="abs(d1 - d0) <= DEPTH_EPSILON";break;case $A:e="abs(d1 - d0) > DEPTH_EPSILON";break;case wA:e="d0 > d1";break;case Ru:e="d0 >= d1";break;case Qv:e="d0 <= d1";break;case jv:default:e="d0 < d1";break}this.defines.DEPTH_MODE=n.toFixed(0),this.defines["depthTest(d0, d1)"]=e,this.needsUpdate=!0}getDepthMode(){return this.depthMode}setDepthMode(n){this.depthMode=n}adoptCameraSettings(n){this.copyCameraSettings(n)}copyCameraSettings(n){n&&(this.uniforms.cameraNearFar.value.set(n.near,n.far),n instanceof mn?this.defines.PERSPECTIVE_CAMERA="1":delete this.defines.PERSPECTIVE_CAMERA,this.needsUpdate=!0)}},bU=`#ifdef FRAMEBUFFER_PRECISION_HIGH +if(keep){gl_FragColor=texture2D(inputBuffer,vUv);}else{discard;}}`,XM=class extends Rt{constructor(){super({name:"DepthMaskMaterial",defines:{DEPTH_EPSILON:"0.0001",DEPTH_PACKING_0:"0",DEPTH_PACKING_1:"0",DEPTH_TEST_STRATEGY:lu.KEEP_MAX_DEPTH},uniforms:{inputBuffer:new ne(null),depthBuffer0:new ne(null),depthBuffer1:new ne(null),cameraNearFar:new ne(new oe(1,1))},blending:an,toneMapped:!1,depthWrite:!1,depthTest:!1,fragmentShader:mU,vertexShader:Tl}),this.depthMode=wA}set depthBuffer0(n){this.uniforms.depthBuffer0.value=n}set depthPacking0(n){this.defines.DEPTH_PACKING_0=n.toFixed(0),this.needsUpdate=!0}setDepthBuffer0(n,e=Tn){this.depthBuffer0=n,this.depthPacking0=e}set depthBuffer1(n){this.uniforms.depthBuffer1.value=n}set depthPacking1(n){this.defines.DEPTH_PACKING_1=n.toFixed(0),this.needsUpdate=!0}setDepthBuffer1(n,e=Tn){this.depthBuffer1=n,this.depthPacking1=e}get maxDepthStrategy(){return Number(this.defines.DEPTH_TEST_STRATEGY)}set maxDepthStrategy(n){this.defines.DEPTH_TEST_STRATEGY=n.toFixed(0),this.needsUpdate=!0}get keepFar(){return this.maxDepthStrategy}set keepFar(n){this.maxDepthStrategy=n?lu.KEEP_MAX_DEPTH:lu.DISCARD_MAX_DEPTH}getMaxDepthStrategy(){return this.maxDepthStrategy}setMaxDepthStrategy(n){this.maxDepthStrategy=n}get epsilon(){return Number(this.defines.DEPTH_EPSILON)}set epsilon(n){this.defines.DEPTH_EPSILON=n.toFixed(16),this.needsUpdate=!0}getEpsilon(){return this.epsilon}setEpsilon(n){this.epsilon=n}get depthMode(){return Number(this.defines.DEPTH_MODE)}set depthMode(n){let e;switch(n){case Jv:e="false";break;case Ov:e="true";break;case Vu:e="abs(d1 - d0) <= DEPTH_EPSILON";break;case $A:e="abs(d1 - d0) > DEPTH_EPSILON";break;case wA:e="d0 > d1";break;case Wu:e="d0 >= d1";break;case Qv:e="d0 <= d1";break;case jv:default:e="d0 < d1";break}this.defines.DEPTH_MODE=n.toFixed(0),this.defines["depthTest(d0, d1)"]=e,this.needsUpdate=!0}getDepthMode(){return this.depthMode}setDepthMode(n){this.depthMode=n}adoptCameraSettings(n){this.copyCameraSettings(n)}copyCameraSettings(n){n&&(this.uniforms.cameraNearFar.value.set(n.near,n.far),n instanceof mn?this.defines.PERSPECTIVE_CAMERA="1":delete this.defines.PERSPECTIVE_CAMERA,this.needsUpdate=!0)}},bU=`#ifdef FRAMEBUFFER_PRECISION_HIGH uniform mediump sampler2D inputBuffer; #else uniform lowp sampler2D inputBuffer; @@ -3895,7 +3895,7 @@ gl_FragColor=vec4(mask*texture2D(inputBuffer,vUv).rgb,mask); #else gl_FragColor=mask*texture2D(inputBuffer,vUv); #endif -}`,HU=class extends Rt{constructor(n=null){super({name:"MaskMaterial",uniforms:{maskTexture:new ne(n),inputBuffer:new ne(null),strength:new ne(1)},blending:an,toneMapped:!1,depthWrite:!1,depthTest:!1,fragmentShader:NU,vertexShader:Tl}),this.colorChannel=Qg.RED,this.maskFunction=lu.DISCARD}set inputBuffer(n){this.uniforms.inputBuffer.value=n}setInputBuffer(n){this.uniforms.inputBuffer.value=n}set maskTexture(n){this.uniforms.maskTexture.value=n,delete this.defines.MASK_PRECISION_HIGH,n.type!==cn&&(this.defines.MASK_PRECISION_HIGH="1"),this.needsUpdate=!0}setMaskTexture(n){this.maskTexture=n}set colorChannel(n){this.defines.COLOR_CHANNEL=n.toFixed(0),this.needsUpdate=!0}setColorChannel(n){this.colorChannel=n}set maskFunction(n){this.defines.MASK_FUNCTION=n.toFixed(0),this.needsUpdate=!0}setMaskFunction(n){this.maskFunction=n}get inverted(){return this.defines.INVERTED!==void 0}set inverted(n){this.inverted&&!n?delete this.defines.INVERTED:n&&(this.defines.INVERTED="1"),this.needsUpdate=!0}isInverted(){return this.inverted}setInverted(n){this.inverted=n}get strength(){return this.uniforms.strength.value}set strength(n){this.uniforms.strength.value=n}getStrength(){return this.strength}setStrength(n){this.strength=n}},XU="uniform lowp sampler2D inputBuffer;varying vec2 vUv0;varying vec2 vUv1;varying vec2 vUv2;varying vec2 vUv3;void main(){vec2 c0=texture2D(inputBuffer,vUv0).rg;vec2 c1=texture2D(inputBuffer,vUv1).rg;vec2 c2=texture2D(inputBuffer,vUv2).rg;vec2 c3=texture2D(inputBuffer,vUv3).rg;float d0=(c0.x-c1.x)*0.5;float d1=(c2.x-c3.x)*0.5;float d=length(vec2(d0,d1));float a0=min(c0.y,c1.y);float a1=min(c2.y,c3.y);float visibilityFactor=min(a0,a1);gl_FragColor.rg=(1.0-visibilityFactor>0.001)?vec2(d,0.0):vec2(0.0,d);}",FU="uniform vec2 texelSize;varying vec2 vUv0;varying vec2 vUv1;varying vec2 vUv2;varying vec2 vUv3;void main(){vec2 uv=position.xy*0.5+0.5;vUv0=vec2(uv.x+texelSize.x,uv.y);vUv1=vec2(uv.x-texelSize.x,uv.y);vUv2=vec2(uv.x,uv.y+texelSize.y);vUv3=vec2(uv.x,uv.y-texelSize.y);gl_Position=vec4(position.xy,1.0,1.0);}",YU=class extends Rt{constructor(n=new oe){super({name:"OutlineMaterial",uniforms:{inputBuffer:new ne(null),texelSize:new ne(new oe)},blending:an,toneMapped:!1,depthWrite:!1,depthTest:!1,fragmentShader:XU,vertexShader:FU}),this.uniforms.texelSize.value.set(n.x,n.y),this.uniforms.maskTexture=this.uniforms.inputBuffer}set inputBuffer(n){this.uniforms.inputBuffer.value=n}setInputBuffer(n){this.uniforms.inputBuffer.value=n}setTexelSize(n,e){this.uniforms.texelSize.value.set(n,e)}setSize(n,e){this.uniforms.texelSize.value.set(1/n,1/e)}},KU=`#define sampleLevelZeroOffset(t, coord, offset) texture2D(t, coord + offset * texelSize) +}`,HU=class extends Rt{constructor(n=null){super({name:"MaskMaterial",uniforms:{maskTexture:new ne(n),inputBuffer:new ne(null),strength:new ne(1)},blending:an,toneMapped:!1,depthWrite:!1,depthTest:!1,fragmentShader:NU,vertexShader:Tl}),this.colorChannel=Qg.RED,this.maskFunction=gu.DISCARD}set inputBuffer(n){this.uniforms.inputBuffer.value=n}setInputBuffer(n){this.uniforms.inputBuffer.value=n}set maskTexture(n){this.uniforms.maskTexture.value=n,delete this.defines.MASK_PRECISION_HIGH,n.type!==cn&&(this.defines.MASK_PRECISION_HIGH="1"),this.needsUpdate=!0}setMaskTexture(n){this.maskTexture=n}set colorChannel(n){this.defines.COLOR_CHANNEL=n.toFixed(0),this.needsUpdate=!0}setColorChannel(n){this.colorChannel=n}set maskFunction(n){this.defines.MASK_FUNCTION=n.toFixed(0),this.needsUpdate=!0}setMaskFunction(n){this.maskFunction=n}get inverted(){return this.defines.INVERTED!==void 0}set inverted(n){this.inverted&&!n?delete this.defines.INVERTED:n&&(this.defines.INVERTED="1"),this.needsUpdate=!0}isInverted(){return this.inverted}setInverted(n){this.inverted=n}get strength(){return this.uniforms.strength.value}set strength(n){this.uniforms.strength.value=n}getStrength(){return this.strength}setStrength(n){this.strength=n}},XU="uniform lowp sampler2D inputBuffer;varying vec2 vUv0;varying vec2 vUv1;varying vec2 vUv2;varying vec2 vUv3;void main(){vec2 c0=texture2D(inputBuffer,vUv0).rg;vec2 c1=texture2D(inputBuffer,vUv1).rg;vec2 c2=texture2D(inputBuffer,vUv2).rg;vec2 c3=texture2D(inputBuffer,vUv3).rg;float d0=(c0.x-c1.x)*0.5;float d1=(c2.x-c3.x)*0.5;float d=length(vec2(d0,d1));float a0=min(c0.y,c1.y);float a1=min(c2.y,c3.y);float visibilityFactor=min(a0,a1);gl_FragColor.rg=(1.0-visibilityFactor>0.001)?vec2(d,0.0):vec2(0.0,d);}",FU="uniform vec2 texelSize;varying vec2 vUv0;varying vec2 vUv1;varying vec2 vUv2;varying vec2 vUv3;void main(){vec2 uv=position.xy*0.5+0.5;vUv0=vec2(uv.x+texelSize.x,uv.y);vUv1=vec2(uv.x-texelSize.x,uv.y);vUv2=vec2(uv.x,uv.y+texelSize.y);vUv3=vec2(uv.x,uv.y-texelSize.y);gl_Position=vec4(position.xy,1.0,1.0);}",YU=class extends Rt{constructor(n=new oe){super({name:"OutlineMaterial",uniforms:{inputBuffer:new ne(null),texelSize:new ne(new oe)},blending:an,toneMapped:!1,depthWrite:!1,depthTest:!1,fragmentShader:XU,vertexShader:FU}),this.uniforms.texelSize.value.set(n.x,n.y),this.uniforms.maskTexture=this.uniforms.inputBuffer}set inputBuffer(n){this.uniforms.inputBuffer.value=n}setInputBuffer(n){this.uniforms.inputBuffer.value=n}setTexelSize(n,e){this.uniforms.texelSize.value.set(n,e)}setSize(n,e){this.uniforms.texelSize.value.set(1/n,1/e)}},KU=`#define sampleLevelZeroOffset(t, coord, offset) texture2D(t, coord + offset * texelSize) #if __VERSION__ < 300 #define round(v) floor(v + 0.5) #endif @@ -3981,7 +3981,7 @@ uniform lowp sampler2D inputBuffer;uniform lowp sampler2D supportBuffer; #endif uniform float radius;varying vec2 vUv;varying vec2 vUv0;varying vec2 vUv1;varying vec2 vUv2;varying vec2 vUv3;varying vec2 vUv4;varying vec2 vUv5;varying vec2 vUv6;varying vec2 vUv7;void main(){vec4 c=vec4(0.0);c+=texture2D(inputBuffer,vUv0)*0.0625;c+=texture2D(inputBuffer,vUv1)*0.125;c+=texture2D(inputBuffer,vUv2)*0.0625;c+=texture2D(inputBuffer,vUv3)*0.125;c+=texture2D(inputBuffer,vUv)*0.25;c+=texture2D(inputBuffer,vUv4)*0.125;c+=texture2D(inputBuffer,vUv5)*0.0625;c+=texture2D(inputBuffer,vUv6)*0.125;c+=texture2D(inputBuffer,vUv7)*0.0625;vec4 baseColor=texture2D(supportBuffer,vUv);gl_FragColor=mix(baseColor,c,radius); #include -}`,UU="uniform vec2 texelSize;varying vec2 vUv;varying vec2 vUv0;varying vec2 vUv1;varying vec2 vUv2;varying vec2 vUv3;varying vec2 vUv4;varying vec2 vUv5;varying vec2 vUv6;varying vec2 vUv7;void main(){vUv=position.xy*0.5+0.5;vUv0=vUv+texelSize*vec2(-1.0,1.0);vUv1=vUv+texelSize*vec2(0.0,1.0);vUv2=vUv+texelSize*vec2(1.0,1.0);vUv3=vUv+texelSize*vec2(-1.0,0.0);vUv4=vUv+texelSize*vec2(1.0,0.0);vUv5=vUv+texelSize*vec2(-1.0,-1.0);vUv6=vUv+texelSize*vec2(0.0,-1.0);vUv7=vUv+texelSize*vec2(1.0,-1.0);gl_Position=vec4(position.xy,1.0,1.0);}",PU=class extends Rt{constructor(){super({name:"UpsamplingMaterial",uniforms:{inputBuffer:new ne(null),supportBuffer:new ne(null),texelSize:new ne(new oe),radius:new ne(.85)},blending:an,toneMapped:!1,depthWrite:!1,depthTest:!1,fragmentShader:DU,vertexShader:UU})}set inputBuffer(n){this.uniforms.inputBuffer.value=n}set supportBuffer(n){this.uniforms.supportBuffer.value=n}get radius(){return this.uniforms.radius.value}set radius(n){this.uniforms.radius.value=n}setSize(n,e){this.uniforms.texelSize.value.set(1/n,1/e)}},_U=new xc,Oo=null;function JU(){if(Oo===null){const n=new Float32Array([-1,-1,0,3,-1,0,-1,3,0]),e=new Float32Array([0,0,2,0,0,2]);Oo=new Gt,Oo.setAttribute!==void 0?(Oo.setAttribute("position",new Jt(n,3)),Oo.setAttribute("uv",new Jt(e,2))):(Oo.addAttribute("position",new Jt(n,3)),Oo.addAttribute("uv",new Jt(e,2)))}return Oo}var Nn=class{constructor(n="Pass",e=new Sl,t=_U){this.name=n,this.renderer=null,this.scene=e,this.camera=t,this.screen=null,this.rtt=!0,this.needsSwap=!0,this.needsDepthTexture=!1,this.enabled=!0}get renderToScreen(){return!this.rtt}set renderToScreen(n){if(this.rtt===n){const e=this.fullscreenMaterial;e!==null&&(e.needsUpdate=!0),this.rtt=!n}}set mainScene(n){}set mainCamera(n){}setRenderer(n){this.renderer=n}isEnabled(){return this.enabled}setEnabled(n){this.enabled=n}get fullscreenMaterial(){return this.screen!==null?this.screen.material:null}set fullscreenMaterial(n){let e=this.screen;e!==null?e.material=n:(e=new On(JU(),n),e.frustumCulled=!1,this.scene===null&&(this.scene=new Sl),this.scene.add(e),this.screen=e)}getFullscreenMaterial(){return this.fullscreenMaterial}setFullscreenMaterial(n){this.fullscreenMaterial=n}getDepthTexture(){return null}setDepthTexture(n,e=Tn){}render(n,e,t,i,s){throw new Error("Render method not implemented!")}setSize(n,e){}initialize(n,e,t){}dispose(){for(const n of Object.keys(this)){const e=this[n];(e instanceof Nt||e instanceof ei||e instanceof sn||e instanceof Nn)&&this[n].dispose()}}},FM=class extends Nn{constructor(n,e=!0){super("CopyPass"),this.fullscreenMaterial=new HM,this.needsSwap=!1,this.renderTarget=n,n===void 0&&(this.renderTarget=new Nt(1,1,{minFilter:st,magFilter:st,stencilBuffer:!1,depthBuffer:!1}),this.renderTarget.texture.name="CopyPass.Target"),this.autoResize=e}get resize(){return this.autoResize}set resize(n){this.autoResize=n}get texture(){return this.renderTarget.texture}getTexture(){return this.renderTarget.texture}setAutoResizeEnabled(n){this.autoResize=n}render(n,e,t,i,s){this.fullscreenMaterial.inputBuffer=e.texture,n.setRenderTarget(this.renderToScreen?null:this.renderTarget),n.render(this.scene,this.camera)}setSize(n,e){this.autoResize&&this.renderTarget.setSize(n,e)}initialize(n,e,t){t!==void 0&&(this.renderTarget.texture.type=t,t!==cn?this.fullscreenMaterial.defines.FRAMEBUFFER_PRECISION_HIGH="1":So(n)===jt&&Qn(this.renderTarget.texture,jt))}},OU=class extends Nn{constructor(){super("ClearMaskPass",null,null),this.needsSwap=!1}render(n,e,t,i,s){const r=n.state.buffers.stencil;r.setLocked(!1),r.setTest(!1)}},gS=new Xe,Fc=class extends Nn{constructor(n=!0,e=!0,t=!1){super("ClearPass",null,null),this.needsSwap=!1,this.color=n,this.depth=e,this.stencil=t,this.overrideClearColor=null,this.overrideClearAlpha=-1}setClearFlags(n,e,t){this.color=n,this.depth=e,this.stencil=t}getOverrideClearColor(){return this.overrideClearColor}setOverrideClearColor(n){this.overrideClearColor=n}getOverrideClearAlpha(){return this.overrideClearAlpha}setOverrideClearAlpha(n){this.overrideClearAlpha=n}render(n,e,t,i,s){const r=this.overrideClearColor,o=this.overrideClearAlpha,a=n.getClearAlpha(),l=r!==null,g=o>=0;l?(n.getClearColor(gS),n.setClearColor(r,g?o:a)):g&&n.setClearAlpha(o),n.setRenderTarget(this.renderToScreen?null:e),n.clear(this.color,this.depth,this.stencil),l?n.setClearColor(gS,a):g&&n.setClearAlpha(a)}},Qo=-1,qt=class extends Ps{constructor(n,e=Qo,t=Qo,i=1){super(),this.resizable=n,this.baseSize=new oe(1,1),this.preferredSize=new oe(e,t),this.target=this.preferredSize,this.s=i,this.effectiveSize=new oe,this.addEventListener("change",()=>this.updateEffectiveSize()),this.updateEffectiveSize()}updateEffectiveSize(){const n=this.baseSize,e=this.preferredSize,t=this.effectiveSize,i=this.scale;e.width!==Qo?t.width=e.width:e.height!==Qo?t.width=Math.round(e.height*(n.width/Math.max(n.height,1))):t.width=Math.round(n.width*i),e.height!==Qo?t.height=e.height:e.width!==Qo?t.height=Math.round(e.width/Math.max(n.width/Math.max(n.height,1),1)):t.height=Math.round(n.height*i)}get width(){return this.effectiveSize.width}set width(n){this.preferredWidth=n}get height(){return this.effectiveSize.height}set height(n){this.preferredHeight=n}getWidth(){return this.width}getHeight(){return this.height}get scale(){return this.s}set scale(n){this.s!==n&&(this.s=n,this.preferredSize.setScalar(Qo),this.dispatchEvent({type:"change"}),this.resizable.setSize(this.baseSize.width,this.baseSize.height))}getScale(){return this.scale}setScale(n){this.scale=n}get baseWidth(){return this.baseSize.width}set baseWidth(n){this.baseSize.width!==n&&(this.baseSize.width=n,this.dispatchEvent({type:"change"}),this.resizable.setSize(this.baseSize.width,this.baseSize.height))}getBaseWidth(){return this.baseWidth}setBaseWidth(n){this.baseWidth=n}get baseHeight(){return this.baseSize.height}set baseHeight(n){this.baseSize.height!==n&&(this.baseSize.height=n,this.dispatchEvent({type:"change"}),this.resizable.setSize(this.baseSize.width,this.baseSize.height))}getBaseHeight(){return this.baseHeight}setBaseHeight(n){this.baseHeight=n}setBaseSize(n,e){(this.baseSize.width!==n||this.baseSize.height!==e)&&(this.baseSize.set(n,e),this.dispatchEvent({type:"change"}),this.resizable.setSize(this.baseSize.width,this.baseSize.height))}get preferredWidth(){return this.preferredSize.width}set preferredWidth(n){this.preferredSize.width!==n&&(this.preferredSize.width=n,this.dispatchEvent({type:"change"}),this.resizable.setSize(this.baseSize.width,this.baseSize.height))}getPreferredWidth(){return this.preferredWidth}setPreferredWidth(n){this.preferredWidth=n}get preferredHeight(){return this.preferredSize.height}set preferredHeight(n){this.preferredSize.height!==n&&(this.preferredSize.height=n,this.dispatchEvent({type:"change"}),this.resizable.setSize(this.baseSize.width,this.baseSize.height))}getPreferredHeight(){return this.preferredHeight}setPreferredHeight(n){this.preferredHeight=n}setPreferredSize(n,e){(this.preferredSize.width!==n||this.preferredSize.height!==e)&&(this.preferredSize.set(n,e),this.dispatchEvent({type:"change"}),this.resizable.setSize(this.baseSize.width,this.baseSize.height))}copy(n){this.s=n.scale,this.baseSize.set(n.baseWidth,n.baseHeight),this.preferredSize.set(n.preferredWidth,n.preferredHeight),this.dispatchEvent({type:"change"}),this.resizable.setSize(this.baseSize.width,this.baseSize.height)}static get AUTO_SIZE(){return Qo}},Pm=!1,cS=class{constructor(n=null){this.originalMaterials=new Map,this.material=null,this.materials=null,this.materialsBackSide=null,this.materialsDoubleSide=null,this.materialsFlatShaded=null,this.materialsFlatShadedBackSide=null,this.materialsFlatShadedDoubleSide=null,this.setMaterial(n),this.meshCount=0,this.replaceMaterial=e=>{if(e.isMesh){let t;if(e.material.flatShading)switch(e.material.side){case ts:t=this.materialsFlatShadedDoubleSide;break;case Jn:t=this.materialsFlatShadedBackSide;break;default:t=this.materialsFlatShaded;break}else switch(e.material.side){case ts:t=this.materialsDoubleSide;break;case Jn:t=this.materialsBackSide;break;default:t=this.materials;break}this.originalMaterials.set(e,e.material),e.isSkinnedMesh?e.material=t[2]:e.isInstancedMesh?e.material=t[1]:e.material=t[0],++this.meshCount}}}cloneMaterial(n){if(!(n instanceof Rt))return n.clone();const e=n.uniforms,t=new Map;for(const s in e){const r=e[s].value;r.isRenderTargetTexture&&(e[s].value=null,t.set(s,r))}const i=n.clone();for(const s of t)e[s[0]].value=s[1],i.uniforms[s[0]].value=s[1];return i}setMaterial(n){if(this.disposeMaterials(),this.material=n,n!==null){const e=this.materials=[this.cloneMaterial(n),this.cloneMaterial(n),this.cloneMaterial(n)];for(const t of e)t.uniforms=Object.assign({},n.uniforms),t.side=Er;e[2].skinning=!0,this.materialsBackSide=e.map(t=>{const i=this.cloneMaterial(t);return i.uniforms=Object.assign({},n.uniforms),i.side=Jn,i}),this.materialsDoubleSide=e.map(t=>{const i=this.cloneMaterial(t);return i.uniforms=Object.assign({},n.uniforms),i.side=ts,i}),this.materialsFlatShaded=e.map(t=>{const i=this.cloneMaterial(t);return i.uniforms=Object.assign({},n.uniforms),i.flatShading=!0,i}),this.materialsFlatShadedBackSide=e.map(t=>{const i=this.cloneMaterial(t);return i.uniforms=Object.assign({},n.uniforms),i.flatShading=!0,i.side=Jn,i}),this.materialsFlatShadedDoubleSide=e.map(t=>{const i=this.cloneMaterial(t);return i.uniforms=Object.assign({},n.uniforms),i.flatShading=!0,i.side=ts,i})}}render(n,e,t){const i=n.shadowMap.enabled;if(n.shadowMap.enabled=!1,Pm){const s=this.originalMaterials;this.meshCount=0,e.traverse(this.replaceMaterial),n.render(e,t);for(const r of s)r[0].material=r[1];this.meshCount!==s.size&&s.clear()}else{const s=e.overrideMaterial;e.overrideMaterial=this.material,n.render(e,t),e.overrideMaterial=s}n.shadowMap.enabled=i}disposeMaterials(){if(this.material!==null){const n=this.materials.concat(this.materialsBackSide).concat(this.materialsDoubleSide).concat(this.materialsFlatShaded).concat(this.materialsFlatShadedBackSide).concat(this.materialsFlatShadedDoubleSide);for(const e of n)e.dispose()}}dispose(){this.originalMaterials.clear(),this.disposeMaterials()}static get workaroundEnabled(){return Pm}static set workaroundEnabled(n){Pm=n}},Yc=class extends Nn{constructor(n,e,t=null){super("RenderPass",n,e),this.needsSwap=!1,this.clearPass=new Fc,this.overrideMaterialManager=t===null?null:new cS(t),this.ignoreBackground=!1,this.skipShadowMapUpdate=!1,this.selection=null}set mainScene(n){this.scene=n}set mainCamera(n){this.camera=n}get renderToScreen(){return super.renderToScreen}set renderToScreen(n){super.renderToScreen=n,this.clearPass.renderToScreen=n}get overrideMaterial(){const n=this.overrideMaterialManager;return n!==null?n.material:null}set overrideMaterial(n){const e=this.overrideMaterialManager;n!==null?e!==null?e.setMaterial(n):this.overrideMaterialManager=new cS(n):e!==null&&(e.dispose(),this.overrideMaterialManager=null)}getOverrideMaterial(){return this.overrideMaterial}setOverrideMaterial(n){this.overrideMaterial=n}get clear(){return this.clearPass.enabled}set clear(n){this.clearPass.enabled=n}getSelection(){return this.selection}setSelection(n){this.selection=n}isBackgroundDisabled(){return this.ignoreBackground}setBackgroundDisabled(n){this.ignoreBackground=n}isShadowMapDisabled(){return this.skipShadowMapUpdate}setShadowMapDisabled(n){this.skipShadowMapUpdate=n}getClearPass(){return this.clearPass}render(n,e,t,i,s){const r=this.scene,o=this.camera,a=this.selection,l=o.layers.mask,g=r.background,u=n.shadowMap.autoUpdate,C=this.renderToScreen?null:e;a!==null&&o.layers.set(a.getLayer()),this.skipShadowMapUpdate&&(n.shadowMap.autoUpdate=!1),(this.ignoreBackground||this.clearPass.overrideClearColor!==null)&&(r.background=null),this.clearPass.enabled&&this.clearPass.render(n,e),n.setRenderTarget(C),this.overrideMaterialManager!==null?this.overrideMaterialManager.render(n,r,o):n.render(r,o),o.layers.mask=l,r.background=g,n.shadowMap.autoUpdate=u}},ky=class extends Nn{constructor(n,e,{renderTarget:t,resolutionScale:i=1,width:s=qt.AUTO_SIZE,height:r=qt.AUTO_SIZE,resolutionX:o=s,resolutionY:a=r}={}){super("DepthPass"),this.needsSwap=!1,this.renderPass=new Yc(n,e,new ap({depthPacking:Tr}));const l=this.renderPass;l.skipShadowMapUpdate=!0,l.ignoreBackground=!0;const g=l.getClearPass();g.overrideClearColor=new Xe(16777215),g.overrideClearAlpha=1,this.renderTarget=t,this.renderTarget===void 0&&(this.renderTarget=new Nt(1,1,{minFilter:vt,magFilter:vt}),this.renderTarget.texture.name="DepthPass.Target");const u=this.resolution=new qt(this,o,a,i);u.addEventListener("change",C=>this.setSize(u.baseWidth,u.baseHeight))}set mainScene(n){this.renderPass.mainScene=n}set mainCamera(n){this.renderPass.mainCamera=n}get texture(){return this.renderTarget.texture}getTexture(){return this.renderTarget.texture}getResolution(){return this.resolution}getResolutionScale(){return this.resolution.scale}setResolutionScale(n){this.resolution.scale=n}render(n,e,t,i,s){const r=this.renderToScreen?null:this.renderTarget;this.renderPass.render(n,r)}setSize(n,e){const t=this.resolution;t.setBaseSize(n,e),this.renderTarget.setSize(t.width,t.height)}},YM=class extends Nn{constructor({normalBuffer:n=null,resolutionScale:e=.5,width:t=qt.AUTO_SIZE,height:i=qt.AUTO_SIZE,resolutionX:s=t,resolutionY:r=i}={}){super("DepthDownsamplingPass");const o=new fU;o.normalBuffer=n,this.fullscreenMaterial=o,this.needsDepthTexture=!0,this.needsSwap=!1,this.renderTarget=new Nt(1,1,{minFilter:vt,magFilter:vt,depthBuffer:!1,type:Wn}),this.renderTarget.texture.name="DepthDownsamplingPass.Target",this.renderTarget.texture.generateMipmaps=!1;const a=this.resolution=new qt(this,s,r,e);a.addEventListener("change",l=>this.setSize(a.baseWidth,a.baseHeight))}get texture(){return this.renderTarget.texture}getTexture(){return this.renderTarget.texture}getResolution(){return this.resolution}setDepthTexture(n,e=Tn){this.fullscreenMaterial.depthBuffer=n,this.fullscreenMaterial.depthPacking=e}render(n,e,t,i,s){n.setRenderTarget(this.renderToScreen?null:this.renderTarget),n.render(this.scene,this.camera)}setSize(n,e){const t=this.resolution;t.setBaseSize(n,e),this.renderTarget.setSize(t.width,t.height),this.fullscreenMaterial.setSize(n,e)}initialize(n,e,t){const i=n.getContext();if(!(i.getExtension("EXT_color_buffer_float")||i.getExtension("EXT_color_buffer_half_float")))throw new Error("Rendering to float texture is not supported.")}},QU=class extends Nn{constructor({depthPacking:n=Tr}={}){super("DepthCopyPass");const e=new hU;e.outputDepthPacking=n,this.fullscreenMaterial=e,this.needsDepthTexture=!0,this.needsSwap=!1,this.renderTarget=new Nt(1,1,{type:n===Tr?cn:Wn,minFilter:vt,magFilter:vt,depthBuffer:!1}),this.renderTarget.texture.name="DepthCopyPass.Target"}get texture(){return this.renderTarget.texture}getTexture(){return this.renderTarget.texture}get depthPacking(){return this.fullscreenMaterial.outputDepthPacking}getDepthPacking(){return this.fullscreenMaterial.outputDepthPacking}setDepthTexture(n,e=Tn){this.fullscreenMaterial.depthBuffer=n,this.fullscreenMaterial.inputDepthPacking=e}render(n,e,t,i,s){n.setRenderTarget(this.renderToScreen?null:this.renderTarget),n.render(this.scene,this.camera)}setSize(n,e){this.renderTarget.setSize(n,e)}},Sh=new Float32Array([255/256/256**3,255/256/256**2,255/256/256,255/256]);function jU(n){return(n[0]*Sh[0]+n[1]*Sh[1]+n[2]*Sh[2]+n[3]*Sh[3])/255}var qU=class extends QU{constructor({depthPacking:n=Tr,mode:e=TI.SINGLE}={}){super({depthPacking:n}),this.name="DepthPickingPass",this.fullscreenMaterial.mode=e,this.pixelBuffer=n===Tr?new Uint8Array(4):new Float32Array(4),this.callback=null}readDepth(n){return this.fullscreenMaterial.texelPosition.set(n.x*.5+.5,n.y*.5+.5),new Promise(e=>{this.callback=e})}render(n,e,t,i,s){const r=this.fullscreenMaterial,o=r.mode;if(o===TI.FULL&&super.render(n),this.callback!==null){const a=this.renderTarget,l=this.pixelBuffer,g=a.texture.type!==Wn;let u=0,C=0;if(o===TI.SINGLE)super.render(n);else{const d=r.texelPosition;u=Math.round(d.x*a.width),C=Math.round(d.y*a.height)}n.readRenderTargetPixels(a,u,C,1,1,l),this.callback(g?jU(l):l[0]),this.callback=null}}setSize(n,e){this.fullscreenMaterial.mode===TI.FULL&&super.setSize(n,e)}};function IS(n,e,t){for(const i of e){const s="$1"+n+i.charAt(0).toUpperCase()+i.slice(1),r=new RegExp("([^\\.])(\\b"+i+"\\b)","g");for(const o of t.entries())o[1]!==null&&t.set(o[0],o[1].replace(r,s))}}function $U(n,e,t){let i=e.getFragmentShader(),s=e.getVertexShader();const r=i!==void 0&&/mainImage/.test(i),o=i!==void 0&&/mainUv/.test(i);if(t.attributes|=e.getAttributes(),i===void 0)throw new Error(`Missing fragment shader (${e.name})`);if(o&&t.attributes&os.CONVOLUTION)throw new Error(`Effects that transform UVs are incompatible with convolution effects (${e.name})`);if(!r&&!o)throw new Error(`Could not find mainImage or mainUv function (${e.name})`);{const a=/\w+\s+(\w+)\([\w\s,]*\)\s*{/g,l=t.shaderParts;let g=l.get(Pt.FRAGMENT_HEAD)||"",u=l.get(Pt.FRAGMENT_MAIN_UV)||"",C=l.get(Pt.FRAGMENT_MAIN_IMAGE)||"",d=l.get(Pt.VERTEX_HEAD)||"",h=l.get(Pt.VERTEX_MAIN_SUPPORT)||"";const f=new Set,v=new Set;if(o&&(u+=` ${n}MainUv(UV); +}`,UU="uniform vec2 texelSize;varying vec2 vUv;varying vec2 vUv0;varying vec2 vUv1;varying vec2 vUv2;varying vec2 vUv3;varying vec2 vUv4;varying vec2 vUv5;varying vec2 vUv6;varying vec2 vUv7;void main(){vUv=position.xy*0.5+0.5;vUv0=vUv+texelSize*vec2(-1.0,1.0);vUv1=vUv+texelSize*vec2(0.0,1.0);vUv2=vUv+texelSize*vec2(1.0,1.0);vUv3=vUv+texelSize*vec2(-1.0,0.0);vUv4=vUv+texelSize*vec2(1.0,0.0);vUv5=vUv+texelSize*vec2(-1.0,-1.0);vUv6=vUv+texelSize*vec2(0.0,-1.0);vUv7=vUv+texelSize*vec2(1.0,-1.0);gl_Position=vec4(position.xy,1.0,1.0);}",PU=class extends Rt{constructor(){super({name:"UpsamplingMaterial",uniforms:{inputBuffer:new ne(null),supportBuffer:new ne(null),texelSize:new ne(new oe),radius:new ne(.85)},blending:an,toneMapped:!1,depthWrite:!1,depthTest:!1,fragmentShader:DU,vertexShader:UU})}set inputBuffer(n){this.uniforms.inputBuffer.value=n}set supportBuffer(n){this.uniforms.supportBuffer.value=n}get radius(){return this.uniforms.radius.value}set radius(n){this.uniforms.radius.value=n}setSize(n,e){this.uniforms.texelSize.value.set(1/n,1/e)}},_U=new Rc,Oo=null;function JU(){if(Oo===null){const n=new Float32Array([-1,-1,0,3,-1,0,-1,3,0]),e=new Float32Array([0,0,2,0,0,2]);Oo=new Gt,Oo.setAttribute!==void 0?(Oo.setAttribute("position",new Jt(n,3)),Oo.setAttribute("uv",new Jt(e,2))):(Oo.addAttribute("position",new Jt(n,3)),Oo.addAttribute("uv",new Jt(e,2)))}return Oo}var Nn=class{constructor(n="Pass",e=new Sl,t=_U){this.name=n,this.renderer=null,this.scene=e,this.camera=t,this.screen=null,this.rtt=!0,this.needsSwap=!0,this.needsDepthTexture=!1,this.enabled=!0}get renderToScreen(){return!this.rtt}set renderToScreen(n){if(this.rtt===n){const e=this.fullscreenMaterial;e!==null&&(e.needsUpdate=!0),this.rtt=!n}}set mainScene(n){}set mainCamera(n){}setRenderer(n){this.renderer=n}isEnabled(){return this.enabled}setEnabled(n){this.enabled=n}get fullscreenMaterial(){return this.screen!==null?this.screen.material:null}set fullscreenMaterial(n){let e=this.screen;e!==null?e.material=n:(e=new On(JU(),n),e.frustumCulled=!1,this.scene===null&&(this.scene=new Sl),this.scene.add(e),this.screen=e)}getFullscreenMaterial(){return this.fullscreenMaterial}setFullscreenMaterial(n){this.fullscreenMaterial=n}getDepthTexture(){return null}setDepthTexture(n,e=Tn){}render(n,e,t,i,s){throw new Error("Render method not implemented!")}setSize(n,e){}initialize(n,e,t){}dispose(){for(const n of Object.keys(this)){const e=this[n];(e instanceof Nt||e instanceof ei||e instanceof sn||e instanceof Nn)&&this[n].dispose()}}},FM=class extends Nn{constructor(n,e=!0){super("CopyPass"),this.fullscreenMaterial=new HM,this.needsSwap=!1,this.renderTarget=n,n===void 0&&(this.renderTarget=new Nt(1,1,{minFilter:st,magFilter:st,stencilBuffer:!1,depthBuffer:!1}),this.renderTarget.texture.name="CopyPass.Target"),this.autoResize=e}get resize(){return this.autoResize}set resize(n){this.autoResize=n}get texture(){return this.renderTarget.texture}getTexture(){return this.renderTarget.texture}setAutoResizeEnabled(n){this.autoResize=n}render(n,e,t,i,s){this.fullscreenMaterial.inputBuffer=e.texture,n.setRenderTarget(this.renderToScreen?null:this.renderTarget),n.render(this.scene,this.camera)}setSize(n,e){this.autoResize&&this.renderTarget.setSize(n,e)}initialize(n,e,t){t!==void 0&&(this.renderTarget.texture.type=t,t!==cn?this.fullscreenMaterial.defines.FRAMEBUFFER_PRECISION_HIGH="1":So(n)===jt&&Qn(this.renderTarget.texture,jt))}},OU=class extends Nn{constructor(){super("ClearMaskPass",null,null),this.needsSwap=!1}render(n,e,t,i,s){const r=n.state.buffers.stencil;r.setLocked(!1),r.setTest(!1)}},gS=new Xe,Yc=class extends Nn{constructor(n=!0,e=!0,t=!1){super("ClearPass",null,null),this.needsSwap=!1,this.color=n,this.depth=e,this.stencil=t,this.overrideClearColor=null,this.overrideClearAlpha=-1}setClearFlags(n,e,t){this.color=n,this.depth=e,this.stencil=t}getOverrideClearColor(){return this.overrideClearColor}setOverrideClearColor(n){this.overrideClearColor=n}getOverrideClearAlpha(){return this.overrideClearAlpha}setOverrideClearAlpha(n){this.overrideClearAlpha=n}render(n,e,t,i,s){const r=this.overrideClearColor,o=this.overrideClearAlpha,a=n.getClearAlpha(),l=r!==null,g=o>=0;l?(n.getClearColor(gS),n.setClearColor(r,g?o:a)):g&&n.setClearAlpha(o),n.setRenderTarget(this.renderToScreen?null:e),n.clear(this.color,this.depth,this.stencil),l?n.setClearColor(gS,a):g&&n.setClearAlpha(a)}},Qo=-1,qt=class extends Ps{constructor(n,e=Qo,t=Qo,i=1){super(),this.resizable=n,this.baseSize=new oe(1,1),this.preferredSize=new oe(e,t),this.target=this.preferredSize,this.s=i,this.effectiveSize=new oe,this.addEventListener("change",()=>this.updateEffectiveSize()),this.updateEffectiveSize()}updateEffectiveSize(){const n=this.baseSize,e=this.preferredSize,t=this.effectiveSize,i=this.scale;e.width!==Qo?t.width=e.width:e.height!==Qo?t.width=Math.round(e.height*(n.width/Math.max(n.height,1))):t.width=Math.round(n.width*i),e.height!==Qo?t.height=e.height:e.width!==Qo?t.height=Math.round(e.width/Math.max(n.width/Math.max(n.height,1),1)):t.height=Math.round(n.height*i)}get width(){return this.effectiveSize.width}set width(n){this.preferredWidth=n}get height(){return this.effectiveSize.height}set height(n){this.preferredHeight=n}getWidth(){return this.width}getHeight(){return this.height}get scale(){return this.s}set scale(n){this.s!==n&&(this.s=n,this.preferredSize.setScalar(Qo),this.dispatchEvent({type:"change"}),this.resizable.setSize(this.baseSize.width,this.baseSize.height))}getScale(){return this.scale}setScale(n){this.scale=n}get baseWidth(){return this.baseSize.width}set baseWidth(n){this.baseSize.width!==n&&(this.baseSize.width=n,this.dispatchEvent({type:"change"}),this.resizable.setSize(this.baseSize.width,this.baseSize.height))}getBaseWidth(){return this.baseWidth}setBaseWidth(n){this.baseWidth=n}get baseHeight(){return this.baseSize.height}set baseHeight(n){this.baseSize.height!==n&&(this.baseSize.height=n,this.dispatchEvent({type:"change"}),this.resizable.setSize(this.baseSize.width,this.baseSize.height))}getBaseHeight(){return this.baseHeight}setBaseHeight(n){this.baseHeight=n}setBaseSize(n,e){(this.baseSize.width!==n||this.baseSize.height!==e)&&(this.baseSize.set(n,e),this.dispatchEvent({type:"change"}),this.resizable.setSize(this.baseSize.width,this.baseSize.height))}get preferredWidth(){return this.preferredSize.width}set preferredWidth(n){this.preferredSize.width!==n&&(this.preferredSize.width=n,this.dispatchEvent({type:"change"}),this.resizable.setSize(this.baseSize.width,this.baseSize.height))}getPreferredWidth(){return this.preferredWidth}setPreferredWidth(n){this.preferredWidth=n}get preferredHeight(){return this.preferredSize.height}set preferredHeight(n){this.preferredSize.height!==n&&(this.preferredSize.height=n,this.dispatchEvent({type:"change"}),this.resizable.setSize(this.baseSize.width,this.baseSize.height))}getPreferredHeight(){return this.preferredHeight}setPreferredHeight(n){this.preferredHeight=n}setPreferredSize(n,e){(this.preferredSize.width!==n||this.preferredSize.height!==e)&&(this.preferredSize.set(n,e),this.dispatchEvent({type:"change"}),this.resizable.setSize(this.baseSize.width,this.baseSize.height))}copy(n){this.s=n.scale,this.baseSize.set(n.baseWidth,n.baseHeight),this.preferredSize.set(n.preferredWidth,n.preferredHeight),this.dispatchEvent({type:"change"}),this.resizable.setSize(this.baseSize.width,this.baseSize.height)}static get AUTO_SIZE(){return Qo}},Pm=!1,cS=class{constructor(n=null){this.originalMaterials=new Map,this.material=null,this.materials=null,this.materialsBackSide=null,this.materialsDoubleSide=null,this.materialsFlatShaded=null,this.materialsFlatShadedBackSide=null,this.materialsFlatShadedDoubleSide=null,this.setMaterial(n),this.meshCount=0,this.replaceMaterial=e=>{if(e.isMesh){let t;if(e.material.flatShading)switch(e.material.side){case ts:t=this.materialsFlatShadedDoubleSide;break;case Jn:t=this.materialsFlatShadedBackSide;break;default:t=this.materialsFlatShaded;break}else switch(e.material.side){case ts:t=this.materialsDoubleSide;break;case Jn:t=this.materialsBackSide;break;default:t=this.materials;break}this.originalMaterials.set(e,e.material),e.isSkinnedMesh?e.material=t[2]:e.isInstancedMesh?e.material=t[1]:e.material=t[0],++this.meshCount}}}cloneMaterial(n){if(!(n instanceof Rt))return n.clone();const e=n.uniforms,t=new Map;for(const s in e){const r=e[s].value;r.isRenderTargetTexture&&(e[s].value=null,t.set(s,r))}const i=n.clone();for(const s of t)e[s[0]].value=s[1],i.uniforms[s[0]].value=s[1];return i}setMaterial(n){if(this.disposeMaterials(),this.material=n,n!==null){const e=this.materials=[this.cloneMaterial(n),this.cloneMaterial(n),this.cloneMaterial(n)];for(const t of e)t.uniforms=Object.assign({},n.uniforms),t.side=Er;e[2].skinning=!0,this.materialsBackSide=e.map(t=>{const i=this.cloneMaterial(t);return i.uniforms=Object.assign({},n.uniforms),i.side=Jn,i}),this.materialsDoubleSide=e.map(t=>{const i=this.cloneMaterial(t);return i.uniforms=Object.assign({},n.uniforms),i.side=ts,i}),this.materialsFlatShaded=e.map(t=>{const i=this.cloneMaterial(t);return i.uniforms=Object.assign({},n.uniforms),i.flatShading=!0,i}),this.materialsFlatShadedBackSide=e.map(t=>{const i=this.cloneMaterial(t);return i.uniforms=Object.assign({},n.uniforms),i.flatShading=!0,i.side=Jn,i}),this.materialsFlatShadedDoubleSide=e.map(t=>{const i=this.cloneMaterial(t);return i.uniforms=Object.assign({},n.uniforms),i.flatShading=!0,i.side=ts,i})}}render(n,e,t){const i=n.shadowMap.enabled;if(n.shadowMap.enabled=!1,Pm){const s=this.originalMaterials;this.meshCount=0,e.traverse(this.replaceMaterial),n.render(e,t);for(const r of s)r[0].material=r[1];this.meshCount!==s.size&&s.clear()}else{const s=e.overrideMaterial;e.overrideMaterial=this.material,n.render(e,t),e.overrideMaterial=s}n.shadowMap.enabled=i}disposeMaterials(){if(this.material!==null){const n=this.materials.concat(this.materialsBackSide).concat(this.materialsDoubleSide).concat(this.materialsFlatShaded).concat(this.materialsFlatShadedBackSide).concat(this.materialsFlatShadedDoubleSide);for(const e of n)e.dispose()}}dispose(){this.originalMaterials.clear(),this.disposeMaterials()}static get workaroundEnabled(){return Pm}static set workaroundEnabled(n){Pm=n}},Kc=class extends Nn{constructor(n,e,t=null){super("RenderPass",n,e),this.needsSwap=!1,this.clearPass=new Yc,this.overrideMaterialManager=t===null?null:new cS(t),this.ignoreBackground=!1,this.skipShadowMapUpdate=!1,this.selection=null}set mainScene(n){this.scene=n}set mainCamera(n){this.camera=n}get renderToScreen(){return super.renderToScreen}set renderToScreen(n){super.renderToScreen=n,this.clearPass.renderToScreen=n}get overrideMaterial(){const n=this.overrideMaterialManager;return n!==null?n.material:null}set overrideMaterial(n){const e=this.overrideMaterialManager;n!==null?e!==null?e.setMaterial(n):this.overrideMaterialManager=new cS(n):e!==null&&(e.dispose(),this.overrideMaterialManager=null)}getOverrideMaterial(){return this.overrideMaterial}setOverrideMaterial(n){this.overrideMaterial=n}get clear(){return this.clearPass.enabled}set clear(n){this.clearPass.enabled=n}getSelection(){return this.selection}setSelection(n){this.selection=n}isBackgroundDisabled(){return this.ignoreBackground}setBackgroundDisabled(n){this.ignoreBackground=n}isShadowMapDisabled(){return this.skipShadowMapUpdate}setShadowMapDisabled(n){this.skipShadowMapUpdate=n}getClearPass(){return this.clearPass}render(n,e,t,i,s){const r=this.scene,o=this.camera,a=this.selection,l=o.layers.mask,g=r.background,u=n.shadowMap.autoUpdate,C=this.renderToScreen?null:e;a!==null&&o.layers.set(a.getLayer()),this.skipShadowMapUpdate&&(n.shadowMap.autoUpdate=!1),(this.ignoreBackground||this.clearPass.overrideClearColor!==null)&&(r.background=null),this.clearPass.enabled&&this.clearPass.render(n,e),n.setRenderTarget(C),this.overrideMaterialManager!==null?this.overrideMaterialManager.render(n,r,o):n.render(r,o),o.layers.mask=l,r.background=g,n.shadowMap.autoUpdate=u}},ky=class extends Nn{constructor(n,e,{renderTarget:t,resolutionScale:i=1,width:s=qt.AUTO_SIZE,height:r=qt.AUTO_SIZE,resolutionX:o=s,resolutionY:a=r}={}){super("DepthPass"),this.needsSwap=!1,this.renderPass=new Kc(n,e,new ap({depthPacking:Tr}));const l=this.renderPass;l.skipShadowMapUpdate=!0,l.ignoreBackground=!0;const g=l.getClearPass();g.overrideClearColor=new Xe(16777215),g.overrideClearAlpha=1,this.renderTarget=t,this.renderTarget===void 0&&(this.renderTarget=new Nt(1,1,{minFilter:vt,magFilter:vt}),this.renderTarget.texture.name="DepthPass.Target");const u=this.resolution=new qt(this,o,a,i);u.addEventListener("change",C=>this.setSize(u.baseWidth,u.baseHeight))}set mainScene(n){this.renderPass.mainScene=n}set mainCamera(n){this.renderPass.mainCamera=n}get texture(){return this.renderTarget.texture}getTexture(){return this.renderTarget.texture}getResolution(){return this.resolution}getResolutionScale(){return this.resolution.scale}setResolutionScale(n){this.resolution.scale=n}render(n,e,t,i,s){const r=this.renderToScreen?null:this.renderTarget;this.renderPass.render(n,r)}setSize(n,e){const t=this.resolution;t.setBaseSize(n,e),this.renderTarget.setSize(t.width,t.height)}},YM=class extends Nn{constructor({normalBuffer:n=null,resolutionScale:e=.5,width:t=qt.AUTO_SIZE,height:i=qt.AUTO_SIZE,resolutionX:s=t,resolutionY:r=i}={}){super("DepthDownsamplingPass");const o=new fU;o.normalBuffer=n,this.fullscreenMaterial=o,this.needsDepthTexture=!0,this.needsSwap=!1,this.renderTarget=new Nt(1,1,{minFilter:vt,magFilter:vt,depthBuffer:!1,type:Wn}),this.renderTarget.texture.name="DepthDownsamplingPass.Target",this.renderTarget.texture.generateMipmaps=!1;const a=this.resolution=new qt(this,s,r,e);a.addEventListener("change",l=>this.setSize(a.baseWidth,a.baseHeight))}get texture(){return this.renderTarget.texture}getTexture(){return this.renderTarget.texture}getResolution(){return this.resolution}setDepthTexture(n,e=Tn){this.fullscreenMaterial.depthBuffer=n,this.fullscreenMaterial.depthPacking=e}render(n,e,t,i,s){n.setRenderTarget(this.renderToScreen?null:this.renderTarget),n.render(this.scene,this.camera)}setSize(n,e){const t=this.resolution;t.setBaseSize(n,e),this.renderTarget.setSize(t.width,t.height),this.fullscreenMaterial.setSize(n,e)}initialize(n,e,t){const i=n.getContext();if(!(i.getExtension("EXT_color_buffer_float")||i.getExtension("EXT_color_buffer_half_float")))throw new Error("Rendering to float texture is not supported.")}},QU=class extends Nn{constructor({depthPacking:n=Tr}={}){super("DepthCopyPass");const e=new hU;e.outputDepthPacking=n,this.fullscreenMaterial=e,this.needsDepthTexture=!0,this.needsSwap=!1,this.renderTarget=new Nt(1,1,{type:n===Tr?cn:Wn,minFilter:vt,magFilter:vt,depthBuffer:!1}),this.renderTarget.texture.name="DepthCopyPass.Target"}get texture(){return this.renderTarget.texture}getTexture(){return this.renderTarget.texture}get depthPacking(){return this.fullscreenMaterial.outputDepthPacking}getDepthPacking(){return this.fullscreenMaterial.outputDepthPacking}setDepthTexture(n,e=Tn){this.fullscreenMaterial.depthBuffer=n,this.fullscreenMaterial.inputDepthPacking=e}render(n,e,t,i,s){n.setRenderTarget(this.renderToScreen?null:this.renderTarget),n.render(this.scene,this.camera)}setSize(n,e){this.renderTarget.setSize(n,e)}},Sh=new Float32Array([255/256/256**3,255/256/256**2,255/256/256,255/256]);function jU(n){return(n[0]*Sh[0]+n[1]*Sh[1]+n[2]*Sh[2]+n[3]*Sh[3])/255}var qU=class extends QU{constructor({depthPacking:n=Tr,mode:e=kI.SINGLE}={}){super({depthPacking:n}),this.name="DepthPickingPass",this.fullscreenMaterial.mode=e,this.pixelBuffer=n===Tr?new Uint8Array(4):new Float32Array(4),this.callback=null}readDepth(n){return this.fullscreenMaterial.texelPosition.set(n.x*.5+.5,n.y*.5+.5),new Promise(e=>{this.callback=e})}render(n,e,t,i,s){const r=this.fullscreenMaterial,o=r.mode;if(o===kI.FULL&&super.render(n),this.callback!==null){const a=this.renderTarget,l=this.pixelBuffer,g=a.texture.type!==Wn;let u=0,C=0;if(o===kI.SINGLE)super.render(n);else{const d=r.texelPosition;u=Math.round(d.x*a.width),C=Math.round(d.y*a.height)}n.readRenderTargetPixels(a,u,C,1,1,l),this.callback(g?jU(l):l[0]),this.callback=null}}setSize(n,e){this.fullscreenMaterial.mode===kI.FULL&&super.setSize(n,e)}};function IS(n,e,t){for(const i of e){const s="$1"+n+i.charAt(0).toUpperCase()+i.slice(1),r=new RegExp("([^\\.])(\\b"+i+"\\b)","g");for(const o of t.entries())o[1]!==null&&t.set(o[0],o[1].replace(r,s))}}function $U(n,e,t){let i=e.getFragmentShader(),s=e.getVertexShader();const r=i!==void 0&&/mainImage/.test(i),o=i!==void 0&&/mainUv/.test(i);if(t.attributes|=e.getAttributes(),i===void 0)throw new Error(`Missing fragment shader (${e.name})`);if(o&&t.attributes&os.CONVOLUTION)throw new Error(`Effects that transform UVs are incompatible with convolution effects (${e.name})`);if(!r&&!o)throw new Error(`Could not find mainImage or mainUv function (${e.name})`);{const a=/\w+\s+(\w+)\([\w\s,]*\)\s*{/g,l=t.shaderParts;let g=l.get(Pt.FRAGMENT_HEAD)||"",u=l.get(Pt.FRAGMENT_MAIN_UV)||"",C=l.get(Pt.FRAGMENT_MAIN_IMAGE)||"",d=l.get(Pt.VERTEX_HEAD)||"",h=l.get(Pt.VERTEX_MAIN_SUPPORT)||"";const f=new Set,v=new Set;if(o&&(u+=` ${n}MainUv(UV); `,t.uvTransformation=!0),s!==null&&/mainSupport/.test(s)){const b=/mainSupport *\([\w\s]*?uv\s*?\)/.test(s);h+=` ${n}MainSupport(`,h+=b?`vUv); `:`); `;for(const m of s.matchAll(/(?:varying\s+\w+\s+([\S\s]*?);)/g))for(const B of m[1].split(/\s*,\s*/))t.varyings.add(B),f.add(B),v.add(B);for(const m of s.matchAll(a))v.add(m[1])}for(const b of i.matchAll(a))v.add(b[1]);for(const b of e.defines.keys())v.add(b.replace(/\([\w\s,]*\)/g,""));for(const b of e.uniforms.keys())v.add(b);v.delete("while"),v.delete("for"),v.delete("if"),e.uniforms.forEach((b,m)=>t.uniforms.set(n+m.charAt(0).toUpperCase()+m.slice(1),b)),e.defines.forEach((b,m)=>t.defines.set(n+m.charAt(0).toUpperCase()+m.slice(1),b));const y=new Map([["fragment",i],["vertex",s]]);IS(n,v,t.defines),IS(n,v,y),i=y.get("fragment"),s=y.get("vertex");const A=e.blendMode;if(t.blendModes.set(A.blendFunction,A),r){e.inputColorSpace!==null&&e.inputColorSpace!==t.colorSpace&&(C+=e.inputColorSpace===jt?`color0 = LinearTosRGB(color0); @@ -3999,12 +3999,12 @@ uniform float radius;varying vec2 vUv;varying vec2 vUv0;varying vec2 vUv1;varyin `+i),this.needsDepthTexture=this.getDepthTexture()===null):this.needsDepthTexture=!1,n.colorSpace===jt&&(i+=`color0 = sRGBToLinear(color0); `),n.uvTransformation?(s=`vec2 transformedUv = vUv; `+s,n.defines.set("UV","transformedUv")):n.defines.set("UV","vUv"),n.shaderParts.set(Pt.FRAGMENT_HEAD,t),n.shaderParts.set(Pt.FRAGMENT_MAIN_IMAGE,i),n.shaderParts.set(Pt.FRAGMENT_MAIN_UV,s);for(const[o,a]of n.shaderParts)a!==null&&n.shaderParts.set(o,a.trim().replace(/^#/,` -#`));this.skipRendering=e===0,this.needsSwap=!this.skipRendering,this.fullscreenMaterial.setShaderData(n)}recompile(){this.updateMaterial()}getDepthTexture(){return this.fullscreenMaterial.depthBuffer}setDepthTexture(n,e=Tn){this.fullscreenMaterial.depthBuffer=n,this.fullscreenMaterial.depthPacking=e;for(const t of this.effects)t.setDepthTexture(n,e)}render(n,e,t,i,s){for(const r of this.effects)r.update(n,e,i);if(!this.skipRendering||this.renderToScreen){const r=this.fullscreenMaterial;r.inputBuffer=e.texture,r.time+=i*this.timeScale,n.setRenderTarget(this.renderToScreen?null:t),n.render(this.scene,this.camera)}}setSize(n,e){this.fullscreenMaterial.setSize(n,e);for(const t of this.effects)t.setSize(n,e)}initialize(n,e,t){this.renderer=n;for(const i of this.effects)i.initialize(n,e,t);this.updateMaterial(),t!==void 0&&t!==cn&&(this.fullscreenMaterial.defines.FRAMEBUFFER_PRECISION_HIGH="1")}dispose(){super.dispose();for(const n of this.effects)n.removeEventListener("change",this.listener),n.dispose()}handleEvent(n){switch(n.type){case"change":this.recompile();break}}},vp=class extends Nn{constructor({kernelSize:n=Xc.MEDIUM,resolutionScale:e=.5,width:t=qt.AUTO_SIZE,height:i=qt.AUTO_SIZE,resolutionX:s=t,resolutionY:r=i}={}){super("KawaseBlurPass"),this.renderTargetA=new Nt(1,1,{depthBuffer:!1}),this.renderTargetA.texture.name="Blur.Target.A",this.renderTargetB=this.renderTargetA.clone(),this.renderTargetB.texture.name="Blur.Target.B";const o=this.resolution=new qt(this,s,r,e);o.addEventListener("change",a=>this.setSize(o.baseWidth,o.baseHeight)),this._blurMaterial=new lU,this._blurMaterial.kernelSize=n,this.copyMaterial=new HM}getResolution(){return this.resolution}get blurMaterial(){return this._blurMaterial}set blurMaterial(n){this._blurMaterial=n}get dithering(){return this.copyMaterial.dithering}set dithering(n){this.copyMaterial.dithering=n}get kernelSize(){return this.blurMaterial.kernelSize}set kernelSize(n){this.blurMaterial.kernelSize=n}get width(){return this.resolution.width}set width(n){this.resolution.preferredWidth=n}get height(){return this.resolution.height}set height(n){this.resolution.preferredHeight=n}get scale(){return this.blurMaterial.scale}set scale(n){this.blurMaterial.scale=n}getScale(){return this.blurMaterial.scale}setScale(n){this.blurMaterial.scale=n}getKernelSize(){return this.kernelSize}setKernelSize(n){this.kernelSize=n}getResolutionScale(){return this.resolution.scale}setResolutionScale(n){this.resolution.scale=n}render(n,e,t,i,s){const r=this.scene,o=this.camera,a=this.renderTargetA,l=this.renderTargetB,g=this.blurMaterial,u=g.kernelSequence;let C=e;this.fullscreenMaterial=g;for(let d=0,h=u.length;dthis.setSize(l.baseWidth,l.baseHeight))}get texture(){return this.renderTarget.texture}getTexture(){return this.renderTarget.texture}getResolution(){return this.resolution}render(n,e,t,i,s){const r=this.fullscreenMaterial;r.inputBuffer=e.texture,n.setRenderTarget(this.renderToScreen?null:this.renderTarget),n.render(this.scene,this.camera)}setSize(n,e){const t=this.resolution;t.setBaseSize(n,e),this.renderTarget.setSize(t.width,t.height)}initialize(n,e,t){t!==void 0&&t!==cn&&(this.renderTarget.texture.type=t,this.fullscreenMaterial.defines.FRAMEBUFFER_PRECISION_HIGH="1")}},nP=class extends Nn{constructor(n,e){super("MaskPass",n,e),this.needsSwap=!1,this.clearPass=new Fc(!1,!1,!0),this.inverse=!1}set mainScene(n){this.scene=n}set mainCamera(n){this.camera=n}get inverted(){return this.inverse}set inverted(n){this.inverse=n}get clear(){return this.clearPass.enabled}set clear(n){this.clearPass.enabled=n}getClearPass(){return this.clearPass}isInverted(){return this.inverted}setInverted(n){this.inverted=n}render(n,e,t,i,s){const r=n.getContext(),o=n.state.buffers,a=this.scene,l=this.camera,g=this.clearPass,u=this.inverted?0:1,C=1-u;o.color.setMask(!1),o.depth.setMask(!1),o.color.setLocked(!0),o.depth.setLocked(!0),o.stencil.setTest(!0),o.stencil.setOp(r.REPLACE,r.REPLACE,r.REPLACE),o.stencil.setFunc(r.ALWAYS,u,4294967295),o.stencil.setClear(C),o.stencil.setLocked(!0),this.clearPass.enabled&&(this.renderToScreen?g.render(n,null):(g.render(n,e),g.render(n,t))),this.renderToScreen?(n.setRenderTarget(null),n.render(a,l)):(n.setRenderTarget(e),n.render(a,l),n.setRenderTarget(t),n.render(a,l)),o.color.setLocked(!1),o.depth.setLocked(!1),o.stencil.setLocked(!1),o.stencil.setFunc(r.EQUAL,1,4294967295),o.stencil.setOp(r.KEEP,r.KEEP,r.KEEP),o.stencil.setLocked(!0)}},iP=class extends Nn{constructor(){super("MipmapBlurPass"),this.needsSwap=!1,this.renderTarget=new Nt(1,1,{depthBuffer:!1}),this.renderTarget.texture.name="Upsampling.Mipmap0",this.downsamplingMipmaps=[],this.upsamplingMipmaps=[],this.downsamplingMaterial=new yU,this.upsamplingMaterial=new PU,this.resolution=new oe}get texture(){return this.renderTarget.texture}get levels(){return this.downsamplingMipmaps.length}set levels(n){if(this.levels!==n){const e=this.renderTarget;this.dispose(),this.downsamplingMipmaps=[],this.upsamplingMipmaps=[];for(let t=0;t=0;--d){const h=u[d];l.setSize(C.width,C.height),l.inputBuffer=C.texture,l.supportBuffer=g[d].texture,n.setRenderTarget(h),n.render(r,o),C=h}}setSize(n,e){const t=this.resolution;t.set(n,e);let i=t.width,s=t.height;for(let r=0,o=this.downsamplingMipmaps.length;rthis.setSize(u.baseWidth,u.baseHeight))}set mainScene(n){this.renderPass.mainScene=n}set mainCamera(n){this.renderPass.mainCamera=n}get texture(){return this.renderTarget.texture}getTexture(){return this.renderTarget.texture}getResolution(){return this.resolution}getResolutionScale(){return this.resolution.scale}setResolutionScale(n){this.resolution.scale=n}render(n,e,t,i,s){const r=this.renderToScreen?null:this.renderTarget;this.renderPass.render(n,r,r)}setSize(n,e){const t=this.resolution;t.setBaseSize(n,e),this.renderTarget.setSize(t.width,t.height)}},As=class extends Nn{constructor(n,e="inputBuffer"){super("ShaderPass"),this.fullscreenMaterial=n,this.input=e}setInput(n){this.input=n}render(n,e,t,i,s){const r=this.fullscreenMaterial.uniforms;e!==null&&r!==void 0&&r[this.input]!==void 0&&(r[this.input].value=e.texture),n.setRenderTarget(this.renderToScreen?null:t),n.render(this.scene,this.camera)}initialize(n,e,t){t!==void 0&&t!==cn&&(this.fullscreenMaterial.defines.FRAMEBUFFER_PRECISION_HIGH="1")}},_m=1/1e3,rP=1e3,oP=class{constructor(){this.startTime=performance.now(),this.previousTime=0,this.currentTime=0,this._delta=0,this._elapsed=0,this._fixedDelta=1e3/60,this.timescale=1,this.useFixedDelta=!1,this._autoReset=!1}get autoReset(){return this._autoReset}set autoReset(n){typeof document<"u"&&document.hidden!==void 0&&(n?document.addEventListener("visibilitychange",this):document.removeEventListener("visibilitychange",this),this._autoReset=n)}get delta(){return this._delta*_m}get fixedDelta(){return this._fixedDelta*_m}set fixedDelta(n){this._fixedDelta=n*rP}get elapsed(){return this._elapsed*_m}update(n){this.useFixedDelta?this._delta=this.fixedDelta:(this.previousTime=this.currentTime,this.currentTime=(n!==void 0?n:performance.now())-this.startTime,this._delta=this.currentTime-this.previousTime),this._delta*=this.timescale,this._elapsed+=this._delta}reset(){this._delta=0,this._elapsed=0,this.currentTime=performance.now()-this.startTime}handleEvent(n){document.hidden||(this.currentTime=performance.now()-this.startTime)}dispose(){this.autoReset=!1}},aP=class{constructor(e=null,{depthBuffer:t=!0,stencilBuffer:i=!1,multisampling:s=0,frameBufferType:r}={}){this.renderer=null,this.inputBuffer=this.createBuffer(t,i,r,s),this.outputBuffer=this.inputBuffer.clone(),this.copyPass=new FM,this.depthTexture=null,this.passes=[],this.timer=new oP,this.autoRenderToScreen=!0,this.setRenderer(e)}get multisampling(){return this.inputBuffer.samples||0}set multisampling(e){const t=this.inputBuffer,i=this.multisampling;i>0&&e>0?(this.inputBuffer.samples=e,this.outputBuffer.samples=e,this.inputBuffer.dispose(),this.outputBuffer.dispose()):i!==e&&(this.inputBuffer.dispose(),this.outputBuffer.dispose(),this.inputBuffer=this.createBuffer(t.depthBuffer,t.stencilBuffer,t.texture.type,e),this.inputBuffer.depthTexture=this.depthTexture,this.outputBuffer=this.inputBuffer.clone())}getTimer(){return this.timer}getRenderer(){return this.renderer}setRenderer(e){if(this.renderer=e,e!==null){const t=e.getSize(new oe),i=e.getContext().getContextAttributes().alpha,s=this.inputBuffer.texture.type;s===cn&&So(e)===jt&&(Qn(this.inputBuffer.texture,jt),Qn(this.outputBuffer.texture,jt),this.inputBuffer.dispose(),this.outputBuffer.dispose()),e.autoClear=!1,this.setSize(t.width,t.height);for(const r of this.passes)r.initialize(e,i,s)}}replaceRenderer(e,t=!0){const i=this.renderer,s=i.domElement.parentNode;return this.setRenderer(e),t&&s!==null&&(s.removeChild(i.domElement),s.appendChild(e.domElement)),i}createDepthTexture(){const e=this.depthTexture=new lp;return this.inputBuffer.depthTexture=e,this.inputBuffer.dispose(),this.inputBuffer.stencilBuffer?(e.format=va,e.type=da):e.type=Ao,e}deleteDepthTexture(){if(this.depthTexture!==null){this.depthTexture.dispose(),this.depthTexture=null,this.inputBuffer.depthTexture=null,this.inputBuffer.dispose();for(const e of this.passes)e.setDepthTexture(null)}}createBuffer(e,t,i,s){const r=this.renderer,o=r===null?new oe:r.getDrawingBufferSize(new oe),a={minFilter:st,magFilter:st,stencilBuffer:t,depthBuffer:e,type:i},l=new Nt(o.width,o.height,a);return s>0&&(l.ignoreDepthForMultisampleCopy=!1,l.samples=s),i===cn&&So(r)===jt&&Qn(l.texture,jt),l.texture.name="EffectComposer.Buffer",l.texture.generateMipmaps=!1,l}setMainScene(e){for(const t of this.passes)t.mainScene=e}setMainCamera(e){for(const t of this.passes)t.mainCamera=e}addPass(e,t){const i=this.passes,s=this.renderer,r=s.getDrawingBufferSize(new oe),o=s.getContext().getContextAttributes().alpha,a=this.inputBuffer.texture.type;if(e.setRenderer(s),e.setSize(r.width,r.height),e.initialize(s,o,a),this.autoRenderToScreen&&(i.length>0&&(i[i.length-1].renderToScreen=!1),e.renderToScreen&&(this.autoRenderToScreen=!1)),t!==void 0?i.splice(t,0,e):i.push(e),this.autoRenderToScreen&&(i[i.length-1].renderToScreen=!0),e.needsDepthTexture||this.depthTexture!==null)if(this.depthTexture===null){const l=this.createDepthTexture();for(e of i)e.setDepthTexture(l)}else e.setDepthTexture(this.depthTexture)}removePass(e){const t=this.passes,i=t.indexOf(e);if(i!==-1&&t.splice(i,1).length>0){if(this.depthTexture!==null){const o=(l,g)=>l||g.needsDepthTexture;t.reduce(o,!1)||(e.getDepthTexture()===this.depthTexture&&e.setDepthTexture(null),this.deleteDepthTexture())}this.autoRenderToScreen&&i===t.length&&(e.renderToScreen=!1,t.length>0&&(t[t.length-1].renderToScreen=!0))}}removeAllPasses(){const e=this.passes;this.deleteDepthTexture(),e.length>0&&(this.autoRenderToScreen&&(e[e.length-1].renderToScreen=!1),this.passes=[])}render(e){const t=this.renderer,i=this.copyPass;let s=this.inputBuffer,r=this.outputBuffer,o=!1,a,l,g;e===void 0&&(this.timer.update(),e=this.timer.delta);for(const u of this.passes)u.enabled&&(u.render(t,s,r,e,o),u.needsSwap&&(o&&(i.renderToScreen=u.renderToScreen,a=t.getContext(),l=t.state.buffers.stencil,l.setFunc(a.NOTEQUAL,1,4294967295),i.render(t,s,r,e,o),l.setFunc(a.EQUAL,1,4294967295)),g=s,s=r,r=g),u instanceof nP?o=!0:u instanceof OU&&(o=!1))}setSize(e,t,i){const s=this.renderer,r=s.getSize(new oe);(e===void 0||t===void 0)&&(e=r.width,t=r.height),(r.width!==e||r.height!==t)&&s.setSize(e,t,i);const o=s.getDrawingBufferSize(new oe);this.inputBuffer.setSize(o.width,o.height),this.outputBuffer.setSize(o.width,o.height);for(const a of this.passes)a.setSize(o.width,o.height)}reset(){const e=this.timer.autoReset;this.dispose(),this.autoRenderToScreen=!0,this.timer.autoReset=e}dispose(){for(const e of this.passes)e.dispose();this.passes=[],this.inputBuffer!==null&&this.inputBuffer.dispose(),this.outputBuffer!==null&&this.outputBuffer.dispose(),this.deleteDepthTexture(),this.copyPass.dispose(),this.timer.dispose()}},lP=class{constructor(){this.shaderParts=new Map([[Pt.FRAGMENT_HEAD,null],[Pt.FRAGMENT_MAIN_UV,null],[Pt.FRAGMENT_MAIN_IMAGE,null],[Pt.VERTEX_HEAD,null],[Pt.VERTEX_MAIN_SUPPORT,null]]),this.defines=new Map,this.uniforms=new Map,this.blendModes=new Map,this.extensions=new Set,this.attributes=os.NONE,this.varyings=new Set,this.uvTransformation=!1,this.readDepth=!1,this.colorSpace=yc}},Dy=class extends Set{constructor(n,e=10){super(),this.l=e,this.exclusive=!1,n!==void 0&&this.set(n)}get layer(){return this.l}set layer(n){const e=this.l;for(const t of this)t.layers.disable(e),t.layers.enable(n);this.l=n}getLayer(){return this.layer}setLayer(n){this.layer=n}isExclusive(){return this.exclusive}setExclusive(n){this.exclusive=n}clear(){const n=this.layer;for(const e of this)e.layers.disable(n);return super.clear()}set(n){this.clear();for(const e of n)this.add(e);return this}indexOf(n){return this.has(n)?0:-1}add(n){return this.exclusive?n.layers.set(this.layer):n.layers.enable(this.layer),super.add(n)}delete(n){return this.has(n)&&n.layers.disable(this.layer),super.delete(n)}toggle(n){let e;return this.has(n)?(this.delete(n),e=!1):(this.add(n),e=!0),e}setVisible(n){for(const e of this)n?e.layers.enable(0):e.layers.disable(0);return this}},gP="vec4 blend(const in vec4 x,const in vec4 y,const in float opacity){return mix(x,x+y,opacity);}",cP="vec4 blend(const in vec4 x,const in vec4 y,const in float opacity){return mix(x,y,min(y.a,opacity));}",IP="vec4 blend(const in vec4 x,const in vec4 y,const in float opacity){return mix(x,(x+y)*0.5,opacity);}",uP="vec4 blend(const in vec4 x,const in vec4 y,const in float opacity){vec3 xHSL=RGBToHSL(x.rgb);vec3 yHSL=RGBToHSL(y.rgb);vec3 z=HSLToRGB(vec3(yHSL.rg,xHSL.b));return vec4(mix(x.rgb,z,opacity),y.a);}",CP="vec4 blend(const in vec4 x,const in vec4 y,const in float opacity){vec4 z=mix(step(0.0,y)*(1.0-min(vec4(1.0),(1.0-x)/y)),vec4(1.0),step(1.0,x));return mix(x,z,opacity);}",dP="vec4 blend(const in vec4 x,const in vec4 y,const in float opacity){vec4 z=step(0.0,x)*mix(min(vec4(1.0),x/max(1.0-y,1e-9)),vec4(1.0),step(1.0,y));return mix(x,z,opacity);}",hP="vec4 blend(const in vec4 x,const in vec4 y,const in float opacity){return mix(x,min(x,y),opacity);}",AP="vec4 blend(const in vec4 x,const in vec4 y,const in float opacity){return mix(x,abs(x-y),opacity);}",pP="vec4 blend(const in vec4 x,const in vec4 y,const in float opacity){return mix(x,x/max(y,1e-12),opacity);}",fP="vec4 blend(const in vec4 x,const in vec4 y,const in float opacity){return mix(x,(x+y-2.0*x*y),opacity);}",mP="vec4 blend(const in vec4 x,const in vec4 y,const in float opacity){vec4 a=min(x,1.0),b=min(y,1.0);vec4 z=mix(2.0*a*b,1.0-2.0*(1.0-a)*(1.0-b),step(0.5,y));return mix(x,z,opacity);}",bP="vec4 blend(const in vec4 x,const in vec4 y,const in float opacity){return mix(x,step(1.0,x+y),opacity);}",vP="vec4 blend(const in vec4 x,const in vec4 y,const in float opacity){vec3 xHSL=RGBToHSL(x.rgb);vec3 yHSL=RGBToHSL(y.rgb);vec3 z=HSLToRGB(vec3(yHSL.r,xHSL.gb));return vec4(mix(x.rgb,z,opacity),y.a);}",yP="vec4 blend(const in vec4 x,const in vec4 y,const in float opacity){return mix(x,1.0-y,opacity);}",GP="vec4 blend(const in vec4 x,const in vec4 y,const in float opacity){return mix(x,y*(1.0-x),opacity);}",BP="vec4 blend(const in vec4 x,const in vec4 y,const in float opacity){return mix(x,max(x,y),opacity);}",ZP="vec4 blend(const in vec4 x,const in vec4 y,const in float opacity){return mix(x,clamp(y+x-1.0,0.0,1.0),opacity);}",wP="vec4 blend(const in vec4 x,const in vec4 y,const in float opacity){return mix(x,min(x+y,1.0),opacity);}",SP="vec4 blend(const in vec4 x,const in vec4 y,const in float opacity){return mix(x,clamp(2.0*y+x-1.0,0.0,1.0),opacity);}",xP="vec4 blend(const in vec4 x,const in vec4 y,const in float opacity){vec3 xHSL=RGBToHSL(x.rgb);vec3 yHSL=RGBToHSL(y.rgb);vec3 z=HSLToRGB(vec3(xHSL.rg,yHSL.b));return vec4(mix(x.rgb,z,opacity),y.a);}",RP="vec4 blend(const in vec4 x,const in vec4 y,const in float opacity){return mix(x,x*y,opacity);}",WP="vec4 blend(const in vec4 x,const in vec4 y,const in float opacity){return mix(x,1.0-abs(1.0-x-y),opacity);}",VP="vec4 blend(const in vec4 x,const in vec4 y,const in float opacity){return mix(x,y,opacity);}",MP="vec4 blend(const in vec4 x,const in vec4 y,const in float opacity){vec4 z=mix(2.0*y*x,1.0-2.0*(1.0-y)*(1.0-x),step(0.5,x));return mix(x,z,opacity);}",NP="vec4 blend(const in vec4 x,const in vec4 y,const in float opacity){vec4 y2=2.0*y;vec4 z=mix(mix(y2,x,step(0.5*x,y)),max(vec4(0.0),y2-1.0),step(x,(y2-1.0)));return mix(x,z,opacity);}",HP="vec4 blend(const in vec4 x,const in vec4 y,const in float opacity){vec4 z=mix(min(x*x/max(1.0-y,1e-12),1.0),y,step(1.0,y));return mix(x,z,opacity);}",XP="vec4 blend(const in vec4 x,const in vec4 y,const in float opacity){vec3 xHSL=RGBToHSL(x.rgb);vec3 yHSL=RGBToHSL(y.rgb);vec3 z=HSLToRGB(vec3(xHSL.r,yHSL.g,xHSL.b));return vec4(mix(x.rgb,z,opacity),y.a);}",FP="vec4 blend(const in vec4 x,const in vec4 y,const in float opacity){return mix(x,x+y-min(x*y,1.0),opacity);}",YP="vec4 blend(const in vec4 x,const in vec4 y,const in float opacity){vec4 y2=2.0*y;vec4 w=step(0.5,y);vec4 z=mix(x-(1.0-y2)*x*(1.0-x),mix(x+(y2-1.0)*(sqrt(x)-x),x+(y2-1.0)*x*((16.0*x-12.0)*x+3.0),w*(1.0-step(0.25,x))),w);return mix(x,z,opacity);}",KP="vec4 blend(const in vec4 x,const in vec4 y,const in float opacity){return y;}",zP="vec4 blend(const in vec4 x,const in vec4 y,const in float opacity){return mix(x,max(x+y-1.0,0.0),opacity);}",LP="vec4 blend(const in vec4 x,const in vec4 y,const in float opacity){vec4 z=mix(max(1.0-min((1.0-x)/(2.0*y),1.0),0.0),min(x/(2.0*(1.0-y)),1.0),step(0.5,y));return mix(x,z,opacity);}",EP=new Map([[ht.ADD,gP],[ht.ALPHA,cP],[ht.AVERAGE,IP],[ht.COLOR,uP],[ht.COLOR_BURN,CP],[ht.COLOR_DODGE,dP],[ht.DARKEN,hP],[ht.DIFFERENCE,AP],[ht.DIVIDE,pP],[ht.DST,null],[ht.EXCLUSION,fP],[ht.HARD_LIGHT,mP],[ht.HARD_MIX,bP],[ht.HUE,vP],[ht.INVERT,yP],[ht.INVERT_RGB,GP],[ht.LIGHTEN,BP],[ht.LINEAR_BURN,ZP],[ht.LINEAR_DODGE,wP],[ht.LINEAR_LIGHT,SP],[ht.LUMINOSITY,xP],[ht.MULTIPLY,RP],[ht.NEGATION,WP],[ht.NORMAL,VP],[ht.OVERLAY,MP],[ht.PIN_LIGHT,NP],[ht.REFLECT,HP],[ht.SATURATION,XP],[ht.SCREEN,FP],[ht.SOFT_LIGHT,YP],[ht.SRC,KP],[ht.SUBTRACT,zP],[ht.VIVID_LIGHT,LP]]),TP=class extends Ps{constructor(n,e=1){super(),this._blendFunction=n,this.opacity=new ne(e)}getOpacity(){return this.opacity.value}setOpacity(n){this.opacity.value=n}get blendFunction(){return this._blendFunction}set blendFunction(n){this._blendFunction=n,this.dispatchEvent({type:"change"})}getBlendFunction(){return this.blendFunction}setBlendFunction(n){this.blendFunction=n}getShaderCode(){return EP.get(this.blendFunction)}},di=class extends Ps{constructor(n,e,{attributes:t=os.NONE,blendFunction:i=ht.NORMAL,defines:s=new Map,uniforms:r=new Map,extensions:o=null,vertexShader:a=null}={}){super(),this.name=n,this.renderer=null,this.attributes=t,this.fragmentShader=e,this.vertexShader=a,this.defines=s,this.uniforms=r,this.extensions=o,this.blendMode=new TP(i),this.blendMode.addEventListener("change",l=>this.setChanged()),this._inputColorSpace=yc,this._outputColorSpace=VM}get inputColorSpace(){return this._inputColorSpace}set inputColorSpace(n){this._inputColorSpace=n,this.setChanged()}get outputColorSpace(){return this._outputColorSpace}set outputColorSpace(n){this._outputColorSpace=n,this.setChanged()}set mainScene(n){}set mainCamera(n){}getName(){return this.name}setRenderer(n){this.renderer=n}getDefines(){return this.defines}getUniforms(){return this.uniforms}getExtensions(){return this.extensions}getBlendMode(){return this.blendMode}getAttributes(){return this.attributes}setAttributes(n){this.attributes=n,this.setChanged()}getFragmentShader(){return this.fragmentShader}setFragmentShader(n){this.fragmentShader=n,this.setChanged()}getVertexShader(){return this.vertexShader}setVertexShader(n){this.vertexShader=n,this.setChanged()}setChanged(){this.dispatchEvent({type:"change"})}setDepthTexture(n,e=Tn){}update(n,e,t){}setSize(n,e){}initialize(n,e,t){}dispose(){for(const n of Object.keys(this)){const e=this[n];(e instanceof Nt||e instanceof ei||e instanceof sn||e instanceof Nn)&&this[n].dispose()}}},kP=`#ifdef FRAMEBUFFER_PRECISION_HIGH +#`));this.skipRendering=e===0,this.needsSwap=!this.skipRendering,this.fullscreenMaterial.setShaderData(n)}recompile(){this.updateMaterial()}getDepthTexture(){return this.fullscreenMaterial.depthBuffer}setDepthTexture(n,e=Tn){this.fullscreenMaterial.depthBuffer=n,this.fullscreenMaterial.depthPacking=e;for(const t of this.effects)t.setDepthTexture(n,e)}render(n,e,t,i,s){for(const r of this.effects)r.update(n,e,i);if(!this.skipRendering||this.renderToScreen){const r=this.fullscreenMaterial;r.inputBuffer=e.texture,r.time+=i*this.timeScale,n.setRenderTarget(this.renderToScreen?null:t),n.render(this.scene,this.camera)}}setSize(n,e){this.fullscreenMaterial.setSize(n,e);for(const t of this.effects)t.setSize(n,e)}initialize(n,e,t){this.renderer=n;for(const i of this.effects)i.initialize(n,e,t);this.updateMaterial(),t!==void 0&&t!==cn&&(this.fullscreenMaterial.defines.FRAMEBUFFER_PRECISION_HIGH="1")}dispose(){super.dispose();for(const n of this.effects)n.removeEventListener("change",this.listener),n.dispose()}handleEvent(n){switch(n.type){case"change":this.recompile();break}}},vp=class extends Nn{constructor({kernelSize:n=Fc.MEDIUM,resolutionScale:e=.5,width:t=qt.AUTO_SIZE,height:i=qt.AUTO_SIZE,resolutionX:s=t,resolutionY:r=i}={}){super("KawaseBlurPass"),this.renderTargetA=new Nt(1,1,{depthBuffer:!1}),this.renderTargetA.texture.name="Blur.Target.A",this.renderTargetB=this.renderTargetA.clone(),this.renderTargetB.texture.name="Blur.Target.B";const o=this.resolution=new qt(this,s,r,e);o.addEventListener("change",a=>this.setSize(o.baseWidth,o.baseHeight)),this._blurMaterial=new lU,this._blurMaterial.kernelSize=n,this.copyMaterial=new HM}getResolution(){return this.resolution}get blurMaterial(){return this._blurMaterial}set blurMaterial(n){this._blurMaterial=n}get dithering(){return this.copyMaterial.dithering}set dithering(n){this.copyMaterial.dithering=n}get kernelSize(){return this.blurMaterial.kernelSize}set kernelSize(n){this.blurMaterial.kernelSize=n}get width(){return this.resolution.width}set width(n){this.resolution.preferredWidth=n}get height(){return this.resolution.height}set height(n){this.resolution.preferredHeight=n}get scale(){return this.blurMaterial.scale}set scale(n){this.blurMaterial.scale=n}getScale(){return this.blurMaterial.scale}setScale(n){this.blurMaterial.scale=n}getKernelSize(){return this.kernelSize}setKernelSize(n){this.kernelSize=n}getResolutionScale(){return this.resolution.scale}setResolutionScale(n){this.resolution.scale=n}render(n,e,t,i,s){const r=this.scene,o=this.camera,a=this.renderTargetA,l=this.renderTargetB,g=this.blurMaterial,u=g.kernelSequence;let C=e;this.fullscreenMaterial=g;for(let d=0,h=u.length;dthis.setSize(l.baseWidth,l.baseHeight))}get texture(){return this.renderTarget.texture}getTexture(){return this.renderTarget.texture}getResolution(){return this.resolution}render(n,e,t,i,s){const r=this.fullscreenMaterial;r.inputBuffer=e.texture,n.setRenderTarget(this.renderToScreen?null:this.renderTarget),n.render(this.scene,this.camera)}setSize(n,e){const t=this.resolution;t.setBaseSize(n,e),this.renderTarget.setSize(t.width,t.height)}initialize(n,e,t){t!==void 0&&t!==cn&&(this.renderTarget.texture.type=t,this.fullscreenMaterial.defines.FRAMEBUFFER_PRECISION_HIGH="1")}},nP=class extends Nn{constructor(n,e){super("MaskPass",n,e),this.needsSwap=!1,this.clearPass=new Yc(!1,!1,!0),this.inverse=!1}set mainScene(n){this.scene=n}set mainCamera(n){this.camera=n}get inverted(){return this.inverse}set inverted(n){this.inverse=n}get clear(){return this.clearPass.enabled}set clear(n){this.clearPass.enabled=n}getClearPass(){return this.clearPass}isInverted(){return this.inverted}setInverted(n){this.inverted=n}render(n,e,t,i,s){const r=n.getContext(),o=n.state.buffers,a=this.scene,l=this.camera,g=this.clearPass,u=this.inverted?0:1,C=1-u;o.color.setMask(!1),o.depth.setMask(!1),o.color.setLocked(!0),o.depth.setLocked(!0),o.stencil.setTest(!0),o.stencil.setOp(r.REPLACE,r.REPLACE,r.REPLACE),o.stencil.setFunc(r.ALWAYS,u,4294967295),o.stencil.setClear(C),o.stencil.setLocked(!0),this.clearPass.enabled&&(this.renderToScreen?g.render(n,null):(g.render(n,e),g.render(n,t))),this.renderToScreen?(n.setRenderTarget(null),n.render(a,l)):(n.setRenderTarget(e),n.render(a,l),n.setRenderTarget(t),n.render(a,l)),o.color.setLocked(!1),o.depth.setLocked(!1),o.stencil.setLocked(!1),o.stencil.setFunc(r.EQUAL,1,4294967295),o.stencil.setOp(r.KEEP,r.KEEP,r.KEEP),o.stencil.setLocked(!0)}},iP=class extends Nn{constructor(){super("MipmapBlurPass"),this.needsSwap=!1,this.renderTarget=new Nt(1,1,{depthBuffer:!1}),this.renderTarget.texture.name="Upsampling.Mipmap0",this.downsamplingMipmaps=[],this.upsamplingMipmaps=[],this.downsamplingMaterial=new yU,this.upsamplingMaterial=new PU,this.resolution=new oe}get texture(){return this.renderTarget.texture}get levels(){return this.downsamplingMipmaps.length}set levels(n){if(this.levels!==n){const e=this.renderTarget;this.dispose(),this.downsamplingMipmaps=[],this.upsamplingMipmaps=[];for(let t=0;t=0;--d){const h=u[d];l.setSize(C.width,C.height),l.inputBuffer=C.texture,l.supportBuffer=g[d].texture,n.setRenderTarget(h),n.render(r,o),C=h}}setSize(n,e){const t=this.resolution;t.set(n,e);let i=t.width,s=t.height;for(let r=0,o=this.downsamplingMipmaps.length;rthis.setSize(u.baseWidth,u.baseHeight))}set mainScene(n){this.renderPass.mainScene=n}set mainCamera(n){this.renderPass.mainCamera=n}get texture(){return this.renderTarget.texture}getTexture(){return this.renderTarget.texture}getResolution(){return this.resolution}getResolutionScale(){return this.resolution.scale}setResolutionScale(n){this.resolution.scale=n}render(n,e,t,i,s){const r=this.renderToScreen?null:this.renderTarget;this.renderPass.render(n,r,r)}setSize(n,e){const t=this.resolution;t.setBaseSize(n,e),this.renderTarget.setSize(t.width,t.height)}},As=class extends Nn{constructor(n,e="inputBuffer"){super("ShaderPass"),this.fullscreenMaterial=n,this.input=e}setInput(n){this.input=n}render(n,e,t,i,s){const r=this.fullscreenMaterial.uniforms;e!==null&&r!==void 0&&r[this.input]!==void 0&&(r[this.input].value=e.texture),n.setRenderTarget(this.renderToScreen?null:t),n.render(this.scene,this.camera)}initialize(n,e,t){t!==void 0&&t!==cn&&(this.fullscreenMaterial.defines.FRAMEBUFFER_PRECISION_HIGH="1")}},_m=1/1e3,rP=1e3,oP=class{constructor(){this.startTime=performance.now(),this.previousTime=0,this.currentTime=0,this._delta=0,this._elapsed=0,this._fixedDelta=1e3/60,this.timescale=1,this.useFixedDelta=!1,this._autoReset=!1}get autoReset(){return this._autoReset}set autoReset(n){typeof document<"u"&&document.hidden!==void 0&&(n?document.addEventListener("visibilitychange",this):document.removeEventListener("visibilitychange",this),this._autoReset=n)}get delta(){return this._delta*_m}get fixedDelta(){return this._fixedDelta*_m}set fixedDelta(n){this._fixedDelta=n*rP}get elapsed(){return this._elapsed*_m}update(n){this.useFixedDelta?this._delta=this.fixedDelta:(this.previousTime=this.currentTime,this.currentTime=(n!==void 0?n:performance.now())-this.startTime,this._delta=this.currentTime-this.previousTime),this._delta*=this.timescale,this._elapsed+=this._delta}reset(){this._delta=0,this._elapsed=0,this.currentTime=performance.now()-this.startTime}handleEvent(n){document.hidden||(this.currentTime=performance.now()-this.startTime)}dispose(){this.autoReset=!1}},aP=class{constructor(e=null,{depthBuffer:t=!0,stencilBuffer:i=!1,multisampling:s=0,frameBufferType:r}={}){this.renderer=null,this.inputBuffer=this.createBuffer(t,i,r,s),this.outputBuffer=this.inputBuffer.clone(),this.copyPass=new FM,this.depthTexture=null,this.passes=[],this.timer=new oP,this.autoRenderToScreen=!0,this.setRenderer(e)}get multisampling(){return this.inputBuffer.samples||0}set multisampling(e){const t=this.inputBuffer,i=this.multisampling;i>0&&e>0?(this.inputBuffer.samples=e,this.outputBuffer.samples=e,this.inputBuffer.dispose(),this.outputBuffer.dispose()):i!==e&&(this.inputBuffer.dispose(),this.outputBuffer.dispose(),this.inputBuffer=this.createBuffer(t.depthBuffer,t.stencilBuffer,t.texture.type,e),this.inputBuffer.depthTexture=this.depthTexture,this.outputBuffer=this.inputBuffer.clone())}getTimer(){return this.timer}getRenderer(){return this.renderer}setRenderer(e){if(this.renderer=e,e!==null){const t=e.getSize(new oe),i=e.getContext().getContextAttributes().alpha,s=this.inputBuffer.texture.type;s===cn&&So(e)===jt&&(Qn(this.inputBuffer.texture,jt),Qn(this.outputBuffer.texture,jt),this.inputBuffer.dispose(),this.outputBuffer.dispose()),e.autoClear=!1,this.setSize(t.width,t.height);for(const r of this.passes)r.initialize(e,i,s)}}replaceRenderer(e,t=!0){const i=this.renderer,s=i.domElement.parentNode;return this.setRenderer(e),t&&s!==null&&(s.removeChild(i.domElement),s.appendChild(e.domElement)),i}createDepthTexture(){const e=this.depthTexture=new lp;return this.inputBuffer.depthTexture=e,this.inputBuffer.dispose(),this.inputBuffer.stencilBuffer?(e.format=va,e.type=da):e.type=Ao,e}deleteDepthTexture(){if(this.depthTexture!==null){this.depthTexture.dispose(),this.depthTexture=null,this.inputBuffer.depthTexture=null,this.inputBuffer.dispose();for(const e of this.passes)e.setDepthTexture(null)}}createBuffer(e,t,i,s){const r=this.renderer,o=r===null?new oe:r.getDrawingBufferSize(new oe),a={minFilter:st,magFilter:st,stencilBuffer:t,depthBuffer:e,type:i},l=new Nt(o.width,o.height,a);return s>0&&(l.ignoreDepthForMultisampleCopy=!1,l.samples=s),i===cn&&So(r)===jt&&Qn(l.texture,jt),l.texture.name="EffectComposer.Buffer",l.texture.generateMipmaps=!1,l}setMainScene(e){for(const t of this.passes)t.mainScene=e}setMainCamera(e){for(const t of this.passes)t.mainCamera=e}addPass(e,t){const i=this.passes,s=this.renderer,r=s.getDrawingBufferSize(new oe),o=s.getContext().getContextAttributes().alpha,a=this.inputBuffer.texture.type;if(e.setRenderer(s),e.setSize(r.width,r.height),e.initialize(s,o,a),this.autoRenderToScreen&&(i.length>0&&(i[i.length-1].renderToScreen=!1),e.renderToScreen&&(this.autoRenderToScreen=!1)),t!==void 0?i.splice(t,0,e):i.push(e),this.autoRenderToScreen&&(i[i.length-1].renderToScreen=!0),e.needsDepthTexture||this.depthTexture!==null)if(this.depthTexture===null){const l=this.createDepthTexture();for(e of i)e.setDepthTexture(l)}else e.setDepthTexture(this.depthTexture)}removePass(e){const t=this.passes,i=t.indexOf(e);if(i!==-1&&t.splice(i,1).length>0){if(this.depthTexture!==null){const o=(l,g)=>l||g.needsDepthTexture;t.reduce(o,!1)||(e.getDepthTexture()===this.depthTexture&&e.setDepthTexture(null),this.deleteDepthTexture())}this.autoRenderToScreen&&i===t.length&&(e.renderToScreen=!1,t.length>0&&(t[t.length-1].renderToScreen=!0))}}removeAllPasses(){const e=this.passes;this.deleteDepthTexture(),e.length>0&&(this.autoRenderToScreen&&(e[e.length-1].renderToScreen=!1),this.passes=[])}render(e){const t=this.renderer,i=this.copyPass;let s=this.inputBuffer,r=this.outputBuffer,o=!1,a,l,g;e===void 0&&(this.timer.update(),e=this.timer.delta);for(const u of this.passes)u.enabled&&(u.render(t,s,r,e,o),u.needsSwap&&(o&&(i.renderToScreen=u.renderToScreen,a=t.getContext(),l=t.state.buffers.stencil,l.setFunc(a.NOTEQUAL,1,4294967295),i.render(t,s,r,e,o),l.setFunc(a.EQUAL,1,4294967295)),g=s,s=r,r=g),u instanceof nP?o=!0:u instanceof OU&&(o=!1))}setSize(e,t,i){const s=this.renderer,r=s.getSize(new oe);(e===void 0||t===void 0)&&(e=r.width,t=r.height),(r.width!==e||r.height!==t)&&s.setSize(e,t,i);const o=s.getDrawingBufferSize(new oe);this.inputBuffer.setSize(o.width,o.height),this.outputBuffer.setSize(o.width,o.height);for(const a of this.passes)a.setSize(o.width,o.height)}reset(){const e=this.timer.autoReset;this.dispose(),this.autoRenderToScreen=!0,this.timer.autoReset=e}dispose(){for(const e of this.passes)e.dispose();this.passes=[],this.inputBuffer!==null&&this.inputBuffer.dispose(),this.outputBuffer!==null&&this.outputBuffer.dispose(),this.deleteDepthTexture(),this.copyPass.dispose(),this.timer.dispose()}},lP=class{constructor(){this.shaderParts=new Map([[Pt.FRAGMENT_HEAD,null],[Pt.FRAGMENT_MAIN_UV,null],[Pt.FRAGMENT_MAIN_IMAGE,null],[Pt.VERTEX_HEAD,null],[Pt.VERTEX_MAIN_SUPPORT,null]]),this.defines=new Map,this.uniforms=new Map,this.blendModes=new Map,this.extensions=new Set,this.attributes=os.NONE,this.varyings=new Set,this.uvTransformation=!1,this.readDepth=!1,this.colorSpace=yc}},Dy=class extends Set{constructor(n,e=10){super(),this.l=e,this.exclusive=!1,n!==void 0&&this.set(n)}get layer(){return this.l}set layer(n){const e=this.l;for(const t of this)t.layers.disable(e),t.layers.enable(n);this.l=n}getLayer(){return this.layer}setLayer(n){this.layer=n}isExclusive(){return this.exclusive}setExclusive(n){this.exclusive=n}clear(){const n=this.layer;for(const e of this)e.layers.disable(n);return super.clear()}set(n){this.clear();for(const e of n)this.add(e);return this}indexOf(n){return this.has(n)?0:-1}add(n){return this.exclusive?n.layers.set(this.layer):n.layers.enable(this.layer),super.add(n)}delete(n){return this.has(n)&&n.layers.disable(this.layer),super.delete(n)}toggle(n){let e;return this.has(n)?(this.delete(n),e=!1):(this.add(n),e=!0),e}setVisible(n){for(const e of this)n?e.layers.enable(0):e.layers.disable(0);return this}},gP="vec4 blend(const in vec4 x,const in vec4 y,const in float opacity){return mix(x,x+y,opacity);}",cP="vec4 blend(const in vec4 x,const in vec4 y,const in float opacity){return mix(x,y,min(y.a,opacity));}",IP="vec4 blend(const in vec4 x,const in vec4 y,const in float opacity){return mix(x,(x+y)*0.5,opacity);}",uP="vec4 blend(const in vec4 x,const in vec4 y,const in float opacity){vec3 xHSL=RGBToHSL(x.rgb);vec3 yHSL=RGBToHSL(y.rgb);vec3 z=HSLToRGB(vec3(yHSL.rg,xHSL.b));return vec4(mix(x.rgb,z,opacity),y.a);}",CP="vec4 blend(const in vec4 x,const in vec4 y,const in float opacity){vec4 z=mix(step(0.0,y)*(1.0-min(vec4(1.0),(1.0-x)/y)),vec4(1.0),step(1.0,x));return mix(x,z,opacity);}",dP="vec4 blend(const in vec4 x,const in vec4 y,const in float opacity){vec4 z=step(0.0,x)*mix(min(vec4(1.0),x/max(1.0-y,1e-9)),vec4(1.0),step(1.0,y));return mix(x,z,opacity);}",hP="vec4 blend(const in vec4 x,const in vec4 y,const in float opacity){return mix(x,min(x,y),opacity);}",AP="vec4 blend(const in vec4 x,const in vec4 y,const in float opacity){return mix(x,abs(x-y),opacity);}",pP="vec4 blend(const in vec4 x,const in vec4 y,const in float opacity){return mix(x,x/max(y,1e-12),opacity);}",fP="vec4 blend(const in vec4 x,const in vec4 y,const in float opacity){return mix(x,(x+y-2.0*x*y),opacity);}",mP="vec4 blend(const in vec4 x,const in vec4 y,const in float opacity){vec4 a=min(x,1.0),b=min(y,1.0);vec4 z=mix(2.0*a*b,1.0-2.0*(1.0-a)*(1.0-b),step(0.5,y));return mix(x,z,opacity);}",bP="vec4 blend(const in vec4 x,const in vec4 y,const in float opacity){return mix(x,step(1.0,x+y),opacity);}",vP="vec4 blend(const in vec4 x,const in vec4 y,const in float opacity){vec3 xHSL=RGBToHSL(x.rgb);vec3 yHSL=RGBToHSL(y.rgb);vec3 z=HSLToRGB(vec3(yHSL.r,xHSL.gb));return vec4(mix(x.rgb,z,opacity),y.a);}",yP="vec4 blend(const in vec4 x,const in vec4 y,const in float opacity){return mix(x,1.0-y,opacity);}",GP="vec4 blend(const in vec4 x,const in vec4 y,const in float opacity){return mix(x,y*(1.0-x),opacity);}",BP="vec4 blend(const in vec4 x,const in vec4 y,const in float opacity){return mix(x,max(x,y),opacity);}",ZP="vec4 blend(const in vec4 x,const in vec4 y,const in float opacity){return mix(x,clamp(y+x-1.0,0.0,1.0),opacity);}",wP="vec4 blend(const in vec4 x,const in vec4 y,const in float opacity){return mix(x,min(x+y,1.0),opacity);}",SP="vec4 blend(const in vec4 x,const in vec4 y,const in float opacity){return mix(x,clamp(2.0*y+x-1.0,0.0,1.0),opacity);}",xP="vec4 blend(const in vec4 x,const in vec4 y,const in float opacity){vec3 xHSL=RGBToHSL(x.rgb);vec3 yHSL=RGBToHSL(y.rgb);vec3 z=HSLToRGB(vec3(xHSL.rg,yHSL.b));return vec4(mix(x.rgb,z,opacity),y.a);}",RP="vec4 blend(const in vec4 x,const in vec4 y,const in float opacity){return mix(x,x*y,opacity);}",WP="vec4 blend(const in vec4 x,const in vec4 y,const in float opacity){return mix(x,1.0-abs(1.0-x-y),opacity);}",VP="vec4 blend(const in vec4 x,const in vec4 y,const in float opacity){return mix(x,y,opacity);}",MP="vec4 blend(const in vec4 x,const in vec4 y,const in float opacity){vec4 z=mix(2.0*y*x,1.0-2.0*(1.0-y)*(1.0-x),step(0.5,x));return mix(x,z,opacity);}",NP="vec4 blend(const in vec4 x,const in vec4 y,const in float opacity){vec4 y2=2.0*y;vec4 z=mix(mix(y2,x,step(0.5*x,y)),max(vec4(0.0),y2-1.0),step(x,(y2-1.0)));return mix(x,z,opacity);}",HP="vec4 blend(const in vec4 x,const in vec4 y,const in float opacity){vec4 z=mix(min(x*x/max(1.0-y,1e-12),1.0),y,step(1.0,y));return mix(x,z,opacity);}",XP="vec4 blend(const in vec4 x,const in vec4 y,const in float opacity){vec3 xHSL=RGBToHSL(x.rgb);vec3 yHSL=RGBToHSL(y.rgb);vec3 z=HSLToRGB(vec3(xHSL.r,yHSL.g,xHSL.b));return vec4(mix(x.rgb,z,opacity),y.a);}",FP="vec4 blend(const in vec4 x,const in vec4 y,const in float opacity){return mix(x,x+y-min(x*y,1.0),opacity);}",YP="vec4 blend(const in vec4 x,const in vec4 y,const in float opacity){vec4 y2=2.0*y;vec4 w=step(0.5,y);vec4 z=mix(x-(1.0-y2)*x*(1.0-x),mix(x+(y2-1.0)*(sqrt(x)-x),x+(y2-1.0)*x*((16.0*x-12.0)*x+3.0),w*(1.0-step(0.25,x))),w);return mix(x,z,opacity);}",KP="vec4 blend(const in vec4 x,const in vec4 y,const in float opacity){return y;}",zP="vec4 blend(const in vec4 x,const in vec4 y,const in float opacity){return mix(x,max(x+y-1.0,0.0),opacity);}",LP="vec4 blend(const in vec4 x,const in vec4 y,const in float opacity){vec4 z=mix(max(1.0-min((1.0-x)/(2.0*y),1.0),0.0),min(x/(2.0*(1.0-y)),1.0),step(0.5,y));return mix(x,z,opacity);}",EP=new Map([[ht.ADD,gP],[ht.ALPHA,cP],[ht.AVERAGE,IP],[ht.COLOR,uP],[ht.COLOR_BURN,CP],[ht.COLOR_DODGE,dP],[ht.DARKEN,hP],[ht.DIFFERENCE,AP],[ht.DIVIDE,pP],[ht.DST,null],[ht.EXCLUSION,fP],[ht.HARD_LIGHT,mP],[ht.HARD_MIX,bP],[ht.HUE,vP],[ht.INVERT,yP],[ht.INVERT_RGB,GP],[ht.LIGHTEN,BP],[ht.LINEAR_BURN,ZP],[ht.LINEAR_DODGE,wP],[ht.LINEAR_LIGHT,SP],[ht.LUMINOSITY,xP],[ht.MULTIPLY,RP],[ht.NEGATION,WP],[ht.NORMAL,VP],[ht.OVERLAY,MP],[ht.PIN_LIGHT,NP],[ht.REFLECT,HP],[ht.SATURATION,XP],[ht.SCREEN,FP],[ht.SOFT_LIGHT,YP],[ht.SRC,KP],[ht.SUBTRACT,zP],[ht.VIVID_LIGHT,LP]]),TP=class extends Ps{constructor(n,e=1){super(),this._blendFunction=n,this.opacity=new ne(e)}getOpacity(){return this.opacity.value}setOpacity(n){this.opacity.value=n}get blendFunction(){return this._blendFunction}set blendFunction(n){this._blendFunction=n,this.dispatchEvent({type:"change"})}getBlendFunction(){return this.blendFunction}setBlendFunction(n){this.blendFunction=n}getShaderCode(){return EP.get(this.blendFunction)}},di=class extends Ps{constructor(n,e,{attributes:t=os.NONE,blendFunction:i=ht.NORMAL,defines:s=new Map,uniforms:r=new Map,extensions:o=null,vertexShader:a=null}={}){super(),this.name=n,this.renderer=null,this.attributes=t,this.fragmentShader=e,this.vertexShader=a,this.defines=s,this.uniforms=r,this.extensions=o,this.blendMode=new TP(i),this.blendMode.addEventListener("change",l=>this.setChanged()),this._inputColorSpace=yc,this._outputColorSpace=VM}get inputColorSpace(){return this._inputColorSpace}set inputColorSpace(n){this._inputColorSpace=n,this.setChanged()}get outputColorSpace(){return this._outputColorSpace}set outputColorSpace(n){this._outputColorSpace=n,this.setChanged()}set mainScene(n){}set mainCamera(n){}getName(){return this.name}setRenderer(n){this.renderer=n}getDefines(){return this.defines}getUniforms(){return this.uniforms}getExtensions(){return this.extensions}getBlendMode(){return this.blendMode}getAttributes(){return this.attributes}setAttributes(n){this.attributes=n,this.setChanged()}getFragmentShader(){return this.fragmentShader}setFragmentShader(n){this.fragmentShader=n,this.setChanged()}getVertexShader(){return this.vertexShader}setVertexShader(n){this.vertexShader=n,this.setChanged()}setChanged(){this.dispatchEvent({type:"change"})}setDepthTexture(n,e=Tn){}update(n,e,t){}setSize(n,e){}initialize(n,e,t){}dispose(){for(const n of Object.keys(this)){const e=this[n];(e instanceof Nt||e instanceof ei||e instanceof sn||e instanceof Nn)&&this[n].dispose()}}},kP=`#ifdef FRAMEBUFFER_PRECISION_HIGH uniform mediump sampler2D map; #else uniform lowp sampler2D map; #endif -uniform float intensity;void mainImage(const in vec4 inputColor,const in vec2 uv,out vec4 outputColor){outputColor=texture2D(map,uv)*intensity;}`,DP=class extends di{constructor({blendFunction:n=ht.SCREEN,luminanceThreshold:e=.9,luminanceSmoothing:t=.025,mipmapBlur:i=!1,intensity:s=1,radius:r=.85,levels:o=8,kernelSize:a=Xc.LARGE,resolutionScale:l=.5,width:g=qt.AUTO_SIZE,height:u=qt.AUTO_SIZE,resolutionX:C=g,resolutionY:d=u}={}){super("BloomEffect",kP,{blendFunction:n,uniforms:new Map([["map",new ne(null)],["intensity",new ne(s)]])}),this.renderTarget=new Nt(1,1,{depthBuffer:!1}),this.renderTarget.texture.name="Bloom.Target",this.blurPass=new vp({kernelSize:a}),this.luminancePass=new tP({colorOutput:!0}),this.luminanceMaterial.threshold=e,this.luminanceMaterial.smoothing=t,this.mipmapBlurPass=new iP,this.mipmapBlurPass.enabled=i,this.mipmapBlurPass.radius=r,this.mipmapBlurPass.levels=o,this.uniforms.get("map").value=i?this.mipmapBlurPass.texture:this.renderTarget.texture;const h=this.resolution=new qt(this,C,d,l);h.addEventListener("change",f=>this.setSize(h.baseWidth,h.baseHeight))}get texture(){return this.mipmapBlurPass.enabled?this.mipmapBlurPass.texture:this.renderTarget.texture}getTexture(){return this.texture}getResolution(){return this.resolution}getBlurPass(){return this.blurPass}getLuminancePass(){return this.luminancePass}get luminanceMaterial(){return this.luminancePass.fullscreenMaterial}getLuminanceMaterial(){return this.luminancePass.fullscreenMaterial}get width(){return this.resolution.width}set width(n){this.resolution.preferredWidth=n}get height(){return this.resolution.height}set height(n){this.resolution.preferredHeight=n}get dithering(){return this.blurPass.dithering}set dithering(n){this.blurPass.dithering=n}get kernelSize(){return this.blurPass.kernelSize}set kernelSize(n){this.blurPass.kernelSize=n}get distinction(){return console.warn(this.name,"distinction was removed"),1}set distinction(n){console.warn(this.name,"distinction was removed")}get intensity(){return this.uniforms.get("intensity").value}set intensity(n){this.uniforms.get("intensity").value=n}getIntensity(){return this.intensity}setIntensity(n){this.intensity=n}getResolutionScale(){return this.resolution.scale}setResolutionScale(n){this.resolution.scale=n}update(n,e,t){const i=this.renderTarget,s=this.luminancePass;s.enabled?(s.render(n,e),this.mipmapBlurPass.enabled?this.mipmapBlurPass.render(n,s.renderTarget):this.blurPass.render(n,s.renderTarget,i)):this.mipmapBlurPass.enabled?this.mipmapBlurPass.render(n,e):this.blurPass.render(n,e,i)}setSize(n,e){const t=this.resolution;t.setBaseSize(n,e),this.renderTarget.setSize(t.width,t.height),this.blurPass.resolution.copy(t),this.luminancePass.setSize(n,e),this.mipmapBlurPass.setSize(n,e)}initialize(n,e,t){this.blurPass.initialize(n,e,t),this.luminancePass.initialize(n,e,t),this.mipmapBlurPass.initialize(n,e,t),t!==void 0&&(this.renderTarget.texture.type=t,So(n)===jt&&Qn(this.renderTarget.texture,jt))}},UP="void mainImage(const in vec4 inputColor,const in vec2 uv,out vec4 outputColor){outputColor=vec4(vec3(average(inputColor.rgb)),inputColor.a);}",PP=class extends di{constructor(n){super("ColorAverageEffect",UP,{blendFunction:n})}},_P=`#ifdef RADIAL_MODULATION +uniform float intensity;void mainImage(const in vec4 inputColor,const in vec2 uv,out vec4 outputColor){outputColor=texture2D(map,uv)*intensity;}`,DP=class extends di{constructor({blendFunction:n=ht.SCREEN,luminanceThreshold:e=.9,luminanceSmoothing:t=.025,mipmapBlur:i=!1,intensity:s=1,radius:r=.85,levels:o=8,kernelSize:a=Fc.LARGE,resolutionScale:l=.5,width:g=qt.AUTO_SIZE,height:u=qt.AUTO_SIZE,resolutionX:C=g,resolutionY:d=u}={}){super("BloomEffect",kP,{blendFunction:n,uniforms:new Map([["map",new ne(null)],["intensity",new ne(s)]])}),this.renderTarget=new Nt(1,1,{depthBuffer:!1}),this.renderTarget.texture.name="Bloom.Target",this.blurPass=new vp({kernelSize:a}),this.luminancePass=new tP({colorOutput:!0}),this.luminanceMaterial.threshold=e,this.luminanceMaterial.smoothing=t,this.mipmapBlurPass=new iP,this.mipmapBlurPass.enabled=i,this.mipmapBlurPass.radius=r,this.mipmapBlurPass.levels=o,this.uniforms.get("map").value=i?this.mipmapBlurPass.texture:this.renderTarget.texture;const h=this.resolution=new qt(this,C,d,l);h.addEventListener("change",f=>this.setSize(h.baseWidth,h.baseHeight))}get texture(){return this.mipmapBlurPass.enabled?this.mipmapBlurPass.texture:this.renderTarget.texture}getTexture(){return this.texture}getResolution(){return this.resolution}getBlurPass(){return this.blurPass}getLuminancePass(){return this.luminancePass}get luminanceMaterial(){return this.luminancePass.fullscreenMaterial}getLuminanceMaterial(){return this.luminancePass.fullscreenMaterial}get width(){return this.resolution.width}set width(n){this.resolution.preferredWidth=n}get height(){return this.resolution.height}set height(n){this.resolution.preferredHeight=n}get dithering(){return this.blurPass.dithering}set dithering(n){this.blurPass.dithering=n}get kernelSize(){return this.blurPass.kernelSize}set kernelSize(n){this.blurPass.kernelSize=n}get distinction(){return console.warn(this.name,"distinction was removed"),1}set distinction(n){console.warn(this.name,"distinction was removed")}get intensity(){return this.uniforms.get("intensity").value}set intensity(n){this.uniforms.get("intensity").value=n}getIntensity(){return this.intensity}setIntensity(n){this.intensity=n}getResolutionScale(){return this.resolution.scale}setResolutionScale(n){this.resolution.scale=n}update(n,e,t){const i=this.renderTarget,s=this.luminancePass;s.enabled?(s.render(n,e),this.mipmapBlurPass.enabled?this.mipmapBlurPass.render(n,s.renderTarget):this.blurPass.render(n,s.renderTarget,i)):this.mipmapBlurPass.enabled?this.mipmapBlurPass.render(n,e):this.blurPass.render(n,e,i)}setSize(n,e){const t=this.resolution;t.setBaseSize(n,e),this.renderTarget.setSize(t.width,t.height),this.blurPass.resolution.copy(t),this.luminancePass.setSize(n,e),this.mipmapBlurPass.setSize(n,e)}initialize(n,e,t){this.blurPass.initialize(n,e,t),this.luminancePass.initialize(n,e,t),this.mipmapBlurPass.initialize(n,e,t),t!==void 0&&(this.renderTarget.texture.type=t,So(n)===jt&&Qn(this.renderTarget.texture,jt))}},UP="void mainImage(const in vec4 inputColor,const in vec2 uv,out vec4 outputColor){outputColor=vec4(vec3(average(inputColor.rgb)),inputColor.a);}",PP=class extends di{constructor(n){super("ColorAverageEffect",UP,{blendFunction:n})}},_P=`#ifdef RADIAL_MODULATION uniform float modulationOffset; #endif varying float vActive;varying vec2 vUvR;varying vec2 vUvB;void mainImage(const in vec4 inputColor,const in vec2 uv,out vec4 outputColor){vec2 ra=inputColor.ra;vec2 ba=inputColor.ba; @@ -4018,12 +4018,12 @@ uniform mediump sampler2D nearColorBuffer;uniform mediump sampler2D farColorBuff #else uniform lowp sampler2D nearColorBuffer;uniform lowp sampler2D farColorBuffer; #endif -uniform lowp sampler2D nearCoCBuffer;uniform float scale;void mainImage(const in vec4 inputColor,const in vec2 uv,const in float depth,out vec4 outputColor){vec4 colorNear=texture2D(nearColorBuffer,uv);vec4 colorFar=texture2D(farColorBuffer,uv);float cocNear=texture2D(nearCoCBuffer,uv).r;cocNear=min(cocNear*scale,1.0);vec4 result=inputColor*(1.0-colorFar.a)+colorFar;result=mix(result,colorNear,cocNear);outputColor=result;}`,jP=class extends di{constructor(n,{blendFunction:e,worldFocusDistance:t,worldFocusRange:i,focusDistance:s=0,focalLength:r=.1,focusRange:o=r,bokehScale:a=1,resolutionScale:l=1,width:g=qt.AUTO_SIZE,height:u=qt.AUTO_SIZE,resolutionX:C=g,resolutionY:d=u}={}){super("DepthOfFieldEffect",QP,{blendFunction:e,attributes:os.DEPTH,uniforms:new Map([["nearColorBuffer",new ne(null)],["farColorBuffer",new ne(null)],["nearCoCBuffer",new ne(null)],["scale",new ne(1)]])}),this.camera=n,this.renderTarget=new Nt(1,1,{depthBuffer:!1}),this.renderTarget.texture.name="DoF.Intermediate",this.renderTargetMasked=this.renderTarget.clone(),this.renderTargetMasked.texture.name="DoF.Masked.Far",this.renderTargetNear=this.renderTarget.clone(),this.renderTargetNear.texture.name="DoF.Bokeh.Near",this.uniforms.get("nearColorBuffer").value=this.renderTargetNear.texture,this.renderTargetFar=this.renderTarget.clone(),this.renderTargetFar.texture.name="DoF.Bokeh.Far",this.uniforms.get("farColorBuffer").value=this.renderTargetFar.texture,this.renderTargetCoC=this.renderTarget.clone(),this.renderTargetCoC.texture.name="DoF.CoC",this.renderTargetCoCBlurred=this.renderTargetCoC.clone(),this.renderTargetCoCBlurred.texture.name="DoF.CoC.Blurred",this.uniforms.get("nearCoCBuffer").value=this.renderTargetCoCBlurred.texture,this.cocPass=new As(new nU(n));const h=this.cocMaterial;h.focusDistance=s,h.focusRange=o,t!==void 0&&(h.worldFocusDistance=t),i!==void 0&&(h.worldFocusRange=i),this.blurPass=new vp({resolutionScale:l,resolutionX:C,resolutionY:d,kernelSize:Xc.MEDIUM}),this.maskPass=new As(new HU(this.renderTargetCoC.texture));const f=this.maskPass.fullscreenMaterial;f.maskFunction=lu.MULTIPLY,f.colorChannel=Qg.GREEN,this.bokehNearBasePass=new As(new wh(!1,!0)),this.bokehNearBasePass.fullscreenMaterial.cocBuffer=this.renderTargetCoCBlurred.texture,this.bokehNearFillPass=new As(new wh(!0,!0)),this.bokehNearFillPass.fullscreenMaterial.cocBuffer=this.renderTargetCoCBlurred.texture,this.bokehFarBasePass=new As(new wh(!1,!1)),this.bokehFarBasePass.fullscreenMaterial.cocBuffer=this.renderTargetCoC.texture,this.bokehFarFillPass=new As(new wh(!0,!1)),this.bokehFarFillPass.fullscreenMaterial.cocBuffer=this.renderTargetCoC.texture,this.target=null;const v=this.resolution=new qt(this,C,d,l);v.addEventListener("change",y=>this.setSize(v.baseWidth,v.baseHeight)),this.bokehScale=a}set mainCamera(n){this.camera=n,this.cocMaterial.copyCameraSettings(n)}get cocTexture(){return this.renderTargetCoC.texture}get cocMaterial(){return this.cocPass.fullscreenMaterial}get circleOfConfusionMaterial(){return this.cocMaterial}getCircleOfConfusionMaterial(){return this.circleOfConfusionMaterial}getBlurPass(){return this.blurPass}getResolution(){return this.resolution}get bokehScale(){return this.uniforms.get("scale").value}set bokehScale(n){this.bokehNearBasePass.fullscreenMaterial.scale=n,this.bokehNearFillPass.fullscreenMaterial.scale=n,this.bokehFarBasePass.fullscreenMaterial.scale=n,this.bokehFarFillPass.fullscreenMaterial.scale=n,this.maskPass.fullscreenMaterial.strength=n,this.uniforms.get("scale").value=n}getBokehScale(){return this.bokehScale}setBokehScale(n){this.bokehScale=n}getTarget(){return this.target}setTarget(n){this.target=n}calculateFocusDistance(n){const e=this.camera,t=e.position.distanceTo(n);return Cl(-t,e.near,e.far)}setDepthTexture(n,e=Tn){this.circleOfConfusionMaterial.depthBuffer=n,this.circleOfConfusionMaterial.depthPacking=e}update(n,e,t){const i=this.renderTarget,s=this.renderTargetCoC,r=this.renderTargetCoCBlurred,o=this.renderTargetMasked;if(this.target!==null){const a=this.calculateFocusDistance(this.target);this.cocMaterial.focusDistance=a}this.cocPass.render(n,null,s),this.blurPass.render(n,s,r),this.maskPass.render(n,e,o),this.bokehFarBasePass.render(n,o,i),this.bokehFarFillPass.render(n,i,this.renderTargetFar),this.bokehNearBasePass.render(n,e,i),this.bokehNearFillPass.render(n,i,this.renderTargetNear)}setSize(n,e){const t=this.resolution;t.setBaseSize(n,e);const i=t.width,s=t.height;this.cocPass.setSize(n,e),this.blurPass.setSize(n,e),this.maskPass.setSize(n,e),this.renderTargetCoC.setSize(n,e),this.renderTargetMasked.setSize(n,e),this.renderTarget.setSize(i,s),this.renderTargetNear.setSize(i,s),this.renderTargetFar.setSize(i,s),this.renderTargetCoCBlurred.setSize(i,s),this.bokehNearBasePass.fullscreenMaterial.setSize(n,e),this.bokehNearFillPass.fullscreenMaterial.setSize(n,e),this.bokehFarBasePass.fullscreenMaterial.setSize(n,e),this.bokehFarFillPass.fullscreenMaterial.setSize(n,e)}initialize(n,e,t){this.cocPass.initialize(n,e,t),this.maskPass.initialize(n,e,t),this.bokehNearBasePass.initialize(n,e,t),this.bokehNearFillPass.initialize(n,e,t),this.bokehFarBasePass.initialize(n,e,t),this.bokehFarFillPass.initialize(n,e,t),this.blurPass.initialize(n,e,cn);const i=this.maskPass.fullscreenMaterial;i.maskFunction=e?lu.MULTIPLY:lu.MULTIPLY_RGB_SET_ALPHA,t!==void 0&&(this.renderTarget.texture.type=t,this.renderTargetNear.texture.type=t,this.renderTargetFar.texture.type=t,this.renderTargetMasked.texture.type=t,So(n)===jt&&(Qn(this.renderTarget.texture,jt),Qn(this.renderTargetNear.texture,jt),Qn(this.renderTargetFar.texture,jt),Qn(this.renderTargetMasked.texture,jt)))}};function qP(n,e,t){const i=new Map([[tp,1],[ty,1],[ny,2],[An,4]]);let s;if(i.has(e)||console.error("Invalid noise texture format"),t===cn){s=new Uint8Array(n*i.get(e));for(let r=0,o=s.length;rdistortion.x-columns*random){float sx=clamp(ceil(seeds.x),0.0,1.0);uv.y=sx*(1.0-(uv.y+distortion.y))+(1.0-sx)*distortion.y;}if(uv.xdistortion.y-columns*random){float sy=clamp(ceil(seeds.y),0.0,1.0);uv.x=sy*distortion.x+(1.0-sy)*(1.0-(uv.x+distortion.x));}vec2 normal=texture2D(perturbationMap,uv*random*random).rg;uv+=normal*seeds*(random*0.2);}}",xh="Glitch.Generated";function Oi(n,e){return n+Math.random()*(e-n)}var e_=class extends di{constructor({chromaticAberrationOffset:n=null,delay:e=new oe(1.5,3.5),duration:t=new oe(.6,1),strength:i=new oe(.3,1),columns:s=.05,ratio:r=.85,perturbationMap:o=null,dtSize:a=64}={}){if(super("GlitchEffect",$P,{uniforms:new Map([["perturbationMap",new ne(null)],["columns",new ne(s)],["active",new ne(!1)],["random",new ne(1)],["seeds",new ne(new oe)],["distortion",new ne(new oe)]])}),o===null){const l=new Lb(a,a,An);l.name=xh,this.perturbationMap=l}else this.perturbationMap=o;this.time=0,this.distortion=this.uniforms.get("distortion").value,this.delay=e,this.duration=t,this.breakPoint=new oe(Oi(this.delay.x,this.delay.y),Oi(this.duration.x,this.duration.y)),this.strength=i,this.mode=sl.SPORADIC,this.ratio=r,this.chromaticAberrationOffset=n}get seeds(){return this.uniforms.get("seeds").value}get active(){return this.uniforms.get("active").value}isActive(){return this.active}get minDelay(){return this.delay.x}set minDelay(n){this.delay.x=n}getMinDelay(){return this.delay.x}setMinDelay(n){this.delay.x=n}get maxDelay(){return this.delay.y}set maxDelay(n){this.delay.y=n}getMaxDelay(){return this.delay.y}setMaxDelay(n){this.delay.y=n}get minDuration(){return this.duration.x}set minDuration(n){this.duration.x=n}getMinDuration(){return this.duration.x}setMinDuration(n){this.duration.x=n}get maxDuration(){return this.duration.y}set maxDuration(n){this.duration.y=n}getMaxDuration(){return this.duration.y}setMaxDuration(n){this.duration.y=n}get minStrength(){return this.strength.x}set minStrength(n){this.strength.x=n}getMinStrength(){return this.strength.x}setMinStrength(n){this.strength.x=n}get maxStrength(){return this.strength.y}set maxStrength(n){this.strength.y=n}getMaxStrength(){return this.strength.y}setMaxStrength(n){this.strength.y=n}getMode(){return this.mode}setMode(n){this.mode=n}getGlitchRatio(){return 1-this.ratio}setGlitchRatio(n){this.ratio=Math.min(Math.max(1-n,0),1)}get columns(){return this.uniforms.get("columns").value}set columns(n){this.uniforms.get("columns").value=n}getGlitchColumns(){return this.columns}setGlitchColumns(n){this.columns=n}getChromaticAberrationOffset(){return this.chromaticAberrationOffset}setChromaticAberrationOffset(n){this.chromaticAberrationOffset=n}get perturbationMap(){return this.uniforms.get("perturbationMap").value}set perturbationMap(n){const e=this.perturbationMap;e!==null&&e.name===xh&&e.dispose(),n.minFilter=n.magFilter=vt,n.wrapS=n.wrapT=Gs,n.generateMipmaps=!1,this.uniforms.get("perturbationMap").value=n}getPerturbationMap(){return this.perturbationMap}setPerturbationMap(n){this.perturbationMap=n}generatePerturbationMap(n=64){const e=new Lb(n,n,An);return e.name=xh,e}update(n,e,t){const i=this.mode,s=this.breakPoint,r=this.chromaticAberrationOffset,o=this.strength;let a=this.time,l=!1,g=0,u=0,C;i!==sl.DISABLED&&(i===sl.SPORADIC&&(a+=t,C=a>s.x,a>=s.x+s.y&&(s.set(Oi(this.delay.x,this.delay.y),Oi(this.duration.x,this.duration.y)),a=0)),g=Math.random(),this.uniforms.get("random").value=g,C&&g>this.ratio||i===sl.CONSTANT_WILD?(l=!0,g*=o.y*.03,u=Oi(-Math.PI,Math.PI),this.seeds.set(Oi(-o.y,o.y),Oi(-o.y,o.y)),this.distortion.set(Oi(0,1),Oi(0,1))):(C||i===sl.CONSTANT_MILD)&&(l=!0,g*=o.x*.03,u=Oi(-Math.PI,Math.PI),this.seeds.set(Oi(-o.x,o.x),Oi(-o.x,o.x)),this.distortion.set(Oi(0,1),Oi(0,1))),this.time=a),r!==null&&(l?r.set(Math.cos(u),Math.sin(u)).multiplyScalar(g):r.set(0,0)),this.uniforms.get("active").value=l}dispose(){const n=this.perturbationMap;n!==null&&n.name===xh&&n.dispose()}},t_=`#ifdef FRAMEBUFFER_PRECISION_HIGH +uniform lowp sampler2D nearCoCBuffer;uniform float scale;void mainImage(const in vec4 inputColor,const in vec2 uv,const in float depth,out vec4 outputColor){vec4 colorNear=texture2D(nearColorBuffer,uv);vec4 colorFar=texture2D(farColorBuffer,uv);float cocNear=texture2D(nearCoCBuffer,uv).r;cocNear=min(cocNear*scale,1.0);vec4 result=inputColor*(1.0-colorFar.a)+colorFar;result=mix(result,colorNear,cocNear);outputColor=result;}`,jP=class extends di{constructor(n,{blendFunction:e,worldFocusDistance:t,worldFocusRange:i,focusDistance:s=0,focalLength:r=.1,focusRange:o=r,bokehScale:a=1,resolutionScale:l=1,width:g=qt.AUTO_SIZE,height:u=qt.AUTO_SIZE,resolutionX:C=g,resolutionY:d=u}={}){super("DepthOfFieldEffect",QP,{blendFunction:e,attributes:os.DEPTH,uniforms:new Map([["nearColorBuffer",new ne(null)],["farColorBuffer",new ne(null)],["nearCoCBuffer",new ne(null)],["scale",new ne(1)]])}),this.camera=n,this.renderTarget=new Nt(1,1,{depthBuffer:!1}),this.renderTarget.texture.name="DoF.Intermediate",this.renderTargetMasked=this.renderTarget.clone(),this.renderTargetMasked.texture.name="DoF.Masked.Far",this.renderTargetNear=this.renderTarget.clone(),this.renderTargetNear.texture.name="DoF.Bokeh.Near",this.uniforms.get("nearColorBuffer").value=this.renderTargetNear.texture,this.renderTargetFar=this.renderTarget.clone(),this.renderTargetFar.texture.name="DoF.Bokeh.Far",this.uniforms.get("farColorBuffer").value=this.renderTargetFar.texture,this.renderTargetCoC=this.renderTarget.clone(),this.renderTargetCoC.texture.name="DoF.CoC",this.renderTargetCoCBlurred=this.renderTargetCoC.clone(),this.renderTargetCoCBlurred.texture.name="DoF.CoC.Blurred",this.uniforms.get("nearCoCBuffer").value=this.renderTargetCoCBlurred.texture,this.cocPass=new As(new nU(n));const h=this.cocMaterial;h.focusDistance=s,h.focusRange=o,t!==void 0&&(h.worldFocusDistance=t),i!==void 0&&(h.worldFocusRange=i),this.blurPass=new vp({resolutionScale:l,resolutionX:C,resolutionY:d,kernelSize:Fc.MEDIUM}),this.maskPass=new As(new HU(this.renderTargetCoC.texture));const f=this.maskPass.fullscreenMaterial;f.maskFunction=gu.MULTIPLY,f.colorChannel=Qg.GREEN,this.bokehNearBasePass=new As(new wh(!1,!0)),this.bokehNearBasePass.fullscreenMaterial.cocBuffer=this.renderTargetCoCBlurred.texture,this.bokehNearFillPass=new As(new wh(!0,!0)),this.bokehNearFillPass.fullscreenMaterial.cocBuffer=this.renderTargetCoCBlurred.texture,this.bokehFarBasePass=new As(new wh(!1,!1)),this.bokehFarBasePass.fullscreenMaterial.cocBuffer=this.renderTargetCoC.texture,this.bokehFarFillPass=new As(new wh(!0,!1)),this.bokehFarFillPass.fullscreenMaterial.cocBuffer=this.renderTargetCoC.texture,this.target=null;const v=this.resolution=new qt(this,C,d,l);v.addEventListener("change",y=>this.setSize(v.baseWidth,v.baseHeight)),this.bokehScale=a}set mainCamera(n){this.camera=n,this.cocMaterial.copyCameraSettings(n)}get cocTexture(){return this.renderTargetCoC.texture}get cocMaterial(){return this.cocPass.fullscreenMaterial}get circleOfConfusionMaterial(){return this.cocMaterial}getCircleOfConfusionMaterial(){return this.circleOfConfusionMaterial}getBlurPass(){return this.blurPass}getResolution(){return this.resolution}get bokehScale(){return this.uniforms.get("scale").value}set bokehScale(n){this.bokehNearBasePass.fullscreenMaterial.scale=n,this.bokehNearFillPass.fullscreenMaterial.scale=n,this.bokehFarBasePass.fullscreenMaterial.scale=n,this.bokehFarFillPass.fullscreenMaterial.scale=n,this.maskPass.fullscreenMaterial.strength=n,this.uniforms.get("scale").value=n}getBokehScale(){return this.bokehScale}setBokehScale(n){this.bokehScale=n}getTarget(){return this.target}setTarget(n){this.target=n}calculateFocusDistance(n){const e=this.camera,t=e.position.distanceTo(n);return Cl(-t,e.near,e.far)}setDepthTexture(n,e=Tn){this.circleOfConfusionMaterial.depthBuffer=n,this.circleOfConfusionMaterial.depthPacking=e}update(n,e,t){const i=this.renderTarget,s=this.renderTargetCoC,r=this.renderTargetCoCBlurred,o=this.renderTargetMasked;if(this.target!==null){const a=this.calculateFocusDistance(this.target);this.cocMaterial.focusDistance=a}this.cocPass.render(n,null,s),this.blurPass.render(n,s,r),this.maskPass.render(n,e,o),this.bokehFarBasePass.render(n,o,i),this.bokehFarFillPass.render(n,i,this.renderTargetFar),this.bokehNearBasePass.render(n,e,i),this.bokehNearFillPass.render(n,i,this.renderTargetNear)}setSize(n,e){const t=this.resolution;t.setBaseSize(n,e);const i=t.width,s=t.height;this.cocPass.setSize(n,e),this.blurPass.setSize(n,e),this.maskPass.setSize(n,e),this.renderTargetCoC.setSize(n,e),this.renderTargetMasked.setSize(n,e),this.renderTarget.setSize(i,s),this.renderTargetNear.setSize(i,s),this.renderTargetFar.setSize(i,s),this.renderTargetCoCBlurred.setSize(i,s),this.bokehNearBasePass.fullscreenMaterial.setSize(n,e),this.bokehNearFillPass.fullscreenMaterial.setSize(n,e),this.bokehFarBasePass.fullscreenMaterial.setSize(n,e),this.bokehFarFillPass.fullscreenMaterial.setSize(n,e)}initialize(n,e,t){this.cocPass.initialize(n,e,t),this.maskPass.initialize(n,e,t),this.bokehNearBasePass.initialize(n,e,t),this.bokehNearFillPass.initialize(n,e,t),this.bokehFarBasePass.initialize(n,e,t),this.bokehFarFillPass.initialize(n,e,t),this.blurPass.initialize(n,e,cn);const i=this.maskPass.fullscreenMaterial;i.maskFunction=e?gu.MULTIPLY:gu.MULTIPLY_RGB_SET_ALPHA,t!==void 0&&(this.renderTarget.texture.type=t,this.renderTargetNear.texture.type=t,this.renderTargetFar.texture.type=t,this.renderTargetMasked.texture.type=t,So(n)===jt&&(Qn(this.renderTarget.texture,jt),Qn(this.renderTargetNear.texture,jt),Qn(this.renderTargetFar.texture,jt),Qn(this.renderTargetMasked.texture,jt)))}};function qP(n,e,t){const i=new Map([[tp,1],[ty,1],[ny,2],[An,4]]);let s;if(i.has(e)||console.error("Invalid noise texture format"),t===cn){s=new Uint8Array(n*i.get(e));for(let r=0,o=s.length;rdistortion.x-columns*random){float sx=clamp(ceil(seeds.x),0.0,1.0);uv.y=sx*(1.0-(uv.y+distortion.y))+(1.0-sx)*distortion.y;}if(uv.xdistortion.y-columns*random){float sy=clamp(ceil(seeds.y),0.0,1.0);uv.x=sy*distortion.x+(1.0-sy)*(1.0-(uv.x+distortion.x));}vec2 normal=texture2D(perturbationMap,uv*random*random).rg;uv+=normal*seeds*(random*0.2);}}",xh="Glitch.Generated";function Oi(n,e){return n+Math.random()*(e-n)}var e_=class extends di{constructor({chromaticAberrationOffset:n=null,delay:e=new oe(1.5,3.5),duration:t=new oe(.6,1),strength:i=new oe(.3,1),columns:s=.05,ratio:r=.85,perturbationMap:o=null,dtSize:a=64}={}){if(super("GlitchEffect",$P,{uniforms:new Map([["perturbationMap",new ne(null)],["columns",new ne(s)],["active",new ne(!1)],["random",new ne(1)],["seeds",new ne(new oe)],["distortion",new ne(new oe)]])}),o===null){const l=new Lb(a,a,An);l.name=xh,this.perturbationMap=l}else this.perturbationMap=o;this.time=0,this.distortion=this.uniforms.get("distortion").value,this.delay=e,this.duration=t,this.breakPoint=new oe(Oi(this.delay.x,this.delay.y),Oi(this.duration.x,this.duration.y)),this.strength=i,this.mode=sl.SPORADIC,this.ratio=r,this.chromaticAberrationOffset=n}get seeds(){return this.uniforms.get("seeds").value}get active(){return this.uniforms.get("active").value}isActive(){return this.active}get minDelay(){return this.delay.x}set minDelay(n){this.delay.x=n}getMinDelay(){return this.delay.x}setMinDelay(n){this.delay.x=n}get maxDelay(){return this.delay.y}set maxDelay(n){this.delay.y=n}getMaxDelay(){return this.delay.y}setMaxDelay(n){this.delay.y=n}get minDuration(){return this.duration.x}set minDuration(n){this.duration.x=n}getMinDuration(){return this.duration.x}setMinDuration(n){this.duration.x=n}get maxDuration(){return this.duration.y}set maxDuration(n){this.duration.y=n}getMaxDuration(){return this.duration.y}setMaxDuration(n){this.duration.y=n}get minStrength(){return this.strength.x}set minStrength(n){this.strength.x=n}getMinStrength(){return this.strength.x}setMinStrength(n){this.strength.x=n}get maxStrength(){return this.strength.y}set maxStrength(n){this.strength.y=n}getMaxStrength(){return this.strength.y}setMaxStrength(n){this.strength.y=n}getMode(){return this.mode}setMode(n){this.mode=n}getGlitchRatio(){return 1-this.ratio}setGlitchRatio(n){this.ratio=Math.min(Math.max(1-n,0),1)}get columns(){return this.uniforms.get("columns").value}set columns(n){this.uniforms.get("columns").value=n}getGlitchColumns(){return this.columns}setGlitchColumns(n){this.columns=n}getChromaticAberrationOffset(){return this.chromaticAberrationOffset}setChromaticAberrationOffset(n){this.chromaticAberrationOffset=n}get perturbationMap(){return this.uniforms.get("perturbationMap").value}set perturbationMap(n){const e=this.perturbationMap;e!==null&&e.name===xh&&e.dispose(),n.minFilter=n.magFilter=vt,n.wrapS=n.wrapT=Gs,n.generateMipmaps=!1,this.uniforms.get("perturbationMap").value=n}getPerturbationMap(){return this.perturbationMap}setPerturbationMap(n){this.perturbationMap=n}generatePerturbationMap(n=64){const e=new Lb(n,n,An);return e.name=xh,e}update(n,e,t){const i=this.mode,s=this.breakPoint,r=this.chromaticAberrationOffset,o=this.strength;let a=this.time,l=!1,g=0,u=0,C;i!==sl.DISABLED&&(i===sl.SPORADIC&&(a+=t,C=a>s.x,a>=s.x+s.y&&(s.set(Oi(this.delay.x,this.delay.y),Oi(this.duration.x,this.duration.y)),a=0)),g=Math.random(),this.uniforms.get("random").value=g,C&&g>this.ratio||i===sl.CONSTANT_WILD?(l=!0,g*=o.y*.03,u=Oi(-Math.PI,Math.PI),this.seeds.set(Oi(-o.y,o.y),Oi(-o.y,o.y)),this.distortion.set(Oi(0,1),Oi(0,1))):(C||i===sl.CONSTANT_MILD)&&(l=!0,g*=o.x*.03,u=Oi(-Math.PI,Math.PI),this.seeds.set(Oi(-o.x,o.x),Oi(-o.x,o.x)),this.distortion.set(Oi(0,1),Oi(0,1))),this.time=a),r!==null&&(l?r.set(Math.cos(u),Math.sin(u)).multiplyScalar(g):r.set(0,0)),this.uniforms.get("active").value=l}dispose(){const n=this.perturbationMap;n!==null&&n.name===xh&&n.dispose()}},t_=`#ifdef FRAMEBUFFER_PRECISION_HIGH uniform mediump sampler2D map; #else uniform lowp sampler2D map; #endif -void mainImage(const in vec4 inputColor,const in vec2 uv,out vec4 outputColor){outputColor=texture2D(map,uv);}`,Jm=new H,uS=new _e,n_=class extends di{constructor(n,e,{blendFunction:t=ht.SCREEN,samples:i=60,density:s=.96,decay:r=.9,weight:o=.4,exposure:a=.6,clampMax:l=1,blur:g=!0,kernelSize:u=Xc.SMALL,resolutionScale:C=.5,width:d=qt.AUTO_SIZE,height:h=qt.AUTO_SIZE,resolutionX:f=d,resolutionY:v=h}={}){super("GodRaysEffect",t_,{blendFunction:t,attributes:os.DEPTH,uniforms:new Map([["map",new ne(null)]])}),this.camera=n,this._lightSource=e,this.lightSource=e,this.lightScene=new Sl,this.screenPosition=new oe,this.renderTargetA=new Nt(1,1,{depthBuffer:!1}),this.renderTargetA.texture.name="GodRays.Target.A",this.renderTargetB=this.renderTargetA.clone(),this.renderTargetB.texture.name="GodRays.Target.B",this.uniforms.get("map").value=this.renderTargetB.texture,this.renderTargetLight=new Nt(1,1),this.renderTargetLight.texture.name="GodRays.Light",this.renderTargetLight.depthTexture=new lp,this.renderPassLight=new Yc(this.lightScene,n),this.renderPassLight.clearPass.overrideClearColor=new Xe(0),this.clearPass=new Fc(!0,!1,!1),this.clearPass.overrideClearColor=new Xe(0),this.blurPass=new vp({kernelSize:u}),this.blurPass.enabled=g,this.depthMaskPass=new As(new XM);const y=this.depthMaskMaterial;y.depthBuffer1=this.renderTargetLight.depthTexture,y.copyCameraSettings(n),this.godRaysPass=new As(new WU(this.screenPosition));const A=this.godRaysMaterial;A.density=s,A.decay=r,A.weight=o,A.exposure=a,A.maxIntensity=l,A.samples=i;const b=this.resolution=new qt(this,f,v,C);b.addEventListener("change",m=>this.setSize(b.baseWidth,b.baseHeight))}set mainCamera(n){this.camera=n,this.renderPassLight.mainCamera=n,this.depthMaskMaterial.copyCameraSettings(n)}get lightSource(){return this._lightSource}set lightSource(n){this._lightSource=n,n!==null&&(n.material.depthWrite=!1,n.material.transparent=!0)}getBlurPass(){return this.blurPass}get texture(){return this.renderTargetB.texture}getTexture(){return this.texture}get depthMaskMaterial(){return this.depthMaskPass.fullscreenMaterial}get godRaysMaterial(){return this.godRaysPass.fullscreenMaterial}getGodRaysMaterial(){return this.godRaysMaterial}getResolution(){return this.resolution}get width(){return this.resolution.width}set width(n){this.resolution.preferredWidth=n}get height(){return this.resolution.height}set height(n){this.resolution.preferredHeight=n}get dithering(){return this.godRaysMaterial.dithering}set dithering(n){const e=this.godRaysMaterial;e.dithering=n,e.needsUpdate=!0}get blur(){return this.blurPass.enabled}set blur(n){this.blurPass.enabled=n}get kernelSize(){return this.blurPass.kernelSize}set kernelSize(n){this.blurPass.kernelSize=n}getResolutionScale(){return this.resolution.scale}setResolutionScale(n){this.resolution.scale=n}get samples(){return this.godRaysMaterial.samples}set samples(n){this.godRaysMaterial.samples=n}setDepthTexture(n,e=Tn){this.depthMaskPass.fullscreenMaterial.depthBuffer0=n,this.depthMaskPass.fullscreenMaterial.depthPacking0=e}update(n,e,t){const i=this.lightSource,s=i.parent,r=i.matrixAutoUpdate,o=this.renderTargetA,a=this.renderTargetLight;i.material.depthWrite=!0,i.matrixAutoUpdate=!1,i.updateWorldMatrix(!0,!1),s!==null&&(r||uS.copy(i.matrix),i.matrix.copy(i.matrixWorld)),this.lightScene.add(i),this.renderPassLight.render(n,a),this.clearPass.render(n,o),this.depthMaskPass.render(n,a,o),i.material.depthWrite=!1,i.matrixAutoUpdate=r,s!==null&&(r||i.matrix.copy(uS),s.add(i)),Jm.setFromMatrixPosition(i.matrixWorld).project(this.camera),this.screenPosition.set(Math.min(Math.max((Jm.x+1)*.5,-1),2),Math.min(Math.max((Jm.y+1)*.5,-1),2)),this.blurPass.enabled&&this.blurPass.render(n,o,o),this.godRaysPass.render(n,o,this.renderTargetB)}setSize(n,e){const t=this.resolution;t.setBaseSize(n,e);const i=t.width,s=t.height;this.renderTargetA.setSize(i,s),this.renderTargetB.setSize(i,s),this.renderTargetLight.setSize(i,s),this.blurPass.resolution.copy(t)}initialize(n,e,t){this.blurPass.initialize(n,e,t),this.renderPassLight.initialize(n,e,t),this.depthMaskPass.initialize(n,e,t),this.godRaysPass.initialize(n,e,t),t!==void 0&&(this.renderTargetA.texture.type=t,this.renderTargetB.texture.type=t,this.renderTargetLight.texture.type=t,So(n)===jt&&(Qn(this.renderTargetA.texture,jt),Qn(this.renderTargetB.texture,jt),Qn(this.renderTargetLight.texture,jt)))}},i_="uniform vec2 scale;uniform float lineWidth;void mainImage(const in vec4 inputColor,const in vec2 uv,out vec4 outputColor){float grid=0.5-max(abs(mod(uv.x*scale.x,1.0)-0.5),abs(mod(uv.y*scale.y,1.0)-0.5));outputColor=vec4(vec3(smoothstep(0.0,lineWidth,grid)),inputColor.a);}",s_=class extends di{constructor({blendFunction:n=ht.OVERLAY,scale:e=1,lineWidth:t=0}={}){super("GridEffect",i_,{blendFunction:n,uniforms:new Map([["scale",new ne(new oe)],["lineWidth",new ne(t)]])}),this.resolution=new oe,this.s=0,this.scale=e,this.l=0,this.lineWidth=t}get scale(){return this.s}set scale(n){this.s=Math.max(n,1e-6),this.setSize(this.resolution.width,this.resolution.height)}getScale(){return this.scale}setScale(n){this.scale=n}get lineWidth(){return this.l}set lineWidth(n){this.l=n,this.setSize(this.resolution.width,this.resolution.height)}getLineWidth(){return this.lineWidth}setLineWidth(n){this.lineWidth=n}setSize(n,e){this.resolution.set(n,e);const t=n/e,i=this.scale*(e*.125);this.uniforms.get("scale").value.set(t*i,i),this.uniforms.get("lineWidth").value=i/e+this.lineWidth}};function CS(n,e,t){const i=document.createElement("canvas"),s=i.getContext("2d");if(i.width=n,i.height=e,t instanceof Image)s.drawImage(t,0,0);else{const r=s.createImageData(n,e);r.data.set(t),s.putImageData(r,0,0)}return i}var KM=class{constructor(n=0,e=0,t=null){this.width=n,this.height=e,this.data=t}toCanvas(){return typeof document>"u"?null:CS(this.width,this.height,this.data)}static from(n){const{width:e,height:t}=n;let i;if(n instanceof Image){const s=CS(e,t,n);s!==null&&(i=s.getContext("2d").getImageData(0,0,e,t).data)}else i=n.data;return new KM(e,t,i)}},r_=`"use strict";(()=>{var O=Math.pow;var _={SCALE_UP:"lut.scaleup"};var k=[new Float32Array(3),new Float32Array(3)],n=[new Float32Array(3),new Float32Array(3),new Float32Array(3),new Float32Array(3)],Z=[[new Float32Array([0,0,0]),new Float32Array([1,0,0]),new Float32Array([1,1,0]),new Float32Array([1,1,1])],[new Float32Array([0,0,0]),new Float32Array([1,0,0]),new Float32Array([1,0,1]),new Float32Array([1,1,1])],[new Float32Array([0,0,0]),new Float32Array([0,0,1]),new Float32Array([1,0,1]),new Float32Array([1,1,1])],[new Float32Array([0,0,0]),new Float32Array([0,1,0]),new Float32Array([1,1,0]),new Float32Array([1,1,1])],[new Float32Array([0,0,0]),new Float32Array([0,1,0]),new Float32Array([0,1,1]),new Float32Array([1,1,1])],[new Float32Array([0,0,0]),new Float32Array([0,0,1]),new Float32Array([0,1,1]),new Float32Array([1,1,1])]];function d(a,t,r,m){let i=r[0]-t[0],e=r[1]-t[1],y=r[2]-t[2],h=a[0]-t[0],A=a[1]-t[1],w=a[2]-t[2],c=e*w-y*A,l=y*h-i*w,x=i*A-e*h,u=Math.sqrt(c*c+l*l+x*x),b=u*.5,s=c/u,F=l/u,f=x/u,p=-(a[0]*s+a[1]*F+a[2]*f),M=m[0]*s+m[1]*F+m[2]*f;return Math.abs(M+p)*b/3}function V(a,t,r,m,i,e){let y=(r+m*t+i*t*t)*4;e[0]=a[y+0],e[1]=a[y+1],e[2]=a[y+2]}function j(a,t,r,m,i,e){let y=r*(t-1),h=m*(t-1),A=i*(t-1),w=Math.floor(y),c=Math.floor(h),l=Math.floor(A),x=Math.ceil(y),u=Math.ceil(h),b=Math.ceil(A),s=y-w,F=h-c,f=A-l;if(w===y&&c===h&&l===A)V(a,t,y,h,A,e);else{let p;s>=F&&F>=f?p=Z[0]:s>=f&&f>=F?p=Z[1]:f>=s&&s>=F?p=Z[2]:F>=s&&s>=f?p=Z[3]:F>=f&&f>=s?p=Z[4]:f>=F&&F>=s&&(p=Z[5]);let[M,g,X,Y]=p,P=k[0];P[0]=s,P[1]=F,P[2]=f;let o=k[1],L=x-w,S=u-c,U=b-l;o[0]=L*M[0]+w,o[1]=S*M[1]+c,o[2]=U*M[2]+l,V(a,t,o[0],o[1],o[2],n[0]),o[0]=L*g[0]+w,o[1]=S*g[1]+c,o[2]=U*g[2]+l,V(a,t,o[0],o[1],o[2],n[1]),o[0]=L*X[0]+w,o[1]=S*X[1]+c,o[2]=U*X[2]+l,V(a,t,o[0],o[1],o[2],n[2]),o[0]=L*Y[0]+w,o[1]=S*Y[1]+c,o[2]=U*Y[2]+l,V(a,t,o[0],o[1],o[2],n[3]);let T=d(g,X,Y,P)*6,q=d(M,X,Y,P)*6,C=d(M,g,Y,P)*6,E=d(M,g,X,P)*6;n[0][0]*=T,n[0][1]*=T,n[0][2]*=T,n[1][0]*=q,n[1][1]*=q,n[1][2]*=q,n[2][0]*=C,n[2][1]*=C,n[2][2]*=C,n[3][0]*=E,n[3][1]*=E,n[3][2]*=E,e[0]=n[0][0]+n[1][0]+n[2][0]+n[3][0],e[1]=n[0][1]+n[1][1]+n[2][1]+n[3][1],e[2]=n[0][2]+n[1][2]+n[2][2]+n[3][2]}}var v=class{static expand(t,r){let m=Math.cbrt(t.length/4),i=new Float32Array(3),e=new t.constructor(O(r,3)*4),y=t instanceof Uint8Array?255:1,h=O(r,2),A=1/(r-1);for(let w=0;w{let t=a.data,r=t.data;switch(t.operation){case _.SCALE_UP:r=v.expand(r,t.size);break}postMessage(r,[r.buffer]),close()});})(); +void mainImage(const in vec4 inputColor,const in vec2 uv,out vec4 outputColor){outputColor=texture2D(map,uv);}`,Jm=new H,uS=new _e,n_=class extends di{constructor(n,e,{blendFunction:t=ht.SCREEN,samples:i=60,density:s=.96,decay:r=.9,weight:o=.4,exposure:a=.6,clampMax:l=1,blur:g=!0,kernelSize:u=Fc.SMALL,resolutionScale:C=.5,width:d=qt.AUTO_SIZE,height:h=qt.AUTO_SIZE,resolutionX:f=d,resolutionY:v=h}={}){super("GodRaysEffect",t_,{blendFunction:t,attributes:os.DEPTH,uniforms:new Map([["map",new ne(null)]])}),this.camera=n,this._lightSource=e,this.lightSource=e,this.lightScene=new Sl,this.screenPosition=new oe,this.renderTargetA=new Nt(1,1,{depthBuffer:!1}),this.renderTargetA.texture.name="GodRays.Target.A",this.renderTargetB=this.renderTargetA.clone(),this.renderTargetB.texture.name="GodRays.Target.B",this.uniforms.get("map").value=this.renderTargetB.texture,this.renderTargetLight=new Nt(1,1),this.renderTargetLight.texture.name="GodRays.Light",this.renderTargetLight.depthTexture=new lp,this.renderPassLight=new Kc(this.lightScene,n),this.renderPassLight.clearPass.overrideClearColor=new Xe(0),this.clearPass=new Yc(!0,!1,!1),this.clearPass.overrideClearColor=new Xe(0),this.blurPass=new vp({kernelSize:u}),this.blurPass.enabled=g,this.depthMaskPass=new As(new XM);const y=this.depthMaskMaterial;y.depthBuffer1=this.renderTargetLight.depthTexture,y.copyCameraSettings(n),this.godRaysPass=new As(new WU(this.screenPosition));const A=this.godRaysMaterial;A.density=s,A.decay=r,A.weight=o,A.exposure=a,A.maxIntensity=l,A.samples=i;const b=this.resolution=new qt(this,f,v,C);b.addEventListener("change",m=>this.setSize(b.baseWidth,b.baseHeight))}set mainCamera(n){this.camera=n,this.renderPassLight.mainCamera=n,this.depthMaskMaterial.copyCameraSettings(n)}get lightSource(){return this._lightSource}set lightSource(n){this._lightSource=n,n!==null&&(n.material.depthWrite=!1,n.material.transparent=!0)}getBlurPass(){return this.blurPass}get texture(){return this.renderTargetB.texture}getTexture(){return this.texture}get depthMaskMaterial(){return this.depthMaskPass.fullscreenMaterial}get godRaysMaterial(){return this.godRaysPass.fullscreenMaterial}getGodRaysMaterial(){return this.godRaysMaterial}getResolution(){return this.resolution}get width(){return this.resolution.width}set width(n){this.resolution.preferredWidth=n}get height(){return this.resolution.height}set height(n){this.resolution.preferredHeight=n}get dithering(){return this.godRaysMaterial.dithering}set dithering(n){const e=this.godRaysMaterial;e.dithering=n,e.needsUpdate=!0}get blur(){return this.blurPass.enabled}set blur(n){this.blurPass.enabled=n}get kernelSize(){return this.blurPass.kernelSize}set kernelSize(n){this.blurPass.kernelSize=n}getResolutionScale(){return this.resolution.scale}setResolutionScale(n){this.resolution.scale=n}get samples(){return this.godRaysMaterial.samples}set samples(n){this.godRaysMaterial.samples=n}setDepthTexture(n,e=Tn){this.depthMaskPass.fullscreenMaterial.depthBuffer0=n,this.depthMaskPass.fullscreenMaterial.depthPacking0=e}update(n,e,t){const i=this.lightSource,s=i.parent,r=i.matrixAutoUpdate,o=this.renderTargetA,a=this.renderTargetLight;i.material.depthWrite=!0,i.matrixAutoUpdate=!1,i.updateWorldMatrix(!0,!1),s!==null&&(r||uS.copy(i.matrix),i.matrix.copy(i.matrixWorld)),this.lightScene.add(i),this.renderPassLight.render(n,a),this.clearPass.render(n,o),this.depthMaskPass.render(n,a,o),i.material.depthWrite=!1,i.matrixAutoUpdate=r,s!==null&&(r||i.matrix.copy(uS),s.add(i)),Jm.setFromMatrixPosition(i.matrixWorld).project(this.camera),this.screenPosition.set(Math.min(Math.max((Jm.x+1)*.5,-1),2),Math.min(Math.max((Jm.y+1)*.5,-1),2)),this.blurPass.enabled&&this.blurPass.render(n,o,o),this.godRaysPass.render(n,o,this.renderTargetB)}setSize(n,e){const t=this.resolution;t.setBaseSize(n,e);const i=t.width,s=t.height;this.renderTargetA.setSize(i,s),this.renderTargetB.setSize(i,s),this.renderTargetLight.setSize(i,s),this.blurPass.resolution.copy(t)}initialize(n,e,t){this.blurPass.initialize(n,e,t),this.renderPassLight.initialize(n,e,t),this.depthMaskPass.initialize(n,e,t),this.godRaysPass.initialize(n,e,t),t!==void 0&&(this.renderTargetA.texture.type=t,this.renderTargetB.texture.type=t,this.renderTargetLight.texture.type=t,So(n)===jt&&(Qn(this.renderTargetA.texture,jt),Qn(this.renderTargetB.texture,jt),Qn(this.renderTargetLight.texture,jt)))}},i_="uniform vec2 scale;uniform float lineWidth;void mainImage(const in vec4 inputColor,const in vec2 uv,out vec4 outputColor){float grid=0.5-max(abs(mod(uv.x*scale.x,1.0)-0.5),abs(mod(uv.y*scale.y,1.0)-0.5));outputColor=vec4(vec3(smoothstep(0.0,lineWidth,grid)),inputColor.a);}",s_=class extends di{constructor({blendFunction:n=ht.OVERLAY,scale:e=1,lineWidth:t=0}={}){super("GridEffect",i_,{blendFunction:n,uniforms:new Map([["scale",new ne(new oe)],["lineWidth",new ne(t)]])}),this.resolution=new oe,this.s=0,this.scale=e,this.l=0,this.lineWidth=t}get scale(){return this.s}set scale(n){this.s=Math.max(n,1e-6),this.setSize(this.resolution.width,this.resolution.height)}getScale(){return this.scale}setScale(n){this.scale=n}get lineWidth(){return this.l}set lineWidth(n){this.l=n,this.setSize(this.resolution.width,this.resolution.height)}getLineWidth(){return this.lineWidth}setLineWidth(n){this.lineWidth=n}setSize(n,e){this.resolution.set(n,e);const t=n/e,i=this.scale*(e*.125);this.uniforms.get("scale").value.set(t*i,i),this.uniforms.get("lineWidth").value=i/e+this.lineWidth}};function CS(n,e,t){const i=document.createElement("canvas"),s=i.getContext("2d");if(i.width=n,i.height=e,t instanceof Image)s.drawImage(t,0,0);else{const r=s.createImageData(n,e);r.data.set(t),s.putImageData(r,0,0)}return i}var KM=class{constructor(n=0,e=0,t=null){this.width=n,this.height=e,this.data=t}toCanvas(){return typeof document>"u"?null:CS(this.width,this.height,this.data)}static from(n){const{width:e,height:t}=n;let i;if(n instanceof Image){const s=CS(e,t,n);s!==null&&(i=s.getContext("2d").getImageData(0,0,e,t).data)}else i=n.data;return new KM(e,t,i)}},r_=`"use strict";(()=>{var O=Math.pow;var _={SCALE_UP:"lut.scaleup"};var k=[new Float32Array(3),new Float32Array(3)],n=[new Float32Array(3),new Float32Array(3),new Float32Array(3),new Float32Array(3)],Z=[[new Float32Array([0,0,0]),new Float32Array([1,0,0]),new Float32Array([1,1,0]),new Float32Array([1,1,1])],[new Float32Array([0,0,0]),new Float32Array([1,0,0]),new Float32Array([1,0,1]),new Float32Array([1,1,1])],[new Float32Array([0,0,0]),new Float32Array([0,0,1]),new Float32Array([1,0,1]),new Float32Array([1,1,1])],[new Float32Array([0,0,0]),new Float32Array([0,1,0]),new Float32Array([1,1,0]),new Float32Array([1,1,1])],[new Float32Array([0,0,0]),new Float32Array([0,1,0]),new Float32Array([0,1,1]),new Float32Array([1,1,1])],[new Float32Array([0,0,0]),new Float32Array([0,0,1]),new Float32Array([0,1,1]),new Float32Array([1,1,1])]];function d(a,t,r,m){let i=r[0]-t[0],e=r[1]-t[1],y=r[2]-t[2],h=a[0]-t[0],A=a[1]-t[1],w=a[2]-t[2],c=e*w-y*A,l=y*h-i*w,x=i*A-e*h,u=Math.sqrt(c*c+l*l+x*x),b=u*.5,s=c/u,F=l/u,f=x/u,p=-(a[0]*s+a[1]*F+a[2]*f),M=m[0]*s+m[1]*F+m[2]*f;return Math.abs(M+p)*b/3}function V(a,t,r,m,i,e){let y=(r+m*t+i*t*t)*4;e[0]=a[y+0],e[1]=a[y+1],e[2]=a[y+2]}function j(a,t,r,m,i,e){let y=r*(t-1),h=m*(t-1),A=i*(t-1),w=Math.floor(y),c=Math.floor(h),l=Math.floor(A),x=Math.ceil(y),u=Math.ceil(h),b=Math.ceil(A),s=y-w,F=h-c,f=A-l;if(w===y&&c===h&&l===A)V(a,t,y,h,A,e);else{let p;s>=F&&F>=f?p=Z[0]:s>=f&&f>=F?p=Z[1]:f>=s&&s>=F?p=Z[2]:F>=s&&s>=f?p=Z[3]:F>=f&&f>=s?p=Z[4]:f>=F&&F>=s&&(p=Z[5]);let[M,g,X,Y]=p,P=k[0];P[0]=s,P[1]=F,P[2]=f;let o=k[1],L=x-w,S=u-c,U=b-l;o[0]=L*M[0]+w,o[1]=S*M[1]+c,o[2]=U*M[2]+l,V(a,t,o[0],o[1],o[2],n[0]),o[0]=L*g[0]+w,o[1]=S*g[1]+c,o[2]=U*g[2]+l,V(a,t,o[0],o[1],o[2],n[1]),o[0]=L*X[0]+w,o[1]=S*X[1]+c,o[2]=U*X[2]+l,V(a,t,o[0],o[1],o[2],n[2]),o[0]=L*Y[0]+w,o[1]=S*Y[1]+c,o[2]=U*Y[2]+l,V(a,t,o[0],o[1],o[2],n[3]);let T=d(g,X,Y,P)*6,q=d(M,X,Y,P)*6,C=d(M,g,Y,P)*6,E=d(M,g,X,P)*6;n[0][0]*=T,n[0][1]*=T,n[0][2]*=T,n[1][0]*=q,n[1][1]*=q,n[1][2]*=q,n[2][0]*=C,n[2][1]*=C,n[2][2]*=C,n[3][0]*=E,n[3][1]*=E,n[3][2]*=E,e[0]=n[0][0]+n[1][0]+n[2][0]+n[3][0],e[1]=n[0][1]+n[1][1]+n[2][1]+n[3][1],e[2]=n[0][2]+n[1][2]+n[2][2]+n[3][2]}}var v=class{static expand(t,r){let m=Math.cbrt(t.length/4),i=new Float32Array(3),e=new t.constructor(O(r,3)*4),y=t instanceof Uint8Array?255:1,h=O(r,2),A=1/(r-1);for(let w=0;w{let t=a.data,r=t.data;switch(t.operation){case _.SCALE_UP:r=v.expand(r,t.size);break}postMessage(r,[r.buffer]),close()});})(); `,dS=new Xe,eA=class extends fl{constructor(n,e){super(n,e,e,e),this.type=Wn,this.format=An,this.minFilter=st,this.magFilter=st,this.wrapS=Pn,this.wrapT=Pn,this.wrapR=Pn,this.unpackAlignment=1,this.needsUpdate=!0,Qn(this,yc),this.domainMin=new H(0,0,0),this.domainMax=new H(1,1,1)}get isLookupTexture3D(){return!0}scaleUp(n,e=!0){const t=this.image;let i;return n<=t.width?i=Promise.reject(new Error("The target size must be greater than the current size")):i=new Promise((s,r)=>{const o=URL.createObjectURL(new Blob([r_],{type:"text/javascript"})),a=new Worker(o);a.addEventListener("error",g=>r(g.error)),a.addEventListener("message",g=>{const u=new eA(g.data,n);Um(this,u),u.type=this.type,u.name=this.name,URL.revokeObjectURL(o),s(u)});const l=e?[t.data.buffer]:[];a.postMessage({operation:iU.SCALE_UP,data:t.data,size:n},l)}),i}applyLUT(n){const e=this.image,t=n.image,i=Math.min(e.width,e.height,e.depth),s=Math.min(t.width,t.height,t.depth);if(i!==s)console.error("Size mismatch");else if(n.type!==Wn||this.type!==Wn)console.error("Both LUTs must be FloatType textures");else if(n.format!==An||this.format!==An)console.error("Both LUTs must be RGBA textures");else{const r=e.data,o=t.data,a=i,l=a**2,g=a-1;for(let u=0,C=a**3;ui){r=new Uint8Array(l.length);for(let g=0;g{this.blendMode.blendFunction===ht.ALPHA?this.defines.set("ALPHA","1"):this.defines.delete("ALPHA"),this.setChanged()}),this.blendMode.blendFunction=t,this.patternTexture=i,this.xRay=C,this.scene=n,this.camera=e,this.renderTargetMask=new Nt(1,1),this.renderTargetMask.samples=d,this.renderTargetMask.texture.name="Outline.Mask",this.uniforms.get("maskTexture").value=this.renderTargetMask.texture,this.renderTargetOutline=new Nt(1,1,{depthBuffer:!1}),this.renderTargetOutline.texture.name="Outline.Edges",this.uniforms.get("edgeTexture").value=this.renderTargetOutline.texture,this.clearPass=new Fc,this.clearPass.overrideClearColor=new Xe(0),this.clearPass.overrideClearAlpha=1,this.depthPass=new ky(n,e),this.maskPass=new Yc(n,e,new uU(this.depthPass.texture,e));const b=this.maskPass.clearPass;b.overrideClearColor=new Xe(16777215),b.overrideClearAlpha=1,this.blurPass=new vp({resolutionScale:h,resolutionX:y,resolutionY:A,kernelSize:g}),this.blurPass.enabled=u;const m=this.blurPass.resolution;m.addEventListener("change",S=>this.setSize(m.baseWidth,m.baseHeight)),this.outlinePass=new As(new YU);const B=this.outlinePass.fullscreenMaterial;B.inputBuffer=this.renderTargetMask.texture,this.time=0,this.active=!1,this.selection=new Dy,this.selection.layer=10,this.pulseSpeed=o}set mainScene(n){this.scene=n,this.depthPass.mainScene=n,this.maskPass.mainScene=n}set mainCamera(n){this.camera=n,this.depthPass.mainCamera=n,this.maskPass.mainCamera=n,this.maskPass.overrideMaterial.copyCameraSettings(n)}get resolution(){return this.blurPass.resolution}getResolution(){return this.blurPass.getResolution()}get multisampling(){return this.renderTargetMask.samples}set multisampling(n){this.renderTargetMask.samples=n,this.renderTargetMask.dispose()}get patternScale(){return this.uniforms.get("patternScale").value}set patternScale(n){this.uniforms.get("patternScale").value=n}get edgeStrength(){return this.uniforms.get("edgeStrength").value}set edgeStrength(n){this.uniforms.get("edgeStrength").value=n}get visibleEdgeColor(){return this.uniforms.get("visibleEdgeColor").value}set visibleEdgeColor(n){this.uniforms.get("visibleEdgeColor").value=n}get hiddenEdgeColor(){return this.uniforms.get("hiddenEdgeColor").value}set hiddenEdgeColor(n){this.uniforms.get("hiddenEdgeColor").value=n}getBlurPass(){return this.blurPass}getSelection(){return this.selection}getPulseSpeed(){return this.pulseSpeed}setPulseSpeed(n){this.pulseSpeed=n}get width(){return this.resolution.width}set width(n){this.resolution.preferredWidth=n}get height(){return this.resolution.height}set height(n){this.resolution.preferredHeight=n}get selectionLayer(){return this.selection.layer}set selectionLayer(n){this.selection.layer=n}get dithering(){return this.blurPass.dithering}set dithering(n){this.blurPass.dithering=n}get kernelSize(){return this.blurPass.kernelSize}set kernelSize(n){this.blurPass.kernelSize=n}get blur(){return this.blurPass.enabled}set blur(n){this.blurPass.enabled=n}get xRay(){return this.defines.has("X_RAY")}set xRay(n){this.xRay!==n&&(n?this.defines.set("X_RAY","1"):this.defines.delete("X_RAY"),this.setChanged())}isXRayEnabled(){return this.xRay}setXRayEnabled(n){this.xRay=n}get patternTexture(){return this.uniforms.get("patternTexture").value}set patternTexture(n){n!==null?(n.wrapS=n.wrapT=Gs,this.defines.set("USE_PATTERN","1"),this.setVertexShader(g_)):(this.defines.delete("USE_PATTERN"),this.setVertexShader(null)),this.uniforms.get("patternTexture").value=n,this.setChanged()}setPatternTexture(n){this.patternTexture=n}getResolutionScale(){return this.resolution.scale}setResolutionScale(n){this.resolution.scale=n}setSelection(n){return this.selection.set(n),this}clearSelection(){return this.selection.clear(),this}selectObject(n){return this.selection.add(n),this}deselectObject(n){return this.selection.delete(n),this}update(n,e,t){const i=this.scene,s=this.camera,r=this.selection,a=this.uniforms.get("pulse"),l=i.background,g=s.layers.mask;r.size>0?(i.background=null,a.value=1,this.pulseSpeed>0&&(a.value=Math.cos(this.time*this.pulseSpeed*10)*.375+.625),this.active=!0,this.time+=t,r.setVisible(!1),this.depthPass.render(n),r.setVisible(!0),s.layers.set(r.layer),this.maskPass.render(n,this.renderTargetMask),s.layers.mask=g,i.background=l,this.outlinePass.render(n,null,this.renderTargetOutline),this.blurPass.enabled&&this.blurPass.render(n,this.renderTargetOutline,this.renderTargetOutline)):this.active&&(this.clearPass.render(n,this.renderTargetOutline),this.active=!1)}setSize(n,e){this.blurPass.setSize(n,e),this.renderTargetMask.setSize(n,e);const t=this.resolution;t.setBaseSize(n,e);const i=t.width,s=t.height;this.depthPass.setSize(i,s),this.renderTargetOutline.setSize(i,s),this.outlinePass.fullscreenMaterial.setSize(i,s)}initialize(n,e,t){this.blurPass.initialize(n,e,cn),t!==void 0&&(this.depthPass.initialize(n,e,t),this.maskPass.initialize(n,e,t),this.outlinePass.initialize(n,e,t))}},I_="uniform bool active;uniform vec4 d;void mainUv(inout vec2 uv){if(active){uv=d.xy*(floor(uv*d.zw)+0.5);}}",u_=class extends di{constructor(n=30){super("PixelationEffect",I_,{uniforms:new Map([["active",new ne(!1)],["d",new ne(new Yt)]])}),this.resolution=new oe,this._granularity=0,this.granularity=n}get granularity(){return this._granularity}set granularity(n){let e=Math.floor(n);e%2>0&&(e+=1),this._granularity=e,this.uniforms.get("active").value=e>0,this.setSize(this.resolution.width,this.resolution.height)}getGranularity(){return this.granularity}setGranularity(n){this.granularity=n}setSize(n,e){const t=this.resolution;t.set(n,e);const i=this.granularity,s=i/t.x,r=i/t.y;this.uniforms.get("d").value.set(s,r,1/s,1/r)}};new H;new H;var C_=class extends DP{constructor(n,e,t){super(t),this.setAttributes(this.getAttributes()|os.DEPTH),this.camera=e,this.depthPass=new ky(n,e),this.clearPass=new Fc(!0,!1,!1),this.clearPass.overrideClearColor=new Xe(0),this.depthMaskPass=new As(new XM);const i=this.depthMaskMaterial;i.copyCameraSettings(e),i.depthBuffer1=this.depthPass.texture,i.depthPacking1=Tr,i.depthMode=Wu,this.renderTargetMasked=new Nt(1,1,{depthBuffer:!1}),this.renderTargetMasked.texture.name="Bloom.Masked",this.selection=new Dy,this.selection.layer=11,this._inverted=!1,this._ignoreBackground=!1}set mainScene(n){this.depthPass.mainScene=n}set mainCamera(n){this.camera=n,this.depthPass.mainCamera=n,this.depthMaskMaterial.copyCameraSettings(n)}getSelection(){return this.selection}get depthMaskMaterial(){return this.depthMaskPass.fullscreenMaterial}get inverted(){return this._inverted}set inverted(n){this._inverted=n,this.depthMaskMaterial.depthMode=n?$A:Wu}isInverted(){return this.inverted}setInverted(n){this.inverted=n}get ignoreBackground(){return this._ignoreBackground}set ignoreBackground(n){this._ignoreBackground=n,this.depthMaskMaterial.maxDepthStrategy=n?au.DISCARD_MAX_DEPTH:au.KEEP_MAX_DEPTH}isBackgroundDisabled(){return this.ignoreBackground}setBackgroundDisabled(n){this.ignoreBackground=n}setDepthTexture(n,e=Tn){this.depthMaskMaterial.depthBuffer0=n,this.depthMaskMaterial.depthPacking0=e}update(n,e,t){const i=this.camera,s=this.selection,r=this.inverted;let o=e;if(this.ignoreBackground||!r||s.size>0){const a=i.layers.mask;i.layers.set(s.layer),this.depthPass.render(n),i.layers.mask=a,o=this.renderTargetMasked,this.clearPass.render(n,o),this.depthMaskPass.render(n,e,o)}super.update(n,o,t)}setSize(n,e){super.setSize(n,e),this.renderTargetMasked.setSize(n,e),this.depthPass.setSize(n,e)}initialize(n,e,t){super.initialize(n,e,t),this.clearPass.initialize(n,e,t),this.depthPass.initialize(n,e,t),this.depthMaskPass.initialize(n,e,t),t!==void 0&&(this.renderTargetMasked.texture.type=t,So(n)===jt&&Qn(this.renderTargetMasked.texture,jt))}},hS="data:image/png;base64,iVBORw0KGg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SCjdaGr3fUw+I+VPwiPPpqJjO8J1Nw43e7ymHwHoAKMFd7QErAeEE5NNJMb3R+z3lsGcNzgfgiPPpomJ6o/d76oGwPgCOKJ8uKqY3er+nKwBHmE+noqRG7/fUA199U/AI8+kEwEbv93QHoEhZTnA+nYqSGr3fBoAtaiqBUImdm5hPJwA2er+nKwBHnE+X1gUzSbnR+z11wPj/AeCpPDD3t7rvAAAAAElFTkSuQmCC",d_="uniform sampler2D weightMap;varying vec2 vOffset0;varying vec2 vOffset1;void movec(const in bvec2 c,inout vec2 variable,const in vec2 value){if(c.x){variable.x=value.x;}if(c.y){variable.y=value.y;}}void movec(const in bvec4 c,inout vec4 variable,const in vec4 value){movec(c.xy,variable.xy,value.xy);movec(c.zw,variable.zw,value.zw);}void mainImage(const in vec4 inputColor,const in vec2 uv,out vec4 outputColor){vec4 a;a.x=texture2D(weightMap,vOffset0).a;a.y=texture2D(weightMap,vOffset1).g;a.wz=texture2D(weightMap,uv).rb;vec4 color=inputColor;if(dot(a,vec4(1.0))>=1e-5){bool h=max(a.x,a.z)>max(a.y,a.w);vec4 blendingOffset=vec4(0.0,a.y,0.0,a.w);vec2 blendingWeight=a.yw;movec(bvec4(h),blendingOffset,vec4(a.x,0.0,a.z,0.0));movec(bvec2(h),blendingWeight,a.xz);blendingWeight/=dot(blendingWeight,vec2(1.0));vec4 blendingCoord=blendingOffset*vec4(texelSize,-texelSize)+uv.xyxy;color=blendingWeight.x*texture2D(inputBuffer,blendingCoord.xy);color+=blendingWeight.y*texture2D(inputBuffer,blendingCoord.zw);}outputColor=color;}",h_="varying vec2 vOffset0;varying vec2 vOffset1;void mainSupport(const in vec2 uv){vOffset0=uv+texelSize*vec2(1.0,0.0);vOffset1=uv+texelSize*vec2(0.0,1.0);}",A_=class extends di{constructor({blendFunction:n=ht.SRC,preset:e=RI.MEDIUM,edgeDetectionMode:t=NM.COLOR,predicationMode:i=sU.DISABLED}={}){super("SMAAEffect",d_,{vertexShader:h_,blendFunction:n,attributes:os.CONVOLUTION|os.DEPTH,uniforms:new Map([["weightMap",new ne(null)]])});let s,r;arguments.length>1&&(s=arguments[0],r=arguments[1],arguments.length>2&&(e=arguments[2]),arguments.length>3&&(t=arguments[3])),this.renderTargetEdges=new Nt(1,1,{depthBuffer:!1}),this.renderTargetEdges.texture.name="SMAA.Edges",this.renderTargetWeights=this.renderTargetEdges.clone(),this.renderTargetWeights.texture.name="SMAA.Weights",this.uniforms.get("weightMap").value=this.renderTargetWeights.texture,this.clearPass=new Fc(!0,!1,!1),this.clearPass.overrideClearColor=new Xe(0),this.clearPass.overrideClearAlpha=1,this.edgeDetectionPass=new As(new ZU),this.edgeDetectionMaterial.edgeDetectionMode=t,this.edgeDetectionMaterial.predicationMode=i,this.weightsPass=new As(new LU);const o=new pp;o.onLoad=()=>{const a=new sn(s);a.name="SMAA.Search",a.magFilter=vt,a.minFilter=vt,a.generateMipmaps=!1,a.needsUpdate=!0,a.flipY=!0,this.weightsMaterial.searchTexture=a;const l=new sn(r);l.name="SMAA.Area",l.magFilter=st,l.minFilter=st,l.generateMipmaps=!1,l.needsUpdate=!0,l.flipY=!1,this.weightsMaterial.areaTexture=l,this.dispatchEvent({type:"load"})},o.itemStart("search"),o.itemStart("area"),s!==void 0&&r!==void 0?(o.itemEnd("search"),o.itemEnd("area")):typeof Image<"u"&&(s=new Image,r=new Image,s.addEventListener("load",()=>o.itemEnd("search")),r.addEventListener("load",()=>o.itemEnd("area")),s.src=hS,r.src=AS),this.applyPreset(e)}get edgesTexture(){return this.renderTargetEdges.texture}getEdgesTexture(){return this.edgesTexture}get weightsTexture(){return this.renderTargetWeights.texture}getWeightsTexture(){return this.weightsTexture}get edgeDetectionMaterial(){return this.edgeDetectionPass.fullscreenMaterial}get colorEdgesMaterial(){return this.edgeDetectionMaterial}getEdgeDetectionMaterial(){return this.edgeDetectionMaterial}get weightsMaterial(){return this.weightsPass.fullscreenMaterial}getWeightsMaterial(){return this.weightsMaterial}setEdgeDetectionThreshold(n){this.edgeDetectionMaterial.edgeDetectionThreshold=n}setOrthogonalSearchSteps(n){this.weightsMaterial.orthogonalSearchSteps=n}applyPreset(n){const e=this.edgeDetectionMaterial,t=this.weightsMaterial;switch(n){case RI.LOW:e.edgeDetectionThreshold=.15,t.orthogonalSearchSteps=4,t.diagonalDetection=!1,t.cornerDetection=!1;break;case RI.MEDIUM:e.edgeDetectionThreshold=.1,t.orthogonalSearchSteps=8,t.diagonalDetection=!1,t.cornerDetection=!1;break;case RI.HIGH:e.edgeDetectionThreshold=.1,t.orthogonalSearchSteps=16,t.diagonalSearchSteps=8,t.cornerRounding=25,t.diagonalDetection=!0,t.cornerDetection=!0;break;case RI.ULTRA:e.edgeDetectionThreshold=.05,t.orthogonalSearchSteps=32,t.diagonalSearchSteps=16,t.cornerRounding=25,t.diagonalDetection=!0,t.cornerDetection=!0;break}}setDepthTexture(n,e=Tn){this.edgeDetectionMaterial.depthBuffer=n,this.edgeDetectionMaterial.depthPacking=e}update(n,e,t){this.clearPass.render(n,this.renderTargetEdges),this.edgeDetectionPass.render(n,e,this.renderTargetEdges),this.weightsPass.render(n,this.renderTargetEdges,this.renderTargetWeights)}setSize(n,e){this.edgeDetectionMaterial.setSize(n,e),this.weightsMaterial.setSize(n,e),this.renderTargetEdges.setSize(n,e),this.renderTargetWeights.setSize(n,e)}dispose(){const{searchTexture:n,areaTexture:e}=this.weightsMaterial;n!==null&&e!==null&&(n.dispose(),e.dispose()),super.dispose()}static get searchImageDataURL(){return hS}static get areaImageDataURL(){return AS}},p_=`uniform lowp sampler2D aoBuffer;uniform float luminanceInfluence;uniform float intensity; +}`,g_="uniform float patternScale;varying vec2 vUvPattern;void mainSupport(const in vec2 uv){vUvPattern=uv*vec2(aspect,1.0)*patternScale;}",c_=class extends di{constructor(n,e,{blendFunction:t=ht.SCREEN,patternTexture:i=null,patternScale:s=1,edgeStrength:r=1,pulseSpeed:o=0,visibleEdgeColor:a=16777215,hiddenEdgeColor:l=2230538,kernelSize:g=Fc.VERY_SMALL,blur:u=!1,xRay:C=!0,multisampling:d=0,resolutionScale:h=.5,width:f=qt.AUTO_SIZE,height:v=qt.AUTO_SIZE,resolutionX:y=f,resolutionY:A=v}={}){super("OutlineEffect",l_,{uniforms:new Map([["maskTexture",new ne(null)],["edgeTexture",new ne(null)],["edgeStrength",new ne(r)],["visibleEdgeColor",new ne(new Xe(a))],["hiddenEdgeColor",new ne(new Xe(l))],["pulse",new ne(1)],["patternScale",new ne(s)],["patternTexture",new ne(null)]])}),this.blendMode.addEventListener("change",S=>{this.blendMode.blendFunction===ht.ALPHA?this.defines.set("ALPHA","1"):this.defines.delete("ALPHA"),this.setChanged()}),this.blendMode.blendFunction=t,this.patternTexture=i,this.xRay=C,this.scene=n,this.camera=e,this.renderTargetMask=new Nt(1,1),this.renderTargetMask.samples=d,this.renderTargetMask.texture.name="Outline.Mask",this.uniforms.get("maskTexture").value=this.renderTargetMask.texture,this.renderTargetOutline=new Nt(1,1,{depthBuffer:!1}),this.renderTargetOutline.texture.name="Outline.Edges",this.uniforms.get("edgeTexture").value=this.renderTargetOutline.texture,this.clearPass=new Yc,this.clearPass.overrideClearColor=new Xe(0),this.clearPass.overrideClearAlpha=1,this.depthPass=new ky(n,e),this.maskPass=new Kc(n,e,new uU(this.depthPass.texture,e));const b=this.maskPass.clearPass;b.overrideClearColor=new Xe(16777215),b.overrideClearAlpha=1,this.blurPass=new vp({resolutionScale:h,resolutionX:y,resolutionY:A,kernelSize:g}),this.blurPass.enabled=u;const m=this.blurPass.resolution;m.addEventListener("change",S=>this.setSize(m.baseWidth,m.baseHeight)),this.outlinePass=new As(new YU);const B=this.outlinePass.fullscreenMaterial;B.inputBuffer=this.renderTargetMask.texture,this.time=0,this.active=!1,this.selection=new Dy,this.selection.layer=10,this.pulseSpeed=o}set mainScene(n){this.scene=n,this.depthPass.mainScene=n,this.maskPass.mainScene=n}set mainCamera(n){this.camera=n,this.depthPass.mainCamera=n,this.maskPass.mainCamera=n,this.maskPass.overrideMaterial.copyCameraSettings(n)}get resolution(){return this.blurPass.resolution}getResolution(){return this.blurPass.getResolution()}get multisampling(){return this.renderTargetMask.samples}set multisampling(n){this.renderTargetMask.samples=n,this.renderTargetMask.dispose()}get patternScale(){return this.uniforms.get("patternScale").value}set patternScale(n){this.uniforms.get("patternScale").value=n}get edgeStrength(){return this.uniforms.get("edgeStrength").value}set edgeStrength(n){this.uniforms.get("edgeStrength").value=n}get visibleEdgeColor(){return this.uniforms.get("visibleEdgeColor").value}set visibleEdgeColor(n){this.uniforms.get("visibleEdgeColor").value=n}get hiddenEdgeColor(){return this.uniforms.get("hiddenEdgeColor").value}set hiddenEdgeColor(n){this.uniforms.get("hiddenEdgeColor").value=n}getBlurPass(){return this.blurPass}getSelection(){return this.selection}getPulseSpeed(){return this.pulseSpeed}setPulseSpeed(n){this.pulseSpeed=n}get width(){return this.resolution.width}set width(n){this.resolution.preferredWidth=n}get height(){return this.resolution.height}set height(n){this.resolution.preferredHeight=n}get selectionLayer(){return this.selection.layer}set selectionLayer(n){this.selection.layer=n}get dithering(){return this.blurPass.dithering}set dithering(n){this.blurPass.dithering=n}get kernelSize(){return this.blurPass.kernelSize}set kernelSize(n){this.blurPass.kernelSize=n}get blur(){return this.blurPass.enabled}set blur(n){this.blurPass.enabled=n}get xRay(){return this.defines.has("X_RAY")}set xRay(n){this.xRay!==n&&(n?this.defines.set("X_RAY","1"):this.defines.delete("X_RAY"),this.setChanged())}isXRayEnabled(){return this.xRay}setXRayEnabled(n){this.xRay=n}get patternTexture(){return this.uniforms.get("patternTexture").value}set patternTexture(n){n!==null?(n.wrapS=n.wrapT=Gs,this.defines.set("USE_PATTERN","1"),this.setVertexShader(g_)):(this.defines.delete("USE_PATTERN"),this.setVertexShader(null)),this.uniforms.get("patternTexture").value=n,this.setChanged()}setPatternTexture(n){this.patternTexture=n}getResolutionScale(){return this.resolution.scale}setResolutionScale(n){this.resolution.scale=n}setSelection(n){return this.selection.set(n),this}clearSelection(){return this.selection.clear(),this}selectObject(n){return this.selection.add(n),this}deselectObject(n){return this.selection.delete(n),this}update(n,e,t){const i=this.scene,s=this.camera,r=this.selection,a=this.uniforms.get("pulse"),l=i.background,g=s.layers.mask;r.size>0?(i.background=null,a.value=1,this.pulseSpeed>0&&(a.value=Math.cos(this.time*this.pulseSpeed*10)*.375+.625),this.active=!0,this.time+=t,r.setVisible(!1),this.depthPass.render(n),r.setVisible(!0),s.layers.set(r.layer),this.maskPass.render(n,this.renderTargetMask),s.layers.mask=g,i.background=l,this.outlinePass.render(n,null,this.renderTargetOutline),this.blurPass.enabled&&this.blurPass.render(n,this.renderTargetOutline,this.renderTargetOutline)):this.active&&(this.clearPass.render(n,this.renderTargetOutline),this.active=!1)}setSize(n,e){this.blurPass.setSize(n,e),this.renderTargetMask.setSize(n,e);const t=this.resolution;t.setBaseSize(n,e);const i=t.width,s=t.height;this.depthPass.setSize(i,s),this.renderTargetOutline.setSize(i,s),this.outlinePass.fullscreenMaterial.setSize(i,s)}initialize(n,e,t){this.blurPass.initialize(n,e,cn),t!==void 0&&(this.depthPass.initialize(n,e,t),this.maskPass.initialize(n,e,t),this.outlinePass.initialize(n,e,t))}},I_="uniform bool active;uniform vec4 d;void mainUv(inout vec2 uv){if(active){uv=d.xy*(floor(uv*d.zw)+0.5);}}",u_=class extends di{constructor(n=30){super("PixelationEffect",I_,{uniforms:new Map([["active",new ne(!1)],["d",new ne(new Yt)]])}),this.resolution=new oe,this._granularity=0,this.granularity=n}get granularity(){return this._granularity}set granularity(n){let e=Math.floor(n);e%2>0&&(e+=1),this._granularity=e,this.uniforms.get("active").value=e>0,this.setSize(this.resolution.width,this.resolution.height)}getGranularity(){return this.granularity}setGranularity(n){this.granularity=n}setSize(n,e){const t=this.resolution;t.set(n,e);const i=this.granularity,s=i/t.x,r=i/t.y;this.uniforms.get("d").value.set(s,r,1/s,1/r)}};new H;new H;var C_=class extends DP{constructor(n,e,t){super(t),this.setAttributes(this.getAttributes()|os.DEPTH),this.camera=e,this.depthPass=new ky(n,e),this.clearPass=new Yc(!0,!1,!1),this.clearPass.overrideClearColor=new Xe(0),this.depthMaskPass=new As(new XM);const i=this.depthMaskMaterial;i.copyCameraSettings(e),i.depthBuffer1=this.depthPass.texture,i.depthPacking1=Tr,i.depthMode=Vu,this.renderTargetMasked=new Nt(1,1,{depthBuffer:!1}),this.renderTargetMasked.texture.name="Bloom.Masked",this.selection=new Dy,this.selection.layer=11,this._inverted=!1,this._ignoreBackground=!1}set mainScene(n){this.depthPass.mainScene=n}set mainCamera(n){this.camera=n,this.depthPass.mainCamera=n,this.depthMaskMaterial.copyCameraSettings(n)}getSelection(){return this.selection}get depthMaskMaterial(){return this.depthMaskPass.fullscreenMaterial}get inverted(){return this._inverted}set inverted(n){this._inverted=n,this.depthMaskMaterial.depthMode=n?$A:Vu}isInverted(){return this.inverted}setInverted(n){this.inverted=n}get ignoreBackground(){return this._ignoreBackground}set ignoreBackground(n){this._ignoreBackground=n,this.depthMaskMaterial.maxDepthStrategy=n?lu.DISCARD_MAX_DEPTH:lu.KEEP_MAX_DEPTH}isBackgroundDisabled(){return this.ignoreBackground}setBackgroundDisabled(n){this.ignoreBackground=n}setDepthTexture(n,e=Tn){this.depthMaskMaterial.depthBuffer0=n,this.depthMaskMaterial.depthPacking0=e}update(n,e,t){const i=this.camera,s=this.selection,r=this.inverted;let o=e;if(this.ignoreBackground||!r||s.size>0){const a=i.layers.mask;i.layers.set(s.layer),this.depthPass.render(n),i.layers.mask=a,o=this.renderTargetMasked,this.clearPass.render(n,o),this.depthMaskPass.render(n,e,o)}super.update(n,o,t)}setSize(n,e){super.setSize(n,e),this.renderTargetMasked.setSize(n,e),this.depthPass.setSize(n,e)}initialize(n,e,t){super.initialize(n,e,t),this.clearPass.initialize(n,e,t),this.depthPass.initialize(n,e,t),this.depthMaskPass.initialize(n,e,t),t!==void 0&&(this.renderTargetMasked.texture.type=t,So(n)===jt&&Qn(this.renderTargetMasked.texture,jt))}},hS="data:image/png;base64,iVBORw0KGgoAAAANSUh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fUw+I+VPwiPPpqJjO8J1Nw43e7ymHwHoAKMFd7QErAeEE5NNJMb3R+z3lsGcNzgfgiPPpomJ6o/d76oGwPgCOKJ8uKqY3er+nKwBHmE+noqRG7/fUA199U/AI8+kEwEbv93QHoEhZTnA+nYqSGr3fBoAtaiqBUImdm5hPJwA2er+nKwBHnE+X1gUzSbnR+z11wPj/AeCpPDD3t7rvAAAAAElFTkSuQmCC",d_="uniform sampler2D weightMap;varying vec2 vOffset0;varying vec2 vOffset1;void movec(const in bvec2 c,inout vec2 variable,const in vec2 value){if(c.x){variable.x=value.x;}if(c.y){variable.y=value.y;}}void movec(const in bvec4 c,inout vec4 variable,const in vec4 value){movec(c.xy,variable.xy,value.xy);movec(c.zw,variable.zw,value.zw);}void mainImage(const in vec4 inputColor,const in vec2 uv,out vec4 outputColor){vec4 a;a.x=texture2D(weightMap,vOffset0).a;a.y=texture2D(weightMap,vOffset1).g;a.wz=texture2D(weightMap,uv).rb;vec4 color=inputColor;if(dot(a,vec4(1.0))>=1e-5){bool h=max(a.x,a.z)>max(a.y,a.w);vec4 blendingOffset=vec4(0.0,a.y,0.0,a.w);vec2 blendingWeight=a.yw;movec(bvec4(h),blendingOffset,vec4(a.x,0.0,a.z,0.0));movec(bvec2(h),blendingWeight,a.xz);blendingWeight/=dot(blendingWeight,vec2(1.0));vec4 blendingCoord=blendingOffset*vec4(texelSize,-texelSize)+uv.xyxy;color=blendingWeight.x*texture2D(inputBuffer,blendingCoord.xy);color+=blendingWeight.y*texture2D(inputBuffer,blendingCoord.zw);}outputColor=color;}",h_="varying vec2 vOffset0;varying vec2 vOffset1;void mainSupport(const in vec2 uv){vOffset0=uv+texelSize*vec2(1.0,0.0);vOffset1=uv+texelSize*vec2(0.0,1.0);}",A_=class extends di{constructor({blendFunction:n=ht.SRC,preset:e=WI.MEDIUM,edgeDetectionMode:t=NM.COLOR,predicationMode:i=sU.DISABLED}={}){super("SMAAEffect",d_,{vertexShader:h_,blendFunction:n,attributes:os.CONVOLUTION|os.DEPTH,uniforms:new Map([["weightMap",new ne(null)]])});let s,r;arguments.length>1&&(s=arguments[0],r=arguments[1],arguments.length>2&&(e=arguments[2]),arguments.length>3&&(t=arguments[3])),this.renderTargetEdges=new Nt(1,1,{depthBuffer:!1}),this.renderTargetEdges.texture.name="SMAA.Edges",this.renderTargetWeights=this.renderTargetEdges.clone(),this.renderTargetWeights.texture.name="SMAA.Weights",this.uniforms.get("weightMap").value=this.renderTargetWeights.texture,this.clearPass=new Yc(!0,!1,!1),this.clearPass.overrideClearColor=new Xe(0),this.clearPass.overrideClearAlpha=1,this.edgeDetectionPass=new As(new ZU),this.edgeDetectionMaterial.edgeDetectionMode=t,this.edgeDetectionMaterial.predicationMode=i,this.weightsPass=new As(new LU);const o=new pp;o.onLoad=()=>{const a=new sn(s);a.name="SMAA.Search",a.magFilter=vt,a.minFilter=vt,a.generateMipmaps=!1,a.needsUpdate=!0,a.flipY=!0,this.weightsMaterial.searchTexture=a;const l=new sn(r);l.name="SMAA.Area",l.magFilter=st,l.minFilter=st,l.generateMipmaps=!1,l.needsUpdate=!0,l.flipY=!1,this.weightsMaterial.areaTexture=l,this.dispatchEvent({type:"load"})},o.itemStart("search"),o.itemStart("area"),s!==void 0&&r!==void 0?(o.itemEnd("search"),o.itemEnd("area")):typeof Image<"u"&&(s=new Image,r=new Image,s.addEventListener("load",()=>o.itemEnd("search")),r.addEventListener("load",()=>o.itemEnd("area")),s.src=hS,r.src=AS),this.applyPreset(e)}get edgesTexture(){return this.renderTargetEdges.texture}getEdgesTexture(){return this.edgesTexture}get weightsTexture(){return this.renderTargetWeights.texture}getWeightsTexture(){return this.weightsTexture}get edgeDetectionMaterial(){return this.edgeDetectionPass.fullscreenMaterial}get colorEdgesMaterial(){return this.edgeDetectionMaterial}getEdgeDetectionMaterial(){return this.edgeDetectionMaterial}get weightsMaterial(){return this.weightsPass.fullscreenMaterial}getWeightsMaterial(){return this.weightsMaterial}setEdgeDetectionThreshold(n){this.edgeDetectionMaterial.edgeDetectionThreshold=n}setOrthogonalSearchSteps(n){this.weightsMaterial.orthogonalSearchSteps=n}applyPreset(n){const e=this.edgeDetectionMaterial,t=this.weightsMaterial;switch(n){case WI.LOW:e.edgeDetectionThreshold=.15,t.orthogonalSearchSteps=4,t.diagonalDetection=!1,t.cornerDetection=!1;break;case WI.MEDIUM:e.edgeDetectionThreshold=.1,t.orthogonalSearchSteps=8,t.diagonalDetection=!1,t.cornerDetection=!1;break;case WI.HIGH:e.edgeDetectionThreshold=.1,t.orthogonalSearchSteps=16,t.diagonalSearchSteps=8,t.cornerRounding=25,t.diagonalDetection=!0,t.cornerDetection=!0;break;case WI.ULTRA:e.edgeDetectionThreshold=.05,t.orthogonalSearchSteps=32,t.diagonalSearchSteps=16,t.cornerRounding=25,t.diagonalDetection=!0,t.cornerDetection=!0;break}}setDepthTexture(n,e=Tn){this.edgeDetectionMaterial.depthBuffer=n,this.edgeDetectionMaterial.depthPacking=e}update(n,e,t){this.clearPass.render(n,this.renderTargetEdges),this.edgeDetectionPass.render(n,e,this.renderTargetEdges),this.weightsPass.render(n,this.renderTargetEdges,this.renderTargetWeights)}setSize(n,e){this.edgeDetectionMaterial.setSize(n,e),this.weightsMaterial.setSize(n,e),this.renderTargetEdges.setSize(n,e),this.renderTargetWeights.setSize(n,e)}dispose(){const{searchTexture:n,areaTexture:e}=this.weightsMaterial;n!==null&&e!==null&&(n.dispose(),e.dispose()),super.dispose()}static get searchImageDataURL(){return hS}static get areaImageDataURL(){return AS}},p_=`uniform lowp sampler2D aoBuffer;uniform float luminanceInfluence;uniform float intensity; #if THREE_REVISION < 143 #define luminance(v) linearToRelativeLuminance(v) #endif @@ -4144,8 +4144,8 @@ vUv2=uv*vec2(aspect,1.0)*scale; #else vUv2=(uvTransform*vec3(uv,1.0)).xy; #endif -}`,v_=class extends di{constructor({blendFunction:n,texture:e=null,aspectCorrection:t=!1}={}){super("TextureEffect",m_,{blendFunction:n,defines:new Map([["TEXEL","texel"]]),uniforms:new Map([["map",new ne(null)],["scale",new ne(1)],["uvTransform",new ne(null)]])}),this.texture=e,this.aspectCorrection=t}get texture(){return this.uniforms.get("map").value}set texture(n){const e=this.texture,t=this.uniforms,i=this.defines;e!==n&&(t.get("map").value=n,t.get("uvTransform").value=n.matrix,i.delete("TEXTURE_PRECISION_HIGH"),n!==null&&(n.matrixAutoUpdate?(i.set("UV_TRANSFORM","1"),this.setVertexShader(b_)):(i.delete("UV_TRANSFORM"),this.setVertexShader(null)),n.type!==cn&&i.set("TEXTURE_PRECISION_HIGH","1"),(e===null||e.type!==n.type||e.encoding!==n.encoding)&&this.setChanged()))}getTexture(){return this.texture}setTexture(n){this.texture=n}get aspectCorrection(){return this.defines.has("ASPECT_CORRECTION")}set aspectCorrection(n){this.aspectCorrection!==n&&(n?this.defines.set("ASPECT_CORRECTION","1"):this.defines.delete("ASPECT_CORRECTION"),this.setChanged())}get uvTransform(){const n=this.texture;return n!==null&&n.matrixAutoUpdate}set uvTransform(n){const e=this.texture;e!==null&&(e.matrixAutoUpdate=n)}setTextureSwizzleRGBA(n,e=n,t=n,i=n){const s="rgba";let r="";(n!==Qg.RED||e!==Qg.GREEN||t!==Qg.BLUE||i!==Qg.ALPHA)&&(r=[".",s[n],s[e],s[t],s[i]].join("")),this.defines.set("TEXEL","texel"+r),this.setChanged()}update(n,e,t){this.texture.matrixAutoUpdate&&this.texture.updateMatrix()}};let WI;function y_(){var n;if(WI!==void 0)return WI;try{let e;const t=document.createElement("canvas");return WI=!!(window.WebGL2RenderingContext&&(e=t.getContext("webgl2"))),e&&((n=e.getExtension("WEBGL_lose_context"))==null||n.loseContext()),WI}catch{return WI=!1}}var G_=Object.defineProperty,B_=(n,e,t)=>e in n?G_(n,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):n[e]=t,Om=(n,e,t)=>(B_(n,typeof e!="symbol"?e+"":e,t),t);class Rh{constructor(e){Om(this,"camera",new Rc(-1,1,1,-1,0,1)),Om(this,"geometry",new Fl(2,2)),Om(this,"mesh"),this.mesh=new On(this.geometry,e)}get material(){return this.mesh.material}set material(e){this.mesh.material=e}dispose(){this.mesh.geometry.dispose()}render(e){e.render(this.mesh,this.camera)}}function gu(n,e,t){return e in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function Eb(n,e){(e==null||e>n.length)&&(e=n.length);for(var t=0,i=new Array(e);tMath.PI&&(t-=Math.PI*2),t}function zM(n,e){if(!(n instanceof e))throw new TypeError("Cannot call a class as a function")}var Fs=function n(e,t,i){var s=this;zM(this,n),gu(this,"dot2",function(r,o){return s.x*r+s.y*o}),gu(this,"dot3",function(r,o,a){return s.x*r+s.y*o+s.z*a}),this.x=e,this.y=t,this.z=i},N_=[new Fs(1,1,0),new Fs(-1,1,0),new Fs(1,-1,0),new Fs(-1,-1,0),new Fs(1,0,1),new Fs(-1,0,1),new Fs(1,0,-1),new Fs(-1,0,-1),new Fs(0,1,1),new Fs(0,-1,1),new Fs(0,1,-1),new Fs(0,-1,-1)],fS=[151,160,137,91,90,15,131,13,201,95,96,53,194,233,7,225,140,36,103,30,69,142,8,99,37,240,21,10,23,190,6,148,247,120,234,75,0,26,197,62,94,252,219,203,117,35,11,32,57,177,33,88,237,149,56,87,174,20,125,136,171,168,68,175,74,165,71,134,139,48,27,166,77,146,158,231,83,111,229,122,60,211,133,230,220,105,92,41,55,46,245,40,244,102,143,54,65,25,63,161,1,216,80,73,209,76,132,187,208,89,18,169,200,196,135,130,116,188,159,86,164,100,109,198,173,186,3,64,52,217,226,250,124,123,5,202,38,147,118,126,255,82,85,212,207,206,59,227,47,16,58,17,182,189,28,42,223,183,170,213,119,248,152,2,44,154,163,70,221,153,101,155,167,43,172,9,129,22,39,253,19,98,108,110,79,113,224,232,178,185,112,104,218,246,97,228,251,34,242,193,238,210,144,12,191,179,162,241,81,51,145,235,249,14,239,107,49,192,214,31,181,199,106,157,184,84,204,176,115,121,50,45,127,4,150,254,138,236,205,93,222,114,67,29,24,72,243,141,128,195,78,66,215,61,156,180],mS=new Array(512),bS=new Array(512),H_=function(e){e>0&&e<1&&(e*=65536),e=Math.floor(e),e<256&&(e|=e<<8);for(var t=0;t<256;t++){var i;t&1?i=fS[t]^e&255:i=fS[t]^e>>8&255,mS[t]=mS[t+256]=i,bS[t]=bS[t+256]=N_[i%12]}};H_(0);function X_(n){if(typeof n=="number")n=Math.abs(n);else if(typeof n=="string"){var e=n;n=0;for(var t=0;t1&&arguments[1]!==void 0?arguments[1]:.01,i=arguments.length>2&&arguments[2]!==void 0?arguments[2]:1,s=arguments.length>3&&arguments[3]!==void 0?arguments[3]:1/(2*Math.PI);return i/Math.atan(1/t)*Math.atan(Math.sin(2*Math.PI*e*s)/t)},LM=function(e){return 1/(1+e+.48*e*e+.235*e*e*e)};function jn(n,e,t){var i=arguments.length>3&&arguments[3]!==void 0?arguments[3]:.25,s=arguments.length>4&&arguments[4]!==void 0?arguments[4]:.01,r=arguments.length>5&&arguments[5]!==void 0?arguments[5]:1/0,o=arguments.length>6&&arguments[6]!==void 0?arguments[6]:LM,a=arguments.length>7&&arguments[7]!==void 0?arguments[7]:.001,l="velocity_"+e;if(n.__damp===void 0&&(n.__damp={}),n.__damp[l]===void 0&&(n.__damp[l]=0),Math.abs(n[e]-t)<=a)return n[e]=t,!1;i=Math.max(1e-4,i);var g=2/i,u=o(g*s),C=n[e]-t,d=t,h=r*i;C=Math.min(Math.max(C,-h),h),t=n[e]-C;var f=(n.__damp[l]+g*C)*s;n.__damp[l]=(n.__damp[l]-g*f)*u;var v=t+(C+f)*u;return d-n[e]>0==v>d&&(v=d,n.__damp[l]=(v-d)/s),n[e]=v,!0}function lc(n,e,t,i,s,r,o,a){return jn(n,e,n[e]+M_(n[e],t),i,s,r,o,a)}var VI=new oe,yS,GS;function K_(n,e,t,i,s,r,o){return typeof e=="number"?VI.setScalar(e):Array.isArray(e)?VI.set(e[0],e[1]):VI.copy(e),yS=jn(n,"x",VI.x,t,i,s,r,o),GS=jn(n,"y",VI.y,t,i,s,r,o),yS||GS}var Zg=new H,BS,ZS,wS;function Tb(n,e,t,i,s,r,o){return typeof e=="number"?Zg.setScalar(e):Array.isArray(e)?Zg.set(e[0],e[1],e[2]):Zg.copy(e),BS=jn(n,"x",Zg.x,t,i,s,r,o),ZS=jn(n,"y",Zg.y,t,i,s,r,o),wS=jn(n,"z",Zg.z,t,i,s,r,o),BS||ZS||wS}var Oa=new Yt,SS,xS,RS,WS;function z_(n,e,t,i,s,r,o){return typeof e=="number"?Oa.setScalar(e):Array.isArray(e)?Oa.set(e[0],e[1],e[2],e[3]):Oa.copy(e),SS=jn(n,"x",Oa.x,t,i,s,r,o),xS=jn(n,"y",Oa.y,t,i,s,r,o),RS=jn(n,"z",Oa.z,t,i,s,r,o),WS=jn(n,"w",Oa.w,t,i,s,r,o),SS||xS||RS||WS}var MI=new Xl,VS,MS,NS;function L_(n,e,t,i,s,r,o){return Array.isArray(e)?MI.set(e[0],e[1],e[2],e[3]):MI.copy(e),VS=lc(n,"x",MI.x,t,i,s,r,o),MS=lc(n,"y",MI.y,t,i,s,r,o),NS=lc(n,"z",MI.z,t,i,s,r,o),VS||MS||NS}var wg=new Xe,HS,XS,FS;function E_(n,e,t,i,s,r,o){return e instanceof Xe?wg.copy(e):Array.isArray(e)?wg.setRGB(e[0],e[1],e[2]):wg.set(e),HS=jn(n,"r",wg.r,t,i,s,r,o),XS=jn(n,"g",wg.g,t,i,s,r,o),FS=jn(n,"b",wg.b,t,i,s,r,o),HS||XS||FS}var ar=new Mn,ao=new Yt,YS=new Yt,NI=new Yt,KS,zS,LS,ES;function EM(n,e,t,i,s,r,o){var a=n;Array.isArray(e)?ar.set(e[0],e[1],e[2],e[3]):ar.copy(e);var l=n.dot(ar)>0?1:-1;return ar.x*=l,ar.y*=l,ar.z*=l,ar.w*=l,KS=jn(n,"x",ar.x,t,i,s,r,o),zS=jn(n,"y",ar.y,t,i,s,r,o),LS=jn(n,"z",ar.z,t,i,s,r,o),ES=jn(n,"w",ar.w,t,i,s,r,o),ao.set(n.x,n.y,n.z,n.w).normalize(),YS.set(a.__damp.velocity_x,a.__damp.velocity_y,a.__damp.velocity_z,a.__damp.velocity_w),NI.copy(ao).multiplyScalar(YS.dot(ao)/ao.dot(ao)),a.__damp.velocity_x-=NI.x,a.__damp.velocity_y-=NI.y,a.__damp.velocity_z-=NI.z,a.__damp.velocity_w-=NI.w,n.set(ao.x,ao.y,ao.z,ao.w),KS||zS||LS||ES}var HI=new HV,TS,kS,DS;function T_(n,e,t,i,s,r,o){return Array.isArray(e)?HI.set(e[0],e[1],e[2]):HI.copy(e),TS=jn(n,"radius",HI.radius,t,i,s,r,o),kS=lc(n,"phi",HI.phi,t,i,s,r,o),DS=lc(n,"theta",HI.theta,t,i,s,r,o),TS||kS||DS}var Wh=new _e,US=new H,PS=new Mn,_S=new H,JS,OS,QS;function k_(n,e,t,i,s,r,o){var a=n;return a.__damp===void 0&&(a.__damp={position:new H,rotation:new Mn,scale:new H},n.decompose(a.__damp.position,a.__damp.rotation,a.__damp.scale)),Array.isArray(e)?Wh.set.apply(Wh,R_(e)):Wh.copy(e),Wh.decompose(US,PS,_S),JS=Tb(a.__damp.position,US,t,i,s,r,o),OS=EM(a.__damp.rotation,PS,t,i,s,r,o),QS=Tb(a.__damp.scale,_S,t,i,s,r,o),n.compose(a.__damp.position,a.__damp.rotation,a.__damp.scale),JS||OS||QS}var D_=Object.freeze({__proto__:null,rsqw:Y_,exp:LM,damp:jn,dampAngle:lc,damp2:K_,damp3:Tb,damp4:z_,dampE:L_,dampC:E_,dampQ:EM,dampS:T_,dampM:k_});function kb(){return kb=Object.assign?Object.assign.bind():function(n){for(var e=1;ee in n?G_(n,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):n[e]=t,Om=(n,e,t)=>(B_(n,typeof e!="symbol"?e+"":e,t),t);class Rh{constructor(e){Om(this,"camera",new Wc(-1,1,1,-1,0,1)),Om(this,"geometry",new Fl(2,2)),Om(this,"mesh"),this.mesh=new On(this.geometry,e)}get material(){return this.mesh.material}set material(e){this.mesh.material=e}dispose(){this.mesh.geometry.dispose()}render(e){e.render(this.mesh,this.camera)}}function cu(n,e,t){return e in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function Eb(n,e){(e==null||e>n.length)&&(e=n.length);for(var t=0,i=new Array(e);tMath.PI&&(t-=Math.PI*2),t}function zM(n,e){if(!(n instanceof e))throw new TypeError("Cannot call a class as a function")}var Fs=function n(e,t,i){var s=this;zM(this,n),cu(this,"dot2",function(r,o){return s.x*r+s.y*o}),cu(this,"dot3",function(r,o,a){return s.x*r+s.y*o+s.z*a}),this.x=e,this.y=t,this.z=i},N_=[new Fs(1,1,0),new Fs(-1,1,0),new Fs(1,-1,0),new Fs(-1,-1,0),new Fs(1,0,1),new Fs(-1,0,1),new Fs(1,0,-1),new Fs(-1,0,-1),new Fs(0,1,1),new Fs(0,-1,1),new Fs(0,1,-1),new Fs(0,-1,-1)],fS=[151,160,137,91,90,15,131,13,201,95,96,53,194,233,7,225,140,36,103,30,69,142,8,99,37,240,21,10,23,190,6,148,247,120,234,75,0,26,197,62,94,252,219,203,117,35,11,32,57,177,33,88,237,149,56,87,174,20,125,136,171,168,68,175,74,165,71,134,139,48,27,166,77,146,158,231,83,111,229,122,60,211,133,230,220,105,92,41,55,46,245,40,244,102,143,54,65,25,63,161,1,216,80,73,209,76,132,187,208,89,18,169,200,196,135,130,116,188,159,86,164,100,109,198,173,186,3,64,52,217,226,250,124,123,5,202,38,147,118,126,255,82,85,212,207,206,59,227,47,16,58,17,182,189,28,42,223,183,170,213,119,248,152,2,44,154,163,70,221,153,101,155,167,43,172,9,129,22,39,253,19,98,108,110,79,113,224,232,178,185,112,104,218,246,97,228,251,34,242,193,238,210,144,12,191,179,162,241,81,51,145,235,249,14,239,107,49,192,214,31,181,199,106,157,184,84,204,176,115,121,50,45,127,4,150,254,138,236,205,93,222,114,67,29,24,72,243,141,128,195,78,66,215,61,156,180],mS=new Array(512),bS=new Array(512),H_=function(e){e>0&&e<1&&(e*=65536),e=Math.floor(e),e<256&&(e|=e<<8);for(var t=0;t<256;t++){var i;t&1?i=fS[t]^e&255:i=fS[t]^e>>8&255,mS[t]=mS[t+256]=i,bS[t]=bS[t+256]=N_[i%12]}};H_(0);function X_(n){if(typeof n=="number")n=Math.abs(n);else if(typeof n=="string"){var e=n;n=0;for(var t=0;t1&&arguments[1]!==void 0?arguments[1]:.01,i=arguments.length>2&&arguments[2]!==void 0?arguments[2]:1,s=arguments.length>3&&arguments[3]!==void 0?arguments[3]:1/(2*Math.PI);return i/Math.atan(1/t)*Math.atan(Math.sin(2*Math.PI*e*s)/t)},LM=function(e){return 1/(1+e+.48*e*e+.235*e*e*e)};function jn(n,e,t){var i=arguments.length>3&&arguments[3]!==void 0?arguments[3]:.25,s=arguments.length>4&&arguments[4]!==void 0?arguments[4]:.01,r=arguments.length>5&&arguments[5]!==void 0?arguments[5]:1/0,o=arguments.length>6&&arguments[6]!==void 0?arguments[6]:LM,a=arguments.length>7&&arguments[7]!==void 0?arguments[7]:.001,l="velocity_"+e;if(n.__damp===void 0&&(n.__damp={}),n.__damp[l]===void 0&&(n.__damp[l]=0),Math.abs(n[e]-t)<=a)return n[e]=t,!1;i=Math.max(1e-4,i);var g=2/i,u=o(g*s),C=n[e]-t,d=t,h=r*i;C=Math.min(Math.max(C,-h),h),t=n[e]-C;var f=(n.__damp[l]+g*C)*s;n.__damp[l]=(n.__damp[l]-g*f)*u;var v=t+(C+f)*u;return d-n[e]>0==v>d&&(v=d,n.__damp[l]=(v-d)/s),n[e]=v,!0}function lc(n,e,t,i,s,r,o,a){return jn(n,e,n[e]+M_(n[e],t),i,s,r,o,a)}var MI=new oe,yS,GS;function K_(n,e,t,i,s,r,o){return typeof e=="number"?MI.setScalar(e):Array.isArray(e)?MI.set(e[0],e[1]):MI.copy(e),yS=jn(n,"x",MI.x,t,i,s,r,o),GS=jn(n,"y",MI.y,t,i,s,r,o),yS||GS}var Zg=new H,BS,ZS,wS;function Tb(n,e,t,i,s,r,o){return typeof e=="number"?Zg.setScalar(e):Array.isArray(e)?Zg.set(e[0],e[1],e[2]):Zg.copy(e),BS=jn(n,"x",Zg.x,t,i,s,r,o),ZS=jn(n,"y",Zg.y,t,i,s,r,o),wS=jn(n,"z",Zg.z,t,i,s,r,o),BS||ZS||wS}var Oa=new Yt,SS,xS,RS,WS;function z_(n,e,t,i,s,r,o){return typeof e=="number"?Oa.setScalar(e):Array.isArray(e)?Oa.set(e[0],e[1],e[2],e[3]):Oa.copy(e),SS=jn(n,"x",Oa.x,t,i,s,r,o),xS=jn(n,"y",Oa.y,t,i,s,r,o),RS=jn(n,"z",Oa.z,t,i,s,r,o),WS=jn(n,"w",Oa.w,t,i,s,r,o),SS||xS||RS||WS}var NI=new Xl,VS,MS,NS;function L_(n,e,t,i,s,r,o){return Array.isArray(e)?NI.set(e[0],e[1],e[2],e[3]):NI.copy(e),VS=lc(n,"x",NI.x,t,i,s,r,o),MS=lc(n,"y",NI.y,t,i,s,r,o),NS=lc(n,"z",NI.z,t,i,s,r,o),VS||MS||NS}var wg=new Xe,HS,XS,FS;function E_(n,e,t,i,s,r,o){return e instanceof Xe?wg.copy(e):Array.isArray(e)?wg.setRGB(e[0],e[1],e[2]):wg.set(e),HS=jn(n,"r",wg.r,t,i,s,r,o),XS=jn(n,"g",wg.g,t,i,s,r,o),FS=jn(n,"b",wg.b,t,i,s,r,o),HS||XS||FS}var ar=new Mn,ao=new Yt,YS=new Yt,HI=new Yt,KS,zS,LS,ES;function EM(n,e,t,i,s,r,o){var a=n;Array.isArray(e)?ar.set(e[0],e[1],e[2],e[3]):ar.copy(e);var l=n.dot(ar)>0?1:-1;return ar.x*=l,ar.y*=l,ar.z*=l,ar.w*=l,KS=jn(n,"x",ar.x,t,i,s,r,o),zS=jn(n,"y",ar.y,t,i,s,r,o),LS=jn(n,"z",ar.z,t,i,s,r,o),ES=jn(n,"w",ar.w,t,i,s,r,o),ao.set(n.x,n.y,n.z,n.w).normalize(),YS.set(a.__damp.velocity_x,a.__damp.velocity_y,a.__damp.velocity_z,a.__damp.velocity_w),HI.copy(ao).multiplyScalar(YS.dot(ao)/ao.dot(ao)),a.__damp.velocity_x-=HI.x,a.__damp.velocity_y-=HI.y,a.__damp.velocity_z-=HI.z,a.__damp.velocity_w-=HI.w,n.set(ao.x,ao.y,ao.z,ao.w),KS||zS||LS||ES}var XI=new HV,TS,kS,DS;function T_(n,e,t,i,s,r,o){return Array.isArray(e)?XI.set(e[0],e[1],e[2]):XI.copy(e),TS=jn(n,"radius",XI.radius,t,i,s,r,o),kS=lc(n,"phi",XI.phi,t,i,s,r,o),DS=lc(n,"theta",XI.theta,t,i,s,r,o),TS||kS||DS}var Wh=new _e,US=new H,PS=new Mn,_S=new H,JS,OS,QS;function k_(n,e,t,i,s,r,o){var a=n;return a.__damp===void 0&&(a.__damp={position:new H,rotation:new Mn,scale:new H},n.decompose(a.__damp.position,a.__damp.rotation,a.__damp.scale)),Array.isArray(e)?Wh.set.apply(Wh,R_(e)):Wh.copy(e),Wh.decompose(US,PS,_S),JS=Tb(a.__damp.position,US,t,i,s,r,o),OS=EM(a.__damp.rotation,PS,t,i,s,r,o),QS=Tb(a.__damp.scale,_S,t,i,s,r,o),n.compose(a.__damp.position,a.__damp.rotation,a.__damp.scale),JS||OS||QS}var D_=Object.freeze({__proto__:null,rsqw:Y_,exp:LM,damp:jn,dampAngle:lc,damp2:K_,damp3:Tb,damp4:z_,dampE:L_,dampC:E_,dampQ:EM,dampS:T_,dampM:k_});function kb(){return kb=Object.assign?Object.assign.bind():function(n){for(var e=1;e",TM),vertexShader:O_,toneMapped:!1,depthWrite:!1,depthTest:!1})}}const kM=n=>{const e=[n],t=[];for(;e.length!==0;){const i=e.shift();i.material&&t.push(i);for(const s of i.children)s.visible&&e.push(s)}return t},q_=n=>{const e=n.envMapCubeUVHeight;if(e===null)return null;const t=Math.log2(e)-2,i=1/e;return{texelWidth:1/(3*Math.max(Math.pow(2,t),7*16)),texelHeight:i,maxMip:t}},jS=(n,e,t)=>{n.uniforms.envMap.value=e;const i=q_({envMapCubeUVHeight:t});n.defines.ENVMAP_TYPE_CUBE_UV="",n.defines.CUBEUV_TEXEL_WIDTH=i.texelWidth,n.defines.CUBEUV_TEXEL_HEIGHT=i.texelHeight,n.defines.CUBEUV_MAX_MIP=i.maxMip+".0",n.needsUpdate=!0},$_=()=>{try{const n=document.createElement("canvas");return!!(window.WebGL2RenderingContext&&n.getContext("webgl2"))}catch{return!1}};class eJ extends Nn{constructor(e,t={}){super("ReflectionsPass"),this.ssrEffect=void 0,this.cachedMaterials=new WeakMap,this.USE_MRT=!1,this.webgl1DepthPass=null,this.visibleMeshes=[],this.ssrEffect=e,this._scene=e._scene,this._camera=e._camera,this.fullscreenMaterial=new j_,e._camera.isPerspectiveCamera&&(this.fullscreenMaterial.defines.PERSPECTIVE_CAMERA="");const i=t.width||typeof window<"u"?window.innerWidth:2e3,s=t.height||typeof window<"u"?window.innerHeight:1e3;this.renderTarget=new Nt(i,s,{minFilter:st,magFilter:st,type:bs,depthBuffer:!1}),this.renderPass=new Yc(this._scene,this._camera),this.USE_MRT=$_(),this.USE_MRT?(this.gBuffersRenderTarget=new MW(i,s,2,{minFilter:st,magFilter:st}),this.normalTexture=this.gBuffersRenderTarget.texture[0],this.depthTexture=this.gBuffersRenderTarget.texture[1]):(this.webgl1DepthPass=new ky(this._scene,this._camera),this.webgl1DepthPass.renderTarget.minFilter=st,this.webgl1DepthPass.renderTarget.magFilter=st,this.webgl1DepthPass.renderTarget.texture.minFilter=st,this.webgl1DepthPass.renderTarget.texture.magFilter=st,this.webgl1DepthPass.setSize(typeof window<"u"?window.innerWidth:2e3,typeof window<"u"?window.innerHeight:1e3),this.gBuffersRenderTarget=new Nt(i,s,{minFilter:st,magFilter:st}),this.normalTexture=this.gBuffersRenderTarget.texture,this.depthTexture=this.webgl1DepthPass.texture),this.fullscreenMaterial.uniforms.normalTexture.value=this.normalTexture,this.fullscreenMaterial.uniforms.depthTexture.value=this.depthTexture,this.fullscreenMaterial.uniforms.accumulatedTexture.value=this.ssrEffect.temporalResolvePass.accumulatedTexture,this.fullscreenMaterial.uniforms.cameraMatrixWorld.value=this._camera.matrixWorld,this.fullscreenMaterial.uniforms._projectionMatrix.value=this._camera.projectionMatrix,this.fullscreenMaterial.uniforms._inverseProjectionMatrix.value=this._camera.projectionMatrixInverse}setSize(e,t){this.renderTarget.setSize(e*this.ssrEffect.resolutionScale,t*this.ssrEffect.resolutionScale),this.gBuffersRenderTarget.setSize(e*this.ssrEffect.resolutionScale,t*this.ssrEffect.resolutionScale),this.fullscreenMaterial.uniforms.accumulatedTexture.value=this.ssrEffect.temporalResolvePass.accumulatedTexture,this.fullscreenMaterial.needsUpdate=!0}dispose(){this.renderTarget.dispose(),this.gBuffersRenderTarget.dispose(),this.renderPass.dispose(),this.USE_MRT||this.webgl1DepthPass.dispose(),this.fullscreenMaterial.dispose(),this.normalTexture=null,this.depthTexture=null,this.velocityTexture=null}keepMaterialMapUpdated(e,t,i,s){this.ssrEffect[s]?t[i]!==e[i]&&(e[i]=t[i],e.uniforms[i].value=t[i],t[i]?e.defines[s]="":delete e.defines[s],e.needsUpdate=!0):e[i]!==void 0&&(e[i]=void 0,e.uniforms[i].value=void 0,delete e.defines[s],e.needsUpdate=!0)}setMRTMaterialInScene(){this.visibleMeshes=kM(this._scene);for(const e of this.visibleMeshes)if(e.material){const t=e.material;let[i,s]=this.cachedMaterials.get(e)||[];if(t!==i){s&&s.dispose(),s=new J_,this.USE_MRT&&(s.defines.USE_MRT=""),s.normalScale=t.normalScale,s.uniforms.normalScale.value=t.normalScale;const r=t.map||t.normalMap||t.roughnessMap||t.metalnessMap;r&&(s.uniforms.uvTransform.value=r.matrix),this.cachedMaterials.set(e,[t,s])}this.keepMaterialMapUpdated(s,t,"normalMap","useNormalMap"),this.keepMaterialMapUpdated(s,t,"roughnessMap","useRoughnessMap"),s.uniforms.roughness.value=this.ssrEffect.selection.size===0||this.ssrEffect.selection.has(e)?t.roughness||0:1e11,e.material=s}}unsetMRTMaterialInScene(){for(const t of this.visibleMeshes){var e;if(((e=t.material)==null?void 0:e.type)==="MRTMaterial"){t.visible=!0;const[i]=this.cachedMaterials.get(t);t.material=i}}}render(e,t){this.setMRTMaterialInScene(),e.setRenderTarget(this.gBuffersRenderTarget),this.renderPass.render(e,this.gBuffersRenderTarget),this.unsetMRTMaterialInScene(),this.USE_MRT||this.webgl1DepthPass.renderPass.render(e,this.webgl1DepthPass.renderTarget),this.fullscreenMaterial.uniforms.inputTexture.value=t.texture,this.fullscreenMaterial.uniforms.samples.value=this.ssrEffect.temporalResolvePass.samples,this.fullscreenMaterial.uniforms.cameraNear.value=this._camera.near,this.fullscreenMaterial.uniforms.cameraFar.value=this._camera.far,this.fullscreenMaterial.uniforms.viewMatrix.value.copy(this._camera.matrixWorldInverse),e.setRenderTarget(this.renderTarget),e.render(this.scene,this.camera)}}const qS={intensity:1,exponent:1,distance:10,fade:0,roughnessFade:1,thickness:10,ior:1.45,maxRoughness:1,maxDepthDifference:10,blend:.9,correction:1,correctionRadius:1,blur:.5,blurKernel:1,blurSharpness:10,jitter:0,jitterRoughness:0,steps:20,refineSteps:5,missedRays:!0,useNormalMap:!0,useRoughnessMap:!0,resolutionScale:1,velocityResolutionScale:1};var tJ=`#define GLSLIFY 1 +}`;class j_ extends Rt{constructor(){super({type:"ReflectionsMaterial",uniforms:{inputTexture:new ne(null),accumulatedTexture:new ne(null),normalTexture:new ne(null),depthTexture:new ne(null),_projectionMatrix:new ne(new _e),_inverseProjectionMatrix:new ne(new _e),cameraMatrixWorld:new ne(new _e),cameraNear:new ne(0),cameraFar:new ne(0),rayDistance:new ne(0),intensity:new ne(0),roughnessFade:new ne(0),fade:new ne(0),thickness:new ne(0),ior:new ne(0),maxDepthDifference:new ne(0),jitter:new ne(0),jitterRoughness:new ne(0),maxRoughness:new ne(0),samples:new ne(0),envMap:new ne(null),envMapPosition:new ne(new H),envMapSize:new ne(new H),viewMatrix:new ne(new _e)},defines:{steps:20,refineSteps:5,CUBEUV_TEXEL_WIDTH:0,CUBEUV_TEXEL_HEIGHT:0,CUBEUV_MAX_MIP:0,vWorldPosition:"worldPos"},fragmentShader:Q_.replace("#include ",TM),vertexShader:O_,toneMapped:!1,depthWrite:!1,depthTest:!1})}}const kM=n=>{const e=[n],t=[];for(;e.length!==0;){const i=e.shift();i.material&&t.push(i);for(const s of i.children)s.visible&&e.push(s)}return t},q_=n=>{const e=n.envMapCubeUVHeight;if(e===null)return null;const t=Math.log2(e)-2,i=1/e;return{texelWidth:1/(3*Math.max(Math.pow(2,t),7*16)),texelHeight:i,maxMip:t}},jS=(n,e,t)=>{n.uniforms.envMap.value=e;const i=q_({envMapCubeUVHeight:t});n.defines.ENVMAP_TYPE_CUBE_UV="",n.defines.CUBEUV_TEXEL_WIDTH=i.texelWidth,n.defines.CUBEUV_TEXEL_HEIGHT=i.texelHeight,n.defines.CUBEUV_MAX_MIP=i.maxMip+".0",n.needsUpdate=!0},$_=()=>{try{const n=document.createElement("canvas");return!!(window.WebGL2RenderingContext&&n.getContext("webgl2"))}catch{return!1}};class eJ extends Nn{constructor(e,t={}){super("ReflectionsPass"),this.ssrEffect=void 0,this.cachedMaterials=new WeakMap,this.USE_MRT=!1,this.webgl1DepthPass=null,this.visibleMeshes=[],this.ssrEffect=e,this._scene=e._scene,this._camera=e._camera,this.fullscreenMaterial=new j_,e._camera.isPerspectiveCamera&&(this.fullscreenMaterial.defines.PERSPECTIVE_CAMERA="");const i=t.width||typeof window<"u"?window.innerWidth:2e3,s=t.height||typeof window<"u"?window.innerHeight:1e3;this.renderTarget=new Nt(i,s,{minFilter:st,magFilter:st,type:bs,depthBuffer:!1}),this.renderPass=new Kc(this._scene,this._camera),this.USE_MRT=$_(),this.USE_MRT?(this.gBuffersRenderTarget=new MW(i,s,2,{minFilter:st,magFilter:st}),this.normalTexture=this.gBuffersRenderTarget.texture[0],this.depthTexture=this.gBuffersRenderTarget.texture[1]):(this.webgl1DepthPass=new ky(this._scene,this._camera),this.webgl1DepthPass.renderTarget.minFilter=st,this.webgl1DepthPass.renderTarget.magFilter=st,this.webgl1DepthPass.renderTarget.texture.minFilter=st,this.webgl1DepthPass.renderTarget.texture.magFilter=st,this.webgl1DepthPass.setSize(typeof window<"u"?window.innerWidth:2e3,typeof window<"u"?window.innerHeight:1e3),this.gBuffersRenderTarget=new Nt(i,s,{minFilter:st,magFilter:st}),this.normalTexture=this.gBuffersRenderTarget.texture,this.depthTexture=this.webgl1DepthPass.texture),this.fullscreenMaterial.uniforms.normalTexture.value=this.normalTexture,this.fullscreenMaterial.uniforms.depthTexture.value=this.depthTexture,this.fullscreenMaterial.uniforms.accumulatedTexture.value=this.ssrEffect.temporalResolvePass.accumulatedTexture,this.fullscreenMaterial.uniforms.cameraMatrixWorld.value=this._camera.matrixWorld,this.fullscreenMaterial.uniforms._projectionMatrix.value=this._camera.projectionMatrix,this.fullscreenMaterial.uniforms._inverseProjectionMatrix.value=this._camera.projectionMatrixInverse}setSize(e,t){this.renderTarget.setSize(e*this.ssrEffect.resolutionScale,t*this.ssrEffect.resolutionScale),this.gBuffersRenderTarget.setSize(e*this.ssrEffect.resolutionScale,t*this.ssrEffect.resolutionScale),this.fullscreenMaterial.uniforms.accumulatedTexture.value=this.ssrEffect.temporalResolvePass.accumulatedTexture,this.fullscreenMaterial.needsUpdate=!0}dispose(){this.renderTarget.dispose(),this.gBuffersRenderTarget.dispose(),this.renderPass.dispose(),this.USE_MRT||this.webgl1DepthPass.dispose(),this.fullscreenMaterial.dispose(),this.normalTexture=null,this.depthTexture=null,this.velocityTexture=null}keepMaterialMapUpdated(e,t,i,s){this.ssrEffect[s]?t[i]!==e[i]&&(e[i]=t[i],e.uniforms[i].value=t[i],t[i]?e.defines[s]="":delete e.defines[s],e.needsUpdate=!0):e[i]!==void 0&&(e[i]=void 0,e.uniforms[i].value=void 0,delete e.defines[s],e.needsUpdate=!0)}setMRTMaterialInScene(){this.visibleMeshes=kM(this._scene);for(const e of this.visibleMeshes)if(e.material){const t=e.material;let[i,s]=this.cachedMaterials.get(e)||[];if(t!==i){s&&s.dispose(),s=new J_,this.USE_MRT&&(s.defines.USE_MRT=""),s.normalScale=t.normalScale,s.uniforms.normalScale.value=t.normalScale;const r=t.map||t.normalMap||t.roughnessMap||t.metalnessMap;r&&(s.uniforms.uvTransform.value=r.matrix),this.cachedMaterials.set(e,[t,s])}this.keepMaterialMapUpdated(s,t,"normalMap","useNormalMap"),this.keepMaterialMapUpdated(s,t,"roughnessMap","useRoughnessMap"),s.uniforms.roughness.value=this.ssrEffect.selection.size===0||this.ssrEffect.selection.has(e)?t.roughness||0:1e11,e.material=s}}unsetMRTMaterialInScene(){for(const t of this.visibleMeshes){var e;if(((e=t.material)==null?void 0:e.type)==="MRTMaterial"){t.visible=!0;const[i]=this.cachedMaterials.get(t);t.material=i}}}render(e,t){this.setMRTMaterialInScene(),e.setRenderTarget(this.gBuffersRenderTarget),this.renderPass.render(e,this.gBuffersRenderTarget),this.unsetMRTMaterialInScene(),this.USE_MRT||this.webgl1DepthPass.renderPass.render(e,this.webgl1DepthPass.renderTarget),this.fullscreenMaterial.uniforms.inputTexture.value=t.texture,this.fullscreenMaterial.uniforms.samples.value=this.ssrEffect.temporalResolvePass.samples,this.fullscreenMaterial.uniforms.cameraNear.value=this._camera.near,this.fullscreenMaterial.uniforms.cameraFar.value=this._camera.far,this.fullscreenMaterial.uniforms.viewMatrix.value.copy(this._camera.matrixWorldInverse),e.setRenderTarget(this.renderTarget),e.render(this.scene,this.camera)}}const qS={intensity:1,exponent:1,distance:10,fade:0,roughnessFade:1,thickness:10,ior:1.45,maxRoughness:1,maxDepthDifference:10,blend:.9,correction:1,correctionRadius:1,blur:.5,blurKernel:1,blurSharpness:10,jitter:0,jitterRoughness:0,steps:20,refineSteps:5,missedRays:!0,useNormalMap:!0,useRoughnessMap:!0,resolutionScale:1,velocityResolutionScale:1};var tJ=`#define GLSLIFY 1 varying vec2 vUv;void main(){vUv=position.xy*0.5+0.5;gl_Position=vec4(position.xy,1.0,1.0);}`,nJ=`#define GLSLIFY 1 uniform sampler2D inputTexture;uniform sampler2D accumulatedTexture;uniform sampler2D velocityTexture;uniform sampler2D lastVelocityTexture;uniform float blend;uniform float correction;uniform float exponent;uniform float samples;uniform vec2 invTexSize;uniform mat4 curInverseProjectionMatrix;uniform mat4 curCameraMatrixWorld;uniform mat4 prevInverseProjectionMatrix;uniform mat4 prevCameraMatrixWorld;varying vec2 vUv; #define MAX_NEIGHBOR_DEPTH_DIFFERENCE 0.001 @@ -4484,7 +4484,7 @@ gl_FragColor=vec4(undoColorTransform(outputColor),alpha);}`;class iJ extends Rt{ `+n.vertexShader.replace("#include ",uJ),n.fragmentShader=CJ+` `+n.fragmentShader.replace("#include ",gt.envmap_physical_pars_fragment).replace(i,`vec3 worldNormal = inverseTransformDirection( normal, viewMatrix ); ${dJ}`).replace(s,`reflectVec = inverseTransformDirection( reflectVec, viewMatrix ); - ${hJ}`)}const pJ=P_.replace("#include ",TM).replace("#include ",U_),fJ=["blur","blurSharpness","blurKernel"],mJ=new sp(1);let Vh;class bJ extends di{constructor(e,t,i=qS){super("SSREffect",pJ,{type:"FinalSSRMaterial",uniforms:new Map([["reflectionsTexture",new ne(null)],["blur",new ne(0)],["blurSharpness",new ne(0)],["blurKernel",new ne(0)]]),defines:new Map([["RENDER_MODE","0"]])}),this.haltonSequence=IJ(1024),this.haltonIndex=0,this.selection=new Dy,this.lastSize=void 0,this.cubeCamera=new gy(.001,1e3,mJ),this.usingBoxProjectedEnvMap=!1,this._scene=e,this._camera=t,i=kb({},qS,i,{boxBlur:!0,dilation:!0}),this.temporalResolvePass=new cJ(e,t,__,i),this.uniforms.get("reflectionsTexture").value=this.temporalResolvePass.renderTarget.texture,this.reflectionsPass=new eJ(this,i),this.temporalResolvePass.fullscreenMaterial.uniforms.inputTexture.value=this.reflectionsPass.renderTarget.texture,this.lastSize={width:i.width,height:i.height,resolutionScale:i.resolutionScale,velocityResolutionScale:i.velocityResolutionScale},this.setSize(i.width,i.height),this.makeOptionsReactive(i)}makeOptionsReactive(e){let t=!1;const i=this.reflectionsPass.fullscreenMaterial.uniforms,s=Object.keys(i);for(const r of Object.keys(e))Object.defineProperty(this,r,{get(){return e[r]},set(o){if(!(e[r]===o&&t))switch(e[r]=o,fJ.includes(r)||this.setSize(this.lastSize.width,this.lastSize.height,!0),r){case"resolutionScale":this.setSize(this.lastSize.width,this.lastSize.height);break;case"velocityResolutionScale":this.temporalResolvePass.velocityResolutionScale=o,this.setSize(this.lastSize.width,this.lastSize.height,!0);break;case"blur":this.uniforms.get("blur").value=o;break;case"blurSharpness":this.uniforms.get("blurSharpness").value=o;break;case"blurKernel":this.uniforms.get("blurKernel").value=o;break;case"steps":this.reflectionsPass.fullscreenMaterial.defines.steps=parseInt(o),this.reflectionsPass.fullscreenMaterial.needsUpdate=t;break;case"refineSteps":this.reflectionsPass.fullscreenMaterial.defines.refineSteps=parseInt(o),this.reflectionsPass.fullscreenMaterial.needsUpdate=t;break;case"missedRays":o?this.reflectionsPass.fullscreenMaterial.defines.missedRays="":delete this.reflectionsPass.fullscreenMaterial.defines.missedRays,this.reflectionsPass.fullscreenMaterial.needsUpdate=t;break;case"correctionRadius":this.temporalResolvePass.fullscreenMaterial.defines.correctionRadius=Math.round(o),this.temporalResolvePass.fullscreenMaterial.needsUpdate=t;break;case"blend":this.temporalResolvePass.fullscreenMaterial.uniforms.blend.value=o;break;case"correction":this.temporalResolvePass.fullscreenMaterial.uniforms.correction.value=o;break;case"exponent":this.temporalResolvePass.fullscreenMaterial.uniforms.exponent.value=o;break;case"distance":i.rayDistance.value=o;default:s.includes(r)&&(i[r].value=o)}}}),this[r]=e[r];t=!0}setSize(e,t,i=!1){!i&&e===this.lastSize.width&&t===this.lastSize.height&&this.resolutionScale===this.lastSize.resolutionScale&&this.velocityResolutionScale===this.lastSize.velocityResolutionScale||(this.temporalResolvePass.setSize(e,t),this.reflectionsPass.setSize(e,t),this.lastSize={width:e,height:t,resolutionScale:this.resolutionScale,velocityResolutionScale:this.velocityResolutionScale})}generateBoxProjectedEnvMapFallback(e,t=new H,i=new H,s=512){this.cubeCamera.renderTarget.dispose(),this.cubeCamera.renderTarget=new sp(s),this.cubeCamera.position.copy(t),this.cubeCamera.updateMatrixWorld(),this.cubeCamera.update(e,this._scene),Vh||(Vh=new WA(e),Vh.compileCubemapShader());const r=Vh.fromCubemap(this.cubeCamera.renderTarget.texture).texture;r.minFilter=st,r.magFilter=st;const o=this.reflectionsPass.fullscreenMaterial;return AJ(o,t,i),o.fragmentShader=o.fragmentShader.replace("vec3 worldPos","worldPos").replace("varying vec3 vWorldPosition;","vec3 worldPos;"),o.uniforms.envMapPosition.value.copy(t),o.uniforms.envMapSize.value.copy(i),jS(o,r,s),this.usingBoxProjectedEnvMap=!0,r}setIBLRadiance(e,t){this._scene.traverse(i=>{if(i.material){var s;const r=(s=t.properties.get(i.material))==null?void 0:s.uniforms;r&&"disableIBLRadiance"in r&&(r.disableIBLRadiance.value=e)}})}deleteBoxProjectedEnvMapFallback(){const e=this.reflectionsPass.fullscreenMaterial;e.uniforms.envMap.value=null,e.fragmentShader=e.fragmentShader.replace("worldPos = ","vec3 worldPos = "),delete e.defines.BOX_PROJECTED_ENV_MAP,e.needsUpdate=!0,this.usingBoxProjectedEnvMap=!1}dispose(){super.dispose(),this.reflectionsPass.dispose(),this.temporalResolvePass.dispose()}update(e,t){if(!this.usingBoxProjectedEnvMap&&this._scene.environment){const a=this.reflectionsPass.fullscreenMaterial;let l=null;if(this._scene.traverse(g=>{if(!l&&g.material&&!g.material.envMap){const u=e.properties.get(g.material);"envMap"in u&&u.envMap instanceof sn&&(l=u.envMap)}}),l){const g=this._scene.environment.image.height;jS(a,l,g)}}this.haltonIndex=(this.haltonIndex+1)%this.haltonSequence.length;const[i,s]=this.haltonSequence[this.haltonIndex],{width:r,height:o}=this.lastSize;this.temporalResolvePass.velocityPass.render(e),this._camera.setViewOffset&&this._camera.setViewOffset(r,o,i,s,r,o),this.reflectionsPass.render(e,t),this.temporalResolvePass.render(e),this._camera.clearViewOffset()}static patchDirectEnvIntensity(e=0){e===0?gt.envmap_physical_pars_fragment=gt.envmap_physical_pars_fragment.replace("vec3 getIBLRadiance( const in vec3 viewDir, const in vec3 normal, const in float roughness ) {","vec3 getIBLRadiance( const in vec3 viewDir, const in vec3 normal, const in float roughness ) { return vec3(0.0);"):gt.envmap_physical_pars_fragment=gt.envmap_physical_pars_fragment.replace("vec4 envMapColor = textureCubeUV( envMap, reflectVec, roughness );","vec4 envMapColor = textureCubeUV( envMap, reflectVec, roughness ) * "+e.toFixed(5)+";")}}const Uy=k.createContext(null),Wa=k.createContext(null),vJ=Ki.memo(k.forwardRef(({children:n,camera:e,scene:t,resolutionScale:i,enabled:s=!0,renderPriority:r=1,autoClear:o=!0,depthBuffer:a,disableNormalPass:l,stencilBuffer:g,multisampling:u=8,frameBufferType:C=bs},d)=>{const{gl:h,scene:f,camera:v,size:y}=as(),A=t||f,b=e||v,[m,B,S]=k.useMemo(()=>{const Z=y_(),V=new aP(h,{depthBuffer:a,stencilBuffer:g,multisampling:u>0&&Z?u:0,frameBufferType:C});V.addPass(new Yc(A,b));let N=null,P=null;return l||(P=new sP(A,b),P.enabled=!1,V.addPass(P),i!==void 0&&Z&&(N=new YM({normalBuffer:P.texture,resolutionScale:i}),N.enabled=!1,V.addPass(N))),[V,P,N]},[b,h,a,g,u,C,A,l,i]);k.useEffect(()=>m?.setSize(y.width,y.height),[m,y]),bC((Z,V)=>{if(s){const N=h.autoClear;h.autoClear=o,g&&!o&&h.clearStencil(),m.render(V),h.autoClear=N}},s?r:0);const x=k.useRef(null),R=uk(x);k.useLayoutEffect(()=>{const Z=[];if(x.current&&R.current&&m){const V=R.current.objects;for(let N=0;N{for(const V of Z)m?.removePass(V);B&&(B.enabled=!1),S&&(S.enabled=!1)}},[m,n,b,B,S,R]);const M=k.useMemo(()=>({composer:m,normalPass:B,downSamplingPass:S,resolutionScale:i,camera:b,scene:A}),[m,B,S,i,b,A]);return k.useImperativeHandle(d,()=>m,[m]),E.jsx(Wa.Provider,{value:M,children:E.jsx("group",{ref:x,children:n})})})),sa=n=>typeof n=="object"&&n!=null&&"current"in n?n.current:n;let yJ=0;const nx=new WeakMap,GJ=(n,e)=>Ki.forwardRef(function({blendFunction:i=e?.blendFunction,opacity:s=e?.opacity,...r},o){let a=nx.get(n);if(!a){const u=`@react-three/postprocessing/${n.name}-${yJ++}`;kV({[u]:n}),nx.set(n,a=u)}const l=as(u=>u.camera),g=Ki.useMemo(()=>{var u,C;return[...(u=e?.args)!=null?u:[],...(C=r.args)!=null?C:[{...e,...r}]]},[JSON.stringify(r)]);return E.jsx(a,{camera:l,"blendMode-blendFunction":i,"blendMode-opacity-value":s,...r,ref:o,args:g})}),kI=(n,e)=>{const t=n[e];return Ki.useMemo(()=>typeof t=="number"?new oe(t,t):t?new oe(...t):new oe,[t])},BJ=k.forwardRef(function({target:e,depthTexture:t,...i},s){const r=as(l=>l.invalidate),{camera:o}=k.useContext(Wa),a=k.useMemo(()=>{const l=new jP(o,i),g=l.maskPass.getFullscreenMaterial();return g.maskFunction=lu.MULTIPLY_RGB_SET_ALPHA,l},[o,i]);return k.useLayoutEffect(()=>{if(e&&typeof e!="number"){const l=e instanceof H?new H().set(e.x,e.y,e.z):new H().set(e[0],e[1],e[2]);a.target=l}t&&a.setDepthTexture(t.texture,t.packing),r()},[e,t,a]),E.jsx("primitive",{ref:s,object:a,dispose:null})});k.forwardRef(({target:n=void 0,mouse:e=!1,debug:t=void 0,manual:i=!1,smoothTime:s=.25,...r},o)=>{const a=k.useRef(null),l=k.useRef(null),g=k.useRef(null),u=as(({scene:S})=>S),C=as(({pointer:S})=>S),{composer:d,camera:h}=k.useContext(Wa),[f]=k.useState(()=>new qU),[v]=k.useState(()=>new FM);k.useEffect(()=>(d.addPass(f),d.addPass(v),()=>{d.removePass(f),d.removePass(v)}),[d,f,v]),k.useEffect(()=>()=>{f.dispose(),v.dispose()},[f,v]);const[y]=k.useState(()=>new H(0,0,0)),[A]=k.useState(()=>new H(0,0,0)),b=k.useCallback(async(S,x)=>(A.x=S,A.y=x,A.z=await f.readDepth(A),A.z=A.z*2-1,1-A.z>1e-7?A.unproject(h):!1),[A,f,h]),m=k.useCallback(async(S,x=!0)=>{var R;if(n)y.set(...n);else{const{x:M,y:Z}=e?C:{x:0,y:0},V=await b(M,Z);V&&y.copy(V)}x&&((R=a.current)!=null&&R.target)&&(s>0&&S>0?D_.damp3(a.current.target,y,s,S):a.current.target.copy(y))},[n,y,e,b,s,C]);bC(async(S,x)=>{var R;i||m(x),l.current&&l.current.position.copy(y),g.current&&((R=a.current)!=null&&R.target)&&g.current.position.copy(a.current.target)});const B=k.useMemo(()=>({dofRef:a,hitpoint:y,update:m}),[y,m]);return k.useImperativeHandle(o,()=>B,[B]),E.jsxs(E.Fragment,{children:[t?pk(E.jsxs(E.Fragment,{children:[E.jsxs("mesh",{ref:l,children:[E.jsx("sphereGeometry",{args:[t,16,16]}),E.jsx("meshBasicMaterial",{color:"#00ff00",opacity:1,transparent:!0,depthWrite:!1})]}),E.jsxs("mesh",{ref:g,children:[E.jsx("sphereGeometry",{args:[t/2,16,16]}),E.jsx("meshBasicMaterial",{color:"#00ff00",opacity:.5,transparent:!0,depthWrite:!1})]})]}),u):null,E.jsx(BJ,{ref:a,...r,target:y})]})});k.forwardRef(function(e,t){const i=kI(e,"offset"),s=k.useMemo(()=>new OP({...e,offset:i}),[i,e]);return E.jsx("primitive",{ref:t,object:s,dispose:null})});k.forwardRef(function({blendFunction:e=ht.NORMAL},t){const i=k.useMemo(()=>new PP(e),[e]);return E.jsx("primitive",{ref:t,object:i,dispose:null})});k.forwardRef(function({active:e=!0,...t},i){const s=as(u=>u.invalidate),r=kI(t,"delay"),o=kI(t,"duration"),a=kI(t,"strength"),l=kI(t,"chromaticAberrationOffset"),g=k.useMemo(()=>new e_({...t,delay:r,duration:o,strength:a,chromaticAberrationOffset:l}),[r,o,t,a,l]);return k.useLayoutEffect(()=>{g.mode=e?t.mode||sl.SPORADIC:sl.DISABLED,s()},[e,g,s,t.mode]),E.jsx("primitive",{ref:i,object:g,dispose:null})});k.forwardRef(function(e,t){const{camera:i}=k.useContext(Wa),s=k.useMemo(()=>new n_(i,sa(e.sun),e),[i,e]);return k.useLayoutEffect(()=>void(s.lightSource=sa(e.sun)),[s,e.sun]),E.jsx("primitive",{ref:t,object:s,dispose:null})});k.forwardRef(function({size:e,...t},i){const s=as(o=>o.invalidate),r=k.useMemo(()=>new s_(t),[t]);return k.useLayoutEffect(()=>{e&&r.setSize(e.width,e.height),s()},[r,e]),E.jsx("primitive",{ref:i,object:r,dispose:null})});k.forwardRef(function({selection:e=[],selectionLayer:t=10,blendFunction:i,patternTexture:s,edgeStrength:r,pulseSpeed:o,visibleEdgeColor:a,hiddenEdgeColor:l,width:g,height:u,kernelSize:C,blur:d,xRay:h,...f},v){const y=as(S=>S.invalidate),{scene:A,camera:b}=k.useContext(Wa),m=k.useMemo(()=>new c_(A,b,{blendFunction:i,patternTexture:s,edgeStrength:r,pulseSpeed:o,visibleEdgeColor:a,hiddenEdgeColor:l,width:g,height:u,kernelSize:C,blur:d,xRay:h,...f}),[i,d,b,r,u,l,C,s,o,A,a,g,h]),B=k.useContext(Uy);return k.useEffect(()=>{if(!B&&e)return m.selection.set(Array.isArray(e)?e.map(sa):[sa(e)]),y(),()=>{m.selection.clear(),y()}},[m,e,B,y]),k.useEffect(()=>{m.selectionLayer=t,y()},[m,y,t]),k.useRef(),k.useEffect(()=>{var S;if(B&&B.enabled&&(S=B.selected)!=null&&S.length)return m.selection.set(B.selected),y(),()=>{m.selection.clear(),y()}},[B,m.selection,y]),E.jsx("primitive",{ref:v,object:m})});k.forwardRef(function({granularity:e=5},t){const i=k.useMemo(()=>new u_(e),[e]);return E.jsx("primitive",{ref:t,object:i,dispose:null})});const ZJ=(n,e)=>n.layers.enable(e.selection.layer),wJ=(n,e)=>n.layers.disable(e.selection.layer);k.forwardRef(function({selection:e=[],selectionLayer:t=10,lights:i=[],luminanceThreshold:s,luminanceSmoothing:r,intensity:o,width:a,height:l,kernelSize:g,mipmapBlur:u,...C},d){i.length===0&&console.warn("SelectiveBloom requires lights to work.");const h=as(b=>b.invalidate),{scene:f,camera:v}=k.useContext(Wa),y=k.useMemo(()=>new C_(f,v,{blendFunction:ht.ADD,luminanceThreshold:s,luminanceSmoothing:r,intensity:o,width:a,height:l,kernelSize:g,mipmapBlur:u,...C}),[f,v,s,r,o,a,l,g,u,C]),A=k.useContext(Uy);return k.useEffect(()=>{if(!A&&e)return y.selection.set(Array.isArray(e)?e.map(sa):[sa(e)]),h(),()=>{y.selection.clear(),h()}},[y,e,A,h]),k.useEffect(()=>{y.selection.layer=t,h()},[y,h,t]),k.useEffect(()=>{if(i&&i.length>0)return i.forEach(b=>ZJ(sa(b),y)),h(),()=>{i.forEach(b=>wJ(sa(b),y)),h()}},[y,h,i,t]),k.useEffect(()=>{var b;if(A&&A.enabled&&(b=A.selected)!=null&&b.length)return y.selection.set(A.selected),h(),()=>{y.selection.clear(),h()}},[A,y.selection,h]),E.jsx("primitive",{ref:d,object:y,dispose:null})});k.forwardRef(function(e,t){const{camera:i,normalPass:s,downSamplingPass:r,resolutionScale:o}=k.useContext(Wa),a=k.useMemo(()=>s===null&&r===null?(console.error("Please enable the NormalPass in the EffectComposer in order to use SSAO."),{}):new f_(i,s&&!r?s.texture:null,{blendFunction:ht.MULTIPLY,samples:30,rings:4,distanceThreshold:1,distanceFalloff:0,rangeThreshold:.5,rangeFalloff:.1,luminanceInfluence:.9,radius:20,bias:.5,intensity:1,color:void 0,normalDepthBuffer:r?r.texture:null,resolutionScale:o??1,depthAwareUpsampling:!0,...e}),[i,s,e]);return E.jsx("primitive",{ref:t,object:a,dispose:null})});const SJ=GJ(A_);k.forwardRef(function({textureSrc:e,texture:t,...i},s){const r=Yy(vV,e);k.useLayoutEffect(()=>{r.encoding=ks,r.wrapS=r.wrapT=Gs},[r]);const o=k.useMemo(()=>new v_({...i,texture:r||t}),[i,r,t]);return E.jsx("primitive",{ref:s,object:o,dispose:null})});k.forwardRef(function({lut:e,tetrahedralInterpolation:t,...i},s){const r=k.useMemo(()=>new a_(e,i),[e,i]),o=as(a=>a.invalidate);return k.useLayoutEffect(()=>{t&&(r.tetrahedralInterpolation=t),e&&(r.lut=e),o()},[r,o,e,t]),E.jsx("primitive",{ref:s,object:r,dispose:null})});const xJ=` + ${hJ}`)}const pJ=P_.replace("#include ",TM).replace("#include ",U_),fJ=["blur","blurSharpness","blurKernel"],mJ=new sp(1);let Vh;class bJ extends di{constructor(e,t,i=qS){super("SSREffect",pJ,{type:"FinalSSRMaterial",uniforms:new Map([["reflectionsTexture",new ne(null)],["blur",new ne(0)],["blurSharpness",new ne(0)],["blurKernel",new ne(0)]]),defines:new Map([["RENDER_MODE","0"]])}),this.haltonSequence=IJ(1024),this.haltonIndex=0,this.selection=new Dy,this.lastSize=void 0,this.cubeCamera=new gy(.001,1e3,mJ),this.usingBoxProjectedEnvMap=!1,this._scene=e,this._camera=t,i=kb({},qS,i,{boxBlur:!0,dilation:!0}),this.temporalResolvePass=new cJ(e,t,__,i),this.uniforms.get("reflectionsTexture").value=this.temporalResolvePass.renderTarget.texture,this.reflectionsPass=new eJ(this,i),this.temporalResolvePass.fullscreenMaterial.uniforms.inputTexture.value=this.reflectionsPass.renderTarget.texture,this.lastSize={width:i.width,height:i.height,resolutionScale:i.resolutionScale,velocityResolutionScale:i.velocityResolutionScale},this.setSize(i.width,i.height),this.makeOptionsReactive(i)}makeOptionsReactive(e){let t=!1;const i=this.reflectionsPass.fullscreenMaterial.uniforms,s=Object.keys(i);for(const r of Object.keys(e))Object.defineProperty(this,r,{get(){return e[r]},set(o){if(!(e[r]===o&&t))switch(e[r]=o,fJ.includes(r)||this.setSize(this.lastSize.width,this.lastSize.height,!0),r){case"resolutionScale":this.setSize(this.lastSize.width,this.lastSize.height);break;case"velocityResolutionScale":this.temporalResolvePass.velocityResolutionScale=o,this.setSize(this.lastSize.width,this.lastSize.height,!0);break;case"blur":this.uniforms.get("blur").value=o;break;case"blurSharpness":this.uniforms.get("blurSharpness").value=o;break;case"blurKernel":this.uniforms.get("blurKernel").value=o;break;case"steps":this.reflectionsPass.fullscreenMaterial.defines.steps=parseInt(o),this.reflectionsPass.fullscreenMaterial.needsUpdate=t;break;case"refineSteps":this.reflectionsPass.fullscreenMaterial.defines.refineSteps=parseInt(o),this.reflectionsPass.fullscreenMaterial.needsUpdate=t;break;case"missedRays":o?this.reflectionsPass.fullscreenMaterial.defines.missedRays="":delete this.reflectionsPass.fullscreenMaterial.defines.missedRays,this.reflectionsPass.fullscreenMaterial.needsUpdate=t;break;case"correctionRadius":this.temporalResolvePass.fullscreenMaterial.defines.correctionRadius=Math.round(o),this.temporalResolvePass.fullscreenMaterial.needsUpdate=t;break;case"blend":this.temporalResolvePass.fullscreenMaterial.uniforms.blend.value=o;break;case"correction":this.temporalResolvePass.fullscreenMaterial.uniforms.correction.value=o;break;case"exponent":this.temporalResolvePass.fullscreenMaterial.uniforms.exponent.value=o;break;case"distance":i.rayDistance.value=o;default:s.includes(r)&&(i[r].value=o)}}}),this[r]=e[r];t=!0}setSize(e,t,i=!1){!i&&e===this.lastSize.width&&t===this.lastSize.height&&this.resolutionScale===this.lastSize.resolutionScale&&this.velocityResolutionScale===this.lastSize.velocityResolutionScale||(this.temporalResolvePass.setSize(e,t),this.reflectionsPass.setSize(e,t),this.lastSize={width:e,height:t,resolutionScale:this.resolutionScale,velocityResolutionScale:this.velocityResolutionScale})}generateBoxProjectedEnvMapFallback(e,t=new H,i=new H,s=512){this.cubeCamera.renderTarget.dispose(),this.cubeCamera.renderTarget=new sp(s),this.cubeCamera.position.copy(t),this.cubeCamera.updateMatrixWorld(),this.cubeCamera.update(e,this._scene),Vh||(Vh=new WA(e),Vh.compileCubemapShader());const r=Vh.fromCubemap(this.cubeCamera.renderTarget.texture).texture;r.minFilter=st,r.magFilter=st;const o=this.reflectionsPass.fullscreenMaterial;return AJ(o,t,i),o.fragmentShader=o.fragmentShader.replace("vec3 worldPos","worldPos").replace("varying vec3 vWorldPosition;","vec3 worldPos;"),o.uniforms.envMapPosition.value.copy(t),o.uniforms.envMapSize.value.copy(i),jS(o,r,s),this.usingBoxProjectedEnvMap=!0,r}setIBLRadiance(e,t){this._scene.traverse(i=>{if(i.material){var s;const r=(s=t.properties.get(i.material))==null?void 0:s.uniforms;r&&"disableIBLRadiance"in r&&(r.disableIBLRadiance.value=e)}})}deleteBoxProjectedEnvMapFallback(){const e=this.reflectionsPass.fullscreenMaterial;e.uniforms.envMap.value=null,e.fragmentShader=e.fragmentShader.replace("worldPos = ","vec3 worldPos = "),delete e.defines.BOX_PROJECTED_ENV_MAP,e.needsUpdate=!0,this.usingBoxProjectedEnvMap=!1}dispose(){super.dispose(),this.reflectionsPass.dispose(),this.temporalResolvePass.dispose()}update(e,t){if(!this.usingBoxProjectedEnvMap&&this._scene.environment){const a=this.reflectionsPass.fullscreenMaterial;let l=null;if(this._scene.traverse(g=>{if(!l&&g.material&&!g.material.envMap){const u=e.properties.get(g.material);"envMap"in u&&u.envMap instanceof sn&&(l=u.envMap)}}),l){const g=this._scene.environment.image.height;jS(a,l,g)}}this.haltonIndex=(this.haltonIndex+1)%this.haltonSequence.length;const[i,s]=this.haltonSequence[this.haltonIndex],{width:r,height:o}=this.lastSize;this.temporalResolvePass.velocityPass.render(e),this._camera.setViewOffset&&this._camera.setViewOffset(r,o,i,s,r,o),this.reflectionsPass.render(e,t),this.temporalResolvePass.render(e),this._camera.clearViewOffset()}static patchDirectEnvIntensity(e=0){e===0?gt.envmap_physical_pars_fragment=gt.envmap_physical_pars_fragment.replace("vec3 getIBLRadiance( const in vec3 viewDir, const in vec3 normal, const in float roughness ) {","vec3 getIBLRadiance( const in vec3 viewDir, const in vec3 normal, const in float roughness ) { return vec3(0.0);"):gt.envmap_physical_pars_fragment=gt.envmap_physical_pars_fragment.replace("vec4 envMapColor = textureCubeUV( envMap, reflectVec, roughness );","vec4 envMapColor = textureCubeUV( envMap, reflectVec, roughness ) * "+e.toFixed(5)+";")}}const Uy=k.createContext(null),Wa=k.createContext(null),vJ=Ki.memo(k.forwardRef(({children:n,camera:e,scene:t,resolutionScale:i,enabled:s=!0,renderPriority:r=1,autoClear:o=!0,depthBuffer:a,disableNormalPass:l,stencilBuffer:g,multisampling:u=8,frameBufferType:C=bs},d)=>{const{gl:h,scene:f,camera:v,size:y}=as(),A=t||f,b=e||v,[m,B,S]=k.useMemo(()=>{const Z=y_(),V=new aP(h,{depthBuffer:a,stencilBuffer:g,multisampling:u>0&&Z?u:0,frameBufferType:C});V.addPass(new Kc(A,b));let N=null,P=null;return l||(P=new sP(A,b),P.enabled=!1,V.addPass(P),i!==void 0&&Z&&(N=new YM({normalBuffer:P.texture,resolutionScale:i}),N.enabled=!1,V.addPass(N))),[V,P,N]},[b,h,a,g,u,C,A,l,i]);k.useEffect(()=>m?.setSize(y.width,y.height),[m,y]),bC((Z,V)=>{if(s){const N=h.autoClear;h.autoClear=o,g&&!o&&h.clearStencil(),m.render(V),h.autoClear=N}},s?r:0);const x=k.useRef(null),R=uk(x);k.useLayoutEffect(()=>{const Z=[];if(x.current&&R.current&&m){const V=R.current.objects;for(let N=0;N{for(const V of Z)m?.removePass(V);B&&(B.enabled=!1),S&&(S.enabled=!1)}},[m,n,b,B,S,R]);const M=k.useMemo(()=>({composer:m,normalPass:B,downSamplingPass:S,resolutionScale:i,camera:b,scene:A}),[m,B,S,i,b,A]);return k.useImperativeHandle(d,()=>m,[m]),L.jsx(Wa.Provider,{value:M,children:L.jsx("group",{ref:x,children:n})})})),sa=n=>typeof n=="object"&&n!=null&&"current"in n?n.current:n;let yJ=0;const nx=new WeakMap,GJ=(n,e)=>Ki.forwardRef(function({blendFunction:i=e?.blendFunction,opacity:s=e?.opacity,...r},o){let a=nx.get(n);if(!a){const u=`@react-three/postprocessing/${n.name}-${yJ++}`;kV({[u]:n}),nx.set(n,a=u)}const l=as(u=>u.camera),g=Ki.useMemo(()=>{var u,C;return[...(u=e?.args)!=null?u:[],...(C=r.args)!=null?C:[{...e,...r}]]},[JSON.stringify(r)]);return L.jsx(a,{camera:l,"blendMode-blendFunction":i,"blendMode-opacity-value":s,...r,ref:o,args:g})}),DI=(n,e)=>{const t=n[e];return Ki.useMemo(()=>typeof t=="number"?new oe(t,t):t?new oe(...t):new oe,[t])},BJ=k.forwardRef(function({target:e,depthTexture:t,...i},s){const r=as(l=>l.invalidate),{camera:o}=k.useContext(Wa),a=k.useMemo(()=>{const l=new jP(o,i),g=l.maskPass.getFullscreenMaterial();return g.maskFunction=gu.MULTIPLY_RGB_SET_ALPHA,l},[o,i]);return k.useLayoutEffect(()=>{if(e&&typeof e!="number"){const l=e instanceof H?new H().set(e.x,e.y,e.z):new H().set(e[0],e[1],e[2]);a.target=l}t&&a.setDepthTexture(t.texture,t.packing),r()},[e,t,a]),L.jsx("primitive",{ref:s,object:a,dispose:null})});k.forwardRef(({target:n=void 0,mouse:e=!1,debug:t=void 0,manual:i=!1,smoothTime:s=.25,...r},o)=>{const a=k.useRef(null),l=k.useRef(null),g=k.useRef(null),u=as(({scene:S})=>S),C=as(({pointer:S})=>S),{composer:d,camera:h}=k.useContext(Wa),[f]=k.useState(()=>new qU),[v]=k.useState(()=>new FM);k.useEffect(()=>(d.addPass(f),d.addPass(v),()=>{d.removePass(f),d.removePass(v)}),[d,f,v]),k.useEffect(()=>()=>{f.dispose(),v.dispose()},[f,v]);const[y]=k.useState(()=>new H(0,0,0)),[A]=k.useState(()=>new H(0,0,0)),b=k.useCallback(async(S,x)=>(A.x=S,A.y=x,A.z=await f.readDepth(A),A.z=A.z*2-1,1-A.z>1e-7?A.unproject(h):!1),[A,f,h]),m=k.useCallback(async(S,x=!0)=>{var R;if(n)y.set(...n);else{const{x:M,y:Z}=e?C:{x:0,y:0},V=await b(M,Z);V&&y.copy(V)}x&&((R=a.current)!=null&&R.target)&&(s>0&&S>0?D_.damp3(a.current.target,y,s,S):a.current.target.copy(y))},[n,y,e,b,s,C]);bC(async(S,x)=>{var R;i||m(x),l.current&&l.current.position.copy(y),g.current&&((R=a.current)!=null&&R.target)&&g.current.position.copy(a.current.target)});const B=k.useMemo(()=>({dofRef:a,hitpoint:y,update:m}),[y,m]);return k.useImperativeHandle(o,()=>B,[B]),L.jsxs(L.Fragment,{children:[t?pk(L.jsxs(L.Fragment,{children:[L.jsxs("mesh",{ref:l,children:[L.jsx("sphereGeometry",{args:[t,16,16]}),L.jsx("meshBasicMaterial",{color:"#00ff00",opacity:1,transparent:!0,depthWrite:!1})]}),L.jsxs("mesh",{ref:g,children:[L.jsx("sphereGeometry",{args:[t/2,16,16]}),L.jsx("meshBasicMaterial",{color:"#00ff00",opacity:.5,transparent:!0,depthWrite:!1})]})]}),u):null,L.jsx(BJ,{ref:a,...r,target:y})]})});k.forwardRef(function(e,t){const i=DI(e,"offset"),s=k.useMemo(()=>new OP({...e,offset:i}),[i,e]);return L.jsx("primitive",{ref:t,object:s,dispose:null})});k.forwardRef(function({blendFunction:e=ht.NORMAL},t){const i=k.useMemo(()=>new PP(e),[e]);return L.jsx("primitive",{ref:t,object:i,dispose:null})});k.forwardRef(function({active:e=!0,...t},i){const s=as(u=>u.invalidate),r=DI(t,"delay"),o=DI(t,"duration"),a=DI(t,"strength"),l=DI(t,"chromaticAberrationOffset"),g=k.useMemo(()=>new e_({...t,delay:r,duration:o,strength:a,chromaticAberrationOffset:l}),[r,o,t,a,l]);return k.useLayoutEffect(()=>{g.mode=e?t.mode||sl.SPORADIC:sl.DISABLED,s()},[e,g,s,t.mode]),L.jsx("primitive",{ref:i,object:g,dispose:null})});k.forwardRef(function(e,t){const{camera:i}=k.useContext(Wa),s=k.useMemo(()=>new n_(i,sa(e.sun),e),[i,e]);return k.useLayoutEffect(()=>void(s.lightSource=sa(e.sun)),[s,e.sun]),L.jsx("primitive",{ref:t,object:s,dispose:null})});k.forwardRef(function({size:e,...t},i){const s=as(o=>o.invalidate),r=k.useMemo(()=>new s_(t),[t]);return k.useLayoutEffect(()=>{e&&r.setSize(e.width,e.height),s()},[r,e]),L.jsx("primitive",{ref:i,object:r,dispose:null})});k.forwardRef(function({selection:e=[],selectionLayer:t=10,blendFunction:i,patternTexture:s,edgeStrength:r,pulseSpeed:o,visibleEdgeColor:a,hiddenEdgeColor:l,width:g,height:u,kernelSize:C,blur:d,xRay:h,...f},v){const y=as(S=>S.invalidate),{scene:A,camera:b}=k.useContext(Wa),m=k.useMemo(()=>new c_(A,b,{blendFunction:i,patternTexture:s,edgeStrength:r,pulseSpeed:o,visibleEdgeColor:a,hiddenEdgeColor:l,width:g,height:u,kernelSize:C,blur:d,xRay:h,...f}),[i,d,b,r,u,l,C,s,o,A,a,g,h]),B=k.useContext(Uy);return k.useEffect(()=>{if(!B&&e)return m.selection.set(Array.isArray(e)?e.map(sa):[sa(e)]),y(),()=>{m.selection.clear(),y()}},[m,e,B,y]),k.useEffect(()=>{m.selectionLayer=t,y()},[m,y,t]),k.useRef(),k.useEffect(()=>{var S;if(B&&B.enabled&&(S=B.selected)!=null&&S.length)return m.selection.set(B.selected),y(),()=>{m.selection.clear(),y()}},[B,m.selection,y]),L.jsx("primitive",{ref:v,object:m})});k.forwardRef(function({granularity:e=5},t){const i=k.useMemo(()=>new u_(e),[e]);return L.jsx("primitive",{ref:t,object:i,dispose:null})});const ZJ=(n,e)=>n.layers.enable(e.selection.layer),wJ=(n,e)=>n.layers.disable(e.selection.layer);k.forwardRef(function({selection:e=[],selectionLayer:t=10,lights:i=[],luminanceThreshold:s,luminanceSmoothing:r,intensity:o,width:a,height:l,kernelSize:g,mipmapBlur:u,...C},d){i.length===0&&console.warn("SelectiveBloom requires lights to work.");const h=as(b=>b.invalidate),{scene:f,camera:v}=k.useContext(Wa),y=k.useMemo(()=>new C_(f,v,{blendFunction:ht.ADD,luminanceThreshold:s,luminanceSmoothing:r,intensity:o,width:a,height:l,kernelSize:g,mipmapBlur:u,...C}),[f,v,s,r,o,a,l,g,u,C]),A=k.useContext(Uy);return k.useEffect(()=>{if(!A&&e)return y.selection.set(Array.isArray(e)?e.map(sa):[sa(e)]),h(),()=>{y.selection.clear(),h()}},[y,e,A,h]),k.useEffect(()=>{y.selection.layer=t,h()},[y,h,t]),k.useEffect(()=>{if(i&&i.length>0)return i.forEach(b=>ZJ(sa(b),y)),h(),()=>{i.forEach(b=>wJ(sa(b),y)),h()}},[y,h,i,t]),k.useEffect(()=>{var b;if(A&&A.enabled&&(b=A.selected)!=null&&b.length)return y.selection.set(A.selected),h(),()=>{y.selection.clear(),h()}},[A,y.selection,h]),L.jsx("primitive",{ref:d,object:y,dispose:null})});k.forwardRef(function(e,t){const{camera:i,normalPass:s,downSamplingPass:r,resolutionScale:o}=k.useContext(Wa),a=k.useMemo(()=>s===null&&r===null?(console.error("Please enable the NormalPass in the EffectComposer in order to use SSAO."),{}):new f_(i,s&&!r?s.texture:null,{blendFunction:ht.MULTIPLY,samples:30,rings:4,distanceThreshold:1,distanceFalloff:0,rangeThreshold:.5,rangeFalloff:.1,luminanceInfluence:.9,radius:20,bias:.5,intensity:1,color:void 0,normalDepthBuffer:r?r.texture:null,resolutionScale:o??1,depthAwareUpsampling:!0,...e}),[i,s,e]);return L.jsx("primitive",{ref:t,object:a,dispose:null})});const SJ=GJ(A_);k.forwardRef(function({textureSrc:e,texture:t,...i},s){const r=Yy(vV,e);k.useLayoutEffect(()=>{r.encoding=ks,r.wrapS=r.wrapT=Gs},[r]);const o=k.useMemo(()=>new v_({...i,texture:r||t}),[i,r,t]);return L.jsx("primitive",{ref:s,object:o,dispose:null})});k.forwardRef(function({lut:e,tetrahedralInterpolation:t,...i},s){const r=k.useMemo(()=>new a_(e,i),[e,i]),o=as(a=>a.invalidate);return k.useLayoutEffect(()=>{t&&(r.tetrahedralInterpolation=t),e&&(r.lut=e),o()},[r,o,e,t]),L.jsx("primitive",{ref:s,object:r,dispose:null})});const xJ=` uniform sampler2D uCharacters; uniform float uCharactersCount; uniform float uCellSize; @@ -4523,7 +4523,7 @@ void mainImage(const in vec4 inputColor, const in vec2 uv, out vec4 outputColor) asciiCharacter.a = pixelized.a; outputColor = asciiCharacter; } -`;class RJ extends di{constructor({characters:e=" .:,'-^=*+?!|0#X%WM@",fontSize:t=54,cellSize:i=16,color:s="#ffffff",invert:r=!1}={}){const o=new Map([["uCharacters",new ne(new sn)],["uCellSize",new ne(i)],["uCharactersCount",new ne(e.length)],["uColor",new ne(new Xe(s))],["uInvert",new ne(r)]]);super("ASCIIEffect",xJ,{uniforms:o});const a=this.uniforms.get("uCharacters");a&&(a.value=this.createCharactersTexture(e,t))}createCharactersTexture(e,t){const i=document.createElement("canvas"),s=1024,r=16,o=s/r;i.width=i.height=s;const a=new jW(i,void 0,Gs,Gs,vt,vt),l=i.getContext("2d");if(!l)throw new Error("Context not available");l.clearRect(0,0,s,s),l.font=`${t}px arial`,l.textAlign="center",l.textBaseline="middle",l.fillStyle="#fff";for(let g=0;g{const o=k.useMemo(()=>new RJ({characters:n,fontSize:e,cellSize:t,color:i,invert:s}),[n,e,t,i,s]);return E.jsx("primitive",{ref:r,object:o})});k.forwardRef(function({ENABLE_BLUR:e=!0,USE_MRT:t=!0,...i},s){const{invalidate:r}=as(),{scene:o,camera:a}=k.useContext(Wa),l=k.useMemo(()=>new bJ(o,a,{ENABLE_BLUR:e,USE_MRT:t,...i}),[o,a,e,t,i]),g=k.useContext(Uy);return k.useEffect(()=>{var u;if(g&&g.enabled&&(u=g.selected)!=null&&u.length)return l.selection.set(g.selected),r(),()=>{l.selection.clear(),r()}},[g]),E.jsx("primitive",{ref:s,object:l,...i})});const WJ={uniforms:{sceneDiffuse:{value:null},sceneDepth:{value:null},projMat:{value:new _e},viewMat:{value:new _e},projViewMat:{value:new _e},projectionMatrixInv:{value:new _e},viewMatrixInv:{value:new _e},cameraPos:{value:new H},resolution:{value:new oe},time:{value:0},samples:{value:[]},samplesR:{value:[]},bluenoise:{value:null},distanceFalloff:{value:1},radius:{value:5},near:{value:.1},far:{value:1e3},logDepth:{value:!1},ortho:{value:!1},screenSpaceRadius:{value:!1}},vertexShader:` +`;class RJ extends di{constructor({characters:e=" .:,'-^=*+?!|0#X%WM@",fontSize:t=54,cellSize:i=16,color:s="#ffffff",invert:r=!1}={}){const o=new Map([["uCharacters",new ne(new sn)],["uCellSize",new ne(i)],["uCharactersCount",new ne(e.length)],["uColor",new ne(new Xe(s))],["uInvert",new ne(r)]]);super("ASCIIEffect",xJ,{uniforms:o});const a=this.uniforms.get("uCharacters");a&&(a.value=this.createCharactersTexture(e,t))}createCharactersTexture(e,t){const i=document.createElement("canvas"),s=1024,r=16,o=s/r;i.width=i.height=s;const a=new jW(i,void 0,Gs,Gs,vt,vt),l=i.getContext("2d");if(!l)throw new Error("Context not available");l.clearRect(0,0,s,s),l.font=`${t}px arial`,l.textAlign="center",l.textBaseline="middle",l.fillStyle="#fff";for(let g=0;g{const o=k.useMemo(()=>new RJ({characters:n,fontSize:e,cellSize:t,color:i,invert:s}),[n,e,t,i,s]);return L.jsx("primitive",{ref:r,object:o})});k.forwardRef(function({ENABLE_BLUR:e=!0,USE_MRT:t=!0,...i},s){const{invalidate:r}=as(),{scene:o,camera:a}=k.useContext(Wa),l=k.useMemo(()=>new bJ(o,a,{ENABLE_BLUR:e,USE_MRT:t,...i}),[o,a,e,t,i]),g=k.useContext(Uy);return k.useEffect(()=>{var u;if(g&&g.enabled&&(u=g.selected)!=null&&u.length)return l.selection.set(g.selected),r(),()=>{l.selection.clear(),r()}},[g]),L.jsx("primitive",{ref:s,object:l,...i})});const WJ={uniforms:{sceneDiffuse:{value:null},sceneDepth:{value:null},projMat:{value:new _e},viewMat:{value:new _e},projViewMat:{value:new _e},projectionMatrixInv:{value:new _e},viewMatrixInv:{value:new _e},cameraPos:{value:new H},resolution:{value:new oe},time:{value:0},samples:{value:[]},samplesR:{value:[]},bluenoise:{value:null},distanceFalloff:{value:1},radius:{value:5},near:{value:.1},far:{value:1e3},logDepth:{value:!1},ortho:{value:!1},screenSpaceRadius:{value:!1}},vertexShader:` varying vec2 vUv; void main() { vUv = uv; @@ -4882,7 +4882,7 @@ void main() { } `})),this.writeTargetInternal=new Nt(this.width,this.height,{minFilter:st,magFilter:st,depthBuffer:!1}),this.readTargetInternal=new Nt(this.width,this.height,{minFilter:st,magFilter:st,depthBuffer:!1}),this.bluenoise=new zr(NJ,128,128),this.bluenoise.colorSpace=vo,this.bluenoise.wrapS=Gs,this.bluenoise.wrapT=Gs,this.bluenoise.minFilter=vt,this.bluenoise.magFilter=vt,this.bluenoise.needsUpdate=!0,this.lastTime=0,this.needsDepthTexture=!0,this._r=new oe,this._c=new Xe}configureSampleDependentPasses(){this.configureAOPass(this.configuration.logarithmicDepthBuffer),this.configureDenoisePass(this.configuration.logarithmicDepthBuffer)}configureAOPass(e=!1){this.samples=this.generateHemisphereSamples(this.configuration.aoSamples),this.samplesR=this.generateHemisphereSamplesR(this.configuration.aoSamples);const t={...WJ};t.fragmentShader=t.fragmentShader.replace("16",this.configuration.aoSamples).replace("16.0",this.configuration.aoSamples+".0"),e&&(t.fragmentShader=`#define LOGDEPTH `+t.fragmentShader),this.effectShaderQuad?(this.effectShaderQuad.material.dispose(),this.effectShaderQuad.material=new Rt(t)):this.effectShaderQuad=new Rh(new Rt(t))}configureDenoisePass(e=!1){this.samplesDenoise=this.generateDenoiseSamples(this.configuration.denoiseSamples,11);const t={...MJ};t.fragmentShader=t.fragmentShader.replace("16",this.configuration.denoiseSamples),e&&(t.fragmentShader=`#define LOGDEPTH -`+t.fragmentShader),this.poissonBlurQuad?(this.poissonBlurQuad.material.dispose(),this.poissonBlurQuad.material=new Rt(t)):this.poissonBlurQuad=new Rh(new Rt(t))}generateHemisphereSamples(e){const t=[];for(let i=0;in.charCodeAt(0));const XJ=k.forwardRef(({screenSpaceRadius:n,quality:e,aoRadius:t=5,aoSamples:i=16,denoiseSamples:s=4,denoiseRadius:r=12,distanceFalloff:o=1,intensity:a=1,color:l},g)=>{const{camera:u,scene:C}=as(),d=k.useMemo(()=>new HJ(C,u),[]);return k.useLayoutEffect(()=>{$a(d.configuration,{color:l,aoRadius:t,distanceFalloff:o,intensity:a,aoSamples:i,denoiseSamples:s,denoiseRadius:r,screenSpaceRadius:n})},[n,l,t,o,a,i,s,r]),k.useLayoutEffect(()=>{e&&d.setQualityMode(e.charAt(0).toUpperCase()+e.slice(1))},[e]),E.jsx("primitive",{ref:g,object:d})}),Qm=WW.randFloatSpread;function FJ({mat:n=new _e,vec:e=new H,numBalls:t,color:i}){const s=new Kl(1,50,50),r=new Ap({color:i,roughness:0,envMapIntensity:1}),[o,a]=WM(()=>({args:[1],mass:1,angularDamping:.1,linearDamping:.65,position:[Qm(10),Qm(10),Qm(10)]}));return bC(l=>{for(let g=0;gt.viewport),[,e]=WM(()=>({type:"Kinematic",args:[3],position:[0,0,0]}));return bC(t=>e.position.set(-(t.mouse.x*n.width)/2,t.mouse.y*n.height/2,3))}const KJ=({intensity:n,color:e,distance:t,width:i,height:s})=>{const r=[];for(let a=0;a<10;a++)r.push([-i/2+i/(10-1)*a,t,s/2]),r.push([-i/2+i/(10-1)*a,t,-s/2]),r.push([i/2,t,-s/2+s/(10-1)*a]),r.push([-i/2,t,-s/2+s/(10-1)*a]);return E.jsx(E.Fragment,{children:r.map((a,l)=>E.jsx("pointLight",{position:a,intensity:n,color:e},l))})},zJ=({color:n,className:e})=>E.jsxs(Fk,{className:e,shadows:!0,gl:{antialias:!0},camera:{position:[0,0,-34],fov:20,near:1,far:1e3},children:[E.jsxs(jD,{gravity:[0,-8,0],iterations:10,children:[E.jsx(YJ,{}),E.jsx(FJ,{numBalls:20,color:n})]}),E.jsx("ambientLight",{intensity:1}),E.jsx(KJ,{intensity:.05,color:"#ffffff",distance:100,height:200,width:100}),E.jsxs(vJ,{disableNormalPass:!0,multisampling:0,children:[E.jsx(XJ,{color:"black",aoRadius:2,intensity:1,aoSamples:6,denoiseSamples:4}),E.jsx(SJ,{})]})]}),ix=({className:n})=>E.jsx("a",{href:"/",children:E.jsxs("svg",{className:n,width:"100%",height:"100%",viewBox:"0 0 180 180",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[E.jsx("path",{className:"fill-icontext dark:fill-icontext-dark",d:"M76.875 5.3125L65.25 51H54.2188L48.0312 27C47.9062 26.5417 47.7396 25.8438 47.5312 24.9062C47.3229 23.9688 47.1042 22.9479 46.875 21.8438C46.6458 20.7188 46.4375 19.6667 46.25 18.6875C46.0833 17.6875 45.9688 16.8958 45.9062 16.3125C45.8438 16.8958 45.7188 17.6771 45.5312 18.6562C45.3646 19.6354 45.1667 20.6771 44.9375 21.7812C44.7292 22.8854 44.5208 23.9167 44.3125 24.875C44.1042 25.8333 43.9375 26.5625 43.8125 27.0625L37.6562 51H26.6562L15 5.3125H24.5312L30.375 30.25C30.5417 31 30.7292 31.8958 30.9375 32.9375C31.1667 33.9792 31.3854 35.0729 31.5938 36.2188C31.8229 37.3438 32.0208 38.4375 32.1875 39.5C32.375 40.5417 32.5104 41.4479 32.5938 42.2188C32.6979 41.4271 32.8333 40.5104 33 39.4688C33.1667 38.4062 33.3438 37.3333 33.5312 36.25C33.7396 35.1458 33.9479 34.125 34.1562 33.1875C34.3646 32.25 34.5521 31.4896 34.7188 30.9062L41.375 5.3125H50.5312L57.1875 30.9062C57.3333 31.4688 57.5 32.2292 57.6875 33.1875C57.8958 34.125 58.1042 35.1458 58.3125 36.25C58.5208 37.3542 58.7083 38.4375 58.875 39.5C59.0625 40.5417 59.1979 41.4479 59.2812 42.2188C59.4271 41.1771 59.625 39.9167 59.875 38.4375C60.1458 36.9375 60.4271 35.4479 60.7188 33.9688C61.0312 32.4896 61.3021 31.25 61.5312 30.25L67.3438 5.3125H76.875ZM107.225 33.4688C107.225 36.3854 106.829 38.9688 106.037 41.2188C105.267 43.4688 104.131 45.375 102.631 46.9375C101.152 48.4792 99.3604 49.6458 97.2562 50.4375C95.1729 51.2292 92.8187 51.625 90.1937 51.625C87.7354 51.625 85.475 51.2292 83.4125 50.4375C81.3708 49.6458 79.5896 48.4792 78.0687 46.9375C76.5687 45.375 75.4021 43.4688 74.5687 41.2188C73.7562 38.9688 73.35 36.3854 73.35 33.4688C73.35 29.5938 74.0375 26.3125 75.4125 23.625C76.7875 20.9375 78.7458 18.8958 81.2875 17.5C83.8292 16.1042 86.8604 15.4062 90.3812 15.4062C93.6521 15.4062 96.5479 16.1042 99.0687 17.5C101.61 18.8958 103.6 20.9375 105.037 23.625C106.496 26.3125 107.225 29.5938 107.225 33.4688ZM83.0687 33.4688C83.0687 35.7604 83.3187 37.6875 83.8187 39.25C84.3187 40.8125 85.1 41.9896 86.1625 42.7812C87.225 43.5729 88.6104 43.9688 90.3187 43.9688C92.0062 43.9688 93.3708 43.5729 94.4125 42.7812C95.475 41.9896 96.2458 40.8125 96.725 39.25C97.225 37.6875 97.475 35.7604 97.475 33.4688C97.475 31.1562 97.225 29.2396 96.725 27.7188C96.2458 26.1771 95.475 25.0208 94.4125 24.25C93.35 23.4792 91.9646 23.0938 90.2562 23.0938C87.7354 23.0938 85.9021 23.9583 84.7562 25.6875C83.6312 27.4167 83.0687 30.0104 83.0687 33.4688ZM122.003 51.625C118.107 51.625 114.93 50.1042 112.471 47.0625C110.034 44 108.815 39.5104 108.815 33.5938C108.815 27.6146 110.055 23.0938 112.534 20.0312C115.013 16.9479 118.253 15.4062 122.253 15.4062C123.919 15.4062 125.388 15.6354 126.659 16.0938C127.93 16.5521 129.023 17.1667 129.94 17.9375C130.878 18.7083 131.669 19.5729 132.315 20.5312H132.628C132.503 19.8646 132.346 18.8854 132.159 17.5938C131.992 16.2812 131.909 14.9375 131.909 13.5625V2.375H141.471V51H134.159L132.315 46.4688H131.909C131.305 47.4271 130.544 48.3021 129.628 49.0938C128.732 49.8646 127.659 50.4792 126.409 50.9375C125.159 51.3958 123.69 51.625 122.003 51.625ZM125.346 44.0312C127.95 44.0312 129.784 43.2604 130.846 41.7188C131.93 40.1562 132.503 37.8125 132.565 34.6875V33.6562C132.565 30.2604 132.044 27.6667 131.003 25.875C129.961 24.0625 128.023 23.1562 125.19 23.1562C123.086 23.1562 121.44 24.0625 120.253 25.875C119.065 27.6875 118.471 30.3021 118.471 33.7188C118.471 37.1354 119.065 39.7083 120.253 41.4375C121.461 43.1667 123.159 44.0312 125.346 44.0312ZM159.446 15.4062C162.675 15.4062 165.457 16.0312 167.79 17.2812C170.123 18.5104 171.925 20.3021 173.196 22.6562C174.467 25.0104 175.103 27.8854 175.103 31.2812V35.9062H152.571C152.675 38.5938 153.478 40.7083 154.978 42.25C156.498 43.7708 158.603 44.5312 161.29 44.5312C163.519 44.5312 165.561 44.3021 167.415 43.8438C169.269 43.3854 171.175 42.6979 173.134 41.7812V49.1562C171.405 50.0104 169.592 50.6354 167.696 51.0312C165.821 51.4271 163.54 51.625 160.853 51.625C157.353 51.625 154.248 50.9792 151.54 49.6875C148.853 48.3958 146.738 46.4271 145.196 43.7812C143.675 41.1354 142.915 37.8021 142.915 33.7812C142.915 29.6979 143.603 26.3021 144.978 23.5938C146.373 20.8646 148.311 18.8229 150.79 17.4688C153.269 16.0938 156.155 15.4062 159.446 15.4062ZM159.509 22.1875C157.655 22.1875 156.113 22.7812 154.884 23.9688C153.675 25.1562 152.978 27.0208 152.79 29.5625H166.165C166.144 28.1458 165.884 26.8854 165.384 25.7812C164.905 24.6771 164.175 23.8021 163.196 23.1562C162.238 22.5104 161.009 22.1875 159.509 22.1875ZM61.2812 155H48.9688L29.0938 120.438H28.8125C28.8958 121.875 28.9688 123.323 29.0312 124.781C29.0938 126.24 29.1562 127.698 29.2188 129.156C29.2812 130.594 29.3438 132.042 29.4062 133.5V155H20.75V109.312H32.9688L52.8125 143.531H53.0312C52.9896 142.115 52.9375 140.708 52.875 139.312C52.8125 137.917 52.75 136.521 52.6875 135.125C52.6458 133.729 52.6042 132.333 52.5625 130.938V109.312H61.2812V155ZM75.1937 120.062V155H65.6625V120.062H75.1937ZM70.4437 106.375C71.8604 106.375 73.0792 106.708 74.1 107.375C75.1208 108.021 75.6312 109.24 75.6312 111.031C75.6312 112.802 75.1208 114.031 74.1 114.719C73.0792 115.385 71.8604 115.719 70.4437 115.719C69.0062 115.719 67.7771 115.385 66.7562 114.719C65.7562 114.031 65.2562 112.802 65.2562 111.031C65.2562 109.24 65.7562 108.021 66.7562 107.375C67.7771 106.708 69.0062 106.375 70.4437 106.375Z"}),E.jsx("path",{className:"fill-primary",d:"M18.3382 54.625C18.1007 55.7875 17.857 57.0187 17.607 58.3187C17.3695 59.6187 17.1507 60.8937 16.9507 62.1437C16.7632 63.3937 16.6132 64.5312 16.5007 65.5562H10.0882L9.807 65.1437C10.0445 64.2187 10.3382 63.1187 10.6882 61.8437C11.0507 60.5562 11.4382 59.2687 11.8507 57.9812C12.2757 56.6812 12.7007 55.5625 13.1257 54.625H18.3382ZM8.77575 54.625C8.53825 55.7875 8.2945 57.0187 8.0445 58.3187C7.807 59.6187 7.58825 60.8937 7.38825 62.1437C7.20075 63.3937 7.05075 64.5312 6.93825 65.5562H0.525749L0.244499 65.1437C0.481999 64.2187 0.775749 63.1187 1.12575 61.8437C1.48825 60.5562 1.87575 59.2687 2.28825 57.9812C2.71325 56.6812 3.13825 55.5625 3.56325 54.625H8.77575ZM61.2812 103H48.9688L29.0938 68.4375H28.8125C28.8958 69.875 28.9688 71.3229 29.0312 72.7812C29.0938 74.2396 29.1562 75.6979 29.2188 77.1562C29.2812 78.5938 29.3438 80.0417 29.4062 81.5V103H20.75V57.3125H32.9688L52.8125 91.5312H53.0312C52.9896 90.1146 52.9375 88.7083 52.875 87.3125C52.8125 85.9167 52.75 84.5208 52.6875 83.125C52.6458 81.7292 52.6042 80.3333 52.5625 78.9375V57.3125H61.2812V103ZM75.1937 68.0625V103H65.6625V68.0625H75.1937ZM70.4437 54.375C71.8604 54.375 73.0792 54.7083 74.1 55.375C75.1208 56.0208 75.6312 57.2396 75.6312 59.0312C75.6312 60.8021 75.1208 62.0312 74.1 62.7188C73.0792 63.3854 71.8604 63.7188 70.4437 63.7188C69.0062 63.7188 67.7771 63.3854 66.7562 62.7188C65.7562 62.0312 65.2562 60.8021 65.2562 59.0312C65.2562 57.2396 65.7562 56.0208 66.7562 55.375C67.7771 54.7083 69.0062 54.375 70.4437 54.375ZM119.856 67.4062C123.815 67.4062 126.804 68.4271 128.825 70.4688C130.867 72.4896 131.888 75.7396 131.888 80.2188V103H122.325V82.5938C122.325 80.0938 121.898 78.2083 121.044 76.9375C120.19 75.6667 118.867 75.0312 117.075 75.0312C114.554 75.0312 112.763 75.9375 111.7 77.75C110.638 79.5417 110.106 82.1146 110.106 85.4688V103H100.575V82.5938C100.575 80.9271 100.388 79.5312 100.013 78.4062C99.6375 77.2812 99.0646 76.4375 98.2938 75.875C97.5229 75.3125 96.5333 75.0312 95.325 75.0312C93.5542 75.0312 92.1583 75.4792 91.1375 76.375C90.1375 77.25 89.4188 78.5521 88.9813 80.2812C88.5646 81.9896 88.3563 84.0833 88.3563 86.5625V103H78.825V68.0625H86.1063L87.3875 72.5312H87.9188C88.6271 71.3229 89.5125 70.3438 90.575 69.5938C91.6583 68.8438 92.8458 68.2917 94.1375 67.9375C95.4292 67.5833 96.7417 67.4062 98.075 67.4062C100.638 67.4062 102.804 67.8229 104.575 68.6562C106.367 69.4896 107.742 70.7812 108.7 72.5312H109.544C110.585 70.7396 112.054 69.4375 113.95 68.625C115.867 67.8125 117.835 67.4062 119.856 67.4062ZM167.05 85.4688C167.05 88.3854 166.654 90.9688 165.863 93.2188C165.092 95.4688 163.956 97.375 162.456 98.9375C160.977 100.479 159.185 101.646 157.081 102.438C154.998 103.229 152.644 103.625 150.019 103.625C147.56 103.625 145.3 103.229 143.238 102.438C141.196 101.646 139.415 100.479 137.894 98.9375C136.394 97.375 135.227 95.4688 134.394 93.2188C133.581 90.9688 133.175 88.3854 133.175 85.4688C133.175 81.5938 133.863 78.3125 135.238 75.625C136.613 72.9375 138.571 70.8958 141.113 69.5C143.654 68.1042 146.685 67.4062 150.206 67.4062C153.477 67.4062 156.373 68.1042 158.894 69.5C161.435 70.8958 163.425 72.9375 164.863 75.625C166.321 78.3125 167.05 81.5938 167.05 85.4688ZM142.894 85.4688C142.894 87.7604 143.144 89.6875 143.644 91.25C144.144 92.8125 144.925 93.9896 145.988 94.7812C147.05 95.5729 148.435 95.9688 150.144 95.9688C151.831 95.9688 153.196 95.5729 154.238 94.7812C155.3 93.9896 156.071 92.8125 156.55 91.25C157.05 89.6875 157.3 87.7604 157.3 85.4688C157.3 83.1562 157.05 81.2396 156.55 79.7188C156.071 78.1771 155.3 77.0208 154.238 76.25C153.175 75.4792 151.79 75.0938 150.081 75.0938C147.56 75.0938 145.727 75.9583 144.581 77.6875C143.456 79.4167 142.894 82.0104 142.894 85.4688ZM182.031 54.625L182.294 55.0375C182.069 55.9625 181.775 57.0687 181.412 58.3562C181.062 59.6312 180.675 60.9125 180.25 62.2C179.837 63.4875 179.419 64.6062 178.994 65.5562H173.781C174.031 64.3937 174.275 63.1625 174.512 61.8625C174.75 60.5625 174.962 59.2875 175.15 58.0375C175.35 56.7875 175.506 55.65 175.619 54.625H182.031ZM172.469 54.625L172.75 55.0375C172.525 55.9625 172.231 57.0687 171.869 58.3562C171.506 59.6312 171.112 60.9125 170.687 62.2C170.275 63.4875 169.856 64.6062 169.431 65.5562H164.219C164.406 64.6812 164.587 63.7687 164.762 62.8187C164.95 61.8562 165.125 60.8937 165.287 59.9312C165.45 58.9687 165.594 58.0375 165.719 57.1375C165.856 56.225 165.969 55.3875 166.056 54.625H172.469Z"})]})}),LJ={colors:{primary:"#C559F4"}},Py=({children:n,logoOnly:e=!1})=>{const[t,i]=k.useState(0);k.useEffect(()=>{i(new Date().getFullYear())},[]);const s=({className:o})=>E.jsx("div",{className:o,children:e?E.jsx("div",{className:"h-44",children:E.jsx(ix,{className:"w-44 mt-8"})}):E.jsxs("div",{className:"flex h-44",children:[E.jsx("div",{className:"w-48 h-48",children:E.jsx(zJ,{color:LJ.colors.primary})}),E.jsx(ix,{className:"w-44 ml-4 mt-8"})]})}),r=()=>E.jsxs("div",{className:"md:col-span-3 mt-8 w-full flex flex-col text-sm justify-center items-center text-gray-500 dark:text-neutral-400",children:[E.jsxs("span",{className:"mb-2",children:["© ",t,' Wode "Nimo" Ni.']}),E.jsxs("div",{className:"flex items-start color-primary text-sm",children:[E.jsx(L1,{}),E.jsx(E1,{}),E.jsx(T1,{})]})]});return E.jsxs("div",{className:"font-sans md:grid md:grid-cols-3 p-4 md:p-10 max-w-screen-xl dark:text-neutral-100",children:[E.jsx(s,{className:"md:col-span-2"}),n,E.jsx(r,{})]})},EJ=`@inproceedings{recode-ni-2021, +`+t.fragmentShader),this.poissonBlurQuad?(this.poissonBlurQuad.material.dispose(),this.poissonBlurQuad.material=new Rt(t)):this.poissonBlurQuad=new Rh(new Rt(t))}generateHemisphereSamples(e){const t=[];for(let i=0;in.charCodeAt(0));const XJ=k.forwardRef(({screenSpaceRadius:n,quality:e,aoRadius:t=5,aoSamples:i=16,denoiseSamples:s=4,denoiseRadius:r=12,distanceFalloff:o=1,intensity:a=1,color:l},g)=>{const{camera:u,scene:C}=as(),d=k.useMemo(()=>new HJ(C,u),[]);return k.useLayoutEffect(()=>{$a(d.configuration,{color:l,aoRadius:t,distanceFalloff:o,intensity:a,aoSamples:i,denoiseSamples:s,denoiseRadius:r,screenSpaceRadius:n})},[n,l,t,o,a,i,s,r]),k.useLayoutEffect(()=>{e&&d.setQualityMode(e.charAt(0).toUpperCase()+e.slice(1))},[e]),L.jsx("primitive",{ref:g,object:d})}),Qm=WW.randFloatSpread;function FJ({mat:n=new _e,vec:e=new H,numBalls:t,color:i}){const s=new Kl(1,50,50),r=new Ap({color:i,roughness:0,envMapIntensity:1}),[o,a]=WM(()=>({args:[1],mass:1,angularDamping:.1,linearDamping:.65,position:[Qm(10),Qm(10),Qm(10)]}));return bC(l=>{for(let g=0;gt.viewport),[,e]=WM(()=>({type:"Kinematic",args:[3],position:[0,0,0]}));return bC(t=>e.position.set(-(t.mouse.x*n.width)/2,t.mouse.y*n.height/2,3))}const KJ=({intensity:n,color:e,distance:t,width:i,height:s})=>{const r=[];for(let a=0;a<10;a++)r.push([-i/2+i/(10-1)*a,t,s/2]),r.push([-i/2+i/(10-1)*a,t,-s/2]),r.push([i/2,t,-s/2+s/(10-1)*a]),r.push([-i/2,t,-s/2+s/(10-1)*a]);return L.jsx(L.Fragment,{children:r.map((a,l)=>L.jsx("pointLight",{position:a,intensity:n,color:e},l))})},zJ=({color:n,className:e})=>L.jsxs(Fk,{className:e,shadows:!0,gl:{antialias:!0},camera:{position:[0,0,-34],fov:20,near:1,far:1e3},children:[L.jsxs(jD,{gravity:[0,-8,0],iterations:10,children:[L.jsx(YJ,{}),L.jsx(FJ,{numBalls:20,color:n})]}),L.jsx("ambientLight",{intensity:1}),L.jsx(KJ,{intensity:.05,color:"#ffffff",distance:100,height:200,width:100}),L.jsxs(vJ,{disableNormalPass:!0,multisampling:0,children:[L.jsx(XJ,{color:"black",aoRadius:2,intensity:1,aoSamples:6,denoiseSamples:4}),L.jsx(SJ,{})]})]}),ix=({className:n})=>L.jsx("a",{href:"/",children:L.jsxs("svg",{className:n,width:"100%",height:"100%",viewBox:"0 0 180 180",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[L.jsx("path",{className:"fill-icontext dark:fill-icontext-dark",d:"M76.875 5.3125L65.25 51H54.2188L48.0312 27C47.9062 26.5417 47.7396 25.8438 47.5312 24.9062C47.3229 23.9688 47.1042 22.9479 46.875 21.8438C46.6458 20.7188 46.4375 19.6667 46.25 18.6875C46.0833 17.6875 45.9688 16.8958 45.9062 16.3125C45.8438 16.8958 45.7188 17.6771 45.5312 18.6562C45.3646 19.6354 45.1667 20.6771 44.9375 21.7812C44.7292 22.8854 44.5208 23.9167 44.3125 24.875C44.1042 25.8333 43.9375 26.5625 43.8125 27.0625L37.6562 51H26.6562L15 5.3125H24.5312L30.375 30.25C30.5417 31 30.7292 31.8958 30.9375 32.9375C31.1667 33.9792 31.3854 35.0729 31.5938 36.2188C31.8229 37.3438 32.0208 38.4375 32.1875 39.5C32.375 40.5417 32.5104 41.4479 32.5938 42.2188C32.6979 41.4271 32.8333 40.5104 33 39.4688C33.1667 38.4062 33.3438 37.3333 33.5312 36.25C33.7396 35.1458 33.9479 34.125 34.1562 33.1875C34.3646 32.25 34.5521 31.4896 34.7188 30.9062L41.375 5.3125H50.5312L57.1875 30.9062C57.3333 31.4688 57.5 32.2292 57.6875 33.1875C57.8958 34.125 58.1042 35.1458 58.3125 36.25C58.5208 37.3542 58.7083 38.4375 58.875 39.5C59.0625 40.5417 59.1979 41.4479 59.2812 42.2188C59.4271 41.1771 59.625 39.9167 59.875 38.4375C60.1458 36.9375 60.4271 35.4479 60.7188 33.9688C61.0312 32.4896 61.3021 31.25 61.5312 30.25L67.3438 5.3125H76.875ZM107.225 33.4688C107.225 36.3854 106.829 38.9688 106.037 41.2188C105.267 43.4688 104.131 45.375 102.631 46.9375C101.152 48.4792 99.3604 49.6458 97.2562 50.4375C95.1729 51.2292 92.8187 51.625 90.1937 51.625C87.7354 51.625 85.475 51.2292 83.4125 50.4375C81.3708 49.6458 79.5896 48.4792 78.0687 46.9375C76.5687 45.375 75.4021 43.4688 74.5687 41.2188C73.7562 38.9688 73.35 36.3854 73.35 33.4688C73.35 29.5938 74.0375 26.3125 75.4125 23.625C76.7875 20.9375 78.7458 18.8958 81.2875 17.5C83.8292 16.1042 86.8604 15.4062 90.3812 15.4062C93.6521 15.4062 96.5479 16.1042 99.0687 17.5C101.61 18.8958 103.6 20.9375 105.037 23.625C106.496 26.3125 107.225 29.5938 107.225 33.4688ZM83.0687 33.4688C83.0687 35.7604 83.3187 37.6875 83.8187 39.25C84.3187 40.8125 85.1 41.9896 86.1625 42.7812C87.225 43.5729 88.6104 43.9688 90.3187 43.9688C92.0062 43.9688 93.3708 43.5729 94.4125 42.7812C95.475 41.9896 96.2458 40.8125 96.725 39.25C97.225 37.6875 97.475 35.7604 97.475 33.4688C97.475 31.1562 97.225 29.2396 96.725 27.7188C96.2458 26.1771 95.475 25.0208 94.4125 24.25C93.35 23.4792 91.9646 23.0938 90.2562 23.0938C87.7354 23.0938 85.9021 23.9583 84.7562 25.6875C83.6312 27.4167 83.0687 30.0104 83.0687 33.4688ZM122.003 51.625C118.107 51.625 114.93 50.1042 112.471 47.0625C110.034 44 108.815 39.5104 108.815 33.5938C108.815 27.6146 110.055 23.0938 112.534 20.0312C115.013 16.9479 118.253 15.4062 122.253 15.4062C123.919 15.4062 125.388 15.6354 126.659 16.0938C127.93 16.5521 129.023 17.1667 129.94 17.9375C130.878 18.7083 131.669 19.5729 132.315 20.5312H132.628C132.503 19.8646 132.346 18.8854 132.159 17.5938C131.992 16.2812 131.909 14.9375 131.909 13.5625V2.375H141.471V51H134.159L132.315 46.4688H131.909C131.305 47.4271 130.544 48.3021 129.628 49.0938C128.732 49.8646 127.659 50.4792 126.409 50.9375C125.159 51.3958 123.69 51.625 122.003 51.625ZM125.346 44.0312C127.95 44.0312 129.784 43.2604 130.846 41.7188C131.93 40.1562 132.503 37.8125 132.565 34.6875V33.6562C132.565 30.2604 132.044 27.6667 131.003 25.875C129.961 24.0625 128.023 23.1562 125.19 23.1562C123.086 23.1562 121.44 24.0625 120.253 25.875C119.065 27.6875 118.471 30.3021 118.471 33.7188C118.471 37.1354 119.065 39.7083 120.253 41.4375C121.461 43.1667 123.159 44.0312 125.346 44.0312ZM159.446 15.4062C162.675 15.4062 165.457 16.0312 167.79 17.2812C170.123 18.5104 171.925 20.3021 173.196 22.6562C174.467 25.0104 175.103 27.8854 175.103 31.2812V35.9062H152.571C152.675 38.5938 153.478 40.7083 154.978 42.25C156.498 43.7708 158.603 44.5312 161.29 44.5312C163.519 44.5312 165.561 44.3021 167.415 43.8438C169.269 43.3854 171.175 42.6979 173.134 41.7812V49.1562C171.405 50.0104 169.592 50.6354 167.696 51.0312C165.821 51.4271 163.54 51.625 160.853 51.625C157.353 51.625 154.248 50.9792 151.54 49.6875C148.853 48.3958 146.738 46.4271 145.196 43.7812C143.675 41.1354 142.915 37.8021 142.915 33.7812C142.915 29.6979 143.603 26.3021 144.978 23.5938C146.373 20.8646 148.311 18.8229 150.79 17.4688C153.269 16.0938 156.155 15.4062 159.446 15.4062ZM159.509 22.1875C157.655 22.1875 156.113 22.7812 154.884 23.9688C153.675 25.1562 152.978 27.0208 152.79 29.5625H166.165C166.144 28.1458 165.884 26.8854 165.384 25.7812C164.905 24.6771 164.175 23.8021 163.196 23.1562C162.238 22.5104 161.009 22.1875 159.509 22.1875ZM61.2812 155H48.9688L29.0938 120.438H28.8125C28.8958 121.875 28.9688 123.323 29.0312 124.781C29.0938 126.24 29.1562 127.698 29.2188 129.156C29.2812 130.594 29.3438 132.042 29.4062 133.5V155H20.75V109.312H32.9688L52.8125 143.531H53.0312C52.9896 142.115 52.9375 140.708 52.875 139.312C52.8125 137.917 52.75 136.521 52.6875 135.125C52.6458 133.729 52.6042 132.333 52.5625 130.938V109.312H61.2812V155ZM75.1937 120.062V155H65.6625V120.062H75.1937ZM70.4437 106.375C71.8604 106.375 73.0792 106.708 74.1 107.375C75.1208 108.021 75.6312 109.24 75.6312 111.031C75.6312 112.802 75.1208 114.031 74.1 114.719C73.0792 115.385 71.8604 115.719 70.4437 115.719C69.0062 115.719 67.7771 115.385 66.7562 114.719C65.7562 114.031 65.2562 112.802 65.2562 111.031C65.2562 109.24 65.7562 108.021 66.7562 107.375C67.7771 106.708 69.0062 106.375 70.4437 106.375Z"}),L.jsx("path",{className:"fill-primary",d:"M18.3382 54.625C18.1007 55.7875 17.857 57.0187 17.607 58.3187C17.3695 59.6187 17.1507 60.8937 16.9507 62.1437C16.7632 63.3937 16.6132 64.5312 16.5007 65.5562H10.0882L9.807 65.1437C10.0445 64.2187 10.3382 63.1187 10.6882 61.8437C11.0507 60.5562 11.4382 59.2687 11.8507 57.9812C12.2757 56.6812 12.7007 55.5625 13.1257 54.625H18.3382ZM8.77575 54.625C8.53825 55.7875 8.2945 57.0187 8.0445 58.3187C7.807 59.6187 7.58825 60.8937 7.38825 62.1437C7.20075 63.3937 7.05075 64.5312 6.93825 65.5562H0.525749L0.244499 65.1437C0.481999 64.2187 0.775749 63.1187 1.12575 61.8437C1.48825 60.5562 1.87575 59.2687 2.28825 57.9812C2.71325 56.6812 3.13825 55.5625 3.56325 54.625H8.77575ZM61.2812 103H48.9688L29.0938 68.4375H28.8125C28.8958 69.875 28.9688 71.3229 29.0312 72.7812C29.0938 74.2396 29.1562 75.6979 29.2188 77.1562C29.2812 78.5938 29.3438 80.0417 29.4062 81.5V103H20.75V57.3125H32.9688L52.8125 91.5312H53.0312C52.9896 90.1146 52.9375 88.7083 52.875 87.3125C52.8125 85.9167 52.75 84.5208 52.6875 83.125C52.6458 81.7292 52.6042 80.3333 52.5625 78.9375V57.3125H61.2812V103ZM75.1937 68.0625V103H65.6625V68.0625H75.1937ZM70.4437 54.375C71.8604 54.375 73.0792 54.7083 74.1 55.375C75.1208 56.0208 75.6312 57.2396 75.6312 59.0312C75.6312 60.8021 75.1208 62.0312 74.1 62.7188C73.0792 63.3854 71.8604 63.7188 70.4437 63.7188C69.0062 63.7188 67.7771 63.3854 66.7562 62.7188C65.7562 62.0312 65.2562 60.8021 65.2562 59.0312C65.2562 57.2396 65.7562 56.0208 66.7562 55.375C67.7771 54.7083 69.0062 54.375 70.4437 54.375ZM119.856 67.4062C123.815 67.4062 126.804 68.4271 128.825 70.4688C130.867 72.4896 131.888 75.7396 131.888 80.2188V103H122.325V82.5938C122.325 80.0938 121.898 78.2083 121.044 76.9375C120.19 75.6667 118.867 75.0312 117.075 75.0312C114.554 75.0312 112.763 75.9375 111.7 77.75C110.638 79.5417 110.106 82.1146 110.106 85.4688V103H100.575V82.5938C100.575 80.9271 100.388 79.5312 100.013 78.4062C99.6375 77.2812 99.0646 76.4375 98.2938 75.875C97.5229 75.3125 96.5333 75.0312 95.325 75.0312C93.5542 75.0312 92.1583 75.4792 91.1375 76.375C90.1375 77.25 89.4188 78.5521 88.9813 80.2812C88.5646 81.9896 88.3563 84.0833 88.3563 86.5625V103H78.825V68.0625H86.1063L87.3875 72.5312H87.9188C88.6271 71.3229 89.5125 70.3438 90.575 69.5938C91.6583 68.8438 92.8458 68.2917 94.1375 67.9375C95.4292 67.5833 96.7417 67.4062 98.075 67.4062C100.638 67.4062 102.804 67.8229 104.575 68.6562C106.367 69.4896 107.742 70.7812 108.7 72.5312H109.544C110.585 70.7396 112.054 69.4375 113.95 68.625C115.867 67.8125 117.835 67.4062 119.856 67.4062ZM167.05 85.4688C167.05 88.3854 166.654 90.9688 165.863 93.2188C165.092 95.4688 163.956 97.375 162.456 98.9375C160.977 100.479 159.185 101.646 157.081 102.438C154.998 103.229 152.644 103.625 150.019 103.625C147.56 103.625 145.3 103.229 143.238 102.438C141.196 101.646 139.415 100.479 137.894 98.9375C136.394 97.375 135.227 95.4688 134.394 93.2188C133.581 90.9688 133.175 88.3854 133.175 85.4688C133.175 81.5938 133.863 78.3125 135.238 75.625C136.613 72.9375 138.571 70.8958 141.113 69.5C143.654 68.1042 146.685 67.4062 150.206 67.4062C153.477 67.4062 156.373 68.1042 158.894 69.5C161.435 70.8958 163.425 72.9375 164.863 75.625C166.321 78.3125 167.05 81.5938 167.05 85.4688ZM142.894 85.4688C142.894 87.7604 143.144 89.6875 143.644 91.25C144.144 92.8125 144.925 93.9896 145.988 94.7812C147.05 95.5729 148.435 95.9688 150.144 95.9688C151.831 95.9688 153.196 95.5729 154.238 94.7812C155.3 93.9896 156.071 92.8125 156.55 91.25C157.05 89.6875 157.3 87.7604 157.3 85.4688C157.3 83.1562 157.05 81.2396 156.55 79.7188C156.071 78.1771 155.3 77.0208 154.238 76.25C153.175 75.4792 151.79 75.0938 150.081 75.0938C147.56 75.0938 145.727 75.9583 144.581 77.6875C143.456 79.4167 142.894 82.0104 142.894 85.4688ZM182.031 54.625L182.294 55.0375C182.069 55.9625 181.775 57.0687 181.412 58.3562C181.062 59.6312 180.675 60.9125 180.25 62.2C179.837 63.4875 179.419 64.6062 178.994 65.5562H173.781C174.031 64.3937 174.275 63.1625 174.512 61.8625C174.75 60.5625 174.962 59.2875 175.15 58.0375C175.35 56.7875 175.506 55.65 175.619 54.625H182.031ZM172.469 54.625L172.75 55.0375C172.525 55.9625 172.231 57.0687 171.869 58.3562C171.506 59.6312 171.112 60.9125 170.687 62.2C170.275 63.4875 169.856 64.6062 169.431 65.5562H164.219C164.406 64.6812 164.587 63.7687 164.762 62.8187C164.95 61.8562 165.125 60.8937 165.287 59.9312C165.45 58.9687 165.594 58.0375 165.719 57.1375C165.856 56.225 165.969 55.3875 166.056 54.625H172.469Z"})]})}),LJ={colors:{primary:"#C559F4"}},Py=({children:n,logoOnly:e=!1})=>{const[t,i]=k.useState(0);k.useEffect(()=>{i(new Date().getFullYear())},[]);const s=({className:o})=>L.jsx("div",{className:o,children:e?L.jsx("div",{className:"h-44",children:L.jsx(ix,{className:"w-44 mt-8"})}):L.jsxs("div",{className:"flex h-44",children:[L.jsx("div",{className:"w-48 h-48",children:L.jsx(zJ,{color:LJ.colors.primary})}),L.jsx(ix,{className:"w-44 ml-4 mt-8"})]})}),r=()=>L.jsxs("div",{className:"md:col-span-3 mt-8 w-full flex flex-col text-sm justify-center items-center text-gray-500 dark:text-neutral-400",children:[L.jsxs("span",{className:"mb-2",children:["© ",t,' Wode "Nimo" Ni.']}),L.jsxs("div",{className:"flex items-start color-primary text-sm",children:[L.jsx(L1,{}),L.jsx(E1,{}),L.jsx(T1,{})]})]});return L.jsxs("div",{className:"font-sans md:grid md:grid-cols-3 p-4 md:p-10 max-w-screen-xl dark:text-neutral-100",children:[L.jsx(s,{className:"md:col-span-2"}),n,L.jsx(r,{})]})},EJ=`@inproceedings{recode-ni-2021, author = {Ni, Wode and Sunshine, Joshua and Le, Vu and Gulwani, Sumit and Barik, Titus}, title = {reCode: A Lightweight Find-and-Replace Interaction in the IDE for Transforming Code by Example}, year = {2021}, @@ -4981,10 +4981,10 @@ void main() { `,C+=" "+f+` `,C+=" "+Array(v).join(" ")+"^"}return C+" at index "+(this.index-1)},g.fail={},g.prototype.feed=function(u){var C=this.lexer;C.reset(u,this.lexerState);for(var d;d=C.next();){var h=this.table[this.current];this.options.keepHistory||delete this.table[this.current-1];var f=this.current+1,v=new o(this.grammar,f);this.table.push(v);for(var y=d.value,A=C.constructor===l?d.value:d,b=h.scannable,m=b.length;m--;){var B=b[m],S=B.rule.symbols[B.dot];if(S.test?S.test(A):S.type?S.type===d.type:S.literal===y){var x=B.nextState({data:A,token:d,isToken:!0,reference:f-1});v.states.push(x)}}if(v.process(),v.states.length===0){var R=this.lexer.formatError(d,"invalid syntax")+` `;R+="Unexpected "+(d.type?d.type+" token: ":""),R+=JSON.stringify(d.value!==void 0?d.value:d)+` -`;var M=new Error(R);throw M.offset=this.current,M.token=d,M}this.options.keepHistory&&(h.lexerState=C.save()),this.current++}return h&&(this.lexerState=C.save()),this.results=this.finish(),this},g.prototype.save=function(){var u=this.table[this.current];return u.lexerState=this.lexerState,u},g.prototype.restore=function(u){var C=u.index;this.current=C,this.table[C]=u,this.table.splice(C+1),this.lexerState=u.lexerState,this.results=this.finish()},g.prototype.rewind=function(u){if(!this.options.keepHistory)throw new Error("set option `keepHistory` to enable rewinding");this.restore(this.table[u])},g.prototype.finish=function(){var u=[],C=this.grammar.start;return this.table[this.table.length-1].states.forEach(function(d){d.rule.name===C&&d.dot===d.rule.symbols.length&&d.reference===0&&d.data!==g.fail&&u.push(d)}),u.map(function(d){return d.data})},{Parser:g,Grammar:a,Rule:s}})},function(t,i,s){function r(Z){return Z[0]}function o(Z,V){if(V.type!=="keyval")throw new Error("Expected a keyval object");var N=V.key.toLowerCase();return Z.fields[N]?void 0:(Z.fields[N]=V.value,Z)}function a(Z){for(var V=[],N=0;N=this.str.length)){var d=this.str.charAt(this.pos);return o.isSingleWhiteSpaceCharacter(d)?this.eatWhiteSpace():r.isSpecialChar(d)?this.eatSpecialChars(d):a.isNum(d)?this.eatNumericString(d):this.eatIdString()}},C.prototype.eatIdString=function(){for(var d=[],h=this.pos,f=h;f{switch(n){case"workshop":case"conference":return Ju.normalizeFieldValue(e.getField("booktitle"));case"journal":return Ju.normalizeFieldValue(e.getField("journal"))}},UJ=n=>` +`;var M=new Error(R);throw M.offset=this.current,M.token=d,M}this.options.keepHistory&&(h.lexerState=C.save()),this.current++}return h&&(this.lexerState=C.save()),this.results=this.finish(),this},g.prototype.save=function(){var u=this.table[this.current];return u.lexerState=this.lexerState,u},g.prototype.restore=function(u){var C=u.index;this.current=C,this.table[C]=u,this.table.splice(C+1),this.lexerState=u.lexerState,this.results=this.finish()},g.prototype.rewind=function(u){if(!this.options.keepHistory)throw new Error("set option `keepHistory` to enable rewinding");this.restore(this.table[u])},g.prototype.finish=function(){var u=[],C=this.grammar.start;return this.table[this.table.length-1].states.forEach(function(d){d.rule.name===C&&d.dot===d.rule.symbols.length&&d.reference===0&&d.data!==g.fail&&u.push(d)}),u.map(function(d){return d.data})},{Parser:g,Grammar:a,Rule:s}})},function(t,i,s){function r(Z){return Z[0]}function o(Z,V){if(V.type!=="keyval")throw new Error("Expected a keyval object");var N=V.key.toLowerCase();return Z.fields[N]?void 0:(Z.fields[N]=V.value,Z)}function a(Z){for(var V=[],N=0;N=this.str.length)){var d=this.str.charAt(this.pos);return o.isSingleWhiteSpaceCharacter(d)?this.eatWhiteSpace():r.isSpecialChar(d)?this.eatSpecialChars(d):a.isNum(d)?this.eatNumericString(d):this.eatIdString()}},C.prototype.eatIdString=function(){for(var d=[],h=this.pos,f=h;f{switch(n){case"workshop":case"conference":return Ou.normalizeFieldValue(e.getField("booktitle"));case"journal":return Ou.normalizeFieldValue(e.getField("journal"))}},UJ=n=>` @${n.type} { ${Object.entries(n.fields).map(([e,t])=>` ${e} = {${n.getFieldAsString(e)}}`).join(`, `)} } -`,PJ=(n,e,t)=>{const i=e.getField("author"),s=e.getField("title"),r=e.getField("series");if(i&&s&&r)return{title:Ju.normalizeFieldValue(s),authors:i.authors$.map(o=>o.firstNames.concat(o.vons).concat(o.lastNames).concat(o.jrs).join(" ")),series:Ju.normalizeFieldValue(r).replace(/\s/g,""),venue:DJ(t.type,e),id:n,bibtex:UJ(e),...t};throw new Error(`cannot read field from entry ${e._id}`)},_J=n=>Object.entries(kJ).map(([e,t])=>{const i=n.getEntry(e);if(i)return PJ(e,i,t);throw new Error(`cannot find bib entry ${e}`)}),JJ=_J(TJ),jm=({name:n,desc:e,link:t,logo:i,dark:s})=>E.jsx("a",{href:t,children:E.jsxs("div",{className:`rounded shadow-md hover:shadow-xl w-full h-36 lg:h-48 bg-white dark:shadow-none dark:bg-zinc-700 dark:rounded-lg dark:border-primary bg-contain bg-left-top dark:drop-shadow-none dark:hover:drop-shadow-none dark:transition-none transition-all ease-in-out duration-100 dark:hover:shadow-md dark:hover:scale-105 overflow-hidden scale-100 - `,children:[E.jsxs("svg",{className:"absolute z-[-50]",width:"100%",viewBox:"0 0 100 100",children:[E.jsxs("defs",{children:[E.jsx("filter",{id:"grayscale-filter",children:E.jsx("feColorMatrix",{type:"saturate",values:"0"})}),E.jsxs("filter",{id:"color-tint-filter",children:[E.jsx("feColorMatrix",{type:"matrix",values:"0.7725 0 0 0 0 0 0.3490 0 0 0 0 0 0.9569 0 0 0 0 0 1 0"}),E.jsxs("feComponentTransfer",{children:[E.jsx("feFuncR",{type:"table",tableValues:"0 0.7725"}),E.jsx("feFuncG",{type:"table",tableValues:"0 0.3490"}),E.jsx("feFuncB",{type:"table",tableValues:"0 0.9569"})]})]}),E.jsxs("linearGradient",{id:"gradient-overlay",x1:"0%",y1:"50%",x2:"100%",y2:"50%",children:[E.jsx("stop",{offset:"0%",style:{stopColor:s?"#333":"#fff",stopOpacity:.3}}),E.jsx("stop",{offset:"50%",style:{stopColor:s?"#111":"#fff",stopOpacity:s?.35:.7}}),E.jsx("stop",{offset:"100%",style:{stopColor:s?"#333":"#fff",stopOpacity:.95}})]})]}),E.jsx("image",{href:i,x:50,y:-8,width:80,filter:s?"url(#grayscale-filter) ":""}),E.jsx("rect",{width:"100",height:"100",style:{fill:"url(#gradient-overlay)"}})]}),E.jsx("div",{className:"text-3xl -font-medium w-7/10 px-6 pt-4 lg:py-6 text-primary/70 dark:text-primary",children:n}),E.jsx("div",{className:"text-lg font-extralight w-7/10 px-6 py-4 lg:py-6",children:e})]})}),OJ="/pr-preview/pr-22/assets/edgeworth.svg",QJ="/pr-preview/pr-22/assets/mathdiagrams.webp",jJ="/pr-preview/pr-22/assets/penrose.svg",qJ=()=>{const[n,e]=k.useState(!1),t=k.useRef(null);return k.useEffect(()=>{const i=()=>{if(t.current!==null){const s=t.current.scrollTop===0;e(!s)}};if(t.current!==null){const s=t.current;return s.addEventListener("scroll",i),()=>{s.removeEventListener("scroll",i)}}},[]),E.jsxs("div",{className:"my-2 relative",children:[n&&E.jsx("div",{className:"invisible md:visible absolute top-0 left-0 right-0 h-10 bg-gradient-to-b from-white dark:from-zinc-800 to-transparent"}),E.jsx("div",{ref:t,className:"overflow-auto max-h-[50vh]",children:DX.map(({time:i,msg:s},r)=>E.jsxs("div",{className:"py-2 text-gray-500 md:text-sm dark:text-neutral-300 ",children:[E.jsx("div",{className:"w-fit bg-gray-100 text-gray-400 rounded py-px px-1 dark:text-neutral-400 dark:bg-zinc-700",children:i.toLocaleString("default",{month:"long",year:"numeric"})}),s]},`news-${r}`))}),E.jsx("div",{className:"invisible md:visible absolute bottom-0 left-0 right-0 h-12 bg-gradient-to-t from-white dark:from-zinc-800 to-transparent"})]})},$J=({data:n,children:e})=>{const[t,i]=k.useState(!1),s=()=>{navigator.clipboard.writeText(n),i(!0),setTimeout(()=>{i(!1)},5e3)};return E.jsxs("div",{children:[E.jsx("span",{className:"underline decoration-primary/50 dark:decoration-primary/70 decoration-2 cursor-pointer hover:decoration-primary hover:decoration-3 ease-in-out duration-100",onClick:s,children:e}),t&&E.jsx("span",{children:" (Copied to clipboard)"})]})},eO=()=>E.jsx("div",{children:JJ.map(({pdf:n,title:e,venue:t,authors:i,talk:s,coauthors:r,series:o,slides:a,id:l,bibtex:g})=>E.jsxs("div",{className:"my-4",children:[E.jsx("a",{href:n,children:E.jsx("span",{className:"text-lg font-semibold dark:font-normal cursor-pointer",children:e})}),E.jsx("br",{}),E.jsx("span",{className:"text-base font-light",children:i.map(u=>r?.includes(u)?`${u}*`:u).map(u=>u==="Wode Ni"||u==="Wode Ni*"?E.jsx("strong",{children:u}):u).map((u,C)=>E.jsxs("span",{children:[E.jsx("li",{className:"inline",children:u}),C!==i.length-1&&E.jsx("span",{children:", "})]},`${l}-author-${C}`))}),"."," ",E.jsx("span",{className:"text-base font-light italic",children:o}),".",E.jsxs("div",{className:"flex gap-2",children:[E.jsxs("div",{className:"flex items-center gap-0.5",children:[E.jsx(hH,{}),E.jsx($J,{data:g,children:"bib"})]}),n&&E.jsxs("div",{className:"flex items-center gap-0.5",children:[E.jsx(fH,{}),E.jsx(Qt,{href:n,children:"pdf"})]}),s&&E.jsxs("div",{className:"flex items-center gap-0.5",children:[E.jsx(mH,{}),E.jsx(Qt,{href:s,children:"talk"})]}),a&&E.jsxs("div",{className:"flex items-center gap-0.5",children:[E.jsx(dH,{}),E.jsx(Qt,{href:a,children:"slides"})]})]})]},l))}),tO=()=>E.jsx("div",{className:"flex items-end md:items-top md:ml-auto mb-0 color-primary font-light md:text-lg font-mono md:mt-4 gap-2 md:flex-col",children:E.jsx(Qt,{href:"/posts",children:E.jsx("span",{children:"/Posts"})})}),nO=()=>{const{darkMode:n,toggleDark:e}=k.useContext(JA);return E.jsxs(Py,{children:[E.jsxs("div",{className:"md:col-span-1 justify-left flex flex-col",children:[E.jsx(Uv,{className:"mt-8",toggleDark:e}),E.jsx(tO,{})]}),E.jsx(zI,{className:"md:col-span-2 mt-8",children:"I'm Nimo. I build ergonomic digital tools to make difficult things feel simple."}),E.jsxs("div",{className:"max-w-screen-md md:col-span-2",children:[E.jsxs(kg,{header:"Research",children:[E.jsxs(zI,{className:"",children:["I am a Ph.D. candidate at Carnegie Mellon University, School of Computer Science, advised by"," ",E.jsx(Qt,{href:"http://pact.cs.cmu.edu/koedinger.html",children:"Ken Koedinger"})," ","and ",E.jsx(Qt,{href:"https://www.cs.cmu.edu/~jssunshi/",children:"Josh Sunshine"}),"."]}),E.jsx(eO,{})]}),E.jsx(kg,{header:"Tools",children:E.jsxs("div",{className:"grid lg:grid-cols-2 gap-2 md:gap-4 lg:gap-8 my-4",children:[E.jsx(jm,{name:"Penrose",desc:"Create beautiful diagrams just by typing math notation in plain text.",link:"https://penrose.cs.cmu.edu/",logo:jJ,dark:n}),E.jsx(jm,{name:"Edgeworth",desc:"Diagrammatic problem generation by program mutation.",link:"https://penrose.github.io/penrose/edgeworth/develop/",logo:OJ,dark:n}),E.jsx(jm,{name:"Math Diagrams",desc:"A growing collection of open-source math visualizations.",link:"https://mathdiagrams.com/",dark:n,logo:QJ})]})}),E.jsxs(kg,{header:"About",children:[E.jsx(zI,{children:'My name is 倪沃德 (ní wò dé) in Chinese. “Nimo” has been my alias since my street dancing days. If you find "Wo-de" hard to pronounce, default to “Nimo”.'}),E.jsx(zI,{children:"I am an avid pool player. I play in local leagues and national tournaments."})]})]}),E.jsx("div",{className:"md:ml-10 md:max-w-60",children:E.jsx(kg,{header:"News",children:E.jsx(qJ,{})})})]})};const iO=Object.assign({"./posts/why.md":()=>rx(()=>import("./why-6c324fc6.js"),[])}),sO=()=>{const{darkMode:n,toggleDark:e}=k.useContext(JA),[t,i]=k.useState([]);return k.useEffect(()=>{async function s(){const r=Object.entries(iO).map(async([o,a])=>{const{attributes:l,html:g}=await a();return{path:o,attributes:l,html:g}});return Promise.all(r)}s().then(r=>{i(r)})},[]),E.jsxs(Py,{children:[E.jsxs("div",{className:"md:col-span-1 justify-left flex flex-col",children:[E.jsx(Uv,{className:"mt-8",toggleDark:e}),E.jsx("div",{className:"flex items-end md:items-top md:ml-auto mb-0 color-primary font-light md:text-lg font-mono md:mt-4 gap-2 md:flex-col",children:E.jsx(Qt,{href:"/",children:E.jsx("span",{children:"/Home"})})})]}),E.jsxs("div",{className:"max-w-screen-md md:col-span-2",children:[E.jsx(zI,{className:"md:col-span-2 mt-8",children:"Writing is tough, but I try to do a bit more every day."}),E.jsx(kg,{header:"Posts",children:t.map((s,r)=>E.jsxs("p",{className:"my-4 text-xl",children:[E.jsx("span",{className:"text-gray-500 dark:text-neutral-400 font-mono text-lg mr-4",children:s.attributes.date}),E.jsx(Qt,{href:`/posts/${s.path.split("/").pop().replace(".md","")}`,children:s.attributes.title})]},r))})]})]})},rO=()=>E.jsx("div",{children:E.jsx("h1",{children:"Pool"})}),oO=({post:n})=>{const{darkMode:e,toggleDark:t}=k.useContext(JA);return E.jsxs(Py,{children:[E.jsxs("div",{className:"md:col-span-1 justify-left flex flex-col",children:[E.jsx(Uv,{className:"mt-8",toggleDark:t}),E.jsxs("div",{className:"flex items-end md:items-top md:ml-auto mb-0 color-primary font-light md:text-lg font-mono md:mt-4 gap-2 md:flex-col",children:[E.jsx(Qt,{href:"/",children:E.jsx("span",{children:"/Home"})}),E.jsx(Qt,{href:"/posts",children:E.jsx("span",{children:"/Posts"})})]})]}),E.jsxs("div",{className:"max-w-screen-md md:col-span-2 mt-8",children:[E.jsx(kg,{header:n.attributes.title}),E.jsx("article",{className:"prose dark:prose-invert",dangerouslySetInnerHTML:{__html:n.html}})]})]})},sx=Object.assign({"./posts/why.md":()=>rx(()=>import("./why-6c324fc6.js"),[])}),aO=async()=>await Promise.all(Object.keys(sx).map(async e=>{const t=await sx[e]();return{path:`/posts/${e.split("/").pop()?.replace(".md","")}`,element:E.jsx(oO,{post:t})}})),lO=async()=>{const n=await aO();return RX([{path:"/",element:E.jsx(nO,{})},{path:"/posts",element:E.jsx(sO,{})},{path:"/pool",element:E.jsx(rO,{})},...n])},gO=()=>{const[n,e]=k.useState(null);k.useEffect(()=>{lO().then(r=>e(r))},[]);const[t,i]=k.useState(window.matchMedia("(prefers-color-scheme: dark)").matches),s=()=>{i(!t)};return k.useEffect(()=>{function r(){window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?i(!0):i(!1)}window.matchMedia("(prefers-color-scheme: dark)").addEventListener("change",r)},[]),k.useEffect(()=>{document.documentElement.classList.toggle("dark",t)},[t]),n?E.jsx(Ki.StrictMode,{children:E.jsx(JA.Provider,{value:{darkMode:t,toggleDark:s},children:E.jsx(vX,{router:n})})}):E.jsx("div",{children:"Loading..."})};qm.createRoot(document.getElementById("root")).render(E.jsx(Ki.StrictMode,{children:E.jsx(gO,{})})); +`,PJ=(n,e,t)=>{const i=e.getField("author"),s=e.getField("title"),r=e.getField("series");if(i&&s&&r)return{title:Ou.normalizeFieldValue(s),authors:i.authors$.map(o=>o.firstNames.concat(o.vons).concat(o.lastNames).concat(o.jrs).join(" ")),series:Ou.normalizeFieldValue(r).replace(/\s/g,""),venue:DJ(t.type,e),id:n,bibtex:UJ(e),...t};throw new Error(`cannot read field from entry ${e._id}`)},_J=n=>Object.entries(kJ).map(([e,t])=>{const i=n.getEntry(e);if(i)return PJ(e,i,t);throw new Error(`cannot find bib entry ${e}`)}),JJ=_J(TJ),jm=({name:n,desc:e,link:t,logo:i,dark:s})=>L.jsx("a",{href:t,children:L.jsxs("div",{className:`rounded shadow-md hover:shadow-xl w-full h-36 lg:h-48 bg-white dark:shadow-none dark:bg-zinc-700 dark:rounded-lg dark:border-primary bg-contain bg-left-top dark:drop-shadow-none dark:hover:drop-shadow-none dark:transition-none transition-all ease-in-out duration-100 dark:hover:shadow-md dark:hover:scale-105 overflow-hidden scale-100 + `,children:[L.jsxs("svg",{className:"absolute z-[-50]",width:"100%",viewBox:"0 0 100 100",children:[L.jsxs("defs",{children:[L.jsx("filter",{id:"grayscale-filter",children:L.jsx("feColorMatrix",{type:"saturate",values:"0"})}),L.jsxs("filter",{id:"color-tint-filter",children:[L.jsx("feColorMatrix",{type:"matrix",values:"0.7725 0 0 0 0 0 0.3490 0 0 0 0 0 0.9569 0 0 0 0 0 1 0"}),L.jsxs("feComponentTransfer",{children:[L.jsx("feFuncR",{type:"table",tableValues:"0 0.7725"}),L.jsx("feFuncG",{type:"table",tableValues:"0 0.3490"}),L.jsx("feFuncB",{type:"table",tableValues:"0 0.9569"})]})]}),L.jsxs("linearGradient",{id:"gradient-overlay",x1:"0%",y1:"50%",x2:"100%",y2:"50%",children:[L.jsx("stop",{offset:"0%",style:{stopColor:s?"#333":"#fff",stopOpacity:.3}}),L.jsx("stop",{offset:"50%",style:{stopColor:s?"#111":"#fff",stopOpacity:s?.35:.7}}),L.jsx("stop",{offset:"100%",style:{stopColor:s?"#333":"#fff",stopOpacity:.95}})]})]}),L.jsx("image",{href:i,x:50,y:-8,width:80,filter:s?"url(#grayscale-filter) ":""}),L.jsx("rect",{width:"100",height:"100",style:{fill:"url(#gradient-overlay)"}})]}),L.jsx("div",{className:"text-3xl -font-medium w-7/10 px-6 pt-4 lg:py-6 text-primary/70 dark:text-primary",children:n}),L.jsx("div",{className:"text-lg font-extralight w-7/10 px-6 py-4 lg:py-6",children:e})]})}),OJ="/pr-preview/pr-22/assets/edgeworth.svg",QJ="/pr-preview/pr-22/assets/mathdiagrams.webp",jJ="/pr-preview/pr-22/assets/penrose.svg",qJ=()=>{const[n,e]=k.useState(!1),t=k.useRef(null);return k.useEffect(()=>{const i=()=>{if(t.current!==null){const s=t.current.scrollTop===0;e(!s)}};if(t.current!==null){const s=t.current;return s.addEventListener("scroll",i),()=>{s.removeEventListener("scroll",i)}}},[]),L.jsxs("div",{className:"my-2 relative",children:[n&&L.jsx("div",{className:"invisible md:visible absolute top-0 left-0 right-0 h-10 bg-gradient-to-b from-white dark:from-zinc-800 to-transparent"}),L.jsx("div",{ref:t,className:"overflow-auto max-h-[50vh]",children:DX.map(({time:i,msg:s},r)=>L.jsxs("div",{className:"py-2 text-gray-500 md:text-sm dark:text-neutral-300 ",children:[L.jsx("div",{className:"w-fit bg-gray-100 text-gray-400 rounded py-px px-1 dark:text-neutral-400 dark:bg-zinc-700",children:i.toLocaleString("default",{month:"long",year:"numeric"})}),s]},`news-${r}`))}),L.jsx("div",{className:"invisible md:visible absolute bottom-0 left-0 right-0 h-12 bg-gradient-to-t from-white dark:from-zinc-800 to-transparent"})]})},$J=({data:n,children:e})=>{const[t,i]=k.useState(!1),s=()=>{navigator.clipboard.writeText(n),i(!0),setTimeout(()=>{i(!1)},5e3)};return L.jsxs("div",{children:[L.jsx("span",{className:"underline decoration-primary/50 dark:decoration-primary/70 decoration-2 cursor-pointer hover:decoration-primary hover:decoration-3 ease-in-out duration-100",onClick:s,children:e}),t&&L.jsx("span",{children:" (Copied to clipboard)"})]})},eO=()=>L.jsx("div",{children:JJ.map(({pdf:n,title:e,venue:t,authors:i,talk:s,coauthors:r,series:o,slides:a,id:l,bibtex:g})=>L.jsxs("div",{className:"my-4",children:[L.jsx("a",{href:n,children:L.jsx("span",{className:"text-lg font-semibold dark:font-normal cursor-pointer",children:e})}),L.jsx("br",{}),L.jsx("span",{className:"text-base font-light",children:i.map(u=>r?.includes(u)?`${u}*`:u).map(u=>u==="Wode Ni"||u==="Wode Ni*"?L.jsx("strong",{children:u}):u).map((u,C)=>L.jsxs("span",{children:[L.jsx("li",{className:"inline",children:u}),C!==i.length-1&&L.jsx("span",{children:", "})]},`${l}-author-${C}`))}),"."," ",L.jsx("span",{className:"text-base font-light italic",children:o}),".",L.jsxs("div",{className:"flex gap-2",children:[L.jsxs("div",{className:"flex items-center gap-0.5",children:[L.jsx(hH,{}),L.jsx($J,{data:g,children:"bib"})]}),n&&L.jsxs("div",{className:"flex items-center gap-0.5",children:[L.jsx(fH,{}),L.jsx(Qt,{href:n,children:"pdf"})]}),s&&L.jsxs("div",{className:"flex items-center gap-0.5",children:[L.jsx(mH,{}),L.jsx(Qt,{href:s,children:"talk"})]}),a&&L.jsxs("div",{className:"flex items-center gap-0.5",children:[L.jsx(dH,{}),L.jsx(Qt,{href:a,children:"slides"})]})]})]},l))}),tO=()=>L.jsx("div",{className:"flex items-end md:items-top md:ml-auto mb-0 color-primary font-light md:text-lg font-mono md:mt-4 gap-2 md:flex-col",children:L.jsx(Qt,{href:"/posts",children:L.jsx("span",{children:"/Posts"})})}),nO=()=>{const{darkMode:n,toggleDark:e}=k.useContext(JA);return L.jsxs(Py,{children:[L.jsxs("div",{className:"md:col-span-1 justify-left flex flex-col",children:[L.jsx(Uv,{className:"mt-8",toggleDark:e}),L.jsx(tO,{})]}),L.jsx(LI,{className:"md:col-span-2 mt-8",children:"I'm Nimo. I build ergonomic digital tools to make difficult things feel simple."}),L.jsxs("div",{className:"max-w-screen-md md:col-span-2",children:[L.jsxs(kg,{header:"Research",children:[L.jsxs(LI,{className:"",children:["I am a Ph.D. candidate at Carnegie Mellon University, School of Computer Science, advised by"," ",L.jsx(Qt,{href:"http://pact.cs.cmu.edu/koedinger.html",children:"Ken Koedinger"})," ","and ",L.jsx(Qt,{href:"https://www.cs.cmu.edu/~jssunshi/",children:"Josh Sunshine"}),"."]}),L.jsx(eO,{})]}),L.jsx(kg,{header:"Tools",children:L.jsxs("div",{className:"grid lg:grid-cols-2 gap-2 md:gap-4 lg:gap-8 my-4",children:[L.jsx(jm,{name:"Penrose",desc:"Create beautiful diagrams just by typing math notation in plain text.",link:"https://penrose.cs.cmu.edu/",logo:jJ,dark:n}),L.jsx(jm,{name:"Edgeworth",desc:"Diagrammatic problem generation by program mutation.",link:"https://penrose.github.io/penrose/edgeworth/develop/",logo:OJ,dark:n}),L.jsx(jm,{name:"Math Diagrams",desc:"A growing collection of open-source math visualizations.",link:"https://mathdiagrams.com/",dark:n,logo:QJ})]})}),L.jsxs(kg,{header:"About",children:[L.jsx(LI,{children:'My name is 倪沃德 (ní wò dé) in Chinese. “Nimo” has been my alias since my street dancing days. If you find "Wo-de" hard to pronounce, default to “Nimo”.'}),L.jsx(LI,{children:"I am an avid pool player. I play in local leagues and national tournaments."})]})]}),L.jsx("div",{className:"md:ml-10 md:max-w-60",children:L.jsx(kg,{header:"News",children:L.jsx(qJ,{})})})]})};const iO=Object.assign({"./posts/why.md":()=>rx(()=>import("./why-6c324fc6.js"),[])}),sO=()=>{const{darkMode:n,toggleDark:e}=k.useContext(JA),[t,i]=k.useState([]);return k.useEffect(()=>{async function s(){const r=Object.entries(iO).map(async([o,a])=>{const{attributes:l,html:g}=await a();return{path:o,attributes:l,html:g}});return Promise.all(r)}s().then(r=>{i(r)})},[]),L.jsxs(Py,{children:[L.jsxs("div",{className:"md:col-span-1 justify-left flex flex-col",children:[L.jsx(Uv,{className:"mt-8",toggleDark:e}),L.jsx("div",{className:"flex items-end md:items-top md:ml-auto mb-0 color-primary font-light md:text-lg font-mono md:mt-4 gap-2 md:flex-col",children:L.jsx(Qt,{href:"/",children:L.jsx("span",{children:"/Home"})})})]}),L.jsxs("div",{className:"max-w-screen-md md:col-span-2",children:[L.jsx(LI,{className:"md:col-span-2 mt-8",children:"Writing is tough, but I try to do a bit more every day."}),L.jsx(kg,{header:"Posts",children:t.map((s,r)=>L.jsxs("p",{className:"my-4 text-xl",children:[L.jsx("span",{className:"text-gray-500 dark:text-neutral-400 font-mono text-lg mr-4",children:s.attributes.date}),L.jsx(Qt,{href:`/posts/${s.path.split("/").pop().replace(".md","")}`,children:s.attributes.title})]},r))})]})]})},rO=()=>L.jsx("div",{children:L.jsx("h1",{children:"Pool"})}),oO=({post:n})=>{const{darkMode:e,toggleDark:t}=k.useContext(JA);return L.jsxs(Py,{children:[L.jsxs("div",{className:"md:col-span-1 justify-left flex flex-col",children:[L.jsx(Uv,{className:"mt-8",toggleDark:t}),L.jsxs("div",{className:"flex items-end md:items-top md:ml-auto mb-0 color-primary font-light md:text-lg font-mono md:mt-4 gap-2 md:flex-col",children:[L.jsx(Qt,{href:"/",children:L.jsx("span",{children:"/Home"})}),L.jsx(Qt,{href:"/posts",children:L.jsx("span",{children:"/Posts"})})]})]}),L.jsxs("div",{className:"max-w-screen-md md:col-span-2 mt-8",children:[L.jsx(kg,{header:n.attributes.title}),L.jsx("article",{className:"prose dark:prose-invert",dangerouslySetInnerHTML:{__html:n.html}})]})]})},sx=Object.assign({"./posts/why.md":()=>rx(()=>import("./why-6c324fc6.js"),[])}),aO=async()=>await Promise.all(Object.keys(sx).map(async e=>{const t=await sx[e]();return{path:`/posts/${e.split("/").pop()?.replace(".md","")}`,element:L.jsx(oO,{post:t})}})),lO=async()=>{const n=await aO();return RX([{path:"/",element:L.jsx(nO,{})},{path:"/posts",element:L.jsx(sO,{})},{path:"/pool",element:L.jsx(rO,{})},...n])},gO=()=>{const[n,e]=k.useState(null);k.useEffect(()=>{lO().then(r=>e(r))},[]);const[t,i]=k.useState(window.matchMedia("(prefers-color-scheme: dark)").matches),s=()=>{i(!t)};return k.useEffect(()=>{function r(){window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?i(!0):i(!1)}window.matchMedia("(prefers-color-scheme: dark)").addEventListener("change",r)},[]),k.useEffect(()=>{document.documentElement.classList.toggle("dark",t)},[t]),n?L.jsx(Ki.StrictMode,{children:L.jsx(JA.Provider,{value:{darkMode:t,toggleDark:s},children:L.jsx(vX,{router:n})})}):L.jsx("div",{children:"Loading..."})};qm.createRoot(document.getElementById("root")).render(L.jsx(Ki.StrictMode,{children:L.jsx(gO,{})})); diff --git a/pr-preview/pr-22/index.html b/pr-preview/pr-22/index.html index ab123a8..3d5e836 100644 --- a/pr-preview/pr-22/index.html +++ b/pr-preview/pr-22/index.html @@ -73,7 +73,7 @@ data-utcoffset="-4" > Wode "Nimo" Ni - +