@streamoji/avatar-widget 0.2.6 → 0.2.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/avatar-widget.cjs +4 -4
- package/dist/avatar-widget.cjs.map +1 -1
- package/dist/avatar-widget.js +156 -154
- package/dist/avatar-widget.js.map +1 -1
- package/dist/avatar-widget.umd.js +10 -10
- package/dist/avatar-widget.umd.js.map +1 -1
- package/package.json +1 -1
|
@@ -5,7 +5,7 @@ var StreamojiLeadsAvatarWidget=(function(Oy){"use strict";var hl={env:{NODE_ENV:
|
|
|
5
5
|
`);for(A=m=0;m<re.length&&!re[m].includes("DetermineComponentFrameRoot");)m++;for(;A<Re.length&&!Re[A].includes("DetermineComponentFrameRoot");)A++;if(m===re.length||A===Re.length)for(m=re.length-1,A=Re.length-1;1<=m&&0<=A&&re[m]!==Re[A];)A--;for(;1<=m&&0<=A;m--,A--)if(re[m]!==Re[A]){if(m!==1||A!==1)do if(m--,A--,0>A||re[m]!==Re[A]){var Xe=`
|
|
6
6
|
`+re[m].replace(" at new "," at ");return a.displayName&&Xe.includes("<anonymous>")&&(Xe=Xe.replace("<anonymous>",a.displayName)),Xe}while(1<=m&&0<=A);break}}}finally{et=!1,Error.prepareStackTrace=f}return(f=a?a.displayName||a.name:"")?Ge(f):""}function xt(a,r){switch(a.tag){case 26:case 27:case 5:return Ge(a.type);case 16:return Ge("Lazy");case 13:return a.child!==r&&r!==null?Ge("Suspense Fallback"):Ge("Suspense");case 19:return Ge("SuspenseList");case 0:case 15:return Je(a.type,!1);case 11:return Je(a.type.render,!1);case 1:return Je(a.type,!0);case 31:return Ge("Activity");default:return""}}function Q(a){try{var r="",f=null;do r+=xt(a,f),f=a,a=a.return;while(a);return r}catch(m){return`
|
|
7
7
|
Error generating stack: `+m.message+`
|
|
8
|
-
`+m.stack}}var Dt=Object.prototype.hasOwnProperty,mt=s.unstable_scheduleCallback,Ot=s.unstable_cancelCallback,gt=s.unstable_shouldYield,j=s.unstable_requestPaint,P=s.unstable_now,de=s.unstable_getCurrentPriorityLevel,Fe=s.unstable_ImmediatePriority,ke=s.unstable_UserBlockingPriority,Ie=s.unstable_NormalPriority,Ft=s.unstable_LowPriority,Mt=s.unstable_IdlePriority,Ht=s.log,zt=s.unstable_setDisableYieldValue,Ye=null,qe=null;function wt(a){if(typeof Ht=="function"&&zt(a),qe&&typeof qe.setStrictMode=="function")try{qe.setStrictMode(Ye,a)}catch{}}var bt=Math.clz32?Math.clz32:fe,rt=Math.log,Vt=Math.LN2;function fe(a){return a>>>=0,a===0?32:31-(rt(a)/Vt|0)|0}var Ne=256,ot=262144,Et=4194304;function Qe(a){var r=a&42;if(r!==0)return r;switch(a&-a){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:return 64;case 128:return 128;case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:return a&261888;case 262144:case 524288:case 1048576:case 2097152:return a&3932160;case 4194304:case 8388608:case 16777216:case 33554432:return a&62914560;case 67108864:return 67108864;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 0;default:return a}}function We(a,r,f){var m=a.pendingLanes;if(m===0)return 0;var A=0,E=a.suspendedLanes,L=a.pingedLanes;a=a.warmLanes;var Y=m&134217727;return Y!==0?(m=Y&~E,m!==0?A=Qe(m):(L&=Y,L!==0?A=Qe(L):f||(f=Y&~a,f!==0&&(A=Qe(f))))):(Y=m&~E,Y!==0?A=Qe(Y):L!==0?A=Qe(L):f||(f=m&~a,f!==0&&(A=Qe(f)))),A===0?0:r!==0&&r!==A&&(r&E)===0&&(E=A&-A,f=r&-r,E>=f||E===32&&(f&4194048)!==0)?r:A}function _t(a,r){return(a.pendingLanes&~(a.suspendedLanes&~a.pingedLanes)&r)===0}function nn(a,r){switch(a){case 1:case 2:case 4:case 8:case 64:return r+250;case 16:case 32: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 r+5e3;case 4194304:case 8388608:case 16777216:case 33554432:return-1;case 67108864:case 134217728:case 268435456:case 536870912:case 1073741824:return-1;default:return-1}}function wn(){var a=Et;return Et<<=1,(Et&62914560)===0&&(Et=4194304),a}function Mn(a){for(var r=[],f=0;31>f;f++)r.push(a);return r}function Fi(a,r){a.pendingLanes|=r,r!==268435456&&(a.suspendedLanes=0,a.pingedLanes=0,a.warmLanes=0)}function va(a,r,f,m,A,E){var L=a.pendingLanes;a.pendingLanes=f,a.suspendedLanes=0,a.pingedLanes=0,a.warmLanes=0,a.expiredLanes&=f,a.entangledLanes&=f,a.errorRecoveryDisabledLanes&=f,a.shellSuspendCounter=0;var Y=a.entanglements,re=a.expirationTimes,Re=a.hiddenUpdates;for(f=L&~f;0<f;){var Xe=31-bt(f),$e=1<<Xe;Y[Xe]=0,re[Xe]=-1;var De=Re[Xe];if(De!==null)for(Re[Xe]=null,Xe=0;Xe<De.length;Xe++){var Pe=De[Xe];Pe!==null&&(Pe.lane&=-536870913)}f&=~$e}m!==0&&br(a,m,0),E!==0&&A===0&&a.tag!==0&&(a.suspendedLanes|=E&~(L&~r))}function br(a,r,f){a.pendingLanes|=r,a.suspendedLanes&=~r;var m=31-bt(r);a.entangledLanes|=r,a.entanglements[m]=a.entanglements[m]|1073741824|f&261930}function ir(a,r){var f=a.entangledLanes|=r;for(a=a.entanglements;f;){var m=31-bt(f),A=1<<m;A&r|a[m]&r&&(a[m]|=r),f&=~A}}function _a(a,r){var f=r&-r;return f=(f&42)!==0?1:sa(f),(f&(a.suspendedLanes|r))!==0?0:f}function sa(a){switch(a){case 2:a=1;break;case 8:a=4;break;case 32:a=16;break;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:a=128;break;case 268435456:a=134217728;break;default:a=0}return a}function Da(a){return a&=-a,2<a?8<a?(a&134217727)!==0?32:268435456:8:2}function wi(){var a=W.p;return a!==0?a:(a=window.event,a===void 0?32:nR(a.type))}function kt(a,r){var f=W.p;try{return W.p=a,r()}finally{W.p=f}}var Ai=Math.random().toString(36).slice(2),mn="__reactFiber$"+Ai,G="__reactProps$"+Ai,q="__reactContainer$"+Ai,oe="__reactEvents$"+Ai,Te="__reactListeners$"+Ai,Le="__reactHandles$"+Ai,Ue="__reactResources$"+Ai,ct="__reactMarker$"+Ai;function at(a){delete a[mn],delete a[G],delete a[oe],delete a[Te],delete a[Le]}function st(a){var r=a[mn];if(r)return r;for(var f=a.parentNode;f;){if(r=f[q]||f[mn]){if(f=r.alternate,r.child!==null||f!==null&&f.child!==null)for(a=GC(a);a!==null;){if(f=a[mn])return f;a=GC(a)}return r}a=f,f=a.parentNode}return null}function tt(a){if(a=a[mn]||a[q]){var r=a.tag;if(r===5||r===6||r===13||r===31||r===26||r===27||r===3)return a}return null}function yt(a){var r=a.tag;if(r===5||r===26||r===27||r===6)return a.stateNode;throw Error(n(33))}function dt(a){var r=a[Ue];return r||(r=a[Ue]={hoistableStyles:new Map,hoistableScripts:new Map}),r}function k(a){a[ct]=!0}var ie=new Set,ue={};function pe(a,r){ce(a,r),ce(a+"Capture",r)}function ce(a,r){for(ue[a]=r,a=0;a<r.length;a++)ie.add(r[a])}var it=RegExp("^[: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]*$"),ut={},ht={};function xe(a){return Dt.call(ht,a)?!0:Dt.call(ut,a)?!1:it.test(a)?ht[a]=!0:(ut[a]=!0,!1)}function we(a,r,f){if(xe(r))if(f===null)a.removeAttribute(r);else{switch(typeof f){case"undefined":case"function":case"symbol":a.removeAttribute(r);return;case"boolean":var m=r.toLowerCase().slice(0,5);if(m!=="data-"&&m!=="aria-"){a.removeAttribute(r);return}}a.setAttribute(r,""+f)}}function je(a,r,f){if(f===null)a.removeAttribute(r);else{switch(typeof f){case"undefined":case"function":case"symbol":case"boolean":a.removeAttribute(r);return}a.setAttribute(r,""+f)}}function He(a,r,f,m){if(m===null)a.removeAttribute(f);else{switch(typeof m){case"undefined":case"function":case"symbol":case"boolean":a.removeAttribute(f);return}a.setAttributeNS(r,f,""+m)}}function Ve(a){switch(typeof a){case"bigint":case"boolean":case"number":case"string":case"undefined":return a;case"object":return a;default:return""}}function At(a){var r=a.type;return(a=a.nodeName)&&a.toLowerCase()==="input"&&(r==="checkbox"||r==="radio")}function Yt(a,r,f){var m=Object.getOwnPropertyDescriptor(a.constructor.prototype,r);if(!a.hasOwnProperty(r)&&typeof m<"u"&&typeof m.get=="function"&&typeof m.set=="function"){var A=m.get,E=m.set;return Object.defineProperty(a,r,{configurable:!0,get:function(){return A.call(this)},set:function(L){f=""+L,E.call(this,L)}}),Object.defineProperty(a,r,{enumerable:m.enumerable}),{getValue:function(){return f},setValue:function(L){f=""+L},stopTracking:function(){a._valueTracker=null,delete a[r]}}}}function Jt(a){if(!a._valueTracker){var r=At(a)?"checked":"value";a._valueTracker=Yt(a,r,""+a[r])}}function Tt(a){if(!a)return!1;var r=a._valueTracker;if(!r)return!0;var f=r.getValue(),m="";return a&&(m=At(a)?a.checked?"true":"false":a.value),a=m,a!==f?(r.setValue(a),!0):!1}function ft(a){if(a=a||(typeof document<"u"?document:void 0),typeof a>"u")return null;try{return a.activeElement||a.body}catch{return a.body}}var Nt=/[\n"\\]/g;function vt(a){return a.replace(Nt,function(r){return"\\"+r.charCodeAt(0).toString(16)+" "})}function un(a,r,f,m,A,E,L,Y){a.name="",L!=null&&typeof L!="function"&&typeof L!="symbol"&&typeof L!="boolean"?a.type=L:a.removeAttribute("type"),r!=null?L==="number"?(r===0&&a.value===""||a.value!=r)&&(a.value=""+Ve(r)):a.value!==""+Ve(r)&&(a.value=""+Ve(r)):L!=="submit"&&L!=="reset"||a.removeAttribute("value"),r!=null?an(a,L,Ve(r)):f!=null?an(a,L,Ve(f)):m!=null&&a.removeAttribute("value"),A==null&&E!=null&&(a.defaultChecked=!!E),A!=null&&(a.checked=A&&typeof A!="function"&&typeof A!="symbol"),Y!=null&&typeof Y!="function"&&typeof Y!="symbol"&&typeof Y!="boolean"?a.name=""+Ve(Y):a.removeAttribute("name")}function Wn(a,r,f,m,A,E,L,Y){if(E!=null&&typeof E!="function"&&typeof E!="symbol"&&typeof E!="boolean"&&(a.type=E),r!=null||f!=null){if(!(E!=="submit"&&E!=="reset"||r!=null)){Jt(a);return}f=f!=null?""+Ve(f):"",r=r!=null?""+Ve(r):f,Y||r===a.value||(a.value=r),a.defaultValue=r}m=m??A,m=typeof m!="function"&&typeof m!="symbol"&&!!m,a.checked=Y?a.checked:!!m,a.defaultChecked=!!m,L!=null&&typeof L!="function"&&typeof L!="symbol"&&typeof L!="boolean"&&(a.name=L),Jt(a)}function an(a,r,f){r==="number"&&ft(a.ownerDocument)===a||a.defaultValue===""+f||(a.defaultValue=""+f)}function Xn(a,r,f,m){if(a=a.options,r){r={};for(var A=0;A<f.length;A++)r["$"+f[A]]=!0;for(f=0;f<a.length;f++)A=r.hasOwnProperty("$"+a[f].value),a[f].selected!==A&&(a[f].selected=A),A&&m&&(a[f].defaultSelected=!0)}else{for(f=""+Ve(f),r=null,A=0;A<a.length;A++){if(a[A].value===f){a[A].selected=!0,m&&(a[A].defaultSelected=!0);return}r!==null||a[A].disabled||(r=a[A])}r!==null&&(r.selected=!0)}}function rn(a,r,f){if(r!=null&&(r=""+Ve(r),r!==a.value&&(a.value=r),f==null)){a.defaultValue!==r&&(a.defaultValue=r);return}a.defaultValue=f!=null?""+Ve(f):""}function Pn(a,r,f,m){if(r==null){if(m!=null){if(f!=null)throw Error(n(92));if(ge(m)){if(1<m.length)throw Error(n(93));m=m[0]}f=m}f==null&&(f=""),r=f}f=Ve(r),a.defaultValue=f,m=a.textContent,m===f&&m!==""&&m!==null&&(a.value=m),Jt(a)}function jn(a,r){if(r){var f=a.firstChild;if(f&&f===a.lastChild&&f.nodeType===3){f.nodeValue=r;return}}a.textContent=r}var ri=new Set("animationIterationCount aspectRatio borderImageOutset borderImageSlice borderImageWidth boxFlex boxFlexGroup boxOrdinalGroup columnCount columns flex flexGrow flexPositive flexShrink flexNegative flexOrder gridArea gridRow gridRowEnd gridRowSpan gridRowStart gridColumn gridColumnEnd gridColumnSpan gridColumnStart fontWeight lineClamp lineHeight opacity order orphans scale tabSize widows zIndex zoom fillOpacity floodOpacity stopOpacity strokeDasharray strokeDashoffset strokeMiterlimit strokeOpacity strokeWidth MozAnimationIterationCount MozBoxFlex MozBoxFlexGroup MozLineClamp msAnimationIterationCount msFlex msZoom msFlexGrow msFlexNegative msFlexOrder msFlexPositive msFlexShrink msGridColumn msGridColumnSpan msGridRow msGridRowSpan WebkitAnimationIterationCount WebkitBoxFlex WebKitBoxFlexGroup WebkitBoxOrdinalGroup WebkitColumnCount WebkitColumns WebkitFlex WebkitFlexGrow WebkitFlexPositive WebkitFlexShrink WebkitLineClamp".split(" "));function Si(a,r,f){var m=r.indexOf("--")===0;f==null||typeof f=="boolean"||f===""?m?a.setProperty(r,""):r==="float"?a.cssFloat="":a[r]="":m?a.setProperty(r,f):typeof f!="number"||f===0||ri.has(r)?r==="float"?a.cssFloat=f:a[r]=(""+f).trim():a[r]=f+"px"}function Er(a,r,f){if(r!=null&&typeof r!="object")throw Error(n(62));if(a=a.style,f!=null){for(var m in f)!f.hasOwnProperty(m)||r!=null&&r.hasOwnProperty(m)||(m.indexOf("--")===0?a.setProperty(m,""):m==="float"?a.cssFloat="":a[m]="");for(var A in r)m=r[A],r.hasOwnProperty(A)&&f[A]!==m&&Si(a,A,m)}else for(var E in r)r.hasOwnProperty(E)&&Si(a,E,r[E])}function _s(a){if(a.indexOf("-")===-1)return!1;switch(a){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 g_=new Map([["acceptCharset","accept-charset"],["htmlFor","for"],["httpEquiv","http-equiv"],["crossOrigin","crossorigin"],["accentHeight","accent-height"],["alignmentBaseline","alignment-baseline"],["arabicForm","arabic-form"],["baselineShift","baseline-shift"],["capHeight","cap-height"],["clipPath","clip-path"],["clipRule","clip-rule"],["colorInterpolation","color-interpolation"],["colorInterpolationFilters","color-interpolation-filters"],["colorProfile","color-profile"],["colorRendering","color-rendering"],["dominantBaseline","dominant-baseline"],["enableBackground","enable-background"],["fillOpacity","fill-opacity"],["fillRule","fill-rule"],["floodColor","flood-color"],["floodOpacity","flood-opacity"],["fontFamily","font-family"],["fontSize","font-size"],["fontSizeAdjust","font-size-adjust"],["fontStretch","font-stretch"],["fontStyle","font-style"],["fontVariant","font-variant"],["fontWeight","font-weight"],["glyphName","glyph-name"],["glyphOrientationHorizontal","glyph-orientation-horizontal"],["glyphOrientationVertical","glyph-orientation-vertical"],["horizAdvX","horiz-adv-x"],["horizOriginX","horiz-origin-x"],["imageRendering","image-rendering"],["letterSpacing","letter-spacing"],["lightingColor","lighting-color"],["markerEnd","marker-end"],["markerMid","marker-mid"],["markerStart","marker-start"],["overlinePosition","overline-position"],["overlineThickness","overline-thickness"],["paintOrder","paint-order"],["panose-1","panose-1"],["pointerEvents","pointer-events"],["renderingIntent","rendering-intent"],["shapeRendering","shape-rendering"],["stopColor","stop-color"],["stopOpacity","stop-opacity"],["strikethroughPosition","strikethrough-position"],["strikethroughThickness","strikethrough-thickness"],["strokeDasharray","stroke-dasharray"],["strokeDashoffset","stroke-dashoffset"],["strokeLinecap","stroke-linecap"],["strokeLinejoin","stroke-linejoin"],["strokeMiterlimit","stroke-miterlimit"],["strokeOpacity","stroke-opacity"],["strokeWidth","stroke-width"],["textAnchor","text-anchor"],["textDecoration","text-decoration"],["textRendering","text-rendering"],["transformOrigin","transform-origin"],["underlinePosition","underline-position"],["underlineThickness","underline-thickness"],["unicodeBidi","unicode-bidi"],["unicodeRange","unicode-range"],["unitsPerEm","units-per-em"],["vAlphabetic","v-alphabetic"],["vHanging","v-hanging"],["vIdeographic","v-ideographic"],["vMathematical","v-mathematical"],["vectorEffect","vector-effect"],["vertAdvY","vert-adv-y"],["vertOriginX","vert-origin-x"],["vertOriginY","vert-origin-y"],["wordSpacing","word-spacing"],["writingMode","writing-mode"],["xmlnsXlink","xmlns:xlink"],["xHeight","x-height"]]),v_=/^[\u0000-\u001F ]*j[\r\n\t]*a[\r\n\t]*v[\r\n\t]*a[\r\n\t]*s[\r\n\t]*c[\r\n\t]*r[\r\n\t]*i[\r\n\t]*p[\r\n\t]*t[\r\n\t]*:/i;function af(a){return v_.test(""+a)?"javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')":a}function Tr(){}var sf=null;function Xh(a){return a=a.target||a.srcElement||window,a.correspondingUseElement&&(a=a.correspondingUseElement),a.nodeType===3?a.parentNode:a}var Dl=null,Lo=null;function am(a){var r=tt(a);if(r&&(a=r.stateNode)){var f=a[G]||null;e:switch(a=r.stateNode,r.type){case"input":if(un(a,f.value,f.defaultValue,f.defaultValue,f.checked,f.defaultChecked,f.type,f.name),r=f.name,f.type==="radio"&&r!=null){for(f=a;f.parentNode;)f=f.parentNode;for(f=f.querySelectorAll('input[name="'+vt(""+r)+'"][type="radio"]'),r=0;r<f.length;r++){var m=f[r];if(m!==a&&m.form===a.form){var A=m[G]||null;if(!A)throw Error(n(90));un(m,A.value,A.defaultValue,A.defaultValue,A.checked,A.defaultChecked,A.type,A.name)}}for(r=0;r<f.length;r++)m=f[r],m.form===a.form&&Tt(m)}break e;case"textarea":rn(a,f.value,f.defaultValue);break e;case"select":r=f.value,r!=null&&Xn(a,!!f.multiple,r,!1)}}}var Yh=!1;function sm(a,r,f){if(Yh)return a(r,f);Yh=!0;try{var m=a(r);return m}finally{if(Yh=!1,(Dl!==null||Lo!==null)&&(J(),Dl&&(r=Dl,a=Lo,Lo=Dl=null,am(r),a)))for(r=0;r<a.length;r++)am(a[r])}}function Nl(a,r){var f=a.stateNode;if(f===null)return null;var m=f[G]||null;if(m===null)return null;f=m[r];e:switch(r){case"onClick":case"onClickCapture":case"onDoubleClick":case"onDoubleClickCapture":case"onMouseDown":case"onMouseDownCapture":case"onMouseMove":case"onMouseMoveCapture":case"onMouseUp":case"onMouseUpCapture":case"onMouseEnter":(m=!m.disabled)||(a=a.type,m=!(a==="button"||a==="input"||a==="select"||a==="textarea")),a=!m;break e;default:a=!1}if(a)return null;if(f&&typeof f!="function")throw Error(n(231,r,typeof f));return f}var Cr=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),Jh=!1;if(Cr)try{var rf={};Object.defineProperty(rf,"passive",{get:function(){Jh=!0}}),window.addEventListener("test",rf,rf),window.removeEventListener("test",rf,rf)}catch{Jh=!1}var Oo=null,qh=null,Io=null;function Kh(){if(Io)return Io;var a,r=qh,f=r.length,m,A="value"in Oo?Oo.value:Oo.textContent,E=A.length;for(a=0;a<f&&r[a]===A[a];a++);var L=f-a;for(m=1;m<=L&&r[f-m]===A[E-m];m++);return Io=A.slice(a,1<m?1-m:void 0)}function Ul(a){var r=a.keyCode;return"charCode"in a?(a=a.charCode,a===0&&r===13&&(a=13)):a=r,a===10&&(a=13),32<=a||a===13?a:0}function of(){return!0}function rm(){return!1}function Na(a){function r(f,m,A,E,L){this._reactName=f,this._targetInst=A,this.type=m,this.nativeEvent=E,this.target=L,this.currentTarget=null;for(var Y in a)a.hasOwnProperty(Y)&&(f=a[Y],this[Y]=f?f(E):E[Y]);return this.isDefaultPrevented=(E.defaultPrevented!=null?E.defaultPrevented:E.returnValue===!1)?of:rm,this.isPropagationStopped=rm,this}return v(r.prototype,{preventDefault:function(){this.defaultPrevented=!0;var f=this.nativeEvent;f&&(f.preventDefault?f.preventDefault():typeof f.returnValue!="unknown"&&(f.returnValue=!1),this.isDefaultPrevented=of)},stopPropagation:function(){var f=this.nativeEvent;f&&(f.stopPropagation?f.stopPropagation():typeof f.cancelBubble!="unknown"&&(f.cancelBubble=!0),this.isPropagationStopped=of)},persist:function(){},isPersistent:of}),r}var Fo={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(a){return a.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},lf=Na(Fo),ar=v({},Fo,{view:0,detail:0}),Wh=Na(ar),jh,cf,Dc,uf=v({},ar,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:hf,button:0,buttons:0,relatedTarget:function(a){return a.relatedTarget===void 0?a.fromElement===a.srcElement?a.toElement:a.fromElement:a.relatedTarget},movementX:function(a){return"movementX"in a?a.movementX:(a!==Dc&&(Dc&&a.type==="mousemove"?(jh=a.screenX-Dc.screenX,cf=a.screenY-Dc.screenY):cf=jh=0,Dc=a),jh)},movementY:function(a){return"movementY"in a?a.movementY:cf}}),__=Na(uf),ya=v({},uf,{dataTransfer:0}),y_=Na(ya),x_=v({},ar,{relatedTarget:0}),Zh=Na(x_),A_=v({},Fo,{animationName:0,elapsedTime:0,pseudoElement:0}),S_=Na(A_),ff=v({},Fo,{clipboardData:function(a){return"clipboardData"in a?a.clipboardData:window.clipboardData}}),om=Na(ff),M_=v({},Fo,{data:0}),lm=Na(M_),b_={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},cm={8:"Backspace",9:"Tab",12:"Clear",13:"Enter",16:"Shift",17:"Control",18:"Alt",19:"Pause",20:"CapsLock",27:"Escape",32:" ",33:"PageUp",34:"PageDown",35:"End",36:"Home",37:"ArrowLeft",38:"ArrowUp",39:"ArrowRight",40:"ArrowDown",45:"Insert",46:"Delete",112:"F1",113:"F2",114:"F3",115:"F4",116:"F5",117:"F6",118:"F7",119:"F8",120:"F9",121:"F10",122:"F11",123:"F12",144:"NumLock",145:"ScrollLock",224:"Meta"},um={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function E_(a){var r=this.nativeEvent;return r.getModifierState?r.getModifierState(a):(a=um[a])?!!r[a]:!1}function hf(){return E_}var fm=v({},ar,{key:function(a){if(a.key){var r=b_[a.key]||a.key;if(r!=="Unidentified")return r}return a.type==="keypress"?(a=Ul(a),a===13?"Enter":String.fromCharCode(a)):a.type==="keydown"||a.type==="keyup"?cm[a.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:hf,charCode:function(a){return a.type==="keypress"?Ul(a):0},keyCode:function(a){return a.type==="keydown"||a.type==="keyup"?a.keyCode:0},which:function(a){return a.type==="keypress"?Ul(a):a.type==="keydown"||a.type==="keyup"?a.keyCode:0}}),hm=Na(fm),T_=v({},uf,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),Qh=Na(T_),C_=v({},ar,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:hf}),no=Na(C_),dm=v({},Fo,{propertyName:0,elapsedTime:0,pseudoElement:0}),zS=Na(dm),R_=v({},uf,{deltaX:function(a){return"deltaX"in a?a.deltaX:"wheelDeltaX"in a?-a.wheelDeltaX:0},deltaY:function(a){return"deltaY"in a?a.deltaY:"wheelDeltaY"in a?-a.wheelDeltaY:"wheelDelta"in a?-a.wheelDelta:0},deltaZ:0,deltaMode:0}),Ho=Na(R_),io=v({},Fo,{newState:0,oldState:0}),pm=Na(io),mm=[9,13,27,32],Ll=Cr&&"CompositionEvent"in window,Po=null;Cr&&"documentMode"in document&&(Po=document.documentMode);var Ol=Cr&&"TextEvent"in window&&!Po,xa=Cr&&(!Ll||Po&&8<Po&&11>=Po),df=" ",gm=!1;function $h(a,r){switch(a){case"keyup":return mm.indexOf(r.keyCode)!==-1;case"keydown":return r.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function Nc(a){return a=a.detail,typeof a=="object"&&"data"in a?a.data:null}var Go=!1;function ed(a,r){switch(a){case"compositionend":return Nc(r);case"keypress":return r.which!==32?null:(gm=!0,df);case"textInput":return a=r.data,a===df&&gm?null:a;default:return null}}function w_(a,r){if(Go)return a==="compositionend"||!Ll&&$h(a,r)?(a=Kh(),Io=qh=Oo=null,Go=!1,a):null;switch(a){case"paste":return null;case"keypress":if(!(r.ctrlKey||r.altKey||r.metaKey)||r.ctrlKey&&r.altKey){if(r.char&&1<r.char.length)return r.char;if(r.which)return String.fromCharCode(r.which)}return null;case"compositionend":return xa&&r.locale!=="ko"?null:r.data;default:return null}}var ys={color:!0,date:!0,datetime:!0,"datetime-local":!0,email:!0,month:!0,number:!0,password:!0,range:!0,search:!0,tel:!0,text:!0,time:!0,url:!0,week:!0};function vm(a){var r=a&&a.nodeName&&a.nodeName.toLowerCase();return r==="input"?!!ys[a.type]:r==="textarea"}function td(a,r,f,m){Dl?Lo?Lo.push(m):Lo=[m]:Dl=m,r=xy(r,"onChange"),0<r.length&&(f=new lf("onChange","change",null,f,m),a.push({event:f,listeners:r}))}var Uc=null,Lc=null;function _m(a){TC(a,0)}function Oc(a){var r=yt(a);if(Tt(r))return a}function ym(a,r){if(a==="change")return r}var pf=!1;if(Cr){var Il;if(Cr){var mi="oninput"in document;if(!mi){var B_=document.createElement("div");B_.setAttribute("oninput","return;"),mi=typeof B_.oninput=="function"}Il=mi}else Il=!1;pf=Il&&(!document.documentMode||9<document.documentMode)}function D_(){Uc&&(Uc.detachEvent("onpropertychange",xm),Lc=Uc=null)}function xm(a){if(a.propertyName==="value"&&Oc(Lc)){var r=[];td(r,Lc,a,Xh(a)),sm(_m,r)}}function mf(a,r,f){a==="focusin"?(D_(),Uc=r,Lc=f,Uc.attachEvent("onpropertychange",xm)):a==="focusout"&&D_()}function zo(a){if(a==="selectionchange"||a==="keyup"||a==="keydown")return Oc(Lc)}function N_(a,r){if(a==="click")return Oc(r)}function U_(a,r){if(a==="input"||a==="change")return Oc(r)}function Fl(a,r){return a===r&&(a!==0||1/a===1/r)||a!==a&&r!==r}var gi=typeof Object.is=="function"?Object.is:Fl;function Ic(a,r){if(gi(a,r))return!0;if(typeof a!="object"||a===null||typeof r!="object"||r===null)return!1;var f=Object.keys(a),m=Object.keys(r);if(f.length!==m.length)return!1;for(m=0;m<f.length;m++){var A=f[m];if(!Dt.call(r,A)||!gi(a[A],r[A]))return!1}return!0}function Am(a){for(;a&&a.firstChild;)a=a.firstChild;return a}function Sm(a,r){var f=Am(a);a=0;for(var m;f;){if(f.nodeType===3){if(m=a+f.textContent.length,a<=r&&m>=r)return{node:f,offset:r-a};a=m}e:{for(;f;){if(f.nextSibling){f=f.nextSibling;break e}f=f.parentNode}f=void 0}f=Am(f)}}function nd(a,r){return a&&r?a===r?!0:a&&a.nodeType===3?!1:r&&r.nodeType===3?nd(a,r.parentNode):"contains"in a?a.contains(r):a.compareDocumentPosition?!!(a.compareDocumentPosition(r)&16):!1:!1}function id(a){a=a!=null&&a.ownerDocument!=null&&a.ownerDocument.defaultView!=null?a.ownerDocument.defaultView:window;for(var r=ft(a.document);r instanceof a.HTMLIFrameElement;){try{var f=typeof r.contentWindow.location.href=="string"}catch{f=!1}if(f)a=r.contentWindow;else break;r=ft(a.document)}return r}function Fc(a){var r=a&&a.nodeName&&a.nodeName.toLowerCase();return r&&(r==="input"&&(a.type==="text"||a.type==="search"||a.type==="tel"||a.type==="url"||a.type==="password")||r==="textarea"||a.contentEditable==="true")}var L_=Cr&&"documentMode"in document&&11>=document.documentMode,Hc=null,ad=null,Pc=null,xs=!1;function sd(a,r,f){var m=f.window===f?f.document:f.nodeType===9?f:f.ownerDocument;xs||Hc==null||Hc!==ft(m)||(m=Hc,"selectionStart"in m&&Fc(m)?m={start:m.selectionStart,end:m.selectionEnd}:(m=(m.ownerDocument&&m.ownerDocument.defaultView||window).getSelection(),m={anchorNode:m.anchorNode,anchorOffset:m.anchorOffset,focusNode:m.focusNode,focusOffset:m.focusOffset}),Pc&&Ic(Pc,m)||(Pc=m,m=xy(ad,"onSelect"),0<m.length&&(r=new lf("onSelect","select",null,r,f),a.push({event:r,listeners:m}),r.target=Hc)))}function Vo(a,r){var f={};return f[a.toLowerCase()]=r.toLowerCase(),f["Webkit"+a]="webkit"+r,f["Moz"+a]="moz"+r,f}var Gc={animationend:Vo("Animation","AnimationEnd"),animationiteration:Vo("Animation","AnimationIteration"),animationstart:Vo("Animation","AnimationStart"),transitionrun:Vo("Transition","TransitionRun"),transitionstart:Vo("Transition","TransitionStart"),transitioncancel:Vo("Transition","TransitionCancel"),transitionend:Vo("Transition","TransitionEnd")},gf={},Va={};Cr&&(Va=document.createElement("div").style,"AnimationEvent"in window||(delete Gc.animationend.animation,delete Gc.animationiteration.animation,delete Gc.animationstart.animation),"TransitionEvent"in window||delete Gc.transitionend.transition);function ko(a){if(gf[a])return gf[a];if(!Gc[a])return a;var r=Gc[a],f;for(f in r)if(r.hasOwnProperty(f)&&f in Va)return gf[a]=r[f];return a}var es=ko("animationend"),Mm=ko("animationiteration"),Rr=ko("animationstart"),zc=ko("transitionrun"),Xo=ko("transitionstart"),bm=ko("transitioncancel"),rd=ko("transitionend"),ao=new Map,od="abort auxClick beforeToggle cancel canPlay canPlayThrough click close contextMenu copy cut drag dragEnd dragEnter dragExit dragLeave dragOver dragStart drop durationChange emptied encrypted ended error gotPointerCapture input invalid keyDown keyPress keyUp load loadedData loadedMetadata loadStart lostPointerCapture mouseDown mouseMove mouseOut mouseOver mouseUp paste pause play playing pointerCancel pointerDown pointerMove pointerOut pointerOver pointerUp progress rateChange reset resize seeked seeking stalled submit suspend timeUpdate touchCancel touchEnd touchStart volumeChange scroll toggle touchMove waiting wheel".split(" ");od.push("scrollEnd");function Ua(a,r){ao.set(a,r),pe(r,[a])}var Yo=typeof reportError=="function"?reportError:function(a){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var r=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof a=="object"&&a!==null&&typeof a.message=="string"?String(a.message):String(a),error:a});if(!window.dispatchEvent(r))return}else if(typeof hl=="object"&&typeof hl.emit=="function"){hl.emit("uncaughtException",a);return}console.error(a)},ra=[],Hl=0,ld=0;function Jo(){for(var a=Hl,r=ld=Hl=0;r<a;){var f=ra[r];ra[r++]=null;var m=ra[r];ra[r++]=null;var A=ra[r];ra[r++]=null;var E=ra[r];if(ra[r++]=null,m!==null&&A!==null){var L=m.pending;L===null?A.next=A:(A.next=L.next,L.next=A),m.pending=A}E!==0&&cd(f,A,E)}}function vf(a,r,f,m){ra[Hl++]=a,ra[Hl++]=r,ra[Hl++]=f,ra[Hl++]=m,ld|=m,a.lanes|=m,a=a.alternate,a!==null&&(a.lanes|=m)}function Vc(a,r,f,m){return vf(a,r,f,m),kc(a)}function qo(a,r){return vf(a,null,null,r),kc(a)}function cd(a,r,f){a.lanes|=f;var m=a.alternate;m!==null&&(m.lanes|=f);for(var A=!1,E=a.return;E!==null;)E.childLanes|=f,m=E.alternate,m!==null&&(m.childLanes|=f),E.tag===22&&(a=E.stateNode,a===null||a._visibility&1||(A=!0)),a=E,E=E.return;return a.tag===3?(E=a.stateNode,A&&r!==null&&(A=31-bt(f),a=E.hiddenUpdates,m=a[A],m===null?a[A]=[r]:m.push(r),r.lane=f|536870912),E):null}function kc(a){if(50<tc)throw tc=0,nc=null,Error(n(185));for(var r=a.return;r!==null;)a=r,r=a.return;return a.tag===3?a.stateNode:null}var Ko={};function O_(a,r,f,m){this.tag=a,this.key=f,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.refCleanup=this.ref=null,this.pendingProps=r,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=m,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function ka(a,r,f,m){return new O_(a,r,f,m)}function Xa(a){return a=a.prototype,!(!a||!a.isReactComponent)}function wr(a,r){var f=a.alternate;return f===null?(f=ka(a.tag,r,a.key,a.mode),f.elementType=a.elementType,f.type=a.type,f.stateNode=a.stateNode,f.alternate=a,a.alternate=f):(f.pendingProps=r,f.type=a.type,f.flags=0,f.subtreeFlags=0,f.deletions=null),f.flags=a.flags&65011712,f.childLanes=a.childLanes,f.lanes=a.lanes,f.child=a.child,f.memoizedProps=a.memoizedProps,f.memoizedState=a.memoizedState,f.updateQueue=a.updateQueue,r=a.dependencies,f.dependencies=r===null?null:{lanes:r.lanes,firstContext:r.firstContext},f.sibling=a.sibling,f.index=a.index,f.ref=a.ref,f.refCleanup=a.refCleanup,f}function La(a,r){a.flags&=65011714;var f=a.alternate;return f===null?(a.childLanes=0,a.lanes=r,a.child=null,a.subtreeFlags=0,a.memoizedProps=null,a.memoizedState=null,a.updateQueue=null,a.dependencies=null,a.stateNode=null):(a.childLanes=f.childLanes,a.lanes=f.lanes,a.child=f.child,a.subtreeFlags=0,a.deletions=null,a.memoizedProps=f.memoizedProps,a.memoizedState=f.memoizedState,a.updateQueue=f.updateQueue,a.type=f.type,r=f.dependencies,a.dependencies=r===null?null:{lanes:r.lanes,firstContext:r.firstContext}),a}function _f(a,r,f,m,A,E){var L=0;if(m=a,typeof a=="function")Xa(a)&&(L=1);else if(typeof a=="string")L=C4(a,f,ve.current)?26:a==="html"||a==="head"||a==="body"?27:5;else e:switch(a){case U:return a=ka(31,f,r,A),a.elementType=U,a.lanes=E,a;case R:return so(f.children,A,E,r);case T:L=8,A|=24;break;case M:return a=ka(12,f,r,A|2),a.elementType=M,a.lanes=E,a;case H:return a=ka(13,f,r,A),a.elementType=H,a.lanes=E,a;case O:return a=ka(19,f,r,A),a.elementType=O,a.lanes=E,a;default:if(typeof a=="object"&&a!==null)switch(a.$$typeof){case D:L=10;break e;case w:L=9;break e;case N:L=11;break e;case z:L=14;break e;case V:L=16,m=null;break e}L=29,f=Error(n(130,a===null?"null":typeof a,"")),m=null}return r=ka(L,f,r,A),r.elementType=a,r.type=m,r.lanes=E,r}function so(a,r,f,m){return a=ka(7,a,m,r),a.lanes=f,a}function ud(a,r,f){return a=ka(6,a,null,r),a.lanes=f,a}function I_(a){var r=ka(18,null,null,0);return r.stateNode=a,r}function sr(a,r,f){return r=ka(4,a.children!==null?a.children:[],a.key,r),r.lanes=f,r.stateNode={containerInfo:a.containerInfo,pendingChildren:null,implementation:a.implementation},r}var Em=new WeakMap;function ts(a,r){if(typeof a=="object"&&a!==null){var f=Em.get(a);return f!==void 0?f:(r={value:a,source:r,stack:Q(r)},Em.set(a,r),r)}return{value:a,source:r,stack:Q(r)}}var rr=[],Pl=0,yf=null,Xc=0,As=[],ns=0,Br=null,Dr=1,Nr="";function ro(a,r){rr[Pl++]=Xc,rr[Pl++]=yf,yf=a,Xc=r}function Tm(a,r,f){As[ns++]=Dr,As[ns++]=Nr,As[ns++]=Br,Br=a;var m=Dr;a=Nr;var A=32-bt(m)-1;m&=~(1<<A),f+=1;var E=32-bt(r)+A;if(30<E){var L=A-A%5;E=(m&(1<<L)-1).toString(32),m>>=L,A-=L,Dr=1<<32-bt(r)+A|f<<A|m,Nr=E+a}else Dr=1<<E|f<<A|m,Nr=a}function fd(a){a.return!==null&&(ro(a,1),Tm(a,1,0))}function Wo(a){for(;a===yf;)yf=rr[--Pl],rr[Pl]=null,Xc=rr[--Pl],rr[Pl]=null;for(;a===Br;)Br=As[--ns],As[ns]=null,Nr=As[--ns],As[ns]=null,Dr=As[--ns],As[ns]=null}function xf(a,r){As[ns++]=Dr,As[ns++]=Nr,As[ns++]=Br,Dr=r.id,Nr=r.overflow,Br=a}var oa=null,ui=null,In=!1,oo=null,la=!1,hd=Error(n(519));function Dn(a){var r=Error(n(418,1<arguments.length&&arguments[1]!==void 0&&arguments[1]?"text":"HTML",""));throw Af(ts(r,a)),hd}function dd(a){var r=a.stateNode,f=a.type,m=a.memoizedProps;switch(r[mn]=a,r[G]=m,f){case"dialog":Fn("cancel",r),Fn("close",r);break;case"iframe":case"object":case"embed":Fn("load",r);break;case"video":case"audio":for(f=0;f<_g.length;f++)Fn(_g[f],r);break;case"source":Fn("error",r);break;case"img":case"image":case"link":Fn("error",r),Fn("load",r);break;case"details":Fn("toggle",r);break;case"input":Fn("invalid",r),Wn(r,m.value,m.defaultValue,m.checked,m.defaultChecked,m.type,m.name,!0);break;case"select":Fn("invalid",r);break;case"textarea":Fn("invalid",r),Pn(r,m.value,m.defaultValue,m.children)}f=m.children,typeof f!="string"&&typeof f!="number"&&typeof f!="bigint"||r.textContent===""+f||m.suppressHydrationWarning===!0||BC(r.textContent,f)?(m.popover!=null&&(Fn("beforetoggle",r),Fn("toggle",r)),m.onScroll!=null&&Fn("scroll",r),m.onScrollEnd!=null&&Fn("scrollend",r),m.onClick!=null&&(r.onclick=Tr),r=!0):r=!1,r||Dn(a,!0)}function F_(a){for(oa=a.return;oa;)switch(oa.tag){case 5:case 31:case 13:la=!1;return;case 27:case 3:la=!0;return;default:oa=oa.return}}function Gl(a){if(a!==oa)return!1;if(!In)return F_(a),In=!0,!1;var r=a.tag,f;if((f=r!==3&&r!==27)&&((f=r===5)&&(f=a.type,f=!(f!=="form"&&f!=="button")||oM(a.type,a.memoizedProps)),f=!f),f&&ui&&Dn(a),F_(a),r===13){if(a=a.memoizedState,a=a!==null?a.dehydrated:null,!a)throw Error(n(317));ui=PC(a)}else if(r===31){if(a=a.memoizedState,a=a!==null?a.dehydrated:null,!a)throw Error(n(317));ui=PC(a)}else r===27?(r=ui,cu(a.type)?(a=hM,hM=null,ui=a):ui=r):ui=oa?kr(a.stateNode.nextSibling):null;return!0}function zl(){ui=oa=null,In=!1}function Cm(){var a=oo;return a!==null&&(Ga===null?Ga=a:Ga.push.apply(Ga,a),oo=null),a}function Af(a){oo===null?oo=[a]:oo.push(a)}var Rm=X(null),lo=null,Oa=null;function co(a,r,f){le(Rm,r._currentValue),r._currentValue=f}function zs(a){a._currentValue=Rm.current,te(Rm)}function uo(a,r,f){for(;a!==null;){var m=a.alternate;if((a.childLanes&r)!==r?(a.childLanes|=r,m!==null&&(m.childLanes|=r)):m!==null&&(m.childLanes&r)!==r&&(m.childLanes|=r),a===f)break;a=a.return}}function pd(a,r,f,m){var A=a.child;for(A!==null&&(A.return=a);A!==null;){var E=A.dependencies;if(E!==null){var L=A.child;E=E.firstContext;e:for(;E!==null;){var Y=E;E=A;for(var re=0;re<r.length;re++)if(Y.context===r[re]){E.lanes|=f,Y=E.alternate,Y!==null&&(Y.lanes|=f),uo(E.return,f,a),m||(L=null);break e}E=Y.next}}else if(A.tag===18){if(L=A.return,L===null)throw Error(n(341));L.lanes|=f,E=L.alternate,E!==null&&(E.lanes|=f),uo(L,f,a),L=null}else L=A.child;if(L!==null)L.return=A;else for(L=A;L!==null;){if(L===a){L=null;break}if(A=L.sibling,A!==null){A.return=L.return,L=A;break}L=L.return}A=L}}function jo(a,r,f,m){a=null;for(var A=r,E=!1;A!==null;){if(!E){if((A.flags&524288)!==0)E=!0;else if((A.flags&262144)!==0)break}if(A.tag===10){var L=A.alternate;if(L===null)throw Error(n(387));if(L=L.memoizedProps,L!==null){var Y=A.type;gi(A.pendingProps.value,L.value)||(a!==null?a.push(Y):a=[Y])}}else if(A===Ee.current){if(L=A.alternate,L===null)throw Error(n(387));L.memoizedState.memoizedState!==A.memoizedState.memoizedState&&(a!==null?a.push(Mg):a=[Mg])}A=A.return}a!==null&&pd(r,a,f,m),r.flags|=262144}function Yc(a){for(a=a.firstContext;a!==null;){if(!gi(a.context._currentValue,a.memoizedValue))return!0;a=a.next}return!1}function Vl(a){lo=a,Oa=null,a=a.dependencies,a!==null&&(a.firstContext=null)}function ca(a){return wm(lo,a)}function Sf(a,r){return lo===null&&Vl(a),wm(a,r)}function wm(a,r){var f=r._currentValue;if(r={context:r,memoizedValue:f,next:null},Oa===null){if(a===null)throw Error(n(308));Oa=r,a.dependencies={lanes:0,firstContext:r},a.flags|=524288}else Oa=Oa.next=r;return f}var H_=typeof AbortController<"u"?AbortController:function(){var a=[],r=this.signal={aborted:!1,addEventListener:function(f,m){a.push(m)}};this.abort=function(){r.aborted=!0,a.forEach(function(f){return f()})}},P_=s.unstable_scheduleCallback,Bm=s.unstable_NormalPriority,Qt={$$typeof:D,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function Dm(){return{controller:new H_,data:new Map,refCount:0}}function Aa(a){a.refCount--,a.refCount===0&&P_(Bm,function(){a.controller.abort()})}var kl=null,Nm=0,fo=0,or=null;function Jc(a,r){if(kl===null){var f=kl=[];Nm=0,fo=QS(),or={status:"pending",value:void 0,then:function(m){f.push(m)}}}return Nm++,r.then(Um,Um),r}function Um(){if(--Nm===0&&kl!==null){or!==null&&(or.status="fulfilled");var a=kl;kl=null,fo=0,or=null;for(var r=0;r<a.length;r++)(0,a[r])()}}function Lm(a,r){var f=[],m={status:"pending",value:null,reason:null,then:function(A){f.push(A)}};return a.then(function(){m.status="fulfilled",m.value=r;for(var A=0;A<f.length;A++)(0,f[A])(r)},function(A){for(m.status="rejected",m.reason=A,A=0;A<f.length;A++)(0,f[A])(void 0)}),m}var G_=I.S;I.S=function(a,r){ru=P(),typeof r=="object"&&r!==null&&typeof r.then=="function"&&Jc(a,r),G_!==null&&G_(a,r)};var Zo=X(null);function Ur(){var a=Zo.current;return a!==null?a:ei.pooledCache}function qc(a,r){r===null?le(Zo,Zo.current):le(Zo,r.pool)}function md(){var a=Ur();return a===null?null:{parent:Qt._currentValue,pool:a}}var Qo=Error(n(460)),Mf=Error(n(474)),lr=Error(n(542)),bf={then:function(){}};function z_(a){return a=a.status,a==="fulfilled"||a==="rejected"}function Om(a,r,f){switch(f=a[f],f===void 0?a.push(r):f!==r&&(r.then(Tr,Tr),r=f),r.status){case"fulfilled":return r.value;case"rejected":throw a=r.reason,Im(a),a;default:if(typeof r.status=="string")r.then(Tr,Tr);else{if(a=ei,a!==null&&100<a.shellSuspendCounter)throw Error(n(482));a=r,a.status="pending",a.then(function(m){if(r.status==="pending"){var A=r;A.status="fulfilled",A.value=m}},function(m){if(r.status==="pending"){var A=r;A.status="rejected",A.reason=m}})}switch(r.status){case"fulfilled":return r.value;case"rejected":throw a=r.reason,Im(a),a}throw ln=r,Qo}}function Xl(a){try{var r=a._init;return r(a._payload)}catch(f){throw f!==null&&typeof f=="object"&&typeof f.then=="function"?(ln=f,Qo):f}}var ln=null;function gd(){if(ln===null)throw Error(n(459));var a=ln;return ln=null,a}function Im(a){if(a===Qo||a===lr)throw Error(n(483))}var $o=null,el=0;function vd(a){var r=el;return el+=1,$o===null&&($o=[]),Om($o,a,r)}function Ef(a,r){r=r.props.ref,a.ref=r!==void 0?r:null}function Tf(a,r){throw r.$$typeof===y?Error(n(525)):(a=Object.prototype.toString.call(r),Error(n(31,a==="[object Object]"?"object with keys {"+Object.keys(r).join(", ")+"}":a)))}function Kc(a){function r(Se,me){if(a){var Ce=Se.deletions;Ce===null?(Se.deletions=[me],Se.flags|=16):Ce.push(me)}}function f(Se,me){if(!a)return null;for(;me!==null;)r(Se,me),me=me.sibling;return null}function m(Se){for(var me=new Map;Se!==null;)Se.key!==null?me.set(Se.key,Se):me.set(Se.index,Se),Se=Se.sibling;return me}function A(Se,me){return Se=wr(Se,me),Se.index=0,Se.sibling=null,Se}function E(Se,me,Ce){return Se.index=Ce,a?(Ce=Se.alternate,Ce!==null?(Ce=Ce.index,Ce<me?(Se.flags|=67108866,me):Ce):(Se.flags|=67108866,me)):(Se.flags|=1048576,me)}function L(Se){return a&&Se.alternate===null&&(Se.flags|=67108866),Se}function Y(Se,me,Ce,Ze){return me===null||me.tag!==6?(me=ud(Ce,Se.mode,Ze),me.return=Se,me):(me=A(me,Ce),me.return=Se,me)}function re(Se,me,Ce,Ze){var sn=Ce.type;return sn===R?Xe(Se,me,Ce.props.children,Ze,Ce.key):me!==null&&(me.elementType===sn||typeof sn=="object"&&sn!==null&&sn.$$typeof===V&&Xl(sn)===me.type)?(me=A(me,Ce.props),Ef(me,Ce),me.return=Se,me):(me=_f(Ce.type,Ce.key,Ce.props,null,Se.mode,Ze),Ef(me,Ce),me.return=Se,me)}function Re(Se,me,Ce,Ze){return me===null||me.tag!==4||me.stateNode.containerInfo!==Ce.containerInfo||me.stateNode.implementation!==Ce.implementation?(me=sr(Ce,Se.mode,Ze),me.return=Se,me):(me=A(me,Ce.children||[]),me.return=Se,me)}function Xe(Se,me,Ce,Ze,sn){return me===null||me.tag!==7?(me=so(Ce,Se.mode,Ze,sn),me.return=Se,me):(me=A(me,Ce),me.return=Se,me)}function $e(Se,me,Ce){if(typeof me=="string"&&me!==""||typeof me=="number"||typeof me=="bigint")return me=ud(""+me,Se.mode,Ce),me.return=Se,me;if(typeof me=="object"&&me!==null){switch(me.$$typeof){case x:return Ce=_f(me.type,me.key,me.props,null,Se.mode,Ce),Ef(Ce,me),Ce.return=Se,Ce;case b:return me=sr(me,Se.mode,Ce),me.return=Se,me;case V:return me=Xl(me),$e(Se,me,Ce)}if(ge(me)||ne(me))return me=so(me,Se.mode,Ce,null),me.return=Se,me;if(typeof me.then=="function")return $e(Se,vd(me),Ce);if(me.$$typeof===D)return $e(Se,Sf(Se,me),Ce);Tf(Se,me)}return null}function De(Se,me,Ce,Ze){var sn=me!==null?me.key:null;if(typeof Ce=="string"&&Ce!==""||typeof Ce=="number"||typeof Ce=="bigint")return sn!==null?null:Y(Se,me,""+Ce,Ze);if(typeof Ce=="object"&&Ce!==null){switch(Ce.$$typeof){case x:return Ce.key===sn?re(Se,me,Ce,Ze):null;case b:return Ce.key===sn?Re(Se,me,Ce,Ze):null;case V:return Ce=Xl(Ce),De(Se,me,Ce,Ze)}if(ge(Ce)||ne(Ce))return sn!==null?null:Xe(Se,me,Ce,Ze,null);if(typeof Ce.then=="function")return De(Se,me,vd(Ce),Ze);if(Ce.$$typeof===D)return De(Se,me,Sf(Se,Ce),Ze);Tf(Se,Ce)}return null}function Pe(Se,me,Ce,Ze,sn){if(typeof Ze=="string"&&Ze!==""||typeof Ze=="number"||typeof Ze=="bigint")return Se=Se.get(Ce)||null,Y(me,Se,""+Ze,sn);if(typeof Ze=="object"&&Ze!==null){switch(Ze.$$typeof){case x:return Se=Se.get(Ze.key===null?Ce:Ze.key)||null,re(me,Se,Ze,sn);case b:return Se=Se.get(Ze.key===null?Ce:Ze.key)||null,Re(me,Se,Ze,sn);case V:return Ze=Xl(Ze),Pe(Se,me,Ce,Ze,sn)}if(ge(Ze)||ne(Ze))return Se=Se.get(Ce)||null,Xe(me,Se,Ze,sn,null);if(typeof Ze.then=="function")return Pe(Se,me,Ce,vd(Ze),sn);if(Ze.$$typeof===D)return Pe(Se,me,Ce,Sf(me,Ze),sn);Tf(me,Ze)}return null}function qt(Se,me,Ce,Ze){for(var sn=null,ni=null,Kt=me,Tn=me=0,Vn=null;Kt!==null&&Tn<Ce.length;Tn++){Kt.index>Tn?(Vn=Kt,Kt=null):Vn=Kt.sibling;var ii=De(Se,Kt,Ce[Tn],Ze);if(ii===null){Kt===null&&(Kt=Vn);break}a&&Kt&&ii.alternate===null&&r(Se,Kt),me=E(ii,me,Tn),ni===null?sn=ii:ni.sibling=ii,ni=ii,Kt=Vn}if(Tn===Ce.length)return f(Se,Kt),In&&ro(Se,Tn),sn;if(Kt===null){for(;Tn<Ce.length;Tn++)Kt=$e(Se,Ce[Tn],Ze),Kt!==null&&(me=E(Kt,me,Tn),ni===null?sn=Kt:ni.sibling=Kt,ni=Kt);return In&&ro(Se,Tn),sn}for(Kt=m(Kt);Tn<Ce.length;Tn++)Vn=Pe(Kt,Se,Tn,Ce[Tn],Ze),Vn!==null&&(a&&Vn.alternate!==null&&Kt.delete(Vn.key===null?Tn:Vn.key),me=E(Vn,me,Tn),ni===null?sn=Vn:ni.sibling=Vn,ni=Vn);return a&&Kt.forEach(function(pu){return r(Se,pu)}),In&&ro(Se,Tn),sn}function cn(Se,me,Ce,Ze){if(Ce==null)throw Error(n(151));for(var sn=null,ni=null,Kt=me,Tn=me=0,Vn=null,ii=Ce.next();Kt!==null&&!ii.done;Tn++,ii=Ce.next()){Kt.index>Tn?(Vn=Kt,Kt=null):Vn=Kt.sibling;var pu=De(Se,Kt,ii.value,Ze);if(pu===null){Kt===null&&(Kt=Vn);break}a&&Kt&&pu.alternate===null&&r(Se,Kt),me=E(pu,me,Tn),ni===null?sn=pu:ni.sibling=pu,ni=pu,Kt=Vn}if(ii.done)return f(Se,Kt),In&&ro(Se,Tn),sn;if(Kt===null){for(;!ii.done;Tn++,ii=Ce.next())ii=$e(Se,ii.value,Ze),ii!==null&&(me=E(ii,me,Tn),ni===null?sn=ii:ni.sibling=ii,ni=ii);return In&&ro(Se,Tn),sn}for(Kt=m(Kt);!ii.done;Tn++,ii=Ce.next())ii=Pe(Kt,Se,Tn,ii.value,Ze),ii!==null&&(a&&ii.alternate!==null&&Kt.delete(ii.key===null?Tn:ii.key),me=E(ii,me,Tn),ni===null?sn=ii:ni.sibling=ii,ni=ii);return a&&Kt.forEach(function(H4){return r(Se,H4)}),In&&ro(Se,Tn),sn}function di(Se,me,Ce,Ze){if(typeof Ce=="object"&&Ce!==null&&Ce.type===R&&Ce.key===null&&(Ce=Ce.props.children),typeof Ce=="object"&&Ce!==null){switch(Ce.$$typeof){case x:e:{for(var sn=Ce.key;me!==null;){if(me.key===sn){if(sn=Ce.type,sn===R){if(me.tag===7){f(Se,me.sibling),Ze=A(me,Ce.props.children),Ze.return=Se,Se=Ze;break e}}else if(me.elementType===sn||typeof sn=="object"&&sn!==null&&sn.$$typeof===V&&Xl(sn)===me.type){f(Se,me.sibling),Ze=A(me,Ce.props),Ef(Ze,Ce),Ze.return=Se,Se=Ze;break e}f(Se,me);break}else r(Se,me);me=me.sibling}Ce.type===R?(Ze=so(Ce.props.children,Se.mode,Ze,Ce.key),Ze.return=Se,Se=Ze):(Ze=_f(Ce.type,Ce.key,Ce.props,null,Se.mode,Ze),Ef(Ze,Ce),Ze.return=Se,Se=Ze)}return L(Se);case b:e:{for(sn=Ce.key;me!==null;){if(me.key===sn)if(me.tag===4&&me.stateNode.containerInfo===Ce.containerInfo&&me.stateNode.implementation===Ce.implementation){f(Se,me.sibling),Ze=A(me,Ce.children||[]),Ze.return=Se,Se=Ze;break e}else{f(Se,me);break}else r(Se,me);me=me.sibling}Ze=sr(Ce,Se.mode,Ze),Ze.return=Se,Se=Ze}return L(Se);case V:return Ce=Xl(Ce),di(Se,me,Ce,Ze)}if(ge(Ce))return qt(Se,me,Ce,Ze);if(ne(Ce)){if(sn=ne(Ce),typeof sn!="function")throw Error(n(150));return Ce=sn.call(Ce),cn(Se,me,Ce,Ze)}if(typeof Ce.then=="function")return di(Se,me,vd(Ce),Ze);if(Ce.$$typeof===D)return di(Se,me,Sf(Se,Ce),Ze);Tf(Se,Ce)}return typeof Ce=="string"&&Ce!==""||typeof Ce=="number"||typeof Ce=="bigint"?(Ce=""+Ce,me!==null&&me.tag===6?(f(Se,me.sibling),Ze=A(me,Ce),Ze.return=Se,Se=Ze):(f(Se,me),Ze=ud(Ce,Se.mode,Ze),Ze.return=Se,Se=Ze),L(Se)):f(Se,me)}return function(Se,me,Ce,Ze){try{el=0;var sn=di(Se,me,Ce,Ze);return $o=null,sn}catch(Kt){if(Kt===Qo||Kt===lr)throw Kt;var ni=ka(29,Kt,null,Se.mode);return ni.lanes=Ze,ni.return=Se,ni}}}var Yl=Kc(!0),V_=Kc(!1),tl=!1;function Fm(a){a.updateQueue={baseState:a.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function Hm(a,r){a=a.updateQueue,r.updateQueue===a&&(r.updateQueue={baseState:a.baseState,firstBaseUpdate:a.firstBaseUpdate,lastBaseUpdate:a.lastBaseUpdate,shared:a.shared,callbacks:null})}function Lr(a){return{lane:a,tag:0,payload:null,callback:null,next:null}}function ho(a,r,f){var m=a.updateQueue;if(m===null)return null;if(m=m.shared,(Gn&2)!==0){var A=m.pending;return A===null?r.next=r:(r.next=A.next,A.next=r),m.pending=r,r=kc(a),cd(a,null,f),r}return vf(a,m,r,f),kc(a)}function nl(a,r,f){if(r=r.updateQueue,r!==null&&(r=r.shared,(f&4194048)!==0)){var m=r.lanes;m&=a.pendingLanes,f|=m,r.lanes=f,ir(a,f)}}function _d(a,r){var f=a.updateQueue,m=a.alternate;if(m!==null&&(m=m.updateQueue,f===m)){var A=null,E=null;if(f=f.firstBaseUpdate,f!==null){do{var L={lane:f.lane,tag:f.tag,payload:f.payload,callback:null,next:null};E===null?A=E=L:E=E.next=L,f=f.next}while(f!==null);E===null?A=E=r:E=E.next=r}else A=E=r;f={baseState:m.baseState,firstBaseUpdate:A,lastBaseUpdate:E,shared:m.shared,callbacks:m.callbacks},a.updateQueue=f;return}a=f.lastBaseUpdate,a===null?f.firstBaseUpdate=r:a.next=r,f.lastBaseUpdate=r}var Pm=!1;function Cf(){if(Pm){var a=or;if(a!==null)throw a}}function Jl(a,r,f,m){Pm=!1;var A=a.updateQueue;tl=!1;var E=A.firstBaseUpdate,L=A.lastBaseUpdate,Y=A.shared.pending;if(Y!==null){A.shared.pending=null;var re=Y,Re=re.next;re.next=null,L===null?E=Re:L.next=Re,L=re;var Xe=a.alternate;Xe!==null&&(Xe=Xe.updateQueue,Y=Xe.lastBaseUpdate,Y!==L&&(Y===null?Xe.firstBaseUpdate=Re:Y.next=Re,Xe.lastBaseUpdate=re))}if(E!==null){var $e=A.baseState;L=0,Xe=Re=re=null,Y=E;do{var De=Y.lane&-536870913,Pe=De!==Y.lane;if(Pe?(Nn&De)===De:(m&De)===De){De!==0&&De===fo&&(Pm=!0),Xe!==null&&(Xe=Xe.next={lane:0,tag:Y.tag,payload:Y.payload,callback:null,next:null});e:{var qt=a,cn=Y;De=r;var di=f;switch(cn.tag){case 1:if(qt=cn.payload,typeof qt=="function"){$e=qt.call(di,$e,De);break e}$e=qt;break e;case 3:qt.flags=qt.flags&-65537|128;case 0:if(qt=cn.payload,De=typeof qt=="function"?qt.call(di,$e,De):qt,De==null)break e;$e=v({},$e,De);break e;case 2:tl=!0}}De=Y.callback,De!==null&&(a.flags|=64,Pe&&(a.flags|=8192),Pe=A.callbacks,Pe===null?A.callbacks=[De]:Pe.push(De))}else Pe={lane:De,tag:Y.tag,payload:Y.payload,callback:Y.callback,next:null},Xe===null?(Re=Xe=Pe,re=$e):Xe=Xe.next=Pe,L|=De;if(Y=Y.next,Y===null){if(Y=A.shared.pending,Y===null)break;Pe=Y,Y=Pe.next,Pe.next=null,A.lastBaseUpdate=Pe,A.shared.pending=null}}while(!0);Xe===null&&(re=$e),A.baseState=re,A.firstBaseUpdate=Re,A.lastBaseUpdate=Xe,E===null&&(A.shared.lanes=0),Ns|=L,a.lanes=L,a.memoizedState=$e}}function Or(a,r){if(typeof a!="function")throw Error(n(191,a));a.call(r)}function Sa(a,r){var f=a.callbacks;if(f!==null)for(a.callbacks=null,a=0;a<f.length;a++)Or(f[a],r)}var Ss=X(null),Ya=X(0);function Gm(a,r){a=Vi,le(Ya,a),le(Ss,r),Vi=a|r.baseLanes}function zm(){le(Ya,Vi),le(Ss,Ss.current)}function Ia(){Vi=Ya.current,te(Ss),te(Ya)}var $i=X(null),Vs=null;function il(a){var r=a.alternate;le(Bi,Bi.current&1),le($i,a),Vs===null&&(r===null||Ss.current!==null||r.memoizedState!==null)&&(Vs=a)}function Vm(a){le(Bi,Bi.current),le($i,a),Vs===null&&(Vs=a)}function k_(a){a.tag===22?(le(Bi,Bi.current),le($i,a),Vs===null&&(Vs=a)):po()}function po(){le(Bi,Bi.current),le($i,$i.current)}function Ms(a){te($i),Vs===a&&(Vs=null),te(Bi)}var Bi=X(0);function yd(a){for(var r=a;r!==null;){if(r.tag===13){var f=r.memoizedState;if(f!==null&&(f=f.dehydrated,f===null||uM(f)||fM(f)))return r}else if(r.tag===19&&(r.memoizedProps.revealOrder==="forwards"||r.memoizedProps.revealOrder==="backwards"||r.memoizedProps.revealOrder==="unstable_legacy-backwards"||r.memoizedProps.revealOrder==="together")){if((r.flags&128)!==0)return r}else if(r.child!==null){r.child.return=r,r=r.child;continue}if(r===a)break;for(;r.sibling===null;){if(r.return===null||r.return===a)return null;r=r.return}r.sibling.return=r.return,r=r.sibling}return null}var is=0,fn=null,oi=null,Ki=null,xd=!1,Ir=!1,ql=!1,Ad=0,Rf=0,Fr=null,VS=0;function Di(){throw Error(n(321))}function km(a,r){if(r===null)return!1;for(var f=0;f<r.length&&f<a.length;f++)if(!gi(a[f],r[f]))return!1;return!0}function Xm(a,r,f,m,A,E){return is=E,fn=r,r.memoizedState=null,r.updateQueue=null,r.lanes=0,I.H=a===null||a.memoizedState===null?cy:Zc,ql=!1,E=f(m,A),ql=!1,Ir&&(E=Y_(r,f,m,A)),X_(a),E}function X_(a){I.H=Uf;var r=oi!==null&&oi.next!==null;if(is=0,Ki=oi=fn=null,xd=!1,Rf=0,Fr=null,r)throw Error(n(300));a===null||vi||(a=a.dependencies,a!==null&&Yc(a)&&(vi=!0))}function Y_(a,r,f,m){fn=a;var A=0;do{if(Ir&&(Fr=null),Rf=0,Ir=!1,25<=A)throw Error(n(301));if(A+=1,Ki=oi=null,a.updateQueue!=null){var E=a.updateQueue;E.lastEffect=null,E.events=null,E.stores=null,E.memoCache!=null&&(E.memoCache.index=0)}I.H=Lf,E=r(f,m)}while(Ir);return E}function kS(){var a=I.H,r=a.useState()[0];return r=typeof r.then=="function"?Bf(r):r,a=a.useState()[0],(oi!==null?oi.memoizedState:null)!==a&&(fn.flags|=1024),r}function Ym(){var a=Ad!==0;return Ad=0,a}function Jm(a,r,f){r.updateQueue=a.updateQueue,r.flags&=-2053,a.lanes&=~f}function qm(a){if(xd){for(a=a.memoizedState;a!==null;){var r=a.queue;r!==null&&(r.pending=null),a=a.next}xd=!1}is=0,Ki=oi=fn=null,Ir=!1,Rf=Ad=0,Fr=null}function Ja(){var a={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return Ki===null?fn.memoizedState=Ki=a:Ki=Ki.next=a,Ki}function Hi(){if(oi===null){var a=fn.alternate;a=a!==null?a.memoizedState:null}else a=oi.next;var r=Ki===null?fn.memoizedState:Ki.next;if(r!==null)Ki=r,oi=a;else{if(a===null)throw fn.alternate===null?Error(n(467)):Error(n(310));oi=a,a={memoizedState:oi.memoizedState,baseState:oi.baseState,baseQueue:oi.baseQueue,queue:oi.queue,next:null},Ki===null?fn.memoizedState=Ki=a:Ki=Ki.next=a}return Ki}function wf(){return{lastEffect:null,events:null,stores:null,memoCache:null}}function Bf(a){var r=Rf;return Rf+=1,Fr===null&&(Fr=[]),a=Om(Fr,a,r),r=fn,(Ki===null?r.memoizedState:Ki.next)===null&&(r=r.alternate,I.H=r===null||r.memoizedState===null?cy:Zc),a}function Sd(a){if(a!==null&&typeof a=="object"){if(typeof a.then=="function")return Bf(a);if(a.$$typeof===D)return ca(a)}throw Error(n(438,String(a)))}function Km(a){var r=null,f=fn.updateQueue;if(f!==null&&(r=f.memoCache),r==null){var m=fn.alternate;m!==null&&(m=m.updateQueue,m!==null&&(m=m.memoCache,m!=null&&(r={data:m.data.map(function(A){return A.slice()}),index:0})))}if(r==null&&(r={data:[],index:0}),f===null&&(f=wf(),fn.updateQueue=f),f.memoCache=r,f=r.data[r.index],f===void 0)for(f=r.data[r.index]=Array(a),m=0;m<a;m++)f[m]=F;return r.index++,f}function mo(a,r){return typeof r=="function"?r(a):r}function Md(a){var r=Hi();return Wm(r,oi,a)}function Wm(a,r,f){var m=a.queue;if(m===null)throw Error(n(311));m.lastRenderedReducer=f;var A=a.baseQueue,E=m.pending;if(E!==null){if(A!==null){var L=A.next;A.next=E.next,E.next=L}r.baseQueue=A=E,m.pending=null}if(E=a.baseState,A===null)a.memoizedState=E;else{r=A.next;var Y=L=null,re=null,Re=r,Xe=!1;do{var $e=Re.lane&-536870913;if($e!==Re.lane?(Nn&$e)===$e:(is&$e)===$e){var De=Re.revertLane;if(De===0)re!==null&&(re=re.next={lane:0,revertLane:0,gesture:null,action:Re.action,hasEagerState:Re.hasEagerState,eagerState:Re.eagerState,next:null}),$e===fo&&(Xe=!0);else if((is&De)===De){Re=Re.next,De===fo&&(Xe=!0);continue}else $e={lane:0,revertLane:Re.revertLane,gesture:null,action:Re.action,hasEagerState:Re.hasEagerState,eagerState:Re.eagerState,next:null},re===null?(Y=re=$e,L=E):re=re.next=$e,fn.lanes|=De,Ns|=De;$e=Re.action,ql&&f(E,$e),E=Re.hasEagerState?Re.eagerState:f(E,$e)}else De={lane:$e,revertLane:Re.revertLane,gesture:Re.gesture,action:Re.action,hasEagerState:Re.hasEagerState,eagerState:Re.eagerState,next:null},re===null?(Y=re=De,L=E):re=re.next=De,fn.lanes|=$e,Ns|=$e;Re=Re.next}while(Re!==null&&Re!==r);if(re===null?L=E:re.next=Y,!gi(E,a.memoizedState)&&(vi=!0,Xe&&(f=or,f!==null)))throw f;a.memoizedState=E,a.baseState=L,a.baseQueue=re,m.lastRenderedState=E}return A===null&&(m.lanes=0),[a.memoizedState,m.dispatch]}function bd(a){var r=Hi(),f=r.queue;if(f===null)throw Error(n(311));f.lastRenderedReducer=a;var m=f.dispatch,A=f.pending,E=r.memoizedState;if(A!==null){f.pending=null;var L=A=A.next;do E=a(E,L.action),L=L.next;while(L!==A);gi(E,r.memoizedState)||(vi=!0),r.memoizedState=E,r.baseQueue===null&&(r.baseState=E),f.lastRenderedState=E}return[E,m]}function jm(a,r,f){var m=fn,A=Hi(),E=In;if(E){if(f===void 0)throw Error(n(407));f=f()}else f=r();var L=!gi((oi||A).memoizedState,f);if(L&&(A.memoizedState=f,vi=!0),A=A.queue,tg(Qm.bind(null,m,A,a),[a]),A.getSnapshot!==r||L||Ki!==null&&Ki.memoizedState.tag&1){if(m.flags|=2048,Wc(9,{destroy:void 0},Zm.bind(null,m,A,f,r),null),ei===null)throw Error(n(349));E||(is&127)!==0||J_(m,r,f)}return f}function J_(a,r,f){a.flags|=16384,a={getSnapshot:r,value:f},r=fn.updateQueue,r===null?(r=wf(),fn.updateQueue=r,r.stores=[a]):(f=r.stores,f===null?r.stores=[a]:f.push(a))}function Zm(a,r,f,m){r.value=f,r.getSnapshot=m,$m(r)&&Ed(a)}function Qm(a,r,f){return f(function(){$m(r)&&Ed(a)})}function $m(a){var r=a.getSnapshot;a=a.value;try{var f=r();return!gi(a,f)}catch{return!0}}function Ed(a){var r=qo(a,2);r!==null&&u(r,a,2)}function Df(a){var r=Ja();if(typeof a=="function"){var f=a;if(a=f(),ql){wt(!0);try{f()}finally{wt(!1)}}}return r.memoizedState=r.baseState=a,r.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:mo,lastRenderedState:a},r}function q_(a,r,f,m){return a.baseState=f,Wm(a,oi,typeof m=="function"?m:mo)}function XS(a,r,f,m,A){if(go(a))throw Error(n(485));if(a=r.action,a!==null){var E={payload:A,action:a,next:null,isTransition:!0,status:"pending",value:null,reason:null,listeners:[],then:function(L){E.listeners.push(L)}};I.T!==null?f(!0):E.isTransition=!1,m(E),f=r.pending,f===null?(E.next=r.pending=E,K_(r,E)):(E.next=f.next,r.pending=f.next=E)}}function K_(a,r){var f=r.action,m=r.payload,A=a.state;if(r.isTransition){var E=I.T,L={};I.T=L;try{var Y=f(A,m),re=I.S;re!==null&&re(L,Y),W_(a,r,Y)}catch(Re){Td(a,r,Re)}finally{E!==null&&L.types!==null&&(E.types=L.types),I.T=E}}else try{E=f(A,m),W_(a,r,E)}catch(Re){Td(a,r,Re)}}function W_(a,r,f){f!==null&&typeof f=="object"&&typeof f.then=="function"?f.then(function(m){eg(a,r,m)},function(m){return Td(a,r,m)}):eg(a,r,f)}function eg(a,r,f){r.status="fulfilled",r.value=f,j_(r),a.state=f,r=a.pending,r!==null&&(f=r.next,f===r?a.pending=null:(f=f.next,r.next=f,K_(a,f)))}function Td(a,r,f){var m=a.pending;if(a.pending=null,m!==null){m=m.next;do r.status="rejected",r.reason=f,j_(r),r=r.next;while(r!==m)}a.action=null}function j_(a){a=a.listeners;for(var r=0;r<a.length;r++)(0,a[r])()}function Z_(a,r){return r}function Q_(a,r){if(In){var f=ei.formState;if(f!==null){e:{var m=fn;if(In){if(ui){t:{for(var A=ui,E=la;A.nodeType!==8;){if(!E){A=null;break t}if(A=kr(A.nextSibling),A===null){A=null;break t}}E=A.data,A=E==="F!"||E==="F"?A:null}if(A){ui=kr(A.nextSibling),m=A.data==="F!";break e}}Dn(m)}m=!1}m&&(r=f[0])}}return f=Ja(),f.memoizedState=f.baseState=r,m={pending:null,lanes:0,dispatch:null,lastRenderedReducer:Z_,lastRenderedState:r},f.queue=m,f=ly.bind(null,fn,m),m.dispatch=f,m=Df(!1),E=Nf.bind(null,fn,!1,m.queue),m=Ja(),A={state:r,dispatch:null,action:a,pending:null},m.queue=A,f=XS.bind(null,fn,A,E,f),A.dispatch=f,m.memoizedState=a,[r,f,!1]}function $_(a){var r=Hi();return ey(r,oi,a)}function ey(a,r,f){if(r=Wm(a,r,Z_)[0],a=Md(mo)[0],typeof r=="object"&&r!==null&&typeof r.then=="function")try{var m=Bf(r)}catch(L){throw L===Qo?lr:L}else m=r;r=Hi();var A=r.queue,E=A.dispatch;return f!==r.memoizedState&&(fn.flags|=2048,Wc(9,{destroy:void 0},YS.bind(null,A,f),null)),[m,E,a]}function YS(a,r){a.action=r}function ty(a){var r=Hi(),f=oi;if(f!==null)return ey(r,f,a);Hi(),r=r.memoizedState,f=Hi();var m=f.queue.dispatch;return f.memoizedState=a,[r,m,!1]}function Wc(a,r,f,m){return a={tag:a,create:f,deps:m,inst:r,next:null},r=fn.updateQueue,r===null&&(r=wf(),fn.updateQueue=r),f=r.lastEffect,f===null?r.lastEffect=a.next=a:(m=f.next,f.next=a,a.next=m,r.lastEffect=a),a}function ny(){return Hi().memoizedState}function Cd(a,r,f,m){var A=Ja();fn.flags|=a,A.memoizedState=Wc(1|r,{destroy:void 0},f,m===void 0?null:m)}function Rd(a,r,f,m){var A=Hi();m=m===void 0?null:m;var E=A.memoizedState.inst;oi!==null&&m!==null&&km(m,oi.memoizedState.deps)?A.memoizedState=Wc(r,E,f,m):(fn.flags|=a,A.memoizedState=Wc(1|r,E,f,m))}function iy(a,r){Cd(8390656,8,a,r)}function tg(a,r){Rd(2048,8,a,r)}function ay(a){fn.flags|=4;var r=fn.updateQueue;if(r===null)r=wf(),fn.updateQueue=r,r.events=[a];else{var f=r.events;f===null?r.events=[a]:f.push(a)}}function sy(a){var r=Hi().memoizedState;return ay({ref:r,nextImpl:a}),function(){if((Gn&2)!==0)throw Error(n(440));return r.impl.apply(void 0,arguments)}}function ry(a,r){return Rd(4,2,a,r)}function bs(a,r){return Rd(4,4,a,r)}function ng(a,r){if(typeof r=="function"){a=a();var f=r(a);return function(){typeof f=="function"?f():r(null)}}if(r!=null)return a=a(),r.current=a,function(){r.current=null}}function wd(a,r,f){f=f!=null?f.concat([a]):null,Rd(4,4,ng.bind(null,r,a),f)}function Bd(){}function ig(a,r){var f=Hi();r=r===void 0?null:r;var m=f.memoizedState;return r!==null&&km(r,m[1])?m[0]:(f.memoizedState=[a,r],a)}function ag(a,r){var f=Hi();r=r===void 0?null:r;var m=f.memoizedState;if(r!==null&&km(r,m[1]))return m[0];if(m=a(),ql){wt(!0);try{a()}finally{wt(!1)}}return f.memoizedState=[m,r],m}function sg(a,r,f){return f===void 0||(is&1073741824)!==0&&(Nn&261930)===0?a.memoizedState=r:(a.memoizedState=f,a=c(),fn.lanes|=a,Ns|=a,f)}function rg(a,r,f,m){return gi(f,r)?f:Ss.current!==null?(a=sg(a,f,m),gi(a,r)||(vi=!0),a):(is&42)===0||(is&1073741824)!==0&&(Nn&261930)===0?(vi=!0,a.memoizedState=f):(a=c(),fn.lanes|=a,Ns|=a,r)}function og(a,r,f,m,A){var E=W.p;W.p=E!==0&&8>E?E:8;var L=I.T,Y={};I.T=Y,Nf(a,!1,r,f);try{var re=A(),Re=I.S;if(Re!==null&&Re(Y,re),re!==null&&typeof re=="object"&&typeof re.then=="function"){var Xe=Lm(re,m);jc(a,r,Xe,Ka(a))}else jc(a,r,m,Ka(a))}catch($e){jc(a,r,{then:function(){},status:"rejected",reason:$e},Ka())}finally{W.p=E,L!==null&&Y.types!==null&&(L.types=Y.types),I.T=L}}function JS(){}function lg(a,r,f,m){if(a.tag!==5)throw Error(n(476));var A=oy(a).queue;og(a,A,r,ee,f===null?JS:function(){return cg(a),f(m)})}function oy(a){var r=a.memoizedState;if(r!==null)return r;r={memoizedState:ee,baseState:ee,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:mo,lastRenderedState:ee},next:null};var f={};return r.next={memoizedState:f,baseState:f,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:mo,lastRenderedState:f},next:null},a.memoizedState=r,a=a.alternate,a!==null&&(a.memoizedState=r),r}function cg(a){var r=oy(a);r.next===null&&(r=a.alternate.memoizedState),jc(a,r.next.queue,{},Ka())}function ug(){return ca(Mg)}function Ma(){return Hi().memoizedState}function fg(){return Hi().memoizedState}function qS(a){for(var r=a.return;r!==null;){switch(r.tag){case 24:case 3:var f=Ka();a=Lr(f);var m=ho(r,a,f);m!==null&&(u(m,r,f),nl(m,r,f)),r={cache:Dm()},a.payload=r;return}r=r.return}}function KS(a,r,f){var m=Ka();f={lane:m,revertLane:0,gesture:null,action:f,hasEagerState:!1,eagerState:null,next:null},go(a)?Kl(r,f):(f=Vc(a,r,f,m),f!==null&&(u(f,a,m),as(f,r,m)))}function ly(a,r,f){var m=Ka();jc(a,r,f,m)}function jc(a,r,f,m){var A={lane:m,revertLane:0,gesture:null,action:f,hasEagerState:!1,eagerState:null,next:null};if(go(a))Kl(r,A);else{var E=a.alternate;if(a.lanes===0&&(E===null||E.lanes===0)&&(E=r.lastRenderedReducer,E!==null))try{var L=r.lastRenderedState,Y=E(L,f);if(A.hasEagerState=!0,A.eagerState=Y,gi(Y,L))return vf(a,r,A,0),ei===null&&Jo(),!1}catch{}if(f=Vc(a,r,A,m),f!==null)return u(f,a,m),as(f,r,m),!0}return!1}function Nf(a,r,f,m){if(m={lane:2,revertLane:QS(),gesture:null,action:m,hasEagerState:!1,eagerState:null,next:null},go(a)){if(r)throw Error(n(479))}else r=Vc(a,f,m,2),r!==null&&u(r,a,2)}function go(a){var r=a.alternate;return a===fn||r!==null&&r===fn}function Kl(a,r){Ir=xd=!0;var f=a.pending;f===null?r.next=r:(r.next=f.next,f.next=r),a.pending=r}function as(a,r,f){if((f&4194048)!==0){var m=r.lanes;m&=a.pendingLanes,f|=m,r.lanes=f,ir(a,f)}}var Uf={readContext:ca,use:Sd,useCallback:Di,useContext:Di,useEffect:Di,useImperativeHandle:Di,useLayoutEffect:Di,useInsertionEffect:Di,useMemo:Di,useReducer:Di,useRef:Di,useState:Di,useDebugValue:Di,useDeferredValue:Di,useTransition:Di,useSyncExternalStore:Di,useId:Di,useHostTransitionStatus:Di,useFormState:Di,useActionState:Di,useOptimistic:Di,useMemoCache:Di,useCacheRefresh:Di};Uf.useEffectEvent=Di;var cy={readContext:ca,use:Sd,useCallback:function(a,r){return Ja().memoizedState=[a,r===void 0?null:r],a},useContext:ca,useEffect:iy,useImperativeHandle:function(a,r,f){f=f!=null?f.concat([a]):null,Cd(4194308,4,ng.bind(null,r,a),f)},useLayoutEffect:function(a,r){return Cd(4194308,4,a,r)},useInsertionEffect:function(a,r){Cd(4,2,a,r)},useMemo:function(a,r){var f=Ja();r=r===void 0?null:r;var m=a();if(ql){wt(!0);try{a()}finally{wt(!1)}}return f.memoizedState=[m,r],m},useReducer:function(a,r,f){var m=Ja();if(f!==void 0){var A=f(r);if(ql){wt(!0);try{f(r)}finally{wt(!1)}}}else A=r;return m.memoizedState=m.baseState=A,a={pending:null,lanes:0,dispatch:null,lastRenderedReducer:a,lastRenderedState:A},m.queue=a,a=a.dispatch=KS.bind(null,fn,a),[m.memoizedState,a]},useRef:function(a){var r=Ja();return a={current:a},r.memoizedState=a},useState:function(a){a=Df(a);var r=a.queue,f=ly.bind(null,fn,r);return r.dispatch=f,[a.memoizedState,f]},useDebugValue:Bd,useDeferredValue:function(a,r){var f=Ja();return sg(f,a,r)},useTransition:function(){var a=Df(!1);return a=og.bind(null,fn,a.queue,!0,!1),Ja().memoizedState=a,[!1,a]},useSyncExternalStore:function(a,r,f){var m=fn,A=Ja();if(In){if(f===void 0)throw Error(n(407));f=f()}else{if(f=r(),ei===null)throw Error(n(349));(Nn&127)!==0||J_(m,r,f)}A.memoizedState=f;var E={value:f,getSnapshot:r};return A.queue=E,iy(Qm.bind(null,m,E,a),[a]),m.flags|=2048,Wc(9,{destroy:void 0},Zm.bind(null,m,E,f,r),null),f},useId:function(){var a=Ja(),r=ei.identifierPrefix;if(In){var f=Nr,m=Dr;f=(m&~(1<<32-bt(m)-1)).toString(32)+f,r="_"+r+"R_"+f,f=Ad++,0<f&&(r+="H"+f.toString(32)),r+="_"}else f=VS++,r="_"+r+"r_"+f.toString(32)+"_";return a.memoizedState=r},useHostTransitionStatus:ug,useFormState:Q_,useActionState:Q_,useOptimistic:function(a){var r=Ja();r.memoizedState=r.baseState=a;var f={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return r.queue=f,r=Nf.bind(null,fn,!0,f),f.dispatch=r,[a,r]},useMemoCache:Km,useCacheRefresh:function(){return Ja().memoizedState=qS.bind(null,fn)},useEffectEvent:function(a){var r=Ja(),f={impl:a};return r.memoizedState=f,function(){if((Gn&2)!==0)throw Error(n(440));return f.impl.apply(void 0,arguments)}}},Zc={readContext:ca,use:Sd,useCallback:ig,useContext:ca,useEffect:tg,useImperativeHandle:wd,useInsertionEffect:ry,useLayoutEffect:bs,useMemo:ag,useReducer:Md,useRef:ny,useState:function(){return Md(mo)},useDebugValue:Bd,useDeferredValue:function(a,r){var f=Hi();return rg(f,oi.memoizedState,a,r)},useTransition:function(){var a=Md(mo)[0],r=Hi().memoizedState;return[typeof a=="boolean"?a:Bf(a),r]},useSyncExternalStore:jm,useId:Ma,useHostTransitionStatus:ug,useFormState:$_,useActionState:$_,useOptimistic:function(a,r){var f=Hi();return q_(f,oi,a,r)},useMemoCache:Km,useCacheRefresh:fg};Zc.useEffectEvent=sy;var Lf={readContext:ca,use:Sd,useCallback:ig,useContext:ca,useEffect:tg,useImperativeHandle:wd,useInsertionEffect:ry,useLayoutEffect:bs,useMemo:ag,useReducer:bd,useRef:ny,useState:function(){return bd(mo)},useDebugValue:Bd,useDeferredValue:function(a,r){var f=Hi();return oi===null?sg(f,a,r):rg(f,oi.memoizedState,a,r)},useTransition:function(){var a=bd(mo)[0],r=Hi().memoizedState;return[typeof a=="boolean"?a:Bf(a),r]},useSyncExternalStore:jm,useId:Ma,useHostTransitionStatus:ug,useFormState:ty,useActionState:ty,useOptimistic:function(a,r){var f=Hi();return oi!==null?q_(f,oi,a,r):(f.baseState=a,[a,f.queue.dispatch])},useMemoCache:Km,useCacheRefresh:fg};Lf.useEffectEvent=sy;function Qc(a,r,f,m){r=a.memoizedState,f=f(m,r),f=f==null?r:v({},r,f),a.memoizedState=f,a.lanes===0&&(a.updateQueue.baseState=f)}var Of={enqueueSetState:function(a,r,f){a=a._reactInternals;var m=Ka(),A=Lr(m);A.payload=r,f!=null&&(A.callback=f),r=ho(a,A,m),r!==null&&(u(r,a,m),nl(r,a,m))},enqueueReplaceState:function(a,r,f){a=a._reactInternals;var m=Ka(),A=Lr(m);A.tag=1,A.payload=r,f!=null&&(A.callback=f),r=ho(a,A,m),r!==null&&(u(r,a,m),nl(r,a,m))},enqueueForceUpdate:function(a,r){a=a._reactInternals;var f=Ka(),m=Lr(f);m.tag=2,r!=null&&(m.callback=r),r=ho(a,m,f),r!==null&&(u(r,a,f),nl(r,a,f))}};function uy(a,r,f,m,A,E,L){return a=a.stateNode,typeof a.shouldComponentUpdate=="function"?a.shouldComponentUpdate(m,E,L):r.prototype&&r.prototype.isPureReactComponent?!Ic(f,m)||!Ic(A,E):!0}function fy(a,r,f,m){a=r.state,typeof r.componentWillReceiveProps=="function"&&r.componentWillReceiveProps(f,m),typeof r.UNSAFE_componentWillReceiveProps=="function"&&r.UNSAFE_componentWillReceiveProps(f,m),r.state!==a&&Of.enqueueReplaceState(r,r.state,null)}function ba(a,r){var f=r;if("ref"in r){f={};for(var m in r)m!=="ref"&&(f[m]=r[m])}if(a=a.defaultProps){f===r&&(f=v({},f));for(var A in a)f[A]===void 0&&(f[A]=a[A])}return f}function hg(a){Yo(a)}function hy(a){console.error(a)}function Dd(a){Yo(a)}function Nd(a,r){try{var f=a.onUncaughtError;f(r.value,{componentStack:r.stack})}catch(m){setTimeout(function(){throw m})}}function dy(a,r,f){try{var m=a.onCaughtError;m(f.value,{componentStack:f.stack,errorBoundary:r.tag===1?r.stateNode:null})}catch(A){setTimeout(function(){throw A})}}function dg(a,r,f){return f=Lr(f),f.tag=3,f.payload={element:null},f.callback=function(){Nd(a,r)},f}function $c(a){return a=Lr(a),a.tag=3,a}function ss(a,r,f,m){var A=f.type.getDerivedStateFromError;if(typeof A=="function"){var E=m.value;a.payload=function(){return A(E)},a.callback=function(){dy(r,f,m)}}var L=f.stateNode;L!==null&&typeof L.componentDidCatch=="function"&&(a.callback=function(){dy(r,f,m),typeof A!="function"&&(Vr===null?Vr=new Set([this]):Vr.add(this));var Y=m.stack;this.componentDidCatch(m.value,{componentStack:Y!==null?Y:""})})}function Es(a,r,f,m,A){if(f.flags|=32768,m!==null&&typeof m=="object"&&typeof m.then=="function"){if(r=f.alternate,r!==null&&jo(r,f,A,!0),f=$i.current,f!==null){switch(f.tag){case 31:case 13:return Vs===null?gn():f.alternate===null&&ti===0&&(ti=3),f.flags&=-257,f.flags|=65536,f.lanes=A,m===bf?f.flags|=16384:(r=f.updateQueue,r===null?f.updateQueue=new Set([m]):r.add(m),WS(a,m,A)),!1;case 22:return f.flags|=65536,m===bf?f.flags|=16384:(r=f.updateQueue,r===null?(r={transitions:null,markerInstances:null,retryQueue:new Set([m])},f.updateQueue=r):(f=r.retryQueue,f===null?r.retryQueue=new Set([m]):f.add(m)),WS(a,m,A)),!1}throw Error(n(435,f.tag))}return WS(a,m,A),gn(),!1}if(In)return r=$i.current,r!==null?((r.flags&65536)===0&&(r.flags|=256),r.flags|=65536,r.lanes=A,m!==hd&&(a=Error(n(422),{cause:m}),Af(ts(a,f)))):(m!==hd&&(r=Error(n(423),{cause:m}),Af(ts(r,f))),a=a.current.alternate,a.flags|=65536,A&=-A,a.lanes|=A,m=ts(m,f),A=dg(a.stateNode,m,A),_d(a,A),ti!==4&&(ti=2)),!1;var E=Error(n(520),{cause:m});if(E=ts(E,f),dr===null?dr=[E]:dr.push(E),ti!==4&&(ti=2),r===null)return!0;m=ts(m,f),f=r;do{switch(f.tag){case 3:return f.flags|=65536,a=A&-A,f.lanes|=a,a=dg(f.stateNode,m,a),_d(f,a),!1;case 1:if(r=f.type,E=f.stateNode,(f.flags&128)===0&&(typeof r.getDerivedStateFromError=="function"||E!==null&&typeof E.componentDidCatch=="function"&&(Vr===null||!Vr.has(E))))return f.flags|=65536,A&=-A,f.lanes|=A,A=$c(A),ss(A,a,f,m),_d(f,A),!1}f=f.return}while(f!==null);return!1}var Ud=Error(n(461)),vi=!1;function Ni(a,r,f,m){r.child=a===null?V_(r,null,f,m):Yl(r,a.child,f,m)}function If(a,r,f,m,A){f=f.render;var E=r.ref;if("ref"in m){var L={};for(var Y in m)Y!=="ref"&&(L[Y]=m[Y])}else L=m;return Vl(r),m=Xm(a,r,f,L,E,A),Y=Ym(),a!==null&&!vi?(Jm(a,r,A),fr(a,r,A)):(In&&Y&&fd(r),r.flags|=1,Ni(a,r,m,A),r.child)}function Ff(a,r,f,m,A){if(a===null){var E=f.type;return typeof E=="function"&&!Xa(E)&&E.defaultProps===void 0&&f.compare===null?(r.tag=15,r.type=E,Ts(a,r,E,m,A)):(a=_f(f.type,null,m,r,r.mode,A),a.ref=r.ref,a.return=r,r.child=a)}if(E=a.child,!sl(a,A)){var L=E.memoizedProps;if(f=f.compare,f=f!==null?f:Ic,f(L,m)&&a.ref===r.ref)return fr(a,r,A)}return r.flags|=1,a=wr(E,m),a.ref=r.ref,a.return=r,r.child=a}function Ts(a,r,f,m,A){if(a!==null){var E=a.memoizedProps;if(Ic(E,m)&&a.ref===r.ref)if(vi=!1,r.pendingProps=m=E,sl(a,A))(a.flags&131072)!==0&&(vi=!0);else return r.lanes=a.lanes,fr(a,r,A)}return eu(a,r,f,m,A)}function Cs(a,r,f,m){var A=m.children,E=a!==null?a.memoizedState:null;if(a===null&&r.stateNode===null&&(r.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),m.mode==="hidden"){if((r.flags&128)!==0){if(E=E!==null?E.baseLanes|f:f,a!==null){for(m=r.child=a.child,A=0;m!==null;)A=A|m.lanes|m.childLanes,m=m.sibling;m=A&~E}else m=0,r.child=null;return Hr(a,r,E,f,m)}if((f&536870912)!==0)r.memoizedState={baseLanes:0,cachePool:null},a!==null&&qc(r,E!==null?E.cachePool:null),E!==null?Gm(r,E):zm(),k_(r);else return m=r.lanes=536870912,Hr(a,r,E!==null?E.baseLanes|f:f,f,m)}else E!==null?(qc(r,E.cachePool),Gm(r,E),po(),r.memoizedState=null):(a!==null&&qc(r,null),zm(),po());return Ni(a,r,A,f),r.child}function cr(a,r){return a!==null&&a.tag===22||r.stateNode!==null||(r.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),r.sibling}function Hr(a,r,f,m,A){var E=Ur();return E=E===null?null:{parent:Qt._currentValue,pool:E},r.memoizedState={baseLanes:f,cachePool:E},a!==null&&qc(r,null),zm(),k_(r),a!==null&&jo(a,r,m,!0),r.childLanes=A,null}function ks(a,r){return r=tu({mode:r.mode,children:r.children},a.mode),r.ref=a.ref,a.child=r,r.return=a,r}function ua(a,r,f){return Yl(r,a.child,null,f),a=ks(r,r.pendingProps),a.flags|=2,Ms(r),r.memoizedState=null,a}function Hf(a,r,f){var m=r.pendingProps,A=(r.flags&128)!==0;if(r.flags&=-129,a===null){if(In){if(m.mode==="hidden")return a=ks(r,m),r.lanes=536870912,cr(null,a);if(Vm(r),(a=ui)?(a=HC(a,la),a=a!==null&&a.data==="&"?a:null,a!==null&&(r.memoizedState={dehydrated:a,treeContext:Br!==null?{id:Dr,overflow:Nr}:null,retryLane:536870912,hydrationErrors:null},f=I_(a),f.return=r,r.child=f,oa=r,ui=null)):a=null,a===null)throw Dn(r);return r.lanes=536870912,null}return ks(r,m)}var E=a.memoizedState;if(E!==null){var L=E.dehydrated;if(Vm(r),A)if(r.flags&256)r.flags&=-257,r=ua(a,r,f);else if(r.memoizedState!==null)r.child=a.child,r.flags|=128,r=null;else throw Error(n(558));else if(vi||jo(a,r,f,!1),A=(f&a.childLanes)!==0,vi||A){if(m=ei,m!==null&&(L=_a(m,f),L!==0&&L!==E.retryLane))throw E.retryLane=L,qo(a,L),u(m,a,L),Ud;gn(),r=ua(a,r,f)}else a=E.treeContext,ui=kr(L.nextSibling),oa=r,In=!0,oo=null,la=!1,a!==null&&xf(r,a),r=ks(r,m),r.flags|=4096;return r}return a=wr(a.child,{mode:m.mode,children:m.children}),a.ref=r.ref,r.child=a,a.return=r,a}function ur(a,r){var f=r.ref;if(f===null)a!==null&&a.ref!==null&&(r.flags|=4194816);else{if(typeof f!="function"&&typeof f!="object")throw Error(n(284));(a===null||a.ref!==f)&&(r.flags|=4194816)}}function eu(a,r,f,m,A){return Vl(r),f=Xm(a,r,f,m,void 0,A),m=Ym(),a!==null&&!vi?(Jm(a,r,A),fr(a,r,A)):(In&&m&&fd(r),r.flags|=1,Ni(a,r,f,A),r.child)}function Fa(a,r,f,m,A,E){return Vl(r),r.updateQueue=null,f=Y_(r,m,f,A),X_(a),m=Ym(),a!==null&&!vi?(Jm(a,r,E),fr(a,r,E)):(In&&m&&fd(r),r.flags|=1,Ni(a,r,f,E),r.child)}function Ea(a,r,f,m,A){if(Vl(r),r.stateNode===null){var E=Ko,L=f.contextType;typeof L=="object"&&L!==null&&(E=ca(L)),E=new f(m,E),r.memoizedState=E.state!==null&&E.state!==void 0?E.state:null,E.updater=Of,r.stateNode=E,E._reactInternals=r,E=r.stateNode,E.props=m,E.state=r.memoizedState,E.refs={},Fm(r),L=f.contextType,E.context=typeof L=="object"&&L!==null?ca(L):Ko,E.state=r.memoizedState,L=f.getDerivedStateFromProps,typeof L=="function"&&(Qc(r,f,L,m),E.state=r.memoizedState),typeof f.getDerivedStateFromProps=="function"||typeof E.getSnapshotBeforeUpdate=="function"||typeof E.UNSAFE_componentWillMount!="function"&&typeof E.componentWillMount!="function"||(L=E.state,typeof E.componentWillMount=="function"&&E.componentWillMount(),typeof E.UNSAFE_componentWillMount=="function"&&E.UNSAFE_componentWillMount(),L!==E.state&&Of.enqueueReplaceState(E,E.state,null),Jl(r,m,E,A),Cf(),E.state=r.memoizedState),typeof E.componentDidMount=="function"&&(r.flags|=4194308),m=!0}else if(a===null){E=r.stateNode;var Y=r.memoizedProps,re=ba(f,Y);E.props=re;var Re=E.context,Xe=f.contextType;L=Ko,typeof Xe=="object"&&Xe!==null&&(L=ca(Xe));var $e=f.getDerivedStateFromProps;Xe=typeof $e=="function"||typeof E.getSnapshotBeforeUpdate=="function",Y=r.pendingProps!==Y,Xe||typeof E.UNSAFE_componentWillReceiveProps!="function"&&typeof E.componentWillReceiveProps!="function"||(Y||Re!==L)&&fy(r,E,m,L),tl=!1;var De=r.memoizedState;E.state=De,Jl(r,m,E,A),Cf(),Re=r.memoizedState,Y||De!==Re||tl?(typeof $e=="function"&&(Qc(r,f,$e,m),Re=r.memoizedState),(re=tl||uy(r,f,re,m,De,Re,L))?(Xe||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"&&(r.flags|=4194308)):(typeof E.componentDidMount=="function"&&(r.flags|=4194308),r.memoizedProps=m,r.memoizedState=Re),E.props=m,E.state=Re,E.context=L,m=re):(typeof E.componentDidMount=="function"&&(r.flags|=4194308),m=!1)}else{E=r.stateNode,Hm(a,r),L=r.memoizedProps,Xe=ba(f,L),E.props=Xe,$e=r.pendingProps,De=E.context,Re=f.contextType,re=Ko,typeof Re=="object"&&Re!==null&&(re=ca(Re)),Y=f.getDerivedStateFromProps,(Re=typeof Y=="function"||typeof E.getSnapshotBeforeUpdate=="function")||typeof E.UNSAFE_componentWillReceiveProps!="function"&&typeof E.componentWillReceiveProps!="function"||(L!==$e||De!==re)&&fy(r,E,m,re),tl=!1,De=r.memoizedState,E.state=De,Jl(r,m,E,A),Cf();var Pe=r.memoizedState;L!==$e||De!==Pe||tl||a!==null&&a.dependencies!==null&&Yc(a.dependencies)?(typeof Y=="function"&&(Qc(r,f,Y,m),Pe=r.memoizedState),(Xe=tl||uy(r,f,Xe,m,De,Pe,re)||a!==null&&a.dependencies!==null&&Yc(a.dependencies))?(Re||typeof E.UNSAFE_componentWillUpdate!="function"&&typeof E.componentWillUpdate!="function"||(typeof E.componentWillUpdate=="function"&&E.componentWillUpdate(m,Pe,re),typeof E.UNSAFE_componentWillUpdate=="function"&&E.UNSAFE_componentWillUpdate(m,Pe,re)),typeof E.componentDidUpdate=="function"&&(r.flags|=4),typeof E.getSnapshotBeforeUpdate=="function"&&(r.flags|=1024)):(typeof E.componentDidUpdate!="function"||L===a.memoizedProps&&De===a.memoizedState||(r.flags|=4),typeof E.getSnapshotBeforeUpdate!="function"||L===a.memoizedProps&&De===a.memoizedState||(r.flags|=1024),r.memoizedProps=m,r.memoizedState=Pe),E.props=m,E.state=Pe,E.context=re,m=Xe):(typeof E.componentDidUpdate!="function"||L===a.memoizedProps&&De===a.memoizedState||(r.flags|=4),typeof E.getSnapshotBeforeUpdate!="function"||L===a.memoizedProps&&De===a.memoizedState||(r.flags|=1024),m=!1)}return E=m,ur(a,r),m=(r.flags&128)!==0,E||m?(E=r.stateNode,f=m&&typeof f.getDerivedStateFromError!="function"?null:E.render(),r.flags|=1,a!==null&&m?(r.child=Yl(r,a.child,null,A),r.child=Yl(r,null,f,A)):Ni(a,r,f,A),r.memoizedState=E.state,a=r.child):a=fr(a,r,A),a}function Yn(a,r,f,m){return zl(),r.flags|=256,Ni(a,r,f,m),r.child}var Rs={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function Xs(a){return{baseLanes:a,cachePool:md()}}function Pf(a,r,f){return a=a!==null?a.childLanes&~f:0,r&&(a|=zn),a}function ws(a,r,f){var m=r.pendingProps,A=!1,E=(r.flags&128)!==0,L;if((L=E)||(L=a!==null&&a.memoizedState===null?!1:(Bi.current&2)!==0),L&&(A=!0,r.flags&=-129),L=(r.flags&32)!==0,r.flags&=-33,a===null){if(In){if(A?il(r):po(),(a=ui)?(a=HC(a,la),a=a!==null&&a.data!=="&"?a:null,a!==null&&(r.memoizedState={dehydrated:a,treeContext:Br!==null?{id:Dr,overflow:Nr}:null,retryLane:536870912,hydrationErrors:null},f=I_(a),f.return=r,r.child=f,oa=r,ui=null)):a=null,a===null)throw Dn(r);return fM(a)?r.lanes=32:r.lanes=536870912,null}var Y=m.children;return m=m.fallback,A?(po(),A=r.mode,Y=tu({mode:"hidden",children:Y},A),m=so(m,A,f,null),Y.return=r,m.return=r,Y.sibling=m,r.child=Y,m=r.child,m.memoizedState=Xs(f),m.childLanes=Pf(a,L,f),r.memoizedState=Rs,cr(null,m)):(il(r),al(r,Y))}var re=a.memoizedState;if(re!==null&&(Y=re.dehydrated,Y!==null)){if(E)r.flags&256?(il(r),r.flags&=-257,r=nu(a,r,f)):r.memoizedState!==null?(po(),r.child=a.child,r.flags|=128,r=null):(po(),Y=m.fallback,A=r.mode,m=tu({mode:"visible",children:m.children},A),Y=so(Y,A,f,null),Y.flags|=2,m.return=r,Y.return=r,m.sibling=Y,r.child=m,Yl(r,a.child,null,f),m=r.child,m.memoizedState=Xs(f),m.childLanes=Pf(a,L,f),r.memoizedState=Rs,r=cr(null,m));else if(il(r),fM(Y)){if(L=Y.nextSibling&&Y.nextSibling.dataset,L)var Re=L.dgst;L=Re,m=Error(n(419)),m.stack="",m.digest=L,Af({value:m,source:null,stack:null}),r=nu(a,r,f)}else if(vi||jo(a,r,f,!1),L=(f&a.childLanes)!==0,vi||L){if(L=ei,L!==null&&(m=_a(L,f),m!==0&&m!==re.retryLane))throw re.retryLane=m,qo(a,m),u(L,a,m),Ud;uM(Y)||gn(),r=nu(a,r,f)}else uM(Y)?(r.flags|=192,r.child=a.child,r=null):(a=re.treeContext,ui=kr(Y.nextSibling),oa=r,In=!0,oo=null,la=!1,a!==null&&xf(r,a),r=al(r,m.children),r.flags|=4096);return r}return A?(po(),Y=m.fallback,A=r.mode,re=a.child,Re=re.sibling,m=wr(re,{mode:"hidden",children:m.children}),m.subtreeFlags=re.subtreeFlags&65011712,Re!==null?Y=wr(Re,Y):(Y=so(Y,A,f,null),Y.flags|=2),Y.return=r,m.return=r,m.sibling=Y,r.child=m,cr(null,m),m=r.child,Y=a.child.memoizedState,Y===null?Y=Xs(f):(A=Y.cachePool,A!==null?(re=Qt._currentValue,A=A.parent!==re?{parent:re,pool:re}:A):A=md(),Y={baseLanes:Y.baseLanes|f,cachePool:A}),m.memoizedState=Y,m.childLanes=Pf(a,L,f),r.memoizedState=Rs,cr(a.child,m)):(il(r),f=a.child,a=f.sibling,f=wr(f,{mode:"visible",children:m.children}),f.return=r,f.sibling=null,a!==null&&(L=r.deletions,L===null?(r.deletions=[a],r.flags|=16):L.push(a)),r.child=f,r.memoizedState=null,f)}function al(a,r){return r=tu({mode:"visible",children:r},a.mode),r.return=a,a.child=r}function tu(a,r){return a=ka(22,a,null,r),a.lanes=0,a}function nu(a,r,f){return Yl(r,a.child,null,f),a=al(r,r.pendingProps.children),a.flags|=2,r.memoizedState=null,a}function Wl(a,r,f){a.lanes|=r;var m=a.alternate;m!==null&&(m.lanes|=r),uo(a.return,r,f)}function Gf(a,r,f,m,A,E){var L=a.memoizedState;L===null?a.memoizedState={isBackwards:r,rendering:null,renderingStartTime:0,last:m,tail:f,tailMode:A,treeForkCount:E}:(L.isBackwards=r,L.rendering=null,L.renderingStartTime=0,L.last=m,L.tail=f,L.tailMode=A,L.treeForkCount=E)}function zf(a,r,f){var m=r.pendingProps,A=m.revealOrder,E=m.tail;m=m.children;var L=Bi.current,Y=(L&2)!==0;if(Y?(L=L&1|2,r.flags|=128):L&=1,le(Bi,L),Ni(a,r,m,f),m=In?Xc:0,!Y&&a!==null&&(a.flags&128)!==0)e:for(a=r.child;a!==null;){if(a.tag===13)a.memoizedState!==null&&Wl(a,f,r);else if(a.tag===19)Wl(a,f,r);else if(a.child!==null){a.child.return=a,a=a.child;continue}if(a===r)break e;for(;a.sibling===null;){if(a.return===null||a.return===r)break e;a=a.return}a.sibling.return=a.return,a=a.sibling}switch(A){case"forwards":for(f=r.child,A=null;f!==null;)a=f.alternate,a!==null&&yd(a)===null&&(A=f),f=f.sibling;f=A,f===null?(A=r.child,r.child=null):(A=f.sibling,f.sibling=null),Gf(r,!1,A,f,E,m);break;case"backwards":case"unstable_legacy-backwards":for(f=null,A=r.child,r.child=null;A!==null;){if(a=A.alternate,a!==null&&yd(a)===null){r.child=A;break}a=A.sibling,A.sibling=f,f=A,A=a}Gf(r,!0,f,null,E,m);break;case"together":Gf(r,!1,null,null,void 0,m);break;default:r.memoizedState=null}return r.child}function fr(a,r,f){if(a!==null&&(r.dependencies=a.dependencies),Ns|=r.lanes,(f&r.childLanes)===0)if(a!==null){if(jo(a,r,f,!1),(f&r.childLanes)===0)return null}else return null;if(a!==null&&r.child!==a.child)throw Error(n(153));if(r.child!==null){for(a=r.child,f=wr(a,a.pendingProps),r.child=f,f.return=r;a.sibling!==null;)a=a.sibling,f=f.sibling=wr(a,a.pendingProps),f.return=r;f.sibling=null}return r.child}function sl(a,r){return(a.lanes&r)!==0?!0:(a=a.dependencies,!!(a!==null&&Yc(a)))}function Vf(a,r,f){switch(r.tag){case 3:lt(r,r.stateNode.containerInfo),co(r,Qt,a.memoizedState.cache),zl();break;case 27:case 5:Bt(r);break;case 4:lt(r,r.stateNode.containerInfo);break;case 10:co(r,r.type,r.memoizedProps.value);break;case 31:if(r.memoizedState!==null)return r.flags|=128,Vm(r),null;break;case 13:var m=r.memoizedState;if(m!==null)return m.dehydrated!==null?(il(r),r.flags|=128,null):(f&r.child.childLanes)!==0?ws(a,r,f):(il(r),a=fr(a,r,f),a!==null?a.sibling:null);il(r);break;case 19:var A=(a.flags&128)!==0;if(m=(f&r.childLanes)!==0,m||(jo(a,r,f,!1),m=(f&r.childLanes)!==0),A){if(m)return zf(a,r,f);r.flags|=128}if(A=r.memoizedState,A!==null&&(A.rendering=null,A.tail=null,A.lastEffect=null),le(Bi,Bi.current),m)break;return null;case 22:return r.lanes=0,Cs(a,r,f,r.pendingProps);case 24:co(r,Qt,a.memoizedState.cache)}return fr(a,r,f)}function Ld(a,r,f){if(a!==null)if(a.memoizedProps!==r.pendingProps)vi=!0;else{if(!sl(a,f)&&(r.flags&128)===0)return vi=!1,Vf(a,r,f);vi=(a.flags&131072)!==0}else vi=!1,In&&(r.flags&1048576)!==0&&Tm(r,Xc,r.index);switch(r.lanes=0,r.tag){case 16:e:{var m=r.pendingProps;if(a=Xl(r.elementType),r.type=a,typeof a=="function")Xa(a)?(m=ba(a,m),r.tag=1,r=Ea(null,r,a,m,f)):(r.tag=0,r=eu(null,r,a,m,f));else{if(a!=null){var A=a.$$typeof;if(A===N){r.tag=11,r=If(null,r,a,m,f);break e}else if(A===z){r.tag=14,r=Ff(null,r,a,m,f);break e}}throw r=ae(a)||a,Error(n(306,r,""))}}return r;case 0:return eu(a,r,r.type,r.pendingProps,f);case 1:return m=r.type,A=ba(m,r.pendingProps),Ea(a,r,m,A,f);case 3:e:{if(lt(r,r.stateNode.containerInfo),a===null)throw Error(n(387));m=r.pendingProps;var E=r.memoizedState;A=E.element,Hm(a,r),Jl(r,m,null,f);var L=r.memoizedState;if(m=L.cache,co(r,Qt,m),m!==E.cache&&pd(r,[Qt],f,!0),Cf(),m=L.element,E.isDehydrated)if(E={element:m,isDehydrated:!1,cache:L.cache},r.updateQueue.baseState=E,r.memoizedState=E,r.flags&256){r=Yn(a,r,m,f);break e}else if(m!==A){A=ts(Error(n(424)),r),Af(A),r=Yn(a,r,m,f);break e}else for(a=r.stateNode.containerInfo,a.nodeType===9?a=a.body:a=a.nodeName==="HTML"?a.ownerDocument.body:a,ui=kr(a.firstChild),oa=r,In=!0,oo=null,la=!0,f=V_(r,null,m,f),r.child=f;f;)f.flags=f.flags&-3|4096,f=f.sibling;else{if(zl(),m===A){r=fr(a,r,f);break e}Ni(a,r,m,f)}r=r.child}return r;case 26:return ur(a,r),a===null?(f=XC(r.type,null,r.pendingProps,null))?r.memoizedState=f:In||(f=r.type,a=r.pendingProps,m=Ay(he.current).createElement(f),m[mn]=r,m[G]=a,Wa(m,f,a),k(m),r.stateNode=m):r.memoizedState=XC(r.type,a.memoizedProps,r.pendingProps,a.memoizedState),null;case 27:return Bt(r),a===null&&In&&(m=r.stateNode=zC(r.type,r.pendingProps,he.current),oa=r,la=!0,A=ui,cu(r.type)?(hM=A,ui=kr(m.firstChild)):ui=A),Ni(a,r,r.pendingProps.children,f),ur(a,r),a===null&&(r.flags|=4194304),r.child;case 5:return a===null&&In&&((A=m=ui)&&(m=p4(m,r.type,r.pendingProps,la),m!==null?(r.stateNode=m,oa=r,ui=kr(m.firstChild),la=!1,A=!0):A=!1),A||Dn(r)),Bt(r),A=r.type,E=r.pendingProps,L=a!==null?a.memoizedProps:null,m=E.children,oM(A,E)?m=null:L!==null&&oM(A,L)&&(r.flags|=32),r.memoizedState!==null&&(A=Xm(a,r,kS,null,null,f),Mg._currentValue=A),ur(a,r),Ni(a,r,m,f),r.child;case 6:return a===null&&In&&((a=f=ui)&&(f=m4(f,r.pendingProps,la),f!==null?(r.stateNode=f,oa=r,ui=null,a=!0):a=!1),a||Dn(r)),null;case 13:return ws(a,r,f);case 4:return lt(r,r.stateNode.containerInfo),m=r.pendingProps,a===null?r.child=Yl(r,null,m,f):Ni(a,r,m,f),r.child;case 11:return If(a,r,r.type,r.pendingProps,f);case 7:return Ni(a,r,r.pendingProps,f),r.child;case 8:return Ni(a,r,r.pendingProps.children,f),r.child;case 12:return Ni(a,r,r.pendingProps.children,f),r.child;case 10:return m=r.pendingProps,co(r,r.type,m.value),Ni(a,r,m.children,f),r.child;case 9:return A=r.type._context,m=r.pendingProps.children,Vl(r),A=ca(A),m=m(A),r.flags|=1,Ni(a,r,m,f),r.child;case 14:return Ff(a,r,r.type,r.pendingProps,f);case 15:return Ts(a,r,r.type,r.pendingProps,f);case 19:return zf(a,r,f);case 31:return Hf(a,r,f);case 22:return Cs(a,r,f,r.pendingProps);case 24:return Vl(r),m=ca(Qt),a===null?(A=Ur(),A===null&&(A=ei,E=Dm(),A.pooledCache=E,E.refCount++,E!==null&&(A.pooledCacheLanes|=f),A=E),r.memoizedState={parent:m,cache:A},Fm(r),co(r,Qt,A)):((a.lanes&f)!==0&&(Hm(a,r),Jl(r,null,null,f),Cf()),A=a.memoizedState,E=r.memoizedState,A.parent!==m?(A={parent:m,cache:m},r.memoizedState=A,r.lanes===0&&(r.memoizedState=r.updateQueue.baseState=A),co(r,Qt,m)):(m=E.cache,co(r,Qt,m),m!==A.cache&&pd(r,[Qt],f,!0))),Ni(a,r,r.pendingProps.children,f),r.child;case 29:throw r.pendingProps}throw Error(n(156,r.tag))}function rs(a){a.flags|=4}function rl(a,r,f,m,A){if((r=(a.mode&32)!==0)&&(r=!1),r){if(a.flags|=16777216,(A&335544128)===A)if(a.stateNode.complete)a.flags|=8192;else if(St())a.flags|=8192;else throw ln=bf,Mf}else a.flags&=-16777217}function vo(a,r){if(r.type!=="stylesheet"||(r.state.loading&4)!==0)a.flags&=-16777217;else if(a.flags|=16777216,!WC(r))if(St())a.flags|=8192;else throw ln=bf,Mf}function iu(a,r){r!==null&&(a.flags|=4),a.flags&16384&&(r=a.tag!==22?wn():536870912,a.lanes|=r,Us|=r)}function kf(a,r){if(!In)switch(a.tailMode){case"hidden":r=a.tail;for(var f=null;r!==null;)r.alternate!==null&&(f=r),r=r.sibling;f===null?a.tail=null:f.sibling=null;break;case"collapsed":f=a.tail;for(var m=null;f!==null;)f.alternate!==null&&(m=f),f=f.sibling;m===null?r||a.tail===null?a.tail=null:a.tail.sibling=null:m.sibling=null}}function ai(a){var r=a.alternate!==null&&a.alternate.child===a.child,f=0,m=0;if(r)for(var A=a.child;A!==null;)f|=A.lanes|A.childLanes,m|=A.subtreeFlags&65011712,m|=A.flags&65011712,A.return=a,A=A.sibling;else for(A=a.child;A!==null;)f|=A.lanes|A.childLanes,m|=A.subtreeFlags,m|=A.flags,A.return=a,A=A.sibling;return a.subtreeFlags|=m,a.childLanes=f,r}function pg(a,r,f){var m=r.pendingProps;switch(Wo(r),r.tag){case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return ai(r),null;case 1:return ai(r),null;case 3:return f=r.stateNode,m=null,a!==null&&(m=a.memoizedState.cache),r.memoizedState.cache!==m&&(r.flags|=2048),zs(Qt),Rt(),f.pendingContext&&(f.context=f.pendingContext,f.pendingContext=null),(a===null||a.child===null)&&(Gl(r)?rs(r):a===null||a.memoizedState.isDehydrated&&(r.flags&256)===0||(r.flags|=1024,Cm())),ai(r),null;case 26:var A=r.type,E=r.memoizedState;return a===null?(rs(r),E!==null?(ai(r),vo(r,E)):(ai(r),rl(r,A,null,m,f))):E?E!==a.memoizedState?(rs(r),ai(r),vo(r,E)):(ai(r),r.flags&=-16777217):(a=a.memoizedProps,a!==m&&rs(r),ai(r),rl(r,A,a,m,f)),null;case 27:if(tn(r),f=he.current,A=r.type,a!==null&&r.stateNode!=null)a.memoizedProps!==m&&rs(r);else{if(!m){if(r.stateNode===null)throw Error(n(166));return ai(r),null}a=ve.current,Gl(r)?dd(r):(a=zC(A,m,f),r.stateNode=a,rs(r))}return ai(r),null;case 5:if(tn(r),A=r.type,a!==null&&r.stateNode!=null)a.memoizedProps!==m&&rs(r);else{if(!m){if(r.stateNode===null)throw Error(n(166));return ai(r),null}if(E=ve.current,Gl(r))dd(r);else{var L=Ay(he.current);switch(E){case 1:E=L.createElementNS("http://www.w3.org/2000/svg",A);break;case 2:E=L.createElementNS("http://www.w3.org/1998/Math/MathML",A);break;default:switch(A){case"svg":E=L.createElementNS("http://www.w3.org/2000/svg",A);break;case"math":E=L.createElementNS("http://www.w3.org/1998/Math/MathML",A);break;case"script":E=L.createElement("div"),E.innerHTML="<script><\/script>",E=E.removeChild(E.firstChild);break;case"select":E=typeof m.is=="string"?L.createElement("select",{is:m.is}):L.createElement("select"),m.multiple?E.multiple=!0:m.size&&(E.size=m.size);break;default:E=typeof m.is=="string"?L.createElement(A,{is:m.is}):L.createElement(A)}}E[mn]=r,E[G]=m;e:for(L=r.child;L!==null;){if(L.tag===5||L.tag===6)E.appendChild(L.stateNode);else if(L.tag!==4&&L.tag!==27&&L.child!==null){L.child.return=L,L=L.child;continue}if(L===r)break e;for(;L.sibling===null;){if(L.return===null||L.return===r)break e;L=L.return}L.sibling.return=L.return,L=L.sibling}r.stateNode=E;e:switch(Wa(E,A,m),A){case"button":case"input":case"select":case"textarea":m=!!m.autoFocus;break e;case"img":m=!0;break e;default:m=!1}m&&rs(r)}}return ai(r),rl(r,r.type,a===null?null:a.memoizedProps,r.pendingProps,f),null;case 6:if(a&&r.stateNode!=null)a.memoizedProps!==m&&rs(r);else{if(typeof m!="string"&&r.stateNode===null)throw Error(n(166));if(a=he.current,Gl(r)){if(a=r.stateNode,f=r.memoizedProps,m=null,A=oa,A!==null)switch(A.tag){case 27:case 5:m=A.memoizedProps}a[mn]=r,a=!!(a.nodeValue===f||m!==null&&m.suppressHydrationWarning===!0||BC(a.nodeValue,f)),a||Dn(r,!0)}else a=Ay(a).createTextNode(m),a[mn]=r,r.stateNode=a}return ai(r),null;case 31:if(f=r.memoizedState,a===null||a.memoizedState!==null){if(m=Gl(r),f!==null){if(a===null){if(!m)throw Error(n(318));if(a=r.memoizedState,a=a!==null?a.dehydrated:null,!a)throw Error(n(557));a[mn]=r}else zl(),(r.flags&128)===0&&(r.memoizedState=null),r.flags|=4;ai(r),a=!1}else f=Cm(),a!==null&&a.memoizedState!==null&&(a.memoizedState.hydrationErrors=f),a=!0;if(!a)return r.flags&256?(Ms(r),r):(Ms(r),null);if((r.flags&128)!==0)throw Error(n(558))}return ai(r),null;case 13:if(m=r.memoizedState,a===null||a.memoizedState!==null&&a.memoizedState.dehydrated!==null){if(A=Gl(r),m!==null&&m.dehydrated!==null){if(a===null){if(!A)throw Error(n(318));if(A=r.memoizedState,A=A!==null?A.dehydrated:null,!A)throw Error(n(317));A[mn]=r}else zl(),(r.flags&128)===0&&(r.memoizedState=null),r.flags|=4;ai(r),A=!1}else A=Cm(),a!==null&&a.memoizedState!==null&&(a.memoizedState.hydrationErrors=A),A=!0;if(!A)return r.flags&256?(Ms(r),r):(Ms(r),null)}return Ms(r),(r.flags&128)!==0?(r.lanes=f,r):(f=m!==null,a=a!==null&&a.memoizedState!==null,f&&(m=r.child,A=null,m.alternate!==null&&m.alternate.memoizedState!==null&&m.alternate.memoizedState.cachePool!==null&&(A=m.alternate.memoizedState.cachePool.pool),E=null,m.memoizedState!==null&&m.memoizedState.cachePool!==null&&(E=m.memoizedState.cachePool.pool),E!==A&&(m.flags|=2048)),f!==a&&f&&(r.child.flags|=8192),iu(r,r.updateQueue),ai(r),null);case 4:return Rt(),a===null&&nM(r.stateNode.containerInfo),ai(r),null;case 10:return zs(r.type),ai(r),null;case 19:if(te(Bi),m=r.memoizedState,m===null)return ai(r),null;if(A=(r.flags&128)!==0,E=m.rendering,E===null)if(A)kf(m,!1);else{if(ti!==0||a!==null&&(a.flags&128)!==0)for(a=r.child;a!==null;){if(E=yd(a),E!==null){for(r.flags|=128,kf(m,!1),a=E.updateQueue,r.updateQueue=a,iu(r,a),r.subtreeFlags=0,a=f,f=r.child;f!==null;)La(f,a),f=f.sibling;return le(Bi,Bi.current&1|2),In&&ro(r,m.treeForkCount),r.child}a=a.sibling}m.tail!==null&&P()>Ls&&(r.flags|=128,A=!0,kf(m,!1),r.lanes=4194304)}else{if(!A)if(a=yd(E),a!==null){if(r.flags|=128,A=!0,a=a.updateQueue,r.updateQueue=a,iu(r,a),kf(m,!0),m.tail===null&&m.tailMode==="hidden"&&!E.alternate&&!In)return ai(r),null}else 2*P()-m.renderingStartTime>Ls&&f!==536870912&&(r.flags|=128,A=!0,kf(m,!1),r.lanes=4194304);m.isBackwards?(E.sibling=r.child,r.child=E):(a=m.last,a!==null?a.sibling=E:r.child=E,m.last=E)}return m.tail!==null?(a=m.tail,m.rendering=a,m.tail=a.sibling,m.renderingStartTime=P(),a.sibling=null,f=Bi.current,le(Bi,A?f&1|2:f&1),In&&ro(r,m.treeForkCount),a):(ai(r),null);case 22:case 23:return Ms(r),Ia(),m=r.memoizedState!==null,a!==null?a.memoizedState!==null!==m&&(r.flags|=8192):m&&(r.flags|=8192),m?(f&536870912)!==0&&(r.flags&128)===0&&(ai(r),r.subtreeFlags&6&&(r.flags|=8192)):ai(r),f=r.updateQueue,f!==null&&iu(r,f.retryQueue),f=null,a!==null&&a.memoizedState!==null&&a.memoizedState.cachePool!==null&&(f=a.memoizedState.cachePool.pool),m=null,r.memoizedState!==null&&r.memoizedState.cachePool!==null&&(m=r.memoizedState.cachePool.pool),m!==f&&(r.flags|=2048),a!==null&&te(Zo),null;case 24:return f=null,a!==null&&(f=a.memoizedState.cache),r.memoizedState.cache!==f&&(r.flags|=2048),zs(Qt),ai(r),null;case 25:return null;case 30:return null}throw Error(n(156,r.tag))}function Od(a,r){switch(Wo(r),r.tag){case 1:return a=r.flags,a&65536?(r.flags=a&-65537|128,r):null;case 3:return zs(Qt),Rt(),a=r.flags,(a&65536)!==0&&(a&128)===0?(r.flags=a&-65537|128,r):null;case 26:case 27:case 5:return tn(r),null;case 31:if(r.memoizedState!==null){if(Ms(r),r.alternate===null)throw Error(n(340));zl()}return a=r.flags,a&65536?(r.flags=a&-65537|128,r):null;case 13:if(Ms(r),a=r.memoizedState,a!==null&&a.dehydrated!==null){if(r.alternate===null)throw Error(n(340));zl()}return a=r.flags,a&65536?(r.flags=a&-65537|128,r):null;case 19:return te(Bi),null;case 4:return Rt(),null;case 10:return zs(r.type),null;case 22:case 23:return Ms(r),Ia(),a!==null&&te(Zo),a=r.flags,a&65536?(r.flags=a&-65537|128,r):null;case 24:return zs(Qt),null;case 25:return null;default:return null}}function jl(a,r){switch(Wo(r),r.tag){case 3:zs(Qt),Rt();break;case 26:case 27:case 5:tn(r);break;case 4:Rt();break;case 31:r.memoizedState!==null&&Ms(r);break;case 13:Ms(r);break;case 19:te(Bi);break;case 10:zs(r.type);break;case 22:case 23:Ms(r),Ia(),a!==null&&te(Zo);break;case 24:zs(Qt)}}function Pr(a,r){try{var f=r.updateQueue,m=f!==null?f.lastEffect:null;if(m!==null){var A=m.next;f=A;do{if((f.tag&a)===a){m=void 0;var E=f.create,L=f.inst;m=E(),L.destroy=m}f=f.next}while(f!==A)}}catch(Y){ci(r,r.return,Y)}}function Ys(a,r,f){try{var m=r.updateQueue,A=m!==null?m.lastEffect:null;if(A!==null){var E=A.next;m=E;do{if((m.tag&a)===a){var L=m.inst,Y=L.destroy;if(Y!==void 0){L.destroy=void 0,A=r;var re=f,Re=Y;try{Re()}catch(Xe){ci(A,re,Xe)}}}m=m.next}while(m!==E)}}catch(Xe){ci(r,r.return,Xe)}}function ol(a){var r=a.updateQueue;if(r!==null){var f=a.stateNode;try{Sa(r,f)}catch(m){ci(a,a.return,m)}}}function mg(a,r,f){f.props=ba(a.type,a.memoizedProps),f.state=a.memoizedState;try{f.componentWillUnmount()}catch(m){ci(a,r,m)}}function Gr(a,r){try{var f=a.ref;if(f!==null){switch(a.tag){case 26:case 27:case 5:var m=a.stateNode;break;case 30:m=a.stateNode;break;default:m=a.stateNode}typeof f=="function"?a.refCleanup=f(m):f.current=m}}catch(A){ci(a,r,A)}}function Bs(a,r){var f=a.ref,m=a.refCleanup;if(f!==null)if(typeof m=="function")try{m()}catch(A){ci(a,r,A)}finally{a.refCleanup=null,a=a.alternate,a!=null&&(a.refCleanup=null)}else if(typeof f=="function")try{f(null)}catch(A){ci(a,r,A)}else f.current=null}function Ds(a){var r=a.type,f=a.memoizedProps,m=a.stateNode;try{e:switch(r){case"button":case"input":case"select":case"textarea":f.autoFocus&&m.focus();break e;case"img":f.src?m.src=f.src:f.srcSet&&(m.srcset=f.srcSet)}}catch(A){ci(a,a.return,A)}}function Js(a,r,f){try{var m=a.stateNode;l4(m,a.type,f,r),m[G]=r}catch(A){ci(a,a.return,A)}}function Wi(a){return a.tag===5||a.tag===3||a.tag===26||a.tag===27&&cu(a.type)||a.tag===4}function zr(a){e:for(;;){for(;a.sibling===null;){if(a.return===null||Wi(a.return))return null;a=a.return}for(a.sibling.return=a.return,a=a.sibling;a.tag!==5&&a.tag!==6&&a.tag!==18;){if(a.tag===27&&cu(a.type)||a.flags&2||a.child===null||a.tag===4)continue e;a.child.return=a,a=a.child}if(!(a.flags&2))return a.stateNode}}function xn(a,r,f){var m=a.tag;if(m===5||m===6)a=a.stateNode,r?(f.nodeType===9?f.body:f.nodeName==="HTML"?f.ownerDocument.body:f).insertBefore(a,r):(r=f.nodeType===9?f.body:f.nodeName==="HTML"?f.ownerDocument.body:f,r.appendChild(a),f=f._reactRootContainer,f!=null||r.onclick!==null||(r.onclick=Tr));else if(m!==4&&(m===27&&cu(a.type)&&(f=a.stateNode,r=null),a=a.child,a!==null))for(xn(a,r,f),a=a.sibling;a!==null;)xn(a,r,f),a=a.sibling}function Zn(a,r,f){var m=a.tag;if(m===5||m===6)a=a.stateNode,r?f.insertBefore(a,r):f.appendChild(a);else if(m!==4&&(m===27&&cu(a.type)&&(f=a.stateNode),a=a.child,a!==null))for(Zn(a,r,f),a=a.sibling;a!==null;)Zn(a,r,f),a=a.sibling}function Pi(a){var r=a.stateNode,f=a.memoizedProps;try{for(var m=a.type,A=r.attributes;A.length;)r.removeAttributeNode(A[0]);Wa(r,m,f),r[mn]=a,r[G]=f}catch(E){ci(a,a.return,E)}}var qs=!1,_i=!1,_o=!1,Xf=typeof WeakSet=="function"?WeakSet:Set,Ui=null;function au(a,r){if(a=a.containerInfo,sM=Ry,a=id(a),Fc(a)){if("selectionStart"in a)var f={start:a.selectionStart,end:a.selectionEnd};else e:{f=(f=a.ownerDocument)&&f.defaultView||window;var m=f.getSelection&&f.getSelection();if(m&&m.rangeCount!==0){f=m.anchorNode;var A=m.anchorOffset,E=m.focusNode;m=m.focusOffset;try{f.nodeType,E.nodeType}catch{f=null;break e}var L=0,Y=-1,re=-1,Re=0,Xe=0,$e=a,De=null;t:for(;;){for(var Pe;$e!==f||A!==0&&$e.nodeType!==3||(Y=L+A),$e!==E||m!==0&&$e.nodeType!==3||(re=L+m),$e.nodeType===3&&(L+=$e.nodeValue.length),(Pe=$e.firstChild)!==null;)De=$e,$e=Pe;for(;;){if($e===a)break t;if(De===f&&++Re===A&&(Y=L),De===E&&++Xe===m&&(re=L),(Pe=$e.nextSibling)!==null)break;$e=De,De=$e.parentNode}$e=Pe}f=Y===-1||re===-1?null:{start:Y,end:re}}else f=null}f=f||{start:0,end:0}}else f=null;for(rM={focusedElem:a,selectionRange:f},Ry=!1,Ui=r;Ui!==null;)if(r=Ui,a=r.child,(r.subtreeFlags&1028)!==0&&a!==null)a.return=r,Ui=a;else for(;Ui!==null;){switch(r=Ui,E=r.alternate,a=r.flags,r.tag){case 0:if((a&4)!==0&&(a=r.updateQueue,a=a!==null?a.events:null,a!==null))for(f=0;f<a.length;f++)A=a[f],A.ref.impl=A.nextImpl;break;case 11:case 15:break;case 1:if((a&1024)!==0&&E!==null){a=void 0,f=r,A=E.memoizedProps,E=E.memoizedState,m=f.stateNode;try{var qt=ba(f.type,A);a=m.getSnapshotBeforeUpdate(qt,E),m.__reactInternalSnapshotBeforeUpdate=a}catch(cn){ci(f,f.return,cn)}}break;case 3:if((a&1024)!==0){if(a=r.stateNode.containerInfo,f=a.nodeType,f===9)cM(a);else if(f===1)switch(a.nodeName){case"HEAD":case"HTML":case"BODY":cM(a);break;default:a.textContent=""}}break;case 5:case 26:case 27:case 6:case 4:case 17:break;default:if((a&1024)!==0)throw Error(n(163))}if(a=r.sibling,a!==null){a.return=r.return,Ui=a;break}Ui=r.return}}function py(a,r,f){var m=f.flags;switch(f.tag){case 0:case 11:case 15:yo(a,f),m&4&&Pr(5,f);break;case 1:if(yo(a,f),m&4)if(a=f.stateNode,r===null)try{a.componentDidMount()}catch(L){ci(f,f.return,L)}else{var A=ba(f.type,r.memoizedProps);r=r.memoizedState;try{a.componentDidUpdate(A,r,a.__reactInternalSnapshotBeforeUpdate)}catch(L){ci(f,f.return,L)}}m&64&&ol(f),m&512&&Gr(f,f.return);break;case 3:if(yo(a,f),m&64&&(a=f.updateQueue,a!==null)){if(r=null,f.child!==null)switch(f.child.tag){case 27:case 5:r=f.child.stateNode;break;case 1:r=f.child.stateNode}try{Sa(a,r)}catch(L){ci(f,f.return,L)}}break;case 27:r===null&&m&4&&Pi(f);case 26:case 5:yo(a,f),r===null&&m&4&&Ds(f),m&512&&Gr(f,f.return);break;case 12:yo(a,f);break;case 31:yo(a,f),m&4&&Fd(a,f);break;case 13:yo(a,f),m&4&&gg(a,f),m&64&&(a=f.memoizedState,a!==null&&(a=a.dehydrated,a!==null&&(f=jF.bind(null,f),g4(a,f))));break;case 22:if(m=f.memoizedState!==null||qs,!m){r=r!==null&&r.memoizedState!==null||_i,A=qs;var E=_i;qs=m,(_i=r)&&!E?$n(a,f,(f.subtreeFlags&8772)!==0):yo(a,f),qs=A,_i=E}break;case 30:break;default:yo(a,f)}}function Id(a){var r=a.alternate;r!==null&&(a.alternate=null,Id(r)),a.child=null,a.deletions=null,a.sibling=null,a.tag===5&&(r=a.stateNode,r!==null&&at(r)),a.stateNode=null,a.return=null,a.dependencies=null,a.memoizedProps=null,a.memoizedState=null,a.pendingProps=null,a.stateNode=null,a.updateQueue=null}var Jn=null,ji=!1;function Ha(a,r,f){for(f=f.child;f!==null;)ll(a,r,f),f=f.sibling}function ll(a,r,f){if(qe&&typeof qe.onCommitFiberUnmount=="function")try{qe.onCommitFiberUnmount(Ye,f)}catch{}switch(f.tag){case 26:_i||Bs(f,r),Ha(a,r,f),f.memoizedState?f.memoizedState.count--:f.stateNode&&(f=f.stateNode,f.parentNode.removeChild(f));break;case 27:_i||Bs(f,r);var m=Jn,A=ji;cu(f.type)&&(Jn=f.stateNode,ji=!1),Ha(a,r,f),xg(f.stateNode),Jn=m,ji=A;break;case 5:_i||Bs(f,r);case 6:if(m=Jn,A=ji,Jn=null,Ha(a,r,f),Jn=m,ji=A,Jn!==null)if(ji)try{(Jn.nodeType===9?Jn.body:Jn.nodeName==="HTML"?Jn.ownerDocument.body:Jn).removeChild(f.stateNode)}catch(E){ci(f,r,E)}else try{Jn.removeChild(f.stateNode)}catch(E){ci(f,r,E)}break;case 18:Jn!==null&&(ji?(a=Jn,IC(a.nodeType===9?a.body:a.nodeName==="HTML"?a.ownerDocument.body:a,f.stateNode),Kd(a)):IC(Jn,f.stateNode));break;case 4:m=Jn,A=ji,Jn=f.stateNode.containerInfo,ji=!0,Ha(a,r,f),Jn=m,ji=A;break;case 0:case 11:case 14:case 15:Ys(2,f,r),_i||Ys(4,f,r),Ha(a,r,f);break;case 1:_i||(Bs(f,r),m=f.stateNode,typeof m.componentWillUnmount=="function"&&mg(f,r,m)),Ha(a,r,f);break;case 21:Ha(a,r,f);break;case 22:_i=(m=_i)||f.memoizedState!==null,Ha(a,r,f),_i=m;break;default:Ha(a,r,f)}}function Fd(a,r){if(r.memoizedState===null&&(a=r.alternate,a!==null&&(a=a.memoizedState,a!==null))){a=a.dehydrated;try{Kd(a)}catch(f){ci(r,r.return,f)}}}function gg(a,r){if(r.memoizedState===null&&(a=r.alternate,a!==null&&(a=a.memoizedState,a!==null&&(a=a.dehydrated,a!==null))))try{Kd(a)}catch(f){ci(r,r.return,f)}}function my(a){switch(a.tag){case 31:case 13:case 19:var r=a.stateNode;return r===null&&(r=a.stateNode=new Xf),r;case 22:return a=a.stateNode,r=a._retryCache,r===null&&(r=a._retryCache=new Xf),r;default:throw Error(n(435,a.tag))}}function Gi(a,r){var f=my(a);r.forEach(function(m){if(!f.has(m)){f.add(m);var A=ZF.bind(null,a,m);m.then(A,A)}})}function Pa(a,r){var f=r.deletions;if(f!==null)for(var m=0;m<f.length;m++){var A=f[m],E=a,L=r,Y=L;e:for(;Y!==null;){switch(Y.tag){case 27:if(cu(Y.type)){Jn=Y.stateNode,ji=!1;break e}break;case 5:Jn=Y.stateNode,ji=!1;break e;case 3:case 4:Jn=Y.stateNode.containerInfo,ji=!0;break e}Y=Y.return}if(Jn===null)throw Error(n(160));ll(E,L,A),Jn=null,ji=!1,E=A.alternate,E!==null&&(E.return=null),A.return=null}if(r.subtreeFlags&13886)for(r=r.child;r!==null;)cl(r,a),r=r.sibling}var os=null;function cl(a,r){var f=a.alternate,m=a.flags;switch(a.tag){case 0:case 11:case 14:case 15:Pa(r,a),Li(a),m&4&&(Ys(3,a,a.return),Pr(3,a),Ys(5,a,a.return));break;case 1:Pa(r,a),Li(a),m&512&&(_i||f===null||Bs(f,f.return)),m&64&&qs&&(a=a.updateQueue,a!==null&&(m=a.callbacks,m!==null&&(f=a.shared.hiddenCallbacks,a.shared.hiddenCallbacks=f===null?m:f.concat(m))));break;case 26:var A=os;if(Pa(r,a),Li(a),m&512&&(_i||f===null||Bs(f,f.return)),m&4){var E=f!==null?f.memoizedState:null;if(m=a.memoizedState,f===null)if(m===null)if(a.stateNode===null){e:{m=a.type,f=a.memoizedProps,A=A.ownerDocument||A;t:switch(m){case"title":E=A.getElementsByTagName("title")[0],(!E||E[ct]||E[mn]||E.namespaceURI==="http://www.w3.org/2000/svg"||E.hasAttribute("itemprop"))&&(E=A.createElement(m),A.head.insertBefore(E,A.querySelector("head > title"))),Wa(E,m,f),E[mn]=a,k(E),m=E;break e;case"link":var L=qC("link","href",A).get(m+(f.href||""));if(L){for(var Y=0;Y<L.length;Y++)if(E=L[Y],E.getAttribute("href")===(f.href==null||f.href===""?null:f.href)&&E.getAttribute("rel")===(f.rel==null?null:f.rel)&&E.getAttribute("title")===(f.title==null?null:f.title)&&E.getAttribute("crossorigin")===(f.crossOrigin==null?null:f.crossOrigin)){L.splice(Y,1);break t}}E=A.createElement(m),Wa(E,m,f),A.head.appendChild(E);break;case"meta":if(L=qC("meta","content",A).get(m+(f.content||""))){for(Y=0;Y<L.length;Y++)if(E=L[Y],E.getAttribute("content")===(f.content==null?null:""+f.content)&&E.getAttribute("name")===(f.name==null?null:f.name)&&E.getAttribute("property")===(f.property==null?null:f.property)&&E.getAttribute("http-equiv")===(f.httpEquiv==null?null:f.httpEquiv)&&E.getAttribute("charset")===(f.charSet==null?null:f.charSet)){L.splice(Y,1);break t}}E=A.createElement(m),Wa(E,m,f),A.head.appendChild(E);break;default:throw Error(n(468,m))}E[mn]=a,k(E),m=E}a.stateNode=m}else KC(A,a.type,a.stateNode);else a.stateNode=JC(A,m,a.memoizedProps);else E!==m?(E===null?f.stateNode!==null&&(f=f.stateNode,f.parentNode.removeChild(f)):E.count--,m===null?KC(A,a.type,a.stateNode):JC(A,m,a.memoizedProps)):m===null&&a.stateNode!==null&&Js(a,a.memoizedProps,f.memoizedProps)}break;case 27:Pa(r,a),Li(a),m&512&&(_i||f===null||Bs(f,f.return)),f!==null&&m&4&&Js(a,a.memoizedProps,f.memoizedProps);break;case 5:if(Pa(r,a),Li(a),m&512&&(_i||f===null||Bs(f,f.return)),a.flags&32){A=a.stateNode;try{jn(A,"")}catch(qt){ci(a,a.return,qt)}}m&4&&a.stateNode!=null&&(A=a.memoizedProps,Js(a,A,f!==null?f.memoizedProps:A)),m&1024&&(_o=!0);break;case 6:if(Pa(r,a),Li(a),m&4){if(a.stateNode===null)throw Error(n(162));m=a.memoizedProps,f=a.stateNode;try{f.nodeValue=m}catch(qt){ci(a,a.return,qt)}}break;case 3:if(by=null,A=os,os=Sy(r.containerInfo),Pa(r,a),os=A,Li(a),m&4&&f!==null&&f.memoizedState.isDehydrated)try{Kd(r.containerInfo)}catch(qt){ci(a,a.return,qt)}_o&&(_o=!1,gy(a));break;case 4:m=os,os=Sy(a.stateNode.containerInfo),Pa(r,a),Li(a),os=m;break;case 12:Pa(r,a),Li(a);break;case 31:Pa(r,a),Li(a),m&4&&(m=a.updateQueue,m!==null&&(a.updateQueue=null,Gi(a,m)));break;case 13:Pa(r,a),Li(a),a.child.flags&8192&&a.memoizedState!==null!=(f!==null&&f.memoizedState!==null)&&(So=P()),m&4&&(m=a.updateQueue,m!==null&&(a.updateQueue=null,Gi(a,m)));break;case 22:A=a.memoizedState!==null;var re=f!==null&&f.memoizedState!==null,Re=qs,Xe=_i;if(qs=Re||A,_i=Xe||re,Pa(r,a),_i=Xe,qs=Re,Li(a),m&8192)e:for(r=a.stateNode,r._visibility=A?r._visibility&-2:r._visibility|1,A&&(f===null||re||qs||_i||Zl(a)),f=null,r=a;;){if(r.tag===5||r.tag===26){if(f===null){re=f=r;try{if(E=re.stateNode,A)L=E.style,typeof L.setProperty=="function"?L.setProperty("display","none","important"):L.display="none";else{Y=re.stateNode;var $e=re.memoizedProps.style,De=$e!=null&&$e.hasOwnProperty("display")?$e.display:null;Y.style.display=De==null||typeof De=="boolean"?"":(""+De).trim()}}catch(qt){ci(re,re.return,qt)}}}else if(r.tag===6){if(f===null){re=r;try{re.stateNode.nodeValue=A?"":re.memoizedProps}catch(qt){ci(re,re.return,qt)}}}else if(r.tag===18){if(f===null){re=r;try{var Pe=re.stateNode;A?FC(Pe,!0):FC(re.stateNode,!1)}catch(qt){ci(re,re.return,qt)}}}else if((r.tag!==22&&r.tag!==23||r.memoizedState===null||r===a)&&r.child!==null){r.child.return=r,r=r.child;continue}if(r===a)break e;for(;r.sibling===null;){if(r.return===null||r.return===a)break e;f===r&&(f=null),r=r.return}f===r&&(f=null),r.sibling.return=r.return,r=r.sibling}m&4&&(m=a.updateQueue,m!==null&&(f=m.retryQueue,f!==null&&(m.retryQueue=null,Gi(a,f))));break;case 19:Pa(r,a),Li(a),m&4&&(m=a.updateQueue,m!==null&&(a.updateQueue=null,Gi(a,m)));break;case 30:break;case 21:break;default:Pa(r,a),Li(a)}}function Li(a){var r=a.flags;if(r&2){try{for(var f,m=a.return;m!==null;){if(Wi(m)){f=m;break}m=m.return}if(f==null)throw Error(n(160));switch(f.tag){case 27:var A=f.stateNode,E=zr(a);Zn(a,E,A);break;case 5:var L=f.stateNode;f.flags&32&&(jn(L,""),f.flags&=-33);var Y=zr(a);Zn(a,Y,L);break;case 3:case 4:var re=f.stateNode.containerInfo,Re=zr(a);xn(a,Re,re);break;default:throw Error(n(161))}}catch(Xe){ci(a,a.return,Xe)}a.flags&=-3}r&4096&&(a.flags&=-4097)}function gy(a){if(a.subtreeFlags&1024)for(a=a.child;a!==null;){var r=a;gy(r),r.tag===5&&r.flags&1024&&r.stateNode.reset(),a=a.sibling}}function yo(a,r){if(r.subtreeFlags&8772)for(r=r.child;r!==null;)py(a,r.alternate,r),r=r.sibling}function Zl(a){for(a=a.child;a!==null;){var r=a;switch(r.tag){case 0:case 11:case 14:case 15:Ys(4,r,r.return),Zl(r);break;case 1:Bs(r,r.return);var f=r.stateNode;typeof f.componentWillUnmount=="function"&&mg(r,r.return,f),Zl(r);break;case 27:xg(r.stateNode);case 26:case 5:Bs(r,r.return),Zl(r);break;case 22:r.memoizedState===null&&Zl(r);break;case 30:Zl(r);break;default:Zl(r)}a=a.sibling}}function $n(a,r,f){for(f=f&&(r.subtreeFlags&8772)!==0,r=r.child;r!==null;){var m=r.alternate,A=a,E=r,L=E.flags;switch(E.tag){case 0:case 11:case 15:$n(A,E,f),Pr(4,E);break;case 1:if($n(A,E,f),m=E,A=m.stateNode,typeof A.componentDidMount=="function")try{A.componentDidMount()}catch(Re){ci(m,m.return,Re)}if(m=E,A=m.updateQueue,A!==null){var Y=m.stateNode;try{var re=A.shared.hiddenCallbacks;if(re!==null)for(A.shared.hiddenCallbacks=null,A=0;A<re.length;A++)Or(re[A],Y)}catch(Re){ci(m,m.return,Re)}}f&&L&64&&ol(E),Gr(E,E.return);break;case 27:Pi(E);case 26:case 5:$n(A,E,f),f&&m===null&&L&4&&Ds(E),Gr(E,E.return);break;case 12:$n(A,E,f);break;case 31:$n(A,E,f),f&&L&4&&Fd(A,E);break;case 13:$n(A,E,f),f&&L&4&&gg(A,E);break;case 22:E.memoizedState===null&&$n(A,E,f),Gr(E,E.return);break;case 30:break;default:$n(A,E,f)}r=r.sibling}}function Hd(a,r){var f=null;a!==null&&a.memoizedState!==null&&a.memoizedState.cachePool!==null&&(f=a.memoizedState.cachePool.pool),a=null,r.memoizedState!==null&&r.memoizedState.cachePool!==null&&(a=r.memoizedState.cachePool.pool),a!==f&&(a!=null&&a.refCount++,f!=null&&Aa(f))}function xo(a,r){a=null,r.alternate!==null&&(a=r.alternate.memoizedState.cache),r=r.memoizedState.cache,r!==a&&(r.refCount++,a!=null&&Aa(a))}function ea(a,r,f,m){if(r.subtreeFlags&10256)for(r=r.child;r!==null;)Mi(a,r,f,m),r=r.sibling}function Mi(a,r,f,m){var A=r.flags;switch(r.tag){case 0:case 11:case 15:ea(a,r,f,m),A&2048&&Pr(9,r);break;case 1:ea(a,r,f,m);break;case 3:ea(a,r,f,m),A&2048&&(a=null,r.alternate!==null&&(a=r.alternate.memoizedState.cache),r=r.memoizedState.cache,r!==a&&(r.refCount++,a!=null&&Aa(a)));break;case 12:if(A&2048){ea(a,r,f,m),a=r.stateNode;try{var E=r.memoizedProps,L=E.id,Y=E.onPostCommit;typeof Y=="function"&&Y(L,r.alternate===null?"mount":"update",a.passiveEffectDuration,-0)}catch(re){ci(r,r.return,re)}}else ea(a,r,f,m);break;case 31:ea(a,r,f,m);break;case 13:ea(a,r,f,m);break;case 23:break;case 22:E=r.stateNode,L=r.alternate,r.memoizedState!==null?E._visibility&2?ea(a,r,f,m):su(a,r):E._visibility&2?ea(a,r,f,m):(E._visibility|=2,ul(a,r,f,m,(r.subtreeFlags&10256)!==0||!1)),A&2048&&Hd(L,r);break;case 24:ea(a,r,f,m),A&2048&&xo(r.alternate,r);break;default:ea(a,r,f,m)}}function ul(a,r,f,m,A){for(A=A&&((r.subtreeFlags&10256)!==0||!1),r=r.child;r!==null;){var E=a,L=r,Y=f,re=m,Re=L.flags;switch(L.tag){case 0:case 11:case 15:ul(E,L,Y,re,A),Pr(8,L);break;case 23:break;case 22:var Xe=L.stateNode;L.memoizedState!==null?Xe._visibility&2?ul(E,L,Y,re,A):su(E,L):(Xe._visibility|=2,ul(E,L,Y,re,A)),A&&Re&2048&&Hd(L.alternate,L);break;case 24:ul(E,L,Y,re,A),A&&Re&2048&&xo(L.alternate,L);break;default:ul(E,L,Y,re,A)}r=r.sibling}}function su(a,r){if(r.subtreeFlags&10256)for(r=r.child;r!==null;){var f=a,m=r,A=m.flags;switch(m.tag){case 22:su(f,m),A&2048&&Hd(m.alternate,m);break;case 24:su(f,m),A&2048&&xo(m.alternate,m);break;default:su(f,m)}r=r.sibling}}var Oi=8192;function Ql(a,r,f){if(a.subtreeFlags&Oi)for(a=a.child;a!==null;)zi(a,r,f),a=a.sibling}function zi(a,r,f){switch(a.tag){case 26:Ql(a,r,f),a.flags&Oi&&a.memoizedState!==null&&R4(f,os,a.memoizedState,a.memoizedProps);break;case 5:Ql(a,r,f);break;case 3:case 4:var m=os;os=Sy(a.stateNode.containerInfo),Ql(a,r,f),os=m;break;case 22:a.memoizedState===null&&(m=a.alternate,m!==null&&m.memoizedState!==null?(m=Oi,Oi=16777216,Ql(a,r,f),Oi=m):Ql(a,r,f));break;default:Ql(a,r,f)}}function ls(a){var r=a.alternate;if(r!==null&&(a=r.child,a!==null)){r.child=null;do r=a.sibling,a.sibling=null,a=r;while(a!==null)}}function qa(a){var r=a.deletions;if((a.flags&16)!==0){if(r!==null)for(var f=0;f<r.length;f++){var m=r[f];Ui=m,Yf(m,a)}ls(a)}if(a.subtreeFlags&10256)for(a=a.child;a!==null;)$l(a),a=a.sibling}function $l(a){switch(a.tag){case 0:case 11:case 15:qa(a),a.flags&2048&&Ys(9,a,a.return);break;case 3:qa(a);break;case 12:qa(a);break;case 22:var r=a.stateNode;a.memoizedState!==null&&r._visibility&2&&(a.return===null||a.return.tag!==13)?(r._visibility&=-3,Pd(a)):qa(a);break;default:qa(a)}}function Pd(a){var r=a.deletions;if((a.flags&16)!==0){if(r!==null)for(var f=0;f<r.length;f++){var m=r[f];Ui=m,Yf(m,a)}ls(a)}for(a=a.child;a!==null;){switch(r=a,r.tag){case 0:case 11:case 15:Ys(8,r,r.return),Pd(r);break;case 22:f=r.stateNode,f._visibility&2&&(f._visibility&=-3,Pd(r));break;default:Pd(r)}a=a.sibling}}function Yf(a,r){for(;Ui!==null;){var f=Ui;switch(f.tag){case 0:case 11:case 15:Ys(8,f,r);break;case 23:case 22:if(f.memoizedState!==null&&f.memoizedState.cachePool!==null){var m=f.memoizedState.cachePool.pool;m!=null&&m.refCount++}break;case 24:Aa(f.memoizedState.cache)}if(m=f.child,m!==null)m.return=f,Ui=m;else e:for(f=a;Ui!==null;){m=Ui;var A=m.sibling,E=m.return;if(Id(m),m===f){Ui=null;break e}if(A!==null){A.return=E,Ui=A;break e}Ui=E}}}var Gd={getCacheForType:function(a){var r=ca(Qt),f=r.data.get(a);return f===void 0&&(f=a(),r.data.set(a,f)),f},cacheSignal:function(){return ca(Qt).controller.signal}},zd=typeof WeakMap=="function"?WeakMap:Map,Gn=0,ei=null,An=null,Nn=0,$t=0,Rn=null,vn=!1,En=!1,li=!1,Vi=0,ti=0,Ns=0,Ao=0,hr=0,zn=0,Us=0,dr=null,Ga=null,cs=!1,So=0,ru=0,Ls=1/0,ou=null,Vr=null,bi=0,pr=null,Os=null,Ks=0,Mo=0,ec=null,Vd=null,tc=0,nc=null;function Ka(){return(Gn&2)!==0&&Nn!==0?Nn&-Nn:I.T!==null?QS():wi()}function c(){if(zn===0)if((Nn&536870912)===0||In){var a=ot;ot<<=1,(ot&3932160)===0&&(ot=262144),zn=a}else zn=536870912;return a=$i.current,a!==null&&(a.flags|=32),zn}function u(a,r,f){(a===ei&&($t===2||$t===9)||a.cancelPendingCommit!==null)&&(be(a,0),B(a,Nn,zn,!1)),Fi(a,f),((Gn&2)===0||a!==ei)&&(a===ei&&((Gn&2)===0&&(Ao|=f),ti===4&&B(a,Nn,zn,!1)),fl(a))}function g(a,r,f){if((Gn&6)!==0)throw Error(n(327));var m=!f&&(r&127)===0&&(r&a.expiredLanes)===0||_t(a,r),A=m?ic(a,r):us(a,r,!0),E=m;do{if(A===0){En&&!m&&B(a,r,0,!1);break}else{if(f=a.current.alternate,E&&!C(f)){A=us(a,r,!1),E=!1;continue}if(A===2){if(E=r,a.errorRecoveryDisabledLanes&E)var L=0;else L=a.pendingLanes&-536870913,L=L!==0?L:L&536870912?536870912:0;if(L!==0){r=L;e:{var Y=a;A=dr;var re=Y.current.memoizedState.isDehydrated;if(re&&(be(Y,L).flags|=256),L=us(Y,L,!1),L!==2){if(li&&!re){Y.errorRecoveryDisabledLanes|=E,Ao|=E,A=4;break e}E=Ga,Ga=A,E!==null&&(Ga===null?Ga=E:Ga.push.apply(Ga,E))}A=L}if(E=!1,A!==2)continue}}if(A===1){be(a,0),B(a,r,0,!0);break}e:{switch(m=a,E=A,E){case 0:case 1:throw Error(n(345));case 4:if((r&4194048)!==r)break;case 6:B(m,r,zn,!vn);break e;case 2:Ga=null;break;case 3:case 5:break;default:throw Error(n(329))}if((r&62914560)===r&&(A=So+300-P(),10<A)){if(B(m,r,zn,!vn),We(m,0,!0)!==0)break e;Ks=r,m.timeoutHandle=LC(S.bind(null,m,f,Ga,ou,cs,r,zn,Ao,Us,vn,E,"Throttled",-0,0),A);break e}S(m,f,Ga,ou,cs,r,zn,Ao,Us,vn,E,null,-0,0)}}break}while(!0);fl(a)}function S(a,r,f,m,A,E,L,Y,re,Re,Xe,$e,De,Pe){if(a.timeoutHandle=-1,$e=r.subtreeFlags,$e&8192||($e&16785408)===16785408){$e={stylesheets:null,count:0,imgCount:0,imgBytes:0,suspenseyImages:[],waitingForImages:!0,waitingForViewTransition:!1,unsuspend:Tr},zi(r,E,$e);var qt=(E&62914560)===E?So-P():(E&4194048)===E?ru-P():0;if(qt=w4($e,qt),qt!==null){Ks=E,a.cancelPendingCommit=qt(hn.bind(null,a,r,E,f,m,A,L,Y,re,Xe,$e,null,De,Pe)),B(a,E,L,!Re);return}}hn(a,r,E,f,m,A,L,Y,re)}function C(a){for(var r=a;;){var f=r.tag;if((f===0||f===11||f===15)&&r.flags&16384&&(f=r.updateQueue,f!==null&&(f=f.stores,f!==null)))for(var m=0;m<f.length;m++){var A=f[m],E=A.getSnapshot;A=A.value;try{if(!gi(E(),A))return!1}catch{return!1}}if(f=r.child,r.subtreeFlags&16384&&f!==null)f.return=r,r=f;else{if(r===a)break;for(;r.sibling===null;){if(r.return===null||r.return===a)return!0;r=r.return}r.sibling.return=r.return,r=r.sibling}}return!0}function B(a,r,f,m){r&=~hr,r&=~Ao,a.suspendedLanes|=r,a.pingedLanes&=~r,m&&(a.warmLanes|=r),m=a.expirationTimes;for(var A=r;0<A;){var E=31-bt(A),L=1<<E;m[E]=-1,A&=~L}f!==0&&br(a,f,r)}function J(){return(Gn&6)===0?(vg(0),!1):!0}function se(){if(An!==null){if($t===0)var a=An.return;else a=An,Oa=lo=null,qm(a),$o=null,el=0,a=An;for(;a!==null;)jl(a.alternate,a),a=a.return;An=null}}function be(a,r){var f=a.timeoutHandle;f!==-1&&(a.timeoutHandle=-1,f4(f)),f=a.cancelPendingCommit,f!==null&&(a.cancelPendingCommit=null,f()),Ks=0,se(),ei=a,An=f=wr(a.current,null),Nn=r,$t=0,Rn=null,vn=!1,En=_t(a,r),li=!1,Us=zn=hr=Ao=Ns=ti=0,Ga=dr=null,cs=!1,(r&8)!==0&&(r|=r&32);var m=a.entangledLanes;if(m!==0)for(a=a.entanglements,m&=r;0<m;){var A=31-bt(m),E=1<<A;r|=a[A],m&=~E}return Vi=r,Jo(),f}function Ke(a,r){fn=null,I.H=Uf,r===Qo||r===lr?(r=gd(),$t=3):r===Mf?(r=gd(),$t=4):$t=r===Ud?8:r!==null&&typeof r=="object"&&typeof r.then=="function"?6:1,Rn=r,An===null&&(ti=1,Nd(a,ts(r,a.current)))}function St(){var a=$i.current;return a===null?!0:(Nn&4194048)===Nn?Vs===null:(Nn&62914560)===Nn||(Nn&536870912)!==0?a===Vs:!1}function It(){var a=I.H;return I.H=Uf,a===null?Uf:a}function Pt(){var a=I.A;return I.A=Gd,a}function gn(){ti=4,vn||(Nn&4194048)!==Nn&&$i.current!==null||(En=!0),(Ns&134217727)===0&&(Ao&134217727)===0||ei===null||B(ei,Nn,zn,!1)}function us(a,r,f){var m=Gn;Gn|=2;var A=It(),E=Pt();(ei!==a||Nn!==r)&&(ou=null,be(a,r)),r=!1;var L=ti;e:do try{if($t!==0&&An!==null){var Y=An,re=Rn;switch($t){case 8:se(),L=6;break e;case 3:case 2:case 9:case 6:$i.current===null&&(r=!0);var Re=$t;if($t=0,Rn=null,pt(a,Y,re,Re),f&&En){L=0;break e}break;default:Re=$t,$t=0,Rn=null,pt(a,Y,re,Re)}}Jf(),L=ti;break}catch(Xe){Ke(a,Xe)}while(!0);return r&&a.shellSuspendCounter++,Oa=lo=null,Gn=m,I.H=A,I.A=E,An===null&&(ei=null,Nn=0,Jo()),L}function Jf(){for(;An!==null;)Ae(An)}function ic(a,r){var f=Gn;Gn|=2;var m=It(),A=Pt();ei!==a||Nn!==r?(ou=null,Ls=P()+500,be(a,r)):En=_t(a,r);e:do try{if($t!==0&&An!==null){r=An;var E=Rn;t:switch($t){case 1:$t=0,Rn=null,pt(a,r,E,1);break;case 2:case 9:if(z_(E)){$t=0,Rn=null,Oe(r);break}r=function(){$t!==2&&$t!==9||ei!==a||($t=7),fl(a)},E.then(r,r);break e;case 3:$t=7;break e;case 4:$t=5;break e;case 7:z_(E)?($t=0,Rn=null,Oe(r)):($t=0,Rn=null,pt(a,r,E,7));break;case 5:var L=null;switch(An.tag){case 26:L=An.memoizedState;case 5:case 27:var Y=An;if(L?WC(L):Y.stateNode.complete){$t=0,Rn=null;var re=Y.sibling;if(re!==null)An=re;else{var Re=Y.return;Re!==null?(An=Re,jt(Re)):An=null}break t}}$t=0,Rn=null,pt(a,r,E,5);break;case 6:$t=0,Rn=null,pt(a,r,E,6);break;case 8:se(),ti=6;break e;default:throw Error(n(462))}}Be();break}catch(Xe){Ke(a,Xe)}while(!0);return Oa=lo=null,I.H=m,I.A=A,Gn=f,An!==null?0:(ei=null,Nn=0,Jo(),ti)}function Be(){for(;An!==null&&!gt();)Ae(An)}function Ae(a){var r=Ld(a.alternate,a,Vi);a.memoizedProps=a.pendingProps,r===null?jt(a):An=r}function Oe(a){var r=a,f=r.alternate;switch(r.tag){case 15:case 0:r=Fa(f,r,r.pendingProps,r.type,void 0,Nn);break;case 11:r=Fa(f,r,r.pendingProps,r.type.render,r.ref,Nn);break;case 5:qm(r);default:jl(f,r),r=An=La(r,Vi),r=Ld(f,r,Vi)}a.memoizedProps=a.pendingProps,r===null?jt(a):An=r}function pt(a,r,f,m){Oa=lo=null,qm(r),$o=null,el=0;var A=r.return;try{if(Es(a,A,r,f,Nn)){ti=1,Nd(a,ts(f,a.current)),An=null;return}}catch(E){if(A!==null)throw An=A,E;ti=1,Nd(a,ts(f,a.current)),An=null;return}r.flags&32768?(In||m===1?a=!0:En||(Nn&536870912)!==0?a=!1:(vn=a=!0,(m===2||m===9||m===3||m===6)&&(m=$i.current,m!==null&&m.tag===13&&(m.flags|=16384))),fi(r,a)):jt(r)}function jt(a){var r=a;do{if((r.flags&32768)!==0){fi(r,vn);return}a=r.return;var f=pg(r.alternate,r,Vi);if(f!==null){An=f;return}if(r=r.sibling,r!==null){An=r;return}An=r=a}while(r!==null);ti===0&&(ti=5)}function fi(a,r){do{var f=Od(a.alternate,a);if(f!==null){f.flags&=32767,An=f;return}if(f=a.return,f!==null&&(f.flags|=32768,f.subtreeFlags=0,f.deletions=null),!r&&(a=a.sibling,a!==null)){An=a;return}An=a=f}while(a!==null);ti=6,An=null}function hn(a,r,f,m,A,E,L,Y,re){a.cancelPendingCommit=null;do kd();while(bi!==0);if((Gn&6)!==0)throw Error(n(327));if(r!==null){if(r===a.current)throw Error(n(177));if(E=r.lanes|r.childLanes,E|=ld,va(a,f,E,L,Y,re),a===ei&&(An=ei=null,Nn=0),Os=r,pr=a,Ks=f,Mo=E,ec=A,Vd=m,(r.subtreeFlags&10256)!==0||(r.flags&10256)!==0?(a.callbackNode=null,a.callbackPriority=0,QF(Ie,function(){return vC(),null})):(a.callbackNode=null,a.callbackPriority=0),m=(r.flags&13878)!==0,(r.subtreeFlags&13878)!==0||m){m=I.T,I.T=null,A=W.p,W.p=2,L=Gn,Gn|=4;try{au(a,r,f)}finally{Gn=L,W.p=A,I.T=m}}bi=1,qn(),ta(),Kn()}}function qn(){if(bi===1){bi=0;var a=pr,r=Os,f=(r.flags&13878)!==0;if((r.subtreeFlags&13878)!==0||f){f=I.T,I.T=null;var m=W.p;W.p=2;var A=Gn;Gn|=4;try{cl(r,a);var E=rM,L=id(a.containerInfo),Y=E.focusedElem,re=E.selectionRange;if(L!==Y&&Y&&Y.ownerDocument&&nd(Y.ownerDocument.documentElement,Y)){if(re!==null&&Fc(Y)){var Re=re.start,Xe=re.end;if(Xe===void 0&&(Xe=Re),"selectionStart"in Y)Y.selectionStart=Re,Y.selectionEnd=Math.min(Xe,Y.value.length);else{var $e=Y.ownerDocument||document,De=$e&&$e.defaultView||window;if(De.getSelection){var Pe=De.getSelection(),qt=Y.textContent.length,cn=Math.min(re.start,qt),di=re.end===void 0?cn:Math.min(re.end,qt);!Pe.extend&&cn>di&&(L=di,di=cn,cn=L);var Se=Sm(Y,cn),me=Sm(Y,di);if(Se&&me&&(Pe.rangeCount!==1||Pe.anchorNode!==Se.node||Pe.anchorOffset!==Se.offset||Pe.focusNode!==me.node||Pe.focusOffset!==me.offset)){var Ce=$e.createRange();Ce.setStart(Se.node,Se.offset),Pe.removeAllRanges(),cn>di?(Pe.addRange(Ce),Pe.extend(me.node,me.offset)):(Ce.setEnd(me.node,me.offset),Pe.addRange(Ce))}}}}for($e=[],Pe=Y;Pe=Pe.parentNode;)Pe.nodeType===1&&$e.push({element:Pe,left:Pe.scrollLeft,top:Pe.scrollTop});for(typeof Y.focus=="function"&&Y.focus(),Y=0;Y<$e.length;Y++){var Ze=$e[Y];Ze.element.scrollLeft=Ze.left,Ze.element.scrollTop=Ze.top}}Ry=!!sM,rM=sM=null}finally{Gn=A,W.p=m,I.T=f}}a.current=r,bi=2}}function ta(){if(bi===2){bi=0;var a=pr,r=Os,f=(r.flags&8772)!==0;if((r.subtreeFlags&8772)!==0||f){f=I.T,I.T=null;var m=W.p;W.p=2;var A=Gn;Gn|=4;try{py(a,r.alternate,r)}finally{Gn=A,W.p=m,I.T=f}}bi=3}}function Kn(){if(bi===4||bi===3){bi=0,j();var a=pr,r=Os,f=Ks,m=Vd;(r.subtreeFlags&10256)!==0||(r.flags&10256)!==0?bi=5:(bi=0,Os=pr=null,bo(a,a.pendingLanes));var A=a.pendingLanes;if(A===0&&(Vr=null),Da(f),r=r.stateNode,qe&&typeof qe.onCommitFiberRoot=="function")try{qe.onCommitFiberRoot(Ye,r,void 0,(r.current.flags&128)===128)}catch{}if(m!==null){r=I.T,A=W.p,W.p=2,I.T=null;try{for(var E=a.onRecoverableError,L=0;L<m.length;L++){var Y=m[L];E(Y.value,{componentStack:Y.stack})}}finally{I.T=r,W.p=A}}(Ks&3)!==0&&kd(),fl(a),A=a.pendingLanes,(f&261930)!==0&&(A&42)!==0?a===nc?tc++:(tc=0,nc=a):tc=0,vg(0)}}function bo(a,r){(a.pooledCacheLanes&=r)===0&&(r=a.pooledCache,r!=null&&(a.pooledCache=null,Aa(r)))}function kd(){return qn(),ta(),Kn(),vC()}function vC(){if(bi!==5)return!1;var a=pr,r=Mo;Mo=0;var f=Da(Ks),m=I.T,A=W.p;try{W.p=32>f?32:f,I.T=null,f=ec,ec=null;var E=pr,L=Ks;if(bi=0,Os=pr=null,Ks=0,(Gn&6)!==0)throw Error(n(331));var Y=Gn;if(Gn|=4,$l(E.current),Mi(E,E.current,L,f),Gn=Y,vg(0,!1),qe&&typeof qe.onPostCommitFiberRoot=="function")try{qe.onPostCommitFiberRoot(Ye,E)}catch{}return!0}finally{W.p=A,I.T=m,bo(a,r)}}function _C(a,r,f){r=ts(f,r),r=dg(a.stateNode,r,2),a=ho(a,r,2),a!==null&&(Fi(a,2),fl(a))}function ci(a,r,f){if(a.tag===3)_C(a,a,f);else for(;r!==null;){if(r.tag===3){_C(r,a,f);break}else if(r.tag===1){var m=r.stateNode;if(typeof r.type.getDerivedStateFromError=="function"||typeof m.componentDidCatch=="function"&&(Vr===null||!Vr.has(m))){a=ts(f,a),f=$c(2),m=ho(r,f,2),m!==null&&(ss(f,m,r,a),Fi(m,2),fl(m));break}}r=r.return}}function WS(a,r,f){var m=a.pingCache;if(m===null){m=a.pingCache=new zd;var A=new Set;m.set(r,A)}else A=m.get(r),A===void 0&&(A=new Set,m.set(r,A));A.has(f)||(li=!0,A.add(f),a=WF.bind(null,a,r,f),r.then(a,a))}function WF(a,r,f){var m=a.pingCache;m!==null&&m.delete(r),a.pingedLanes|=a.suspendedLanes&f,a.warmLanes&=~f,ei===a&&(Nn&f)===f&&(ti===4||ti===3&&(Nn&62914560)===Nn&&300>P()-So?(Gn&2)===0&&be(a,0):hr|=f,Us===Nn&&(Us=0)),fl(a)}function yC(a,r){r===0&&(r=wn()),a=qo(a,r),a!==null&&(Fi(a,r),fl(a))}function jF(a){var r=a.memoizedState,f=0;r!==null&&(f=r.retryLane),yC(a,f)}function ZF(a,r){var f=0;switch(a.tag){case 31:case 13:var m=a.stateNode,A=a.memoizedState;A!==null&&(f=A.retryLane);break;case 19:m=a.stateNode;break;case 22:m=a.stateNode._retryCache;break;default:throw Error(n(314))}m!==null&&m.delete(r),yC(a,f)}function QF(a,r){return mt(a,r)}var vy=null,Xd=null,jS=!1,_y=!1,ZS=!1,lu=0;function fl(a){a!==Xd&&a.next===null&&(Xd===null?vy=Xd=a:Xd=Xd.next=a),_y=!0,jS||(jS=!0,e4())}function vg(a,r){if(!ZS&&_y){ZS=!0;do for(var f=!1,m=vy;m!==null;){if(a!==0){var A=m.pendingLanes;if(A===0)var E=0;else{var L=m.suspendedLanes,Y=m.pingedLanes;E=(1<<31-bt(42|a)+1)-1,E&=A&~(L&~Y),E=E&201326741?E&201326741|1:E?E|2:0}E!==0&&(f=!0,MC(m,E))}else E=Nn,E=We(m,m===ei?E:0,m.cancelPendingCommit!==null||m.timeoutHandle!==-1),(E&3)===0||_t(m,E)||(f=!0,MC(m,E));m=m.next}while(f);ZS=!1}}function $F(){xC()}function xC(){_y=jS=!1;var a=0;lu!==0&&u4()&&(a=lu);for(var r=P(),f=null,m=vy;m!==null;){var A=m.next,E=AC(m,r);E===0?(m.next=null,f===null?vy=A:f.next=A,A===null&&(Xd=f)):(f=m,(a!==0||(E&3)!==0)&&(_y=!0)),m=A}bi!==0&&bi!==5||vg(a),lu!==0&&(lu=0)}function AC(a,r){for(var f=a.suspendedLanes,m=a.pingedLanes,A=a.expirationTimes,E=a.pendingLanes&-62914561;0<E;){var L=31-bt(E),Y=1<<L,re=A[L];re===-1?((Y&f)===0||(Y&m)!==0)&&(A[L]=nn(Y,r)):re<=r&&(a.expiredLanes|=Y),E&=~Y}if(r=ei,f=Nn,f=We(a,a===r?f:0,a.cancelPendingCommit!==null||a.timeoutHandle!==-1),m=a.callbackNode,f===0||a===r&&($t===2||$t===9)||a.cancelPendingCommit!==null)return m!==null&&m!==null&&Ot(m),a.callbackNode=null,a.callbackPriority=0;if((f&3)===0||_t(a,f)){if(r=f&-f,r===a.callbackPriority)return r;switch(m!==null&&Ot(m),Da(f)){case 2:case 8:f=ke;break;case 32:f=Ie;break;case 268435456:f=Mt;break;default:f=Ie}return m=SC.bind(null,a),f=mt(f,m),a.callbackPriority=r,a.callbackNode=f,r}return m!==null&&m!==null&&Ot(m),a.callbackPriority=2,a.callbackNode=null,2}function SC(a,r){if(bi!==0&&bi!==5)return a.callbackNode=null,a.callbackPriority=0,null;var f=a.callbackNode;if(kd()&&a.callbackNode!==f)return null;var m=Nn;return m=We(a,a===ei?m:0,a.cancelPendingCommit!==null||a.timeoutHandle!==-1),m===0?null:(g(a,m,r),AC(a,P()),a.callbackNode!=null&&a.callbackNode===f?SC.bind(null,a):null)}function MC(a,r){if(kd())return null;g(a,r,!0)}function e4(){h4(function(){(Gn&6)!==0?mt(Fe,$F):xC()})}function QS(){if(lu===0){var a=fo;a===0&&(a=Ne,Ne<<=1,(Ne&261888)===0&&(Ne=256)),lu=a}return lu}function bC(a){return a==null||typeof a=="symbol"||typeof a=="boolean"?null:typeof a=="function"?a:af(""+a)}function EC(a,r){var f=r.ownerDocument.createElement("input");return f.name=r.name,f.value=r.value,a.id&&f.setAttribute("form",a.id),r.parentNode.insertBefore(f,r),a=new FormData(a),f.parentNode.removeChild(f),a}function t4(a,r,f,m,A){if(r==="submit"&&f&&f.stateNode===A){var E=bC((A[G]||null).action),L=m.submitter;L&&(r=(r=L[G]||null)?bC(r.formAction):L.getAttribute("formAction"),r!==null&&(E=r,L=null));var Y=new lf("action","action",null,m,A);a.push({event:Y,listeners:[{instance:null,listener:function(){if(m.defaultPrevented){if(lu!==0){var re=L?EC(A,L):new FormData(A);lg(f,{pending:!0,data:re,method:A.method,action:E},null,re)}}else typeof E=="function"&&(Y.preventDefault(),re=L?EC(A,L):new FormData(A),lg(f,{pending:!0,data:re,method:A.method,action:E},E,re))},currentTarget:A}]})}}for(var $S=0;$S<od.length;$S++){var eM=od[$S],n4=eM.toLowerCase(),i4=eM[0].toUpperCase()+eM.slice(1);Ua(n4,"on"+i4)}Ua(es,"onAnimationEnd"),Ua(Mm,"onAnimationIteration"),Ua(Rr,"onAnimationStart"),Ua("dblclick","onDoubleClick"),Ua("focusin","onFocus"),Ua("focusout","onBlur"),Ua(zc,"onTransitionRun"),Ua(Xo,"onTransitionStart"),Ua(bm,"onTransitionCancel"),Ua(rd,"onTransitionEnd"),ce("onMouseEnter",["mouseout","mouseover"]),ce("onMouseLeave",["mouseout","mouseover"]),ce("onPointerEnter",["pointerout","pointerover"]),ce("onPointerLeave",["pointerout","pointerover"]),pe("onChange","change click focusin focusout input keydown keyup selectionchange".split(" ")),pe("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" ")),pe("onBeforeInput",["compositionend","keypress","textInput","paste"]),pe("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" ")),pe("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" ")),pe("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var _g="abort canplay canplaythrough durationchange emptied encrypted ended error loadeddata loadedmetadata loadstart pause play playing progress ratechange resize seeked seeking stalled suspend timeupdate volumechange waiting".split(" "),a4=new Set("beforetoggle cancel close invalid load scroll scrollend toggle".split(" ").concat(_g));function TC(a,r){r=(r&4)!==0;for(var f=0;f<a.length;f++){var m=a[f],A=m.event;m=m.listeners;e:{var E=void 0;if(r)for(var L=m.length-1;0<=L;L--){var Y=m[L],re=Y.instance,Re=Y.currentTarget;if(Y=Y.listener,re!==E&&A.isPropagationStopped())break e;E=Y,A.currentTarget=Re;try{E(A)}catch(Xe){Yo(Xe)}A.currentTarget=null,E=re}else for(L=0;L<m.length;L++){if(Y=m[L],re=Y.instance,Re=Y.currentTarget,Y=Y.listener,re!==E&&A.isPropagationStopped())break e;E=Y,A.currentTarget=Re;try{E(A)}catch(Xe){Yo(Xe)}A.currentTarget=null,E=re}}}}function Fn(a,r){var f=r[oe];f===void 0&&(f=r[oe]=new Set);var m=a+"__bubble";f.has(m)||(CC(r,a,2,!1),f.add(m))}function tM(a,r,f){var m=0;r&&(m|=4),CC(f,a,m,r)}var yy="_reactListening"+Math.random().toString(36).slice(2);function nM(a){if(!a[yy]){a[yy]=!0,ie.forEach(function(f){f!=="selectionchange"&&(a4.has(f)||tM(f,!1,a),tM(f,!0,a))});var r=a.nodeType===9?a:a.ownerDocument;r===null||r[yy]||(r[yy]=!0,tM("selectionchange",!1,r))}}function CC(a,r,f,m){switch(nR(r)){case 2:var A=N4;break;case 8:A=U4;break;default:A=vM}f=A.bind(null,r,f,a),A=void 0,!Jh||r!=="touchstart"&&r!=="touchmove"&&r!=="wheel"||(A=!0),m?A!==void 0?a.addEventListener(r,f,{capture:!0,passive:A}):a.addEventListener(r,f,!0):A!==void 0?a.addEventListener(r,f,{passive:A}):a.addEventListener(r,f,!1)}function iM(a,r,f,m,A){var E=m;if((r&1)===0&&(r&2)===0&&m!==null)e:for(;;){if(m===null)return;var L=m.tag;if(L===3||L===4){var Y=m.stateNode.containerInfo;if(Y===A)break;if(L===4)for(L=m.return;L!==null;){var re=L.tag;if((re===3||re===4)&&L.stateNode.containerInfo===A)return;L=L.return}for(;Y!==null;){if(L=st(Y),L===null)return;if(re=L.tag,re===5||re===6||re===26||re===27){m=E=L;continue e}Y=Y.parentNode}}m=m.return}sm(function(){var Re=E,Xe=Xh(f),$e=[];e:{var De=ao.get(a);if(De!==void 0){var Pe=lf,qt=a;switch(a){case"keypress":if(Ul(f)===0)break e;case"keydown":case"keyup":Pe=hm;break;case"focusin":qt="focus",Pe=Zh;break;case"focusout":qt="blur",Pe=Zh;break;case"beforeblur":case"afterblur":Pe=Zh;break;case"click":if(f.button===2)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":Pe=__;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":Pe=y_;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":Pe=no;break;case es:case Mm:case Rr:Pe=S_;break;case rd:Pe=zS;break;case"scroll":case"scrollend":Pe=Wh;break;case"wheel":Pe=Ho;break;case"copy":case"cut":case"paste":Pe=om;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":Pe=Qh;break;case"toggle":case"beforetoggle":Pe=pm}var cn=(r&4)!==0,di=!cn&&(a==="scroll"||a==="scrollend"),Se=cn?De!==null?De+"Capture":null:De;cn=[];for(var me=Re,Ce;me!==null;){var Ze=me;if(Ce=Ze.stateNode,Ze=Ze.tag,Ze!==5&&Ze!==26&&Ze!==27||Ce===null||Se===null||(Ze=Nl(me,Se),Ze!=null&&cn.push(yg(me,Ze,Ce))),di)break;me=me.return}0<cn.length&&(De=new Pe(De,qt,null,f,Xe),$e.push({event:De,listeners:cn}))}}if((r&7)===0){e:{if(De=a==="mouseover"||a==="pointerover",Pe=a==="mouseout"||a==="pointerout",De&&f!==sf&&(qt=f.relatedTarget||f.fromElement)&&(st(qt)||qt[q]))break e;if((Pe||De)&&(De=Xe.window===Xe?Xe:(De=Xe.ownerDocument)?De.defaultView||De.parentWindow:window,Pe?(qt=f.relatedTarget||f.toElement,Pe=Re,qt=qt?st(qt):null,qt!==null&&(di=o(qt),cn=qt.tag,qt!==di||cn!==5&&cn!==27&&cn!==6)&&(qt=null)):(Pe=null,qt=Re),Pe!==qt)){if(cn=__,Ze="onMouseLeave",Se="onMouseEnter",me="mouse",(a==="pointerout"||a==="pointerover")&&(cn=Qh,Ze="onPointerLeave",Se="onPointerEnter",me="pointer"),di=Pe==null?De:yt(Pe),Ce=qt==null?De:yt(qt),De=new cn(Ze,me+"leave",Pe,f,Xe),De.target=di,De.relatedTarget=Ce,Ze=null,st(Xe)===Re&&(cn=new cn(Se,me+"enter",qt,f,Xe),cn.target=Ce,cn.relatedTarget=di,Ze=cn),di=Ze,Pe&&qt)t:{for(cn=s4,Se=Pe,me=qt,Ce=0,Ze=Se;Ze;Ze=cn(Ze))Ce++;Ze=0;for(var sn=me;sn;sn=cn(sn))Ze++;for(;0<Ce-Ze;)Se=cn(Se),Ce--;for(;0<Ze-Ce;)me=cn(me),Ze--;for(;Ce--;){if(Se===me||me!==null&&Se===me.alternate){cn=Se;break t}Se=cn(Se),me=cn(me)}cn=null}else cn=null;Pe!==null&&RC($e,De,Pe,cn,!1),qt!==null&&di!==null&&RC($e,di,qt,cn,!0)}}e:{if(De=Re?yt(Re):window,Pe=De.nodeName&&De.nodeName.toLowerCase(),Pe==="select"||Pe==="input"&&De.type==="file")var ni=ym;else if(vm(De))if(pf)ni=U_;else{ni=zo;var Kt=mf}else Pe=De.nodeName,!Pe||Pe.toLowerCase()!=="input"||De.type!=="checkbox"&&De.type!=="radio"?Re&&_s(Re.elementType)&&(ni=ym):ni=N_;if(ni&&(ni=ni(a,Re))){td($e,ni,f,Xe);break e}Kt&&Kt(a,De,Re),a==="focusout"&&Re&&De.type==="number"&&Re.memoizedProps.value!=null&&an(De,"number",De.value)}switch(Kt=Re?yt(Re):window,a){case"focusin":(vm(Kt)||Kt.contentEditable==="true")&&(Hc=Kt,ad=Re,Pc=null);break;case"focusout":Pc=ad=Hc=null;break;case"mousedown":xs=!0;break;case"contextmenu":case"mouseup":case"dragend":xs=!1,sd($e,f,Xe);break;case"selectionchange":if(L_)break;case"keydown":case"keyup":sd($e,f,Xe)}var Tn;if(Ll)e:{switch(a){case"compositionstart":var Vn="onCompositionStart";break e;case"compositionend":Vn="onCompositionEnd";break e;case"compositionupdate":Vn="onCompositionUpdate";break e}Vn=void 0}else Go?$h(a,f)&&(Vn="onCompositionEnd"):a==="keydown"&&f.keyCode===229&&(Vn="onCompositionStart");Vn&&(xa&&f.locale!=="ko"&&(Go||Vn!=="onCompositionStart"?Vn==="onCompositionEnd"&&Go&&(Tn=Kh()):(Oo=Xe,qh="value"in Oo?Oo.value:Oo.textContent,Go=!0)),Kt=xy(Re,Vn),0<Kt.length&&(Vn=new lm(Vn,a,null,f,Xe),$e.push({event:Vn,listeners:Kt}),Tn?Vn.data=Tn:(Tn=Nc(f),Tn!==null&&(Vn.data=Tn)))),(Tn=Ol?ed(a,f):w_(a,f))&&(Vn=xy(Re,"onBeforeInput"),0<Vn.length&&(Kt=new lm("onBeforeInput","beforeinput",null,f,Xe),$e.push({event:Kt,listeners:Vn}),Kt.data=Tn)),t4($e,a,Re,f,Xe)}TC($e,r)})}function yg(a,r,f){return{instance:a,listener:r,currentTarget:f}}function xy(a,r){for(var f=r+"Capture",m=[];a!==null;){var A=a,E=A.stateNode;if(A=A.tag,A!==5&&A!==26&&A!==27||E===null||(A=Nl(a,f),A!=null&&m.unshift(yg(a,A,E)),A=Nl(a,r),A!=null&&m.push(yg(a,A,E))),a.tag===3)return m;a=a.return}return[]}function s4(a){if(a===null)return null;do a=a.return;while(a&&a.tag!==5&&a.tag!==27);return a||null}function RC(a,r,f,m,A){for(var E=r._reactName,L=[];f!==null&&f!==m;){var Y=f,re=Y.alternate,Re=Y.stateNode;if(Y=Y.tag,re!==null&&re===m)break;Y!==5&&Y!==26&&Y!==27||Re===null||(re=Re,A?(Re=Nl(f,E),Re!=null&&L.unshift(yg(f,Re,re))):A||(Re=Nl(f,E),Re!=null&&L.push(yg(f,Re,re)))),f=f.return}L.length!==0&&a.push({event:r,listeners:L})}var r4=/\r\n?/g,o4=/\u0000|\uFFFD/g;function wC(a){return(typeof a=="string"?a:""+a).replace(r4,`
|
|
8
|
+
`+m.stack}}var Dt=Object.prototype.hasOwnProperty,mt=s.unstable_scheduleCallback,Lt=s.unstable_cancelCallback,gt=s.unstable_shouldYield,j=s.unstable_requestPaint,P=s.unstable_now,de=s.unstable_getCurrentPriorityLevel,Fe=s.unstable_ImmediatePriority,ke=s.unstable_UserBlockingPriority,Ie=s.unstable_NormalPriority,Ft=s.unstable_LowPriority,Mt=s.unstable_IdlePriority,Ht=s.log,zt=s.unstable_setDisableYieldValue,Ye=null,qe=null;function wt(a){if(typeof Ht=="function"&&zt(a),qe&&typeof qe.setStrictMode=="function")try{qe.setStrictMode(Ye,a)}catch{}}var bt=Math.clz32?Math.clz32:fe,rt=Math.log,Vt=Math.LN2;function fe(a){return a>>>=0,a===0?32:31-(rt(a)/Vt|0)|0}var Ne=256,ot=262144,Et=4194304;function Qe(a){var r=a&42;if(r!==0)return r;switch(a&-a){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:return 64;case 128:return 128;case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:return a&261888;case 262144:case 524288:case 1048576:case 2097152:return a&3932160;case 4194304:case 8388608:case 16777216:case 33554432:return a&62914560;case 67108864:return 67108864;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 0;default:return a}}function We(a,r,f){var m=a.pendingLanes;if(m===0)return 0;var A=0,E=a.suspendedLanes,L=a.pingedLanes;a=a.warmLanes;var Y=m&134217727;return Y!==0?(m=Y&~E,m!==0?A=Qe(m):(L&=Y,L!==0?A=Qe(L):f||(f=Y&~a,f!==0&&(A=Qe(f))))):(Y=m&~E,Y!==0?A=Qe(Y):L!==0?A=Qe(L):f||(f=m&~a,f!==0&&(A=Qe(f)))),A===0?0:r!==0&&r!==A&&(r&E)===0&&(E=A&-A,f=r&-r,E>=f||E===32&&(f&4194048)!==0)?r:A}function _t(a,r){return(a.pendingLanes&~(a.suspendedLanes&~a.pingedLanes)&r)===0}function nn(a,r){switch(a){case 1:case 2:case 4:case 8:case 64:return r+250;case 16:case 32: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 r+5e3;case 4194304:case 8388608:case 16777216:case 33554432:return-1;case 67108864:case 134217728:case 268435456:case 536870912:case 1073741824:return-1;default:return-1}}function wn(){var a=Et;return Et<<=1,(Et&62914560)===0&&(Et=4194304),a}function Mn(a){for(var r=[],f=0;31>f;f++)r.push(a);return r}function Fi(a,r){a.pendingLanes|=r,r!==268435456&&(a.suspendedLanes=0,a.pingedLanes=0,a.warmLanes=0)}function va(a,r,f,m,A,E){var L=a.pendingLanes;a.pendingLanes=f,a.suspendedLanes=0,a.pingedLanes=0,a.warmLanes=0,a.expiredLanes&=f,a.entangledLanes&=f,a.errorRecoveryDisabledLanes&=f,a.shellSuspendCounter=0;var Y=a.entanglements,re=a.expirationTimes,Re=a.hiddenUpdates;for(f=L&~f;0<f;){var Xe=31-bt(f),$e=1<<Xe;Y[Xe]=0,re[Xe]=-1;var De=Re[Xe];if(De!==null)for(Re[Xe]=null,Xe=0;Xe<De.length;Xe++){var Pe=De[Xe];Pe!==null&&(Pe.lane&=-536870913)}f&=~$e}m!==0&&br(a,m,0),E!==0&&A===0&&a.tag!==0&&(a.suspendedLanes|=E&~(L&~r))}function br(a,r,f){a.pendingLanes|=r,a.suspendedLanes&=~r;var m=31-bt(r);a.entangledLanes|=r,a.entanglements[m]=a.entanglements[m]|1073741824|f&261930}function ir(a,r){var f=a.entangledLanes|=r;for(a=a.entanglements;f;){var m=31-bt(f),A=1<<m;A&r|a[m]&r&&(a[m]|=r),f&=~A}}function _a(a,r){var f=r&-r;return f=(f&42)!==0?1:sa(f),(f&(a.suspendedLanes|r))!==0?0:f}function sa(a){switch(a){case 2:a=1;break;case 8:a=4;break;case 32:a=16;break;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:a=128;break;case 268435456:a=134217728;break;default:a=0}return a}function Da(a){return a&=-a,2<a?8<a?(a&134217727)!==0?32:268435456:8:2}function wi(){var a=W.p;return a!==0?a:(a=window.event,a===void 0?32:nR(a.type))}function kt(a,r){var f=W.p;try{return W.p=a,r()}finally{W.p=f}}var Ai=Math.random().toString(36).slice(2),mn="__reactFiber$"+Ai,G="__reactProps$"+Ai,q="__reactContainer$"+Ai,oe="__reactEvents$"+Ai,Te="__reactListeners$"+Ai,Le="__reactHandles$"+Ai,Ue="__reactResources$"+Ai,ct="__reactMarker$"+Ai;function at(a){delete a[mn],delete a[G],delete a[oe],delete a[Te],delete a[Le]}function st(a){var r=a[mn];if(r)return r;for(var f=a.parentNode;f;){if(r=f[q]||f[mn]){if(f=r.alternate,r.child!==null||f!==null&&f.child!==null)for(a=GC(a);a!==null;){if(f=a[mn])return f;a=GC(a)}return r}a=f,f=a.parentNode}return null}function tt(a){if(a=a[mn]||a[q]){var r=a.tag;if(r===5||r===6||r===13||r===31||r===26||r===27||r===3)return a}return null}function yt(a){var r=a.tag;if(r===5||r===26||r===27||r===6)return a.stateNode;throw Error(n(33))}function dt(a){var r=a[Ue];return r||(r=a[Ue]={hoistableStyles:new Map,hoistableScripts:new Map}),r}function k(a){a[ct]=!0}var ie=new Set,ue={};function pe(a,r){ce(a,r),ce(a+"Capture",r)}function ce(a,r){for(ue[a]=r,a=0;a<r.length;a++)ie.add(r[a])}var it=RegExp("^[: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]*$"),ut={},ht={};function xe(a){return Dt.call(ht,a)?!0:Dt.call(ut,a)?!1:it.test(a)?ht[a]=!0:(ut[a]=!0,!1)}function we(a,r,f){if(xe(r))if(f===null)a.removeAttribute(r);else{switch(typeof f){case"undefined":case"function":case"symbol":a.removeAttribute(r);return;case"boolean":var m=r.toLowerCase().slice(0,5);if(m!=="data-"&&m!=="aria-"){a.removeAttribute(r);return}}a.setAttribute(r,""+f)}}function je(a,r,f){if(f===null)a.removeAttribute(r);else{switch(typeof f){case"undefined":case"function":case"symbol":case"boolean":a.removeAttribute(r);return}a.setAttribute(r,""+f)}}function He(a,r,f,m){if(m===null)a.removeAttribute(f);else{switch(typeof m){case"undefined":case"function":case"symbol":case"boolean":a.removeAttribute(f);return}a.setAttributeNS(r,f,""+m)}}function Ve(a){switch(typeof a){case"bigint":case"boolean":case"number":case"string":case"undefined":return a;case"object":return a;default:return""}}function At(a){var r=a.type;return(a=a.nodeName)&&a.toLowerCase()==="input"&&(r==="checkbox"||r==="radio")}function Yt(a,r,f){var m=Object.getOwnPropertyDescriptor(a.constructor.prototype,r);if(!a.hasOwnProperty(r)&&typeof m<"u"&&typeof m.get=="function"&&typeof m.set=="function"){var A=m.get,E=m.set;return Object.defineProperty(a,r,{configurable:!0,get:function(){return A.call(this)},set:function(L){f=""+L,E.call(this,L)}}),Object.defineProperty(a,r,{enumerable:m.enumerable}),{getValue:function(){return f},setValue:function(L){f=""+L},stopTracking:function(){a._valueTracker=null,delete a[r]}}}}function Jt(a){if(!a._valueTracker){var r=At(a)?"checked":"value";a._valueTracker=Yt(a,r,""+a[r])}}function Tt(a){if(!a)return!1;var r=a._valueTracker;if(!r)return!0;var f=r.getValue(),m="";return a&&(m=At(a)?a.checked?"true":"false":a.value),a=m,a!==f?(r.setValue(a),!0):!1}function ft(a){if(a=a||(typeof document<"u"?document:void 0),typeof a>"u")return null;try{return a.activeElement||a.body}catch{return a.body}}var Nt=/[\n"\\]/g;function vt(a){return a.replace(Nt,function(r){return"\\"+r.charCodeAt(0).toString(16)+" "})}function un(a,r,f,m,A,E,L,Y){a.name="",L!=null&&typeof L!="function"&&typeof L!="symbol"&&typeof L!="boolean"?a.type=L:a.removeAttribute("type"),r!=null?L==="number"?(r===0&&a.value===""||a.value!=r)&&(a.value=""+Ve(r)):a.value!==""+Ve(r)&&(a.value=""+Ve(r)):L!=="submit"&&L!=="reset"||a.removeAttribute("value"),r!=null?an(a,L,Ve(r)):f!=null?an(a,L,Ve(f)):m!=null&&a.removeAttribute("value"),A==null&&E!=null&&(a.defaultChecked=!!E),A!=null&&(a.checked=A&&typeof A!="function"&&typeof A!="symbol"),Y!=null&&typeof Y!="function"&&typeof Y!="symbol"&&typeof Y!="boolean"?a.name=""+Ve(Y):a.removeAttribute("name")}function Wn(a,r,f,m,A,E,L,Y){if(E!=null&&typeof E!="function"&&typeof E!="symbol"&&typeof E!="boolean"&&(a.type=E),r!=null||f!=null){if(!(E!=="submit"&&E!=="reset"||r!=null)){Jt(a);return}f=f!=null?""+Ve(f):"",r=r!=null?""+Ve(r):f,Y||r===a.value||(a.value=r),a.defaultValue=r}m=m??A,m=typeof m!="function"&&typeof m!="symbol"&&!!m,a.checked=Y?a.checked:!!m,a.defaultChecked=!!m,L!=null&&typeof L!="function"&&typeof L!="symbol"&&typeof L!="boolean"&&(a.name=L),Jt(a)}function an(a,r,f){r==="number"&&ft(a.ownerDocument)===a||a.defaultValue===""+f||(a.defaultValue=""+f)}function Xn(a,r,f,m){if(a=a.options,r){r={};for(var A=0;A<f.length;A++)r["$"+f[A]]=!0;for(f=0;f<a.length;f++)A=r.hasOwnProperty("$"+a[f].value),a[f].selected!==A&&(a[f].selected=A),A&&m&&(a[f].defaultSelected=!0)}else{for(f=""+Ve(f),r=null,A=0;A<a.length;A++){if(a[A].value===f){a[A].selected=!0,m&&(a[A].defaultSelected=!0);return}r!==null||a[A].disabled||(r=a[A])}r!==null&&(r.selected=!0)}}function rn(a,r,f){if(r!=null&&(r=""+Ve(r),r!==a.value&&(a.value=r),f==null)){a.defaultValue!==r&&(a.defaultValue=r);return}a.defaultValue=f!=null?""+Ve(f):""}function Pn(a,r,f,m){if(r==null){if(m!=null){if(f!=null)throw Error(n(92));if(ge(m)){if(1<m.length)throw Error(n(93));m=m[0]}f=m}f==null&&(f=""),r=f}f=Ve(r),a.defaultValue=f,m=a.textContent,m===f&&m!==""&&m!==null&&(a.value=m),Jt(a)}function jn(a,r){if(r){var f=a.firstChild;if(f&&f===a.lastChild&&f.nodeType===3){f.nodeValue=r;return}}a.textContent=r}var ri=new Set("animationIterationCount aspectRatio borderImageOutset borderImageSlice borderImageWidth boxFlex boxFlexGroup boxOrdinalGroup columnCount columns flex flexGrow flexPositive flexShrink flexNegative flexOrder gridArea gridRow gridRowEnd gridRowSpan gridRowStart gridColumn gridColumnEnd gridColumnSpan gridColumnStart fontWeight lineClamp lineHeight opacity order orphans scale tabSize widows zIndex zoom fillOpacity floodOpacity stopOpacity strokeDasharray strokeDashoffset strokeMiterlimit strokeOpacity strokeWidth MozAnimationIterationCount MozBoxFlex MozBoxFlexGroup MozLineClamp msAnimationIterationCount msFlex msZoom msFlexGrow msFlexNegative msFlexOrder msFlexPositive msFlexShrink msGridColumn msGridColumnSpan msGridRow msGridRowSpan WebkitAnimationIterationCount WebkitBoxFlex WebKitBoxFlexGroup WebkitBoxOrdinalGroup WebkitColumnCount WebkitColumns WebkitFlex WebkitFlexGrow WebkitFlexPositive WebkitFlexShrink WebkitLineClamp".split(" "));function Si(a,r,f){var m=r.indexOf("--")===0;f==null||typeof f=="boolean"||f===""?m?a.setProperty(r,""):r==="float"?a.cssFloat="":a[r]="":m?a.setProperty(r,f):typeof f!="number"||f===0||ri.has(r)?r==="float"?a.cssFloat=f:a[r]=(""+f).trim():a[r]=f+"px"}function Er(a,r,f){if(r!=null&&typeof r!="object")throw Error(n(62));if(a=a.style,f!=null){for(var m in f)!f.hasOwnProperty(m)||r!=null&&r.hasOwnProperty(m)||(m.indexOf("--")===0?a.setProperty(m,""):m==="float"?a.cssFloat="":a[m]="");for(var A in r)m=r[A],r.hasOwnProperty(A)&&f[A]!==m&&Si(a,A,m)}else for(var E in r)r.hasOwnProperty(E)&&Si(a,E,r[E])}function _s(a){if(a.indexOf("-")===-1)return!1;switch(a){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 g_=new Map([["acceptCharset","accept-charset"],["htmlFor","for"],["httpEquiv","http-equiv"],["crossOrigin","crossorigin"],["accentHeight","accent-height"],["alignmentBaseline","alignment-baseline"],["arabicForm","arabic-form"],["baselineShift","baseline-shift"],["capHeight","cap-height"],["clipPath","clip-path"],["clipRule","clip-rule"],["colorInterpolation","color-interpolation"],["colorInterpolationFilters","color-interpolation-filters"],["colorProfile","color-profile"],["colorRendering","color-rendering"],["dominantBaseline","dominant-baseline"],["enableBackground","enable-background"],["fillOpacity","fill-opacity"],["fillRule","fill-rule"],["floodColor","flood-color"],["floodOpacity","flood-opacity"],["fontFamily","font-family"],["fontSize","font-size"],["fontSizeAdjust","font-size-adjust"],["fontStretch","font-stretch"],["fontStyle","font-style"],["fontVariant","font-variant"],["fontWeight","font-weight"],["glyphName","glyph-name"],["glyphOrientationHorizontal","glyph-orientation-horizontal"],["glyphOrientationVertical","glyph-orientation-vertical"],["horizAdvX","horiz-adv-x"],["horizOriginX","horiz-origin-x"],["imageRendering","image-rendering"],["letterSpacing","letter-spacing"],["lightingColor","lighting-color"],["markerEnd","marker-end"],["markerMid","marker-mid"],["markerStart","marker-start"],["overlinePosition","overline-position"],["overlineThickness","overline-thickness"],["paintOrder","paint-order"],["panose-1","panose-1"],["pointerEvents","pointer-events"],["renderingIntent","rendering-intent"],["shapeRendering","shape-rendering"],["stopColor","stop-color"],["stopOpacity","stop-opacity"],["strikethroughPosition","strikethrough-position"],["strikethroughThickness","strikethrough-thickness"],["strokeDasharray","stroke-dasharray"],["strokeDashoffset","stroke-dashoffset"],["strokeLinecap","stroke-linecap"],["strokeLinejoin","stroke-linejoin"],["strokeMiterlimit","stroke-miterlimit"],["strokeOpacity","stroke-opacity"],["strokeWidth","stroke-width"],["textAnchor","text-anchor"],["textDecoration","text-decoration"],["textRendering","text-rendering"],["transformOrigin","transform-origin"],["underlinePosition","underline-position"],["underlineThickness","underline-thickness"],["unicodeBidi","unicode-bidi"],["unicodeRange","unicode-range"],["unitsPerEm","units-per-em"],["vAlphabetic","v-alphabetic"],["vHanging","v-hanging"],["vIdeographic","v-ideographic"],["vMathematical","v-mathematical"],["vectorEffect","vector-effect"],["vertAdvY","vert-adv-y"],["vertOriginX","vert-origin-x"],["vertOriginY","vert-origin-y"],["wordSpacing","word-spacing"],["writingMode","writing-mode"],["xmlnsXlink","xmlns:xlink"],["xHeight","x-height"]]),v_=/^[\u0000-\u001F ]*j[\r\n\t]*a[\r\n\t]*v[\r\n\t]*a[\r\n\t]*s[\r\n\t]*c[\r\n\t]*r[\r\n\t]*i[\r\n\t]*p[\r\n\t]*t[\r\n\t]*:/i;function af(a){return v_.test(""+a)?"javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')":a}function Tr(){}var sf=null;function Xh(a){return a=a.target||a.srcElement||window,a.correspondingUseElement&&(a=a.correspondingUseElement),a.nodeType===3?a.parentNode:a}var Dl=null,Lo=null;function am(a){var r=tt(a);if(r&&(a=r.stateNode)){var f=a[G]||null;e:switch(a=r.stateNode,r.type){case"input":if(un(a,f.value,f.defaultValue,f.defaultValue,f.checked,f.defaultChecked,f.type,f.name),r=f.name,f.type==="radio"&&r!=null){for(f=a;f.parentNode;)f=f.parentNode;for(f=f.querySelectorAll('input[name="'+vt(""+r)+'"][type="radio"]'),r=0;r<f.length;r++){var m=f[r];if(m!==a&&m.form===a.form){var A=m[G]||null;if(!A)throw Error(n(90));un(m,A.value,A.defaultValue,A.defaultValue,A.checked,A.defaultChecked,A.type,A.name)}}for(r=0;r<f.length;r++)m=f[r],m.form===a.form&&Tt(m)}break e;case"textarea":rn(a,f.value,f.defaultValue);break e;case"select":r=f.value,r!=null&&Xn(a,!!f.multiple,r,!1)}}}var Yh=!1;function sm(a,r,f){if(Yh)return a(r,f);Yh=!0;try{var m=a(r);return m}finally{if(Yh=!1,(Dl!==null||Lo!==null)&&(J(),Dl&&(r=Dl,a=Lo,Lo=Dl=null,am(r),a)))for(r=0;r<a.length;r++)am(a[r])}}function Nl(a,r){var f=a.stateNode;if(f===null)return null;var m=f[G]||null;if(m===null)return null;f=m[r];e:switch(r){case"onClick":case"onClickCapture":case"onDoubleClick":case"onDoubleClickCapture":case"onMouseDown":case"onMouseDownCapture":case"onMouseMove":case"onMouseMoveCapture":case"onMouseUp":case"onMouseUpCapture":case"onMouseEnter":(m=!m.disabled)||(a=a.type,m=!(a==="button"||a==="input"||a==="select"||a==="textarea")),a=!m;break e;default:a=!1}if(a)return null;if(f&&typeof f!="function")throw Error(n(231,r,typeof f));return f}var Cr=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),Jh=!1;if(Cr)try{var rf={};Object.defineProperty(rf,"passive",{get:function(){Jh=!0}}),window.addEventListener("test",rf,rf),window.removeEventListener("test",rf,rf)}catch{Jh=!1}var Oo=null,qh=null,Io=null;function Kh(){if(Io)return Io;var a,r=qh,f=r.length,m,A="value"in Oo?Oo.value:Oo.textContent,E=A.length;for(a=0;a<f&&r[a]===A[a];a++);var L=f-a;for(m=1;m<=L&&r[f-m]===A[E-m];m++);return Io=A.slice(a,1<m?1-m:void 0)}function Ul(a){var r=a.keyCode;return"charCode"in a?(a=a.charCode,a===0&&r===13&&(a=13)):a=r,a===10&&(a=13),32<=a||a===13?a:0}function of(){return!0}function rm(){return!1}function Na(a){function r(f,m,A,E,L){this._reactName=f,this._targetInst=A,this.type=m,this.nativeEvent=E,this.target=L,this.currentTarget=null;for(var Y in a)a.hasOwnProperty(Y)&&(f=a[Y],this[Y]=f?f(E):E[Y]);return this.isDefaultPrevented=(E.defaultPrevented!=null?E.defaultPrevented:E.returnValue===!1)?of:rm,this.isPropagationStopped=rm,this}return v(r.prototype,{preventDefault:function(){this.defaultPrevented=!0;var f=this.nativeEvent;f&&(f.preventDefault?f.preventDefault():typeof f.returnValue!="unknown"&&(f.returnValue=!1),this.isDefaultPrevented=of)},stopPropagation:function(){var f=this.nativeEvent;f&&(f.stopPropagation?f.stopPropagation():typeof f.cancelBubble!="unknown"&&(f.cancelBubble=!0),this.isPropagationStopped=of)},persist:function(){},isPersistent:of}),r}var Fo={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(a){return a.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},lf=Na(Fo),ar=v({},Fo,{view:0,detail:0}),Wh=Na(ar),jh,cf,Dc,uf=v({},ar,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:hf,button:0,buttons:0,relatedTarget:function(a){return a.relatedTarget===void 0?a.fromElement===a.srcElement?a.toElement:a.fromElement:a.relatedTarget},movementX:function(a){return"movementX"in a?a.movementX:(a!==Dc&&(Dc&&a.type==="mousemove"?(jh=a.screenX-Dc.screenX,cf=a.screenY-Dc.screenY):cf=jh=0,Dc=a),jh)},movementY:function(a){return"movementY"in a?a.movementY:cf}}),__=Na(uf),ya=v({},uf,{dataTransfer:0}),y_=Na(ya),x_=v({},ar,{relatedTarget:0}),Zh=Na(x_),A_=v({},Fo,{animationName:0,elapsedTime:0,pseudoElement:0}),S_=Na(A_),ff=v({},Fo,{clipboardData:function(a){return"clipboardData"in a?a.clipboardData:window.clipboardData}}),om=Na(ff),M_=v({},Fo,{data:0}),lm=Na(M_),b_={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},cm={8:"Backspace",9:"Tab",12:"Clear",13:"Enter",16:"Shift",17:"Control",18:"Alt",19:"Pause",20:"CapsLock",27:"Escape",32:" ",33:"PageUp",34:"PageDown",35:"End",36:"Home",37:"ArrowLeft",38:"ArrowUp",39:"ArrowRight",40:"ArrowDown",45:"Insert",46:"Delete",112:"F1",113:"F2",114:"F3",115:"F4",116:"F5",117:"F6",118:"F7",119:"F8",120:"F9",121:"F10",122:"F11",123:"F12",144:"NumLock",145:"ScrollLock",224:"Meta"},um={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function E_(a){var r=this.nativeEvent;return r.getModifierState?r.getModifierState(a):(a=um[a])?!!r[a]:!1}function hf(){return E_}var fm=v({},ar,{key:function(a){if(a.key){var r=b_[a.key]||a.key;if(r!=="Unidentified")return r}return a.type==="keypress"?(a=Ul(a),a===13?"Enter":String.fromCharCode(a)):a.type==="keydown"||a.type==="keyup"?cm[a.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:hf,charCode:function(a){return a.type==="keypress"?Ul(a):0},keyCode:function(a){return a.type==="keydown"||a.type==="keyup"?a.keyCode:0},which:function(a){return a.type==="keypress"?Ul(a):a.type==="keydown"||a.type==="keyup"?a.keyCode:0}}),hm=Na(fm),T_=v({},uf,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),Qh=Na(T_),C_=v({},ar,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:hf}),no=Na(C_),dm=v({},Fo,{propertyName:0,elapsedTime:0,pseudoElement:0}),zS=Na(dm),R_=v({},uf,{deltaX:function(a){return"deltaX"in a?a.deltaX:"wheelDeltaX"in a?-a.wheelDeltaX:0},deltaY:function(a){return"deltaY"in a?a.deltaY:"wheelDeltaY"in a?-a.wheelDeltaY:"wheelDelta"in a?-a.wheelDelta:0},deltaZ:0,deltaMode:0}),Ho=Na(R_),io=v({},Fo,{newState:0,oldState:0}),pm=Na(io),mm=[9,13,27,32],Ll=Cr&&"CompositionEvent"in window,Po=null;Cr&&"documentMode"in document&&(Po=document.documentMode);var Ol=Cr&&"TextEvent"in window&&!Po,xa=Cr&&(!Ll||Po&&8<Po&&11>=Po),df=" ",gm=!1;function $h(a,r){switch(a){case"keyup":return mm.indexOf(r.keyCode)!==-1;case"keydown":return r.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function Nc(a){return a=a.detail,typeof a=="object"&&"data"in a?a.data:null}var Go=!1;function ed(a,r){switch(a){case"compositionend":return Nc(r);case"keypress":return r.which!==32?null:(gm=!0,df);case"textInput":return a=r.data,a===df&&gm?null:a;default:return null}}function w_(a,r){if(Go)return a==="compositionend"||!Ll&&$h(a,r)?(a=Kh(),Io=qh=Oo=null,Go=!1,a):null;switch(a){case"paste":return null;case"keypress":if(!(r.ctrlKey||r.altKey||r.metaKey)||r.ctrlKey&&r.altKey){if(r.char&&1<r.char.length)return r.char;if(r.which)return String.fromCharCode(r.which)}return null;case"compositionend":return xa&&r.locale!=="ko"?null:r.data;default:return null}}var ys={color:!0,date:!0,datetime:!0,"datetime-local":!0,email:!0,month:!0,number:!0,password:!0,range:!0,search:!0,tel:!0,text:!0,time:!0,url:!0,week:!0};function vm(a){var r=a&&a.nodeName&&a.nodeName.toLowerCase();return r==="input"?!!ys[a.type]:r==="textarea"}function td(a,r,f,m){Dl?Lo?Lo.push(m):Lo=[m]:Dl=m,r=xy(r,"onChange"),0<r.length&&(f=new lf("onChange","change",null,f,m),a.push({event:f,listeners:r}))}var Uc=null,Lc=null;function _m(a){TC(a,0)}function Oc(a){var r=yt(a);if(Tt(r))return a}function ym(a,r){if(a==="change")return r}var pf=!1;if(Cr){var Il;if(Cr){var mi="oninput"in document;if(!mi){var B_=document.createElement("div");B_.setAttribute("oninput","return;"),mi=typeof B_.oninput=="function"}Il=mi}else Il=!1;pf=Il&&(!document.documentMode||9<document.documentMode)}function D_(){Uc&&(Uc.detachEvent("onpropertychange",xm),Lc=Uc=null)}function xm(a){if(a.propertyName==="value"&&Oc(Lc)){var r=[];td(r,Lc,a,Xh(a)),sm(_m,r)}}function mf(a,r,f){a==="focusin"?(D_(),Uc=r,Lc=f,Uc.attachEvent("onpropertychange",xm)):a==="focusout"&&D_()}function zo(a){if(a==="selectionchange"||a==="keyup"||a==="keydown")return Oc(Lc)}function N_(a,r){if(a==="click")return Oc(r)}function U_(a,r){if(a==="input"||a==="change")return Oc(r)}function Fl(a,r){return a===r&&(a!==0||1/a===1/r)||a!==a&&r!==r}var gi=typeof Object.is=="function"?Object.is:Fl;function Ic(a,r){if(gi(a,r))return!0;if(typeof a!="object"||a===null||typeof r!="object"||r===null)return!1;var f=Object.keys(a),m=Object.keys(r);if(f.length!==m.length)return!1;for(m=0;m<f.length;m++){var A=f[m];if(!Dt.call(r,A)||!gi(a[A],r[A]))return!1}return!0}function Am(a){for(;a&&a.firstChild;)a=a.firstChild;return a}function Sm(a,r){var f=Am(a);a=0;for(var m;f;){if(f.nodeType===3){if(m=a+f.textContent.length,a<=r&&m>=r)return{node:f,offset:r-a};a=m}e:{for(;f;){if(f.nextSibling){f=f.nextSibling;break e}f=f.parentNode}f=void 0}f=Am(f)}}function nd(a,r){return a&&r?a===r?!0:a&&a.nodeType===3?!1:r&&r.nodeType===3?nd(a,r.parentNode):"contains"in a?a.contains(r):a.compareDocumentPosition?!!(a.compareDocumentPosition(r)&16):!1:!1}function id(a){a=a!=null&&a.ownerDocument!=null&&a.ownerDocument.defaultView!=null?a.ownerDocument.defaultView:window;for(var r=ft(a.document);r instanceof a.HTMLIFrameElement;){try{var f=typeof r.contentWindow.location.href=="string"}catch{f=!1}if(f)a=r.contentWindow;else break;r=ft(a.document)}return r}function Fc(a){var r=a&&a.nodeName&&a.nodeName.toLowerCase();return r&&(r==="input"&&(a.type==="text"||a.type==="search"||a.type==="tel"||a.type==="url"||a.type==="password")||r==="textarea"||a.contentEditable==="true")}var L_=Cr&&"documentMode"in document&&11>=document.documentMode,Hc=null,ad=null,Pc=null,xs=!1;function sd(a,r,f){var m=f.window===f?f.document:f.nodeType===9?f:f.ownerDocument;xs||Hc==null||Hc!==ft(m)||(m=Hc,"selectionStart"in m&&Fc(m)?m={start:m.selectionStart,end:m.selectionEnd}:(m=(m.ownerDocument&&m.ownerDocument.defaultView||window).getSelection(),m={anchorNode:m.anchorNode,anchorOffset:m.anchorOffset,focusNode:m.focusNode,focusOffset:m.focusOffset}),Pc&&Ic(Pc,m)||(Pc=m,m=xy(ad,"onSelect"),0<m.length&&(r=new lf("onSelect","select",null,r,f),a.push({event:r,listeners:m}),r.target=Hc)))}function Vo(a,r){var f={};return f[a.toLowerCase()]=r.toLowerCase(),f["Webkit"+a]="webkit"+r,f["Moz"+a]="moz"+r,f}var Gc={animationend:Vo("Animation","AnimationEnd"),animationiteration:Vo("Animation","AnimationIteration"),animationstart:Vo("Animation","AnimationStart"),transitionrun:Vo("Transition","TransitionRun"),transitionstart:Vo("Transition","TransitionStart"),transitioncancel:Vo("Transition","TransitionCancel"),transitionend:Vo("Transition","TransitionEnd")},gf={},Va={};Cr&&(Va=document.createElement("div").style,"AnimationEvent"in window||(delete Gc.animationend.animation,delete Gc.animationiteration.animation,delete Gc.animationstart.animation),"TransitionEvent"in window||delete Gc.transitionend.transition);function ko(a){if(gf[a])return gf[a];if(!Gc[a])return a;var r=Gc[a],f;for(f in r)if(r.hasOwnProperty(f)&&f in Va)return gf[a]=r[f];return a}var es=ko("animationend"),Mm=ko("animationiteration"),Rr=ko("animationstart"),zc=ko("transitionrun"),Xo=ko("transitionstart"),bm=ko("transitioncancel"),rd=ko("transitionend"),ao=new Map,od="abort auxClick beforeToggle cancel canPlay canPlayThrough click close contextMenu copy cut drag dragEnd dragEnter dragExit dragLeave dragOver dragStart drop durationChange emptied encrypted ended error gotPointerCapture input invalid keyDown keyPress keyUp load loadedData loadedMetadata loadStart lostPointerCapture mouseDown mouseMove mouseOut mouseOver mouseUp paste pause play playing pointerCancel pointerDown pointerMove pointerOut pointerOver pointerUp progress rateChange reset resize seeked seeking stalled submit suspend timeUpdate touchCancel touchEnd touchStart volumeChange scroll toggle touchMove waiting wheel".split(" ");od.push("scrollEnd");function Ua(a,r){ao.set(a,r),pe(r,[a])}var Yo=typeof reportError=="function"?reportError:function(a){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var r=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof a=="object"&&a!==null&&typeof a.message=="string"?String(a.message):String(a),error:a});if(!window.dispatchEvent(r))return}else if(typeof hl=="object"&&typeof hl.emit=="function"){hl.emit("uncaughtException",a);return}console.error(a)},ra=[],Hl=0,ld=0;function Jo(){for(var a=Hl,r=ld=Hl=0;r<a;){var f=ra[r];ra[r++]=null;var m=ra[r];ra[r++]=null;var A=ra[r];ra[r++]=null;var E=ra[r];if(ra[r++]=null,m!==null&&A!==null){var L=m.pending;L===null?A.next=A:(A.next=L.next,L.next=A),m.pending=A}E!==0&&cd(f,A,E)}}function vf(a,r,f,m){ra[Hl++]=a,ra[Hl++]=r,ra[Hl++]=f,ra[Hl++]=m,ld|=m,a.lanes|=m,a=a.alternate,a!==null&&(a.lanes|=m)}function Vc(a,r,f,m){return vf(a,r,f,m),kc(a)}function qo(a,r){return vf(a,null,null,r),kc(a)}function cd(a,r,f){a.lanes|=f;var m=a.alternate;m!==null&&(m.lanes|=f);for(var A=!1,E=a.return;E!==null;)E.childLanes|=f,m=E.alternate,m!==null&&(m.childLanes|=f),E.tag===22&&(a=E.stateNode,a===null||a._visibility&1||(A=!0)),a=E,E=E.return;return a.tag===3?(E=a.stateNode,A&&r!==null&&(A=31-bt(f),a=E.hiddenUpdates,m=a[A],m===null?a[A]=[r]:m.push(r),r.lane=f|536870912),E):null}function kc(a){if(50<tc)throw tc=0,nc=null,Error(n(185));for(var r=a.return;r!==null;)a=r,r=a.return;return a.tag===3?a.stateNode:null}var Ko={};function O_(a,r,f,m){this.tag=a,this.key=f,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.refCleanup=this.ref=null,this.pendingProps=r,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=m,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function ka(a,r,f,m){return new O_(a,r,f,m)}function Xa(a){return a=a.prototype,!(!a||!a.isReactComponent)}function wr(a,r){var f=a.alternate;return f===null?(f=ka(a.tag,r,a.key,a.mode),f.elementType=a.elementType,f.type=a.type,f.stateNode=a.stateNode,f.alternate=a,a.alternate=f):(f.pendingProps=r,f.type=a.type,f.flags=0,f.subtreeFlags=0,f.deletions=null),f.flags=a.flags&65011712,f.childLanes=a.childLanes,f.lanes=a.lanes,f.child=a.child,f.memoizedProps=a.memoizedProps,f.memoizedState=a.memoizedState,f.updateQueue=a.updateQueue,r=a.dependencies,f.dependencies=r===null?null:{lanes:r.lanes,firstContext:r.firstContext},f.sibling=a.sibling,f.index=a.index,f.ref=a.ref,f.refCleanup=a.refCleanup,f}function La(a,r){a.flags&=65011714;var f=a.alternate;return f===null?(a.childLanes=0,a.lanes=r,a.child=null,a.subtreeFlags=0,a.memoizedProps=null,a.memoizedState=null,a.updateQueue=null,a.dependencies=null,a.stateNode=null):(a.childLanes=f.childLanes,a.lanes=f.lanes,a.child=f.child,a.subtreeFlags=0,a.deletions=null,a.memoizedProps=f.memoizedProps,a.memoizedState=f.memoizedState,a.updateQueue=f.updateQueue,a.type=f.type,r=f.dependencies,a.dependencies=r===null?null:{lanes:r.lanes,firstContext:r.firstContext}),a}function _f(a,r,f,m,A,E){var L=0;if(m=a,typeof a=="function")Xa(a)&&(L=1);else if(typeof a=="string")L=C4(a,f,ve.current)?26:a==="html"||a==="head"||a==="body"?27:5;else e:switch(a){case U:return a=ka(31,f,r,A),a.elementType=U,a.lanes=E,a;case R:return so(f.children,A,E,r);case T:L=8,A|=24;break;case M:return a=ka(12,f,r,A|2),a.elementType=M,a.lanes=E,a;case H:return a=ka(13,f,r,A),a.elementType=H,a.lanes=E,a;case O:return a=ka(19,f,r,A),a.elementType=O,a.lanes=E,a;default:if(typeof a=="object"&&a!==null)switch(a.$$typeof){case D:L=10;break e;case w:L=9;break e;case N:L=11;break e;case z:L=14;break e;case V:L=16,m=null;break e}L=29,f=Error(n(130,a===null?"null":typeof a,"")),m=null}return r=ka(L,f,r,A),r.elementType=a,r.type=m,r.lanes=E,r}function so(a,r,f,m){return a=ka(7,a,m,r),a.lanes=f,a}function ud(a,r,f){return a=ka(6,a,null,r),a.lanes=f,a}function I_(a){var r=ka(18,null,null,0);return r.stateNode=a,r}function sr(a,r,f){return r=ka(4,a.children!==null?a.children:[],a.key,r),r.lanes=f,r.stateNode={containerInfo:a.containerInfo,pendingChildren:null,implementation:a.implementation},r}var Em=new WeakMap;function ts(a,r){if(typeof a=="object"&&a!==null){var f=Em.get(a);return f!==void 0?f:(r={value:a,source:r,stack:Q(r)},Em.set(a,r),r)}return{value:a,source:r,stack:Q(r)}}var rr=[],Pl=0,yf=null,Xc=0,As=[],ns=0,Br=null,Dr=1,Nr="";function ro(a,r){rr[Pl++]=Xc,rr[Pl++]=yf,yf=a,Xc=r}function Tm(a,r,f){As[ns++]=Dr,As[ns++]=Nr,As[ns++]=Br,Br=a;var m=Dr;a=Nr;var A=32-bt(m)-1;m&=~(1<<A),f+=1;var E=32-bt(r)+A;if(30<E){var L=A-A%5;E=(m&(1<<L)-1).toString(32),m>>=L,A-=L,Dr=1<<32-bt(r)+A|f<<A|m,Nr=E+a}else Dr=1<<E|f<<A|m,Nr=a}function fd(a){a.return!==null&&(ro(a,1),Tm(a,1,0))}function Wo(a){for(;a===yf;)yf=rr[--Pl],rr[Pl]=null,Xc=rr[--Pl],rr[Pl]=null;for(;a===Br;)Br=As[--ns],As[ns]=null,Nr=As[--ns],As[ns]=null,Dr=As[--ns],As[ns]=null}function xf(a,r){As[ns++]=Dr,As[ns++]=Nr,As[ns++]=Br,Dr=r.id,Nr=r.overflow,Br=a}var oa=null,ui=null,In=!1,oo=null,la=!1,hd=Error(n(519));function Dn(a){var r=Error(n(418,1<arguments.length&&arguments[1]!==void 0&&arguments[1]?"text":"HTML",""));throw Af(ts(r,a)),hd}function dd(a){var r=a.stateNode,f=a.type,m=a.memoizedProps;switch(r[mn]=a,r[G]=m,f){case"dialog":Fn("cancel",r),Fn("close",r);break;case"iframe":case"object":case"embed":Fn("load",r);break;case"video":case"audio":for(f=0;f<_g.length;f++)Fn(_g[f],r);break;case"source":Fn("error",r);break;case"img":case"image":case"link":Fn("error",r),Fn("load",r);break;case"details":Fn("toggle",r);break;case"input":Fn("invalid",r),Wn(r,m.value,m.defaultValue,m.checked,m.defaultChecked,m.type,m.name,!0);break;case"select":Fn("invalid",r);break;case"textarea":Fn("invalid",r),Pn(r,m.value,m.defaultValue,m.children)}f=m.children,typeof f!="string"&&typeof f!="number"&&typeof f!="bigint"||r.textContent===""+f||m.suppressHydrationWarning===!0||BC(r.textContent,f)?(m.popover!=null&&(Fn("beforetoggle",r),Fn("toggle",r)),m.onScroll!=null&&Fn("scroll",r),m.onScrollEnd!=null&&Fn("scrollend",r),m.onClick!=null&&(r.onclick=Tr),r=!0):r=!1,r||Dn(a,!0)}function F_(a){for(oa=a.return;oa;)switch(oa.tag){case 5:case 31:case 13:la=!1;return;case 27:case 3:la=!0;return;default:oa=oa.return}}function Gl(a){if(a!==oa)return!1;if(!In)return F_(a),In=!0,!1;var r=a.tag,f;if((f=r!==3&&r!==27)&&((f=r===5)&&(f=a.type,f=!(f!=="form"&&f!=="button")||oM(a.type,a.memoizedProps)),f=!f),f&&ui&&Dn(a),F_(a),r===13){if(a=a.memoizedState,a=a!==null?a.dehydrated:null,!a)throw Error(n(317));ui=PC(a)}else if(r===31){if(a=a.memoizedState,a=a!==null?a.dehydrated:null,!a)throw Error(n(317));ui=PC(a)}else r===27?(r=ui,cu(a.type)?(a=hM,hM=null,ui=a):ui=r):ui=oa?kr(a.stateNode.nextSibling):null;return!0}function zl(){ui=oa=null,In=!1}function Cm(){var a=oo;return a!==null&&(Ga===null?Ga=a:Ga.push.apply(Ga,a),oo=null),a}function Af(a){oo===null?oo=[a]:oo.push(a)}var Rm=X(null),lo=null,Oa=null;function co(a,r,f){le(Rm,r._currentValue),r._currentValue=f}function zs(a){a._currentValue=Rm.current,te(Rm)}function uo(a,r,f){for(;a!==null;){var m=a.alternate;if((a.childLanes&r)!==r?(a.childLanes|=r,m!==null&&(m.childLanes|=r)):m!==null&&(m.childLanes&r)!==r&&(m.childLanes|=r),a===f)break;a=a.return}}function pd(a,r,f,m){var A=a.child;for(A!==null&&(A.return=a);A!==null;){var E=A.dependencies;if(E!==null){var L=A.child;E=E.firstContext;e:for(;E!==null;){var Y=E;E=A;for(var re=0;re<r.length;re++)if(Y.context===r[re]){E.lanes|=f,Y=E.alternate,Y!==null&&(Y.lanes|=f),uo(E.return,f,a),m||(L=null);break e}E=Y.next}}else if(A.tag===18){if(L=A.return,L===null)throw Error(n(341));L.lanes|=f,E=L.alternate,E!==null&&(E.lanes|=f),uo(L,f,a),L=null}else L=A.child;if(L!==null)L.return=A;else for(L=A;L!==null;){if(L===a){L=null;break}if(A=L.sibling,A!==null){A.return=L.return,L=A;break}L=L.return}A=L}}function jo(a,r,f,m){a=null;for(var A=r,E=!1;A!==null;){if(!E){if((A.flags&524288)!==0)E=!0;else if((A.flags&262144)!==0)break}if(A.tag===10){var L=A.alternate;if(L===null)throw Error(n(387));if(L=L.memoizedProps,L!==null){var Y=A.type;gi(A.pendingProps.value,L.value)||(a!==null?a.push(Y):a=[Y])}}else if(A===Ee.current){if(L=A.alternate,L===null)throw Error(n(387));L.memoizedState.memoizedState!==A.memoizedState.memoizedState&&(a!==null?a.push(Mg):a=[Mg])}A=A.return}a!==null&&pd(r,a,f,m),r.flags|=262144}function Yc(a){for(a=a.firstContext;a!==null;){if(!gi(a.context._currentValue,a.memoizedValue))return!0;a=a.next}return!1}function Vl(a){lo=a,Oa=null,a=a.dependencies,a!==null&&(a.firstContext=null)}function ca(a){return wm(lo,a)}function Sf(a,r){return lo===null&&Vl(a),wm(a,r)}function wm(a,r){var f=r._currentValue;if(r={context:r,memoizedValue:f,next:null},Oa===null){if(a===null)throw Error(n(308));Oa=r,a.dependencies={lanes:0,firstContext:r},a.flags|=524288}else Oa=Oa.next=r;return f}var H_=typeof AbortController<"u"?AbortController:function(){var a=[],r=this.signal={aborted:!1,addEventListener:function(f,m){a.push(m)}};this.abort=function(){r.aborted=!0,a.forEach(function(f){return f()})}},P_=s.unstable_scheduleCallback,Bm=s.unstable_NormalPriority,Qt={$$typeof:D,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function Dm(){return{controller:new H_,data:new Map,refCount:0}}function Aa(a){a.refCount--,a.refCount===0&&P_(Bm,function(){a.controller.abort()})}var kl=null,Nm=0,fo=0,or=null;function Jc(a,r){if(kl===null){var f=kl=[];Nm=0,fo=QS(),or={status:"pending",value:void 0,then:function(m){f.push(m)}}}return Nm++,r.then(Um,Um),r}function Um(){if(--Nm===0&&kl!==null){or!==null&&(or.status="fulfilled");var a=kl;kl=null,fo=0,or=null;for(var r=0;r<a.length;r++)(0,a[r])()}}function Lm(a,r){var f=[],m={status:"pending",value:null,reason:null,then:function(A){f.push(A)}};return a.then(function(){m.status="fulfilled",m.value=r;for(var A=0;A<f.length;A++)(0,f[A])(r)},function(A){for(m.status="rejected",m.reason=A,A=0;A<f.length;A++)(0,f[A])(void 0)}),m}var G_=I.S;I.S=function(a,r){ru=P(),typeof r=="object"&&r!==null&&typeof r.then=="function"&&Jc(a,r),G_!==null&&G_(a,r)};var Zo=X(null);function Ur(){var a=Zo.current;return a!==null?a:ei.pooledCache}function qc(a,r){r===null?le(Zo,Zo.current):le(Zo,r.pool)}function md(){var a=Ur();return a===null?null:{parent:Qt._currentValue,pool:a}}var Qo=Error(n(460)),Mf=Error(n(474)),lr=Error(n(542)),bf={then:function(){}};function z_(a){return a=a.status,a==="fulfilled"||a==="rejected"}function Om(a,r,f){switch(f=a[f],f===void 0?a.push(r):f!==r&&(r.then(Tr,Tr),r=f),r.status){case"fulfilled":return r.value;case"rejected":throw a=r.reason,Im(a),a;default:if(typeof r.status=="string")r.then(Tr,Tr);else{if(a=ei,a!==null&&100<a.shellSuspendCounter)throw Error(n(482));a=r,a.status="pending",a.then(function(m){if(r.status==="pending"){var A=r;A.status="fulfilled",A.value=m}},function(m){if(r.status==="pending"){var A=r;A.status="rejected",A.reason=m}})}switch(r.status){case"fulfilled":return r.value;case"rejected":throw a=r.reason,Im(a),a}throw ln=r,Qo}}function Xl(a){try{var r=a._init;return r(a._payload)}catch(f){throw f!==null&&typeof f=="object"&&typeof f.then=="function"?(ln=f,Qo):f}}var ln=null;function gd(){if(ln===null)throw Error(n(459));var a=ln;return ln=null,a}function Im(a){if(a===Qo||a===lr)throw Error(n(483))}var $o=null,el=0;function vd(a){var r=el;return el+=1,$o===null&&($o=[]),Om($o,a,r)}function Ef(a,r){r=r.props.ref,a.ref=r!==void 0?r:null}function Tf(a,r){throw r.$$typeof===y?Error(n(525)):(a=Object.prototype.toString.call(r),Error(n(31,a==="[object Object]"?"object with keys {"+Object.keys(r).join(", ")+"}":a)))}function Kc(a){function r(Se,me){if(a){var Ce=Se.deletions;Ce===null?(Se.deletions=[me],Se.flags|=16):Ce.push(me)}}function f(Se,me){if(!a)return null;for(;me!==null;)r(Se,me),me=me.sibling;return null}function m(Se){for(var me=new Map;Se!==null;)Se.key!==null?me.set(Se.key,Se):me.set(Se.index,Se),Se=Se.sibling;return me}function A(Se,me){return Se=wr(Se,me),Se.index=0,Se.sibling=null,Se}function E(Se,me,Ce){return Se.index=Ce,a?(Ce=Se.alternate,Ce!==null?(Ce=Ce.index,Ce<me?(Se.flags|=67108866,me):Ce):(Se.flags|=67108866,me)):(Se.flags|=1048576,me)}function L(Se){return a&&Se.alternate===null&&(Se.flags|=67108866),Se}function Y(Se,me,Ce,Ze){return me===null||me.tag!==6?(me=ud(Ce,Se.mode,Ze),me.return=Se,me):(me=A(me,Ce),me.return=Se,me)}function re(Se,me,Ce,Ze){var sn=Ce.type;return sn===R?Xe(Se,me,Ce.props.children,Ze,Ce.key):me!==null&&(me.elementType===sn||typeof sn=="object"&&sn!==null&&sn.$$typeof===V&&Xl(sn)===me.type)?(me=A(me,Ce.props),Ef(me,Ce),me.return=Se,me):(me=_f(Ce.type,Ce.key,Ce.props,null,Se.mode,Ze),Ef(me,Ce),me.return=Se,me)}function Re(Se,me,Ce,Ze){return me===null||me.tag!==4||me.stateNode.containerInfo!==Ce.containerInfo||me.stateNode.implementation!==Ce.implementation?(me=sr(Ce,Se.mode,Ze),me.return=Se,me):(me=A(me,Ce.children||[]),me.return=Se,me)}function Xe(Se,me,Ce,Ze,sn){return me===null||me.tag!==7?(me=so(Ce,Se.mode,Ze,sn),me.return=Se,me):(me=A(me,Ce),me.return=Se,me)}function $e(Se,me,Ce){if(typeof me=="string"&&me!==""||typeof me=="number"||typeof me=="bigint")return me=ud(""+me,Se.mode,Ce),me.return=Se,me;if(typeof me=="object"&&me!==null){switch(me.$$typeof){case x:return Ce=_f(me.type,me.key,me.props,null,Se.mode,Ce),Ef(Ce,me),Ce.return=Se,Ce;case b:return me=sr(me,Se.mode,Ce),me.return=Se,me;case V:return me=Xl(me),$e(Se,me,Ce)}if(ge(me)||ne(me))return me=so(me,Se.mode,Ce,null),me.return=Se,me;if(typeof me.then=="function")return $e(Se,vd(me),Ce);if(me.$$typeof===D)return $e(Se,Sf(Se,me),Ce);Tf(Se,me)}return null}function De(Se,me,Ce,Ze){var sn=me!==null?me.key:null;if(typeof Ce=="string"&&Ce!==""||typeof Ce=="number"||typeof Ce=="bigint")return sn!==null?null:Y(Se,me,""+Ce,Ze);if(typeof Ce=="object"&&Ce!==null){switch(Ce.$$typeof){case x:return Ce.key===sn?re(Se,me,Ce,Ze):null;case b:return Ce.key===sn?Re(Se,me,Ce,Ze):null;case V:return Ce=Xl(Ce),De(Se,me,Ce,Ze)}if(ge(Ce)||ne(Ce))return sn!==null?null:Xe(Se,me,Ce,Ze,null);if(typeof Ce.then=="function")return De(Se,me,vd(Ce),Ze);if(Ce.$$typeof===D)return De(Se,me,Sf(Se,Ce),Ze);Tf(Se,Ce)}return null}function Pe(Se,me,Ce,Ze,sn){if(typeof Ze=="string"&&Ze!==""||typeof Ze=="number"||typeof Ze=="bigint")return Se=Se.get(Ce)||null,Y(me,Se,""+Ze,sn);if(typeof Ze=="object"&&Ze!==null){switch(Ze.$$typeof){case x:return Se=Se.get(Ze.key===null?Ce:Ze.key)||null,re(me,Se,Ze,sn);case b:return Se=Se.get(Ze.key===null?Ce:Ze.key)||null,Re(me,Se,Ze,sn);case V:return Ze=Xl(Ze),Pe(Se,me,Ce,Ze,sn)}if(ge(Ze)||ne(Ze))return Se=Se.get(Ce)||null,Xe(me,Se,Ze,sn,null);if(typeof Ze.then=="function")return Pe(Se,me,Ce,vd(Ze),sn);if(Ze.$$typeof===D)return Pe(Se,me,Ce,Sf(me,Ze),sn);Tf(me,Ze)}return null}function qt(Se,me,Ce,Ze){for(var sn=null,ni=null,Kt=me,Tn=me=0,Vn=null;Kt!==null&&Tn<Ce.length;Tn++){Kt.index>Tn?(Vn=Kt,Kt=null):Vn=Kt.sibling;var ii=De(Se,Kt,Ce[Tn],Ze);if(ii===null){Kt===null&&(Kt=Vn);break}a&&Kt&&ii.alternate===null&&r(Se,Kt),me=E(ii,me,Tn),ni===null?sn=ii:ni.sibling=ii,ni=ii,Kt=Vn}if(Tn===Ce.length)return f(Se,Kt),In&&ro(Se,Tn),sn;if(Kt===null){for(;Tn<Ce.length;Tn++)Kt=$e(Se,Ce[Tn],Ze),Kt!==null&&(me=E(Kt,me,Tn),ni===null?sn=Kt:ni.sibling=Kt,ni=Kt);return In&&ro(Se,Tn),sn}for(Kt=m(Kt);Tn<Ce.length;Tn++)Vn=Pe(Kt,Se,Tn,Ce[Tn],Ze),Vn!==null&&(a&&Vn.alternate!==null&&Kt.delete(Vn.key===null?Tn:Vn.key),me=E(Vn,me,Tn),ni===null?sn=Vn:ni.sibling=Vn,ni=Vn);return a&&Kt.forEach(function(pu){return r(Se,pu)}),In&&ro(Se,Tn),sn}function cn(Se,me,Ce,Ze){if(Ce==null)throw Error(n(151));for(var sn=null,ni=null,Kt=me,Tn=me=0,Vn=null,ii=Ce.next();Kt!==null&&!ii.done;Tn++,ii=Ce.next()){Kt.index>Tn?(Vn=Kt,Kt=null):Vn=Kt.sibling;var pu=De(Se,Kt,ii.value,Ze);if(pu===null){Kt===null&&(Kt=Vn);break}a&&Kt&&pu.alternate===null&&r(Se,Kt),me=E(pu,me,Tn),ni===null?sn=pu:ni.sibling=pu,ni=pu,Kt=Vn}if(ii.done)return f(Se,Kt),In&&ro(Se,Tn),sn;if(Kt===null){for(;!ii.done;Tn++,ii=Ce.next())ii=$e(Se,ii.value,Ze),ii!==null&&(me=E(ii,me,Tn),ni===null?sn=ii:ni.sibling=ii,ni=ii);return In&&ro(Se,Tn),sn}for(Kt=m(Kt);!ii.done;Tn++,ii=Ce.next())ii=Pe(Kt,Se,Tn,ii.value,Ze),ii!==null&&(a&&ii.alternate!==null&&Kt.delete(ii.key===null?Tn:ii.key),me=E(ii,me,Tn),ni===null?sn=ii:ni.sibling=ii,ni=ii);return a&&Kt.forEach(function(H4){return r(Se,H4)}),In&&ro(Se,Tn),sn}function di(Se,me,Ce,Ze){if(typeof Ce=="object"&&Ce!==null&&Ce.type===R&&Ce.key===null&&(Ce=Ce.props.children),typeof Ce=="object"&&Ce!==null){switch(Ce.$$typeof){case x:e:{for(var sn=Ce.key;me!==null;){if(me.key===sn){if(sn=Ce.type,sn===R){if(me.tag===7){f(Se,me.sibling),Ze=A(me,Ce.props.children),Ze.return=Se,Se=Ze;break e}}else if(me.elementType===sn||typeof sn=="object"&&sn!==null&&sn.$$typeof===V&&Xl(sn)===me.type){f(Se,me.sibling),Ze=A(me,Ce.props),Ef(Ze,Ce),Ze.return=Se,Se=Ze;break e}f(Se,me);break}else r(Se,me);me=me.sibling}Ce.type===R?(Ze=so(Ce.props.children,Se.mode,Ze,Ce.key),Ze.return=Se,Se=Ze):(Ze=_f(Ce.type,Ce.key,Ce.props,null,Se.mode,Ze),Ef(Ze,Ce),Ze.return=Se,Se=Ze)}return L(Se);case b:e:{for(sn=Ce.key;me!==null;){if(me.key===sn)if(me.tag===4&&me.stateNode.containerInfo===Ce.containerInfo&&me.stateNode.implementation===Ce.implementation){f(Se,me.sibling),Ze=A(me,Ce.children||[]),Ze.return=Se,Se=Ze;break e}else{f(Se,me);break}else r(Se,me);me=me.sibling}Ze=sr(Ce,Se.mode,Ze),Ze.return=Se,Se=Ze}return L(Se);case V:return Ce=Xl(Ce),di(Se,me,Ce,Ze)}if(ge(Ce))return qt(Se,me,Ce,Ze);if(ne(Ce)){if(sn=ne(Ce),typeof sn!="function")throw Error(n(150));return Ce=sn.call(Ce),cn(Se,me,Ce,Ze)}if(typeof Ce.then=="function")return di(Se,me,vd(Ce),Ze);if(Ce.$$typeof===D)return di(Se,me,Sf(Se,Ce),Ze);Tf(Se,Ce)}return typeof Ce=="string"&&Ce!==""||typeof Ce=="number"||typeof Ce=="bigint"?(Ce=""+Ce,me!==null&&me.tag===6?(f(Se,me.sibling),Ze=A(me,Ce),Ze.return=Se,Se=Ze):(f(Se,me),Ze=ud(Ce,Se.mode,Ze),Ze.return=Se,Se=Ze),L(Se)):f(Se,me)}return function(Se,me,Ce,Ze){try{el=0;var sn=di(Se,me,Ce,Ze);return $o=null,sn}catch(Kt){if(Kt===Qo||Kt===lr)throw Kt;var ni=ka(29,Kt,null,Se.mode);return ni.lanes=Ze,ni.return=Se,ni}}}var Yl=Kc(!0),V_=Kc(!1),tl=!1;function Fm(a){a.updateQueue={baseState:a.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function Hm(a,r){a=a.updateQueue,r.updateQueue===a&&(r.updateQueue={baseState:a.baseState,firstBaseUpdate:a.firstBaseUpdate,lastBaseUpdate:a.lastBaseUpdate,shared:a.shared,callbacks:null})}function Lr(a){return{lane:a,tag:0,payload:null,callback:null,next:null}}function ho(a,r,f){var m=a.updateQueue;if(m===null)return null;if(m=m.shared,(Gn&2)!==0){var A=m.pending;return A===null?r.next=r:(r.next=A.next,A.next=r),m.pending=r,r=kc(a),cd(a,null,f),r}return vf(a,m,r,f),kc(a)}function nl(a,r,f){if(r=r.updateQueue,r!==null&&(r=r.shared,(f&4194048)!==0)){var m=r.lanes;m&=a.pendingLanes,f|=m,r.lanes=f,ir(a,f)}}function _d(a,r){var f=a.updateQueue,m=a.alternate;if(m!==null&&(m=m.updateQueue,f===m)){var A=null,E=null;if(f=f.firstBaseUpdate,f!==null){do{var L={lane:f.lane,tag:f.tag,payload:f.payload,callback:null,next:null};E===null?A=E=L:E=E.next=L,f=f.next}while(f!==null);E===null?A=E=r:E=E.next=r}else A=E=r;f={baseState:m.baseState,firstBaseUpdate:A,lastBaseUpdate:E,shared:m.shared,callbacks:m.callbacks},a.updateQueue=f;return}a=f.lastBaseUpdate,a===null?f.firstBaseUpdate=r:a.next=r,f.lastBaseUpdate=r}var Pm=!1;function Cf(){if(Pm){var a=or;if(a!==null)throw a}}function Jl(a,r,f,m){Pm=!1;var A=a.updateQueue;tl=!1;var E=A.firstBaseUpdate,L=A.lastBaseUpdate,Y=A.shared.pending;if(Y!==null){A.shared.pending=null;var re=Y,Re=re.next;re.next=null,L===null?E=Re:L.next=Re,L=re;var Xe=a.alternate;Xe!==null&&(Xe=Xe.updateQueue,Y=Xe.lastBaseUpdate,Y!==L&&(Y===null?Xe.firstBaseUpdate=Re:Y.next=Re,Xe.lastBaseUpdate=re))}if(E!==null){var $e=A.baseState;L=0,Xe=Re=re=null,Y=E;do{var De=Y.lane&-536870913,Pe=De!==Y.lane;if(Pe?(Nn&De)===De:(m&De)===De){De!==0&&De===fo&&(Pm=!0),Xe!==null&&(Xe=Xe.next={lane:0,tag:Y.tag,payload:Y.payload,callback:null,next:null});e:{var qt=a,cn=Y;De=r;var di=f;switch(cn.tag){case 1:if(qt=cn.payload,typeof qt=="function"){$e=qt.call(di,$e,De);break e}$e=qt;break e;case 3:qt.flags=qt.flags&-65537|128;case 0:if(qt=cn.payload,De=typeof qt=="function"?qt.call(di,$e,De):qt,De==null)break e;$e=v({},$e,De);break e;case 2:tl=!0}}De=Y.callback,De!==null&&(a.flags|=64,Pe&&(a.flags|=8192),Pe=A.callbacks,Pe===null?A.callbacks=[De]:Pe.push(De))}else Pe={lane:De,tag:Y.tag,payload:Y.payload,callback:Y.callback,next:null},Xe===null?(Re=Xe=Pe,re=$e):Xe=Xe.next=Pe,L|=De;if(Y=Y.next,Y===null){if(Y=A.shared.pending,Y===null)break;Pe=Y,Y=Pe.next,Pe.next=null,A.lastBaseUpdate=Pe,A.shared.pending=null}}while(!0);Xe===null&&(re=$e),A.baseState=re,A.firstBaseUpdate=Re,A.lastBaseUpdate=Xe,E===null&&(A.shared.lanes=0),Ns|=L,a.lanes=L,a.memoizedState=$e}}function Or(a,r){if(typeof a!="function")throw Error(n(191,a));a.call(r)}function Sa(a,r){var f=a.callbacks;if(f!==null)for(a.callbacks=null,a=0;a<f.length;a++)Or(f[a],r)}var Ss=X(null),Ya=X(0);function Gm(a,r){a=Vi,le(Ya,a),le(Ss,r),Vi=a|r.baseLanes}function zm(){le(Ya,Vi),le(Ss,Ss.current)}function Ia(){Vi=Ya.current,te(Ss),te(Ya)}var $i=X(null),Vs=null;function il(a){var r=a.alternate;le(Bi,Bi.current&1),le($i,a),Vs===null&&(r===null||Ss.current!==null||r.memoizedState!==null)&&(Vs=a)}function Vm(a){le(Bi,Bi.current),le($i,a),Vs===null&&(Vs=a)}function k_(a){a.tag===22?(le(Bi,Bi.current),le($i,a),Vs===null&&(Vs=a)):po()}function po(){le(Bi,Bi.current),le($i,$i.current)}function Ms(a){te($i),Vs===a&&(Vs=null),te(Bi)}var Bi=X(0);function yd(a){for(var r=a;r!==null;){if(r.tag===13){var f=r.memoizedState;if(f!==null&&(f=f.dehydrated,f===null||uM(f)||fM(f)))return r}else if(r.tag===19&&(r.memoizedProps.revealOrder==="forwards"||r.memoizedProps.revealOrder==="backwards"||r.memoizedProps.revealOrder==="unstable_legacy-backwards"||r.memoizedProps.revealOrder==="together")){if((r.flags&128)!==0)return r}else if(r.child!==null){r.child.return=r,r=r.child;continue}if(r===a)break;for(;r.sibling===null;){if(r.return===null||r.return===a)return null;r=r.return}r.sibling.return=r.return,r=r.sibling}return null}var is=0,fn=null,oi=null,Ki=null,xd=!1,Ir=!1,ql=!1,Ad=0,Rf=0,Fr=null,VS=0;function Di(){throw Error(n(321))}function km(a,r){if(r===null)return!1;for(var f=0;f<r.length&&f<a.length;f++)if(!gi(a[f],r[f]))return!1;return!0}function Xm(a,r,f,m,A,E){return is=E,fn=r,r.memoizedState=null,r.updateQueue=null,r.lanes=0,I.H=a===null||a.memoizedState===null?cy:Zc,ql=!1,E=f(m,A),ql=!1,Ir&&(E=Y_(r,f,m,A)),X_(a),E}function X_(a){I.H=Uf;var r=oi!==null&&oi.next!==null;if(is=0,Ki=oi=fn=null,xd=!1,Rf=0,Fr=null,r)throw Error(n(300));a===null||vi||(a=a.dependencies,a!==null&&Yc(a)&&(vi=!0))}function Y_(a,r,f,m){fn=a;var A=0;do{if(Ir&&(Fr=null),Rf=0,Ir=!1,25<=A)throw Error(n(301));if(A+=1,Ki=oi=null,a.updateQueue!=null){var E=a.updateQueue;E.lastEffect=null,E.events=null,E.stores=null,E.memoCache!=null&&(E.memoCache.index=0)}I.H=Lf,E=r(f,m)}while(Ir);return E}function kS(){var a=I.H,r=a.useState()[0];return r=typeof r.then=="function"?Bf(r):r,a=a.useState()[0],(oi!==null?oi.memoizedState:null)!==a&&(fn.flags|=1024),r}function Ym(){var a=Ad!==0;return Ad=0,a}function Jm(a,r,f){r.updateQueue=a.updateQueue,r.flags&=-2053,a.lanes&=~f}function qm(a){if(xd){for(a=a.memoizedState;a!==null;){var r=a.queue;r!==null&&(r.pending=null),a=a.next}xd=!1}is=0,Ki=oi=fn=null,Ir=!1,Rf=Ad=0,Fr=null}function Ja(){var a={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return Ki===null?fn.memoizedState=Ki=a:Ki=Ki.next=a,Ki}function Hi(){if(oi===null){var a=fn.alternate;a=a!==null?a.memoizedState:null}else a=oi.next;var r=Ki===null?fn.memoizedState:Ki.next;if(r!==null)Ki=r,oi=a;else{if(a===null)throw fn.alternate===null?Error(n(467)):Error(n(310));oi=a,a={memoizedState:oi.memoizedState,baseState:oi.baseState,baseQueue:oi.baseQueue,queue:oi.queue,next:null},Ki===null?fn.memoizedState=Ki=a:Ki=Ki.next=a}return Ki}function wf(){return{lastEffect:null,events:null,stores:null,memoCache:null}}function Bf(a){var r=Rf;return Rf+=1,Fr===null&&(Fr=[]),a=Om(Fr,a,r),r=fn,(Ki===null?r.memoizedState:Ki.next)===null&&(r=r.alternate,I.H=r===null||r.memoizedState===null?cy:Zc),a}function Sd(a){if(a!==null&&typeof a=="object"){if(typeof a.then=="function")return Bf(a);if(a.$$typeof===D)return ca(a)}throw Error(n(438,String(a)))}function Km(a){var r=null,f=fn.updateQueue;if(f!==null&&(r=f.memoCache),r==null){var m=fn.alternate;m!==null&&(m=m.updateQueue,m!==null&&(m=m.memoCache,m!=null&&(r={data:m.data.map(function(A){return A.slice()}),index:0})))}if(r==null&&(r={data:[],index:0}),f===null&&(f=wf(),fn.updateQueue=f),f.memoCache=r,f=r.data[r.index],f===void 0)for(f=r.data[r.index]=Array(a),m=0;m<a;m++)f[m]=F;return r.index++,f}function mo(a,r){return typeof r=="function"?r(a):r}function Md(a){var r=Hi();return Wm(r,oi,a)}function Wm(a,r,f){var m=a.queue;if(m===null)throw Error(n(311));m.lastRenderedReducer=f;var A=a.baseQueue,E=m.pending;if(E!==null){if(A!==null){var L=A.next;A.next=E.next,E.next=L}r.baseQueue=A=E,m.pending=null}if(E=a.baseState,A===null)a.memoizedState=E;else{r=A.next;var Y=L=null,re=null,Re=r,Xe=!1;do{var $e=Re.lane&-536870913;if($e!==Re.lane?(Nn&$e)===$e:(is&$e)===$e){var De=Re.revertLane;if(De===0)re!==null&&(re=re.next={lane:0,revertLane:0,gesture:null,action:Re.action,hasEagerState:Re.hasEagerState,eagerState:Re.eagerState,next:null}),$e===fo&&(Xe=!0);else if((is&De)===De){Re=Re.next,De===fo&&(Xe=!0);continue}else $e={lane:0,revertLane:Re.revertLane,gesture:null,action:Re.action,hasEagerState:Re.hasEagerState,eagerState:Re.eagerState,next:null},re===null?(Y=re=$e,L=E):re=re.next=$e,fn.lanes|=De,Ns|=De;$e=Re.action,ql&&f(E,$e),E=Re.hasEagerState?Re.eagerState:f(E,$e)}else De={lane:$e,revertLane:Re.revertLane,gesture:Re.gesture,action:Re.action,hasEagerState:Re.hasEagerState,eagerState:Re.eagerState,next:null},re===null?(Y=re=De,L=E):re=re.next=De,fn.lanes|=$e,Ns|=$e;Re=Re.next}while(Re!==null&&Re!==r);if(re===null?L=E:re.next=Y,!gi(E,a.memoizedState)&&(vi=!0,Xe&&(f=or,f!==null)))throw f;a.memoizedState=E,a.baseState=L,a.baseQueue=re,m.lastRenderedState=E}return A===null&&(m.lanes=0),[a.memoizedState,m.dispatch]}function bd(a){var r=Hi(),f=r.queue;if(f===null)throw Error(n(311));f.lastRenderedReducer=a;var m=f.dispatch,A=f.pending,E=r.memoizedState;if(A!==null){f.pending=null;var L=A=A.next;do E=a(E,L.action),L=L.next;while(L!==A);gi(E,r.memoizedState)||(vi=!0),r.memoizedState=E,r.baseQueue===null&&(r.baseState=E),f.lastRenderedState=E}return[E,m]}function jm(a,r,f){var m=fn,A=Hi(),E=In;if(E){if(f===void 0)throw Error(n(407));f=f()}else f=r();var L=!gi((oi||A).memoizedState,f);if(L&&(A.memoizedState=f,vi=!0),A=A.queue,tg(Qm.bind(null,m,A,a),[a]),A.getSnapshot!==r||L||Ki!==null&&Ki.memoizedState.tag&1){if(m.flags|=2048,Wc(9,{destroy:void 0},Zm.bind(null,m,A,f,r),null),ei===null)throw Error(n(349));E||(is&127)!==0||J_(m,r,f)}return f}function J_(a,r,f){a.flags|=16384,a={getSnapshot:r,value:f},r=fn.updateQueue,r===null?(r=wf(),fn.updateQueue=r,r.stores=[a]):(f=r.stores,f===null?r.stores=[a]:f.push(a))}function Zm(a,r,f,m){r.value=f,r.getSnapshot=m,$m(r)&&Ed(a)}function Qm(a,r,f){return f(function(){$m(r)&&Ed(a)})}function $m(a){var r=a.getSnapshot;a=a.value;try{var f=r();return!gi(a,f)}catch{return!0}}function Ed(a){var r=qo(a,2);r!==null&&u(r,a,2)}function Df(a){var r=Ja();if(typeof a=="function"){var f=a;if(a=f(),ql){wt(!0);try{f()}finally{wt(!1)}}}return r.memoizedState=r.baseState=a,r.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:mo,lastRenderedState:a},r}function q_(a,r,f,m){return a.baseState=f,Wm(a,oi,typeof m=="function"?m:mo)}function XS(a,r,f,m,A){if(go(a))throw Error(n(485));if(a=r.action,a!==null){var E={payload:A,action:a,next:null,isTransition:!0,status:"pending",value:null,reason:null,listeners:[],then:function(L){E.listeners.push(L)}};I.T!==null?f(!0):E.isTransition=!1,m(E),f=r.pending,f===null?(E.next=r.pending=E,K_(r,E)):(E.next=f.next,r.pending=f.next=E)}}function K_(a,r){var f=r.action,m=r.payload,A=a.state;if(r.isTransition){var E=I.T,L={};I.T=L;try{var Y=f(A,m),re=I.S;re!==null&&re(L,Y),W_(a,r,Y)}catch(Re){Td(a,r,Re)}finally{E!==null&&L.types!==null&&(E.types=L.types),I.T=E}}else try{E=f(A,m),W_(a,r,E)}catch(Re){Td(a,r,Re)}}function W_(a,r,f){f!==null&&typeof f=="object"&&typeof f.then=="function"?f.then(function(m){eg(a,r,m)},function(m){return Td(a,r,m)}):eg(a,r,f)}function eg(a,r,f){r.status="fulfilled",r.value=f,j_(r),a.state=f,r=a.pending,r!==null&&(f=r.next,f===r?a.pending=null:(f=f.next,r.next=f,K_(a,f)))}function Td(a,r,f){var m=a.pending;if(a.pending=null,m!==null){m=m.next;do r.status="rejected",r.reason=f,j_(r),r=r.next;while(r!==m)}a.action=null}function j_(a){a=a.listeners;for(var r=0;r<a.length;r++)(0,a[r])()}function Z_(a,r){return r}function Q_(a,r){if(In){var f=ei.formState;if(f!==null){e:{var m=fn;if(In){if(ui){t:{for(var A=ui,E=la;A.nodeType!==8;){if(!E){A=null;break t}if(A=kr(A.nextSibling),A===null){A=null;break t}}E=A.data,A=E==="F!"||E==="F"?A:null}if(A){ui=kr(A.nextSibling),m=A.data==="F!";break e}}Dn(m)}m=!1}m&&(r=f[0])}}return f=Ja(),f.memoizedState=f.baseState=r,m={pending:null,lanes:0,dispatch:null,lastRenderedReducer:Z_,lastRenderedState:r},f.queue=m,f=ly.bind(null,fn,m),m.dispatch=f,m=Df(!1),E=Nf.bind(null,fn,!1,m.queue),m=Ja(),A={state:r,dispatch:null,action:a,pending:null},m.queue=A,f=XS.bind(null,fn,A,E,f),A.dispatch=f,m.memoizedState=a,[r,f,!1]}function $_(a){var r=Hi();return ey(r,oi,a)}function ey(a,r,f){if(r=Wm(a,r,Z_)[0],a=Md(mo)[0],typeof r=="object"&&r!==null&&typeof r.then=="function")try{var m=Bf(r)}catch(L){throw L===Qo?lr:L}else m=r;r=Hi();var A=r.queue,E=A.dispatch;return f!==r.memoizedState&&(fn.flags|=2048,Wc(9,{destroy:void 0},YS.bind(null,A,f),null)),[m,E,a]}function YS(a,r){a.action=r}function ty(a){var r=Hi(),f=oi;if(f!==null)return ey(r,f,a);Hi(),r=r.memoizedState,f=Hi();var m=f.queue.dispatch;return f.memoizedState=a,[r,m,!1]}function Wc(a,r,f,m){return a={tag:a,create:f,deps:m,inst:r,next:null},r=fn.updateQueue,r===null&&(r=wf(),fn.updateQueue=r),f=r.lastEffect,f===null?r.lastEffect=a.next=a:(m=f.next,f.next=a,a.next=m,r.lastEffect=a),a}function ny(){return Hi().memoizedState}function Cd(a,r,f,m){var A=Ja();fn.flags|=a,A.memoizedState=Wc(1|r,{destroy:void 0},f,m===void 0?null:m)}function Rd(a,r,f,m){var A=Hi();m=m===void 0?null:m;var E=A.memoizedState.inst;oi!==null&&m!==null&&km(m,oi.memoizedState.deps)?A.memoizedState=Wc(r,E,f,m):(fn.flags|=a,A.memoizedState=Wc(1|r,E,f,m))}function iy(a,r){Cd(8390656,8,a,r)}function tg(a,r){Rd(2048,8,a,r)}function ay(a){fn.flags|=4;var r=fn.updateQueue;if(r===null)r=wf(),fn.updateQueue=r,r.events=[a];else{var f=r.events;f===null?r.events=[a]:f.push(a)}}function sy(a){var r=Hi().memoizedState;return ay({ref:r,nextImpl:a}),function(){if((Gn&2)!==0)throw Error(n(440));return r.impl.apply(void 0,arguments)}}function ry(a,r){return Rd(4,2,a,r)}function bs(a,r){return Rd(4,4,a,r)}function ng(a,r){if(typeof r=="function"){a=a();var f=r(a);return function(){typeof f=="function"?f():r(null)}}if(r!=null)return a=a(),r.current=a,function(){r.current=null}}function wd(a,r,f){f=f!=null?f.concat([a]):null,Rd(4,4,ng.bind(null,r,a),f)}function Bd(){}function ig(a,r){var f=Hi();r=r===void 0?null:r;var m=f.memoizedState;return r!==null&&km(r,m[1])?m[0]:(f.memoizedState=[a,r],a)}function ag(a,r){var f=Hi();r=r===void 0?null:r;var m=f.memoizedState;if(r!==null&&km(r,m[1]))return m[0];if(m=a(),ql){wt(!0);try{a()}finally{wt(!1)}}return f.memoizedState=[m,r],m}function sg(a,r,f){return f===void 0||(is&1073741824)!==0&&(Nn&261930)===0?a.memoizedState=r:(a.memoizedState=f,a=c(),fn.lanes|=a,Ns|=a,f)}function rg(a,r,f,m){return gi(f,r)?f:Ss.current!==null?(a=sg(a,f,m),gi(a,r)||(vi=!0),a):(is&42)===0||(is&1073741824)!==0&&(Nn&261930)===0?(vi=!0,a.memoizedState=f):(a=c(),fn.lanes|=a,Ns|=a,r)}function og(a,r,f,m,A){var E=W.p;W.p=E!==0&&8>E?E:8;var L=I.T,Y={};I.T=Y,Nf(a,!1,r,f);try{var re=A(),Re=I.S;if(Re!==null&&Re(Y,re),re!==null&&typeof re=="object"&&typeof re.then=="function"){var Xe=Lm(re,m);jc(a,r,Xe,Ka(a))}else jc(a,r,m,Ka(a))}catch($e){jc(a,r,{then:function(){},status:"rejected",reason:$e},Ka())}finally{W.p=E,L!==null&&Y.types!==null&&(L.types=Y.types),I.T=L}}function JS(){}function lg(a,r,f,m){if(a.tag!==5)throw Error(n(476));var A=oy(a).queue;og(a,A,r,ee,f===null?JS:function(){return cg(a),f(m)})}function oy(a){var r=a.memoizedState;if(r!==null)return r;r={memoizedState:ee,baseState:ee,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:mo,lastRenderedState:ee},next:null};var f={};return r.next={memoizedState:f,baseState:f,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:mo,lastRenderedState:f},next:null},a.memoizedState=r,a=a.alternate,a!==null&&(a.memoizedState=r),r}function cg(a){var r=oy(a);r.next===null&&(r=a.alternate.memoizedState),jc(a,r.next.queue,{},Ka())}function ug(){return ca(Mg)}function Ma(){return Hi().memoizedState}function fg(){return Hi().memoizedState}function qS(a){for(var r=a.return;r!==null;){switch(r.tag){case 24:case 3:var f=Ka();a=Lr(f);var m=ho(r,a,f);m!==null&&(u(m,r,f),nl(m,r,f)),r={cache:Dm()},a.payload=r;return}r=r.return}}function KS(a,r,f){var m=Ka();f={lane:m,revertLane:0,gesture:null,action:f,hasEagerState:!1,eagerState:null,next:null},go(a)?Kl(r,f):(f=Vc(a,r,f,m),f!==null&&(u(f,a,m),as(f,r,m)))}function ly(a,r,f){var m=Ka();jc(a,r,f,m)}function jc(a,r,f,m){var A={lane:m,revertLane:0,gesture:null,action:f,hasEagerState:!1,eagerState:null,next:null};if(go(a))Kl(r,A);else{var E=a.alternate;if(a.lanes===0&&(E===null||E.lanes===0)&&(E=r.lastRenderedReducer,E!==null))try{var L=r.lastRenderedState,Y=E(L,f);if(A.hasEagerState=!0,A.eagerState=Y,gi(Y,L))return vf(a,r,A,0),ei===null&&Jo(),!1}catch{}if(f=Vc(a,r,A,m),f!==null)return u(f,a,m),as(f,r,m),!0}return!1}function Nf(a,r,f,m){if(m={lane:2,revertLane:QS(),gesture:null,action:m,hasEagerState:!1,eagerState:null,next:null},go(a)){if(r)throw Error(n(479))}else r=Vc(a,f,m,2),r!==null&&u(r,a,2)}function go(a){var r=a.alternate;return a===fn||r!==null&&r===fn}function Kl(a,r){Ir=xd=!0;var f=a.pending;f===null?r.next=r:(r.next=f.next,f.next=r),a.pending=r}function as(a,r,f){if((f&4194048)!==0){var m=r.lanes;m&=a.pendingLanes,f|=m,r.lanes=f,ir(a,f)}}var Uf={readContext:ca,use:Sd,useCallback:Di,useContext:Di,useEffect:Di,useImperativeHandle:Di,useLayoutEffect:Di,useInsertionEffect:Di,useMemo:Di,useReducer:Di,useRef:Di,useState:Di,useDebugValue:Di,useDeferredValue:Di,useTransition:Di,useSyncExternalStore:Di,useId:Di,useHostTransitionStatus:Di,useFormState:Di,useActionState:Di,useOptimistic:Di,useMemoCache:Di,useCacheRefresh:Di};Uf.useEffectEvent=Di;var cy={readContext:ca,use:Sd,useCallback:function(a,r){return Ja().memoizedState=[a,r===void 0?null:r],a},useContext:ca,useEffect:iy,useImperativeHandle:function(a,r,f){f=f!=null?f.concat([a]):null,Cd(4194308,4,ng.bind(null,r,a),f)},useLayoutEffect:function(a,r){return Cd(4194308,4,a,r)},useInsertionEffect:function(a,r){Cd(4,2,a,r)},useMemo:function(a,r){var f=Ja();r=r===void 0?null:r;var m=a();if(ql){wt(!0);try{a()}finally{wt(!1)}}return f.memoizedState=[m,r],m},useReducer:function(a,r,f){var m=Ja();if(f!==void 0){var A=f(r);if(ql){wt(!0);try{f(r)}finally{wt(!1)}}}else A=r;return m.memoizedState=m.baseState=A,a={pending:null,lanes:0,dispatch:null,lastRenderedReducer:a,lastRenderedState:A},m.queue=a,a=a.dispatch=KS.bind(null,fn,a),[m.memoizedState,a]},useRef:function(a){var r=Ja();return a={current:a},r.memoizedState=a},useState:function(a){a=Df(a);var r=a.queue,f=ly.bind(null,fn,r);return r.dispatch=f,[a.memoizedState,f]},useDebugValue:Bd,useDeferredValue:function(a,r){var f=Ja();return sg(f,a,r)},useTransition:function(){var a=Df(!1);return a=og.bind(null,fn,a.queue,!0,!1),Ja().memoizedState=a,[!1,a]},useSyncExternalStore:function(a,r,f){var m=fn,A=Ja();if(In){if(f===void 0)throw Error(n(407));f=f()}else{if(f=r(),ei===null)throw Error(n(349));(Nn&127)!==0||J_(m,r,f)}A.memoizedState=f;var E={value:f,getSnapshot:r};return A.queue=E,iy(Qm.bind(null,m,E,a),[a]),m.flags|=2048,Wc(9,{destroy:void 0},Zm.bind(null,m,E,f,r),null),f},useId:function(){var a=Ja(),r=ei.identifierPrefix;if(In){var f=Nr,m=Dr;f=(m&~(1<<32-bt(m)-1)).toString(32)+f,r="_"+r+"R_"+f,f=Ad++,0<f&&(r+="H"+f.toString(32)),r+="_"}else f=VS++,r="_"+r+"r_"+f.toString(32)+"_";return a.memoizedState=r},useHostTransitionStatus:ug,useFormState:Q_,useActionState:Q_,useOptimistic:function(a){var r=Ja();r.memoizedState=r.baseState=a;var f={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return r.queue=f,r=Nf.bind(null,fn,!0,f),f.dispatch=r,[a,r]},useMemoCache:Km,useCacheRefresh:function(){return Ja().memoizedState=qS.bind(null,fn)},useEffectEvent:function(a){var r=Ja(),f={impl:a};return r.memoizedState=f,function(){if((Gn&2)!==0)throw Error(n(440));return f.impl.apply(void 0,arguments)}}},Zc={readContext:ca,use:Sd,useCallback:ig,useContext:ca,useEffect:tg,useImperativeHandle:wd,useInsertionEffect:ry,useLayoutEffect:bs,useMemo:ag,useReducer:Md,useRef:ny,useState:function(){return Md(mo)},useDebugValue:Bd,useDeferredValue:function(a,r){var f=Hi();return rg(f,oi.memoizedState,a,r)},useTransition:function(){var a=Md(mo)[0],r=Hi().memoizedState;return[typeof a=="boolean"?a:Bf(a),r]},useSyncExternalStore:jm,useId:Ma,useHostTransitionStatus:ug,useFormState:$_,useActionState:$_,useOptimistic:function(a,r){var f=Hi();return q_(f,oi,a,r)},useMemoCache:Km,useCacheRefresh:fg};Zc.useEffectEvent=sy;var Lf={readContext:ca,use:Sd,useCallback:ig,useContext:ca,useEffect:tg,useImperativeHandle:wd,useInsertionEffect:ry,useLayoutEffect:bs,useMemo:ag,useReducer:bd,useRef:ny,useState:function(){return bd(mo)},useDebugValue:Bd,useDeferredValue:function(a,r){var f=Hi();return oi===null?sg(f,a,r):rg(f,oi.memoizedState,a,r)},useTransition:function(){var a=bd(mo)[0],r=Hi().memoizedState;return[typeof a=="boolean"?a:Bf(a),r]},useSyncExternalStore:jm,useId:Ma,useHostTransitionStatus:ug,useFormState:ty,useActionState:ty,useOptimistic:function(a,r){var f=Hi();return oi!==null?q_(f,oi,a,r):(f.baseState=a,[a,f.queue.dispatch])},useMemoCache:Km,useCacheRefresh:fg};Lf.useEffectEvent=sy;function Qc(a,r,f,m){r=a.memoizedState,f=f(m,r),f=f==null?r:v({},r,f),a.memoizedState=f,a.lanes===0&&(a.updateQueue.baseState=f)}var Of={enqueueSetState:function(a,r,f){a=a._reactInternals;var m=Ka(),A=Lr(m);A.payload=r,f!=null&&(A.callback=f),r=ho(a,A,m),r!==null&&(u(r,a,m),nl(r,a,m))},enqueueReplaceState:function(a,r,f){a=a._reactInternals;var m=Ka(),A=Lr(m);A.tag=1,A.payload=r,f!=null&&(A.callback=f),r=ho(a,A,m),r!==null&&(u(r,a,m),nl(r,a,m))},enqueueForceUpdate:function(a,r){a=a._reactInternals;var f=Ka(),m=Lr(f);m.tag=2,r!=null&&(m.callback=r),r=ho(a,m,f),r!==null&&(u(r,a,f),nl(r,a,f))}};function uy(a,r,f,m,A,E,L){return a=a.stateNode,typeof a.shouldComponentUpdate=="function"?a.shouldComponentUpdate(m,E,L):r.prototype&&r.prototype.isPureReactComponent?!Ic(f,m)||!Ic(A,E):!0}function fy(a,r,f,m){a=r.state,typeof r.componentWillReceiveProps=="function"&&r.componentWillReceiveProps(f,m),typeof r.UNSAFE_componentWillReceiveProps=="function"&&r.UNSAFE_componentWillReceiveProps(f,m),r.state!==a&&Of.enqueueReplaceState(r,r.state,null)}function ba(a,r){var f=r;if("ref"in r){f={};for(var m in r)m!=="ref"&&(f[m]=r[m])}if(a=a.defaultProps){f===r&&(f=v({},f));for(var A in a)f[A]===void 0&&(f[A]=a[A])}return f}function hg(a){Yo(a)}function hy(a){console.error(a)}function Dd(a){Yo(a)}function Nd(a,r){try{var f=a.onUncaughtError;f(r.value,{componentStack:r.stack})}catch(m){setTimeout(function(){throw m})}}function dy(a,r,f){try{var m=a.onCaughtError;m(f.value,{componentStack:f.stack,errorBoundary:r.tag===1?r.stateNode:null})}catch(A){setTimeout(function(){throw A})}}function dg(a,r,f){return f=Lr(f),f.tag=3,f.payload={element:null},f.callback=function(){Nd(a,r)},f}function $c(a){return a=Lr(a),a.tag=3,a}function ss(a,r,f,m){var A=f.type.getDerivedStateFromError;if(typeof A=="function"){var E=m.value;a.payload=function(){return A(E)},a.callback=function(){dy(r,f,m)}}var L=f.stateNode;L!==null&&typeof L.componentDidCatch=="function"&&(a.callback=function(){dy(r,f,m),typeof A!="function"&&(Vr===null?Vr=new Set([this]):Vr.add(this));var Y=m.stack;this.componentDidCatch(m.value,{componentStack:Y!==null?Y:""})})}function Es(a,r,f,m,A){if(f.flags|=32768,m!==null&&typeof m=="object"&&typeof m.then=="function"){if(r=f.alternate,r!==null&&jo(r,f,A,!0),f=$i.current,f!==null){switch(f.tag){case 31:case 13:return Vs===null?gn():f.alternate===null&&ti===0&&(ti=3),f.flags&=-257,f.flags|=65536,f.lanes=A,m===bf?f.flags|=16384:(r=f.updateQueue,r===null?f.updateQueue=new Set([m]):r.add(m),WS(a,m,A)),!1;case 22:return f.flags|=65536,m===bf?f.flags|=16384:(r=f.updateQueue,r===null?(r={transitions:null,markerInstances:null,retryQueue:new Set([m])},f.updateQueue=r):(f=r.retryQueue,f===null?r.retryQueue=new Set([m]):f.add(m)),WS(a,m,A)),!1}throw Error(n(435,f.tag))}return WS(a,m,A),gn(),!1}if(In)return r=$i.current,r!==null?((r.flags&65536)===0&&(r.flags|=256),r.flags|=65536,r.lanes=A,m!==hd&&(a=Error(n(422),{cause:m}),Af(ts(a,f)))):(m!==hd&&(r=Error(n(423),{cause:m}),Af(ts(r,f))),a=a.current.alternate,a.flags|=65536,A&=-A,a.lanes|=A,m=ts(m,f),A=dg(a.stateNode,m,A),_d(a,A),ti!==4&&(ti=2)),!1;var E=Error(n(520),{cause:m});if(E=ts(E,f),dr===null?dr=[E]:dr.push(E),ti!==4&&(ti=2),r===null)return!0;m=ts(m,f),f=r;do{switch(f.tag){case 3:return f.flags|=65536,a=A&-A,f.lanes|=a,a=dg(f.stateNode,m,a),_d(f,a),!1;case 1:if(r=f.type,E=f.stateNode,(f.flags&128)===0&&(typeof r.getDerivedStateFromError=="function"||E!==null&&typeof E.componentDidCatch=="function"&&(Vr===null||!Vr.has(E))))return f.flags|=65536,A&=-A,f.lanes|=A,A=$c(A),ss(A,a,f,m),_d(f,A),!1}f=f.return}while(f!==null);return!1}var Ud=Error(n(461)),vi=!1;function Ni(a,r,f,m){r.child=a===null?V_(r,null,f,m):Yl(r,a.child,f,m)}function If(a,r,f,m,A){f=f.render;var E=r.ref;if("ref"in m){var L={};for(var Y in m)Y!=="ref"&&(L[Y]=m[Y])}else L=m;return Vl(r),m=Xm(a,r,f,L,E,A),Y=Ym(),a!==null&&!vi?(Jm(a,r,A),fr(a,r,A)):(In&&Y&&fd(r),r.flags|=1,Ni(a,r,m,A),r.child)}function Ff(a,r,f,m,A){if(a===null){var E=f.type;return typeof E=="function"&&!Xa(E)&&E.defaultProps===void 0&&f.compare===null?(r.tag=15,r.type=E,Ts(a,r,E,m,A)):(a=_f(f.type,null,m,r,r.mode,A),a.ref=r.ref,a.return=r,r.child=a)}if(E=a.child,!sl(a,A)){var L=E.memoizedProps;if(f=f.compare,f=f!==null?f:Ic,f(L,m)&&a.ref===r.ref)return fr(a,r,A)}return r.flags|=1,a=wr(E,m),a.ref=r.ref,a.return=r,r.child=a}function Ts(a,r,f,m,A){if(a!==null){var E=a.memoizedProps;if(Ic(E,m)&&a.ref===r.ref)if(vi=!1,r.pendingProps=m=E,sl(a,A))(a.flags&131072)!==0&&(vi=!0);else return r.lanes=a.lanes,fr(a,r,A)}return eu(a,r,f,m,A)}function Cs(a,r,f,m){var A=m.children,E=a!==null?a.memoizedState:null;if(a===null&&r.stateNode===null&&(r.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),m.mode==="hidden"){if((r.flags&128)!==0){if(E=E!==null?E.baseLanes|f:f,a!==null){for(m=r.child=a.child,A=0;m!==null;)A=A|m.lanes|m.childLanes,m=m.sibling;m=A&~E}else m=0,r.child=null;return Hr(a,r,E,f,m)}if((f&536870912)!==0)r.memoizedState={baseLanes:0,cachePool:null},a!==null&&qc(r,E!==null?E.cachePool:null),E!==null?Gm(r,E):zm(),k_(r);else return m=r.lanes=536870912,Hr(a,r,E!==null?E.baseLanes|f:f,f,m)}else E!==null?(qc(r,E.cachePool),Gm(r,E),po(),r.memoizedState=null):(a!==null&&qc(r,null),zm(),po());return Ni(a,r,A,f),r.child}function cr(a,r){return a!==null&&a.tag===22||r.stateNode!==null||(r.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),r.sibling}function Hr(a,r,f,m,A){var E=Ur();return E=E===null?null:{parent:Qt._currentValue,pool:E},r.memoizedState={baseLanes:f,cachePool:E},a!==null&&qc(r,null),zm(),k_(r),a!==null&&jo(a,r,m,!0),r.childLanes=A,null}function ks(a,r){return r=tu({mode:r.mode,children:r.children},a.mode),r.ref=a.ref,a.child=r,r.return=a,r}function ua(a,r,f){return Yl(r,a.child,null,f),a=ks(r,r.pendingProps),a.flags|=2,Ms(r),r.memoizedState=null,a}function Hf(a,r,f){var m=r.pendingProps,A=(r.flags&128)!==0;if(r.flags&=-129,a===null){if(In){if(m.mode==="hidden")return a=ks(r,m),r.lanes=536870912,cr(null,a);if(Vm(r),(a=ui)?(a=HC(a,la),a=a!==null&&a.data==="&"?a:null,a!==null&&(r.memoizedState={dehydrated:a,treeContext:Br!==null?{id:Dr,overflow:Nr}:null,retryLane:536870912,hydrationErrors:null},f=I_(a),f.return=r,r.child=f,oa=r,ui=null)):a=null,a===null)throw Dn(r);return r.lanes=536870912,null}return ks(r,m)}var E=a.memoizedState;if(E!==null){var L=E.dehydrated;if(Vm(r),A)if(r.flags&256)r.flags&=-257,r=ua(a,r,f);else if(r.memoizedState!==null)r.child=a.child,r.flags|=128,r=null;else throw Error(n(558));else if(vi||jo(a,r,f,!1),A=(f&a.childLanes)!==0,vi||A){if(m=ei,m!==null&&(L=_a(m,f),L!==0&&L!==E.retryLane))throw E.retryLane=L,qo(a,L),u(m,a,L),Ud;gn(),r=ua(a,r,f)}else a=E.treeContext,ui=kr(L.nextSibling),oa=r,In=!0,oo=null,la=!1,a!==null&&xf(r,a),r=ks(r,m),r.flags|=4096;return r}return a=wr(a.child,{mode:m.mode,children:m.children}),a.ref=r.ref,r.child=a,a.return=r,a}function ur(a,r){var f=r.ref;if(f===null)a!==null&&a.ref!==null&&(r.flags|=4194816);else{if(typeof f!="function"&&typeof f!="object")throw Error(n(284));(a===null||a.ref!==f)&&(r.flags|=4194816)}}function eu(a,r,f,m,A){return Vl(r),f=Xm(a,r,f,m,void 0,A),m=Ym(),a!==null&&!vi?(Jm(a,r,A),fr(a,r,A)):(In&&m&&fd(r),r.flags|=1,Ni(a,r,f,A),r.child)}function Fa(a,r,f,m,A,E){return Vl(r),r.updateQueue=null,f=Y_(r,m,f,A),X_(a),m=Ym(),a!==null&&!vi?(Jm(a,r,E),fr(a,r,E)):(In&&m&&fd(r),r.flags|=1,Ni(a,r,f,E),r.child)}function Ea(a,r,f,m,A){if(Vl(r),r.stateNode===null){var E=Ko,L=f.contextType;typeof L=="object"&&L!==null&&(E=ca(L)),E=new f(m,E),r.memoizedState=E.state!==null&&E.state!==void 0?E.state:null,E.updater=Of,r.stateNode=E,E._reactInternals=r,E=r.stateNode,E.props=m,E.state=r.memoizedState,E.refs={},Fm(r),L=f.contextType,E.context=typeof L=="object"&&L!==null?ca(L):Ko,E.state=r.memoizedState,L=f.getDerivedStateFromProps,typeof L=="function"&&(Qc(r,f,L,m),E.state=r.memoizedState),typeof f.getDerivedStateFromProps=="function"||typeof E.getSnapshotBeforeUpdate=="function"||typeof E.UNSAFE_componentWillMount!="function"&&typeof E.componentWillMount!="function"||(L=E.state,typeof E.componentWillMount=="function"&&E.componentWillMount(),typeof E.UNSAFE_componentWillMount=="function"&&E.UNSAFE_componentWillMount(),L!==E.state&&Of.enqueueReplaceState(E,E.state,null),Jl(r,m,E,A),Cf(),E.state=r.memoizedState),typeof E.componentDidMount=="function"&&(r.flags|=4194308),m=!0}else if(a===null){E=r.stateNode;var Y=r.memoizedProps,re=ba(f,Y);E.props=re;var Re=E.context,Xe=f.contextType;L=Ko,typeof Xe=="object"&&Xe!==null&&(L=ca(Xe));var $e=f.getDerivedStateFromProps;Xe=typeof $e=="function"||typeof E.getSnapshotBeforeUpdate=="function",Y=r.pendingProps!==Y,Xe||typeof E.UNSAFE_componentWillReceiveProps!="function"&&typeof E.componentWillReceiveProps!="function"||(Y||Re!==L)&&fy(r,E,m,L),tl=!1;var De=r.memoizedState;E.state=De,Jl(r,m,E,A),Cf(),Re=r.memoizedState,Y||De!==Re||tl?(typeof $e=="function"&&(Qc(r,f,$e,m),Re=r.memoizedState),(re=tl||uy(r,f,re,m,De,Re,L))?(Xe||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"&&(r.flags|=4194308)):(typeof E.componentDidMount=="function"&&(r.flags|=4194308),r.memoizedProps=m,r.memoizedState=Re),E.props=m,E.state=Re,E.context=L,m=re):(typeof E.componentDidMount=="function"&&(r.flags|=4194308),m=!1)}else{E=r.stateNode,Hm(a,r),L=r.memoizedProps,Xe=ba(f,L),E.props=Xe,$e=r.pendingProps,De=E.context,Re=f.contextType,re=Ko,typeof Re=="object"&&Re!==null&&(re=ca(Re)),Y=f.getDerivedStateFromProps,(Re=typeof Y=="function"||typeof E.getSnapshotBeforeUpdate=="function")||typeof E.UNSAFE_componentWillReceiveProps!="function"&&typeof E.componentWillReceiveProps!="function"||(L!==$e||De!==re)&&fy(r,E,m,re),tl=!1,De=r.memoizedState,E.state=De,Jl(r,m,E,A),Cf();var Pe=r.memoizedState;L!==$e||De!==Pe||tl||a!==null&&a.dependencies!==null&&Yc(a.dependencies)?(typeof Y=="function"&&(Qc(r,f,Y,m),Pe=r.memoizedState),(Xe=tl||uy(r,f,Xe,m,De,Pe,re)||a!==null&&a.dependencies!==null&&Yc(a.dependencies))?(Re||typeof E.UNSAFE_componentWillUpdate!="function"&&typeof E.componentWillUpdate!="function"||(typeof E.componentWillUpdate=="function"&&E.componentWillUpdate(m,Pe,re),typeof E.UNSAFE_componentWillUpdate=="function"&&E.UNSAFE_componentWillUpdate(m,Pe,re)),typeof E.componentDidUpdate=="function"&&(r.flags|=4),typeof E.getSnapshotBeforeUpdate=="function"&&(r.flags|=1024)):(typeof E.componentDidUpdate!="function"||L===a.memoizedProps&&De===a.memoizedState||(r.flags|=4),typeof E.getSnapshotBeforeUpdate!="function"||L===a.memoizedProps&&De===a.memoizedState||(r.flags|=1024),r.memoizedProps=m,r.memoizedState=Pe),E.props=m,E.state=Pe,E.context=re,m=Xe):(typeof E.componentDidUpdate!="function"||L===a.memoizedProps&&De===a.memoizedState||(r.flags|=4),typeof E.getSnapshotBeforeUpdate!="function"||L===a.memoizedProps&&De===a.memoizedState||(r.flags|=1024),m=!1)}return E=m,ur(a,r),m=(r.flags&128)!==0,E||m?(E=r.stateNode,f=m&&typeof f.getDerivedStateFromError!="function"?null:E.render(),r.flags|=1,a!==null&&m?(r.child=Yl(r,a.child,null,A),r.child=Yl(r,null,f,A)):Ni(a,r,f,A),r.memoizedState=E.state,a=r.child):a=fr(a,r,A),a}function Yn(a,r,f,m){return zl(),r.flags|=256,Ni(a,r,f,m),r.child}var Rs={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function Xs(a){return{baseLanes:a,cachePool:md()}}function Pf(a,r,f){return a=a!==null?a.childLanes&~f:0,r&&(a|=zn),a}function ws(a,r,f){var m=r.pendingProps,A=!1,E=(r.flags&128)!==0,L;if((L=E)||(L=a!==null&&a.memoizedState===null?!1:(Bi.current&2)!==0),L&&(A=!0,r.flags&=-129),L=(r.flags&32)!==0,r.flags&=-33,a===null){if(In){if(A?il(r):po(),(a=ui)?(a=HC(a,la),a=a!==null&&a.data!=="&"?a:null,a!==null&&(r.memoizedState={dehydrated:a,treeContext:Br!==null?{id:Dr,overflow:Nr}:null,retryLane:536870912,hydrationErrors:null},f=I_(a),f.return=r,r.child=f,oa=r,ui=null)):a=null,a===null)throw Dn(r);return fM(a)?r.lanes=32:r.lanes=536870912,null}var Y=m.children;return m=m.fallback,A?(po(),A=r.mode,Y=tu({mode:"hidden",children:Y},A),m=so(m,A,f,null),Y.return=r,m.return=r,Y.sibling=m,r.child=Y,m=r.child,m.memoizedState=Xs(f),m.childLanes=Pf(a,L,f),r.memoizedState=Rs,cr(null,m)):(il(r),al(r,Y))}var re=a.memoizedState;if(re!==null&&(Y=re.dehydrated,Y!==null)){if(E)r.flags&256?(il(r),r.flags&=-257,r=nu(a,r,f)):r.memoizedState!==null?(po(),r.child=a.child,r.flags|=128,r=null):(po(),Y=m.fallback,A=r.mode,m=tu({mode:"visible",children:m.children},A),Y=so(Y,A,f,null),Y.flags|=2,m.return=r,Y.return=r,m.sibling=Y,r.child=m,Yl(r,a.child,null,f),m=r.child,m.memoizedState=Xs(f),m.childLanes=Pf(a,L,f),r.memoizedState=Rs,r=cr(null,m));else if(il(r),fM(Y)){if(L=Y.nextSibling&&Y.nextSibling.dataset,L)var Re=L.dgst;L=Re,m=Error(n(419)),m.stack="",m.digest=L,Af({value:m,source:null,stack:null}),r=nu(a,r,f)}else if(vi||jo(a,r,f,!1),L=(f&a.childLanes)!==0,vi||L){if(L=ei,L!==null&&(m=_a(L,f),m!==0&&m!==re.retryLane))throw re.retryLane=m,qo(a,m),u(L,a,m),Ud;uM(Y)||gn(),r=nu(a,r,f)}else uM(Y)?(r.flags|=192,r.child=a.child,r=null):(a=re.treeContext,ui=kr(Y.nextSibling),oa=r,In=!0,oo=null,la=!1,a!==null&&xf(r,a),r=al(r,m.children),r.flags|=4096);return r}return A?(po(),Y=m.fallback,A=r.mode,re=a.child,Re=re.sibling,m=wr(re,{mode:"hidden",children:m.children}),m.subtreeFlags=re.subtreeFlags&65011712,Re!==null?Y=wr(Re,Y):(Y=so(Y,A,f,null),Y.flags|=2),Y.return=r,m.return=r,m.sibling=Y,r.child=m,cr(null,m),m=r.child,Y=a.child.memoizedState,Y===null?Y=Xs(f):(A=Y.cachePool,A!==null?(re=Qt._currentValue,A=A.parent!==re?{parent:re,pool:re}:A):A=md(),Y={baseLanes:Y.baseLanes|f,cachePool:A}),m.memoizedState=Y,m.childLanes=Pf(a,L,f),r.memoizedState=Rs,cr(a.child,m)):(il(r),f=a.child,a=f.sibling,f=wr(f,{mode:"visible",children:m.children}),f.return=r,f.sibling=null,a!==null&&(L=r.deletions,L===null?(r.deletions=[a],r.flags|=16):L.push(a)),r.child=f,r.memoizedState=null,f)}function al(a,r){return r=tu({mode:"visible",children:r},a.mode),r.return=a,a.child=r}function tu(a,r){return a=ka(22,a,null,r),a.lanes=0,a}function nu(a,r,f){return Yl(r,a.child,null,f),a=al(r,r.pendingProps.children),a.flags|=2,r.memoizedState=null,a}function Wl(a,r,f){a.lanes|=r;var m=a.alternate;m!==null&&(m.lanes|=r),uo(a.return,r,f)}function Gf(a,r,f,m,A,E){var L=a.memoizedState;L===null?a.memoizedState={isBackwards:r,rendering:null,renderingStartTime:0,last:m,tail:f,tailMode:A,treeForkCount:E}:(L.isBackwards=r,L.rendering=null,L.renderingStartTime=0,L.last=m,L.tail=f,L.tailMode=A,L.treeForkCount=E)}function zf(a,r,f){var m=r.pendingProps,A=m.revealOrder,E=m.tail;m=m.children;var L=Bi.current,Y=(L&2)!==0;if(Y?(L=L&1|2,r.flags|=128):L&=1,le(Bi,L),Ni(a,r,m,f),m=In?Xc:0,!Y&&a!==null&&(a.flags&128)!==0)e:for(a=r.child;a!==null;){if(a.tag===13)a.memoizedState!==null&&Wl(a,f,r);else if(a.tag===19)Wl(a,f,r);else if(a.child!==null){a.child.return=a,a=a.child;continue}if(a===r)break e;for(;a.sibling===null;){if(a.return===null||a.return===r)break e;a=a.return}a.sibling.return=a.return,a=a.sibling}switch(A){case"forwards":for(f=r.child,A=null;f!==null;)a=f.alternate,a!==null&&yd(a)===null&&(A=f),f=f.sibling;f=A,f===null?(A=r.child,r.child=null):(A=f.sibling,f.sibling=null),Gf(r,!1,A,f,E,m);break;case"backwards":case"unstable_legacy-backwards":for(f=null,A=r.child,r.child=null;A!==null;){if(a=A.alternate,a!==null&&yd(a)===null){r.child=A;break}a=A.sibling,A.sibling=f,f=A,A=a}Gf(r,!0,f,null,E,m);break;case"together":Gf(r,!1,null,null,void 0,m);break;default:r.memoizedState=null}return r.child}function fr(a,r,f){if(a!==null&&(r.dependencies=a.dependencies),Ns|=r.lanes,(f&r.childLanes)===0)if(a!==null){if(jo(a,r,f,!1),(f&r.childLanes)===0)return null}else return null;if(a!==null&&r.child!==a.child)throw Error(n(153));if(r.child!==null){for(a=r.child,f=wr(a,a.pendingProps),r.child=f,f.return=r;a.sibling!==null;)a=a.sibling,f=f.sibling=wr(a,a.pendingProps),f.return=r;f.sibling=null}return r.child}function sl(a,r){return(a.lanes&r)!==0?!0:(a=a.dependencies,!!(a!==null&&Yc(a)))}function Vf(a,r,f){switch(r.tag){case 3:lt(r,r.stateNode.containerInfo),co(r,Qt,a.memoizedState.cache),zl();break;case 27:case 5:Bt(r);break;case 4:lt(r,r.stateNode.containerInfo);break;case 10:co(r,r.type,r.memoizedProps.value);break;case 31:if(r.memoizedState!==null)return r.flags|=128,Vm(r),null;break;case 13:var m=r.memoizedState;if(m!==null)return m.dehydrated!==null?(il(r),r.flags|=128,null):(f&r.child.childLanes)!==0?ws(a,r,f):(il(r),a=fr(a,r,f),a!==null?a.sibling:null);il(r);break;case 19:var A=(a.flags&128)!==0;if(m=(f&r.childLanes)!==0,m||(jo(a,r,f,!1),m=(f&r.childLanes)!==0),A){if(m)return zf(a,r,f);r.flags|=128}if(A=r.memoizedState,A!==null&&(A.rendering=null,A.tail=null,A.lastEffect=null),le(Bi,Bi.current),m)break;return null;case 22:return r.lanes=0,Cs(a,r,f,r.pendingProps);case 24:co(r,Qt,a.memoizedState.cache)}return fr(a,r,f)}function Ld(a,r,f){if(a!==null)if(a.memoizedProps!==r.pendingProps)vi=!0;else{if(!sl(a,f)&&(r.flags&128)===0)return vi=!1,Vf(a,r,f);vi=(a.flags&131072)!==0}else vi=!1,In&&(r.flags&1048576)!==0&&Tm(r,Xc,r.index);switch(r.lanes=0,r.tag){case 16:e:{var m=r.pendingProps;if(a=Xl(r.elementType),r.type=a,typeof a=="function")Xa(a)?(m=ba(a,m),r.tag=1,r=Ea(null,r,a,m,f)):(r.tag=0,r=eu(null,r,a,m,f));else{if(a!=null){var A=a.$$typeof;if(A===N){r.tag=11,r=If(null,r,a,m,f);break e}else if(A===z){r.tag=14,r=Ff(null,r,a,m,f);break e}}throw r=ae(a)||a,Error(n(306,r,""))}}return r;case 0:return eu(a,r,r.type,r.pendingProps,f);case 1:return m=r.type,A=ba(m,r.pendingProps),Ea(a,r,m,A,f);case 3:e:{if(lt(r,r.stateNode.containerInfo),a===null)throw Error(n(387));m=r.pendingProps;var E=r.memoizedState;A=E.element,Hm(a,r),Jl(r,m,null,f);var L=r.memoizedState;if(m=L.cache,co(r,Qt,m),m!==E.cache&&pd(r,[Qt],f,!0),Cf(),m=L.element,E.isDehydrated)if(E={element:m,isDehydrated:!1,cache:L.cache},r.updateQueue.baseState=E,r.memoizedState=E,r.flags&256){r=Yn(a,r,m,f);break e}else if(m!==A){A=ts(Error(n(424)),r),Af(A),r=Yn(a,r,m,f);break e}else for(a=r.stateNode.containerInfo,a.nodeType===9?a=a.body:a=a.nodeName==="HTML"?a.ownerDocument.body:a,ui=kr(a.firstChild),oa=r,In=!0,oo=null,la=!0,f=V_(r,null,m,f),r.child=f;f;)f.flags=f.flags&-3|4096,f=f.sibling;else{if(zl(),m===A){r=fr(a,r,f);break e}Ni(a,r,m,f)}r=r.child}return r;case 26:return ur(a,r),a===null?(f=XC(r.type,null,r.pendingProps,null))?r.memoizedState=f:In||(f=r.type,a=r.pendingProps,m=Ay(he.current).createElement(f),m[mn]=r,m[G]=a,Wa(m,f,a),k(m),r.stateNode=m):r.memoizedState=XC(r.type,a.memoizedProps,r.pendingProps,a.memoizedState),null;case 27:return Bt(r),a===null&&In&&(m=r.stateNode=zC(r.type,r.pendingProps,he.current),oa=r,la=!0,A=ui,cu(r.type)?(hM=A,ui=kr(m.firstChild)):ui=A),Ni(a,r,r.pendingProps.children,f),ur(a,r),a===null&&(r.flags|=4194304),r.child;case 5:return a===null&&In&&((A=m=ui)&&(m=p4(m,r.type,r.pendingProps,la),m!==null?(r.stateNode=m,oa=r,ui=kr(m.firstChild),la=!1,A=!0):A=!1),A||Dn(r)),Bt(r),A=r.type,E=r.pendingProps,L=a!==null?a.memoizedProps:null,m=E.children,oM(A,E)?m=null:L!==null&&oM(A,L)&&(r.flags|=32),r.memoizedState!==null&&(A=Xm(a,r,kS,null,null,f),Mg._currentValue=A),ur(a,r),Ni(a,r,m,f),r.child;case 6:return a===null&&In&&((a=f=ui)&&(f=m4(f,r.pendingProps,la),f!==null?(r.stateNode=f,oa=r,ui=null,a=!0):a=!1),a||Dn(r)),null;case 13:return ws(a,r,f);case 4:return lt(r,r.stateNode.containerInfo),m=r.pendingProps,a===null?r.child=Yl(r,null,m,f):Ni(a,r,m,f),r.child;case 11:return If(a,r,r.type,r.pendingProps,f);case 7:return Ni(a,r,r.pendingProps,f),r.child;case 8:return Ni(a,r,r.pendingProps.children,f),r.child;case 12:return Ni(a,r,r.pendingProps.children,f),r.child;case 10:return m=r.pendingProps,co(r,r.type,m.value),Ni(a,r,m.children,f),r.child;case 9:return A=r.type._context,m=r.pendingProps.children,Vl(r),A=ca(A),m=m(A),r.flags|=1,Ni(a,r,m,f),r.child;case 14:return Ff(a,r,r.type,r.pendingProps,f);case 15:return Ts(a,r,r.type,r.pendingProps,f);case 19:return zf(a,r,f);case 31:return Hf(a,r,f);case 22:return Cs(a,r,f,r.pendingProps);case 24:return Vl(r),m=ca(Qt),a===null?(A=Ur(),A===null&&(A=ei,E=Dm(),A.pooledCache=E,E.refCount++,E!==null&&(A.pooledCacheLanes|=f),A=E),r.memoizedState={parent:m,cache:A},Fm(r),co(r,Qt,A)):((a.lanes&f)!==0&&(Hm(a,r),Jl(r,null,null,f),Cf()),A=a.memoizedState,E=r.memoizedState,A.parent!==m?(A={parent:m,cache:m},r.memoizedState=A,r.lanes===0&&(r.memoizedState=r.updateQueue.baseState=A),co(r,Qt,m)):(m=E.cache,co(r,Qt,m),m!==A.cache&&pd(r,[Qt],f,!0))),Ni(a,r,r.pendingProps.children,f),r.child;case 29:throw r.pendingProps}throw Error(n(156,r.tag))}function rs(a){a.flags|=4}function rl(a,r,f,m,A){if((r=(a.mode&32)!==0)&&(r=!1),r){if(a.flags|=16777216,(A&335544128)===A)if(a.stateNode.complete)a.flags|=8192;else if(St())a.flags|=8192;else throw ln=bf,Mf}else a.flags&=-16777217}function vo(a,r){if(r.type!=="stylesheet"||(r.state.loading&4)!==0)a.flags&=-16777217;else if(a.flags|=16777216,!WC(r))if(St())a.flags|=8192;else throw ln=bf,Mf}function iu(a,r){r!==null&&(a.flags|=4),a.flags&16384&&(r=a.tag!==22?wn():536870912,a.lanes|=r,Us|=r)}function kf(a,r){if(!In)switch(a.tailMode){case"hidden":r=a.tail;for(var f=null;r!==null;)r.alternate!==null&&(f=r),r=r.sibling;f===null?a.tail=null:f.sibling=null;break;case"collapsed":f=a.tail;for(var m=null;f!==null;)f.alternate!==null&&(m=f),f=f.sibling;m===null?r||a.tail===null?a.tail=null:a.tail.sibling=null:m.sibling=null}}function ai(a){var r=a.alternate!==null&&a.alternate.child===a.child,f=0,m=0;if(r)for(var A=a.child;A!==null;)f|=A.lanes|A.childLanes,m|=A.subtreeFlags&65011712,m|=A.flags&65011712,A.return=a,A=A.sibling;else for(A=a.child;A!==null;)f|=A.lanes|A.childLanes,m|=A.subtreeFlags,m|=A.flags,A.return=a,A=A.sibling;return a.subtreeFlags|=m,a.childLanes=f,r}function pg(a,r,f){var m=r.pendingProps;switch(Wo(r),r.tag){case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return ai(r),null;case 1:return ai(r),null;case 3:return f=r.stateNode,m=null,a!==null&&(m=a.memoizedState.cache),r.memoizedState.cache!==m&&(r.flags|=2048),zs(Qt),Rt(),f.pendingContext&&(f.context=f.pendingContext,f.pendingContext=null),(a===null||a.child===null)&&(Gl(r)?rs(r):a===null||a.memoizedState.isDehydrated&&(r.flags&256)===0||(r.flags|=1024,Cm())),ai(r),null;case 26:var A=r.type,E=r.memoizedState;return a===null?(rs(r),E!==null?(ai(r),vo(r,E)):(ai(r),rl(r,A,null,m,f))):E?E!==a.memoizedState?(rs(r),ai(r),vo(r,E)):(ai(r),r.flags&=-16777217):(a=a.memoizedProps,a!==m&&rs(r),ai(r),rl(r,A,a,m,f)),null;case 27:if(tn(r),f=he.current,A=r.type,a!==null&&r.stateNode!=null)a.memoizedProps!==m&&rs(r);else{if(!m){if(r.stateNode===null)throw Error(n(166));return ai(r),null}a=ve.current,Gl(r)?dd(r):(a=zC(A,m,f),r.stateNode=a,rs(r))}return ai(r),null;case 5:if(tn(r),A=r.type,a!==null&&r.stateNode!=null)a.memoizedProps!==m&&rs(r);else{if(!m){if(r.stateNode===null)throw Error(n(166));return ai(r),null}if(E=ve.current,Gl(r))dd(r);else{var L=Ay(he.current);switch(E){case 1:E=L.createElementNS("http://www.w3.org/2000/svg",A);break;case 2:E=L.createElementNS("http://www.w3.org/1998/Math/MathML",A);break;default:switch(A){case"svg":E=L.createElementNS("http://www.w3.org/2000/svg",A);break;case"math":E=L.createElementNS("http://www.w3.org/1998/Math/MathML",A);break;case"script":E=L.createElement("div"),E.innerHTML="<script><\/script>",E=E.removeChild(E.firstChild);break;case"select":E=typeof m.is=="string"?L.createElement("select",{is:m.is}):L.createElement("select"),m.multiple?E.multiple=!0:m.size&&(E.size=m.size);break;default:E=typeof m.is=="string"?L.createElement(A,{is:m.is}):L.createElement(A)}}E[mn]=r,E[G]=m;e:for(L=r.child;L!==null;){if(L.tag===5||L.tag===6)E.appendChild(L.stateNode);else if(L.tag!==4&&L.tag!==27&&L.child!==null){L.child.return=L,L=L.child;continue}if(L===r)break e;for(;L.sibling===null;){if(L.return===null||L.return===r)break e;L=L.return}L.sibling.return=L.return,L=L.sibling}r.stateNode=E;e:switch(Wa(E,A,m),A){case"button":case"input":case"select":case"textarea":m=!!m.autoFocus;break e;case"img":m=!0;break e;default:m=!1}m&&rs(r)}}return ai(r),rl(r,r.type,a===null?null:a.memoizedProps,r.pendingProps,f),null;case 6:if(a&&r.stateNode!=null)a.memoizedProps!==m&&rs(r);else{if(typeof m!="string"&&r.stateNode===null)throw Error(n(166));if(a=he.current,Gl(r)){if(a=r.stateNode,f=r.memoizedProps,m=null,A=oa,A!==null)switch(A.tag){case 27:case 5:m=A.memoizedProps}a[mn]=r,a=!!(a.nodeValue===f||m!==null&&m.suppressHydrationWarning===!0||BC(a.nodeValue,f)),a||Dn(r,!0)}else a=Ay(a).createTextNode(m),a[mn]=r,r.stateNode=a}return ai(r),null;case 31:if(f=r.memoizedState,a===null||a.memoizedState!==null){if(m=Gl(r),f!==null){if(a===null){if(!m)throw Error(n(318));if(a=r.memoizedState,a=a!==null?a.dehydrated:null,!a)throw Error(n(557));a[mn]=r}else zl(),(r.flags&128)===0&&(r.memoizedState=null),r.flags|=4;ai(r),a=!1}else f=Cm(),a!==null&&a.memoizedState!==null&&(a.memoizedState.hydrationErrors=f),a=!0;if(!a)return r.flags&256?(Ms(r),r):(Ms(r),null);if((r.flags&128)!==0)throw Error(n(558))}return ai(r),null;case 13:if(m=r.memoizedState,a===null||a.memoizedState!==null&&a.memoizedState.dehydrated!==null){if(A=Gl(r),m!==null&&m.dehydrated!==null){if(a===null){if(!A)throw Error(n(318));if(A=r.memoizedState,A=A!==null?A.dehydrated:null,!A)throw Error(n(317));A[mn]=r}else zl(),(r.flags&128)===0&&(r.memoizedState=null),r.flags|=4;ai(r),A=!1}else A=Cm(),a!==null&&a.memoizedState!==null&&(a.memoizedState.hydrationErrors=A),A=!0;if(!A)return r.flags&256?(Ms(r),r):(Ms(r),null)}return Ms(r),(r.flags&128)!==0?(r.lanes=f,r):(f=m!==null,a=a!==null&&a.memoizedState!==null,f&&(m=r.child,A=null,m.alternate!==null&&m.alternate.memoizedState!==null&&m.alternate.memoizedState.cachePool!==null&&(A=m.alternate.memoizedState.cachePool.pool),E=null,m.memoizedState!==null&&m.memoizedState.cachePool!==null&&(E=m.memoizedState.cachePool.pool),E!==A&&(m.flags|=2048)),f!==a&&f&&(r.child.flags|=8192),iu(r,r.updateQueue),ai(r),null);case 4:return Rt(),a===null&&nM(r.stateNode.containerInfo),ai(r),null;case 10:return zs(r.type),ai(r),null;case 19:if(te(Bi),m=r.memoizedState,m===null)return ai(r),null;if(A=(r.flags&128)!==0,E=m.rendering,E===null)if(A)kf(m,!1);else{if(ti!==0||a!==null&&(a.flags&128)!==0)for(a=r.child;a!==null;){if(E=yd(a),E!==null){for(r.flags|=128,kf(m,!1),a=E.updateQueue,r.updateQueue=a,iu(r,a),r.subtreeFlags=0,a=f,f=r.child;f!==null;)La(f,a),f=f.sibling;return le(Bi,Bi.current&1|2),In&&ro(r,m.treeForkCount),r.child}a=a.sibling}m.tail!==null&&P()>Ls&&(r.flags|=128,A=!0,kf(m,!1),r.lanes=4194304)}else{if(!A)if(a=yd(E),a!==null){if(r.flags|=128,A=!0,a=a.updateQueue,r.updateQueue=a,iu(r,a),kf(m,!0),m.tail===null&&m.tailMode==="hidden"&&!E.alternate&&!In)return ai(r),null}else 2*P()-m.renderingStartTime>Ls&&f!==536870912&&(r.flags|=128,A=!0,kf(m,!1),r.lanes=4194304);m.isBackwards?(E.sibling=r.child,r.child=E):(a=m.last,a!==null?a.sibling=E:r.child=E,m.last=E)}return m.tail!==null?(a=m.tail,m.rendering=a,m.tail=a.sibling,m.renderingStartTime=P(),a.sibling=null,f=Bi.current,le(Bi,A?f&1|2:f&1),In&&ro(r,m.treeForkCount),a):(ai(r),null);case 22:case 23:return Ms(r),Ia(),m=r.memoizedState!==null,a!==null?a.memoizedState!==null!==m&&(r.flags|=8192):m&&(r.flags|=8192),m?(f&536870912)!==0&&(r.flags&128)===0&&(ai(r),r.subtreeFlags&6&&(r.flags|=8192)):ai(r),f=r.updateQueue,f!==null&&iu(r,f.retryQueue),f=null,a!==null&&a.memoizedState!==null&&a.memoizedState.cachePool!==null&&(f=a.memoizedState.cachePool.pool),m=null,r.memoizedState!==null&&r.memoizedState.cachePool!==null&&(m=r.memoizedState.cachePool.pool),m!==f&&(r.flags|=2048),a!==null&&te(Zo),null;case 24:return f=null,a!==null&&(f=a.memoizedState.cache),r.memoizedState.cache!==f&&(r.flags|=2048),zs(Qt),ai(r),null;case 25:return null;case 30:return null}throw Error(n(156,r.tag))}function Od(a,r){switch(Wo(r),r.tag){case 1:return a=r.flags,a&65536?(r.flags=a&-65537|128,r):null;case 3:return zs(Qt),Rt(),a=r.flags,(a&65536)!==0&&(a&128)===0?(r.flags=a&-65537|128,r):null;case 26:case 27:case 5:return tn(r),null;case 31:if(r.memoizedState!==null){if(Ms(r),r.alternate===null)throw Error(n(340));zl()}return a=r.flags,a&65536?(r.flags=a&-65537|128,r):null;case 13:if(Ms(r),a=r.memoizedState,a!==null&&a.dehydrated!==null){if(r.alternate===null)throw Error(n(340));zl()}return a=r.flags,a&65536?(r.flags=a&-65537|128,r):null;case 19:return te(Bi),null;case 4:return Rt(),null;case 10:return zs(r.type),null;case 22:case 23:return Ms(r),Ia(),a!==null&&te(Zo),a=r.flags,a&65536?(r.flags=a&-65537|128,r):null;case 24:return zs(Qt),null;case 25:return null;default:return null}}function jl(a,r){switch(Wo(r),r.tag){case 3:zs(Qt),Rt();break;case 26:case 27:case 5:tn(r);break;case 4:Rt();break;case 31:r.memoizedState!==null&&Ms(r);break;case 13:Ms(r);break;case 19:te(Bi);break;case 10:zs(r.type);break;case 22:case 23:Ms(r),Ia(),a!==null&&te(Zo);break;case 24:zs(Qt)}}function Pr(a,r){try{var f=r.updateQueue,m=f!==null?f.lastEffect:null;if(m!==null){var A=m.next;f=A;do{if((f.tag&a)===a){m=void 0;var E=f.create,L=f.inst;m=E(),L.destroy=m}f=f.next}while(f!==A)}}catch(Y){ci(r,r.return,Y)}}function Ys(a,r,f){try{var m=r.updateQueue,A=m!==null?m.lastEffect:null;if(A!==null){var E=A.next;m=E;do{if((m.tag&a)===a){var L=m.inst,Y=L.destroy;if(Y!==void 0){L.destroy=void 0,A=r;var re=f,Re=Y;try{Re()}catch(Xe){ci(A,re,Xe)}}}m=m.next}while(m!==E)}}catch(Xe){ci(r,r.return,Xe)}}function ol(a){var r=a.updateQueue;if(r!==null){var f=a.stateNode;try{Sa(r,f)}catch(m){ci(a,a.return,m)}}}function mg(a,r,f){f.props=ba(a.type,a.memoizedProps),f.state=a.memoizedState;try{f.componentWillUnmount()}catch(m){ci(a,r,m)}}function Gr(a,r){try{var f=a.ref;if(f!==null){switch(a.tag){case 26:case 27:case 5:var m=a.stateNode;break;case 30:m=a.stateNode;break;default:m=a.stateNode}typeof f=="function"?a.refCleanup=f(m):f.current=m}}catch(A){ci(a,r,A)}}function Bs(a,r){var f=a.ref,m=a.refCleanup;if(f!==null)if(typeof m=="function")try{m()}catch(A){ci(a,r,A)}finally{a.refCleanup=null,a=a.alternate,a!=null&&(a.refCleanup=null)}else if(typeof f=="function")try{f(null)}catch(A){ci(a,r,A)}else f.current=null}function Ds(a){var r=a.type,f=a.memoizedProps,m=a.stateNode;try{e:switch(r){case"button":case"input":case"select":case"textarea":f.autoFocus&&m.focus();break e;case"img":f.src?m.src=f.src:f.srcSet&&(m.srcset=f.srcSet)}}catch(A){ci(a,a.return,A)}}function Js(a,r,f){try{var m=a.stateNode;l4(m,a.type,f,r),m[G]=r}catch(A){ci(a,a.return,A)}}function Wi(a){return a.tag===5||a.tag===3||a.tag===26||a.tag===27&&cu(a.type)||a.tag===4}function zr(a){e:for(;;){for(;a.sibling===null;){if(a.return===null||Wi(a.return))return null;a=a.return}for(a.sibling.return=a.return,a=a.sibling;a.tag!==5&&a.tag!==6&&a.tag!==18;){if(a.tag===27&&cu(a.type)||a.flags&2||a.child===null||a.tag===4)continue e;a.child.return=a,a=a.child}if(!(a.flags&2))return a.stateNode}}function xn(a,r,f){var m=a.tag;if(m===5||m===6)a=a.stateNode,r?(f.nodeType===9?f.body:f.nodeName==="HTML"?f.ownerDocument.body:f).insertBefore(a,r):(r=f.nodeType===9?f.body:f.nodeName==="HTML"?f.ownerDocument.body:f,r.appendChild(a),f=f._reactRootContainer,f!=null||r.onclick!==null||(r.onclick=Tr));else if(m!==4&&(m===27&&cu(a.type)&&(f=a.stateNode,r=null),a=a.child,a!==null))for(xn(a,r,f),a=a.sibling;a!==null;)xn(a,r,f),a=a.sibling}function Zn(a,r,f){var m=a.tag;if(m===5||m===6)a=a.stateNode,r?f.insertBefore(a,r):f.appendChild(a);else if(m!==4&&(m===27&&cu(a.type)&&(f=a.stateNode),a=a.child,a!==null))for(Zn(a,r,f),a=a.sibling;a!==null;)Zn(a,r,f),a=a.sibling}function Pi(a){var r=a.stateNode,f=a.memoizedProps;try{for(var m=a.type,A=r.attributes;A.length;)r.removeAttributeNode(A[0]);Wa(r,m,f),r[mn]=a,r[G]=f}catch(E){ci(a,a.return,E)}}var qs=!1,_i=!1,_o=!1,Xf=typeof WeakSet=="function"?WeakSet:Set,Ui=null;function au(a,r){if(a=a.containerInfo,sM=Ry,a=id(a),Fc(a)){if("selectionStart"in a)var f={start:a.selectionStart,end:a.selectionEnd};else e:{f=(f=a.ownerDocument)&&f.defaultView||window;var m=f.getSelection&&f.getSelection();if(m&&m.rangeCount!==0){f=m.anchorNode;var A=m.anchorOffset,E=m.focusNode;m=m.focusOffset;try{f.nodeType,E.nodeType}catch{f=null;break e}var L=0,Y=-1,re=-1,Re=0,Xe=0,$e=a,De=null;t:for(;;){for(var Pe;$e!==f||A!==0&&$e.nodeType!==3||(Y=L+A),$e!==E||m!==0&&$e.nodeType!==3||(re=L+m),$e.nodeType===3&&(L+=$e.nodeValue.length),(Pe=$e.firstChild)!==null;)De=$e,$e=Pe;for(;;){if($e===a)break t;if(De===f&&++Re===A&&(Y=L),De===E&&++Xe===m&&(re=L),(Pe=$e.nextSibling)!==null)break;$e=De,De=$e.parentNode}$e=Pe}f=Y===-1||re===-1?null:{start:Y,end:re}}else f=null}f=f||{start:0,end:0}}else f=null;for(rM={focusedElem:a,selectionRange:f},Ry=!1,Ui=r;Ui!==null;)if(r=Ui,a=r.child,(r.subtreeFlags&1028)!==0&&a!==null)a.return=r,Ui=a;else for(;Ui!==null;){switch(r=Ui,E=r.alternate,a=r.flags,r.tag){case 0:if((a&4)!==0&&(a=r.updateQueue,a=a!==null?a.events:null,a!==null))for(f=0;f<a.length;f++)A=a[f],A.ref.impl=A.nextImpl;break;case 11:case 15:break;case 1:if((a&1024)!==0&&E!==null){a=void 0,f=r,A=E.memoizedProps,E=E.memoizedState,m=f.stateNode;try{var qt=ba(f.type,A);a=m.getSnapshotBeforeUpdate(qt,E),m.__reactInternalSnapshotBeforeUpdate=a}catch(cn){ci(f,f.return,cn)}}break;case 3:if((a&1024)!==0){if(a=r.stateNode.containerInfo,f=a.nodeType,f===9)cM(a);else if(f===1)switch(a.nodeName){case"HEAD":case"HTML":case"BODY":cM(a);break;default:a.textContent=""}}break;case 5:case 26:case 27:case 6:case 4:case 17:break;default:if((a&1024)!==0)throw Error(n(163))}if(a=r.sibling,a!==null){a.return=r.return,Ui=a;break}Ui=r.return}}function py(a,r,f){var m=f.flags;switch(f.tag){case 0:case 11:case 15:yo(a,f),m&4&&Pr(5,f);break;case 1:if(yo(a,f),m&4)if(a=f.stateNode,r===null)try{a.componentDidMount()}catch(L){ci(f,f.return,L)}else{var A=ba(f.type,r.memoizedProps);r=r.memoizedState;try{a.componentDidUpdate(A,r,a.__reactInternalSnapshotBeforeUpdate)}catch(L){ci(f,f.return,L)}}m&64&&ol(f),m&512&&Gr(f,f.return);break;case 3:if(yo(a,f),m&64&&(a=f.updateQueue,a!==null)){if(r=null,f.child!==null)switch(f.child.tag){case 27:case 5:r=f.child.stateNode;break;case 1:r=f.child.stateNode}try{Sa(a,r)}catch(L){ci(f,f.return,L)}}break;case 27:r===null&&m&4&&Pi(f);case 26:case 5:yo(a,f),r===null&&m&4&&Ds(f),m&512&&Gr(f,f.return);break;case 12:yo(a,f);break;case 31:yo(a,f),m&4&&Fd(a,f);break;case 13:yo(a,f),m&4&&gg(a,f),m&64&&(a=f.memoizedState,a!==null&&(a=a.dehydrated,a!==null&&(f=jF.bind(null,f),g4(a,f))));break;case 22:if(m=f.memoizedState!==null||qs,!m){r=r!==null&&r.memoizedState!==null||_i,A=qs;var E=_i;qs=m,(_i=r)&&!E?$n(a,f,(f.subtreeFlags&8772)!==0):yo(a,f),qs=A,_i=E}break;case 30:break;default:yo(a,f)}}function Id(a){var r=a.alternate;r!==null&&(a.alternate=null,Id(r)),a.child=null,a.deletions=null,a.sibling=null,a.tag===5&&(r=a.stateNode,r!==null&&at(r)),a.stateNode=null,a.return=null,a.dependencies=null,a.memoizedProps=null,a.memoizedState=null,a.pendingProps=null,a.stateNode=null,a.updateQueue=null}var Jn=null,ji=!1;function Ha(a,r,f){for(f=f.child;f!==null;)ll(a,r,f),f=f.sibling}function ll(a,r,f){if(qe&&typeof qe.onCommitFiberUnmount=="function")try{qe.onCommitFiberUnmount(Ye,f)}catch{}switch(f.tag){case 26:_i||Bs(f,r),Ha(a,r,f),f.memoizedState?f.memoizedState.count--:f.stateNode&&(f=f.stateNode,f.parentNode.removeChild(f));break;case 27:_i||Bs(f,r);var m=Jn,A=ji;cu(f.type)&&(Jn=f.stateNode,ji=!1),Ha(a,r,f),xg(f.stateNode),Jn=m,ji=A;break;case 5:_i||Bs(f,r);case 6:if(m=Jn,A=ji,Jn=null,Ha(a,r,f),Jn=m,ji=A,Jn!==null)if(ji)try{(Jn.nodeType===9?Jn.body:Jn.nodeName==="HTML"?Jn.ownerDocument.body:Jn).removeChild(f.stateNode)}catch(E){ci(f,r,E)}else try{Jn.removeChild(f.stateNode)}catch(E){ci(f,r,E)}break;case 18:Jn!==null&&(ji?(a=Jn,IC(a.nodeType===9?a.body:a.nodeName==="HTML"?a.ownerDocument.body:a,f.stateNode),Kd(a)):IC(Jn,f.stateNode));break;case 4:m=Jn,A=ji,Jn=f.stateNode.containerInfo,ji=!0,Ha(a,r,f),Jn=m,ji=A;break;case 0:case 11:case 14:case 15:Ys(2,f,r),_i||Ys(4,f,r),Ha(a,r,f);break;case 1:_i||(Bs(f,r),m=f.stateNode,typeof m.componentWillUnmount=="function"&&mg(f,r,m)),Ha(a,r,f);break;case 21:Ha(a,r,f);break;case 22:_i=(m=_i)||f.memoizedState!==null,Ha(a,r,f),_i=m;break;default:Ha(a,r,f)}}function Fd(a,r){if(r.memoizedState===null&&(a=r.alternate,a!==null&&(a=a.memoizedState,a!==null))){a=a.dehydrated;try{Kd(a)}catch(f){ci(r,r.return,f)}}}function gg(a,r){if(r.memoizedState===null&&(a=r.alternate,a!==null&&(a=a.memoizedState,a!==null&&(a=a.dehydrated,a!==null))))try{Kd(a)}catch(f){ci(r,r.return,f)}}function my(a){switch(a.tag){case 31:case 13:case 19:var r=a.stateNode;return r===null&&(r=a.stateNode=new Xf),r;case 22:return a=a.stateNode,r=a._retryCache,r===null&&(r=a._retryCache=new Xf),r;default:throw Error(n(435,a.tag))}}function Gi(a,r){var f=my(a);r.forEach(function(m){if(!f.has(m)){f.add(m);var A=ZF.bind(null,a,m);m.then(A,A)}})}function Pa(a,r){var f=r.deletions;if(f!==null)for(var m=0;m<f.length;m++){var A=f[m],E=a,L=r,Y=L;e:for(;Y!==null;){switch(Y.tag){case 27:if(cu(Y.type)){Jn=Y.stateNode,ji=!1;break e}break;case 5:Jn=Y.stateNode,ji=!1;break e;case 3:case 4:Jn=Y.stateNode.containerInfo,ji=!0;break e}Y=Y.return}if(Jn===null)throw Error(n(160));ll(E,L,A),Jn=null,ji=!1,E=A.alternate,E!==null&&(E.return=null),A.return=null}if(r.subtreeFlags&13886)for(r=r.child;r!==null;)cl(r,a),r=r.sibling}var os=null;function cl(a,r){var f=a.alternate,m=a.flags;switch(a.tag){case 0:case 11:case 14:case 15:Pa(r,a),Li(a),m&4&&(Ys(3,a,a.return),Pr(3,a),Ys(5,a,a.return));break;case 1:Pa(r,a),Li(a),m&512&&(_i||f===null||Bs(f,f.return)),m&64&&qs&&(a=a.updateQueue,a!==null&&(m=a.callbacks,m!==null&&(f=a.shared.hiddenCallbacks,a.shared.hiddenCallbacks=f===null?m:f.concat(m))));break;case 26:var A=os;if(Pa(r,a),Li(a),m&512&&(_i||f===null||Bs(f,f.return)),m&4){var E=f!==null?f.memoizedState:null;if(m=a.memoizedState,f===null)if(m===null)if(a.stateNode===null){e:{m=a.type,f=a.memoizedProps,A=A.ownerDocument||A;t:switch(m){case"title":E=A.getElementsByTagName("title")[0],(!E||E[ct]||E[mn]||E.namespaceURI==="http://www.w3.org/2000/svg"||E.hasAttribute("itemprop"))&&(E=A.createElement(m),A.head.insertBefore(E,A.querySelector("head > title"))),Wa(E,m,f),E[mn]=a,k(E),m=E;break e;case"link":var L=qC("link","href",A).get(m+(f.href||""));if(L){for(var Y=0;Y<L.length;Y++)if(E=L[Y],E.getAttribute("href")===(f.href==null||f.href===""?null:f.href)&&E.getAttribute("rel")===(f.rel==null?null:f.rel)&&E.getAttribute("title")===(f.title==null?null:f.title)&&E.getAttribute("crossorigin")===(f.crossOrigin==null?null:f.crossOrigin)){L.splice(Y,1);break t}}E=A.createElement(m),Wa(E,m,f),A.head.appendChild(E);break;case"meta":if(L=qC("meta","content",A).get(m+(f.content||""))){for(Y=0;Y<L.length;Y++)if(E=L[Y],E.getAttribute("content")===(f.content==null?null:""+f.content)&&E.getAttribute("name")===(f.name==null?null:f.name)&&E.getAttribute("property")===(f.property==null?null:f.property)&&E.getAttribute("http-equiv")===(f.httpEquiv==null?null:f.httpEquiv)&&E.getAttribute("charset")===(f.charSet==null?null:f.charSet)){L.splice(Y,1);break t}}E=A.createElement(m),Wa(E,m,f),A.head.appendChild(E);break;default:throw Error(n(468,m))}E[mn]=a,k(E),m=E}a.stateNode=m}else KC(A,a.type,a.stateNode);else a.stateNode=JC(A,m,a.memoizedProps);else E!==m?(E===null?f.stateNode!==null&&(f=f.stateNode,f.parentNode.removeChild(f)):E.count--,m===null?KC(A,a.type,a.stateNode):JC(A,m,a.memoizedProps)):m===null&&a.stateNode!==null&&Js(a,a.memoizedProps,f.memoizedProps)}break;case 27:Pa(r,a),Li(a),m&512&&(_i||f===null||Bs(f,f.return)),f!==null&&m&4&&Js(a,a.memoizedProps,f.memoizedProps);break;case 5:if(Pa(r,a),Li(a),m&512&&(_i||f===null||Bs(f,f.return)),a.flags&32){A=a.stateNode;try{jn(A,"")}catch(qt){ci(a,a.return,qt)}}m&4&&a.stateNode!=null&&(A=a.memoizedProps,Js(a,A,f!==null?f.memoizedProps:A)),m&1024&&(_o=!0);break;case 6:if(Pa(r,a),Li(a),m&4){if(a.stateNode===null)throw Error(n(162));m=a.memoizedProps,f=a.stateNode;try{f.nodeValue=m}catch(qt){ci(a,a.return,qt)}}break;case 3:if(by=null,A=os,os=Sy(r.containerInfo),Pa(r,a),os=A,Li(a),m&4&&f!==null&&f.memoizedState.isDehydrated)try{Kd(r.containerInfo)}catch(qt){ci(a,a.return,qt)}_o&&(_o=!1,gy(a));break;case 4:m=os,os=Sy(a.stateNode.containerInfo),Pa(r,a),Li(a),os=m;break;case 12:Pa(r,a),Li(a);break;case 31:Pa(r,a),Li(a),m&4&&(m=a.updateQueue,m!==null&&(a.updateQueue=null,Gi(a,m)));break;case 13:Pa(r,a),Li(a),a.child.flags&8192&&a.memoizedState!==null!=(f!==null&&f.memoizedState!==null)&&(So=P()),m&4&&(m=a.updateQueue,m!==null&&(a.updateQueue=null,Gi(a,m)));break;case 22:A=a.memoizedState!==null;var re=f!==null&&f.memoizedState!==null,Re=qs,Xe=_i;if(qs=Re||A,_i=Xe||re,Pa(r,a),_i=Xe,qs=Re,Li(a),m&8192)e:for(r=a.stateNode,r._visibility=A?r._visibility&-2:r._visibility|1,A&&(f===null||re||qs||_i||Zl(a)),f=null,r=a;;){if(r.tag===5||r.tag===26){if(f===null){re=f=r;try{if(E=re.stateNode,A)L=E.style,typeof L.setProperty=="function"?L.setProperty("display","none","important"):L.display="none";else{Y=re.stateNode;var $e=re.memoizedProps.style,De=$e!=null&&$e.hasOwnProperty("display")?$e.display:null;Y.style.display=De==null||typeof De=="boolean"?"":(""+De).trim()}}catch(qt){ci(re,re.return,qt)}}}else if(r.tag===6){if(f===null){re=r;try{re.stateNode.nodeValue=A?"":re.memoizedProps}catch(qt){ci(re,re.return,qt)}}}else if(r.tag===18){if(f===null){re=r;try{var Pe=re.stateNode;A?FC(Pe,!0):FC(re.stateNode,!1)}catch(qt){ci(re,re.return,qt)}}}else if((r.tag!==22&&r.tag!==23||r.memoizedState===null||r===a)&&r.child!==null){r.child.return=r,r=r.child;continue}if(r===a)break e;for(;r.sibling===null;){if(r.return===null||r.return===a)break e;f===r&&(f=null),r=r.return}f===r&&(f=null),r.sibling.return=r.return,r=r.sibling}m&4&&(m=a.updateQueue,m!==null&&(f=m.retryQueue,f!==null&&(m.retryQueue=null,Gi(a,f))));break;case 19:Pa(r,a),Li(a),m&4&&(m=a.updateQueue,m!==null&&(a.updateQueue=null,Gi(a,m)));break;case 30:break;case 21:break;default:Pa(r,a),Li(a)}}function Li(a){var r=a.flags;if(r&2){try{for(var f,m=a.return;m!==null;){if(Wi(m)){f=m;break}m=m.return}if(f==null)throw Error(n(160));switch(f.tag){case 27:var A=f.stateNode,E=zr(a);Zn(a,E,A);break;case 5:var L=f.stateNode;f.flags&32&&(jn(L,""),f.flags&=-33);var Y=zr(a);Zn(a,Y,L);break;case 3:case 4:var re=f.stateNode.containerInfo,Re=zr(a);xn(a,Re,re);break;default:throw Error(n(161))}}catch(Xe){ci(a,a.return,Xe)}a.flags&=-3}r&4096&&(a.flags&=-4097)}function gy(a){if(a.subtreeFlags&1024)for(a=a.child;a!==null;){var r=a;gy(r),r.tag===5&&r.flags&1024&&r.stateNode.reset(),a=a.sibling}}function yo(a,r){if(r.subtreeFlags&8772)for(r=r.child;r!==null;)py(a,r.alternate,r),r=r.sibling}function Zl(a){for(a=a.child;a!==null;){var r=a;switch(r.tag){case 0:case 11:case 14:case 15:Ys(4,r,r.return),Zl(r);break;case 1:Bs(r,r.return);var f=r.stateNode;typeof f.componentWillUnmount=="function"&&mg(r,r.return,f),Zl(r);break;case 27:xg(r.stateNode);case 26:case 5:Bs(r,r.return),Zl(r);break;case 22:r.memoizedState===null&&Zl(r);break;case 30:Zl(r);break;default:Zl(r)}a=a.sibling}}function $n(a,r,f){for(f=f&&(r.subtreeFlags&8772)!==0,r=r.child;r!==null;){var m=r.alternate,A=a,E=r,L=E.flags;switch(E.tag){case 0:case 11:case 15:$n(A,E,f),Pr(4,E);break;case 1:if($n(A,E,f),m=E,A=m.stateNode,typeof A.componentDidMount=="function")try{A.componentDidMount()}catch(Re){ci(m,m.return,Re)}if(m=E,A=m.updateQueue,A!==null){var Y=m.stateNode;try{var re=A.shared.hiddenCallbacks;if(re!==null)for(A.shared.hiddenCallbacks=null,A=0;A<re.length;A++)Or(re[A],Y)}catch(Re){ci(m,m.return,Re)}}f&&L&64&&ol(E),Gr(E,E.return);break;case 27:Pi(E);case 26:case 5:$n(A,E,f),f&&m===null&&L&4&&Ds(E),Gr(E,E.return);break;case 12:$n(A,E,f);break;case 31:$n(A,E,f),f&&L&4&&Fd(A,E);break;case 13:$n(A,E,f),f&&L&4&&gg(A,E);break;case 22:E.memoizedState===null&&$n(A,E,f),Gr(E,E.return);break;case 30:break;default:$n(A,E,f)}r=r.sibling}}function Hd(a,r){var f=null;a!==null&&a.memoizedState!==null&&a.memoizedState.cachePool!==null&&(f=a.memoizedState.cachePool.pool),a=null,r.memoizedState!==null&&r.memoizedState.cachePool!==null&&(a=r.memoizedState.cachePool.pool),a!==f&&(a!=null&&a.refCount++,f!=null&&Aa(f))}function xo(a,r){a=null,r.alternate!==null&&(a=r.alternate.memoizedState.cache),r=r.memoizedState.cache,r!==a&&(r.refCount++,a!=null&&Aa(a))}function ea(a,r,f,m){if(r.subtreeFlags&10256)for(r=r.child;r!==null;)Mi(a,r,f,m),r=r.sibling}function Mi(a,r,f,m){var A=r.flags;switch(r.tag){case 0:case 11:case 15:ea(a,r,f,m),A&2048&&Pr(9,r);break;case 1:ea(a,r,f,m);break;case 3:ea(a,r,f,m),A&2048&&(a=null,r.alternate!==null&&(a=r.alternate.memoizedState.cache),r=r.memoizedState.cache,r!==a&&(r.refCount++,a!=null&&Aa(a)));break;case 12:if(A&2048){ea(a,r,f,m),a=r.stateNode;try{var E=r.memoizedProps,L=E.id,Y=E.onPostCommit;typeof Y=="function"&&Y(L,r.alternate===null?"mount":"update",a.passiveEffectDuration,-0)}catch(re){ci(r,r.return,re)}}else ea(a,r,f,m);break;case 31:ea(a,r,f,m);break;case 13:ea(a,r,f,m);break;case 23:break;case 22:E=r.stateNode,L=r.alternate,r.memoizedState!==null?E._visibility&2?ea(a,r,f,m):su(a,r):E._visibility&2?ea(a,r,f,m):(E._visibility|=2,ul(a,r,f,m,(r.subtreeFlags&10256)!==0||!1)),A&2048&&Hd(L,r);break;case 24:ea(a,r,f,m),A&2048&&xo(r.alternate,r);break;default:ea(a,r,f,m)}}function ul(a,r,f,m,A){for(A=A&&((r.subtreeFlags&10256)!==0||!1),r=r.child;r!==null;){var E=a,L=r,Y=f,re=m,Re=L.flags;switch(L.tag){case 0:case 11:case 15:ul(E,L,Y,re,A),Pr(8,L);break;case 23:break;case 22:var Xe=L.stateNode;L.memoizedState!==null?Xe._visibility&2?ul(E,L,Y,re,A):su(E,L):(Xe._visibility|=2,ul(E,L,Y,re,A)),A&&Re&2048&&Hd(L.alternate,L);break;case 24:ul(E,L,Y,re,A),A&&Re&2048&&xo(L.alternate,L);break;default:ul(E,L,Y,re,A)}r=r.sibling}}function su(a,r){if(r.subtreeFlags&10256)for(r=r.child;r!==null;){var f=a,m=r,A=m.flags;switch(m.tag){case 22:su(f,m),A&2048&&Hd(m.alternate,m);break;case 24:su(f,m),A&2048&&xo(m.alternate,m);break;default:su(f,m)}r=r.sibling}}var Oi=8192;function Ql(a,r,f){if(a.subtreeFlags&Oi)for(a=a.child;a!==null;)zi(a,r,f),a=a.sibling}function zi(a,r,f){switch(a.tag){case 26:Ql(a,r,f),a.flags&Oi&&a.memoizedState!==null&&R4(f,os,a.memoizedState,a.memoizedProps);break;case 5:Ql(a,r,f);break;case 3:case 4:var m=os;os=Sy(a.stateNode.containerInfo),Ql(a,r,f),os=m;break;case 22:a.memoizedState===null&&(m=a.alternate,m!==null&&m.memoizedState!==null?(m=Oi,Oi=16777216,Ql(a,r,f),Oi=m):Ql(a,r,f));break;default:Ql(a,r,f)}}function ls(a){var r=a.alternate;if(r!==null&&(a=r.child,a!==null)){r.child=null;do r=a.sibling,a.sibling=null,a=r;while(a!==null)}}function qa(a){var r=a.deletions;if((a.flags&16)!==0){if(r!==null)for(var f=0;f<r.length;f++){var m=r[f];Ui=m,Yf(m,a)}ls(a)}if(a.subtreeFlags&10256)for(a=a.child;a!==null;)$l(a),a=a.sibling}function $l(a){switch(a.tag){case 0:case 11:case 15:qa(a),a.flags&2048&&Ys(9,a,a.return);break;case 3:qa(a);break;case 12:qa(a);break;case 22:var r=a.stateNode;a.memoizedState!==null&&r._visibility&2&&(a.return===null||a.return.tag!==13)?(r._visibility&=-3,Pd(a)):qa(a);break;default:qa(a)}}function Pd(a){var r=a.deletions;if((a.flags&16)!==0){if(r!==null)for(var f=0;f<r.length;f++){var m=r[f];Ui=m,Yf(m,a)}ls(a)}for(a=a.child;a!==null;){switch(r=a,r.tag){case 0:case 11:case 15:Ys(8,r,r.return),Pd(r);break;case 22:f=r.stateNode,f._visibility&2&&(f._visibility&=-3,Pd(r));break;default:Pd(r)}a=a.sibling}}function Yf(a,r){for(;Ui!==null;){var f=Ui;switch(f.tag){case 0:case 11:case 15:Ys(8,f,r);break;case 23:case 22:if(f.memoizedState!==null&&f.memoizedState.cachePool!==null){var m=f.memoizedState.cachePool.pool;m!=null&&m.refCount++}break;case 24:Aa(f.memoizedState.cache)}if(m=f.child,m!==null)m.return=f,Ui=m;else e:for(f=a;Ui!==null;){m=Ui;var A=m.sibling,E=m.return;if(Id(m),m===f){Ui=null;break e}if(A!==null){A.return=E,Ui=A;break e}Ui=E}}}var Gd={getCacheForType:function(a){var r=ca(Qt),f=r.data.get(a);return f===void 0&&(f=a(),r.data.set(a,f)),f},cacheSignal:function(){return ca(Qt).controller.signal}},zd=typeof WeakMap=="function"?WeakMap:Map,Gn=0,ei=null,An=null,Nn=0,$t=0,Rn=null,vn=!1,En=!1,li=!1,Vi=0,ti=0,Ns=0,Ao=0,hr=0,zn=0,Us=0,dr=null,Ga=null,cs=!1,So=0,ru=0,Ls=1/0,ou=null,Vr=null,bi=0,pr=null,Os=null,Ks=0,Mo=0,ec=null,Vd=null,tc=0,nc=null;function Ka(){return(Gn&2)!==0&&Nn!==0?Nn&-Nn:I.T!==null?QS():wi()}function c(){if(zn===0)if((Nn&536870912)===0||In){var a=ot;ot<<=1,(ot&3932160)===0&&(ot=262144),zn=a}else zn=536870912;return a=$i.current,a!==null&&(a.flags|=32),zn}function u(a,r,f){(a===ei&&($t===2||$t===9)||a.cancelPendingCommit!==null)&&(be(a,0),B(a,Nn,zn,!1)),Fi(a,f),((Gn&2)===0||a!==ei)&&(a===ei&&((Gn&2)===0&&(Ao|=f),ti===4&&B(a,Nn,zn,!1)),fl(a))}function g(a,r,f){if((Gn&6)!==0)throw Error(n(327));var m=!f&&(r&127)===0&&(r&a.expiredLanes)===0||_t(a,r),A=m?ic(a,r):us(a,r,!0),E=m;do{if(A===0){En&&!m&&B(a,r,0,!1);break}else{if(f=a.current.alternate,E&&!C(f)){A=us(a,r,!1),E=!1;continue}if(A===2){if(E=r,a.errorRecoveryDisabledLanes&E)var L=0;else L=a.pendingLanes&-536870913,L=L!==0?L:L&536870912?536870912:0;if(L!==0){r=L;e:{var Y=a;A=dr;var re=Y.current.memoizedState.isDehydrated;if(re&&(be(Y,L).flags|=256),L=us(Y,L,!1),L!==2){if(li&&!re){Y.errorRecoveryDisabledLanes|=E,Ao|=E,A=4;break e}E=Ga,Ga=A,E!==null&&(Ga===null?Ga=E:Ga.push.apply(Ga,E))}A=L}if(E=!1,A!==2)continue}}if(A===1){be(a,0),B(a,r,0,!0);break}e:{switch(m=a,E=A,E){case 0:case 1:throw Error(n(345));case 4:if((r&4194048)!==r)break;case 6:B(m,r,zn,!vn);break e;case 2:Ga=null;break;case 3:case 5:break;default:throw Error(n(329))}if((r&62914560)===r&&(A=So+300-P(),10<A)){if(B(m,r,zn,!vn),We(m,0,!0)!==0)break e;Ks=r,m.timeoutHandle=LC(S.bind(null,m,f,Ga,ou,cs,r,zn,Ao,Us,vn,E,"Throttled",-0,0),A);break e}S(m,f,Ga,ou,cs,r,zn,Ao,Us,vn,E,null,-0,0)}}break}while(!0);fl(a)}function S(a,r,f,m,A,E,L,Y,re,Re,Xe,$e,De,Pe){if(a.timeoutHandle=-1,$e=r.subtreeFlags,$e&8192||($e&16785408)===16785408){$e={stylesheets:null,count:0,imgCount:0,imgBytes:0,suspenseyImages:[],waitingForImages:!0,waitingForViewTransition:!1,unsuspend:Tr},zi(r,E,$e);var qt=(E&62914560)===E?So-P():(E&4194048)===E?ru-P():0;if(qt=w4($e,qt),qt!==null){Ks=E,a.cancelPendingCommit=qt(hn.bind(null,a,r,E,f,m,A,L,Y,re,Xe,$e,null,De,Pe)),B(a,E,L,!Re);return}}hn(a,r,E,f,m,A,L,Y,re)}function C(a){for(var r=a;;){var f=r.tag;if((f===0||f===11||f===15)&&r.flags&16384&&(f=r.updateQueue,f!==null&&(f=f.stores,f!==null)))for(var m=0;m<f.length;m++){var A=f[m],E=A.getSnapshot;A=A.value;try{if(!gi(E(),A))return!1}catch{return!1}}if(f=r.child,r.subtreeFlags&16384&&f!==null)f.return=r,r=f;else{if(r===a)break;for(;r.sibling===null;){if(r.return===null||r.return===a)return!0;r=r.return}r.sibling.return=r.return,r=r.sibling}}return!0}function B(a,r,f,m){r&=~hr,r&=~Ao,a.suspendedLanes|=r,a.pingedLanes&=~r,m&&(a.warmLanes|=r),m=a.expirationTimes;for(var A=r;0<A;){var E=31-bt(A),L=1<<E;m[E]=-1,A&=~L}f!==0&&br(a,f,r)}function J(){return(Gn&6)===0?(vg(0),!1):!0}function se(){if(An!==null){if($t===0)var a=An.return;else a=An,Oa=lo=null,qm(a),$o=null,el=0,a=An;for(;a!==null;)jl(a.alternate,a),a=a.return;An=null}}function be(a,r){var f=a.timeoutHandle;f!==-1&&(a.timeoutHandle=-1,f4(f)),f=a.cancelPendingCommit,f!==null&&(a.cancelPendingCommit=null,f()),Ks=0,se(),ei=a,An=f=wr(a.current,null),Nn=r,$t=0,Rn=null,vn=!1,En=_t(a,r),li=!1,Us=zn=hr=Ao=Ns=ti=0,Ga=dr=null,cs=!1,(r&8)!==0&&(r|=r&32);var m=a.entangledLanes;if(m!==0)for(a=a.entanglements,m&=r;0<m;){var A=31-bt(m),E=1<<A;r|=a[A],m&=~E}return Vi=r,Jo(),f}function Ke(a,r){fn=null,I.H=Uf,r===Qo||r===lr?(r=gd(),$t=3):r===Mf?(r=gd(),$t=4):$t=r===Ud?8:r!==null&&typeof r=="object"&&typeof r.then=="function"?6:1,Rn=r,An===null&&(ti=1,Nd(a,ts(r,a.current)))}function St(){var a=$i.current;return a===null?!0:(Nn&4194048)===Nn?Vs===null:(Nn&62914560)===Nn||(Nn&536870912)!==0?a===Vs:!1}function It(){var a=I.H;return I.H=Uf,a===null?Uf:a}function Pt(){var a=I.A;return I.A=Gd,a}function gn(){ti=4,vn||(Nn&4194048)!==Nn&&$i.current!==null||(En=!0),(Ns&134217727)===0&&(Ao&134217727)===0||ei===null||B(ei,Nn,zn,!1)}function us(a,r,f){var m=Gn;Gn|=2;var A=It(),E=Pt();(ei!==a||Nn!==r)&&(ou=null,be(a,r)),r=!1;var L=ti;e:do try{if($t!==0&&An!==null){var Y=An,re=Rn;switch($t){case 8:se(),L=6;break e;case 3:case 2:case 9:case 6:$i.current===null&&(r=!0);var Re=$t;if($t=0,Rn=null,pt(a,Y,re,Re),f&&En){L=0;break e}break;default:Re=$t,$t=0,Rn=null,pt(a,Y,re,Re)}}Jf(),L=ti;break}catch(Xe){Ke(a,Xe)}while(!0);return r&&a.shellSuspendCounter++,Oa=lo=null,Gn=m,I.H=A,I.A=E,An===null&&(ei=null,Nn=0,Jo()),L}function Jf(){for(;An!==null;)Ae(An)}function ic(a,r){var f=Gn;Gn|=2;var m=It(),A=Pt();ei!==a||Nn!==r?(ou=null,Ls=P()+500,be(a,r)):En=_t(a,r);e:do try{if($t!==0&&An!==null){r=An;var E=Rn;t:switch($t){case 1:$t=0,Rn=null,pt(a,r,E,1);break;case 2:case 9:if(z_(E)){$t=0,Rn=null,Oe(r);break}r=function(){$t!==2&&$t!==9||ei!==a||($t=7),fl(a)},E.then(r,r);break e;case 3:$t=7;break e;case 4:$t=5;break e;case 7:z_(E)?($t=0,Rn=null,Oe(r)):($t=0,Rn=null,pt(a,r,E,7));break;case 5:var L=null;switch(An.tag){case 26:L=An.memoizedState;case 5:case 27:var Y=An;if(L?WC(L):Y.stateNode.complete){$t=0,Rn=null;var re=Y.sibling;if(re!==null)An=re;else{var Re=Y.return;Re!==null?(An=Re,jt(Re)):An=null}break t}}$t=0,Rn=null,pt(a,r,E,5);break;case 6:$t=0,Rn=null,pt(a,r,E,6);break;case 8:se(),ti=6;break e;default:throw Error(n(462))}}Be();break}catch(Xe){Ke(a,Xe)}while(!0);return Oa=lo=null,I.H=m,I.A=A,Gn=f,An!==null?0:(ei=null,Nn=0,Jo(),ti)}function Be(){for(;An!==null&&!gt();)Ae(An)}function Ae(a){var r=Ld(a.alternate,a,Vi);a.memoizedProps=a.pendingProps,r===null?jt(a):An=r}function Oe(a){var r=a,f=r.alternate;switch(r.tag){case 15:case 0:r=Fa(f,r,r.pendingProps,r.type,void 0,Nn);break;case 11:r=Fa(f,r,r.pendingProps,r.type.render,r.ref,Nn);break;case 5:qm(r);default:jl(f,r),r=An=La(r,Vi),r=Ld(f,r,Vi)}a.memoizedProps=a.pendingProps,r===null?jt(a):An=r}function pt(a,r,f,m){Oa=lo=null,qm(r),$o=null,el=0;var A=r.return;try{if(Es(a,A,r,f,Nn)){ti=1,Nd(a,ts(f,a.current)),An=null;return}}catch(E){if(A!==null)throw An=A,E;ti=1,Nd(a,ts(f,a.current)),An=null;return}r.flags&32768?(In||m===1?a=!0:En||(Nn&536870912)!==0?a=!1:(vn=a=!0,(m===2||m===9||m===3||m===6)&&(m=$i.current,m!==null&&m.tag===13&&(m.flags|=16384))),fi(r,a)):jt(r)}function jt(a){var r=a;do{if((r.flags&32768)!==0){fi(r,vn);return}a=r.return;var f=pg(r.alternate,r,Vi);if(f!==null){An=f;return}if(r=r.sibling,r!==null){An=r;return}An=r=a}while(r!==null);ti===0&&(ti=5)}function fi(a,r){do{var f=Od(a.alternate,a);if(f!==null){f.flags&=32767,An=f;return}if(f=a.return,f!==null&&(f.flags|=32768,f.subtreeFlags=0,f.deletions=null),!r&&(a=a.sibling,a!==null)){An=a;return}An=a=f}while(a!==null);ti=6,An=null}function hn(a,r,f,m,A,E,L,Y,re){a.cancelPendingCommit=null;do kd();while(bi!==0);if((Gn&6)!==0)throw Error(n(327));if(r!==null){if(r===a.current)throw Error(n(177));if(E=r.lanes|r.childLanes,E|=ld,va(a,f,E,L,Y,re),a===ei&&(An=ei=null,Nn=0),Os=r,pr=a,Ks=f,Mo=E,ec=A,Vd=m,(r.subtreeFlags&10256)!==0||(r.flags&10256)!==0?(a.callbackNode=null,a.callbackPriority=0,QF(Ie,function(){return vC(),null})):(a.callbackNode=null,a.callbackPriority=0),m=(r.flags&13878)!==0,(r.subtreeFlags&13878)!==0||m){m=I.T,I.T=null,A=W.p,W.p=2,L=Gn,Gn|=4;try{au(a,r,f)}finally{Gn=L,W.p=A,I.T=m}}bi=1,qn(),ta(),Kn()}}function qn(){if(bi===1){bi=0;var a=pr,r=Os,f=(r.flags&13878)!==0;if((r.subtreeFlags&13878)!==0||f){f=I.T,I.T=null;var m=W.p;W.p=2;var A=Gn;Gn|=4;try{cl(r,a);var E=rM,L=id(a.containerInfo),Y=E.focusedElem,re=E.selectionRange;if(L!==Y&&Y&&Y.ownerDocument&&nd(Y.ownerDocument.documentElement,Y)){if(re!==null&&Fc(Y)){var Re=re.start,Xe=re.end;if(Xe===void 0&&(Xe=Re),"selectionStart"in Y)Y.selectionStart=Re,Y.selectionEnd=Math.min(Xe,Y.value.length);else{var $e=Y.ownerDocument||document,De=$e&&$e.defaultView||window;if(De.getSelection){var Pe=De.getSelection(),qt=Y.textContent.length,cn=Math.min(re.start,qt),di=re.end===void 0?cn:Math.min(re.end,qt);!Pe.extend&&cn>di&&(L=di,di=cn,cn=L);var Se=Sm(Y,cn),me=Sm(Y,di);if(Se&&me&&(Pe.rangeCount!==1||Pe.anchorNode!==Se.node||Pe.anchorOffset!==Se.offset||Pe.focusNode!==me.node||Pe.focusOffset!==me.offset)){var Ce=$e.createRange();Ce.setStart(Se.node,Se.offset),Pe.removeAllRanges(),cn>di?(Pe.addRange(Ce),Pe.extend(me.node,me.offset)):(Ce.setEnd(me.node,me.offset),Pe.addRange(Ce))}}}}for($e=[],Pe=Y;Pe=Pe.parentNode;)Pe.nodeType===1&&$e.push({element:Pe,left:Pe.scrollLeft,top:Pe.scrollTop});for(typeof Y.focus=="function"&&Y.focus(),Y=0;Y<$e.length;Y++){var Ze=$e[Y];Ze.element.scrollLeft=Ze.left,Ze.element.scrollTop=Ze.top}}Ry=!!sM,rM=sM=null}finally{Gn=A,W.p=m,I.T=f}}a.current=r,bi=2}}function ta(){if(bi===2){bi=0;var a=pr,r=Os,f=(r.flags&8772)!==0;if((r.subtreeFlags&8772)!==0||f){f=I.T,I.T=null;var m=W.p;W.p=2;var A=Gn;Gn|=4;try{py(a,r.alternate,r)}finally{Gn=A,W.p=m,I.T=f}}bi=3}}function Kn(){if(bi===4||bi===3){bi=0,j();var a=pr,r=Os,f=Ks,m=Vd;(r.subtreeFlags&10256)!==0||(r.flags&10256)!==0?bi=5:(bi=0,Os=pr=null,bo(a,a.pendingLanes));var A=a.pendingLanes;if(A===0&&(Vr=null),Da(f),r=r.stateNode,qe&&typeof qe.onCommitFiberRoot=="function")try{qe.onCommitFiberRoot(Ye,r,void 0,(r.current.flags&128)===128)}catch{}if(m!==null){r=I.T,A=W.p,W.p=2,I.T=null;try{for(var E=a.onRecoverableError,L=0;L<m.length;L++){var Y=m[L];E(Y.value,{componentStack:Y.stack})}}finally{I.T=r,W.p=A}}(Ks&3)!==0&&kd(),fl(a),A=a.pendingLanes,(f&261930)!==0&&(A&42)!==0?a===nc?tc++:(tc=0,nc=a):tc=0,vg(0)}}function bo(a,r){(a.pooledCacheLanes&=r)===0&&(r=a.pooledCache,r!=null&&(a.pooledCache=null,Aa(r)))}function kd(){return qn(),ta(),Kn(),vC()}function vC(){if(bi!==5)return!1;var a=pr,r=Mo;Mo=0;var f=Da(Ks),m=I.T,A=W.p;try{W.p=32>f?32:f,I.T=null,f=ec,ec=null;var E=pr,L=Ks;if(bi=0,Os=pr=null,Ks=0,(Gn&6)!==0)throw Error(n(331));var Y=Gn;if(Gn|=4,$l(E.current),Mi(E,E.current,L,f),Gn=Y,vg(0,!1),qe&&typeof qe.onPostCommitFiberRoot=="function")try{qe.onPostCommitFiberRoot(Ye,E)}catch{}return!0}finally{W.p=A,I.T=m,bo(a,r)}}function _C(a,r,f){r=ts(f,r),r=dg(a.stateNode,r,2),a=ho(a,r,2),a!==null&&(Fi(a,2),fl(a))}function ci(a,r,f){if(a.tag===3)_C(a,a,f);else for(;r!==null;){if(r.tag===3){_C(r,a,f);break}else if(r.tag===1){var m=r.stateNode;if(typeof r.type.getDerivedStateFromError=="function"||typeof m.componentDidCatch=="function"&&(Vr===null||!Vr.has(m))){a=ts(f,a),f=$c(2),m=ho(r,f,2),m!==null&&(ss(f,m,r,a),Fi(m,2),fl(m));break}}r=r.return}}function WS(a,r,f){var m=a.pingCache;if(m===null){m=a.pingCache=new zd;var A=new Set;m.set(r,A)}else A=m.get(r),A===void 0&&(A=new Set,m.set(r,A));A.has(f)||(li=!0,A.add(f),a=WF.bind(null,a,r,f),r.then(a,a))}function WF(a,r,f){var m=a.pingCache;m!==null&&m.delete(r),a.pingedLanes|=a.suspendedLanes&f,a.warmLanes&=~f,ei===a&&(Nn&f)===f&&(ti===4||ti===3&&(Nn&62914560)===Nn&&300>P()-So?(Gn&2)===0&&be(a,0):hr|=f,Us===Nn&&(Us=0)),fl(a)}function yC(a,r){r===0&&(r=wn()),a=qo(a,r),a!==null&&(Fi(a,r),fl(a))}function jF(a){var r=a.memoizedState,f=0;r!==null&&(f=r.retryLane),yC(a,f)}function ZF(a,r){var f=0;switch(a.tag){case 31:case 13:var m=a.stateNode,A=a.memoizedState;A!==null&&(f=A.retryLane);break;case 19:m=a.stateNode;break;case 22:m=a.stateNode._retryCache;break;default:throw Error(n(314))}m!==null&&m.delete(r),yC(a,f)}function QF(a,r){return mt(a,r)}var vy=null,Xd=null,jS=!1,_y=!1,ZS=!1,lu=0;function fl(a){a!==Xd&&a.next===null&&(Xd===null?vy=Xd=a:Xd=Xd.next=a),_y=!0,jS||(jS=!0,e4())}function vg(a,r){if(!ZS&&_y){ZS=!0;do for(var f=!1,m=vy;m!==null;){if(a!==0){var A=m.pendingLanes;if(A===0)var E=0;else{var L=m.suspendedLanes,Y=m.pingedLanes;E=(1<<31-bt(42|a)+1)-1,E&=A&~(L&~Y),E=E&201326741?E&201326741|1:E?E|2:0}E!==0&&(f=!0,MC(m,E))}else E=Nn,E=We(m,m===ei?E:0,m.cancelPendingCommit!==null||m.timeoutHandle!==-1),(E&3)===0||_t(m,E)||(f=!0,MC(m,E));m=m.next}while(f);ZS=!1}}function $F(){xC()}function xC(){_y=jS=!1;var a=0;lu!==0&&u4()&&(a=lu);for(var r=P(),f=null,m=vy;m!==null;){var A=m.next,E=AC(m,r);E===0?(m.next=null,f===null?vy=A:f.next=A,A===null&&(Xd=f)):(f=m,(a!==0||(E&3)!==0)&&(_y=!0)),m=A}bi!==0&&bi!==5||vg(a),lu!==0&&(lu=0)}function AC(a,r){for(var f=a.suspendedLanes,m=a.pingedLanes,A=a.expirationTimes,E=a.pendingLanes&-62914561;0<E;){var L=31-bt(E),Y=1<<L,re=A[L];re===-1?((Y&f)===0||(Y&m)!==0)&&(A[L]=nn(Y,r)):re<=r&&(a.expiredLanes|=Y),E&=~Y}if(r=ei,f=Nn,f=We(a,a===r?f:0,a.cancelPendingCommit!==null||a.timeoutHandle!==-1),m=a.callbackNode,f===0||a===r&&($t===2||$t===9)||a.cancelPendingCommit!==null)return m!==null&&m!==null&&Lt(m),a.callbackNode=null,a.callbackPriority=0;if((f&3)===0||_t(a,f)){if(r=f&-f,r===a.callbackPriority)return r;switch(m!==null&&Lt(m),Da(f)){case 2:case 8:f=ke;break;case 32:f=Ie;break;case 268435456:f=Mt;break;default:f=Ie}return m=SC.bind(null,a),f=mt(f,m),a.callbackPriority=r,a.callbackNode=f,r}return m!==null&&m!==null&&Lt(m),a.callbackPriority=2,a.callbackNode=null,2}function SC(a,r){if(bi!==0&&bi!==5)return a.callbackNode=null,a.callbackPriority=0,null;var f=a.callbackNode;if(kd()&&a.callbackNode!==f)return null;var m=Nn;return m=We(a,a===ei?m:0,a.cancelPendingCommit!==null||a.timeoutHandle!==-1),m===0?null:(g(a,m,r),AC(a,P()),a.callbackNode!=null&&a.callbackNode===f?SC.bind(null,a):null)}function MC(a,r){if(kd())return null;g(a,r,!0)}function e4(){h4(function(){(Gn&6)!==0?mt(Fe,$F):xC()})}function QS(){if(lu===0){var a=fo;a===0&&(a=Ne,Ne<<=1,(Ne&261888)===0&&(Ne=256)),lu=a}return lu}function bC(a){return a==null||typeof a=="symbol"||typeof a=="boolean"?null:typeof a=="function"?a:af(""+a)}function EC(a,r){var f=r.ownerDocument.createElement("input");return f.name=r.name,f.value=r.value,a.id&&f.setAttribute("form",a.id),r.parentNode.insertBefore(f,r),a=new FormData(a),f.parentNode.removeChild(f),a}function t4(a,r,f,m,A){if(r==="submit"&&f&&f.stateNode===A){var E=bC((A[G]||null).action),L=m.submitter;L&&(r=(r=L[G]||null)?bC(r.formAction):L.getAttribute("formAction"),r!==null&&(E=r,L=null));var Y=new lf("action","action",null,m,A);a.push({event:Y,listeners:[{instance:null,listener:function(){if(m.defaultPrevented){if(lu!==0){var re=L?EC(A,L):new FormData(A);lg(f,{pending:!0,data:re,method:A.method,action:E},null,re)}}else typeof E=="function"&&(Y.preventDefault(),re=L?EC(A,L):new FormData(A),lg(f,{pending:!0,data:re,method:A.method,action:E},E,re))},currentTarget:A}]})}}for(var $S=0;$S<od.length;$S++){var eM=od[$S],n4=eM.toLowerCase(),i4=eM[0].toUpperCase()+eM.slice(1);Ua(n4,"on"+i4)}Ua(es,"onAnimationEnd"),Ua(Mm,"onAnimationIteration"),Ua(Rr,"onAnimationStart"),Ua("dblclick","onDoubleClick"),Ua("focusin","onFocus"),Ua("focusout","onBlur"),Ua(zc,"onTransitionRun"),Ua(Xo,"onTransitionStart"),Ua(bm,"onTransitionCancel"),Ua(rd,"onTransitionEnd"),ce("onMouseEnter",["mouseout","mouseover"]),ce("onMouseLeave",["mouseout","mouseover"]),ce("onPointerEnter",["pointerout","pointerover"]),ce("onPointerLeave",["pointerout","pointerover"]),pe("onChange","change click focusin focusout input keydown keyup selectionchange".split(" ")),pe("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" ")),pe("onBeforeInput",["compositionend","keypress","textInput","paste"]),pe("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" ")),pe("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" ")),pe("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var _g="abort canplay canplaythrough durationchange emptied encrypted ended error loadeddata loadedmetadata loadstart pause play playing progress ratechange resize seeked seeking stalled suspend timeupdate volumechange waiting".split(" "),a4=new Set("beforetoggle cancel close invalid load scroll scrollend toggle".split(" ").concat(_g));function TC(a,r){r=(r&4)!==0;for(var f=0;f<a.length;f++){var m=a[f],A=m.event;m=m.listeners;e:{var E=void 0;if(r)for(var L=m.length-1;0<=L;L--){var Y=m[L],re=Y.instance,Re=Y.currentTarget;if(Y=Y.listener,re!==E&&A.isPropagationStopped())break e;E=Y,A.currentTarget=Re;try{E(A)}catch(Xe){Yo(Xe)}A.currentTarget=null,E=re}else for(L=0;L<m.length;L++){if(Y=m[L],re=Y.instance,Re=Y.currentTarget,Y=Y.listener,re!==E&&A.isPropagationStopped())break e;E=Y,A.currentTarget=Re;try{E(A)}catch(Xe){Yo(Xe)}A.currentTarget=null,E=re}}}}function Fn(a,r){var f=r[oe];f===void 0&&(f=r[oe]=new Set);var m=a+"__bubble";f.has(m)||(CC(r,a,2,!1),f.add(m))}function tM(a,r,f){var m=0;r&&(m|=4),CC(f,a,m,r)}var yy="_reactListening"+Math.random().toString(36).slice(2);function nM(a){if(!a[yy]){a[yy]=!0,ie.forEach(function(f){f!=="selectionchange"&&(a4.has(f)||tM(f,!1,a),tM(f,!0,a))});var r=a.nodeType===9?a:a.ownerDocument;r===null||r[yy]||(r[yy]=!0,tM("selectionchange",!1,r))}}function CC(a,r,f,m){switch(nR(r)){case 2:var A=N4;break;case 8:A=U4;break;default:A=vM}f=A.bind(null,r,f,a),A=void 0,!Jh||r!=="touchstart"&&r!=="touchmove"&&r!=="wheel"||(A=!0),m?A!==void 0?a.addEventListener(r,f,{capture:!0,passive:A}):a.addEventListener(r,f,!0):A!==void 0?a.addEventListener(r,f,{passive:A}):a.addEventListener(r,f,!1)}function iM(a,r,f,m,A){var E=m;if((r&1)===0&&(r&2)===0&&m!==null)e:for(;;){if(m===null)return;var L=m.tag;if(L===3||L===4){var Y=m.stateNode.containerInfo;if(Y===A)break;if(L===4)for(L=m.return;L!==null;){var re=L.tag;if((re===3||re===4)&&L.stateNode.containerInfo===A)return;L=L.return}for(;Y!==null;){if(L=st(Y),L===null)return;if(re=L.tag,re===5||re===6||re===26||re===27){m=E=L;continue e}Y=Y.parentNode}}m=m.return}sm(function(){var Re=E,Xe=Xh(f),$e=[];e:{var De=ao.get(a);if(De!==void 0){var Pe=lf,qt=a;switch(a){case"keypress":if(Ul(f)===0)break e;case"keydown":case"keyup":Pe=hm;break;case"focusin":qt="focus",Pe=Zh;break;case"focusout":qt="blur",Pe=Zh;break;case"beforeblur":case"afterblur":Pe=Zh;break;case"click":if(f.button===2)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":Pe=__;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":Pe=y_;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":Pe=no;break;case es:case Mm:case Rr:Pe=S_;break;case rd:Pe=zS;break;case"scroll":case"scrollend":Pe=Wh;break;case"wheel":Pe=Ho;break;case"copy":case"cut":case"paste":Pe=om;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":Pe=Qh;break;case"toggle":case"beforetoggle":Pe=pm}var cn=(r&4)!==0,di=!cn&&(a==="scroll"||a==="scrollend"),Se=cn?De!==null?De+"Capture":null:De;cn=[];for(var me=Re,Ce;me!==null;){var Ze=me;if(Ce=Ze.stateNode,Ze=Ze.tag,Ze!==5&&Ze!==26&&Ze!==27||Ce===null||Se===null||(Ze=Nl(me,Se),Ze!=null&&cn.push(yg(me,Ze,Ce))),di)break;me=me.return}0<cn.length&&(De=new Pe(De,qt,null,f,Xe),$e.push({event:De,listeners:cn}))}}if((r&7)===0){e:{if(De=a==="mouseover"||a==="pointerover",Pe=a==="mouseout"||a==="pointerout",De&&f!==sf&&(qt=f.relatedTarget||f.fromElement)&&(st(qt)||qt[q]))break e;if((Pe||De)&&(De=Xe.window===Xe?Xe:(De=Xe.ownerDocument)?De.defaultView||De.parentWindow:window,Pe?(qt=f.relatedTarget||f.toElement,Pe=Re,qt=qt?st(qt):null,qt!==null&&(di=o(qt),cn=qt.tag,qt!==di||cn!==5&&cn!==27&&cn!==6)&&(qt=null)):(Pe=null,qt=Re),Pe!==qt)){if(cn=__,Ze="onMouseLeave",Se="onMouseEnter",me="mouse",(a==="pointerout"||a==="pointerover")&&(cn=Qh,Ze="onPointerLeave",Se="onPointerEnter",me="pointer"),di=Pe==null?De:yt(Pe),Ce=qt==null?De:yt(qt),De=new cn(Ze,me+"leave",Pe,f,Xe),De.target=di,De.relatedTarget=Ce,Ze=null,st(Xe)===Re&&(cn=new cn(Se,me+"enter",qt,f,Xe),cn.target=Ce,cn.relatedTarget=di,Ze=cn),di=Ze,Pe&&qt)t:{for(cn=s4,Se=Pe,me=qt,Ce=0,Ze=Se;Ze;Ze=cn(Ze))Ce++;Ze=0;for(var sn=me;sn;sn=cn(sn))Ze++;for(;0<Ce-Ze;)Se=cn(Se),Ce--;for(;0<Ze-Ce;)me=cn(me),Ze--;for(;Ce--;){if(Se===me||me!==null&&Se===me.alternate){cn=Se;break t}Se=cn(Se),me=cn(me)}cn=null}else cn=null;Pe!==null&&RC($e,De,Pe,cn,!1),qt!==null&&di!==null&&RC($e,di,qt,cn,!0)}}e:{if(De=Re?yt(Re):window,Pe=De.nodeName&&De.nodeName.toLowerCase(),Pe==="select"||Pe==="input"&&De.type==="file")var ni=ym;else if(vm(De))if(pf)ni=U_;else{ni=zo;var Kt=mf}else Pe=De.nodeName,!Pe||Pe.toLowerCase()!=="input"||De.type!=="checkbox"&&De.type!=="radio"?Re&&_s(Re.elementType)&&(ni=ym):ni=N_;if(ni&&(ni=ni(a,Re))){td($e,ni,f,Xe);break e}Kt&&Kt(a,De,Re),a==="focusout"&&Re&&De.type==="number"&&Re.memoizedProps.value!=null&&an(De,"number",De.value)}switch(Kt=Re?yt(Re):window,a){case"focusin":(vm(Kt)||Kt.contentEditable==="true")&&(Hc=Kt,ad=Re,Pc=null);break;case"focusout":Pc=ad=Hc=null;break;case"mousedown":xs=!0;break;case"contextmenu":case"mouseup":case"dragend":xs=!1,sd($e,f,Xe);break;case"selectionchange":if(L_)break;case"keydown":case"keyup":sd($e,f,Xe)}var Tn;if(Ll)e:{switch(a){case"compositionstart":var Vn="onCompositionStart";break e;case"compositionend":Vn="onCompositionEnd";break e;case"compositionupdate":Vn="onCompositionUpdate";break e}Vn=void 0}else Go?$h(a,f)&&(Vn="onCompositionEnd"):a==="keydown"&&f.keyCode===229&&(Vn="onCompositionStart");Vn&&(xa&&f.locale!=="ko"&&(Go||Vn!=="onCompositionStart"?Vn==="onCompositionEnd"&&Go&&(Tn=Kh()):(Oo=Xe,qh="value"in Oo?Oo.value:Oo.textContent,Go=!0)),Kt=xy(Re,Vn),0<Kt.length&&(Vn=new lm(Vn,a,null,f,Xe),$e.push({event:Vn,listeners:Kt}),Tn?Vn.data=Tn:(Tn=Nc(f),Tn!==null&&(Vn.data=Tn)))),(Tn=Ol?ed(a,f):w_(a,f))&&(Vn=xy(Re,"onBeforeInput"),0<Vn.length&&(Kt=new lm("onBeforeInput","beforeinput",null,f,Xe),$e.push({event:Kt,listeners:Vn}),Kt.data=Tn)),t4($e,a,Re,f,Xe)}TC($e,r)})}function yg(a,r,f){return{instance:a,listener:r,currentTarget:f}}function xy(a,r){for(var f=r+"Capture",m=[];a!==null;){var A=a,E=A.stateNode;if(A=A.tag,A!==5&&A!==26&&A!==27||E===null||(A=Nl(a,f),A!=null&&m.unshift(yg(a,A,E)),A=Nl(a,r),A!=null&&m.push(yg(a,A,E))),a.tag===3)return m;a=a.return}return[]}function s4(a){if(a===null)return null;do a=a.return;while(a&&a.tag!==5&&a.tag!==27);return a||null}function RC(a,r,f,m,A){for(var E=r._reactName,L=[];f!==null&&f!==m;){var Y=f,re=Y.alternate,Re=Y.stateNode;if(Y=Y.tag,re!==null&&re===m)break;Y!==5&&Y!==26&&Y!==27||Re===null||(re=Re,A?(Re=Nl(f,E),Re!=null&&L.unshift(yg(f,Re,re))):A||(Re=Nl(f,E),Re!=null&&L.push(yg(f,Re,re)))),f=f.return}L.length!==0&&a.push({event:r,listeners:L})}var r4=/\r\n?/g,o4=/\u0000|\uFFFD/g;function wC(a){return(typeof a=="string"?a:""+a).replace(r4,`
|
|
9
9
|
`).replace(o4,"")}function BC(a,r){return r=wC(r),wC(a)===r}function hi(a,r,f,m,A,E){switch(f){case"children":typeof m=="string"?r==="body"||r==="textarea"&&m===""||jn(a,m):(typeof m=="number"||typeof m=="bigint")&&r!=="body"&&jn(a,""+m);break;case"className":je(a,"class",m);break;case"tabIndex":je(a,"tabindex",m);break;case"dir":case"role":case"viewBox":case"width":case"height":je(a,f,m);break;case"style":Er(a,m,E);break;case"data":if(r!=="object"){je(a,"data",m);break}case"src":case"href":if(m===""&&(r!=="a"||f!=="href")){a.removeAttribute(f);break}if(m==null||typeof m=="function"||typeof m=="symbol"||typeof m=="boolean"){a.removeAttribute(f);break}m=af(""+m),a.setAttribute(f,m);break;case"action":case"formAction":if(typeof m=="function"){a.setAttribute(f,"javascript:throw new Error('A React form was unexpectedly submitted. If you called form.submit() manually, consider using form.requestSubmit() instead. If you\\'re trying to use event.stopPropagation() in a submit event handler, consider also calling event.preventDefault().')");break}else typeof E=="function"&&(f==="formAction"?(r!=="input"&&hi(a,r,"name",A.name,A,null),hi(a,r,"formEncType",A.formEncType,A,null),hi(a,r,"formMethod",A.formMethod,A,null),hi(a,r,"formTarget",A.formTarget,A,null)):(hi(a,r,"encType",A.encType,A,null),hi(a,r,"method",A.method,A,null),hi(a,r,"target",A.target,A,null)));if(m==null||typeof m=="symbol"||typeof m=="boolean"){a.removeAttribute(f);break}m=af(""+m),a.setAttribute(f,m);break;case"onClick":m!=null&&(a.onclick=Tr);break;case"onScroll":m!=null&&Fn("scroll",a);break;case"onScrollEnd":m!=null&&Fn("scrollend",a);break;case"dangerouslySetInnerHTML":if(m!=null){if(typeof m!="object"||!("__html"in m))throw Error(n(61));if(f=m.__html,f!=null){if(A.children!=null)throw Error(n(60));a.innerHTML=f}}break;case"multiple":a.multiple=m&&typeof m!="function"&&typeof m!="symbol";break;case"muted":a.muted=m&&typeof m!="function"&&typeof m!="symbol";break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"defaultValue":case"defaultChecked":case"innerHTML":case"ref":break;case"autoFocus":break;case"xlinkHref":if(m==null||typeof m=="function"||typeof m=="boolean"||typeof m=="symbol"){a.removeAttribute("xlink:href");break}f=af(""+m),a.setAttributeNS("http://www.w3.org/1999/xlink","xlink:href",f);break;case"contentEditable":case"spellCheck":case"draggable":case"value":case"autoReverse":case"externalResourcesRequired":case"focusable":case"preserveAlpha":m!=null&&typeof m!="function"&&typeof m!="symbol"?a.setAttribute(f,""+m):a.removeAttribute(f);break;case"inert":case"allowFullScreen":case"async":case"autoPlay":case"controls":case"default":case"defer":case"disabled":case"disablePictureInPicture":case"disableRemotePlayback":case"formNoValidate":case"hidden":case"loop":case"noModule":case"noValidate":case"open":case"playsInline":case"readOnly":case"required":case"reversed":case"scoped":case"seamless":case"itemScope":m&&typeof m!="function"&&typeof m!="symbol"?a.setAttribute(f,""):a.removeAttribute(f);break;case"capture":case"download":m===!0?a.setAttribute(f,""):m!==!1&&m!=null&&typeof m!="function"&&typeof m!="symbol"?a.setAttribute(f,m):a.removeAttribute(f);break;case"cols":case"rows":case"size":case"span":m!=null&&typeof m!="function"&&typeof m!="symbol"&&!isNaN(m)&&1<=m?a.setAttribute(f,m):a.removeAttribute(f);break;case"rowSpan":case"start":m==null||typeof m=="function"||typeof m=="symbol"||isNaN(m)?a.removeAttribute(f):a.setAttribute(f,m);break;case"popover":Fn("beforetoggle",a),Fn("toggle",a),we(a,"popover",m);break;case"xlinkActuate":He(a,"http://www.w3.org/1999/xlink","xlink:actuate",m);break;case"xlinkArcrole":He(a,"http://www.w3.org/1999/xlink","xlink:arcrole",m);break;case"xlinkRole":He(a,"http://www.w3.org/1999/xlink","xlink:role",m);break;case"xlinkShow":He(a,"http://www.w3.org/1999/xlink","xlink:show",m);break;case"xlinkTitle":He(a,"http://www.w3.org/1999/xlink","xlink:title",m);break;case"xlinkType":He(a,"http://www.w3.org/1999/xlink","xlink:type",m);break;case"xmlBase":He(a,"http://www.w3.org/XML/1998/namespace","xml:base",m);break;case"xmlLang":He(a,"http://www.w3.org/XML/1998/namespace","xml:lang",m);break;case"xmlSpace":He(a,"http://www.w3.org/XML/1998/namespace","xml:space",m);break;case"is":we(a,"is",m);break;case"innerText":case"textContent":break;default:(!(2<f.length)||f[0]!=="o"&&f[0]!=="O"||f[1]!=="n"&&f[1]!=="N")&&(f=g_.get(f)||f,we(a,f,m))}}function aM(a,r,f,m,A,E){switch(f){case"style":Er(a,m,E);break;case"dangerouslySetInnerHTML":if(m!=null){if(typeof m!="object"||!("__html"in m))throw Error(n(61));if(f=m.__html,f!=null){if(A.children!=null)throw Error(n(60));a.innerHTML=f}}break;case"children":typeof m=="string"?jn(a,m):(typeof m=="number"||typeof m=="bigint")&&jn(a,""+m);break;case"onScroll":m!=null&&Fn("scroll",a);break;case"onScrollEnd":m!=null&&Fn("scrollend",a);break;case"onClick":m!=null&&(a.onclick=Tr);break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"innerHTML":case"ref":break;case"innerText":case"textContent":break;default:if(!ue.hasOwnProperty(f))e:{if(f[0]==="o"&&f[1]==="n"&&(A=f.endsWith("Capture"),r=f.slice(2,A?f.length-7:void 0),E=a[G]||null,E=E!=null?E[f]:null,typeof E=="function"&&a.removeEventListener(r,E,A),typeof m=="function")){typeof E!="function"&&E!==null&&(f in a?a[f]=null:a.hasAttribute(f)&&a.removeAttribute(f)),a.addEventListener(r,m,A);break e}f in a?a[f]=m:m===!0?a.setAttribute(f,""):we(a,f,m)}}}function Wa(a,r,f){switch(r){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"img":Fn("error",a),Fn("load",a);var m=!1,A=!1,E;for(E in f)if(f.hasOwnProperty(E)){var L=f[E];if(L!=null)switch(E){case"src":m=!0;break;case"srcSet":A=!0;break;case"children":case"dangerouslySetInnerHTML":throw Error(n(137,r));default:hi(a,r,E,L,f,null)}}A&&hi(a,r,"srcSet",f.srcSet,f,null),m&&hi(a,r,"src",f.src,f,null);return;case"input":Fn("invalid",a);var Y=E=L=A=null,re=null,Re=null;for(m in f)if(f.hasOwnProperty(m)){var Xe=f[m];if(Xe!=null)switch(m){case"name":A=Xe;break;case"type":L=Xe;break;case"checked":re=Xe;break;case"defaultChecked":Re=Xe;break;case"value":E=Xe;break;case"defaultValue":Y=Xe;break;case"children":case"dangerouslySetInnerHTML":if(Xe!=null)throw Error(n(137,r));break;default:hi(a,r,m,Xe,f,null)}}Wn(a,E,Y,re,Re,L,A,!1);return;case"select":Fn("invalid",a),m=L=E=null;for(A in f)if(f.hasOwnProperty(A)&&(Y=f[A],Y!=null))switch(A){case"value":E=Y;break;case"defaultValue":L=Y;break;case"multiple":m=Y;default:hi(a,r,A,Y,f,null)}r=E,f=L,a.multiple=!!m,r!=null?Xn(a,!!m,r,!1):f!=null&&Xn(a,!!m,f,!0);return;case"textarea":Fn("invalid",a),E=A=m=null;for(L in f)if(f.hasOwnProperty(L)&&(Y=f[L],Y!=null))switch(L){case"value":m=Y;break;case"defaultValue":A=Y;break;case"children":E=Y;break;case"dangerouslySetInnerHTML":if(Y!=null)throw Error(n(91));break;default:hi(a,r,L,Y,f,null)}Pn(a,m,A,E);return;case"option":for(re in f)f.hasOwnProperty(re)&&(m=f[re],m!=null)&&(re==="selected"?a.selected=m&&typeof m!="function"&&typeof m!="symbol":hi(a,r,re,m,f,null));return;case"dialog":Fn("beforetoggle",a),Fn("toggle",a),Fn("cancel",a),Fn("close",a);break;case"iframe":case"object":Fn("load",a);break;case"video":case"audio":for(m=0;m<_g.length;m++)Fn(_g[m],a);break;case"image":Fn("error",a),Fn("load",a);break;case"details":Fn("toggle",a);break;case"embed":case"source":case"link":Fn("error",a),Fn("load",a);case"area":case"base":case"br":case"col":case"hr":case"keygen":case"meta":case"param":case"track":case"wbr":case"menuitem":for(Re in f)if(f.hasOwnProperty(Re)&&(m=f[Re],m!=null))switch(Re){case"children":case"dangerouslySetInnerHTML":throw Error(n(137,r));default:hi(a,r,Re,m,f,null)}return;default:if(_s(r)){for(Xe in f)f.hasOwnProperty(Xe)&&(m=f[Xe],m!==void 0&&aM(a,r,Xe,m,f,void 0));return}}for(Y in f)f.hasOwnProperty(Y)&&(m=f[Y],m!=null&&hi(a,r,Y,m,f,null))}function l4(a,r,f,m){switch(r){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"input":var A=null,E=null,L=null,Y=null,re=null,Re=null,Xe=null;for(Pe in f){var $e=f[Pe];if(f.hasOwnProperty(Pe)&&$e!=null)switch(Pe){case"checked":break;case"value":break;case"defaultValue":re=$e;default:m.hasOwnProperty(Pe)||hi(a,r,Pe,null,m,$e)}}for(var De in m){var Pe=m[De];if($e=f[De],m.hasOwnProperty(De)&&(Pe!=null||$e!=null))switch(De){case"type":E=Pe;break;case"name":A=Pe;break;case"checked":Re=Pe;break;case"defaultChecked":Xe=Pe;break;case"value":L=Pe;break;case"defaultValue":Y=Pe;break;case"children":case"dangerouslySetInnerHTML":if(Pe!=null)throw Error(n(137,r));break;default:Pe!==$e&&hi(a,r,De,Pe,m,$e)}}un(a,L,Y,re,Re,Xe,E,A);return;case"select":Pe=L=Y=De=null;for(E in f)if(re=f[E],f.hasOwnProperty(E)&&re!=null)switch(E){case"value":break;case"multiple":Pe=re;default:m.hasOwnProperty(E)||hi(a,r,E,null,m,re)}for(A in m)if(E=m[A],re=f[A],m.hasOwnProperty(A)&&(E!=null||re!=null))switch(A){case"value":De=E;break;case"defaultValue":Y=E;break;case"multiple":L=E;default:E!==re&&hi(a,r,A,E,m,re)}r=Y,f=L,m=Pe,De!=null?Xn(a,!!f,De,!1):!!m!=!!f&&(r!=null?Xn(a,!!f,r,!0):Xn(a,!!f,f?[]:"",!1));return;case"textarea":Pe=De=null;for(Y in f)if(A=f[Y],f.hasOwnProperty(Y)&&A!=null&&!m.hasOwnProperty(Y))switch(Y){case"value":break;case"children":break;default:hi(a,r,Y,null,m,A)}for(L in m)if(A=m[L],E=f[L],m.hasOwnProperty(L)&&(A!=null||E!=null))switch(L){case"value":De=A;break;case"defaultValue":Pe=A;break;case"children":break;case"dangerouslySetInnerHTML":if(A!=null)throw Error(n(91));break;default:A!==E&&hi(a,r,L,A,m,E)}rn(a,De,Pe);return;case"option":for(var qt in f)De=f[qt],f.hasOwnProperty(qt)&&De!=null&&!m.hasOwnProperty(qt)&&(qt==="selected"?a.selected=!1:hi(a,r,qt,null,m,De));for(re in m)De=m[re],Pe=f[re],m.hasOwnProperty(re)&&De!==Pe&&(De!=null||Pe!=null)&&(re==="selected"?a.selected=De&&typeof De!="function"&&typeof De!="symbol":hi(a,r,re,De,m,Pe));return;case"img":case"link":case"area":case"base":case"br":case"col":case"embed":case"hr":case"keygen":case"meta":case"param":case"source":case"track":case"wbr":case"menuitem":for(var cn in f)De=f[cn],f.hasOwnProperty(cn)&&De!=null&&!m.hasOwnProperty(cn)&&hi(a,r,cn,null,m,De);for(Re in m)if(De=m[Re],Pe=f[Re],m.hasOwnProperty(Re)&&De!==Pe&&(De!=null||Pe!=null))switch(Re){case"children":case"dangerouslySetInnerHTML":if(De!=null)throw Error(n(137,r));break;default:hi(a,r,Re,De,m,Pe)}return;default:if(_s(r)){for(var di in f)De=f[di],f.hasOwnProperty(di)&&De!==void 0&&!m.hasOwnProperty(di)&&aM(a,r,di,void 0,m,De);for(Xe in m)De=m[Xe],Pe=f[Xe],!m.hasOwnProperty(Xe)||De===Pe||De===void 0&&Pe===void 0||aM(a,r,Xe,De,m,Pe);return}}for(var Se in f)De=f[Se],f.hasOwnProperty(Se)&&De!=null&&!m.hasOwnProperty(Se)&&hi(a,r,Se,null,m,De);for($e in m)De=m[$e],Pe=f[$e],!m.hasOwnProperty($e)||De===Pe||De==null&&Pe==null||hi(a,r,$e,De,m,Pe)}function DC(a){switch(a){case"css":case"script":case"font":case"img":case"image":case"input":case"link":return!0;default:return!1}}function c4(){if(typeof performance.getEntriesByType=="function"){for(var a=0,r=0,f=performance.getEntriesByType("resource"),m=0;m<f.length;m++){var A=f[m],E=A.transferSize,L=A.initiatorType,Y=A.duration;if(E&&Y&&DC(L)){for(L=0,Y=A.responseEnd,m+=1;m<f.length;m++){var re=f[m],Re=re.startTime;if(Re>Y)break;var Xe=re.transferSize,$e=re.initiatorType;Xe&&DC($e)&&(re=re.responseEnd,L+=Xe*(re<Y?1:(Y-Re)/(re-Re)))}if(--m,r+=8*(E+L)/(A.duration/1e3),a++,10<a)break}}if(0<a)return r/a/1e6}return navigator.connection&&(a=navigator.connection.downlink,typeof a=="number")?a:5}var sM=null,rM=null;function Ay(a){return a.nodeType===9?a:a.ownerDocument}function NC(a){switch(a){case"http://www.w3.org/2000/svg":return 1;case"http://www.w3.org/1998/Math/MathML":return 2;default:return 0}}function UC(a,r){if(a===0)switch(r){case"svg":return 1;case"math":return 2;default:return 0}return a===1&&r==="foreignObject"?0:a}function oM(a,r){return a==="textarea"||a==="noscript"||typeof r.children=="string"||typeof r.children=="number"||typeof r.children=="bigint"||typeof r.dangerouslySetInnerHTML=="object"&&r.dangerouslySetInnerHTML!==null&&r.dangerouslySetInnerHTML.__html!=null}var lM=null;function u4(){var a=window.event;return a&&a.type==="popstate"?a===lM?!1:(lM=a,!0):(lM=null,!1)}var LC=typeof setTimeout=="function"?setTimeout:void 0,f4=typeof clearTimeout=="function"?clearTimeout:void 0,OC=typeof Promise=="function"?Promise:void 0,h4=typeof queueMicrotask=="function"?queueMicrotask:typeof OC<"u"?function(a){return OC.resolve(null).then(a).catch(d4)}:LC;function d4(a){setTimeout(function(){throw a})}function cu(a){return a==="head"}function IC(a,r){var f=r,m=0;do{var A=f.nextSibling;if(a.removeChild(f),A&&A.nodeType===8)if(f=A.data,f==="/$"||f==="/&"){if(m===0){a.removeChild(A),Kd(r);return}m--}else if(f==="$"||f==="$?"||f==="$~"||f==="$!"||f==="&")m++;else if(f==="html")xg(a.ownerDocument.documentElement);else if(f==="head"){f=a.ownerDocument.head,xg(f);for(var E=f.firstChild;E;){var L=E.nextSibling,Y=E.nodeName;E[ct]||Y==="SCRIPT"||Y==="STYLE"||Y==="LINK"&&E.rel.toLowerCase()==="stylesheet"||f.removeChild(E),E=L}}else f==="body"&&xg(a.ownerDocument.body);f=A}while(f);Kd(r)}function FC(a,r){var f=a;a=0;do{var m=f.nextSibling;if(f.nodeType===1?r?(f._stashedDisplay=f.style.display,f.style.display="none"):(f.style.display=f._stashedDisplay||"",f.getAttribute("style")===""&&f.removeAttribute("style")):f.nodeType===3&&(r?(f._stashedText=f.nodeValue,f.nodeValue=""):f.nodeValue=f._stashedText||""),m&&m.nodeType===8)if(f=m.data,f==="/$"){if(a===0)break;a--}else f!=="$"&&f!=="$?"&&f!=="$~"&&f!=="$!"||a++;f=m}while(f)}function cM(a){var r=a.firstChild;for(r&&r.nodeType===10&&(r=r.nextSibling);r;){var f=r;switch(r=r.nextSibling,f.nodeName){case"HTML":case"HEAD":case"BODY":cM(f),at(f);continue;case"SCRIPT":case"STYLE":continue;case"LINK":if(f.rel.toLowerCase()==="stylesheet")continue}a.removeChild(f)}}function p4(a,r,f,m){for(;a.nodeType===1;){var A=f;if(a.nodeName.toLowerCase()!==r.toLowerCase()){if(!m&&(a.nodeName!=="INPUT"||a.type!=="hidden"))break}else if(m){if(!a[ct])switch(r){case"meta":if(!a.hasAttribute("itemprop"))break;return a;case"link":if(E=a.getAttribute("rel"),E==="stylesheet"&&a.hasAttribute("data-precedence"))break;if(E!==A.rel||a.getAttribute("href")!==(A.href==null||A.href===""?null:A.href)||a.getAttribute("crossorigin")!==(A.crossOrigin==null?null:A.crossOrigin)||a.getAttribute("title")!==(A.title==null?null:A.title))break;return a;case"style":if(a.hasAttribute("data-precedence"))break;return a;case"script":if(E=a.getAttribute("src"),(E!==(A.src==null?null:A.src)||a.getAttribute("type")!==(A.type==null?null:A.type)||a.getAttribute("crossorigin")!==(A.crossOrigin==null?null:A.crossOrigin))&&E&&a.hasAttribute("async")&&!a.hasAttribute("itemprop"))break;return a;default:return a}}else if(r==="input"&&a.type==="hidden"){var E=A.name==null?null:""+A.name;if(A.type==="hidden"&&a.getAttribute("name")===E)return a}else return a;if(a=kr(a.nextSibling),a===null)break}return null}function m4(a,r,f){if(r==="")return null;for(;a.nodeType!==3;)if((a.nodeType!==1||a.nodeName!=="INPUT"||a.type!=="hidden")&&!f||(a=kr(a.nextSibling),a===null))return null;return a}function HC(a,r){for(;a.nodeType!==8;)if((a.nodeType!==1||a.nodeName!=="INPUT"||a.type!=="hidden")&&!r||(a=kr(a.nextSibling),a===null))return null;return a}function uM(a){return a.data==="$?"||a.data==="$~"}function fM(a){return a.data==="$!"||a.data==="$?"&&a.ownerDocument.readyState!=="loading"}function g4(a,r){var f=a.ownerDocument;if(a.data==="$~")a._reactRetry=r;else if(a.data!=="$?"||f.readyState!=="loading")r();else{var m=function(){r(),f.removeEventListener("DOMContentLoaded",m)};f.addEventListener("DOMContentLoaded",m),a._reactRetry=m}}function kr(a){for(;a!=null;a=a.nextSibling){var r=a.nodeType;if(r===1||r===3)break;if(r===8){if(r=a.data,r==="$"||r==="$!"||r==="$?"||r==="$~"||r==="&"||r==="F!"||r==="F")break;if(r==="/$"||r==="/&")return null}}return a}var hM=null;function PC(a){a=a.nextSibling;for(var r=0;a;){if(a.nodeType===8){var f=a.data;if(f==="/$"||f==="/&"){if(r===0)return kr(a.nextSibling);r--}else f!=="$"&&f!=="$!"&&f!=="$?"&&f!=="$~"&&f!=="&"||r++}a=a.nextSibling}return null}function GC(a){a=a.previousSibling;for(var r=0;a;){if(a.nodeType===8){var f=a.data;if(f==="$"||f==="$!"||f==="$?"||f==="$~"||f==="&"){if(r===0)return a;r--}else f!=="/$"&&f!=="/&"||r++}a=a.previousSibling}return null}function zC(a,r,f){switch(r=Ay(f),a){case"html":if(a=r.documentElement,!a)throw Error(n(452));return a;case"head":if(a=r.head,!a)throw Error(n(453));return a;case"body":if(a=r.body,!a)throw Error(n(454));return a;default:throw Error(n(451))}}function xg(a){for(var r=a.attributes;r.length;)a.removeAttributeNode(r[0]);at(a)}var Xr=new Map,VC=new Set;function Sy(a){return typeof a.getRootNode=="function"?a.getRootNode():a.nodeType===9?a:a.ownerDocument}var ac=W.d;W.d={f:v4,r:_4,D:y4,C:x4,L:A4,m:S4,X:b4,S:M4,M:E4};function v4(){var a=ac.f(),r=J();return a||r}function _4(a){var r=tt(a);r!==null&&r.tag===5&&r.type==="form"?cg(r):ac.r(a)}var Yd=typeof document>"u"?null:document;function kC(a,r,f){var m=Yd;if(m&&typeof r=="string"&&r){var A=vt(r);A='link[rel="'+a+'"][href="'+A+'"]',typeof f=="string"&&(A+='[crossorigin="'+f+'"]'),VC.has(A)||(VC.add(A),a={rel:a,crossOrigin:f,href:r},m.querySelector(A)===null&&(r=m.createElement("link"),Wa(r,"link",a),k(r),m.head.appendChild(r)))}}function y4(a){ac.D(a),kC("dns-prefetch",a,null)}function x4(a,r){ac.C(a,r),kC("preconnect",a,r)}function A4(a,r,f){ac.L(a,r,f);var m=Yd;if(m&&a&&r){var A='link[rel="preload"][as="'+vt(r)+'"]';r==="image"&&f&&f.imageSrcSet?(A+='[imagesrcset="'+vt(f.imageSrcSet)+'"]',typeof f.imageSizes=="string"&&(A+='[imagesizes="'+vt(f.imageSizes)+'"]')):A+='[href="'+vt(a)+'"]';var E=A;switch(r){case"style":E=Jd(a);break;case"script":E=qd(a)}Xr.has(E)||(a=v({rel:"preload",href:r==="image"&&f&&f.imageSrcSet?void 0:a,as:r},f),Xr.set(E,a),m.querySelector(A)!==null||r==="style"&&m.querySelector(Ag(E))||r==="script"&&m.querySelector(Sg(E))||(r=m.createElement("link"),Wa(r,"link",a),k(r),m.head.appendChild(r)))}}function S4(a,r){ac.m(a,r);var f=Yd;if(f&&a){var m=r&&typeof r.as=="string"?r.as:"script",A='link[rel="modulepreload"][as="'+vt(m)+'"][href="'+vt(a)+'"]',E=A;switch(m){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":E=qd(a)}if(!Xr.has(E)&&(a=v({rel:"modulepreload",href:a},r),Xr.set(E,a),f.querySelector(A)===null)){switch(m){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(f.querySelector(Sg(E)))return}m=f.createElement("link"),Wa(m,"link",a),k(m),f.head.appendChild(m)}}}function M4(a,r,f){ac.S(a,r,f);var m=Yd;if(m&&a){var A=dt(m).hoistableStyles,E=Jd(a);r=r||"default";var L=A.get(E);if(!L){var Y={loading:0,preload:null};if(L=m.querySelector(Ag(E)))Y.loading=5;else{a=v({rel:"stylesheet",href:a,"data-precedence":r},f),(f=Xr.get(E))&&dM(a,f);var re=L=m.createElement("link");k(re),Wa(re,"link",a),re._p=new Promise(function(Re,Xe){re.onload=Re,re.onerror=Xe}),re.addEventListener("load",function(){Y.loading|=1}),re.addEventListener("error",function(){Y.loading|=2}),Y.loading|=4,My(L,r,m)}L={type:"stylesheet",instance:L,count:1,state:Y},A.set(E,L)}}}function b4(a,r){ac.X(a,r);var f=Yd;if(f&&a){var m=dt(f).hoistableScripts,A=qd(a),E=m.get(A);E||(E=f.querySelector(Sg(A)),E||(a=v({src:a,async:!0},r),(r=Xr.get(A))&&pM(a,r),E=f.createElement("script"),k(E),Wa(E,"link",a),f.head.appendChild(E)),E={type:"script",instance:E,count:1,state:null},m.set(A,E))}}function E4(a,r){ac.M(a,r);var f=Yd;if(f&&a){var m=dt(f).hoistableScripts,A=qd(a),E=m.get(A);E||(E=f.querySelector(Sg(A)),E||(a=v({src:a,async:!0,type:"module"},r),(r=Xr.get(A))&&pM(a,r),E=f.createElement("script"),k(E),Wa(E,"link",a),f.head.appendChild(E)),E={type:"script",instance:E,count:1,state:null},m.set(A,E))}}function XC(a,r,f,m){var A=(A=he.current)?Sy(A):null;if(!A)throw Error(n(446));switch(a){case"meta":case"title":return null;case"style":return typeof f.precedence=="string"&&typeof f.href=="string"?(r=Jd(f.href),f=dt(A).hoistableStyles,m=f.get(r),m||(m={type:"style",instance:null,count:0,state:null},f.set(r,m)),m):{type:"void",instance:null,count:0,state:null};case"link":if(f.rel==="stylesheet"&&typeof f.href=="string"&&typeof f.precedence=="string"){a=Jd(f.href);var E=dt(A).hoistableStyles,L=E.get(a);if(L||(A=A.ownerDocument||A,L={type:"stylesheet",instance:null,count:0,state:{loading:0,preload:null}},E.set(a,L),(E=A.querySelector(Ag(a)))&&!E._p&&(L.instance=E,L.state.loading=5),Xr.has(a)||(f={rel:"preload",as:"style",href:f.href,crossOrigin:f.crossOrigin,integrity:f.integrity,media:f.media,hrefLang:f.hrefLang,referrerPolicy:f.referrerPolicy},Xr.set(a,f),E||T4(A,a,f,L.state))),r&&m===null)throw Error(n(528,""));return L}if(r&&m!==null)throw Error(n(529,""));return null;case"script":return r=f.async,f=f.src,typeof f=="string"&&r&&typeof r!="function"&&typeof r!="symbol"?(r=qd(f),f=dt(A).hoistableScripts,m=f.get(r),m||(m={type:"script",instance:null,count:0,state:null},f.set(r,m)),m):{type:"void",instance:null,count:0,state:null};default:throw Error(n(444,a))}}function Jd(a){return'href="'+vt(a)+'"'}function Ag(a){return'link[rel="stylesheet"]['+a+"]"}function YC(a){return v({},a,{"data-precedence":a.precedence,precedence:null})}function T4(a,r,f,m){a.querySelector('link[rel="preload"][as="style"]['+r+"]")?m.loading=1:(r=a.createElement("link"),m.preload=r,r.addEventListener("load",function(){return m.loading|=1}),r.addEventListener("error",function(){return m.loading|=2}),Wa(r,"link",f),k(r),a.head.appendChild(r))}function qd(a){return'[src="'+vt(a)+'"]'}function Sg(a){return"script[async]"+a}function JC(a,r,f){if(r.count++,r.instance===null)switch(r.type){case"style":var m=a.querySelector('style[data-href~="'+vt(f.href)+'"]');if(m)return r.instance=m,k(m),m;var A=v({},f,{"data-href":f.href,"data-precedence":f.precedence,href:null,precedence:null});return m=(a.ownerDocument||a).createElement("style"),k(m),Wa(m,"style",A),My(m,f.precedence,a),r.instance=m;case"stylesheet":A=Jd(f.href);var E=a.querySelector(Ag(A));if(E)return r.state.loading|=4,r.instance=E,k(E),E;m=YC(f),(A=Xr.get(A))&&dM(m,A),E=(a.ownerDocument||a).createElement("link"),k(E);var L=E;return L._p=new Promise(function(Y,re){L.onload=Y,L.onerror=re}),Wa(E,"link",m),r.state.loading|=4,My(E,f.precedence,a),r.instance=E;case"script":return E=qd(f.src),(A=a.querySelector(Sg(E)))?(r.instance=A,k(A),A):(m=f,(A=Xr.get(E))&&(m=v({},f),pM(m,A)),a=a.ownerDocument||a,A=a.createElement("script"),k(A),Wa(A,"link",m),a.head.appendChild(A),r.instance=A);case"void":return null;default:throw Error(n(443,r.type))}else r.type==="stylesheet"&&(r.state.loading&4)===0&&(m=r.instance,r.state.loading|=4,My(m,f.precedence,a));return r.instance}function My(a,r,f){for(var m=f.querySelectorAll('link[rel="stylesheet"][data-precedence],style[data-precedence]'),A=m.length?m[m.length-1]:null,E=A,L=0;L<m.length;L++){var Y=m[L];if(Y.dataset.precedence===r)E=Y;else if(E!==A)break}E?E.parentNode.insertBefore(a,E.nextSibling):(r=f.nodeType===9?f.head:f,r.insertBefore(a,r.firstChild))}function dM(a,r){a.crossOrigin==null&&(a.crossOrigin=r.crossOrigin),a.referrerPolicy==null&&(a.referrerPolicy=r.referrerPolicy),a.title==null&&(a.title=r.title)}function pM(a,r){a.crossOrigin==null&&(a.crossOrigin=r.crossOrigin),a.referrerPolicy==null&&(a.referrerPolicy=r.referrerPolicy),a.integrity==null&&(a.integrity=r.integrity)}var by=null;function qC(a,r,f){if(by===null){var m=new Map,A=by=new Map;A.set(f,m)}else A=by,m=A.get(f),m||(m=new Map,A.set(f,m));if(m.has(a))return m;for(m.set(a,null),f=f.getElementsByTagName(a),A=0;A<f.length;A++){var E=f[A];if(!(E[ct]||E[mn]||a==="link"&&E.getAttribute("rel")==="stylesheet")&&E.namespaceURI!=="http://www.w3.org/2000/svg"){var L=E.getAttribute(r)||"";L=a+L;var Y=m.get(L);Y?Y.push(E):m.set(L,[E])}}return m}function KC(a,r,f){a=a.ownerDocument||a,a.head.insertBefore(f,r==="title"?a.querySelector("head > title"):null)}function C4(a,r,f){if(f===1||r.itemProp!=null)return!1;switch(a){case"meta":case"title":return!0;case"style":if(typeof r.precedence!="string"||typeof r.href!="string"||r.href==="")break;return!0;case"link":if(typeof r.rel!="string"||typeof r.href!="string"||r.href===""||r.onLoad||r.onError)break;return r.rel==="stylesheet"?(a=r.disabled,typeof r.precedence=="string"&&a==null):!0;case"script":if(r.async&&typeof r.async!="function"&&typeof r.async!="symbol"&&!r.onLoad&&!r.onError&&r.src&&typeof r.src=="string")return!0}return!1}function WC(a){return!(a.type==="stylesheet"&&(a.state.loading&3)===0)}function R4(a,r,f,m){if(f.type==="stylesheet"&&(typeof m.media!="string"||matchMedia(m.media).matches!==!1)&&(f.state.loading&4)===0){if(f.instance===null){var A=Jd(m.href),E=r.querySelector(Ag(A));if(E){r=E._p,r!==null&&typeof r=="object"&&typeof r.then=="function"&&(a.count++,a=Ey.bind(a),r.then(a,a)),f.state.loading|=4,f.instance=E,k(E);return}E=r.ownerDocument||r,m=YC(m),(A=Xr.get(A))&&dM(m,A),E=E.createElement("link"),k(E);var L=E;L._p=new Promise(function(Y,re){L.onload=Y,L.onerror=re}),Wa(E,"link",m),f.instance=E}a.stylesheets===null&&(a.stylesheets=new Map),a.stylesheets.set(f,r),(r=f.state.preload)&&(f.state.loading&3)===0&&(a.count++,f=Ey.bind(a),r.addEventListener("load",f),r.addEventListener("error",f))}}var mM=0;function w4(a,r){return a.stylesheets&&a.count===0&&Cy(a,a.stylesheets),0<a.count||0<a.imgCount?function(f){var m=setTimeout(function(){if(a.stylesheets&&Cy(a,a.stylesheets),a.unsuspend){var E=a.unsuspend;a.unsuspend=null,E()}},6e4+r);0<a.imgBytes&&mM===0&&(mM=62500*c4());var A=setTimeout(function(){if(a.waitingForImages=!1,a.count===0&&(a.stylesheets&&Cy(a,a.stylesheets),a.unsuspend)){var E=a.unsuspend;a.unsuspend=null,E()}},(a.imgBytes>mM?50:800)+r);return a.unsuspend=f,function(){a.unsuspend=null,clearTimeout(m),clearTimeout(A)}}:null}function Ey(){if(this.count--,this.count===0&&(this.imgCount===0||!this.waitingForImages)){if(this.stylesheets)Cy(this,this.stylesheets);else if(this.unsuspend){var a=this.unsuspend;this.unsuspend=null,a()}}}var Ty=null;function Cy(a,r){a.stylesheets=null,a.unsuspend!==null&&(a.count++,Ty=new Map,r.forEach(B4,a),Ty=null,Ey.call(a))}function B4(a,r){if(!(r.state.loading&4)){var f=Ty.get(a);if(f)var m=f.get(null);else{f=new Map,Ty.set(a,f);for(var A=a.querySelectorAll("link[data-precedence],style[data-precedence]"),E=0;E<A.length;E++){var L=A[E];(L.nodeName==="LINK"||L.getAttribute("media")!=="not all")&&(f.set(L.dataset.precedence,L),m=L)}m&&f.set(null,m)}A=r.instance,L=A.getAttribute("data-precedence"),E=f.get(L)||m,E===m&&f.set(null,A),f.set(L,A),this.count++,m=Ey.bind(this),A.addEventListener("load",m),A.addEventListener("error",m),E?E.parentNode.insertBefore(A,E.nextSibling):(a=a.nodeType===9?a.head:a,a.insertBefore(A,a.firstChild)),r.state.loading|=4}}var Mg={$$typeof:D,Provider:null,Consumer:null,_currentValue:ee,_currentValue2:ee,_threadCount:0};function D4(a,r,f,m,A,E,L,Y,re){this.tag=1,this.containerInfo=a,this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.next=this.pendingContext=this.context=this.cancelPendingCommit=null,this.callbackPriority=0,this.expirationTimes=Mn(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=Mn(0),this.hiddenUpdates=Mn(null),this.identifierPrefix=m,this.onUncaughtError=A,this.onCaughtError=E,this.onRecoverableError=L,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=re,this.incompleteTransitions=new Map}function jC(a,r,f,m,A,E,L,Y,re,Re,Xe,$e){return a=new D4(a,r,f,L,re,Re,Xe,$e,Y),r=1,E===!0&&(r|=24),E=ka(3,null,null,r),a.current=E,E.stateNode=a,r=Dm(),r.refCount++,a.pooledCache=r,r.refCount++,E.memoizedState={element:m,isDehydrated:f,cache:r},Fm(E),a}function ZC(a){return a?(a=Ko,a):Ko}function QC(a,r,f,m,A,E){A=ZC(A),m.context===null?m.context=A:m.pendingContext=A,m=Lr(r),m.payload={element:f},E=E===void 0?null:E,E!==null&&(m.callback=E),f=ho(a,m,r),f!==null&&(u(f,a,r),nl(f,a,r))}function $C(a,r){if(a=a.memoizedState,a!==null&&a.dehydrated!==null){var f=a.retryLane;a.retryLane=f!==0&&f<r?f:r}}function gM(a,r){$C(a,r),(a=a.alternate)&&$C(a,r)}function eR(a){if(a.tag===13||a.tag===31){var r=qo(a,67108864);r!==null&&u(r,a,67108864),gM(a,67108864)}}function tR(a){if(a.tag===13||a.tag===31){var r=Ka();r=sa(r);var f=qo(a,r);f!==null&&u(f,a,r),gM(a,r)}}var Ry=!0;function N4(a,r,f,m){var A=I.T;I.T=null;var E=W.p;try{W.p=2,vM(a,r,f,m)}finally{W.p=E,I.T=A}}function U4(a,r,f,m){var A=I.T;I.T=null;var E=W.p;try{W.p=8,vM(a,r,f,m)}finally{W.p=E,I.T=A}}function vM(a,r,f,m){if(Ry){var A=_M(m);if(A===null)iM(a,r,m,wy,f),iR(a,m);else if(O4(A,a,r,f,m))m.stopPropagation();else if(iR(a,m),r&4&&-1<L4.indexOf(a)){for(;A!==null;){var E=tt(A);if(E!==null)switch(E.tag){case 3:if(E=E.stateNode,E.current.memoizedState.isDehydrated){var L=Qe(E.pendingLanes);if(L!==0){var Y=E;for(Y.pendingLanes|=2,Y.entangledLanes|=2;L;){var re=1<<31-bt(L);Y.entanglements[1]|=re,L&=~re}fl(E),(Gn&6)===0&&(Ls=P()+500,vg(0))}}break;case 31:case 13:Y=qo(E,2),Y!==null&&u(Y,E,2),J(),gM(E,2)}if(E=_M(m),E===null&&iM(a,r,m,wy,f),E===A)break;A=E}A!==null&&m.stopPropagation()}else iM(a,r,m,null,f)}}function _M(a){return a=Xh(a),yM(a)}var wy=null;function yM(a){if(wy=null,a=st(a),a!==null){var r=o(a);if(r===null)a=null;else{var f=r.tag;if(f===13){if(a=l(r),a!==null)return a;a=null}else if(f===31){if(a=h(r),a!==null)return a;a=null}else if(f===3){if(r.stateNode.current.memoizedState.isDehydrated)return r.tag===3?r.stateNode.containerInfo:null;a=null}else r!==a&&(a=null)}}return wy=a,null}function nR(a){switch(a){case"beforetoggle":case"cancel":case"click":case"close":case"contextmenu":case"copy":case"cut":case"auxclick":case"dblclick":case"dragend":case"dragstart":case"drop":case"focusin":case"focusout":case"input":case"invalid":case"keydown":case"keypress":case"keyup":case"mousedown":case"mouseup":case"paste":case"pause":case"play":case"pointercancel":case"pointerdown":case"pointerup":case"ratechange":case"reset":case"resize":case"seeked":case"submit":case"toggle":case"touchcancel":case"touchend":case"touchstart":case"volumechange":case"change":case"selectionchange":case"textInput":case"compositionstart":case"compositionend":case"compositionupdate":case"beforeblur":case"afterblur":case"beforeinput":case"blur":case"fullscreenchange":case"focus":case"hashchange":case"popstate":case"select":case"selectstart":return 2;case"drag":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"mousemove":case"mouseout":case"mouseover":case"pointermove":case"pointerout":case"pointerover":case"scroll":case"touchmove":case"wheel":case"mouseenter":case"mouseleave":case"pointerenter":case"pointerleave":return 8;case"message":switch(de()){case Fe:return 2;case ke:return 8;case Ie:case Ft:return 32;case Mt:return 268435456;default:return 32}default:return 32}}var xM=!1,uu=null,fu=null,hu=null,bg=new Map,Eg=new Map,du=[],L4="mousedown mouseup touchcancel touchend touchstart auxclick dblclick pointercancel pointerdown pointerup dragend dragstart drop compositionend compositionstart keydown keypress keyup input textInput copy cut paste click change contextmenu reset".split(" ");function iR(a,r){switch(a){case"focusin":case"focusout":uu=null;break;case"dragenter":case"dragleave":fu=null;break;case"mouseover":case"mouseout":hu=null;break;case"pointerover":case"pointerout":bg.delete(r.pointerId);break;case"gotpointercapture":case"lostpointercapture":Eg.delete(r.pointerId)}}function Tg(a,r,f,m,A,E){return a===null||a.nativeEvent!==E?(a={blockedOn:r,domEventName:f,eventSystemFlags:m,nativeEvent:E,targetContainers:[A]},r!==null&&(r=tt(r),r!==null&&eR(r)),a):(a.eventSystemFlags|=m,r=a.targetContainers,A!==null&&r.indexOf(A)===-1&&r.push(A),a)}function O4(a,r,f,m,A){switch(r){case"focusin":return uu=Tg(uu,a,r,f,m,A),!0;case"dragenter":return fu=Tg(fu,a,r,f,m,A),!0;case"mouseover":return hu=Tg(hu,a,r,f,m,A),!0;case"pointerover":var E=A.pointerId;return bg.set(E,Tg(bg.get(E)||null,a,r,f,m,A)),!0;case"gotpointercapture":return E=A.pointerId,Eg.set(E,Tg(Eg.get(E)||null,a,r,f,m,A)),!0}return!1}function aR(a){var r=st(a.target);if(r!==null){var f=o(r);if(f!==null){if(r=f.tag,r===13){if(r=l(f),r!==null){a.blockedOn=r,kt(a.priority,function(){tR(f)});return}}else if(r===31){if(r=h(f),r!==null){a.blockedOn=r,kt(a.priority,function(){tR(f)});return}}else if(r===3&&f.stateNode.current.memoizedState.isDehydrated){a.blockedOn=f.tag===3?f.stateNode.containerInfo:null;return}}}a.blockedOn=null}function By(a){if(a.blockedOn!==null)return!1;for(var r=a.targetContainers;0<r.length;){var f=_M(a.nativeEvent);if(f===null){f=a.nativeEvent;var m=new f.constructor(f.type,f);sf=m,f.target.dispatchEvent(m),sf=null}else return r=tt(f),r!==null&&eR(r),a.blockedOn=f,!1;r.shift()}return!0}function sR(a,r,f){By(a)&&f.delete(r)}function I4(){xM=!1,uu!==null&&By(uu)&&(uu=null),fu!==null&&By(fu)&&(fu=null),hu!==null&&By(hu)&&(hu=null),bg.forEach(sR),Eg.forEach(sR)}function Dy(a,r){a.blockedOn===r&&(a.blockedOn=null,xM||(xM=!0,s.unstable_scheduleCallback(s.unstable_NormalPriority,I4)))}var Ny=null;function rR(a){Ny!==a&&(Ny=a,s.unstable_scheduleCallback(s.unstable_NormalPriority,function(){Ny===a&&(Ny=null);for(var r=0;r<a.length;r+=3){var f=a[r],m=a[r+1],A=a[r+2];if(typeof m!="function"){if(yM(m||f)===null)continue;break}var E=tt(f);E!==null&&(a.splice(r,3),r-=3,lg(E,{pending:!0,data:A,method:f.method,action:m},m,A))}}))}function Kd(a){function r(re){return Dy(re,a)}uu!==null&&Dy(uu,a),fu!==null&&Dy(fu,a),hu!==null&&Dy(hu,a),bg.forEach(r),Eg.forEach(r);for(var f=0;f<du.length;f++){var m=du[f];m.blockedOn===a&&(m.blockedOn=null)}for(;0<du.length&&(f=du[0],f.blockedOn===null);)aR(f),f.blockedOn===null&&du.shift();if(f=(a.ownerDocument||a).$$reactFormReplay,f!=null)for(m=0;m<f.length;m+=3){var A=f[m],E=f[m+1],L=A[G]||null;if(typeof E=="function")L||rR(f);else if(L){var Y=null;if(E&&E.hasAttribute("formAction")){if(A=E,L=E[G]||null)Y=L.formAction;else if(yM(A)!==null)continue}else Y=L.action;typeof Y=="function"?f[m+1]=Y:(f.splice(m,3),m-=3),rR(f)}}}function oR(){function a(E){E.canIntercept&&E.info==="react-transition"&&E.intercept({handler:function(){return new Promise(function(L){return A=L})},focusReset:"manual",scroll:"manual"})}function r(){A!==null&&(A(),A=null),m||setTimeout(f,20)}function f(){if(!m&&!navigation.transition){var E=navigation.currentEntry;E&&E.url!=null&&navigation.navigate(E.url,{state:E.getState(),info:"react-transition",history:"replace"})}}if(typeof navigation=="object"){var m=!1,A=null;return navigation.addEventListener("navigate",a),navigation.addEventListener("navigatesuccess",r),navigation.addEventListener("navigateerror",r),setTimeout(f,100),function(){m=!0,navigation.removeEventListener("navigate",a),navigation.removeEventListener("navigatesuccess",r),navigation.removeEventListener("navigateerror",r),A!==null&&(A(),A=null)}}}function AM(a){this._internalRoot=a}Uy.prototype.render=AM.prototype.render=function(a){var r=this._internalRoot;if(r===null)throw Error(n(409));var f=r.current,m=Ka();QC(f,m,a,r,null,null)},Uy.prototype.unmount=AM.prototype.unmount=function(){var a=this._internalRoot;if(a!==null){this._internalRoot=null;var r=a.containerInfo;QC(a.current,2,null,a,null,null),J(),r[q]=null}};function Uy(a){this._internalRoot=a}Uy.prototype.unstable_scheduleHydration=function(a){if(a){var r=wi();a={blockedOn:null,target:a,priority:r};for(var f=0;f<du.length&&r!==0&&r<du[f].priority;f++);du.splice(f,0,a),f===0&&aR(a)}};var lR=e.version;if(lR!=="19.2.3")throw Error(n(527,lR,"19.2.3"));W.findDOMNode=function(a){var r=a._reactInternals;if(r===void 0)throw typeof a.render=="function"?Error(n(188)):(a=Object.keys(a).join(","),Error(n(268,a)));return a=p(r),a=a!==null?_(a):null,a=a===null?null:a.stateNode,a};var F4={bundleType:0,version:"19.2.3",rendererPackageName:"react-dom",currentDispatcherRef:I,reconcilerVersion:"19.2.3"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var Ly=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!Ly.isDisabled&&Ly.supportsFiber)try{Ye=Ly.inject(F4),qe=Ly}catch{}}return Wd.createRoot=function(a,r){if(!i(a))throw Error(n(299));var f=!1,m="",A=hg,E=hy,L=Dd;return r!=null&&(r.unstable_strictMode===!0&&(f=!0),r.identifierPrefix!==void 0&&(m=r.identifierPrefix),r.onUncaughtError!==void 0&&(A=r.onUncaughtError),r.onCaughtError!==void 0&&(E=r.onCaughtError),r.onRecoverableError!==void 0&&(L=r.onRecoverableError)),r=jC(a,1,!1,null,null,f,m,null,A,E,L,oR),a[q]=r.current,nM(a),new AM(r)},Wd.hydrateRoot=function(a,r,f){if(!i(a))throw Error(n(299));var m=!1,A="",E=hg,L=hy,Y=Dd,re=null;return f!=null&&(f.unstable_strictMode===!0&&(m=!0),f.identifierPrefix!==void 0&&(A=f.identifierPrefix),f.onUncaughtError!==void 0&&(E=f.onUncaughtError),f.onCaughtError!==void 0&&(L=f.onCaughtError),f.onRecoverableError!==void 0&&(Y=f.onRecoverableError),f.formState!==void 0&&(re=f.formState)),r=jC(a,1,!0,r,f??null,m,A,re,E,L,Y,oR),r.context=ZC(null),f=r.current,m=Ka(),m=sa(m),A=Lr(m),A.callback=null,ho(f,A,m),f=m,r.current.lanes=f,Fi(r,f),fl(r),a[q]=r.current,nM(a),new Uy(r)},Wd.version="19.2.3",Wd}var BM;function mR(){if(BM)return Hy.exports;BM=1;function s(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(s)}catch(e){console.error(e)}}return s(),Hy.exports=pR(),Hy.exports}var gR=mR(),Vy={exports:{}},jd={};var DM;function vR(){if(DM)return jd;DM=1;var s=Symbol.for("react.transitional.element"),e=Symbol.for("react.fragment");function t(n,i,o){var l=null;if(o!==void 0&&(l=""+o),i.key!==void 0&&(l=""+i.key),"key"in i){o={};for(var h in i)h!=="key"&&(o[h]=i[h])}else o=i;return i=o.ref,{$$typeof:s,type:n,key:l,ref:i!==void 0?i:null,props:o}}return jd.Fragment=e,jd.jsx=t,jd.jsxs=t,jd}var NM;function _R(){return NM||(NM=1,Vy.exports=vR()),Vy.exports}var Gt=_R();function ky(){return ky=Object.assign?Object.assign.bind():function(s){for(var e=1;e<arguments.length;e++){var t=arguments[e];for(var n in t)({}).hasOwnProperty.call(t,n)&&(s[n]=t[n])}return s},ky.apply(null,arguments)}const Zd="182",yR={LEFT:0,MIDDLE:1,RIGHT:2,ROTATE:0,DOLLY:1,PAN:2},xR={ROTATE:0,PAN:1,DOLLY_PAN:2,DOLLY_ROTATE:3},UM=0,Xy=1,LM=2,AR=3,OM=0,Kf=1,Qd=2,mu=3,Yr=0,fs=1,Ws=2,Jr=0,gu=1,Yy=2,Jy=3,qy=4,IM=5,sc=100,FM=101,HM=102,PM=103,GM=104,zM=200,VM=201,kM=202,XM=203,Cg=204,Rg=205,YM=206,JM=207,qM=208,KM=209,WM=210,jM=211,ZM=212,QM=213,$M=214,wg=0,Bg=1,Dg=2,vu=3,Ng=4,Ug=5,Lg=6,Og=7,$d=0,eb=1,tb=2,mr=0,Ky=1,Wy=2,jy=3,Ig=4,Zy=5,Qy=6,$y=7,ex="attached",nb="detached",rc=300,qr=301,oc=302,Wf=303,ep=304,jf=306,Kr=1e3,Ei=1001,_u=1002,Ti=1003,tp=1004,SR=1004,lc=1005,MR=1005,Cn=1006,yu=1007,bR=1007,Is=1008,tx=1008,Ta=1009,Fg=1010,Hg=1011,Zf=1012,np=1013,js=1014,Ci=1015,ki=1016,Pg=1017,Gg=1018,Qf=1020,nx=35902,ix=35899,ax=1021,sx=1022,Zi=1023,Eo=1026,cc=1027,ip=1028,ap=1029,xu=1030,zg=1031,ER=1032,Vg=1033,sp=33776,rp=33777,op=33778,lp=33779,kg=35840,Xg=35841,Yg=35842,Jg=35843,qg=36196,Kg=37492,Wg=37496,jg=37488,Zg=37489,Qg=37490,$g=37491,e0=37808,t0=37809,n0=37810,i0=37811,a0=37812,s0=37813,r0=37814,o0=37815,l0=37816,c0=37817,u0=37818,f0=37819,h0=37820,d0=37821,p0=36492,m0=36494,g0=36495,v0=36283,_0=36284,y0=36285,x0=36286,cp=2200,ib=2201,ab=2202,Au=2300,uc=2301,A0=2302,Su=2400,Mu=2401,up=2402,S0=2500,rx=2501,ox=0,fp=1,bu=2,sb=3200,TR=3201,CR=3202,RR=3203,fc=0,rb=1,dl="",Xi="srgb",na="srgb-linear",hp="linear",si="srgb",wR="",BR="rg",DR="ga",NR=0,Eu=7680,UR=7681,LR=7682,OR=7683,IR=34055,FR=34056,HR=5386,PR=512,GR=513,zR=514,VR=515,kR=516,XR=517,YR=518,lx=519,ob=512,lb=513,cb=514,M0=515,ub=516,fb=517,b0=518,hb=519,dp=35044,JR=35048,qR=35040,KR=35045,WR=35049,jR=35041,ZR=35046,QR=35050,$R=35042,e2="100",cx="300 es",Zs=2e3,$f=2001,t2={COMPUTE:"compute",RENDER:"render"},n2={PERSPECTIVE:"perspective",LINEAR:"linear",FLAT:"flat"},i2={NORMAL:"normal",CENTROID:"centroid",SAMPLE:"sample",FIRST:"first",EITHER:"either"};function db(s){for(let e=s.length-1;e>=0;--e)if(s[e]>=65535)return!0;return!1}const a2={Int8Array,Uint8Array,Uint8ClampedArray,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array};function eh(s,e){return new a2[s](e)}function pb(s){return ArrayBuffer.isView(s)&&!(s instanceof DataView)}function pp(s){return document.createElementNS("http://www.w3.org/1999/xhtml",s)}function mb(){const s=pp("canvas");return s.style.display="block",s}const gb={};let hc=null;function s2(s){hc=s}function r2(){return hc}function mp(...s){const e="THREE."+s.shift();hc?hc("log",e,...s):console.log(e,...s)}function Ut(...s){const e="THREE."+s.shift();hc?hc("warn",e,...s):console.warn(e,...s)}function Zt(...s){const e="THREE."+s.shift();hc?hc("error",e,...s):console.error(e,...s)}function th(...s){const e=s.join(" ");e in gb||(gb[e]=!0,Ut(...s))}function o2(s,e,t){return new Promise(function(n,i){function o(){switch(s.clientWaitSync(e,s.SYNC_FLUSH_COMMANDS_BIT,0)){case s.WAIT_FAILED:i();break;case s.TIMEOUT_EXPIRED:setTimeout(o,t);break;default:n()}}setTimeout(o,t)})}class To{addEventListener(e,t){this._listeners===void 0&&(this._listeners={});const n=this._listeners;n[e]===void 0&&(n[e]=[]),n[e].indexOf(t)===-1&&n[e].push(t)}hasEventListener(e,t){const n=this._listeners;return n===void 0?!1:n[e]!==void 0&&n[e].indexOf(t)!==-1}removeEventListener(e,t){const n=this._listeners;if(n===void 0)return;const i=n[e];if(i!==void 0){const o=i.indexOf(t);o!==-1&&i.splice(o,1)}}dispatchEvent(e){const t=this._listeners;if(t===void 0)return;const n=t[e.type];if(n!==void 0){e.target=this;const i=n.slice(0);for(let o=0,l=i.length;o<l;o++)i[o].call(this,e);e.target=null}}}const Za=["00","01","02","03","04","05","06","07","08","09","0a","0b","0c","0d","0e","0f","10","11","12","13","14","15","16","17","18","19","1a","1b","1c","1d","1e","1f","20","21","22","23","24","25","26","27","28","29","2a","2b","2c","2d","2e","2f","30","31","32","33","34","35","36","37","38","39","3a","3b","3c","3d","3e","3f","40","41","42","43","44","45","46","47","48","49","4a","4b","4c","4d","4e","4f","50","51","52","53","54","55","56","57","58","59","5a","5b","5c","5d","5e","5f","60","61","62","63","64","65","66","67","68","69","6a","6b","6c","6d","6e","6f","70","71","72","73","74","75","76","77","78","79","7a","7b","7c","7d","7e","7f","80","81","82","83","84","85","86","87","88","89","8a","8b","8c","8d","8e","8f","90","91","92","93","94","95","96","97","98","99","9a","9b","9c","9d","9e","9f","a0","a1","a2","a3","a4","a5","a6","a7","a8","a9","aa","ab","ac","ad","ae","af","b0","b1","b2","b3","b4","b5","b6","b7","b8","b9","ba","bb","bc","bd","be","bf","c0","c1","c2","c3","c4","c5","c6","c7","c8","c9","ca","cb","cc","cd","ce","cf","d0","d1","d2","d3","d4","d5","d6","d7","d8","d9","da","db","dc","dd","de","df","e0","e1","e2","e3","e4","e5","e6","e7","e8","e9","ea","eb","ec","ed","ee","ef","f0","f1","f2","f3","f4","f5","f6","f7","f8","f9","fa","fb","fc","fd","fe","ff"];let vb=1234567;const Tu=Math.PI/180,nh=180/Math.PI;function Qs(){const s=Math.random()*4294967295|0,e=Math.random()*4294967295|0,t=Math.random()*4294967295|0,n=Math.random()*4294967295|0;return(Za[s&255]+Za[s>>8&255]+Za[s>>16&255]+Za[s>>24&255]+"-"+Za[e&255]+Za[e>>8&255]+"-"+Za[e>>16&15|64]+Za[e>>24&255]+"-"+Za[t&63|128]+Za[t>>8&255]+"-"+Za[t>>16&255]+Za[t>>24&255]+Za[n&255]+Za[n>>8&255]+Za[n>>16&255]+Za[n>>24&255]).toLowerCase()}function dn(s,e,t){return Math.max(e,Math.min(t,s))}function ux(s,e){return(s%e+e)%e}function l2(s,e,t,n,i){return n+(s-e)*(i-n)/(t-e)}function c2(s,e,t){return s!==e?(t-s)/(e-s):0}function gp(s,e,t){return(1-t)*s+t*e}function u2(s,e,t,n){return gp(s,e,1-Math.exp(-t*n))}function f2(s,e=1){return e-Math.abs(ux(s,e*2)-e)}function h2(s,e,t){return s<=e?0:s>=t?1:(s=(s-e)/(t-e),s*s*(3-2*s))}function d2(s,e,t){return s<=e?0:s>=t?1:(s=(s-e)/(t-e),s*s*s*(s*(s*6-15)+10))}function p2(s,e){return s+Math.floor(Math.random()*(e-s+1))}function m2(s,e){return s+Math.random()*(e-s)}function g2(s){return s*(.5-Math.random())}function v2(s){s!==void 0&&(vb=s);let e=vb+=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 _2(s){return s*Tu}function y2(s){return s*nh}function x2(s){return(s&s-1)===0&&s!==0}function A2(s){return Math.pow(2,Math.ceil(Math.log(s)/Math.LN2))}function S2(s){return Math.pow(2,Math.floor(Math.log(s)/Math.LN2))}function M2(s,e,t,n,i){const o=Math.cos,l=Math.sin,h=o(t/2),d=l(t/2),p=o((e+n)/2),_=l((e+n)/2),v=o((e-n)/2),y=l((e-n)/2),x=o((n-e)/2),b=l((n-e)/2);switch(i){case"XYX":s.set(h*_,d*v,d*y,h*p);break;case"YZY":s.set(d*y,h*_,d*v,h*p);break;case"ZXZ":s.set(d*v,d*y,h*_,h*p);break;case"XZX":s.set(h*_,d*b,d*x,h*p);break;case"YXY":s.set(d*x,h*_,d*b,h*p);break;case"ZYZ":s.set(d*b,d*x,h*_,h*p);break;default:Ut("MathUtils: .setQuaternionFromProperEuler() encountered an unknown order: "+i)}}function hs(s,e){switch(e.constructor){case Float32Array:return s;case Uint32Array:return s/4294967295;case Uint16Array:return s/65535;case Uint8Array:return s/255;case Int32Array:return Math.max(s/2147483647,-1);case Int16Array:return Math.max(s/32767,-1);case Int8Array:return Math.max(s/127,-1);default:throw new Error("Invalid component type.")}}function Sn(s,e){switch(e.constructor){case Float32Array:return s;case Uint32Array:return Math.round(s*4294967295);case Uint16Array:return Math.round(s*65535);case Uint8Array:return Math.round(s*255);case Int32Array:return Math.round(s*2147483647);case Int16Array:return Math.round(s*32767);case Int8Array:return Math.round(s*127);default:throw new Error("Invalid component type.")}}const E0={DEG2RAD:Tu,RAD2DEG:nh,generateUUID:Qs,clamp:dn,euclideanModulo:ux,mapLinear:l2,inverseLerp:c2,lerp:gp,damp:u2,pingpong:f2,smoothstep:h2,smootherstep:d2,randInt:p2,randFloat:m2,randFloatSpread:g2,seededRandom:v2,degToRad:_2,radToDeg:y2,isPowerOfTwo:x2,ceilPowerOfTwo:A2,floorPowerOfTwo:S2,setQuaternionFromProperEuler:M2,normalize:Sn,denormalize:hs};class nt{constructor(e=0,t=0){nt.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,n=this.y,i=e.elements;return this.x=i[0]*t+i[3]*n+i[6],this.y=i[1]*t+i[4]*n+i[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=dn(this.x,e.x,t.x),this.y=dn(this.y,e.y,t.y),this}clampScalar(e,t){return this.x=dn(this.x,e,t),this.y=dn(this.y,e,t),this}clampLength(e,t){const n=this.length();return this.divideScalar(n||1).multiplyScalar(dn(n,e,t))}floor(){return this.x=Math.floor(this.x),this.y=Math.floor(this.y),this}ceil(){return this.x=Math.ceil(this.x),this.y=Math.ceil(this.y),this}round(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this}roundToZero(){return this.x=Math.trunc(this.x),this.y=Math.trunc(this.y),this}negate(){return this.x=-this.x,this.y=-this.y,this}dot(e){return this.x*e.x+this.y*e.y}cross(e){return this.x*e.y-this.y*e.x}lengthSq(){return this.x*this.x+this.y*this.y}length(){return Math.sqrt(this.x*this.x+this.y*this.y)}manhattanLength(){return Math.abs(this.x)+Math.abs(this.y)}normalize(){return this.divideScalar(this.length()||1)}angle(){return Math.atan2(-this.y,-this.x)+Math.PI}angleTo(e){const t=Math.sqrt(this.lengthSq()*e.lengthSq());if(t===0)return Math.PI/2;const n=this.dot(e)/t;return Math.acos(dn(n,-1,1))}distanceTo(e){return Math.sqrt(this.distanceToSquared(e))}distanceToSquared(e){const t=this.x-e.x,n=this.y-e.y;return t*t+n*n}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,n){return this.x=e.x+(t.x-e.x)*n,this.y=e.y+(t.y-e.y)*n,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 n=Math.cos(t),i=Math.sin(t),o=this.x-e.x,l=this.y-e.y;return this.x=o*n-l*i+e.x,this.y=o*i+l*n+e.y,this}random(){return this.x=Math.random(),this.y=Math.random(),this}*[Symbol.iterator](){yield this.x,yield this.y}}class Ca{constructor(e=0,t=0,n=0,i=1){this.isQuaternion=!0,this._x=e,this._y=t,this._z=n,this._w=i}static slerpFlat(e,t,n,i,o,l,h){let d=n[i+0],p=n[i+1],_=n[i+2],v=n[i+3],y=o[l+0],x=o[l+1],b=o[l+2],R=o[l+3];if(h<=0){e[t+0]=d,e[t+1]=p,e[t+2]=_,e[t+3]=v;return}if(h>=1){e[t+0]=y,e[t+1]=x,e[t+2]=b,e[t+3]=R;return}if(v!==R||d!==y||p!==x||_!==b){let T=d*y+p*x+_*b+v*R;T<0&&(y=-y,x=-x,b=-b,R=-R,T=-T);let M=1-h;if(T<.9995){const w=Math.acos(T),D=Math.sin(w);M=Math.sin(M*w)/D,h=Math.sin(h*w)/D,d=d*M+y*h,p=p*M+x*h,_=_*M+b*h,v=v*M+R*h}else{d=d*M+y*h,p=p*M+x*h,_=_*M+b*h,v=v*M+R*h;const w=1/Math.sqrt(d*d+p*p+_*_+v*v);d*=w,p*=w,_*=w,v*=w}}e[t]=d,e[t+1]=p,e[t+2]=_,e[t+3]=v}static multiplyQuaternionsFlat(e,t,n,i,o,l){const h=n[i],d=n[i+1],p=n[i+2],_=n[i+3],v=o[l],y=o[l+1],x=o[l+2],b=o[l+3];return e[t]=h*b+_*v+d*x-p*y,e[t+1]=d*b+_*y+p*v-h*x,e[t+2]=p*b+_*x+h*y-d*v,e[t+3]=_*b-h*v-d*y-p*x,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,n,i){return this._x=e,this._y=t,this._z=n,this._w=i,this._onChangeCallback(),this}clone(){return new this.constructor(this._x,this._y,this._z,this._w)}copy(e){return this._x=e.x,this._y=e.y,this._z=e.z,this._w=e.w,this._onChangeCallback(),this}setFromEuler(e,t=!0){const n=e._x,i=e._y,o=e._z,l=e._order,h=Math.cos,d=Math.sin,p=h(n/2),_=h(i/2),v=h(o/2),y=d(n/2),x=d(i/2),b=d(o/2);switch(l){case"XYZ":this._x=y*_*v+p*x*b,this._y=p*x*v-y*_*b,this._z=p*_*b+y*x*v,this._w=p*_*v-y*x*b;break;case"YXZ":this._x=y*_*v+p*x*b,this._y=p*x*v-y*_*b,this._z=p*_*b-y*x*v,this._w=p*_*v+y*x*b;break;case"ZXY":this._x=y*_*v-p*x*b,this._y=p*x*v+y*_*b,this._z=p*_*b+y*x*v,this._w=p*_*v-y*x*b;break;case"ZYX":this._x=y*_*v-p*x*b,this._y=p*x*v+y*_*b,this._z=p*_*b-y*x*v,this._w=p*_*v+y*x*b;break;case"YZX":this._x=y*_*v+p*x*b,this._y=p*x*v+y*_*b,this._z=p*_*b-y*x*v,this._w=p*_*v-y*x*b;break;case"XZY":this._x=y*_*v-p*x*b,this._y=p*x*v-y*_*b,this._z=p*_*b+y*x*v,this._w=p*_*v+y*x*b;break;default:Ut("Quaternion: .setFromEuler() encountered an unknown order: "+l)}return t===!0&&this._onChangeCallback(),this}setFromAxisAngle(e,t){const n=t/2,i=Math.sin(n);return this._x=e.x*i,this._y=e.y*i,this._z=e.z*i,this._w=Math.cos(n),this._onChangeCallback(),this}setFromRotationMatrix(e){const t=e.elements,n=t[0],i=t[4],o=t[8],l=t[1],h=t[5],d=t[9],p=t[2],_=t[6],v=t[10],y=n+h+v;if(y>0){const x=.5/Math.sqrt(y+1);this._w=.25/x,this._x=(_-d)*x,this._y=(o-p)*x,this._z=(l-i)*x}else if(n>h&&n>v){const x=2*Math.sqrt(1+n-h-v);this._w=(_-d)/x,this._x=.25*x,this._y=(i+l)/x,this._z=(o+p)/x}else if(h>v){const x=2*Math.sqrt(1+h-n-v);this._w=(o-p)/x,this._x=(i+l)/x,this._y=.25*x,this._z=(d+_)/x}else{const x=2*Math.sqrt(1+v-n-h);this._w=(l-i)/x,this._x=(o+p)/x,this._y=(d+_)/x,this._z=.25*x}return this._onChangeCallback(),this}setFromUnitVectors(e,t){let n=e.dot(t)+1;return n<1e-8?(n=0,Math.abs(e.x)>Math.abs(e.z)?(this._x=-e.y,this._y=e.x,this._z=0,this._w=n):(this._x=0,this._y=-e.z,this._z=e.y,this._w=n)):(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=n),this.normalize()}angleTo(e){return 2*Math.acos(Math.abs(dn(this.dot(e),-1,1)))}rotateTowards(e,t){const n=this.angleTo(e);if(n===0)return this;const i=Math.min(1,t/n);return this.slerp(e,i),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 n=e._x,i=e._y,o=e._z,l=e._w,h=t._x,d=t._y,p=t._z,_=t._w;return this._x=n*_+l*h+i*p-o*d,this._y=i*_+l*d+o*h-n*p,this._z=o*_+l*p+n*d-i*h,this._w=l*_-n*h-i*d-o*p,this._onChangeCallback(),this}slerp(e,t){if(t<=0)return this;if(t>=1)return this.copy(e);let n=e._x,i=e._y,o=e._z,l=e._w,h=this.dot(e);h<0&&(n=-n,i=-i,o=-o,l=-l,h=-h);let d=1-t;if(h<.9995){const p=Math.acos(h),_=Math.sin(p);d=Math.sin(d*p)/_,t=Math.sin(t*p)/_,this._x=this._x*d+n*t,this._y=this._y*d+i*t,this._z=this._z*d+o*t,this._w=this._w*d+l*t,this._onChangeCallback()}else this._x=this._x*d+n*t,this._y=this._y*d+i*t,this._z=this._z*d+o*t,this._w=this._w*d+l*t,this.normalize();return this}slerpQuaternions(e,t,n){return this.copy(e).slerp(t,n)}random(){const e=2*Math.PI*Math.random(),t=2*Math.PI*Math.random(),n=Math.random(),i=Math.sqrt(1-n),o=Math.sqrt(n);return this.set(i*Math.sin(e),i*Math.cos(e),o*Math.sin(t),o*Math.cos(t))}equals(e){return e._x===this._x&&e._y===this._y&&e._z===this._z&&e._w===this._w}fromArray(e,t=0){return this._x=e[t],this._y=e[t+1],this._z=e[t+2],this._w=e[t+3],this._onChangeCallback(),this}toArray(e=[],t=0){return e[t]=this._x,e[t+1]=this._y,e[t+2]=this._z,e[t+3]=this._w,e}fromBufferAttribute(e,t){return this._x=e.getX(t),this._y=e.getY(t),this._z=e.getZ(t),this._w=e.getW(t),this._onChangeCallback(),this}toJSON(){return this.toArray()}_onChange(e){return this._onChangeCallback=e,this}_onChangeCallback(){}*[Symbol.iterator](){yield this._x,yield this._y,yield this._z,yield this._w}}class Z{constructor(e=0,t=0,n=0){Z.prototype.isVector3=!0,this.x=e,this.y=t,this.z=n}set(e,t,n){return n===void 0&&(n=this.z),this.x=e,this.y=t,this.z=n,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(_b.setFromEuler(e))}applyAxisAngle(e,t){return this.applyQuaternion(_b.setFromAxisAngle(e,t))}applyMatrix3(e){const t=this.x,n=this.y,i=this.z,o=e.elements;return this.x=o[0]*t+o[3]*n+o[6]*i,this.y=o[1]*t+o[4]*n+o[7]*i,this.z=o[2]*t+o[5]*n+o[8]*i,this}applyNormalMatrix(e){return this.applyMatrix3(e).normalize()}applyMatrix4(e){const t=this.x,n=this.y,i=this.z,o=e.elements,l=1/(o[3]*t+o[7]*n+o[11]*i+o[15]);return this.x=(o[0]*t+o[4]*n+o[8]*i+o[12])*l,this.y=(o[1]*t+o[5]*n+o[9]*i+o[13])*l,this.z=(o[2]*t+o[6]*n+o[10]*i+o[14])*l,this}applyQuaternion(e){const t=this.x,n=this.y,i=this.z,o=e.x,l=e.y,h=e.z,d=e.w,p=2*(l*i-h*n),_=2*(h*t-o*i),v=2*(o*n-l*t);return this.x=t+d*p+l*v-h*_,this.y=n+d*_+h*p-o*v,this.z=i+d*v+o*_-l*p,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,n=this.y,i=this.z,o=e.elements;return this.x=o[0]*t+o[4]*n+o[8]*i,this.y=o[1]*t+o[5]*n+o[9]*i,this.z=o[2]*t+o[6]*n+o[10]*i,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=dn(this.x,e.x,t.x),this.y=dn(this.y,e.y,t.y),this.z=dn(this.z,e.z,t.z),this}clampScalar(e,t){return this.x=dn(this.x,e,t),this.y=dn(this.y,e,t),this.z=dn(this.z,e,t),this}clampLength(e,t){const n=this.length();return this.divideScalar(n||1).multiplyScalar(dn(n,e,t))}floor(){return this.x=Math.floor(this.x),this.y=Math.floor(this.y),this.z=Math.floor(this.z),this}ceil(){return this.x=Math.ceil(this.x),this.y=Math.ceil(this.y),this.z=Math.ceil(this.z),this}round(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this.z=Math.round(this.z),this}roundToZero(){return this.x=Math.trunc(this.x),this.y=Math.trunc(this.y),this.z=Math.trunc(this.z),this}negate(){return this.x=-this.x,this.y=-this.y,this.z=-this.z,this}dot(e){return this.x*e.x+this.y*e.y+this.z*e.z}lengthSq(){return this.x*this.x+this.y*this.y+this.z*this.z}length(){return Math.sqrt(this.x*this.x+this.y*this.y+this.z*this.z)}manhattanLength(){return Math.abs(this.x)+Math.abs(this.y)+Math.abs(this.z)}normalize(){return this.divideScalar(this.length()||1)}setLength(e){return this.normalize().multiplyScalar(e)}lerp(e,t){return this.x+=(e.x-this.x)*t,this.y+=(e.y-this.y)*t,this.z+=(e.z-this.z)*t,this}lerpVectors(e,t,n){return this.x=e.x+(t.x-e.x)*n,this.y=e.y+(t.y-e.y)*n,this.z=e.z+(t.z-e.z)*n,this}cross(e){return this.crossVectors(this,e)}crossVectors(e,t){const n=e.x,i=e.y,o=e.z,l=t.x,h=t.y,d=t.z;return this.x=i*d-o*h,this.y=o*l-n*d,this.z=n*h-i*l,this}projectOnVector(e){const t=e.lengthSq();if(t===0)return this.set(0,0,0);const n=e.dot(this)/t;return this.copy(e).multiplyScalar(n)}projectOnPlane(e){return fx.copy(this).projectOnVector(e),this.sub(fx)}reflect(e){return this.sub(fx.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 n=this.dot(e)/t;return Math.acos(dn(n,-1,1))}distanceTo(e){return Math.sqrt(this.distanceToSquared(e))}distanceToSquared(e){const t=this.x-e.x,n=this.y-e.y,i=this.z-e.z;return t*t+n*n+i*i}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,n){const i=Math.sin(t)*e;return this.x=i*Math.sin(n),this.y=Math.cos(t)*e,this.z=i*Math.cos(n),this}setFromCylindrical(e){return this.setFromCylindricalCoords(e.radius,e.theta,e.y)}setFromCylindricalCoords(e,t,n){return this.x=e*Math.sin(t),this.y=n,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(),n=this.setFromMatrixColumn(e,1).length(),i=this.setFromMatrixColumn(e,2).length();return this.x=t,this.y=n,this.z=i,this}setFromMatrixColumn(e,t){return this.fromArray(e.elements,t*4)}setFromMatrix3Column(e,t){return this.fromArray(e.elements,t*3)}setFromEuler(e){return this.x=e._x,this.y=e._y,this.z=e._z,this}setFromColor(e){return this.x=e.r,this.y=e.g,this.z=e.b,this}equals(e){return e.x===this.x&&e.y===this.y&&e.z===this.z}fromArray(e,t=0){return this.x=e[t],this.y=e[t+1],this.z=e[t+2],this}toArray(e=[],t=0){return e[t]=this.x,e[t+1]=this.y,e[t+2]=this.z,e}fromBufferAttribute(e,t){return this.x=e.getX(t),this.y=e.getY(t),this.z=e.getZ(t),this}random(){return this.x=Math.random(),this.y=Math.random(),this.z=Math.random(),this}randomDirection(){const e=Math.random()*Math.PI*2,t=Math.random()*2-1,n=Math.sqrt(1-t*t);return this.x=n*Math.cos(e),this.y=t,this.z=n*Math.sin(e),this}*[Symbol.iterator](){yield this.x,yield this.y,yield this.z}}const fx=new Z,_b=new Ca;class yn{constructor(e,t,n,i,o,l,h,d,p){yn.prototype.isMatrix3=!0,this.elements=[1,0,0,0,1,0,0,0,1],e!==void 0&&this.set(e,t,n,i,o,l,h,d,p)}set(e,t,n,i,o,l,h,d,p){const _=this.elements;return _[0]=e,_[1]=i,_[2]=h,_[3]=t,_[4]=o,_[5]=d,_[6]=n,_[7]=l,_[8]=p,this}identity(){return this.set(1,0,0,0,1,0,0,0,1),this}copy(e){const t=this.elements,n=e.elements;return t[0]=n[0],t[1]=n[1],t[2]=n[2],t[3]=n[3],t[4]=n[4],t[5]=n[5],t[6]=n[6],t[7]=n[7],t[8]=n[8],this}extractBasis(e,t,n){return e.setFromMatrix3Column(this,0),t.setFromMatrix3Column(this,1),n.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 n=e.elements,i=t.elements,o=this.elements,l=n[0],h=n[3],d=n[6],p=n[1],_=n[4],v=n[7],y=n[2],x=n[5],b=n[8],R=i[0],T=i[3],M=i[6],w=i[1],D=i[4],N=i[7],H=i[2],O=i[5],z=i[8];return o[0]=l*R+h*w+d*H,o[3]=l*T+h*D+d*O,o[6]=l*M+h*N+d*z,o[1]=p*R+_*w+v*H,o[4]=p*T+_*D+v*O,o[7]=p*M+_*N+v*z,o[2]=y*R+x*w+b*H,o[5]=y*T+x*D+b*O,o[8]=y*M+x*N+b*z,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],n=e[1],i=e[2],o=e[3],l=e[4],h=e[5],d=e[6],p=e[7],_=e[8];return t*l*_-t*h*p-n*o*_+n*h*d+i*o*p-i*l*d}invert(){const e=this.elements,t=e[0],n=e[1],i=e[2],o=e[3],l=e[4],h=e[5],d=e[6],p=e[7],_=e[8],v=_*l-h*p,y=h*d-_*o,x=p*o-l*d,b=t*v+n*y+i*x;if(b===0)return this.set(0,0,0,0,0,0,0,0,0);const R=1/b;return e[0]=v*R,e[1]=(i*p-_*n)*R,e[2]=(h*n-i*l)*R,e[3]=y*R,e[4]=(_*t-i*d)*R,e[5]=(i*o-h*t)*R,e[6]=x*R,e[7]=(n*d-p*t)*R,e[8]=(l*t-n*o)*R,this}transpose(){let e;const t=this.elements;return e=t[1],t[1]=t[3],t[3]=e,e=t[2],t[2]=t[6],t[6]=e,e=t[5],t[5]=t[7],t[7]=e,this}getNormalMatrix(e){return this.setFromMatrix4(e).invert().transpose()}transposeIntoArray(e){const t=this.elements;return e[0]=t[0],e[1]=t[3],e[2]=t[6],e[3]=t[1],e[4]=t[4],e[5]=t[7],e[6]=t[2],e[7]=t[5],e[8]=t[8],this}setUvTransform(e,t,n,i,o,l,h){const d=Math.cos(o),p=Math.sin(o);return this.set(n*d,n*p,-n*(d*l+p*h)+l+e,-i*p,i*d,-i*(-p*l+d*h)+h+t,0,0,1),this}scale(e,t){return this.premultiply(hx.makeScale(e,t)),this}rotate(e){return this.premultiply(hx.makeRotation(-e)),this}translate(e,t){return this.premultiply(hx.makeTranslation(e,t)),this}makeTranslation(e,t){return e.isVector2?this.set(1,0,e.x,0,1,e.y,0,0,1):this.set(1,0,e,0,1,t,0,0,1),this}makeRotation(e){const t=Math.cos(e),n=Math.sin(e);return this.set(t,-n,0,n,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,n=e.elements;for(let i=0;i<9;i++)if(t[i]!==n[i])return!1;return!0}fromArray(e,t=0){for(let n=0;n<9;n++)this.elements[n]=e[n+t];return this}toArray(e=[],t=0){const n=this.elements;return e[t]=n[0],e[t+1]=n[1],e[t+2]=n[2],e[t+3]=n[3],e[t+4]=n[4],e[t+5]=n[5],e[t+6]=n[6],e[t+7]=n[7],e[t+8]=n[8],e}clone(){return new this.constructor().fromArray(this.elements)}}const hx=new yn,yb=new yn().set(.4123908,.3575843,.1804808,.212639,.7151687,.0721923,.0193308,.1191948,.9505322),xb=new yn().set(3.2409699,-1.5373832,-.4986108,-.9692436,1.8759675,.0415551,.0556301,-.203977,1.0569715);function b2(){const s={enabled:!0,workingColorSpace:na,spaces:{},convert:function(i,o,l){return this.enabled===!1||o===l||!o||!l||(this.spaces[o].transfer===si&&(i.r=pl(i.r),i.g=pl(i.g),i.b=pl(i.b)),this.spaces[o].primaries!==this.spaces[l].primaries&&(i.applyMatrix3(this.spaces[o].toXYZ),i.applyMatrix3(this.spaces[l].fromXYZ)),this.spaces[l].transfer===si&&(i.r=ih(i.r),i.g=ih(i.g),i.b=ih(i.b))),i},workingToColorSpace:function(i,o){return this.convert(i,this.workingColorSpace,o)},colorSpaceToWorking:function(i,o){return this.convert(i,o,this.workingColorSpace)},getPrimaries:function(i){return this.spaces[i].primaries},getTransfer:function(i){return i===dl?hp:this.spaces[i].transfer},getToneMappingMode:function(i){return this.spaces[i].outputColorSpaceConfig.toneMappingMode||"standard"},getLuminanceCoefficients:function(i,o=this.workingColorSpace){return i.fromArray(this.spaces[o].luminanceCoefficients)},define:function(i){Object.assign(this.spaces,i)},_getMatrix:function(i,o,l){return i.copy(this.spaces[o].toXYZ).multiply(this.spaces[l].fromXYZ)},_getDrawingBufferColorSpace:function(i){return this.spaces[i].outputColorSpaceConfig.drawingBufferColorSpace},_getUnpackColorSpace:function(i=this.workingColorSpace){return this.spaces[i].workingColorSpaceConfig.unpackColorSpace},fromWorkingColorSpace:function(i,o){return th("ColorManagement: .fromWorkingColorSpace() has been renamed to .workingToColorSpace()."),s.workingToColorSpace(i,o)},toWorkingColorSpace:function(i,o){return th("ColorManagement: .toWorkingColorSpace() has been renamed to .colorSpaceToWorking()."),s.colorSpaceToWorking(i,o)}},e=[.64,.33,.3,.6,.15,.06],t=[.2126,.7152,.0722],n=[.3127,.329];return s.define({[na]:{primaries:e,whitePoint:n,transfer:hp,toXYZ:yb,fromXYZ:xb,luminanceCoefficients:t,workingColorSpaceConfig:{unpackColorSpace:Xi},outputColorSpaceConfig:{drawingBufferColorSpace:Xi}},[Xi]:{primaries:e,whitePoint:n,transfer:si,toXYZ:yb,fromXYZ:xb,luminanceCoefficients:t,outputColorSpaceConfig:{drawingBufferColorSpace:Xi}}}),s}const Bn=b2();function pl(s){return s<.04045?s*.0773993808:Math.pow(s*.9478672986+.0521327014,2.4)}function ih(s){return s<.0031308?s*12.92:1.055*Math.pow(s,.41666)-.055}let ah;class Ab{static getDataURL(e,t="image/png"){if(/^data:/i.test(e.src)||typeof HTMLCanvasElement>"u")return e.src;let n;if(e instanceof HTMLCanvasElement)n=e;else{ah===void 0&&(ah=pp("canvas")),ah.width=e.width,ah.height=e.height;const i=ah.getContext("2d");e instanceof ImageData?i.putImageData(e,0,0):i.drawImage(e,0,0,e.width,e.height),n=ah}return n.toDataURL(t)}static sRGBToLinear(e){if(typeof HTMLImageElement<"u"&&e instanceof HTMLImageElement||typeof HTMLCanvasElement<"u"&&e instanceof HTMLCanvasElement||typeof ImageBitmap<"u"&&e instanceof ImageBitmap){const t=pp("canvas");t.width=e.width,t.height=e.height;const n=t.getContext("2d");n.drawImage(e,0,0,e.width,e.height);const i=n.getImageData(0,0,e.width,e.height),o=i.data;for(let l=0;l<o.length;l++)o[l]=pl(o[l]/255)*255;return n.putImageData(i,0,0),t}else if(e.data){const t=e.data.slice(0);for(let n=0;n<t.length;n++)t instanceof Uint8Array||t instanceof Uint8ClampedArray?t[n]=Math.floor(pl(t[n]/255)*255):t[n]=pl(t[n]);return{data:t,width:e.width,height:e.height}}else return Ut("ImageUtils.sRGBToLinear(): Unsupported image type. No color space conversion applied."),e}}let E2=0;class dc{constructor(e=null){this.isSource=!0,Object.defineProperty(this,"id",{value:E2++}),this.uuid=Qs(),this.data=e,this.dataReady=!0,this.version=0}getSize(e){const t=this.data;return typeof HTMLVideoElement<"u"&&t instanceof HTMLVideoElement?e.set(t.videoWidth,t.videoHeight,0):typeof VideoFrame<"u"&&t instanceof VideoFrame?e.set(t.displayHeight,t.displayWidth,0):t!==null?e.set(t.width,t.height,t.depth||0):e.set(0,0,0),e}set needsUpdate(e){e===!0&&this.version++}toJSON(e){const t=e===void 0||typeof e=="string";if(!t&&e.images[this.uuid]!==void 0)return e.images[this.uuid];const n={uuid:this.uuid,url:""},i=this.data;if(i!==null){let o;if(Array.isArray(i)){o=[];for(let l=0,h=i.length;l<h;l++)i[l].isDataTexture?o.push(dx(i[l].image)):o.push(dx(i[l]))}else o=dx(i);n.url=o}return t||(e.images[this.uuid]=n),n}}function dx(s){return typeof HTMLImageElement<"u"&&s instanceof HTMLImageElement||typeof HTMLCanvasElement<"u"&&s instanceof HTMLCanvasElement||typeof ImageBitmap<"u"&&s instanceof ImageBitmap?Ab.getDataURL(s):s.data?{data:Array.from(s.data),width:s.width,height:s.height,type:s.data.constructor.name}:(Ut("Texture: Unable to serialize Texture."),{})}let T2=0;const px=new Z;class Qn extends To{constructor(e=Qn.DEFAULT_IMAGE,t=Qn.DEFAULT_MAPPING,n=Ei,i=Ei,o=Cn,l=Is,h=Zi,d=Ta,p=Qn.DEFAULT_ANISOTROPY,_=dl){super(),this.isTexture=!0,Object.defineProperty(this,"id",{value:T2++}),this.uuid=Qs(),this.name="",this.source=new dc(e),this.mipmaps=[],this.mapping=t,this.channel=0,this.wrapS=n,this.wrapT=i,this.magFilter=o,this.minFilter=l,this.anisotropy=p,this.format=h,this.internalFormat=null,this.type=d,this.offset=new nt(0,0),this.repeat=new nt(1,1),this.center=new nt(0,0),this.rotation=0,this.matrixAutoUpdate=!0,this.matrix=new yn,this.generateMipmaps=!0,this.premultiplyAlpha=!1,this.flipY=!0,this.unpackAlignment=4,this.colorSpace=_,this.userData={},this.updateRanges=[],this.version=0,this.onUpdate=null,this.renderTarget=null,this.isRenderTargetTexture=!1,this.isArrayTexture=!!(e&&e.depth&&e.depth>1),this.pmremVersion=0}get width(){return this.source.getSize(px).x}get height(){return this.source.getSize(px).y}get depth(){return this.source.getSize(px).z}get image(){return this.source.data}set image(e=null){this.source.data=e}updateMatrix(){this.matrix.setUvTransform(this.offset.x,this.offset.y,this.repeat.x,this.repeat.y,this.rotation,this.center.x,this.center.y)}addUpdateRange(e,t){this.updateRanges.push({start:e,count:t})}clearUpdateRanges(){this.updateRanges.length=0}clone(){return new this.constructor().copy(this)}copy(e){return this.name=e.name,this.source=e.source,this.mipmaps=e.mipmaps.slice(0),this.mapping=e.mapping,this.channel=e.channel,this.wrapS=e.wrapS,this.wrapT=e.wrapT,this.magFilter=e.magFilter,this.minFilter=e.minFilter,this.anisotropy=e.anisotropy,this.format=e.format,this.internalFormat=e.internalFormat,this.type=e.type,this.offset.copy(e.offset),this.repeat.copy(e.repeat),this.center.copy(e.center),this.rotation=e.rotation,this.matrixAutoUpdate=e.matrixAutoUpdate,this.matrix.copy(e.matrix),this.generateMipmaps=e.generateMipmaps,this.premultiplyAlpha=e.premultiplyAlpha,this.flipY=e.flipY,this.unpackAlignment=e.unpackAlignment,this.colorSpace=e.colorSpace,this.renderTarget=e.renderTarget,this.isRenderTargetTexture=e.isRenderTargetTexture,this.isArrayTexture=e.isArrayTexture,this.userData=JSON.parse(JSON.stringify(e.userData)),this.needsUpdate=!0,this}setValues(e){for(const t in e){const n=e[t];if(n===void 0){Ut(`Texture.setValues(): parameter '${t}' has value of undefined.`);continue}const i=this[t];if(i===void 0){Ut(`Texture.setValues(): property '${t}' does not exist.`);continue}i&&n&&i.isVector2&&n.isVector2||i&&n&&i.isVector3&&n.isVector3||i&&n&&i.isMatrix3&&n.isMatrix3?i.copy(n):this[t]=n}}toJSON(e){const t=e===void 0||typeof e=="string";if(!t&&e.textures[this.uuid]!==void 0)return e.textures[this.uuid];const n={metadata:{version:4.7,type:"Texture",generator:"Texture.toJSON"},uuid:this.uuid,name:this.name,image:this.source.toJSON(e).uuid,mapping:this.mapping,channel:this.channel,repeat:[this.repeat.x,this.repeat.y],offset:[this.offset.x,this.offset.y],center:[this.center.x,this.center.y],rotation:this.rotation,wrap:[this.wrapS,this.wrapT],format:this.format,internalFormat:this.internalFormat,type:this.type,colorSpace:this.colorSpace,minFilter:this.minFilter,magFilter:this.magFilter,anisotropy:this.anisotropy,flipY:this.flipY,generateMipmaps:this.generateMipmaps,premultiplyAlpha:this.premultiplyAlpha,unpackAlignment:this.unpackAlignment};return Object.keys(this.userData).length>0&&(n.userData=this.userData),t||(e.textures[this.uuid]=n),n}dispose(){this.dispatchEvent({type:"dispose"})}transformUv(e){if(this.mapping!==rc)return e;if(e.applyMatrix3(this.matrix),e.x<0||e.x>1)switch(this.wrapS){case Kr:e.x=e.x-Math.floor(e.x);break;case Ei:e.x=e.x<0?0:1;break;case _u: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 Kr:e.y=e.y-Math.floor(e.y);break;case Ei:e.y=e.y<0?0:1;break;case _u:Math.abs(Math.floor(e.y)%2)===1?e.y=Math.ceil(e.y)-e.y:e.y=e.y-Math.floor(e.y);break}return this.flipY&&(e.y=1-e.y),e}set needsUpdate(e){e===!0&&(this.version++,this.source.needsUpdate=!0)}set needsPMREMUpdate(e){e===!0&&this.pmremVersion++}}Qn.DEFAULT_IMAGE=null,Qn.DEFAULT_MAPPING=rc,Qn.DEFAULT_ANISOTROPY=1;class pi{constructor(e=0,t=0,n=0,i=1){pi.prototype.isVector4=!0,this.x=e,this.y=t,this.z=n,this.w=i}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,n,i){return this.x=e,this.y=t,this.z=n,this.w=i,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,n=this.y,i=this.z,o=this.w,l=e.elements;return this.x=l[0]*t+l[4]*n+l[8]*i+l[12]*o,this.y=l[1]*t+l[5]*n+l[9]*i+l[13]*o,this.z=l[2]*t+l[6]*n+l[10]*i+l[14]*o,this.w=l[3]*t+l[7]*n+l[11]*i+l[15]*o,this}divide(e){return this.x/=e.x,this.y/=e.y,this.z/=e.z,this.w/=e.w,this}divideScalar(e){return this.multiplyScalar(1/e)}setAxisAngleFromQuaternion(e){this.w=2*Math.acos(e.w);const t=Math.sqrt(1-e.w*e.w);return t<1e-4?(this.x=1,this.y=0,this.z=0):(this.x=e.x/t,this.y=e.y/t,this.z=e.z/t),this}setAxisAngleFromRotationMatrix(e){let t,n,i,o;const d=e.elements,p=d[0],_=d[4],v=d[8],y=d[1],x=d[5],b=d[9],R=d[2],T=d[6],M=d[10];if(Math.abs(_-y)<.01&&Math.abs(v-R)<.01&&Math.abs(b-T)<.01){if(Math.abs(_+y)<.1&&Math.abs(v+R)<.1&&Math.abs(b+T)<.1&&Math.abs(p+x+M-3)<.1)return this.set(1,0,0,0),this;t=Math.PI;const D=(p+1)/2,N=(x+1)/2,H=(M+1)/2,O=(_+y)/4,z=(v+R)/4,V=(b+T)/4;return D>N&&D>H?D<.01?(n=0,i=.707106781,o=.707106781):(n=Math.sqrt(D),i=O/n,o=z/n):N>H?N<.01?(n=.707106781,i=0,o=.707106781):(i=Math.sqrt(N),n=O/i,o=V/i):H<.01?(n=.707106781,i=.707106781,o=0):(o=Math.sqrt(H),n=z/o,i=V/o),this.set(n,i,o,t),this}let w=Math.sqrt((T-b)*(T-b)+(v-R)*(v-R)+(y-_)*(y-_));return Math.abs(w)<.001&&(w=1),this.x=(T-b)/w,this.y=(v-R)/w,this.z=(y-_)/w,this.w=Math.acos((p+x+M-1)/2),this}setFromMatrixPosition(e){const t=e.elements;return this.x=t[12],this.y=t[13],this.z=t[14],this.w=t[15],this}min(e){return this.x=Math.min(this.x,e.x),this.y=Math.min(this.y,e.y),this.z=Math.min(this.z,e.z),this.w=Math.min(this.w,e.w),this}max(e){return this.x=Math.max(this.x,e.x),this.y=Math.max(this.y,e.y),this.z=Math.max(this.z,e.z),this.w=Math.max(this.w,e.w),this}clamp(e,t){return this.x=dn(this.x,e.x,t.x),this.y=dn(this.y,e.y,t.y),this.z=dn(this.z,e.z,t.z),this.w=dn(this.w,e.w,t.w),this}clampScalar(e,t){return this.x=dn(this.x,e,t),this.y=dn(this.y,e,t),this.z=dn(this.z,e,t),this.w=dn(this.w,e,t),this}clampLength(e,t){const n=this.length();return this.divideScalar(n||1).multiplyScalar(dn(n,e,t))}floor(){return this.x=Math.floor(this.x),this.y=Math.floor(this.y),this.z=Math.floor(this.z),this.w=Math.floor(this.w),this}ceil(){return this.x=Math.ceil(this.x),this.y=Math.ceil(this.y),this.z=Math.ceil(this.z),this.w=Math.ceil(this.w),this}round(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this.z=Math.round(this.z),this.w=Math.round(this.w),this}roundToZero(){return this.x=Math.trunc(this.x),this.y=Math.trunc(this.y),this.z=Math.trunc(this.z),this.w=Math.trunc(this.w),this}negate(){return this.x=-this.x,this.y=-this.y,this.z=-this.z,this.w=-this.w,this}dot(e){return this.x*e.x+this.y*e.y+this.z*e.z+this.w*e.w}lengthSq(){return this.x*this.x+this.y*this.y+this.z*this.z+this.w*this.w}length(){return Math.sqrt(this.x*this.x+this.y*this.y+this.z*this.z+this.w*this.w)}manhattanLength(){return Math.abs(this.x)+Math.abs(this.y)+Math.abs(this.z)+Math.abs(this.w)}normalize(){return this.divideScalar(this.length()||1)}setLength(e){return this.normalize().multiplyScalar(e)}lerp(e,t){return this.x+=(e.x-this.x)*t,this.y+=(e.y-this.y)*t,this.z+=(e.z-this.z)*t,this.w+=(e.w-this.w)*t,this}lerpVectors(e,t,n){return this.x=e.x+(t.x-e.x)*n,this.y=e.y+(t.y-e.y)*n,this.z=e.z+(t.z-e.z)*n,this.w=e.w+(t.w-e.w)*n,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 mx extends To{constructor(e=1,t=1,n={}){super(),n=Object.assign({generateMipmaps:!1,internalFormat:null,minFilter:Cn,depthBuffer:!0,stencilBuffer:!1,resolveDepthBuffer:!0,resolveStencilBuffer:!0,depthTexture:null,samples:0,count:1,depth:1,multiview:!1},n),this.isRenderTarget=!0,this.width=e,this.height=t,this.depth=n.depth,this.scissor=new pi(0,0,e,t),this.scissorTest=!1,this.viewport=new pi(0,0,e,t);const i={width:e,height:t,depth:n.depth},o=new Qn(i);this.textures=[];const l=n.count;for(let h=0;h<l;h++)this.textures[h]=o.clone(),this.textures[h].isRenderTargetTexture=!0,this.textures[h].renderTarget=this;this._setTextureOptions(n),this.depthBuffer=n.depthBuffer,this.stencilBuffer=n.stencilBuffer,this.resolveDepthBuffer=n.resolveDepthBuffer,this.resolveStencilBuffer=n.resolveStencilBuffer,this._depthTexture=null,this.depthTexture=n.depthTexture,this.samples=n.samples,this.multiview=n.multiview}_setTextureOptions(e={}){const t={minFilter:Cn,generateMipmaps:!1,flipY:!1,internalFormat:null};e.mapping!==void 0&&(t.mapping=e.mapping),e.wrapS!==void 0&&(t.wrapS=e.wrapS),e.wrapT!==void 0&&(t.wrapT=e.wrapT),e.wrapR!==void 0&&(t.wrapR=e.wrapR),e.magFilter!==void 0&&(t.magFilter=e.magFilter),e.minFilter!==void 0&&(t.minFilter=e.minFilter),e.format!==void 0&&(t.format=e.format),e.type!==void 0&&(t.type=e.type),e.anisotropy!==void 0&&(t.anisotropy=e.anisotropy),e.colorSpace!==void 0&&(t.colorSpace=e.colorSpace),e.flipY!==void 0&&(t.flipY=e.flipY),e.generateMipmaps!==void 0&&(t.generateMipmaps=e.generateMipmaps),e.internalFormat!==void 0&&(t.internalFormat=e.internalFormat);for(let n=0;n<this.textures.length;n++)this.textures[n].setValues(t)}get texture(){return this.textures[0]}set texture(e){this.textures[0]=e}set depthTexture(e){this._depthTexture!==null&&(this._depthTexture.renderTarget=null),e!==null&&(e.renderTarget=this),this._depthTexture=e}get depthTexture(){return this._depthTexture}setSize(e,t,n=1){if(this.width!==e||this.height!==t||this.depth!==n){this.width=e,this.height=t,this.depth=n;for(let i=0,o=this.textures.length;i<o;i++)this.textures[i].image.width=e,this.textures[i].image.height=t,this.textures[i].image.depth=n,this.textures[i].isData3DTexture!==!0&&(this.textures[i].isArrayTexture=this.textures[i].image.depth>1);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.textures.length=0;for(let t=0,n=e.textures.length;t<n;t++){this.textures[t]=e.textures[t].clone(),this.textures[t].isRenderTargetTexture=!0,this.textures[t].renderTarget=this;const i=Object.assign({},e.textures[t].image);this.textures[t].source=new dc(i)}return this.depthBuffer=e.depthBuffer,this.stencilBuffer=e.stencilBuffer,this.resolveDepthBuffer=e.resolveDepthBuffer,this.resolveStencilBuffer=e.resolveStencilBuffer,e.depthTexture!==null&&(this.depthTexture=e.depthTexture.clone()),this.samples=e.samples,this}dispose(){this.dispatchEvent({type:"dispose"})}}class ds extends mx{constructor(e=1,t=1,n={}){super(e,t,n),this.isWebGLRenderTarget=!0}}class T0 extends Qn{constructor(e=null,t=1,n=1,i=1){super(null),this.isDataArrayTexture=!0,this.image={data:e,width:t,height:n,depth:i},this.magFilter=Ti,this.minFilter=Ti,this.wrapR=Ei,this.generateMipmaps=!1,this.flipY=!1,this.unpackAlignment=1,this.layerUpdates=new Set}addLayerUpdate(e){this.layerUpdates.add(e)}clearLayerUpdates(){this.layerUpdates.clear()}}class C2 extends ds{constructor(e=1,t=1,n=1,i={}){super(e,t,i),this.isWebGLArrayRenderTarget=!0,this.depth=n,this.texture=new T0(null,e,t,n),this._setTextureOptions(i),this.texture.isRenderTargetTexture=!0}}class C0 extends Qn{constructor(e=null,t=1,n=1,i=1){super(null),this.isData3DTexture=!0,this.image={data:e,width:t,height:n,depth:i},this.magFilter=Ti,this.minFilter=Ti,this.wrapR=Ei,this.generateMipmaps=!1,this.flipY=!1,this.unpackAlignment=1}}class R2 extends ds{constructor(e=1,t=1,n=1,i={}){super(e,t,i),this.isWebGL3DRenderTarget=!0,this.depth=n,this.texture=new C0(null,e,t,n),this._setTextureOptions(i),this.texture.isRenderTargetTexture=!0}}class Ra{constructor(e=new Z(1/0,1/0,1/0),t=new Z(-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,n=e.length;t<n;t+=3)this.expandByPoint(Wr.fromArray(e,t));return this}setFromBufferAttribute(e){this.makeEmpty();for(let t=0,n=e.count;t<n;t++)this.expandByPoint(Wr.fromBufferAttribute(e,t));return this}setFromPoints(e){this.makeEmpty();for(let t=0,n=e.length;t<n;t++)this.expandByPoint(e[t]);return this}setFromCenterAndSize(e,t){const n=Wr.copy(t).multiplyScalar(.5);return this.min.copy(e).sub(n),this.max.copy(e).add(n),this}setFromObject(e,t=!1){return this.makeEmpty(),this.expandByObject(e,t)}clone(){return new this.constructor().copy(this)}copy(e){return this.min.copy(e.min),this.max.copy(e.max),this}makeEmpty(){return this.min.x=this.min.y=this.min.z=1/0,this.max.x=this.max.y=this.max.z=-1/0,this}isEmpty(){return this.max.x<this.min.x||this.max.y<this.min.y||this.max.z<this.min.z}getCenter(e){return this.isEmpty()?e.set(0,0,0):e.addVectors(this.min,this.max).multiplyScalar(.5)}getSize(e){return this.isEmpty()?e.set(0,0,0):e.subVectors(this.max,this.min)}expandByPoint(e){return this.min.min(e),this.max.max(e),this}expandByVector(e){return this.min.sub(e),this.max.add(e),this}expandByScalar(e){return this.min.addScalar(-e),this.max.addScalar(e),this}expandByObject(e,t=!1){e.updateWorldMatrix(!1,!1);const n=e.geometry;if(n!==void 0){const o=n.getAttribute("position");if(t===!0&&o!==void 0&&e.isInstancedMesh!==!0)for(let l=0,h=o.count;l<h;l++)e.isMesh===!0?e.getVertexPosition(l,Wr):Wr.fromBufferAttribute(o,l),Wr.applyMatrix4(e.matrixWorld),this.expandByPoint(Wr);else e.boundingBox!==void 0?(e.boundingBox===null&&e.computeBoundingBox(),R0.copy(e.boundingBox)):(n.boundingBox===null&&n.computeBoundingBox(),R0.copy(n.boundingBox)),R0.applyMatrix4(e.matrixWorld),this.union(R0)}const i=e.children;for(let o=0,l=i.length;o<l;o++)this.expandByObject(i[o],t);return this}containsPoint(e){return e.x>=this.min.x&&e.x<=this.max.x&&e.y>=this.min.y&&e.y<=this.max.y&&e.z>=this.min.z&&e.z<=this.max.z}containsBox(e){return this.min.x<=e.min.x&&e.max.x<=this.max.x&&this.min.y<=e.min.y&&e.max.y<=this.max.y&&this.min.z<=e.min.z&&e.max.z<=this.max.z}getParameter(e,t){return t.set((e.x-this.min.x)/(this.max.x-this.min.x),(e.y-this.min.y)/(this.max.y-this.min.y),(e.z-this.min.z)/(this.max.z-this.min.z))}intersectsBox(e){return e.max.x>=this.min.x&&e.min.x<=this.max.x&&e.max.y>=this.min.y&&e.min.y<=this.max.y&&e.max.z>=this.min.z&&e.min.z<=this.max.z}intersectsSphere(e){return this.clampPoint(e.center,Wr),Wr.distanceToSquared(e.center)<=e.radius*e.radius}intersectsPlane(e){let t,n;return e.normal.x>0?(t=e.normal.x*this.min.x,n=e.normal.x*this.max.x):(t=e.normal.x*this.max.x,n=e.normal.x*this.min.x),e.normal.y>0?(t+=e.normal.y*this.min.y,n+=e.normal.y*this.max.y):(t+=e.normal.y*this.max.y,n+=e.normal.y*this.min.y),e.normal.z>0?(t+=e.normal.z*this.min.z,n+=e.normal.z*this.max.z):(t+=e.normal.z*this.max.z,n+=e.normal.z*this.min.z),t<=-e.constant&&n>=-e.constant}intersectsTriangle(e){if(this.isEmpty())return!1;this.getCenter(vp),w0.subVectors(this.max,vp),sh.subVectors(e.a,vp),rh.subVectors(e.b,vp),oh.subVectors(e.c,vp),pc.subVectors(rh,sh),mc.subVectors(oh,rh),Cu.subVectors(sh,oh);let t=[0,-pc.z,pc.y,0,-mc.z,mc.y,0,-Cu.z,Cu.y,pc.z,0,-pc.x,mc.z,0,-mc.x,Cu.z,0,-Cu.x,-pc.y,pc.x,0,-mc.y,mc.x,0,-Cu.y,Cu.x,0];return!gx(t,sh,rh,oh,w0)||(t=[1,0,0,0,1,0,0,0,1],!gx(t,sh,rh,oh,w0))?!1:(B0.crossVectors(pc,mc),t=[B0.x,B0.y,B0.z],gx(t,sh,rh,oh,w0))}clampPoint(e,t){return t.copy(e).clamp(this.min,this.max)}distanceToPoint(e){return this.clampPoint(e,Wr).distanceTo(e)}getBoundingSphere(e){return this.isEmpty()?e.makeEmpty():(this.getCenter(e.center),e.radius=this.getSize(Wr).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:(ml[0].set(this.min.x,this.min.y,this.min.z).applyMatrix4(e),ml[1].set(this.min.x,this.min.y,this.max.z).applyMatrix4(e),ml[2].set(this.min.x,this.max.y,this.min.z).applyMatrix4(e),ml[3].set(this.min.x,this.max.y,this.max.z).applyMatrix4(e),ml[4].set(this.max.x,this.min.y,this.min.z).applyMatrix4(e),ml[5].set(this.max.x,this.min.y,this.max.z).applyMatrix4(e),ml[6].set(this.max.x,this.max.y,this.min.z).applyMatrix4(e),ml[7].set(this.max.x,this.max.y,this.max.z).applyMatrix4(e),this.setFromPoints(ml),this)}translate(e){return this.min.add(e),this.max.add(e),this}equals(e){return e.min.equals(this.min)&&e.max.equals(this.max)}toJSON(){return{min:this.min.toArray(),max:this.max.toArray()}}fromJSON(e){return this.min.fromArray(e.min),this.max.fromArray(e.max),this}}const ml=[new Z,new Z,new Z,new Z,new Z,new Z,new Z,new Z],Wr=new Z,R0=new Ra,sh=new Z,rh=new Z,oh=new Z,pc=new Z,mc=new Z,Cu=new Z,vp=new Z,w0=new Z,B0=new Z,Ru=new Z;function gx(s,e,t,n,i){for(let o=0,l=s.length-3;o<=l;o+=3){Ru.fromArray(s,o);const h=i.x*Math.abs(Ru.x)+i.y*Math.abs(Ru.y)+i.z*Math.abs(Ru.z),d=e.dot(Ru),p=t.dot(Ru),_=n.dot(Ru);if(Math.max(-Math.max(d,p,_),Math.min(d,p,_))>h)return!1}return!0}const w2=new Ra,_p=new Z,vx=new Z;class fa{constructor(e=new Z,t=-1){this.isSphere=!0,this.center=e,this.radius=t}set(e,t){return this.center.copy(e),this.radius=t,this}setFromPoints(e,t){const n=this.center;t!==void 0?n.copy(t):w2.setFromPoints(e).getCenter(n);let i=0;for(let o=0,l=e.length;o<l;o++)i=Math.max(i,n.distanceToSquared(e[o]));return this.radius=Math.sqrt(i),this}copy(e){return this.center.copy(e.center),this.radius=e.radius,this}isEmpty(){return this.radius<0}makeEmpty(){return this.center.set(0,0,0),this.radius=-1,this}containsPoint(e){return e.distanceToSquared(this.center)<=this.radius*this.radius}distanceToPoint(e){return e.distanceTo(this.center)-this.radius}intersectsSphere(e){const t=this.radius+e.radius;return e.center.distanceToSquared(this.center)<=t*t}intersectsBox(e){return e.intersectsSphere(this)}intersectsPlane(e){return Math.abs(e.distanceToPoint(this.center))<=this.radius}clampPoint(e,t){const n=this.center.distanceToSquared(e);return t.copy(e),n>this.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;_p.subVectors(e,this.center);const t=_p.lengthSq();if(t>this.radius*this.radius){const n=Math.sqrt(t),i=(n-this.radius)*.5;this.center.addScaledVector(_p,i/n),this.radius+=i}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):(vx.subVectors(e.center,this.center).setLength(e.radius),this.expandByPoint(_p.copy(e.center).add(vx)),this.expandByPoint(_p.copy(e.center).sub(vx))),this)}equals(e){return e.center.equals(this.center)&&e.radius===this.radius}clone(){return new this.constructor().copy(this)}toJSON(){return{radius:this.radius,center:this.center.toArray()}}fromJSON(e){return this.radius=e.radius,this.center.fromArray(e.center),this}}const gl=new Z,_x=new Z,D0=new Z,gc=new Z,yx=new Z,N0=new Z,xx=new Z;class lh{constructor(e=new Z,t=new Z(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,gl)),this}closestPointToPoint(e,t){t.subVectors(e,this.origin);const n=t.dot(this.direction);return n<0?t.copy(this.origin):t.copy(this.origin).addScaledVector(this.direction,n)}distanceToPoint(e){return Math.sqrt(this.distanceSqToPoint(e))}distanceSqToPoint(e){const t=gl.subVectors(e,this.origin).dot(this.direction);return t<0?this.origin.distanceToSquared(e):(gl.copy(this.origin).addScaledVector(this.direction,t),gl.distanceToSquared(e))}distanceSqToSegment(e,t,n,i){_x.copy(e).add(t).multiplyScalar(.5),D0.copy(t).sub(e).normalize(),gc.copy(this.origin).sub(_x);const o=e.distanceTo(t)*.5,l=-this.direction.dot(D0),h=gc.dot(this.direction),d=-gc.dot(D0),p=gc.lengthSq(),_=Math.abs(1-l*l);let v,y,x,b;if(_>0)if(v=l*d-h,y=l*h-d,b=o*_,v>=0)if(y>=-b)if(y<=b){const R=1/_;v*=R,y*=R,x=v*(v+l*y+2*h)+y*(l*v+y+2*d)+p}else y=o,v=Math.max(0,-(l*y+h)),x=-v*v+y*(y+2*d)+p;else y=-o,v=Math.max(0,-(l*y+h)),x=-v*v+y*(y+2*d)+p;else y<=-b?(v=Math.max(0,-(-l*o+h)),y=v>0?-o:Math.min(Math.max(-o,-d),o),x=-v*v+y*(y+2*d)+p):y<=b?(v=0,y=Math.min(Math.max(-o,-d),o),x=y*(y+2*d)+p):(v=Math.max(0,-(l*o+h)),y=v>0?o:Math.min(Math.max(-o,-d),o),x=-v*v+y*(y+2*d)+p);else y=l>0?-o:o,v=Math.max(0,-(l*y+h)),x=-v*v+y*(y+2*d)+p;return n&&n.copy(this.origin).addScaledVector(this.direction,v),i&&i.copy(_x).addScaledVector(D0,y),x}intersectSphere(e,t){gl.subVectors(e.center,this.origin);const n=gl.dot(this.direction),i=gl.dot(gl)-n*n,o=e.radius*e.radius;if(i>o)return null;const l=Math.sqrt(o-i),h=n-l,d=n+l;return d<0?null:h<0?this.at(d,t):this.at(h,t)}intersectsSphere(e){return e.radius<0?!1: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 n=-(this.origin.dot(e.normal)+e.constant)/t;return n>=0?n:null}intersectPlane(e,t){const n=this.distanceToPlane(e);return n===null?null:this.at(n,t)}intersectsPlane(e){const t=e.distanceToPoint(this.origin);return t===0||e.normal.dot(this.direction)*t<0}intersectBox(e,t){let n,i,o,l,h,d;const p=1/this.direction.x,_=1/this.direction.y,v=1/this.direction.z,y=this.origin;return p>=0?(n=(e.min.x-y.x)*p,i=(e.max.x-y.x)*p):(n=(e.max.x-y.x)*p,i=(e.min.x-y.x)*p),_>=0?(o=(e.min.y-y.y)*_,l=(e.max.y-y.y)*_):(o=(e.max.y-y.y)*_,l=(e.min.y-y.y)*_),n>l||o>i||((o>n||isNaN(n))&&(n=o),(l<i||isNaN(i))&&(i=l),v>=0?(h=(e.min.z-y.z)*v,d=(e.max.z-y.z)*v):(h=(e.max.z-y.z)*v,d=(e.min.z-y.z)*v),n>d||h>i)||((h>n||n!==n)&&(n=h),(d<i||i!==i)&&(i=d),i<0)?null:this.at(n>=0?n:i,t)}intersectsBox(e){return this.intersectBox(e,gl)!==null}intersectTriangle(e,t,n,i,o){yx.subVectors(t,e),N0.subVectors(n,e),xx.crossVectors(yx,N0);let l=this.direction.dot(xx),h;if(l>0){if(i)return null;h=1}else if(l<0)h=-1,l=-l;else return null;gc.subVectors(this.origin,e);const d=h*this.direction.dot(N0.crossVectors(gc,N0));if(d<0)return null;const p=h*this.direction.dot(yx.cross(gc));if(p<0||d+p>l)return null;const _=-h*gc.dot(xx);return _<0?null:this.at(_/l,o)}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 en{constructor(e,t,n,i,o,l,h,d,p,_,v,y,x,b,R,T){en.prototype.isMatrix4=!0,this.elements=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1],e!==void 0&&this.set(e,t,n,i,o,l,h,d,p,_,v,y,x,b,R,T)}set(e,t,n,i,o,l,h,d,p,_,v,y,x,b,R,T){const M=this.elements;return M[0]=e,M[4]=t,M[8]=n,M[12]=i,M[1]=o,M[5]=l,M[9]=h,M[13]=d,M[2]=p,M[6]=_,M[10]=v,M[14]=y,M[3]=x,M[7]=b,M[11]=R,M[15]=T,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 en().fromArray(this.elements)}copy(e){const t=this.elements,n=e.elements;return t[0]=n[0],t[1]=n[1],t[2]=n[2],t[3]=n[3],t[4]=n[4],t[5]=n[5],t[6]=n[6],t[7]=n[7],t[8]=n[8],t[9]=n[9],t[10]=n[10],t[11]=n[11],t[12]=n[12],t[13]=n[13],t[14]=n[14],t[15]=n[15],this}copyPosition(e){const t=this.elements,n=e.elements;return t[12]=n[12],t[13]=n[13],t[14]=n[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,n){return this.determinant()===0?(e.set(1,0,0),t.set(0,1,0),n.set(0,0,1),this):(e.setFromMatrixColumn(this,0),t.setFromMatrixColumn(this,1),n.setFromMatrixColumn(this,2),this)}makeBasis(e,t,n){return this.set(e.x,t.x,n.x,0,e.y,t.y,n.y,0,e.z,t.z,n.z,0,0,0,0,1),this}extractRotation(e){if(e.determinant()===0)return this.identity();const t=this.elements,n=e.elements,i=1/ch.setFromMatrixColumn(e,0).length(),o=1/ch.setFromMatrixColumn(e,1).length(),l=1/ch.setFromMatrixColumn(e,2).length();return t[0]=n[0]*i,t[1]=n[1]*i,t[2]=n[2]*i,t[3]=0,t[4]=n[4]*o,t[5]=n[5]*o,t[6]=n[6]*o,t[7]=0,t[8]=n[8]*l,t[9]=n[9]*l,t[10]=n[10]*l,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,this}makeRotationFromEuler(e){const t=this.elements,n=e.x,i=e.y,o=e.z,l=Math.cos(n),h=Math.sin(n),d=Math.cos(i),p=Math.sin(i),_=Math.cos(o),v=Math.sin(o);if(e.order==="XYZ"){const y=l*_,x=l*v,b=h*_,R=h*v;t[0]=d*_,t[4]=-d*v,t[8]=p,t[1]=x+b*p,t[5]=y-R*p,t[9]=-h*d,t[2]=R-y*p,t[6]=b+x*p,t[10]=l*d}else if(e.order==="YXZ"){const y=d*_,x=d*v,b=p*_,R=p*v;t[0]=y+R*h,t[4]=b*h-x,t[8]=l*p,t[1]=l*v,t[5]=l*_,t[9]=-h,t[2]=x*h-b,t[6]=R+y*h,t[10]=l*d}else if(e.order==="ZXY"){const y=d*_,x=d*v,b=p*_,R=p*v;t[0]=y-R*h,t[4]=-l*v,t[8]=b+x*h,t[1]=x+b*h,t[5]=l*_,t[9]=R-y*h,t[2]=-l*p,t[6]=h,t[10]=l*d}else if(e.order==="ZYX"){const y=l*_,x=l*v,b=h*_,R=h*v;t[0]=d*_,t[4]=b*p-x,t[8]=y*p+R,t[1]=d*v,t[5]=R*p+y,t[9]=x*p-b,t[2]=-p,t[6]=h*d,t[10]=l*d}else if(e.order==="YZX"){const y=l*d,x=l*p,b=h*d,R=h*p;t[0]=d*_,t[4]=R-y*v,t[8]=b*v+x,t[1]=v,t[5]=l*_,t[9]=-h*_,t[2]=-p*_,t[6]=x*v+b,t[10]=y-R*v}else if(e.order==="XZY"){const y=l*d,x=l*p,b=h*d,R=h*p;t[0]=d*_,t[4]=-v,t[8]=p*_,t[1]=y*v+R,t[5]=l*_,t[9]=x*v-b,t[2]=b*v-x,t[6]=h*_,t[10]=R*v+y}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(B2,e,D2)}lookAt(e,t,n){const i=this.elements;return $s.subVectors(e,t),$s.lengthSq()===0&&($s.z=1),$s.normalize(),vc.crossVectors(n,$s),vc.lengthSq()===0&&(Math.abs(n.z)===1?$s.x+=1e-4:$s.z+=1e-4,$s.normalize(),vc.crossVectors(n,$s)),vc.normalize(),U0.crossVectors($s,vc),i[0]=vc.x,i[4]=U0.x,i[8]=$s.x,i[1]=vc.y,i[5]=U0.y,i[9]=$s.y,i[2]=vc.z,i[6]=U0.z,i[10]=$s.z,this}multiply(e){return this.multiplyMatrices(this,e)}premultiply(e){return this.multiplyMatrices(e,this)}multiplyMatrices(e,t){const n=e.elements,i=t.elements,o=this.elements,l=n[0],h=n[4],d=n[8],p=n[12],_=n[1],v=n[5],y=n[9],x=n[13],b=n[2],R=n[6],T=n[10],M=n[14],w=n[3],D=n[7],N=n[11],H=n[15],O=i[0],z=i[4],V=i[8],U=i[12],F=i[1],K=i[5],ne=i[9],$=i[13],ae=i[2],ge=i[6],I=i[10],W=i[14],ee=i[3],ye=i[7],_e=i[11],X=i[15];return o[0]=l*O+h*F+d*ae+p*ee,o[4]=l*z+h*K+d*ge+p*ye,o[8]=l*V+h*ne+d*I+p*_e,o[12]=l*U+h*$+d*W+p*X,o[1]=_*O+v*F+y*ae+x*ee,o[5]=_*z+v*K+y*ge+x*ye,o[9]=_*V+v*ne+y*I+x*_e,o[13]=_*U+v*$+y*W+x*X,o[2]=b*O+R*F+T*ae+M*ee,o[6]=b*z+R*K+T*ge+M*ye,o[10]=b*V+R*ne+T*I+M*_e,o[14]=b*U+R*$+T*W+M*X,o[3]=w*O+D*F+N*ae+H*ee,o[7]=w*z+D*K+N*ge+H*ye,o[11]=w*V+D*ne+N*I+H*_e,o[15]=w*U+D*$+N*W+H*X,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],n=e[4],i=e[8],o=e[12],l=e[1],h=e[5],d=e[9],p=e[13],_=e[2],v=e[6],y=e[10],x=e[14],b=e[3],R=e[7],T=e[11],M=e[15],w=d*x-p*y,D=h*x-p*v,N=h*y-d*v,H=l*x-p*_,O=l*y-d*_,z=l*v-h*_;return t*(R*w-T*D+M*N)-n*(b*w-T*H+M*O)+i*(b*D-R*H+M*z)-o*(b*N-R*O+T*z)}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,n){const i=this.elements;return e.isVector3?(i[12]=e.x,i[13]=e.y,i[14]=e.z):(i[12]=e,i[13]=t,i[14]=n),this}invert(){const e=this.elements,t=e[0],n=e[1],i=e[2],o=e[3],l=e[4],h=e[5],d=e[6],p=e[7],_=e[8],v=e[9],y=e[10],x=e[11],b=e[12],R=e[13],T=e[14],M=e[15],w=v*T*p-R*y*p+R*d*x-h*T*x-v*d*M+h*y*M,D=b*y*p-_*T*p-b*d*x+l*T*x+_*d*M-l*y*M,N=_*R*p-b*v*p+b*h*x-l*R*x-_*h*M+l*v*M,H=b*v*d-_*R*d-b*h*y+l*R*y+_*h*T-l*v*T,O=t*w+n*D+i*N+o*H;if(O===0)return this.set(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0);const z=1/O;return e[0]=w*z,e[1]=(R*y*o-v*T*o-R*i*x+n*T*x+v*i*M-n*y*M)*z,e[2]=(h*T*o-R*d*o+R*i*p-n*T*p-h*i*M+n*d*M)*z,e[3]=(v*d*o-h*y*o-v*i*p+n*y*p+h*i*x-n*d*x)*z,e[4]=D*z,e[5]=(_*T*o-b*y*o+b*i*x-t*T*x-_*i*M+t*y*M)*z,e[6]=(b*d*o-l*T*o-b*i*p+t*T*p+l*i*M-t*d*M)*z,e[7]=(l*y*o-_*d*o+_*i*p-t*y*p-l*i*x+t*d*x)*z,e[8]=N*z,e[9]=(b*v*o-_*R*o-b*n*x+t*R*x+_*n*M-t*v*M)*z,e[10]=(l*R*o-b*h*o+b*n*p-t*R*p-l*n*M+t*h*M)*z,e[11]=(_*h*o-l*v*o-_*n*p+t*v*p+l*n*x-t*h*x)*z,e[12]=H*z,e[13]=(_*R*i-b*v*i+b*n*y-t*R*y-_*n*T+t*v*T)*z,e[14]=(b*h*i-l*R*i-b*n*d+t*R*d+l*n*T-t*h*T)*z,e[15]=(l*v*i-_*h*i+_*n*d-t*v*d-l*n*y+t*h*y)*z,this}scale(e){const t=this.elements,n=e.x,i=e.y,o=e.z;return t[0]*=n,t[4]*=i,t[8]*=o,t[1]*=n,t[5]*=i,t[9]*=o,t[2]*=n,t[6]*=i,t[10]*=o,t[3]*=n,t[7]*=i,t[11]*=o,this}getMaxScaleOnAxis(){const e=this.elements,t=e[0]*e[0]+e[1]*e[1]+e[2]*e[2],n=e[4]*e[4]+e[5]*e[5]+e[6]*e[6],i=e[8]*e[8]+e[9]*e[9]+e[10]*e[10];return Math.sqrt(Math.max(t,n,i))}makeTranslation(e,t,n){return e.isVector3?this.set(1,0,0,e.x,0,1,0,e.y,0,0,1,e.z,0,0,0,1):this.set(1,0,0,e,0,1,0,t,0,0,1,n,0,0,0,1),this}makeRotationX(e){const t=Math.cos(e),n=Math.sin(e);return this.set(1,0,0,0,0,t,-n,0,0,n,t,0,0,0,0,1),this}makeRotationY(e){const t=Math.cos(e),n=Math.sin(e);return this.set(t,0,n,0,0,1,0,0,-n,0,t,0,0,0,0,1),this}makeRotationZ(e){const t=Math.cos(e),n=Math.sin(e);return this.set(t,-n,0,0,n,t,0,0,0,0,1,0,0,0,0,1),this}makeRotationAxis(e,t){const n=Math.cos(t),i=Math.sin(t),o=1-n,l=e.x,h=e.y,d=e.z,p=o*l,_=o*h;return this.set(p*l+n,p*h-i*d,p*d+i*h,0,p*h+i*d,_*h+n,_*d-i*l,0,p*d-i*h,_*d+i*l,o*d*d+n,0,0,0,0,1),this}makeScale(e,t,n){return this.set(e,0,0,0,0,t,0,0,0,0,n,0,0,0,0,1),this}makeShear(e,t,n,i,o,l){return this.set(1,n,o,0,e,1,l,0,t,i,1,0,0,0,0,1),this}compose(e,t,n){const i=this.elements,o=t._x,l=t._y,h=t._z,d=t._w,p=o+o,_=l+l,v=h+h,y=o*p,x=o*_,b=o*v,R=l*_,T=l*v,M=h*v,w=d*p,D=d*_,N=d*v,H=n.x,O=n.y,z=n.z;return i[0]=(1-(R+M))*H,i[1]=(x+N)*H,i[2]=(b-D)*H,i[3]=0,i[4]=(x-N)*O,i[5]=(1-(y+M))*O,i[6]=(T+w)*O,i[7]=0,i[8]=(b+D)*z,i[9]=(T-w)*z,i[10]=(1-(y+R))*z,i[11]=0,i[12]=e.x,i[13]=e.y,i[14]=e.z,i[15]=1,this}decompose(e,t,n){const i=this.elements;if(e.x=i[12],e.y=i[13],e.z=i[14],this.determinant()===0)return n.set(1,1,1),t.identity(),this;let o=ch.set(i[0],i[1],i[2]).length();const l=ch.set(i[4],i[5],i[6]).length(),h=ch.set(i[8],i[9],i[10]).length();this.determinant()<0&&(o=-o),jr.copy(this);const p=1/o,_=1/l,v=1/h;return jr.elements[0]*=p,jr.elements[1]*=p,jr.elements[2]*=p,jr.elements[4]*=_,jr.elements[5]*=_,jr.elements[6]*=_,jr.elements[8]*=v,jr.elements[9]*=v,jr.elements[10]*=v,t.setFromRotationMatrix(jr),n.x=o,n.y=l,n.z=h,this}makePerspective(e,t,n,i,o,l,h=Zs,d=!1){const p=this.elements,_=2*o/(t-e),v=2*o/(n-i),y=(t+e)/(t-e),x=(n+i)/(n-i);let b,R;if(d)b=o/(l-o),R=l*o/(l-o);else if(h===Zs)b=-(l+o)/(l-o),R=-2*l*o/(l-o);else if(h===$f)b=-l/(l-o),R=-l*o/(l-o);else throw new Error("THREE.Matrix4.makePerspective(): Invalid coordinate system: "+h);return p[0]=_,p[4]=0,p[8]=y,p[12]=0,p[1]=0,p[5]=v,p[9]=x,p[13]=0,p[2]=0,p[6]=0,p[10]=b,p[14]=R,p[3]=0,p[7]=0,p[11]=-1,p[15]=0,this}makeOrthographic(e,t,n,i,o,l,h=Zs,d=!1){const p=this.elements,_=2/(t-e),v=2/(n-i),y=-(t+e)/(t-e),x=-(n+i)/(n-i);let b,R;if(d)b=1/(l-o),R=l/(l-o);else if(h===Zs)b=-2/(l-o),R=-(l+o)/(l-o);else if(h===$f)b=-1/(l-o),R=-o/(l-o);else throw new Error("THREE.Matrix4.makeOrthographic(): Invalid coordinate system: "+h);return p[0]=_,p[4]=0,p[8]=0,p[12]=y,p[1]=0,p[5]=v,p[9]=0,p[13]=x,p[2]=0,p[6]=0,p[10]=b,p[14]=R,p[3]=0,p[7]=0,p[11]=0,p[15]=1,this}equals(e){const t=this.elements,n=e.elements;for(let i=0;i<16;i++)if(t[i]!==n[i])return!1;return!0}fromArray(e,t=0){for(let n=0;n<16;n++)this.elements[n]=e[n+t];return this}toArray(e=[],t=0){const n=this.elements;return e[t]=n[0],e[t+1]=n[1],e[t+2]=n[2],e[t+3]=n[3],e[t+4]=n[4],e[t+5]=n[5],e[t+6]=n[6],e[t+7]=n[7],e[t+8]=n[8],e[t+9]=n[9],e[t+10]=n[10],e[t+11]=n[11],e[t+12]=n[12],e[t+13]=n[13],e[t+14]=n[14],e[t+15]=n[15],e}}const ch=new Z,jr=new en,B2=new Z(0,0,0),D2=new Z(1,1,1),vc=new Z,U0=new Z,$s=new Z,Sb=new en,Mb=new Ca;class er{constructor(e=0,t=0,n=0,i=er.DEFAULT_ORDER){this.isEuler=!0,this._x=e,this._y=t,this._z=n,this._order=i}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,n,i=this._order){return this._x=e,this._y=t,this._z=n,this._order=i,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,n=!0){const i=e.elements,o=i[0],l=i[4],h=i[8],d=i[1],p=i[5],_=i[9],v=i[2],y=i[6],x=i[10];switch(t){case"XYZ":this._y=Math.asin(dn(h,-1,1)),Math.abs(h)<.9999999?(this._x=Math.atan2(-_,x),this._z=Math.atan2(-l,o)):(this._x=Math.atan2(y,p),this._z=0);break;case"YXZ":this._x=Math.asin(-dn(_,-1,1)),Math.abs(_)<.9999999?(this._y=Math.atan2(h,x),this._z=Math.atan2(d,p)):(this._y=Math.atan2(-v,o),this._z=0);break;case"ZXY":this._x=Math.asin(dn(y,-1,1)),Math.abs(y)<.9999999?(this._y=Math.atan2(-v,x),this._z=Math.atan2(-l,p)):(this._y=0,this._z=Math.atan2(d,o));break;case"ZYX":this._y=Math.asin(-dn(v,-1,1)),Math.abs(v)<.9999999?(this._x=Math.atan2(y,x),this._z=Math.atan2(d,o)):(this._x=0,this._z=Math.atan2(-l,p));break;case"YZX":this._z=Math.asin(dn(d,-1,1)),Math.abs(d)<.9999999?(this._x=Math.atan2(-_,p),this._y=Math.atan2(-v,o)):(this._x=0,this._y=Math.atan2(h,x));break;case"XZY":this._z=Math.asin(-dn(l,-1,1)),Math.abs(l)<.9999999?(this._x=Math.atan2(y,p),this._y=Math.atan2(h,o)):(this._x=Math.atan2(-_,x),this._y=0);break;default:Ut("Euler: .setFromRotationMatrix() encountered an unknown order: "+t)}return this._order=t,n===!0&&this._onChangeCallback(),this}setFromQuaternion(e,t,n){return Sb.makeRotationFromQuaternion(e),this.setFromRotationMatrix(Sb,t,n)}setFromVector3(e,t=this._order){return this.set(e.x,e.y,e.z,t)}reorder(e){return Mb.setFromEuler(this),this.setFromQuaternion(Mb,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}}er.DEFAULT_ORDER="XYZ";class uh{constructor(){this.mask=1}set(e){this.mask=(1<<e|0)>>>0}enable(e){this.mask|=1<<e|0}enableAll(){this.mask=-1}toggle(e){this.mask^=1<<e|0}disable(e){this.mask&=~(1<<e|0)}disableAll(){this.mask=0}test(e){return(this.mask&e.mask)!==0}isEnabled(e){return(this.mask&(1<<e|0))!==0}}let N2=0;const bb=new Z,fh=new Ca,vl=new en,L0=new Z,yp=new Z,U2=new Z,L2=new Ca,Eb=new Z(1,0,0),Tb=new Z(0,1,0),Cb=new Z(0,0,1),Rb={type:"added"},O2={type:"removed"},hh={type:"childadded",child:null},Ax={type:"childremoved",child:null};class Un extends To{constructor(){super(),this.isObject3D=!0,Object.defineProperty(this,"id",{value:N2++}),this.uuid=Qs(),this.name="",this.type="Object3D",this.parent=null,this.children=[],this.up=Un.DEFAULT_UP.clone();const e=new Z,t=new er,n=new Ca,i=new Z(1,1,1);function o(){n.setFromEuler(t,!1)}function l(){t.setFromQuaternion(n,void 0,!1)}t._onChange(o),n._onChange(l),Object.defineProperties(this,{position:{configurable:!0,enumerable:!0,value:e},rotation:{configurable:!0,enumerable:!0,value:t},quaternion:{configurable:!0,enumerable:!0,value:n},scale:{configurable:!0,enumerable:!0,value:i},modelViewMatrix:{value:new en},normalMatrix:{value:new yn}}),this.matrix=new en,this.matrixWorld=new en,this.matrixAutoUpdate=Un.DEFAULT_MATRIX_AUTO_UPDATE,this.matrixWorldAutoUpdate=Un.DEFAULT_MATRIX_WORLD_AUTO_UPDATE,this.matrixWorldNeedsUpdate=!1,this.layers=new uh,this.visible=!0,this.castShadow=!1,this.receiveShadow=!1,this.frustumCulled=!0,this.renderOrder=0,this.animations=[],this.customDepthMaterial=void 0,this.customDistanceMaterial=void 0,this.userData={}}onBeforeShadow(){}onAfterShadow(){}onBeforeRender(){}onAfterRender(){}applyMatrix4(e){this.matrixAutoUpdate&&this.updateMatrix(),this.matrix.premultiply(e),this.matrix.decompose(this.position,this.quaternion,this.scale)}applyQuaternion(e){return this.quaternion.premultiply(e),this}setRotationFromAxisAngle(e,t){this.quaternion.setFromAxisAngle(e,t)}setRotationFromEuler(e){this.quaternion.setFromEuler(e,!0)}setRotationFromMatrix(e){this.quaternion.setFromRotationMatrix(e)}setRotationFromQuaternion(e){this.quaternion.copy(e)}rotateOnAxis(e,t){return fh.setFromAxisAngle(e,t),this.quaternion.multiply(fh),this}rotateOnWorldAxis(e,t){return fh.setFromAxisAngle(e,t),this.quaternion.premultiply(fh),this}rotateX(e){return this.rotateOnAxis(Eb,e)}rotateY(e){return this.rotateOnAxis(Tb,e)}rotateZ(e){return this.rotateOnAxis(Cb,e)}translateOnAxis(e,t){return bb.copy(e).applyQuaternion(this.quaternion),this.position.add(bb.multiplyScalar(t)),this}translateX(e){return this.translateOnAxis(Eb,e)}translateY(e){return this.translateOnAxis(Tb,e)}translateZ(e){return this.translateOnAxis(Cb,e)}localToWorld(e){return this.updateWorldMatrix(!0,!1),e.applyMatrix4(this.matrixWorld)}worldToLocal(e){return this.updateWorldMatrix(!0,!1),e.applyMatrix4(vl.copy(this.matrixWorld).invert())}lookAt(e,t,n){e.isVector3?L0.copy(e):L0.set(e,t,n);const i=this.parent;this.updateWorldMatrix(!0,!1),yp.setFromMatrixPosition(this.matrixWorld),this.isCamera||this.isLight?vl.lookAt(yp,L0,this.up):vl.lookAt(L0,yp,this.up),this.quaternion.setFromRotationMatrix(vl),i&&(vl.extractRotation(i.matrixWorld),fh.setFromRotationMatrix(vl),this.quaternion.premultiply(fh.invert()))}add(e){if(arguments.length>1){for(let t=0;t<arguments.length;t++)this.add(arguments[t]);return this}return e===this?(Zt("Object3D.add: object can't be added as a child of itself.",e),this):(e&&e.isObject3D?(e.removeFromParent(),e.parent=this,this.children.push(e),e.dispatchEvent(Rb),hh.child=e,this.dispatchEvent(hh),hh.child=null):Zt("Object3D.add: object not an instance of THREE.Object3D.",e),this)}remove(e){if(arguments.length>1){for(let n=0;n<arguments.length;n++)this.remove(arguments[n]);return this}const t=this.children.indexOf(e);return t!==-1&&(e.parent=null,this.children.splice(t,1),e.dispatchEvent(O2),Ax.child=e,this.dispatchEvent(Ax),Ax.child=null),this}removeFromParent(){const e=this.parent;return e!==null&&e.remove(this),this}clear(){return this.remove(...this.children)}attach(e){return this.updateWorldMatrix(!0,!1),vl.copy(this.matrixWorld).invert(),e.parent!==null&&(e.parent.updateWorldMatrix(!0,!1),vl.multiply(e.parent.matrixWorld)),e.applyMatrix4(vl),e.removeFromParent(),e.parent=this,this.children.push(e),e.updateWorldMatrix(!1,!0),e.dispatchEvent(Rb),hh.child=e,this.dispatchEvent(hh),hh.child=null,this}getObjectById(e){return this.getObjectByProperty("id",e)}getObjectByName(e){return this.getObjectByProperty("name",e)}getObjectByProperty(e,t){if(this[e]===t)return this;for(let n=0,i=this.children.length;n<i;n++){const l=this.children[n].getObjectByProperty(e,t);if(l!==void 0)return l}}getObjectsByProperty(e,t,n=[]){this[e]===t&&n.push(this);const i=this.children;for(let o=0,l=i.length;o<l;o++)i[o].getObjectsByProperty(e,t,n);return n}getWorldPosition(e){return this.updateWorldMatrix(!0,!1),e.setFromMatrixPosition(this.matrixWorld)}getWorldQuaternion(e){return this.updateWorldMatrix(!0,!1),this.matrixWorld.decompose(yp,e,U2),e}getWorldScale(e){return this.updateWorldMatrix(!0,!1),this.matrixWorld.decompose(yp,L2,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 n=0,i=t.length;n<i;n++)t[n].traverse(e)}traverseVisible(e){if(this.visible===!1)return;e(this);const t=this.children;for(let n=0,i=t.length;n<i;n++)t[n].traverseVisible(e)}traverseAncestors(e){const t=this.parent;t!==null&&(e(t),t.traverseAncestors(e))}updateMatrix(){this.matrix.compose(this.position,this.quaternion,this.scale),this.matrixWorldNeedsUpdate=!0}updateMatrixWorld(e){this.matrixAutoUpdate&&this.updateMatrix(),(this.matrixWorldNeedsUpdate||e)&&(this.matrixWorldAutoUpdate===!0&&(this.parent===null?this.matrixWorld.copy(this.matrix):this.matrixWorld.multiplyMatrices(this.parent.matrixWorld,this.matrix)),this.matrixWorldNeedsUpdate=!1,e=!0);const t=this.children;for(let n=0,i=t.length;n<i;n++)t[n].updateMatrixWorld(e)}updateWorldMatrix(e,t){const n=this.parent;if(e===!0&&n!==null&&n.updateWorldMatrix(!0,!1),this.matrixAutoUpdate&&this.updateMatrix(),this.matrixWorldAutoUpdate===!0&&(this.parent===null?this.matrixWorld.copy(this.matrix):this.matrixWorld.multiplyMatrices(this.parent.matrixWorld,this.matrix)),t===!0){const i=this.children;for(let o=0,l=i.length;o<l;o++)i[o].updateWorldMatrix(!1,!0)}}toJSON(e){const t=e===void 0||typeof e=="string",n={};t&&(e={geometries:{},materials:{},textures:{},images:{},shapes:{},skeletons:{},animations:{},nodes:{}},n.metadata={version:4.7,type:"Object",generator:"Object3D.toJSON"});const i={};i.uuid=this.uuid,i.type=this.type,this.name!==""&&(i.name=this.name),this.castShadow===!0&&(i.castShadow=!0),this.receiveShadow===!0&&(i.receiveShadow=!0),this.visible===!1&&(i.visible=!1),this.frustumCulled===!1&&(i.frustumCulled=!1),this.renderOrder!==0&&(i.renderOrder=this.renderOrder),Object.keys(this.userData).length>0&&(i.userData=this.userData),i.layers=this.layers.mask,i.matrix=this.matrix.toArray(),i.up=this.up.toArray(),this.matrixAutoUpdate===!1&&(i.matrixAutoUpdate=!1),this.isInstancedMesh&&(i.type="InstancedMesh",i.count=this.count,i.instanceMatrix=this.instanceMatrix.toJSON(),this.instanceColor!==null&&(i.instanceColor=this.instanceColor.toJSON())),this.isBatchedMesh&&(i.type="BatchedMesh",i.perObjectFrustumCulled=this.perObjectFrustumCulled,i.sortObjects=this.sortObjects,i.drawRanges=this._drawRanges,i.reservedRanges=this._reservedRanges,i.geometryInfo=this._geometryInfo.map(h=>({...h,boundingBox:h.boundingBox?h.boundingBox.toJSON():void 0,boundingSphere:h.boundingSphere?h.boundingSphere.toJSON():void 0})),i.instanceInfo=this._instanceInfo.map(h=>({...h})),i.availableInstanceIds=this._availableInstanceIds.slice(),i.availableGeometryIds=this._availableGeometryIds.slice(),i.nextIndexStart=this._nextIndexStart,i.nextVertexStart=this._nextVertexStart,i.geometryCount=this._geometryCount,i.maxInstanceCount=this._maxInstanceCount,i.maxVertexCount=this._maxVertexCount,i.maxIndexCount=this._maxIndexCount,i.geometryInitialized=this._geometryInitialized,i.matricesTexture=this._matricesTexture.toJSON(e),i.indirectTexture=this._indirectTexture.toJSON(e),this._colorsTexture!==null&&(i.colorsTexture=this._colorsTexture.toJSON(e)),this.boundingSphere!==null&&(i.boundingSphere=this.boundingSphere.toJSON()),this.boundingBox!==null&&(i.boundingBox=this.boundingBox.toJSON()));function o(h,d){return h[d.uuid]===void 0&&(h[d.uuid]=d.toJSON(e)),d.uuid}if(this.isScene)this.background&&(this.background.isColor?i.background=this.background.toJSON():this.background.isTexture&&(i.background=this.background.toJSON(e).uuid)),this.environment&&this.environment.isTexture&&this.environment.isRenderTargetTexture!==!0&&(i.environment=this.environment.toJSON(e).uuid);else if(this.isMesh||this.isLine||this.isPoints){i.geometry=o(e.geometries,this.geometry);const h=this.geometry.parameters;if(h!==void 0&&h.shapes!==void 0){const d=h.shapes;if(Array.isArray(d))for(let p=0,_=d.length;p<_;p++){const v=d[p];o(e.shapes,v)}else o(e.shapes,d)}}if(this.isSkinnedMesh&&(i.bindMode=this.bindMode,i.bindMatrix=this.bindMatrix.toArray(),this.skeleton!==void 0&&(o(e.skeletons,this.skeleton),i.skeleton=this.skeleton.uuid)),this.material!==void 0)if(Array.isArray(this.material)){const h=[];for(let d=0,p=this.material.length;d<p;d++)h.push(o(e.materials,this.material[d]));i.material=h}else i.material=o(e.materials,this.material);if(this.children.length>0){i.children=[];for(let h=0;h<this.children.length;h++)i.children.push(this.children[h].toJSON(e).object)}if(this.animations.length>0){i.animations=[];for(let h=0;h<this.animations.length;h++){const d=this.animations[h];i.animations.push(o(e.animations,d))}}if(t){const h=l(e.geometries),d=l(e.materials),p=l(e.textures),_=l(e.images),v=l(e.shapes),y=l(e.skeletons),x=l(e.animations),b=l(e.nodes);h.length>0&&(n.geometries=h),d.length>0&&(n.materials=d),p.length>0&&(n.textures=p),_.length>0&&(n.images=_),v.length>0&&(n.shapes=v),y.length>0&&(n.skeletons=y),x.length>0&&(n.animations=x),b.length>0&&(n.nodes=b)}return n.object=i,n;function l(h){const d=[];for(const p in h){const _=h[p];delete _.metadata,d.push(_)}return d}}clone(e){return new this.constructor().copy(this,e)}copy(e,t=!0){if(this.name=e.name,this.up.copy(e.up),this.position.copy(e.position),this.rotation.order=e.rotation.order,this.quaternion.copy(e.quaternion),this.scale.copy(e.scale),this.matrix.copy(e.matrix),this.matrixWorld.copy(e.matrixWorld),this.matrixAutoUpdate=e.matrixAutoUpdate,this.matrixWorldAutoUpdate=e.matrixWorldAutoUpdate,this.matrixWorldNeedsUpdate=e.matrixWorldNeedsUpdate,this.layers.mask=e.layers.mask,this.visible=e.visible,this.castShadow=e.castShadow,this.receiveShadow=e.receiveShadow,this.frustumCulled=e.frustumCulled,this.renderOrder=e.renderOrder,this.animations=e.animations.slice(),this.userData=JSON.parse(JSON.stringify(e.userData)),t===!0)for(let n=0;n<e.children.length;n++){const i=e.children[n];this.add(i.clone())}return this}}Un.DEFAULT_UP=new Z(0,1,0),Un.DEFAULT_MATRIX_AUTO_UPDATE=!0,Un.DEFAULT_MATRIX_WORLD_AUTO_UPDATE=!0;const Zr=new Z,_l=new Z,Sx=new Z,yl=new Z,dh=new Z,ph=new Z,wb=new Z,Mx=new Z,bx=new Z,Ex=new Z,Tx=new pi,Cx=new pi,Rx=new pi;class Fs{constructor(e=new Z,t=new Z,n=new Z){this.a=e,this.b=t,this.c=n}static getNormal(e,t,n,i){i.subVectors(n,t),Zr.subVectors(e,t),i.cross(Zr);const o=i.lengthSq();return o>0?i.multiplyScalar(1/Math.sqrt(o)):i.set(0,0,0)}static getBarycoord(e,t,n,i,o){Zr.subVectors(i,t),_l.subVectors(n,t),Sx.subVectors(e,t);const l=Zr.dot(Zr),h=Zr.dot(_l),d=Zr.dot(Sx),p=_l.dot(_l),_=_l.dot(Sx),v=l*p-h*h;if(v===0)return o.set(0,0,0),null;const y=1/v,x=(p*d-h*_)*y,b=(l*_-h*d)*y;return o.set(1-x-b,b,x)}static containsPoint(e,t,n,i){return this.getBarycoord(e,t,n,i,yl)===null?!1:yl.x>=0&&yl.y>=0&&yl.x+yl.y<=1}static getInterpolation(e,t,n,i,o,l,h,d){return this.getBarycoord(e,t,n,i,yl)===null?(d.x=0,d.y=0,"z"in d&&(d.z=0),"w"in d&&(d.w=0),null):(d.setScalar(0),d.addScaledVector(o,yl.x),d.addScaledVector(l,yl.y),d.addScaledVector(h,yl.z),d)}static getInterpolatedAttribute(e,t,n,i,o,l){return Tx.setScalar(0),Cx.setScalar(0),Rx.setScalar(0),Tx.fromBufferAttribute(e,t),Cx.fromBufferAttribute(e,n),Rx.fromBufferAttribute(e,i),l.setScalar(0),l.addScaledVector(Tx,o.x),l.addScaledVector(Cx,o.y),l.addScaledVector(Rx,o.z),l}static isFrontFacing(e,t,n,i){return Zr.subVectors(n,t),_l.subVectors(e,t),Zr.cross(_l).dot(i)<0}set(e,t,n){return this.a.copy(e),this.b.copy(t),this.c.copy(n),this}setFromPointsAndIndices(e,t,n,i){return this.a.copy(e[t]),this.b.copy(e[n]),this.c.copy(e[i]),this}setFromAttributeAndIndices(e,t,n,i){return this.a.fromBufferAttribute(e,t),this.b.fromBufferAttribute(e,n),this.c.fromBufferAttribute(e,i),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 Zr.subVectors(this.c,this.b),_l.subVectors(this.a,this.b),Zr.cross(_l).length()*.5}getMidpoint(e){return e.addVectors(this.a,this.b).add(this.c).multiplyScalar(.3333333333333333)}getNormal(e){return Fs.getNormal(this.a,this.b,this.c,e)}getPlane(e){return e.setFromCoplanarPoints(this.a,this.b,this.c)}getBarycoord(e,t){return Fs.getBarycoord(e,this.a,this.b,this.c,t)}getInterpolation(e,t,n,i,o){return Fs.getInterpolation(e,this.a,this.b,this.c,t,n,i,o)}containsPoint(e){return Fs.containsPoint(e,this.a,this.b,this.c)}isFrontFacing(e){return Fs.isFrontFacing(this.a,this.b,this.c,e)}intersectsBox(e){return e.intersectsTriangle(this)}closestPointToPoint(e,t){const n=this.a,i=this.b,o=this.c;let l,h;dh.subVectors(i,n),ph.subVectors(o,n),Mx.subVectors(e,n);const d=dh.dot(Mx),p=ph.dot(Mx);if(d<=0&&p<=0)return t.copy(n);bx.subVectors(e,i);const _=dh.dot(bx),v=ph.dot(bx);if(_>=0&&v<=_)return t.copy(i);const y=d*v-_*p;if(y<=0&&d>=0&&_<=0)return l=d/(d-_),t.copy(n).addScaledVector(dh,l);Ex.subVectors(e,o);const x=dh.dot(Ex),b=ph.dot(Ex);if(b>=0&&x<=b)return t.copy(o);const R=x*p-d*b;if(R<=0&&p>=0&&b<=0)return h=p/(p-b),t.copy(n).addScaledVector(ph,h);const T=_*b-x*v;if(T<=0&&v-_>=0&&x-b>=0)return wb.subVectors(o,i),h=(v-_)/(v-_+(x-b)),t.copy(i).addScaledVector(wb,h);const M=1/(T+R+y);return l=R*M,h=y*M,t.copy(n).addScaledVector(dh,l).addScaledVector(ph,h)}equals(e){return e.a.equals(this.a)&&e.b.equals(this.b)&&e.c.equals(this.c)}}const Bb={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},_c={h:0,s:0,l:0},O0={h:0,s:0,l:0};function wx(s,e,t){return t<0&&(t+=1),t>1&&(t-=1),t<.16666666666666666?s+(e-s)*6*t:t<.5?e:t<.6666666666666666?s+(e-s)*6*(.6666666666666666-t):s}class Ct{constructor(e,t,n){return this.isColor=!0,this.r=1,this.g=1,this.b=1,this.set(e,t,n)}set(e,t,n){if(t===void 0&&n===void 0){const i=e;i&&i.isColor?this.copy(i):typeof i=="number"?this.setHex(i):typeof i=="string"&&this.setStyle(i)}else this.setRGB(e,t,n);return this}setScalar(e){return this.r=e,this.g=e,this.b=e,this}setHex(e,t=Xi){return e=Math.floor(e),this.r=(e>>16&255)/255,this.g=(e>>8&255)/255,this.b=(e&255)/255,Bn.colorSpaceToWorking(this,t),this}setRGB(e,t,n,i=Bn.workingColorSpace){return this.r=e,this.g=t,this.b=n,Bn.colorSpaceToWorking(this,i),this}setHSL(e,t,n,i=Bn.workingColorSpace){if(e=ux(e,1),t=dn(t,0,1),n=dn(n,0,1),t===0)this.r=this.g=this.b=n;else{const o=n<=.5?n*(1+t):n+t-n*t,l=2*n-o;this.r=wx(l,o,e+.3333333333333333),this.g=wx(l,o,e),this.b=wx(l,o,e-.3333333333333333)}return Bn.colorSpaceToWorking(this,i),this}setStyle(e,t=Xi){function n(o){o!==void 0&&parseFloat(o)<1&&Ut("Color: Alpha component of "+e+" will be ignored.")}let i;if(i=/^(\w+)\(([^\)]*)\)/.exec(e)){let o;const l=i[1],h=i[2];switch(l){case"rgb":case"rgba":if(o=/^\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec(h))return n(o[4]),this.setRGB(Math.min(255,parseInt(o[1],10))/255,Math.min(255,parseInt(o[2],10))/255,Math.min(255,parseInt(o[3],10))/255,t);if(o=/^\s*(\d+)\%\s*,\s*(\d+)\%\s*,\s*(\d+)\%\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec(h))return n(o[4]),this.setRGB(Math.min(100,parseInt(o[1],10))/100,Math.min(100,parseInt(o[2],10))/100,Math.min(100,parseInt(o[3],10))/100,t);break;case"hsl":case"hsla":if(o=/^\s*(\d*\.?\d+)\s*,\s*(\d*\.?\d+)\%\s*,\s*(\d*\.?\d+)\%\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec(h))return n(o[4]),this.setHSL(parseFloat(o[1])/360,parseFloat(o[2])/100,parseFloat(o[3])/100,t);break;default:Ut("Color: Unknown color model "+e)}}else if(i=/^\#([A-Fa-f\d]+)$/.exec(e)){const o=i[1],l=o.length;if(l===3)return this.setRGB(parseInt(o.charAt(0),16)/15,parseInt(o.charAt(1),16)/15,parseInt(o.charAt(2),16)/15,t);if(l===6)return this.setHex(parseInt(o,16),t);Ut("Color: Invalid hex color "+e)}else if(e&&e.length>0)return this.setColorName(e,t);return this}setColorName(e,t=Xi){const n=Bb[e.toLowerCase()];return n!==void 0?this.setHex(n,t):Ut("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=pl(e.r),this.g=pl(e.g),this.b=pl(e.b),this}copyLinearToSRGB(e){return this.r=ih(e.r),this.g=ih(e.g),this.b=ih(e.b),this}convertSRGBToLinear(){return this.copySRGBToLinear(this),this}convertLinearToSRGB(){return this.copyLinearToSRGB(this),this}getHex(e=Xi){return Bn.workingToColorSpace(Qa.copy(this),e),Math.round(dn(Qa.r*255,0,255))*65536+Math.round(dn(Qa.g*255,0,255))*256+Math.round(dn(Qa.b*255,0,255))}getHexString(e=Xi){return("000000"+this.getHex(e).toString(16)).slice(-6)}getHSL(e,t=Bn.workingColorSpace){Bn.workingToColorSpace(Qa.copy(this),t);const n=Qa.r,i=Qa.g,o=Qa.b,l=Math.max(n,i,o),h=Math.min(n,i,o);let d,p;const _=(h+l)/2;if(h===l)d=0,p=0;else{const v=l-h;switch(p=_<=.5?v/(l+h):v/(2-l-h),l){case n:d=(i-o)/v+(i<o?6:0);break;case i:d=(o-n)/v+2;break;case o:d=(n-i)/v+4;break}d/=6}return e.h=d,e.s=p,e.l=_,e}getRGB(e,t=Bn.workingColorSpace){return Bn.workingToColorSpace(Qa.copy(this),t),e.r=Qa.r,e.g=Qa.g,e.b=Qa.b,e}getStyle(e=Xi){Bn.workingToColorSpace(Qa.copy(this),e);const t=Qa.r,n=Qa.g,i=Qa.b;return e!==Xi?`color(${e} ${t.toFixed(3)} ${n.toFixed(3)} ${i.toFixed(3)})`:`rgb(${Math.round(t*255)},${Math.round(n*255)},${Math.round(i*255)})`}offsetHSL(e,t,n){return this.getHSL(_c),this.setHSL(_c.h+e,_c.s+t,_c.l+n)}add(e){return this.r+=e.r,this.g+=e.g,this.b+=e.b,this}addColors(e,t){return this.r=e.r+t.r,this.g=e.g+t.g,this.b=e.b+t.b,this}addScalar(e){return this.r+=e,this.g+=e,this.b+=e,this}sub(e){return this.r=Math.max(0,this.r-e.r),this.g=Math.max(0,this.g-e.g),this.b=Math.max(0,this.b-e.b),this}multiply(e){return this.r*=e.r,this.g*=e.g,this.b*=e.b,this}multiplyScalar(e){return this.r*=e,this.g*=e,this.b*=e,this}lerp(e,t){return this.r+=(e.r-this.r)*t,this.g+=(e.g-this.g)*t,this.b+=(e.b-this.b)*t,this}lerpColors(e,t,n){return this.r=e.r+(t.r-e.r)*n,this.g=e.g+(t.g-e.g)*n,this.b=e.b+(t.b-e.b)*n,this}lerpHSL(e,t){this.getHSL(_c),e.getHSL(O0);const n=gp(_c.h,O0.h,t),i=gp(_c.s,O0.s,t),o=gp(_c.l,O0.l,t);return this.setHSL(n,i,o),this}setFromVector3(e){return this.r=e.x,this.g=e.y,this.b=e.z,this}applyMatrix3(e){const t=this.r,n=this.g,i=this.b,o=e.elements;return this.r=o[0]*t+o[3]*n+o[6]*i,this.g=o[1]*t+o[4]*n+o[7]*i,this.b=o[2]*t+o[5]*n+o[8]*i,this}equals(e){return e.r===this.r&&e.g===this.g&&e.b===this.b}fromArray(e,t=0){return this.r=e[t],this.g=e[t+1],this.b=e[t+2],this}toArray(e=[],t=0){return e[t]=this.r,e[t+1]=this.g,e[t+2]=this.b,e}fromBufferAttribute(e,t){return this.r=e.getX(t),this.g=e.getY(t),this.b=e.getZ(t),this}toJSON(){return this.getHex()}*[Symbol.iterator](){yield this.r,yield this.g,yield this.b}}const Qa=new Ct;Ct.NAMES=Bb;let I2=0;class Yi extends To{constructor(){super(),this.isMaterial=!0,Object.defineProperty(this,"id",{value:I2++}),this.uuid=Qs(),this.name="",this.type="Material",this.blending=gu,this.side=Yr,this.vertexColors=!1,this.opacity=1,this.transparent=!1,this.alphaHash=!1,this.blendSrc=Cg,this.blendDst=Rg,this.blendEquation=sc,this.blendSrcAlpha=null,this.blendDstAlpha=null,this.blendEquationAlpha=null,this.blendColor=new Ct(0,0,0),this.blendAlpha=0,this.depthFunc=vu,this.depthTest=!0,this.depthWrite=!0,this.stencilWriteMask=255,this.stencilFunc=lx,this.stencilRef=0,this.stencilFuncMask=255,this.stencilFail=Eu,this.stencilZFail=Eu,this.stencilZPass=Eu,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.allowOverride=!0,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}onBeforeRender(){}onBeforeCompile(){}customProgramCacheKey(){return this.onBeforeCompile.toString()}setValues(e){if(e!==void 0)for(const t in e){const n=e[t];if(n===void 0){Ut(`Material: parameter '${t}' has value of undefined.`);continue}const i=this[t];if(i===void 0){Ut(`Material: '${t}' is not a property of THREE.${this.type}.`);continue}i&&i.isColor?i.set(n):i&&i.isVector3&&n&&n.isVector3?i.copy(n):this[t]=n}}toJSON(e){const t=e===void 0||typeof e=="string";t&&(e={textures:{},images:{}});const n={metadata:{version:4.7,type:"Material",generator:"Material.toJSON"}};n.uuid=this.uuid,n.type=this.type,this.name!==""&&(n.name=this.name),this.color&&this.color.isColor&&(n.color=this.color.getHex()),this.roughness!==void 0&&(n.roughness=this.roughness),this.metalness!==void 0&&(n.metalness=this.metalness),this.sheen!==void 0&&(n.sheen=this.sheen),this.sheenColor&&this.sheenColor.isColor&&(n.sheenColor=this.sheenColor.getHex()),this.sheenRoughness!==void 0&&(n.sheenRoughness=this.sheenRoughness),this.emissive&&this.emissive.isColor&&(n.emissive=this.emissive.getHex()),this.emissiveIntensity!==void 0&&this.emissiveIntensity!==1&&(n.emissiveIntensity=this.emissiveIntensity),this.specular&&this.specular.isColor&&(n.specular=this.specular.getHex()),this.specularIntensity!==void 0&&(n.specularIntensity=this.specularIntensity),this.specularColor&&this.specularColor.isColor&&(n.specularColor=this.specularColor.getHex()),this.shininess!==void 0&&(n.shininess=this.shininess),this.clearcoat!==void 0&&(n.clearcoat=this.clearcoat),this.clearcoatRoughness!==void 0&&(n.clearcoatRoughness=this.clearcoatRoughness),this.clearcoatMap&&this.clearcoatMap.isTexture&&(n.clearcoatMap=this.clearcoatMap.toJSON(e).uuid),this.clearcoatRoughnessMap&&this.clearcoatRoughnessMap.isTexture&&(n.clearcoatRoughnessMap=this.clearcoatRoughnessMap.toJSON(e).uuid),this.clearcoatNormalMap&&this.clearcoatNormalMap.isTexture&&(n.clearcoatNormalMap=this.clearcoatNormalMap.toJSON(e).uuid,n.clearcoatNormalScale=this.clearcoatNormalScale.toArray()),this.sheenColorMap&&this.sheenColorMap.isTexture&&(n.sheenColorMap=this.sheenColorMap.toJSON(e).uuid),this.sheenRoughnessMap&&this.sheenRoughnessMap.isTexture&&(n.sheenRoughnessMap=this.sheenRoughnessMap.toJSON(e).uuid),this.dispersion!==void 0&&(n.dispersion=this.dispersion),this.iridescence!==void 0&&(n.iridescence=this.iridescence),this.iridescenceIOR!==void 0&&(n.iridescenceIOR=this.iridescenceIOR),this.iridescenceThicknessRange!==void 0&&(n.iridescenceThicknessRange=this.iridescenceThicknessRange),this.iridescenceMap&&this.iridescenceMap.isTexture&&(n.iridescenceMap=this.iridescenceMap.toJSON(e).uuid),this.iridescenceThicknessMap&&this.iridescenceThicknessMap.isTexture&&(n.iridescenceThicknessMap=this.iridescenceThicknessMap.toJSON(e).uuid),this.anisotropy!==void 0&&(n.anisotropy=this.anisotropy),this.anisotropyRotation!==void 0&&(n.anisotropyRotation=this.anisotropyRotation),this.anisotropyMap&&this.anisotropyMap.isTexture&&(n.anisotropyMap=this.anisotropyMap.toJSON(e).uuid),this.map&&this.map.isTexture&&(n.map=this.map.toJSON(e).uuid),this.matcap&&this.matcap.isTexture&&(n.matcap=this.matcap.toJSON(e).uuid),this.alphaMap&&this.alphaMap.isTexture&&(n.alphaMap=this.alphaMap.toJSON(e).uuid),this.lightMap&&this.lightMap.isTexture&&(n.lightMap=this.lightMap.toJSON(e).uuid,n.lightMapIntensity=this.lightMapIntensity),this.aoMap&&this.aoMap.isTexture&&(n.aoMap=this.aoMap.toJSON(e).uuid,n.aoMapIntensity=this.aoMapIntensity),this.bumpMap&&this.bumpMap.isTexture&&(n.bumpMap=this.bumpMap.toJSON(e).uuid,n.bumpScale=this.bumpScale),this.normalMap&&this.normalMap.isTexture&&(n.normalMap=this.normalMap.toJSON(e).uuid,n.normalMapType=this.normalMapType,n.normalScale=this.normalScale.toArray()),this.displacementMap&&this.displacementMap.isTexture&&(n.displacementMap=this.displacementMap.toJSON(e).uuid,n.displacementScale=this.displacementScale,n.displacementBias=this.displacementBias),this.roughnessMap&&this.roughnessMap.isTexture&&(n.roughnessMap=this.roughnessMap.toJSON(e).uuid),this.metalnessMap&&this.metalnessMap.isTexture&&(n.metalnessMap=this.metalnessMap.toJSON(e).uuid),this.emissiveMap&&this.emissiveMap.isTexture&&(n.emissiveMap=this.emissiveMap.toJSON(e).uuid),this.specularMap&&this.specularMap.isTexture&&(n.specularMap=this.specularMap.toJSON(e).uuid),this.specularIntensityMap&&this.specularIntensityMap.isTexture&&(n.specularIntensityMap=this.specularIntensityMap.toJSON(e).uuid),this.specularColorMap&&this.specularColorMap.isTexture&&(n.specularColorMap=this.specularColorMap.toJSON(e).uuid),this.envMap&&this.envMap.isTexture&&(n.envMap=this.envMap.toJSON(e).uuid,this.combine!==void 0&&(n.combine=this.combine)),this.envMapRotation!==void 0&&(n.envMapRotation=this.envMapRotation.toArray()),this.envMapIntensity!==void 0&&(n.envMapIntensity=this.envMapIntensity),this.reflectivity!==void 0&&(n.reflectivity=this.reflectivity),this.refractionRatio!==void 0&&(n.refractionRatio=this.refractionRatio),this.gradientMap&&this.gradientMap.isTexture&&(n.gradientMap=this.gradientMap.toJSON(e).uuid),this.transmission!==void 0&&(n.transmission=this.transmission),this.transmissionMap&&this.transmissionMap.isTexture&&(n.transmissionMap=this.transmissionMap.toJSON(e).uuid),this.thickness!==void 0&&(n.thickness=this.thickness),this.thicknessMap&&this.thicknessMap.isTexture&&(n.thicknessMap=this.thicknessMap.toJSON(e).uuid),this.attenuationDistance!==void 0&&this.attenuationDistance!==1/0&&(n.attenuationDistance=this.attenuationDistance),this.attenuationColor!==void 0&&(n.attenuationColor=this.attenuationColor.getHex()),this.size!==void 0&&(n.size=this.size),this.shadowSide!==null&&(n.shadowSide=this.shadowSide),this.sizeAttenuation!==void 0&&(n.sizeAttenuation=this.sizeAttenuation),this.blending!==gu&&(n.blending=this.blending),this.side!==Yr&&(n.side=this.side),this.vertexColors===!0&&(n.vertexColors=!0),this.opacity<1&&(n.opacity=this.opacity),this.transparent===!0&&(n.transparent=!0),this.blendSrc!==Cg&&(n.blendSrc=this.blendSrc),this.blendDst!==Rg&&(n.blendDst=this.blendDst),this.blendEquation!==sc&&(n.blendEquation=this.blendEquation),this.blendSrcAlpha!==null&&(n.blendSrcAlpha=this.blendSrcAlpha),this.blendDstAlpha!==null&&(n.blendDstAlpha=this.blendDstAlpha),this.blendEquationAlpha!==null&&(n.blendEquationAlpha=this.blendEquationAlpha),this.blendColor&&this.blendColor.isColor&&(n.blendColor=this.blendColor.getHex()),this.blendAlpha!==0&&(n.blendAlpha=this.blendAlpha),this.depthFunc!==vu&&(n.depthFunc=this.depthFunc),this.depthTest===!1&&(n.depthTest=this.depthTest),this.depthWrite===!1&&(n.depthWrite=this.depthWrite),this.colorWrite===!1&&(n.colorWrite=this.colorWrite),this.stencilWriteMask!==255&&(n.stencilWriteMask=this.stencilWriteMask),this.stencilFunc!==lx&&(n.stencilFunc=this.stencilFunc),this.stencilRef!==0&&(n.stencilRef=this.stencilRef),this.stencilFuncMask!==255&&(n.stencilFuncMask=this.stencilFuncMask),this.stencilFail!==Eu&&(n.stencilFail=this.stencilFail),this.stencilZFail!==Eu&&(n.stencilZFail=this.stencilZFail),this.stencilZPass!==Eu&&(n.stencilZPass=this.stencilZPass),this.stencilWrite===!0&&(n.stencilWrite=this.stencilWrite),this.rotation!==void 0&&this.rotation!==0&&(n.rotation=this.rotation),this.polygonOffset===!0&&(n.polygonOffset=!0),this.polygonOffsetFactor!==0&&(n.polygonOffsetFactor=this.polygonOffsetFactor),this.polygonOffsetUnits!==0&&(n.polygonOffsetUnits=this.polygonOffsetUnits),this.linewidth!==void 0&&this.linewidth!==1&&(n.linewidth=this.linewidth),this.dashSize!==void 0&&(n.dashSize=this.dashSize),this.gapSize!==void 0&&(n.gapSize=this.gapSize),this.scale!==void 0&&(n.scale=this.scale),this.dithering===!0&&(n.dithering=!0),this.alphaTest>0&&(n.alphaTest=this.alphaTest),this.alphaHash===!0&&(n.alphaHash=!0),this.alphaToCoverage===!0&&(n.alphaToCoverage=!0),this.premultipliedAlpha===!0&&(n.premultipliedAlpha=!0),this.forceSinglePass===!0&&(n.forceSinglePass=!0),this.allowOverride===!1&&(n.allowOverride=!1),this.wireframe===!0&&(n.wireframe=!0),this.wireframeLinewidth>1&&(n.wireframeLinewidth=this.wireframeLinewidth),this.wireframeLinecap!=="round"&&(n.wireframeLinecap=this.wireframeLinecap),this.wireframeLinejoin!=="round"&&(n.wireframeLinejoin=this.wireframeLinejoin),this.flatShading===!0&&(n.flatShading=!0),this.visible===!1&&(n.visible=!1),this.toneMapped===!1&&(n.toneMapped=!1),this.fog===!1&&(n.fog=!1),Object.keys(this.userData).length>0&&(n.userData=this.userData);function i(o){const l=[];for(const h in o){const d=o[h];delete d.metadata,l.push(d)}return l}if(t){const o=i(e.textures),l=i(e.images);o.length>0&&(n.textures=o),l.length>0&&(n.images=l)}return n}clone(){return new this.constructor().copy(this)}copy(e){this.name=e.name,this.blending=e.blending,this.side=e.side,this.vertexColors=e.vertexColors,this.opacity=e.opacity,this.transparent=e.transparent,this.blendSrc=e.blendSrc,this.blendDst=e.blendDst,this.blendEquation=e.blendEquation,this.blendSrcAlpha=e.blendSrcAlpha,this.blendDstAlpha=e.blendDstAlpha,this.blendEquationAlpha=e.blendEquationAlpha,this.blendColor.copy(e.blendColor),this.blendAlpha=e.blendAlpha,this.depthFunc=e.depthFunc,this.depthTest=e.depthTest,this.depthWrite=e.depthWrite,this.stencilWriteMask=e.stencilWriteMask,this.stencilFunc=e.stencilFunc,this.stencilRef=e.stencilRef,this.stencilFuncMask=e.stencilFuncMask,this.stencilFail=e.stencilFail,this.stencilZFail=e.stencilZFail,this.stencilZPass=e.stencilZPass,this.stencilWrite=e.stencilWrite;const t=e.clippingPlanes;let n=null;if(t!==null){const i=t.length;n=new Array(i);for(let o=0;o!==i;++o)n[o]=t[o].clone()}return this.clippingPlanes=n,this.clipIntersection=e.clipIntersection,this.clipShadows=e.clipShadows,this.shadowSide=e.shadowSide,this.colorWrite=e.colorWrite,this.precision=e.precision,this.polygonOffset=e.polygonOffset,this.polygonOffsetFactor=e.polygonOffsetFactor,this.polygonOffsetUnits=e.polygonOffsetUnits,this.dithering=e.dithering,this.alphaTest=e.alphaTest,this.alphaHash=e.alphaHash,this.alphaToCoverage=e.alphaToCoverage,this.premultipliedAlpha=e.premultipliedAlpha,this.forceSinglePass=e.forceSinglePass,this.allowOverride=e.allowOverride,this.visible=e.visible,this.toneMapped=e.toneMapped,this.userData=JSON.parse(JSON.stringify(e.userData)),this}dispose(){this.dispatchEvent({type:"dispose"})}set needsUpdate(e){e===!0&&this.version++}}class ha extends Yi{constructor(e){super(),this.isMeshBasicMaterial=!0,this.type="MeshBasicMaterial",this.color=new Ct(16777215),this.map=null,this.lightMap=null,this.lightMapIntensity=1,this.aoMap=null,this.aoMapIntensity=1,this.specularMap=null,this.alphaMap=null,this.envMap=null,this.envMapRotation=new er,this.combine=$d,this.reflectivity=1,this.refractionRatio=.98,this.wireframe=!1,this.wireframeLinewidth=1,this.wireframeLinecap="round",this.wireframeLinejoin="round",this.fog=!0,this.setValues(e)}copy(e){return super.copy(e),this.color.copy(e.color),this.map=e.map,this.lightMap=e.lightMap,this.lightMapIntensity=e.lightMapIntensity,this.aoMap=e.aoMap,this.aoMapIntensity=e.aoMapIntensity,this.specularMap=e.specularMap,this.alphaMap=e.alphaMap,this.envMap=e.envMap,this.envMapRotation.copy(e.envMapRotation),this.combine=e.combine,this.reflectivity=e.reflectivity,this.refractionRatio=e.refractionRatio,this.wireframe=e.wireframe,this.wireframeLinewidth=e.wireframeLinewidth,this.wireframeLinecap=e.wireframeLinecap,this.wireframeLinejoin=e.wireframeLinejoin,this.fog=e.fog,this}}const xl=F2();function F2(){const s=new ArrayBuffer(4),e=new Float32Array(s),t=new Uint32Array(s),n=new Uint32Array(512),i=new Uint32Array(512);for(let d=0;d<256;++d){const p=d-127;p<-27?(n[d]=0,n[d|256]=32768,i[d]=24,i[d|256]=24):p<-14?(n[d]=1024>>-p-14,n[d|256]=1024>>-p-14|32768,i[d]=-p-1,i[d|256]=-p-1):p<=15?(n[d]=p+15<<10,n[d|256]=p+15<<10|32768,i[d]=13,i[d|256]=13):p<128?(n[d]=31744,n[d|256]=64512,i[d]=24,i[d|256]=24):(n[d]=31744,n[d|256]=64512,i[d]=13,i[d|256]=13)}const o=new Uint32Array(2048),l=new Uint32Array(64),h=new Uint32Array(64);for(let d=1;d<1024;++d){let p=d<<13,_=0;for(;(p&8388608)===0;)p<<=1,_-=8388608;p&=-8388609,_+=947912704,o[d]=p|_}for(let d=1024;d<2048;++d)o[d]=939524096+(d-1024<<13);for(let d=1;d<31;++d)l[d]=d<<23;l[31]=1199570944,l[32]=2147483648;for(let d=33;d<63;++d)l[d]=2147483648+(d-32<<23);l[63]=3347054592;for(let d=1;d<64;++d)d!==32&&(h[d]=1024);return{floatView:e,uint32View:t,baseTable:n,shiftTable:i,mantissaTable:o,exponentTable:l,offsetTable:h}}function Hs(s){Math.abs(s)>65504&&Ut("DataUtils.toHalfFloat(): Value out of range."),s=dn(s,-65504,65504),xl.floatView[0]=s;const e=xl.uint32View[0],t=e>>23&511;return xl.baseTable[t]+((e&8388607)>>xl.shiftTable[t])}function xp(s){const e=s>>10;return xl.uint32View[0]=xl.mantissaTable[xl.offsetTable[e]+(s&1023)]+xl.exponentTable[e],xl.floatView[0]}class wu{static toHalfFloat(e){return Hs(e)}static fromHalfFloat(e){return xp(e)}}const ia=new Z,I0=new nt;let H2=0;class Hn{constructor(e,t,n=!1){if(Array.isArray(e))throw new TypeError("THREE.BufferAttribute: array should be a Typed Array.");this.isBufferAttribute=!0,Object.defineProperty(this,"id",{value:H2++}),this.name="",this.array=e,this.itemSize=t,this.count=e!==void 0?e.length/t:0,this.normalized=n,this.usage=dp,this.updateRanges=[],this.gpuType=Ci,this.version=0}onUploadCallback(){}set needsUpdate(e){e===!0&&this.version++}setUsage(e){return this.usage=e,this}addUpdateRange(e,t){this.updateRanges.push({start:e,count:t})}clearUpdateRanges(){this.updateRanges.length=0}copy(e){return this.name=e.name,this.array=new e.array.constructor(e.array),this.itemSize=e.itemSize,this.count=e.count,this.normalized=e.normalized,this.usage=e.usage,this.gpuType=e.gpuType,this}copyAt(e,t,n){e*=this.itemSize,n*=t.itemSize;for(let i=0,o=this.itemSize;i<o;i++)this.array[e+i]=t.array[n+i];return this}copyArray(e){return this.array.set(e),this}applyMatrix3(e){if(this.itemSize===2)for(let t=0,n=this.count;t<n;t++)I0.fromBufferAttribute(this,t),I0.applyMatrix3(e),this.setXY(t,I0.x,I0.y);else if(this.itemSize===3)for(let t=0,n=this.count;t<n;t++)ia.fromBufferAttribute(this,t),ia.applyMatrix3(e),this.setXYZ(t,ia.x,ia.y,ia.z);return this}applyMatrix4(e){for(let t=0,n=this.count;t<n;t++)ia.fromBufferAttribute(this,t),ia.applyMatrix4(e),this.setXYZ(t,ia.x,ia.y,ia.z);return this}applyNormalMatrix(e){for(let t=0,n=this.count;t<n;t++)ia.fromBufferAttribute(this,t),ia.applyNormalMatrix(e),this.setXYZ(t,ia.x,ia.y,ia.z);return this}transformDirection(e){for(let t=0,n=this.count;t<n;t++)ia.fromBufferAttribute(this,t),ia.transformDirection(e),this.setXYZ(t,ia.x,ia.y,ia.z);return this}set(e,t=0){return this.array.set(e,t),this}getComponent(e,t){let n=this.array[e*this.itemSize+t];return this.normalized&&(n=hs(n,this.array)),n}setComponent(e,t,n){return this.normalized&&(n=Sn(n,this.array)),this.array[e*this.itemSize+t]=n,this}getX(e){let t=this.array[e*this.itemSize];return this.normalized&&(t=hs(t,this.array)),t}setX(e,t){return this.normalized&&(t=Sn(t,this.array)),this.array[e*this.itemSize]=t,this}getY(e){let t=this.array[e*this.itemSize+1];return this.normalized&&(t=hs(t,this.array)),t}setY(e,t){return this.normalized&&(t=Sn(t,this.array)),this.array[e*this.itemSize+1]=t,this}getZ(e){let t=this.array[e*this.itemSize+2];return this.normalized&&(t=hs(t,this.array)),t}setZ(e,t){return this.normalized&&(t=Sn(t,this.array)),this.array[e*this.itemSize+2]=t,this}getW(e){let t=this.array[e*this.itemSize+3];return this.normalized&&(t=hs(t,this.array)),t}setW(e,t){return this.normalized&&(t=Sn(t,this.array)),this.array[e*this.itemSize+3]=t,this}setXY(e,t,n){return e*=this.itemSize,this.normalized&&(t=Sn(t,this.array),n=Sn(n,this.array)),this.array[e+0]=t,this.array[e+1]=n,this}setXYZ(e,t,n,i){return e*=this.itemSize,this.normalized&&(t=Sn(t,this.array),n=Sn(n,this.array),i=Sn(i,this.array)),this.array[e+0]=t,this.array[e+1]=n,this.array[e+2]=i,this}setXYZW(e,t,n,i,o){return e*=this.itemSize,this.normalized&&(t=Sn(t,this.array),n=Sn(n,this.array),i=Sn(i,this.array),o=Sn(o,this.array)),this.array[e+0]=t,this.array[e+1]=n,this.array[e+2]=i,this.array[e+3]=o,this}onUpload(e){return this.onUploadCallback=e,this}clone(){return new this.constructor(this.array,this.itemSize).copy(this)}toJSON(){const e={itemSize:this.itemSize,type:this.array.constructor.name,array:Array.from(this.array),normalized:this.normalized};return this.name!==""&&(e.name=this.name),this.usage!==dp&&(e.usage=this.usage),e}}class P2 extends Hn{constructor(e,t,n){super(new Int8Array(e),t,n)}}class G2 extends Hn{constructor(e,t,n){super(new Uint8Array(e),t,n)}}class z2 extends Hn{constructor(e,t,n){super(new Uint8ClampedArray(e),t,n)}}class V2 extends Hn{constructor(e,t,n){super(new Int16Array(e),t,n)}}class Bx extends Hn{constructor(e,t,n){super(new Uint16Array(e),t,n)}}class k2 extends Hn{constructor(e,t,n){super(new Int32Array(e),t,n)}}class Dx extends Hn{constructor(e,t,n){super(new Uint32Array(e),t,n)}}class X2 extends Hn{constructor(e,t,n){super(new Uint16Array(e),t,n),this.isFloat16BufferAttribute=!0}getX(e){let t=xp(this.array[e*this.itemSize]);return this.normalized&&(t=hs(t,this.array)),t}setX(e,t){return this.normalized&&(t=Sn(t,this.array)),this.array[e*this.itemSize]=Hs(t),this}getY(e){let t=xp(this.array[e*this.itemSize+1]);return this.normalized&&(t=hs(t,this.array)),t}setY(e,t){return this.normalized&&(t=Sn(t,this.array)),this.array[e*this.itemSize+1]=Hs(t),this}getZ(e){let t=xp(this.array[e*this.itemSize+2]);return this.normalized&&(t=hs(t,this.array)),t}setZ(e,t){return this.normalized&&(t=Sn(t,this.array)),this.array[e*this.itemSize+2]=Hs(t),this}getW(e){let t=xp(this.array[e*this.itemSize+3]);return this.normalized&&(t=hs(t,this.array)),t}setW(e,t){return this.normalized&&(t=Sn(t,this.array)),this.array[e*this.itemSize+3]=Hs(t),this}setXY(e,t,n){return e*=this.itemSize,this.normalized&&(t=Sn(t,this.array),n=Sn(n,this.array)),this.array[e+0]=Hs(t),this.array[e+1]=Hs(n),this}setXYZ(e,t,n,i){return e*=this.itemSize,this.normalized&&(t=Sn(t,this.array),n=Sn(n,this.array),i=Sn(i,this.array)),this.array[e+0]=Hs(t),this.array[e+1]=Hs(n),this.array[e+2]=Hs(i),this}setXYZW(e,t,n,i,o){return e*=this.itemSize,this.normalized&&(t=Sn(t,this.array),n=Sn(n,this.array),i=Sn(i,this.array),o=Sn(o,this.array)),this.array[e+0]=Hs(t),this.array[e+1]=Hs(n),this.array[e+2]=Hs(i),this.array[e+3]=Hs(o),this}}class Xt extends Hn{constructor(e,t,n){super(new Float32Array(e),t,n)}}let Y2=0;const gr=new en,Nx=new Un,mh=new Z,tr=new Ra,Ap=new Ra,wa=new Z;class pn extends To{constructor(){super(),this.isBufferGeometry=!0,Object.defineProperty(this,"id",{value:Y2++}),this.uuid=Qs(),this.name="",this.type="BufferGeometry",this.index=null,this.indirect=null,this.indirectOffset=0,this.attributes={},this.morphAttributes={},this.morphTargetsRelative=!1,this.groups=[],this.boundingBox=null,this.boundingSphere=null,this.drawRange={start:0,count:1/0},this.userData={}}getIndex(){return this.index}setIndex(e){return Array.isArray(e)?this.index=new(db(e)?Dx:Bx)(e,1):this.index=e,this}setIndirect(e,t=0){return this.indirect=e,this.indirectOffset=t,this}getIndirect(){return this.indirect}getAttribute(e){return this.attributes[e]}setAttribute(e,t){return this.attributes[e]=t,this}deleteAttribute(e){return delete this.attributes[e],this}hasAttribute(e){return this.attributes[e]!==void 0}addGroup(e,t,n=0){this.groups.push({start:e,count:t,materialIndex:n})}clearGroups(){this.groups=[]}setDrawRange(e,t){this.drawRange.start=e,this.drawRange.count=t}applyMatrix4(e){const t=this.attributes.position;t!==void 0&&(t.applyMatrix4(e),t.needsUpdate=!0);const n=this.attributes.normal;if(n!==void 0){const o=new yn().getNormalMatrix(e);n.applyNormalMatrix(o),n.needsUpdate=!0}const i=this.attributes.tangent;return i!==void 0&&(i.transformDirection(e),i.needsUpdate=!0),this.boundingBox!==null&&this.computeBoundingBox(),this.boundingSphere!==null&&this.computeBoundingSphere(),this}applyQuaternion(e){return gr.makeRotationFromQuaternion(e),this.applyMatrix4(gr),this}rotateX(e){return gr.makeRotationX(e),this.applyMatrix4(gr),this}rotateY(e){return gr.makeRotationY(e),this.applyMatrix4(gr),this}rotateZ(e){return gr.makeRotationZ(e),this.applyMatrix4(gr),this}translate(e,t,n){return gr.makeTranslation(e,t,n),this.applyMatrix4(gr),this}scale(e,t,n){return gr.makeScale(e,t,n),this.applyMatrix4(gr),this}lookAt(e){return Nx.lookAt(e),Nx.updateMatrix(),this.applyMatrix4(Nx.matrix),this}center(){return this.computeBoundingBox(),this.boundingBox.getCenter(mh).negate(),this.translate(mh.x,mh.y,mh.z),this}setFromPoints(e){const t=this.getAttribute("position");if(t===void 0){const n=[];for(let i=0,o=e.length;i<o;i++){const l=e[i];n.push(l.x,l.y,l.z||0)}this.setAttribute("position",new Xt(n,3))}else{const n=Math.min(e.length,t.count);for(let i=0;i<n;i++){const o=e[i];t.setXYZ(i,o.x,o.y,o.z||0)}e.length>t.count&&Ut("BufferGeometry: Buffer size too small for points data. Use .dispose() and create a new geometry."),t.needsUpdate=!0}return this}computeBoundingBox(){this.boundingBox===null&&(this.boundingBox=new Ra);const e=this.attributes.position,t=this.morphAttributes.position;if(e&&e.isGLBufferAttribute){Zt("BufferGeometry.computeBoundingBox(): GLBufferAttribute requires a manual bounding box.",this),this.boundingBox.set(new Z(-1/0,-1/0,-1/0),new Z(1/0,1/0,1/0));return}if(e!==void 0){if(this.boundingBox.setFromBufferAttribute(e),t)for(let n=0,i=t.length;n<i;n++){const o=t[n];tr.setFromBufferAttribute(o),this.morphTargetsRelative?(wa.addVectors(this.boundingBox.min,tr.min),this.boundingBox.expandByPoint(wa),wa.addVectors(this.boundingBox.max,tr.max),this.boundingBox.expandByPoint(wa)):(this.boundingBox.expandByPoint(tr.min),this.boundingBox.expandByPoint(tr.max))}}else this.boundingBox.makeEmpty();(isNaN(this.boundingBox.min.x)||isNaN(this.boundingBox.min.y)||isNaN(this.boundingBox.min.z))&&Zt('BufferGeometry.computeBoundingBox(): Computed min/max have NaN values. The "position" attribute is likely to have NaN values.',this)}computeBoundingSphere(){this.boundingSphere===null&&(this.boundingSphere=new fa);const e=this.attributes.position,t=this.morphAttributes.position;if(e&&e.isGLBufferAttribute){Zt("BufferGeometry.computeBoundingSphere(): GLBufferAttribute requires a manual bounding sphere.",this),this.boundingSphere.set(new Z,1/0);return}if(e){const n=this.boundingSphere.center;if(tr.setFromBufferAttribute(e),t)for(let o=0,l=t.length;o<l;o++){const h=t[o];Ap.setFromBufferAttribute(h),this.morphTargetsRelative?(wa.addVectors(tr.min,Ap.min),tr.expandByPoint(wa),wa.addVectors(tr.max,Ap.max),tr.expandByPoint(wa)):(tr.expandByPoint(Ap.min),tr.expandByPoint(Ap.max))}tr.getCenter(n);let i=0;for(let o=0,l=e.count;o<l;o++)wa.fromBufferAttribute(e,o),i=Math.max(i,n.distanceToSquared(wa));if(t)for(let o=0,l=t.length;o<l;o++){const h=t[o],d=this.morphTargetsRelative;for(let p=0,_=h.count;p<_;p++)wa.fromBufferAttribute(h,p),d&&(mh.fromBufferAttribute(e,p),wa.add(mh)),i=Math.max(i,n.distanceToSquared(wa))}this.boundingSphere.radius=Math.sqrt(i),isNaN(this.boundingSphere.radius)&&Zt('BufferGeometry.computeBoundingSphere(): Computed radius is NaN. The "position" attribute is likely to have NaN values.',this)}}computeTangents(){const e=this.index,t=this.attributes;if(e===null||t.position===void 0||t.normal===void 0||t.uv===void 0){Zt("BufferGeometry: .computeTangents() failed. Missing required attributes (index, position, normal or uv)");return}const n=t.position,i=t.normal,o=t.uv;this.hasAttribute("tangent")===!1&&this.setAttribute("tangent",new Hn(new Float32Array(4*n.count),4));const l=this.getAttribute("tangent"),h=[],d=[];for(let V=0;V<n.count;V++)h[V]=new Z,d[V]=new Z;const p=new Z,_=new Z,v=new Z,y=new nt,x=new nt,b=new nt,R=new Z,T=new Z;function M(V,U,F){p.fromBufferAttribute(n,V),_.fromBufferAttribute(n,U),v.fromBufferAttribute(n,F),y.fromBufferAttribute(o,V),x.fromBufferAttribute(o,U),b.fromBufferAttribute(o,F),_.sub(p),v.sub(p),x.sub(y),b.sub(y);const K=1/(x.x*b.y-b.x*x.y);isFinite(K)&&(R.copy(_).multiplyScalar(b.y).addScaledVector(v,-x.y).multiplyScalar(K),T.copy(v).multiplyScalar(x.x).addScaledVector(_,-b.x).multiplyScalar(K),h[V].add(R),h[U].add(R),h[F].add(R),d[V].add(T),d[U].add(T),d[F].add(T))}let w=this.groups;w.length===0&&(w=[{start:0,count:e.count}]);for(let V=0,U=w.length;V<U;++V){const F=w[V],K=F.start,ne=F.count;for(let $=K,ae=K+ne;$<ae;$+=3)M(e.getX($+0),e.getX($+1),e.getX($+2))}const D=new Z,N=new Z,H=new Z,O=new Z;function z(V){H.fromBufferAttribute(i,V),O.copy(H);const U=h[V];D.copy(U),D.sub(H.multiplyScalar(H.dot(U))).normalize(),N.crossVectors(O,U);const K=N.dot(d[V])<0?-1:1;l.setXYZW(V,D.x,D.y,D.z,K)}for(let V=0,U=w.length;V<U;++V){const F=w[V],K=F.start,ne=F.count;for(let $=K,ae=K+ne;$<ae;$+=3)z(e.getX($+0)),z(e.getX($+1)),z(e.getX($+2))}}computeVertexNormals(){const e=this.index,t=this.getAttribute("position");if(t!==void 0){let n=this.getAttribute("normal");if(n===void 0)n=new Hn(new Float32Array(t.count*3),3),this.setAttribute("normal",n);else for(let y=0,x=n.count;y<x;y++)n.setXYZ(y,0,0,0);const i=new Z,o=new Z,l=new Z,h=new Z,d=new Z,p=new Z,_=new Z,v=new Z;if(e)for(let y=0,x=e.count;y<x;y+=3){const b=e.getX(y+0),R=e.getX(y+1),T=e.getX(y+2);i.fromBufferAttribute(t,b),o.fromBufferAttribute(t,R),l.fromBufferAttribute(t,T),_.subVectors(l,o),v.subVectors(i,o),_.cross(v),h.fromBufferAttribute(n,b),d.fromBufferAttribute(n,R),p.fromBufferAttribute(n,T),h.add(_),d.add(_),p.add(_),n.setXYZ(b,h.x,h.y,h.z),n.setXYZ(R,d.x,d.y,d.z),n.setXYZ(T,p.x,p.y,p.z)}else for(let y=0,x=t.count;y<x;y+=3)i.fromBufferAttribute(t,y+0),o.fromBufferAttribute(t,y+1),l.fromBufferAttribute(t,y+2),_.subVectors(l,o),v.subVectors(i,o),_.cross(v),n.setXYZ(y+0,_.x,_.y,_.z),n.setXYZ(y+1,_.x,_.y,_.z),n.setXYZ(y+2,_.x,_.y,_.z);this.normalizeNormals(),n.needsUpdate=!0}}normalizeNormals(){const e=this.attributes.normal;for(let t=0,n=e.count;t<n;t++)wa.fromBufferAttribute(e,t),wa.normalize(),e.setXYZ(t,wa.x,wa.y,wa.z)}toNonIndexed(){function e(h,d){const p=h.array,_=h.itemSize,v=h.normalized,y=new p.constructor(d.length*_);let x=0,b=0;for(let R=0,T=d.length;R<T;R++){h.isInterleavedBufferAttribute?x=d[R]*h.data.stride+h.offset:x=d[R]*_;for(let M=0;M<_;M++)y[b++]=p[x++]}return new Hn(y,_,v)}if(this.index===null)return Ut("BufferGeometry.toNonIndexed(): BufferGeometry is already non-indexed."),this;const t=new pn,n=this.index.array,i=this.attributes;for(const h in i){const d=i[h],p=e(d,n);t.setAttribute(h,p)}const o=this.morphAttributes;for(const h in o){const d=[],p=o[h];for(let _=0,v=p.length;_<v;_++){const y=p[_],x=e(y,n);d.push(x)}t.morphAttributes[h]=d}t.morphTargetsRelative=this.morphTargetsRelative;const l=this.groups;for(let h=0,d=l.length;h<d;h++){const p=l[h];t.addGroup(p.start,p.count,p.materialIndex)}return t}toJSON(){const e={metadata:{version:4.7,type:"BufferGeometry",generator:"BufferGeometry.toJSON"}};if(e.uuid=this.uuid,e.type=this.type,this.name!==""&&(e.name=this.name),Object.keys(this.userData).length>0&&(e.userData=this.userData),this.parameters!==void 0){const d=this.parameters;for(const p in d)d[p]!==void 0&&(e[p]=d[p]);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 n=this.attributes;for(const d in n){const p=n[d];e.data.attributes[d]=p.toJSON(e.data)}const i={};let o=!1;for(const d in this.morphAttributes){const p=this.morphAttributes[d],_=[];for(let v=0,y=p.length;v<y;v++){const x=p[v];_.push(x.toJSON(e.data))}_.length>0&&(i[d]=_,o=!0)}o&&(e.data.morphAttributes=i,e.data.morphTargetsRelative=this.morphTargetsRelative);const l=this.groups;l.length>0&&(e.data.groups=JSON.parse(JSON.stringify(l)));const h=this.boundingSphere;return h!==null&&(e.data.boundingSphere=h.toJSON()),e}clone(){return new this.constructor().copy(this)}copy(e){this.index=null,this.attributes={},this.morphAttributes={},this.groups=[],this.boundingBox=null,this.boundingSphere=null;const t={};this.name=e.name;const n=e.index;n!==null&&this.setIndex(n.clone());const i=e.attributes;for(const p in i){const _=i[p];this.setAttribute(p,_.clone(t))}const o=e.morphAttributes;for(const p in o){const _=[],v=o[p];for(let y=0,x=v.length;y<x;y++)_.push(v[y].clone(t));this.morphAttributes[p]=_}this.morphTargetsRelative=e.morphTargetsRelative;const l=e.groups;for(let p=0,_=l.length;p<_;p++){const v=l[p];this.addGroup(v.start,v.count,v.materialIndex)}const h=e.boundingBox;h!==null&&(this.boundingBox=h.clone());const d=e.boundingSphere;return d!==null&&(this.boundingSphere=d.clone()),this.drawRange.start=e.drawRange.start,this.drawRange.count=e.drawRange.count,this.userData=e.userData,this}dispose(){this.dispatchEvent({type:"dispose"})}}const Db=new en,Bu=new lh,F0=new fa,Nb=new Z,H0=new Z,P0=new Z,G0=new Z,Ux=new Z,z0=new Z,Ub=new Z,V0=new Z;class yi extends Un{constructor(e=new pn,t=new ha){super(),this.isMesh=!0,this.type="Mesh",this.geometry=e,this.material=t,this.morphTargetDictionary=void 0,this.morphTargetInfluences=void 0,this.count=1,this.updateMorphTargets()}copy(e,t){return super.copy(e,t),e.morphTargetInfluences!==void 0&&(this.morphTargetInfluences=e.morphTargetInfluences.slice()),e.morphTargetDictionary!==void 0&&(this.morphTargetDictionary=Object.assign({},e.morphTargetDictionary)),this.material=Array.isArray(e.material)?e.material.slice():e.material,this.geometry=e.geometry,this}updateMorphTargets(){const t=this.geometry.morphAttributes,n=Object.keys(t);if(n.length>0){const i=t[n[0]];if(i!==void 0){this.morphTargetInfluences=[],this.morphTargetDictionary={};for(let o=0,l=i.length;o<l;o++){const h=i[o].name||String(o);this.morphTargetInfluences.push(0),this.morphTargetDictionary[h]=o}}}}getVertexPosition(e,t){const n=this.geometry,i=n.attributes.position,o=n.morphAttributes.position,l=n.morphTargetsRelative;t.fromBufferAttribute(i,e);const h=this.morphTargetInfluences;if(o&&h){z0.set(0,0,0);for(let d=0,p=o.length;d<p;d++){const _=h[d],v=o[d];_!==0&&(Ux.fromBufferAttribute(v,e),l?z0.addScaledVector(Ux,_):z0.addScaledVector(Ux.sub(t),_))}t.add(z0)}return t}raycast(e,t){const n=this.geometry,i=this.material,o=this.matrixWorld;i!==void 0&&(n.boundingSphere===null&&n.computeBoundingSphere(),F0.copy(n.boundingSphere),F0.applyMatrix4(o),Bu.copy(e.ray).recast(e.near),!(F0.containsPoint(Bu.origin)===!1&&(Bu.intersectSphere(F0,Nb)===null||Bu.origin.distanceToSquared(Nb)>(e.far-e.near)**2))&&(Db.copy(o).invert(),Bu.copy(e.ray).applyMatrix4(Db),!(n.boundingBox!==null&&Bu.intersectsBox(n.boundingBox)===!1)&&this._computeIntersections(e,t,Bu)))}_computeIntersections(e,t,n){let i;const o=this.geometry,l=this.material,h=o.index,d=o.attributes.position,p=o.attributes.uv,_=o.attributes.uv1,v=o.attributes.normal,y=o.groups,x=o.drawRange;if(h!==null)if(Array.isArray(l))for(let b=0,R=y.length;b<R;b++){const T=y[b],M=l[T.materialIndex],w=Math.max(T.start,x.start),D=Math.min(h.count,Math.min(T.start+T.count,x.start+x.count));for(let N=w,H=D;N<H;N+=3){const O=h.getX(N),z=h.getX(N+1),V=h.getX(N+2);i=k0(this,M,e,n,p,_,v,O,z,V),i&&(i.faceIndex=Math.floor(N/3),i.face.materialIndex=T.materialIndex,t.push(i))}}else{const b=Math.max(0,x.start),R=Math.min(h.count,x.start+x.count);for(let T=b,M=R;T<M;T+=3){const w=h.getX(T),D=h.getX(T+1),N=h.getX(T+2);i=k0(this,l,e,n,p,_,v,w,D,N),i&&(i.faceIndex=Math.floor(T/3),t.push(i))}}else if(d!==void 0)if(Array.isArray(l))for(let b=0,R=y.length;b<R;b++){const T=y[b],M=l[T.materialIndex],w=Math.max(T.start,x.start),D=Math.min(d.count,Math.min(T.start+T.count,x.start+x.count));for(let N=w,H=D;N<H;N+=3){const O=N,z=N+1,V=N+2;i=k0(this,M,e,n,p,_,v,O,z,V),i&&(i.faceIndex=Math.floor(N/3),i.face.materialIndex=T.materialIndex,t.push(i))}}else{const b=Math.max(0,x.start),R=Math.min(d.count,x.start+x.count);for(let T=b,M=R;T<M;T+=3){const w=T,D=T+1,N=T+2;i=k0(this,l,e,n,p,_,v,w,D,N),i&&(i.faceIndex=Math.floor(T/3),t.push(i))}}}}function J2(s,e,t,n,i,o,l,h){let d;if(e.side===fs?d=n.intersectTriangle(l,o,i,!0,h):d=n.intersectTriangle(i,o,l,e.side===Yr,h),d===null)return null;V0.copy(h),V0.applyMatrix4(s.matrixWorld);const p=t.ray.origin.distanceTo(V0);return p<t.near||p>t.far?null:{distance:p,point:V0.clone(),object:s}}function k0(s,e,t,n,i,o,l,h,d,p){s.getVertexPosition(h,H0),s.getVertexPosition(d,P0),s.getVertexPosition(p,G0);const _=J2(s,e,t,n,H0,P0,G0,Ub);if(_){const v=new Z;Fs.getBarycoord(Ub,H0,P0,G0,v),i&&(_.uv=Fs.getInterpolatedAttribute(i,h,d,p,v,new nt)),o&&(_.uv1=Fs.getInterpolatedAttribute(o,h,d,p,v,new nt)),l&&(_.normal=Fs.getInterpolatedAttribute(l,h,d,p,v,new Z),_.normal.dot(n.direction)>0&&_.normal.multiplyScalar(-1));const y={a:h,b:d,c:p,normal:new Z,materialIndex:0};Fs.getNormal(H0,P0,G0,y.normal),_.face=y,_.barycoord=v}return _}class Du extends pn{constructor(e=1,t=1,n=1,i=1,o=1,l=1){super(),this.type="BoxGeometry",this.parameters={width:e,height:t,depth:n,widthSegments:i,heightSegments:o,depthSegments:l};const h=this;i=Math.floor(i),o=Math.floor(o),l=Math.floor(l);const d=[],p=[],_=[],v=[];let y=0,x=0;b("z","y","x",-1,-1,n,t,e,l,o,0),b("z","y","x",1,-1,n,t,-e,l,o,1),b("x","z","y",1,1,e,n,t,i,l,2),b("x","z","y",1,-1,e,n,-t,i,l,3),b("x","y","z",1,-1,e,t,n,i,o,4),b("x","y","z",-1,-1,e,t,-n,i,o,5),this.setIndex(d),this.setAttribute("position",new Xt(p,3)),this.setAttribute("normal",new Xt(_,3)),this.setAttribute("uv",new Xt(v,2));function b(R,T,M,w,D,N,H,O,z,V,U){const F=N/z,K=H/V,ne=N/2,$=H/2,ae=O/2,ge=z+1,I=V+1;let W=0,ee=0;const ye=new Z;for(let _e=0;_e<I;_e++){const X=_e*K-$;for(let te=0;te<ge;te++){const le=te*F-ne;ye[R]=le*w,ye[T]=X*D,ye[M]=ae,p.push(ye.x,ye.y,ye.z),ye[R]=0,ye[T]=0,ye[M]=O>0?1:-1,_.push(ye.x,ye.y,ye.z),v.push(te/z),v.push(1-_e/V),W+=1}}for(let _e=0;_e<V;_e++)for(let X=0;X<z;X++){const te=y+X+ge*_e,le=y+X+ge*(_e+1),ve=y+(X+1)+ge*(_e+1),ze=y+(X+1)+ge*_e;d.push(te,le,ze),d.push(le,ve,ze),ee+=6}h.addGroup(x,ee,U),x+=ee,y+=W}}copy(e){return super.copy(e),this.parameters=Object.assign({},e.parameters),this}static fromJSON(e){return new Du(e.width,e.height,e.depth,e.widthSegments,e.heightSegments,e.depthSegments)}}function gh(s){const e={};for(const t in s){e[t]={};for(const n in s[t]){const i=s[t][n];i&&(i.isColor||i.isMatrix3||i.isMatrix4||i.isVector2||i.isVector3||i.isVector4||i.isTexture||i.isQuaternion)?i.isRenderTargetTexture?(Ut("UniformsUtils: Textures of render targets cannot be cloned via cloneUniforms() or mergeUniforms()."),e[t][n]=null):e[t][n]=i.clone():Array.isArray(i)?e[t][n]=i.slice():e[t][n]=i}}return e}function ps(s){const e={};for(let t=0;t<s.length;t++){const n=gh(s[t]);for(const i in n)e[i]=n[i]}return e}function q2(s){const e=[];for(let t=0;t<s.length;t++)e.push(s[t].clone());return e}function Lb(s){const e=s.getRenderTarget();return e===null?s.outputColorSpace:e.isXRRenderTarget===!0?e.texture.colorSpace:Bn.workingColorSpace}const Ob={clone:gh,merge:ps};var K2=`void main() {
|
|
10
10
|
gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );
|
|
11
11
|
}`,W2=`void main() {
|
|
@@ -45,7 +45,7 @@ Error generating stack: `+m.message+`
|
|
|
45
45
|
gl_FragColor = texture2D( tEquirect, sampleUV );
|
|
46
46
|
|
|
47
47
|
}
|
|
48
|
-
`},i=new Du(5,5,5),o=new ms({name:"CubemapFromEquirect",uniforms:gh(n.uniforms),vertexShader:n.vertexShader,fragmentShader:n.fragmentShader,side:fs,blending:Jr});o.uniforms.tEquirect.value=t;const l=new yi(i,o),h=t.minFilter;return t.minFilter===Is&&(t.minFilter=Cn),new Hb(1,10,this).update(e,l),t.minFilter=h,l.geometry.dispose(),l.material.dispose(),this}clear(e,t=!0,n=!0,i=!0){const o=e.getRenderTarget();for(let l=0;l<6;l++)e.setRenderTarget(this,l),e.clear(t,n,i);e.setRenderTarget(o)}}class vr extends Un{constructor(){super(),this.isGroup=!0,this.type="Group"}}const j2={type:"move"};class J0{constructor(){this._targetRay=null,this._grip=null,this._hand=null}getHandSpace(){return this._hand===null&&(this._hand=new vr,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 vr,this._targetRay.matrixAutoUpdate=!1,this._targetRay.visible=!1,this._targetRay.hasLinearVelocity=!1,this._targetRay.linearVelocity=new Z,this._targetRay.hasAngularVelocity=!1,this._targetRay.angularVelocity=new Z),this._targetRay}getGripSpace(){return this._grip===null&&(this._grip=new vr,this._grip.matrixAutoUpdate=!1,this._grip.visible=!1,this._grip.hasLinearVelocity=!1,this._grip.linearVelocity=new Z,this._grip.hasAngularVelocity=!1,this._grip.angularVelocity=new Z),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 n of e.hand.values())this._getHandJoint(t,n)}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,n){let i=null,o=null,l=null;const h=this._targetRay,d=this._grip,p=this._hand;if(e&&t.session.visibilityState!=="visible-blurred"){if(p&&e.hand){l=!0;for(const R of e.hand.values()){const T=t.getJointPose(R,n),M=this._getHandJoint(p,R);T!==null&&(M.matrix.fromArray(T.transform.matrix),M.matrix.decompose(M.position,M.rotation,M.scale),M.matrixWorldNeedsUpdate=!0,M.jointRadius=T.radius),M.visible=T!==null}const _=p.joints["index-finger-tip"],v=p.joints["thumb-tip"],y=_.position.distanceTo(v.position),x=.02,b=.005;p.inputState.pinching&&y>x+b?(p.inputState.pinching=!1,this.dispatchEvent({type:"pinchend",handedness:e.handedness,target:this})):!p.inputState.pinching&&y<=x-b&&(p.inputState.pinching=!0,this.dispatchEvent({type:"pinchstart",handedness:e.handedness,target:this}))}else d!==null&&e.gripSpace&&(o=t.getPose(e.gripSpace,n),o!==null&&(d.matrix.fromArray(o.transform.matrix),d.matrix.decompose(d.position,d.rotation,d.scale),d.matrixWorldNeedsUpdate=!0,o.linearVelocity?(d.hasLinearVelocity=!0,d.linearVelocity.copy(o.linearVelocity)):d.hasLinearVelocity=!1,o.angularVelocity?(d.hasAngularVelocity=!0,d.angularVelocity.copy(o.angularVelocity)):d.hasAngularVelocity=!1));h!==null&&(i=t.getPose(e.targetRaySpace,n),i===null&&o!==null&&(i=o),i!==null&&(h.matrix.fromArray(i.transform.matrix),h.matrix.decompose(h.position,h.rotation,h.scale),h.matrixWorldNeedsUpdate=!0,i.linearVelocity?(h.hasLinearVelocity=!0,h.linearVelocity.copy(i.linearVelocity)):h.hasLinearVelocity=!1,i.angularVelocity?(h.hasAngularVelocity=!0,h.angularVelocity.copy(i.angularVelocity)):h.hasAngularVelocity=!1,this.dispatchEvent(j2)))}return h!==null&&(h.visible=i!==null),d!==null&&(d.visible=o!==null),p!==null&&(p.visible=l!==null),this}_getHandJoint(e,t){if(e.joints[t.jointName]===void 0){const n=new vr;n.matrixAutoUpdate=!1,n.visible=!1,e.joints[t.jointName]=n,e.add(n)}return e.joints[t.jointName]}}class q0{constructor(e,t=25e-5){this.isFogExp2=!0,this.name="",this.color=new Ct(e),this.density=t}clone(){return new q0(this.color,this.density)}toJSON(){return{type:"FogExp2",name:this.name,color:this.color.getHex(),density:this.density}}}class K0{constructor(e,t=1,n=1e3){this.isFog=!0,this.name="",this.color=new Ct(e),this.near=t,this.far=n}clone(){return new K0(this.color,this.near,this.far)}toJSON(){return{type:"Fog",name:this.name,color:this.color.getHex(),near:this.near,far:this.far}}}class Mp extends Un{constructor(){super(),this.isScene=!0,this.type="Scene",this.background=null,this.environment=null,this.fog=null,this.backgroundBlurriness=0,this.backgroundIntensity=1,this.backgroundRotation=new er,this.environmentIntensity=1,this.environmentRotation=new er,this.overrideMaterial=null,typeof __THREE_DEVTOOLS__<"u"&&__THREE_DEVTOOLS__.dispatchEvent(new CustomEvent("observe",{detail:this}))}copy(e,t){return super.copy(e,t),e.background!==null&&(this.background=e.background.clone()),e.environment!==null&&(this.environment=e.environment.clone()),e.fog!==null&&(this.fog=e.fog.clone()),this.backgroundBlurriness=e.backgroundBlurriness,this.backgroundIntensity=e.backgroundIntensity,this.backgroundRotation.copy(e.backgroundRotation),this.environmentIntensity=e.environmentIntensity,this.environmentRotation.copy(e.environmentRotation),e.overrideMaterial!==null&&(this.overrideMaterial=e.overrideMaterial.clone()),this.matrixAutoUpdate=e.matrixAutoUpdate,this}toJSON(e){const t=super.toJSON(e);return this.fog!==null&&(t.object.fog=this.fog.toJSON()),this.backgroundBlurriness>0&&(t.object.backgroundBlurriness=this.backgroundBlurriness),this.backgroundIntensity!==1&&(t.object.backgroundIntensity=this.backgroundIntensity),t.object.backgroundRotation=this.backgroundRotation.toArray(),this.environmentIntensity!==1&&(t.object.environmentIntensity=this.environmentIntensity),t.object.environmentRotation=this.environmentRotation.toArray(),t}}class yh{constructor(e,t){this.isInterleavedBuffer=!0,this.array=e,this.stride=t,this.count=e!==void 0?e.length/t:0,this.usage=dp,this.updateRanges=[],this.version=0,this.uuid=Qs()}onUploadCallback(){}set needsUpdate(e){e===!0&&this.version++}setUsage(e){return this.usage=e,this}addUpdateRange(e,t){this.updateRanges.push({start:e,count:t})}clearUpdateRanges(){this.updateRanges.length=0}copy(e){return this.array=new e.array.constructor(e.array),this.count=e.count,this.stride=e.stride,this.usage=e.usage,this}copyAt(e,t,n){e*=this.stride,n*=t.stride;for(let i=0,o=this.stride;i<o;i++)this.array[e+i]=t.array[n+i];return this}set(e,t=0){return this.array.set(e,t),this}clone(e){e.arrayBuffers===void 0&&(e.arrayBuffers={}),this.array.buffer._uuid===void 0&&(this.array.buffer._uuid=Qs()),e.arrayBuffers[this.array.buffer._uuid]===void 0&&(e.arrayBuffers[this.array.buffer._uuid]=this.array.slice(0).buffer);const t=new this.array.constructor(e.arrayBuffers[this.array.buffer._uuid]),n=new this.constructor(t,this.stride);return n.setUsage(this.usage),n}onUpload(e){return this.onUploadCallback=e,this}toJSON(e){return e.arrayBuffers===void 0&&(e.arrayBuffers={}),this.array.buffer._uuid===void 0&&(this.array.buffer._uuid=Qs()),e.arrayBuffers[this.array.buffer._uuid]===void 0&&(e.arrayBuffers[this.array.buffer._uuid]=Array.from(new Uint32Array(this.array.buffer))),{uuid:this.uuid,buffer:this.array.buffer._uuid,type:this.array.constructor.name,stride:this.stride}}}const gs=new Z;class Al{constructor(e,t,n,i=!1){this.isInterleavedBufferAttribute=!0,this.name="",this.data=e,this.itemSize=t,this.offset=n,this.normalized=i}get count(){return this.data.count}get array(){return this.data.array}set needsUpdate(e){this.data.needsUpdate=e}applyMatrix4(e){for(let t=0,n=this.data.count;t<n;t++)gs.fromBufferAttribute(this,t),gs.applyMatrix4(e),this.setXYZ(t,gs.x,gs.y,gs.z);return this}applyNormalMatrix(e){for(let t=0,n=this.count;t<n;t++)gs.fromBufferAttribute(this,t),gs.applyNormalMatrix(e),this.setXYZ(t,gs.x,gs.y,gs.z);return this}transformDirection(e){for(let t=0,n=this.count;t<n;t++)gs.fromBufferAttribute(this,t),gs.transformDirection(e),this.setXYZ(t,gs.x,gs.y,gs.z);return this}getComponent(e,t){let n=this.array[e*this.data.stride+this.offset+t];return this.normalized&&(n=hs(n,this.array)),n}setComponent(e,t,n){return this.normalized&&(n=Sn(n,this.array)),this.data.array[e*this.data.stride+this.offset+t]=n,this}setX(e,t){return this.normalized&&(t=Sn(t,this.array)),this.data.array[e*this.data.stride+this.offset]=t,this}setY(e,t){return this.normalized&&(t=Sn(t,this.array)),this.data.array[e*this.data.stride+this.offset+1]=t,this}setZ(e,t){return this.normalized&&(t=Sn(t,this.array)),this.data.array[e*this.data.stride+this.offset+2]=t,this}setW(e,t){return this.normalized&&(t=Sn(t,this.array)),this.data.array[e*this.data.stride+this.offset+3]=t,this}getX(e){let t=this.data.array[e*this.data.stride+this.offset];return this.normalized&&(t=hs(t,this.array)),t}getY(e){let t=this.data.array[e*this.data.stride+this.offset+1];return this.normalized&&(t=hs(t,this.array)),t}getZ(e){let t=this.data.array[e*this.data.stride+this.offset+2];return this.normalized&&(t=hs(t,this.array)),t}getW(e){let t=this.data.array[e*this.data.stride+this.offset+3];return this.normalized&&(t=hs(t,this.array)),t}setXY(e,t,n){return e=e*this.data.stride+this.offset,this.normalized&&(t=Sn(t,this.array),n=Sn(n,this.array)),this.data.array[e+0]=t,this.data.array[e+1]=n,this}setXYZ(e,t,n,i){return e=e*this.data.stride+this.offset,this.normalized&&(t=Sn(t,this.array),n=Sn(n,this.array),i=Sn(i,this.array)),this.data.array[e+0]=t,this.data.array[e+1]=n,this.data.array[e+2]=i,this}setXYZW(e,t,n,i,o){return e=e*this.data.stride+this.offset,this.normalized&&(t=Sn(t,this.array),n=Sn(n,this.array),i=Sn(i,this.array),o=Sn(o,this.array)),this.data.array[e+0]=t,this.data.array[e+1]=n,this.data.array[e+2]=i,this.data.array[e+3]=o,this}clone(e){if(e===void 0){mp("InterleavedBufferAttribute.clone(): Cloning an interleaved buffer attribute will de-interleave buffer data.");const t=[];for(let n=0;n<this.count;n++){const i=n*this.data.stride+this.offset;for(let o=0;o<this.itemSize;o++)t.push(this.data.array[i+o])}return new Hn(new this.array.constructor(t),this.itemSize,this.normalized)}else return e.interleavedBuffers===void 0&&(e.interleavedBuffers={}),e.interleavedBuffers[this.data.uuid]===void 0&&(e.interleavedBuffers[this.data.uuid]=this.data.clone(e)),new Al(e.interleavedBuffers[this.data.uuid],this.itemSize,this.offset,this.normalized)}toJSON(e){if(e===void 0){mp("InterleavedBufferAttribute.toJSON(): Serializing an interleaved buffer attribute will de-interleave buffer data.");const t=[];for(let n=0;n<this.count;n++){const i=n*this.data.stride+this.offset;for(let o=0;o<this.itemSize;o++)t.push(this.data.array[i+o])}return{itemSize:this.itemSize,type:this.array.constructor.name,array:t,normalized:this.normalized}}else return e.interleavedBuffers===void 0&&(e.interleavedBuffers={}),e.interleavedBuffers[this.data.uuid]===void 0&&(e.interleavedBuffers[this.data.uuid]=this.data.toJSON(e)),{isInterleavedBufferAttribute:!0,itemSize:this.itemSize,data:this.data.uuid,offset:this.offset,normalized:this.normalized}}}class Lx extends Yi{constructor(e){super(),this.isSpriteMaterial=!0,this.type="SpriteMaterial",this.color=new Ct(16777215),this.map=null,this.alphaMap=null,this.rotation=0,this.sizeAttenuation=!0,this.transparent=!0,this.fog=!0,this.setValues(e)}copy(e){return super.copy(e),this.color.copy(e.color),this.map=e.map,this.alphaMap=e.alphaMap,this.rotation=e.rotation,this.sizeAttenuation=e.sizeAttenuation,this.fog=e.fog,this}}let xh;const bp=new Z,Ah=new Z,Sh=new Z,Mh=new nt,Ep=new nt,Pb=new en,W0=new Z,Tp=new Z,j0=new Z,Gb=new nt,Ox=new nt,zb=new nt;class Vb extends Un{constructor(e=new Lx){if(super(),this.isSprite=!0,this.type="Sprite",xh===void 0){xh=new pn;const t=new Float32Array([-.5,-.5,0,0,0,.5,-.5,0,1,0,.5,.5,0,1,1,-.5,.5,0,0,1]),n=new yh(t,5);xh.setIndex([0,1,2,0,2,3]),xh.setAttribute("position",new Al(n,3,0,!1)),xh.setAttribute("uv",new Al(n,2,3,!1))}this.geometry=xh,this.material=e,this.center=new nt(.5,.5),this.count=1}raycast(e,t){e.camera===null&&Zt('Sprite: "Raycaster.camera" needs to be set in order to raycast against sprites.'),Ah.setFromMatrixScale(this.matrixWorld),Pb.copy(e.camera.matrixWorld),this.modelViewMatrix.multiplyMatrices(e.camera.matrixWorldInverse,this.matrixWorld),Sh.setFromMatrixPosition(this.modelViewMatrix),e.camera.isPerspectiveCamera&&this.material.sizeAttenuation===!1&&Ah.multiplyScalar(-Sh.z);const n=this.material.rotation;let i,o;n!==0&&(o=Math.cos(n),i=Math.sin(n));const l=this.center;Z0(W0.set(-.5,-.5,0),Sh,l,Ah,i,o),Z0(Tp.set(.5,-.5,0),Sh,l,Ah,i,o),Z0(j0.set(.5,.5,0),Sh,l,Ah,i,o),Gb.set(0,0),Ox.set(1,0),zb.set(1,1);let h=e.ray.intersectTriangle(W0,Tp,j0,!1,bp);if(h===null&&(Z0(Tp.set(-.5,.5,0),Sh,l,Ah,i,o),Ox.set(0,1),h=e.ray.intersectTriangle(W0,j0,Tp,!1,bp),h===null))return;const d=e.ray.origin.distanceTo(bp);d<e.near||d>e.far||t.push({distance:d,point:bp.clone(),uv:Fs.getInterpolation(bp,W0,Tp,j0,Gb,Ox,zb,new nt),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 Z0(s,e,t,n,i,o){Mh.subVectors(s,t).addScalar(.5).multiply(n),i!==void 0?(Ep.x=o*Mh.x-i*Mh.y,Ep.y=i*Mh.x+o*Mh.y):Ep.copy(Mh),s.copy(e),s.x+=Ep.x,s.y+=Ep.y,s.applyMatrix4(Pb)}const Q0=new Z,kb=new Z;class Xb extends Un{constructor(){super(),this.isLOD=!0,this._currentLevel=0,this.type="LOD",Object.defineProperties(this,{levels:{enumerable:!0,value:[]}}),this.autoUpdate=!0}copy(e){super.copy(e,!1);const t=e.levels;for(let n=0,i=t.length;n<i;n++){const o=t[n];this.addLevel(o.object.clone(),o.distance,o.hysteresis)}return this.autoUpdate=e.autoUpdate,this}addLevel(e,t=0,n=0){t=Math.abs(t);const i=this.levels;let o;for(o=0;o<i.length&&!(t<i[o].distance);o++);return i.splice(o,0,{distance:t,hysteresis:n,object:e}),this.add(e),this}removeLevel(e){const t=this.levels;for(let n=0;n<t.length;n++)if(t[n].distance===e){const i=t.splice(n,1);return this.remove(i[0].object),!0}return!1}getCurrentLevel(){return this._currentLevel}getObjectForDistance(e){const t=this.levels;if(t.length>0){let n,i;for(n=1,i=t.length;n<i;n++){let o=t[n].distance;if(t[n].object.visible&&(o-=o*t[n].hysteresis),e<o)break}return t[n-1].object}return null}raycast(e,t){if(this.levels.length>0){Q0.setFromMatrixPosition(this.matrixWorld);const i=e.ray.origin.distanceTo(Q0);this.getObjectForDistance(i).raycast(e,t)}}update(e){const t=this.levels;if(t.length>1){Q0.setFromMatrixPosition(e.matrixWorld),kb.setFromMatrixPosition(this.matrixWorld);const n=Q0.distanceTo(kb)/e.zoom;t[0].object.visible=!0;let i,o;for(i=1,o=t.length;i<o;i++){let l=t[i].distance;if(t[i].object.visible&&(l-=l*t[i].hysteresis),n>=l)t[i-1].object.visible=!1,t[i].object.visible=!0;else break}for(this._currentLevel=i-1;i<o;i++)t[i].object.visible=!1}}toJSON(e){const t=super.toJSON(e);this.autoUpdate===!1&&(t.object.autoUpdate=!1),t.object.levels=[];const n=this.levels;for(let i=0,o=n.length;i<o;i++){const l=n[i];t.object.levels.push({object:l.object.uuid,distance:l.distance,hysteresis:l.hysteresis})}return t}}const Yb=new Z,Jb=new pi,qb=new pi,Z2=new Z,Kb=new en,$0=new Z,Ix=new fa,Wb=new en,Fx=new lh;class ev extends yi{constructor(e,t){super(e,t),this.isSkinnedMesh=!0,this.type="SkinnedMesh",this.bindMode=ex,this.bindMatrix=new en,this.bindMatrixInverse=new en,this.boundingBox=null,this.boundingSphere=null}computeBoundingBox(){const e=this.geometry;this.boundingBox===null&&(this.boundingBox=new Ra),this.boundingBox.makeEmpty();const t=e.getAttribute("position");for(let n=0;n<t.count;n++)this.getVertexPosition(n,$0),this.boundingBox.expandByPoint($0)}computeBoundingSphere(){const e=this.geometry;this.boundingSphere===null&&(this.boundingSphere=new fa),this.boundingSphere.makeEmpty();const t=e.getAttribute("position");for(let n=0;n<t.count;n++)this.getVertexPosition(n,$0),this.boundingSphere.expandByPoint($0)}copy(e,t){return super.copy(e,t),this.bindMode=e.bindMode,this.bindMatrix.copy(e.bindMatrix),this.bindMatrixInverse.copy(e.bindMatrixInverse),this.skeleton=e.skeleton,e.boundingBox!==null&&(this.boundingBox=e.boundingBox.clone()),e.boundingSphere!==null&&(this.boundingSphere=e.boundingSphere.clone()),this}raycast(e,t){const n=this.material,i=this.matrixWorld;n!==void 0&&(this.boundingSphere===null&&this.computeBoundingSphere(),Ix.copy(this.boundingSphere),Ix.applyMatrix4(i),e.ray.intersectsSphere(Ix)!==!1&&(Wb.copy(i).invert(),Fx.copy(e.ray).applyMatrix4(Wb),!(this.boundingBox!==null&&Fx.intersectsBox(this.boundingBox)===!1)&&this._computeIntersections(e,t,Fx)))}getVertexPosition(e,t){return super.getVertexPosition(e,t),this.applyBoneTransform(e,t),t}bind(e,t){this.skeleton=e,t===void 0&&(this.updateMatrixWorld(!0),this.skeleton.calculateInverses(),t=this.matrixWorld),this.bindMatrix.copy(t),this.bindMatrixInverse.copy(t).invert()}pose(){this.skeleton.pose()}normalizeSkinWeights(){const e=new pi,t=this.geometry.attributes.skinWeight;for(let n=0,i=t.count;n<i;n++){e.fromBufferAttribute(t,n);const o=1/e.manhattanLength();o!==1/0?e.multiplyScalar(o):e.set(1,0,0,0),t.setXYZW(n,e.x,e.y,e.z,e.w)}}updateMatrixWorld(e){super.updateMatrixWorld(e),this.bindMode===ex?this.bindMatrixInverse.copy(this.matrixWorld).invert():this.bindMode===nb?this.bindMatrixInverse.copy(this.bindMatrix).invert():Ut("SkinnedMesh: Unrecognized bindMode: "+this.bindMode)}applyBoneTransform(e,t){const n=this.skeleton,i=this.geometry;Jb.fromBufferAttribute(i.attributes.skinIndex,e),qb.fromBufferAttribute(i.attributes.skinWeight,e),Yb.copy(t).applyMatrix4(this.bindMatrix),t.set(0,0,0);for(let o=0;o<4;o++){const l=qb.getComponent(o);if(l!==0){const h=Jb.getComponent(o);Kb.multiplyMatrices(n.bones[h].matrixWorld,n.boneInverses[h]),t.addScaledVector(Z2.copy(Yb).applyMatrix4(Kb),l)}}return t.applyMatrix4(this.bindMatrixInverse)}}class Cp extends Un{constructor(){super(),this.isBone=!0,this.type="Bone"}}class _r extends Qn{constructor(e=null,t=1,n=1,i,o,l,h,d,p=Ti,_=Ti,v,y){super(null,l,h,d,p,_,i,o,v,y),this.isDataTexture=!0,this.image={data:e,width:t,height:n},this.generateMipmaps=!1,this.flipY=!1,this.unpackAlignment=1}}const jb=new en,Q2=new en;class bh{constructor(e=[],t=[]){this.uuid=Qs(),this.bones=e.slice(0),this.boneInverses=t,this.boneMatrices=null,this.previousBoneMatrices=null,this.boneTexture=null,this.init()}init(){const e=this.bones,t=this.boneInverses;if(this.boneMatrices=new Float32Array(e.length*16),t.length===0)this.calculateInverses();else if(e.length!==t.length){Ut("Skeleton: Number of inverse bone matrices does not match amount of bones."),this.boneInverses=[];for(let n=0,i=this.bones.length;n<i;n++)this.boneInverses.push(new en)}}calculateInverses(){this.boneInverses.length=0;for(let e=0,t=this.bones.length;e<t;e++){const n=new en;this.bones[e]&&n.copy(this.bones[e].matrixWorld).invert(),this.boneInverses.push(n)}}pose(){for(let e=0,t=this.bones.length;e<t;e++){const n=this.bones[e];n&&n.matrixWorld.copy(this.boneInverses[e]).invert()}for(let e=0,t=this.bones.length;e<t;e++){const n=this.bones[e];n&&(n.parent&&n.parent.isBone?(n.matrix.copy(n.parent.matrixWorld).invert(),n.matrix.multiply(n.matrixWorld)):n.matrix.copy(n.matrixWorld),n.matrix.decompose(n.position,n.quaternion,n.scale))}}update(){const e=this.bones,t=this.boneInverses,n=this.boneMatrices,i=this.boneTexture;for(let o=0,l=e.length;o<l;o++){const h=e[o]?e[o].matrixWorld:Q2;jb.multiplyMatrices(h,t[o]),jb.toArray(n,o*16)}i!==null&&(i.needsUpdate=!0)}clone(){return new bh(this.bones,this.boneInverses)}computeBoneTexture(){let e=Math.sqrt(this.bones.length*4);e=Math.ceil(e/4)*4,e=Math.max(e,4);const t=new Float32Array(e*e*4);t.set(this.boneMatrices);const n=new _r(t,e,e,Zi,Ci);return n.needsUpdate=!0,this.boneMatrices=t,this.boneTexture=n,this}getBoneByName(e){for(let t=0,n=this.bones.length;t<n;t++){const i=this.bones[t];if(i.name===e)return i}}dispose(){this.boneTexture!==null&&(this.boneTexture.dispose(),this.boneTexture=null)}fromJSON(e,t){this.uuid=e.uuid;for(let n=0,i=e.bones.length;n<i;n++){const o=e.bones[n];let l=t[o];l===void 0&&(Ut("Skeleton: No bone found with UUID:",o),l=new Cp),this.bones.push(l),this.boneInverses.push(new en().fromArray(e.boneInverses[n]))}return this.init(),this}toJSON(){const e={metadata:{version:4.7,type:"Skeleton",generator:"Skeleton.toJSON"},bones:[],boneInverses:[]};e.uuid=this.uuid;const t=this.bones,n=this.boneInverses;for(let i=0,o=t.length;i<o;i++){const l=t[i];e.bones.push(l.uuid);const h=n[i];e.boneInverses.push(h.toArray())}return e}}class xc extends Hn{constructor(e,t,n,i=1){super(e,t,n),this.isInstancedBufferAttribute=!0,this.meshPerAttribute=i}copy(e){return super.copy(e),this.meshPerAttribute=e.meshPerAttribute,this}toJSON(){const e=super.toJSON();return e.meshPerAttribute=this.meshPerAttribute,e.isInstancedBufferAttribute=!0,e}}const Eh=new en,Zb=new en,tv=[],Qb=new Ra,$2=new en,Rp=new yi,wp=new fa;class nv extends yi{constructor(e,t,n){super(e,t),this.isInstancedMesh=!0,this.instanceMatrix=new xc(new Float32Array(n*16),16),this.instanceColor=null,this.morphTexture=null,this.count=n,this.boundingBox=null,this.boundingSphere=null;for(let i=0;i<n;i++)this.setMatrixAt(i,$2)}computeBoundingBox(){const e=this.geometry,t=this.count;this.boundingBox===null&&(this.boundingBox=new Ra),e.boundingBox===null&&e.computeBoundingBox(),this.boundingBox.makeEmpty();for(let n=0;n<t;n++)this.getMatrixAt(n,Eh),Qb.copy(e.boundingBox).applyMatrix4(Eh),this.boundingBox.union(Qb)}computeBoundingSphere(){const e=this.geometry,t=this.count;this.boundingSphere===null&&(this.boundingSphere=new fa),e.boundingSphere===null&&e.computeBoundingSphere(),this.boundingSphere.makeEmpty();for(let n=0;n<t;n++)this.getMatrixAt(n,Eh),wp.copy(e.boundingSphere).applyMatrix4(Eh),this.boundingSphere.union(wp)}copy(e,t){return super.copy(e,t),this.instanceMatrix.copy(e.instanceMatrix),e.morphTexture!==null&&(this.morphTexture=e.morphTexture.clone()),e.instanceColor!==null&&(this.instanceColor=e.instanceColor.clone()),this.count=e.count,e.boundingBox!==null&&(this.boundingBox=e.boundingBox.clone()),e.boundingSphere!==null&&(this.boundingSphere=e.boundingSphere.clone()),this}getColorAt(e,t){t.fromArray(this.instanceColor.array,e*3)}getMatrixAt(e,t){t.fromArray(this.instanceMatrix.array,e*16)}getMorphAt(e,t){const n=t.morphTargetInfluences,i=this.morphTexture.source.data.data,o=n.length+1,l=e*o+1;for(let h=0;h<n.length;h++)n[h]=i[l+h]}raycast(e,t){const n=this.matrixWorld,i=this.count;if(Rp.geometry=this.geometry,Rp.material=this.material,Rp.material!==void 0&&(this.boundingSphere===null&&this.computeBoundingSphere(),wp.copy(this.boundingSphere),wp.applyMatrix4(n),e.ray.intersectsSphere(wp)!==!1))for(let o=0;o<i;o++){this.getMatrixAt(o,Eh),Zb.multiplyMatrices(n,Eh),Rp.matrixWorld=Zb,Rp.raycast(e,tv);for(let l=0,h=tv.length;l<h;l++){const d=tv[l];d.instanceId=o,d.object=this,t.push(d)}tv.length=0}}setColorAt(e,t){this.instanceColor===null&&(this.instanceColor=new xc(new Float32Array(this.instanceMatrix.count*3).fill(1),3)),t.toArray(this.instanceColor.array,e*3)}setMatrixAt(e,t){t.toArray(this.instanceMatrix.array,e*16)}setMorphAt(e,t){const n=t.morphTargetInfluences,i=n.length+1;this.morphTexture===null&&(this.morphTexture=new _r(new Float32Array(i*this.count),i,this.count,ip,Ci));const o=this.morphTexture.source.data.data;let l=0;for(let p=0;p<n.length;p++)l+=n[p];const h=this.geometry.morphTargetsRelative?1:1-l,d=i*e;o[d]=h,o.set(n,d+1)}updateMorphTargets(){}dispose(){this.dispatchEvent({type:"dispose"}),this.morphTexture!==null&&(this.morphTexture.dispose(),this.morphTexture=null)}}const Hx=new Z,ew=new Z,tw=new yn;class Ac{constructor(e=new Z(1,0,0),t=0){this.isPlane=!0,this.normal=e,this.constant=t}set(e,t){return this.normal.copy(e),this.constant=t,this}setComponents(e,t,n,i){return this.normal.set(e,t,n),this.constant=i,this}setFromNormalAndCoplanarPoint(e,t){return this.normal.copy(e),this.constant=-t.dot(this.normal),this}setFromCoplanarPoints(e,t,n){const i=Hx.subVectors(n,t).cross(ew.subVectors(e,t)).normalize();return this.setFromNormalAndCoplanarPoint(i,e),this}copy(e){return this.normal.copy(e.normal),this.constant=e.constant,this}normalize(){const e=1/this.normal.length();return this.normal.multiplyScalar(e),this.constant*=e,this}negate(){return this.constant*=-1,this.normal.negate(),this}distanceToPoint(e){return this.normal.dot(e)+this.constant}distanceToSphere(e){return this.distanceToPoint(e.center)-e.radius}projectPoint(e,t){return t.copy(e).addScaledVector(this.normal,-this.distanceToPoint(e))}intersectLine(e,t){const n=e.delta(Hx),i=this.normal.dot(n);if(i===0)return this.distanceToPoint(e.start)===0?t.copy(e.start):null;const o=-(e.start.dot(this.normal)+this.constant)/i;return o<0||o>1?null:t.copy(e.start).addScaledVector(n,o)}intersectsLine(e){const t=this.distanceToPoint(e.start),n=this.distanceToPoint(e.end);return t<0&&n>0||n<0&&t>0}intersectsBox(e){return e.intersectsPlane(this)}intersectsSphere(e){return e.intersectsPlane(this)}coplanarPoint(e){return e.copy(this.normal).multiplyScalar(-this.constant)}applyMatrix4(e,t){const n=t||tw.getNormalMatrix(e),i=this.coplanarPoint(Hx).applyMatrix4(e),o=this.normal.applyMatrix3(n).normalize();return this.constant=-i.dot(o),this}translate(e){return this.constant-=e.dot(this.normal),this}equals(e){return e.normal.equals(this.normal)&&e.constant===this.constant}clone(){return new this.constructor().copy(this)}}const Nu=new fa,nw=new nt(.5,.5),iv=new Z;class Th{constructor(e=new Ac,t=new Ac,n=new Ac,i=new Ac,o=new Ac,l=new Ac){this.planes=[e,t,n,i,o,l]}set(e,t,n,i,o,l){const h=this.planes;return h[0].copy(e),h[1].copy(t),h[2].copy(n),h[3].copy(i),h[4].copy(o),h[5].copy(l),this}copy(e){const t=this.planes;for(let n=0;n<6;n++)t[n].copy(e.planes[n]);return this}setFromProjectionMatrix(e,t=Zs,n=!1){const i=this.planes,o=e.elements,l=o[0],h=o[1],d=o[2],p=o[3],_=o[4],v=o[5],y=o[6],x=o[7],b=o[8],R=o[9],T=o[10],M=o[11],w=o[12],D=o[13],N=o[14],H=o[15];if(i[0].setComponents(p-l,x-_,M-b,H-w).normalize(),i[1].setComponents(p+l,x+_,M+b,H+w).normalize(),i[2].setComponents(p+h,x+v,M+R,H+D).normalize(),i[3].setComponents(p-h,x-v,M-R,H-D).normalize(),n)i[4].setComponents(d,y,T,N).normalize(),i[5].setComponents(p-d,x-y,M-T,H-N).normalize();else if(i[4].setComponents(p-d,x-y,M-T,H-N).normalize(),t===Zs)i[5].setComponents(p+d,x+y,M+T,H+N).normalize();else if(t===$f)i[5].setComponents(d,y,T,N).normalize();else throw new Error("THREE.Frustum.setFromProjectionMatrix(): Invalid coordinate system: "+t);return this}intersectsObject(e){if(e.boundingSphere!==void 0)e.boundingSphere===null&&e.computeBoundingSphere(),Nu.copy(e.boundingSphere).applyMatrix4(e.matrixWorld);else{const t=e.geometry;t.boundingSphere===null&&t.computeBoundingSphere(),Nu.copy(t.boundingSphere).applyMatrix4(e.matrixWorld)}return this.intersectsSphere(Nu)}intersectsSprite(e){Nu.center.set(0,0,0);const t=nw.distanceTo(e.center);return Nu.radius=.7071067811865476+t,Nu.applyMatrix4(e.matrixWorld),this.intersectsSphere(Nu)}intersectsSphere(e){const t=this.planes,n=e.center,i=-e.radius;for(let o=0;o<6;o++)if(t[o].distanceToPoint(n)<i)return!1;return!0}intersectsBox(e){const t=this.planes;for(let n=0;n<6;n++){const i=t[n];if(iv.x=i.normal.x>0?e.max.x:e.min.x,iv.y=i.normal.y>0?e.max.y:e.min.y,iv.z=i.normal.z>0?e.max.z:e.min.z,i.distanceToPoint(iv)<0)return!1}return!0}containsPoint(e){const t=this.planes;for(let n=0;n<6;n++)if(t[n].distanceToPoint(e)<0)return!1;return!0}clone(){return new this.constructor().copy(this)}}const Co=new en,Ro=new Th;class av{constructor(){this.coordinateSystem=Zs}intersectsObject(e,t){if(!t.isArrayCamera||t.cameras.length===0)return!1;for(let n=0;n<t.cameras.length;n++){const i=t.cameras[n];if(Co.multiplyMatrices(i.projectionMatrix,i.matrixWorldInverse),Ro.setFromProjectionMatrix(Co,i.coordinateSystem,i.reversedDepth),Ro.intersectsObject(e))return!0}return!1}intersectsSprite(e,t){if(!t||!t.cameras||t.cameras.length===0)return!1;for(let n=0;n<t.cameras.length;n++){const i=t.cameras[n];if(Co.multiplyMatrices(i.projectionMatrix,i.matrixWorldInverse),Ro.setFromProjectionMatrix(Co,i.coordinateSystem,i.reversedDepth),Ro.intersectsSprite(e))return!0}return!1}intersectsSphere(e,t){if(!t||!t.cameras||t.cameras.length===0)return!1;for(let n=0;n<t.cameras.length;n++){const i=t.cameras[n];if(Co.multiplyMatrices(i.projectionMatrix,i.matrixWorldInverse),Ro.setFromProjectionMatrix(Co,i.coordinateSystem,i.reversedDepth),Ro.intersectsSphere(e))return!0}return!1}intersectsBox(e,t){if(!t||!t.cameras||t.cameras.length===0)return!1;for(let n=0;n<t.cameras.length;n++){const i=t.cameras[n];if(Co.multiplyMatrices(i.projectionMatrix,i.matrixWorldInverse),Ro.setFromProjectionMatrix(Co,i.coordinateSystem,i.reversedDepth),Ro.intersectsBox(e))return!0}return!1}containsPoint(e,t){if(!t||!t.cameras||t.cameras.length===0)return!1;for(let n=0;n<t.cameras.length;n++){const i=t.cameras[n];if(Co.multiplyMatrices(i.projectionMatrix,i.matrixWorldInverse),Ro.setFromProjectionMatrix(Co,i.coordinateSystem,i.reversedDepth),Ro.containsPoint(e))return!0}return!1}clone(){return new av}}function Px(s,e){return s-e}function iw(s,e){return s.z-e.z}function aw(s,e){return e.z-s.z}class sw{constructor(){this.index=0,this.pool=[],this.list=[]}push(e,t,n,i){const o=this.pool,l=this.list;this.index>=o.length&&o.push({start:-1,count:-1,z:-1,index:-1});const h=o[this.index];l.push(h),this.index++,h.start=e,h.count=t,h.z=n,h.index=i}reset(){this.list.length=0,this.index=0}}const Ps=new en,rw=new Ct(1,1,1),$b=new Th,ow=new av,sv=new Ra,Uu=new fa,Bp=new Z,e1=new Z,lw=new Z,Gx=new sw,$a=new yi,rv=[];function cw(s,e,t=0){const n=e.itemSize;if(s.isInterleavedBufferAttribute||s.array.constructor!==e.array.constructor){const i=s.count;for(let o=0;o<i;o++)for(let l=0;l<n;l++)e.setComponent(o+t,l,s.getComponent(o,l))}else e.array.set(s.array,t*n);e.needsUpdate=!0}function Lu(s,e){if(s.constructor!==e.constructor){const t=Math.min(s.length,e.length);for(let n=0;n<t;n++)e[n]=s[n]}else{const t=Math.min(s.length,e.length);e.set(new s.constructor(s.buffer,0,t))}}class t1 extends yi{constructor(e,t,n=t*2,i){super(new pn,i),this.isBatchedMesh=!0,this.perObjectFrustumCulled=!0,this.sortObjects=!0,this.boundingBox=null,this.boundingSphere=null,this.customSort=null,this._instanceInfo=[],this._geometryInfo=[],this._availableInstanceIds=[],this._availableGeometryIds=[],this._nextIndexStart=0,this._nextVertexStart=0,this._geometryCount=0,this._visibilityChanged=!0,this._geometryInitialized=!1,this._maxInstanceCount=e,this._maxVertexCount=t,this._maxIndexCount=n,this._multiDrawCounts=new Int32Array(e),this._multiDrawStarts=new Int32Array(e),this._multiDrawCount=0,this._multiDrawInstances=null,this._matricesTexture=null,this._indirectTexture=null,this._colorsTexture=null,this._initMatricesTexture(),this._initIndirectTexture()}get maxInstanceCount(){return this._maxInstanceCount}get instanceCount(){return this._instanceInfo.length-this._availableInstanceIds.length}get unusedVertexCount(){return this._maxVertexCount-this._nextVertexStart}get unusedIndexCount(){return this._maxIndexCount-this._nextIndexStart}_initMatricesTexture(){let e=Math.sqrt(this._maxInstanceCount*4);e=Math.ceil(e/4)*4,e=Math.max(e,4);const t=new Float32Array(e*e*4),n=new _r(t,e,e,Zi,Ci);this._matricesTexture=n}_initIndirectTexture(){let e=Math.sqrt(this._maxInstanceCount);e=Math.ceil(e);const t=new Uint32Array(e*e),n=new _r(t,e,e,ap,js);this._indirectTexture=n}_initColorsTexture(){let e=Math.sqrt(this._maxInstanceCount);e=Math.ceil(e);const t=new Float32Array(e*e*4).fill(1),n=new _r(t,e,e,Zi,Ci);n.colorSpace=Bn.workingColorSpace,this._colorsTexture=n}_initializeGeometry(e){const t=this.geometry,n=this._maxVertexCount,i=this._maxIndexCount;if(this._geometryInitialized===!1){for(const o in e.attributes){const l=e.getAttribute(o),{array:h,itemSize:d,normalized:p}=l,_=new h.constructor(n*d),v=new Hn(_,d,p);t.setAttribute(o,v)}if(e.getIndex()!==null){const o=n>65535?new Uint32Array(i):new Uint16Array(i);t.setIndex(new Hn(o,1))}this._geometryInitialized=!0}}_validateGeometry(e){const t=this.geometry;if(!!e.getIndex()!=!!t.getIndex())throw new Error('THREE.BatchedMesh: All geometries must consistently have "index".');for(const n in t.attributes){if(!e.hasAttribute(n))throw new Error(`THREE.BatchedMesh: Added geometry missing "${n}". All geometries must have consistent attributes.`);const i=e.getAttribute(n),o=t.getAttribute(n);if(i.itemSize!==o.itemSize||i.normalized!==o.normalized)throw new Error("THREE.BatchedMesh: All attributes must have a consistent itemSize and normalized value.")}}validateInstanceId(e){const t=this._instanceInfo;if(e<0||e>=t.length||t[e].active===!1)throw new Error(`THREE.BatchedMesh: Invalid instanceId ${e}. Instance is either out of range or has been deleted.`)}validateGeometryId(e){const t=this._geometryInfo;if(e<0||e>=t.length||t[e].active===!1)throw new Error(`THREE.BatchedMesh: Invalid geometryId ${e}. Geometry is either out of range or has been deleted.`)}setCustomSort(e){return this.customSort=e,this}computeBoundingBox(){this.boundingBox===null&&(this.boundingBox=new Ra);const e=this.boundingBox,t=this._instanceInfo;e.makeEmpty();for(let n=0,i=t.length;n<i;n++){if(t[n].active===!1)continue;const o=t[n].geometryIndex;this.getMatrixAt(n,Ps),this.getBoundingBoxAt(o,sv).applyMatrix4(Ps),e.union(sv)}}computeBoundingSphere(){this.boundingSphere===null&&(this.boundingSphere=new fa);const e=this.boundingSphere,t=this._instanceInfo;e.makeEmpty();for(let n=0,i=t.length;n<i;n++){if(t[n].active===!1)continue;const o=t[n].geometryIndex;this.getMatrixAt(n,Ps),this.getBoundingSphereAt(o,Uu).applyMatrix4(Ps),e.union(Uu)}}addInstance(e){if(this._instanceInfo.length>=this.maxInstanceCount&&this._availableInstanceIds.length===0)throw new Error("THREE.BatchedMesh: Maximum item count reached.");const n={visible:!0,active:!0,geometryIndex:e};let i=null;this._availableInstanceIds.length>0?(this._availableInstanceIds.sort(Px),i=this._availableInstanceIds.shift(),this._instanceInfo[i]=n):(i=this._instanceInfo.length,this._instanceInfo.push(n));const o=this._matricesTexture;Ps.identity().toArray(o.image.data,i*16),o.needsUpdate=!0;const l=this._colorsTexture;return l&&(rw.toArray(l.image.data,i*4),l.needsUpdate=!0),this._visibilityChanged=!0,i}addGeometry(e,t=-1,n=-1){this._initializeGeometry(e),this._validateGeometry(e);const i={vertexStart:-1,vertexCount:-1,reservedVertexCount:-1,indexStart:-1,indexCount:-1,reservedIndexCount:-1,start:-1,count:-1,boundingBox:null,boundingSphere:null,active:!0},o=this._geometryInfo;i.vertexStart=this._nextVertexStart,i.reservedVertexCount=t===-1?e.getAttribute("position").count:t;const l=e.getIndex();if(l!==null&&(i.indexStart=this._nextIndexStart,i.reservedIndexCount=n===-1?l.count:n),i.indexStart!==-1&&i.indexStart+i.reservedIndexCount>this._maxIndexCount||i.vertexStart+i.reservedVertexCount>this._maxVertexCount)throw new Error("THREE.BatchedMesh: Reserved space request exceeds the maximum buffer size.");let d;return this._availableGeometryIds.length>0?(this._availableGeometryIds.sort(Px),d=this._availableGeometryIds.shift(),o[d]=i):(d=this._geometryCount,this._geometryCount++,o.push(i)),this.setGeometryAt(d,e),this._nextIndexStart=i.indexStart+i.reservedIndexCount,this._nextVertexStart=i.vertexStart+i.reservedVertexCount,d}setGeometryAt(e,t){if(e>=this._geometryCount)throw new Error("THREE.BatchedMesh: Maximum geometry count reached.");this._validateGeometry(t);const n=this.geometry,i=n.getIndex()!==null,o=n.getIndex(),l=t.getIndex(),h=this._geometryInfo[e];if(i&&l.count>h.reservedIndexCount||t.attributes.position.count>h.reservedVertexCount)throw new Error("THREE.BatchedMesh: Reserved space not large enough for provided geometry.");const d=h.vertexStart,p=h.reservedVertexCount;h.vertexCount=t.getAttribute("position").count;for(const _ in n.attributes){const v=t.getAttribute(_),y=n.getAttribute(_);cw(v,y,d);const x=v.itemSize;for(let b=v.count,R=p;b<R;b++){const T=d+b;for(let M=0;M<x;M++)y.setComponent(T,M,0)}y.needsUpdate=!0,y.addUpdateRange(d*x,p*x)}if(i){const _=h.indexStart,v=h.reservedIndexCount;h.indexCount=t.getIndex().count;for(let y=0;y<l.count;y++)o.setX(_+y,d+l.getX(y));for(let y=l.count,x=v;y<x;y++)o.setX(_+y,d);o.needsUpdate=!0,o.addUpdateRange(_,h.reservedIndexCount)}return h.start=i?h.indexStart:h.vertexStart,h.count=i?h.indexCount:h.vertexCount,h.boundingBox=null,t.boundingBox!==null&&(h.boundingBox=t.boundingBox.clone()),h.boundingSphere=null,t.boundingSphere!==null&&(h.boundingSphere=t.boundingSphere.clone()),this._visibilityChanged=!0,e}deleteGeometry(e){const t=this._geometryInfo;if(e>=t.length||t[e].active===!1)return this;const n=this._instanceInfo;for(let i=0,o=n.length;i<o;i++)n[i].active&&n[i].geometryIndex===e&&this.deleteInstance(i);return t[e].active=!1,this._availableGeometryIds.push(e),this._visibilityChanged=!0,this}deleteInstance(e){return this.validateInstanceId(e),this._instanceInfo[e].active=!1,this._availableInstanceIds.push(e),this._visibilityChanged=!0,this}optimize(){let e=0,t=0;const n=this._geometryInfo,i=n.map((l,h)=>h).sort((l,h)=>n[l].vertexStart-n[h].vertexStart),o=this.geometry;for(let l=0,h=n.length;l<h;l++){const d=i[l],p=n[d];if(p.active!==!1){if(o.index!==null){if(p.indexStart!==t){const{indexStart:_,vertexStart:v,reservedIndexCount:y}=p,x=o.index,b=x.array,R=e-v;for(let T=_;T<_+y;T++)b[T]=b[T]+R;x.array.copyWithin(t,_,_+y),x.addUpdateRange(t,y),x.needsUpdate=!0,p.indexStart=t}t+=p.reservedIndexCount}if(p.vertexStart!==e){const{vertexStart:_,reservedVertexCount:v}=p,y=o.attributes;for(const x in y){const b=y[x],{array:R,itemSize:T}=b;R.copyWithin(e*T,_*T,(_+v)*T),b.addUpdateRange(e*T,v*T),b.needsUpdate=!0}p.vertexStart=e}e+=p.reservedVertexCount,p.start=o.index?p.indexStart:p.vertexStart,this._nextIndexStart=o.index?p.indexStart+p.reservedIndexCount:0,this._nextVertexStart=p.vertexStart+p.reservedVertexCount}}return this._visibilityChanged=!0,this}getBoundingBoxAt(e,t){if(e>=this._geometryCount)return null;const n=this.geometry,i=this._geometryInfo[e];if(i.boundingBox===null){const o=new Ra,l=n.index,h=n.attributes.position;for(let d=i.start,p=i.start+i.count;d<p;d++){let _=d;l&&(_=l.getX(_)),o.expandByPoint(Bp.fromBufferAttribute(h,_))}i.boundingBox=o}return t.copy(i.boundingBox),t}getBoundingSphereAt(e,t){if(e>=this._geometryCount)return null;const n=this.geometry,i=this._geometryInfo[e];if(i.boundingSphere===null){const o=new fa;this.getBoundingBoxAt(e,sv),sv.getCenter(o.center);const l=n.index,h=n.attributes.position;let d=0;for(let p=i.start,_=i.start+i.count;p<_;p++){let v=p;l&&(v=l.getX(v)),Bp.fromBufferAttribute(h,v),d=Math.max(d,o.center.distanceToSquared(Bp))}o.radius=Math.sqrt(d),i.boundingSphere=o}return t.copy(i.boundingSphere),t}setMatrixAt(e,t){this.validateInstanceId(e);const n=this._matricesTexture,i=this._matricesTexture.image.data;return t.toArray(i,e*16),n.needsUpdate=!0,this}getMatrixAt(e,t){return this.validateInstanceId(e),t.fromArray(this._matricesTexture.image.data,e*16)}setColorAt(e,t){return this.validateInstanceId(e),this._colorsTexture===null&&this._initColorsTexture(),t.toArray(this._colorsTexture.image.data,e*4),this._colorsTexture.needsUpdate=!0,this}getColorAt(e,t){return this.validateInstanceId(e),t.fromArray(this._colorsTexture.image.data,e*4)}setVisibleAt(e,t){return this.validateInstanceId(e),this._instanceInfo[e].visible===t?this:(this._instanceInfo[e].visible=t,this._visibilityChanged=!0,this)}getVisibleAt(e){return this.validateInstanceId(e),this._instanceInfo[e].visible}setGeometryIdAt(e,t){return this.validateInstanceId(e),this.validateGeometryId(t),this._instanceInfo[e].geometryIndex=t,this}getGeometryIdAt(e){return this.validateInstanceId(e),this._instanceInfo[e].geometryIndex}getGeometryRangeAt(e,t={}){this.validateGeometryId(e);const n=this._geometryInfo[e];return t.vertexStart=n.vertexStart,t.vertexCount=n.vertexCount,t.reservedVertexCount=n.reservedVertexCount,t.indexStart=n.indexStart,t.indexCount=n.indexCount,t.reservedIndexCount=n.reservedIndexCount,t.start=n.start,t.count=n.count,t}setInstanceCount(e){const t=this._availableInstanceIds,n=this._instanceInfo;for(t.sort(Px);t[t.length-1]===n.length-1;)n.pop(),t.pop();if(e<n.length)throw new Error(`BatchedMesh: Instance ids outside the range ${e} are being used. Cannot shrink instance count.`);const i=new Int32Array(e),o=new Int32Array(e);Lu(this._multiDrawCounts,i),Lu(this._multiDrawStarts,o),this._multiDrawCounts=i,this._multiDrawStarts=o,this._maxInstanceCount=e;const l=this._indirectTexture,h=this._matricesTexture,d=this._colorsTexture;l.dispose(),this._initIndirectTexture(),Lu(l.image.data,this._indirectTexture.image.data),h.dispose(),this._initMatricesTexture(),Lu(h.image.data,this._matricesTexture.image.data),d&&(d.dispose(),this._initColorsTexture(),Lu(d.image.data,this._colorsTexture.image.data))}setGeometrySize(e,t){const n=[...this._geometryInfo].filter(h=>h.active);if(Math.max(...n.map(h=>h.vertexStart+h.reservedVertexCount))>e)throw new Error(`BatchedMesh: Geometry vertex values are being used outside the range ${t}. Cannot shrink further.`);if(this.geometry.index&&Math.max(...n.map(d=>d.indexStart+d.reservedIndexCount))>t)throw new Error(`BatchedMesh: Geometry index values are being used outside the range ${t}. Cannot shrink further.`);const o=this.geometry;o.dispose(),this._maxVertexCount=e,this._maxIndexCount=t,this._geometryInitialized&&(this._geometryInitialized=!1,this.geometry=new pn,this._initializeGeometry(o));const l=this.geometry;o.index&&Lu(o.index.array,l.index.array);for(const h in o.attributes)Lu(o.attributes[h].array,l.attributes[h].array)}raycast(e,t){const n=this._instanceInfo,i=this._geometryInfo,o=this.matrixWorld,l=this.geometry;$a.material=this.material,$a.geometry.index=l.index,$a.geometry.attributes=l.attributes,$a.geometry.boundingBox===null&&($a.geometry.boundingBox=new Ra),$a.geometry.boundingSphere===null&&($a.geometry.boundingSphere=new fa);for(let h=0,d=n.length;h<d;h++){if(!n[h].visible||!n[h].active)continue;const p=n[h].geometryIndex,_=i[p];$a.geometry.setDrawRange(_.start,_.count),this.getMatrixAt(h,$a.matrixWorld).premultiply(o),this.getBoundingBoxAt(p,$a.geometry.boundingBox),this.getBoundingSphereAt(p,$a.geometry.boundingSphere),$a.raycast(e,rv);for(let v=0,y=rv.length;v<y;v++){const x=rv[v];x.object=this,x.batchId=h,t.push(x)}rv.length=0}$a.material=null,$a.geometry.index=null,$a.geometry.attributes={},$a.geometry.setDrawRange(0,1/0)}copy(e){return super.copy(e),this.geometry=e.geometry.clone(),this.perObjectFrustumCulled=e.perObjectFrustumCulled,this.sortObjects=e.sortObjects,this.boundingBox=e.boundingBox!==null?e.boundingBox.clone():null,this.boundingSphere=e.boundingSphere!==null?e.boundingSphere.clone():null,this._geometryInfo=e._geometryInfo.map(t=>({...t,boundingBox:t.boundingBox!==null?t.boundingBox.clone():null,boundingSphere:t.boundingSphere!==null?t.boundingSphere.clone():null})),this._instanceInfo=e._instanceInfo.map(t=>({...t})),this._availableInstanceIds=e._availableInstanceIds.slice(),this._availableGeometryIds=e._availableGeometryIds.slice(),this._nextIndexStart=e._nextIndexStart,this._nextVertexStart=e._nextVertexStart,this._geometryCount=e._geometryCount,this._maxInstanceCount=e._maxInstanceCount,this._maxVertexCount=e._maxVertexCount,this._maxIndexCount=e._maxIndexCount,this._geometryInitialized=e._geometryInitialized,this._multiDrawCounts=e._multiDrawCounts.slice(),this._multiDrawStarts=e._multiDrawStarts.slice(),this._indirectTexture=e._indirectTexture.clone(),this._indirectTexture.image.data=this._indirectTexture.image.data.slice(),this._matricesTexture=e._matricesTexture.clone(),this._matricesTexture.image.data=this._matricesTexture.image.data.slice(),this._colorsTexture!==null&&(this._colorsTexture=e._colorsTexture.clone(),this._colorsTexture.image.data=this._colorsTexture.image.data.slice()),this}dispose(){this.geometry.dispose(),this._matricesTexture.dispose(),this._matricesTexture=null,this._indirectTexture.dispose(),this._indirectTexture=null,this._colorsTexture!==null&&(this._colorsTexture.dispose(),this._colorsTexture=null)}onBeforeRender(e,t,n,i,o){if(!this._visibilityChanged&&!this.perObjectFrustumCulled&&!this.sortObjects)return;const l=i.getIndex(),h=l===null?1:l.array.BYTES_PER_ELEMENT,d=this._instanceInfo,p=this._multiDrawStarts,_=this._multiDrawCounts,v=this._geometryInfo,y=this.perObjectFrustumCulled,x=this._indirectTexture,b=x.image.data,R=n.isArrayCamera?ow:$b;y&&!n.isArrayCamera&&(Ps.multiplyMatrices(n.projectionMatrix,n.matrixWorldInverse).multiply(this.matrixWorld),$b.setFromProjectionMatrix(Ps,n.coordinateSystem,n.reversedDepth));let T=0;if(this.sortObjects){Ps.copy(this.matrixWorld).invert(),Bp.setFromMatrixPosition(n.matrixWorld).applyMatrix4(Ps),e1.set(0,0,-1).transformDirection(n.matrixWorld).transformDirection(Ps);for(let D=0,N=d.length;D<N;D++)if(d[D].visible&&d[D].active){const H=d[D].geometryIndex;this.getMatrixAt(D,Ps),this.getBoundingSphereAt(H,Uu).applyMatrix4(Ps);let O=!1;if(y&&(O=!R.intersectsSphere(Uu,n)),!O){const z=v[H],V=lw.subVectors(Uu.center,Bp).dot(e1);Gx.push(z.start,z.count,V,D)}}const M=Gx.list,w=this.customSort;w===null?M.sort(o.transparent?aw:iw):w.call(this,M,n);for(let D=0,N=M.length;D<N;D++){const H=M[D];p[T]=H.start*h,_[T]=H.count,b[T]=H.index,T++}Gx.reset()}else for(let M=0,w=d.length;M<w;M++)if(d[M].visible&&d[M].active){const D=d[M].geometryIndex;let N=!1;if(y&&(this.getMatrixAt(M,Ps),this.getBoundingSphereAt(D,Uu).applyMatrix4(Ps),N=!R.intersectsSphere(Uu,n)),!N){const H=v[D];p[T]=H.start*h,_[T]=H.count,b[T]=M,T++}}x.needsUpdate=!0,this._multiDrawCount=T,this._visibilityChanged=!1}onBeforeShadow(e,t,n,i,o,l){this.onBeforeRender(e,null,i,o,l)}}class za extends Yi{constructor(e){super(),this.isLineBasicMaterial=!0,this.type="LineBasicMaterial",this.color=new Ct(16777215),this.map=null,this.linewidth=1,this.linecap="round",this.linejoin="round",this.fog=!0,this.setValues(e)}copy(e){return super.copy(e),this.color.copy(e.color),this.map=e.map,this.linewidth=e.linewidth,this.linecap=e.linecap,this.linejoin=e.linejoin,this.fog=e.fog,this}}const ov=new Z,lv=new Z,n1=new en,Dp=new lh,cv=new fa,zx=new Z,i1=new Z;class wo extends Un{constructor(e=new pn,t=new za){super(),this.isLine=!0,this.type="Line",this.geometry=e,this.material=t,this.morphTargetDictionary=void 0,this.morphTargetInfluences=void 0,this.updateMorphTargets()}copy(e,t){return super.copy(e,t),this.material=Array.isArray(e.material)?e.material.slice():e.material,this.geometry=e.geometry,this}computeLineDistances(){const e=this.geometry;if(e.index===null){const t=e.attributes.position,n=[0];for(let i=1,o=t.count;i<o;i++)ov.fromBufferAttribute(t,i-1),lv.fromBufferAttribute(t,i),n[i]=n[i-1],n[i]+=ov.distanceTo(lv);e.setAttribute("lineDistance",new Xt(n,1))}else Ut("Line.computeLineDistances(): Computation only possible with non-indexed BufferGeometry.");return this}raycast(e,t){const n=this.geometry,i=this.matrixWorld,o=e.params.Line.threshold,l=n.drawRange;if(n.boundingSphere===null&&n.computeBoundingSphere(),cv.copy(n.boundingSphere),cv.applyMatrix4(i),cv.radius+=o,e.ray.intersectsSphere(cv)===!1)return;n1.copy(i).invert(),Dp.copy(e.ray).applyMatrix4(n1);const h=o/((this.scale.x+this.scale.y+this.scale.z)/3),d=h*h,p=this.isLineSegments?2:1,_=n.index,y=n.attributes.position;if(_!==null){const x=Math.max(0,l.start),b=Math.min(_.count,l.start+l.count);for(let R=x,T=b-1;R<T;R+=p){const M=_.getX(R),w=_.getX(R+1),D=uv(this,e,Dp,d,M,w,R);D&&t.push(D)}if(this.isLineLoop){const R=_.getX(b-1),T=_.getX(x),M=uv(this,e,Dp,d,R,T,b-1);M&&t.push(M)}}else{const x=Math.max(0,l.start),b=Math.min(y.count,l.start+l.count);for(let R=x,T=b-1;R<T;R+=p){const M=uv(this,e,Dp,d,R,R+1,R);M&&t.push(M)}if(this.isLineLoop){const R=uv(this,e,Dp,d,b-1,x,b-1);R&&t.push(R)}}}updateMorphTargets(){const t=this.geometry.morphAttributes,n=Object.keys(t);if(n.length>0){const i=t[n[0]];if(i!==void 0){this.morphTargetInfluences=[],this.morphTargetDictionary={};for(let o=0,l=i.length;o<l;o++){const h=i[o].name||String(o);this.morphTargetInfluences.push(0),this.morphTargetDictionary[h]=o}}}}}function uv(s,e,t,n,i,o,l){const h=s.geometry.attributes.position;if(ov.fromBufferAttribute(h,i),lv.fromBufferAttribute(h,o),t.distanceSqToSegment(ov,lv,zx,i1)>n)return;zx.applyMatrix4(s.matrixWorld);const p=e.ray.origin.distanceTo(zx);if(!(p<e.near||p>e.far))return{distance:p,point:i1.clone().applyMatrix4(s.matrixWorld),index:l,face:null,faceIndex:null,barycoord:null,object:s}}const a1=new Z,s1=new Z;class yr extends wo{constructor(e,t){super(e,t),this.isLineSegments=!0,this.type="LineSegments"}computeLineDistances(){const e=this.geometry;if(e.index===null){const t=e.attributes.position,n=[];for(let i=0,o=t.count;i<o;i+=2)a1.fromBufferAttribute(t,i),s1.fromBufferAttribute(t,i+1),n[i]=i===0?0:n[i-1],n[i+1]=n[i]+a1.distanceTo(s1);e.setAttribute("lineDistance",new Xt(n,1))}else Ut("LineSegments.computeLineDistances(): Computation only possible with non-indexed BufferGeometry.");return this}}class fv extends wo{constructor(e,t){super(e,t),this.isLineLoop=!0,this.type="LineLoop"}}class Np extends Yi{constructor(e){super(),this.isPointsMaterial=!0,this.type="PointsMaterial",this.color=new Ct(16777215),this.map=null,this.alphaMap=null,this.size=1,this.sizeAttenuation=!0,this.fog=!0,this.setValues(e)}copy(e){return super.copy(e),this.color.copy(e.color),this.map=e.map,this.alphaMap=e.alphaMap,this.size=e.size,this.sizeAttenuation=e.sizeAttenuation,this.fog=e.fog,this}}const r1=new en,Vx=new lh,hv=new fa,dv=new Z;class pv extends Un{constructor(e=new pn,t=new Np){super(),this.isPoints=!0,this.type="Points",this.geometry=e,this.material=t,this.morphTargetDictionary=void 0,this.morphTargetInfluences=void 0,this.updateMorphTargets()}copy(e,t){return super.copy(e,t),this.material=Array.isArray(e.material)?e.material.slice():e.material,this.geometry=e.geometry,this}raycast(e,t){const n=this.geometry,i=this.matrixWorld,o=e.params.Points.threshold,l=n.drawRange;if(n.boundingSphere===null&&n.computeBoundingSphere(),hv.copy(n.boundingSphere),hv.applyMatrix4(i),hv.radius+=o,e.ray.intersectsSphere(hv)===!1)return;r1.copy(i).invert(),Vx.copy(e.ray).applyMatrix4(r1);const h=o/((this.scale.x+this.scale.y+this.scale.z)/3),d=h*h,p=n.index,v=n.attributes.position;if(p!==null){const y=Math.max(0,l.start),x=Math.min(p.count,l.start+l.count);for(let b=y,R=x;b<R;b++){const T=p.getX(b);dv.fromBufferAttribute(v,T),o1(dv,T,d,i,e,t,this)}}else{const y=Math.max(0,l.start),x=Math.min(v.count,l.start+l.count);for(let b=y,R=x;b<R;b++)dv.fromBufferAttribute(v,b),o1(dv,b,d,i,e,t,this)}}updateMorphTargets(){const t=this.geometry.morphAttributes,n=Object.keys(t);if(n.length>0){const i=t[n[0]];if(i!==void 0){this.morphTargetInfluences=[],this.morphTargetDictionary={};for(let o=0,l=i.length;o<l;o++){const h=i[o].name||String(o);this.morphTargetInfluences.push(0),this.morphTargetDictionary[h]=o}}}}}function o1(s,e,t,n,i,o,l){const h=Vx.distanceSqToPoint(s);if(h<t){const d=new Z;Vx.closestPointToPoint(s,d),d.applyMatrix4(n);const p=i.ray.origin.distanceTo(d);if(p<i.near||p>i.far)return;o.push({distance:p,distanceToRay:Math.sqrt(h),point:d,index:e,face:null,faceIndex:null,barycoord:null,object:l})}}class l1 extends Qn{constructor(e,t,n,i,o=Cn,l=Cn,h,d,p){super(e,t,n,i,o,l,h,d,p),this.isVideoTexture=!0,this.generateMipmaps=!1,this._requestVideoFrameCallbackId=0;const _=this;function v(){_.needsUpdate=!0,_._requestVideoFrameCallbackId=e.requestVideoFrameCallback(v)}"requestVideoFrameCallback"in e&&(this._requestVideoFrameCallbackId=e.requestVideoFrameCallback(v))}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)}dispose(){this._requestVideoFrameCallbackId!==0&&(this.source.data.cancelVideoFrameCallback(this._requestVideoFrameCallbackId),this._requestVideoFrameCallbackId=0),super.dispose()}}class uw extends l1{constructor(e,t,n,i,o,l,h,d){super({},e,t,n,i,o,l,h,d),this.isVideoFrameTexture=!0}update(){}clone(){return new this.constructor().copy(this)}setFrame(e){this.image=e,this.needsUpdate=!0}}class fw extends Qn{constructor(e,t){super({width:e,height:t}),this.isFramebufferTexture=!0,this.magFilter=Ti,this.minFilter=Ti,this.generateMipmaps=!1,this.needsUpdate=!0}}class mv extends Qn{constructor(e,t,n,i,o,l,h,d,p,_,v,y){super(null,l,h,d,p,_,i,o,v,y),this.isCompressedTexture=!0,this.image={width:t,height:n},this.mipmaps=e,this.flipY=!1,this.generateMipmaps=!1}}class hw extends mv{constructor(e,t,n,i,o,l){super(e,t,n,o,l),this.isCompressedArrayTexture=!0,this.image.depth=i,this.wrapR=Ei,this.layerUpdates=new Set}addLayerUpdate(e){this.layerUpdates.add(e)}clearLayerUpdates(){this.layerUpdates.clear()}}class dw extends mv{constructor(e,t,n){super(void 0,e[0].width,e[0].height,t,n,qr),this.isCompressedCubeTexture=!0,this.isCubeTexture=!0,this.image=e}}class pw extends Qn{constructor(e,t,n,i,o,l,h,d,p){super(e,t,n,i,o,l,h,d,p),this.isCanvasTexture=!0,this.needsUpdate=!0}}class Ch extends Qn{constructor(e,t,n=js,i,o,l,h=Ti,d=Ti,p,_=Eo,v=1){if(_!==Eo&&_!==cc)throw new Error("DepthTexture format must be either THREE.DepthFormat or THREE.DepthStencilFormat");const y={width:e,height:t,depth:v};super(y,i,o,l,h,d,_,n,p),this.isDepthTexture=!0,this.flipY=!1,this.generateMipmaps=!1,this.compareFunction=null}copy(e){return super.copy(e),this.source=new dc(Object.assign({},e.image)),this.compareFunction=e.compareFunction,this}toJSON(e){const t=super.toJSON(e);return this.compareFunction!==null&&(t.compareFunction=this.compareFunction),t}}class c1 extends Ch{constructor(e,t=js,n=qr,i,o,l=Ti,h=Ti,d,p=Eo){const _={width:e,height:e,depth:1},v=[_,_,_,_,_,_];super(e,e,t,n,i,o,l,h,d,p),this.image=v,this.isCubeDepthTexture=!0,this.isCubeTexture=!0}get images(){return this.image}set images(e){this.image=e}}class kx extends Qn{constructor(e=null){super(),this.sourceTexture=e,this.isExternalTexture=!0}copy(e){return super.copy(e),this.sourceTexture=e.sourceTexture,this}}class gv extends pn{constructor(e=1,t=1,n=4,i=8,o=1){super(),this.type="CapsuleGeometry",this.parameters={radius:e,height:t,capSegments:n,radialSegments:i,heightSegments:o},t=Math.max(0,t),n=Math.max(1,Math.floor(n)),i=Math.max(3,Math.floor(i)),o=Math.max(1,Math.floor(o));const l=[],h=[],d=[],p=[],_=t/2,v=Math.PI/2*e,y=t,x=2*v+y,b=n*2+o,R=i+1,T=new Z,M=new Z;for(let w=0;w<=b;w++){let D=0,N=0,H=0,O=0;if(w<=n){const U=w/n,F=U*Math.PI/2;N=-_-e*Math.cos(F),H=e*Math.sin(F),O=-e*Math.cos(F),D=U*v}else if(w<=n+o){const U=(w-n)/o;N=-_+U*t,H=e,O=0,D=v+U*y}else{const U=(w-n-o)/n,F=U*Math.PI/2;N=_+e*Math.sin(F),H=e*Math.cos(F),O=e*Math.sin(F),D=v+y+U*v}const z=Math.max(0,Math.min(1,D/x));let V=0;w===0?V=.5/i:w===b&&(V=-.5/i);for(let U=0;U<=i;U++){const F=U/i,K=F*Math.PI*2,ne=Math.sin(K),$=Math.cos(K);M.x=-H*$,M.y=N,M.z=H*ne,h.push(M.x,M.y,M.z),T.set(-H*$,O,H*ne),T.normalize(),d.push(T.x,T.y,T.z),p.push(F+V,z)}if(w>0){const U=(w-1)*R;for(let F=0;F<i;F++){const K=U+F,ne=U+F+1,$=w*R+F,ae=w*R+F+1;l.push(K,ne,$),l.push(ne,ae,$)}}}this.setIndex(l),this.setAttribute("position",new Xt(h,3)),this.setAttribute("normal",new Xt(d,3)),this.setAttribute("uv",new Xt(p,2))}copy(e){return super.copy(e),this.parameters=Object.assign({},e.parameters),this}static fromJSON(e){return new gv(e.radius,e.height,e.capSegments,e.radialSegments,e.heightSegments)}}class vv extends pn{constructor(e=1,t=32,n=0,i=Math.PI*2){super(),this.type="CircleGeometry",this.parameters={radius:e,segments:t,thetaStart:n,thetaLength:i},t=Math.max(3,t);const o=[],l=[],h=[],d=[],p=new Z,_=new nt;l.push(0,0,0),h.push(0,0,1),d.push(.5,.5);for(let v=0,y=3;v<=t;v++,y+=3){const x=n+v/t*i;p.x=e*Math.cos(x),p.y=e*Math.sin(x),l.push(p.x,p.y,p.z),h.push(0,0,1),_.x=(l[y]/e+1)/2,_.y=(l[y+1]/e+1)/2,d.push(_.x,_.y)}for(let v=1;v<=t;v++)o.push(v,v+1,0);this.setIndex(o),this.setAttribute("position",new Xt(l,3)),this.setAttribute("normal",new Xt(h,3)),this.setAttribute("uv",new Xt(d,2))}copy(e){return super.copy(e),this.parameters=Object.assign({},e.parameters),this}static fromJSON(e){return new vv(e.radius,e.segments,e.thetaStart,e.thetaLength)}}class Up extends pn{constructor(e=1,t=1,n=1,i=32,o=1,l=!1,h=0,d=Math.PI*2){super(),this.type="CylinderGeometry",this.parameters={radiusTop:e,radiusBottom:t,height:n,radialSegments:i,heightSegments:o,openEnded:l,thetaStart:h,thetaLength:d};const p=this;i=Math.floor(i),o=Math.floor(o);const _=[],v=[],y=[],x=[];let b=0;const R=[],T=n/2;let M=0;w(),l===!1&&(e>0&&D(!0),t>0&&D(!1)),this.setIndex(_),this.setAttribute("position",new Xt(v,3)),this.setAttribute("normal",new Xt(y,3)),this.setAttribute("uv",new Xt(x,2));function w(){const N=new Z,H=new Z;let O=0;const z=(t-e)/n;for(let V=0;V<=o;V++){const U=[],F=V/o,K=F*(t-e)+e;for(let ne=0;ne<=i;ne++){const $=ne/i,ae=$*d+h,ge=Math.sin(ae),I=Math.cos(ae);H.x=K*ge,H.y=-F*n+T,H.z=K*I,v.push(H.x,H.y,H.z),N.set(ge,z,I).normalize(),y.push(N.x,N.y,N.z),x.push($,1-F),U.push(b++)}R.push(U)}for(let V=0;V<i;V++)for(let U=0;U<o;U++){const F=R[U][V],K=R[U+1][V],ne=R[U+1][V+1],$=R[U][V+1];(e>0||U!==0)&&(_.push(F,K,$),O+=3),(t>0||U!==o-1)&&(_.push(K,ne,$),O+=3)}p.addGroup(M,O,0),M+=O}function D(N){const H=b,O=new nt,z=new Z;let V=0;const U=N===!0?e:t,F=N===!0?1:-1;for(let ne=1;ne<=i;ne++)v.push(0,T*F,0),y.push(0,F,0),x.push(.5,.5),b++;const K=b;for(let ne=0;ne<=i;ne++){const ae=ne/i*d+h,ge=Math.cos(ae),I=Math.sin(ae);z.x=U*I,z.y=T*F,z.z=U*ge,v.push(z.x,z.y,z.z),y.push(0,F,0),O.x=ge*.5+.5,O.y=I*.5*F+.5,x.push(O.x,O.y),b++}for(let ne=0;ne<i;ne++){const $=H+ne,ae=K+ne;N===!0?_.push(ae,ae+1,$):_.push(ae+1,ae,$),V+=3}p.addGroup(M,V,N===!0?1:2),M+=V}}copy(e){return super.copy(e),this.parameters=Object.assign({},e.parameters),this}static fromJSON(e){return new Up(e.radiusTop,e.radiusBottom,e.height,e.radialSegments,e.heightSegments,e.openEnded,e.thetaStart,e.thetaLength)}}class Lp extends Up{constructor(e=1,t=1,n=32,i=1,o=!1,l=0,h=Math.PI*2){super(0,e,t,n,i,o,l,h),this.type="ConeGeometry",this.parameters={radius:e,height:t,radialSegments:n,heightSegments:i,openEnded:o,thetaStart:l,thetaLength:h}}static fromJSON(e){return new Lp(e.radius,e.height,e.radialSegments,e.heightSegments,e.openEnded,e.thetaStart,e.thetaLength)}}class Sc extends pn{constructor(e=[],t=[],n=1,i=0){super(),this.type="PolyhedronGeometry",this.parameters={vertices:e,indices:t,radius:n,detail:i};const o=[],l=[];h(i),p(n),_(),this.setAttribute("position",new Xt(o,3)),this.setAttribute("normal",new Xt(o.slice(),3)),this.setAttribute("uv",new Xt(l,2)),i===0?this.computeVertexNormals():this.normalizeNormals();function h(w){const D=new Z,N=new Z,H=new Z;for(let O=0;O<t.length;O+=3)x(t[O+0],D),x(t[O+1],N),x(t[O+2],H),d(D,N,H,w)}function d(w,D,N,H){const O=H+1,z=[];for(let V=0;V<=O;V++){z[V]=[];const U=w.clone().lerp(N,V/O),F=D.clone().lerp(N,V/O),K=O-V;for(let ne=0;ne<=K;ne++)ne===0&&V===O?z[V][ne]=U:z[V][ne]=U.clone().lerp(F,ne/K)}for(let V=0;V<O;V++)for(let U=0;U<2*(O-V)-1;U++){const F=Math.floor(U/2);U%2===0?(y(z[V][F+1]),y(z[V+1][F]),y(z[V][F])):(y(z[V][F+1]),y(z[V+1][F+1]),y(z[V+1][F]))}}function p(w){const D=new Z;for(let N=0;N<o.length;N+=3)D.x=o[N+0],D.y=o[N+1],D.z=o[N+2],D.normalize().multiplyScalar(w),o[N+0]=D.x,o[N+1]=D.y,o[N+2]=D.z}function _(){const w=new Z;for(let D=0;D<o.length;D+=3){w.x=o[D+0],w.y=o[D+1],w.z=o[D+2];const N=T(w)/2/Math.PI+.5,H=M(w)/Math.PI+.5;l.push(N,1-H)}b(),v()}function v(){for(let w=0;w<l.length;w+=6){const D=l[w+0],N=l[w+2],H=l[w+4],O=Math.max(D,N,H),z=Math.min(D,N,H);O>.9&&z<.1&&(D<.2&&(l[w+0]+=1),N<.2&&(l[w+2]+=1),H<.2&&(l[w+4]+=1))}}function y(w){o.push(w.x,w.y,w.z)}function x(w,D){const N=w*3;D.x=e[N+0],D.y=e[N+1],D.z=e[N+2]}function b(){const w=new Z,D=new Z,N=new Z,H=new Z,O=new nt,z=new nt,V=new nt;for(let U=0,F=0;U<o.length;U+=9,F+=6){w.set(o[U+0],o[U+1],o[U+2]),D.set(o[U+3],o[U+4],o[U+5]),N.set(o[U+6],o[U+7],o[U+8]),O.set(l[F+0],l[F+1]),z.set(l[F+2],l[F+3]),V.set(l[F+4],l[F+5]),H.copy(w).add(D).add(N).divideScalar(3);const K=T(H);R(O,F+0,w,K),R(z,F+2,D,K),R(V,F+4,N,K)}}function R(w,D,N,H){H<0&&w.x===1&&(l[D]=w.x-1),N.x===0&&N.z===0&&(l[D]=H/2/Math.PI+.5)}function T(w){return Math.atan2(w.z,-w.x)}function M(w){return Math.atan2(-w.y,Math.sqrt(w.x*w.x+w.z*w.z))}}copy(e){return super.copy(e),this.parameters=Object.assign({},e.parameters),this}static fromJSON(e){return new Sc(e.vertices,e.indices,e.radius,e.detail)}}class _v extends Sc{constructor(e=1,t=0){const n=(1+Math.sqrt(5))/2,i=1/n,o=[-1,-1,-1,-1,-1,1,-1,1,-1,-1,1,1,1,-1,-1,1,-1,1,1,1,-1,1,1,1,0,-i,-n,0,-i,n,0,i,-n,0,i,n,-i,-n,0,-i,n,0,i,-n,0,i,n,0,-n,0,-i,n,0,-i,-n,0,i,n,0,i],l=[3,11,7,3,7,15,3,15,13,7,19,17,7,17,6,7,6,15,17,4,8,17,8,10,17,10,6,8,0,16,8,16,2,8,2,10,0,12,1,0,1,18,0,18,16,6,10,2,6,2,13,6,13,15,2,16,18,2,18,3,2,3,13,18,1,9,18,9,11,18,11,3,4,14,12,4,12,0,4,0,8,11,9,5,11,5,19,11,19,7,19,5,14,19,14,4,19,4,17,1,12,14,1,14,5,1,5,9];super(o,l,e,t),this.type="DodecahedronGeometry",this.parameters={radius:e,detail:t}}static fromJSON(e){return new _v(e.radius,e.detail)}}const yv=new Z,xv=new Z,Xx=new Z,Av=new Fs;class u1 extends pn{constructor(e=null,t=1){if(super(),this.type="EdgesGeometry",this.parameters={geometry:e,thresholdAngle:t},e!==null){const i=Math.pow(10,4),o=Math.cos(Tu*t),l=e.getIndex(),h=e.getAttribute("position"),d=l?l.count:h.count,p=[0,0,0],_=["a","b","c"],v=new Array(3),y={},x=[];for(let b=0;b<d;b+=3){l?(p[0]=l.getX(b),p[1]=l.getX(b+1),p[2]=l.getX(b+2)):(p[0]=b,p[1]=b+1,p[2]=b+2);const{a:R,b:T,c:M}=Av;if(R.fromBufferAttribute(h,p[0]),T.fromBufferAttribute(h,p[1]),M.fromBufferAttribute(h,p[2]),Av.getNormal(Xx),v[0]=`${Math.round(R.x*i)},${Math.round(R.y*i)},${Math.round(R.z*i)}`,v[1]=`${Math.round(T.x*i)},${Math.round(T.y*i)},${Math.round(T.z*i)}`,v[2]=`${Math.round(M.x*i)},${Math.round(M.y*i)},${Math.round(M.z*i)}`,!(v[0]===v[1]||v[1]===v[2]||v[2]===v[0]))for(let w=0;w<3;w++){const D=(w+1)%3,N=v[w],H=v[D],O=Av[_[w]],z=Av[_[D]],V=`${N}_${H}`,U=`${H}_${N}`;U in y&&y[U]?(Xx.dot(y[U].normal)<=o&&(x.push(O.x,O.y,O.z),x.push(z.x,z.y,z.z)),y[U]=null):V in y||(y[V]={index0:p[w],index1:p[D],normal:Xx.clone()})}}for(const b in y)if(y[b]){const{index0:R,index1:T}=y[b];yv.fromBufferAttribute(h,R),xv.fromBufferAttribute(h,T),x.push(yv.x,yv.y,yv.z),x.push(xv.x,xv.y,xv.z)}this.setAttribute("position",new Xt(x,3))}}copy(e){return super.copy(e),this.parameters=Object.assign({},e.parameters),this}}class Qr{constructor(){this.type="Curve",this.arcLengthDivisions=200,this.needsUpdate=!1,this.cacheArcLengths=null}getPoint(){Ut("Curve: .getPoint() not implemented.")}getPointAt(e,t){const n=this.getUtoTmapping(e);return this.getPoint(n,t)}getPoints(e=5){const t=[];for(let n=0;n<=e;n++)t.push(this.getPoint(n/e));return t}getSpacedPoints(e=5){const t=[];for(let n=0;n<=e;n++)t.push(this.getPointAt(n/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 n,i=this.getPoint(0),o=0;t.push(0);for(let l=1;l<=e;l++)n=this.getPoint(l/e),o+=n.distanceTo(i),t.push(o),i=n;return this.cacheArcLengths=t,t}updateArcLengths(){this.needsUpdate=!0,this.getLengths()}getUtoTmapping(e,t=null){const n=this.getLengths();let i=0;const o=n.length;let l;t?l=t:l=e*n[o-1];let h=0,d=o-1,p;for(;h<=d;)if(i=Math.floor(h+(d-h)/2),p=n[i]-l,p<0)h=i+1;else if(p>0)d=i-1;else{d=i;break}if(i=d,n[i]===l)return i/(o-1);const _=n[i],y=n[i+1]-_,x=(l-_)/y;return(i+x)/(o-1)}getTangent(e,t){let i=e-1e-4,o=e+1e-4;i<0&&(i=0),o>1&&(o=1);const l=this.getPoint(i),h=this.getPoint(o),d=t||(l.isVector2?new nt:new Z);return d.copy(h).sub(l).normalize(),d}getTangentAt(e,t){const n=this.getUtoTmapping(e);return this.getTangent(n,t)}computeFrenetFrames(e,t=!1){const n=new Z,i=[],o=[],l=[],h=new Z,d=new en;for(let x=0;x<=e;x++){const b=x/e;i[x]=this.getTangentAt(b,new Z)}o[0]=new Z,l[0]=new Z;let p=Number.MAX_VALUE;const _=Math.abs(i[0].x),v=Math.abs(i[0].y),y=Math.abs(i[0].z);_<=p&&(p=_,n.set(1,0,0)),v<=p&&(p=v,n.set(0,1,0)),y<=p&&n.set(0,0,1),h.crossVectors(i[0],n).normalize(),o[0].crossVectors(i[0],h),l[0].crossVectors(i[0],o[0]);for(let x=1;x<=e;x++){if(o[x]=o[x-1].clone(),l[x]=l[x-1].clone(),h.crossVectors(i[x-1],i[x]),h.length()>Number.EPSILON){h.normalize();const b=Math.acos(dn(i[x-1].dot(i[x]),-1,1));o[x].applyMatrix4(d.makeRotationAxis(h,b))}l[x].crossVectors(i[x],o[x])}if(t===!0){let x=Math.acos(dn(o[0].dot(o[e]),-1,1));x/=e,i[0].dot(h.crossVectors(o[0],o[e]))>0&&(x=-x);for(let b=1;b<=e;b++)o[b].applyMatrix4(d.makeRotationAxis(i[b],x*b)),l[b].crossVectors(i[b],o[b])}return{tangents:i,normals:o,binormals:l}}clone(){return new this.constructor().copy(this)}copy(e){return this.arcLengthDivisions=e.arcLengthDivisions,this}toJSON(){const e={metadata:{version:4.7,type:"Curve",generator:"Curve.toJSON"}};return e.arcLengthDivisions=this.arcLengthDivisions,e.type=this.type,e}fromJSON(e){return this.arcLengthDivisions=e.arcLengthDivisions,this}}class Sv extends Qr{constructor(e=0,t=0,n=1,i=1,o=0,l=Math.PI*2,h=!1,d=0){super(),this.isEllipseCurve=!0,this.type="EllipseCurve",this.aX=e,this.aY=t,this.xRadius=n,this.yRadius=i,this.aStartAngle=o,this.aEndAngle=l,this.aClockwise=h,this.aRotation=d}getPoint(e,t=new nt){const n=t,i=Math.PI*2;let o=this.aEndAngle-this.aStartAngle;const l=Math.abs(o)<Number.EPSILON;for(;o<0;)o+=i;for(;o>i;)o-=i;o<Number.EPSILON&&(l?o=0:o=i),this.aClockwise===!0&&!l&&(o===i?o=-i:o=o-i);const h=this.aStartAngle+e*o;let d=this.aX+this.xRadius*Math.cos(h),p=this.aY+this.yRadius*Math.sin(h);if(this.aRotation!==0){const _=Math.cos(this.aRotation),v=Math.sin(this.aRotation),y=d-this.aX,x=p-this.aY;d=y*_-x*v+this.aX,p=y*v+x*_+this.aY}return n.set(d,p)}copy(e){return super.copy(e),this.aX=e.aX,this.aY=e.aY,this.xRadius=e.xRadius,this.yRadius=e.yRadius,this.aStartAngle=e.aStartAngle,this.aEndAngle=e.aEndAngle,this.aClockwise=e.aClockwise,this.aRotation=e.aRotation,this}toJSON(){const e=super.toJSON();return e.aX=this.aX,e.aY=this.aY,e.xRadius=this.xRadius,e.yRadius=this.yRadius,e.aStartAngle=this.aStartAngle,e.aEndAngle=this.aEndAngle,e.aClockwise=this.aClockwise,e.aRotation=this.aRotation,e}fromJSON(e){return super.fromJSON(e),this.aX=e.aX,this.aY=e.aY,this.xRadius=e.xRadius,this.yRadius=e.yRadius,this.aStartAngle=e.aStartAngle,this.aEndAngle=e.aEndAngle,this.aClockwise=e.aClockwise,this.aRotation=e.aRotation,this}}class f1 extends Sv{constructor(e,t,n,i,o,l){super(e,t,n,n,i,o,l),this.isArcCurve=!0,this.type="ArcCurve"}}function Yx(){let s=0,e=0,t=0,n=0;function i(o,l,h,d){s=o,e=h,t=-3*o+3*l-2*h-d,n=2*o-2*l+h+d}return{initCatmullRom:function(o,l,h,d,p){i(l,h,p*(h-o),p*(d-l))},initNonuniformCatmullRom:function(o,l,h,d,p,_,v){let y=(l-o)/p-(h-o)/(p+_)+(h-l)/_,x=(h-l)/_-(d-l)/(_+v)+(d-h)/v;y*=_,x*=_,i(l,h,y,x)},calc:function(o){const l=o*o,h=l*o;return s+e*o+t*l+n*h}}}const Mv=new Z,Jx=new Yx,qx=new Yx,Kx=new Yx;class h1 extends Qr{constructor(e=[],t=!1,n="centripetal",i=.5){super(),this.isCatmullRomCurve3=!0,this.type="CatmullRomCurve3",this.points=e,this.closed=t,this.curveType=n,this.tension=i}getPoint(e,t=new Z){const n=t,i=this.points,o=i.length,l=(o-(this.closed?0:1))*e;let h=Math.floor(l),d=l-h;this.closed?h+=h>0?0:(Math.floor(Math.abs(h)/o)+1)*o:d===0&&h===o-1&&(h=o-2,d=1);let p,_;this.closed||h>0?p=i[(h-1)%o]:(Mv.subVectors(i[0],i[1]).add(i[0]),p=Mv);const v=i[h%o],y=i[(h+1)%o];if(this.closed||h+2<o?_=i[(h+2)%o]:(Mv.subVectors(i[o-1],i[o-2]).add(i[o-1]),_=Mv),this.curveType==="centripetal"||this.curveType==="chordal"){const x=this.curveType==="chordal"?.5:.25;let b=Math.pow(p.distanceToSquared(v),x),R=Math.pow(v.distanceToSquared(y),x),T=Math.pow(y.distanceToSquared(_),x);R<1e-4&&(R=1),b<1e-4&&(b=R),T<1e-4&&(T=R),Jx.initNonuniformCatmullRom(p.x,v.x,y.x,_.x,b,R,T),qx.initNonuniformCatmullRom(p.y,v.y,y.y,_.y,b,R,T),Kx.initNonuniformCatmullRom(p.z,v.z,y.z,_.z,b,R,T)}else this.curveType==="catmullrom"&&(Jx.initCatmullRom(p.x,v.x,y.x,_.x,this.tension),qx.initCatmullRom(p.y,v.y,y.y,_.y,this.tension),Kx.initCatmullRom(p.z,v.z,y.z,_.z,this.tension));return n.set(Jx.calc(d),qx.calc(d),Kx.calc(d)),n}copy(e){super.copy(e),this.points=[];for(let t=0,n=e.points.length;t<n;t++){const i=e.points[t];this.points.push(i.clone())}return this.closed=e.closed,this.curveType=e.curveType,this.tension=e.tension,this}toJSON(){const e=super.toJSON();e.points=[];for(let t=0,n=this.points.length;t<n;t++){const i=this.points[t];e.points.push(i.toArray())}return e.closed=this.closed,e.curveType=this.curveType,e.tension=this.tension,e}fromJSON(e){super.fromJSON(e),this.points=[];for(let t=0,n=e.points.length;t<n;t++){const i=e.points[t];this.points.push(new Z().fromArray(i))}return this.closed=e.closed,this.curveType=e.curveType,this.tension=e.tension,this}}function d1(s,e,t,n,i){const o=(n-e)*.5,l=(i-t)*.5,h=s*s,d=s*h;return(2*t-2*n+o+l)*d+(-3*t+3*n-2*o-l)*h+o*s+t}function mw(s,e){const t=1-s;return t*t*e}function gw(s,e){return 2*(1-s)*s*e}function vw(s,e){return s*s*e}function Op(s,e,t,n){return mw(s,e)+gw(s,t)+vw(s,n)}function _w(s,e){const t=1-s;return t*t*t*e}function yw(s,e){const t=1-s;return 3*t*t*s*e}function xw(s,e){return 3*(1-s)*s*s*e}function Aw(s,e){return s*s*s*e}function Ip(s,e,t,n,i){return _w(s,e)+yw(s,t)+xw(s,n)+Aw(s,i)}class Wx extends Qr{constructor(e=new nt,t=new nt,n=new nt,i=new nt){super(),this.isCubicBezierCurve=!0,this.type="CubicBezierCurve",this.v0=e,this.v1=t,this.v2=n,this.v3=i}getPoint(e,t=new nt){const n=t,i=this.v0,o=this.v1,l=this.v2,h=this.v3;return n.set(Ip(e,i.x,o.x,l.x,h.x),Ip(e,i.y,o.y,l.y,h.y)),n}copy(e){return super.copy(e),this.v0.copy(e.v0),this.v1.copy(e.v1),this.v2.copy(e.v2),this.v3.copy(e.v3),this}toJSON(){const e=super.toJSON();return e.v0=this.v0.toArray(),e.v1=this.v1.toArray(),e.v2=this.v2.toArray(),e.v3=this.v3.toArray(),e}fromJSON(e){return super.fromJSON(e),this.v0.fromArray(e.v0),this.v1.fromArray(e.v1),this.v2.fromArray(e.v2),this.v3.fromArray(e.v3),this}}class p1 extends Qr{constructor(e=new Z,t=new Z,n=new Z,i=new Z){super(),this.isCubicBezierCurve3=!0,this.type="CubicBezierCurve3",this.v0=e,this.v1=t,this.v2=n,this.v3=i}getPoint(e,t=new Z){const n=t,i=this.v0,o=this.v1,l=this.v2,h=this.v3;return n.set(Ip(e,i.x,o.x,l.x,h.x),Ip(e,i.y,o.y,l.y,h.y),Ip(e,i.z,o.z,l.z,h.z)),n}copy(e){return super.copy(e),this.v0.copy(e.v0),this.v1.copy(e.v1),this.v2.copy(e.v2),this.v3.copy(e.v3),this}toJSON(){const e=super.toJSON();return e.v0=this.v0.toArray(),e.v1=this.v1.toArray(),e.v2=this.v2.toArray(),e.v3=this.v3.toArray(),e}fromJSON(e){return super.fromJSON(e),this.v0.fromArray(e.v0),this.v1.fromArray(e.v1),this.v2.fromArray(e.v2),this.v3.fromArray(e.v3),this}}class jx extends Qr{constructor(e=new nt,t=new nt){super(),this.isLineCurve=!0,this.type="LineCurve",this.v1=e,this.v2=t}getPoint(e,t=new nt){const n=t;return e===1?n.copy(this.v2):(n.copy(this.v2).sub(this.v1),n.multiplyScalar(e).add(this.v1)),n}getPointAt(e,t){return this.getPoint(e,t)}getTangent(e,t=new nt){return t.subVectors(this.v2,this.v1).normalize()}getTangentAt(e,t){return this.getTangent(e,t)}copy(e){return super.copy(e),this.v1.copy(e.v1),this.v2.copy(e.v2),this}toJSON(){const e=super.toJSON();return e.v1=this.v1.toArray(),e.v2=this.v2.toArray(),e}fromJSON(e){return super.fromJSON(e),this.v1.fromArray(e.v1),this.v2.fromArray(e.v2),this}}class m1 extends Qr{constructor(e=new Z,t=new Z){super(),this.isLineCurve3=!0,this.type="LineCurve3",this.v1=e,this.v2=t}getPoint(e,t=new Z){const n=t;return e===1?n.copy(this.v2):(n.copy(this.v2).sub(this.v1),n.multiplyScalar(e).add(this.v1)),n}getPointAt(e,t){return this.getPoint(e,t)}getTangent(e,t=new Z){return t.subVectors(this.v2,this.v1).normalize()}getTangentAt(e,t){return this.getTangent(e,t)}copy(e){return super.copy(e),this.v1.copy(e.v1),this.v2.copy(e.v2),this}toJSON(){const e=super.toJSON();return e.v1=this.v1.toArray(),e.v2=this.v2.toArray(),e}fromJSON(e){return super.fromJSON(e),this.v1.fromArray(e.v1),this.v2.fromArray(e.v2),this}}class Zx extends Qr{constructor(e=new nt,t=new nt,n=new nt){super(),this.isQuadraticBezierCurve=!0,this.type="QuadraticBezierCurve",this.v0=e,this.v1=t,this.v2=n}getPoint(e,t=new nt){const n=t,i=this.v0,o=this.v1,l=this.v2;return n.set(Op(e,i.x,o.x,l.x),Op(e,i.y,o.y,l.y)),n}copy(e){return super.copy(e),this.v0.copy(e.v0),this.v1.copy(e.v1),this.v2.copy(e.v2),this}toJSON(){const e=super.toJSON();return e.v0=this.v0.toArray(),e.v1=this.v1.toArray(),e.v2=this.v2.toArray(),e}fromJSON(e){return super.fromJSON(e),this.v0.fromArray(e.v0),this.v1.fromArray(e.v1),this.v2.fromArray(e.v2),this}}class Qx extends Qr{constructor(e=new Z,t=new Z,n=new Z){super(),this.isQuadraticBezierCurve3=!0,this.type="QuadraticBezierCurve3",this.v0=e,this.v1=t,this.v2=n}getPoint(e,t=new Z){const n=t,i=this.v0,o=this.v1,l=this.v2;return n.set(Op(e,i.x,o.x,l.x),Op(e,i.y,o.y,l.y),Op(e,i.z,o.z,l.z)),n}copy(e){return super.copy(e),this.v0.copy(e.v0),this.v1.copy(e.v1),this.v2.copy(e.v2),this}toJSON(){const e=super.toJSON();return e.v0=this.v0.toArray(),e.v1=this.v1.toArray(),e.v2=this.v2.toArray(),e}fromJSON(e){return super.fromJSON(e),this.v0.fromArray(e.v0),this.v1.fromArray(e.v1),this.v2.fromArray(e.v2),this}}class $x extends Qr{constructor(e=[]){super(),this.isSplineCurve=!0,this.type="SplineCurve",this.points=e}getPoint(e,t=new nt){const n=t,i=this.points,o=(i.length-1)*e,l=Math.floor(o),h=o-l,d=i[l===0?l:l-1],p=i[l],_=i[l>i.length-2?i.length-1:l+1],v=i[l>i.length-3?i.length-1:l+2];return n.set(d1(h,d.x,p.x,_.x,v.x),d1(h,d.y,p.y,_.y,v.y)),n}copy(e){super.copy(e),this.points=[];for(let t=0,n=e.points.length;t<n;t++){const i=e.points[t];this.points.push(i.clone())}return this}toJSON(){const e=super.toJSON();e.points=[];for(let t=0,n=this.points.length;t<n;t++){const i=this.points[t];e.points.push(i.toArray())}return e}fromJSON(e){super.fromJSON(e),this.points=[];for(let t=0,n=e.points.length;t<n;t++){const i=e.points[t];this.points.push(new nt().fromArray(i))}return this}}var bv=Object.freeze({__proto__:null,ArcCurve:f1,CatmullRomCurve3:h1,CubicBezierCurve:Wx,CubicBezierCurve3:p1,EllipseCurve:Sv,LineCurve:jx,LineCurve3:m1,QuadraticBezierCurve:Zx,QuadraticBezierCurve3:Qx,SplineCurve:$x});class g1 extends Qr{constructor(){super(),this.type="CurvePath",this.curves=[],this.autoClose=!1}add(e){this.curves.push(e)}closePath(){const e=this.curves[0].getPoint(0),t=this.curves[this.curves.length-1].getPoint(1);if(!e.equals(t)){const n=e.isVector2===!0?"LineCurve":"LineCurve3";this.curves.push(new bv[n](t,e))}return this}getPoint(e,t){const n=e*this.getLength(),i=this.getCurveLengths();let o=0;for(;o<i.length;){if(i[o]>=n){const l=i[o]-n,h=this.curves[o],d=h.getLength(),p=d===0?0:1-l/d;return h.getPointAt(p,t)}o++}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 n=0,i=this.curves.length;n<i;n++)t+=this.curves[n].getLength(),e.push(t);return this.cacheLengths=e,e}getSpacedPoints(e=40){const t=[];for(let n=0;n<=e;n++)t.push(this.getPoint(n/e));return this.autoClose&&t.push(t[0]),t}getPoints(e=12){const t=[];let n;for(let i=0,o=this.curves;i<o.length;i++){const l=o[i],h=l.isEllipseCurve?e*2:l.isLineCurve||l.isLineCurve3?1:l.isSplineCurve?e*l.points.length:e,d=l.getPoints(h);for(let p=0;p<d.length;p++){const _=d[p];n&&n.equals(_)||(t.push(_),n=_)}}return this.autoClose&&t.length>1&&!t[t.length-1].equals(t[0])&&t.push(t[0]),t}copy(e){super.copy(e),this.curves=[];for(let t=0,n=e.curves.length;t<n;t++){const i=e.curves[t];this.curves.push(i.clone())}return this.autoClose=e.autoClose,this}toJSON(){const e=super.toJSON();e.autoClose=this.autoClose,e.curves=[];for(let t=0,n=this.curves.length;t<n;t++){const i=this.curves[t];e.curves.push(i.toJSON())}return e}fromJSON(e){super.fromJSON(e),this.autoClose=e.autoClose,this.curves=[];for(let t=0,n=e.curves.length;t<n;t++){const i=e.curves[t];this.curves.push(new bv[i.type]().fromJSON(i))}return this}}class Ev extends g1{constructor(e){super(),this.type="Path",this.currentPoint=new nt,e&&this.setFromPoints(e)}setFromPoints(e){this.moveTo(e[0].x,e[0].y);for(let t=1,n=e.length;t<n;t++)this.lineTo(e[t].x,e[t].y);return this}moveTo(e,t){return this.currentPoint.set(e,t),this}lineTo(e,t){const n=new jx(this.currentPoint.clone(),new nt(e,t));return this.curves.push(n),this.currentPoint.set(e,t),this}quadraticCurveTo(e,t,n,i){const o=new Zx(this.currentPoint.clone(),new nt(e,t),new nt(n,i));return this.curves.push(o),this.currentPoint.set(n,i),this}bezierCurveTo(e,t,n,i,o,l){const h=new Wx(this.currentPoint.clone(),new nt(e,t),new nt(n,i),new nt(o,l));return this.curves.push(h),this.currentPoint.set(o,l),this}splineThru(e){const t=[this.currentPoint.clone()].concat(e),n=new $x(t);return this.curves.push(n),this.currentPoint.copy(e[e.length-1]),this}arc(e,t,n,i,o,l){const h=this.currentPoint.x,d=this.currentPoint.y;return this.absarc(e+h,t+d,n,i,o,l),this}absarc(e,t,n,i,o,l){return this.absellipse(e,t,n,n,i,o,l),this}ellipse(e,t,n,i,o,l,h,d){const p=this.currentPoint.x,_=this.currentPoint.y;return this.absellipse(e+p,t+_,n,i,o,l,h,d),this}absellipse(e,t,n,i,o,l,h,d){const p=new Sv(e,t,n,i,o,l,h,d);if(this.curves.length>0){const v=p.getPoint(0);v.equals(this.currentPoint)||this.lineTo(v.x,v.y)}this.curves.push(p);const _=p.getPoint(1);return this.currentPoint.copy(_),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 Ou extends Ev{constructor(e){super(e),this.uuid=Qs(),this.type="Shape",this.holes=[]}getPointsHoles(e){const t=[];for(let n=0,i=this.holes.length;n<i;n++)t[n]=this.holes[n].getPoints(e);return t}extractPoints(e){return{shape:this.getPoints(e),holes:this.getPointsHoles(e)}}copy(e){super.copy(e),this.holes=[];for(let t=0,n=e.holes.length;t<n;t++){const i=e.holes[t];this.holes.push(i.clone())}return this}toJSON(){const e=super.toJSON();e.uuid=this.uuid,e.holes=[];for(let t=0,n=this.holes.length;t<n;t++){const i=this.holes[t];e.holes.push(i.toJSON())}return e}fromJSON(e){super.fromJSON(e),this.uuid=e.uuid,this.holes=[];for(let t=0,n=e.holes.length;t<n;t++){const i=e.holes[t];this.holes.push(new Ev().fromJSON(i))}return this}}function Sw(s,e,t=2){const n=e&&e.length,i=n?e[0]*t:s.length;let o=v1(s,0,i,t,!0);const l=[];if(!o||o.next===o.prev)return l;let h,d,p;if(n&&(o=Cw(s,e,o,t)),s.length>80*t){h=s[0],d=s[1];let _=h,v=d;for(let y=t;y<i;y+=t){const x=s[y],b=s[y+1];x<h&&(h=x),b<d&&(d=b),x>_&&(_=x),b>v&&(v=b)}p=Math.max(_-h,v-d),p=p!==0?32767/p:0}return Fp(o,l,t,h,d,p,0),l}function v1(s,e,t,n,i){let o;if(i===Hw(s,e,t,n)>0)for(let l=e;l<t;l+=n)o=A1(l/n|0,s[l],s[l+1],o);else for(let l=t-n;l>=e;l-=n)o=A1(l/n|0,s[l],s[l+1],o);return o&&Rh(o,o.next)&&(Gp(o),o=o.next),o}function Iu(s,e){if(!s)return s;e||(e=s);let t=s,n;do if(n=!1,!t.steiner&&(Rh(t,t.next)||Ii(t.prev,t,t.next)===0)){if(Gp(t),t=e=t.prev,t===t.next)break;n=!0}else t=t.next;while(n||t!==e);return e}function Fp(s,e,t,n,i,o,l){if(!s)return;!l&&o&&Nw(s,n,i,o);let h=s;for(;s.prev!==s.next;){const d=s.prev,p=s.next;if(o?bw(s,n,i,o):Mw(s)){e.push(d.i,s.i,p.i),Gp(s),s=p.next,h=p.next;continue}if(s=p,s===h){l?l===1?(s=Ew(Iu(s),e),Fp(s,e,t,n,i,o,2)):l===2&&Tw(s,e,t,n,i,o):Fp(Iu(s),e,t,n,i,o,1);break}}}function Mw(s){const e=s.prev,t=s,n=s.next;if(Ii(e,t,n)>=0)return!1;const i=e.x,o=t.x,l=n.x,h=e.y,d=t.y,p=n.y,_=Math.min(i,o,l),v=Math.min(h,d,p),y=Math.max(i,o,l),x=Math.max(h,d,p);let b=n.next;for(;b!==e;){if(b.x>=_&&b.x<=y&&b.y>=v&&b.y<=x&&Hp(i,h,o,d,l,p,b.x,b.y)&&Ii(b.prev,b,b.next)>=0)return!1;b=b.next}return!0}function bw(s,e,t,n){const i=s.prev,o=s,l=s.next;if(Ii(i,o,l)>=0)return!1;const h=i.x,d=o.x,p=l.x,_=i.y,v=o.y,y=l.y,x=Math.min(h,d,p),b=Math.min(_,v,y),R=Math.max(h,d,p),T=Math.max(_,v,y),M=eA(x,b,e,t,n),w=eA(R,T,e,t,n);let D=s.prevZ,N=s.nextZ;for(;D&&D.z>=M&&N&&N.z<=w;){if(D.x>=x&&D.x<=R&&D.y>=b&&D.y<=T&&D!==i&&D!==l&&Hp(h,_,d,v,p,y,D.x,D.y)&&Ii(D.prev,D,D.next)>=0||(D=D.prevZ,N.x>=x&&N.x<=R&&N.y>=b&&N.y<=T&&N!==i&&N!==l&&Hp(h,_,d,v,p,y,N.x,N.y)&&Ii(N.prev,N,N.next)>=0))return!1;N=N.nextZ}for(;D&&D.z>=M;){if(D.x>=x&&D.x<=R&&D.y>=b&&D.y<=T&&D!==i&&D!==l&&Hp(h,_,d,v,p,y,D.x,D.y)&&Ii(D.prev,D,D.next)>=0)return!1;D=D.prevZ}for(;N&&N.z<=w;){if(N.x>=x&&N.x<=R&&N.y>=b&&N.y<=T&&N!==i&&N!==l&&Hp(h,_,d,v,p,y,N.x,N.y)&&Ii(N.prev,N,N.next)>=0)return!1;N=N.nextZ}return!0}function Ew(s,e){let t=s;do{const n=t.prev,i=t.next.next;!Rh(n,i)&&y1(n,t,t.next,i)&&Pp(n,i)&&Pp(i,n)&&(e.push(n.i,t.i,i.i),Gp(t),Gp(t.next),t=s=i),t=t.next}while(t!==s);return Iu(t)}function Tw(s,e,t,n,i,o){let l=s;do{let h=l.next.next;for(;h!==l.prev;){if(l.i!==h.i&&Ow(l,h)){let d=x1(l,h);l=Iu(l,l.next),d=Iu(d,d.next),Fp(l,e,t,n,i,o,0),Fp(d,e,t,n,i,o,0);return}h=h.next}l=l.next}while(l!==s)}function Cw(s,e,t,n){const i=[];for(let o=0,l=e.length;o<l;o++){const h=e[o]*n,d=o<l-1?e[o+1]*n:s.length,p=v1(s,h,d,n,!1);p===p.next&&(p.steiner=!0),i.push(Lw(p))}i.sort(Rw);for(let o=0;o<i.length;o++)t=ww(i[o],t);return t}function Rw(s,e){let t=s.x-e.x;if(t===0&&(t=s.y-e.y,t===0)){const n=(s.next.y-s.y)/(s.next.x-s.x),i=(e.next.y-e.y)/(e.next.x-e.x);t=n-i}return t}function ww(s,e){const t=Bw(s,e);if(!t)return e;const n=x1(t,s);return Iu(n,n.next),Iu(t,t.next)}function Bw(s,e){let t=e;const n=s.x,i=s.y;let o=-1/0,l;if(Rh(s,t))return t;do{if(Rh(s,t.next))return t.next;if(i<=t.y&&i>=t.next.y&&t.next.y!==t.y){const v=t.x+(i-t.y)*(t.next.x-t.x)/(t.next.y-t.y);if(v<=n&&v>o&&(o=v,l=t.x<t.next.x?t:t.next,v===n))return l}t=t.next}while(t!==e);if(!l)return null;const h=l,d=l.x,p=l.y;let _=1/0;t=l;do{if(n>=t.x&&t.x>=d&&n!==t.x&&_1(i<p?n:o,i,d,p,i<p?o:n,i,t.x,t.y)){const v=Math.abs(i-t.y)/(n-t.x);Pp(t,s)&&(v<_||v===_&&(t.x>l.x||t.x===l.x&&Dw(l,t)))&&(l=t,_=v)}t=t.next}while(t!==h);return l}function Dw(s,e){return Ii(s.prev,s,e.prev)<0&&Ii(e.next,s,s.next)<0}function Nw(s,e,t,n){let i=s;do i.z===0&&(i.z=eA(i.x,i.y,e,t,n)),i.prevZ=i.prev,i.nextZ=i.next,i=i.next;while(i!==s);i.prevZ.nextZ=null,i.prevZ=null,Uw(i)}function Uw(s){let e,t=1;do{let n=s,i;s=null;let o=null;for(e=0;n;){e++;let l=n,h=0;for(let p=0;p<t&&(h++,l=l.nextZ,!!l);p++);let d=t;for(;h>0||d>0&&l;)h!==0&&(d===0||!l||n.z<=l.z)?(i=n,n=n.nextZ,h--):(i=l,l=l.nextZ,d--),o?o.nextZ=i:s=i,i.prevZ=o,o=i;n=l}o.nextZ=null,t*=2}while(e>1);return s}function eA(s,e,t,n,i){return s=(s-t)*i|0,e=(e-n)*i|0,s=(s|s<<8)&16711935,s=(s|s<<4)&252645135,s=(s|s<<2)&858993459,s=(s|s<<1)&1431655765,e=(e|e<<8)&16711935,e=(e|e<<4)&252645135,e=(e|e<<2)&858993459,e=(e|e<<1)&1431655765,s|e<<1}function Lw(s){let e=s,t=s;do(e.x<t.x||e.x===t.x&&e.y<t.y)&&(t=e),e=e.next;while(e!==s);return t}function _1(s,e,t,n,i,o,l,h){return(i-l)*(e-h)>=(s-l)*(o-h)&&(s-l)*(n-h)>=(t-l)*(e-h)&&(t-l)*(o-h)>=(i-l)*(n-h)}function Hp(s,e,t,n,i,o,l,h){return!(s===l&&e===h)&&_1(s,e,t,n,i,o,l,h)}function Ow(s,e){return s.next.i!==e.i&&s.prev.i!==e.i&&!Iw(s,e)&&(Pp(s,e)&&Pp(e,s)&&Fw(s,e)&&(Ii(s.prev,s,e.prev)||Ii(s,e.prev,e))||Rh(s,e)&&Ii(s.prev,s,s.next)>0&&Ii(e.prev,e,e.next)>0)}function Ii(s,e,t){return(e.y-s.y)*(t.x-e.x)-(e.x-s.x)*(t.y-e.y)}function Rh(s,e){return s.x===e.x&&s.y===e.y}function y1(s,e,t,n){const i=Cv(Ii(s,e,t)),o=Cv(Ii(s,e,n)),l=Cv(Ii(t,n,s)),h=Cv(Ii(t,n,e));return!!(i!==o&&l!==h||i===0&&Tv(s,t,e)||o===0&&Tv(s,n,e)||l===0&&Tv(t,s,n)||h===0&&Tv(t,e,n))}function Tv(s,e,t){return e.x<=Math.max(s.x,t.x)&&e.x>=Math.min(s.x,t.x)&&e.y<=Math.max(s.y,t.y)&&e.y>=Math.min(s.y,t.y)}function Cv(s){return s>0?1:s<0?-1:0}function Iw(s,e){let t=s;do{if(t.i!==s.i&&t.next.i!==s.i&&t.i!==e.i&&t.next.i!==e.i&&y1(t,t.next,s,e))return!0;t=t.next}while(t!==s);return!1}function Pp(s,e){return Ii(s.prev,s,s.next)<0?Ii(s,e,s.next)>=0&&Ii(s,s.prev,e)>=0:Ii(s,e,s.prev)<0||Ii(s,s.next,e)<0}function Fw(s,e){let t=s,n=!1;const i=(s.x+e.x)/2,o=(s.y+e.y)/2;do t.y>o!=t.next.y>o&&t.next.y!==t.y&&i<(t.next.x-t.x)*(o-t.y)/(t.next.y-t.y)+t.x&&(n=!n),t=t.next;while(t!==s);return n}function x1(s,e){const t=tA(s.i,s.x,s.y),n=tA(e.i,e.x,e.y),i=s.next,o=e.prev;return s.next=e,e.prev=s,t.next=i,i.prev=t,n.next=t,t.prev=n,o.next=n,n.prev=o,n}function A1(s,e,t,n){const i=tA(s,e,t);return n?(i.next=n.next,i.prev=n,n.next.prev=i,n.next=i):(i.prev=i,i.next=i),i}function Gp(s){s.next.prev=s.prev,s.prev.next=s.next,s.prevZ&&(s.prevZ.nextZ=s.nextZ),s.nextZ&&(s.nextZ.prevZ=s.prevZ)}function tA(s,e,t){return{i:s,x:e,y:t,prev:null,next:null,z:0,prevZ:null,nextZ:null,steiner:!1}}function Hw(s,e,t,n){let i=0;for(let o=e,l=t-n;o<t;o+=n)i+=(s[l]-s[o])*(s[o+1]+s[l+1]),l=o;return i}class Pw{static triangulate(e,t,n=2){return Sw(e,t,n)}}class $r{static area(e){const t=e.length;let n=0;for(let i=t-1,o=0;o<t;i=o++)n+=e[i].x*e[o].y-e[o].x*e[i].y;return n*.5}static isClockWise(e){return $r.area(e)<0}static triangulateShape(e,t){const n=[],i=[],o=[];S1(e),M1(n,e);let l=e.length;t.forEach(S1);for(let d=0;d<t.length;d++)i.push(l),l+=t[d].length,M1(n,t[d]);const h=Pw.triangulate(n,i);for(let d=0;d<h.length;d+=3)o.push(h.slice(d,d+3));return o}}function S1(s){const e=s.length;e>2&&s[e-1].equals(s[0])&&s.pop()}function M1(s,e){for(let t=0;t<e.length;t++)s.push(e[t].x),s.push(e[t].y)}class Rv extends pn{constructor(e=new Ou([new nt(.5,.5),new nt(-.5,.5),new nt(-.5,-.5),new nt(.5,-.5)]),t={}){super(),this.type="ExtrudeGeometry",this.parameters={shapes:e,options:t},e=Array.isArray(e)?e:[e];const n=this,i=[],o=[];for(let h=0,d=e.length;h<d;h++){const p=e[h];l(p)}this.setAttribute("position",new Xt(i,3)),this.setAttribute("uv",new Xt(o,2)),this.computeVertexNormals();function l(h){const d=[],p=t.curveSegments!==void 0?t.curveSegments:12,_=t.steps!==void 0?t.steps:1,v=t.depth!==void 0?t.depth:1;let y=t.bevelEnabled!==void 0?t.bevelEnabled:!0,x=t.bevelThickness!==void 0?t.bevelThickness:.2,b=t.bevelSize!==void 0?t.bevelSize:x-.1,R=t.bevelOffset!==void 0?t.bevelOffset:0,T=t.bevelSegments!==void 0?t.bevelSegments:3;const M=t.extrudePath,w=t.UVGenerator!==void 0?t.UVGenerator:Gw;let D,N=!1,H,O,z,V;if(M){D=M.getSpacedPoints(_),N=!0,y=!1;const Ge=M.isCatmullRomCurve3?M.closed:!1;H=M.computeFrenetFrames(_,Ge),O=new Z,z=new Z,V=new Z}y||(T=0,x=0,b=0,R=0);const U=h.extractPoints(p);let F=U.shape;const K=U.holes;if(!$r.isClockWise(F)){F=F.reverse();for(let Ge=0,et=K.length;Ge<et;Ge++){const Je=K[Ge];$r.isClockWise(Je)&&(K[Ge]=Je.reverse())}}function $(Ge){const Je=10000000000000001e-36;let xt=Ge[0];for(let Q=1;Q<=Ge.length;Q++){const Dt=Q%Ge.length,mt=Ge[Dt],Ot=mt.x-xt.x,gt=mt.y-xt.y,j=Ot*Ot+gt*gt,P=Math.max(Math.abs(mt.x),Math.abs(mt.y),Math.abs(xt.x),Math.abs(xt.y)),de=Je*P*P;if(j<=de){Ge.splice(Dt,1),Q--;continue}xt=mt}}$(F),K.forEach($);const ae=K.length,ge=F;for(let Ge=0;Ge<ae;Ge++){const et=K[Ge];F=F.concat(et)}function I(Ge,et,Je){return et||Zt("ExtrudeGeometry: vec does not exist"),Ge.clone().addScaledVector(et,Je)}const W=F.length;function ee(Ge,et,Je){let xt,Q,Dt;const mt=Ge.x-et.x,Ot=Ge.y-et.y,gt=Je.x-Ge.x,j=Je.y-Ge.y,P=mt*mt+Ot*Ot,de=mt*j-Ot*gt;if(Math.abs(de)>Number.EPSILON){const Fe=Math.sqrt(P),ke=Math.sqrt(gt*gt+j*j),Ie=et.x-Ot/Fe,Ft=et.y+mt/Fe,Mt=Je.x-j/ke,Ht=Je.y+gt/ke,zt=((Mt-Ie)*j-(Ht-Ft)*gt)/(mt*j-Ot*gt);xt=Ie+mt*zt-Ge.x,Q=Ft+Ot*zt-Ge.y;const Ye=xt*xt+Q*Q;if(Ye<=2)return new nt(xt,Q);Dt=Math.sqrt(Ye/2)}else{let Fe=!1;mt>Number.EPSILON?gt>Number.EPSILON&&(Fe=!0):mt<-Number.EPSILON?gt<-Number.EPSILON&&(Fe=!0):Math.sign(Ot)===Math.sign(j)&&(Fe=!0),Fe?(xt=-Ot,Q=mt,Dt=Math.sqrt(P)):(xt=mt,Q=Ot,Dt=Math.sqrt(P/2))}return new nt(xt/Dt,Q/Dt)}const ye=[];for(let Ge=0,et=ge.length,Je=et-1,xt=Ge+1;Ge<et;Ge++,Je++,xt++)Je===et&&(Je=0),xt===et&&(xt=0),ye[Ge]=ee(ge[Ge],ge[Je],ge[xt]);const _e=[];let X,te=ye.concat();for(let Ge=0,et=ae;Ge<et;Ge++){const Je=K[Ge];X=[];for(let xt=0,Q=Je.length,Dt=Q-1,mt=xt+1;xt<Q;xt++,Dt++,mt++)Dt===Q&&(Dt=0),mt===Q&&(mt=0),X[xt]=ee(Je[xt],Je[Dt],Je[mt]);_e.push(X),te=te.concat(X)}let le;if(T===0)le=$r.triangulateShape(ge,K);else{const Ge=[],et=[];for(let Je=0;Je<T;Je++){const xt=Je/T,Q=x*Math.cos(xt*Math.PI/2),Dt=b*Math.sin(xt*Math.PI/2)+R;for(let mt=0,Ot=ge.length;mt<Ot;mt++){const gt=I(ge[mt],ye[mt],Dt);Rt(gt.x,gt.y,-Q),xt===0&&Ge.push(gt)}for(let mt=0,Ot=ae;mt<Ot;mt++){const gt=K[mt];X=_e[mt];const j=[];for(let P=0,de=gt.length;P<de;P++){const Fe=I(gt[P],X[P],Dt);Rt(Fe.x,Fe.y,-Q),xt===0&&j.push(Fe)}xt===0&&et.push(j)}}le=$r.triangulateShape(Ge,et)}const ve=le.length,ze=b+R;for(let Ge=0;Ge<W;Ge++){const et=y?I(F[Ge],te[Ge],ze):F[Ge];N?(z.copy(H.normals[0]).multiplyScalar(et.x),O.copy(H.binormals[0]).multiplyScalar(et.y),V.copy(D[0]).add(z).add(O),Rt(V.x,V.y,V.z)):Rt(et.x,et.y,0)}for(let Ge=1;Ge<=_;Ge++)for(let et=0;et<W;et++){const Je=y?I(F[et],te[et],ze):F[et];N?(z.copy(H.normals[Ge]).multiplyScalar(Je.x),O.copy(H.binormals[Ge]).multiplyScalar(Je.y),V.copy(D[Ge]).add(z).add(O),Rt(V.x,V.y,V.z)):Rt(Je.x,Je.y,v/_*Ge)}for(let Ge=T-1;Ge>=0;Ge--){const et=Ge/T,Je=x*Math.cos(et*Math.PI/2),xt=b*Math.sin(et*Math.PI/2)+R;for(let Q=0,Dt=ge.length;Q<Dt;Q++){const mt=I(ge[Q],ye[Q],xt);Rt(mt.x,mt.y,v+Je)}for(let Q=0,Dt=K.length;Q<Dt;Q++){const mt=K[Q];X=_e[Q];for(let Ot=0,gt=mt.length;Ot<gt;Ot++){const j=I(mt[Ot],X[Ot],xt);N?Rt(j.x,j.y+D[_-1].y,D[_-1].x+Je):Rt(j.x,j.y,v+Je)}}}he(),Ee();function he(){const Ge=i.length/3;if(y){let et=0,Je=W*et;for(let xt=0;xt<ve;xt++){const Q=le[xt];Bt(Q[2]+Je,Q[1]+Je,Q[0]+Je)}et=_+T*2,Je=W*et;for(let xt=0;xt<ve;xt++){const Q=le[xt];Bt(Q[0]+Je,Q[1]+Je,Q[2]+Je)}}else{for(let et=0;et<ve;et++){const Je=le[et];Bt(Je[2],Je[1],Je[0])}for(let et=0;et<ve;et++){const Je=le[et];Bt(Je[0]+W*_,Je[1]+W*_,Je[2]+W*_)}}n.addGroup(Ge,i.length/3-Ge,0)}function Ee(){const Ge=i.length/3;let et=0;lt(ge,et),et+=ge.length;for(let Je=0,xt=K.length;Je<xt;Je++){const Q=K[Je];lt(Q,et),et+=Q.length}n.addGroup(Ge,i.length/3-Ge,1)}function lt(Ge,et){let Je=Ge.length;for(;--Je>=0;){const xt=Je;let Q=Je-1;Q<0&&(Q=Ge.length-1);for(let Dt=0,mt=_+T*2;Dt<mt;Dt++){const Ot=W*Dt,gt=W*(Dt+1),j=et+xt+Ot,P=et+Q+Ot,de=et+Q+gt,Fe=et+xt+gt;tn(j,P,de,Fe)}}}function Rt(Ge,et,Je){d.push(Ge),d.push(et),d.push(Je)}function Bt(Ge,et,Je){on(Ge),on(et),on(Je);const xt=i.length/3,Q=w.generateTopUV(n,i,xt-3,xt-2,xt-1);Wt(Q[0]),Wt(Q[1]),Wt(Q[2])}function tn(Ge,et,Je,xt){on(Ge),on(et),on(xt),on(et),on(Je),on(xt);const Q=i.length/3,Dt=w.generateSideWallUV(n,i,Q-6,Q-3,Q-2,Q-1);Wt(Dt[0]),Wt(Dt[1]),Wt(Dt[3]),Wt(Dt[1]),Wt(Dt[2]),Wt(Dt[3])}function on(Ge){i.push(d[Ge*3+0]),i.push(d[Ge*3+1]),i.push(d[Ge*3+2])}function Wt(Ge){o.push(Ge.x),o.push(Ge.y)}}}copy(e){return super.copy(e),this.parameters=Object.assign({},e.parameters),this}toJSON(){const e=super.toJSON(),t=this.parameters.shapes,n=this.parameters.options;return zw(t,n,e)}static fromJSON(e,t){const n=[];for(let o=0,l=e.shapes.length;o<l;o++){const h=t[e.shapes[o]];n.push(h)}const i=e.options.extrudePath;return i!==void 0&&(e.options.extrudePath=new bv[i.type]().fromJSON(i)),new Rv(n,e.options)}}const Gw={generateTopUV:function(s,e,t,n,i){const o=e[t*3],l=e[t*3+1],h=e[n*3],d=e[n*3+1],p=e[i*3],_=e[i*3+1];return[new nt(o,l),new nt(h,d),new nt(p,_)]},generateSideWallUV:function(s,e,t,n,i,o){const l=e[t*3],h=e[t*3+1],d=e[t*3+2],p=e[n*3],_=e[n*3+1],v=e[n*3+2],y=e[i*3],x=e[i*3+1],b=e[i*3+2],R=e[o*3],T=e[o*3+1],M=e[o*3+2];return Math.abs(h-_)<Math.abs(l-p)?[new nt(l,1-d),new nt(p,1-v),new nt(y,1-b),new nt(R,1-M)]:[new nt(h,1-d),new nt(_,1-v),new nt(x,1-b),new nt(T,1-M)]}};function zw(s,e,t){if(t.shapes=[],Array.isArray(s))for(let n=0,i=s.length;n<i;n++){const o=s[n];t.shapes.push(o.uuid)}else t.shapes.push(s.uuid);return t.options=Object.assign({},e),e.extrudePath!==void 0&&(t.options.extrudePath=e.extrudePath.toJSON()),t}class zp extends Sc{constructor(e=1,t=0){const n=(1+Math.sqrt(5))/2,i=[-1,n,0,1,n,0,-1,-n,0,1,-n,0,0,-1,n,0,1,n,0,-1,-n,0,1,-n,n,0,-1,n,0,1,-n,0,-1,-n,0,1],o=[0,11,5,0,5,1,0,1,7,0,7,10,0,10,11,1,5,9,5,11,4,11,10,2,10,7,6,7,1,8,3,9,4,3,4,2,3,2,6,3,6,8,3,8,9,4,9,5,2,4,11,6,2,10,8,6,7,9,8,1];super(i,o,e,t),this.type="IcosahedronGeometry",this.parameters={radius:e,detail:t}}static fromJSON(e){return new zp(e.radius,e.detail)}}class wv extends pn{constructor(e=[new nt(0,-.5),new nt(.5,0),new nt(0,.5)],t=12,n=0,i=Math.PI*2){super(),this.type="LatheGeometry",this.parameters={points:e,segments:t,phiStart:n,phiLength:i},t=Math.floor(t),i=dn(i,0,Math.PI*2);const o=[],l=[],h=[],d=[],p=[],_=1/t,v=new Z,y=new nt,x=new Z,b=new Z,R=new Z;let T=0,M=0;for(let w=0;w<=e.length-1;w++)switch(w){case 0:T=e[w+1].x-e[w].x,M=e[w+1].y-e[w].y,x.x=M*1,x.y=-T,x.z=M*0,R.copy(x),x.normalize(),d.push(x.x,x.y,x.z);break;case e.length-1:d.push(R.x,R.y,R.z);break;default:T=e[w+1].x-e[w].x,M=e[w+1].y-e[w].y,x.x=M*1,x.y=-T,x.z=M*0,b.copy(x),x.x+=R.x,x.y+=R.y,x.z+=R.z,x.normalize(),d.push(x.x,x.y,x.z),R.copy(b)}for(let w=0;w<=t;w++){const D=n+w*_*i,N=Math.sin(D),H=Math.cos(D);for(let O=0;O<=e.length-1;O++){v.x=e[O].x*N,v.y=e[O].y,v.z=e[O].x*H,l.push(v.x,v.y,v.z),y.x=w/t,y.y=O/(e.length-1),h.push(y.x,y.y);const z=d[3*O+0]*N,V=d[3*O+1],U=d[3*O+0]*H;p.push(z,V,U)}}for(let w=0;w<t;w++)for(let D=0;D<e.length-1;D++){const N=D+w*e.length,H=N,O=N+e.length,z=N+e.length+1,V=N+1;o.push(H,O,V),o.push(z,V,O)}this.setIndex(o),this.setAttribute("position",new Xt(l,3)),this.setAttribute("uv",new Xt(h,2)),this.setAttribute("normal",new Xt(p,3))}copy(e){return super.copy(e),this.parameters=Object.assign({},e.parameters),this}static fromJSON(e){return new wv(e.points,e.segments,e.phiStart,e.phiLength)}}class Vp extends Sc{constructor(e=1,t=0){const n=[1,0,0,-1,0,0,0,1,0,0,-1,0,0,0,1,0,0,-1],i=[0,2,4,0,4,3,0,3,5,0,5,2,1,2,5,1,5,3,1,3,4,1,4,2];super(n,i,e,t),this.type="OctahedronGeometry",this.parameters={radius:e,detail:t}}static fromJSON(e){return new Vp(e.radius,e.detail)}}class Mc extends pn{constructor(e=1,t=1,n=1,i=1){super(),this.type="PlaneGeometry",this.parameters={width:e,height:t,widthSegments:n,heightSegments:i};const o=e/2,l=t/2,h=Math.floor(n),d=Math.floor(i),p=h+1,_=d+1,v=e/h,y=t/d,x=[],b=[],R=[],T=[];for(let M=0;M<_;M++){const w=M*y-l;for(let D=0;D<p;D++){const N=D*v-o;b.push(N,-w,0),R.push(0,0,1),T.push(D/h),T.push(1-M/d)}}for(let M=0;M<d;M++)for(let w=0;w<h;w++){const D=w+p*M,N=w+p*(M+1),H=w+1+p*(M+1),O=w+1+p*M;x.push(D,N,O),x.push(N,H,O)}this.setIndex(x),this.setAttribute("position",new Xt(b,3)),this.setAttribute("normal",new Xt(R,3)),this.setAttribute("uv",new Xt(T,2))}copy(e){return super.copy(e),this.parameters=Object.assign({},e.parameters),this}static fromJSON(e){return new Mc(e.width,e.height,e.widthSegments,e.heightSegments)}}class Bv extends pn{constructor(e=.5,t=1,n=32,i=1,o=0,l=Math.PI*2){super(),this.type="RingGeometry",this.parameters={innerRadius:e,outerRadius:t,thetaSegments:n,phiSegments:i,thetaStart:o,thetaLength:l},n=Math.max(3,n),i=Math.max(1,i);const h=[],d=[],p=[],_=[];let v=e;const y=(t-e)/i,x=new Z,b=new nt;for(let R=0;R<=i;R++){for(let T=0;T<=n;T++){const M=o+T/n*l;x.x=v*Math.cos(M),x.y=v*Math.sin(M),d.push(x.x,x.y,x.z),p.push(0,0,1),b.x=(x.x/t+1)/2,b.y=(x.y/t+1)/2,_.push(b.x,b.y)}v+=y}for(let R=0;R<i;R++){const T=R*(n+1);for(let M=0;M<n;M++){const w=M+T,D=w,N=w+n+1,H=w+n+2,O=w+1;h.push(D,N,O),h.push(N,H,O)}}this.setIndex(h),this.setAttribute("position",new Xt(d,3)),this.setAttribute("normal",new Xt(p,3)),this.setAttribute("uv",new Xt(_,2))}copy(e){return super.copy(e),this.parameters=Object.assign({},e.parameters),this}static fromJSON(e){return new Bv(e.innerRadius,e.outerRadius,e.thetaSegments,e.phiSegments,e.thetaStart,e.thetaLength)}}class Dv extends pn{constructor(e=new Ou([new nt(0,.5),new nt(-.5,-.5),new nt(.5,-.5)]),t=12){super(),this.type="ShapeGeometry",this.parameters={shapes:e,curveSegments:t};const n=[],i=[],o=[],l=[];let h=0,d=0;if(Array.isArray(e)===!1)p(e);else for(let _=0;_<e.length;_++)p(e[_]),this.addGroup(h,d,_),h+=d,d=0;this.setIndex(n),this.setAttribute("position",new Xt(i,3)),this.setAttribute("normal",new Xt(o,3)),this.setAttribute("uv",new Xt(l,2));function p(_){const v=i.length/3,y=_.extractPoints(t);let x=y.shape;const b=y.holes;$r.isClockWise(x)===!1&&(x=x.reverse());for(let T=0,M=b.length;T<M;T++){const w=b[T];$r.isClockWise(w)===!0&&(b[T]=w.reverse())}const R=$r.triangulateShape(x,b);for(let T=0,M=b.length;T<M;T++){const w=b[T];x=x.concat(w)}for(let T=0,M=x.length;T<M;T++){const w=x[T];i.push(w.x,w.y,0),o.push(0,0,1),l.push(w.x,w.y)}for(let T=0,M=R.length;T<M;T++){const w=R[T],D=w[0]+v,N=w[1]+v,H=w[2]+v;n.push(D,N,H),d+=3}}}copy(e){return super.copy(e),this.parameters=Object.assign({},e.parameters),this}toJSON(){const e=super.toJSON(),t=this.parameters.shapes;return Vw(t,e)}static fromJSON(e,t){const n=[];for(let i=0,o=e.shapes.length;i<o;i++){const l=t[e.shapes[i]];n.push(l)}return new Dv(n,e.curveSegments)}}function Vw(s,e){if(e.shapes=[],Array.isArray(s))for(let t=0,n=s.length;t<n;t++){const i=s[t];e.shapes.push(i.uuid)}else e.shapes.push(s.uuid);return e}class kp extends pn{constructor(e=1,t=32,n=16,i=0,o=Math.PI*2,l=0,h=Math.PI){super(),this.type="SphereGeometry",this.parameters={radius:e,widthSegments:t,heightSegments:n,phiStart:i,phiLength:o,thetaStart:l,thetaLength:h},t=Math.max(3,Math.floor(t)),n=Math.max(2,Math.floor(n));const d=Math.min(l+h,Math.PI);let p=0;const _=[],v=new Z,y=new Z,x=[],b=[],R=[],T=[];for(let M=0;M<=n;M++){const w=[],D=M/n;let N=0;M===0&&l===0?N=.5/t:M===n&&d===Math.PI&&(N=-.5/t);for(let H=0;H<=t;H++){const O=H/t;v.x=-e*Math.cos(i+O*o)*Math.sin(l+D*h),v.y=e*Math.cos(l+D*h),v.z=e*Math.sin(i+O*o)*Math.sin(l+D*h),b.push(v.x,v.y,v.z),y.copy(v).normalize(),R.push(y.x,y.y,y.z),T.push(O+N,1-D),w.push(p++)}_.push(w)}for(let M=0;M<n;M++)for(let w=0;w<t;w++){const D=_[M][w+1],N=_[M][w],H=_[M+1][w],O=_[M+1][w+1];(M!==0||l>0)&&x.push(D,N,O),(M!==n-1||d<Math.PI)&&x.push(N,H,O)}this.setIndex(x),this.setAttribute("position",new Xt(b,3)),this.setAttribute("normal",new Xt(R,3)),this.setAttribute("uv",new Xt(T,2))}copy(e){return super.copy(e),this.parameters=Object.assign({},e.parameters),this}static fromJSON(e){return new kp(e.radius,e.widthSegments,e.heightSegments,e.phiStart,e.phiLength,e.thetaStart,e.thetaLength)}}class Nv extends Sc{constructor(e=1,t=0){const n=[1,1,1,-1,-1,1,-1,1,-1,1,-1,-1],i=[2,1,0,0,3,2,1,3,0,2,3,1];super(n,i,e,t),this.type="TetrahedronGeometry",this.parameters={radius:e,detail:t}}static fromJSON(e){return new Nv(e.radius,e.detail)}}class Uv extends pn{constructor(e=1,t=.4,n=12,i=48,o=Math.PI*2){super(),this.type="TorusGeometry",this.parameters={radius:e,tube:t,radialSegments:n,tubularSegments:i,arc:o},n=Math.floor(n),i=Math.floor(i);const l=[],h=[],d=[],p=[],_=new Z,v=new Z,y=new Z;for(let x=0;x<=n;x++)for(let b=0;b<=i;b++){const R=b/i*o,T=x/n*Math.PI*2;v.x=(e+t*Math.cos(T))*Math.cos(R),v.y=(e+t*Math.cos(T))*Math.sin(R),v.z=t*Math.sin(T),h.push(v.x,v.y,v.z),_.x=e*Math.cos(R),_.y=e*Math.sin(R),y.subVectors(v,_).normalize(),d.push(y.x,y.y,y.z),p.push(b/i),p.push(x/n)}for(let x=1;x<=n;x++)for(let b=1;b<=i;b++){const R=(i+1)*x+b-1,T=(i+1)*(x-1)+b-1,M=(i+1)*(x-1)+b,w=(i+1)*x+b;l.push(R,T,w),l.push(T,M,w)}this.setIndex(l),this.setAttribute("position",new Xt(h,3)),this.setAttribute("normal",new Xt(d,3)),this.setAttribute("uv",new Xt(p,2))}copy(e){return super.copy(e),this.parameters=Object.assign({},e.parameters),this}static fromJSON(e){return new Uv(e.radius,e.tube,e.radialSegments,e.tubularSegments,e.arc)}}class Lv extends pn{constructor(e=1,t=.4,n=64,i=8,o=2,l=3){super(),this.type="TorusKnotGeometry",this.parameters={radius:e,tube:t,tubularSegments:n,radialSegments:i,p:o,q:l},n=Math.floor(n),i=Math.floor(i);const h=[],d=[],p=[],_=[],v=new Z,y=new Z,x=new Z,b=new Z,R=new Z,T=new Z,M=new Z;for(let D=0;D<=n;++D){const N=D/n*o*Math.PI*2;w(N,o,l,e,x),w(N+.01,o,l,e,b),T.subVectors(b,x),M.addVectors(b,x),R.crossVectors(T,M),M.crossVectors(R,T),R.normalize(),M.normalize();for(let H=0;H<=i;++H){const O=H/i*Math.PI*2,z=-t*Math.cos(O),V=t*Math.sin(O);v.x=x.x+(z*M.x+V*R.x),v.y=x.y+(z*M.y+V*R.y),v.z=x.z+(z*M.z+V*R.z),d.push(v.x,v.y,v.z),y.subVectors(v,x).normalize(),p.push(y.x,y.y,y.z),_.push(D/n),_.push(H/i)}}for(let D=1;D<=n;D++)for(let N=1;N<=i;N++){const H=(i+1)*(D-1)+(N-1),O=(i+1)*D+(N-1),z=(i+1)*D+N,V=(i+1)*(D-1)+N;h.push(H,O,V),h.push(O,z,V)}this.setIndex(h),this.setAttribute("position",new Xt(d,3)),this.setAttribute("normal",new Xt(p,3)),this.setAttribute("uv",new Xt(_,2));function w(D,N,H,O,z){const V=Math.cos(D),U=Math.sin(D),F=H/N*D,K=Math.cos(F);z.x=O*(2+K)*.5*V,z.y=O*(2+K)*U*.5,z.z=O*Math.sin(F)*.5}}copy(e){return super.copy(e),this.parameters=Object.assign({},e.parameters),this}static fromJSON(e){return new Lv(e.radius,e.tube,e.tubularSegments,e.radialSegments,e.p,e.q)}}class Ov extends pn{constructor(e=new Qx(new Z(-1,-1,0),new Z(-1,1,0),new Z(1,1,0)),t=64,n=1,i=8,o=!1){super(),this.type="TubeGeometry",this.parameters={path:e,tubularSegments:t,radius:n,radialSegments:i,closed:o};const l=e.computeFrenetFrames(t,o);this.tangents=l.tangents,this.normals=l.normals,this.binormals=l.binormals;const h=new Z,d=new Z,p=new nt;let _=new Z;const v=[],y=[],x=[],b=[];R(),this.setIndex(b),this.setAttribute("position",new Xt(v,3)),this.setAttribute("normal",new Xt(y,3)),this.setAttribute("uv",new Xt(x,2));function R(){for(let D=0;D<t;D++)T(D);T(o===!1?t:0),w(),M()}function T(D){_=e.getPointAt(D/t,_);const N=l.normals[D],H=l.binormals[D];for(let O=0;O<=i;O++){const z=O/i*Math.PI*2,V=Math.sin(z),U=-Math.cos(z);d.x=U*N.x+V*H.x,d.y=U*N.y+V*H.y,d.z=U*N.z+V*H.z,d.normalize(),y.push(d.x,d.y,d.z),h.x=_.x+n*d.x,h.y=_.y+n*d.y,h.z=_.z+n*d.z,v.push(h.x,h.y,h.z)}}function M(){for(let D=1;D<=t;D++)for(let N=1;N<=i;N++){const H=(i+1)*(D-1)+(N-1),O=(i+1)*D+(N-1),z=(i+1)*D+N,V=(i+1)*(D-1)+N;b.push(H,O,V),b.push(O,z,V)}}function w(){for(let D=0;D<=t;D++)for(let N=0;N<=i;N++)p.x=D/t,p.y=N/i,x.push(p.x,p.y)}}copy(e){return super.copy(e),this.parameters=Object.assign({},e.parameters),this}toJSON(){const e=super.toJSON();return e.path=this.parameters.path.toJSON(),e}static fromJSON(e){return new Ov(new bv[e.path.type]().fromJSON(e.path),e.tubularSegments,e.radius,e.radialSegments,e.closed)}}class b1 extends pn{constructor(e=null){if(super(),this.type="WireframeGeometry",this.parameters={geometry:e},e!==null){const t=[],n=new Set,i=new Z,o=new Z;if(e.index!==null){const l=e.attributes.position,h=e.index;let d=e.groups;d.length===0&&(d=[{start:0,count:h.count,materialIndex:0}]);for(let p=0,_=d.length;p<_;++p){const v=d[p],y=v.start,x=v.count;for(let b=y,R=y+x;b<R;b+=3)for(let T=0;T<3;T++){const M=h.getX(b+T),w=h.getX(b+(T+1)%3);i.fromBufferAttribute(l,M),o.fromBufferAttribute(l,w),E1(i,o,n)===!0&&(t.push(i.x,i.y,i.z),t.push(o.x,o.y,o.z))}}}else{const l=e.attributes.position;for(let h=0,d=l.count/3;h<d;h++)for(let p=0;p<3;p++){const _=3*h+p,v=3*h+(p+1)%3;i.fromBufferAttribute(l,_),o.fromBufferAttribute(l,v),E1(i,o,n)===!0&&(t.push(i.x,i.y,i.z),t.push(o.x,o.y,o.z))}}this.setAttribute("position",new Xt(t,3))}}copy(e){return super.copy(e),this.parameters=Object.assign({},e.parameters),this}}function E1(s,e,t){const n=`${s.x},${s.y},${s.z}-${e.x},${e.y},${e.z}`,i=`${e.x},${e.y},${e.z}-${s.x},${s.y},${s.z}`;return t.has(n)===!0||t.has(i)===!0?!1:(t.add(n),t.add(i),!0)}var T1=Object.freeze({__proto__:null,BoxGeometry:Du,CapsuleGeometry:gv,CircleGeometry:vv,ConeGeometry:Lp,CylinderGeometry:Up,DodecahedronGeometry:_v,EdgesGeometry:u1,ExtrudeGeometry:Rv,IcosahedronGeometry:zp,LatheGeometry:wv,OctahedronGeometry:Vp,PlaneGeometry:Mc,PolyhedronGeometry:Sc,RingGeometry:Bv,ShapeGeometry:Dv,SphereGeometry:kp,TetrahedronGeometry:Nv,TorusGeometry:Uv,TorusKnotGeometry:Lv,TubeGeometry:Ov,WireframeGeometry:b1});class C1 extends Yi{constructor(e){super(),this.isShadowMaterial=!0,this.type="ShadowMaterial",this.color=new Ct(0),this.transparent=!0,this.fog=!0,this.setValues(e)}copy(e){return super.copy(e),this.color.copy(e.color),this.fog=e.fog,this}}class nA extends ms{constructor(e){super(e),this.isRawShaderMaterial=!0,this.type="RawShaderMaterial"}}class Fu extends Yi{constructor(e){super(),this.isMeshStandardMaterial=!0,this.type="MeshStandardMaterial",this.defines={STANDARD:""},this.color=new Ct(16777215),this.roughness=1,this.metalness=0,this.map=null,this.lightMap=null,this.lightMapIntensity=1,this.aoMap=null,this.aoMapIntensity=1,this.emissive=new Ct(0),this.emissiveIntensity=1,this.emissiveMap=null,this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=fc,this.normalScale=new nt(1,1),this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.roughnessMap=null,this.metalnessMap=null,this.alphaMap=null,this.envMap=null,this.envMapRotation=new er,this.envMapIntensity=1,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.defines={STANDARD:""},this.color.copy(e.color),this.roughness=e.roughness,this.metalness=e.metalness,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.roughnessMap=e.roughnessMap,this.metalnessMap=e.metalnessMap,this.alphaMap=e.alphaMap,this.envMap=e.envMap,this.envMapRotation.copy(e.envMapRotation),this.envMapIntensity=e.envMapIntensity,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 Ji extends Fu{constructor(e){super(),this.isMeshPhysicalMaterial=!0,this.defines={STANDARD:"",PHYSICAL:""},this.type="MeshPhysicalMaterial",this.anisotropyRotation=0,this.anisotropyMap=null,this.clearcoatMap=null,this.clearcoatRoughness=0,this.clearcoatRoughnessMap=null,this.clearcoatNormalScale=new nt(1,1),this.clearcoatNormalMap=null,this.ior=1.5,Object.defineProperty(this,"reflectivity",{get:function(){return dn(2.5*(this.ior-1)/(this.ior+1),0,1)},set:function(t){this.ior=(1+.4*t)/(1-.4*t)}}),this.iridescenceMap=null,this.iridescenceIOR=1.3,this.iridescenceThicknessRange=[100,400],this.iridescenceThicknessMap=null,this.sheenColor=new Ct(0),this.sheenColorMap=null,this.sheenRoughness=1,this.sheenRoughnessMap=null,this.transmissionMap=null,this.thickness=0,this.thicknessMap=null,this.attenuationDistance=1/0,this.attenuationColor=new Ct(1,1,1),this.specularIntensity=1,this.specularIntensityMap=null,this.specularColor=new Ct(1,1,1),this.specularColorMap=null,this._anisotropy=0,this._clearcoat=0,this._dispersion=0,this._iridescence=0,this._sheen=0,this._transmission=0,this.setValues(e)}get anisotropy(){return this._anisotropy}set anisotropy(e){this._anisotropy>0!=e>0&&this.version++,this._anisotropy=e}get clearcoat(){return this._clearcoat}set clearcoat(e){this._clearcoat>0!=e>0&&this.version++,this._clearcoat=e}get iridescence(){return this._iridescence}set iridescence(e){this._iridescence>0!=e>0&&this.version++,this._iridescence=e}get dispersion(){return this._dispersion}set dispersion(e){this._dispersion>0!=e>0&&this.version++,this._dispersion=e}get sheen(){return this._sheen}set sheen(e){this._sheen>0!=e>0&&this.version++,this._sheen=e}get transmission(){return this._transmission}set transmission(e){this._transmission>0!=e>0&&this.version++,this._transmission=e}copy(e){return super.copy(e),this.defines={STANDARD:"",PHYSICAL:""},this.anisotropy=e.anisotropy,this.anisotropyRotation=e.anisotropyRotation,this.anisotropyMap=e.anisotropyMap,this.clearcoat=e.clearcoat,this.clearcoatMap=e.clearcoatMap,this.clearcoatRoughness=e.clearcoatRoughness,this.clearcoatRoughnessMap=e.clearcoatRoughnessMap,this.clearcoatNormalMap=e.clearcoatNormalMap,this.clearcoatNormalScale.copy(e.clearcoatNormalScale),this.dispersion=e.dispersion,this.ior=e.ior,this.iridescence=e.iridescence,this.iridescenceMap=e.iridescenceMap,this.iridescenceIOR=e.iridescenceIOR,this.iridescenceThicknessRange=[...e.iridescenceThicknessRange],this.iridescenceThicknessMap=e.iridescenceThicknessMap,this.sheen=e.sheen,this.sheenColor.copy(e.sheenColor),this.sheenColorMap=e.sheenColorMap,this.sheenRoughness=e.sheenRoughness,this.sheenRoughnessMap=e.sheenRoughnessMap,this.transmission=e.transmission,this.transmissionMap=e.transmissionMap,this.thickness=e.thickness,this.thicknessMap=e.thicknessMap,this.attenuationDistance=e.attenuationDistance,this.attenuationColor.copy(e.attenuationColor),this.specularIntensity=e.specularIntensity,this.specularIntensityMap=e.specularIntensityMap,this.specularColor.copy(e.specularColor),this.specularColorMap=e.specularColorMap,this}}class R1 extends Yi{constructor(e){super(),this.isMeshPhongMaterial=!0,this.type="MeshPhongMaterial",this.color=new Ct(16777215),this.specular=new Ct(1118481),this.shininess=30,this.map=null,this.lightMap=null,this.lightMapIntensity=1,this.aoMap=null,this.aoMapIntensity=1,this.emissive=new Ct(0),this.emissiveIntensity=1,this.emissiveMap=null,this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=fc,this.normalScale=new nt(1,1),this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.specularMap=null,this.alphaMap=null,this.envMap=null,this.envMapRotation=new er,this.combine=$d,this.reflectivity=1,this.refractionRatio=.98,this.wireframe=!1,this.wireframeLinewidth=1,this.wireframeLinecap="round",this.wireframeLinejoin="round",this.flatShading=!1,this.fog=!0,this.setValues(e)}copy(e){return super.copy(e),this.color.copy(e.color),this.specular.copy(e.specular),this.shininess=e.shininess,this.map=e.map,this.lightMap=e.lightMap,this.lightMapIntensity=e.lightMapIntensity,this.aoMap=e.aoMap,this.aoMapIntensity=e.aoMapIntensity,this.emissive.copy(e.emissive),this.emissiveMap=e.emissiveMap,this.emissiveIntensity=e.emissiveIntensity,this.bumpMap=e.bumpMap,this.bumpScale=e.bumpScale,this.normalMap=e.normalMap,this.normalMapType=e.normalMapType,this.normalScale.copy(e.normalScale),this.displacementMap=e.displacementMap,this.displacementScale=e.displacementScale,this.displacementBias=e.displacementBias,this.specularMap=e.specularMap,this.alphaMap=e.alphaMap,this.envMap=e.envMap,this.envMapRotation.copy(e.envMapRotation),this.combine=e.combine,this.reflectivity=e.reflectivity,this.refractionRatio=e.refractionRatio,this.wireframe=e.wireframe,this.wireframeLinewidth=e.wireframeLinewidth,this.wireframeLinecap=e.wireframeLinecap,this.wireframeLinejoin=e.wireframeLinejoin,this.flatShading=e.flatShading,this.fog=e.fog,this}}class w1 extends Yi{constructor(e){super(),this.isMeshToonMaterial=!0,this.defines={TOON:""},this.type="MeshToonMaterial",this.color=new Ct(16777215),this.map=null,this.gradientMap=null,this.lightMap=null,this.lightMapIntensity=1,this.aoMap=null,this.aoMapIntensity=1,this.emissive=new Ct(0),this.emissiveIntensity=1,this.emissiveMap=null,this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=fc,this.normalScale=new nt(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 B1 extends Yi{constructor(e){super(),this.isMeshNormalMaterial=!0,this.type="MeshNormalMaterial",this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=fc,this.normalScale=new nt(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 D1 extends Yi{constructor(e){super(),this.isMeshLambertMaterial=!0,this.type="MeshLambertMaterial",this.color=new Ct(16777215),this.map=null,this.lightMap=null,this.lightMapIntensity=1,this.aoMap=null,this.aoMapIntensity=1,this.emissive=new Ct(0),this.emissiveIntensity=1,this.emissiveMap=null,this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=fc,this.normalScale=new nt(1,1),this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.specularMap=null,this.alphaMap=null,this.envMap=null,this.envMapRotation=new er,this.combine=$d,this.reflectivity=1,this.refractionRatio=.98,this.wireframe=!1,this.wireframeLinewidth=1,this.wireframeLinecap="round",this.wireframeLinejoin="round",this.flatShading=!1,this.fog=!0,this.setValues(e)}copy(e){return super.copy(e),this.color.copy(e.color),this.map=e.map,this.lightMap=e.lightMap,this.lightMapIntensity=e.lightMapIntensity,this.aoMap=e.aoMap,this.aoMapIntensity=e.aoMapIntensity,this.emissive.copy(e.emissive),this.emissiveMap=e.emissiveMap,this.emissiveIntensity=e.emissiveIntensity,this.bumpMap=e.bumpMap,this.bumpScale=e.bumpScale,this.normalMap=e.normalMap,this.normalMapType=e.normalMapType,this.normalScale.copy(e.normalScale),this.displacementMap=e.displacementMap,this.displacementScale=e.displacementScale,this.displacementBias=e.displacementBias,this.specularMap=e.specularMap,this.alphaMap=e.alphaMap,this.envMap=e.envMap,this.envMapRotation.copy(e.envMapRotation),this.combine=e.combine,this.reflectivity=e.reflectivity,this.refractionRatio=e.refractionRatio,this.wireframe=e.wireframe,this.wireframeLinewidth=e.wireframeLinewidth,this.wireframeLinecap=e.wireframeLinecap,this.wireframeLinejoin=e.wireframeLinejoin,this.flatShading=e.flatShading,this.fog=e.fog,this}}class iA extends Yi{constructor(e){super(),this.isMeshDepthMaterial=!0,this.type="MeshDepthMaterial",this.depthPacking=sb,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 aA extends Yi{constructor(e){super(),this.isMeshDistanceMaterial=!0,this.type="MeshDistanceMaterial",this.map=null,this.alphaMap=null,this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.setValues(e)}copy(e){return super.copy(e),this.map=e.map,this.alphaMap=e.alphaMap,this.displacementMap=e.displacementMap,this.displacementScale=e.displacementScale,this.displacementBias=e.displacementBias,this}}class N1 extends Yi{constructor(e){super(),this.isMeshMatcapMaterial=!0,this.defines={MATCAP:""},this.type="MeshMatcapMaterial",this.color=new Ct(16777215),this.matcap=null,this.map=null,this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=fc,this.normalScale=new nt(1,1),this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.alphaMap=null,this.wireframe=!1,this.wireframeLinewidth=1,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.wireframe=e.wireframe,this.wireframeLinewidth=e.wireframeLinewidth,this.flatShading=e.flatShading,this.fog=e.fog,this}}class U1 extends za{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 Hu(s,e){return!s||s.constructor===e?s:typeof e.BYTES_PER_ELEMENT=="number"?new e(s):Array.prototype.slice.call(s)}function L1(s){function e(i,o){return s[i]-s[o]}const t=s.length,n=new Array(t);for(let i=0;i!==t;++i)n[i]=i;return n.sort(e),n}function sA(s,e,t){const n=s.length,i=new s.constructor(n);for(let o=0,l=0;l!==n;++o){const h=t[o]*e;for(let d=0;d!==e;++d)i[l++]=s[h+d]}return i}function rA(s,e,t,n){let i=1,o=s[0];for(;o!==void 0&&o[n]===void 0;)o=s[i++];if(o===void 0)return;let l=o[n];if(l!==void 0)if(Array.isArray(l))do l=o[n],l!==void 0&&(e.push(o.time),t.push(...l)),o=s[i++];while(o!==void 0);else if(l.toArray!==void 0)do l=o[n],l!==void 0&&(e.push(o.time),l.toArray(t,t.length)),o=s[i++];while(o!==void 0);else do l=o[n],l!==void 0&&(e.push(o.time),t.push(l)),o=s[i++];while(o!==void 0)}function kw(s,e,t,n,i=30){const o=s.clone();o.name=e;const l=[];for(let d=0;d<o.tracks.length;++d){const p=o.tracks[d],_=p.getValueSize(),v=[],y=[];for(let x=0;x<p.times.length;++x){const b=p.times[x]*i;if(!(b<t||b>=n)){v.push(p.times[x]);for(let R=0;R<_;++R)y.push(p.values[x*_+R])}}v.length!==0&&(p.times=Hu(v,p.times.constructor),p.values=Hu(y,p.values.constructor),l.push(p))}o.tracks=l;let h=1/0;for(let d=0;d<o.tracks.length;++d)h>o.tracks[d].times[0]&&(h=o.tracks[d].times[0]);for(let d=0;d<o.tracks.length;++d)o.tracks[d].shift(-1*h);return o.resetDuration(),o}function Xw(s,e=0,t=s,n=30){n<=0&&(n=30);const i=t.tracks.length,o=e/n;for(let l=0;l<i;++l){const h=t.tracks[l],d=h.ValueTypeName;if(d==="bool"||d==="string")continue;const p=s.tracks.find(function(M){return M.name===h.name&&M.ValueTypeName===d});if(p===void 0)continue;let _=0;const v=h.getValueSize();h.createInterpolant.isInterpolantFactoryMethodGLTFCubicSpline&&(_=v/3);let y=0;const x=p.getValueSize();p.createInterpolant.isInterpolantFactoryMethodGLTFCubicSpline&&(y=x/3);const b=h.times.length-1;let R;if(o<=h.times[0]){const M=_,w=v-_;R=h.values.slice(M,w)}else if(o>=h.times[b]){const M=b*v+_,w=M+v-_;R=h.values.slice(M,w)}else{const M=h.createInterpolant(),w=_,D=v-_;M.evaluate(o),R=M.resultBuffer.slice(w,D)}d==="quaternion"&&new Ca().fromArray(R).normalize().conjugate().toArray(R);const T=p.times.length;for(let M=0;M<T;++M){const w=M*x+y;if(d==="quaternion")Ca.multiplyQuaternionsFlat(p.values,w,R,0,p.values,w);else{const D=x-y*2;for(let N=0;N<D;++N)p.values[w+N]-=R[N]}}}return s.blendMode=rx,s}class Yw{static convertArray(e,t){return Hu(e,t)}static isTypedArray(e){return pb(e)}static getKeyframeOrder(e){return L1(e)}static sortedArray(e,t,n){return sA(e,t,n)}static flattenJSON(e,t,n,i){rA(e,t,n,i)}static subclip(e,t,n,i,o=30){return kw(e,t,n,i,o)}static makeClipAdditive(e,t=0,n=e,i=30){return Xw(e,t,n,i)}}class Pu{constructor(e,t,n,i){this.parameterPositions=e,this._cachedIndex=0,this.resultBuffer=i!==void 0?i:new t.constructor(n),this.sampleValues=t,this.valueSize=n,this.settings=null,this.DefaultSettings_={}}evaluate(e){const t=this.parameterPositions;let n=this._cachedIndex,i=t[n],o=t[n-1];e:{t:{let l;n:{i:if(!(e<i)){for(let h=n+2;;){if(i===void 0){if(e<o)break i;return n=t.length,this._cachedIndex=n,this.copySampleValue_(n-1)}if(n===h)break;if(o=i,i=t[++n],e<i)break t}l=t.length;break n}if(!(e>=o)){const h=t[1];e<h&&(n=2,o=h);for(let d=n-2;;){if(o===void 0)return this._cachedIndex=0,this.copySampleValue_(0);if(n===d)break;if(i=o,o=t[--n-1],e>=o)break t}l=n,n=0;break n}break e}for(;n<l;){const h=n+l>>>1;e<t[h]?l=h:n=h+1}if(i=t[n],o=t[n-1],o===void 0)return this._cachedIndex=0,this.copySampleValue_(0);if(i===void 0)return n=t.length,this._cachedIndex=n,this.copySampleValue_(n-1)}this._cachedIndex=n,this.intervalChanged_(n,o,i)}return this.interpolate_(n,o,e,i)}getSettings_(){return this.settings||this.DefaultSettings_}copySampleValue_(e){const t=this.resultBuffer,n=this.sampleValues,i=this.valueSize,o=e*i;for(let l=0;l!==i;++l)t[l]=n[o+l];return t}interpolate_(){throw new Error("call to abstract method")}intervalChanged_(){}}class O1 extends Pu{constructor(e,t,n,i){super(e,t,n,i),this._weightPrev=-0,this._offsetPrev=-0,this._weightNext=-0,this._offsetNext=-0,this.DefaultSettings_={endingStart:Su,endingEnd:Su}}intervalChanged_(e,t,n){const i=this.parameterPositions;let o=e-2,l=e+1,h=i[o],d=i[l];if(h===void 0)switch(this.getSettings_().endingStart){case Mu:o=e,h=2*t-n;break;case up:o=i.length-2,h=t+i[o]-i[o+1];break;default:o=e,h=n}if(d===void 0)switch(this.getSettings_().endingEnd){case Mu:l=e,d=2*n-t;break;case up:l=1,d=n+i[1]-i[0];break;default:l=e-1,d=t}const p=(n-t)*.5,_=this.valueSize;this._weightPrev=p/(t-h),this._weightNext=p/(d-n),this._offsetPrev=o*_,this._offsetNext=l*_}interpolate_(e,t,n,i){const o=this.resultBuffer,l=this.sampleValues,h=this.valueSize,d=e*h,p=d-h,_=this._offsetPrev,v=this._offsetNext,y=this._weightPrev,x=this._weightNext,b=(n-t)/(i-t),R=b*b,T=R*b,M=-y*T+2*y*R-y*b,w=(1+y)*T+(-1.5-2*y)*R+(-.5+y)*b+1,D=(-1-x)*T+(1.5+x)*R+.5*b,N=x*T-x*R;for(let H=0;H!==h;++H)o[H]=M*l[_+H]+w*l[p+H]+D*l[d+H]+N*l[v+H];return o}}class oA extends Pu{constructor(e,t,n,i){super(e,t,n,i)}interpolate_(e,t,n,i){const o=this.resultBuffer,l=this.sampleValues,h=this.valueSize,d=e*h,p=d-h,_=(n-t)/(i-t),v=1-_;for(let y=0;y!==h;++y)o[y]=l[p+y]*v+l[d+y]*_;return o}}class I1 extends Pu{constructor(e,t,n,i){super(e,t,n,i)}interpolate_(e){return this.copySampleValue_(e-1)}}class xr{constructor(e,t,n,i){if(e===void 0)throw new Error("THREE.KeyframeTrack: track name is undefined");if(t===void 0||t.length===0)throw new Error("THREE.KeyframeTrack: no keyframes in track named "+e);this.name=e,this.times=Hu(t,this.TimeBufferType),this.values=Hu(n,this.ValueBufferType),this.setInterpolation(i||this.DefaultInterpolation)}static toJSON(e){const t=e.constructor;let n;if(t.toJSON!==this.toJSON)n=t.toJSON(e);else{n={name:e.name,times:Hu(e.times,Array),values:Hu(e.values,Array)};const i=e.getInterpolation();i!==e.DefaultInterpolation&&(n.interpolation=i)}return n.type=e.ValueTypeName,n}InterpolantFactoryMethodDiscrete(e){return new I1(this.times,this.values,this.getValueSize(),e)}InterpolantFactoryMethodLinear(e){return new oA(this.times,this.values,this.getValueSize(),e)}InterpolantFactoryMethodSmooth(e){return new O1(this.times,this.values,this.getValueSize(),e)}setInterpolation(e){let t;switch(e){case Au:t=this.InterpolantFactoryMethodDiscrete;break;case uc:t=this.InterpolantFactoryMethodLinear;break;case A0:t=this.InterpolantFactoryMethodSmooth;break}if(t===void 0){const n="unsupported interpolation for "+this.ValueTypeName+" keyframe track named "+this.name;if(this.createInterpolant===void 0)if(e!==this.DefaultInterpolation)this.setInterpolation(this.DefaultInterpolation);else throw new Error(n);return Ut("KeyframeTrack:",n),this}return this.createInterpolant=t,this}getInterpolation(){switch(this.createInterpolant){case this.InterpolantFactoryMethodDiscrete:return Au;case this.InterpolantFactoryMethodLinear:return uc;case this.InterpolantFactoryMethodSmooth:return A0}}getValueSize(){return this.values.length/this.times.length}shift(e){if(e!==0){const t=this.times;for(let n=0,i=t.length;n!==i;++n)t[n]+=e}return this}scale(e){if(e!==1){const t=this.times;for(let n=0,i=t.length;n!==i;++n)t[n]*=e}return this}trim(e,t){const n=this.times,i=n.length;let o=0,l=i-1;for(;o!==i&&n[o]<e;)++o;for(;l!==-1&&n[l]>t;)--l;if(++l,o!==0||l!==i){o>=l&&(l=Math.max(l,1),o=l-1);const h=this.getValueSize();this.times=n.slice(o,l),this.values=this.values.slice(o*h,l*h)}return this}validate(){let e=!0;const t=this.getValueSize();t-Math.floor(t)!==0&&(Zt("KeyframeTrack: Invalid value size in track.",this),e=!1);const n=this.times,i=this.values,o=n.length;o===0&&(Zt("KeyframeTrack: Track is empty.",this),e=!1);let l=null;for(let h=0;h!==o;h++){const d=n[h];if(typeof d=="number"&&isNaN(d)){Zt("KeyframeTrack: Time is not a valid number.",this,h,d),e=!1;break}if(l!==null&&l>d){Zt("KeyframeTrack: Out of order keys.",this,h,d,l),e=!1;break}l=d}if(i!==void 0&&pb(i))for(let h=0,d=i.length;h!==d;++h){const p=i[h];if(isNaN(p)){Zt("KeyframeTrack: Value is not a valid number.",this,h,p),e=!1;break}}return e}optimize(){const e=this.times.slice(),t=this.values.slice(),n=this.getValueSize(),i=this.getInterpolation()===A0,o=e.length-1;let l=1;for(let h=1;h<o;++h){let d=!1;const p=e[h],_=e[h+1];if(p!==_&&(h!==1||p!==e[0]))if(i)d=!0;else{const v=h*n,y=v-n,x=v+n;for(let b=0;b!==n;++b){const R=t[v+b];if(R!==t[y+b]||R!==t[x+b]){d=!0;break}}}if(d){if(h!==l){e[l]=e[h];const v=h*n,y=l*n;for(let x=0;x!==n;++x)t[y+x]=t[v+x]}++l}}if(o>0){e[l]=e[o];for(let h=o*n,d=l*n,p=0;p!==n;++p)t[d+p]=t[h+p];++l}return l!==e.length?(this.times=e.slice(0,l),this.values=t.slice(0,l*n)):(this.times=e,this.values=t),this}clone(){const e=this.times.slice(),t=this.values.slice(),n=this.constructor,i=new n(this.name,e,t);return i.createInterpolant=this.createInterpolant,i}}xr.prototype.ValueTypeName="",xr.prototype.TimeBufferType=Float32Array,xr.prototype.ValueBufferType=Float32Array,xr.prototype.DefaultInterpolation=uc;class Gu extends xr{constructor(e,t,n){super(e,t,n)}}Gu.prototype.ValueTypeName="bool",Gu.prototype.ValueBufferType=Array,Gu.prototype.DefaultInterpolation=Au,Gu.prototype.InterpolantFactoryMethodLinear=void 0,Gu.prototype.InterpolantFactoryMethodSmooth=void 0;class lA extends xr{constructor(e,t,n,i){super(e,t,n,i)}}lA.prototype.ValueTypeName="color";class Sl extends xr{constructor(e,t,n,i){super(e,t,n,i)}}Sl.prototype.ValueTypeName="number";class F1 extends Pu{constructor(e,t,n,i){super(e,t,n,i)}interpolate_(e,t,n,i){const o=this.resultBuffer,l=this.sampleValues,h=this.valueSize,d=(n-t)/(i-t);let p=e*h;for(let _=p+h;p!==_;p+=4)Ca.slerpFlat(o,0,l,p-h,l,p,d);return o}}class Ml extends xr{constructor(e,t,n,i){super(e,t,n,i)}InterpolantFactoryMethodLinear(e){return new F1(this.times,this.values,this.getValueSize(),e)}}Ml.prototype.ValueTypeName="quaternion",Ml.prototype.InterpolantFactoryMethodSmooth=void 0;class zu extends xr{constructor(e,t,n){super(e,t,n)}}zu.prototype.ValueTypeName="string",zu.prototype.ValueBufferType=Array,zu.prototype.DefaultInterpolation=Au,zu.prototype.InterpolantFactoryMethodLinear=void 0,zu.prototype.InterpolantFactoryMethodSmooth=void 0;class bl extends xr{constructor(e,t,n,i){super(e,t,n,i)}}bl.prototype.ValueTypeName="vector";class Vu{constructor(e="",t=-1,n=[],i=S0){this.name=e,this.tracks=n,this.duration=t,this.blendMode=i,this.uuid=Qs(),this.userData={},this.duration<0&&this.resetDuration()}static parse(e){const t=[],n=e.tracks,i=1/(e.fps||1);for(let l=0,h=n.length;l!==h;++l)t.push(qw(n[l]).scale(i));const o=new this(e.name,e.duration,t,e.blendMode);return o.uuid=e.uuid,o.userData=JSON.parse(e.userData||"{}"),o}static toJSON(e){const t=[],n=e.tracks,i={name:e.name,duration:e.duration,tracks:t,uuid:e.uuid,blendMode:e.blendMode,userData:JSON.stringify(e.userData)};for(let o=0,l=n.length;o!==l;++o)t.push(xr.toJSON(n[o]));return i}static CreateFromMorphTargetSequence(e,t,n,i){const o=t.length,l=[];for(let h=0;h<o;h++){let d=[],p=[];d.push((h+o-1)%o,h,(h+1)%o),p.push(0,1,0);const _=L1(d);d=sA(d,1,_),p=sA(p,1,_),!i&&d[0]===0&&(d.push(o),p.push(p[0])),l.push(new Sl(".morphTargetInfluences["+t[h].name+"]",d,p).scale(1/n))}return new this(e,-1,l)}static findByName(e,t){let n=e;if(!Array.isArray(e)){const i=e;n=i.geometry&&i.geometry.animations||i.animations}for(let i=0;i<n.length;i++)if(n[i].name===t)return n[i];return null}static CreateClipsFromMorphTargetSequences(e,t,n){const i={},o=/^([\w-]*?)([\d]+)$/;for(let h=0,d=e.length;h<d;h++){const p=e[h],_=p.name.match(o);if(_&&_.length>1){const v=_[1];let y=i[v];y||(i[v]=y=[]),y.push(p)}}const l=[];for(const h in i)l.push(this.CreateFromMorphTargetSequence(h,i[h],t,n));return l}static parseAnimation(e,t){if(Ut("AnimationClip: parseAnimation() is deprecated and will be removed with r185"),!e)return Zt("AnimationClip: No animation in JSONLoader data."),null;const n=function(v,y,x,b,R){if(x.length!==0){const T=[],M=[];rA(x,T,M,b),T.length!==0&&R.push(new v(y,T,M))}},i=[],o=e.name||"default",l=e.fps||30,h=e.blendMode;let d=e.length||-1;const p=e.hierarchy||[];for(let v=0;v<p.length;v++){const y=p[v].keys;if(!(!y||y.length===0))if(y[0].morphTargets){const x={};let b;for(b=0;b<y.length;b++)if(y[b].morphTargets)for(let R=0;R<y[b].morphTargets.length;R++)x[y[b].morphTargets[R]]=-1;for(const R in x){const T=[],M=[];for(let w=0;w!==y[b].morphTargets.length;++w){const D=y[b];T.push(D.time),M.push(D.morphTarget===R?1:0)}i.push(new Sl(".morphTargetInfluence["+R+"]",T,M))}d=x.length*l}else{const x=".bones["+t[v].name+"]";n(bl,x+".position",y,"pos",i),n(Ml,x+".quaternion",y,"rot",i),n(bl,x+".scale",y,"scl",i)}}return i.length===0?null:new this(o,d,i,h)}resetDuration(){const e=this.tracks;let t=0;for(let n=0,i=e.length;n!==i;++n){const o=this.tracks[n];t=Math.max(t,o.times[o.times.length-1])}return this.duration=t,this}trim(){for(let e=0;e<this.tracks.length;e++)this.tracks[e].trim(0,this.duration);return this}validate(){let e=!0;for(let t=0;t<this.tracks.length;t++)e=e&&this.tracks[t].validate();return e}optimize(){for(let e=0;e<this.tracks.length;e++)this.tracks[e].optimize();return this}clone(){const e=[];for(let n=0;n<this.tracks.length;n++)e.push(this.tracks[n].clone());const t=new this.constructor(this.name,this.duration,e,this.blendMode);return t.userData=JSON.parse(JSON.stringify(this.userData)),t}toJSON(){return this.constructor.toJSON(this)}}function Jw(s){switch(s.toLowerCase()){case"scalar":case"double":case"float":case"number":case"integer":return Sl;case"vector":case"vector2":case"vector3":case"vector4":return bl;case"color":return lA;case"quaternion":return Ml;case"bool":case"boolean":return Gu;case"string":return zu}throw new Error("THREE.KeyframeTrack: Unsupported typeName: "+s)}function qw(s){if(s.type===void 0)throw new Error("THREE.KeyframeTrack: track type undefined, can not parse");const e=Jw(s.type);if(s.times===void 0){const t=[],n=[];rA(s.keys,t,n,"value"),s.times=t,s.values=n}return e.parse!==void 0?e.parse(s):new e(s.name,s.times,s.values,s.interpolation)}const Bo={enabled:!1,files:{},add:function(s,e){this.enabled!==!1&&(this.files[s]=e)},get:function(s){if(this.enabled!==!1)return this.files[s]},remove:function(s){delete this.files[s]},clear:function(){this.files={}}};class Iv{constructor(e,t,n){const i=this;let o=!1,l=0,h=0,d;const p=[];this.onStart=void 0,this.onLoad=e,this.onProgress=t,this.onError=n,this._abortController=null,this.itemStart=function(_){h++,o===!1&&i.onStart!==void 0&&i.onStart(_,l,h),o=!0},this.itemEnd=function(_){l++,i.onProgress!==void 0&&i.onProgress(_,l,h),l===h&&(o=!1,i.onLoad!==void 0&&i.onLoad())},this.itemError=function(_){i.onError!==void 0&&i.onError(_)},this.resolveURL=function(_){return d?d(_):_},this.setURLModifier=function(_){return d=_,this},this.addHandler=function(_,v){return p.push(_,v),this},this.removeHandler=function(_){const v=p.indexOf(_);return v!==-1&&p.splice(v,2),this},this.getHandler=function(_){for(let v=0,y=p.length;v<y;v+=2){const x=p[v],b=p[v+1];if(x.global&&(x.lastIndex=0),x.test(_))return b}return null},this.abort=function(){return this.abortController.abort(),this._abortController=null,this}}get abortController(){return this._abortController||(this._abortController=new AbortController),this._abortController}}const H1=new Iv;class Ba{constructor(e){this.manager=e!==void 0?e:H1,this.crossOrigin="anonymous",this.withCredentials=!1,this.path="",this.resourcePath="",this.requestHeader={}}load(){}loadAsync(e,t){const n=this;return new Promise(function(i,o){n.load(e,i,t,o)})}parse(){}setCrossOrigin(e){return this.crossOrigin=e,this}setWithCredentials(e){return this.withCredentials=e,this}setPath(e){return this.path=e,this}setResourcePath(e){return this.resourcePath=e,this}setRequestHeader(e){return this.requestHeader=e,this}abort(){return this}}Ba.DEFAULT_MATERIAL_NAME="__DEFAULT";const El={};class Kw extends Error{constructor(e,t){super(e),this.response=t}}class da extends Ba{constructor(e){super(e),this.mimeType="",this.responseType="",this._abortController=new AbortController}load(e,t,n,i){e===void 0&&(e=""),this.path!==void 0&&(e=this.path+e),e=this.manager.resolveURL(e);const o=Bo.get(`file:${e}`);if(o!==void 0)return this.manager.itemStart(e),setTimeout(()=>{t&&t(o),this.manager.itemEnd(e)},0),o;if(El[e]!==void 0){El[e].push({onLoad:t,onProgress:n,onError:i});return}El[e]=[],El[e].push({onLoad:t,onProgress:n,onError:i});const l=new Request(e,{headers:new Headers(this.requestHeader),credentials:this.withCredentials?"include":"same-origin",signal:typeof AbortSignal.any=="function"?AbortSignal.any([this._abortController.signal,this.manager.abortController.signal]):this._abortController.signal}),h=this.mimeType,d=this.responseType;fetch(l).then(p=>{if(p.status===200||p.status===0){if(p.status===0&&Ut("FileLoader: HTTP Status 0 received."),typeof ReadableStream>"u"||p.body===void 0||p.body.getReader===void 0)return p;const _=El[e],v=p.body.getReader(),y=p.headers.get("X-File-Size")||p.headers.get("Content-Length"),x=y?parseInt(y):0,b=x!==0;let R=0;const T=new ReadableStream({start(M){w();function w(){v.read().then(({done:D,value:N})=>{if(D)M.close();else{R+=N.byteLength;const H=new ProgressEvent("progress",{lengthComputable:b,loaded:R,total:x});for(let O=0,z=_.length;O<z;O++){const V=_[O];V.onProgress&&V.onProgress(H)}M.enqueue(N),w()}},D=>{M.error(D)})}}});return new Response(T)}else throw new Kw(`fetch for "${p.url}" responded with ${p.status}: ${p.statusText}`,p)}).then(p=>{switch(d){case"arraybuffer":return p.arrayBuffer();case"blob":return p.blob();case"document":return p.text().then(_=>new DOMParser().parseFromString(_,h));case"json":return p.json();default:if(h==="")return p.text();{const v=/charset="?([^;"\s]*)"?/i.exec(h),y=v&&v[1]?v[1].toLowerCase():void 0,x=new TextDecoder(y);return p.arrayBuffer().then(b=>x.decode(b))}}}).then(p=>{Bo.add(`file:${e}`,p);const _=El[e];delete El[e];for(let v=0,y=_.length;v<y;v++){const x=_[v];x.onLoad&&x.onLoad(p)}}).catch(p=>{const _=El[e];if(_===void 0)throw this.manager.itemError(e),p;delete El[e];for(let v=0,y=_.length;v<y;v++){const x=_[v];x.onError&&x.onError(p)}this.manager.itemError(e)}).finally(()=>{this.manager.itemEnd(e)}),this.manager.itemStart(e)}setResponseType(e){return this.responseType=e,this}setMimeType(e){return this.mimeType=e,this}abort(){return this._abortController.abort(),this._abortController=new AbortController,this}}class Ww extends Ba{constructor(e){super(e)}load(e,t,n,i){const o=this,l=new da(this.manager);l.setPath(this.path),l.setRequestHeader(this.requestHeader),l.setWithCredentials(this.withCredentials),l.load(e,function(h){try{t(o.parse(JSON.parse(h)))}catch(d){i?i(d):Zt(d),o.manager.itemError(e)}},n,i)}parse(e){const t=[];for(let n=0;n<e.length;n++){const i=Vu.parse(e[n]);t.push(i)}return t}}class jw extends Ba{constructor(e){super(e)}load(e,t,n,i){const o=this,l=[],h=new mv,d=new da(this.manager);d.setPath(this.path),d.setResponseType("arraybuffer"),d.setRequestHeader(this.requestHeader),d.setWithCredentials(o.withCredentials);let p=0;function _(v){d.load(e[v],function(y){const x=o.parse(y,!0);l[v]={width:x.width,height:x.height,format:x.format,mipmaps:x.mipmaps},p+=1,p===6&&(x.mipmapCount===1&&(h.minFilter=Cn),h.image=l,h.format=x.format,h.needsUpdate=!0,t&&t(h))},n,i)}if(Array.isArray(e))for(let v=0,y=e.length;v<y;++v)_(v);else d.load(e,function(v){const y=o.parse(v,!0);if(y.isCubemap){const x=y.mipmaps.length/y.mipmapCount;for(let b=0;b<x;b++){l[b]={mipmaps:[]};for(let R=0;R<y.mipmapCount;R++)l[b].mipmaps.push(y.mipmaps[b*y.mipmapCount+R]),l[b].format=y.format,l[b].width=y.width,l[b].height=y.height}h.image=l}else h.image.width=y.width,h.image.height=y.height,h.mipmaps=y.mipmaps;y.mipmapCount===1&&(h.minFilter=Cn),h.format=y.format,h.needsUpdate=!0,t&&t(h)},n,i);return h}}const wh=new WeakMap;class Xp extends Ba{constructor(e){super(e)}load(e,t,n,i){this.path!==void 0&&(e=this.path+e),e=this.manager.resolveURL(e);const o=this,l=Bo.get(`image:${e}`);if(l!==void 0){if(l.complete===!0)o.manager.itemStart(e),setTimeout(function(){t&&t(l),o.manager.itemEnd(e)},0);else{let v=wh.get(l);v===void 0&&(v=[],wh.set(l,v)),v.push({onLoad:t,onError:i})}return l}const h=pp("img");function d(){_(),t&&t(this);const v=wh.get(this)||[];for(let y=0;y<v.length;y++){const x=v[y];x.onLoad&&x.onLoad(this)}wh.delete(this),o.manager.itemEnd(e)}function p(v){_(),i&&i(v),Bo.remove(`image:${e}`);const y=wh.get(this)||[];for(let x=0;x<y.length;x++){const b=y[x];b.onError&&b.onError(v)}wh.delete(this),o.manager.itemError(e),o.manager.itemEnd(e)}function _(){h.removeEventListener("load",d,!1),h.removeEventListener("error",p,!1)}return h.addEventListener("load",d,!1),h.addEventListener("error",p,!1),e.slice(0,5)!=="data:"&&this.crossOrigin!==void 0&&(h.crossOrigin=this.crossOrigin),Bo.add(`image:${e}`,h),o.manager.itemStart(e),h.src=e,h}}class P1 extends Ba{constructor(e){super(e)}load(e,t,n,i){const o=new Sp;o.colorSpace=Xi;const l=new Xp(this.manager);l.setCrossOrigin(this.crossOrigin),l.setPath(this.path);let h=0;function d(p){l.load(e[p],function(_){o.images[p]=_,h++,h===6&&(o.needsUpdate=!0,t&&t(o))},void 0,i)}for(let p=0;p<e.length;++p)d(p);return o}}class cA extends Ba{constructor(e){super(e)}load(e,t,n,i){const o=this,l=new _r,h=new da(this.manager);return h.setResponseType("arraybuffer"),h.setRequestHeader(this.requestHeader),h.setPath(this.path),h.setWithCredentials(o.withCredentials),h.load(e,function(d){let p;try{p=o.parse(d)}catch(_){if(i!==void 0)i(_);else{_(_);return}}p.image!==void 0?l.image=p.image:p.data!==void 0&&(l.image.width=p.width,l.image.height=p.height,l.image.data=p.data),l.wrapS=p.wrapS!==void 0?p.wrapS:Ei,l.wrapT=p.wrapT!==void 0?p.wrapT:Ei,l.magFilter=p.magFilter!==void 0?p.magFilter:Cn,l.minFilter=p.minFilter!==void 0?p.minFilter:Cn,l.anisotropy=p.anisotropy!==void 0?p.anisotropy:1,p.colorSpace!==void 0&&(l.colorSpace=p.colorSpace),p.flipY!==void 0&&(l.flipY=p.flipY),p.format!==void 0&&(l.format=p.format),p.type!==void 0&&(l.type=p.type),p.mipmaps!==void 0&&(l.mipmaps=p.mipmaps,l.minFilter=Is),p.mipmapCount===1&&(l.minFilter=Cn),p.generateMipmaps!==void 0&&(l.generateMipmaps=p.generateMipmaps),l.needsUpdate=!0,t&&t(l,p)},n,i),l}}class uA extends Ba{constructor(e){super(e)}load(e,t,n,i){const o=new Qn,l=new Xp(this.manager);return l.setCrossOrigin(this.crossOrigin),l.setPath(this.path),l.load(e,function(h){o.image=h,o.needsUpdate=!0,t!==void 0&&t(o)},n,i),o}}class bc extends Un{constructor(e,t=1){super(),this.isLight=!0,this.type="Light",this.color=new Ct(e),this.intensity=t}dispose(){this.dispatchEvent({type:"dispose"})}copy(e,t){return super.copy(e,t),this.color.copy(e.color),this.intensity=e.intensity,this}toJSON(e){const t=super.toJSON(e);return t.object.color=this.color.getHex(),t.object.intensity=this.intensity,t}}class G1 extends bc{constructor(e,t,n){super(e,n),this.isHemisphereLight=!0,this.type="HemisphereLight",this.position.copy(Un.DEFAULT_UP),this.updateMatrix(),this.groundColor=new Ct(t)}copy(e,t){return super.copy(e,t),this.groundColor.copy(e.groundColor),this}toJSON(e){const t=super.toJSON(e);return t.object.groundColor=this.groundColor.getHex(),t}}const fA=new en,z1=new Z,V1=new Z;class hA{constructor(e){this.camera=e,this.intensity=1,this.bias=0,this.normalBias=0,this.radius=1,this.blurSamples=8,this.mapSize=new nt(512,512),this.mapType=Ta,this.map=null,this.mapPass=null,this.matrix=new en,this.autoUpdate=!0,this.needsUpdate=!1,this._frustum=new Th,this._frameExtents=new nt(1,1),this._viewportCount=1,this._viewports=[new pi(0,0,1,1)]}getViewportCount(){return this._viewportCount}getFrustum(){return this._frustum}updateMatrices(e){const t=this.camera,n=this.matrix;z1.setFromMatrixPosition(e.matrixWorld),t.position.copy(z1),V1.setFromMatrixPosition(e.target.matrixWorld),t.lookAt(V1),t.updateMatrixWorld(),fA.multiplyMatrices(t.projectionMatrix,t.matrixWorldInverse),this._frustum.setFromProjectionMatrix(fA,t.coordinateSystem,t.reversedDepth),t.reversedDepth?n.set(.5,0,0,.5,0,.5,0,.5,0,0,1,0,0,0,0,1):n.set(.5,0,0,.5,0,.5,0,.5,0,0,.5,.5,0,0,0,1),n.multiply(fA)}getViewport(e){return this._viewports[e]}getFrameExtents(){return this._frameExtents}dispose(){this.map&&this.map.dispose(),this.mapPass&&this.mapPass.dispose()}copy(e){return this.camera=e.camera.clone(),this.intensity=e.intensity,this.bias=e.bias,this.radius=e.radius,this.autoUpdate=e.autoUpdate,this.needsUpdate=e.needsUpdate,this.normalBias=e.normalBias,this.blurSamples=e.blurSamples,this.mapSize.copy(e.mapSize),this}clone(){return new this.constructor().copy(this)}toJSON(){const e={};return this.intensity!==1&&(e.intensity=this.intensity),this.bias!==0&&(e.bias=this.bias),this.normalBias!==0&&(e.normalBias=this.normalBias),this.radius!==1&&(e.radius=this.radius),(this.mapSize.x!==512||this.mapSize.y!==512)&&(e.mapSize=this.mapSize.toArray()),e.camera=this.camera.toJSON(!1).object,delete e.camera.matrix,e}}class Zw extends hA{constructor(){super(new aa(50,1,.5,500)),this.isSpotLightShadow=!0,this.focus=1,this.aspect=1}updateMatrices(e){const t=this.camera,n=nh*2*e.angle*this.focus,i=this.mapSize.width/this.mapSize.height*this.aspect,o=e.distance||t.far;(n!==t.fov||i!==t.aspect||o!==t.far)&&(t.fov=n,t.aspect=i,t.far=o,t.updateProjectionMatrix()),super.updateMatrices(e)}copy(e){return super.copy(e),this.focus=e.focus,this}}class Fv extends bc{constructor(e,t,n=0,i=Math.PI/3,o=0,l=2){super(e,t),this.isSpotLight=!0,this.type="SpotLight",this.position.copy(Un.DEFAULT_UP),this.updateMatrix(),this.target=new Un,this.distance=n,this.angle=i,this.penumbra=o,this.decay=l,this.map=null,this.shadow=new Zw}get power(){return this.intensity*Math.PI}set power(e){this.intensity=e/Math.PI}dispose(){super.dispose(),this.shadow.dispose()}copy(e,t){return super.copy(e,t),this.distance=e.distance,this.angle=e.angle,this.penumbra=e.penumbra,this.decay=e.decay,this.target=e.target.clone(),this.map=e.map,this.shadow=e.shadow.clone(),this}toJSON(e){const t=super.toJSON(e);return t.object.distance=this.distance,t.object.angle=this.angle,t.object.decay=this.decay,t.object.penumbra=this.penumbra,t.object.target=this.target.uuid,this.map&&this.map.isTexture&&(t.object.map=this.map.toJSON(e).uuid),t.object.shadow=this.shadow.toJSON(),t}}class Qw extends hA{constructor(){super(new aa(90,1,.5,500)),this.isPointLightShadow=!0}}class Hv extends bc{constructor(e,t,n=0,i=2){super(e,t),this.isPointLight=!0,this.type="PointLight",this.distance=n,this.decay=i,this.shadow=new Qw}get power(){return this.intensity*4*Math.PI}set power(e){this.intensity=e/(4*Math.PI)}dispose(){super.dispose(),this.shadow.dispose()}copy(e,t){return super.copy(e,t),this.distance=e.distance,this.decay=e.decay,this.shadow=e.shadow.clone(),this}toJSON(e){const t=super.toJSON(e);return t.object.distance=this.distance,t.object.decay=this.decay,t.object.shadow=this.shadow.toJSON(),t}}class Tl extends X0{constructor(e=-1,t=1,n=1,i=-1,o=.1,l=2e3){super(),this.isOrthographicCamera=!0,this.type="OrthographicCamera",this.zoom=1,this.view=null,this.left=e,this.right=t,this.top=n,this.bottom=i,this.near=o,this.far=l,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,n,i,o,l){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=n,this.view.offsetY=i,this.view.width=o,this.view.height=l,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),n=(this.right+this.left)/2,i=(this.top+this.bottom)/2;let o=n-e,l=n+e,h=i+t,d=i-t;if(this.view!==null&&this.view.enabled){const p=(this.right-this.left)/this.view.fullWidth/this.zoom,_=(this.top-this.bottom)/this.view.fullHeight/this.zoom;o+=p*this.view.offsetX,l=o+p*this.view.width,h-=_*this.view.offsetY,d=h-_*this.view.height}this.projectionMatrix.makeOrthographic(o,l,h,d,this.near,this.far,this.coordinateSystem,this.reversedDepth),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}}class $w extends hA{constructor(){super(new Tl(-5,5,5,-5,.5,500)),this.isDirectionalLightShadow=!0}}class Pv extends bc{constructor(e,t){super(e,t),this.isDirectionalLight=!0,this.type="DirectionalLight",this.position.copy(Un.DEFAULT_UP),this.updateMatrix(),this.target=new Un,this.shadow=new $w}dispose(){super.dispose(),this.shadow.dispose()}copy(e){return super.copy(e),this.target=e.target.clone(),this.shadow=e.shadow.clone(),this}toJSON(e){const t=super.toJSON(e);return t.object.shadow=this.shadow.toJSON(),t.object.target=this.target.uuid,t}}class k1 extends bc{constructor(e,t){super(e,t),this.isAmbientLight=!0,this.type="AmbientLight"}}class X1 extends bc{constructor(e,t,n=10,i=10){super(e,t),this.isRectAreaLight=!0,this.type="RectAreaLight",this.width=n,this.height=i}get power(){return this.intensity*this.width*this.height*Math.PI}set power(e){this.intensity=e/(this.width*this.height*Math.PI)}copy(e){return super.copy(e),this.width=e.width,this.height=e.height,this}toJSON(e){const t=super.toJSON(e);return t.object.width=this.width,t.object.height=this.height,t}}class dA{constructor(){this.isSphericalHarmonics3=!0,this.coefficients=[];for(let e=0;e<9;e++)this.coefficients.push(new Z)}set(e){for(let t=0;t<9;t++)this.coefficients[t].copy(e[t]);return this}zero(){for(let e=0;e<9;e++)this.coefficients[e].set(0,0,0);return this}getAt(e,t){const n=e.x,i=e.y,o=e.z,l=this.coefficients;return t.copy(l[0]).multiplyScalar(.282095),t.addScaledVector(l[1],.488603*i),t.addScaledVector(l[2],.488603*o),t.addScaledVector(l[3],.488603*n),t.addScaledVector(l[4],1.092548*(n*i)),t.addScaledVector(l[5],1.092548*(i*o)),t.addScaledVector(l[6],.315392*(3*o*o-1)),t.addScaledVector(l[7],1.092548*(n*o)),t.addScaledVector(l[8],.546274*(n*n-i*i)),t}getIrradianceAt(e,t){const n=e.x,i=e.y,o=e.z,l=this.coefficients;return t.copy(l[0]).multiplyScalar(.886227),t.addScaledVector(l[1],1.023328*i),t.addScaledVector(l[2],1.023328*o),t.addScaledVector(l[3],1.023328*n),t.addScaledVector(l[4],.858086*n*i),t.addScaledVector(l[5],.858086*i*o),t.addScaledVector(l[6],.743125*o*o-.247708),t.addScaledVector(l[7],.858086*n*o),t.addScaledVector(l[8],.429043*(n*n-i*i)),t}add(e){for(let t=0;t<9;t++)this.coefficients[t].add(e.coefficients[t]);return this}addScaledSH(e,t){for(let n=0;n<9;n++)this.coefficients[n].addScaledVector(e.coefficients[n],t);return this}scale(e){for(let t=0;t<9;t++)this.coefficients[t].multiplyScalar(e);return this}lerp(e,t){for(let n=0;n<9;n++)this.coefficients[n].lerp(e.coefficients[n],t);return this}equals(e){for(let t=0;t<9;t++)if(!this.coefficients[t].equals(e.coefficients[t]))return!1;return!0}copy(e){return this.set(e.coefficients)}clone(){return new this.constructor().copy(this)}fromArray(e,t=0){const n=this.coefficients;for(let i=0;i<9;i++)n[i].fromArray(e,t+i*3);return this}toArray(e=[],t=0){const n=this.coefficients;for(let i=0;i<9;i++)n[i].toArray(e,t+i*3);return e}static getBasisAt(e,t){const n=e.x,i=e.y,o=e.z;t[0]=.282095,t[1]=.488603*i,t[2]=.488603*o,t[3]=.488603*n,t[4]=1.092548*n*i,t[5]=1.092548*i*o,t[6]=.315392*(3*o*o-1),t[7]=1.092548*n*o,t[8]=.546274*(n*n-i*i)}}class Y1 extends bc{constructor(e=new dA,t=1){super(void 0,t),this.isLightProbe=!0,this.sh=e}copy(e){return super.copy(e),this.sh.copy(e.sh),this}toJSON(e){const t=super.toJSON(e);return t.object.sh=this.sh.toArray(),t}}class Gv extends Ba{constructor(e){super(e),this.textures={}}load(e,t,n,i){const o=this,l=new da(o.manager);l.setPath(o.path),l.setRequestHeader(o.requestHeader),l.setWithCredentials(o.withCredentials),l.load(e,function(h){try{t(o.parse(JSON.parse(h)))}catch(d){i?i(d):Zt(d),o.manager.itemError(e)}},n,i)}parse(e){const t=this.textures;function n(o){return t[o]===void 0&&Ut("MaterialLoader: Undefined texture",o),t[o]}const i=this.createMaterialFromType(e.type);if(e.uuid!==void 0&&(i.uuid=e.uuid),e.name!==void 0&&(i.name=e.name),e.color!==void 0&&i.color!==void 0&&i.color.setHex(e.color),e.roughness!==void 0&&(i.roughness=e.roughness),e.metalness!==void 0&&(i.metalness=e.metalness),e.sheen!==void 0&&(i.sheen=e.sheen),e.sheenColor!==void 0&&(i.sheenColor=new Ct().setHex(e.sheenColor)),e.sheenRoughness!==void 0&&(i.sheenRoughness=e.sheenRoughness),e.emissive!==void 0&&i.emissive!==void 0&&i.emissive.setHex(e.emissive),e.specular!==void 0&&i.specular!==void 0&&i.specular.setHex(e.specular),e.specularIntensity!==void 0&&(i.specularIntensity=e.specularIntensity),e.specularColor!==void 0&&i.specularColor!==void 0&&i.specularColor.setHex(e.specularColor),e.shininess!==void 0&&(i.shininess=e.shininess),e.clearcoat!==void 0&&(i.clearcoat=e.clearcoat),e.clearcoatRoughness!==void 0&&(i.clearcoatRoughness=e.clearcoatRoughness),e.dispersion!==void 0&&(i.dispersion=e.dispersion),e.iridescence!==void 0&&(i.iridescence=e.iridescence),e.iridescenceIOR!==void 0&&(i.iridescenceIOR=e.iridescenceIOR),e.iridescenceThicknessRange!==void 0&&(i.iridescenceThicknessRange=e.iridescenceThicknessRange),e.transmission!==void 0&&(i.transmission=e.transmission),e.thickness!==void 0&&(i.thickness=e.thickness),e.attenuationDistance!==void 0&&(i.attenuationDistance=e.attenuationDistance),e.attenuationColor!==void 0&&i.attenuationColor!==void 0&&i.attenuationColor.setHex(e.attenuationColor),e.anisotropy!==void 0&&(i.anisotropy=e.anisotropy),e.anisotropyRotation!==void 0&&(i.anisotropyRotation=e.anisotropyRotation),e.fog!==void 0&&(i.fog=e.fog),e.flatShading!==void 0&&(i.flatShading=e.flatShading),e.blending!==void 0&&(i.blending=e.blending),e.combine!==void 0&&(i.combine=e.combine),e.side!==void 0&&(i.side=e.side),e.shadowSide!==void 0&&(i.shadowSide=e.shadowSide),e.opacity!==void 0&&(i.opacity=e.opacity),e.transparent!==void 0&&(i.transparent=e.transparent),e.alphaTest!==void 0&&(i.alphaTest=e.alphaTest),e.alphaHash!==void 0&&(i.alphaHash=e.alphaHash),e.depthFunc!==void 0&&(i.depthFunc=e.depthFunc),e.depthTest!==void 0&&(i.depthTest=e.depthTest),e.depthWrite!==void 0&&(i.depthWrite=e.depthWrite),e.colorWrite!==void 0&&(i.colorWrite=e.colorWrite),e.blendSrc!==void 0&&(i.blendSrc=e.blendSrc),e.blendDst!==void 0&&(i.blendDst=e.blendDst),e.blendEquation!==void 0&&(i.blendEquation=e.blendEquation),e.blendSrcAlpha!==void 0&&(i.blendSrcAlpha=e.blendSrcAlpha),e.blendDstAlpha!==void 0&&(i.blendDstAlpha=e.blendDstAlpha),e.blendEquationAlpha!==void 0&&(i.blendEquationAlpha=e.blendEquationAlpha),e.blendColor!==void 0&&i.blendColor!==void 0&&i.blendColor.setHex(e.blendColor),e.blendAlpha!==void 0&&(i.blendAlpha=e.blendAlpha),e.stencilWriteMask!==void 0&&(i.stencilWriteMask=e.stencilWriteMask),e.stencilFunc!==void 0&&(i.stencilFunc=e.stencilFunc),e.stencilRef!==void 0&&(i.stencilRef=e.stencilRef),e.stencilFuncMask!==void 0&&(i.stencilFuncMask=e.stencilFuncMask),e.stencilFail!==void 0&&(i.stencilFail=e.stencilFail),e.stencilZFail!==void 0&&(i.stencilZFail=e.stencilZFail),e.stencilZPass!==void 0&&(i.stencilZPass=e.stencilZPass),e.stencilWrite!==void 0&&(i.stencilWrite=e.stencilWrite),e.wireframe!==void 0&&(i.wireframe=e.wireframe),e.wireframeLinewidth!==void 0&&(i.wireframeLinewidth=e.wireframeLinewidth),e.wireframeLinecap!==void 0&&(i.wireframeLinecap=e.wireframeLinecap),e.wireframeLinejoin!==void 0&&(i.wireframeLinejoin=e.wireframeLinejoin),e.rotation!==void 0&&(i.rotation=e.rotation),e.linewidth!==void 0&&(i.linewidth=e.linewidth),e.dashSize!==void 0&&(i.dashSize=e.dashSize),e.gapSize!==void 0&&(i.gapSize=e.gapSize),e.scale!==void 0&&(i.scale=e.scale),e.polygonOffset!==void 0&&(i.polygonOffset=e.polygonOffset),e.polygonOffsetFactor!==void 0&&(i.polygonOffsetFactor=e.polygonOffsetFactor),e.polygonOffsetUnits!==void 0&&(i.polygonOffsetUnits=e.polygonOffsetUnits),e.dithering!==void 0&&(i.dithering=e.dithering),e.alphaToCoverage!==void 0&&(i.alphaToCoverage=e.alphaToCoverage),e.premultipliedAlpha!==void 0&&(i.premultipliedAlpha=e.premultipliedAlpha),e.forceSinglePass!==void 0&&(i.forceSinglePass=e.forceSinglePass),e.allowOverride!==void 0&&(i.allowOverride=e.allowOverride),e.visible!==void 0&&(i.visible=e.visible),e.toneMapped!==void 0&&(i.toneMapped=e.toneMapped),e.userData!==void 0&&(i.userData=e.userData),e.vertexColors!==void 0&&(typeof e.vertexColors=="number"?i.vertexColors=e.vertexColors>0:i.vertexColors=e.vertexColors),e.uniforms!==void 0)for(const o in e.uniforms){const l=e.uniforms[o];switch(i.uniforms[o]={},l.type){case"t":i.uniforms[o].value=n(l.value);break;case"c":i.uniforms[o].value=new Ct().setHex(l.value);break;case"v2":i.uniforms[o].value=new nt().fromArray(l.value);break;case"v3":i.uniforms[o].value=new Z().fromArray(l.value);break;case"v4":i.uniforms[o].value=new pi().fromArray(l.value);break;case"m3":i.uniforms[o].value=new yn().fromArray(l.value);break;case"m4":i.uniforms[o].value=new en().fromArray(l.value);break;default:i.uniforms[o].value=l.value}}if(e.defines!==void 0&&(i.defines=e.defines),e.vertexShader!==void 0&&(i.vertexShader=e.vertexShader),e.fragmentShader!==void 0&&(i.fragmentShader=e.fragmentShader),e.glslVersion!==void 0&&(i.glslVersion=e.glslVersion),e.extensions!==void 0)for(const o in e.extensions)i.extensions[o]=e.extensions[o];if(e.lights!==void 0&&(i.lights=e.lights),e.clipping!==void 0&&(i.clipping=e.clipping),e.size!==void 0&&(i.size=e.size),e.sizeAttenuation!==void 0&&(i.sizeAttenuation=e.sizeAttenuation),e.map!==void 0&&(i.map=n(e.map)),e.matcap!==void 0&&(i.matcap=n(e.matcap)),e.alphaMap!==void 0&&(i.alphaMap=n(e.alphaMap)),e.bumpMap!==void 0&&(i.bumpMap=n(e.bumpMap)),e.bumpScale!==void 0&&(i.bumpScale=e.bumpScale),e.normalMap!==void 0&&(i.normalMap=n(e.normalMap)),e.normalMapType!==void 0&&(i.normalMapType=e.normalMapType),e.normalScale!==void 0){let o=e.normalScale;Array.isArray(o)===!1&&(o=[o,o]),i.normalScale=new nt().fromArray(o)}return e.displacementMap!==void 0&&(i.displacementMap=n(e.displacementMap)),e.displacementScale!==void 0&&(i.displacementScale=e.displacementScale),e.displacementBias!==void 0&&(i.displacementBias=e.displacementBias),e.roughnessMap!==void 0&&(i.roughnessMap=n(e.roughnessMap)),e.metalnessMap!==void 0&&(i.metalnessMap=n(e.metalnessMap)),e.emissiveMap!==void 0&&(i.emissiveMap=n(e.emissiveMap)),e.emissiveIntensity!==void 0&&(i.emissiveIntensity=e.emissiveIntensity),e.specularMap!==void 0&&(i.specularMap=n(e.specularMap)),e.specularIntensityMap!==void 0&&(i.specularIntensityMap=n(e.specularIntensityMap)),e.specularColorMap!==void 0&&(i.specularColorMap=n(e.specularColorMap)),e.envMap!==void 0&&(i.envMap=n(e.envMap)),e.envMapRotation!==void 0&&i.envMapRotation.fromArray(e.envMapRotation),e.envMapIntensity!==void 0&&(i.envMapIntensity=e.envMapIntensity),e.reflectivity!==void 0&&(i.reflectivity=e.reflectivity),e.refractionRatio!==void 0&&(i.refractionRatio=e.refractionRatio),e.lightMap!==void 0&&(i.lightMap=n(e.lightMap)),e.lightMapIntensity!==void 0&&(i.lightMapIntensity=e.lightMapIntensity),e.aoMap!==void 0&&(i.aoMap=n(e.aoMap)),e.aoMapIntensity!==void 0&&(i.aoMapIntensity=e.aoMapIntensity),e.gradientMap!==void 0&&(i.gradientMap=n(e.gradientMap)),e.clearcoatMap!==void 0&&(i.clearcoatMap=n(e.clearcoatMap)),e.clearcoatRoughnessMap!==void 0&&(i.clearcoatRoughnessMap=n(e.clearcoatRoughnessMap)),e.clearcoatNormalMap!==void 0&&(i.clearcoatNormalMap=n(e.clearcoatNormalMap)),e.clearcoatNormalScale!==void 0&&(i.clearcoatNormalScale=new nt().fromArray(e.clearcoatNormalScale)),e.iridescenceMap!==void 0&&(i.iridescenceMap=n(e.iridescenceMap)),e.iridescenceThicknessMap!==void 0&&(i.iridescenceThicknessMap=n(e.iridescenceThicknessMap)),e.transmissionMap!==void 0&&(i.transmissionMap=n(e.transmissionMap)),e.thicknessMap!==void 0&&(i.thicknessMap=n(e.thicknessMap)),e.anisotropyMap!==void 0&&(i.anisotropyMap=n(e.anisotropyMap)),e.sheenColorMap!==void 0&&(i.sheenColorMap=n(e.sheenColorMap)),e.sheenRoughnessMap!==void 0&&(i.sheenRoughnessMap=n(e.sheenRoughnessMap)),i}setTextures(e){return this.textures=e,this}createMaterialFromType(e){return Gv.createMaterialFromType(e)}static createMaterialFromType(e){const t={ShadowMaterial:C1,SpriteMaterial:Lx,RawShaderMaterial:nA,ShaderMaterial:ms,PointsMaterial:Np,MeshPhysicalMaterial:Ji,MeshStandardMaterial:Fu,MeshPhongMaterial:R1,MeshToonMaterial:w1,MeshNormalMaterial:B1,MeshLambertMaterial:D1,MeshDepthMaterial:iA,MeshDistanceMaterial:aA,MeshBasicMaterial:ha,MeshMatcapMaterial:N1,LineDashedMaterial:U1,LineBasicMaterial:za,Material:Yi};return new t[e]}}class nr{static extractUrlBase(e){const t=e.lastIndexOf("/");return t===-1?"./":e.slice(0,t+1)}static resolveURL(e,t){return typeof e!="string"||e===""?"":(/^https?:\/\//i.test(t)&&/^\//.test(e)&&(t=t.replace(/(^https?:\/\/[^\/]+).*/i,"$1")),/^(https?:)?\/\//i.test(e)||/^data:.*,.*$/i.test(e)||/^blob:.*$/i.test(e)?e:t+e)}}class J1 extends pn{constructor(){super(),this.isInstancedBufferGeometry=!0,this.type="InstancedBufferGeometry",this.instanceCount=1/0}copy(e){return super.copy(e),this.instanceCount=e.instanceCount,this}toJSON(){const e=super.toJSON();return e.instanceCount=this.instanceCount,e.isInstancedBufferGeometry=!0,e}}class q1 extends Ba{constructor(e){super(e)}load(e,t,n,i){const o=this,l=new da(o.manager);l.setPath(o.path),l.setRequestHeader(o.requestHeader),l.setWithCredentials(o.withCredentials),l.load(e,function(h){try{t(o.parse(JSON.parse(h)))}catch(d){i?i(d):Zt(d),o.manager.itemError(e)}},n,i)}parse(e){const t={},n={};function i(x,b){if(t[b]!==void 0)return t[b];const T=x.interleavedBuffers[b],M=o(x,T.buffer),w=eh(T.type,M),D=new yh(w,T.stride);return D.uuid=T.uuid,t[b]=D,D}function o(x,b){if(n[b]!==void 0)return n[b];const T=x.arrayBuffers[b],M=new Uint32Array(T).buffer;return n[b]=M,M}const l=e.isInstancedBufferGeometry?new J1:new pn,h=e.data.index;if(h!==void 0){const x=eh(h.type,h.array);l.setIndex(new Hn(x,1))}const d=e.data.attributes;for(const x in d){const b=d[x];let R;if(b.isInterleavedBufferAttribute){const T=i(e.data,b.data);R=new Al(T,b.itemSize,b.offset,b.normalized)}else{const T=eh(b.type,b.array),M=b.isInstancedBufferAttribute?xc:Hn;R=new M(T,b.itemSize,b.normalized)}b.name!==void 0&&(R.name=b.name),b.usage!==void 0&&R.setUsage(b.usage),l.setAttribute(x,R)}const p=e.data.morphAttributes;if(p)for(const x in p){const b=p[x],R=[];for(let T=0,M=b.length;T<M;T++){const w=b[T];let D;if(w.isInterleavedBufferAttribute){const N=i(e.data,w.data);D=new Al(N,w.itemSize,w.offset,w.normalized)}else{const N=eh(w.type,w.array);D=new Hn(N,w.itemSize,w.normalized)}w.name!==void 0&&(D.name=w.name),R.push(D)}l.morphAttributes[x]=R}e.data.morphTargetsRelative&&(l.morphTargetsRelative=!0);const v=e.data.groups||e.data.drawcalls||e.data.offsets;if(v!==void 0)for(let x=0,b=v.length;x!==b;++x){const R=v[x];l.addGroup(R.start,R.count,R.materialIndex)}const y=e.data.boundingSphere;return y!==void 0&&(l.boundingSphere=new fa().fromJSON(y)),e.name&&(l.name=e.name),e.userData&&(l.userData=e.userData),l}}class eB extends Ba{constructor(e){super(e)}load(e,t,n,i){const o=this,l=this.path===""?nr.extractUrlBase(e):this.path;this.resourcePath=this.resourcePath||l;const h=new da(this.manager);h.setPath(this.path),h.setRequestHeader(this.requestHeader),h.setWithCredentials(this.withCredentials),h.load(e,function(d){let p=null;try{p=JSON.parse(d)}catch(v){i!==void 0&&i(v),v("ObjectLoader: Can't parse "+e+".",v.message);return}const _=p.metadata;if(_===void 0||_.type===void 0||_.type.toLowerCase()==="geometry"){i!==void 0&&i(new Error("THREE.ObjectLoader: Can't load "+e)),Zt("ObjectLoader: Can't load "+e);return}o.parse(p,t)},n,i)}async loadAsync(e,t){const n=this,i=this.path===""?nr.extractUrlBase(e):this.path;this.resourcePath=this.resourcePath||i;const o=new da(this.manager);o.setPath(this.path),o.setRequestHeader(this.requestHeader),o.setWithCredentials(this.withCredentials);const l=await o.loadAsync(e,t),h=JSON.parse(l),d=h.metadata;if(d===void 0||d.type===void 0||d.type.toLowerCase()==="geometry")throw new Error("THREE.ObjectLoader: Can't load "+e);return await n.parseAsync(h)}parse(e,t){const n=this.parseAnimations(e.animations),i=this.parseShapes(e.shapes),o=this.parseGeometries(e.geometries,i),l=this.parseImages(e.images,function(){t!==void 0&&t(p)}),h=this.parseTextures(e.textures,l),d=this.parseMaterials(e.materials,h),p=this.parseObject(e.object,o,d,h,n),_=this.parseSkeletons(e.skeletons,p);if(this.bindSkeletons(p,_),this.bindLightTargets(p),t!==void 0){let v=!1;for(const y in l)if(l[y].data instanceof HTMLImageElement){v=!0;break}v===!1&&t(p)}return p}async parseAsync(e){const t=this.parseAnimations(e.animations),n=this.parseShapes(e.shapes),i=this.parseGeometries(e.geometries,n),o=await this.parseImagesAsync(e.images),l=this.parseTextures(e.textures,o),h=this.parseMaterials(e.materials,l),d=this.parseObject(e.object,i,h,l,t),p=this.parseSkeletons(e.skeletons,d);return this.bindSkeletons(d,p),this.bindLightTargets(d),d}parseShapes(e){const t={};if(e!==void 0)for(let n=0,i=e.length;n<i;n++){const o=new Ou().fromJSON(e[n]);t[o.uuid]=o}return t}parseSkeletons(e,t){const n={},i={};if(t.traverse(function(o){o.isBone&&(i[o.uuid]=o)}),e!==void 0)for(let o=0,l=e.length;o<l;o++){const h=new bh().fromJSON(e[o],i);n[h.uuid]=h}return n}parseGeometries(e,t){const n={};if(e!==void 0){const i=new q1;for(let o=0,l=e.length;o<l;o++){let h;const d=e[o];switch(d.type){case"BufferGeometry":case"InstancedBufferGeometry":h=i.parse(d);break;default:d.type in T1?h=T1[d.type].fromJSON(d,t):Ut(`ObjectLoader: Unsupported geometry type "${d.type}"`)}h.uuid=d.uuid,d.name!==void 0&&(h.name=d.name),d.userData!==void 0&&(h.userData=d.userData),n[d.uuid]=h}}return n}parseMaterials(e,t){const n={},i={};if(e!==void 0){const o=new Gv;o.setTextures(t);for(let l=0,h=e.length;l<h;l++){const d=e[l];n[d.uuid]===void 0&&(n[d.uuid]=o.parse(d)),i[d.uuid]=n[d.uuid]}}return i}parseAnimations(e){const t={};if(e!==void 0)for(let n=0;n<e.length;n++){const i=e[n],o=Vu.parse(i);t[o.uuid]=o}return t}parseImages(e,t){const n=this,i={};let o;function l(d){return n.manager.itemStart(d),o.load(d,function(){n.manager.itemEnd(d)},void 0,function(){n.manager.itemError(d),n.manager.itemEnd(d)})}function h(d){if(typeof d=="string"){const p=d,_=/^(\/\/)|([a-z]+:(\/\/)?)/i.test(p)?p:n.resourcePath+p;return l(_)}else return d.data?{data:eh(d.type,d.data),width:d.width,height:d.height}:null}if(e!==void 0&&e.length>0){const d=new Iv(t);o=new Xp(d),o.setCrossOrigin(this.crossOrigin);for(let p=0,_=e.length;p<_;p++){const v=e[p],y=v.url;if(Array.isArray(y)){const x=[];for(let b=0,R=y.length;b<R;b++){const T=y[b],M=h(T);M!==null&&(M instanceof HTMLImageElement?x.push(M):x.push(new _r(M.data,M.width,M.height)))}i[v.uuid]=new dc(x)}else{const x=h(v.url);i[v.uuid]=new dc(x)}}}return i}async parseImagesAsync(e){const t=this,n={};let i;async function o(l){if(typeof l=="string"){const h=l,d=/^(\/\/)|([a-z]+:(\/\/)?)/i.test(h)?h:t.resourcePath+h;return await i.loadAsync(d)}else return l.data?{data:eh(l.type,l.data),width:l.width,height:l.height}:null}if(e!==void 0&&e.length>0){i=new Xp(this.manager),i.setCrossOrigin(this.crossOrigin);for(let l=0,h=e.length;l<h;l++){const d=e[l],p=d.url;if(Array.isArray(p)){const _=[];for(let v=0,y=p.length;v<y;v++){const x=p[v],b=await o(x);b!==null&&(b instanceof HTMLImageElement?_.push(b):_.push(new _r(b.data,b.width,b.height)))}n[d.uuid]=new dc(_)}else{const _=await o(d.url);n[d.uuid]=new dc(_)}}}return n}parseTextures(e,t){function n(o,l){return typeof o=="number"?o:(Ut("ObjectLoader.parseTexture: Constant should be in numeric form.",o),l[o])}const i={};if(e!==void 0)for(let o=0,l=e.length;o<l;o++){const h=e[o];h.image===void 0&&Ut('ObjectLoader: No "image" specified for',h.uuid),t[h.image]===void 0&&Ut("ObjectLoader: Undefined image",h.image);const d=t[h.image],p=d.data;let _;Array.isArray(p)?(_=new Sp,p.length===6&&(_.needsUpdate=!0)):(p&&p.data?_=new _r:_=new Qn,p&&(_.needsUpdate=!0)),_.source=d,_.uuid=h.uuid,h.name!==void 0&&(_.name=h.name),h.mapping!==void 0&&(_.mapping=n(h.mapping,tB)),h.channel!==void 0&&(_.channel=h.channel),h.offset!==void 0&&_.offset.fromArray(h.offset),h.repeat!==void 0&&_.repeat.fromArray(h.repeat),h.center!==void 0&&_.center.fromArray(h.center),h.rotation!==void 0&&(_.rotation=h.rotation),h.wrap!==void 0&&(_.wrapS=n(h.wrap[0],K1),_.wrapT=n(h.wrap[1],K1)),h.format!==void 0&&(_.format=h.format),h.internalFormat!==void 0&&(_.internalFormat=h.internalFormat),h.type!==void 0&&(_.type=h.type),h.colorSpace!==void 0&&(_.colorSpace=h.colorSpace),h.minFilter!==void 0&&(_.minFilter=n(h.minFilter,W1)),h.magFilter!==void 0&&(_.magFilter=n(h.magFilter,W1)),h.anisotropy!==void 0&&(_.anisotropy=h.anisotropy),h.flipY!==void 0&&(_.flipY=h.flipY),h.generateMipmaps!==void 0&&(_.generateMipmaps=h.generateMipmaps),h.premultiplyAlpha!==void 0&&(_.premultiplyAlpha=h.premultiplyAlpha),h.unpackAlignment!==void 0&&(_.unpackAlignment=h.unpackAlignment),h.compareFunction!==void 0&&(_.compareFunction=h.compareFunction),h.userData!==void 0&&(_.userData=h.userData),i[h.uuid]=_}return i}parseObject(e,t,n,i,o){let l;function h(y){return t[y]===void 0&&Ut("ObjectLoader: Undefined geometry",y),t[y]}function d(y){if(y!==void 0){if(Array.isArray(y)){const x=[];for(let b=0,R=y.length;b<R;b++){const T=y[b];n[T]===void 0&&Ut("ObjectLoader: Undefined material",T),x.push(n[T])}return x}return n[y]===void 0&&Ut("ObjectLoader: Undefined material",y),n[y]}}function p(y){return i[y]===void 0&&Ut("ObjectLoader: Undefined texture",y),i[y]}let _,v;switch(e.type){case"Scene":l=new Mp,e.background!==void 0&&(Number.isInteger(e.background)?l.background=new Ct(e.background):l.background=p(e.background)),e.environment!==void 0&&(l.environment=p(e.environment)),e.fog!==void 0&&(e.fog.type==="Fog"?l.fog=new K0(e.fog.color,e.fog.near,e.fog.far):e.fog.type==="FogExp2"&&(l.fog=new q0(e.fog.color,e.fog.density)),e.fog.name!==""&&(l.fog.name=e.fog.name)),e.backgroundBlurriness!==void 0&&(l.backgroundBlurriness=e.backgroundBlurriness),e.backgroundIntensity!==void 0&&(l.backgroundIntensity=e.backgroundIntensity),e.backgroundRotation!==void 0&&l.backgroundRotation.fromArray(e.backgroundRotation),e.environmentIntensity!==void 0&&(l.environmentIntensity=e.environmentIntensity),e.environmentRotation!==void 0&&l.environmentRotation.fromArray(e.environmentRotation);break;case"PerspectiveCamera":l=new aa(e.fov,e.aspect,e.near,e.far),e.focus!==void 0&&(l.focus=e.focus),e.zoom!==void 0&&(l.zoom=e.zoom),e.filmGauge!==void 0&&(l.filmGauge=e.filmGauge),e.filmOffset!==void 0&&(l.filmOffset=e.filmOffset),e.view!==void 0&&(l.view=Object.assign({},e.view));break;case"OrthographicCamera":l=new Tl(e.left,e.right,e.top,e.bottom,e.near,e.far),e.zoom!==void 0&&(l.zoom=e.zoom),e.view!==void 0&&(l.view=Object.assign({},e.view));break;case"AmbientLight":l=new k1(e.color,e.intensity);break;case"DirectionalLight":l=new Pv(e.color,e.intensity),l.target=e.target||"";break;case"PointLight":l=new Hv(e.color,e.intensity,e.distance,e.decay);break;case"RectAreaLight":l=new X1(e.color,e.intensity,e.width,e.height);break;case"SpotLight":l=new Fv(e.color,e.intensity,e.distance,e.angle,e.penumbra,e.decay),l.target=e.target||"";break;case"HemisphereLight":l=new G1(e.color,e.groundColor,e.intensity);break;case"LightProbe":const y=new dA().fromArray(e.sh);l=new Y1(y,e.intensity);break;case"SkinnedMesh":_=h(e.geometry),v=d(e.material),l=new ev(_,v),e.bindMode!==void 0&&(l.bindMode=e.bindMode),e.bindMatrix!==void 0&&l.bindMatrix.fromArray(e.bindMatrix),e.skeleton!==void 0&&(l.skeleton=e.skeleton);break;case"Mesh":_=h(e.geometry),v=d(e.material),l=new yi(_,v);break;case"InstancedMesh":_=h(e.geometry),v=d(e.material);const x=e.count,b=e.instanceMatrix,R=e.instanceColor;l=new nv(_,v,x),l.instanceMatrix=new xc(new Float32Array(b.array),16),R!==void 0&&(l.instanceColor=new xc(new Float32Array(R.array),R.itemSize));break;case"BatchedMesh":_=h(e.geometry),v=d(e.material),l=new t1(e.maxInstanceCount,e.maxVertexCount,e.maxIndexCount,v),l.geometry=_,l.perObjectFrustumCulled=e.perObjectFrustumCulled,l.sortObjects=e.sortObjects,l._drawRanges=e.drawRanges,l._reservedRanges=e.reservedRanges,l._geometryInfo=e.geometryInfo.map(T=>{let M=null,w=null;return T.boundingBox!==void 0&&(M=new Ra().fromJSON(T.boundingBox)),T.boundingSphere!==void 0&&(w=new fa().fromJSON(T.boundingSphere)),{...T,boundingBox:M,boundingSphere:w}}),l._instanceInfo=e.instanceInfo,l._availableInstanceIds=e._availableInstanceIds,l._availableGeometryIds=e._availableGeometryIds,l._nextIndexStart=e.nextIndexStart,l._nextVertexStart=e.nextVertexStart,l._geometryCount=e.geometryCount,l._maxInstanceCount=e.maxInstanceCount,l._maxVertexCount=e.maxVertexCount,l._maxIndexCount=e.maxIndexCount,l._geometryInitialized=e.geometryInitialized,l._matricesTexture=p(e.matricesTexture.uuid),l._indirectTexture=p(e.indirectTexture.uuid),e.colorsTexture!==void 0&&(l._colorsTexture=p(e.colorsTexture.uuid)),e.boundingSphere!==void 0&&(l.boundingSphere=new fa().fromJSON(e.boundingSphere)),e.boundingBox!==void 0&&(l.boundingBox=new Ra().fromJSON(e.boundingBox));break;case"LOD":l=new Xb;break;case"Line":l=new wo(h(e.geometry),d(e.material));break;case"LineLoop":l=new fv(h(e.geometry),d(e.material));break;case"LineSegments":l=new yr(h(e.geometry),d(e.material));break;case"PointCloud":case"Points":l=new pv(h(e.geometry),d(e.material));break;case"Sprite":l=new Vb(d(e.material));break;case"Group":l=new vr;break;case"Bone":l=new Cp;break;default:l=new Un}if(l.uuid=e.uuid,e.name!==void 0&&(l.name=e.name),e.matrix!==void 0?(l.matrix.fromArray(e.matrix),e.matrixAutoUpdate!==void 0&&(l.matrixAutoUpdate=e.matrixAutoUpdate),l.matrixAutoUpdate&&l.matrix.decompose(l.position,l.quaternion,l.scale)):(e.position!==void 0&&l.position.fromArray(e.position),e.rotation!==void 0&&l.rotation.fromArray(e.rotation),e.quaternion!==void 0&&l.quaternion.fromArray(e.quaternion),e.scale!==void 0&&l.scale.fromArray(e.scale)),e.up!==void 0&&l.up.fromArray(e.up),e.castShadow!==void 0&&(l.castShadow=e.castShadow),e.receiveShadow!==void 0&&(l.receiveShadow=e.receiveShadow),e.shadow&&(e.shadow.intensity!==void 0&&(l.shadow.intensity=e.shadow.intensity),e.shadow.bias!==void 0&&(l.shadow.bias=e.shadow.bias),e.shadow.normalBias!==void 0&&(l.shadow.normalBias=e.shadow.normalBias),e.shadow.radius!==void 0&&(l.shadow.radius=e.shadow.radius),e.shadow.mapSize!==void 0&&l.shadow.mapSize.fromArray(e.shadow.mapSize),e.shadow.camera!==void 0&&(l.shadow.camera=this.parseObject(e.shadow.camera))),e.visible!==void 0&&(l.visible=e.visible),e.frustumCulled!==void 0&&(l.frustumCulled=e.frustumCulled),e.renderOrder!==void 0&&(l.renderOrder=e.renderOrder),e.userData!==void 0&&(l.userData=e.userData),e.layers!==void 0&&(l.layers.mask=e.layers),e.children!==void 0){const y=e.children;for(let x=0;x<y.length;x++)l.add(this.parseObject(y[x],t,n,i,o))}if(e.animations!==void 0){const y=e.animations;for(let x=0;x<y.length;x++){const b=y[x];l.animations.push(o[b])}}if(e.type==="LOD"){e.autoUpdate!==void 0&&(l.autoUpdate=e.autoUpdate);const y=e.levels;for(let x=0;x<y.length;x++){const b=y[x],R=l.getObjectByProperty("uuid",b.object);R!==void 0&&l.addLevel(R,b.distance,b.hysteresis)}}return l}bindSkeletons(e,t){Object.keys(t).length!==0&&e.traverse(function(n){if(n.isSkinnedMesh===!0&&n.skeleton!==void 0){const i=t[n.skeleton];i===void 0?Ut("ObjectLoader: No skeleton found with UUID:",n.skeleton):n.bind(i,n.bindMatrix)}})}bindLightTargets(e){e.traverse(function(t){if(t.isDirectionalLight||t.isSpotLight){const n=t.target,i=e.getObjectByProperty("uuid",n);i!==void 0?t.target=i:t.target=new Un}})}}const tB={UVMapping:rc,CubeReflectionMapping:qr,CubeRefractionMapping:oc,EquirectangularReflectionMapping:Wf,EquirectangularRefractionMapping:ep,CubeUVReflectionMapping:jf},K1={RepeatWrapping:Kr,ClampToEdgeWrapping:Ei,MirroredRepeatWrapping:_u},W1={NearestFilter:Ti,NearestMipmapNearestFilter:tp,NearestMipmapLinearFilter:lc,LinearFilter:Cn,LinearMipmapNearestFilter:yu,LinearMipmapLinearFilter:Is},pA=new WeakMap;class mA extends Ba{constructor(e){super(e),this.isImageBitmapLoader=!0,typeof createImageBitmap>"u"&&Ut("ImageBitmapLoader: createImageBitmap() not supported."),typeof fetch>"u"&&Ut("ImageBitmapLoader: fetch() not supported."),this.options={premultiplyAlpha:"none"},this._abortController=new AbortController}setOptions(e){return this.options=e,this}load(e,t,n,i){e===void 0&&(e=""),this.path!==void 0&&(e=this.path+e),e=this.manager.resolveURL(e);const o=this,l=Bo.get(`image-bitmap:${e}`);if(l!==void 0){if(o.manager.itemStart(e),l.then){l.then(p=>{if(pA.has(l)===!0)i&&i(pA.get(l)),o.manager.itemError(e),o.manager.itemEnd(e);else return t&&t(p),o.manager.itemEnd(e),p});return}return setTimeout(function(){t&&t(l),o.manager.itemEnd(e)},0),l}const h={};h.credentials=this.crossOrigin==="anonymous"?"same-origin":"include",h.headers=this.requestHeader,h.signal=typeof AbortSignal.any=="function"?AbortSignal.any([this._abortController.signal,this.manager.abortController.signal]):this._abortController.signal;const d=fetch(e,h).then(function(p){return p.blob()}).then(function(p){return createImageBitmap(p,Object.assign(o.options,{colorSpaceConversion:"none"}))}).then(function(p){return Bo.add(`image-bitmap:${e}`,p),t&&t(p),o.manager.itemEnd(e),p}).catch(function(p){i&&i(p),pA.set(d,p),Bo.remove(`image-bitmap:${e}`),o.manager.itemError(e),o.manager.itemEnd(e)});Bo.add(`image-bitmap:${e}`,d),o.manager.itemStart(e)}abort(){return this._abortController.abort(),this._abortController=new AbortController,this}}let zv;class gA{static getContext(){return zv===void 0&&(zv=new(window.AudioContext||window.webkitAudioContext)),zv}static setContext(e){zv=e}}class nB extends Ba{constructor(e){super(e)}load(e,t,n,i){const o=this,l=new da(this.manager);l.setResponseType("arraybuffer"),l.setPath(this.path),l.setRequestHeader(this.requestHeader),l.setWithCredentials(this.withCredentials),l.load(e,function(d){try{const p=d.slice(0);gA.getContext().decodeAudioData(p,function(v){t(v)}).catch(h)}catch(p){h(p)}},n,i);function h(d){i?i(d):Zt(d),o.manager.itemError(e)}}}const j1=new en,Z1=new en,ku=new en;class iB{constructor(){this.type="StereoCamera",this.aspect=1,this.eyeSep=.064,this.cameraL=new aa,this.cameraL.layers.enable(1),this.cameraL.matrixAutoUpdate=!1,this.cameraR=new aa,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,ku.copy(e.projectionMatrix);const i=t.eyeSep/2,o=i*t.near/t.focus,l=t.near*Math.tan(Tu*t.fov*.5)/t.zoom;let h,d;Z1.elements[12]=-i,j1.elements[12]=i,h=-l*t.aspect+o,d=l*t.aspect+o,ku.elements[0]=2*t.near/(d-h),ku.elements[8]=(d+h)/(d-h),this.cameraL.projectionMatrix.copy(ku),h=-l*t.aspect-o,d=l*t.aspect-o,ku.elements[0]=2*t.near/(d-h),ku.elements[8]=(d+h)/(d-h),this.cameraR.projectionMatrix.copy(ku)}this.cameraL.matrixWorld.copy(e.matrixWorld).multiply(Z1),this.cameraR.matrixWorld.copy(e.matrixWorld).multiply(j1)}}class Q1 extends aa{constructor(e=[]){super(),this.isArrayCamera=!0,this.isMultiViewCamera=!1,this.cameras=e}}class vA{constructor(e=!0){this.autoStart=e,this.startTime=0,this.oldTime=0,this.elapsedTime=0,this.running=!1}start(){this.startTime=performance.now(),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=performance.now();e=(t-this.oldTime)/1e3,this.oldTime=t,this.elapsedTime+=e}return e}}const Xu=new Z,_A=new Ca,aB=new Z,Yu=new Z,Ju=new Z;class sB extends Un{constructor(){super(),this.type="AudioListener",this.context=gA.getContext(),this.gain=this.context.createGain(),this.gain.connect(this.context.destination),this.filter=null,this.timeDelta=0,this._clock=new vA}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;if(this.timeDelta=this._clock.getDelta(),this.matrixWorld.decompose(Xu,_A,aB),Yu.set(0,0,-1).applyQuaternion(_A),Ju.set(0,1,0).applyQuaternion(_A),t.positionX){const n=this.context.currentTime+this.timeDelta;t.positionX.linearRampToValueAtTime(Xu.x,n),t.positionY.linearRampToValueAtTime(Xu.y,n),t.positionZ.linearRampToValueAtTime(Xu.z,n),t.forwardX.linearRampToValueAtTime(Yu.x,n),t.forwardY.linearRampToValueAtTime(Yu.y,n),t.forwardZ.linearRampToValueAtTime(Yu.z,n),t.upX.linearRampToValueAtTime(Ju.x,n),t.upY.linearRampToValueAtTime(Ju.y,n),t.upZ.linearRampToValueAtTime(Ju.z,n)}else t.setPosition(Xu.x,Xu.y,Xu.z),t.setOrientation(Yu.x,Yu.y,Yu.z,Ju.x,Ju.y,Ju.z)}}class $1 extends Un{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){Ut("Audio: Audio is already playing.");return}if(this.hasPlaybackControl===!1){Ut("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){Ut("Audio: this Audio has no playback control.");return}return this.isPlaying===!0&&(this._progress+=Math.max(this.context.currentTime-this._startedAt,0)*this.playbackRate,this.loop===!0&&(this._progress=this._progress%(this.duration||this.buffer.duration)),this.source.stop(),this.source.onended=null,this.isPlaying=!1),this}stop(e=0){if(this.hasPlaybackControl===!1){Ut("Audio: this Audio has no playback control.");return}return this._progress=0,this.source!==null&&(this.source.stop(this.context.currentTime+e),this.source.onended=null),this.isPlaying=!1,this}connect(){if(this.filters.length>0){this.source.connect(this.filters[0]);for(let e=1,t=this.filters.length;e<t;e++)this.filters[e-1].connect(this.filters[e]);this.filters[this.filters.length-1].connect(this.getOutput())}else this.source.connect(this.getOutput());return this._connected=!0,this}disconnect(){if(this._connected!==!1){if(this.filters.length>0){this.source.disconnect(this.filters[0]);for(let e=1,t=this.filters.length;e<t;e++)this.filters[e-1].disconnect(this.filters[e]);this.filters[this.filters.length-1].disconnect(this.getOutput())}else this.source.disconnect(this.getOutput());return this._connected=!1,this}}getFilters(){return this.filters}setFilters(e){return e||(e=[]),this._connected===!0?(this.disconnect(),this.filters=e.slice(),this.connect()):this.filters=e.slice(),this}setDetune(e){return this.detune=e,this.isPlaying===!0&&this.source.detune!==void 0&&this.source.detune.setTargetAtTime(this.detune,this.context.currentTime,.01),this}getDetune(){return this.detune}getFilter(){return this.getFilters()[0]}setFilter(e){return this.setFilters(e?[e]:[])}setPlaybackRate(e){if(this.hasPlaybackControl===!1){Ut("Audio: this Audio has no playback control.");return}return this.playbackRate=e,this.isPlaying===!0&&this.source.playbackRate.setTargetAtTime(this.playbackRate,this.context.currentTime,.01),this}getPlaybackRate(){return this.playbackRate}onEnded(){this.isPlaying=!1,this._progress=0}getLoop(){return this.hasPlaybackControl===!1?(Ut("Audio: this Audio has no playback control."),!1):this.loop}setLoop(e){if(this.hasPlaybackControl===!1){Ut("Audio: this Audio has no playback control.");return}return this.loop=e,this.isPlaying===!0&&(this.source.loop=this.loop),this}setLoopStart(e){return this.loopStart=e,this}setLoopEnd(e){return this.loopEnd=e,this}getVolume(){return this.gain.gain.value}setVolume(e){return this.gain.gain.setTargetAtTime(e,this.context.currentTime,.01),this}copy(e,t){return super.copy(e,t),e.sourceType!=="buffer"?(Ut("Audio: Audio source type cannot be copied."),this):(this.autoplay=e.autoplay,this.buffer=e.buffer,this.detune=e.detune,this.loop=e.loop,this.loopStart=e.loopStart,this.loopEnd=e.loopEnd,this.offset=e.offset,this.duration=e.duration,this.playbackRate=e.playbackRate,this.hasPlaybackControl=e.hasPlaybackControl,this.sourceType=e.sourceType,this.filters=e.filters.slice(),this)}clone(e){return new this.constructor(this.listener).copy(this,e)}}const qu=new Z,eE=new Ca,rB=new Z,Ku=new Z;class oB extends $1{constructor(e){super(e),this.panner=this.context.createPanner(),this.panner.panningModel="HRTF",this.panner.connect(this.gain)}connect(){return super.connect(),this.panner.connect(this.gain),this}disconnect(){return super.disconnect(),this.panner.disconnect(this.gain),this}getOutput(){return this.panner}getRefDistance(){return this.panner.refDistance}setRefDistance(e){return this.panner.refDistance=e,this}getRolloffFactor(){return this.panner.rolloffFactor}setRolloffFactor(e){return this.panner.rolloffFactor=e,this}getDistanceModel(){return this.panner.distanceModel}setDistanceModel(e){return this.panner.distanceModel=e,this}getMaxDistance(){return this.panner.maxDistance}setMaxDistance(e){return this.panner.maxDistance=e,this}setDirectionalCone(e,t,n){return this.panner.coneInnerAngle=e,this.panner.coneOuterAngle=t,this.panner.coneOuterGain=n,this}updateMatrixWorld(e){if(super.updateMatrixWorld(e),this.hasPlaybackControl===!0&&this.isPlaying===!1)return;this.matrixWorld.decompose(qu,eE,rB),Ku.set(0,0,1).applyQuaternion(eE);const t=this.panner;if(t.positionX){const n=this.context.currentTime+this.listener.timeDelta;t.positionX.linearRampToValueAtTime(qu.x,n),t.positionY.linearRampToValueAtTime(qu.y,n),t.positionZ.linearRampToValueAtTime(qu.z,n),t.orientationX.linearRampToValueAtTime(Ku.x,n),t.orientationY.linearRampToValueAtTime(Ku.y,n),t.orientationZ.linearRampToValueAtTime(Ku.z,n)}else t.setPosition(qu.x,qu.y,qu.z),t.setOrientation(Ku.x,Ku.y,Ku.z)}}class lB{constructor(e,t=2048){this.analyser=e.context.createAnalyser(),this.analyser.fftSize=t,this.data=new Uint8Array(this.analyser.frequencyBinCount),e.getOutput().connect(this.analyser)}getFrequencyData(){return this.analyser.getByteFrequencyData(this.data),this.data}getAverageFrequency(){let e=0;const t=this.getFrequencyData();for(let n=0;n<t.length;n++)e+=t[n];return e/t.length}}class tE{constructor(e,t,n){this.binding=e,this.valueSize=n;let i,o,l;switch(t){case"quaternion":i=this._slerp,o=this._slerpAdditive,l=this._setAdditiveIdentityQuaternion,this.buffer=new Float64Array(n*6),this._workIndex=5;break;case"string":case"bool":i=this._select,o=this._select,l=this._setAdditiveIdentityOther,this.buffer=new Array(n*5);break;default:i=this._lerp,o=this._lerpAdditive,l=this._setAdditiveIdentityNumeric,this.buffer=new Float64Array(n*5)}this._mixBufferRegion=i,this._mixBufferRegionAdditive=o,this._setIdentity=l,this._origIndex=3,this._addIndex=4,this.cumulativeWeight=0,this.cumulativeWeightAdditive=0,this.useCount=0,this.referenceCount=0}accumulate(e,t){const n=this.buffer,i=this.valueSize,o=e*i+i;let l=this.cumulativeWeight;if(l===0){for(let h=0;h!==i;++h)n[o+h]=n[h];l=t}else{l+=t;const h=t/l;this._mixBufferRegion(n,o,0,h,i)}this.cumulativeWeight=l}accumulateAdditive(e){const t=this.buffer,n=this.valueSize,i=n*this._addIndex;this.cumulativeWeightAdditive===0&&this._setIdentity(),this._mixBufferRegionAdditive(t,i,0,e,n),this.cumulativeWeightAdditive+=e}apply(e){const t=this.valueSize,n=this.buffer,i=e*t+t,o=this.cumulativeWeight,l=this.cumulativeWeightAdditive,h=this.binding;if(this.cumulativeWeight=0,this.cumulativeWeightAdditive=0,o<1){const d=t*this._origIndex;this._mixBufferRegion(n,i,d,1-o,t)}l>0&&this._mixBufferRegionAdditive(n,i,this._addIndex*t,1,t);for(let d=t,p=t+t;d!==p;++d)if(n[d]!==n[d+t]){h.setValue(n,i);break}}saveOriginalState(){const e=this.binding,t=this.buffer,n=this.valueSize,i=n*this._origIndex;e.getValue(t,i);for(let o=n,l=i;o!==l;++o)t[o]=t[i+o%n];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 n=e;n<t;n++)this.buffer[n]=0}_setAdditiveIdentityQuaternion(){this._setAdditiveIdentityNumeric(),this.buffer[this._addIndex*this.valueSize+3]=1}_setAdditiveIdentityOther(){const e=this._origIndex*this.valueSize,t=this._addIndex*this.valueSize;for(let n=0;n<this.valueSize;n++)this.buffer[t+n]=this.buffer[e+n]}_select(e,t,n,i,o){if(i>=.5)for(let l=0;l!==o;++l)e[t+l]=e[n+l]}_slerp(e,t,n,i){Ca.slerpFlat(e,t,e,t,e,n,i)}_slerpAdditive(e,t,n,i,o){const l=this._workIndex*o;Ca.multiplyQuaternionsFlat(e,l,e,t,e,n),Ca.slerpFlat(e,t,e,t,e,l,i)}_lerp(e,t,n,i,o){const l=1-i;for(let h=0;h!==o;++h){const d=t+h;e[d]=e[d]*l+e[n+h]*i}}_lerpAdditive(e,t,n,i,o){for(let l=0;l!==o;++l){const h=t+l;e[h]=e[h]+e[n+l]*i}}}const yA="\\[\\]\\.:\\/",cB=new RegExp("["+yA+"]","g"),xA="[^"+yA+"]",uB="[^"+yA.replace("\\.","")+"]",fB=/((?:WC+[\/:])*)/.source.replace("WC",xA),hB=/(WCOD+)?/.source.replace("WCOD",uB),dB=/(?:\.(WC+)(?:\[(.+)\])?)?/.source.replace("WC",xA),pB=/\.(WC+)(?:\[(.+)\])?/.source.replace("WC",xA),mB=new RegExp("^"+fB+hB+dB+pB+"$"),gB=["material","materials","bones","map"];class vB{constructor(e,t,n){const i=n||kn.parseTrackName(t);this._targetGroup=e,this._bindings=e.subscribe_(t,i)}getValue(e,t){this.bind();const n=this._targetGroup.nCachedObjects_,i=this._bindings[n];i!==void 0&&i.getValue(e,t)}setValue(e,t){const n=this._bindings;for(let i=this._targetGroup.nCachedObjects_,o=n.length;i!==o;++i)n[i].setValue(e,t)}bind(){const e=this._bindings;for(let t=this._targetGroup.nCachedObjects_,n=e.length;t!==n;++t)e[t].bind()}unbind(){const e=this._bindings;for(let t=this._targetGroup.nCachedObjects_,n=e.length;t!==n;++t)e[t].unbind()}}class kn{constructor(e,t,n){this.path=t,this.parsedPath=n||kn.parseTrackName(t),this.node=kn.findNode(e,this.parsedPath.nodeName),this.rootNode=e,this.getValue=this._getValue_unbound,this.setValue=this._setValue_unbound}static create(e,t,n){return e&&e.isAnimationObjectGroup?new kn.Composite(e,t,n):new kn(e,t,n)}static sanitizeNodeName(e){return e.replace(/\s/g,"_").replace(cB,"")}static parseTrackName(e){const t=mB.exec(e);if(t===null)throw new Error("PropertyBinding: Cannot parse trackName: "+e);const n={nodeName:t[2],objectName:t[3],objectIndex:t[4],propertyName:t[5],propertyIndex:t[6]},i=n.nodeName&&n.nodeName.lastIndexOf(".");if(i!==void 0&&i!==-1){const o=n.nodeName.substring(i+1);gB.indexOf(o)!==-1&&(n.nodeName=n.nodeName.substring(0,i),n.objectName=o)}if(n.propertyName===null||n.propertyName.length===0)throw new Error("PropertyBinding: can not parse propertyName from trackName: "+e);return n}static findNode(e,t){if(t===void 0||t===""||t==="."||t===-1||t===e.name||t===e.uuid)return e;if(e.skeleton){const n=e.skeleton.getBoneByName(t);if(n!==void 0)return n}if(e.children){const n=function(o){for(let l=0;l<o.length;l++){const h=o[l];if(h.name===t||h.uuid===t)return h;const d=n(h.children);if(d)return d}return null},i=n(e.children);if(i)return i}return null}_getValue_unavailable(){}_setValue_unavailable(){}_getValue_direct(e,t){e[t]=this.targetObject[this.propertyName]}_getValue_array(e,t){const n=this.resolvedProperty;for(let i=0,o=n.length;i!==o;++i)e[t++]=n[i]}_getValue_arrayElement(e,t){e[t]=this.resolvedProperty[this.propertyIndex]}_getValue_toArray(e,t){this.resolvedProperty.toArray(e,t)}_setValue_direct(e,t){this.targetObject[this.propertyName]=e[t]}_setValue_direct_setNeedsUpdate(e,t){this.targetObject[this.propertyName]=e[t],this.targetObject.needsUpdate=!0}_setValue_direct_setMatrixWorldNeedsUpdate(e,t){this.targetObject[this.propertyName]=e[t],this.targetObject.matrixWorldNeedsUpdate=!0}_setValue_array(e,t){const n=this.resolvedProperty;for(let i=0,o=n.length;i!==o;++i)n[i]=e[t++]}_setValue_array_setNeedsUpdate(e,t){const n=this.resolvedProperty;for(let i=0,o=n.length;i!==o;++i)n[i]=e[t++];this.targetObject.needsUpdate=!0}_setValue_array_setMatrixWorldNeedsUpdate(e,t){const n=this.resolvedProperty;for(let i=0,o=n.length;i!==o;++i)n[i]=e[t++];this.targetObject.matrixWorldNeedsUpdate=!0}_setValue_arrayElement(e,t){this.resolvedProperty[this.propertyIndex]=e[t]}_setValue_arrayElement_setNeedsUpdate(e,t){this.resolvedProperty[this.propertyIndex]=e[t],this.targetObject.needsUpdate=!0}_setValue_arrayElement_setMatrixWorldNeedsUpdate(e,t){this.resolvedProperty[this.propertyIndex]=e[t],this.targetObject.matrixWorldNeedsUpdate=!0}_setValue_fromArray(e,t){this.resolvedProperty.fromArray(e,t)}_setValue_fromArray_setNeedsUpdate(e,t){this.resolvedProperty.fromArray(e,t),this.targetObject.needsUpdate=!0}_setValue_fromArray_setMatrixWorldNeedsUpdate(e,t){this.resolvedProperty.fromArray(e,t),this.targetObject.matrixWorldNeedsUpdate=!0}_getValue_unbound(e,t){this.bind(),this.getValue(e,t)}_setValue_unbound(e,t){this.bind(),this.setValue(e,t)}bind(){let e=this.node;const t=this.parsedPath,n=t.objectName,i=t.propertyName;let o=t.propertyIndex;if(e||(e=kn.findNode(this.rootNode,t.nodeName),this.node=e),this.getValue=this._getValue_unavailable,this.setValue=this._setValue_unavailable,!e){Ut("PropertyBinding: No target node found for track: "+this.path+".");return}if(n){let p=t.objectIndex;switch(n){case"materials":if(!e.material){Zt("PropertyBinding: Can not bind to material as node does not have a material.",this);return}if(!e.material.materials){Zt("PropertyBinding: Can not bind to material.materials as node.material does not have a materials array.",this);return}e=e.material.materials;break;case"bones":if(!e.skeleton){Zt("PropertyBinding: Can not bind to bones as node does not have a skeleton.",this);return}e=e.skeleton.bones;for(let _=0;_<e.length;_++)if(e[_].name===p){p=_;break}break;case"map":if("map"in e){e=e.map;break}if(!e.material){Zt("PropertyBinding: Can not bind to material as node does not have a material.",this);return}if(!e.material.map){Zt("PropertyBinding: Can not bind to material.map as node.material does not have a map.",this);return}e=e.material.map;break;default:if(e[n]===void 0){Zt("PropertyBinding: Can not bind to objectName of node undefined.",this);return}e=e[n]}if(p!==void 0){if(e[p]===void 0){Zt("PropertyBinding: Trying to bind to objectIndex of objectName, but is undefined.",this,e);return}e=e[p]}}const l=e[i];if(l===void 0){const p=t.nodeName;Zt("PropertyBinding: Trying to update property for track: "+p+"."+i+" but it wasn't found.",e);return}let h=this.Versioning.None;this.targetObject=e,e.isMaterial===!0?h=this.Versioning.NeedsUpdate:e.isObject3D===!0&&(h=this.Versioning.MatrixWorldNeedsUpdate);let d=this.BindingType.Direct;if(o!==void 0){if(i==="morphTargetInfluences"){if(!e.geometry){Zt("PropertyBinding: Can not bind to morphTargetInfluences because node does not have a geometry.",this);return}if(!e.geometry.morphAttributes){Zt("PropertyBinding: Can not bind to morphTargetInfluences because node does not have a geometry.morphAttributes.",this);return}e.morphTargetDictionary[o]!==void 0&&(o=e.morphTargetDictionary[o])}d=this.BindingType.ArrayElement,this.resolvedProperty=l,this.propertyIndex=o}else l.fromArray!==void 0&&l.toArray!==void 0?(d=this.BindingType.HasFromToArray,this.resolvedProperty=l):Array.isArray(l)?(d=this.BindingType.EntireArray,this.resolvedProperty=l):this.propertyName=i;this.getValue=this.GetterByBindingType[d],this.setValue=this.SetterByBindingTypeAndVersioning[d][h]}unbind(){this.node=null,this.getValue=this._getValue_unbound,this.setValue=this._setValue_unbound}}kn.Composite=vB,kn.prototype.BindingType={Direct:0,EntireArray:1,ArrayElement:2,HasFromToArray:3},kn.prototype.Versioning={None:0,NeedsUpdate:1,MatrixWorldNeedsUpdate:2},kn.prototype.GetterByBindingType=[kn.prototype._getValue_direct,kn.prototype._getValue_array,kn.prototype._getValue_arrayElement,kn.prototype._getValue_toArray],kn.prototype.SetterByBindingTypeAndVersioning=[[kn.prototype._setValue_direct,kn.prototype._setValue_direct_setNeedsUpdate,kn.prototype._setValue_direct_setMatrixWorldNeedsUpdate],[kn.prototype._setValue_array,kn.prototype._setValue_array_setNeedsUpdate,kn.prototype._setValue_array_setMatrixWorldNeedsUpdate],[kn.prototype._setValue_arrayElement,kn.prototype._setValue_arrayElement_setNeedsUpdate,kn.prototype._setValue_arrayElement_setMatrixWorldNeedsUpdate],[kn.prototype._setValue_fromArray,kn.prototype._setValue_fromArray_setNeedsUpdate,kn.prototype._setValue_fromArray_setMatrixWorldNeedsUpdate]];class _B{constructor(){this.isAnimationObjectGroup=!0,this.uuid=Qs(),this._objects=Array.prototype.slice.call(arguments),this.nCachedObjects_=0;const e={};this._indicesByUUID=e;for(let n=0,i=arguments.length;n!==i;++n)e[arguments[n].uuid]=n;this._paths=[],this._parsedPaths=[],this._bindings=[],this._bindingsIndicesByPath={};const t=this;this.stats={objects:{get total(){return t._objects.length},get inUse(){return this.total-t.nCachedObjects_}},get bindingsPerObject(){return t._bindings.length}}}add(){const e=this._objects,t=this._indicesByUUID,n=this._paths,i=this._parsedPaths,o=this._bindings,l=o.length;let h,d=e.length,p=this.nCachedObjects_;for(let _=0,v=arguments.length;_!==v;++_){const y=arguments[_],x=y.uuid;let b=t[x];if(b===void 0){b=d++,t[x]=b,e.push(y);for(let R=0,T=l;R!==T;++R)o[R].push(new kn(y,n[R],i[R]))}else if(b<p){h=e[b];const R=--p,T=e[R];t[T.uuid]=b,e[b]=T,t[x]=R,e[R]=y;for(let M=0,w=l;M!==w;++M){const D=o[M],N=D[R];let H=D[b];D[b]=N,H===void 0&&(H=new kn(y,n[M],i[M])),D[R]=H}}else e[b]!==h&&Zt("AnimationObjectGroup: Different objects with the same UUID detected. Clean the caches or recreate your infrastructure when reloading scenes.")}this.nCachedObjects_=p}remove(){const e=this._objects,t=this._indicesByUUID,n=this._bindings,i=n.length;let o=this.nCachedObjects_;for(let l=0,h=arguments.length;l!==h;++l){const d=arguments[l],p=d.uuid,_=t[p];if(_!==void 0&&_>=o){const v=o++,y=e[v];t[y.uuid]=_,e[_]=y,t[p]=v,e[v]=d;for(let x=0,b=i;x!==b;++x){const R=n[x],T=R[v],M=R[_];R[_]=T,R[v]=M}}}this.nCachedObjects_=o}uncache(){const e=this._objects,t=this._indicesByUUID,n=this._bindings,i=n.length;let o=this.nCachedObjects_,l=e.length;for(let h=0,d=arguments.length;h!==d;++h){const p=arguments[h],_=p.uuid,v=t[_];if(v!==void 0)if(delete t[_],v<o){const y=--o,x=e[y],b=--l,R=e[b];t[x.uuid]=v,e[v]=x,t[R.uuid]=y,e[y]=R,e.pop();for(let T=0,M=i;T!==M;++T){const w=n[T],D=w[y],N=w[b];w[v]=D,w[y]=N,w.pop()}}else{const y=--l,x=e[y];y>0&&(t[x.uuid]=v),e[v]=x,e.pop();for(let b=0,R=i;b!==R;++b){const T=n[b];T[v]=T[y],T.pop()}}}this.nCachedObjects_=o}subscribe_(e,t){const n=this._bindingsIndicesByPath;let i=n[e];const o=this._bindings;if(i!==void 0)return o[i];const l=this._paths,h=this._parsedPaths,d=this._objects,p=d.length,_=this.nCachedObjects_,v=new Array(p);i=o.length,n[e]=i,l.push(e),h.push(t),o.push(v);for(let y=_,x=d.length;y!==x;++y){const b=d[y];v[y]=new kn(b,e,t)}return v}unsubscribe_(e){const t=this._bindingsIndicesByPath,n=t[e];if(n!==void 0){const i=this._paths,o=this._parsedPaths,l=this._bindings,h=l.length-1,d=l[h],p=e[h];t[p]=n,l[n]=d,l.pop(),o[n]=o[h],o.pop(),i[n]=i[h],i.pop()}}}class nE{constructor(e,t,n=null,i=t.blendMode){this._mixer=e,this._clip=t,this._localRoot=n,this.blendMode=i;const o=t.tracks,l=o.length,h=new Array(l),d={endingStart:Su,endingEnd:Su};for(let p=0;p!==l;++p){const _=o[p].createInterpolant(null);h[p]=_,_.settings=d}this._interpolantSettings=d,this._interpolants=h,this._propertyBindings=new Array(l),this._cacheIndex=null,this._byClipCacheIndex=null,this._timeScaleInterpolant=null,this._weightInterpolant=null,this.loop=ib,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,n=!1){if(e.fadeOut(t),this.fadeIn(t),n===!0){const i=this._clip.duration,o=e._clip.duration,l=o/i,h=i/o;e.warp(1,l,t),this.warp(h,1,t)}return this}crossFadeTo(e,t,n=!1){return e.crossFadeFrom(this,t,n)}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,n){const i=this._mixer,o=i.time,l=this.timeScale;let h=this._timeScaleInterpolant;h===null&&(h=i._lendControlInterpolant(),this._timeScaleInterpolant=h);const d=h.parameterPositions,p=h.sampleValues;return d[0]=o,d[1]=o+n,p[0]=e/l,p[1]=t/l,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,n,i){if(!this.enabled){this._updateWeight(e);return}const o=this._startTime;if(o!==null){const d=(e-o)*n;d<0||n===0?t=0:(this._startTime=null,t=n*d)}t*=this._updateTimeScale(e);const l=this._updateTime(t),h=this._updateWeight(e);if(h>0){const d=this._interpolants,p=this._propertyBindings;switch(this.blendMode){case rx:for(let _=0,v=d.length;_!==v;++_)d[_].evaluate(l),p[_].accumulateAdditive(h);break;case S0:default:for(let _=0,v=d.length;_!==v;++_)d[_].evaluate(l),p[_].accumulate(i,h)}}}_updateWeight(e){let t=0;if(this.enabled){t=this.weight;const n=this._weightInterpolant;if(n!==null){const i=n.evaluate(e)[0];t*=i,e>n.parameterPositions[1]&&(this.stopFading(),i===0&&(this.enabled=!1))}}return this._effectiveWeight=t,t}_updateTimeScale(e){let t=0;if(!this.paused){t=this.timeScale;const n=this._timeScaleInterpolant;if(n!==null){const i=n.evaluate(e)[0];t*=i,e>n.parameterPositions[1]&&(this.stopWarping(),t===0?this.paused=!0:this.timeScale=t)}}return this._effectiveTimeScale=t,t}_updateTime(e){const t=this._clip.duration,n=this.loop;let i=this.time+e,o=this._loopCount;const l=n===ab;if(e===0)return o===-1?i:l&&(o&1)===1?t-i:i;if(n===cp){o===-1&&(this._loopCount=0,this._setEndings(!0,!0,!1));e:{if(i>=t)i=t;else if(i<0)i=0;else{this.time=i;break e}this.clampWhenFinished?this.paused=!0:this.enabled=!1,this.time=i,this._mixer.dispatchEvent({type:"finished",action:this,direction:e<0?-1:1})}}else{if(o===-1&&(e>=0?(o=0,this._setEndings(!0,this.repetitions===0,l)):this._setEndings(this.repetitions===0,!0,l)),i>=t||i<0){const h=Math.floor(i/t);i-=t*h,o+=Math.abs(h);const d=this.repetitions-o;if(d<=0)this.clampWhenFinished?this.paused=!0:this.enabled=!1,i=e>0?t:0,this.time=i,this._mixer.dispatchEvent({type:"finished",action:this,direction:e>0?1:-1});else{if(d===1){const p=e<0;this._setEndings(p,!p,l)}else this._setEndings(!1,!1,l);this._loopCount=o,this.time=i,this._mixer.dispatchEvent({type:"loop",action:this,loopDelta:h})}}else this.time=i;if(l&&(o&1)===1)return t-i}return i}_setEndings(e,t,n){const i=this._interpolantSettings;n?(i.endingStart=Mu,i.endingEnd=Mu):(e?i.endingStart=this.zeroSlopeAtStart?Mu:Su:i.endingStart=up,t?i.endingEnd=this.zeroSlopeAtEnd?Mu:Su:i.endingEnd=up)}_scheduleFading(e,t,n){const i=this._mixer,o=i.time;let l=this._weightInterpolant;l===null&&(l=i._lendControlInterpolant(),this._weightInterpolant=l);const h=l.parameterPositions,d=l.sampleValues;return h[0]=o,d[0]=t,h[1]=o+e,d[1]=n,this}}const yB=new Float32Array(1);class iE extends To{constructor(e){super(),this._root=e,this._initMemoryManager(),this._accuIndex=0,this.time=0,this.timeScale=1}_bindAction(e,t){const n=e._localRoot||this._root,i=e._clip.tracks,o=i.length,l=e._propertyBindings,h=e._interpolants,d=n.uuid,p=this._bindingsByRootAndName;let _=p[d];_===void 0&&(_={},p[d]=_);for(let v=0;v!==o;++v){const y=i[v],x=y.name;let b=_[x];if(b!==void 0)++b.referenceCount,l[v]=b;else{if(b=l[v],b!==void 0){b._cacheIndex===null&&(++b.referenceCount,this._addInactiveBinding(b,d,x));continue}const R=t&&t._propertyBindings[v].binding.parsedPath;b=new tE(kn.create(n,x,R),y.ValueTypeName,y.getValueSize()),++b.referenceCount,this._addInactiveBinding(b,d,x),l[v]=b}h[v].resultBuffer=b.buffer}}_activateAction(e){if(!this._isActiveAction(e)){if(e._cacheIndex===null){const n=(e._localRoot||this._root).uuid,i=e._clip.uuid,o=this._actionsByClip[i];this._bindAction(e,o&&o.knownActions[0]),this._addInactiveAction(e,i,n)}const t=e._propertyBindings;for(let n=0,i=t.length;n!==i;++n){const o=t[n];o.useCount++===0&&(this._lendBinding(o),o.saveOriginalState())}this._lendAction(e)}}_deactivateAction(e){if(this._isActiveAction(e)){const t=e._propertyBindings;for(let n=0,i=t.length;n!==i;++n){const o=t[n];--o.useCount===0&&(o.restoreOriginalState(),this._takeBackBinding(o))}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<this._nActiveActions}_addInactiveAction(e,t,n){const i=this._actions,o=this._actionsByClip;let l=o[t];if(l===void 0)l={knownActions:[e],actionByRoot:{}},e._byClipCacheIndex=0,o[t]=l;else{const h=l.knownActions;e._byClipCacheIndex=h.length,h.push(e)}e._cacheIndex=i.length,i.push(e),l.actionByRoot[n]=e}_removeInactiveAction(e){const t=this._actions,n=t[t.length-1],i=e._cacheIndex;n._cacheIndex=i,t[i]=n,t.pop(),e._cacheIndex=null;const o=e._clip.uuid,l=this._actionsByClip,h=l[o],d=h.knownActions,p=d[d.length-1],_=e._byClipCacheIndex;p._byClipCacheIndex=_,d[_]=p,d.pop(),e._byClipCacheIndex=null;const v=h.actionByRoot,y=(e._localRoot||this._root).uuid;delete v[y],d.length===0&&delete l[o],this._removeInactiveBindingsForAction(e)}_removeInactiveBindingsForAction(e){const t=e._propertyBindings;for(let n=0,i=t.length;n!==i;++n){const o=t[n];--o.referenceCount===0&&this._removeInactiveBinding(o)}}_lendAction(e){const t=this._actions,n=e._cacheIndex,i=this._nActiveActions++,o=t[i];e._cacheIndex=i,t[i]=e,o._cacheIndex=n,t[n]=o}_takeBackAction(e){const t=this._actions,n=e._cacheIndex,i=--this._nActiveActions,o=t[i];e._cacheIndex=i,t[i]=e,o._cacheIndex=n,t[n]=o}_addInactiveBinding(e,t,n){const i=this._bindingsByRootAndName,o=this._bindings;let l=i[t];l===void 0&&(l={},i[t]=l),l[n]=e,e._cacheIndex=o.length,o.push(e)}_removeInactiveBinding(e){const t=this._bindings,n=e.binding,i=n.rootNode.uuid,o=n.path,l=this._bindingsByRootAndName,h=l[i],d=t[t.length-1],p=e._cacheIndex;d._cacheIndex=p,t[p]=d,t.pop(),delete h[o],Object.keys(h).length===0&&delete l[i]}_lendBinding(e){const t=this._bindings,n=e._cacheIndex,i=this._nActiveBindings++,o=t[i];e._cacheIndex=i,t[i]=e,o._cacheIndex=n,t[n]=o}_takeBackBinding(e){const t=this._bindings,n=e._cacheIndex,i=--this._nActiveBindings,o=t[i];e._cacheIndex=i,t[i]=e,o._cacheIndex=n,t[n]=o}_lendControlInterpolant(){const e=this._controlInterpolants,t=this._nActiveControlInterpolants++;let n=e[t];return n===void 0&&(n=new oA(new Float32Array(2),new Float32Array(2),1,yB),n.__cacheIndex=t,e[t]=n),n}_takeBackControlInterpolant(e){const t=this._controlInterpolants,n=e.__cacheIndex,i=--this._nActiveControlInterpolants,o=t[i];e.__cacheIndex=i,t[i]=e,o.__cacheIndex=n,t[n]=o}clipAction(e,t,n){const i=t||this._root,o=i.uuid;let l=typeof e=="string"?Vu.findByName(i,e):e;const h=l!==null?l.uuid:e,d=this._actionsByClip[h];let p=null;if(n===void 0&&(l!==null?n=l.blendMode:n=S0),d!==void 0){const v=d.actionByRoot[o];if(v!==void 0&&v.blendMode===n)return v;p=d.knownActions[0],l===null&&(l=p._clip)}if(l===null)return null;const _=new nE(this,l,t,n);return this._bindAction(_,p),this._addInactiveAction(_,h,o),_}existingAction(e,t){const n=t||this._root,i=n.uuid,o=typeof e=="string"?Vu.findByName(n,e):e,l=o?o.uuid:e,h=this._actionsByClip[l];return h!==void 0&&h.actionByRoot[i]||null}stopAllAction(){const e=this._actions,t=this._nActiveActions;for(let n=t-1;n>=0;--n)e[n].stop();return this}update(e){e*=this.timeScale;const t=this._actions,n=this._nActiveActions,i=this.time+=e,o=Math.sign(e),l=this._accuIndex^=1;for(let p=0;p!==n;++p)t[p]._update(i,e,o,l);const h=this._bindings,d=this._nActiveBindings;for(let p=0;p!==d;++p)h[p].apply(l);return this}setTime(e){this.time=0;for(let t=0;t<this._actions.length;t++)this._actions[t].time=0;return this.update(e)}getRoot(){return this._root}uncacheClip(e){const t=this._actions,n=e.uuid,i=this._actionsByClip,o=i[n];if(o!==void 0){const l=o.knownActions;for(let h=0,d=l.length;h!==d;++h){const p=l[h];this._deactivateAction(p);const _=p._cacheIndex,v=t[t.length-1];p._cacheIndex=null,p._byClipCacheIndex=null,v._cacheIndex=_,t[_]=v,t.pop(),this._removeInactiveBindingsForAction(p)}delete i[n]}}uncacheRoot(e){const t=e.uuid,n=this._actionsByClip;for(const l in n){const h=n[l].actionByRoot,d=h[t];d!==void 0&&(this._deactivateAction(d),this._removeInactiveAction(d))}const i=this._bindingsByRootAndName,o=i[t];if(o!==void 0)for(const l in o){const h=o[l];h.restoreOriginalState(),this._removeInactiveBinding(h)}}uncacheAction(e,t){const n=this.existingAction(e,t);n!==null&&(this._deactivateAction(n),this._removeInactiveAction(n))}}class xB extends mx{constructor(e=1,t=1,n=1,i={}){super(e,t,i),this.isRenderTarget3D=!0,this.depth=n,this.texture=new C0(null,e,t,n),this._setTextureOptions(i),this.texture.isRenderTargetTexture=!0}}class AA{constructor(e){this.value=e}clone(){return new AA(this.value.clone===void 0?this.value:this.value.clone())}}let AB=0;class SB extends To{constructor(){super(),this.isUniformsGroup=!0,Object.defineProperty(this,"id",{value:AB++}),this.name="",this.usage=dp,this.uniforms=[]}add(e){return this.uniforms.push(e),this}remove(e){const t=this.uniforms.indexOf(e);return t!==-1&&this.uniforms.splice(t,1),this}setName(e){return this.name=e,this}setUsage(e){return this.usage=e,this}dispose(){this.dispatchEvent({type:"dispose"})}copy(e){this.name=e.name,this.usage=e.usage;const t=e.uniforms;this.uniforms.length=0;for(let n=0,i=t.length;n<i;n++){const o=Array.isArray(t[n])?t[n]:[t[n]];for(let l=0;l<o.length;l++)this.uniforms.push(o[l].clone())}return this}clone(){return new this.constructor().copy(this)}}class MB extends yh{constructor(e,t,n=1){super(e,t),this.isInstancedInterleavedBuffer=!0,this.meshPerAttribute=n}copy(e){return super.copy(e),this.meshPerAttribute=e.meshPerAttribute,this}clone(e){const t=super.clone(e);return t.meshPerAttribute=this.meshPerAttribute,t}toJSON(e){const t=super.toJSON(e);return t.isInstancedInterleavedBuffer=!0,t.meshPerAttribute=this.meshPerAttribute,t}}class bB{constructor(e,t,n,i,o,l=!1){this.isGLBufferAttribute=!0,this.name="",this.buffer=e,this.type=t,this.itemSize=n,this.elementSize=i,this.count=o,this.normalized=l,this.version=0}set needsUpdate(e){e===!0&&this.version++}setBuffer(e){return this.buffer=e,this}setType(e,t){return this.type=e,this.elementSize=t,this}setItemSize(e){return this.itemSize=e,this}setCount(e){return this.count=e,this}}const aE=new en;class SA{constructor(e,t,n=0,i=1/0){this.ray=new lh(e,t),this.near=n,this.far=i,this.camera=null,this.layers=new uh,this.params={Mesh:{},Line:{threshold:1},LOD:{},Points:{threshold:1},Sprite:{}}}set(e,t){this.ray.set(e,t)}setFromCamera(e,t){t.isPerspectiveCamera?(this.ray.origin.setFromMatrixPosition(t.matrixWorld),this.ray.direction.set(e.x,e.y,.5).unproject(t).sub(this.ray.origin).normalize(),this.camera=t):t.isOrthographicCamera?(this.ray.origin.set(e.x,e.y,(t.near+t.far)/(t.near-t.far)).unproject(t),this.ray.direction.set(0,0,-1).transformDirection(t.matrixWorld),this.camera=t):Zt("Raycaster: Unsupported camera type: "+t.type)}setFromXRController(e){return aE.identity().extractRotation(e.matrixWorld),this.ray.origin.setFromMatrixPosition(e.matrixWorld),this.ray.direction.set(0,0,-1).applyMatrix4(aE),this}intersectObject(e,t=!0,n=[]){return MA(e,this,n,t),n.sort(sE),n}intersectObjects(e,t=!0,n=[]){for(let i=0,o=e.length;i<o;i++)MA(e[i],this,n,t);return n.sort(sE),n}}function sE(s,e){return s.distance-e.distance}function MA(s,e,t,n){let i=!0;if(s.layers.test(e.layers)&&s.raycast(e,t)===!1&&(i=!1),i===!0&&n===!0){const o=s.children;for(let l=0,h=o.length;l<h;l++)MA(o[l],e,t,!0)}}class EB{constructor(){this._previousTime=0,this._currentTime=0,this._startTime=performance.now(),this._delta=0,this._elapsed=0,this._timescale=1,this._document=null,this._pageVisibilityHandler=null}connect(e){this._document=e,e.hidden!==void 0&&(this._pageVisibilityHandler=TB.bind(this),e.addEventListener("visibilitychange",this._pageVisibilityHandler,!1))}disconnect(){this._pageVisibilityHandler!==null&&(this._document.removeEventListener("visibilitychange",this._pageVisibilityHandler),this._pageVisibilityHandler=null),this._document=null}getDelta(){return this._delta/1e3}getElapsed(){return this._elapsed/1e3}getTimescale(){return this._timescale}setTimescale(e){return this._timescale=e,this}reset(){return this._currentTime=performance.now()-this._startTime,this}dispose(){this.disconnect()}update(e){return this._pageVisibilityHandler!==null&&this._document.hidden===!0?this._delta=0:(this._previousTime=this._currentTime,this._currentTime=(e!==void 0?e:performance.now())-this._startTime,this._delta=(this._currentTime-this._previousTime)*this._timescale,this._elapsed+=this._delta),this}}function TB(){this._document.hidden===!1&&this.reset()}class CB{constructor(e=1,t=0,n=0){this.radius=e,this.phi=t,this.theta=n}set(e,t,n){return this.radius=e,this.phi=t,this.theta=n,this}copy(e){return this.radius=e.radius,this.phi=e.phi,this.theta=e.theta,this}makeSafe(){return this.phi=dn(this.phi,1e-6,Math.PI-1e-6),this}setFromVector3(e){return this.setFromCartesianCoords(e.x,e.y,e.z)}setFromCartesianCoords(e,t,n){return this.radius=Math.sqrt(e*e+t*t+n*n),this.radius===0?(this.theta=0,this.phi=0):(this.theta=Math.atan2(e,n),this.phi=Math.acos(dn(t/this.radius,-1,1))),this}clone(){return new this.constructor().copy(this)}}class RB{constructor(e=1,t=0,n=0){this.radius=e,this.theta=t,this.y=n}set(e,t,n){return this.radius=e,this.theta=t,this.y=n,this}copy(e){return this.radius=e.radius,this.theta=e.theta,this.y=e.y,this}setFromVector3(e){return this.setFromCartesianCoords(e.x,e.y,e.z)}setFromCartesianCoords(e,t,n){return this.radius=Math.sqrt(e*e+n*n),this.theta=Math.atan2(e,n),this.y=t,this}clone(){return new this.constructor().copy(this)}}class bA{constructor(e,t,n,i){bA.prototype.isMatrix2=!0,this.elements=[1,0,0,1],e!==void 0&&this.set(e,t,n,i)}identity(){return this.set(1,0,0,1),this}fromArray(e,t=0){for(let n=0;n<4;n++)this.elements[n]=e[n+t];return this}set(e,t,n,i){const o=this.elements;return o[0]=e,o[2]=t,o[1]=n,o[3]=i,this}}const rE=new nt;class wB{constructor(e=new nt(1/0,1/0),t=new nt(-1/0,-1/0)){this.isBox2=!0,this.min=e,this.max=t}set(e,t){return this.min.copy(e),this.max.copy(t),this}setFromPoints(e){this.makeEmpty();for(let t=0,n=e.length;t<n;t++)this.expandByPoint(e[t]);return this}setFromCenterAndSize(e,t){const n=rE.copy(t).multiplyScalar(.5);return this.min.copy(e).sub(n),this.max.copy(e).add(n),this}clone(){return new this.constructor().copy(this)}copy(e){return this.min.copy(e.min),this.max.copy(e.max),this}makeEmpty(){return this.min.x=this.min.y=1/0,this.max.x=this.max.y=-1/0,this}isEmpty(){return this.max.x<this.min.x||this.max.y<this.min.y}getCenter(e){return this.isEmpty()?e.set(0,0):e.addVectors(this.min,this.max).multiplyScalar(.5)}getSize(e){return this.isEmpty()?e.set(0,0):e.subVectors(this.max,this.min)}expandByPoint(e){return this.min.min(e),this.max.max(e),this}expandByVector(e){return this.min.sub(e),this.max.add(e),this}expandByScalar(e){return this.min.addScalar(-e),this.max.addScalar(e),this}containsPoint(e){return e.x>=this.min.x&&e.x<=this.max.x&&e.y>=this.min.y&&e.y<=this.max.y}containsBox(e){return this.min.x<=e.min.x&&e.max.x<=this.max.x&&this.min.y<=e.min.y&&e.max.y<=this.max.y}getParameter(e,t){return t.set((e.x-this.min.x)/(this.max.x-this.min.x),(e.y-this.min.y)/(this.max.y-this.min.y))}intersectsBox(e){return e.max.x>=this.min.x&&e.min.x<=this.max.x&&e.max.y>=this.min.y&&e.min.y<=this.max.y}clampPoint(e,t){return t.copy(e).clamp(this.min,this.max)}distanceToPoint(e){return this.clampPoint(e,rE).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 oE=new Z,Vv=new Z,Bh=new Z,Dh=new Z,EA=new Z,BB=new Z,DB=new Z;class NB{constructor(e=new Z,t=new Z){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){oE.subVectors(e,this.start),Vv.subVectors(this.end,this.start);const n=Vv.dot(Vv);let o=Vv.dot(oE)/n;return t&&(o=dn(o,0,1)),o}closestPointToPoint(e,t,n){const i=this.closestPointToPointParameter(e,t);return this.delta(n).multiplyScalar(i).add(this.start)}distanceSqToLine3(e,t=BB,n=DB){const i=10000000000000001e-32;let o,l;const h=this.start,d=e.start,p=this.end,_=e.end;Bh.subVectors(p,h),Dh.subVectors(_,d),EA.subVectors(h,d);const v=Bh.dot(Bh),y=Dh.dot(Dh),x=Dh.dot(EA);if(v<=i&&y<=i)return t.copy(h),n.copy(d),t.sub(n),t.dot(t);if(v<=i)o=0,l=x/y,l=dn(l,0,1);else{const b=Bh.dot(EA);if(y<=i)l=0,o=dn(-b/v,0,1);else{const R=Bh.dot(Dh),T=v*y-R*R;T!==0?o=dn((R*x-b*y)/T,0,1):o=0,l=(R*o+x)/y,l<0?(l=0,o=dn(-b/v,0,1)):l>1&&(l=1,o=dn((R-b)/v,0,1))}}return t.copy(h).add(Bh.multiplyScalar(o)),n.copy(d).add(Dh.multiplyScalar(l)),t.sub(n),t.dot(t)}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 lE=new Z;class UB extends Un{constructor(e,t){super(),this.light=e,this.matrixAutoUpdate=!1,this.color=t,this.type="SpotLightHelper";const n=new pn,i=[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 l=0,h=1,d=32;l<d;l++,h++){const p=l/d*Math.PI*2,_=h/d*Math.PI*2;i.push(Math.cos(p),Math.sin(p),1,Math.cos(_),Math.sin(_),1)}n.setAttribute("position",new Xt(i,3));const o=new za({fog:!1,toneMapped:!1});this.cone=new yr(n,o),this.add(this.cone),this.update()}dispose(){this.cone.geometry.dispose(),this.cone.material.dispose()}update(){this.light.updateWorldMatrix(!0,!1),this.light.target.updateWorldMatrix(!0,!1),this.parent?(this.parent.updateWorldMatrix(!0),this.matrix.copy(this.parent.matrixWorld).invert().multiply(this.light.matrixWorld)):this.matrix.copy(this.light.matrixWorld),this.matrixWorld.copy(this.light.matrixWorld);const e=this.light.distance?this.light.distance:1e3,t=e*Math.tan(this.light.angle);this.cone.scale.set(t,t,e),lE.setFromMatrixPosition(this.light.target.matrixWorld),this.cone.lookAt(lE),this.color!==void 0?this.cone.material.color.set(this.color):this.cone.material.color.copy(this.light.color)}}const Ec=new Z,kv=new en,TA=new en;class LB extends yr{constructor(e){const t=cE(e),n=new pn,i=[],o=[];for(let p=0;p<t.length;p++){const _=t[p];_.parent&&_.parent.isBone&&(i.push(0,0,0),i.push(0,0,0),o.push(0,0,0),o.push(0,0,0))}n.setAttribute("position",new Xt(i,3)),n.setAttribute("color",new Xt(o,3));const l=new za({vertexColors:!0,depthTest:!1,depthWrite:!1,toneMapped:!1,transparent:!0});super(n,l),this.isSkeletonHelper=!0,this.type="SkeletonHelper",this.root=e,this.bones=t,this.matrix=e.matrixWorld,this.matrixAutoUpdate=!1;const h=new Ct(255),d=new Ct(65280);this.setColors(h,d)}updateMatrixWorld(e){const t=this.bones,n=this.geometry,i=n.getAttribute("position");TA.copy(this.root.matrixWorld).invert();for(let o=0,l=0;o<t.length;o++){const h=t[o];h.parent&&h.parent.isBone&&(kv.multiplyMatrices(TA,h.matrixWorld),Ec.setFromMatrixPosition(kv),i.setXYZ(l,Ec.x,Ec.y,Ec.z),kv.multiplyMatrices(TA,h.parent.matrixWorld),Ec.setFromMatrixPosition(kv),i.setXYZ(l+1,Ec.x,Ec.y,Ec.z),l+=2)}n.getAttribute("position").needsUpdate=!0,super.updateMatrixWorld(e)}setColors(e,t){const i=this.geometry.getAttribute("color");for(let o=0;o<i.count;o+=2)i.setXYZ(o,e.r,e.g,e.b),i.setXYZ(o+1,t.r,t.g,t.b);return i.needsUpdate=!0,this}dispose(){this.geometry.dispose(),this.material.dispose()}}function cE(s){const e=[];s.isBone===!0&&e.push(s);for(let t=0;t<s.children.length;t++)e.push(...cE(s.children[t]));return e}class OB extends yi{constructor(e,t,n){const i=new kp(t,4,2),o=new ha({wireframe:!0,fog:!1,toneMapped:!1});super(i,o),this.light=e,this.color=n,this.type="PointLightHelper",this.matrix=this.light.matrixWorld,this.matrixAutoUpdate=!1,this.update()}dispose(){this.geometry.dispose(),this.material.dispose()}update(){this.light.updateWorldMatrix(!0,!1),this.color!==void 0?this.material.color.set(this.color):this.material.color.copy(this.light.color)}}const IB=new Z,uE=new Ct,fE=new Ct;class FB extends Un{constructor(e,t,n){super(),this.light=e,this.matrix=e.matrixWorld,this.matrixAutoUpdate=!1,this.color=n,this.type="HemisphereLightHelper";const i=new Vp(t);i.rotateY(Math.PI*.5),this.material=new ha({wireframe:!0,fog:!1,toneMapped:!1}),this.color===void 0&&(this.material.vertexColors=!0);const o=i.getAttribute("position"),l=new Float32Array(o.count*3);i.setAttribute("color",new Hn(l,3)),this.add(new yi(i,this.material)),this.update()}dispose(){this.children[0].geometry.dispose(),this.children[0].material.dispose()}update(){const e=this.children[0];if(this.color!==void 0)this.material.color.set(this.color);else{const t=e.geometry.getAttribute("color");uE.copy(this.light.color),fE.copy(this.light.groundColor);for(let n=0,i=t.count;n<i;n++){const o=n<i/2?uE:fE;t.setXYZ(n,o.r,o.g,o.b)}t.needsUpdate=!0}this.light.updateWorldMatrix(!0,!1),e.lookAt(IB.setFromMatrixPosition(this.light.matrixWorld).negate())}}class HB extends yr{constructor(e=10,t=10,n=4473924,i=8947848){n=new Ct(n),i=new Ct(i);const o=t/2,l=e/t,h=e/2,d=[],p=[];for(let y=0,x=0,b=-h;y<=t;y++,b+=l){d.push(-h,0,b,h,0,b),d.push(b,0,-h,b,0,h);const R=y===o?n:i;R.toArray(p,x),x+=3,R.toArray(p,x),x+=3,R.toArray(p,x),x+=3,R.toArray(p,x),x+=3}const _=new pn;_.setAttribute("position",new Xt(d,3)),_.setAttribute("color",new Xt(p,3));const v=new za({vertexColors:!0,toneMapped:!1});super(_,v),this.type="GridHelper"}dispose(){this.geometry.dispose(),this.material.dispose()}}class PB extends yr{constructor(e=10,t=16,n=8,i=64,o=4473924,l=8947848){o=new Ct(o),l=new Ct(l);const h=[],d=[];if(t>1)for(let v=0;v<t;v++){const y=v/t*(Math.PI*2),x=Math.sin(y)*e,b=Math.cos(y)*e;h.push(0,0,0),h.push(x,0,b);const R=v&1?o:l;d.push(R.r,R.g,R.b),d.push(R.r,R.g,R.b)}for(let v=0;v<n;v++){const y=v&1?o:l,x=e-e/n*v;for(let b=0;b<i;b++){let R=b/i*(Math.PI*2),T=Math.sin(R)*x,M=Math.cos(R)*x;h.push(T,0,M),d.push(y.r,y.g,y.b),R=(b+1)/i*(Math.PI*2),T=Math.sin(R)*x,M=Math.cos(R)*x,h.push(T,0,M),d.push(y.r,y.g,y.b)}}const p=new pn;p.setAttribute("position",new Xt(h,3)),p.setAttribute("color",new Xt(d,3));const _=new za({vertexColors:!0,toneMapped:!1});super(p,_),this.type="PolarGridHelper"}dispose(){this.geometry.dispose(),this.material.dispose()}}const hE=new Z,Xv=new Z,dE=new Z;class GB extends Un{constructor(e,t,n){super(),this.light=e,this.matrix=e.matrixWorld,this.matrixAutoUpdate=!1,this.color=n,this.type="DirectionalLightHelper",t===void 0&&(t=1);let i=new pn;i.setAttribute("position",new Xt([-t,t,0,t,t,0,t,-t,0,-t,-t,0,-t,t,0],3));const o=new za({fog:!1,toneMapped:!1});this.lightPlane=new wo(i,o),this.add(this.lightPlane),i=new pn,i.setAttribute("position",new Xt([0,0,0,0,0,1],3)),this.targetLine=new wo(i,o),this.add(this.targetLine),this.update()}dispose(){this.lightPlane.geometry.dispose(),this.lightPlane.material.dispose(),this.targetLine.geometry.dispose(),this.targetLine.material.dispose()}update(){this.light.updateWorldMatrix(!0,!1),this.light.target.updateWorldMatrix(!0,!1),hE.setFromMatrixPosition(this.light.matrixWorld),Xv.setFromMatrixPosition(this.light.target.matrixWorld),dE.subVectors(Xv,hE),this.lightPlane.lookAt(Xv),this.color!==void 0?(this.lightPlane.material.color.set(this.color),this.targetLine.material.color.set(this.color)):(this.lightPlane.material.color.copy(this.light.color),this.targetLine.material.color.copy(this.light.color)),this.targetLine.lookAt(Xv),this.targetLine.scale.z=dE.length()}}const Yv=new Z,qi=new X0;class zB extends yr{constructor(e){const t=new pn,n=new za({color:16777215,vertexColors:!0,toneMapped:!1}),i=[],o=[],l={};h("n1","n2"),h("n2","n4"),h("n4","n3"),h("n3","n1"),h("f1","f2"),h("f2","f4"),h("f4","f3"),h("f3","f1"),h("n1","f1"),h("n2","f2"),h("n3","f3"),h("n4","f4"),h("p","n1"),h("p","n2"),h("p","n3"),h("p","n4"),h("u1","u2"),h("u2","u3"),h("u3","u1"),h("c","t"),h("p","c"),h("cn1","cn2"),h("cn3","cn4"),h("cf1","cf2"),h("cf3","cf4");function h(b,R){d(b),d(R)}function d(b){i.push(0,0,0),o.push(0,0,0),l[b]===void 0&&(l[b]=[]),l[b].push(i.length/3-1)}t.setAttribute("position",new Xt(i,3)),t.setAttribute("color",new Xt(o,3)),super(t,n),this.type="CameraHelper",this.camera=e,this.camera.updateProjectionMatrix&&this.camera.updateProjectionMatrix(),this.matrix=e.matrixWorld,this.matrixAutoUpdate=!1,this.pointMap=l,this.update();const p=new Ct(16755200),_=new Ct(16711680),v=new Ct(43775),y=new Ct(16777215),x=new Ct(3355443);this.setColors(p,_,v,y,x)}setColors(e,t,n,i,o){const h=this.geometry.getAttribute("color");return h.setXYZ(0,e.r,e.g,e.b),h.setXYZ(1,e.r,e.g,e.b),h.setXYZ(2,e.r,e.g,e.b),h.setXYZ(3,e.r,e.g,e.b),h.setXYZ(4,e.r,e.g,e.b),h.setXYZ(5,e.r,e.g,e.b),h.setXYZ(6,e.r,e.g,e.b),h.setXYZ(7,e.r,e.g,e.b),h.setXYZ(8,e.r,e.g,e.b),h.setXYZ(9,e.r,e.g,e.b),h.setXYZ(10,e.r,e.g,e.b),h.setXYZ(11,e.r,e.g,e.b),h.setXYZ(12,e.r,e.g,e.b),h.setXYZ(13,e.r,e.g,e.b),h.setXYZ(14,e.r,e.g,e.b),h.setXYZ(15,e.r,e.g,e.b),h.setXYZ(16,e.r,e.g,e.b),h.setXYZ(17,e.r,e.g,e.b),h.setXYZ(18,e.r,e.g,e.b),h.setXYZ(19,e.r,e.g,e.b),h.setXYZ(20,e.r,e.g,e.b),h.setXYZ(21,e.r,e.g,e.b),h.setXYZ(22,e.r,e.g,e.b),h.setXYZ(23,e.r,e.g,e.b),h.setXYZ(24,t.r,t.g,t.b),h.setXYZ(25,t.r,t.g,t.b),h.setXYZ(26,t.r,t.g,t.b),h.setXYZ(27,t.r,t.g,t.b),h.setXYZ(28,t.r,t.g,t.b),h.setXYZ(29,t.r,t.g,t.b),h.setXYZ(30,t.r,t.g,t.b),h.setXYZ(31,t.r,t.g,t.b),h.setXYZ(32,n.r,n.g,n.b),h.setXYZ(33,n.r,n.g,n.b),h.setXYZ(34,n.r,n.g,n.b),h.setXYZ(35,n.r,n.g,n.b),h.setXYZ(36,n.r,n.g,n.b),h.setXYZ(37,n.r,n.g,n.b),h.setXYZ(38,i.r,i.g,i.b),h.setXYZ(39,i.r,i.g,i.b),h.setXYZ(40,o.r,o.g,o.b),h.setXYZ(41,o.r,o.g,o.b),h.setXYZ(42,o.r,o.g,o.b),h.setXYZ(43,o.r,o.g,o.b),h.setXYZ(44,o.r,o.g,o.b),h.setXYZ(45,o.r,o.g,o.b),h.setXYZ(46,o.r,o.g,o.b),h.setXYZ(47,o.r,o.g,o.b),h.setXYZ(48,o.r,o.g,o.b),h.setXYZ(49,o.r,o.g,o.b),h.needsUpdate=!0,this}update(){const e=this.geometry,t=this.pointMap,n=1,i=1;let o,l;if(qi.projectionMatrixInverse.copy(this.camera.projectionMatrixInverse),this.camera.reversedDepth===!0)o=1,l=0;else if(this.camera.coordinateSystem===Zs)o=-1,l=1;else if(this.camera.coordinateSystem===$f)o=0,l=1;else throw new Error("THREE.CameraHelper.update(): Invalid coordinate system: "+this.camera.coordinateSystem);Qi("c",t,e,qi,0,0,o),Qi("t",t,e,qi,0,0,l),Qi("n1",t,e,qi,-n,-i,o),Qi("n2",t,e,qi,n,-i,o),Qi("n3",t,e,qi,-n,i,o),Qi("n4",t,e,qi,n,i,o),Qi("f1",t,e,qi,-n,-i,l),Qi("f2",t,e,qi,n,-i,l),Qi("f3",t,e,qi,-n,i,l),Qi("f4",t,e,qi,n,i,l),Qi("u1",t,e,qi,n*.7,i*1.1,o),Qi("u2",t,e,qi,-n*.7,i*1.1,o),Qi("u3",t,e,qi,0,i*2,o),Qi("cf1",t,e,qi,-n,0,l),Qi("cf2",t,e,qi,n,0,l),Qi("cf3",t,e,qi,0,-i,l),Qi("cf4",t,e,qi,0,i,l),Qi("cn1",t,e,qi,-n,0,o),Qi("cn2",t,e,qi,n,0,o),Qi("cn3",t,e,qi,0,-i,o),Qi("cn4",t,e,qi,0,i,o),e.getAttribute("position").needsUpdate=!0}dispose(){this.geometry.dispose(),this.material.dispose()}}function Qi(s,e,t,n,i,o,l){Yv.set(i,o,l).unproject(n);const h=e[s];if(h!==void 0){const d=t.getAttribute("position");for(let p=0,_=h.length;p<_;p++)d.setXYZ(h[p],Yv.x,Yv.y,Yv.z)}}const Jv=new Ra;class VB extends yr{constructor(e,t=16776960){const n=new Uint16Array([0,1,1,2,2,3,3,0,4,5,5,6,6,7,7,4,0,4,1,5,2,6,3,7]),i=new Float32Array(24),o=new pn;o.setIndex(new Hn(n,1)),o.setAttribute("position",new Hn(i,3)),super(o,new za({color:t,toneMapped:!1})),this.object=e,this.type="BoxHelper",this.matrixAutoUpdate=!1,this.update()}update(){if(this.object!==void 0&&Jv.setFromObject(this.object),Jv.isEmpty())return;const e=Jv.min,t=Jv.max,n=this.geometry.attributes.position,i=n.array;i[0]=t.x,i[1]=t.y,i[2]=t.z,i[3]=e.x,i[4]=t.y,i[5]=t.z,i[6]=e.x,i[7]=e.y,i[8]=t.z,i[9]=t.x,i[10]=e.y,i[11]=t.z,i[12]=t.x,i[13]=t.y,i[14]=e.z,i[15]=e.x,i[16]=t.y,i[17]=e.z,i[18]=e.x,i[19]=e.y,i[20]=e.z,i[21]=t.x,i[22]=e.y,i[23]=e.z,n.needsUpdate=!0,this.geometry.computeBoundingSphere()}setFromObject(e){return this.object=e,this.update(),this}copy(e,t){return super.copy(e,t),this.object=e.object,this}dispose(){this.geometry.dispose(),this.material.dispose()}}class kB extends yr{constructor(e,t=16776960){const n=new Uint16Array([0,1,1,2,2,3,3,0,4,5,5,6,6,7,7,4,0,4,1,5,2,6,3,7]),i=[1,1,1,-1,1,1,-1,-1,1,1,-1,1,1,1,-1,-1,1,-1,-1,-1,-1,1,-1,-1],o=new pn;o.setIndex(new Hn(n,1)),o.setAttribute("position",new Xt(i,3)),super(o,new za({color:t,toneMapped:!1})),this.box=e,this.type="Box3Helper",this.geometry.computeBoundingSphere()}updateMatrixWorld(e){const t=this.box;t.isEmpty()||(t.getCenter(this.position),t.getSize(this.scale),this.scale.multiplyScalar(.5),super.updateMatrixWorld(e))}dispose(){this.geometry.dispose(),this.material.dispose()}}class XB extends wo{constructor(e,t=1,n=16776960){const i=n,o=[1,-1,0,-1,1,0,-1,-1,0,1,1,0,-1,1,0,-1,-1,0,1,-1,0,1,1,0],l=new pn;l.setAttribute("position",new Xt(o,3)),l.computeBoundingSphere(),super(l,new za({color:i,toneMapped:!1})),this.type="PlaneHelper",this.plane=e,this.size=t;const h=[1,1,0,-1,1,0,-1,-1,0,1,1,0,-1,-1,0,1,-1,0],d=new pn;d.setAttribute("position",new Xt(h,3)),d.computeBoundingSphere(),this.add(new yi(d,new ha({color:i,opacity:.2,transparent:!0,depthWrite:!1,toneMapped:!1})))}updateMatrixWorld(e){this.position.set(0,0,0),this.scale.set(.5*this.size,.5*this.size,1),this.lookAt(this.plane.normal),this.translateZ(-this.plane.constant),super.updateMatrixWorld(e)}dispose(){this.geometry.dispose(),this.material.dispose(),this.children[0].geometry.dispose(),this.children[0].material.dispose()}}const pE=new Z;let qv,CA;class YB extends Un{constructor(e=new Z(0,0,1),t=new Z(0,0,0),n=1,i=16776960,o=n*.2,l=o*.2){super(),this.type="ArrowHelper",qv===void 0&&(qv=new pn,qv.setAttribute("position",new Xt([0,0,0,0,1,0],3)),CA=new Lp(.5,1,5,1),CA.translate(0,-.5,0)),this.position.copy(t),this.line=new wo(qv,new za({color:i,toneMapped:!1})),this.line.matrixAutoUpdate=!1,this.add(this.line),this.cone=new yi(CA,new ha({color:i,toneMapped:!1})),this.cone.matrixAutoUpdate=!1,this.add(this.cone),this.setDirection(e),this.setLength(n,o,l)}setDirection(e){if(e.y>.99999)this.quaternion.set(0,0,0,1);else if(e.y<-.99999)this.quaternion.set(1,0,0,0);else{pE.set(e.z,0,-e.x).normalize();const t=Math.acos(e.y);this.quaternion.setFromAxisAngle(pE,t)}}setLength(e,t=e*.2,n=t*.2){this.line.scale.set(1,Math.max(1e-4,e-t),1),this.line.updateMatrix(),this.cone.scale.set(n,t,n),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 JB extends yr{constructor(e=1){const t=[0,0,0,e,0,0,0,0,0,0,e,0,0,0,0,0,0,e],n=[1,0,0,1,.6,0,0,1,0,.6,1,0,0,0,1,0,.6,1],i=new pn;i.setAttribute("position",new Xt(t,3)),i.setAttribute("color",new Xt(n,3));const o=new za({vertexColors:!0,toneMapped:!1});super(i,o),this.type="AxesHelper"}setColors(e,t,n){const i=new Ct,o=this.geometry.attributes.color.array;return i.set(e),i.toArray(o,0),i.toArray(o,3),i.set(t),i.toArray(o,6),i.toArray(o,9),i.set(n),i.toArray(o,12),i.toArray(o,15),this.geometry.attributes.color.needsUpdate=!0,this}dispose(){this.geometry.dispose(),this.material.dispose()}}class qB{constructor(){this.type="ShapePath",this.color=new Ct,this.subPaths=[],this.currentPath=null}moveTo(e,t){return this.currentPath=new Ev,this.subPaths.push(this.currentPath),this.currentPath.moveTo(e,t),this}lineTo(e,t){return this.currentPath.lineTo(e,t),this}quadraticCurveTo(e,t,n,i){return this.currentPath.quadraticCurveTo(e,t,n,i),this}bezierCurveTo(e,t,n,i,o,l){return this.currentPath.bezierCurveTo(e,t,n,i,o,l),this}splineThru(e){return this.currentPath.splineThru(e),this}toShapes(e){function t(M){const w=[];for(let D=0,N=M.length;D<N;D++){const H=M[D],O=new Ou;O.curves=H.curves,w.push(O)}return w}function n(M,w){const D=w.length;let N=!1;for(let H=D-1,O=0;O<D;H=O++){let z=w[H],V=w[O],U=V.x-z.x,F=V.y-z.y;if(Math.abs(F)>Number.EPSILON){if(F<0&&(z=w[O],U=-U,V=w[H],F=-F),M.y<z.y||M.y>V.y)continue;if(M.y===z.y){if(M.x===z.x)return!0}else{const K=F*(M.x-z.x)-U*(M.y-z.y);if(K===0)return!0;if(K<0)continue;N=!N}}else{if(M.y!==z.y)continue;if(V.x<=M.x&&M.x<=z.x||z.x<=M.x&&M.x<=V.x)return!0}}return N}const i=$r.isClockWise,o=this.subPaths;if(o.length===0)return[];let l,h,d;const p=[];if(o.length===1)return h=o[0],d=new Ou,d.curves=h.curves,p.push(d),p;let _=!i(o[0].getPoints());_=e?!_:_;const v=[],y=[];let x=[],b=0,R;y[b]=void 0,x[b]=[];for(let M=0,w=o.length;M<w;M++)h=o[M],R=h.getPoints(),l=i(R),l=e?!l:l,l?(!_&&y[b]&&b++,y[b]={s:new Ou,p:R},y[b].s.curves=h.curves,_&&b++,x[b]=[]):x[b].push({h,p:R[0]});if(!y[0])return t(o);if(y.length>1){let M=!1,w=0;for(let D=0,N=y.length;D<N;D++)v[D]=[];for(let D=0,N=y.length;D<N;D++){const H=x[D];for(let O=0;O<H.length;O++){const z=H[O];let V=!0;for(let U=0;U<y.length;U++)n(z.p,y[U].p)&&(D!==U&&w++,V?(V=!1,v[U].push(z)):M=!0);V&&v[D].push(z)}}w>0&&M===!1&&(x=v)}let T;for(let M=0,w=y.length;M<w;M++){d=y[M].s,p.push(d),T=x[M];for(let D=0,N=T.length;D<N;D++)d.holes.push(T[D].h)}return p}}class KB extends To{constructor(e,t=null){super(),this.object=e,this.domElement=t,this.enabled=!0,this.state=-1,this.keys={},this.mouseButtons={LEFT:null,MIDDLE:null,RIGHT:null},this.touches={ONE:null,TWO:null}}connect(e){if(e===void 0){Ut("Controls: connect() now requires an element.");return}this.domElement!==null&&this.disconnect(),this.domElement=e}disconnect(){}dispose(){}update(){}}function WB(s,e){const t=s.image&&s.image.width?s.image.width/s.image.height:1;return t>e?(s.repeat.x=1,s.repeat.y=t/e,s.offset.x=0,s.offset.y=(1-s.repeat.y)/2):(s.repeat.x=e/t,s.repeat.y=1,s.offset.x=(1-s.repeat.x)/2,s.offset.y=0),s}function jB(s,e){const t=s.image&&s.image.width?s.image.width/s.image.height:1;return t>e?(s.repeat.x=e/t,s.repeat.y=1,s.offset.x=(1-s.repeat.x)/2,s.offset.y=0):(s.repeat.x=1,s.repeat.y=t/e,s.offset.x=0,s.offset.y=(1-s.repeat.y)/2),s}function ZB(s){return s.repeat.x=1,s.repeat.y=1,s.offset.x=0,s.offset.y=0,s}function RA(s,e,t,n){const i=QB(n);switch(t){case ax:return s*e;case ip:return s*e/i.components*i.byteLength;case ap:return s*e/i.components*i.byteLength;case xu:return s*e*2/i.components*i.byteLength;case zg:return s*e*2/i.components*i.byteLength;case sx:return s*e*3/i.components*i.byteLength;case Zi:return s*e*4/i.components*i.byteLength;case Vg:return s*e*4/i.components*i.byteLength;case sp:case rp:return Math.floor((s+3)/4)*Math.floor((e+3)/4)*8;case op:case lp:return Math.floor((s+3)/4)*Math.floor((e+3)/4)*16;case Xg:case Jg:return Math.max(s,16)*Math.max(e,8)/4;case kg:case Yg:return Math.max(s,8)*Math.max(e,8)/2;case qg:case Kg:case jg:case Zg:return Math.floor((s+3)/4)*Math.floor((e+3)/4)*8;case Wg:case Qg:case $g:return Math.floor((s+3)/4)*Math.floor((e+3)/4)*16;case e0:return Math.floor((s+3)/4)*Math.floor((e+3)/4)*16;case t0:return Math.floor((s+4)/5)*Math.floor((e+3)/4)*16;case n0:return Math.floor((s+4)/5)*Math.floor((e+4)/5)*16;case i0:return Math.floor((s+5)/6)*Math.floor((e+4)/5)*16;case a0:return Math.floor((s+5)/6)*Math.floor((e+5)/6)*16;case s0:return Math.floor((s+7)/8)*Math.floor((e+4)/5)*16;case r0:return Math.floor((s+7)/8)*Math.floor((e+5)/6)*16;case o0:return Math.floor((s+7)/8)*Math.floor((e+7)/8)*16;case l0:return Math.floor((s+9)/10)*Math.floor((e+4)/5)*16;case c0:return Math.floor((s+9)/10)*Math.floor((e+5)/6)*16;case u0:return Math.floor((s+9)/10)*Math.floor((e+7)/8)*16;case f0:return Math.floor((s+9)/10)*Math.floor((e+9)/10)*16;case h0:return Math.floor((s+11)/12)*Math.floor((e+9)/10)*16;case d0:return Math.floor((s+11)/12)*Math.floor((e+11)/12)*16;case p0:case m0:case g0:return Math.ceil(s/4)*Math.ceil(e/4)*16;case v0:case _0:return Math.ceil(s/4)*Math.ceil(e/4)*8;case y0:case x0:return Math.ceil(s/4)*Math.ceil(e/4)*16}throw new Error(`Unable to determine texture byte length for ${t} format.`)}function QB(s){switch(s){case Ta:case Fg:return{byteLength:1,components:1};case Zf:case Hg:case ki:return{byteLength:2,components:1};case Pg:case Gg:return{byteLength:2,components:4};case js:case np:case Ci:return{byteLength:4,components:1};case nx:case ix:return{byteLength:4,components:3}}throw new Error(`Unknown texture type ${s}.`)}class $B{static contain(e,t){return WB(e,t)}static cover(e,t){return jB(e,t)}static fill(e){return ZB(e)}static getByteLength(e,t,n,i){return RA(e,t,n,i)}}typeof __THREE_DEVTOOLS__<"u"&&__THREE_DEVTOOLS__.dispatchEvent(new CustomEvent("register",{detail:{revision:Zd}})),typeof window<"u"&&(window.__THREE__?Ut("WARNING: Multiple instances of Three.js being imported."):window.__THREE__=Zd);function mE(){let s=null,e=!1,t=null,n=null;function i(o,l){t(o,l),n=s.requestAnimationFrame(i)}return{start:function(){e!==!0&&t!==null&&(n=s.requestAnimationFrame(i),e=!0)},stop:function(){s.cancelAnimationFrame(n),e=!1},setAnimationLoop:function(o){t=o},setContext:function(o){s=o}}}function e3(s){const e=new WeakMap;function t(h,d){const p=h.array,_=h.usage,v=p.byteLength,y=s.createBuffer();s.bindBuffer(d,y),s.bufferData(d,p,_),h.onUploadCallback();let x;if(p instanceof Float32Array)x=s.FLOAT;else if(typeof Float16Array<"u"&&p instanceof Float16Array)x=s.HALF_FLOAT;else if(p instanceof Uint16Array)h.isFloat16BufferAttribute?x=s.HALF_FLOAT:x=s.UNSIGNED_SHORT;else if(p instanceof Int16Array)x=s.SHORT;else if(p instanceof Uint32Array)x=s.UNSIGNED_INT;else if(p instanceof Int32Array)x=s.INT;else if(p instanceof Int8Array)x=s.BYTE;else if(p instanceof Uint8Array)x=s.UNSIGNED_BYTE;else if(p instanceof Uint8ClampedArray)x=s.UNSIGNED_BYTE;else throw new Error("THREE.WebGLAttributes: Unsupported buffer data format: "+p);return{buffer:y,type:x,bytesPerElement:p.BYTES_PER_ELEMENT,version:h.version,size:v}}function n(h,d,p){const _=d.array,v=d.updateRanges;if(s.bindBuffer(p,h),v.length===0)s.bufferSubData(p,0,_);else{v.sort((x,b)=>x.start-b.start);let y=0;for(let x=1;x<v.length;x++){const b=v[y],R=v[x];R.start<=b.start+b.count+1?b.count=Math.max(b.count,R.start+R.count-b.start):(++y,v[y]=R)}v.length=y+1;for(let x=0,b=v.length;x<b;x++){const R=v[x];s.bufferSubData(p,R.start*_.BYTES_PER_ELEMENT,_,R.start,R.count)}d.clearUpdateRanges()}d.onUploadCallback()}function i(h){return h.isInterleavedBufferAttribute&&(h=h.data),e.get(h)}function o(h){h.isInterleavedBufferAttribute&&(h=h.data);const d=e.get(h);d&&(s.deleteBuffer(d.buffer),e.delete(h))}function l(h,d){if(h.isInterleavedBufferAttribute&&(h=h.data),h.isGLBufferAttribute){const _=e.get(h);(!_||_.version<h.version)&&e.set(h,{buffer:h.buffer,type:h.type,bytesPerElement:h.elementSize,version:h.version});return}const p=e.get(h);if(p===void 0)e.set(h,t(h,d));else if(p.version<h.version){if(p.size!==h.array.byteLength)throw new Error("THREE.WebGLAttributes: The size of the buffer attribute's array buffer does not match the original size. Resizing buffer attributes is not supported.");n(p.buffer,h,d),p.version=h.version}}return{get:i,remove:o,update:l}}var t3=`#ifdef USE_ALPHAHASH
|
|
48
|
+
`},i=new Du(5,5,5),o=new ms({name:"CubemapFromEquirect",uniforms:gh(n.uniforms),vertexShader:n.vertexShader,fragmentShader:n.fragmentShader,side:fs,blending:Jr});o.uniforms.tEquirect.value=t;const l=new yi(i,o),h=t.minFilter;return t.minFilter===Is&&(t.minFilter=Cn),new Hb(1,10,this).update(e,l),t.minFilter=h,l.geometry.dispose(),l.material.dispose(),this}clear(e,t=!0,n=!0,i=!0){const o=e.getRenderTarget();for(let l=0;l<6;l++)e.setRenderTarget(this,l),e.clear(t,n,i);e.setRenderTarget(o)}}class vr extends Un{constructor(){super(),this.isGroup=!0,this.type="Group"}}const j2={type:"move"};class J0{constructor(){this._targetRay=null,this._grip=null,this._hand=null}getHandSpace(){return this._hand===null&&(this._hand=new vr,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 vr,this._targetRay.matrixAutoUpdate=!1,this._targetRay.visible=!1,this._targetRay.hasLinearVelocity=!1,this._targetRay.linearVelocity=new Z,this._targetRay.hasAngularVelocity=!1,this._targetRay.angularVelocity=new Z),this._targetRay}getGripSpace(){return this._grip===null&&(this._grip=new vr,this._grip.matrixAutoUpdate=!1,this._grip.visible=!1,this._grip.hasLinearVelocity=!1,this._grip.linearVelocity=new Z,this._grip.hasAngularVelocity=!1,this._grip.angularVelocity=new Z),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 n of e.hand.values())this._getHandJoint(t,n)}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,n){let i=null,o=null,l=null;const h=this._targetRay,d=this._grip,p=this._hand;if(e&&t.session.visibilityState!=="visible-blurred"){if(p&&e.hand){l=!0;for(const R of e.hand.values()){const T=t.getJointPose(R,n),M=this._getHandJoint(p,R);T!==null&&(M.matrix.fromArray(T.transform.matrix),M.matrix.decompose(M.position,M.rotation,M.scale),M.matrixWorldNeedsUpdate=!0,M.jointRadius=T.radius),M.visible=T!==null}const _=p.joints["index-finger-tip"],v=p.joints["thumb-tip"],y=_.position.distanceTo(v.position),x=.02,b=.005;p.inputState.pinching&&y>x+b?(p.inputState.pinching=!1,this.dispatchEvent({type:"pinchend",handedness:e.handedness,target:this})):!p.inputState.pinching&&y<=x-b&&(p.inputState.pinching=!0,this.dispatchEvent({type:"pinchstart",handedness:e.handedness,target:this}))}else d!==null&&e.gripSpace&&(o=t.getPose(e.gripSpace,n),o!==null&&(d.matrix.fromArray(o.transform.matrix),d.matrix.decompose(d.position,d.rotation,d.scale),d.matrixWorldNeedsUpdate=!0,o.linearVelocity?(d.hasLinearVelocity=!0,d.linearVelocity.copy(o.linearVelocity)):d.hasLinearVelocity=!1,o.angularVelocity?(d.hasAngularVelocity=!0,d.angularVelocity.copy(o.angularVelocity)):d.hasAngularVelocity=!1));h!==null&&(i=t.getPose(e.targetRaySpace,n),i===null&&o!==null&&(i=o),i!==null&&(h.matrix.fromArray(i.transform.matrix),h.matrix.decompose(h.position,h.rotation,h.scale),h.matrixWorldNeedsUpdate=!0,i.linearVelocity?(h.hasLinearVelocity=!0,h.linearVelocity.copy(i.linearVelocity)):h.hasLinearVelocity=!1,i.angularVelocity?(h.hasAngularVelocity=!0,h.angularVelocity.copy(i.angularVelocity)):h.hasAngularVelocity=!1,this.dispatchEvent(j2)))}return h!==null&&(h.visible=i!==null),d!==null&&(d.visible=o!==null),p!==null&&(p.visible=l!==null),this}_getHandJoint(e,t){if(e.joints[t.jointName]===void 0){const n=new vr;n.matrixAutoUpdate=!1,n.visible=!1,e.joints[t.jointName]=n,e.add(n)}return e.joints[t.jointName]}}class q0{constructor(e,t=25e-5){this.isFogExp2=!0,this.name="",this.color=new Ct(e),this.density=t}clone(){return new q0(this.color,this.density)}toJSON(){return{type:"FogExp2",name:this.name,color:this.color.getHex(),density:this.density}}}class K0{constructor(e,t=1,n=1e3){this.isFog=!0,this.name="",this.color=new Ct(e),this.near=t,this.far=n}clone(){return new K0(this.color,this.near,this.far)}toJSON(){return{type:"Fog",name:this.name,color:this.color.getHex(),near:this.near,far:this.far}}}class Mp extends Un{constructor(){super(),this.isScene=!0,this.type="Scene",this.background=null,this.environment=null,this.fog=null,this.backgroundBlurriness=0,this.backgroundIntensity=1,this.backgroundRotation=new er,this.environmentIntensity=1,this.environmentRotation=new er,this.overrideMaterial=null,typeof __THREE_DEVTOOLS__<"u"&&__THREE_DEVTOOLS__.dispatchEvent(new CustomEvent("observe",{detail:this}))}copy(e,t){return super.copy(e,t),e.background!==null&&(this.background=e.background.clone()),e.environment!==null&&(this.environment=e.environment.clone()),e.fog!==null&&(this.fog=e.fog.clone()),this.backgroundBlurriness=e.backgroundBlurriness,this.backgroundIntensity=e.backgroundIntensity,this.backgroundRotation.copy(e.backgroundRotation),this.environmentIntensity=e.environmentIntensity,this.environmentRotation.copy(e.environmentRotation),e.overrideMaterial!==null&&(this.overrideMaterial=e.overrideMaterial.clone()),this.matrixAutoUpdate=e.matrixAutoUpdate,this}toJSON(e){const t=super.toJSON(e);return this.fog!==null&&(t.object.fog=this.fog.toJSON()),this.backgroundBlurriness>0&&(t.object.backgroundBlurriness=this.backgroundBlurriness),this.backgroundIntensity!==1&&(t.object.backgroundIntensity=this.backgroundIntensity),t.object.backgroundRotation=this.backgroundRotation.toArray(),this.environmentIntensity!==1&&(t.object.environmentIntensity=this.environmentIntensity),t.object.environmentRotation=this.environmentRotation.toArray(),t}}class yh{constructor(e,t){this.isInterleavedBuffer=!0,this.array=e,this.stride=t,this.count=e!==void 0?e.length/t:0,this.usage=dp,this.updateRanges=[],this.version=0,this.uuid=Qs()}onUploadCallback(){}set needsUpdate(e){e===!0&&this.version++}setUsage(e){return this.usage=e,this}addUpdateRange(e,t){this.updateRanges.push({start:e,count:t})}clearUpdateRanges(){this.updateRanges.length=0}copy(e){return this.array=new e.array.constructor(e.array),this.count=e.count,this.stride=e.stride,this.usage=e.usage,this}copyAt(e,t,n){e*=this.stride,n*=t.stride;for(let i=0,o=this.stride;i<o;i++)this.array[e+i]=t.array[n+i];return this}set(e,t=0){return this.array.set(e,t),this}clone(e){e.arrayBuffers===void 0&&(e.arrayBuffers={}),this.array.buffer._uuid===void 0&&(this.array.buffer._uuid=Qs()),e.arrayBuffers[this.array.buffer._uuid]===void 0&&(e.arrayBuffers[this.array.buffer._uuid]=this.array.slice(0).buffer);const t=new this.array.constructor(e.arrayBuffers[this.array.buffer._uuid]),n=new this.constructor(t,this.stride);return n.setUsage(this.usage),n}onUpload(e){return this.onUploadCallback=e,this}toJSON(e){return e.arrayBuffers===void 0&&(e.arrayBuffers={}),this.array.buffer._uuid===void 0&&(this.array.buffer._uuid=Qs()),e.arrayBuffers[this.array.buffer._uuid]===void 0&&(e.arrayBuffers[this.array.buffer._uuid]=Array.from(new Uint32Array(this.array.buffer))),{uuid:this.uuid,buffer:this.array.buffer._uuid,type:this.array.constructor.name,stride:this.stride}}}const gs=new Z;class Al{constructor(e,t,n,i=!1){this.isInterleavedBufferAttribute=!0,this.name="",this.data=e,this.itemSize=t,this.offset=n,this.normalized=i}get count(){return this.data.count}get array(){return this.data.array}set needsUpdate(e){this.data.needsUpdate=e}applyMatrix4(e){for(let t=0,n=this.data.count;t<n;t++)gs.fromBufferAttribute(this,t),gs.applyMatrix4(e),this.setXYZ(t,gs.x,gs.y,gs.z);return this}applyNormalMatrix(e){for(let t=0,n=this.count;t<n;t++)gs.fromBufferAttribute(this,t),gs.applyNormalMatrix(e),this.setXYZ(t,gs.x,gs.y,gs.z);return this}transformDirection(e){for(let t=0,n=this.count;t<n;t++)gs.fromBufferAttribute(this,t),gs.transformDirection(e),this.setXYZ(t,gs.x,gs.y,gs.z);return this}getComponent(e,t){let n=this.array[e*this.data.stride+this.offset+t];return this.normalized&&(n=hs(n,this.array)),n}setComponent(e,t,n){return this.normalized&&(n=Sn(n,this.array)),this.data.array[e*this.data.stride+this.offset+t]=n,this}setX(e,t){return this.normalized&&(t=Sn(t,this.array)),this.data.array[e*this.data.stride+this.offset]=t,this}setY(e,t){return this.normalized&&(t=Sn(t,this.array)),this.data.array[e*this.data.stride+this.offset+1]=t,this}setZ(e,t){return this.normalized&&(t=Sn(t,this.array)),this.data.array[e*this.data.stride+this.offset+2]=t,this}setW(e,t){return this.normalized&&(t=Sn(t,this.array)),this.data.array[e*this.data.stride+this.offset+3]=t,this}getX(e){let t=this.data.array[e*this.data.stride+this.offset];return this.normalized&&(t=hs(t,this.array)),t}getY(e){let t=this.data.array[e*this.data.stride+this.offset+1];return this.normalized&&(t=hs(t,this.array)),t}getZ(e){let t=this.data.array[e*this.data.stride+this.offset+2];return this.normalized&&(t=hs(t,this.array)),t}getW(e){let t=this.data.array[e*this.data.stride+this.offset+3];return this.normalized&&(t=hs(t,this.array)),t}setXY(e,t,n){return e=e*this.data.stride+this.offset,this.normalized&&(t=Sn(t,this.array),n=Sn(n,this.array)),this.data.array[e+0]=t,this.data.array[e+1]=n,this}setXYZ(e,t,n,i){return e=e*this.data.stride+this.offset,this.normalized&&(t=Sn(t,this.array),n=Sn(n,this.array),i=Sn(i,this.array)),this.data.array[e+0]=t,this.data.array[e+1]=n,this.data.array[e+2]=i,this}setXYZW(e,t,n,i,o){return e=e*this.data.stride+this.offset,this.normalized&&(t=Sn(t,this.array),n=Sn(n,this.array),i=Sn(i,this.array),o=Sn(o,this.array)),this.data.array[e+0]=t,this.data.array[e+1]=n,this.data.array[e+2]=i,this.data.array[e+3]=o,this}clone(e){if(e===void 0){mp("InterleavedBufferAttribute.clone(): Cloning an interleaved buffer attribute will de-interleave buffer data.");const t=[];for(let n=0;n<this.count;n++){const i=n*this.data.stride+this.offset;for(let o=0;o<this.itemSize;o++)t.push(this.data.array[i+o])}return new Hn(new this.array.constructor(t),this.itemSize,this.normalized)}else return e.interleavedBuffers===void 0&&(e.interleavedBuffers={}),e.interleavedBuffers[this.data.uuid]===void 0&&(e.interleavedBuffers[this.data.uuid]=this.data.clone(e)),new Al(e.interleavedBuffers[this.data.uuid],this.itemSize,this.offset,this.normalized)}toJSON(e){if(e===void 0){mp("InterleavedBufferAttribute.toJSON(): Serializing an interleaved buffer attribute will de-interleave buffer data.");const t=[];for(let n=0;n<this.count;n++){const i=n*this.data.stride+this.offset;for(let o=0;o<this.itemSize;o++)t.push(this.data.array[i+o])}return{itemSize:this.itemSize,type:this.array.constructor.name,array:t,normalized:this.normalized}}else return e.interleavedBuffers===void 0&&(e.interleavedBuffers={}),e.interleavedBuffers[this.data.uuid]===void 0&&(e.interleavedBuffers[this.data.uuid]=this.data.toJSON(e)),{isInterleavedBufferAttribute:!0,itemSize:this.itemSize,data:this.data.uuid,offset:this.offset,normalized:this.normalized}}}class Lx extends Yi{constructor(e){super(),this.isSpriteMaterial=!0,this.type="SpriteMaterial",this.color=new Ct(16777215),this.map=null,this.alphaMap=null,this.rotation=0,this.sizeAttenuation=!0,this.transparent=!0,this.fog=!0,this.setValues(e)}copy(e){return super.copy(e),this.color.copy(e.color),this.map=e.map,this.alphaMap=e.alphaMap,this.rotation=e.rotation,this.sizeAttenuation=e.sizeAttenuation,this.fog=e.fog,this}}let xh;const bp=new Z,Ah=new Z,Sh=new Z,Mh=new nt,Ep=new nt,Pb=new en,W0=new Z,Tp=new Z,j0=new Z,Gb=new nt,Ox=new nt,zb=new nt;class Vb extends Un{constructor(e=new Lx){if(super(),this.isSprite=!0,this.type="Sprite",xh===void 0){xh=new pn;const t=new Float32Array([-.5,-.5,0,0,0,.5,-.5,0,1,0,.5,.5,0,1,1,-.5,.5,0,0,1]),n=new yh(t,5);xh.setIndex([0,1,2,0,2,3]),xh.setAttribute("position",new Al(n,3,0,!1)),xh.setAttribute("uv",new Al(n,2,3,!1))}this.geometry=xh,this.material=e,this.center=new nt(.5,.5),this.count=1}raycast(e,t){e.camera===null&&Zt('Sprite: "Raycaster.camera" needs to be set in order to raycast against sprites.'),Ah.setFromMatrixScale(this.matrixWorld),Pb.copy(e.camera.matrixWorld),this.modelViewMatrix.multiplyMatrices(e.camera.matrixWorldInverse,this.matrixWorld),Sh.setFromMatrixPosition(this.modelViewMatrix),e.camera.isPerspectiveCamera&&this.material.sizeAttenuation===!1&&Ah.multiplyScalar(-Sh.z);const n=this.material.rotation;let i,o;n!==0&&(o=Math.cos(n),i=Math.sin(n));const l=this.center;Z0(W0.set(-.5,-.5,0),Sh,l,Ah,i,o),Z0(Tp.set(.5,-.5,0),Sh,l,Ah,i,o),Z0(j0.set(.5,.5,0),Sh,l,Ah,i,o),Gb.set(0,0),Ox.set(1,0),zb.set(1,1);let h=e.ray.intersectTriangle(W0,Tp,j0,!1,bp);if(h===null&&(Z0(Tp.set(-.5,.5,0),Sh,l,Ah,i,o),Ox.set(0,1),h=e.ray.intersectTriangle(W0,j0,Tp,!1,bp),h===null))return;const d=e.ray.origin.distanceTo(bp);d<e.near||d>e.far||t.push({distance:d,point:bp.clone(),uv:Fs.getInterpolation(bp,W0,Tp,j0,Gb,Ox,zb,new nt),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 Z0(s,e,t,n,i,o){Mh.subVectors(s,t).addScalar(.5).multiply(n),i!==void 0?(Ep.x=o*Mh.x-i*Mh.y,Ep.y=i*Mh.x+o*Mh.y):Ep.copy(Mh),s.copy(e),s.x+=Ep.x,s.y+=Ep.y,s.applyMatrix4(Pb)}const Q0=new Z,kb=new Z;class Xb extends Un{constructor(){super(),this.isLOD=!0,this._currentLevel=0,this.type="LOD",Object.defineProperties(this,{levels:{enumerable:!0,value:[]}}),this.autoUpdate=!0}copy(e){super.copy(e,!1);const t=e.levels;for(let n=0,i=t.length;n<i;n++){const o=t[n];this.addLevel(o.object.clone(),o.distance,o.hysteresis)}return this.autoUpdate=e.autoUpdate,this}addLevel(e,t=0,n=0){t=Math.abs(t);const i=this.levels;let o;for(o=0;o<i.length&&!(t<i[o].distance);o++);return i.splice(o,0,{distance:t,hysteresis:n,object:e}),this.add(e),this}removeLevel(e){const t=this.levels;for(let n=0;n<t.length;n++)if(t[n].distance===e){const i=t.splice(n,1);return this.remove(i[0].object),!0}return!1}getCurrentLevel(){return this._currentLevel}getObjectForDistance(e){const t=this.levels;if(t.length>0){let n,i;for(n=1,i=t.length;n<i;n++){let o=t[n].distance;if(t[n].object.visible&&(o-=o*t[n].hysteresis),e<o)break}return t[n-1].object}return null}raycast(e,t){if(this.levels.length>0){Q0.setFromMatrixPosition(this.matrixWorld);const i=e.ray.origin.distanceTo(Q0);this.getObjectForDistance(i).raycast(e,t)}}update(e){const t=this.levels;if(t.length>1){Q0.setFromMatrixPosition(e.matrixWorld),kb.setFromMatrixPosition(this.matrixWorld);const n=Q0.distanceTo(kb)/e.zoom;t[0].object.visible=!0;let i,o;for(i=1,o=t.length;i<o;i++){let l=t[i].distance;if(t[i].object.visible&&(l-=l*t[i].hysteresis),n>=l)t[i-1].object.visible=!1,t[i].object.visible=!0;else break}for(this._currentLevel=i-1;i<o;i++)t[i].object.visible=!1}}toJSON(e){const t=super.toJSON(e);this.autoUpdate===!1&&(t.object.autoUpdate=!1),t.object.levels=[];const n=this.levels;for(let i=0,o=n.length;i<o;i++){const l=n[i];t.object.levels.push({object:l.object.uuid,distance:l.distance,hysteresis:l.hysteresis})}return t}}const Yb=new Z,Jb=new pi,qb=new pi,Z2=new Z,Kb=new en,$0=new Z,Ix=new fa,Wb=new en,Fx=new lh;class ev extends yi{constructor(e,t){super(e,t),this.isSkinnedMesh=!0,this.type="SkinnedMesh",this.bindMode=ex,this.bindMatrix=new en,this.bindMatrixInverse=new en,this.boundingBox=null,this.boundingSphere=null}computeBoundingBox(){const e=this.geometry;this.boundingBox===null&&(this.boundingBox=new Ra),this.boundingBox.makeEmpty();const t=e.getAttribute("position");for(let n=0;n<t.count;n++)this.getVertexPosition(n,$0),this.boundingBox.expandByPoint($0)}computeBoundingSphere(){const e=this.geometry;this.boundingSphere===null&&(this.boundingSphere=new fa),this.boundingSphere.makeEmpty();const t=e.getAttribute("position");for(let n=0;n<t.count;n++)this.getVertexPosition(n,$0),this.boundingSphere.expandByPoint($0)}copy(e,t){return super.copy(e,t),this.bindMode=e.bindMode,this.bindMatrix.copy(e.bindMatrix),this.bindMatrixInverse.copy(e.bindMatrixInverse),this.skeleton=e.skeleton,e.boundingBox!==null&&(this.boundingBox=e.boundingBox.clone()),e.boundingSphere!==null&&(this.boundingSphere=e.boundingSphere.clone()),this}raycast(e,t){const n=this.material,i=this.matrixWorld;n!==void 0&&(this.boundingSphere===null&&this.computeBoundingSphere(),Ix.copy(this.boundingSphere),Ix.applyMatrix4(i),e.ray.intersectsSphere(Ix)!==!1&&(Wb.copy(i).invert(),Fx.copy(e.ray).applyMatrix4(Wb),!(this.boundingBox!==null&&Fx.intersectsBox(this.boundingBox)===!1)&&this._computeIntersections(e,t,Fx)))}getVertexPosition(e,t){return super.getVertexPosition(e,t),this.applyBoneTransform(e,t),t}bind(e,t){this.skeleton=e,t===void 0&&(this.updateMatrixWorld(!0),this.skeleton.calculateInverses(),t=this.matrixWorld),this.bindMatrix.copy(t),this.bindMatrixInverse.copy(t).invert()}pose(){this.skeleton.pose()}normalizeSkinWeights(){const e=new pi,t=this.geometry.attributes.skinWeight;for(let n=0,i=t.count;n<i;n++){e.fromBufferAttribute(t,n);const o=1/e.manhattanLength();o!==1/0?e.multiplyScalar(o):e.set(1,0,0,0),t.setXYZW(n,e.x,e.y,e.z,e.w)}}updateMatrixWorld(e){super.updateMatrixWorld(e),this.bindMode===ex?this.bindMatrixInverse.copy(this.matrixWorld).invert():this.bindMode===nb?this.bindMatrixInverse.copy(this.bindMatrix).invert():Ut("SkinnedMesh: Unrecognized bindMode: "+this.bindMode)}applyBoneTransform(e,t){const n=this.skeleton,i=this.geometry;Jb.fromBufferAttribute(i.attributes.skinIndex,e),qb.fromBufferAttribute(i.attributes.skinWeight,e),Yb.copy(t).applyMatrix4(this.bindMatrix),t.set(0,0,0);for(let o=0;o<4;o++){const l=qb.getComponent(o);if(l!==0){const h=Jb.getComponent(o);Kb.multiplyMatrices(n.bones[h].matrixWorld,n.boneInverses[h]),t.addScaledVector(Z2.copy(Yb).applyMatrix4(Kb),l)}}return t.applyMatrix4(this.bindMatrixInverse)}}class Cp extends Un{constructor(){super(),this.isBone=!0,this.type="Bone"}}class _r extends Qn{constructor(e=null,t=1,n=1,i,o,l,h,d,p=Ti,_=Ti,v,y){super(null,l,h,d,p,_,i,o,v,y),this.isDataTexture=!0,this.image={data:e,width:t,height:n},this.generateMipmaps=!1,this.flipY=!1,this.unpackAlignment=1}}const jb=new en,Q2=new en;class bh{constructor(e=[],t=[]){this.uuid=Qs(),this.bones=e.slice(0),this.boneInverses=t,this.boneMatrices=null,this.previousBoneMatrices=null,this.boneTexture=null,this.init()}init(){const e=this.bones,t=this.boneInverses;if(this.boneMatrices=new Float32Array(e.length*16),t.length===0)this.calculateInverses();else if(e.length!==t.length){Ut("Skeleton: Number of inverse bone matrices does not match amount of bones."),this.boneInverses=[];for(let n=0,i=this.bones.length;n<i;n++)this.boneInverses.push(new en)}}calculateInverses(){this.boneInverses.length=0;for(let e=0,t=this.bones.length;e<t;e++){const n=new en;this.bones[e]&&n.copy(this.bones[e].matrixWorld).invert(),this.boneInverses.push(n)}}pose(){for(let e=0,t=this.bones.length;e<t;e++){const n=this.bones[e];n&&n.matrixWorld.copy(this.boneInverses[e]).invert()}for(let e=0,t=this.bones.length;e<t;e++){const n=this.bones[e];n&&(n.parent&&n.parent.isBone?(n.matrix.copy(n.parent.matrixWorld).invert(),n.matrix.multiply(n.matrixWorld)):n.matrix.copy(n.matrixWorld),n.matrix.decompose(n.position,n.quaternion,n.scale))}}update(){const e=this.bones,t=this.boneInverses,n=this.boneMatrices,i=this.boneTexture;for(let o=0,l=e.length;o<l;o++){const h=e[o]?e[o].matrixWorld:Q2;jb.multiplyMatrices(h,t[o]),jb.toArray(n,o*16)}i!==null&&(i.needsUpdate=!0)}clone(){return new bh(this.bones,this.boneInverses)}computeBoneTexture(){let e=Math.sqrt(this.bones.length*4);e=Math.ceil(e/4)*4,e=Math.max(e,4);const t=new Float32Array(e*e*4);t.set(this.boneMatrices);const n=new _r(t,e,e,Zi,Ci);return n.needsUpdate=!0,this.boneMatrices=t,this.boneTexture=n,this}getBoneByName(e){for(let t=0,n=this.bones.length;t<n;t++){const i=this.bones[t];if(i.name===e)return i}}dispose(){this.boneTexture!==null&&(this.boneTexture.dispose(),this.boneTexture=null)}fromJSON(e,t){this.uuid=e.uuid;for(let n=0,i=e.bones.length;n<i;n++){const o=e.bones[n];let l=t[o];l===void 0&&(Ut("Skeleton: No bone found with UUID:",o),l=new Cp),this.bones.push(l),this.boneInverses.push(new en().fromArray(e.boneInverses[n]))}return this.init(),this}toJSON(){const e={metadata:{version:4.7,type:"Skeleton",generator:"Skeleton.toJSON"},bones:[],boneInverses:[]};e.uuid=this.uuid;const t=this.bones,n=this.boneInverses;for(let i=0,o=t.length;i<o;i++){const l=t[i];e.bones.push(l.uuid);const h=n[i];e.boneInverses.push(h.toArray())}return e}}class xc extends Hn{constructor(e,t,n,i=1){super(e,t,n),this.isInstancedBufferAttribute=!0,this.meshPerAttribute=i}copy(e){return super.copy(e),this.meshPerAttribute=e.meshPerAttribute,this}toJSON(){const e=super.toJSON();return e.meshPerAttribute=this.meshPerAttribute,e.isInstancedBufferAttribute=!0,e}}const Eh=new en,Zb=new en,tv=[],Qb=new Ra,$2=new en,Rp=new yi,wp=new fa;class nv extends yi{constructor(e,t,n){super(e,t),this.isInstancedMesh=!0,this.instanceMatrix=new xc(new Float32Array(n*16),16),this.instanceColor=null,this.morphTexture=null,this.count=n,this.boundingBox=null,this.boundingSphere=null;for(let i=0;i<n;i++)this.setMatrixAt(i,$2)}computeBoundingBox(){const e=this.geometry,t=this.count;this.boundingBox===null&&(this.boundingBox=new Ra),e.boundingBox===null&&e.computeBoundingBox(),this.boundingBox.makeEmpty();for(let n=0;n<t;n++)this.getMatrixAt(n,Eh),Qb.copy(e.boundingBox).applyMatrix4(Eh),this.boundingBox.union(Qb)}computeBoundingSphere(){const e=this.geometry,t=this.count;this.boundingSphere===null&&(this.boundingSphere=new fa),e.boundingSphere===null&&e.computeBoundingSphere(),this.boundingSphere.makeEmpty();for(let n=0;n<t;n++)this.getMatrixAt(n,Eh),wp.copy(e.boundingSphere).applyMatrix4(Eh),this.boundingSphere.union(wp)}copy(e,t){return super.copy(e,t),this.instanceMatrix.copy(e.instanceMatrix),e.morphTexture!==null&&(this.morphTexture=e.morphTexture.clone()),e.instanceColor!==null&&(this.instanceColor=e.instanceColor.clone()),this.count=e.count,e.boundingBox!==null&&(this.boundingBox=e.boundingBox.clone()),e.boundingSphere!==null&&(this.boundingSphere=e.boundingSphere.clone()),this}getColorAt(e,t){t.fromArray(this.instanceColor.array,e*3)}getMatrixAt(e,t){t.fromArray(this.instanceMatrix.array,e*16)}getMorphAt(e,t){const n=t.morphTargetInfluences,i=this.morphTexture.source.data.data,o=n.length+1,l=e*o+1;for(let h=0;h<n.length;h++)n[h]=i[l+h]}raycast(e,t){const n=this.matrixWorld,i=this.count;if(Rp.geometry=this.geometry,Rp.material=this.material,Rp.material!==void 0&&(this.boundingSphere===null&&this.computeBoundingSphere(),wp.copy(this.boundingSphere),wp.applyMatrix4(n),e.ray.intersectsSphere(wp)!==!1))for(let o=0;o<i;o++){this.getMatrixAt(o,Eh),Zb.multiplyMatrices(n,Eh),Rp.matrixWorld=Zb,Rp.raycast(e,tv);for(let l=0,h=tv.length;l<h;l++){const d=tv[l];d.instanceId=o,d.object=this,t.push(d)}tv.length=0}}setColorAt(e,t){this.instanceColor===null&&(this.instanceColor=new xc(new Float32Array(this.instanceMatrix.count*3).fill(1),3)),t.toArray(this.instanceColor.array,e*3)}setMatrixAt(e,t){t.toArray(this.instanceMatrix.array,e*16)}setMorphAt(e,t){const n=t.morphTargetInfluences,i=n.length+1;this.morphTexture===null&&(this.morphTexture=new _r(new Float32Array(i*this.count),i,this.count,ip,Ci));const o=this.morphTexture.source.data.data;let l=0;for(let p=0;p<n.length;p++)l+=n[p];const h=this.geometry.morphTargetsRelative?1:1-l,d=i*e;o[d]=h,o.set(n,d+1)}updateMorphTargets(){}dispose(){this.dispatchEvent({type:"dispose"}),this.morphTexture!==null&&(this.morphTexture.dispose(),this.morphTexture=null)}}const Hx=new Z,ew=new Z,tw=new yn;class Ac{constructor(e=new Z(1,0,0),t=0){this.isPlane=!0,this.normal=e,this.constant=t}set(e,t){return this.normal.copy(e),this.constant=t,this}setComponents(e,t,n,i){return this.normal.set(e,t,n),this.constant=i,this}setFromNormalAndCoplanarPoint(e,t){return this.normal.copy(e),this.constant=-t.dot(this.normal),this}setFromCoplanarPoints(e,t,n){const i=Hx.subVectors(n,t).cross(ew.subVectors(e,t)).normalize();return this.setFromNormalAndCoplanarPoint(i,e),this}copy(e){return this.normal.copy(e.normal),this.constant=e.constant,this}normalize(){const e=1/this.normal.length();return this.normal.multiplyScalar(e),this.constant*=e,this}negate(){return this.constant*=-1,this.normal.negate(),this}distanceToPoint(e){return this.normal.dot(e)+this.constant}distanceToSphere(e){return this.distanceToPoint(e.center)-e.radius}projectPoint(e,t){return t.copy(e).addScaledVector(this.normal,-this.distanceToPoint(e))}intersectLine(e,t){const n=e.delta(Hx),i=this.normal.dot(n);if(i===0)return this.distanceToPoint(e.start)===0?t.copy(e.start):null;const o=-(e.start.dot(this.normal)+this.constant)/i;return o<0||o>1?null:t.copy(e.start).addScaledVector(n,o)}intersectsLine(e){const t=this.distanceToPoint(e.start),n=this.distanceToPoint(e.end);return t<0&&n>0||n<0&&t>0}intersectsBox(e){return e.intersectsPlane(this)}intersectsSphere(e){return e.intersectsPlane(this)}coplanarPoint(e){return e.copy(this.normal).multiplyScalar(-this.constant)}applyMatrix4(e,t){const n=t||tw.getNormalMatrix(e),i=this.coplanarPoint(Hx).applyMatrix4(e),o=this.normal.applyMatrix3(n).normalize();return this.constant=-i.dot(o),this}translate(e){return this.constant-=e.dot(this.normal),this}equals(e){return e.normal.equals(this.normal)&&e.constant===this.constant}clone(){return new this.constructor().copy(this)}}const Nu=new fa,nw=new nt(.5,.5),iv=new Z;class Th{constructor(e=new Ac,t=new Ac,n=new Ac,i=new Ac,o=new Ac,l=new Ac){this.planes=[e,t,n,i,o,l]}set(e,t,n,i,o,l){const h=this.planes;return h[0].copy(e),h[1].copy(t),h[2].copy(n),h[3].copy(i),h[4].copy(o),h[5].copy(l),this}copy(e){const t=this.planes;for(let n=0;n<6;n++)t[n].copy(e.planes[n]);return this}setFromProjectionMatrix(e,t=Zs,n=!1){const i=this.planes,o=e.elements,l=o[0],h=o[1],d=o[2],p=o[3],_=o[4],v=o[5],y=o[6],x=o[7],b=o[8],R=o[9],T=o[10],M=o[11],w=o[12],D=o[13],N=o[14],H=o[15];if(i[0].setComponents(p-l,x-_,M-b,H-w).normalize(),i[1].setComponents(p+l,x+_,M+b,H+w).normalize(),i[2].setComponents(p+h,x+v,M+R,H+D).normalize(),i[3].setComponents(p-h,x-v,M-R,H-D).normalize(),n)i[4].setComponents(d,y,T,N).normalize(),i[5].setComponents(p-d,x-y,M-T,H-N).normalize();else if(i[4].setComponents(p-d,x-y,M-T,H-N).normalize(),t===Zs)i[5].setComponents(p+d,x+y,M+T,H+N).normalize();else if(t===$f)i[5].setComponents(d,y,T,N).normalize();else throw new Error("THREE.Frustum.setFromProjectionMatrix(): Invalid coordinate system: "+t);return this}intersectsObject(e){if(e.boundingSphere!==void 0)e.boundingSphere===null&&e.computeBoundingSphere(),Nu.copy(e.boundingSphere).applyMatrix4(e.matrixWorld);else{const t=e.geometry;t.boundingSphere===null&&t.computeBoundingSphere(),Nu.copy(t.boundingSphere).applyMatrix4(e.matrixWorld)}return this.intersectsSphere(Nu)}intersectsSprite(e){Nu.center.set(0,0,0);const t=nw.distanceTo(e.center);return Nu.radius=.7071067811865476+t,Nu.applyMatrix4(e.matrixWorld),this.intersectsSphere(Nu)}intersectsSphere(e){const t=this.planes,n=e.center,i=-e.radius;for(let o=0;o<6;o++)if(t[o].distanceToPoint(n)<i)return!1;return!0}intersectsBox(e){const t=this.planes;for(let n=0;n<6;n++){const i=t[n];if(iv.x=i.normal.x>0?e.max.x:e.min.x,iv.y=i.normal.y>0?e.max.y:e.min.y,iv.z=i.normal.z>0?e.max.z:e.min.z,i.distanceToPoint(iv)<0)return!1}return!0}containsPoint(e){const t=this.planes;for(let n=0;n<6;n++)if(t[n].distanceToPoint(e)<0)return!1;return!0}clone(){return new this.constructor().copy(this)}}const Co=new en,Ro=new Th;class av{constructor(){this.coordinateSystem=Zs}intersectsObject(e,t){if(!t.isArrayCamera||t.cameras.length===0)return!1;for(let n=0;n<t.cameras.length;n++){const i=t.cameras[n];if(Co.multiplyMatrices(i.projectionMatrix,i.matrixWorldInverse),Ro.setFromProjectionMatrix(Co,i.coordinateSystem,i.reversedDepth),Ro.intersectsObject(e))return!0}return!1}intersectsSprite(e,t){if(!t||!t.cameras||t.cameras.length===0)return!1;for(let n=0;n<t.cameras.length;n++){const i=t.cameras[n];if(Co.multiplyMatrices(i.projectionMatrix,i.matrixWorldInverse),Ro.setFromProjectionMatrix(Co,i.coordinateSystem,i.reversedDepth),Ro.intersectsSprite(e))return!0}return!1}intersectsSphere(e,t){if(!t||!t.cameras||t.cameras.length===0)return!1;for(let n=0;n<t.cameras.length;n++){const i=t.cameras[n];if(Co.multiplyMatrices(i.projectionMatrix,i.matrixWorldInverse),Ro.setFromProjectionMatrix(Co,i.coordinateSystem,i.reversedDepth),Ro.intersectsSphere(e))return!0}return!1}intersectsBox(e,t){if(!t||!t.cameras||t.cameras.length===0)return!1;for(let n=0;n<t.cameras.length;n++){const i=t.cameras[n];if(Co.multiplyMatrices(i.projectionMatrix,i.matrixWorldInverse),Ro.setFromProjectionMatrix(Co,i.coordinateSystem,i.reversedDepth),Ro.intersectsBox(e))return!0}return!1}containsPoint(e,t){if(!t||!t.cameras||t.cameras.length===0)return!1;for(let n=0;n<t.cameras.length;n++){const i=t.cameras[n];if(Co.multiplyMatrices(i.projectionMatrix,i.matrixWorldInverse),Ro.setFromProjectionMatrix(Co,i.coordinateSystem,i.reversedDepth),Ro.containsPoint(e))return!0}return!1}clone(){return new av}}function Px(s,e){return s-e}function iw(s,e){return s.z-e.z}function aw(s,e){return e.z-s.z}class sw{constructor(){this.index=0,this.pool=[],this.list=[]}push(e,t,n,i){const o=this.pool,l=this.list;this.index>=o.length&&o.push({start:-1,count:-1,z:-1,index:-1});const h=o[this.index];l.push(h),this.index++,h.start=e,h.count=t,h.z=n,h.index=i}reset(){this.list.length=0,this.index=0}}const Ps=new en,rw=new Ct(1,1,1),$b=new Th,ow=new av,sv=new Ra,Uu=new fa,Bp=new Z,e1=new Z,lw=new Z,Gx=new sw,$a=new yi,rv=[];function cw(s,e,t=0){const n=e.itemSize;if(s.isInterleavedBufferAttribute||s.array.constructor!==e.array.constructor){const i=s.count;for(let o=0;o<i;o++)for(let l=0;l<n;l++)e.setComponent(o+t,l,s.getComponent(o,l))}else e.array.set(s.array,t*n);e.needsUpdate=!0}function Lu(s,e){if(s.constructor!==e.constructor){const t=Math.min(s.length,e.length);for(let n=0;n<t;n++)e[n]=s[n]}else{const t=Math.min(s.length,e.length);e.set(new s.constructor(s.buffer,0,t))}}class t1 extends yi{constructor(e,t,n=t*2,i){super(new pn,i),this.isBatchedMesh=!0,this.perObjectFrustumCulled=!0,this.sortObjects=!0,this.boundingBox=null,this.boundingSphere=null,this.customSort=null,this._instanceInfo=[],this._geometryInfo=[],this._availableInstanceIds=[],this._availableGeometryIds=[],this._nextIndexStart=0,this._nextVertexStart=0,this._geometryCount=0,this._visibilityChanged=!0,this._geometryInitialized=!1,this._maxInstanceCount=e,this._maxVertexCount=t,this._maxIndexCount=n,this._multiDrawCounts=new Int32Array(e),this._multiDrawStarts=new Int32Array(e),this._multiDrawCount=0,this._multiDrawInstances=null,this._matricesTexture=null,this._indirectTexture=null,this._colorsTexture=null,this._initMatricesTexture(),this._initIndirectTexture()}get maxInstanceCount(){return this._maxInstanceCount}get instanceCount(){return this._instanceInfo.length-this._availableInstanceIds.length}get unusedVertexCount(){return this._maxVertexCount-this._nextVertexStart}get unusedIndexCount(){return this._maxIndexCount-this._nextIndexStart}_initMatricesTexture(){let e=Math.sqrt(this._maxInstanceCount*4);e=Math.ceil(e/4)*4,e=Math.max(e,4);const t=new Float32Array(e*e*4),n=new _r(t,e,e,Zi,Ci);this._matricesTexture=n}_initIndirectTexture(){let e=Math.sqrt(this._maxInstanceCount);e=Math.ceil(e);const t=new Uint32Array(e*e),n=new _r(t,e,e,ap,js);this._indirectTexture=n}_initColorsTexture(){let e=Math.sqrt(this._maxInstanceCount);e=Math.ceil(e);const t=new Float32Array(e*e*4).fill(1),n=new _r(t,e,e,Zi,Ci);n.colorSpace=Bn.workingColorSpace,this._colorsTexture=n}_initializeGeometry(e){const t=this.geometry,n=this._maxVertexCount,i=this._maxIndexCount;if(this._geometryInitialized===!1){for(const o in e.attributes){const l=e.getAttribute(o),{array:h,itemSize:d,normalized:p}=l,_=new h.constructor(n*d),v=new Hn(_,d,p);t.setAttribute(o,v)}if(e.getIndex()!==null){const o=n>65535?new Uint32Array(i):new Uint16Array(i);t.setIndex(new Hn(o,1))}this._geometryInitialized=!0}}_validateGeometry(e){const t=this.geometry;if(!!e.getIndex()!=!!t.getIndex())throw new Error('THREE.BatchedMesh: All geometries must consistently have "index".');for(const n in t.attributes){if(!e.hasAttribute(n))throw new Error(`THREE.BatchedMesh: Added geometry missing "${n}". All geometries must have consistent attributes.`);const i=e.getAttribute(n),o=t.getAttribute(n);if(i.itemSize!==o.itemSize||i.normalized!==o.normalized)throw new Error("THREE.BatchedMesh: All attributes must have a consistent itemSize and normalized value.")}}validateInstanceId(e){const t=this._instanceInfo;if(e<0||e>=t.length||t[e].active===!1)throw new Error(`THREE.BatchedMesh: Invalid instanceId ${e}. Instance is either out of range or has been deleted.`)}validateGeometryId(e){const t=this._geometryInfo;if(e<0||e>=t.length||t[e].active===!1)throw new Error(`THREE.BatchedMesh: Invalid geometryId ${e}. Geometry is either out of range or has been deleted.`)}setCustomSort(e){return this.customSort=e,this}computeBoundingBox(){this.boundingBox===null&&(this.boundingBox=new Ra);const e=this.boundingBox,t=this._instanceInfo;e.makeEmpty();for(let n=0,i=t.length;n<i;n++){if(t[n].active===!1)continue;const o=t[n].geometryIndex;this.getMatrixAt(n,Ps),this.getBoundingBoxAt(o,sv).applyMatrix4(Ps),e.union(sv)}}computeBoundingSphere(){this.boundingSphere===null&&(this.boundingSphere=new fa);const e=this.boundingSphere,t=this._instanceInfo;e.makeEmpty();for(let n=0,i=t.length;n<i;n++){if(t[n].active===!1)continue;const o=t[n].geometryIndex;this.getMatrixAt(n,Ps),this.getBoundingSphereAt(o,Uu).applyMatrix4(Ps),e.union(Uu)}}addInstance(e){if(this._instanceInfo.length>=this.maxInstanceCount&&this._availableInstanceIds.length===0)throw new Error("THREE.BatchedMesh: Maximum item count reached.");const n={visible:!0,active:!0,geometryIndex:e};let i=null;this._availableInstanceIds.length>0?(this._availableInstanceIds.sort(Px),i=this._availableInstanceIds.shift(),this._instanceInfo[i]=n):(i=this._instanceInfo.length,this._instanceInfo.push(n));const o=this._matricesTexture;Ps.identity().toArray(o.image.data,i*16),o.needsUpdate=!0;const l=this._colorsTexture;return l&&(rw.toArray(l.image.data,i*4),l.needsUpdate=!0),this._visibilityChanged=!0,i}addGeometry(e,t=-1,n=-1){this._initializeGeometry(e),this._validateGeometry(e);const i={vertexStart:-1,vertexCount:-1,reservedVertexCount:-1,indexStart:-1,indexCount:-1,reservedIndexCount:-1,start:-1,count:-1,boundingBox:null,boundingSphere:null,active:!0},o=this._geometryInfo;i.vertexStart=this._nextVertexStart,i.reservedVertexCount=t===-1?e.getAttribute("position").count:t;const l=e.getIndex();if(l!==null&&(i.indexStart=this._nextIndexStart,i.reservedIndexCount=n===-1?l.count:n),i.indexStart!==-1&&i.indexStart+i.reservedIndexCount>this._maxIndexCount||i.vertexStart+i.reservedVertexCount>this._maxVertexCount)throw new Error("THREE.BatchedMesh: Reserved space request exceeds the maximum buffer size.");let d;return this._availableGeometryIds.length>0?(this._availableGeometryIds.sort(Px),d=this._availableGeometryIds.shift(),o[d]=i):(d=this._geometryCount,this._geometryCount++,o.push(i)),this.setGeometryAt(d,e),this._nextIndexStart=i.indexStart+i.reservedIndexCount,this._nextVertexStart=i.vertexStart+i.reservedVertexCount,d}setGeometryAt(e,t){if(e>=this._geometryCount)throw new Error("THREE.BatchedMesh: Maximum geometry count reached.");this._validateGeometry(t);const n=this.geometry,i=n.getIndex()!==null,o=n.getIndex(),l=t.getIndex(),h=this._geometryInfo[e];if(i&&l.count>h.reservedIndexCount||t.attributes.position.count>h.reservedVertexCount)throw new Error("THREE.BatchedMesh: Reserved space not large enough for provided geometry.");const d=h.vertexStart,p=h.reservedVertexCount;h.vertexCount=t.getAttribute("position").count;for(const _ in n.attributes){const v=t.getAttribute(_),y=n.getAttribute(_);cw(v,y,d);const x=v.itemSize;for(let b=v.count,R=p;b<R;b++){const T=d+b;for(let M=0;M<x;M++)y.setComponent(T,M,0)}y.needsUpdate=!0,y.addUpdateRange(d*x,p*x)}if(i){const _=h.indexStart,v=h.reservedIndexCount;h.indexCount=t.getIndex().count;for(let y=0;y<l.count;y++)o.setX(_+y,d+l.getX(y));for(let y=l.count,x=v;y<x;y++)o.setX(_+y,d);o.needsUpdate=!0,o.addUpdateRange(_,h.reservedIndexCount)}return h.start=i?h.indexStart:h.vertexStart,h.count=i?h.indexCount:h.vertexCount,h.boundingBox=null,t.boundingBox!==null&&(h.boundingBox=t.boundingBox.clone()),h.boundingSphere=null,t.boundingSphere!==null&&(h.boundingSphere=t.boundingSphere.clone()),this._visibilityChanged=!0,e}deleteGeometry(e){const t=this._geometryInfo;if(e>=t.length||t[e].active===!1)return this;const n=this._instanceInfo;for(let i=0,o=n.length;i<o;i++)n[i].active&&n[i].geometryIndex===e&&this.deleteInstance(i);return t[e].active=!1,this._availableGeometryIds.push(e),this._visibilityChanged=!0,this}deleteInstance(e){return this.validateInstanceId(e),this._instanceInfo[e].active=!1,this._availableInstanceIds.push(e),this._visibilityChanged=!0,this}optimize(){let e=0,t=0;const n=this._geometryInfo,i=n.map((l,h)=>h).sort((l,h)=>n[l].vertexStart-n[h].vertexStart),o=this.geometry;for(let l=0,h=n.length;l<h;l++){const d=i[l],p=n[d];if(p.active!==!1){if(o.index!==null){if(p.indexStart!==t){const{indexStart:_,vertexStart:v,reservedIndexCount:y}=p,x=o.index,b=x.array,R=e-v;for(let T=_;T<_+y;T++)b[T]=b[T]+R;x.array.copyWithin(t,_,_+y),x.addUpdateRange(t,y),x.needsUpdate=!0,p.indexStart=t}t+=p.reservedIndexCount}if(p.vertexStart!==e){const{vertexStart:_,reservedVertexCount:v}=p,y=o.attributes;for(const x in y){const b=y[x],{array:R,itemSize:T}=b;R.copyWithin(e*T,_*T,(_+v)*T),b.addUpdateRange(e*T,v*T),b.needsUpdate=!0}p.vertexStart=e}e+=p.reservedVertexCount,p.start=o.index?p.indexStart:p.vertexStart,this._nextIndexStart=o.index?p.indexStart+p.reservedIndexCount:0,this._nextVertexStart=p.vertexStart+p.reservedVertexCount}}return this._visibilityChanged=!0,this}getBoundingBoxAt(e,t){if(e>=this._geometryCount)return null;const n=this.geometry,i=this._geometryInfo[e];if(i.boundingBox===null){const o=new Ra,l=n.index,h=n.attributes.position;for(let d=i.start,p=i.start+i.count;d<p;d++){let _=d;l&&(_=l.getX(_)),o.expandByPoint(Bp.fromBufferAttribute(h,_))}i.boundingBox=o}return t.copy(i.boundingBox),t}getBoundingSphereAt(e,t){if(e>=this._geometryCount)return null;const n=this.geometry,i=this._geometryInfo[e];if(i.boundingSphere===null){const o=new fa;this.getBoundingBoxAt(e,sv),sv.getCenter(o.center);const l=n.index,h=n.attributes.position;let d=0;for(let p=i.start,_=i.start+i.count;p<_;p++){let v=p;l&&(v=l.getX(v)),Bp.fromBufferAttribute(h,v),d=Math.max(d,o.center.distanceToSquared(Bp))}o.radius=Math.sqrt(d),i.boundingSphere=o}return t.copy(i.boundingSphere),t}setMatrixAt(e,t){this.validateInstanceId(e);const n=this._matricesTexture,i=this._matricesTexture.image.data;return t.toArray(i,e*16),n.needsUpdate=!0,this}getMatrixAt(e,t){return this.validateInstanceId(e),t.fromArray(this._matricesTexture.image.data,e*16)}setColorAt(e,t){return this.validateInstanceId(e),this._colorsTexture===null&&this._initColorsTexture(),t.toArray(this._colorsTexture.image.data,e*4),this._colorsTexture.needsUpdate=!0,this}getColorAt(e,t){return this.validateInstanceId(e),t.fromArray(this._colorsTexture.image.data,e*4)}setVisibleAt(e,t){return this.validateInstanceId(e),this._instanceInfo[e].visible===t?this:(this._instanceInfo[e].visible=t,this._visibilityChanged=!0,this)}getVisibleAt(e){return this.validateInstanceId(e),this._instanceInfo[e].visible}setGeometryIdAt(e,t){return this.validateInstanceId(e),this.validateGeometryId(t),this._instanceInfo[e].geometryIndex=t,this}getGeometryIdAt(e){return this.validateInstanceId(e),this._instanceInfo[e].geometryIndex}getGeometryRangeAt(e,t={}){this.validateGeometryId(e);const n=this._geometryInfo[e];return t.vertexStart=n.vertexStart,t.vertexCount=n.vertexCount,t.reservedVertexCount=n.reservedVertexCount,t.indexStart=n.indexStart,t.indexCount=n.indexCount,t.reservedIndexCount=n.reservedIndexCount,t.start=n.start,t.count=n.count,t}setInstanceCount(e){const t=this._availableInstanceIds,n=this._instanceInfo;for(t.sort(Px);t[t.length-1]===n.length-1;)n.pop(),t.pop();if(e<n.length)throw new Error(`BatchedMesh: Instance ids outside the range ${e} are being used. Cannot shrink instance count.`);const i=new Int32Array(e),o=new Int32Array(e);Lu(this._multiDrawCounts,i),Lu(this._multiDrawStarts,o),this._multiDrawCounts=i,this._multiDrawStarts=o,this._maxInstanceCount=e;const l=this._indirectTexture,h=this._matricesTexture,d=this._colorsTexture;l.dispose(),this._initIndirectTexture(),Lu(l.image.data,this._indirectTexture.image.data),h.dispose(),this._initMatricesTexture(),Lu(h.image.data,this._matricesTexture.image.data),d&&(d.dispose(),this._initColorsTexture(),Lu(d.image.data,this._colorsTexture.image.data))}setGeometrySize(e,t){const n=[...this._geometryInfo].filter(h=>h.active);if(Math.max(...n.map(h=>h.vertexStart+h.reservedVertexCount))>e)throw new Error(`BatchedMesh: Geometry vertex values are being used outside the range ${t}. Cannot shrink further.`);if(this.geometry.index&&Math.max(...n.map(d=>d.indexStart+d.reservedIndexCount))>t)throw new Error(`BatchedMesh: Geometry index values are being used outside the range ${t}. Cannot shrink further.`);const o=this.geometry;o.dispose(),this._maxVertexCount=e,this._maxIndexCount=t,this._geometryInitialized&&(this._geometryInitialized=!1,this.geometry=new pn,this._initializeGeometry(o));const l=this.geometry;o.index&&Lu(o.index.array,l.index.array);for(const h in o.attributes)Lu(o.attributes[h].array,l.attributes[h].array)}raycast(e,t){const n=this._instanceInfo,i=this._geometryInfo,o=this.matrixWorld,l=this.geometry;$a.material=this.material,$a.geometry.index=l.index,$a.geometry.attributes=l.attributes,$a.geometry.boundingBox===null&&($a.geometry.boundingBox=new Ra),$a.geometry.boundingSphere===null&&($a.geometry.boundingSphere=new fa);for(let h=0,d=n.length;h<d;h++){if(!n[h].visible||!n[h].active)continue;const p=n[h].geometryIndex,_=i[p];$a.geometry.setDrawRange(_.start,_.count),this.getMatrixAt(h,$a.matrixWorld).premultiply(o),this.getBoundingBoxAt(p,$a.geometry.boundingBox),this.getBoundingSphereAt(p,$a.geometry.boundingSphere),$a.raycast(e,rv);for(let v=0,y=rv.length;v<y;v++){const x=rv[v];x.object=this,x.batchId=h,t.push(x)}rv.length=0}$a.material=null,$a.geometry.index=null,$a.geometry.attributes={},$a.geometry.setDrawRange(0,1/0)}copy(e){return super.copy(e),this.geometry=e.geometry.clone(),this.perObjectFrustumCulled=e.perObjectFrustumCulled,this.sortObjects=e.sortObjects,this.boundingBox=e.boundingBox!==null?e.boundingBox.clone():null,this.boundingSphere=e.boundingSphere!==null?e.boundingSphere.clone():null,this._geometryInfo=e._geometryInfo.map(t=>({...t,boundingBox:t.boundingBox!==null?t.boundingBox.clone():null,boundingSphere:t.boundingSphere!==null?t.boundingSphere.clone():null})),this._instanceInfo=e._instanceInfo.map(t=>({...t})),this._availableInstanceIds=e._availableInstanceIds.slice(),this._availableGeometryIds=e._availableGeometryIds.slice(),this._nextIndexStart=e._nextIndexStart,this._nextVertexStart=e._nextVertexStart,this._geometryCount=e._geometryCount,this._maxInstanceCount=e._maxInstanceCount,this._maxVertexCount=e._maxVertexCount,this._maxIndexCount=e._maxIndexCount,this._geometryInitialized=e._geometryInitialized,this._multiDrawCounts=e._multiDrawCounts.slice(),this._multiDrawStarts=e._multiDrawStarts.slice(),this._indirectTexture=e._indirectTexture.clone(),this._indirectTexture.image.data=this._indirectTexture.image.data.slice(),this._matricesTexture=e._matricesTexture.clone(),this._matricesTexture.image.data=this._matricesTexture.image.data.slice(),this._colorsTexture!==null&&(this._colorsTexture=e._colorsTexture.clone(),this._colorsTexture.image.data=this._colorsTexture.image.data.slice()),this}dispose(){this.geometry.dispose(),this._matricesTexture.dispose(),this._matricesTexture=null,this._indirectTexture.dispose(),this._indirectTexture=null,this._colorsTexture!==null&&(this._colorsTexture.dispose(),this._colorsTexture=null)}onBeforeRender(e,t,n,i,o){if(!this._visibilityChanged&&!this.perObjectFrustumCulled&&!this.sortObjects)return;const l=i.getIndex(),h=l===null?1:l.array.BYTES_PER_ELEMENT,d=this._instanceInfo,p=this._multiDrawStarts,_=this._multiDrawCounts,v=this._geometryInfo,y=this.perObjectFrustumCulled,x=this._indirectTexture,b=x.image.data,R=n.isArrayCamera?ow:$b;y&&!n.isArrayCamera&&(Ps.multiplyMatrices(n.projectionMatrix,n.matrixWorldInverse).multiply(this.matrixWorld),$b.setFromProjectionMatrix(Ps,n.coordinateSystem,n.reversedDepth));let T=0;if(this.sortObjects){Ps.copy(this.matrixWorld).invert(),Bp.setFromMatrixPosition(n.matrixWorld).applyMatrix4(Ps),e1.set(0,0,-1).transformDirection(n.matrixWorld).transformDirection(Ps);for(let D=0,N=d.length;D<N;D++)if(d[D].visible&&d[D].active){const H=d[D].geometryIndex;this.getMatrixAt(D,Ps),this.getBoundingSphereAt(H,Uu).applyMatrix4(Ps);let O=!1;if(y&&(O=!R.intersectsSphere(Uu,n)),!O){const z=v[H],V=lw.subVectors(Uu.center,Bp).dot(e1);Gx.push(z.start,z.count,V,D)}}const M=Gx.list,w=this.customSort;w===null?M.sort(o.transparent?aw:iw):w.call(this,M,n);for(let D=0,N=M.length;D<N;D++){const H=M[D];p[T]=H.start*h,_[T]=H.count,b[T]=H.index,T++}Gx.reset()}else for(let M=0,w=d.length;M<w;M++)if(d[M].visible&&d[M].active){const D=d[M].geometryIndex;let N=!1;if(y&&(this.getMatrixAt(M,Ps),this.getBoundingSphereAt(D,Uu).applyMatrix4(Ps),N=!R.intersectsSphere(Uu,n)),!N){const H=v[D];p[T]=H.start*h,_[T]=H.count,b[T]=M,T++}}x.needsUpdate=!0,this._multiDrawCount=T,this._visibilityChanged=!1}onBeforeShadow(e,t,n,i,o,l){this.onBeforeRender(e,null,i,o,l)}}class za extends Yi{constructor(e){super(),this.isLineBasicMaterial=!0,this.type="LineBasicMaterial",this.color=new Ct(16777215),this.map=null,this.linewidth=1,this.linecap="round",this.linejoin="round",this.fog=!0,this.setValues(e)}copy(e){return super.copy(e),this.color.copy(e.color),this.map=e.map,this.linewidth=e.linewidth,this.linecap=e.linecap,this.linejoin=e.linejoin,this.fog=e.fog,this}}const ov=new Z,lv=new Z,n1=new en,Dp=new lh,cv=new fa,zx=new Z,i1=new Z;class wo extends Un{constructor(e=new pn,t=new za){super(),this.isLine=!0,this.type="Line",this.geometry=e,this.material=t,this.morphTargetDictionary=void 0,this.morphTargetInfluences=void 0,this.updateMorphTargets()}copy(e,t){return super.copy(e,t),this.material=Array.isArray(e.material)?e.material.slice():e.material,this.geometry=e.geometry,this}computeLineDistances(){const e=this.geometry;if(e.index===null){const t=e.attributes.position,n=[0];for(let i=1,o=t.count;i<o;i++)ov.fromBufferAttribute(t,i-1),lv.fromBufferAttribute(t,i),n[i]=n[i-1],n[i]+=ov.distanceTo(lv);e.setAttribute("lineDistance",new Xt(n,1))}else Ut("Line.computeLineDistances(): Computation only possible with non-indexed BufferGeometry.");return this}raycast(e,t){const n=this.geometry,i=this.matrixWorld,o=e.params.Line.threshold,l=n.drawRange;if(n.boundingSphere===null&&n.computeBoundingSphere(),cv.copy(n.boundingSphere),cv.applyMatrix4(i),cv.radius+=o,e.ray.intersectsSphere(cv)===!1)return;n1.copy(i).invert(),Dp.copy(e.ray).applyMatrix4(n1);const h=o/((this.scale.x+this.scale.y+this.scale.z)/3),d=h*h,p=this.isLineSegments?2:1,_=n.index,y=n.attributes.position;if(_!==null){const x=Math.max(0,l.start),b=Math.min(_.count,l.start+l.count);for(let R=x,T=b-1;R<T;R+=p){const M=_.getX(R),w=_.getX(R+1),D=uv(this,e,Dp,d,M,w,R);D&&t.push(D)}if(this.isLineLoop){const R=_.getX(b-1),T=_.getX(x),M=uv(this,e,Dp,d,R,T,b-1);M&&t.push(M)}}else{const x=Math.max(0,l.start),b=Math.min(y.count,l.start+l.count);for(let R=x,T=b-1;R<T;R+=p){const M=uv(this,e,Dp,d,R,R+1,R);M&&t.push(M)}if(this.isLineLoop){const R=uv(this,e,Dp,d,b-1,x,b-1);R&&t.push(R)}}}updateMorphTargets(){const t=this.geometry.morphAttributes,n=Object.keys(t);if(n.length>0){const i=t[n[0]];if(i!==void 0){this.morphTargetInfluences=[],this.morphTargetDictionary={};for(let o=0,l=i.length;o<l;o++){const h=i[o].name||String(o);this.morphTargetInfluences.push(0),this.morphTargetDictionary[h]=o}}}}}function uv(s,e,t,n,i,o,l){const h=s.geometry.attributes.position;if(ov.fromBufferAttribute(h,i),lv.fromBufferAttribute(h,o),t.distanceSqToSegment(ov,lv,zx,i1)>n)return;zx.applyMatrix4(s.matrixWorld);const p=e.ray.origin.distanceTo(zx);if(!(p<e.near||p>e.far))return{distance:p,point:i1.clone().applyMatrix4(s.matrixWorld),index:l,face:null,faceIndex:null,barycoord:null,object:s}}const a1=new Z,s1=new Z;class yr extends wo{constructor(e,t){super(e,t),this.isLineSegments=!0,this.type="LineSegments"}computeLineDistances(){const e=this.geometry;if(e.index===null){const t=e.attributes.position,n=[];for(let i=0,o=t.count;i<o;i+=2)a1.fromBufferAttribute(t,i),s1.fromBufferAttribute(t,i+1),n[i]=i===0?0:n[i-1],n[i+1]=n[i]+a1.distanceTo(s1);e.setAttribute("lineDistance",new Xt(n,1))}else Ut("LineSegments.computeLineDistances(): Computation only possible with non-indexed BufferGeometry.");return this}}class fv extends wo{constructor(e,t){super(e,t),this.isLineLoop=!0,this.type="LineLoop"}}class Np extends Yi{constructor(e){super(),this.isPointsMaterial=!0,this.type="PointsMaterial",this.color=new Ct(16777215),this.map=null,this.alphaMap=null,this.size=1,this.sizeAttenuation=!0,this.fog=!0,this.setValues(e)}copy(e){return super.copy(e),this.color.copy(e.color),this.map=e.map,this.alphaMap=e.alphaMap,this.size=e.size,this.sizeAttenuation=e.sizeAttenuation,this.fog=e.fog,this}}const r1=new en,Vx=new lh,hv=new fa,dv=new Z;class pv extends Un{constructor(e=new pn,t=new Np){super(),this.isPoints=!0,this.type="Points",this.geometry=e,this.material=t,this.morphTargetDictionary=void 0,this.morphTargetInfluences=void 0,this.updateMorphTargets()}copy(e,t){return super.copy(e,t),this.material=Array.isArray(e.material)?e.material.slice():e.material,this.geometry=e.geometry,this}raycast(e,t){const n=this.geometry,i=this.matrixWorld,o=e.params.Points.threshold,l=n.drawRange;if(n.boundingSphere===null&&n.computeBoundingSphere(),hv.copy(n.boundingSphere),hv.applyMatrix4(i),hv.radius+=o,e.ray.intersectsSphere(hv)===!1)return;r1.copy(i).invert(),Vx.copy(e.ray).applyMatrix4(r1);const h=o/((this.scale.x+this.scale.y+this.scale.z)/3),d=h*h,p=n.index,v=n.attributes.position;if(p!==null){const y=Math.max(0,l.start),x=Math.min(p.count,l.start+l.count);for(let b=y,R=x;b<R;b++){const T=p.getX(b);dv.fromBufferAttribute(v,T),o1(dv,T,d,i,e,t,this)}}else{const y=Math.max(0,l.start),x=Math.min(v.count,l.start+l.count);for(let b=y,R=x;b<R;b++)dv.fromBufferAttribute(v,b),o1(dv,b,d,i,e,t,this)}}updateMorphTargets(){const t=this.geometry.morphAttributes,n=Object.keys(t);if(n.length>0){const i=t[n[0]];if(i!==void 0){this.morphTargetInfluences=[],this.morphTargetDictionary={};for(let o=0,l=i.length;o<l;o++){const h=i[o].name||String(o);this.morphTargetInfluences.push(0),this.morphTargetDictionary[h]=o}}}}}function o1(s,e,t,n,i,o,l){const h=Vx.distanceSqToPoint(s);if(h<t){const d=new Z;Vx.closestPointToPoint(s,d),d.applyMatrix4(n);const p=i.ray.origin.distanceTo(d);if(p<i.near||p>i.far)return;o.push({distance:p,distanceToRay:Math.sqrt(h),point:d,index:e,face:null,faceIndex:null,barycoord:null,object:l})}}class l1 extends Qn{constructor(e,t,n,i,o=Cn,l=Cn,h,d,p){super(e,t,n,i,o,l,h,d,p),this.isVideoTexture=!0,this.generateMipmaps=!1,this._requestVideoFrameCallbackId=0;const _=this;function v(){_.needsUpdate=!0,_._requestVideoFrameCallbackId=e.requestVideoFrameCallback(v)}"requestVideoFrameCallback"in e&&(this._requestVideoFrameCallbackId=e.requestVideoFrameCallback(v))}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)}dispose(){this._requestVideoFrameCallbackId!==0&&(this.source.data.cancelVideoFrameCallback(this._requestVideoFrameCallbackId),this._requestVideoFrameCallbackId=0),super.dispose()}}class uw extends l1{constructor(e,t,n,i,o,l,h,d){super({},e,t,n,i,o,l,h,d),this.isVideoFrameTexture=!0}update(){}clone(){return new this.constructor().copy(this)}setFrame(e){this.image=e,this.needsUpdate=!0}}class fw extends Qn{constructor(e,t){super({width:e,height:t}),this.isFramebufferTexture=!0,this.magFilter=Ti,this.minFilter=Ti,this.generateMipmaps=!1,this.needsUpdate=!0}}class mv extends Qn{constructor(e,t,n,i,o,l,h,d,p,_,v,y){super(null,l,h,d,p,_,i,o,v,y),this.isCompressedTexture=!0,this.image={width:t,height:n},this.mipmaps=e,this.flipY=!1,this.generateMipmaps=!1}}class hw extends mv{constructor(e,t,n,i,o,l){super(e,t,n,o,l),this.isCompressedArrayTexture=!0,this.image.depth=i,this.wrapR=Ei,this.layerUpdates=new Set}addLayerUpdate(e){this.layerUpdates.add(e)}clearLayerUpdates(){this.layerUpdates.clear()}}class dw extends mv{constructor(e,t,n){super(void 0,e[0].width,e[0].height,t,n,qr),this.isCompressedCubeTexture=!0,this.isCubeTexture=!0,this.image=e}}class pw extends Qn{constructor(e,t,n,i,o,l,h,d,p){super(e,t,n,i,o,l,h,d,p),this.isCanvasTexture=!0,this.needsUpdate=!0}}class Ch extends Qn{constructor(e,t,n=js,i,o,l,h=Ti,d=Ti,p,_=Eo,v=1){if(_!==Eo&&_!==cc)throw new Error("DepthTexture format must be either THREE.DepthFormat or THREE.DepthStencilFormat");const y={width:e,height:t,depth:v};super(y,i,o,l,h,d,_,n,p),this.isDepthTexture=!0,this.flipY=!1,this.generateMipmaps=!1,this.compareFunction=null}copy(e){return super.copy(e),this.source=new dc(Object.assign({},e.image)),this.compareFunction=e.compareFunction,this}toJSON(e){const t=super.toJSON(e);return this.compareFunction!==null&&(t.compareFunction=this.compareFunction),t}}class c1 extends Ch{constructor(e,t=js,n=qr,i,o,l=Ti,h=Ti,d,p=Eo){const _={width:e,height:e,depth:1},v=[_,_,_,_,_,_];super(e,e,t,n,i,o,l,h,d,p),this.image=v,this.isCubeDepthTexture=!0,this.isCubeTexture=!0}get images(){return this.image}set images(e){this.image=e}}class kx extends Qn{constructor(e=null){super(),this.sourceTexture=e,this.isExternalTexture=!0}copy(e){return super.copy(e),this.sourceTexture=e.sourceTexture,this}}class gv extends pn{constructor(e=1,t=1,n=4,i=8,o=1){super(),this.type="CapsuleGeometry",this.parameters={radius:e,height:t,capSegments:n,radialSegments:i,heightSegments:o},t=Math.max(0,t),n=Math.max(1,Math.floor(n)),i=Math.max(3,Math.floor(i)),o=Math.max(1,Math.floor(o));const l=[],h=[],d=[],p=[],_=t/2,v=Math.PI/2*e,y=t,x=2*v+y,b=n*2+o,R=i+1,T=new Z,M=new Z;for(let w=0;w<=b;w++){let D=0,N=0,H=0,O=0;if(w<=n){const U=w/n,F=U*Math.PI/2;N=-_-e*Math.cos(F),H=e*Math.sin(F),O=-e*Math.cos(F),D=U*v}else if(w<=n+o){const U=(w-n)/o;N=-_+U*t,H=e,O=0,D=v+U*y}else{const U=(w-n-o)/n,F=U*Math.PI/2;N=_+e*Math.sin(F),H=e*Math.cos(F),O=e*Math.sin(F),D=v+y+U*v}const z=Math.max(0,Math.min(1,D/x));let V=0;w===0?V=.5/i:w===b&&(V=-.5/i);for(let U=0;U<=i;U++){const F=U/i,K=F*Math.PI*2,ne=Math.sin(K),$=Math.cos(K);M.x=-H*$,M.y=N,M.z=H*ne,h.push(M.x,M.y,M.z),T.set(-H*$,O,H*ne),T.normalize(),d.push(T.x,T.y,T.z),p.push(F+V,z)}if(w>0){const U=(w-1)*R;for(let F=0;F<i;F++){const K=U+F,ne=U+F+1,$=w*R+F,ae=w*R+F+1;l.push(K,ne,$),l.push(ne,ae,$)}}}this.setIndex(l),this.setAttribute("position",new Xt(h,3)),this.setAttribute("normal",new Xt(d,3)),this.setAttribute("uv",new Xt(p,2))}copy(e){return super.copy(e),this.parameters=Object.assign({},e.parameters),this}static fromJSON(e){return new gv(e.radius,e.height,e.capSegments,e.radialSegments,e.heightSegments)}}class vv extends pn{constructor(e=1,t=32,n=0,i=Math.PI*2){super(),this.type="CircleGeometry",this.parameters={radius:e,segments:t,thetaStart:n,thetaLength:i},t=Math.max(3,t);const o=[],l=[],h=[],d=[],p=new Z,_=new nt;l.push(0,0,0),h.push(0,0,1),d.push(.5,.5);for(let v=0,y=3;v<=t;v++,y+=3){const x=n+v/t*i;p.x=e*Math.cos(x),p.y=e*Math.sin(x),l.push(p.x,p.y,p.z),h.push(0,0,1),_.x=(l[y]/e+1)/2,_.y=(l[y+1]/e+1)/2,d.push(_.x,_.y)}for(let v=1;v<=t;v++)o.push(v,v+1,0);this.setIndex(o),this.setAttribute("position",new Xt(l,3)),this.setAttribute("normal",new Xt(h,3)),this.setAttribute("uv",new Xt(d,2))}copy(e){return super.copy(e),this.parameters=Object.assign({},e.parameters),this}static fromJSON(e){return new vv(e.radius,e.segments,e.thetaStart,e.thetaLength)}}class Up extends pn{constructor(e=1,t=1,n=1,i=32,o=1,l=!1,h=0,d=Math.PI*2){super(),this.type="CylinderGeometry",this.parameters={radiusTop:e,radiusBottom:t,height:n,radialSegments:i,heightSegments:o,openEnded:l,thetaStart:h,thetaLength:d};const p=this;i=Math.floor(i),o=Math.floor(o);const _=[],v=[],y=[],x=[];let b=0;const R=[],T=n/2;let M=0;w(),l===!1&&(e>0&&D(!0),t>0&&D(!1)),this.setIndex(_),this.setAttribute("position",new Xt(v,3)),this.setAttribute("normal",new Xt(y,3)),this.setAttribute("uv",new Xt(x,2));function w(){const N=new Z,H=new Z;let O=0;const z=(t-e)/n;for(let V=0;V<=o;V++){const U=[],F=V/o,K=F*(t-e)+e;for(let ne=0;ne<=i;ne++){const $=ne/i,ae=$*d+h,ge=Math.sin(ae),I=Math.cos(ae);H.x=K*ge,H.y=-F*n+T,H.z=K*I,v.push(H.x,H.y,H.z),N.set(ge,z,I).normalize(),y.push(N.x,N.y,N.z),x.push($,1-F),U.push(b++)}R.push(U)}for(let V=0;V<i;V++)for(let U=0;U<o;U++){const F=R[U][V],K=R[U+1][V],ne=R[U+1][V+1],$=R[U][V+1];(e>0||U!==0)&&(_.push(F,K,$),O+=3),(t>0||U!==o-1)&&(_.push(K,ne,$),O+=3)}p.addGroup(M,O,0),M+=O}function D(N){const H=b,O=new nt,z=new Z;let V=0;const U=N===!0?e:t,F=N===!0?1:-1;for(let ne=1;ne<=i;ne++)v.push(0,T*F,0),y.push(0,F,0),x.push(.5,.5),b++;const K=b;for(let ne=0;ne<=i;ne++){const ae=ne/i*d+h,ge=Math.cos(ae),I=Math.sin(ae);z.x=U*I,z.y=T*F,z.z=U*ge,v.push(z.x,z.y,z.z),y.push(0,F,0),O.x=ge*.5+.5,O.y=I*.5*F+.5,x.push(O.x,O.y),b++}for(let ne=0;ne<i;ne++){const $=H+ne,ae=K+ne;N===!0?_.push(ae,ae+1,$):_.push(ae+1,ae,$),V+=3}p.addGroup(M,V,N===!0?1:2),M+=V}}copy(e){return super.copy(e),this.parameters=Object.assign({},e.parameters),this}static fromJSON(e){return new Up(e.radiusTop,e.radiusBottom,e.height,e.radialSegments,e.heightSegments,e.openEnded,e.thetaStart,e.thetaLength)}}class Lp extends Up{constructor(e=1,t=1,n=32,i=1,o=!1,l=0,h=Math.PI*2){super(0,e,t,n,i,o,l,h),this.type="ConeGeometry",this.parameters={radius:e,height:t,radialSegments:n,heightSegments:i,openEnded:o,thetaStart:l,thetaLength:h}}static fromJSON(e){return new Lp(e.radius,e.height,e.radialSegments,e.heightSegments,e.openEnded,e.thetaStart,e.thetaLength)}}class Sc extends pn{constructor(e=[],t=[],n=1,i=0){super(),this.type="PolyhedronGeometry",this.parameters={vertices:e,indices:t,radius:n,detail:i};const o=[],l=[];h(i),p(n),_(),this.setAttribute("position",new Xt(o,3)),this.setAttribute("normal",new Xt(o.slice(),3)),this.setAttribute("uv",new Xt(l,2)),i===0?this.computeVertexNormals():this.normalizeNormals();function h(w){const D=new Z,N=new Z,H=new Z;for(let O=0;O<t.length;O+=3)x(t[O+0],D),x(t[O+1],N),x(t[O+2],H),d(D,N,H,w)}function d(w,D,N,H){const O=H+1,z=[];for(let V=0;V<=O;V++){z[V]=[];const U=w.clone().lerp(N,V/O),F=D.clone().lerp(N,V/O),K=O-V;for(let ne=0;ne<=K;ne++)ne===0&&V===O?z[V][ne]=U:z[V][ne]=U.clone().lerp(F,ne/K)}for(let V=0;V<O;V++)for(let U=0;U<2*(O-V)-1;U++){const F=Math.floor(U/2);U%2===0?(y(z[V][F+1]),y(z[V+1][F]),y(z[V][F])):(y(z[V][F+1]),y(z[V+1][F+1]),y(z[V+1][F]))}}function p(w){const D=new Z;for(let N=0;N<o.length;N+=3)D.x=o[N+0],D.y=o[N+1],D.z=o[N+2],D.normalize().multiplyScalar(w),o[N+0]=D.x,o[N+1]=D.y,o[N+2]=D.z}function _(){const w=new Z;for(let D=0;D<o.length;D+=3){w.x=o[D+0],w.y=o[D+1],w.z=o[D+2];const N=T(w)/2/Math.PI+.5,H=M(w)/Math.PI+.5;l.push(N,1-H)}b(),v()}function v(){for(let w=0;w<l.length;w+=6){const D=l[w+0],N=l[w+2],H=l[w+4],O=Math.max(D,N,H),z=Math.min(D,N,H);O>.9&&z<.1&&(D<.2&&(l[w+0]+=1),N<.2&&(l[w+2]+=1),H<.2&&(l[w+4]+=1))}}function y(w){o.push(w.x,w.y,w.z)}function x(w,D){const N=w*3;D.x=e[N+0],D.y=e[N+1],D.z=e[N+2]}function b(){const w=new Z,D=new Z,N=new Z,H=new Z,O=new nt,z=new nt,V=new nt;for(let U=0,F=0;U<o.length;U+=9,F+=6){w.set(o[U+0],o[U+1],o[U+2]),D.set(o[U+3],o[U+4],o[U+5]),N.set(o[U+6],o[U+7],o[U+8]),O.set(l[F+0],l[F+1]),z.set(l[F+2],l[F+3]),V.set(l[F+4],l[F+5]),H.copy(w).add(D).add(N).divideScalar(3);const K=T(H);R(O,F+0,w,K),R(z,F+2,D,K),R(V,F+4,N,K)}}function R(w,D,N,H){H<0&&w.x===1&&(l[D]=w.x-1),N.x===0&&N.z===0&&(l[D]=H/2/Math.PI+.5)}function T(w){return Math.atan2(w.z,-w.x)}function M(w){return Math.atan2(-w.y,Math.sqrt(w.x*w.x+w.z*w.z))}}copy(e){return super.copy(e),this.parameters=Object.assign({},e.parameters),this}static fromJSON(e){return new Sc(e.vertices,e.indices,e.radius,e.detail)}}class _v extends Sc{constructor(e=1,t=0){const n=(1+Math.sqrt(5))/2,i=1/n,o=[-1,-1,-1,-1,-1,1,-1,1,-1,-1,1,1,1,-1,-1,1,-1,1,1,1,-1,1,1,1,0,-i,-n,0,-i,n,0,i,-n,0,i,n,-i,-n,0,-i,n,0,i,-n,0,i,n,0,-n,0,-i,n,0,-i,-n,0,i,n,0,i],l=[3,11,7,3,7,15,3,15,13,7,19,17,7,17,6,7,6,15,17,4,8,17,8,10,17,10,6,8,0,16,8,16,2,8,2,10,0,12,1,0,1,18,0,18,16,6,10,2,6,2,13,6,13,15,2,16,18,2,18,3,2,3,13,18,1,9,18,9,11,18,11,3,4,14,12,4,12,0,4,0,8,11,9,5,11,5,19,11,19,7,19,5,14,19,14,4,19,4,17,1,12,14,1,14,5,1,5,9];super(o,l,e,t),this.type="DodecahedronGeometry",this.parameters={radius:e,detail:t}}static fromJSON(e){return new _v(e.radius,e.detail)}}const yv=new Z,xv=new Z,Xx=new Z,Av=new Fs;class u1 extends pn{constructor(e=null,t=1){if(super(),this.type="EdgesGeometry",this.parameters={geometry:e,thresholdAngle:t},e!==null){const i=Math.pow(10,4),o=Math.cos(Tu*t),l=e.getIndex(),h=e.getAttribute("position"),d=l?l.count:h.count,p=[0,0,0],_=["a","b","c"],v=new Array(3),y={},x=[];for(let b=0;b<d;b+=3){l?(p[0]=l.getX(b),p[1]=l.getX(b+1),p[2]=l.getX(b+2)):(p[0]=b,p[1]=b+1,p[2]=b+2);const{a:R,b:T,c:M}=Av;if(R.fromBufferAttribute(h,p[0]),T.fromBufferAttribute(h,p[1]),M.fromBufferAttribute(h,p[2]),Av.getNormal(Xx),v[0]=`${Math.round(R.x*i)},${Math.round(R.y*i)},${Math.round(R.z*i)}`,v[1]=`${Math.round(T.x*i)},${Math.round(T.y*i)},${Math.round(T.z*i)}`,v[2]=`${Math.round(M.x*i)},${Math.round(M.y*i)},${Math.round(M.z*i)}`,!(v[0]===v[1]||v[1]===v[2]||v[2]===v[0]))for(let w=0;w<3;w++){const D=(w+1)%3,N=v[w],H=v[D],O=Av[_[w]],z=Av[_[D]],V=`${N}_${H}`,U=`${H}_${N}`;U in y&&y[U]?(Xx.dot(y[U].normal)<=o&&(x.push(O.x,O.y,O.z),x.push(z.x,z.y,z.z)),y[U]=null):V in y||(y[V]={index0:p[w],index1:p[D],normal:Xx.clone()})}}for(const b in y)if(y[b]){const{index0:R,index1:T}=y[b];yv.fromBufferAttribute(h,R),xv.fromBufferAttribute(h,T),x.push(yv.x,yv.y,yv.z),x.push(xv.x,xv.y,xv.z)}this.setAttribute("position",new Xt(x,3))}}copy(e){return super.copy(e),this.parameters=Object.assign({},e.parameters),this}}class Qr{constructor(){this.type="Curve",this.arcLengthDivisions=200,this.needsUpdate=!1,this.cacheArcLengths=null}getPoint(){Ut("Curve: .getPoint() not implemented.")}getPointAt(e,t){const n=this.getUtoTmapping(e);return this.getPoint(n,t)}getPoints(e=5){const t=[];for(let n=0;n<=e;n++)t.push(this.getPoint(n/e));return t}getSpacedPoints(e=5){const t=[];for(let n=0;n<=e;n++)t.push(this.getPointAt(n/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 n,i=this.getPoint(0),o=0;t.push(0);for(let l=1;l<=e;l++)n=this.getPoint(l/e),o+=n.distanceTo(i),t.push(o),i=n;return this.cacheArcLengths=t,t}updateArcLengths(){this.needsUpdate=!0,this.getLengths()}getUtoTmapping(e,t=null){const n=this.getLengths();let i=0;const o=n.length;let l;t?l=t:l=e*n[o-1];let h=0,d=o-1,p;for(;h<=d;)if(i=Math.floor(h+(d-h)/2),p=n[i]-l,p<0)h=i+1;else if(p>0)d=i-1;else{d=i;break}if(i=d,n[i]===l)return i/(o-1);const _=n[i],y=n[i+1]-_,x=(l-_)/y;return(i+x)/(o-1)}getTangent(e,t){let i=e-1e-4,o=e+1e-4;i<0&&(i=0),o>1&&(o=1);const l=this.getPoint(i),h=this.getPoint(o),d=t||(l.isVector2?new nt:new Z);return d.copy(h).sub(l).normalize(),d}getTangentAt(e,t){const n=this.getUtoTmapping(e);return this.getTangent(n,t)}computeFrenetFrames(e,t=!1){const n=new Z,i=[],o=[],l=[],h=new Z,d=new en;for(let x=0;x<=e;x++){const b=x/e;i[x]=this.getTangentAt(b,new Z)}o[0]=new Z,l[0]=new Z;let p=Number.MAX_VALUE;const _=Math.abs(i[0].x),v=Math.abs(i[0].y),y=Math.abs(i[0].z);_<=p&&(p=_,n.set(1,0,0)),v<=p&&(p=v,n.set(0,1,0)),y<=p&&n.set(0,0,1),h.crossVectors(i[0],n).normalize(),o[0].crossVectors(i[0],h),l[0].crossVectors(i[0],o[0]);for(let x=1;x<=e;x++){if(o[x]=o[x-1].clone(),l[x]=l[x-1].clone(),h.crossVectors(i[x-1],i[x]),h.length()>Number.EPSILON){h.normalize();const b=Math.acos(dn(i[x-1].dot(i[x]),-1,1));o[x].applyMatrix4(d.makeRotationAxis(h,b))}l[x].crossVectors(i[x],o[x])}if(t===!0){let x=Math.acos(dn(o[0].dot(o[e]),-1,1));x/=e,i[0].dot(h.crossVectors(o[0],o[e]))>0&&(x=-x);for(let b=1;b<=e;b++)o[b].applyMatrix4(d.makeRotationAxis(i[b],x*b)),l[b].crossVectors(i[b],o[b])}return{tangents:i,normals:o,binormals:l}}clone(){return new this.constructor().copy(this)}copy(e){return this.arcLengthDivisions=e.arcLengthDivisions,this}toJSON(){const e={metadata:{version:4.7,type:"Curve",generator:"Curve.toJSON"}};return e.arcLengthDivisions=this.arcLengthDivisions,e.type=this.type,e}fromJSON(e){return this.arcLengthDivisions=e.arcLengthDivisions,this}}class Sv extends Qr{constructor(e=0,t=0,n=1,i=1,o=0,l=Math.PI*2,h=!1,d=0){super(),this.isEllipseCurve=!0,this.type="EllipseCurve",this.aX=e,this.aY=t,this.xRadius=n,this.yRadius=i,this.aStartAngle=o,this.aEndAngle=l,this.aClockwise=h,this.aRotation=d}getPoint(e,t=new nt){const n=t,i=Math.PI*2;let o=this.aEndAngle-this.aStartAngle;const l=Math.abs(o)<Number.EPSILON;for(;o<0;)o+=i;for(;o>i;)o-=i;o<Number.EPSILON&&(l?o=0:o=i),this.aClockwise===!0&&!l&&(o===i?o=-i:o=o-i);const h=this.aStartAngle+e*o;let d=this.aX+this.xRadius*Math.cos(h),p=this.aY+this.yRadius*Math.sin(h);if(this.aRotation!==0){const _=Math.cos(this.aRotation),v=Math.sin(this.aRotation),y=d-this.aX,x=p-this.aY;d=y*_-x*v+this.aX,p=y*v+x*_+this.aY}return n.set(d,p)}copy(e){return super.copy(e),this.aX=e.aX,this.aY=e.aY,this.xRadius=e.xRadius,this.yRadius=e.yRadius,this.aStartAngle=e.aStartAngle,this.aEndAngle=e.aEndAngle,this.aClockwise=e.aClockwise,this.aRotation=e.aRotation,this}toJSON(){const e=super.toJSON();return e.aX=this.aX,e.aY=this.aY,e.xRadius=this.xRadius,e.yRadius=this.yRadius,e.aStartAngle=this.aStartAngle,e.aEndAngle=this.aEndAngle,e.aClockwise=this.aClockwise,e.aRotation=this.aRotation,e}fromJSON(e){return super.fromJSON(e),this.aX=e.aX,this.aY=e.aY,this.xRadius=e.xRadius,this.yRadius=e.yRadius,this.aStartAngle=e.aStartAngle,this.aEndAngle=e.aEndAngle,this.aClockwise=e.aClockwise,this.aRotation=e.aRotation,this}}class f1 extends Sv{constructor(e,t,n,i,o,l){super(e,t,n,n,i,o,l),this.isArcCurve=!0,this.type="ArcCurve"}}function Yx(){let s=0,e=0,t=0,n=0;function i(o,l,h,d){s=o,e=h,t=-3*o+3*l-2*h-d,n=2*o-2*l+h+d}return{initCatmullRom:function(o,l,h,d,p){i(l,h,p*(h-o),p*(d-l))},initNonuniformCatmullRom:function(o,l,h,d,p,_,v){let y=(l-o)/p-(h-o)/(p+_)+(h-l)/_,x=(h-l)/_-(d-l)/(_+v)+(d-h)/v;y*=_,x*=_,i(l,h,y,x)},calc:function(o){const l=o*o,h=l*o;return s+e*o+t*l+n*h}}}const Mv=new Z,Jx=new Yx,qx=new Yx,Kx=new Yx;class h1 extends Qr{constructor(e=[],t=!1,n="centripetal",i=.5){super(),this.isCatmullRomCurve3=!0,this.type="CatmullRomCurve3",this.points=e,this.closed=t,this.curveType=n,this.tension=i}getPoint(e,t=new Z){const n=t,i=this.points,o=i.length,l=(o-(this.closed?0:1))*e;let h=Math.floor(l),d=l-h;this.closed?h+=h>0?0:(Math.floor(Math.abs(h)/o)+1)*o:d===0&&h===o-1&&(h=o-2,d=1);let p,_;this.closed||h>0?p=i[(h-1)%o]:(Mv.subVectors(i[0],i[1]).add(i[0]),p=Mv);const v=i[h%o],y=i[(h+1)%o];if(this.closed||h+2<o?_=i[(h+2)%o]:(Mv.subVectors(i[o-1],i[o-2]).add(i[o-1]),_=Mv),this.curveType==="centripetal"||this.curveType==="chordal"){const x=this.curveType==="chordal"?.5:.25;let b=Math.pow(p.distanceToSquared(v),x),R=Math.pow(v.distanceToSquared(y),x),T=Math.pow(y.distanceToSquared(_),x);R<1e-4&&(R=1),b<1e-4&&(b=R),T<1e-4&&(T=R),Jx.initNonuniformCatmullRom(p.x,v.x,y.x,_.x,b,R,T),qx.initNonuniformCatmullRom(p.y,v.y,y.y,_.y,b,R,T),Kx.initNonuniformCatmullRom(p.z,v.z,y.z,_.z,b,R,T)}else this.curveType==="catmullrom"&&(Jx.initCatmullRom(p.x,v.x,y.x,_.x,this.tension),qx.initCatmullRom(p.y,v.y,y.y,_.y,this.tension),Kx.initCatmullRom(p.z,v.z,y.z,_.z,this.tension));return n.set(Jx.calc(d),qx.calc(d),Kx.calc(d)),n}copy(e){super.copy(e),this.points=[];for(let t=0,n=e.points.length;t<n;t++){const i=e.points[t];this.points.push(i.clone())}return this.closed=e.closed,this.curveType=e.curveType,this.tension=e.tension,this}toJSON(){const e=super.toJSON();e.points=[];for(let t=0,n=this.points.length;t<n;t++){const i=this.points[t];e.points.push(i.toArray())}return e.closed=this.closed,e.curveType=this.curveType,e.tension=this.tension,e}fromJSON(e){super.fromJSON(e),this.points=[];for(let t=0,n=e.points.length;t<n;t++){const i=e.points[t];this.points.push(new Z().fromArray(i))}return this.closed=e.closed,this.curveType=e.curveType,this.tension=e.tension,this}}function d1(s,e,t,n,i){const o=(n-e)*.5,l=(i-t)*.5,h=s*s,d=s*h;return(2*t-2*n+o+l)*d+(-3*t+3*n-2*o-l)*h+o*s+t}function mw(s,e){const t=1-s;return t*t*e}function gw(s,e){return 2*(1-s)*s*e}function vw(s,e){return s*s*e}function Op(s,e,t,n){return mw(s,e)+gw(s,t)+vw(s,n)}function _w(s,e){const t=1-s;return t*t*t*e}function yw(s,e){const t=1-s;return 3*t*t*s*e}function xw(s,e){return 3*(1-s)*s*s*e}function Aw(s,e){return s*s*s*e}function Ip(s,e,t,n,i){return _w(s,e)+yw(s,t)+xw(s,n)+Aw(s,i)}class Wx extends Qr{constructor(e=new nt,t=new nt,n=new nt,i=new nt){super(),this.isCubicBezierCurve=!0,this.type="CubicBezierCurve",this.v0=e,this.v1=t,this.v2=n,this.v3=i}getPoint(e,t=new nt){const n=t,i=this.v0,o=this.v1,l=this.v2,h=this.v3;return n.set(Ip(e,i.x,o.x,l.x,h.x),Ip(e,i.y,o.y,l.y,h.y)),n}copy(e){return super.copy(e),this.v0.copy(e.v0),this.v1.copy(e.v1),this.v2.copy(e.v2),this.v3.copy(e.v3),this}toJSON(){const e=super.toJSON();return e.v0=this.v0.toArray(),e.v1=this.v1.toArray(),e.v2=this.v2.toArray(),e.v3=this.v3.toArray(),e}fromJSON(e){return super.fromJSON(e),this.v0.fromArray(e.v0),this.v1.fromArray(e.v1),this.v2.fromArray(e.v2),this.v3.fromArray(e.v3),this}}class p1 extends Qr{constructor(e=new Z,t=new Z,n=new Z,i=new Z){super(),this.isCubicBezierCurve3=!0,this.type="CubicBezierCurve3",this.v0=e,this.v1=t,this.v2=n,this.v3=i}getPoint(e,t=new Z){const n=t,i=this.v0,o=this.v1,l=this.v2,h=this.v3;return n.set(Ip(e,i.x,o.x,l.x,h.x),Ip(e,i.y,o.y,l.y,h.y),Ip(e,i.z,o.z,l.z,h.z)),n}copy(e){return super.copy(e),this.v0.copy(e.v0),this.v1.copy(e.v1),this.v2.copy(e.v2),this.v3.copy(e.v3),this}toJSON(){const e=super.toJSON();return e.v0=this.v0.toArray(),e.v1=this.v1.toArray(),e.v2=this.v2.toArray(),e.v3=this.v3.toArray(),e}fromJSON(e){return super.fromJSON(e),this.v0.fromArray(e.v0),this.v1.fromArray(e.v1),this.v2.fromArray(e.v2),this.v3.fromArray(e.v3),this}}class jx extends Qr{constructor(e=new nt,t=new nt){super(),this.isLineCurve=!0,this.type="LineCurve",this.v1=e,this.v2=t}getPoint(e,t=new nt){const n=t;return e===1?n.copy(this.v2):(n.copy(this.v2).sub(this.v1),n.multiplyScalar(e).add(this.v1)),n}getPointAt(e,t){return this.getPoint(e,t)}getTangent(e,t=new nt){return t.subVectors(this.v2,this.v1).normalize()}getTangentAt(e,t){return this.getTangent(e,t)}copy(e){return super.copy(e),this.v1.copy(e.v1),this.v2.copy(e.v2),this}toJSON(){const e=super.toJSON();return e.v1=this.v1.toArray(),e.v2=this.v2.toArray(),e}fromJSON(e){return super.fromJSON(e),this.v1.fromArray(e.v1),this.v2.fromArray(e.v2),this}}class m1 extends Qr{constructor(e=new Z,t=new Z){super(),this.isLineCurve3=!0,this.type="LineCurve3",this.v1=e,this.v2=t}getPoint(e,t=new Z){const n=t;return e===1?n.copy(this.v2):(n.copy(this.v2).sub(this.v1),n.multiplyScalar(e).add(this.v1)),n}getPointAt(e,t){return this.getPoint(e,t)}getTangent(e,t=new Z){return t.subVectors(this.v2,this.v1).normalize()}getTangentAt(e,t){return this.getTangent(e,t)}copy(e){return super.copy(e),this.v1.copy(e.v1),this.v2.copy(e.v2),this}toJSON(){const e=super.toJSON();return e.v1=this.v1.toArray(),e.v2=this.v2.toArray(),e}fromJSON(e){return super.fromJSON(e),this.v1.fromArray(e.v1),this.v2.fromArray(e.v2),this}}class Zx extends Qr{constructor(e=new nt,t=new nt,n=new nt){super(),this.isQuadraticBezierCurve=!0,this.type="QuadraticBezierCurve",this.v0=e,this.v1=t,this.v2=n}getPoint(e,t=new nt){const n=t,i=this.v0,o=this.v1,l=this.v2;return n.set(Op(e,i.x,o.x,l.x),Op(e,i.y,o.y,l.y)),n}copy(e){return super.copy(e),this.v0.copy(e.v0),this.v1.copy(e.v1),this.v2.copy(e.v2),this}toJSON(){const e=super.toJSON();return e.v0=this.v0.toArray(),e.v1=this.v1.toArray(),e.v2=this.v2.toArray(),e}fromJSON(e){return super.fromJSON(e),this.v0.fromArray(e.v0),this.v1.fromArray(e.v1),this.v2.fromArray(e.v2),this}}class Qx extends Qr{constructor(e=new Z,t=new Z,n=new Z){super(),this.isQuadraticBezierCurve3=!0,this.type="QuadraticBezierCurve3",this.v0=e,this.v1=t,this.v2=n}getPoint(e,t=new Z){const n=t,i=this.v0,o=this.v1,l=this.v2;return n.set(Op(e,i.x,o.x,l.x),Op(e,i.y,o.y,l.y),Op(e,i.z,o.z,l.z)),n}copy(e){return super.copy(e),this.v0.copy(e.v0),this.v1.copy(e.v1),this.v2.copy(e.v2),this}toJSON(){const e=super.toJSON();return e.v0=this.v0.toArray(),e.v1=this.v1.toArray(),e.v2=this.v2.toArray(),e}fromJSON(e){return super.fromJSON(e),this.v0.fromArray(e.v0),this.v1.fromArray(e.v1),this.v2.fromArray(e.v2),this}}class $x extends Qr{constructor(e=[]){super(),this.isSplineCurve=!0,this.type="SplineCurve",this.points=e}getPoint(e,t=new nt){const n=t,i=this.points,o=(i.length-1)*e,l=Math.floor(o),h=o-l,d=i[l===0?l:l-1],p=i[l],_=i[l>i.length-2?i.length-1:l+1],v=i[l>i.length-3?i.length-1:l+2];return n.set(d1(h,d.x,p.x,_.x,v.x),d1(h,d.y,p.y,_.y,v.y)),n}copy(e){super.copy(e),this.points=[];for(let t=0,n=e.points.length;t<n;t++){const i=e.points[t];this.points.push(i.clone())}return this}toJSON(){const e=super.toJSON();e.points=[];for(let t=0,n=this.points.length;t<n;t++){const i=this.points[t];e.points.push(i.toArray())}return e}fromJSON(e){super.fromJSON(e),this.points=[];for(let t=0,n=e.points.length;t<n;t++){const i=e.points[t];this.points.push(new nt().fromArray(i))}return this}}var bv=Object.freeze({__proto__:null,ArcCurve:f1,CatmullRomCurve3:h1,CubicBezierCurve:Wx,CubicBezierCurve3:p1,EllipseCurve:Sv,LineCurve:jx,LineCurve3:m1,QuadraticBezierCurve:Zx,QuadraticBezierCurve3:Qx,SplineCurve:$x});class g1 extends Qr{constructor(){super(),this.type="CurvePath",this.curves=[],this.autoClose=!1}add(e){this.curves.push(e)}closePath(){const e=this.curves[0].getPoint(0),t=this.curves[this.curves.length-1].getPoint(1);if(!e.equals(t)){const n=e.isVector2===!0?"LineCurve":"LineCurve3";this.curves.push(new bv[n](t,e))}return this}getPoint(e,t){const n=e*this.getLength(),i=this.getCurveLengths();let o=0;for(;o<i.length;){if(i[o]>=n){const l=i[o]-n,h=this.curves[o],d=h.getLength(),p=d===0?0:1-l/d;return h.getPointAt(p,t)}o++}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 n=0,i=this.curves.length;n<i;n++)t+=this.curves[n].getLength(),e.push(t);return this.cacheLengths=e,e}getSpacedPoints(e=40){const t=[];for(let n=0;n<=e;n++)t.push(this.getPoint(n/e));return this.autoClose&&t.push(t[0]),t}getPoints(e=12){const t=[];let n;for(let i=0,o=this.curves;i<o.length;i++){const l=o[i],h=l.isEllipseCurve?e*2:l.isLineCurve||l.isLineCurve3?1:l.isSplineCurve?e*l.points.length:e,d=l.getPoints(h);for(let p=0;p<d.length;p++){const _=d[p];n&&n.equals(_)||(t.push(_),n=_)}}return this.autoClose&&t.length>1&&!t[t.length-1].equals(t[0])&&t.push(t[0]),t}copy(e){super.copy(e),this.curves=[];for(let t=0,n=e.curves.length;t<n;t++){const i=e.curves[t];this.curves.push(i.clone())}return this.autoClose=e.autoClose,this}toJSON(){const e=super.toJSON();e.autoClose=this.autoClose,e.curves=[];for(let t=0,n=this.curves.length;t<n;t++){const i=this.curves[t];e.curves.push(i.toJSON())}return e}fromJSON(e){super.fromJSON(e),this.autoClose=e.autoClose,this.curves=[];for(let t=0,n=e.curves.length;t<n;t++){const i=e.curves[t];this.curves.push(new bv[i.type]().fromJSON(i))}return this}}class Ev extends g1{constructor(e){super(),this.type="Path",this.currentPoint=new nt,e&&this.setFromPoints(e)}setFromPoints(e){this.moveTo(e[0].x,e[0].y);for(let t=1,n=e.length;t<n;t++)this.lineTo(e[t].x,e[t].y);return this}moveTo(e,t){return this.currentPoint.set(e,t),this}lineTo(e,t){const n=new jx(this.currentPoint.clone(),new nt(e,t));return this.curves.push(n),this.currentPoint.set(e,t),this}quadraticCurveTo(e,t,n,i){const o=new Zx(this.currentPoint.clone(),new nt(e,t),new nt(n,i));return this.curves.push(o),this.currentPoint.set(n,i),this}bezierCurveTo(e,t,n,i,o,l){const h=new Wx(this.currentPoint.clone(),new nt(e,t),new nt(n,i),new nt(o,l));return this.curves.push(h),this.currentPoint.set(o,l),this}splineThru(e){const t=[this.currentPoint.clone()].concat(e),n=new $x(t);return this.curves.push(n),this.currentPoint.copy(e[e.length-1]),this}arc(e,t,n,i,o,l){const h=this.currentPoint.x,d=this.currentPoint.y;return this.absarc(e+h,t+d,n,i,o,l),this}absarc(e,t,n,i,o,l){return this.absellipse(e,t,n,n,i,o,l),this}ellipse(e,t,n,i,o,l,h,d){const p=this.currentPoint.x,_=this.currentPoint.y;return this.absellipse(e+p,t+_,n,i,o,l,h,d),this}absellipse(e,t,n,i,o,l,h,d){const p=new Sv(e,t,n,i,o,l,h,d);if(this.curves.length>0){const v=p.getPoint(0);v.equals(this.currentPoint)||this.lineTo(v.x,v.y)}this.curves.push(p);const _=p.getPoint(1);return this.currentPoint.copy(_),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 Ou extends Ev{constructor(e){super(e),this.uuid=Qs(),this.type="Shape",this.holes=[]}getPointsHoles(e){const t=[];for(let n=0,i=this.holes.length;n<i;n++)t[n]=this.holes[n].getPoints(e);return t}extractPoints(e){return{shape:this.getPoints(e),holes:this.getPointsHoles(e)}}copy(e){super.copy(e),this.holes=[];for(let t=0,n=e.holes.length;t<n;t++){const i=e.holes[t];this.holes.push(i.clone())}return this}toJSON(){const e=super.toJSON();e.uuid=this.uuid,e.holes=[];for(let t=0,n=this.holes.length;t<n;t++){const i=this.holes[t];e.holes.push(i.toJSON())}return e}fromJSON(e){super.fromJSON(e),this.uuid=e.uuid,this.holes=[];for(let t=0,n=e.holes.length;t<n;t++){const i=e.holes[t];this.holes.push(new Ev().fromJSON(i))}return this}}function Sw(s,e,t=2){const n=e&&e.length,i=n?e[0]*t:s.length;let o=v1(s,0,i,t,!0);const l=[];if(!o||o.next===o.prev)return l;let h,d,p;if(n&&(o=Cw(s,e,o,t)),s.length>80*t){h=s[0],d=s[1];let _=h,v=d;for(let y=t;y<i;y+=t){const x=s[y],b=s[y+1];x<h&&(h=x),b<d&&(d=b),x>_&&(_=x),b>v&&(v=b)}p=Math.max(_-h,v-d),p=p!==0?32767/p:0}return Fp(o,l,t,h,d,p,0),l}function v1(s,e,t,n,i){let o;if(i===Hw(s,e,t,n)>0)for(let l=e;l<t;l+=n)o=A1(l/n|0,s[l],s[l+1],o);else for(let l=t-n;l>=e;l-=n)o=A1(l/n|0,s[l],s[l+1],o);return o&&Rh(o,o.next)&&(Gp(o),o=o.next),o}function Iu(s,e){if(!s)return s;e||(e=s);let t=s,n;do if(n=!1,!t.steiner&&(Rh(t,t.next)||Ii(t.prev,t,t.next)===0)){if(Gp(t),t=e=t.prev,t===t.next)break;n=!0}else t=t.next;while(n||t!==e);return e}function Fp(s,e,t,n,i,o,l){if(!s)return;!l&&o&&Nw(s,n,i,o);let h=s;for(;s.prev!==s.next;){const d=s.prev,p=s.next;if(o?bw(s,n,i,o):Mw(s)){e.push(d.i,s.i,p.i),Gp(s),s=p.next,h=p.next;continue}if(s=p,s===h){l?l===1?(s=Ew(Iu(s),e),Fp(s,e,t,n,i,o,2)):l===2&&Tw(s,e,t,n,i,o):Fp(Iu(s),e,t,n,i,o,1);break}}}function Mw(s){const e=s.prev,t=s,n=s.next;if(Ii(e,t,n)>=0)return!1;const i=e.x,o=t.x,l=n.x,h=e.y,d=t.y,p=n.y,_=Math.min(i,o,l),v=Math.min(h,d,p),y=Math.max(i,o,l),x=Math.max(h,d,p);let b=n.next;for(;b!==e;){if(b.x>=_&&b.x<=y&&b.y>=v&&b.y<=x&&Hp(i,h,o,d,l,p,b.x,b.y)&&Ii(b.prev,b,b.next)>=0)return!1;b=b.next}return!0}function bw(s,e,t,n){const i=s.prev,o=s,l=s.next;if(Ii(i,o,l)>=0)return!1;const h=i.x,d=o.x,p=l.x,_=i.y,v=o.y,y=l.y,x=Math.min(h,d,p),b=Math.min(_,v,y),R=Math.max(h,d,p),T=Math.max(_,v,y),M=eA(x,b,e,t,n),w=eA(R,T,e,t,n);let D=s.prevZ,N=s.nextZ;for(;D&&D.z>=M&&N&&N.z<=w;){if(D.x>=x&&D.x<=R&&D.y>=b&&D.y<=T&&D!==i&&D!==l&&Hp(h,_,d,v,p,y,D.x,D.y)&&Ii(D.prev,D,D.next)>=0||(D=D.prevZ,N.x>=x&&N.x<=R&&N.y>=b&&N.y<=T&&N!==i&&N!==l&&Hp(h,_,d,v,p,y,N.x,N.y)&&Ii(N.prev,N,N.next)>=0))return!1;N=N.nextZ}for(;D&&D.z>=M;){if(D.x>=x&&D.x<=R&&D.y>=b&&D.y<=T&&D!==i&&D!==l&&Hp(h,_,d,v,p,y,D.x,D.y)&&Ii(D.prev,D,D.next)>=0)return!1;D=D.prevZ}for(;N&&N.z<=w;){if(N.x>=x&&N.x<=R&&N.y>=b&&N.y<=T&&N!==i&&N!==l&&Hp(h,_,d,v,p,y,N.x,N.y)&&Ii(N.prev,N,N.next)>=0)return!1;N=N.nextZ}return!0}function Ew(s,e){let t=s;do{const n=t.prev,i=t.next.next;!Rh(n,i)&&y1(n,t,t.next,i)&&Pp(n,i)&&Pp(i,n)&&(e.push(n.i,t.i,i.i),Gp(t),Gp(t.next),t=s=i),t=t.next}while(t!==s);return Iu(t)}function Tw(s,e,t,n,i,o){let l=s;do{let h=l.next.next;for(;h!==l.prev;){if(l.i!==h.i&&Ow(l,h)){let d=x1(l,h);l=Iu(l,l.next),d=Iu(d,d.next),Fp(l,e,t,n,i,o,0),Fp(d,e,t,n,i,o,0);return}h=h.next}l=l.next}while(l!==s)}function Cw(s,e,t,n){const i=[];for(let o=0,l=e.length;o<l;o++){const h=e[o]*n,d=o<l-1?e[o+1]*n:s.length,p=v1(s,h,d,n,!1);p===p.next&&(p.steiner=!0),i.push(Lw(p))}i.sort(Rw);for(let o=0;o<i.length;o++)t=ww(i[o],t);return t}function Rw(s,e){let t=s.x-e.x;if(t===0&&(t=s.y-e.y,t===0)){const n=(s.next.y-s.y)/(s.next.x-s.x),i=(e.next.y-e.y)/(e.next.x-e.x);t=n-i}return t}function ww(s,e){const t=Bw(s,e);if(!t)return e;const n=x1(t,s);return Iu(n,n.next),Iu(t,t.next)}function Bw(s,e){let t=e;const n=s.x,i=s.y;let o=-1/0,l;if(Rh(s,t))return t;do{if(Rh(s,t.next))return t.next;if(i<=t.y&&i>=t.next.y&&t.next.y!==t.y){const v=t.x+(i-t.y)*(t.next.x-t.x)/(t.next.y-t.y);if(v<=n&&v>o&&(o=v,l=t.x<t.next.x?t:t.next,v===n))return l}t=t.next}while(t!==e);if(!l)return null;const h=l,d=l.x,p=l.y;let _=1/0;t=l;do{if(n>=t.x&&t.x>=d&&n!==t.x&&_1(i<p?n:o,i,d,p,i<p?o:n,i,t.x,t.y)){const v=Math.abs(i-t.y)/(n-t.x);Pp(t,s)&&(v<_||v===_&&(t.x>l.x||t.x===l.x&&Dw(l,t)))&&(l=t,_=v)}t=t.next}while(t!==h);return l}function Dw(s,e){return Ii(s.prev,s,e.prev)<0&&Ii(e.next,s,s.next)<0}function Nw(s,e,t,n){let i=s;do i.z===0&&(i.z=eA(i.x,i.y,e,t,n)),i.prevZ=i.prev,i.nextZ=i.next,i=i.next;while(i!==s);i.prevZ.nextZ=null,i.prevZ=null,Uw(i)}function Uw(s){let e,t=1;do{let n=s,i;s=null;let o=null;for(e=0;n;){e++;let l=n,h=0;for(let p=0;p<t&&(h++,l=l.nextZ,!!l);p++);let d=t;for(;h>0||d>0&&l;)h!==0&&(d===0||!l||n.z<=l.z)?(i=n,n=n.nextZ,h--):(i=l,l=l.nextZ,d--),o?o.nextZ=i:s=i,i.prevZ=o,o=i;n=l}o.nextZ=null,t*=2}while(e>1);return s}function eA(s,e,t,n,i){return s=(s-t)*i|0,e=(e-n)*i|0,s=(s|s<<8)&16711935,s=(s|s<<4)&252645135,s=(s|s<<2)&858993459,s=(s|s<<1)&1431655765,e=(e|e<<8)&16711935,e=(e|e<<4)&252645135,e=(e|e<<2)&858993459,e=(e|e<<1)&1431655765,s|e<<1}function Lw(s){let e=s,t=s;do(e.x<t.x||e.x===t.x&&e.y<t.y)&&(t=e),e=e.next;while(e!==s);return t}function _1(s,e,t,n,i,o,l,h){return(i-l)*(e-h)>=(s-l)*(o-h)&&(s-l)*(n-h)>=(t-l)*(e-h)&&(t-l)*(o-h)>=(i-l)*(n-h)}function Hp(s,e,t,n,i,o,l,h){return!(s===l&&e===h)&&_1(s,e,t,n,i,o,l,h)}function Ow(s,e){return s.next.i!==e.i&&s.prev.i!==e.i&&!Iw(s,e)&&(Pp(s,e)&&Pp(e,s)&&Fw(s,e)&&(Ii(s.prev,s,e.prev)||Ii(s,e.prev,e))||Rh(s,e)&&Ii(s.prev,s,s.next)>0&&Ii(e.prev,e,e.next)>0)}function Ii(s,e,t){return(e.y-s.y)*(t.x-e.x)-(e.x-s.x)*(t.y-e.y)}function Rh(s,e){return s.x===e.x&&s.y===e.y}function y1(s,e,t,n){const i=Cv(Ii(s,e,t)),o=Cv(Ii(s,e,n)),l=Cv(Ii(t,n,s)),h=Cv(Ii(t,n,e));return!!(i!==o&&l!==h||i===0&&Tv(s,t,e)||o===0&&Tv(s,n,e)||l===0&&Tv(t,s,n)||h===0&&Tv(t,e,n))}function Tv(s,e,t){return e.x<=Math.max(s.x,t.x)&&e.x>=Math.min(s.x,t.x)&&e.y<=Math.max(s.y,t.y)&&e.y>=Math.min(s.y,t.y)}function Cv(s){return s>0?1:s<0?-1:0}function Iw(s,e){let t=s;do{if(t.i!==s.i&&t.next.i!==s.i&&t.i!==e.i&&t.next.i!==e.i&&y1(t,t.next,s,e))return!0;t=t.next}while(t!==s);return!1}function Pp(s,e){return Ii(s.prev,s,s.next)<0?Ii(s,e,s.next)>=0&&Ii(s,s.prev,e)>=0:Ii(s,e,s.prev)<0||Ii(s,s.next,e)<0}function Fw(s,e){let t=s,n=!1;const i=(s.x+e.x)/2,o=(s.y+e.y)/2;do t.y>o!=t.next.y>o&&t.next.y!==t.y&&i<(t.next.x-t.x)*(o-t.y)/(t.next.y-t.y)+t.x&&(n=!n),t=t.next;while(t!==s);return n}function x1(s,e){const t=tA(s.i,s.x,s.y),n=tA(e.i,e.x,e.y),i=s.next,o=e.prev;return s.next=e,e.prev=s,t.next=i,i.prev=t,n.next=t,t.prev=n,o.next=n,n.prev=o,n}function A1(s,e,t,n){const i=tA(s,e,t);return n?(i.next=n.next,i.prev=n,n.next.prev=i,n.next=i):(i.prev=i,i.next=i),i}function Gp(s){s.next.prev=s.prev,s.prev.next=s.next,s.prevZ&&(s.prevZ.nextZ=s.nextZ),s.nextZ&&(s.nextZ.prevZ=s.prevZ)}function tA(s,e,t){return{i:s,x:e,y:t,prev:null,next:null,z:0,prevZ:null,nextZ:null,steiner:!1}}function Hw(s,e,t,n){let i=0;for(let o=e,l=t-n;o<t;o+=n)i+=(s[l]-s[o])*(s[o+1]+s[l+1]),l=o;return i}class Pw{static triangulate(e,t,n=2){return Sw(e,t,n)}}class $r{static area(e){const t=e.length;let n=0;for(let i=t-1,o=0;o<t;i=o++)n+=e[i].x*e[o].y-e[o].x*e[i].y;return n*.5}static isClockWise(e){return $r.area(e)<0}static triangulateShape(e,t){const n=[],i=[],o=[];S1(e),M1(n,e);let l=e.length;t.forEach(S1);for(let d=0;d<t.length;d++)i.push(l),l+=t[d].length,M1(n,t[d]);const h=Pw.triangulate(n,i);for(let d=0;d<h.length;d+=3)o.push(h.slice(d,d+3));return o}}function S1(s){const e=s.length;e>2&&s[e-1].equals(s[0])&&s.pop()}function M1(s,e){for(let t=0;t<e.length;t++)s.push(e[t].x),s.push(e[t].y)}class Rv extends pn{constructor(e=new Ou([new nt(.5,.5),new nt(-.5,.5),new nt(-.5,-.5),new nt(.5,-.5)]),t={}){super(),this.type="ExtrudeGeometry",this.parameters={shapes:e,options:t},e=Array.isArray(e)?e:[e];const n=this,i=[],o=[];for(let h=0,d=e.length;h<d;h++){const p=e[h];l(p)}this.setAttribute("position",new Xt(i,3)),this.setAttribute("uv",new Xt(o,2)),this.computeVertexNormals();function l(h){const d=[],p=t.curveSegments!==void 0?t.curveSegments:12,_=t.steps!==void 0?t.steps:1,v=t.depth!==void 0?t.depth:1;let y=t.bevelEnabled!==void 0?t.bevelEnabled:!0,x=t.bevelThickness!==void 0?t.bevelThickness:.2,b=t.bevelSize!==void 0?t.bevelSize:x-.1,R=t.bevelOffset!==void 0?t.bevelOffset:0,T=t.bevelSegments!==void 0?t.bevelSegments:3;const M=t.extrudePath,w=t.UVGenerator!==void 0?t.UVGenerator:Gw;let D,N=!1,H,O,z,V;if(M){D=M.getSpacedPoints(_),N=!0,y=!1;const Ge=M.isCatmullRomCurve3?M.closed:!1;H=M.computeFrenetFrames(_,Ge),O=new Z,z=new Z,V=new Z}y||(T=0,x=0,b=0,R=0);const U=h.extractPoints(p);let F=U.shape;const K=U.holes;if(!$r.isClockWise(F)){F=F.reverse();for(let Ge=0,et=K.length;Ge<et;Ge++){const Je=K[Ge];$r.isClockWise(Je)&&(K[Ge]=Je.reverse())}}function $(Ge){const Je=10000000000000001e-36;let xt=Ge[0];for(let Q=1;Q<=Ge.length;Q++){const Dt=Q%Ge.length,mt=Ge[Dt],Lt=mt.x-xt.x,gt=mt.y-xt.y,j=Lt*Lt+gt*gt,P=Math.max(Math.abs(mt.x),Math.abs(mt.y),Math.abs(xt.x),Math.abs(xt.y)),de=Je*P*P;if(j<=de){Ge.splice(Dt,1),Q--;continue}xt=mt}}$(F),K.forEach($);const ae=K.length,ge=F;for(let Ge=0;Ge<ae;Ge++){const et=K[Ge];F=F.concat(et)}function I(Ge,et,Je){return et||Zt("ExtrudeGeometry: vec does not exist"),Ge.clone().addScaledVector(et,Je)}const W=F.length;function ee(Ge,et,Je){let xt,Q,Dt;const mt=Ge.x-et.x,Lt=Ge.y-et.y,gt=Je.x-Ge.x,j=Je.y-Ge.y,P=mt*mt+Lt*Lt,de=mt*j-Lt*gt;if(Math.abs(de)>Number.EPSILON){const Fe=Math.sqrt(P),ke=Math.sqrt(gt*gt+j*j),Ie=et.x-Lt/Fe,Ft=et.y+mt/Fe,Mt=Je.x-j/ke,Ht=Je.y+gt/ke,zt=((Mt-Ie)*j-(Ht-Ft)*gt)/(mt*j-Lt*gt);xt=Ie+mt*zt-Ge.x,Q=Ft+Lt*zt-Ge.y;const Ye=xt*xt+Q*Q;if(Ye<=2)return new nt(xt,Q);Dt=Math.sqrt(Ye/2)}else{let Fe=!1;mt>Number.EPSILON?gt>Number.EPSILON&&(Fe=!0):mt<-Number.EPSILON?gt<-Number.EPSILON&&(Fe=!0):Math.sign(Lt)===Math.sign(j)&&(Fe=!0),Fe?(xt=-Lt,Q=mt,Dt=Math.sqrt(P)):(xt=mt,Q=Lt,Dt=Math.sqrt(P/2))}return new nt(xt/Dt,Q/Dt)}const ye=[];for(let Ge=0,et=ge.length,Je=et-1,xt=Ge+1;Ge<et;Ge++,Je++,xt++)Je===et&&(Je=0),xt===et&&(xt=0),ye[Ge]=ee(ge[Ge],ge[Je],ge[xt]);const _e=[];let X,te=ye.concat();for(let Ge=0,et=ae;Ge<et;Ge++){const Je=K[Ge];X=[];for(let xt=0,Q=Je.length,Dt=Q-1,mt=xt+1;xt<Q;xt++,Dt++,mt++)Dt===Q&&(Dt=0),mt===Q&&(mt=0),X[xt]=ee(Je[xt],Je[Dt],Je[mt]);_e.push(X),te=te.concat(X)}let le;if(T===0)le=$r.triangulateShape(ge,K);else{const Ge=[],et=[];for(let Je=0;Je<T;Je++){const xt=Je/T,Q=x*Math.cos(xt*Math.PI/2),Dt=b*Math.sin(xt*Math.PI/2)+R;for(let mt=0,Lt=ge.length;mt<Lt;mt++){const gt=I(ge[mt],ye[mt],Dt);Rt(gt.x,gt.y,-Q),xt===0&&Ge.push(gt)}for(let mt=0,Lt=ae;mt<Lt;mt++){const gt=K[mt];X=_e[mt];const j=[];for(let P=0,de=gt.length;P<de;P++){const Fe=I(gt[P],X[P],Dt);Rt(Fe.x,Fe.y,-Q),xt===0&&j.push(Fe)}xt===0&&et.push(j)}}le=$r.triangulateShape(Ge,et)}const ve=le.length,ze=b+R;for(let Ge=0;Ge<W;Ge++){const et=y?I(F[Ge],te[Ge],ze):F[Ge];N?(z.copy(H.normals[0]).multiplyScalar(et.x),O.copy(H.binormals[0]).multiplyScalar(et.y),V.copy(D[0]).add(z).add(O),Rt(V.x,V.y,V.z)):Rt(et.x,et.y,0)}for(let Ge=1;Ge<=_;Ge++)for(let et=0;et<W;et++){const Je=y?I(F[et],te[et],ze):F[et];N?(z.copy(H.normals[Ge]).multiplyScalar(Je.x),O.copy(H.binormals[Ge]).multiplyScalar(Je.y),V.copy(D[Ge]).add(z).add(O),Rt(V.x,V.y,V.z)):Rt(Je.x,Je.y,v/_*Ge)}for(let Ge=T-1;Ge>=0;Ge--){const et=Ge/T,Je=x*Math.cos(et*Math.PI/2),xt=b*Math.sin(et*Math.PI/2)+R;for(let Q=0,Dt=ge.length;Q<Dt;Q++){const mt=I(ge[Q],ye[Q],xt);Rt(mt.x,mt.y,v+Je)}for(let Q=0,Dt=K.length;Q<Dt;Q++){const mt=K[Q];X=_e[Q];for(let Lt=0,gt=mt.length;Lt<gt;Lt++){const j=I(mt[Lt],X[Lt],xt);N?Rt(j.x,j.y+D[_-1].y,D[_-1].x+Je):Rt(j.x,j.y,v+Je)}}}he(),Ee();function he(){const Ge=i.length/3;if(y){let et=0,Je=W*et;for(let xt=0;xt<ve;xt++){const Q=le[xt];Bt(Q[2]+Je,Q[1]+Je,Q[0]+Je)}et=_+T*2,Je=W*et;for(let xt=0;xt<ve;xt++){const Q=le[xt];Bt(Q[0]+Je,Q[1]+Je,Q[2]+Je)}}else{for(let et=0;et<ve;et++){const Je=le[et];Bt(Je[2],Je[1],Je[0])}for(let et=0;et<ve;et++){const Je=le[et];Bt(Je[0]+W*_,Je[1]+W*_,Je[2]+W*_)}}n.addGroup(Ge,i.length/3-Ge,0)}function Ee(){const Ge=i.length/3;let et=0;lt(ge,et),et+=ge.length;for(let Je=0,xt=K.length;Je<xt;Je++){const Q=K[Je];lt(Q,et),et+=Q.length}n.addGroup(Ge,i.length/3-Ge,1)}function lt(Ge,et){let Je=Ge.length;for(;--Je>=0;){const xt=Je;let Q=Je-1;Q<0&&(Q=Ge.length-1);for(let Dt=0,mt=_+T*2;Dt<mt;Dt++){const Lt=W*Dt,gt=W*(Dt+1),j=et+xt+Lt,P=et+Q+Lt,de=et+Q+gt,Fe=et+xt+gt;tn(j,P,de,Fe)}}}function Rt(Ge,et,Je){d.push(Ge),d.push(et),d.push(Je)}function Bt(Ge,et,Je){on(Ge),on(et),on(Je);const xt=i.length/3,Q=w.generateTopUV(n,i,xt-3,xt-2,xt-1);Wt(Q[0]),Wt(Q[1]),Wt(Q[2])}function tn(Ge,et,Je,xt){on(Ge),on(et),on(xt),on(et),on(Je),on(xt);const Q=i.length/3,Dt=w.generateSideWallUV(n,i,Q-6,Q-3,Q-2,Q-1);Wt(Dt[0]),Wt(Dt[1]),Wt(Dt[3]),Wt(Dt[1]),Wt(Dt[2]),Wt(Dt[3])}function on(Ge){i.push(d[Ge*3+0]),i.push(d[Ge*3+1]),i.push(d[Ge*3+2])}function Wt(Ge){o.push(Ge.x),o.push(Ge.y)}}}copy(e){return super.copy(e),this.parameters=Object.assign({},e.parameters),this}toJSON(){const e=super.toJSON(),t=this.parameters.shapes,n=this.parameters.options;return zw(t,n,e)}static fromJSON(e,t){const n=[];for(let o=0,l=e.shapes.length;o<l;o++){const h=t[e.shapes[o]];n.push(h)}const i=e.options.extrudePath;return i!==void 0&&(e.options.extrudePath=new bv[i.type]().fromJSON(i)),new Rv(n,e.options)}}const Gw={generateTopUV:function(s,e,t,n,i){const o=e[t*3],l=e[t*3+1],h=e[n*3],d=e[n*3+1],p=e[i*3],_=e[i*3+1];return[new nt(o,l),new nt(h,d),new nt(p,_)]},generateSideWallUV:function(s,e,t,n,i,o){const l=e[t*3],h=e[t*3+1],d=e[t*3+2],p=e[n*3],_=e[n*3+1],v=e[n*3+2],y=e[i*3],x=e[i*3+1],b=e[i*3+2],R=e[o*3],T=e[o*3+1],M=e[o*3+2];return Math.abs(h-_)<Math.abs(l-p)?[new nt(l,1-d),new nt(p,1-v),new nt(y,1-b),new nt(R,1-M)]:[new nt(h,1-d),new nt(_,1-v),new nt(x,1-b),new nt(T,1-M)]}};function zw(s,e,t){if(t.shapes=[],Array.isArray(s))for(let n=0,i=s.length;n<i;n++){const o=s[n];t.shapes.push(o.uuid)}else t.shapes.push(s.uuid);return t.options=Object.assign({},e),e.extrudePath!==void 0&&(t.options.extrudePath=e.extrudePath.toJSON()),t}class zp extends Sc{constructor(e=1,t=0){const n=(1+Math.sqrt(5))/2,i=[-1,n,0,1,n,0,-1,-n,0,1,-n,0,0,-1,n,0,1,n,0,-1,-n,0,1,-n,n,0,-1,n,0,1,-n,0,-1,-n,0,1],o=[0,11,5,0,5,1,0,1,7,0,7,10,0,10,11,1,5,9,5,11,4,11,10,2,10,7,6,7,1,8,3,9,4,3,4,2,3,2,6,3,6,8,3,8,9,4,9,5,2,4,11,6,2,10,8,6,7,9,8,1];super(i,o,e,t),this.type="IcosahedronGeometry",this.parameters={radius:e,detail:t}}static fromJSON(e){return new zp(e.radius,e.detail)}}class wv extends pn{constructor(e=[new nt(0,-.5),new nt(.5,0),new nt(0,.5)],t=12,n=0,i=Math.PI*2){super(),this.type="LatheGeometry",this.parameters={points:e,segments:t,phiStart:n,phiLength:i},t=Math.floor(t),i=dn(i,0,Math.PI*2);const o=[],l=[],h=[],d=[],p=[],_=1/t,v=new Z,y=new nt,x=new Z,b=new Z,R=new Z;let T=0,M=0;for(let w=0;w<=e.length-1;w++)switch(w){case 0:T=e[w+1].x-e[w].x,M=e[w+1].y-e[w].y,x.x=M*1,x.y=-T,x.z=M*0,R.copy(x),x.normalize(),d.push(x.x,x.y,x.z);break;case e.length-1:d.push(R.x,R.y,R.z);break;default:T=e[w+1].x-e[w].x,M=e[w+1].y-e[w].y,x.x=M*1,x.y=-T,x.z=M*0,b.copy(x),x.x+=R.x,x.y+=R.y,x.z+=R.z,x.normalize(),d.push(x.x,x.y,x.z),R.copy(b)}for(let w=0;w<=t;w++){const D=n+w*_*i,N=Math.sin(D),H=Math.cos(D);for(let O=0;O<=e.length-1;O++){v.x=e[O].x*N,v.y=e[O].y,v.z=e[O].x*H,l.push(v.x,v.y,v.z),y.x=w/t,y.y=O/(e.length-1),h.push(y.x,y.y);const z=d[3*O+0]*N,V=d[3*O+1],U=d[3*O+0]*H;p.push(z,V,U)}}for(let w=0;w<t;w++)for(let D=0;D<e.length-1;D++){const N=D+w*e.length,H=N,O=N+e.length,z=N+e.length+1,V=N+1;o.push(H,O,V),o.push(z,V,O)}this.setIndex(o),this.setAttribute("position",new Xt(l,3)),this.setAttribute("uv",new Xt(h,2)),this.setAttribute("normal",new Xt(p,3))}copy(e){return super.copy(e),this.parameters=Object.assign({},e.parameters),this}static fromJSON(e){return new wv(e.points,e.segments,e.phiStart,e.phiLength)}}class Vp extends Sc{constructor(e=1,t=0){const n=[1,0,0,-1,0,0,0,1,0,0,-1,0,0,0,1,0,0,-1],i=[0,2,4,0,4,3,0,3,5,0,5,2,1,2,5,1,5,3,1,3,4,1,4,2];super(n,i,e,t),this.type="OctahedronGeometry",this.parameters={radius:e,detail:t}}static fromJSON(e){return new Vp(e.radius,e.detail)}}class Mc extends pn{constructor(e=1,t=1,n=1,i=1){super(),this.type="PlaneGeometry",this.parameters={width:e,height:t,widthSegments:n,heightSegments:i};const o=e/2,l=t/2,h=Math.floor(n),d=Math.floor(i),p=h+1,_=d+1,v=e/h,y=t/d,x=[],b=[],R=[],T=[];for(let M=0;M<_;M++){const w=M*y-l;for(let D=0;D<p;D++){const N=D*v-o;b.push(N,-w,0),R.push(0,0,1),T.push(D/h),T.push(1-M/d)}}for(let M=0;M<d;M++)for(let w=0;w<h;w++){const D=w+p*M,N=w+p*(M+1),H=w+1+p*(M+1),O=w+1+p*M;x.push(D,N,O),x.push(N,H,O)}this.setIndex(x),this.setAttribute("position",new Xt(b,3)),this.setAttribute("normal",new Xt(R,3)),this.setAttribute("uv",new Xt(T,2))}copy(e){return super.copy(e),this.parameters=Object.assign({},e.parameters),this}static fromJSON(e){return new Mc(e.width,e.height,e.widthSegments,e.heightSegments)}}class Bv extends pn{constructor(e=.5,t=1,n=32,i=1,o=0,l=Math.PI*2){super(),this.type="RingGeometry",this.parameters={innerRadius:e,outerRadius:t,thetaSegments:n,phiSegments:i,thetaStart:o,thetaLength:l},n=Math.max(3,n),i=Math.max(1,i);const h=[],d=[],p=[],_=[];let v=e;const y=(t-e)/i,x=new Z,b=new nt;for(let R=0;R<=i;R++){for(let T=0;T<=n;T++){const M=o+T/n*l;x.x=v*Math.cos(M),x.y=v*Math.sin(M),d.push(x.x,x.y,x.z),p.push(0,0,1),b.x=(x.x/t+1)/2,b.y=(x.y/t+1)/2,_.push(b.x,b.y)}v+=y}for(let R=0;R<i;R++){const T=R*(n+1);for(let M=0;M<n;M++){const w=M+T,D=w,N=w+n+1,H=w+n+2,O=w+1;h.push(D,N,O),h.push(N,H,O)}}this.setIndex(h),this.setAttribute("position",new Xt(d,3)),this.setAttribute("normal",new Xt(p,3)),this.setAttribute("uv",new Xt(_,2))}copy(e){return super.copy(e),this.parameters=Object.assign({},e.parameters),this}static fromJSON(e){return new Bv(e.innerRadius,e.outerRadius,e.thetaSegments,e.phiSegments,e.thetaStart,e.thetaLength)}}class Dv extends pn{constructor(e=new Ou([new nt(0,.5),new nt(-.5,-.5),new nt(.5,-.5)]),t=12){super(),this.type="ShapeGeometry",this.parameters={shapes:e,curveSegments:t};const n=[],i=[],o=[],l=[];let h=0,d=0;if(Array.isArray(e)===!1)p(e);else for(let _=0;_<e.length;_++)p(e[_]),this.addGroup(h,d,_),h+=d,d=0;this.setIndex(n),this.setAttribute("position",new Xt(i,3)),this.setAttribute("normal",new Xt(o,3)),this.setAttribute("uv",new Xt(l,2));function p(_){const v=i.length/3,y=_.extractPoints(t);let x=y.shape;const b=y.holes;$r.isClockWise(x)===!1&&(x=x.reverse());for(let T=0,M=b.length;T<M;T++){const w=b[T];$r.isClockWise(w)===!0&&(b[T]=w.reverse())}const R=$r.triangulateShape(x,b);for(let T=0,M=b.length;T<M;T++){const w=b[T];x=x.concat(w)}for(let T=0,M=x.length;T<M;T++){const w=x[T];i.push(w.x,w.y,0),o.push(0,0,1),l.push(w.x,w.y)}for(let T=0,M=R.length;T<M;T++){const w=R[T],D=w[0]+v,N=w[1]+v,H=w[2]+v;n.push(D,N,H),d+=3}}}copy(e){return super.copy(e),this.parameters=Object.assign({},e.parameters),this}toJSON(){const e=super.toJSON(),t=this.parameters.shapes;return Vw(t,e)}static fromJSON(e,t){const n=[];for(let i=0,o=e.shapes.length;i<o;i++){const l=t[e.shapes[i]];n.push(l)}return new Dv(n,e.curveSegments)}}function Vw(s,e){if(e.shapes=[],Array.isArray(s))for(let t=0,n=s.length;t<n;t++){const i=s[t];e.shapes.push(i.uuid)}else e.shapes.push(s.uuid);return e}class kp extends pn{constructor(e=1,t=32,n=16,i=0,o=Math.PI*2,l=0,h=Math.PI){super(),this.type="SphereGeometry",this.parameters={radius:e,widthSegments:t,heightSegments:n,phiStart:i,phiLength:o,thetaStart:l,thetaLength:h},t=Math.max(3,Math.floor(t)),n=Math.max(2,Math.floor(n));const d=Math.min(l+h,Math.PI);let p=0;const _=[],v=new Z,y=new Z,x=[],b=[],R=[],T=[];for(let M=0;M<=n;M++){const w=[],D=M/n;let N=0;M===0&&l===0?N=.5/t:M===n&&d===Math.PI&&(N=-.5/t);for(let H=0;H<=t;H++){const O=H/t;v.x=-e*Math.cos(i+O*o)*Math.sin(l+D*h),v.y=e*Math.cos(l+D*h),v.z=e*Math.sin(i+O*o)*Math.sin(l+D*h),b.push(v.x,v.y,v.z),y.copy(v).normalize(),R.push(y.x,y.y,y.z),T.push(O+N,1-D),w.push(p++)}_.push(w)}for(let M=0;M<n;M++)for(let w=0;w<t;w++){const D=_[M][w+1],N=_[M][w],H=_[M+1][w],O=_[M+1][w+1];(M!==0||l>0)&&x.push(D,N,O),(M!==n-1||d<Math.PI)&&x.push(N,H,O)}this.setIndex(x),this.setAttribute("position",new Xt(b,3)),this.setAttribute("normal",new Xt(R,3)),this.setAttribute("uv",new Xt(T,2))}copy(e){return super.copy(e),this.parameters=Object.assign({},e.parameters),this}static fromJSON(e){return new kp(e.radius,e.widthSegments,e.heightSegments,e.phiStart,e.phiLength,e.thetaStart,e.thetaLength)}}class Nv extends Sc{constructor(e=1,t=0){const n=[1,1,1,-1,-1,1,-1,1,-1,1,-1,-1],i=[2,1,0,0,3,2,1,3,0,2,3,1];super(n,i,e,t),this.type="TetrahedronGeometry",this.parameters={radius:e,detail:t}}static fromJSON(e){return new Nv(e.radius,e.detail)}}class Uv extends pn{constructor(e=1,t=.4,n=12,i=48,o=Math.PI*2){super(),this.type="TorusGeometry",this.parameters={radius:e,tube:t,radialSegments:n,tubularSegments:i,arc:o},n=Math.floor(n),i=Math.floor(i);const l=[],h=[],d=[],p=[],_=new Z,v=new Z,y=new Z;for(let x=0;x<=n;x++)for(let b=0;b<=i;b++){const R=b/i*o,T=x/n*Math.PI*2;v.x=(e+t*Math.cos(T))*Math.cos(R),v.y=(e+t*Math.cos(T))*Math.sin(R),v.z=t*Math.sin(T),h.push(v.x,v.y,v.z),_.x=e*Math.cos(R),_.y=e*Math.sin(R),y.subVectors(v,_).normalize(),d.push(y.x,y.y,y.z),p.push(b/i),p.push(x/n)}for(let x=1;x<=n;x++)for(let b=1;b<=i;b++){const R=(i+1)*x+b-1,T=(i+1)*(x-1)+b-1,M=(i+1)*(x-1)+b,w=(i+1)*x+b;l.push(R,T,w),l.push(T,M,w)}this.setIndex(l),this.setAttribute("position",new Xt(h,3)),this.setAttribute("normal",new Xt(d,3)),this.setAttribute("uv",new Xt(p,2))}copy(e){return super.copy(e),this.parameters=Object.assign({},e.parameters),this}static fromJSON(e){return new Uv(e.radius,e.tube,e.radialSegments,e.tubularSegments,e.arc)}}class Lv extends pn{constructor(e=1,t=.4,n=64,i=8,o=2,l=3){super(),this.type="TorusKnotGeometry",this.parameters={radius:e,tube:t,tubularSegments:n,radialSegments:i,p:o,q:l},n=Math.floor(n),i=Math.floor(i);const h=[],d=[],p=[],_=[],v=new Z,y=new Z,x=new Z,b=new Z,R=new Z,T=new Z,M=new Z;for(let D=0;D<=n;++D){const N=D/n*o*Math.PI*2;w(N,o,l,e,x),w(N+.01,o,l,e,b),T.subVectors(b,x),M.addVectors(b,x),R.crossVectors(T,M),M.crossVectors(R,T),R.normalize(),M.normalize();for(let H=0;H<=i;++H){const O=H/i*Math.PI*2,z=-t*Math.cos(O),V=t*Math.sin(O);v.x=x.x+(z*M.x+V*R.x),v.y=x.y+(z*M.y+V*R.y),v.z=x.z+(z*M.z+V*R.z),d.push(v.x,v.y,v.z),y.subVectors(v,x).normalize(),p.push(y.x,y.y,y.z),_.push(D/n),_.push(H/i)}}for(let D=1;D<=n;D++)for(let N=1;N<=i;N++){const H=(i+1)*(D-1)+(N-1),O=(i+1)*D+(N-1),z=(i+1)*D+N,V=(i+1)*(D-1)+N;h.push(H,O,V),h.push(O,z,V)}this.setIndex(h),this.setAttribute("position",new Xt(d,3)),this.setAttribute("normal",new Xt(p,3)),this.setAttribute("uv",new Xt(_,2));function w(D,N,H,O,z){const V=Math.cos(D),U=Math.sin(D),F=H/N*D,K=Math.cos(F);z.x=O*(2+K)*.5*V,z.y=O*(2+K)*U*.5,z.z=O*Math.sin(F)*.5}}copy(e){return super.copy(e),this.parameters=Object.assign({},e.parameters),this}static fromJSON(e){return new Lv(e.radius,e.tube,e.tubularSegments,e.radialSegments,e.p,e.q)}}class Ov extends pn{constructor(e=new Qx(new Z(-1,-1,0),new Z(-1,1,0),new Z(1,1,0)),t=64,n=1,i=8,o=!1){super(),this.type="TubeGeometry",this.parameters={path:e,tubularSegments:t,radius:n,radialSegments:i,closed:o};const l=e.computeFrenetFrames(t,o);this.tangents=l.tangents,this.normals=l.normals,this.binormals=l.binormals;const h=new Z,d=new Z,p=new nt;let _=new Z;const v=[],y=[],x=[],b=[];R(),this.setIndex(b),this.setAttribute("position",new Xt(v,3)),this.setAttribute("normal",new Xt(y,3)),this.setAttribute("uv",new Xt(x,2));function R(){for(let D=0;D<t;D++)T(D);T(o===!1?t:0),w(),M()}function T(D){_=e.getPointAt(D/t,_);const N=l.normals[D],H=l.binormals[D];for(let O=0;O<=i;O++){const z=O/i*Math.PI*2,V=Math.sin(z),U=-Math.cos(z);d.x=U*N.x+V*H.x,d.y=U*N.y+V*H.y,d.z=U*N.z+V*H.z,d.normalize(),y.push(d.x,d.y,d.z),h.x=_.x+n*d.x,h.y=_.y+n*d.y,h.z=_.z+n*d.z,v.push(h.x,h.y,h.z)}}function M(){for(let D=1;D<=t;D++)for(let N=1;N<=i;N++){const H=(i+1)*(D-1)+(N-1),O=(i+1)*D+(N-1),z=(i+1)*D+N,V=(i+1)*(D-1)+N;b.push(H,O,V),b.push(O,z,V)}}function w(){for(let D=0;D<=t;D++)for(let N=0;N<=i;N++)p.x=D/t,p.y=N/i,x.push(p.x,p.y)}}copy(e){return super.copy(e),this.parameters=Object.assign({},e.parameters),this}toJSON(){const e=super.toJSON();return e.path=this.parameters.path.toJSON(),e}static fromJSON(e){return new Ov(new bv[e.path.type]().fromJSON(e.path),e.tubularSegments,e.radius,e.radialSegments,e.closed)}}class b1 extends pn{constructor(e=null){if(super(),this.type="WireframeGeometry",this.parameters={geometry:e},e!==null){const t=[],n=new Set,i=new Z,o=new Z;if(e.index!==null){const l=e.attributes.position,h=e.index;let d=e.groups;d.length===0&&(d=[{start:0,count:h.count,materialIndex:0}]);for(let p=0,_=d.length;p<_;++p){const v=d[p],y=v.start,x=v.count;for(let b=y,R=y+x;b<R;b+=3)for(let T=0;T<3;T++){const M=h.getX(b+T),w=h.getX(b+(T+1)%3);i.fromBufferAttribute(l,M),o.fromBufferAttribute(l,w),E1(i,o,n)===!0&&(t.push(i.x,i.y,i.z),t.push(o.x,o.y,o.z))}}}else{const l=e.attributes.position;for(let h=0,d=l.count/3;h<d;h++)for(let p=0;p<3;p++){const _=3*h+p,v=3*h+(p+1)%3;i.fromBufferAttribute(l,_),o.fromBufferAttribute(l,v),E1(i,o,n)===!0&&(t.push(i.x,i.y,i.z),t.push(o.x,o.y,o.z))}}this.setAttribute("position",new Xt(t,3))}}copy(e){return super.copy(e),this.parameters=Object.assign({},e.parameters),this}}function E1(s,e,t){const n=`${s.x},${s.y},${s.z}-${e.x},${e.y},${e.z}`,i=`${e.x},${e.y},${e.z}-${s.x},${s.y},${s.z}`;return t.has(n)===!0||t.has(i)===!0?!1:(t.add(n),t.add(i),!0)}var T1=Object.freeze({__proto__:null,BoxGeometry:Du,CapsuleGeometry:gv,CircleGeometry:vv,ConeGeometry:Lp,CylinderGeometry:Up,DodecahedronGeometry:_v,EdgesGeometry:u1,ExtrudeGeometry:Rv,IcosahedronGeometry:zp,LatheGeometry:wv,OctahedronGeometry:Vp,PlaneGeometry:Mc,PolyhedronGeometry:Sc,RingGeometry:Bv,ShapeGeometry:Dv,SphereGeometry:kp,TetrahedronGeometry:Nv,TorusGeometry:Uv,TorusKnotGeometry:Lv,TubeGeometry:Ov,WireframeGeometry:b1});class C1 extends Yi{constructor(e){super(),this.isShadowMaterial=!0,this.type="ShadowMaterial",this.color=new Ct(0),this.transparent=!0,this.fog=!0,this.setValues(e)}copy(e){return super.copy(e),this.color.copy(e.color),this.fog=e.fog,this}}class nA extends ms{constructor(e){super(e),this.isRawShaderMaterial=!0,this.type="RawShaderMaterial"}}class Fu extends Yi{constructor(e){super(),this.isMeshStandardMaterial=!0,this.type="MeshStandardMaterial",this.defines={STANDARD:""},this.color=new Ct(16777215),this.roughness=1,this.metalness=0,this.map=null,this.lightMap=null,this.lightMapIntensity=1,this.aoMap=null,this.aoMapIntensity=1,this.emissive=new Ct(0),this.emissiveIntensity=1,this.emissiveMap=null,this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=fc,this.normalScale=new nt(1,1),this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.roughnessMap=null,this.metalnessMap=null,this.alphaMap=null,this.envMap=null,this.envMapRotation=new er,this.envMapIntensity=1,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.defines={STANDARD:""},this.color.copy(e.color),this.roughness=e.roughness,this.metalness=e.metalness,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.roughnessMap=e.roughnessMap,this.metalnessMap=e.metalnessMap,this.alphaMap=e.alphaMap,this.envMap=e.envMap,this.envMapRotation.copy(e.envMapRotation),this.envMapIntensity=e.envMapIntensity,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 Ji extends Fu{constructor(e){super(),this.isMeshPhysicalMaterial=!0,this.defines={STANDARD:"",PHYSICAL:""},this.type="MeshPhysicalMaterial",this.anisotropyRotation=0,this.anisotropyMap=null,this.clearcoatMap=null,this.clearcoatRoughness=0,this.clearcoatRoughnessMap=null,this.clearcoatNormalScale=new nt(1,1),this.clearcoatNormalMap=null,this.ior=1.5,Object.defineProperty(this,"reflectivity",{get:function(){return dn(2.5*(this.ior-1)/(this.ior+1),0,1)},set:function(t){this.ior=(1+.4*t)/(1-.4*t)}}),this.iridescenceMap=null,this.iridescenceIOR=1.3,this.iridescenceThicknessRange=[100,400],this.iridescenceThicknessMap=null,this.sheenColor=new Ct(0),this.sheenColorMap=null,this.sheenRoughness=1,this.sheenRoughnessMap=null,this.transmissionMap=null,this.thickness=0,this.thicknessMap=null,this.attenuationDistance=1/0,this.attenuationColor=new Ct(1,1,1),this.specularIntensity=1,this.specularIntensityMap=null,this.specularColor=new Ct(1,1,1),this.specularColorMap=null,this._anisotropy=0,this._clearcoat=0,this._dispersion=0,this._iridescence=0,this._sheen=0,this._transmission=0,this.setValues(e)}get anisotropy(){return this._anisotropy}set anisotropy(e){this._anisotropy>0!=e>0&&this.version++,this._anisotropy=e}get clearcoat(){return this._clearcoat}set clearcoat(e){this._clearcoat>0!=e>0&&this.version++,this._clearcoat=e}get iridescence(){return this._iridescence}set iridescence(e){this._iridescence>0!=e>0&&this.version++,this._iridescence=e}get dispersion(){return this._dispersion}set dispersion(e){this._dispersion>0!=e>0&&this.version++,this._dispersion=e}get sheen(){return this._sheen}set sheen(e){this._sheen>0!=e>0&&this.version++,this._sheen=e}get transmission(){return this._transmission}set transmission(e){this._transmission>0!=e>0&&this.version++,this._transmission=e}copy(e){return super.copy(e),this.defines={STANDARD:"",PHYSICAL:""},this.anisotropy=e.anisotropy,this.anisotropyRotation=e.anisotropyRotation,this.anisotropyMap=e.anisotropyMap,this.clearcoat=e.clearcoat,this.clearcoatMap=e.clearcoatMap,this.clearcoatRoughness=e.clearcoatRoughness,this.clearcoatRoughnessMap=e.clearcoatRoughnessMap,this.clearcoatNormalMap=e.clearcoatNormalMap,this.clearcoatNormalScale.copy(e.clearcoatNormalScale),this.dispersion=e.dispersion,this.ior=e.ior,this.iridescence=e.iridescence,this.iridescenceMap=e.iridescenceMap,this.iridescenceIOR=e.iridescenceIOR,this.iridescenceThicknessRange=[...e.iridescenceThicknessRange],this.iridescenceThicknessMap=e.iridescenceThicknessMap,this.sheen=e.sheen,this.sheenColor.copy(e.sheenColor),this.sheenColorMap=e.sheenColorMap,this.sheenRoughness=e.sheenRoughness,this.sheenRoughnessMap=e.sheenRoughnessMap,this.transmission=e.transmission,this.transmissionMap=e.transmissionMap,this.thickness=e.thickness,this.thicknessMap=e.thicknessMap,this.attenuationDistance=e.attenuationDistance,this.attenuationColor.copy(e.attenuationColor),this.specularIntensity=e.specularIntensity,this.specularIntensityMap=e.specularIntensityMap,this.specularColor.copy(e.specularColor),this.specularColorMap=e.specularColorMap,this}}class R1 extends Yi{constructor(e){super(),this.isMeshPhongMaterial=!0,this.type="MeshPhongMaterial",this.color=new Ct(16777215),this.specular=new Ct(1118481),this.shininess=30,this.map=null,this.lightMap=null,this.lightMapIntensity=1,this.aoMap=null,this.aoMapIntensity=1,this.emissive=new Ct(0),this.emissiveIntensity=1,this.emissiveMap=null,this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=fc,this.normalScale=new nt(1,1),this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.specularMap=null,this.alphaMap=null,this.envMap=null,this.envMapRotation=new er,this.combine=$d,this.reflectivity=1,this.refractionRatio=.98,this.wireframe=!1,this.wireframeLinewidth=1,this.wireframeLinecap="round",this.wireframeLinejoin="round",this.flatShading=!1,this.fog=!0,this.setValues(e)}copy(e){return super.copy(e),this.color.copy(e.color),this.specular.copy(e.specular),this.shininess=e.shininess,this.map=e.map,this.lightMap=e.lightMap,this.lightMapIntensity=e.lightMapIntensity,this.aoMap=e.aoMap,this.aoMapIntensity=e.aoMapIntensity,this.emissive.copy(e.emissive),this.emissiveMap=e.emissiveMap,this.emissiveIntensity=e.emissiveIntensity,this.bumpMap=e.bumpMap,this.bumpScale=e.bumpScale,this.normalMap=e.normalMap,this.normalMapType=e.normalMapType,this.normalScale.copy(e.normalScale),this.displacementMap=e.displacementMap,this.displacementScale=e.displacementScale,this.displacementBias=e.displacementBias,this.specularMap=e.specularMap,this.alphaMap=e.alphaMap,this.envMap=e.envMap,this.envMapRotation.copy(e.envMapRotation),this.combine=e.combine,this.reflectivity=e.reflectivity,this.refractionRatio=e.refractionRatio,this.wireframe=e.wireframe,this.wireframeLinewidth=e.wireframeLinewidth,this.wireframeLinecap=e.wireframeLinecap,this.wireframeLinejoin=e.wireframeLinejoin,this.flatShading=e.flatShading,this.fog=e.fog,this}}class w1 extends Yi{constructor(e){super(),this.isMeshToonMaterial=!0,this.defines={TOON:""},this.type="MeshToonMaterial",this.color=new Ct(16777215),this.map=null,this.gradientMap=null,this.lightMap=null,this.lightMapIntensity=1,this.aoMap=null,this.aoMapIntensity=1,this.emissive=new Ct(0),this.emissiveIntensity=1,this.emissiveMap=null,this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=fc,this.normalScale=new nt(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 B1 extends Yi{constructor(e){super(),this.isMeshNormalMaterial=!0,this.type="MeshNormalMaterial",this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=fc,this.normalScale=new nt(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 D1 extends Yi{constructor(e){super(),this.isMeshLambertMaterial=!0,this.type="MeshLambertMaterial",this.color=new Ct(16777215),this.map=null,this.lightMap=null,this.lightMapIntensity=1,this.aoMap=null,this.aoMapIntensity=1,this.emissive=new Ct(0),this.emissiveIntensity=1,this.emissiveMap=null,this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=fc,this.normalScale=new nt(1,1),this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.specularMap=null,this.alphaMap=null,this.envMap=null,this.envMapRotation=new er,this.combine=$d,this.reflectivity=1,this.refractionRatio=.98,this.wireframe=!1,this.wireframeLinewidth=1,this.wireframeLinecap="round",this.wireframeLinejoin="round",this.flatShading=!1,this.fog=!0,this.setValues(e)}copy(e){return super.copy(e),this.color.copy(e.color),this.map=e.map,this.lightMap=e.lightMap,this.lightMapIntensity=e.lightMapIntensity,this.aoMap=e.aoMap,this.aoMapIntensity=e.aoMapIntensity,this.emissive.copy(e.emissive),this.emissiveMap=e.emissiveMap,this.emissiveIntensity=e.emissiveIntensity,this.bumpMap=e.bumpMap,this.bumpScale=e.bumpScale,this.normalMap=e.normalMap,this.normalMapType=e.normalMapType,this.normalScale.copy(e.normalScale),this.displacementMap=e.displacementMap,this.displacementScale=e.displacementScale,this.displacementBias=e.displacementBias,this.specularMap=e.specularMap,this.alphaMap=e.alphaMap,this.envMap=e.envMap,this.envMapRotation.copy(e.envMapRotation),this.combine=e.combine,this.reflectivity=e.reflectivity,this.refractionRatio=e.refractionRatio,this.wireframe=e.wireframe,this.wireframeLinewidth=e.wireframeLinewidth,this.wireframeLinecap=e.wireframeLinecap,this.wireframeLinejoin=e.wireframeLinejoin,this.flatShading=e.flatShading,this.fog=e.fog,this}}class iA extends Yi{constructor(e){super(),this.isMeshDepthMaterial=!0,this.type="MeshDepthMaterial",this.depthPacking=sb,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 aA extends Yi{constructor(e){super(),this.isMeshDistanceMaterial=!0,this.type="MeshDistanceMaterial",this.map=null,this.alphaMap=null,this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.setValues(e)}copy(e){return super.copy(e),this.map=e.map,this.alphaMap=e.alphaMap,this.displacementMap=e.displacementMap,this.displacementScale=e.displacementScale,this.displacementBias=e.displacementBias,this}}class N1 extends Yi{constructor(e){super(),this.isMeshMatcapMaterial=!0,this.defines={MATCAP:""},this.type="MeshMatcapMaterial",this.color=new Ct(16777215),this.matcap=null,this.map=null,this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=fc,this.normalScale=new nt(1,1),this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.alphaMap=null,this.wireframe=!1,this.wireframeLinewidth=1,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.wireframe=e.wireframe,this.wireframeLinewidth=e.wireframeLinewidth,this.flatShading=e.flatShading,this.fog=e.fog,this}}class U1 extends za{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 Hu(s,e){return!s||s.constructor===e?s:typeof e.BYTES_PER_ELEMENT=="number"?new e(s):Array.prototype.slice.call(s)}function L1(s){function e(i,o){return s[i]-s[o]}const t=s.length,n=new Array(t);for(let i=0;i!==t;++i)n[i]=i;return n.sort(e),n}function sA(s,e,t){const n=s.length,i=new s.constructor(n);for(let o=0,l=0;l!==n;++o){const h=t[o]*e;for(let d=0;d!==e;++d)i[l++]=s[h+d]}return i}function rA(s,e,t,n){let i=1,o=s[0];for(;o!==void 0&&o[n]===void 0;)o=s[i++];if(o===void 0)return;let l=o[n];if(l!==void 0)if(Array.isArray(l))do l=o[n],l!==void 0&&(e.push(o.time),t.push(...l)),o=s[i++];while(o!==void 0);else if(l.toArray!==void 0)do l=o[n],l!==void 0&&(e.push(o.time),l.toArray(t,t.length)),o=s[i++];while(o!==void 0);else do l=o[n],l!==void 0&&(e.push(o.time),t.push(l)),o=s[i++];while(o!==void 0)}function kw(s,e,t,n,i=30){const o=s.clone();o.name=e;const l=[];for(let d=0;d<o.tracks.length;++d){const p=o.tracks[d],_=p.getValueSize(),v=[],y=[];for(let x=0;x<p.times.length;++x){const b=p.times[x]*i;if(!(b<t||b>=n)){v.push(p.times[x]);for(let R=0;R<_;++R)y.push(p.values[x*_+R])}}v.length!==0&&(p.times=Hu(v,p.times.constructor),p.values=Hu(y,p.values.constructor),l.push(p))}o.tracks=l;let h=1/0;for(let d=0;d<o.tracks.length;++d)h>o.tracks[d].times[0]&&(h=o.tracks[d].times[0]);for(let d=0;d<o.tracks.length;++d)o.tracks[d].shift(-1*h);return o.resetDuration(),o}function Xw(s,e=0,t=s,n=30){n<=0&&(n=30);const i=t.tracks.length,o=e/n;for(let l=0;l<i;++l){const h=t.tracks[l],d=h.ValueTypeName;if(d==="bool"||d==="string")continue;const p=s.tracks.find(function(M){return M.name===h.name&&M.ValueTypeName===d});if(p===void 0)continue;let _=0;const v=h.getValueSize();h.createInterpolant.isInterpolantFactoryMethodGLTFCubicSpline&&(_=v/3);let y=0;const x=p.getValueSize();p.createInterpolant.isInterpolantFactoryMethodGLTFCubicSpline&&(y=x/3);const b=h.times.length-1;let R;if(o<=h.times[0]){const M=_,w=v-_;R=h.values.slice(M,w)}else if(o>=h.times[b]){const M=b*v+_,w=M+v-_;R=h.values.slice(M,w)}else{const M=h.createInterpolant(),w=_,D=v-_;M.evaluate(o),R=M.resultBuffer.slice(w,D)}d==="quaternion"&&new Ca().fromArray(R).normalize().conjugate().toArray(R);const T=p.times.length;for(let M=0;M<T;++M){const w=M*x+y;if(d==="quaternion")Ca.multiplyQuaternionsFlat(p.values,w,R,0,p.values,w);else{const D=x-y*2;for(let N=0;N<D;++N)p.values[w+N]-=R[N]}}}return s.blendMode=rx,s}class Yw{static convertArray(e,t){return Hu(e,t)}static isTypedArray(e){return pb(e)}static getKeyframeOrder(e){return L1(e)}static sortedArray(e,t,n){return sA(e,t,n)}static flattenJSON(e,t,n,i){rA(e,t,n,i)}static subclip(e,t,n,i,o=30){return kw(e,t,n,i,o)}static makeClipAdditive(e,t=0,n=e,i=30){return Xw(e,t,n,i)}}class Pu{constructor(e,t,n,i){this.parameterPositions=e,this._cachedIndex=0,this.resultBuffer=i!==void 0?i:new t.constructor(n),this.sampleValues=t,this.valueSize=n,this.settings=null,this.DefaultSettings_={}}evaluate(e){const t=this.parameterPositions;let n=this._cachedIndex,i=t[n],o=t[n-1];e:{t:{let l;n:{i:if(!(e<i)){for(let h=n+2;;){if(i===void 0){if(e<o)break i;return n=t.length,this._cachedIndex=n,this.copySampleValue_(n-1)}if(n===h)break;if(o=i,i=t[++n],e<i)break t}l=t.length;break n}if(!(e>=o)){const h=t[1];e<h&&(n=2,o=h);for(let d=n-2;;){if(o===void 0)return this._cachedIndex=0,this.copySampleValue_(0);if(n===d)break;if(i=o,o=t[--n-1],e>=o)break t}l=n,n=0;break n}break e}for(;n<l;){const h=n+l>>>1;e<t[h]?l=h:n=h+1}if(i=t[n],o=t[n-1],o===void 0)return this._cachedIndex=0,this.copySampleValue_(0);if(i===void 0)return n=t.length,this._cachedIndex=n,this.copySampleValue_(n-1)}this._cachedIndex=n,this.intervalChanged_(n,o,i)}return this.interpolate_(n,o,e,i)}getSettings_(){return this.settings||this.DefaultSettings_}copySampleValue_(e){const t=this.resultBuffer,n=this.sampleValues,i=this.valueSize,o=e*i;for(let l=0;l!==i;++l)t[l]=n[o+l];return t}interpolate_(){throw new Error("call to abstract method")}intervalChanged_(){}}class O1 extends Pu{constructor(e,t,n,i){super(e,t,n,i),this._weightPrev=-0,this._offsetPrev=-0,this._weightNext=-0,this._offsetNext=-0,this.DefaultSettings_={endingStart:Su,endingEnd:Su}}intervalChanged_(e,t,n){const i=this.parameterPositions;let o=e-2,l=e+1,h=i[o],d=i[l];if(h===void 0)switch(this.getSettings_().endingStart){case Mu:o=e,h=2*t-n;break;case up:o=i.length-2,h=t+i[o]-i[o+1];break;default:o=e,h=n}if(d===void 0)switch(this.getSettings_().endingEnd){case Mu:l=e,d=2*n-t;break;case up:l=1,d=n+i[1]-i[0];break;default:l=e-1,d=t}const p=(n-t)*.5,_=this.valueSize;this._weightPrev=p/(t-h),this._weightNext=p/(d-n),this._offsetPrev=o*_,this._offsetNext=l*_}interpolate_(e,t,n,i){const o=this.resultBuffer,l=this.sampleValues,h=this.valueSize,d=e*h,p=d-h,_=this._offsetPrev,v=this._offsetNext,y=this._weightPrev,x=this._weightNext,b=(n-t)/(i-t),R=b*b,T=R*b,M=-y*T+2*y*R-y*b,w=(1+y)*T+(-1.5-2*y)*R+(-.5+y)*b+1,D=(-1-x)*T+(1.5+x)*R+.5*b,N=x*T-x*R;for(let H=0;H!==h;++H)o[H]=M*l[_+H]+w*l[p+H]+D*l[d+H]+N*l[v+H];return o}}class oA extends Pu{constructor(e,t,n,i){super(e,t,n,i)}interpolate_(e,t,n,i){const o=this.resultBuffer,l=this.sampleValues,h=this.valueSize,d=e*h,p=d-h,_=(n-t)/(i-t),v=1-_;for(let y=0;y!==h;++y)o[y]=l[p+y]*v+l[d+y]*_;return o}}class I1 extends Pu{constructor(e,t,n,i){super(e,t,n,i)}interpolate_(e){return this.copySampleValue_(e-1)}}class xr{constructor(e,t,n,i){if(e===void 0)throw new Error("THREE.KeyframeTrack: track name is undefined");if(t===void 0||t.length===0)throw new Error("THREE.KeyframeTrack: no keyframes in track named "+e);this.name=e,this.times=Hu(t,this.TimeBufferType),this.values=Hu(n,this.ValueBufferType),this.setInterpolation(i||this.DefaultInterpolation)}static toJSON(e){const t=e.constructor;let n;if(t.toJSON!==this.toJSON)n=t.toJSON(e);else{n={name:e.name,times:Hu(e.times,Array),values:Hu(e.values,Array)};const i=e.getInterpolation();i!==e.DefaultInterpolation&&(n.interpolation=i)}return n.type=e.ValueTypeName,n}InterpolantFactoryMethodDiscrete(e){return new I1(this.times,this.values,this.getValueSize(),e)}InterpolantFactoryMethodLinear(e){return new oA(this.times,this.values,this.getValueSize(),e)}InterpolantFactoryMethodSmooth(e){return new O1(this.times,this.values,this.getValueSize(),e)}setInterpolation(e){let t;switch(e){case Au:t=this.InterpolantFactoryMethodDiscrete;break;case uc:t=this.InterpolantFactoryMethodLinear;break;case A0:t=this.InterpolantFactoryMethodSmooth;break}if(t===void 0){const n="unsupported interpolation for "+this.ValueTypeName+" keyframe track named "+this.name;if(this.createInterpolant===void 0)if(e!==this.DefaultInterpolation)this.setInterpolation(this.DefaultInterpolation);else throw new Error(n);return Ut("KeyframeTrack:",n),this}return this.createInterpolant=t,this}getInterpolation(){switch(this.createInterpolant){case this.InterpolantFactoryMethodDiscrete:return Au;case this.InterpolantFactoryMethodLinear:return uc;case this.InterpolantFactoryMethodSmooth:return A0}}getValueSize(){return this.values.length/this.times.length}shift(e){if(e!==0){const t=this.times;for(let n=0,i=t.length;n!==i;++n)t[n]+=e}return this}scale(e){if(e!==1){const t=this.times;for(let n=0,i=t.length;n!==i;++n)t[n]*=e}return this}trim(e,t){const n=this.times,i=n.length;let o=0,l=i-1;for(;o!==i&&n[o]<e;)++o;for(;l!==-1&&n[l]>t;)--l;if(++l,o!==0||l!==i){o>=l&&(l=Math.max(l,1),o=l-1);const h=this.getValueSize();this.times=n.slice(o,l),this.values=this.values.slice(o*h,l*h)}return this}validate(){let e=!0;const t=this.getValueSize();t-Math.floor(t)!==0&&(Zt("KeyframeTrack: Invalid value size in track.",this),e=!1);const n=this.times,i=this.values,o=n.length;o===0&&(Zt("KeyframeTrack: Track is empty.",this),e=!1);let l=null;for(let h=0;h!==o;h++){const d=n[h];if(typeof d=="number"&&isNaN(d)){Zt("KeyframeTrack: Time is not a valid number.",this,h,d),e=!1;break}if(l!==null&&l>d){Zt("KeyframeTrack: Out of order keys.",this,h,d,l),e=!1;break}l=d}if(i!==void 0&&pb(i))for(let h=0,d=i.length;h!==d;++h){const p=i[h];if(isNaN(p)){Zt("KeyframeTrack: Value is not a valid number.",this,h,p),e=!1;break}}return e}optimize(){const e=this.times.slice(),t=this.values.slice(),n=this.getValueSize(),i=this.getInterpolation()===A0,o=e.length-1;let l=1;for(let h=1;h<o;++h){let d=!1;const p=e[h],_=e[h+1];if(p!==_&&(h!==1||p!==e[0]))if(i)d=!0;else{const v=h*n,y=v-n,x=v+n;for(let b=0;b!==n;++b){const R=t[v+b];if(R!==t[y+b]||R!==t[x+b]){d=!0;break}}}if(d){if(h!==l){e[l]=e[h];const v=h*n,y=l*n;for(let x=0;x!==n;++x)t[y+x]=t[v+x]}++l}}if(o>0){e[l]=e[o];for(let h=o*n,d=l*n,p=0;p!==n;++p)t[d+p]=t[h+p];++l}return l!==e.length?(this.times=e.slice(0,l),this.values=t.slice(0,l*n)):(this.times=e,this.values=t),this}clone(){const e=this.times.slice(),t=this.values.slice(),n=this.constructor,i=new n(this.name,e,t);return i.createInterpolant=this.createInterpolant,i}}xr.prototype.ValueTypeName="",xr.prototype.TimeBufferType=Float32Array,xr.prototype.ValueBufferType=Float32Array,xr.prototype.DefaultInterpolation=uc;class Gu extends xr{constructor(e,t,n){super(e,t,n)}}Gu.prototype.ValueTypeName="bool",Gu.prototype.ValueBufferType=Array,Gu.prototype.DefaultInterpolation=Au,Gu.prototype.InterpolantFactoryMethodLinear=void 0,Gu.prototype.InterpolantFactoryMethodSmooth=void 0;class lA extends xr{constructor(e,t,n,i){super(e,t,n,i)}}lA.prototype.ValueTypeName="color";class Sl extends xr{constructor(e,t,n,i){super(e,t,n,i)}}Sl.prototype.ValueTypeName="number";class F1 extends Pu{constructor(e,t,n,i){super(e,t,n,i)}interpolate_(e,t,n,i){const o=this.resultBuffer,l=this.sampleValues,h=this.valueSize,d=(n-t)/(i-t);let p=e*h;for(let _=p+h;p!==_;p+=4)Ca.slerpFlat(o,0,l,p-h,l,p,d);return o}}class Ml extends xr{constructor(e,t,n,i){super(e,t,n,i)}InterpolantFactoryMethodLinear(e){return new F1(this.times,this.values,this.getValueSize(),e)}}Ml.prototype.ValueTypeName="quaternion",Ml.prototype.InterpolantFactoryMethodSmooth=void 0;class zu extends xr{constructor(e,t,n){super(e,t,n)}}zu.prototype.ValueTypeName="string",zu.prototype.ValueBufferType=Array,zu.prototype.DefaultInterpolation=Au,zu.prototype.InterpolantFactoryMethodLinear=void 0,zu.prototype.InterpolantFactoryMethodSmooth=void 0;class bl extends xr{constructor(e,t,n,i){super(e,t,n,i)}}bl.prototype.ValueTypeName="vector";class Vu{constructor(e="",t=-1,n=[],i=S0){this.name=e,this.tracks=n,this.duration=t,this.blendMode=i,this.uuid=Qs(),this.userData={},this.duration<0&&this.resetDuration()}static parse(e){const t=[],n=e.tracks,i=1/(e.fps||1);for(let l=0,h=n.length;l!==h;++l)t.push(qw(n[l]).scale(i));const o=new this(e.name,e.duration,t,e.blendMode);return o.uuid=e.uuid,o.userData=JSON.parse(e.userData||"{}"),o}static toJSON(e){const t=[],n=e.tracks,i={name:e.name,duration:e.duration,tracks:t,uuid:e.uuid,blendMode:e.blendMode,userData:JSON.stringify(e.userData)};for(let o=0,l=n.length;o!==l;++o)t.push(xr.toJSON(n[o]));return i}static CreateFromMorphTargetSequence(e,t,n,i){const o=t.length,l=[];for(let h=0;h<o;h++){let d=[],p=[];d.push((h+o-1)%o,h,(h+1)%o),p.push(0,1,0);const _=L1(d);d=sA(d,1,_),p=sA(p,1,_),!i&&d[0]===0&&(d.push(o),p.push(p[0])),l.push(new Sl(".morphTargetInfluences["+t[h].name+"]",d,p).scale(1/n))}return new this(e,-1,l)}static findByName(e,t){let n=e;if(!Array.isArray(e)){const i=e;n=i.geometry&&i.geometry.animations||i.animations}for(let i=0;i<n.length;i++)if(n[i].name===t)return n[i];return null}static CreateClipsFromMorphTargetSequences(e,t,n){const i={},o=/^([\w-]*?)([\d]+)$/;for(let h=0,d=e.length;h<d;h++){const p=e[h],_=p.name.match(o);if(_&&_.length>1){const v=_[1];let y=i[v];y||(i[v]=y=[]),y.push(p)}}const l=[];for(const h in i)l.push(this.CreateFromMorphTargetSequence(h,i[h],t,n));return l}static parseAnimation(e,t){if(Ut("AnimationClip: parseAnimation() is deprecated and will be removed with r185"),!e)return Zt("AnimationClip: No animation in JSONLoader data."),null;const n=function(v,y,x,b,R){if(x.length!==0){const T=[],M=[];rA(x,T,M,b),T.length!==0&&R.push(new v(y,T,M))}},i=[],o=e.name||"default",l=e.fps||30,h=e.blendMode;let d=e.length||-1;const p=e.hierarchy||[];for(let v=0;v<p.length;v++){const y=p[v].keys;if(!(!y||y.length===0))if(y[0].morphTargets){const x={};let b;for(b=0;b<y.length;b++)if(y[b].morphTargets)for(let R=0;R<y[b].morphTargets.length;R++)x[y[b].morphTargets[R]]=-1;for(const R in x){const T=[],M=[];for(let w=0;w!==y[b].morphTargets.length;++w){const D=y[b];T.push(D.time),M.push(D.morphTarget===R?1:0)}i.push(new Sl(".morphTargetInfluence["+R+"]",T,M))}d=x.length*l}else{const x=".bones["+t[v].name+"]";n(bl,x+".position",y,"pos",i),n(Ml,x+".quaternion",y,"rot",i),n(bl,x+".scale",y,"scl",i)}}return i.length===0?null:new this(o,d,i,h)}resetDuration(){const e=this.tracks;let t=0;for(let n=0,i=e.length;n!==i;++n){const o=this.tracks[n];t=Math.max(t,o.times[o.times.length-1])}return this.duration=t,this}trim(){for(let e=0;e<this.tracks.length;e++)this.tracks[e].trim(0,this.duration);return this}validate(){let e=!0;for(let t=0;t<this.tracks.length;t++)e=e&&this.tracks[t].validate();return e}optimize(){for(let e=0;e<this.tracks.length;e++)this.tracks[e].optimize();return this}clone(){const e=[];for(let n=0;n<this.tracks.length;n++)e.push(this.tracks[n].clone());const t=new this.constructor(this.name,this.duration,e,this.blendMode);return t.userData=JSON.parse(JSON.stringify(this.userData)),t}toJSON(){return this.constructor.toJSON(this)}}function Jw(s){switch(s.toLowerCase()){case"scalar":case"double":case"float":case"number":case"integer":return Sl;case"vector":case"vector2":case"vector3":case"vector4":return bl;case"color":return lA;case"quaternion":return Ml;case"bool":case"boolean":return Gu;case"string":return zu}throw new Error("THREE.KeyframeTrack: Unsupported typeName: "+s)}function qw(s){if(s.type===void 0)throw new Error("THREE.KeyframeTrack: track type undefined, can not parse");const e=Jw(s.type);if(s.times===void 0){const t=[],n=[];rA(s.keys,t,n,"value"),s.times=t,s.values=n}return e.parse!==void 0?e.parse(s):new e(s.name,s.times,s.values,s.interpolation)}const Bo={enabled:!1,files:{},add:function(s,e){this.enabled!==!1&&(this.files[s]=e)},get:function(s){if(this.enabled!==!1)return this.files[s]},remove:function(s){delete this.files[s]},clear:function(){this.files={}}};class Iv{constructor(e,t,n){const i=this;let o=!1,l=0,h=0,d;const p=[];this.onStart=void 0,this.onLoad=e,this.onProgress=t,this.onError=n,this._abortController=null,this.itemStart=function(_){h++,o===!1&&i.onStart!==void 0&&i.onStart(_,l,h),o=!0},this.itemEnd=function(_){l++,i.onProgress!==void 0&&i.onProgress(_,l,h),l===h&&(o=!1,i.onLoad!==void 0&&i.onLoad())},this.itemError=function(_){i.onError!==void 0&&i.onError(_)},this.resolveURL=function(_){return d?d(_):_},this.setURLModifier=function(_){return d=_,this},this.addHandler=function(_,v){return p.push(_,v),this},this.removeHandler=function(_){const v=p.indexOf(_);return v!==-1&&p.splice(v,2),this},this.getHandler=function(_){for(let v=0,y=p.length;v<y;v+=2){const x=p[v],b=p[v+1];if(x.global&&(x.lastIndex=0),x.test(_))return b}return null},this.abort=function(){return this.abortController.abort(),this._abortController=null,this}}get abortController(){return this._abortController||(this._abortController=new AbortController),this._abortController}}const H1=new Iv;class Ba{constructor(e){this.manager=e!==void 0?e:H1,this.crossOrigin="anonymous",this.withCredentials=!1,this.path="",this.resourcePath="",this.requestHeader={}}load(){}loadAsync(e,t){const n=this;return new Promise(function(i,o){n.load(e,i,t,o)})}parse(){}setCrossOrigin(e){return this.crossOrigin=e,this}setWithCredentials(e){return this.withCredentials=e,this}setPath(e){return this.path=e,this}setResourcePath(e){return this.resourcePath=e,this}setRequestHeader(e){return this.requestHeader=e,this}abort(){return this}}Ba.DEFAULT_MATERIAL_NAME="__DEFAULT";const El={};class Kw extends Error{constructor(e,t){super(e),this.response=t}}class da extends Ba{constructor(e){super(e),this.mimeType="",this.responseType="",this._abortController=new AbortController}load(e,t,n,i){e===void 0&&(e=""),this.path!==void 0&&(e=this.path+e),e=this.manager.resolveURL(e);const o=Bo.get(`file:${e}`);if(o!==void 0)return this.manager.itemStart(e),setTimeout(()=>{t&&t(o),this.manager.itemEnd(e)},0),o;if(El[e]!==void 0){El[e].push({onLoad:t,onProgress:n,onError:i});return}El[e]=[],El[e].push({onLoad:t,onProgress:n,onError:i});const l=new Request(e,{headers:new Headers(this.requestHeader),credentials:this.withCredentials?"include":"same-origin",signal:typeof AbortSignal.any=="function"?AbortSignal.any([this._abortController.signal,this.manager.abortController.signal]):this._abortController.signal}),h=this.mimeType,d=this.responseType;fetch(l).then(p=>{if(p.status===200||p.status===0){if(p.status===0&&Ut("FileLoader: HTTP Status 0 received."),typeof ReadableStream>"u"||p.body===void 0||p.body.getReader===void 0)return p;const _=El[e],v=p.body.getReader(),y=p.headers.get("X-File-Size")||p.headers.get("Content-Length"),x=y?parseInt(y):0,b=x!==0;let R=0;const T=new ReadableStream({start(M){w();function w(){v.read().then(({done:D,value:N})=>{if(D)M.close();else{R+=N.byteLength;const H=new ProgressEvent("progress",{lengthComputable:b,loaded:R,total:x});for(let O=0,z=_.length;O<z;O++){const V=_[O];V.onProgress&&V.onProgress(H)}M.enqueue(N),w()}},D=>{M.error(D)})}}});return new Response(T)}else throw new Kw(`fetch for "${p.url}" responded with ${p.status}: ${p.statusText}`,p)}).then(p=>{switch(d){case"arraybuffer":return p.arrayBuffer();case"blob":return p.blob();case"document":return p.text().then(_=>new DOMParser().parseFromString(_,h));case"json":return p.json();default:if(h==="")return p.text();{const v=/charset="?([^;"\s]*)"?/i.exec(h),y=v&&v[1]?v[1].toLowerCase():void 0,x=new TextDecoder(y);return p.arrayBuffer().then(b=>x.decode(b))}}}).then(p=>{Bo.add(`file:${e}`,p);const _=El[e];delete El[e];for(let v=0,y=_.length;v<y;v++){const x=_[v];x.onLoad&&x.onLoad(p)}}).catch(p=>{const _=El[e];if(_===void 0)throw this.manager.itemError(e),p;delete El[e];for(let v=0,y=_.length;v<y;v++){const x=_[v];x.onError&&x.onError(p)}this.manager.itemError(e)}).finally(()=>{this.manager.itemEnd(e)}),this.manager.itemStart(e)}setResponseType(e){return this.responseType=e,this}setMimeType(e){return this.mimeType=e,this}abort(){return this._abortController.abort(),this._abortController=new AbortController,this}}class Ww extends Ba{constructor(e){super(e)}load(e,t,n,i){const o=this,l=new da(this.manager);l.setPath(this.path),l.setRequestHeader(this.requestHeader),l.setWithCredentials(this.withCredentials),l.load(e,function(h){try{t(o.parse(JSON.parse(h)))}catch(d){i?i(d):Zt(d),o.manager.itemError(e)}},n,i)}parse(e){const t=[];for(let n=0;n<e.length;n++){const i=Vu.parse(e[n]);t.push(i)}return t}}class jw extends Ba{constructor(e){super(e)}load(e,t,n,i){const o=this,l=[],h=new mv,d=new da(this.manager);d.setPath(this.path),d.setResponseType("arraybuffer"),d.setRequestHeader(this.requestHeader),d.setWithCredentials(o.withCredentials);let p=0;function _(v){d.load(e[v],function(y){const x=o.parse(y,!0);l[v]={width:x.width,height:x.height,format:x.format,mipmaps:x.mipmaps},p+=1,p===6&&(x.mipmapCount===1&&(h.minFilter=Cn),h.image=l,h.format=x.format,h.needsUpdate=!0,t&&t(h))},n,i)}if(Array.isArray(e))for(let v=0,y=e.length;v<y;++v)_(v);else d.load(e,function(v){const y=o.parse(v,!0);if(y.isCubemap){const x=y.mipmaps.length/y.mipmapCount;for(let b=0;b<x;b++){l[b]={mipmaps:[]};for(let R=0;R<y.mipmapCount;R++)l[b].mipmaps.push(y.mipmaps[b*y.mipmapCount+R]),l[b].format=y.format,l[b].width=y.width,l[b].height=y.height}h.image=l}else h.image.width=y.width,h.image.height=y.height,h.mipmaps=y.mipmaps;y.mipmapCount===1&&(h.minFilter=Cn),h.format=y.format,h.needsUpdate=!0,t&&t(h)},n,i);return h}}const wh=new WeakMap;class Xp extends Ba{constructor(e){super(e)}load(e,t,n,i){this.path!==void 0&&(e=this.path+e),e=this.manager.resolveURL(e);const o=this,l=Bo.get(`image:${e}`);if(l!==void 0){if(l.complete===!0)o.manager.itemStart(e),setTimeout(function(){t&&t(l),o.manager.itemEnd(e)},0);else{let v=wh.get(l);v===void 0&&(v=[],wh.set(l,v)),v.push({onLoad:t,onError:i})}return l}const h=pp("img");function d(){_(),t&&t(this);const v=wh.get(this)||[];for(let y=0;y<v.length;y++){const x=v[y];x.onLoad&&x.onLoad(this)}wh.delete(this),o.manager.itemEnd(e)}function p(v){_(),i&&i(v),Bo.remove(`image:${e}`);const y=wh.get(this)||[];for(let x=0;x<y.length;x++){const b=y[x];b.onError&&b.onError(v)}wh.delete(this),o.manager.itemError(e),o.manager.itemEnd(e)}function _(){h.removeEventListener("load",d,!1),h.removeEventListener("error",p,!1)}return h.addEventListener("load",d,!1),h.addEventListener("error",p,!1),e.slice(0,5)!=="data:"&&this.crossOrigin!==void 0&&(h.crossOrigin=this.crossOrigin),Bo.add(`image:${e}`,h),o.manager.itemStart(e),h.src=e,h}}class P1 extends Ba{constructor(e){super(e)}load(e,t,n,i){const o=new Sp;o.colorSpace=Xi;const l=new Xp(this.manager);l.setCrossOrigin(this.crossOrigin),l.setPath(this.path);let h=0;function d(p){l.load(e[p],function(_){o.images[p]=_,h++,h===6&&(o.needsUpdate=!0,t&&t(o))},void 0,i)}for(let p=0;p<e.length;++p)d(p);return o}}class cA extends Ba{constructor(e){super(e)}load(e,t,n,i){const o=this,l=new _r,h=new da(this.manager);return h.setResponseType("arraybuffer"),h.setRequestHeader(this.requestHeader),h.setPath(this.path),h.setWithCredentials(o.withCredentials),h.load(e,function(d){let p;try{p=o.parse(d)}catch(_){if(i!==void 0)i(_);else{_(_);return}}p.image!==void 0?l.image=p.image:p.data!==void 0&&(l.image.width=p.width,l.image.height=p.height,l.image.data=p.data),l.wrapS=p.wrapS!==void 0?p.wrapS:Ei,l.wrapT=p.wrapT!==void 0?p.wrapT:Ei,l.magFilter=p.magFilter!==void 0?p.magFilter:Cn,l.minFilter=p.minFilter!==void 0?p.minFilter:Cn,l.anisotropy=p.anisotropy!==void 0?p.anisotropy:1,p.colorSpace!==void 0&&(l.colorSpace=p.colorSpace),p.flipY!==void 0&&(l.flipY=p.flipY),p.format!==void 0&&(l.format=p.format),p.type!==void 0&&(l.type=p.type),p.mipmaps!==void 0&&(l.mipmaps=p.mipmaps,l.minFilter=Is),p.mipmapCount===1&&(l.minFilter=Cn),p.generateMipmaps!==void 0&&(l.generateMipmaps=p.generateMipmaps),l.needsUpdate=!0,t&&t(l,p)},n,i),l}}class uA extends Ba{constructor(e){super(e)}load(e,t,n,i){const o=new Qn,l=new Xp(this.manager);return l.setCrossOrigin(this.crossOrigin),l.setPath(this.path),l.load(e,function(h){o.image=h,o.needsUpdate=!0,t!==void 0&&t(o)},n,i),o}}class bc extends Un{constructor(e,t=1){super(),this.isLight=!0,this.type="Light",this.color=new Ct(e),this.intensity=t}dispose(){this.dispatchEvent({type:"dispose"})}copy(e,t){return super.copy(e,t),this.color.copy(e.color),this.intensity=e.intensity,this}toJSON(e){const t=super.toJSON(e);return t.object.color=this.color.getHex(),t.object.intensity=this.intensity,t}}class G1 extends bc{constructor(e,t,n){super(e,n),this.isHemisphereLight=!0,this.type="HemisphereLight",this.position.copy(Un.DEFAULT_UP),this.updateMatrix(),this.groundColor=new Ct(t)}copy(e,t){return super.copy(e,t),this.groundColor.copy(e.groundColor),this}toJSON(e){const t=super.toJSON(e);return t.object.groundColor=this.groundColor.getHex(),t}}const fA=new en,z1=new Z,V1=new Z;class hA{constructor(e){this.camera=e,this.intensity=1,this.bias=0,this.normalBias=0,this.radius=1,this.blurSamples=8,this.mapSize=new nt(512,512),this.mapType=Ta,this.map=null,this.mapPass=null,this.matrix=new en,this.autoUpdate=!0,this.needsUpdate=!1,this._frustum=new Th,this._frameExtents=new nt(1,1),this._viewportCount=1,this._viewports=[new pi(0,0,1,1)]}getViewportCount(){return this._viewportCount}getFrustum(){return this._frustum}updateMatrices(e){const t=this.camera,n=this.matrix;z1.setFromMatrixPosition(e.matrixWorld),t.position.copy(z1),V1.setFromMatrixPosition(e.target.matrixWorld),t.lookAt(V1),t.updateMatrixWorld(),fA.multiplyMatrices(t.projectionMatrix,t.matrixWorldInverse),this._frustum.setFromProjectionMatrix(fA,t.coordinateSystem,t.reversedDepth),t.reversedDepth?n.set(.5,0,0,.5,0,.5,0,.5,0,0,1,0,0,0,0,1):n.set(.5,0,0,.5,0,.5,0,.5,0,0,.5,.5,0,0,0,1),n.multiply(fA)}getViewport(e){return this._viewports[e]}getFrameExtents(){return this._frameExtents}dispose(){this.map&&this.map.dispose(),this.mapPass&&this.mapPass.dispose()}copy(e){return this.camera=e.camera.clone(),this.intensity=e.intensity,this.bias=e.bias,this.radius=e.radius,this.autoUpdate=e.autoUpdate,this.needsUpdate=e.needsUpdate,this.normalBias=e.normalBias,this.blurSamples=e.blurSamples,this.mapSize.copy(e.mapSize),this}clone(){return new this.constructor().copy(this)}toJSON(){const e={};return this.intensity!==1&&(e.intensity=this.intensity),this.bias!==0&&(e.bias=this.bias),this.normalBias!==0&&(e.normalBias=this.normalBias),this.radius!==1&&(e.radius=this.radius),(this.mapSize.x!==512||this.mapSize.y!==512)&&(e.mapSize=this.mapSize.toArray()),e.camera=this.camera.toJSON(!1).object,delete e.camera.matrix,e}}class Zw extends hA{constructor(){super(new aa(50,1,.5,500)),this.isSpotLightShadow=!0,this.focus=1,this.aspect=1}updateMatrices(e){const t=this.camera,n=nh*2*e.angle*this.focus,i=this.mapSize.width/this.mapSize.height*this.aspect,o=e.distance||t.far;(n!==t.fov||i!==t.aspect||o!==t.far)&&(t.fov=n,t.aspect=i,t.far=o,t.updateProjectionMatrix()),super.updateMatrices(e)}copy(e){return super.copy(e),this.focus=e.focus,this}}class Fv extends bc{constructor(e,t,n=0,i=Math.PI/3,o=0,l=2){super(e,t),this.isSpotLight=!0,this.type="SpotLight",this.position.copy(Un.DEFAULT_UP),this.updateMatrix(),this.target=new Un,this.distance=n,this.angle=i,this.penumbra=o,this.decay=l,this.map=null,this.shadow=new Zw}get power(){return this.intensity*Math.PI}set power(e){this.intensity=e/Math.PI}dispose(){super.dispose(),this.shadow.dispose()}copy(e,t){return super.copy(e,t),this.distance=e.distance,this.angle=e.angle,this.penumbra=e.penumbra,this.decay=e.decay,this.target=e.target.clone(),this.map=e.map,this.shadow=e.shadow.clone(),this}toJSON(e){const t=super.toJSON(e);return t.object.distance=this.distance,t.object.angle=this.angle,t.object.decay=this.decay,t.object.penumbra=this.penumbra,t.object.target=this.target.uuid,this.map&&this.map.isTexture&&(t.object.map=this.map.toJSON(e).uuid),t.object.shadow=this.shadow.toJSON(),t}}class Qw extends hA{constructor(){super(new aa(90,1,.5,500)),this.isPointLightShadow=!0}}class Hv extends bc{constructor(e,t,n=0,i=2){super(e,t),this.isPointLight=!0,this.type="PointLight",this.distance=n,this.decay=i,this.shadow=new Qw}get power(){return this.intensity*4*Math.PI}set power(e){this.intensity=e/(4*Math.PI)}dispose(){super.dispose(),this.shadow.dispose()}copy(e,t){return super.copy(e,t),this.distance=e.distance,this.decay=e.decay,this.shadow=e.shadow.clone(),this}toJSON(e){const t=super.toJSON(e);return t.object.distance=this.distance,t.object.decay=this.decay,t.object.shadow=this.shadow.toJSON(),t}}class Tl extends X0{constructor(e=-1,t=1,n=1,i=-1,o=.1,l=2e3){super(),this.isOrthographicCamera=!0,this.type="OrthographicCamera",this.zoom=1,this.view=null,this.left=e,this.right=t,this.top=n,this.bottom=i,this.near=o,this.far=l,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,n,i,o,l){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=n,this.view.offsetY=i,this.view.width=o,this.view.height=l,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),n=(this.right+this.left)/2,i=(this.top+this.bottom)/2;let o=n-e,l=n+e,h=i+t,d=i-t;if(this.view!==null&&this.view.enabled){const p=(this.right-this.left)/this.view.fullWidth/this.zoom,_=(this.top-this.bottom)/this.view.fullHeight/this.zoom;o+=p*this.view.offsetX,l=o+p*this.view.width,h-=_*this.view.offsetY,d=h-_*this.view.height}this.projectionMatrix.makeOrthographic(o,l,h,d,this.near,this.far,this.coordinateSystem,this.reversedDepth),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}}class $w extends hA{constructor(){super(new Tl(-5,5,5,-5,.5,500)),this.isDirectionalLightShadow=!0}}class Pv extends bc{constructor(e,t){super(e,t),this.isDirectionalLight=!0,this.type="DirectionalLight",this.position.copy(Un.DEFAULT_UP),this.updateMatrix(),this.target=new Un,this.shadow=new $w}dispose(){super.dispose(),this.shadow.dispose()}copy(e){return super.copy(e),this.target=e.target.clone(),this.shadow=e.shadow.clone(),this}toJSON(e){const t=super.toJSON(e);return t.object.shadow=this.shadow.toJSON(),t.object.target=this.target.uuid,t}}class k1 extends bc{constructor(e,t){super(e,t),this.isAmbientLight=!0,this.type="AmbientLight"}}class X1 extends bc{constructor(e,t,n=10,i=10){super(e,t),this.isRectAreaLight=!0,this.type="RectAreaLight",this.width=n,this.height=i}get power(){return this.intensity*this.width*this.height*Math.PI}set power(e){this.intensity=e/(this.width*this.height*Math.PI)}copy(e){return super.copy(e),this.width=e.width,this.height=e.height,this}toJSON(e){const t=super.toJSON(e);return t.object.width=this.width,t.object.height=this.height,t}}class dA{constructor(){this.isSphericalHarmonics3=!0,this.coefficients=[];for(let e=0;e<9;e++)this.coefficients.push(new Z)}set(e){for(let t=0;t<9;t++)this.coefficients[t].copy(e[t]);return this}zero(){for(let e=0;e<9;e++)this.coefficients[e].set(0,0,0);return this}getAt(e,t){const n=e.x,i=e.y,o=e.z,l=this.coefficients;return t.copy(l[0]).multiplyScalar(.282095),t.addScaledVector(l[1],.488603*i),t.addScaledVector(l[2],.488603*o),t.addScaledVector(l[3],.488603*n),t.addScaledVector(l[4],1.092548*(n*i)),t.addScaledVector(l[5],1.092548*(i*o)),t.addScaledVector(l[6],.315392*(3*o*o-1)),t.addScaledVector(l[7],1.092548*(n*o)),t.addScaledVector(l[8],.546274*(n*n-i*i)),t}getIrradianceAt(e,t){const n=e.x,i=e.y,o=e.z,l=this.coefficients;return t.copy(l[0]).multiplyScalar(.886227),t.addScaledVector(l[1],1.023328*i),t.addScaledVector(l[2],1.023328*o),t.addScaledVector(l[3],1.023328*n),t.addScaledVector(l[4],.858086*n*i),t.addScaledVector(l[5],.858086*i*o),t.addScaledVector(l[6],.743125*o*o-.247708),t.addScaledVector(l[7],.858086*n*o),t.addScaledVector(l[8],.429043*(n*n-i*i)),t}add(e){for(let t=0;t<9;t++)this.coefficients[t].add(e.coefficients[t]);return this}addScaledSH(e,t){for(let n=0;n<9;n++)this.coefficients[n].addScaledVector(e.coefficients[n],t);return this}scale(e){for(let t=0;t<9;t++)this.coefficients[t].multiplyScalar(e);return this}lerp(e,t){for(let n=0;n<9;n++)this.coefficients[n].lerp(e.coefficients[n],t);return this}equals(e){for(let t=0;t<9;t++)if(!this.coefficients[t].equals(e.coefficients[t]))return!1;return!0}copy(e){return this.set(e.coefficients)}clone(){return new this.constructor().copy(this)}fromArray(e,t=0){const n=this.coefficients;for(let i=0;i<9;i++)n[i].fromArray(e,t+i*3);return this}toArray(e=[],t=0){const n=this.coefficients;for(let i=0;i<9;i++)n[i].toArray(e,t+i*3);return e}static getBasisAt(e,t){const n=e.x,i=e.y,o=e.z;t[0]=.282095,t[1]=.488603*i,t[2]=.488603*o,t[3]=.488603*n,t[4]=1.092548*n*i,t[5]=1.092548*i*o,t[6]=.315392*(3*o*o-1),t[7]=1.092548*n*o,t[8]=.546274*(n*n-i*i)}}class Y1 extends bc{constructor(e=new dA,t=1){super(void 0,t),this.isLightProbe=!0,this.sh=e}copy(e){return super.copy(e),this.sh.copy(e.sh),this}toJSON(e){const t=super.toJSON(e);return t.object.sh=this.sh.toArray(),t}}class Gv extends Ba{constructor(e){super(e),this.textures={}}load(e,t,n,i){const o=this,l=new da(o.manager);l.setPath(o.path),l.setRequestHeader(o.requestHeader),l.setWithCredentials(o.withCredentials),l.load(e,function(h){try{t(o.parse(JSON.parse(h)))}catch(d){i?i(d):Zt(d),o.manager.itemError(e)}},n,i)}parse(e){const t=this.textures;function n(o){return t[o]===void 0&&Ut("MaterialLoader: Undefined texture",o),t[o]}const i=this.createMaterialFromType(e.type);if(e.uuid!==void 0&&(i.uuid=e.uuid),e.name!==void 0&&(i.name=e.name),e.color!==void 0&&i.color!==void 0&&i.color.setHex(e.color),e.roughness!==void 0&&(i.roughness=e.roughness),e.metalness!==void 0&&(i.metalness=e.metalness),e.sheen!==void 0&&(i.sheen=e.sheen),e.sheenColor!==void 0&&(i.sheenColor=new Ct().setHex(e.sheenColor)),e.sheenRoughness!==void 0&&(i.sheenRoughness=e.sheenRoughness),e.emissive!==void 0&&i.emissive!==void 0&&i.emissive.setHex(e.emissive),e.specular!==void 0&&i.specular!==void 0&&i.specular.setHex(e.specular),e.specularIntensity!==void 0&&(i.specularIntensity=e.specularIntensity),e.specularColor!==void 0&&i.specularColor!==void 0&&i.specularColor.setHex(e.specularColor),e.shininess!==void 0&&(i.shininess=e.shininess),e.clearcoat!==void 0&&(i.clearcoat=e.clearcoat),e.clearcoatRoughness!==void 0&&(i.clearcoatRoughness=e.clearcoatRoughness),e.dispersion!==void 0&&(i.dispersion=e.dispersion),e.iridescence!==void 0&&(i.iridescence=e.iridescence),e.iridescenceIOR!==void 0&&(i.iridescenceIOR=e.iridescenceIOR),e.iridescenceThicknessRange!==void 0&&(i.iridescenceThicknessRange=e.iridescenceThicknessRange),e.transmission!==void 0&&(i.transmission=e.transmission),e.thickness!==void 0&&(i.thickness=e.thickness),e.attenuationDistance!==void 0&&(i.attenuationDistance=e.attenuationDistance),e.attenuationColor!==void 0&&i.attenuationColor!==void 0&&i.attenuationColor.setHex(e.attenuationColor),e.anisotropy!==void 0&&(i.anisotropy=e.anisotropy),e.anisotropyRotation!==void 0&&(i.anisotropyRotation=e.anisotropyRotation),e.fog!==void 0&&(i.fog=e.fog),e.flatShading!==void 0&&(i.flatShading=e.flatShading),e.blending!==void 0&&(i.blending=e.blending),e.combine!==void 0&&(i.combine=e.combine),e.side!==void 0&&(i.side=e.side),e.shadowSide!==void 0&&(i.shadowSide=e.shadowSide),e.opacity!==void 0&&(i.opacity=e.opacity),e.transparent!==void 0&&(i.transparent=e.transparent),e.alphaTest!==void 0&&(i.alphaTest=e.alphaTest),e.alphaHash!==void 0&&(i.alphaHash=e.alphaHash),e.depthFunc!==void 0&&(i.depthFunc=e.depthFunc),e.depthTest!==void 0&&(i.depthTest=e.depthTest),e.depthWrite!==void 0&&(i.depthWrite=e.depthWrite),e.colorWrite!==void 0&&(i.colorWrite=e.colorWrite),e.blendSrc!==void 0&&(i.blendSrc=e.blendSrc),e.blendDst!==void 0&&(i.blendDst=e.blendDst),e.blendEquation!==void 0&&(i.blendEquation=e.blendEquation),e.blendSrcAlpha!==void 0&&(i.blendSrcAlpha=e.blendSrcAlpha),e.blendDstAlpha!==void 0&&(i.blendDstAlpha=e.blendDstAlpha),e.blendEquationAlpha!==void 0&&(i.blendEquationAlpha=e.blendEquationAlpha),e.blendColor!==void 0&&i.blendColor!==void 0&&i.blendColor.setHex(e.blendColor),e.blendAlpha!==void 0&&(i.blendAlpha=e.blendAlpha),e.stencilWriteMask!==void 0&&(i.stencilWriteMask=e.stencilWriteMask),e.stencilFunc!==void 0&&(i.stencilFunc=e.stencilFunc),e.stencilRef!==void 0&&(i.stencilRef=e.stencilRef),e.stencilFuncMask!==void 0&&(i.stencilFuncMask=e.stencilFuncMask),e.stencilFail!==void 0&&(i.stencilFail=e.stencilFail),e.stencilZFail!==void 0&&(i.stencilZFail=e.stencilZFail),e.stencilZPass!==void 0&&(i.stencilZPass=e.stencilZPass),e.stencilWrite!==void 0&&(i.stencilWrite=e.stencilWrite),e.wireframe!==void 0&&(i.wireframe=e.wireframe),e.wireframeLinewidth!==void 0&&(i.wireframeLinewidth=e.wireframeLinewidth),e.wireframeLinecap!==void 0&&(i.wireframeLinecap=e.wireframeLinecap),e.wireframeLinejoin!==void 0&&(i.wireframeLinejoin=e.wireframeLinejoin),e.rotation!==void 0&&(i.rotation=e.rotation),e.linewidth!==void 0&&(i.linewidth=e.linewidth),e.dashSize!==void 0&&(i.dashSize=e.dashSize),e.gapSize!==void 0&&(i.gapSize=e.gapSize),e.scale!==void 0&&(i.scale=e.scale),e.polygonOffset!==void 0&&(i.polygonOffset=e.polygonOffset),e.polygonOffsetFactor!==void 0&&(i.polygonOffsetFactor=e.polygonOffsetFactor),e.polygonOffsetUnits!==void 0&&(i.polygonOffsetUnits=e.polygonOffsetUnits),e.dithering!==void 0&&(i.dithering=e.dithering),e.alphaToCoverage!==void 0&&(i.alphaToCoverage=e.alphaToCoverage),e.premultipliedAlpha!==void 0&&(i.premultipliedAlpha=e.premultipliedAlpha),e.forceSinglePass!==void 0&&(i.forceSinglePass=e.forceSinglePass),e.allowOverride!==void 0&&(i.allowOverride=e.allowOverride),e.visible!==void 0&&(i.visible=e.visible),e.toneMapped!==void 0&&(i.toneMapped=e.toneMapped),e.userData!==void 0&&(i.userData=e.userData),e.vertexColors!==void 0&&(typeof e.vertexColors=="number"?i.vertexColors=e.vertexColors>0:i.vertexColors=e.vertexColors),e.uniforms!==void 0)for(const o in e.uniforms){const l=e.uniforms[o];switch(i.uniforms[o]={},l.type){case"t":i.uniforms[o].value=n(l.value);break;case"c":i.uniforms[o].value=new Ct().setHex(l.value);break;case"v2":i.uniforms[o].value=new nt().fromArray(l.value);break;case"v3":i.uniforms[o].value=new Z().fromArray(l.value);break;case"v4":i.uniforms[o].value=new pi().fromArray(l.value);break;case"m3":i.uniforms[o].value=new yn().fromArray(l.value);break;case"m4":i.uniforms[o].value=new en().fromArray(l.value);break;default:i.uniforms[o].value=l.value}}if(e.defines!==void 0&&(i.defines=e.defines),e.vertexShader!==void 0&&(i.vertexShader=e.vertexShader),e.fragmentShader!==void 0&&(i.fragmentShader=e.fragmentShader),e.glslVersion!==void 0&&(i.glslVersion=e.glslVersion),e.extensions!==void 0)for(const o in e.extensions)i.extensions[o]=e.extensions[o];if(e.lights!==void 0&&(i.lights=e.lights),e.clipping!==void 0&&(i.clipping=e.clipping),e.size!==void 0&&(i.size=e.size),e.sizeAttenuation!==void 0&&(i.sizeAttenuation=e.sizeAttenuation),e.map!==void 0&&(i.map=n(e.map)),e.matcap!==void 0&&(i.matcap=n(e.matcap)),e.alphaMap!==void 0&&(i.alphaMap=n(e.alphaMap)),e.bumpMap!==void 0&&(i.bumpMap=n(e.bumpMap)),e.bumpScale!==void 0&&(i.bumpScale=e.bumpScale),e.normalMap!==void 0&&(i.normalMap=n(e.normalMap)),e.normalMapType!==void 0&&(i.normalMapType=e.normalMapType),e.normalScale!==void 0){let o=e.normalScale;Array.isArray(o)===!1&&(o=[o,o]),i.normalScale=new nt().fromArray(o)}return e.displacementMap!==void 0&&(i.displacementMap=n(e.displacementMap)),e.displacementScale!==void 0&&(i.displacementScale=e.displacementScale),e.displacementBias!==void 0&&(i.displacementBias=e.displacementBias),e.roughnessMap!==void 0&&(i.roughnessMap=n(e.roughnessMap)),e.metalnessMap!==void 0&&(i.metalnessMap=n(e.metalnessMap)),e.emissiveMap!==void 0&&(i.emissiveMap=n(e.emissiveMap)),e.emissiveIntensity!==void 0&&(i.emissiveIntensity=e.emissiveIntensity),e.specularMap!==void 0&&(i.specularMap=n(e.specularMap)),e.specularIntensityMap!==void 0&&(i.specularIntensityMap=n(e.specularIntensityMap)),e.specularColorMap!==void 0&&(i.specularColorMap=n(e.specularColorMap)),e.envMap!==void 0&&(i.envMap=n(e.envMap)),e.envMapRotation!==void 0&&i.envMapRotation.fromArray(e.envMapRotation),e.envMapIntensity!==void 0&&(i.envMapIntensity=e.envMapIntensity),e.reflectivity!==void 0&&(i.reflectivity=e.reflectivity),e.refractionRatio!==void 0&&(i.refractionRatio=e.refractionRatio),e.lightMap!==void 0&&(i.lightMap=n(e.lightMap)),e.lightMapIntensity!==void 0&&(i.lightMapIntensity=e.lightMapIntensity),e.aoMap!==void 0&&(i.aoMap=n(e.aoMap)),e.aoMapIntensity!==void 0&&(i.aoMapIntensity=e.aoMapIntensity),e.gradientMap!==void 0&&(i.gradientMap=n(e.gradientMap)),e.clearcoatMap!==void 0&&(i.clearcoatMap=n(e.clearcoatMap)),e.clearcoatRoughnessMap!==void 0&&(i.clearcoatRoughnessMap=n(e.clearcoatRoughnessMap)),e.clearcoatNormalMap!==void 0&&(i.clearcoatNormalMap=n(e.clearcoatNormalMap)),e.clearcoatNormalScale!==void 0&&(i.clearcoatNormalScale=new nt().fromArray(e.clearcoatNormalScale)),e.iridescenceMap!==void 0&&(i.iridescenceMap=n(e.iridescenceMap)),e.iridescenceThicknessMap!==void 0&&(i.iridescenceThicknessMap=n(e.iridescenceThicknessMap)),e.transmissionMap!==void 0&&(i.transmissionMap=n(e.transmissionMap)),e.thicknessMap!==void 0&&(i.thicknessMap=n(e.thicknessMap)),e.anisotropyMap!==void 0&&(i.anisotropyMap=n(e.anisotropyMap)),e.sheenColorMap!==void 0&&(i.sheenColorMap=n(e.sheenColorMap)),e.sheenRoughnessMap!==void 0&&(i.sheenRoughnessMap=n(e.sheenRoughnessMap)),i}setTextures(e){return this.textures=e,this}createMaterialFromType(e){return Gv.createMaterialFromType(e)}static createMaterialFromType(e){const t={ShadowMaterial:C1,SpriteMaterial:Lx,RawShaderMaterial:nA,ShaderMaterial:ms,PointsMaterial:Np,MeshPhysicalMaterial:Ji,MeshStandardMaterial:Fu,MeshPhongMaterial:R1,MeshToonMaterial:w1,MeshNormalMaterial:B1,MeshLambertMaterial:D1,MeshDepthMaterial:iA,MeshDistanceMaterial:aA,MeshBasicMaterial:ha,MeshMatcapMaterial:N1,LineDashedMaterial:U1,LineBasicMaterial:za,Material:Yi};return new t[e]}}class nr{static extractUrlBase(e){const t=e.lastIndexOf("/");return t===-1?"./":e.slice(0,t+1)}static resolveURL(e,t){return typeof e!="string"||e===""?"":(/^https?:\/\//i.test(t)&&/^\//.test(e)&&(t=t.replace(/(^https?:\/\/[^\/]+).*/i,"$1")),/^(https?:)?\/\//i.test(e)||/^data:.*,.*$/i.test(e)||/^blob:.*$/i.test(e)?e:t+e)}}class J1 extends pn{constructor(){super(),this.isInstancedBufferGeometry=!0,this.type="InstancedBufferGeometry",this.instanceCount=1/0}copy(e){return super.copy(e),this.instanceCount=e.instanceCount,this}toJSON(){const e=super.toJSON();return e.instanceCount=this.instanceCount,e.isInstancedBufferGeometry=!0,e}}class q1 extends Ba{constructor(e){super(e)}load(e,t,n,i){const o=this,l=new da(o.manager);l.setPath(o.path),l.setRequestHeader(o.requestHeader),l.setWithCredentials(o.withCredentials),l.load(e,function(h){try{t(o.parse(JSON.parse(h)))}catch(d){i?i(d):Zt(d),o.manager.itemError(e)}},n,i)}parse(e){const t={},n={};function i(x,b){if(t[b]!==void 0)return t[b];const T=x.interleavedBuffers[b],M=o(x,T.buffer),w=eh(T.type,M),D=new yh(w,T.stride);return D.uuid=T.uuid,t[b]=D,D}function o(x,b){if(n[b]!==void 0)return n[b];const T=x.arrayBuffers[b],M=new Uint32Array(T).buffer;return n[b]=M,M}const l=e.isInstancedBufferGeometry?new J1:new pn,h=e.data.index;if(h!==void 0){const x=eh(h.type,h.array);l.setIndex(new Hn(x,1))}const d=e.data.attributes;for(const x in d){const b=d[x];let R;if(b.isInterleavedBufferAttribute){const T=i(e.data,b.data);R=new Al(T,b.itemSize,b.offset,b.normalized)}else{const T=eh(b.type,b.array),M=b.isInstancedBufferAttribute?xc:Hn;R=new M(T,b.itemSize,b.normalized)}b.name!==void 0&&(R.name=b.name),b.usage!==void 0&&R.setUsage(b.usage),l.setAttribute(x,R)}const p=e.data.morphAttributes;if(p)for(const x in p){const b=p[x],R=[];for(let T=0,M=b.length;T<M;T++){const w=b[T];let D;if(w.isInterleavedBufferAttribute){const N=i(e.data,w.data);D=new Al(N,w.itemSize,w.offset,w.normalized)}else{const N=eh(w.type,w.array);D=new Hn(N,w.itemSize,w.normalized)}w.name!==void 0&&(D.name=w.name),R.push(D)}l.morphAttributes[x]=R}e.data.morphTargetsRelative&&(l.morphTargetsRelative=!0);const v=e.data.groups||e.data.drawcalls||e.data.offsets;if(v!==void 0)for(let x=0,b=v.length;x!==b;++x){const R=v[x];l.addGroup(R.start,R.count,R.materialIndex)}const y=e.data.boundingSphere;return y!==void 0&&(l.boundingSphere=new fa().fromJSON(y)),e.name&&(l.name=e.name),e.userData&&(l.userData=e.userData),l}}class eB extends Ba{constructor(e){super(e)}load(e,t,n,i){const o=this,l=this.path===""?nr.extractUrlBase(e):this.path;this.resourcePath=this.resourcePath||l;const h=new da(this.manager);h.setPath(this.path),h.setRequestHeader(this.requestHeader),h.setWithCredentials(this.withCredentials),h.load(e,function(d){let p=null;try{p=JSON.parse(d)}catch(v){i!==void 0&&i(v),v("ObjectLoader: Can't parse "+e+".",v.message);return}const _=p.metadata;if(_===void 0||_.type===void 0||_.type.toLowerCase()==="geometry"){i!==void 0&&i(new Error("THREE.ObjectLoader: Can't load "+e)),Zt("ObjectLoader: Can't load "+e);return}o.parse(p,t)},n,i)}async loadAsync(e,t){const n=this,i=this.path===""?nr.extractUrlBase(e):this.path;this.resourcePath=this.resourcePath||i;const o=new da(this.manager);o.setPath(this.path),o.setRequestHeader(this.requestHeader),o.setWithCredentials(this.withCredentials);const l=await o.loadAsync(e,t),h=JSON.parse(l),d=h.metadata;if(d===void 0||d.type===void 0||d.type.toLowerCase()==="geometry")throw new Error("THREE.ObjectLoader: Can't load "+e);return await n.parseAsync(h)}parse(e,t){const n=this.parseAnimations(e.animations),i=this.parseShapes(e.shapes),o=this.parseGeometries(e.geometries,i),l=this.parseImages(e.images,function(){t!==void 0&&t(p)}),h=this.parseTextures(e.textures,l),d=this.parseMaterials(e.materials,h),p=this.parseObject(e.object,o,d,h,n),_=this.parseSkeletons(e.skeletons,p);if(this.bindSkeletons(p,_),this.bindLightTargets(p),t!==void 0){let v=!1;for(const y in l)if(l[y].data instanceof HTMLImageElement){v=!0;break}v===!1&&t(p)}return p}async parseAsync(e){const t=this.parseAnimations(e.animations),n=this.parseShapes(e.shapes),i=this.parseGeometries(e.geometries,n),o=await this.parseImagesAsync(e.images),l=this.parseTextures(e.textures,o),h=this.parseMaterials(e.materials,l),d=this.parseObject(e.object,i,h,l,t),p=this.parseSkeletons(e.skeletons,d);return this.bindSkeletons(d,p),this.bindLightTargets(d),d}parseShapes(e){const t={};if(e!==void 0)for(let n=0,i=e.length;n<i;n++){const o=new Ou().fromJSON(e[n]);t[o.uuid]=o}return t}parseSkeletons(e,t){const n={},i={};if(t.traverse(function(o){o.isBone&&(i[o.uuid]=o)}),e!==void 0)for(let o=0,l=e.length;o<l;o++){const h=new bh().fromJSON(e[o],i);n[h.uuid]=h}return n}parseGeometries(e,t){const n={};if(e!==void 0){const i=new q1;for(let o=0,l=e.length;o<l;o++){let h;const d=e[o];switch(d.type){case"BufferGeometry":case"InstancedBufferGeometry":h=i.parse(d);break;default:d.type in T1?h=T1[d.type].fromJSON(d,t):Ut(`ObjectLoader: Unsupported geometry type "${d.type}"`)}h.uuid=d.uuid,d.name!==void 0&&(h.name=d.name),d.userData!==void 0&&(h.userData=d.userData),n[d.uuid]=h}}return n}parseMaterials(e,t){const n={},i={};if(e!==void 0){const o=new Gv;o.setTextures(t);for(let l=0,h=e.length;l<h;l++){const d=e[l];n[d.uuid]===void 0&&(n[d.uuid]=o.parse(d)),i[d.uuid]=n[d.uuid]}}return i}parseAnimations(e){const t={};if(e!==void 0)for(let n=0;n<e.length;n++){const i=e[n],o=Vu.parse(i);t[o.uuid]=o}return t}parseImages(e,t){const n=this,i={};let o;function l(d){return n.manager.itemStart(d),o.load(d,function(){n.manager.itemEnd(d)},void 0,function(){n.manager.itemError(d),n.manager.itemEnd(d)})}function h(d){if(typeof d=="string"){const p=d,_=/^(\/\/)|([a-z]+:(\/\/)?)/i.test(p)?p:n.resourcePath+p;return l(_)}else return d.data?{data:eh(d.type,d.data),width:d.width,height:d.height}:null}if(e!==void 0&&e.length>0){const d=new Iv(t);o=new Xp(d),o.setCrossOrigin(this.crossOrigin);for(let p=0,_=e.length;p<_;p++){const v=e[p],y=v.url;if(Array.isArray(y)){const x=[];for(let b=0,R=y.length;b<R;b++){const T=y[b],M=h(T);M!==null&&(M instanceof HTMLImageElement?x.push(M):x.push(new _r(M.data,M.width,M.height)))}i[v.uuid]=new dc(x)}else{const x=h(v.url);i[v.uuid]=new dc(x)}}}return i}async parseImagesAsync(e){const t=this,n={};let i;async function o(l){if(typeof l=="string"){const h=l,d=/^(\/\/)|([a-z]+:(\/\/)?)/i.test(h)?h:t.resourcePath+h;return await i.loadAsync(d)}else return l.data?{data:eh(l.type,l.data),width:l.width,height:l.height}:null}if(e!==void 0&&e.length>0){i=new Xp(this.manager),i.setCrossOrigin(this.crossOrigin);for(let l=0,h=e.length;l<h;l++){const d=e[l],p=d.url;if(Array.isArray(p)){const _=[];for(let v=0,y=p.length;v<y;v++){const x=p[v],b=await o(x);b!==null&&(b instanceof HTMLImageElement?_.push(b):_.push(new _r(b.data,b.width,b.height)))}n[d.uuid]=new dc(_)}else{const _=await o(d.url);n[d.uuid]=new dc(_)}}}return n}parseTextures(e,t){function n(o,l){return typeof o=="number"?o:(Ut("ObjectLoader.parseTexture: Constant should be in numeric form.",o),l[o])}const i={};if(e!==void 0)for(let o=0,l=e.length;o<l;o++){const h=e[o];h.image===void 0&&Ut('ObjectLoader: No "image" specified for',h.uuid),t[h.image]===void 0&&Ut("ObjectLoader: Undefined image",h.image);const d=t[h.image],p=d.data;let _;Array.isArray(p)?(_=new Sp,p.length===6&&(_.needsUpdate=!0)):(p&&p.data?_=new _r:_=new Qn,p&&(_.needsUpdate=!0)),_.source=d,_.uuid=h.uuid,h.name!==void 0&&(_.name=h.name),h.mapping!==void 0&&(_.mapping=n(h.mapping,tB)),h.channel!==void 0&&(_.channel=h.channel),h.offset!==void 0&&_.offset.fromArray(h.offset),h.repeat!==void 0&&_.repeat.fromArray(h.repeat),h.center!==void 0&&_.center.fromArray(h.center),h.rotation!==void 0&&(_.rotation=h.rotation),h.wrap!==void 0&&(_.wrapS=n(h.wrap[0],K1),_.wrapT=n(h.wrap[1],K1)),h.format!==void 0&&(_.format=h.format),h.internalFormat!==void 0&&(_.internalFormat=h.internalFormat),h.type!==void 0&&(_.type=h.type),h.colorSpace!==void 0&&(_.colorSpace=h.colorSpace),h.minFilter!==void 0&&(_.minFilter=n(h.minFilter,W1)),h.magFilter!==void 0&&(_.magFilter=n(h.magFilter,W1)),h.anisotropy!==void 0&&(_.anisotropy=h.anisotropy),h.flipY!==void 0&&(_.flipY=h.flipY),h.generateMipmaps!==void 0&&(_.generateMipmaps=h.generateMipmaps),h.premultiplyAlpha!==void 0&&(_.premultiplyAlpha=h.premultiplyAlpha),h.unpackAlignment!==void 0&&(_.unpackAlignment=h.unpackAlignment),h.compareFunction!==void 0&&(_.compareFunction=h.compareFunction),h.userData!==void 0&&(_.userData=h.userData),i[h.uuid]=_}return i}parseObject(e,t,n,i,o){let l;function h(y){return t[y]===void 0&&Ut("ObjectLoader: Undefined geometry",y),t[y]}function d(y){if(y!==void 0){if(Array.isArray(y)){const x=[];for(let b=0,R=y.length;b<R;b++){const T=y[b];n[T]===void 0&&Ut("ObjectLoader: Undefined material",T),x.push(n[T])}return x}return n[y]===void 0&&Ut("ObjectLoader: Undefined material",y),n[y]}}function p(y){return i[y]===void 0&&Ut("ObjectLoader: Undefined texture",y),i[y]}let _,v;switch(e.type){case"Scene":l=new Mp,e.background!==void 0&&(Number.isInteger(e.background)?l.background=new Ct(e.background):l.background=p(e.background)),e.environment!==void 0&&(l.environment=p(e.environment)),e.fog!==void 0&&(e.fog.type==="Fog"?l.fog=new K0(e.fog.color,e.fog.near,e.fog.far):e.fog.type==="FogExp2"&&(l.fog=new q0(e.fog.color,e.fog.density)),e.fog.name!==""&&(l.fog.name=e.fog.name)),e.backgroundBlurriness!==void 0&&(l.backgroundBlurriness=e.backgroundBlurriness),e.backgroundIntensity!==void 0&&(l.backgroundIntensity=e.backgroundIntensity),e.backgroundRotation!==void 0&&l.backgroundRotation.fromArray(e.backgroundRotation),e.environmentIntensity!==void 0&&(l.environmentIntensity=e.environmentIntensity),e.environmentRotation!==void 0&&l.environmentRotation.fromArray(e.environmentRotation);break;case"PerspectiveCamera":l=new aa(e.fov,e.aspect,e.near,e.far),e.focus!==void 0&&(l.focus=e.focus),e.zoom!==void 0&&(l.zoom=e.zoom),e.filmGauge!==void 0&&(l.filmGauge=e.filmGauge),e.filmOffset!==void 0&&(l.filmOffset=e.filmOffset),e.view!==void 0&&(l.view=Object.assign({},e.view));break;case"OrthographicCamera":l=new Tl(e.left,e.right,e.top,e.bottom,e.near,e.far),e.zoom!==void 0&&(l.zoom=e.zoom),e.view!==void 0&&(l.view=Object.assign({},e.view));break;case"AmbientLight":l=new k1(e.color,e.intensity);break;case"DirectionalLight":l=new Pv(e.color,e.intensity),l.target=e.target||"";break;case"PointLight":l=new Hv(e.color,e.intensity,e.distance,e.decay);break;case"RectAreaLight":l=new X1(e.color,e.intensity,e.width,e.height);break;case"SpotLight":l=new Fv(e.color,e.intensity,e.distance,e.angle,e.penumbra,e.decay),l.target=e.target||"";break;case"HemisphereLight":l=new G1(e.color,e.groundColor,e.intensity);break;case"LightProbe":const y=new dA().fromArray(e.sh);l=new Y1(y,e.intensity);break;case"SkinnedMesh":_=h(e.geometry),v=d(e.material),l=new ev(_,v),e.bindMode!==void 0&&(l.bindMode=e.bindMode),e.bindMatrix!==void 0&&l.bindMatrix.fromArray(e.bindMatrix),e.skeleton!==void 0&&(l.skeleton=e.skeleton);break;case"Mesh":_=h(e.geometry),v=d(e.material),l=new yi(_,v);break;case"InstancedMesh":_=h(e.geometry),v=d(e.material);const x=e.count,b=e.instanceMatrix,R=e.instanceColor;l=new nv(_,v,x),l.instanceMatrix=new xc(new Float32Array(b.array),16),R!==void 0&&(l.instanceColor=new xc(new Float32Array(R.array),R.itemSize));break;case"BatchedMesh":_=h(e.geometry),v=d(e.material),l=new t1(e.maxInstanceCount,e.maxVertexCount,e.maxIndexCount,v),l.geometry=_,l.perObjectFrustumCulled=e.perObjectFrustumCulled,l.sortObjects=e.sortObjects,l._drawRanges=e.drawRanges,l._reservedRanges=e.reservedRanges,l._geometryInfo=e.geometryInfo.map(T=>{let M=null,w=null;return T.boundingBox!==void 0&&(M=new Ra().fromJSON(T.boundingBox)),T.boundingSphere!==void 0&&(w=new fa().fromJSON(T.boundingSphere)),{...T,boundingBox:M,boundingSphere:w}}),l._instanceInfo=e.instanceInfo,l._availableInstanceIds=e._availableInstanceIds,l._availableGeometryIds=e._availableGeometryIds,l._nextIndexStart=e.nextIndexStart,l._nextVertexStart=e.nextVertexStart,l._geometryCount=e.geometryCount,l._maxInstanceCount=e.maxInstanceCount,l._maxVertexCount=e.maxVertexCount,l._maxIndexCount=e.maxIndexCount,l._geometryInitialized=e.geometryInitialized,l._matricesTexture=p(e.matricesTexture.uuid),l._indirectTexture=p(e.indirectTexture.uuid),e.colorsTexture!==void 0&&(l._colorsTexture=p(e.colorsTexture.uuid)),e.boundingSphere!==void 0&&(l.boundingSphere=new fa().fromJSON(e.boundingSphere)),e.boundingBox!==void 0&&(l.boundingBox=new Ra().fromJSON(e.boundingBox));break;case"LOD":l=new Xb;break;case"Line":l=new wo(h(e.geometry),d(e.material));break;case"LineLoop":l=new fv(h(e.geometry),d(e.material));break;case"LineSegments":l=new yr(h(e.geometry),d(e.material));break;case"PointCloud":case"Points":l=new pv(h(e.geometry),d(e.material));break;case"Sprite":l=new Vb(d(e.material));break;case"Group":l=new vr;break;case"Bone":l=new Cp;break;default:l=new Un}if(l.uuid=e.uuid,e.name!==void 0&&(l.name=e.name),e.matrix!==void 0?(l.matrix.fromArray(e.matrix),e.matrixAutoUpdate!==void 0&&(l.matrixAutoUpdate=e.matrixAutoUpdate),l.matrixAutoUpdate&&l.matrix.decompose(l.position,l.quaternion,l.scale)):(e.position!==void 0&&l.position.fromArray(e.position),e.rotation!==void 0&&l.rotation.fromArray(e.rotation),e.quaternion!==void 0&&l.quaternion.fromArray(e.quaternion),e.scale!==void 0&&l.scale.fromArray(e.scale)),e.up!==void 0&&l.up.fromArray(e.up),e.castShadow!==void 0&&(l.castShadow=e.castShadow),e.receiveShadow!==void 0&&(l.receiveShadow=e.receiveShadow),e.shadow&&(e.shadow.intensity!==void 0&&(l.shadow.intensity=e.shadow.intensity),e.shadow.bias!==void 0&&(l.shadow.bias=e.shadow.bias),e.shadow.normalBias!==void 0&&(l.shadow.normalBias=e.shadow.normalBias),e.shadow.radius!==void 0&&(l.shadow.radius=e.shadow.radius),e.shadow.mapSize!==void 0&&l.shadow.mapSize.fromArray(e.shadow.mapSize),e.shadow.camera!==void 0&&(l.shadow.camera=this.parseObject(e.shadow.camera))),e.visible!==void 0&&(l.visible=e.visible),e.frustumCulled!==void 0&&(l.frustumCulled=e.frustumCulled),e.renderOrder!==void 0&&(l.renderOrder=e.renderOrder),e.userData!==void 0&&(l.userData=e.userData),e.layers!==void 0&&(l.layers.mask=e.layers),e.children!==void 0){const y=e.children;for(let x=0;x<y.length;x++)l.add(this.parseObject(y[x],t,n,i,o))}if(e.animations!==void 0){const y=e.animations;for(let x=0;x<y.length;x++){const b=y[x];l.animations.push(o[b])}}if(e.type==="LOD"){e.autoUpdate!==void 0&&(l.autoUpdate=e.autoUpdate);const y=e.levels;for(let x=0;x<y.length;x++){const b=y[x],R=l.getObjectByProperty("uuid",b.object);R!==void 0&&l.addLevel(R,b.distance,b.hysteresis)}}return l}bindSkeletons(e,t){Object.keys(t).length!==0&&e.traverse(function(n){if(n.isSkinnedMesh===!0&&n.skeleton!==void 0){const i=t[n.skeleton];i===void 0?Ut("ObjectLoader: No skeleton found with UUID:",n.skeleton):n.bind(i,n.bindMatrix)}})}bindLightTargets(e){e.traverse(function(t){if(t.isDirectionalLight||t.isSpotLight){const n=t.target,i=e.getObjectByProperty("uuid",n);i!==void 0?t.target=i:t.target=new Un}})}}const tB={UVMapping:rc,CubeReflectionMapping:qr,CubeRefractionMapping:oc,EquirectangularReflectionMapping:Wf,EquirectangularRefractionMapping:ep,CubeUVReflectionMapping:jf},K1={RepeatWrapping:Kr,ClampToEdgeWrapping:Ei,MirroredRepeatWrapping:_u},W1={NearestFilter:Ti,NearestMipmapNearestFilter:tp,NearestMipmapLinearFilter:lc,LinearFilter:Cn,LinearMipmapNearestFilter:yu,LinearMipmapLinearFilter:Is},pA=new WeakMap;class mA extends Ba{constructor(e){super(e),this.isImageBitmapLoader=!0,typeof createImageBitmap>"u"&&Ut("ImageBitmapLoader: createImageBitmap() not supported."),typeof fetch>"u"&&Ut("ImageBitmapLoader: fetch() not supported."),this.options={premultiplyAlpha:"none"},this._abortController=new AbortController}setOptions(e){return this.options=e,this}load(e,t,n,i){e===void 0&&(e=""),this.path!==void 0&&(e=this.path+e),e=this.manager.resolveURL(e);const o=this,l=Bo.get(`image-bitmap:${e}`);if(l!==void 0){if(o.manager.itemStart(e),l.then){l.then(p=>{if(pA.has(l)===!0)i&&i(pA.get(l)),o.manager.itemError(e),o.manager.itemEnd(e);else return t&&t(p),o.manager.itemEnd(e),p});return}return setTimeout(function(){t&&t(l),o.manager.itemEnd(e)},0),l}const h={};h.credentials=this.crossOrigin==="anonymous"?"same-origin":"include",h.headers=this.requestHeader,h.signal=typeof AbortSignal.any=="function"?AbortSignal.any([this._abortController.signal,this.manager.abortController.signal]):this._abortController.signal;const d=fetch(e,h).then(function(p){return p.blob()}).then(function(p){return createImageBitmap(p,Object.assign(o.options,{colorSpaceConversion:"none"}))}).then(function(p){return Bo.add(`image-bitmap:${e}`,p),t&&t(p),o.manager.itemEnd(e),p}).catch(function(p){i&&i(p),pA.set(d,p),Bo.remove(`image-bitmap:${e}`),o.manager.itemError(e),o.manager.itemEnd(e)});Bo.add(`image-bitmap:${e}`,d),o.manager.itemStart(e)}abort(){return this._abortController.abort(),this._abortController=new AbortController,this}}let zv;class gA{static getContext(){return zv===void 0&&(zv=new(window.AudioContext||window.webkitAudioContext)),zv}static setContext(e){zv=e}}class nB extends Ba{constructor(e){super(e)}load(e,t,n,i){const o=this,l=new da(this.manager);l.setResponseType("arraybuffer"),l.setPath(this.path),l.setRequestHeader(this.requestHeader),l.setWithCredentials(this.withCredentials),l.load(e,function(d){try{const p=d.slice(0);gA.getContext().decodeAudioData(p,function(v){t(v)}).catch(h)}catch(p){h(p)}},n,i);function h(d){i?i(d):Zt(d),o.manager.itemError(e)}}}const j1=new en,Z1=new en,ku=new en;class iB{constructor(){this.type="StereoCamera",this.aspect=1,this.eyeSep=.064,this.cameraL=new aa,this.cameraL.layers.enable(1),this.cameraL.matrixAutoUpdate=!1,this.cameraR=new aa,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,ku.copy(e.projectionMatrix);const i=t.eyeSep/2,o=i*t.near/t.focus,l=t.near*Math.tan(Tu*t.fov*.5)/t.zoom;let h,d;Z1.elements[12]=-i,j1.elements[12]=i,h=-l*t.aspect+o,d=l*t.aspect+o,ku.elements[0]=2*t.near/(d-h),ku.elements[8]=(d+h)/(d-h),this.cameraL.projectionMatrix.copy(ku),h=-l*t.aspect-o,d=l*t.aspect-o,ku.elements[0]=2*t.near/(d-h),ku.elements[8]=(d+h)/(d-h),this.cameraR.projectionMatrix.copy(ku)}this.cameraL.matrixWorld.copy(e.matrixWorld).multiply(Z1),this.cameraR.matrixWorld.copy(e.matrixWorld).multiply(j1)}}class Q1 extends aa{constructor(e=[]){super(),this.isArrayCamera=!0,this.isMultiViewCamera=!1,this.cameras=e}}class vA{constructor(e=!0){this.autoStart=e,this.startTime=0,this.oldTime=0,this.elapsedTime=0,this.running=!1}start(){this.startTime=performance.now(),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=performance.now();e=(t-this.oldTime)/1e3,this.oldTime=t,this.elapsedTime+=e}return e}}const Xu=new Z,_A=new Ca,aB=new Z,Yu=new Z,Ju=new Z;class sB extends Un{constructor(){super(),this.type="AudioListener",this.context=gA.getContext(),this.gain=this.context.createGain(),this.gain.connect(this.context.destination),this.filter=null,this.timeDelta=0,this._clock=new vA}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;if(this.timeDelta=this._clock.getDelta(),this.matrixWorld.decompose(Xu,_A,aB),Yu.set(0,0,-1).applyQuaternion(_A),Ju.set(0,1,0).applyQuaternion(_A),t.positionX){const n=this.context.currentTime+this.timeDelta;t.positionX.linearRampToValueAtTime(Xu.x,n),t.positionY.linearRampToValueAtTime(Xu.y,n),t.positionZ.linearRampToValueAtTime(Xu.z,n),t.forwardX.linearRampToValueAtTime(Yu.x,n),t.forwardY.linearRampToValueAtTime(Yu.y,n),t.forwardZ.linearRampToValueAtTime(Yu.z,n),t.upX.linearRampToValueAtTime(Ju.x,n),t.upY.linearRampToValueAtTime(Ju.y,n),t.upZ.linearRampToValueAtTime(Ju.z,n)}else t.setPosition(Xu.x,Xu.y,Xu.z),t.setOrientation(Yu.x,Yu.y,Yu.z,Ju.x,Ju.y,Ju.z)}}class $1 extends Un{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){Ut("Audio: Audio is already playing.");return}if(this.hasPlaybackControl===!1){Ut("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){Ut("Audio: this Audio has no playback control.");return}return this.isPlaying===!0&&(this._progress+=Math.max(this.context.currentTime-this._startedAt,0)*this.playbackRate,this.loop===!0&&(this._progress=this._progress%(this.duration||this.buffer.duration)),this.source.stop(),this.source.onended=null,this.isPlaying=!1),this}stop(e=0){if(this.hasPlaybackControl===!1){Ut("Audio: this Audio has no playback control.");return}return this._progress=0,this.source!==null&&(this.source.stop(this.context.currentTime+e),this.source.onended=null),this.isPlaying=!1,this}connect(){if(this.filters.length>0){this.source.connect(this.filters[0]);for(let e=1,t=this.filters.length;e<t;e++)this.filters[e-1].connect(this.filters[e]);this.filters[this.filters.length-1].connect(this.getOutput())}else this.source.connect(this.getOutput());return this._connected=!0,this}disconnect(){if(this._connected!==!1){if(this.filters.length>0){this.source.disconnect(this.filters[0]);for(let e=1,t=this.filters.length;e<t;e++)this.filters[e-1].disconnect(this.filters[e]);this.filters[this.filters.length-1].disconnect(this.getOutput())}else this.source.disconnect(this.getOutput());return this._connected=!1,this}}getFilters(){return this.filters}setFilters(e){return e||(e=[]),this._connected===!0?(this.disconnect(),this.filters=e.slice(),this.connect()):this.filters=e.slice(),this}setDetune(e){return this.detune=e,this.isPlaying===!0&&this.source.detune!==void 0&&this.source.detune.setTargetAtTime(this.detune,this.context.currentTime,.01),this}getDetune(){return this.detune}getFilter(){return this.getFilters()[0]}setFilter(e){return this.setFilters(e?[e]:[])}setPlaybackRate(e){if(this.hasPlaybackControl===!1){Ut("Audio: this Audio has no playback control.");return}return this.playbackRate=e,this.isPlaying===!0&&this.source.playbackRate.setTargetAtTime(this.playbackRate,this.context.currentTime,.01),this}getPlaybackRate(){return this.playbackRate}onEnded(){this.isPlaying=!1,this._progress=0}getLoop(){return this.hasPlaybackControl===!1?(Ut("Audio: this Audio has no playback control."),!1):this.loop}setLoop(e){if(this.hasPlaybackControl===!1){Ut("Audio: this Audio has no playback control.");return}return this.loop=e,this.isPlaying===!0&&(this.source.loop=this.loop),this}setLoopStart(e){return this.loopStart=e,this}setLoopEnd(e){return this.loopEnd=e,this}getVolume(){return this.gain.gain.value}setVolume(e){return this.gain.gain.setTargetAtTime(e,this.context.currentTime,.01),this}copy(e,t){return super.copy(e,t),e.sourceType!=="buffer"?(Ut("Audio: Audio source type cannot be copied."),this):(this.autoplay=e.autoplay,this.buffer=e.buffer,this.detune=e.detune,this.loop=e.loop,this.loopStart=e.loopStart,this.loopEnd=e.loopEnd,this.offset=e.offset,this.duration=e.duration,this.playbackRate=e.playbackRate,this.hasPlaybackControl=e.hasPlaybackControl,this.sourceType=e.sourceType,this.filters=e.filters.slice(),this)}clone(e){return new this.constructor(this.listener).copy(this,e)}}const qu=new Z,eE=new Ca,rB=new Z,Ku=new Z;class oB extends $1{constructor(e){super(e),this.panner=this.context.createPanner(),this.panner.panningModel="HRTF",this.panner.connect(this.gain)}connect(){return super.connect(),this.panner.connect(this.gain),this}disconnect(){return super.disconnect(),this.panner.disconnect(this.gain),this}getOutput(){return this.panner}getRefDistance(){return this.panner.refDistance}setRefDistance(e){return this.panner.refDistance=e,this}getRolloffFactor(){return this.panner.rolloffFactor}setRolloffFactor(e){return this.panner.rolloffFactor=e,this}getDistanceModel(){return this.panner.distanceModel}setDistanceModel(e){return this.panner.distanceModel=e,this}getMaxDistance(){return this.panner.maxDistance}setMaxDistance(e){return this.panner.maxDistance=e,this}setDirectionalCone(e,t,n){return this.panner.coneInnerAngle=e,this.panner.coneOuterAngle=t,this.panner.coneOuterGain=n,this}updateMatrixWorld(e){if(super.updateMatrixWorld(e),this.hasPlaybackControl===!0&&this.isPlaying===!1)return;this.matrixWorld.decompose(qu,eE,rB),Ku.set(0,0,1).applyQuaternion(eE);const t=this.panner;if(t.positionX){const n=this.context.currentTime+this.listener.timeDelta;t.positionX.linearRampToValueAtTime(qu.x,n),t.positionY.linearRampToValueAtTime(qu.y,n),t.positionZ.linearRampToValueAtTime(qu.z,n),t.orientationX.linearRampToValueAtTime(Ku.x,n),t.orientationY.linearRampToValueAtTime(Ku.y,n),t.orientationZ.linearRampToValueAtTime(Ku.z,n)}else t.setPosition(qu.x,qu.y,qu.z),t.setOrientation(Ku.x,Ku.y,Ku.z)}}class lB{constructor(e,t=2048){this.analyser=e.context.createAnalyser(),this.analyser.fftSize=t,this.data=new Uint8Array(this.analyser.frequencyBinCount),e.getOutput().connect(this.analyser)}getFrequencyData(){return this.analyser.getByteFrequencyData(this.data),this.data}getAverageFrequency(){let e=0;const t=this.getFrequencyData();for(let n=0;n<t.length;n++)e+=t[n];return e/t.length}}class tE{constructor(e,t,n){this.binding=e,this.valueSize=n;let i,o,l;switch(t){case"quaternion":i=this._slerp,o=this._slerpAdditive,l=this._setAdditiveIdentityQuaternion,this.buffer=new Float64Array(n*6),this._workIndex=5;break;case"string":case"bool":i=this._select,o=this._select,l=this._setAdditiveIdentityOther,this.buffer=new Array(n*5);break;default:i=this._lerp,o=this._lerpAdditive,l=this._setAdditiveIdentityNumeric,this.buffer=new Float64Array(n*5)}this._mixBufferRegion=i,this._mixBufferRegionAdditive=o,this._setIdentity=l,this._origIndex=3,this._addIndex=4,this.cumulativeWeight=0,this.cumulativeWeightAdditive=0,this.useCount=0,this.referenceCount=0}accumulate(e,t){const n=this.buffer,i=this.valueSize,o=e*i+i;let l=this.cumulativeWeight;if(l===0){for(let h=0;h!==i;++h)n[o+h]=n[h];l=t}else{l+=t;const h=t/l;this._mixBufferRegion(n,o,0,h,i)}this.cumulativeWeight=l}accumulateAdditive(e){const t=this.buffer,n=this.valueSize,i=n*this._addIndex;this.cumulativeWeightAdditive===0&&this._setIdentity(),this._mixBufferRegionAdditive(t,i,0,e,n),this.cumulativeWeightAdditive+=e}apply(e){const t=this.valueSize,n=this.buffer,i=e*t+t,o=this.cumulativeWeight,l=this.cumulativeWeightAdditive,h=this.binding;if(this.cumulativeWeight=0,this.cumulativeWeightAdditive=0,o<1){const d=t*this._origIndex;this._mixBufferRegion(n,i,d,1-o,t)}l>0&&this._mixBufferRegionAdditive(n,i,this._addIndex*t,1,t);for(let d=t,p=t+t;d!==p;++d)if(n[d]!==n[d+t]){h.setValue(n,i);break}}saveOriginalState(){const e=this.binding,t=this.buffer,n=this.valueSize,i=n*this._origIndex;e.getValue(t,i);for(let o=n,l=i;o!==l;++o)t[o]=t[i+o%n];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 n=e;n<t;n++)this.buffer[n]=0}_setAdditiveIdentityQuaternion(){this._setAdditiveIdentityNumeric(),this.buffer[this._addIndex*this.valueSize+3]=1}_setAdditiveIdentityOther(){const e=this._origIndex*this.valueSize,t=this._addIndex*this.valueSize;for(let n=0;n<this.valueSize;n++)this.buffer[t+n]=this.buffer[e+n]}_select(e,t,n,i,o){if(i>=.5)for(let l=0;l!==o;++l)e[t+l]=e[n+l]}_slerp(e,t,n,i){Ca.slerpFlat(e,t,e,t,e,n,i)}_slerpAdditive(e,t,n,i,o){const l=this._workIndex*o;Ca.multiplyQuaternionsFlat(e,l,e,t,e,n),Ca.slerpFlat(e,t,e,t,e,l,i)}_lerp(e,t,n,i,o){const l=1-i;for(let h=0;h!==o;++h){const d=t+h;e[d]=e[d]*l+e[n+h]*i}}_lerpAdditive(e,t,n,i,o){for(let l=0;l!==o;++l){const h=t+l;e[h]=e[h]+e[n+l]*i}}}const yA="\\[\\]\\.:\\/",cB=new RegExp("["+yA+"]","g"),xA="[^"+yA+"]",uB="[^"+yA.replace("\\.","")+"]",fB=/((?:WC+[\/:])*)/.source.replace("WC",xA),hB=/(WCOD+)?/.source.replace("WCOD",uB),dB=/(?:\.(WC+)(?:\[(.+)\])?)?/.source.replace("WC",xA),pB=/\.(WC+)(?:\[(.+)\])?/.source.replace("WC",xA),mB=new RegExp("^"+fB+hB+dB+pB+"$"),gB=["material","materials","bones","map"];class vB{constructor(e,t,n){const i=n||kn.parseTrackName(t);this._targetGroup=e,this._bindings=e.subscribe_(t,i)}getValue(e,t){this.bind();const n=this._targetGroup.nCachedObjects_,i=this._bindings[n];i!==void 0&&i.getValue(e,t)}setValue(e,t){const n=this._bindings;for(let i=this._targetGroup.nCachedObjects_,o=n.length;i!==o;++i)n[i].setValue(e,t)}bind(){const e=this._bindings;for(let t=this._targetGroup.nCachedObjects_,n=e.length;t!==n;++t)e[t].bind()}unbind(){const e=this._bindings;for(let t=this._targetGroup.nCachedObjects_,n=e.length;t!==n;++t)e[t].unbind()}}class kn{constructor(e,t,n){this.path=t,this.parsedPath=n||kn.parseTrackName(t),this.node=kn.findNode(e,this.parsedPath.nodeName),this.rootNode=e,this.getValue=this._getValue_unbound,this.setValue=this._setValue_unbound}static create(e,t,n){return e&&e.isAnimationObjectGroup?new kn.Composite(e,t,n):new kn(e,t,n)}static sanitizeNodeName(e){return e.replace(/\s/g,"_").replace(cB,"")}static parseTrackName(e){const t=mB.exec(e);if(t===null)throw new Error("PropertyBinding: Cannot parse trackName: "+e);const n={nodeName:t[2],objectName:t[3],objectIndex:t[4],propertyName:t[5],propertyIndex:t[6]},i=n.nodeName&&n.nodeName.lastIndexOf(".");if(i!==void 0&&i!==-1){const o=n.nodeName.substring(i+1);gB.indexOf(o)!==-1&&(n.nodeName=n.nodeName.substring(0,i),n.objectName=o)}if(n.propertyName===null||n.propertyName.length===0)throw new Error("PropertyBinding: can not parse propertyName from trackName: "+e);return n}static findNode(e,t){if(t===void 0||t===""||t==="."||t===-1||t===e.name||t===e.uuid)return e;if(e.skeleton){const n=e.skeleton.getBoneByName(t);if(n!==void 0)return n}if(e.children){const n=function(o){for(let l=0;l<o.length;l++){const h=o[l];if(h.name===t||h.uuid===t)return h;const d=n(h.children);if(d)return d}return null},i=n(e.children);if(i)return i}return null}_getValue_unavailable(){}_setValue_unavailable(){}_getValue_direct(e,t){e[t]=this.targetObject[this.propertyName]}_getValue_array(e,t){const n=this.resolvedProperty;for(let i=0,o=n.length;i!==o;++i)e[t++]=n[i]}_getValue_arrayElement(e,t){e[t]=this.resolvedProperty[this.propertyIndex]}_getValue_toArray(e,t){this.resolvedProperty.toArray(e,t)}_setValue_direct(e,t){this.targetObject[this.propertyName]=e[t]}_setValue_direct_setNeedsUpdate(e,t){this.targetObject[this.propertyName]=e[t],this.targetObject.needsUpdate=!0}_setValue_direct_setMatrixWorldNeedsUpdate(e,t){this.targetObject[this.propertyName]=e[t],this.targetObject.matrixWorldNeedsUpdate=!0}_setValue_array(e,t){const n=this.resolvedProperty;for(let i=0,o=n.length;i!==o;++i)n[i]=e[t++]}_setValue_array_setNeedsUpdate(e,t){const n=this.resolvedProperty;for(let i=0,o=n.length;i!==o;++i)n[i]=e[t++];this.targetObject.needsUpdate=!0}_setValue_array_setMatrixWorldNeedsUpdate(e,t){const n=this.resolvedProperty;for(let i=0,o=n.length;i!==o;++i)n[i]=e[t++];this.targetObject.matrixWorldNeedsUpdate=!0}_setValue_arrayElement(e,t){this.resolvedProperty[this.propertyIndex]=e[t]}_setValue_arrayElement_setNeedsUpdate(e,t){this.resolvedProperty[this.propertyIndex]=e[t],this.targetObject.needsUpdate=!0}_setValue_arrayElement_setMatrixWorldNeedsUpdate(e,t){this.resolvedProperty[this.propertyIndex]=e[t],this.targetObject.matrixWorldNeedsUpdate=!0}_setValue_fromArray(e,t){this.resolvedProperty.fromArray(e,t)}_setValue_fromArray_setNeedsUpdate(e,t){this.resolvedProperty.fromArray(e,t),this.targetObject.needsUpdate=!0}_setValue_fromArray_setMatrixWorldNeedsUpdate(e,t){this.resolvedProperty.fromArray(e,t),this.targetObject.matrixWorldNeedsUpdate=!0}_getValue_unbound(e,t){this.bind(),this.getValue(e,t)}_setValue_unbound(e,t){this.bind(),this.setValue(e,t)}bind(){let e=this.node;const t=this.parsedPath,n=t.objectName,i=t.propertyName;let o=t.propertyIndex;if(e||(e=kn.findNode(this.rootNode,t.nodeName),this.node=e),this.getValue=this._getValue_unavailable,this.setValue=this._setValue_unavailable,!e){Ut("PropertyBinding: No target node found for track: "+this.path+".");return}if(n){let p=t.objectIndex;switch(n){case"materials":if(!e.material){Zt("PropertyBinding: Can not bind to material as node does not have a material.",this);return}if(!e.material.materials){Zt("PropertyBinding: Can not bind to material.materials as node.material does not have a materials array.",this);return}e=e.material.materials;break;case"bones":if(!e.skeleton){Zt("PropertyBinding: Can not bind to bones as node does not have a skeleton.",this);return}e=e.skeleton.bones;for(let _=0;_<e.length;_++)if(e[_].name===p){p=_;break}break;case"map":if("map"in e){e=e.map;break}if(!e.material){Zt("PropertyBinding: Can not bind to material as node does not have a material.",this);return}if(!e.material.map){Zt("PropertyBinding: Can not bind to material.map as node.material does not have a map.",this);return}e=e.material.map;break;default:if(e[n]===void 0){Zt("PropertyBinding: Can not bind to objectName of node undefined.",this);return}e=e[n]}if(p!==void 0){if(e[p]===void 0){Zt("PropertyBinding: Trying to bind to objectIndex of objectName, but is undefined.",this,e);return}e=e[p]}}const l=e[i];if(l===void 0){const p=t.nodeName;Zt("PropertyBinding: Trying to update property for track: "+p+"."+i+" but it wasn't found.",e);return}let h=this.Versioning.None;this.targetObject=e,e.isMaterial===!0?h=this.Versioning.NeedsUpdate:e.isObject3D===!0&&(h=this.Versioning.MatrixWorldNeedsUpdate);let d=this.BindingType.Direct;if(o!==void 0){if(i==="morphTargetInfluences"){if(!e.geometry){Zt("PropertyBinding: Can not bind to morphTargetInfluences because node does not have a geometry.",this);return}if(!e.geometry.morphAttributes){Zt("PropertyBinding: Can not bind to morphTargetInfluences because node does not have a geometry.morphAttributes.",this);return}e.morphTargetDictionary[o]!==void 0&&(o=e.morphTargetDictionary[o])}d=this.BindingType.ArrayElement,this.resolvedProperty=l,this.propertyIndex=o}else l.fromArray!==void 0&&l.toArray!==void 0?(d=this.BindingType.HasFromToArray,this.resolvedProperty=l):Array.isArray(l)?(d=this.BindingType.EntireArray,this.resolvedProperty=l):this.propertyName=i;this.getValue=this.GetterByBindingType[d],this.setValue=this.SetterByBindingTypeAndVersioning[d][h]}unbind(){this.node=null,this.getValue=this._getValue_unbound,this.setValue=this._setValue_unbound}}kn.Composite=vB,kn.prototype.BindingType={Direct:0,EntireArray:1,ArrayElement:2,HasFromToArray:3},kn.prototype.Versioning={None:0,NeedsUpdate:1,MatrixWorldNeedsUpdate:2},kn.prototype.GetterByBindingType=[kn.prototype._getValue_direct,kn.prototype._getValue_array,kn.prototype._getValue_arrayElement,kn.prototype._getValue_toArray],kn.prototype.SetterByBindingTypeAndVersioning=[[kn.prototype._setValue_direct,kn.prototype._setValue_direct_setNeedsUpdate,kn.prototype._setValue_direct_setMatrixWorldNeedsUpdate],[kn.prototype._setValue_array,kn.prototype._setValue_array_setNeedsUpdate,kn.prototype._setValue_array_setMatrixWorldNeedsUpdate],[kn.prototype._setValue_arrayElement,kn.prototype._setValue_arrayElement_setNeedsUpdate,kn.prototype._setValue_arrayElement_setMatrixWorldNeedsUpdate],[kn.prototype._setValue_fromArray,kn.prototype._setValue_fromArray_setNeedsUpdate,kn.prototype._setValue_fromArray_setMatrixWorldNeedsUpdate]];class _B{constructor(){this.isAnimationObjectGroup=!0,this.uuid=Qs(),this._objects=Array.prototype.slice.call(arguments),this.nCachedObjects_=0;const e={};this._indicesByUUID=e;for(let n=0,i=arguments.length;n!==i;++n)e[arguments[n].uuid]=n;this._paths=[],this._parsedPaths=[],this._bindings=[],this._bindingsIndicesByPath={};const t=this;this.stats={objects:{get total(){return t._objects.length},get inUse(){return this.total-t.nCachedObjects_}},get bindingsPerObject(){return t._bindings.length}}}add(){const e=this._objects,t=this._indicesByUUID,n=this._paths,i=this._parsedPaths,o=this._bindings,l=o.length;let h,d=e.length,p=this.nCachedObjects_;for(let _=0,v=arguments.length;_!==v;++_){const y=arguments[_],x=y.uuid;let b=t[x];if(b===void 0){b=d++,t[x]=b,e.push(y);for(let R=0,T=l;R!==T;++R)o[R].push(new kn(y,n[R],i[R]))}else if(b<p){h=e[b];const R=--p,T=e[R];t[T.uuid]=b,e[b]=T,t[x]=R,e[R]=y;for(let M=0,w=l;M!==w;++M){const D=o[M],N=D[R];let H=D[b];D[b]=N,H===void 0&&(H=new kn(y,n[M],i[M])),D[R]=H}}else e[b]!==h&&Zt("AnimationObjectGroup: Different objects with the same UUID detected. Clean the caches or recreate your infrastructure when reloading scenes.")}this.nCachedObjects_=p}remove(){const e=this._objects,t=this._indicesByUUID,n=this._bindings,i=n.length;let o=this.nCachedObjects_;for(let l=0,h=arguments.length;l!==h;++l){const d=arguments[l],p=d.uuid,_=t[p];if(_!==void 0&&_>=o){const v=o++,y=e[v];t[y.uuid]=_,e[_]=y,t[p]=v,e[v]=d;for(let x=0,b=i;x!==b;++x){const R=n[x],T=R[v],M=R[_];R[_]=T,R[v]=M}}}this.nCachedObjects_=o}uncache(){const e=this._objects,t=this._indicesByUUID,n=this._bindings,i=n.length;let o=this.nCachedObjects_,l=e.length;for(let h=0,d=arguments.length;h!==d;++h){const p=arguments[h],_=p.uuid,v=t[_];if(v!==void 0)if(delete t[_],v<o){const y=--o,x=e[y],b=--l,R=e[b];t[x.uuid]=v,e[v]=x,t[R.uuid]=y,e[y]=R,e.pop();for(let T=0,M=i;T!==M;++T){const w=n[T],D=w[y],N=w[b];w[v]=D,w[y]=N,w.pop()}}else{const y=--l,x=e[y];y>0&&(t[x.uuid]=v),e[v]=x,e.pop();for(let b=0,R=i;b!==R;++b){const T=n[b];T[v]=T[y],T.pop()}}}this.nCachedObjects_=o}subscribe_(e,t){const n=this._bindingsIndicesByPath;let i=n[e];const o=this._bindings;if(i!==void 0)return o[i];const l=this._paths,h=this._parsedPaths,d=this._objects,p=d.length,_=this.nCachedObjects_,v=new Array(p);i=o.length,n[e]=i,l.push(e),h.push(t),o.push(v);for(let y=_,x=d.length;y!==x;++y){const b=d[y];v[y]=new kn(b,e,t)}return v}unsubscribe_(e){const t=this._bindingsIndicesByPath,n=t[e];if(n!==void 0){const i=this._paths,o=this._parsedPaths,l=this._bindings,h=l.length-1,d=l[h],p=e[h];t[p]=n,l[n]=d,l.pop(),o[n]=o[h],o.pop(),i[n]=i[h],i.pop()}}}class nE{constructor(e,t,n=null,i=t.blendMode){this._mixer=e,this._clip=t,this._localRoot=n,this.blendMode=i;const o=t.tracks,l=o.length,h=new Array(l),d={endingStart:Su,endingEnd:Su};for(let p=0;p!==l;++p){const _=o[p].createInterpolant(null);h[p]=_,_.settings=d}this._interpolantSettings=d,this._interpolants=h,this._propertyBindings=new Array(l),this._cacheIndex=null,this._byClipCacheIndex=null,this._timeScaleInterpolant=null,this._weightInterpolant=null,this.loop=ib,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,n=!1){if(e.fadeOut(t),this.fadeIn(t),n===!0){const i=this._clip.duration,o=e._clip.duration,l=o/i,h=i/o;e.warp(1,l,t),this.warp(h,1,t)}return this}crossFadeTo(e,t,n=!1){return e.crossFadeFrom(this,t,n)}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,n){const i=this._mixer,o=i.time,l=this.timeScale;let h=this._timeScaleInterpolant;h===null&&(h=i._lendControlInterpolant(),this._timeScaleInterpolant=h);const d=h.parameterPositions,p=h.sampleValues;return d[0]=o,d[1]=o+n,p[0]=e/l,p[1]=t/l,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,n,i){if(!this.enabled){this._updateWeight(e);return}const o=this._startTime;if(o!==null){const d=(e-o)*n;d<0||n===0?t=0:(this._startTime=null,t=n*d)}t*=this._updateTimeScale(e);const l=this._updateTime(t),h=this._updateWeight(e);if(h>0){const d=this._interpolants,p=this._propertyBindings;switch(this.blendMode){case rx:for(let _=0,v=d.length;_!==v;++_)d[_].evaluate(l),p[_].accumulateAdditive(h);break;case S0:default:for(let _=0,v=d.length;_!==v;++_)d[_].evaluate(l),p[_].accumulate(i,h)}}}_updateWeight(e){let t=0;if(this.enabled){t=this.weight;const n=this._weightInterpolant;if(n!==null){const i=n.evaluate(e)[0];t*=i,e>n.parameterPositions[1]&&(this.stopFading(),i===0&&(this.enabled=!1))}}return this._effectiveWeight=t,t}_updateTimeScale(e){let t=0;if(!this.paused){t=this.timeScale;const n=this._timeScaleInterpolant;if(n!==null){const i=n.evaluate(e)[0];t*=i,e>n.parameterPositions[1]&&(this.stopWarping(),t===0?this.paused=!0:this.timeScale=t)}}return this._effectiveTimeScale=t,t}_updateTime(e){const t=this._clip.duration,n=this.loop;let i=this.time+e,o=this._loopCount;const l=n===ab;if(e===0)return o===-1?i:l&&(o&1)===1?t-i:i;if(n===cp){o===-1&&(this._loopCount=0,this._setEndings(!0,!0,!1));e:{if(i>=t)i=t;else if(i<0)i=0;else{this.time=i;break e}this.clampWhenFinished?this.paused=!0:this.enabled=!1,this.time=i,this._mixer.dispatchEvent({type:"finished",action:this,direction:e<0?-1:1})}}else{if(o===-1&&(e>=0?(o=0,this._setEndings(!0,this.repetitions===0,l)):this._setEndings(this.repetitions===0,!0,l)),i>=t||i<0){const h=Math.floor(i/t);i-=t*h,o+=Math.abs(h);const d=this.repetitions-o;if(d<=0)this.clampWhenFinished?this.paused=!0:this.enabled=!1,i=e>0?t:0,this.time=i,this._mixer.dispatchEvent({type:"finished",action:this,direction:e>0?1:-1});else{if(d===1){const p=e<0;this._setEndings(p,!p,l)}else this._setEndings(!1,!1,l);this._loopCount=o,this.time=i,this._mixer.dispatchEvent({type:"loop",action:this,loopDelta:h})}}else this.time=i;if(l&&(o&1)===1)return t-i}return i}_setEndings(e,t,n){const i=this._interpolantSettings;n?(i.endingStart=Mu,i.endingEnd=Mu):(e?i.endingStart=this.zeroSlopeAtStart?Mu:Su:i.endingStart=up,t?i.endingEnd=this.zeroSlopeAtEnd?Mu:Su:i.endingEnd=up)}_scheduleFading(e,t,n){const i=this._mixer,o=i.time;let l=this._weightInterpolant;l===null&&(l=i._lendControlInterpolant(),this._weightInterpolant=l);const h=l.parameterPositions,d=l.sampleValues;return h[0]=o,d[0]=t,h[1]=o+e,d[1]=n,this}}const yB=new Float32Array(1);class iE extends To{constructor(e){super(),this._root=e,this._initMemoryManager(),this._accuIndex=0,this.time=0,this.timeScale=1}_bindAction(e,t){const n=e._localRoot||this._root,i=e._clip.tracks,o=i.length,l=e._propertyBindings,h=e._interpolants,d=n.uuid,p=this._bindingsByRootAndName;let _=p[d];_===void 0&&(_={},p[d]=_);for(let v=0;v!==o;++v){const y=i[v],x=y.name;let b=_[x];if(b!==void 0)++b.referenceCount,l[v]=b;else{if(b=l[v],b!==void 0){b._cacheIndex===null&&(++b.referenceCount,this._addInactiveBinding(b,d,x));continue}const R=t&&t._propertyBindings[v].binding.parsedPath;b=new tE(kn.create(n,x,R),y.ValueTypeName,y.getValueSize()),++b.referenceCount,this._addInactiveBinding(b,d,x),l[v]=b}h[v].resultBuffer=b.buffer}}_activateAction(e){if(!this._isActiveAction(e)){if(e._cacheIndex===null){const n=(e._localRoot||this._root).uuid,i=e._clip.uuid,o=this._actionsByClip[i];this._bindAction(e,o&&o.knownActions[0]),this._addInactiveAction(e,i,n)}const t=e._propertyBindings;for(let n=0,i=t.length;n!==i;++n){const o=t[n];o.useCount++===0&&(this._lendBinding(o),o.saveOriginalState())}this._lendAction(e)}}_deactivateAction(e){if(this._isActiveAction(e)){const t=e._propertyBindings;for(let n=0,i=t.length;n!==i;++n){const o=t[n];--o.useCount===0&&(o.restoreOriginalState(),this._takeBackBinding(o))}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<this._nActiveActions}_addInactiveAction(e,t,n){const i=this._actions,o=this._actionsByClip;let l=o[t];if(l===void 0)l={knownActions:[e],actionByRoot:{}},e._byClipCacheIndex=0,o[t]=l;else{const h=l.knownActions;e._byClipCacheIndex=h.length,h.push(e)}e._cacheIndex=i.length,i.push(e),l.actionByRoot[n]=e}_removeInactiveAction(e){const t=this._actions,n=t[t.length-1],i=e._cacheIndex;n._cacheIndex=i,t[i]=n,t.pop(),e._cacheIndex=null;const o=e._clip.uuid,l=this._actionsByClip,h=l[o],d=h.knownActions,p=d[d.length-1],_=e._byClipCacheIndex;p._byClipCacheIndex=_,d[_]=p,d.pop(),e._byClipCacheIndex=null;const v=h.actionByRoot,y=(e._localRoot||this._root).uuid;delete v[y],d.length===0&&delete l[o],this._removeInactiveBindingsForAction(e)}_removeInactiveBindingsForAction(e){const t=e._propertyBindings;for(let n=0,i=t.length;n!==i;++n){const o=t[n];--o.referenceCount===0&&this._removeInactiveBinding(o)}}_lendAction(e){const t=this._actions,n=e._cacheIndex,i=this._nActiveActions++,o=t[i];e._cacheIndex=i,t[i]=e,o._cacheIndex=n,t[n]=o}_takeBackAction(e){const t=this._actions,n=e._cacheIndex,i=--this._nActiveActions,o=t[i];e._cacheIndex=i,t[i]=e,o._cacheIndex=n,t[n]=o}_addInactiveBinding(e,t,n){const i=this._bindingsByRootAndName,o=this._bindings;let l=i[t];l===void 0&&(l={},i[t]=l),l[n]=e,e._cacheIndex=o.length,o.push(e)}_removeInactiveBinding(e){const t=this._bindings,n=e.binding,i=n.rootNode.uuid,o=n.path,l=this._bindingsByRootAndName,h=l[i],d=t[t.length-1],p=e._cacheIndex;d._cacheIndex=p,t[p]=d,t.pop(),delete h[o],Object.keys(h).length===0&&delete l[i]}_lendBinding(e){const t=this._bindings,n=e._cacheIndex,i=this._nActiveBindings++,o=t[i];e._cacheIndex=i,t[i]=e,o._cacheIndex=n,t[n]=o}_takeBackBinding(e){const t=this._bindings,n=e._cacheIndex,i=--this._nActiveBindings,o=t[i];e._cacheIndex=i,t[i]=e,o._cacheIndex=n,t[n]=o}_lendControlInterpolant(){const e=this._controlInterpolants,t=this._nActiveControlInterpolants++;let n=e[t];return n===void 0&&(n=new oA(new Float32Array(2),new Float32Array(2),1,yB),n.__cacheIndex=t,e[t]=n),n}_takeBackControlInterpolant(e){const t=this._controlInterpolants,n=e.__cacheIndex,i=--this._nActiveControlInterpolants,o=t[i];e.__cacheIndex=i,t[i]=e,o.__cacheIndex=n,t[n]=o}clipAction(e,t,n){const i=t||this._root,o=i.uuid;let l=typeof e=="string"?Vu.findByName(i,e):e;const h=l!==null?l.uuid:e,d=this._actionsByClip[h];let p=null;if(n===void 0&&(l!==null?n=l.blendMode:n=S0),d!==void 0){const v=d.actionByRoot[o];if(v!==void 0&&v.blendMode===n)return v;p=d.knownActions[0],l===null&&(l=p._clip)}if(l===null)return null;const _=new nE(this,l,t,n);return this._bindAction(_,p),this._addInactiveAction(_,h,o),_}existingAction(e,t){const n=t||this._root,i=n.uuid,o=typeof e=="string"?Vu.findByName(n,e):e,l=o?o.uuid:e,h=this._actionsByClip[l];return h!==void 0&&h.actionByRoot[i]||null}stopAllAction(){const e=this._actions,t=this._nActiveActions;for(let n=t-1;n>=0;--n)e[n].stop();return this}update(e){e*=this.timeScale;const t=this._actions,n=this._nActiveActions,i=this.time+=e,o=Math.sign(e),l=this._accuIndex^=1;for(let p=0;p!==n;++p)t[p]._update(i,e,o,l);const h=this._bindings,d=this._nActiveBindings;for(let p=0;p!==d;++p)h[p].apply(l);return this}setTime(e){this.time=0;for(let t=0;t<this._actions.length;t++)this._actions[t].time=0;return this.update(e)}getRoot(){return this._root}uncacheClip(e){const t=this._actions,n=e.uuid,i=this._actionsByClip,o=i[n];if(o!==void 0){const l=o.knownActions;for(let h=0,d=l.length;h!==d;++h){const p=l[h];this._deactivateAction(p);const _=p._cacheIndex,v=t[t.length-1];p._cacheIndex=null,p._byClipCacheIndex=null,v._cacheIndex=_,t[_]=v,t.pop(),this._removeInactiveBindingsForAction(p)}delete i[n]}}uncacheRoot(e){const t=e.uuid,n=this._actionsByClip;for(const l in n){const h=n[l].actionByRoot,d=h[t];d!==void 0&&(this._deactivateAction(d),this._removeInactiveAction(d))}const i=this._bindingsByRootAndName,o=i[t];if(o!==void 0)for(const l in o){const h=o[l];h.restoreOriginalState(),this._removeInactiveBinding(h)}}uncacheAction(e,t){const n=this.existingAction(e,t);n!==null&&(this._deactivateAction(n),this._removeInactiveAction(n))}}class xB extends mx{constructor(e=1,t=1,n=1,i={}){super(e,t,i),this.isRenderTarget3D=!0,this.depth=n,this.texture=new C0(null,e,t,n),this._setTextureOptions(i),this.texture.isRenderTargetTexture=!0}}class AA{constructor(e){this.value=e}clone(){return new AA(this.value.clone===void 0?this.value:this.value.clone())}}let AB=0;class SB extends To{constructor(){super(),this.isUniformsGroup=!0,Object.defineProperty(this,"id",{value:AB++}),this.name="",this.usage=dp,this.uniforms=[]}add(e){return this.uniforms.push(e),this}remove(e){const t=this.uniforms.indexOf(e);return t!==-1&&this.uniforms.splice(t,1),this}setName(e){return this.name=e,this}setUsage(e){return this.usage=e,this}dispose(){this.dispatchEvent({type:"dispose"})}copy(e){this.name=e.name,this.usage=e.usage;const t=e.uniforms;this.uniforms.length=0;for(let n=0,i=t.length;n<i;n++){const o=Array.isArray(t[n])?t[n]:[t[n]];for(let l=0;l<o.length;l++)this.uniforms.push(o[l].clone())}return this}clone(){return new this.constructor().copy(this)}}class MB extends yh{constructor(e,t,n=1){super(e,t),this.isInstancedInterleavedBuffer=!0,this.meshPerAttribute=n}copy(e){return super.copy(e),this.meshPerAttribute=e.meshPerAttribute,this}clone(e){const t=super.clone(e);return t.meshPerAttribute=this.meshPerAttribute,t}toJSON(e){const t=super.toJSON(e);return t.isInstancedInterleavedBuffer=!0,t.meshPerAttribute=this.meshPerAttribute,t}}class bB{constructor(e,t,n,i,o,l=!1){this.isGLBufferAttribute=!0,this.name="",this.buffer=e,this.type=t,this.itemSize=n,this.elementSize=i,this.count=o,this.normalized=l,this.version=0}set needsUpdate(e){e===!0&&this.version++}setBuffer(e){return this.buffer=e,this}setType(e,t){return this.type=e,this.elementSize=t,this}setItemSize(e){return this.itemSize=e,this}setCount(e){return this.count=e,this}}const aE=new en;class SA{constructor(e,t,n=0,i=1/0){this.ray=new lh(e,t),this.near=n,this.far=i,this.camera=null,this.layers=new uh,this.params={Mesh:{},Line:{threshold:1},LOD:{},Points:{threshold:1},Sprite:{}}}set(e,t){this.ray.set(e,t)}setFromCamera(e,t){t.isPerspectiveCamera?(this.ray.origin.setFromMatrixPosition(t.matrixWorld),this.ray.direction.set(e.x,e.y,.5).unproject(t).sub(this.ray.origin).normalize(),this.camera=t):t.isOrthographicCamera?(this.ray.origin.set(e.x,e.y,(t.near+t.far)/(t.near-t.far)).unproject(t),this.ray.direction.set(0,0,-1).transformDirection(t.matrixWorld),this.camera=t):Zt("Raycaster: Unsupported camera type: "+t.type)}setFromXRController(e){return aE.identity().extractRotation(e.matrixWorld),this.ray.origin.setFromMatrixPosition(e.matrixWorld),this.ray.direction.set(0,0,-1).applyMatrix4(aE),this}intersectObject(e,t=!0,n=[]){return MA(e,this,n,t),n.sort(sE),n}intersectObjects(e,t=!0,n=[]){for(let i=0,o=e.length;i<o;i++)MA(e[i],this,n,t);return n.sort(sE),n}}function sE(s,e){return s.distance-e.distance}function MA(s,e,t,n){let i=!0;if(s.layers.test(e.layers)&&s.raycast(e,t)===!1&&(i=!1),i===!0&&n===!0){const o=s.children;for(let l=0,h=o.length;l<h;l++)MA(o[l],e,t,!0)}}class EB{constructor(){this._previousTime=0,this._currentTime=0,this._startTime=performance.now(),this._delta=0,this._elapsed=0,this._timescale=1,this._document=null,this._pageVisibilityHandler=null}connect(e){this._document=e,e.hidden!==void 0&&(this._pageVisibilityHandler=TB.bind(this),e.addEventListener("visibilitychange",this._pageVisibilityHandler,!1))}disconnect(){this._pageVisibilityHandler!==null&&(this._document.removeEventListener("visibilitychange",this._pageVisibilityHandler),this._pageVisibilityHandler=null),this._document=null}getDelta(){return this._delta/1e3}getElapsed(){return this._elapsed/1e3}getTimescale(){return this._timescale}setTimescale(e){return this._timescale=e,this}reset(){return this._currentTime=performance.now()-this._startTime,this}dispose(){this.disconnect()}update(e){return this._pageVisibilityHandler!==null&&this._document.hidden===!0?this._delta=0:(this._previousTime=this._currentTime,this._currentTime=(e!==void 0?e:performance.now())-this._startTime,this._delta=(this._currentTime-this._previousTime)*this._timescale,this._elapsed+=this._delta),this}}function TB(){this._document.hidden===!1&&this.reset()}class CB{constructor(e=1,t=0,n=0){this.radius=e,this.phi=t,this.theta=n}set(e,t,n){return this.radius=e,this.phi=t,this.theta=n,this}copy(e){return this.radius=e.radius,this.phi=e.phi,this.theta=e.theta,this}makeSafe(){return this.phi=dn(this.phi,1e-6,Math.PI-1e-6),this}setFromVector3(e){return this.setFromCartesianCoords(e.x,e.y,e.z)}setFromCartesianCoords(e,t,n){return this.radius=Math.sqrt(e*e+t*t+n*n),this.radius===0?(this.theta=0,this.phi=0):(this.theta=Math.atan2(e,n),this.phi=Math.acos(dn(t/this.radius,-1,1))),this}clone(){return new this.constructor().copy(this)}}class RB{constructor(e=1,t=0,n=0){this.radius=e,this.theta=t,this.y=n}set(e,t,n){return this.radius=e,this.theta=t,this.y=n,this}copy(e){return this.radius=e.radius,this.theta=e.theta,this.y=e.y,this}setFromVector3(e){return this.setFromCartesianCoords(e.x,e.y,e.z)}setFromCartesianCoords(e,t,n){return this.radius=Math.sqrt(e*e+n*n),this.theta=Math.atan2(e,n),this.y=t,this}clone(){return new this.constructor().copy(this)}}class bA{constructor(e,t,n,i){bA.prototype.isMatrix2=!0,this.elements=[1,0,0,1],e!==void 0&&this.set(e,t,n,i)}identity(){return this.set(1,0,0,1),this}fromArray(e,t=0){for(let n=0;n<4;n++)this.elements[n]=e[n+t];return this}set(e,t,n,i){const o=this.elements;return o[0]=e,o[2]=t,o[1]=n,o[3]=i,this}}const rE=new nt;class wB{constructor(e=new nt(1/0,1/0),t=new nt(-1/0,-1/0)){this.isBox2=!0,this.min=e,this.max=t}set(e,t){return this.min.copy(e),this.max.copy(t),this}setFromPoints(e){this.makeEmpty();for(let t=0,n=e.length;t<n;t++)this.expandByPoint(e[t]);return this}setFromCenterAndSize(e,t){const n=rE.copy(t).multiplyScalar(.5);return this.min.copy(e).sub(n),this.max.copy(e).add(n),this}clone(){return new this.constructor().copy(this)}copy(e){return this.min.copy(e.min),this.max.copy(e.max),this}makeEmpty(){return this.min.x=this.min.y=1/0,this.max.x=this.max.y=-1/0,this}isEmpty(){return this.max.x<this.min.x||this.max.y<this.min.y}getCenter(e){return this.isEmpty()?e.set(0,0):e.addVectors(this.min,this.max).multiplyScalar(.5)}getSize(e){return this.isEmpty()?e.set(0,0):e.subVectors(this.max,this.min)}expandByPoint(e){return this.min.min(e),this.max.max(e),this}expandByVector(e){return this.min.sub(e),this.max.add(e),this}expandByScalar(e){return this.min.addScalar(-e),this.max.addScalar(e),this}containsPoint(e){return e.x>=this.min.x&&e.x<=this.max.x&&e.y>=this.min.y&&e.y<=this.max.y}containsBox(e){return this.min.x<=e.min.x&&e.max.x<=this.max.x&&this.min.y<=e.min.y&&e.max.y<=this.max.y}getParameter(e,t){return t.set((e.x-this.min.x)/(this.max.x-this.min.x),(e.y-this.min.y)/(this.max.y-this.min.y))}intersectsBox(e){return e.max.x>=this.min.x&&e.min.x<=this.max.x&&e.max.y>=this.min.y&&e.min.y<=this.max.y}clampPoint(e,t){return t.copy(e).clamp(this.min,this.max)}distanceToPoint(e){return this.clampPoint(e,rE).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 oE=new Z,Vv=new Z,Bh=new Z,Dh=new Z,EA=new Z,BB=new Z,DB=new Z;class NB{constructor(e=new Z,t=new Z){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){oE.subVectors(e,this.start),Vv.subVectors(this.end,this.start);const n=Vv.dot(Vv);let o=Vv.dot(oE)/n;return t&&(o=dn(o,0,1)),o}closestPointToPoint(e,t,n){const i=this.closestPointToPointParameter(e,t);return this.delta(n).multiplyScalar(i).add(this.start)}distanceSqToLine3(e,t=BB,n=DB){const i=10000000000000001e-32;let o,l;const h=this.start,d=e.start,p=this.end,_=e.end;Bh.subVectors(p,h),Dh.subVectors(_,d),EA.subVectors(h,d);const v=Bh.dot(Bh),y=Dh.dot(Dh),x=Dh.dot(EA);if(v<=i&&y<=i)return t.copy(h),n.copy(d),t.sub(n),t.dot(t);if(v<=i)o=0,l=x/y,l=dn(l,0,1);else{const b=Bh.dot(EA);if(y<=i)l=0,o=dn(-b/v,0,1);else{const R=Bh.dot(Dh),T=v*y-R*R;T!==0?o=dn((R*x-b*y)/T,0,1):o=0,l=(R*o+x)/y,l<0?(l=0,o=dn(-b/v,0,1)):l>1&&(l=1,o=dn((R-b)/v,0,1))}}return t.copy(h).add(Bh.multiplyScalar(o)),n.copy(d).add(Dh.multiplyScalar(l)),t.sub(n),t.dot(t)}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 lE=new Z;class UB extends Un{constructor(e,t){super(),this.light=e,this.matrixAutoUpdate=!1,this.color=t,this.type="SpotLightHelper";const n=new pn,i=[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 l=0,h=1,d=32;l<d;l++,h++){const p=l/d*Math.PI*2,_=h/d*Math.PI*2;i.push(Math.cos(p),Math.sin(p),1,Math.cos(_),Math.sin(_),1)}n.setAttribute("position",new Xt(i,3));const o=new za({fog:!1,toneMapped:!1});this.cone=new yr(n,o),this.add(this.cone),this.update()}dispose(){this.cone.geometry.dispose(),this.cone.material.dispose()}update(){this.light.updateWorldMatrix(!0,!1),this.light.target.updateWorldMatrix(!0,!1),this.parent?(this.parent.updateWorldMatrix(!0),this.matrix.copy(this.parent.matrixWorld).invert().multiply(this.light.matrixWorld)):this.matrix.copy(this.light.matrixWorld),this.matrixWorld.copy(this.light.matrixWorld);const e=this.light.distance?this.light.distance:1e3,t=e*Math.tan(this.light.angle);this.cone.scale.set(t,t,e),lE.setFromMatrixPosition(this.light.target.matrixWorld),this.cone.lookAt(lE),this.color!==void 0?this.cone.material.color.set(this.color):this.cone.material.color.copy(this.light.color)}}const Ec=new Z,kv=new en,TA=new en;class LB extends yr{constructor(e){const t=cE(e),n=new pn,i=[],o=[];for(let p=0;p<t.length;p++){const _=t[p];_.parent&&_.parent.isBone&&(i.push(0,0,0),i.push(0,0,0),o.push(0,0,0),o.push(0,0,0))}n.setAttribute("position",new Xt(i,3)),n.setAttribute("color",new Xt(o,3));const l=new za({vertexColors:!0,depthTest:!1,depthWrite:!1,toneMapped:!1,transparent:!0});super(n,l),this.isSkeletonHelper=!0,this.type="SkeletonHelper",this.root=e,this.bones=t,this.matrix=e.matrixWorld,this.matrixAutoUpdate=!1;const h=new Ct(255),d=new Ct(65280);this.setColors(h,d)}updateMatrixWorld(e){const t=this.bones,n=this.geometry,i=n.getAttribute("position");TA.copy(this.root.matrixWorld).invert();for(let o=0,l=0;o<t.length;o++){const h=t[o];h.parent&&h.parent.isBone&&(kv.multiplyMatrices(TA,h.matrixWorld),Ec.setFromMatrixPosition(kv),i.setXYZ(l,Ec.x,Ec.y,Ec.z),kv.multiplyMatrices(TA,h.parent.matrixWorld),Ec.setFromMatrixPosition(kv),i.setXYZ(l+1,Ec.x,Ec.y,Ec.z),l+=2)}n.getAttribute("position").needsUpdate=!0,super.updateMatrixWorld(e)}setColors(e,t){const i=this.geometry.getAttribute("color");for(let o=0;o<i.count;o+=2)i.setXYZ(o,e.r,e.g,e.b),i.setXYZ(o+1,t.r,t.g,t.b);return i.needsUpdate=!0,this}dispose(){this.geometry.dispose(),this.material.dispose()}}function cE(s){const e=[];s.isBone===!0&&e.push(s);for(let t=0;t<s.children.length;t++)e.push(...cE(s.children[t]));return e}class OB extends yi{constructor(e,t,n){const i=new kp(t,4,2),o=new ha({wireframe:!0,fog:!1,toneMapped:!1});super(i,o),this.light=e,this.color=n,this.type="PointLightHelper",this.matrix=this.light.matrixWorld,this.matrixAutoUpdate=!1,this.update()}dispose(){this.geometry.dispose(),this.material.dispose()}update(){this.light.updateWorldMatrix(!0,!1),this.color!==void 0?this.material.color.set(this.color):this.material.color.copy(this.light.color)}}const IB=new Z,uE=new Ct,fE=new Ct;class FB extends Un{constructor(e,t,n){super(),this.light=e,this.matrix=e.matrixWorld,this.matrixAutoUpdate=!1,this.color=n,this.type="HemisphereLightHelper";const i=new Vp(t);i.rotateY(Math.PI*.5),this.material=new ha({wireframe:!0,fog:!1,toneMapped:!1}),this.color===void 0&&(this.material.vertexColors=!0);const o=i.getAttribute("position"),l=new Float32Array(o.count*3);i.setAttribute("color",new Hn(l,3)),this.add(new yi(i,this.material)),this.update()}dispose(){this.children[0].geometry.dispose(),this.children[0].material.dispose()}update(){const e=this.children[0];if(this.color!==void 0)this.material.color.set(this.color);else{const t=e.geometry.getAttribute("color");uE.copy(this.light.color),fE.copy(this.light.groundColor);for(let n=0,i=t.count;n<i;n++){const o=n<i/2?uE:fE;t.setXYZ(n,o.r,o.g,o.b)}t.needsUpdate=!0}this.light.updateWorldMatrix(!0,!1),e.lookAt(IB.setFromMatrixPosition(this.light.matrixWorld).negate())}}class HB extends yr{constructor(e=10,t=10,n=4473924,i=8947848){n=new Ct(n),i=new Ct(i);const o=t/2,l=e/t,h=e/2,d=[],p=[];for(let y=0,x=0,b=-h;y<=t;y++,b+=l){d.push(-h,0,b,h,0,b),d.push(b,0,-h,b,0,h);const R=y===o?n:i;R.toArray(p,x),x+=3,R.toArray(p,x),x+=3,R.toArray(p,x),x+=3,R.toArray(p,x),x+=3}const _=new pn;_.setAttribute("position",new Xt(d,3)),_.setAttribute("color",new Xt(p,3));const v=new za({vertexColors:!0,toneMapped:!1});super(_,v),this.type="GridHelper"}dispose(){this.geometry.dispose(),this.material.dispose()}}class PB extends yr{constructor(e=10,t=16,n=8,i=64,o=4473924,l=8947848){o=new Ct(o),l=new Ct(l);const h=[],d=[];if(t>1)for(let v=0;v<t;v++){const y=v/t*(Math.PI*2),x=Math.sin(y)*e,b=Math.cos(y)*e;h.push(0,0,0),h.push(x,0,b);const R=v&1?o:l;d.push(R.r,R.g,R.b),d.push(R.r,R.g,R.b)}for(let v=0;v<n;v++){const y=v&1?o:l,x=e-e/n*v;for(let b=0;b<i;b++){let R=b/i*(Math.PI*2),T=Math.sin(R)*x,M=Math.cos(R)*x;h.push(T,0,M),d.push(y.r,y.g,y.b),R=(b+1)/i*(Math.PI*2),T=Math.sin(R)*x,M=Math.cos(R)*x,h.push(T,0,M),d.push(y.r,y.g,y.b)}}const p=new pn;p.setAttribute("position",new Xt(h,3)),p.setAttribute("color",new Xt(d,3));const _=new za({vertexColors:!0,toneMapped:!1});super(p,_),this.type="PolarGridHelper"}dispose(){this.geometry.dispose(),this.material.dispose()}}const hE=new Z,Xv=new Z,dE=new Z;class GB extends Un{constructor(e,t,n){super(),this.light=e,this.matrix=e.matrixWorld,this.matrixAutoUpdate=!1,this.color=n,this.type="DirectionalLightHelper",t===void 0&&(t=1);let i=new pn;i.setAttribute("position",new Xt([-t,t,0,t,t,0,t,-t,0,-t,-t,0,-t,t,0],3));const o=new za({fog:!1,toneMapped:!1});this.lightPlane=new wo(i,o),this.add(this.lightPlane),i=new pn,i.setAttribute("position",new Xt([0,0,0,0,0,1],3)),this.targetLine=new wo(i,o),this.add(this.targetLine),this.update()}dispose(){this.lightPlane.geometry.dispose(),this.lightPlane.material.dispose(),this.targetLine.geometry.dispose(),this.targetLine.material.dispose()}update(){this.light.updateWorldMatrix(!0,!1),this.light.target.updateWorldMatrix(!0,!1),hE.setFromMatrixPosition(this.light.matrixWorld),Xv.setFromMatrixPosition(this.light.target.matrixWorld),dE.subVectors(Xv,hE),this.lightPlane.lookAt(Xv),this.color!==void 0?(this.lightPlane.material.color.set(this.color),this.targetLine.material.color.set(this.color)):(this.lightPlane.material.color.copy(this.light.color),this.targetLine.material.color.copy(this.light.color)),this.targetLine.lookAt(Xv),this.targetLine.scale.z=dE.length()}}const Yv=new Z,qi=new X0;class zB extends yr{constructor(e){const t=new pn,n=new za({color:16777215,vertexColors:!0,toneMapped:!1}),i=[],o=[],l={};h("n1","n2"),h("n2","n4"),h("n4","n3"),h("n3","n1"),h("f1","f2"),h("f2","f4"),h("f4","f3"),h("f3","f1"),h("n1","f1"),h("n2","f2"),h("n3","f3"),h("n4","f4"),h("p","n1"),h("p","n2"),h("p","n3"),h("p","n4"),h("u1","u2"),h("u2","u3"),h("u3","u1"),h("c","t"),h("p","c"),h("cn1","cn2"),h("cn3","cn4"),h("cf1","cf2"),h("cf3","cf4");function h(b,R){d(b),d(R)}function d(b){i.push(0,0,0),o.push(0,0,0),l[b]===void 0&&(l[b]=[]),l[b].push(i.length/3-1)}t.setAttribute("position",new Xt(i,3)),t.setAttribute("color",new Xt(o,3)),super(t,n),this.type="CameraHelper",this.camera=e,this.camera.updateProjectionMatrix&&this.camera.updateProjectionMatrix(),this.matrix=e.matrixWorld,this.matrixAutoUpdate=!1,this.pointMap=l,this.update();const p=new Ct(16755200),_=new Ct(16711680),v=new Ct(43775),y=new Ct(16777215),x=new Ct(3355443);this.setColors(p,_,v,y,x)}setColors(e,t,n,i,o){const h=this.geometry.getAttribute("color");return h.setXYZ(0,e.r,e.g,e.b),h.setXYZ(1,e.r,e.g,e.b),h.setXYZ(2,e.r,e.g,e.b),h.setXYZ(3,e.r,e.g,e.b),h.setXYZ(4,e.r,e.g,e.b),h.setXYZ(5,e.r,e.g,e.b),h.setXYZ(6,e.r,e.g,e.b),h.setXYZ(7,e.r,e.g,e.b),h.setXYZ(8,e.r,e.g,e.b),h.setXYZ(9,e.r,e.g,e.b),h.setXYZ(10,e.r,e.g,e.b),h.setXYZ(11,e.r,e.g,e.b),h.setXYZ(12,e.r,e.g,e.b),h.setXYZ(13,e.r,e.g,e.b),h.setXYZ(14,e.r,e.g,e.b),h.setXYZ(15,e.r,e.g,e.b),h.setXYZ(16,e.r,e.g,e.b),h.setXYZ(17,e.r,e.g,e.b),h.setXYZ(18,e.r,e.g,e.b),h.setXYZ(19,e.r,e.g,e.b),h.setXYZ(20,e.r,e.g,e.b),h.setXYZ(21,e.r,e.g,e.b),h.setXYZ(22,e.r,e.g,e.b),h.setXYZ(23,e.r,e.g,e.b),h.setXYZ(24,t.r,t.g,t.b),h.setXYZ(25,t.r,t.g,t.b),h.setXYZ(26,t.r,t.g,t.b),h.setXYZ(27,t.r,t.g,t.b),h.setXYZ(28,t.r,t.g,t.b),h.setXYZ(29,t.r,t.g,t.b),h.setXYZ(30,t.r,t.g,t.b),h.setXYZ(31,t.r,t.g,t.b),h.setXYZ(32,n.r,n.g,n.b),h.setXYZ(33,n.r,n.g,n.b),h.setXYZ(34,n.r,n.g,n.b),h.setXYZ(35,n.r,n.g,n.b),h.setXYZ(36,n.r,n.g,n.b),h.setXYZ(37,n.r,n.g,n.b),h.setXYZ(38,i.r,i.g,i.b),h.setXYZ(39,i.r,i.g,i.b),h.setXYZ(40,o.r,o.g,o.b),h.setXYZ(41,o.r,o.g,o.b),h.setXYZ(42,o.r,o.g,o.b),h.setXYZ(43,o.r,o.g,o.b),h.setXYZ(44,o.r,o.g,o.b),h.setXYZ(45,o.r,o.g,o.b),h.setXYZ(46,o.r,o.g,o.b),h.setXYZ(47,o.r,o.g,o.b),h.setXYZ(48,o.r,o.g,o.b),h.setXYZ(49,o.r,o.g,o.b),h.needsUpdate=!0,this}update(){const e=this.geometry,t=this.pointMap,n=1,i=1;let o,l;if(qi.projectionMatrixInverse.copy(this.camera.projectionMatrixInverse),this.camera.reversedDepth===!0)o=1,l=0;else if(this.camera.coordinateSystem===Zs)o=-1,l=1;else if(this.camera.coordinateSystem===$f)o=0,l=1;else throw new Error("THREE.CameraHelper.update(): Invalid coordinate system: "+this.camera.coordinateSystem);Qi("c",t,e,qi,0,0,o),Qi("t",t,e,qi,0,0,l),Qi("n1",t,e,qi,-n,-i,o),Qi("n2",t,e,qi,n,-i,o),Qi("n3",t,e,qi,-n,i,o),Qi("n4",t,e,qi,n,i,o),Qi("f1",t,e,qi,-n,-i,l),Qi("f2",t,e,qi,n,-i,l),Qi("f3",t,e,qi,-n,i,l),Qi("f4",t,e,qi,n,i,l),Qi("u1",t,e,qi,n*.7,i*1.1,o),Qi("u2",t,e,qi,-n*.7,i*1.1,o),Qi("u3",t,e,qi,0,i*2,o),Qi("cf1",t,e,qi,-n,0,l),Qi("cf2",t,e,qi,n,0,l),Qi("cf3",t,e,qi,0,-i,l),Qi("cf4",t,e,qi,0,i,l),Qi("cn1",t,e,qi,-n,0,o),Qi("cn2",t,e,qi,n,0,o),Qi("cn3",t,e,qi,0,-i,o),Qi("cn4",t,e,qi,0,i,o),e.getAttribute("position").needsUpdate=!0}dispose(){this.geometry.dispose(),this.material.dispose()}}function Qi(s,e,t,n,i,o,l){Yv.set(i,o,l).unproject(n);const h=e[s];if(h!==void 0){const d=t.getAttribute("position");for(let p=0,_=h.length;p<_;p++)d.setXYZ(h[p],Yv.x,Yv.y,Yv.z)}}const Jv=new Ra;class VB extends yr{constructor(e,t=16776960){const n=new Uint16Array([0,1,1,2,2,3,3,0,4,5,5,6,6,7,7,4,0,4,1,5,2,6,3,7]),i=new Float32Array(24),o=new pn;o.setIndex(new Hn(n,1)),o.setAttribute("position",new Hn(i,3)),super(o,new za({color:t,toneMapped:!1})),this.object=e,this.type="BoxHelper",this.matrixAutoUpdate=!1,this.update()}update(){if(this.object!==void 0&&Jv.setFromObject(this.object),Jv.isEmpty())return;const e=Jv.min,t=Jv.max,n=this.geometry.attributes.position,i=n.array;i[0]=t.x,i[1]=t.y,i[2]=t.z,i[3]=e.x,i[4]=t.y,i[5]=t.z,i[6]=e.x,i[7]=e.y,i[8]=t.z,i[9]=t.x,i[10]=e.y,i[11]=t.z,i[12]=t.x,i[13]=t.y,i[14]=e.z,i[15]=e.x,i[16]=t.y,i[17]=e.z,i[18]=e.x,i[19]=e.y,i[20]=e.z,i[21]=t.x,i[22]=e.y,i[23]=e.z,n.needsUpdate=!0,this.geometry.computeBoundingSphere()}setFromObject(e){return this.object=e,this.update(),this}copy(e,t){return super.copy(e,t),this.object=e.object,this}dispose(){this.geometry.dispose(),this.material.dispose()}}class kB extends yr{constructor(e,t=16776960){const n=new Uint16Array([0,1,1,2,2,3,3,0,4,5,5,6,6,7,7,4,0,4,1,5,2,6,3,7]),i=[1,1,1,-1,1,1,-1,-1,1,1,-1,1,1,1,-1,-1,1,-1,-1,-1,-1,1,-1,-1],o=new pn;o.setIndex(new Hn(n,1)),o.setAttribute("position",new Xt(i,3)),super(o,new za({color:t,toneMapped:!1})),this.box=e,this.type="Box3Helper",this.geometry.computeBoundingSphere()}updateMatrixWorld(e){const t=this.box;t.isEmpty()||(t.getCenter(this.position),t.getSize(this.scale),this.scale.multiplyScalar(.5),super.updateMatrixWorld(e))}dispose(){this.geometry.dispose(),this.material.dispose()}}class XB extends wo{constructor(e,t=1,n=16776960){const i=n,o=[1,-1,0,-1,1,0,-1,-1,0,1,1,0,-1,1,0,-1,-1,0,1,-1,0,1,1,0],l=new pn;l.setAttribute("position",new Xt(o,3)),l.computeBoundingSphere(),super(l,new za({color:i,toneMapped:!1})),this.type="PlaneHelper",this.plane=e,this.size=t;const h=[1,1,0,-1,1,0,-1,-1,0,1,1,0,-1,-1,0,1,-1,0],d=new pn;d.setAttribute("position",new Xt(h,3)),d.computeBoundingSphere(),this.add(new yi(d,new ha({color:i,opacity:.2,transparent:!0,depthWrite:!1,toneMapped:!1})))}updateMatrixWorld(e){this.position.set(0,0,0),this.scale.set(.5*this.size,.5*this.size,1),this.lookAt(this.plane.normal),this.translateZ(-this.plane.constant),super.updateMatrixWorld(e)}dispose(){this.geometry.dispose(),this.material.dispose(),this.children[0].geometry.dispose(),this.children[0].material.dispose()}}const pE=new Z;let qv,CA;class YB extends Un{constructor(e=new Z(0,0,1),t=new Z(0,0,0),n=1,i=16776960,o=n*.2,l=o*.2){super(),this.type="ArrowHelper",qv===void 0&&(qv=new pn,qv.setAttribute("position",new Xt([0,0,0,0,1,0],3)),CA=new Lp(.5,1,5,1),CA.translate(0,-.5,0)),this.position.copy(t),this.line=new wo(qv,new za({color:i,toneMapped:!1})),this.line.matrixAutoUpdate=!1,this.add(this.line),this.cone=new yi(CA,new ha({color:i,toneMapped:!1})),this.cone.matrixAutoUpdate=!1,this.add(this.cone),this.setDirection(e),this.setLength(n,o,l)}setDirection(e){if(e.y>.99999)this.quaternion.set(0,0,0,1);else if(e.y<-.99999)this.quaternion.set(1,0,0,0);else{pE.set(e.z,0,-e.x).normalize();const t=Math.acos(e.y);this.quaternion.setFromAxisAngle(pE,t)}}setLength(e,t=e*.2,n=t*.2){this.line.scale.set(1,Math.max(1e-4,e-t),1),this.line.updateMatrix(),this.cone.scale.set(n,t,n),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 JB extends yr{constructor(e=1){const t=[0,0,0,e,0,0,0,0,0,0,e,0,0,0,0,0,0,e],n=[1,0,0,1,.6,0,0,1,0,.6,1,0,0,0,1,0,.6,1],i=new pn;i.setAttribute("position",new Xt(t,3)),i.setAttribute("color",new Xt(n,3));const o=new za({vertexColors:!0,toneMapped:!1});super(i,o),this.type="AxesHelper"}setColors(e,t,n){const i=new Ct,o=this.geometry.attributes.color.array;return i.set(e),i.toArray(o,0),i.toArray(o,3),i.set(t),i.toArray(o,6),i.toArray(o,9),i.set(n),i.toArray(o,12),i.toArray(o,15),this.geometry.attributes.color.needsUpdate=!0,this}dispose(){this.geometry.dispose(),this.material.dispose()}}class qB{constructor(){this.type="ShapePath",this.color=new Ct,this.subPaths=[],this.currentPath=null}moveTo(e,t){return this.currentPath=new Ev,this.subPaths.push(this.currentPath),this.currentPath.moveTo(e,t),this}lineTo(e,t){return this.currentPath.lineTo(e,t),this}quadraticCurveTo(e,t,n,i){return this.currentPath.quadraticCurveTo(e,t,n,i),this}bezierCurveTo(e,t,n,i,o,l){return this.currentPath.bezierCurveTo(e,t,n,i,o,l),this}splineThru(e){return this.currentPath.splineThru(e),this}toShapes(e){function t(M){const w=[];for(let D=0,N=M.length;D<N;D++){const H=M[D],O=new Ou;O.curves=H.curves,w.push(O)}return w}function n(M,w){const D=w.length;let N=!1;for(let H=D-1,O=0;O<D;H=O++){let z=w[H],V=w[O],U=V.x-z.x,F=V.y-z.y;if(Math.abs(F)>Number.EPSILON){if(F<0&&(z=w[O],U=-U,V=w[H],F=-F),M.y<z.y||M.y>V.y)continue;if(M.y===z.y){if(M.x===z.x)return!0}else{const K=F*(M.x-z.x)-U*(M.y-z.y);if(K===0)return!0;if(K<0)continue;N=!N}}else{if(M.y!==z.y)continue;if(V.x<=M.x&&M.x<=z.x||z.x<=M.x&&M.x<=V.x)return!0}}return N}const i=$r.isClockWise,o=this.subPaths;if(o.length===0)return[];let l,h,d;const p=[];if(o.length===1)return h=o[0],d=new Ou,d.curves=h.curves,p.push(d),p;let _=!i(o[0].getPoints());_=e?!_:_;const v=[],y=[];let x=[],b=0,R;y[b]=void 0,x[b]=[];for(let M=0,w=o.length;M<w;M++)h=o[M],R=h.getPoints(),l=i(R),l=e?!l:l,l?(!_&&y[b]&&b++,y[b]={s:new Ou,p:R},y[b].s.curves=h.curves,_&&b++,x[b]=[]):x[b].push({h,p:R[0]});if(!y[0])return t(o);if(y.length>1){let M=!1,w=0;for(let D=0,N=y.length;D<N;D++)v[D]=[];for(let D=0,N=y.length;D<N;D++){const H=x[D];for(let O=0;O<H.length;O++){const z=H[O];let V=!0;for(let U=0;U<y.length;U++)n(z.p,y[U].p)&&(D!==U&&w++,V?(V=!1,v[U].push(z)):M=!0);V&&v[D].push(z)}}w>0&&M===!1&&(x=v)}let T;for(let M=0,w=y.length;M<w;M++){d=y[M].s,p.push(d),T=x[M];for(let D=0,N=T.length;D<N;D++)d.holes.push(T[D].h)}return p}}class KB extends To{constructor(e,t=null){super(),this.object=e,this.domElement=t,this.enabled=!0,this.state=-1,this.keys={},this.mouseButtons={LEFT:null,MIDDLE:null,RIGHT:null},this.touches={ONE:null,TWO:null}}connect(e){if(e===void 0){Ut("Controls: connect() now requires an element.");return}this.domElement!==null&&this.disconnect(),this.domElement=e}disconnect(){}dispose(){}update(){}}function WB(s,e){const t=s.image&&s.image.width?s.image.width/s.image.height:1;return t>e?(s.repeat.x=1,s.repeat.y=t/e,s.offset.x=0,s.offset.y=(1-s.repeat.y)/2):(s.repeat.x=e/t,s.repeat.y=1,s.offset.x=(1-s.repeat.x)/2,s.offset.y=0),s}function jB(s,e){const t=s.image&&s.image.width?s.image.width/s.image.height:1;return t>e?(s.repeat.x=e/t,s.repeat.y=1,s.offset.x=(1-s.repeat.x)/2,s.offset.y=0):(s.repeat.x=1,s.repeat.y=t/e,s.offset.x=0,s.offset.y=(1-s.repeat.y)/2),s}function ZB(s){return s.repeat.x=1,s.repeat.y=1,s.offset.x=0,s.offset.y=0,s}function RA(s,e,t,n){const i=QB(n);switch(t){case ax:return s*e;case ip:return s*e/i.components*i.byteLength;case ap:return s*e/i.components*i.byteLength;case xu:return s*e*2/i.components*i.byteLength;case zg:return s*e*2/i.components*i.byteLength;case sx:return s*e*3/i.components*i.byteLength;case Zi:return s*e*4/i.components*i.byteLength;case Vg:return s*e*4/i.components*i.byteLength;case sp:case rp:return Math.floor((s+3)/4)*Math.floor((e+3)/4)*8;case op:case lp:return Math.floor((s+3)/4)*Math.floor((e+3)/4)*16;case Xg:case Jg:return Math.max(s,16)*Math.max(e,8)/4;case kg:case Yg:return Math.max(s,8)*Math.max(e,8)/2;case qg:case Kg:case jg:case Zg:return Math.floor((s+3)/4)*Math.floor((e+3)/4)*8;case Wg:case Qg:case $g:return Math.floor((s+3)/4)*Math.floor((e+3)/4)*16;case e0:return Math.floor((s+3)/4)*Math.floor((e+3)/4)*16;case t0:return Math.floor((s+4)/5)*Math.floor((e+3)/4)*16;case n0:return Math.floor((s+4)/5)*Math.floor((e+4)/5)*16;case i0:return Math.floor((s+5)/6)*Math.floor((e+4)/5)*16;case a0:return Math.floor((s+5)/6)*Math.floor((e+5)/6)*16;case s0:return Math.floor((s+7)/8)*Math.floor((e+4)/5)*16;case r0:return Math.floor((s+7)/8)*Math.floor((e+5)/6)*16;case o0:return Math.floor((s+7)/8)*Math.floor((e+7)/8)*16;case l0:return Math.floor((s+9)/10)*Math.floor((e+4)/5)*16;case c0:return Math.floor((s+9)/10)*Math.floor((e+5)/6)*16;case u0:return Math.floor((s+9)/10)*Math.floor((e+7)/8)*16;case f0:return Math.floor((s+9)/10)*Math.floor((e+9)/10)*16;case h0:return Math.floor((s+11)/12)*Math.floor((e+9)/10)*16;case d0:return Math.floor((s+11)/12)*Math.floor((e+11)/12)*16;case p0:case m0:case g0:return Math.ceil(s/4)*Math.ceil(e/4)*16;case v0:case _0:return Math.ceil(s/4)*Math.ceil(e/4)*8;case y0:case x0:return Math.ceil(s/4)*Math.ceil(e/4)*16}throw new Error(`Unable to determine texture byte length for ${t} format.`)}function QB(s){switch(s){case Ta:case Fg:return{byteLength:1,components:1};case Zf:case Hg:case ki:return{byteLength:2,components:1};case Pg:case Gg:return{byteLength:2,components:4};case js:case np:case Ci:return{byteLength:4,components:1};case nx:case ix:return{byteLength:4,components:3}}throw new Error(`Unknown texture type ${s}.`)}class $B{static contain(e,t){return WB(e,t)}static cover(e,t){return jB(e,t)}static fill(e){return ZB(e)}static getByteLength(e,t,n,i){return RA(e,t,n,i)}}typeof __THREE_DEVTOOLS__<"u"&&__THREE_DEVTOOLS__.dispatchEvent(new CustomEvent("register",{detail:{revision:Zd}})),typeof window<"u"&&(window.__THREE__?Ut("WARNING: Multiple instances of Three.js being imported."):window.__THREE__=Zd);function mE(){let s=null,e=!1,t=null,n=null;function i(o,l){t(o,l),n=s.requestAnimationFrame(i)}return{start:function(){e!==!0&&t!==null&&(n=s.requestAnimationFrame(i),e=!0)},stop:function(){s.cancelAnimationFrame(n),e=!1},setAnimationLoop:function(o){t=o},setContext:function(o){s=o}}}function e3(s){const e=new WeakMap;function t(h,d){const p=h.array,_=h.usage,v=p.byteLength,y=s.createBuffer();s.bindBuffer(d,y),s.bufferData(d,p,_),h.onUploadCallback();let x;if(p instanceof Float32Array)x=s.FLOAT;else if(typeof Float16Array<"u"&&p instanceof Float16Array)x=s.HALF_FLOAT;else if(p instanceof Uint16Array)h.isFloat16BufferAttribute?x=s.HALF_FLOAT:x=s.UNSIGNED_SHORT;else if(p instanceof Int16Array)x=s.SHORT;else if(p instanceof Uint32Array)x=s.UNSIGNED_INT;else if(p instanceof Int32Array)x=s.INT;else if(p instanceof Int8Array)x=s.BYTE;else if(p instanceof Uint8Array)x=s.UNSIGNED_BYTE;else if(p instanceof Uint8ClampedArray)x=s.UNSIGNED_BYTE;else throw new Error("THREE.WebGLAttributes: Unsupported buffer data format: "+p);return{buffer:y,type:x,bytesPerElement:p.BYTES_PER_ELEMENT,version:h.version,size:v}}function n(h,d,p){const _=d.array,v=d.updateRanges;if(s.bindBuffer(p,h),v.length===0)s.bufferSubData(p,0,_);else{v.sort((x,b)=>x.start-b.start);let y=0;for(let x=1;x<v.length;x++){const b=v[y],R=v[x];R.start<=b.start+b.count+1?b.count=Math.max(b.count,R.start+R.count-b.start):(++y,v[y]=R)}v.length=y+1;for(let x=0,b=v.length;x<b;x++){const R=v[x];s.bufferSubData(p,R.start*_.BYTES_PER_ELEMENT,_,R.start,R.count)}d.clearUpdateRanges()}d.onUploadCallback()}function i(h){return h.isInterleavedBufferAttribute&&(h=h.data),e.get(h)}function o(h){h.isInterleavedBufferAttribute&&(h=h.data);const d=e.get(h);d&&(s.deleteBuffer(d.buffer),e.delete(h))}function l(h,d){if(h.isInterleavedBufferAttribute&&(h=h.data),h.isGLBufferAttribute){const _=e.get(h);(!_||_.version<h.version)&&e.set(h,{buffer:h.buffer,type:h.type,bytesPerElement:h.elementSize,version:h.version});return}const p=e.get(h);if(p===void 0)e.set(h,t(h,d));else if(p.version<h.version){if(p.size!==h.array.byteLength)throw new Error("THREE.WebGLAttributes: The size of the buffer attribute's array buffer does not match the original size. Resizing buffer attributes is not supported.");n(p.buffer,h,d),p.version=h.version}}return{get:i,remove:o,update:l}}var t3=`#ifdef USE_ALPHAHASH
|
|
49
49
|
if ( diffuseColor.a < getAlphaHashThreshold( vPosition ) ) discard;
|
|
50
50
|
#endif`,n3=`#ifdef USE_ALPHAHASH
|
|
51
51
|
const float ALPHA_HASH_SCALE = 0.05;
|
|
@@ -3610,7 +3610,7 @@ void main() {
|
|
|
3610
3610
|
#include <tonemapping_fragment>
|
|
3611
3611
|
#include <colorspace_fragment>
|
|
3612
3612
|
#include <fog_fragment>
|
|
3613
|
-
}`},Lt={common:{diffuse:{value:new Ct(16777215)},opacity:{value:1},map:{value:null},mapTransform:{value:new yn},alphaMap:{value:null},alphaMapTransform:{value:new yn},alphaTest:{value:0}},specularmap:{specularMap:{value:null},specularMapTransform:{value:new yn}},envmap:{envMap:{value:null},envMapRotation:{value:new yn},flipEnvMap:{value:-1},reflectivity:{value:1},ior:{value:1.5},refractionRatio:{value:.98},dfgLUT:{value:null}},aomap:{aoMap:{value:null},aoMapIntensity:{value:1},aoMapTransform:{value:new yn}},lightmap:{lightMap:{value:null},lightMapIntensity:{value:1},lightMapTransform:{value:new yn}},bumpmap:{bumpMap:{value:null},bumpMapTransform:{value:new yn},bumpScale:{value:1}},normalmap:{normalMap:{value:null},normalMapTransform:{value:new yn},normalScale:{value:new nt(1,1)}},displacementmap:{displacementMap:{value:null},displacementMapTransform:{value:new yn},displacementScale:{value:1},displacementBias:{value:0}},emissivemap:{emissiveMap:{value:null},emissiveMapTransform:{value:new yn}},metalnessmap:{metalnessMap:{value:null},metalnessMapTransform:{value:new yn}},roughnessmap:{roughnessMap:{value:null},roughnessMapTransform:{value:new yn}},gradientmap:{gradientMap:{value:null}},fog:{fogDensity:{value:25e-5},fogNear:{value:1},fogFar:{value:2e3},fogColor:{value:new Ct(16777215)}},lights:{ambientLightColor:{value:[]},lightProbe:{value:[]},directionalLights:{value:[],properties:{direction:{},color:{}}},directionalLightShadows:{value:[],properties:{shadowIntensity:1,shadowBias:{},shadowNormalBias:{},shadowRadius:{},shadowMapSize:{}}},directionalShadowMap:{value:[]},directionalShadowMatrix:{value:[]},spotLights:{value:[],properties:{color:{},position:{},direction:{},distance:{},coneCos:{},penumbraCos:{},decay:{}}},spotLightShadows:{value:[],properties:{shadowIntensity:1,shadowBias:{},shadowNormalBias:{},shadowRadius:{},shadowMapSize:{}}},spotLightMap:{value:[]},spotShadowMap:{value:[]},spotLightMatrix:{value:[]},pointLights:{value:[],properties:{color:{},position:{},decay:{},distance:{}}},pointLightShadows:{value:[],properties:{shadowIntensity:1,shadowBias:{},shadowNormalBias:{},shadowRadius:{},shadowMapSize:{},shadowCameraNear:{},shadowCameraFar:{}}},pointShadowMap:{value:[]},pointShadowMatrix:{value:[]},hemisphereLights:{value:[],properties:{direction:{},skyColor:{},groundColor:{}}},rectAreaLights:{value:[],properties:{color:{},position:{},width:{},height:{}}},ltc_1:{value:null},ltc_2:{value:null}},points:{diffuse:{value:new Ct(16777215)},opacity:{value:1},size:{value:1},scale:{value:1},map:{value:null},alphaMap:{value:null},alphaMapTransform:{value:new yn},alphaTest:{value:0},uvTransform:{value:new yn}},sprite:{diffuse:{value:new Ct(16777215)},opacity:{value:1},center:{value:new nt(.5,.5)},rotation:{value:0},map:{value:null},mapTransform:{value:new yn},alphaMap:{value:null},alphaMapTransform:{value:new yn},alphaTest:{value:0}}},eo={basic:{uniforms:ps([Lt.common,Lt.specularmap,Lt.envmap,Lt.aomap,Lt.lightmap,Lt.fog]),vertexShader:bn.meshbasic_vert,fragmentShader:bn.meshbasic_frag},lambert:{uniforms:ps([Lt.common,Lt.specularmap,Lt.envmap,Lt.aomap,Lt.lightmap,Lt.emissivemap,Lt.bumpmap,Lt.normalmap,Lt.displacementmap,Lt.fog,Lt.lights,{emissive:{value:new Ct(0)}}]),vertexShader:bn.meshlambert_vert,fragmentShader:bn.meshlambert_frag},phong:{uniforms:ps([Lt.common,Lt.specularmap,Lt.envmap,Lt.aomap,Lt.lightmap,Lt.emissivemap,Lt.bumpmap,Lt.normalmap,Lt.displacementmap,Lt.fog,Lt.lights,{emissive:{value:new Ct(0)},specular:{value:new Ct(1118481)},shininess:{value:30}}]),vertexShader:bn.meshphong_vert,fragmentShader:bn.meshphong_frag},standard:{uniforms:ps([Lt.common,Lt.envmap,Lt.aomap,Lt.lightmap,Lt.emissivemap,Lt.bumpmap,Lt.normalmap,Lt.displacementmap,Lt.roughnessmap,Lt.metalnessmap,Lt.fog,Lt.lights,{emissive:{value:new Ct(0)},roughness:{value:1},metalness:{value:0},envMapIntensity:{value:1}}]),vertexShader:bn.meshphysical_vert,fragmentShader:bn.meshphysical_frag},toon:{uniforms:ps([Lt.common,Lt.aomap,Lt.lightmap,Lt.emissivemap,Lt.bumpmap,Lt.normalmap,Lt.displacementmap,Lt.gradientmap,Lt.fog,Lt.lights,{emissive:{value:new Ct(0)}}]),vertexShader:bn.meshtoon_vert,fragmentShader:bn.meshtoon_frag},matcap:{uniforms:ps([Lt.common,Lt.bumpmap,Lt.normalmap,Lt.displacementmap,Lt.fog,{matcap:{value:null}}]),vertexShader:bn.meshmatcap_vert,fragmentShader:bn.meshmatcap_frag},points:{uniforms:ps([Lt.points,Lt.fog]),vertexShader:bn.points_vert,fragmentShader:bn.points_frag},dashed:{uniforms:ps([Lt.common,Lt.fog,{scale:{value:1},dashSize:{value:1},totalSize:{value:2}}]),vertexShader:bn.linedashed_vert,fragmentShader:bn.linedashed_frag},depth:{uniforms:ps([Lt.common,Lt.displacementmap]),vertexShader:bn.depth_vert,fragmentShader:bn.depth_frag},normal:{uniforms:ps([Lt.common,Lt.bumpmap,Lt.normalmap,Lt.displacementmap,{opacity:{value:1}}]),vertexShader:bn.meshnormal_vert,fragmentShader:bn.meshnormal_frag},sprite:{uniforms:ps([Lt.sprite,Lt.fog]),vertexShader:bn.sprite_vert,fragmentShader:bn.sprite_frag},background:{uniforms:{uvTransform:{value:new yn},t2D:{value:null},backgroundIntensity:{value:1}},vertexShader:bn.background_vert,fragmentShader:bn.background_frag},backgroundCube:{uniforms:{envMap:{value:null},flipEnvMap:{value:-1},backgroundBlurriness:{value:0},backgroundIntensity:{value:1},backgroundRotation:{value:new yn}},vertexShader:bn.backgroundCube_vert,fragmentShader:bn.backgroundCube_frag},cube:{uniforms:{tCube:{value:null},tFlip:{value:-1},opacity:{value:1}},vertexShader:bn.cube_vert,fragmentShader:bn.cube_frag},equirect:{uniforms:{tEquirect:{value:null}},vertexShader:bn.equirect_vert,fragmentShader:bn.equirect_frag},distance:{uniforms:ps([Lt.common,Lt.displacementmap,{referencePosition:{value:new Z},nearDistance:{value:1},farDistance:{value:1e3}}]),vertexShader:bn.distance_vert,fragmentShader:bn.distance_frag},shadow:{uniforms:ps([Lt.lights,Lt.fog,{color:{value:new Ct(0)},opacity:{value:1}}]),vertexShader:bn.shadow_vert,fragmentShader:bn.shadow_frag}};eo.physical={uniforms:ps([eo.standard.uniforms,{clearcoat:{value:0},clearcoatMap:{value:null},clearcoatMapTransform:{value:new yn},clearcoatNormalMap:{value:null},clearcoatNormalMapTransform:{value:new yn},clearcoatNormalScale:{value:new nt(1,1)},clearcoatRoughness:{value:0},clearcoatRoughnessMap:{value:null},clearcoatRoughnessMapTransform:{value:new yn},dispersion:{value:0},iridescence:{value:0},iridescenceMap:{value:null},iridescenceMapTransform:{value:new yn},iridescenceIOR:{value:1.3},iridescenceThicknessMinimum:{value:100},iridescenceThicknessMaximum:{value:400},iridescenceThicknessMap:{value:null},iridescenceThicknessMapTransform:{value:new yn},sheen:{value:0},sheenColor:{value:new Ct(0)},sheenColorMap:{value:null},sheenColorMapTransform:{value:new yn},sheenRoughness:{value:1},sheenRoughnessMap:{value:null},sheenRoughnessMapTransform:{value:new yn},transmission:{value:0},transmissionMap:{value:null},transmissionMapTransform:{value:new yn},transmissionSamplerSize:{value:new nt},transmissionSamplerMap:{value:null},thickness:{value:0},thicknessMap:{value:null},thicknessMapTransform:{value:new yn},attenuationDistance:{value:0},attenuationColor:{value:new Ct(0)},specularColor:{value:new Ct(1,1,1)},specularColorMap:{value:null},specularColorMapTransform:{value:new yn},specularIntensity:{value:1},specularIntensityMap:{value:null},specularIntensityMapTransform:{value:new yn},anisotropyVector:{value:new nt},anisotropyMap:{value:null},anisotropyMapTransform:{value:new yn}}]),vertexShader:bn.meshphysical_vert,fragmentShader:bn.meshphysical_frag};const Kv={r:0,b:0,g:0},Wu=new er,eN=new en;function tN(s,e,t,n,i,o,l){const h=new Ct(0);let d=o===!0?0:1,p,_,v=null,y=0,x=null;function b(D){let N=D.isScene===!0?D.background:null;return N&&N.isTexture&&(N=(D.backgroundBlurriness>0?t:e).get(N)),N}function R(D){let N=!1;const H=b(D);H===null?M(h,d):H&&H.isColor&&(M(H,1),N=!0);const O=s.xr.getEnvironmentBlendMode();O==="additive"?n.buffers.color.setClear(0,0,0,1,l):O==="alpha-blend"&&n.buffers.color.setClear(0,0,0,0,l),(s.autoClear||N)&&(n.buffers.depth.setTest(!0),n.buffers.depth.setMask(!0),n.buffers.color.setMask(!0),s.clear(s.autoClearColor,s.autoClearDepth,s.autoClearStencil))}function T(D,N){const H=b(N);H&&(H.isCubeTexture||H.mapping===jf)?(_===void 0&&(_=new yi(new Du(1,1,1),new ms({name:"BackgroundCubeMaterial",uniforms:gh(eo.backgroundCube.uniforms),vertexShader:eo.backgroundCube.vertexShader,fragmentShader:eo.backgroundCube.fragmentShader,side:fs,depthTest:!1,depthWrite:!1,fog:!1,allowOverride:!1})),_.geometry.deleteAttribute("normal"),_.geometry.deleteAttribute("uv"),_.onBeforeRender=function(O,z,V){this.matrixWorld.copyPosition(V.matrixWorld)},Object.defineProperty(_.material,"envMap",{get:function(){return this.uniforms.envMap.value}}),i.update(_)),Wu.copy(N.backgroundRotation),Wu.x*=-1,Wu.y*=-1,Wu.z*=-1,H.isCubeTexture&&H.isRenderTargetTexture===!1&&(Wu.y*=-1,Wu.z*=-1),_.material.uniforms.envMap.value=H,_.material.uniforms.flipEnvMap.value=H.isCubeTexture&&H.isRenderTargetTexture===!1?-1:1,_.material.uniforms.backgroundBlurriness.value=N.backgroundBlurriness,_.material.uniforms.backgroundIntensity.value=N.backgroundIntensity,_.material.uniforms.backgroundRotation.value.setFromMatrix4(eN.makeRotationFromEuler(Wu)),_.material.toneMapped=Bn.getTransfer(H.colorSpace)!==si,(v!==H||y!==H.version||x!==s.toneMapping)&&(_.material.needsUpdate=!0,v=H,y=H.version,x=s.toneMapping),_.layers.enableAll(),D.unshift(_,_.geometry,_.material,0,0,null)):H&&H.isTexture&&(p===void 0&&(p=new yi(new Mc(2,2),new ms({name:"BackgroundMaterial",uniforms:gh(eo.background.uniforms),vertexShader:eo.background.vertexShader,fragmentShader:eo.background.fragmentShader,side:Yr,depthTest:!1,depthWrite:!1,fog:!1,allowOverride:!1})),p.geometry.deleteAttribute("normal"),Object.defineProperty(p.material,"map",{get:function(){return this.uniforms.t2D.value}}),i.update(p)),p.material.uniforms.t2D.value=H,p.material.uniforms.backgroundIntensity.value=N.backgroundIntensity,p.material.toneMapped=Bn.getTransfer(H.colorSpace)!==si,H.matrixAutoUpdate===!0&&H.updateMatrix(),p.material.uniforms.uvTransform.value.copy(H.matrix),(v!==H||y!==H.version||x!==s.toneMapping)&&(p.material.needsUpdate=!0,v=H,y=H.version,x=s.toneMapping),p.layers.enableAll(),D.unshift(p,p.geometry,p.material,0,0,null))}function M(D,N){D.getRGB(Kv,Lb(s)),n.buffers.color.setClear(Kv.r,Kv.g,Kv.b,N,l)}function w(){_!==void 0&&(_.geometry.dispose(),_.material.dispose(),_=void 0),p!==void 0&&(p.geometry.dispose(),p.material.dispose(),p=void 0)}return{getClearColor:function(){return h},setClearColor:function(D,N=1){h.set(D),d=N,M(h,d)},getClearAlpha:function(){return d},setClearAlpha:function(D){d=D,M(h,d)},render:R,addToRenderList:T,dispose:w}}function nN(s,e){const t=s.getParameter(s.MAX_VERTEX_ATTRIBS),n={},i=y(null);let o=i,l=!1;function h(F,K,ne,$,ae){let ge=!1;const I=v($,ne,K);o!==I&&(o=I,p(o.object)),ge=x(F,$,ne,ae),ge&&b(F,$,ne,ae),ae!==null&&e.update(ae,s.ELEMENT_ARRAY_BUFFER),(ge||l)&&(l=!1,N(F,K,ne,$),ae!==null&&s.bindBuffer(s.ELEMENT_ARRAY_BUFFER,e.get(ae).buffer))}function d(){return s.createVertexArray()}function p(F){return s.bindVertexArray(F)}function _(F){return s.deleteVertexArray(F)}function v(F,K,ne){const $=ne.wireframe===!0;let ae=n[F.id];ae===void 0&&(ae={},n[F.id]=ae);let ge=ae[K.id];ge===void 0&&(ge={},ae[K.id]=ge);let I=ge[$];return I===void 0&&(I=y(d()),ge[$]=I),I}function y(F){const K=[],ne=[],$=[];for(let ae=0;ae<t;ae++)K[ae]=0,ne[ae]=0,$[ae]=0;return{geometry:null,program:null,wireframe:!1,newAttributes:K,enabledAttributes:ne,attributeDivisors:$,object:F,attributes:{},index:null}}function x(F,K,ne,$){const ae=o.attributes,ge=K.attributes;let I=0;const W=ne.getAttributes();for(const ee in W)if(W[ee].location>=0){const _e=ae[ee];let X=ge[ee];if(X===void 0&&(ee==="instanceMatrix"&&F.instanceMatrix&&(X=F.instanceMatrix),ee==="instanceColor"&&F.instanceColor&&(X=F.instanceColor)),_e===void 0||_e.attribute!==X||X&&_e.data!==X.data)return!0;I++}return o.attributesNum!==I||o.index!==$}function b(F,K,ne,$){const ae={},ge=K.attributes;let I=0;const W=ne.getAttributes();for(const ee in W)if(W[ee].location>=0){let _e=ge[ee];_e===void 0&&(ee==="instanceMatrix"&&F.instanceMatrix&&(_e=F.instanceMatrix),ee==="instanceColor"&&F.instanceColor&&(_e=F.instanceColor));const X={};X.attribute=_e,_e&&_e.data&&(X.data=_e.data),ae[ee]=X,I++}o.attributes=ae,o.attributesNum=I,o.index=$}function R(){const F=o.newAttributes;for(let K=0,ne=F.length;K<ne;K++)F[K]=0}function T(F){M(F,0)}function M(F,K){const ne=o.newAttributes,$=o.enabledAttributes,ae=o.attributeDivisors;ne[F]=1,$[F]===0&&(s.enableVertexAttribArray(F),$[F]=1),ae[F]!==K&&(s.vertexAttribDivisor(F,K),ae[F]=K)}function w(){const F=o.newAttributes,K=o.enabledAttributes;for(let ne=0,$=K.length;ne<$;ne++)K[ne]!==F[ne]&&(s.disableVertexAttribArray(ne),K[ne]=0)}function D(F,K,ne,$,ae,ge,I){I===!0?s.vertexAttribIPointer(F,K,ne,ae,ge):s.vertexAttribPointer(F,K,ne,$,ae,ge)}function N(F,K,ne,$){R();const ae=$.attributes,ge=ne.getAttributes(),I=K.defaultAttributeValues;for(const W in ge){const ee=ge[W];if(ee.location>=0){let ye=ae[W];if(ye===void 0&&(W==="instanceMatrix"&&F.instanceMatrix&&(ye=F.instanceMatrix),W==="instanceColor"&&F.instanceColor&&(ye=F.instanceColor)),ye!==void 0){const _e=ye.normalized,X=ye.itemSize,te=e.get(ye);if(te===void 0)continue;const le=te.buffer,ve=te.type,ze=te.bytesPerElement,he=ve===s.INT||ve===s.UNSIGNED_INT||ye.gpuType===np;if(ye.isInterleavedBufferAttribute){const Ee=ye.data,lt=Ee.stride,Rt=ye.offset;if(Ee.isInstancedInterleavedBuffer){for(let Bt=0;Bt<ee.locationSize;Bt++)M(ee.location+Bt,Ee.meshPerAttribute);F.isInstancedMesh!==!0&&$._maxInstanceCount===void 0&&($._maxInstanceCount=Ee.meshPerAttribute*Ee.count)}else for(let Bt=0;Bt<ee.locationSize;Bt++)T(ee.location+Bt);s.bindBuffer(s.ARRAY_BUFFER,le);for(let Bt=0;Bt<ee.locationSize;Bt++)D(ee.location+Bt,X/ee.locationSize,ve,_e,lt*ze,(Rt+X/ee.locationSize*Bt)*ze,he)}else{if(ye.isInstancedBufferAttribute){for(let Ee=0;Ee<ee.locationSize;Ee++)M(ee.location+Ee,ye.meshPerAttribute);F.isInstancedMesh!==!0&&$._maxInstanceCount===void 0&&($._maxInstanceCount=ye.meshPerAttribute*ye.count)}else for(let Ee=0;Ee<ee.locationSize;Ee++)T(ee.location+Ee);s.bindBuffer(s.ARRAY_BUFFER,le);for(let Ee=0;Ee<ee.locationSize;Ee++)D(ee.location+Ee,X/ee.locationSize,ve,_e,X*ze,X/ee.locationSize*Ee*ze,he)}}else if(I!==void 0){const _e=I[W];if(_e!==void 0)switch(_e.length){case 2:s.vertexAttrib2fv(ee.location,_e);break;case 3:s.vertexAttrib3fv(ee.location,_e);break;case 4:s.vertexAttrib4fv(ee.location,_e);break;default:s.vertexAttrib1fv(ee.location,_e)}}}}w()}function H(){V();for(const F in n){const K=n[F];for(const ne in K){const $=K[ne];for(const ae in $)_($[ae].object),delete $[ae];delete K[ne]}delete n[F]}}function O(F){if(n[F.id]===void 0)return;const K=n[F.id];for(const ne in K){const $=K[ne];for(const ae in $)_($[ae].object),delete $[ae];delete K[ne]}delete n[F.id]}function z(F){for(const K in n){const ne=n[K];if(ne[F.id]===void 0)continue;const $=ne[F.id];for(const ae in $)_($[ae].object),delete $[ae];delete ne[F.id]}}function V(){U(),l=!0,o!==i&&(o=i,p(o.object))}function U(){i.geometry=null,i.program=null,i.wireframe=!1}return{setup:h,reset:V,resetDefaultState:U,dispose:H,releaseStatesOfGeometry:O,releaseStatesOfProgram:z,initAttributes:R,enableAttribute:T,disableUnusedAttributes:w}}function iN(s,e,t){let n;function i(p){n=p}function o(p,_){s.drawArrays(n,p,_),t.update(_,n,1)}function l(p,_,v){v!==0&&(s.drawArraysInstanced(n,p,_,v),t.update(_,n,v))}function h(p,_,v){if(v===0)return;e.get("WEBGL_multi_draw").multiDrawArraysWEBGL(n,p,0,_,0,v);let x=0;for(let b=0;b<v;b++)x+=_[b];t.update(x,n,1)}function d(p,_,v,y){if(v===0)return;const x=e.get("WEBGL_multi_draw");if(x===null)for(let b=0;b<p.length;b++)l(p[b],_[b],y[b]);else{x.multiDrawArraysInstancedWEBGL(n,p,0,_,0,y,0,v);let b=0;for(let R=0;R<v;R++)b+=_[R]*y[R];t.update(b,n,1)}}this.setMode=i,this.render=o,this.renderInstances=l,this.renderMultiDraw=h,this.renderMultiDrawInstances=d}function aN(s,e,t,n){let i;function o(){if(i!==void 0)return i;if(e.has("EXT_texture_filter_anisotropic")===!0){const z=e.get("EXT_texture_filter_anisotropic");i=s.getParameter(z.MAX_TEXTURE_MAX_ANISOTROPY_EXT)}else i=0;return i}function l(z){return!(z!==Zi&&n.convert(z)!==s.getParameter(s.IMPLEMENTATION_COLOR_READ_FORMAT))}function h(z){const V=z===ki&&(e.has("EXT_color_buffer_half_float")||e.has("EXT_color_buffer_float"));return!(z!==Ta&&n.convert(z)!==s.getParameter(s.IMPLEMENTATION_COLOR_READ_TYPE)&&z!==Ci&&!V)}function d(z){if(z==="highp"){if(s.getShaderPrecisionFormat(s.VERTEX_SHADER,s.HIGH_FLOAT).precision>0&&s.getShaderPrecisionFormat(s.FRAGMENT_SHADER,s.HIGH_FLOAT).precision>0)return"highp";z="mediump"}return z==="mediump"&&s.getShaderPrecisionFormat(s.VERTEX_SHADER,s.MEDIUM_FLOAT).precision>0&&s.getShaderPrecisionFormat(s.FRAGMENT_SHADER,s.MEDIUM_FLOAT).precision>0?"mediump":"lowp"}let p=t.precision!==void 0?t.precision:"highp";const _=d(p);_!==p&&(Ut("WebGLRenderer:",p,"not supported, using",_,"instead."),p=_);const v=t.logarithmicDepthBuffer===!0,y=t.reversedDepthBuffer===!0&&e.has("EXT_clip_control"),x=s.getParameter(s.MAX_TEXTURE_IMAGE_UNITS),b=s.getParameter(s.MAX_VERTEX_TEXTURE_IMAGE_UNITS),R=s.getParameter(s.MAX_TEXTURE_SIZE),T=s.getParameter(s.MAX_CUBE_MAP_TEXTURE_SIZE),M=s.getParameter(s.MAX_VERTEX_ATTRIBS),w=s.getParameter(s.MAX_VERTEX_UNIFORM_VECTORS),D=s.getParameter(s.MAX_VARYING_VECTORS),N=s.getParameter(s.MAX_FRAGMENT_UNIFORM_VECTORS),H=s.getParameter(s.MAX_SAMPLES),O=s.getParameter(s.SAMPLES);return{isWebGL2:!0,getMaxAnisotropy:o,getMaxPrecision:d,textureFormatReadable:l,textureTypeReadable:h,precision:p,logarithmicDepthBuffer:v,reversedDepthBuffer:y,maxTextures:x,maxVertexTextures:b,maxTextureSize:R,maxCubemapSize:T,maxAttributes:M,maxVertexUniforms:w,maxVaryings:D,maxFragmentUniforms:N,maxSamples:H,samples:O}}function sN(s){const e=this;let t=null,n=0,i=!1,o=!1;const l=new Ac,h=new yn,d={value:null,needsUpdate:!1};this.uniform=d,this.numPlanes=0,this.numIntersection=0,this.init=function(v,y){const x=v.length!==0||y||n!==0||i;return i=y,n=v.length,x},this.beginShadows=function(){o=!0,_(null)},this.endShadows=function(){o=!1},this.setGlobalState=function(v,y){t=_(v,y,0)},this.setState=function(v,y,x){const b=v.clippingPlanes,R=v.clipIntersection,T=v.clipShadows,M=s.get(v);if(!i||b===null||b.length===0||o&&!T)o?_(null):p();else{const w=o?0:n,D=w*4;let N=M.clippingState||null;d.value=N,N=_(b,y,D,x);for(let H=0;H!==D;++H)N[H]=t[H];M.clippingState=N,this.numIntersection=R?this.numPlanes:0,this.numPlanes+=w}};function p(){d.value!==t&&(d.value=t,d.needsUpdate=n>0),e.numPlanes=n,e.numIntersection=0}function _(v,y,x,b){const R=v!==null?v.length:0;let T=null;if(R!==0){if(T=d.value,b!==!0||T===null){const M=x+R*4,w=y.matrixWorldInverse;h.getNormalMatrix(w),(T===null||T.length<M)&&(T=new Float32Array(M));for(let D=0,N=x;D!==R;++D,N+=4)l.copy(v[D]).applyMatrix4(w,h),l.normal.toArray(T,N),T[N+3]=l.constant}d.value=T,d.needsUpdate=!0}return e.numPlanes=R,e.numIntersection=0,T}}function rN(s){let e=new WeakMap;function t(l,h){return h===Wf?l.mapping=qr:h===ep&&(l.mapping=oc),l}function n(l){if(l&&l.isTexture){const h=l.mapping;if(h===Wf||h===ep)if(e.has(l)){const d=e.get(l).texture;return t(d,l.mapping)}else{const d=l.image;if(d&&d.height>0){const p=new Y0(d.height);return p.fromEquirectangularTexture(s,l),e.set(l,p),l.addEventListener("dispose",i),t(p.texture,l.mapping)}else return null}}return l}function i(l){const h=l.target;h.removeEventListener("dispose",i);const d=e.get(h);d!==void 0&&(e.delete(h),d.dispose())}function o(){e=new WeakMap}return{get:n,dispose:o}}const Tc=4,gE=[.125,.215,.35,.446,.526,.582],ju=20,oN=256,Yp=new Tl,vE=new Ct;let wA=null,BA=0,DA=0,NA=!1;const lN=new Z;class UA{constructor(e){this._renderer=e,this._pingPongRenderTarget=null,this._lodMax=0,this._cubeSize=0,this._sizeLods=[],this._sigmas=[],this._lodMeshes=[],this._backgroundBox=null,this._cubemapMaterial=null,this._equirectMaterial=null,this._blurMaterial=null,this._ggxMaterial=null}fromScene(e,t=0,n=.1,i=100,o={}){const{size:l=256,position:h=lN}=o;wA=this._renderer.getRenderTarget(),BA=this._renderer.getActiveCubeFace(),DA=this._renderer.getActiveMipmapLevel(),NA=this._renderer.xr.enabled,this._renderer.xr.enabled=!1,this._setSize(l);const d=this._allocateTargets();return d.depthBuffer=!0,this._sceneToCubeUV(e,n,i,d,h),t>0&&this._blur(d,0,0,t),this._applyPMREM(d),this._cleanup(d),d}fromEquirectangular(e,t=null){return this._fromTexture(e,t)}fromCubemap(e,t=null){return this._fromTexture(e,t)}compileCubemapShader(){this._cubemapMaterial===null&&(this._cubemapMaterial=xE(),this._compileMaterial(this._cubemapMaterial))}compileEquirectangularShader(){this._equirectMaterial===null&&(this._equirectMaterial=yE(),this._compileMaterial(this._equirectMaterial))}dispose(){this._dispose(),this._cubemapMaterial!==null&&this._cubemapMaterial.dispose(),this._equirectMaterial!==null&&this._equirectMaterial.dispose(),this._backgroundBox!==null&&(this._backgroundBox.geometry.dispose(),this._backgroundBox.material.dispose())}_setSize(e){this._lodMax=Math.floor(Math.log2(e)),this._cubeSize=Math.pow(2,this._lodMax)}_dispose(){this._blurMaterial!==null&&this._blurMaterial.dispose(),this._ggxMaterial!==null&&this._ggxMaterial.dispose(),this._pingPongRenderTarget!==null&&this._pingPongRenderTarget.dispose();for(let e=0;e<this._lodMeshes.length;e++)this._lodMeshes[e].geometry.dispose()}_cleanup(e){this._renderer.setRenderTarget(wA,BA,DA),this._renderer.xr.enabled=NA,e.scissorTest=!1,Nh(e,0,0,e.width,e.height)}_fromTexture(e,t){e.mapping===qr||e.mapping===oc?this._setSize(e.image.length===0?16:e.image[0].width||e.image[0].image.width):this._setSize(e.image.width/4),wA=this._renderer.getRenderTarget(),BA=this._renderer.getActiveCubeFace(),DA=this._renderer.getActiveMipmapLevel(),NA=this._renderer.xr.enabled,this._renderer.xr.enabled=!1;const n=t||this._allocateTargets();return this._textureToCubeUV(e,n),this._applyPMREM(n),this._cleanup(n),n}_allocateTargets(){const e=3*Math.max(this._cubeSize,112),t=4*this._cubeSize,n={magFilter:Cn,minFilter:Cn,generateMipmaps:!1,type:ki,format:Zi,colorSpace:na,depthBuffer:!1},i=_E(e,t,n);if(this._pingPongRenderTarget===null||this._pingPongRenderTarget.width!==e||this._pingPongRenderTarget.height!==t){this._pingPongRenderTarget!==null&&this._dispose(),this._pingPongRenderTarget=_E(e,t,n);const{_lodMax:o}=this;({lodMeshes:this._lodMeshes,sizeLods:this._sizeLods,sigmas:this._sigmas}=cN(o)),this._blurMaterial=fN(o,e,t),this._ggxMaterial=uN(o,e,t)}return i}_compileMaterial(e){const t=new yi(new pn,e);this._renderer.compile(t,Yp)}_sceneToCubeUV(e,t,n,i,o){const d=new aa(90,1,t,n),p=[1,-1,1,1,1,1],_=[1,1,1,-1,-1,-1],v=this._renderer,y=v.autoClear,x=v.toneMapping;v.getClearColor(vE),v.toneMapping=mr,v.autoClear=!1,v.state.buffers.depth.getReversed()&&(v.setRenderTarget(i),v.clearDepth(),v.setRenderTarget(null)),this._backgroundBox===null&&(this._backgroundBox=new yi(new Du,new ha({name:"PMREM.Background",side:fs,depthWrite:!1,depthTest:!1})));const R=this._backgroundBox,T=R.material;let M=!1;const w=e.background;w?w.isColor&&(T.color.copy(w),e.background=null,M=!0):(T.color.copy(vE),M=!0);for(let D=0;D<6;D++){const N=D%3;N===0?(d.up.set(0,p[D],0),d.position.set(o.x,o.y,o.z),d.lookAt(o.x+_[D],o.y,o.z)):N===1?(d.up.set(0,0,p[D]),d.position.set(o.x,o.y,o.z),d.lookAt(o.x,o.y+_[D],o.z)):(d.up.set(0,p[D],0),d.position.set(o.x,o.y,o.z),d.lookAt(o.x,o.y,o.z+_[D]));const H=this._cubeSize;Nh(i,N*H,D>2?H:0,H,H),v.setRenderTarget(i),M&&v.render(R,d),v.render(e,d)}v.toneMapping=x,v.autoClear=y,e.background=w}_textureToCubeUV(e,t){const n=this._renderer,i=e.mapping===qr||e.mapping===oc;i?(this._cubemapMaterial===null&&(this._cubemapMaterial=xE()),this._cubemapMaterial.uniforms.flipEnvMap.value=e.isRenderTargetTexture===!1?-1:1):this._equirectMaterial===null&&(this._equirectMaterial=yE());const o=i?this._cubemapMaterial:this._equirectMaterial,l=this._lodMeshes[0];l.material=o;const h=o.uniforms;h.envMap.value=e;const d=this._cubeSize;Nh(t,0,0,3*d,2*d),n.setRenderTarget(t),n.render(l,Yp)}_applyPMREM(e){const t=this._renderer,n=t.autoClear;t.autoClear=!1;const i=this._lodMeshes.length;for(let o=1;o<i;o++)this._applyGGXFilter(e,o-1,o);t.autoClear=n}_applyGGXFilter(e,t,n){const i=this._renderer,o=this._pingPongRenderTarget,l=this._ggxMaterial,h=this._lodMeshes[n];h.material=l;const d=l.uniforms,p=n/(this._lodMeshes.length-1),_=t/(this._lodMeshes.length-1),v=Math.sqrt(p*p-_*_),y=0+p*1.25,x=v*y,{_lodMax:b}=this,R=this._sizeLods[n],T=3*R*(n>b-Tc?n-b+Tc:0),M=4*(this._cubeSize-R);d.envMap.value=e.texture,d.roughness.value=x,d.mipInt.value=b-t,Nh(o,T,M,3*R,2*R),i.setRenderTarget(o),i.render(h,Yp),d.envMap.value=o.texture,d.roughness.value=0,d.mipInt.value=b-n,Nh(e,T,M,3*R,2*R),i.setRenderTarget(e),i.render(h,Yp)}_blur(e,t,n,i,o){const l=this._pingPongRenderTarget;this._halfBlur(e,l,t,n,i,"latitudinal",o),this._halfBlur(l,e,n,n,i,"longitudinal",o)}_halfBlur(e,t,n,i,o,l,h){const d=this._renderer,p=this._blurMaterial;l!=="latitudinal"&&l!=="longitudinal"&&Zt("blur direction must be either latitudinal or longitudinal!");const _=3,v=this._lodMeshes[i];v.material=p;const y=p.uniforms,x=this._sizeLods[n]-1,b=isFinite(o)?Math.PI/(2*x):2*Math.PI/(2*ju-1),R=o/b,T=isFinite(o)?1+Math.floor(_*R):ju;T>ju&&Ut(`sigmaRadians, ${o}, is too large and will clip, as it requested ${T} samples when the maximum is set to ${ju}`);const M=[];let w=0;for(let z=0;z<ju;++z){const V=z/R,U=Math.exp(-V*V/2);M.push(U),z===0?w+=U:z<T&&(w+=2*U)}for(let z=0;z<M.length;z++)M[z]=M[z]/w;y.envMap.value=e.texture,y.samples.value=T,y.weights.value=M,y.latitudinal.value=l==="latitudinal",h&&(y.poleAxis.value=h);const{_lodMax:D}=this;y.dTheta.value=b,y.mipInt.value=D-n;const N=this._sizeLods[i],H=3*N*(i>D-Tc?i-D+Tc:0),O=4*(this._cubeSize-N);Nh(t,H,O,3*N,2*N),d.setRenderTarget(t),d.render(v,Yp)}}function cN(s){const e=[],t=[],n=[];let i=s;const o=s-Tc+1+gE.length;for(let l=0;l<o;l++){const h=Math.pow(2,i);e.push(h);let d=1/h;l>s-Tc?d=gE[l-s+Tc-1]:l===0&&(d=0),t.push(d);const p=1/(h-2),_=-p,v=1+p,y=[_,_,v,_,v,v,_,_,v,v,_,v],x=6,b=6,R=3,T=2,M=1,w=new Float32Array(R*b*x),D=new Float32Array(T*b*x),N=new Float32Array(M*b*x);for(let O=0;O<x;O++){const z=O%3*2/3-1,V=O>2?0:-1,U=[z,V,0,z+2/3,V,0,z+2/3,V+1,0,z,V,0,z+2/3,V+1,0,z,V+1,0];w.set(U,R*b*O),D.set(y,T*b*O);const F=[O,O,O,O,O,O];N.set(F,M*b*O)}const H=new pn;H.setAttribute("position",new Hn(w,R)),H.setAttribute("uv",new Hn(D,T)),H.setAttribute("faceIndex",new Hn(N,M)),n.push(new yi(H,null)),i>Tc&&i--}return{lodMeshes:n,sizeLods:e,sigmas:t}}function _E(s,e,t){const n=new ds(s,e,t);return n.texture.mapping=jf,n.texture.name="PMREM.cubeUv",n.scissorTest=!0,n}function Nh(s,e,t,n,i){s.viewport.set(e,t,n,i),s.scissor.set(e,t,n,i)}function uN(s,e,t){return new ms({name:"PMREMGGXConvolution",defines:{GGX_SAMPLES:oN,CUBEUV_TEXEL_WIDTH:1/e,CUBEUV_TEXEL_HEIGHT:1/t,CUBEUV_MAX_MIP:`${s}.0`},uniforms:{envMap:{value:null},roughness:{value:0},mipInt:{value:0}},vertexShader:Wv(),fragmentShader:`
|
|
3613
|
+
}`},Ot={common:{diffuse:{value:new Ct(16777215)},opacity:{value:1},map:{value:null},mapTransform:{value:new yn},alphaMap:{value:null},alphaMapTransform:{value:new yn},alphaTest:{value:0}},specularmap:{specularMap:{value:null},specularMapTransform:{value:new yn}},envmap:{envMap:{value:null},envMapRotation:{value:new yn},flipEnvMap:{value:-1},reflectivity:{value:1},ior:{value:1.5},refractionRatio:{value:.98},dfgLUT:{value:null}},aomap:{aoMap:{value:null},aoMapIntensity:{value:1},aoMapTransform:{value:new yn}},lightmap:{lightMap:{value:null},lightMapIntensity:{value:1},lightMapTransform:{value:new yn}},bumpmap:{bumpMap:{value:null},bumpMapTransform:{value:new yn},bumpScale:{value:1}},normalmap:{normalMap:{value:null},normalMapTransform:{value:new yn},normalScale:{value:new nt(1,1)}},displacementmap:{displacementMap:{value:null},displacementMapTransform:{value:new yn},displacementScale:{value:1},displacementBias:{value:0}},emissivemap:{emissiveMap:{value:null},emissiveMapTransform:{value:new yn}},metalnessmap:{metalnessMap:{value:null},metalnessMapTransform:{value:new yn}},roughnessmap:{roughnessMap:{value:null},roughnessMapTransform:{value:new yn}},gradientmap:{gradientMap:{value:null}},fog:{fogDensity:{value:25e-5},fogNear:{value:1},fogFar:{value:2e3},fogColor:{value:new Ct(16777215)}},lights:{ambientLightColor:{value:[]},lightProbe:{value:[]},directionalLights:{value:[],properties:{direction:{},color:{}}},directionalLightShadows:{value:[],properties:{shadowIntensity:1,shadowBias:{},shadowNormalBias:{},shadowRadius:{},shadowMapSize:{}}},directionalShadowMap:{value:[]},directionalShadowMatrix:{value:[]},spotLights:{value:[],properties:{color:{},position:{},direction:{},distance:{},coneCos:{},penumbraCos:{},decay:{}}},spotLightShadows:{value:[],properties:{shadowIntensity:1,shadowBias:{},shadowNormalBias:{},shadowRadius:{},shadowMapSize:{}}},spotLightMap:{value:[]},spotShadowMap:{value:[]},spotLightMatrix:{value:[]},pointLights:{value:[],properties:{color:{},position:{},decay:{},distance:{}}},pointLightShadows:{value:[],properties:{shadowIntensity:1,shadowBias:{},shadowNormalBias:{},shadowRadius:{},shadowMapSize:{},shadowCameraNear:{},shadowCameraFar:{}}},pointShadowMap:{value:[]},pointShadowMatrix:{value:[]},hemisphereLights:{value:[],properties:{direction:{},skyColor:{},groundColor:{}}},rectAreaLights:{value:[],properties:{color:{},position:{},width:{},height:{}}},ltc_1:{value:null},ltc_2:{value:null}},points:{diffuse:{value:new Ct(16777215)},opacity:{value:1},size:{value:1},scale:{value:1},map:{value:null},alphaMap:{value:null},alphaMapTransform:{value:new yn},alphaTest:{value:0},uvTransform:{value:new yn}},sprite:{diffuse:{value:new Ct(16777215)},opacity:{value:1},center:{value:new nt(.5,.5)},rotation:{value:0},map:{value:null},mapTransform:{value:new yn},alphaMap:{value:null},alphaMapTransform:{value:new yn},alphaTest:{value:0}}},eo={basic:{uniforms:ps([Ot.common,Ot.specularmap,Ot.envmap,Ot.aomap,Ot.lightmap,Ot.fog]),vertexShader:bn.meshbasic_vert,fragmentShader:bn.meshbasic_frag},lambert:{uniforms:ps([Ot.common,Ot.specularmap,Ot.envmap,Ot.aomap,Ot.lightmap,Ot.emissivemap,Ot.bumpmap,Ot.normalmap,Ot.displacementmap,Ot.fog,Ot.lights,{emissive:{value:new Ct(0)}}]),vertexShader:bn.meshlambert_vert,fragmentShader:bn.meshlambert_frag},phong:{uniforms:ps([Ot.common,Ot.specularmap,Ot.envmap,Ot.aomap,Ot.lightmap,Ot.emissivemap,Ot.bumpmap,Ot.normalmap,Ot.displacementmap,Ot.fog,Ot.lights,{emissive:{value:new Ct(0)},specular:{value:new Ct(1118481)},shininess:{value:30}}]),vertexShader:bn.meshphong_vert,fragmentShader:bn.meshphong_frag},standard:{uniforms:ps([Ot.common,Ot.envmap,Ot.aomap,Ot.lightmap,Ot.emissivemap,Ot.bumpmap,Ot.normalmap,Ot.displacementmap,Ot.roughnessmap,Ot.metalnessmap,Ot.fog,Ot.lights,{emissive:{value:new Ct(0)},roughness:{value:1},metalness:{value:0},envMapIntensity:{value:1}}]),vertexShader:bn.meshphysical_vert,fragmentShader:bn.meshphysical_frag},toon:{uniforms:ps([Ot.common,Ot.aomap,Ot.lightmap,Ot.emissivemap,Ot.bumpmap,Ot.normalmap,Ot.displacementmap,Ot.gradientmap,Ot.fog,Ot.lights,{emissive:{value:new Ct(0)}}]),vertexShader:bn.meshtoon_vert,fragmentShader:bn.meshtoon_frag},matcap:{uniforms:ps([Ot.common,Ot.bumpmap,Ot.normalmap,Ot.displacementmap,Ot.fog,{matcap:{value:null}}]),vertexShader:bn.meshmatcap_vert,fragmentShader:bn.meshmatcap_frag},points:{uniforms:ps([Ot.points,Ot.fog]),vertexShader:bn.points_vert,fragmentShader:bn.points_frag},dashed:{uniforms:ps([Ot.common,Ot.fog,{scale:{value:1},dashSize:{value:1},totalSize:{value:2}}]),vertexShader:bn.linedashed_vert,fragmentShader:bn.linedashed_frag},depth:{uniforms:ps([Ot.common,Ot.displacementmap]),vertexShader:bn.depth_vert,fragmentShader:bn.depth_frag},normal:{uniforms:ps([Ot.common,Ot.bumpmap,Ot.normalmap,Ot.displacementmap,{opacity:{value:1}}]),vertexShader:bn.meshnormal_vert,fragmentShader:bn.meshnormal_frag},sprite:{uniforms:ps([Ot.sprite,Ot.fog]),vertexShader:bn.sprite_vert,fragmentShader:bn.sprite_frag},background:{uniforms:{uvTransform:{value:new yn},t2D:{value:null},backgroundIntensity:{value:1}},vertexShader:bn.background_vert,fragmentShader:bn.background_frag},backgroundCube:{uniforms:{envMap:{value:null},flipEnvMap:{value:-1},backgroundBlurriness:{value:0},backgroundIntensity:{value:1},backgroundRotation:{value:new yn}},vertexShader:bn.backgroundCube_vert,fragmentShader:bn.backgroundCube_frag},cube:{uniforms:{tCube:{value:null},tFlip:{value:-1},opacity:{value:1}},vertexShader:bn.cube_vert,fragmentShader:bn.cube_frag},equirect:{uniforms:{tEquirect:{value:null}},vertexShader:bn.equirect_vert,fragmentShader:bn.equirect_frag},distance:{uniforms:ps([Ot.common,Ot.displacementmap,{referencePosition:{value:new Z},nearDistance:{value:1},farDistance:{value:1e3}}]),vertexShader:bn.distance_vert,fragmentShader:bn.distance_frag},shadow:{uniforms:ps([Ot.lights,Ot.fog,{color:{value:new Ct(0)},opacity:{value:1}}]),vertexShader:bn.shadow_vert,fragmentShader:bn.shadow_frag}};eo.physical={uniforms:ps([eo.standard.uniforms,{clearcoat:{value:0},clearcoatMap:{value:null},clearcoatMapTransform:{value:new yn},clearcoatNormalMap:{value:null},clearcoatNormalMapTransform:{value:new yn},clearcoatNormalScale:{value:new nt(1,1)},clearcoatRoughness:{value:0},clearcoatRoughnessMap:{value:null},clearcoatRoughnessMapTransform:{value:new yn},dispersion:{value:0},iridescence:{value:0},iridescenceMap:{value:null},iridescenceMapTransform:{value:new yn},iridescenceIOR:{value:1.3},iridescenceThicknessMinimum:{value:100},iridescenceThicknessMaximum:{value:400},iridescenceThicknessMap:{value:null},iridescenceThicknessMapTransform:{value:new yn},sheen:{value:0},sheenColor:{value:new Ct(0)},sheenColorMap:{value:null},sheenColorMapTransform:{value:new yn},sheenRoughness:{value:1},sheenRoughnessMap:{value:null},sheenRoughnessMapTransform:{value:new yn},transmission:{value:0},transmissionMap:{value:null},transmissionMapTransform:{value:new yn},transmissionSamplerSize:{value:new nt},transmissionSamplerMap:{value:null},thickness:{value:0},thicknessMap:{value:null},thicknessMapTransform:{value:new yn},attenuationDistance:{value:0},attenuationColor:{value:new Ct(0)},specularColor:{value:new Ct(1,1,1)},specularColorMap:{value:null},specularColorMapTransform:{value:new yn},specularIntensity:{value:1},specularIntensityMap:{value:null},specularIntensityMapTransform:{value:new yn},anisotropyVector:{value:new nt},anisotropyMap:{value:null},anisotropyMapTransform:{value:new yn}}]),vertexShader:bn.meshphysical_vert,fragmentShader:bn.meshphysical_frag};const Kv={r:0,b:0,g:0},Wu=new er,eN=new en;function tN(s,e,t,n,i,o,l){const h=new Ct(0);let d=o===!0?0:1,p,_,v=null,y=0,x=null;function b(D){let N=D.isScene===!0?D.background:null;return N&&N.isTexture&&(N=(D.backgroundBlurriness>0?t:e).get(N)),N}function R(D){let N=!1;const H=b(D);H===null?M(h,d):H&&H.isColor&&(M(H,1),N=!0);const O=s.xr.getEnvironmentBlendMode();O==="additive"?n.buffers.color.setClear(0,0,0,1,l):O==="alpha-blend"&&n.buffers.color.setClear(0,0,0,0,l),(s.autoClear||N)&&(n.buffers.depth.setTest(!0),n.buffers.depth.setMask(!0),n.buffers.color.setMask(!0),s.clear(s.autoClearColor,s.autoClearDepth,s.autoClearStencil))}function T(D,N){const H=b(N);H&&(H.isCubeTexture||H.mapping===jf)?(_===void 0&&(_=new yi(new Du(1,1,1),new ms({name:"BackgroundCubeMaterial",uniforms:gh(eo.backgroundCube.uniforms),vertexShader:eo.backgroundCube.vertexShader,fragmentShader:eo.backgroundCube.fragmentShader,side:fs,depthTest:!1,depthWrite:!1,fog:!1,allowOverride:!1})),_.geometry.deleteAttribute("normal"),_.geometry.deleteAttribute("uv"),_.onBeforeRender=function(O,z,V){this.matrixWorld.copyPosition(V.matrixWorld)},Object.defineProperty(_.material,"envMap",{get:function(){return this.uniforms.envMap.value}}),i.update(_)),Wu.copy(N.backgroundRotation),Wu.x*=-1,Wu.y*=-1,Wu.z*=-1,H.isCubeTexture&&H.isRenderTargetTexture===!1&&(Wu.y*=-1,Wu.z*=-1),_.material.uniforms.envMap.value=H,_.material.uniforms.flipEnvMap.value=H.isCubeTexture&&H.isRenderTargetTexture===!1?-1:1,_.material.uniforms.backgroundBlurriness.value=N.backgroundBlurriness,_.material.uniforms.backgroundIntensity.value=N.backgroundIntensity,_.material.uniforms.backgroundRotation.value.setFromMatrix4(eN.makeRotationFromEuler(Wu)),_.material.toneMapped=Bn.getTransfer(H.colorSpace)!==si,(v!==H||y!==H.version||x!==s.toneMapping)&&(_.material.needsUpdate=!0,v=H,y=H.version,x=s.toneMapping),_.layers.enableAll(),D.unshift(_,_.geometry,_.material,0,0,null)):H&&H.isTexture&&(p===void 0&&(p=new yi(new Mc(2,2),new ms({name:"BackgroundMaterial",uniforms:gh(eo.background.uniforms),vertexShader:eo.background.vertexShader,fragmentShader:eo.background.fragmentShader,side:Yr,depthTest:!1,depthWrite:!1,fog:!1,allowOverride:!1})),p.geometry.deleteAttribute("normal"),Object.defineProperty(p.material,"map",{get:function(){return this.uniforms.t2D.value}}),i.update(p)),p.material.uniforms.t2D.value=H,p.material.uniforms.backgroundIntensity.value=N.backgroundIntensity,p.material.toneMapped=Bn.getTransfer(H.colorSpace)!==si,H.matrixAutoUpdate===!0&&H.updateMatrix(),p.material.uniforms.uvTransform.value.copy(H.matrix),(v!==H||y!==H.version||x!==s.toneMapping)&&(p.material.needsUpdate=!0,v=H,y=H.version,x=s.toneMapping),p.layers.enableAll(),D.unshift(p,p.geometry,p.material,0,0,null))}function M(D,N){D.getRGB(Kv,Lb(s)),n.buffers.color.setClear(Kv.r,Kv.g,Kv.b,N,l)}function w(){_!==void 0&&(_.geometry.dispose(),_.material.dispose(),_=void 0),p!==void 0&&(p.geometry.dispose(),p.material.dispose(),p=void 0)}return{getClearColor:function(){return h},setClearColor:function(D,N=1){h.set(D),d=N,M(h,d)},getClearAlpha:function(){return d},setClearAlpha:function(D){d=D,M(h,d)},render:R,addToRenderList:T,dispose:w}}function nN(s,e){const t=s.getParameter(s.MAX_VERTEX_ATTRIBS),n={},i=y(null);let o=i,l=!1;function h(F,K,ne,$,ae){let ge=!1;const I=v($,ne,K);o!==I&&(o=I,p(o.object)),ge=x(F,$,ne,ae),ge&&b(F,$,ne,ae),ae!==null&&e.update(ae,s.ELEMENT_ARRAY_BUFFER),(ge||l)&&(l=!1,N(F,K,ne,$),ae!==null&&s.bindBuffer(s.ELEMENT_ARRAY_BUFFER,e.get(ae).buffer))}function d(){return s.createVertexArray()}function p(F){return s.bindVertexArray(F)}function _(F){return s.deleteVertexArray(F)}function v(F,K,ne){const $=ne.wireframe===!0;let ae=n[F.id];ae===void 0&&(ae={},n[F.id]=ae);let ge=ae[K.id];ge===void 0&&(ge={},ae[K.id]=ge);let I=ge[$];return I===void 0&&(I=y(d()),ge[$]=I),I}function y(F){const K=[],ne=[],$=[];for(let ae=0;ae<t;ae++)K[ae]=0,ne[ae]=0,$[ae]=0;return{geometry:null,program:null,wireframe:!1,newAttributes:K,enabledAttributes:ne,attributeDivisors:$,object:F,attributes:{},index:null}}function x(F,K,ne,$){const ae=o.attributes,ge=K.attributes;let I=0;const W=ne.getAttributes();for(const ee in W)if(W[ee].location>=0){const _e=ae[ee];let X=ge[ee];if(X===void 0&&(ee==="instanceMatrix"&&F.instanceMatrix&&(X=F.instanceMatrix),ee==="instanceColor"&&F.instanceColor&&(X=F.instanceColor)),_e===void 0||_e.attribute!==X||X&&_e.data!==X.data)return!0;I++}return o.attributesNum!==I||o.index!==$}function b(F,K,ne,$){const ae={},ge=K.attributes;let I=0;const W=ne.getAttributes();for(const ee in W)if(W[ee].location>=0){let _e=ge[ee];_e===void 0&&(ee==="instanceMatrix"&&F.instanceMatrix&&(_e=F.instanceMatrix),ee==="instanceColor"&&F.instanceColor&&(_e=F.instanceColor));const X={};X.attribute=_e,_e&&_e.data&&(X.data=_e.data),ae[ee]=X,I++}o.attributes=ae,o.attributesNum=I,o.index=$}function R(){const F=o.newAttributes;for(let K=0,ne=F.length;K<ne;K++)F[K]=0}function T(F){M(F,0)}function M(F,K){const ne=o.newAttributes,$=o.enabledAttributes,ae=o.attributeDivisors;ne[F]=1,$[F]===0&&(s.enableVertexAttribArray(F),$[F]=1),ae[F]!==K&&(s.vertexAttribDivisor(F,K),ae[F]=K)}function w(){const F=o.newAttributes,K=o.enabledAttributes;for(let ne=0,$=K.length;ne<$;ne++)K[ne]!==F[ne]&&(s.disableVertexAttribArray(ne),K[ne]=0)}function D(F,K,ne,$,ae,ge,I){I===!0?s.vertexAttribIPointer(F,K,ne,ae,ge):s.vertexAttribPointer(F,K,ne,$,ae,ge)}function N(F,K,ne,$){R();const ae=$.attributes,ge=ne.getAttributes(),I=K.defaultAttributeValues;for(const W in ge){const ee=ge[W];if(ee.location>=0){let ye=ae[W];if(ye===void 0&&(W==="instanceMatrix"&&F.instanceMatrix&&(ye=F.instanceMatrix),W==="instanceColor"&&F.instanceColor&&(ye=F.instanceColor)),ye!==void 0){const _e=ye.normalized,X=ye.itemSize,te=e.get(ye);if(te===void 0)continue;const le=te.buffer,ve=te.type,ze=te.bytesPerElement,he=ve===s.INT||ve===s.UNSIGNED_INT||ye.gpuType===np;if(ye.isInterleavedBufferAttribute){const Ee=ye.data,lt=Ee.stride,Rt=ye.offset;if(Ee.isInstancedInterleavedBuffer){for(let Bt=0;Bt<ee.locationSize;Bt++)M(ee.location+Bt,Ee.meshPerAttribute);F.isInstancedMesh!==!0&&$._maxInstanceCount===void 0&&($._maxInstanceCount=Ee.meshPerAttribute*Ee.count)}else for(let Bt=0;Bt<ee.locationSize;Bt++)T(ee.location+Bt);s.bindBuffer(s.ARRAY_BUFFER,le);for(let Bt=0;Bt<ee.locationSize;Bt++)D(ee.location+Bt,X/ee.locationSize,ve,_e,lt*ze,(Rt+X/ee.locationSize*Bt)*ze,he)}else{if(ye.isInstancedBufferAttribute){for(let Ee=0;Ee<ee.locationSize;Ee++)M(ee.location+Ee,ye.meshPerAttribute);F.isInstancedMesh!==!0&&$._maxInstanceCount===void 0&&($._maxInstanceCount=ye.meshPerAttribute*ye.count)}else for(let Ee=0;Ee<ee.locationSize;Ee++)T(ee.location+Ee);s.bindBuffer(s.ARRAY_BUFFER,le);for(let Ee=0;Ee<ee.locationSize;Ee++)D(ee.location+Ee,X/ee.locationSize,ve,_e,X*ze,X/ee.locationSize*Ee*ze,he)}}else if(I!==void 0){const _e=I[W];if(_e!==void 0)switch(_e.length){case 2:s.vertexAttrib2fv(ee.location,_e);break;case 3:s.vertexAttrib3fv(ee.location,_e);break;case 4:s.vertexAttrib4fv(ee.location,_e);break;default:s.vertexAttrib1fv(ee.location,_e)}}}}w()}function H(){V();for(const F in n){const K=n[F];for(const ne in K){const $=K[ne];for(const ae in $)_($[ae].object),delete $[ae];delete K[ne]}delete n[F]}}function O(F){if(n[F.id]===void 0)return;const K=n[F.id];for(const ne in K){const $=K[ne];for(const ae in $)_($[ae].object),delete $[ae];delete K[ne]}delete n[F.id]}function z(F){for(const K in n){const ne=n[K];if(ne[F.id]===void 0)continue;const $=ne[F.id];for(const ae in $)_($[ae].object),delete $[ae];delete ne[F.id]}}function V(){U(),l=!0,o!==i&&(o=i,p(o.object))}function U(){i.geometry=null,i.program=null,i.wireframe=!1}return{setup:h,reset:V,resetDefaultState:U,dispose:H,releaseStatesOfGeometry:O,releaseStatesOfProgram:z,initAttributes:R,enableAttribute:T,disableUnusedAttributes:w}}function iN(s,e,t){let n;function i(p){n=p}function o(p,_){s.drawArrays(n,p,_),t.update(_,n,1)}function l(p,_,v){v!==0&&(s.drawArraysInstanced(n,p,_,v),t.update(_,n,v))}function h(p,_,v){if(v===0)return;e.get("WEBGL_multi_draw").multiDrawArraysWEBGL(n,p,0,_,0,v);let x=0;for(let b=0;b<v;b++)x+=_[b];t.update(x,n,1)}function d(p,_,v,y){if(v===0)return;const x=e.get("WEBGL_multi_draw");if(x===null)for(let b=0;b<p.length;b++)l(p[b],_[b],y[b]);else{x.multiDrawArraysInstancedWEBGL(n,p,0,_,0,y,0,v);let b=0;for(let R=0;R<v;R++)b+=_[R]*y[R];t.update(b,n,1)}}this.setMode=i,this.render=o,this.renderInstances=l,this.renderMultiDraw=h,this.renderMultiDrawInstances=d}function aN(s,e,t,n){let i;function o(){if(i!==void 0)return i;if(e.has("EXT_texture_filter_anisotropic")===!0){const z=e.get("EXT_texture_filter_anisotropic");i=s.getParameter(z.MAX_TEXTURE_MAX_ANISOTROPY_EXT)}else i=0;return i}function l(z){return!(z!==Zi&&n.convert(z)!==s.getParameter(s.IMPLEMENTATION_COLOR_READ_FORMAT))}function h(z){const V=z===ki&&(e.has("EXT_color_buffer_half_float")||e.has("EXT_color_buffer_float"));return!(z!==Ta&&n.convert(z)!==s.getParameter(s.IMPLEMENTATION_COLOR_READ_TYPE)&&z!==Ci&&!V)}function d(z){if(z==="highp"){if(s.getShaderPrecisionFormat(s.VERTEX_SHADER,s.HIGH_FLOAT).precision>0&&s.getShaderPrecisionFormat(s.FRAGMENT_SHADER,s.HIGH_FLOAT).precision>0)return"highp";z="mediump"}return z==="mediump"&&s.getShaderPrecisionFormat(s.VERTEX_SHADER,s.MEDIUM_FLOAT).precision>0&&s.getShaderPrecisionFormat(s.FRAGMENT_SHADER,s.MEDIUM_FLOAT).precision>0?"mediump":"lowp"}let p=t.precision!==void 0?t.precision:"highp";const _=d(p);_!==p&&(Ut("WebGLRenderer:",p,"not supported, using",_,"instead."),p=_);const v=t.logarithmicDepthBuffer===!0,y=t.reversedDepthBuffer===!0&&e.has("EXT_clip_control"),x=s.getParameter(s.MAX_TEXTURE_IMAGE_UNITS),b=s.getParameter(s.MAX_VERTEX_TEXTURE_IMAGE_UNITS),R=s.getParameter(s.MAX_TEXTURE_SIZE),T=s.getParameter(s.MAX_CUBE_MAP_TEXTURE_SIZE),M=s.getParameter(s.MAX_VERTEX_ATTRIBS),w=s.getParameter(s.MAX_VERTEX_UNIFORM_VECTORS),D=s.getParameter(s.MAX_VARYING_VECTORS),N=s.getParameter(s.MAX_FRAGMENT_UNIFORM_VECTORS),H=s.getParameter(s.MAX_SAMPLES),O=s.getParameter(s.SAMPLES);return{isWebGL2:!0,getMaxAnisotropy:o,getMaxPrecision:d,textureFormatReadable:l,textureTypeReadable:h,precision:p,logarithmicDepthBuffer:v,reversedDepthBuffer:y,maxTextures:x,maxVertexTextures:b,maxTextureSize:R,maxCubemapSize:T,maxAttributes:M,maxVertexUniforms:w,maxVaryings:D,maxFragmentUniforms:N,maxSamples:H,samples:O}}function sN(s){const e=this;let t=null,n=0,i=!1,o=!1;const l=new Ac,h=new yn,d={value:null,needsUpdate:!1};this.uniform=d,this.numPlanes=0,this.numIntersection=0,this.init=function(v,y){const x=v.length!==0||y||n!==0||i;return i=y,n=v.length,x},this.beginShadows=function(){o=!0,_(null)},this.endShadows=function(){o=!1},this.setGlobalState=function(v,y){t=_(v,y,0)},this.setState=function(v,y,x){const b=v.clippingPlanes,R=v.clipIntersection,T=v.clipShadows,M=s.get(v);if(!i||b===null||b.length===0||o&&!T)o?_(null):p();else{const w=o?0:n,D=w*4;let N=M.clippingState||null;d.value=N,N=_(b,y,D,x);for(let H=0;H!==D;++H)N[H]=t[H];M.clippingState=N,this.numIntersection=R?this.numPlanes:0,this.numPlanes+=w}};function p(){d.value!==t&&(d.value=t,d.needsUpdate=n>0),e.numPlanes=n,e.numIntersection=0}function _(v,y,x,b){const R=v!==null?v.length:0;let T=null;if(R!==0){if(T=d.value,b!==!0||T===null){const M=x+R*4,w=y.matrixWorldInverse;h.getNormalMatrix(w),(T===null||T.length<M)&&(T=new Float32Array(M));for(let D=0,N=x;D!==R;++D,N+=4)l.copy(v[D]).applyMatrix4(w,h),l.normal.toArray(T,N),T[N+3]=l.constant}d.value=T,d.needsUpdate=!0}return e.numPlanes=R,e.numIntersection=0,T}}function rN(s){let e=new WeakMap;function t(l,h){return h===Wf?l.mapping=qr:h===ep&&(l.mapping=oc),l}function n(l){if(l&&l.isTexture){const h=l.mapping;if(h===Wf||h===ep)if(e.has(l)){const d=e.get(l).texture;return t(d,l.mapping)}else{const d=l.image;if(d&&d.height>0){const p=new Y0(d.height);return p.fromEquirectangularTexture(s,l),e.set(l,p),l.addEventListener("dispose",i),t(p.texture,l.mapping)}else return null}}return l}function i(l){const h=l.target;h.removeEventListener("dispose",i);const d=e.get(h);d!==void 0&&(e.delete(h),d.dispose())}function o(){e=new WeakMap}return{get:n,dispose:o}}const Tc=4,gE=[.125,.215,.35,.446,.526,.582],ju=20,oN=256,Yp=new Tl,vE=new Ct;let wA=null,BA=0,DA=0,NA=!1;const lN=new Z;class UA{constructor(e){this._renderer=e,this._pingPongRenderTarget=null,this._lodMax=0,this._cubeSize=0,this._sizeLods=[],this._sigmas=[],this._lodMeshes=[],this._backgroundBox=null,this._cubemapMaterial=null,this._equirectMaterial=null,this._blurMaterial=null,this._ggxMaterial=null}fromScene(e,t=0,n=.1,i=100,o={}){const{size:l=256,position:h=lN}=o;wA=this._renderer.getRenderTarget(),BA=this._renderer.getActiveCubeFace(),DA=this._renderer.getActiveMipmapLevel(),NA=this._renderer.xr.enabled,this._renderer.xr.enabled=!1,this._setSize(l);const d=this._allocateTargets();return d.depthBuffer=!0,this._sceneToCubeUV(e,n,i,d,h),t>0&&this._blur(d,0,0,t),this._applyPMREM(d),this._cleanup(d),d}fromEquirectangular(e,t=null){return this._fromTexture(e,t)}fromCubemap(e,t=null){return this._fromTexture(e,t)}compileCubemapShader(){this._cubemapMaterial===null&&(this._cubemapMaterial=xE(),this._compileMaterial(this._cubemapMaterial))}compileEquirectangularShader(){this._equirectMaterial===null&&(this._equirectMaterial=yE(),this._compileMaterial(this._equirectMaterial))}dispose(){this._dispose(),this._cubemapMaterial!==null&&this._cubemapMaterial.dispose(),this._equirectMaterial!==null&&this._equirectMaterial.dispose(),this._backgroundBox!==null&&(this._backgroundBox.geometry.dispose(),this._backgroundBox.material.dispose())}_setSize(e){this._lodMax=Math.floor(Math.log2(e)),this._cubeSize=Math.pow(2,this._lodMax)}_dispose(){this._blurMaterial!==null&&this._blurMaterial.dispose(),this._ggxMaterial!==null&&this._ggxMaterial.dispose(),this._pingPongRenderTarget!==null&&this._pingPongRenderTarget.dispose();for(let e=0;e<this._lodMeshes.length;e++)this._lodMeshes[e].geometry.dispose()}_cleanup(e){this._renderer.setRenderTarget(wA,BA,DA),this._renderer.xr.enabled=NA,e.scissorTest=!1,Nh(e,0,0,e.width,e.height)}_fromTexture(e,t){e.mapping===qr||e.mapping===oc?this._setSize(e.image.length===0?16:e.image[0].width||e.image[0].image.width):this._setSize(e.image.width/4),wA=this._renderer.getRenderTarget(),BA=this._renderer.getActiveCubeFace(),DA=this._renderer.getActiveMipmapLevel(),NA=this._renderer.xr.enabled,this._renderer.xr.enabled=!1;const n=t||this._allocateTargets();return this._textureToCubeUV(e,n),this._applyPMREM(n),this._cleanup(n),n}_allocateTargets(){const e=3*Math.max(this._cubeSize,112),t=4*this._cubeSize,n={magFilter:Cn,minFilter:Cn,generateMipmaps:!1,type:ki,format:Zi,colorSpace:na,depthBuffer:!1},i=_E(e,t,n);if(this._pingPongRenderTarget===null||this._pingPongRenderTarget.width!==e||this._pingPongRenderTarget.height!==t){this._pingPongRenderTarget!==null&&this._dispose(),this._pingPongRenderTarget=_E(e,t,n);const{_lodMax:o}=this;({lodMeshes:this._lodMeshes,sizeLods:this._sizeLods,sigmas:this._sigmas}=cN(o)),this._blurMaterial=fN(o,e,t),this._ggxMaterial=uN(o,e,t)}return i}_compileMaterial(e){const t=new yi(new pn,e);this._renderer.compile(t,Yp)}_sceneToCubeUV(e,t,n,i,o){const d=new aa(90,1,t,n),p=[1,-1,1,1,1,1],_=[1,1,1,-1,-1,-1],v=this._renderer,y=v.autoClear,x=v.toneMapping;v.getClearColor(vE),v.toneMapping=mr,v.autoClear=!1,v.state.buffers.depth.getReversed()&&(v.setRenderTarget(i),v.clearDepth(),v.setRenderTarget(null)),this._backgroundBox===null&&(this._backgroundBox=new yi(new Du,new ha({name:"PMREM.Background",side:fs,depthWrite:!1,depthTest:!1})));const R=this._backgroundBox,T=R.material;let M=!1;const w=e.background;w?w.isColor&&(T.color.copy(w),e.background=null,M=!0):(T.color.copy(vE),M=!0);for(let D=0;D<6;D++){const N=D%3;N===0?(d.up.set(0,p[D],0),d.position.set(o.x,o.y,o.z),d.lookAt(o.x+_[D],o.y,o.z)):N===1?(d.up.set(0,0,p[D]),d.position.set(o.x,o.y,o.z),d.lookAt(o.x,o.y+_[D],o.z)):(d.up.set(0,p[D],0),d.position.set(o.x,o.y,o.z),d.lookAt(o.x,o.y,o.z+_[D]));const H=this._cubeSize;Nh(i,N*H,D>2?H:0,H,H),v.setRenderTarget(i),M&&v.render(R,d),v.render(e,d)}v.toneMapping=x,v.autoClear=y,e.background=w}_textureToCubeUV(e,t){const n=this._renderer,i=e.mapping===qr||e.mapping===oc;i?(this._cubemapMaterial===null&&(this._cubemapMaterial=xE()),this._cubemapMaterial.uniforms.flipEnvMap.value=e.isRenderTargetTexture===!1?-1:1):this._equirectMaterial===null&&(this._equirectMaterial=yE());const o=i?this._cubemapMaterial:this._equirectMaterial,l=this._lodMeshes[0];l.material=o;const h=o.uniforms;h.envMap.value=e;const d=this._cubeSize;Nh(t,0,0,3*d,2*d),n.setRenderTarget(t),n.render(l,Yp)}_applyPMREM(e){const t=this._renderer,n=t.autoClear;t.autoClear=!1;const i=this._lodMeshes.length;for(let o=1;o<i;o++)this._applyGGXFilter(e,o-1,o);t.autoClear=n}_applyGGXFilter(e,t,n){const i=this._renderer,o=this._pingPongRenderTarget,l=this._ggxMaterial,h=this._lodMeshes[n];h.material=l;const d=l.uniforms,p=n/(this._lodMeshes.length-1),_=t/(this._lodMeshes.length-1),v=Math.sqrt(p*p-_*_),y=0+p*1.25,x=v*y,{_lodMax:b}=this,R=this._sizeLods[n],T=3*R*(n>b-Tc?n-b+Tc:0),M=4*(this._cubeSize-R);d.envMap.value=e.texture,d.roughness.value=x,d.mipInt.value=b-t,Nh(o,T,M,3*R,2*R),i.setRenderTarget(o),i.render(h,Yp),d.envMap.value=o.texture,d.roughness.value=0,d.mipInt.value=b-n,Nh(e,T,M,3*R,2*R),i.setRenderTarget(e),i.render(h,Yp)}_blur(e,t,n,i,o){const l=this._pingPongRenderTarget;this._halfBlur(e,l,t,n,i,"latitudinal",o),this._halfBlur(l,e,n,n,i,"longitudinal",o)}_halfBlur(e,t,n,i,o,l,h){const d=this._renderer,p=this._blurMaterial;l!=="latitudinal"&&l!=="longitudinal"&&Zt("blur direction must be either latitudinal or longitudinal!");const _=3,v=this._lodMeshes[i];v.material=p;const y=p.uniforms,x=this._sizeLods[n]-1,b=isFinite(o)?Math.PI/(2*x):2*Math.PI/(2*ju-1),R=o/b,T=isFinite(o)?1+Math.floor(_*R):ju;T>ju&&Ut(`sigmaRadians, ${o}, is too large and will clip, as it requested ${T} samples when the maximum is set to ${ju}`);const M=[];let w=0;for(let z=0;z<ju;++z){const V=z/R,U=Math.exp(-V*V/2);M.push(U),z===0?w+=U:z<T&&(w+=2*U)}for(let z=0;z<M.length;z++)M[z]=M[z]/w;y.envMap.value=e.texture,y.samples.value=T,y.weights.value=M,y.latitudinal.value=l==="latitudinal",h&&(y.poleAxis.value=h);const{_lodMax:D}=this;y.dTheta.value=b,y.mipInt.value=D-n;const N=this._sizeLods[i],H=3*N*(i>D-Tc?i-D+Tc:0),O=4*(this._cubeSize-N);Nh(t,H,O,3*N,2*N),d.setRenderTarget(t),d.render(v,Yp)}}function cN(s){const e=[],t=[],n=[];let i=s;const o=s-Tc+1+gE.length;for(let l=0;l<o;l++){const h=Math.pow(2,i);e.push(h);let d=1/h;l>s-Tc?d=gE[l-s+Tc-1]:l===0&&(d=0),t.push(d);const p=1/(h-2),_=-p,v=1+p,y=[_,_,v,_,v,v,_,_,v,v,_,v],x=6,b=6,R=3,T=2,M=1,w=new Float32Array(R*b*x),D=new Float32Array(T*b*x),N=new Float32Array(M*b*x);for(let O=0;O<x;O++){const z=O%3*2/3-1,V=O>2?0:-1,U=[z,V,0,z+2/3,V,0,z+2/3,V+1,0,z,V,0,z+2/3,V+1,0,z,V+1,0];w.set(U,R*b*O),D.set(y,T*b*O);const F=[O,O,O,O,O,O];N.set(F,M*b*O)}const H=new pn;H.setAttribute("position",new Hn(w,R)),H.setAttribute("uv",new Hn(D,T)),H.setAttribute("faceIndex",new Hn(N,M)),n.push(new yi(H,null)),i>Tc&&i--}return{lodMeshes:n,sizeLods:e,sigmas:t}}function _E(s,e,t){const n=new ds(s,e,t);return n.texture.mapping=jf,n.texture.name="PMREM.cubeUv",n.scissorTest=!0,n}function Nh(s,e,t,n,i){s.viewport.set(e,t,n,i),s.scissor.set(e,t,n,i)}function uN(s,e,t){return new ms({name:"PMREMGGXConvolution",defines:{GGX_SAMPLES:oN,CUBEUV_TEXEL_WIDTH:1/e,CUBEUV_TEXEL_HEIGHT:1/t,CUBEUV_MAX_MIP:`${s}.0`},uniforms:{envMap:{value:null},roughness:{value:0},mipInt:{value:0}},vertexShader:Wv(),fragmentShader:`
|
|
3614
3614
|
|
|
3615
3615
|
precision highp float;
|
|
3616
3616
|
precision highp int;
|
|
@@ -3965,7 +3965,7 @@ Material Type: `+K.type+`
|
|
|
3965
3965
|
|
|
3966
3966
|
Program Info Log: `+ge+`
|
|
3967
3967
|
`+_e+`
|
|
3968
|
-
`+X)}else ge!==""?Ut("WebGLProgram: Program Info Log:",ge):(I===""||W==="")&&(ye=!1);ye&&(K.diagnostics={runnable:ee,programLog:ge,vertexShader:{log:I,prefix:T},fragmentShader:{log:W,prefix:M}})}i.deleteShader(H),i.deleteShader(O),V=new Zv(i,R),U=AU(i,R)}let V;this.getUniforms=function(){return V===void 0&&z(this),V};let U;this.getAttributes=function(){return U===void 0&&z(this),U};let F=t.rendererExtensionParallelShaderCompile===!1;return this.isReady=function(){return F===!1&&(F=i.getProgramParameter(R,fU)),F},this.destroy=function(){n.releaseStatesOfProgram(this),i.deleteProgram(R),this.program=void 0},this.type=t.shaderType,this.name=t.shaderName,this.id=hU++,this.cacheKey=e,this.usedTimes=1,this.program=R,this.vertexShader=H,this.fragmentShader=O,this}let FU=0;class HU{constructor(){this.shaderCache=new Map,this.materialCache=new Map}update(e){const t=e.vertexShader,n=e.fragmentShader,i=this._getShaderStage(t),o=this._getShaderStage(n),l=this._getShaderCacheForMaterial(e);return l.has(i)===!1&&(l.add(i),i.usedTimes++),l.has(o)===!1&&(l.add(o),o.usedTimes++),this}remove(e){const t=this.materialCache.get(e);for(const n of t)n.usedTimes--,n.usedTimes===0&&this.shaderCache.delete(n.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 n=t.get(e);return n===void 0&&(n=new Set,t.set(e,n)),n}_getShaderStage(e){const t=this.shaderCache;let n=t.get(e);return n===void 0&&(n=new PU(e),t.set(e,n)),n}}class PU{constructor(e){this.id=FU++,this.code=e,this.usedTimes=0}}function GU(s,e,t,n,i,o,l){const h=new uh,d=new HU,p=new Set,_=[],v=new Map,y=i.logarithmicDepthBuffer;let x=i.precision;const b={MeshDepthMaterial:"depth",MeshDistanceMaterial:"distance",MeshNormalMaterial:"normal",MeshBasicMaterial:"basic",MeshLambertMaterial:"lambert",MeshPhongMaterial:"phong",MeshToonMaterial:"toon",MeshStandardMaterial:"physical",MeshPhysicalMaterial:"physical",MeshMatcapMaterial:"matcap",LineBasicMaterial:"basic",LineDashedMaterial:"dashed",PointsMaterial:"points",ShadowMaterial:"shadow",SpriteMaterial:"sprite"};function R(U){return p.add(U),U===0?"uv":`uv${U}`}function T(U,F,K,ne,$){const ae=ne.fog,ge=$.geometry,I=U.isMeshStandardMaterial?ne.environment:null,W=(U.isMeshStandardMaterial?t:e).get(U.envMap||I),ee=W&&W.mapping===jf?W.image.height:null,ye=b[U.type];U.precision!==null&&(x=i.getMaxPrecision(U.precision),x!==U.precision&&Ut("WebGLProgram.getParameters:",U.precision,"not supported, using",x,"instead."));const _e=ge.morphAttributes.position||ge.morphAttributes.normal||ge.morphAttributes.color,X=_e!==void 0?_e.length:0;let te=0;ge.morphAttributes.position!==void 0&&(te=1),ge.morphAttributes.normal!==void 0&&(te=2),ge.morphAttributes.color!==void 0&&(te=3);let le,ve,ze,he;if(ye){const Mn=eo[ye];le=Mn.vertexShader,ve=Mn.fragmentShader}else le=U.vertexShader,ve=U.fragmentShader,d.update(U),ze=d.getVertexShaderID(U),he=d.getFragmentShaderID(U);const Ee=s.getRenderTarget(),lt=s.state.buffers.depth.getReversed(),Rt=$.isInstancedMesh===!0,Bt=$.isBatchedMesh===!0,tn=!!U.map,on=!!U.matcap,Wt=!!W,Ge=!!U.aoMap,et=!!U.lightMap,Je=!!U.bumpMap,xt=!!U.normalMap,Q=!!U.displacementMap,Dt=!!U.emissiveMap,mt=!!U.metalnessMap,Ot=!!U.roughnessMap,gt=U.anisotropy>0,j=U.clearcoat>0,P=U.dispersion>0,de=U.iridescence>0,Fe=U.sheen>0,ke=U.transmission>0,Ie=gt&&!!U.anisotropyMap,Ft=j&&!!U.clearcoatMap,Mt=j&&!!U.clearcoatNormalMap,Ht=j&&!!U.clearcoatRoughnessMap,zt=de&&!!U.iridescenceMap,Ye=de&&!!U.iridescenceThicknessMap,qe=Fe&&!!U.sheenColorMap,wt=Fe&&!!U.sheenRoughnessMap,bt=!!U.specularMap,rt=!!U.specularColorMap,Vt=!!U.specularIntensityMap,fe=ke&&!!U.transmissionMap,Ne=ke&&!!U.thicknessMap,ot=!!U.gradientMap,Et=!!U.alphaMap,Qe=U.alphaTest>0,We=!!U.alphaHash,_t=!!U.extensions;let nn=mr;U.toneMapped&&(Ee===null||Ee.isXRRenderTarget===!0)&&(nn=s.toneMapping);const wn={shaderID:ye,shaderType:U.type,shaderName:U.name,vertexShader:le,fragmentShader:ve,defines:U.defines,customVertexShaderID:ze,customFragmentShaderID:he,isRawShaderMaterial:U.isRawShaderMaterial===!0,glslVersion:U.glslVersion,precision:x,batching:Bt,batchingColor:Bt&&$._colorsTexture!==null,instancing:Rt,instancingColor:Rt&&$.instanceColor!==null,instancingMorph:Rt&&$.morphTexture!==null,outputColorSpace:Ee===null?s.outputColorSpace:Ee.isXRRenderTarget===!0?Ee.texture.colorSpace:na,alphaToCoverage:!!U.alphaToCoverage,map:tn,matcap:on,envMap:Wt,envMapMode:Wt&&W.mapping,envMapCubeUVHeight:ee,aoMap:Ge,lightMap:et,bumpMap:Je,normalMap:xt,displacementMap:Q,emissiveMap:Dt,normalMapObjectSpace:xt&&U.normalMapType===rb,normalMapTangentSpace:xt&&U.normalMapType===fc,metalnessMap:mt,roughnessMap:Ot,anisotropy:gt,anisotropyMap:Ie,clearcoat:j,clearcoatMap:Ft,clearcoatNormalMap:Mt,clearcoatRoughnessMap:Ht,dispersion:P,iridescence:de,iridescenceMap:zt,iridescenceThicknessMap:Ye,sheen:Fe,sheenColorMap:qe,sheenRoughnessMap:wt,specularMap:bt,specularColorMap:rt,specularIntensityMap:Vt,transmission:ke,transmissionMap:fe,thicknessMap:Ne,gradientMap:ot,opaque:U.transparent===!1&&U.blending===gu&&U.alphaToCoverage===!1,alphaMap:Et,alphaTest:Qe,alphaHash:We,combine:U.combine,mapUv:tn&&R(U.map.channel),aoMapUv:Ge&&R(U.aoMap.channel),lightMapUv:et&&R(U.lightMap.channel),bumpMapUv:Je&&R(U.bumpMap.channel),normalMapUv:xt&&R(U.normalMap.channel),displacementMapUv:Q&&R(U.displacementMap.channel),emissiveMapUv:Dt&&R(U.emissiveMap.channel),metalnessMapUv:mt&&R(U.metalnessMap.channel),roughnessMapUv:Ot&&R(U.roughnessMap.channel),anisotropyMapUv:Ie&&R(U.anisotropyMap.channel),clearcoatMapUv:Ft&&R(U.clearcoatMap.channel),clearcoatNormalMapUv:Mt&&R(U.clearcoatNormalMap.channel),clearcoatRoughnessMapUv:Ht&&R(U.clearcoatRoughnessMap.channel),iridescenceMapUv:zt&&R(U.iridescenceMap.channel),iridescenceThicknessMapUv:Ye&&R(U.iridescenceThicknessMap.channel),sheenColorMapUv:qe&&R(U.sheenColorMap.channel),sheenRoughnessMapUv:wt&&R(U.sheenRoughnessMap.channel),specularMapUv:bt&&R(U.specularMap.channel),specularColorMapUv:rt&&R(U.specularColorMap.channel),specularIntensityMapUv:Vt&&R(U.specularIntensityMap.channel),transmissionMapUv:fe&&R(U.transmissionMap.channel),thicknessMapUv:Ne&&R(U.thicknessMap.channel),alphaMapUv:Et&&R(U.alphaMap.channel),vertexTangents:!!ge.attributes.tangent&&(xt||gt),vertexColors:U.vertexColors,vertexAlphas:U.vertexColors===!0&&!!ge.attributes.color&&ge.attributes.color.itemSize===4,pointsUvs:$.isPoints===!0&&!!ge.attributes.uv&&(tn||Et),fog:!!ae,useFog:U.fog===!0,fogExp2:!!ae&&ae.isFogExp2,flatShading:U.flatShading===!0&&U.wireframe===!1,sizeAttenuation:U.sizeAttenuation===!0,logarithmicDepthBuffer:y,reversedDepthBuffer:lt,skinning:$.isSkinnedMesh===!0,morphTargets:ge.morphAttributes.position!==void 0,morphNormals:ge.morphAttributes.normal!==void 0,morphColors:ge.morphAttributes.color!==void 0,morphTargetsCount:X,morphTextureStride:te,numDirLights:F.directional.length,numPointLights:F.point.length,numSpotLights:F.spot.length,numSpotLightMaps:F.spotLightMap.length,numRectAreaLights:F.rectArea.length,numHemiLights:F.hemi.length,numDirLightShadows:F.directionalShadowMap.length,numPointLightShadows:F.pointShadowMap.length,numSpotLightShadows:F.spotShadowMap.length,numSpotLightShadowsWithMaps:F.numSpotLightShadowsWithMaps,numLightProbes:F.numLightProbes,numClippingPlanes:l.numPlanes,numClipIntersection:l.numIntersection,dithering:U.dithering,shadowMapEnabled:s.shadowMap.enabled&&K.length>0,shadowMapType:s.shadowMap.type,toneMapping:nn,decodeVideoTexture:tn&&U.map.isVideoTexture===!0&&Bn.getTransfer(U.map.colorSpace)===si,decodeVideoTextureEmissive:Dt&&U.emissiveMap.isVideoTexture===!0&&Bn.getTransfer(U.emissiveMap.colorSpace)===si,premultipliedAlpha:U.premultipliedAlpha,doubleSided:U.side===Ws,flipSided:U.side===fs,useDepthPacking:U.depthPacking>=0,depthPacking:U.depthPacking||0,index0AttributeName:U.index0AttributeName,extensionClipCullDistance:_t&&U.extensions.clipCullDistance===!0&&n.has("WEBGL_clip_cull_distance"),extensionMultiDraw:(_t&&U.extensions.multiDraw===!0||Bt)&&n.has("WEBGL_multi_draw"),rendererExtensionParallelShaderCompile:n.has("KHR_parallel_shader_compile"),customProgramCacheKey:U.customProgramCacheKey()};return wn.vertexUv1s=p.has(1),wn.vertexUv2s=p.has(2),wn.vertexUv3s=p.has(3),p.clear(),wn}function M(U){const F=[];if(U.shaderID?F.push(U.shaderID):(F.push(U.customVertexShaderID),F.push(U.customFragmentShaderID)),U.defines!==void 0)for(const K in U.defines)F.push(K),F.push(U.defines[K]);return U.isRawShaderMaterial===!1&&(w(F,U),D(F,U),F.push(s.outputColorSpace)),F.push(U.customProgramCacheKey),F.join()}function w(U,F){U.push(F.precision),U.push(F.outputColorSpace),U.push(F.envMapMode),U.push(F.envMapCubeUVHeight),U.push(F.mapUv),U.push(F.alphaMapUv),U.push(F.lightMapUv),U.push(F.aoMapUv),U.push(F.bumpMapUv),U.push(F.normalMapUv),U.push(F.displacementMapUv),U.push(F.emissiveMapUv),U.push(F.metalnessMapUv),U.push(F.roughnessMapUv),U.push(F.anisotropyMapUv),U.push(F.clearcoatMapUv),U.push(F.clearcoatNormalMapUv),U.push(F.clearcoatRoughnessMapUv),U.push(F.iridescenceMapUv),U.push(F.iridescenceThicknessMapUv),U.push(F.sheenColorMapUv),U.push(F.sheenRoughnessMapUv),U.push(F.specularMapUv),U.push(F.specularColorMapUv),U.push(F.specularIntensityMapUv),U.push(F.transmissionMapUv),U.push(F.thicknessMapUv),U.push(F.combine),U.push(F.fogExp2),U.push(F.sizeAttenuation),U.push(F.morphTargetsCount),U.push(F.morphAttributeCount),U.push(F.numDirLights),U.push(F.numPointLights),U.push(F.numSpotLights),U.push(F.numSpotLightMaps),U.push(F.numHemiLights),U.push(F.numRectAreaLights),U.push(F.numDirLightShadows),U.push(F.numPointLightShadows),U.push(F.numSpotLightShadows),U.push(F.numSpotLightShadowsWithMaps),U.push(F.numLightProbes),U.push(F.shadowMapType),U.push(F.toneMapping),U.push(F.numClippingPlanes),U.push(F.numClipIntersection),U.push(F.depthPacking)}function D(U,F){h.disableAll(),F.instancing&&h.enable(0),F.instancingColor&&h.enable(1),F.instancingMorph&&h.enable(2),F.matcap&&h.enable(3),F.envMap&&h.enable(4),F.normalMapObjectSpace&&h.enable(5),F.normalMapTangentSpace&&h.enable(6),F.clearcoat&&h.enable(7),F.iridescence&&h.enable(8),F.alphaTest&&h.enable(9),F.vertexColors&&h.enable(10),F.vertexAlphas&&h.enable(11),F.vertexUv1s&&h.enable(12),F.vertexUv2s&&h.enable(13),F.vertexUv3s&&h.enable(14),F.vertexTangents&&h.enable(15),F.anisotropy&&h.enable(16),F.alphaHash&&h.enable(17),F.batching&&h.enable(18),F.dispersion&&h.enable(19),F.batchingColor&&h.enable(20),F.gradientMap&&h.enable(21),U.push(h.mask),h.disableAll(),F.fog&&h.enable(0),F.useFog&&h.enable(1),F.flatShading&&h.enable(2),F.logarithmicDepthBuffer&&h.enable(3),F.reversedDepthBuffer&&h.enable(4),F.skinning&&h.enable(5),F.morphTargets&&h.enable(6),F.morphNormals&&h.enable(7),F.morphColors&&h.enable(8),F.premultipliedAlpha&&h.enable(9),F.shadowMapEnabled&&h.enable(10),F.doubleSided&&h.enable(11),F.flipSided&&h.enable(12),F.useDepthPacking&&h.enable(13),F.dithering&&h.enable(14),F.transmission&&h.enable(15),F.sheen&&h.enable(16),F.opaque&&h.enable(17),F.pointsUvs&&h.enable(18),F.decodeVideoTexture&&h.enable(19),F.decodeVideoTextureEmissive&&h.enable(20),F.alphaToCoverage&&h.enable(21),U.push(h.mask)}function N(U){const F=b[U.type];let K;if(F){const ne=eo[F];K=Ob.clone(ne.uniforms)}else K=U.uniforms;return K}function H(U,F){let K=v.get(F);return K!==void 0?++K.usedTimes:(K=new IU(s,F,U,o),_.push(K),v.set(F,K)),K}function O(U){if(--U.usedTimes===0){const F=_.indexOf(U);_[F]=_[_.length-1],_.pop(),v.delete(U.cacheKey),U.destroy()}}function z(U){d.remove(U)}function V(){d.dispose()}return{getParameters:T,getProgramCacheKey:M,getUniforms:N,acquireProgram:H,releaseProgram:O,releaseShaderCache:z,programs:_,dispose:V}}function zU(){let s=new WeakMap;function e(l){return s.has(l)}function t(l){let h=s.get(l);return h===void 0&&(h={},s.set(l,h)),h}function n(l){s.delete(l)}function i(l,h,d){s.get(l)[h]=d}function o(){s=new WeakMap}return{has:e,get:t,remove:n,update:i,dispose:o}}function VU(s,e){return s.groupOrder!==e.groupOrder?s.groupOrder-e.groupOrder:s.renderOrder!==e.renderOrder?s.renderOrder-e.renderOrder:s.material.id!==e.material.id?s.material.id-e.material.id:s.z!==e.z?s.z-e.z:s.id-e.id}function HE(s,e){return s.groupOrder!==e.groupOrder?s.groupOrder-e.groupOrder:s.renderOrder!==e.renderOrder?s.renderOrder-e.renderOrder:s.z!==e.z?e.z-s.z:s.id-e.id}function PE(){const s=[];let e=0;const t=[],n=[],i=[];function o(){e=0,t.length=0,n.length=0,i.length=0}function l(v,y,x,b,R,T){let M=s[e];return M===void 0?(M={id:v.id,object:v,geometry:y,material:x,groupOrder:b,renderOrder:v.renderOrder,z:R,group:T},s[e]=M):(M.id=v.id,M.object=v,M.geometry=y,M.material=x,M.groupOrder=b,M.renderOrder=v.renderOrder,M.z=R,M.group=T),e++,M}function h(v,y,x,b,R,T){const M=l(v,y,x,b,R,T);x.transmission>0?n.push(M):x.transparent===!0?i.push(M):t.push(M)}function d(v,y,x,b,R,T){const M=l(v,y,x,b,R,T);x.transmission>0?n.unshift(M):x.transparent===!0?i.unshift(M):t.unshift(M)}function p(v,y){t.length>1&&t.sort(v||VU),n.length>1&&n.sort(y||HE),i.length>1&&i.sort(y||HE)}function _(){for(let v=e,y=s.length;v<y;v++){const x=s[v];if(x.id===null)break;x.id=null,x.object=null,x.geometry=null,x.material=null,x.group=null}}return{opaque:t,transmissive:n,transparent:i,init:o,push:h,unshift:d,finish:_,sort:p}}function kU(){let s=new WeakMap;function e(n,i){const o=s.get(n);let l;return o===void 0?(l=new PE,s.set(n,[l])):i>=o.length?(l=new PE,o.push(l)):l=o[i],l}function t(){s=new WeakMap}return{get:e,dispose:t}}function XU(){const s={};return{get:function(e){if(s[e.id]!==void 0)return s[e.id];let t;switch(e.type){case"DirectionalLight":t={direction:new Z,color:new Ct};break;case"SpotLight":t={position:new Z,direction:new Z,color:new Ct,distance:0,coneCos:0,penumbraCos:0,decay:0};break;case"PointLight":t={position:new Z,color:new Ct,distance:0,decay:0};break;case"HemisphereLight":t={direction:new Z,skyColor:new Ct,groundColor:new Ct};break;case"RectAreaLight":t={color:new Ct,position:new Z,halfWidth:new Z,halfHeight:new Z};break}return s[e.id]=t,t}}}function YU(){const s={};return{get:function(e){if(s[e.id]!==void 0)return s[e.id];let t;switch(e.type){case"DirectionalLight":t={shadowIntensity:1,shadowBias:0,shadowNormalBias:0,shadowRadius:1,shadowMapSize:new nt};break;case"SpotLight":t={shadowIntensity:1,shadowBias:0,shadowNormalBias:0,shadowRadius:1,shadowMapSize:new nt};break;case"PointLight":t={shadowIntensity:1,shadowBias:0,shadowNormalBias:0,shadowRadius:1,shadowMapSize:new nt,shadowCameraNear:1,shadowCameraFar:1e3};break}return s[e.id]=t,t}}}let JU=0;function qU(s,e){return(e.castShadow?2:0)-(s.castShadow?2:0)+(e.map?1:0)-(s.map?1:0)}function KU(s){const e=new XU,t=YU(),n={version:0,hash:{directionalLength:-1,pointLength:-1,spotLength:-1,rectAreaLength:-1,hemiLength:-1,numDirectionalShadows:-1,numPointShadows:-1,numSpotShadows:-1,numSpotMaps:-1,numLightProbes:-1},ambient:[0,0,0],probe:[],directional:[],directionalShadow:[],directionalShadowMap:[],directionalShadowMatrix:[],spot:[],spotLightMap:[],spotShadow:[],spotShadowMap:[],spotLightMatrix:[],rectArea:[],rectAreaLTC1:null,rectAreaLTC2:null,point:[],pointShadow:[],pointShadowMap:[],pointShadowMatrix:[],hemi:[],numSpotLightShadowsWithMaps:0,numLightProbes:0};for(let p=0;p<9;p++)n.probe.push(new Z);const i=new Z,o=new en,l=new en;function h(p){let _=0,v=0,y=0;for(let U=0;U<9;U++)n.probe[U].set(0,0,0);let x=0,b=0,R=0,T=0,M=0,w=0,D=0,N=0,H=0,O=0,z=0;p.sort(qU);for(let U=0,F=p.length;U<F;U++){const K=p[U],ne=K.color,$=K.intensity,ae=K.distance;let ge=null;if(K.shadow&&K.shadow.map&&(K.shadow.map.texture.format===xu?ge=K.shadow.map.texture:ge=K.shadow.map.depthTexture||K.shadow.map.texture),K.isAmbientLight)_+=ne.r*$,v+=ne.g*$,y+=ne.b*$;else if(K.isLightProbe){for(let I=0;I<9;I++)n.probe[I].addScaledVector(K.sh.coefficients[I],$);z++}else if(K.isDirectionalLight){const I=e.get(K);if(I.color.copy(K.color).multiplyScalar(K.intensity),K.castShadow){const W=K.shadow,ee=t.get(K);ee.shadowIntensity=W.intensity,ee.shadowBias=W.bias,ee.shadowNormalBias=W.normalBias,ee.shadowRadius=W.radius,ee.shadowMapSize=W.mapSize,n.directionalShadow[x]=ee,n.directionalShadowMap[x]=ge,n.directionalShadowMatrix[x]=K.shadow.matrix,w++}n.directional[x]=I,x++}else if(K.isSpotLight){const I=e.get(K);I.position.setFromMatrixPosition(K.matrixWorld),I.color.copy(ne).multiplyScalar($),I.distance=ae,I.coneCos=Math.cos(K.angle),I.penumbraCos=Math.cos(K.angle*(1-K.penumbra)),I.decay=K.decay,n.spot[R]=I;const W=K.shadow;if(K.map&&(n.spotLightMap[H]=K.map,H++,W.updateMatrices(K),K.castShadow&&O++),n.spotLightMatrix[R]=W.matrix,K.castShadow){const ee=t.get(K);ee.shadowIntensity=W.intensity,ee.shadowBias=W.bias,ee.shadowNormalBias=W.normalBias,ee.shadowRadius=W.radius,ee.shadowMapSize=W.mapSize,n.spotShadow[R]=ee,n.spotShadowMap[R]=ge,N++}R++}else if(K.isRectAreaLight){const I=e.get(K);I.color.copy(ne).multiplyScalar($),I.halfWidth.set(K.width*.5,0,0),I.halfHeight.set(0,K.height*.5,0),n.rectArea[T]=I,T++}else if(K.isPointLight){const I=e.get(K);if(I.color.copy(K.color).multiplyScalar(K.intensity),I.distance=K.distance,I.decay=K.decay,K.castShadow){const W=K.shadow,ee=t.get(K);ee.shadowIntensity=W.intensity,ee.shadowBias=W.bias,ee.shadowNormalBias=W.normalBias,ee.shadowRadius=W.radius,ee.shadowMapSize=W.mapSize,ee.shadowCameraNear=W.camera.near,ee.shadowCameraFar=W.camera.far,n.pointShadow[b]=ee,n.pointShadowMap[b]=ge,n.pointShadowMatrix[b]=K.shadow.matrix,D++}n.point[b]=I,b++}else if(K.isHemisphereLight){const I=e.get(K);I.skyColor.copy(K.color).multiplyScalar($),I.groundColor.copy(K.groundColor).multiplyScalar($),n.hemi[M]=I,M++}}T>0&&(s.has("OES_texture_float_linear")===!0?(n.rectAreaLTC1=Lt.LTC_FLOAT_1,n.rectAreaLTC2=Lt.LTC_FLOAT_2):(n.rectAreaLTC1=Lt.LTC_HALF_1,n.rectAreaLTC2=Lt.LTC_HALF_2)),n.ambient[0]=_,n.ambient[1]=v,n.ambient[2]=y;const V=n.hash;(V.directionalLength!==x||V.pointLength!==b||V.spotLength!==R||V.rectAreaLength!==T||V.hemiLength!==M||V.numDirectionalShadows!==w||V.numPointShadows!==D||V.numSpotShadows!==N||V.numSpotMaps!==H||V.numLightProbes!==z)&&(n.directional.length=x,n.spot.length=R,n.rectArea.length=T,n.point.length=b,n.hemi.length=M,n.directionalShadow.length=w,n.directionalShadowMap.length=w,n.pointShadow.length=D,n.pointShadowMap.length=D,n.spotShadow.length=N,n.spotShadowMap.length=N,n.directionalShadowMatrix.length=w,n.pointShadowMatrix.length=D,n.spotLightMatrix.length=N+H-O,n.spotLightMap.length=H,n.numSpotLightShadowsWithMaps=O,n.numLightProbes=z,V.directionalLength=x,V.pointLength=b,V.spotLength=R,V.rectAreaLength=T,V.hemiLength=M,V.numDirectionalShadows=w,V.numPointShadows=D,V.numSpotShadows=N,V.numSpotMaps=H,V.numLightProbes=z,n.version=JU++)}function d(p,_){let v=0,y=0,x=0,b=0,R=0;const T=_.matrixWorldInverse;for(let M=0,w=p.length;M<w;M++){const D=p[M];if(D.isDirectionalLight){const N=n.directional[v];N.direction.setFromMatrixPosition(D.matrixWorld),i.setFromMatrixPosition(D.target.matrixWorld),N.direction.sub(i),N.direction.transformDirection(T),v++}else if(D.isSpotLight){const N=n.spot[x];N.position.setFromMatrixPosition(D.matrixWorld),N.position.applyMatrix4(T),N.direction.setFromMatrixPosition(D.matrixWorld),i.setFromMatrixPosition(D.target.matrixWorld),N.direction.sub(i),N.direction.transformDirection(T),x++}else if(D.isRectAreaLight){const N=n.rectArea[b];N.position.setFromMatrixPosition(D.matrixWorld),N.position.applyMatrix4(T),l.identity(),o.copy(D.matrixWorld),o.premultiply(T),l.extractRotation(o),N.halfWidth.set(D.width*.5,0,0),N.halfHeight.set(0,D.height*.5,0),N.halfWidth.applyMatrix4(l),N.halfHeight.applyMatrix4(l),b++}else if(D.isPointLight){const N=n.point[y];N.position.setFromMatrixPosition(D.matrixWorld),N.position.applyMatrix4(T),y++}else if(D.isHemisphereLight){const N=n.hemi[R];N.direction.setFromMatrixPosition(D.matrixWorld),N.direction.transformDirection(T),R++}}}return{setup:h,setupView:d,state:n}}function GE(s){const e=new KU(s),t=[],n=[];function i(_){p.camera=_,t.length=0,n.length=0}function o(_){t.push(_)}function l(_){n.push(_)}function h(){e.setup(t)}function d(_){e.setupView(t,_)}const p={lightsArray:t,shadowsArray:n,camera:null,lights:e,transmissionRenderTarget:{}};return{init:i,state:p,setupLights:h,setupLightsView:d,pushLight:o,pushShadow:l}}function WU(s){let e=new WeakMap;function t(i,o=0){const l=e.get(i);let h;return l===void 0?(h=new GE(s),e.set(i,[h])):o>=l.length?(h=new GE(s),l.push(h)):h=l[o],h}function n(){e=new WeakMap}return{get:t,dispose:n}}const jU=`void main() {
|
|
3968
|
+
`+X)}else ge!==""?Ut("WebGLProgram: Program Info Log:",ge):(I===""||W==="")&&(ye=!1);ye&&(K.diagnostics={runnable:ee,programLog:ge,vertexShader:{log:I,prefix:T},fragmentShader:{log:W,prefix:M}})}i.deleteShader(H),i.deleteShader(O),V=new Zv(i,R),U=AU(i,R)}let V;this.getUniforms=function(){return V===void 0&&z(this),V};let U;this.getAttributes=function(){return U===void 0&&z(this),U};let F=t.rendererExtensionParallelShaderCompile===!1;return this.isReady=function(){return F===!1&&(F=i.getProgramParameter(R,fU)),F},this.destroy=function(){n.releaseStatesOfProgram(this),i.deleteProgram(R),this.program=void 0},this.type=t.shaderType,this.name=t.shaderName,this.id=hU++,this.cacheKey=e,this.usedTimes=1,this.program=R,this.vertexShader=H,this.fragmentShader=O,this}let FU=0;class HU{constructor(){this.shaderCache=new Map,this.materialCache=new Map}update(e){const t=e.vertexShader,n=e.fragmentShader,i=this._getShaderStage(t),o=this._getShaderStage(n),l=this._getShaderCacheForMaterial(e);return l.has(i)===!1&&(l.add(i),i.usedTimes++),l.has(o)===!1&&(l.add(o),o.usedTimes++),this}remove(e){const t=this.materialCache.get(e);for(const n of t)n.usedTimes--,n.usedTimes===0&&this.shaderCache.delete(n.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 n=t.get(e);return n===void 0&&(n=new Set,t.set(e,n)),n}_getShaderStage(e){const t=this.shaderCache;let n=t.get(e);return n===void 0&&(n=new PU(e),t.set(e,n)),n}}class PU{constructor(e){this.id=FU++,this.code=e,this.usedTimes=0}}function GU(s,e,t,n,i,o,l){const h=new uh,d=new HU,p=new Set,_=[],v=new Map,y=i.logarithmicDepthBuffer;let x=i.precision;const b={MeshDepthMaterial:"depth",MeshDistanceMaterial:"distance",MeshNormalMaterial:"normal",MeshBasicMaterial:"basic",MeshLambertMaterial:"lambert",MeshPhongMaterial:"phong",MeshToonMaterial:"toon",MeshStandardMaterial:"physical",MeshPhysicalMaterial:"physical",MeshMatcapMaterial:"matcap",LineBasicMaterial:"basic",LineDashedMaterial:"dashed",PointsMaterial:"points",ShadowMaterial:"shadow",SpriteMaterial:"sprite"};function R(U){return p.add(U),U===0?"uv":`uv${U}`}function T(U,F,K,ne,$){const ae=ne.fog,ge=$.geometry,I=U.isMeshStandardMaterial?ne.environment:null,W=(U.isMeshStandardMaterial?t:e).get(U.envMap||I),ee=W&&W.mapping===jf?W.image.height:null,ye=b[U.type];U.precision!==null&&(x=i.getMaxPrecision(U.precision),x!==U.precision&&Ut("WebGLProgram.getParameters:",U.precision,"not supported, using",x,"instead."));const _e=ge.morphAttributes.position||ge.morphAttributes.normal||ge.morphAttributes.color,X=_e!==void 0?_e.length:0;let te=0;ge.morphAttributes.position!==void 0&&(te=1),ge.morphAttributes.normal!==void 0&&(te=2),ge.morphAttributes.color!==void 0&&(te=3);let le,ve,ze,he;if(ye){const Mn=eo[ye];le=Mn.vertexShader,ve=Mn.fragmentShader}else le=U.vertexShader,ve=U.fragmentShader,d.update(U),ze=d.getVertexShaderID(U),he=d.getFragmentShaderID(U);const Ee=s.getRenderTarget(),lt=s.state.buffers.depth.getReversed(),Rt=$.isInstancedMesh===!0,Bt=$.isBatchedMesh===!0,tn=!!U.map,on=!!U.matcap,Wt=!!W,Ge=!!U.aoMap,et=!!U.lightMap,Je=!!U.bumpMap,xt=!!U.normalMap,Q=!!U.displacementMap,Dt=!!U.emissiveMap,mt=!!U.metalnessMap,Lt=!!U.roughnessMap,gt=U.anisotropy>0,j=U.clearcoat>0,P=U.dispersion>0,de=U.iridescence>0,Fe=U.sheen>0,ke=U.transmission>0,Ie=gt&&!!U.anisotropyMap,Ft=j&&!!U.clearcoatMap,Mt=j&&!!U.clearcoatNormalMap,Ht=j&&!!U.clearcoatRoughnessMap,zt=de&&!!U.iridescenceMap,Ye=de&&!!U.iridescenceThicknessMap,qe=Fe&&!!U.sheenColorMap,wt=Fe&&!!U.sheenRoughnessMap,bt=!!U.specularMap,rt=!!U.specularColorMap,Vt=!!U.specularIntensityMap,fe=ke&&!!U.transmissionMap,Ne=ke&&!!U.thicknessMap,ot=!!U.gradientMap,Et=!!U.alphaMap,Qe=U.alphaTest>0,We=!!U.alphaHash,_t=!!U.extensions;let nn=mr;U.toneMapped&&(Ee===null||Ee.isXRRenderTarget===!0)&&(nn=s.toneMapping);const wn={shaderID:ye,shaderType:U.type,shaderName:U.name,vertexShader:le,fragmentShader:ve,defines:U.defines,customVertexShaderID:ze,customFragmentShaderID:he,isRawShaderMaterial:U.isRawShaderMaterial===!0,glslVersion:U.glslVersion,precision:x,batching:Bt,batchingColor:Bt&&$._colorsTexture!==null,instancing:Rt,instancingColor:Rt&&$.instanceColor!==null,instancingMorph:Rt&&$.morphTexture!==null,outputColorSpace:Ee===null?s.outputColorSpace:Ee.isXRRenderTarget===!0?Ee.texture.colorSpace:na,alphaToCoverage:!!U.alphaToCoverage,map:tn,matcap:on,envMap:Wt,envMapMode:Wt&&W.mapping,envMapCubeUVHeight:ee,aoMap:Ge,lightMap:et,bumpMap:Je,normalMap:xt,displacementMap:Q,emissiveMap:Dt,normalMapObjectSpace:xt&&U.normalMapType===rb,normalMapTangentSpace:xt&&U.normalMapType===fc,metalnessMap:mt,roughnessMap:Lt,anisotropy:gt,anisotropyMap:Ie,clearcoat:j,clearcoatMap:Ft,clearcoatNormalMap:Mt,clearcoatRoughnessMap:Ht,dispersion:P,iridescence:de,iridescenceMap:zt,iridescenceThicknessMap:Ye,sheen:Fe,sheenColorMap:qe,sheenRoughnessMap:wt,specularMap:bt,specularColorMap:rt,specularIntensityMap:Vt,transmission:ke,transmissionMap:fe,thicknessMap:Ne,gradientMap:ot,opaque:U.transparent===!1&&U.blending===gu&&U.alphaToCoverage===!1,alphaMap:Et,alphaTest:Qe,alphaHash:We,combine:U.combine,mapUv:tn&&R(U.map.channel),aoMapUv:Ge&&R(U.aoMap.channel),lightMapUv:et&&R(U.lightMap.channel),bumpMapUv:Je&&R(U.bumpMap.channel),normalMapUv:xt&&R(U.normalMap.channel),displacementMapUv:Q&&R(U.displacementMap.channel),emissiveMapUv:Dt&&R(U.emissiveMap.channel),metalnessMapUv:mt&&R(U.metalnessMap.channel),roughnessMapUv:Lt&&R(U.roughnessMap.channel),anisotropyMapUv:Ie&&R(U.anisotropyMap.channel),clearcoatMapUv:Ft&&R(U.clearcoatMap.channel),clearcoatNormalMapUv:Mt&&R(U.clearcoatNormalMap.channel),clearcoatRoughnessMapUv:Ht&&R(U.clearcoatRoughnessMap.channel),iridescenceMapUv:zt&&R(U.iridescenceMap.channel),iridescenceThicknessMapUv:Ye&&R(U.iridescenceThicknessMap.channel),sheenColorMapUv:qe&&R(U.sheenColorMap.channel),sheenRoughnessMapUv:wt&&R(U.sheenRoughnessMap.channel),specularMapUv:bt&&R(U.specularMap.channel),specularColorMapUv:rt&&R(U.specularColorMap.channel),specularIntensityMapUv:Vt&&R(U.specularIntensityMap.channel),transmissionMapUv:fe&&R(U.transmissionMap.channel),thicknessMapUv:Ne&&R(U.thicknessMap.channel),alphaMapUv:Et&&R(U.alphaMap.channel),vertexTangents:!!ge.attributes.tangent&&(xt||gt),vertexColors:U.vertexColors,vertexAlphas:U.vertexColors===!0&&!!ge.attributes.color&&ge.attributes.color.itemSize===4,pointsUvs:$.isPoints===!0&&!!ge.attributes.uv&&(tn||Et),fog:!!ae,useFog:U.fog===!0,fogExp2:!!ae&&ae.isFogExp2,flatShading:U.flatShading===!0&&U.wireframe===!1,sizeAttenuation:U.sizeAttenuation===!0,logarithmicDepthBuffer:y,reversedDepthBuffer:lt,skinning:$.isSkinnedMesh===!0,morphTargets:ge.morphAttributes.position!==void 0,morphNormals:ge.morphAttributes.normal!==void 0,morphColors:ge.morphAttributes.color!==void 0,morphTargetsCount:X,morphTextureStride:te,numDirLights:F.directional.length,numPointLights:F.point.length,numSpotLights:F.spot.length,numSpotLightMaps:F.spotLightMap.length,numRectAreaLights:F.rectArea.length,numHemiLights:F.hemi.length,numDirLightShadows:F.directionalShadowMap.length,numPointLightShadows:F.pointShadowMap.length,numSpotLightShadows:F.spotShadowMap.length,numSpotLightShadowsWithMaps:F.numSpotLightShadowsWithMaps,numLightProbes:F.numLightProbes,numClippingPlanes:l.numPlanes,numClipIntersection:l.numIntersection,dithering:U.dithering,shadowMapEnabled:s.shadowMap.enabled&&K.length>0,shadowMapType:s.shadowMap.type,toneMapping:nn,decodeVideoTexture:tn&&U.map.isVideoTexture===!0&&Bn.getTransfer(U.map.colorSpace)===si,decodeVideoTextureEmissive:Dt&&U.emissiveMap.isVideoTexture===!0&&Bn.getTransfer(U.emissiveMap.colorSpace)===si,premultipliedAlpha:U.premultipliedAlpha,doubleSided:U.side===Ws,flipSided:U.side===fs,useDepthPacking:U.depthPacking>=0,depthPacking:U.depthPacking||0,index0AttributeName:U.index0AttributeName,extensionClipCullDistance:_t&&U.extensions.clipCullDistance===!0&&n.has("WEBGL_clip_cull_distance"),extensionMultiDraw:(_t&&U.extensions.multiDraw===!0||Bt)&&n.has("WEBGL_multi_draw"),rendererExtensionParallelShaderCompile:n.has("KHR_parallel_shader_compile"),customProgramCacheKey:U.customProgramCacheKey()};return wn.vertexUv1s=p.has(1),wn.vertexUv2s=p.has(2),wn.vertexUv3s=p.has(3),p.clear(),wn}function M(U){const F=[];if(U.shaderID?F.push(U.shaderID):(F.push(U.customVertexShaderID),F.push(U.customFragmentShaderID)),U.defines!==void 0)for(const K in U.defines)F.push(K),F.push(U.defines[K]);return U.isRawShaderMaterial===!1&&(w(F,U),D(F,U),F.push(s.outputColorSpace)),F.push(U.customProgramCacheKey),F.join()}function w(U,F){U.push(F.precision),U.push(F.outputColorSpace),U.push(F.envMapMode),U.push(F.envMapCubeUVHeight),U.push(F.mapUv),U.push(F.alphaMapUv),U.push(F.lightMapUv),U.push(F.aoMapUv),U.push(F.bumpMapUv),U.push(F.normalMapUv),U.push(F.displacementMapUv),U.push(F.emissiveMapUv),U.push(F.metalnessMapUv),U.push(F.roughnessMapUv),U.push(F.anisotropyMapUv),U.push(F.clearcoatMapUv),U.push(F.clearcoatNormalMapUv),U.push(F.clearcoatRoughnessMapUv),U.push(F.iridescenceMapUv),U.push(F.iridescenceThicknessMapUv),U.push(F.sheenColorMapUv),U.push(F.sheenRoughnessMapUv),U.push(F.specularMapUv),U.push(F.specularColorMapUv),U.push(F.specularIntensityMapUv),U.push(F.transmissionMapUv),U.push(F.thicknessMapUv),U.push(F.combine),U.push(F.fogExp2),U.push(F.sizeAttenuation),U.push(F.morphTargetsCount),U.push(F.morphAttributeCount),U.push(F.numDirLights),U.push(F.numPointLights),U.push(F.numSpotLights),U.push(F.numSpotLightMaps),U.push(F.numHemiLights),U.push(F.numRectAreaLights),U.push(F.numDirLightShadows),U.push(F.numPointLightShadows),U.push(F.numSpotLightShadows),U.push(F.numSpotLightShadowsWithMaps),U.push(F.numLightProbes),U.push(F.shadowMapType),U.push(F.toneMapping),U.push(F.numClippingPlanes),U.push(F.numClipIntersection),U.push(F.depthPacking)}function D(U,F){h.disableAll(),F.instancing&&h.enable(0),F.instancingColor&&h.enable(1),F.instancingMorph&&h.enable(2),F.matcap&&h.enable(3),F.envMap&&h.enable(4),F.normalMapObjectSpace&&h.enable(5),F.normalMapTangentSpace&&h.enable(6),F.clearcoat&&h.enable(7),F.iridescence&&h.enable(8),F.alphaTest&&h.enable(9),F.vertexColors&&h.enable(10),F.vertexAlphas&&h.enable(11),F.vertexUv1s&&h.enable(12),F.vertexUv2s&&h.enable(13),F.vertexUv3s&&h.enable(14),F.vertexTangents&&h.enable(15),F.anisotropy&&h.enable(16),F.alphaHash&&h.enable(17),F.batching&&h.enable(18),F.dispersion&&h.enable(19),F.batchingColor&&h.enable(20),F.gradientMap&&h.enable(21),U.push(h.mask),h.disableAll(),F.fog&&h.enable(0),F.useFog&&h.enable(1),F.flatShading&&h.enable(2),F.logarithmicDepthBuffer&&h.enable(3),F.reversedDepthBuffer&&h.enable(4),F.skinning&&h.enable(5),F.morphTargets&&h.enable(6),F.morphNormals&&h.enable(7),F.morphColors&&h.enable(8),F.premultipliedAlpha&&h.enable(9),F.shadowMapEnabled&&h.enable(10),F.doubleSided&&h.enable(11),F.flipSided&&h.enable(12),F.useDepthPacking&&h.enable(13),F.dithering&&h.enable(14),F.transmission&&h.enable(15),F.sheen&&h.enable(16),F.opaque&&h.enable(17),F.pointsUvs&&h.enable(18),F.decodeVideoTexture&&h.enable(19),F.decodeVideoTextureEmissive&&h.enable(20),F.alphaToCoverage&&h.enable(21),U.push(h.mask)}function N(U){const F=b[U.type];let K;if(F){const ne=eo[F];K=Ob.clone(ne.uniforms)}else K=U.uniforms;return K}function H(U,F){let K=v.get(F);return K!==void 0?++K.usedTimes:(K=new IU(s,F,U,o),_.push(K),v.set(F,K)),K}function O(U){if(--U.usedTimes===0){const F=_.indexOf(U);_[F]=_[_.length-1],_.pop(),v.delete(U.cacheKey),U.destroy()}}function z(U){d.remove(U)}function V(){d.dispose()}return{getParameters:T,getProgramCacheKey:M,getUniforms:N,acquireProgram:H,releaseProgram:O,releaseShaderCache:z,programs:_,dispose:V}}function zU(){let s=new WeakMap;function e(l){return s.has(l)}function t(l){let h=s.get(l);return h===void 0&&(h={},s.set(l,h)),h}function n(l){s.delete(l)}function i(l,h,d){s.get(l)[h]=d}function o(){s=new WeakMap}return{has:e,get:t,remove:n,update:i,dispose:o}}function VU(s,e){return s.groupOrder!==e.groupOrder?s.groupOrder-e.groupOrder:s.renderOrder!==e.renderOrder?s.renderOrder-e.renderOrder:s.material.id!==e.material.id?s.material.id-e.material.id:s.z!==e.z?s.z-e.z:s.id-e.id}function HE(s,e){return s.groupOrder!==e.groupOrder?s.groupOrder-e.groupOrder:s.renderOrder!==e.renderOrder?s.renderOrder-e.renderOrder:s.z!==e.z?e.z-s.z:s.id-e.id}function PE(){const s=[];let e=0;const t=[],n=[],i=[];function o(){e=0,t.length=0,n.length=0,i.length=0}function l(v,y,x,b,R,T){let M=s[e];return M===void 0?(M={id:v.id,object:v,geometry:y,material:x,groupOrder:b,renderOrder:v.renderOrder,z:R,group:T},s[e]=M):(M.id=v.id,M.object=v,M.geometry=y,M.material=x,M.groupOrder=b,M.renderOrder=v.renderOrder,M.z=R,M.group=T),e++,M}function h(v,y,x,b,R,T){const M=l(v,y,x,b,R,T);x.transmission>0?n.push(M):x.transparent===!0?i.push(M):t.push(M)}function d(v,y,x,b,R,T){const M=l(v,y,x,b,R,T);x.transmission>0?n.unshift(M):x.transparent===!0?i.unshift(M):t.unshift(M)}function p(v,y){t.length>1&&t.sort(v||VU),n.length>1&&n.sort(y||HE),i.length>1&&i.sort(y||HE)}function _(){for(let v=e,y=s.length;v<y;v++){const x=s[v];if(x.id===null)break;x.id=null,x.object=null,x.geometry=null,x.material=null,x.group=null}}return{opaque:t,transmissive:n,transparent:i,init:o,push:h,unshift:d,finish:_,sort:p}}function kU(){let s=new WeakMap;function e(n,i){const o=s.get(n);let l;return o===void 0?(l=new PE,s.set(n,[l])):i>=o.length?(l=new PE,o.push(l)):l=o[i],l}function t(){s=new WeakMap}return{get:e,dispose:t}}function XU(){const s={};return{get:function(e){if(s[e.id]!==void 0)return s[e.id];let t;switch(e.type){case"DirectionalLight":t={direction:new Z,color:new Ct};break;case"SpotLight":t={position:new Z,direction:new Z,color:new Ct,distance:0,coneCos:0,penumbraCos:0,decay:0};break;case"PointLight":t={position:new Z,color:new Ct,distance:0,decay:0};break;case"HemisphereLight":t={direction:new Z,skyColor:new Ct,groundColor:new Ct};break;case"RectAreaLight":t={color:new Ct,position:new Z,halfWidth:new Z,halfHeight:new Z};break}return s[e.id]=t,t}}}function YU(){const s={};return{get:function(e){if(s[e.id]!==void 0)return s[e.id];let t;switch(e.type){case"DirectionalLight":t={shadowIntensity:1,shadowBias:0,shadowNormalBias:0,shadowRadius:1,shadowMapSize:new nt};break;case"SpotLight":t={shadowIntensity:1,shadowBias:0,shadowNormalBias:0,shadowRadius:1,shadowMapSize:new nt};break;case"PointLight":t={shadowIntensity:1,shadowBias:0,shadowNormalBias:0,shadowRadius:1,shadowMapSize:new nt,shadowCameraNear:1,shadowCameraFar:1e3};break}return s[e.id]=t,t}}}let JU=0;function qU(s,e){return(e.castShadow?2:0)-(s.castShadow?2:0)+(e.map?1:0)-(s.map?1:0)}function KU(s){const e=new XU,t=YU(),n={version:0,hash:{directionalLength:-1,pointLength:-1,spotLength:-1,rectAreaLength:-1,hemiLength:-1,numDirectionalShadows:-1,numPointShadows:-1,numSpotShadows:-1,numSpotMaps:-1,numLightProbes:-1},ambient:[0,0,0],probe:[],directional:[],directionalShadow:[],directionalShadowMap:[],directionalShadowMatrix:[],spot:[],spotLightMap:[],spotShadow:[],spotShadowMap:[],spotLightMatrix:[],rectArea:[],rectAreaLTC1:null,rectAreaLTC2:null,point:[],pointShadow:[],pointShadowMap:[],pointShadowMatrix:[],hemi:[],numSpotLightShadowsWithMaps:0,numLightProbes:0};for(let p=0;p<9;p++)n.probe.push(new Z);const i=new Z,o=new en,l=new en;function h(p){let _=0,v=0,y=0;for(let U=0;U<9;U++)n.probe[U].set(0,0,0);let x=0,b=0,R=0,T=0,M=0,w=0,D=0,N=0,H=0,O=0,z=0;p.sort(qU);for(let U=0,F=p.length;U<F;U++){const K=p[U],ne=K.color,$=K.intensity,ae=K.distance;let ge=null;if(K.shadow&&K.shadow.map&&(K.shadow.map.texture.format===xu?ge=K.shadow.map.texture:ge=K.shadow.map.depthTexture||K.shadow.map.texture),K.isAmbientLight)_+=ne.r*$,v+=ne.g*$,y+=ne.b*$;else if(K.isLightProbe){for(let I=0;I<9;I++)n.probe[I].addScaledVector(K.sh.coefficients[I],$);z++}else if(K.isDirectionalLight){const I=e.get(K);if(I.color.copy(K.color).multiplyScalar(K.intensity),K.castShadow){const W=K.shadow,ee=t.get(K);ee.shadowIntensity=W.intensity,ee.shadowBias=W.bias,ee.shadowNormalBias=W.normalBias,ee.shadowRadius=W.radius,ee.shadowMapSize=W.mapSize,n.directionalShadow[x]=ee,n.directionalShadowMap[x]=ge,n.directionalShadowMatrix[x]=K.shadow.matrix,w++}n.directional[x]=I,x++}else if(K.isSpotLight){const I=e.get(K);I.position.setFromMatrixPosition(K.matrixWorld),I.color.copy(ne).multiplyScalar($),I.distance=ae,I.coneCos=Math.cos(K.angle),I.penumbraCos=Math.cos(K.angle*(1-K.penumbra)),I.decay=K.decay,n.spot[R]=I;const W=K.shadow;if(K.map&&(n.spotLightMap[H]=K.map,H++,W.updateMatrices(K),K.castShadow&&O++),n.spotLightMatrix[R]=W.matrix,K.castShadow){const ee=t.get(K);ee.shadowIntensity=W.intensity,ee.shadowBias=W.bias,ee.shadowNormalBias=W.normalBias,ee.shadowRadius=W.radius,ee.shadowMapSize=W.mapSize,n.spotShadow[R]=ee,n.spotShadowMap[R]=ge,N++}R++}else if(K.isRectAreaLight){const I=e.get(K);I.color.copy(ne).multiplyScalar($),I.halfWidth.set(K.width*.5,0,0),I.halfHeight.set(0,K.height*.5,0),n.rectArea[T]=I,T++}else if(K.isPointLight){const I=e.get(K);if(I.color.copy(K.color).multiplyScalar(K.intensity),I.distance=K.distance,I.decay=K.decay,K.castShadow){const W=K.shadow,ee=t.get(K);ee.shadowIntensity=W.intensity,ee.shadowBias=W.bias,ee.shadowNormalBias=W.normalBias,ee.shadowRadius=W.radius,ee.shadowMapSize=W.mapSize,ee.shadowCameraNear=W.camera.near,ee.shadowCameraFar=W.camera.far,n.pointShadow[b]=ee,n.pointShadowMap[b]=ge,n.pointShadowMatrix[b]=K.shadow.matrix,D++}n.point[b]=I,b++}else if(K.isHemisphereLight){const I=e.get(K);I.skyColor.copy(K.color).multiplyScalar($),I.groundColor.copy(K.groundColor).multiplyScalar($),n.hemi[M]=I,M++}}T>0&&(s.has("OES_texture_float_linear")===!0?(n.rectAreaLTC1=Ot.LTC_FLOAT_1,n.rectAreaLTC2=Ot.LTC_FLOAT_2):(n.rectAreaLTC1=Ot.LTC_HALF_1,n.rectAreaLTC2=Ot.LTC_HALF_2)),n.ambient[0]=_,n.ambient[1]=v,n.ambient[2]=y;const V=n.hash;(V.directionalLength!==x||V.pointLength!==b||V.spotLength!==R||V.rectAreaLength!==T||V.hemiLength!==M||V.numDirectionalShadows!==w||V.numPointShadows!==D||V.numSpotShadows!==N||V.numSpotMaps!==H||V.numLightProbes!==z)&&(n.directional.length=x,n.spot.length=R,n.rectArea.length=T,n.point.length=b,n.hemi.length=M,n.directionalShadow.length=w,n.directionalShadowMap.length=w,n.pointShadow.length=D,n.pointShadowMap.length=D,n.spotShadow.length=N,n.spotShadowMap.length=N,n.directionalShadowMatrix.length=w,n.pointShadowMatrix.length=D,n.spotLightMatrix.length=N+H-O,n.spotLightMap.length=H,n.numSpotLightShadowsWithMaps=O,n.numLightProbes=z,V.directionalLength=x,V.pointLength=b,V.spotLength=R,V.rectAreaLength=T,V.hemiLength=M,V.numDirectionalShadows=w,V.numPointShadows=D,V.numSpotShadows=N,V.numSpotMaps=H,V.numLightProbes=z,n.version=JU++)}function d(p,_){let v=0,y=0,x=0,b=0,R=0;const T=_.matrixWorldInverse;for(let M=0,w=p.length;M<w;M++){const D=p[M];if(D.isDirectionalLight){const N=n.directional[v];N.direction.setFromMatrixPosition(D.matrixWorld),i.setFromMatrixPosition(D.target.matrixWorld),N.direction.sub(i),N.direction.transformDirection(T),v++}else if(D.isSpotLight){const N=n.spot[x];N.position.setFromMatrixPosition(D.matrixWorld),N.position.applyMatrix4(T),N.direction.setFromMatrixPosition(D.matrixWorld),i.setFromMatrixPosition(D.target.matrixWorld),N.direction.sub(i),N.direction.transformDirection(T),x++}else if(D.isRectAreaLight){const N=n.rectArea[b];N.position.setFromMatrixPosition(D.matrixWorld),N.position.applyMatrix4(T),l.identity(),o.copy(D.matrixWorld),o.premultiply(T),l.extractRotation(o),N.halfWidth.set(D.width*.5,0,0),N.halfHeight.set(0,D.height*.5,0),N.halfWidth.applyMatrix4(l),N.halfHeight.applyMatrix4(l),b++}else if(D.isPointLight){const N=n.point[y];N.position.setFromMatrixPosition(D.matrixWorld),N.position.applyMatrix4(T),y++}else if(D.isHemisphereLight){const N=n.hemi[R];N.direction.setFromMatrixPosition(D.matrixWorld),N.direction.transformDirection(T),R++}}}return{setup:h,setupView:d,state:n}}function GE(s){const e=new KU(s),t=[],n=[];function i(_){p.camera=_,t.length=0,n.length=0}function o(_){t.push(_)}function l(_){n.push(_)}function h(){e.setup(t)}function d(_){e.setupView(t,_)}const p={lightsArray:t,shadowsArray:n,camera:null,lights:e,transmissionRenderTarget:{}};return{init:i,state:p,setupLights:h,setupLightsView:d,pushLight:o,pushShadow:l}}function WU(s){let e=new WeakMap;function t(i,o=0){const l=e.get(i);let h;return l===void 0?(h=new GE(s),e.set(i,[h])):o>=l.length?(h=new GE(s),l.push(h)):h=l[o],h}function n(){e=new WeakMap}return{get:t,dispose:n}}const jU=`void main() {
|
|
3969
3969
|
gl_Position = vec4( position, 1.0 );
|
|
3970
3970
|
}`,ZU=`uniform sampler2D shadow_pass;
|
|
3971
3971
|
uniform vec2 resolution;
|
|
@@ -3992,7 +3992,7 @@ void main() {
|
|
|
3992
3992
|
squared_mean = squared_mean / samples;
|
|
3993
3993
|
float std_dev = sqrt( max( 0.0, squared_mean - mean * mean ) );
|
|
3994
3994
|
gl_FragColor = vec4( mean, std_dev, 0.0, 1.0 );
|
|
3995
|
-
}`,QU=[new Z(1,0,0),new Z(-1,0,0),new Z(0,1,0),new Z(0,-1,0),new Z(0,0,1),new Z(0,0,-1)],$U=[new Z(0,-1,0),new Z(0,-1,0),new Z(0,0,1),new Z(0,0,-1),new Z(0,-1,0),new Z(0,-1,0)],zE=new en,qp=new Z,FA=new Z;function eL(s,e,t){let n=new Th;const i=new nt,o=new nt,l=new pi,h=new iA,d=new aA,p={},_=t.maxTextureSize,v={[Yr]:fs,[fs]:Yr,[Ws]:Ws},y=new ms({defines:{VSM_SAMPLES:8},uniforms:{shadow_pass:{value:null},resolution:{value:new nt},radius:{value:4}},vertexShader:jU,fragmentShader:ZU}),x=y.clone();x.defines.HORIZONTAL_PASS=1;const b=new pn;b.setAttribute("position",new Hn(new Float32Array([-1,-1,.5,3,-1,.5,-1,3,.5]),3));const R=new yi(b,y),T=this;this.enabled=!1,this.autoUpdate=!0,this.needsUpdate=!1,this.type=Kf;let M=this.type;this.render=function(O,z,V){if(T.enabled===!1||T.autoUpdate===!1&&T.needsUpdate===!1||O.length===0)return;O.type===Qd&&(Ut("WebGLShadowMap: PCFSoftShadowMap has been deprecated. Using PCFShadowMap instead."),O.type=Kf);const U=s.getRenderTarget(),F=s.getActiveCubeFace(),K=s.getActiveMipmapLevel(),ne=s.state;ne.setBlending(Jr),ne.buffers.depth.getReversed()===!0?ne.buffers.color.setClear(0,0,0,0):ne.buffers.color.setClear(1,1,1,1),ne.buffers.depth.setTest(!0),ne.setScissorTest(!1);const $=M!==this.type;$&&z.traverse(function(ae){ae.material&&(Array.isArray(ae.material)?ae.material.forEach(ge=>ge.needsUpdate=!0):ae.material.needsUpdate=!0)});for(let ae=0,ge=O.length;ae<ge;ae++){const I=O[ae],W=I.shadow;if(W===void 0){Ut("WebGLShadowMap:",I,"has no shadow.");continue}if(W.autoUpdate===!1&&W.needsUpdate===!1)continue;i.copy(W.mapSize);const ee=W.getFrameExtents();if(i.multiply(ee),o.copy(W.mapSize),(i.x>_||i.y>_)&&(i.x>_&&(o.x=Math.floor(_/ee.x),i.x=o.x*ee.x,W.mapSize.x=o.x),i.y>_&&(o.y=Math.floor(_/ee.y),i.y=o.y*ee.y,W.mapSize.y=o.y)),W.map===null||$===!0){if(W.map!==null&&(W.map.depthTexture!==null&&(W.map.depthTexture.dispose(),W.map.depthTexture=null),W.map.dispose()),this.type===mu){if(I.isPointLight){Ut("WebGLShadowMap: VSM shadow maps are not supported for PointLights. Use PCF or BasicShadowMap instead.");continue}W.map=new ds(i.x,i.y,{format:xu,type:ki,minFilter:Cn,magFilter:Cn,generateMipmaps:!1}),W.map.texture.name=I.name+".shadowMap",W.map.depthTexture=new Ch(i.x,i.y,Ci),W.map.depthTexture.name=I.name+".shadowMapDepth",W.map.depthTexture.format=Eo,W.map.depthTexture.compareFunction=null,W.map.depthTexture.minFilter=Ti,W.map.depthTexture.magFilter=Ti}else{I.isPointLight?(W.map=new Y0(i.x),W.map.depthTexture=new c1(i.x,js)):(W.map=new ds(i.x,i.y),W.map.depthTexture=new Ch(i.x,i.y,js)),W.map.depthTexture.name=I.name+".shadowMap",W.map.depthTexture.format=Eo;const _e=s.state.buffers.depth.getReversed();this.type===Kf?(W.map.depthTexture.compareFunction=_e?b0:M0,W.map.depthTexture.minFilter=Cn,W.map.depthTexture.magFilter=Cn):(W.map.depthTexture.compareFunction=null,W.map.depthTexture.minFilter=Ti,W.map.depthTexture.magFilter=Ti)}W.camera.updateProjectionMatrix()}const ye=W.map.isWebGLCubeRenderTarget?6:1;for(let _e=0;_e<ye;_e++){if(W.map.isWebGLCubeRenderTarget)s.setRenderTarget(W.map,_e),s.clear();else{_e===0&&(s.setRenderTarget(W.map),s.clear());const X=W.getViewport(_e);l.set(o.x*X.x,o.y*X.y,o.x*X.z,o.y*X.w),ne.viewport(l)}if(I.isPointLight){const X=W.camera,te=W.matrix,le=I.distance||X.far;le!==X.far&&(X.far=le,X.updateProjectionMatrix()),qp.setFromMatrixPosition(I.matrixWorld),X.position.copy(qp),FA.copy(X.position),FA.add(QU[_e]),X.up.copy($U[_e]),X.lookAt(FA),X.updateMatrixWorld(),te.makeTranslation(-qp.x,-qp.y,-qp.z),zE.multiplyMatrices(X.projectionMatrix,X.matrixWorldInverse),W._frustum.setFromProjectionMatrix(zE,X.coordinateSystem,X.reversedDepth)}else W.updateMatrices(I);n=W.getFrustum(),N(z,V,W.camera,I,this.type)}W.isPointLightShadow!==!0&&this.type===mu&&w(W,V),W.needsUpdate=!1}M=this.type,T.needsUpdate=!1,s.setRenderTarget(U,F,K)};function w(O,z){const V=e.update(R);y.defines.VSM_SAMPLES!==O.blurSamples&&(y.defines.VSM_SAMPLES=O.blurSamples,x.defines.VSM_SAMPLES=O.blurSamples,y.needsUpdate=!0,x.needsUpdate=!0),O.mapPass===null&&(O.mapPass=new ds(i.x,i.y,{format:xu,type:ki})),y.uniforms.shadow_pass.value=O.map.depthTexture,y.uniforms.resolution.value=O.mapSize,y.uniforms.radius.value=O.radius,s.setRenderTarget(O.mapPass),s.clear(),s.renderBufferDirect(z,null,V,y,R,null),x.uniforms.shadow_pass.value=O.mapPass.texture,x.uniforms.resolution.value=O.mapSize,x.uniforms.radius.value=O.radius,s.setRenderTarget(O.map),s.clear(),s.renderBufferDirect(z,null,V,x,R,null)}function D(O,z,V,U){let F=null;const K=V.isPointLight===!0?O.customDistanceMaterial:O.customDepthMaterial;if(K!==void 0)F=K;else if(F=V.isPointLight===!0?d:h,s.localClippingEnabled&&z.clipShadows===!0&&Array.isArray(z.clippingPlanes)&&z.clippingPlanes.length!==0||z.displacementMap&&z.displacementScale!==0||z.alphaMap&&z.alphaTest>0||z.map&&z.alphaTest>0||z.alphaToCoverage===!0){const ne=F.uuid,$=z.uuid;let ae=p[ne];ae===void 0&&(ae={},p[ne]=ae);let ge=ae[$];ge===void 0&&(ge=F.clone(),ae[$]=ge,z.addEventListener("dispose",H)),F=ge}if(F.visible=z.visible,F.wireframe=z.wireframe,U===mu?F.side=z.shadowSide!==null?z.shadowSide:z.side:F.side=z.shadowSide!==null?z.shadowSide:v[z.side],F.alphaMap=z.alphaMap,F.alphaTest=z.alphaToCoverage===!0?.5:z.alphaTest,F.map=z.map,F.clipShadows=z.clipShadows,F.clippingPlanes=z.clippingPlanes,F.clipIntersection=z.clipIntersection,F.displacementMap=z.displacementMap,F.displacementScale=z.displacementScale,F.displacementBias=z.displacementBias,F.wireframeLinewidth=z.wireframeLinewidth,F.linewidth=z.linewidth,V.isPointLight===!0&&F.isMeshDistanceMaterial===!0){const ne=s.properties.get(F);ne.light=V}return F}function N(O,z,V,U,F){if(O.visible===!1)return;if(O.layers.test(z.layers)&&(O.isMesh||O.isLine||O.isPoints)&&(O.castShadow||O.receiveShadow&&F===mu)&&(!O.frustumCulled||n.intersectsObject(O))){O.modelViewMatrix.multiplyMatrices(V.matrixWorldInverse,O.matrixWorld);const $=e.update(O),ae=O.material;if(Array.isArray(ae)){const ge=$.groups;for(let I=0,W=ge.length;I<W;I++){const ee=ge[I],ye=ae[ee.materialIndex];if(ye&&ye.visible){const _e=D(O,ye,U,F);O.onBeforeShadow(s,O,z,V,$,_e,ee),s.renderBufferDirect(V,null,$,_e,O,ee),O.onAfterShadow(s,O,z,V,$,_e,ee)}}}else if(ae.visible){const ge=D(O,ae,U,F);O.onBeforeShadow(s,O,z,V,$,ge,null),s.renderBufferDirect(V,null,$,ge,O,null),O.onAfterShadow(s,O,z,V,$,ge,null)}}const ne=O.children;for(let $=0,ae=ne.length;$<ae;$++)N(ne[$],z,V,U,F)}function H(O){O.target.removeEventListener("dispose",H);for(const V in p){const U=p[V],F=O.target.uuid;F in U&&(U[F].dispose(),delete U[F])}}}const tL={[wg]:Bg,[Dg]:Lg,[Ng]:Og,[vu]:Ug,[Bg]:wg,[Lg]:Dg,[Og]:Ng,[Ug]:vu};function nL(s,e){function t(){let fe=!1;const Ne=new pi;let ot=null;const Et=new pi(0,0,0,0);return{setMask:function(Qe){ot!==Qe&&!fe&&(s.colorMask(Qe,Qe,Qe,Qe),ot=Qe)},setLocked:function(Qe){fe=Qe},setClear:function(Qe,We,_t,nn,wn){wn===!0&&(Qe*=nn,We*=nn,_t*=nn),Ne.set(Qe,We,_t,nn),Et.equals(Ne)===!1&&(s.clearColor(Qe,We,_t,nn),Et.copy(Ne))},reset:function(){fe=!1,ot=null,Et.set(-1,0,0,0)}}}function n(){let fe=!1,Ne=!1,ot=null,Et=null,Qe=null;return{setReversed:function(We){if(Ne!==We){const _t=e.get("EXT_clip_control");We?_t.clipControlEXT(_t.LOWER_LEFT_EXT,_t.ZERO_TO_ONE_EXT):_t.clipControlEXT(_t.LOWER_LEFT_EXT,_t.NEGATIVE_ONE_TO_ONE_EXT),Ne=We;const nn=Qe;Qe=null,this.setClear(nn)}},getReversed:function(){return Ne},setTest:function(We){We?Ee(s.DEPTH_TEST):lt(s.DEPTH_TEST)},setMask:function(We){ot!==We&&!fe&&(s.depthMask(We),ot=We)},setFunc:function(We){if(Ne&&(We=tL[We]),Et!==We){switch(We){case wg:s.depthFunc(s.NEVER);break;case Bg:s.depthFunc(s.ALWAYS);break;case Dg:s.depthFunc(s.LESS);break;case vu:s.depthFunc(s.LEQUAL);break;case Ng:s.depthFunc(s.EQUAL);break;case Ug:s.depthFunc(s.GEQUAL);break;case Lg:s.depthFunc(s.GREATER);break;case Og:s.depthFunc(s.NOTEQUAL);break;default:s.depthFunc(s.LEQUAL)}Et=We}},setLocked:function(We){fe=We},setClear:function(We){Qe!==We&&(Ne&&(We=1-We),s.clearDepth(We),Qe=We)},reset:function(){fe=!1,ot=null,Et=null,Qe=null,Ne=!1}}}function i(){let fe=!1,Ne=null,ot=null,Et=null,Qe=null,We=null,_t=null,nn=null,wn=null;return{setTest:function(Mn){fe||(Mn?Ee(s.STENCIL_TEST):lt(s.STENCIL_TEST))},setMask:function(Mn){Ne!==Mn&&!fe&&(s.stencilMask(Mn),Ne=Mn)},setFunc:function(Mn,Fi,va){(ot!==Mn||Et!==Fi||Qe!==va)&&(s.stencilFunc(Mn,Fi,va),ot=Mn,Et=Fi,Qe=va)},setOp:function(Mn,Fi,va){(We!==Mn||_t!==Fi||nn!==va)&&(s.stencilOp(Mn,Fi,va),We=Mn,_t=Fi,nn=va)},setLocked:function(Mn){fe=Mn},setClear:function(Mn){wn!==Mn&&(s.clearStencil(Mn),wn=Mn)},reset:function(){fe=!1,Ne=null,ot=null,Et=null,Qe=null,We=null,_t=null,nn=null,wn=null}}}const o=new t,l=new n,h=new i,d=new WeakMap,p=new WeakMap;let _={},v={},y=new WeakMap,x=[],b=null,R=!1,T=null,M=null,w=null,D=null,N=null,H=null,O=null,z=new Ct(0,0,0),V=0,U=!1,F=null,K=null,ne=null,$=null,ae=null;const ge=s.getParameter(s.MAX_COMBINED_TEXTURE_IMAGE_UNITS);let I=!1,W=0;const ee=s.getParameter(s.VERSION);ee.indexOf("WebGL")!==-1?(W=parseFloat(/^WebGL (\d)/.exec(ee)[1]),I=W>=1):ee.indexOf("OpenGL ES")!==-1&&(W=parseFloat(/^OpenGL ES (\d)/.exec(ee)[1]),I=W>=2);let ye=null,_e={};const X=s.getParameter(s.SCISSOR_BOX),te=s.getParameter(s.VIEWPORT),le=new pi().fromArray(X),ve=new pi().fromArray(te);function ze(fe,Ne,ot,Et){const Qe=new Uint8Array(4),We=s.createTexture();s.bindTexture(fe,We),s.texParameteri(fe,s.TEXTURE_MIN_FILTER,s.NEAREST),s.texParameteri(fe,s.TEXTURE_MAG_FILTER,s.NEAREST);for(let _t=0;_t<ot;_t++)fe===s.TEXTURE_3D||fe===s.TEXTURE_2D_ARRAY?s.texImage3D(Ne,0,s.RGBA,1,1,Et,0,s.RGBA,s.UNSIGNED_BYTE,Qe):s.texImage2D(Ne+_t,0,s.RGBA,1,1,0,s.RGBA,s.UNSIGNED_BYTE,Qe);return We}const he={};he[s.TEXTURE_2D]=ze(s.TEXTURE_2D,s.TEXTURE_2D,1),he[s.TEXTURE_CUBE_MAP]=ze(s.TEXTURE_CUBE_MAP,s.TEXTURE_CUBE_MAP_POSITIVE_X,6),he[s.TEXTURE_2D_ARRAY]=ze(s.TEXTURE_2D_ARRAY,s.TEXTURE_2D_ARRAY,1,1),he[s.TEXTURE_3D]=ze(s.TEXTURE_3D,s.TEXTURE_3D,1,1),o.setClear(0,0,0,1),l.setClear(1),h.setClear(0),Ee(s.DEPTH_TEST),l.setFunc(vu),Je(!1),xt(Xy),Ee(s.CULL_FACE),Ge(Jr);function Ee(fe){_[fe]!==!0&&(s.enable(fe),_[fe]=!0)}function lt(fe){_[fe]!==!1&&(s.disable(fe),_[fe]=!1)}function Rt(fe,Ne){return v[fe]!==Ne?(s.bindFramebuffer(fe,Ne),v[fe]=Ne,fe===s.DRAW_FRAMEBUFFER&&(v[s.FRAMEBUFFER]=Ne),fe===s.FRAMEBUFFER&&(v[s.DRAW_FRAMEBUFFER]=Ne),!0):!1}function Bt(fe,Ne){let ot=x,Et=!1;if(fe){ot=y.get(Ne),ot===void 0&&(ot=[],y.set(Ne,ot));const Qe=fe.textures;if(ot.length!==Qe.length||ot[0]!==s.COLOR_ATTACHMENT0){for(let We=0,_t=Qe.length;We<_t;We++)ot[We]=s.COLOR_ATTACHMENT0+We;ot.length=Qe.length,Et=!0}}else ot[0]!==s.BACK&&(ot[0]=s.BACK,Et=!0);Et&&s.drawBuffers(ot)}function tn(fe){return b!==fe?(s.useProgram(fe),b=fe,!0):!1}const on={[sc]:s.FUNC_ADD,[FM]:s.FUNC_SUBTRACT,[HM]:s.FUNC_REVERSE_SUBTRACT};on[PM]=s.MIN,on[GM]=s.MAX;const Wt={[zM]:s.ZERO,[VM]:s.ONE,[kM]:s.SRC_COLOR,[Cg]:s.SRC_ALPHA,[WM]:s.SRC_ALPHA_SATURATE,[qM]:s.DST_COLOR,[YM]:s.DST_ALPHA,[XM]:s.ONE_MINUS_SRC_COLOR,[Rg]:s.ONE_MINUS_SRC_ALPHA,[KM]:s.ONE_MINUS_DST_COLOR,[JM]:s.ONE_MINUS_DST_ALPHA,[jM]:s.CONSTANT_COLOR,[ZM]:s.ONE_MINUS_CONSTANT_COLOR,[QM]:s.CONSTANT_ALPHA,[$M]:s.ONE_MINUS_CONSTANT_ALPHA};function Ge(fe,Ne,ot,Et,Qe,We,_t,nn,wn,Mn){if(fe===Jr){R===!0&&(lt(s.BLEND),R=!1);return}if(R===!1&&(Ee(s.BLEND),R=!0),fe!==IM){if(fe!==T||Mn!==U){if((M!==sc||N!==sc)&&(s.blendEquation(s.FUNC_ADD),M=sc,N=sc),Mn)switch(fe){case gu:s.blendFuncSeparate(s.ONE,s.ONE_MINUS_SRC_ALPHA,s.ONE,s.ONE_MINUS_SRC_ALPHA);break;case Yy:s.blendFunc(s.ONE,s.ONE);break;case Jy:s.blendFuncSeparate(s.ZERO,s.ONE_MINUS_SRC_COLOR,s.ZERO,s.ONE);break;case qy:s.blendFuncSeparate(s.DST_COLOR,s.ONE_MINUS_SRC_ALPHA,s.ZERO,s.ONE);break;default:Zt("WebGLState: Invalid blending: ",fe);break}else switch(fe){case gu:s.blendFuncSeparate(s.SRC_ALPHA,s.ONE_MINUS_SRC_ALPHA,s.ONE,s.ONE_MINUS_SRC_ALPHA);break;case Yy:s.blendFuncSeparate(s.SRC_ALPHA,s.ONE,s.ONE,s.ONE);break;case Jy:Zt("WebGLState: SubtractiveBlending requires material.premultipliedAlpha = true");break;case qy:Zt("WebGLState: MultiplyBlending requires material.premultipliedAlpha = true");break;default:Zt("WebGLState: Invalid blending: ",fe);break}w=null,D=null,H=null,O=null,z.set(0,0,0),V=0,T=fe,U=Mn}return}Qe=Qe||Ne,We=We||ot,_t=_t||Et,(Ne!==M||Qe!==N)&&(s.blendEquationSeparate(on[Ne],on[Qe]),M=Ne,N=Qe),(ot!==w||Et!==D||We!==H||_t!==O)&&(s.blendFuncSeparate(Wt[ot],Wt[Et],Wt[We],Wt[_t]),w=ot,D=Et,H=We,O=_t),(nn.equals(z)===!1||wn!==V)&&(s.blendColor(nn.r,nn.g,nn.b,wn),z.copy(nn),V=wn),T=fe,U=!1}function et(fe,Ne){fe.side===Ws?lt(s.CULL_FACE):Ee(s.CULL_FACE);let ot=fe.side===fs;Ne&&(ot=!ot),Je(ot),fe.blending===gu&&fe.transparent===!1?Ge(Jr):Ge(fe.blending,fe.blendEquation,fe.blendSrc,fe.blendDst,fe.blendEquationAlpha,fe.blendSrcAlpha,fe.blendDstAlpha,fe.blendColor,fe.blendAlpha,fe.premultipliedAlpha),l.setFunc(fe.depthFunc),l.setTest(fe.depthTest),l.setMask(fe.depthWrite),o.setMask(fe.colorWrite);const Et=fe.stencilWrite;h.setTest(Et),Et&&(h.setMask(fe.stencilWriteMask),h.setFunc(fe.stencilFunc,fe.stencilRef,fe.stencilFuncMask),h.setOp(fe.stencilFail,fe.stencilZFail,fe.stencilZPass)),Dt(fe.polygonOffset,fe.polygonOffsetFactor,fe.polygonOffsetUnits),fe.alphaToCoverage===!0?Ee(s.SAMPLE_ALPHA_TO_COVERAGE):lt(s.SAMPLE_ALPHA_TO_COVERAGE)}function Je(fe){F!==fe&&(fe?s.frontFace(s.CW):s.frontFace(s.CCW),F=fe)}function xt(fe){fe!==UM?(Ee(s.CULL_FACE),fe!==K&&(fe===Xy?s.cullFace(s.BACK):fe===LM?s.cullFace(s.FRONT):s.cullFace(s.FRONT_AND_BACK))):lt(s.CULL_FACE),K=fe}function Q(fe){fe!==ne&&(I&&s.lineWidth(fe),ne=fe)}function Dt(fe,Ne,ot){fe?(Ee(s.POLYGON_OFFSET_FILL),($!==Ne||ae!==ot)&&(s.polygonOffset(Ne,ot),$=Ne,ae=ot)):lt(s.POLYGON_OFFSET_FILL)}function mt(fe){fe?Ee(s.SCISSOR_TEST):lt(s.SCISSOR_TEST)}function Ot(fe){fe===void 0&&(fe=s.TEXTURE0+ge-1),ye!==fe&&(s.activeTexture(fe),ye=fe)}function gt(fe,Ne,ot){ot===void 0&&(ye===null?ot=s.TEXTURE0+ge-1:ot=ye);let Et=_e[ot];Et===void 0&&(Et={type:void 0,texture:void 0},_e[ot]=Et),(Et.type!==fe||Et.texture!==Ne)&&(ye!==ot&&(s.activeTexture(ot),ye=ot),s.bindTexture(fe,Ne||he[fe]),Et.type=fe,Et.texture=Ne)}function j(){const fe=_e[ye];fe!==void 0&&fe.type!==void 0&&(s.bindTexture(fe.type,null),fe.type=void 0,fe.texture=void 0)}function P(){try{s.compressedTexImage2D(...arguments)}catch(fe){Zt("WebGLState:",fe)}}function de(){try{s.compressedTexImage3D(...arguments)}catch(fe){Zt("WebGLState:",fe)}}function Fe(){try{s.texSubImage2D(...arguments)}catch(fe){Zt("WebGLState:",fe)}}function ke(){try{s.texSubImage3D(...arguments)}catch(fe){Zt("WebGLState:",fe)}}function Ie(){try{s.compressedTexSubImage2D(...arguments)}catch(fe){Zt("WebGLState:",fe)}}function Ft(){try{s.compressedTexSubImage3D(...arguments)}catch(fe){Zt("WebGLState:",fe)}}function Mt(){try{s.texStorage2D(...arguments)}catch(fe){Zt("WebGLState:",fe)}}function Ht(){try{s.texStorage3D(...arguments)}catch(fe){Zt("WebGLState:",fe)}}function zt(){try{s.texImage2D(...arguments)}catch(fe){Zt("WebGLState:",fe)}}function Ye(){try{s.texImage3D(...arguments)}catch(fe){Zt("WebGLState:",fe)}}function qe(fe){le.equals(fe)===!1&&(s.scissor(fe.x,fe.y,fe.z,fe.w),le.copy(fe))}function wt(fe){ve.equals(fe)===!1&&(s.viewport(fe.x,fe.y,fe.z,fe.w),ve.copy(fe))}function bt(fe,Ne){let ot=p.get(Ne);ot===void 0&&(ot=new WeakMap,p.set(Ne,ot));let Et=ot.get(fe);Et===void 0&&(Et=s.getUniformBlockIndex(Ne,fe.name),ot.set(fe,Et))}function rt(fe,Ne){const Et=p.get(Ne).get(fe);d.get(Ne)!==Et&&(s.uniformBlockBinding(Ne,Et,fe.__bindingPointIndex),d.set(Ne,Et))}function Vt(){s.disable(s.BLEND),s.disable(s.CULL_FACE),s.disable(s.DEPTH_TEST),s.disable(s.POLYGON_OFFSET_FILL),s.disable(s.SCISSOR_TEST),s.disable(s.STENCIL_TEST),s.disable(s.SAMPLE_ALPHA_TO_COVERAGE),s.blendEquation(s.FUNC_ADD),s.blendFunc(s.ONE,s.ZERO),s.blendFuncSeparate(s.ONE,s.ZERO,s.ONE,s.ZERO),s.blendColor(0,0,0,0),s.colorMask(!0,!0,!0,!0),s.clearColor(0,0,0,0),s.depthMask(!0),s.depthFunc(s.LESS),l.setReversed(!1),s.clearDepth(1),s.stencilMask(4294967295),s.stencilFunc(s.ALWAYS,0,4294967295),s.stencilOp(s.KEEP,s.KEEP,s.KEEP),s.clearStencil(0),s.cullFace(s.BACK),s.frontFace(s.CCW),s.polygonOffset(0,0),s.activeTexture(s.TEXTURE0),s.bindFramebuffer(s.FRAMEBUFFER,null),s.bindFramebuffer(s.DRAW_FRAMEBUFFER,null),s.bindFramebuffer(s.READ_FRAMEBUFFER,null),s.useProgram(null),s.lineWidth(1),s.scissor(0,0,s.canvas.width,s.canvas.height),s.viewport(0,0,s.canvas.width,s.canvas.height),_={},ye=null,_e={},v={},y=new WeakMap,x=[],b=null,R=!1,T=null,M=null,w=null,D=null,N=null,H=null,O=null,z=new Ct(0,0,0),V=0,U=!1,F=null,K=null,ne=null,$=null,ae=null,le.set(0,0,s.canvas.width,s.canvas.height),ve.set(0,0,s.canvas.width,s.canvas.height),o.reset(),l.reset(),h.reset()}return{buffers:{color:o,depth:l,stencil:h},enable:Ee,disable:lt,bindFramebuffer:Rt,drawBuffers:Bt,useProgram:tn,setBlending:Ge,setMaterial:et,setFlipSided:Je,setCullFace:xt,setLineWidth:Q,setPolygonOffset:Dt,setScissorTest:mt,activeTexture:Ot,bindTexture:gt,unbindTexture:j,compressedTexImage2D:P,compressedTexImage3D:de,texImage2D:zt,texImage3D:Ye,updateUBOMapping:bt,uniformBlockBinding:rt,texStorage2D:Mt,texStorage3D:Ht,texSubImage2D:Fe,texSubImage3D:ke,compressedTexSubImage2D:Ie,compressedTexSubImage3D:Ft,scissor:qe,viewport:wt,reset:Vt}}function iL(s,e,t,n,i,o,l){const h=e.has("WEBGL_multisampled_render_to_texture")?e.get("WEBGL_multisampled_render_to_texture"):null,d=typeof navigator>"u"?!1:/OculusBrowser/g.test(navigator.userAgent),p=new nt,_=new WeakMap;let v;const y=new WeakMap;let x=!1;try{x=typeof OffscreenCanvas<"u"&&new OffscreenCanvas(1,1).getContext("2d")!==null}catch{}function b(j,P){return x?new OffscreenCanvas(j,P):pp("canvas")}function R(j,P,de){let Fe=1;const ke=gt(j);if((ke.width>de||ke.height>de)&&(Fe=de/Math.max(ke.width,ke.height)),Fe<1)if(typeof HTMLImageElement<"u"&&j instanceof HTMLImageElement||typeof HTMLCanvasElement<"u"&&j instanceof HTMLCanvasElement||typeof ImageBitmap<"u"&&j instanceof ImageBitmap||typeof VideoFrame<"u"&&j instanceof VideoFrame){const Ie=Math.floor(Fe*ke.width),Ft=Math.floor(Fe*ke.height);v===void 0&&(v=b(Ie,Ft));const Mt=P?b(Ie,Ft):v;return Mt.width=Ie,Mt.height=Ft,Mt.getContext("2d").drawImage(j,0,0,Ie,Ft),Ut("WebGLRenderer: Texture has been resized from ("+ke.width+"x"+ke.height+") to ("+Ie+"x"+Ft+")."),Mt}else return"data"in j&&Ut("WebGLRenderer: Image in DataTexture is too big ("+ke.width+"x"+ke.height+")."),j;return j}function T(j){return j.generateMipmaps}function M(j){s.generateMipmap(j)}function w(j){return j.isWebGLCubeRenderTarget?s.TEXTURE_CUBE_MAP:j.isWebGL3DRenderTarget?s.TEXTURE_3D:j.isWebGLArrayRenderTarget||j.isCompressedArrayTexture?s.TEXTURE_2D_ARRAY:s.TEXTURE_2D}function D(j,P,de,Fe,ke=!1){if(j!==null){if(s[j]!==void 0)return s[j];Ut("WebGLRenderer: Attempt to use non-existing WebGL internal format '"+j+"'")}let Ie=P;if(P===s.RED&&(de===s.FLOAT&&(Ie=s.R32F),de===s.HALF_FLOAT&&(Ie=s.R16F),de===s.UNSIGNED_BYTE&&(Ie=s.R8)),P===s.RED_INTEGER&&(de===s.UNSIGNED_BYTE&&(Ie=s.R8UI),de===s.UNSIGNED_SHORT&&(Ie=s.R16UI),de===s.UNSIGNED_INT&&(Ie=s.R32UI),de===s.BYTE&&(Ie=s.R8I),de===s.SHORT&&(Ie=s.R16I),de===s.INT&&(Ie=s.R32I)),P===s.RG&&(de===s.FLOAT&&(Ie=s.RG32F),de===s.HALF_FLOAT&&(Ie=s.RG16F),de===s.UNSIGNED_BYTE&&(Ie=s.RG8)),P===s.RG_INTEGER&&(de===s.UNSIGNED_BYTE&&(Ie=s.RG8UI),de===s.UNSIGNED_SHORT&&(Ie=s.RG16UI),de===s.UNSIGNED_INT&&(Ie=s.RG32UI),de===s.BYTE&&(Ie=s.RG8I),de===s.SHORT&&(Ie=s.RG16I),de===s.INT&&(Ie=s.RG32I)),P===s.RGB_INTEGER&&(de===s.UNSIGNED_BYTE&&(Ie=s.RGB8UI),de===s.UNSIGNED_SHORT&&(Ie=s.RGB16UI),de===s.UNSIGNED_INT&&(Ie=s.RGB32UI),de===s.BYTE&&(Ie=s.RGB8I),de===s.SHORT&&(Ie=s.RGB16I),de===s.INT&&(Ie=s.RGB32I)),P===s.RGBA_INTEGER&&(de===s.UNSIGNED_BYTE&&(Ie=s.RGBA8UI),de===s.UNSIGNED_SHORT&&(Ie=s.RGBA16UI),de===s.UNSIGNED_INT&&(Ie=s.RGBA32UI),de===s.BYTE&&(Ie=s.RGBA8I),de===s.SHORT&&(Ie=s.RGBA16I),de===s.INT&&(Ie=s.RGBA32I)),P===s.RGB&&(de===s.UNSIGNED_INT_5_9_9_9_REV&&(Ie=s.RGB9_E5),de===s.UNSIGNED_INT_10F_11F_11F_REV&&(Ie=s.R11F_G11F_B10F)),P===s.RGBA){const Ft=ke?hp:Bn.getTransfer(Fe);de===s.FLOAT&&(Ie=s.RGBA32F),de===s.HALF_FLOAT&&(Ie=s.RGBA16F),de===s.UNSIGNED_BYTE&&(Ie=Ft===si?s.SRGB8_ALPHA8:s.RGBA8),de===s.UNSIGNED_SHORT_4_4_4_4&&(Ie=s.RGBA4),de===s.UNSIGNED_SHORT_5_5_5_1&&(Ie=s.RGB5_A1)}return(Ie===s.R16F||Ie===s.R32F||Ie===s.RG16F||Ie===s.RG32F||Ie===s.RGBA16F||Ie===s.RGBA32F)&&e.get("EXT_color_buffer_float"),Ie}function N(j,P){let de;return j?P===null||P===js||P===Qf?de=s.DEPTH24_STENCIL8:P===Ci?de=s.DEPTH32F_STENCIL8:P===Zf&&(de=s.DEPTH24_STENCIL8,Ut("DepthTexture: 16 bit depth attachment is not supported with stencil. Using 24-bit attachment.")):P===null||P===js||P===Qf?de=s.DEPTH_COMPONENT24:P===Ci?de=s.DEPTH_COMPONENT32F:P===Zf&&(de=s.DEPTH_COMPONENT16),de}function H(j,P){return T(j)===!0||j.isFramebufferTexture&&j.minFilter!==Ti&&j.minFilter!==Cn?Math.log2(Math.max(P.width,P.height))+1:j.mipmaps!==void 0&&j.mipmaps.length>0?j.mipmaps.length:j.isCompressedTexture&&Array.isArray(j.image)?P.mipmaps.length:1}function O(j){const P=j.target;P.removeEventListener("dispose",O),V(P),P.isVideoTexture&&_.delete(P)}function z(j){const P=j.target;P.removeEventListener("dispose",z),F(P)}function V(j){const P=n.get(j);if(P.__webglInit===void 0)return;const de=j.source,Fe=y.get(de);if(Fe){const ke=Fe[P.__cacheKey];ke.usedTimes--,ke.usedTimes===0&&U(j),Object.keys(Fe).length===0&&y.delete(de)}n.remove(j)}function U(j){const P=n.get(j);s.deleteTexture(P.__webglTexture);const de=j.source,Fe=y.get(de);delete Fe[P.__cacheKey],l.memory.textures--}function F(j){const P=n.get(j);if(j.depthTexture&&(j.depthTexture.dispose(),n.remove(j.depthTexture)),j.isWebGLCubeRenderTarget)for(let Fe=0;Fe<6;Fe++){if(Array.isArray(P.__webglFramebuffer[Fe]))for(let ke=0;ke<P.__webglFramebuffer[Fe].length;ke++)s.deleteFramebuffer(P.__webglFramebuffer[Fe][ke]);else s.deleteFramebuffer(P.__webglFramebuffer[Fe]);P.__webglDepthbuffer&&s.deleteRenderbuffer(P.__webglDepthbuffer[Fe])}else{if(Array.isArray(P.__webglFramebuffer))for(let Fe=0;Fe<P.__webglFramebuffer.length;Fe++)s.deleteFramebuffer(P.__webglFramebuffer[Fe]);else s.deleteFramebuffer(P.__webglFramebuffer);if(P.__webglDepthbuffer&&s.deleteRenderbuffer(P.__webglDepthbuffer),P.__webglMultisampledFramebuffer&&s.deleteFramebuffer(P.__webglMultisampledFramebuffer),P.__webglColorRenderbuffer)for(let Fe=0;Fe<P.__webglColorRenderbuffer.length;Fe++)P.__webglColorRenderbuffer[Fe]&&s.deleteRenderbuffer(P.__webglColorRenderbuffer[Fe]);P.__webglDepthRenderbuffer&&s.deleteRenderbuffer(P.__webglDepthRenderbuffer)}const de=j.textures;for(let Fe=0,ke=de.length;Fe<ke;Fe++){const Ie=n.get(de[Fe]);Ie.__webglTexture&&(s.deleteTexture(Ie.__webglTexture),l.memory.textures--),n.remove(de[Fe])}n.remove(j)}let K=0;function ne(){K=0}function $(){const j=K;return j>=i.maxTextures&&Ut("WebGLTextures: Trying to use "+j+" texture units while this GPU supports only "+i.maxTextures),K+=1,j}function ae(j){const P=[];return P.push(j.wrapS),P.push(j.wrapT),P.push(j.wrapR||0),P.push(j.magFilter),P.push(j.minFilter),P.push(j.anisotropy),P.push(j.internalFormat),P.push(j.format),P.push(j.type),P.push(j.generateMipmaps),P.push(j.premultiplyAlpha),P.push(j.flipY),P.push(j.unpackAlignment),P.push(j.colorSpace),P.join()}function ge(j,P){const de=n.get(j);if(j.isVideoTexture&&mt(j),j.isRenderTargetTexture===!1&&j.isExternalTexture!==!0&&j.version>0&&de.__version!==j.version){const Fe=j.image;if(Fe===null)Ut("WebGLRenderer: Texture marked for update but no image data found.");else if(Fe.complete===!1)Ut("WebGLRenderer: Texture marked for update but image is incomplete");else{he(de,j,P);return}}else j.isExternalTexture&&(de.__webglTexture=j.sourceTexture?j.sourceTexture:null);t.bindTexture(s.TEXTURE_2D,de.__webglTexture,s.TEXTURE0+P)}function I(j,P){const de=n.get(j);if(j.isRenderTargetTexture===!1&&j.version>0&&de.__version!==j.version){he(de,j,P);return}else j.isExternalTexture&&(de.__webglTexture=j.sourceTexture?j.sourceTexture:null);t.bindTexture(s.TEXTURE_2D_ARRAY,de.__webglTexture,s.TEXTURE0+P)}function W(j,P){const de=n.get(j);if(j.isRenderTargetTexture===!1&&j.version>0&&de.__version!==j.version){he(de,j,P);return}t.bindTexture(s.TEXTURE_3D,de.__webglTexture,s.TEXTURE0+P)}function ee(j,P){const de=n.get(j);if(j.isCubeDepthTexture!==!0&&j.version>0&&de.__version!==j.version){Ee(de,j,P);return}t.bindTexture(s.TEXTURE_CUBE_MAP,de.__webglTexture,s.TEXTURE0+P)}const ye={[Kr]:s.REPEAT,[Ei]:s.CLAMP_TO_EDGE,[_u]:s.MIRRORED_REPEAT},_e={[Ti]:s.NEAREST,[tp]:s.NEAREST_MIPMAP_NEAREST,[lc]:s.NEAREST_MIPMAP_LINEAR,[Cn]:s.LINEAR,[yu]:s.LINEAR_MIPMAP_NEAREST,[Is]:s.LINEAR_MIPMAP_LINEAR},X={[ob]:s.NEVER,[hb]:s.ALWAYS,[lb]:s.LESS,[M0]:s.LEQUAL,[cb]:s.EQUAL,[b0]:s.GEQUAL,[ub]:s.GREATER,[fb]:s.NOTEQUAL};function te(j,P){if(P.type===Ci&&e.has("OES_texture_float_linear")===!1&&(P.magFilter===Cn||P.magFilter===yu||P.magFilter===lc||P.magFilter===Is||P.minFilter===Cn||P.minFilter===yu||P.minFilter===lc||P.minFilter===Is)&&Ut("WebGLRenderer: Unable to use linear filtering with floating point textures. OES_texture_float_linear not supported on this device."),s.texParameteri(j,s.TEXTURE_WRAP_S,ye[P.wrapS]),s.texParameteri(j,s.TEXTURE_WRAP_T,ye[P.wrapT]),(j===s.TEXTURE_3D||j===s.TEXTURE_2D_ARRAY)&&s.texParameteri(j,s.TEXTURE_WRAP_R,ye[P.wrapR]),s.texParameteri(j,s.TEXTURE_MAG_FILTER,_e[P.magFilter]),s.texParameteri(j,s.TEXTURE_MIN_FILTER,_e[P.minFilter]),P.compareFunction&&(s.texParameteri(j,s.TEXTURE_COMPARE_MODE,s.COMPARE_REF_TO_TEXTURE),s.texParameteri(j,s.TEXTURE_COMPARE_FUNC,X[P.compareFunction])),e.has("EXT_texture_filter_anisotropic")===!0){if(P.magFilter===Ti||P.minFilter!==lc&&P.minFilter!==Is||P.type===Ci&&e.has("OES_texture_float_linear")===!1)return;if(P.anisotropy>1||n.get(P).__currentAnisotropy){const de=e.get("EXT_texture_filter_anisotropic");s.texParameterf(j,de.TEXTURE_MAX_ANISOTROPY_EXT,Math.min(P.anisotropy,i.getMaxAnisotropy())),n.get(P).__currentAnisotropy=P.anisotropy}}}function le(j,P){let de=!1;j.__webglInit===void 0&&(j.__webglInit=!0,P.addEventListener("dispose",O));const Fe=P.source;let ke=y.get(Fe);ke===void 0&&(ke={},y.set(Fe,ke));const Ie=ae(P);if(Ie!==j.__cacheKey){ke[Ie]===void 0&&(ke[Ie]={texture:s.createTexture(),usedTimes:0},l.memory.textures++,de=!0),ke[Ie].usedTimes++;const Ft=ke[j.__cacheKey];Ft!==void 0&&(ke[j.__cacheKey].usedTimes--,Ft.usedTimes===0&&U(P)),j.__cacheKey=Ie,j.__webglTexture=ke[Ie].texture}return de}function ve(j,P,de){return Math.floor(Math.floor(j/de)/P)}function ze(j,P,de,Fe){const Ie=j.updateRanges;if(Ie.length===0)t.texSubImage2D(s.TEXTURE_2D,0,0,0,P.width,P.height,de,Fe,P.data);else{Ie.sort((Ye,qe)=>Ye.start-qe.start);let Ft=0;for(let Ye=1;Ye<Ie.length;Ye++){const qe=Ie[Ft],wt=Ie[Ye],bt=qe.start+qe.count,rt=ve(wt.start,P.width,4),Vt=ve(qe.start,P.width,4);wt.start<=bt+1&&rt===Vt&&ve(wt.start+wt.count-1,P.width,4)===rt?qe.count=Math.max(qe.count,wt.start+wt.count-qe.start):(++Ft,Ie[Ft]=wt)}Ie.length=Ft+1;const Mt=s.getParameter(s.UNPACK_ROW_LENGTH),Ht=s.getParameter(s.UNPACK_SKIP_PIXELS),zt=s.getParameter(s.UNPACK_SKIP_ROWS);s.pixelStorei(s.UNPACK_ROW_LENGTH,P.width);for(let Ye=0,qe=Ie.length;Ye<qe;Ye++){const wt=Ie[Ye],bt=Math.floor(wt.start/4),rt=Math.ceil(wt.count/4),Vt=bt%P.width,fe=Math.floor(bt/P.width),Ne=rt,ot=1;s.pixelStorei(s.UNPACK_SKIP_PIXELS,Vt),s.pixelStorei(s.UNPACK_SKIP_ROWS,fe),t.texSubImage2D(s.TEXTURE_2D,0,Vt,fe,Ne,ot,de,Fe,P.data)}j.clearUpdateRanges(),s.pixelStorei(s.UNPACK_ROW_LENGTH,Mt),s.pixelStorei(s.UNPACK_SKIP_PIXELS,Ht),s.pixelStorei(s.UNPACK_SKIP_ROWS,zt)}}function he(j,P,de){let Fe=s.TEXTURE_2D;(P.isDataArrayTexture||P.isCompressedArrayTexture)&&(Fe=s.TEXTURE_2D_ARRAY),P.isData3DTexture&&(Fe=s.TEXTURE_3D);const ke=le(j,P),Ie=P.source;t.bindTexture(Fe,j.__webglTexture,s.TEXTURE0+de);const Ft=n.get(Ie);if(Ie.version!==Ft.__version||ke===!0){t.activeTexture(s.TEXTURE0+de);const Mt=Bn.getPrimaries(Bn.workingColorSpace),Ht=P.colorSpace===dl?null:Bn.getPrimaries(P.colorSpace),zt=P.colorSpace===dl||Mt===Ht?s.NONE:s.BROWSER_DEFAULT_WEBGL;s.pixelStorei(s.UNPACK_FLIP_Y_WEBGL,P.flipY),s.pixelStorei(s.UNPACK_PREMULTIPLY_ALPHA_WEBGL,P.premultiplyAlpha),s.pixelStorei(s.UNPACK_ALIGNMENT,P.unpackAlignment),s.pixelStorei(s.UNPACK_COLORSPACE_CONVERSION_WEBGL,zt);let Ye=R(P.image,!1,i.maxTextureSize);Ye=Ot(P,Ye);const qe=o.convert(P.format,P.colorSpace),wt=o.convert(P.type);let bt=D(P.internalFormat,qe,wt,P.colorSpace,P.isVideoTexture);te(Fe,P);let rt;const Vt=P.mipmaps,fe=P.isVideoTexture!==!0,Ne=Ft.__version===void 0||ke===!0,ot=Ie.dataReady,Et=H(P,Ye);if(P.isDepthTexture)bt=N(P.format===cc,P.type),Ne&&(fe?t.texStorage2D(s.TEXTURE_2D,1,bt,Ye.width,Ye.height):t.texImage2D(s.TEXTURE_2D,0,bt,Ye.width,Ye.height,0,qe,wt,null));else if(P.isDataTexture)if(Vt.length>0){fe&&Ne&&t.texStorage2D(s.TEXTURE_2D,Et,bt,Vt[0].width,Vt[0].height);for(let Qe=0,We=Vt.length;Qe<We;Qe++)rt=Vt[Qe],fe?ot&&t.texSubImage2D(s.TEXTURE_2D,Qe,0,0,rt.width,rt.height,qe,wt,rt.data):t.texImage2D(s.TEXTURE_2D,Qe,bt,rt.width,rt.height,0,qe,wt,rt.data);P.generateMipmaps=!1}else fe?(Ne&&t.texStorage2D(s.TEXTURE_2D,Et,bt,Ye.width,Ye.height),ot&&ze(P,Ye,qe,wt)):t.texImage2D(s.TEXTURE_2D,0,bt,Ye.width,Ye.height,0,qe,wt,Ye.data);else if(P.isCompressedTexture)if(P.isCompressedArrayTexture){fe&&Ne&&t.texStorage3D(s.TEXTURE_2D_ARRAY,Et,bt,Vt[0].width,Vt[0].height,Ye.depth);for(let Qe=0,We=Vt.length;Qe<We;Qe++)if(rt=Vt[Qe],P.format!==Zi)if(qe!==null)if(fe){if(ot)if(P.layerUpdates.size>0){const _t=RA(rt.width,rt.height,P.format,P.type);for(const nn of P.layerUpdates){const wn=rt.data.subarray(nn*_t/rt.data.BYTES_PER_ELEMENT,(nn+1)*_t/rt.data.BYTES_PER_ELEMENT);t.compressedTexSubImage3D(s.TEXTURE_2D_ARRAY,Qe,0,0,nn,rt.width,rt.height,1,qe,wn)}P.clearLayerUpdates()}else t.compressedTexSubImage3D(s.TEXTURE_2D_ARRAY,Qe,0,0,0,rt.width,rt.height,Ye.depth,qe,rt.data)}else t.compressedTexImage3D(s.TEXTURE_2D_ARRAY,Qe,bt,rt.width,rt.height,Ye.depth,0,rt.data,0,0);else Ut("WebGLRenderer: Attempt to load unsupported compressed texture format in .uploadTexture()");else fe?ot&&t.texSubImage3D(s.TEXTURE_2D_ARRAY,Qe,0,0,0,rt.width,rt.height,Ye.depth,qe,wt,rt.data):t.texImage3D(s.TEXTURE_2D_ARRAY,Qe,bt,rt.width,rt.height,Ye.depth,0,qe,wt,rt.data)}else{fe&&Ne&&t.texStorage2D(s.TEXTURE_2D,Et,bt,Vt[0].width,Vt[0].height);for(let Qe=0,We=Vt.length;Qe<We;Qe++)rt=Vt[Qe],P.format!==Zi?qe!==null?fe?ot&&t.compressedTexSubImage2D(s.TEXTURE_2D,Qe,0,0,rt.width,rt.height,qe,rt.data):t.compressedTexImage2D(s.TEXTURE_2D,Qe,bt,rt.width,rt.height,0,rt.data):Ut("WebGLRenderer: Attempt to load unsupported compressed texture format in .uploadTexture()"):fe?ot&&t.texSubImage2D(s.TEXTURE_2D,Qe,0,0,rt.width,rt.height,qe,wt,rt.data):t.texImage2D(s.TEXTURE_2D,Qe,bt,rt.width,rt.height,0,qe,wt,rt.data)}else if(P.isDataArrayTexture)if(fe){if(Ne&&t.texStorage3D(s.TEXTURE_2D_ARRAY,Et,bt,Ye.width,Ye.height,Ye.depth),ot)if(P.layerUpdates.size>0){const Qe=RA(Ye.width,Ye.height,P.format,P.type);for(const We of P.layerUpdates){const _t=Ye.data.subarray(We*Qe/Ye.data.BYTES_PER_ELEMENT,(We+1)*Qe/Ye.data.BYTES_PER_ELEMENT);t.texSubImage3D(s.TEXTURE_2D_ARRAY,0,0,0,We,Ye.width,Ye.height,1,qe,wt,_t)}P.clearLayerUpdates()}else t.texSubImage3D(s.TEXTURE_2D_ARRAY,0,0,0,0,Ye.width,Ye.height,Ye.depth,qe,wt,Ye.data)}else t.texImage3D(s.TEXTURE_2D_ARRAY,0,bt,Ye.width,Ye.height,Ye.depth,0,qe,wt,Ye.data);else if(P.isData3DTexture)fe?(Ne&&t.texStorage3D(s.TEXTURE_3D,Et,bt,Ye.width,Ye.height,Ye.depth),ot&&t.texSubImage3D(s.TEXTURE_3D,0,0,0,0,Ye.width,Ye.height,Ye.depth,qe,wt,Ye.data)):t.texImage3D(s.TEXTURE_3D,0,bt,Ye.width,Ye.height,Ye.depth,0,qe,wt,Ye.data);else if(P.isFramebufferTexture){if(Ne)if(fe)t.texStorage2D(s.TEXTURE_2D,Et,bt,Ye.width,Ye.height);else{let Qe=Ye.width,We=Ye.height;for(let _t=0;_t<Et;_t++)t.texImage2D(s.TEXTURE_2D,_t,bt,Qe,We,0,qe,wt,null),Qe>>=1,We>>=1}}else if(Vt.length>0){if(fe&&Ne){const Qe=gt(Vt[0]);t.texStorage2D(s.TEXTURE_2D,Et,bt,Qe.width,Qe.height)}for(let Qe=0,We=Vt.length;Qe<We;Qe++)rt=Vt[Qe],fe?ot&&t.texSubImage2D(s.TEXTURE_2D,Qe,0,0,qe,wt,rt):t.texImage2D(s.TEXTURE_2D,Qe,bt,qe,wt,rt);P.generateMipmaps=!1}else if(fe){if(Ne){const Qe=gt(Ye);t.texStorage2D(s.TEXTURE_2D,Et,bt,Qe.width,Qe.height)}ot&&t.texSubImage2D(s.TEXTURE_2D,0,0,0,qe,wt,Ye)}else t.texImage2D(s.TEXTURE_2D,0,bt,qe,wt,Ye);T(P)&&M(Fe),Ft.__version=Ie.version,P.onUpdate&&P.onUpdate(P)}j.__version=P.version}function Ee(j,P,de){if(P.image.length!==6)return;const Fe=le(j,P),ke=P.source;t.bindTexture(s.TEXTURE_CUBE_MAP,j.__webglTexture,s.TEXTURE0+de);const Ie=n.get(ke);if(ke.version!==Ie.__version||Fe===!0){t.activeTexture(s.TEXTURE0+de);const Ft=Bn.getPrimaries(Bn.workingColorSpace),Mt=P.colorSpace===dl?null:Bn.getPrimaries(P.colorSpace),Ht=P.colorSpace===dl||Ft===Mt?s.NONE:s.BROWSER_DEFAULT_WEBGL;s.pixelStorei(s.UNPACK_FLIP_Y_WEBGL,P.flipY),s.pixelStorei(s.UNPACK_PREMULTIPLY_ALPHA_WEBGL,P.premultiplyAlpha),s.pixelStorei(s.UNPACK_ALIGNMENT,P.unpackAlignment),s.pixelStorei(s.UNPACK_COLORSPACE_CONVERSION_WEBGL,Ht);const zt=P.isCompressedTexture||P.image[0].isCompressedTexture,Ye=P.image[0]&&P.image[0].isDataTexture,qe=[];for(let We=0;We<6;We++)!zt&&!Ye?qe[We]=R(P.image[We],!0,i.maxCubemapSize):qe[We]=Ye?P.image[We].image:P.image[We],qe[We]=Ot(P,qe[We]);const wt=qe[0],bt=o.convert(P.format,P.colorSpace),rt=o.convert(P.type),Vt=D(P.internalFormat,bt,rt,P.colorSpace),fe=P.isVideoTexture!==!0,Ne=Ie.__version===void 0||Fe===!0,ot=ke.dataReady;let Et=H(P,wt);te(s.TEXTURE_CUBE_MAP,P);let Qe;if(zt){fe&&Ne&&t.texStorage2D(s.TEXTURE_CUBE_MAP,Et,Vt,wt.width,wt.height);for(let We=0;We<6;We++){Qe=qe[We].mipmaps;for(let _t=0;_t<Qe.length;_t++){const nn=Qe[_t];P.format!==Zi?bt!==null?fe?ot&&t.compressedTexSubImage2D(s.TEXTURE_CUBE_MAP_POSITIVE_X+We,_t,0,0,nn.width,nn.height,bt,nn.data):t.compressedTexImage2D(s.TEXTURE_CUBE_MAP_POSITIVE_X+We,_t,Vt,nn.width,nn.height,0,nn.data):Ut("WebGLRenderer: Attempt to load unsupported compressed texture format in .setTextureCube()"):fe?ot&&t.texSubImage2D(s.TEXTURE_CUBE_MAP_POSITIVE_X+We,_t,0,0,nn.width,nn.height,bt,rt,nn.data):t.texImage2D(s.TEXTURE_CUBE_MAP_POSITIVE_X+We,_t,Vt,nn.width,nn.height,0,bt,rt,nn.data)}}}else{if(Qe=P.mipmaps,fe&&Ne){Qe.length>0&&Et++;const We=gt(qe[0]);t.texStorage2D(s.TEXTURE_CUBE_MAP,Et,Vt,We.width,We.height)}for(let We=0;We<6;We++)if(Ye){fe?ot&&t.texSubImage2D(s.TEXTURE_CUBE_MAP_POSITIVE_X+We,0,0,0,qe[We].width,qe[We].height,bt,rt,qe[We].data):t.texImage2D(s.TEXTURE_CUBE_MAP_POSITIVE_X+We,0,Vt,qe[We].width,qe[We].height,0,bt,rt,qe[We].data);for(let _t=0;_t<Qe.length;_t++){const wn=Qe[_t].image[We].image;fe?ot&&t.texSubImage2D(s.TEXTURE_CUBE_MAP_POSITIVE_X+We,_t+1,0,0,wn.width,wn.height,bt,rt,wn.data):t.texImage2D(s.TEXTURE_CUBE_MAP_POSITIVE_X+We,_t+1,Vt,wn.width,wn.height,0,bt,rt,wn.data)}}else{fe?ot&&t.texSubImage2D(s.TEXTURE_CUBE_MAP_POSITIVE_X+We,0,0,0,bt,rt,qe[We]):t.texImage2D(s.TEXTURE_CUBE_MAP_POSITIVE_X+We,0,Vt,bt,rt,qe[We]);for(let _t=0;_t<Qe.length;_t++){const nn=Qe[_t];fe?ot&&t.texSubImage2D(s.TEXTURE_CUBE_MAP_POSITIVE_X+We,_t+1,0,0,bt,rt,nn.image[We]):t.texImage2D(s.TEXTURE_CUBE_MAP_POSITIVE_X+We,_t+1,Vt,bt,rt,nn.image[We])}}}T(P)&&M(s.TEXTURE_CUBE_MAP),Ie.__version=ke.version,P.onUpdate&&P.onUpdate(P)}j.__version=P.version}function lt(j,P,de,Fe,ke,Ie){const Ft=o.convert(de.format,de.colorSpace),Mt=o.convert(de.type),Ht=D(de.internalFormat,Ft,Mt,de.colorSpace),zt=n.get(P),Ye=n.get(de);if(Ye.__renderTarget=P,!zt.__hasExternalTextures){const qe=Math.max(1,P.width>>Ie),wt=Math.max(1,P.height>>Ie);ke===s.TEXTURE_3D||ke===s.TEXTURE_2D_ARRAY?t.texImage3D(ke,Ie,Ht,qe,wt,P.depth,0,Ft,Mt,null):t.texImage2D(ke,Ie,Ht,qe,wt,0,Ft,Mt,null)}t.bindFramebuffer(s.FRAMEBUFFER,j),Dt(P)?h.framebufferTexture2DMultisampleEXT(s.FRAMEBUFFER,Fe,ke,Ye.__webglTexture,0,Q(P)):(ke===s.TEXTURE_2D||ke>=s.TEXTURE_CUBE_MAP_POSITIVE_X&&ke<=s.TEXTURE_CUBE_MAP_NEGATIVE_Z)&&s.framebufferTexture2D(s.FRAMEBUFFER,Fe,ke,Ye.__webglTexture,Ie),t.bindFramebuffer(s.FRAMEBUFFER,null)}function Rt(j,P,de){if(s.bindRenderbuffer(s.RENDERBUFFER,j),P.depthBuffer){const Fe=P.depthTexture,ke=Fe&&Fe.isDepthTexture?Fe.type:null,Ie=N(P.stencilBuffer,ke),Ft=P.stencilBuffer?s.DEPTH_STENCIL_ATTACHMENT:s.DEPTH_ATTACHMENT;Dt(P)?h.renderbufferStorageMultisampleEXT(s.RENDERBUFFER,Q(P),Ie,P.width,P.height):de?s.renderbufferStorageMultisample(s.RENDERBUFFER,Q(P),Ie,P.width,P.height):s.renderbufferStorage(s.RENDERBUFFER,Ie,P.width,P.height),s.framebufferRenderbuffer(s.FRAMEBUFFER,Ft,s.RENDERBUFFER,j)}else{const Fe=P.textures;for(let ke=0;ke<Fe.length;ke++){const Ie=Fe[ke],Ft=o.convert(Ie.format,Ie.colorSpace),Mt=o.convert(Ie.type),Ht=D(Ie.internalFormat,Ft,Mt,Ie.colorSpace);Dt(P)?h.renderbufferStorageMultisampleEXT(s.RENDERBUFFER,Q(P),Ht,P.width,P.height):de?s.renderbufferStorageMultisample(s.RENDERBUFFER,Q(P),Ht,P.width,P.height):s.renderbufferStorage(s.RENDERBUFFER,Ht,P.width,P.height)}}s.bindRenderbuffer(s.RENDERBUFFER,null)}function Bt(j,P,de){const Fe=P.isWebGLCubeRenderTarget===!0;if(t.bindFramebuffer(s.FRAMEBUFFER,j),!(P.depthTexture&&P.depthTexture.isDepthTexture))throw new Error("renderTarget.depthTexture must be an instance of THREE.DepthTexture");const ke=n.get(P.depthTexture);if(ke.__renderTarget=P,(!ke.__webglTexture||P.depthTexture.image.width!==P.width||P.depthTexture.image.height!==P.height)&&(P.depthTexture.image.width=P.width,P.depthTexture.image.height=P.height,P.depthTexture.needsUpdate=!0),Fe){if(ke.__webglInit===void 0&&(ke.__webglInit=!0,P.depthTexture.addEventListener("dispose",O)),ke.__webglTexture===void 0){ke.__webglTexture=s.createTexture(),t.bindTexture(s.TEXTURE_CUBE_MAP,ke.__webglTexture),te(s.TEXTURE_CUBE_MAP,P.depthTexture);const zt=o.convert(P.depthTexture.format),Ye=o.convert(P.depthTexture.type);let qe;P.depthTexture.format===Eo?qe=s.DEPTH_COMPONENT24:P.depthTexture.format===cc&&(qe=s.DEPTH24_STENCIL8);for(let wt=0;wt<6;wt++)s.texImage2D(s.TEXTURE_CUBE_MAP_POSITIVE_X+wt,0,qe,P.width,P.height,0,zt,Ye,null)}}else ge(P.depthTexture,0);const Ie=ke.__webglTexture,Ft=Q(P),Mt=Fe?s.TEXTURE_CUBE_MAP_POSITIVE_X+de:s.TEXTURE_2D,Ht=P.depthTexture.format===cc?s.DEPTH_STENCIL_ATTACHMENT:s.DEPTH_ATTACHMENT;if(P.depthTexture.format===Eo)Dt(P)?h.framebufferTexture2DMultisampleEXT(s.FRAMEBUFFER,Ht,Mt,Ie,0,Ft):s.framebufferTexture2D(s.FRAMEBUFFER,Ht,Mt,Ie,0);else if(P.depthTexture.format===cc)Dt(P)?h.framebufferTexture2DMultisampleEXT(s.FRAMEBUFFER,Ht,Mt,Ie,0,Ft):s.framebufferTexture2D(s.FRAMEBUFFER,Ht,Mt,Ie,0);else throw new Error("Unknown depthTexture format")}function tn(j){const P=n.get(j),de=j.isWebGLCubeRenderTarget===!0;if(P.__boundDepthTexture!==j.depthTexture){const Fe=j.depthTexture;if(P.__depthDisposeCallback&&P.__depthDisposeCallback(),Fe){const ke=()=>{delete P.__boundDepthTexture,delete P.__depthDisposeCallback,Fe.removeEventListener("dispose",ke)};Fe.addEventListener("dispose",ke),P.__depthDisposeCallback=ke}P.__boundDepthTexture=Fe}if(j.depthTexture&&!P.__autoAllocateDepthBuffer)if(de)for(let Fe=0;Fe<6;Fe++)Bt(P.__webglFramebuffer[Fe],j,Fe);else{const Fe=j.texture.mipmaps;Fe&&Fe.length>0?Bt(P.__webglFramebuffer[0],j,0):Bt(P.__webglFramebuffer,j,0)}else if(de){P.__webglDepthbuffer=[];for(let Fe=0;Fe<6;Fe++)if(t.bindFramebuffer(s.FRAMEBUFFER,P.__webglFramebuffer[Fe]),P.__webglDepthbuffer[Fe]===void 0)P.__webglDepthbuffer[Fe]=s.createRenderbuffer(),Rt(P.__webglDepthbuffer[Fe],j,!1);else{const ke=j.stencilBuffer?s.DEPTH_STENCIL_ATTACHMENT:s.DEPTH_ATTACHMENT,Ie=P.__webglDepthbuffer[Fe];s.bindRenderbuffer(s.RENDERBUFFER,Ie),s.framebufferRenderbuffer(s.FRAMEBUFFER,ke,s.RENDERBUFFER,Ie)}}else{const Fe=j.texture.mipmaps;if(Fe&&Fe.length>0?t.bindFramebuffer(s.FRAMEBUFFER,P.__webglFramebuffer[0]):t.bindFramebuffer(s.FRAMEBUFFER,P.__webglFramebuffer),P.__webglDepthbuffer===void 0)P.__webglDepthbuffer=s.createRenderbuffer(),Rt(P.__webglDepthbuffer,j,!1);else{const ke=j.stencilBuffer?s.DEPTH_STENCIL_ATTACHMENT:s.DEPTH_ATTACHMENT,Ie=P.__webglDepthbuffer;s.bindRenderbuffer(s.RENDERBUFFER,Ie),s.framebufferRenderbuffer(s.FRAMEBUFFER,ke,s.RENDERBUFFER,Ie)}}t.bindFramebuffer(s.FRAMEBUFFER,null)}function on(j,P,de){const Fe=n.get(j);P!==void 0&<(Fe.__webglFramebuffer,j,j.texture,s.COLOR_ATTACHMENT0,s.TEXTURE_2D,0),de!==void 0&&tn(j)}function Wt(j){const P=j.texture,de=n.get(j),Fe=n.get(P);j.addEventListener("dispose",z);const ke=j.textures,Ie=j.isWebGLCubeRenderTarget===!0,Ft=ke.length>1;if(Ft||(Fe.__webglTexture===void 0&&(Fe.__webglTexture=s.createTexture()),Fe.__version=P.version,l.memory.textures++),Ie){de.__webglFramebuffer=[];for(let Mt=0;Mt<6;Mt++)if(P.mipmaps&&P.mipmaps.length>0){de.__webglFramebuffer[Mt]=[];for(let Ht=0;Ht<P.mipmaps.length;Ht++)de.__webglFramebuffer[Mt][Ht]=s.createFramebuffer()}else de.__webglFramebuffer[Mt]=s.createFramebuffer()}else{if(P.mipmaps&&P.mipmaps.length>0){de.__webglFramebuffer=[];for(let Mt=0;Mt<P.mipmaps.length;Mt++)de.__webglFramebuffer[Mt]=s.createFramebuffer()}else de.__webglFramebuffer=s.createFramebuffer();if(Ft)for(let Mt=0,Ht=ke.length;Mt<Ht;Mt++){const zt=n.get(ke[Mt]);zt.__webglTexture===void 0&&(zt.__webglTexture=s.createTexture(),l.memory.textures++)}if(j.samples>0&&Dt(j)===!1){de.__webglMultisampledFramebuffer=s.createFramebuffer(),de.__webglColorRenderbuffer=[],t.bindFramebuffer(s.FRAMEBUFFER,de.__webglMultisampledFramebuffer);for(let Mt=0;Mt<ke.length;Mt++){const Ht=ke[Mt];de.__webglColorRenderbuffer[Mt]=s.createRenderbuffer(),s.bindRenderbuffer(s.RENDERBUFFER,de.__webglColorRenderbuffer[Mt]);const zt=o.convert(Ht.format,Ht.colorSpace),Ye=o.convert(Ht.type),qe=D(Ht.internalFormat,zt,Ye,Ht.colorSpace,j.isXRRenderTarget===!0),wt=Q(j);s.renderbufferStorageMultisample(s.RENDERBUFFER,wt,qe,j.width,j.height),s.framebufferRenderbuffer(s.FRAMEBUFFER,s.COLOR_ATTACHMENT0+Mt,s.RENDERBUFFER,de.__webglColorRenderbuffer[Mt])}s.bindRenderbuffer(s.RENDERBUFFER,null),j.depthBuffer&&(de.__webglDepthRenderbuffer=s.createRenderbuffer(),Rt(de.__webglDepthRenderbuffer,j,!0)),t.bindFramebuffer(s.FRAMEBUFFER,null)}}if(Ie){t.bindTexture(s.TEXTURE_CUBE_MAP,Fe.__webglTexture),te(s.TEXTURE_CUBE_MAP,P);for(let Mt=0;Mt<6;Mt++)if(P.mipmaps&&P.mipmaps.length>0)for(let Ht=0;Ht<P.mipmaps.length;Ht++)lt(de.__webglFramebuffer[Mt][Ht],j,P,s.COLOR_ATTACHMENT0,s.TEXTURE_CUBE_MAP_POSITIVE_X+Mt,Ht);else lt(de.__webglFramebuffer[Mt],j,P,s.COLOR_ATTACHMENT0,s.TEXTURE_CUBE_MAP_POSITIVE_X+Mt,0);T(P)&&M(s.TEXTURE_CUBE_MAP),t.unbindTexture()}else if(Ft){for(let Mt=0,Ht=ke.length;Mt<Ht;Mt++){const zt=ke[Mt],Ye=n.get(zt);let qe=s.TEXTURE_2D;(j.isWebGL3DRenderTarget||j.isWebGLArrayRenderTarget)&&(qe=j.isWebGL3DRenderTarget?s.TEXTURE_3D:s.TEXTURE_2D_ARRAY),t.bindTexture(qe,Ye.__webglTexture),te(qe,zt),lt(de.__webglFramebuffer,j,zt,s.COLOR_ATTACHMENT0+Mt,qe,0),T(zt)&&M(qe)}t.unbindTexture()}else{let Mt=s.TEXTURE_2D;if((j.isWebGL3DRenderTarget||j.isWebGLArrayRenderTarget)&&(Mt=j.isWebGL3DRenderTarget?s.TEXTURE_3D:s.TEXTURE_2D_ARRAY),t.bindTexture(Mt,Fe.__webglTexture),te(Mt,P),P.mipmaps&&P.mipmaps.length>0)for(let Ht=0;Ht<P.mipmaps.length;Ht++)lt(de.__webglFramebuffer[Ht],j,P,s.COLOR_ATTACHMENT0,Mt,Ht);else lt(de.__webglFramebuffer,j,P,s.COLOR_ATTACHMENT0,Mt,0);T(P)&&M(Mt),t.unbindTexture()}j.depthBuffer&&tn(j)}function Ge(j){const P=j.textures;for(let de=0,Fe=P.length;de<Fe;de++){const ke=P[de];if(T(ke)){const Ie=w(j),Ft=n.get(ke).__webglTexture;t.bindTexture(Ie,Ft),M(Ie),t.unbindTexture()}}}const et=[],Je=[];function xt(j){if(j.samples>0){if(Dt(j)===!1){const P=j.textures,de=j.width,Fe=j.height;let ke=s.COLOR_BUFFER_BIT;const Ie=j.stencilBuffer?s.DEPTH_STENCIL_ATTACHMENT:s.DEPTH_ATTACHMENT,Ft=n.get(j),Mt=P.length>1;if(Mt)for(let zt=0;zt<P.length;zt++)t.bindFramebuffer(s.FRAMEBUFFER,Ft.__webglMultisampledFramebuffer),s.framebufferRenderbuffer(s.FRAMEBUFFER,s.COLOR_ATTACHMENT0+zt,s.RENDERBUFFER,null),t.bindFramebuffer(s.FRAMEBUFFER,Ft.__webglFramebuffer),s.framebufferTexture2D(s.DRAW_FRAMEBUFFER,s.COLOR_ATTACHMENT0+zt,s.TEXTURE_2D,null,0);t.bindFramebuffer(s.READ_FRAMEBUFFER,Ft.__webglMultisampledFramebuffer);const Ht=j.texture.mipmaps;Ht&&Ht.length>0?t.bindFramebuffer(s.DRAW_FRAMEBUFFER,Ft.__webglFramebuffer[0]):t.bindFramebuffer(s.DRAW_FRAMEBUFFER,Ft.__webglFramebuffer);for(let zt=0;zt<P.length;zt++){if(j.resolveDepthBuffer&&(j.depthBuffer&&(ke|=s.DEPTH_BUFFER_BIT),j.stencilBuffer&&j.resolveStencilBuffer&&(ke|=s.STENCIL_BUFFER_BIT)),Mt){s.framebufferRenderbuffer(s.READ_FRAMEBUFFER,s.COLOR_ATTACHMENT0,s.RENDERBUFFER,Ft.__webglColorRenderbuffer[zt]);const Ye=n.get(P[zt]).__webglTexture;s.framebufferTexture2D(s.DRAW_FRAMEBUFFER,s.COLOR_ATTACHMENT0,s.TEXTURE_2D,Ye,0)}s.blitFramebuffer(0,0,de,Fe,0,0,de,Fe,ke,s.NEAREST),d===!0&&(et.length=0,Je.length=0,et.push(s.COLOR_ATTACHMENT0+zt),j.depthBuffer&&j.resolveDepthBuffer===!1&&(et.push(Ie),Je.push(Ie),s.invalidateFramebuffer(s.DRAW_FRAMEBUFFER,Je)),s.invalidateFramebuffer(s.READ_FRAMEBUFFER,et))}if(t.bindFramebuffer(s.READ_FRAMEBUFFER,null),t.bindFramebuffer(s.DRAW_FRAMEBUFFER,null),Mt)for(let zt=0;zt<P.length;zt++){t.bindFramebuffer(s.FRAMEBUFFER,Ft.__webglMultisampledFramebuffer),s.framebufferRenderbuffer(s.FRAMEBUFFER,s.COLOR_ATTACHMENT0+zt,s.RENDERBUFFER,Ft.__webglColorRenderbuffer[zt]);const Ye=n.get(P[zt]).__webglTexture;t.bindFramebuffer(s.FRAMEBUFFER,Ft.__webglFramebuffer),s.framebufferTexture2D(s.DRAW_FRAMEBUFFER,s.COLOR_ATTACHMENT0+zt,s.TEXTURE_2D,Ye,0)}t.bindFramebuffer(s.DRAW_FRAMEBUFFER,Ft.__webglMultisampledFramebuffer)}else if(j.depthBuffer&&j.resolveDepthBuffer===!1&&d){const P=j.stencilBuffer?s.DEPTH_STENCIL_ATTACHMENT:s.DEPTH_ATTACHMENT;s.invalidateFramebuffer(s.DRAW_FRAMEBUFFER,[P])}}}function Q(j){return Math.min(i.maxSamples,j.samples)}function Dt(j){const P=n.get(j);return j.samples>0&&e.has("WEBGL_multisampled_render_to_texture")===!0&&P.__useRenderToTexture!==!1}function mt(j){const P=l.render.frame;_.get(j)!==P&&(_.set(j,P),j.update())}function Ot(j,P){const de=j.colorSpace,Fe=j.format,ke=j.type;return j.isCompressedTexture===!0||j.isVideoTexture===!0||de!==na&&de!==dl&&(Bn.getTransfer(de)===si?(Fe!==Zi||ke!==Ta)&&Ut("WebGLTextures: sRGB encoded textures have to use RGBAFormat and UnsignedByteType."):Zt("WebGLTextures: Unsupported texture color space:",de)),P}function gt(j){return typeof HTMLImageElement<"u"&&j instanceof HTMLImageElement?(p.width=j.naturalWidth||j.width,p.height=j.naturalHeight||j.height):typeof VideoFrame<"u"&&j instanceof VideoFrame?(p.width=j.displayWidth,p.height=j.displayHeight):(p.width=j.width,p.height=j.height),p}this.allocateTextureUnit=$,this.resetTextureUnits=ne,this.setTexture2D=ge,this.setTexture2DArray=I,this.setTexture3D=W,this.setTextureCube=ee,this.rebindTextures=on,this.setupRenderTarget=Wt,this.updateRenderTargetMipmap=Ge,this.updateMultisampleRenderTarget=xt,this.setupDepthRenderbuffer=tn,this.setupFrameBufferTexture=lt,this.useMultisampledRTT=Dt,this.isReversedDepthBuffer=function(){return t.buffers.depth.getReversed()}}function VE(s,e){function t(n,i=dl){let o;const l=Bn.getTransfer(i);if(n===Ta)return s.UNSIGNED_BYTE;if(n===Pg)return s.UNSIGNED_SHORT_4_4_4_4;if(n===Gg)return s.UNSIGNED_SHORT_5_5_5_1;if(n===nx)return s.UNSIGNED_INT_5_9_9_9_REV;if(n===ix)return s.UNSIGNED_INT_10F_11F_11F_REV;if(n===Fg)return s.BYTE;if(n===Hg)return s.SHORT;if(n===Zf)return s.UNSIGNED_SHORT;if(n===np)return s.INT;if(n===js)return s.UNSIGNED_INT;if(n===Ci)return s.FLOAT;if(n===ki)return s.HALF_FLOAT;if(n===ax)return s.ALPHA;if(n===sx)return s.RGB;if(n===Zi)return s.RGBA;if(n===Eo)return s.DEPTH_COMPONENT;if(n===cc)return s.DEPTH_STENCIL;if(n===ip)return s.RED;if(n===ap)return s.RED_INTEGER;if(n===xu)return s.RG;if(n===zg)return s.RG_INTEGER;if(n===Vg)return s.RGBA_INTEGER;if(n===sp||n===rp||n===op||n===lp)if(l===si)if(o=e.get("WEBGL_compressed_texture_s3tc_srgb"),o!==null){if(n===sp)return o.COMPRESSED_SRGB_S3TC_DXT1_EXT;if(n===rp)return o.COMPRESSED_SRGB_ALPHA_S3TC_DXT1_EXT;if(n===op)return o.COMPRESSED_SRGB_ALPHA_S3TC_DXT3_EXT;if(n===lp)return o.COMPRESSED_SRGB_ALPHA_S3TC_DXT5_EXT}else return null;else if(o=e.get("WEBGL_compressed_texture_s3tc"),o!==null){if(n===sp)return o.COMPRESSED_RGB_S3TC_DXT1_EXT;if(n===rp)return o.COMPRESSED_RGBA_S3TC_DXT1_EXT;if(n===op)return o.COMPRESSED_RGBA_S3TC_DXT3_EXT;if(n===lp)return o.COMPRESSED_RGBA_S3TC_DXT5_EXT}else return null;if(n===kg||n===Xg||n===Yg||n===Jg)if(o=e.get("WEBGL_compressed_texture_pvrtc"),o!==null){if(n===kg)return o.COMPRESSED_RGB_PVRTC_4BPPV1_IMG;if(n===Xg)return o.COMPRESSED_RGB_PVRTC_2BPPV1_IMG;if(n===Yg)return o.COMPRESSED_RGBA_PVRTC_4BPPV1_IMG;if(n===Jg)return o.COMPRESSED_RGBA_PVRTC_2BPPV1_IMG}else return null;if(n===qg||n===Kg||n===Wg||n===jg||n===Zg||n===Qg||n===$g)if(o=e.get("WEBGL_compressed_texture_etc"),o!==null){if(n===qg||n===Kg)return l===si?o.COMPRESSED_SRGB8_ETC2:o.COMPRESSED_RGB8_ETC2;if(n===Wg)return l===si?o.COMPRESSED_SRGB8_ALPHA8_ETC2_EAC:o.COMPRESSED_RGBA8_ETC2_EAC;if(n===jg)return o.COMPRESSED_R11_EAC;if(n===Zg)return o.COMPRESSED_SIGNED_R11_EAC;if(n===Qg)return o.COMPRESSED_RG11_EAC;if(n===$g)return o.COMPRESSED_SIGNED_RG11_EAC}else return null;if(n===e0||n===t0||n===n0||n===i0||n===a0||n===s0||n===r0||n===o0||n===l0||n===c0||n===u0||n===f0||n===h0||n===d0)if(o=e.get("WEBGL_compressed_texture_astc"),o!==null){if(n===e0)return l===si?o.COMPRESSED_SRGB8_ALPHA8_ASTC_4x4_KHR:o.COMPRESSED_RGBA_ASTC_4x4_KHR;if(n===t0)return l===si?o.COMPRESSED_SRGB8_ALPHA8_ASTC_5x4_KHR:o.COMPRESSED_RGBA_ASTC_5x4_KHR;if(n===n0)return l===si?o.COMPRESSED_SRGB8_ALPHA8_ASTC_5x5_KHR:o.COMPRESSED_RGBA_ASTC_5x5_KHR;if(n===i0)return l===si?o.COMPRESSED_SRGB8_ALPHA8_ASTC_6x5_KHR:o.COMPRESSED_RGBA_ASTC_6x5_KHR;if(n===a0)return l===si?o.COMPRESSED_SRGB8_ALPHA8_ASTC_6x6_KHR:o.COMPRESSED_RGBA_ASTC_6x6_KHR;if(n===s0)return l===si?o.COMPRESSED_SRGB8_ALPHA8_ASTC_8x5_KHR:o.COMPRESSED_RGBA_ASTC_8x5_KHR;if(n===r0)return l===si?o.COMPRESSED_SRGB8_ALPHA8_ASTC_8x6_KHR:o.COMPRESSED_RGBA_ASTC_8x6_KHR;if(n===o0)return l===si?o.COMPRESSED_SRGB8_ALPHA8_ASTC_8x8_KHR:o.COMPRESSED_RGBA_ASTC_8x8_KHR;if(n===l0)return l===si?o.COMPRESSED_SRGB8_ALPHA8_ASTC_10x5_KHR:o.COMPRESSED_RGBA_ASTC_10x5_KHR;if(n===c0)return l===si?o.COMPRESSED_SRGB8_ALPHA8_ASTC_10x6_KHR:o.COMPRESSED_RGBA_ASTC_10x6_KHR;if(n===u0)return l===si?o.COMPRESSED_SRGB8_ALPHA8_ASTC_10x8_KHR:o.COMPRESSED_RGBA_ASTC_10x8_KHR;if(n===f0)return l===si?o.COMPRESSED_SRGB8_ALPHA8_ASTC_10x10_KHR:o.COMPRESSED_RGBA_ASTC_10x10_KHR;if(n===h0)return l===si?o.COMPRESSED_SRGB8_ALPHA8_ASTC_12x10_KHR:o.COMPRESSED_RGBA_ASTC_12x10_KHR;if(n===d0)return l===si?o.COMPRESSED_SRGB8_ALPHA8_ASTC_12x12_KHR:o.COMPRESSED_RGBA_ASTC_12x12_KHR}else return null;if(n===p0||n===m0||n===g0)if(o=e.get("EXT_texture_compression_bptc"),o!==null){if(n===p0)return l===si?o.COMPRESSED_SRGB_ALPHA_BPTC_UNORM_EXT:o.COMPRESSED_RGBA_BPTC_UNORM_EXT;if(n===m0)return o.COMPRESSED_RGB_BPTC_SIGNED_FLOAT_EXT;if(n===g0)return o.COMPRESSED_RGB_BPTC_UNSIGNED_FLOAT_EXT}else return null;if(n===v0||n===_0||n===y0||n===x0)if(o=e.get("EXT_texture_compression_rgtc"),o!==null){if(n===v0)return o.COMPRESSED_RED_RGTC1_EXT;if(n===_0)return o.COMPRESSED_SIGNED_RED_RGTC1_EXT;if(n===y0)return o.COMPRESSED_RED_GREEN_RGTC2_EXT;if(n===x0)return o.COMPRESSED_SIGNED_RED_GREEN_RGTC2_EXT}else return null;return n===Qf?s.UNSIGNED_INT_24_8:s[n]!==void 0?s[n]:null}return{convert:t}}const aL=`
|
|
3995
|
+
}`,QU=[new Z(1,0,0),new Z(-1,0,0),new Z(0,1,0),new Z(0,-1,0),new Z(0,0,1),new Z(0,0,-1)],$U=[new Z(0,-1,0),new Z(0,-1,0),new Z(0,0,1),new Z(0,0,-1),new Z(0,-1,0),new Z(0,-1,0)],zE=new en,qp=new Z,FA=new Z;function eL(s,e,t){let n=new Th;const i=new nt,o=new nt,l=new pi,h=new iA,d=new aA,p={},_=t.maxTextureSize,v={[Yr]:fs,[fs]:Yr,[Ws]:Ws},y=new ms({defines:{VSM_SAMPLES:8},uniforms:{shadow_pass:{value:null},resolution:{value:new nt},radius:{value:4}},vertexShader:jU,fragmentShader:ZU}),x=y.clone();x.defines.HORIZONTAL_PASS=1;const b=new pn;b.setAttribute("position",new Hn(new Float32Array([-1,-1,.5,3,-1,.5,-1,3,.5]),3));const R=new yi(b,y),T=this;this.enabled=!1,this.autoUpdate=!0,this.needsUpdate=!1,this.type=Kf;let M=this.type;this.render=function(O,z,V){if(T.enabled===!1||T.autoUpdate===!1&&T.needsUpdate===!1||O.length===0)return;O.type===Qd&&(Ut("WebGLShadowMap: PCFSoftShadowMap has been deprecated. Using PCFShadowMap instead."),O.type=Kf);const U=s.getRenderTarget(),F=s.getActiveCubeFace(),K=s.getActiveMipmapLevel(),ne=s.state;ne.setBlending(Jr),ne.buffers.depth.getReversed()===!0?ne.buffers.color.setClear(0,0,0,0):ne.buffers.color.setClear(1,1,1,1),ne.buffers.depth.setTest(!0),ne.setScissorTest(!1);const $=M!==this.type;$&&z.traverse(function(ae){ae.material&&(Array.isArray(ae.material)?ae.material.forEach(ge=>ge.needsUpdate=!0):ae.material.needsUpdate=!0)});for(let ae=0,ge=O.length;ae<ge;ae++){const I=O[ae],W=I.shadow;if(W===void 0){Ut("WebGLShadowMap:",I,"has no shadow.");continue}if(W.autoUpdate===!1&&W.needsUpdate===!1)continue;i.copy(W.mapSize);const ee=W.getFrameExtents();if(i.multiply(ee),o.copy(W.mapSize),(i.x>_||i.y>_)&&(i.x>_&&(o.x=Math.floor(_/ee.x),i.x=o.x*ee.x,W.mapSize.x=o.x),i.y>_&&(o.y=Math.floor(_/ee.y),i.y=o.y*ee.y,W.mapSize.y=o.y)),W.map===null||$===!0){if(W.map!==null&&(W.map.depthTexture!==null&&(W.map.depthTexture.dispose(),W.map.depthTexture=null),W.map.dispose()),this.type===mu){if(I.isPointLight){Ut("WebGLShadowMap: VSM shadow maps are not supported for PointLights. Use PCF or BasicShadowMap instead.");continue}W.map=new ds(i.x,i.y,{format:xu,type:ki,minFilter:Cn,magFilter:Cn,generateMipmaps:!1}),W.map.texture.name=I.name+".shadowMap",W.map.depthTexture=new Ch(i.x,i.y,Ci),W.map.depthTexture.name=I.name+".shadowMapDepth",W.map.depthTexture.format=Eo,W.map.depthTexture.compareFunction=null,W.map.depthTexture.minFilter=Ti,W.map.depthTexture.magFilter=Ti}else{I.isPointLight?(W.map=new Y0(i.x),W.map.depthTexture=new c1(i.x,js)):(W.map=new ds(i.x,i.y),W.map.depthTexture=new Ch(i.x,i.y,js)),W.map.depthTexture.name=I.name+".shadowMap",W.map.depthTexture.format=Eo;const _e=s.state.buffers.depth.getReversed();this.type===Kf?(W.map.depthTexture.compareFunction=_e?b0:M0,W.map.depthTexture.minFilter=Cn,W.map.depthTexture.magFilter=Cn):(W.map.depthTexture.compareFunction=null,W.map.depthTexture.minFilter=Ti,W.map.depthTexture.magFilter=Ti)}W.camera.updateProjectionMatrix()}const ye=W.map.isWebGLCubeRenderTarget?6:1;for(let _e=0;_e<ye;_e++){if(W.map.isWebGLCubeRenderTarget)s.setRenderTarget(W.map,_e),s.clear();else{_e===0&&(s.setRenderTarget(W.map),s.clear());const X=W.getViewport(_e);l.set(o.x*X.x,o.y*X.y,o.x*X.z,o.y*X.w),ne.viewport(l)}if(I.isPointLight){const X=W.camera,te=W.matrix,le=I.distance||X.far;le!==X.far&&(X.far=le,X.updateProjectionMatrix()),qp.setFromMatrixPosition(I.matrixWorld),X.position.copy(qp),FA.copy(X.position),FA.add(QU[_e]),X.up.copy($U[_e]),X.lookAt(FA),X.updateMatrixWorld(),te.makeTranslation(-qp.x,-qp.y,-qp.z),zE.multiplyMatrices(X.projectionMatrix,X.matrixWorldInverse),W._frustum.setFromProjectionMatrix(zE,X.coordinateSystem,X.reversedDepth)}else W.updateMatrices(I);n=W.getFrustum(),N(z,V,W.camera,I,this.type)}W.isPointLightShadow!==!0&&this.type===mu&&w(W,V),W.needsUpdate=!1}M=this.type,T.needsUpdate=!1,s.setRenderTarget(U,F,K)};function w(O,z){const V=e.update(R);y.defines.VSM_SAMPLES!==O.blurSamples&&(y.defines.VSM_SAMPLES=O.blurSamples,x.defines.VSM_SAMPLES=O.blurSamples,y.needsUpdate=!0,x.needsUpdate=!0),O.mapPass===null&&(O.mapPass=new ds(i.x,i.y,{format:xu,type:ki})),y.uniforms.shadow_pass.value=O.map.depthTexture,y.uniforms.resolution.value=O.mapSize,y.uniforms.radius.value=O.radius,s.setRenderTarget(O.mapPass),s.clear(),s.renderBufferDirect(z,null,V,y,R,null),x.uniforms.shadow_pass.value=O.mapPass.texture,x.uniforms.resolution.value=O.mapSize,x.uniforms.radius.value=O.radius,s.setRenderTarget(O.map),s.clear(),s.renderBufferDirect(z,null,V,x,R,null)}function D(O,z,V,U){let F=null;const K=V.isPointLight===!0?O.customDistanceMaterial:O.customDepthMaterial;if(K!==void 0)F=K;else if(F=V.isPointLight===!0?d:h,s.localClippingEnabled&&z.clipShadows===!0&&Array.isArray(z.clippingPlanes)&&z.clippingPlanes.length!==0||z.displacementMap&&z.displacementScale!==0||z.alphaMap&&z.alphaTest>0||z.map&&z.alphaTest>0||z.alphaToCoverage===!0){const ne=F.uuid,$=z.uuid;let ae=p[ne];ae===void 0&&(ae={},p[ne]=ae);let ge=ae[$];ge===void 0&&(ge=F.clone(),ae[$]=ge,z.addEventListener("dispose",H)),F=ge}if(F.visible=z.visible,F.wireframe=z.wireframe,U===mu?F.side=z.shadowSide!==null?z.shadowSide:z.side:F.side=z.shadowSide!==null?z.shadowSide:v[z.side],F.alphaMap=z.alphaMap,F.alphaTest=z.alphaToCoverage===!0?.5:z.alphaTest,F.map=z.map,F.clipShadows=z.clipShadows,F.clippingPlanes=z.clippingPlanes,F.clipIntersection=z.clipIntersection,F.displacementMap=z.displacementMap,F.displacementScale=z.displacementScale,F.displacementBias=z.displacementBias,F.wireframeLinewidth=z.wireframeLinewidth,F.linewidth=z.linewidth,V.isPointLight===!0&&F.isMeshDistanceMaterial===!0){const ne=s.properties.get(F);ne.light=V}return F}function N(O,z,V,U,F){if(O.visible===!1)return;if(O.layers.test(z.layers)&&(O.isMesh||O.isLine||O.isPoints)&&(O.castShadow||O.receiveShadow&&F===mu)&&(!O.frustumCulled||n.intersectsObject(O))){O.modelViewMatrix.multiplyMatrices(V.matrixWorldInverse,O.matrixWorld);const $=e.update(O),ae=O.material;if(Array.isArray(ae)){const ge=$.groups;for(let I=0,W=ge.length;I<W;I++){const ee=ge[I],ye=ae[ee.materialIndex];if(ye&&ye.visible){const _e=D(O,ye,U,F);O.onBeforeShadow(s,O,z,V,$,_e,ee),s.renderBufferDirect(V,null,$,_e,O,ee),O.onAfterShadow(s,O,z,V,$,_e,ee)}}}else if(ae.visible){const ge=D(O,ae,U,F);O.onBeforeShadow(s,O,z,V,$,ge,null),s.renderBufferDirect(V,null,$,ge,O,null),O.onAfterShadow(s,O,z,V,$,ge,null)}}const ne=O.children;for(let $=0,ae=ne.length;$<ae;$++)N(ne[$],z,V,U,F)}function H(O){O.target.removeEventListener("dispose",H);for(const V in p){const U=p[V],F=O.target.uuid;F in U&&(U[F].dispose(),delete U[F])}}}const tL={[wg]:Bg,[Dg]:Lg,[Ng]:Og,[vu]:Ug,[Bg]:wg,[Lg]:Dg,[Og]:Ng,[Ug]:vu};function nL(s,e){function t(){let fe=!1;const Ne=new pi;let ot=null;const Et=new pi(0,0,0,0);return{setMask:function(Qe){ot!==Qe&&!fe&&(s.colorMask(Qe,Qe,Qe,Qe),ot=Qe)},setLocked:function(Qe){fe=Qe},setClear:function(Qe,We,_t,nn,wn){wn===!0&&(Qe*=nn,We*=nn,_t*=nn),Ne.set(Qe,We,_t,nn),Et.equals(Ne)===!1&&(s.clearColor(Qe,We,_t,nn),Et.copy(Ne))},reset:function(){fe=!1,ot=null,Et.set(-1,0,0,0)}}}function n(){let fe=!1,Ne=!1,ot=null,Et=null,Qe=null;return{setReversed:function(We){if(Ne!==We){const _t=e.get("EXT_clip_control");We?_t.clipControlEXT(_t.LOWER_LEFT_EXT,_t.ZERO_TO_ONE_EXT):_t.clipControlEXT(_t.LOWER_LEFT_EXT,_t.NEGATIVE_ONE_TO_ONE_EXT),Ne=We;const nn=Qe;Qe=null,this.setClear(nn)}},getReversed:function(){return Ne},setTest:function(We){We?Ee(s.DEPTH_TEST):lt(s.DEPTH_TEST)},setMask:function(We){ot!==We&&!fe&&(s.depthMask(We),ot=We)},setFunc:function(We){if(Ne&&(We=tL[We]),Et!==We){switch(We){case wg:s.depthFunc(s.NEVER);break;case Bg:s.depthFunc(s.ALWAYS);break;case Dg:s.depthFunc(s.LESS);break;case vu:s.depthFunc(s.LEQUAL);break;case Ng:s.depthFunc(s.EQUAL);break;case Ug:s.depthFunc(s.GEQUAL);break;case Lg:s.depthFunc(s.GREATER);break;case Og:s.depthFunc(s.NOTEQUAL);break;default:s.depthFunc(s.LEQUAL)}Et=We}},setLocked:function(We){fe=We},setClear:function(We){Qe!==We&&(Ne&&(We=1-We),s.clearDepth(We),Qe=We)},reset:function(){fe=!1,ot=null,Et=null,Qe=null,Ne=!1}}}function i(){let fe=!1,Ne=null,ot=null,Et=null,Qe=null,We=null,_t=null,nn=null,wn=null;return{setTest:function(Mn){fe||(Mn?Ee(s.STENCIL_TEST):lt(s.STENCIL_TEST))},setMask:function(Mn){Ne!==Mn&&!fe&&(s.stencilMask(Mn),Ne=Mn)},setFunc:function(Mn,Fi,va){(ot!==Mn||Et!==Fi||Qe!==va)&&(s.stencilFunc(Mn,Fi,va),ot=Mn,Et=Fi,Qe=va)},setOp:function(Mn,Fi,va){(We!==Mn||_t!==Fi||nn!==va)&&(s.stencilOp(Mn,Fi,va),We=Mn,_t=Fi,nn=va)},setLocked:function(Mn){fe=Mn},setClear:function(Mn){wn!==Mn&&(s.clearStencil(Mn),wn=Mn)},reset:function(){fe=!1,Ne=null,ot=null,Et=null,Qe=null,We=null,_t=null,nn=null,wn=null}}}const o=new t,l=new n,h=new i,d=new WeakMap,p=new WeakMap;let _={},v={},y=new WeakMap,x=[],b=null,R=!1,T=null,M=null,w=null,D=null,N=null,H=null,O=null,z=new Ct(0,0,0),V=0,U=!1,F=null,K=null,ne=null,$=null,ae=null;const ge=s.getParameter(s.MAX_COMBINED_TEXTURE_IMAGE_UNITS);let I=!1,W=0;const ee=s.getParameter(s.VERSION);ee.indexOf("WebGL")!==-1?(W=parseFloat(/^WebGL (\d)/.exec(ee)[1]),I=W>=1):ee.indexOf("OpenGL ES")!==-1&&(W=parseFloat(/^OpenGL ES (\d)/.exec(ee)[1]),I=W>=2);let ye=null,_e={};const X=s.getParameter(s.SCISSOR_BOX),te=s.getParameter(s.VIEWPORT),le=new pi().fromArray(X),ve=new pi().fromArray(te);function ze(fe,Ne,ot,Et){const Qe=new Uint8Array(4),We=s.createTexture();s.bindTexture(fe,We),s.texParameteri(fe,s.TEXTURE_MIN_FILTER,s.NEAREST),s.texParameteri(fe,s.TEXTURE_MAG_FILTER,s.NEAREST);for(let _t=0;_t<ot;_t++)fe===s.TEXTURE_3D||fe===s.TEXTURE_2D_ARRAY?s.texImage3D(Ne,0,s.RGBA,1,1,Et,0,s.RGBA,s.UNSIGNED_BYTE,Qe):s.texImage2D(Ne+_t,0,s.RGBA,1,1,0,s.RGBA,s.UNSIGNED_BYTE,Qe);return We}const he={};he[s.TEXTURE_2D]=ze(s.TEXTURE_2D,s.TEXTURE_2D,1),he[s.TEXTURE_CUBE_MAP]=ze(s.TEXTURE_CUBE_MAP,s.TEXTURE_CUBE_MAP_POSITIVE_X,6),he[s.TEXTURE_2D_ARRAY]=ze(s.TEXTURE_2D_ARRAY,s.TEXTURE_2D_ARRAY,1,1),he[s.TEXTURE_3D]=ze(s.TEXTURE_3D,s.TEXTURE_3D,1,1),o.setClear(0,0,0,1),l.setClear(1),h.setClear(0),Ee(s.DEPTH_TEST),l.setFunc(vu),Je(!1),xt(Xy),Ee(s.CULL_FACE),Ge(Jr);function Ee(fe){_[fe]!==!0&&(s.enable(fe),_[fe]=!0)}function lt(fe){_[fe]!==!1&&(s.disable(fe),_[fe]=!1)}function Rt(fe,Ne){return v[fe]!==Ne?(s.bindFramebuffer(fe,Ne),v[fe]=Ne,fe===s.DRAW_FRAMEBUFFER&&(v[s.FRAMEBUFFER]=Ne),fe===s.FRAMEBUFFER&&(v[s.DRAW_FRAMEBUFFER]=Ne),!0):!1}function Bt(fe,Ne){let ot=x,Et=!1;if(fe){ot=y.get(Ne),ot===void 0&&(ot=[],y.set(Ne,ot));const Qe=fe.textures;if(ot.length!==Qe.length||ot[0]!==s.COLOR_ATTACHMENT0){for(let We=0,_t=Qe.length;We<_t;We++)ot[We]=s.COLOR_ATTACHMENT0+We;ot.length=Qe.length,Et=!0}}else ot[0]!==s.BACK&&(ot[0]=s.BACK,Et=!0);Et&&s.drawBuffers(ot)}function tn(fe){return b!==fe?(s.useProgram(fe),b=fe,!0):!1}const on={[sc]:s.FUNC_ADD,[FM]:s.FUNC_SUBTRACT,[HM]:s.FUNC_REVERSE_SUBTRACT};on[PM]=s.MIN,on[GM]=s.MAX;const Wt={[zM]:s.ZERO,[VM]:s.ONE,[kM]:s.SRC_COLOR,[Cg]:s.SRC_ALPHA,[WM]:s.SRC_ALPHA_SATURATE,[qM]:s.DST_COLOR,[YM]:s.DST_ALPHA,[XM]:s.ONE_MINUS_SRC_COLOR,[Rg]:s.ONE_MINUS_SRC_ALPHA,[KM]:s.ONE_MINUS_DST_COLOR,[JM]:s.ONE_MINUS_DST_ALPHA,[jM]:s.CONSTANT_COLOR,[ZM]:s.ONE_MINUS_CONSTANT_COLOR,[QM]:s.CONSTANT_ALPHA,[$M]:s.ONE_MINUS_CONSTANT_ALPHA};function Ge(fe,Ne,ot,Et,Qe,We,_t,nn,wn,Mn){if(fe===Jr){R===!0&&(lt(s.BLEND),R=!1);return}if(R===!1&&(Ee(s.BLEND),R=!0),fe!==IM){if(fe!==T||Mn!==U){if((M!==sc||N!==sc)&&(s.blendEquation(s.FUNC_ADD),M=sc,N=sc),Mn)switch(fe){case gu:s.blendFuncSeparate(s.ONE,s.ONE_MINUS_SRC_ALPHA,s.ONE,s.ONE_MINUS_SRC_ALPHA);break;case Yy:s.blendFunc(s.ONE,s.ONE);break;case Jy:s.blendFuncSeparate(s.ZERO,s.ONE_MINUS_SRC_COLOR,s.ZERO,s.ONE);break;case qy:s.blendFuncSeparate(s.DST_COLOR,s.ONE_MINUS_SRC_ALPHA,s.ZERO,s.ONE);break;default:Zt("WebGLState: Invalid blending: ",fe);break}else switch(fe){case gu:s.blendFuncSeparate(s.SRC_ALPHA,s.ONE_MINUS_SRC_ALPHA,s.ONE,s.ONE_MINUS_SRC_ALPHA);break;case Yy:s.blendFuncSeparate(s.SRC_ALPHA,s.ONE,s.ONE,s.ONE);break;case Jy:Zt("WebGLState: SubtractiveBlending requires material.premultipliedAlpha = true");break;case qy:Zt("WebGLState: MultiplyBlending requires material.premultipliedAlpha = true");break;default:Zt("WebGLState: Invalid blending: ",fe);break}w=null,D=null,H=null,O=null,z.set(0,0,0),V=0,T=fe,U=Mn}return}Qe=Qe||Ne,We=We||ot,_t=_t||Et,(Ne!==M||Qe!==N)&&(s.blendEquationSeparate(on[Ne],on[Qe]),M=Ne,N=Qe),(ot!==w||Et!==D||We!==H||_t!==O)&&(s.blendFuncSeparate(Wt[ot],Wt[Et],Wt[We],Wt[_t]),w=ot,D=Et,H=We,O=_t),(nn.equals(z)===!1||wn!==V)&&(s.blendColor(nn.r,nn.g,nn.b,wn),z.copy(nn),V=wn),T=fe,U=!1}function et(fe,Ne){fe.side===Ws?lt(s.CULL_FACE):Ee(s.CULL_FACE);let ot=fe.side===fs;Ne&&(ot=!ot),Je(ot),fe.blending===gu&&fe.transparent===!1?Ge(Jr):Ge(fe.blending,fe.blendEquation,fe.blendSrc,fe.blendDst,fe.blendEquationAlpha,fe.blendSrcAlpha,fe.blendDstAlpha,fe.blendColor,fe.blendAlpha,fe.premultipliedAlpha),l.setFunc(fe.depthFunc),l.setTest(fe.depthTest),l.setMask(fe.depthWrite),o.setMask(fe.colorWrite);const Et=fe.stencilWrite;h.setTest(Et),Et&&(h.setMask(fe.stencilWriteMask),h.setFunc(fe.stencilFunc,fe.stencilRef,fe.stencilFuncMask),h.setOp(fe.stencilFail,fe.stencilZFail,fe.stencilZPass)),Dt(fe.polygonOffset,fe.polygonOffsetFactor,fe.polygonOffsetUnits),fe.alphaToCoverage===!0?Ee(s.SAMPLE_ALPHA_TO_COVERAGE):lt(s.SAMPLE_ALPHA_TO_COVERAGE)}function Je(fe){F!==fe&&(fe?s.frontFace(s.CW):s.frontFace(s.CCW),F=fe)}function xt(fe){fe!==UM?(Ee(s.CULL_FACE),fe!==K&&(fe===Xy?s.cullFace(s.BACK):fe===LM?s.cullFace(s.FRONT):s.cullFace(s.FRONT_AND_BACK))):lt(s.CULL_FACE),K=fe}function Q(fe){fe!==ne&&(I&&s.lineWidth(fe),ne=fe)}function Dt(fe,Ne,ot){fe?(Ee(s.POLYGON_OFFSET_FILL),($!==Ne||ae!==ot)&&(s.polygonOffset(Ne,ot),$=Ne,ae=ot)):lt(s.POLYGON_OFFSET_FILL)}function mt(fe){fe?Ee(s.SCISSOR_TEST):lt(s.SCISSOR_TEST)}function Lt(fe){fe===void 0&&(fe=s.TEXTURE0+ge-1),ye!==fe&&(s.activeTexture(fe),ye=fe)}function gt(fe,Ne,ot){ot===void 0&&(ye===null?ot=s.TEXTURE0+ge-1:ot=ye);let Et=_e[ot];Et===void 0&&(Et={type:void 0,texture:void 0},_e[ot]=Et),(Et.type!==fe||Et.texture!==Ne)&&(ye!==ot&&(s.activeTexture(ot),ye=ot),s.bindTexture(fe,Ne||he[fe]),Et.type=fe,Et.texture=Ne)}function j(){const fe=_e[ye];fe!==void 0&&fe.type!==void 0&&(s.bindTexture(fe.type,null),fe.type=void 0,fe.texture=void 0)}function P(){try{s.compressedTexImage2D(...arguments)}catch(fe){Zt("WebGLState:",fe)}}function de(){try{s.compressedTexImage3D(...arguments)}catch(fe){Zt("WebGLState:",fe)}}function Fe(){try{s.texSubImage2D(...arguments)}catch(fe){Zt("WebGLState:",fe)}}function ke(){try{s.texSubImage3D(...arguments)}catch(fe){Zt("WebGLState:",fe)}}function Ie(){try{s.compressedTexSubImage2D(...arguments)}catch(fe){Zt("WebGLState:",fe)}}function Ft(){try{s.compressedTexSubImage3D(...arguments)}catch(fe){Zt("WebGLState:",fe)}}function Mt(){try{s.texStorage2D(...arguments)}catch(fe){Zt("WebGLState:",fe)}}function Ht(){try{s.texStorage3D(...arguments)}catch(fe){Zt("WebGLState:",fe)}}function zt(){try{s.texImage2D(...arguments)}catch(fe){Zt("WebGLState:",fe)}}function Ye(){try{s.texImage3D(...arguments)}catch(fe){Zt("WebGLState:",fe)}}function qe(fe){le.equals(fe)===!1&&(s.scissor(fe.x,fe.y,fe.z,fe.w),le.copy(fe))}function wt(fe){ve.equals(fe)===!1&&(s.viewport(fe.x,fe.y,fe.z,fe.w),ve.copy(fe))}function bt(fe,Ne){let ot=p.get(Ne);ot===void 0&&(ot=new WeakMap,p.set(Ne,ot));let Et=ot.get(fe);Et===void 0&&(Et=s.getUniformBlockIndex(Ne,fe.name),ot.set(fe,Et))}function rt(fe,Ne){const Et=p.get(Ne).get(fe);d.get(Ne)!==Et&&(s.uniformBlockBinding(Ne,Et,fe.__bindingPointIndex),d.set(Ne,Et))}function Vt(){s.disable(s.BLEND),s.disable(s.CULL_FACE),s.disable(s.DEPTH_TEST),s.disable(s.POLYGON_OFFSET_FILL),s.disable(s.SCISSOR_TEST),s.disable(s.STENCIL_TEST),s.disable(s.SAMPLE_ALPHA_TO_COVERAGE),s.blendEquation(s.FUNC_ADD),s.blendFunc(s.ONE,s.ZERO),s.blendFuncSeparate(s.ONE,s.ZERO,s.ONE,s.ZERO),s.blendColor(0,0,0,0),s.colorMask(!0,!0,!0,!0),s.clearColor(0,0,0,0),s.depthMask(!0),s.depthFunc(s.LESS),l.setReversed(!1),s.clearDepth(1),s.stencilMask(4294967295),s.stencilFunc(s.ALWAYS,0,4294967295),s.stencilOp(s.KEEP,s.KEEP,s.KEEP),s.clearStencil(0),s.cullFace(s.BACK),s.frontFace(s.CCW),s.polygonOffset(0,0),s.activeTexture(s.TEXTURE0),s.bindFramebuffer(s.FRAMEBUFFER,null),s.bindFramebuffer(s.DRAW_FRAMEBUFFER,null),s.bindFramebuffer(s.READ_FRAMEBUFFER,null),s.useProgram(null),s.lineWidth(1),s.scissor(0,0,s.canvas.width,s.canvas.height),s.viewport(0,0,s.canvas.width,s.canvas.height),_={},ye=null,_e={},v={},y=new WeakMap,x=[],b=null,R=!1,T=null,M=null,w=null,D=null,N=null,H=null,O=null,z=new Ct(0,0,0),V=0,U=!1,F=null,K=null,ne=null,$=null,ae=null,le.set(0,0,s.canvas.width,s.canvas.height),ve.set(0,0,s.canvas.width,s.canvas.height),o.reset(),l.reset(),h.reset()}return{buffers:{color:o,depth:l,stencil:h},enable:Ee,disable:lt,bindFramebuffer:Rt,drawBuffers:Bt,useProgram:tn,setBlending:Ge,setMaterial:et,setFlipSided:Je,setCullFace:xt,setLineWidth:Q,setPolygonOffset:Dt,setScissorTest:mt,activeTexture:Lt,bindTexture:gt,unbindTexture:j,compressedTexImage2D:P,compressedTexImage3D:de,texImage2D:zt,texImage3D:Ye,updateUBOMapping:bt,uniformBlockBinding:rt,texStorage2D:Mt,texStorage3D:Ht,texSubImage2D:Fe,texSubImage3D:ke,compressedTexSubImage2D:Ie,compressedTexSubImage3D:Ft,scissor:qe,viewport:wt,reset:Vt}}function iL(s,e,t,n,i,o,l){const h=e.has("WEBGL_multisampled_render_to_texture")?e.get("WEBGL_multisampled_render_to_texture"):null,d=typeof navigator>"u"?!1:/OculusBrowser/g.test(navigator.userAgent),p=new nt,_=new WeakMap;let v;const y=new WeakMap;let x=!1;try{x=typeof OffscreenCanvas<"u"&&new OffscreenCanvas(1,1).getContext("2d")!==null}catch{}function b(j,P){return x?new OffscreenCanvas(j,P):pp("canvas")}function R(j,P,de){let Fe=1;const ke=gt(j);if((ke.width>de||ke.height>de)&&(Fe=de/Math.max(ke.width,ke.height)),Fe<1)if(typeof HTMLImageElement<"u"&&j instanceof HTMLImageElement||typeof HTMLCanvasElement<"u"&&j instanceof HTMLCanvasElement||typeof ImageBitmap<"u"&&j instanceof ImageBitmap||typeof VideoFrame<"u"&&j instanceof VideoFrame){const Ie=Math.floor(Fe*ke.width),Ft=Math.floor(Fe*ke.height);v===void 0&&(v=b(Ie,Ft));const Mt=P?b(Ie,Ft):v;return Mt.width=Ie,Mt.height=Ft,Mt.getContext("2d").drawImage(j,0,0,Ie,Ft),Ut("WebGLRenderer: Texture has been resized from ("+ke.width+"x"+ke.height+") to ("+Ie+"x"+Ft+")."),Mt}else return"data"in j&&Ut("WebGLRenderer: Image in DataTexture is too big ("+ke.width+"x"+ke.height+")."),j;return j}function T(j){return j.generateMipmaps}function M(j){s.generateMipmap(j)}function w(j){return j.isWebGLCubeRenderTarget?s.TEXTURE_CUBE_MAP:j.isWebGL3DRenderTarget?s.TEXTURE_3D:j.isWebGLArrayRenderTarget||j.isCompressedArrayTexture?s.TEXTURE_2D_ARRAY:s.TEXTURE_2D}function D(j,P,de,Fe,ke=!1){if(j!==null){if(s[j]!==void 0)return s[j];Ut("WebGLRenderer: Attempt to use non-existing WebGL internal format '"+j+"'")}let Ie=P;if(P===s.RED&&(de===s.FLOAT&&(Ie=s.R32F),de===s.HALF_FLOAT&&(Ie=s.R16F),de===s.UNSIGNED_BYTE&&(Ie=s.R8)),P===s.RED_INTEGER&&(de===s.UNSIGNED_BYTE&&(Ie=s.R8UI),de===s.UNSIGNED_SHORT&&(Ie=s.R16UI),de===s.UNSIGNED_INT&&(Ie=s.R32UI),de===s.BYTE&&(Ie=s.R8I),de===s.SHORT&&(Ie=s.R16I),de===s.INT&&(Ie=s.R32I)),P===s.RG&&(de===s.FLOAT&&(Ie=s.RG32F),de===s.HALF_FLOAT&&(Ie=s.RG16F),de===s.UNSIGNED_BYTE&&(Ie=s.RG8)),P===s.RG_INTEGER&&(de===s.UNSIGNED_BYTE&&(Ie=s.RG8UI),de===s.UNSIGNED_SHORT&&(Ie=s.RG16UI),de===s.UNSIGNED_INT&&(Ie=s.RG32UI),de===s.BYTE&&(Ie=s.RG8I),de===s.SHORT&&(Ie=s.RG16I),de===s.INT&&(Ie=s.RG32I)),P===s.RGB_INTEGER&&(de===s.UNSIGNED_BYTE&&(Ie=s.RGB8UI),de===s.UNSIGNED_SHORT&&(Ie=s.RGB16UI),de===s.UNSIGNED_INT&&(Ie=s.RGB32UI),de===s.BYTE&&(Ie=s.RGB8I),de===s.SHORT&&(Ie=s.RGB16I),de===s.INT&&(Ie=s.RGB32I)),P===s.RGBA_INTEGER&&(de===s.UNSIGNED_BYTE&&(Ie=s.RGBA8UI),de===s.UNSIGNED_SHORT&&(Ie=s.RGBA16UI),de===s.UNSIGNED_INT&&(Ie=s.RGBA32UI),de===s.BYTE&&(Ie=s.RGBA8I),de===s.SHORT&&(Ie=s.RGBA16I),de===s.INT&&(Ie=s.RGBA32I)),P===s.RGB&&(de===s.UNSIGNED_INT_5_9_9_9_REV&&(Ie=s.RGB9_E5),de===s.UNSIGNED_INT_10F_11F_11F_REV&&(Ie=s.R11F_G11F_B10F)),P===s.RGBA){const Ft=ke?hp:Bn.getTransfer(Fe);de===s.FLOAT&&(Ie=s.RGBA32F),de===s.HALF_FLOAT&&(Ie=s.RGBA16F),de===s.UNSIGNED_BYTE&&(Ie=Ft===si?s.SRGB8_ALPHA8:s.RGBA8),de===s.UNSIGNED_SHORT_4_4_4_4&&(Ie=s.RGBA4),de===s.UNSIGNED_SHORT_5_5_5_1&&(Ie=s.RGB5_A1)}return(Ie===s.R16F||Ie===s.R32F||Ie===s.RG16F||Ie===s.RG32F||Ie===s.RGBA16F||Ie===s.RGBA32F)&&e.get("EXT_color_buffer_float"),Ie}function N(j,P){let de;return j?P===null||P===js||P===Qf?de=s.DEPTH24_STENCIL8:P===Ci?de=s.DEPTH32F_STENCIL8:P===Zf&&(de=s.DEPTH24_STENCIL8,Ut("DepthTexture: 16 bit depth attachment is not supported with stencil. Using 24-bit attachment.")):P===null||P===js||P===Qf?de=s.DEPTH_COMPONENT24:P===Ci?de=s.DEPTH_COMPONENT32F:P===Zf&&(de=s.DEPTH_COMPONENT16),de}function H(j,P){return T(j)===!0||j.isFramebufferTexture&&j.minFilter!==Ti&&j.minFilter!==Cn?Math.log2(Math.max(P.width,P.height))+1:j.mipmaps!==void 0&&j.mipmaps.length>0?j.mipmaps.length:j.isCompressedTexture&&Array.isArray(j.image)?P.mipmaps.length:1}function O(j){const P=j.target;P.removeEventListener("dispose",O),V(P),P.isVideoTexture&&_.delete(P)}function z(j){const P=j.target;P.removeEventListener("dispose",z),F(P)}function V(j){const P=n.get(j);if(P.__webglInit===void 0)return;const de=j.source,Fe=y.get(de);if(Fe){const ke=Fe[P.__cacheKey];ke.usedTimes--,ke.usedTimes===0&&U(j),Object.keys(Fe).length===0&&y.delete(de)}n.remove(j)}function U(j){const P=n.get(j);s.deleteTexture(P.__webglTexture);const de=j.source,Fe=y.get(de);delete Fe[P.__cacheKey],l.memory.textures--}function F(j){const P=n.get(j);if(j.depthTexture&&(j.depthTexture.dispose(),n.remove(j.depthTexture)),j.isWebGLCubeRenderTarget)for(let Fe=0;Fe<6;Fe++){if(Array.isArray(P.__webglFramebuffer[Fe]))for(let ke=0;ke<P.__webglFramebuffer[Fe].length;ke++)s.deleteFramebuffer(P.__webglFramebuffer[Fe][ke]);else s.deleteFramebuffer(P.__webglFramebuffer[Fe]);P.__webglDepthbuffer&&s.deleteRenderbuffer(P.__webglDepthbuffer[Fe])}else{if(Array.isArray(P.__webglFramebuffer))for(let Fe=0;Fe<P.__webglFramebuffer.length;Fe++)s.deleteFramebuffer(P.__webglFramebuffer[Fe]);else s.deleteFramebuffer(P.__webglFramebuffer);if(P.__webglDepthbuffer&&s.deleteRenderbuffer(P.__webglDepthbuffer),P.__webglMultisampledFramebuffer&&s.deleteFramebuffer(P.__webglMultisampledFramebuffer),P.__webglColorRenderbuffer)for(let Fe=0;Fe<P.__webglColorRenderbuffer.length;Fe++)P.__webglColorRenderbuffer[Fe]&&s.deleteRenderbuffer(P.__webglColorRenderbuffer[Fe]);P.__webglDepthRenderbuffer&&s.deleteRenderbuffer(P.__webglDepthRenderbuffer)}const de=j.textures;for(let Fe=0,ke=de.length;Fe<ke;Fe++){const Ie=n.get(de[Fe]);Ie.__webglTexture&&(s.deleteTexture(Ie.__webglTexture),l.memory.textures--),n.remove(de[Fe])}n.remove(j)}let K=0;function ne(){K=0}function $(){const j=K;return j>=i.maxTextures&&Ut("WebGLTextures: Trying to use "+j+" texture units while this GPU supports only "+i.maxTextures),K+=1,j}function ae(j){const P=[];return P.push(j.wrapS),P.push(j.wrapT),P.push(j.wrapR||0),P.push(j.magFilter),P.push(j.minFilter),P.push(j.anisotropy),P.push(j.internalFormat),P.push(j.format),P.push(j.type),P.push(j.generateMipmaps),P.push(j.premultiplyAlpha),P.push(j.flipY),P.push(j.unpackAlignment),P.push(j.colorSpace),P.join()}function ge(j,P){const de=n.get(j);if(j.isVideoTexture&&mt(j),j.isRenderTargetTexture===!1&&j.isExternalTexture!==!0&&j.version>0&&de.__version!==j.version){const Fe=j.image;if(Fe===null)Ut("WebGLRenderer: Texture marked for update but no image data found.");else if(Fe.complete===!1)Ut("WebGLRenderer: Texture marked for update but image is incomplete");else{he(de,j,P);return}}else j.isExternalTexture&&(de.__webglTexture=j.sourceTexture?j.sourceTexture:null);t.bindTexture(s.TEXTURE_2D,de.__webglTexture,s.TEXTURE0+P)}function I(j,P){const de=n.get(j);if(j.isRenderTargetTexture===!1&&j.version>0&&de.__version!==j.version){he(de,j,P);return}else j.isExternalTexture&&(de.__webglTexture=j.sourceTexture?j.sourceTexture:null);t.bindTexture(s.TEXTURE_2D_ARRAY,de.__webglTexture,s.TEXTURE0+P)}function W(j,P){const de=n.get(j);if(j.isRenderTargetTexture===!1&&j.version>0&&de.__version!==j.version){he(de,j,P);return}t.bindTexture(s.TEXTURE_3D,de.__webglTexture,s.TEXTURE0+P)}function ee(j,P){const de=n.get(j);if(j.isCubeDepthTexture!==!0&&j.version>0&&de.__version!==j.version){Ee(de,j,P);return}t.bindTexture(s.TEXTURE_CUBE_MAP,de.__webglTexture,s.TEXTURE0+P)}const ye={[Kr]:s.REPEAT,[Ei]:s.CLAMP_TO_EDGE,[_u]:s.MIRRORED_REPEAT},_e={[Ti]:s.NEAREST,[tp]:s.NEAREST_MIPMAP_NEAREST,[lc]:s.NEAREST_MIPMAP_LINEAR,[Cn]:s.LINEAR,[yu]:s.LINEAR_MIPMAP_NEAREST,[Is]:s.LINEAR_MIPMAP_LINEAR},X={[ob]:s.NEVER,[hb]:s.ALWAYS,[lb]:s.LESS,[M0]:s.LEQUAL,[cb]:s.EQUAL,[b0]:s.GEQUAL,[ub]:s.GREATER,[fb]:s.NOTEQUAL};function te(j,P){if(P.type===Ci&&e.has("OES_texture_float_linear")===!1&&(P.magFilter===Cn||P.magFilter===yu||P.magFilter===lc||P.magFilter===Is||P.minFilter===Cn||P.minFilter===yu||P.minFilter===lc||P.minFilter===Is)&&Ut("WebGLRenderer: Unable to use linear filtering with floating point textures. OES_texture_float_linear not supported on this device."),s.texParameteri(j,s.TEXTURE_WRAP_S,ye[P.wrapS]),s.texParameteri(j,s.TEXTURE_WRAP_T,ye[P.wrapT]),(j===s.TEXTURE_3D||j===s.TEXTURE_2D_ARRAY)&&s.texParameteri(j,s.TEXTURE_WRAP_R,ye[P.wrapR]),s.texParameteri(j,s.TEXTURE_MAG_FILTER,_e[P.magFilter]),s.texParameteri(j,s.TEXTURE_MIN_FILTER,_e[P.minFilter]),P.compareFunction&&(s.texParameteri(j,s.TEXTURE_COMPARE_MODE,s.COMPARE_REF_TO_TEXTURE),s.texParameteri(j,s.TEXTURE_COMPARE_FUNC,X[P.compareFunction])),e.has("EXT_texture_filter_anisotropic")===!0){if(P.magFilter===Ti||P.minFilter!==lc&&P.minFilter!==Is||P.type===Ci&&e.has("OES_texture_float_linear")===!1)return;if(P.anisotropy>1||n.get(P).__currentAnisotropy){const de=e.get("EXT_texture_filter_anisotropic");s.texParameterf(j,de.TEXTURE_MAX_ANISOTROPY_EXT,Math.min(P.anisotropy,i.getMaxAnisotropy())),n.get(P).__currentAnisotropy=P.anisotropy}}}function le(j,P){let de=!1;j.__webglInit===void 0&&(j.__webglInit=!0,P.addEventListener("dispose",O));const Fe=P.source;let ke=y.get(Fe);ke===void 0&&(ke={},y.set(Fe,ke));const Ie=ae(P);if(Ie!==j.__cacheKey){ke[Ie]===void 0&&(ke[Ie]={texture:s.createTexture(),usedTimes:0},l.memory.textures++,de=!0),ke[Ie].usedTimes++;const Ft=ke[j.__cacheKey];Ft!==void 0&&(ke[j.__cacheKey].usedTimes--,Ft.usedTimes===0&&U(P)),j.__cacheKey=Ie,j.__webglTexture=ke[Ie].texture}return de}function ve(j,P,de){return Math.floor(Math.floor(j/de)/P)}function ze(j,P,de,Fe){const Ie=j.updateRanges;if(Ie.length===0)t.texSubImage2D(s.TEXTURE_2D,0,0,0,P.width,P.height,de,Fe,P.data);else{Ie.sort((Ye,qe)=>Ye.start-qe.start);let Ft=0;for(let Ye=1;Ye<Ie.length;Ye++){const qe=Ie[Ft],wt=Ie[Ye],bt=qe.start+qe.count,rt=ve(wt.start,P.width,4),Vt=ve(qe.start,P.width,4);wt.start<=bt+1&&rt===Vt&&ve(wt.start+wt.count-1,P.width,4)===rt?qe.count=Math.max(qe.count,wt.start+wt.count-qe.start):(++Ft,Ie[Ft]=wt)}Ie.length=Ft+1;const Mt=s.getParameter(s.UNPACK_ROW_LENGTH),Ht=s.getParameter(s.UNPACK_SKIP_PIXELS),zt=s.getParameter(s.UNPACK_SKIP_ROWS);s.pixelStorei(s.UNPACK_ROW_LENGTH,P.width);for(let Ye=0,qe=Ie.length;Ye<qe;Ye++){const wt=Ie[Ye],bt=Math.floor(wt.start/4),rt=Math.ceil(wt.count/4),Vt=bt%P.width,fe=Math.floor(bt/P.width),Ne=rt,ot=1;s.pixelStorei(s.UNPACK_SKIP_PIXELS,Vt),s.pixelStorei(s.UNPACK_SKIP_ROWS,fe),t.texSubImage2D(s.TEXTURE_2D,0,Vt,fe,Ne,ot,de,Fe,P.data)}j.clearUpdateRanges(),s.pixelStorei(s.UNPACK_ROW_LENGTH,Mt),s.pixelStorei(s.UNPACK_SKIP_PIXELS,Ht),s.pixelStorei(s.UNPACK_SKIP_ROWS,zt)}}function he(j,P,de){let Fe=s.TEXTURE_2D;(P.isDataArrayTexture||P.isCompressedArrayTexture)&&(Fe=s.TEXTURE_2D_ARRAY),P.isData3DTexture&&(Fe=s.TEXTURE_3D);const ke=le(j,P),Ie=P.source;t.bindTexture(Fe,j.__webglTexture,s.TEXTURE0+de);const Ft=n.get(Ie);if(Ie.version!==Ft.__version||ke===!0){t.activeTexture(s.TEXTURE0+de);const Mt=Bn.getPrimaries(Bn.workingColorSpace),Ht=P.colorSpace===dl?null:Bn.getPrimaries(P.colorSpace),zt=P.colorSpace===dl||Mt===Ht?s.NONE:s.BROWSER_DEFAULT_WEBGL;s.pixelStorei(s.UNPACK_FLIP_Y_WEBGL,P.flipY),s.pixelStorei(s.UNPACK_PREMULTIPLY_ALPHA_WEBGL,P.premultiplyAlpha),s.pixelStorei(s.UNPACK_ALIGNMENT,P.unpackAlignment),s.pixelStorei(s.UNPACK_COLORSPACE_CONVERSION_WEBGL,zt);let Ye=R(P.image,!1,i.maxTextureSize);Ye=Lt(P,Ye);const qe=o.convert(P.format,P.colorSpace),wt=o.convert(P.type);let bt=D(P.internalFormat,qe,wt,P.colorSpace,P.isVideoTexture);te(Fe,P);let rt;const Vt=P.mipmaps,fe=P.isVideoTexture!==!0,Ne=Ft.__version===void 0||ke===!0,ot=Ie.dataReady,Et=H(P,Ye);if(P.isDepthTexture)bt=N(P.format===cc,P.type),Ne&&(fe?t.texStorage2D(s.TEXTURE_2D,1,bt,Ye.width,Ye.height):t.texImage2D(s.TEXTURE_2D,0,bt,Ye.width,Ye.height,0,qe,wt,null));else if(P.isDataTexture)if(Vt.length>0){fe&&Ne&&t.texStorage2D(s.TEXTURE_2D,Et,bt,Vt[0].width,Vt[0].height);for(let Qe=0,We=Vt.length;Qe<We;Qe++)rt=Vt[Qe],fe?ot&&t.texSubImage2D(s.TEXTURE_2D,Qe,0,0,rt.width,rt.height,qe,wt,rt.data):t.texImage2D(s.TEXTURE_2D,Qe,bt,rt.width,rt.height,0,qe,wt,rt.data);P.generateMipmaps=!1}else fe?(Ne&&t.texStorage2D(s.TEXTURE_2D,Et,bt,Ye.width,Ye.height),ot&&ze(P,Ye,qe,wt)):t.texImage2D(s.TEXTURE_2D,0,bt,Ye.width,Ye.height,0,qe,wt,Ye.data);else if(P.isCompressedTexture)if(P.isCompressedArrayTexture){fe&&Ne&&t.texStorage3D(s.TEXTURE_2D_ARRAY,Et,bt,Vt[0].width,Vt[0].height,Ye.depth);for(let Qe=0,We=Vt.length;Qe<We;Qe++)if(rt=Vt[Qe],P.format!==Zi)if(qe!==null)if(fe){if(ot)if(P.layerUpdates.size>0){const _t=RA(rt.width,rt.height,P.format,P.type);for(const nn of P.layerUpdates){const wn=rt.data.subarray(nn*_t/rt.data.BYTES_PER_ELEMENT,(nn+1)*_t/rt.data.BYTES_PER_ELEMENT);t.compressedTexSubImage3D(s.TEXTURE_2D_ARRAY,Qe,0,0,nn,rt.width,rt.height,1,qe,wn)}P.clearLayerUpdates()}else t.compressedTexSubImage3D(s.TEXTURE_2D_ARRAY,Qe,0,0,0,rt.width,rt.height,Ye.depth,qe,rt.data)}else t.compressedTexImage3D(s.TEXTURE_2D_ARRAY,Qe,bt,rt.width,rt.height,Ye.depth,0,rt.data,0,0);else Ut("WebGLRenderer: Attempt to load unsupported compressed texture format in .uploadTexture()");else fe?ot&&t.texSubImage3D(s.TEXTURE_2D_ARRAY,Qe,0,0,0,rt.width,rt.height,Ye.depth,qe,wt,rt.data):t.texImage3D(s.TEXTURE_2D_ARRAY,Qe,bt,rt.width,rt.height,Ye.depth,0,qe,wt,rt.data)}else{fe&&Ne&&t.texStorage2D(s.TEXTURE_2D,Et,bt,Vt[0].width,Vt[0].height);for(let Qe=0,We=Vt.length;Qe<We;Qe++)rt=Vt[Qe],P.format!==Zi?qe!==null?fe?ot&&t.compressedTexSubImage2D(s.TEXTURE_2D,Qe,0,0,rt.width,rt.height,qe,rt.data):t.compressedTexImage2D(s.TEXTURE_2D,Qe,bt,rt.width,rt.height,0,rt.data):Ut("WebGLRenderer: Attempt to load unsupported compressed texture format in .uploadTexture()"):fe?ot&&t.texSubImage2D(s.TEXTURE_2D,Qe,0,0,rt.width,rt.height,qe,wt,rt.data):t.texImage2D(s.TEXTURE_2D,Qe,bt,rt.width,rt.height,0,qe,wt,rt.data)}else if(P.isDataArrayTexture)if(fe){if(Ne&&t.texStorage3D(s.TEXTURE_2D_ARRAY,Et,bt,Ye.width,Ye.height,Ye.depth),ot)if(P.layerUpdates.size>0){const Qe=RA(Ye.width,Ye.height,P.format,P.type);for(const We of P.layerUpdates){const _t=Ye.data.subarray(We*Qe/Ye.data.BYTES_PER_ELEMENT,(We+1)*Qe/Ye.data.BYTES_PER_ELEMENT);t.texSubImage3D(s.TEXTURE_2D_ARRAY,0,0,0,We,Ye.width,Ye.height,1,qe,wt,_t)}P.clearLayerUpdates()}else t.texSubImage3D(s.TEXTURE_2D_ARRAY,0,0,0,0,Ye.width,Ye.height,Ye.depth,qe,wt,Ye.data)}else t.texImage3D(s.TEXTURE_2D_ARRAY,0,bt,Ye.width,Ye.height,Ye.depth,0,qe,wt,Ye.data);else if(P.isData3DTexture)fe?(Ne&&t.texStorage3D(s.TEXTURE_3D,Et,bt,Ye.width,Ye.height,Ye.depth),ot&&t.texSubImage3D(s.TEXTURE_3D,0,0,0,0,Ye.width,Ye.height,Ye.depth,qe,wt,Ye.data)):t.texImage3D(s.TEXTURE_3D,0,bt,Ye.width,Ye.height,Ye.depth,0,qe,wt,Ye.data);else if(P.isFramebufferTexture){if(Ne)if(fe)t.texStorage2D(s.TEXTURE_2D,Et,bt,Ye.width,Ye.height);else{let Qe=Ye.width,We=Ye.height;for(let _t=0;_t<Et;_t++)t.texImage2D(s.TEXTURE_2D,_t,bt,Qe,We,0,qe,wt,null),Qe>>=1,We>>=1}}else if(Vt.length>0){if(fe&&Ne){const Qe=gt(Vt[0]);t.texStorage2D(s.TEXTURE_2D,Et,bt,Qe.width,Qe.height)}for(let Qe=0,We=Vt.length;Qe<We;Qe++)rt=Vt[Qe],fe?ot&&t.texSubImage2D(s.TEXTURE_2D,Qe,0,0,qe,wt,rt):t.texImage2D(s.TEXTURE_2D,Qe,bt,qe,wt,rt);P.generateMipmaps=!1}else if(fe){if(Ne){const Qe=gt(Ye);t.texStorage2D(s.TEXTURE_2D,Et,bt,Qe.width,Qe.height)}ot&&t.texSubImage2D(s.TEXTURE_2D,0,0,0,qe,wt,Ye)}else t.texImage2D(s.TEXTURE_2D,0,bt,qe,wt,Ye);T(P)&&M(Fe),Ft.__version=Ie.version,P.onUpdate&&P.onUpdate(P)}j.__version=P.version}function Ee(j,P,de){if(P.image.length!==6)return;const Fe=le(j,P),ke=P.source;t.bindTexture(s.TEXTURE_CUBE_MAP,j.__webglTexture,s.TEXTURE0+de);const Ie=n.get(ke);if(ke.version!==Ie.__version||Fe===!0){t.activeTexture(s.TEXTURE0+de);const Ft=Bn.getPrimaries(Bn.workingColorSpace),Mt=P.colorSpace===dl?null:Bn.getPrimaries(P.colorSpace),Ht=P.colorSpace===dl||Ft===Mt?s.NONE:s.BROWSER_DEFAULT_WEBGL;s.pixelStorei(s.UNPACK_FLIP_Y_WEBGL,P.flipY),s.pixelStorei(s.UNPACK_PREMULTIPLY_ALPHA_WEBGL,P.premultiplyAlpha),s.pixelStorei(s.UNPACK_ALIGNMENT,P.unpackAlignment),s.pixelStorei(s.UNPACK_COLORSPACE_CONVERSION_WEBGL,Ht);const zt=P.isCompressedTexture||P.image[0].isCompressedTexture,Ye=P.image[0]&&P.image[0].isDataTexture,qe=[];for(let We=0;We<6;We++)!zt&&!Ye?qe[We]=R(P.image[We],!0,i.maxCubemapSize):qe[We]=Ye?P.image[We].image:P.image[We],qe[We]=Lt(P,qe[We]);const wt=qe[0],bt=o.convert(P.format,P.colorSpace),rt=o.convert(P.type),Vt=D(P.internalFormat,bt,rt,P.colorSpace),fe=P.isVideoTexture!==!0,Ne=Ie.__version===void 0||Fe===!0,ot=ke.dataReady;let Et=H(P,wt);te(s.TEXTURE_CUBE_MAP,P);let Qe;if(zt){fe&&Ne&&t.texStorage2D(s.TEXTURE_CUBE_MAP,Et,Vt,wt.width,wt.height);for(let We=0;We<6;We++){Qe=qe[We].mipmaps;for(let _t=0;_t<Qe.length;_t++){const nn=Qe[_t];P.format!==Zi?bt!==null?fe?ot&&t.compressedTexSubImage2D(s.TEXTURE_CUBE_MAP_POSITIVE_X+We,_t,0,0,nn.width,nn.height,bt,nn.data):t.compressedTexImage2D(s.TEXTURE_CUBE_MAP_POSITIVE_X+We,_t,Vt,nn.width,nn.height,0,nn.data):Ut("WebGLRenderer: Attempt to load unsupported compressed texture format in .setTextureCube()"):fe?ot&&t.texSubImage2D(s.TEXTURE_CUBE_MAP_POSITIVE_X+We,_t,0,0,nn.width,nn.height,bt,rt,nn.data):t.texImage2D(s.TEXTURE_CUBE_MAP_POSITIVE_X+We,_t,Vt,nn.width,nn.height,0,bt,rt,nn.data)}}}else{if(Qe=P.mipmaps,fe&&Ne){Qe.length>0&&Et++;const We=gt(qe[0]);t.texStorage2D(s.TEXTURE_CUBE_MAP,Et,Vt,We.width,We.height)}for(let We=0;We<6;We++)if(Ye){fe?ot&&t.texSubImage2D(s.TEXTURE_CUBE_MAP_POSITIVE_X+We,0,0,0,qe[We].width,qe[We].height,bt,rt,qe[We].data):t.texImage2D(s.TEXTURE_CUBE_MAP_POSITIVE_X+We,0,Vt,qe[We].width,qe[We].height,0,bt,rt,qe[We].data);for(let _t=0;_t<Qe.length;_t++){const wn=Qe[_t].image[We].image;fe?ot&&t.texSubImage2D(s.TEXTURE_CUBE_MAP_POSITIVE_X+We,_t+1,0,0,wn.width,wn.height,bt,rt,wn.data):t.texImage2D(s.TEXTURE_CUBE_MAP_POSITIVE_X+We,_t+1,Vt,wn.width,wn.height,0,bt,rt,wn.data)}}else{fe?ot&&t.texSubImage2D(s.TEXTURE_CUBE_MAP_POSITIVE_X+We,0,0,0,bt,rt,qe[We]):t.texImage2D(s.TEXTURE_CUBE_MAP_POSITIVE_X+We,0,Vt,bt,rt,qe[We]);for(let _t=0;_t<Qe.length;_t++){const nn=Qe[_t];fe?ot&&t.texSubImage2D(s.TEXTURE_CUBE_MAP_POSITIVE_X+We,_t+1,0,0,bt,rt,nn.image[We]):t.texImage2D(s.TEXTURE_CUBE_MAP_POSITIVE_X+We,_t+1,Vt,bt,rt,nn.image[We])}}}T(P)&&M(s.TEXTURE_CUBE_MAP),Ie.__version=ke.version,P.onUpdate&&P.onUpdate(P)}j.__version=P.version}function lt(j,P,de,Fe,ke,Ie){const Ft=o.convert(de.format,de.colorSpace),Mt=o.convert(de.type),Ht=D(de.internalFormat,Ft,Mt,de.colorSpace),zt=n.get(P),Ye=n.get(de);if(Ye.__renderTarget=P,!zt.__hasExternalTextures){const qe=Math.max(1,P.width>>Ie),wt=Math.max(1,P.height>>Ie);ke===s.TEXTURE_3D||ke===s.TEXTURE_2D_ARRAY?t.texImage3D(ke,Ie,Ht,qe,wt,P.depth,0,Ft,Mt,null):t.texImage2D(ke,Ie,Ht,qe,wt,0,Ft,Mt,null)}t.bindFramebuffer(s.FRAMEBUFFER,j),Dt(P)?h.framebufferTexture2DMultisampleEXT(s.FRAMEBUFFER,Fe,ke,Ye.__webglTexture,0,Q(P)):(ke===s.TEXTURE_2D||ke>=s.TEXTURE_CUBE_MAP_POSITIVE_X&&ke<=s.TEXTURE_CUBE_MAP_NEGATIVE_Z)&&s.framebufferTexture2D(s.FRAMEBUFFER,Fe,ke,Ye.__webglTexture,Ie),t.bindFramebuffer(s.FRAMEBUFFER,null)}function Rt(j,P,de){if(s.bindRenderbuffer(s.RENDERBUFFER,j),P.depthBuffer){const Fe=P.depthTexture,ke=Fe&&Fe.isDepthTexture?Fe.type:null,Ie=N(P.stencilBuffer,ke),Ft=P.stencilBuffer?s.DEPTH_STENCIL_ATTACHMENT:s.DEPTH_ATTACHMENT;Dt(P)?h.renderbufferStorageMultisampleEXT(s.RENDERBUFFER,Q(P),Ie,P.width,P.height):de?s.renderbufferStorageMultisample(s.RENDERBUFFER,Q(P),Ie,P.width,P.height):s.renderbufferStorage(s.RENDERBUFFER,Ie,P.width,P.height),s.framebufferRenderbuffer(s.FRAMEBUFFER,Ft,s.RENDERBUFFER,j)}else{const Fe=P.textures;for(let ke=0;ke<Fe.length;ke++){const Ie=Fe[ke],Ft=o.convert(Ie.format,Ie.colorSpace),Mt=o.convert(Ie.type),Ht=D(Ie.internalFormat,Ft,Mt,Ie.colorSpace);Dt(P)?h.renderbufferStorageMultisampleEXT(s.RENDERBUFFER,Q(P),Ht,P.width,P.height):de?s.renderbufferStorageMultisample(s.RENDERBUFFER,Q(P),Ht,P.width,P.height):s.renderbufferStorage(s.RENDERBUFFER,Ht,P.width,P.height)}}s.bindRenderbuffer(s.RENDERBUFFER,null)}function Bt(j,P,de){const Fe=P.isWebGLCubeRenderTarget===!0;if(t.bindFramebuffer(s.FRAMEBUFFER,j),!(P.depthTexture&&P.depthTexture.isDepthTexture))throw new Error("renderTarget.depthTexture must be an instance of THREE.DepthTexture");const ke=n.get(P.depthTexture);if(ke.__renderTarget=P,(!ke.__webglTexture||P.depthTexture.image.width!==P.width||P.depthTexture.image.height!==P.height)&&(P.depthTexture.image.width=P.width,P.depthTexture.image.height=P.height,P.depthTexture.needsUpdate=!0),Fe){if(ke.__webglInit===void 0&&(ke.__webglInit=!0,P.depthTexture.addEventListener("dispose",O)),ke.__webglTexture===void 0){ke.__webglTexture=s.createTexture(),t.bindTexture(s.TEXTURE_CUBE_MAP,ke.__webglTexture),te(s.TEXTURE_CUBE_MAP,P.depthTexture);const zt=o.convert(P.depthTexture.format),Ye=o.convert(P.depthTexture.type);let qe;P.depthTexture.format===Eo?qe=s.DEPTH_COMPONENT24:P.depthTexture.format===cc&&(qe=s.DEPTH24_STENCIL8);for(let wt=0;wt<6;wt++)s.texImage2D(s.TEXTURE_CUBE_MAP_POSITIVE_X+wt,0,qe,P.width,P.height,0,zt,Ye,null)}}else ge(P.depthTexture,0);const Ie=ke.__webglTexture,Ft=Q(P),Mt=Fe?s.TEXTURE_CUBE_MAP_POSITIVE_X+de:s.TEXTURE_2D,Ht=P.depthTexture.format===cc?s.DEPTH_STENCIL_ATTACHMENT:s.DEPTH_ATTACHMENT;if(P.depthTexture.format===Eo)Dt(P)?h.framebufferTexture2DMultisampleEXT(s.FRAMEBUFFER,Ht,Mt,Ie,0,Ft):s.framebufferTexture2D(s.FRAMEBUFFER,Ht,Mt,Ie,0);else if(P.depthTexture.format===cc)Dt(P)?h.framebufferTexture2DMultisampleEXT(s.FRAMEBUFFER,Ht,Mt,Ie,0,Ft):s.framebufferTexture2D(s.FRAMEBUFFER,Ht,Mt,Ie,0);else throw new Error("Unknown depthTexture format")}function tn(j){const P=n.get(j),de=j.isWebGLCubeRenderTarget===!0;if(P.__boundDepthTexture!==j.depthTexture){const Fe=j.depthTexture;if(P.__depthDisposeCallback&&P.__depthDisposeCallback(),Fe){const ke=()=>{delete P.__boundDepthTexture,delete P.__depthDisposeCallback,Fe.removeEventListener("dispose",ke)};Fe.addEventListener("dispose",ke),P.__depthDisposeCallback=ke}P.__boundDepthTexture=Fe}if(j.depthTexture&&!P.__autoAllocateDepthBuffer)if(de)for(let Fe=0;Fe<6;Fe++)Bt(P.__webglFramebuffer[Fe],j,Fe);else{const Fe=j.texture.mipmaps;Fe&&Fe.length>0?Bt(P.__webglFramebuffer[0],j,0):Bt(P.__webglFramebuffer,j,0)}else if(de){P.__webglDepthbuffer=[];for(let Fe=0;Fe<6;Fe++)if(t.bindFramebuffer(s.FRAMEBUFFER,P.__webglFramebuffer[Fe]),P.__webglDepthbuffer[Fe]===void 0)P.__webglDepthbuffer[Fe]=s.createRenderbuffer(),Rt(P.__webglDepthbuffer[Fe],j,!1);else{const ke=j.stencilBuffer?s.DEPTH_STENCIL_ATTACHMENT:s.DEPTH_ATTACHMENT,Ie=P.__webglDepthbuffer[Fe];s.bindRenderbuffer(s.RENDERBUFFER,Ie),s.framebufferRenderbuffer(s.FRAMEBUFFER,ke,s.RENDERBUFFER,Ie)}}else{const Fe=j.texture.mipmaps;if(Fe&&Fe.length>0?t.bindFramebuffer(s.FRAMEBUFFER,P.__webglFramebuffer[0]):t.bindFramebuffer(s.FRAMEBUFFER,P.__webglFramebuffer),P.__webglDepthbuffer===void 0)P.__webglDepthbuffer=s.createRenderbuffer(),Rt(P.__webglDepthbuffer,j,!1);else{const ke=j.stencilBuffer?s.DEPTH_STENCIL_ATTACHMENT:s.DEPTH_ATTACHMENT,Ie=P.__webglDepthbuffer;s.bindRenderbuffer(s.RENDERBUFFER,Ie),s.framebufferRenderbuffer(s.FRAMEBUFFER,ke,s.RENDERBUFFER,Ie)}}t.bindFramebuffer(s.FRAMEBUFFER,null)}function on(j,P,de){const Fe=n.get(j);P!==void 0&<(Fe.__webglFramebuffer,j,j.texture,s.COLOR_ATTACHMENT0,s.TEXTURE_2D,0),de!==void 0&&tn(j)}function Wt(j){const P=j.texture,de=n.get(j),Fe=n.get(P);j.addEventListener("dispose",z);const ke=j.textures,Ie=j.isWebGLCubeRenderTarget===!0,Ft=ke.length>1;if(Ft||(Fe.__webglTexture===void 0&&(Fe.__webglTexture=s.createTexture()),Fe.__version=P.version,l.memory.textures++),Ie){de.__webglFramebuffer=[];for(let Mt=0;Mt<6;Mt++)if(P.mipmaps&&P.mipmaps.length>0){de.__webglFramebuffer[Mt]=[];for(let Ht=0;Ht<P.mipmaps.length;Ht++)de.__webglFramebuffer[Mt][Ht]=s.createFramebuffer()}else de.__webglFramebuffer[Mt]=s.createFramebuffer()}else{if(P.mipmaps&&P.mipmaps.length>0){de.__webglFramebuffer=[];for(let Mt=0;Mt<P.mipmaps.length;Mt++)de.__webglFramebuffer[Mt]=s.createFramebuffer()}else de.__webglFramebuffer=s.createFramebuffer();if(Ft)for(let Mt=0,Ht=ke.length;Mt<Ht;Mt++){const zt=n.get(ke[Mt]);zt.__webglTexture===void 0&&(zt.__webglTexture=s.createTexture(),l.memory.textures++)}if(j.samples>0&&Dt(j)===!1){de.__webglMultisampledFramebuffer=s.createFramebuffer(),de.__webglColorRenderbuffer=[],t.bindFramebuffer(s.FRAMEBUFFER,de.__webglMultisampledFramebuffer);for(let Mt=0;Mt<ke.length;Mt++){const Ht=ke[Mt];de.__webglColorRenderbuffer[Mt]=s.createRenderbuffer(),s.bindRenderbuffer(s.RENDERBUFFER,de.__webglColorRenderbuffer[Mt]);const zt=o.convert(Ht.format,Ht.colorSpace),Ye=o.convert(Ht.type),qe=D(Ht.internalFormat,zt,Ye,Ht.colorSpace,j.isXRRenderTarget===!0),wt=Q(j);s.renderbufferStorageMultisample(s.RENDERBUFFER,wt,qe,j.width,j.height),s.framebufferRenderbuffer(s.FRAMEBUFFER,s.COLOR_ATTACHMENT0+Mt,s.RENDERBUFFER,de.__webglColorRenderbuffer[Mt])}s.bindRenderbuffer(s.RENDERBUFFER,null),j.depthBuffer&&(de.__webglDepthRenderbuffer=s.createRenderbuffer(),Rt(de.__webglDepthRenderbuffer,j,!0)),t.bindFramebuffer(s.FRAMEBUFFER,null)}}if(Ie){t.bindTexture(s.TEXTURE_CUBE_MAP,Fe.__webglTexture),te(s.TEXTURE_CUBE_MAP,P);for(let Mt=0;Mt<6;Mt++)if(P.mipmaps&&P.mipmaps.length>0)for(let Ht=0;Ht<P.mipmaps.length;Ht++)lt(de.__webglFramebuffer[Mt][Ht],j,P,s.COLOR_ATTACHMENT0,s.TEXTURE_CUBE_MAP_POSITIVE_X+Mt,Ht);else lt(de.__webglFramebuffer[Mt],j,P,s.COLOR_ATTACHMENT0,s.TEXTURE_CUBE_MAP_POSITIVE_X+Mt,0);T(P)&&M(s.TEXTURE_CUBE_MAP),t.unbindTexture()}else if(Ft){for(let Mt=0,Ht=ke.length;Mt<Ht;Mt++){const zt=ke[Mt],Ye=n.get(zt);let qe=s.TEXTURE_2D;(j.isWebGL3DRenderTarget||j.isWebGLArrayRenderTarget)&&(qe=j.isWebGL3DRenderTarget?s.TEXTURE_3D:s.TEXTURE_2D_ARRAY),t.bindTexture(qe,Ye.__webglTexture),te(qe,zt),lt(de.__webglFramebuffer,j,zt,s.COLOR_ATTACHMENT0+Mt,qe,0),T(zt)&&M(qe)}t.unbindTexture()}else{let Mt=s.TEXTURE_2D;if((j.isWebGL3DRenderTarget||j.isWebGLArrayRenderTarget)&&(Mt=j.isWebGL3DRenderTarget?s.TEXTURE_3D:s.TEXTURE_2D_ARRAY),t.bindTexture(Mt,Fe.__webglTexture),te(Mt,P),P.mipmaps&&P.mipmaps.length>0)for(let Ht=0;Ht<P.mipmaps.length;Ht++)lt(de.__webglFramebuffer[Ht],j,P,s.COLOR_ATTACHMENT0,Mt,Ht);else lt(de.__webglFramebuffer,j,P,s.COLOR_ATTACHMENT0,Mt,0);T(P)&&M(Mt),t.unbindTexture()}j.depthBuffer&&tn(j)}function Ge(j){const P=j.textures;for(let de=0,Fe=P.length;de<Fe;de++){const ke=P[de];if(T(ke)){const Ie=w(j),Ft=n.get(ke).__webglTexture;t.bindTexture(Ie,Ft),M(Ie),t.unbindTexture()}}}const et=[],Je=[];function xt(j){if(j.samples>0){if(Dt(j)===!1){const P=j.textures,de=j.width,Fe=j.height;let ke=s.COLOR_BUFFER_BIT;const Ie=j.stencilBuffer?s.DEPTH_STENCIL_ATTACHMENT:s.DEPTH_ATTACHMENT,Ft=n.get(j),Mt=P.length>1;if(Mt)for(let zt=0;zt<P.length;zt++)t.bindFramebuffer(s.FRAMEBUFFER,Ft.__webglMultisampledFramebuffer),s.framebufferRenderbuffer(s.FRAMEBUFFER,s.COLOR_ATTACHMENT0+zt,s.RENDERBUFFER,null),t.bindFramebuffer(s.FRAMEBUFFER,Ft.__webglFramebuffer),s.framebufferTexture2D(s.DRAW_FRAMEBUFFER,s.COLOR_ATTACHMENT0+zt,s.TEXTURE_2D,null,0);t.bindFramebuffer(s.READ_FRAMEBUFFER,Ft.__webglMultisampledFramebuffer);const Ht=j.texture.mipmaps;Ht&&Ht.length>0?t.bindFramebuffer(s.DRAW_FRAMEBUFFER,Ft.__webglFramebuffer[0]):t.bindFramebuffer(s.DRAW_FRAMEBUFFER,Ft.__webglFramebuffer);for(let zt=0;zt<P.length;zt++){if(j.resolveDepthBuffer&&(j.depthBuffer&&(ke|=s.DEPTH_BUFFER_BIT),j.stencilBuffer&&j.resolveStencilBuffer&&(ke|=s.STENCIL_BUFFER_BIT)),Mt){s.framebufferRenderbuffer(s.READ_FRAMEBUFFER,s.COLOR_ATTACHMENT0,s.RENDERBUFFER,Ft.__webglColorRenderbuffer[zt]);const Ye=n.get(P[zt]).__webglTexture;s.framebufferTexture2D(s.DRAW_FRAMEBUFFER,s.COLOR_ATTACHMENT0,s.TEXTURE_2D,Ye,0)}s.blitFramebuffer(0,0,de,Fe,0,0,de,Fe,ke,s.NEAREST),d===!0&&(et.length=0,Je.length=0,et.push(s.COLOR_ATTACHMENT0+zt),j.depthBuffer&&j.resolveDepthBuffer===!1&&(et.push(Ie),Je.push(Ie),s.invalidateFramebuffer(s.DRAW_FRAMEBUFFER,Je)),s.invalidateFramebuffer(s.READ_FRAMEBUFFER,et))}if(t.bindFramebuffer(s.READ_FRAMEBUFFER,null),t.bindFramebuffer(s.DRAW_FRAMEBUFFER,null),Mt)for(let zt=0;zt<P.length;zt++){t.bindFramebuffer(s.FRAMEBUFFER,Ft.__webglMultisampledFramebuffer),s.framebufferRenderbuffer(s.FRAMEBUFFER,s.COLOR_ATTACHMENT0+zt,s.RENDERBUFFER,Ft.__webglColorRenderbuffer[zt]);const Ye=n.get(P[zt]).__webglTexture;t.bindFramebuffer(s.FRAMEBUFFER,Ft.__webglFramebuffer),s.framebufferTexture2D(s.DRAW_FRAMEBUFFER,s.COLOR_ATTACHMENT0+zt,s.TEXTURE_2D,Ye,0)}t.bindFramebuffer(s.DRAW_FRAMEBUFFER,Ft.__webglMultisampledFramebuffer)}else if(j.depthBuffer&&j.resolveDepthBuffer===!1&&d){const P=j.stencilBuffer?s.DEPTH_STENCIL_ATTACHMENT:s.DEPTH_ATTACHMENT;s.invalidateFramebuffer(s.DRAW_FRAMEBUFFER,[P])}}}function Q(j){return Math.min(i.maxSamples,j.samples)}function Dt(j){const P=n.get(j);return j.samples>0&&e.has("WEBGL_multisampled_render_to_texture")===!0&&P.__useRenderToTexture!==!1}function mt(j){const P=l.render.frame;_.get(j)!==P&&(_.set(j,P),j.update())}function Lt(j,P){const de=j.colorSpace,Fe=j.format,ke=j.type;return j.isCompressedTexture===!0||j.isVideoTexture===!0||de!==na&&de!==dl&&(Bn.getTransfer(de)===si?(Fe!==Zi||ke!==Ta)&&Ut("WebGLTextures: sRGB encoded textures have to use RGBAFormat and UnsignedByteType."):Zt("WebGLTextures: Unsupported texture color space:",de)),P}function gt(j){return typeof HTMLImageElement<"u"&&j instanceof HTMLImageElement?(p.width=j.naturalWidth||j.width,p.height=j.naturalHeight||j.height):typeof VideoFrame<"u"&&j instanceof VideoFrame?(p.width=j.displayWidth,p.height=j.displayHeight):(p.width=j.width,p.height=j.height),p}this.allocateTextureUnit=$,this.resetTextureUnits=ne,this.setTexture2D=ge,this.setTexture2DArray=I,this.setTexture3D=W,this.setTextureCube=ee,this.rebindTextures=on,this.setupRenderTarget=Wt,this.updateRenderTargetMipmap=Ge,this.updateMultisampleRenderTarget=xt,this.setupDepthRenderbuffer=tn,this.setupFrameBufferTexture=lt,this.useMultisampledRTT=Dt,this.isReversedDepthBuffer=function(){return t.buffers.depth.getReversed()}}function VE(s,e){function t(n,i=dl){let o;const l=Bn.getTransfer(i);if(n===Ta)return s.UNSIGNED_BYTE;if(n===Pg)return s.UNSIGNED_SHORT_4_4_4_4;if(n===Gg)return s.UNSIGNED_SHORT_5_5_5_1;if(n===nx)return s.UNSIGNED_INT_5_9_9_9_REV;if(n===ix)return s.UNSIGNED_INT_10F_11F_11F_REV;if(n===Fg)return s.BYTE;if(n===Hg)return s.SHORT;if(n===Zf)return s.UNSIGNED_SHORT;if(n===np)return s.INT;if(n===js)return s.UNSIGNED_INT;if(n===Ci)return s.FLOAT;if(n===ki)return s.HALF_FLOAT;if(n===ax)return s.ALPHA;if(n===sx)return s.RGB;if(n===Zi)return s.RGBA;if(n===Eo)return s.DEPTH_COMPONENT;if(n===cc)return s.DEPTH_STENCIL;if(n===ip)return s.RED;if(n===ap)return s.RED_INTEGER;if(n===xu)return s.RG;if(n===zg)return s.RG_INTEGER;if(n===Vg)return s.RGBA_INTEGER;if(n===sp||n===rp||n===op||n===lp)if(l===si)if(o=e.get("WEBGL_compressed_texture_s3tc_srgb"),o!==null){if(n===sp)return o.COMPRESSED_SRGB_S3TC_DXT1_EXT;if(n===rp)return o.COMPRESSED_SRGB_ALPHA_S3TC_DXT1_EXT;if(n===op)return o.COMPRESSED_SRGB_ALPHA_S3TC_DXT3_EXT;if(n===lp)return o.COMPRESSED_SRGB_ALPHA_S3TC_DXT5_EXT}else return null;else if(o=e.get("WEBGL_compressed_texture_s3tc"),o!==null){if(n===sp)return o.COMPRESSED_RGB_S3TC_DXT1_EXT;if(n===rp)return o.COMPRESSED_RGBA_S3TC_DXT1_EXT;if(n===op)return o.COMPRESSED_RGBA_S3TC_DXT3_EXT;if(n===lp)return o.COMPRESSED_RGBA_S3TC_DXT5_EXT}else return null;if(n===kg||n===Xg||n===Yg||n===Jg)if(o=e.get("WEBGL_compressed_texture_pvrtc"),o!==null){if(n===kg)return o.COMPRESSED_RGB_PVRTC_4BPPV1_IMG;if(n===Xg)return o.COMPRESSED_RGB_PVRTC_2BPPV1_IMG;if(n===Yg)return o.COMPRESSED_RGBA_PVRTC_4BPPV1_IMG;if(n===Jg)return o.COMPRESSED_RGBA_PVRTC_2BPPV1_IMG}else return null;if(n===qg||n===Kg||n===Wg||n===jg||n===Zg||n===Qg||n===$g)if(o=e.get("WEBGL_compressed_texture_etc"),o!==null){if(n===qg||n===Kg)return l===si?o.COMPRESSED_SRGB8_ETC2:o.COMPRESSED_RGB8_ETC2;if(n===Wg)return l===si?o.COMPRESSED_SRGB8_ALPHA8_ETC2_EAC:o.COMPRESSED_RGBA8_ETC2_EAC;if(n===jg)return o.COMPRESSED_R11_EAC;if(n===Zg)return o.COMPRESSED_SIGNED_R11_EAC;if(n===Qg)return o.COMPRESSED_RG11_EAC;if(n===$g)return o.COMPRESSED_SIGNED_RG11_EAC}else return null;if(n===e0||n===t0||n===n0||n===i0||n===a0||n===s0||n===r0||n===o0||n===l0||n===c0||n===u0||n===f0||n===h0||n===d0)if(o=e.get("WEBGL_compressed_texture_astc"),o!==null){if(n===e0)return l===si?o.COMPRESSED_SRGB8_ALPHA8_ASTC_4x4_KHR:o.COMPRESSED_RGBA_ASTC_4x4_KHR;if(n===t0)return l===si?o.COMPRESSED_SRGB8_ALPHA8_ASTC_5x4_KHR:o.COMPRESSED_RGBA_ASTC_5x4_KHR;if(n===n0)return l===si?o.COMPRESSED_SRGB8_ALPHA8_ASTC_5x5_KHR:o.COMPRESSED_RGBA_ASTC_5x5_KHR;if(n===i0)return l===si?o.COMPRESSED_SRGB8_ALPHA8_ASTC_6x5_KHR:o.COMPRESSED_RGBA_ASTC_6x5_KHR;if(n===a0)return l===si?o.COMPRESSED_SRGB8_ALPHA8_ASTC_6x6_KHR:o.COMPRESSED_RGBA_ASTC_6x6_KHR;if(n===s0)return l===si?o.COMPRESSED_SRGB8_ALPHA8_ASTC_8x5_KHR:o.COMPRESSED_RGBA_ASTC_8x5_KHR;if(n===r0)return l===si?o.COMPRESSED_SRGB8_ALPHA8_ASTC_8x6_KHR:o.COMPRESSED_RGBA_ASTC_8x6_KHR;if(n===o0)return l===si?o.COMPRESSED_SRGB8_ALPHA8_ASTC_8x8_KHR:o.COMPRESSED_RGBA_ASTC_8x8_KHR;if(n===l0)return l===si?o.COMPRESSED_SRGB8_ALPHA8_ASTC_10x5_KHR:o.COMPRESSED_RGBA_ASTC_10x5_KHR;if(n===c0)return l===si?o.COMPRESSED_SRGB8_ALPHA8_ASTC_10x6_KHR:o.COMPRESSED_RGBA_ASTC_10x6_KHR;if(n===u0)return l===si?o.COMPRESSED_SRGB8_ALPHA8_ASTC_10x8_KHR:o.COMPRESSED_RGBA_ASTC_10x8_KHR;if(n===f0)return l===si?o.COMPRESSED_SRGB8_ALPHA8_ASTC_10x10_KHR:o.COMPRESSED_RGBA_ASTC_10x10_KHR;if(n===h0)return l===si?o.COMPRESSED_SRGB8_ALPHA8_ASTC_12x10_KHR:o.COMPRESSED_RGBA_ASTC_12x10_KHR;if(n===d0)return l===si?o.COMPRESSED_SRGB8_ALPHA8_ASTC_12x12_KHR:o.COMPRESSED_RGBA_ASTC_12x12_KHR}else return null;if(n===p0||n===m0||n===g0)if(o=e.get("EXT_texture_compression_bptc"),o!==null){if(n===p0)return l===si?o.COMPRESSED_SRGB_ALPHA_BPTC_UNORM_EXT:o.COMPRESSED_RGBA_BPTC_UNORM_EXT;if(n===m0)return o.COMPRESSED_RGB_BPTC_SIGNED_FLOAT_EXT;if(n===g0)return o.COMPRESSED_RGB_BPTC_UNSIGNED_FLOAT_EXT}else return null;if(n===v0||n===_0||n===y0||n===x0)if(o=e.get("EXT_texture_compression_rgtc"),o!==null){if(n===v0)return o.COMPRESSED_RED_RGTC1_EXT;if(n===_0)return o.COMPRESSED_SIGNED_RED_RGTC1_EXT;if(n===y0)return o.COMPRESSED_RED_GREEN_RGTC2_EXT;if(n===x0)return o.COMPRESSED_SIGNED_RED_GREEN_RGTC2_EXT}else return null;return n===Qf?s.UNSIGNED_INT_24_8:s[n]!==void 0?s[n]:null}return{convert:t}}const aL=`
|
|
3996
3996
|
void main() {
|
|
3997
3997
|
|
|
3998
3998
|
gl_Position = vec4( position, 1.0 );
|
|
@@ -4016,14 +4016,14 @@ void main() {
|
|
|
4016
4016
|
|
|
4017
4017
|
}
|
|
4018
4018
|
|
|
4019
|
-
}`;class rL{constructor(){this.texture=null,this.mesh=null,this.depthNear=0,this.depthFar=0}init(e,t){if(this.texture===null){const n=new kx(e.texture);(e.depthNear!==t.depthNear||e.depthFar!==t.depthFar)&&(this.depthNear=e.depthNear,this.depthFar=e.depthFar),this.texture=n}}getMesh(e){if(this.texture!==null&&this.mesh===null){const t=e.cameras[0].viewport,n=new ms({vertexShader:aL,fragmentShader:sL,uniforms:{depthColor:{value:this.texture},depthWidth:{value:t.z},depthHeight:{value:t.w}}});this.mesh=new yi(new Mc(20,20),n)}return this.mesh}reset(){this.texture=null,this.mesh=null}getDepthTexture(){return this.texture}}class oL extends To{constructor(e,t){super();const n=this;let i=null,o=1,l=null,h="local-floor",d=1,p=null,_=null,v=null,y=null,x=null,b=null;const R=typeof XRWebGLBinding<"u",T=new rL,M={},w=t.getContextAttributes();let D=null,N=null;const H=[],O=[],z=new nt;let V=null;const U=new aa;U.viewport=new pi;const F=new aa;F.viewport=new pi;const K=[U,F],ne=new Q1;let $=null,ae=null;this.cameraAutoUpdate=!0,this.enabled=!1,this.isPresenting=!1,this.getController=function(he){let Ee=H[he];return Ee===void 0&&(Ee=new J0,H[he]=Ee),Ee.getTargetRaySpace()},this.getControllerGrip=function(he){let Ee=H[he];return Ee===void 0&&(Ee=new J0,H[he]=Ee),Ee.getGripSpace()},this.getHand=function(he){let Ee=H[he];return Ee===void 0&&(Ee=new J0,H[he]=Ee),Ee.getHandSpace()};function ge(he){const Ee=O.indexOf(he.inputSource);if(Ee===-1)return;const lt=H[Ee];lt!==void 0&&(lt.update(he.inputSource,he.frame,p||l),lt.dispatchEvent({type:he.type,data:he.inputSource}))}function I(){i.removeEventListener("select",ge),i.removeEventListener("selectstart",ge),i.removeEventListener("selectend",ge),i.removeEventListener("squeeze",ge),i.removeEventListener("squeezestart",ge),i.removeEventListener("squeezeend",ge),i.removeEventListener("end",I),i.removeEventListener("inputsourceschange",W);for(let he=0;he<H.length;he++){const Ee=O[he];Ee!==null&&(O[he]=null,H[he].disconnect(Ee))}$=null,ae=null,T.reset();for(const he in M)delete M[he];e.setRenderTarget(D),x=null,y=null,v=null,i=null,N=null,ze.stop(),n.isPresenting=!1,e.setPixelRatio(V),e.setSize(z.width,z.height,!1),n.dispatchEvent({type:"sessionend"})}this.setFramebufferScaleFactor=function(he){o=he,n.isPresenting===!0&&Ut("WebXRManager: Cannot change framebuffer scale while presenting.")},this.setReferenceSpaceType=function(he){h=he,n.isPresenting===!0&&Ut("WebXRManager: Cannot change reference space type while presenting.")},this.getReferenceSpace=function(){return p||l},this.setReferenceSpace=function(he){p=he},this.getBaseLayer=function(){return y!==null?y:x},this.getBinding=function(){return v===null&&R&&(v=new XRWebGLBinding(i,t)),v},this.getFrame=function(){return b},this.getSession=function(){return i},this.setSession=async function(he){if(i=he,i!==null){if(D=e.getRenderTarget(),i.addEventListener("select",ge),i.addEventListener("selectstart",ge),i.addEventListener("selectend",ge),i.addEventListener("squeeze",ge),i.addEventListener("squeezestart",ge),i.addEventListener("squeezeend",ge),i.addEventListener("end",I),i.addEventListener("inputsourceschange",W),w.xrCompatible!==!0&&await t.makeXRCompatible(),V=e.getPixelRatio(),e.getSize(z),R&&"createProjectionLayer"in XRWebGLBinding.prototype){let lt=null,Rt=null,Bt=null;w.depth&&(Bt=w.stencil?t.DEPTH24_STENCIL8:t.DEPTH_COMPONENT24,lt=w.stencil?cc:Eo,Rt=w.stencil?Qf:js);const tn={colorFormat:t.RGBA8,depthFormat:Bt,scaleFactor:o};v=this.getBinding(),y=v.createProjectionLayer(tn),i.updateRenderState({layers:[y]}),e.setPixelRatio(1),e.setSize(y.textureWidth,y.textureHeight,!1),N=new ds(y.textureWidth,y.textureHeight,{format:Zi,type:Ta,depthTexture:new Ch(y.textureWidth,y.textureHeight,Rt,void 0,void 0,void 0,void 0,void 0,void 0,lt),stencilBuffer:w.stencil,colorSpace:e.outputColorSpace,samples:w.antialias?4:0,resolveDepthBuffer:y.ignoreDepthValues===!1,resolveStencilBuffer:y.ignoreDepthValues===!1})}else{const lt={antialias:w.antialias,alpha:!0,depth:w.depth,stencil:w.stencil,framebufferScaleFactor:o};x=new XRWebGLLayer(i,t,lt),i.updateRenderState({baseLayer:x}),e.setPixelRatio(1),e.setSize(x.framebufferWidth,x.framebufferHeight,!1),N=new ds(x.framebufferWidth,x.framebufferHeight,{format:Zi,type:Ta,colorSpace:e.outputColorSpace,stencilBuffer:w.stencil,resolveDepthBuffer:x.ignoreDepthValues===!1,resolveStencilBuffer:x.ignoreDepthValues===!1})}N.isXRRenderTarget=!0,this.setFoveation(d),p=null,l=await i.requestReferenceSpace(h),ze.setContext(i),ze.start(),n.isPresenting=!0,n.dispatchEvent({type:"sessionstart"})}},this.getEnvironmentBlendMode=function(){if(i!==null)return i.environmentBlendMode},this.getDepthTexture=function(){return T.getDepthTexture()};function W(he){for(let Ee=0;Ee<he.removed.length;Ee++){const lt=he.removed[Ee],Rt=O.indexOf(lt);Rt>=0&&(O[Rt]=null,H[Rt].disconnect(lt))}for(let Ee=0;Ee<he.added.length;Ee++){const lt=he.added[Ee];let Rt=O.indexOf(lt);if(Rt===-1){for(let tn=0;tn<H.length;tn++)if(tn>=O.length){O.push(lt),Rt=tn;break}else if(O[tn]===null){O[tn]=lt,Rt=tn;break}if(Rt===-1)break}const Bt=H[Rt];Bt&&Bt.connect(lt)}}const ee=new Z,ye=new Z;function _e(he,Ee,lt){ee.setFromMatrixPosition(Ee.matrixWorld),ye.setFromMatrixPosition(lt.matrixWorld);const Rt=ee.distanceTo(ye),Bt=Ee.projectionMatrix.elements,tn=lt.projectionMatrix.elements,on=Bt[14]/(Bt[10]-1),Wt=Bt[14]/(Bt[10]+1),Ge=(Bt[9]+1)/Bt[5],et=(Bt[9]-1)/Bt[5],Je=(Bt[8]-1)/Bt[0],xt=(tn[8]+1)/tn[0],Q=on*Je,Dt=on*xt,mt=Rt/(-Je+xt),Ot=mt*-Je;if(Ee.matrixWorld.decompose(he.position,he.quaternion,he.scale),he.translateX(Ot),he.translateZ(mt),he.matrixWorld.compose(he.position,he.quaternion,he.scale),he.matrixWorldInverse.copy(he.matrixWorld).invert(),Bt[10]===-1)he.projectionMatrix.copy(Ee.projectionMatrix),he.projectionMatrixInverse.copy(Ee.projectionMatrixInverse);else{const gt=on+mt,j=Wt+mt,P=Q-Ot,de=Dt+(Rt-Ot),Fe=Ge*Wt/j*gt,ke=et*Wt/j*gt;he.projectionMatrix.makePerspective(P,de,Fe,ke,gt,j),he.projectionMatrixInverse.copy(he.projectionMatrix).invert()}}function X(he,Ee){Ee===null?he.matrixWorld.copy(he.matrix):he.matrixWorld.multiplyMatrices(Ee.matrixWorld,he.matrix),he.matrixWorldInverse.copy(he.matrixWorld).invert()}this.updateCamera=function(he){if(i===null)return;let Ee=he.near,lt=he.far;T.texture!==null&&(T.depthNear>0&&(Ee=T.depthNear),T.depthFar>0&&(lt=T.depthFar)),ne.near=F.near=U.near=Ee,ne.far=F.far=U.far=lt,($!==ne.near||ae!==ne.far)&&(i.updateRenderState({depthNear:ne.near,depthFar:ne.far}),$=ne.near,ae=ne.far),ne.layers.mask=he.layers.mask|6,U.layers.mask=ne.layers.mask&3,F.layers.mask=ne.layers.mask&5;const Rt=he.parent,Bt=ne.cameras;X(ne,Rt);for(let tn=0;tn<Bt.length;tn++)X(Bt[tn],Rt);Bt.length===2?_e(ne,U,F):ne.projectionMatrix.copy(U.projectionMatrix),te(he,ne,Rt)};function te(he,Ee,lt){lt===null?he.matrix.copy(Ee.matrixWorld):(he.matrix.copy(lt.matrixWorld),he.matrix.invert(),he.matrix.multiply(Ee.matrixWorld)),he.matrix.decompose(he.position,he.quaternion,he.scale),he.updateMatrixWorld(!0),he.projectionMatrix.copy(Ee.projectionMatrix),he.projectionMatrixInverse.copy(Ee.projectionMatrixInverse),he.isPerspectiveCamera&&(he.fov=nh*2*Math.atan(1/he.projectionMatrix.elements[5]),he.zoom=1)}this.getCamera=function(){return ne},this.getFoveation=function(){if(!(y===null&&x===null))return d},this.setFoveation=function(he){d=he,y!==null&&(y.fixedFoveation=he),x!==null&&x.fixedFoveation!==void 0&&(x.fixedFoveation=he)},this.hasDepthSensing=function(){return T.texture!==null},this.getDepthSensingMesh=function(){return T.getMesh(ne)},this.getCameraTexture=function(he){return M[he]};let le=null;function ve(he,Ee){if(_=Ee.getViewerPose(p||l),b=Ee,_!==null){const lt=_.views;x!==null&&(e.setRenderTargetFramebuffer(N,x.framebuffer),e.setRenderTarget(N));let Rt=!1;lt.length!==ne.cameras.length&&(ne.cameras.length=0,Rt=!0);for(let Wt=0;Wt<lt.length;Wt++){const Ge=lt[Wt];let et=null;if(x!==null)et=x.getViewport(Ge);else{const xt=v.getViewSubImage(y,Ge);et=xt.viewport,Wt===0&&(e.setRenderTargetTextures(N,xt.colorTexture,xt.depthStencilTexture),e.setRenderTarget(N))}let Je=K[Wt];Je===void 0&&(Je=new aa,Je.layers.enable(Wt),Je.viewport=new pi,K[Wt]=Je),Je.matrix.fromArray(Ge.transform.matrix),Je.matrix.decompose(Je.position,Je.quaternion,Je.scale),Je.projectionMatrix.fromArray(Ge.projectionMatrix),Je.projectionMatrixInverse.copy(Je.projectionMatrix).invert(),Je.viewport.set(et.x,et.y,et.width,et.height),Wt===0&&(ne.matrix.copy(Je.matrix),ne.matrix.decompose(ne.position,ne.quaternion,ne.scale)),Rt===!0&&ne.cameras.push(Je)}const Bt=i.enabledFeatures;if(Bt&&Bt.includes("depth-sensing")&&i.depthUsage=="gpu-optimized"&&R){v=n.getBinding();const Wt=v.getDepthInformation(lt[0]);Wt&&Wt.isValid&&Wt.texture&&T.init(Wt,i.renderState)}if(Bt&&Bt.includes("camera-access")&&R){e.state.unbindTexture(),v=n.getBinding();for(let Wt=0;Wt<lt.length;Wt++){const Ge=lt[Wt].camera;if(Ge){let et=M[Ge];et||(et=new kx,M[Ge]=et);const Je=v.getCameraImage(Ge);et.sourceTexture=Je}}}}for(let lt=0;lt<H.length;lt++){const Rt=O[lt],Bt=H[lt];Rt!==null&&Bt!==void 0&&Bt.update(Rt,Ee,p||l)}le&&le(he,Ee),Ee.detectedPlanes&&n.dispatchEvent({type:"planesdetected",data:Ee}),b=null}const ze=new mE;ze.setAnimationLoop(ve),this.setAnimationLoop=function(he){le=he},this.dispose=function(){}}}const Zu=new er,lL=new en;function cL(s,e){function t(T,M){T.matrixAutoUpdate===!0&&T.updateMatrix(),M.value.copy(T.matrix)}function n(T,M){M.color.getRGB(T.fogColor.value,Lb(s)),M.isFog?(T.fogNear.value=M.near,T.fogFar.value=M.far):M.isFogExp2&&(T.fogDensity.value=M.density)}function i(T,M,w,D,N){M.isMeshBasicMaterial||M.isMeshLambertMaterial?o(T,M):M.isMeshToonMaterial?(o(T,M),v(T,M)):M.isMeshPhongMaterial?(o(T,M),_(T,M)):M.isMeshStandardMaterial?(o(T,M),y(T,M),M.isMeshPhysicalMaterial&&x(T,M,N)):M.isMeshMatcapMaterial?(o(T,M),b(T,M)):M.isMeshDepthMaterial?o(T,M):M.isMeshDistanceMaterial?(o(T,M),R(T,M)):M.isMeshNormalMaterial?o(T,M):M.isLineBasicMaterial?(l(T,M),M.isLineDashedMaterial&&h(T,M)):M.isPointsMaterial?d(T,M,w,D):M.isSpriteMaterial?p(T,M):M.isShadowMaterial?(T.color.value.copy(M.color),T.opacity.value=M.opacity):M.isShaderMaterial&&(M.uniformsNeedUpdate=!1)}function o(T,M){T.opacity.value=M.opacity,M.color&&T.diffuse.value.copy(M.color),M.emissive&&T.emissive.value.copy(M.emissive).multiplyScalar(M.emissiveIntensity),M.map&&(T.map.value=M.map,t(M.map,T.mapTransform)),M.alphaMap&&(T.alphaMap.value=M.alphaMap,t(M.alphaMap,T.alphaMapTransform)),M.bumpMap&&(T.bumpMap.value=M.bumpMap,t(M.bumpMap,T.bumpMapTransform),T.bumpScale.value=M.bumpScale,M.side===fs&&(T.bumpScale.value*=-1)),M.normalMap&&(T.normalMap.value=M.normalMap,t(M.normalMap,T.normalMapTransform),T.normalScale.value.copy(M.normalScale),M.side===fs&&T.normalScale.value.negate()),M.displacementMap&&(T.displacementMap.value=M.displacementMap,t(M.displacementMap,T.displacementMapTransform),T.displacementScale.value=M.displacementScale,T.displacementBias.value=M.displacementBias),M.emissiveMap&&(T.emissiveMap.value=M.emissiveMap,t(M.emissiveMap,T.emissiveMapTransform)),M.specularMap&&(T.specularMap.value=M.specularMap,t(M.specularMap,T.specularMapTransform)),M.alphaTest>0&&(T.alphaTest.value=M.alphaTest);const w=e.get(M),D=w.envMap,N=w.envMapRotation;D&&(T.envMap.value=D,Zu.copy(N),Zu.x*=-1,Zu.y*=-1,Zu.z*=-1,D.isCubeTexture&&D.isRenderTargetTexture===!1&&(Zu.y*=-1,Zu.z*=-1),T.envMapRotation.value.setFromMatrix4(lL.makeRotationFromEuler(Zu)),T.flipEnvMap.value=D.isCubeTexture&&D.isRenderTargetTexture===!1?-1:1,T.reflectivity.value=M.reflectivity,T.ior.value=M.ior,T.refractionRatio.value=M.refractionRatio),M.lightMap&&(T.lightMap.value=M.lightMap,T.lightMapIntensity.value=M.lightMapIntensity,t(M.lightMap,T.lightMapTransform)),M.aoMap&&(T.aoMap.value=M.aoMap,T.aoMapIntensity.value=M.aoMapIntensity,t(M.aoMap,T.aoMapTransform))}function l(T,M){T.diffuse.value.copy(M.color),T.opacity.value=M.opacity,M.map&&(T.map.value=M.map,t(M.map,T.mapTransform))}function h(T,M){T.dashSize.value=M.dashSize,T.totalSize.value=M.dashSize+M.gapSize,T.scale.value=M.scale}function d(T,M,w,D){T.diffuse.value.copy(M.color),T.opacity.value=M.opacity,T.size.value=M.size*w,T.scale.value=D*.5,M.map&&(T.map.value=M.map,t(M.map,T.uvTransform)),M.alphaMap&&(T.alphaMap.value=M.alphaMap,t(M.alphaMap,T.alphaMapTransform)),M.alphaTest>0&&(T.alphaTest.value=M.alphaTest)}function p(T,M){T.diffuse.value.copy(M.color),T.opacity.value=M.opacity,T.rotation.value=M.rotation,M.map&&(T.map.value=M.map,t(M.map,T.mapTransform)),M.alphaMap&&(T.alphaMap.value=M.alphaMap,t(M.alphaMap,T.alphaMapTransform)),M.alphaTest>0&&(T.alphaTest.value=M.alphaTest)}function _(T,M){T.specular.value.copy(M.specular),T.shininess.value=Math.max(M.shininess,1e-4)}function v(T,M){M.gradientMap&&(T.gradientMap.value=M.gradientMap)}function y(T,M){T.metalness.value=M.metalness,M.metalnessMap&&(T.metalnessMap.value=M.metalnessMap,t(M.metalnessMap,T.metalnessMapTransform)),T.roughness.value=M.roughness,M.roughnessMap&&(T.roughnessMap.value=M.roughnessMap,t(M.roughnessMap,T.roughnessMapTransform)),M.envMap&&(T.envMapIntensity.value=M.envMapIntensity)}function x(T,M,w){T.ior.value=M.ior,M.sheen>0&&(T.sheenColor.value.copy(M.sheenColor).multiplyScalar(M.sheen),T.sheenRoughness.value=M.sheenRoughness,M.sheenColorMap&&(T.sheenColorMap.value=M.sheenColorMap,t(M.sheenColorMap,T.sheenColorMapTransform)),M.sheenRoughnessMap&&(T.sheenRoughnessMap.value=M.sheenRoughnessMap,t(M.sheenRoughnessMap,T.sheenRoughnessMapTransform))),M.clearcoat>0&&(T.clearcoat.value=M.clearcoat,T.clearcoatRoughness.value=M.clearcoatRoughness,M.clearcoatMap&&(T.clearcoatMap.value=M.clearcoatMap,t(M.clearcoatMap,T.clearcoatMapTransform)),M.clearcoatRoughnessMap&&(T.clearcoatRoughnessMap.value=M.clearcoatRoughnessMap,t(M.clearcoatRoughnessMap,T.clearcoatRoughnessMapTransform)),M.clearcoatNormalMap&&(T.clearcoatNormalMap.value=M.clearcoatNormalMap,t(M.clearcoatNormalMap,T.clearcoatNormalMapTransform),T.clearcoatNormalScale.value.copy(M.clearcoatNormalScale),M.side===fs&&T.clearcoatNormalScale.value.negate())),M.dispersion>0&&(T.dispersion.value=M.dispersion),M.iridescence>0&&(T.iridescence.value=M.iridescence,T.iridescenceIOR.value=M.iridescenceIOR,T.iridescenceThicknessMinimum.value=M.iridescenceThicknessRange[0],T.iridescenceThicknessMaximum.value=M.iridescenceThicknessRange[1],M.iridescenceMap&&(T.iridescenceMap.value=M.iridescenceMap,t(M.iridescenceMap,T.iridescenceMapTransform)),M.iridescenceThicknessMap&&(T.iridescenceThicknessMap.value=M.iridescenceThicknessMap,t(M.iridescenceThicknessMap,T.iridescenceThicknessMapTransform))),M.transmission>0&&(T.transmission.value=M.transmission,T.transmissionSamplerMap.value=w.texture,T.transmissionSamplerSize.value.set(w.width,w.height),M.transmissionMap&&(T.transmissionMap.value=M.transmissionMap,t(M.transmissionMap,T.transmissionMapTransform)),T.thickness.value=M.thickness,M.thicknessMap&&(T.thicknessMap.value=M.thicknessMap,t(M.thicknessMap,T.thicknessMapTransform)),T.attenuationDistance.value=M.attenuationDistance,T.attenuationColor.value.copy(M.attenuationColor)),M.anisotropy>0&&(T.anisotropyVector.value.set(M.anisotropy*Math.cos(M.anisotropyRotation),M.anisotropy*Math.sin(M.anisotropyRotation)),M.anisotropyMap&&(T.anisotropyMap.value=M.anisotropyMap,t(M.anisotropyMap,T.anisotropyMapTransform))),T.specularIntensity.value=M.specularIntensity,T.specularColor.value.copy(M.specularColor),M.specularColorMap&&(T.specularColorMap.value=M.specularColorMap,t(M.specularColorMap,T.specularColorMapTransform)),M.specularIntensityMap&&(T.specularIntensityMap.value=M.specularIntensityMap,t(M.specularIntensityMap,T.specularIntensityMapTransform))}function b(T,M){M.matcap&&(T.matcap.value=M.matcap)}function R(T,M){const w=e.get(M).light;T.referencePosition.value.setFromMatrixPosition(w.matrixWorld),T.nearDistance.value=w.shadow.camera.near,T.farDistance.value=w.shadow.camera.far}return{refreshFogUniforms:n,refreshMaterialUniforms:i}}function uL(s,e,t,n){let i={},o={},l=[];const h=s.getParameter(s.MAX_UNIFORM_BUFFER_BINDINGS);function d(w,D){const N=D.program;n.uniformBlockBinding(w,N)}function p(w,D){let N=i[w.id];N===void 0&&(b(w),N=_(w),i[w.id]=N,w.addEventListener("dispose",T));const H=D.program;n.updateUBOMapping(w,H);const O=e.render.frame;o[w.id]!==O&&(y(w),o[w.id]=O)}function _(w){const D=v();w.__bindingPointIndex=D;const N=s.createBuffer(),H=w.__size,O=w.usage;return s.bindBuffer(s.UNIFORM_BUFFER,N),s.bufferData(s.UNIFORM_BUFFER,H,O),s.bindBuffer(s.UNIFORM_BUFFER,null),s.bindBufferBase(s.UNIFORM_BUFFER,D,N),N}function v(){for(let w=0;w<h;w++)if(l.indexOf(w)===-1)return l.push(w),w;return Zt("WebGLRenderer: Maximum number of simultaneously usable uniforms groups reached."),0}function y(w){const D=i[w.id],N=w.uniforms,H=w.__cache;s.bindBuffer(s.UNIFORM_BUFFER,D);for(let O=0,z=N.length;O<z;O++){const V=Array.isArray(N[O])?N[O]:[N[O]];for(let U=0,F=V.length;U<F;U++){const K=V[U];if(x(K,O,U,H)===!0){const ne=K.__offset,$=Array.isArray(K.value)?K.value:[K.value];let ae=0;for(let ge=0;ge<$.length;ge++){const I=$[ge],W=R(I);typeof I=="number"||typeof I=="boolean"?(K.__data[0]=I,s.bufferSubData(s.UNIFORM_BUFFER,ne+ae,K.__data)):I.isMatrix3?(K.__data[0]=I.elements[0],K.__data[1]=I.elements[1],K.__data[2]=I.elements[2],K.__data[3]=0,K.__data[4]=I.elements[3],K.__data[5]=I.elements[4],K.__data[6]=I.elements[5],K.__data[7]=0,K.__data[8]=I.elements[6],K.__data[9]=I.elements[7],K.__data[10]=I.elements[8],K.__data[11]=0):(I.toArray(K.__data,ae),ae+=W.storage/Float32Array.BYTES_PER_ELEMENT)}s.bufferSubData(s.UNIFORM_BUFFER,ne,K.__data)}}}s.bindBuffer(s.UNIFORM_BUFFER,null)}function x(w,D,N,H){const O=w.value,z=D+"_"+N;if(H[z]===void 0)return typeof O=="number"||typeof O=="boolean"?H[z]=O:H[z]=O.clone(),!0;{const V=H[z];if(typeof O=="number"||typeof O=="boolean"){if(V!==O)return H[z]=O,!0}else if(V.equals(O)===!1)return V.copy(O),!0}return!1}function b(w){const D=w.uniforms;let N=0;const H=16;for(let z=0,V=D.length;z<V;z++){const U=Array.isArray(D[z])?D[z]:[D[z]];for(let F=0,K=U.length;F<K;F++){const ne=U[F],$=Array.isArray(ne.value)?ne.value:[ne.value];for(let ae=0,ge=$.length;ae<ge;ae++){const I=$[ae],W=R(I),ee=N%H,ye=ee%W.boundary,_e=ee+ye;N+=ye,_e!==0&&H-_e<W.storage&&(N+=H-_e),ne.__data=new Float32Array(W.storage/Float32Array.BYTES_PER_ELEMENT),ne.__offset=N,N+=W.storage}}}const O=N%H;return O>0&&(N+=H-O),w.__size=N,w.__cache={},this}function R(w){const D={boundary:0,storage:0};return typeof w=="number"||typeof w=="boolean"?(D.boundary=4,D.storage=4):w.isVector2?(D.boundary=8,D.storage=8):w.isVector3||w.isColor?(D.boundary=16,D.storage=12):w.isVector4?(D.boundary=16,D.storage=16):w.isMatrix3?(D.boundary=48,D.storage=48):w.isMatrix4?(D.boundary=64,D.storage=64):w.isTexture?Ut("WebGLRenderer: Texture samplers can not be part of an uniforms group."):Ut("WebGLRenderer: Unsupported uniform value type.",w),D}function T(w){const D=w.target;D.removeEventListener("dispose",T);const N=l.indexOf(D.__bindingPointIndex);l.splice(N,1),s.deleteBuffer(i[D.id]),delete i[D.id],delete o[D.id]}function M(){for(const w in i)s.deleteBuffer(i[w]);l=[],i={},o={}}return{bind:d,update:p,dispose:M}}const fL=new Uint16Array([12469,15057,12620,14925,13266,14620,13807,14376,14323,13990,14545,13625,14713,13328,14840,12882,14931,12528,14996,12233,15039,11829,15066,11525,15080,11295,15085,10976,15082,10705,15073,10495,13880,14564,13898,14542,13977,14430,14158,14124,14393,13732,14556,13410,14702,12996,14814,12596,14891,12291,14937,11834,14957,11489,14958,11194,14943,10803,14921,10506,14893,10278,14858,9960,14484,14039,14487,14025,14499,13941,14524,13740,14574,13468,14654,13106,14743,12678,14818,12344,14867,11893,14889,11509,14893,11180,14881,10751,14852,10428,14812,10128,14765,9754,14712,9466,14764,13480,14764,13475,14766,13440,14766,13347,14769,13070,14786,12713,14816,12387,14844,11957,14860,11549,14868,11215,14855,10751,14825,10403,14782,10044,14729,9651,14666,9352,14599,9029,14967,12835,14966,12831,14963,12804,14954,12723,14936,12564,14917,12347,14900,11958,14886,11569,14878,11247,14859,10765,14828,10401,14784,10011,14727,9600,14660,9289,14586,8893,14508,8533,15111,12234,15110,12234,15104,12216,15092,12156,15067,12010,15028,11776,14981,11500,14942,11205,14902,10752,14861,10393,14812,9991,14752,9570,14682,9252,14603,8808,14519,8445,14431,8145,15209,11449,15208,11451,15202,11451,15190,11438,15163,11384,15117,11274,15055,10979,14994,10648,14932,10343,14871,9936,14803,9532,14729,9218,14645,8742,14556,8381,14461,8020,14365,7603,15273,10603,15272,10607,15267,10619,15256,10631,15231,10614,15182,10535,15118,10389,15042,10167,14963,9787,14883,9447,14800,9115,14710,8665,14615,8318,14514,7911,14411,7507,14279,7198,15314,9675,15313,9683,15309,9712,15298,9759,15277,9797,15229,9773,15166,9668,15084,9487,14995,9274,14898,8910,14800,8539,14697,8234,14590,7790,14479,7409,14367,7067,14178,6621,15337,8619,15337,8631,15333,8677,15325,8769,15305,8871,15264,8940,15202,8909,15119,8775,15022,8565,14916,8328,14804,8009,14688,7614,14569,7287,14448,6888,14321,6483,14088,6171,15350,7402,15350,7419,15347,7480,15340,7613,15322,7804,15287,7973,15229,8057,15148,8012,15046,7846,14933,7611,14810,7357,14682,7069,14552,6656,14421,6316,14251,5948,14007,5528,15356,5942,15356,5977,15353,6119,15348,6294,15332,6551,15302,6824,15249,7044,15171,7122,15070,7050,14949,6861,14818,6611,14679,6349,14538,6067,14398,5651,14189,5311,13935,4958,15359,4123,15359,4153,15356,4296,15353,4646,15338,5160,15311,5508,15263,5829,15188,6042,15088,6094,14966,6001,14826,5796,14678,5543,14527,5287,14377,4985,14133,4586,13869,4257,15360,1563,15360,1642,15358,2076,15354,2636,15341,3350,15317,4019,15273,4429,15203,4732,15105,4911,14981,4932,14836,4818,14679,4621,14517,4386,14359,4156,14083,3795,13808,3437,15360,122,15360,137,15358,285,15355,636,15344,1274,15322,2177,15281,2765,15215,3223,15120,3451,14995,3569,14846,3567,14681,3466,14511,3305,14344,3121,14037,2800,13753,2467,15360,0,15360,1,15359,21,15355,89,15346,253,15325,479,15287,796,15225,1148,15133,1492,15008,1749,14856,1882,14685,1886,14506,1783,14324,1608,13996,1398,13702,1183]);let Do=null;function hL(){return Do===null&&(Do=new _r(fL,16,16,xu,ki),Do.name="DFG_LUT",Do.minFilter=Cn,Do.magFilter=Cn,Do.wrapS=Ei,Do.wrapT=Ei,Do.generateMipmaps=!1,Do.needsUpdate=!0),Do}class HA{constructor(e={}){const{canvas:t=mb(),context:n=null,depth:i=!0,stencil:o=!1,alpha:l=!1,antialias:h=!1,premultipliedAlpha:d=!0,preserveDrawingBuffer:p=!1,powerPreference:_="default",failIfMajorPerformanceCaveat:v=!1,reversedDepthBuffer:y=!1,outputBufferType:x=Ta}=e;this.isWebGLRenderer=!0;let b;if(n!==null){if(typeof WebGLRenderingContext<"u"&&n instanceof WebGLRenderingContext)throw new Error("THREE.WebGLRenderer: WebGL 1 is not supported since r163.");b=n.getContextAttributes().alpha}else b=l;const R=x,T=new Set([Vg,zg,ap]),M=new Set([Ta,js,Zf,Qf,Pg,Gg]),w=new Uint32Array(4),D=new Int32Array(4);let N=null,H=null;const O=[],z=[];let V=null;this.domElement=t,this.debug={checkShaderErrors:!0,onShaderError:null},this.autoClear=!0,this.autoClearColor=!0,this.autoClearDepth=!0,this.autoClearStencil=!0,this.sortObjects=!0,this.clippingPlanes=[],this.localClippingEnabled=!1,this.toneMapping=mr,this.toneMappingExposure=1,this.transmissionResolutionScale=1;const U=this;let F=!1;this._outputColorSpace=Xi;let K=0,ne=0,$=null,ae=-1,ge=null;const I=new pi,W=new pi;let ee=null;const ye=new Ct(0);let _e=0,X=t.width,te=t.height,le=1,ve=null,ze=null;const he=new pi(0,0,X,te),Ee=new pi(0,0,X,te);let lt=!1;const Rt=new Th;let Bt=!1,tn=!1;const on=new en,Wt=new Z,Ge=new pi,et={background:null,fog:null,environment:null,overrideMaterial:null,isScene:!0};let Je=!1;function xt(){return $===null?le:1}let Q=n;function Dt(k,ie){return t.getContext(k,ie)}try{const k={alpha:!0,depth:i,stencil:o,antialias:h,premultipliedAlpha:d,preserveDrawingBuffer:p,powerPreference:_,failIfMajorPerformanceCaveat:v};if("setAttribute"in t&&t.setAttribute("data-engine",`three.js r${Zd}`),t.addEventListener("webglcontextlost",nn,!1),t.addEventListener("webglcontextrestored",wn,!1),t.addEventListener("webglcontextcreationerror",Mn,!1),Q===null){const ie="webgl2";if(Q=Dt(ie,k),Q===null)throw Dt(ie)?new Error("Error creating WebGL context with your selected attributes."):new Error("Error creating WebGL context.")}}catch(k){throw Zt("WebGLRenderer: "+k.message),k}let mt,Ot,gt,j,P,de,Fe,ke,Ie,Ft,Mt,Ht,zt,Ye,qe,wt,bt,rt,Vt,fe,Ne,ot,Et,Qe;function We(){mt=new dN(Q),mt.init(),ot=new VE(Q,mt),Ot=new aN(Q,mt,e,ot),gt=new nL(Q,mt),Ot.reversedDepthBuffer&&y&>.buffers.depth.setReversed(!0),j=new gN(Q),P=new zU,de=new iL(Q,mt,gt,P,Ot,ot,j),Fe=new rN(U),ke=new hN(U),Ie=new e3(Q),Et=new nN(Q,Ie),Ft=new pN(Q,Ie,j,Et),Mt=new _N(Q,Ft,Ie,j),Vt=new vN(Q,Ot,de),wt=new sN(P),Ht=new GU(U,Fe,ke,mt,Ot,Et,wt),zt=new cL(U,P),Ye=new kU,qe=new WU(mt),rt=new tN(U,Fe,ke,gt,Mt,b,d),bt=new eL(U,Mt,Ot),Qe=new uL(Q,j,Ot,gt),fe=new iN(Q,mt,j),Ne=new mN(Q,mt,j),j.programs=Ht.programs,U.capabilities=Ot,U.extensions=mt,U.properties=P,U.renderLists=Ye,U.shadowMap=bt,U.state=gt,U.info=j}We(),R!==Ta&&(V=new xN(R,t.width,t.height,i,o));const _t=new oL(U,Q);this.xr=_t,this.getContext=function(){return Q},this.getContextAttributes=function(){return Q.getContextAttributes()},this.forceContextLoss=function(){const k=mt.get("WEBGL_lose_context");k&&k.loseContext()},this.forceContextRestore=function(){const k=mt.get("WEBGL_lose_context");k&&k.restoreContext()},this.getPixelRatio=function(){return le},this.setPixelRatio=function(k){k!==void 0&&(le=k,this.setSize(X,te,!1))},this.getSize=function(k){return k.set(X,te)},this.setSize=function(k,ie,ue=!0){if(_t.isPresenting){Ut("WebGLRenderer: Can't change size while VR device is presenting.");return}X=k,te=ie,t.width=Math.floor(k*le),t.height=Math.floor(ie*le),ue===!0&&(t.style.width=k+"px",t.style.height=ie+"px"),V!==null&&V.setSize(t.width,t.height),this.setViewport(0,0,k,ie)},this.getDrawingBufferSize=function(k){return k.set(X*le,te*le).floor()},this.setDrawingBufferSize=function(k,ie,ue){X=k,te=ie,le=ue,t.width=Math.floor(k*ue),t.height=Math.floor(ie*ue),this.setViewport(0,0,k,ie)},this.setEffects=function(k){if(R===Ta){console.error("THREE.WebGLRenderer: setEffects() requires outputBufferType set to HalfFloatType or FloatType.");return}if(k){for(let ie=0;ie<k.length;ie++)if(k[ie].isOutputPass===!0){console.warn("THREE.WebGLRenderer: OutputPass is not needed in setEffects(). Tone mapping and color space conversion are applied automatically.");break}}V.setEffects(k||[])},this.getCurrentViewport=function(k){return k.copy(I)},this.getViewport=function(k){return k.copy(he)},this.setViewport=function(k,ie,ue,pe){k.isVector4?he.set(k.x,k.y,k.z,k.w):he.set(k,ie,ue,pe),gt.viewport(I.copy(he).multiplyScalar(le).round())},this.getScissor=function(k){return k.copy(Ee)},this.setScissor=function(k,ie,ue,pe){k.isVector4?Ee.set(k.x,k.y,k.z,k.w):Ee.set(k,ie,ue,pe),gt.scissor(W.copy(Ee).multiplyScalar(le).round())},this.getScissorTest=function(){return lt},this.setScissorTest=function(k){gt.setScissorTest(lt=k)},this.setOpaqueSort=function(k){ve=k},this.setTransparentSort=function(k){ze=k},this.getClearColor=function(k){return k.copy(rt.getClearColor())},this.setClearColor=function(){rt.setClearColor(...arguments)},this.getClearAlpha=function(){return rt.getClearAlpha()},this.setClearAlpha=function(){rt.setClearAlpha(...arguments)},this.clear=function(k=!0,ie=!0,ue=!0){let pe=0;if(k){let ce=!1;if($!==null){const it=$.texture.format;ce=T.has(it)}if(ce){const it=$.texture.type,ut=M.has(it),ht=rt.getClearColor(),xe=rt.getClearAlpha(),we=ht.r,je=ht.g,He=ht.b;ut?(w[0]=we,w[1]=je,w[2]=He,w[3]=xe,Q.clearBufferuiv(Q.COLOR,0,w)):(D[0]=we,D[1]=je,D[2]=He,D[3]=xe,Q.clearBufferiv(Q.COLOR,0,D))}else pe|=Q.COLOR_BUFFER_BIT}ie&&(pe|=Q.DEPTH_BUFFER_BIT),ue&&(pe|=Q.STENCIL_BUFFER_BIT,this.state.buffers.stencil.setMask(4294967295)),Q.clear(pe)},this.clearColor=function(){this.clear(!0,!1,!1)},this.clearDepth=function(){this.clear(!1,!0,!1)},this.clearStencil=function(){this.clear(!1,!1,!0)},this.dispose=function(){t.removeEventListener("webglcontextlost",nn,!1),t.removeEventListener("webglcontextrestored",wn,!1),t.removeEventListener("webglcontextcreationerror",Mn,!1),rt.dispose(),Ye.dispose(),qe.dispose(),P.dispose(),Fe.dispose(),ke.dispose(),Mt.dispose(),Et.dispose(),Qe.dispose(),Ht.dispose(),_t.dispose(),_t.removeEventListener("sessionstart",Da),_t.removeEventListener("sessionend",wi),kt.stop()};function nn(k){k.preventDefault(),mp("WebGLRenderer: Context Lost."),F=!0}function wn(){mp("WebGLRenderer: Context Restored."),F=!1;const k=j.autoReset,ie=bt.enabled,ue=bt.autoUpdate,pe=bt.needsUpdate,ce=bt.type;We(),j.autoReset=k,bt.enabled=ie,bt.autoUpdate=ue,bt.needsUpdate=pe,bt.type=ce}function Mn(k){Zt("WebGLRenderer: A WebGL context could not be created. Reason: ",k.statusMessage)}function Fi(k){const ie=k.target;ie.removeEventListener("dispose",Fi),va(ie)}function va(k){br(k),P.remove(k)}function br(k){const ie=P.get(k).programs;ie!==void 0&&(ie.forEach(function(ue){Ht.releaseProgram(ue)}),k.isShaderMaterial&&Ht.releaseShaderCache(k))}this.renderBufferDirect=function(k,ie,ue,pe,ce,it){ie===null&&(ie=et);const ut=ce.isMesh&&ce.matrixWorld.determinant()<0,ht=ct(k,ie,ue,pe,ce);gt.setMaterial(pe,ut);let xe=ue.index,we=1;if(pe.wireframe===!0){if(xe=Ft.getWireframeAttribute(ue),xe===void 0)return;we=2}const je=ue.drawRange,He=ue.attributes.position;let Ve=je.start*we,At=(je.start+je.count)*we;it!==null&&(Ve=Math.max(Ve,it.start*we),At=Math.min(At,(it.start+it.count)*we)),xe!==null?(Ve=Math.max(Ve,0),At=Math.min(At,xe.count)):He!=null&&(Ve=Math.max(Ve,0),At=Math.min(At,He.count));const Yt=At-Ve;if(Yt<0||Yt===1/0)return;Et.setup(ce,pe,ht,ue,xe);let Jt,Tt=fe;if(xe!==null&&(Jt=Ie.get(xe),Tt=Ne,Tt.setIndex(Jt)),ce.isMesh)pe.wireframe===!0?(gt.setLineWidth(pe.wireframeLinewidth*xt()),Tt.setMode(Q.LINES)):Tt.setMode(Q.TRIANGLES);else if(ce.isLine){let ft=pe.linewidth;ft===void 0&&(ft=1),gt.setLineWidth(ft*xt()),ce.isLineSegments?Tt.setMode(Q.LINES):ce.isLineLoop?Tt.setMode(Q.LINE_LOOP):Tt.setMode(Q.LINE_STRIP)}else ce.isPoints?Tt.setMode(Q.POINTS):ce.isSprite&&Tt.setMode(Q.TRIANGLES);if(ce.isBatchedMesh)if(ce._multiDrawInstances!==null)th("WebGLRenderer: renderMultiDrawInstances has been deprecated and will be removed in r184. Append to renderMultiDraw arguments and use indirection."),Tt.renderMultiDrawInstances(ce._multiDrawStarts,ce._multiDrawCounts,ce._multiDrawCount,ce._multiDrawInstances);else if(mt.get("WEBGL_multi_draw"))Tt.renderMultiDraw(ce._multiDrawStarts,ce._multiDrawCounts,ce._multiDrawCount);else{const ft=ce._multiDrawStarts,Nt=ce._multiDrawCounts,vt=ce._multiDrawCount,un=xe?Ie.get(xe).bytesPerElement:1,Wn=P.get(pe).currentProgram.getUniforms();for(let an=0;an<vt;an++)Wn.setValue(Q,"_gl_DrawID",an),Tt.render(ft[an]/un,Nt[an])}else if(ce.isInstancedMesh)Tt.renderInstances(Ve,Yt,ce.count);else if(ue.isInstancedBufferGeometry){const ft=ue._maxInstanceCount!==void 0?ue._maxInstanceCount:1/0,Nt=Math.min(ue.instanceCount,ft);Tt.renderInstances(Ve,Yt,Nt)}else Tt.render(Ve,Yt)};function ir(k,ie,ue){k.transparent===!0&&k.side===Ws&&k.forceSinglePass===!1?(k.side=fs,k.needsUpdate=!0,Te(k,ie,ue),k.side=Yr,k.needsUpdate=!0,Te(k,ie,ue),k.side=Ws):Te(k,ie,ue)}this.compile=function(k,ie,ue=null){ue===null&&(ue=k),H=qe.get(ue),H.init(ie),z.push(H),ue.traverseVisible(function(ce){ce.isLight&&ce.layers.test(ie.layers)&&(H.pushLight(ce),ce.castShadow&&H.pushShadow(ce))}),k!==ue&&k.traverseVisible(function(ce){ce.isLight&&ce.layers.test(ie.layers)&&(H.pushLight(ce),ce.castShadow&&H.pushShadow(ce))}),H.setupLights();const pe=new Set;return k.traverse(function(ce){if(!(ce.isMesh||ce.isPoints||ce.isLine||ce.isSprite))return;const it=ce.material;if(it)if(Array.isArray(it))for(let ut=0;ut<it.length;ut++){const ht=it[ut];ir(ht,ue,ce),pe.add(ht)}else ir(it,ue,ce),pe.add(it)}),H=z.pop(),pe},this.compileAsync=function(k,ie,ue=null){const pe=this.compile(k,ie,ue);return new Promise(ce=>{function it(){if(pe.forEach(function(ut){P.get(ut).currentProgram.isReady()&&pe.delete(ut)}),pe.size===0){ce(k);return}setTimeout(it,10)}mt.get("KHR_parallel_shader_compile")!==null?it():setTimeout(it,10)})};let _a=null;function sa(k){_a&&_a(k)}function Da(){kt.stop()}function wi(){kt.start()}const kt=new mE;kt.setAnimationLoop(sa),typeof self<"u"&&kt.setContext(self),this.setAnimationLoop=function(k){_a=k,_t.setAnimationLoop(k),k===null?kt.stop():kt.start()},_t.addEventListener("sessionstart",Da),_t.addEventListener("sessionend",wi),this.render=function(k,ie){if(ie!==void 0&&ie.isCamera!==!0){Zt("WebGLRenderer.render: camera is not an instance of THREE.Camera.");return}if(F===!0)return;const ue=_t.enabled===!0&&_t.isPresenting===!0,pe=V!==null&&($===null||ue)&&V.begin(U,$);if(k.matrixWorldAutoUpdate===!0&&k.updateMatrixWorld(),ie.parent===null&&ie.matrixWorldAutoUpdate===!0&&ie.updateMatrixWorld(),_t.enabled===!0&&_t.isPresenting===!0&&(V===null||V.isCompositing()===!1)&&(_t.cameraAutoUpdate===!0&&_t.updateCamera(ie),ie=_t.getCamera()),k.isScene===!0&&k.onBeforeRender(U,k,ie,$),H=qe.get(k,z.length),H.init(ie),z.push(H),on.multiplyMatrices(ie.projectionMatrix,ie.matrixWorldInverse),Rt.setFromProjectionMatrix(on,Zs,ie.reversedDepth),tn=this.localClippingEnabled,Bt=wt.init(this.clippingPlanes,tn),N=Ye.get(k,O.length),N.init(),O.push(N),_t.enabled===!0&&_t.isPresenting===!0){const ut=U.xr.getDepthSensingMesh();ut!==null&&Ai(ut,ie,-1/0,U.sortObjects)}Ai(k,ie,0,U.sortObjects),N.finish(),U.sortObjects===!0&&N.sort(ve,ze),Je=_t.enabled===!1||_t.isPresenting===!1||_t.hasDepthSensing()===!1,Je&&rt.addToRenderList(N,k),this.info.render.frame++,Bt===!0&&wt.beginShadows();const ce=H.state.shadowsArray;if(bt.render(ce,k,ie),Bt===!0&&wt.endShadows(),this.info.autoReset===!0&&this.info.reset(),(pe&&V.hasRenderPass())===!1){const ut=N.opaque,ht=N.transmissive;if(H.setupLights(),ie.isArrayCamera){const xe=ie.cameras;if(ht.length>0)for(let we=0,je=xe.length;we<je;we++){const He=xe[we];G(ut,ht,k,He)}Je&&rt.render(k);for(let we=0,je=xe.length;we<je;we++){const He=xe[we];mn(N,k,He,He.viewport)}}else ht.length>0&&G(ut,ht,k,ie),Je&&rt.render(k),mn(N,k,ie)}$!==null&&ne===0&&(de.updateMultisampleRenderTarget($),de.updateRenderTargetMipmap($)),pe&&V.end(U),k.isScene===!0&&k.onAfterRender(U,k,ie),Et.resetDefaultState(),ae=-1,ge=null,z.pop(),z.length>0?(H=z[z.length-1],Bt===!0&&wt.setGlobalState(U.clippingPlanes,H.state.camera)):H=null,O.pop(),O.length>0?N=O[O.length-1]:N=null};function Ai(k,ie,ue,pe){if(k.visible===!1)return;if(k.layers.test(ie.layers)){if(k.isGroup)ue=k.renderOrder;else if(k.isLOD)k.autoUpdate===!0&&k.update(ie);else if(k.isLight)H.pushLight(k),k.castShadow&&H.pushShadow(k);else if(k.isSprite){if(!k.frustumCulled||Rt.intersectsSprite(k)){pe&&Ge.setFromMatrixPosition(k.matrixWorld).applyMatrix4(on);const ut=Mt.update(k),ht=k.material;ht.visible&&N.push(k,ut,ht,ue,Ge.z,null)}}else if((k.isMesh||k.isLine||k.isPoints)&&(!k.frustumCulled||Rt.intersectsObject(k))){const ut=Mt.update(k),ht=k.material;if(pe&&(k.boundingSphere!==void 0?(k.boundingSphere===null&&k.computeBoundingSphere(),Ge.copy(k.boundingSphere.center)):(ut.boundingSphere===null&&ut.computeBoundingSphere(),Ge.copy(ut.boundingSphere.center)),Ge.applyMatrix4(k.matrixWorld).applyMatrix4(on)),Array.isArray(ht)){const xe=ut.groups;for(let we=0,je=xe.length;we<je;we++){const He=xe[we],Ve=ht[He.materialIndex];Ve&&Ve.visible&&N.push(k,ut,Ve,ue,Ge.z,He)}}else ht.visible&&N.push(k,ut,ht,ue,Ge.z,null)}}const it=k.children;for(let ut=0,ht=it.length;ut<ht;ut++)Ai(it[ut],ie,ue,pe)}function mn(k,ie,ue,pe){const{opaque:ce,transmissive:it,transparent:ut}=k;H.setupLightsView(ue),Bt===!0&&wt.setGlobalState(U.clippingPlanes,ue),pe&>.viewport(I.copy(pe)),ce.length>0&&q(ce,ie,ue),it.length>0&&q(it,ie,ue),ut.length>0&&q(ut,ie,ue),gt.buffers.depth.setTest(!0),gt.buffers.depth.setMask(!0),gt.buffers.color.setMask(!0),gt.setPolygonOffset(!1)}function G(k,ie,ue,pe){if((ue.isScene===!0?ue.overrideMaterial:null)!==null)return;if(H.state.transmissionRenderTarget[pe.id]===void 0){const Ve=mt.has("EXT_color_buffer_half_float")||mt.has("EXT_color_buffer_float");H.state.transmissionRenderTarget[pe.id]=new ds(1,1,{generateMipmaps:!0,type:Ve?ki:Ta,minFilter:Is,samples:Ot.samples,stencilBuffer:o,resolveDepthBuffer:!1,resolveStencilBuffer:!1,colorSpace:Bn.workingColorSpace})}const it=H.state.transmissionRenderTarget[pe.id],ut=pe.viewport||I;it.setSize(ut.z*U.transmissionResolutionScale,ut.w*U.transmissionResolutionScale);const ht=U.getRenderTarget(),xe=U.getActiveCubeFace(),we=U.getActiveMipmapLevel();U.setRenderTarget(it),U.getClearColor(ye),_e=U.getClearAlpha(),_e<1&&U.setClearColor(16777215,.5),U.clear(),Je&&rt.render(ue);const je=U.toneMapping;U.toneMapping=mr;const He=pe.viewport;if(pe.viewport!==void 0&&(pe.viewport=void 0),H.setupLightsView(pe),Bt===!0&&wt.setGlobalState(U.clippingPlanes,pe),q(k,ue,pe),de.updateMultisampleRenderTarget(it),de.updateRenderTargetMipmap(it),mt.has("WEBGL_multisampled_render_to_texture")===!1){let Ve=!1;for(let At=0,Yt=ie.length;At<Yt;At++){const Jt=ie[At],{object:Tt,geometry:ft,material:Nt,group:vt}=Jt;if(Nt.side===Ws&&Tt.layers.test(pe.layers)){const un=Nt.side;Nt.side=fs,Nt.needsUpdate=!0,oe(Tt,ue,pe,ft,Nt,vt),Nt.side=un,Nt.needsUpdate=!0,Ve=!0}}Ve===!0&&(de.updateMultisampleRenderTarget(it),de.updateRenderTargetMipmap(it))}U.setRenderTarget(ht,xe,we),U.setClearColor(ye,_e),He!==void 0&&(pe.viewport=He),U.toneMapping=je}function q(k,ie,ue){const pe=ie.isScene===!0?ie.overrideMaterial:null;for(let ce=0,it=k.length;ce<it;ce++){const ut=k[ce],{object:ht,geometry:xe,group:we}=ut;let je=ut.material;je.allowOverride===!0&&pe!==null&&(je=pe),ht.layers.test(ue.layers)&&oe(ht,ie,ue,xe,je,we)}}function oe(k,ie,ue,pe,ce,it){k.onBeforeRender(U,ie,ue,pe,ce,it),k.modelViewMatrix.multiplyMatrices(ue.matrixWorldInverse,k.matrixWorld),k.normalMatrix.getNormalMatrix(k.modelViewMatrix),ce.onBeforeRender(U,ie,ue,pe,k,it),ce.transparent===!0&&ce.side===Ws&&ce.forceSinglePass===!1?(ce.side=fs,ce.needsUpdate=!0,U.renderBufferDirect(ue,ie,pe,ce,k,it),ce.side=Yr,ce.needsUpdate=!0,U.renderBufferDirect(ue,ie,pe,ce,k,it),ce.side=Ws):U.renderBufferDirect(ue,ie,pe,ce,k,it),k.onAfterRender(U,ie,ue,pe,ce,it)}function Te(k,ie,ue){ie.isScene!==!0&&(ie=et);const pe=P.get(k),ce=H.state.lights,it=H.state.shadowsArray,ut=ce.state.version,ht=Ht.getParameters(k,ce.state,it,ie,ue),xe=Ht.getProgramCacheKey(ht);let we=pe.programs;pe.environment=k.isMeshStandardMaterial?ie.environment:null,pe.fog=ie.fog,pe.envMap=(k.isMeshStandardMaterial?ke:Fe).get(k.envMap||pe.environment),pe.envMapRotation=pe.environment!==null&&k.envMap===null?ie.environmentRotation:k.envMapRotation,we===void 0&&(k.addEventListener("dispose",Fi),we=new Map,pe.programs=we);let je=we.get(xe);if(je!==void 0){if(pe.currentProgram===je&&pe.lightsStateVersion===ut)return Ue(k,ht),je}else ht.uniforms=Ht.getUniforms(k),k.onBeforeCompile(ht,U),je=Ht.acquireProgram(ht,xe),we.set(xe,je),pe.uniforms=ht.uniforms;const He=pe.uniforms;return(!k.isShaderMaterial&&!k.isRawShaderMaterial||k.clipping===!0)&&(He.clippingPlanes=wt.uniform),Ue(k,ht),pe.needsLights=st(k),pe.lightsStateVersion=ut,pe.needsLights&&(He.ambientLightColor.value=ce.state.ambient,He.lightProbe.value=ce.state.probe,He.directionalLights.value=ce.state.directional,He.directionalLightShadows.value=ce.state.directionalShadow,He.spotLights.value=ce.state.spot,He.spotLightShadows.value=ce.state.spotShadow,He.rectAreaLights.value=ce.state.rectArea,He.ltc_1.value=ce.state.rectAreaLTC1,He.ltc_2.value=ce.state.rectAreaLTC2,He.pointLights.value=ce.state.point,He.pointLightShadows.value=ce.state.pointShadow,He.hemisphereLights.value=ce.state.hemi,He.directionalShadowMap.value=ce.state.directionalShadowMap,He.directionalShadowMatrix.value=ce.state.directionalShadowMatrix,He.spotShadowMap.value=ce.state.spotShadowMap,He.spotLightMatrix.value=ce.state.spotLightMatrix,He.spotLightMap.value=ce.state.spotLightMap,He.pointShadowMap.value=ce.state.pointShadowMap,He.pointShadowMatrix.value=ce.state.pointShadowMatrix),pe.currentProgram=je,pe.uniformsList=null,je}function Le(k){if(k.uniformsList===null){const ie=k.currentProgram.getUniforms();k.uniformsList=Zv.seqWithValue(ie.seq,k.uniforms)}return k.uniformsList}function Ue(k,ie){const ue=P.get(k);ue.outputColorSpace=ie.outputColorSpace,ue.batching=ie.batching,ue.batchingColor=ie.batchingColor,ue.instancing=ie.instancing,ue.instancingColor=ie.instancingColor,ue.instancingMorph=ie.instancingMorph,ue.skinning=ie.skinning,ue.morphTargets=ie.morphTargets,ue.morphNormals=ie.morphNormals,ue.morphColors=ie.morphColors,ue.morphTargetsCount=ie.morphTargetsCount,ue.numClippingPlanes=ie.numClippingPlanes,ue.numIntersection=ie.numClipIntersection,ue.vertexAlphas=ie.vertexAlphas,ue.vertexTangents=ie.vertexTangents,ue.toneMapping=ie.toneMapping}function ct(k,ie,ue,pe,ce){ie.isScene!==!0&&(ie=et),de.resetTextureUnits();const it=ie.fog,ut=pe.isMeshStandardMaterial?ie.environment:null,ht=$===null?U.outputColorSpace:$.isXRRenderTarget===!0?$.texture.colorSpace:na,xe=(pe.isMeshStandardMaterial?ke:Fe).get(pe.envMap||ut),we=pe.vertexColors===!0&&!!ue.attributes.color&&ue.attributes.color.itemSize===4,je=!!ue.attributes.tangent&&(!!pe.normalMap||pe.anisotropy>0),He=!!ue.morphAttributes.position,Ve=!!ue.morphAttributes.normal,At=!!ue.morphAttributes.color;let Yt=mr;pe.toneMapped&&($===null||$.isXRRenderTarget===!0)&&(Yt=U.toneMapping);const Jt=ue.morphAttributes.position||ue.morphAttributes.normal||ue.morphAttributes.color,Tt=Jt!==void 0?Jt.length:0,ft=P.get(pe),Nt=H.state.lights;if(Bt===!0&&(tn===!0||k!==ge)){const ri=k===ge&&pe.id===ae;wt.setState(pe,k,ri)}let vt=!1;pe.version===ft.__version?(ft.needsLights&&ft.lightsStateVersion!==Nt.state.version||ft.outputColorSpace!==ht||ce.isBatchedMesh&&ft.batching===!1||!ce.isBatchedMesh&&ft.batching===!0||ce.isBatchedMesh&&ft.batchingColor===!0&&ce.colorTexture===null||ce.isBatchedMesh&&ft.batchingColor===!1&&ce.colorTexture!==null||ce.isInstancedMesh&&ft.instancing===!1||!ce.isInstancedMesh&&ft.instancing===!0||ce.isSkinnedMesh&&ft.skinning===!1||!ce.isSkinnedMesh&&ft.skinning===!0||ce.isInstancedMesh&&ft.instancingColor===!0&&ce.instanceColor===null||ce.isInstancedMesh&&ft.instancingColor===!1&&ce.instanceColor!==null||ce.isInstancedMesh&&ft.instancingMorph===!0&&ce.morphTexture===null||ce.isInstancedMesh&&ft.instancingMorph===!1&&ce.morphTexture!==null||ft.envMap!==xe||pe.fog===!0&&ft.fog!==it||ft.numClippingPlanes!==void 0&&(ft.numClippingPlanes!==wt.numPlanes||ft.numIntersection!==wt.numIntersection)||ft.vertexAlphas!==we||ft.vertexTangents!==je||ft.morphTargets!==He||ft.morphNormals!==Ve||ft.morphColors!==At||ft.toneMapping!==Yt||ft.morphTargetsCount!==Tt)&&(vt=!0):(vt=!0,ft.__version=pe.version);let un=ft.currentProgram;vt===!0&&(un=Te(pe,ie,ce));let Wn=!1,an=!1,Xn=!1;const rn=un.getUniforms(),Pn=ft.uniforms;if(gt.useProgram(un.program)&&(Wn=!0,an=!0,Xn=!0),pe.id!==ae&&(ae=pe.id,an=!0),Wn||ge!==k){gt.buffers.depth.getReversed()&&k.reversedDepth!==!0&&(k._reversedDepth=!0,k.updateProjectionMatrix()),rn.setValue(Q,"projectionMatrix",k.projectionMatrix),rn.setValue(Q,"viewMatrix",k.matrixWorldInverse);const Si=rn.map.cameraPosition;Si!==void 0&&Si.setValue(Q,Wt.setFromMatrixPosition(k.matrixWorld)),Ot.logarithmicDepthBuffer&&rn.setValue(Q,"logDepthBufFC",2/(Math.log(k.far+1)/Math.LN2)),(pe.isMeshPhongMaterial||pe.isMeshToonMaterial||pe.isMeshLambertMaterial||pe.isMeshBasicMaterial||pe.isMeshStandardMaterial||pe.isShaderMaterial)&&rn.setValue(Q,"isOrthographic",k.isOrthographicCamera===!0),ge!==k&&(ge=k,an=!0,Xn=!0)}if(ft.needsLights&&(Nt.state.directionalShadowMap.length>0&&rn.setValue(Q,"directionalShadowMap",Nt.state.directionalShadowMap,de),Nt.state.spotShadowMap.length>0&&rn.setValue(Q,"spotShadowMap",Nt.state.spotShadowMap,de),Nt.state.pointShadowMap.length>0&&rn.setValue(Q,"pointShadowMap",Nt.state.pointShadowMap,de)),ce.isSkinnedMesh){rn.setOptional(Q,ce,"bindMatrix"),rn.setOptional(Q,ce,"bindMatrixInverse");const ri=ce.skeleton;ri&&(ri.boneTexture===null&&ri.computeBoneTexture(),rn.setValue(Q,"boneTexture",ri.boneTexture,de))}ce.isBatchedMesh&&(rn.setOptional(Q,ce,"batchingTexture"),rn.setValue(Q,"batchingTexture",ce._matricesTexture,de),rn.setOptional(Q,ce,"batchingIdTexture"),rn.setValue(Q,"batchingIdTexture",ce._indirectTexture,de),rn.setOptional(Q,ce,"batchingColorTexture"),ce._colorsTexture!==null&&rn.setValue(Q,"batchingColorTexture",ce._colorsTexture,de));const jn=ue.morphAttributes;if((jn.position!==void 0||jn.normal!==void 0||jn.color!==void 0)&&Vt.update(ce,ue,un),(an||ft.receiveShadow!==ce.receiveShadow)&&(ft.receiveShadow=ce.receiveShadow,rn.setValue(Q,"receiveShadow",ce.receiveShadow)),pe.isMeshGouraudMaterial&&pe.envMap!==null&&(Pn.envMap.value=xe,Pn.flipEnvMap.value=xe.isCubeTexture&&xe.isRenderTargetTexture===!1?-1:1),pe.isMeshStandardMaterial&&pe.envMap===null&&ie.environment!==null&&(Pn.envMapIntensity.value=ie.environmentIntensity),Pn.dfgLUT!==void 0&&(Pn.dfgLUT.value=hL()),an&&(rn.setValue(Q,"toneMappingExposure",U.toneMappingExposure),ft.needsLights&&at(Pn,Xn),it&&pe.fog===!0&&zt.refreshFogUniforms(Pn,it),zt.refreshMaterialUniforms(Pn,pe,le,te,H.state.transmissionRenderTarget[k.id]),Zv.upload(Q,Le(ft),Pn,de)),pe.isShaderMaterial&&pe.uniformsNeedUpdate===!0&&(Zv.upload(Q,Le(ft),Pn,de),pe.uniformsNeedUpdate=!1),pe.isSpriteMaterial&&rn.setValue(Q,"center",ce.center),rn.setValue(Q,"modelViewMatrix",ce.modelViewMatrix),rn.setValue(Q,"normalMatrix",ce.normalMatrix),rn.setValue(Q,"modelMatrix",ce.matrixWorld),pe.isShaderMaterial||pe.isRawShaderMaterial){const ri=pe.uniformsGroups;for(let Si=0,Er=ri.length;Si<Er;Si++){const _s=ri[Si];Qe.update(_s,un),Qe.bind(_s,un)}}return un}function at(k,ie){k.ambientLightColor.needsUpdate=ie,k.lightProbe.needsUpdate=ie,k.directionalLights.needsUpdate=ie,k.directionalLightShadows.needsUpdate=ie,k.pointLights.needsUpdate=ie,k.pointLightShadows.needsUpdate=ie,k.spotLights.needsUpdate=ie,k.spotLightShadows.needsUpdate=ie,k.rectAreaLights.needsUpdate=ie,k.hemisphereLights.needsUpdate=ie}function st(k){return k.isMeshLambertMaterial||k.isMeshToonMaterial||k.isMeshPhongMaterial||k.isMeshStandardMaterial||k.isShadowMaterial||k.isShaderMaterial&&k.lights===!0}this.getActiveCubeFace=function(){return K},this.getActiveMipmapLevel=function(){return ne},this.getRenderTarget=function(){return $},this.setRenderTargetTextures=function(k,ie,ue){const pe=P.get(k);pe.__autoAllocateDepthBuffer=k.resolveDepthBuffer===!1,pe.__autoAllocateDepthBuffer===!1&&(pe.__useRenderToTexture=!1),P.get(k.texture).__webglTexture=ie,P.get(k.depthTexture).__webglTexture=pe.__autoAllocateDepthBuffer?void 0:ue,pe.__hasExternalTextures=!0},this.setRenderTargetFramebuffer=function(k,ie){const ue=P.get(k);ue.__webglFramebuffer=ie,ue.__useDefaultFramebuffer=ie===void 0};const tt=Q.createFramebuffer();this.setRenderTarget=function(k,ie=0,ue=0){$=k,K=ie,ne=ue;let pe=null,ce=!1,it=!1;if(k){const ht=P.get(k);if(ht.__useDefaultFramebuffer!==void 0){gt.bindFramebuffer(Q.FRAMEBUFFER,ht.__webglFramebuffer),I.copy(k.viewport),W.copy(k.scissor),ee=k.scissorTest,gt.viewport(I),gt.scissor(W),gt.setScissorTest(ee),ae=-1;return}else if(ht.__webglFramebuffer===void 0)de.setupRenderTarget(k);else if(ht.__hasExternalTextures)de.rebindTextures(k,P.get(k.texture).__webglTexture,P.get(k.depthTexture).__webglTexture);else if(k.depthBuffer){const je=k.depthTexture;if(ht.__boundDepthTexture!==je){if(je!==null&&P.has(je)&&(k.width!==je.image.width||k.height!==je.image.height))throw new Error("WebGLRenderTarget: Attached DepthTexture is initialized to the incorrect size.");de.setupDepthRenderbuffer(k)}}const xe=k.texture;(xe.isData3DTexture||xe.isDataArrayTexture||xe.isCompressedArrayTexture)&&(it=!0);const we=P.get(k).__webglFramebuffer;k.isWebGLCubeRenderTarget?(Array.isArray(we[ie])?pe=we[ie][ue]:pe=we[ie],ce=!0):k.samples>0&&de.useMultisampledRTT(k)===!1?pe=P.get(k).__webglMultisampledFramebuffer:Array.isArray(we)?pe=we[ue]:pe=we,I.copy(k.viewport),W.copy(k.scissor),ee=k.scissorTest}else I.copy(he).multiplyScalar(le).floor(),W.copy(Ee).multiplyScalar(le).floor(),ee=lt;if(ue!==0&&(pe=tt),gt.bindFramebuffer(Q.FRAMEBUFFER,pe)&>.drawBuffers(k,pe),gt.viewport(I),gt.scissor(W),gt.setScissorTest(ee),ce){const ht=P.get(k.texture);Q.framebufferTexture2D(Q.FRAMEBUFFER,Q.COLOR_ATTACHMENT0,Q.TEXTURE_CUBE_MAP_POSITIVE_X+ie,ht.__webglTexture,ue)}else if(it){const ht=ie;for(let xe=0;xe<k.textures.length;xe++){const we=P.get(k.textures[xe]);Q.framebufferTextureLayer(Q.FRAMEBUFFER,Q.COLOR_ATTACHMENT0+xe,we.__webglTexture,ue,ht)}}else if(k!==null&&ue!==0){const ht=P.get(k.texture);Q.framebufferTexture2D(Q.FRAMEBUFFER,Q.COLOR_ATTACHMENT0,Q.TEXTURE_2D,ht.__webglTexture,ue)}ae=-1},this.readRenderTargetPixels=function(k,ie,ue,pe,ce,it,ut,ht=0){if(!(k&&k.isWebGLRenderTarget)){Zt("WebGLRenderer.readRenderTargetPixels: renderTarget is not THREE.WebGLRenderTarget.");return}let xe=P.get(k).__webglFramebuffer;if(k.isWebGLCubeRenderTarget&&ut!==void 0&&(xe=xe[ut]),xe){gt.bindFramebuffer(Q.FRAMEBUFFER,xe);try{const we=k.textures[ht],je=we.format,He=we.type;if(!Ot.textureFormatReadable(je)){Zt("WebGLRenderer.readRenderTargetPixels: renderTarget is not in RGBA or implementation defined format.");return}if(!Ot.textureTypeReadable(He)){Zt("WebGLRenderer.readRenderTargetPixels: renderTarget is not in UnsignedByteType or implementation defined type.");return}ie>=0&&ie<=k.width-pe&&ue>=0&&ue<=k.height-ce&&(k.textures.length>1&&Q.readBuffer(Q.COLOR_ATTACHMENT0+ht),Q.readPixels(ie,ue,pe,ce,ot.convert(je),ot.convert(He),it))}finally{const we=$!==null?P.get($).__webglFramebuffer:null;gt.bindFramebuffer(Q.FRAMEBUFFER,we)}}},this.readRenderTargetPixelsAsync=async function(k,ie,ue,pe,ce,it,ut,ht=0){if(!(k&&k.isWebGLRenderTarget))throw new Error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not THREE.WebGLRenderTarget.");let xe=P.get(k).__webglFramebuffer;if(k.isWebGLCubeRenderTarget&&ut!==void 0&&(xe=xe[ut]),xe)if(ie>=0&&ie<=k.width-pe&&ue>=0&&ue<=k.height-ce){gt.bindFramebuffer(Q.FRAMEBUFFER,xe);const we=k.textures[ht],je=we.format,He=we.type;if(!Ot.textureFormatReadable(je))throw new Error("THREE.WebGLRenderer.readRenderTargetPixelsAsync: renderTarget is not in RGBA or implementation defined format.");if(!Ot.textureTypeReadable(He))throw new Error("THREE.WebGLRenderer.readRenderTargetPixelsAsync: renderTarget is not in UnsignedByteType or implementation defined type.");const Ve=Q.createBuffer();Q.bindBuffer(Q.PIXEL_PACK_BUFFER,Ve),Q.bufferData(Q.PIXEL_PACK_BUFFER,it.byteLength,Q.STREAM_READ),k.textures.length>1&&Q.readBuffer(Q.COLOR_ATTACHMENT0+ht),Q.readPixels(ie,ue,pe,ce,ot.convert(je),ot.convert(He),0);const At=$!==null?P.get($).__webglFramebuffer:null;gt.bindFramebuffer(Q.FRAMEBUFFER,At);const Yt=Q.fenceSync(Q.SYNC_GPU_COMMANDS_COMPLETE,0);return Q.flush(),await o2(Q,Yt,4),Q.bindBuffer(Q.PIXEL_PACK_BUFFER,Ve),Q.getBufferSubData(Q.PIXEL_PACK_BUFFER,0,it),Q.deleteBuffer(Ve),Q.deleteSync(Yt),it}else throw new Error("THREE.WebGLRenderer.readRenderTargetPixelsAsync: requested read bounds are out of range.")},this.copyFramebufferToTexture=function(k,ie=null,ue=0){const pe=Math.pow(2,-ue),ce=Math.floor(k.image.width*pe),it=Math.floor(k.image.height*pe),ut=ie!==null?ie.x:0,ht=ie!==null?ie.y:0;de.setTexture2D(k,0),Q.copyTexSubImage2D(Q.TEXTURE_2D,ue,0,0,ut,ht,ce,it),gt.unbindTexture()};const yt=Q.createFramebuffer(),dt=Q.createFramebuffer();this.copyTextureToTexture=function(k,ie,ue=null,pe=null,ce=0,it=null){it===null&&(ce!==0?(th("WebGLRenderer: copyTextureToTexture function signature has changed to support src and dst mipmap levels."),it=ce,ce=0):it=0);let ut,ht,xe,we,je,He,Ve,At,Yt;const Jt=k.isCompressedTexture?k.mipmaps[it]:k.image;if(ue!==null)ut=ue.max.x-ue.min.x,ht=ue.max.y-ue.min.y,xe=ue.isBox3?ue.max.z-ue.min.z:1,we=ue.min.x,je=ue.min.y,He=ue.isBox3?ue.min.z:0;else{const jn=Math.pow(2,-ce);ut=Math.floor(Jt.width*jn),ht=Math.floor(Jt.height*jn),k.isDataArrayTexture?xe=Jt.depth:k.isData3DTexture?xe=Math.floor(Jt.depth*jn):xe=1,we=0,je=0,He=0}pe!==null?(Ve=pe.x,At=pe.y,Yt=pe.z):(Ve=0,At=0,Yt=0);const Tt=ot.convert(ie.format),ft=ot.convert(ie.type);let Nt;ie.isData3DTexture?(de.setTexture3D(ie,0),Nt=Q.TEXTURE_3D):ie.isDataArrayTexture||ie.isCompressedArrayTexture?(de.setTexture2DArray(ie,0),Nt=Q.TEXTURE_2D_ARRAY):(de.setTexture2D(ie,0),Nt=Q.TEXTURE_2D),Q.pixelStorei(Q.UNPACK_FLIP_Y_WEBGL,ie.flipY),Q.pixelStorei(Q.UNPACK_PREMULTIPLY_ALPHA_WEBGL,ie.premultiplyAlpha),Q.pixelStorei(Q.UNPACK_ALIGNMENT,ie.unpackAlignment);const vt=Q.getParameter(Q.UNPACK_ROW_LENGTH),un=Q.getParameter(Q.UNPACK_IMAGE_HEIGHT),Wn=Q.getParameter(Q.UNPACK_SKIP_PIXELS),an=Q.getParameter(Q.UNPACK_SKIP_ROWS),Xn=Q.getParameter(Q.UNPACK_SKIP_IMAGES);Q.pixelStorei(Q.UNPACK_ROW_LENGTH,Jt.width),Q.pixelStorei(Q.UNPACK_IMAGE_HEIGHT,Jt.height),Q.pixelStorei(Q.UNPACK_SKIP_PIXELS,we),Q.pixelStorei(Q.UNPACK_SKIP_ROWS,je),Q.pixelStorei(Q.UNPACK_SKIP_IMAGES,He);const rn=k.isDataArrayTexture||k.isData3DTexture,Pn=ie.isDataArrayTexture||ie.isData3DTexture;if(k.isDepthTexture){const jn=P.get(k),ri=P.get(ie),Si=P.get(jn.__renderTarget),Er=P.get(ri.__renderTarget);gt.bindFramebuffer(Q.READ_FRAMEBUFFER,Si.__webglFramebuffer),gt.bindFramebuffer(Q.DRAW_FRAMEBUFFER,Er.__webglFramebuffer);for(let _s=0;_s<xe;_s++)rn&&(Q.framebufferTextureLayer(Q.READ_FRAMEBUFFER,Q.COLOR_ATTACHMENT0,P.get(k).__webglTexture,ce,He+_s),Q.framebufferTextureLayer(Q.DRAW_FRAMEBUFFER,Q.COLOR_ATTACHMENT0,P.get(ie).__webglTexture,it,Yt+_s)),Q.blitFramebuffer(we,je,ut,ht,Ve,At,ut,ht,Q.DEPTH_BUFFER_BIT,Q.NEAREST);gt.bindFramebuffer(Q.READ_FRAMEBUFFER,null),gt.bindFramebuffer(Q.DRAW_FRAMEBUFFER,null)}else if(ce!==0||k.isRenderTargetTexture||P.has(k)){const jn=P.get(k),ri=P.get(ie);gt.bindFramebuffer(Q.READ_FRAMEBUFFER,yt),gt.bindFramebuffer(Q.DRAW_FRAMEBUFFER,dt);for(let Si=0;Si<xe;Si++)rn?Q.framebufferTextureLayer(Q.READ_FRAMEBUFFER,Q.COLOR_ATTACHMENT0,jn.__webglTexture,ce,He+Si):Q.framebufferTexture2D(Q.READ_FRAMEBUFFER,Q.COLOR_ATTACHMENT0,Q.TEXTURE_2D,jn.__webglTexture,ce),Pn?Q.framebufferTextureLayer(Q.DRAW_FRAMEBUFFER,Q.COLOR_ATTACHMENT0,ri.__webglTexture,it,Yt+Si):Q.framebufferTexture2D(Q.DRAW_FRAMEBUFFER,Q.COLOR_ATTACHMENT0,Q.TEXTURE_2D,ri.__webglTexture,it),ce!==0?Q.blitFramebuffer(we,je,ut,ht,Ve,At,ut,ht,Q.COLOR_BUFFER_BIT,Q.NEAREST):Pn?Q.copyTexSubImage3D(Nt,it,Ve,At,Yt+Si,we,je,ut,ht):Q.copyTexSubImage2D(Nt,it,Ve,At,we,je,ut,ht);gt.bindFramebuffer(Q.READ_FRAMEBUFFER,null),gt.bindFramebuffer(Q.DRAW_FRAMEBUFFER,null)}else Pn?k.isDataTexture||k.isData3DTexture?Q.texSubImage3D(Nt,it,Ve,At,Yt,ut,ht,xe,Tt,ft,Jt.data):ie.isCompressedArrayTexture?Q.compressedTexSubImage3D(Nt,it,Ve,At,Yt,ut,ht,xe,Tt,Jt.data):Q.texSubImage3D(Nt,it,Ve,At,Yt,ut,ht,xe,Tt,ft,Jt):k.isDataTexture?Q.texSubImage2D(Q.TEXTURE_2D,it,Ve,At,ut,ht,Tt,ft,Jt.data):k.isCompressedTexture?Q.compressedTexSubImage2D(Q.TEXTURE_2D,it,Ve,At,Jt.width,Jt.height,Tt,Jt.data):Q.texSubImage2D(Q.TEXTURE_2D,it,Ve,At,ut,ht,Tt,ft,Jt);Q.pixelStorei(Q.UNPACK_ROW_LENGTH,vt),Q.pixelStorei(Q.UNPACK_IMAGE_HEIGHT,un),Q.pixelStorei(Q.UNPACK_SKIP_PIXELS,Wn),Q.pixelStorei(Q.UNPACK_SKIP_ROWS,an),Q.pixelStorei(Q.UNPACK_SKIP_IMAGES,Xn),it===0&&ie.generateMipmaps&&Q.generateMipmap(Nt),gt.unbindTexture()},this.initRenderTarget=function(k){P.get(k).__webglFramebuffer===void 0&&de.setupRenderTarget(k)},this.initTexture=function(k){k.isCubeTexture?de.setTextureCube(k,0):k.isData3DTexture?de.setTexture3D(k,0):k.isDataArrayTexture||k.isCompressedArrayTexture?de.setTexture2DArray(k,0):de.setTexture2D(k,0),gt.unbindTexture()},this.resetState=function(){K=0,ne=0,$=null,gt.reset(),Et.reset()},typeof __THREE_DEVTOOLS__<"u"&&__THREE_DEVTOOLS__.dispatchEvent(new CustomEvent("observe",{detail:this}))}get coordinateSystem(){return Zs}get outputColorSpace(){return this._outputColorSpace}set outputColorSpace(e){this._outputColorSpace=e;const t=this.getContext();t.drawingBufferColorSpace=Bn._getDrawingBufferColorSpace(e),t.unpackColorSpace=Bn._getUnpackColorSpace()}}const dL=Object.freeze(Object.defineProperty({__proto__:null,ACESFilmicToneMapping:Ig,AddEquation:sc,AddOperation:tb,AdditiveAnimationBlendMode:rx,AdditiveBlending:Yy,AgXToneMapping:Qy,AlphaFormat:ax,AlwaysCompare:hb,AlwaysDepth:Bg,AlwaysStencilFunc:lx,AmbientLight:k1,AnimationAction:nE,AnimationClip:Vu,AnimationLoader:Ww,AnimationMixer:iE,AnimationObjectGroup:_B,AnimationUtils:Yw,ArcCurve:f1,ArrayCamera:Q1,ArrowHelper:YB,AttachedBindMode:ex,Audio:$1,AudioAnalyser:lB,AudioContext:gA,AudioListener:sB,AudioLoader:nB,AxesHelper:JB,BackSide:fs,BasicDepthPacking:sb,BasicShadowMap:OM,BatchedMesh:t1,Bone:Cp,BooleanKeyframeTrack:Gu,Box2:wB,Box3:Ra,Box3Helper:kB,BoxGeometry:Du,BoxHelper:VB,BufferAttribute:Hn,BufferGeometry:pn,BufferGeometryLoader:q1,ByteType:Fg,Cache:Bo,Camera:X0,CameraHelper:zB,CanvasTexture:pw,CapsuleGeometry:gv,CatmullRomCurve3:h1,CineonToneMapping:jy,CircleGeometry:vv,ClampToEdgeWrapping:Ei,Clock:vA,Color:Ct,ColorKeyframeTrack:lA,ColorManagement:Bn,CompressedArrayTexture:hw,CompressedCubeTexture:dw,CompressedTexture:mv,CompressedTextureLoader:jw,ConeGeometry:Lp,ConstantAlphaFactor:QM,ConstantColorFactor:jM,Controls:KB,CubeCamera:Hb,CubeDepthTexture:c1,CubeReflectionMapping:qr,CubeRefractionMapping:oc,CubeTexture:Sp,CubeTextureLoader:P1,CubeUVReflectionMapping:jf,CubicBezierCurve:Wx,CubicBezierCurve3:p1,CubicInterpolant:O1,CullFaceBack:Xy,CullFaceFront:LM,CullFaceFrontBack:AR,CullFaceNone:UM,Curve:Qr,CurvePath:g1,CustomBlending:IM,CustomToneMapping:Zy,CylinderGeometry:Up,Cylindrical:RB,Data3DTexture:C0,DataArrayTexture:T0,DataTexture:_r,DataTextureLoader:cA,DataUtils:wu,DecrementStencilOp:OR,DecrementWrapStencilOp:FR,DefaultLoadingManager:H1,DepthFormat:Eo,DepthStencilFormat:cc,DepthTexture:Ch,DetachedBindMode:nb,DirectionalLight:Pv,DirectionalLightHelper:GB,DiscreteInterpolant:I1,DodecahedronGeometry:_v,DoubleSide:Ws,DstAlphaFactor:YM,DstColorFactor:qM,DynamicCopyUsage:QR,DynamicDrawUsage:JR,DynamicReadUsage:WR,EdgesGeometry:u1,EllipseCurve:Sv,EqualCompare:cb,EqualDepth:Ng,EqualStencilFunc:zR,EquirectangularReflectionMapping:Wf,EquirectangularRefractionMapping:ep,Euler:er,EventDispatcher:To,ExternalTexture:kx,ExtrudeGeometry:Rv,FileLoader:da,Float16BufferAttribute:X2,Float32BufferAttribute:Xt,FloatType:Ci,Fog:K0,FogExp2:q0,FramebufferTexture:fw,FrontSide:Yr,Frustum:Th,FrustumArray:av,GLBufferAttribute:bB,GLSL1:e2,GLSL3:cx,GreaterCompare:ub,GreaterDepth:Lg,GreaterEqualCompare:b0,GreaterEqualDepth:Ug,GreaterEqualStencilFunc:YR,GreaterStencilFunc:kR,GridHelper:HB,Group:vr,HalfFloatType:ki,HemisphereLight:G1,HemisphereLightHelper:FB,IcosahedronGeometry:zp,ImageBitmapLoader:mA,ImageLoader:Xp,ImageUtils:Ab,IncrementStencilOp:LR,IncrementWrapStencilOp:IR,InstancedBufferAttribute:xc,InstancedBufferGeometry:J1,InstancedInterleavedBuffer:MB,InstancedMesh:nv,Int16BufferAttribute:V2,Int32BufferAttribute:k2,Int8BufferAttribute:P2,IntType:np,InterleavedBuffer:yh,InterleavedBufferAttribute:Al,Interpolant:Pu,InterpolateDiscrete:Au,InterpolateLinear:uc,InterpolateSmooth:A0,InterpolationSamplingMode:i2,InterpolationSamplingType:n2,InvertStencilOp:HR,KeepStencilOp:Eu,KeyframeTrack:xr,LOD:Xb,LatheGeometry:wv,Layers:uh,LessCompare:lb,LessDepth:Dg,LessEqualCompare:M0,LessEqualDepth:vu,LessEqualStencilFunc:VR,LessStencilFunc:GR,Light:bc,LightProbe:Y1,Line:wo,Line3:NB,LineBasicMaterial:za,LineCurve:jx,LineCurve3:m1,LineDashedMaterial:U1,LineLoop:fv,LineSegments:yr,LinearFilter:Cn,LinearInterpolant:oA,LinearMipMapLinearFilter:tx,LinearMipMapNearestFilter:bR,LinearMipmapLinearFilter:Is,LinearMipmapNearestFilter:yu,LinearSRGBColorSpace:na,LinearToneMapping:Ky,LinearTransfer:hp,Loader:Ba,LoaderUtils:nr,LoadingManager:Iv,LoopOnce:cp,LoopPingPong:ab,LoopRepeat:ib,MOUSE:yR,Material:Yi,MaterialLoader:Gv,MathUtils:E0,Matrix2:bA,Matrix3:yn,Matrix4:en,MaxEquation:GM,Mesh:yi,MeshBasicMaterial:ha,MeshDepthMaterial:iA,MeshDistanceMaterial:aA,MeshLambertMaterial:D1,MeshMatcapMaterial:N1,MeshNormalMaterial:B1,MeshPhongMaterial:R1,MeshPhysicalMaterial:Ji,MeshStandardMaterial:Fu,MeshToonMaterial:w1,MinEquation:PM,MirroredRepeatWrapping:_u,MixOperation:eb,MultiplyBlending:qy,MultiplyOperation:$d,NearestFilter:Ti,NearestMipMapLinearFilter:MR,NearestMipMapNearestFilter:SR,NearestMipmapLinearFilter:lc,NearestMipmapNearestFilter:tp,NeutralToneMapping:$y,NeverCompare:ob,NeverDepth:wg,NeverStencilFunc:PR,NoBlending:Jr,NoColorSpace:dl,NoNormalPacking:wR,NoToneMapping:mr,NormalAnimationBlendMode:S0,NormalBlending:gu,NormalGAPacking:DR,NormalRGPacking:BR,NotEqualCompare:fb,NotEqualDepth:Og,NotEqualStencilFunc:XR,NumberKeyframeTrack:Sl,Object3D:Un,ObjectLoader:eB,ObjectSpaceNormalMap:rb,OctahedronGeometry:Vp,OneFactor:VM,OneMinusConstantAlphaFactor:$M,OneMinusConstantColorFactor:ZM,OneMinusDstAlphaFactor:JM,OneMinusDstColorFactor:KM,OneMinusSrcAlphaFactor:Rg,OneMinusSrcColorFactor:XM,OrthographicCamera:Tl,PCFShadowMap:Kf,PCFSoftShadowMap:Qd,PMREMGenerator:UA,Path:Ev,PerspectiveCamera:aa,Plane:Ac,PlaneGeometry:Mc,PlaneHelper:XB,PointLight:Hv,PointLightHelper:OB,Points:pv,PointsMaterial:Np,PolarGridHelper:PB,PolyhedronGeometry:Sc,PositionalAudio:oB,PropertyBinding:kn,PropertyMixer:tE,QuadraticBezierCurve:Zx,QuadraticBezierCurve3:Qx,Quaternion:Ca,QuaternionKeyframeTrack:Ml,QuaternionLinearInterpolant:F1,R11_EAC_Format:jg,RED_GREEN_RGTC2_Format:y0,RED_RGTC1_Format:v0,REVISION:Zd,RG11_EAC_Format:Qg,RGBADepthPacking:TR,RGBAFormat:Zi,RGBAIntegerFormat:Vg,RGBA_ASTC_10x10_Format:f0,RGBA_ASTC_10x5_Format:l0,RGBA_ASTC_10x6_Format:c0,RGBA_ASTC_10x8_Format:u0,RGBA_ASTC_12x10_Format:h0,RGBA_ASTC_12x12_Format:d0,RGBA_ASTC_4x4_Format:e0,RGBA_ASTC_5x4_Format:t0,RGBA_ASTC_5x5_Format:n0,RGBA_ASTC_6x5_Format:i0,RGBA_ASTC_6x6_Format:a0,RGBA_ASTC_8x5_Format:s0,RGBA_ASTC_8x6_Format:r0,RGBA_ASTC_8x8_Format:o0,RGBA_BPTC_Format:p0,RGBA_ETC2_EAC_Format:Wg,RGBA_PVRTC_2BPPV1_Format:Jg,RGBA_PVRTC_4BPPV1_Format:Yg,RGBA_S3TC_DXT1_Format:rp,RGBA_S3TC_DXT3_Format:op,RGBA_S3TC_DXT5_Format:lp,RGBDepthPacking:CR,RGBFormat:sx,RGBIntegerFormat:ER,RGB_BPTC_SIGNED_Format:m0,RGB_BPTC_UNSIGNED_Format:g0,RGB_ETC1_Format:qg,RGB_ETC2_Format:Kg,RGB_PVRTC_2BPPV1_Format:Xg,RGB_PVRTC_4BPPV1_Format:kg,RGB_S3TC_DXT1_Format:sp,RGDepthPacking:RR,RGFormat:xu,RGIntegerFormat:zg,RawShaderMaterial:nA,Ray:lh,Raycaster:SA,RectAreaLight:X1,RedFormat:ip,RedIntegerFormat:ap,ReinhardToneMapping:Wy,RenderTarget:mx,RenderTarget3D:xB,RepeatWrapping:Kr,ReplaceStencilOp:UR,ReverseSubtractEquation:HM,RingGeometry:Bv,SIGNED_R11_EAC_Format:Zg,SIGNED_RED_GREEN_RGTC2_Format:x0,SIGNED_RED_RGTC1_Format:_0,SIGNED_RG11_EAC_Format:$g,SRGBColorSpace:Xi,SRGBTransfer:si,Scene:Mp,ShaderChunk:bn,ShaderLib:eo,ShaderMaterial:ms,ShadowMaterial:C1,Shape:Ou,ShapeGeometry:Dv,ShapePath:qB,ShapeUtils:$r,ShortType:Hg,Skeleton:bh,SkeletonHelper:LB,SkinnedMesh:ev,Source:dc,Sphere:fa,SphereGeometry:kp,Spherical:CB,SphericalHarmonics3:dA,SplineCurve:$x,SpotLight:Fv,SpotLightHelper:UB,Sprite:Vb,SpriteMaterial:Lx,SrcAlphaFactor:Cg,SrcAlphaSaturateFactor:WM,SrcColorFactor:kM,StaticCopyUsage:ZR,StaticDrawUsage:dp,StaticReadUsage:KR,StereoCamera:iB,StreamCopyUsage:$R,StreamDrawUsage:qR,StreamReadUsage:jR,StringKeyframeTrack:zu,SubtractEquation:FM,SubtractiveBlending:Jy,TOUCH:xR,TangentSpaceNormalMap:fc,TetrahedronGeometry:Nv,Texture:Qn,TextureLoader:uA,TextureUtils:$B,Timer:EB,TimestampQuery:t2,TorusGeometry:Uv,TorusKnotGeometry:Lv,Triangle:Fs,TriangleFanDrawMode:bu,TriangleStripDrawMode:fp,TrianglesDrawMode:ox,TubeGeometry:Ov,UVMapping:rc,Uint16BufferAttribute:Bx,Uint32BufferAttribute:Dx,Uint8BufferAttribute:G2,Uint8ClampedBufferAttribute:z2,Uniform:AA,UniformsGroup:SB,UniformsLib:Lt,UniformsUtils:Ob,UnsignedByteType:Ta,UnsignedInt101111Type:ix,UnsignedInt248Type:Qf,UnsignedInt5999Type:nx,UnsignedIntType:js,UnsignedShort4444Type:Pg,UnsignedShort5551Type:Gg,UnsignedShortType:Zf,VSMShadowMap:mu,Vector2:nt,Vector3:Z,Vector4:pi,VectorKeyframeTrack:bl,VideoFrameTexture:uw,VideoTexture:l1,WebGL3DRenderTarget:R2,WebGLArrayRenderTarget:C2,WebGLCoordinateSystem:Zs,WebGLCubeRenderTarget:Y0,WebGLRenderTarget:ds,WebGLRenderer:HA,WebGLUtils:VE,WebGPUCoordinateSystem:$f,WebXRController:J0,WireframeGeometry:b1,WrapAroundEnding:up,ZeroCurvatureEnding:Su,ZeroFactor:zM,ZeroSlopeEnding:Mu,ZeroStencilOp:NR,createCanvasElement:mb,error:Zt,getConsoleFunction:r2,log:mp,setConsoleFunction:s2,warn:Ut,warnOnce:th},Symbol.toStringTag,{value:"Module"}));var PA={exports:{}},Cl={};var kE;function pL(){return kE||(kE=1,Cl.ConcurrentRoot=1,Cl.ContinuousEventPriority=8,Cl.DefaultEventPriority=32,Cl.DiscreteEventPriority=2,Cl.IdleEventPriority=268435456,Cl.LegacyRoot=0,Cl.NoEventPriority=0),Cl}var XE;function mL(){return XE||(XE=1,PA.exports=pL()),PA.exports}var $v=mL(),GA={exports:{}},zA={},VA={exports:{}},kA={};var YE;function gL(){if(YE)return kA;YE=1;var s=qf();function e(v,y){return v===y&&(v!==0||1/v===1/y)||v!==v&&y!==y}var t=typeof Object.is=="function"?Object.is:e,n=s.useState,i=s.useEffect,o=s.useLayoutEffect,l=s.useDebugValue;function h(v,y){var x=y(),b=n({inst:{value:x,getSnapshot:y}}),R=b[0].inst,T=b[1];return o(function(){R.value=x,R.getSnapshot=y,d(R)&&T({inst:R})},[v,x,y]),i(function(){return d(R)&&T({inst:R}),v(function(){d(R)&&T({inst:R})})},[v]),l(x),x}function d(v){var y=v.getSnapshot;v=v.value;try{var x=y();return!t(v,x)}catch{return!0}}function p(v,y){return y()}var _=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?p:h;return kA.useSyncExternalStore=s.useSyncExternalStore!==void 0?s.useSyncExternalStore:_,kA}var JE;function vL(){return JE||(JE=1,VA.exports=gL()),VA.exports}var qE;function _L(){if(qE)return zA;qE=1;var s=qf(),e=vL();function t(p,_){return p===_&&(p!==0||1/p===1/_)||p!==p&&_!==_}var n=typeof Object.is=="function"?Object.is:t,i=e.useSyncExternalStore,o=s.useRef,l=s.useEffect,h=s.useMemo,d=s.useDebugValue;return zA.useSyncExternalStoreWithSelector=function(p,_,v,y,x){var b=o(null);if(b.current===null){var R={hasValue:!1,value:null};b.current=R}else R=b.current;b=h(function(){function M(O){if(!w){if(w=!0,D=O,O=y(O),x!==void 0&&R.hasValue){var z=R.value;if(x(z,O))return N=z}return N=O}if(z=N,n(D,O))return z;var V=y(O);return x!==void 0&&x(z,V)?(D=O,z):(D=O,N=V)}var w=!1,D,N,H=v===void 0?null:v;return[function(){return M(_())},H===null?void 0:function(){return M(H())}]},[_,v,y,x]);var T=i(p,b[0],b[1]);return l(function(){R.hasValue=!0,R.value=T},[T]),d(T),T},zA}var KE;function yL(){return KE||(KE=1,GA.exports=_L()),GA.exports}var xL=yL();const AL=Iy(xL),WE=s=>{let e;const t=new Set,n=(p,_)=>{const v=typeof p=="function"?p(e):p;if(!Object.is(v,e)){const y=e;e=_??(typeof v!="object"||v===null)?v:Object.assign({},e,v),t.forEach(x=>x(e,y))}},i=()=>e,h={setState:n,getState:i,getInitialState:()=>d,subscribe:p=>(t.add(p),()=>t.delete(p))},d=e=s(n,i,h);return h},SL=(s=>s?WE(s):WE),{useSyncExternalStoreWithSelector:ML}=AL,bL=s=>s;function EL(s,e=bL,t){const n=ML(s.subscribe,s.getState,s.getInitialState,e,t);return bM.useDebugValue(n),n}const jE=(s,e)=>{const t=SL(s),n=(i,o=e)=>EL(t,i,o);return Object.assign(n,t),n},ZE=((s,e)=>s?jE(s,e):jE),TL=s=>typeof s=="object"&&typeof s.then=="function",Qu=[];function QE(s,e,t=(n,i)=>n===i){if(s===e)return!0;if(!s||!e)return!1;const n=s.length;if(e.length!==n)return!1;for(let i=0;i<n;i++)if(!t(s[i],e[i]))return!1;return!0}function $E(s,e=null,t=!1,n={}){e===null&&(e=[s]);for(const o of Qu)if(QE(e,o.keys,o.equal)){if(t)return;if(Object.prototype.hasOwnProperty.call(o,"error"))throw o.error;if(Object.prototype.hasOwnProperty.call(o,"response"))return n.lifespan&&n.lifespan>0&&(o.timeout&&clearTimeout(o.timeout),o.timeout=setTimeout(o.remove,n.lifespan)),o.response;if(!t)throw o.promise}const i={keys:e,equal:n.equal,remove:()=>{const o=Qu.indexOf(i);o!==-1&&Qu.splice(o,1)},promise:(TL(s)?s:s(...e)).then(o=>{i.response=o,n.lifespan&&n.lifespan>0&&(i.timeout=setTimeout(i.remove,n.lifespan))}).catch(o=>i.error=o)};if(Qu.push(i),!t)throw i.promise}const CL=(s,e,t)=>$E(s,e,!1,t),RL=(s,e,t)=>{$E(s,e,!0,t)},wL=s=>{if(s===void 0||s.length===0)Qu.splice(0,Qu.length);else{const e=Qu.find(t=>QE(s,t.keys,t.equal));e&&e.remove()}};var XA={exports:{}},YA={exports:{}},JA={exports:{}},qA={};var eT;function BL(){return eT||(eT=1,(function(s){function e(I,W){var ee=I.length;I.push(W);e:for(;0<ee;){var ye=ee-1>>>1,_e=I[ye];if(0<i(_e,W))I[ye]=W,I[ee]=_e,ee=ye;else break e}}function t(I){return I.length===0?null:I[0]}function n(I){if(I.length===0)return null;var W=I[0],ee=I.pop();if(ee!==W){I[0]=ee;e:for(var ye=0,_e=I.length,X=_e>>>1;ye<X;){var te=2*(ye+1)-1,le=I[te],ve=te+1,ze=I[ve];if(0>i(le,ee))ve<_e&&0>i(ze,le)?(I[ye]=ze,I[ve]=ee,ye=ve):(I[ye]=le,I[te]=ee,ye=te);else if(ve<_e&&0>i(ze,ee))I[ye]=ze,I[ve]=ee,ye=ve;else break e}}return W}function i(I,W){var ee=I.sortIndex-W.sortIndex;return ee!==0?ee:I.id-W.id}if(s.unstable_now=void 0,typeof performance=="object"&&typeof performance.now=="function"){var o=performance;s.unstable_now=function(){return o.now()}}else{var l=Date,h=l.now();s.unstable_now=function(){return l.now()-h}}var d=[],p=[],_=1,v=null,y=3,x=!1,b=!1,R=!1,T=typeof setTimeout=="function"?setTimeout:null,M=typeof clearTimeout=="function"?clearTimeout:null,w=typeof setImmediate<"u"?setImmediate:null;function D(I){for(var W=t(p);W!==null;){if(W.callback===null)n(p);else if(W.startTime<=I)n(p),W.sortIndex=W.expirationTime,e(d,W);else break;W=t(p)}}function N(I){if(R=!1,D(I),!b)if(t(d)!==null)b=!0,ae();else{var W=t(p);W!==null&&ge(N,W.startTime-I)}}var H=!1,O=-1,z=5,V=-1;function U(){return!(s.unstable_now()-V<z)}function F(){if(H){var I=s.unstable_now();V=I;var W=!0;try{e:{b=!1,R&&(R=!1,M(O),O=-1),x=!0;var ee=y;try{t:{for(D(I),v=t(d);v!==null&&!(v.expirationTime>I&&U());){var ye=v.callback;if(typeof ye=="function"){v.callback=null,y=v.priorityLevel;var _e=ye(v.expirationTime<=I);if(I=s.unstable_now(),typeof _e=="function"){v.callback=_e,D(I),W=!0;break t}v===t(d)&&n(d),D(I)}else n(d);v=t(d)}if(v!==null)W=!0;else{var X=t(p);X!==null&&ge(N,X.startTime-I),W=!1}}break e}finally{v=null,y=ee,x=!1}W=void 0}}finally{W?K():H=!1}}}var K;if(typeof w=="function")K=function(){w(F)};else if(typeof MessageChannel<"u"){var ne=new MessageChannel,$=ne.port2;ne.port1.onmessage=F,K=function(){$.postMessage(null)}}else K=function(){T(F,0)};function ae(){H||(H=!0,K())}function ge(I,W){O=T(function(){I(s.unstable_now())},W)}s.unstable_IdlePriority=5,s.unstable_ImmediatePriority=1,s.unstable_LowPriority=4,s.unstable_NormalPriority=3,s.unstable_Profiling=null,s.unstable_UserBlockingPriority=2,s.unstable_cancelCallback=function(I){I.callback=null},s.unstable_continueExecution=function(){b||x||(b=!0,ae())},s.unstable_forceFrameRate=function(I){0>I||125<I?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):z=0<I?Math.floor(1e3/I):5},s.unstable_getCurrentPriorityLevel=function(){return y},s.unstable_getFirstCallbackNode=function(){return t(d)},s.unstable_next=function(I){switch(y){case 1:case 2:case 3:var W=3;break;default:W=y}var ee=y;y=W;try{return I()}finally{y=ee}},s.unstable_pauseExecution=function(){},s.unstable_requestPaint=function(){},s.unstable_runWithPriority=function(I,W){switch(I){case 1:case 2:case 3:case 4:case 5:break;default:I=3}var ee=y;y=I;try{return W()}finally{y=ee}},s.unstable_scheduleCallback=function(I,W,ee){var ye=s.unstable_now();switch(typeof ee=="object"&&ee!==null?(ee=ee.delay,ee=typeof ee=="number"&&0<ee?ye+ee:ye):ee=ye,I){case 1:var _e=-1;break;case 2:_e=250;break;case 5:_e=1073741823;break;case 4:_e=1e4;break;default:_e=5e3}return _e=ee+_e,I={id:_++,callback:W,priorityLevel:I,startTime:ee,expirationTime:_e,sortIndex:-1},ee>ye?(I.sortIndex=ee,e(p,I),t(d)===null&&I===t(p)&&(R?(M(O),O=-1):R=!0,ge(N,ee-ye))):(I.sortIndex=_e,e(d,I),b||x||(b=!0,ae())),I},s.unstable_shouldYield=U,s.unstable_wrapCallback=function(I){var W=y;return function(){var ee=y;y=W;try{return I.apply(this,arguments)}finally{y=ee}}}})(qA)),qA}var tT;function DL(){return tT||(tT=1,JA.exports=BL()),JA.exports}var nT;function NL(){return nT||(nT=1,(function(s){s.exports=function(e){function t(c,u,g,S){return new Rm(c,u,g,S)}function n(){}function i(c){var u="https://react.dev/errors/"+c;if(1<arguments.length){u+="?args[]="+encodeURIComponent(arguments[1]);for(var g=2;g<arguments.length;g++)u+="&args[]="+encodeURIComponent(arguments[g])}return"Minified React error #"+c+"; visit "+u+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function o(c){return c===null||typeof c!="object"?null:(c=Om&&c[Om]||c["@@iterator"],typeof c=="function"?c:null)}function l(c){if(c==null)return null;if(typeof c=="function")return c.$$typeof===Xl?null:c.displayName||c.name||null;if(typeof c=="string")return c;switch(c){case Jc:return"Fragment";case or:return"Portal";case Lm:return"Profiler";case Um:return"StrictMode";case md:return"Suspense";case Qo:return"SuspenseList"}if(typeof c=="object")switch(c.$$typeof){case Ur:return(c.displayName||"Context")+".Provider";case Zo:return(c._context.displayName||"Context")+".Consumer";case qc:var u=c.render;return c=c.displayName,c||(c=u.displayName||u.name||"",c=c!==""?"ForwardRef("+c+")":"ForwardRef"),c;case Mf:return u=c.displayName||null,u!==null?u:l(c.type)||"Memo";case lr:u=c._payload,c=c._init;try{return l(c(u))}catch{}}return null}function h(c){if(gd===void 0)try{throw Error()}catch(g){var u=g.stack.trim().match(/\n( *(at )?)/);gd=u&&u[1]||"",Im=-1<g.stack.indexOf(`
|
|
4019
|
+
}`;class rL{constructor(){this.texture=null,this.mesh=null,this.depthNear=0,this.depthFar=0}init(e,t){if(this.texture===null){const n=new kx(e.texture);(e.depthNear!==t.depthNear||e.depthFar!==t.depthFar)&&(this.depthNear=e.depthNear,this.depthFar=e.depthFar),this.texture=n}}getMesh(e){if(this.texture!==null&&this.mesh===null){const t=e.cameras[0].viewport,n=new ms({vertexShader:aL,fragmentShader:sL,uniforms:{depthColor:{value:this.texture},depthWidth:{value:t.z},depthHeight:{value:t.w}}});this.mesh=new yi(new Mc(20,20),n)}return this.mesh}reset(){this.texture=null,this.mesh=null}getDepthTexture(){return this.texture}}class oL extends To{constructor(e,t){super();const n=this;let i=null,o=1,l=null,h="local-floor",d=1,p=null,_=null,v=null,y=null,x=null,b=null;const R=typeof XRWebGLBinding<"u",T=new rL,M={},w=t.getContextAttributes();let D=null,N=null;const H=[],O=[],z=new nt;let V=null;const U=new aa;U.viewport=new pi;const F=new aa;F.viewport=new pi;const K=[U,F],ne=new Q1;let $=null,ae=null;this.cameraAutoUpdate=!0,this.enabled=!1,this.isPresenting=!1,this.getController=function(he){let Ee=H[he];return Ee===void 0&&(Ee=new J0,H[he]=Ee),Ee.getTargetRaySpace()},this.getControllerGrip=function(he){let Ee=H[he];return Ee===void 0&&(Ee=new J0,H[he]=Ee),Ee.getGripSpace()},this.getHand=function(he){let Ee=H[he];return Ee===void 0&&(Ee=new J0,H[he]=Ee),Ee.getHandSpace()};function ge(he){const Ee=O.indexOf(he.inputSource);if(Ee===-1)return;const lt=H[Ee];lt!==void 0&&(lt.update(he.inputSource,he.frame,p||l),lt.dispatchEvent({type:he.type,data:he.inputSource}))}function I(){i.removeEventListener("select",ge),i.removeEventListener("selectstart",ge),i.removeEventListener("selectend",ge),i.removeEventListener("squeeze",ge),i.removeEventListener("squeezestart",ge),i.removeEventListener("squeezeend",ge),i.removeEventListener("end",I),i.removeEventListener("inputsourceschange",W);for(let he=0;he<H.length;he++){const Ee=O[he];Ee!==null&&(O[he]=null,H[he].disconnect(Ee))}$=null,ae=null,T.reset();for(const he in M)delete M[he];e.setRenderTarget(D),x=null,y=null,v=null,i=null,N=null,ze.stop(),n.isPresenting=!1,e.setPixelRatio(V),e.setSize(z.width,z.height,!1),n.dispatchEvent({type:"sessionend"})}this.setFramebufferScaleFactor=function(he){o=he,n.isPresenting===!0&&Ut("WebXRManager: Cannot change framebuffer scale while presenting.")},this.setReferenceSpaceType=function(he){h=he,n.isPresenting===!0&&Ut("WebXRManager: Cannot change reference space type while presenting.")},this.getReferenceSpace=function(){return p||l},this.setReferenceSpace=function(he){p=he},this.getBaseLayer=function(){return y!==null?y:x},this.getBinding=function(){return v===null&&R&&(v=new XRWebGLBinding(i,t)),v},this.getFrame=function(){return b},this.getSession=function(){return i},this.setSession=async function(he){if(i=he,i!==null){if(D=e.getRenderTarget(),i.addEventListener("select",ge),i.addEventListener("selectstart",ge),i.addEventListener("selectend",ge),i.addEventListener("squeeze",ge),i.addEventListener("squeezestart",ge),i.addEventListener("squeezeend",ge),i.addEventListener("end",I),i.addEventListener("inputsourceschange",W),w.xrCompatible!==!0&&await t.makeXRCompatible(),V=e.getPixelRatio(),e.getSize(z),R&&"createProjectionLayer"in XRWebGLBinding.prototype){let lt=null,Rt=null,Bt=null;w.depth&&(Bt=w.stencil?t.DEPTH24_STENCIL8:t.DEPTH_COMPONENT24,lt=w.stencil?cc:Eo,Rt=w.stencil?Qf:js);const tn={colorFormat:t.RGBA8,depthFormat:Bt,scaleFactor:o};v=this.getBinding(),y=v.createProjectionLayer(tn),i.updateRenderState({layers:[y]}),e.setPixelRatio(1),e.setSize(y.textureWidth,y.textureHeight,!1),N=new ds(y.textureWidth,y.textureHeight,{format:Zi,type:Ta,depthTexture:new Ch(y.textureWidth,y.textureHeight,Rt,void 0,void 0,void 0,void 0,void 0,void 0,lt),stencilBuffer:w.stencil,colorSpace:e.outputColorSpace,samples:w.antialias?4:0,resolveDepthBuffer:y.ignoreDepthValues===!1,resolveStencilBuffer:y.ignoreDepthValues===!1})}else{const lt={antialias:w.antialias,alpha:!0,depth:w.depth,stencil:w.stencil,framebufferScaleFactor:o};x=new XRWebGLLayer(i,t,lt),i.updateRenderState({baseLayer:x}),e.setPixelRatio(1),e.setSize(x.framebufferWidth,x.framebufferHeight,!1),N=new ds(x.framebufferWidth,x.framebufferHeight,{format:Zi,type:Ta,colorSpace:e.outputColorSpace,stencilBuffer:w.stencil,resolveDepthBuffer:x.ignoreDepthValues===!1,resolveStencilBuffer:x.ignoreDepthValues===!1})}N.isXRRenderTarget=!0,this.setFoveation(d),p=null,l=await i.requestReferenceSpace(h),ze.setContext(i),ze.start(),n.isPresenting=!0,n.dispatchEvent({type:"sessionstart"})}},this.getEnvironmentBlendMode=function(){if(i!==null)return i.environmentBlendMode},this.getDepthTexture=function(){return T.getDepthTexture()};function W(he){for(let Ee=0;Ee<he.removed.length;Ee++){const lt=he.removed[Ee],Rt=O.indexOf(lt);Rt>=0&&(O[Rt]=null,H[Rt].disconnect(lt))}for(let Ee=0;Ee<he.added.length;Ee++){const lt=he.added[Ee];let Rt=O.indexOf(lt);if(Rt===-1){for(let tn=0;tn<H.length;tn++)if(tn>=O.length){O.push(lt),Rt=tn;break}else if(O[tn]===null){O[tn]=lt,Rt=tn;break}if(Rt===-1)break}const Bt=H[Rt];Bt&&Bt.connect(lt)}}const ee=new Z,ye=new Z;function _e(he,Ee,lt){ee.setFromMatrixPosition(Ee.matrixWorld),ye.setFromMatrixPosition(lt.matrixWorld);const Rt=ee.distanceTo(ye),Bt=Ee.projectionMatrix.elements,tn=lt.projectionMatrix.elements,on=Bt[14]/(Bt[10]-1),Wt=Bt[14]/(Bt[10]+1),Ge=(Bt[9]+1)/Bt[5],et=(Bt[9]-1)/Bt[5],Je=(Bt[8]-1)/Bt[0],xt=(tn[8]+1)/tn[0],Q=on*Je,Dt=on*xt,mt=Rt/(-Je+xt),Lt=mt*-Je;if(Ee.matrixWorld.decompose(he.position,he.quaternion,he.scale),he.translateX(Lt),he.translateZ(mt),he.matrixWorld.compose(he.position,he.quaternion,he.scale),he.matrixWorldInverse.copy(he.matrixWorld).invert(),Bt[10]===-1)he.projectionMatrix.copy(Ee.projectionMatrix),he.projectionMatrixInverse.copy(Ee.projectionMatrixInverse);else{const gt=on+mt,j=Wt+mt,P=Q-Lt,de=Dt+(Rt-Lt),Fe=Ge*Wt/j*gt,ke=et*Wt/j*gt;he.projectionMatrix.makePerspective(P,de,Fe,ke,gt,j),he.projectionMatrixInverse.copy(he.projectionMatrix).invert()}}function X(he,Ee){Ee===null?he.matrixWorld.copy(he.matrix):he.matrixWorld.multiplyMatrices(Ee.matrixWorld,he.matrix),he.matrixWorldInverse.copy(he.matrixWorld).invert()}this.updateCamera=function(he){if(i===null)return;let Ee=he.near,lt=he.far;T.texture!==null&&(T.depthNear>0&&(Ee=T.depthNear),T.depthFar>0&&(lt=T.depthFar)),ne.near=F.near=U.near=Ee,ne.far=F.far=U.far=lt,($!==ne.near||ae!==ne.far)&&(i.updateRenderState({depthNear:ne.near,depthFar:ne.far}),$=ne.near,ae=ne.far),ne.layers.mask=he.layers.mask|6,U.layers.mask=ne.layers.mask&3,F.layers.mask=ne.layers.mask&5;const Rt=he.parent,Bt=ne.cameras;X(ne,Rt);for(let tn=0;tn<Bt.length;tn++)X(Bt[tn],Rt);Bt.length===2?_e(ne,U,F):ne.projectionMatrix.copy(U.projectionMatrix),te(he,ne,Rt)};function te(he,Ee,lt){lt===null?he.matrix.copy(Ee.matrixWorld):(he.matrix.copy(lt.matrixWorld),he.matrix.invert(),he.matrix.multiply(Ee.matrixWorld)),he.matrix.decompose(he.position,he.quaternion,he.scale),he.updateMatrixWorld(!0),he.projectionMatrix.copy(Ee.projectionMatrix),he.projectionMatrixInverse.copy(Ee.projectionMatrixInverse),he.isPerspectiveCamera&&(he.fov=nh*2*Math.atan(1/he.projectionMatrix.elements[5]),he.zoom=1)}this.getCamera=function(){return ne},this.getFoveation=function(){if(!(y===null&&x===null))return d},this.setFoveation=function(he){d=he,y!==null&&(y.fixedFoveation=he),x!==null&&x.fixedFoveation!==void 0&&(x.fixedFoveation=he)},this.hasDepthSensing=function(){return T.texture!==null},this.getDepthSensingMesh=function(){return T.getMesh(ne)},this.getCameraTexture=function(he){return M[he]};let le=null;function ve(he,Ee){if(_=Ee.getViewerPose(p||l),b=Ee,_!==null){const lt=_.views;x!==null&&(e.setRenderTargetFramebuffer(N,x.framebuffer),e.setRenderTarget(N));let Rt=!1;lt.length!==ne.cameras.length&&(ne.cameras.length=0,Rt=!0);for(let Wt=0;Wt<lt.length;Wt++){const Ge=lt[Wt];let et=null;if(x!==null)et=x.getViewport(Ge);else{const xt=v.getViewSubImage(y,Ge);et=xt.viewport,Wt===0&&(e.setRenderTargetTextures(N,xt.colorTexture,xt.depthStencilTexture),e.setRenderTarget(N))}let Je=K[Wt];Je===void 0&&(Je=new aa,Je.layers.enable(Wt),Je.viewport=new pi,K[Wt]=Je),Je.matrix.fromArray(Ge.transform.matrix),Je.matrix.decompose(Je.position,Je.quaternion,Je.scale),Je.projectionMatrix.fromArray(Ge.projectionMatrix),Je.projectionMatrixInverse.copy(Je.projectionMatrix).invert(),Je.viewport.set(et.x,et.y,et.width,et.height),Wt===0&&(ne.matrix.copy(Je.matrix),ne.matrix.decompose(ne.position,ne.quaternion,ne.scale)),Rt===!0&&ne.cameras.push(Je)}const Bt=i.enabledFeatures;if(Bt&&Bt.includes("depth-sensing")&&i.depthUsage=="gpu-optimized"&&R){v=n.getBinding();const Wt=v.getDepthInformation(lt[0]);Wt&&Wt.isValid&&Wt.texture&&T.init(Wt,i.renderState)}if(Bt&&Bt.includes("camera-access")&&R){e.state.unbindTexture(),v=n.getBinding();for(let Wt=0;Wt<lt.length;Wt++){const Ge=lt[Wt].camera;if(Ge){let et=M[Ge];et||(et=new kx,M[Ge]=et);const Je=v.getCameraImage(Ge);et.sourceTexture=Je}}}}for(let lt=0;lt<H.length;lt++){const Rt=O[lt],Bt=H[lt];Rt!==null&&Bt!==void 0&&Bt.update(Rt,Ee,p||l)}le&&le(he,Ee),Ee.detectedPlanes&&n.dispatchEvent({type:"planesdetected",data:Ee}),b=null}const ze=new mE;ze.setAnimationLoop(ve),this.setAnimationLoop=function(he){le=he},this.dispose=function(){}}}const Zu=new er,lL=new en;function cL(s,e){function t(T,M){T.matrixAutoUpdate===!0&&T.updateMatrix(),M.value.copy(T.matrix)}function n(T,M){M.color.getRGB(T.fogColor.value,Lb(s)),M.isFog?(T.fogNear.value=M.near,T.fogFar.value=M.far):M.isFogExp2&&(T.fogDensity.value=M.density)}function i(T,M,w,D,N){M.isMeshBasicMaterial||M.isMeshLambertMaterial?o(T,M):M.isMeshToonMaterial?(o(T,M),v(T,M)):M.isMeshPhongMaterial?(o(T,M),_(T,M)):M.isMeshStandardMaterial?(o(T,M),y(T,M),M.isMeshPhysicalMaterial&&x(T,M,N)):M.isMeshMatcapMaterial?(o(T,M),b(T,M)):M.isMeshDepthMaterial?o(T,M):M.isMeshDistanceMaterial?(o(T,M),R(T,M)):M.isMeshNormalMaterial?o(T,M):M.isLineBasicMaterial?(l(T,M),M.isLineDashedMaterial&&h(T,M)):M.isPointsMaterial?d(T,M,w,D):M.isSpriteMaterial?p(T,M):M.isShadowMaterial?(T.color.value.copy(M.color),T.opacity.value=M.opacity):M.isShaderMaterial&&(M.uniformsNeedUpdate=!1)}function o(T,M){T.opacity.value=M.opacity,M.color&&T.diffuse.value.copy(M.color),M.emissive&&T.emissive.value.copy(M.emissive).multiplyScalar(M.emissiveIntensity),M.map&&(T.map.value=M.map,t(M.map,T.mapTransform)),M.alphaMap&&(T.alphaMap.value=M.alphaMap,t(M.alphaMap,T.alphaMapTransform)),M.bumpMap&&(T.bumpMap.value=M.bumpMap,t(M.bumpMap,T.bumpMapTransform),T.bumpScale.value=M.bumpScale,M.side===fs&&(T.bumpScale.value*=-1)),M.normalMap&&(T.normalMap.value=M.normalMap,t(M.normalMap,T.normalMapTransform),T.normalScale.value.copy(M.normalScale),M.side===fs&&T.normalScale.value.negate()),M.displacementMap&&(T.displacementMap.value=M.displacementMap,t(M.displacementMap,T.displacementMapTransform),T.displacementScale.value=M.displacementScale,T.displacementBias.value=M.displacementBias),M.emissiveMap&&(T.emissiveMap.value=M.emissiveMap,t(M.emissiveMap,T.emissiveMapTransform)),M.specularMap&&(T.specularMap.value=M.specularMap,t(M.specularMap,T.specularMapTransform)),M.alphaTest>0&&(T.alphaTest.value=M.alphaTest);const w=e.get(M),D=w.envMap,N=w.envMapRotation;D&&(T.envMap.value=D,Zu.copy(N),Zu.x*=-1,Zu.y*=-1,Zu.z*=-1,D.isCubeTexture&&D.isRenderTargetTexture===!1&&(Zu.y*=-1,Zu.z*=-1),T.envMapRotation.value.setFromMatrix4(lL.makeRotationFromEuler(Zu)),T.flipEnvMap.value=D.isCubeTexture&&D.isRenderTargetTexture===!1?-1:1,T.reflectivity.value=M.reflectivity,T.ior.value=M.ior,T.refractionRatio.value=M.refractionRatio),M.lightMap&&(T.lightMap.value=M.lightMap,T.lightMapIntensity.value=M.lightMapIntensity,t(M.lightMap,T.lightMapTransform)),M.aoMap&&(T.aoMap.value=M.aoMap,T.aoMapIntensity.value=M.aoMapIntensity,t(M.aoMap,T.aoMapTransform))}function l(T,M){T.diffuse.value.copy(M.color),T.opacity.value=M.opacity,M.map&&(T.map.value=M.map,t(M.map,T.mapTransform))}function h(T,M){T.dashSize.value=M.dashSize,T.totalSize.value=M.dashSize+M.gapSize,T.scale.value=M.scale}function d(T,M,w,D){T.diffuse.value.copy(M.color),T.opacity.value=M.opacity,T.size.value=M.size*w,T.scale.value=D*.5,M.map&&(T.map.value=M.map,t(M.map,T.uvTransform)),M.alphaMap&&(T.alphaMap.value=M.alphaMap,t(M.alphaMap,T.alphaMapTransform)),M.alphaTest>0&&(T.alphaTest.value=M.alphaTest)}function p(T,M){T.diffuse.value.copy(M.color),T.opacity.value=M.opacity,T.rotation.value=M.rotation,M.map&&(T.map.value=M.map,t(M.map,T.mapTransform)),M.alphaMap&&(T.alphaMap.value=M.alphaMap,t(M.alphaMap,T.alphaMapTransform)),M.alphaTest>0&&(T.alphaTest.value=M.alphaTest)}function _(T,M){T.specular.value.copy(M.specular),T.shininess.value=Math.max(M.shininess,1e-4)}function v(T,M){M.gradientMap&&(T.gradientMap.value=M.gradientMap)}function y(T,M){T.metalness.value=M.metalness,M.metalnessMap&&(T.metalnessMap.value=M.metalnessMap,t(M.metalnessMap,T.metalnessMapTransform)),T.roughness.value=M.roughness,M.roughnessMap&&(T.roughnessMap.value=M.roughnessMap,t(M.roughnessMap,T.roughnessMapTransform)),M.envMap&&(T.envMapIntensity.value=M.envMapIntensity)}function x(T,M,w){T.ior.value=M.ior,M.sheen>0&&(T.sheenColor.value.copy(M.sheenColor).multiplyScalar(M.sheen),T.sheenRoughness.value=M.sheenRoughness,M.sheenColorMap&&(T.sheenColorMap.value=M.sheenColorMap,t(M.sheenColorMap,T.sheenColorMapTransform)),M.sheenRoughnessMap&&(T.sheenRoughnessMap.value=M.sheenRoughnessMap,t(M.sheenRoughnessMap,T.sheenRoughnessMapTransform))),M.clearcoat>0&&(T.clearcoat.value=M.clearcoat,T.clearcoatRoughness.value=M.clearcoatRoughness,M.clearcoatMap&&(T.clearcoatMap.value=M.clearcoatMap,t(M.clearcoatMap,T.clearcoatMapTransform)),M.clearcoatRoughnessMap&&(T.clearcoatRoughnessMap.value=M.clearcoatRoughnessMap,t(M.clearcoatRoughnessMap,T.clearcoatRoughnessMapTransform)),M.clearcoatNormalMap&&(T.clearcoatNormalMap.value=M.clearcoatNormalMap,t(M.clearcoatNormalMap,T.clearcoatNormalMapTransform),T.clearcoatNormalScale.value.copy(M.clearcoatNormalScale),M.side===fs&&T.clearcoatNormalScale.value.negate())),M.dispersion>0&&(T.dispersion.value=M.dispersion),M.iridescence>0&&(T.iridescence.value=M.iridescence,T.iridescenceIOR.value=M.iridescenceIOR,T.iridescenceThicknessMinimum.value=M.iridescenceThicknessRange[0],T.iridescenceThicknessMaximum.value=M.iridescenceThicknessRange[1],M.iridescenceMap&&(T.iridescenceMap.value=M.iridescenceMap,t(M.iridescenceMap,T.iridescenceMapTransform)),M.iridescenceThicknessMap&&(T.iridescenceThicknessMap.value=M.iridescenceThicknessMap,t(M.iridescenceThicknessMap,T.iridescenceThicknessMapTransform))),M.transmission>0&&(T.transmission.value=M.transmission,T.transmissionSamplerMap.value=w.texture,T.transmissionSamplerSize.value.set(w.width,w.height),M.transmissionMap&&(T.transmissionMap.value=M.transmissionMap,t(M.transmissionMap,T.transmissionMapTransform)),T.thickness.value=M.thickness,M.thicknessMap&&(T.thicknessMap.value=M.thicknessMap,t(M.thicknessMap,T.thicknessMapTransform)),T.attenuationDistance.value=M.attenuationDistance,T.attenuationColor.value.copy(M.attenuationColor)),M.anisotropy>0&&(T.anisotropyVector.value.set(M.anisotropy*Math.cos(M.anisotropyRotation),M.anisotropy*Math.sin(M.anisotropyRotation)),M.anisotropyMap&&(T.anisotropyMap.value=M.anisotropyMap,t(M.anisotropyMap,T.anisotropyMapTransform))),T.specularIntensity.value=M.specularIntensity,T.specularColor.value.copy(M.specularColor),M.specularColorMap&&(T.specularColorMap.value=M.specularColorMap,t(M.specularColorMap,T.specularColorMapTransform)),M.specularIntensityMap&&(T.specularIntensityMap.value=M.specularIntensityMap,t(M.specularIntensityMap,T.specularIntensityMapTransform))}function b(T,M){M.matcap&&(T.matcap.value=M.matcap)}function R(T,M){const w=e.get(M).light;T.referencePosition.value.setFromMatrixPosition(w.matrixWorld),T.nearDistance.value=w.shadow.camera.near,T.farDistance.value=w.shadow.camera.far}return{refreshFogUniforms:n,refreshMaterialUniforms:i}}function uL(s,e,t,n){let i={},o={},l=[];const h=s.getParameter(s.MAX_UNIFORM_BUFFER_BINDINGS);function d(w,D){const N=D.program;n.uniformBlockBinding(w,N)}function p(w,D){let N=i[w.id];N===void 0&&(b(w),N=_(w),i[w.id]=N,w.addEventListener("dispose",T));const H=D.program;n.updateUBOMapping(w,H);const O=e.render.frame;o[w.id]!==O&&(y(w),o[w.id]=O)}function _(w){const D=v();w.__bindingPointIndex=D;const N=s.createBuffer(),H=w.__size,O=w.usage;return s.bindBuffer(s.UNIFORM_BUFFER,N),s.bufferData(s.UNIFORM_BUFFER,H,O),s.bindBuffer(s.UNIFORM_BUFFER,null),s.bindBufferBase(s.UNIFORM_BUFFER,D,N),N}function v(){for(let w=0;w<h;w++)if(l.indexOf(w)===-1)return l.push(w),w;return Zt("WebGLRenderer: Maximum number of simultaneously usable uniforms groups reached."),0}function y(w){const D=i[w.id],N=w.uniforms,H=w.__cache;s.bindBuffer(s.UNIFORM_BUFFER,D);for(let O=0,z=N.length;O<z;O++){const V=Array.isArray(N[O])?N[O]:[N[O]];for(let U=0,F=V.length;U<F;U++){const K=V[U];if(x(K,O,U,H)===!0){const ne=K.__offset,$=Array.isArray(K.value)?K.value:[K.value];let ae=0;for(let ge=0;ge<$.length;ge++){const I=$[ge],W=R(I);typeof I=="number"||typeof I=="boolean"?(K.__data[0]=I,s.bufferSubData(s.UNIFORM_BUFFER,ne+ae,K.__data)):I.isMatrix3?(K.__data[0]=I.elements[0],K.__data[1]=I.elements[1],K.__data[2]=I.elements[2],K.__data[3]=0,K.__data[4]=I.elements[3],K.__data[5]=I.elements[4],K.__data[6]=I.elements[5],K.__data[7]=0,K.__data[8]=I.elements[6],K.__data[9]=I.elements[7],K.__data[10]=I.elements[8],K.__data[11]=0):(I.toArray(K.__data,ae),ae+=W.storage/Float32Array.BYTES_PER_ELEMENT)}s.bufferSubData(s.UNIFORM_BUFFER,ne,K.__data)}}}s.bindBuffer(s.UNIFORM_BUFFER,null)}function x(w,D,N,H){const O=w.value,z=D+"_"+N;if(H[z]===void 0)return typeof O=="number"||typeof O=="boolean"?H[z]=O:H[z]=O.clone(),!0;{const V=H[z];if(typeof O=="number"||typeof O=="boolean"){if(V!==O)return H[z]=O,!0}else if(V.equals(O)===!1)return V.copy(O),!0}return!1}function b(w){const D=w.uniforms;let N=0;const H=16;for(let z=0,V=D.length;z<V;z++){const U=Array.isArray(D[z])?D[z]:[D[z]];for(let F=0,K=U.length;F<K;F++){const ne=U[F],$=Array.isArray(ne.value)?ne.value:[ne.value];for(let ae=0,ge=$.length;ae<ge;ae++){const I=$[ae],W=R(I),ee=N%H,ye=ee%W.boundary,_e=ee+ye;N+=ye,_e!==0&&H-_e<W.storage&&(N+=H-_e),ne.__data=new Float32Array(W.storage/Float32Array.BYTES_PER_ELEMENT),ne.__offset=N,N+=W.storage}}}const O=N%H;return O>0&&(N+=H-O),w.__size=N,w.__cache={},this}function R(w){const D={boundary:0,storage:0};return typeof w=="number"||typeof w=="boolean"?(D.boundary=4,D.storage=4):w.isVector2?(D.boundary=8,D.storage=8):w.isVector3||w.isColor?(D.boundary=16,D.storage=12):w.isVector4?(D.boundary=16,D.storage=16):w.isMatrix3?(D.boundary=48,D.storage=48):w.isMatrix4?(D.boundary=64,D.storage=64):w.isTexture?Ut("WebGLRenderer: Texture samplers can not be part of an uniforms group."):Ut("WebGLRenderer: Unsupported uniform value type.",w),D}function T(w){const D=w.target;D.removeEventListener("dispose",T);const N=l.indexOf(D.__bindingPointIndex);l.splice(N,1),s.deleteBuffer(i[D.id]),delete i[D.id],delete o[D.id]}function M(){for(const w in i)s.deleteBuffer(i[w]);l=[],i={},o={}}return{bind:d,update:p,dispose:M}}const fL=new Uint16Array([12469,15057,12620,14925,13266,14620,13807,14376,14323,13990,14545,13625,14713,13328,14840,12882,14931,12528,14996,12233,15039,11829,15066,11525,15080,11295,15085,10976,15082,10705,15073,10495,13880,14564,13898,14542,13977,14430,14158,14124,14393,13732,14556,13410,14702,12996,14814,12596,14891,12291,14937,11834,14957,11489,14958,11194,14943,10803,14921,10506,14893,10278,14858,9960,14484,14039,14487,14025,14499,13941,14524,13740,14574,13468,14654,13106,14743,12678,14818,12344,14867,11893,14889,11509,14893,11180,14881,10751,14852,10428,14812,10128,14765,9754,14712,9466,14764,13480,14764,13475,14766,13440,14766,13347,14769,13070,14786,12713,14816,12387,14844,11957,14860,11549,14868,11215,14855,10751,14825,10403,14782,10044,14729,9651,14666,9352,14599,9029,14967,12835,14966,12831,14963,12804,14954,12723,14936,12564,14917,12347,14900,11958,14886,11569,14878,11247,14859,10765,14828,10401,14784,10011,14727,9600,14660,9289,14586,8893,14508,8533,15111,12234,15110,12234,15104,12216,15092,12156,15067,12010,15028,11776,14981,11500,14942,11205,14902,10752,14861,10393,14812,9991,14752,9570,14682,9252,14603,8808,14519,8445,14431,8145,15209,11449,15208,11451,15202,11451,15190,11438,15163,11384,15117,11274,15055,10979,14994,10648,14932,10343,14871,9936,14803,9532,14729,9218,14645,8742,14556,8381,14461,8020,14365,7603,15273,10603,15272,10607,15267,10619,15256,10631,15231,10614,15182,10535,15118,10389,15042,10167,14963,9787,14883,9447,14800,9115,14710,8665,14615,8318,14514,7911,14411,7507,14279,7198,15314,9675,15313,9683,15309,9712,15298,9759,15277,9797,15229,9773,15166,9668,15084,9487,14995,9274,14898,8910,14800,8539,14697,8234,14590,7790,14479,7409,14367,7067,14178,6621,15337,8619,15337,8631,15333,8677,15325,8769,15305,8871,15264,8940,15202,8909,15119,8775,15022,8565,14916,8328,14804,8009,14688,7614,14569,7287,14448,6888,14321,6483,14088,6171,15350,7402,15350,7419,15347,7480,15340,7613,15322,7804,15287,7973,15229,8057,15148,8012,15046,7846,14933,7611,14810,7357,14682,7069,14552,6656,14421,6316,14251,5948,14007,5528,15356,5942,15356,5977,15353,6119,15348,6294,15332,6551,15302,6824,15249,7044,15171,7122,15070,7050,14949,6861,14818,6611,14679,6349,14538,6067,14398,5651,14189,5311,13935,4958,15359,4123,15359,4153,15356,4296,15353,4646,15338,5160,15311,5508,15263,5829,15188,6042,15088,6094,14966,6001,14826,5796,14678,5543,14527,5287,14377,4985,14133,4586,13869,4257,15360,1563,15360,1642,15358,2076,15354,2636,15341,3350,15317,4019,15273,4429,15203,4732,15105,4911,14981,4932,14836,4818,14679,4621,14517,4386,14359,4156,14083,3795,13808,3437,15360,122,15360,137,15358,285,15355,636,15344,1274,15322,2177,15281,2765,15215,3223,15120,3451,14995,3569,14846,3567,14681,3466,14511,3305,14344,3121,14037,2800,13753,2467,15360,0,15360,1,15359,21,15355,89,15346,253,15325,479,15287,796,15225,1148,15133,1492,15008,1749,14856,1882,14685,1886,14506,1783,14324,1608,13996,1398,13702,1183]);let Do=null;function hL(){return Do===null&&(Do=new _r(fL,16,16,xu,ki),Do.name="DFG_LUT",Do.minFilter=Cn,Do.magFilter=Cn,Do.wrapS=Ei,Do.wrapT=Ei,Do.generateMipmaps=!1,Do.needsUpdate=!0),Do}class HA{constructor(e={}){const{canvas:t=mb(),context:n=null,depth:i=!0,stencil:o=!1,alpha:l=!1,antialias:h=!1,premultipliedAlpha:d=!0,preserveDrawingBuffer:p=!1,powerPreference:_="default",failIfMajorPerformanceCaveat:v=!1,reversedDepthBuffer:y=!1,outputBufferType:x=Ta}=e;this.isWebGLRenderer=!0;let b;if(n!==null){if(typeof WebGLRenderingContext<"u"&&n instanceof WebGLRenderingContext)throw new Error("THREE.WebGLRenderer: WebGL 1 is not supported since r163.");b=n.getContextAttributes().alpha}else b=l;const R=x,T=new Set([Vg,zg,ap]),M=new Set([Ta,js,Zf,Qf,Pg,Gg]),w=new Uint32Array(4),D=new Int32Array(4);let N=null,H=null;const O=[],z=[];let V=null;this.domElement=t,this.debug={checkShaderErrors:!0,onShaderError:null},this.autoClear=!0,this.autoClearColor=!0,this.autoClearDepth=!0,this.autoClearStencil=!0,this.sortObjects=!0,this.clippingPlanes=[],this.localClippingEnabled=!1,this.toneMapping=mr,this.toneMappingExposure=1,this.transmissionResolutionScale=1;const U=this;let F=!1;this._outputColorSpace=Xi;let K=0,ne=0,$=null,ae=-1,ge=null;const I=new pi,W=new pi;let ee=null;const ye=new Ct(0);let _e=0,X=t.width,te=t.height,le=1,ve=null,ze=null;const he=new pi(0,0,X,te),Ee=new pi(0,0,X,te);let lt=!1;const Rt=new Th;let Bt=!1,tn=!1;const on=new en,Wt=new Z,Ge=new pi,et={background:null,fog:null,environment:null,overrideMaterial:null,isScene:!0};let Je=!1;function xt(){return $===null?le:1}let Q=n;function Dt(k,ie){return t.getContext(k,ie)}try{const k={alpha:!0,depth:i,stencil:o,antialias:h,premultipliedAlpha:d,preserveDrawingBuffer:p,powerPreference:_,failIfMajorPerformanceCaveat:v};if("setAttribute"in t&&t.setAttribute("data-engine",`three.js r${Zd}`),t.addEventListener("webglcontextlost",nn,!1),t.addEventListener("webglcontextrestored",wn,!1),t.addEventListener("webglcontextcreationerror",Mn,!1),Q===null){const ie="webgl2";if(Q=Dt(ie,k),Q===null)throw Dt(ie)?new Error("Error creating WebGL context with your selected attributes."):new Error("Error creating WebGL context.")}}catch(k){throw Zt("WebGLRenderer: "+k.message),k}let mt,Lt,gt,j,P,de,Fe,ke,Ie,Ft,Mt,Ht,zt,Ye,qe,wt,bt,rt,Vt,fe,Ne,ot,Et,Qe;function We(){mt=new dN(Q),mt.init(),ot=new VE(Q,mt),Lt=new aN(Q,mt,e,ot),gt=new nL(Q,mt),Lt.reversedDepthBuffer&&y&>.buffers.depth.setReversed(!0),j=new gN(Q),P=new zU,de=new iL(Q,mt,gt,P,Lt,ot,j),Fe=new rN(U),ke=new hN(U),Ie=new e3(Q),Et=new nN(Q,Ie),Ft=new pN(Q,Ie,j,Et),Mt=new _N(Q,Ft,Ie,j),Vt=new vN(Q,Lt,de),wt=new sN(P),Ht=new GU(U,Fe,ke,mt,Lt,Et,wt),zt=new cL(U,P),Ye=new kU,qe=new WU(mt),rt=new tN(U,Fe,ke,gt,Mt,b,d),bt=new eL(U,Mt,Lt),Qe=new uL(Q,j,Lt,gt),fe=new iN(Q,mt,j),Ne=new mN(Q,mt,j),j.programs=Ht.programs,U.capabilities=Lt,U.extensions=mt,U.properties=P,U.renderLists=Ye,U.shadowMap=bt,U.state=gt,U.info=j}We(),R!==Ta&&(V=new xN(R,t.width,t.height,i,o));const _t=new oL(U,Q);this.xr=_t,this.getContext=function(){return Q},this.getContextAttributes=function(){return Q.getContextAttributes()},this.forceContextLoss=function(){const k=mt.get("WEBGL_lose_context");k&&k.loseContext()},this.forceContextRestore=function(){const k=mt.get("WEBGL_lose_context");k&&k.restoreContext()},this.getPixelRatio=function(){return le},this.setPixelRatio=function(k){k!==void 0&&(le=k,this.setSize(X,te,!1))},this.getSize=function(k){return k.set(X,te)},this.setSize=function(k,ie,ue=!0){if(_t.isPresenting){Ut("WebGLRenderer: Can't change size while VR device is presenting.");return}X=k,te=ie,t.width=Math.floor(k*le),t.height=Math.floor(ie*le),ue===!0&&(t.style.width=k+"px",t.style.height=ie+"px"),V!==null&&V.setSize(t.width,t.height),this.setViewport(0,0,k,ie)},this.getDrawingBufferSize=function(k){return k.set(X*le,te*le).floor()},this.setDrawingBufferSize=function(k,ie,ue){X=k,te=ie,le=ue,t.width=Math.floor(k*ue),t.height=Math.floor(ie*ue),this.setViewport(0,0,k,ie)},this.setEffects=function(k){if(R===Ta){console.error("THREE.WebGLRenderer: setEffects() requires outputBufferType set to HalfFloatType or FloatType.");return}if(k){for(let ie=0;ie<k.length;ie++)if(k[ie].isOutputPass===!0){console.warn("THREE.WebGLRenderer: OutputPass is not needed in setEffects(). Tone mapping and color space conversion are applied automatically.");break}}V.setEffects(k||[])},this.getCurrentViewport=function(k){return k.copy(I)},this.getViewport=function(k){return k.copy(he)},this.setViewport=function(k,ie,ue,pe){k.isVector4?he.set(k.x,k.y,k.z,k.w):he.set(k,ie,ue,pe),gt.viewport(I.copy(he).multiplyScalar(le).round())},this.getScissor=function(k){return k.copy(Ee)},this.setScissor=function(k,ie,ue,pe){k.isVector4?Ee.set(k.x,k.y,k.z,k.w):Ee.set(k,ie,ue,pe),gt.scissor(W.copy(Ee).multiplyScalar(le).round())},this.getScissorTest=function(){return lt},this.setScissorTest=function(k){gt.setScissorTest(lt=k)},this.setOpaqueSort=function(k){ve=k},this.setTransparentSort=function(k){ze=k},this.getClearColor=function(k){return k.copy(rt.getClearColor())},this.setClearColor=function(){rt.setClearColor(...arguments)},this.getClearAlpha=function(){return rt.getClearAlpha()},this.setClearAlpha=function(){rt.setClearAlpha(...arguments)},this.clear=function(k=!0,ie=!0,ue=!0){let pe=0;if(k){let ce=!1;if($!==null){const it=$.texture.format;ce=T.has(it)}if(ce){const it=$.texture.type,ut=M.has(it),ht=rt.getClearColor(),xe=rt.getClearAlpha(),we=ht.r,je=ht.g,He=ht.b;ut?(w[0]=we,w[1]=je,w[2]=He,w[3]=xe,Q.clearBufferuiv(Q.COLOR,0,w)):(D[0]=we,D[1]=je,D[2]=He,D[3]=xe,Q.clearBufferiv(Q.COLOR,0,D))}else pe|=Q.COLOR_BUFFER_BIT}ie&&(pe|=Q.DEPTH_BUFFER_BIT),ue&&(pe|=Q.STENCIL_BUFFER_BIT,this.state.buffers.stencil.setMask(4294967295)),Q.clear(pe)},this.clearColor=function(){this.clear(!0,!1,!1)},this.clearDepth=function(){this.clear(!1,!0,!1)},this.clearStencil=function(){this.clear(!1,!1,!0)},this.dispose=function(){t.removeEventListener("webglcontextlost",nn,!1),t.removeEventListener("webglcontextrestored",wn,!1),t.removeEventListener("webglcontextcreationerror",Mn,!1),rt.dispose(),Ye.dispose(),qe.dispose(),P.dispose(),Fe.dispose(),ke.dispose(),Mt.dispose(),Et.dispose(),Qe.dispose(),Ht.dispose(),_t.dispose(),_t.removeEventListener("sessionstart",Da),_t.removeEventListener("sessionend",wi),kt.stop()};function nn(k){k.preventDefault(),mp("WebGLRenderer: Context Lost."),F=!0}function wn(){mp("WebGLRenderer: Context Restored."),F=!1;const k=j.autoReset,ie=bt.enabled,ue=bt.autoUpdate,pe=bt.needsUpdate,ce=bt.type;We(),j.autoReset=k,bt.enabled=ie,bt.autoUpdate=ue,bt.needsUpdate=pe,bt.type=ce}function Mn(k){Zt("WebGLRenderer: A WebGL context could not be created. Reason: ",k.statusMessage)}function Fi(k){const ie=k.target;ie.removeEventListener("dispose",Fi),va(ie)}function va(k){br(k),P.remove(k)}function br(k){const ie=P.get(k).programs;ie!==void 0&&(ie.forEach(function(ue){Ht.releaseProgram(ue)}),k.isShaderMaterial&&Ht.releaseShaderCache(k))}this.renderBufferDirect=function(k,ie,ue,pe,ce,it){ie===null&&(ie=et);const ut=ce.isMesh&&ce.matrixWorld.determinant()<0,ht=ct(k,ie,ue,pe,ce);gt.setMaterial(pe,ut);let xe=ue.index,we=1;if(pe.wireframe===!0){if(xe=Ft.getWireframeAttribute(ue),xe===void 0)return;we=2}const je=ue.drawRange,He=ue.attributes.position;let Ve=je.start*we,At=(je.start+je.count)*we;it!==null&&(Ve=Math.max(Ve,it.start*we),At=Math.min(At,(it.start+it.count)*we)),xe!==null?(Ve=Math.max(Ve,0),At=Math.min(At,xe.count)):He!=null&&(Ve=Math.max(Ve,0),At=Math.min(At,He.count));const Yt=At-Ve;if(Yt<0||Yt===1/0)return;Et.setup(ce,pe,ht,ue,xe);let Jt,Tt=fe;if(xe!==null&&(Jt=Ie.get(xe),Tt=Ne,Tt.setIndex(Jt)),ce.isMesh)pe.wireframe===!0?(gt.setLineWidth(pe.wireframeLinewidth*xt()),Tt.setMode(Q.LINES)):Tt.setMode(Q.TRIANGLES);else if(ce.isLine){let ft=pe.linewidth;ft===void 0&&(ft=1),gt.setLineWidth(ft*xt()),ce.isLineSegments?Tt.setMode(Q.LINES):ce.isLineLoop?Tt.setMode(Q.LINE_LOOP):Tt.setMode(Q.LINE_STRIP)}else ce.isPoints?Tt.setMode(Q.POINTS):ce.isSprite&&Tt.setMode(Q.TRIANGLES);if(ce.isBatchedMesh)if(ce._multiDrawInstances!==null)th("WebGLRenderer: renderMultiDrawInstances has been deprecated and will be removed in r184. Append to renderMultiDraw arguments and use indirection."),Tt.renderMultiDrawInstances(ce._multiDrawStarts,ce._multiDrawCounts,ce._multiDrawCount,ce._multiDrawInstances);else if(mt.get("WEBGL_multi_draw"))Tt.renderMultiDraw(ce._multiDrawStarts,ce._multiDrawCounts,ce._multiDrawCount);else{const ft=ce._multiDrawStarts,Nt=ce._multiDrawCounts,vt=ce._multiDrawCount,un=xe?Ie.get(xe).bytesPerElement:1,Wn=P.get(pe).currentProgram.getUniforms();for(let an=0;an<vt;an++)Wn.setValue(Q,"_gl_DrawID",an),Tt.render(ft[an]/un,Nt[an])}else if(ce.isInstancedMesh)Tt.renderInstances(Ve,Yt,ce.count);else if(ue.isInstancedBufferGeometry){const ft=ue._maxInstanceCount!==void 0?ue._maxInstanceCount:1/0,Nt=Math.min(ue.instanceCount,ft);Tt.renderInstances(Ve,Yt,Nt)}else Tt.render(Ve,Yt)};function ir(k,ie,ue){k.transparent===!0&&k.side===Ws&&k.forceSinglePass===!1?(k.side=fs,k.needsUpdate=!0,Te(k,ie,ue),k.side=Yr,k.needsUpdate=!0,Te(k,ie,ue),k.side=Ws):Te(k,ie,ue)}this.compile=function(k,ie,ue=null){ue===null&&(ue=k),H=qe.get(ue),H.init(ie),z.push(H),ue.traverseVisible(function(ce){ce.isLight&&ce.layers.test(ie.layers)&&(H.pushLight(ce),ce.castShadow&&H.pushShadow(ce))}),k!==ue&&k.traverseVisible(function(ce){ce.isLight&&ce.layers.test(ie.layers)&&(H.pushLight(ce),ce.castShadow&&H.pushShadow(ce))}),H.setupLights();const pe=new Set;return k.traverse(function(ce){if(!(ce.isMesh||ce.isPoints||ce.isLine||ce.isSprite))return;const it=ce.material;if(it)if(Array.isArray(it))for(let ut=0;ut<it.length;ut++){const ht=it[ut];ir(ht,ue,ce),pe.add(ht)}else ir(it,ue,ce),pe.add(it)}),H=z.pop(),pe},this.compileAsync=function(k,ie,ue=null){const pe=this.compile(k,ie,ue);return new Promise(ce=>{function it(){if(pe.forEach(function(ut){P.get(ut).currentProgram.isReady()&&pe.delete(ut)}),pe.size===0){ce(k);return}setTimeout(it,10)}mt.get("KHR_parallel_shader_compile")!==null?it():setTimeout(it,10)})};let _a=null;function sa(k){_a&&_a(k)}function Da(){kt.stop()}function wi(){kt.start()}const kt=new mE;kt.setAnimationLoop(sa),typeof self<"u"&&kt.setContext(self),this.setAnimationLoop=function(k){_a=k,_t.setAnimationLoop(k),k===null?kt.stop():kt.start()},_t.addEventListener("sessionstart",Da),_t.addEventListener("sessionend",wi),this.render=function(k,ie){if(ie!==void 0&&ie.isCamera!==!0){Zt("WebGLRenderer.render: camera is not an instance of THREE.Camera.");return}if(F===!0)return;const ue=_t.enabled===!0&&_t.isPresenting===!0,pe=V!==null&&($===null||ue)&&V.begin(U,$);if(k.matrixWorldAutoUpdate===!0&&k.updateMatrixWorld(),ie.parent===null&&ie.matrixWorldAutoUpdate===!0&&ie.updateMatrixWorld(),_t.enabled===!0&&_t.isPresenting===!0&&(V===null||V.isCompositing()===!1)&&(_t.cameraAutoUpdate===!0&&_t.updateCamera(ie),ie=_t.getCamera()),k.isScene===!0&&k.onBeforeRender(U,k,ie,$),H=qe.get(k,z.length),H.init(ie),z.push(H),on.multiplyMatrices(ie.projectionMatrix,ie.matrixWorldInverse),Rt.setFromProjectionMatrix(on,Zs,ie.reversedDepth),tn=this.localClippingEnabled,Bt=wt.init(this.clippingPlanes,tn),N=Ye.get(k,O.length),N.init(),O.push(N),_t.enabled===!0&&_t.isPresenting===!0){const ut=U.xr.getDepthSensingMesh();ut!==null&&Ai(ut,ie,-1/0,U.sortObjects)}Ai(k,ie,0,U.sortObjects),N.finish(),U.sortObjects===!0&&N.sort(ve,ze),Je=_t.enabled===!1||_t.isPresenting===!1||_t.hasDepthSensing()===!1,Je&&rt.addToRenderList(N,k),this.info.render.frame++,Bt===!0&&wt.beginShadows();const ce=H.state.shadowsArray;if(bt.render(ce,k,ie),Bt===!0&&wt.endShadows(),this.info.autoReset===!0&&this.info.reset(),(pe&&V.hasRenderPass())===!1){const ut=N.opaque,ht=N.transmissive;if(H.setupLights(),ie.isArrayCamera){const xe=ie.cameras;if(ht.length>0)for(let we=0,je=xe.length;we<je;we++){const He=xe[we];G(ut,ht,k,He)}Je&&rt.render(k);for(let we=0,je=xe.length;we<je;we++){const He=xe[we];mn(N,k,He,He.viewport)}}else ht.length>0&&G(ut,ht,k,ie),Je&&rt.render(k),mn(N,k,ie)}$!==null&&ne===0&&(de.updateMultisampleRenderTarget($),de.updateRenderTargetMipmap($)),pe&&V.end(U),k.isScene===!0&&k.onAfterRender(U,k,ie),Et.resetDefaultState(),ae=-1,ge=null,z.pop(),z.length>0?(H=z[z.length-1],Bt===!0&&wt.setGlobalState(U.clippingPlanes,H.state.camera)):H=null,O.pop(),O.length>0?N=O[O.length-1]:N=null};function Ai(k,ie,ue,pe){if(k.visible===!1)return;if(k.layers.test(ie.layers)){if(k.isGroup)ue=k.renderOrder;else if(k.isLOD)k.autoUpdate===!0&&k.update(ie);else if(k.isLight)H.pushLight(k),k.castShadow&&H.pushShadow(k);else if(k.isSprite){if(!k.frustumCulled||Rt.intersectsSprite(k)){pe&&Ge.setFromMatrixPosition(k.matrixWorld).applyMatrix4(on);const ut=Mt.update(k),ht=k.material;ht.visible&&N.push(k,ut,ht,ue,Ge.z,null)}}else if((k.isMesh||k.isLine||k.isPoints)&&(!k.frustumCulled||Rt.intersectsObject(k))){const ut=Mt.update(k),ht=k.material;if(pe&&(k.boundingSphere!==void 0?(k.boundingSphere===null&&k.computeBoundingSphere(),Ge.copy(k.boundingSphere.center)):(ut.boundingSphere===null&&ut.computeBoundingSphere(),Ge.copy(ut.boundingSphere.center)),Ge.applyMatrix4(k.matrixWorld).applyMatrix4(on)),Array.isArray(ht)){const xe=ut.groups;for(let we=0,je=xe.length;we<je;we++){const He=xe[we],Ve=ht[He.materialIndex];Ve&&Ve.visible&&N.push(k,ut,Ve,ue,Ge.z,He)}}else ht.visible&&N.push(k,ut,ht,ue,Ge.z,null)}}const it=k.children;for(let ut=0,ht=it.length;ut<ht;ut++)Ai(it[ut],ie,ue,pe)}function mn(k,ie,ue,pe){const{opaque:ce,transmissive:it,transparent:ut}=k;H.setupLightsView(ue),Bt===!0&&wt.setGlobalState(U.clippingPlanes,ue),pe&>.viewport(I.copy(pe)),ce.length>0&&q(ce,ie,ue),it.length>0&&q(it,ie,ue),ut.length>0&&q(ut,ie,ue),gt.buffers.depth.setTest(!0),gt.buffers.depth.setMask(!0),gt.buffers.color.setMask(!0),gt.setPolygonOffset(!1)}function G(k,ie,ue,pe){if((ue.isScene===!0?ue.overrideMaterial:null)!==null)return;if(H.state.transmissionRenderTarget[pe.id]===void 0){const Ve=mt.has("EXT_color_buffer_half_float")||mt.has("EXT_color_buffer_float");H.state.transmissionRenderTarget[pe.id]=new ds(1,1,{generateMipmaps:!0,type:Ve?ki:Ta,minFilter:Is,samples:Lt.samples,stencilBuffer:o,resolveDepthBuffer:!1,resolveStencilBuffer:!1,colorSpace:Bn.workingColorSpace})}const it=H.state.transmissionRenderTarget[pe.id],ut=pe.viewport||I;it.setSize(ut.z*U.transmissionResolutionScale,ut.w*U.transmissionResolutionScale);const ht=U.getRenderTarget(),xe=U.getActiveCubeFace(),we=U.getActiveMipmapLevel();U.setRenderTarget(it),U.getClearColor(ye),_e=U.getClearAlpha(),_e<1&&U.setClearColor(16777215,.5),U.clear(),Je&&rt.render(ue);const je=U.toneMapping;U.toneMapping=mr;const He=pe.viewport;if(pe.viewport!==void 0&&(pe.viewport=void 0),H.setupLightsView(pe),Bt===!0&&wt.setGlobalState(U.clippingPlanes,pe),q(k,ue,pe),de.updateMultisampleRenderTarget(it),de.updateRenderTargetMipmap(it),mt.has("WEBGL_multisampled_render_to_texture")===!1){let Ve=!1;for(let At=0,Yt=ie.length;At<Yt;At++){const Jt=ie[At],{object:Tt,geometry:ft,material:Nt,group:vt}=Jt;if(Nt.side===Ws&&Tt.layers.test(pe.layers)){const un=Nt.side;Nt.side=fs,Nt.needsUpdate=!0,oe(Tt,ue,pe,ft,Nt,vt),Nt.side=un,Nt.needsUpdate=!0,Ve=!0}}Ve===!0&&(de.updateMultisampleRenderTarget(it),de.updateRenderTargetMipmap(it))}U.setRenderTarget(ht,xe,we),U.setClearColor(ye,_e),He!==void 0&&(pe.viewport=He),U.toneMapping=je}function q(k,ie,ue){const pe=ie.isScene===!0?ie.overrideMaterial:null;for(let ce=0,it=k.length;ce<it;ce++){const ut=k[ce],{object:ht,geometry:xe,group:we}=ut;let je=ut.material;je.allowOverride===!0&&pe!==null&&(je=pe),ht.layers.test(ue.layers)&&oe(ht,ie,ue,xe,je,we)}}function oe(k,ie,ue,pe,ce,it){k.onBeforeRender(U,ie,ue,pe,ce,it),k.modelViewMatrix.multiplyMatrices(ue.matrixWorldInverse,k.matrixWorld),k.normalMatrix.getNormalMatrix(k.modelViewMatrix),ce.onBeforeRender(U,ie,ue,pe,k,it),ce.transparent===!0&&ce.side===Ws&&ce.forceSinglePass===!1?(ce.side=fs,ce.needsUpdate=!0,U.renderBufferDirect(ue,ie,pe,ce,k,it),ce.side=Yr,ce.needsUpdate=!0,U.renderBufferDirect(ue,ie,pe,ce,k,it),ce.side=Ws):U.renderBufferDirect(ue,ie,pe,ce,k,it),k.onAfterRender(U,ie,ue,pe,ce,it)}function Te(k,ie,ue){ie.isScene!==!0&&(ie=et);const pe=P.get(k),ce=H.state.lights,it=H.state.shadowsArray,ut=ce.state.version,ht=Ht.getParameters(k,ce.state,it,ie,ue),xe=Ht.getProgramCacheKey(ht);let we=pe.programs;pe.environment=k.isMeshStandardMaterial?ie.environment:null,pe.fog=ie.fog,pe.envMap=(k.isMeshStandardMaterial?ke:Fe).get(k.envMap||pe.environment),pe.envMapRotation=pe.environment!==null&&k.envMap===null?ie.environmentRotation:k.envMapRotation,we===void 0&&(k.addEventListener("dispose",Fi),we=new Map,pe.programs=we);let je=we.get(xe);if(je!==void 0){if(pe.currentProgram===je&&pe.lightsStateVersion===ut)return Ue(k,ht),je}else ht.uniforms=Ht.getUniforms(k),k.onBeforeCompile(ht,U),je=Ht.acquireProgram(ht,xe),we.set(xe,je),pe.uniforms=ht.uniforms;const He=pe.uniforms;return(!k.isShaderMaterial&&!k.isRawShaderMaterial||k.clipping===!0)&&(He.clippingPlanes=wt.uniform),Ue(k,ht),pe.needsLights=st(k),pe.lightsStateVersion=ut,pe.needsLights&&(He.ambientLightColor.value=ce.state.ambient,He.lightProbe.value=ce.state.probe,He.directionalLights.value=ce.state.directional,He.directionalLightShadows.value=ce.state.directionalShadow,He.spotLights.value=ce.state.spot,He.spotLightShadows.value=ce.state.spotShadow,He.rectAreaLights.value=ce.state.rectArea,He.ltc_1.value=ce.state.rectAreaLTC1,He.ltc_2.value=ce.state.rectAreaLTC2,He.pointLights.value=ce.state.point,He.pointLightShadows.value=ce.state.pointShadow,He.hemisphereLights.value=ce.state.hemi,He.directionalShadowMap.value=ce.state.directionalShadowMap,He.directionalShadowMatrix.value=ce.state.directionalShadowMatrix,He.spotShadowMap.value=ce.state.spotShadowMap,He.spotLightMatrix.value=ce.state.spotLightMatrix,He.spotLightMap.value=ce.state.spotLightMap,He.pointShadowMap.value=ce.state.pointShadowMap,He.pointShadowMatrix.value=ce.state.pointShadowMatrix),pe.currentProgram=je,pe.uniformsList=null,je}function Le(k){if(k.uniformsList===null){const ie=k.currentProgram.getUniforms();k.uniformsList=Zv.seqWithValue(ie.seq,k.uniforms)}return k.uniformsList}function Ue(k,ie){const ue=P.get(k);ue.outputColorSpace=ie.outputColorSpace,ue.batching=ie.batching,ue.batchingColor=ie.batchingColor,ue.instancing=ie.instancing,ue.instancingColor=ie.instancingColor,ue.instancingMorph=ie.instancingMorph,ue.skinning=ie.skinning,ue.morphTargets=ie.morphTargets,ue.morphNormals=ie.morphNormals,ue.morphColors=ie.morphColors,ue.morphTargetsCount=ie.morphTargetsCount,ue.numClippingPlanes=ie.numClippingPlanes,ue.numIntersection=ie.numClipIntersection,ue.vertexAlphas=ie.vertexAlphas,ue.vertexTangents=ie.vertexTangents,ue.toneMapping=ie.toneMapping}function ct(k,ie,ue,pe,ce){ie.isScene!==!0&&(ie=et),de.resetTextureUnits();const it=ie.fog,ut=pe.isMeshStandardMaterial?ie.environment:null,ht=$===null?U.outputColorSpace:$.isXRRenderTarget===!0?$.texture.colorSpace:na,xe=(pe.isMeshStandardMaterial?ke:Fe).get(pe.envMap||ut),we=pe.vertexColors===!0&&!!ue.attributes.color&&ue.attributes.color.itemSize===4,je=!!ue.attributes.tangent&&(!!pe.normalMap||pe.anisotropy>0),He=!!ue.morphAttributes.position,Ve=!!ue.morphAttributes.normal,At=!!ue.morphAttributes.color;let Yt=mr;pe.toneMapped&&($===null||$.isXRRenderTarget===!0)&&(Yt=U.toneMapping);const Jt=ue.morphAttributes.position||ue.morphAttributes.normal||ue.morphAttributes.color,Tt=Jt!==void 0?Jt.length:0,ft=P.get(pe),Nt=H.state.lights;if(Bt===!0&&(tn===!0||k!==ge)){const ri=k===ge&&pe.id===ae;wt.setState(pe,k,ri)}let vt=!1;pe.version===ft.__version?(ft.needsLights&&ft.lightsStateVersion!==Nt.state.version||ft.outputColorSpace!==ht||ce.isBatchedMesh&&ft.batching===!1||!ce.isBatchedMesh&&ft.batching===!0||ce.isBatchedMesh&&ft.batchingColor===!0&&ce.colorTexture===null||ce.isBatchedMesh&&ft.batchingColor===!1&&ce.colorTexture!==null||ce.isInstancedMesh&&ft.instancing===!1||!ce.isInstancedMesh&&ft.instancing===!0||ce.isSkinnedMesh&&ft.skinning===!1||!ce.isSkinnedMesh&&ft.skinning===!0||ce.isInstancedMesh&&ft.instancingColor===!0&&ce.instanceColor===null||ce.isInstancedMesh&&ft.instancingColor===!1&&ce.instanceColor!==null||ce.isInstancedMesh&&ft.instancingMorph===!0&&ce.morphTexture===null||ce.isInstancedMesh&&ft.instancingMorph===!1&&ce.morphTexture!==null||ft.envMap!==xe||pe.fog===!0&&ft.fog!==it||ft.numClippingPlanes!==void 0&&(ft.numClippingPlanes!==wt.numPlanes||ft.numIntersection!==wt.numIntersection)||ft.vertexAlphas!==we||ft.vertexTangents!==je||ft.morphTargets!==He||ft.morphNormals!==Ve||ft.morphColors!==At||ft.toneMapping!==Yt||ft.morphTargetsCount!==Tt)&&(vt=!0):(vt=!0,ft.__version=pe.version);let un=ft.currentProgram;vt===!0&&(un=Te(pe,ie,ce));let Wn=!1,an=!1,Xn=!1;const rn=un.getUniforms(),Pn=ft.uniforms;if(gt.useProgram(un.program)&&(Wn=!0,an=!0,Xn=!0),pe.id!==ae&&(ae=pe.id,an=!0),Wn||ge!==k){gt.buffers.depth.getReversed()&&k.reversedDepth!==!0&&(k._reversedDepth=!0,k.updateProjectionMatrix()),rn.setValue(Q,"projectionMatrix",k.projectionMatrix),rn.setValue(Q,"viewMatrix",k.matrixWorldInverse);const Si=rn.map.cameraPosition;Si!==void 0&&Si.setValue(Q,Wt.setFromMatrixPosition(k.matrixWorld)),Lt.logarithmicDepthBuffer&&rn.setValue(Q,"logDepthBufFC",2/(Math.log(k.far+1)/Math.LN2)),(pe.isMeshPhongMaterial||pe.isMeshToonMaterial||pe.isMeshLambertMaterial||pe.isMeshBasicMaterial||pe.isMeshStandardMaterial||pe.isShaderMaterial)&&rn.setValue(Q,"isOrthographic",k.isOrthographicCamera===!0),ge!==k&&(ge=k,an=!0,Xn=!0)}if(ft.needsLights&&(Nt.state.directionalShadowMap.length>0&&rn.setValue(Q,"directionalShadowMap",Nt.state.directionalShadowMap,de),Nt.state.spotShadowMap.length>0&&rn.setValue(Q,"spotShadowMap",Nt.state.spotShadowMap,de),Nt.state.pointShadowMap.length>0&&rn.setValue(Q,"pointShadowMap",Nt.state.pointShadowMap,de)),ce.isSkinnedMesh){rn.setOptional(Q,ce,"bindMatrix"),rn.setOptional(Q,ce,"bindMatrixInverse");const ri=ce.skeleton;ri&&(ri.boneTexture===null&&ri.computeBoneTexture(),rn.setValue(Q,"boneTexture",ri.boneTexture,de))}ce.isBatchedMesh&&(rn.setOptional(Q,ce,"batchingTexture"),rn.setValue(Q,"batchingTexture",ce._matricesTexture,de),rn.setOptional(Q,ce,"batchingIdTexture"),rn.setValue(Q,"batchingIdTexture",ce._indirectTexture,de),rn.setOptional(Q,ce,"batchingColorTexture"),ce._colorsTexture!==null&&rn.setValue(Q,"batchingColorTexture",ce._colorsTexture,de));const jn=ue.morphAttributes;if((jn.position!==void 0||jn.normal!==void 0||jn.color!==void 0)&&Vt.update(ce,ue,un),(an||ft.receiveShadow!==ce.receiveShadow)&&(ft.receiveShadow=ce.receiveShadow,rn.setValue(Q,"receiveShadow",ce.receiveShadow)),pe.isMeshGouraudMaterial&&pe.envMap!==null&&(Pn.envMap.value=xe,Pn.flipEnvMap.value=xe.isCubeTexture&&xe.isRenderTargetTexture===!1?-1:1),pe.isMeshStandardMaterial&&pe.envMap===null&&ie.environment!==null&&(Pn.envMapIntensity.value=ie.environmentIntensity),Pn.dfgLUT!==void 0&&(Pn.dfgLUT.value=hL()),an&&(rn.setValue(Q,"toneMappingExposure",U.toneMappingExposure),ft.needsLights&&at(Pn,Xn),it&&pe.fog===!0&&zt.refreshFogUniforms(Pn,it),zt.refreshMaterialUniforms(Pn,pe,le,te,H.state.transmissionRenderTarget[k.id]),Zv.upload(Q,Le(ft),Pn,de)),pe.isShaderMaterial&&pe.uniformsNeedUpdate===!0&&(Zv.upload(Q,Le(ft),Pn,de),pe.uniformsNeedUpdate=!1),pe.isSpriteMaterial&&rn.setValue(Q,"center",ce.center),rn.setValue(Q,"modelViewMatrix",ce.modelViewMatrix),rn.setValue(Q,"normalMatrix",ce.normalMatrix),rn.setValue(Q,"modelMatrix",ce.matrixWorld),pe.isShaderMaterial||pe.isRawShaderMaterial){const ri=pe.uniformsGroups;for(let Si=0,Er=ri.length;Si<Er;Si++){const _s=ri[Si];Qe.update(_s,un),Qe.bind(_s,un)}}return un}function at(k,ie){k.ambientLightColor.needsUpdate=ie,k.lightProbe.needsUpdate=ie,k.directionalLights.needsUpdate=ie,k.directionalLightShadows.needsUpdate=ie,k.pointLights.needsUpdate=ie,k.pointLightShadows.needsUpdate=ie,k.spotLights.needsUpdate=ie,k.spotLightShadows.needsUpdate=ie,k.rectAreaLights.needsUpdate=ie,k.hemisphereLights.needsUpdate=ie}function st(k){return k.isMeshLambertMaterial||k.isMeshToonMaterial||k.isMeshPhongMaterial||k.isMeshStandardMaterial||k.isShadowMaterial||k.isShaderMaterial&&k.lights===!0}this.getActiveCubeFace=function(){return K},this.getActiveMipmapLevel=function(){return ne},this.getRenderTarget=function(){return $},this.setRenderTargetTextures=function(k,ie,ue){const pe=P.get(k);pe.__autoAllocateDepthBuffer=k.resolveDepthBuffer===!1,pe.__autoAllocateDepthBuffer===!1&&(pe.__useRenderToTexture=!1),P.get(k.texture).__webglTexture=ie,P.get(k.depthTexture).__webglTexture=pe.__autoAllocateDepthBuffer?void 0:ue,pe.__hasExternalTextures=!0},this.setRenderTargetFramebuffer=function(k,ie){const ue=P.get(k);ue.__webglFramebuffer=ie,ue.__useDefaultFramebuffer=ie===void 0};const tt=Q.createFramebuffer();this.setRenderTarget=function(k,ie=0,ue=0){$=k,K=ie,ne=ue;let pe=null,ce=!1,it=!1;if(k){const ht=P.get(k);if(ht.__useDefaultFramebuffer!==void 0){gt.bindFramebuffer(Q.FRAMEBUFFER,ht.__webglFramebuffer),I.copy(k.viewport),W.copy(k.scissor),ee=k.scissorTest,gt.viewport(I),gt.scissor(W),gt.setScissorTest(ee),ae=-1;return}else if(ht.__webglFramebuffer===void 0)de.setupRenderTarget(k);else if(ht.__hasExternalTextures)de.rebindTextures(k,P.get(k.texture).__webglTexture,P.get(k.depthTexture).__webglTexture);else if(k.depthBuffer){const je=k.depthTexture;if(ht.__boundDepthTexture!==je){if(je!==null&&P.has(je)&&(k.width!==je.image.width||k.height!==je.image.height))throw new Error("WebGLRenderTarget: Attached DepthTexture is initialized to the incorrect size.");de.setupDepthRenderbuffer(k)}}const xe=k.texture;(xe.isData3DTexture||xe.isDataArrayTexture||xe.isCompressedArrayTexture)&&(it=!0);const we=P.get(k).__webglFramebuffer;k.isWebGLCubeRenderTarget?(Array.isArray(we[ie])?pe=we[ie][ue]:pe=we[ie],ce=!0):k.samples>0&&de.useMultisampledRTT(k)===!1?pe=P.get(k).__webglMultisampledFramebuffer:Array.isArray(we)?pe=we[ue]:pe=we,I.copy(k.viewport),W.copy(k.scissor),ee=k.scissorTest}else I.copy(he).multiplyScalar(le).floor(),W.copy(Ee).multiplyScalar(le).floor(),ee=lt;if(ue!==0&&(pe=tt),gt.bindFramebuffer(Q.FRAMEBUFFER,pe)&>.drawBuffers(k,pe),gt.viewport(I),gt.scissor(W),gt.setScissorTest(ee),ce){const ht=P.get(k.texture);Q.framebufferTexture2D(Q.FRAMEBUFFER,Q.COLOR_ATTACHMENT0,Q.TEXTURE_CUBE_MAP_POSITIVE_X+ie,ht.__webglTexture,ue)}else if(it){const ht=ie;for(let xe=0;xe<k.textures.length;xe++){const we=P.get(k.textures[xe]);Q.framebufferTextureLayer(Q.FRAMEBUFFER,Q.COLOR_ATTACHMENT0+xe,we.__webglTexture,ue,ht)}}else if(k!==null&&ue!==0){const ht=P.get(k.texture);Q.framebufferTexture2D(Q.FRAMEBUFFER,Q.COLOR_ATTACHMENT0,Q.TEXTURE_2D,ht.__webglTexture,ue)}ae=-1},this.readRenderTargetPixels=function(k,ie,ue,pe,ce,it,ut,ht=0){if(!(k&&k.isWebGLRenderTarget)){Zt("WebGLRenderer.readRenderTargetPixels: renderTarget is not THREE.WebGLRenderTarget.");return}let xe=P.get(k).__webglFramebuffer;if(k.isWebGLCubeRenderTarget&&ut!==void 0&&(xe=xe[ut]),xe){gt.bindFramebuffer(Q.FRAMEBUFFER,xe);try{const we=k.textures[ht],je=we.format,He=we.type;if(!Lt.textureFormatReadable(je)){Zt("WebGLRenderer.readRenderTargetPixels: renderTarget is not in RGBA or implementation defined format.");return}if(!Lt.textureTypeReadable(He)){Zt("WebGLRenderer.readRenderTargetPixels: renderTarget is not in UnsignedByteType or implementation defined type.");return}ie>=0&&ie<=k.width-pe&&ue>=0&&ue<=k.height-ce&&(k.textures.length>1&&Q.readBuffer(Q.COLOR_ATTACHMENT0+ht),Q.readPixels(ie,ue,pe,ce,ot.convert(je),ot.convert(He),it))}finally{const we=$!==null?P.get($).__webglFramebuffer:null;gt.bindFramebuffer(Q.FRAMEBUFFER,we)}}},this.readRenderTargetPixelsAsync=async function(k,ie,ue,pe,ce,it,ut,ht=0){if(!(k&&k.isWebGLRenderTarget))throw new Error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not THREE.WebGLRenderTarget.");let xe=P.get(k).__webglFramebuffer;if(k.isWebGLCubeRenderTarget&&ut!==void 0&&(xe=xe[ut]),xe)if(ie>=0&&ie<=k.width-pe&&ue>=0&&ue<=k.height-ce){gt.bindFramebuffer(Q.FRAMEBUFFER,xe);const we=k.textures[ht],je=we.format,He=we.type;if(!Lt.textureFormatReadable(je))throw new Error("THREE.WebGLRenderer.readRenderTargetPixelsAsync: renderTarget is not in RGBA or implementation defined format.");if(!Lt.textureTypeReadable(He))throw new Error("THREE.WebGLRenderer.readRenderTargetPixelsAsync: renderTarget is not in UnsignedByteType or implementation defined type.");const Ve=Q.createBuffer();Q.bindBuffer(Q.PIXEL_PACK_BUFFER,Ve),Q.bufferData(Q.PIXEL_PACK_BUFFER,it.byteLength,Q.STREAM_READ),k.textures.length>1&&Q.readBuffer(Q.COLOR_ATTACHMENT0+ht),Q.readPixels(ie,ue,pe,ce,ot.convert(je),ot.convert(He),0);const At=$!==null?P.get($).__webglFramebuffer:null;gt.bindFramebuffer(Q.FRAMEBUFFER,At);const Yt=Q.fenceSync(Q.SYNC_GPU_COMMANDS_COMPLETE,0);return Q.flush(),await o2(Q,Yt,4),Q.bindBuffer(Q.PIXEL_PACK_BUFFER,Ve),Q.getBufferSubData(Q.PIXEL_PACK_BUFFER,0,it),Q.deleteBuffer(Ve),Q.deleteSync(Yt),it}else throw new Error("THREE.WebGLRenderer.readRenderTargetPixelsAsync: requested read bounds are out of range.")},this.copyFramebufferToTexture=function(k,ie=null,ue=0){const pe=Math.pow(2,-ue),ce=Math.floor(k.image.width*pe),it=Math.floor(k.image.height*pe),ut=ie!==null?ie.x:0,ht=ie!==null?ie.y:0;de.setTexture2D(k,0),Q.copyTexSubImage2D(Q.TEXTURE_2D,ue,0,0,ut,ht,ce,it),gt.unbindTexture()};const yt=Q.createFramebuffer(),dt=Q.createFramebuffer();this.copyTextureToTexture=function(k,ie,ue=null,pe=null,ce=0,it=null){it===null&&(ce!==0?(th("WebGLRenderer: copyTextureToTexture function signature has changed to support src and dst mipmap levels."),it=ce,ce=0):it=0);let ut,ht,xe,we,je,He,Ve,At,Yt;const Jt=k.isCompressedTexture?k.mipmaps[it]:k.image;if(ue!==null)ut=ue.max.x-ue.min.x,ht=ue.max.y-ue.min.y,xe=ue.isBox3?ue.max.z-ue.min.z:1,we=ue.min.x,je=ue.min.y,He=ue.isBox3?ue.min.z:0;else{const jn=Math.pow(2,-ce);ut=Math.floor(Jt.width*jn),ht=Math.floor(Jt.height*jn),k.isDataArrayTexture?xe=Jt.depth:k.isData3DTexture?xe=Math.floor(Jt.depth*jn):xe=1,we=0,je=0,He=0}pe!==null?(Ve=pe.x,At=pe.y,Yt=pe.z):(Ve=0,At=0,Yt=0);const Tt=ot.convert(ie.format),ft=ot.convert(ie.type);let Nt;ie.isData3DTexture?(de.setTexture3D(ie,0),Nt=Q.TEXTURE_3D):ie.isDataArrayTexture||ie.isCompressedArrayTexture?(de.setTexture2DArray(ie,0),Nt=Q.TEXTURE_2D_ARRAY):(de.setTexture2D(ie,0),Nt=Q.TEXTURE_2D),Q.pixelStorei(Q.UNPACK_FLIP_Y_WEBGL,ie.flipY),Q.pixelStorei(Q.UNPACK_PREMULTIPLY_ALPHA_WEBGL,ie.premultiplyAlpha),Q.pixelStorei(Q.UNPACK_ALIGNMENT,ie.unpackAlignment);const vt=Q.getParameter(Q.UNPACK_ROW_LENGTH),un=Q.getParameter(Q.UNPACK_IMAGE_HEIGHT),Wn=Q.getParameter(Q.UNPACK_SKIP_PIXELS),an=Q.getParameter(Q.UNPACK_SKIP_ROWS),Xn=Q.getParameter(Q.UNPACK_SKIP_IMAGES);Q.pixelStorei(Q.UNPACK_ROW_LENGTH,Jt.width),Q.pixelStorei(Q.UNPACK_IMAGE_HEIGHT,Jt.height),Q.pixelStorei(Q.UNPACK_SKIP_PIXELS,we),Q.pixelStorei(Q.UNPACK_SKIP_ROWS,je),Q.pixelStorei(Q.UNPACK_SKIP_IMAGES,He);const rn=k.isDataArrayTexture||k.isData3DTexture,Pn=ie.isDataArrayTexture||ie.isData3DTexture;if(k.isDepthTexture){const jn=P.get(k),ri=P.get(ie),Si=P.get(jn.__renderTarget),Er=P.get(ri.__renderTarget);gt.bindFramebuffer(Q.READ_FRAMEBUFFER,Si.__webglFramebuffer),gt.bindFramebuffer(Q.DRAW_FRAMEBUFFER,Er.__webglFramebuffer);for(let _s=0;_s<xe;_s++)rn&&(Q.framebufferTextureLayer(Q.READ_FRAMEBUFFER,Q.COLOR_ATTACHMENT0,P.get(k).__webglTexture,ce,He+_s),Q.framebufferTextureLayer(Q.DRAW_FRAMEBUFFER,Q.COLOR_ATTACHMENT0,P.get(ie).__webglTexture,it,Yt+_s)),Q.blitFramebuffer(we,je,ut,ht,Ve,At,ut,ht,Q.DEPTH_BUFFER_BIT,Q.NEAREST);gt.bindFramebuffer(Q.READ_FRAMEBUFFER,null),gt.bindFramebuffer(Q.DRAW_FRAMEBUFFER,null)}else if(ce!==0||k.isRenderTargetTexture||P.has(k)){const jn=P.get(k),ri=P.get(ie);gt.bindFramebuffer(Q.READ_FRAMEBUFFER,yt),gt.bindFramebuffer(Q.DRAW_FRAMEBUFFER,dt);for(let Si=0;Si<xe;Si++)rn?Q.framebufferTextureLayer(Q.READ_FRAMEBUFFER,Q.COLOR_ATTACHMENT0,jn.__webglTexture,ce,He+Si):Q.framebufferTexture2D(Q.READ_FRAMEBUFFER,Q.COLOR_ATTACHMENT0,Q.TEXTURE_2D,jn.__webglTexture,ce),Pn?Q.framebufferTextureLayer(Q.DRAW_FRAMEBUFFER,Q.COLOR_ATTACHMENT0,ri.__webglTexture,it,Yt+Si):Q.framebufferTexture2D(Q.DRAW_FRAMEBUFFER,Q.COLOR_ATTACHMENT0,Q.TEXTURE_2D,ri.__webglTexture,it),ce!==0?Q.blitFramebuffer(we,je,ut,ht,Ve,At,ut,ht,Q.COLOR_BUFFER_BIT,Q.NEAREST):Pn?Q.copyTexSubImage3D(Nt,it,Ve,At,Yt+Si,we,je,ut,ht):Q.copyTexSubImage2D(Nt,it,Ve,At,we,je,ut,ht);gt.bindFramebuffer(Q.READ_FRAMEBUFFER,null),gt.bindFramebuffer(Q.DRAW_FRAMEBUFFER,null)}else Pn?k.isDataTexture||k.isData3DTexture?Q.texSubImage3D(Nt,it,Ve,At,Yt,ut,ht,xe,Tt,ft,Jt.data):ie.isCompressedArrayTexture?Q.compressedTexSubImage3D(Nt,it,Ve,At,Yt,ut,ht,xe,Tt,Jt.data):Q.texSubImage3D(Nt,it,Ve,At,Yt,ut,ht,xe,Tt,ft,Jt):k.isDataTexture?Q.texSubImage2D(Q.TEXTURE_2D,it,Ve,At,ut,ht,Tt,ft,Jt.data):k.isCompressedTexture?Q.compressedTexSubImage2D(Q.TEXTURE_2D,it,Ve,At,Jt.width,Jt.height,Tt,Jt.data):Q.texSubImage2D(Q.TEXTURE_2D,it,Ve,At,ut,ht,Tt,ft,Jt);Q.pixelStorei(Q.UNPACK_ROW_LENGTH,vt),Q.pixelStorei(Q.UNPACK_IMAGE_HEIGHT,un),Q.pixelStorei(Q.UNPACK_SKIP_PIXELS,Wn),Q.pixelStorei(Q.UNPACK_SKIP_ROWS,an),Q.pixelStorei(Q.UNPACK_SKIP_IMAGES,Xn),it===0&&ie.generateMipmaps&&Q.generateMipmap(Nt),gt.unbindTexture()},this.initRenderTarget=function(k){P.get(k).__webglFramebuffer===void 0&&de.setupRenderTarget(k)},this.initTexture=function(k){k.isCubeTexture?de.setTextureCube(k,0):k.isData3DTexture?de.setTexture3D(k,0):k.isDataArrayTexture||k.isCompressedArrayTexture?de.setTexture2DArray(k,0):de.setTexture2D(k,0),gt.unbindTexture()},this.resetState=function(){K=0,ne=0,$=null,gt.reset(),Et.reset()},typeof __THREE_DEVTOOLS__<"u"&&__THREE_DEVTOOLS__.dispatchEvent(new CustomEvent("observe",{detail:this}))}get coordinateSystem(){return Zs}get outputColorSpace(){return this._outputColorSpace}set outputColorSpace(e){this._outputColorSpace=e;const t=this.getContext();t.drawingBufferColorSpace=Bn._getDrawingBufferColorSpace(e),t.unpackColorSpace=Bn._getUnpackColorSpace()}}const dL=Object.freeze(Object.defineProperty({__proto__:null,ACESFilmicToneMapping:Ig,AddEquation:sc,AddOperation:tb,AdditiveAnimationBlendMode:rx,AdditiveBlending:Yy,AgXToneMapping:Qy,AlphaFormat:ax,AlwaysCompare:hb,AlwaysDepth:Bg,AlwaysStencilFunc:lx,AmbientLight:k1,AnimationAction:nE,AnimationClip:Vu,AnimationLoader:Ww,AnimationMixer:iE,AnimationObjectGroup:_B,AnimationUtils:Yw,ArcCurve:f1,ArrayCamera:Q1,ArrowHelper:YB,AttachedBindMode:ex,Audio:$1,AudioAnalyser:lB,AudioContext:gA,AudioListener:sB,AudioLoader:nB,AxesHelper:JB,BackSide:fs,BasicDepthPacking:sb,BasicShadowMap:OM,BatchedMesh:t1,Bone:Cp,BooleanKeyframeTrack:Gu,Box2:wB,Box3:Ra,Box3Helper:kB,BoxGeometry:Du,BoxHelper:VB,BufferAttribute:Hn,BufferGeometry:pn,BufferGeometryLoader:q1,ByteType:Fg,Cache:Bo,Camera:X0,CameraHelper:zB,CanvasTexture:pw,CapsuleGeometry:gv,CatmullRomCurve3:h1,CineonToneMapping:jy,CircleGeometry:vv,ClampToEdgeWrapping:Ei,Clock:vA,Color:Ct,ColorKeyframeTrack:lA,ColorManagement:Bn,CompressedArrayTexture:hw,CompressedCubeTexture:dw,CompressedTexture:mv,CompressedTextureLoader:jw,ConeGeometry:Lp,ConstantAlphaFactor:QM,ConstantColorFactor:jM,Controls:KB,CubeCamera:Hb,CubeDepthTexture:c1,CubeReflectionMapping:qr,CubeRefractionMapping:oc,CubeTexture:Sp,CubeTextureLoader:P1,CubeUVReflectionMapping:jf,CubicBezierCurve:Wx,CubicBezierCurve3:p1,CubicInterpolant:O1,CullFaceBack:Xy,CullFaceFront:LM,CullFaceFrontBack:AR,CullFaceNone:UM,Curve:Qr,CurvePath:g1,CustomBlending:IM,CustomToneMapping:Zy,CylinderGeometry:Up,Cylindrical:RB,Data3DTexture:C0,DataArrayTexture:T0,DataTexture:_r,DataTextureLoader:cA,DataUtils:wu,DecrementStencilOp:OR,DecrementWrapStencilOp:FR,DefaultLoadingManager:H1,DepthFormat:Eo,DepthStencilFormat:cc,DepthTexture:Ch,DetachedBindMode:nb,DirectionalLight:Pv,DirectionalLightHelper:GB,DiscreteInterpolant:I1,DodecahedronGeometry:_v,DoubleSide:Ws,DstAlphaFactor:YM,DstColorFactor:qM,DynamicCopyUsage:QR,DynamicDrawUsage:JR,DynamicReadUsage:WR,EdgesGeometry:u1,EllipseCurve:Sv,EqualCompare:cb,EqualDepth:Ng,EqualStencilFunc:zR,EquirectangularReflectionMapping:Wf,EquirectangularRefractionMapping:ep,Euler:er,EventDispatcher:To,ExternalTexture:kx,ExtrudeGeometry:Rv,FileLoader:da,Float16BufferAttribute:X2,Float32BufferAttribute:Xt,FloatType:Ci,Fog:K0,FogExp2:q0,FramebufferTexture:fw,FrontSide:Yr,Frustum:Th,FrustumArray:av,GLBufferAttribute:bB,GLSL1:e2,GLSL3:cx,GreaterCompare:ub,GreaterDepth:Lg,GreaterEqualCompare:b0,GreaterEqualDepth:Ug,GreaterEqualStencilFunc:YR,GreaterStencilFunc:kR,GridHelper:HB,Group:vr,HalfFloatType:ki,HemisphereLight:G1,HemisphereLightHelper:FB,IcosahedronGeometry:zp,ImageBitmapLoader:mA,ImageLoader:Xp,ImageUtils:Ab,IncrementStencilOp:LR,IncrementWrapStencilOp:IR,InstancedBufferAttribute:xc,InstancedBufferGeometry:J1,InstancedInterleavedBuffer:MB,InstancedMesh:nv,Int16BufferAttribute:V2,Int32BufferAttribute:k2,Int8BufferAttribute:P2,IntType:np,InterleavedBuffer:yh,InterleavedBufferAttribute:Al,Interpolant:Pu,InterpolateDiscrete:Au,InterpolateLinear:uc,InterpolateSmooth:A0,InterpolationSamplingMode:i2,InterpolationSamplingType:n2,InvertStencilOp:HR,KeepStencilOp:Eu,KeyframeTrack:xr,LOD:Xb,LatheGeometry:wv,Layers:uh,LessCompare:lb,LessDepth:Dg,LessEqualCompare:M0,LessEqualDepth:vu,LessEqualStencilFunc:VR,LessStencilFunc:GR,Light:bc,LightProbe:Y1,Line:wo,Line3:NB,LineBasicMaterial:za,LineCurve:jx,LineCurve3:m1,LineDashedMaterial:U1,LineLoop:fv,LineSegments:yr,LinearFilter:Cn,LinearInterpolant:oA,LinearMipMapLinearFilter:tx,LinearMipMapNearestFilter:bR,LinearMipmapLinearFilter:Is,LinearMipmapNearestFilter:yu,LinearSRGBColorSpace:na,LinearToneMapping:Ky,LinearTransfer:hp,Loader:Ba,LoaderUtils:nr,LoadingManager:Iv,LoopOnce:cp,LoopPingPong:ab,LoopRepeat:ib,MOUSE:yR,Material:Yi,MaterialLoader:Gv,MathUtils:E0,Matrix2:bA,Matrix3:yn,Matrix4:en,MaxEquation:GM,Mesh:yi,MeshBasicMaterial:ha,MeshDepthMaterial:iA,MeshDistanceMaterial:aA,MeshLambertMaterial:D1,MeshMatcapMaterial:N1,MeshNormalMaterial:B1,MeshPhongMaterial:R1,MeshPhysicalMaterial:Ji,MeshStandardMaterial:Fu,MeshToonMaterial:w1,MinEquation:PM,MirroredRepeatWrapping:_u,MixOperation:eb,MultiplyBlending:qy,MultiplyOperation:$d,NearestFilter:Ti,NearestMipMapLinearFilter:MR,NearestMipMapNearestFilter:SR,NearestMipmapLinearFilter:lc,NearestMipmapNearestFilter:tp,NeutralToneMapping:$y,NeverCompare:ob,NeverDepth:wg,NeverStencilFunc:PR,NoBlending:Jr,NoColorSpace:dl,NoNormalPacking:wR,NoToneMapping:mr,NormalAnimationBlendMode:S0,NormalBlending:gu,NormalGAPacking:DR,NormalRGPacking:BR,NotEqualCompare:fb,NotEqualDepth:Og,NotEqualStencilFunc:XR,NumberKeyframeTrack:Sl,Object3D:Un,ObjectLoader:eB,ObjectSpaceNormalMap:rb,OctahedronGeometry:Vp,OneFactor:VM,OneMinusConstantAlphaFactor:$M,OneMinusConstantColorFactor:ZM,OneMinusDstAlphaFactor:JM,OneMinusDstColorFactor:KM,OneMinusSrcAlphaFactor:Rg,OneMinusSrcColorFactor:XM,OrthographicCamera:Tl,PCFShadowMap:Kf,PCFSoftShadowMap:Qd,PMREMGenerator:UA,Path:Ev,PerspectiveCamera:aa,Plane:Ac,PlaneGeometry:Mc,PlaneHelper:XB,PointLight:Hv,PointLightHelper:OB,Points:pv,PointsMaterial:Np,PolarGridHelper:PB,PolyhedronGeometry:Sc,PositionalAudio:oB,PropertyBinding:kn,PropertyMixer:tE,QuadraticBezierCurve:Zx,QuadraticBezierCurve3:Qx,Quaternion:Ca,QuaternionKeyframeTrack:Ml,QuaternionLinearInterpolant:F1,R11_EAC_Format:jg,RED_GREEN_RGTC2_Format:y0,RED_RGTC1_Format:v0,REVISION:Zd,RG11_EAC_Format:Qg,RGBADepthPacking:TR,RGBAFormat:Zi,RGBAIntegerFormat:Vg,RGBA_ASTC_10x10_Format:f0,RGBA_ASTC_10x5_Format:l0,RGBA_ASTC_10x6_Format:c0,RGBA_ASTC_10x8_Format:u0,RGBA_ASTC_12x10_Format:h0,RGBA_ASTC_12x12_Format:d0,RGBA_ASTC_4x4_Format:e0,RGBA_ASTC_5x4_Format:t0,RGBA_ASTC_5x5_Format:n0,RGBA_ASTC_6x5_Format:i0,RGBA_ASTC_6x6_Format:a0,RGBA_ASTC_8x5_Format:s0,RGBA_ASTC_8x6_Format:r0,RGBA_ASTC_8x8_Format:o0,RGBA_BPTC_Format:p0,RGBA_ETC2_EAC_Format:Wg,RGBA_PVRTC_2BPPV1_Format:Jg,RGBA_PVRTC_4BPPV1_Format:Yg,RGBA_S3TC_DXT1_Format:rp,RGBA_S3TC_DXT3_Format:op,RGBA_S3TC_DXT5_Format:lp,RGBDepthPacking:CR,RGBFormat:sx,RGBIntegerFormat:ER,RGB_BPTC_SIGNED_Format:m0,RGB_BPTC_UNSIGNED_Format:g0,RGB_ETC1_Format:qg,RGB_ETC2_Format:Kg,RGB_PVRTC_2BPPV1_Format:Xg,RGB_PVRTC_4BPPV1_Format:kg,RGB_S3TC_DXT1_Format:sp,RGDepthPacking:RR,RGFormat:xu,RGIntegerFormat:zg,RawShaderMaterial:nA,Ray:lh,Raycaster:SA,RectAreaLight:X1,RedFormat:ip,RedIntegerFormat:ap,ReinhardToneMapping:Wy,RenderTarget:mx,RenderTarget3D:xB,RepeatWrapping:Kr,ReplaceStencilOp:UR,ReverseSubtractEquation:HM,RingGeometry:Bv,SIGNED_R11_EAC_Format:Zg,SIGNED_RED_GREEN_RGTC2_Format:x0,SIGNED_RED_RGTC1_Format:_0,SIGNED_RG11_EAC_Format:$g,SRGBColorSpace:Xi,SRGBTransfer:si,Scene:Mp,ShaderChunk:bn,ShaderLib:eo,ShaderMaterial:ms,ShadowMaterial:C1,Shape:Ou,ShapeGeometry:Dv,ShapePath:qB,ShapeUtils:$r,ShortType:Hg,Skeleton:bh,SkeletonHelper:LB,SkinnedMesh:ev,Source:dc,Sphere:fa,SphereGeometry:kp,Spherical:CB,SphericalHarmonics3:dA,SplineCurve:$x,SpotLight:Fv,SpotLightHelper:UB,Sprite:Vb,SpriteMaterial:Lx,SrcAlphaFactor:Cg,SrcAlphaSaturateFactor:WM,SrcColorFactor:kM,StaticCopyUsage:ZR,StaticDrawUsage:dp,StaticReadUsage:KR,StereoCamera:iB,StreamCopyUsage:$R,StreamDrawUsage:qR,StreamReadUsage:jR,StringKeyframeTrack:zu,SubtractEquation:FM,SubtractiveBlending:Jy,TOUCH:xR,TangentSpaceNormalMap:fc,TetrahedronGeometry:Nv,Texture:Qn,TextureLoader:uA,TextureUtils:$B,Timer:EB,TimestampQuery:t2,TorusGeometry:Uv,TorusKnotGeometry:Lv,Triangle:Fs,TriangleFanDrawMode:bu,TriangleStripDrawMode:fp,TrianglesDrawMode:ox,TubeGeometry:Ov,UVMapping:rc,Uint16BufferAttribute:Bx,Uint32BufferAttribute:Dx,Uint8BufferAttribute:G2,Uint8ClampedBufferAttribute:z2,Uniform:AA,UniformsGroup:SB,UniformsLib:Ot,UniformsUtils:Ob,UnsignedByteType:Ta,UnsignedInt101111Type:ix,UnsignedInt248Type:Qf,UnsignedInt5999Type:nx,UnsignedIntType:js,UnsignedShort4444Type:Pg,UnsignedShort5551Type:Gg,UnsignedShortType:Zf,VSMShadowMap:mu,Vector2:nt,Vector3:Z,Vector4:pi,VectorKeyframeTrack:bl,VideoFrameTexture:uw,VideoTexture:l1,WebGL3DRenderTarget:R2,WebGLArrayRenderTarget:C2,WebGLCoordinateSystem:Zs,WebGLCubeRenderTarget:Y0,WebGLRenderTarget:ds,WebGLRenderer:HA,WebGLUtils:VE,WebGPUCoordinateSystem:$f,WebXRController:J0,WireframeGeometry:b1,WrapAroundEnding:up,ZeroCurvatureEnding:Su,ZeroFactor:zM,ZeroSlopeEnding:Mu,ZeroStencilOp:NR,createCanvasElement:mb,error:Zt,getConsoleFunction:r2,log:mp,setConsoleFunction:s2,warn:Ut,warnOnce:th},Symbol.toStringTag,{value:"Module"}));var PA={exports:{}},Cl={};var kE;function pL(){return kE||(kE=1,Cl.ConcurrentRoot=1,Cl.ContinuousEventPriority=8,Cl.DefaultEventPriority=32,Cl.DiscreteEventPriority=2,Cl.IdleEventPriority=268435456,Cl.LegacyRoot=0,Cl.NoEventPriority=0),Cl}var XE;function mL(){return XE||(XE=1,PA.exports=pL()),PA.exports}var $v=mL(),GA={exports:{}},zA={},VA={exports:{}},kA={};var YE;function gL(){if(YE)return kA;YE=1;var s=qf();function e(v,y){return v===y&&(v!==0||1/v===1/y)||v!==v&&y!==y}var t=typeof Object.is=="function"?Object.is:e,n=s.useState,i=s.useEffect,o=s.useLayoutEffect,l=s.useDebugValue;function h(v,y){var x=y(),b=n({inst:{value:x,getSnapshot:y}}),R=b[0].inst,T=b[1];return o(function(){R.value=x,R.getSnapshot=y,d(R)&&T({inst:R})},[v,x,y]),i(function(){return d(R)&&T({inst:R}),v(function(){d(R)&&T({inst:R})})},[v]),l(x),x}function d(v){var y=v.getSnapshot;v=v.value;try{var x=y();return!t(v,x)}catch{return!0}}function p(v,y){return y()}var _=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?p:h;return kA.useSyncExternalStore=s.useSyncExternalStore!==void 0?s.useSyncExternalStore:_,kA}var JE;function vL(){return JE||(JE=1,VA.exports=gL()),VA.exports}var qE;function _L(){if(qE)return zA;qE=1;var s=qf(),e=vL();function t(p,_){return p===_&&(p!==0||1/p===1/_)||p!==p&&_!==_}var n=typeof Object.is=="function"?Object.is:t,i=e.useSyncExternalStore,o=s.useRef,l=s.useEffect,h=s.useMemo,d=s.useDebugValue;return zA.useSyncExternalStoreWithSelector=function(p,_,v,y,x){var b=o(null);if(b.current===null){var R={hasValue:!1,value:null};b.current=R}else R=b.current;b=h(function(){function M(O){if(!w){if(w=!0,D=O,O=y(O),x!==void 0&&R.hasValue){var z=R.value;if(x(z,O))return N=z}return N=O}if(z=N,n(D,O))return z;var V=y(O);return x!==void 0&&x(z,V)?(D=O,z):(D=O,N=V)}var w=!1,D,N,H=v===void 0?null:v;return[function(){return M(_())},H===null?void 0:function(){return M(H())}]},[_,v,y,x]);var T=i(p,b[0],b[1]);return l(function(){R.hasValue=!0,R.value=T},[T]),d(T),T},zA}var KE;function yL(){return KE||(KE=1,GA.exports=_L()),GA.exports}var xL=yL();const AL=Iy(xL),WE=s=>{let e;const t=new Set,n=(p,_)=>{const v=typeof p=="function"?p(e):p;if(!Object.is(v,e)){const y=e;e=_??(typeof v!="object"||v===null)?v:Object.assign({},e,v),t.forEach(x=>x(e,y))}},i=()=>e,h={setState:n,getState:i,getInitialState:()=>d,subscribe:p=>(t.add(p),()=>t.delete(p))},d=e=s(n,i,h);return h},SL=(s=>s?WE(s):WE),{useSyncExternalStoreWithSelector:ML}=AL,bL=s=>s;function EL(s,e=bL,t){const n=ML(s.subscribe,s.getState,s.getInitialState,e,t);return bM.useDebugValue(n),n}const jE=(s,e)=>{const t=SL(s),n=(i,o=e)=>EL(t,i,o);return Object.assign(n,t),n},ZE=((s,e)=>s?jE(s,e):jE),TL=s=>typeof s=="object"&&typeof s.then=="function",Qu=[];function QE(s,e,t=(n,i)=>n===i){if(s===e)return!0;if(!s||!e)return!1;const n=s.length;if(e.length!==n)return!1;for(let i=0;i<n;i++)if(!t(s[i],e[i]))return!1;return!0}function $E(s,e=null,t=!1,n={}){e===null&&(e=[s]);for(const o of Qu)if(QE(e,o.keys,o.equal)){if(t)return;if(Object.prototype.hasOwnProperty.call(o,"error"))throw o.error;if(Object.prototype.hasOwnProperty.call(o,"response"))return n.lifespan&&n.lifespan>0&&(o.timeout&&clearTimeout(o.timeout),o.timeout=setTimeout(o.remove,n.lifespan)),o.response;if(!t)throw o.promise}const i={keys:e,equal:n.equal,remove:()=>{const o=Qu.indexOf(i);o!==-1&&Qu.splice(o,1)},promise:(TL(s)?s:s(...e)).then(o=>{i.response=o,n.lifespan&&n.lifespan>0&&(i.timeout=setTimeout(i.remove,n.lifespan))}).catch(o=>i.error=o)};if(Qu.push(i),!t)throw i.promise}const CL=(s,e,t)=>$E(s,e,!1,t),RL=(s,e,t)=>{$E(s,e,!0,t)},wL=s=>{if(s===void 0||s.length===0)Qu.splice(0,Qu.length);else{const e=Qu.find(t=>QE(s,t.keys,t.equal));e&&e.remove()}};var XA={exports:{}},YA={exports:{}},JA={exports:{}},qA={};var eT;function BL(){return eT||(eT=1,(function(s){function e(I,W){var ee=I.length;I.push(W);e:for(;0<ee;){var ye=ee-1>>>1,_e=I[ye];if(0<i(_e,W))I[ye]=W,I[ee]=_e,ee=ye;else break e}}function t(I){return I.length===0?null:I[0]}function n(I){if(I.length===0)return null;var W=I[0],ee=I.pop();if(ee!==W){I[0]=ee;e:for(var ye=0,_e=I.length,X=_e>>>1;ye<X;){var te=2*(ye+1)-1,le=I[te],ve=te+1,ze=I[ve];if(0>i(le,ee))ve<_e&&0>i(ze,le)?(I[ye]=ze,I[ve]=ee,ye=ve):(I[ye]=le,I[te]=ee,ye=te);else if(ve<_e&&0>i(ze,ee))I[ye]=ze,I[ve]=ee,ye=ve;else break e}}return W}function i(I,W){var ee=I.sortIndex-W.sortIndex;return ee!==0?ee:I.id-W.id}if(s.unstable_now=void 0,typeof performance=="object"&&typeof performance.now=="function"){var o=performance;s.unstable_now=function(){return o.now()}}else{var l=Date,h=l.now();s.unstable_now=function(){return l.now()-h}}var d=[],p=[],_=1,v=null,y=3,x=!1,b=!1,R=!1,T=typeof setTimeout=="function"?setTimeout:null,M=typeof clearTimeout=="function"?clearTimeout:null,w=typeof setImmediate<"u"?setImmediate:null;function D(I){for(var W=t(p);W!==null;){if(W.callback===null)n(p);else if(W.startTime<=I)n(p),W.sortIndex=W.expirationTime,e(d,W);else break;W=t(p)}}function N(I){if(R=!1,D(I),!b)if(t(d)!==null)b=!0,ae();else{var W=t(p);W!==null&&ge(N,W.startTime-I)}}var H=!1,O=-1,z=5,V=-1;function U(){return!(s.unstable_now()-V<z)}function F(){if(H){var I=s.unstable_now();V=I;var W=!0;try{e:{b=!1,R&&(R=!1,M(O),O=-1),x=!0;var ee=y;try{t:{for(D(I),v=t(d);v!==null&&!(v.expirationTime>I&&U());){var ye=v.callback;if(typeof ye=="function"){v.callback=null,y=v.priorityLevel;var _e=ye(v.expirationTime<=I);if(I=s.unstable_now(),typeof _e=="function"){v.callback=_e,D(I),W=!0;break t}v===t(d)&&n(d),D(I)}else n(d);v=t(d)}if(v!==null)W=!0;else{var X=t(p);X!==null&&ge(N,X.startTime-I),W=!1}}break e}finally{v=null,y=ee,x=!1}W=void 0}}finally{W?K():H=!1}}}var K;if(typeof w=="function")K=function(){w(F)};else if(typeof MessageChannel<"u"){var ne=new MessageChannel,$=ne.port2;ne.port1.onmessage=F,K=function(){$.postMessage(null)}}else K=function(){T(F,0)};function ae(){H||(H=!0,K())}function ge(I,W){O=T(function(){I(s.unstable_now())},W)}s.unstable_IdlePriority=5,s.unstable_ImmediatePriority=1,s.unstable_LowPriority=4,s.unstable_NormalPriority=3,s.unstable_Profiling=null,s.unstable_UserBlockingPriority=2,s.unstable_cancelCallback=function(I){I.callback=null},s.unstable_continueExecution=function(){b||x||(b=!0,ae())},s.unstable_forceFrameRate=function(I){0>I||125<I?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):z=0<I?Math.floor(1e3/I):5},s.unstable_getCurrentPriorityLevel=function(){return y},s.unstable_getFirstCallbackNode=function(){return t(d)},s.unstable_next=function(I){switch(y){case 1:case 2:case 3:var W=3;break;default:W=y}var ee=y;y=W;try{return I()}finally{y=ee}},s.unstable_pauseExecution=function(){},s.unstable_requestPaint=function(){},s.unstable_runWithPriority=function(I,W){switch(I){case 1:case 2:case 3:case 4:case 5:break;default:I=3}var ee=y;y=I;try{return W()}finally{y=ee}},s.unstable_scheduleCallback=function(I,W,ee){var ye=s.unstable_now();switch(typeof ee=="object"&&ee!==null?(ee=ee.delay,ee=typeof ee=="number"&&0<ee?ye+ee:ye):ee=ye,I){case 1:var _e=-1;break;case 2:_e=250;break;case 5:_e=1073741823;break;case 4:_e=1e4;break;default:_e=5e3}return _e=ee+_e,I={id:_++,callback:W,priorityLevel:I,startTime:ee,expirationTime:_e,sortIndex:-1},ee>ye?(I.sortIndex=ee,e(p,I),t(d)===null&&I===t(p)&&(R?(M(O),O=-1):R=!0,ge(N,ee-ye))):(I.sortIndex=_e,e(d,I),b||x||(b=!0,ae())),I},s.unstable_shouldYield=U,s.unstable_wrapCallback=function(I){var W=y;return function(){var ee=y;y=W;try{return I.apply(this,arguments)}finally{y=ee}}}})(qA)),qA}var tT;function DL(){return tT||(tT=1,JA.exports=BL()),JA.exports}var nT;function NL(){return nT||(nT=1,(function(s){s.exports=function(e){function t(c,u,g,S){return new Rm(c,u,g,S)}function n(){}function i(c){var u="https://react.dev/errors/"+c;if(1<arguments.length){u+="?args[]="+encodeURIComponent(arguments[1]);for(var g=2;g<arguments.length;g++)u+="&args[]="+encodeURIComponent(arguments[g])}return"Minified React error #"+c+"; visit "+u+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function o(c){return c===null||typeof c!="object"?null:(c=Om&&c[Om]||c["@@iterator"],typeof c=="function"?c:null)}function l(c){if(c==null)return null;if(typeof c=="function")return c.$$typeof===Xl?null:c.displayName||c.name||null;if(typeof c=="string")return c;switch(c){case Jc:return"Fragment";case or:return"Portal";case Lm:return"Profiler";case Um:return"StrictMode";case md:return"Suspense";case Qo:return"SuspenseList"}if(typeof c=="object")switch(c.$$typeof){case Ur:return(c.displayName||"Context")+".Provider";case Zo:return(c._context.displayName||"Context")+".Consumer";case qc:var u=c.render;return c=c.displayName,c||(c=u.displayName||u.name||"",c=c!==""?"ForwardRef("+c+")":"ForwardRef"),c;case Mf:return u=c.displayName||null,u!==null?u:l(c.type)||"Memo";case lr:u=c._payload,c=c._init;try{return l(c(u))}catch{}}return null}function h(c){if(gd===void 0)try{throw Error()}catch(g){var u=g.stack.trim().match(/\n( *(at )?)/);gd=u&&u[1]||"",Im=-1<g.stack.indexOf(`
|
|
4020
4020
|
at`)?" (<anonymous>)":-1<g.stack.indexOf("@")?"@unknown:0:0":""}return`
|
|
4021
4021
|
`+gd+c+Im}function d(c,u){if(!c||$o)return"";$o=!0;var g=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{var S={DetermineComponentFrameRoot:function(){try{if(u){var It=function(){throw Error()};if(Object.defineProperty(It.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(It,[])}catch(gn){var Pt=gn}Reflect.construct(c,[],It)}else{try{It.call()}catch(gn){Pt=gn}c.call(It.prototype)}}else{try{throw Error()}catch(gn){Pt=gn}(It=c())&&typeof It.catch=="function"&&It.catch(function(){})}}catch(gn){if(gn&&Pt&&typeof gn.stack=="string")return[gn.stack,Pt.stack]}return[null,null]}};S.DetermineComponentFrameRoot.displayName="DetermineComponentFrameRoot";var C=Object.getOwnPropertyDescriptor(S.DetermineComponentFrameRoot,"name");C&&C.configurable&&Object.defineProperty(S.DetermineComponentFrameRoot,"name",{value:"DetermineComponentFrameRoot"});var B=S.DetermineComponentFrameRoot(),J=B[0],se=B[1];if(J&&se){var be=J.split(`
|
|
4022
4022
|
`),Ke=se.split(`
|
|
4023
4023
|
`);for(C=S=0;S<be.length&&!be[S].includes("DetermineComponentFrameRoot");)S++;for(;C<Ke.length&&!Ke[C].includes("DetermineComponentFrameRoot");)C++;if(S===be.length||C===Ke.length)for(S=be.length-1,C=Ke.length-1;1<=S&&0<=C&&be[S]!==Ke[C];)C--;for(;1<=S&&0<=C;S--,C--)if(be[S]!==Ke[C]){if(S!==1||C!==1)do if(S--,C--,0>C||be[S]!==Ke[C]){var St=`
|
|
4024
4024
|
`+be[S].replace(" at new "," at ");return c.displayName&&St.includes("<anonymous>")&&(St=St.replace("<anonymous>",c.displayName)),St}while(1<=S&&0<=C);break}}}finally{$o=!1,Error.prepareStackTrace=g}return(g=c?c.displayName||c.name:"")?h(g):""}function p(c){switch(c.tag){case 26:case 27:case 5:return h(c.type);case 16:return h("Lazy");case 13:return h("Suspense");case 19:return h("SuspenseList");case 0:case 15:return c=d(c.type,!1),c;case 11:return c=d(c.type.render,!1),c;case 1:return c=d(c.type,!0),c;default:return""}}function _(c){try{var u="";do u+=p(c),c=c.return;while(c);return u}catch(g){return`
|
|
4025
4025
|
Error generating stack: `+g.message+`
|
|
4026
|
-
`+g.stack}}function v(c){var u=c,g=c;if(c.alternate)for(;u.return;)u=u.return;else{c=u;do u=c,(u.flags&4098)!==0&&(g=u.return),c=u.return;while(c)}return u.tag===3?g:null}function y(c){if(v(c)!==c)throw Error(i(188))}function x(c){var u=c.alternate;if(!u){if(u=v(c),u===null)throw Error(i(188));return u!==c?null:c}for(var g=c,S=u;;){var C=g.return;if(C===null)break;var B=C.alternate;if(B===null){if(S=C.return,S!==null){g=S;continue}break}if(C.child===B.child){for(B=C.child;B;){if(B===g)return y(C),c;if(B===S)return y(C),u;B=B.sibling}throw Error(i(188))}if(g.return!==S.return)g=C,S=B;else{for(var J=!1,se=C.child;se;){if(se===g){J=!0,g=C,S=B;break}if(se===S){J=!0,S=C,g=B;break}se=se.sibling}if(!J){for(se=B.child;se;){if(se===g){J=!0,g=B,S=C;break}if(se===S){J=!0,S=B,g=C;break}se=se.sibling}if(!J)throw Error(i(189))}}if(g.alternate!==S)throw Error(i(190))}if(g.tag!==3)throw Error(i(188));return g.stateNode.current===g?c:u}function b(c){var u=c.tag;if(u===5||u===26||u===27||u===6)return c;for(c=c.child;c!==null;){if(u=b(c),u!==null)return u;c=c.sibling}return null}function R(c){var u=c.tag;if(u===5||u===26||u===27||u===6)return c;for(c=c.child;c!==null;){if(c.tag!==4&&(u=R(c),u!==null))return u;c=c.sibling}return null}function T(c){return{current:c}}function M(c){0>go||(c.current=Nf[go],Nf[go]=null,go--)}function w(c,u){go++,Nf[go]=c.current,c.current=u}function D(c){return c>>>=0,c===0?32:31-(Uf(c)/cy|0)|0}function N(c){var u=c&42;if(u!==0)return u;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:return 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&4194176;case 4194304:case 8388608:case 16777216:case 33554432:return c&62914560;case 67108864:return 67108864;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 0;default:return c}}function H(c,u){var g=c.pendingLanes;if(g===0)return 0;var S=0,C=c.suspendedLanes,B=c.pingedLanes,J=c.warmLanes;c=c.finishedLanes!==0;var se=g&134217727;return se!==0?(g=se&~C,g!==0?S=N(g):(B&=se,B!==0?S=N(B):c||(J=se&~J,J!==0&&(S=N(J))))):(se=g&~C,se!==0?S=N(se):B!==0?S=N(B):c||(J=g&~J,J!==0&&(S=N(J)))),S===0?0:u!==0&&u!==S&&(u&C)===0&&(C=S&-S,J=u&-u,C>=J||C===32&&(J&4194176)!==0)?u:S}function O(c,u){return(c.pendingLanes&~(c.suspendedLanes&~c.pingedLanes)&u)===0}function z(c,u){switch(c){case 1:case 2:case 4:case 8:return u+250;case 16:case 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 u+5e3;case 4194304:case 8388608:case 16777216:case 33554432:return-1;case 67108864:case 134217728:case 268435456:case 536870912:case 1073741824:return-1;default:return-1}}function V(){var c=Zc;return Zc<<=1,(Zc&4194176)===0&&(Zc=128),c}function U(){var c=Lf;return Lf<<=1,(Lf&62914560)===0&&(Lf=4194304),c}function F(c){for(var u=[],g=0;31>g;g++)u.push(c);return u}function K(c,u){c.pendingLanes|=u,u!==268435456&&(c.suspendedLanes=0,c.pingedLanes=0,c.warmLanes=0)}function ne(c,u,g,S,C,B){var J=c.pendingLanes;c.pendingLanes=g,c.suspendedLanes=0,c.pingedLanes=0,c.warmLanes=0,c.expiredLanes&=g,c.entangledLanes&=g,c.errorRecoveryDisabledLanes&=g,c.shellSuspendCounter=0;var se=c.entanglements,be=c.expirationTimes,Ke=c.hiddenUpdates;for(g=J&~g;0<g;){var St=31-as(g),It=1<<St;se[St]=0,be[St]=-1;var Pt=Ke[St];if(Pt!==null)for(Ke[St]=null,St=0;St<Pt.length;St++){var gn=Pt[St];gn!==null&&(gn.lane&=-536870913)}g&=~It}S!==0&&$(c,S,0),B!==0&&C===0&&c.tag!==0&&(c.suspendedLanes|=B&~(J&~u))}function $(c,u,g){c.pendingLanes|=u,c.suspendedLanes&=~u;var S=31-as(u);c.entangledLanes|=u,c.entanglements[S]=c.entanglements[S]|1073741824|g&4194218}function ae(c,u){var g=c.entangledLanes|=u;for(c=c.entanglements;g;){var S=31-as(g),C=1<<S;C&u|c[S]&u&&(c[S]|=u),g&=~C}}function ge(c){return c&=-c,2<c?8<c?(c&134217727)!==0?32:268435456:8:2}function I(c){if(ss&&typeof ss.onCommitFiberRoot=="function")try{ss.onCommitFiberRoot($c,c,void 0,(c.current.flags&128)===128)}catch{}}function W(c){if(typeof dy=="function"&&dg(c),ss&&typeof ss.setStrictMode=="function")try{ss.setStrictMode($c,c)}catch{}}function ee(c,u){return c===u&&(c!==0||1/c===1/u)||c!==c&&u!==u}function ye(c,u){if(typeof c=="object"&&c!==null){var g=Ud.get(c);return g!==void 0?g:(u={value:c,source:u,stack:_(u)},Ud.set(c,u),u)}return{value:c,source:u,stack:_(u)}}function _e(c,u){vi[Ni++]=Ff,vi[Ni++]=If,If=c,Ff=u}function X(c,u,g){Ts[Cs++]=Hr,Ts[Cs++]=ks,Ts[Cs++]=cr,cr=c;var S=Hr;c=ks;var C=32-as(S)-1;S&=~(1<<C),g+=1;var B=32-as(u)+C;if(30<B){var J=C-C%5;B=(S&(1<<J)-1).toString(32),S>>=J,C-=J,Hr=1<<32-as(u)+C|g<<C|S,ks=B+c}else Hr=1<<B|g<<C|S,ks=c}function te(c){c.return!==null&&(_e(c,1),X(c,1,0))}function le(c){for(;c===If;)If=vi[--Ni],vi[Ni]=null,Ff=vi[--Ni],vi[Ni]=null;for(;c===cr;)cr=Ts[--Cs],Ts[Cs]=null,ks=Ts[--Cs],Ts[Cs]=null,Hr=Ts[--Cs],Ts[Cs]=null}function ve(c,u){w(ur,u),w(Hf,c),w(ua,null),c=Yl(u),M(ua),w(ua,c)}function ze(){M(ua),M(Hf),M(ur)}function he(c){c.memoizedState!==null&&w(eu,c);var u=ua.current,g=V_(u,c.type);u!==g&&(w(Hf,c),w(ua,g))}function Ee(c){Hf.current===c&&(M(ua),M(Hf)),eu.current===c&&(M(eu),Or?fn._currentValue=is:fn._currentValue2=is)}function lt(c){var u=Error(i(418,""));throw Wt(ye(u,c)),Pf}function Rt(c,u){if(!Ya)throw Error(i(175));YS(c.stateNode,c.type,c.memoizedProps,u,c)||lt(c)}function Bt(c){for(Fa=c.return;Fa;)switch(Fa.tag){case 3:case 27:Xs=!0;return;case 5:case 13:Xs=!1;return;default:Fa=Fa.return}}function tn(c){if(!Ya||c!==Fa)return!1;if(!Yn)return Bt(c),Yn=!0,!1;var u=!1;if(Ma?c.tag!==3&&c.tag!==27&&(c.tag!==5||ay(c.type)&&!nl(c.type,c.memoizedProps))&&(u=!0):c.tag!==3&&(c.tag!==5||ay(c.type)&&!nl(c.type,c.memoizedProps))&&(u=!0),u&&Ea&<(c),Bt(c),c.tag===13){if(!Ya)throw Error(i(316));if(c=c.memoizedState,c=c!==null?c.dehydrated:null,!c)throw Error(i(317));Ea=ny(c)}else Ea=Fa?eg(c.stateNode):null;return!0}function on(){Ya&&(Ea=Fa=null,Yn=!1)}function Wt(c){Rs===null?Rs=[c]:Rs.push(c)}function Ge(){for(var c=al,u=tu=al=0;u<c;){var g=ws[u];ws[u++]=null;var S=ws[u];ws[u++]=null;var C=ws[u];ws[u++]=null;var B=ws[u];if(ws[u++]=null,S!==null&&C!==null){var J=S.pending;J===null?C.next=C:(C.next=J.next,J.next=C),S.pending=C}B!==0&&Q(g,C,B)}}function et(c,u,g,S){ws[al++]=c,ws[al++]=u,ws[al++]=g,ws[al++]=S,tu|=S,c.lanes|=S,c=c.alternate,c!==null&&(c.lanes|=S)}function Je(c,u,g,S){return et(c,u,g,S),Dt(c)}function xt(c,u){return et(c,null,null,u),Dt(c)}function Q(c,u,g){c.lanes|=g;var S=c.alternate;S!==null&&(S.lanes|=g);for(var C=!1,B=c.return;B!==null;)B.childLanes|=g,S=B.alternate,S!==null&&(S.childLanes|=g),B.tag===22&&(c=B.stateNode,c===null||c._visibility&1||(C=!0)),c=B,B=B.return;C&&u!==null&&c.tag===3&&(B=c.stateNode,C=31-as(g),B=B.hiddenUpdates,c=B[C],c===null?B[C]=[u]:c.push(u),u.lane=g|536870912)}function Dt(c){if(50<nc)throw nc=0,Ka=null,Error(i(185));for(var u=c.return;u!==null;)c=u,u=c.return;return c.tag===3?c.stateNode:null}function mt(c){c!==Wl&&c.next===null&&(Wl===null?nu=Wl=c:Wl=Wl.next=c),zf=!0,Gf||(Gf=!0,Fe(gt))}function Ot(c,u){if(!fr&&zf){fr=!0;do for(var g=!1,S=nu;S!==null;){if(c!==0){var C=S.pendingLanes;if(C===0)var B=0;else{var J=S.suspendedLanes,se=S.pingedLanes;B=(1<<31-as(42|c)+1)-1,B&=C&~(J&~se),B=B&201326677?B&201326677|1:B?B|2:0}B!==0&&(g=!0,de(S,B))}else B=En,B=H(S,S===Rn?B:0),(B&3)===0||O(S,B)||(g=!0,de(S,B));S=S.next}while(g);fr=!1}}function gt(){zf=Gf=!1;var c=0;sl!==0&&(il()&&(c=sl),sl=0);for(var u=ba(),g=null,S=nu;S!==null;){var C=S.next,B=j(S,u);B===0?(S.next=null,g===null?nu=C:g.next=C,C===null&&(Wl=g)):(g=S,(c!==0||(B&3)!==0)&&(zf=!0)),S=C}Ot(c)}function j(c,u){for(var g=c.suspendedLanes,S=c.pingedLanes,C=c.expirationTimes,B=c.pendingLanes&-62914561;0<B;){var J=31-as(B),se=1<<J,be=C[J];be===-1?((se&g)===0||(se&S)!==0)&&(C[J]=z(se,u)):be<=u&&(c.expiredLanes|=se),B&=~se}if(u=Rn,g=En,g=H(c,c===u?g:0),S=c.callbackNode,g===0||c===u&&li===2||c.cancelPendingCommit!==null)return S!==null&&S!==null&&Of(S),c.callbackNode=null,c.callbackPriority=0;if((g&3)===0||O(c,g)){if(u=g&-g,u===c.callbackPriority)return u;switch(S!==null&&Of(S),ge(g)){case 2:case 8:g=hy;break;case 32:g=Dd;break;case 268435456:g=Nd;break;default:g=Dd}return S=P.bind(null,c),g=Qc(g,S),c.callbackPriority=u,c.callbackNode=g,u}return S!==null&&S!==null&&Of(S),c.callbackPriority=2,c.callbackNode=null,2}function P(c,u){var g=c.callbackNode;if(la()&&c.callbackNode!==g)return null;var S=En;return S=H(c,c===Rn?S:0),S===0?null:(_f(c,S,u),j(c,ba()),c.callbackNode!=null&&c.callbackNode===g?P.bind(null,c):null)}function de(c,u){if(la())return null;_f(c,u,!0)}function Fe(c){Ki?xd(function(){($t&6)!==0?Qc(hg,c):c()}):Qc(hg,c)}function ke(){return sl===0&&(sl=V()),sl}function Ie(c,u){if(Vf===null){var g=Vf=[];Ld=0,rs=ke(),rl={status:"pending",value:void 0,then:function(S){g.push(S)}}}return Ld++,u.then(Ft,Ft),u}function Ft(){if(--Ld===0&&Vf!==null){rl!==null&&(rl.status="fulfilled");var c=Vf;Vf=null,rs=0,rl=null;for(var u=0;u<c.length;u++)(0,c[u])()}}function Mt(c,u){var g=[],S={status:"pending",value:null,reason:null,then:function(C){g.push(C)}};return c.then(function(){S.status="fulfilled",S.value=u;for(var C=0;C<g.length;C++)(0,g[C])(u)},function(C){for(S.status="rejected",S.reason=C,C=0;C<g.length;C++)(0,g[C])(void 0)}),S}function Ht(c){c.updateQueue={baseState:c.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function zt(c,u){c=c.updateQueue,u.updateQueue===c&&(u.updateQueue={baseState:c.baseState,firstBaseUpdate:c.firstBaseUpdate,lastBaseUpdate:c.lastBaseUpdate,shared:c.shared,callbacks:null})}function Ye(c){return{lane:c,tag:0,payload:null,callback:null,next:null}}function qe(c,u,g){var S=c.updateQueue;if(S===null)return null;if(S=S.shared,($t&2)!==0){var C=S.pending;return C===null?u.next=u:(u.next=C.next,C.next=u),S.pending=u,u=Dt(c),Q(c,null,g),u}return et(c,S,u,g),Dt(c)}function wt(c,u,g){if(u=u.updateQueue,u!==null&&(u=u.shared,(g&4194176)!==0)){var S=u.lanes;S&=c.pendingLanes,g|=S,u.lanes=g,ae(c,g)}}function bt(c,u){var g=c.updateQueue,S=c.alternate;if(S!==null&&(S=S.updateQueue,g===S)){var C=null,B=null;if(g=g.firstBaseUpdate,g!==null){do{var J={lane:g.lane,tag:g.tag,payload:g.payload,callback:null,next:null};B===null?C=B=J:B=B.next=J,g=g.next}while(g!==null);B===null?C=B=u:B=B.next=u}else C=B=u;g={baseState:S.baseState,firstBaseUpdate:C,lastBaseUpdate:B,shared:S.shared,callbacks:S.callbacks},c.updateQueue=g;return}c=g.lastBaseUpdate,c===null?g.firstBaseUpdate=u:c.next=u,g.lastBaseUpdate=u}function rt(){if(iu){var c=rl;if(c!==null)throw c}}function Vt(c,u,g,S){iu=!1;var C=c.updateQueue;vo=!1;var B=C.firstBaseUpdate,J=C.lastBaseUpdate,se=C.shared.pending;if(se!==null){C.shared.pending=null;var be=se,Ke=be.next;be.next=null,J===null?B=Ke:J.next=Ke,J=be;var St=c.alternate;St!==null&&(St=St.updateQueue,se=St.lastBaseUpdate,se!==J&&(se===null?St.firstBaseUpdate=Ke:se.next=Ke,St.lastBaseUpdate=be))}if(B!==null){var It=C.baseState;J=0,St=Ke=be=null,se=B;do{var Pt=se.lane&-536870913,gn=Pt!==se.lane;if(gn?(En&Pt)===Pt:(S&Pt)===Pt){Pt!==0&&Pt===rs&&(iu=!0),St!==null&&(St=St.next={lane:0,tag:se.tag,payload:se.payload,callback:null,next:null});e:{var us=c,Jf=se;Pt=u;var ic=g;switch(Jf.tag){case 1:if(us=Jf.payload,typeof us=="function"){It=us.call(ic,It,Pt);break e}It=us;break e;case 3:us.flags=us.flags&-65537|128;case 0:if(us=Jf.payload,Pt=typeof us=="function"?us.call(ic,It,Pt):us,Pt==null)break e;It=kl({},It,Pt);break e;case 2:vo=!0}}Pt=se.callback,Pt!==null&&(c.flags|=64,gn&&(c.flags|=8192),gn=C.callbacks,gn===null?C.callbacks=[Pt]:gn.push(Pt))}else gn={lane:Pt,tag:se.tag,payload:se.payload,callback:se.callback,next:null},St===null?(Ke=St=gn,be=It):St=St.next=gn,J|=Pt;if(se=se.next,se===null){if(se=C.shared.pending,se===null)break;gn=se,se=gn.next,gn.next=null,C.lastBaseUpdate=gn,C.shared.pending=null}}while(!0);St===null&&(be=It),C.baseState=be,C.firstBaseUpdate=Ke,C.lastBaseUpdate=St,B===null&&(C.shared.lanes=0),Us|=J,c.lanes=J,c.memoizedState=It}}function fe(c,u){if(typeof c!="function")throw Error(i(191,c));c.call(u)}function Ne(c,u){var g=c.callbacks;if(g!==null)for(c.callbacks=null,c=0;c<g.length;c++)fe(g[c],u)}function ot(c,u){if(Es(c,u))return!0;if(typeof c!="object"||c===null||typeof u!="object"||u===null)return!1;var g=Object.keys(c),S=Object.keys(u);if(g.length!==S.length)return!1;for(S=0;S<g.length;S++){var C=g[S];if(!kf.call(u,C)||!Es(c[C],u[C]))return!1}return!0}function Et(c){return c=c.status,c==="fulfilled"||c==="rejected"}function Qe(){}function We(c,u,g){switch(g=c[g],g===void 0?c.push(u):g!==u&&(u.then(Qe,Qe),u=g),u.status){case"fulfilled":return u.value;case"rejected":throw c=u.reason,c===ai?Error(i(483)):c;default:if(typeof u.status=="string")u.then(Qe,Qe);else{if(c=Rn,c!==null&&100<c.shellSuspendCounter)throw Error(i(482));c=u,c.status="pending",c.then(function(S){if(u.status==="pending"){var C=u;C.status="fulfilled",C.value=S}},function(S){if(u.status==="pending"){var C=u;C.status="rejected",C.reason=S}})}switch(u.status){case"fulfilled":return u.value;case"rejected":throw c=u.reason,c===ai?Error(i(483)):c}throw jl=u,ai}}function _t(){if(jl===null)throw Error(i(459));var c=jl;return jl=null,c}function nn(c){var u=Ys;return Ys+=1,Pr===null&&(Pr=[]),We(Pr,c,u)}function wn(c,u){u=u.props.ref,c.ref=u!==void 0?u:null}function Mn(c,u){throw u.$$typeof===Nm?Error(i(525)):(c=Object.prototype.toString.call(u),Error(i(31,c==="[object Object]"?"object with keys {"+Object.keys(u).join(", ")+"}":c)))}function Fi(c){var u=c._init;return u(c._payload)}function va(c){function u(Be,Ae){if(c){var Oe=Be.deletions;Oe===null?(Be.deletions=[Ae],Be.flags|=16):Oe.push(Ae)}}function g(Be,Ae){if(!c)return null;for(;Ae!==null;)u(Be,Ae),Ae=Ae.sibling;return null}function S(Be){for(var Ae=new Map;Be!==null;)Be.key!==null?Ae.set(Be.key,Be):Ae.set(Be.index,Be),Be=Be.sibling;return Ae}function C(Be,Ae){return Be=Oa(Be,Ae),Be.index=0,Be.sibling=null,Be}function B(Be,Ae,Oe){return Be.index=Oe,c?(Oe=Be.alternate,Oe!==null?(Oe=Oe.index,Oe<Ae?(Be.flags|=33554434,Ae):Oe):(Be.flags|=33554434,Ae)):(Be.flags|=1048576,Ae)}function J(Be){return c&&Be.alternate===null&&(Be.flags|=33554434),Be}function se(Be,Ae,Oe,pt){return Ae===null||Ae.tag!==6?(Ae=jo(Oe,Be.mode,pt),Ae.return=Be,Ae):(Ae=C(Ae,Oe),Ae.return=Be,Ae)}function be(Be,Ae,Oe,pt){var jt=Oe.type;return jt===Jc?St(Be,Ae,Oe.props.children,pt,Oe.key):Ae!==null&&(Ae.elementType===jt||typeof jt=="object"&&jt!==null&&jt.$$typeof===lr&&Fi(jt)===Ae.type)?(Ae=C(Ae,Oe.props),wn(Ae,Oe),Ae.return=Be,Ae):(Ae=zs(Oe.type,Oe.key,Oe.props,null,Be.mode,pt),wn(Ae,Oe),Ae.return=Be,Ae)}function Ke(Be,Ae,Oe,pt){return Ae===null||Ae.tag!==4||Ae.stateNode.containerInfo!==Oe.containerInfo||Ae.stateNode.implementation!==Oe.implementation?(Ae=Yc(Oe,Be.mode,pt),Ae.return=Be,Ae):(Ae=C(Ae,Oe.children||[]),Ae.return=Be,Ae)}function St(Be,Ae,Oe,pt,jt){return Ae===null||Ae.tag!==7?(Ae=uo(Oe,Be.mode,pt,jt),Ae.return=Be,Ae):(Ae=C(Ae,Oe),Ae.return=Be,Ae)}function It(Be,Ae,Oe){if(typeof Ae=="string"&&Ae!==""||typeof Ae=="number"||typeof Ae=="bigint")return Ae=jo(""+Ae,Be.mode,Oe),Ae.return=Be,Ae;if(typeof Ae=="object"&&Ae!==null){switch(Ae.$$typeof){case fo:return Oe=zs(Ae.type,Ae.key,Ae.props,null,Be.mode,Oe),wn(Oe,Ae),Oe.return=Be,Oe;case or:return Ae=Yc(Ae,Be.mode,Oe),Ae.return=Be,Ae;case lr:var pt=Ae._init;return Ae=pt(Ae._payload),It(Be,Ae,Oe)}if(el(Ae)||o(Ae))return Ae=uo(Ae,Be.mode,Oe,null),Ae.return=Be,Ae;if(typeof Ae.then=="function")return It(Be,nn(Ae),Oe);if(Ae.$$typeof===Ur)return It(Be,df(Be,Ae),Oe);Mn(Be,Ae)}return null}function Pt(Be,Ae,Oe,pt){var jt=Ae!==null?Ae.key:null;if(typeof Oe=="string"&&Oe!==""||typeof Oe=="number"||typeof Oe=="bigint")return jt!==null?null:se(Be,Ae,""+Oe,pt);if(typeof Oe=="object"&&Oe!==null){switch(Oe.$$typeof){case fo:return Oe.key===jt?be(Be,Ae,Oe,pt):null;case or:return Oe.key===jt?Ke(Be,Ae,Oe,pt):null;case lr:return jt=Oe._init,Oe=jt(Oe._payload),Pt(Be,Ae,Oe,pt)}if(el(Oe)||o(Oe))return jt!==null?null:St(Be,Ae,Oe,pt,null);if(typeof Oe.then=="function")return Pt(Be,Ae,nn(Oe),pt);if(Oe.$$typeof===Ur)return Pt(Be,Ae,df(Be,Oe),pt);Mn(Be,Oe)}return null}function gn(Be,Ae,Oe,pt,jt){if(typeof pt=="string"&&pt!==""||typeof pt=="number"||typeof pt=="bigint")return Be=Be.get(Oe)||null,se(Ae,Be,""+pt,jt);if(typeof pt=="object"&&pt!==null){switch(pt.$$typeof){case fo:return Be=Be.get(pt.key===null?Oe:pt.key)||null,be(Ae,Be,pt,jt);case or:return Be=Be.get(pt.key===null?Oe:pt.key)||null,Ke(Ae,Be,pt,jt);case lr:var fi=pt._init;return pt=fi(pt._payload),gn(Be,Ae,Oe,pt,jt)}if(el(pt)||o(pt))return Be=Be.get(Oe)||null,St(Ae,Be,pt,jt,null);if(typeof pt.then=="function")return gn(Be,Ae,Oe,nn(pt),jt);if(pt.$$typeof===Ur)return gn(Be,Ae,Oe,df(Ae,pt),jt);Mn(Ae,pt)}return null}function us(Be,Ae,Oe,pt){for(var jt=null,fi=null,hn=Ae,qn=Ae=0,ta=null;hn!==null&&qn<Oe.length;qn++){hn.index>qn?(ta=hn,hn=null):ta=hn.sibling;var Kn=Pt(Be,hn,Oe[qn],pt);if(Kn===null){hn===null&&(hn=ta);break}c&&hn&&Kn.alternate===null&&u(Be,hn),Ae=B(Kn,Ae,qn),fi===null?jt=Kn:fi.sibling=Kn,fi=Kn,hn=ta}if(qn===Oe.length)return g(Be,hn),Yn&&_e(Be,qn),jt;if(hn===null){for(;qn<Oe.length;qn++)hn=It(Be,Oe[qn],pt),hn!==null&&(Ae=B(hn,Ae,qn),fi===null?jt=hn:fi.sibling=hn,fi=hn);return Yn&&_e(Be,qn),jt}for(hn=S(hn);qn<Oe.length;qn++)ta=gn(hn,Be,qn,Oe[qn],pt),ta!==null&&(c&&ta.alternate!==null&&hn.delete(ta.key===null?qn:ta.key),Ae=B(ta,Ae,qn),fi===null?jt=ta:fi.sibling=ta,fi=ta);return c&&hn.forEach(function(bo){return u(Be,bo)}),Yn&&_e(Be,qn),jt}function Jf(Be,Ae,Oe,pt){if(Oe==null)throw Error(i(151));for(var jt=null,fi=null,hn=Ae,qn=Ae=0,ta=null,Kn=Oe.next();hn!==null&&!Kn.done;qn++,Kn=Oe.next()){hn.index>qn?(ta=hn,hn=null):ta=hn.sibling;var bo=Pt(Be,hn,Kn.value,pt);if(bo===null){hn===null&&(hn=ta);break}c&&hn&&bo.alternate===null&&u(Be,hn),Ae=B(bo,Ae,qn),fi===null?jt=bo:fi.sibling=bo,fi=bo,hn=ta}if(Kn.done)return g(Be,hn),Yn&&_e(Be,qn),jt;if(hn===null){for(;!Kn.done;qn++,Kn=Oe.next())Kn=It(Be,Kn.value,pt),Kn!==null&&(Ae=B(Kn,Ae,qn),fi===null?jt=Kn:fi.sibling=Kn,fi=Kn);return Yn&&_e(Be,qn),jt}for(hn=S(hn);!Kn.done;qn++,Kn=Oe.next())Kn=gn(hn,Be,qn,Kn.value,pt),Kn!==null&&(c&&Kn.alternate!==null&&hn.delete(Kn.key===null?qn:Kn.key),Ae=B(Kn,Ae,qn),fi===null?jt=Kn:fi.sibling=Kn,fi=Kn);return c&&hn.forEach(function(kd){return u(Be,kd)}),Yn&&_e(Be,qn),jt}function ic(Be,Ae,Oe,pt){if(typeof Oe=="object"&&Oe!==null&&Oe.type===Jc&&Oe.key===null&&(Oe=Oe.props.children),typeof Oe=="object"&&Oe!==null){switch(Oe.$$typeof){case fo:e:{for(var jt=Oe.key;Ae!==null;){if(Ae.key===jt){if(jt=Oe.type,jt===Jc){if(Ae.tag===7){g(Be,Ae.sibling),pt=C(Ae,Oe.props.children),pt.return=Be,Be=pt;break e}}else if(Ae.elementType===jt||typeof jt=="object"&&jt!==null&&jt.$$typeof===lr&&Fi(jt)===Ae.type){g(Be,Ae.sibling),pt=C(Ae,Oe.props),wn(pt,Oe),pt.return=Be,Be=pt;break e}g(Be,Ae);break}else u(Be,Ae);Ae=Ae.sibling}Oe.type===Jc?(pt=uo(Oe.props.children,Be.mode,pt,Oe.key),pt.return=Be,Be=pt):(pt=zs(Oe.type,Oe.key,Oe.props,null,Be.mode,pt),wn(pt,Oe),pt.return=Be,Be=pt)}return J(Be);case or:e:{for(jt=Oe.key;Ae!==null;){if(Ae.key===jt)if(Ae.tag===4&&Ae.stateNode.containerInfo===Oe.containerInfo&&Ae.stateNode.implementation===Oe.implementation){g(Be,Ae.sibling),pt=C(Ae,Oe.children||[]),pt.return=Be,Be=pt;break e}else{g(Be,Ae);break}else u(Be,Ae);Ae=Ae.sibling}pt=Yc(Oe,Be.mode,pt),pt.return=Be,Be=pt}return J(Be);case lr:return jt=Oe._init,Oe=jt(Oe._payload),ic(Be,Ae,Oe,pt)}if(el(Oe))return us(Be,Ae,Oe,pt);if(o(Oe)){if(jt=o(Oe),typeof jt!="function")throw Error(i(150));return Oe=jt.call(Oe),Jf(Be,Ae,Oe,pt)}if(typeof Oe.then=="function")return ic(Be,Ae,nn(Oe),pt);if(Oe.$$typeof===Ur)return ic(Be,Ae,df(Be,Oe),pt);Mn(Be,Oe)}return typeof Oe=="string"&&Oe!==""||typeof Oe=="number"||typeof Oe=="bigint"?(Oe=""+Oe,Ae!==null&&Ae.tag===6?(g(Be,Ae.sibling),pt=C(Ae,Oe),pt.return=Be,Be=pt):(g(Be,Ae),pt=jo(Oe,Be.mode,pt),pt.return=Be,Be=pt),J(Be)):g(Be,Ae)}return function(Be,Ae,Oe,pt){try{Ys=0;var jt=ic(Be,Ae,Oe,pt);return Pr=null,jt}catch(hn){if(hn===ai)throw hn;var fi=t(29,hn,null,Be.mode);return fi.lanes=pt,fi.return=Be,fi}}}function br(c,u){c=hr,w(Bs,c),w(Gr,u),hr=c|u.baseLanes}function ir(){w(Bs,hr),w(Gr,Gr.current)}function _a(){hr=Bs.current,M(Gr),M(Bs)}function sa(c){var u=c.alternate;w(Wi,Wi.current&1),w(Ds,c),Js===null&&(u===null||Gr.current!==null||u.memoizedState!==null)&&(Js=c)}function Da(c){if(c.tag===22){if(w(Wi,Wi.current),w(Ds,c),Js===null){var u=c.alternate;u!==null&&u.memoizedState!==null&&(Js=c)}}else wi()}function wi(){w(Wi,Wi.current),w(Ds,Ds.current)}function kt(c){M(Ds),Js===c&&(Js=null),M(Wi)}function Ai(c){for(var u=c;u!==null;){if(u.tag===13){var g=u.memoizedState;if(g!==null&&(g=g.dehydrated,g===null||Ed(g)||Df(g)))return u}else if(u.tag===19&&u.memoizedProps.revealOrder!==void 0){if((u.flags&128)!==0)return u}else if(u.child!==null){u.child.return=u,u=u.child;continue}if(u===c)break;for(;u.sibling===null;){if(u.return===null||u.return===c)return null;u=u.return}u.sibling.return=u.return,u=u.sibling}return null}function mn(){throw Error(i(321))}function G(c,u){if(u===null)return!1;for(var g=0;g<u.length&&g<c.length;g++)if(!Es(c[g],u[g]))return!1;return!0}function q(c,u,g,S,C,B){return zr=B,xn=u,u.memoizedState=null,u.updateQueue=null,u.lanes=0,ln.H=c===null||c.memoizedState===null?ji:Ha,_o=!1,B=g(S,C),_o=!1,_i&&(B=Te(u,g,S,C)),oe(c),B}function oe(c){ln.H=Jn;var u=Zn!==null&&Zn.next!==null;if(zr=0,Pi=Zn=xn=null,qs=!1,Ui=0,au=null,u)throw Error(i(300));c===null||Gi||(c=c.dependencies,c!==null&&Po(c)&&(Gi=!0))}function Te(c,u,g,S){xn=c;var C=0;do{if(_i&&(au=null),Ui=0,_i=!1,25<=C)throw Error(i(301));if(C+=1,Pi=Zn=null,c.updateQueue!=null){var B=c.updateQueue;B.lastEffect=null,B.events=null,B.stores=null,B.memoCache!=null&&(B.memoCache.index=0)}ln.H=ll,B=u(g,S)}while(_i);return B}function Le(){var c=ln.H,u=c.useState()[0];return u=typeof u.then=="function"?yt(u):u,c=c.useState()[0],(Zn!==null?Zn.memoizedState:null)!==c&&(xn.flags|=1024),u}function Ue(){var c=Xf!==0;return Xf=0,c}function ct(c,u,g){u.updateQueue=c.updateQueue,u.flags&=-2053,c.lanes&=~g}function at(c){if(qs){for(c=c.memoizedState;c!==null;){var u=c.queue;u!==null&&(u.pending=null),c=c.next}qs=!1}zr=0,Pi=Zn=xn=null,_i=!1,Ui=Xf=0,au=null}function st(){var c={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return Pi===null?xn.memoizedState=Pi=c:Pi=Pi.next=c,Pi}function tt(){if(Zn===null){var c=xn.alternate;c=c!==null?c.memoizedState:null}else c=Zn.next;var u=Pi===null?xn.memoizedState:Pi.next;if(u!==null)Pi=u,Zn=c;else{if(c===null)throw xn.alternate===null?Error(i(467)):Error(i(310));Zn=c,c={memoizedState:Zn.memoizedState,baseState:Zn.baseState,baseQueue:Zn.baseQueue,queue:Zn.queue,next:null},Pi===null?xn.memoizedState=Pi=c:Pi=Pi.next=c}return Pi}function yt(c){var u=Ui;return Ui+=1,au===null&&(au=[]),c=We(au,c,u),u=xn,(Pi===null?u.memoizedState:Pi.next)===null&&(u=u.alternate,ln.H=u===null||u.memoizedState===null?ji:Ha),c}function dt(c){if(c!==null&&typeof c=="object"){if(typeof c.then=="function")return yt(c);if(c.$$typeof===Ur)return xa(c)}throw Error(i(438,String(c)))}function k(c){var u=null,g=xn.updateQueue;if(g!==null&&(u=g.memoCache),u==null){var S=xn.alternate;S!==null&&(S=S.updateQueue,S!==null&&(S=S.memoCache,S!=null&&(u={data:S.data.map(function(C){return C.slice()}),index:0})))}if(u==null&&(u={data:[],index:0}),g===null&&(g=Id(),xn.updateQueue=g),g.memoCache=u,g=u.data[u.index],g===void 0)for(g=u.data[u.index]=Array(c),S=0;S<c;S++)g[S]=z_;return u.index++,g}function ie(c,u){return typeof u=="function"?u(c):u}function ue(c){var u=tt();return pe(u,Zn,c)}function pe(c,u,g){var S=c.queue;if(S===null)throw Error(i(311));S.lastRenderedReducer=g;var C=c.baseQueue,B=S.pending;if(B!==null){if(C!==null){var J=C.next;C.next=B.next,B.next=J}u.baseQueue=C=B,S.pending=null}if(B=c.baseState,C===null)c.memoizedState=B;else{u=C.next;var se=J=null,be=null,Ke=u,St=!1;do{var It=Ke.lane&-536870913;if(It!==Ke.lane?(En&It)===It:(zr&It)===It){var Pt=Ke.revertLane;if(Pt===0)be!==null&&(be=be.next={lane:0,revertLane:0,action:Ke.action,hasEagerState:Ke.hasEagerState,eagerState:Ke.eagerState,next:null}),It===rs&&(St=!0);else if((zr&Pt)===Pt){Ke=Ke.next,Pt===rs&&(St=!0);continue}else It={lane:0,revertLane:Ke.revertLane,action:Ke.action,hasEagerState:Ke.hasEagerState,eagerState:Ke.eagerState,next:null},be===null?(se=be=It,J=B):be=be.next=It,xn.lanes|=Pt,Us|=Pt;It=Ke.action,_o&&g(B,It),B=Ke.hasEagerState?Ke.eagerState:g(B,It)}else Pt={lane:It,revertLane:Ke.revertLane,action:Ke.action,hasEagerState:Ke.hasEagerState,eagerState:Ke.eagerState,next:null},be===null?(se=be=Pt,J=B):be=be.next=Pt,xn.lanes|=It,Us|=It;Ke=Ke.next}while(Ke!==null&&Ke!==u);if(be===null?J=B:be.next=se,!Es(B,c.memoizedState)&&(Gi=!0,St&&(g=rl,g!==null)))throw g;c.memoizedState=B,c.baseState=J,c.baseQueue=be,S.lastRenderedState=B}return C===null&&(S.lanes=0),[c.memoizedState,S.dispatch]}function ce(c){var u=tt(),g=u.queue;if(g===null)throw Error(i(311));g.lastRenderedReducer=c;var S=g.dispatch,C=g.pending,B=u.memoizedState;if(C!==null){g.pending=null;var J=C=C.next;do B=c(B,J.action),J=J.next;while(J!==C);Es(B,u.memoizedState)||(Gi=!0),u.memoizedState=B,u.baseQueue===null&&(u.baseState=B),g.lastRenderedState=B}return[B,S]}function it(c,u,g){var S=xn,C=tt(),B=Yn;if(B){if(g===void 0)throw Error(i(407));g=g()}else g=u();var J=!Es((Zn||C).memoizedState,g);if(J&&(C.memoizedState=g,Gi=!0),C=C.queue,_s(xe.bind(null,S,C,c),[c]),C.getSnapshot!==u||J||Pi!==null&&Pi.memoizedState.tag&1){if(S.flags|=2048,Pn(9,ht.bind(null,S,C,g,u),{destroy:void 0},null),Rn===null)throw Error(i(349));B||(zr&60)!==0||ut(S,u,g)}return g}function ut(c,u,g){c.flags|=16384,c={getSnapshot:u,value:g},u=xn.updateQueue,u===null?(u=Id(),xn.updateQueue=u,u.stores=[c]):(g=u.stores,g===null?u.stores=[c]:g.push(c))}function ht(c,u,g,S){u.value=g,u.getSnapshot=S,we(u)&&je(c)}function xe(c,u,g){return g(function(){we(u)&&je(c)})}function we(c){var u=c.getSnapshot;c=c.value;try{var g=u();return!Es(c,g)}catch{return!0}}function je(c){var u=xt(c,2);u!==null&&La(u,c,2)}function He(c){var u=st();if(typeof c=="function"){var g=c;if(c=g(),_o){W(!0);try{g()}finally{W(!1)}}}return u.memoizedState=u.baseState=c,u.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:ie,lastRenderedState:c},u}function Ve(c,u,g,S){return c.baseState=g,pe(c,Zn,typeof S=="function"?S:ie)}function At(c,u,g,S,C){if(Ul(c))throw Error(i(485));if(c=u.action,c!==null){var B={payload:C,action:c,next:null,isTransition:!0,status:"pending",value:null,reason:null,listeners:[],then:function(J){B.listeners.push(J)}};ln.T!==null?g(!0):B.isTransition=!1,S(B),g=u.pending,g===null?(B.next=u.pending=B,Yt(u,B)):(B.next=g.next,u.pending=g.next=B)}}function Yt(c,u){var g=u.action,S=u.payload,C=c.state;if(u.isTransition){var B=ln.T,J={};ln.T=J;try{var se=g(C,S),be=ln.S;be!==null&&be(J,se),Jt(c,u,se)}catch(Ke){ft(c,u,Ke)}finally{ln.T=B}}else try{B=g(C,S),Jt(c,u,B)}catch(Ke){ft(c,u,Ke)}}function Jt(c,u,g){g!==null&&typeof g=="object"&&typeof g.then=="function"?g.then(function(S){Tt(c,u,S)},function(S){return ft(c,u,S)}):Tt(c,u,g)}function Tt(c,u,g){u.status="fulfilled",u.value=g,Nt(u),c.state=g,u=c.pending,u!==null&&(g=u.next,g===u?c.pending=null:(g=g.next,u.next=g,Yt(c,g)))}function ft(c,u,g){var S=c.pending;if(c.pending=null,S!==null){S=S.next;do u.status="rejected",u.reason=g,Nt(u),u=u.next;while(u!==S)}c.action=null}function Nt(c){c=c.listeners;for(var u=0;u<c.length;u++)(0,c[u])()}function vt(c,u){return u}function un(c,u){if(Yn){var g=Rn.formState;if(g!==null){e:{var S=xn;if(Yn){if(Ea){var C=K_(Ea,Xs);if(C){Ea=eg(C),S=W_(C);break e}}lt(S)}S=!1}S&&(u=g[0])}}g=st(),g.memoizedState=g.baseState=u,S={pending:null,lanes:0,dispatch:null,lastRenderedReducer:vt,lastRenderedState:u},g.queue=S,g=qh.bind(null,xn,S),S.dispatch=g,S=He(!1);var B=Kh.bind(null,xn,!1,S.queue);return S=st(),C={state:u,dispatch:null,action:c,pending:null},S.queue=C,g=At.bind(null,xn,C,B,g),C.dispatch=g,S.memoizedState=c,[u,g,!1]}function Wn(c){var u=tt();return an(u,Zn,c)}function an(c,u,g){u=pe(c,u,vt)[0],c=ue(ie)[0],u=typeof u=="object"&&u!==null&&typeof u.then=="function"?yt(u):u;var S=tt(),C=S.queue,B=C.dispatch;return g!==S.memoizedState&&(xn.flags|=2048,Pn(9,Xn.bind(null,C,g),{destroy:void 0},null)),[u,B,c]}function Xn(c,u){c.action=u}function rn(c){var u=tt(),g=Zn;if(g!==null)return an(u,g,c);tt(),u=u.memoizedState,g=tt();var S=g.queue.dispatch;return g.memoizedState=c,[u,S,!1]}function Pn(c,u,g,S){return c={tag:c,create:u,inst:g,deps:S,next:null},u=xn.updateQueue,u===null&&(u=Id(),xn.updateQueue=u),g=u.lastEffect,g===null?u.lastEffect=c.next=c:(S=g.next,g.next=c,c.next=S,u.lastEffect=c),c}function jn(){return tt().memoizedState}function ri(c,u,g,S){var C=st();xn.flags|=c,C.memoizedState=Pn(1|u,g,{destroy:void 0},S===void 0?null:S)}function Si(c,u,g,S){var C=tt();S=S===void 0?null:S;var B=C.memoizedState.inst;Zn!==null&&S!==null&&G(S,Zn.memoizedState.deps)?C.memoizedState=Pn(u,g,B,S):(xn.flags|=c,C.memoizedState=Pn(1|u,g,B,S))}function Er(c,u){ri(8390656,8,c,u)}function _s(c,u){Si(2048,8,c,u)}function g_(c,u){return Si(4,2,c,u)}function v_(c,u){return Si(4,4,c,u)}function af(c,u){if(typeof u=="function"){c=c();var g=u(c);return function(){typeof g=="function"?g():u(null)}}if(u!=null)return c=c(),u.current=c,function(){u.current=null}}function Tr(c,u,g){g=g!=null?g.concat([c]):null,Si(4,4,af.bind(null,u,c),g)}function sf(){}function Xh(c,u){var g=tt();u=u===void 0?null:u;var S=g.memoizedState;return u!==null&&G(u,S[1])?S[0]:(g.memoizedState=[c,u],c)}function Dl(c,u){var g=tt();u=u===void 0?null:u;var S=g.memoizedState;if(u!==null&&G(u,S[1]))return S[0];if(S=c(),_o){W(!0);try{c()}finally{W(!1)}}return g.memoizedState=[S,u],S}function Lo(c,u,g){return g===void 0||(zr&1073741824)!==0?c.memoizedState=u:(c.memoizedState=g,c=wr(),xn.lanes|=c,Us|=c,g)}function am(c,u,g,S){return Es(g,u)?g:Gr.current!==null?(c=Lo(c,g,S),Es(c,u)||(Gi=!0),c):(zr&42)===0?(Gi=!0,c.memoizedState=g):(c=wr(),xn.lanes|=c,Us|=c,u)}function Yh(c,u,g,S,C){var B=$i();Ia(B!==0&&8>B?B:8);var J=ln.T,se={};ln.T=se,Kh(c,!1,u,g);try{var be=C(),Ke=ln.S;if(Ke!==null&&Ke(se,be),be!==null&&typeof be=="object"&&typeof be.then=="function"){var St=Mt(be,S);Io(c,u,St,Xa(c))}else Io(c,u,S,Xa(c))}catch(It){Io(c,u,{then:function(){},status:"rejected",reason:It},Xa())}finally{Ia(B),ln.T=J}}function sm(c){var u=c.memoizedState;if(u!==null)return u;u={memoizedState:is,baseState:is,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:ie,lastRenderedState:is},next:null};var g={};return u.next={memoizedState:g,baseState:g,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:ie,lastRenderedState:g},next:null},c.memoizedState=u,c=c.alternate,c!==null&&(c.memoizedState=u),u}function Nl(){return xa(fn)}function Cr(){return tt().memoizedState}function Jh(){return tt().memoizedState}function rf(c){for(var u=c.return;u!==null;){switch(u.tag){case 24:case 3:var g=Xa();c=Ye(g);var S=qe(u,c,g);S!==null&&(La(S,u,g),wt(S,u,g)),u={cache:$h()},c.payload=u;return}u=u.return}}function Oo(c,u,g){var S=Xa();g={lane:S,revertLane:0,action:g,hasEagerState:!1,eagerState:null,next:null},Ul(c)?of(u,g):(g=Je(c,u,g,S),g!==null&&(La(g,c,S),rm(g,u,S)))}function qh(c,u,g){var S=Xa();Io(c,u,g,S)}function Io(c,u,g,S){var C={lane:S,revertLane:0,action:g,hasEagerState:!1,eagerState:null,next:null};if(Ul(c))of(u,C);else{var B=c.alternate;if(c.lanes===0&&(B===null||B.lanes===0)&&(B=u.lastRenderedReducer,B!==null))try{var J=u.lastRenderedState,se=B(J,g);if(C.hasEagerState=!0,C.eagerState=se,Es(se,J))return et(c,u,C,0),Rn===null&&Ge(),!1}catch{}if(g=Je(c,u,C,S),g!==null)return La(g,c,S),rm(g,u,S),!0}return!1}function Kh(c,u,g,S){if(S={lane:2,revertLane:ke(),action:S,hasEagerState:!1,eagerState:null,next:null},Ul(c)){if(u)throw Error(i(479))}else u=Je(c,g,S,2),u!==null&&La(u,c,2)}function Ul(c){var u=c.alternate;return c===xn||u!==null&&u===xn}function of(c,u){_i=qs=!0;var g=c.pending;g===null?u.next=u:(u.next=g.next,g.next=u),c.pending=u}function rm(c,u,g){if((g&4194176)!==0){var S=u.lanes;S&=c.pendingLanes,g|=S,u.lanes=g,ae(c,g)}}function Na(c,u,g,S){u=c.memoizedState,g=g(S,u),g=g==null?u:kl({},u,g),c.memoizedState=g,c.lanes===0&&(c.updateQueue.baseState=g)}function Fo(c,u,g,S,C,B,J){return c=c.stateNode,typeof c.shouldComponentUpdate=="function"?c.shouldComponentUpdate(S,B,J):u.prototype&&u.prototype.isPureReactComponent?!ot(g,S)||!ot(C,B):!0}function lf(c,u,g,S){c=u.state,typeof u.componentWillReceiveProps=="function"&&u.componentWillReceiveProps(g,S),typeof u.UNSAFE_componentWillReceiveProps=="function"&&u.UNSAFE_componentWillReceiveProps(g,S),u.state!==c&&Fd.enqueueReplaceState(u,u.state,null)}function ar(c,u){var g=u;if("ref"in u){g={};for(var S in u)S!=="ref"&&(g[S]=u[S])}if(c=c.defaultProps){g===u&&(g=kl({},g));for(var C in c)g[C]===void 0&&(g[C]=c[C])}return g}function Wh(c,u){try{var g=c.onUncaughtError;g(u.value,{componentStack:u.stack})}catch(S){setTimeout(function(){throw S})}}function jh(c,u,g){try{var S=c.onCaughtError;S(g.value,{componentStack:g.stack,errorBoundary:u.tag===1?u.stateNode:null})}catch(C){setTimeout(function(){throw C})}}function cf(c,u,g){return g=Ye(g),g.tag=3,g.payload={element:null},g.callback=function(){Wh(c,u)},g}function Dc(c){return c=Ye(c),c.tag=3,c}function uf(c,u,g,S){var C=g.type.getDerivedStateFromError;if(typeof C=="function"){var B=S.value;c.payload=function(){return C(B)},c.callback=function(){jh(u,g,S)}}var J=g.stateNode;J!==null&&typeof J.componentDidCatch=="function"&&(c.callback=function(){jh(u,g,S),typeof C!="function"&&(Os===null?Os=new Set([this]):Os.add(this));var se=S.stack;this.componentDidCatch(S.value,{componentStack:se!==null?se:""})})}function __(c,u,g,S,C){if(g.flags|=32768,S!==null&&typeof S=="object"&&typeof S.then=="function"){if(u=g.alternate,u!==null&&Ll(u,g,C,!0),g=Ds.current,g!==null){switch(g.tag){case 13:return Js===null?ns():g.alternate===null&&zn===0&&(zn=3),g.flags&=-257,g.flags|=65536,g.lanes=C,S===Od?g.flags|=16384:(u=g.updateQueue,u===null?g.updateQueue=new Set([S]):u.add(S),dd(c,S,C)),!1;case 22:return g.flags|=65536,S===Od?g.flags|=16384:(u=g.updateQueue,u===null?(u={transitions:null,markerInstances:null,retryQueue:new Set([S])},g.updateQueue=u):(g=u.retryQueue,g===null?u.retryQueue=new Set([S]):g.add(S)),dd(c,S,C)),!1}throw Error(i(435,g.tag))}return dd(c,S,C),ns(),!1}if(Yn)return u=Ds.current,u!==null?((u.flags&65536)===0&&(u.flags|=256),u.flags|=65536,u.lanes=C,S!==Pf&&(c=Error(i(422),{cause:S}),Wt(ye(c,g)))):(S!==Pf&&(u=Error(i(423),{cause:S}),Wt(ye(u,g))),c=c.current.alternate,c.flags|=65536,C&=-C,c.lanes|=C,S=ye(S,g),C=cf(c.stateNode,S,C),bt(c,C),zn!==4&&(zn=2)),!1;var B=Error(i(520),{cause:S});if(B=ye(B,g),ru===null?ru=[B]:ru.push(B),zn!==4&&(zn=2),u===null)return!0;S=ye(S,g),g=u;do{switch(g.tag){case 3:return g.flags|=65536,c=C&-C,g.lanes|=c,c=cf(g.stateNode,S,c),bt(g,c),!1;case 1:if(u=g.type,B=g.stateNode,(g.flags&128)===0&&(typeof u.getDerivedStateFromError=="function"||B!==null&&typeof B.componentDidCatch=="function"&&(Os===null||!Os.has(B))))return g.flags|=65536,C&=-C,g.lanes|=C,C=Dc(C),uf(C,c,g,S),bt(g,C),!1}g=g.return}while(g!==null);return!1}function ya(c,u,g,S){u.child=c===null?mg(u,null,g,S):ol(u,c.child,g,S)}function y_(c,u,g,S,C){g=g.render;var B=u.ref;if("ref"in S){var J={};for(var se in S)se!=="ref"&&(J[se]=S[se])}else J=S;return Ol(u),S=q(c,u,g,J,B,C),se=Ue(),c!==null&&!Gi?(ct(c,u,C),no(c,u,C)):(Yn&&se&&te(u),u.flags|=1,ya(c,u,S,C),u.child)}function x_(c,u,g,S,C){if(c===null){var B=g.type;return typeof B=="function"&&!lo(B)&&B.defaultProps===void 0&&g.compare===null?(u.tag=15,u.type=B,Zh(c,u,B,S,C)):(c=zs(g.type,null,S,u,u.mode,C),c.ref=u.ref,c.return=u,u.child=c)}if(B=c.child,!dm(c,C)){var J=B.memoizedProps;if(g=g.compare,g=g!==null?g:ot,g(J,S)&&c.ref===u.ref)return no(c,u,C)}return u.flags|=1,c=Oa(B,S),c.ref=u.ref,c.return=u,u.child=c}function Zh(c,u,g,S,C){if(c!==null){var B=c.memoizedProps;if(ot(B,S)&&c.ref===u.ref)if(Gi=!1,u.pendingProps=S=B,dm(c,C))(c.flags&131072)!==0&&(Gi=!0);else return u.lanes=c.lanes,no(c,u,C)}return om(c,u,g,S,C)}function A_(c,u,g){var S=u.pendingProps,C=S.children,B=(u.stateNode._pendingVisibility&2)!==0,J=c!==null?c.memoizedState:null;if(ff(c,u),S.mode==="hidden"||B){if((u.flags&128)!==0){if(S=J!==null?J.baseLanes|g:g,c!==null){for(C=u.child=c.child,B=0;C!==null;)B=B|C.lanes|C.childLanes,C=C.sibling;u.childLanes=B&~S}else u.childLanes=0,u.child=null;return S_(c,u,S,g)}if((g&536870912)!==0)u.memoizedState={baseLanes:0,cachePool:null},c!==null&&ed(u,J!==null?J.cachePool:null),J!==null?br(u,J):ir(),Da(u);else return u.lanes=u.childLanes=536870912,S_(c,u,J!==null?J.baseLanes|g:g,g)}else J!==null?(ed(u,J.cachePool),br(u,J),wi(),u.memoizedState=null):(c!==null&&ed(u,null),ir(),wi());return ya(c,u,C,g),u.child}function S_(c,u,g,S){var C=Go();return C=C===null?null:{parent:Or?$n._currentValue:$n._currentValue2,pool:C},u.memoizedState={baseLanes:g,cachePool:C},c!==null&&ed(u,null),ir(),Da(u),c!==null&&Ll(c,u,S,!0),null}function ff(c,u){var g=u.ref;if(g===null)c!==null&&c.ref!==null&&(u.flags|=2097664);else{if(typeof g!="function"&&typeof g!="object")throw Error(i(284));(c===null||c.ref!==g)&&(u.flags|=2097664)}}function om(c,u,g,S,C){return Ol(u),g=q(c,u,g,S,void 0,C),S=Ue(),c!==null&&!Gi?(ct(c,u,C),no(c,u,C)):(Yn&&S&&te(u),u.flags|=1,ya(c,u,g,C),u.child)}function M_(c,u,g,S,C,B){return Ol(u),u.updateQueue=null,g=Te(u,S,g,C),oe(c),S=Ue(),c!==null&&!Gi?(ct(c,u,B),no(c,u,B)):(Yn&&S&&te(u),u.flags|=1,ya(c,u,g,B),u.child)}function lm(c,u,g,S,C){if(Ol(u),u.stateNode===null){var B=Kl,J=g.contextType;typeof J=="object"&&J!==null&&(B=xa(J)),B=new g(S,B),u.memoizedState=B.state!==null&&B.state!==void 0?B.state:null,B.updater=Fd,u.stateNode=B,B._reactInternals=u,B=u.stateNode,B.props=S,B.state=u.memoizedState,B.refs={},Ht(u),J=g.contextType,B.context=typeof J=="object"&&J!==null?xa(J):Kl,B.state=u.memoizedState,J=g.getDerivedStateFromProps,typeof J=="function"&&(Na(u,g,J,S),B.state=u.memoizedState),typeof g.getDerivedStateFromProps=="function"||typeof B.getSnapshotBeforeUpdate=="function"||typeof B.UNSAFE_componentWillMount!="function"&&typeof B.componentWillMount!="function"||(J=B.state,typeof B.componentWillMount=="function"&&B.componentWillMount(),typeof B.UNSAFE_componentWillMount=="function"&&B.UNSAFE_componentWillMount(),J!==B.state&&Fd.enqueueReplaceState(B,B.state,null),Vt(u,S,B,C),rt(),B.state=u.memoizedState),typeof B.componentDidMount=="function"&&(u.flags|=4194308),S=!0}else if(c===null){B=u.stateNode;var se=u.memoizedProps,be=ar(g,se);B.props=be;var Ke=B.context,St=g.contextType;J=Kl,typeof St=="object"&&St!==null&&(J=xa(St));var It=g.getDerivedStateFromProps;St=typeof It=="function"||typeof B.getSnapshotBeforeUpdate=="function",se=u.pendingProps!==se,St||typeof B.UNSAFE_componentWillReceiveProps!="function"&&typeof B.componentWillReceiveProps!="function"||(se||Ke!==J)&&lf(u,B,S,J),vo=!1;var Pt=u.memoizedState;B.state=Pt,Vt(u,S,B,C),rt(),Ke=u.memoizedState,se||Pt!==Ke||vo?(typeof It=="function"&&(Na(u,g,It,S),Ke=u.memoizedState),(be=vo||Fo(u,g,be,S,Pt,Ke,J))?(St||typeof B.UNSAFE_componentWillMount!="function"&&typeof B.componentWillMount!="function"||(typeof B.componentWillMount=="function"&&B.componentWillMount(),typeof B.UNSAFE_componentWillMount=="function"&&B.UNSAFE_componentWillMount()),typeof B.componentDidMount=="function"&&(u.flags|=4194308)):(typeof B.componentDidMount=="function"&&(u.flags|=4194308),u.memoizedProps=S,u.memoizedState=Ke),B.props=S,B.state=Ke,B.context=J,S=be):(typeof B.componentDidMount=="function"&&(u.flags|=4194308),S=!1)}else{B=u.stateNode,zt(c,u),J=u.memoizedProps,St=ar(g,J),B.props=St,It=u.pendingProps,Pt=B.context,Ke=g.contextType,be=Kl,typeof Ke=="object"&&Ke!==null&&(be=xa(Ke)),se=g.getDerivedStateFromProps,(Ke=typeof se=="function"||typeof B.getSnapshotBeforeUpdate=="function")||typeof B.UNSAFE_componentWillReceiveProps!="function"&&typeof B.componentWillReceiveProps!="function"||(J!==It||Pt!==be)&&lf(u,B,S,be),vo=!1,Pt=u.memoizedState,B.state=Pt,Vt(u,S,B,C),rt();var gn=u.memoizedState;J!==It||Pt!==gn||vo||c!==null&&c.dependencies!==null&&Po(c.dependencies)?(typeof se=="function"&&(Na(u,g,se,S),gn=u.memoizedState),(St=vo||Fo(u,g,St,S,Pt,gn,be)||c!==null&&c.dependencies!==null&&Po(c.dependencies))?(Ke||typeof B.UNSAFE_componentWillUpdate!="function"&&typeof B.componentWillUpdate!="function"||(typeof B.componentWillUpdate=="function"&&B.componentWillUpdate(S,gn,be),typeof B.UNSAFE_componentWillUpdate=="function"&&B.UNSAFE_componentWillUpdate(S,gn,be)),typeof B.componentDidUpdate=="function"&&(u.flags|=4),typeof B.getSnapshotBeforeUpdate=="function"&&(u.flags|=1024)):(typeof B.componentDidUpdate!="function"||J===c.memoizedProps&&Pt===c.memoizedState||(u.flags|=4),typeof B.getSnapshotBeforeUpdate!="function"||J===c.memoizedProps&&Pt===c.memoizedState||(u.flags|=1024),u.memoizedProps=S,u.memoizedState=gn),B.props=S,B.state=gn,B.context=be,S=St):(typeof B.componentDidUpdate!="function"||J===c.memoizedProps&&Pt===c.memoizedState||(u.flags|=4),typeof B.getSnapshotBeforeUpdate!="function"||J===c.memoizedProps&&Pt===c.memoizedState||(u.flags|=1024),S=!1)}return B=S,ff(c,u),S=(u.flags&128)!==0,B||S?(B=u.stateNode,g=S&&typeof g.getDerivedStateFromError!="function"?null:B.render(),u.flags|=1,c!==null&&S?(u.child=ol(u,c.child,null,C),u.child=ol(u,null,g,C)):ya(c,u,g,C),u.memoizedState=B.state,c=u.child):c=no(c,u,C),c}function b_(c,u,g,S){return on(),u.flags|=256,ya(c,u,g,S),u.child}function cm(c){return{baseLanes:c,cachePool:w_()}}function um(c,u,g){return c=c!==null?c.childLanes&~g:0,u&&(c|=cs),c}function E_(c,u,g){var S=u.pendingProps,C=!1,B=(u.flags&128)!==0,J;if((J=B)||(J=c!==null&&c.memoizedState===null?!1:(Wi.current&2)!==0),J&&(C=!0,u.flags&=-129),J=(u.flags&32)!==0,u.flags&=-33,c===null){if(Yn){if(C?sa(u):wi(),Yn){var se=Ea,be;(be=se)&&(se=ey(se,Xs),se!==null?(u.memoizedState={dehydrated:se,treeContext:cr!==null?{id:Hr,overflow:ks}:null,retryLane:536870912},be=t(18,null,null,0),be.stateNode=se,be.return=u,u.child=be,Fa=u,Ea=null,be=!0):be=!1),be||lt(u)}if(se=u.memoizedState,se!==null&&(se=se.dehydrated,se!==null))return Df(se)?u.lanes=16:u.lanes=536870912,null;kt(u)}return se=S.children,S=S.fallback,C?(wi(),C=u.mode,se=fm({mode:"hidden",children:se},C),S=uo(S,C,g,null),se.return=u,S.return=u,se.sibling=S,u.child=se,C=u.child,C.memoizedState=cm(g),C.childLanes=um(c,J,g),u.memoizedState=Pa,S):(sa(u),hf(u,se))}if(be=c.memoizedState,be!==null&&(se=be.dehydrated,se!==null)){if(B)u.flags&256?(sa(u),u.flags&=-257,u=hm(c,u,g)):u.memoizedState!==null?(wi(),u.child=c.child,u.flags|=128,u=null):(wi(),C=S.fallback,se=u.mode,S=fm({mode:"visible",children:S.children},se),C=uo(C,se,g,null),C.flags|=2,S.return=u,C.return=u,S.sibling=C,u.child=S,ol(u,c.child,null,g),S=u.child,S.memoizedState=cm(g),S.childLanes=um(c,J,g),u.memoizedState=Pa,u=C);else if(sa(u),Df(se))J=q_(se).digest,S=Error(i(419)),S.stack="",S.digest=J,Wt({value:S,source:null,stack:null}),u=hm(c,u,g);else if(Gi||Ll(c,u,g,!1),J=(g&c.childLanes)!==0,Gi||J){if(J=Rn,J!==null){if(S=g&-g,(S&42)!==0)S=1;else switch(S){case 2:S=1;break;case 8:S=4;break;case 32:S=16;break;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:S=64;break;case 268435456:S=134217728;break;default:S=0}if(S=(S&(J.suspendedLanes|g))!==0?0:S,S!==0&&S!==be.retryLane)throw be.retryLane=S,xt(c,S),La(J,c,S),my}Ed(se)||ns(),u=hm(c,u,g)}else Ed(se)?(u.flags|=128,u.child=c.child,u=zl.bind(null,c),XS(se,u),u=null):(c=be.treeContext,Ya&&(Ea=Z_(se),Fa=u,Yn=!0,Rs=null,Xs=!1,c!==null&&(Ts[Cs++]=Hr,Ts[Cs++]=ks,Ts[Cs++]=cr,Hr=c.id,ks=c.overflow,cr=u)),u=hf(u,S.children),u.flags|=4096);return u}return C?(wi(),C=S.fallback,se=u.mode,be=c.child,B=be.sibling,S=Oa(be,{mode:"hidden",children:S.children}),S.subtreeFlags=be.subtreeFlags&31457280,B!==null?C=Oa(B,C):(C=uo(C,se,g,null),C.flags|=2),C.return=u,S.return=u,S.sibling=C,u.child=S,S=C,C=u.child,se=c.child.memoizedState,se===null?se=cm(g):(be=se.cachePool,be!==null?(B=Or?$n._currentValue:$n._currentValue2,be=be.parent!==B?{parent:B,pool:B}:be):be=w_(),se={baseLanes:se.baseLanes|g,cachePool:be}),C.memoizedState=se,C.childLanes=um(c,J,g),u.memoizedState=Pa,S):(sa(u),g=c.child,c=g.sibling,g=Oa(g,{mode:"visible",children:S.children}),g.return=u,g.sibling=null,c!==null&&(J=u.deletions,J===null?(u.deletions=[c],u.flags|=16):J.push(c)),u.child=g,u.memoizedState=null,g)}function hf(c,u){return u=fm({mode:"visible",children:u},c.mode),u.return=c,c.child=u}function fm(c,u){return pd(c,u,0,null)}function hm(c,u,g){return ol(u,c.child,null,g),c=hf(u,u.pendingProps.children),c.flags|=2,u.memoizedState=null,c}function T_(c,u,g){c.lanes|=u;var S=c.alternate;S!==null&&(S.lanes|=u),pm(c.return,u,g)}function Qh(c,u,g,S,C){var B=c.memoizedState;B===null?c.memoizedState={isBackwards:u,rendering:null,renderingStartTime:0,last:S,tail:g,tailMode:C}:(B.isBackwards=u,B.rendering=null,B.renderingStartTime=0,B.last=S,B.tail=g,B.tailMode=C)}function C_(c,u,g){var S=u.pendingProps,C=S.revealOrder,B=S.tail;if(ya(c,u,S.children,g),S=Wi.current,(S&2)!==0)S=S&1|2,u.flags|=128;else{if(c!==null&&(c.flags&128)!==0)e:for(c=u.child;c!==null;){if(c.tag===13)c.memoizedState!==null&&T_(c,g,u);else if(c.tag===19)T_(c,g,u);else if(c.child!==null){c.child.return=c,c=c.child;continue}if(c===u)break e;for(;c.sibling===null;){if(c.return===null||c.return===u)break e;c=c.return}c.sibling.return=c.return,c=c.sibling}S&=1}switch(w(Wi,S),C){case"forwards":for(g=u.child,C=null;g!==null;)c=g.alternate,c!==null&&Ai(c)===null&&(C=g),g=g.sibling;g=C,g===null?(C=u.child,u.child=null):(C=g.sibling,g.sibling=null),Qh(u,!1,C,g,B);break;case"backwards":for(g=null,C=u.child,u.child=null;C!==null;){if(c=C.alternate,c!==null&&Ai(c)===null){u.child=C;break}c=C.sibling,C.sibling=g,g=C,C=c}Qh(u,!0,g,null,B);break;case"together":Qh(u,!1,null,null,void 0);break;default:u.memoizedState=null}return u.child}function no(c,u,g){if(c!==null&&(u.dependencies=c.dependencies),Us|=u.lanes,(g&u.childLanes)===0)if(c!==null){if(Ll(c,u,g,!1),(g&u.childLanes)===0)return null}else return null;if(c!==null&&u.child!==c.child)throw Error(i(153));if(u.child!==null){for(c=u.child,g=Oa(c,c.pendingProps),u.child=g,g.return=u;c.sibling!==null;)c=c.sibling,g=g.sibling=Oa(c,c.pendingProps),g.return=u;g.sibling=null}return u.child}function dm(c,u){return(c.lanes&u)!==0?!0:(c=c.dependencies,!!(c!==null&&Po(c)))}function zS(c,u,g){switch(u.tag){case 3:ve(u,u.stateNode.containerInfo),Ho(u,$n,c.memoizedState.cache),on();break;case 27:case 5:he(u);break;case 4:ve(u,u.stateNode.containerInfo);break;case 10:Ho(u,u.type,u.memoizedProps.value);break;case 13:var S=u.memoizedState;if(S!==null)return S.dehydrated!==null?(sa(u),u.flags|=128,null):(g&u.child.childLanes)!==0?E_(c,u,g):(sa(u),c=no(c,u,g),c!==null?c.sibling:null);sa(u);break;case 19:var C=(c.flags&128)!==0;if(S=(g&u.childLanes)!==0,S||(Ll(c,u,g,!1),S=(g&u.childLanes)!==0),C){if(S)return C_(c,u,g);u.flags|=128}if(C=u.memoizedState,C!==null&&(C.rendering=null,C.tail=null,C.lastEffect=null),w(Wi,Wi.current),S)break;return null;case 22:case 23:return u.lanes=0,A_(c,u,g);case 24:Ho(u,$n,c.memoizedState.cache)}return no(c,u,g)}function R_(c,u,g){if(c!==null)if(c.memoizedProps!==u.pendingProps)Gi=!0;else{if(!dm(c,g)&&(u.flags&128)===0)return Gi=!1,zS(c,u,g);Gi=(c.flags&131072)!==0}else Gi=!1,Yn&&(u.flags&1048576)!==0&&X(u,Ff,u.index);switch(u.lanes=0,u.tag){case 16:e:{c=u.pendingProps;var S=u.elementType,C=S._init;if(S=C(S._payload),u.type=S,typeof S=="function")lo(S)?(c=ar(S,c),u.tag=1,u=lm(null,u,S,c,g)):(u.tag=0,u=om(null,u,S,c,g));else{if(S!=null){if(C=S.$$typeof,C===qc){u.tag=11,u=y_(null,u,S,c,g);break e}else if(C===Mf){u.tag=14,u=x_(null,u,S,c,g);break e}}throw u=l(S)||S,Error(i(306,u,""))}}return u;case 0:return om(c,u,u.type,u.pendingProps,g);case 1:return S=u.type,C=ar(S,u.pendingProps),lm(c,u,S,C,g);case 3:e:{if(ve(u,u.stateNode.containerInfo),c===null)throw Error(i(387));var B=u.pendingProps;C=u.memoizedState,S=C.element,zt(c,u),Vt(u,B,null,g);var J=u.memoizedState;if(B=J.cache,Ho(u,$n,B),B!==C.cache&&mm(u,[$n],g,!0),rt(),B=J.element,Ya&&C.isDehydrated)if(C={element:B,isDehydrated:!1,cache:J.cache},u.updateQueue.baseState=C,u.memoizedState=C,u.flags&256){u=b_(c,u,B,g);break e}else if(B!==S){S=ye(Error(i(424)),u),Wt(S),u=b_(c,u,B,g);break e}else for(Ya&&(Ea=j_(u.stateNode.containerInfo),Fa=u,Yn=!0,Rs=null,Xs=!0),g=mg(u,null,B,g),u.child=g;g;)g.flags=g.flags&-3|4096,g=g.sibling;else{if(on(),B===S){u=no(c,u,g);break e}ya(c,u,B,g)}u=u.child}return u;case 26:if(bs)return ff(c,u),c===null?(g=Bd(u.type,null,u.pendingProps,null))?u.memoizedState=g:Yn||(u.stateNode=JS(u.type,u.pendingProps,ur.current,u)):u.memoizedState=Bd(u.type,c.memoizedProps,u.pendingProps,c.memoizedState),null;case 27:if(Ma)return he(u),c===null&&Ma&&Yn&&(S=u.stateNode=fg(u.type,u.pendingProps,ur.current,ua.current,!1),Fa=u,Xs=!0,Ea=Td(S)),S=u.pendingProps.children,c!==null||Yn?ya(c,u,S,g):u.child=ol(u,null,S,g),ff(c,u),u.child;case 5:return c===null&&Yn&&(sy(u.type,u.pendingProps,ua.current),(C=S=Ea)&&(S=Q_(S,u.type,u.pendingProps,Xs),S!==null?(u.stateNode=S,Fa=u,Ea=Td(S),Xs=!1,C=!0):C=!1),C||lt(u)),he(u),C=u.type,B=u.pendingProps,J=c!==null?c.memoizedProps:null,S=B.children,nl(C,B)?S=null:J!==null&&nl(C,J)&&(u.flags|=32),u.memoizedState!==null&&(C=q(c,u,Le,null,null,g),Or?fn._currentValue=C:fn._currentValue2=C),ff(c,u),ya(c,u,S,g),u.child;case 6:return c===null&&Yn&&(ry(u.pendingProps,ua.current),(c=g=Ea)&&(g=$_(g,u.pendingProps,Xs),g!==null?(u.stateNode=g,Fa=u,Ea=null,c=!0):c=!1),c||lt(u)),null;case 13:return E_(c,u,g);case 4:return ve(u,u.stateNode.containerInfo),S=u.pendingProps,c===null?u.child=ol(u,null,S,g):ya(c,u,S,g),u.child;case 11:return y_(c,u,u.type,u.pendingProps,g);case 7:return ya(c,u,u.pendingProps,g),u.child;case 8:return ya(c,u,u.pendingProps.children,g),u.child;case 12:return ya(c,u,u.pendingProps.children,g),u.child;case 10:return S=u.pendingProps,Ho(u,u.type,S.value),ya(c,u,S.children,g),u.child;case 9:return C=u.type._context,S=u.pendingProps.children,Ol(u),C=xa(C),S=S(C),u.flags|=1,ya(c,u,S,g),u.child;case 14:return x_(c,u,u.type,u.pendingProps,g);case 15:return Zh(c,u,u.type,u.pendingProps,g);case 19:return C_(c,u,g);case 22:return A_(c,u,g);case 24:return Ol(u),S=xa($n),c===null?(C=Go(),C===null&&(C=Rn,B=$h(),C.pooledCache=B,B.refCount++,B!==null&&(C.pooledCacheLanes|=g),C=B),u.memoizedState={parent:S,cache:C},Ht(u),Ho(u,$n,C)):((c.lanes&g)!==0&&(zt(c,u),Vt(u,null,null,g),rt()),C=c.memoizedState,B=u.memoizedState,C.parent!==S?(C={parent:S,cache:S},u.memoizedState=C,u.lanes===0&&(u.memoizedState=u.updateQueue.baseState=C),Ho(u,$n,S)):(S=B.cache,Ho(u,$n,S),S!==C.cache&&mm(u,[$n],g,!0))),ya(c,u,u.pendingProps.children,g),u.child;case 29:throw u.pendingProps}throw Error(i(156,u.tag))}function Ho(c,u,g){Or?(w(os,u._currentValue),u._currentValue=g):(w(os,u._currentValue2),u._currentValue2=g)}function io(c){var u=os.current;Or?c._currentValue=u:c._currentValue2=u,M(os)}function pm(c,u,g){for(;c!==null;){var S=c.alternate;if((c.childLanes&u)!==u?(c.childLanes|=u,S!==null&&(S.childLanes|=u)):S!==null&&(S.childLanes&u)!==u&&(S.childLanes|=u),c===g)break;c=c.return}}function mm(c,u,g,S){var C=c.child;for(C!==null&&(C.return=c);C!==null;){var B=C.dependencies;if(B!==null){var J=C.child;B=B.firstContext;e:for(;B!==null;){var se=B;B=C;for(var be=0;be<u.length;be++)if(se.context===u[be]){B.lanes|=g,se=B.alternate,se!==null&&(se.lanes|=g),pm(B.return,g,c),S||(J=null);break e}B=se.next}}else if(C.tag===18){if(J=C.return,J===null)throw Error(i(341));J.lanes|=g,B=J.alternate,B!==null&&(B.lanes|=g),pm(J,g,c),J=null}else J=C.child;if(J!==null)J.return=C;else for(J=C;J!==null;){if(J===c){J=null;break}if(C=J.sibling,C!==null){C.return=J.return,J=C;break}J=J.return}C=J}}function Ll(c,u,g,S){c=null;for(var C=u,B=!1;C!==null;){if(!B){if((C.flags&524288)!==0)B=!0;else if((C.flags&262144)!==0)break}if(C.tag===10){var J=C.alternate;if(J===null)throw Error(i(387));if(J=J.memoizedProps,J!==null){var se=C.type;Es(C.pendingProps.value,J.value)||(c!==null?c.push(se):c=[se])}}else if(C===eu.current){if(J=C.alternate,J===null)throw Error(i(387));J.memoizedState.memoizedState!==C.memoizedState.memoizedState&&(c!==null?c.push(fn):c=[fn])}C=C.return}c!==null&&mm(u,c,g,S),u.flags|=262144}function Po(c){for(c=c.firstContext;c!==null;){var u=c.context;if(!Es(Or?u._currentValue:u._currentValue2,c.memoizedValue))return!0;c=c.next}return!1}function Ol(c){cl=c,Li=null,c=c.dependencies,c!==null&&(c.firstContext=null)}function xa(c){return gm(cl,c)}function df(c,u){return cl===null&&Ol(c),gm(c,u)}function gm(c,u){var g=Or?u._currentValue:u._currentValue2;if(u={context:u,memoizedValue:g,next:null},Li===null){if(c===null)throw Error(i(308));Li=u,c.dependencies={lanes:0,firstContext:u},c.flags|=524288}else Li=Li.next=u;return g}function $h(){return{controller:new gy,data:new Map,refCount:0}}function Nc(c){c.refCount--,c.refCount===0&&yo(Zl,function(){c.controller.abort()})}function Go(){var c=xo.current;return c!==null?c:Rn.pooledCache}function ed(c,u){u===null?w(xo,xo.current):w(xo,u.pool)}function w_(){var c=Go();return c===null?null:{parent:Or?$n._currentValue:$n._currentValue2,pool:c}}function ys(c){c.flags|=4}function vm(c,u){if(c!==null&&c.child===u.child)return!1;if((u.flags&16)!==0)return!0;for(c=u.child;c!==null;){if((c.flags&13878)!==0||(c.subtreeFlags&13878)!==0)return!0;c=c.sibling}return!1}function td(c,u,g,S){if(Sa)for(g=u.child;g!==null;){if(g.tag===5||g.tag===6)Lr(c,g.stateNode);else if(!(g.tag===4||Ma&&g.tag===27)&&g.child!==null){g.child.return=g,g=g.child;continue}if(g===u)break;for(;g.sibling===null;){if(g.return===null||g.return===u)return;g=g.return}g.sibling.return=g.return,g=g.sibling}else if(Ss)for(var C=u.child;C!==null;){if(C.tag===5){var B=C.stateNode;g&&S&&(B=Qm(B,C.type,C.memoizedProps)),Lr(c,B)}else if(C.tag===6)B=C.stateNode,g&&S&&(B=$m(B,C.memoizedProps)),Lr(c,B);else if(C.tag!==4){if(C.tag===22&&C.memoizedState!==null)B=C.child,B!==null&&(B.return=C),td(c,C,!0,!0);else if(C.child!==null){C.child.return=C,C=C.child;continue}}if(C===u)break;for(;C.sibling===null;){if(C.return===null||C.return===u)return;C=C.return}C.sibling.return=C.return,C=C.sibling}}function Uc(c,u,g,S){if(Ss)for(var C=u.child;C!==null;){if(C.tag===5){var B=C.stateNode;g&&S&&(B=Qm(B,C.type,C.memoizedProps)),jm(c,B)}else if(C.tag===6)B=C.stateNode,g&&S&&(B=$m(B,C.memoizedProps)),jm(c,B);else if(C.tag!==4){if(C.tag===22&&C.memoizedState!==null)B=C.child,B!==null&&(B.return=C),Uc(c,C,!(C.memoizedProps!==null&&C.memoizedProps.mode==="manual"),!0);else if(C.child!==null){C.child.return=C,C=C.child;continue}}if(C===u)break;for(;C.sibling===null;){if(C.return===null||C.return===u)return;C=C.return}C.sibling.return=C.return,C=C.sibling}}function Lc(c,u){if(Ss&&vm(c,u)){c=u.stateNode;var g=c.containerInfo,S=bd();Uc(S,u,!1,!1),c.pendingChildren=S,ys(u),J_(g,S)}}function _m(c,u,g,S){if(Sa)c.memoizedProps!==S&&ys(u);else if(Ss){var C=c.stateNode,B=c.memoizedProps;if((c=vm(c,u))||B!==S){var J=ua.current;B=Wm(C,g,B,S,!c,null),B===C?u.stateNode=C:(ho(B,g,S,J)&&ys(u),u.stateNode=B,c?td(B,u,!1,!1):ys(u))}else u.stateNode=C}}function Oc(c,u,g){if(k_(u,g)){if(c.flags|=16777216,!po(u,g))if(yf())c.flags|=8192;else throw jl=Od,pg}else c.flags&=-16777217}function ym(c,u){if(oy(u)){if(c.flags|=16777216,!cg(u))if(yf())c.flags|=8192;else throw jl=Od,pg}else c.flags&=-16777217}function pf(c,u){u!==null&&(c.flags|=4),c.flags&16384&&(u=c.tag!==22?U():536870912,c.lanes|=u,So|=u)}function Il(c,u){if(!Yn)switch(c.tailMode){case"hidden":u=c.tail;for(var g=null;u!==null;)u.alternate!==null&&(g=u),u=u.sibling;g===null?c.tail=null:g.sibling=null;break;case"collapsed":g=c.tail;for(var S=null;g!==null;)g.alternate!==null&&(S=g),g=g.sibling;S===null?u||c.tail===null?c.tail=null:c.tail.sibling=null:S.sibling=null}}function mi(c){var u=c.alternate!==null&&c.alternate.child===c.child,g=0,S=0;if(u)for(var C=c.child;C!==null;)g|=C.lanes|C.childLanes,S|=C.subtreeFlags&31457280,S|=C.flags&31457280,C.return=c,C=C.sibling;else for(C=c.child;C!==null;)g|=C.lanes|C.childLanes,S|=C.subtreeFlags,S|=C.flags,C.return=c,C=C.sibling;return c.subtreeFlags|=S,c.childLanes=g,u}function B_(c,u,g){var S=u.pendingProps;switch(le(u),u.tag){case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return mi(u),null;case 1:return mi(u),null;case 3:return g=u.stateNode,S=null,c!==null&&(S=c.memoizedState.cache),u.memoizedState.cache!==S&&(u.flags|=2048),io($n),ze(),g.pendingContext&&(g.context=g.pendingContext,g.pendingContext=null),(c===null||c.child===null)&&(tn(u)?ys(u):c===null||c.memoizedState.isDehydrated&&(u.flags&256)===0||(u.flags|=1024,Rs!==null&&(so(Rs),Rs=null))),Lc(c,u),mi(u),null;case 26:if(bs){g=u.type;var C=u.memoizedState;return c===null?(ys(u),C!==null?(mi(u),ym(u,C)):(mi(u),Oc(u,g,S))):C?C!==c.memoizedState?(ys(u),mi(u),ym(u,C)):(mi(u),u.flags&=-16777217):(Sa?c.memoizedProps!==S&&ys(u):_m(c,u,g,S),mi(u),Oc(u,g,S)),null}case 27:if(Ma){if(Ee(u),g=ur.current,C=u.type,c!==null&&u.stateNode!=null)Sa?c.memoizedProps!==S&&ys(u):_m(c,u,C,S);else{if(!S){if(u.stateNode===null)throw Error(i(166));return mi(u),null}c=ua.current,tn(u)?Rt(u,c):(c=fg(C,S,g,c,!0),u.stateNode=c,ys(u))}return mi(u),null}case 5:if(Ee(u),g=u.type,c!==null&&u.stateNode!=null)_m(c,u,g,S);else{if(!S){if(u.stateNode===null)throw Error(i(166));return mi(u),null}c=ua.current,tn(u)?Rt(u,c):(C=Hm(g,S,ur.current,c,u),td(C,u,!1,!1),u.stateNode=C,ho(C,g,S,c)&&ys(u))}return mi(u),Oc(u,u.type,u.pendingProps),null;case 6:if(c&&u.stateNode!=null)g=c.memoizedProps,Sa?g!==S&&ys(u):Ss&&(g!==S?(u.stateNode=_d(S,ur.current,ua.current,u),ys(u)):u.stateNode=c.stateNode);else{if(typeof S!="string"&&u.stateNode===null)throw Error(i(166));if(c=ur.current,g=ua.current,tn(u)){if(!Ya)throw Error(i(176));if(c=u.stateNode,g=u.memoizedProps,S=null,C=Fa,C!==null)switch(C.tag){case 27:case 5:S=C.memoizedProps}ty(c,g,u,S)||lt(u)}else u.stateNode=_d(S,c,g,u)}return mi(u),null;case 13:if(S=u.memoizedState,c===null||c.memoizedState!==null&&c.memoizedState.dehydrated!==null){if(C=tn(u),S!==null&&S.dehydrated!==null){if(c===null){if(!C)throw Error(i(318));if(!Ya)throw Error(i(344));if(C=u.memoizedState,C=C!==null?C.dehydrated:null,!C)throw Error(i(317));Wc(C,u)}else on(),(u.flags&128)===0&&(u.memoizedState=null),u.flags|=4;mi(u),C=!1}else Rs!==null&&(so(Rs),Rs=null),C=!0;if(!C)return u.flags&256?(kt(u),u):(kt(u),null)}if(kt(u),(u.flags&128)!==0)return u.lanes=g,u;if(g=S!==null,c=c!==null&&c.memoizedState!==null,g){S=u.child,C=null,S.alternate!==null&&S.alternate.memoizedState!==null&&S.alternate.memoizedState.cachePool!==null&&(C=S.alternate.memoizedState.cachePool.pool);var B=null;S.memoizedState!==null&&S.memoizedState.cachePool!==null&&(B=S.memoizedState.cachePool.pool),B!==C&&(S.flags|=2048)}return g!==c&&g&&(u.child.flags|=8192),pf(u,u.updateQueue),mi(u),null;case 4:return ze(),Lc(c,u),c===null&&zm(u.stateNode.containerInfo),mi(u),null;case 10:return io(u.type),mi(u),null;case 19:if(M(Wi),C=u.memoizedState,C===null)return mi(u),null;if(S=(u.flags&128)!==0,B=C.rendering,B===null)if(S)Il(C,!1);else{if(zn!==0||c!==null&&(c.flags&128)!==0)for(c=u.child;c!==null;){if(B=Ai(c),B!==null){for(u.flags|=128,Il(C,!1),c=B.updateQueue,u.updateQueue=c,pf(u,c),u.subtreeFlags=0,c=g,g=u.child;g!==null;)co(g,c),g=g.sibling;return w(Wi,Wi.current&1|2),u.child}c=c.sibling}C.tail!==null&&ba()>bi&&(u.flags|=128,S=!0,Il(C,!1),u.lanes=4194304)}else{if(!S)if(c=Ai(B),c!==null){if(u.flags|=128,S=!0,c=c.updateQueue,u.updateQueue=c,pf(u,c),Il(C,!0),C.tail===null&&C.tailMode==="hidden"&&!B.alternate&&!Yn)return mi(u),null}else 2*ba()-C.renderingStartTime>bi&&g!==536870912&&(u.flags|=128,S=!0,Il(C,!1),u.lanes=4194304);C.isBackwards?(B.sibling=u.child,u.child=B):(c=C.last,c!==null?c.sibling=B:u.child=B,C.last=B)}return C.tail!==null?(u=C.tail,C.rendering=u,C.tail=u.sibling,C.renderingStartTime=ba(),u.sibling=null,c=Wi.current,w(Wi,S?c&1|2:c&1),u):(mi(u),null);case 22:case 23:return kt(u),_a(),S=u.memoizedState!==null,c!==null?c.memoizedState!==null!==S&&(u.flags|=8192):S&&(u.flags|=8192),S?(g&536870912)!==0&&(u.flags&128)===0&&(mi(u),u.subtreeFlags&6&&(u.flags|=8192)):mi(u),g=u.updateQueue,g!==null&&pf(u,g.retryQueue),g=null,c!==null&&c.memoizedState!==null&&c.memoizedState.cachePool!==null&&(g=c.memoizedState.cachePool.pool),S=null,u.memoizedState!==null&&u.memoizedState.cachePool!==null&&(S=u.memoizedState.cachePool.pool),S!==g&&(u.flags|=2048),c!==null&&M(xo),null;case 24:return g=null,c!==null&&(g=c.memoizedState.cache),u.memoizedState.cache!==g&&(u.flags|=2048),io($n),mi(u),null;case 25:return null}throw Error(i(156,u.tag))}function D_(c,u){switch(le(u),u.tag){case 1:return c=u.flags,c&65536?(u.flags=c&-65537|128,u):null;case 3:return io($n),ze(),c=u.flags,(c&65536)!==0&&(c&128)===0?(u.flags=c&-65537|128,u):null;case 26:case 27:case 5:return Ee(u),null;case 13:if(kt(u),c=u.memoizedState,c!==null&&c.dehydrated!==null){if(u.alternate===null)throw Error(i(340));on()}return c=u.flags,c&65536?(u.flags=c&-65537|128,u):null;case 19:return M(Wi),null;case 4:return ze(),null;case 10:return io(u.type),null;case 22:case 23:return kt(u),_a(),c!==null&&M(xo),c=u.flags,c&65536?(u.flags=c&-65537|128,u):null;case 24:return io($n),null;case 25:return null;default:return null}}function xm(c,u){switch(le(u),u.tag){case 3:io($n),ze();break;case 26:case 27:case 5:Ee(u);break;case 4:ze();break;case 13:kt(u);break;case 19:M(Wi);break;case 10:io(u.type);break;case 22:case 23:kt(u),_a(),c!==null&&M(xo);break;case 24:io($n)}}function mf(c,u){try{var g=u.updateQueue,S=g!==null?g.lastEffect:null;if(S!==null){var C=S.next;g=C;do{if((g.tag&c)===c){S=void 0;var B=g.create,J=g.inst;S=B(),J.destroy=S}g=g.next}while(g!==C)}}catch(se){Dn(u,u.return,se)}}function zo(c,u,g){try{var S=u.updateQueue,C=S!==null?S.lastEffect:null;if(C!==null){var B=C.next;S=B;do{if((S.tag&c)===c){var J=S.inst,se=J.destroy;if(se!==void 0){J.destroy=void 0,C=u;var be=g;try{se()}catch(Ke){Dn(C,be,Ke)}}}S=S.next}while(S!==B)}}catch(Ke){Dn(u,u.return,Ke)}}function N_(c){var u=c.updateQueue;if(u!==null){var g=c.stateNode;try{Ne(u,g)}catch(S){Dn(c,c.return,S)}}}function U_(c,u,g){g.props=ar(c.type,c.memoizedProps),g.state=c.memoizedState;try{g.componentWillUnmount()}catch(S){Dn(c,u,S)}}function Fl(c,u){try{var g=c.ref;if(g!==null){var S=c.stateNode;switch(c.tag){case 26:case 27:case 5:var C=Kc(S);break;default:C=S}typeof g=="function"?c.refCleanup=g(C):g.current=C}}catch(B){Dn(c,u,B)}}function gi(c,u){var g=c.ref,S=c.refCleanup;if(g!==null)if(typeof S=="function")try{S()}catch(C){Dn(c,u,C)}finally{c.refCleanup=null,c=c.alternate,c!=null&&(c.refCleanup=null)}else if(typeof g=="function")try{g(null)}catch(C){Dn(c,u,C)}else g.current=null}function Ic(c){var u=c.type,g=c.memoizedProps,S=c.stateNode;try{kS(S,u,g,c)}catch(C){Dn(c,c.return,C)}}function Am(c,u,g){try{Ym(c.stateNode,c.type,g,u,c)}catch(S){Dn(c,c.return,S)}}function Sm(c){return c.tag===5||c.tag===3||(bs?c.tag===26:!1)||(Ma?c.tag===27:!1)||c.tag===4}function nd(c){e:for(;;){for(;c.sibling===null;){if(c.return===null||Sm(c.return))return null;c=c.return}for(c.sibling.return=c.return,c=c.sibling;c.tag!==5&&c.tag!==6&&(!Ma||c.tag!==27)&&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 id(c,u,g){var S=c.tag;if(S===5||S===6)c=c.stateNode,u?qm(g,c,u):X_(g,c);else if(!(S===4||Ma&&S===27)&&(c=c.child,c!==null))for(id(c,u,g),c=c.sibling;c!==null;)id(c,u,g),c=c.sibling}function Fc(c,u,g){var S=c.tag;if(S===5||S===6)c=c.stateNode,u?Jm(g,c,u):Xm(g,c);else if(!(S===4||Ma&&S===27)&&(c=c.child,c!==null))for(Fc(c,u,g),c=c.sibling;c!==null;)Fc(c,u,g),c=c.sibling}function L_(c,u,g){c=c.containerInfo;try{Zm(c,g)}catch(S){Dn(u,u.return,S)}}function Hc(c,u){for(tl(c.containerInfo),Oi=u;Oi!==null;)if(c=Oi,u=c.child,(c.subtreeFlags&1028)!==0&&u!==null)u.return=c,Oi=u;else for(;Oi!==null;){c=Oi;var g=c.alternate;switch(u=c.flags,c.tag){case 0:break;case 11:case 15:break;case 1:if((u&1024)!==0&&g!==null){u=void 0;var S=c,C=g.memoizedProps;g=g.memoizedState;var B=S.stateNode;try{var J=ar(S.type,C,S.elementType===S.type);u=B.getSnapshotBeforeUpdate(J,g),B.__reactInternalSnapshotBeforeUpdate=u}catch(se){Dn(S,S.return,se)}}break;case 3:(u&1024)!==0&&Sa&&Md(c.stateNode.containerInfo);break;case 5:case 26:case 27:case 6:case 4:case 17:break;default:if((u&1024)!==0)throw Error(i(163))}if(u=c.sibling,u!==null){u.return=c.return,Oi=u;break}Oi=c.return}return J=Ql,Ql=!1,J}function ad(c,u,g){var S=g.flags;switch(g.tag){case 0:case 11:case 15:Rr(c,g),S&4&&mf(5,g);break;case 1:if(Rr(c,g),S&4)if(c=g.stateNode,u===null)try{c.componentDidMount()}catch(se){Dn(g,g.return,se)}else{var C=ar(g.type,u.memoizedProps);u=u.memoizedState;try{c.componentDidUpdate(C,u,c.__reactInternalSnapshotBeforeUpdate)}catch(se){Dn(g,g.return,se)}}S&64&&N_(g),S&512&&Fl(g,g.return);break;case 3:if(Rr(c,g),S&64&&(S=g.updateQueue,S!==null)){if(c=null,g.child!==null)switch(g.child.tag){case 27:case 5:c=Kc(g.child.stateNode);break;case 1:c=g.child.stateNode}try{Ne(S,c)}catch(se){Dn(g,g.return,se)}}break;case 26:if(bs){Rr(c,g),S&512&&Fl(g,g.return);break}case 27:case 5:Rr(c,g),u===null&&S&4&&Ic(g),S&512&&Fl(g,g.return);break;case 12:Rr(c,g);break;case 13:Rr(c,g),S&4&&Vo(c,g);break;case 22:if(C=g.memoizedState!==null||ea,!C){u=u!==null&&u.memoizedState!==null||Mi;var B=ea,J=Mi;ea=C,(Mi=u)&&!J?Xo(c,g,(g.subtreeFlags&8772)!==0):Rr(c,g),ea=B,Mi=J}S&512&&(g.memoizedProps.mode==="manual"?Fl(g,g.return):gi(g,g.return));break;default:Rr(c,g)}}function Pc(c){var u=c.alternate;u!==null&&(c.alternate=null,Pc(u)),c.child=null,c.deletions=null,c.sibling=null,c.tag===5&&(u=c.stateNode,u!==null&&Vm(u)),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 xs(c,u,g){for(g=g.child;g!==null;)sd(c,u,g),g=g.sibling}function sd(c,u,g){if(ss&&typeof ss.onCommitFiberUnmount=="function")try{ss.onCommitFiberUnmount($c,g)}catch{}switch(g.tag){case 26:if(bs){Mi||gi(g,u),xs(c,u,g),g.memoizedState?ag(g.memoizedState):g.stateNode&&og(g.stateNode);break}case 27:if(Ma){Mi||gi(g,u);var S=zi,C=ls;zi=g.stateNode,xs(c,u,g),ly(g.stateNode),zi=S,ls=C;break}case 5:Mi||gi(g,u);case 6:if(Sa){if(S=zi,C=ls,zi=null,xs(c,u,g),zi=S,ls=C,zi!==null)if(ls)try{Hi(zi,g.stateNode)}catch(B){Dn(g,u,B)}else try{Ja(zi,g.stateNode)}catch(B){Dn(g,u,B)}}else xs(c,u,g);break;case 18:Sa&&zi!==null&&(ls?tg(zi,g.stateNode):iy(zi,g.stateNode));break;case 4:Sa?(S=zi,C=ls,zi=g.stateNode.containerInfo,ls=!0,xs(c,u,g),zi=S,ls=C):(Ss&&L_(g.stateNode,g,bd()),xs(c,u,g));break;case 0:case 11:case 14:case 15:Mi||zo(2,g,u),Mi||zo(4,g,u),xs(c,u,g);break;case 1:Mi||(gi(g,u),S=g.stateNode,typeof S.componentWillUnmount=="function"&&U_(g,u,S)),xs(c,u,g);break;case 21:xs(c,u,g);break;case 22:Mi||gi(g,u),Mi=(S=Mi)||g.memoizedState!==null,xs(c,u,g),Mi=S;break;default:xs(c,u,g)}}function Vo(c,u){if(Ya&&u.memoizedState===null&&(c=u.alternate,c!==null&&(c=c.memoizedState,c!==null&&(c=c.dehydrated,c!==null))))try{Rd(c)}catch(g){Dn(u,u.return,g)}}function Gc(c){switch(c.tag){case 13:case 19:var u=c.stateNode;return u===null&&(u=c.stateNode=new su),u;case 22:return c=c.stateNode,u=c._retryCache,u===null&&(u=c._retryCache=new su),u;default:throw Error(i(435,c.tag))}}function gf(c,u){var g=Gc(c);u.forEach(function(S){var C=Cm.bind(null,c,S);g.has(S)||(g.add(S),S.then(C,C))})}function Va(c,u){var g=u.deletions;if(g!==null)for(var S=0;S<g.length;S++){var C=g[S],B=c,J=u;if(Sa){var se=J;e:for(;se!==null;){switch(se.tag){case 27:case 5:zi=se.stateNode,ls=!1;break e;case 3:zi=se.stateNode.containerInfo,ls=!0;break e;case 4:zi=se.stateNode.containerInfo,ls=!0;break e}se=se.return}if(zi===null)throw Error(i(160));sd(B,J,C),zi=null,ls=!1}else sd(B,J,C);B=C.alternate,B!==null&&(B.return=null),C.return=null}if(u.subtreeFlags&13878)for(u=u.child;u!==null;)ko(u,c),u=u.sibling}function ko(c,u){var g=c.alternate,S=c.flags;switch(c.tag){case 0:case 11:case 14:case 15:Va(u,c),es(c),S&4&&(zo(3,c,c.return),mf(3,c),zo(5,c,c.return));break;case 1:Va(u,c),es(c),S&512&&(Mi||g===null||gi(g,g.return)),S&64&&ea&&(c=c.updateQueue,c!==null&&(S=c.callbacks,S!==null&&(g=c.shared.hiddenCallbacks,c.shared.hiddenCallbacks=g===null?S:g.concat(S))));break;case 26:if(bs){var C=qa;Va(u,c),es(c),S&512&&(Mi||g===null||gi(g,g.return)),S&4&&(S=g!==null?g.memoizedState:null,u=c.memoizedState,g===null?u===null?c.stateNode===null?c.stateNode=sg(C,c.type,c.memoizedProps,c):rg(C,c.type,c.stateNode):c.stateNode=ig(C,u,c.memoizedProps):S!==u?(S===null?g.stateNode!==null&&og(g.stateNode):ag(S),u===null?rg(C,c.type,c.stateNode):ig(C,u,c.memoizedProps)):u===null&&c.stateNode!==null&&Am(c,c.memoizedProps,g.memoizedProps));break}case 27:if(Ma&&S&4&&c.alternate===null){C=c.stateNode;var B=c.memoizedProps;try{qS(C),KS(c.type,B,C,c)}catch(St){Dn(c,c.return,St)}}case 5:if(Va(u,c),es(c),S&512&&(Mi||g===null||gi(g,g.return)),Sa){if(c.flags&32){u=c.stateNode;try{wf(u)}catch(St){Dn(c,c.return,St)}}S&4&&c.stateNode!=null&&(u=c.memoizedProps,Am(c,u,g!==null?g.memoizedProps:u)),S&1024&&(ul=!0)}break;case 6:if(Va(u,c),es(c),S&4&&Sa){if(c.stateNode===null)throw Error(i(162));S=c.memoizedProps,g=g!==null?g.memoizedProps:S,u=c.stateNode;try{Y_(u,g,S)}catch(St){Dn(c,c.return,St)}}break;case 3:if(bs?(lg(),C=qa,qa=wd(u.containerInfo),Va(u,c),qa=C):Va(u,c),es(c),S&4){if(Sa&&Ya&&g!==null&&g.memoizedState.isDehydrated)try{Cd(u.containerInfo)}catch(St){Dn(c,c.return,St)}if(Ss){S=u.containerInfo,g=u.pendingChildren;try{Zm(S,g)}catch(St){Dn(c,c.return,St)}}}ul&&(ul=!1,Mm(c));break;case 4:bs?(g=qa,qa=wd(c.stateNode.containerInfo),Va(u,c),es(c),qa=g):(Va(u,c),es(c)),S&4&&Ss&&L_(c.stateNode,c,c.stateNode.pendingChildren);break;case 12:Va(u,c),es(c);break;case 13:Va(u,c),es(c),c.child.flags&8192&&c.memoizedState!==null!=(g!==null&&g.memoizedState!==null)&&(Vr=ba()),S&4&&(S=c.updateQueue,S!==null&&(c.updateQueue=null,gf(c,S)));break;case 22:S&512&&(Mi||g===null||gi(g,g.return)),C=c.memoizedState!==null;var J=g!==null&&g.memoizedState!==null,se=ea,be=Mi;if(ea=se||C,Mi=be||J,Va(u,c),Mi=be,ea=se,es(c),u=c.stateNode,u._current=c,u._visibility&=-3,u._visibility|=u._pendingVisibility&2,S&8192&&(u._visibility=C?u._visibility&-2:u._visibility|1,C&&(u=ea||Mi,g===null||J||u||zc(c)),Sa&&(c.memoizedProps===null||c.memoizedProps.mode!=="manual"))){e:if(g=null,Sa)for(u=c;;){if(u.tag===5||bs&&u.tag===26||Ma&&u.tag===27){if(g===null){J=g=u;try{B=J.stateNode,C?Bf(B):Km(J.stateNode,J.memoizedProps)}catch(St){Dn(J,J.return,St)}}}else if(u.tag===6){if(g===null){J=u;try{var Ke=J.stateNode;C?Sd(Ke):mo(Ke,J.memoizedProps)}catch(St){Dn(J,J.return,St)}}}else if((u.tag!==22&&u.tag!==23||u.memoizedState===null||u===c)&&u.child!==null){u.child.return=u,u=u.child;continue}if(u===c)break e;for(;u.sibling===null;){if(u.return===null||u.return===c)break e;g===u&&(g=null),u=u.return}g===u&&(g=null),u.sibling.return=u.return,u=u.sibling}}S&4&&(S=c.updateQueue,S!==null&&(g=S.retryQueue,g!==null&&(S.retryQueue=null,gf(c,g))));break;case 19:Va(u,c),es(c),S&4&&(S=c.updateQueue,S!==null&&(c.updateQueue=null,gf(c,S)));break;case 21:break;default:Va(u,c),es(c)}}function es(c){var u=c.flags;if(u&2){try{if(Sa&&(!Ma||c.tag!==27)){e:{for(var g=c.return;g!==null;){if(Sm(g)){var S=g;break e}g=g.return}throw Error(i(160))}switch(S.tag){case 27:if(Ma){var C=S.stateNode,B=nd(c);Fc(c,B,C);break}case 5:var J=S.stateNode;S.flags&32&&(wf(J),S.flags&=-33);var se=nd(c);Fc(c,se,J);break;case 3:case 4:var be=S.stateNode.containerInfo,Ke=nd(c);id(c,Ke,be);break;default:throw Error(i(161))}}}catch(St){Dn(c,c.return,St)}c.flags&=-3}u&4096&&(c.flags&=-4097)}function Mm(c){if(c.subtreeFlags&1024)for(c=c.child;c!==null;){var u=c;Mm(u),u.tag===5&&u.flags&1024&&oi(u.stateNode),c=c.sibling}}function Rr(c,u){if(u.subtreeFlags&8772)for(u=u.child;u!==null;)ad(c,u.alternate,u),u=u.sibling}function zc(c){for(c=c.child;c!==null;){var u=c;switch(u.tag){case 0:case 11:case 14:case 15:zo(4,u,u.return),zc(u);break;case 1:gi(u,u.return);var g=u.stateNode;typeof g.componentWillUnmount=="function"&&U_(u,u.return,g),zc(u);break;case 26:case 27:case 5:gi(u,u.return),zc(u);break;case 22:gi(u,u.return),u.memoizedState===null&&zc(u);break;default:zc(u)}c=c.sibling}}function Xo(c,u,g){for(g=g&&(u.subtreeFlags&8772)!==0,u=u.child;u!==null;){var S=u.alternate,C=c,B=u,J=B.flags;switch(B.tag){case 0:case 11:case 15:Xo(C,B,g),mf(4,B);break;case 1:if(Xo(C,B,g),S=B,C=S.stateNode,typeof C.componentDidMount=="function")try{C.componentDidMount()}catch(Ke){Dn(S,S.return,Ke)}if(S=B,C=S.updateQueue,C!==null){var se=S.stateNode;try{var be=C.shared.hiddenCallbacks;if(be!==null)for(C.shared.hiddenCallbacks=null,C=0;C<be.length;C++)fe(be[C],se)}catch(Ke){Dn(S,S.return,Ke)}}g&&J&64&&N_(B),Fl(B,B.return);break;case 26:case 27:case 5:Xo(C,B,g),g&&S===null&&J&4&&Ic(B),Fl(B,B.return);break;case 12:Xo(C,B,g);break;case 13:Xo(C,B,g),g&&J&4&&Vo(C,B);break;case 22:B.memoizedState===null&&Xo(C,B,g),Fl(B,B.return);break;default:Xo(C,B,g)}u=u.sibling}}function bm(c,u){var g=null;c!==null&&c.memoizedState!==null&&c.memoizedState.cachePool!==null&&(g=c.memoizedState.cachePool.pool),c=null,u.memoizedState!==null&&u.memoizedState.cachePool!==null&&(c=u.memoizedState.cachePool.pool),c!==g&&(c!=null&&c.refCount++,g!=null&&Nc(g))}function rd(c,u){c=null,u.alternate!==null&&(c=u.alternate.memoizedState.cache),u=u.memoizedState.cache,u!==c&&(u.refCount++,c!=null&&Nc(c))}function ao(c,u,g,S){if(u.subtreeFlags&10256)for(u=u.child;u!==null;)od(c,u,g,S),u=u.sibling}function od(c,u,g,S){var C=u.flags;switch(u.tag){case 0:case 11:case 15:ao(c,u,g,S),C&2048&&mf(9,u);break;case 3:ao(c,u,g,S),C&2048&&(c=null,u.alternate!==null&&(c=u.alternate.memoizedState.cache),u=u.memoizedState.cache,u!==c&&(u.refCount++,c!=null&&Nc(c)));break;case 12:if(C&2048){ao(c,u,g,S),c=u.stateNode;try{var B=u.memoizedProps,J=B.id,se=B.onPostCommit;typeof se=="function"&&se(J,u.alternate===null?"mount":"update",c.passiveEffectDuration,-0)}catch(be){Dn(u,u.return,be)}}else ao(c,u,g,S);break;case 23:break;case 22:B=u.stateNode,u.memoizedState!==null?B._visibility&4?ao(c,u,g,S):Yo(c,u):B._visibility&4?ao(c,u,g,S):(B._visibility|=4,Ua(c,u,g,S,(u.subtreeFlags&10256)!==0)),C&2048&&bm(u.alternate,u);break;case 24:ao(c,u,g,S),C&2048&&rd(u.alternate,u);break;default:ao(c,u,g,S)}}function Ua(c,u,g,S,C){for(C=C&&(u.subtreeFlags&10256)!==0,u=u.child;u!==null;){var B=c,J=u,se=g,be=S,Ke=J.flags;switch(J.tag){case 0:case 11:case 15:Ua(B,J,se,be,C),mf(8,J);break;case 23:break;case 22:var St=J.stateNode;J.memoizedState!==null?St._visibility&4?Ua(B,J,se,be,C):Yo(B,J):(St._visibility|=4,Ua(B,J,se,be,C)),C&&Ke&2048&&bm(J.alternate,J);break;case 24:Ua(B,J,se,be,C),C&&Ke&2048&&rd(J.alternate,J);break;default:Ua(B,J,se,be,C)}u=u.sibling}}function Yo(c,u){if(u.subtreeFlags&10256)for(u=u.child;u!==null;){var g=c,S=u,C=S.flags;switch(S.tag){case 22:Yo(g,S),C&2048&&bm(S.alternate,S);break;case 24:Yo(g,S),C&2048&&rd(S.alternate,S);break;default:Yo(g,S)}u=u.sibling}}function ra(c){if(c.subtreeFlags&$l)for(c=c.child;c!==null;)Hl(c),c=c.sibling}function Hl(c){switch(c.tag){case 26:ra(c),c.flags&$l&&(c.memoizedState!==null?ug(qa,c.memoizedState,c.memoizedProps):Bi(c.type,c.memoizedProps));break;case 5:ra(c),c.flags&$l&&Bi(c.type,c.memoizedProps);break;case 3:case 4:if(bs){var u=qa;qa=wd(c.stateNode.containerInfo),ra(c),qa=u}else ra(c);break;case 22:c.memoizedState===null&&(u=c.alternate,u!==null&&u.memoizedState!==null?(u=$l,$l=16777216,ra(c),$l=u):ra(c));break;default:ra(c)}}function ld(c){var u=c.alternate;if(u!==null&&(c=u.child,c!==null)){u.child=null;do u=c.sibling,c.sibling=null,c=u;while(c!==null)}}function Jo(c){var u=c.deletions;if((c.flags&16)!==0){if(u!==null)for(var g=0;g<u.length;g++){var S=u[g];Oi=S,qo(S,c)}ld(c)}if(c.subtreeFlags&10256)for(c=c.child;c!==null;)vf(c),c=c.sibling}function vf(c){switch(c.tag){case 0:case 11:case 15:Jo(c),c.flags&2048&&zo(9,c,c.return);break;case 3:Jo(c);break;case 12:Jo(c);break;case 22:var u=c.stateNode;c.memoizedState!==null&&u._visibility&4&&(c.return===null||c.return.tag!==13)?(u._visibility&=-5,Vc(c)):Jo(c);break;default:Jo(c)}}function Vc(c){var u=c.deletions;if((c.flags&16)!==0){if(u!==null)for(var g=0;g<u.length;g++){var S=u[g];Oi=S,qo(S,c)}ld(c)}for(c=c.child;c!==null;){switch(u=c,u.tag){case 0:case 11:case 15:zo(8,u,u.return),Vc(u);break;case 22:g=u.stateNode,g._visibility&4&&(g._visibility&=-5,Vc(u));break;default:Vc(u)}c=c.sibling}}function qo(c,u){for(;Oi!==null;){var g=Oi;switch(g.tag){case 0:case 11:case 15:zo(8,g,u);break;case 23:case 22:if(g.memoizedState!==null&&g.memoizedState.cachePool!==null){var S=g.memoizedState.cachePool.pool;S!=null&&S.refCount++}break;case 24:Nc(g.memoizedState.cache)}if(S=g.child,S!==null)S.return=g,Oi=S;else e:for(g=c;Oi!==null;){S=Oi;var C=S.sibling,B=S.return;if(Pc(S),S===g){Oi=null;break e}if(C!==null){C.return=B,Oi=C;break e}Oi=B}}}function cd(c){var u=Gm(c);if(u!=null){if(typeof u.memoizedProps["data-testname"]!="string")throw Error(i(364));return u}if(c=ql(c),c===null)throw Error(i(362));return c.stateNode.current}function kc(c,u){var g=c.tag;switch(u.$$typeof){case Yf:if(c.type===u.value)return!0;break;case Gd:e:{for(u=u.value,c=[c,0],g=0;g<c.length;){var S=c[g++],C=S.tag,B=c[g++],J=u[B];if(C!==5&&C!==26&&C!==27||!Fr(S)){for(;J!=null&&kc(S,J);)B++,J=u[B];if(B===u.length){u=!0;break e}else for(S=S.child;S!==null;)c.push(S,B),S=S.sibling}}u=!1}return u;case zd:if((g===5||g===26||g===27)&&VS(c.stateNode,u.value))return!0;break;case ei:if((g===5||g===6||g===26||g===27)&&(c=Rf(c),c!==null&&0<=c.indexOf(u.value)))return!0;break;case Gn:if((g===5||g===26||g===27)&&(c=c.memoizedProps["data-testname"],typeof c=="string"&&c.toLowerCase()===u.value.toLowerCase()))return!0;break;default:throw Error(i(365))}return!1}function Ko(c){switch(c.$$typeof){case Yf:return"<"+(l(c.value)||"Unknown")+">";case Gd:return":has("+(Ko(c)||"")+")";case zd:return'[role="'+c.value+'"]';case ei:return'"'+c.value+'"';case Gn:return'[data-testname="'+c.value+'"]';default:throw Error(i(365))}}function O_(c,u){var g=[];c=[c,0];for(var S=0;S<c.length;){var C=c[S++],B=C.tag,J=c[S++],se=u[J];if(B!==5&&B!==26&&B!==27||!Fr(C)){for(;se!=null&&kc(C,se);)J++,se=u[J];if(J===u.length)g.push(C);else for(C=C.child;C!==null;)c.push(C,J),C=C.sibling}}return g}function ka(c,u){if(!Ir)throw Error(i(363));c=cd(c),c=O_(c,u),u=[],c=Array.from(c);for(var g=0;g<c.length;){var S=c[g++],C=S.tag;if(C===5||C===26||C===27)Fr(S)||u.push(S.stateNode);else for(S=S.child;S!==null;)c.push(S),S=S.sibling}return u}function Xa(){if(($t&2)!==0&&En!==0)return En&-En;if(ln.T!==null){var c=rs;return c!==0?c:ke()}return Vs()}function wr(){cs===0&&(cs=(En&536870912)===0||Yn?V():536870912);var c=Ds.current;return c!==null&&(c.flags|=32),cs}function La(c,u,g){(c===Rn&&li===2||c.cancelPendingCommit!==null)&&(rr(c,0),sr(c,En,cs,!1)),K(c,g),(($t&2)===0||c!==Rn)&&(c===Rn&&(($t&2)===0&&(dr|=g),zn===4&&sr(c,En,cs,!1)),mt(c))}function _f(c,u,g){if(($t&6)!==0)throw Error(i(327));var S=!g&&(u&60)===0&&(u&c.expiredLanes)===0||O(c,u),C=S?Nr(c,u):Br(c,u,!0),B=S;do{if(C===0){Ns&&!S&&sr(c,u,0,!1);break}else if(C===6)sr(c,u,0,!ti);else{if(g=c.current.alternate,B&&!I_(g)){C=Br(c,u,!1),B=!1;continue}if(C===2){if(B=u,c.errorRecoveryDisabledLanes&B)var J=0;else J=c.pendingLanes&-536870913,J=J!==0?J:J&536870912?536870912:0;if(J!==0){u=J;e:{var se=c;C=ru;var be=Ya&&se.current.memoizedState.isDehydrated;if(be&&(rr(se,J).flags|=256),J=Br(se,J,!1),J!==2){if(Ao&&!be){se.errorRecoveryDisabledLanes|=B,dr|=B,C=4;break e}B=Ls,Ls=C,B!==null&&so(B)}C=J}if(B=!1,C!==2)continue}}if(C===1){rr(c,0),sr(c,u,0,!0);break}e:{switch(S=c,C){case 0:case 1:throw Error(i(345));case 4:if((u&4194176)===u){sr(S,u,cs,!ti);break e}break;case 2:Ls=null;break;case 3:case 5:break;default:throw Error(i(329))}if(S.finishedWork=g,S.finishedLanes=u,(u&62914560)===u&&(B=Vr+300-ba(),10<B)){if(sr(S,u,cs,!ti),H(S,0)!==0)break e;S.timeoutHandle=Pm(ud.bind(null,S,g,Ls,pr,ou,u,cs,dr,So,ti,2,-0,0),B);break e}ud(S,g,Ls,pr,ou,u,cs,dr,So,ti,0,-0,0)}}break}while(!0);mt(c)}function so(c){Ls===null?Ls=c:Ls.push.apply(Ls,c)}function ud(c,u,g,S,C,B,J,se,be,Ke,St,It,Pt){var gn=u.subtreeFlags;if((gn&8192||(gn&16785408)===16785408)&&(Ms(),Hl(u),u=yd(),u!==null)){c.cancelPendingCommit=u(ui.bind(null,c,g,S,C,J,se,be,1,It,Pt)),sr(c,B,J,!Ke);return}ui(c,g,S,C,J,se,be,St,It,Pt)}function I_(c){for(var u=c;;){var g=u.tag;if((g===0||g===11||g===15)&&u.flags&16384&&(g=u.updateQueue,g!==null&&(g=g.stores,g!==null)))for(var S=0;S<g.length;S++){var C=g[S],B=C.getSnapshot;C=C.value;try{if(!Es(B(),C))return!1}catch{return!1}}if(g=u.child,u.subtreeFlags&16384&&g!==null)g.return=u,u=g;else{if(u===c)break;for(;u.sibling===null;){if(u.return===null||u.return===c)return!0;u=u.return}u.sibling.return=u.return,u=u.sibling}}return!0}function sr(c,u,g,S){u&=~Ga,u&=~dr,c.suspendedLanes|=u,c.pingedLanes&=~u,S&&(c.warmLanes|=u),S=c.expirationTimes;for(var C=u;0<C;){var B=31-as(C),J=1<<B;S[B]=-1,C&=~J}g!==0&&$(c,g,u)}function Em(){return($t&6)===0?(Ot(0),!1):!0}function ts(){if(vn!==null){if(li===0)var c=vn.return;else c=vn,Li=cl=null,at(c),Pr=null,Ys=0,c=vn;for(;c!==null;)xm(c.alternate,c),c=c.return;vn=null}}function rr(c,u){c.finishedWork=null,c.finishedLanes=0;var g=c.timeoutHandle;g!==Jl&&(c.timeoutHandle=Jl,Cf(g)),g=c.cancelPendingCommit,g!==null&&(c.cancelPendingCommit=null,g()),ts(),Rn=c,vn=g=Oa(c.current,null),En=u,li=0,Vi=null,ti=!1,Ns=O(c,u),Ao=!1,So=cs=Ga=dr=Us=zn=0,Ls=ru=null,ou=!1,(u&8)!==0&&(u|=u&32);var S=c.entangledLanes;if(S!==0)for(c=c.entanglements,S&=u;0<S;){var C=31-as(S),B=1<<C;u|=c[C],S&=~B}return hr=u,Ge(),g}function Pl(c,u){xn=null,ln.H=Jn,u===ai?(u=_t(),li=3):u===pg?(u=_t(),li=4):li=u===my?8:u!==null&&typeof u=="object"&&typeof u.then=="function"?6:1,Vi=u,vn===null&&(zn=1,Wh(c,ye(u,c.current)))}function yf(){var c=Ds.current;return c===null?!0:(En&4194176)===En?Js===null:(En&62914560)===En||(En&536870912)!==0?c===Js:!1}function Xc(){var c=ln.H;return ln.H=Jn,c===null?Jn:c}function As(){var c=ln.A;return ln.A=Pd,c}function ns(){zn=4,ti||(En&4194176)!==En&&Ds.current!==null||(Ns=!0),(Us&134217727)===0&&(dr&134217727)===0||Rn===null||sr(Rn,En,cs,!1)}function Br(c,u,g){var S=$t;$t|=2;var C=Xc(),B=As();(Rn!==c||En!==u)&&(pr=null,rr(c,u)),u=!1;var J=zn;e:do try{if(li!==0&&vn!==null){var se=vn,be=Vi;switch(li){case 8:ts(),J=6;break e;case 3:case 2:case 6:Ds.current===null&&(u=!0);var Ke=li;if(li=0,Vi=null,Wo(c,se,be,Ke),g&&Ns){J=0;break e}break;default:Ke=li,li=0,Vi=null,Wo(c,se,be,Ke)}}Dr(),J=zn;break}catch(St){Pl(c,St)}while(!0);return u&&c.shellSuspendCounter++,Li=cl=null,$t=S,ln.H=C,ln.A=B,vn===null&&(Rn=null,En=0,Ge()),J}function Dr(){for(;vn!==null;)Tm(vn)}function Nr(c,u){var g=$t;$t|=2;var S=Xc(),C=As();Rn!==c||En!==u?(pr=null,bi=ba()+500,rr(c,u)):Ns=O(c,u);e:do try{if(li!==0&&vn!==null){u=vn;var B=Vi;t:switch(li){case 1:li=0,Vi=null,Wo(c,u,B,1);break;case 2:if(Et(B)){li=0,Vi=null,fd(u);break}u=function(){li===2&&Rn===c&&(li=7),mt(c)},B.then(u,u);break e;case 3:li=7;break e;case 4:li=5;break e;case 7:Et(B)?(li=0,Vi=null,fd(u)):(li=0,Vi=null,Wo(c,u,B,7));break;case 5:var J=null;switch(vn.tag){case 26:J=vn.memoizedState;case 5:case 27:var se=vn,be=se.type,Ke=se.pendingProps;if(J?cg(J):po(be,Ke)){li=0,Vi=null;var St=se.sibling;if(St!==null)vn=St;else{var It=se.return;It!==null?(vn=It,xf(It)):vn=null}break t}}li=0,Vi=null,Wo(c,u,B,5);break;case 6:li=0,Vi=null,Wo(c,u,B,6);break;case 8:ts(),zn=6;break e;default:throw Error(i(462))}}ro();break}catch(Pt){Pl(c,Pt)}while(!0);return Li=cl=null,ln.H=S,ln.A=C,$t=g,vn!==null?0:(Rn=null,En=0,Ge(),zn)}function ro(){for(;vn!==null&&!uy();)Tm(vn)}function Tm(c){var u=R_(c.alternate,c,hr);c.memoizedProps=c.pendingProps,u===null?xf(c):vn=u}function fd(c){var u=c,g=u.alternate;switch(u.tag){case 15:case 0:u=M_(g,u,u.pendingProps,u.type,void 0,En);break;case 11:u=M_(g,u,u.pendingProps,u.type.render,u.ref,En);break;case 5:at(u);default:xm(g,u),u=vn=co(u,hr),u=R_(g,u,hr)}c.memoizedProps=c.pendingProps,u===null?xf(c):vn=u}function Wo(c,u,g,S){Li=cl=null,at(u),Pr=null,Ys=0;var C=u.return;try{if(__(c,C,u,g,En)){zn=1,Wh(c,ye(g,c.current)),vn=null;return}}catch(B){if(C!==null)throw vn=C,B;zn=1,Wh(c,ye(g,c.current)),vn=null;return}u.flags&32768?(Yn||S===1?c=!0:Ns||(En&536870912)!==0?c=!1:(ti=c=!0,(S===2||S===3||S===6)&&(S=Ds.current,S!==null&&S.tag===13&&(S.flags|=16384))),oa(u,c)):xf(u)}function xf(c){var u=c;do{if((u.flags&32768)!==0){oa(u,ti);return}c=u.return;var g=B_(u.alternate,u,hr);if(g!==null){vn=g;return}if(u=u.sibling,u!==null){vn=u;return}vn=u=c}while(u!==null);zn===0&&(zn=5)}function oa(c,u){do{var g=D_(c.alternate,c);if(g!==null){g.flags&=32767,vn=g;return}if(g=c.return,g!==null&&(g.flags|=32768,g.subtreeFlags=0,g.deletions=null),!u&&(c=c.sibling,c!==null)){vn=c;return}vn=c=g}while(c!==null);zn=6,vn=null}function ui(c,u,g,S,C,B,J,se,be,Ke){var St=ln.T,It=$i();try{Ia(2),ln.T=null,In(c,u,g,S,It,C,B,J,se,be,Ke)}finally{ln.T=St,Ia(It)}}function In(c,u,g,S,C,B,J,se){do la();while(Mo!==null);if(($t&6)!==0)throw Error(i(327));var be=c.finishedWork;if(S=c.finishedLanes,be===null)return null;if(c.finishedWork=null,c.finishedLanes=0,be===c.current)throw Error(i(177));c.callbackNode=null,c.callbackPriority=0,c.cancelPendingCommit=null;var Ke=be.lanes|be.childLanes;if(Ke|=tu,ne(c,S,Ke,B,J,se),c===Rn&&(vn=Rn=null,En=0),(be.subtreeFlags&10256)===0&&(be.flags&10256)===0||Ks||(Ks=!0,Vd=Ke,tc=g,Af(Dd,function(){return la(),null})),g=(be.flags&15990)!==0,(be.subtreeFlags&15990)!==0||g?(g=ln.T,ln.T=null,B=$i(),Ia(2),J=$t,$t|=4,Hc(c,be),ko(be,c),Fm(c.containerInfo),c.current=be,ad(c,be.alternate,be),fy(),$t=J,Ia(B),ln.T=g):c.current=be,Ks?(Ks=!1,Mo=c,ec=S):oo(c,Ke),Ke=c.pendingLanes,Ke===0&&(Os=null),I(be.stateNode),mt(c),u!==null)for(C=c.onRecoverableError,be=0;be<u.length;be++)Ke=u[be],C(Ke.value,{componentStack:Ke.stack});return(ec&3)!==0&&la(),Ke=c.pendingLanes,(S&4194218)!==0&&(Ke&42)!==0?c===Ka?nc++:(nc=0,Ka=c):nc=0,Ot(0),null}function oo(c,u){(c.pooledCacheLanes&=u)===0&&(u=c.pooledCache,u!=null&&(c.pooledCache=null,Nc(u)))}function la(){if(Mo!==null){var c=Mo,u=Vd;Vd=0;var g=ge(ec),S=32>g?32:g;g=ln.T;var C=$i();try{if(Ia(S),ln.T=null,Mo===null)var B=!1;else{S=tc,tc=null;var J=Mo,se=ec;if(Mo=null,ec=0,($t&6)!==0)throw Error(i(331));var be=$t;if($t|=4,vf(J.current),od(J,J.current,se,S),$t=be,Ot(0,!1),ss&&typeof ss.onPostCommitFiberRoot=="function")try{ss.onPostCommitFiberRoot($c,J)}catch{}B=!0}return B}finally{Ia(C),ln.T=g,oo(c,u)}}return!1}function hd(c,u,g){u=ye(g,u),u=cf(c.stateNode,u,2),c=qe(c,u,2),c!==null&&(K(c,2),mt(c))}function Dn(c,u,g){if(c.tag===3)hd(c,c,g);else for(;u!==null;){if(u.tag===3){hd(u,c,g);break}else if(u.tag===1){var S=u.stateNode;if(typeof u.type.getDerivedStateFromError=="function"||typeof S.componentDidCatch=="function"&&(Os===null||!Os.has(S))){c=ye(g,c),g=Dc(2),S=qe(u,g,2),S!==null&&(uf(g,S,u,c),K(S,2),mt(S));break}}u=u.return}}function dd(c,u,g){var S=c.pingCache;if(S===null){S=c.pingCache=new Nn;var C=new Set;S.set(u,C)}else C=S.get(u),C===void 0&&(C=new Set,S.set(u,C));C.has(g)||(Ao=!0,C.add(g),c=F_.bind(null,c,u,g),u.then(c,c))}function F_(c,u,g){var S=c.pingCache;S!==null&&S.delete(u),c.pingedLanes|=c.suspendedLanes&g,c.warmLanes&=~g,Rn===c&&(En&g)===g&&(zn===4||zn===3&&(En&62914560)===En&&300>ba()-Vr?($t&2)===0&&rr(c,0):Ga|=g,So===En&&(So=0)),mt(c)}function Gl(c,u){u===0&&(u=U()),c=xt(c,u),c!==null&&(K(c,u),mt(c))}function zl(c){var u=c.memoizedState,g=0;u!==null&&(g=u.retryLane),Gl(c,g)}function Cm(c,u){var g=0;switch(c.tag){case 13:var S=c.stateNode,C=c.memoizedState;C!==null&&(g=C.retryLane);break;case 19:S=c.stateNode;break;case 22:S=c.stateNode._retryCache;break;default:throw Error(i(314))}S!==null&&S.delete(u),Gl(c,g)}function Af(c,u){return Qc(c,u)}function Rm(c,u,g,S){this.tag=c,this.key=g,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.refCleanup=this.ref=null,this.pendingProps=u,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=S,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function lo(c){return c=c.prototype,!(!c||!c.isReactComponent)}function Oa(c,u){var g=c.alternate;return g===null?(g=t(c.tag,u,c.key,c.mode),g.elementType=c.elementType,g.type=c.type,g.stateNode=c.stateNode,g.alternate=c,c.alternate=g):(g.pendingProps=u,g.type=c.type,g.flags=0,g.subtreeFlags=0,g.deletions=null),g.flags=c.flags&31457280,g.childLanes=c.childLanes,g.lanes=c.lanes,g.child=c.child,g.memoizedProps=c.memoizedProps,g.memoizedState=c.memoizedState,g.updateQueue=c.updateQueue,u=c.dependencies,g.dependencies=u===null?null:{lanes:u.lanes,firstContext:u.firstContext},g.sibling=c.sibling,g.index=c.index,g.ref=c.ref,g.refCleanup=c.refCleanup,g}function co(c,u){c.flags&=31457282;var g=c.alternate;return g===null?(c.childLanes=0,c.lanes=u,c.child=null,c.subtreeFlags=0,c.memoizedProps=null,c.memoizedState=null,c.updateQueue=null,c.dependencies=null,c.stateNode=null):(c.childLanes=g.childLanes,c.lanes=g.lanes,c.child=g.child,c.subtreeFlags=0,c.deletions=null,c.memoizedProps=g.memoizedProps,c.memoizedState=g.memoizedState,c.updateQueue=g.updateQueue,c.type=g.type,u=g.dependencies,c.dependencies=u===null?null:{lanes:u.lanes,firstContext:u.firstContext}),c}function zs(c,u,g,S,C,B){var J=0;if(S=c,typeof c=="function")lo(c)&&(J=1);else if(typeof c=="string")J=bs&&Ma?ng(c,g,ua.current)?26:jc(c)?27:5:bs?ng(c,g,ua.current)?26:5:Ma&&jc(c)?27:5;else e:switch(c){case Jc:return uo(g.children,C,B,u);case Um:J=8,C|=24;break;case Lm:return c=t(12,g,u,C|2),c.elementType=Lm,c.lanes=B,c;case md:return c=t(13,g,u,C),c.elementType=md,c.lanes=B,c;case Qo:return c=t(19,g,u,C),c.elementType=Qo,c.lanes=B,c;case bf:return pd(g,C,B,u);default:if(typeof c=="object"&&c!==null)switch(c.$$typeof){case G_:case Ur:J=10;break e;case Zo:J=9;break e;case qc:J=11;break e;case Mf:J=14;break e;case lr:J=16,S=null;break e}J=29,g=Error(i(130,c===null?"null":typeof c,"")),S=null}return u=t(J,g,u,C),u.elementType=c,u.type=S,u.lanes=B,u}function uo(c,u,g,S){return c=t(7,c,S,u),c.lanes=g,c}function pd(c,u,g,S){c=t(22,c,S,u),c.elementType=bf,c.lanes=g;var C={_visibility:1,_pendingVisibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null,_current:null,detach:function(){var B=C._current;if(B===null)throw Error(i(456));if((C._pendingVisibility&2)===0){var J=xt(B,2);J!==null&&(C._pendingVisibility|=2,La(J,B,2))}},attach:function(){var B=C._current;if(B===null)throw Error(i(456));if((C._pendingVisibility&2)!==0){var J=xt(B,2);J!==null&&(C._pendingVisibility&=-3,La(J,B,2))}}};return c.stateNode=C,c}function jo(c,u,g){return c=t(6,c,null,u),c.lanes=g,c}function Yc(c,u,g){return u=t(4,c.children!==null?c.children:[],c.key,u),u.lanes=g,u.stateNode={containerInfo:c.containerInfo,pendingChildren:null,implementation:c.implementation},u}function Vl(c,u,g,S,C,B,J,se){this.tag=1,this.containerInfo=c,this.finishedWork=this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=Jl,this.callbackNode=this.next=this.pendingContext=this.context=this.cancelPendingCommit=null,this.callbackPriority=0,this.expirationTimes=F(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.finishedLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=F(0),this.hiddenUpdates=F(null),this.identifierPrefix=S,this.onUncaughtError=C,this.onCaughtError=B,this.onRecoverableError=J,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=se,this.incompleteTransitions=new Map}function ca(c,u,g,S,C,B,J,se,be,Ke,St,It){return c=new Vl(c,u,g,J,se,be,Ke,It),u=1,B===!0&&(u|=24),B=t(3,null,null,u),c.current=B,B.stateNode=c,u=$h(),u.refCount++,c.pooledCache=u,u.refCount++,B.memoizedState={element:S,isDehydrated:g,cache:u},Ht(B),c}function Sf(c){return c?(c=Kl,c):Kl}function wm(c){var u=c._reactInternals;if(u===void 0)throw typeof c.render=="function"?Error(i(188)):(c=Object.keys(c).join(","),Error(i(268,c)));return c=x(u),c=c!==null?b(c):null,c===null?null:Kc(c.stateNode)}function H_(c,u,g,S,C,B){C=Sf(C),S.context===null?S.context=C:S.pendingContext=C,S=Ye(u),S.payload={element:g},B=B===void 0?null:B,B!==null&&(S.callback=B),g=qe(c,S,u),g!==null&&(La(g,c,u),wt(g,c,u))}function P_(c,u){if(c=c.memoizedState,c!==null&&c.dehydrated!==null){var g=c.retryLane;c.retryLane=g!==0&&g<u?g:u}}function Bm(c,u){P_(c,u),(c=c.alternate)&&P_(c,u)}var Qt={},Dm=qf(),Aa=DL(),kl=Object.assign,Nm=Symbol.for("react.element"),fo=Symbol.for("react.transitional.element"),or=Symbol.for("react.portal"),Jc=Symbol.for("react.fragment"),Um=Symbol.for("react.strict_mode"),Lm=Symbol.for("react.profiler"),G_=Symbol.for("react.provider"),Zo=Symbol.for("react.consumer"),Ur=Symbol.for("react.context"),qc=Symbol.for("react.forward_ref"),md=Symbol.for("react.suspense"),Qo=Symbol.for("react.suspense_list"),Mf=Symbol.for("react.memo"),lr=Symbol.for("react.lazy"),bf=Symbol.for("react.offscreen"),z_=Symbol.for("react.memo_cache_sentinel"),Om=Symbol.iterator,Xl=Symbol.for("react.client.reference"),ln=Dm.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,gd,Im,$o=!1,el=Array.isArray,vd=e.rendererVersion,Ef=e.rendererPackageName,Tf=e.extraDevToolsConfig,Kc=e.getPublicInstance,Yl=e.getRootHostContext,V_=e.getChildHostContext,tl=e.prepareForCommit,Fm=e.resetAfterCommit,Hm=e.createInstance,Lr=e.appendInitialChild,ho=e.finalizeInitialChildren,nl=e.shouldSetTextContent,_d=e.createTextInstance,Pm=e.scheduleTimeout,Cf=e.cancelTimeout,Jl=e.noTimeout,Or=e.isPrimaryRenderer;e.warnsIfNotActing;var Sa=e.supportsMutation,Ss=e.supportsPersistence,Ya=e.supportsHydration,Gm=e.getInstanceFromNode;e.beforeActiveInstanceBlur,e.afterActiveInstanceBlur;var zm=e.preparePortalMount;e.prepareScopeUpdate,e.getInstanceFromScope;var Ia=e.setCurrentUpdatePriority,$i=e.getCurrentUpdatePriority,Vs=e.resolveUpdatePriority;e.resolveEventType,e.resolveEventTimeStamp;var il=e.shouldAttemptEagerTransition,Vm=e.detachDeletedInstance;e.requestPostPaintCallback;var k_=e.maySuspendCommit,po=e.preloadInstance,Ms=e.startSuspendingCommit,Bi=e.suspendInstance,yd=e.waitForCommitToBeReady,is=e.NotPendingTransition,fn=e.HostTransitionContext,oi=e.resetFormInstance;e.bindToConsole;var Ki=e.supportsMicrotasks,xd=e.scheduleMicrotask,Ir=e.supportsTestSelectors,ql=e.findFiberRoot,Ad=e.getBoundingRect,Rf=e.getTextContent,Fr=e.isHiddenSubtree,VS=e.matchAccessibilityRole,Di=e.setFocusIfFocusable,km=e.setupIntersectionObserver,Xm=e.appendChild,X_=e.appendChildToContainer,Y_=e.commitTextUpdate,kS=e.commitMount,Ym=e.commitUpdate,Jm=e.insertBefore,qm=e.insertInContainerBefore,Ja=e.removeChild,Hi=e.removeChildFromContainer,wf=e.resetTextContent,Bf=e.hideInstance,Sd=e.hideTextInstance,Km=e.unhideInstance,mo=e.unhideTextInstance,Md=e.clearContainer,Wm=e.cloneInstance,bd=e.createContainerChildSet,jm=e.appendChildToContainerChildSet,J_=e.finalizeContainerChildren,Zm=e.replaceContainerChildren,Qm=e.cloneHiddenInstance,$m=e.cloneHiddenTextInstance,Ed=e.isSuspenseInstancePending,Df=e.isSuspenseInstanceFallback,q_=e.getSuspenseInstanceFallbackErrorDetails,XS=e.registerSuspenseInstanceRetry,K_=e.canHydrateFormStateMarker,W_=e.isFormStateMarkerMatching,eg=e.getNextHydratableSibling,Td=e.getFirstHydratableChild,j_=e.getFirstHydratableChildWithinContainer,Z_=e.getFirstHydratableChildWithinSuspenseInstance,Q_=e.canHydrateInstance,$_=e.canHydrateTextInstance,ey=e.canHydrateSuspenseInstance,YS=e.hydrateInstance,ty=e.hydrateTextInstance,Wc=e.hydrateSuspenseInstance,ny=e.getNextHydratableInstanceAfterSuspenseInstance,Cd=e.commitHydratedContainer,Rd=e.commitHydratedSuspenseInstance,iy=e.clearSuspenseBoundary,tg=e.clearSuspenseBoundaryFromContainer,ay=e.shouldDeleteUnhydratedTailInstances;e.diffHydratedPropsForDevWarnings,e.diffHydratedTextForDevWarnings,e.describeHydratableInstanceForDevWarnings;var sy=e.validateHydratableInstance,ry=e.validateHydratableTextInstance,bs=e.supportsResources,ng=e.isHostHoistableType,wd=e.getHoistableRoot,Bd=e.getResource,ig=e.acquireResource,ag=e.releaseResource,sg=e.hydrateHoistable,rg=e.mountHoistable,og=e.unmountHoistable,JS=e.createHoistableInstance,lg=e.prepareToCommitHoistables,oy=e.mayResourceSuspendCommit,cg=e.preloadResource,ug=e.suspendResource,Ma=e.supportsSingletons,fg=e.resolveSingletonInstance,qS=e.clearSingleton,KS=e.acquireSingletonInstance,ly=e.releaseSingletonInstance,jc=e.isHostSingletonType,Nf=[],go=-1,Kl={},as=Math.clz32?Math.clz32:D,Uf=Math.log,cy=Math.LN2,Zc=128,Lf=4194304,Qc=Aa.unstable_scheduleCallback,Of=Aa.unstable_cancelCallback,uy=Aa.unstable_shouldYield,fy=Aa.unstable_requestPaint,ba=Aa.unstable_now,hg=Aa.unstable_ImmediatePriority,hy=Aa.unstable_UserBlockingPriority,Dd=Aa.unstable_NormalPriority,Nd=Aa.unstable_IdlePriority,dy=Aa.log,dg=Aa.unstable_setDisableYieldValue,$c=null,ss=null,Es=typeof Object.is=="function"?Object.is:ee,Ud=new WeakMap,vi=[],Ni=0,If=null,Ff=0,Ts=[],Cs=0,cr=null,Hr=1,ks="",ua=T(null),Hf=T(null),ur=T(null),eu=T(null),Fa=null,Ea=null,Yn=!1,Rs=null,Xs=!1,Pf=Error(i(519)),ws=[],al=0,tu=0,nu=null,Wl=null,Gf=!1,zf=!1,fr=!1,sl=0,Vf=null,Ld=0,rs=0,rl=null,vo=!1,iu=!1,kf=Object.prototype.hasOwnProperty,ai=Error(i(460)),pg=Error(i(474)),Od={then:function(){}},jl=null,Pr=null,Ys=0,ol=va(!0),mg=va(!1),Gr=T(null),Bs=T(0),Ds=T(null),Js=null,Wi=T(0),zr=0,xn=null,Zn=null,Pi=null,qs=!1,_i=!1,_o=!1,Xf=0,Ui=0,au=null,py=0,Id=function(){return{lastEffect:null,events:null,stores:null,memoCache:null}},Jn={readContext:xa,use:dt,useCallback:mn,useContext:mn,useEffect:mn,useImperativeHandle:mn,useLayoutEffect:mn,useInsertionEffect:mn,useMemo:mn,useReducer:mn,useRef:mn,useState:mn,useDebugValue:mn,useDeferredValue:mn,useTransition:mn,useSyncExternalStore:mn,useId:mn};Jn.useCacheRefresh=mn,Jn.useMemoCache=mn,Jn.useHostTransitionStatus=mn,Jn.useFormState=mn,Jn.useActionState=mn,Jn.useOptimistic=mn;var ji={readContext:xa,use:dt,useCallback:function(c,u){return st().memoizedState=[c,u===void 0?null:u],c},useContext:xa,useEffect:Er,useImperativeHandle:function(c,u,g){g=g!=null?g.concat([c]):null,ri(4194308,4,af.bind(null,u,c),g)},useLayoutEffect:function(c,u){return ri(4194308,4,c,u)},useInsertionEffect:function(c,u){ri(4,2,c,u)},useMemo:function(c,u){var g=st();u=u===void 0?null:u;var S=c();if(_o){W(!0);try{c()}finally{W(!1)}}return g.memoizedState=[S,u],S},useReducer:function(c,u,g){var S=st();if(g!==void 0){var C=g(u);if(_o){W(!0);try{g(u)}finally{W(!1)}}}else C=u;return S.memoizedState=S.baseState=C,c={pending:null,lanes:0,dispatch:null,lastRenderedReducer:c,lastRenderedState:C},S.queue=c,c=c.dispatch=Oo.bind(null,xn,c),[S.memoizedState,c]},useRef:function(c){var u=st();return c={current:c},u.memoizedState=c},useState:function(c){c=He(c);var u=c.queue,g=qh.bind(null,xn,u);return u.dispatch=g,[c.memoizedState,g]},useDebugValue:sf,useDeferredValue:function(c,u){var g=st();return Lo(g,c,u)},useTransition:function(){var c=He(!1);return c=Yh.bind(null,xn,c.queue,!0,!1),st().memoizedState=c,[!1,c]},useSyncExternalStore:function(c,u,g){var S=xn,C=st();if(Yn){if(g===void 0)throw Error(i(407));g=g()}else{if(g=u(),Rn===null)throw Error(i(349));(En&60)!==0||ut(S,u,g)}C.memoizedState=g;var B={value:g,getSnapshot:u};return C.queue=B,Er(xe.bind(null,S,B,c),[c]),S.flags|=2048,Pn(9,ht.bind(null,S,B,g,u),{destroy:void 0},null),g},useId:function(){var c=st(),u=Rn.identifierPrefix;if(Yn){var g=ks,S=Hr;g=(S&~(1<<32-as(S)-1)).toString(32)+g,u=":"+u+"R"+g,g=Xf++,0<g&&(u+="H"+g.toString(32)),u+=":"}else g=py++,u=":"+u+"r"+g.toString(32)+":";return c.memoizedState=u},useCacheRefresh:function(){return st().memoizedState=rf.bind(null,xn)}};ji.useMemoCache=k,ji.useHostTransitionStatus=Nl,ji.useFormState=un,ji.useActionState=un,ji.useOptimistic=function(c){var u=st();u.memoizedState=u.baseState=c;var g={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return u.queue=g,u=Kh.bind(null,xn,!0,g),g.dispatch=u,[c,u]};var Ha={readContext:xa,use:dt,useCallback:Xh,useContext:xa,useEffect:_s,useImperativeHandle:Tr,useInsertionEffect:g_,useLayoutEffect:v_,useMemo:Dl,useReducer:ue,useRef:jn,useState:function(){return ue(ie)},useDebugValue:sf,useDeferredValue:function(c,u){var g=tt();return am(g,Zn.memoizedState,c,u)},useTransition:function(){var c=ue(ie)[0],u=tt().memoizedState;return[typeof c=="boolean"?c:yt(c),u]},useSyncExternalStore:it,useId:Cr};Ha.useCacheRefresh=Jh,Ha.useMemoCache=k,Ha.useHostTransitionStatus=Nl,Ha.useFormState=Wn,Ha.useActionState=Wn,Ha.useOptimistic=function(c,u){var g=tt();return Ve(g,Zn,c,u)};var ll={readContext:xa,use:dt,useCallback:Xh,useContext:xa,useEffect:_s,useImperativeHandle:Tr,useInsertionEffect:g_,useLayoutEffect:v_,useMemo:Dl,useReducer:ce,useRef:jn,useState:function(){return ce(ie)},useDebugValue:sf,useDeferredValue:function(c,u){var g=tt();return Zn===null?Lo(g,c,u):am(g,Zn.memoizedState,c,u)},useTransition:function(){var c=ce(ie)[0],u=tt().memoizedState;return[typeof c=="boolean"?c:yt(c),u]},useSyncExternalStore:it,useId:Cr};ll.useCacheRefresh=Jh,ll.useMemoCache=k,ll.useHostTransitionStatus=Nl,ll.useFormState=rn,ll.useActionState=rn,ll.useOptimistic=function(c,u){var g=tt();return Zn!==null?Ve(g,Zn,c,u):(g.baseState=c,[c,g.queue.dispatch])};var Fd={isMounted:function(c){return(c=c._reactInternals)?v(c)===c:!1},enqueueSetState:function(c,u,g){c=c._reactInternals;var S=Xa(),C=Ye(S);C.payload=u,g!=null&&(C.callback=g),u=qe(c,C,S),u!==null&&(La(u,c,S),wt(u,c,S))},enqueueReplaceState:function(c,u,g){c=c._reactInternals;var S=Xa(),C=Ye(S);C.tag=1,C.payload=u,g!=null&&(C.callback=g),u=qe(c,C,S),u!==null&&(La(u,c,S),wt(u,c,S))},enqueueForceUpdate:function(c,u){c=c._reactInternals;var g=Xa(),S=Ye(g);S.tag=2,u!=null&&(S.callback=u),u=qe(c,S,g),u!==null&&(La(u,c,g),wt(u,c,g))}},gg=typeof reportError=="function"?reportError:function(c){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var u=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof c=="object"&&c!==null&&typeof c.message=="string"?String(c.message):String(c),error:c});if(!window.dispatchEvent(u))return}else if(typeof hl=="object"&&typeof hl.emit=="function"){hl.emit("uncaughtException",c);return}console.error(c)},my=Error(i(461)),Gi=!1,Pa={dehydrated:null,treeContext:null,retryLane:0},os=T(null),cl=null,Li=null,gy=typeof AbortController<"u"?AbortController:function(){var c=[],u=this.signal={aborted:!1,addEventListener:function(g,S){c.push(S)}};this.abort=function(){u.aborted=!0,c.forEach(function(g){return g()})}},yo=Aa.unstable_scheduleCallback,Zl=Aa.unstable_NormalPriority,$n={$$typeof:Ur,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0},Hd=ln.S;ln.S=function(c,u){typeof u=="object"&&u!==null&&typeof u.then=="function"&&Ie(c,u),Hd!==null&&Hd(c,u)};var xo=T(null),ea=!1,Mi=!1,ul=!1,su=typeof WeakSet=="function"?WeakSet:Set,Oi=null,Ql=!1,zi=null,ls=!1,qa=null,$l=8192,Pd={getCacheForType:function(c){var u=xa($n),g=u.data.get(c);return g===void 0&&(g=c(),u.data.set(c,g)),g}},Yf=0,Gd=1,zd=2,Gn=3,ei=4;if(typeof Symbol=="function"&&Symbol.for){var An=Symbol.for;Yf=An("selector.component"),Gd=An("selector.has_pseudo_class"),zd=An("selector.role"),Gn=An("selector.test_id"),ei=An("selector.text")}var Nn=typeof WeakMap=="function"?WeakMap:Map,$t=0,Rn=null,vn=null,En=0,li=0,Vi=null,ti=!1,Ns=!1,Ao=!1,hr=0,zn=0,Us=0,dr=0,Ga=0,cs=0,So=0,ru=null,Ls=null,ou=!1,Vr=0,bi=1/0,pr=null,Os=null,Ks=!1,Mo=null,ec=0,Vd=0,tc=null,nc=0,Ka=null;return Qt.attemptContinuousHydration=function(c){if(c.tag===13){var u=xt(c,67108864);u!==null&&La(u,c,67108864),Bm(c,67108864)}},Qt.attemptHydrationAtCurrentPriority=function(c){if(c.tag===13){var u=Xa(),g=xt(c,u);g!==null&&La(g,c,u),Bm(c,u)}},Qt.attemptSynchronousHydration=function(c){switch(c.tag){case 3:if(c=c.stateNode,c.current.memoizedState.isDehydrated){var u=N(c.pendingLanes);if(u!==0){for(c.pendingLanes|=2,c.entangledLanes|=2;u;){var g=1<<31-as(u);c.entanglements[1]|=g,u&=~g}mt(c),($t&6)===0&&(bi=ba()+500,Ot(0))}}break;case 13:u=xt(c,2),u!==null&&La(u,c,2),Em(),Bm(c,2)}},Qt.batchedUpdates=function(c,u){return c(u)},Qt.createComponentSelector=function(c){return{$$typeof:Yf,value:c}},Qt.createContainer=function(c,u,g,S,C,B,J,se,be,Ke){return ca(c,u,!1,null,g,S,B,J,se,be,Ke,null)},Qt.createHasPseudoClassSelector=function(c){return{$$typeof:Gd,value:c}},Qt.createHydrationContainer=function(c,u,g,S,C,B,J,se,be,Ke,St,It,Pt){return c=ca(g,S,!0,c,C,B,se,be,Ke,St,It,Pt),c.context=Sf(null),g=c.current,S=Xa(),C=Ye(S),C.callback=u??null,qe(g,C,S),c.current.lanes=S,K(c,S),mt(c),c},Qt.createPortal=function(c,u,g){var S=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:or,key:S==null?null:""+S,children:c,containerInfo:u,implementation:g}},Qt.createRoleSelector=function(c){return{$$typeof:zd,value:c}},Qt.createTestNameSelector=function(c){return{$$typeof:Gn,value:c}},Qt.createTextSelector=function(c){return{$$typeof:ei,value:c}},Qt.defaultOnCaughtError=function(c){console.error(c)},Qt.defaultOnRecoverableError=function(c){gg(c)},Qt.defaultOnUncaughtError=function(c){gg(c)},Qt.deferredUpdates=function(c){var u=ln.T,g=$i();try{return Ia(32),ln.T=null,c()}finally{Ia(g),ln.T=u}},Qt.discreteUpdates=function(c,u,g,S,C){var B=ln.T,J=$i();try{return Ia(2),ln.T=null,c(u,g,S,C)}finally{Ia(J),ln.T=B,$t===0&&(bi=ba()+500)}},Qt.findAllNodes=ka,Qt.findBoundingRects=function(c,u){if(!Ir)throw Error(i(363));u=ka(c,u),c=[];for(var g=0;g<u.length;g++)c.push(Ad(u[g]));for(u=c.length-1;0<u;u--){g=c[u];for(var S=g.x,C=S+g.width,B=g.y,J=B+g.height,se=u-1;0<=se;se--)if(u!==se){var be=c[se],Ke=be.x,St=Ke+be.width,It=be.y,Pt=It+be.height;if(S>=Ke&&B>=It&&C<=St&&J<=Pt){c.splice(u,1);break}else if(S!==Ke||g.width!==be.width||Pt<B||It>J){if(!(B!==It||g.height!==be.height||St<S||Ke>C)){Ke>S&&(be.width+=Ke-S,be.x=S),St<C&&(be.width=C-Ke),c.splice(u,1);break}}else{It>B&&(be.height+=It-B,be.y=B),Pt<J&&(be.height=J-It),c.splice(u,1);break}}}return c},Qt.findHostInstance=wm,Qt.findHostInstanceWithNoPortals=function(c){return c=x(c),c=c!==null?R(c):null,c===null?null:Kc(c.stateNode)},Qt.findHostInstanceWithWarning=function(c){return wm(c)},Qt.flushPassiveEffects=la,Qt.flushSyncFromReconciler=function(c){var u=$t;$t|=1;var g=ln.T,S=$i();try{if(Ia(2),ln.T=null,c)return c()}finally{Ia(S),ln.T=g,$t=u,($t&6)===0&&Ot(0)}},Qt.flushSyncWork=Em,Qt.focusWithin=function(c,u){if(!Ir)throw Error(i(363));for(c=cd(c),u=O_(c,u),u=Array.from(u),c=0;c<u.length;){var g=u[c++],S=g.tag;if(!Fr(g)){if((S===5||S===26||S===27)&&Di(g.stateNode))return!0;for(g=g.child;g!==null;)u.push(g),g=g.sibling}}return!1},Qt.getFindAllNodesFailureDescription=function(c,u){if(!Ir)throw Error(i(363));var g=0,S=[];c=[cd(c),0];for(var C=0;C<c.length;){var B=c[C++],J=B.tag,se=c[C++],be=u[se];if((J!==5&&J!==26&&J!==27||!Fr(B))&&(kc(B,be)&&(S.push(Ko(be)),se++,se>g&&(g=se)),se<u.length))for(B=B.child;B!==null;)c.push(B,se),B=B.sibling}if(g<u.length){for(c=[];g<u.length;g++)c.push(Ko(u[g]));return`findAllNodes was able to match part of the selector:
|
|
4026
|
+
`+g.stack}}function v(c){var u=c,g=c;if(c.alternate)for(;u.return;)u=u.return;else{c=u;do u=c,(u.flags&4098)!==0&&(g=u.return),c=u.return;while(c)}return u.tag===3?g:null}function y(c){if(v(c)!==c)throw Error(i(188))}function x(c){var u=c.alternate;if(!u){if(u=v(c),u===null)throw Error(i(188));return u!==c?null:c}for(var g=c,S=u;;){var C=g.return;if(C===null)break;var B=C.alternate;if(B===null){if(S=C.return,S!==null){g=S;continue}break}if(C.child===B.child){for(B=C.child;B;){if(B===g)return y(C),c;if(B===S)return y(C),u;B=B.sibling}throw Error(i(188))}if(g.return!==S.return)g=C,S=B;else{for(var J=!1,se=C.child;se;){if(se===g){J=!0,g=C,S=B;break}if(se===S){J=!0,S=C,g=B;break}se=se.sibling}if(!J){for(se=B.child;se;){if(se===g){J=!0,g=B,S=C;break}if(se===S){J=!0,S=B,g=C;break}se=se.sibling}if(!J)throw Error(i(189))}}if(g.alternate!==S)throw Error(i(190))}if(g.tag!==3)throw Error(i(188));return g.stateNode.current===g?c:u}function b(c){var u=c.tag;if(u===5||u===26||u===27||u===6)return c;for(c=c.child;c!==null;){if(u=b(c),u!==null)return u;c=c.sibling}return null}function R(c){var u=c.tag;if(u===5||u===26||u===27||u===6)return c;for(c=c.child;c!==null;){if(c.tag!==4&&(u=R(c),u!==null))return u;c=c.sibling}return null}function T(c){return{current:c}}function M(c){0>go||(c.current=Nf[go],Nf[go]=null,go--)}function w(c,u){go++,Nf[go]=c.current,c.current=u}function D(c){return c>>>=0,c===0?32:31-(Uf(c)/cy|0)|0}function N(c){var u=c&42;if(u!==0)return u;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:return 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&4194176;case 4194304:case 8388608:case 16777216:case 33554432:return c&62914560;case 67108864:return 67108864;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 0;default:return c}}function H(c,u){var g=c.pendingLanes;if(g===0)return 0;var S=0,C=c.suspendedLanes,B=c.pingedLanes,J=c.warmLanes;c=c.finishedLanes!==0;var se=g&134217727;return se!==0?(g=se&~C,g!==0?S=N(g):(B&=se,B!==0?S=N(B):c||(J=se&~J,J!==0&&(S=N(J))))):(se=g&~C,se!==0?S=N(se):B!==0?S=N(B):c||(J=g&~J,J!==0&&(S=N(J)))),S===0?0:u!==0&&u!==S&&(u&C)===0&&(C=S&-S,J=u&-u,C>=J||C===32&&(J&4194176)!==0)?u:S}function O(c,u){return(c.pendingLanes&~(c.suspendedLanes&~c.pingedLanes)&u)===0}function z(c,u){switch(c){case 1:case 2:case 4:case 8:return u+250;case 16:case 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 u+5e3;case 4194304:case 8388608:case 16777216:case 33554432:return-1;case 67108864:case 134217728:case 268435456:case 536870912:case 1073741824:return-1;default:return-1}}function V(){var c=Zc;return Zc<<=1,(Zc&4194176)===0&&(Zc=128),c}function U(){var c=Lf;return Lf<<=1,(Lf&62914560)===0&&(Lf=4194304),c}function F(c){for(var u=[],g=0;31>g;g++)u.push(c);return u}function K(c,u){c.pendingLanes|=u,u!==268435456&&(c.suspendedLanes=0,c.pingedLanes=0,c.warmLanes=0)}function ne(c,u,g,S,C,B){var J=c.pendingLanes;c.pendingLanes=g,c.suspendedLanes=0,c.pingedLanes=0,c.warmLanes=0,c.expiredLanes&=g,c.entangledLanes&=g,c.errorRecoveryDisabledLanes&=g,c.shellSuspendCounter=0;var se=c.entanglements,be=c.expirationTimes,Ke=c.hiddenUpdates;for(g=J&~g;0<g;){var St=31-as(g),It=1<<St;se[St]=0,be[St]=-1;var Pt=Ke[St];if(Pt!==null)for(Ke[St]=null,St=0;St<Pt.length;St++){var gn=Pt[St];gn!==null&&(gn.lane&=-536870913)}g&=~It}S!==0&&$(c,S,0),B!==0&&C===0&&c.tag!==0&&(c.suspendedLanes|=B&~(J&~u))}function $(c,u,g){c.pendingLanes|=u,c.suspendedLanes&=~u;var S=31-as(u);c.entangledLanes|=u,c.entanglements[S]=c.entanglements[S]|1073741824|g&4194218}function ae(c,u){var g=c.entangledLanes|=u;for(c=c.entanglements;g;){var S=31-as(g),C=1<<S;C&u|c[S]&u&&(c[S]|=u),g&=~C}}function ge(c){return c&=-c,2<c?8<c?(c&134217727)!==0?32:268435456:8:2}function I(c){if(ss&&typeof ss.onCommitFiberRoot=="function")try{ss.onCommitFiberRoot($c,c,void 0,(c.current.flags&128)===128)}catch{}}function W(c){if(typeof dy=="function"&&dg(c),ss&&typeof ss.setStrictMode=="function")try{ss.setStrictMode($c,c)}catch{}}function ee(c,u){return c===u&&(c!==0||1/c===1/u)||c!==c&&u!==u}function ye(c,u){if(typeof c=="object"&&c!==null){var g=Ud.get(c);return g!==void 0?g:(u={value:c,source:u,stack:_(u)},Ud.set(c,u),u)}return{value:c,source:u,stack:_(u)}}function _e(c,u){vi[Ni++]=Ff,vi[Ni++]=If,If=c,Ff=u}function X(c,u,g){Ts[Cs++]=Hr,Ts[Cs++]=ks,Ts[Cs++]=cr,cr=c;var S=Hr;c=ks;var C=32-as(S)-1;S&=~(1<<C),g+=1;var B=32-as(u)+C;if(30<B){var J=C-C%5;B=(S&(1<<J)-1).toString(32),S>>=J,C-=J,Hr=1<<32-as(u)+C|g<<C|S,ks=B+c}else Hr=1<<B|g<<C|S,ks=c}function te(c){c.return!==null&&(_e(c,1),X(c,1,0))}function le(c){for(;c===If;)If=vi[--Ni],vi[Ni]=null,Ff=vi[--Ni],vi[Ni]=null;for(;c===cr;)cr=Ts[--Cs],Ts[Cs]=null,ks=Ts[--Cs],Ts[Cs]=null,Hr=Ts[--Cs],Ts[Cs]=null}function ve(c,u){w(ur,u),w(Hf,c),w(ua,null),c=Yl(u),M(ua),w(ua,c)}function ze(){M(ua),M(Hf),M(ur)}function he(c){c.memoizedState!==null&&w(eu,c);var u=ua.current,g=V_(u,c.type);u!==g&&(w(Hf,c),w(ua,g))}function Ee(c){Hf.current===c&&(M(ua),M(Hf)),eu.current===c&&(M(eu),Or?fn._currentValue=is:fn._currentValue2=is)}function lt(c){var u=Error(i(418,""));throw Wt(ye(u,c)),Pf}function Rt(c,u){if(!Ya)throw Error(i(175));YS(c.stateNode,c.type,c.memoizedProps,u,c)||lt(c)}function Bt(c){for(Fa=c.return;Fa;)switch(Fa.tag){case 3:case 27:Xs=!0;return;case 5:case 13:Xs=!1;return;default:Fa=Fa.return}}function tn(c){if(!Ya||c!==Fa)return!1;if(!Yn)return Bt(c),Yn=!0,!1;var u=!1;if(Ma?c.tag!==3&&c.tag!==27&&(c.tag!==5||ay(c.type)&&!nl(c.type,c.memoizedProps))&&(u=!0):c.tag!==3&&(c.tag!==5||ay(c.type)&&!nl(c.type,c.memoizedProps))&&(u=!0),u&&Ea&<(c),Bt(c),c.tag===13){if(!Ya)throw Error(i(316));if(c=c.memoizedState,c=c!==null?c.dehydrated:null,!c)throw Error(i(317));Ea=ny(c)}else Ea=Fa?eg(c.stateNode):null;return!0}function on(){Ya&&(Ea=Fa=null,Yn=!1)}function Wt(c){Rs===null?Rs=[c]:Rs.push(c)}function Ge(){for(var c=al,u=tu=al=0;u<c;){var g=ws[u];ws[u++]=null;var S=ws[u];ws[u++]=null;var C=ws[u];ws[u++]=null;var B=ws[u];if(ws[u++]=null,S!==null&&C!==null){var J=S.pending;J===null?C.next=C:(C.next=J.next,J.next=C),S.pending=C}B!==0&&Q(g,C,B)}}function et(c,u,g,S){ws[al++]=c,ws[al++]=u,ws[al++]=g,ws[al++]=S,tu|=S,c.lanes|=S,c=c.alternate,c!==null&&(c.lanes|=S)}function Je(c,u,g,S){return et(c,u,g,S),Dt(c)}function xt(c,u){return et(c,null,null,u),Dt(c)}function Q(c,u,g){c.lanes|=g;var S=c.alternate;S!==null&&(S.lanes|=g);for(var C=!1,B=c.return;B!==null;)B.childLanes|=g,S=B.alternate,S!==null&&(S.childLanes|=g),B.tag===22&&(c=B.stateNode,c===null||c._visibility&1||(C=!0)),c=B,B=B.return;C&&u!==null&&c.tag===3&&(B=c.stateNode,C=31-as(g),B=B.hiddenUpdates,c=B[C],c===null?B[C]=[u]:c.push(u),u.lane=g|536870912)}function Dt(c){if(50<nc)throw nc=0,Ka=null,Error(i(185));for(var u=c.return;u!==null;)c=u,u=c.return;return c.tag===3?c.stateNode:null}function mt(c){c!==Wl&&c.next===null&&(Wl===null?nu=Wl=c:Wl=Wl.next=c),zf=!0,Gf||(Gf=!0,Fe(gt))}function Lt(c,u){if(!fr&&zf){fr=!0;do for(var g=!1,S=nu;S!==null;){if(c!==0){var C=S.pendingLanes;if(C===0)var B=0;else{var J=S.suspendedLanes,se=S.pingedLanes;B=(1<<31-as(42|c)+1)-1,B&=C&~(J&~se),B=B&201326677?B&201326677|1:B?B|2:0}B!==0&&(g=!0,de(S,B))}else B=En,B=H(S,S===Rn?B:0),(B&3)===0||O(S,B)||(g=!0,de(S,B));S=S.next}while(g);fr=!1}}function gt(){zf=Gf=!1;var c=0;sl!==0&&(il()&&(c=sl),sl=0);for(var u=ba(),g=null,S=nu;S!==null;){var C=S.next,B=j(S,u);B===0?(S.next=null,g===null?nu=C:g.next=C,C===null&&(Wl=g)):(g=S,(c!==0||(B&3)!==0)&&(zf=!0)),S=C}Lt(c)}function j(c,u){for(var g=c.suspendedLanes,S=c.pingedLanes,C=c.expirationTimes,B=c.pendingLanes&-62914561;0<B;){var J=31-as(B),se=1<<J,be=C[J];be===-1?((se&g)===0||(se&S)!==0)&&(C[J]=z(se,u)):be<=u&&(c.expiredLanes|=se),B&=~se}if(u=Rn,g=En,g=H(c,c===u?g:0),S=c.callbackNode,g===0||c===u&&li===2||c.cancelPendingCommit!==null)return S!==null&&S!==null&&Of(S),c.callbackNode=null,c.callbackPriority=0;if((g&3)===0||O(c,g)){if(u=g&-g,u===c.callbackPriority)return u;switch(S!==null&&Of(S),ge(g)){case 2:case 8:g=hy;break;case 32:g=Dd;break;case 268435456:g=Nd;break;default:g=Dd}return S=P.bind(null,c),g=Qc(g,S),c.callbackPriority=u,c.callbackNode=g,u}return S!==null&&S!==null&&Of(S),c.callbackPriority=2,c.callbackNode=null,2}function P(c,u){var g=c.callbackNode;if(la()&&c.callbackNode!==g)return null;var S=En;return S=H(c,c===Rn?S:0),S===0?null:(_f(c,S,u),j(c,ba()),c.callbackNode!=null&&c.callbackNode===g?P.bind(null,c):null)}function de(c,u){if(la())return null;_f(c,u,!0)}function Fe(c){Ki?xd(function(){($t&6)!==0?Qc(hg,c):c()}):Qc(hg,c)}function ke(){return sl===0&&(sl=V()),sl}function Ie(c,u){if(Vf===null){var g=Vf=[];Ld=0,rs=ke(),rl={status:"pending",value:void 0,then:function(S){g.push(S)}}}return Ld++,u.then(Ft,Ft),u}function Ft(){if(--Ld===0&&Vf!==null){rl!==null&&(rl.status="fulfilled");var c=Vf;Vf=null,rs=0,rl=null;for(var u=0;u<c.length;u++)(0,c[u])()}}function Mt(c,u){var g=[],S={status:"pending",value:null,reason:null,then:function(C){g.push(C)}};return c.then(function(){S.status="fulfilled",S.value=u;for(var C=0;C<g.length;C++)(0,g[C])(u)},function(C){for(S.status="rejected",S.reason=C,C=0;C<g.length;C++)(0,g[C])(void 0)}),S}function Ht(c){c.updateQueue={baseState:c.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function zt(c,u){c=c.updateQueue,u.updateQueue===c&&(u.updateQueue={baseState:c.baseState,firstBaseUpdate:c.firstBaseUpdate,lastBaseUpdate:c.lastBaseUpdate,shared:c.shared,callbacks:null})}function Ye(c){return{lane:c,tag:0,payload:null,callback:null,next:null}}function qe(c,u,g){var S=c.updateQueue;if(S===null)return null;if(S=S.shared,($t&2)!==0){var C=S.pending;return C===null?u.next=u:(u.next=C.next,C.next=u),S.pending=u,u=Dt(c),Q(c,null,g),u}return et(c,S,u,g),Dt(c)}function wt(c,u,g){if(u=u.updateQueue,u!==null&&(u=u.shared,(g&4194176)!==0)){var S=u.lanes;S&=c.pendingLanes,g|=S,u.lanes=g,ae(c,g)}}function bt(c,u){var g=c.updateQueue,S=c.alternate;if(S!==null&&(S=S.updateQueue,g===S)){var C=null,B=null;if(g=g.firstBaseUpdate,g!==null){do{var J={lane:g.lane,tag:g.tag,payload:g.payload,callback:null,next:null};B===null?C=B=J:B=B.next=J,g=g.next}while(g!==null);B===null?C=B=u:B=B.next=u}else C=B=u;g={baseState:S.baseState,firstBaseUpdate:C,lastBaseUpdate:B,shared:S.shared,callbacks:S.callbacks},c.updateQueue=g;return}c=g.lastBaseUpdate,c===null?g.firstBaseUpdate=u:c.next=u,g.lastBaseUpdate=u}function rt(){if(iu){var c=rl;if(c!==null)throw c}}function Vt(c,u,g,S){iu=!1;var C=c.updateQueue;vo=!1;var B=C.firstBaseUpdate,J=C.lastBaseUpdate,se=C.shared.pending;if(se!==null){C.shared.pending=null;var be=se,Ke=be.next;be.next=null,J===null?B=Ke:J.next=Ke,J=be;var St=c.alternate;St!==null&&(St=St.updateQueue,se=St.lastBaseUpdate,se!==J&&(se===null?St.firstBaseUpdate=Ke:se.next=Ke,St.lastBaseUpdate=be))}if(B!==null){var It=C.baseState;J=0,St=Ke=be=null,se=B;do{var Pt=se.lane&-536870913,gn=Pt!==se.lane;if(gn?(En&Pt)===Pt:(S&Pt)===Pt){Pt!==0&&Pt===rs&&(iu=!0),St!==null&&(St=St.next={lane:0,tag:se.tag,payload:se.payload,callback:null,next:null});e:{var us=c,Jf=se;Pt=u;var ic=g;switch(Jf.tag){case 1:if(us=Jf.payload,typeof us=="function"){It=us.call(ic,It,Pt);break e}It=us;break e;case 3:us.flags=us.flags&-65537|128;case 0:if(us=Jf.payload,Pt=typeof us=="function"?us.call(ic,It,Pt):us,Pt==null)break e;It=kl({},It,Pt);break e;case 2:vo=!0}}Pt=se.callback,Pt!==null&&(c.flags|=64,gn&&(c.flags|=8192),gn=C.callbacks,gn===null?C.callbacks=[Pt]:gn.push(Pt))}else gn={lane:Pt,tag:se.tag,payload:se.payload,callback:se.callback,next:null},St===null?(Ke=St=gn,be=It):St=St.next=gn,J|=Pt;if(se=se.next,se===null){if(se=C.shared.pending,se===null)break;gn=se,se=gn.next,gn.next=null,C.lastBaseUpdate=gn,C.shared.pending=null}}while(!0);St===null&&(be=It),C.baseState=be,C.firstBaseUpdate=Ke,C.lastBaseUpdate=St,B===null&&(C.shared.lanes=0),Us|=J,c.lanes=J,c.memoizedState=It}}function fe(c,u){if(typeof c!="function")throw Error(i(191,c));c.call(u)}function Ne(c,u){var g=c.callbacks;if(g!==null)for(c.callbacks=null,c=0;c<g.length;c++)fe(g[c],u)}function ot(c,u){if(Es(c,u))return!0;if(typeof c!="object"||c===null||typeof u!="object"||u===null)return!1;var g=Object.keys(c),S=Object.keys(u);if(g.length!==S.length)return!1;for(S=0;S<g.length;S++){var C=g[S];if(!kf.call(u,C)||!Es(c[C],u[C]))return!1}return!0}function Et(c){return c=c.status,c==="fulfilled"||c==="rejected"}function Qe(){}function We(c,u,g){switch(g=c[g],g===void 0?c.push(u):g!==u&&(u.then(Qe,Qe),u=g),u.status){case"fulfilled":return u.value;case"rejected":throw c=u.reason,c===ai?Error(i(483)):c;default:if(typeof u.status=="string")u.then(Qe,Qe);else{if(c=Rn,c!==null&&100<c.shellSuspendCounter)throw Error(i(482));c=u,c.status="pending",c.then(function(S){if(u.status==="pending"){var C=u;C.status="fulfilled",C.value=S}},function(S){if(u.status==="pending"){var C=u;C.status="rejected",C.reason=S}})}switch(u.status){case"fulfilled":return u.value;case"rejected":throw c=u.reason,c===ai?Error(i(483)):c}throw jl=u,ai}}function _t(){if(jl===null)throw Error(i(459));var c=jl;return jl=null,c}function nn(c){var u=Ys;return Ys+=1,Pr===null&&(Pr=[]),We(Pr,c,u)}function wn(c,u){u=u.props.ref,c.ref=u!==void 0?u:null}function Mn(c,u){throw u.$$typeof===Nm?Error(i(525)):(c=Object.prototype.toString.call(u),Error(i(31,c==="[object Object]"?"object with keys {"+Object.keys(u).join(", ")+"}":c)))}function Fi(c){var u=c._init;return u(c._payload)}function va(c){function u(Be,Ae){if(c){var Oe=Be.deletions;Oe===null?(Be.deletions=[Ae],Be.flags|=16):Oe.push(Ae)}}function g(Be,Ae){if(!c)return null;for(;Ae!==null;)u(Be,Ae),Ae=Ae.sibling;return null}function S(Be){for(var Ae=new Map;Be!==null;)Be.key!==null?Ae.set(Be.key,Be):Ae.set(Be.index,Be),Be=Be.sibling;return Ae}function C(Be,Ae){return Be=Oa(Be,Ae),Be.index=0,Be.sibling=null,Be}function B(Be,Ae,Oe){return Be.index=Oe,c?(Oe=Be.alternate,Oe!==null?(Oe=Oe.index,Oe<Ae?(Be.flags|=33554434,Ae):Oe):(Be.flags|=33554434,Ae)):(Be.flags|=1048576,Ae)}function J(Be){return c&&Be.alternate===null&&(Be.flags|=33554434),Be}function se(Be,Ae,Oe,pt){return Ae===null||Ae.tag!==6?(Ae=jo(Oe,Be.mode,pt),Ae.return=Be,Ae):(Ae=C(Ae,Oe),Ae.return=Be,Ae)}function be(Be,Ae,Oe,pt){var jt=Oe.type;return jt===Jc?St(Be,Ae,Oe.props.children,pt,Oe.key):Ae!==null&&(Ae.elementType===jt||typeof jt=="object"&&jt!==null&&jt.$$typeof===lr&&Fi(jt)===Ae.type)?(Ae=C(Ae,Oe.props),wn(Ae,Oe),Ae.return=Be,Ae):(Ae=zs(Oe.type,Oe.key,Oe.props,null,Be.mode,pt),wn(Ae,Oe),Ae.return=Be,Ae)}function Ke(Be,Ae,Oe,pt){return Ae===null||Ae.tag!==4||Ae.stateNode.containerInfo!==Oe.containerInfo||Ae.stateNode.implementation!==Oe.implementation?(Ae=Yc(Oe,Be.mode,pt),Ae.return=Be,Ae):(Ae=C(Ae,Oe.children||[]),Ae.return=Be,Ae)}function St(Be,Ae,Oe,pt,jt){return Ae===null||Ae.tag!==7?(Ae=uo(Oe,Be.mode,pt,jt),Ae.return=Be,Ae):(Ae=C(Ae,Oe),Ae.return=Be,Ae)}function It(Be,Ae,Oe){if(typeof Ae=="string"&&Ae!==""||typeof Ae=="number"||typeof Ae=="bigint")return Ae=jo(""+Ae,Be.mode,Oe),Ae.return=Be,Ae;if(typeof Ae=="object"&&Ae!==null){switch(Ae.$$typeof){case fo:return Oe=zs(Ae.type,Ae.key,Ae.props,null,Be.mode,Oe),wn(Oe,Ae),Oe.return=Be,Oe;case or:return Ae=Yc(Ae,Be.mode,Oe),Ae.return=Be,Ae;case lr:var pt=Ae._init;return Ae=pt(Ae._payload),It(Be,Ae,Oe)}if(el(Ae)||o(Ae))return Ae=uo(Ae,Be.mode,Oe,null),Ae.return=Be,Ae;if(typeof Ae.then=="function")return It(Be,nn(Ae),Oe);if(Ae.$$typeof===Ur)return It(Be,df(Be,Ae),Oe);Mn(Be,Ae)}return null}function Pt(Be,Ae,Oe,pt){var jt=Ae!==null?Ae.key:null;if(typeof Oe=="string"&&Oe!==""||typeof Oe=="number"||typeof Oe=="bigint")return jt!==null?null:se(Be,Ae,""+Oe,pt);if(typeof Oe=="object"&&Oe!==null){switch(Oe.$$typeof){case fo:return Oe.key===jt?be(Be,Ae,Oe,pt):null;case or:return Oe.key===jt?Ke(Be,Ae,Oe,pt):null;case lr:return jt=Oe._init,Oe=jt(Oe._payload),Pt(Be,Ae,Oe,pt)}if(el(Oe)||o(Oe))return jt!==null?null:St(Be,Ae,Oe,pt,null);if(typeof Oe.then=="function")return Pt(Be,Ae,nn(Oe),pt);if(Oe.$$typeof===Ur)return Pt(Be,Ae,df(Be,Oe),pt);Mn(Be,Oe)}return null}function gn(Be,Ae,Oe,pt,jt){if(typeof pt=="string"&&pt!==""||typeof pt=="number"||typeof pt=="bigint")return Be=Be.get(Oe)||null,se(Ae,Be,""+pt,jt);if(typeof pt=="object"&&pt!==null){switch(pt.$$typeof){case fo:return Be=Be.get(pt.key===null?Oe:pt.key)||null,be(Ae,Be,pt,jt);case or:return Be=Be.get(pt.key===null?Oe:pt.key)||null,Ke(Ae,Be,pt,jt);case lr:var fi=pt._init;return pt=fi(pt._payload),gn(Be,Ae,Oe,pt,jt)}if(el(pt)||o(pt))return Be=Be.get(Oe)||null,St(Ae,Be,pt,jt,null);if(typeof pt.then=="function")return gn(Be,Ae,Oe,nn(pt),jt);if(pt.$$typeof===Ur)return gn(Be,Ae,Oe,df(Ae,pt),jt);Mn(Ae,pt)}return null}function us(Be,Ae,Oe,pt){for(var jt=null,fi=null,hn=Ae,qn=Ae=0,ta=null;hn!==null&&qn<Oe.length;qn++){hn.index>qn?(ta=hn,hn=null):ta=hn.sibling;var Kn=Pt(Be,hn,Oe[qn],pt);if(Kn===null){hn===null&&(hn=ta);break}c&&hn&&Kn.alternate===null&&u(Be,hn),Ae=B(Kn,Ae,qn),fi===null?jt=Kn:fi.sibling=Kn,fi=Kn,hn=ta}if(qn===Oe.length)return g(Be,hn),Yn&&_e(Be,qn),jt;if(hn===null){for(;qn<Oe.length;qn++)hn=It(Be,Oe[qn],pt),hn!==null&&(Ae=B(hn,Ae,qn),fi===null?jt=hn:fi.sibling=hn,fi=hn);return Yn&&_e(Be,qn),jt}for(hn=S(hn);qn<Oe.length;qn++)ta=gn(hn,Be,qn,Oe[qn],pt),ta!==null&&(c&&ta.alternate!==null&&hn.delete(ta.key===null?qn:ta.key),Ae=B(ta,Ae,qn),fi===null?jt=ta:fi.sibling=ta,fi=ta);return c&&hn.forEach(function(bo){return u(Be,bo)}),Yn&&_e(Be,qn),jt}function Jf(Be,Ae,Oe,pt){if(Oe==null)throw Error(i(151));for(var jt=null,fi=null,hn=Ae,qn=Ae=0,ta=null,Kn=Oe.next();hn!==null&&!Kn.done;qn++,Kn=Oe.next()){hn.index>qn?(ta=hn,hn=null):ta=hn.sibling;var bo=Pt(Be,hn,Kn.value,pt);if(bo===null){hn===null&&(hn=ta);break}c&&hn&&bo.alternate===null&&u(Be,hn),Ae=B(bo,Ae,qn),fi===null?jt=bo:fi.sibling=bo,fi=bo,hn=ta}if(Kn.done)return g(Be,hn),Yn&&_e(Be,qn),jt;if(hn===null){for(;!Kn.done;qn++,Kn=Oe.next())Kn=It(Be,Kn.value,pt),Kn!==null&&(Ae=B(Kn,Ae,qn),fi===null?jt=Kn:fi.sibling=Kn,fi=Kn);return Yn&&_e(Be,qn),jt}for(hn=S(hn);!Kn.done;qn++,Kn=Oe.next())Kn=gn(hn,Be,qn,Kn.value,pt),Kn!==null&&(c&&Kn.alternate!==null&&hn.delete(Kn.key===null?qn:Kn.key),Ae=B(Kn,Ae,qn),fi===null?jt=Kn:fi.sibling=Kn,fi=Kn);return c&&hn.forEach(function(kd){return u(Be,kd)}),Yn&&_e(Be,qn),jt}function ic(Be,Ae,Oe,pt){if(typeof Oe=="object"&&Oe!==null&&Oe.type===Jc&&Oe.key===null&&(Oe=Oe.props.children),typeof Oe=="object"&&Oe!==null){switch(Oe.$$typeof){case fo:e:{for(var jt=Oe.key;Ae!==null;){if(Ae.key===jt){if(jt=Oe.type,jt===Jc){if(Ae.tag===7){g(Be,Ae.sibling),pt=C(Ae,Oe.props.children),pt.return=Be,Be=pt;break e}}else if(Ae.elementType===jt||typeof jt=="object"&&jt!==null&&jt.$$typeof===lr&&Fi(jt)===Ae.type){g(Be,Ae.sibling),pt=C(Ae,Oe.props),wn(pt,Oe),pt.return=Be,Be=pt;break e}g(Be,Ae);break}else u(Be,Ae);Ae=Ae.sibling}Oe.type===Jc?(pt=uo(Oe.props.children,Be.mode,pt,Oe.key),pt.return=Be,Be=pt):(pt=zs(Oe.type,Oe.key,Oe.props,null,Be.mode,pt),wn(pt,Oe),pt.return=Be,Be=pt)}return J(Be);case or:e:{for(jt=Oe.key;Ae!==null;){if(Ae.key===jt)if(Ae.tag===4&&Ae.stateNode.containerInfo===Oe.containerInfo&&Ae.stateNode.implementation===Oe.implementation){g(Be,Ae.sibling),pt=C(Ae,Oe.children||[]),pt.return=Be,Be=pt;break e}else{g(Be,Ae);break}else u(Be,Ae);Ae=Ae.sibling}pt=Yc(Oe,Be.mode,pt),pt.return=Be,Be=pt}return J(Be);case lr:return jt=Oe._init,Oe=jt(Oe._payload),ic(Be,Ae,Oe,pt)}if(el(Oe))return us(Be,Ae,Oe,pt);if(o(Oe)){if(jt=o(Oe),typeof jt!="function")throw Error(i(150));return Oe=jt.call(Oe),Jf(Be,Ae,Oe,pt)}if(typeof Oe.then=="function")return ic(Be,Ae,nn(Oe),pt);if(Oe.$$typeof===Ur)return ic(Be,Ae,df(Be,Oe),pt);Mn(Be,Oe)}return typeof Oe=="string"&&Oe!==""||typeof Oe=="number"||typeof Oe=="bigint"?(Oe=""+Oe,Ae!==null&&Ae.tag===6?(g(Be,Ae.sibling),pt=C(Ae,Oe),pt.return=Be,Be=pt):(g(Be,Ae),pt=jo(Oe,Be.mode,pt),pt.return=Be,Be=pt),J(Be)):g(Be,Ae)}return function(Be,Ae,Oe,pt){try{Ys=0;var jt=ic(Be,Ae,Oe,pt);return Pr=null,jt}catch(hn){if(hn===ai)throw hn;var fi=t(29,hn,null,Be.mode);return fi.lanes=pt,fi.return=Be,fi}}}function br(c,u){c=hr,w(Bs,c),w(Gr,u),hr=c|u.baseLanes}function ir(){w(Bs,hr),w(Gr,Gr.current)}function _a(){hr=Bs.current,M(Gr),M(Bs)}function sa(c){var u=c.alternate;w(Wi,Wi.current&1),w(Ds,c),Js===null&&(u===null||Gr.current!==null||u.memoizedState!==null)&&(Js=c)}function Da(c){if(c.tag===22){if(w(Wi,Wi.current),w(Ds,c),Js===null){var u=c.alternate;u!==null&&u.memoizedState!==null&&(Js=c)}}else wi()}function wi(){w(Wi,Wi.current),w(Ds,Ds.current)}function kt(c){M(Ds),Js===c&&(Js=null),M(Wi)}function Ai(c){for(var u=c;u!==null;){if(u.tag===13){var g=u.memoizedState;if(g!==null&&(g=g.dehydrated,g===null||Ed(g)||Df(g)))return u}else if(u.tag===19&&u.memoizedProps.revealOrder!==void 0){if((u.flags&128)!==0)return u}else if(u.child!==null){u.child.return=u,u=u.child;continue}if(u===c)break;for(;u.sibling===null;){if(u.return===null||u.return===c)return null;u=u.return}u.sibling.return=u.return,u=u.sibling}return null}function mn(){throw Error(i(321))}function G(c,u){if(u===null)return!1;for(var g=0;g<u.length&&g<c.length;g++)if(!Es(c[g],u[g]))return!1;return!0}function q(c,u,g,S,C,B){return zr=B,xn=u,u.memoizedState=null,u.updateQueue=null,u.lanes=0,ln.H=c===null||c.memoizedState===null?ji:Ha,_o=!1,B=g(S,C),_o=!1,_i&&(B=Te(u,g,S,C)),oe(c),B}function oe(c){ln.H=Jn;var u=Zn!==null&&Zn.next!==null;if(zr=0,Pi=Zn=xn=null,qs=!1,Ui=0,au=null,u)throw Error(i(300));c===null||Gi||(c=c.dependencies,c!==null&&Po(c)&&(Gi=!0))}function Te(c,u,g,S){xn=c;var C=0;do{if(_i&&(au=null),Ui=0,_i=!1,25<=C)throw Error(i(301));if(C+=1,Pi=Zn=null,c.updateQueue!=null){var B=c.updateQueue;B.lastEffect=null,B.events=null,B.stores=null,B.memoCache!=null&&(B.memoCache.index=0)}ln.H=ll,B=u(g,S)}while(_i);return B}function Le(){var c=ln.H,u=c.useState()[0];return u=typeof u.then=="function"?yt(u):u,c=c.useState()[0],(Zn!==null?Zn.memoizedState:null)!==c&&(xn.flags|=1024),u}function Ue(){var c=Xf!==0;return Xf=0,c}function ct(c,u,g){u.updateQueue=c.updateQueue,u.flags&=-2053,c.lanes&=~g}function at(c){if(qs){for(c=c.memoizedState;c!==null;){var u=c.queue;u!==null&&(u.pending=null),c=c.next}qs=!1}zr=0,Pi=Zn=xn=null,_i=!1,Ui=Xf=0,au=null}function st(){var c={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return Pi===null?xn.memoizedState=Pi=c:Pi=Pi.next=c,Pi}function tt(){if(Zn===null){var c=xn.alternate;c=c!==null?c.memoizedState:null}else c=Zn.next;var u=Pi===null?xn.memoizedState:Pi.next;if(u!==null)Pi=u,Zn=c;else{if(c===null)throw xn.alternate===null?Error(i(467)):Error(i(310));Zn=c,c={memoizedState:Zn.memoizedState,baseState:Zn.baseState,baseQueue:Zn.baseQueue,queue:Zn.queue,next:null},Pi===null?xn.memoizedState=Pi=c:Pi=Pi.next=c}return Pi}function yt(c){var u=Ui;return Ui+=1,au===null&&(au=[]),c=We(au,c,u),u=xn,(Pi===null?u.memoizedState:Pi.next)===null&&(u=u.alternate,ln.H=u===null||u.memoizedState===null?ji:Ha),c}function dt(c){if(c!==null&&typeof c=="object"){if(typeof c.then=="function")return yt(c);if(c.$$typeof===Ur)return xa(c)}throw Error(i(438,String(c)))}function k(c){var u=null,g=xn.updateQueue;if(g!==null&&(u=g.memoCache),u==null){var S=xn.alternate;S!==null&&(S=S.updateQueue,S!==null&&(S=S.memoCache,S!=null&&(u={data:S.data.map(function(C){return C.slice()}),index:0})))}if(u==null&&(u={data:[],index:0}),g===null&&(g=Id(),xn.updateQueue=g),g.memoCache=u,g=u.data[u.index],g===void 0)for(g=u.data[u.index]=Array(c),S=0;S<c;S++)g[S]=z_;return u.index++,g}function ie(c,u){return typeof u=="function"?u(c):u}function ue(c){var u=tt();return pe(u,Zn,c)}function pe(c,u,g){var S=c.queue;if(S===null)throw Error(i(311));S.lastRenderedReducer=g;var C=c.baseQueue,B=S.pending;if(B!==null){if(C!==null){var J=C.next;C.next=B.next,B.next=J}u.baseQueue=C=B,S.pending=null}if(B=c.baseState,C===null)c.memoizedState=B;else{u=C.next;var se=J=null,be=null,Ke=u,St=!1;do{var It=Ke.lane&-536870913;if(It!==Ke.lane?(En&It)===It:(zr&It)===It){var Pt=Ke.revertLane;if(Pt===0)be!==null&&(be=be.next={lane:0,revertLane:0,action:Ke.action,hasEagerState:Ke.hasEagerState,eagerState:Ke.eagerState,next:null}),It===rs&&(St=!0);else if((zr&Pt)===Pt){Ke=Ke.next,Pt===rs&&(St=!0);continue}else It={lane:0,revertLane:Ke.revertLane,action:Ke.action,hasEagerState:Ke.hasEagerState,eagerState:Ke.eagerState,next:null},be===null?(se=be=It,J=B):be=be.next=It,xn.lanes|=Pt,Us|=Pt;It=Ke.action,_o&&g(B,It),B=Ke.hasEagerState?Ke.eagerState:g(B,It)}else Pt={lane:It,revertLane:Ke.revertLane,action:Ke.action,hasEagerState:Ke.hasEagerState,eagerState:Ke.eagerState,next:null},be===null?(se=be=Pt,J=B):be=be.next=Pt,xn.lanes|=It,Us|=It;Ke=Ke.next}while(Ke!==null&&Ke!==u);if(be===null?J=B:be.next=se,!Es(B,c.memoizedState)&&(Gi=!0,St&&(g=rl,g!==null)))throw g;c.memoizedState=B,c.baseState=J,c.baseQueue=be,S.lastRenderedState=B}return C===null&&(S.lanes=0),[c.memoizedState,S.dispatch]}function ce(c){var u=tt(),g=u.queue;if(g===null)throw Error(i(311));g.lastRenderedReducer=c;var S=g.dispatch,C=g.pending,B=u.memoizedState;if(C!==null){g.pending=null;var J=C=C.next;do B=c(B,J.action),J=J.next;while(J!==C);Es(B,u.memoizedState)||(Gi=!0),u.memoizedState=B,u.baseQueue===null&&(u.baseState=B),g.lastRenderedState=B}return[B,S]}function it(c,u,g){var S=xn,C=tt(),B=Yn;if(B){if(g===void 0)throw Error(i(407));g=g()}else g=u();var J=!Es((Zn||C).memoizedState,g);if(J&&(C.memoizedState=g,Gi=!0),C=C.queue,_s(xe.bind(null,S,C,c),[c]),C.getSnapshot!==u||J||Pi!==null&&Pi.memoizedState.tag&1){if(S.flags|=2048,Pn(9,ht.bind(null,S,C,g,u),{destroy:void 0},null),Rn===null)throw Error(i(349));B||(zr&60)!==0||ut(S,u,g)}return g}function ut(c,u,g){c.flags|=16384,c={getSnapshot:u,value:g},u=xn.updateQueue,u===null?(u=Id(),xn.updateQueue=u,u.stores=[c]):(g=u.stores,g===null?u.stores=[c]:g.push(c))}function ht(c,u,g,S){u.value=g,u.getSnapshot=S,we(u)&&je(c)}function xe(c,u,g){return g(function(){we(u)&&je(c)})}function we(c){var u=c.getSnapshot;c=c.value;try{var g=u();return!Es(c,g)}catch{return!0}}function je(c){var u=xt(c,2);u!==null&&La(u,c,2)}function He(c){var u=st();if(typeof c=="function"){var g=c;if(c=g(),_o){W(!0);try{g()}finally{W(!1)}}}return u.memoizedState=u.baseState=c,u.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:ie,lastRenderedState:c},u}function Ve(c,u,g,S){return c.baseState=g,pe(c,Zn,typeof S=="function"?S:ie)}function At(c,u,g,S,C){if(Ul(c))throw Error(i(485));if(c=u.action,c!==null){var B={payload:C,action:c,next:null,isTransition:!0,status:"pending",value:null,reason:null,listeners:[],then:function(J){B.listeners.push(J)}};ln.T!==null?g(!0):B.isTransition=!1,S(B),g=u.pending,g===null?(B.next=u.pending=B,Yt(u,B)):(B.next=g.next,u.pending=g.next=B)}}function Yt(c,u){var g=u.action,S=u.payload,C=c.state;if(u.isTransition){var B=ln.T,J={};ln.T=J;try{var se=g(C,S),be=ln.S;be!==null&&be(J,se),Jt(c,u,se)}catch(Ke){ft(c,u,Ke)}finally{ln.T=B}}else try{B=g(C,S),Jt(c,u,B)}catch(Ke){ft(c,u,Ke)}}function Jt(c,u,g){g!==null&&typeof g=="object"&&typeof g.then=="function"?g.then(function(S){Tt(c,u,S)},function(S){return ft(c,u,S)}):Tt(c,u,g)}function Tt(c,u,g){u.status="fulfilled",u.value=g,Nt(u),c.state=g,u=c.pending,u!==null&&(g=u.next,g===u?c.pending=null:(g=g.next,u.next=g,Yt(c,g)))}function ft(c,u,g){var S=c.pending;if(c.pending=null,S!==null){S=S.next;do u.status="rejected",u.reason=g,Nt(u),u=u.next;while(u!==S)}c.action=null}function Nt(c){c=c.listeners;for(var u=0;u<c.length;u++)(0,c[u])()}function vt(c,u){return u}function un(c,u){if(Yn){var g=Rn.formState;if(g!==null){e:{var S=xn;if(Yn){if(Ea){var C=K_(Ea,Xs);if(C){Ea=eg(C),S=W_(C);break e}}lt(S)}S=!1}S&&(u=g[0])}}g=st(),g.memoizedState=g.baseState=u,S={pending:null,lanes:0,dispatch:null,lastRenderedReducer:vt,lastRenderedState:u},g.queue=S,g=qh.bind(null,xn,S),S.dispatch=g,S=He(!1);var B=Kh.bind(null,xn,!1,S.queue);return S=st(),C={state:u,dispatch:null,action:c,pending:null},S.queue=C,g=At.bind(null,xn,C,B,g),C.dispatch=g,S.memoizedState=c,[u,g,!1]}function Wn(c){var u=tt();return an(u,Zn,c)}function an(c,u,g){u=pe(c,u,vt)[0],c=ue(ie)[0],u=typeof u=="object"&&u!==null&&typeof u.then=="function"?yt(u):u;var S=tt(),C=S.queue,B=C.dispatch;return g!==S.memoizedState&&(xn.flags|=2048,Pn(9,Xn.bind(null,C,g),{destroy:void 0},null)),[u,B,c]}function Xn(c,u){c.action=u}function rn(c){var u=tt(),g=Zn;if(g!==null)return an(u,g,c);tt(),u=u.memoizedState,g=tt();var S=g.queue.dispatch;return g.memoizedState=c,[u,S,!1]}function Pn(c,u,g,S){return c={tag:c,create:u,inst:g,deps:S,next:null},u=xn.updateQueue,u===null&&(u=Id(),xn.updateQueue=u),g=u.lastEffect,g===null?u.lastEffect=c.next=c:(S=g.next,g.next=c,c.next=S,u.lastEffect=c),c}function jn(){return tt().memoizedState}function ri(c,u,g,S){var C=st();xn.flags|=c,C.memoizedState=Pn(1|u,g,{destroy:void 0},S===void 0?null:S)}function Si(c,u,g,S){var C=tt();S=S===void 0?null:S;var B=C.memoizedState.inst;Zn!==null&&S!==null&&G(S,Zn.memoizedState.deps)?C.memoizedState=Pn(u,g,B,S):(xn.flags|=c,C.memoizedState=Pn(1|u,g,B,S))}function Er(c,u){ri(8390656,8,c,u)}function _s(c,u){Si(2048,8,c,u)}function g_(c,u){return Si(4,2,c,u)}function v_(c,u){return Si(4,4,c,u)}function af(c,u){if(typeof u=="function"){c=c();var g=u(c);return function(){typeof g=="function"?g():u(null)}}if(u!=null)return c=c(),u.current=c,function(){u.current=null}}function Tr(c,u,g){g=g!=null?g.concat([c]):null,Si(4,4,af.bind(null,u,c),g)}function sf(){}function Xh(c,u){var g=tt();u=u===void 0?null:u;var S=g.memoizedState;return u!==null&&G(u,S[1])?S[0]:(g.memoizedState=[c,u],c)}function Dl(c,u){var g=tt();u=u===void 0?null:u;var S=g.memoizedState;if(u!==null&&G(u,S[1]))return S[0];if(S=c(),_o){W(!0);try{c()}finally{W(!1)}}return g.memoizedState=[S,u],S}function Lo(c,u,g){return g===void 0||(zr&1073741824)!==0?c.memoizedState=u:(c.memoizedState=g,c=wr(),xn.lanes|=c,Us|=c,g)}function am(c,u,g,S){return Es(g,u)?g:Gr.current!==null?(c=Lo(c,g,S),Es(c,u)||(Gi=!0),c):(zr&42)===0?(Gi=!0,c.memoizedState=g):(c=wr(),xn.lanes|=c,Us|=c,u)}function Yh(c,u,g,S,C){var B=$i();Ia(B!==0&&8>B?B:8);var J=ln.T,se={};ln.T=se,Kh(c,!1,u,g);try{var be=C(),Ke=ln.S;if(Ke!==null&&Ke(se,be),be!==null&&typeof be=="object"&&typeof be.then=="function"){var St=Mt(be,S);Io(c,u,St,Xa(c))}else Io(c,u,S,Xa(c))}catch(It){Io(c,u,{then:function(){},status:"rejected",reason:It},Xa())}finally{Ia(B),ln.T=J}}function sm(c){var u=c.memoizedState;if(u!==null)return u;u={memoizedState:is,baseState:is,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:ie,lastRenderedState:is},next:null};var g={};return u.next={memoizedState:g,baseState:g,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:ie,lastRenderedState:g},next:null},c.memoizedState=u,c=c.alternate,c!==null&&(c.memoizedState=u),u}function Nl(){return xa(fn)}function Cr(){return tt().memoizedState}function Jh(){return tt().memoizedState}function rf(c){for(var u=c.return;u!==null;){switch(u.tag){case 24:case 3:var g=Xa();c=Ye(g);var S=qe(u,c,g);S!==null&&(La(S,u,g),wt(S,u,g)),u={cache:$h()},c.payload=u;return}u=u.return}}function Oo(c,u,g){var S=Xa();g={lane:S,revertLane:0,action:g,hasEagerState:!1,eagerState:null,next:null},Ul(c)?of(u,g):(g=Je(c,u,g,S),g!==null&&(La(g,c,S),rm(g,u,S)))}function qh(c,u,g){var S=Xa();Io(c,u,g,S)}function Io(c,u,g,S){var C={lane:S,revertLane:0,action:g,hasEagerState:!1,eagerState:null,next:null};if(Ul(c))of(u,C);else{var B=c.alternate;if(c.lanes===0&&(B===null||B.lanes===0)&&(B=u.lastRenderedReducer,B!==null))try{var J=u.lastRenderedState,se=B(J,g);if(C.hasEagerState=!0,C.eagerState=se,Es(se,J))return et(c,u,C,0),Rn===null&&Ge(),!1}catch{}if(g=Je(c,u,C,S),g!==null)return La(g,c,S),rm(g,u,S),!0}return!1}function Kh(c,u,g,S){if(S={lane:2,revertLane:ke(),action:S,hasEagerState:!1,eagerState:null,next:null},Ul(c)){if(u)throw Error(i(479))}else u=Je(c,g,S,2),u!==null&&La(u,c,2)}function Ul(c){var u=c.alternate;return c===xn||u!==null&&u===xn}function of(c,u){_i=qs=!0;var g=c.pending;g===null?u.next=u:(u.next=g.next,g.next=u),c.pending=u}function rm(c,u,g){if((g&4194176)!==0){var S=u.lanes;S&=c.pendingLanes,g|=S,u.lanes=g,ae(c,g)}}function Na(c,u,g,S){u=c.memoizedState,g=g(S,u),g=g==null?u:kl({},u,g),c.memoizedState=g,c.lanes===0&&(c.updateQueue.baseState=g)}function Fo(c,u,g,S,C,B,J){return c=c.stateNode,typeof c.shouldComponentUpdate=="function"?c.shouldComponentUpdate(S,B,J):u.prototype&&u.prototype.isPureReactComponent?!ot(g,S)||!ot(C,B):!0}function lf(c,u,g,S){c=u.state,typeof u.componentWillReceiveProps=="function"&&u.componentWillReceiveProps(g,S),typeof u.UNSAFE_componentWillReceiveProps=="function"&&u.UNSAFE_componentWillReceiveProps(g,S),u.state!==c&&Fd.enqueueReplaceState(u,u.state,null)}function ar(c,u){var g=u;if("ref"in u){g={};for(var S in u)S!=="ref"&&(g[S]=u[S])}if(c=c.defaultProps){g===u&&(g=kl({},g));for(var C in c)g[C]===void 0&&(g[C]=c[C])}return g}function Wh(c,u){try{var g=c.onUncaughtError;g(u.value,{componentStack:u.stack})}catch(S){setTimeout(function(){throw S})}}function jh(c,u,g){try{var S=c.onCaughtError;S(g.value,{componentStack:g.stack,errorBoundary:u.tag===1?u.stateNode:null})}catch(C){setTimeout(function(){throw C})}}function cf(c,u,g){return g=Ye(g),g.tag=3,g.payload={element:null},g.callback=function(){Wh(c,u)},g}function Dc(c){return c=Ye(c),c.tag=3,c}function uf(c,u,g,S){var C=g.type.getDerivedStateFromError;if(typeof C=="function"){var B=S.value;c.payload=function(){return C(B)},c.callback=function(){jh(u,g,S)}}var J=g.stateNode;J!==null&&typeof J.componentDidCatch=="function"&&(c.callback=function(){jh(u,g,S),typeof C!="function"&&(Os===null?Os=new Set([this]):Os.add(this));var se=S.stack;this.componentDidCatch(S.value,{componentStack:se!==null?se:""})})}function __(c,u,g,S,C){if(g.flags|=32768,S!==null&&typeof S=="object"&&typeof S.then=="function"){if(u=g.alternate,u!==null&&Ll(u,g,C,!0),g=Ds.current,g!==null){switch(g.tag){case 13:return Js===null?ns():g.alternate===null&&zn===0&&(zn=3),g.flags&=-257,g.flags|=65536,g.lanes=C,S===Od?g.flags|=16384:(u=g.updateQueue,u===null?g.updateQueue=new Set([S]):u.add(S),dd(c,S,C)),!1;case 22:return g.flags|=65536,S===Od?g.flags|=16384:(u=g.updateQueue,u===null?(u={transitions:null,markerInstances:null,retryQueue:new Set([S])},g.updateQueue=u):(g=u.retryQueue,g===null?u.retryQueue=new Set([S]):g.add(S)),dd(c,S,C)),!1}throw Error(i(435,g.tag))}return dd(c,S,C),ns(),!1}if(Yn)return u=Ds.current,u!==null?((u.flags&65536)===0&&(u.flags|=256),u.flags|=65536,u.lanes=C,S!==Pf&&(c=Error(i(422),{cause:S}),Wt(ye(c,g)))):(S!==Pf&&(u=Error(i(423),{cause:S}),Wt(ye(u,g))),c=c.current.alternate,c.flags|=65536,C&=-C,c.lanes|=C,S=ye(S,g),C=cf(c.stateNode,S,C),bt(c,C),zn!==4&&(zn=2)),!1;var B=Error(i(520),{cause:S});if(B=ye(B,g),ru===null?ru=[B]:ru.push(B),zn!==4&&(zn=2),u===null)return!0;S=ye(S,g),g=u;do{switch(g.tag){case 3:return g.flags|=65536,c=C&-C,g.lanes|=c,c=cf(g.stateNode,S,c),bt(g,c),!1;case 1:if(u=g.type,B=g.stateNode,(g.flags&128)===0&&(typeof u.getDerivedStateFromError=="function"||B!==null&&typeof B.componentDidCatch=="function"&&(Os===null||!Os.has(B))))return g.flags|=65536,C&=-C,g.lanes|=C,C=Dc(C),uf(C,c,g,S),bt(g,C),!1}g=g.return}while(g!==null);return!1}function ya(c,u,g,S){u.child=c===null?mg(u,null,g,S):ol(u,c.child,g,S)}function y_(c,u,g,S,C){g=g.render;var B=u.ref;if("ref"in S){var J={};for(var se in S)se!=="ref"&&(J[se]=S[se])}else J=S;return Ol(u),S=q(c,u,g,J,B,C),se=Ue(),c!==null&&!Gi?(ct(c,u,C),no(c,u,C)):(Yn&&se&&te(u),u.flags|=1,ya(c,u,S,C),u.child)}function x_(c,u,g,S,C){if(c===null){var B=g.type;return typeof B=="function"&&!lo(B)&&B.defaultProps===void 0&&g.compare===null?(u.tag=15,u.type=B,Zh(c,u,B,S,C)):(c=zs(g.type,null,S,u,u.mode,C),c.ref=u.ref,c.return=u,u.child=c)}if(B=c.child,!dm(c,C)){var J=B.memoizedProps;if(g=g.compare,g=g!==null?g:ot,g(J,S)&&c.ref===u.ref)return no(c,u,C)}return u.flags|=1,c=Oa(B,S),c.ref=u.ref,c.return=u,u.child=c}function Zh(c,u,g,S,C){if(c!==null){var B=c.memoizedProps;if(ot(B,S)&&c.ref===u.ref)if(Gi=!1,u.pendingProps=S=B,dm(c,C))(c.flags&131072)!==0&&(Gi=!0);else return u.lanes=c.lanes,no(c,u,C)}return om(c,u,g,S,C)}function A_(c,u,g){var S=u.pendingProps,C=S.children,B=(u.stateNode._pendingVisibility&2)!==0,J=c!==null?c.memoizedState:null;if(ff(c,u),S.mode==="hidden"||B){if((u.flags&128)!==0){if(S=J!==null?J.baseLanes|g:g,c!==null){for(C=u.child=c.child,B=0;C!==null;)B=B|C.lanes|C.childLanes,C=C.sibling;u.childLanes=B&~S}else u.childLanes=0,u.child=null;return S_(c,u,S,g)}if((g&536870912)!==0)u.memoizedState={baseLanes:0,cachePool:null},c!==null&&ed(u,J!==null?J.cachePool:null),J!==null?br(u,J):ir(),Da(u);else return u.lanes=u.childLanes=536870912,S_(c,u,J!==null?J.baseLanes|g:g,g)}else J!==null?(ed(u,J.cachePool),br(u,J),wi(),u.memoizedState=null):(c!==null&&ed(u,null),ir(),wi());return ya(c,u,C,g),u.child}function S_(c,u,g,S){var C=Go();return C=C===null?null:{parent:Or?$n._currentValue:$n._currentValue2,pool:C},u.memoizedState={baseLanes:g,cachePool:C},c!==null&&ed(u,null),ir(),Da(u),c!==null&&Ll(c,u,S,!0),null}function ff(c,u){var g=u.ref;if(g===null)c!==null&&c.ref!==null&&(u.flags|=2097664);else{if(typeof g!="function"&&typeof g!="object")throw Error(i(284));(c===null||c.ref!==g)&&(u.flags|=2097664)}}function om(c,u,g,S,C){return Ol(u),g=q(c,u,g,S,void 0,C),S=Ue(),c!==null&&!Gi?(ct(c,u,C),no(c,u,C)):(Yn&&S&&te(u),u.flags|=1,ya(c,u,g,C),u.child)}function M_(c,u,g,S,C,B){return Ol(u),u.updateQueue=null,g=Te(u,S,g,C),oe(c),S=Ue(),c!==null&&!Gi?(ct(c,u,B),no(c,u,B)):(Yn&&S&&te(u),u.flags|=1,ya(c,u,g,B),u.child)}function lm(c,u,g,S,C){if(Ol(u),u.stateNode===null){var B=Kl,J=g.contextType;typeof J=="object"&&J!==null&&(B=xa(J)),B=new g(S,B),u.memoizedState=B.state!==null&&B.state!==void 0?B.state:null,B.updater=Fd,u.stateNode=B,B._reactInternals=u,B=u.stateNode,B.props=S,B.state=u.memoizedState,B.refs={},Ht(u),J=g.contextType,B.context=typeof J=="object"&&J!==null?xa(J):Kl,B.state=u.memoizedState,J=g.getDerivedStateFromProps,typeof J=="function"&&(Na(u,g,J,S),B.state=u.memoizedState),typeof g.getDerivedStateFromProps=="function"||typeof B.getSnapshotBeforeUpdate=="function"||typeof B.UNSAFE_componentWillMount!="function"&&typeof B.componentWillMount!="function"||(J=B.state,typeof B.componentWillMount=="function"&&B.componentWillMount(),typeof B.UNSAFE_componentWillMount=="function"&&B.UNSAFE_componentWillMount(),J!==B.state&&Fd.enqueueReplaceState(B,B.state,null),Vt(u,S,B,C),rt(),B.state=u.memoizedState),typeof B.componentDidMount=="function"&&(u.flags|=4194308),S=!0}else if(c===null){B=u.stateNode;var se=u.memoizedProps,be=ar(g,se);B.props=be;var Ke=B.context,St=g.contextType;J=Kl,typeof St=="object"&&St!==null&&(J=xa(St));var It=g.getDerivedStateFromProps;St=typeof It=="function"||typeof B.getSnapshotBeforeUpdate=="function",se=u.pendingProps!==se,St||typeof B.UNSAFE_componentWillReceiveProps!="function"&&typeof B.componentWillReceiveProps!="function"||(se||Ke!==J)&&lf(u,B,S,J),vo=!1;var Pt=u.memoizedState;B.state=Pt,Vt(u,S,B,C),rt(),Ke=u.memoizedState,se||Pt!==Ke||vo?(typeof It=="function"&&(Na(u,g,It,S),Ke=u.memoizedState),(be=vo||Fo(u,g,be,S,Pt,Ke,J))?(St||typeof B.UNSAFE_componentWillMount!="function"&&typeof B.componentWillMount!="function"||(typeof B.componentWillMount=="function"&&B.componentWillMount(),typeof B.UNSAFE_componentWillMount=="function"&&B.UNSAFE_componentWillMount()),typeof B.componentDidMount=="function"&&(u.flags|=4194308)):(typeof B.componentDidMount=="function"&&(u.flags|=4194308),u.memoizedProps=S,u.memoizedState=Ke),B.props=S,B.state=Ke,B.context=J,S=be):(typeof B.componentDidMount=="function"&&(u.flags|=4194308),S=!1)}else{B=u.stateNode,zt(c,u),J=u.memoizedProps,St=ar(g,J),B.props=St,It=u.pendingProps,Pt=B.context,Ke=g.contextType,be=Kl,typeof Ke=="object"&&Ke!==null&&(be=xa(Ke)),se=g.getDerivedStateFromProps,(Ke=typeof se=="function"||typeof B.getSnapshotBeforeUpdate=="function")||typeof B.UNSAFE_componentWillReceiveProps!="function"&&typeof B.componentWillReceiveProps!="function"||(J!==It||Pt!==be)&&lf(u,B,S,be),vo=!1,Pt=u.memoizedState,B.state=Pt,Vt(u,S,B,C),rt();var gn=u.memoizedState;J!==It||Pt!==gn||vo||c!==null&&c.dependencies!==null&&Po(c.dependencies)?(typeof se=="function"&&(Na(u,g,se,S),gn=u.memoizedState),(St=vo||Fo(u,g,St,S,Pt,gn,be)||c!==null&&c.dependencies!==null&&Po(c.dependencies))?(Ke||typeof B.UNSAFE_componentWillUpdate!="function"&&typeof B.componentWillUpdate!="function"||(typeof B.componentWillUpdate=="function"&&B.componentWillUpdate(S,gn,be),typeof B.UNSAFE_componentWillUpdate=="function"&&B.UNSAFE_componentWillUpdate(S,gn,be)),typeof B.componentDidUpdate=="function"&&(u.flags|=4),typeof B.getSnapshotBeforeUpdate=="function"&&(u.flags|=1024)):(typeof B.componentDidUpdate!="function"||J===c.memoizedProps&&Pt===c.memoizedState||(u.flags|=4),typeof B.getSnapshotBeforeUpdate!="function"||J===c.memoizedProps&&Pt===c.memoizedState||(u.flags|=1024),u.memoizedProps=S,u.memoizedState=gn),B.props=S,B.state=gn,B.context=be,S=St):(typeof B.componentDidUpdate!="function"||J===c.memoizedProps&&Pt===c.memoizedState||(u.flags|=4),typeof B.getSnapshotBeforeUpdate!="function"||J===c.memoizedProps&&Pt===c.memoizedState||(u.flags|=1024),S=!1)}return B=S,ff(c,u),S=(u.flags&128)!==0,B||S?(B=u.stateNode,g=S&&typeof g.getDerivedStateFromError!="function"?null:B.render(),u.flags|=1,c!==null&&S?(u.child=ol(u,c.child,null,C),u.child=ol(u,null,g,C)):ya(c,u,g,C),u.memoizedState=B.state,c=u.child):c=no(c,u,C),c}function b_(c,u,g,S){return on(),u.flags|=256,ya(c,u,g,S),u.child}function cm(c){return{baseLanes:c,cachePool:w_()}}function um(c,u,g){return c=c!==null?c.childLanes&~g:0,u&&(c|=cs),c}function E_(c,u,g){var S=u.pendingProps,C=!1,B=(u.flags&128)!==0,J;if((J=B)||(J=c!==null&&c.memoizedState===null?!1:(Wi.current&2)!==0),J&&(C=!0,u.flags&=-129),J=(u.flags&32)!==0,u.flags&=-33,c===null){if(Yn){if(C?sa(u):wi(),Yn){var se=Ea,be;(be=se)&&(se=ey(se,Xs),se!==null?(u.memoizedState={dehydrated:se,treeContext:cr!==null?{id:Hr,overflow:ks}:null,retryLane:536870912},be=t(18,null,null,0),be.stateNode=se,be.return=u,u.child=be,Fa=u,Ea=null,be=!0):be=!1),be||lt(u)}if(se=u.memoizedState,se!==null&&(se=se.dehydrated,se!==null))return Df(se)?u.lanes=16:u.lanes=536870912,null;kt(u)}return se=S.children,S=S.fallback,C?(wi(),C=u.mode,se=fm({mode:"hidden",children:se},C),S=uo(S,C,g,null),se.return=u,S.return=u,se.sibling=S,u.child=se,C=u.child,C.memoizedState=cm(g),C.childLanes=um(c,J,g),u.memoizedState=Pa,S):(sa(u),hf(u,se))}if(be=c.memoizedState,be!==null&&(se=be.dehydrated,se!==null)){if(B)u.flags&256?(sa(u),u.flags&=-257,u=hm(c,u,g)):u.memoizedState!==null?(wi(),u.child=c.child,u.flags|=128,u=null):(wi(),C=S.fallback,se=u.mode,S=fm({mode:"visible",children:S.children},se),C=uo(C,se,g,null),C.flags|=2,S.return=u,C.return=u,S.sibling=C,u.child=S,ol(u,c.child,null,g),S=u.child,S.memoizedState=cm(g),S.childLanes=um(c,J,g),u.memoizedState=Pa,u=C);else if(sa(u),Df(se))J=q_(se).digest,S=Error(i(419)),S.stack="",S.digest=J,Wt({value:S,source:null,stack:null}),u=hm(c,u,g);else if(Gi||Ll(c,u,g,!1),J=(g&c.childLanes)!==0,Gi||J){if(J=Rn,J!==null){if(S=g&-g,(S&42)!==0)S=1;else switch(S){case 2:S=1;break;case 8:S=4;break;case 32:S=16;break;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:S=64;break;case 268435456:S=134217728;break;default:S=0}if(S=(S&(J.suspendedLanes|g))!==0?0:S,S!==0&&S!==be.retryLane)throw be.retryLane=S,xt(c,S),La(J,c,S),my}Ed(se)||ns(),u=hm(c,u,g)}else Ed(se)?(u.flags|=128,u.child=c.child,u=zl.bind(null,c),XS(se,u),u=null):(c=be.treeContext,Ya&&(Ea=Z_(se),Fa=u,Yn=!0,Rs=null,Xs=!1,c!==null&&(Ts[Cs++]=Hr,Ts[Cs++]=ks,Ts[Cs++]=cr,Hr=c.id,ks=c.overflow,cr=u)),u=hf(u,S.children),u.flags|=4096);return u}return C?(wi(),C=S.fallback,se=u.mode,be=c.child,B=be.sibling,S=Oa(be,{mode:"hidden",children:S.children}),S.subtreeFlags=be.subtreeFlags&31457280,B!==null?C=Oa(B,C):(C=uo(C,se,g,null),C.flags|=2),C.return=u,S.return=u,S.sibling=C,u.child=S,S=C,C=u.child,se=c.child.memoizedState,se===null?se=cm(g):(be=se.cachePool,be!==null?(B=Or?$n._currentValue:$n._currentValue2,be=be.parent!==B?{parent:B,pool:B}:be):be=w_(),se={baseLanes:se.baseLanes|g,cachePool:be}),C.memoizedState=se,C.childLanes=um(c,J,g),u.memoizedState=Pa,S):(sa(u),g=c.child,c=g.sibling,g=Oa(g,{mode:"visible",children:S.children}),g.return=u,g.sibling=null,c!==null&&(J=u.deletions,J===null?(u.deletions=[c],u.flags|=16):J.push(c)),u.child=g,u.memoizedState=null,g)}function hf(c,u){return u=fm({mode:"visible",children:u},c.mode),u.return=c,c.child=u}function fm(c,u){return pd(c,u,0,null)}function hm(c,u,g){return ol(u,c.child,null,g),c=hf(u,u.pendingProps.children),c.flags|=2,u.memoizedState=null,c}function T_(c,u,g){c.lanes|=u;var S=c.alternate;S!==null&&(S.lanes|=u),pm(c.return,u,g)}function Qh(c,u,g,S,C){var B=c.memoizedState;B===null?c.memoizedState={isBackwards:u,rendering:null,renderingStartTime:0,last:S,tail:g,tailMode:C}:(B.isBackwards=u,B.rendering=null,B.renderingStartTime=0,B.last=S,B.tail=g,B.tailMode=C)}function C_(c,u,g){var S=u.pendingProps,C=S.revealOrder,B=S.tail;if(ya(c,u,S.children,g),S=Wi.current,(S&2)!==0)S=S&1|2,u.flags|=128;else{if(c!==null&&(c.flags&128)!==0)e:for(c=u.child;c!==null;){if(c.tag===13)c.memoizedState!==null&&T_(c,g,u);else if(c.tag===19)T_(c,g,u);else if(c.child!==null){c.child.return=c,c=c.child;continue}if(c===u)break e;for(;c.sibling===null;){if(c.return===null||c.return===u)break e;c=c.return}c.sibling.return=c.return,c=c.sibling}S&=1}switch(w(Wi,S),C){case"forwards":for(g=u.child,C=null;g!==null;)c=g.alternate,c!==null&&Ai(c)===null&&(C=g),g=g.sibling;g=C,g===null?(C=u.child,u.child=null):(C=g.sibling,g.sibling=null),Qh(u,!1,C,g,B);break;case"backwards":for(g=null,C=u.child,u.child=null;C!==null;){if(c=C.alternate,c!==null&&Ai(c)===null){u.child=C;break}c=C.sibling,C.sibling=g,g=C,C=c}Qh(u,!0,g,null,B);break;case"together":Qh(u,!1,null,null,void 0);break;default:u.memoizedState=null}return u.child}function no(c,u,g){if(c!==null&&(u.dependencies=c.dependencies),Us|=u.lanes,(g&u.childLanes)===0)if(c!==null){if(Ll(c,u,g,!1),(g&u.childLanes)===0)return null}else return null;if(c!==null&&u.child!==c.child)throw Error(i(153));if(u.child!==null){for(c=u.child,g=Oa(c,c.pendingProps),u.child=g,g.return=u;c.sibling!==null;)c=c.sibling,g=g.sibling=Oa(c,c.pendingProps),g.return=u;g.sibling=null}return u.child}function dm(c,u){return(c.lanes&u)!==0?!0:(c=c.dependencies,!!(c!==null&&Po(c)))}function zS(c,u,g){switch(u.tag){case 3:ve(u,u.stateNode.containerInfo),Ho(u,$n,c.memoizedState.cache),on();break;case 27:case 5:he(u);break;case 4:ve(u,u.stateNode.containerInfo);break;case 10:Ho(u,u.type,u.memoizedProps.value);break;case 13:var S=u.memoizedState;if(S!==null)return S.dehydrated!==null?(sa(u),u.flags|=128,null):(g&u.child.childLanes)!==0?E_(c,u,g):(sa(u),c=no(c,u,g),c!==null?c.sibling:null);sa(u);break;case 19:var C=(c.flags&128)!==0;if(S=(g&u.childLanes)!==0,S||(Ll(c,u,g,!1),S=(g&u.childLanes)!==0),C){if(S)return C_(c,u,g);u.flags|=128}if(C=u.memoizedState,C!==null&&(C.rendering=null,C.tail=null,C.lastEffect=null),w(Wi,Wi.current),S)break;return null;case 22:case 23:return u.lanes=0,A_(c,u,g);case 24:Ho(u,$n,c.memoizedState.cache)}return no(c,u,g)}function R_(c,u,g){if(c!==null)if(c.memoizedProps!==u.pendingProps)Gi=!0;else{if(!dm(c,g)&&(u.flags&128)===0)return Gi=!1,zS(c,u,g);Gi=(c.flags&131072)!==0}else Gi=!1,Yn&&(u.flags&1048576)!==0&&X(u,Ff,u.index);switch(u.lanes=0,u.tag){case 16:e:{c=u.pendingProps;var S=u.elementType,C=S._init;if(S=C(S._payload),u.type=S,typeof S=="function")lo(S)?(c=ar(S,c),u.tag=1,u=lm(null,u,S,c,g)):(u.tag=0,u=om(null,u,S,c,g));else{if(S!=null){if(C=S.$$typeof,C===qc){u.tag=11,u=y_(null,u,S,c,g);break e}else if(C===Mf){u.tag=14,u=x_(null,u,S,c,g);break e}}throw u=l(S)||S,Error(i(306,u,""))}}return u;case 0:return om(c,u,u.type,u.pendingProps,g);case 1:return S=u.type,C=ar(S,u.pendingProps),lm(c,u,S,C,g);case 3:e:{if(ve(u,u.stateNode.containerInfo),c===null)throw Error(i(387));var B=u.pendingProps;C=u.memoizedState,S=C.element,zt(c,u),Vt(u,B,null,g);var J=u.memoizedState;if(B=J.cache,Ho(u,$n,B),B!==C.cache&&mm(u,[$n],g,!0),rt(),B=J.element,Ya&&C.isDehydrated)if(C={element:B,isDehydrated:!1,cache:J.cache},u.updateQueue.baseState=C,u.memoizedState=C,u.flags&256){u=b_(c,u,B,g);break e}else if(B!==S){S=ye(Error(i(424)),u),Wt(S),u=b_(c,u,B,g);break e}else for(Ya&&(Ea=j_(u.stateNode.containerInfo),Fa=u,Yn=!0,Rs=null,Xs=!0),g=mg(u,null,B,g),u.child=g;g;)g.flags=g.flags&-3|4096,g=g.sibling;else{if(on(),B===S){u=no(c,u,g);break e}ya(c,u,B,g)}u=u.child}return u;case 26:if(bs)return ff(c,u),c===null?(g=Bd(u.type,null,u.pendingProps,null))?u.memoizedState=g:Yn||(u.stateNode=JS(u.type,u.pendingProps,ur.current,u)):u.memoizedState=Bd(u.type,c.memoizedProps,u.pendingProps,c.memoizedState),null;case 27:if(Ma)return he(u),c===null&&Ma&&Yn&&(S=u.stateNode=fg(u.type,u.pendingProps,ur.current,ua.current,!1),Fa=u,Xs=!0,Ea=Td(S)),S=u.pendingProps.children,c!==null||Yn?ya(c,u,S,g):u.child=ol(u,null,S,g),ff(c,u),u.child;case 5:return c===null&&Yn&&(sy(u.type,u.pendingProps,ua.current),(C=S=Ea)&&(S=Q_(S,u.type,u.pendingProps,Xs),S!==null?(u.stateNode=S,Fa=u,Ea=Td(S),Xs=!1,C=!0):C=!1),C||lt(u)),he(u),C=u.type,B=u.pendingProps,J=c!==null?c.memoizedProps:null,S=B.children,nl(C,B)?S=null:J!==null&&nl(C,J)&&(u.flags|=32),u.memoizedState!==null&&(C=q(c,u,Le,null,null,g),Or?fn._currentValue=C:fn._currentValue2=C),ff(c,u),ya(c,u,S,g),u.child;case 6:return c===null&&Yn&&(ry(u.pendingProps,ua.current),(c=g=Ea)&&(g=$_(g,u.pendingProps,Xs),g!==null?(u.stateNode=g,Fa=u,Ea=null,c=!0):c=!1),c||lt(u)),null;case 13:return E_(c,u,g);case 4:return ve(u,u.stateNode.containerInfo),S=u.pendingProps,c===null?u.child=ol(u,null,S,g):ya(c,u,S,g),u.child;case 11:return y_(c,u,u.type,u.pendingProps,g);case 7:return ya(c,u,u.pendingProps,g),u.child;case 8:return ya(c,u,u.pendingProps.children,g),u.child;case 12:return ya(c,u,u.pendingProps.children,g),u.child;case 10:return S=u.pendingProps,Ho(u,u.type,S.value),ya(c,u,S.children,g),u.child;case 9:return C=u.type._context,S=u.pendingProps.children,Ol(u),C=xa(C),S=S(C),u.flags|=1,ya(c,u,S,g),u.child;case 14:return x_(c,u,u.type,u.pendingProps,g);case 15:return Zh(c,u,u.type,u.pendingProps,g);case 19:return C_(c,u,g);case 22:return A_(c,u,g);case 24:return Ol(u),S=xa($n),c===null?(C=Go(),C===null&&(C=Rn,B=$h(),C.pooledCache=B,B.refCount++,B!==null&&(C.pooledCacheLanes|=g),C=B),u.memoizedState={parent:S,cache:C},Ht(u),Ho(u,$n,C)):((c.lanes&g)!==0&&(zt(c,u),Vt(u,null,null,g),rt()),C=c.memoizedState,B=u.memoizedState,C.parent!==S?(C={parent:S,cache:S},u.memoizedState=C,u.lanes===0&&(u.memoizedState=u.updateQueue.baseState=C),Ho(u,$n,S)):(S=B.cache,Ho(u,$n,S),S!==C.cache&&mm(u,[$n],g,!0))),ya(c,u,u.pendingProps.children,g),u.child;case 29:throw u.pendingProps}throw Error(i(156,u.tag))}function Ho(c,u,g){Or?(w(os,u._currentValue),u._currentValue=g):(w(os,u._currentValue2),u._currentValue2=g)}function io(c){var u=os.current;Or?c._currentValue=u:c._currentValue2=u,M(os)}function pm(c,u,g){for(;c!==null;){var S=c.alternate;if((c.childLanes&u)!==u?(c.childLanes|=u,S!==null&&(S.childLanes|=u)):S!==null&&(S.childLanes&u)!==u&&(S.childLanes|=u),c===g)break;c=c.return}}function mm(c,u,g,S){var C=c.child;for(C!==null&&(C.return=c);C!==null;){var B=C.dependencies;if(B!==null){var J=C.child;B=B.firstContext;e:for(;B!==null;){var se=B;B=C;for(var be=0;be<u.length;be++)if(se.context===u[be]){B.lanes|=g,se=B.alternate,se!==null&&(se.lanes|=g),pm(B.return,g,c),S||(J=null);break e}B=se.next}}else if(C.tag===18){if(J=C.return,J===null)throw Error(i(341));J.lanes|=g,B=J.alternate,B!==null&&(B.lanes|=g),pm(J,g,c),J=null}else J=C.child;if(J!==null)J.return=C;else for(J=C;J!==null;){if(J===c){J=null;break}if(C=J.sibling,C!==null){C.return=J.return,J=C;break}J=J.return}C=J}}function Ll(c,u,g,S){c=null;for(var C=u,B=!1;C!==null;){if(!B){if((C.flags&524288)!==0)B=!0;else if((C.flags&262144)!==0)break}if(C.tag===10){var J=C.alternate;if(J===null)throw Error(i(387));if(J=J.memoizedProps,J!==null){var se=C.type;Es(C.pendingProps.value,J.value)||(c!==null?c.push(se):c=[se])}}else if(C===eu.current){if(J=C.alternate,J===null)throw Error(i(387));J.memoizedState.memoizedState!==C.memoizedState.memoizedState&&(c!==null?c.push(fn):c=[fn])}C=C.return}c!==null&&mm(u,c,g,S),u.flags|=262144}function Po(c){for(c=c.firstContext;c!==null;){var u=c.context;if(!Es(Or?u._currentValue:u._currentValue2,c.memoizedValue))return!0;c=c.next}return!1}function Ol(c){cl=c,Li=null,c=c.dependencies,c!==null&&(c.firstContext=null)}function xa(c){return gm(cl,c)}function df(c,u){return cl===null&&Ol(c),gm(c,u)}function gm(c,u){var g=Or?u._currentValue:u._currentValue2;if(u={context:u,memoizedValue:g,next:null},Li===null){if(c===null)throw Error(i(308));Li=u,c.dependencies={lanes:0,firstContext:u},c.flags|=524288}else Li=Li.next=u;return g}function $h(){return{controller:new gy,data:new Map,refCount:0}}function Nc(c){c.refCount--,c.refCount===0&&yo(Zl,function(){c.controller.abort()})}function Go(){var c=xo.current;return c!==null?c:Rn.pooledCache}function ed(c,u){u===null?w(xo,xo.current):w(xo,u.pool)}function w_(){var c=Go();return c===null?null:{parent:Or?$n._currentValue:$n._currentValue2,pool:c}}function ys(c){c.flags|=4}function vm(c,u){if(c!==null&&c.child===u.child)return!1;if((u.flags&16)!==0)return!0;for(c=u.child;c!==null;){if((c.flags&13878)!==0||(c.subtreeFlags&13878)!==0)return!0;c=c.sibling}return!1}function td(c,u,g,S){if(Sa)for(g=u.child;g!==null;){if(g.tag===5||g.tag===6)Lr(c,g.stateNode);else if(!(g.tag===4||Ma&&g.tag===27)&&g.child!==null){g.child.return=g,g=g.child;continue}if(g===u)break;for(;g.sibling===null;){if(g.return===null||g.return===u)return;g=g.return}g.sibling.return=g.return,g=g.sibling}else if(Ss)for(var C=u.child;C!==null;){if(C.tag===5){var B=C.stateNode;g&&S&&(B=Qm(B,C.type,C.memoizedProps)),Lr(c,B)}else if(C.tag===6)B=C.stateNode,g&&S&&(B=$m(B,C.memoizedProps)),Lr(c,B);else if(C.tag!==4){if(C.tag===22&&C.memoizedState!==null)B=C.child,B!==null&&(B.return=C),td(c,C,!0,!0);else if(C.child!==null){C.child.return=C,C=C.child;continue}}if(C===u)break;for(;C.sibling===null;){if(C.return===null||C.return===u)return;C=C.return}C.sibling.return=C.return,C=C.sibling}}function Uc(c,u,g,S){if(Ss)for(var C=u.child;C!==null;){if(C.tag===5){var B=C.stateNode;g&&S&&(B=Qm(B,C.type,C.memoizedProps)),jm(c,B)}else if(C.tag===6)B=C.stateNode,g&&S&&(B=$m(B,C.memoizedProps)),jm(c,B);else if(C.tag!==4){if(C.tag===22&&C.memoizedState!==null)B=C.child,B!==null&&(B.return=C),Uc(c,C,!(C.memoizedProps!==null&&C.memoizedProps.mode==="manual"),!0);else if(C.child!==null){C.child.return=C,C=C.child;continue}}if(C===u)break;for(;C.sibling===null;){if(C.return===null||C.return===u)return;C=C.return}C.sibling.return=C.return,C=C.sibling}}function Lc(c,u){if(Ss&&vm(c,u)){c=u.stateNode;var g=c.containerInfo,S=bd();Uc(S,u,!1,!1),c.pendingChildren=S,ys(u),J_(g,S)}}function _m(c,u,g,S){if(Sa)c.memoizedProps!==S&&ys(u);else if(Ss){var C=c.stateNode,B=c.memoizedProps;if((c=vm(c,u))||B!==S){var J=ua.current;B=Wm(C,g,B,S,!c,null),B===C?u.stateNode=C:(ho(B,g,S,J)&&ys(u),u.stateNode=B,c?td(B,u,!1,!1):ys(u))}else u.stateNode=C}}function Oc(c,u,g){if(k_(u,g)){if(c.flags|=16777216,!po(u,g))if(yf())c.flags|=8192;else throw jl=Od,pg}else c.flags&=-16777217}function ym(c,u){if(oy(u)){if(c.flags|=16777216,!cg(u))if(yf())c.flags|=8192;else throw jl=Od,pg}else c.flags&=-16777217}function pf(c,u){u!==null&&(c.flags|=4),c.flags&16384&&(u=c.tag!==22?U():536870912,c.lanes|=u,So|=u)}function Il(c,u){if(!Yn)switch(c.tailMode){case"hidden":u=c.tail;for(var g=null;u!==null;)u.alternate!==null&&(g=u),u=u.sibling;g===null?c.tail=null:g.sibling=null;break;case"collapsed":g=c.tail;for(var S=null;g!==null;)g.alternate!==null&&(S=g),g=g.sibling;S===null?u||c.tail===null?c.tail=null:c.tail.sibling=null:S.sibling=null}}function mi(c){var u=c.alternate!==null&&c.alternate.child===c.child,g=0,S=0;if(u)for(var C=c.child;C!==null;)g|=C.lanes|C.childLanes,S|=C.subtreeFlags&31457280,S|=C.flags&31457280,C.return=c,C=C.sibling;else for(C=c.child;C!==null;)g|=C.lanes|C.childLanes,S|=C.subtreeFlags,S|=C.flags,C.return=c,C=C.sibling;return c.subtreeFlags|=S,c.childLanes=g,u}function B_(c,u,g){var S=u.pendingProps;switch(le(u),u.tag){case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return mi(u),null;case 1:return mi(u),null;case 3:return g=u.stateNode,S=null,c!==null&&(S=c.memoizedState.cache),u.memoizedState.cache!==S&&(u.flags|=2048),io($n),ze(),g.pendingContext&&(g.context=g.pendingContext,g.pendingContext=null),(c===null||c.child===null)&&(tn(u)?ys(u):c===null||c.memoizedState.isDehydrated&&(u.flags&256)===0||(u.flags|=1024,Rs!==null&&(so(Rs),Rs=null))),Lc(c,u),mi(u),null;case 26:if(bs){g=u.type;var C=u.memoizedState;return c===null?(ys(u),C!==null?(mi(u),ym(u,C)):(mi(u),Oc(u,g,S))):C?C!==c.memoizedState?(ys(u),mi(u),ym(u,C)):(mi(u),u.flags&=-16777217):(Sa?c.memoizedProps!==S&&ys(u):_m(c,u,g,S),mi(u),Oc(u,g,S)),null}case 27:if(Ma){if(Ee(u),g=ur.current,C=u.type,c!==null&&u.stateNode!=null)Sa?c.memoizedProps!==S&&ys(u):_m(c,u,C,S);else{if(!S){if(u.stateNode===null)throw Error(i(166));return mi(u),null}c=ua.current,tn(u)?Rt(u,c):(c=fg(C,S,g,c,!0),u.stateNode=c,ys(u))}return mi(u),null}case 5:if(Ee(u),g=u.type,c!==null&&u.stateNode!=null)_m(c,u,g,S);else{if(!S){if(u.stateNode===null)throw Error(i(166));return mi(u),null}c=ua.current,tn(u)?Rt(u,c):(C=Hm(g,S,ur.current,c,u),td(C,u,!1,!1),u.stateNode=C,ho(C,g,S,c)&&ys(u))}return mi(u),Oc(u,u.type,u.pendingProps),null;case 6:if(c&&u.stateNode!=null)g=c.memoizedProps,Sa?g!==S&&ys(u):Ss&&(g!==S?(u.stateNode=_d(S,ur.current,ua.current,u),ys(u)):u.stateNode=c.stateNode);else{if(typeof S!="string"&&u.stateNode===null)throw Error(i(166));if(c=ur.current,g=ua.current,tn(u)){if(!Ya)throw Error(i(176));if(c=u.stateNode,g=u.memoizedProps,S=null,C=Fa,C!==null)switch(C.tag){case 27:case 5:S=C.memoizedProps}ty(c,g,u,S)||lt(u)}else u.stateNode=_d(S,c,g,u)}return mi(u),null;case 13:if(S=u.memoizedState,c===null||c.memoizedState!==null&&c.memoizedState.dehydrated!==null){if(C=tn(u),S!==null&&S.dehydrated!==null){if(c===null){if(!C)throw Error(i(318));if(!Ya)throw Error(i(344));if(C=u.memoizedState,C=C!==null?C.dehydrated:null,!C)throw Error(i(317));Wc(C,u)}else on(),(u.flags&128)===0&&(u.memoizedState=null),u.flags|=4;mi(u),C=!1}else Rs!==null&&(so(Rs),Rs=null),C=!0;if(!C)return u.flags&256?(kt(u),u):(kt(u),null)}if(kt(u),(u.flags&128)!==0)return u.lanes=g,u;if(g=S!==null,c=c!==null&&c.memoizedState!==null,g){S=u.child,C=null,S.alternate!==null&&S.alternate.memoizedState!==null&&S.alternate.memoizedState.cachePool!==null&&(C=S.alternate.memoizedState.cachePool.pool);var B=null;S.memoizedState!==null&&S.memoizedState.cachePool!==null&&(B=S.memoizedState.cachePool.pool),B!==C&&(S.flags|=2048)}return g!==c&&g&&(u.child.flags|=8192),pf(u,u.updateQueue),mi(u),null;case 4:return ze(),Lc(c,u),c===null&&zm(u.stateNode.containerInfo),mi(u),null;case 10:return io(u.type),mi(u),null;case 19:if(M(Wi),C=u.memoizedState,C===null)return mi(u),null;if(S=(u.flags&128)!==0,B=C.rendering,B===null)if(S)Il(C,!1);else{if(zn!==0||c!==null&&(c.flags&128)!==0)for(c=u.child;c!==null;){if(B=Ai(c),B!==null){for(u.flags|=128,Il(C,!1),c=B.updateQueue,u.updateQueue=c,pf(u,c),u.subtreeFlags=0,c=g,g=u.child;g!==null;)co(g,c),g=g.sibling;return w(Wi,Wi.current&1|2),u.child}c=c.sibling}C.tail!==null&&ba()>bi&&(u.flags|=128,S=!0,Il(C,!1),u.lanes=4194304)}else{if(!S)if(c=Ai(B),c!==null){if(u.flags|=128,S=!0,c=c.updateQueue,u.updateQueue=c,pf(u,c),Il(C,!0),C.tail===null&&C.tailMode==="hidden"&&!B.alternate&&!Yn)return mi(u),null}else 2*ba()-C.renderingStartTime>bi&&g!==536870912&&(u.flags|=128,S=!0,Il(C,!1),u.lanes=4194304);C.isBackwards?(B.sibling=u.child,u.child=B):(c=C.last,c!==null?c.sibling=B:u.child=B,C.last=B)}return C.tail!==null?(u=C.tail,C.rendering=u,C.tail=u.sibling,C.renderingStartTime=ba(),u.sibling=null,c=Wi.current,w(Wi,S?c&1|2:c&1),u):(mi(u),null);case 22:case 23:return kt(u),_a(),S=u.memoizedState!==null,c!==null?c.memoizedState!==null!==S&&(u.flags|=8192):S&&(u.flags|=8192),S?(g&536870912)!==0&&(u.flags&128)===0&&(mi(u),u.subtreeFlags&6&&(u.flags|=8192)):mi(u),g=u.updateQueue,g!==null&&pf(u,g.retryQueue),g=null,c!==null&&c.memoizedState!==null&&c.memoizedState.cachePool!==null&&(g=c.memoizedState.cachePool.pool),S=null,u.memoizedState!==null&&u.memoizedState.cachePool!==null&&(S=u.memoizedState.cachePool.pool),S!==g&&(u.flags|=2048),c!==null&&M(xo),null;case 24:return g=null,c!==null&&(g=c.memoizedState.cache),u.memoizedState.cache!==g&&(u.flags|=2048),io($n),mi(u),null;case 25:return null}throw Error(i(156,u.tag))}function D_(c,u){switch(le(u),u.tag){case 1:return c=u.flags,c&65536?(u.flags=c&-65537|128,u):null;case 3:return io($n),ze(),c=u.flags,(c&65536)!==0&&(c&128)===0?(u.flags=c&-65537|128,u):null;case 26:case 27:case 5:return Ee(u),null;case 13:if(kt(u),c=u.memoizedState,c!==null&&c.dehydrated!==null){if(u.alternate===null)throw Error(i(340));on()}return c=u.flags,c&65536?(u.flags=c&-65537|128,u):null;case 19:return M(Wi),null;case 4:return ze(),null;case 10:return io(u.type),null;case 22:case 23:return kt(u),_a(),c!==null&&M(xo),c=u.flags,c&65536?(u.flags=c&-65537|128,u):null;case 24:return io($n),null;case 25:return null;default:return null}}function xm(c,u){switch(le(u),u.tag){case 3:io($n),ze();break;case 26:case 27:case 5:Ee(u);break;case 4:ze();break;case 13:kt(u);break;case 19:M(Wi);break;case 10:io(u.type);break;case 22:case 23:kt(u),_a(),c!==null&&M(xo);break;case 24:io($n)}}function mf(c,u){try{var g=u.updateQueue,S=g!==null?g.lastEffect:null;if(S!==null){var C=S.next;g=C;do{if((g.tag&c)===c){S=void 0;var B=g.create,J=g.inst;S=B(),J.destroy=S}g=g.next}while(g!==C)}}catch(se){Dn(u,u.return,se)}}function zo(c,u,g){try{var S=u.updateQueue,C=S!==null?S.lastEffect:null;if(C!==null){var B=C.next;S=B;do{if((S.tag&c)===c){var J=S.inst,se=J.destroy;if(se!==void 0){J.destroy=void 0,C=u;var be=g;try{se()}catch(Ke){Dn(C,be,Ke)}}}S=S.next}while(S!==B)}}catch(Ke){Dn(u,u.return,Ke)}}function N_(c){var u=c.updateQueue;if(u!==null){var g=c.stateNode;try{Ne(u,g)}catch(S){Dn(c,c.return,S)}}}function U_(c,u,g){g.props=ar(c.type,c.memoizedProps),g.state=c.memoizedState;try{g.componentWillUnmount()}catch(S){Dn(c,u,S)}}function Fl(c,u){try{var g=c.ref;if(g!==null){var S=c.stateNode;switch(c.tag){case 26:case 27:case 5:var C=Kc(S);break;default:C=S}typeof g=="function"?c.refCleanup=g(C):g.current=C}}catch(B){Dn(c,u,B)}}function gi(c,u){var g=c.ref,S=c.refCleanup;if(g!==null)if(typeof S=="function")try{S()}catch(C){Dn(c,u,C)}finally{c.refCleanup=null,c=c.alternate,c!=null&&(c.refCleanup=null)}else if(typeof g=="function")try{g(null)}catch(C){Dn(c,u,C)}else g.current=null}function Ic(c){var u=c.type,g=c.memoizedProps,S=c.stateNode;try{kS(S,u,g,c)}catch(C){Dn(c,c.return,C)}}function Am(c,u,g){try{Ym(c.stateNode,c.type,g,u,c)}catch(S){Dn(c,c.return,S)}}function Sm(c){return c.tag===5||c.tag===3||(bs?c.tag===26:!1)||(Ma?c.tag===27:!1)||c.tag===4}function nd(c){e:for(;;){for(;c.sibling===null;){if(c.return===null||Sm(c.return))return null;c=c.return}for(c.sibling.return=c.return,c=c.sibling;c.tag!==5&&c.tag!==6&&(!Ma||c.tag!==27)&&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 id(c,u,g){var S=c.tag;if(S===5||S===6)c=c.stateNode,u?qm(g,c,u):X_(g,c);else if(!(S===4||Ma&&S===27)&&(c=c.child,c!==null))for(id(c,u,g),c=c.sibling;c!==null;)id(c,u,g),c=c.sibling}function Fc(c,u,g){var S=c.tag;if(S===5||S===6)c=c.stateNode,u?Jm(g,c,u):Xm(g,c);else if(!(S===4||Ma&&S===27)&&(c=c.child,c!==null))for(Fc(c,u,g),c=c.sibling;c!==null;)Fc(c,u,g),c=c.sibling}function L_(c,u,g){c=c.containerInfo;try{Zm(c,g)}catch(S){Dn(u,u.return,S)}}function Hc(c,u){for(tl(c.containerInfo),Oi=u;Oi!==null;)if(c=Oi,u=c.child,(c.subtreeFlags&1028)!==0&&u!==null)u.return=c,Oi=u;else for(;Oi!==null;){c=Oi;var g=c.alternate;switch(u=c.flags,c.tag){case 0:break;case 11:case 15:break;case 1:if((u&1024)!==0&&g!==null){u=void 0;var S=c,C=g.memoizedProps;g=g.memoizedState;var B=S.stateNode;try{var J=ar(S.type,C,S.elementType===S.type);u=B.getSnapshotBeforeUpdate(J,g),B.__reactInternalSnapshotBeforeUpdate=u}catch(se){Dn(S,S.return,se)}}break;case 3:(u&1024)!==0&&Sa&&Md(c.stateNode.containerInfo);break;case 5:case 26:case 27:case 6:case 4:case 17:break;default:if((u&1024)!==0)throw Error(i(163))}if(u=c.sibling,u!==null){u.return=c.return,Oi=u;break}Oi=c.return}return J=Ql,Ql=!1,J}function ad(c,u,g){var S=g.flags;switch(g.tag){case 0:case 11:case 15:Rr(c,g),S&4&&mf(5,g);break;case 1:if(Rr(c,g),S&4)if(c=g.stateNode,u===null)try{c.componentDidMount()}catch(se){Dn(g,g.return,se)}else{var C=ar(g.type,u.memoizedProps);u=u.memoizedState;try{c.componentDidUpdate(C,u,c.__reactInternalSnapshotBeforeUpdate)}catch(se){Dn(g,g.return,se)}}S&64&&N_(g),S&512&&Fl(g,g.return);break;case 3:if(Rr(c,g),S&64&&(S=g.updateQueue,S!==null)){if(c=null,g.child!==null)switch(g.child.tag){case 27:case 5:c=Kc(g.child.stateNode);break;case 1:c=g.child.stateNode}try{Ne(S,c)}catch(se){Dn(g,g.return,se)}}break;case 26:if(bs){Rr(c,g),S&512&&Fl(g,g.return);break}case 27:case 5:Rr(c,g),u===null&&S&4&&Ic(g),S&512&&Fl(g,g.return);break;case 12:Rr(c,g);break;case 13:Rr(c,g),S&4&&Vo(c,g);break;case 22:if(C=g.memoizedState!==null||ea,!C){u=u!==null&&u.memoizedState!==null||Mi;var B=ea,J=Mi;ea=C,(Mi=u)&&!J?Xo(c,g,(g.subtreeFlags&8772)!==0):Rr(c,g),ea=B,Mi=J}S&512&&(g.memoizedProps.mode==="manual"?Fl(g,g.return):gi(g,g.return));break;default:Rr(c,g)}}function Pc(c){var u=c.alternate;u!==null&&(c.alternate=null,Pc(u)),c.child=null,c.deletions=null,c.sibling=null,c.tag===5&&(u=c.stateNode,u!==null&&Vm(u)),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 xs(c,u,g){for(g=g.child;g!==null;)sd(c,u,g),g=g.sibling}function sd(c,u,g){if(ss&&typeof ss.onCommitFiberUnmount=="function")try{ss.onCommitFiberUnmount($c,g)}catch{}switch(g.tag){case 26:if(bs){Mi||gi(g,u),xs(c,u,g),g.memoizedState?ag(g.memoizedState):g.stateNode&&og(g.stateNode);break}case 27:if(Ma){Mi||gi(g,u);var S=zi,C=ls;zi=g.stateNode,xs(c,u,g),ly(g.stateNode),zi=S,ls=C;break}case 5:Mi||gi(g,u);case 6:if(Sa){if(S=zi,C=ls,zi=null,xs(c,u,g),zi=S,ls=C,zi!==null)if(ls)try{Hi(zi,g.stateNode)}catch(B){Dn(g,u,B)}else try{Ja(zi,g.stateNode)}catch(B){Dn(g,u,B)}}else xs(c,u,g);break;case 18:Sa&&zi!==null&&(ls?tg(zi,g.stateNode):iy(zi,g.stateNode));break;case 4:Sa?(S=zi,C=ls,zi=g.stateNode.containerInfo,ls=!0,xs(c,u,g),zi=S,ls=C):(Ss&&L_(g.stateNode,g,bd()),xs(c,u,g));break;case 0:case 11:case 14:case 15:Mi||zo(2,g,u),Mi||zo(4,g,u),xs(c,u,g);break;case 1:Mi||(gi(g,u),S=g.stateNode,typeof S.componentWillUnmount=="function"&&U_(g,u,S)),xs(c,u,g);break;case 21:xs(c,u,g);break;case 22:Mi||gi(g,u),Mi=(S=Mi)||g.memoizedState!==null,xs(c,u,g),Mi=S;break;default:xs(c,u,g)}}function Vo(c,u){if(Ya&&u.memoizedState===null&&(c=u.alternate,c!==null&&(c=c.memoizedState,c!==null&&(c=c.dehydrated,c!==null))))try{Rd(c)}catch(g){Dn(u,u.return,g)}}function Gc(c){switch(c.tag){case 13:case 19:var u=c.stateNode;return u===null&&(u=c.stateNode=new su),u;case 22:return c=c.stateNode,u=c._retryCache,u===null&&(u=c._retryCache=new su),u;default:throw Error(i(435,c.tag))}}function gf(c,u){var g=Gc(c);u.forEach(function(S){var C=Cm.bind(null,c,S);g.has(S)||(g.add(S),S.then(C,C))})}function Va(c,u){var g=u.deletions;if(g!==null)for(var S=0;S<g.length;S++){var C=g[S],B=c,J=u;if(Sa){var se=J;e:for(;se!==null;){switch(se.tag){case 27:case 5:zi=se.stateNode,ls=!1;break e;case 3:zi=se.stateNode.containerInfo,ls=!0;break e;case 4:zi=se.stateNode.containerInfo,ls=!0;break e}se=se.return}if(zi===null)throw Error(i(160));sd(B,J,C),zi=null,ls=!1}else sd(B,J,C);B=C.alternate,B!==null&&(B.return=null),C.return=null}if(u.subtreeFlags&13878)for(u=u.child;u!==null;)ko(u,c),u=u.sibling}function ko(c,u){var g=c.alternate,S=c.flags;switch(c.tag){case 0:case 11:case 14:case 15:Va(u,c),es(c),S&4&&(zo(3,c,c.return),mf(3,c),zo(5,c,c.return));break;case 1:Va(u,c),es(c),S&512&&(Mi||g===null||gi(g,g.return)),S&64&&ea&&(c=c.updateQueue,c!==null&&(S=c.callbacks,S!==null&&(g=c.shared.hiddenCallbacks,c.shared.hiddenCallbacks=g===null?S:g.concat(S))));break;case 26:if(bs){var C=qa;Va(u,c),es(c),S&512&&(Mi||g===null||gi(g,g.return)),S&4&&(S=g!==null?g.memoizedState:null,u=c.memoizedState,g===null?u===null?c.stateNode===null?c.stateNode=sg(C,c.type,c.memoizedProps,c):rg(C,c.type,c.stateNode):c.stateNode=ig(C,u,c.memoizedProps):S!==u?(S===null?g.stateNode!==null&&og(g.stateNode):ag(S),u===null?rg(C,c.type,c.stateNode):ig(C,u,c.memoizedProps)):u===null&&c.stateNode!==null&&Am(c,c.memoizedProps,g.memoizedProps));break}case 27:if(Ma&&S&4&&c.alternate===null){C=c.stateNode;var B=c.memoizedProps;try{qS(C),KS(c.type,B,C,c)}catch(St){Dn(c,c.return,St)}}case 5:if(Va(u,c),es(c),S&512&&(Mi||g===null||gi(g,g.return)),Sa){if(c.flags&32){u=c.stateNode;try{wf(u)}catch(St){Dn(c,c.return,St)}}S&4&&c.stateNode!=null&&(u=c.memoizedProps,Am(c,u,g!==null?g.memoizedProps:u)),S&1024&&(ul=!0)}break;case 6:if(Va(u,c),es(c),S&4&&Sa){if(c.stateNode===null)throw Error(i(162));S=c.memoizedProps,g=g!==null?g.memoizedProps:S,u=c.stateNode;try{Y_(u,g,S)}catch(St){Dn(c,c.return,St)}}break;case 3:if(bs?(lg(),C=qa,qa=wd(u.containerInfo),Va(u,c),qa=C):Va(u,c),es(c),S&4){if(Sa&&Ya&&g!==null&&g.memoizedState.isDehydrated)try{Cd(u.containerInfo)}catch(St){Dn(c,c.return,St)}if(Ss){S=u.containerInfo,g=u.pendingChildren;try{Zm(S,g)}catch(St){Dn(c,c.return,St)}}}ul&&(ul=!1,Mm(c));break;case 4:bs?(g=qa,qa=wd(c.stateNode.containerInfo),Va(u,c),es(c),qa=g):(Va(u,c),es(c)),S&4&&Ss&&L_(c.stateNode,c,c.stateNode.pendingChildren);break;case 12:Va(u,c),es(c);break;case 13:Va(u,c),es(c),c.child.flags&8192&&c.memoizedState!==null!=(g!==null&&g.memoizedState!==null)&&(Vr=ba()),S&4&&(S=c.updateQueue,S!==null&&(c.updateQueue=null,gf(c,S)));break;case 22:S&512&&(Mi||g===null||gi(g,g.return)),C=c.memoizedState!==null;var J=g!==null&&g.memoizedState!==null,se=ea,be=Mi;if(ea=se||C,Mi=be||J,Va(u,c),Mi=be,ea=se,es(c),u=c.stateNode,u._current=c,u._visibility&=-3,u._visibility|=u._pendingVisibility&2,S&8192&&(u._visibility=C?u._visibility&-2:u._visibility|1,C&&(u=ea||Mi,g===null||J||u||zc(c)),Sa&&(c.memoizedProps===null||c.memoizedProps.mode!=="manual"))){e:if(g=null,Sa)for(u=c;;){if(u.tag===5||bs&&u.tag===26||Ma&&u.tag===27){if(g===null){J=g=u;try{B=J.stateNode,C?Bf(B):Km(J.stateNode,J.memoizedProps)}catch(St){Dn(J,J.return,St)}}}else if(u.tag===6){if(g===null){J=u;try{var Ke=J.stateNode;C?Sd(Ke):mo(Ke,J.memoizedProps)}catch(St){Dn(J,J.return,St)}}}else if((u.tag!==22&&u.tag!==23||u.memoizedState===null||u===c)&&u.child!==null){u.child.return=u,u=u.child;continue}if(u===c)break e;for(;u.sibling===null;){if(u.return===null||u.return===c)break e;g===u&&(g=null),u=u.return}g===u&&(g=null),u.sibling.return=u.return,u=u.sibling}}S&4&&(S=c.updateQueue,S!==null&&(g=S.retryQueue,g!==null&&(S.retryQueue=null,gf(c,g))));break;case 19:Va(u,c),es(c),S&4&&(S=c.updateQueue,S!==null&&(c.updateQueue=null,gf(c,S)));break;case 21:break;default:Va(u,c),es(c)}}function es(c){var u=c.flags;if(u&2){try{if(Sa&&(!Ma||c.tag!==27)){e:{for(var g=c.return;g!==null;){if(Sm(g)){var S=g;break e}g=g.return}throw Error(i(160))}switch(S.tag){case 27:if(Ma){var C=S.stateNode,B=nd(c);Fc(c,B,C);break}case 5:var J=S.stateNode;S.flags&32&&(wf(J),S.flags&=-33);var se=nd(c);Fc(c,se,J);break;case 3:case 4:var be=S.stateNode.containerInfo,Ke=nd(c);id(c,Ke,be);break;default:throw Error(i(161))}}}catch(St){Dn(c,c.return,St)}c.flags&=-3}u&4096&&(c.flags&=-4097)}function Mm(c){if(c.subtreeFlags&1024)for(c=c.child;c!==null;){var u=c;Mm(u),u.tag===5&&u.flags&1024&&oi(u.stateNode),c=c.sibling}}function Rr(c,u){if(u.subtreeFlags&8772)for(u=u.child;u!==null;)ad(c,u.alternate,u),u=u.sibling}function zc(c){for(c=c.child;c!==null;){var u=c;switch(u.tag){case 0:case 11:case 14:case 15:zo(4,u,u.return),zc(u);break;case 1:gi(u,u.return);var g=u.stateNode;typeof g.componentWillUnmount=="function"&&U_(u,u.return,g),zc(u);break;case 26:case 27:case 5:gi(u,u.return),zc(u);break;case 22:gi(u,u.return),u.memoizedState===null&&zc(u);break;default:zc(u)}c=c.sibling}}function Xo(c,u,g){for(g=g&&(u.subtreeFlags&8772)!==0,u=u.child;u!==null;){var S=u.alternate,C=c,B=u,J=B.flags;switch(B.tag){case 0:case 11:case 15:Xo(C,B,g),mf(4,B);break;case 1:if(Xo(C,B,g),S=B,C=S.stateNode,typeof C.componentDidMount=="function")try{C.componentDidMount()}catch(Ke){Dn(S,S.return,Ke)}if(S=B,C=S.updateQueue,C!==null){var se=S.stateNode;try{var be=C.shared.hiddenCallbacks;if(be!==null)for(C.shared.hiddenCallbacks=null,C=0;C<be.length;C++)fe(be[C],se)}catch(Ke){Dn(S,S.return,Ke)}}g&&J&64&&N_(B),Fl(B,B.return);break;case 26:case 27:case 5:Xo(C,B,g),g&&S===null&&J&4&&Ic(B),Fl(B,B.return);break;case 12:Xo(C,B,g);break;case 13:Xo(C,B,g),g&&J&4&&Vo(C,B);break;case 22:B.memoizedState===null&&Xo(C,B,g),Fl(B,B.return);break;default:Xo(C,B,g)}u=u.sibling}}function bm(c,u){var g=null;c!==null&&c.memoizedState!==null&&c.memoizedState.cachePool!==null&&(g=c.memoizedState.cachePool.pool),c=null,u.memoizedState!==null&&u.memoizedState.cachePool!==null&&(c=u.memoizedState.cachePool.pool),c!==g&&(c!=null&&c.refCount++,g!=null&&Nc(g))}function rd(c,u){c=null,u.alternate!==null&&(c=u.alternate.memoizedState.cache),u=u.memoizedState.cache,u!==c&&(u.refCount++,c!=null&&Nc(c))}function ao(c,u,g,S){if(u.subtreeFlags&10256)for(u=u.child;u!==null;)od(c,u,g,S),u=u.sibling}function od(c,u,g,S){var C=u.flags;switch(u.tag){case 0:case 11:case 15:ao(c,u,g,S),C&2048&&mf(9,u);break;case 3:ao(c,u,g,S),C&2048&&(c=null,u.alternate!==null&&(c=u.alternate.memoizedState.cache),u=u.memoizedState.cache,u!==c&&(u.refCount++,c!=null&&Nc(c)));break;case 12:if(C&2048){ao(c,u,g,S),c=u.stateNode;try{var B=u.memoizedProps,J=B.id,se=B.onPostCommit;typeof se=="function"&&se(J,u.alternate===null?"mount":"update",c.passiveEffectDuration,-0)}catch(be){Dn(u,u.return,be)}}else ao(c,u,g,S);break;case 23:break;case 22:B=u.stateNode,u.memoizedState!==null?B._visibility&4?ao(c,u,g,S):Yo(c,u):B._visibility&4?ao(c,u,g,S):(B._visibility|=4,Ua(c,u,g,S,(u.subtreeFlags&10256)!==0)),C&2048&&bm(u.alternate,u);break;case 24:ao(c,u,g,S),C&2048&&rd(u.alternate,u);break;default:ao(c,u,g,S)}}function Ua(c,u,g,S,C){for(C=C&&(u.subtreeFlags&10256)!==0,u=u.child;u!==null;){var B=c,J=u,se=g,be=S,Ke=J.flags;switch(J.tag){case 0:case 11:case 15:Ua(B,J,se,be,C),mf(8,J);break;case 23:break;case 22:var St=J.stateNode;J.memoizedState!==null?St._visibility&4?Ua(B,J,se,be,C):Yo(B,J):(St._visibility|=4,Ua(B,J,se,be,C)),C&&Ke&2048&&bm(J.alternate,J);break;case 24:Ua(B,J,se,be,C),C&&Ke&2048&&rd(J.alternate,J);break;default:Ua(B,J,se,be,C)}u=u.sibling}}function Yo(c,u){if(u.subtreeFlags&10256)for(u=u.child;u!==null;){var g=c,S=u,C=S.flags;switch(S.tag){case 22:Yo(g,S),C&2048&&bm(S.alternate,S);break;case 24:Yo(g,S),C&2048&&rd(S.alternate,S);break;default:Yo(g,S)}u=u.sibling}}function ra(c){if(c.subtreeFlags&$l)for(c=c.child;c!==null;)Hl(c),c=c.sibling}function Hl(c){switch(c.tag){case 26:ra(c),c.flags&$l&&(c.memoizedState!==null?ug(qa,c.memoizedState,c.memoizedProps):Bi(c.type,c.memoizedProps));break;case 5:ra(c),c.flags&$l&&Bi(c.type,c.memoizedProps);break;case 3:case 4:if(bs){var u=qa;qa=wd(c.stateNode.containerInfo),ra(c),qa=u}else ra(c);break;case 22:c.memoizedState===null&&(u=c.alternate,u!==null&&u.memoizedState!==null?(u=$l,$l=16777216,ra(c),$l=u):ra(c));break;default:ra(c)}}function ld(c){var u=c.alternate;if(u!==null&&(c=u.child,c!==null)){u.child=null;do u=c.sibling,c.sibling=null,c=u;while(c!==null)}}function Jo(c){var u=c.deletions;if((c.flags&16)!==0){if(u!==null)for(var g=0;g<u.length;g++){var S=u[g];Oi=S,qo(S,c)}ld(c)}if(c.subtreeFlags&10256)for(c=c.child;c!==null;)vf(c),c=c.sibling}function vf(c){switch(c.tag){case 0:case 11:case 15:Jo(c),c.flags&2048&&zo(9,c,c.return);break;case 3:Jo(c);break;case 12:Jo(c);break;case 22:var u=c.stateNode;c.memoizedState!==null&&u._visibility&4&&(c.return===null||c.return.tag!==13)?(u._visibility&=-5,Vc(c)):Jo(c);break;default:Jo(c)}}function Vc(c){var u=c.deletions;if((c.flags&16)!==0){if(u!==null)for(var g=0;g<u.length;g++){var S=u[g];Oi=S,qo(S,c)}ld(c)}for(c=c.child;c!==null;){switch(u=c,u.tag){case 0:case 11:case 15:zo(8,u,u.return),Vc(u);break;case 22:g=u.stateNode,g._visibility&4&&(g._visibility&=-5,Vc(u));break;default:Vc(u)}c=c.sibling}}function qo(c,u){for(;Oi!==null;){var g=Oi;switch(g.tag){case 0:case 11:case 15:zo(8,g,u);break;case 23:case 22:if(g.memoizedState!==null&&g.memoizedState.cachePool!==null){var S=g.memoizedState.cachePool.pool;S!=null&&S.refCount++}break;case 24:Nc(g.memoizedState.cache)}if(S=g.child,S!==null)S.return=g,Oi=S;else e:for(g=c;Oi!==null;){S=Oi;var C=S.sibling,B=S.return;if(Pc(S),S===g){Oi=null;break e}if(C!==null){C.return=B,Oi=C;break e}Oi=B}}}function cd(c){var u=Gm(c);if(u!=null){if(typeof u.memoizedProps["data-testname"]!="string")throw Error(i(364));return u}if(c=ql(c),c===null)throw Error(i(362));return c.stateNode.current}function kc(c,u){var g=c.tag;switch(u.$$typeof){case Yf:if(c.type===u.value)return!0;break;case Gd:e:{for(u=u.value,c=[c,0],g=0;g<c.length;){var S=c[g++],C=S.tag,B=c[g++],J=u[B];if(C!==5&&C!==26&&C!==27||!Fr(S)){for(;J!=null&&kc(S,J);)B++,J=u[B];if(B===u.length){u=!0;break e}else for(S=S.child;S!==null;)c.push(S,B),S=S.sibling}}u=!1}return u;case zd:if((g===5||g===26||g===27)&&VS(c.stateNode,u.value))return!0;break;case ei:if((g===5||g===6||g===26||g===27)&&(c=Rf(c),c!==null&&0<=c.indexOf(u.value)))return!0;break;case Gn:if((g===5||g===26||g===27)&&(c=c.memoizedProps["data-testname"],typeof c=="string"&&c.toLowerCase()===u.value.toLowerCase()))return!0;break;default:throw Error(i(365))}return!1}function Ko(c){switch(c.$$typeof){case Yf:return"<"+(l(c.value)||"Unknown")+">";case Gd:return":has("+(Ko(c)||"")+")";case zd:return'[role="'+c.value+'"]';case ei:return'"'+c.value+'"';case Gn:return'[data-testname="'+c.value+'"]';default:throw Error(i(365))}}function O_(c,u){var g=[];c=[c,0];for(var S=0;S<c.length;){var C=c[S++],B=C.tag,J=c[S++],se=u[J];if(B!==5&&B!==26&&B!==27||!Fr(C)){for(;se!=null&&kc(C,se);)J++,se=u[J];if(J===u.length)g.push(C);else for(C=C.child;C!==null;)c.push(C,J),C=C.sibling}}return g}function ka(c,u){if(!Ir)throw Error(i(363));c=cd(c),c=O_(c,u),u=[],c=Array.from(c);for(var g=0;g<c.length;){var S=c[g++],C=S.tag;if(C===5||C===26||C===27)Fr(S)||u.push(S.stateNode);else for(S=S.child;S!==null;)c.push(S),S=S.sibling}return u}function Xa(){if(($t&2)!==0&&En!==0)return En&-En;if(ln.T!==null){var c=rs;return c!==0?c:ke()}return Vs()}function wr(){cs===0&&(cs=(En&536870912)===0||Yn?V():536870912);var c=Ds.current;return c!==null&&(c.flags|=32),cs}function La(c,u,g){(c===Rn&&li===2||c.cancelPendingCommit!==null)&&(rr(c,0),sr(c,En,cs,!1)),K(c,g),(($t&2)===0||c!==Rn)&&(c===Rn&&(($t&2)===0&&(dr|=g),zn===4&&sr(c,En,cs,!1)),mt(c))}function _f(c,u,g){if(($t&6)!==0)throw Error(i(327));var S=!g&&(u&60)===0&&(u&c.expiredLanes)===0||O(c,u),C=S?Nr(c,u):Br(c,u,!0),B=S;do{if(C===0){Ns&&!S&&sr(c,u,0,!1);break}else if(C===6)sr(c,u,0,!ti);else{if(g=c.current.alternate,B&&!I_(g)){C=Br(c,u,!1),B=!1;continue}if(C===2){if(B=u,c.errorRecoveryDisabledLanes&B)var J=0;else J=c.pendingLanes&-536870913,J=J!==0?J:J&536870912?536870912:0;if(J!==0){u=J;e:{var se=c;C=ru;var be=Ya&&se.current.memoizedState.isDehydrated;if(be&&(rr(se,J).flags|=256),J=Br(se,J,!1),J!==2){if(Ao&&!be){se.errorRecoveryDisabledLanes|=B,dr|=B,C=4;break e}B=Ls,Ls=C,B!==null&&so(B)}C=J}if(B=!1,C!==2)continue}}if(C===1){rr(c,0),sr(c,u,0,!0);break}e:{switch(S=c,C){case 0:case 1:throw Error(i(345));case 4:if((u&4194176)===u){sr(S,u,cs,!ti);break e}break;case 2:Ls=null;break;case 3:case 5:break;default:throw Error(i(329))}if(S.finishedWork=g,S.finishedLanes=u,(u&62914560)===u&&(B=Vr+300-ba(),10<B)){if(sr(S,u,cs,!ti),H(S,0)!==0)break e;S.timeoutHandle=Pm(ud.bind(null,S,g,Ls,pr,ou,u,cs,dr,So,ti,2,-0,0),B);break e}ud(S,g,Ls,pr,ou,u,cs,dr,So,ti,0,-0,0)}}break}while(!0);mt(c)}function so(c){Ls===null?Ls=c:Ls.push.apply(Ls,c)}function ud(c,u,g,S,C,B,J,se,be,Ke,St,It,Pt){var gn=u.subtreeFlags;if((gn&8192||(gn&16785408)===16785408)&&(Ms(),Hl(u),u=yd(),u!==null)){c.cancelPendingCommit=u(ui.bind(null,c,g,S,C,J,se,be,1,It,Pt)),sr(c,B,J,!Ke);return}ui(c,g,S,C,J,se,be,St,It,Pt)}function I_(c){for(var u=c;;){var g=u.tag;if((g===0||g===11||g===15)&&u.flags&16384&&(g=u.updateQueue,g!==null&&(g=g.stores,g!==null)))for(var S=0;S<g.length;S++){var C=g[S],B=C.getSnapshot;C=C.value;try{if(!Es(B(),C))return!1}catch{return!1}}if(g=u.child,u.subtreeFlags&16384&&g!==null)g.return=u,u=g;else{if(u===c)break;for(;u.sibling===null;){if(u.return===null||u.return===c)return!0;u=u.return}u.sibling.return=u.return,u=u.sibling}}return!0}function sr(c,u,g,S){u&=~Ga,u&=~dr,c.suspendedLanes|=u,c.pingedLanes&=~u,S&&(c.warmLanes|=u),S=c.expirationTimes;for(var C=u;0<C;){var B=31-as(C),J=1<<B;S[B]=-1,C&=~J}g!==0&&$(c,g,u)}function Em(){return($t&6)===0?(Lt(0),!1):!0}function ts(){if(vn!==null){if(li===0)var c=vn.return;else c=vn,Li=cl=null,at(c),Pr=null,Ys=0,c=vn;for(;c!==null;)xm(c.alternate,c),c=c.return;vn=null}}function rr(c,u){c.finishedWork=null,c.finishedLanes=0;var g=c.timeoutHandle;g!==Jl&&(c.timeoutHandle=Jl,Cf(g)),g=c.cancelPendingCommit,g!==null&&(c.cancelPendingCommit=null,g()),ts(),Rn=c,vn=g=Oa(c.current,null),En=u,li=0,Vi=null,ti=!1,Ns=O(c,u),Ao=!1,So=cs=Ga=dr=Us=zn=0,Ls=ru=null,ou=!1,(u&8)!==0&&(u|=u&32);var S=c.entangledLanes;if(S!==0)for(c=c.entanglements,S&=u;0<S;){var C=31-as(S),B=1<<C;u|=c[C],S&=~B}return hr=u,Ge(),g}function Pl(c,u){xn=null,ln.H=Jn,u===ai?(u=_t(),li=3):u===pg?(u=_t(),li=4):li=u===my?8:u!==null&&typeof u=="object"&&typeof u.then=="function"?6:1,Vi=u,vn===null&&(zn=1,Wh(c,ye(u,c.current)))}function yf(){var c=Ds.current;return c===null?!0:(En&4194176)===En?Js===null:(En&62914560)===En||(En&536870912)!==0?c===Js:!1}function Xc(){var c=ln.H;return ln.H=Jn,c===null?Jn:c}function As(){var c=ln.A;return ln.A=Pd,c}function ns(){zn=4,ti||(En&4194176)!==En&&Ds.current!==null||(Ns=!0),(Us&134217727)===0&&(dr&134217727)===0||Rn===null||sr(Rn,En,cs,!1)}function Br(c,u,g){var S=$t;$t|=2;var C=Xc(),B=As();(Rn!==c||En!==u)&&(pr=null,rr(c,u)),u=!1;var J=zn;e:do try{if(li!==0&&vn!==null){var se=vn,be=Vi;switch(li){case 8:ts(),J=6;break e;case 3:case 2:case 6:Ds.current===null&&(u=!0);var Ke=li;if(li=0,Vi=null,Wo(c,se,be,Ke),g&&Ns){J=0;break e}break;default:Ke=li,li=0,Vi=null,Wo(c,se,be,Ke)}}Dr(),J=zn;break}catch(St){Pl(c,St)}while(!0);return u&&c.shellSuspendCounter++,Li=cl=null,$t=S,ln.H=C,ln.A=B,vn===null&&(Rn=null,En=0,Ge()),J}function Dr(){for(;vn!==null;)Tm(vn)}function Nr(c,u){var g=$t;$t|=2;var S=Xc(),C=As();Rn!==c||En!==u?(pr=null,bi=ba()+500,rr(c,u)):Ns=O(c,u);e:do try{if(li!==0&&vn!==null){u=vn;var B=Vi;t:switch(li){case 1:li=0,Vi=null,Wo(c,u,B,1);break;case 2:if(Et(B)){li=0,Vi=null,fd(u);break}u=function(){li===2&&Rn===c&&(li=7),mt(c)},B.then(u,u);break e;case 3:li=7;break e;case 4:li=5;break e;case 7:Et(B)?(li=0,Vi=null,fd(u)):(li=0,Vi=null,Wo(c,u,B,7));break;case 5:var J=null;switch(vn.tag){case 26:J=vn.memoizedState;case 5:case 27:var se=vn,be=se.type,Ke=se.pendingProps;if(J?cg(J):po(be,Ke)){li=0,Vi=null;var St=se.sibling;if(St!==null)vn=St;else{var It=se.return;It!==null?(vn=It,xf(It)):vn=null}break t}}li=0,Vi=null,Wo(c,u,B,5);break;case 6:li=0,Vi=null,Wo(c,u,B,6);break;case 8:ts(),zn=6;break e;default:throw Error(i(462))}}ro();break}catch(Pt){Pl(c,Pt)}while(!0);return Li=cl=null,ln.H=S,ln.A=C,$t=g,vn!==null?0:(Rn=null,En=0,Ge(),zn)}function ro(){for(;vn!==null&&!uy();)Tm(vn)}function Tm(c){var u=R_(c.alternate,c,hr);c.memoizedProps=c.pendingProps,u===null?xf(c):vn=u}function fd(c){var u=c,g=u.alternate;switch(u.tag){case 15:case 0:u=M_(g,u,u.pendingProps,u.type,void 0,En);break;case 11:u=M_(g,u,u.pendingProps,u.type.render,u.ref,En);break;case 5:at(u);default:xm(g,u),u=vn=co(u,hr),u=R_(g,u,hr)}c.memoizedProps=c.pendingProps,u===null?xf(c):vn=u}function Wo(c,u,g,S){Li=cl=null,at(u),Pr=null,Ys=0;var C=u.return;try{if(__(c,C,u,g,En)){zn=1,Wh(c,ye(g,c.current)),vn=null;return}}catch(B){if(C!==null)throw vn=C,B;zn=1,Wh(c,ye(g,c.current)),vn=null;return}u.flags&32768?(Yn||S===1?c=!0:Ns||(En&536870912)!==0?c=!1:(ti=c=!0,(S===2||S===3||S===6)&&(S=Ds.current,S!==null&&S.tag===13&&(S.flags|=16384))),oa(u,c)):xf(u)}function xf(c){var u=c;do{if((u.flags&32768)!==0){oa(u,ti);return}c=u.return;var g=B_(u.alternate,u,hr);if(g!==null){vn=g;return}if(u=u.sibling,u!==null){vn=u;return}vn=u=c}while(u!==null);zn===0&&(zn=5)}function oa(c,u){do{var g=D_(c.alternate,c);if(g!==null){g.flags&=32767,vn=g;return}if(g=c.return,g!==null&&(g.flags|=32768,g.subtreeFlags=0,g.deletions=null),!u&&(c=c.sibling,c!==null)){vn=c;return}vn=c=g}while(c!==null);zn=6,vn=null}function ui(c,u,g,S,C,B,J,se,be,Ke){var St=ln.T,It=$i();try{Ia(2),ln.T=null,In(c,u,g,S,It,C,B,J,se,be,Ke)}finally{ln.T=St,Ia(It)}}function In(c,u,g,S,C,B,J,se){do la();while(Mo!==null);if(($t&6)!==0)throw Error(i(327));var be=c.finishedWork;if(S=c.finishedLanes,be===null)return null;if(c.finishedWork=null,c.finishedLanes=0,be===c.current)throw Error(i(177));c.callbackNode=null,c.callbackPriority=0,c.cancelPendingCommit=null;var Ke=be.lanes|be.childLanes;if(Ke|=tu,ne(c,S,Ke,B,J,se),c===Rn&&(vn=Rn=null,En=0),(be.subtreeFlags&10256)===0&&(be.flags&10256)===0||Ks||(Ks=!0,Vd=Ke,tc=g,Af(Dd,function(){return la(),null})),g=(be.flags&15990)!==0,(be.subtreeFlags&15990)!==0||g?(g=ln.T,ln.T=null,B=$i(),Ia(2),J=$t,$t|=4,Hc(c,be),ko(be,c),Fm(c.containerInfo),c.current=be,ad(c,be.alternate,be),fy(),$t=J,Ia(B),ln.T=g):c.current=be,Ks?(Ks=!1,Mo=c,ec=S):oo(c,Ke),Ke=c.pendingLanes,Ke===0&&(Os=null),I(be.stateNode),mt(c),u!==null)for(C=c.onRecoverableError,be=0;be<u.length;be++)Ke=u[be],C(Ke.value,{componentStack:Ke.stack});return(ec&3)!==0&&la(),Ke=c.pendingLanes,(S&4194218)!==0&&(Ke&42)!==0?c===Ka?nc++:(nc=0,Ka=c):nc=0,Lt(0),null}function oo(c,u){(c.pooledCacheLanes&=u)===0&&(u=c.pooledCache,u!=null&&(c.pooledCache=null,Nc(u)))}function la(){if(Mo!==null){var c=Mo,u=Vd;Vd=0;var g=ge(ec),S=32>g?32:g;g=ln.T;var C=$i();try{if(Ia(S),ln.T=null,Mo===null)var B=!1;else{S=tc,tc=null;var J=Mo,se=ec;if(Mo=null,ec=0,($t&6)!==0)throw Error(i(331));var be=$t;if($t|=4,vf(J.current),od(J,J.current,se,S),$t=be,Lt(0,!1),ss&&typeof ss.onPostCommitFiberRoot=="function")try{ss.onPostCommitFiberRoot($c,J)}catch{}B=!0}return B}finally{Ia(C),ln.T=g,oo(c,u)}}return!1}function hd(c,u,g){u=ye(g,u),u=cf(c.stateNode,u,2),c=qe(c,u,2),c!==null&&(K(c,2),mt(c))}function Dn(c,u,g){if(c.tag===3)hd(c,c,g);else for(;u!==null;){if(u.tag===3){hd(u,c,g);break}else if(u.tag===1){var S=u.stateNode;if(typeof u.type.getDerivedStateFromError=="function"||typeof S.componentDidCatch=="function"&&(Os===null||!Os.has(S))){c=ye(g,c),g=Dc(2),S=qe(u,g,2),S!==null&&(uf(g,S,u,c),K(S,2),mt(S));break}}u=u.return}}function dd(c,u,g){var S=c.pingCache;if(S===null){S=c.pingCache=new Nn;var C=new Set;S.set(u,C)}else C=S.get(u),C===void 0&&(C=new Set,S.set(u,C));C.has(g)||(Ao=!0,C.add(g),c=F_.bind(null,c,u,g),u.then(c,c))}function F_(c,u,g){var S=c.pingCache;S!==null&&S.delete(u),c.pingedLanes|=c.suspendedLanes&g,c.warmLanes&=~g,Rn===c&&(En&g)===g&&(zn===4||zn===3&&(En&62914560)===En&&300>ba()-Vr?($t&2)===0&&rr(c,0):Ga|=g,So===En&&(So=0)),mt(c)}function Gl(c,u){u===0&&(u=U()),c=xt(c,u),c!==null&&(K(c,u),mt(c))}function zl(c){var u=c.memoizedState,g=0;u!==null&&(g=u.retryLane),Gl(c,g)}function Cm(c,u){var g=0;switch(c.tag){case 13:var S=c.stateNode,C=c.memoizedState;C!==null&&(g=C.retryLane);break;case 19:S=c.stateNode;break;case 22:S=c.stateNode._retryCache;break;default:throw Error(i(314))}S!==null&&S.delete(u),Gl(c,g)}function Af(c,u){return Qc(c,u)}function Rm(c,u,g,S){this.tag=c,this.key=g,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.refCleanup=this.ref=null,this.pendingProps=u,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=S,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function lo(c){return c=c.prototype,!(!c||!c.isReactComponent)}function Oa(c,u){var g=c.alternate;return g===null?(g=t(c.tag,u,c.key,c.mode),g.elementType=c.elementType,g.type=c.type,g.stateNode=c.stateNode,g.alternate=c,c.alternate=g):(g.pendingProps=u,g.type=c.type,g.flags=0,g.subtreeFlags=0,g.deletions=null),g.flags=c.flags&31457280,g.childLanes=c.childLanes,g.lanes=c.lanes,g.child=c.child,g.memoizedProps=c.memoizedProps,g.memoizedState=c.memoizedState,g.updateQueue=c.updateQueue,u=c.dependencies,g.dependencies=u===null?null:{lanes:u.lanes,firstContext:u.firstContext},g.sibling=c.sibling,g.index=c.index,g.ref=c.ref,g.refCleanup=c.refCleanup,g}function co(c,u){c.flags&=31457282;var g=c.alternate;return g===null?(c.childLanes=0,c.lanes=u,c.child=null,c.subtreeFlags=0,c.memoizedProps=null,c.memoizedState=null,c.updateQueue=null,c.dependencies=null,c.stateNode=null):(c.childLanes=g.childLanes,c.lanes=g.lanes,c.child=g.child,c.subtreeFlags=0,c.deletions=null,c.memoizedProps=g.memoizedProps,c.memoizedState=g.memoizedState,c.updateQueue=g.updateQueue,c.type=g.type,u=g.dependencies,c.dependencies=u===null?null:{lanes:u.lanes,firstContext:u.firstContext}),c}function zs(c,u,g,S,C,B){var J=0;if(S=c,typeof c=="function")lo(c)&&(J=1);else if(typeof c=="string")J=bs&&Ma?ng(c,g,ua.current)?26:jc(c)?27:5:bs?ng(c,g,ua.current)?26:5:Ma&&jc(c)?27:5;else e:switch(c){case Jc:return uo(g.children,C,B,u);case Um:J=8,C|=24;break;case Lm:return c=t(12,g,u,C|2),c.elementType=Lm,c.lanes=B,c;case md:return c=t(13,g,u,C),c.elementType=md,c.lanes=B,c;case Qo:return c=t(19,g,u,C),c.elementType=Qo,c.lanes=B,c;case bf:return pd(g,C,B,u);default:if(typeof c=="object"&&c!==null)switch(c.$$typeof){case G_:case Ur:J=10;break e;case Zo:J=9;break e;case qc:J=11;break e;case Mf:J=14;break e;case lr:J=16,S=null;break e}J=29,g=Error(i(130,c===null?"null":typeof c,"")),S=null}return u=t(J,g,u,C),u.elementType=c,u.type=S,u.lanes=B,u}function uo(c,u,g,S){return c=t(7,c,S,u),c.lanes=g,c}function pd(c,u,g,S){c=t(22,c,S,u),c.elementType=bf,c.lanes=g;var C={_visibility:1,_pendingVisibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null,_current:null,detach:function(){var B=C._current;if(B===null)throw Error(i(456));if((C._pendingVisibility&2)===0){var J=xt(B,2);J!==null&&(C._pendingVisibility|=2,La(J,B,2))}},attach:function(){var B=C._current;if(B===null)throw Error(i(456));if((C._pendingVisibility&2)!==0){var J=xt(B,2);J!==null&&(C._pendingVisibility&=-3,La(J,B,2))}}};return c.stateNode=C,c}function jo(c,u,g){return c=t(6,c,null,u),c.lanes=g,c}function Yc(c,u,g){return u=t(4,c.children!==null?c.children:[],c.key,u),u.lanes=g,u.stateNode={containerInfo:c.containerInfo,pendingChildren:null,implementation:c.implementation},u}function Vl(c,u,g,S,C,B,J,se){this.tag=1,this.containerInfo=c,this.finishedWork=this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=Jl,this.callbackNode=this.next=this.pendingContext=this.context=this.cancelPendingCommit=null,this.callbackPriority=0,this.expirationTimes=F(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.finishedLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=F(0),this.hiddenUpdates=F(null),this.identifierPrefix=S,this.onUncaughtError=C,this.onCaughtError=B,this.onRecoverableError=J,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=se,this.incompleteTransitions=new Map}function ca(c,u,g,S,C,B,J,se,be,Ke,St,It){return c=new Vl(c,u,g,J,se,be,Ke,It),u=1,B===!0&&(u|=24),B=t(3,null,null,u),c.current=B,B.stateNode=c,u=$h(),u.refCount++,c.pooledCache=u,u.refCount++,B.memoizedState={element:S,isDehydrated:g,cache:u},Ht(B),c}function Sf(c){return c?(c=Kl,c):Kl}function wm(c){var u=c._reactInternals;if(u===void 0)throw typeof c.render=="function"?Error(i(188)):(c=Object.keys(c).join(","),Error(i(268,c)));return c=x(u),c=c!==null?b(c):null,c===null?null:Kc(c.stateNode)}function H_(c,u,g,S,C,B){C=Sf(C),S.context===null?S.context=C:S.pendingContext=C,S=Ye(u),S.payload={element:g},B=B===void 0?null:B,B!==null&&(S.callback=B),g=qe(c,S,u),g!==null&&(La(g,c,u),wt(g,c,u))}function P_(c,u){if(c=c.memoizedState,c!==null&&c.dehydrated!==null){var g=c.retryLane;c.retryLane=g!==0&&g<u?g:u}}function Bm(c,u){P_(c,u),(c=c.alternate)&&P_(c,u)}var Qt={},Dm=qf(),Aa=DL(),kl=Object.assign,Nm=Symbol.for("react.element"),fo=Symbol.for("react.transitional.element"),or=Symbol.for("react.portal"),Jc=Symbol.for("react.fragment"),Um=Symbol.for("react.strict_mode"),Lm=Symbol.for("react.profiler"),G_=Symbol.for("react.provider"),Zo=Symbol.for("react.consumer"),Ur=Symbol.for("react.context"),qc=Symbol.for("react.forward_ref"),md=Symbol.for("react.suspense"),Qo=Symbol.for("react.suspense_list"),Mf=Symbol.for("react.memo"),lr=Symbol.for("react.lazy"),bf=Symbol.for("react.offscreen"),z_=Symbol.for("react.memo_cache_sentinel"),Om=Symbol.iterator,Xl=Symbol.for("react.client.reference"),ln=Dm.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,gd,Im,$o=!1,el=Array.isArray,vd=e.rendererVersion,Ef=e.rendererPackageName,Tf=e.extraDevToolsConfig,Kc=e.getPublicInstance,Yl=e.getRootHostContext,V_=e.getChildHostContext,tl=e.prepareForCommit,Fm=e.resetAfterCommit,Hm=e.createInstance,Lr=e.appendInitialChild,ho=e.finalizeInitialChildren,nl=e.shouldSetTextContent,_d=e.createTextInstance,Pm=e.scheduleTimeout,Cf=e.cancelTimeout,Jl=e.noTimeout,Or=e.isPrimaryRenderer;e.warnsIfNotActing;var Sa=e.supportsMutation,Ss=e.supportsPersistence,Ya=e.supportsHydration,Gm=e.getInstanceFromNode;e.beforeActiveInstanceBlur,e.afterActiveInstanceBlur;var zm=e.preparePortalMount;e.prepareScopeUpdate,e.getInstanceFromScope;var Ia=e.setCurrentUpdatePriority,$i=e.getCurrentUpdatePriority,Vs=e.resolveUpdatePriority;e.resolveEventType,e.resolveEventTimeStamp;var il=e.shouldAttemptEagerTransition,Vm=e.detachDeletedInstance;e.requestPostPaintCallback;var k_=e.maySuspendCommit,po=e.preloadInstance,Ms=e.startSuspendingCommit,Bi=e.suspendInstance,yd=e.waitForCommitToBeReady,is=e.NotPendingTransition,fn=e.HostTransitionContext,oi=e.resetFormInstance;e.bindToConsole;var Ki=e.supportsMicrotasks,xd=e.scheduleMicrotask,Ir=e.supportsTestSelectors,ql=e.findFiberRoot,Ad=e.getBoundingRect,Rf=e.getTextContent,Fr=e.isHiddenSubtree,VS=e.matchAccessibilityRole,Di=e.setFocusIfFocusable,km=e.setupIntersectionObserver,Xm=e.appendChild,X_=e.appendChildToContainer,Y_=e.commitTextUpdate,kS=e.commitMount,Ym=e.commitUpdate,Jm=e.insertBefore,qm=e.insertInContainerBefore,Ja=e.removeChild,Hi=e.removeChildFromContainer,wf=e.resetTextContent,Bf=e.hideInstance,Sd=e.hideTextInstance,Km=e.unhideInstance,mo=e.unhideTextInstance,Md=e.clearContainer,Wm=e.cloneInstance,bd=e.createContainerChildSet,jm=e.appendChildToContainerChildSet,J_=e.finalizeContainerChildren,Zm=e.replaceContainerChildren,Qm=e.cloneHiddenInstance,$m=e.cloneHiddenTextInstance,Ed=e.isSuspenseInstancePending,Df=e.isSuspenseInstanceFallback,q_=e.getSuspenseInstanceFallbackErrorDetails,XS=e.registerSuspenseInstanceRetry,K_=e.canHydrateFormStateMarker,W_=e.isFormStateMarkerMatching,eg=e.getNextHydratableSibling,Td=e.getFirstHydratableChild,j_=e.getFirstHydratableChildWithinContainer,Z_=e.getFirstHydratableChildWithinSuspenseInstance,Q_=e.canHydrateInstance,$_=e.canHydrateTextInstance,ey=e.canHydrateSuspenseInstance,YS=e.hydrateInstance,ty=e.hydrateTextInstance,Wc=e.hydrateSuspenseInstance,ny=e.getNextHydratableInstanceAfterSuspenseInstance,Cd=e.commitHydratedContainer,Rd=e.commitHydratedSuspenseInstance,iy=e.clearSuspenseBoundary,tg=e.clearSuspenseBoundaryFromContainer,ay=e.shouldDeleteUnhydratedTailInstances;e.diffHydratedPropsForDevWarnings,e.diffHydratedTextForDevWarnings,e.describeHydratableInstanceForDevWarnings;var sy=e.validateHydratableInstance,ry=e.validateHydratableTextInstance,bs=e.supportsResources,ng=e.isHostHoistableType,wd=e.getHoistableRoot,Bd=e.getResource,ig=e.acquireResource,ag=e.releaseResource,sg=e.hydrateHoistable,rg=e.mountHoistable,og=e.unmountHoistable,JS=e.createHoistableInstance,lg=e.prepareToCommitHoistables,oy=e.mayResourceSuspendCommit,cg=e.preloadResource,ug=e.suspendResource,Ma=e.supportsSingletons,fg=e.resolveSingletonInstance,qS=e.clearSingleton,KS=e.acquireSingletonInstance,ly=e.releaseSingletonInstance,jc=e.isHostSingletonType,Nf=[],go=-1,Kl={},as=Math.clz32?Math.clz32:D,Uf=Math.log,cy=Math.LN2,Zc=128,Lf=4194304,Qc=Aa.unstable_scheduleCallback,Of=Aa.unstable_cancelCallback,uy=Aa.unstable_shouldYield,fy=Aa.unstable_requestPaint,ba=Aa.unstable_now,hg=Aa.unstable_ImmediatePriority,hy=Aa.unstable_UserBlockingPriority,Dd=Aa.unstable_NormalPriority,Nd=Aa.unstable_IdlePriority,dy=Aa.log,dg=Aa.unstable_setDisableYieldValue,$c=null,ss=null,Es=typeof Object.is=="function"?Object.is:ee,Ud=new WeakMap,vi=[],Ni=0,If=null,Ff=0,Ts=[],Cs=0,cr=null,Hr=1,ks="",ua=T(null),Hf=T(null),ur=T(null),eu=T(null),Fa=null,Ea=null,Yn=!1,Rs=null,Xs=!1,Pf=Error(i(519)),ws=[],al=0,tu=0,nu=null,Wl=null,Gf=!1,zf=!1,fr=!1,sl=0,Vf=null,Ld=0,rs=0,rl=null,vo=!1,iu=!1,kf=Object.prototype.hasOwnProperty,ai=Error(i(460)),pg=Error(i(474)),Od={then:function(){}},jl=null,Pr=null,Ys=0,ol=va(!0),mg=va(!1),Gr=T(null),Bs=T(0),Ds=T(null),Js=null,Wi=T(0),zr=0,xn=null,Zn=null,Pi=null,qs=!1,_i=!1,_o=!1,Xf=0,Ui=0,au=null,py=0,Id=function(){return{lastEffect:null,events:null,stores:null,memoCache:null}},Jn={readContext:xa,use:dt,useCallback:mn,useContext:mn,useEffect:mn,useImperativeHandle:mn,useLayoutEffect:mn,useInsertionEffect:mn,useMemo:mn,useReducer:mn,useRef:mn,useState:mn,useDebugValue:mn,useDeferredValue:mn,useTransition:mn,useSyncExternalStore:mn,useId:mn};Jn.useCacheRefresh=mn,Jn.useMemoCache=mn,Jn.useHostTransitionStatus=mn,Jn.useFormState=mn,Jn.useActionState=mn,Jn.useOptimistic=mn;var ji={readContext:xa,use:dt,useCallback:function(c,u){return st().memoizedState=[c,u===void 0?null:u],c},useContext:xa,useEffect:Er,useImperativeHandle:function(c,u,g){g=g!=null?g.concat([c]):null,ri(4194308,4,af.bind(null,u,c),g)},useLayoutEffect:function(c,u){return ri(4194308,4,c,u)},useInsertionEffect:function(c,u){ri(4,2,c,u)},useMemo:function(c,u){var g=st();u=u===void 0?null:u;var S=c();if(_o){W(!0);try{c()}finally{W(!1)}}return g.memoizedState=[S,u],S},useReducer:function(c,u,g){var S=st();if(g!==void 0){var C=g(u);if(_o){W(!0);try{g(u)}finally{W(!1)}}}else C=u;return S.memoizedState=S.baseState=C,c={pending:null,lanes:0,dispatch:null,lastRenderedReducer:c,lastRenderedState:C},S.queue=c,c=c.dispatch=Oo.bind(null,xn,c),[S.memoizedState,c]},useRef:function(c){var u=st();return c={current:c},u.memoizedState=c},useState:function(c){c=He(c);var u=c.queue,g=qh.bind(null,xn,u);return u.dispatch=g,[c.memoizedState,g]},useDebugValue:sf,useDeferredValue:function(c,u){var g=st();return Lo(g,c,u)},useTransition:function(){var c=He(!1);return c=Yh.bind(null,xn,c.queue,!0,!1),st().memoizedState=c,[!1,c]},useSyncExternalStore:function(c,u,g){var S=xn,C=st();if(Yn){if(g===void 0)throw Error(i(407));g=g()}else{if(g=u(),Rn===null)throw Error(i(349));(En&60)!==0||ut(S,u,g)}C.memoizedState=g;var B={value:g,getSnapshot:u};return C.queue=B,Er(xe.bind(null,S,B,c),[c]),S.flags|=2048,Pn(9,ht.bind(null,S,B,g,u),{destroy:void 0},null),g},useId:function(){var c=st(),u=Rn.identifierPrefix;if(Yn){var g=ks,S=Hr;g=(S&~(1<<32-as(S)-1)).toString(32)+g,u=":"+u+"R"+g,g=Xf++,0<g&&(u+="H"+g.toString(32)),u+=":"}else g=py++,u=":"+u+"r"+g.toString(32)+":";return c.memoizedState=u},useCacheRefresh:function(){return st().memoizedState=rf.bind(null,xn)}};ji.useMemoCache=k,ji.useHostTransitionStatus=Nl,ji.useFormState=un,ji.useActionState=un,ji.useOptimistic=function(c){var u=st();u.memoizedState=u.baseState=c;var g={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return u.queue=g,u=Kh.bind(null,xn,!0,g),g.dispatch=u,[c,u]};var Ha={readContext:xa,use:dt,useCallback:Xh,useContext:xa,useEffect:_s,useImperativeHandle:Tr,useInsertionEffect:g_,useLayoutEffect:v_,useMemo:Dl,useReducer:ue,useRef:jn,useState:function(){return ue(ie)},useDebugValue:sf,useDeferredValue:function(c,u){var g=tt();return am(g,Zn.memoizedState,c,u)},useTransition:function(){var c=ue(ie)[0],u=tt().memoizedState;return[typeof c=="boolean"?c:yt(c),u]},useSyncExternalStore:it,useId:Cr};Ha.useCacheRefresh=Jh,Ha.useMemoCache=k,Ha.useHostTransitionStatus=Nl,Ha.useFormState=Wn,Ha.useActionState=Wn,Ha.useOptimistic=function(c,u){var g=tt();return Ve(g,Zn,c,u)};var ll={readContext:xa,use:dt,useCallback:Xh,useContext:xa,useEffect:_s,useImperativeHandle:Tr,useInsertionEffect:g_,useLayoutEffect:v_,useMemo:Dl,useReducer:ce,useRef:jn,useState:function(){return ce(ie)},useDebugValue:sf,useDeferredValue:function(c,u){var g=tt();return Zn===null?Lo(g,c,u):am(g,Zn.memoizedState,c,u)},useTransition:function(){var c=ce(ie)[0],u=tt().memoizedState;return[typeof c=="boolean"?c:yt(c),u]},useSyncExternalStore:it,useId:Cr};ll.useCacheRefresh=Jh,ll.useMemoCache=k,ll.useHostTransitionStatus=Nl,ll.useFormState=rn,ll.useActionState=rn,ll.useOptimistic=function(c,u){var g=tt();return Zn!==null?Ve(g,Zn,c,u):(g.baseState=c,[c,g.queue.dispatch])};var Fd={isMounted:function(c){return(c=c._reactInternals)?v(c)===c:!1},enqueueSetState:function(c,u,g){c=c._reactInternals;var S=Xa(),C=Ye(S);C.payload=u,g!=null&&(C.callback=g),u=qe(c,C,S),u!==null&&(La(u,c,S),wt(u,c,S))},enqueueReplaceState:function(c,u,g){c=c._reactInternals;var S=Xa(),C=Ye(S);C.tag=1,C.payload=u,g!=null&&(C.callback=g),u=qe(c,C,S),u!==null&&(La(u,c,S),wt(u,c,S))},enqueueForceUpdate:function(c,u){c=c._reactInternals;var g=Xa(),S=Ye(g);S.tag=2,u!=null&&(S.callback=u),u=qe(c,S,g),u!==null&&(La(u,c,g),wt(u,c,g))}},gg=typeof reportError=="function"?reportError:function(c){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var u=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof c=="object"&&c!==null&&typeof c.message=="string"?String(c.message):String(c),error:c});if(!window.dispatchEvent(u))return}else if(typeof hl=="object"&&typeof hl.emit=="function"){hl.emit("uncaughtException",c);return}console.error(c)},my=Error(i(461)),Gi=!1,Pa={dehydrated:null,treeContext:null,retryLane:0},os=T(null),cl=null,Li=null,gy=typeof AbortController<"u"?AbortController:function(){var c=[],u=this.signal={aborted:!1,addEventListener:function(g,S){c.push(S)}};this.abort=function(){u.aborted=!0,c.forEach(function(g){return g()})}},yo=Aa.unstable_scheduleCallback,Zl=Aa.unstable_NormalPriority,$n={$$typeof:Ur,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0},Hd=ln.S;ln.S=function(c,u){typeof u=="object"&&u!==null&&typeof u.then=="function"&&Ie(c,u),Hd!==null&&Hd(c,u)};var xo=T(null),ea=!1,Mi=!1,ul=!1,su=typeof WeakSet=="function"?WeakSet:Set,Oi=null,Ql=!1,zi=null,ls=!1,qa=null,$l=8192,Pd={getCacheForType:function(c){var u=xa($n),g=u.data.get(c);return g===void 0&&(g=c(),u.data.set(c,g)),g}},Yf=0,Gd=1,zd=2,Gn=3,ei=4;if(typeof Symbol=="function"&&Symbol.for){var An=Symbol.for;Yf=An("selector.component"),Gd=An("selector.has_pseudo_class"),zd=An("selector.role"),Gn=An("selector.test_id"),ei=An("selector.text")}var Nn=typeof WeakMap=="function"?WeakMap:Map,$t=0,Rn=null,vn=null,En=0,li=0,Vi=null,ti=!1,Ns=!1,Ao=!1,hr=0,zn=0,Us=0,dr=0,Ga=0,cs=0,So=0,ru=null,Ls=null,ou=!1,Vr=0,bi=1/0,pr=null,Os=null,Ks=!1,Mo=null,ec=0,Vd=0,tc=null,nc=0,Ka=null;return Qt.attemptContinuousHydration=function(c){if(c.tag===13){var u=xt(c,67108864);u!==null&&La(u,c,67108864),Bm(c,67108864)}},Qt.attemptHydrationAtCurrentPriority=function(c){if(c.tag===13){var u=Xa(),g=xt(c,u);g!==null&&La(g,c,u),Bm(c,u)}},Qt.attemptSynchronousHydration=function(c){switch(c.tag){case 3:if(c=c.stateNode,c.current.memoizedState.isDehydrated){var u=N(c.pendingLanes);if(u!==0){for(c.pendingLanes|=2,c.entangledLanes|=2;u;){var g=1<<31-as(u);c.entanglements[1]|=g,u&=~g}mt(c),($t&6)===0&&(bi=ba()+500,Lt(0))}}break;case 13:u=xt(c,2),u!==null&&La(u,c,2),Em(),Bm(c,2)}},Qt.batchedUpdates=function(c,u){return c(u)},Qt.createComponentSelector=function(c){return{$$typeof:Yf,value:c}},Qt.createContainer=function(c,u,g,S,C,B,J,se,be,Ke){return ca(c,u,!1,null,g,S,B,J,se,be,Ke,null)},Qt.createHasPseudoClassSelector=function(c){return{$$typeof:Gd,value:c}},Qt.createHydrationContainer=function(c,u,g,S,C,B,J,se,be,Ke,St,It,Pt){return c=ca(g,S,!0,c,C,B,se,be,Ke,St,It,Pt),c.context=Sf(null),g=c.current,S=Xa(),C=Ye(S),C.callback=u??null,qe(g,C,S),c.current.lanes=S,K(c,S),mt(c),c},Qt.createPortal=function(c,u,g){var S=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:or,key:S==null?null:""+S,children:c,containerInfo:u,implementation:g}},Qt.createRoleSelector=function(c){return{$$typeof:zd,value:c}},Qt.createTestNameSelector=function(c){return{$$typeof:Gn,value:c}},Qt.createTextSelector=function(c){return{$$typeof:ei,value:c}},Qt.defaultOnCaughtError=function(c){console.error(c)},Qt.defaultOnRecoverableError=function(c){gg(c)},Qt.defaultOnUncaughtError=function(c){gg(c)},Qt.deferredUpdates=function(c){var u=ln.T,g=$i();try{return Ia(32),ln.T=null,c()}finally{Ia(g),ln.T=u}},Qt.discreteUpdates=function(c,u,g,S,C){var B=ln.T,J=$i();try{return Ia(2),ln.T=null,c(u,g,S,C)}finally{Ia(J),ln.T=B,$t===0&&(bi=ba()+500)}},Qt.findAllNodes=ka,Qt.findBoundingRects=function(c,u){if(!Ir)throw Error(i(363));u=ka(c,u),c=[];for(var g=0;g<u.length;g++)c.push(Ad(u[g]));for(u=c.length-1;0<u;u--){g=c[u];for(var S=g.x,C=S+g.width,B=g.y,J=B+g.height,se=u-1;0<=se;se--)if(u!==se){var be=c[se],Ke=be.x,St=Ke+be.width,It=be.y,Pt=It+be.height;if(S>=Ke&&B>=It&&C<=St&&J<=Pt){c.splice(u,1);break}else if(S!==Ke||g.width!==be.width||Pt<B||It>J){if(!(B!==It||g.height!==be.height||St<S||Ke>C)){Ke>S&&(be.width+=Ke-S,be.x=S),St<C&&(be.width=C-Ke),c.splice(u,1);break}}else{It>B&&(be.height+=It-B,be.y=B),Pt<J&&(be.height=J-It),c.splice(u,1);break}}}return c},Qt.findHostInstance=wm,Qt.findHostInstanceWithNoPortals=function(c){return c=x(c),c=c!==null?R(c):null,c===null?null:Kc(c.stateNode)},Qt.findHostInstanceWithWarning=function(c){return wm(c)},Qt.flushPassiveEffects=la,Qt.flushSyncFromReconciler=function(c){var u=$t;$t|=1;var g=ln.T,S=$i();try{if(Ia(2),ln.T=null,c)return c()}finally{Ia(S),ln.T=g,$t=u,($t&6)===0&&Lt(0)}},Qt.flushSyncWork=Em,Qt.focusWithin=function(c,u){if(!Ir)throw Error(i(363));for(c=cd(c),u=O_(c,u),u=Array.from(u),c=0;c<u.length;){var g=u[c++],S=g.tag;if(!Fr(g)){if((S===5||S===26||S===27)&&Di(g.stateNode))return!0;for(g=g.child;g!==null;)u.push(g),g=g.sibling}}return!1},Qt.getFindAllNodesFailureDescription=function(c,u){if(!Ir)throw Error(i(363));var g=0,S=[];c=[cd(c),0];for(var C=0;C<c.length;){var B=c[C++],J=B.tag,se=c[C++],be=u[se];if((J!==5&&J!==26&&J!==27||!Fr(B))&&(kc(B,be)&&(S.push(Ko(be)),se++,se>g&&(g=se)),se<u.length))for(B=B.child;B!==null;)c.push(B,se),B=B.sibling}if(g<u.length){for(c=[];g<u.length;g++)c.push(Ko(u[g]));return`findAllNodes was able to match part of the selector:
|
|
4027
4027
|
`+(S.join(" > ")+`
|
|
4028
4028
|
|
|
4029
4029
|
No matching component was found for:
|
|
@@ -4112,7 +4112,7 @@ No matching component was found for:
|
|
|
4112
4112
|
`))&&ae<U&&ne<V.byteLength;)ge+=I,ae+=I.length,ne+=128,I+=String.fromCharCode.apply(null,new Uint16Array(V.subarray(ne,ne+128)));return-1<$?(V.pos+=ae+$+1,ge+I.slice(0,$)):!1},y=function(V){const U=/^#\?(\S+)/,F=/^\s*GAMMA\s*=\s*(\d+(\.\d+)?)\s*$/,K=/^\s*EXPOSURE\s*=\s*(\d+(\.\d+)?)\s*$/,ne=/^\s*FORMAT=(\S+)\s*$/,$=/^\s*\-Y\s+(\d+)\s+\+X\s+(\d+)\s*$/,ae={valid:0,string:"",comments:"",programtype:"RGBE",format:"",gamma:1,exposure:1,width:0,height:0};let ge,I;for((V.pos>=V.byteLength||!(ge=v(V)))&&l(1,"no header found"),(I=ge.match(U))||l(3,"bad initial token"),ae.valid|=1,ae.programtype=I[1],ae.string+=ge+`
|
|
4113
4113
|
`;ge=v(V),ge!==!1;){if(ae.string+=ge+`
|
|
4114
4114
|
`,ge.charAt(0)==="#"){ae.comments+=ge+`
|
|
4115
|
-
`;continue}if((I=ge.match(F))&&(ae.gamma=parseFloat(I[1])),(I=ge.match(K))&&(ae.exposure=parseFloat(I[1])),(I=ge.match(ne))&&(ae.valid|=2,ae.format=I[1]),(I=ge.match($))&&(ae.valid|=4,ae.height=parseInt(I[1],10),ae.width=parseInt(I[2],10)),ae.valid&2&&ae.valid&4)break}return ae.valid&2||l(3,"missing format specifier"),ae.valid&4||l(3,"missing image size specifier"),ae},x=function(V,U,F){const K=U;if(K<8||K>32767||V[0]!==2||V[1]!==2||V[2]&128)return new Uint8Array(V);K!==(V[2]<<8|V[3])&&l(3,"wrong scanline width");const ne=new Uint8Array(4*U*F);ne.length||l(4,"unable to allocate buffer space");let $=0,ae=0;const ge=4*K,I=new Uint8Array(4),W=new Uint8Array(ge);let ee=F;for(;ee>0&&ae<V.byteLength;){ae+4>V.byteLength&&l(1),I[0]=V[ae++],I[1]=V[ae++],I[2]=V[ae++],I[3]=V[ae++],(I[0]!=2||I[1]!=2||(I[2]<<8|I[3])!=K)&&l(3,"bad rgbe scanline format");let ye=0,_e;for(;ye<ge&&ae<V.byteLength;){_e=V[ae++];const te=_e>128;if(te&&(_e-=128),(_e===0||ye+_e>ge)&&l(3,"bad scanline data"),te){const le=V[ae++];for(let ve=0;ve<_e;ve++)W[ye++]=le}else W.set(V.subarray(ae,ae+_e),ye),ye+=_e,ae+=_e}const X=K;for(let te=0;te<X;te++){let le=0;ne[$]=W[te+le],le+=K,ne[$+1]=W[te+le],le+=K,ne[$+2]=W[te+le],le+=K,ne[$+3]=W[te+le],$+=4}ee--}return ne},b=function(V,U,F,K){const ne=V[U+3],$=Math.pow(2,ne-128)/255;F[K+0]=V[U+0]*$,F[K+1]=V[U+1]*$,F[K+2]=V[U+2]*$,F[K+3]=1},R=function(V,U,F,K){const ne=V[U+3],$=Math.pow(2,ne-128)/255;F[K+0]=wu.toHalfFloat(Math.min(V[U+0]*$,65504)),F[K+1]=wu.toHalfFloat(Math.min(V[U+1]*$,65504)),F[K+2]=wu.toHalfFloat(Math.min(V[U+2]*$,65504)),F[K+3]=wu.toHalfFloat(1)},T=new Uint8Array(e);T.pos=0;const M=y(T),w=M.width,D=M.height,N=x(T.subarray(T.pos),w,D);let H,O,z;switch(this.type){case Ci:z=N.length/4;const V=new Float32Array(z*4);for(let F=0;F<z;F++)b(N,F*4,V,F*4);H=V,O=Ci;break;case ki:z=N.length/4;const U=new Uint16Array(z*4);for(let F=0;F<z;F++)R(N,F*4,U,F*4);H=U,O=ki;break;default:throw new Error("THREE.RGBELoader: Unsupported type: "+this.type)}return{width:w,height:D,data:H,header:M.string,gamma:M.gamma,exposure:M.exposure,type:O}}setDataType(e){return this.type=e,this}load(e,t,n,i){function o(l,h){switch(l.type){case Ci:case ki:"colorSpace"in l?l.colorSpace="srgb-linear":l.encoding=3e3,l.minFilter=Cn,l.magFilter=Cn,l.generateMipmaps=!1,l.flipY=!0;break}t&&t(l,h)}return super.load(e,o,n,i)}}const em=pS>=152;class RI extends cA{constructor(e){super(e),this.type=ki}parse(e){const U=Math.pow(2.7182818,2.2);function F(G,q){for(var oe=0,Te=0;Te<65536;++Te)(Te==0||G[Te>>3]&1<<(Te&7))&&(q[oe++]=Te);for(var Le=oe-1;oe<65536;)q[oe++]=0;return Le}function K(G){for(var q=0;q<16384;q++)G[q]={},G[q].len=0,G[q].lit=0,G[q].p=null}const ne={l:0,c:0,lc:0};function $(G,q,oe,Te,Le){for(;oe<G;)q=q<<8|wt(Te,Le),oe+=8;oe-=G,ne.l=q>>oe&(1<<G)-1,ne.c=q,ne.lc=oe}const ae=new Array(59);function ge(G){for(var q=0;q<=58;++q)ae[q]=0;for(var q=0;q<65537;++q)ae[G[q]]+=1;for(var oe=0,q=58;q>0;--q){var Te=oe+ae[q]>>1;ae[q]=oe,oe=Te}for(var q=0;q<65537;++q){var Le=G[q];Le>0&&(G[q]=Le|ae[Le]++<<6)}}function I(G,q,oe,Te,Le,Ue,ct){for(var at=oe,st=0,tt=0;Le<=Ue;Le++){if(at.value-oe.value>Te)return!1;$(6,st,tt,G,at);var yt=ne.l;if(st=ne.c,tt=ne.lc,ct[Le]=yt,yt==63){if(at.value-oe.value>Te)throw"Something wrong with hufUnpackEncTable";$(8,st,tt,G,at);var dt=ne.l+6;if(st=ne.c,tt=ne.lc,Le+dt>Ue+1)throw"Something wrong with hufUnpackEncTable";for(;dt--;)ct[Le++]=0;Le--}else if(yt>=59){var dt=yt-59+2;if(Le+dt>Ue+1)throw"Something wrong with hufUnpackEncTable";for(;dt--;)ct[Le++]=0;Le--}}ge(ct)}function W(G){return G&63}function ee(G){return G>>6}function ye(G,q,oe,Te){for(;q<=oe;q++){var Le=ee(G[q]),Ue=W(G[q]);if(Le>>Ue)throw"Invalid table entry";if(Ue>14){var ct=Te[Le>>Ue-14];if(ct.len)throw"Invalid table entry";if(ct.lit++,ct.p){var at=ct.p;ct.p=new Array(ct.lit);for(var st=0;st<ct.lit-1;++st)ct.p[st]=at[st]}else ct.p=new Array(1);ct.p[ct.lit-1]=q}else if(Ue)for(var tt=0,st=1<<14-Ue;st>0;st--){var ct=Te[(Le<<14-Ue)+tt];if(ct.len||ct.p)throw"Invalid table entry";ct.len=Ue,ct.lit=q,tt++}}return!0}const _e={c:0,lc:0};function X(G,q,oe,Te){G=G<<8|wt(oe,Te),q+=8,_e.c=G,_e.lc=q}const te={c:0,lc:0};function le(G,q,oe,Te,Le,Ue,ct,at,st,tt){if(G==q){Te<8&&(X(oe,Te,Le,ct),oe=_e.c,Te=_e.lc),Te-=8;var yt=oe>>Te,yt=new Uint8Array([yt])[0];if(st.value+yt>tt)return!1;for(var dt=at[st.value-1];yt-- >0;)at[st.value++]=dt}else if(st.value<tt)at[st.value++]=G;else return!1;te.c=oe,te.lc=Te}function ve(G){return G&65535}function ze(G){var q=ve(G);return q>32767?q-65536:q}const he={a:0,b:0};function Ee(G,q){var oe=ze(G),Te=ze(q),Le=Te,Ue=oe+(Le&1)+(Le>>1),ct=Ue,at=Ue-Le;he.a=ct,he.b=at}function lt(G,q){var oe=ve(G),Te=ve(q),Le=oe-(Te>>1)&65535,Ue=Te+Le-32768&65535;he.a=Ue,he.b=Le}function Rt(G,q,oe,Te,Le,Ue,ct){for(var at=ct<16384,st=oe>Le?Le:oe,tt=1,yt;tt<=st;)tt<<=1;for(tt>>=1,yt=tt,tt>>=1;tt>=1;){for(var dt=0,k=dt+Ue*(Le-yt),ie=Ue*tt,ue=Ue*yt,pe=Te*tt,ce=Te*yt,it,ut,ht,xe;dt<=k;dt+=ue){for(var we=dt,je=dt+Te*(oe-yt);we<=je;we+=ce){var He=we+pe,Ve=we+ie,At=Ve+pe;at?(Ee(G[we+q],G[Ve+q]),it=he.a,ht=he.b,Ee(G[He+q],G[At+q]),ut=he.a,xe=he.b,Ee(it,ut),G[we+q]=he.a,G[He+q]=he.b,Ee(ht,xe),G[Ve+q]=he.a,G[At+q]=he.b):(lt(G[we+q],G[Ve+q]),it=he.a,ht=he.b,lt(G[He+q],G[At+q]),ut=he.a,xe=he.b,lt(it,ut),G[we+q]=he.a,G[He+q]=he.b,lt(ht,xe),G[Ve+q]=he.a,G[At+q]=he.b)}if(oe&tt){var Ve=we+ie;at?Ee(G[we+q],G[Ve+q]):lt(G[we+q],G[Ve+q]),it=he.a,G[Ve+q]=he.b,G[we+q]=it}}if(Le&tt)for(var we=dt,je=dt+Te*(oe-yt);we<=je;we+=ce){var He=we+pe;at?Ee(G[we+q],G[He+q]):lt(G[we+q],G[He+q]),it=he.a,G[He+q]=he.b,G[we+q]=it}yt=tt,tt>>=1}return dt}function Bt(G,q,oe,Te,Le,Ue,ct,at,st,tt){for(var yt=0,dt=0,k=at,ie=Math.trunc(Le.value+(Ue+7)/8);Le.value<ie;)for(X(yt,dt,oe,Le),yt=_e.c,dt=_e.lc;dt>=14;){var ue=yt>>dt-14&16383,pe=q[ue];if(pe.len)dt-=pe.len,le(pe.lit,ct,yt,dt,oe,Te,Le,st,tt,k),yt=te.c,dt=te.lc;else{if(!pe.p)throw"hufDecode issues";var ce;for(ce=0;ce<pe.lit;ce++){for(var it=W(G[pe.p[ce]]);dt<it&&Le.value<ie;)X(yt,dt,oe,Le),yt=_e.c,dt=_e.lc;if(dt>=it&&ee(G[pe.p[ce]])==(yt>>dt-it&(1<<it)-1)){dt-=it,le(pe.p[ce],ct,yt,dt,oe,Te,Le,st,tt,k),yt=te.c,dt=te.lc;break}}if(ce==pe.lit)throw"hufDecode issues"}}var ut=8-Ue&7;for(yt>>=ut,dt-=ut;dt>0;){var pe=q[yt<<14-dt&16383];if(pe.len)dt-=pe.len,le(pe.lit,ct,yt,dt,oe,Te,Le,st,tt,k),yt=te.c,dt=te.lc;else throw"hufDecode issues"}return!0}function tn(G,q,oe,Te,Le,Ue){var ct={value:0},at=oe.value,st=qe(q,oe),tt=qe(q,oe);oe.value+=4;var yt=qe(q,oe);if(oe.value+=4,st<0||st>=65537||tt<0||tt>=65537)throw"Something wrong with HUF_ENCSIZE";var dt=new Array(65537),k=new Array(16384);K(k);var ie=Te-(oe.value-at);if(I(G,q,oe,ie,st,tt,dt),yt>8*(Te-(oe.value-at)))throw"Something wrong with hufUncompress";ye(dt,st,tt,k),Bt(dt,k,G,q,oe,yt,tt,Ue,Le,ct)}function on(G,q,oe){for(var Te=0;Te<oe;++Te)q[Te]=G[q[Te]]}function Wt(G){for(var q=1;q<G.length;q++){var oe=G[q-1]+G[q]-128;G[q]=oe}}function Ge(G,q){for(var oe=0,Te=Math.floor((G.length+1)/2),Le=0,Ue=G.length-1;!(Le>Ue||(q[Le++]=G[oe++],Le>Ue));)q[Le++]=G[Te++]}function et(G){for(var q=G.byteLength,oe=new Array,Te=0,Le=new DataView(G);q>0;){var Ue=Le.getInt8(Te++);if(Ue<0){var ct=-Ue;q-=ct+1;for(var at=0;at<ct;at++)oe.push(Le.getUint8(Te++))}else{var ct=Ue;q-=2;for(var st=Le.getUint8(Te++),at=0;at<ct+1;at++)oe.push(st)}}return oe}function Je(G,q,oe,Te,Le,Ue){var He=new DataView(Ue.buffer),ct=oe[G.idx[0]].width,at=oe[G.idx[0]].height,st=3,tt=Math.floor(ct/8),yt=Math.ceil(ct/8),dt=Math.ceil(at/8),k=ct-(yt-1)*8,ie=at-(dt-1)*8,ue={value:0},pe=new Array(st),ce=new Array(st),it=new Array(st),ut=new Array(st),ht=new Array(st);for(let Tt=0;Tt<st;++Tt)ht[Tt]=q[G.idx[Tt]],pe[Tt]=Tt<1?0:pe[Tt-1]+yt*dt,ce[Tt]=new Float32Array(64),it[Tt]=new Uint16Array(64),ut[Tt]=new Uint16Array(yt*64);for(let Tt=0;Tt<dt;++Tt){var xe=8;Tt==dt-1&&(xe=ie);var we=8;for(let Nt=0;Nt<yt;++Nt){Nt==yt-1&&(we=k);for(let vt=0;vt<st;++vt)it[vt].fill(0),it[vt][0]=Le[pe[vt]++],xt(ue,Te,it[vt]),Q(it[vt],ce[vt]),Dt(ce[vt]);mt(ce);for(let vt=0;vt<st;++vt)Ot(ce[vt],ut[vt],Nt*64)}let ft=0;for(let Nt=0;Nt<st;++Nt){const vt=oe[G.idx[Nt]].type;for(let un=8*Tt;un<8*Tt+xe;++un){ft=ht[Nt][un];for(let Wn=0;Wn<tt;++Wn){const an=Wn*64+(un&7)*8;He.setUint16(ft+0*vt,ut[Nt][an+0],!0),He.setUint16(ft+2*vt,ut[Nt][an+1],!0),He.setUint16(ft+4*vt,ut[Nt][an+2],!0),He.setUint16(ft+6*vt,ut[Nt][an+3],!0),He.setUint16(ft+8*vt,ut[Nt][an+4],!0),He.setUint16(ft+10*vt,ut[Nt][an+5],!0),He.setUint16(ft+12*vt,ut[Nt][an+6],!0),He.setUint16(ft+14*vt,ut[Nt][an+7],!0),ft+=16*vt}}if(tt!=yt)for(let un=8*Tt;un<8*Tt+xe;++un){const Wn=ht[Nt][un]+8*tt*2*vt,an=tt*64+(un&7)*8;for(let Xn=0;Xn<we;++Xn)He.setUint16(Wn+Xn*2*vt,ut[Nt][an+Xn],!0)}}}for(var je=new Uint16Array(ct),He=new DataView(Ue.buffer),Ve=0;Ve<st;++Ve){oe[G.idx[Ve]].decoded=!0;var At=oe[G.idx[Ve]].type;if(oe[Ve].type==2)for(var Yt=0;Yt<at;++Yt){const Tt=ht[Ve][Yt];for(var Jt=0;Jt<ct;++Jt)je[Jt]=He.getUint16(Tt+Jt*2*At,!0);for(var Jt=0;Jt<ct;++Jt)He.setFloat32(Tt+Jt*2*At,Ne(je[Jt]),!0)}}}function xt(G,q,oe){for(var Te,Le=1;Le<64;)Te=q[G.value],Te==65280?Le=64:Te>>8==255?Le+=Te&255:(oe[Le]=Te,Le++),G.value++}function Q(G,q){q[0]=Ne(G[0]),q[1]=Ne(G[1]),q[2]=Ne(G[5]),q[3]=Ne(G[6]),q[4]=Ne(G[14]),q[5]=Ne(G[15]),q[6]=Ne(G[27]),q[7]=Ne(G[28]),q[8]=Ne(G[2]),q[9]=Ne(G[4]),q[10]=Ne(G[7]),q[11]=Ne(G[13]),q[12]=Ne(G[16]),q[13]=Ne(G[26]),q[14]=Ne(G[29]),q[15]=Ne(G[42]),q[16]=Ne(G[3]),q[17]=Ne(G[8]),q[18]=Ne(G[12]),q[19]=Ne(G[17]),q[20]=Ne(G[25]),q[21]=Ne(G[30]),q[22]=Ne(G[41]),q[23]=Ne(G[43]),q[24]=Ne(G[9]),q[25]=Ne(G[11]),q[26]=Ne(G[18]),q[27]=Ne(G[24]),q[28]=Ne(G[31]),q[29]=Ne(G[40]),q[30]=Ne(G[44]),q[31]=Ne(G[53]),q[32]=Ne(G[10]),q[33]=Ne(G[19]),q[34]=Ne(G[23]),q[35]=Ne(G[32]),q[36]=Ne(G[39]),q[37]=Ne(G[45]),q[38]=Ne(G[52]),q[39]=Ne(G[54]),q[40]=Ne(G[20]),q[41]=Ne(G[22]),q[42]=Ne(G[33]),q[43]=Ne(G[38]),q[44]=Ne(G[46]),q[45]=Ne(G[51]),q[46]=Ne(G[55]),q[47]=Ne(G[60]),q[48]=Ne(G[21]),q[49]=Ne(G[34]),q[50]=Ne(G[37]),q[51]=Ne(G[47]),q[52]=Ne(G[50]),q[53]=Ne(G[56]),q[54]=Ne(G[59]),q[55]=Ne(G[61]),q[56]=Ne(G[35]),q[57]=Ne(G[36]),q[58]=Ne(G[48]),q[59]=Ne(G[49]),q[60]=Ne(G[57]),q[61]=Ne(G[58]),q[62]=Ne(G[62]),q[63]=Ne(G[63])}function Dt(G){const q=.5*Math.cos(.7853975),oe=.5*Math.cos(3.14159/16),Te=.5*Math.cos(3.14159/8),Le=.5*Math.cos(3*3.14159/16),Ue=.5*Math.cos(5*3.14159/16),ct=.5*Math.cos(3*3.14159/8),at=.5*Math.cos(7*3.14159/16);for(var st=new Array(4),tt=new Array(4),yt=new Array(4),dt=new Array(4),k=0;k<8;++k){var ie=k*8;st[0]=Te*G[ie+2],st[1]=ct*G[ie+2],st[2]=Te*G[ie+6],st[3]=ct*G[ie+6],tt[0]=oe*G[ie+1]+Le*G[ie+3]+Ue*G[ie+5]+at*G[ie+7],tt[1]=Le*G[ie+1]-at*G[ie+3]-oe*G[ie+5]-Ue*G[ie+7],tt[2]=Ue*G[ie+1]-oe*G[ie+3]+at*G[ie+5]+Le*G[ie+7],tt[3]=at*G[ie+1]-Ue*G[ie+3]+Le*G[ie+5]-oe*G[ie+7],yt[0]=q*(G[ie+0]+G[ie+4]),yt[3]=q*(G[ie+0]-G[ie+4]),yt[1]=st[0]+st[3],yt[2]=st[1]-st[2],dt[0]=yt[0]+yt[1],dt[1]=yt[3]+yt[2],dt[2]=yt[3]-yt[2],dt[3]=yt[0]-yt[1],G[ie+0]=dt[0]+tt[0],G[ie+1]=dt[1]+tt[1],G[ie+2]=dt[2]+tt[2],G[ie+3]=dt[3]+tt[3],G[ie+4]=dt[3]-tt[3],G[ie+5]=dt[2]-tt[2],G[ie+6]=dt[1]-tt[1],G[ie+7]=dt[0]-tt[0]}for(var ue=0;ue<8;++ue)st[0]=Te*G[16+ue],st[1]=ct*G[16+ue],st[2]=Te*G[48+ue],st[3]=ct*G[48+ue],tt[0]=oe*G[8+ue]+Le*G[24+ue]+Ue*G[40+ue]+at*G[56+ue],tt[1]=Le*G[8+ue]-at*G[24+ue]-oe*G[40+ue]-Ue*G[56+ue],tt[2]=Ue*G[8+ue]-oe*G[24+ue]+at*G[40+ue]+Le*G[56+ue],tt[3]=at*G[8+ue]-Ue*G[24+ue]+Le*G[40+ue]-oe*G[56+ue],yt[0]=q*(G[ue]+G[32+ue]),yt[3]=q*(G[ue]-G[32+ue]),yt[1]=st[0]+st[3],yt[2]=st[1]-st[2],dt[0]=yt[0]+yt[1],dt[1]=yt[3]+yt[2],dt[2]=yt[3]-yt[2],dt[3]=yt[0]-yt[1],G[0+ue]=dt[0]+tt[0],G[8+ue]=dt[1]+tt[1],G[16+ue]=dt[2]+tt[2],G[24+ue]=dt[3]+tt[3],G[32+ue]=dt[3]-tt[3],G[40+ue]=dt[2]-tt[2],G[48+ue]=dt[1]-tt[1],G[56+ue]=dt[0]-tt[0]}function mt(G){for(var q=0;q<64;++q){var oe=G[0][q],Te=G[1][q],Le=G[2][q];G[0][q]=oe+1.5747*Le,G[1][q]=oe-.1873*Te-.4682*Le,G[2][q]=oe+1.8556*Te}}function Ot(G,q,oe){for(var Te=0;Te<64;++Te)q[oe+Te]=wu.toHalfFloat(gt(G[Te]))}function gt(G){return G<=1?Math.sign(G)*Math.pow(Math.abs(G),2.2):Math.sign(G)*Math.pow(U,Math.abs(G)-1)}function j(G){return new DataView(G.array.buffer,G.offset.value,G.size)}function P(G){var q=G.viewer.buffer.slice(G.offset.value,G.offset.value+G.size),oe=new Uint8Array(et(q)),Te=new Uint8Array(oe.length);return Wt(oe),Ge(oe,Te),new DataView(Te.buffer)}function de(G){var q=G.array.slice(G.offset.value,G.offset.value+G.size),oe=c_(q),Te=new Uint8Array(oe.length);return Wt(oe),Ge(oe,Te),new DataView(Te.buffer)}function Fe(G){for(var q=G.viewer,oe={value:G.offset.value},Te=new Uint16Array(G.width*G.scanlineBlockSize*(G.channels*G.type)),Le=new Uint8Array(8192),Ue=0,ct=new Array(G.channels),at=0;at<G.channels;at++)ct[at]={},ct[at].start=Ue,ct[at].end=ct[at].start,ct[at].nx=G.width,ct[at].ny=G.lines,ct[at].size=G.type,Ue+=ct[at].nx*ct[at].ny*ct[at].size;var st=ot(q,oe),tt=ot(q,oe);if(tt>=8192)throw"Something is wrong with PIZ_COMPRESSION BITMAP_SIZE";if(st<=tt)for(var at=0;at<tt-st+1;at++)Le[at+st]=bt(q,oe);var yt=new Uint16Array(65536),dt=F(Le,yt),k=qe(q,oe);tn(G.array,q,oe,k,Te,Ue);for(var at=0;at<G.channels;++at)for(var ie=ct[at],ue=0;ue<ct[at].size;++ue)Rt(Te,ie.start+ue,ie.nx,ie.size,ie.ny,ie.nx*ie.size,dt);on(yt,Te,Ue);for(var pe=0,ce=new Uint8Array(Te.buffer.byteLength),it=0;it<G.lines;it++)for(var ut=0;ut<G.channels;ut++){var ie=ct[ut],ht=ie.nx*ie.size,xe=new Uint8Array(Te.buffer,ie.end*2,ht*2);ce.set(xe,pe),pe+=ht*2,ie.end+=ht}return new DataView(ce.buffer)}function ke(G){var q=G.array.slice(G.offset.value,G.offset.value+G.size),oe=c_(q);const Te=G.lines*G.channels*G.width,Le=G.type==1?new Uint16Array(Te):new Uint32Array(Te);let Ue=0,ct=0;const at=new Array(4);for(let st=0;st<G.lines;st++)for(let tt=0;tt<G.channels;tt++){let yt=0;switch(G.type){case 1:at[0]=Ue,at[1]=at[0]+G.width,Ue=at[1]+G.width;for(let dt=0;dt<G.width;++dt){const k=oe[at[0]++]<<8|oe[at[1]++];yt+=k,Le[ct]=yt,ct++}break;case 2:at[0]=Ue,at[1]=at[0]+G.width,at[2]=at[1]+G.width,Ue=at[2]+G.width;for(let dt=0;dt<G.width;++dt){const k=oe[at[0]++]<<24|oe[at[1]++]<<16|oe[at[2]++]<<8;yt+=k,Le[ct]=yt,ct++}break}}return new DataView(Le.buffer)}function Ie(G){var q=G.viewer,oe={value:G.offset.value},Te=new Uint8Array(G.width*G.lines*(G.channels*G.type*2)),Le={version:rt(q,oe),unknownUncompressedSize:rt(q,oe),unknownCompressedSize:rt(q,oe),acCompressedSize:rt(q,oe),dcCompressedSize:rt(q,oe),rleCompressedSize:rt(q,oe),rleUncompressedSize:rt(q,oe),rleRawSize:rt(q,oe),totalAcUncompressedCount:rt(q,oe),totalDcUncompressedCount:rt(q,oe),acCompression:rt(q,oe)};if(Le.version<2)throw"EXRLoader.parse: "+wi.compression+" version "+Le.version+" is unsupported";for(var Ue=new Array,ct=ot(q,oe)-2;ct>0;){var at=Ft(q.buffer,oe),st=bt(q,oe),tt=st>>2&3,yt=(st>>4)-1,dt=new Int8Array([yt])[0],k=bt(q,oe);Ue.push({name:at,index:dt,type:k,compression:tt}),ct-=at.length+3}for(var ie=wi.channels,ue=new Array(G.channels),pe=0;pe<G.channels;++pe){var ce=ue[pe]={},it=ie[pe];ce.name=it.name,ce.compression=0,ce.decoded=!1,ce.type=it.pixelType,ce.pLinear=it.pLinear,ce.width=G.width,ce.height=G.lines}for(var ut={idx:new Array(3)},ht=0;ht<G.channels;++ht)for(var ce=ue[ht],pe=0;pe<Ue.length;++pe){var xe=Ue[pe];ce.name==xe.name&&(ce.compression=xe.compression,xe.index>=0&&(ut.idx[xe.index]=ht),ce.offset=ht)}if(Le.acCompressedSize>0)switch(Le.acCompression){case 0:var He=new Uint16Array(Le.totalAcUncompressedCount);tn(G.array,q,oe,Le.acCompressedSize,He,Le.totalAcUncompressedCount);break;case 1:var we=G.array.slice(oe.value,oe.value+Le.totalAcUncompressedCount),je=c_(we),He=new Uint16Array(je.buffer);oe.value+=Le.totalAcUncompressedCount;break}if(Le.dcCompressedSize>0){var Ve={array:G.array,offset:oe,size:Le.dcCompressedSize},At=new Uint16Array(de(Ve).buffer);oe.value+=Le.dcCompressedSize}if(Le.rleRawSize>0){var we=G.array.slice(oe.value,oe.value+Le.rleCompressedSize),je=c_(we),Yt=et(je.buffer);oe.value+=Le.rleCompressedSize}for(var Jt=0,Tt=new Array(ue.length),pe=0;pe<Tt.length;++pe)Tt[pe]=new Array;for(var ft=0;ft<G.lines;++ft)for(var Nt=0;Nt<ue.length;++Nt)Tt[Nt].push(Jt),Jt+=ue[Nt].width*G.type*2;Je(ut,Tt,ue,He,At,Te);for(var pe=0;pe<ue.length;++pe){var ce=ue[pe];if(!ce.decoded)switch(ce.compression){case 2:for(var vt=0,un=0,ft=0;ft<G.lines;++ft){for(var Wn=Tt[pe][vt],an=0;an<ce.width;++an){for(var Xn=0;Xn<2*ce.type;++Xn)Te[Wn++]=Yt[un+Xn*ce.width*ce.height];un++}vt++}break;default:throw"EXRLoader.parse: unsupported channel compression"}}return new DataView(Te.buffer)}function Ft(G,q){for(var oe=new Uint8Array(G),Te=0;oe[q.value+Te]!=0;)Te+=1;var Le=new TextDecoder().decode(oe.slice(q.value,q.value+Te));return q.value=q.value+Te+1,Le}function Mt(G,q,oe){var Te=new TextDecoder().decode(new Uint8Array(G).slice(q.value,q.value+oe));return q.value=q.value+oe,Te}function Ht(G,q){var oe=Ye(G,q),Te=qe(G,q);return[oe,Te]}function zt(G,q){var oe=qe(G,q),Te=qe(G,q);return[oe,Te]}function Ye(G,q){var oe=G.getInt32(q.value,!0);return q.value=q.value+4,oe}function qe(G,q){var oe=G.getUint32(q.value,!0);return q.value=q.value+4,oe}function wt(G,q){var oe=G[q.value];return q.value=q.value+1,oe}function bt(G,q){var oe=G.getUint8(q.value);return q.value=q.value+1,oe}const rt=function(G,q){let oe;return"getBigInt64"in DataView.prototype?oe=Number(G.getBigInt64(q.value,!0)):oe=G.getUint32(q.value+4,!0)+Number(G.getUint32(q.value,!0)<<32),q.value+=8,oe};function Vt(G,q){var oe=G.getFloat32(q.value,!0);return q.value+=4,oe}function fe(G,q){return wu.toHalfFloat(Vt(G,q))}function Ne(G){var q=(G&31744)>>10,oe=G&1023;return(G>>15?-1:1)*(q?q===31?oe?NaN:1/0:Math.pow(2,q-15)*(1+oe/1024):6103515625e-14*(oe/1024))}function ot(G,q){var oe=G.getUint16(q.value,!0);return q.value+=2,oe}function Et(G,q){return Ne(ot(G,q))}function Qe(G,q,oe,Te){for(var Le=oe.value,Ue=[];oe.value<Le+Te-1;){var ct=Ft(q,oe),at=Ye(G,oe),st=bt(G,oe);oe.value+=3;var tt=Ye(G,oe),yt=Ye(G,oe);Ue.push({name:ct,pixelType:at,pLinear:st,xSampling:tt,ySampling:yt})}return oe.value+=1,Ue}function We(G,q){var oe=Vt(G,q),Te=Vt(G,q),Le=Vt(G,q),Ue=Vt(G,q),ct=Vt(G,q),at=Vt(G,q),st=Vt(G,q),tt=Vt(G,q);return{redX:oe,redY:Te,greenX:Le,greenY:Ue,blueX:ct,blueY:at,whiteX:st,whiteY:tt}}function _t(G,q){var oe=["NO_COMPRESSION","RLE_COMPRESSION","ZIPS_COMPRESSION","ZIP_COMPRESSION","PIZ_COMPRESSION","PXR24_COMPRESSION","B44_COMPRESSION","B44A_COMPRESSION","DWAA_COMPRESSION","DWAB_COMPRESSION"],Te=bt(G,q);return oe[Te]}function nn(G,q){var oe=qe(G,q),Te=qe(G,q),Le=qe(G,q),Ue=qe(G,q);return{xMin:oe,yMin:Te,xMax:Le,yMax:Ue}}function wn(G,q){var oe=["INCREASING_Y"],Te=bt(G,q);return oe[Te]}function Mn(G,q){var oe=Vt(G,q),Te=Vt(G,q);return[oe,Te]}function Fi(G,q){var oe=Vt(G,q),Te=Vt(G,q),Le=Vt(G,q);return[oe,Te,Le]}function va(G,q,oe,Te,Le){if(Te==="string"||Te==="stringvector"||Te==="iccProfile")return Mt(q,oe,Le);if(Te==="chlist")return Qe(G,q,oe,Le);if(Te==="chromaticities")return We(G,oe);if(Te==="compression")return _t(G,oe);if(Te==="box2i")return nn(G,oe);if(Te==="lineOrder")return wn(G,oe);if(Te==="float")return Vt(G,oe);if(Te==="v2f")return Mn(G,oe);if(Te==="v3f")return Fi(G,oe);if(Te==="int")return Ye(G,oe);if(Te==="rational")return Ht(G,oe);if(Te==="timecode")return zt(G,oe);if(Te==="preview")return oe.value+=Le,"skipped";oe.value+=Le}function br(G,q,oe){const Te={};if(G.getUint32(0,!0)!=20000630)throw"THREE.EXRLoader: provided file doesn't appear to be in OpenEXR format.";Te.version=G.getUint8(4);const Le=G.getUint8(5);Te.spec={singleTile:!!(Le&2),longName:!!(Le&4),deepFormat:!!(Le&8),multiPart:!!(Le&16)},oe.value=8;for(var Ue=!0;Ue;){var ct=Ft(q,oe);if(ct==0)Ue=!1;else{var at=Ft(q,oe),st=qe(G,oe),tt=va(G,q,oe,at,st);tt===void 0?console.warn(`EXRLoader.parse: skipped unknown header attribute type '${at}'.`):Te[ct]=tt}}if((Le&-5)!=0)throw console.error("EXRHeader:",Te),"THREE.EXRLoader: provided file is currently unsupported.";return Te}function ir(G,q,oe,Te,Le){const Ue={size:0,viewer:q,array:oe,offset:Te,width:G.dataWindow.xMax-G.dataWindow.xMin+1,height:G.dataWindow.yMax-G.dataWindow.yMin+1,channels:G.channels.length,bytesPerLine:null,lines:null,inputSize:null,type:G.channels[0].pixelType,uncompress:null,getter:null,format:null,[em?"colorSpace":"encoding"]:null};switch(G.compression){case"NO_COMPRESSION":Ue.lines=1,Ue.uncompress=j;break;case"RLE_COMPRESSION":Ue.lines=1,Ue.uncompress=P;break;case"ZIPS_COMPRESSION":Ue.lines=1,Ue.uncompress=de;break;case"ZIP_COMPRESSION":Ue.lines=16,Ue.uncompress=de;break;case"PIZ_COMPRESSION":Ue.lines=32,Ue.uncompress=Fe;break;case"PXR24_COMPRESSION":Ue.lines=16,Ue.uncompress=ke;break;case"DWAA_COMPRESSION":Ue.lines=32,Ue.uncompress=Ie;break;case"DWAB_COMPRESSION":Ue.lines=256,Ue.uncompress=Ie;break;default:throw"EXRLoader.parse: "+G.compression+" is unsupported"}if(Ue.scanlineBlockSize=Ue.lines,Ue.type==1)switch(Le){case Ci:Ue.getter=Et,Ue.inputSize=2;break;case ki:Ue.getter=ot,Ue.inputSize=2;break}else if(Ue.type==2)switch(Le){case Ci:Ue.getter=Vt,Ue.inputSize=4;break;case ki:Ue.getter=fe,Ue.inputSize=4}else throw"EXRLoader.parse: unsupported pixelType "+Ue.type+" for "+G.compression+".";Ue.blockCount=(G.dataWindow.yMax+1)/Ue.scanlineBlockSize;for(var ct=0;ct<Ue.blockCount;ct++)rt(q,Te);Ue.outputChannels=Ue.channels==3?4:Ue.channels;const at=Ue.width*Ue.height*Ue.outputChannels;switch(Le){case Ci:Ue.byteArray=new Float32Array(at),Ue.channels<Ue.outputChannels&&Ue.byteArray.fill(1,0,at);break;case ki:Ue.byteArray=new Uint16Array(at),Ue.channels<Ue.outputChannels&&Ue.byteArray.fill(15360,0,at);break;default:console.error("THREE.EXRLoader: unsupported type: ",Le);break}return Ue.bytesPerLine=Ue.width*Ue.inputSize*Ue.channels,Ue.outputChannels==4?Ue.format=Zi:Ue.format=ip,em?Ue.colorSpace="srgb-linear":Ue.encoding=3e3,Ue}const _a=new DataView(e),sa=new Uint8Array(e),Da={value:0},wi=br(_a,e,Da),kt=ir(wi,_a,sa,Da,this.type),Ai={value:0},mn={R:0,G:1,B:2,A:3,Y:0};for(let G=0;G<kt.height/kt.scanlineBlockSize;G++){const q=qe(_a,Da);kt.size=qe(_a,Da),kt.lines=q+kt.scanlineBlockSize>kt.height?kt.height-q:kt.scanlineBlockSize;const Te=kt.size<kt.lines*kt.bytesPerLine?kt.uncompress(kt):j(kt);Da.value+=kt.size;for(let Le=0;Le<kt.scanlineBlockSize;Le++){const Ue=Le+G*kt.scanlineBlockSize;if(Ue>=kt.height)break;for(let ct=0;ct<kt.channels;ct++){const at=mn[wi.channels[ct].name];for(let st=0;st<kt.width;st++){Ai.value=(Le*(kt.channels*kt.width)+ct*kt.width+st)*kt.inputSize;const tt=(kt.height-1-Ue)*(kt.width*kt.outputChannels)+st*kt.outputChannels+at;kt.byteArray[tt]=kt.getter(Te,Ai)}}}}return{header:wi,width:kt.width,height:kt.height,data:kt.byteArray,format:kt.format,[em?"colorSpace":"encoding"]:kt[em?"colorSpace":"encoding"],type:this.type}}setDataType(e){return this.type=e,this}load(e,t,n,i){function o(l,h){em?l.colorSpace=h.colorSpace:l.encoding=h.encoding,l.minFilter=Cn,l.magFilter=Cn,l.generateMipmaps=!1,l.flipY=!1,t&&t(l,h)}return super.load(e,o,n,i)}}const ES=new WeakMap;class wI extends Ba{constructor(e){super(e),this.decoderPath="",this.decoderConfig={},this.decoderBinary=null,this.decoderPending=null,this.workerLimit=4,this.workerPool=[],this.workerNextTaskID=1,this.workerSourceURL="",this.defaultAttributeIDs={position:"POSITION",normal:"NORMAL",color:"COLOR",uv:"TEX_COORD"},this.defaultAttributeTypes={position:"Float32Array",normal:"Float32Array",color:"Float32Array",uv:"Float32Array"}}setDecoderPath(e){return this.decoderPath=e,this}setDecoderConfig(e){return this.decoderConfig=e,this}setWorkerLimit(e){return this.workerLimit=e,this}load(e,t,n,i){const o=new da(this.manager);o.setPath(this.path),o.setResponseType("arraybuffer"),o.setRequestHeader(this.requestHeader),o.setWithCredentials(this.withCredentials),o.load(e,l=>{const h={attributeIDs:this.defaultAttributeIDs,attributeTypes:this.defaultAttributeTypes,useUniqueIDs:!1};this.decodeGeometry(l,h).then(t).catch(i)},n,i)}decodeDracoFile(e,t,n,i){const o={attributeIDs:n||this.defaultAttributeIDs,attributeTypes:i||this.defaultAttributeTypes,useUniqueIDs:!!n};this.decodeGeometry(e,o).then(t)}decodeGeometry(e,t){for(const d in t.attributeTypes){const p=t.attributeTypes[d];p.BYTES_PER_ELEMENT!==void 0&&(t.attributeTypes[d]=p.name)}const n=JSON.stringify(t);if(ES.has(e)){const d=ES.get(e);if(d.key===n)return d.promise;if(e.byteLength===0)throw new Error("THREE.DRACOLoader: Unable to re-decode a buffer with different settings. Buffer has already been transferred.")}let i;const o=this.workerNextTaskID++,l=e.byteLength,h=this._getWorker(o,l).then(d=>(i=d,new Promise((p,_)=>{i._callbacks[o]={resolve:p,reject:_},i.postMessage({type:"decode",id:o,taskConfig:t,buffer:e},[e])}))).then(d=>this._createGeometry(d.geometry));return h.catch(()=>!0).then(()=>{i&&o&&this._releaseTask(i,o)}),ES.set(e,{key:n,promise:h}),h}_createGeometry(e){const t=new pn;e.index&&t.setIndex(new Hn(e.index.array,1));for(let n=0;n<e.attributes.length;n++){const i=e.attributes[n],o=i.name,l=i.array,h=i.itemSize;t.setAttribute(o,new Hn(l,h))}return t}_loadLibrary(e,t){const n=new da(this.manager);return n.setPath(this.decoderPath),n.setResponseType(t),n.setWithCredentials(this.withCredentials),new Promise((i,o)=>{n.load(e,i,void 0,o)})}preload(){return this._initDecoder(),this}_initDecoder(){if(this.decoderPending)return this.decoderPending;const e=typeof WebAssembly!="object"||this.decoderConfig.type==="js",t=[];return e?t.push(this._loadLibrary("draco_decoder.js","text")):(t.push(this._loadLibrary("draco_wasm_wrapper.js","text")),t.push(this._loadLibrary("draco_decoder.wasm","arraybuffer"))),this.decoderPending=Promise.all(t).then(n=>{const i=n[0];e||(this.decoderConfig.wasmBinary=n[1]);const o=BI.toString(),l=["/* draco decoder */",i,"","/* worker */",o.substring(o.indexOf("{")+1,o.lastIndexOf("}"))].join(`
|
|
4115
|
+
`;continue}if((I=ge.match(F))&&(ae.gamma=parseFloat(I[1])),(I=ge.match(K))&&(ae.exposure=parseFloat(I[1])),(I=ge.match(ne))&&(ae.valid|=2,ae.format=I[1]),(I=ge.match($))&&(ae.valid|=4,ae.height=parseInt(I[1],10),ae.width=parseInt(I[2],10)),ae.valid&2&&ae.valid&4)break}return ae.valid&2||l(3,"missing format specifier"),ae.valid&4||l(3,"missing image size specifier"),ae},x=function(V,U,F){const K=U;if(K<8||K>32767||V[0]!==2||V[1]!==2||V[2]&128)return new Uint8Array(V);K!==(V[2]<<8|V[3])&&l(3,"wrong scanline width");const ne=new Uint8Array(4*U*F);ne.length||l(4,"unable to allocate buffer space");let $=0,ae=0;const ge=4*K,I=new Uint8Array(4),W=new Uint8Array(ge);let ee=F;for(;ee>0&&ae<V.byteLength;){ae+4>V.byteLength&&l(1),I[0]=V[ae++],I[1]=V[ae++],I[2]=V[ae++],I[3]=V[ae++],(I[0]!=2||I[1]!=2||(I[2]<<8|I[3])!=K)&&l(3,"bad rgbe scanline format");let ye=0,_e;for(;ye<ge&&ae<V.byteLength;){_e=V[ae++];const te=_e>128;if(te&&(_e-=128),(_e===0||ye+_e>ge)&&l(3,"bad scanline data"),te){const le=V[ae++];for(let ve=0;ve<_e;ve++)W[ye++]=le}else W.set(V.subarray(ae,ae+_e),ye),ye+=_e,ae+=_e}const X=K;for(let te=0;te<X;te++){let le=0;ne[$]=W[te+le],le+=K,ne[$+1]=W[te+le],le+=K,ne[$+2]=W[te+le],le+=K,ne[$+3]=W[te+le],$+=4}ee--}return ne},b=function(V,U,F,K){const ne=V[U+3],$=Math.pow(2,ne-128)/255;F[K+0]=V[U+0]*$,F[K+1]=V[U+1]*$,F[K+2]=V[U+2]*$,F[K+3]=1},R=function(V,U,F,K){const ne=V[U+3],$=Math.pow(2,ne-128)/255;F[K+0]=wu.toHalfFloat(Math.min(V[U+0]*$,65504)),F[K+1]=wu.toHalfFloat(Math.min(V[U+1]*$,65504)),F[K+2]=wu.toHalfFloat(Math.min(V[U+2]*$,65504)),F[K+3]=wu.toHalfFloat(1)},T=new Uint8Array(e);T.pos=0;const M=y(T),w=M.width,D=M.height,N=x(T.subarray(T.pos),w,D);let H,O,z;switch(this.type){case Ci:z=N.length/4;const V=new Float32Array(z*4);for(let F=0;F<z;F++)b(N,F*4,V,F*4);H=V,O=Ci;break;case ki:z=N.length/4;const U=new Uint16Array(z*4);for(let F=0;F<z;F++)R(N,F*4,U,F*4);H=U,O=ki;break;default:throw new Error("THREE.RGBELoader: Unsupported type: "+this.type)}return{width:w,height:D,data:H,header:M.string,gamma:M.gamma,exposure:M.exposure,type:O}}setDataType(e){return this.type=e,this}load(e,t,n,i){function o(l,h){switch(l.type){case Ci:case ki:"colorSpace"in l?l.colorSpace="srgb-linear":l.encoding=3e3,l.minFilter=Cn,l.magFilter=Cn,l.generateMipmaps=!1,l.flipY=!0;break}t&&t(l,h)}return super.load(e,o,n,i)}}const em=pS>=152;class RI extends cA{constructor(e){super(e),this.type=ki}parse(e){const U=Math.pow(2.7182818,2.2);function F(G,q){for(var oe=0,Te=0;Te<65536;++Te)(Te==0||G[Te>>3]&1<<(Te&7))&&(q[oe++]=Te);for(var Le=oe-1;oe<65536;)q[oe++]=0;return Le}function K(G){for(var q=0;q<16384;q++)G[q]={},G[q].len=0,G[q].lit=0,G[q].p=null}const ne={l:0,c:0,lc:0};function $(G,q,oe,Te,Le){for(;oe<G;)q=q<<8|wt(Te,Le),oe+=8;oe-=G,ne.l=q>>oe&(1<<G)-1,ne.c=q,ne.lc=oe}const ae=new Array(59);function ge(G){for(var q=0;q<=58;++q)ae[q]=0;for(var q=0;q<65537;++q)ae[G[q]]+=1;for(var oe=0,q=58;q>0;--q){var Te=oe+ae[q]>>1;ae[q]=oe,oe=Te}for(var q=0;q<65537;++q){var Le=G[q];Le>0&&(G[q]=Le|ae[Le]++<<6)}}function I(G,q,oe,Te,Le,Ue,ct){for(var at=oe,st=0,tt=0;Le<=Ue;Le++){if(at.value-oe.value>Te)return!1;$(6,st,tt,G,at);var yt=ne.l;if(st=ne.c,tt=ne.lc,ct[Le]=yt,yt==63){if(at.value-oe.value>Te)throw"Something wrong with hufUnpackEncTable";$(8,st,tt,G,at);var dt=ne.l+6;if(st=ne.c,tt=ne.lc,Le+dt>Ue+1)throw"Something wrong with hufUnpackEncTable";for(;dt--;)ct[Le++]=0;Le--}else if(yt>=59){var dt=yt-59+2;if(Le+dt>Ue+1)throw"Something wrong with hufUnpackEncTable";for(;dt--;)ct[Le++]=0;Le--}}ge(ct)}function W(G){return G&63}function ee(G){return G>>6}function ye(G,q,oe,Te){for(;q<=oe;q++){var Le=ee(G[q]),Ue=W(G[q]);if(Le>>Ue)throw"Invalid table entry";if(Ue>14){var ct=Te[Le>>Ue-14];if(ct.len)throw"Invalid table entry";if(ct.lit++,ct.p){var at=ct.p;ct.p=new Array(ct.lit);for(var st=0;st<ct.lit-1;++st)ct.p[st]=at[st]}else ct.p=new Array(1);ct.p[ct.lit-1]=q}else if(Ue)for(var tt=0,st=1<<14-Ue;st>0;st--){var ct=Te[(Le<<14-Ue)+tt];if(ct.len||ct.p)throw"Invalid table entry";ct.len=Ue,ct.lit=q,tt++}}return!0}const _e={c:0,lc:0};function X(G,q,oe,Te){G=G<<8|wt(oe,Te),q+=8,_e.c=G,_e.lc=q}const te={c:0,lc:0};function le(G,q,oe,Te,Le,Ue,ct,at,st,tt){if(G==q){Te<8&&(X(oe,Te,Le,ct),oe=_e.c,Te=_e.lc),Te-=8;var yt=oe>>Te,yt=new Uint8Array([yt])[0];if(st.value+yt>tt)return!1;for(var dt=at[st.value-1];yt-- >0;)at[st.value++]=dt}else if(st.value<tt)at[st.value++]=G;else return!1;te.c=oe,te.lc=Te}function ve(G){return G&65535}function ze(G){var q=ve(G);return q>32767?q-65536:q}const he={a:0,b:0};function Ee(G,q){var oe=ze(G),Te=ze(q),Le=Te,Ue=oe+(Le&1)+(Le>>1),ct=Ue,at=Ue-Le;he.a=ct,he.b=at}function lt(G,q){var oe=ve(G),Te=ve(q),Le=oe-(Te>>1)&65535,Ue=Te+Le-32768&65535;he.a=Ue,he.b=Le}function Rt(G,q,oe,Te,Le,Ue,ct){for(var at=ct<16384,st=oe>Le?Le:oe,tt=1,yt;tt<=st;)tt<<=1;for(tt>>=1,yt=tt,tt>>=1;tt>=1;){for(var dt=0,k=dt+Ue*(Le-yt),ie=Ue*tt,ue=Ue*yt,pe=Te*tt,ce=Te*yt,it,ut,ht,xe;dt<=k;dt+=ue){for(var we=dt,je=dt+Te*(oe-yt);we<=je;we+=ce){var He=we+pe,Ve=we+ie,At=Ve+pe;at?(Ee(G[we+q],G[Ve+q]),it=he.a,ht=he.b,Ee(G[He+q],G[At+q]),ut=he.a,xe=he.b,Ee(it,ut),G[we+q]=he.a,G[He+q]=he.b,Ee(ht,xe),G[Ve+q]=he.a,G[At+q]=he.b):(lt(G[we+q],G[Ve+q]),it=he.a,ht=he.b,lt(G[He+q],G[At+q]),ut=he.a,xe=he.b,lt(it,ut),G[we+q]=he.a,G[He+q]=he.b,lt(ht,xe),G[Ve+q]=he.a,G[At+q]=he.b)}if(oe&tt){var Ve=we+ie;at?Ee(G[we+q],G[Ve+q]):lt(G[we+q],G[Ve+q]),it=he.a,G[Ve+q]=he.b,G[we+q]=it}}if(Le&tt)for(var we=dt,je=dt+Te*(oe-yt);we<=je;we+=ce){var He=we+pe;at?Ee(G[we+q],G[He+q]):lt(G[we+q],G[He+q]),it=he.a,G[He+q]=he.b,G[we+q]=it}yt=tt,tt>>=1}return dt}function Bt(G,q,oe,Te,Le,Ue,ct,at,st,tt){for(var yt=0,dt=0,k=at,ie=Math.trunc(Le.value+(Ue+7)/8);Le.value<ie;)for(X(yt,dt,oe,Le),yt=_e.c,dt=_e.lc;dt>=14;){var ue=yt>>dt-14&16383,pe=q[ue];if(pe.len)dt-=pe.len,le(pe.lit,ct,yt,dt,oe,Te,Le,st,tt,k),yt=te.c,dt=te.lc;else{if(!pe.p)throw"hufDecode issues";var ce;for(ce=0;ce<pe.lit;ce++){for(var it=W(G[pe.p[ce]]);dt<it&&Le.value<ie;)X(yt,dt,oe,Le),yt=_e.c,dt=_e.lc;if(dt>=it&&ee(G[pe.p[ce]])==(yt>>dt-it&(1<<it)-1)){dt-=it,le(pe.p[ce],ct,yt,dt,oe,Te,Le,st,tt,k),yt=te.c,dt=te.lc;break}}if(ce==pe.lit)throw"hufDecode issues"}}var ut=8-Ue&7;for(yt>>=ut,dt-=ut;dt>0;){var pe=q[yt<<14-dt&16383];if(pe.len)dt-=pe.len,le(pe.lit,ct,yt,dt,oe,Te,Le,st,tt,k),yt=te.c,dt=te.lc;else throw"hufDecode issues"}return!0}function tn(G,q,oe,Te,Le,Ue){var ct={value:0},at=oe.value,st=qe(q,oe),tt=qe(q,oe);oe.value+=4;var yt=qe(q,oe);if(oe.value+=4,st<0||st>=65537||tt<0||tt>=65537)throw"Something wrong with HUF_ENCSIZE";var dt=new Array(65537),k=new Array(16384);K(k);var ie=Te-(oe.value-at);if(I(G,q,oe,ie,st,tt,dt),yt>8*(Te-(oe.value-at)))throw"Something wrong with hufUncompress";ye(dt,st,tt,k),Bt(dt,k,G,q,oe,yt,tt,Ue,Le,ct)}function on(G,q,oe){for(var Te=0;Te<oe;++Te)q[Te]=G[q[Te]]}function Wt(G){for(var q=1;q<G.length;q++){var oe=G[q-1]+G[q]-128;G[q]=oe}}function Ge(G,q){for(var oe=0,Te=Math.floor((G.length+1)/2),Le=0,Ue=G.length-1;!(Le>Ue||(q[Le++]=G[oe++],Le>Ue));)q[Le++]=G[Te++]}function et(G){for(var q=G.byteLength,oe=new Array,Te=0,Le=new DataView(G);q>0;){var Ue=Le.getInt8(Te++);if(Ue<0){var ct=-Ue;q-=ct+1;for(var at=0;at<ct;at++)oe.push(Le.getUint8(Te++))}else{var ct=Ue;q-=2;for(var st=Le.getUint8(Te++),at=0;at<ct+1;at++)oe.push(st)}}return oe}function Je(G,q,oe,Te,Le,Ue){var He=new DataView(Ue.buffer),ct=oe[G.idx[0]].width,at=oe[G.idx[0]].height,st=3,tt=Math.floor(ct/8),yt=Math.ceil(ct/8),dt=Math.ceil(at/8),k=ct-(yt-1)*8,ie=at-(dt-1)*8,ue={value:0},pe=new Array(st),ce=new Array(st),it=new Array(st),ut=new Array(st),ht=new Array(st);for(let Tt=0;Tt<st;++Tt)ht[Tt]=q[G.idx[Tt]],pe[Tt]=Tt<1?0:pe[Tt-1]+yt*dt,ce[Tt]=new Float32Array(64),it[Tt]=new Uint16Array(64),ut[Tt]=new Uint16Array(yt*64);for(let Tt=0;Tt<dt;++Tt){var xe=8;Tt==dt-1&&(xe=ie);var we=8;for(let Nt=0;Nt<yt;++Nt){Nt==yt-1&&(we=k);for(let vt=0;vt<st;++vt)it[vt].fill(0),it[vt][0]=Le[pe[vt]++],xt(ue,Te,it[vt]),Q(it[vt],ce[vt]),Dt(ce[vt]);mt(ce);for(let vt=0;vt<st;++vt)Lt(ce[vt],ut[vt],Nt*64)}let ft=0;for(let Nt=0;Nt<st;++Nt){const vt=oe[G.idx[Nt]].type;for(let un=8*Tt;un<8*Tt+xe;++un){ft=ht[Nt][un];for(let Wn=0;Wn<tt;++Wn){const an=Wn*64+(un&7)*8;He.setUint16(ft+0*vt,ut[Nt][an+0],!0),He.setUint16(ft+2*vt,ut[Nt][an+1],!0),He.setUint16(ft+4*vt,ut[Nt][an+2],!0),He.setUint16(ft+6*vt,ut[Nt][an+3],!0),He.setUint16(ft+8*vt,ut[Nt][an+4],!0),He.setUint16(ft+10*vt,ut[Nt][an+5],!0),He.setUint16(ft+12*vt,ut[Nt][an+6],!0),He.setUint16(ft+14*vt,ut[Nt][an+7],!0),ft+=16*vt}}if(tt!=yt)for(let un=8*Tt;un<8*Tt+xe;++un){const Wn=ht[Nt][un]+8*tt*2*vt,an=tt*64+(un&7)*8;for(let Xn=0;Xn<we;++Xn)He.setUint16(Wn+Xn*2*vt,ut[Nt][an+Xn],!0)}}}for(var je=new Uint16Array(ct),He=new DataView(Ue.buffer),Ve=0;Ve<st;++Ve){oe[G.idx[Ve]].decoded=!0;var At=oe[G.idx[Ve]].type;if(oe[Ve].type==2)for(var Yt=0;Yt<at;++Yt){const Tt=ht[Ve][Yt];for(var Jt=0;Jt<ct;++Jt)je[Jt]=He.getUint16(Tt+Jt*2*At,!0);for(var Jt=0;Jt<ct;++Jt)He.setFloat32(Tt+Jt*2*At,Ne(je[Jt]),!0)}}}function xt(G,q,oe){for(var Te,Le=1;Le<64;)Te=q[G.value],Te==65280?Le=64:Te>>8==255?Le+=Te&255:(oe[Le]=Te,Le++),G.value++}function Q(G,q){q[0]=Ne(G[0]),q[1]=Ne(G[1]),q[2]=Ne(G[5]),q[3]=Ne(G[6]),q[4]=Ne(G[14]),q[5]=Ne(G[15]),q[6]=Ne(G[27]),q[7]=Ne(G[28]),q[8]=Ne(G[2]),q[9]=Ne(G[4]),q[10]=Ne(G[7]),q[11]=Ne(G[13]),q[12]=Ne(G[16]),q[13]=Ne(G[26]),q[14]=Ne(G[29]),q[15]=Ne(G[42]),q[16]=Ne(G[3]),q[17]=Ne(G[8]),q[18]=Ne(G[12]),q[19]=Ne(G[17]),q[20]=Ne(G[25]),q[21]=Ne(G[30]),q[22]=Ne(G[41]),q[23]=Ne(G[43]),q[24]=Ne(G[9]),q[25]=Ne(G[11]),q[26]=Ne(G[18]),q[27]=Ne(G[24]),q[28]=Ne(G[31]),q[29]=Ne(G[40]),q[30]=Ne(G[44]),q[31]=Ne(G[53]),q[32]=Ne(G[10]),q[33]=Ne(G[19]),q[34]=Ne(G[23]),q[35]=Ne(G[32]),q[36]=Ne(G[39]),q[37]=Ne(G[45]),q[38]=Ne(G[52]),q[39]=Ne(G[54]),q[40]=Ne(G[20]),q[41]=Ne(G[22]),q[42]=Ne(G[33]),q[43]=Ne(G[38]),q[44]=Ne(G[46]),q[45]=Ne(G[51]),q[46]=Ne(G[55]),q[47]=Ne(G[60]),q[48]=Ne(G[21]),q[49]=Ne(G[34]),q[50]=Ne(G[37]),q[51]=Ne(G[47]),q[52]=Ne(G[50]),q[53]=Ne(G[56]),q[54]=Ne(G[59]),q[55]=Ne(G[61]),q[56]=Ne(G[35]),q[57]=Ne(G[36]),q[58]=Ne(G[48]),q[59]=Ne(G[49]),q[60]=Ne(G[57]),q[61]=Ne(G[58]),q[62]=Ne(G[62]),q[63]=Ne(G[63])}function Dt(G){const q=.5*Math.cos(.7853975),oe=.5*Math.cos(3.14159/16),Te=.5*Math.cos(3.14159/8),Le=.5*Math.cos(3*3.14159/16),Ue=.5*Math.cos(5*3.14159/16),ct=.5*Math.cos(3*3.14159/8),at=.5*Math.cos(7*3.14159/16);for(var st=new Array(4),tt=new Array(4),yt=new Array(4),dt=new Array(4),k=0;k<8;++k){var ie=k*8;st[0]=Te*G[ie+2],st[1]=ct*G[ie+2],st[2]=Te*G[ie+6],st[3]=ct*G[ie+6],tt[0]=oe*G[ie+1]+Le*G[ie+3]+Ue*G[ie+5]+at*G[ie+7],tt[1]=Le*G[ie+1]-at*G[ie+3]-oe*G[ie+5]-Ue*G[ie+7],tt[2]=Ue*G[ie+1]-oe*G[ie+3]+at*G[ie+5]+Le*G[ie+7],tt[3]=at*G[ie+1]-Ue*G[ie+3]+Le*G[ie+5]-oe*G[ie+7],yt[0]=q*(G[ie+0]+G[ie+4]),yt[3]=q*(G[ie+0]-G[ie+4]),yt[1]=st[0]+st[3],yt[2]=st[1]-st[2],dt[0]=yt[0]+yt[1],dt[1]=yt[3]+yt[2],dt[2]=yt[3]-yt[2],dt[3]=yt[0]-yt[1],G[ie+0]=dt[0]+tt[0],G[ie+1]=dt[1]+tt[1],G[ie+2]=dt[2]+tt[2],G[ie+3]=dt[3]+tt[3],G[ie+4]=dt[3]-tt[3],G[ie+5]=dt[2]-tt[2],G[ie+6]=dt[1]-tt[1],G[ie+7]=dt[0]-tt[0]}for(var ue=0;ue<8;++ue)st[0]=Te*G[16+ue],st[1]=ct*G[16+ue],st[2]=Te*G[48+ue],st[3]=ct*G[48+ue],tt[0]=oe*G[8+ue]+Le*G[24+ue]+Ue*G[40+ue]+at*G[56+ue],tt[1]=Le*G[8+ue]-at*G[24+ue]-oe*G[40+ue]-Ue*G[56+ue],tt[2]=Ue*G[8+ue]-oe*G[24+ue]+at*G[40+ue]+Le*G[56+ue],tt[3]=at*G[8+ue]-Ue*G[24+ue]+Le*G[40+ue]-oe*G[56+ue],yt[0]=q*(G[ue]+G[32+ue]),yt[3]=q*(G[ue]-G[32+ue]),yt[1]=st[0]+st[3],yt[2]=st[1]-st[2],dt[0]=yt[0]+yt[1],dt[1]=yt[3]+yt[2],dt[2]=yt[3]-yt[2],dt[3]=yt[0]-yt[1],G[0+ue]=dt[0]+tt[0],G[8+ue]=dt[1]+tt[1],G[16+ue]=dt[2]+tt[2],G[24+ue]=dt[3]+tt[3],G[32+ue]=dt[3]-tt[3],G[40+ue]=dt[2]-tt[2],G[48+ue]=dt[1]-tt[1],G[56+ue]=dt[0]-tt[0]}function mt(G){for(var q=0;q<64;++q){var oe=G[0][q],Te=G[1][q],Le=G[2][q];G[0][q]=oe+1.5747*Le,G[1][q]=oe-.1873*Te-.4682*Le,G[2][q]=oe+1.8556*Te}}function Lt(G,q,oe){for(var Te=0;Te<64;++Te)q[oe+Te]=wu.toHalfFloat(gt(G[Te]))}function gt(G){return G<=1?Math.sign(G)*Math.pow(Math.abs(G),2.2):Math.sign(G)*Math.pow(U,Math.abs(G)-1)}function j(G){return new DataView(G.array.buffer,G.offset.value,G.size)}function P(G){var q=G.viewer.buffer.slice(G.offset.value,G.offset.value+G.size),oe=new Uint8Array(et(q)),Te=new Uint8Array(oe.length);return Wt(oe),Ge(oe,Te),new DataView(Te.buffer)}function de(G){var q=G.array.slice(G.offset.value,G.offset.value+G.size),oe=c_(q),Te=new Uint8Array(oe.length);return Wt(oe),Ge(oe,Te),new DataView(Te.buffer)}function Fe(G){for(var q=G.viewer,oe={value:G.offset.value},Te=new Uint16Array(G.width*G.scanlineBlockSize*(G.channels*G.type)),Le=new Uint8Array(8192),Ue=0,ct=new Array(G.channels),at=0;at<G.channels;at++)ct[at]={},ct[at].start=Ue,ct[at].end=ct[at].start,ct[at].nx=G.width,ct[at].ny=G.lines,ct[at].size=G.type,Ue+=ct[at].nx*ct[at].ny*ct[at].size;var st=ot(q,oe),tt=ot(q,oe);if(tt>=8192)throw"Something is wrong with PIZ_COMPRESSION BITMAP_SIZE";if(st<=tt)for(var at=0;at<tt-st+1;at++)Le[at+st]=bt(q,oe);var yt=new Uint16Array(65536),dt=F(Le,yt),k=qe(q,oe);tn(G.array,q,oe,k,Te,Ue);for(var at=0;at<G.channels;++at)for(var ie=ct[at],ue=0;ue<ct[at].size;++ue)Rt(Te,ie.start+ue,ie.nx,ie.size,ie.ny,ie.nx*ie.size,dt);on(yt,Te,Ue);for(var pe=0,ce=new Uint8Array(Te.buffer.byteLength),it=0;it<G.lines;it++)for(var ut=0;ut<G.channels;ut++){var ie=ct[ut],ht=ie.nx*ie.size,xe=new Uint8Array(Te.buffer,ie.end*2,ht*2);ce.set(xe,pe),pe+=ht*2,ie.end+=ht}return new DataView(ce.buffer)}function ke(G){var q=G.array.slice(G.offset.value,G.offset.value+G.size),oe=c_(q);const Te=G.lines*G.channels*G.width,Le=G.type==1?new Uint16Array(Te):new Uint32Array(Te);let Ue=0,ct=0;const at=new Array(4);for(let st=0;st<G.lines;st++)for(let tt=0;tt<G.channels;tt++){let yt=0;switch(G.type){case 1:at[0]=Ue,at[1]=at[0]+G.width,Ue=at[1]+G.width;for(let dt=0;dt<G.width;++dt){const k=oe[at[0]++]<<8|oe[at[1]++];yt+=k,Le[ct]=yt,ct++}break;case 2:at[0]=Ue,at[1]=at[0]+G.width,at[2]=at[1]+G.width,Ue=at[2]+G.width;for(let dt=0;dt<G.width;++dt){const k=oe[at[0]++]<<24|oe[at[1]++]<<16|oe[at[2]++]<<8;yt+=k,Le[ct]=yt,ct++}break}}return new DataView(Le.buffer)}function Ie(G){var q=G.viewer,oe={value:G.offset.value},Te=new Uint8Array(G.width*G.lines*(G.channels*G.type*2)),Le={version:rt(q,oe),unknownUncompressedSize:rt(q,oe),unknownCompressedSize:rt(q,oe),acCompressedSize:rt(q,oe),dcCompressedSize:rt(q,oe),rleCompressedSize:rt(q,oe),rleUncompressedSize:rt(q,oe),rleRawSize:rt(q,oe),totalAcUncompressedCount:rt(q,oe),totalDcUncompressedCount:rt(q,oe),acCompression:rt(q,oe)};if(Le.version<2)throw"EXRLoader.parse: "+wi.compression+" version "+Le.version+" is unsupported";for(var Ue=new Array,ct=ot(q,oe)-2;ct>0;){var at=Ft(q.buffer,oe),st=bt(q,oe),tt=st>>2&3,yt=(st>>4)-1,dt=new Int8Array([yt])[0],k=bt(q,oe);Ue.push({name:at,index:dt,type:k,compression:tt}),ct-=at.length+3}for(var ie=wi.channels,ue=new Array(G.channels),pe=0;pe<G.channels;++pe){var ce=ue[pe]={},it=ie[pe];ce.name=it.name,ce.compression=0,ce.decoded=!1,ce.type=it.pixelType,ce.pLinear=it.pLinear,ce.width=G.width,ce.height=G.lines}for(var ut={idx:new Array(3)},ht=0;ht<G.channels;++ht)for(var ce=ue[ht],pe=0;pe<Ue.length;++pe){var xe=Ue[pe];ce.name==xe.name&&(ce.compression=xe.compression,xe.index>=0&&(ut.idx[xe.index]=ht),ce.offset=ht)}if(Le.acCompressedSize>0)switch(Le.acCompression){case 0:var He=new Uint16Array(Le.totalAcUncompressedCount);tn(G.array,q,oe,Le.acCompressedSize,He,Le.totalAcUncompressedCount);break;case 1:var we=G.array.slice(oe.value,oe.value+Le.totalAcUncompressedCount),je=c_(we),He=new Uint16Array(je.buffer);oe.value+=Le.totalAcUncompressedCount;break}if(Le.dcCompressedSize>0){var Ve={array:G.array,offset:oe,size:Le.dcCompressedSize},At=new Uint16Array(de(Ve).buffer);oe.value+=Le.dcCompressedSize}if(Le.rleRawSize>0){var we=G.array.slice(oe.value,oe.value+Le.rleCompressedSize),je=c_(we),Yt=et(je.buffer);oe.value+=Le.rleCompressedSize}for(var Jt=0,Tt=new Array(ue.length),pe=0;pe<Tt.length;++pe)Tt[pe]=new Array;for(var ft=0;ft<G.lines;++ft)for(var Nt=0;Nt<ue.length;++Nt)Tt[Nt].push(Jt),Jt+=ue[Nt].width*G.type*2;Je(ut,Tt,ue,He,At,Te);for(var pe=0;pe<ue.length;++pe){var ce=ue[pe];if(!ce.decoded)switch(ce.compression){case 2:for(var vt=0,un=0,ft=0;ft<G.lines;++ft){for(var Wn=Tt[pe][vt],an=0;an<ce.width;++an){for(var Xn=0;Xn<2*ce.type;++Xn)Te[Wn++]=Yt[un+Xn*ce.width*ce.height];un++}vt++}break;default:throw"EXRLoader.parse: unsupported channel compression"}}return new DataView(Te.buffer)}function Ft(G,q){for(var oe=new Uint8Array(G),Te=0;oe[q.value+Te]!=0;)Te+=1;var Le=new TextDecoder().decode(oe.slice(q.value,q.value+Te));return q.value=q.value+Te+1,Le}function Mt(G,q,oe){var Te=new TextDecoder().decode(new Uint8Array(G).slice(q.value,q.value+oe));return q.value=q.value+oe,Te}function Ht(G,q){var oe=Ye(G,q),Te=qe(G,q);return[oe,Te]}function zt(G,q){var oe=qe(G,q),Te=qe(G,q);return[oe,Te]}function Ye(G,q){var oe=G.getInt32(q.value,!0);return q.value=q.value+4,oe}function qe(G,q){var oe=G.getUint32(q.value,!0);return q.value=q.value+4,oe}function wt(G,q){var oe=G[q.value];return q.value=q.value+1,oe}function bt(G,q){var oe=G.getUint8(q.value);return q.value=q.value+1,oe}const rt=function(G,q){let oe;return"getBigInt64"in DataView.prototype?oe=Number(G.getBigInt64(q.value,!0)):oe=G.getUint32(q.value+4,!0)+Number(G.getUint32(q.value,!0)<<32),q.value+=8,oe};function Vt(G,q){var oe=G.getFloat32(q.value,!0);return q.value+=4,oe}function fe(G,q){return wu.toHalfFloat(Vt(G,q))}function Ne(G){var q=(G&31744)>>10,oe=G&1023;return(G>>15?-1:1)*(q?q===31?oe?NaN:1/0:Math.pow(2,q-15)*(1+oe/1024):6103515625e-14*(oe/1024))}function ot(G,q){var oe=G.getUint16(q.value,!0);return q.value+=2,oe}function Et(G,q){return Ne(ot(G,q))}function Qe(G,q,oe,Te){for(var Le=oe.value,Ue=[];oe.value<Le+Te-1;){var ct=Ft(q,oe),at=Ye(G,oe),st=bt(G,oe);oe.value+=3;var tt=Ye(G,oe),yt=Ye(G,oe);Ue.push({name:ct,pixelType:at,pLinear:st,xSampling:tt,ySampling:yt})}return oe.value+=1,Ue}function We(G,q){var oe=Vt(G,q),Te=Vt(G,q),Le=Vt(G,q),Ue=Vt(G,q),ct=Vt(G,q),at=Vt(G,q),st=Vt(G,q),tt=Vt(G,q);return{redX:oe,redY:Te,greenX:Le,greenY:Ue,blueX:ct,blueY:at,whiteX:st,whiteY:tt}}function _t(G,q){var oe=["NO_COMPRESSION","RLE_COMPRESSION","ZIPS_COMPRESSION","ZIP_COMPRESSION","PIZ_COMPRESSION","PXR24_COMPRESSION","B44_COMPRESSION","B44A_COMPRESSION","DWAA_COMPRESSION","DWAB_COMPRESSION"],Te=bt(G,q);return oe[Te]}function nn(G,q){var oe=qe(G,q),Te=qe(G,q),Le=qe(G,q),Ue=qe(G,q);return{xMin:oe,yMin:Te,xMax:Le,yMax:Ue}}function wn(G,q){var oe=["INCREASING_Y"],Te=bt(G,q);return oe[Te]}function Mn(G,q){var oe=Vt(G,q),Te=Vt(G,q);return[oe,Te]}function Fi(G,q){var oe=Vt(G,q),Te=Vt(G,q),Le=Vt(G,q);return[oe,Te,Le]}function va(G,q,oe,Te,Le){if(Te==="string"||Te==="stringvector"||Te==="iccProfile")return Mt(q,oe,Le);if(Te==="chlist")return Qe(G,q,oe,Le);if(Te==="chromaticities")return We(G,oe);if(Te==="compression")return _t(G,oe);if(Te==="box2i")return nn(G,oe);if(Te==="lineOrder")return wn(G,oe);if(Te==="float")return Vt(G,oe);if(Te==="v2f")return Mn(G,oe);if(Te==="v3f")return Fi(G,oe);if(Te==="int")return Ye(G,oe);if(Te==="rational")return Ht(G,oe);if(Te==="timecode")return zt(G,oe);if(Te==="preview")return oe.value+=Le,"skipped";oe.value+=Le}function br(G,q,oe){const Te={};if(G.getUint32(0,!0)!=20000630)throw"THREE.EXRLoader: provided file doesn't appear to be in OpenEXR format.";Te.version=G.getUint8(4);const Le=G.getUint8(5);Te.spec={singleTile:!!(Le&2),longName:!!(Le&4),deepFormat:!!(Le&8),multiPart:!!(Le&16)},oe.value=8;for(var Ue=!0;Ue;){var ct=Ft(q,oe);if(ct==0)Ue=!1;else{var at=Ft(q,oe),st=qe(G,oe),tt=va(G,q,oe,at,st);tt===void 0?console.warn(`EXRLoader.parse: skipped unknown header attribute type '${at}'.`):Te[ct]=tt}}if((Le&-5)!=0)throw console.error("EXRHeader:",Te),"THREE.EXRLoader: provided file is currently unsupported.";return Te}function ir(G,q,oe,Te,Le){const Ue={size:0,viewer:q,array:oe,offset:Te,width:G.dataWindow.xMax-G.dataWindow.xMin+1,height:G.dataWindow.yMax-G.dataWindow.yMin+1,channels:G.channels.length,bytesPerLine:null,lines:null,inputSize:null,type:G.channels[0].pixelType,uncompress:null,getter:null,format:null,[em?"colorSpace":"encoding"]:null};switch(G.compression){case"NO_COMPRESSION":Ue.lines=1,Ue.uncompress=j;break;case"RLE_COMPRESSION":Ue.lines=1,Ue.uncompress=P;break;case"ZIPS_COMPRESSION":Ue.lines=1,Ue.uncompress=de;break;case"ZIP_COMPRESSION":Ue.lines=16,Ue.uncompress=de;break;case"PIZ_COMPRESSION":Ue.lines=32,Ue.uncompress=Fe;break;case"PXR24_COMPRESSION":Ue.lines=16,Ue.uncompress=ke;break;case"DWAA_COMPRESSION":Ue.lines=32,Ue.uncompress=Ie;break;case"DWAB_COMPRESSION":Ue.lines=256,Ue.uncompress=Ie;break;default:throw"EXRLoader.parse: "+G.compression+" is unsupported"}if(Ue.scanlineBlockSize=Ue.lines,Ue.type==1)switch(Le){case Ci:Ue.getter=Et,Ue.inputSize=2;break;case ki:Ue.getter=ot,Ue.inputSize=2;break}else if(Ue.type==2)switch(Le){case Ci:Ue.getter=Vt,Ue.inputSize=4;break;case ki:Ue.getter=fe,Ue.inputSize=4}else throw"EXRLoader.parse: unsupported pixelType "+Ue.type+" for "+G.compression+".";Ue.blockCount=(G.dataWindow.yMax+1)/Ue.scanlineBlockSize;for(var ct=0;ct<Ue.blockCount;ct++)rt(q,Te);Ue.outputChannels=Ue.channels==3?4:Ue.channels;const at=Ue.width*Ue.height*Ue.outputChannels;switch(Le){case Ci:Ue.byteArray=new Float32Array(at),Ue.channels<Ue.outputChannels&&Ue.byteArray.fill(1,0,at);break;case ki:Ue.byteArray=new Uint16Array(at),Ue.channels<Ue.outputChannels&&Ue.byteArray.fill(15360,0,at);break;default:console.error("THREE.EXRLoader: unsupported type: ",Le);break}return Ue.bytesPerLine=Ue.width*Ue.inputSize*Ue.channels,Ue.outputChannels==4?Ue.format=Zi:Ue.format=ip,em?Ue.colorSpace="srgb-linear":Ue.encoding=3e3,Ue}const _a=new DataView(e),sa=new Uint8Array(e),Da={value:0},wi=br(_a,e,Da),kt=ir(wi,_a,sa,Da,this.type),Ai={value:0},mn={R:0,G:1,B:2,A:3,Y:0};for(let G=0;G<kt.height/kt.scanlineBlockSize;G++){const q=qe(_a,Da);kt.size=qe(_a,Da),kt.lines=q+kt.scanlineBlockSize>kt.height?kt.height-q:kt.scanlineBlockSize;const Te=kt.size<kt.lines*kt.bytesPerLine?kt.uncompress(kt):j(kt);Da.value+=kt.size;for(let Le=0;Le<kt.scanlineBlockSize;Le++){const Ue=Le+G*kt.scanlineBlockSize;if(Ue>=kt.height)break;for(let ct=0;ct<kt.channels;ct++){const at=mn[wi.channels[ct].name];for(let st=0;st<kt.width;st++){Ai.value=(Le*(kt.channels*kt.width)+ct*kt.width+st)*kt.inputSize;const tt=(kt.height-1-Ue)*(kt.width*kt.outputChannels)+st*kt.outputChannels+at;kt.byteArray[tt]=kt.getter(Te,Ai)}}}}return{header:wi,width:kt.width,height:kt.height,data:kt.byteArray,format:kt.format,[em?"colorSpace":"encoding"]:kt[em?"colorSpace":"encoding"],type:this.type}}setDataType(e){return this.type=e,this}load(e,t,n,i){function o(l,h){em?l.colorSpace=h.colorSpace:l.encoding=h.encoding,l.minFilter=Cn,l.magFilter=Cn,l.generateMipmaps=!1,l.flipY=!1,t&&t(l,h)}return super.load(e,o,n,i)}}const ES=new WeakMap;class wI extends Ba{constructor(e){super(e),this.decoderPath="",this.decoderConfig={},this.decoderBinary=null,this.decoderPending=null,this.workerLimit=4,this.workerPool=[],this.workerNextTaskID=1,this.workerSourceURL="",this.defaultAttributeIDs={position:"POSITION",normal:"NORMAL",color:"COLOR",uv:"TEX_COORD"},this.defaultAttributeTypes={position:"Float32Array",normal:"Float32Array",color:"Float32Array",uv:"Float32Array"}}setDecoderPath(e){return this.decoderPath=e,this}setDecoderConfig(e){return this.decoderConfig=e,this}setWorkerLimit(e){return this.workerLimit=e,this}load(e,t,n,i){const o=new da(this.manager);o.setPath(this.path),o.setResponseType("arraybuffer"),o.setRequestHeader(this.requestHeader),o.setWithCredentials(this.withCredentials),o.load(e,l=>{const h={attributeIDs:this.defaultAttributeIDs,attributeTypes:this.defaultAttributeTypes,useUniqueIDs:!1};this.decodeGeometry(l,h).then(t).catch(i)},n,i)}decodeDracoFile(e,t,n,i){const o={attributeIDs:n||this.defaultAttributeIDs,attributeTypes:i||this.defaultAttributeTypes,useUniqueIDs:!!n};this.decodeGeometry(e,o).then(t)}decodeGeometry(e,t){for(const d in t.attributeTypes){const p=t.attributeTypes[d];p.BYTES_PER_ELEMENT!==void 0&&(t.attributeTypes[d]=p.name)}const n=JSON.stringify(t);if(ES.has(e)){const d=ES.get(e);if(d.key===n)return d.promise;if(e.byteLength===0)throw new Error("THREE.DRACOLoader: Unable to re-decode a buffer with different settings. Buffer has already been transferred.")}let i;const o=this.workerNextTaskID++,l=e.byteLength,h=this._getWorker(o,l).then(d=>(i=d,new Promise((p,_)=>{i._callbacks[o]={resolve:p,reject:_},i.postMessage({type:"decode",id:o,taskConfig:t,buffer:e},[e])}))).then(d=>this._createGeometry(d.geometry));return h.catch(()=>!0).then(()=>{i&&o&&this._releaseTask(i,o)}),ES.set(e,{key:n,promise:h}),h}_createGeometry(e){const t=new pn;e.index&&t.setIndex(new Hn(e.index.array,1));for(let n=0;n<e.attributes.length;n++){const i=e.attributes[n],o=i.name,l=i.array,h=i.itemSize;t.setAttribute(o,new Hn(l,h))}return t}_loadLibrary(e,t){const n=new da(this.manager);return n.setPath(this.decoderPath),n.setResponseType(t),n.setWithCredentials(this.withCredentials),new Promise((i,o)=>{n.load(e,i,void 0,o)})}preload(){return this._initDecoder(),this}_initDecoder(){if(this.decoderPending)return this.decoderPending;const e=typeof WebAssembly!="object"||this.decoderConfig.type==="js",t=[];return e?t.push(this._loadLibrary("draco_decoder.js","text")):(t.push(this._loadLibrary("draco_wasm_wrapper.js","text")),t.push(this._loadLibrary("draco_decoder.wasm","arraybuffer"))),this.decoderPending=Promise.all(t).then(n=>{const i=n[0];e||(this.decoderConfig.wasmBinary=n[1]);const o=BI.toString(),l=["/* draco decoder */",i,"","/* worker */",o.substring(o.indexOf("{")+1,o.lastIndexOf("}"))].join(`
|
|
4116
4116
|
`);this.workerSourceURL=URL.createObjectURL(new Blob([l]))}),this.decoderPending}_getWorker(e,t){return this._initDecoder().then(()=>{if(this.workerPool.length<this.workerLimit){const i=new Worker(this.workerSourceURL);i._callbacks={},i._taskCosts={},i._taskLoad=0,i.postMessage({type:"init",decoderConfig:this.decoderConfig}),i.onmessage=function(o){const l=o.data;switch(l.type){case"decode":i._callbacks[l.id].resolve(l);break;case"error":i._callbacks[l.id].reject(l);break;default:console.error('THREE.DRACOLoader: Unexpected message, "'+l.type+'"')}},this.workerPool.push(i)}else this.workerPool.sort(function(i,o){return i._taskLoad>o._taskLoad?-1:1});const n=this.workerPool[this.workerPool.length-1];return n._taskCosts[e]=t,n._taskLoad+=t,n})}_releaseTask(e,t){e._taskLoad-=e._taskCosts[t],delete e._callbacks[t],delete e._taskCosts[t]}debug(){console.log("Task load: ",this.workerPool.map(e=>e._taskLoad))}dispose(){for(let e=0;e<this.workerPool.length;++e)this.workerPool[e].terminate();return this.workerPool.length=0,this}}function BI(){let s,e;onmessage=function(l){const h=l.data;switch(h.type){case"init":s=h.decoderConfig,e=new Promise(function(_){s.onModuleLoaded=function(v){_({draco:v})},DracoDecoderModule(s)});break;case"decode":const d=h.buffer,p=h.taskConfig;e.then(_=>{const v=_.draco,y=new v.Decoder,x=new v.DecoderBuffer;x.Init(new Int8Array(d),d.byteLength);try{const b=t(v,y,x,p),R=b.attributes.map(T=>T.array.buffer);b.index&&R.push(b.index.array.buffer),self.postMessage({type:"decode",id:h.id,geometry:b},R)}catch(b){console.error(b),self.postMessage({type:"error",id:h.id,error:b.message})}finally{v.destroy(x),v.destroy(y)}});break}};function t(l,h,d,p){const _=p.attributeIDs,v=p.attributeTypes;let y,x;const b=h.GetEncodedGeometryType(d);if(b===l.TRIANGULAR_MESH)y=new l.Mesh,x=h.DecodeBufferToMesh(d,y);else if(b===l.POINT_CLOUD)y=new l.PointCloud,x=h.DecodeBufferToPointCloud(d,y);else throw new Error("THREE.DRACOLoader: Unexpected geometry type.");if(!x.ok()||y.ptr===0)throw new Error("THREE.DRACOLoader: Decoding failed: "+x.error_msg());const R={index:null,attributes:[]};for(const T in _){const M=self[v[T]];let w,D;if(p.useUniqueIDs)D=_[T],w=h.GetAttributeByUniqueId(y,D);else{if(D=h.GetAttributeId(y,l[_[T]]),D===-1)continue;w=h.GetAttribute(y,D)}R.attributes.push(i(l,h,y,T,M,w))}return b===l.TRIANGULAR_MESH&&(R.index=n(l,h,y)),l.destroy(y),R}function n(l,h,d){const _=d.num_faces()*3,v=_*4,y=l._malloc(v);h.GetTrianglesUInt32Array(d,v,y);const x=new Uint32Array(l.HEAPF32.buffer,y,_).slice();return l._free(y),{array:x,itemSize:1}}function i(l,h,d,p,_,v){const y=v.num_components(),b=d.num_points()*y,R=b*_.BYTES_PER_ELEMENT,T=o(l,_),M=l._malloc(R);h.GetAttributeDataArrayForAllPoints(d,v,T,R,M);const w=new _(l.HEAPF32.buffer,M,b).slice();return l._free(M),{name:p,array:w,itemSize:y}}function o(l,h){switch(h){case Float32Array:return l.DT_FLOAT32;case Int8Array:return l.DT_INT8;case Int16Array:return l.DT_INT16;case Int32Array:return l.DT_INT32;case Uint8Array:return l.DT_UINT8;case Uint16Array:return l.DT_UINT16;case Uint32Array:return l.DT_UINT32}}}let f_;const TS=()=>{if(f_)return f_;const s="B9h9z9tFBBBF8fL9gBB9gLaaaaaFa9gEaaaB9gFaFa9gEaaaFaEMcBFFFGGGEIIILF9wFFFLEFBFKNFaFCx/IFMO/LFVK9tv9t9vq95GBt9f9f939h9z9t9f9j9h9s9s9f9jW9vq9zBBp9tv9z9o9v9wW9f9kv9j9v9kv9WvqWv94h919m9mvqBF8Z9tv9z9o9v9wW9f9kv9j9v9kv9J9u9kv94h919m9mvqBGy9tv9z9o9v9wW9f9kv9j9v9kv9J9u9kv949TvZ91v9u9jvBEn9tv9z9o9v9wW9f9kv9j9v9kv69p9sWvq9P9jWBIi9tv9z9o9v9wW9f9kv9j9v9kv69p9sWvq9R919hWBLn9tv9z9o9v9wW9f9kv9j9v9kv69p9sWvq9F949wBKI9z9iqlBOc+x8ycGBM/qQFTa8jUUUUBCU/EBlHL8kUUUUBC9+RKGXAGCFJAI9LQBCaRKAE2BBC+gF9HQBALAEAIJHOAGlAGTkUUUBRNCUoBAG9uC/wgBZHKCUGAKCUG9JyRVAECFJRICBRcGXEXAcAF9PQFAVAFAclAcAVJAF9JyRMGXGXAG9FQBAMCbJHKC9wZRSAKCIrCEJCGrRQANCUGJRfCBRbAIRTEXGXAOATlAQ9PQBCBRISEMATAQJRIGXAS9FQBCBRtCBREEXGXAOAIlCi9PQBCBRISLMANCU/CBJAEJRKGXGXGXGXGXATAECKrJ2BBAtCKZrCEZfIBFGEBMAKhB83EBAKCNJhB83EBSEMAKAI2BIAI2BBHmCKrHYAYCE6HYy86BBAKCFJAICIJAYJHY2BBAmCIrCEZHPAPCE6HPy86BBAKCGJAYAPJHY2BBAmCGrCEZHPAPCE6HPy86BBAKCEJAYAPJHY2BBAmCEZHmAmCE6Hmy86BBAKCIJAYAmJHY2BBAI2BFHmCKrHPAPCE6HPy86BBAKCLJAYAPJHY2BBAmCIrCEZHPAPCE6HPy86BBAKCKJAYAPJHY2BBAmCGrCEZHPAPCE6HPy86BBAKCOJAYAPJHY2BBAmCEZHmAmCE6Hmy86BBAKCNJAYAmJHY2BBAI2BGHmCKrHPAPCE6HPy86BBAKCVJAYAPJHY2BBAmCIrCEZHPAPCE6HPy86BBAKCcJAYAPJHY2BBAmCGrCEZHPAPCE6HPy86BBAKCMJAYAPJHY2BBAmCEZHmAmCE6Hmy86BBAKCSJAYAmJHm2BBAI2BEHICKrHYAYCE6HYy86BBAKCQJAmAYJHm2BBAICIrCEZHYAYCE6HYy86BBAKCfJAmAYJHm2BBAICGrCEZHYAYCE6HYy86BBAKCbJAmAYJHK2BBAICEZHIAICE6HIy86BBAKAIJRISGMAKAI2BNAI2BBHmCIrHYAYCb6HYy86BBAKCFJAICNJAYJHY2BBAmCbZHmAmCb6Hmy86BBAKCGJAYAmJHm2BBAI2BFHYCIrHPAPCb6HPy86BBAKCEJAmAPJHm2BBAYCbZHYAYCb6HYy86BBAKCIJAmAYJHm2BBAI2BGHYCIrHPAPCb6HPy86BBAKCLJAmAPJHm2BBAYCbZHYAYCb6HYy86BBAKCKJAmAYJHm2BBAI2BEHYCIrHPAPCb6HPy86BBAKCOJAmAPJHm2BBAYCbZHYAYCb6HYy86BBAKCNJAmAYJHm2BBAI2BIHYCIrHPAPCb6HPy86BBAKCVJAmAPJHm2BBAYCbZHYAYCb6HYy86BBAKCcJAmAYJHm2BBAI2BLHYCIrHPAPCb6HPy86BBAKCMJAmAPJHm2BBAYCbZHYAYCb6HYy86BBAKCSJAmAYJHm2BBAI2BKHYCIrHPAPCb6HPy86BBAKCQJAmAPJHm2BBAYCbZHYAYCb6HYy86BBAKCfJAmAYJHm2BBAI2BOHICIrHYAYCb6HYy86BBAKCbJAmAYJHK2BBAICbZHIAICb6HIy86BBAKAIJRISFMAKAI8pBB83BBAKCNJAICNJ8pBB83BBAICTJRIMAtCGJRtAECTJHEAS9JQBMMGXAIQBCBRISEMGXAM9FQBANAbJ2BBRtCBRKAfREEXAEANCU/CBJAKJ2BBHTCFrCBATCFZl9zAtJHt86BBAEAGJREAKCFJHKAM9HQBMMAfCFJRfAIRTAbCFJHbAG9HQBMMABAcAG9sJANCUGJAMAG9sTkUUUBpANANCUGJAMCaJAG9sJAGTkUUUBpMAMCBAIyAcJRcAIQBMC9+RKSFMCBC99AOAIlAGCAAGCA9Ly6yRKMALCU/EBJ8kUUUUBAKM+OmFTa8jUUUUBCoFlHL8kUUUUBC9+RKGXAFCE9uHOCtJAI9LQBCaRKAE2BBHNC/wFZC/gF9HQBANCbZHVCF9LQBALCoBJCgFCUFT+JUUUBpALC84Jha83EBALC8wJha83EBALC8oJha83EBALCAJha83EBALCiJha83EBALCTJha83EBALha83ENALha83EBAEAIJC9wJRcAECFJHNAOJRMGXAF9FQBCQCbAVCF6yRSABRECBRVCBRQCBRfCBRICBRKEXGXAMAcuQBC9+RKSEMGXGXAN2BBHOC/vF9LQBALCoBJAOCIrCa9zAKJCbZCEWJHb8oGIRTAb8oGBRtGXAOCbZHbAS9PQBALAOCa9zAIJCbZCGWJ8oGBAVAbyROAb9FRbGXGXAGCG9HQBABAt87FBABCIJAO87FBABCGJAT87FBSFMAEAtjGBAECNJAOjGBAECIJATjGBMAVAbJRVALCoBJAKCEWJHmAOjGBAmATjGIALAICGWJAOjGBALCoBJAKCFJCbZHKCEWJHTAtjGBATAOjGIAIAbJRIAKCFJRKSGMGXGXAbCb6QBAQAbJAbC989zJCFJRQSFMAM1BBHbCgFZROGXGXAbCa9MQBAMCFJRMSFMAM1BFHbCgBZCOWAOCgBZqROGXAbCa9MQBAMCGJRMSFMAM1BGHbCgBZCfWAOqROGXAbCa9MQBAMCEJRMSFMAM1BEHbCgBZCdWAOqROGXAbCa9MQBAMCIJRMSFMAM2BIC8cWAOqROAMCLJRMMAOCFrCBAOCFZl9zAQJRQMGXGXAGCG9HQBABAt87FBABCIJAQ87FBABCGJAT87FBSFMAEAtjGBAECNJAQjGBAECIJATjGBMALCoBJAKCEWJHOAQjGBAOATjGIALAICGWJAQjGBALCoBJAKCFJCbZHKCEWJHOAtjGBAOAQjGIAICFJRIAKCFJRKSFMGXAOCDF9LQBALAIAcAOCbZJ2BBHbCIrHTlCbZCGWJ8oGBAVCFJHtATyROALAIAblCbZCGWJ8oGBAtAT9FHmJHtAbCbZHTyRbAT9FRTGXGXAGCG9HQBABAV87FBABCIJAb87FBABCGJAO87FBSFMAEAVjGBAECNJAbjGBAECIJAOjGBMALAICGWJAVjGBALCoBJAKCEWJHYAOjGBAYAVjGIALAICFJHICbZCGWJAOjGBALCoBJAKCFJCbZCEWJHYAbjGBAYAOjGIALAIAmJCbZHICGWJAbjGBALCoBJAKCGJCbZHKCEWJHOAVjGBAOAbjGIAKCFJRKAIATJRIAtATJRVSFMAVCBAM2BBHYyHTAOC/+F6HPJROAYCbZRtGXGXAYCIrHmQBAOCFJRbSFMAORbALAIAmlCbZCGWJ8oGBROMGXGXAtQBAbCFJRVSFMAbRVALAIAYlCbZCGWJ8oGBRbMGXGXAP9FQBAMCFJRYSFMAM1BFHYCgFZRTGXGXAYCa9MQBAMCGJRYSFMAM1BGHYCgBZCOWATCgBZqRTGXAYCa9MQBAMCEJRYSFMAM1BEHYCgBZCfWATqRTGXAYCa9MQBAMCIJRYSFMAM1BIHYCgBZCdWATqRTGXAYCa9MQBAMCLJRYSFMAMCKJRYAM2BLC8cWATqRTMATCFrCBATCFZl9zAQJHQRTMGXGXAmCb6QBAYRPSFMAY1BBHMCgFZROGXGXAMCa9MQBAYCFJRPSFMAY1BFHMCgBZCOWAOCgBZqROGXAMCa9MQBAYCGJRPSFMAY1BGHMCgBZCfWAOqROGXAMCa9MQBAYCEJRPSFMAY1BEHMCgBZCdWAOqROGXAMCa9MQBAYCIJRPSFMAYCLJRPAY2BIC8cWAOqROMAOCFrCBAOCFZl9zAQJHQROMGXGXAtCb6QBAPRMSFMAP1BBHMCgFZRbGXGXAMCa9MQBAPCFJRMSFMAP1BFHMCgBZCOWAbCgBZqRbGXAMCa9MQBAPCGJRMSFMAP1BGHMCgBZCfWAbqRbGXAMCa9MQBAPCEJRMSFMAP1BEHMCgBZCdWAbqRbGXAMCa9MQBAPCIJRMSFMAPCLJRMAP2BIC8cWAbqRbMAbCFrCBAbCFZl9zAQJHQRbMGXGXAGCG9HQBABAT87FBABCIJAb87FBABCGJAO87FBSFMAEATjGBAECNJAbjGBAECIJAOjGBMALCoBJAKCEWJHYAOjGBAYATjGIALAICGWJATjGBALCoBJAKCFJCbZCEWJHYAbjGBAYAOjGIALAICFJHICbZCGWJAOjGBALCoBJAKCGJCbZCEWJHOATjGBAOAbjGIALAIAm9FAmCb6qJHICbZCGWJAbjGBAIAt9FAtCb6qJRIAKCEJRKMANCFJRNABCKJRBAECSJREAKCbZRKAICbZRIAfCEJHfAF9JQBMMCBC99AMAc6yRKMALCoFJ8kUUUUBAKM/tIFGa8jUUUUBCTlRLC9+RKGXAFCLJAI9LQBCaRKAE2BBC/+FZC/QF9HQBALhB83ENAECFJRKAEAIJC98JREGXAF9FQBGXAGCG6QBEXGXAKAE9JQBC9+bMAK1BBHGCgFZRIGXGXAGCa9MQBAKCFJRKSFMAK1BFHGCgBZCOWAICgBZqRIGXAGCa9MQBAKCGJRKSFMAK1BGHGCgBZCfWAIqRIGXAGCa9MQBAKCEJRKSFMAK1BEHGCgBZCdWAIqRIGXAGCa9MQBAKCIJRKSFMAK2BIC8cWAIqRIAKCLJRKMALCNJAICFZCGWqHGAICGrCBAICFrCFZl9zAG8oGBJHIjGBABAIjGBABCIJRBAFCaJHFQBSGMMEXGXAKAE9JQBC9+bMAK1BBHGCgFZRIGXGXAGCa9MQBAKCFJRKSFMAK1BFHGCgBZCOWAICgBZqRIGXAGCa9MQBAKCGJRKSFMAK1BGHGCgBZCfWAIqRIGXAGCa9MQBAKCEJRKSFMAK1BEHGCgBZCdWAIqRIGXAGCa9MQBAKCIJRKSFMAK2BIC8cWAIqRIAKCLJRKMABAICGrCBAICFrCFZl9zALCNJAICFZCGWqHI8oGBJHG87FBAIAGjGBABCGJRBAFCaJHFQBMMCBC99AKAE6yRKMAKM+lLKFaF99GaG99FaG99GXGXAGCI9HQBAF9FQFEXGXGX9DBBB8/9DBBB+/ABCGJHG1BB+yAB1BBHE+yHI+L+TABCFJHL1BBHK+yHO+L+THN9DBBBB9gHVyAN9DBB/+hANAN+U9DBBBBANAVyHcAc+MHMAECa3yAI+SHIAI+UAcAMAKCa3yAO+SHcAc+U+S+S+R+VHO+U+SHN+L9DBBB9P9d9FQBAN+oRESFMCUUUU94REMAGAE86BBGXGX9DBBB8/9DBBB+/Ac9DBBBB9gyAcAO+U+SHN+L9DBBB9P9d9FQBAN+oRGSFMCUUUU94RGMALAG86BBGXGX9DBBB8/9DBBB+/AI9DBBBB9gyAIAO+U+SHN+L9DBBB9P9d9FQBAN+oRGSFMCUUUU94RGMABAG86BBABCIJRBAFCaJHFQBSGMMAF9FQBEXGXGX9DBBB8/9DBBB+/ABCIJHG8uFB+yAB8uFBHE+yHI+L+TABCGJHL8uFBHK+yHO+L+THN9DBBBB9gHVyAN9DB/+g6ANAN+U9DBBBBANAVyHcAc+MHMAECa3yAI+SHIAI+UAcAMAKCa3yAO+SHcAc+U+S+S+R+VHO+U+SHN+L9DBBB9P9d9FQBAN+oRESFMCUUUU94REMAGAE87FBGXGX9DBBB8/9DBBB+/Ac9DBBBB9gyAcAO+U+SHN+L9DBBB9P9d9FQBAN+oRGSFMCUUUU94RGMALAG87FBGXGX9DBBB8/9DBBB+/AI9DBBBB9gyAIAO+U+SHN+L9DBBB9P9d9FQBAN+oRGSFMCUUUU94RGMABAG87FBABCNJRBAFCaJHFQBMMM/SEIEaE99EaF99GXAF9FQBCBREABRIEXGXGX9D/zI818/AICKJ8uFBHLCEq+y+VHKAI8uFB+y+UHO9DB/+g6+U9DBBB8/9DBBB+/AO9DBBBB9gy+SHN+L9DBBB9P9d9FQBAN+oRVSFMCUUUU94RVMAICIJ8uFBRcAICGJ8uFBRMABALCFJCEZAEqCFWJAV87FBGXGXAKAM+y+UHN9DB/+g6+U9DBBB8/9DBBB+/AN9DBBBB9gy+SHS+L9DBBB9P9d9FQBAS+oRMSFMCUUUU94RMMABALCGJCEZAEqCFWJAM87FBGXGXAKAc+y+UHK9DB/+g6+U9DBBB8/9DBBB+/AK9DBBBB9gy+SHS+L9DBBB9P9d9FQBAS+oRcSFMCUUUU94RcMABALCaJCEZAEqCFWJAc87FBGXGX9DBBU8/AOAO+U+TANAN+U+TAKAK+U+THO9DBBBBAO9DBBBB9gy+R9DB/+g6+U9DBBB8/+SHO+L9DBBB9P9d9FQBAO+oRcSFMCUUUU94RcMABALCEZAEqCFWJAc87FBAICNJRIAECIJREAFCaJHFQBMMM9JBGXAGCGrAF9sHF9FQBEXABAB8oGBHGCNWCN91+yAGCi91CnWCUUU/8EJ+++U84GBABCIJRBAFCaJHFQBMMM9TFEaCBCB8oGUkUUBHFABCEJC98ZJHBjGUkUUBGXGXAB8/BCTWHGuQBCaREABAGlCggEJCTrXBCa6QFMAFREMAEM/lFFFaGXGXAFABqCEZ9FQBABRESFMGXGXAGCT9PQBABRESFMABREEXAEAF8oGBjGBAECIJAFCIJ8oGBjGBAECNJAFCNJ8oGBjGBAECSJAFCSJ8oGBjGBAECTJREAFCTJRFAGC9wJHGCb9LQBMMAGCI9JQBEXAEAF8oGBjGBAFCIJRFAECIJREAGC98JHGCE9LQBMMGXAG9FQBEXAEAF2BB86BBAECFJREAFCFJRFAGCaJHGQBMMABMoFFGaGXGXABCEZ9FQBABRESFMAFCgFZC+BwsN9sRIGXGXAGCT9PQBABRESFMABREEXAEAIjGBAECSJAIjGBAECNJAIjGBAECIJAIjGBAECTJREAGC9wJHGCb9LQBMMAGCI9JQBEXAEAIjGBAECIJREAGC98JHGCE9LQBMMGXAG9FQBEXAEAF86BBAECFJREAGCaJHGQBMMABMMMFBCUNMIT9kBB",e="B9h9z9tFBBBFiI9gBB9gLaaaaaFa9gEaaaB9gFaFaEMcBBFBFFGGGEILF9wFFFLEFBFKNFaFCx/aFMO/LFVK9tv9t9vq95GBt9f9f939h9z9t9f9j9h9s9s9f9jW9vq9zBBp9tv9z9o9v9wW9f9kv9j9v9kv9WvqWv94h919m9mvqBG8Z9tv9z9o9v9wW9f9kv9j9v9kv9J9u9kv94h919m9mvqBIy9tv9z9o9v9wW9f9kv9j9v9kv9J9u9kv949TvZ91v9u9jvBLn9tv9z9o9v9wW9f9kv9j9v9kv69p9sWvq9P9jWBKi9tv9z9o9v9wW9f9kv9j9v9kv69p9sWvq9R919hWBOn9tv9z9o9v9wW9f9kv9j9v9kv69p9sWvq9F949wBNI9z9iqlBVc+N9IcIBTEM9+FLa8jUUUUBCTlRBCBRFEXCBRGCBREEXABCNJAGJAECUaAFAGrCFZHIy86BBAEAIJREAGCFJHGCN9HQBMAFCx+YUUBJAE86BBAFCEWCxkUUBJAB8pEN83EBAFCFJHFCUG9HQBMMk8lLbaE97F9+FaL978jUUUUBCU/KBlHL8kUUUUBC9+RKGXAGCFJAI9LQBCaRKAE2BBC+gF9HQBALAEAIJHOAGlAG/8cBBCUoBAG9uC/wgBZHKCUGAKCUG9JyRNAECFJRKCBRVGXEXAVAF9PQFANAFAVlAVANJAF9JyRcGXGXAG9FQBAcCbJHIC9wZHMCE9sRSAMCFWRQAICIrCEJCGrRfCBRbEXAKRTCBRtGXEXGXAOATlAf9PQBCBRKSLMALCU/CBJAtAM9sJRmATAfJRKCBREGXAMCoB9JQBAOAKlC/gB9JQBCBRIEXAmAIJREGXGXGXGXGXATAICKrJ2BBHYCEZfIBFGEBMAECBDtDMIBSEMAEAKDBBIAKDBBBHPCID+MFAPDQBTFtGmEYIPLdKeOnHPCGD+MFAPDQBTFtGmEYIPLdKeOnC0+G+MiDtD9OHdCEDbD8jHPAPDQBFGENVcMILKOSQfbHeD8dBh+BsxoxoUwN0AeD8dFhxoUwkwk+gUa0sHnhTkAnsHnhNkAnsHn7CgFZHiCEWCxkUUBJDBEBAiCx+YUUBJDBBBHeAeDQBBBBBBBBBBBBBBBBAnhAk7CgFZHiCEWCxkUUBJDBEBD9uDQBFGEILKOTtmYPdenDfAdAPD9SDMIBAKCIJAeDeBJAiCx+YUUBJ2BBJRKSGMAEAKDBBNAKDBBBHPCID+MFAPDQBTFtGmEYIPLdKeOnC+P+e+8/4BDtD9OHdCbDbD8jHPAPDQBFGENVcMILKOSQfbHeD8dBh+BsxoxoUwN0AeD8dFhxoUwkwk+gUa0sHnhTkAnsHnhNkAnsHn7CgFZHiCEWCxkUUBJDBEBAiCx+YUUBJDBBBHeAeDQBBBBBBBBBBBBBBBBAnhAk7CgFZHiCEWCxkUUBJDBEBD9uDQBFGEILKOTtmYPdenDfAdAPD9SDMIBAKCNJAeDeBJAiCx+YUUBJ2BBJRKSFMAEAKDBBBDMIBAKCTJRKMGXGXGXGXGXAYCGrCEZfIBFGEBMAECBDtDMITSEMAEAKDBBIAKDBBBHPCID+MFAPDQBTFtGmEYIPLdKeOnHPCGD+MFAPDQBTFtGmEYIPLdKeOnC0+G+MiDtD9OHdCEDbD8jHPAPDQBFGENVcMILKOSQfbHeD8dBh+BsxoxoUwN0AeD8dFhxoUwkwk+gUa0sHnhTkAnsHnhNkAnsHn7CgFZHiCEWCxkUUBJDBEBAiCx+YUUBJDBBBHeAeDQBBBBBBBBBBBBBBBBAnhAk7CgFZHiCEWCxkUUBJDBEBD9uDQBFGEILKOTtmYPdenDfAdAPD9SDMITAKCIJAeDeBJAiCx+YUUBJ2BBJRKSGMAEAKDBBNAKDBBBHPCID+MFAPDQBTFtGmEYIPLdKeOnC+P+e+8/4BDtD9OHdCbDbD8jHPAPDQBFGENVcMILKOSQfbHeD8dBh+BsxoxoUwN0AeD8dFhxoUwkwk+gUa0sHnhTkAnsHnhNkAnsHn7CgFZHiCEWCxkUUBJDBEBAiCx+YUUBJDBBBHeAeDQBBBBBBBBBBBBBBBBAnhAk7CgFZHiCEWCxkUUBJDBEBD9uDQBFGEILKOTtmYPdenDfAdAPD9SDMITAKCNJAeDeBJAiCx+YUUBJ2BBJRKSFMAEAKDBBBDMITAKCTJRKMGXGXGXGXGXAYCIrCEZfIBFGEBMAECBDtDMIASEMAEAKDBBIAKDBBBHPCID+MFAPDQBTFtGmEYIPLdKeOnHPCGD+MFAPDQBTFtGmEYIPLdKeOnC0+G+MiDtD9OHdCEDbD8jHPAPDQBFGENVcMILKOSQfbHeD8dBh+BsxoxoUwN0AeD8dFhxoUwkwk+gUa0sHnhTkAnsHnhNkAnsHn7CgFZHiCEWCxkUUBJDBEBAiCx+YUUBJDBBBHeAeDQBBBBBBBBBBBBBBBBAnhAk7CgFZHiCEWCxkUUBJDBEBD9uDQBFGEILKOTtmYPdenDfAdAPD9SDMIAAKCIJAeDeBJAiCx+YUUBJ2BBJRKSGMAEAKDBBNAKDBBBHPCID+MFAPDQBTFtGmEYIPLdKeOnC+P+e+8/4BDtD9OHdCbDbD8jHPAPDQBFGENVcMILKOSQfbHeD8dBh+BsxoxoUwN0AeD8dFhxoUwkwk+gUa0sHnhTkAnsHnhNkAnsHn7CgFZHiCEWCxkUUBJDBEBAiCx+YUUBJDBBBHeAeDQBBBBBBBBBBBBBBBBAnhAk7CgFZHiCEWCxkUUBJDBEBD9uDQBFGEILKOTtmYPdenDfAdAPD9SDMIAAKCNJAeDeBJAiCx+YUUBJ2BBJRKSFMAEAKDBBBDMIAAKCTJRKMGXGXGXGXGXAYCKrfIBFGEBMAECBDtDMI8wSEMAEAKDBBIAKDBBBHPCID+MFAPDQBTFtGmEYIPLdKeOnHPCGD+MFAPDQBTFtGmEYIPLdKeOnC0+G+MiDtD9OHdCEDbD8jHPAPDQBFGENVcMILKOSQfbHeD8dBh+BsxoxoUwN0AeD8dFhxoUwkwk+gUa0sHnhTkAnsHnhNkAnsHn7CgFZHYCEWCxkUUBJDBEBAYCx+YUUBJDBBBHeAeDQBBBBBBBBBBBBBBBBAnhAk7CgFZHYCEWCxkUUBJDBEBD9uDQBFGEILKOTtmYPdenDfAdAPD9SDMI8wAKCIJAeDeBJAYCx+YUUBJ2BBJRKSGMAEAKDBBNAKDBBBHPCID+MFAPDQBTFtGmEYIPLdKeOnC+P+e+8/4BDtD9OHdCbDbD8jHPAPDQBFGENVcMILKOSQfbHeD8dBh+BsxoxoUwN0AeD8dFhxoUwkwk+gUa0sHnhTkAnsHnhNkAnsHn7CgFZHYCEWCxkUUBJDBEBAYCx+YUUBJDBBBHeAeDQBBBBBBBBBBBBBBBBAnhAk7CgFZHYCEWCxkUUBJDBEBD9uDQBFGEILKOTtmYPdenDfAdAPD9SDMI8wAKCNJAeDeBJAYCx+YUUBJ2BBJRKSFMAEAKDBBBDMI8wAKCTJRKMAICoBJREAICUFJAM9LQFAERIAOAKlC/fB9LQBMMGXAEAM9PQBAECErRIEXGXAOAKlCi9PQBCBRKSOMAmAEJRYGXGXGXGXGXATAECKrJ2BBAICKZrCEZfIBFGEBMAYCBDtDMIBSEMAYAKDBBIAKDBBBHPCID+MFAPDQBTFtGmEYIPLdKeOnHPCGD+MFAPDQBTFtGmEYIPLdKeOnC0+G+MiDtD9OHdCEDbD8jHPAPDQBFGENVcMILKOSQfbHeD8dBh+BsxoxoUwN0AeD8dFhxoUwkwk+gUa0sHnhTkAnsHnhNkAnsHn7CgFZHiCEWCxkUUBJDBEBAiCx+YUUBJDBBBHeAeDQBBBBBBBBBBBBBBBBAnhAk7CgFZHiCEWCxkUUBJDBEBD9uDQBFGEILKOTtmYPdenDfAdAPD9SDMIBAKCIJAeDeBJAiCx+YUUBJ2BBJRKSGMAYAKDBBNAKDBBBHPCID+MFAPDQBTFtGmEYIPLdKeOnC+P+e+8/4BDtD9OHdCbDbD8jHPAPDQBFGENVcMILKOSQfbHeD8dBh+BsxoxoUwN0AeD8dFhxoUwkwk+gUa0sHnhTkAnsHnhNkAnsHn7CgFZHiCEWCxkUUBJDBEBAiCx+YUUBJDBBBHeAeDQBBBBBBBBBBBBBBBBAnhAk7CgFZHiCEWCxkUUBJDBEBD9uDQBFGEILKOTtmYPdenDfAdAPD9SDMIBAKCNJAeDeBJAiCx+YUUBJ2BBJRKSFMAYAKDBBBDMIBAKCTJRKMAICGJRIAECTJHEAM9JQBMMGXAK9FQBAKRTAtCFJHtCI6QGSFMMCBRKSEMGXAM9FQBALCUGJAbJREALAbJDBGBReCBRYEXAEALCU/CBJAYJHIDBIBHdCFD9tAdCFDbHPD9OD9hD9RHdAIAMJDBIBH8ZCFD9tA8ZAPD9OD9hD9RH8ZDQBTFtGmEYIPLdKeOnHpAIAQJDBIBHyCFD9tAyAPD9OD9hD9RHyAIASJDBIBH8cCFD9tA8cAPD9OD9hD9RH8cDQBTFtGmEYIPLdKeOnH8dDQBFTtGEmYILPdKOenHPAPDQBFGEBFGEBFGEBFGEAeD9uHeDyBjGBAEAGJHIAeAPAPDQILKOILKOILKOILKOD9uHeDyBjGBAIAGJHIAeAPAPDQNVcMNVcMNVcMNVcMD9uHeDyBjGBAIAGJHIAeAPAPDQSQfbSQfbSQfbSQfbD9uHeDyBjGBAIAGJHIAeApA8dDQNVi8ZcMpySQ8c8dfb8e8fHPAPDQBFGEBFGEBFGEBFGED9uHeDyBjGBAIAGJHIAeAPAPDQILKOILKOILKOILKOD9uHeDyBjGBAIAGJHIAeAPAPDQNVcMNVcMNVcMNVcMD9uHeDyBjGBAIAGJHIAeAPAPDQSQfbSQfbSQfbSQfbD9uHeDyBjGBAIAGJHIAeAdA8ZDQNiV8ZcpMyS8cQ8df8eb8fHdAyA8cDQNiV8ZcpMyS8cQ8df8eb8fH8ZDQBFTtGEmYILPdKOenHPAPDQBFGEBFGEBFGEBFGED9uHeDyBjGBAIAGJHIAeAPAPDQILKOILKOILKOILKOD9uHeDyBjGBAIAGJHIAeAPAPDQNVcMNVcMNVcMNVcMD9uHeDyBjGBAIAGJHIAeAPAPDQSQfbSQfbSQfbSQfbD9uHeDyBjGBAIAGJHIAeAdA8ZDQNVi8ZcMpySQ8c8dfb8e8fHPAPDQBFGEBFGEBFGEBFGED9uHeDyBjGBAIAGJHIAeAPAPDQILKOILKOILKOILKOD9uHeDyBjGBAIAGJHIAeAPAPDQNVcMNVcMNVcMNVcMD9uHeDyBjGBAIAGJHIAeAPAPDQSQfbSQfbSQfbSQfbD9uHeDyBjGBAIAGJREAYCTJHYAM9JQBMMAbCIJHbAG9JQBMMABAVAG9sJALCUGJAcAG9s/8cBBALALCUGJAcCaJAG9sJAG/8cBBMAcCBAKyAVJRVAKQBMC9+RKSFMCBC99AOAKlAGCAAGCA9Ly6yRKMALCU/KBJ8kUUUUBAKMNBT+BUUUBM+KmFTa8jUUUUBCoFlHL8kUUUUBC9+RKGXAFCE9uHOCtJAI9LQBCaRKAE2BBHNC/wFZC/gF9HQBANCbZHVCF9LQBALCoBJCgFCUF/8MBALC84Jha83EBALC8wJha83EBALC8oJha83EBALCAJha83EBALCiJha83EBALCTJha83EBALha83ENALha83EBAEAIJC9wJRcAECFJHNAOJRMGXAF9FQBCQCbAVCF6yRSABRECBRVCBRQCBRfCBRICBRKEXGXAMAcuQBC9+RKSEMGXGXAN2BBHOC/vF9LQBALCoBJAOCIrCa9zAKJCbZCEWJHb8oGIRTAb8oGBRtGXAOCbZHbAS9PQBALAOCa9zAIJCbZCGWJ8oGBAVAbyROAb9FRbGXGXAGCG9HQBABAt87FBABCIJAO87FBABCGJAT87FBSFMAEAtjGBAECNJAOjGBAECIJATjGBMAVAbJRVALCoBJAKCEWJHmAOjGBAmATjGIALAICGWJAOjGBALCoBJAKCFJCbZHKCEWJHTAtjGBATAOjGIAIAbJRIAKCFJRKSGMGXGXAbCb6QBAQAbJAbC989zJCFJRQSFMAM1BBHbCgFZROGXGXAbCa9MQBAMCFJRMSFMAM1BFHbCgBZCOWAOCgBZqROGXAbCa9MQBAMCGJRMSFMAM1BGHbCgBZCfWAOqROGXAbCa9MQBAMCEJRMSFMAM1BEHbCgBZCdWAOqROGXAbCa9MQBAMCIJRMSFMAM2BIC8cWAOqROAMCLJRMMAOCFrCBAOCFZl9zAQJRQMGXGXAGCG9HQBABAt87FBABCIJAQ87FBABCGJAT87FBSFMAEAtjGBAECNJAQjGBAECIJATjGBMALCoBJAKCEWJHOAQjGBAOATjGIALAICGWJAQjGBALCoBJAKCFJCbZHKCEWJHOAtjGBAOAQjGIAICFJRIAKCFJRKSFMGXAOCDF9LQBALAIAcAOCbZJ2BBHbCIrHTlCbZCGWJ8oGBAVCFJHtATyROALAIAblCbZCGWJ8oGBAtAT9FHmJHtAbCbZHTyRbAT9FRTGXGXAGCG9HQBABAV87FBABCIJAb87FBABCGJAO87FBSFMAEAVjGBAECNJAbjGBAECIJAOjGBMALAICGWJAVjGBALCoBJAKCEWJHYAOjGBAYAVjGIALAICFJHICbZCGWJAOjGBALCoBJAKCFJCbZCEWJHYAbjGBAYAOjGIALAIAmJCbZHICGWJAbjGBALCoBJAKCGJCbZHKCEWJHOAVjGBAOAbjGIAKCFJRKAIATJRIAtATJRVSFMAVCBAM2BBHYyHTAOC/+F6HPJROAYCbZRtGXGXAYCIrHmQBAOCFJRbSFMAORbALAIAmlCbZCGWJ8oGBROMGXGXAtQBAbCFJRVSFMAbRVALAIAYlCbZCGWJ8oGBRbMGXGXAP9FQBAMCFJRYSFMAM1BFHYCgFZRTGXGXAYCa9MQBAMCGJRYSFMAM1BGHYCgBZCOWATCgBZqRTGXAYCa9MQBAMCEJRYSFMAM1BEHYCgBZCfWATqRTGXAYCa9MQBAMCIJRYSFMAM1BIHYCgBZCdWATqRTGXAYCa9MQBAMCLJRYSFMAMCKJRYAM2BLC8cWATqRTMATCFrCBATCFZl9zAQJHQRTMGXGXAmCb6QBAYRPSFMAY1BBHMCgFZROGXGXAMCa9MQBAYCFJRPSFMAY1BFHMCgBZCOWAOCgBZqROGXAMCa9MQBAYCGJRPSFMAY1BGHMCgBZCfWAOqROGXAMCa9MQBAYCEJRPSFMAY1BEHMCgBZCdWAOqROGXAMCa9MQBAYCIJRPSFMAYCLJRPAY2BIC8cWAOqROMAOCFrCBAOCFZl9zAQJHQROMGXGXAtCb6QBAPRMSFMAP1BBHMCgFZRbGXGXAMCa9MQBAPCFJRMSFMAP1BFHMCgBZCOWAbCgBZqRbGXAMCa9MQBAPCGJRMSFMAP1BGHMCgBZCfWAbqRbGXAMCa9MQBAPCEJRMSFMAP1BEHMCgBZCdWAbqRbGXAMCa9MQBAPCIJRMSFMAPCLJRMAP2BIC8cWAbqRbMAbCFrCBAbCFZl9zAQJHQRbMGXGXAGCG9HQBABAT87FBABCIJAb87FBABCGJAO87FBSFMAEATjGBAECNJAbjGBAECIJAOjGBMALCoBJAKCEWJHYAOjGBAYATjGIALAICGWJATjGBALCoBJAKCFJCbZCEWJHYAbjGBAYAOjGIALAICFJHICbZCGWJAOjGBALCoBJAKCGJCbZCEWJHOATjGBAOAbjGIALAIAm9FAmCb6qJHICbZCGWJAbjGBAIAt9FAtCb6qJRIAKCEJRKMANCFJRNABCKJRBAECSJREAKCbZRKAICbZRIAfCEJHfAF9JQBMMCBC99AMAc6yRKMALCoFJ8kUUUUBAKM/tIFGa8jUUUUBCTlRLC9+RKGXAFCLJAI9LQBCaRKAE2BBC/+FZC/QF9HQBALhB83ENAECFJRKAEAIJC98JREGXAF9FQBGXAGCG6QBEXGXAKAE9JQBC9+bMAK1BBHGCgFZRIGXGXAGCa9MQBAKCFJRKSFMAK1BFHGCgBZCOWAICgBZqRIGXAGCa9MQBAKCGJRKSFMAK1BGHGCgBZCfWAIqRIGXAGCa9MQBAKCEJRKSFMAK1BEHGCgBZCdWAIqRIGXAGCa9MQBAKCIJRKSFMAK2BIC8cWAIqRIAKCLJRKMALCNJAICFZCGWqHGAICGrCBAICFrCFZl9zAG8oGBJHIjGBABAIjGBABCIJRBAFCaJHFQBSGMMEXGXAKAE9JQBC9+bMAK1BBHGCgFZRIGXGXAGCa9MQBAKCFJRKSFMAK1BFHGCgBZCOWAICgBZqRIGXAGCa9MQBAKCGJRKSFMAK1BGHGCgBZCfWAIqRIGXAGCa9MQBAKCEJRKSFMAK1BEHGCgBZCdWAIqRIGXAGCa9MQBAKCIJRKSFMAK2BIC8cWAIqRIAKCLJRKMABAICGrCBAICFrCFZl9zALCNJAICFZCGWqHI8oGBJHG87FBAIAGjGBABCGJRBAFCaJHFQBMMCBC99AKAE6yRKMAKM/dLEK97FaF97GXGXAGCI9HQBAF9FQFCBRGEXABABDBBBHECiD+rFCiD+sFD/6FHIAECND+rFCiD+sFD/6FAID/gFAECTD+rFCiD+sFD/6FHLD/gFD/kFD/lFHKCBDtD+2FHOAICUUUU94DtHND9OD9RD/kFHI9DBB/+hDYAIAID/mFAKAKD/mFALAOALAND9OD9RD/kFHIAID/mFD/kFD/kFD/jFD/nFHLD/mF9DBBX9LDYHOD/kFCgFDtD9OAECUUU94DtD9OD9QAIALD/mFAOD/kFCND+rFCU/+EDtD9OD9QAKALD/mFAOD/kFCTD+rFCUU/8ODtD9OD9QDMBBABCTJRBAGCIJHGAF9JQBSGMMAF9FQBCBRGEXABCTJHVAVDBBBHECBDtHOCUU98D8cFCUU98D8cEHND9OABDBBBHKAEDQILKOSQfbPden8c8d8e8fCggFDtD9OD/6FAKAEDQBFGENVcMTtmYi8ZpyHECTD+sFD/6FHID/gFAECTD+rFCTD+sFD/6FHLD/gFD/kFD/lFHE9DB/+g6DYALAEAOD+2FHOALCUUUU94DtHcD9OD9RD/kFHLALD/mFAEAED/mFAIAOAIAcD9OD9RD/kFHEAED/mFD/kFD/kFD/jFD/nFHID/mF9DBBX9LDYHOD/kFCTD+rFALAID/mFAOD/kFCggEDtD9OD9QHLAEAID/mFAOD/kFCaDbCBDnGCBDnECBDnKCBDnOCBDncCBDnMCBDnfCBDnbD9OHEDQNVi8ZcMpySQ8c8dfb8e8fD9QDMBBABAKAND9OALAEDQBFTtGEmYILPdKOenD9QDMBBABCAJRBAGCIJHGAF9JQBMMM/hEIGaF97FaL978jUUUUBCTlREGXAF9FQBCBRIEXAEABDBBBHLABCTJHKDBBBHODQILKOSQfbPden8c8d8e8fHNCTD+sFHVCID+rFDMIBAB9DBBU8/DY9D/zI818/DYAVCEDtD9QD/6FD/nFHVALAODQBFGENVcMTtmYi8ZpyHLCTD+rFCTD+sFD/6FD/mFHOAOD/mFAVALCTD+sFD/6FD/mFHcAcD/mFAVANCTD+rFCTD+sFD/6FD/mFHNAND/mFD/kFD/kFD/lFCBDtD+4FD/jF9DB/+g6DYHVD/mF9DBBX9LDYHLD/kFCggEDtHMD9OAcAVD/mFALD/kFCTD+rFD9QHcANAVD/mFALD/kFCTD+rFAOAVD/mFALD/kFAMD9OD9QHVDQBFTtGEmYILPdKOenHLD8dBAEDBIBDyB+t+J83EBABCNJALD8dFAEDBIBDyF+t+J83EBAKAcAVDQNVi8ZcMpySQ8c8dfb8e8fHVD8dBAEDBIBDyG+t+J83EBABCiJAVD8dFAEDBIBDyE+t+J83EBABCAJRBAICIJHIAF9JQBMMM9jFF97GXAGCGrAF9sHG9FQBCBRFEXABABDBBBHECND+rFCND+sFD/6FAECiD+sFCnD+rFCUUU/8EDtD+uFD/mFDMBBABCTJRBAFCIJHFAG9JQBMMM9TFEaCBCB8oGUkUUBHFABCEJC98ZJHBjGUkUUBGXGXAB8/BCTWHGuQBCaREABAGlCggEJCTrXBCa6QFMAFREMAEMMMFBCUNMIT9tBB",t=new Uint8Array([0,97,115,109,1,0,0,0,1,4,1,96,0,0,3,3,2,0,0,5,3,1,0,1,12,1,0,10,22,2,12,0,65,0,65,0,65,0,252,10,0,0,11,7,0,65,0,253,15,26,11]),n=new Uint8Array([32,0,65,253,3,1,2,34,4,106,6,5,11,8,7,20,13,33,12,16,128,9,116,64,19,113,127,15,10,21,22,14,255,66,24,54,136,107,18,23,192,26,114,118,132,17,77,101,130,144,27,87,131,44,45,74,156,154,70,167]);if(typeof WebAssembly!="object")return{supported:!1};let i=s;WebAssembly.validate(t)&&(i=e);let o;const l=WebAssembly.instantiate(h(i),{}).then(v=>{o=v.instance,o.exports.__wasm_call_ctors()});function h(v){const y=new Uint8Array(v.length);for(let b=0;b<v.length;++b){const R=v.charCodeAt(b);y[b]=R>96?R-71:R>64?R-65:R>47?R+4:R>46?63:62}let x=0;for(let b=0;b<v.length;++b)y[x++]=y[b]<60?n[y[b]]:(y[b]-60)*64+y[++b];return y.buffer.slice(0,x)}function d(v,y,x,b,R,T){const M=o.exports.sbrk,w=x+3&-4,D=M(w*b),N=M(R.length),H=new Uint8Array(o.exports.memory.buffer);H.set(R,N);const O=v(D,x,b,N,R.length);if(O===0&&T&&T(D,w,b),y.set(H.subarray(D,D+x*b)),M(D-M(0)),O!==0)throw new Error(`Malformed buffer data: ${O}`)}const p={0:"",1:"meshopt_decodeFilterOct",2:"meshopt_decodeFilterQuat",3:"meshopt_decodeFilterExp",NONE:"",OCTAHEDRAL:"meshopt_decodeFilterOct",QUATERNION:"meshopt_decodeFilterQuat",EXPONENTIAL:"meshopt_decodeFilterExp"},_={0:"meshopt_decodeVertexBuffer",1:"meshopt_decodeIndexBuffer",2:"meshopt_decodeIndexSequence",ATTRIBUTES:"meshopt_decodeVertexBuffer",TRIANGLES:"meshopt_decodeIndexBuffer",INDICES:"meshopt_decodeIndexSequence"};return f_={ready:l,supported:!0,decodeVertexBuffer(v,y,x,b,R){d(o.exports.meshopt_decodeVertexBuffer,v,y,x,b,o.exports[p[R]])},decodeIndexBuffer(v,y,x,b){d(o.exports.meshopt_decodeIndexBuffer,v,y,x,b)},decodeIndexSequence(v,y,x,b){d(o.exports.meshopt_decodeIndexSequence,v,y,x,b)},decodeGltfBuffer(v,y,x,b,R,T){d(o.exports[_[R]],v,y,x,b,o.exports[p[T]])}},f_};let h_=null,WT="https://www.gstatic.com/draco/versioned/decoders/1.5.5/";function jT(s=!0,e=!0,t){return n=>{t&&t(n),s&&(h_||(h_=new wI),h_.setDecoderPath(typeof s=="string"?s:WT),n.setDRACOLoader(h_)),e&&n.setMeshoptDecoder(typeof TS=="function"?TS():TS)}}const zh=(s,e,t,n)=>Rl(yS,s,jT(e,t,n));zh.preload=(s,e,t,n)=>Rl.preload(yS,s,jT(e,t,n)),zh.clear=s=>Rl.clear(yS,s),zh.setDecoderPath=s=>{WT=s};const ZT=(s,e,t)=>{let n;switch(s){case Ta:n=new Uint8ClampedArray(e*t*4);break;case ki:n=new Uint16Array(e*t*4);break;case js:n=new Uint32Array(e*t*4);break;case Fg:n=new Int8Array(e*t*4);break;case Hg:n=new Int16Array(e*t*4);break;case np:n=new Int32Array(e*t*4);break;case Ci:n=new Float32Array(e*t*4);break;default:throw new Error("Unsupported data type")}return n};let d_;const DI=(s,e,t,n)=>{if(d_!==void 0)return d_;const i=new ds(1,1,n);e.setRenderTarget(i);const o=new yi(new Mc,new ha({color:16777215}));e.render(o,t),e.setRenderTarget(null);const l=ZT(s,i.width,i.height);return e.readRenderTargetPixels(i,0,0,i.width,i.height,l),i.dispose(),o.geometry.dispose(),o.material.dispose(),d_=l[0]!==0,d_};class CS{_renderer;_rendererIsDisposable=!1;_material;_scene;_camera;_quad;_renderTarget;_width;_height;_type;_colorSpace;_supportsReadPixels=!0;constructor(e){this._width=e.width,this._height=e.height,this._type=e.type,this._colorSpace=e.colorSpace;const t={format:Zi,depthBuffer:!1,stencilBuffer:!1,type:this._type,colorSpace:this._colorSpace,anisotropy:e.renderTargetOptions?.anisotropy!==void 0?e.renderTargetOptions?.anisotropy:1,generateMipmaps:e.renderTargetOptions?.generateMipmaps!==void 0?e.renderTargetOptions?.generateMipmaps:!1,magFilter:e.renderTargetOptions?.magFilter!==void 0?e.renderTargetOptions?.magFilter:Cn,minFilter:e.renderTargetOptions?.minFilter!==void 0?e.renderTargetOptions?.minFilter:Cn,samples:e.renderTargetOptions?.samples!==void 0?e.renderTargetOptions?.samples:void 0,wrapS:e.renderTargetOptions?.wrapS!==void 0?e.renderTargetOptions?.wrapS:Ei,wrapT:e.renderTargetOptions?.wrapT!==void 0?e.renderTargetOptions?.wrapT:Ei};if(this._material=e.material,e.renderer?this._renderer=e.renderer:(this._renderer=CS.instantiateRenderer(),this._rendererIsDisposable=!0),this._scene=new Mp,this._camera=new Tl,this._camera.position.set(0,0,10),this._camera.left=-.5,this._camera.right=.5,this._camera.top=.5,this._camera.bottom=-.5,this._camera.updateProjectionMatrix(),!DI(this._type,this._renderer,this._camera,t)){let n;this._type===ki&&(n=this._renderer.extensions.has("EXT_color_buffer_float")?Ci:void 0),n!==void 0?(console.warn(`This browser does not support reading pixels from ${this._type} RenderTargets, switching to ${Ci}`),this._type=n):(this._supportsReadPixels=!1,console.warn("This browser dos not support toArray or toDataTexture, calls to those methods will result in an error thrown"))}this._quad=new yi(new Mc,this._material),this._quad.geometry.computeBoundingBox(),this._scene.add(this._quad),this._renderTarget=new ds(this.width,this.height,t),this._renderTarget.texture.mapping=e.renderTargetOptions?.mapping!==void 0?e.renderTargetOptions?.mapping:rc}static instantiateRenderer(){const e=new HA;return e.setSize(128,128),e}render=()=>{this._renderer.setRenderTarget(this._renderTarget);try{this._renderer.render(this._scene,this._camera)}catch(e){throw this._renderer.setRenderTarget(null),e}this._renderer.setRenderTarget(null)};toArray(){if(!this._supportsReadPixels)throw new Error("Can't read pixels in this browser");const e=ZT(this._type,this._width,this._height);return this._renderer.readRenderTargetPixels(this._renderTarget,0,0,this._width,this._height,e),e}toDataTexture(e){const t=new _r(this.toArray(),this.width,this.height,Zi,this._type,e?.mapping||rc,e?.wrapS||Ei,e?.wrapT||Ei,e?.magFilter||Cn,e?.minFilter||Cn,e?.anisotropy||1,na);return t.generateMipmaps=e?.generateMipmaps!==void 0?e?.generateMipmaps:!1,t}disposeOnDemandRenderer(){this._renderer.setRenderTarget(null),this._rendererIsDisposable&&(this._renderer.dispose(),this._renderer.forceContextLoss())}dispose(e){this.disposeOnDemandRenderer(),e&&this.renderTarget.dispose(),this.material instanceof ms&&Object.values(this.material.uniforms).forEach(t=>{t.value instanceof Qn&&t.value.dispose()}),Object.values(this.material).forEach(t=>{t instanceof Qn&&t.dispose()}),this.material.dispose(),this._quad.geometry.dispose()}get width(){return this._width}set width(e){this._width=e,this._renderTarget.setSize(this._width,this._height)}get height(){return this._height}set height(e){this._height=e,this._renderTarget.setSize(this._width,this._height)}get renderer(){return this._renderer}get renderTarget(){return this._renderTarget}set renderTarget(e){this._renderTarget=e,this._width=e.width,this._height=e.height}get material(){return this._material}get type(){return this._type}get colorSpace(){return this._colorSpace}}class QT extends Error{}class $T extends Error{}const tm=(s,e,t)=>{const n=new RegExp(`${e}="([^"]*)"`,"i").exec(s);if(n)return n[1];const i=new RegExp(`<${e}[^>]*>([\\s\\S]*?)</${e}>`,"i").exec(s);if(i){const o=i[1].match(/<rdf:li>([^<]*)<\/rdf:li>/g);return o&&o.length===3?o.map(l=>l.replace(/<\/?rdf:li>/g,"")):i[1].trim()}if(t!==void 0)return t;throw new Error(`Can't find ${e} in gainmap metadata`)},NI=s=>{let e;typeof TextDecoder<"u"?e=new TextDecoder().decode(s):e=s.toString();let t=e.indexOf("<x:xmpmeta");for(;t!==-1;){const n=e.indexOf("x:xmpmeta>",t),i=e.slice(t,n+10);try{const o=tm(i,"hdrgm:GainMapMin","0"),l=tm(i,"hdrgm:GainMapMax"),h=tm(i,"hdrgm:Gamma","1"),d=tm(i,"hdrgm:OffsetSDR","0.015625"),p=tm(i,"hdrgm:OffsetHDR","0.015625"),_=/hdrgm:HDRCapacityMin="([^"]*)"/.exec(i),v=_?_[1]:"0",y=/hdrgm:HDRCapacityMax="([^"]*)"/.exec(i);if(!y)throw new Error("Incomplete gainmap metadata");const x=y[1];return{gainMapMin:Array.isArray(o)?o.map(b=>parseFloat(b)):[parseFloat(o),parseFloat(o),parseFloat(o)],gainMapMax:Array.isArray(l)?l.map(b=>parseFloat(b)):[parseFloat(l),parseFloat(l),parseFloat(l)],gamma:Array.isArray(h)?h.map(b=>parseFloat(b)):[parseFloat(h),parseFloat(h),parseFloat(h)],offsetSdr:Array.isArray(d)?d.map(b=>parseFloat(b)):[parseFloat(d),parseFloat(d),parseFloat(d)],offsetHdr:Array.isArray(p)?p.map(b=>parseFloat(b)):[parseFloat(p),parseFloat(p),parseFloat(p)],hdrCapacityMin:parseFloat(v),hdrCapacityMax:parseFloat(x)}}catch{}t=e.indexOf("<x:xmpmeta",n)}};class UI{options;constructor(e){this.options={debug:e&&e.debug!==void 0?e.debug:!1,extractFII:e&&e.extractFII!==void 0?e.extractFII:!0,extractNonFII:e&&e.extractNonFII!==void 0?e.extractNonFII:!0}}extract(e){return new Promise((t,n)=>{const i=this.options.debug,o=new DataView(e.buffer);if(o.getUint16(0)!==65496){n(new Error("Not a valid jpeg"));return}const l=o.byteLength;let h=2,d=0,p;for(;h<l;){if(++d>250){n(new Error(`Found no marker after ${d} loops 😵`));return}if(o.getUint8(h)!==255){n(new Error(`Not a valid marker at offset 0x${h.toString(16)}, found: 0x${o.getUint8(h).toString(16)}`));return}if(p=o.getUint8(h+1),i&&console.log(`Marker: ${p.toString(16)}`),p===226){i&&console.log("Found APP2 marker (0xffe2)");const _=h+4;if(o.getUint32(_)===1297106432){const v=_+4;let y;if(o.getUint16(v)===18761)y=!1;else if(o.getUint16(v)===19789)y=!0;else{n(new Error("No valid endianness marker found in TIFF header"));return}if(o.getUint16(v+2,!y)!==42){n(new Error("Not valid TIFF data! (no 0x002A marker)"));return}const x=o.getUint32(v+4,!y);if(x<8){n(new Error("Not valid TIFF data! (First offset less than 8)"));return}const b=v+x,R=o.getUint16(b,!y),T=b+2;let M=0;for(let H=T;H<T+12*R;H+=12)o.getUint16(H,!y)===45057&&(M=o.getUint32(H+8,!y));const D=b+2+R*12+4,N=[];for(let H=D;H<D+M*16;H+=16){const O={MPType:o.getUint32(H,!y),size:o.getUint32(H+4,!y),dataOffset:o.getUint32(H+8,!y),dependantImages:o.getUint32(H+12,!y),start:-1,end:-1,isFII:!1};O.dataOffset?(O.start=v+O.dataOffset,O.isFII=!1):(O.start=0,O.isFII=!0),O.end=O.start+O.size,N.push(O)}if(this.options.extractNonFII&&N.length){const H=new Blob([o]),O=[];for(const z of N){if(z.isFII&&!this.options.extractFII)continue;const V=H.slice(z.start,z.end+1,"image/jpeg");O.push(V)}t(O)}}}h+=2+o.getUint16(h+2)}})}}const LI=async s=>{const e=NI(s);if(!e)throw new $T("Gain map XMP metadata not found");const n=await new UI({extractFII:!0,extractNonFII:!0}).extract(s);if(n.length!==2)throw new QT("Gain map recovery image not found");return{sdr:new Uint8Array(await n[0].arrayBuffer()),gainMap:new Uint8Array(await n[1].arrayBuffer()),metadata:e}},eC=s=>new Promise((e,t)=>{const n=document.createElement("img");n.onload=()=>{e(n)},n.onerror=i=>{t(i)},n.src=URL.createObjectURL(s)});class OI extends Ba{_renderer;_renderTargetOptions;_internalLoadingManager;_config;constructor(e,t){super(t),this._config=e,e.renderer&&(this._renderer=e.renderer),this._internalLoadingManager=new Iv}setRenderer(e){return this._renderer=e,this}setRenderTargetOptions(e){return this._renderTargetOptions=e,this}prepareQuadRenderer(){this._renderer||console.warn("WARNING: A Renderer was not passed to this Loader constructor or in setRenderer, the result of this Loader will need to be converted to a Data Texture with toDataTexture() before you can use it in your renderer.");const e=this._config.createMaterial({gainMapMax:[1,1,1],gainMapMin:[0,0,0],gamma:[1,1,1],offsetHdr:[1,1,1],offsetSdr:[1,1,1],hdrCapacityMax:1,hdrCapacityMin:0,maxDisplayBoost:1,gainMap:new Qn,sdr:new Qn});return this._config.createQuadRenderer({width:16,height:16,type:ki,colorSpace:na,material:e,renderer:this._renderer,renderTargetOptions:this._renderTargetOptions})}async processImages(e,t,n){const i=t?new Blob([t],{type:"image/jpeg"}):void 0,o=new Blob([e],{type:"image/jpeg"});let l,h,d=!1;if(typeof createImageBitmap>"u"){const p=await Promise.all([i?eC(i):Promise.resolve(void 0),eC(o)]);h=p[0],l=p[1],d=n==="flipY"}else{const p=await Promise.all([i?createImageBitmap(i,{imageOrientation:n||"flipY"}):Promise.resolve(void 0),createImageBitmap(o,{imageOrientation:n||"flipY"})]);h=p[0],l=p[1]}return{sdrImage:l,gainMapImage:h,needsFlip:d}}createTextures(e,t,n){const i=new Qn(t||new ImageData(2,2),rc,Ei,Ei,Cn,tx,Zi,Ta,1,na);i.flipY=n,i.needsUpdate=!0;const o=new Qn(e,rc,Ei,Ei,Cn,tx,Zi,Ta,1,Xi);return o.flipY=n,o.needsUpdate=!0,{gainMap:i,sdr:o}}updateQuadRenderer(e,t,n,i,o){e.width=t.width,e.height=t.height,e.material.gainMap=n,e.material.sdr=i,e.material.gainMapMin=o.gainMapMin,e.material.gainMapMax=o.gainMapMax,e.material.offsetHdr=o.offsetHdr,e.material.offsetSdr=o.offsetSdr,e.material.gamma=o.gamma,e.material.hdrCapacityMin=o.hdrCapacityMin,e.material.hdrCapacityMax=o.hdrCapacityMax,e.material.maxDisplayBoost=Math.pow(2,o.hdrCapacityMax),e.material.needsUpdate=!0}}const II=`
|
|
4117
4117
|
varying vec2 vUv;
|
|
4118
4118
|
|
|
@@ -4146,9 +4146,9 @@ void main() {
|
|
|
4146
4146
|
vec3 clampedHdrColor = max( HALF_FLOAT_MIN, min( HALF_FLOAT_MAX, hdrColor ));
|
|
4147
4147
|
gl_FragColor = vec4( clampedHdrColor , 1.0 );
|
|
4148
4148
|
}
|
|
4149
|
-
`;class HI extends ms{_maxDisplayBoost;_hdrCapacityMin;_hdrCapacityMax;constructor({gamma:e,offsetHdr:t,offsetSdr:n,gainMapMin:i,gainMapMax:o,maxDisplayBoost:l,hdrCapacityMin:h,hdrCapacityMax:d,sdr:p,gainMap:_}){super({name:"GainMapDecoderMaterial",vertexShader:II,fragmentShader:FI,uniforms:{sdr:{value:p},gainMap:{value:_},gamma:{value:new Z(1/e[0],1/e[1],1/e[2])},offsetHdr:{value:new Z().fromArray(t)},offsetSdr:{value:new Z().fromArray(n)},gainMapMin:{value:new Z().fromArray(i)},gainMapMax:{value:new Z().fromArray(o)},weightFactor:{value:(Math.log2(l)-h)/(d-h)}},blending:Jr,depthTest:!1,depthWrite:!1}),this._maxDisplayBoost=l,this._hdrCapacityMin=h,this._hdrCapacityMax=d,this.needsUpdate=!0,this.uniformsNeedUpdate=!0}get sdr(){return this.uniforms.sdr.value}set sdr(e){this.uniforms.sdr.value=e}get gainMap(){return this.uniforms.gainMap.value}set gainMap(e){this.uniforms.gainMap.value=e}get offsetHdr(){return this.uniforms.offsetHdr.value.toArray()}set offsetHdr(e){this.uniforms.offsetHdr.value.fromArray(e)}get offsetSdr(){return this.uniforms.offsetSdr.value.toArray()}set offsetSdr(e){this.uniforms.offsetSdr.value.fromArray(e)}get gainMapMin(){return this.uniforms.gainMapMin.value.toArray()}set gainMapMin(e){this.uniforms.gainMapMin.value.fromArray(e)}get gainMapMax(){return this.uniforms.gainMapMax.value.toArray()}set gainMapMax(e){this.uniforms.gainMapMax.value.fromArray(e)}get gamma(){const e=this.uniforms.gamma.value;return[1/e.x,1/e.y,1/e.z]}set gamma(e){const t=this.uniforms.gamma.value;t.x=1/e[0],t.y=1/e[1],t.z=1/e[2]}get hdrCapacityMin(){return this._hdrCapacityMin}set hdrCapacityMin(e){this._hdrCapacityMin=e,this.calculateWeight()}get hdrCapacityMax(){return this._hdrCapacityMax}set hdrCapacityMax(e){this._hdrCapacityMax=e,this.calculateWeight()}get maxDisplayBoost(){return this._maxDisplayBoost}set maxDisplayBoost(e){this._maxDisplayBoost=Math.max(1,Math.min(65504,e)),this.calculateWeight()}calculateWeight(){const e=(Math.log2(this._maxDisplayBoost)-this._hdrCapacityMin)/(this._hdrCapacityMax-this._hdrCapacityMin);this.uniforms.weightFactor.value=Math.max(0,Math.min(1,e))}}class tC extends OI{constructor(e,t){super({renderer:e,createMaterial:n=>new HI(n),createQuadRenderer:n=>new CS(n)},t)}async render(e,t,n,i){const{sdrImage:o,gainMapImage:l,needsFlip:h}=await this.processImages(n,i,"flipY"),{gainMap:d,sdr:p}=this.createTextures(o,l,h);this.updateQuadRenderer(e,o,d,p,t),e.render()}}class PI extends tC{load([e,t,n],i,o,l){const h=this.prepareQuadRenderer();let d,p,_;const v=async()=>{if(d&&p&&_){try{await this.render(h,_,d,p)}catch(U){this.manager.itemError(e),this.manager.itemError(t),this.manager.itemError(n),typeof l=="function"&&l(U),h.disposeOnDemandRenderer();return}typeof i=="function"&&i(h),this.manager.itemEnd(e),this.manager.itemEnd(t),this.manager.itemEnd(n),h.disposeOnDemandRenderer()}};let y=!0,x=0,b=0,R=!0,T=0,M=0,w=!0,D=0,N=0;const H=()=>{if(typeof o=="function"){const U=x+T+D,F=b+M+N,K=y&&R&&w;o(new ProgressEvent("progress",{lengthComputable:K,loaded:F,total:U}))}};this.manager.itemStart(e),this.manager.itemStart(t),this.manager.itemStart(n);const O=new da(this._internalLoadingManager);O.setResponseType("arraybuffer"),O.setRequestHeader(this.requestHeader),O.setPath(this.path),O.setWithCredentials(this.withCredentials),O.load(e,async U=>{if(typeof U=="string")throw new Error("Invalid sdr buffer");d=U,await v()},U=>{y=U.lengthComputable,b=U.loaded,x=U.total,H()},U=>{this.manager.itemError(e),typeof l=="function"&&l(U)});const z=new da(this._internalLoadingManager);z.setResponseType("arraybuffer"),z.setRequestHeader(this.requestHeader),z.setPath(this.path),z.setWithCredentials(this.withCredentials),z.load(t,async U=>{if(typeof U=="string")throw new Error("Invalid gainmap buffer");p=U,await v()},U=>{R=U.lengthComputable,M=U.loaded,T=U.total,H()},U=>{this.manager.itemError(t),typeof l=="function"&&l(U)});const V=new da(this._internalLoadingManager);return V.setRequestHeader(this.requestHeader),V.setPath(this.path),V.setWithCredentials(this.withCredentials),V.load(n,async U=>{if(typeof U!="string")throw new Error("Invalid metadata string");_=JSON.parse(U),await v()},U=>{w=U.lengthComputable,N=U.loaded,D=U.total,H()},U=>{this.manager.itemError(n),typeof l=="function"&&l(U)}),h}}class GI extends tC{load(e,t,n,i){const o=this.prepareQuadRenderer(),l=new da(this._internalLoadingManager);return l.setResponseType("arraybuffer"),l.setRequestHeader(this.requestHeader),l.setPath(this.path),l.setWithCredentials(this.withCredentials),this.manager.itemStart(e),l.load(e,async h=>{if(typeof h=="string")throw new Error("Invalid buffer, received [string], was expecting [ArrayBuffer]");const d=new Uint8Array(h);let p,_,v;try{const y=await LI(d);p=y.sdr,_=y.gainMap,v=y.metadata}catch(y){if(y instanceof $T||y instanceof QT)console.warn(`Failure to reconstruct an HDR image from ${e}: Gain map metadata not found in the file, HDRJPGLoader will render the SDR jpeg`),v={gainMapMin:[0,0,0],gainMapMax:[1,1,1],gamma:[1,1,1],hdrCapacityMin:0,hdrCapacityMax:1,offsetHdr:[0,0,0],offsetSdr:[0,0,0]},p=d;else throw y}try{await this.render(o,v,p.buffer,_?.buffer)}catch(y){this.manager.itemError(e),typeof i=="function"&&i(y),o.disposeOnDemandRenderer();return}typeof t=="function"&&t(o),this.manager.itemEnd(e),o.disposeOnDemandRenderer()},n,h=>{this.manager.itemError(e),typeof i=="function"&&i(h)}),o}}const nm={apartment:"lebombo_1k.hdr",city:"potsdamer_platz_1k.hdr",dawn:"kiara_1_dawn_1k.hdr",forest:"forest_slope_1k.hdr",lobby:"st_fagans_interior_1k.hdr",night:"dikhololo_night_1k.hdr",park:"rooitou_park_1k.hdr",studio:"studio_small_03_1k.hdr",sunset:"venice_sunset_1k.hdr",warehouse:"empty_warehouse_01_1k.hdr"},nC="https://raw.githack.com/pmndrs/drei-assets/456060a26bbeb8fdf79326f224b6d99b8bcce736/hdri/",Vh=s=>Array.isArray(s),RS=["/px.png","/nx.png","/py.png","/ny.png","/pz.png","/nz.png"];function p_({files:s=RS,path:e="",preset:t=void 0,colorSpace:n=void 0,extensions:i}={}){t&&(wS(t),s=nm[t],e=nC);const o=Vh(s),{extension:l,isCubemap:h}=BS(s),d=DS(l);if(!d)throw new Error("useEnvironment: Unrecognized file extension: "+s);const p=Ih(x=>x.gl);Me.useLayoutEffect(()=>{if(l!=="webp"&&l!=="jpg"&&l!=="jpeg")return;function x(){Rl.clear(d,o?[s]:s)}p.domElement.addEventListener("webglcontextlost",x,{once:!0})},[s,p.domElement]);const _=Rl(d,o?[s]:s,x=>{(l==="webp"||l==="jpg"||l==="jpeg")&&x.setRenderer(p),x.setPath==null||x.setPath(e),i&&i(x)});let v=o?_[0]:_;if(l==="jpg"||l==="jpeg"||l==="webp"){var y;v=(y=v.renderTarget)==null?void 0:y.texture}return v.mapping=h?qr:Wf,v.colorSpace=n??(h?"srgb":"srgb-linear"),v}const zI={files:RS,path:"",preset:void 0,extensions:void 0};p_.preload=s=>{const e={...zI,...s};let{files:t,path:n=""}=e;const{preset:i,extensions:o}=e;i&&(wS(i),t=nm[i],n=nC);const{extension:l}=BS(t);if(l==="webp"||l==="jpg"||l==="jpeg")throw new Error("useEnvironment: Preloading gainmaps is not supported");const h=DS(l);if(!h)throw new Error("useEnvironment: Unrecognized file extension: "+t);Rl.preload(h,Vh(t)?[t]:t,d=>{d.setPath==null||d.setPath(n),o&&o(d)})};const VI={files:RS,preset:void 0};p_.clear=s=>{const e={...VI,...s};let{files:t}=e;const{preset:n}=e;n&&(wS(n),t=nm[n]);const{extension:i}=BS(t),o=DS(i);if(!o)throw new Error("useEnvironment: Unrecognized file extension: "+t);Rl.clear(o,Vh(t)?[t]:t)};function wS(s){if(!(s in nm))throw new Error("Preset must be one of: "+Object.keys(nm).join(", "))}function BS(s){var e;const t=Vh(s)&&s.length===6,n=Vh(s)&&s.length===3&&s.some(l=>l.endsWith("json")),i=Vh(s)?s[0]:s;return{extension:t?"cube":n?"webp":i.startsWith("data:application/exr")?"exr":i.startsWith("data:application/hdr")?"hdr":i.startsWith("data:image/jpeg")?"jpg":(e=i.split(".").pop())==null||(e=e.split("?"))==null||(e=e.shift())==null?void 0:e.toLowerCase(),isCubemap:t,isGainmap:n}}function DS(s){return s==="cube"?P1:s==="hdr"?CI:s==="exr"?RI:s==="jpg"||s==="jpeg"?GI:s==="webp"?PI:null}const kI=s=>s.current&&s.current.isScene,XI=s=>kI(s)?s.current:s;function NS(s,e,t,n,i={}){var o,l,h,d;i={backgroundBlurriness:0,backgroundIntensity:1,backgroundRotation:[0,0,0],environmentIntensity:1,environmentRotation:[0,0,0],...i};const p=XI(e||t),_=p.background,v=p.environment,y={backgroundBlurriness:p.backgroundBlurriness,backgroundIntensity:p.backgroundIntensity,backgroundRotation:(o=(l=p.backgroundRotation)==null||l.clone==null?void 0:l.clone())!==null&&o!==void 0?o:[0,0,0],environmentIntensity:p.environmentIntensity,environmentRotation:(h=(d=p.environmentRotation)==null||d.clone==null?void 0:d.clone())!==null&&h!==void 0?h:[0,0,0]};return s!=="only"&&(p.environment=n),s&&(p.background=n),No(p,i),()=>{s!=="only"&&(p.environment=v),s&&(p.background=_),No(p,y)}}function US({scene:s,background:e=!1,map:t,...n}){const i=Ih(o=>o.scene);return Me.useLayoutEffect(()=>{if(t)return NS(e,s,i,t,n)}),null}function iC({background:s=!1,scene:e,blur:t,backgroundBlurriness:n,backgroundIntensity:i,backgroundRotation:o,environmentIntensity:l,environmentRotation:h,...d}){const p=p_(d),_=Ih(v=>v.scene);return Me.useLayoutEffect(()=>NS(s,e,_,p,{backgroundBlurriness:t??n,backgroundIntensity:i,backgroundRotation:o,environmentIntensity:l,environmentRotation:h})),Me.useEffect(()=>()=>{p.dispose()},[p]),null}function YI({children:s,near:e=.1,far:t=1e3,resolution:n=256,frames:i=1,map:o,background:l=!1,blur:h,backgroundBlurriness:d,backgroundIntensity:p,backgroundRotation:_,environmentIntensity:v,environmentRotation:y,scene:x,files:b,path:R,preset:T=void 0,extensions:M}){const w=Ih(V=>V.gl),D=Ih(V=>V.scene),N=Me.useRef(null),[H]=Me.useState(()=>new Mp),O=Me.useMemo(()=>{const V=new Y0(n);return V.texture.type=ki,V},[n]);Me.useEffect(()=>()=>{O.dispose()},[O]),Me.useLayoutEffect(()=>{if(i===1){const V=w.autoClear;w.autoClear=!0,N.current.update(w,H),w.autoClear=V}return NS(l,x,D,O.texture,{backgroundBlurriness:h??d,backgroundIntensity:p,backgroundRotation:_,environmentIntensity:v,environmentRotation:y})},[s,H,O.texture,x,D,l,i,w]);let z=1;return yT(()=>{if(i===1/0||z<i){const V=w.autoClear;w.autoClear=!0,N.current.update(w,H),w.autoClear=V,z++}}),Me.createElement(Me.Fragment,null,_O(Me.createElement(Me.Fragment,null,s,Me.createElement("cubeCamera",{ref:N,args:[e,t,O]}),b||T?Me.createElement(iC,{background:!0,files:b,preset:T,path:R,extensions:M}):o?Me.createElement(US,{background:!0,map:o,extensions:M}):null),H))}function JI(s){var e,t,n,i;const o=p_(s),l=s.map||o;Me.useMemo(()=>MT({GroundProjectedEnvImpl:YO}),[]),Me.useEffect(()=>()=>{o.dispose()},[o]);const h=Me.useMemo(()=>[l],[l]),d=(e=s.ground)==null?void 0:e.height,p=(t=s.ground)==null?void 0:t.radius,_=(n=(i=s.ground)==null?void 0:i.scale)!==null&&n!==void 0?n:1e3;return Me.createElement(Me.Fragment,null,Me.createElement(US,ky({},s,{map:l})),Me.createElement("groundProjectedEnvImpl",{args:h,scale:_,height:d,radius:p}))}function qI(s){return s.ground?Me.createElement(JI,s):s.map?Me.createElement(US,s):s.children?Me.createElement(YI,s):Me.createElement(iC,s)}function aC(s,e){if(e===ox)return console.warn("THREE.BufferGeometryUtils.toTrianglesDrawMode(): Geometry already defined as triangles."),s;if(e===bu||e===fp){let t=s.getIndex();if(t===null){const l=[],h=s.getAttribute("position");if(h!==void 0){for(let d=0;d<h.count;d++)l.push(d);s.setIndex(l),t=s.getIndex()}else return console.error("THREE.BufferGeometryUtils.toTrianglesDrawMode(): Undefined position attribute. Processing not possible."),s}const n=t.count-2,i=[];if(e===bu)for(let l=1;l<=n;l++)i.push(t.getX(0)),i.push(t.getX(l)),i.push(t.getX(l+1));else for(let l=0;l<n;l++)l%2===0?(i.push(t.getX(l)),i.push(t.getX(l+1)),i.push(t.getX(l+2))):(i.push(t.getX(l+2)),i.push(t.getX(l+1)),i.push(t.getX(l)));i.length/3!==n&&console.error("THREE.BufferGeometryUtils.toTrianglesDrawMode(): Unable to generate correct amount of triangles.");const o=s.clone();return o.setIndex(i),o.clearGroups(),o}else return console.error("THREE.BufferGeometryUtils.toTrianglesDrawMode(): Unknown draw mode:",e),s}class KI extends Ba{constructor(e){super(e),this.dracoLoader=null,this.ktx2Loader=null,this.meshoptDecoder=null,this.pluginCallbacks=[],this.register(function(t){return new $I(t)}),this.register(function(t){return new eF(t)}),this.register(function(t){return new cF(t)}),this.register(function(t){return new uF(t)}),this.register(function(t){return new fF(t)}),this.register(function(t){return new nF(t)}),this.register(function(t){return new iF(t)}),this.register(function(t){return new aF(t)}),this.register(function(t){return new sF(t)}),this.register(function(t){return new QI(t)}),this.register(function(t){return new rF(t)}),this.register(function(t){return new tF(t)}),this.register(function(t){return new lF(t)}),this.register(function(t){return new oF(t)}),this.register(function(t){return new jI(t)}),this.register(function(t){return new hF(t)}),this.register(function(t){return new dF(t)})}load(e,t,n,i){const o=this;let l;if(this.resourcePath!=="")l=this.resourcePath;else if(this.path!==""){const p=nr.extractUrlBase(e);l=nr.resolveURL(p,this.path)}else l=nr.extractUrlBase(e);this.manager.itemStart(e);const h=function(p){i?i(p):console.error(p),o.manager.itemError(e),o.manager.itemEnd(e)},d=new da(this.manager);d.setPath(this.path),d.setResponseType("arraybuffer"),d.setRequestHeader(this.requestHeader),d.setWithCredentials(this.withCredentials),d.load(e,function(p){try{o.parse(p,l,function(_){t(_),o.manager.itemEnd(e)},h)}catch(_){h(_)}},n,h)}setDRACOLoader(e){return this.dracoLoader=e,this}setKTX2Loader(e){return this.ktx2Loader=e,this}setMeshoptDecoder(e){return this.meshoptDecoder=e,this}register(e){return this.pluginCallbacks.indexOf(e)===-1&&this.pluginCallbacks.push(e),this}unregister(e){return this.pluginCallbacks.indexOf(e)!==-1&&this.pluginCallbacks.splice(this.pluginCallbacks.indexOf(e),1),this}parse(e,t,n,i){let o;const l={},h={},d=new TextDecoder;if(typeof e=="string")o=JSON.parse(e);else if(e instanceof ArrayBuffer)if(d.decode(new Uint8Array(e,0,4))===sC){try{l[On.KHR_BINARY_GLTF]=new pF(e)}catch(v){i&&i(v);return}o=JSON.parse(l[On.KHR_BINARY_GLTF].content)}else o=JSON.parse(d.decode(e));else o=e;if(o.asset===void 0||o.asset.version[0]<2){i&&i(new Error("THREE.GLTFLoader: Unsupported asset. glTF versions >=2.0 are supported."));return}const p=new CF(o,{path:t||this.resourcePath||"",crossOrigin:this.crossOrigin,requestHeader:this.requestHeader,manager:this.manager,ktx2Loader:this.ktx2Loader,meshoptDecoder:this.meshoptDecoder});p.fileLoader.setRequestHeader(this.requestHeader);for(let _=0;_<this.pluginCallbacks.length;_++){const v=this.pluginCallbacks[_](p);v.name||console.error("THREE.GLTFLoader: Invalid plugin found: missing name"),h[v.name]=v,l[v.name]=!0}if(o.extensionsUsed)for(let _=0;_<o.extensionsUsed.length;++_){const v=o.extensionsUsed[_],y=o.extensionsRequired||[];switch(v){case On.KHR_MATERIALS_UNLIT:l[v]=new ZI;break;case On.KHR_DRACO_MESH_COMPRESSION:l[v]=new mF(o,this.dracoLoader);break;case On.KHR_TEXTURE_TRANSFORM:l[v]=new gF;break;case On.KHR_MESH_QUANTIZATION:l[v]=new vF;break;default:y.indexOf(v)>=0&&h[v]===void 0&&console.warn('THREE.GLTFLoader: Unknown extension "'+v+'".')}}p.setExtensions(l),p.setPlugins(h),p.parse(n,i)}parseAsync(e,t){const n=this;return new Promise(function(i,o){n.parse(e,t,i,o)})}}function WI(){let s={};return{get:function(e){return s[e]},add:function(e,t){s[e]=t},remove:function(e){delete s[e]},removeAll:function(){s={}}}}const On={KHR_BINARY_GLTF:"KHR_binary_glTF",KHR_DRACO_MESH_COMPRESSION:"KHR_draco_mesh_compression",KHR_LIGHTS_PUNCTUAL:"KHR_lights_punctual",KHR_MATERIALS_CLEARCOAT:"KHR_materials_clearcoat",KHR_MATERIALS_DISPERSION:"KHR_materials_dispersion",KHR_MATERIALS_IOR:"KHR_materials_ior",KHR_MATERIALS_SHEEN:"KHR_materials_sheen",KHR_MATERIALS_SPECULAR:"KHR_materials_specular",KHR_MATERIALS_TRANSMISSION:"KHR_materials_transmission",KHR_MATERIALS_IRIDESCENCE:"KHR_materials_iridescence",KHR_MATERIALS_ANISOTROPY:"KHR_materials_anisotropy",KHR_MATERIALS_UNLIT:"KHR_materials_unlit",KHR_MATERIALS_VOLUME:"KHR_materials_volume",KHR_TEXTURE_BASISU:"KHR_texture_basisu",KHR_TEXTURE_TRANSFORM:"KHR_texture_transform",KHR_MESH_QUANTIZATION:"KHR_mesh_quantization",KHR_MATERIALS_EMISSIVE_STRENGTH:"KHR_materials_emissive_strength",EXT_MATERIALS_BUMP:"EXT_materials_bump",EXT_TEXTURE_WEBP:"EXT_texture_webp",EXT_TEXTURE_AVIF:"EXT_texture_avif",EXT_MESHOPT_COMPRESSION:"EXT_meshopt_compression",EXT_MESH_GPU_INSTANCING:"EXT_mesh_gpu_instancing"};class jI{constructor(e){this.parser=e,this.name=On.KHR_LIGHTS_PUNCTUAL,this.cache={refs:{},uses:{}}}_markDefs(){const e=this.parser,t=this.parser.json.nodes||[];for(let n=0,i=t.length;n<i;n++){const o=t[n];o.extensions&&o.extensions[this.name]&&o.extensions[this.name].light!==void 0&&e._addNodeRef(this.cache,o.extensions[this.name].light)}}_loadLight(e){const t=this.parser,n="light:"+e;let i=t.cache.get(n);if(i)return i;const o=t.json,d=((o.extensions&&o.extensions[this.name]||{}).lights||[])[e];let p;const _=new Ct(16777215);d.color!==void 0&&_.setRGB(d.color[0],d.color[1],d.color[2],na);const v=d.range!==void 0?d.range:0;switch(d.type){case"directional":p=new Pv(_),p.target.position.set(0,0,-1),p.add(p.target);break;case"point":p=new Hv(_),p.distance=v;break;case"spot":p=new Fv(_),p.distance=v,d.spot=d.spot||{},d.spot.innerConeAngle=d.spot.innerConeAngle!==void 0?d.spot.innerConeAngle:0,d.spot.outerConeAngle=d.spot.outerConeAngle!==void 0?d.spot.outerConeAngle:Math.PI/4,p.angle=d.spot.outerConeAngle,p.penumbra=1-d.spot.innerConeAngle/d.spot.outerConeAngle,p.target.position.set(0,0,-1),p.add(p.target);break;default:throw new Error("THREE.GLTFLoader: Unexpected light type: "+d.type)}return p.position.set(0,0,0),Uo(p,d),d.intensity!==void 0&&(p.intensity=d.intensity),p.name=t.createUniqueName(d.name||"light_"+e),i=Promise.resolve(p),t.cache.add(n,i),i}getDependency(e,t){if(e==="light")return this._loadLight(t)}createNodeAttachment(e){const t=this,n=this.parser,o=n.json.nodes[e],h=(o.extensions&&o.extensions[this.name]||{}).light;return h===void 0?null:this._loadLight(h).then(function(d){return n._getNodeRef(t.cache,h,d)})}}class ZI{constructor(){this.name=On.KHR_MATERIALS_UNLIT}getMaterialType(){return ha}extendParams(e,t,n){const i=[];e.color=new Ct(1,1,1),e.opacity=1;const o=t.pbrMetallicRoughness;if(o){if(Array.isArray(o.baseColorFactor)){const l=o.baseColorFactor;e.color.setRGB(l[0],l[1],l[2],na),e.opacity=l[3]}o.baseColorTexture!==void 0&&i.push(n.assignTexture(e,"map",o.baseColorTexture,Xi))}return Promise.all(i)}}class QI{constructor(e){this.parser=e,this.name=On.KHR_MATERIALS_EMISSIVE_STRENGTH}extendMaterialParams(e,t){const i=this.parser.json.materials[e];if(!i.extensions||!i.extensions[this.name])return Promise.resolve();const o=i.extensions[this.name].emissiveStrength;return o!==void 0&&(t.emissiveIntensity=o),Promise.resolve()}}class $I{constructor(e){this.parser=e,this.name=On.KHR_MATERIALS_CLEARCOAT}getMaterialType(e){const n=this.parser.json.materials[e];return!n.extensions||!n.extensions[this.name]?null:Ji}extendMaterialParams(e,t){const n=this.parser,i=n.json.materials[e];if(!i.extensions||!i.extensions[this.name])return Promise.resolve();const o=[],l=i.extensions[this.name];if(l.clearcoatFactor!==void 0&&(t.clearcoat=l.clearcoatFactor),l.clearcoatTexture!==void 0&&o.push(n.assignTexture(t,"clearcoatMap",l.clearcoatTexture)),l.clearcoatRoughnessFactor!==void 0&&(t.clearcoatRoughness=l.clearcoatRoughnessFactor),l.clearcoatRoughnessTexture!==void 0&&o.push(n.assignTexture(t,"clearcoatRoughnessMap",l.clearcoatRoughnessTexture)),l.clearcoatNormalTexture!==void 0&&(o.push(n.assignTexture(t,"clearcoatNormalMap",l.clearcoatNormalTexture)),l.clearcoatNormalTexture.scale!==void 0)){const h=l.clearcoatNormalTexture.scale;t.clearcoatNormalScale=new nt(h,h)}return Promise.all(o)}}class eF{constructor(e){this.parser=e,this.name=On.KHR_MATERIALS_DISPERSION}getMaterialType(e){const n=this.parser.json.materials[e];return!n.extensions||!n.extensions[this.name]?null:Ji}extendMaterialParams(e,t){const i=this.parser.json.materials[e];if(!i.extensions||!i.extensions[this.name])return Promise.resolve();const o=i.extensions[this.name];return t.dispersion=o.dispersion!==void 0?o.dispersion:0,Promise.resolve()}}class tF{constructor(e){this.parser=e,this.name=On.KHR_MATERIALS_IRIDESCENCE}getMaterialType(e){const n=this.parser.json.materials[e];return!n.extensions||!n.extensions[this.name]?null:Ji}extendMaterialParams(e,t){const n=this.parser,i=n.json.materials[e];if(!i.extensions||!i.extensions[this.name])return Promise.resolve();const o=[],l=i.extensions[this.name];return l.iridescenceFactor!==void 0&&(t.iridescence=l.iridescenceFactor),l.iridescenceTexture!==void 0&&o.push(n.assignTexture(t,"iridescenceMap",l.iridescenceTexture)),l.iridescenceIor!==void 0&&(t.iridescenceIOR=l.iridescenceIor),t.iridescenceThicknessRange===void 0&&(t.iridescenceThicknessRange=[100,400]),l.iridescenceThicknessMinimum!==void 0&&(t.iridescenceThicknessRange[0]=l.iridescenceThicknessMinimum),l.iridescenceThicknessMaximum!==void 0&&(t.iridescenceThicknessRange[1]=l.iridescenceThicknessMaximum),l.iridescenceThicknessTexture!==void 0&&o.push(n.assignTexture(t,"iridescenceThicknessMap",l.iridescenceThicknessTexture)),Promise.all(o)}}class nF{constructor(e){this.parser=e,this.name=On.KHR_MATERIALS_SHEEN}getMaterialType(e){const n=this.parser.json.materials[e];return!n.extensions||!n.extensions[this.name]?null:Ji}extendMaterialParams(e,t){const n=this.parser,i=n.json.materials[e];if(!i.extensions||!i.extensions[this.name])return Promise.resolve();const o=[];t.sheenColor=new Ct(0,0,0),t.sheenRoughness=0,t.sheen=1;const l=i.extensions[this.name];if(l.sheenColorFactor!==void 0){const h=l.sheenColorFactor;t.sheenColor.setRGB(h[0],h[1],h[2],na)}return l.sheenRoughnessFactor!==void 0&&(t.sheenRoughness=l.sheenRoughnessFactor),l.sheenColorTexture!==void 0&&o.push(n.assignTexture(t,"sheenColorMap",l.sheenColorTexture,Xi)),l.sheenRoughnessTexture!==void 0&&o.push(n.assignTexture(t,"sheenRoughnessMap",l.sheenRoughnessTexture)),Promise.all(o)}}class iF{constructor(e){this.parser=e,this.name=On.KHR_MATERIALS_TRANSMISSION}getMaterialType(e){const n=this.parser.json.materials[e];return!n.extensions||!n.extensions[this.name]?null:Ji}extendMaterialParams(e,t){const n=this.parser,i=n.json.materials[e];if(!i.extensions||!i.extensions[this.name])return Promise.resolve();const o=[],l=i.extensions[this.name];return l.transmissionFactor!==void 0&&(t.transmission=l.transmissionFactor),l.transmissionTexture!==void 0&&o.push(n.assignTexture(t,"transmissionMap",l.transmissionTexture)),Promise.all(o)}}class aF{constructor(e){this.parser=e,this.name=On.KHR_MATERIALS_VOLUME}getMaterialType(e){const n=this.parser.json.materials[e];return!n.extensions||!n.extensions[this.name]?null:Ji}extendMaterialParams(e,t){const n=this.parser,i=n.json.materials[e];if(!i.extensions||!i.extensions[this.name])return Promise.resolve();const o=[],l=i.extensions[this.name];t.thickness=l.thicknessFactor!==void 0?l.thicknessFactor:0,l.thicknessTexture!==void 0&&o.push(n.assignTexture(t,"thicknessMap",l.thicknessTexture)),t.attenuationDistance=l.attenuationDistance||1/0;const h=l.attenuationColor||[1,1,1];return t.attenuationColor=new Ct().setRGB(h[0],h[1],h[2],na),Promise.all(o)}}class sF{constructor(e){this.parser=e,this.name=On.KHR_MATERIALS_IOR}getMaterialType(e){const n=this.parser.json.materials[e];return!n.extensions||!n.extensions[this.name]?null:Ji}extendMaterialParams(e,t){const i=this.parser.json.materials[e];if(!i.extensions||!i.extensions[this.name])return Promise.resolve();const o=i.extensions[this.name];return t.ior=o.ior!==void 0?o.ior:1.5,Promise.resolve()}}class rF{constructor(e){this.parser=e,this.name=On.KHR_MATERIALS_SPECULAR}getMaterialType(e){const n=this.parser.json.materials[e];return!n.extensions||!n.extensions[this.name]?null:Ji}extendMaterialParams(e,t){const n=this.parser,i=n.json.materials[e];if(!i.extensions||!i.extensions[this.name])return Promise.resolve();const o=[],l=i.extensions[this.name];t.specularIntensity=l.specularFactor!==void 0?l.specularFactor:1,l.specularTexture!==void 0&&o.push(n.assignTexture(t,"specularIntensityMap",l.specularTexture));const h=l.specularColorFactor||[1,1,1];return t.specularColor=new Ct().setRGB(h[0],h[1],h[2],na),l.specularColorTexture!==void 0&&o.push(n.assignTexture(t,"specularColorMap",l.specularColorTexture,Xi)),Promise.all(o)}}class oF{constructor(e){this.parser=e,this.name=On.EXT_MATERIALS_BUMP}getMaterialType(e){const n=this.parser.json.materials[e];return!n.extensions||!n.extensions[this.name]?null:Ji}extendMaterialParams(e,t){const n=this.parser,i=n.json.materials[e];if(!i.extensions||!i.extensions[this.name])return Promise.resolve();const o=[],l=i.extensions[this.name];return t.bumpScale=l.bumpFactor!==void 0?l.bumpFactor:1,l.bumpTexture!==void 0&&o.push(n.assignTexture(t,"bumpMap",l.bumpTexture)),Promise.all(o)}}class lF{constructor(e){this.parser=e,this.name=On.KHR_MATERIALS_ANISOTROPY}getMaterialType(e){const n=this.parser.json.materials[e];return!n.extensions||!n.extensions[this.name]?null:Ji}extendMaterialParams(e,t){const n=this.parser,i=n.json.materials[e];if(!i.extensions||!i.extensions[this.name])return Promise.resolve();const o=[],l=i.extensions[this.name];return l.anisotropyStrength!==void 0&&(t.anisotropy=l.anisotropyStrength),l.anisotropyRotation!==void 0&&(t.anisotropyRotation=l.anisotropyRotation),l.anisotropyTexture!==void 0&&o.push(n.assignTexture(t,"anisotropyMap",l.anisotropyTexture)),Promise.all(o)}}class cF{constructor(e){this.parser=e,this.name=On.KHR_TEXTURE_BASISU}loadTexture(e){const t=this.parser,n=t.json,i=n.textures[e];if(!i.extensions||!i.extensions[this.name])return null;const o=i.extensions[this.name],l=t.options.ktx2Loader;if(!l){if(n.extensionsRequired&&n.extensionsRequired.indexOf(this.name)>=0)throw new Error("THREE.GLTFLoader: setKTX2Loader must be called before loading KTX2 textures");return null}return t.loadTextureImage(e,o.source,l)}}class uF{constructor(e){this.parser=e,this.name=On.EXT_TEXTURE_WEBP}loadTexture(e){const t=this.name,n=this.parser,i=n.json,o=i.textures[e];if(!o.extensions||!o.extensions[t])return null;const l=o.extensions[t],h=i.images[l.source];let d=n.textureLoader;if(h.uri){const p=n.options.manager.getHandler(h.uri);p!==null&&(d=p)}return n.loadTextureImage(e,l.source,d)}}class fF{constructor(e){this.parser=e,this.name=On.EXT_TEXTURE_AVIF}loadTexture(e){const t=this.name,n=this.parser,i=n.json,o=i.textures[e];if(!o.extensions||!o.extensions[t])return null;const l=o.extensions[t],h=i.images[l.source];let d=n.textureLoader;if(h.uri){const p=n.options.manager.getHandler(h.uri);p!==null&&(d=p)}return n.loadTextureImage(e,l.source,d)}}class hF{constructor(e){this.name=On.EXT_MESHOPT_COMPRESSION,this.parser=e}loadBufferView(e){const t=this.parser.json,n=t.bufferViews[e];if(n.extensions&&n.extensions[this.name]){const i=n.extensions[this.name],o=this.parser.getDependency("buffer",i.buffer),l=this.parser.options.meshoptDecoder;if(!l||!l.supported){if(t.extensionsRequired&&t.extensionsRequired.indexOf(this.name)>=0)throw new Error("THREE.GLTFLoader: setMeshoptDecoder must be called before loading compressed files");return null}return o.then(function(h){const d=i.byteOffset||0,p=i.byteLength||0,_=i.count,v=i.byteStride,y=new Uint8Array(h,d,p);return l.decodeGltfBufferAsync?l.decodeGltfBufferAsync(_,v,y,i.mode,i.filter).then(function(x){return x.buffer}):l.ready.then(function(){const x=new ArrayBuffer(_*v);return l.decodeGltfBuffer(new Uint8Array(x),_,v,y,i.mode,i.filter),x})})}else return null}}class dF{constructor(e){this.name=On.EXT_MESH_GPU_INSTANCING,this.parser=e}createNodeMesh(e){const t=this.parser.json,n=t.nodes[e];if(!n.extensions||!n.extensions[this.name]||n.mesh===void 0)return null;const i=t.meshes[n.mesh];for(const p of i.primitives)if(p.mode!==Mr.TRIANGLES&&p.mode!==Mr.TRIANGLE_STRIP&&p.mode!==Mr.TRIANGLE_FAN&&p.mode!==void 0)return null;const l=n.extensions[this.name].attributes,h=[],d={};for(const p in l)h.push(this.parser.getDependency("accessor",l[p]).then(_=>(d[p]=_,d[p])));return h.length<1?null:(h.push(this.parser.createNodeMesh(e)),Promise.all(h).then(p=>{const _=p.pop(),v=_.isGroup?_.children:[_],y=p[0].count,x=[];for(const b of v){const R=new en,T=new Z,M=new Ca,w=new Z(1,1,1),D=new nv(b.geometry,b.material,y);for(let N=0;N<y;N++)d.TRANSLATION&&T.fromBufferAttribute(d.TRANSLATION,N),d.ROTATION&&M.fromBufferAttribute(d.ROTATION,N),d.SCALE&&w.fromBufferAttribute(d.SCALE,N),D.setMatrixAt(N,R.compose(T,M,w));for(const N in d)if(N==="_COLOR_0"){const H=d[N];D.instanceColor=new xc(H.array,H.itemSize,H.normalized)}else N!=="TRANSLATION"&&N!=="ROTATION"&&N!=="SCALE"&&b.geometry.setAttribute(N,d[N]);Un.prototype.copy.call(D,b),this.parser.assignFinalMaterial(D),x.push(D)}return _.isGroup?(_.clear(),_.add(...x),_):x[0]}))}}const sC="glTF",im=12,rC={JSON:1313821514,BIN:5130562};class pF{constructor(e){this.name=On.KHR_BINARY_GLTF,this.content=null,this.body=null;const t=new DataView(e,0,im),n=new TextDecoder;if(this.header={magic:n.decode(new Uint8Array(e.slice(0,4))),version:t.getUint32(4,!0),length:t.getUint32(8,!0)},this.header.magic!==sC)throw new Error("THREE.GLTFLoader: Unsupported glTF-Binary header.");if(this.header.version<2)throw new Error("THREE.GLTFLoader: Legacy binary file detected.");const i=this.header.length-im,o=new DataView(e,im);let l=0;for(;l<i;){const h=o.getUint32(l,!0);l+=4;const d=o.getUint32(l,!0);if(l+=4,d===rC.JSON){const p=new Uint8Array(e,im+l,h);this.content=n.decode(p)}else if(d===rC.BIN){const p=im+l;this.body=e.slice(p,p+h)}l+=h}if(this.content===null)throw new Error("THREE.GLTFLoader: JSON content not found.")}}class mF{constructor(e,t){if(!t)throw new Error("THREE.GLTFLoader: No DRACOLoader instance provided.");this.name=On.KHR_DRACO_MESH_COMPRESSION,this.json=e,this.dracoLoader=t,this.dracoLoader.preload()}decodePrimitive(e,t){const n=this.json,i=this.dracoLoader,o=e.extensions[this.name].bufferView,l=e.extensions[this.name].attributes,h={},d={},p={};for(const _ in l){const v=OS[_]||_.toLowerCase();h[v]=l[_]}for(const _ in e.attributes){const v=OS[_]||_.toLowerCase();if(l[_]!==void 0){const y=n.accessors[e.attributes[_]],x=kh[y.componentType];p[v]=x.name,d[v]=y.normalized===!0}}return t.getDependency("bufferView",o).then(function(_){return new Promise(function(v,y){i.decodeDracoFile(_,function(x){for(const b in x.attributes){const R=x.attributes[b],T=d[b];T!==void 0&&(R.normalized=T)}v(x)},h,p,na,y)})})}}class gF{constructor(){this.name=On.KHR_TEXTURE_TRANSFORM}extendTexture(e,t){return(t.texCoord===void 0||t.texCoord===e.channel)&&t.offset===void 0&&t.rotation===void 0&&t.scale===void 0||(e=e.clone(),t.texCoord!==void 0&&(e.channel=t.texCoord),t.offset!==void 0&&e.offset.fromArray(t.offset),t.rotation!==void 0&&(e.rotation=t.rotation),t.scale!==void 0&&e.repeat.fromArray(t.scale),e.needsUpdate=!0),e}}class vF{constructor(){this.name=On.KHR_MESH_QUANTIZATION}}class oC extends Pu{constructor(e,t,n,i){super(e,t,n,i)}copySampleValue_(e){const t=this.resultBuffer,n=this.sampleValues,i=this.valueSize,o=e*i*3+i;for(let l=0;l!==i;l++)t[l]=n[o+l];return t}interpolate_(e,t,n,i){const o=this.resultBuffer,l=this.sampleValues,h=this.valueSize,d=h*2,p=h*3,_=i-t,v=(n-t)/_,y=v*v,x=y*v,b=e*p,R=b-p,T=-2*x+3*y,M=x-y,w=1-T,D=M-y+v;for(let N=0;N!==h;N++){const H=l[R+N+h],O=l[R+N+d]*_,z=l[b+N+h],V=l[b+N]*_;o[N]=w*H+D*O+T*z+M*V}return o}}const _F=new Ca;class yF extends oC{interpolate_(e,t,n,i){const o=super.interpolate_(e,t,n,i);return _F.fromArray(o).normalize().toArray(o),o}}const Mr={POINTS:0,LINES:1,LINE_LOOP:2,LINE_STRIP:3,TRIANGLES:4,TRIANGLE_STRIP:5,TRIANGLE_FAN:6},kh={5120:Int8Array,5121:Uint8Array,5122:Int16Array,5123:Uint16Array,5125:Uint32Array,5126:Float32Array},lC={9728:Ti,9729:Cn,9984:tp,9985:yu,9986:lc,9987:Is},cC={33071:Ei,33648:_u,10497:Kr},LS={SCALAR:1,VEC2:2,VEC3:3,VEC4:4,MAT2:4,MAT3:9,MAT4:16},OS={POSITION:"position",NORMAL:"normal",TANGENT:"tangent",TEXCOORD_0:"uv",TEXCOORD_1:"uv1",TEXCOORD_2:"uv2",TEXCOORD_3:"uv3",COLOR_0:"color",WEIGHTS_0:"skinWeight",JOINTS_0:"skinIndex"},Bc={scale:"scale",translation:"position",rotation:"quaternion",weights:"morphTargetInfluences"},xF={CUBICSPLINE:void 0,LINEAR:uc,STEP:Au},IS={OPAQUE:"OPAQUE",MASK:"MASK",BLEND:"BLEND"};function AF(s){return s.DefaultMaterial===void 0&&(s.DefaultMaterial=new Fu({color:16777215,emissive:0,metalness:1,roughness:1,transparent:!1,depthTest:!0,side:Yr})),s.DefaultMaterial}function nf(s,e,t){for(const n in t.extensions)s[n]===void 0&&(e.userData.gltfExtensions=e.userData.gltfExtensions||{},e.userData.gltfExtensions[n]=t.extensions[n])}function Uo(s,e){e.extras!==void 0&&(typeof e.extras=="object"?Object.assign(s.userData,e.extras):console.warn("THREE.GLTFLoader: Ignoring primitive type .extras, "+e.extras))}function SF(s,e,t){let n=!1,i=!1,o=!1;for(let p=0,_=e.length;p<_;p++){const v=e[p];if(v.POSITION!==void 0&&(n=!0),v.NORMAL!==void 0&&(i=!0),v.COLOR_0!==void 0&&(o=!0),n&&i&&o)break}if(!n&&!i&&!o)return Promise.resolve(s);const l=[],h=[],d=[];for(let p=0,_=e.length;p<_;p++){const v=e[p];if(n){const y=v.POSITION!==void 0?t.getDependency("accessor",v.POSITION):s.attributes.position;l.push(y)}if(i){const y=v.NORMAL!==void 0?t.getDependency("accessor",v.NORMAL):s.attributes.normal;h.push(y)}if(o){const y=v.COLOR_0!==void 0?t.getDependency("accessor",v.COLOR_0):s.attributes.color;d.push(y)}}return Promise.all([Promise.all(l),Promise.all(h),Promise.all(d)]).then(function(p){const _=p[0],v=p[1],y=p[2];return n&&(s.morphAttributes.position=_),i&&(s.morphAttributes.normal=v),o&&(s.morphAttributes.color=y),s.morphTargetsRelative=!0,s})}function MF(s,e){if(s.updateMorphTargets(),e.weights!==void 0)for(let t=0,n=e.weights.length;t<n;t++)s.morphTargetInfluences[t]=e.weights[t];if(e.extras&&Array.isArray(e.extras.targetNames)){const t=e.extras.targetNames;if(s.morphTargetInfluences.length===t.length){s.morphTargetDictionary={};for(let n=0,i=t.length;n<i;n++)s.morphTargetDictionary[t[n]]=n}else console.warn("THREE.GLTFLoader: Invalid extras.targetNames length. Ignoring names.")}}function bF(s){let e;const t=s.extensions&&s.extensions[On.KHR_DRACO_MESH_COMPRESSION];if(t?e="draco:"+t.bufferView+":"+t.indices+":"+FS(t.attributes):e=s.indices+":"+FS(s.attributes)+":"+s.mode,s.targets!==void 0)for(let n=0,i=s.targets.length;n<i;n++)e+=":"+FS(s.targets[n]);return e}function FS(s){let e="";const t=Object.keys(s).sort();for(let n=0,i=t.length;n<i;n++)e+=t[n]+":"+s[t[n]]+";";return e}function HS(s){switch(s){case Int8Array:return .007874015748031496;case Uint8Array:return .00392156862745098;case Int16Array:return 3051850947599719e-20;case Uint16Array:return 15259021896696422e-21;default:throw new Error("THREE.GLTFLoader: Unsupported normalized accessor component type.")}}function EF(s){return s.search(/\.jpe?g($|\?)/i)>0||s.search(/^data\:image\/jpeg/)===0?"image/jpeg":s.search(/\.webp($|\?)/i)>0||s.search(/^data\:image\/webp/)===0?"image/webp":s.search(/\.ktx2($|\?)/i)>0||s.search(/^data\:image\/ktx2/)===0?"image/ktx2":"image/png"}const TF=new en;class CF{constructor(e={},t={}){this.json=e,this.extensions={},this.plugins={},this.options=t,this.cache=new WI,this.associations=new Map,this.primitiveCache={},this.nodeCache={},this.meshCache={refs:{},uses:{}},this.cameraCache={refs:{},uses:{}},this.lightCache={refs:{},uses:{}},this.sourceCache={},this.textureCache={},this.nodeNamesUsed={};let n=!1,i=-1,o=!1,l=-1;if(typeof navigator<"u"){const h=navigator.userAgent;n=/^((?!chrome|android).)*safari/i.test(h)===!0;const d=h.match(/Version\/(\d+)/);i=n&&d?parseInt(d[1],10):-1,o=h.indexOf("Firefox")>-1,l=o?h.match(/Firefox\/([0-9]+)\./)[1]:-1}typeof createImageBitmap>"u"||n&&i<17||o&&l<98?this.textureLoader=new uA(this.options.manager):this.textureLoader=new mA(this.options.manager),this.textureLoader.setCrossOrigin(this.options.crossOrigin),this.textureLoader.setRequestHeader(this.options.requestHeader),this.fileLoader=new da(this.options.manager),this.fileLoader.setResponseType("arraybuffer"),this.options.crossOrigin==="use-credentials"&&this.fileLoader.setWithCredentials(!0)}setExtensions(e){this.extensions=e}setPlugins(e){this.plugins=e}parse(e,t){const n=this,i=this.json,o=this.extensions;this.cache.removeAll(),this.nodeCache={},this._invokeAll(function(l){return l._markDefs&&l._markDefs()}),Promise.all(this._invokeAll(function(l){return l.beforeRoot&&l.beforeRoot()})).then(function(){return Promise.all([n.getDependencies("scene"),n.getDependencies("animation"),n.getDependencies("camera")])}).then(function(l){const h={scene:l[0][i.scene||0],scenes:l[0],animations:l[1],cameras:l[2],asset:i.asset,parser:n,userData:{}};return nf(o,h,i),Uo(h,i),Promise.all(n._invokeAll(function(d){return d.afterRoot&&d.afterRoot(h)})).then(function(){for(const d of h.scenes)d.updateMatrixWorld();e(h)})}).catch(t)}_markDefs(){const e=this.json.nodes||[],t=this.json.skins||[],n=this.json.meshes||[];for(let i=0,o=t.length;i<o;i++){const l=t[i].joints;for(let h=0,d=l.length;h<d;h++)e[l[h]].isBone=!0}for(let i=0,o=e.length;i<o;i++){const l=e[i];l.mesh!==void 0&&(this._addNodeRef(this.meshCache,l.mesh),l.skin!==void 0&&(n[l.mesh].isSkinnedMesh=!0)),l.camera!==void 0&&this._addNodeRef(this.cameraCache,l.camera)}}_addNodeRef(e,t){t!==void 0&&(e.refs[t]===void 0&&(e.refs[t]=e.uses[t]=0),e.refs[t]++)}_getNodeRef(e,t,n){if(e.refs[t]<=1)return n;const i=n.clone(),o=(l,h)=>{const d=this.associations.get(l);d!=null&&this.associations.set(h,d);for(const[p,_]of l.children.entries())o(_,h.children[p])};return o(n,i),i.name+="_instance_"+e.uses[t]++,i}_invokeOne(e){const t=Object.values(this.plugins);t.push(this);for(let n=0;n<t.length;n++){const i=e(t[n]);if(i)return i}return null}_invokeAll(e){const t=Object.values(this.plugins);t.unshift(this);const n=[];for(let i=0;i<t.length;i++){const o=e(t[i]);o&&n.push(o)}return n}getDependency(e,t){const n=e+":"+t;let i=this.cache.get(n);if(!i){switch(e){case"scene":i=this.loadScene(t);break;case"node":i=this._invokeOne(function(o){return o.loadNode&&o.loadNode(t)});break;case"mesh":i=this._invokeOne(function(o){return o.loadMesh&&o.loadMesh(t)});break;case"accessor":i=this.loadAccessor(t);break;case"bufferView":i=this._invokeOne(function(o){return o.loadBufferView&&o.loadBufferView(t)});break;case"buffer":i=this.loadBuffer(t);break;case"material":i=this._invokeOne(function(o){return o.loadMaterial&&o.loadMaterial(t)});break;case"texture":i=this._invokeOne(function(o){return o.loadTexture&&o.loadTexture(t)});break;case"skin":i=this.loadSkin(t);break;case"animation":i=this._invokeOne(function(o){return o.loadAnimation&&o.loadAnimation(t)});break;case"camera":i=this.loadCamera(t);break;default:if(i=this._invokeOne(function(o){return o!=this&&o.getDependency&&o.getDependency(e,t)}),!i)throw new Error("Unknown type: "+e);break}this.cache.add(n,i)}return i}getDependencies(e){let t=this.cache.get(e);if(!t){const n=this,i=this.json[e+(e==="mesh"?"es":"s")]||[];t=Promise.all(i.map(function(o,l){return n.getDependency(e,l)})),this.cache.add(e,t)}return t}loadBuffer(e){const t=this.json.buffers[e],n=this.fileLoader;if(t.type&&t.type!=="arraybuffer")throw new Error("THREE.GLTFLoader: "+t.type+" buffer type is not supported.");if(t.uri===void 0&&e===0)return Promise.resolve(this.extensions[On.KHR_BINARY_GLTF].body);const i=this.options;return new Promise(function(o,l){n.load(nr.resolveURL(t.uri,i.path),o,void 0,function(){l(new Error('THREE.GLTFLoader: Failed to load buffer "'+t.uri+'".'))})})}loadBufferView(e){const t=this.json.bufferViews[e];return this.getDependency("buffer",t.buffer).then(function(n){const i=t.byteLength||0,o=t.byteOffset||0;return n.slice(o,o+i)})}loadAccessor(e){const t=this,n=this.json,i=this.json.accessors[e];if(i.bufferView===void 0&&i.sparse===void 0){const l=LS[i.type],h=kh[i.componentType],d=i.normalized===!0,p=new h(i.count*l);return Promise.resolve(new Hn(p,l,d))}const o=[];return i.bufferView!==void 0?o.push(this.getDependency("bufferView",i.bufferView)):o.push(null),i.sparse!==void 0&&(o.push(this.getDependency("bufferView",i.sparse.indices.bufferView)),o.push(this.getDependency("bufferView",i.sparse.values.bufferView))),Promise.all(o).then(function(l){const h=l[0],d=LS[i.type],p=kh[i.componentType],_=p.BYTES_PER_ELEMENT,v=_*d,y=i.byteOffset||0,x=i.bufferView!==void 0?n.bufferViews[i.bufferView].byteStride:void 0,b=i.normalized===!0;let R,T;if(x&&x!==v){const M=Math.floor(y/x),w="InterleavedBuffer:"+i.bufferView+":"+i.componentType+":"+M+":"+i.count;let D=t.cache.get(w);D||(R=new p(h,M*x,i.count*x/_),D=new yh(R,x/_),t.cache.add(w,D)),T=new Al(D,d,y%x/_,b)}else h===null?R=new p(i.count*d):R=new p(h,y,i.count*d),T=new Hn(R,d,b);if(i.sparse!==void 0){const M=LS.SCALAR,w=kh[i.sparse.indices.componentType],D=i.sparse.indices.byteOffset||0,N=i.sparse.values.byteOffset||0,H=new w(l[1],D,i.sparse.count*M),O=new p(l[2],N,i.sparse.count*d);h!==null&&(T=new Hn(T.array.slice(),T.itemSize,T.normalized)),T.normalized=!1;for(let z=0,V=H.length;z<V;z++){const U=H[z];if(T.setX(U,O[z*d]),d>=2&&T.setY(U,O[z*d+1]),d>=3&&T.setZ(U,O[z*d+2]),d>=4&&T.setW(U,O[z*d+3]),d>=5)throw new Error("THREE.GLTFLoader: Unsupported itemSize in sparse BufferAttribute.")}T.normalized=b}return T})}loadTexture(e){const t=this.json,n=this.options,o=t.textures[e].source,l=t.images[o];let h=this.textureLoader;if(l.uri){const d=n.manager.getHandler(l.uri);d!==null&&(h=d)}return this.loadTextureImage(e,o,h)}loadTextureImage(e,t,n){const i=this,o=this.json,l=o.textures[e],h=o.images[t],d=(h.uri||h.bufferView)+":"+l.sampler;if(this.textureCache[d])return this.textureCache[d];const p=this.loadImageSource(t,n).then(function(_){_.flipY=!1,_.name=l.name||h.name||"",_.name===""&&typeof h.uri=="string"&&h.uri.startsWith("data:image/")===!1&&(_.name=h.uri);const y=(o.samplers||{})[l.sampler]||{};return _.magFilter=lC[y.magFilter]||Cn,_.minFilter=lC[y.minFilter]||Is,_.wrapS=cC[y.wrapS]||Kr,_.wrapT=cC[y.wrapT]||Kr,_.generateMipmaps=!_.isCompressedTexture&&_.minFilter!==Ti&&_.minFilter!==Cn,i.associations.set(_,{textures:e}),_}).catch(function(){return null});return this.textureCache[d]=p,p}loadImageSource(e,t){const n=this,i=this.json,o=this.options;if(this.sourceCache[e]!==void 0)return this.sourceCache[e].then(v=>v.clone());const l=i.images[e],h=self.URL||self.webkitURL;let d=l.uri||"",p=!1;if(l.bufferView!==void 0)d=n.getDependency("bufferView",l.bufferView).then(function(v){p=!0;const y=new Blob([v],{type:l.mimeType});return d=h.createObjectURL(y),d});else if(l.uri===void 0)throw new Error("THREE.GLTFLoader: Image "+e+" is missing URI and bufferView");const _=Promise.resolve(d).then(function(v){return new Promise(function(y,x){let b=y;t.isImageBitmapLoader===!0&&(b=function(R){const T=new Qn(R);T.needsUpdate=!0,y(T)}),t.load(nr.resolveURL(v,o.path),b,void 0,x)})}).then(function(v){return p===!0&&h.revokeObjectURL(d),Uo(v,l),v.userData.mimeType=l.mimeType||EF(l.uri),v}).catch(function(v){throw console.error("THREE.GLTFLoader: Couldn't load texture",d),v});return this.sourceCache[e]=_,_}assignTexture(e,t,n,i){const o=this;return this.getDependency("texture",n.index).then(function(l){if(!l)return null;if(n.texCoord!==void 0&&n.texCoord>0&&(l=l.clone(),l.channel=n.texCoord),o.extensions[On.KHR_TEXTURE_TRANSFORM]){const h=n.extensions!==void 0?n.extensions[On.KHR_TEXTURE_TRANSFORM]:void 0;if(h){const d=o.associations.get(l);l=o.extensions[On.KHR_TEXTURE_TRANSFORM].extendTexture(l,h),o.associations.set(l,d)}}return i!==void 0&&(l.colorSpace=i),e[t]=l,l})}assignFinalMaterial(e){const t=e.geometry;let n=e.material;const i=t.attributes.tangent===void 0,o=t.attributes.color!==void 0,l=t.attributes.normal===void 0;if(e.isPoints){const h="PointsMaterial:"+n.uuid;let d=this.cache.get(h);d||(d=new Np,Yi.prototype.copy.call(d,n),d.color.copy(n.color),d.map=n.map,d.sizeAttenuation=!1,this.cache.add(h,d)),n=d}else if(e.isLine){const h="LineBasicMaterial:"+n.uuid;let d=this.cache.get(h);d||(d=new za,Yi.prototype.copy.call(d,n),d.color.copy(n.color),d.map=n.map,this.cache.add(h,d)),n=d}if(i||o||l){let h="ClonedMaterial:"+n.uuid+":";i&&(h+="derivative-tangents:"),o&&(h+="vertex-colors:"),l&&(h+="flat-shading:");let d=this.cache.get(h);d||(d=n.clone(),o&&(d.vertexColors=!0),l&&(d.flatShading=!0),i&&(d.normalScale&&(d.normalScale.y*=-1),d.clearcoatNormalScale&&(d.clearcoatNormalScale.y*=-1)),this.cache.add(h,d),this.associations.set(d,this.associations.get(n))),n=d}e.material=n}getMaterialType(){return Fu}loadMaterial(e){const t=this,n=this.json,i=this.extensions,o=n.materials[e];let l;const h={},d=o.extensions||{},p=[];if(d[On.KHR_MATERIALS_UNLIT]){const v=i[On.KHR_MATERIALS_UNLIT];l=v.getMaterialType(),p.push(v.extendParams(h,o,t))}else{const v=o.pbrMetallicRoughness||{};if(h.color=new Ct(1,1,1),h.opacity=1,Array.isArray(v.baseColorFactor)){const y=v.baseColorFactor;h.color.setRGB(y[0],y[1],y[2],na),h.opacity=y[3]}v.baseColorTexture!==void 0&&p.push(t.assignTexture(h,"map",v.baseColorTexture,Xi)),h.metalness=v.metallicFactor!==void 0?v.metallicFactor:1,h.roughness=v.roughnessFactor!==void 0?v.roughnessFactor:1,v.metallicRoughnessTexture!==void 0&&(p.push(t.assignTexture(h,"metalnessMap",v.metallicRoughnessTexture)),p.push(t.assignTexture(h,"roughnessMap",v.metallicRoughnessTexture))),l=this._invokeOne(function(y){return y.getMaterialType&&y.getMaterialType(e)}),p.push(Promise.all(this._invokeAll(function(y){return y.extendMaterialParams&&y.extendMaterialParams(e,h)})))}o.doubleSided===!0&&(h.side=Ws);const _=o.alphaMode||IS.OPAQUE;if(_===IS.BLEND?(h.transparent=!0,h.depthWrite=!1):(h.transparent=!1,_===IS.MASK&&(h.alphaTest=o.alphaCutoff!==void 0?o.alphaCutoff:.5)),o.normalTexture!==void 0&&l!==ha&&(p.push(t.assignTexture(h,"normalMap",o.normalTexture)),h.normalScale=new nt(1,1),o.normalTexture.scale!==void 0)){const v=o.normalTexture.scale;h.normalScale.set(v,v)}if(o.occlusionTexture!==void 0&&l!==ha&&(p.push(t.assignTexture(h,"aoMap",o.occlusionTexture)),o.occlusionTexture.strength!==void 0&&(h.aoMapIntensity=o.occlusionTexture.strength)),o.emissiveFactor!==void 0&&l!==ha){const v=o.emissiveFactor;h.emissive=new Ct().setRGB(v[0],v[1],v[2],na)}return o.emissiveTexture!==void 0&&l!==ha&&p.push(t.assignTexture(h,"emissiveMap",o.emissiveTexture,Xi)),Promise.all(p).then(function(){const v=new l(h);return o.name&&(v.name=o.name),Uo(v,o),t.associations.set(v,{materials:e}),o.extensions&&nf(i,v,o),v})}createUniqueName(e){const t=kn.sanitizeNodeName(e||"");return t in this.nodeNamesUsed?t+"_"+ ++this.nodeNamesUsed[t]:(this.nodeNamesUsed[t]=0,t)}loadGeometries(e){const t=this,n=this.extensions,i=this.primitiveCache;function o(h){return n[On.KHR_DRACO_MESH_COMPRESSION].decodePrimitive(h,t).then(function(d){return uC(d,h,t)})}const l=[];for(let h=0,d=e.length;h<d;h++){const p=e[h],_=bF(p),v=i[_];if(v)l.push(v.promise);else{let y;p.extensions&&p.extensions[On.KHR_DRACO_MESH_COMPRESSION]?y=o(p):y=uC(new pn,p,t),i[_]={primitive:p,promise:y},l.push(y)}}return Promise.all(l)}loadMesh(e){const t=this,n=this.json,i=this.extensions,o=n.meshes[e],l=o.primitives,h=[];for(let d=0,p=l.length;d<p;d++){const _=l[d].material===void 0?AF(this.cache):this.getDependency("material",l[d].material);h.push(_)}return h.push(t.loadGeometries(l)),Promise.all(h).then(function(d){const p=d.slice(0,d.length-1),_=d[d.length-1],v=[];for(let x=0,b=_.length;x<b;x++){const R=_[x],T=l[x];let M;const w=p[x];if(T.mode===Mr.TRIANGLES||T.mode===Mr.TRIANGLE_STRIP||T.mode===Mr.TRIANGLE_FAN||T.mode===void 0)M=o.isSkinnedMesh===!0?new ev(R,w):new yi(R,w),M.isSkinnedMesh===!0&&M.normalizeSkinWeights(),T.mode===Mr.TRIANGLE_STRIP?M.geometry=aC(M.geometry,fp):T.mode===Mr.TRIANGLE_FAN&&(M.geometry=aC(M.geometry,bu));else if(T.mode===Mr.LINES)M=new yr(R,w);else if(T.mode===Mr.LINE_STRIP)M=new wo(R,w);else if(T.mode===Mr.LINE_LOOP)M=new fv(R,w);else if(T.mode===Mr.POINTS)M=new pv(R,w);else throw new Error("THREE.GLTFLoader: Primitive mode unsupported: "+T.mode);Object.keys(M.geometry.morphAttributes).length>0&&MF(M,o),M.name=t.createUniqueName(o.name||"mesh_"+e),Uo(M,o),T.extensions&&nf(i,M,T),t.assignFinalMaterial(M),v.push(M)}for(let x=0,b=v.length;x<b;x++)t.associations.set(v[x],{meshes:e,primitives:x});if(v.length===1)return o.extensions&&nf(i,v[0],o),v[0];const y=new vr;o.extensions&&nf(i,y,o),t.associations.set(y,{meshes:e});for(let x=0,b=v.length;x<b;x++)y.add(v[x]);return y})}loadCamera(e){let t;const n=this.json.cameras[e],i=n[n.type];if(!i){console.warn("THREE.GLTFLoader: Missing camera parameters.");return}return n.type==="perspective"?t=new aa(E0.radToDeg(i.yfov),i.aspectRatio||1,i.znear||1,i.zfar||2e6):n.type==="orthographic"&&(t=new Tl(-i.xmag,i.xmag,i.ymag,-i.ymag,i.znear,i.zfar)),n.name&&(t.name=this.createUniqueName(n.name)),Uo(t,n),Promise.resolve(t)}loadSkin(e){const t=this.json.skins[e],n=[];for(let i=0,o=t.joints.length;i<o;i++)n.push(this._loadNodeShallow(t.joints[i]));return t.inverseBindMatrices!==void 0?n.push(this.getDependency("accessor",t.inverseBindMatrices)):n.push(null),Promise.all(n).then(function(i){const o=i.pop(),l=i,h=[],d=[];for(let p=0,_=l.length;p<_;p++){const v=l[p];if(v){h.push(v);const y=new en;o!==null&&y.fromArray(o.array,p*16),d.push(y)}else console.warn('THREE.GLTFLoader: Joint "%s" could not be found.',t.joints[p])}return new bh(h,d)})}loadAnimation(e){const t=this.json,n=this,i=t.animations[e],o=i.name?i.name:"animation_"+e,l=[],h=[],d=[],p=[],_=[];for(let v=0,y=i.channels.length;v<y;v++){const x=i.channels[v],b=i.samplers[x.sampler],R=x.target,T=R.node,M=i.parameters!==void 0?i.parameters[b.input]:b.input,w=i.parameters!==void 0?i.parameters[b.output]:b.output;R.node!==void 0&&(l.push(this.getDependency("node",T)),h.push(this.getDependency("accessor",M)),d.push(this.getDependency("accessor",w)),p.push(b),_.push(R))}return Promise.all([Promise.all(l),Promise.all(h),Promise.all(d),Promise.all(p),Promise.all(_)]).then(function(v){const y=v[0],x=v[1],b=v[2],R=v[3],T=v[4],M=[];for(let D=0,N=y.length;D<N;D++){const H=y[D],O=x[D],z=b[D],V=R[D],U=T[D];if(H===void 0)continue;H.updateMatrix&&H.updateMatrix();const F=n._createAnimationTracks(H,O,z,V,U);if(F)for(let K=0;K<F.length;K++)M.push(F[K])}const w=new Vu(o,void 0,M);return Uo(w,i),w})}createNodeMesh(e){const t=this.json,n=this,i=t.nodes[e];return i.mesh===void 0?null:n.getDependency("mesh",i.mesh).then(function(o){const l=n._getNodeRef(n.meshCache,i.mesh,o);return i.weights!==void 0&&l.traverse(function(h){if(h.isMesh)for(let d=0,p=i.weights.length;d<p;d++)h.morphTargetInfluences[d]=i.weights[d]}),l})}loadNode(e){const t=this.json,n=this,i=t.nodes[e],o=n._loadNodeShallow(e),l=[],h=i.children||[];for(let p=0,_=h.length;p<_;p++)l.push(n.getDependency("node",h[p]));const d=i.skin===void 0?Promise.resolve(null):n.getDependency("skin",i.skin);return Promise.all([o,Promise.all(l),d]).then(function(p){const _=p[0],v=p[1],y=p[2];y!==null&&_.traverse(function(x){x.isSkinnedMesh&&x.bind(y,TF)});for(let x=0,b=v.length;x<b;x++)_.add(v[x]);return _})}_loadNodeShallow(e){const t=this.json,n=this.extensions,i=this;if(this.nodeCache[e]!==void 0)return this.nodeCache[e];const o=t.nodes[e],l=o.name?i.createUniqueName(o.name):"",h=[],d=i._invokeOne(function(p){return p.createNodeMesh&&p.createNodeMesh(e)});return d&&h.push(d),o.camera!==void 0&&h.push(i.getDependency("camera",o.camera).then(function(p){return i._getNodeRef(i.cameraCache,o.camera,p)})),i._invokeAll(function(p){return p.createNodeAttachment&&p.createNodeAttachment(e)}).forEach(function(p){h.push(p)}),this.nodeCache[e]=Promise.all(h).then(function(p){let _;if(o.isBone===!0?_=new Cp:p.length>1?_=new vr:p.length===1?_=p[0]:_=new Un,_!==p[0])for(let v=0,y=p.length;v<y;v++)_.add(p[v]);if(o.name&&(_.userData.name=o.name,_.name=l),Uo(_,o),o.extensions&&nf(n,_,o),o.matrix!==void 0){const v=new en;v.fromArray(o.matrix),_.applyMatrix4(v)}else o.translation!==void 0&&_.position.fromArray(o.translation),o.rotation!==void 0&&_.quaternion.fromArray(o.rotation),o.scale!==void 0&&_.scale.fromArray(o.scale);if(!i.associations.has(_))i.associations.set(_,{});else if(o.mesh!==void 0&&i.meshCache.refs[o.mesh]>1){const v=i.associations.get(_);i.associations.set(_,{...v})}return i.associations.get(_).nodes=e,_}),this.nodeCache[e]}loadScene(e){const t=this.extensions,n=this.json.scenes[e],i=this,o=new vr;n.name&&(o.name=i.createUniqueName(n.name)),Uo(o,n),n.extensions&&nf(t,o,n);const l=n.nodes||[],h=[];for(let d=0,p=l.length;d<p;d++)h.push(i.getDependency("node",l[d]));return Promise.all(h).then(function(d){for(let _=0,v=d.length;_<v;_++)o.add(d[_]);const p=_=>{const v=new Map;for(const[y,x]of i.associations)(y instanceof Yi||y instanceof Qn)&&v.set(y,x);return _.traverse(y=>{const x=i.associations.get(y);x!=null&&v.set(y,x)}),v};return i.associations=p(o),o})}_createAnimationTracks(e,t,n,i,o){const l=[],h=e.name?e.name:e.uuid,d=[];Bc[o.path]===Bc.weights?e.traverse(function(y){y.morphTargetInfluences&&d.push(y.name?y.name:y.uuid)}):d.push(h);let p;switch(Bc[o.path]){case Bc.weights:p=Sl;break;case Bc.rotation:p=Ml;break;case Bc.translation:case Bc.scale:p=bl;break;default:n.itemSize===1?p=Sl:p=bl;break}const _=i.interpolation!==void 0?xF[i.interpolation]:uc,v=this._getArrayFromAccessor(n);for(let y=0,x=d.length;y<x;y++){const b=new p(d[y]+"."+Bc[o.path],t.array,v,_);i.interpolation==="CUBICSPLINE"&&this._createCubicSplineTrackInterpolant(b),l.push(b)}return l}_getArrayFromAccessor(e){let t=e.array;if(e.normalized){const n=HS(t.constructor),i=new Float32Array(t.length);for(let o=0,l=t.length;o<l;o++)i[o]=t[o]*n;t=i}return t}_createCubicSplineTrackInterpolant(e){e.createInterpolant=function(n){const i=this instanceof Ml?yF:oC;return new i(this.times,this.values,this.getValueSize()/3,n)},e.createInterpolant.isInterpolantFactoryMethodGLTFCubicSpline=!0}}function RF(s,e,t){const n=e.attributes,i=new Ra;if(n.POSITION!==void 0){const h=t.json.accessors[n.POSITION],d=h.min,p=h.max;if(d!==void 0&&p!==void 0){if(i.set(new Z(d[0],d[1],d[2]),new Z(p[0],p[1],p[2])),h.normalized){const _=HS(kh[h.componentType]);i.min.multiplyScalar(_),i.max.multiplyScalar(_)}}else{console.warn("THREE.GLTFLoader: Missing min/max properties for accessor POSITION.");return}}else return;const o=e.targets;if(o!==void 0){const h=new Z,d=new Z;for(let p=0,_=o.length;p<_;p++){const v=o[p];if(v.POSITION!==void 0){const y=t.json.accessors[v.POSITION],x=y.min,b=y.max;if(x!==void 0&&b!==void 0){if(d.setX(Math.max(Math.abs(x[0]),Math.abs(b[0]))),d.setY(Math.max(Math.abs(x[1]),Math.abs(b[1]))),d.setZ(Math.max(Math.abs(x[2]),Math.abs(b[2]))),y.normalized){const R=HS(kh[y.componentType]);d.multiplyScalar(R)}h.max(d)}else console.warn("THREE.GLTFLoader: Missing min/max properties for accessor POSITION.")}}i.expandByVector(h)}s.boundingBox=i;const l=new fa;i.getCenter(l.center),l.radius=i.min.distanceTo(i.max)/2,s.boundingSphere=l}function uC(s,e,t){const n=e.attributes,i=[];function o(l,h){return t.getDependency("accessor",l).then(function(d){s.setAttribute(h,d)})}for(const l in n){const h=OS[l]||l.toLowerCase();h in s.attributes||i.push(o(n[l],h))}if(e.indices!==void 0&&!s.index){const l=t.getDependency("accessor",e.indices).then(function(h){s.setIndex(h)});i.push(l)}return Bn.workingColorSpace!==na&&"COLOR_0"in n&&console.warn(`THREE.GLTFLoader: Converting vertex colors from "srgb-linear" to "${Bn.workingColorSpace}" not supported.`),Uo(s,e),RF(s,e,t),Promise.all(i).then(function(){return e.targets!==void 0?SF(s,e.targets,t):s})}const PS="https://ai.streamoji.com",ga=(...s)=>{},wF=(...s)=>{},fC=({analyser:s})=>{const e=Me.useRef(null),t=Me.useRef(null);return Me.useEffect(()=>{const n=e.current;if(!n)return;const i=n.getContext("2d",{alpha:!0});if(!i)return;let o,l=null;s&&(s.fftSize=128,l=new Uint8Array(s.frequencyBinCount));const h=()=>{o=requestAnimationFrame(h),(n.width!==n.offsetWidth||n.height!==n.offsetHeight)&&(n.width=n.offsetWidth,n.height=n.offsetHeight);const d=n.width,p=n.height;if(d===0||p===0)return;const _=p/2;i.clearRect(0,0,d,p),i.fillStyle="#1e293b";const v=2,x=v+2,b=d*.95,R=Math.floor(b/x);(!t.current||t.current.length!==R)&&(t.current=new Float32Array(R).fill(2));const T=R*x,M=(d-T)/2;s&&l&&s.getByteFrequencyData(l);const w=l?l.length:0,N=Math.floor(w*.7)/R,H=new Float32Array(R);for(let O=0;O<R;O++){let z=0;if(l&&N>0){const F=Math.floor(O*N),K=Math.floor((O+1)*N);for(let ne=F;ne<K;ne++){const $=l[ne]||0;$>z&&(z=$)}}z<10&&(z=0);const V=z/255,U=z>0?Math.max(2,Math.pow(V,1.4)*p*.25):2;H[O]=U}for(let O=0;O<R;O++){const z=R-1-O,V=Math.max(H[O],H[z]),U=t.current[O]+(V-t.current[O])*.3;t.current[O]=U;const F=M+O*x,K=_-U/2;i.beginPath(),i.roundRect?i.roundRect(F,K,v,U,4):i.fillRect(F,K,v,U),i.fill()}};return h(),()=>{cancelAnimationFrame(o)}},[s]),Gt.jsx("canvas",{ref:e,style:{width:"100%",height:"100%",display:"block"}})},BF="https://pub-48df6f7d60d6440bbd01676ea5d90e55.r2.dev",hC="https://pub-be53cae7bd99457a8c1f11b4d38f1672.r2.dev/default-models/fullbodyavatarmale.glb";async function DF(s){const e=await crypto.subtle.digest("SHA-256",new TextEncoder().encode(s));return Array.from(new Uint8Array(e)).map(t=>t.toString(16).padStart(2,"0")).join("")}function NF(s){const[e,t]=Me.useState(null);return Me.useEffect(()=>{if(!s){t(null);return}let n=!1;return DF(s).then(i=>{if(n)return;const o=`${BF}/${i}.glb`;fetch(o,{method:"HEAD"}).then(l=>{n||t(l.ok?o:hC)}).catch(()=>{n||t(hC)})}),()=>{n=!0}},[s]),e}const UF=["https://pub-be53cae7bd99457a8c1f11b4d38f1672.r2.dev/masculine/idle/M_Standing_Idle_Variations_001.glb","https://pub-be53cae7bd99457a8c1f11b4d38f1672.r2.dev/masculine/idle/M_Standing_Idle_Variations_002.glb","https://pub-be53cae7bd99457a8c1f11b4d38f1672.r2.dev/masculine/idle/M_Standing_Idle_002.glb","https://pub-be53cae7bd99457a8c1f11b4d38f1672.r2.dev/masculine/idle/M_Standing_Idle_Variations_005.glb"],LF=["https://pub-be53cae7bd99457a8c1f11b4d38f1672.r2.dev/masculine/idle/F_Standing_Idle_Variations_001.glb","https://pub-be53cae7bd99457a8c1f11b4d38f1672.r2.dev/masculine/idle/F_Standing_Idle_Variations_003.glb","https://pub-be53cae7bd99457a8c1f11b4d38f1672.r2.dev/masculine/idle/F_Standing_Idle_Variations_003.glb"],OF=[{id:"m_expr_01",name:"Friendly Wave",url:"https://pub-be53cae7bd99457a8c1f11b4d38f1672.r2.dev/masculine/expression/M_Standing_Expressions_001.glb"},{id:"m_expr_02",name:"You There",url:"https://pub-be53cae7bd99457a8c1f11b4d38f1672.r2.dev/masculine/expression/M_Standing_Expressions_002.glb"},{id:"m_expr_04",name:"Awkward Agreement",url:"https://pub-be53cae7bd99457a8c1f11b4d38f1672.r2.dev/masculine/expression/M_Standing_Expressions_004.glb"},{id:"m_expr_05",name:"What's Going On?",url:"https://pub-be53cae7bd99457a8c1f11b4d38f1672.r2.dev/masculine/expression/M_Standing_Expressions_005.glb"},{id:"m_expr_06",name:"Tired Stretch",url:"https://pub-be53cae7bd99457a8c1f11b4d38f1672.r2.dev/masculine/expression/M_Standing_Expressions_006.glb"},{id:"m_expr_07",name:"Conceilied Laughter",url:"https://pub-be53cae7bd99457a8c1f11b4d38f1672.r2.dev/masculine/expression/M_Standing_Expressions_007.glb"},{id:"m_expr_08",name:"You Come Here",url:"https://pub-be53cae7bd99457a8c1f11b4d38f1672.r2.dev/masculine/expression/M_Standing_Expressions_008.glb"},{id:"m_expr_09",name:"Come Here Kid",url:"https://pub-be53cae7bd99457a8c1f11b4d38f1672.r2.dev/masculine/expression/M_Standing_Expressions_009.glb"},{id:"m_expr_10",name:"Come Here Everyone",url:"https://pub-be53cae7bd99457a8c1f11b4d38f1672.r2.dev/masculine/expression/M_Standing_Expressions_010.glb"},{id:"m_expr_11",name:"No Freaking Way",url:"https://pub-be53cae7bd99457a8c1f11b4d38f1672.r2.dev/masculine/expression/M_Standing_Expressions_011.glb"},{id:"m_expr_12",name:"Cheerful Approval",url:"https://pub-be53cae7bd99457a8c1f11b4d38f1672.r2.dev/masculine/expression/M_Standing_Expressions_012.glb"},{id:"m_expr_13",name:"Waving Hello",url:"https://pub-be53cae7bd99457a8c1f11b4d38f1672.r2.dev/masculine/expression/M_Standing_Expressions_013.glb"},{id:"m_expr_14",name:"Checking Surroundings",url:"https://pub-be53cae7bd99457a8c1f11b4d38f1672.r2.dev/masculine/expression/M_Standing_Expressions_014.glb"},{id:"m_expr_15",name:"Referee Warning",url:"https://pub-be53cae7bd99457a8c1f11b4d38f1672.r2.dev/masculine/expression/M_Standing_Expressions_015.glb"},{id:"m_expr_16",name:"You Thumbs Down",url:"https://pub-be53cae7bd99457a8c1f11b4d38f1672.r2.dev/masculine/expression/M_Standing_Expressions_016.glb"},{id:"m_expr_17",name:"Side Thumbs Down",url:"https://pub-be53cae7bd99457a8c1f11b4d38f1672.r2.dev/masculine/expression/M_Standing_Expressions_017.glb"},{id:"m_expr_18",name:"You're Finished",url:"https://pub-be53cae7bd99457a8c1f11b4d38f1672.r2.dev/masculine/expression/M_Standing_Expressions_018.glb"},{id:"m_talk_01",name:"Oh God, Why Me?",url:"https://pub-be53cae7bd99457a8c1f11b4d38f1672.r2.dev/masculine/expression/M_Talking_Variations_001.glb"},{id:"m_talk_02",name:"What Are You Doing?",url:"https://pub-be53cae7bd99457a8c1f11b4d38f1672.r2.dev/masculine/expression/M_Talking_Variations_002.glb"},{id:"m_talk_03",name:"What Am I doing?",url:"https://pub-be53cae7bd99457a8c1f11b4d38f1672.r2.dev/masculine/expression/M_Talking_Variations_003.glb"},{id:"m_talk_04",name:"No Way",url:"https://pub-be53cae7bd99457a8c1f11b4d38f1672.r2.dev/masculine/expression/M_Talking_Variations_004.glb"},{id:"m_talk_05",name:"What's Going On?",url:"https://pub-be53cae7bd99457a8c1f11b4d38f1672.r2.dev/masculine/expression/M_Talking_Variations_005.glb"},{id:"m_talk_06",name:"I have no idea",url:"https://pub-be53cae7bd99457a8c1f11b4d38f1672.r2.dev/masculine/expression/M_Talking_Variations_006.glb"},{id:"m_talk_07",name:"What's going on here?",url:"https://pub-be53cae7bd99457a8c1f11b4d38f1672.r2.dev/masculine/expression/M_Talking_Variations_007.glb"},{id:"m_talk_08",name:"Let's stop",url:"https://pub-be53cae7bd99457a8c1f11b4d38f1672.r2.dev/masculine/expression/M_Talking_Variations_008.glb"},{id:"m_talk_09",name:"Fed Up Moment",url:"https://pub-be53cae7bd99457a8c1f11b4d38f1672.r2.dev/masculine/expression/M_Talking_Variations_009.glb"},{id:"m_talk_10",name:"What's This? Hold On",url:"https://pub-be53cae7bd99457a8c1f11b4d38f1672.r2.dev/masculine/expression/M_Talking_Variations_010.glb"},{id:"f_talk_01",name:"Great Job Clap",url:"https://pub-be53cae7bd99457a8c1f11b4d38f1672.r2.dev/masculine/expression/F_Talking_Variations_001.glb"},{id:"f_talk_02",name:"Chill Stretch",url:"https://pub-be53cae7bd99457a8c1f11b4d38f1672.r2.dev/masculine/expression/F_Talking_Variations_002.glb"},{id:"f_talk_03",name:"This Is Me",url:"https://pub-be53cae7bd99457a8c1f11b4d38f1672.r2.dev/masculine/expression/F_Talking_Variations_003.glb"},{id:"f_talk_04",name:"Empathize",url:"https://pub-be53cae7bd99457a8c1f11b4d38f1672.r2.dev/masculine/expression/F_Talking_Variations_004.glb"},{id:"f_talk_05",name:"Loose Hands Stretch",url:"https://pub-be53cae7bd99457a8c1f11b4d38f1672.r2.dev/masculine/expression/F_Talking_Variations_005.glb"},{id:"f_talk_06",name:"Take It Easy",url:"https://pub-be53cae7bd99457a8c1f11b4d38f1672.r2.dev/masculine/expression/F_Talking_Variations_006.glb"}],IF=["https://pub-be53cae7bd99457a8c1f11b4d38f1672.r2.dev/masculine/expression/M_Talking_Variations_005.glb","https://pub-be53cae7bd99457a8c1f11b4d38f1672.r2.dev/masculine/expression/M_Talking_Variations_007.glb"],FF={zoom:.85,position:[.15,-.8,0],scale:1.5,rotation:[.15,.02,0]},HF=[-.45,1.9,.1],PF={browInnerUp:.2},GS=.18,GF=1,dC="__branding__",m_={neutral:{eyeLookDownLeft:.1,eyeLookDownRight:.1},happy:{mouthSmileLeft:.2,mouthSmileRight:.2,eyeLookDownLeft:.1,eyeLookDownRight:.1},sad:{eyeLookDownLeft:.2,eyeLookDownRight:.2,browDownRight:.1,browInnerUp:.6,browOuterUpRight:.2,eyeSquintLeft:.7,eyeSquintRight:.7,mouthFrownLeft:.8,mouthFrownRight:.8,mouthLeft:.2,mouthPucker:.5,mouthRollLower:.2,mouthRollUpper:.2,mouthShrugLower:.2,mouthShrugUpper:.2,mouthStretchLeft:.4},angry:{eyeLookDownLeft:.1,eyeLookDownRight:.1,browDownLeft:.6,browDownRight:.6,jawForward:.3,mouthFrownLeft:.7,mouthFrownRight:.7,mouthRollLower:.2,mouthShrugLower:.3},fear:{browInnerUp:.7,eyeSquintLeft:.5,eyeSquintRight:.5,eyeWideLeft:.6,eyeWideRight:.6,mouthClose:.1,mouthFunnel:.3,mouthShrugLower:.5,mouthShrugUpper:.5},disgust:{browDownLeft:.7,browDownRight:.1,browInnerUp:.3,eyeSquintLeft:1,eyeSquintRight:1,eyeWideLeft:.5,eyeWideRight:.5,mouthLeft:.4,mouthPressLeft:.3,mouthRollLower:.3,mouthShrugLower:.3,mouthShrugUpper:.8,mouthUpperUpLeft:.3,noseSneerLeft:1,noseSneerRight:.7},love:{browInnerUp:.4,browOuterUpLeft:.2,browOuterUpRight:.2,mouthSmileLeft:.2,mouthSmileRight:.2,eyeBlinkLeft:.6,eyeBlinkRight:.6,eyeWideLeft:.7,eyeWideRight:.7,mouthDimpleLeft:.1,mouthDimpleRight:.1,mouthPressLeft:.2,mouthShrugUpper:.2,mouthUpperUpLeft:.1,mouthUpperUpRight:.1}},zF=[{key:"viseme_aa",mix:{jawOpen:.6}},{key:"viseme_E",mix:{mouthPressLeft:.8,mouthPressRight:.8,mouthDimpleLeft:1,mouthDimpleRight:1,jawOpen:.3}},{key:"viseme_I",mix:{mouthPressLeft:.6,mouthPressRight:.6,mouthDimpleLeft:.6,mouthDimpleRight:.6,jawOpen:.2}},{key:"viseme_O",mix:{mouthPucker:1,jawForward:.6,jawOpen:.2}},{key:"viseme_U",mix:{mouthFunnel:1}},{key:"viseme_PP",mix:{mouthRollLower:.3,mouthRollUpper:.3,mouthUpperUpLeft:.3,mouthUpperUpRight:.3}},{key:"viseme_FF",mix:{mouthPucker:1,mouthShrugUpper:1,mouthLowerDownLeft:.2,mouthLowerDownRight:.2,mouthDimpleLeft:1,mouthDimpleRight:1,mouthRollLower:.3}},{key:"viseme_DD",mix:{mouthPressLeft:.8,mouthPressRight:.8,mouthFunnel:.5,jawOpen:.2}},{key:"viseme_SS",mix:{mouthPressLeft:.8,mouthPressRight:.8,mouthLowerDownLeft:.5,mouthLowerDownRight:.5,jawOpen:.1}},{key:"viseme_TH",mix:{mouthRollUpper:.3,jawOpen:.2,tongueOut:.4}},{key:"viseme_CH",mix:{mouthPucker:.5,jawOpen:.2}},{key:"viseme_RR",mix:{mouthPucker:.5,jawOpen:.2}},{key:"viseme_kk",mix:{mouthLowerDownLeft:.4,mouthLowerDownRight:.4,mouthDimpleLeft:.3,mouthDimpleRight:.3,mouthFunnel:.3,mouthPucker:.3,jawOpen:.15}},{key:"viseme_nn",mix:{mouthLowerDownLeft:.4,mouthLowerDownRight:.4,mouthDimpleLeft:.3,mouthDimpleRight:.3,mouthFunnel:.3,mouthPucker:.3,jawOpen:.15,tongueOut:.2}},{key:"viseme_sil",mix:{}}],VF={aei:[{v:"E",w:.8},{v:"I",w:.2}],ee:[{v:"I",w:1}],oo:[{v:"O",w:1}],u:[{v:"U",w:1}],aa:[{v:"aa",w:1}],ah:[{v:"aa",w:.7},{v:"O",w:.3}],bmp:[{v:"PP",w:1}],fv:[{v:"FF",w:1}],th:[{v:"TH",w:1}],l:[{v:"nn",w:1}],r:[{v:"RR",w:1}],qw:[{v:"U",w:.6},{v:"O",w:.4}],chjsh:[{v:"CH",w:1}],cdgknstxyz:[{v:"DD",w:.6},{v:"SS",w:.4}],sil:[{v:"sil",w:1}]};function kF(s){if(!s)return[{v:"sil",w:1}];const e=s.toLowerCase();return VF[e]??[{v:"sil",w:1}]}function XF({target:s}){const{camera:e}=Ih();return Me.useEffect(()=>{e.lookAt(...s)},[e,s]),null}function Gs(s,e,t){if(!s||!s.morphTargetDictionary)return;const n=s,i=n.morphTargetDictionary,o=n.morphTargetInfluences;if(o)for(const l in i)l.toLowerCase()===e.toLowerCase()&&(o[i[l]]=t)}function pC(s,e=.97){if(!s)return;const t=s;if(t.morphTargetInfluences)for(let n=0;n<t.morphTargetInfluences.length;n++)t.morphTargetInfluences[n]*=e}const YF=Me.memo(({avatarUrl:s,isPlayingRef:e,visemeQueueRef:t,audioContextRef:n,responseAudioStartTimeRef:i,adjustments:o,mood:l,expression:h,agentResponse:d,isSpeaking:p,nextStartTimeRef:_,stopPlayback:v,setIsSpeaking:y,expressionUrl:x,onExpressionFinished:b,isNudgeResponse:R,avatarGender:T})=>{const{scene:M}=zh(s),D=zh(T==="female"?LF:UF),N=Me.useMemo(()=>D.flatMap(X=>X.animations),[D]),H=zh(IF),O=Me.useMemo(()=>H.flatMap(X=>X.animations),[H]),z=Me.useRef(null),V=Me.useRef(null),U=Me.useRef(null),F=Me.useRef([]),[K]=Me.useState(()=>new iE(M)),ne=Me.useRef({}),$=Me.useRef(null),ae=Me.useRef(0),ge=Me.useRef(!1),I=Me.useRef(0),W=Me.useRef(null);Me.useEffect(()=>{if(!(!N||!M)){if(N.forEach((X,te)=>{const le=`idle_${te}`;if(!ne.current[le]){const ve=K.clipAction(X,M);ve.name=le,ve.setLoop(cp,1),ve.clampWhenFinished=!0,ne.current[le]=ve}}),O.forEach((X,te)=>{const le=`talk_${te}`;if(!ne.current[le]){const ve=K.clipAction(X,M);ve.name=le,ve.setLoop(cp,1),ve.clampWhenFinished=!0,ne.current[le]=ve}}),N.length>0){const X=ne.current.idle_0,te=$.current&&K.existingAction($.current.getClip());X&&!te&&(X.reset().fadeIn(.5).play(),$.current=X)}return()=>{K.stopAllAction(),ne.current={},$.current=null}}},[N,O,M,K]);const ee=Me.useRef("");Me.useEffect(()=>{if(!x||!M||x===ee.current)return;ee.current=x,W.current=x,new KI().load(x,te=>{if(te.animations&&te.animations.length>0){const le=te.animations[0],ve=K.clipAction(le,M);if(ve.name=`EXPR_${x}`,ve.setLoop(cp,1),ve.clampWhenFinished=!0,ne.current[`EXPR_${x}`]=ve,p&&W.current===x){const ze=$.current;ve.reset().fadeIn(.3).play(),ze&&ze!==ve&&ze.crossFadeTo(ve,.3,!0),$.current=ve,W.current=null}}},void 0,te=>{console.error(`[ANIMATION] Failed to load ${x}`,te)})},[x,M,K,p]),Me.useEffect(()=>{const X=te=>{const le=te.action,ve=le.name||"";if(ve.startsWith("idle_")){const he=(parseInt(ve.split("_")[1])+1)%N.length,Ee=ne.current[`idle_${he}`];Ee&&(Ee.reset().fadeIn(.5).play(),le.crossFadeTo(Ee,.5,!0),$.current=Ee)}else if(ve.startsWith("EXPR_")){if(p){const ze=ne.current.talk_0;ze&&(ze.reset().fadeIn(.5).play(),le.crossFadeTo(ze,.5,!0),$.current=ze)}else{const ze=ne.current.idle_0;ze&&(ze.reset().fadeIn(.5).play(),le.crossFadeTo(ze,.5,!0),$.current=ze)}b&&b()}else if(ve.startsWith("talk_"))if(p&&!R){const he=(parseInt(ve.split("_")[1])+1)%O.length,Ee=ne.current[`talk_${he}`];Ee&&(Ee.reset().fadeIn(.3).play(),le.crossFadeTo(Ee,.3,!0),$.current=Ee)}else{const ze=ne.current.idle_0;ze&&(ze.reset().fadeIn(.5).play(),le.crossFadeTo(ze,.5,!0),$.current=ze)}};return K.addEventListener("finished",X),()=>K.removeEventListener("finished",X)},[K,N,O,p,R,b]),Me.useEffect(()=>{if(p&&M){const X=$.current,te=X?.name||"";if(te.startsWith("idle_")||te.startsWith("talk_")||te===""){const le=W.current;if(le){const ve=ne.current[`EXPR_${le}`];if(ve){ve.reset().fadeIn(.3).play(),X&&X!==ve&&X.crossFadeTo(ve,.3,!0),$.current=ve,W.current=null;return}}if(te.startsWith("idle_")||te===""){const ve=ne.current.talk_0;ve&&(ve.reset().fadeIn(.5).play(),X&&X.crossFadeTo(ve,.5,!0),$.current=ve)}}}else if(!p&&M){const X=$.current,te=X?.name||"";if(te.startsWith("talk_")||te.startsWith("EXPR_")){const le=ne.current.idle_0;le&&(le.reset().fadeIn(.5).play(),X&&X.crossFadeTo(le,.5,!0),$.current=le)}}},[p,M,x]),Me.useEffect(()=>{if(!M)return;M.traverse(le=>{if(le.isMesh&&le.morphTargetDictionary){const ve=le.name.toLowerCase();(ve.includes("head")||ve.includes("avatar"))&&(V.current=le,ga(`[ANIMATION] Found head mesh: ${le.name}`)),ve.includes("teeth")&&(U.current=le,ga(`[ANIMATION] Found teeth mesh: ${le.name}`))}});const X=V.current?.morphTargetDictionary;X&&Object.keys(X).filter(le=>le.toLowerCase().includes("brow"));const te=[];M.traverse(le=>{if(le.isMesh){const ze=le.morphTargetDictionary;ze&&Object.keys(ze).some(he=>he.toLowerCase().includes("brow"))&&te.push(le)}}),F.current=te,te.length>0&&ga("[ANIMATION] Meshes with brow morphs:",te.length)},[M]);const ye=(X,te=1)=>{const le=`viseme_${X}`.toLowerCase(),ve=zF.find(ze=>ze.key.toLowerCase()===le);if(ve)for(const ze in ve.mix){const he=ve.mix[ze]*te;Gs(V.current,ze,he),Gs(U.current,ze,he)}},_e=X=>{const te=m_[X]??m_.neutral;for(const le in te)Gs(V.current,le,te[le]),Gs(U.current,le,te[le])};return yT((X,te)=>{const le=Math.pow(.88,60*te);pC(V.current,le),pC(U.current,le),_e(l);const ve=X.clock.elapsedTime;let ze=0;if(Math.floor(ve)%5===0&&Math.floor((ve-te)%5)!==0){let Dt=null;M.traverse(Ot=>{Ot.name.toLowerCase().includes("hips")&&(Dt=Ot)});const mt=Dt?`Hips Y: ${Dt.position.y.toFixed(4)}`:"Hips not found";ga(`[ANIMATION] Mixer Time: ${K.time.toFixed(2)}, ${mt}`)}if(K.update(te),ve>ae.current&&!ge.current&&(ge.current=!0,I.current=ve),ge.current){const mt=(ve-I.current)/.3;if(mt>=1)ge.current=!1,ae.current=ve+2+Math.random()*5;else{const Ot=mt<.5?mt*2:(1-mt)*2;Gs(V.current,"eyeBlinkLeft",Ot),Gs(V.current,"eyeBlinkRight",Ot),Gs(U.current,"eyeBlinkLeft",Ot),Gs(U.current,"eyeBlinkRight",Ot),ze=Ot*PF.browInnerUp}}const he=m_[l]??m_.neutral,Ee=he.browInnerUp??0,lt=he.browOuterUpLeft??0,Rt=he.browOuterUpRight??0,Bt=ve*GF,tn=GS*Math.sin(Bt),on=GS*.7*Math.sin(Bt+.7),Wt=GS*.7*Math.sin(Bt+1.3),Ge=Dt=>Math.max(0,Math.min(1,Dt)),et=Ge(Ee+tn),Je=Ge(lt+on),xt=Ge(Rt+Wt),Q=Ge(et+ze);if(Gs(V.current,"browInnerUp",Q),Gs(U.current,"browInnerUp",Q),Gs(V.current,"browOuterUpLeft",Je),Gs(U.current,"browOuterUpLeft",Je),Gs(V.current,"browOuterUpRight",xt),Gs(U.current,"browOuterUpRight",xt),z.current){const Dt=e.current?0:o.rotation[1];z.current.rotation.y=E0.lerp(z.current.rotation.y,Dt,.1),z.current.position.set(...o.position),z.current.scale.setScalar(o.scale),z.current.rotation.x=o.rotation[0],z.current.rotation.z=o.rotation[2]}if(e.current&&n.current){const Dt=n.current.currentTime,gt=(Dt-i.current)*1e3- -150;for(let j=0;j<t.current.length;j++){const P=t.current[j];gt>=P.vtime&><P.vtime+P.vduration&&ye(P.viseme,P.weight??1)}Dt>_.current+.5&&(v(),y(!1))}}),Gt.jsx("group",{ref:z,children:Gt.jsx("primitive",{object:M})})});function JF(s){return s?s.charAt(0).toUpperCase()+s.slice(1).toLowerCase():""}const qF=({token:s,agentToken:e,onNavigationRequested:t,avatarGender:n}={})=>{const i=s??e??"",o=NF(i||void 0),[l,h]=Me.useState(""),[d,p]=Me.useState(""),[_,v]=Me.useState("Ready"),[y,x]=Me.useState(!1),[b,R]=Me.useState(!1),[T,M]=Me.useState([]),[w,D]=Me.useState(""),N=Me.useRef(null),[H,O]=Me.useState(()=>typeof window<"u"?window.matchMedia("(max-width: 480px)").matches:!1);Me.useEffect(()=>{const xe=window.matchMedia("(max-width: 480px)"),we=()=>O(xe.matches);return xe.addEventListener("change",we),()=>xe.removeEventListener("change",we)},[]);const z=H?80:600,V=Me.useRef(!1),U=Me.useRef([]),F=Me.useRef(0),K=Me.useRef(!1),ne=Me.useRef([]),$=Me.useRef(null),ae=Me.useRef([]);Me.useRef([]);const ge=Me.useRef([]),I=Me.useRef(0),W=Me.useRef(0),ee=Me.useRef(0),ye=Me.useRef(0),_e=Me.useRef(!1),[X,te]=Me.useState(null),le=Me.useRef(null),[ve,ze]=Me.useState("neutral"),[he,Ee]=Me.useState(""),[lt,Rt]=Me.useState(""),[Bt,tn]=Me.useState("Chat with us"),[on,Wt]=Me.useState(null),[Ge,et]=Me.useState("hidden"),[Je,xt]=Me.useState(""),Q=Me.useRef(null),Dt=Me.useRef(Ge);Dt.current=Ge;const[mt,Ot]=Me.useState(null),gt=Me.useRef(null),j=Me.useRef(null),[P,de]=Me.useState(!1),Fe=Me.useRef(null),[ke,Ie]=Me.useState("hidden"),[Ft,Mt]=Me.useState(""),Ht=Me.useRef(ke);Ht.current=ke;const zt=Me.useRef(""),Ye=Me.useRef(!1),qe=Me.useRef(""),wt=Me.useRef(Date.now()),bt=Me.useRef([]),rt=Me.useRef(!1),[Vt,fe]=Me.useState(!1),[Ne,ot]=Me.useState(!1),Et=Me.useRef(null),Qe=Me.useMemo(()=>P?"Try again":_==="Busy"?"Busy":_==="Thinking..."||_==="Processing Voice..."?_:on!=null&&on!==""&&on!=="none"&&on!=="<none>"?`Enter ${JF(on)}`:ke!=="hidden"||!Ne?null:dC,[_,on,P,ke,Ne]),We=!P&&_!=="Busy"&&_!=="Thinking..."&&_!=="Processing Voice..."&&(on==null||on===""||on==="none"||on==="<none>");Me.useEffect(()=>{if(ke!=="hidden"||!We){ot(!1),Et.current!=null&&(clearTimeout(Et.current),Et.current=null);return}return Et.current=setTimeout(()=>{Et.current=null,ot(!0)},400),()=>{Et.current!=null&&(clearTimeout(Et.current),Et.current=null)}},[ke,We]);const _t=Qe!=null&&Qe!=="";Me.useEffect(()=>{const xe=Dt.current;if(!(xe==="exiting"||xe==="entering")){if(xe==="hidden"){_t&&(xt(Qe??""),et("entering"));return}xe==="visible"&&(!_t||Qe!==Je)&&(Q.current=_t?Qe:null,et("exiting"))}},[_t,Qe,Ge,Je]),Me.useEffect(()=>{if(_!=="Busy"){j.current!=null&&(clearTimeout(j.current),j.current=null);return}return j.current=setTimeout(()=>{j.current=null,v("Ready"),de(!0)},12e3),()=>{j.current!=null&&(clearTimeout(j.current),j.current=null)}},[_]),Me.useEffect(()=>{if(!P)return;const xe=setTimeout(()=>de(!1),2500);return()=>clearTimeout(xe)},[P]);const nn=Me.useCallback(()=>{const xe=Dt.current;if(xe==="exiting"){et("hidden");const we=Q.current;Q.current=null,we!=null&&we!==""&&(xt(we),et("entering"))}else xe==="entering"&&et("visible")},[]),wn=xe=>{if(!xe)return;if(xe.mood!=null){const Ve=String(xe.mood).toLowerCase();ze(Ve)}if(xe.expression!=null){const Ve=String(xe.expression).trim();Ee(Ve);const At=OF.find(Yt=>Yt.name.toLowerCase()===Ve.toLowerCase());ga(`[STREAM] Animation match for "${Ve}": ${At?At.name:"NONE"}`),Rt(At?.url??"")}if(xe.navigation!=null){const Ve=String(xe.navigation).trim();Ve!==""&&(t?t(Ve):window.open(Ve,"_blank"))}const we=xe.ask_for||xe.lead_capture?.ask_for,je=we?String(we).trim().toLowerCase():"",He=je==="none"||je==="<none>";if(we&&!He){const Ve=je;Wt(Ve||null),tn(Ve==="email"?"Enter your email":Ve==="name"?"Enter your name":Ve==="phone"?"Enter your phone number":"Chat with us")}else(He||xe.ask_for===null||xe.lead_capture&&xe.lead_capture.ask_for===null||xe.ask_for==="none")&&(Wt(null),Bt!=="Chat with us"&&tn("Chat with us"));xe.collected,xe.valid},Mn=xe=>{const we=xe.trim();if(!we)return null;if(we.startsWith("{"))try{return JSON.parse(we)}catch{return null}if(we.includes(":")){const je=we.split(":"),He=je[0].trim().toLowerCase(),Ve=je.slice(1).join(":").trim();return{[He]:Ve}}return null},Fi=Me.useCallback(()=>{},[]),va=xe=>{if(Ye.current)xe==="§"?Ye.current=!1:(qe.current+=xe,p(we=>we+xe));else if(xe==="§"){Ye.current=!0;return}else for(zt.current+=xe;zt.current.includes(`
|
|
4149
|
+
`;class HI extends ms{_maxDisplayBoost;_hdrCapacityMin;_hdrCapacityMax;constructor({gamma:e,offsetHdr:t,offsetSdr:n,gainMapMin:i,gainMapMax:o,maxDisplayBoost:l,hdrCapacityMin:h,hdrCapacityMax:d,sdr:p,gainMap:_}){super({name:"GainMapDecoderMaterial",vertexShader:II,fragmentShader:FI,uniforms:{sdr:{value:p},gainMap:{value:_},gamma:{value:new Z(1/e[0],1/e[1],1/e[2])},offsetHdr:{value:new Z().fromArray(t)},offsetSdr:{value:new Z().fromArray(n)},gainMapMin:{value:new Z().fromArray(i)},gainMapMax:{value:new Z().fromArray(o)},weightFactor:{value:(Math.log2(l)-h)/(d-h)}},blending:Jr,depthTest:!1,depthWrite:!1}),this._maxDisplayBoost=l,this._hdrCapacityMin=h,this._hdrCapacityMax=d,this.needsUpdate=!0,this.uniformsNeedUpdate=!0}get sdr(){return this.uniforms.sdr.value}set sdr(e){this.uniforms.sdr.value=e}get gainMap(){return this.uniforms.gainMap.value}set gainMap(e){this.uniforms.gainMap.value=e}get offsetHdr(){return this.uniforms.offsetHdr.value.toArray()}set offsetHdr(e){this.uniforms.offsetHdr.value.fromArray(e)}get offsetSdr(){return this.uniforms.offsetSdr.value.toArray()}set offsetSdr(e){this.uniforms.offsetSdr.value.fromArray(e)}get gainMapMin(){return this.uniforms.gainMapMin.value.toArray()}set gainMapMin(e){this.uniforms.gainMapMin.value.fromArray(e)}get gainMapMax(){return this.uniforms.gainMapMax.value.toArray()}set gainMapMax(e){this.uniforms.gainMapMax.value.fromArray(e)}get gamma(){const e=this.uniforms.gamma.value;return[1/e.x,1/e.y,1/e.z]}set gamma(e){const t=this.uniforms.gamma.value;t.x=1/e[0],t.y=1/e[1],t.z=1/e[2]}get hdrCapacityMin(){return this._hdrCapacityMin}set hdrCapacityMin(e){this._hdrCapacityMin=e,this.calculateWeight()}get hdrCapacityMax(){return this._hdrCapacityMax}set hdrCapacityMax(e){this._hdrCapacityMax=e,this.calculateWeight()}get maxDisplayBoost(){return this._maxDisplayBoost}set maxDisplayBoost(e){this._maxDisplayBoost=Math.max(1,Math.min(65504,e)),this.calculateWeight()}calculateWeight(){const e=(Math.log2(this._maxDisplayBoost)-this._hdrCapacityMin)/(this._hdrCapacityMax-this._hdrCapacityMin);this.uniforms.weightFactor.value=Math.max(0,Math.min(1,e))}}class tC extends OI{constructor(e,t){super({renderer:e,createMaterial:n=>new HI(n),createQuadRenderer:n=>new CS(n)},t)}async render(e,t,n,i){const{sdrImage:o,gainMapImage:l,needsFlip:h}=await this.processImages(n,i,"flipY"),{gainMap:d,sdr:p}=this.createTextures(o,l,h);this.updateQuadRenderer(e,o,d,p,t),e.render()}}class PI extends tC{load([e,t,n],i,o,l){const h=this.prepareQuadRenderer();let d,p,_;const v=async()=>{if(d&&p&&_){try{await this.render(h,_,d,p)}catch(U){this.manager.itemError(e),this.manager.itemError(t),this.manager.itemError(n),typeof l=="function"&&l(U),h.disposeOnDemandRenderer();return}typeof i=="function"&&i(h),this.manager.itemEnd(e),this.manager.itemEnd(t),this.manager.itemEnd(n),h.disposeOnDemandRenderer()}};let y=!0,x=0,b=0,R=!0,T=0,M=0,w=!0,D=0,N=0;const H=()=>{if(typeof o=="function"){const U=x+T+D,F=b+M+N,K=y&&R&&w;o(new ProgressEvent("progress",{lengthComputable:K,loaded:F,total:U}))}};this.manager.itemStart(e),this.manager.itemStart(t),this.manager.itemStart(n);const O=new da(this._internalLoadingManager);O.setResponseType("arraybuffer"),O.setRequestHeader(this.requestHeader),O.setPath(this.path),O.setWithCredentials(this.withCredentials),O.load(e,async U=>{if(typeof U=="string")throw new Error("Invalid sdr buffer");d=U,await v()},U=>{y=U.lengthComputable,b=U.loaded,x=U.total,H()},U=>{this.manager.itemError(e),typeof l=="function"&&l(U)});const z=new da(this._internalLoadingManager);z.setResponseType("arraybuffer"),z.setRequestHeader(this.requestHeader),z.setPath(this.path),z.setWithCredentials(this.withCredentials),z.load(t,async U=>{if(typeof U=="string")throw new Error("Invalid gainmap buffer");p=U,await v()},U=>{R=U.lengthComputable,M=U.loaded,T=U.total,H()},U=>{this.manager.itemError(t),typeof l=="function"&&l(U)});const V=new da(this._internalLoadingManager);return V.setRequestHeader(this.requestHeader),V.setPath(this.path),V.setWithCredentials(this.withCredentials),V.load(n,async U=>{if(typeof U!="string")throw new Error("Invalid metadata string");_=JSON.parse(U),await v()},U=>{w=U.lengthComputable,N=U.loaded,D=U.total,H()},U=>{this.manager.itemError(n),typeof l=="function"&&l(U)}),h}}class GI extends tC{load(e,t,n,i){const o=this.prepareQuadRenderer(),l=new da(this._internalLoadingManager);return l.setResponseType("arraybuffer"),l.setRequestHeader(this.requestHeader),l.setPath(this.path),l.setWithCredentials(this.withCredentials),this.manager.itemStart(e),l.load(e,async h=>{if(typeof h=="string")throw new Error("Invalid buffer, received [string], was expecting [ArrayBuffer]");const d=new Uint8Array(h);let p,_,v;try{const y=await LI(d);p=y.sdr,_=y.gainMap,v=y.metadata}catch(y){if(y instanceof $T||y instanceof QT)console.warn(`Failure to reconstruct an HDR image from ${e}: Gain map metadata not found in the file, HDRJPGLoader will render the SDR jpeg`),v={gainMapMin:[0,0,0],gainMapMax:[1,1,1],gamma:[1,1,1],hdrCapacityMin:0,hdrCapacityMax:1,offsetHdr:[0,0,0],offsetSdr:[0,0,0]},p=d;else throw y}try{await this.render(o,v,p.buffer,_?.buffer)}catch(y){this.manager.itemError(e),typeof i=="function"&&i(y),o.disposeOnDemandRenderer();return}typeof t=="function"&&t(o),this.manager.itemEnd(e),o.disposeOnDemandRenderer()},n,h=>{this.manager.itemError(e),typeof i=="function"&&i(h)}),o}}const nm={apartment:"lebombo_1k.hdr",city:"potsdamer_platz_1k.hdr",dawn:"kiara_1_dawn_1k.hdr",forest:"forest_slope_1k.hdr",lobby:"st_fagans_interior_1k.hdr",night:"dikhololo_night_1k.hdr",park:"rooitou_park_1k.hdr",studio:"studio_small_03_1k.hdr",sunset:"venice_sunset_1k.hdr",warehouse:"empty_warehouse_01_1k.hdr"},nC="https://raw.githack.com/pmndrs/drei-assets/456060a26bbeb8fdf79326f224b6d99b8bcce736/hdri/",Vh=s=>Array.isArray(s),RS=["/px.png","/nx.png","/py.png","/ny.png","/pz.png","/nz.png"];function p_({files:s=RS,path:e="",preset:t=void 0,colorSpace:n=void 0,extensions:i}={}){t&&(wS(t),s=nm[t],e=nC);const o=Vh(s),{extension:l,isCubemap:h}=BS(s),d=DS(l);if(!d)throw new Error("useEnvironment: Unrecognized file extension: "+s);const p=Ih(x=>x.gl);Me.useLayoutEffect(()=>{if(l!=="webp"&&l!=="jpg"&&l!=="jpeg")return;function x(){Rl.clear(d,o?[s]:s)}p.domElement.addEventListener("webglcontextlost",x,{once:!0})},[s,p.domElement]);const _=Rl(d,o?[s]:s,x=>{(l==="webp"||l==="jpg"||l==="jpeg")&&x.setRenderer(p),x.setPath==null||x.setPath(e),i&&i(x)});let v=o?_[0]:_;if(l==="jpg"||l==="jpeg"||l==="webp"){var y;v=(y=v.renderTarget)==null?void 0:y.texture}return v.mapping=h?qr:Wf,v.colorSpace=n??(h?"srgb":"srgb-linear"),v}const zI={files:RS,path:"",preset:void 0,extensions:void 0};p_.preload=s=>{const e={...zI,...s};let{files:t,path:n=""}=e;const{preset:i,extensions:o}=e;i&&(wS(i),t=nm[i],n=nC);const{extension:l}=BS(t);if(l==="webp"||l==="jpg"||l==="jpeg")throw new Error("useEnvironment: Preloading gainmaps is not supported");const h=DS(l);if(!h)throw new Error("useEnvironment: Unrecognized file extension: "+t);Rl.preload(h,Vh(t)?[t]:t,d=>{d.setPath==null||d.setPath(n),o&&o(d)})};const VI={files:RS,preset:void 0};p_.clear=s=>{const e={...VI,...s};let{files:t}=e;const{preset:n}=e;n&&(wS(n),t=nm[n]);const{extension:i}=BS(t),o=DS(i);if(!o)throw new Error("useEnvironment: Unrecognized file extension: "+t);Rl.clear(o,Vh(t)?[t]:t)};function wS(s){if(!(s in nm))throw new Error("Preset must be one of: "+Object.keys(nm).join(", "))}function BS(s){var e;const t=Vh(s)&&s.length===6,n=Vh(s)&&s.length===3&&s.some(l=>l.endsWith("json")),i=Vh(s)?s[0]:s;return{extension:t?"cube":n?"webp":i.startsWith("data:application/exr")?"exr":i.startsWith("data:application/hdr")?"hdr":i.startsWith("data:image/jpeg")?"jpg":(e=i.split(".").pop())==null||(e=e.split("?"))==null||(e=e.shift())==null?void 0:e.toLowerCase(),isCubemap:t,isGainmap:n}}function DS(s){return s==="cube"?P1:s==="hdr"?CI:s==="exr"?RI:s==="jpg"||s==="jpeg"?GI:s==="webp"?PI:null}const kI=s=>s.current&&s.current.isScene,XI=s=>kI(s)?s.current:s;function NS(s,e,t,n,i={}){var o,l,h,d;i={backgroundBlurriness:0,backgroundIntensity:1,backgroundRotation:[0,0,0],environmentIntensity:1,environmentRotation:[0,0,0],...i};const p=XI(e||t),_=p.background,v=p.environment,y={backgroundBlurriness:p.backgroundBlurriness,backgroundIntensity:p.backgroundIntensity,backgroundRotation:(o=(l=p.backgroundRotation)==null||l.clone==null?void 0:l.clone())!==null&&o!==void 0?o:[0,0,0],environmentIntensity:p.environmentIntensity,environmentRotation:(h=(d=p.environmentRotation)==null||d.clone==null?void 0:d.clone())!==null&&h!==void 0?h:[0,0,0]};return s!=="only"&&(p.environment=n),s&&(p.background=n),No(p,i),()=>{s!=="only"&&(p.environment=v),s&&(p.background=_),No(p,y)}}function US({scene:s,background:e=!1,map:t,...n}){const i=Ih(o=>o.scene);return Me.useLayoutEffect(()=>{if(t)return NS(e,s,i,t,n)}),null}function iC({background:s=!1,scene:e,blur:t,backgroundBlurriness:n,backgroundIntensity:i,backgroundRotation:o,environmentIntensity:l,environmentRotation:h,...d}){const p=p_(d),_=Ih(v=>v.scene);return Me.useLayoutEffect(()=>NS(s,e,_,p,{backgroundBlurriness:t??n,backgroundIntensity:i,backgroundRotation:o,environmentIntensity:l,environmentRotation:h})),Me.useEffect(()=>()=>{p.dispose()},[p]),null}function YI({children:s,near:e=.1,far:t=1e3,resolution:n=256,frames:i=1,map:o,background:l=!1,blur:h,backgroundBlurriness:d,backgroundIntensity:p,backgroundRotation:_,environmentIntensity:v,environmentRotation:y,scene:x,files:b,path:R,preset:T=void 0,extensions:M}){const w=Ih(V=>V.gl),D=Ih(V=>V.scene),N=Me.useRef(null),[H]=Me.useState(()=>new Mp),O=Me.useMemo(()=>{const V=new Y0(n);return V.texture.type=ki,V},[n]);Me.useEffect(()=>()=>{O.dispose()},[O]),Me.useLayoutEffect(()=>{if(i===1){const V=w.autoClear;w.autoClear=!0,N.current.update(w,H),w.autoClear=V}return NS(l,x,D,O.texture,{backgroundBlurriness:h??d,backgroundIntensity:p,backgroundRotation:_,environmentIntensity:v,environmentRotation:y})},[s,H,O.texture,x,D,l,i,w]);let z=1;return yT(()=>{if(i===1/0||z<i){const V=w.autoClear;w.autoClear=!0,N.current.update(w,H),w.autoClear=V,z++}}),Me.createElement(Me.Fragment,null,_O(Me.createElement(Me.Fragment,null,s,Me.createElement("cubeCamera",{ref:N,args:[e,t,O]}),b||T?Me.createElement(iC,{background:!0,files:b,preset:T,path:R,extensions:M}):o?Me.createElement(US,{background:!0,map:o,extensions:M}):null),H))}function JI(s){var e,t,n,i;const o=p_(s),l=s.map||o;Me.useMemo(()=>MT({GroundProjectedEnvImpl:YO}),[]),Me.useEffect(()=>()=>{o.dispose()},[o]);const h=Me.useMemo(()=>[l],[l]),d=(e=s.ground)==null?void 0:e.height,p=(t=s.ground)==null?void 0:t.radius,_=(n=(i=s.ground)==null?void 0:i.scale)!==null&&n!==void 0?n:1e3;return Me.createElement(Me.Fragment,null,Me.createElement(US,ky({},s,{map:l})),Me.createElement("groundProjectedEnvImpl",{args:h,scale:_,height:d,radius:p}))}function qI(s){return s.ground?Me.createElement(JI,s):s.map?Me.createElement(US,s):s.children?Me.createElement(YI,s):Me.createElement(iC,s)}function aC(s,e){if(e===ox)return console.warn("THREE.BufferGeometryUtils.toTrianglesDrawMode(): Geometry already defined as triangles."),s;if(e===bu||e===fp){let t=s.getIndex();if(t===null){const l=[],h=s.getAttribute("position");if(h!==void 0){for(let d=0;d<h.count;d++)l.push(d);s.setIndex(l),t=s.getIndex()}else return console.error("THREE.BufferGeometryUtils.toTrianglesDrawMode(): Undefined position attribute. Processing not possible."),s}const n=t.count-2,i=[];if(e===bu)for(let l=1;l<=n;l++)i.push(t.getX(0)),i.push(t.getX(l)),i.push(t.getX(l+1));else for(let l=0;l<n;l++)l%2===0?(i.push(t.getX(l)),i.push(t.getX(l+1)),i.push(t.getX(l+2))):(i.push(t.getX(l+2)),i.push(t.getX(l+1)),i.push(t.getX(l)));i.length/3!==n&&console.error("THREE.BufferGeometryUtils.toTrianglesDrawMode(): Unable to generate correct amount of triangles.");const o=s.clone();return o.setIndex(i),o.clearGroups(),o}else return console.error("THREE.BufferGeometryUtils.toTrianglesDrawMode(): Unknown draw mode:",e),s}class KI extends Ba{constructor(e){super(e),this.dracoLoader=null,this.ktx2Loader=null,this.meshoptDecoder=null,this.pluginCallbacks=[],this.register(function(t){return new $I(t)}),this.register(function(t){return new eF(t)}),this.register(function(t){return new cF(t)}),this.register(function(t){return new uF(t)}),this.register(function(t){return new fF(t)}),this.register(function(t){return new nF(t)}),this.register(function(t){return new iF(t)}),this.register(function(t){return new aF(t)}),this.register(function(t){return new sF(t)}),this.register(function(t){return new QI(t)}),this.register(function(t){return new rF(t)}),this.register(function(t){return new tF(t)}),this.register(function(t){return new lF(t)}),this.register(function(t){return new oF(t)}),this.register(function(t){return new jI(t)}),this.register(function(t){return new hF(t)}),this.register(function(t){return new dF(t)})}load(e,t,n,i){const o=this;let l;if(this.resourcePath!=="")l=this.resourcePath;else if(this.path!==""){const p=nr.extractUrlBase(e);l=nr.resolveURL(p,this.path)}else l=nr.extractUrlBase(e);this.manager.itemStart(e);const h=function(p){i?i(p):console.error(p),o.manager.itemError(e),o.manager.itemEnd(e)},d=new da(this.manager);d.setPath(this.path),d.setResponseType("arraybuffer"),d.setRequestHeader(this.requestHeader),d.setWithCredentials(this.withCredentials),d.load(e,function(p){try{o.parse(p,l,function(_){t(_),o.manager.itemEnd(e)},h)}catch(_){h(_)}},n,h)}setDRACOLoader(e){return this.dracoLoader=e,this}setKTX2Loader(e){return this.ktx2Loader=e,this}setMeshoptDecoder(e){return this.meshoptDecoder=e,this}register(e){return this.pluginCallbacks.indexOf(e)===-1&&this.pluginCallbacks.push(e),this}unregister(e){return this.pluginCallbacks.indexOf(e)!==-1&&this.pluginCallbacks.splice(this.pluginCallbacks.indexOf(e),1),this}parse(e,t,n,i){let o;const l={},h={},d=new TextDecoder;if(typeof e=="string")o=JSON.parse(e);else if(e instanceof ArrayBuffer)if(d.decode(new Uint8Array(e,0,4))===sC){try{l[On.KHR_BINARY_GLTF]=new pF(e)}catch(v){i&&i(v);return}o=JSON.parse(l[On.KHR_BINARY_GLTF].content)}else o=JSON.parse(d.decode(e));else o=e;if(o.asset===void 0||o.asset.version[0]<2){i&&i(new Error("THREE.GLTFLoader: Unsupported asset. glTF versions >=2.0 are supported."));return}const p=new CF(o,{path:t||this.resourcePath||"",crossOrigin:this.crossOrigin,requestHeader:this.requestHeader,manager:this.manager,ktx2Loader:this.ktx2Loader,meshoptDecoder:this.meshoptDecoder});p.fileLoader.setRequestHeader(this.requestHeader);for(let _=0;_<this.pluginCallbacks.length;_++){const v=this.pluginCallbacks[_](p);v.name||console.error("THREE.GLTFLoader: Invalid plugin found: missing name"),h[v.name]=v,l[v.name]=!0}if(o.extensionsUsed)for(let _=0;_<o.extensionsUsed.length;++_){const v=o.extensionsUsed[_],y=o.extensionsRequired||[];switch(v){case On.KHR_MATERIALS_UNLIT:l[v]=new ZI;break;case On.KHR_DRACO_MESH_COMPRESSION:l[v]=new mF(o,this.dracoLoader);break;case On.KHR_TEXTURE_TRANSFORM:l[v]=new gF;break;case On.KHR_MESH_QUANTIZATION:l[v]=new vF;break;default:y.indexOf(v)>=0&&h[v]===void 0&&console.warn('THREE.GLTFLoader: Unknown extension "'+v+'".')}}p.setExtensions(l),p.setPlugins(h),p.parse(n,i)}parseAsync(e,t){const n=this;return new Promise(function(i,o){n.parse(e,t,i,o)})}}function WI(){let s={};return{get:function(e){return s[e]},add:function(e,t){s[e]=t},remove:function(e){delete s[e]},removeAll:function(){s={}}}}const On={KHR_BINARY_GLTF:"KHR_binary_glTF",KHR_DRACO_MESH_COMPRESSION:"KHR_draco_mesh_compression",KHR_LIGHTS_PUNCTUAL:"KHR_lights_punctual",KHR_MATERIALS_CLEARCOAT:"KHR_materials_clearcoat",KHR_MATERIALS_DISPERSION:"KHR_materials_dispersion",KHR_MATERIALS_IOR:"KHR_materials_ior",KHR_MATERIALS_SHEEN:"KHR_materials_sheen",KHR_MATERIALS_SPECULAR:"KHR_materials_specular",KHR_MATERIALS_TRANSMISSION:"KHR_materials_transmission",KHR_MATERIALS_IRIDESCENCE:"KHR_materials_iridescence",KHR_MATERIALS_ANISOTROPY:"KHR_materials_anisotropy",KHR_MATERIALS_UNLIT:"KHR_materials_unlit",KHR_MATERIALS_VOLUME:"KHR_materials_volume",KHR_TEXTURE_BASISU:"KHR_texture_basisu",KHR_TEXTURE_TRANSFORM:"KHR_texture_transform",KHR_MESH_QUANTIZATION:"KHR_mesh_quantization",KHR_MATERIALS_EMISSIVE_STRENGTH:"KHR_materials_emissive_strength",EXT_MATERIALS_BUMP:"EXT_materials_bump",EXT_TEXTURE_WEBP:"EXT_texture_webp",EXT_TEXTURE_AVIF:"EXT_texture_avif",EXT_MESHOPT_COMPRESSION:"EXT_meshopt_compression",EXT_MESH_GPU_INSTANCING:"EXT_mesh_gpu_instancing"};class jI{constructor(e){this.parser=e,this.name=On.KHR_LIGHTS_PUNCTUAL,this.cache={refs:{},uses:{}}}_markDefs(){const e=this.parser,t=this.parser.json.nodes||[];for(let n=0,i=t.length;n<i;n++){const o=t[n];o.extensions&&o.extensions[this.name]&&o.extensions[this.name].light!==void 0&&e._addNodeRef(this.cache,o.extensions[this.name].light)}}_loadLight(e){const t=this.parser,n="light:"+e;let i=t.cache.get(n);if(i)return i;const o=t.json,d=((o.extensions&&o.extensions[this.name]||{}).lights||[])[e];let p;const _=new Ct(16777215);d.color!==void 0&&_.setRGB(d.color[0],d.color[1],d.color[2],na);const v=d.range!==void 0?d.range:0;switch(d.type){case"directional":p=new Pv(_),p.target.position.set(0,0,-1),p.add(p.target);break;case"point":p=new Hv(_),p.distance=v;break;case"spot":p=new Fv(_),p.distance=v,d.spot=d.spot||{},d.spot.innerConeAngle=d.spot.innerConeAngle!==void 0?d.spot.innerConeAngle:0,d.spot.outerConeAngle=d.spot.outerConeAngle!==void 0?d.spot.outerConeAngle:Math.PI/4,p.angle=d.spot.outerConeAngle,p.penumbra=1-d.spot.innerConeAngle/d.spot.outerConeAngle,p.target.position.set(0,0,-1),p.add(p.target);break;default:throw new Error("THREE.GLTFLoader: Unexpected light type: "+d.type)}return p.position.set(0,0,0),Uo(p,d),d.intensity!==void 0&&(p.intensity=d.intensity),p.name=t.createUniqueName(d.name||"light_"+e),i=Promise.resolve(p),t.cache.add(n,i),i}getDependency(e,t){if(e==="light")return this._loadLight(t)}createNodeAttachment(e){const t=this,n=this.parser,o=n.json.nodes[e],h=(o.extensions&&o.extensions[this.name]||{}).light;return h===void 0?null:this._loadLight(h).then(function(d){return n._getNodeRef(t.cache,h,d)})}}class ZI{constructor(){this.name=On.KHR_MATERIALS_UNLIT}getMaterialType(){return ha}extendParams(e,t,n){const i=[];e.color=new Ct(1,1,1),e.opacity=1;const o=t.pbrMetallicRoughness;if(o){if(Array.isArray(o.baseColorFactor)){const l=o.baseColorFactor;e.color.setRGB(l[0],l[1],l[2],na),e.opacity=l[3]}o.baseColorTexture!==void 0&&i.push(n.assignTexture(e,"map",o.baseColorTexture,Xi))}return Promise.all(i)}}class QI{constructor(e){this.parser=e,this.name=On.KHR_MATERIALS_EMISSIVE_STRENGTH}extendMaterialParams(e,t){const i=this.parser.json.materials[e];if(!i.extensions||!i.extensions[this.name])return Promise.resolve();const o=i.extensions[this.name].emissiveStrength;return o!==void 0&&(t.emissiveIntensity=o),Promise.resolve()}}class $I{constructor(e){this.parser=e,this.name=On.KHR_MATERIALS_CLEARCOAT}getMaterialType(e){const n=this.parser.json.materials[e];return!n.extensions||!n.extensions[this.name]?null:Ji}extendMaterialParams(e,t){const n=this.parser,i=n.json.materials[e];if(!i.extensions||!i.extensions[this.name])return Promise.resolve();const o=[],l=i.extensions[this.name];if(l.clearcoatFactor!==void 0&&(t.clearcoat=l.clearcoatFactor),l.clearcoatTexture!==void 0&&o.push(n.assignTexture(t,"clearcoatMap",l.clearcoatTexture)),l.clearcoatRoughnessFactor!==void 0&&(t.clearcoatRoughness=l.clearcoatRoughnessFactor),l.clearcoatRoughnessTexture!==void 0&&o.push(n.assignTexture(t,"clearcoatRoughnessMap",l.clearcoatRoughnessTexture)),l.clearcoatNormalTexture!==void 0&&(o.push(n.assignTexture(t,"clearcoatNormalMap",l.clearcoatNormalTexture)),l.clearcoatNormalTexture.scale!==void 0)){const h=l.clearcoatNormalTexture.scale;t.clearcoatNormalScale=new nt(h,h)}return Promise.all(o)}}class eF{constructor(e){this.parser=e,this.name=On.KHR_MATERIALS_DISPERSION}getMaterialType(e){const n=this.parser.json.materials[e];return!n.extensions||!n.extensions[this.name]?null:Ji}extendMaterialParams(e,t){const i=this.parser.json.materials[e];if(!i.extensions||!i.extensions[this.name])return Promise.resolve();const o=i.extensions[this.name];return t.dispersion=o.dispersion!==void 0?o.dispersion:0,Promise.resolve()}}class tF{constructor(e){this.parser=e,this.name=On.KHR_MATERIALS_IRIDESCENCE}getMaterialType(e){const n=this.parser.json.materials[e];return!n.extensions||!n.extensions[this.name]?null:Ji}extendMaterialParams(e,t){const n=this.parser,i=n.json.materials[e];if(!i.extensions||!i.extensions[this.name])return Promise.resolve();const o=[],l=i.extensions[this.name];return l.iridescenceFactor!==void 0&&(t.iridescence=l.iridescenceFactor),l.iridescenceTexture!==void 0&&o.push(n.assignTexture(t,"iridescenceMap",l.iridescenceTexture)),l.iridescenceIor!==void 0&&(t.iridescenceIOR=l.iridescenceIor),t.iridescenceThicknessRange===void 0&&(t.iridescenceThicknessRange=[100,400]),l.iridescenceThicknessMinimum!==void 0&&(t.iridescenceThicknessRange[0]=l.iridescenceThicknessMinimum),l.iridescenceThicknessMaximum!==void 0&&(t.iridescenceThicknessRange[1]=l.iridescenceThicknessMaximum),l.iridescenceThicknessTexture!==void 0&&o.push(n.assignTexture(t,"iridescenceThicknessMap",l.iridescenceThicknessTexture)),Promise.all(o)}}class nF{constructor(e){this.parser=e,this.name=On.KHR_MATERIALS_SHEEN}getMaterialType(e){const n=this.parser.json.materials[e];return!n.extensions||!n.extensions[this.name]?null:Ji}extendMaterialParams(e,t){const n=this.parser,i=n.json.materials[e];if(!i.extensions||!i.extensions[this.name])return Promise.resolve();const o=[];t.sheenColor=new Ct(0,0,0),t.sheenRoughness=0,t.sheen=1;const l=i.extensions[this.name];if(l.sheenColorFactor!==void 0){const h=l.sheenColorFactor;t.sheenColor.setRGB(h[0],h[1],h[2],na)}return l.sheenRoughnessFactor!==void 0&&(t.sheenRoughness=l.sheenRoughnessFactor),l.sheenColorTexture!==void 0&&o.push(n.assignTexture(t,"sheenColorMap",l.sheenColorTexture,Xi)),l.sheenRoughnessTexture!==void 0&&o.push(n.assignTexture(t,"sheenRoughnessMap",l.sheenRoughnessTexture)),Promise.all(o)}}class iF{constructor(e){this.parser=e,this.name=On.KHR_MATERIALS_TRANSMISSION}getMaterialType(e){const n=this.parser.json.materials[e];return!n.extensions||!n.extensions[this.name]?null:Ji}extendMaterialParams(e,t){const n=this.parser,i=n.json.materials[e];if(!i.extensions||!i.extensions[this.name])return Promise.resolve();const o=[],l=i.extensions[this.name];return l.transmissionFactor!==void 0&&(t.transmission=l.transmissionFactor),l.transmissionTexture!==void 0&&o.push(n.assignTexture(t,"transmissionMap",l.transmissionTexture)),Promise.all(o)}}class aF{constructor(e){this.parser=e,this.name=On.KHR_MATERIALS_VOLUME}getMaterialType(e){const n=this.parser.json.materials[e];return!n.extensions||!n.extensions[this.name]?null:Ji}extendMaterialParams(e,t){const n=this.parser,i=n.json.materials[e];if(!i.extensions||!i.extensions[this.name])return Promise.resolve();const o=[],l=i.extensions[this.name];t.thickness=l.thicknessFactor!==void 0?l.thicknessFactor:0,l.thicknessTexture!==void 0&&o.push(n.assignTexture(t,"thicknessMap",l.thicknessTexture)),t.attenuationDistance=l.attenuationDistance||1/0;const h=l.attenuationColor||[1,1,1];return t.attenuationColor=new Ct().setRGB(h[0],h[1],h[2],na),Promise.all(o)}}class sF{constructor(e){this.parser=e,this.name=On.KHR_MATERIALS_IOR}getMaterialType(e){const n=this.parser.json.materials[e];return!n.extensions||!n.extensions[this.name]?null:Ji}extendMaterialParams(e,t){const i=this.parser.json.materials[e];if(!i.extensions||!i.extensions[this.name])return Promise.resolve();const o=i.extensions[this.name];return t.ior=o.ior!==void 0?o.ior:1.5,Promise.resolve()}}class rF{constructor(e){this.parser=e,this.name=On.KHR_MATERIALS_SPECULAR}getMaterialType(e){const n=this.parser.json.materials[e];return!n.extensions||!n.extensions[this.name]?null:Ji}extendMaterialParams(e,t){const n=this.parser,i=n.json.materials[e];if(!i.extensions||!i.extensions[this.name])return Promise.resolve();const o=[],l=i.extensions[this.name];t.specularIntensity=l.specularFactor!==void 0?l.specularFactor:1,l.specularTexture!==void 0&&o.push(n.assignTexture(t,"specularIntensityMap",l.specularTexture));const h=l.specularColorFactor||[1,1,1];return t.specularColor=new Ct().setRGB(h[0],h[1],h[2],na),l.specularColorTexture!==void 0&&o.push(n.assignTexture(t,"specularColorMap",l.specularColorTexture,Xi)),Promise.all(o)}}class oF{constructor(e){this.parser=e,this.name=On.EXT_MATERIALS_BUMP}getMaterialType(e){const n=this.parser.json.materials[e];return!n.extensions||!n.extensions[this.name]?null:Ji}extendMaterialParams(e,t){const n=this.parser,i=n.json.materials[e];if(!i.extensions||!i.extensions[this.name])return Promise.resolve();const o=[],l=i.extensions[this.name];return t.bumpScale=l.bumpFactor!==void 0?l.bumpFactor:1,l.bumpTexture!==void 0&&o.push(n.assignTexture(t,"bumpMap",l.bumpTexture)),Promise.all(o)}}class lF{constructor(e){this.parser=e,this.name=On.KHR_MATERIALS_ANISOTROPY}getMaterialType(e){const n=this.parser.json.materials[e];return!n.extensions||!n.extensions[this.name]?null:Ji}extendMaterialParams(e,t){const n=this.parser,i=n.json.materials[e];if(!i.extensions||!i.extensions[this.name])return Promise.resolve();const o=[],l=i.extensions[this.name];return l.anisotropyStrength!==void 0&&(t.anisotropy=l.anisotropyStrength),l.anisotropyRotation!==void 0&&(t.anisotropyRotation=l.anisotropyRotation),l.anisotropyTexture!==void 0&&o.push(n.assignTexture(t,"anisotropyMap",l.anisotropyTexture)),Promise.all(o)}}class cF{constructor(e){this.parser=e,this.name=On.KHR_TEXTURE_BASISU}loadTexture(e){const t=this.parser,n=t.json,i=n.textures[e];if(!i.extensions||!i.extensions[this.name])return null;const o=i.extensions[this.name],l=t.options.ktx2Loader;if(!l){if(n.extensionsRequired&&n.extensionsRequired.indexOf(this.name)>=0)throw new Error("THREE.GLTFLoader: setKTX2Loader must be called before loading KTX2 textures");return null}return t.loadTextureImage(e,o.source,l)}}class uF{constructor(e){this.parser=e,this.name=On.EXT_TEXTURE_WEBP}loadTexture(e){const t=this.name,n=this.parser,i=n.json,o=i.textures[e];if(!o.extensions||!o.extensions[t])return null;const l=o.extensions[t],h=i.images[l.source];let d=n.textureLoader;if(h.uri){const p=n.options.manager.getHandler(h.uri);p!==null&&(d=p)}return n.loadTextureImage(e,l.source,d)}}class fF{constructor(e){this.parser=e,this.name=On.EXT_TEXTURE_AVIF}loadTexture(e){const t=this.name,n=this.parser,i=n.json,o=i.textures[e];if(!o.extensions||!o.extensions[t])return null;const l=o.extensions[t],h=i.images[l.source];let d=n.textureLoader;if(h.uri){const p=n.options.manager.getHandler(h.uri);p!==null&&(d=p)}return n.loadTextureImage(e,l.source,d)}}class hF{constructor(e){this.name=On.EXT_MESHOPT_COMPRESSION,this.parser=e}loadBufferView(e){const t=this.parser.json,n=t.bufferViews[e];if(n.extensions&&n.extensions[this.name]){const i=n.extensions[this.name],o=this.parser.getDependency("buffer",i.buffer),l=this.parser.options.meshoptDecoder;if(!l||!l.supported){if(t.extensionsRequired&&t.extensionsRequired.indexOf(this.name)>=0)throw new Error("THREE.GLTFLoader: setMeshoptDecoder must be called before loading compressed files");return null}return o.then(function(h){const d=i.byteOffset||0,p=i.byteLength||0,_=i.count,v=i.byteStride,y=new Uint8Array(h,d,p);return l.decodeGltfBufferAsync?l.decodeGltfBufferAsync(_,v,y,i.mode,i.filter).then(function(x){return x.buffer}):l.ready.then(function(){const x=new ArrayBuffer(_*v);return l.decodeGltfBuffer(new Uint8Array(x),_,v,y,i.mode,i.filter),x})})}else return null}}class dF{constructor(e){this.name=On.EXT_MESH_GPU_INSTANCING,this.parser=e}createNodeMesh(e){const t=this.parser.json,n=t.nodes[e];if(!n.extensions||!n.extensions[this.name]||n.mesh===void 0)return null;const i=t.meshes[n.mesh];for(const p of i.primitives)if(p.mode!==Mr.TRIANGLES&&p.mode!==Mr.TRIANGLE_STRIP&&p.mode!==Mr.TRIANGLE_FAN&&p.mode!==void 0)return null;const l=n.extensions[this.name].attributes,h=[],d={};for(const p in l)h.push(this.parser.getDependency("accessor",l[p]).then(_=>(d[p]=_,d[p])));return h.length<1?null:(h.push(this.parser.createNodeMesh(e)),Promise.all(h).then(p=>{const _=p.pop(),v=_.isGroup?_.children:[_],y=p[0].count,x=[];for(const b of v){const R=new en,T=new Z,M=new Ca,w=new Z(1,1,1),D=new nv(b.geometry,b.material,y);for(let N=0;N<y;N++)d.TRANSLATION&&T.fromBufferAttribute(d.TRANSLATION,N),d.ROTATION&&M.fromBufferAttribute(d.ROTATION,N),d.SCALE&&w.fromBufferAttribute(d.SCALE,N),D.setMatrixAt(N,R.compose(T,M,w));for(const N in d)if(N==="_COLOR_0"){const H=d[N];D.instanceColor=new xc(H.array,H.itemSize,H.normalized)}else N!=="TRANSLATION"&&N!=="ROTATION"&&N!=="SCALE"&&b.geometry.setAttribute(N,d[N]);Un.prototype.copy.call(D,b),this.parser.assignFinalMaterial(D),x.push(D)}return _.isGroup?(_.clear(),_.add(...x),_):x[0]}))}}const sC="glTF",im=12,rC={JSON:1313821514,BIN:5130562};class pF{constructor(e){this.name=On.KHR_BINARY_GLTF,this.content=null,this.body=null;const t=new DataView(e,0,im),n=new TextDecoder;if(this.header={magic:n.decode(new Uint8Array(e.slice(0,4))),version:t.getUint32(4,!0),length:t.getUint32(8,!0)},this.header.magic!==sC)throw new Error("THREE.GLTFLoader: Unsupported glTF-Binary header.");if(this.header.version<2)throw new Error("THREE.GLTFLoader: Legacy binary file detected.");const i=this.header.length-im,o=new DataView(e,im);let l=0;for(;l<i;){const h=o.getUint32(l,!0);l+=4;const d=o.getUint32(l,!0);if(l+=4,d===rC.JSON){const p=new Uint8Array(e,im+l,h);this.content=n.decode(p)}else if(d===rC.BIN){const p=im+l;this.body=e.slice(p,p+h)}l+=h}if(this.content===null)throw new Error("THREE.GLTFLoader: JSON content not found.")}}class mF{constructor(e,t){if(!t)throw new Error("THREE.GLTFLoader: No DRACOLoader instance provided.");this.name=On.KHR_DRACO_MESH_COMPRESSION,this.json=e,this.dracoLoader=t,this.dracoLoader.preload()}decodePrimitive(e,t){const n=this.json,i=this.dracoLoader,o=e.extensions[this.name].bufferView,l=e.extensions[this.name].attributes,h={},d={},p={};for(const _ in l){const v=OS[_]||_.toLowerCase();h[v]=l[_]}for(const _ in e.attributes){const v=OS[_]||_.toLowerCase();if(l[_]!==void 0){const y=n.accessors[e.attributes[_]],x=kh[y.componentType];p[v]=x.name,d[v]=y.normalized===!0}}return t.getDependency("bufferView",o).then(function(_){return new Promise(function(v,y){i.decodeDracoFile(_,function(x){for(const b in x.attributes){const R=x.attributes[b],T=d[b];T!==void 0&&(R.normalized=T)}v(x)},h,p,na,y)})})}}class gF{constructor(){this.name=On.KHR_TEXTURE_TRANSFORM}extendTexture(e,t){return(t.texCoord===void 0||t.texCoord===e.channel)&&t.offset===void 0&&t.rotation===void 0&&t.scale===void 0||(e=e.clone(),t.texCoord!==void 0&&(e.channel=t.texCoord),t.offset!==void 0&&e.offset.fromArray(t.offset),t.rotation!==void 0&&(e.rotation=t.rotation),t.scale!==void 0&&e.repeat.fromArray(t.scale),e.needsUpdate=!0),e}}class vF{constructor(){this.name=On.KHR_MESH_QUANTIZATION}}class oC extends Pu{constructor(e,t,n,i){super(e,t,n,i)}copySampleValue_(e){const t=this.resultBuffer,n=this.sampleValues,i=this.valueSize,o=e*i*3+i;for(let l=0;l!==i;l++)t[l]=n[o+l];return t}interpolate_(e,t,n,i){const o=this.resultBuffer,l=this.sampleValues,h=this.valueSize,d=h*2,p=h*3,_=i-t,v=(n-t)/_,y=v*v,x=y*v,b=e*p,R=b-p,T=-2*x+3*y,M=x-y,w=1-T,D=M-y+v;for(let N=0;N!==h;N++){const H=l[R+N+h],O=l[R+N+d]*_,z=l[b+N+h],V=l[b+N]*_;o[N]=w*H+D*O+T*z+M*V}return o}}const _F=new Ca;class yF extends oC{interpolate_(e,t,n,i){const o=super.interpolate_(e,t,n,i);return _F.fromArray(o).normalize().toArray(o),o}}const Mr={POINTS:0,LINES:1,LINE_LOOP:2,LINE_STRIP:3,TRIANGLES:4,TRIANGLE_STRIP:5,TRIANGLE_FAN:6},kh={5120:Int8Array,5121:Uint8Array,5122:Int16Array,5123:Uint16Array,5125:Uint32Array,5126:Float32Array},lC={9728:Ti,9729:Cn,9984:tp,9985:yu,9986:lc,9987:Is},cC={33071:Ei,33648:_u,10497:Kr},LS={SCALAR:1,VEC2:2,VEC3:3,VEC4:4,MAT2:4,MAT3:9,MAT4:16},OS={POSITION:"position",NORMAL:"normal",TANGENT:"tangent",TEXCOORD_0:"uv",TEXCOORD_1:"uv1",TEXCOORD_2:"uv2",TEXCOORD_3:"uv3",COLOR_0:"color",WEIGHTS_0:"skinWeight",JOINTS_0:"skinIndex"},Bc={scale:"scale",translation:"position",rotation:"quaternion",weights:"morphTargetInfluences"},xF={CUBICSPLINE:void 0,LINEAR:uc,STEP:Au},IS={OPAQUE:"OPAQUE",MASK:"MASK",BLEND:"BLEND"};function AF(s){return s.DefaultMaterial===void 0&&(s.DefaultMaterial=new Fu({color:16777215,emissive:0,metalness:1,roughness:1,transparent:!1,depthTest:!0,side:Yr})),s.DefaultMaterial}function nf(s,e,t){for(const n in t.extensions)s[n]===void 0&&(e.userData.gltfExtensions=e.userData.gltfExtensions||{},e.userData.gltfExtensions[n]=t.extensions[n])}function Uo(s,e){e.extras!==void 0&&(typeof e.extras=="object"?Object.assign(s.userData,e.extras):console.warn("THREE.GLTFLoader: Ignoring primitive type .extras, "+e.extras))}function SF(s,e,t){let n=!1,i=!1,o=!1;for(let p=0,_=e.length;p<_;p++){const v=e[p];if(v.POSITION!==void 0&&(n=!0),v.NORMAL!==void 0&&(i=!0),v.COLOR_0!==void 0&&(o=!0),n&&i&&o)break}if(!n&&!i&&!o)return Promise.resolve(s);const l=[],h=[],d=[];for(let p=0,_=e.length;p<_;p++){const v=e[p];if(n){const y=v.POSITION!==void 0?t.getDependency("accessor",v.POSITION):s.attributes.position;l.push(y)}if(i){const y=v.NORMAL!==void 0?t.getDependency("accessor",v.NORMAL):s.attributes.normal;h.push(y)}if(o){const y=v.COLOR_0!==void 0?t.getDependency("accessor",v.COLOR_0):s.attributes.color;d.push(y)}}return Promise.all([Promise.all(l),Promise.all(h),Promise.all(d)]).then(function(p){const _=p[0],v=p[1],y=p[2];return n&&(s.morphAttributes.position=_),i&&(s.morphAttributes.normal=v),o&&(s.morphAttributes.color=y),s.morphTargetsRelative=!0,s})}function MF(s,e){if(s.updateMorphTargets(),e.weights!==void 0)for(let t=0,n=e.weights.length;t<n;t++)s.morphTargetInfluences[t]=e.weights[t];if(e.extras&&Array.isArray(e.extras.targetNames)){const t=e.extras.targetNames;if(s.morphTargetInfluences.length===t.length){s.morphTargetDictionary={};for(let n=0,i=t.length;n<i;n++)s.morphTargetDictionary[t[n]]=n}else console.warn("THREE.GLTFLoader: Invalid extras.targetNames length. Ignoring names.")}}function bF(s){let e;const t=s.extensions&&s.extensions[On.KHR_DRACO_MESH_COMPRESSION];if(t?e="draco:"+t.bufferView+":"+t.indices+":"+FS(t.attributes):e=s.indices+":"+FS(s.attributes)+":"+s.mode,s.targets!==void 0)for(let n=0,i=s.targets.length;n<i;n++)e+=":"+FS(s.targets[n]);return e}function FS(s){let e="";const t=Object.keys(s).sort();for(let n=0,i=t.length;n<i;n++)e+=t[n]+":"+s[t[n]]+";";return e}function HS(s){switch(s){case Int8Array:return .007874015748031496;case Uint8Array:return .00392156862745098;case Int16Array:return 3051850947599719e-20;case Uint16Array:return 15259021896696422e-21;default:throw new Error("THREE.GLTFLoader: Unsupported normalized accessor component type.")}}function EF(s){return s.search(/\.jpe?g($|\?)/i)>0||s.search(/^data\:image\/jpeg/)===0?"image/jpeg":s.search(/\.webp($|\?)/i)>0||s.search(/^data\:image\/webp/)===0?"image/webp":s.search(/\.ktx2($|\?)/i)>0||s.search(/^data\:image\/ktx2/)===0?"image/ktx2":"image/png"}const TF=new en;class CF{constructor(e={},t={}){this.json=e,this.extensions={},this.plugins={},this.options=t,this.cache=new WI,this.associations=new Map,this.primitiveCache={},this.nodeCache={},this.meshCache={refs:{},uses:{}},this.cameraCache={refs:{},uses:{}},this.lightCache={refs:{},uses:{}},this.sourceCache={},this.textureCache={},this.nodeNamesUsed={};let n=!1,i=-1,o=!1,l=-1;if(typeof navigator<"u"){const h=navigator.userAgent;n=/^((?!chrome|android).)*safari/i.test(h)===!0;const d=h.match(/Version\/(\d+)/);i=n&&d?parseInt(d[1],10):-1,o=h.indexOf("Firefox")>-1,l=o?h.match(/Firefox\/([0-9]+)\./)[1]:-1}typeof createImageBitmap>"u"||n&&i<17||o&&l<98?this.textureLoader=new uA(this.options.manager):this.textureLoader=new mA(this.options.manager),this.textureLoader.setCrossOrigin(this.options.crossOrigin),this.textureLoader.setRequestHeader(this.options.requestHeader),this.fileLoader=new da(this.options.manager),this.fileLoader.setResponseType("arraybuffer"),this.options.crossOrigin==="use-credentials"&&this.fileLoader.setWithCredentials(!0)}setExtensions(e){this.extensions=e}setPlugins(e){this.plugins=e}parse(e,t){const n=this,i=this.json,o=this.extensions;this.cache.removeAll(),this.nodeCache={},this._invokeAll(function(l){return l._markDefs&&l._markDefs()}),Promise.all(this._invokeAll(function(l){return l.beforeRoot&&l.beforeRoot()})).then(function(){return Promise.all([n.getDependencies("scene"),n.getDependencies("animation"),n.getDependencies("camera")])}).then(function(l){const h={scene:l[0][i.scene||0],scenes:l[0],animations:l[1],cameras:l[2],asset:i.asset,parser:n,userData:{}};return nf(o,h,i),Uo(h,i),Promise.all(n._invokeAll(function(d){return d.afterRoot&&d.afterRoot(h)})).then(function(){for(const d of h.scenes)d.updateMatrixWorld();e(h)})}).catch(t)}_markDefs(){const e=this.json.nodes||[],t=this.json.skins||[],n=this.json.meshes||[];for(let i=0,o=t.length;i<o;i++){const l=t[i].joints;for(let h=0,d=l.length;h<d;h++)e[l[h]].isBone=!0}for(let i=0,o=e.length;i<o;i++){const l=e[i];l.mesh!==void 0&&(this._addNodeRef(this.meshCache,l.mesh),l.skin!==void 0&&(n[l.mesh].isSkinnedMesh=!0)),l.camera!==void 0&&this._addNodeRef(this.cameraCache,l.camera)}}_addNodeRef(e,t){t!==void 0&&(e.refs[t]===void 0&&(e.refs[t]=e.uses[t]=0),e.refs[t]++)}_getNodeRef(e,t,n){if(e.refs[t]<=1)return n;const i=n.clone(),o=(l,h)=>{const d=this.associations.get(l);d!=null&&this.associations.set(h,d);for(const[p,_]of l.children.entries())o(_,h.children[p])};return o(n,i),i.name+="_instance_"+e.uses[t]++,i}_invokeOne(e){const t=Object.values(this.plugins);t.push(this);for(let n=0;n<t.length;n++){const i=e(t[n]);if(i)return i}return null}_invokeAll(e){const t=Object.values(this.plugins);t.unshift(this);const n=[];for(let i=0;i<t.length;i++){const o=e(t[i]);o&&n.push(o)}return n}getDependency(e,t){const n=e+":"+t;let i=this.cache.get(n);if(!i){switch(e){case"scene":i=this.loadScene(t);break;case"node":i=this._invokeOne(function(o){return o.loadNode&&o.loadNode(t)});break;case"mesh":i=this._invokeOne(function(o){return o.loadMesh&&o.loadMesh(t)});break;case"accessor":i=this.loadAccessor(t);break;case"bufferView":i=this._invokeOne(function(o){return o.loadBufferView&&o.loadBufferView(t)});break;case"buffer":i=this.loadBuffer(t);break;case"material":i=this._invokeOne(function(o){return o.loadMaterial&&o.loadMaterial(t)});break;case"texture":i=this._invokeOne(function(o){return o.loadTexture&&o.loadTexture(t)});break;case"skin":i=this.loadSkin(t);break;case"animation":i=this._invokeOne(function(o){return o.loadAnimation&&o.loadAnimation(t)});break;case"camera":i=this.loadCamera(t);break;default:if(i=this._invokeOne(function(o){return o!=this&&o.getDependency&&o.getDependency(e,t)}),!i)throw new Error("Unknown type: "+e);break}this.cache.add(n,i)}return i}getDependencies(e){let t=this.cache.get(e);if(!t){const n=this,i=this.json[e+(e==="mesh"?"es":"s")]||[];t=Promise.all(i.map(function(o,l){return n.getDependency(e,l)})),this.cache.add(e,t)}return t}loadBuffer(e){const t=this.json.buffers[e],n=this.fileLoader;if(t.type&&t.type!=="arraybuffer")throw new Error("THREE.GLTFLoader: "+t.type+" buffer type is not supported.");if(t.uri===void 0&&e===0)return Promise.resolve(this.extensions[On.KHR_BINARY_GLTF].body);const i=this.options;return new Promise(function(o,l){n.load(nr.resolveURL(t.uri,i.path),o,void 0,function(){l(new Error('THREE.GLTFLoader: Failed to load buffer "'+t.uri+'".'))})})}loadBufferView(e){const t=this.json.bufferViews[e];return this.getDependency("buffer",t.buffer).then(function(n){const i=t.byteLength||0,o=t.byteOffset||0;return n.slice(o,o+i)})}loadAccessor(e){const t=this,n=this.json,i=this.json.accessors[e];if(i.bufferView===void 0&&i.sparse===void 0){const l=LS[i.type],h=kh[i.componentType],d=i.normalized===!0,p=new h(i.count*l);return Promise.resolve(new Hn(p,l,d))}const o=[];return i.bufferView!==void 0?o.push(this.getDependency("bufferView",i.bufferView)):o.push(null),i.sparse!==void 0&&(o.push(this.getDependency("bufferView",i.sparse.indices.bufferView)),o.push(this.getDependency("bufferView",i.sparse.values.bufferView))),Promise.all(o).then(function(l){const h=l[0],d=LS[i.type],p=kh[i.componentType],_=p.BYTES_PER_ELEMENT,v=_*d,y=i.byteOffset||0,x=i.bufferView!==void 0?n.bufferViews[i.bufferView].byteStride:void 0,b=i.normalized===!0;let R,T;if(x&&x!==v){const M=Math.floor(y/x),w="InterleavedBuffer:"+i.bufferView+":"+i.componentType+":"+M+":"+i.count;let D=t.cache.get(w);D||(R=new p(h,M*x,i.count*x/_),D=new yh(R,x/_),t.cache.add(w,D)),T=new Al(D,d,y%x/_,b)}else h===null?R=new p(i.count*d):R=new p(h,y,i.count*d),T=new Hn(R,d,b);if(i.sparse!==void 0){const M=LS.SCALAR,w=kh[i.sparse.indices.componentType],D=i.sparse.indices.byteOffset||0,N=i.sparse.values.byteOffset||0,H=new w(l[1],D,i.sparse.count*M),O=new p(l[2],N,i.sparse.count*d);h!==null&&(T=new Hn(T.array.slice(),T.itemSize,T.normalized)),T.normalized=!1;for(let z=0,V=H.length;z<V;z++){const U=H[z];if(T.setX(U,O[z*d]),d>=2&&T.setY(U,O[z*d+1]),d>=3&&T.setZ(U,O[z*d+2]),d>=4&&T.setW(U,O[z*d+3]),d>=5)throw new Error("THREE.GLTFLoader: Unsupported itemSize in sparse BufferAttribute.")}T.normalized=b}return T})}loadTexture(e){const t=this.json,n=this.options,o=t.textures[e].source,l=t.images[o];let h=this.textureLoader;if(l.uri){const d=n.manager.getHandler(l.uri);d!==null&&(h=d)}return this.loadTextureImage(e,o,h)}loadTextureImage(e,t,n){const i=this,o=this.json,l=o.textures[e],h=o.images[t],d=(h.uri||h.bufferView)+":"+l.sampler;if(this.textureCache[d])return this.textureCache[d];const p=this.loadImageSource(t,n).then(function(_){_.flipY=!1,_.name=l.name||h.name||"",_.name===""&&typeof h.uri=="string"&&h.uri.startsWith("data:image/")===!1&&(_.name=h.uri);const y=(o.samplers||{})[l.sampler]||{};return _.magFilter=lC[y.magFilter]||Cn,_.minFilter=lC[y.minFilter]||Is,_.wrapS=cC[y.wrapS]||Kr,_.wrapT=cC[y.wrapT]||Kr,_.generateMipmaps=!_.isCompressedTexture&&_.minFilter!==Ti&&_.minFilter!==Cn,i.associations.set(_,{textures:e}),_}).catch(function(){return null});return this.textureCache[d]=p,p}loadImageSource(e,t){const n=this,i=this.json,o=this.options;if(this.sourceCache[e]!==void 0)return this.sourceCache[e].then(v=>v.clone());const l=i.images[e],h=self.URL||self.webkitURL;let d=l.uri||"",p=!1;if(l.bufferView!==void 0)d=n.getDependency("bufferView",l.bufferView).then(function(v){p=!0;const y=new Blob([v],{type:l.mimeType});return d=h.createObjectURL(y),d});else if(l.uri===void 0)throw new Error("THREE.GLTFLoader: Image "+e+" is missing URI and bufferView");const _=Promise.resolve(d).then(function(v){return new Promise(function(y,x){let b=y;t.isImageBitmapLoader===!0&&(b=function(R){const T=new Qn(R);T.needsUpdate=!0,y(T)}),t.load(nr.resolveURL(v,o.path),b,void 0,x)})}).then(function(v){return p===!0&&h.revokeObjectURL(d),Uo(v,l),v.userData.mimeType=l.mimeType||EF(l.uri),v}).catch(function(v){throw console.error("THREE.GLTFLoader: Couldn't load texture",d),v});return this.sourceCache[e]=_,_}assignTexture(e,t,n,i){const o=this;return this.getDependency("texture",n.index).then(function(l){if(!l)return null;if(n.texCoord!==void 0&&n.texCoord>0&&(l=l.clone(),l.channel=n.texCoord),o.extensions[On.KHR_TEXTURE_TRANSFORM]){const h=n.extensions!==void 0?n.extensions[On.KHR_TEXTURE_TRANSFORM]:void 0;if(h){const d=o.associations.get(l);l=o.extensions[On.KHR_TEXTURE_TRANSFORM].extendTexture(l,h),o.associations.set(l,d)}}return i!==void 0&&(l.colorSpace=i),e[t]=l,l})}assignFinalMaterial(e){const t=e.geometry;let n=e.material;const i=t.attributes.tangent===void 0,o=t.attributes.color!==void 0,l=t.attributes.normal===void 0;if(e.isPoints){const h="PointsMaterial:"+n.uuid;let d=this.cache.get(h);d||(d=new Np,Yi.prototype.copy.call(d,n),d.color.copy(n.color),d.map=n.map,d.sizeAttenuation=!1,this.cache.add(h,d)),n=d}else if(e.isLine){const h="LineBasicMaterial:"+n.uuid;let d=this.cache.get(h);d||(d=new za,Yi.prototype.copy.call(d,n),d.color.copy(n.color),d.map=n.map,this.cache.add(h,d)),n=d}if(i||o||l){let h="ClonedMaterial:"+n.uuid+":";i&&(h+="derivative-tangents:"),o&&(h+="vertex-colors:"),l&&(h+="flat-shading:");let d=this.cache.get(h);d||(d=n.clone(),o&&(d.vertexColors=!0),l&&(d.flatShading=!0),i&&(d.normalScale&&(d.normalScale.y*=-1),d.clearcoatNormalScale&&(d.clearcoatNormalScale.y*=-1)),this.cache.add(h,d),this.associations.set(d,this.associations.get(n))),n=d}e.material=n}getMaterialType(){return Fu}loadMaterial(e){const t=this,n=this.json,i=this.extensions,o=n.materials[e];let l;const h={},d=o.extensions||{},p=[];if(d[On.KHR_MATERIALS_UNLIT]){const v=i[On.KHR_MATERIALS_UNLIT];l=v.getMaterialType(),p.push(v.extendParams(h,o,t))}else{const v=o.pbrMetallicRoughness||{};if(h.color=new Ct(1,1,1),h.opacity=1,Array.isArray(v.baseColorFactor)){const y=v.baseColorFactor;h.color.setRGB(y[0],y[1],y[2],na),h.opacity=y[3]}v.baseColorTexture!==void 0&&p.push(t.assignTexture(h,"map",v.baseColorTexture,Xi)),h.metalness=v.metallicFactor!==void 0?v.metallicFactor:1,h.roughness=v.roughnessFactor!==void 0?v.roughnessFactor:1,v.metallicRoughnessTexture!==void 0&&(p.push(t.assignTexture(h,"metalnessMap",v.metallicRoughnessTexture)),p.push(t.assignTexture(h,"roughnessMap",v.metallicRoughnessTexture))),l=this._invokeOne(function(y){return y.getMaterialType&&y.getMaterialType(e)}),p.push(Promise.all(this._invokeAll(function(y){return y.extendMaterialParams&&y.extendMaterialParams(e,h)})))}o.doubleSided===!0&&(h.side=Ws);const _=o.alphaMode||IS.OPAQUE;if(_===IS.BLEND?(h.transparent=!0,h.depthWrite=!1):(h.transparent=!1,_===IS.MASK&&(h.alphaTest=o.alphaCutoff!==void 0?o.alphaCutoff:.5)),o.normalTexture!==void 0&&l!==ha&&(p.push(t.assignTexture(h,"normalMap",o.normalTexture)),h.normalScale=new nt(1,1),o.normalTexture.scale!==void 0)){const v=o.normalTexture.scale;h.normalScale.set(v,v)}if(o.occlusionTexture!==void 0&&l!==ha&&(p.push(t.assignTexture(h,"aoMap",o.occlusionTexture)),o.occlusionTexture.strength!==void 0&&(h.aoMapIntensity=o.occlusionTexture.strength)),o.emissiveFactor!==void 0&&l!==ha){const v=o.emissiveFactor;h.emissive=new Ct().setRGB(v[0],v[1],v[2],na)}return o.emissiveTexture!==void 0&&l!==ha&&p.push(t.assignTexture(h,"emissiveMap",o.emissiveTexture,Xi)),Promise.all(p).then(function(){const v=new l(h);return o.name&&(v.name=o.name),Uo(v,o),t.associations.set(v,{materials:e}),o.extensions&&nf(i,v,o),v})}createUniqueName(e){const t=kn.sanitizeNodeName(e||"");return t in this.nodeNamesUsed?t+"_"+ ++this.nodeNamesUsed[t]:(this.nodeNamesUsed[t]=0,t)}loadGeometries(e){const t=this,n=this.extensions,i=this.primitiveCache;function o(h){return n[On.KHR_DRACO_MESH_COMPRESSION].decodePrimitive(h,t).then(function(d){return uC(d,h,t)})}const l=[];for(let h=0,d=e.length;h<d;h++){const p=e[h],_=bF(p),v=i[_];if(v)l.push(v.promise);else{let y;p.extensions&&p.extensions[On.KHR_DRACO_MESH_COMPRESSION]?y=o(p):y=uC(new pn,p,t),i[_]={primitive:p,promise:y},l.push(y)}}return Promise.all(l)}loadMesh(e){const t=this,n=this.json,i=this.extensions,o=n.meshes[e],l=o.primitives,h=[];for(let d=0,p=l.length;d<p;d++){const _=l[d].material===void 0?AF(this.cache):this.getDependency("material",l[d].material);h.push(_)}return h.push(t.loadGeometries(l)),Promise.all(h).then(function(d){const p=d.slice(0,d.length-1),_=d[d.length-1],v=[];for(let x=0,b=_.length;x<b;x++){const R=_[x],T=l[x];let M;const w=p[x];if(T.mode===Mr.TRIANGLES||T.mode===Mr.TRIANGLE_STRIP||T.mode===Mr.TRIANGLE_FAN||T.mode===void 0)M=o.isSkinnedMesh===!0?new ev(R,w):new yi(R,w),M.isSkinnedMesh===!0&&M.normalizeSkinWeights(),T.mode===Mr.TRIANGLE_STRIP?M.geometry=aC(M.geometry,fp):T.mode===Mr.TRIANGLE_FAN&&(M.geometry=aC(M.geometry,bu));else if(T.mode===Mr.LINES)M=new yr(R,w);else if(T.mode===Mr.LINE_STRIP)M=new wo(R,w);else if(T.mode===Mr.LINE_LOOP)M=new fv(R,w);else if(T.mode===Mr.POINTS)M=new pv(R,w);else throw new Error("THREE.GLTFLoader: Primitive mode unsupported: "+T.mode);Object.keys(M.geometry.morphAttributes).length>0&&MF(M,o),M.name=t.createUniqueName(o.name||"mesh_"+e),Uo(M,o),T.extensions&&nf(i,M,T),t.assignFinalMaterial(M),v.push(M)}for(let x=0,b=v.length;x<b;x++)t.associations.set(v[x],{meshes:e,primitives:x});if(v.length===1)return o.extensions&&nf(i,v[0],o),v[0];const y=new vr;o.extensions&&nf(i,y,o),t.associations.set(y,{meshes:e});for(let x=0,b=v.length;x<b;x++)y.add(v[x]);return y})}loadCamera(e){let t;const n=this.json.cameras[e],i=n[n.type];if(!i){console.warn("THREE.GLTFLoader: Missing camera parameters.");return}return n.type==="perspective"?t=new aa(E0.radToDeg(i.yfov),i.aspectRatio||1,i.znear||1,i.zfar||2e6):n.type==="orthographic"&&(t=new Tl(-i.xmag,i.xmag,i.ymag,-i.ymag,i.znear,i.zfar)),n.name&&(t.name=this.createUniqueName(n.name)),Uo(t,n),Promise.resolve(t)}loadSkin(e){const t=this.json.skins[e],n=[];for(let i=0,o=t.joints.length;i<o;i++)n.push(this._loadNodeShallow(t.joints[i]));return t.inverseBindMatrices!==void 0?n.push(this.getDependency("accessor",t.inverseBindMatrices)):n.push(null),Promise.all(n).then(function(i){const o=i.pop(),l=i,h=[],d=[];for(let p=0,_=l.length;p<_;p++){const v=l[p];if(v){h.push(v);const y=new en;o!==null&&y.fromArray(o.array,p*16),d.push(y)}else console.warn('THREE.GLTFLoader: Joint "%s" could not be found.',t.joints[p])}return new bh(h,d)})}loadAnimation(e){const t=this.json,n=this,i=t.animations[e],o=i.name?i.name:"animation_"+e,l=[],h=[],d=[],p=[],_=[];for(let v=0,y=i.channels.length;v<y;v++){const x=i.channels[v],b=i.samplers[x.sampler],R=x.target,T=R.node,M=i.parameters!==void 0?i.parameters[b.input]:b.input,w=i.parameters!==void 0?i.parameters[b.output]:b.output;R.node!==void 0&&(l.push(this.getDependency("node",T)),h.push(this.getDependency("accessor",M)),d.push(this.getDependency("accessor",w)),p.push(b),_.push(R))}return Promise.all([Promise.all(l),Promise.all(h),Promise.all(d),Promise.all(p),Promise.all(_)]).then(function(v){const y=v[0],x=v[1],b=v[2],R=v[3],T=v[4],M=[];for(let D=0,N=y.length;D<N;D++){const H=y[D],O=x[D],z=b[D],V=R[D],U=T[D];if(H===void 0)continue;H.updateMatrix&&H.updateMatrix();const F=n._createAnimationTracks(H,O,z,V,U);if(F)for(let K=0;K<F.length;K++)M.push(F[K])}const w=new Vu(o,void 0,M);return Uo(w,i),w})}createNodeMesh(e){const t=this.json,n=this,i=t.nodes[e];return i.mesh===void 0?null:n.getDependency("mesh",i.mesh).then(function(o){const l=n._getNodeRef(n.meshCache,i.mesh,o);return i.weights!==void 0&&l.traverse(function(h){if(h.isMesh)for(let d=0,p=i.weights.length;d<p;d++)h.morphTargetInfluences[d]=i.weights[d]}),l})}loadNode(e){const t=this.json,n=this,i=t.nodes[e],o=n._loadNodeShallow(e),l=[],h=i.children||[];for(let p=0,_=h.length;p<_;p++)l.push(n.getDependency("node",h[p]));const d=i.skin===void 0?Promise.resolve(null):n.getDependency("skin",i.skin);return Promise.all([o,Promise.all(l),d]).then(function(p){const _=p[0],v=p[1],y=p[2];y!==null&&_.traverse(function(x){x.isSkinnedMesh&&x.bind(y,TF)});for(let x=0,b=v.length;x<b;x++)_.add(v[x]);return _})}_loadNodeShallow(e){const t=this.json,n=this.extensions,i=this;if(this.nodeCache[e]!==void 0)return this.nodeCache[e];const o=t.nodes[e],l=o.name?i.createUniqueName(o.name):"",h=[],d=i._invokeOne(function(p){return p.createNodeMesh&&p.createNodeMesh(e)});return d&&h.push(d),o.camera!==void 0&&h.push(i.getDependency("camera",o.camera).then(function(p){return i._getNodeRef(i.cameraCache,o.camera,p)})),i._invokeAll(function(p){return p.createNodeAttachment&&p.createNodeAttachment(e)}).forEach(function(p){h.push(p)}),this.nodeCache[e]=Promise.all(h).then(function(p){let _;if(o.isBone===!0?_=new Cp:p.length>1?_=new vr:p.length===1?_=p[0]:_=new Un,_!==p[0])for(let v=0,y=p.length;v<y;v++)_.add(p[v]);if(o.name&&(_.userData.name=o.name,_.name=l),Uo(_,o),o.extensions&&nf(n,_,o),o.matrix!==void 0){const v=new en;v.fromArray(o.matrix),_.applyMatrix4(v)}else o.translation!==void 0&&_.position.fromArray(o.translation),o.rotation!==void 0&&_.quaternion.fromArray(o.rotation),o.scale!==void 0&&_.scale.fromArray(o.scale);if(!i.associations.has(_))i.associations.set(_,{});else if(o.mesh!==void 0&&i.meshCache.refs[o.mesh]>1){const v=i.associations.get(_);i.associations.set(_,{...v})}return i.associations.get(_).nodes=e,_}),this.nodeCache[e]}loadScene(e){const t=this.extensions,n=this.json.scenes[e],i=this,o=new vr;n.name&&(o.name=i.createUniqueName(n.name)),Uo(o,n),n.extensions&&nf(t,o,n);const l=n.nodes||[],h=[];for(let d=0,p=l.length;d<p;d++)h.push(i.getDependency("node",l[d]));return Promise.all(h).then(function(d){for(let _=0,v=d.length;_<v;_++)o.add(d[_]);const p=_=>{const v=new Map;for(const[y,x]of i.associations)(y instanceof Yi||y instanceof Qn)&&v.set(y,x);return _.traverse(y=>{const x=i.associations.get(y);x!=null&&v.set(y,x)}),v};return i.associations=p(o),o})}_createAnimationTracks(e,t,n,i,o){const l=[],h=e.name?e.name:e.uuid,d=[];Bc[o.path]===Bc.weights?e.traverse(function(y){y.morphTargetInfluences&&d.push(y.name?y.name:y.uuid)}):d.push(h);let p;switch(Bc[o.path]){case Bc.weights:p=Sl;break;case Bc.rotation:p=Ml;break;case Bc.translation:case Bc.scale:p=bl;break;default:n.itemSize===1?p=Sl:p=bl;break}const _=i.interpolation!==void 0?xF[i.interpolation]:uc,v=this._getArrayFromAccessor(n);for(let y=0,x=d.length;y<x;y++){const b=new p(d[y]+"."+Bc[o.path],t.array,v,_);i.interpolation==="CUBICSPLINE"&&this._createCubicSplineTrackInterpolant(b),l.push(b)}return l}_getArrayFromAccessor(e){let t=e.array;if(e.normalized){const n=HS(t.constructor),i=new Float32Array(t.length);for(let o=0,l=t.length;o<l;o++)i[o]=t[o]*n;t=i}return t}_createCubicSplineTrackInterpolant(e){e.createInterpolant=function(n){const i=this instanceof Ml?yF:oC;return new i(this.times,this.values,this.getValueSize()/3,n)},e.createInterpolant.isInterpolantFactoryMethodGLTFCubicSpline=!0}}function RF(s,e,t){const n=e.attributes,i=new Ra;if(n.POSITION!==void 0){const h=t.json.accessors[n.POSITION],d=h.min,p=h.max;if(d!==void 0&&p!==void 0){if(i.set(new Z(d[0],d[1],d[2]),new Z(p[0],p[1],p[2])),h.normalized){const _=HS(kh[h.componentType]);i.min.multiplyScalar(_),i.max.multiplyScalar(_)}}else{console.warn("THREE.GLTFLoader: Missing min/max properties for accessor POSITION.");return}}else return;const o=e.targets;if(o!==void 0){const h=new Z,d=new Z;for(let p=0,_=o.length;p<_;p++){const v=o[p];if(v.POSITION!==void 0){const y=t.json.accessors[v.POSITION],x=y.min,b=y.max;if(x!==void 0&&b!==void 0){if(d.setX(Math.max(Math.abs(x[0]),Math.abs(b[0]))),d.setY(Math.max(Math.abs(x[1]),Math.abs(b[1]))),d.setZ(Math.max(Math.abs(x[2]),Math.abs(b[2]))),y.normalized){const R=HS(kh[y.componentType]);d.multiplyScalar(R)}h.max(d)}else console.warn("THREE.GLTFLoader: Missing min/max properties for accessor POSITION.")}}i.expandByVector(h)}s.boundingBox=i;const l=new fa;i.getCenter(l.center),l.radius=i.min.distanceTo(i.max)/2,s.boundingSphere=l}function uC(s,e,t){const n=e.attributes,i=[];function o(l,h){return t.getDependency("accessor",l).then(function(d){s.setAttribute(h,d)})}for(const l in n){const h=OS[l]||l.toLowerCase();h in s.attributes||i.push(o(n[l],h))}if(e.indices!==void 0&&!s.index){const l=t.getDependency("accessor",e.indices).then(function(h){s.setIndex(h)});i.push(l)}return Bn.workingColorSpace!==na&&"COLOR_0"in n&&console.warn(`THREE.GLTFLoader: Converting vertex colors from "srgb-linear" to "${Bn.workingColorSpace}" not supported.`),Uo(s,e),RF(s,e,t),Promise.all(i).then(function(){return e.targets!==void 0?SF(s,e.targets,t):s})}const PS="https://ai.streamoji.com",ga=(...s)=>{},wF=(...s)=>{},fC=({analyser:s})=>{const e=Me.useRef(null),t=Me.useRef(null);return Me.useEffect(()=>{const n=e.current;if(!n)return;const i=n.getContext("2d",{alpha:!0});if(!i)return;let o,l=null;s&&(s.fftSize=128,l=new Uint8Array(s.frequencyBinCount));const h=()=>{o=requestAnimationFrame(h),(n.width!==n.offsetWidth||n.height!==n.offsetHeight)&&(n.width=n.offsetWidth,n.height=n.offsetHeight);const d=n.width,p=n.height;if(d===0||p===0)return;const _=p/2;i.clearRect(0,0,d,p),i.fillStyle="#1e293b";const v=2,x=v+2,b=d*.95,R=Math.floor(b/x);(!t.current||t.current.length!==R)&&(t.current=new Float32Array(R).fill(2));const T=R*x,M=(d-T)/2;s&&l&&s.getByteFrequencyData(l);const w=l?l.length:0,N=Math.floor(w*.7)/R,H=new Float32Array(R);for(let O=0;O<R;O++){let z=0;if(l&&N>0){const F=Math.floor(O*N),K=Math.floor((O+1)*N);for(let ne=F;ne<K;ne++){const $=l[ne]||0;$>z&&(z=$)}}z<10&&(z=0);const V=z/255,U=z>0?Math.max(2,Math.pow(V,1.4)*p*.25):2;H[O]=U}for(let O=0;O<R;O++){const z=R-1-O,V=Math.max(H[O],H[z]),U=t.current[O]+(V-t.current[O])*.3;t.current[O]=U;const F=M+O*x,K=_-U/2;i.beginPath(),i.roundRect?i.roundRect(F,K,v,U,4):i.fillRect(F,K,v,U),i.fill()}};return h(),()=>{cancelAnimationFrame(o)}},[s]),Gt.jsx("canvas",{ref:e,style:{width:"100%",height:"100%",display:"block"}})},BF="https://pub-48df6f7d60d6440bbd01676ea5d90e55.r2.dev",hC="https://pub-be53cae7bd99457a8c1f11b4d38f1672.r2.dev/default-models/fullbodyavatarmale.glb";async function DF(s){const e=await crypto.subtle.digest("SHA-256",new TextEncoder().encode(s));return Array.from(new Uint8Array(e)).map(t=>t.toString(16).padStart(2,"0")).join("")}function NF(s){const[e,t]=Me.useState(null);return Me.useEffect(()=>{if(!s){t(null);return}let n=!1;return DF(s).then(i=>{if(n)return;const o=`${BF}/${i}.glb`;fetch(o,{method:"HEAD"}).then(l=>{n||t(l.ok?o:hC)}).catch(()=>{n||t(hC)})}),()=>{n=!0}},[s]),e}const UF=["https://pub-be53cae7bd99457a8c1f11b4d38f1672.r2.dev/masculine/idle/M_Standing_Idle_Variations_001.glb","https://pub-be53cae7bd99457a8c1f11b4d38f1672.r2.dev/masculine/idle/M_Standing_Idle_Variations_002.glb","https://pub-be53cae7bd99457a8c1f11b4d38f1672.r2.dev/masculine/idle/M_Standing_Idle_002.glb","https://pub-be53cae7bd99457a8c1f11b4d38f1672.r2.dev/masculine/idle/M_Standing_Idle_Variations_005.glb"],LF=["https://pub-be53cae7bd99457a8c1f11b4d38f1672.r2.dev/masculine/idle/F_Standing_Idle_Variations_001.glb","https://pub-be53cae7bd99457a8c1f11b4d38f1672.r2.dev/masculine/idle/F_Standing_Idle_Variations_003.glb","https://pub-be53cae7bd99457a8c1f11b4d38f1672.r2.dev/masculine/idle/F_Standing_Idle_Variations_003.glb"],OF=[{id:"m_expr_01",name:"Friendly Wave",url:"https://pub-be53cae7bd99457a8c1f11b4d38f1672.r2.dev/masculine/expression/M_Standing_Expressions_001.glb"},{id:"m_expr_02",name:"You There",url:"https://pub-be53cae7bd99457a8c1f11b4d38f1672.r2.dev/masculine/expression/M_Standing_Expressions_002.glb"},{id:"m_expr_04",name:"Awkward Agreement",url:"https://pub-be53cae7bd99457a8c1f11b4d38f1672.r2.dev/masculine/expression/M_Standing_Expressions_004.glb"},{id:"m_expr_05",name:"What's Going On?",url:"https://pub-be53cae7bd99457a8c1f11b4d38f1672.r2.dev/masculine/expression/M_Standing_Expressions_005.glb"},{id:"m_expr_06",name:"Tired Stretch",url:"https://pub-be53cae7bd99457a8c1f11b4d38f1672.r2.dev/masculine/expression/M_Standing_Expressions_006.glb"},{id:"m_expr_07",name:"Conceilied Laughter",url:"https://pub-be53cae7bd99457a8c1f11b4d38f1672.r2.dev/masculine/expression/M_Standing_Expressions_007.glb"},{id:"m_expr_08",name:"You Come Here",url:"https://pub-be53cae7bd99457a8c1f11b4d38f1672.r2.dev/masculine/expression/M_Standing_Expressions_008.glb"},{id:"m_expr_09",name:"Come Here Kid",url:"https://pub-be53cae7bd99457a8c1f11b4d38f1672.r2.dev/masculine/expression/M_Standing_Expressions_009.glb"},{id:"m_expr_10",name:"Come Here Everyone",url:"https://pub-be53cae7bd99457a8c1f11b4d38f1672.r2.dev/masculine/expression/M_Standing_Expressions_010.glb"},{id:"m_expr_11",name:"No Freaking Way",url:"https://pub-be53cae7bd99457a8c1f11b4d38f1672.r2.dev/masculine/expression/M_Standing_Expressions_011.glb"},{id:"m_expr_12",name:"Cheerful Approval",url:"https://pub-be53cae7bd99457a8c1f11b4d38f1672.r2.dev/masculine/expression/M_Standing_Expressions_012.glb"},{id:"m_expr_13",name:"Waving Hello",url:"https://pub-be53cae7bd99457a8c1f11b4d38f1672.r2.dev/masculine/expression/M_Standing_Expressions_013.glb"},{id:"m_expr_14",name:"Checking Surroundings",url:"https://pub-be53cae7bd99457a8c1f11b4d38f1672.r2.dev/masculine/expression/M_Standing_Expressions_014.glb"},{id:"m_expr_15",name:"Referee Warning",url:"https://pub-be53cae7bd99457a8c1f11b4d38f1672.r2.dev/masculine/expression/M_Standing_Expressions_015.glb"},{id:"m_expr_16",name:"You Thumbs Down",url:"https://pub-be53cae7bd99457a8c1f11b4d38f1672.r2.dev/masculine/expression/M_Standing_Expressions_016.glb"},{id:"m_expr_17",name:"Side Thumbs Down",url:"https://pub-be53cae7bd99457a8c1f11b4d38f1672.r2.dev/masculine/expression/M_Standing_Expressions_017.glb"},{id:"m_expr_18",name:"You're Finished",url:"https://pub-be53cae7bd99457a8c1f11b4d38f1672.r2.dev/masculine/expression/M_Standing_Expressions_018.glb"},{id:"m_talk_01",name:"Oh God, Why Me?",url:"https://pub-be53cae7bd99457a8c1f11b4d38f1672.r2.dev/masculine/expression/M_Talking_Variations_001.glb"},{id:"m_talk_02",name:"What Are You Doing?",url:"https://pub-be53cae7bd99457a8c1f11b4d38f1672.r2.dev/masculine/expression/M_Talking_Variations_002.glb"},{id:"m_talk_03",name:"What Am I doing?",url:"https://pub-be53cae7bd99457a8c1f11b4d38f1672.r2.dev/masculine/expression/M_Talking_Variations_003.glb"},{id:"m_talk_04",name:"No Way",url:"https://pub-be53cae7bd99457a8c1f11b4d38f1672.r2.dev/masculine/expression/M_Talking_Variations_004.glb"},{id:"m_talk_05",name:"What's Going On?",url:"https://pub-be53cae7bd99457a8c1f11b4d38f1672.r2.dev/masculine/expression/M_Talking_Variations_005.glb"},{id:"m_talk_06",name:"I have no idea",url:"https://pub-be53cae7bd99457a8c1f11b4d38f1672.r2.dev/masculine/expression/M_Talking_Variations_006.glb"},{id:"m_talk_07",name:"What's going on here?",url:"https://pub-be53cae7bd99457a8c1f11b4d38f1672.r2.dev/masculine/expression/M_Talking_Variations_007.glb"},{id:"m_talk_08",name:"Let's stop",url:"https://pub-be53cae7bd99457a8c1f11b4d38f1672.r2.dev/masculine/expression/M_Talking_Variations_008.glb"},{id:"m_talk_09",name:"Fed Up Moment",url:"https://pub-be53cae7bd99457a8c1f11b4d38f1672.r2.dev/masculine/expression/M_Talking_Variations_009.glb"},{id:"m_talk_10",name:"What's This? Hold On",url:"https://pub-be53cae7bd99457a8c1f11b4d38f1672.r2.dev/masculine/expression/M_Talking_Variations_010.glb"},{id:"f_talk_01",name:"Great Job Clap",url:"https://pub-be53cae7bd99457a8c1f11b4d38f1672.r2.dev/masculine/expression/F_Talking_Variations_001.glb"},{id:"f_talk_02",name:"Chill Stretch",url:"https://pub-be53cae7bd99457a8c1f11b4d38f1672.r2.dev/masculine/expression/F_Talking_Variations_002.glb"},{id:"f_talk_03",name:"This Is Me",url:"https://pub-be53cae7bd99457a8c1f11b4d38f1672.r2.dev/masculine/expression/F_Talking_Variations_003.glb"},{id:"f_talk_04",name:"Empathize",url:"https://pub-be53cae7bd99457a8c1f11b4d38f1672.r2.dev/masculine/expression/F_Talking_Variations_004.glb"},{id:"f_talk_05",name:"Loose Hands Stretch",url:"https://pub-be53cae7bd99457a8c1f11b4d38f1672.r2.dev/masculine/expression/F_Talking_Variations_005.glb"},{id:"f_talk_06",name:"Take It Easy",url:"https://pub-be53cae7bd99457a8c1f11b4d38f1672.r2.dev/masculine/expression/F_Talking_Variations_006.glb"}],IF=["https://pub-be53cae7bd99457a8c1f11b4d38f1672.r2.dev/masculine/expression/M_Talking_Variations_005.glb","https://pub-be53cae7bd99457a8c1f11b4d38f1672.r2.dev/masculine/expression/M_Talking_Variations_007.glb"],FF={zoom:.85,position:[.15,-.8,0],scale:1.5,rotation:[.15,.02,0]},HF=[-.45,1.9,.1],PF={browInnerUp:.2},GS=.18,GF=1,dC="__branding__",m_={neutral:{eyeLookDownLeft:.1,eyeLookDownRight:.1},happy:{mouthSmileLeft:.2,mouthSmileRight:.2,eyeLookDownLeft:.1,eyeLookDownRight:.1},sad:{eyeLookDownLeft:.2,eyeLookDownRight:.2,browDownRight:.1,browInnerUp:.6,browOuterUpRight:.2,eyeSquintLeft:.7,eyeSquintRight:.7,mouthFrownLeft:.8,mouthFrownRight:.8,mouthLeft:.2,mouthPucker:.5,mouthRollLower:.2,mouthRollUpper:.2,mouthShrugLower:.2,mouthShrugUpper:.2,mouthStretchLeft:.4},angry:{eyeLookDownLeft:.1,eyeLookDownRight:.1,browDownLeft:.6,browDownRight:.6,jawForward:.3,mouthFrownLeft:.7,mouthFrownRight:.7,mouthRollLower:.2,mouthShrugLower:.3},fear:{browInnerUp:.7,eyeSquintLeft:.5,eyeSquintRight:.5,eyeWideLeft:.6,eyeWideRight:.6,mouthClose:.1,mouthFunnel:.3,mouthShrugLower:.5,mouthShrugUpper:.5},disgust:{browDownLeft:.7,browDownRight:.1,browInnerUp:.3,eyeSquintLeft:1,eyeSquintRight:1,eyeWideLeft:.5,eyeWideRight:.5,mouthLeft:.4,mouthPressLeft:.3,mouthRollLower:.3,mouthShrugLower:.3,mouthShrugUpper:.8,mouthUpperUpLeft:.3,noseSneerLeft:1,noseSneerRight:.7},love:{browInnerUp:.4,browOuterUpLeft:.2,browOuterUpRight:.2,mouthSmileLeft:.2,mouthSmileRight:.2,eyeBlinkLeft:.6,eyeBlinkRight:.6,eyeWideLeft:.7,eyeWideRight:.7,mouthDimpleLeft:.1,mouthDimpleRight:.1,mouthPressLeft:.2,mouthShrugUpper:.2,mouthUpperUpLeft:.1,mouthUpperUpRight:.1}},zF=[{key:"viseme_aa",mix:{jawOpen:.6}},{key:"viseme_E",mix:{mouthPressLeft:.8,mouthPressRight:.8,mouthDimpleLeft:1,mouthDimpleRight:1,jawOpen:.3}},{key:"viseme_I",mix:{mouthPressLeft:.6,mouthPressRight:.6,mouthDimpleLeft:.6,mouthDimpleRight:.6,jawOpen:.2}},{key:"viseme_O",mix:{mouthPucker:1,jawForward:.6,jawOpen:.2}},{key:"viseme_U",mix:{mouthFunnel:1}},{key:"viseme_PP",mix:{mouthRollLower:.3,mouthRollUpper:.3,mouthUpperUpLeft:.3,mouthUpperUpRight:.3}},{key:"viseme_FF",mix:{mouthPucker:1,mouthShrugUpper:1,mouthLowerDownLeft:.2,mouthLowerDownRight:.2,mouthDimpleLeft:1,mouthDimpleRight:1,mouthRollLower:.3}},{key:"viseme_DD",mix:{mouthPressLeft:.8,mouthPressRight:.8,mouthFunnel:.5,jawOpen:.2}},{key:"viseme_SS",mix:{mouthPressLeft:.8,mouthPressRight:.8,mouthLowerDownLeft:.5,mouthLowerDownRight:.5,jawOpen:.1}},{key:"viseme_TH",mix:{mouthRollUpper:.3,jawOpen:.2,tongueOut:.4}},{key:"viseme_CH",mix:{mouthPucker:.5,jawOpen:.2}},{key:"viseme_RR",mix:{mouthPucker:.5,jawOpen:.2}},{key:"viseme_kk",mix:{mouthLowerDownLeft:.4,mouthLowerDownRight:.4,mouthDimpleLeft:.3,mouthDimpleRight:.3,mouthFunnel:.3,mouthPucker:.3,jawOpen:.15}},{key:"viseme_nn",mix:{mouthLowerDownLeft:.4,mouthLowerDownRight:.4,mouthDimpleLeft:.3,mouthDimpleRight:.3,mouthFunnel:.3,mouthPucker:.3,jawOpen:.15,tongueOut:.2}},{key:"viseme_sil",mix:{}}],VF={aei:[{v:"E",w:.8},{v:"I",w:.2}],ee:[{v:"I",w:1}],oo:[{v:"O",w:1}],u:[{v:"U",w:1}],aa:[{v:"aa",w:1}],ah:[{v:"aa",w:.7},{v:"O",w:.3}],bmp:[{v:"PP",w:1}],fv:[{v:"FF",w:1}],th:[{v:"TH",w:1}],l:[{v:"nn",w:1}],r:[{v:"RR",w:1}],qw:[{v:"U",w:.6},{v:"O",w:.4}],chjsh:[{v:"CH",w:1}],cdgknstxyz:[{v:"DD",w:.6},{v:"SS",w:.4}],sil:[{v:"sil",w:1}]};function kF(s){if(!s)return[{v:"sil",w:1}];const e=s.toLowerCase();return VF[e]??[{v:"sil",w:1}]}function XF({target:s}){const{camera:e}=Ih();return Me.useEffect(()=>{e.lookAt(...s)},[e,s]),null}function Gs(s,e,t){if(!s||!s.morphTargetDictionary)return;const n=s,i=n.morphTargetDictionary,o=n.morphTargetInfluences;if(o)for(const l in i)l.toLowerCase()===e.toLowerCase()&&(o[i[l]]=t)}function pC(s,e=.97){if(!s)return;const t=s;if(t.morphTargetInfluences)for(let n=0;n<t.morphTargetInfluences.length;n++)t.morphTargetInfluences[n]*=e}const YF=Me.memo(({avatarUrl:s,isPlayingRef:e,visemeQueueRef:t,audioContextRef:n,responseAudioStartTimeRef:i,adjustments:o,mood:l,expression:h,agentResponse:d,isSpeaking:p,nextStartTimeRef:_,stopPlayback:v,setIsSpeaking:y,expressionUrl:x,onExpressionFinished:b,isNudgeResponse:R,avatarGender:T})=>{const{scene:M}=zh(s),D=zh(T==="female"?LF:UF),N=Me.useMemo(()=>D.flatMap(X=>X.animations),[D]),H=zh(IF),O=Me.useMemo(()=>H.flatMap(X=>X.animations),[H]),z=Me.useRef(null),V=Me.useRef(null),U=Me.useRef(null),F=Me.useRef([]),[K]=Me.useState(()=>new iE(M)),ne=Me.useRef({}),$=Me.useRef(null),ae=Me.useRef(0),ge=Me.useRef(!1),I=Me.useRef(0),W=Me.useRef(null);Me.useEffect(()=>{if(!(!N||!M)){if(N.forEach((X,te)=>{const le=`idle_${te}`;if(!ne.current[le]){const ve=K.clipAction(X,M);ve.name=le,ve.setLoop(cp,1),ve.clampWhenFinished=!0,ne.current[le]=ve}}),O.forEach((X,te)=>{const le=`talk_${te}`;if(!ne.current[le]){const ve=K.clipAction(X,M);ve.name=le,ve.setLoop(cp,1),ve.clampWhenFinished=!0,ne.current[le]=ve}}),N.length>0){const X=ne.current.idle_0,te=$.current&&K.existingAction($.current.getClip());X&&!te&&(X.reset().fadeIn(.5).play(),$.current=X)}return()=>{K.stopAllAction(),ne.current={},$.current=null}}},[N,O,M,K]);const ee=Me.useRef("");Me.useEffect(()=>{if(!x||!M||x===ee.current)return;ee.current=x,W.current=x,new KI().load(x,te=>{if(te.animations&&te.animations.length>0){const le=te.animations[0],ve=K.clipAction(le,M);if(ve.name=`EXPR_${x}`,ve.setLoop(cp,1),ve.clampWhenFinished=!0,ne.current[`EXPR_${x}`]=ve,p&&W.current===x){const ze=$.current;ve.reset().fadeIn(.3).play(),ze&&ze!==ve&&ze.crossFadeTo(ve,.3,!0),$.current=ve,W.current=null}}},void 0,te=>{console.error(`[ANIMATION] Failed to load ${x}`,te)})},[x,M,K,p]),Me.useEffect(()=>{const X=te=>{const le=te.action,ve=le.name||"";if(ve.startsWith("idle_")){const he=(parseInt(ve.split("_")[1])+1)%N.length,Ee=ne.current[`idle_${he}`];Ee&&(Ee.reset().fadeIn(.5).play(),le.crossFadeTo(Ee,.5,!0),$.current=Ee)}else if(ve.startsWith("EXPR_")){if(p){const ze=ne.current.talk_0;ze&&(ze.reset().fadeIn(.5).play(),le.crossFadeTo(ze,.5,!0),$.current=ze)}else{const ze=ne.current.idle_0;ze&&(ze.reset().fadeIn(.5).play(),le.crossFadeTo(ze,.5,!0),$.current=ze)}b&&b()}else if(ve.startsWith("talk_"))if(p&&!R){const he=(parseInt(ve.split("_")[1])+1)%O.length,Ee=ne.current[`talk_${he}`];Ee&&(Ee.reset().fadeIn(.3).play(),le.crossFadeTo(Ee,.3,!0),$.current=Ee)}else{const ze=ne.current.idle_0;ze&&(ze.reset().fadeIn(.5).play(),le.crossFadeTo(ze,.5,!0),$.current=ze)}};return K.addEventListener("finished",X),()=>K.removeEventListener("finished",X)},[K,N,O,p,R,b]),Me.useEffect(()=>{if(p&&M){const X=$.current,te=X?.name||"";if(te.startsWith("idle_")||te.startsWith("talk_")||te===""){const le=W.current;if(le){const ve=ne.current[`EXPR_${le}`];if(ve){ve.reset().fadeIn(.3).play(),X&&X!==ve&&X.crossFadeTo(ve,.3,!0),$.current=ve,W.current=null;return}}if(te.startsWith("idle_")||te===""){const ve=ne.current.talk_0;ve&&(ve.reset().fadeIn(.5).play(),X&&X.crossFadeTo(ve,.5,!0),$.current=ve)}}}else if(!p&&M){const X=$.current,te=X?.name||"";if(te.startsWith("talk_")||te.startsWith("EXPR_")){const le=ne.current.idle_0;le&&(le.reset().fadeIn(.5).play(),X&&X.crossFadeTo(le,.5,!0),$.current=le)}}},[p,M,x]),Me.useEffect(()=>{if(!M)return;M.traverse(le=>{if(le.isMesh&&le.morphTargetDictionary){const ve=le.name.toLowerCase();(ve.includes("head")||ve.includes("avatar"))&&(V.current=le,ga(`[ANIMATION] Found head mesh: ${le.name}`)),ve.includes("teeth")&&(U.current=le,ga(`[ANIMATION] Found teeth mesh: ${le.name}`))}});const X=V.current?.morphTargetDictionary;X&&Object.keys(X).filter(le=>le.toLowerCase().includes("brow"));const te=[];M.traverse(le=>{if(le.isMesh){const ze=le.morphTargetDictionary;ze&&Object.keys(ze).some(he=>he.toLowerCase().includes("brow"))&&te.push(le)}}),F.current=te,te.length>0&&ga("[ANIMATION] Meshes with brow morphs:",te.length)},[M]);const ye=(X,te=1)=>{const le=`viseme_${X}`.toLowerCase(),ve=zF.find(ze=>ze.key.toLowerCase()===le);if(ve)for(const ze in ve.mix){const he=ve.mix[ze]*te;Gs(V.current,ze,he),Gs(U.current,ze,he)}},_e=X=>{const te=m_[X]??m_.neutral;for(const le in te)Gs(V.current,le,te[le]),Gs(U.current,le,te[le])};return yT((X,te)=>{const le=Math.pow(.88,60*te);pC(V.current,le),pC(U.current,le),_e(l);const ve=X.clock.elapsedTime;let ze=0;if(Math.floor(ve)%5===0&&Math.floor((ve-te)%5)!==0){let Dt=null;M.traverse(Lt=>{Lt.name.toLowerCase().includes("hips")&&(Dt=Lt)});const mt=Dt?`Hips Y: ${Dt.position.y.toFixed(4)}`:"Hips not found";ga(`[ANIMATION] Mixer Time: ${K.time.toFixed(2)}, ${mt}`)}if(K.update(te),ve>ae.current&&!ge.current&&(ge.current=!0,I.current=ve),ge.current){const Dt=p?.2:.3,mt=(ve-I.current)/Dt;if(mt>=1){ge.current=!1;const Lt=p?1:2.5;ae.current=ve+Lt}else{const Lt=mt<.5?mt*2:(1-mt)*2;Gs(V.current,"eyeBlinkLeft",Lt),Gs(V.current,"eyeBlinkRight",Lt),Gs(U.current,"eyeBlinkLeft",Lt),Gs(U.current,"eyeBlinkRight",Lt),ze=Lt*PF.browInnerUp}}const he=m_[l]??m_.neutral,Ee=he.browInnerUp??0,lt=he.browOuterUpLeft??0,Rt=he.browOuterUpRight??0,Bt=ve*GF,tn=GS*Math.sin(Bt),on=GS*.7*Math.sin(Bt+.7),Wt=GS*.7*Math.sin(Bt+1.3),Ge=Dt=>Math.max(0,Math.min(1,Dt)),et=Ge(Ee+tn),Je=Ge(lt+on),xt=Ge(Rt+Wt),Q=Ge(et+ze);if(Gs(V.current,"browInnerUp",Q),Gs(U.current,"browInnerUp",Q),Gs(V.current,"browOuterUpLeft",Je),Gs(U.current,"browOuterUpLeft",Je),Gs(V.current,"browOuterUpRight",xt),Gs(U.current,"browOuterUpRight",xt),z.current){const Dt=e.current?0:o.rotation[1];z.current.rotation.y=E0.lerp(z.current.rotation.y,Dt,.1),z.current.position.set(...o.position),z.current.scale.setScalar(o.scale),z.current.rotation.x=o.rotation[0],z.current.rotation.z=o.rotation[2]}if(e.current&&n.current){const Dt=n.current.currentTime,gt=(Dt-i.current)*1e3- -150;for(let j=0;j<t.current.length;j++){const P=t.current[j];gt>=P.vtime&><P.vtime+P.vduration&&ye(P.viseme,P.weight??1)}Dt>_.current+.5&&(v(),y(!1))}}),Gt.jsx("group",{ref:z,children:Gt.jsx("primitive",{object:M})})});function JF(s){return s?s.charAt(0).toUpperCase()+s.slice(1).toLowerCase():""}const qF=({token:s,agentToken:e,onNavigationRequested:t,avatarGender:n}={})=>{const i=s??e??"",o=NF(i||void 0),[l,h]=Me.useState(""),[d,p]=Me.useState(""),[_,v]=Me.useState("Ready"),[y,x]=Me.useState(!1),[b,R]=Me.useState(!1),[T,M]=Me.useState([]),[w,D]=Me.useState(""),N=Me.useRef(null),[H,O]=Me.useState(()=>typeof window<"u"?window.matchMedia("(max-width: 480px)").matches:!1);Me.useEffect(()=>{const xe=window.matchMedia("(max-width: 480px)"),we=()=>O(xe.matches);return xe.addEventListener("change",we),()=>xe.removeEventListener("change",we)},[]);const z=H?80:600,V=Me.useRef(!1),U=Me.useRef([]),F=Me.useRef(0),K=Me.useRef(!1),ne=Me.useRef([]),$=Me.useRef(null),ae=Me.useRef([]);Me.useRef([]);const ge=Me.useRef([]),I=Me.useRef(0),W=Me.useRef(0),ee=Me.useRef(0),ye=Me.useRef(0),_e=Me.useRef(!1),[X,te]=Me.useState(null),le=Me.useRef(null),[ve,ze]=Me.useState("neutral"),[he,Ee]=Me.useState(""),[lt,Rt]=Me.useState(""),[Bt,tn]=Me.useState("Chat with us"),[on,Wt]=Me.useState(null),[Ge,et]=Me.useState("hidden"),[Je,xt]=Me.useState(""),Q=Me.useRef(null),Dt=Me.useRef(Ge);Dt.current=Ge;const[mt,Lt]=Me.useState(null),gt=Me.useRef(null),j=Me.useRef(null),[P,de]=Me.useState(!1),Fe=Me.useRef(null),[ke,Ie]=Me.useState("hidden"),[Ft,Mt]=Me.useState(""),Ht=Me.useRef(ke);Ht.current=ke;const zt=Me.useRef(""),Ye=Me.useRef(!1),qe=Me.useRef(""),wt=Me.useRef(Date.now()),bt=Me.useRef([]),rt=Me.useRef(!1),[Vt,fe]=Me.useState(!1),[Ne,ot]=Me.useState(!1),Et=Me.useRef(null),Qe=Me.useMemo(()=>P?"Try again":_==="Busy"?"Busy":_==="Thinking..."||_==="Processing Voice..."?_:on!=null&&on!==""&&on!=="none"&&on!=="<none>"?`Enter ${JF(on)}`:ke!=="hidden"||!Ne?null:dC,[_,on,P,ke,Ne]),We=!P&&_!=="Busy"&&_!=="Thinking..."&&_!=="Processing Voice..."&&(on==null||on===""||on==="none"||on==="<none>");Me.useEffect(()=>{if(ke!=="hidden"||!We){ot(!1),Et.current!=null&&(clearTimeout(Et.current),Et.current=null);return}return Et.current=setTimeout(()=>{Et.current=null,ot(!0)},400),()=>{Et.current!=null&&(clearTimeout(Et.current),Et.current=null)}},[ke,We]);const _t=Qe!=null&&Qe!=="";Me.useEffect(()=>{const xe=Dt.current;if(!(xe==="exiting"||xe==="entering")){if(xe==="hidden"){_t&&(xt(Qe??""),et("entering"));return}xe==="visible"&&(!_t||Qe!==Je)&&(Q.current=_t?Qe:null,et("exiting"))}},[_t,Qe,Ge,Je]),Me.useEffect(()=>{if(_!=="Busy"){j.current!=null&&(clearTimeout(j.current),j.current=null);return}return j.current=setTimeout(()=>{j.current=null,v("Ready"),de(!0)},12e3),()=>{j.current!=null&&(clearTimeout(j.current),j.current=null)}},[_]),Me.useEffect(()=>{if(!P)return;const xe=setTimeout(()=>de(!1),2500);return()=>clearTimeout(xe)},[P]);const nn=Me.useCallback(()=>{const xe=Dt.current;if(xe==="exiting"){et("hidden");const we=Q.current;Q.current=null,we!=null&&we!==""&&(xt(we),et("entering"))}else xe==="entering"&&et("visible")},[]),wn=xe=>{if(!xe)return;if(xe.mood!=null){const Ve=String(xe.mood).toLowerCase();ze(Ve)}if(xe.expression!=null){const Ve=String(xe.expression).trim();Ee(Ve);const At=OF.find(Yt=>Yt.name.toLowerCase()===Ve.toLowerCase());ga(`[STREAM] Animation match for "${Ve}": ${At?At.name:"NONE"}`),Rt(At?.url??"")}if(xe.navigation!=null){const Ve=String(xe.navigation).trim();Ve!==""&&(t?t(Ve):window.open(Ve,"_blank"))}const we=xe.ask_for||xe.lead_capture?.ask_for,je=we?String(we).trim().toLowerCase():"",He=je==="none"||je==="<none>";if(we&&!He){const Ve=je;Wt(Ve||null),tn(Ve==="email"?"Enter your email":Ve==="name"?"Enter your name":Ve==="phone"?"Enter your phone number":"Chat with us")}else(He||xe.ask_for===null||xe.lead_capture&&xe.lead_capture.ask_for===null||xe.ask_for==="none")&&(Wt(null),Bt!=="Chat with us"&&tn("Chat with us"));xe.collected,xe.valid},Mn=xe=>{const we=xe.trim();if(!we)return null;if(we.startsWith("{"))try{return JSON.parse(we)}catch{return null}if(we.includes(":")){const je=we.split(":"),He=je[0].trim().toLowerCase(),Ve=je.slice(1).join(":").trim();return{[He]:Ve}}return null},Fi=Me.useCallback(()=>{},[]),va=xe=>{if(Ye.current)xe==="§"?Ye.current=!1:(qe.current+=xe,p(we=>we+xe));else if(xe==="§"){Ye.current=!0;return}else for(zt.current+=xe;zt.current.includes(`
|
|
4150
4150
|
`);){const we=zt.current.indexOf(`
|
|
4151
|
-
`),je=zt.current.slice(0,we).trim();zt.current=zt.current.slice(we+1);const He=Mn(je);He&&wn(He)}};Me.useEffect(()=>{(async()=>{if(!sessionStorage.getItem("STREAMOJI_LEADS_SESSION_LEAD_ID")){const je="secret",He=Math.floor(Date.now()/1e3).toString();try{const Ve=new TextEncoder,At=await crypto.subtle.importKey("raw",Ve.encode(je),{name:"HMAC",hash:"SHA-256"},!1,["sign"]),Yt=await crypto.subtle.sign("HMAC",At,Ve.encode(He)),Tt=Array.from(new Uint8Array(Yt)).map(ft=>ft.toString(16).padStart(2,"0")).join("");sessionStorage.setItem("STREAMOJI_LEADS_SESSION_LEAD_ID",Tt),ga("[SESSION] New HMAC UID generated and saved:",Tt)}catch(Ve){console.error("[SESSION] HMAC generation failed:",Ve);const At=Math.random().toString(36)+Date.now().toString();sessionStorage.setItem("STREAMOJI_LEADS_SESSION_LEAD_ID",At)}}sessionStorage.getItem("STREAMOJI_LEADS_SESSION_MESSAGES")||sessionStorage.setItem("STREAMOJI_LEADS_SESSION_MESSAGES",JSON.stringify([]))})()},[]),Me.useEffect(()=>{const xe=()=>{wt.current=Date.now(),rt.current&&(rt.current=!1,fe(!1),M([]),D(""),p(""),R(!1))};window.addEventListener("mousemove",xe),window.addEventListener("keydown",xe),window.addEventListener("mousedown",xe),window.addEventListener("touchstart",xe);const we=setInterval(async()=>{if(Date.now()-wt.current>=3e4&&!b&&!y&&_==="Ready"&&!rt.current)if(rt.current=!0,bt.current.length>0)fe(!0),M(bt.current);else try{const Ve=`${PS}/nudgeUser`,At={navigationUrl:window.location.href,token:i},Yt=await fetch(Ve,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(At)});if(Yt.ok){const Tt=(await Yt.json()).nudge_questions;Tt&&Tt.length>0&&(ga("[NUDGE] Received nudge questions from API:",Tt),bt.current=Tt,fe(!0),M(Tt))}}catch(Ve){console.error("[NUDGE] Error calling /nudgeUser:",Ve),rt.current=!1}},1e3);return()=>{window.removeEventListener("mousemove",xe),window.removeEventListener("keydown",xe),window.removeEventListener("mousedown",xe),window.removeEventListener("touchstart",xe),clearInterval(we)}},[i,b,y,_]),Me.useEffect(()=>{if(T.length===0)return;let xe=0,we=0,je=!1,He=100;const Ve=()=>{const At=T[xe];if(je){const Yt=At.substring(0,we-1);D(Yt),we--,He=50}else{const Yt=At.substring(0,we+1);D(Yt),we++,He=100}!je&&we===At.length?(je=!0,He=3e3):je&&we===0&&(je=!1,xe=(xe+1)%T.length,He=500),N.current=setTimeout(Ve,He)};return Ve(),()=>{N.current&&clearTimeout(N.current)}},[T]);const br=()=>{try{return JSON.parse(sessionStorage.getItem("STREAMOJI_LEADS_SESSION_MESSAGES")||"[]")}catch{return[]}},ir=xe=>{sessionStorage.setItem("STREAMOJI_LEADS_SESSION_MESSAGES",JSON.stringify(xe))},[_a,sa]=Me.useState(!1),[Da,wi]=Me.useState(0),kt=Me.useRef(null),Ai=Me.useRef([]),mn=Me.useRef(0),[G,q]=Me.useState(null),[oe,Te]=Me.useState(null),Le=Me.useRef(null),Ue=Me.useRef(null),ct=Me.useCallback((xe=!1)=>{xe&&(_e.current=!0,x(!1),v("Ready")),ne.current=[],U.current=[],K.current=!1,R(!1),I.current=0,W.current=0,ee.current=0,ae.current.forEach(we=>{try{we.stop()}catch{}}),gt.current&&(clearTimeout(gt.current),gt.current=null),
|
|
4151
|
+
`),je=zt.current.slice(0,we).trim();zt.current=zt.current.slice(we+1);const He=Mn(je);He&&wn(He)}};Me.useEffect(()=>{(async()=>{if(!sessionStorage.getItem("STREAMOJI_LEADS_SESSION_LEAD_ID")){const je="secret",He=Math.floor(Date.now()/1e3).toString();try{const Ve=new TextEncoder,At=await crypto.subtle.importKey("raw",Ve.encode(je),{name:"HMAC",hash:"SHA-256"},!1,["sign"]),Yt=await crypto.subtle.sign("HMAC",At,Ve.encode(He)),Tt=Array.from(new Uint8Array(Yt)).map(ft=>ft.toString(16).padStart(2,"0")).join("");sessionStorage.setItem("STREAMOJI_LEADS_SESSION_LEAD_ID",Tt),ga("[SESSION] New HMAC UID generated and saved:",Tt)}catch(Ve){console.error("[SESSION] HMAC generation failed:",Ve);const At=Math.random().toString(36)+Date.now().toString();sessionStorage.setItem("STREAMOJI_LEADS_SESSION_LEAD_ID",At)}}sessionStorage.getItem("STREAMOJI_LEADS_SESSION_MESSAGES")||sessionStorage.setItem("STREAMOJI_LEADS_SESSION_MESSAGES",JSON.stringify([]))})()},[]),Me.useEffect(()=>{const xe=()=>{wt.current=Date.now(),rt.current&&(rt.current=!1,fe(!1),M([]),D(""),p(""),R(!1))};window.addEventListener("mousemove",xe),window.addEventListener("keydown",xe),window.addEventListener("mousedown",xe),window.addEventListener("touchstart",xe);const we=setInterval(async()=>{if(Date.now()-wt.current>=3e4&&!b&&!y&&_==="Ready"&&!rt.current)if(rt.current=!0,bt.current.length>0)fe(!0),M(bt.current);else try{const Ve=`${PS}/nudgeUser`,At={navigationUrl:window.location.href,token:i},Yt=await fetch(Ve,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(At)});if(Yt.ok){const Tt=(await Yt.json()).nudge_questions;Tt&&Tt.length>0&&(ga("[NUDGE] Received nudge questions from API:",Tt),bt.current=Tt,fe(!0),M(Tt))}}catch(Ve){console.error("[NUDGE] Error calling /nudgeUser:",Ve),rt.current=!1}},1e3);return()=>{window.removeEventListener("mousemove",xe),window.removeEventListener("keydown",xe),window.removeEventListener("mousedown",xe),window.removeEventListener("touchstart",xe),clearInterval(we)}},[i,b,y,_]),Me.useEffect(()=>{if(T.length===0)return;let xe=0,we=0,je=!1,He=100;const Ve=()=>{const At=T[xe];if(je){const Yt=At.substring(0,we-1);D(Yt),we--,He=50}else{const Yt=At.substring(0,we+1);D(Yt),we++,He=100}!je&&we===At.length?(je=!0,He=3e3):je&&we===0&&(je=!1,xe=(xe+1)%T.length,He=500),N.current=setTimeout(Ve,He)};return Ve(),()=>{N.current&&clearTimeout(N.current)}},[T]);const br=()=>{try{return JSON.parse(sessionStorage.getItem("STREAMOJI_LEADS_SESSION_MESSAGES")||"[]")}catch{return[]}},ir=xe=>{sessionStorage.setItem("STREAMOJI_LEADS_SESSION_MESSAGES",JSON.stringify(xe))},[_a,sa]=Me.useState(!1),[Da,wi]=Me.useState(0),kt=Me.useRef(null),Ai=Me.useRef([]),mn=Me.useRef(0),[G,q]=Me.useState(null),[oe,Te]=Me.useState(null),Le=Me.useRef(null),Ue=Me.useRef(null),ct=Me.useCallback((xe=!1)=>{xe&&(_e.current=!0,x(!1),v("Ready")),ne.current=[],U.current=[],K.current=!1,R(!1),I.current=0,W.current=0,ee.current=0,ae.current.forEach(we=>{try{we.stop()}catch{}}),gt.current&&(clearTimeout(gt.current),gt.current=null),Lt(null),Rt(""),ae.current=[]},[]),at=async()=>{try{const xe=await navigator.mediaDevices.getUserMedia({audio:!0}),we=window.AudioContext||window.webkitAudioContext,je=new we,He=je.createMediaStreamSource(xe),Ve=je.createAnalyser();Ve.fftSize=64,He.connect(Ve),Le.current=je,Ue.current=He,Te(Ve);const At=new MediaRecorder(xe);kt.current=At,Ai.current=[],At.ondataavailable=Yt=>{Yt.data.size>0&&Ai.current.push(Yt.data)},At.onstop=async()=>{const Yt=Date.now()-mn.current;if(Te(null),Ue.current&&(Ue.current.disconnect(),Ue.current=null),Le.current&&Le.current.state!=="closed"&&(Le.current.close(),Le.current=null),Yt<1e3){v("Recording too short. Hold or click longer."),x(!1);return}const Jt=new Blob(Ai.current,{type:"audio/wav"});await k(Jt)},mn.current=Date.now(),At.start(100),sa(!0),v("Listening...")}catch(xe){console.error("Error accessing microphone:",xe),v("Mic Access Error")}},st=()=>{kt.current&&kt.current.state!=="inactive"&&(kt.current.stop(),kt.current.stream.getTracks().forEach(xe=>xe.stop()),sa(!1))},tt=()=>{kt.current&&kt.current.state!=="inactive"&&(kt.current.onstop=null,kt.current.stop(),kt.current.stream.getTracks().forEach(xe=>xe.stop()),Te(null),Ue.current&&(Ue.current.disconnect(),Ue.current=null),Le.current&&Le.current.state!=="closed"&&(Le.current.close(),Le.current=null),sa(!1),Ai.current=[],v("Ready"))};Me.useEffect(()=>{if(!b)return;const xe=()=>{const we=ee.current;if(we<=0)return;const je=$.current,He=I.current;if(!je)return;const Ve=je.currentTime-He,At=Math.min(Math.max(0,Ve),we),Yt=d.trim().length;if(Yt<=0)return;const Jt=Math.min(Math.round(At/we*Yt),Yt);te(Jt)};return clearInterval(le.current??void 0),le.current=setInterval(xe,90),()=>clearInterval(le.current??void 0)},[b,d,ee.current]),Me.useEffect(()=>{let xe;return _a?(wi(0),xe=window.setInterval(()=>{wi(we=>we+1)},1e3)):wi(0),()=>clearInterval(xe)},[_a]);const yt=xe=>{const we=xe.numberOfChannels,je=xe.length*we*2+44,He=new ArrayBuffer(je),Ve=new DataView(He);let At=0;const Yt=Nt=>{Ve.setUint16(At,Nt,!0),At+=2},Jt=Nt=>{Ve.setUint32(At,Nt,!0),At+=4};Jt(1179011410),Jt(je-8),Jt(1163280727),Jt(544501094),Jt(16),Yt(1),Yt(we),Jt(xe.sampleRate),Jt(xe.sampleRate*2*we),Yt(we*2),Yt(16),Jt(1635017060),Jt(je-At-4);const Tt=[];for(let Nt=0;Nt<we;Nt++)Tt.push(xe.getChannelData(Nt));let ft=0;for(;At<je;){for(let Nt=0;Nt<we;Nt++){let vt=Math.max(-1,Math.min(1,Tt[Nt][ft]));vt=vt<0?vt*32768:vt*32767,Ve.setInt16(At,vt,!0),At+=2}ft++}return new Blob([He],{type:"audio/wav"})},dt=async(xe,we,je=!1)=>{if(!_e.current){if(V.current){U.current.push({audio:xe,visemes:we,isNewSegment:je});return}V.current=!0;try{const He=window.AudioContext||window.webkitAudioContext,Ve=$.current??new He;Ve.state==="suspended"&&await Ve.resume(),$.current=Ve;const At=window.atob(xe),Yt=new Uint8Array(At.length);for(let an=0;an<At.length;an++)Yt[an]=At.charCodeAt(an);const Jt=await Ve.decodeAudioData(Yt.buffer.slice(0));ee.current+=Jt.duration;const Tt=Ve.currentTime;let ft=W.current;const Nt=!K.current;ft<Tt&&(ft=Tt+.1),W.current=ft+Jt.duration;const vt=Ve.createBufferSource();vt.buffer=Jt;let un=G;if((!un||un.context!==Ve)&&(un=Ve.createAnalyser(),un.fftSize=64,un.connect(Ve.destination),q(un)),vt.connect(un),ae.current.push(vt),_e.current){ae.current=ae.current.filter(an=>an!==vt);return}if(Nt){K.current=!0,R(!0),ga(`[AUDIO] setIsSpeaking(true) - First chunk starting at ${ft.toFixed(3)}`),I.current=ft;const an=(ft-Tt)*1e3;F.current=performance.now()+an,ga(`[AUDIO] Response started. Initial startTime: ${ft.toFixed(3)}, CT: ${Tt.toFixed(3)}`)}vt.start(ft);const Wn=(ft-I.current)*1e3;je&&(ye.current=Wn,ga(`[AUDIO] New segment detected at +${Wn.toFixed(0)}ms. Resetting segment offset.`)),we.forEach((an,Xn)=>{const rn=an.symbol??"";if(rn){const Pn=kF(rn),jn=Math.round(an.start*1e3),ri=Math.round((an.duration??0)*1e3),Si=ye.current+jn;Xn<3&&ga(`[AUDIO] Viseme "${rn}": segment_relative=${jn}ms, segment_offset=${ye.current.toFixed(0)}ms => vtime=${Si}ms`),Pn.forEach(Er=>{ne.current.push({viseme:Er.v,weight:Er.w,vtime:Si,vduration:ri})})}}),v("Speaking...")}finally{if(V.current=!1,U.current.length>0){const He=U.current.shift();He&&dt(He.audio,He.visemes,He.isNewSegment)}}}},k=async xe=>{try{x(!0),fe(!1),qe.current="",p(""),v("Processing Voice...");const we=await xe.arrayBuffer(),He=await new(window.AudioContext||window.webkitAudioContext)().decodeAudioData(we),Ve=yt(He),At=new FileReader;At.readAsDataURL(Ve),At.onloadend=async()=>{const Yt=At.result.split(",")[1];ct(),h(""),zt.current="",Ye.current=!1;const Jt=`${PS}/stt?token=${encodeURIComponent(i)}`,Tt=await fetch(Jt,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({audio_base64:Yt,audio_format:"wav"})});if(Tt.status===429){try{const Xn=await Tt.text(),rn=JSON.parse(Xn);ga("[STT] 429 agent at capacity:",rn?.detail)}catch{}h(""),v("Busy"),x(!1);return}if(!Tt.ok){const Xn=await Tt.text();let rn="STT Failed";try{rn=JSON.parse(Xn).error||rn}catch{Xn&&(rn=Xn.slice(0,200))}throw new Error(rn)}const ft=Tt.body;if(ga("this is body"+ft),!ft){v("STT Failed"),x(!1);return}const Nt=ft.getReader();_e.current=!1;const vt=new TextDecoder;let un="",Wn=!1;const an=async(Xn,rn)=>{switch(Xn){case"transcript":rn.transcript!=null&&h(String(rn.transcript));break;case"text":{const Pn=rn.delta??rn.text??"";Pn&&va(Pn);break}case"audio":{const Pn=rn.chunk,jn=rn.visemes??[],ri=!!rn.is_new_segment;Pn&&await dt(Pn,jn,ri);break}case"done":{Wn=!0,v("Ready"),x(!1);break}case"error":{Wn=!0,v("STT Failed"),x(!1);break}default:break}};for(;;){const{done:Xn,value:rn}=await Nt.read();rn&&(un+=vt.decode(rn,{stream:!0}));const Pn=un.split(`
|
|
4152
4152
|
|
|
4153
4153
|
`);un=Pn.pop()??"";for(const jn of Pn){const ri=ue(jn);ri&&await an(ri.event,ri.data)}if(Xn){if(un.trim()){const jn=ue(un.trim());jn&&await an(jn.event,jn.data)}Wn||(v("Ready"),x(!1));break}}}}catch(we){console.error("Audio Submission Error:",we),v("STT Failed"),x(!1)}},ie=async xe=>{xe&&xe.preventDefault(),fe(!1),qe.current="",p(""),!(!l||y)&&await ce(l)},ue=xe=>{const we=xe.split(/\r?\n/);let je="",He="";for(const At of we)At.startsWith("event:")?je=At.slice(6).trim():At.startsWith("data:")&&(He=At.slice(5).trim());if(!je)return null;let Ve={};if(He)try{Ve=JSON.parse(He)}catch{Ve={raw:He}}return{event:je,data:Ve}},pe=(xe,we)=>{switch(xe){case"connected":zt.current="",Ye.current=!1;break;case"text":{const je=we.delta??"";je&&va(je);break}case"audio":{const je=we.chunk,He=we.visemes??[];je&&dt(je,He);break}case"done":{const je=br(),He=qe.current.trim(),Ve=[...je,{role:"user",content:l||"..."},{role:"assistant",content:He}];ir(Ve),ge.current=[...ne.current],v("Ready"),x(!1),h("");break}case"error":{const je=we.message??"Unknown error";qe.current=je,p(je),v("Agent Failed"),x(!1);break}}},ce=async xe=>{x(!0),v("Thinking..."),qe.current="",zt.current="",Ye.current=!1,ct(),ee.current=0,te(0);const we=`${PS}/agent/chat?token=${encodeURIComponent(i)}`;try{const je=br();let He=sessionStorage.getItem("STREAMOJI_LEADS_SESSION_LEAD_ID");He||(wF("[CHAT] Session UID missing at send time! Generating emergency backup."),He="emergency-"+Math.random().toString(36).substring(7),sessionStorage.setItem("STREAMOJI_LEADS_SESSION_LEAD_ID",He));const Ve={history:je,question:xe,lead_id:He};ga("[CHAT] Sending payload:",Ve);const At=await fetch(we,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(Ve),cache:"default"});if(At.status===429){try{const Nt=await At.json();ga("[CHAT] 429 agent at capacity:",Nt?.detail)}catch{}h(""),v("Busy"),x(!1);return}if(!At.ok)throw new Error("Agent request failed");const Yt=At.body;if(!Yt){v("Agent Failed"),x(!1);return}const Jt=Yt.getReader();_e.current=!1;const Tt=new TextDecoder;let ft="";for(;;){const{done:Nt,value:vt}=await Jt.read();ga(`[SSE] Chunk received. done=${Nt}, length=${vt?.length||0}`),vt&&(ft+=Tt.decode(vt,{stream:!0}));const un=ft.split(`
|
|
4154
4154
|
|