diff --git a/assets/index-7e7d53ee.js b/assets/index-7e7d53ee.js deleted file mode 100644 index 796ed5d..0000000 --- a/assets/index-7e7d53ee.js +++ /dev/null @@ -1,4249 +0,0 @@ -(function(){const e=document.createElement("link").relList;if(e&&e.supports&&e.supports("modulepreload"))return;for(const i of document.querySelectorAll('link[rel="modulepreload"]'))r(i);new MutationObserver(i=>{for(const s of i)if(s.type==="childList")for(const o of s.addedNodes)o.tagName==="LINK"&&o.rel==="modulepreload"&&r(o)}).observe(document,{childList:!0,subtree:!0});function t(i){const s={};return i.integrity&&(s.integrity=i.integrity),i.referrerPolicy&&(s.referrerPolicy=i.referrerPolicy),i.crossOrigin==="use-credentials"?s.credentials="include":i.crossOrigin==="anonymous"?s.credentials="omit":s.credentials="same-origin",s}function r(i){if(i.ep)return;i.ep=!0;const s=t(i);fetch(i.href,s)}})();function gR(n){return n&&n.__esModule&&Object.prototype.hasOwnProperty.call(n,"default")?n.default:n}var R0={},wF={get exports(){return R0},set exports(n){R0=n}},Dv={},ee={},SF={get exports(){return ee},set exports(n){ee=n}},qt={};/** - * @license React - * react.production.min.js - * - * Copyright (c) Facebook, Inc. and its affiliates. - * - * This source code is licensed under the MIT license found in the - * LICENSE file in the root directory of this source tree. - */var lp=Symbol.for("react.element"),AF=Symbol.for("react.portal"),MF=Symbol.for("react.fragment"),EF=Symbol.for("react.strict_mode"),CF=Symbol.for("react.profiler"),bF=Symbol.for("react.provider"),TF=Symbol.for("react.context"),RF=Symbol.for("react.forward_ref"),BF=Symbol.for("react.suspense"),PF=Symbol.for("react.memo"),IF=Symbol.for("react.lazy"),JE=Symbol.iterator;function LF(n){return n===null||typeof n!="object"?null:(n=JE&&n[JE]||n["@@iterator"],typeof n=="function"?n:null)}var vR={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},yR=Object.assign,xR={};function Cf(n,e,t){this.props=n,this.context=e,this.refs=xR,this.updater=t||vR}Cf.prototype.isReactComponent={};Cf.prototype.setState=function(n,e){if(typeof n!="object"&&typeof n!="function"&&n!=null)throw Error("setState(...): takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,n,e,"setState")};Cf.prototype.forceUpdate=function(n){this.updater.enqueueForceUpdate(this,n,"forceUpdate")};function _R(){}_R.prototype=Cf.prototype;function FS(n,e,t){this.props=n,this.context=e,this.refs=xR,this.updater=t||vR}var NS=FS.prototype=new _R;NS.constructor=FS;yR(NS,Cf.prototype);NS.isPureReactComponent=!0;var jE=Array.isArray,wR=Object.prototype.hasOwnProperty,OS={current:null},SR={key:!0,ref:!0,__self:!0,__source:!0};function AR(n,e,t){var r,i={},s=null,o=null;if(e!=null)for(r in e.ref!==void 0&&(o=e.ref),e.key!==void 0&&(s=""+e.key),e)wR.call(e,r)&&!SR.hasOwnProperty(r)&&(i[r]=e[r]);var a=arguments.length-2;if(a===1)i.children=t;else if(1>>1,k=N[W];if(0>>1;Wi(X,j))Ji(ae,X)?(N[W]=ae,N[J]=j,W=J):(N[W]=X,N[q]=j,W=q);else if(Ji(ae,j))N[W]=ae,N[J]=j,W=J;else break e}}return V}function i(N,V){var j=N.sortIndex-V.sortIndex;return j!==0?j:N.id-V.id}if(typeof performance=="object"&&typeof performance.now=="function"){var s=performance;n.unstable_now=function(){return s.now()}}else{var o=Date,a=o.now();n.unstable_now=function(){return o.now()-a}}var l=[],u=[],c=1,f=null,p=3,m=!1,g=!1,v=!1,y=typeof setTimeout=="function"?setTimeout:null,w=typeof clearTimeout=="function"?clearTimeout:null,_=typeof setImmediate<"u"?setImmediate:null;typeof navigator<"u"&&navigator.scheduling!==void 0&&navigator.scheduling.isInputPending!==void 0&&navigator.scheduling.isInputPending.bind(navigator.scheduling);function x(N){for(var V=t(u);V!==null;){if(V.callback===null)r(u);else if(V.startTime<=N)r(u),V.sortIndex=V.expirationTime,e(l,V);else break;V=t(u)}}function A(N){if(v=!1,x(N),!g)if(t(l)!==null)g=!0,G(C);else{var V=t(u);V!==null&&ie(A,V.startTime-N)}}function C(N,V){g=!1,v&&(v=!1,w(E),E=-1),m=!0;var j=p;try{for(x(V),f=t(l);f!==null&&(!(f.expirationTime>V)||N&&!U());){var W=f.callback;if(typeof W=="function"){f.callback=null,p=f.priorityLevel;var k=W(f.expirationTime<=V);V=n.unstable_now(),typeof k=="function"?f.callback=k:f===t(l)&&r(l),x(V)}else r(l);f=t(l)}if(f!==null)var Q=!0;else{var q=t(u);q!==null&&ie(A,q.startTime-V),Q=!1}return Q}finally{f=null,p=j,m=!1}}var b=!1,R=null,E=-1,B=5,D=-1;function U(){return!(n.unstable_now()-DN||125W?(N.sortIndex=j,e(u,N),t(l)===null&&N===t(u)&&(v?(w(E),E=-1):v=!0,ie(A,j-W))):(N.sortIndex=k,e(l,N),g||m||(g=!0,G(C))),N},n.unstable_shouldYield=U,n.unstable_wrapCallback=function(N){var V=p;return function(){var j=p;p=V;try{return N.apply(this,arguments)}finally{p=j}}}})(ER);(function(n){n.exports=ER})(JF);/** - * @license React - * react-dom.production.min.js - * - * Copyright (c) Facebook, Inc. and its affiliates. - * - * This source code is licensed under the MIT license found in the - * LICENSE file in the root directory of this source tree. - */var CR=ee,ns=l_;function et(n){for(var e="https://reactjs.org/docs/error-decoder.html?invariant="+n,t=1;t"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),u_=Object.prototype.hasOwnProperty,jF=/^[: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]*$/,YE={},KE={};function XF(n){return u_.call(KE,n)?!0:u_.call(YE,n)?!1:jF.test(n)?KE[n]=!0:(YE[n]=!0,!1)}function YF(n,e,t,r){if(t!==null&&t.type===0)return!1;switch(typeof e){case"function":case"symbol":return!0;case"boolean":return r?!1:t!==null?!t.acceptsBooleans:(n=n.toLowerCase().slice(0,5),n!=="data-"&&n!=="aria-");default:return!1}}function KF(n,e,t,r){if(e===null||typeof e>"u"||YF(n,e,t,r))return!0;if(r)return!1;if(t!==null)switch(t.type){case 3:return!e;case 4:return e===!1;case 5:return isNaN(e);case 6:return isNaN(e)||1>e}return!1}function Si(n,e,t,r,i,s,o){this.acceptsBooleans=e===2||e===3||e===4,this.attributeName=r,this.attributeNamespace=i,this.mustUseProperty=t,this.propertyName=n,this.type=e,this.sanitizeURL=s,this.removeEmptyString=o}var Vr={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(n){Vr[n]=new Si(n,0,!1,n,null,!1,!1)});[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(function(n){var e=n[0];Vr[e]=new Si(e,1,!1,n[1],null,!1,!1)});["contentEditable","draggable","spellCheck","value"].forEach(function(n){Vr[n]=new Si(n,2,!1,n.toLowerCase(),null,!1,!1)});["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(n){Vr[n]=new Si(n,2,!1,n,null,!1,!1)});"allowFullScreen async autoFocus autoPlay controls default defer disabled disablePictureInPicture disableRemotePlayback formNoValidate hidden loop noModule noValidate open playsInline readOnly required reversed scoped seamless itemScope".split(" ").forEach(function(n){Vr[n]=new Si(n,3,!1,n.toLowerCase(),null,!1,!1)});["checked","multiple","muted","selected"].forEach(function(n){Vr[n]=new Si(n,3,!0,n,null,!1,!1)});["capture","download"].forEach(function(n){Vr[n]=new Si(n,4,!1,n,null,!1,!1)});["cols","rows","size","span"].forEach(function(n){Vr[n]=new Si(n,6,!1,n,null,!1,!1)});["rowSpan","start"].forEach(function(n){Vr[n]=new Si(n,5,!1,n.toLowerCase(),null,!1,!1)});var zS=/[\-:]([a-z])/g;function GS(n){return n[1].toUpperCase()}"accent-height alignment-baseline arabic-form baseline-shift cap-height clip-path clip-rule color-interpolation color-interpolation-filters color-profile color-rendering dominant-baseline enable-background fill-opacity fill-rule flood-color flood-opacity font-family font-size font-size-adjust font-stretch font-style font-variant font-weight glyph-name glyph-orientation-horizontal glyph-orientation-vertical horiz-adv-x horiz-origin-x image-rendering letter-spacing lighting-color marker-end marker-mid marker-start overline-position overline-thickness paint-order panose-1 pointer-events rendering-intent shape-rendering stop-color stop-opacity strikethrough-position strikethrough-thickness stroke-dasharray stroke-dashoffset stroke-linecap stroke-linejoin stroke-miterlimit stroke-opacity stroke-width text-anchor text-decoration text-rendering underline-position underline-thickness unicode-bidi unicode-range units-per-em v-alphabetic v-hanging v-ideographic v-mathematical vector-effect vert-adv-y vert-origin-x vert-origin-y word-spacing writing-mode xmlns:xlink x-height".split(" ").forEach(function(n){var e=n.replace(zS,GS);Vr[e]=new Si(e,1,!1,n,null,!1,!1)});"xlink:actuate xlink:arcrole xlink:role xlink:show xlink:title xlink:type".split(" ").forEach(function(n){var e=n.replace(zS,GS);Vr[e]=new Si(e,1,!1,n,"http://www.w3.org/1999/xlink",!1,!1)});["xml:base","xml:lang","xml:space"].forEach(function(n){var e=n.replace(zS,GS);Vr[e]=new Si(e,1,!1,n,"http://www.w3.org/XML/1998/namespace",!1,!1)});["tabIndex","crossOrigin"].forEach(function(n){Vr[n]=new Si(n,1,!1,n.toLowerCase(),null,!1,!1)});Vr.xlinkHref=new Si("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1);["src","href","action","formAction"].forEach(function(n){Vr[n]=new Si(n,1,!1,n.toLowerCase(),null,!0,!0)});function HS(n,e,t,r){var i=Vr.hasOwnProperty(e)?Vr[e]:null;(i!==null?i.type!==0:r||!(2a||i[o]!==s[a]){var l=` -`+i[o].replace(" at new "," at ");return n.displayName&&l.includes("")&&(l=l.replace("",n.displayName)),l}while(1<=o&&0<=a);break}}}finally{C1=!1,Error.prepareStackTrace=t}return(n=n?n.displayName||n.name:"")?zh(n):""}function ZF(n){switch(n.tag){case 5:return zh(n.type);case 16:return zh("Lazy");case 13:return zh("Suspense");case 19:return zh("SuspenseList");case 0:case 2:case 15:return n=b1(n.type,!1),n;case 11:return n=b1(n.type.render,!1),n;case 1:return n=b1(n.type,!0),n;default:return""}}function d_(n){if(n==null)return null;if(typeof n=="function")return n.displayName||n.name||null;if(typeof n=="string")return n;switch(n){case Mc:return"Fragment";case Ac:return"Portal";case c_:return"Profiler";case VS:return"StrictMode";case f_:return"Suspense";case h_:return"SuspenseList"}if(typeof n=="object")switch(n.$$typeof){case RR:return(n.displayName||"Context")+".Consumer";case TR:return(n._context.displayName||"Context")+".Provider";case WS:var e=n.render;return n=n.displayName,n||(n=e.displayName||e.name||"",n=n!==""?"ForwardRef("+n+")":"ForwardRef"),n;case JS:return e=n.displayName||null,e!==null?e:d_(n.type)||"Memo";case Oa:e=n._payload,n=n._init;try{return d_(n(e))}catch{}}return null}function QF(n){var e=n.type;switch(n.tag){case 24:return"Cache";case 9:return(e.displayName||"Context")+".Consumer";case 10:return(e._context.displayName||"Context")+".Provider";case 18:return"DehydratedFragment";case 11:return n=e.render,n=n.displayName||n.name||"",e.displayName||(n!==""?"ForwardRef("+n+")":"ForwardRef");case 7:return"Fragment";case 5:return e;case 4:return"Portal";case 3:return"Root";case 6:return"Text";case 16:return d_(e);case 8:return e===VS?"StrictMode":"Mode";case 22:return"Offscreen";case 12:return"Profiler";case 21:return"Scope";case 13:return"Suspense";case 19:return"SuspenseList";case 25:return"TracingMarker";case 1:case 0:case 17:case 2:case 14:case 15:if(typeof e=="function")return e.displayName||e.name||null;if(typeof e=="string")return e}return null}function cl(n){switch(typeof n){case"boolean":case"number":case"string":case"undefined":return n;case"object":return n;default:return""}}function PR(n){var e=n.type;return(n=n.nodeName)&&n.toLowerCase()==="input"&&(e==="checkbox"||e==="radio")}function qF(n){var e=PR(n)?"checked":"value",t=Object.getOwnPropertyDescriptor(n.constructor.prototype,e),r=""+n[e];if(!n.hasOwnProperty(e)&&typeof t<"u"&&typeof t.get=="function"&&typeof t.set=="function"){var i=t.get,s=t.set;return Object.defineProperty(n,e,{configurable:!0,get:function(){return i.call(this)},set:function(o){r=""+o,s.call(this,o)}}),Object.defineProperty(n,e,{enumerable:t.enumerable}),{getValue:function(){return r},setValue:function(o){r=""+o},stopTracking:function(){n._valueTracker=null,delete n[e]}}}}function Dm(n){n._valueTracker||(n._valueTracker=qF(n))}function IR(n){if(!n)return!1;var e=n._valueTracker;if(!e)return!0;var t=e.getValue(),r="";return n&&(r=PR(n)?n.checked?"true":"false":n.value),n=r,n!==t?(e.setValue(n),!0):!1}function B0(n){if(n=n||(typeof document<"u"?document:void 0),typeof n>"u")return null;try{return n.activeElement||n.body}catch{return n.body}}function p_(n,e){var t=e.checked;return Jn({},e,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:t??n._wrapperState.initialChecked})}function QE(n,e){var t=e.defaultValue==null?"":e.defaultValue,r=e.checked!=null?e.checked:e.defaultChecked;t=cl(e.value!=null?e.value:t),n._wrapperState={initialChecked:r,initialValue:t,controlled:e.type==="checkbox"||e.type==="radio"?e.checked!=null:e.value!=null}}function LR(n,e){e=e.checked,e!=null&&HS(n,"checked",e,!1)}function m_(n,e){LR(n,e);var t=cl(e.value),r=e.type;if(t!=null)r==="number"?(t===0&&n.value===""||n.value!=t)&&(n.value=""+t):n.value!==""+t&&(n.value=""+t);else if(r==="submit"||r==="reset"){n.removeAttribute("value");return}e.hasOwnProperty("value")?g_(n,e.type,t):e.hasOwnProperty("defaultValue")&&g_(n,e.type,cl(e.defaultValue)),e.checked==null&&e.defaultChecked!=null&&(n.defaultChecked=!!e.defaultChecked)}function qE(n,e,t){if(e.hasOwnProperty("value")||e.hasOwnProperty("defaultValue")){var r=e.type;if(!(r!=="submit"&&r!=="reset"||e.value!==void 0&&e.value!==null))return;e=""+n._wrapperState.initialValue,t||e===n.value||(n.value=e),n.defaultValue=e}t=n.name,t!==""&&(n.name=""),n.defaultChecked=!!n._wrapperState.initialChecked,t!==""&&(n.name=t)}function g_(n,e,t){(e!=="number"||B0(n.ownerDocument)!==n)&&(t==null?n.defaultValue=""+n._wrapperState.initialValue:n.defaultValue!==""+t&&(n.defaultValue=""+t))}var Gh=Array.isArray;function Vc(n,e,t,r){if(n=n.options,e){e={};for(var i=0;i"+e.valueOf().toString()+"",e=km.firstChild;n.firstChild;)n.removeChild(n.firstChild);for(;e.firstChild;)n.appendChild(e.firstChild)}});function Sd(n,e){if(e){var t=n.firstChild;if(t&&t===n.lastChild&&t.nodeType===3){t.nodeValue=e;return}}n.textContent=e}var $h={animationIterationCount:!0,aspectRatio:!0,borderImageOutset:!0,borderImageSlice:!0,borderImageWidth:!0,boxFlex:!0,boxFlexGroup:!0,boxOrdinalGroup:!0,columnCount:!0,columns:!0,flex:!0,flexGrow:!0,flexPositive:!0,flexShrink:!0,flexNegative:!0,flexOrder:!0,gridArea:!0,gridRow:!0,gridRowEnd:!0,gridRowSpan:!0,gridRowStart:!0,gridColumn:!0,gridColumnEnd:!0,gridColumnSpan:!0,gridColumnStart:!0,fontWeight:!0,lineClamp:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,tabSize:!0,widows:!0,zIndex:!0,zoom:!0,fillOpacity:!0,floodOpacity:!0,stopOpacity:!0,strokeDasharray:!0,strokeDashoffset:!0,strokeMiterlimit:!0,strokeOpacity:!0,strokeWidth:!0},$F=["Webkit","ms","Moz","O"];Object.keys($h).forEach(function(n){$F.forEach(function(e){e=e+n.charAt(0).toUpperCase()+n.substring(1),$h[e]=$h[n]})});function NR(n,e,t){return e==null||typeof e=="boolean"||e===""?"":t||typeof e!="number"||e===0||$h.hasOwnProperty(n)&&$h[n]?(""+e).trim():e+"px"}function OR(n,e){n=n.style;for(var t in e)if(e.hasOwnProperty(t)){var r=t.indexOf("--")===0,i=NR(t,e[t],r);t==="float"&&(t="cssFloat"),r?n.setProperty(t,i):n[t]=i}}var e4=Jn({menuitem:!0},{area:!0,base:!0,br:!0,col:!0,embed:!0,hr:!0,img:!0,input:!0,keygen:!0,link:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0});function x_(n,e){if(e){if(e4[n]&&(e.children!=null||e.dangerouslySetInnerHTML!=null))throw Error(et(137,n));if(e.dangerouslySetInnerHTML!=null){if(e.children!=null)throw Error(et(60));if(typeof e.dangerouslySetInnerHTML!="object"||!("__html"in e.dangerouslySetInnerHTML))throw Error(et(61))}if(e.style!=null&&typeof e.style!="object")throw Error(et(62))}}function __(n,e){if(n.indexOf("-")===-1)return typeof e.is=="string";switch(n){case"annotation-xml":case"color-profile":case"font-face":case"font-face-src":case"font-face-uri":case"font-face-format":case"font-face-name":case"missing-glyph":return!1;default:return!0}}var w_=null;function jS(n){return n=n.target||n.srcElement||window,n.correspondingUseElement&&(n=n.correspondingUseElement),n.nodeType===3?n.parentNode:n}var S_=null,Wc=null,Jc=null;function tC(n){if(n=fp(n)){if(typeof S_!="function")throw Error(et(280));var e=n.stateNode;e&&(e=Uv(e),S_(n.stateNode,n.type,e))}}function UR(n){Wc?Jc?Jc.push(n):Jc=[n]:Wc=n}function zR(){if(Wc){var n=Wc,e=Jc;if(Jc=Wc=null,tC(n),e)for(n=0;n>>=0,n===0?32:31-(f4(n)/h4|0)|0}var Fm=64,Nm=4194304;function Hh(n){switch(n&-n){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return n&4194240;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return n&130023424;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 1073741824;default:return n}}function D0(n,e){var t=n.pendingLanes;if(t===0)return 0;var r=0,i=n.suspendedLanes,s=n.pingedLanes,o=t&268435455;if(o!==0){var a=o&~i;a!==0?r=Hh(a):(s&=o,s!==0&&(r=Hh(s)))}else o=t&~i,o!==0?r=Hh(o):s!==0&&(r=Hh(s));if(r===0)return 0;if(e!==0&&e!==r&&!(e&i)&&(i=r&-r,s=e&-e,i>=s||i===16&&(s&4194240)!==0))return e;if(r&4&&(r|=t&16),e=n.entangledLanes,e!==0)for(n=n.entanglements,e&=r;0t;t++)e.push(n);return e}function up(n,e,t){n.pendingLanes|=e,e!==536870912&&(n.suspendedLanes=0,n.pingedLanes=0),n=n.eventTimes,e=31-Ws(e),n[e]=t}function g4(n,e){var t=n.pendingLanes&~e;n.pendingLanes=e,n.suspendedLanes=0,n.pingedLanes=0,n.expiredLanes&=e,n.mutableReadLanes&=e,n.entangledLanes&=e,e=n.entanglements;var r=n.eventTimes;for(n=n.expirationTimes;0=td),cC=String.fromCharCode(32),fC=!1;function oB(n,e){switch(n){case"keyup":return W4.indexOf(e.keyCode)!==-1;case"keydown":return e.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function aB(n){return n=n.detail,typeof n=="object"&&"data"in n?n.data:null}var Ec=!1;function j4(n,e){switch(n){case"compositionend":return aB(e);case"keypress":return e.which!==32?null:(fC=!0,cC);case"textInput":return n=e.data,n===cC&&fC?null:n;default:return null}}function X4(n,e){if(Ec)return n==="compositionend"||!eA&&oB(n,e)?(n=iB(),n0=QS=Xa=null,Ec=!1,n):null;switch(n){case"paste":return null;case"keypress":if(!(e.ctrlKey||e.altKey||e.metaKey)||e.ctrlKey&&e.altKey){if(e.char&&1=e)return{node:t,offset:e-n};n=r}e:{for(;t;){if(t.nextSibling){t=t.nextSibling;break e}t=t.parentNode}t=void 0}t=mC(t)}}function fB(n,e){return n&&e?n===e?!0:n&&n.nodeType===3?!1:e&&e.nodeType===3?fB(n,e.parentNode):"contains"in n?n.contains(e):n.compareDocumentPosition?!!(n.compareDocumentPosition(e)&16):!1:!1}function hB(){for(var n=window,e=B0();e instanceof n.HTMLIFrameElement;){try{var t=typeof e.contentWindow.location.href=="string"}catch{t=!1}if(t)n=e.contentWindow;else break;e=B0(n.document)}return e}function tA(n){var e=n&&n.nodeName&&n.nodeName.toLowerCase();return e&&(e==="input"&&(n.type==="text"||n.type==="search"||n.type==="tel"||n.type==="url"||n.type==="password")||e==="textarea"||n.contentEditable==="true")}function nN(n){var e=hB(),t=n.focusedElem,r=n.selectionRange;if(e!==t&&t&&t.ownerDocument&&fB(t.ownerDocument.documentElement,t)){if(r!==null&&tA(t)){if(e=r.start,n=r.end,n===void 0&&(n=e),"selectionStart"in t)t.selectionStart=e,t.selectionEnd=Math.min(n,t.value.length);else if(n=(e=t.ownerDocument||document)&&e.defaultView||window,n.getSelection){n=n.getSelection();var i=t.textContent.length,s=Math.min(r.start,i);r=r.end===void 0?s:Math.min(r.end,i),!n.extend&&s>r&&(i=r,r=s,s=i),i=gC(t,s);var o=gC(t,r);i&&o&&(n.rangeCount!==1||n.anchorNode!==i.node||n.anchorOffset!==i.offset||n.focusNode!==o.node||n.focusOffset!==o.offset)&&(e=e.createRange(),e.setStart(i.node,i.offset),n.removeAllRanges(),s>r?(n.addRange(e),n.extend(o.node,o.offset)):(e.setEnd(o.node,o.offset),n.addRange(e)))}}for(e=[],n=t;n=n.parentNode;)n.nodeType===1&&e.push({element:n,left:n.scrollLeft,top:n.scrollTop});for(typeof t.focus=="function"&&t.focus(),t=0;t=document.documentMode,Cc=null,T_=null,rd=null,R_=!1;function vC(n,e,t){var r=t.window===t?t.document:t.nodeType===9?t:t.ownerDocument;R_||Cc==null||Cc!==B0(r)||(r=Cc,"selectionStart"in r&&tA(r)?r={start:r.selectionStart,end:r.selectionEnd}:(r=(r.ownerDocument&&r.ownerDocument.defaultView||window).getSelection(),r={anchorNode:r.anchorNode,anchorOffset:r.anchorOffset,focusNode:r.focusNode,focusOffset:r.focusOffset}),rd&&Td(rd,r)||(rd=r,r=N0(T_,"onSelect"),0Rc||(n.current=k_[Rc],k_[Rc]=null,Rc--)}function Tn(n,e){Rc++,k_[Rc]=n.current,n.current=e}var fl={},ni=vl(fl),Li=vl(!1),xu=fl;function nf(n,e){var t=n.type.contextTypes;if(!t)return fl;var r=n.stateNode;if(r&&r.__reactInternalMemoizedUnmaskedChildContext===e)return r.__reactInternalMemoizedMaskedChildContext;var i={},s;for(s in t)i[s]=e[s];return r&&(n=n.stateNode,n.__reactInternalMemoizedUnmaskedChildContext=e,n.__reactInternalMemoizedMaskedChildContext=i),i}function Di(n){return n=n.childContextTypes,n!=null}function U0(){Ln(Li),Ln(ni)}function MC(n,e,t){if(ni.current!==fl)throw Error(et(168));Tn(ni,e),Tn(Li,t)}function wB(n,e,t){var r=n.stateNode;if(e=e.childContextTypes,typeof r.getChildContext!="function")return t;r=r.getChildContext();for(var i in r)if(!(i in e))throw Error(et(108,QF(n)||"Unknown",i));return Jn({},t,r)}function z0(n){return n=(n=n.stateNode)&&n.__reactInternalMemoizedMergedChildContext||fl,xu=ni.current,Tn(ni,n),Tn(Li,Li.current),!0}function EC(n,e,t){var r=n.stateNode;if(!r)throw Error(et(169));t?(n=wB(n,e,xu),r.__reactInternalMemoizedMergedChildContext=n,Ln(Li),Ln(ni),Tn(ni,n)):Ln(Li),Tn(Li,t)}var Xo=null,zv=!1,G1=!1;function SB(n){Xo===null?Xo=[n]:Xo.push(n)}function pN(n){zv=!0,SB(n)}function yl(){if(!G1&&Xo!==null){G1=!0;var n=0,e=xn;try{var t=Xo;for(xn=1;n>=o,i-=o,qo=1<<32-Ws(e)+i|t<E?(B=R,R=null):B=R.sibling;var D=p(w,R,x[E],A);if(D===null){R===null&&(R=B);break}n&&R&&D.alternate===null&&e(w,R),_=s(D,_,E),b===null?C=D:b.sibling=D,b=D,R=B}if(E===x.length)return t(w,R),Fn&&Yl(w,E),C;if(R===null){for(;EE?(B=R,R=null):B=R.sibling;var U=p(w,R,D.value,A);if(U===null){R===null&&(R=B);break}n&&R&&U.alternate===null&&e(w,R),_=s(U,_,E),b===null?C=U:b.sibling=U,b=U,R=B}if(D.done)return t(w,R),Fn&&Yl(w,E),C;if(R===null){for(;!D.done;E++,D=x.next())D=f(w,D.value,A),D!==null&&(_=s(D,_,E),b===null?C=D:b.sibling=D,b=D);return Fn&&Yl(w,E),C}for(R=r(w,R);!D.done;E++,D=x.next())D=m(R,w,E,D.value,A),D!==null&&(n&&D.alternate!==null&&R.delete(D.key===null?E:D.key),_=s(D,_,E),b===null?C=D:b.sibling=D,b=D);return n&&R.forEach(function(z){return e(w,z)}),Fn&&Yl(w,E),C}function y(w,_,x,A){if(typeof x=="object"&&x!==null&&x.type===Mc&&x.key===null&&(x=x.props.children),typeof x=="object"&&x!==null){switch(x.$$typeof){case Lm:e:{for(var C=x.key,b=_;b!==null;){if(b.key===C){if(C=x.type,C===Mc){if(b.tag===7){t(w,b.sibling),_=i(b,x.props.children),_.return=w,w=_;break e}}else if(b.elementType===C||typeof C=="object"&&C!==null&&C.$$typeof===Oa&&IC(C)===b.type){t(w,b.sibling),_=i(b,x.props),_.ref=gh(w,b,x),_.return=w,w=_;break e}t(w,b);break}else e(w,b);b=b.sibling}x.type===Mc?(_=hu(x.props.children,w.mode,A,x.key),_.return=w,w=_):(A=c0(x.type,x.key,x.props,null,w.mode,A),A.ref=gh(w,_,x),A.return=w,w=A)}return o(w);case Ac:e:{for(b=x.key;_!==null;){if(_.key===b)if(_.tag===4&&_.stateNode.containerInfo===x.containerInfo&&_.stateNode.implementation===x.implementation){t(w,_.sibling),_=i(_,x.children||[]),_.return=w,w=_;break e}else{t(w,_);break}else e(w,_);_=_.sibling}_=K1(x,w.mode,A),_.return=w,w=_}return o(w);case Oa:return b=x._init,y(w,_,b(x._payload),A)}if(Gh(x))return g(w,_,x,A);if(fh(x))return v(w,_,x,A);Wm(w,x)}return typeof x=="string"&&x!==""||typeof x=="number"?(x=""+x,_!==null&&_.tag===6?(t(w,_.sibling),_=i(_,x),_.return=w,w=_):(t(w,_),_=Y1(x,w.mode,A),_.return=w,w=_),o(w)):t(w,_)}return y}var sf=BB(!0),PB=BB(!1),hp={},yo=vl(hp),Id=vl(hp),Ld=vl(hp);function iu(n){if(n===hp)throw Error(et(174));return n}function cA(n,e){switch(Tn(Ld,e),Tn(Id,n),Tn(yo,hp),n=e.nodeType,n){case 9:case 11:e=(e=e.documentElement)?e.namespaceURI:y_(null,"");break;default:n=n===8?e.parentNode:e,e=n.namespaceURI||null,n=n.tagName,e=y_(e,n)}Ln(yo),Tn(yo,e)}function of(){Ln(yo),Ln(Id),Ln(Ld)}function IB(n){iu(Ld.current);var e=iu(yo.current),t=y_(e,n.type);e!==t&&(Tn(Id,n),Tn(yo,t))}function fA(n){Id.current===n&&(Ln(yo),Ln(Id))}var zn=vl(0);function j0(n){for(var e=n;e!==null;){if(e.tag===13){var t=e.memoizedState;if(t!==null&&(t=t.dehydrated,t===null||t.data==="$?"||t.data==="$!"))return e}else if(e.tag===19&&e.memoizedProps.revealOrder!==void 0){if(e.flags&128)return e}else if(e.child!==null){e.child.return=e,e=e.child;continue}if(e===n)break;for(;e.sibling===null;){if(e.return===null||e.return===n)return null;e=e.return}e.sibling.return=e.return,e=e.sibling}return null}var H1=[];function hA(){for(var n=0;nt?t:4,n(!0);var r=V1.transition;V1.transition={};try{n(!1),e()}finally{xn=t,V1.transition=r}}function YB(){return Cs().memoizedState}function yN(n,e,t){var r=sl(n);if(t={lane:r,action:t,hasEagerState:!1,eagerState:null,next:null},KB(n))ZB(e,t);else if(t=CB(n,e,t,r),t!==null){var i=gi();Js(t,n,r,i),QB(t,e,r)}}function xN(n,e,t){var r=sl(n),i={lane:r,action:t,hasEagerState:!1,eagerState:null,next:null};if(KB(n))ZB(e,i);else{var s=n.alternate;if(n.lanes===0&&(s===null||s.lanes===0)&&(s=e.lastRenderedReducer,s!==null))try{var o=e.lastRenderedState,a=s(o,t);if(i.hasEagerState=!0,i.eagerState=a,Xs(a,o)){var l=e.interleaved;l===null?(i.next=i,lA(e)):(i.next=l.next,l.next=i),e.interleaved=i;return}}catch{}finally{}t=CB(n,e,i,r),t!==null&&(i=gi(),Js(t,n,r,i),QB(t,e,r))}}function KB(n){var e=n.alternate;return n===Wn||e!==null&&e===Wn}function ZB(n,e){id=X0=!0;var t=n.pending;t===null?e.next=e:(e.next=t.next,t.next=e),n.pending=e}function QB(n,e,t){if(t&4194240){var r=e.lanes;r&=n.pendingLanes,t|=r,e.lanes=t,YS(n,t)}}var Y0={readContext:Es,useCallback:Kr,useContext:Kr,useEffect:Kr,useImperativeHandle:Kr,useInsertionEffect:Kr,useLayoutEffect:Kr,useMemo:Kr,useReducer:Kr,useRef:Kr,useState:Kr,useDebugValue:Kr,useDeferredValue:Kr,useTransition:Kr,useMutableSource:Kr,useSyncExternalStore:Kr,useId:Kr,unstable_isNewReconciler:!1},_N={readContext:Es,useCallback:function(n,e){return co().memoizedState=[n,e===void 0?null:e],n},useContext:Es,useEffect:DC,useImperativeHandle:function(n,e,t){return t=t!=null?t.concat([n]):null,o0(4194308,4,VB.bind(null,e,n),t)},useLayoutEffect:function(n,e){return o0(4194308,4,n,e)},useInsertionEffect:function(n,e){return o0(4,2,n,e)},useMemo:function(n,e){var t=co();return e=e===void 0?null:e,n=n(),t.memoizedState=[n,e],n},useReducer:function(n,e,t){var r=co();return e=t!==void 0?t(e):e,r.memoizedState=r.baseState=e,n={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:n,lastRenderedState:e},r.queue=n,n=n.dispatch=yN.bind(null,Wn,n),[r.memoizedState,n]},useRef:function(n){var e=co();return n={current:n},e.memoizedState=n},useState:LC,useDebugValue:vA,useDeferredValue:function(n){return co().memoizedState=n},useTransition:function(){var n=LC(!1),e=n[0];return n=vN.bind(null,n[1]),co().memoizedState=n,[e,n]},useMutableSource:function(){},useSyncExternalStore:function(n,e,t){var r=Wn,i=co();if(Fn){if(t===void 0)throw Error(et(407));t=t()}else{if(t=e(),Br===null)throw Error(et(349));wu&30||kB(r,e,t)}i.memoizedState=t;var s={value:t,getSnapshot:e};return i.queue=s,DC(NB.bind(null,r,s,n),[n]),r.flags|=2048,Fd(9,FB.bind(null,r,s,t,e),void 0,null),t},useId:function(){var n=co(),e=Br.identifierPrefix;if(Fn){var t=$o,r=qo;t=(r&~(1<<32-Ws(r)-1)).toString(32)+t,e=":"+e+"R"+t,t=Dd++,0<\/script>",n=n.removeChild(n.firstChild)):typeof r.is=="string"?n=o.createElement(t,{is:r.is}):(n=o.createElement(t),t==="select"&&(o=n,r.multiple?o.multiple=!0:r.size&&(o.size=r.size))):n=o.createElementNS(n,t),n[fo]=e,n[Pd]=r,oP(n,e,!1,!1),e.stateNode=n;e:{switch(o=__(t,r),t){case"dialog":Bn("cancel",n),Bn("close",n),i=r;break;case"iframe":case"object":case"embed":Bn("load",n),i=r;break;case"video":case"audio":for(i=0;ilf&&(e.flags|=128,r=!0,vh(s,!1),e.lanes=4194304)}else{if(!r)if(n=j0(o),n!==null){if(e.flags|=128,r=!0,t=n.updateQueue,t!==null&&(e.updateQueue=t,e.flags|=4),vh(s,!0),s.tail===null&&s.tailMode==="hidden"&&!o.alternate&&!Fn)return Zr(e),null}else 2*rr()-s.renderingStartTime>lf&&t!==1073741824&&(e.flags|=128,r=!0,vh(s,!1),e.lanes=4194304);s.isBackwards?(o.sibling=e.child,e.child=o):(t=s.last,t!==null?t.sibling=o:e.child=o,s.last=o)}return s.tail!==null?(e=s.tail,s.rendering=e,s.tail=e.sibling,s.renderingStartTime=rr(),e.sibling=null,t=zn.current,Tn(zn,r?t&1|2:t&1),e):(Zr(e),null);case 22:case 23:return AA(),r=e.memoizedState!==null,n!==null&&n.memoizedState!==null!==r&&(e.flags|=8192),r&&e.mode&1?Yi&1073741824&&(Zr(e),e.subtreeFlags&6&&(e.flags|=8192)):Zr(e),null;case 24:return null;case 25:return null}throw Error(et(156,e.tag))}function TN(n,e){switch(rA(e),e.tag){case 1:return Di(e.type)&&U0(),n=e.flags,n&65536?(e.flags=n&-65537|128,e):null;case 3:return of(),Ln(Li),Ln(ni),hA(),n=e.flags,n&65536&&!(n&128)?(e.flags=n&-65537|128,e):null;case 5:return fA(e),null;case 13:if(Ln(zn),n=e.memoizedState,n!==null&&n.dehydrated!==null){if(e.alternate===null)throw Error(et(340));rf()}return n=e.flags,n&65536?(e.flags=n&-65537|128,e):null;case 19:return Ln(zn),null;case 4:return of(),null;case 10:return aA(e.type._context),null;case 22:case 23:return AA(),null;case 24:return null;default:return null}}var jm=!1,ei=!1,RN=typeof WeakSet=="function"?WeakSet:Set,mt=null;function Lc(n,e){var t=n.ref;if(t!==null)if(typeof t=="function")try{t(null)}catch(r){Kn(n,e,r)}else t.current=null}function X_(n,e,t){try{t()}catch(r){Kn(n,e,r)}}var VC=!1;function BN(n,e){if(B_=k0,n=hB(),tA(n)){if("selectionStart"in n)var t={start:n.selectionStart,end:n.selectionEnd};else e:{t=(t=n.ownerDocument)&&t.defaultView||window;var r=t.getSelection&&t.getSelection();if(r&&r.rangeCount!==0){t=r.anchorNode;var i=r.anchorOffset,s=r.focusNode;r=r.focusOffset;try{t.nodeType,s.nodeType}catch{t=null;break e}var o=0,a=-1,l=-1,u=0,c=0,f=n,p=null;t:for(;;){for(var m;f!==t||i!==0&&f.nodeType!==3||(a=o+i),f!==s||r!==0&&f.nodeType!==3||(l=o+r),f.nodeType===3&&(o+=f.nodeValue.length),(m=f.firstChild)!==null;)p=f,f=m;for(;;){if(f===n)break t;if(p===t&&++u===i&&(a=o),p===s&&++c===r&&(l=o),(m=f.nextSibling)!==null)break;f=p,p=f.parentNode}f=m}t=a===-1||l===-1?null:{start:a,end:l}}else t=null}t=t||{start:0,end:0}}else t=null;for(P_={focusedElem:n,selectionRange:t},k0=!1,mt=e;mt!==null;)if(e=mt,n=e.child,(e.subtreeFlags&1028)!==0&&n!==null)n.return=e,mt=n;else for(;mt!==null;){e=mt;try{var g=e.alternate;if(e.flags&1024)switch(e.tag){case 0:case 11:case 15:break;case 1:if(g!==null){var v=g.memoizedProps,y=g.memoizedState,w=e.stateNode,_=w.getSnapshotBeforeUpdate(e.elementType===e.type?v:Fs(e.type,v),y);w.__reactInternalSnapshotBeforeUpdate=_}break;case 3:var x=e.stateNode.containerInfo;x.nodeType===1?x.textContent="":x.nodeType===9&&x.documentElement&&x.removeChild(x.documentElement);break;case 5:case 6:case 4:case 17:break;default:throw Error(et(163))}}catch(A){Kn(e,e.return,A)}if(n=e.sibling,n!==null){n.return=e.return,mt=n;break}mt=e.return}return g=VC,VC=!1,g}function sd(n,e,t){var r=e.updateQueue;if(r=r!==null?r.lastEffect:null,r!==null){var i=r=r.next;do{if((i.tag&n)===n){var s=i.destroy;i.destroy=void 0,s!==void 0&&X_(e,t,s)}i=i.next}while(i!==r)}}function Vv(n,e){if(e=e.updateQueue,e=e!==null?e.lastEffect:null,e!==null){var t=e=e.next;do{if((t.tag&n)===n){var r=t.create;t.destroy=r()}t=t.next}while(t!==e)}}function Y_(n){var e=n.ref;if(e!==null){var t=n.stateNode;switch(n.tag){case 5:n=t;break;default:n=t}typeof e=="function"?e(n):e.current=n}}function uP(n){var e=n.alternate;e!==null&&(n.alternate=null,uP(e)),n.child=null,n.deletions=null,n.sibling=null,n.tag===5&&(e=n.stateNode,e!==null&&(delete e[fo],delete e[Pd],delete e[D_],delete e[hN],delete e[dN])),n.stateNode=null,n.return=null,n.dependencies=null,n.memoizedProps=null,n.memoizedState=null,n.pendingProps=null,n.stateNode=null,n.updateQueue=null}function cP(n){return n.tag===5||n.tag===3||n.tag===4}function WC(n){e:for(;;){for(;n.sibling===null;){if(n.return===null||cP(n.return))return null;n=n.return}for(n.sibling.return=n.return,n=n.sibling;n.tag!==5&&n.tag!==6&&n.tag!==18;){if(n.flags&2||n.child===null||n.tag===4)continue e;n.child.return=n,n=n.child}if(!(n.flags&2))return n.stateNode}}function K_(n,e,t){var r=n.tag;if(r===5||r===6)n=n.stateNode,e?t.nodeType===8?t.parentNode.insertBefore(n,e):t.insertBefore(n,e):(t.nodeType===8?(e=t.parentNode,e.insertBefore(n,t)):(e=t,e.appendChild(n)),t=t._reactRootContainer,t!=null||e.onclick!==null||(e.onclick=O0));else if(r!==4&&(n=n.child,n!==null))for(K_(n,e,t),n=n.sibling;n!==null;)K_(n,e,t),n=n.sibling}function Z_(n,e,t){var r=n.tag;if(r===5||r===6)n=n.stateNode,e?t.insertBefore(n,e):t.appendChild(n);else if(r!==4&&(n=n.child,n!==null))for(Z_(n,e,t),n=n.sibling;n!==null;)Z_(n,e,t),n=n.sibling}var Nr=null,Ns=!1;function Ba(n,e,t){for(t=t.child;t!==null;)fP(n,e,t),t=t.sibling}function fP(n,e,t){if(vo&&typeof vo.onCommitFiberUnmount=="function")try{vo.onCommitFiberUnmount(kv,t)}catch{}switch(t.tag){case 5:ei||Lc(t,e);case 6:var r=Nr,i=Ns;Nr=null,Ba(n,e,t),Nr=r,Ns=i,Nr!==null&&(Ns?(n=Nr,t=t.stateNode,n.nodeType===8?n.parentNode.removeChild(t):n.removeChild(t)):Nr.removeChild(t.stateNode));break;case 18:Nr!==null&&(Ns?(n=Nr,t=t.stateNode,n.nodeType===8?z1(n.parentNode,t):n.nodeType===1&&z1(n,t),Cd(n)):z1(Nr,t.stateNode));break;case 4:r=Nr,i=Ns,Nr=t.stateNode.containerInfo,Ns=!0,Ba(n,e,t),Nr=r,Ns=i;break;case 0:case 11:case 14:case 15:if(!ei&&(r=t.updateQueue,r!==null&&(r=r.lastEffect,r!==null))){i=r=r.next;do{var s=i,o=s.destroy;s=s.tag,o!==void 0&&(s&2||s&4)&&X_(t,e,o),i=i.next}while(i!==r)}Ba(n,e,t);break;case 1:if(!ei&&(Lc(t,e),r=t.stateNode,typeof r.componentWillUnmount=="function"))try{r.props=t.memoizedProps,r.state=t.memoizedState,r.componentWillUnmount()}catch(a){Kn(t,e,a)}Ba(n,e,t);break;case 21:Ba(n,e,t);break;case 22:t.mode&1?(ei=(r=ei)||t.memoizedState!==null,Ba(n,e,t),ei=r):Ba(n,e,t);break;default:Ba(n,e,t)}}function JC(n){var e=n.updateQueue;if(e!==null){n.updateQueue=null;var t=n.stateNode;t===null&&(t=n.stateNode=new RN),e.forEach(function(r){var i=UN.bind(null,n,r);t.has(r)||(t.add(r),r.then(i,i))})}}function Ps(n,e){var t=e.deletions;if(t!==null)for(var r=0;ri&&(i=o),r&=~s}if(r=i,r=rr()-r,r=(120>r?120:480>r?480:1080>r?1080:1920>r?1920:3e3>r?3e3:4320>r?4320:1960*IN(r/1960))-r,10n?16:n,Ya===null)var r=!1;else{if(n=Ya,Ya=null,Q0=0,cn&6)throw Error(et(331));var i=cn;for(cn|=4,mt=n.current;mt!==null;){var s=mt,o=s.child;if(mt.flags&16){var a=s.deletions;if(a!==null){for(var l=0;lrr()-wA?fu(n,0):_A|=t),ki(n,e)}function xP(n,e){e===0&&(n.mode&1?(e=Nm,Nm<<=1,!(Nm&130023424)&&(Nm=4194304)):e=1);var t=gi();n=ua(n,e),n!==null&&(up(n,e,t),ki(n,t))}function ON(n){var e=n.memoizedState,t=0;e!==null&&(t=e.retryLane),xP(n,t)}function UN(n,e){var t=0;switch(n.tag){case 13:var r=n.stateNode,i=n.memoizedState;i!==null&&(t=i.retryLane);break;case 19:r=n.stateNode;break;default:throw Error(et(314))}r!==null&&r.delete(e),xP(n,t)}var _P;_P=function(n,e,t){if(n!==null)if(n.memoizedProps!==e.pendingProps||Li.current)Pi=!0;else{if(!(n.lanes&t)&&!(e.flags&128))return Pi=!1,CN(n,e,t);Pi=!!(n.flags&131072)}else Pi=!1,Fn&&e.flags&1048576&&AB(e,H0,e.index);switch(e.lanes=0,e.tag){case 2:var r=e.type;a0(n,e),n=e.pendingProps;var i=nf(e,ni.current);Xc(e,t),i=pA(null,e,r,n,i,t);var s=mA();return e.flags|=1,typeof i=="object"&&i!==null&&typeof i.render=="function"&&i.$$typeof===void 0?(e.tag=1,e.memoizedState=null,e.updateQueue=null,Di(r)?(s=!0,z0(e)):s=!1,e.memoizedState=i.state!==null&&i.state!==void 0?i.state:null,uA(e),i.updater=Gv,e.stateNode=i,i._reactInternals=e,z_(e,r,n,t),e=V_(null,e,r,!0,s,t)):(e.tag=0,Fn&&s&&nA(e),fi(null,e,i,t),e=e.child),e;case 16:r=e.elementType;e:{switch(a0(n,e),n=e.pendingProps,i=r._init,r=i(r._payload),e.type=r,i=e.tag=GN(r),n=Fs(r,n),i){case 0:e=H_(null,e,r,n,t);break e;case 1:e=zC(null,e,r,n,t);break e;case 11:e=OC(null,e,r,n,t);break e;case 14:e=UC(null,e,r,Fs(r.type,n),t);break e}throw Error(et(306,r,""))}return e;case 0:return r=e.type,i=e.pendingProps,i=e.elementType===r?i:Fs(r,i),H_(n,e,r,i,t);case 1:return r=e.type,i=e.pendingProps,i=e.elementType===r?i:Fs(r,i),zC(n,e,r,i,t);case 3:e:{if(rP(e),n===null)throw Error(et(387));r=e.pendingProps,s=e.memoizedState,i=s.element,bB(n,e),J0(e,r,null,t);var o=e.memoizedState;if(r=o.element,s.isDehydrated)if(s={element:r,isDehydrated:!1,cache:o.cache,pendingSuspenseBoundaries:o.pendingSuspenseBoundaries,transitions:o.transitions},e.updateQueue.baseState=s,e.memoizedState=s,e.flags&256){i=af(Error(et(423)),e),e=GC(n,e,r,t,i);break e}else if(r!==i){i=af(Error(et(424)),e),e=GC(n,e,r,t,i);break e}else for(Qi=nl(e.stateNode.containerInfo.firstChild),es=e,Fn=!0,Us=null,t=PB(e,null,r,t),e.child=t;t;)t.flags=t.flags&-3|4096,t=t.sibling;else{if(rf(),r===i){e=ca(n,e,t);break e}fi(n,e,r,t)}e=e.child}return e;case 5:return IB(e),n===null&&N_(e),r=e.type,i=e.pendingProps,s=n!==null?n.memoizedProps:null,o=i.children,I_(r,i)?o=null:s!==null&&I_(r,s)&&(e.flags|=32),nP(n,e),fi(n,e,o,t),e.child;case 6:return n===null&&N_(e),null;case 13:return iP(n,e,t);case 4:return cA(e,e.stateNode.containerInfo),r=e.pendingProps,n===null?e.child=sf(e,null,r,t):fi(n,e,r,t),e.child;case 11:return r=e.type,i=e.pendingProps,i=e.elementType===r?i:Fs(r,i),OC(n,e,r,i,t);case 7:return fi(n,e,e.pendingProps,t),e.child;case 8:return fi(n,e,e.pendingProps.children,t),e.child;case 12:return fi(n,e,e.pendingProps.children,t),e.child;case 10:e:{if(r=e.type._context,i=e.pendingProps,s=e.memoizedProps,o=i.value,Tn(V0,r._currentValue),r._currentValue=o,s!==null)if(Xs(s.value,o)){if(s.children===i.children&&!Li.current){e=ca(n,e,t);break e}}else for(s=e.child,s!==null&&(s.return=e);s!==null;){var a=s.dependencies;if(a!==null){o=s.child;for(var l=a.firstContext;l!==null;){if(l.context===r){if(s.tag===1){l=ia(-1,t&-t),l.tag=2;var u=s.updateQueue;if(u!==null){u=u.shared;var c=u.pending;c===null?l.next=l:(l.next=c.next,c.next=l),u.pending=l}}s.lanes|=t,l=s.alternate,l!==null&&(l.lanes|=t),O_(s.return,t,e),a.lanes|=t;break}l=l.next}}else if(s.tag===10)o=s.type===e.type?null:s.child;else if(s.tag===18){if(o=s.return,o===null)throw Error(et(341));o.lanes|=t,a=o.alternate,a!==null&&(a.lanes|=t),O_(o,t,e),o=s.sibling}else o=s.child;if(o!==null)o.return=s;else for(o=s;o!==null;){if(o===e){o=null;break}if(s=o.sibling,s!==null){s.return=o.return,o=s;break}o=o.return}s=o}fi(n,e,i.children,t),e=e.child}return e;case 9:return i=e.type,r=e.pendingProps.children,Xc(e,t),i=Es(i),r=r(i),e.flags|=1,fi(n,e,r,t),e.child;case 14:return r=e.type,i=Fs(r,e.pendingProps),i=Fs(r.type,i),UC(n,e,r,i,t);case 15:return eP(n,e,e.type,e.pendingProps,t);case 17:return r=e.type,i=e.pendingProps,i=e.elementType===r?i:Fs(r,i),a0(n,e),e.tag=1,Di(r)?(n=!0,z0(e)):n=!1,Xc(e,t),RB(e,r,i),z_(e,r,i,t),V_(null,e,r,!0,n,t);case 19:return sP(n,e,t);case 22:return tP(n,e,t)}throw Error(et(156,e.tag))};function wP(n,e){return XR(n,e)}function zN(n,e,t,r){this.tag=n,this.key=t,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.ref=null,this.pendingProps=e,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=r,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function Ss(n,e,t,r){return new zN(n,e,t,r)}function EA(n){return n=n.prototype,!(!n||!n.isReactComponent)}function GN(n){if(typeof n=="function")return EA(n)?1:0;if(n!=null){if(n=n.$$typeof,n===WS)return 11;if(n===JS)return 14}return 2}function ol(n,e){var t=n.alternate;return t===null?(t=Ss(n.tag,e,n.key,n.mode),t.elementType=n.elementType,t.type=n.type,t.stateNode=n.stateNode,t.alternate=n,n.alternate=t):(t.pendingProps=e,t.type=n.type,t.flags=0,t.subtreeFlags=0,t.deletions=null),t.flags=n.flags&14680064,t.childLanes=n.childLanes,t.lanes=n.lanes,t.child=n.child,t.memoizedProps=n.memoizedProps,t.memoizedState=n.memoizedState,t.updateQueue=n.updateQueue,e=n.dependencies,t.dependencies=e===null?null:{lanes:e.lanes,firstContext:e.firstContext},t.sibling=n.sibling,t.index=n.index,t.ref=n.ref,t}function c0(n,e,t,r,i,s){var o=2;if(r=n,typeof n=="function")EA(n)&&(o=1);else if(typeof n=="string")o=5;else e:switch(n){case Mc:return hu(t.children,i,s,e);case VS:o=8,i|=8;break;case c_:return n=Ss(12,t,e,i|2),n.elementType=c_,n.lanes=s,n;case f_:return n=Ss(13,t,e,i),n.elementType=f_,n.lanes=s,n;case h_:return n=Ss(19,t,e,i),n.elementType=h_,n.lanes=s,n;case BR:return Jv(t,i,s,e);default:if(typeof n=="object"&&n!==null)switch(n.$$typeof){case TR:o=10;break e;case RR:o=9;break e;case WS:o=11;break e;case JS:o=14;break e;case Oa:o=16,r=null;break e}throw Error(et(130,n==null?n:typeof n,""))}return e=Ss(o,t,e,i),e.elementType=n,e.type=r,e.lanes=s,e}function hu(n,e,t,r){return n=Ss(7,n,r,e),n.lanes=t,n}function Jv(n,e,t,r){return n=Ss(22,n,r,e),n.elementType=BR,n.lanes=t,n.stateNode={isHidden:!1},n}function Y1(n,e,t){return n=Ss(6,n,null,e),n.lanes=t,n}function K1(n,e,t){return e=Ss(4,n.children!==null?n.children:[],n.key,e),e.lanes=t,e.stateNode={containerInfo:n.containerInfo,pendingChildren:null,implementation:n.implementation},e}function HN(n,e,t,r,i){this.tag=e,this.containerInfo=n,this.finishedWork=this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.pendingContext=this.context=null,this.callbackPriority=0,this.eventTimes=R1(0),this.expirationTimes=R1(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=R1(0),this.identifierPrefix=r,this.onRecoverableError=i,this.mutableSourceEagerHydrationData=null}function CA(n,e,t,r,i,s,o,a,l){return n=new HN(n,e,t,a,l),e===1?(e=1,s===!0&&(e|=8)):e=0,s=Ss(3,null,null,e),n.current=s,s.stateNode=n,s.memoizedState={element:r,isDehydrated:t,cache:null,transitions:null,pendingSuspenseBoundaries:null},uA(s),n}function VN(n,e,t){var r=3"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(e)}catch(t){console.error(t)}}e(),n.exports=is})(WF);var $C=a_;o_.createRoot=$C.createRoot,o_.hydrateRoot=$C.hydrateRoot;var Od={},YN={get exports(){return Od},set exports(n){Od=n}},_n={};/** @license React v16.13.1 - * react-is.production.min.js - * - * Copyright (c) Facebook, Inc. and its affiliates. - * - * This source code is licensed under the MIT license found in the - * LICENSE file in the root directory of this source tree. - */var Lr=typeof Symbol=="function"&&Symbol.for,BA=Lr?Symbol.for("react.element"):60103,PA=Lr?Symbol.for("react.portal"):60106,Zv=Lr?Symbol.for("react.fragment"):60107,Qv=Lr?Symbol.for("react.strict_mode"):60108,qv=Lr?Symbol.for("react.profiler"):60114,$v=Lr?Symbol.for("react.provider"):60109,ey=Lr?Symbol.for("react.context"):60110,IA=Lr?Symbol.for("react.async_mode"):60111,ty=Lr?Symbol.for("react.concurrent_mode"):60111,ny=Lr?Symbol.for("react.forward_ref"):60112,ry=Lr?Symbol.for("react.suspense"):60113,KN=Lr?Symbol.for("react.suspense_list"):60120,iy=Lr?Symbol.for("react.memo"):60115,sy=Lr?Symbol.for("react.lazy"):60116,ZN=Lr?Symbol.for("react.block"):60121,QN=Lr?Symbol.for("react.fundamental"):60117,qN=Lr?Symbol.for("react.responder"):60118,$N=Lr?Symbol.for("react.scope"):60119;function os(n){if(typeof n=="object"&&n!==null){var e=n.$$typeof;switch(e){case BA:switch(n=n.type,n){case IA:case ty:case Zv:case qv:case Qv:case ry:return n;default:switch(n=n&&n.$$typeof,n){case ey:case ny:case sy:case iy:case $v:return n;default:return e}}case PA:return e}}}function EP(n){return os(n)===ty}_n.AsyncMode=IA;_n.ConcurrentMode=ty;_n.ContextConsumer=ey;_n.ContextProvider=$v;_n.Element=BA;_n.ForwardRef=ny;_n.Fragment=Zv;_n.Lazy=sy;_n.Memo=iy;_n.Portal=PA;_n.Profiler=qv;_n.StrictMode=Qv;_n.Suspense=ry;_n.isAsyncMode=function(n){return EP(n)||os(n)===IA};_n.isConcurrentMode=EP;_n.isContextConsumer=function(n){return os(n)===ey};_n.isContextProvider=function(n){return os(n)===$v};_n.isElement=function(n){return typeof n=="object"&&n!==null&&n.$$typeof===BA};_n.isForwardRef=function(n){return os(n)===ny};_n.isFragment=function(n){return os(n)===Zv};_n.isLazy=function(n){return os(n)===sy};_n.isMemo=function(n){return os(n)===iy};_n.isPortal=function(n){return os(n)===PA};_n.isProfiler=function(n){return os(n)===qv};_n.isStrictMode=function(n){return os(n)===Qv};_n.isSuspense=function(n){return os(n)===ry};_n.isValidElementType=function(n){return typeof n=="string"||typeof n=="function"||n===Zv||n===ty||n===qv||n===Qv||n===ry||n===KN||typeof n=="object"&&n!==null&&(n.$$typeof===sy||n.$$typeof===iy||n.$$typeof===$v||n.$$typeof===ey||n.$$typeof===ny||n.$$typeof===QN||n.$$typeof===qN||n.$$typeof===$N||n.$$typeof===ZN)};_n.typeOf=os;(function(n){n.exports=_n})(YN);function eO(n){function e(k,Q,q,X,J){for(var ae=0,re=0,me=0,Me=0,Se,se,ye=0,ke=0,Te,Pe=Te=Se=0,We=0,Ce=0,je=0,He=0,Ie=q.length,K=Ie-1,O,le="",_e="",Ge="",Je="",Ve;WeSe)&&(He=(le=le.replace(" ",":")).length),0X&&(X=(Q=Q.trim()).charCodeAt(0)),X){case 38:return Q.replace(w,"$1"+k.trim());case 58:return k.trim()+Q.replace(w,"$1"+k.trim());default:if(0<1*q&&0re.charCodeAt(8))break;case 115:J=J.replace(re,"-webkit-"+re)+";"+J;break;case 207:case 102:J=J.replace(re,"-webkit-"+(102q.charCodeAt(0)&&(q=q.trim()),W=q,q=[W],01?e-1:0),r=1;r0?" Args: "+t.join(", "):""))}var dO=function(){function n(t){this.groupSizes=new Uint32Array(512),this.length=512,this.tag=t}var e=n.prototype;return e.indexOfGroup=function(t){for(var r=0,i=0;i=this.groupSizes.length){for(var i=this.groupSizes,s=i.length,o=s;t>=o;)(o<<=1)<0&&dp(16,""+t);this.groupSizes=new Uint32Array(o),this.groupSizes.set(i),this.length=o;for(var a=s;a=this.length||this.groupSizes[t]===0)return r;for(var i=this.groupSizes[t],s=this.indexOfGroup(t),o=s+i,a=s;a=ld&&(ld=e+1),f0.set(n,e),tv.set(e,n)},gO="style["+uf+'][data-styled-version="5.3.9"]',vO=new RegExp("^"+uf+'\\.g(\\d+)\\[id="([\\w\\d-]+)"\\].*?"([^"]*)'),yO=function(n,e,t){for(var r,i=t.split(","),s=0,o=i.length;s=0;u--){var c=l[u];if(c&&c.nodeType===1&&c.hasAttribute(uf))return c}}(t),s=i!==void 0?i.nextSibling:null;r.setAttribute(uf,"active"),r.setAttribute("data-styled-version","5.3.9");var o=_O();return o&&r.setAttribute("nonce",o),t.insertBefore(r,s),r},wO=function(){function n(t){var r=this.element=TP(t);r.appendChild(document.createTextNode("")),this.sheet=function(i){if(i.sheet)return i.sheet;for(var s=document.styleSheets,o=0,a=s.length;o=0){var i=document.createTextNode(r),s=this.nodes[t];return this.element.insertBefore(i,s||null),this.length++,!0}return!1},e.deleteRule=function(t){this.element.removeChild(this.nodes[t]),this.length--},e.getRule=function(t){return t0&&(f+=p+",")}),s+=""+u+c+'{content:"'+f+`"}/*!sc*/ -`}}}return s}(this)},n}(),EO=/(a)(d)/gi,ab=function(n){return String.fromCharCode(n+(n>25?39:97))};function nw(n){var e,t="";for(e=Math.abs(n);e>52;e=e/52|0)t=ab(e%52)+t;return(ab(e%52)+t).replace(EO,"$1-$2")}var kc=function(n,e){for(var t=e.length;t;)n=33*n^e.charCodeAt(--t);return n},BP=function(n){return kc(5381,n)};function CO(n){for(var e=0;e>>0);if(!t.hasNameForId(i,a)){var l=r(o,"."+a,void 0,i);t.insertRules(i,a,l)}s.push(a),this.staticRulesId=a}else{for(var u=this.rules.length,c=kc(this.baseHash,r.hash),f="",p=0;p>>0);if(!t.hasNameForId(i,y)){var w=r(f,"."+y,void 0,i);t.insertRules(i,y,w)}s.push(y)}}return s.join(" ")},n}(),RO=/^\s*\/\/.*$/gm,BO=[":","[",".","#"];function PO(n){var e,t,r,i,s=n===void 0?al:n,o=s.options,a=o===void 0?al:o,l=s.plugins,u=l===void 0?ev:l,c=new eO(a),f=[],p=function(v){function y(w){if(w)try{v(w+"}")}catch{}}return function(w,_,x,A,C,b,R,E,B,D){switch(w){case 1:if(B===0&&_.charCodeAt(0)===64)return v(_+";"),"";break;case 2:if(E===0)return _+"/*|*/";break;case 3:switch(E){case 102:case 112:return v(x[0]+_),"";default:return _+(D===0?"/*|*/":"")}case-2:_.split("/*|*/}").forEach(y)}}}(function(v){f.push(v)}),m=function(v,y,w){return y===0&&BO.indexOf(w[t.length])!==-1||w.match(i)?v:"."+e};function g(v,y,w,_){_===void 0&&(_="&");var x=v.replace(RO,""),A=y&&w?w+" "+y+" { "+x+" }":x;return e=_,t=y,r=new RegExp("\\"+t+"\\b","g"),i=new RegExp("(\\"+t+"\\b){2,}"),c(w||!y?"":y,A)}return c.use([].concat(u,[function(v,y,w){v===2&&w.length&&w[0].lastIndexOf(t)>0&&(w[0]=w[0].replace(r,m))},p,function(v){if(v===-2){var y=f;return f=[],y}}])),g.hash=u.length?u.reduce(function(v,y){return y.name||dp(15),kc(v,y.name)},5381).toString():"",g}var PP=pn.createContext();PP.Consumer;var IP=pn.createContext(),IO=(IP.Consumer,new RP),rw=PO();function LO(){return ee.useContext(PP)||IO}function DO(){return ee.useContext(IP)||rw}var kO=function(){function n(e,t){var r=this;this.inject=function(i,s){s===void 0&&(s=rw);var o=r.name+s.hash;i.hasNameForId(r.id,o)||i.insertRules(r.id,o,s(r.rules,o,"@keyframes"))},this.toString=function(){return dp(12,String(r.name))},this.name=e,this.id="sc-keyframes-"+e,this.rules=t}return n.prototype.getName=function(e){return e===void 0&&(e=rw),this.name+e.hash},n}(),FO=/([A-Z])/,NO=/([A-Z])/g,OO=/^ms-/,UO=function(n){return"-"+n.toLowerCase()};function lb(n){return FO.test(n)?n.replace(NO,UO).replace(OO,"-ms-"):n}var ub=function(n){return n==null||n===!1||n===""};function cf(n,e,t,r){if(Array.isArray(n)){for(var i,s=[],o=0,a=n.length;o1?e-1:0),r=1;r?@[\\\]^`{|}~-]+/g,VO=/(^-|-$)/g;function Z1(n){return n.replace(HO,"-").replace(VO,"")}var WO=function(n){return nw(BP(n)>>>0)};function Zm(n){return typeof n=="string"&&!0}var iw=function(n){return typeof n=="function"||typeof n=="object"&&n!==null&&!Array.isArray(n)},JO=function(n){return n!=="__proto__"&&n!=="constructor"&&n!=="prototype"};function jO(n,e,t){var r=n[t];iw(e)&&iw(r)?LP(r,e):n[t]=e}function LP(n){for(var e=arguments.length,t=new Array(e>1?e-1:0),r=1;r=0||(D[E]=b[E]);return D}(e,["componentId"]),C=x&&x+"-"+(Zm(_)?_:Z1(sb(_)));return kP(_,ea({},A,{attrs:p,componentId:C}),t)},Object.defineProperty(g,"defaultProps",{get:function(){return this._foldedDefaultProps},set:function(_){this._foldedDefaultProps=r?LP({},n.defaultProps,_):_}}),Object.defineProperty(g,"toString",{value:function(){return"."+g.styledComponentId}}),i&&fO(g,n,{attrs:!0,componentStyle:!0,displayName:!0,foldedComponentIds:!0,shouldForwardProp:!0,styledComponentId:!0,target:!0,withComponent:!0}),g}var sw=function(n){return function e(t,r,i){if(i===void 0&&(i=al),!Od.isValidElementType(r))return dp(1,String(r));var s=function(){return t(r,i,zO.apply(void 0,arguments))};return s.withConfig=function(o){return e(t,r,ea({},i,{},o))},s.attrs=function(o){return e(t,r,ea({},i,{attrs:Array.prototype.concat(i.attrs,o).filter(Boolean)}))},s}(kP,n)};["a","abbr","address","area","article","aside","audio","b","base","bdi","bdo","big","blockquote","body","br","button","canvas","caption","cite","code","col","colgroup","data","datalist","dd","del","details","dfn","dialog","div","dl","dt","em","embed","fieldset","figcaption","figure","footer","form","h1","h2","h3","h4","h5","h6","head","header","hgroup","hr","html","i","iframe","img","input","ins","kbd","keygen","label","legend","li","link","main","map","mark","marquee","menu","menuitem","meta","meter","nav","noscript","object","ol","optgroup","option","output","p","param","picture","pre","progress","q","rp","rt","ruby","s","samp","script","section","select","small","source","span","strong","style","sub","summary","sup","table","tbody","td","textarea","tfoot","th","thead","time","title","tr","track","u","ul","var","video","wbr","circle","clipPath","defs","ellipse","foreignObject","g","image","line","linearGradient","marker","mask","path","pattern","polygon","polyline","radialGradient","rect","stop","svg","text","textPath","tspan"].forEach(function(n){sw[n]=sw(n)});const pt=sw;var rt={},XO={get exports(){return rt},set exports(n){rt=n}},YO="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED",KO=YO,ZO=KO;function FP(){}function NP(){}NP.resetWarningCache=FP;var QO=function(){function n(r,i,s,o,a,l){if(l!==ZO){var u=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types");throw u.name="Invariant Violation",u}}n.isRequired=n;function e(){return n}var t={array:n,bigint:n,bool:n,func:n,number:n,object:n,string:n,symbol:n,any:n,arrayOf:e,element:n,elementType:n,instanceOf:e,node:n,objectOf:e,oneOf:e,oneOfType:e,shape:e,exact:e,checkPropTypes:NP,resetWarningCache:FP};return t.PropTypes=t,t};XO.exports=QO();class ti{constructor(){this._partials=new Float64Array(32),this._n=0}add(e){const t=this._partials;let r=0;for(let i=0;i0){for(o=e[--t];t>0&&(r=o,i=e[--t],o=r+i,s=i-(o-r),!s););t>0&&(s<0&&e[t-1]<0||s>0&&e[t-1]>0)&&(i=s*2,r=o+i,i==r-o&&(o=r))}return o}}function*qO(n){for(const e of n)yield*e}function OP(n){return Array.from(qO(n))}function Fc(n,e,t){n=+n,e=+e,t=(i=arguments.length)<2?(e=n,n=0,1):i<3?1:+t;for(var r=-1,i=Math.max(0,Math.ceil((e-n)/t))|0,s=new Array(i);++r0?1:n<0?-1:0},Ir=Math.sqrt,NA=Math.tan;function zP(n){return n>1?0:n<-1?jt:Math.acos(n)}function _i(n){return n>1?qn:n<-1?-qn:Math.asin(n)}function fb(n){return(n=dt(n/2))*n}function Gn(){}function iv(n,e){n&&db.hasOwnProperty(n.type)&&db[n.type](n,e)}var hb={Feature:function(n,e){iv(n.geometry,e)},FeatureCollection:function(n,e){for(var t=n.features,r=-1,i=t.length;++r=0?1:-1,i=r*t,s=_t(e),o=dt(e),a=cw*o,l=uw*s+a*_t(i),u=a*r*dt(i);sv.add(xi(u,l)),lw=n,uw=s,cw=o}function nU(n){return ov=new ti,Gs(n,So),ov*2}function av(n){return[xi(n[1],n[0]),_i(n[2])]}function Mu(n){var e=n[0],t=n[1],r=_t(t);return[r*_t(e),r*dt(e),dt(t)]}function qm(n,e){return n[0]*e[0]+n[1]*e[1]+n[2]*e[2]}function ff(n,e){return[n[1]*e[2]-n[2]*e[1],n[2]*e[0]-n[0]*e[2],n[0]*e[1]-n[1]*e[0]]}function $1(n,e){n[0]+=e[0],n[1]+=e[1],n[2]+=e[2]}function $m(n,e){return[n[0]*e,n[1]*e,n[2]*e]}function lv(n){var e=Ir(n[0]*n[0]+n[1]*n[1]+n[2]*n[2]);n[0]/=e,n[1]/=e,n[2]/=e}var Un,Bi,Yn,Zi,Zl,WP,JP,Kc,ud,za,fa,Yo={point:fw,lineStart:mb,lineEnd:gb,polygonStart:function(){Yo.point=XP,Yo.lineStart=rU,Yo.lineEnd=iU,ud=new ti,So.polygonStart()},polygonEnd:function(){So.polygonEnd(),Yo.point=fw,Yo.lineStart=mb,Yo.lineEnd=gb,sv<0?(Un=-(Yn=180),Bi=-(Zi=90)):ud>Ct?Zi=90:ud<-Ct&&(Bi=-90),fa[0]=Un,fa[1]=Yn},sphere:function(){Un=-(Yn=180),Bi=-(Zi=90)}};function fw(n,e){za.push(fa=[Un=n,Yn=n]),eZi&&(Zi=e)}function jP(n,e){var t=Mu([n*bt,e*bt]);if(Kc){var r=ff(Kc,t),i=[r[1],-r[0],0],s=ff(i,r);lv(s),s=av(s);var o=n-Zl,a=o>0?1:-1,l=s[0]*Cn*a,u,c=rn(o)>180;c^(a*ZlZi&&(Zi=u)):(l=(l+360)%360-180,c^(a*ZlZi&&(Zi=e))),c?nKi(Un,Yn)&&(Yn=n):Ki(n,Yn)>Ki(Un,Yn)&&(Un=n):Yn>=Un?(nYn&&(Yn=n)):n>Zl?Ki(Un,n)>Ki(Un,Yn)&&(Yn=n):Ki(n,Yn)>Ki(Un,Yn)&&(Un=n)}else za.push(fa=[Un=n,Yn=n]);eZi&&(Zi=e),Kc=t,Zl=n}function mb(){Yo.point=jP}function gb(){fa[0]=Un,fa[1]=Yn,Yo.point=fw,Kc=null}function XP(n,e){if(Kc){var t=n-Zl;ud.add(rn(t)>180?t+(t>0?360:-360):t)}else WP=n,JP=e;So.point(n,e),jP(n,e)}function rU(){So.lineStart()}function iU(){XP(WP,JP),So.lineEnd(),rn(ud)>Ct&&(Un=-(Yn=180)),fa[0]=Un,fa[1]=Yn,Kc=null}function Ki(n,e){return(e-=n)<0?e+360:e}function sU(n,e){return n[0]-e[0]}function vb(n,e){return n[0]<=n[1]?n[0]<=e&&e<=n[1]:eKi(r[0],r[1])&&(r[1]=i[1]),Ki(i[0],r[1])>Ki(r[0],r[1])&&(r[0]=i[0])):s.push(r=i);for(o=-1/0,t=s.length-1,e=0,r=s[t];e<=t;r=i,++e)i=s[e],(a=Ki(r[1],i[0]))>o&&(o=a,Un=i[0],Yn=r[1])}return za=fa=null,Un===1/0||Bi===1/0?[[NaN,NaN],[NaN,NaN]]:[[Un,Bi],[Yn,Zi]]}var Wh,uv,cv,fv,hv,dv,pv,mv,hw,dw,pw,YP,KP,hi,di,pi,Vs={sphere:Gn,point:OA,lineStart:yb,lineEnd:xb,polygonStart:function(){Vs.lineStart=uU,Vs.lineEnd=cU},polygonEnd:function(){Vs.lineStart=yb,Vs.lineEnd=xb}};function OA(n,e){n*=bt,e*=bt;var t=_t(e);pp(t*_t(n),t*dt(n),dt(e))}function pp(n,e,t){++Wh,cv+=(n-cv)/Wh,fv+=(e-fv)/Wh,hv+=(t-hv)/Wh}function yb(){Vs.point=aU}function aU(n,e){n*=bt,e*=bt;var t=_t(e);hi=t*_t(n),di=t*dt(n),pi=dt(e),Vs.point=lU,pp(hi,di,pi)}function lU(n,e){n*=bt,e*=bt;var t=_t(e),r=t*_t(n),i=t*dt(n),s=dt(e),o=xi(Ir((o=di*s-pi*i)*o+(o=pi*r-hi*s)*o+(o=hi*i-di*r)*o),hi*r+di*i+pi*s);uv+=o,dv+=o*(hi+(hi=r)),pv+=o*(di+(di=i)),mv+=o*(pi+(pi=s)),pp(hi,di,pi)}function xb(){Vs.point=OA}function uU(){Vs.point=fU}function cU(){ZP(YP,KP),Vs.point=OA}function fU(n,e){YP=n,KP=e,n*=bt,e*=bt,Vs.point=ZP;var t=_t(e);hi=t*_t(n),di=t*dt(n),pi=dt(e),pp(hi,di,pi)}function ZP(n,e){n*=bt,e*=bt;var t=_t(e),r=t*_t(n),i=t*dt(n),s=dt(e),o=di*s-pi*i,a=pi*r-hi*s,l=hi*i-di*r,u=ow(o,a,l),c=_i(u),f=u&&-c/u;hw.add(f*o),dw.add(f*a),pw.add(f*l),uv+=c,dv+=c*(hi+(hi=r)),pv+=c*(di+(di=i)),mv+=c*(pi+(pi=s)),pp(hi,di,pi)}function hU(n){Wh=uv=cv=fv=hv=dv=pv=mv=0,hw=new ti,dw=new ti,pw=new ti,Gs(n,Vs);var e=+hw,t=+dw,r=+pw,i=ow(e,t,r);return ijt?n+Math.round(-n/yi)*yi:n,e]}gw.invert=gw;function UA(n,e,t){return(n%=yi)?e||t?mw(wb(n),Sb(e,t)):wb(n):e||t?Sb(e,t):gw}function _b(n){return function(e,t){return e+=n,[e>jt?e-yi:e<-jt?e+yi:e,t]}}function wb(n){var e=_b(n);return e.invert=_b(-n),e}function Sb(n,e){var t=_t(n),r=dt(n),i=_t(e),s=dt(e);function o(a,l){var u=_t(l),c=_t(a)*u,f=dt(a)*u,p=dt(l),m=p*t+c*r;return[xi(f*i-m*s,c*t-p*r),_i(m*i+f*s)]}return o.invert=function(a,l){var u=_t(l),c=_t(a)*u,f=dt(a)*u,p=dt(l),m=p*i-f*s;return[xi(f*i+p*s,c*t+m*r),_i(m*t-c*r)]},o}function QP(n){n=UA(n[0]*bt,n[1]*bt,n.length>2?n[2]*bt:0);function e(t){return t=n(t[0]*bt,t[1]*bt),t[0]*=Cn,t[1]*=Cn,t}return e.invert=function(t){return t=n.invert(t[0]*bt,t[1]*bt),t[0]*=Cn,t[1]*=Cn,t},e}function qP(n,e,t,r,i,s){if(t){var o=_t(e),a=dt(e),l=r*t;i==null?(i=e+r*yi,s=e-l/2):(i=Ab(o,i),s=Ab(o,s),(r>0?is)&&(i+=r*yi));for(var u,c=i;r>0?c>s:c1&&n.push(n.pop().concat(n.shift()))},result:function(){var t=n;return n=[],e=null,t}}}function h0(n,e){return rn(n[0]-e[0])=0;--a)i.point((f=c[a])[0],f[1]);else r(p.x,p.p.x,-1,i);p=p.p}p=p.o,c=p.z,m=!m}while(!p.v);i.lineEnd()}}}function Mb(n){if(e=n.length){for(var e,t=0,r=n[0],i;++t=0?1:-1,D=B*E,U=D>jt,z=y*b;if(l.add(xi(z*B*dt(D),w*R+z*_t(D))),o+=U?E+B*yi:E,U^g>=t^A>=t){var Y=ff(Mu(m),Mu(x));lv(Y);var P=ff(s,Y);lv(P);var F=(U^E>=0?-1:1)*_i(P[2]);(r>F||r===F&&(Y[0]||Y[1]))&&(a+=U^E>=0?1:-1)}}return(o<-Ct||o0){for(l||(i.polygonStart(),l=!0),i.lineStart(),b=0;b1&&A&2&&C.push(C.pop().concat(C.shift())),c.push(C.filter(pU))}}return p}}function pU(n){return n.length>1}function mU(n,e){return((n=n.x)[0]<0?n[1]-qn-Ct:qn-n[1])-((e=e.x)[0]<0?e[1]-qn-Ct:qn-e[1])}const vw=nI(function(){return!0},gU,yU,[-jt,-qn]);function gU(n){var e=NaN,t=NaN,r=NaN,i;return{lineStart:function(){n.lineStart(),i=1},point:function(s,o){var a=s>0?jt:-jt,l=rn(s-e);rn(l-jt)0?qn:-qn),n.point(r,t),n.lineEnd(),n.lineStart(),n.point(a,t),n.point(s,t),i=0):r!==a&&l>=jt&&(rn(e-r)Ct?Rf((dt(e)*(s=_t(r))*dt(t)-dt(r)*(i=_t(e))*dt(n))/(i*s*o)):(e+r)/2}function yU(n,e,t,r){var i;if(n==null)i=t*qn,r.point(-jt,i),r.point(0,i),r.point(jt,i),r.point(jt,0),r.point(jt,-i),r.point(0,-i),r.point(-jt,-i),r.point(-jt,0),r.point(-jt,i);else if(rn(n[0]-e[0])>Ct){var s=n[0]0,i=rn(e)>Ct;function s(c,f,p,m){qP(m,n,t,p,c,f)}function o(c,f){return _t(c)*_t(f)>e}function a(c){var f,p,m,g,v;return{lineStart:function(){g=m=!1,v=1},point:function(y,w){var _=[y,w],x,A=o(y,w),C=r?A?0:u(y,w):A?u(y+(y<0?jt:-jt),w):0;if(!f&&(g=m=A)&&c.lineStart(),A!==m&&(x=l(f,_),(!x||h0(f,x)||h0(_,x))&&(_[2]=1)),A!==m)v=0,A?(c.lineStart(),x=l(_,f),c.point(x[0],x[1])):(x=l(f,_),c.point(x[0],x[1],2),c.lineEnd()),f=x;else if(i&&f&&r^A){var b;!(C&p)&&(b=l(_,f,!0))&&(v=0,r?(c.lineStart(),c.point(b[0][0],b[0][1]),c.point(b[1][0],b[1][1]),c.lineEnd()):(c.point(b[1][0],b[1][1]),c.lineEnd(),c.lineStart(),c.point(b[0][0],b[0][1],3)))}A&&(!f||!h0(f,_))&&c.point(_[0],_[1]),f=_,m=A,p=C},lineEnd:function(){m&&c.lineEnd(),f=null},clean:function(){return v|(g&&m)<<1}}}function l(c,f,p){var m=Mu(c),g=Mu(f),v=[1,0,0],y=ff(m,g),w=qm(y,y),_=y[0],x=w-_*_;if(!x)return!p&&c;var A=e*w/x,C=-e*_/x,b=ff(v,y),R=$m(v,A),E=$m(y,C);$1(R,E);var B=b,D=qm(R,B),U=qm(B,B),z=D*D-U*(qm(R,R)-1);if(!(z<0)){var Y=Ir(z),P=$m(B,(-D-Y)/U);if($1(P,R),P=av(P),!p)return P;var F=c[0],G=f[0],ie=c[1],N=f[1],V;G0^P[1]<(rn(P[0]-F)jt^(F<=P[0]&&P[0]<=G)){var Q=$m(B,(-D+Y)/U);return $1(Q,R),[P,av(Q)]}}}function u(c,f){var p=r?n:jt-n,m=0;return c<-p?m|=1:c>p&&(m|=2),f<-p?m|=4:f>p&&(m|=8),m}return nI(o,a,s,r?[0,-n]:[-jt,n-jt])}function xU(n,e,t,r,i,s){var o=n[0],a=n[1],l=e[0],u=e[1],c=0,f=1,p=l-o,m=u-a,g;if(g=t-o,!(!p&&g>0)){if(g/=p,p<0){if(g0){if(g>f)return;g>c&&(c=g)}if(g=i-o,!(!p&&g<0)){if(g/=p,p<0){if(g>f)return;g>c&&(c=g)}else if(p>0){if(g0)){if(g/=m,m<0){if(g0){if(g>f)return;g>c&&(c=g)}if(g=s-a,!(!m&&g<0)){if(g/=m,m<0){if(g>f)return;g>c&&(c=g)}else if(m>0){if(g0&&(n[0]=o+c*p,n[1]=a+c*m),f<1&&(e[0]=o+f*p,e[1]=a+f*m),!0}}}}}var Jh=1e9,tg=-Jh;function oy(n,e,t,r){function i(u,c){return n<=u&&u<=t&&e<=c&&c<=r}function s(u,c,f,p){var m=0,g=0;if(u==null||(m=o(u,f))!==(g=o(c,f))||l(u,c)<0^f>0)do p.point(m===0||m===3?n:t,m>1?r:e);while((m=(m+f+4)%4)!==g);else p.point(c[0],c[1])}function o(u,c){return rn(u[0]-n)0?0:3:rn(u[0]-t)0?2:1:rn(u[1]-e)0?1:0:c>0?3:2}function a(u,c){return l(u.x,c.x)}function l(u,c){var f=o(u,1),p=o(c,1);return f!==p?f-p:f===0?c[1]-u[1]:f===1?u[0]-c[0]:f===2?u[1]-c[1]:c[0]-u[0]}return function(u){var c=u,f=$P(),p,m,g,v,y,w,_,x,A,C,b,R={point:E,lineStart:z,lineEnd:Y,polygonStart:D,polygonEnd:U};function E(F,G){i(F,G)&&c.point(F,G)}function B(){for(var F=0,G=0,ie=m.length;Gr&&(q-k)*(r-Q)>(X-Q)*(n-k)&&++F:X<=r&&(q-k)*(r-Q)<(X-Q)*(n-k)&&--F;return F}function D(){c=f,p=[],m=[],b=!0}function U(){var F=B(),G=b&&F,ie=(p=OP(p)).length;(G||ie)&&(u.polygonStart(),G&&(u.lineStart(),s(null,null,1,u),u.lineEnd()),ie&&eI(p,a,F,s,u),u.polygonEnd()),c=u,p=m=g=null}function z(){R.point=P,m&&m.push(g=[]),C=!0,A=!1,_=x=NaN}function Y(){p&&(P(v,y),w&&A&&f.rejoin(),p.push(f.result())),R.point=E,A&&c.lineEnd()}function P(F,G){var ie=i(F,G);if(m&&g.push([F,G]),C)v=F,y=G,w=ie,C=!1,ie&&(c.lineStart(),c.point(F,G));else if(ie&&A)c.point(F,G);else{var N=[_=Math.max(tg,Math.min(Jh,_)),x=Math.max(tg,Math.min(Jh,x))],V=[F=Math.max(tg,Math.min(Jh,F)),G=Math.max(tg,Math.min(Jh,G))];xU(N,V,n,e,t,r)?(A||(c.lineStart(),c.point(N[0],N[1])),c.point(V[0],V[1]),ie||c.lineEnd(),b=!1):ie&&(c.lineStart(),c.point(F,G),b=!1)}_=F,x=G,A=ie}return R}}function _U(){var n=0,e=0,t=960,r=500,i,s,o;return o={stream:function(a){return i&&s===a?i:i=oy(n,e,t,r)(s=a)},extent:function(a){return arguments.length?(n=+a[0][0],e=+a[0][1],t=+a[1][0],r=+a[1][1],i=s=null,o):[[n,e],[t,r]]}}}var yw,xw,d0,p0,hf={sphere:Gn,point:Gn,lineStart:wU,lineEnd:Gn,polygonStart:Gn,polygonEnd:Gn};function wU(){hf.point=AU,hf.lineEnd=SU}function SU(){hf.point=hf.lineEnd=Gn}function AU(n,e){n*=bt,e*=bt,xw=n,d0=dt(e),p0=_t(e),hf.point=MU}function MU(n,e){n*=bt,e*=bt;var t=dt(e),r=_t(e),i=rn(n-xw),s=_t(i),o=dt(i),a=r*o,l=p0*t-d0*r*s,u=d0*t+p0*r*s;yw.add(xi(Ir(a*a+l*l),u)),xw=n,d0=t,p0=r}function iI(n){return yw=new ti,Gs(n,hf),+yw}var _w=[null,null],EU={type:"LineString",coordinates:_w};function gv(n,e){return _w[0]=n,_w[1]=e,iI(EU)}var Eb={Feature:function(n,e){return vv(n.geometry,e)},FeatureCollection:function(n,e){for(var t=n.features,r=-1,i=t.length;++r0&&(i=gv(n[s],n[s-1]),i>0&&t<=i&&r<=i&&(t+r-i)*(1-Math.pow((t-r)/i,2))Ct}).map(p)).concat(Fc(Qm(s/u)*u,i,u).filter(function(x){return rn(x%f)>Ct}).map(m))}return w.lines=function(){return _().map(function(x){return{type:"LineString",coordinates:x}})},w.outline=function(){return{type:"Polygon",coordinates:[g(r).concat(v(o).slice(1),g(t).reverse().slice(1),v(a).reverse().slice(1))]}},w.extent=function(x){return arguments.length?w.extentMajor(x).extentMinor(x):w.extentMinor()},w.extentMajor=function(x){return arguments.length?(r=+x[0][0],t=+x[1][0],a=+x[0][1],o=+x[1][1],r>t&&(x=r,r=t,t=x),a>o&&(x=a,a=o,o=x),w.precision(y)):[[r,a],[t,o]]},w.extentMinor=function(x){return arguments.length?(e=+x[0][0],n=+x[1][0],s=+x[0][1],i=+x[1][1],e>n&&(x=e,e=n,n=x),s>i&&(x=s,s=i,i=x),w.precision(y)):[[e,s],[n,i]]},w.step=function(x){return arguments.length?w.stepMajor(x).stepMinor(x):w.stepMinor()},w.stepMajor=function(x){return arguments.length?(c=+x[0],f=+x[1],w):[c,f]},w.stepMinor=function(x){return arguments.length?(l=+x[0],u=+x[1],w):[l,u]},w.precision=function(x){return arguments.length?(y=+x,p=Bb(s,i,90),m=Pb(e,n,y),g=Bb(a,o,90),v=Pb(r,t,y),w):y},w.extentMajor([[-180,-90+Ct],[180,90-Ct]]).extentMinor([[-180,-80-Ct],[180,80+Ct]])}function TU(){return zA()()}function RU(n,e){var t=n[0]*bt,r=n[1]*bt,i=e[0]*bt,s=e[1]*bt,o=_t(r),a=dt(r),l=_t(s),u=dt(s),c=o*_t(t),f=o*dt(t),p=l*_t(i),m=l*dt(i),g=2*_i(Ir(fb(s-r)+o*l*fb(i-t))),v=dt(g),y=g?function(w){var _=dt(w*=g)/v,x=dt(g-w)/v,A=x*c+_*p,C=x*f+_*m,b=x*a+_*u;return[xi(C,A)*Cn,xi(b,Ir(A*A+C*C))*Cn]}:function(){return[t*Cn,r*Cn]};return y.distance=g,y}const Gd=n=>n;var tx=new ti,ww=new ti,oI,aI,Sw,Aw,ja={point:Gn,lineStart:Gn,lineEnd:Gn,polygonStart:function(){ja.lineStart=BU,ja.lineEnd=IU},polygonEnd:function(){ja.lineStart=ja.lineEnd=ja.point=Gn,tx.add(rn(ww)),ww=new ti},result:function(){var n=tx/2;return tx=new ti,n}};function BU(){ja.point=PU}function PU(n,e){ja.point=lI,oI=Sw=n,aI=Aw=e}function lI(n,e){ww.add(Aw*n-Sw*e),Sw=n,Aw=e}function IU(){lI(oI,aI)}const Ib=ja;var df=1/0,yv=df,Hd=-df,xv=Hd,LU={point:DU,lineStart:Gn,lineEnd:Gn,polygonStart:Gn,polygonEnd:Gn,result:function(){var n=[[df,yv],[Hd,xv]];return Hd=xv=-(yv=df=1/0),n}};function DU(n,e){nHd&&(Hd=n),exv&&(xv=e)}const _v=LU;var Mw=0,Ew=0,jh=0,wv=0,Sv=0,Nc=0,Cw=0,bw=0,Xh=0,uI,cI,ho,po,Hs={point:Eu,lineStart:Lb,lineEnd:Db,polygonStart:function(){Hs.lineStart=NU,Hs.lineEnd=OU},polygonEnd:function(){Hs.point=Eu,Hs.lineStart=Lb,Hs.lineEnd=Db},result:function(){var n=Xh?[Cw/Xh,bw/Xh]:Nc?[wv/Nc,Sv/Nc]:jh?[Mw/jh,Ew/jh]:[NaN,NaN];return Mw=Ew=jh=wv=Sv=Nc=Cw=bw=Xh=0,n}};function Eu(n,e){Mw+=n,Ew+=e,++jh}function Lb(){Hs.point=kU}function kU(n,e){Hs.point=FU,Eu(ho=n,po=e)}function FU(n,e){var t=n-ho,r=e-po,i=Ir(t*t+r*r);wv+=i*(ho+n)/2,Sv+=i*(po+e)/2,Nc+=i,Eu(ho=n,po=e)}function Db(){Hs.point=Eu}function NU(){Hs.point=UU}function OU(){fI(uI,cI)}function UU(n,e){Hs.point=fI,Eu(uI=ho=n,cI=po=e)}function fI(n,e){var t=n-ho,r=e-po,i=Ir(t*t+r*r);wv+=i*(ho+n)/2,Sv+=i*(po+e)/2,Nc+=i,i=po*n-ho*e,Cw+=i*(ho+n),bw+=i*(po+e),Xh+=i*3,Eu(ho=n,po=e)}const kb=Hs;function hI(n){this._context=n}hI.prototype={_radius:4.5,pointRadius:function(n){return this._radius=n,this},polygonStart:function(){this._line=0},polygonEnd:function(){this._line=NaN},lineStart:function(){this._point=0},lineEnd:function(){this._line===0&&this._context.closePath(),this._point=NaN},point:function(n,e){switch(this._point){case 0:{this._context.moveTo(n,e),this._point=1;break}case 1:{this._context.lineTo(n,e);break}default:{this._context.moveTo(n+this._radius,e),this._context.arc(n,e,this._radius,0,yi);break}}},result:Gn};var Tw=new ti,nx,dI,pI,Yh,Kh,Av={point:Gn,lineStart:function(){Av.point=zU},lineEnd:function(){nx&&mI(dI,pI),Av.point=Gn},polygonStart:function(){nx=!0},polygonEnd:function(){nx=null},result:function(){var n=+Tw;return Tw=new ti,n}};function zU(n,e){Av.point=mI,dI=Yh=n,pI=Kh=e}function mI(n,e){Yh-=n,Kh-=e,Tw.add(Ir(Yh*Yh+Kh*Kh)),Yh=n,Kh=e}const Fb=Av;function gI(){this._string=[]}gI.prototype={_radius:4.5,_circle:Nb(4.5),pointRadius:function(n){return(n=+n)!==this._radius&&(this._radius=n,this._circle=null),this},polygonStart:function(){this._line=0},polygonEnd:function(){this._line=NaN},lineStart:function(){this._point=0},lineEnd:function(){this._line===0&&this._string.push("Z"),this._point=NaN},point:function(n,e){switch(this._point){case 0:{this._string.push("M",n,",",e),this._point=1;break}case 1:{this._string.push("L",n,",",e);break}default:{this._circle==null&&(this._circle=Nb(this._radius)),this._string.push("M",n,",",e,this._circle);break}}},result:function(){if(this._string.length){var n=this._string.join("");return this._string=[],n}else return null}};function Nb(n){return"m0,"+n+"a"+n+","+n+" 0 1,1 0,"+-2*n+"a"+n+","+n+" 0 1,1 0,"+2*n+"z"}function vI(n,e){var t=4.5,r,i;function s(o){return o&&(typeof t=="function"&&i.pointRadius(+t.apply(this,arguments)),Gs(o,r(i))),i.result()}return s.area=function(o){return Gs(o,r(Ib)),Ib.result()},s.measure=function(o){return Gs(o,r(Fb)),Fb.result()},s.bounds=function(o){return Gs(o,r(_v)),_v.result()},s.centroid=function(o){return Gs(o,r(kb)),kb.result()},s.projection=function(o){return arguments.length?(r=o==null?(n=null,Gd):(n=o).stream,s):n},s.context=function(o){return arguments.length?(i=o==null?(e=null,new gI):new hI(e=o),typeof t!="function"&&i.pointRadius(t),s):e},s.pointRadius=function(o){return arguments.length?(t=typeof o=="function"?o:(i.pointRadius(+o),+o),s):t},s.projection(n).context(e)}function GU(n){return{stream:mp(n)}}function mp(n){return function(e){var t=new Rw;for(var r in n)t[r]=n[r];return t.stream=e,t}}function Rw(){}Rw.prototype={constructor:Rw,point:function(n,e){this.stream.point(n,e)},sphere:function(){this.stream.sphere()},lineStart:function(){this.stream.lineStart()},lineEnd:function(){this.stream.lineEnd()},polygonStart:function(){this.stream.polygonStart()},polygonEnd:function(){this.stream.polygonEnd()}};function GA(n,e,t){var r=n.clipExtent&&n.clipExtent();return n.scale(150).translate([0,0]),r!=null&&n.clipExtent(null),Gs(t,n.stream(_v)),e(_v.result()),r!=null&&n.clipExtent(r),n}function ay(n,e,t){return GA(n,function(r){var i=e[1][0]-e[0][0],s=e[1][1]-e[0][1],o=Math.min(i/(r[1][0]-r[0][0]),s/(r[1][1]-r[0][1])),a=+e[0][0]+(i-o*(r[1][0]+r[0][0]))/2,l=+e[0][1]+(s-o*(r[1][1]+r[0][1]))/2;n.scale(150*o).translate([a,l])},t)}function HA(n,e,t){return ay(n,[[0,0],e],t)}function VA(n,e,t){return GA(n,function(r){var i=+e,s=i/(r[1][0]-r[0][0]),o=(i-s*(r[1][0]+r[0][0]))/2,a=-s*r[0][1];n.scale(150*s).translate([o,a])},t)}function WA(n,e,t){return GA(n,function(r){var i=+e,s=i/(r[1][1]-r[0][1]),o=-s*r[0][0],a=(i-s*(r[1][1]+r[0][1]))/2;n.scale(150*s).translate([o,a])},t)}var Ob=16,HU=_t(30*bt);function Ub(n,e){return+e?WU(n,e):VU(n)}function VU(n){return mp({point:function(e,t){e=n(e,t),this.stream.point(e[0],e[1])}})}function WU(n,e){function t(r,i,s,o,a,l,u,c,f,p,m,g,v,y){var w=u-r,_=c-i,x=w*w+_*_;if(x>4*e&&v--){var A=o+p,C=a+m,b=l+g,R=Ir(A*A+C*C+b*b),E=_i(b/=R),B=rn(rn(b)-1)e||rn((w*Y+_*P)/x-.5)>.3||o*p+a*m+l*g2?F[2]%360*bt:0,Y()):[a*Cn,l*Cn,u*Cn]},U.angle=function(F){return arguments.length?(f=F%360*bt,Y()):f*Cn},U.reflectX=function(F){return arguments.length?(p=F?-1:1,Y()):p<0},U.reflectY=function(F){return arguments.length?(m=F?-1:1,Y()):m<0},U.precision=function(F){return arguments.length?(b=Ub(R,C=F*F),P()):Ir(C)},U.fitExtent=function(F,G){return ay(U,F,G)},U.fitSize=function(F,G){return HA(U,F,G)},U.fitWidth=function(F,G){return VA(U,F,G)},U.fitHeight=function(F,G){return WA(U,F,G)};function Y(){var F=zb(t,0,0,p,m,f).apply(null,e(s,o)),G=zb(t,r-F[0],i-F[1],p,m,f);return c=UA(a,l,u),R=mw(e,G),E=mw(c,R),b=Ub(R,C),P()}function P(){return B=D=null,U}return function(){return e=n.apply(this,arguments),U.invert=e.invert&&z,Y()}}function jA(n){var e=0,t=jt/3,r=JA(n),i=r(e,t);return i.parallels=function(s){return arguments.length?r(e=s[0]*bt,t=s[1]*bt):[e*Cn,t*Cn]},i}function YU(n){var e=_t(n);function t(r,i){return[r*e,dt(i)/e]}return t.invert=function(r,i){return[r/e,_i(i*e)]},t}function yI(n,e){var t=dt(n),r=(t+dt(e))/2;if(rn(r)=.12&&y<.234&&v>=-.425&&v<-.214?i:y>=.166&&y<.234&&v>=-.214&&v<-.115?o:t).invert(p)},c.stream=function(p){return n&&e===p?n:n=KU([t.stream(e=p),i.stream(p),o.stream(p)])},c.precision=function(p){return arguments.length?(t.precision(p),i.precision(p),o.precision(p),f()):t.precision()},c.scale=function(p){return arguments.length?(t.scale(p),i.scale(p*.35),o.scale(p),c.translate(t.translate())):t.scale()},c.translate=function(p){if(!arguments.length)return t.translate();var m=t.scale(),g=+p[0],v=+p[1];return r=t.translate(p).clipExtent([[g-.455*m,v-.238*m],[g+.455*m,v+.238*m]]).stream(u),s=i.translate([g-.307*m,v+.201*m]).clipExtent([[g-.425*m+Ct,v+.12*m+Ct],[g-.214*m-Ct,v+.234*m-Ct]]).stream(u),a=o.translate([g-.205*m,v+.212*m]).clipExtent([[g-.214*m+Ct,v+.166*m+Ct],[g-.115*m-Ct,v+.234*m-Ct]]).stream(u),f()},c.fitExtent=function(p,m){return ay(c,p,m)},c.fitSize=function(p,m){return HA(c,p,m)},c.fitWidth=function(p,m){return VA(c,p,m)},c.fitHeight=function(p,m){return WA(c,p,m)};function f(){return n=e=null,c}return c.scale(1070)}function _I(n){return function(e,t){var r=_t(e),i=_t(t),s=n(r*i);return s===1/0?[2,0]:[s*i*dt(e),s*dt(t)]}}function gp(n){return function(e,t){var r=Ir(e*e+t*t),i=n(r),s=dt(i),o=_t(i);return[xi(e*s,r*o),_i(r&&t*s/r)]}}var XA=_I(function(n){return Ir(2/(1+n))});XA.invert=gp(function(n){return 2*_i(n/2)});function QU(){return Mo(XA).scale(124.75).clipAngle(180-.001)}var YA=_I(function(n){return(n=zP(n))&&n/dt(n)});YA.invert=gp(function(n){return n});function qU(){return Mo(YA).scale(79.4188).clipAngle(180-.001)}function vp(n,e){return[n,rv(NA((qn+e)/2))]}vp.invert=function(n,e){return[n,2*Rf(UP(e))-qn]};function $U(){return wI(vp).scale(961/yi)}function wI(n){var e=Mo(n),t=e.center,r=e.scale,i=e.translate,s=e.clipExtent,o=null,a,l,u;e.scale=function(f){return arguments.length?(r(f),c()):r()},e.translate=function(f){return arguments.length?(i(f),c()):i()},e.center=function(f){return arguments.length?(t(f),c()):t()},e.clipExtent=function(f){return arguments.length?(f==null?o=a=l=u=null:(o=+f[0][0],a=+f[0][1],l=+f[1][0],u=+f[1][1]),c()):o==null?null:[[o,a],[l,u]]};function c(){var f=jt*r(),p=e(QP(e.rotate()).invert([0,0]));return s(o==null?[[p[0]-f,p[1]-f],[p[0]+f,p[1]+f]]:n===vp?[[Math.max(p[0]-f,o),a],[Math.min(p[0]+f,l),u]]:[[o,Math.max(p[1]-f,a)],[l,Math.min(p[1]+f,u)]])}return c()}function ng(n){return NA((qn+n)/2)}function SI(n,e){var t=_t(n),r=n===e?dt(n):rv(t/_t(e))/rv(ng(e)/ng(n)),i=t*q1(ng(n),r)/r;if(!r)return vp;function s(o,a){i>0?a<-qn+Ct&&(a=-qn+Ct):a>qn-Ct&&(a=qn-Ct);var l=i/q1(ng(a),r);return[l*dt(r*o),i-l*_t(r*o)]}return s.invert=function(o,a){var l=i-a,u=As(r)*Ir(o*o+l*l),c=xi(o,rn(l))*As(l);return l*r<0&&(c-=jt*As(o)*As(l)),[c/r,2*Rf(q1(i/u,1/r))-qn]},s}function ez(){return jA(SI).scale(109.5).parallels([30,30])}function Vd(n,e){return[n,e]}Vd.invert=Vd;function tz(){return Mo(Vd).scale(152.63)}function AI(n,e){var t=_t(n),r=n===e?dt(n):(t-_t(e))/(e-n),i=t/r+n;if(rn(r)Ct&&--r>0);return[n/(.8707+(s=t*t)*(-.131979+s*(-.013791+s*s*s*(.003971-.001529*s)))),t]};function az(){return Mo(QA).scale(175.295)}function qA(n,e){return[_t(e)*dt(n),dt(e)]}qA.invert=gp(_i);function lz(){return Mo(qA).scale(249.5).clipAngle(90+Ct)}function $A(n,e){var t=_t(e),r=1+_t(n)*t;return[t*dt(n)/r,dt(e)/r]}$A.invert=gp(function(n){return 2*Rf(n)});function uz(){return Mo($A).scale(250).clipAngle(142)}function eM(n,e){return[rv(NA((qn+e)/2)),-n]}eM.invert=function(n,e){return[-e,2*Rf(UP(n))-qn]};function cz(){var n=wI(eM),e=n.center,t=n.rotate;return n.center=function(r){return arguments.length?e([-r[1],r[0]]):(r=e(),[r[1],-r[0]])},n.rotate=function(r){return arguments.length?t([r[0],r[1],r.length>2?r[2]+90:90]):(r=t(),[r[0],r[1],r[2]-90])},t([0,0,90]).scale(159.155)}const fz=Object.freeze(Object.defineProperty({__proto__:null,geoAlbers:xI,geoAlbersUsa:ZU,geoArea:nU,geoAzimuthalEqualArea:QU,geoAzimuthalEqualAreaRaw:XA,geoAzimuthalEquidistant:qU,geoAzimuthalEquidistantRaw:YA,geoBounds:oU,geoCentroid:hU,geoCircle:dU,geoClipAntimeridian:vw,geoClipCircle:rI,geoClipExtent:_U,geoClipRectangle:oy,geoConicConformal:ez,geoConicConformalRaw:SI,geoConicEqualArea:Mv,geoConicEqualAreaRaw:yI,geoConicEquidistant:nz,geoConicEquidistantRaw:AI,geoContains:bU,geoDistance:gv,geoEqualEarth:iz,geoEqualEarthRaw:KA,geoEquirectangular:tz,geoEquirectangularRaw:Vd,geoGnomonic:sz,geoGnomonicRaw:ZA,geoGraticule:zA,geoGraticule10:TU,geoIdentity:oz,geoInterpolate:RU,geoLength:iI,geoMercator:$U,geoMercatorRaw:vp,geoNaturalEarth1:az,geoNaturalEarth1Raw:QA,geoOrthographic:lz,geoOrthographicRaw:qA,geoPath:vI,geoProjection:Mo,geoProjectionMutator:JA,geoRotation:QP,geoStereographic:uz,geoStereographicRaw:$A,geoStream:Gs,geoTransform:GU,geoTransverseMercator:cz,geoTransverseMercatorRaw:eM},Symbol.toStringTag,{value:"Module"}));function hz(n){return n}function dz(n){if(n==null)return hz;var e,t,r=n.scale[0],i=n.scale[1],s=n.translate[0],o=n.translate[1];return function(a,l){l||(e=t=0);var u=2,c=a.length,f=new Array(c);for(f[0]=(e+=a[0])*r+s,f[1]=(t+=a[1])*i+o;u1)r=yz(n,e,t);else for(i=0,r=new Array(s=n.arcs.length);i{}};function tM(){for(var n=0,e=arguments.length,t={},r;n=0&&(r=t.slice(i+1),t=t.slice(0,i)),t&&!e.hasOwnProperty(t))throw new Error("unknown type: "+t);return{type:t,name:r}})}m0.prototype=tM.prototype={constructor:m0,on:function(n,e){var t=this._,r=_z(n+"",t),i,s=-1,o=r.length;if(arguments.length<2){for(;++s0)for(var t=new Array(i),r=0,i,s;r=0&&(e=n.slice(0,t))!=="xmlns"&&(n=n.slice(t+1)),Wb.hasOwnProperty(e)?{space:Wb[e],local:n}:n}function Sz(n){return function(){var e=this.ownerDocument,t=this.namespaceURI;return t===Bw&&e.documentElement.namespaceURI===Bw?e.createElement(n):e.createElementNS(t,n)}}function Az(n){return function(){return this.ownerDocument.createElementNS(n.space,n.local)}}function EI(n){var e=ly(n);return(e.local?Az:Sz)(e)}function Mz(){}function nM(n){return n==null?Mz:function(){return this.querySelector(n)}}function Ez(n){typeof n!="function"&&(n=nM(n));for(var e=this._groups,t=e.length,r=new Array(t),i=0;i=x&&(x=_+1);!(C=y[x])&&++x=0;)(o=r[i])&&(s&&o.compareDocumentPosition(s)^4&&s.parentNode.insertBefore(o,s),s=o);return this}function Yz(n){n||(n=Kz);function e(f,p){return f&&p?n(f.__data__,p.__data__):!f-!p}for(var t=this._groups,r=t.length,i=new Array(r),s=0;se?1:n>=e?0:NaN}function Zz(){var n=arguments[0];return arguments[0]=this,n.apply(null,arguments),this}function Qz(){return Array.from(this)}function qz(){for(var n=this._groups,e=0,t=n.length;e1?this.each((e==null?u5:typeof e=="function"?f5:c5)(n,e,t??"")):pf(this.node(),n)}function pf(n,e){return n.style.getPropertyValue(e)||PI(n).getComputedStyle(n,null).getPropertyValue(e)}function d5(n){return function(){delete this[n]}}function p5(n,e){return function(){this[n]=e}}function m5(n,e){return function(){var t=e.apply(this,arguments);t==null?delete this[n]:this[n]=t}}function g5(n,e){return arguments.length>1?this.each((e==null?d5:typeof e=="function"?m5:p5)(n,e)):this.node()[n]}function II(n){return n.trim().split(/^|\s+/)}function rM(n){return n.classList||new LI(n)}function LI(n){this._node=n,this._names=II(n.getAttribute("class")||"")}LI.prototype={add:function(n){var e=this._names.indexOf(n);e<0&&(this._names.push(n),this._node.setAttribute("class",this._names.join(" ")))},remove:function(n){var e=this._names.indexOf(n);e>=0&&(this._names.splice(e,1),this._node.setAttribute("class",this._names.join(" ")))},contains:function(n){return this._names.indexOf(n)>=0}};function DI(n,e){for(var t=rM(n),r=-1,i=e.length;++r=0&&(t=e.slice(r+1),e=e.slice(0,r)),{type:e,name:t}})}function W5(n){return function(){var e=this.__on;if(e){for(var t=0,r=-1,i=e.length,s;t>8&15|e>>4&240,e>>4&15|e&240,(e&15)<<4|e&15,1):t===8?rg(e>>24&255,e>>16&255,e>>8&255,(e&255)/255):t===4?rg(e>>12&15|e>>8&240,e>>8&15|e>>4&240,e>>4&15|e&240,((e&15)<<4|e&15)/255):null):(e=n6.exec(n))?new qi(e[1],e[2],e[3],1):(e=r6.exec(n))?new qi(e[1]*255/100,e[2]*255/100,e[3]*255/100,1):(e=i6.exec(n))?rg(e[1],e[2],e[3],e[4]):(e=s6.exec(n))?rg(e[1]*255/100,e[2]*255/100,e[3]*255/100,e[4]):(e=o6.exec(n))?Qb(e[1],e[2]/100,e[3]/100,1):(e=a6.exec(n))?Qb(e[1],e[2]/100,e[3]/100,e[4]):Jb.hasOwnProperty(n)?Yb(Jb[n]):n==="transparent"?new qi(NaN,NaN,NaN,0):null}function Yb(n){return new qi(n>>16&255,n>>8&255,n&255,1)}function rg(n,e,t,r){return r<=0&&(n=e=t=NaN),new qi(n,e,t,r)}function u6(n){return n instanceof xp||(n=jd(n)),n?(n=n.rgb(),new qi(n.r,n.g,n.b,n.opacity)):new qi}function Iw(n,e,t,r){return arguments.length===1?u6(n):new qi(n,e,t,r??1)}function qi(n,e,t,r){this.r=+n,this.g=+e,this.b=+t,this.opacity=+r}iM(qi,Iw,OI(xp,{brighter:function(n){return n=n==null?bv:Math.pow(bv,n),new qi(this.r*n,this.g*n,this.b*n,this.opacity)},darker:function(n){return n=n==null?Wd:Math.pow(Wd,n),new qi(this.r*n,this.g*n,this.b*n,this.opacity)},rgb:function(){return this},displayable:function(){return-.5<=this.r&&this.r<255.5&&-.5<=this.g&&this.g<255.5&&-.5<=this.b&&this.b<255.5&&0<=this.opacity&&this.opacity<=1},hex:Kb,formatHex:Kb,formatRgb:Zb,toString:Zb}));function Kb(){return"#"+rx(this.r)+rx(this.g)+rx(this.b)}function Zb(){var n=this.opacity;return n=isNaN(n)?1:Math.max(0,Math.min(1,n)),(n===1?"rgb(":"rgba(")+Math.max(0,Math.min(255,Math.round(this.r)||0))+", "+Math.max(0,Math.min(255,Math.round(this.g)||0))+", "+Math.max(0,Math.min(255,Math.round(this.b)||0))+(n===1?")":", "+n+")")}function rx(n){return n=Math.max(0,Math.min(255,Math.round(n)||0)),(n<16?"0":"")+n.toString(16)}function Qb(n,e,t,r){return r<=0?n=e=t=NaN:t<=0||t>=1?n=e=NaN:e<=0&&(n=NaN),new mo(n,e,t,r)}function UI(n){if(n instanceof mo)return new mo(n.h,n.s,n.l,n.opacity);if(n instanceof xp||(n=jd(n)),!n)return new mo;if(n instanceof mo)return n;n=n.rgb();var e=n.r/255,t=n.g/255,r=n.b/255,i=Math.min(e,t,r),s=Math.max(e,t,r),o=NaN,a=s-i,l=(s+i)/2;return a?(e===s?o=(t-r)/a+(t0&&l<1?0:o,new mo(o,a,l,n.opacity)}function c6(n,e,t,r){return arguments.length===1?UI(n):new mo(n,e,t,r??1)}function mo(n,e,t,r){this.h=+n,this.s=+e,this.l=+t,this.opacity=+r}iM(mo,c6,OI(xp,{brighter:function(n){return n=n==null?bv:Math.pow(bv,n),new mo(this.h,this.s,this.l*n,this.opacity)},darker:function(n){return n=n==null?Wd:Math.pow(Wd,n),new mo(this.h,this.s,this.l*n,this.opacity)},rgb:function(){var n=this.h%360+(this.h<0)*360,e=isNaN(n)||isNaN(this.s)?0:this.s,t=this.l,r=t+(t<.5?t:1-t)*e,i=2*t-r;return new qi(ix(n>=240?n-240:n+120,i,r),ix(n,i,r),ix(n<120?n+240:n-120,i,r),this.opacity)},displayable:function(){return(0<=this.s&&this.s<=1||isNaN(this.s))&&0<=this.l&&this.l<=1&&0<=this.opacity&&this.opacity<=1},formatHsl:function(){var n=this.opacity;return n=isNaN(n)?1:Math.max(0,Math.min(1,n)),(n===1?"hsl(":"hsla(")+(this.h||0)+", "+(this.s||0)*100+"%, "+(this.l||0)*100+"%"+(n===1?")":", "+n+")")}}));function ix(n,e,t){return(n<60?e+(t-e)*n/60:n<180?t:n<240?e+(t-e)*(240-n)/60:e)*255}const zI=n=>()=>n;function f6(n,e){return function(t){return n+t*e}}function h6(n,e,t){return n=Math.pow(n,t),e=Math.pow(e,t)-n,t=1/t,function(r){return Math.pow(n+r*e,t)}}function d6(n){return(n=+n)==1?GI:function(e,t){return t-e?h6(e,t,n):zI(isNaN(e)?t:e)}}function GI(n,e){var t=e-n;return t?f6(n,t):zI(isNaN(n)?e:n)}const qb=function n(e){var t=d6(e);function r(i,s){var o=t((i=Iw(i)).r,(s=Iw(s)).r),a=t(i.g,s.g),l=t(i.b,s.b),u=GI(i.opacity,s.opacity);return function(c){return i.r=o(c),i.g=a(c),i.b=l(c),i.opacity=u(c),i+""}}return r.gamma=n,r}(1);function Ga(n,e){return n=+n,e=+e,function(t){return n*(1-t)+e*t}}var Lw=/[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g,sx=new RegExp(Lw.source,"g");function p6(n){return function(){return n}}function m6(n){return function(e){return n(e)+""}}function g6(n,e){var t=Lw.lastIndex=sx.lastIndex=0,r,i,s,o=-1,a=[],l=[];for(n=n+"",e=e+"";(r=Lw.exec(n))&&(i=sx.exec(e));)(s=i.index)>t&&(s=e.slice(t,s),a[o]?a[o]+=s:a[++o]=s),(r=r[0])===(i=i[0])?a[o]?a[o]+=i:a[++o]=i:(a[++o]=null,l.push({i:o,x:Ga(r,i)})),t=sx.lastIndex;return t180?c+=360:c-u>180&&(u+=360),p.push({i:f.push(i(f)+"rotate(",null,r)-2,x:Ga(u,c)})):c&&f.push(i(f)+"rotate("+c+r)}function a(u,c,f,p){u!==c?p.push({i:f.push(i(f)+"skewX(",null,r)-2,x:Ga(u,c)}):c&&f.push(i(f)+"skewX("+c+r)}function l(u,c,f,p,m,g){if(u!==f||c!==p){var v=m.push(i(m)+"scale(",null,",",null,")");g.push({i:v-4,x:Ga(u,f)},{i:v-2,x:Ga(c,p)})}else(f!==1||p!==1)&&m.push(i(m)+"scale("+f+","+p+")")}return function(u,c){var f=[],p=[];return u=n(u),c=n(c),s(u.translateX,u.translateY,c.translateX,c.translateY,f,p),o(u.rotate,c.rotate,f,p),a(u.skewX,c.skewX,f,p),l(u.scaleX,u.scaleY,c.scaleX,c.scaleY,f,p),u=c=null,function(m){for(var g=-1,v=p.length,y;++g=0&&n._call.call(null,e),n=n._next;--mf}function tT(){Cu=(Rv=Xd.now())+uy,mf=Zh=0;try{C6()}finally{mf=0,T6(),Cu=0}}function b6(){var n=Xd.now(),e=n-Rv;e>WI&&(uy-=e,Rv=n)}function T6(){for(var n,e=Tv,t,r=1/0;e;)e._call?(r>e._time&&(r=e._time),n=e,e=e._next):(t=e._next,e._next=null,e=n?n._next=t:Tv=t);Qh=n,kw(r)}function kw(n){if(!mf){Zh&&(Zh=clearTimeout(Zh));var e=n-Cu;e>24?(n<1/0&&(Zh=setTimeout(tT,n-Xd.now()-uy)),xh&&(xh=clearInterval(xh))):(xh||(Rv=Xd.now(),xh=setInterval(b6,WI)),mf=1,JI(tT))}}function nT(n,e,t){var r=new Bv;return e=e==null?0:+e,r.restart(i=>{r.stop(),n(i+e)},e,t),r}var R6=tM("start","end","cancel","interrupt"),B6=[],XI=0,rT=1,Fw=2,g0=3,iT=4,Nw=5,v0=6;function cy(n,e,t,r,i,s){var o=n.__transition;if(!o)n.__transition={};else if(t in o)return;P6(n,t,{name:e,index:r,group:i,on:R6,tween:B6,time:s.time,delay:s.delay,duration:s.duration,ease:s.ease,timer:null,state:XI})}function oM(n,e){var t=Ks(n,e);if(t.state>XI)throw new Error("too late; already scheduled");return t}function Eo(n,e){var t=Ks(n,e);if(t.state>g0)throw new Error("too late; already running");return t}function Ks(n,e){var t=n.__transition;if(!t||!(t=t[e]))throw new Error("transition not found");return t}function P6(n,e,t){var r=n.__transition,i;r[e]=t,t.timer=jI(s,0,t.time);function s(u){t.state=rT,t.timer.restart(o,t.delay,t.time),t.delay<=u&&o(u-t.delay)}function o(u){var c,f,p,m;if(t.state!==rT)return l();for(c in r)if(m=r[c],m.name===t.name){if(m.state===g0)return nT(o);m.state===iT?(m.state=v0,m.timer.stop(),m.on.call("interrupt",n,n.__data__,m.index,m.group),delete r[c]):+cFw&&r.state=0&&(e=e.slice(0,t)),!e||e==="start"})}function aG(n,e,t){var r,i,s=oG(e)?oM:Eo;return function(){var o=s(this,n),a=o.on;a!==r&&(i=(r=a).copy()).on(e,t),o.on=i}}function lG(n,e){var t=this._id;return arguments.length<2?Ks(this.node(),t).on.on(n):this.each(aG(t,n,e))}function uG(n){return function(){var e=this.parentNode;for(var t in this.__transition)if(+t!==n)return;e&&e.removeChild(this)}}function cG(){return this.on("end.remove",uG(this._id))}function fG(n){var e=this._name,t=this._id;typeof n!="function"&&(n=nM(n));for(var r=this._groups,i=r.length,s=new Array(i),o=0;o()=>n;function FG(n,{sourceEvent:e,target:t,transform:r,dispatch:i}){Object.defineProperties(this,{type:{value:n,enumerable:!0,configurable:!0},sourceEvent:{value:e,enumerable:!0,configurable:!0},target:{value:t,enumerable:!0,configurable:!0},transform:{value:r,enumerable:!0,configurable:!0},_:{value:i}})}function ta(n,e,t){this.k=n,this.x=e,this.y=t}ta.prototype={constructor:ta,scale:function(n){return n===1?this:new ta(this.k*n,this.x,this.y)},translate:function(n,e){return n===0&e===0?this:new ta(this.k,this.x+this.k*n,this.y+this.k*e)},apply:function(n){return[n[0]*this.k+this.x,n[1]*this.k+this.y]},applyX:function(n){return n*this.k+this.x},applyY:function(n){return n*this.k+this.y},invert:function(n){return[(n[0]-this.x)/this.k,(n[1]-this.y)/this.k]},invertX:function(n){return(n-this.x)/this.k},invertY:function(n){return(n-this.y)/this.k},rescaleX:function(n){return n.copy().domain(n.range().map(this.invertX,this).map(n.invert,n))},rescaleY:function(n){return n.copy().domain(n.range().map(this.invertY,this).map(n.invert,n))},toString:function(){return"translate("+this.x+","+this.y+") scale("+this.k+")"}};var lM=new ta(1,0,0);ta.prototype;function ox(n){n.stopImmediatePropagation()}function _h(n){n.preventDefault(),n.stopImmediatePropagation()}function NG(n){return(!n.ctrlKey||n.type==="wheel")&&!n.button}function OG(){var n=this;return n instanceof SVGElement?(n=n.ownerSVGElement||n,n.hasAttribute("viewBox")?(n=n.viewBox.baseVal,[[n.x,n.y],[n.x+n.width,n.y+n.height]]):[[0,0],[n.width.baseVal.value,n.height.baseVal.value]]):[[0,0],[n.clientWidth,n.clientHeight]]}function sT(){return this.__zoom||lM}function UG(n){return-n.deltaY*(n.deltaMode===1?.05:n.deltaMode?1:.002)*(n.ctrlKey?10:1)}function zG(){return navigator.maxTouchPoints||"ontouchstart"in this}function GG(n,e,t){var r=n.invertX(e[0][0])-t[0][0],i=n.invertX(e[1][0])-t[1][0],s=n.invertY(e[0][1])-t[0][1],o=n.invertY(e[1][1])-t[1][1];return n.translate(i>r?(r+i)/2:Math.min(0,r)||Math.max(0,i),o>s?(s+o)/2:Math.min(0,s)||Math.max(0,o))}function HG(){var n=NG,e=OG,t=GG,r=UG,i=zG,s=[0,1/0],o=[[-1/0,-1/0],[1/0,1/0]],a=250,l=M6,u=tM("start","zoom","end"),c,f,p,m=500,g=150,v=0,y=10;function w(P){P.property("__zoom",sT).on("wheel.zoom",E).on("mousedown.zoom",B).on("dblclick.zoom",D).filter(i).on("touchstart.zoom",U).on("touchmove.zoom",z).on("touchend.zoom touchcancel.zoom",Y).style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}w.transform=function(P,F,G,ie){var N=P.selection?P.selection():P;N.property("__zoom",sT),P!==N?C(P,F,G,ie):N.interrupt().each(function(){b(this,arguments).event(ie).start().zoom(null,typeof F=="function"?F.apply(this,arguments):F).end()})},w.scaleBy=function(P,F,G,ie){w.scaleTo(P,function(){var N=this.__zoom.k,V=typeof F=="function"?F.apply(this,arguments):F;return N*V},G,ie)},w.scaleTo=function(P,F,G,ie){w.transform(P,function(){var N=e.apply(this,arguments),V=this.__zoom,j=G==null?A(N):typeof G=="function"?G.apply(this,arguments):G,W=V.invert(j),k=typeof F=="function"?F.apply(this,arguments):F;return t(x(_(V,k),j,W),N,o)},G,ie)},w.translateBy=function(P,F,G,ie){w.transform(P,function(){return t(this.__zoom.translate(typeof F=="function"?F.apply(this,arguments):F,typeof G=="function"?G.apply(this,arguments):G),e.apply(this,arguments),o)},null,ie)},w.translateTo=function(P,F,G,ie,N){w.transform(P,function(){var V=e.apply(this,arguments),j=this.__zoom,W=ie==null?A(V):typeof ie=="function"?ie.apply(this,arguments):ie;return t(lM.translate(W[0],W[1]).scale(j.k).translate(typeof F=="function"?-F.apply(this,arguments):-F,typeof G=="function"?-G.apply(this,arguments):-G),V,o)},ie,N)};function _(P,F){return F=Math.max(s[0],Math.min(s[1],F)),F===P.k?P:new ta(F,P.x,P.y)}function x(P,F,G){var ie=F[0]-G[0]*P.k,N=F[1]-G[1]*P.k;return ie===P.x&&N===P.y?P:new ta(P.k,ie,N)}function A(P){return[(+P[0][0]+ +P[1][0])/2,(+P[0][1]+ +P[1][1])/2]}function C(P,F,G,ie){P.on("start.zoom",function(){b(this,arguments).event(ie).start()}).on("interrupt.zoom end.zoom",function(){b(this,arguments).event(ie).end()}).tween("zoom",function(){var N=this,V=arguments,j=b(N,V).event(ie),W=e.apply(N,V),k=G==null?A(W):typeof G=="function"?G.apply(N,V):G,Q=Math.max(W[1][0]-W[0][0],W[1][1]-W[0][1]),q=N.__zoom,X=typeof F=="function"?F.apply(N,V):F,J=l(q.invert(k).concat(Q/q.k),X.invert(k).concat(Q/X.k));return function(ae){if(ae===1)ae=X;else{var re=J(ae),me=Q/re[2];ae=new ta(me,k[0]-re[0]*me,k[1]-re[1]*me)}j.zoom(null,ae)}})}function b(P,F,G){return!G&&P.__zooming||new R(P,F)}function R(P,F){this.that=P,this.args=F,this.active=0,this.sourceEvent=null,this.extent=e.apply(P,F),this.taps=0}R.prototype={event:function(P){return P&&(this.sourceEvent=P),this},start:function(){return++this.active===1&&(this.that.__zooming=this,this.emit("start")),this},zoom:function(P,F){return this.mouse&&P!=="mouse"&&(this.mouse[1]=F.invert(this.mouse[0])),this.touch0&&P!=="touch"&&(this.touch0[1]=F.invert(this.touch0[0])),this.touch1&&P!=="touch"&&(this.touch1[1]=F.invert(this.touch1[0])),this.that.__zoom=F,this.emit("zoom"),this},end:function(){return--this.active===0&&(delete this.that.__zooming,this.emit("end")),this},emit:function(P){var F=Ko(this.that).datum();u.call(P,this.that,new FG(P,{sourceEvent:this.sourceEvent,target:w,type:P,transform:this.that.__zoom,dispatch:u}),F)}};function E(P,...F){if(!n.apply(this,arguments))return;var G=b(this,F).event(P),ie=this.__zoom,N=Math.max(s[0],Math.min(s[1],ie.k*Math.pow(2,r.apply(this,arguments)))),V=Fl(P);if(G.wheel)(G.mouse[0][0]!==V[0]||G.mouse[0][1]!==V[1])&&(G.mouse[1]=ie.invert(G.mouse[0]=V)),clearTimeout(G.wheel);else{if(ie.k===N)return;G.mouse=[V,ie.invert(V)],y0(this),G.start()}_h(P),G.wheel=setTimeout(j,g),G.zoom("mouse",t(x(_(ie,N),G.mouse[0],G.mouse[1]),G.extent,o));function j(){G.wheel=null,G.end()}}function B(P,...F){if(p||!n.apply(this,arguments))return;var G=b(this,F,!0).event(P),ie=Ko(P.view).on("mousemove.zoom",k,!0).on("mouseup.zoom",Q,!0),N=Fl(P,V),V=P.currentTarget,j=P.clientX,W=P.clientY;$5(P.view),ox(P),G.mouse=[N,this.__zoom.invert(N)],y0(this),G.start();function k(q){if(_h(q),!G.moved){var X=q.clientX-j,J=q.clientY-W;G.moved=X*X+J*J>v}G.event(q).zoom("mouse",t(x(G.that.__zoom,G.mouse[0]=Fl(q,V),G.mouse[1]),G.extent,o))}function Q(q){ie.on("mousemove.zoom mouseup.zoom",null),e6(q.view,G.moved),_h(q),G.event(q).end()}}function D(P,...F){if(n.apply(this,arguments)){var G=this.__zoom,ie=Fl(P.changedTouches?P.changedTouches[0]:P,this),N=G.invert(ie),V=G.k*(P.shiftKey?.5:2),j=t(x(_(G,V),ie,N),e.apply(this,F),o);_h(P),a>0?Ko(this).transition().duration(a).call(C,j,ie,P):Ko(this).call(w.transform,j,ie,P)}}function U(P,...F){if(n.apply(this,arguments)){var G=P.touches,ie=G.length,N=b(this,F,P.changedTouches.length===ie).event(P),V,j,W,k;for(ox(P),j=0;j=0)&&(t[i]=n[i]);return t}function bs(n,e){if(n==null)return{};var t=WG(n,e),r,i;if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(n);for(i=0;i=0)&&Object.prototype.propertyIsEnumerable.call(n,r)&&(t[r]=n[r])}return t}function Or(n,e){return JG(n)||jG(n,e)||XG(n,e)||YG()}function JG(n){if(Array.isArray(n))return n}function jG(n,e){var t=n==null?null:typeof Symbol<"u"&&n[Symbol.iterator]||n["@@iterator"];if(t!=null){var r=[],i=!0,s=!1,o,a;try{for(t=t.call(n);!(i=(o=t.next()).done)&&(r.push(o.value),!(e&&r.length===e));i=!0);}catch(l){s=!0,a=l}finally{try{!i&&t.return!=null&&t.return()}finally{if(s)throw a}}return r}}function XG(n,e){if(n){if(typeof n=="string")return aT(n,e);var t=Object.prototype.toString.call(n).slice(8,-1);if(t==="Object"&&n.constructor&&(t=n.constructor.name),t==="Map"||t==="Set")return Array.from(n);if(t==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t))return aT(n,e)}}function aT(n,e){(e==null||e>n.length)&&(e=n.length);for(var t=0,r=new Array(e);t0&&arguments[0]!==void 0?arguments[0]:30,e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:30,t=arguments.length>2&&arguments[2]!==void 0?arguments[2]:.5,r=Array.isArray(t)?t:[t,t],i=n/2*r[0],s=e/2*r[1];return"M".concat(0,",",0," Q",-n/2-i,",").concat(-e/2+s," ").concat(-n,",").concat(-e)}function i8(n){return typeof n=="string"}function s8(n){var e=n.geography,t=n.parseGeographies,r=ee.useContext(Co),i=r.path,s=ee.useState({}),o=Or(s,2),a=o[0],l=o[1];ee.useEffect(function(){(typeof window>"u"?"undefined":Ow(window))!=="undefined"&&e&&(i8(e)?e8(e).then(function(m){m&&l({geographies:uT(m,t),mesh:cT(m)})}):l({geographies:uT(e,t),mesh:cT(e)}))},[e,t]);var u=ee.useMemo(function(){var m=a.mesh||{},g=t8(m.outline,m.borders,i);return{geographies:n8(a.geographies,i),outline:g.outline,borders:g.borders}},[a,i]),c=u.geographies,f=u.outline,p=u.borders;return{geographies:c,outline:f,borders:p}}var o8=["geography","children","parseGeographies","className"],cM=ee.forwardRef(function(n,e){var t=n.geography,r=n.children,i=n.parseGeographies,s=n.className,o=s===void 0?"":s,a=bs(n,o8),l=ee.useContext(Co),u=l.path,c=l.projection,f=s8({geography:t,parseGeographies:i}),p=f.geographies,m=f.outline,g=f.borders;return pn.createElement("g",Ni({ref:e,className:"rsm-geographies ".concat(o)},a),p&&p.length>0&&r({geographies:p,outline:m,borders:g,path:u,projection:c}))});cM.displayName="Geographies";cM.propTypes={geography:rt.oneOfType([rt.string,rt.object,rt.array]),children:rt.func,parseGeographies:rt.func,className:rt.string};var a8=["geography","onMouseEnter","onMouseLeave","onMouseDown","onMouseUp","onFocus","onBlur","style","className"],fM=ee.forwardRef(function(n,e){var t=n.geography,r=n.onMouseEnter,i=n.onMouseLeave,s=n.onMouseDown,o=n.onMouseUp,a=n.onFocus,l=n.onBlur,u=n.style,c=u===void 0?{}:u,f=n.className,p=f===void 0?"":f,m=bs(n,a8),g=ee.useState(!1),v=Or(g,2),y=v[0],w=v[1],_=ee.useState(!1),x=Or(_,2),A=x[0],C=x[1];function b(z){C(!0),r&&r(z)}function R(z){C(!1),y&&w(!1),i&&i(z)}function E(z){C(!0),a&&a(z)}function B(z){C(!1),y&&w(!1),l&&l(z)}function D(z){w(!0),s&&s(z)}function U(z){w(!1),o&&o(z)}return pn.createElement("path",Ni({ref:e,tabIndex:"0",className:"rsm-geography ".concat(p),d:t.svgPath,onMouseEnter:b,onMouseLeave:R,onFocus:E,onBlur:B,onMouseDown:D,onMouseUp:U,style:c[y||A?y?"pressed":"hover":"default"]},m))});fM.displayName="Geography";fM.propTypes={geography:rt.object,onMouseEnter:rt.func,onMouseLeave:rt.func,onMouseDown:rt.func,onMouseUp:rt.func,onFocus:rt.func,onBlur:rt.func,style:rt.object,className:rt.string};var l8=ee.memo(fM),u8=["fill","stroke","step","className"],hM=ee.forwardRef(function(n,e){var t=n.fill,r=t===void 0?"transparent":t,i=n.stroke,s=i===void 0?"currentcolor":i,o=n.step,a=o===void 0?[10,10]:o,l=n.className,u=l===void 0?"":l,c=bs(n,u8),f=ee.useContext(Co),p=f.path;return pn.createElement("path",Ni({ref:e,d:p(zA().step(a)()),fill:r,stroke:s,className:"rsm-graticule ".concat(u)},c))});hM.displayName="Graticule";hM.propTypes={fill:rt.string,stroke:rt.string,step:rt.array,className:rt.string};ee.memo(hM);var c8=["value"],f8=ee.createContext(),h8={x:0,y:0,k:1,transformString:"translate(0 0) scale(1)"},qI=function(e){var t=e.value,r=t===void 0?h8:t,i=bs(e,c8);return pn.createElement(f8.Provider,Ni({value:r},i))};qI.propTypes={x:rt.number,y:rt.number,k:rt.number,transformString:rt.string};function d8(n){var e=n.center,t=n.filterZoomEvent,r=n.onMoveStart,i=n.onMoveEnd,s=n.onMove,o=n.translateExtent,a=o===void 0?[[-1/0,-1/0],[1/0,1/0]]:o,l=n.scaleExtent,u=l===void 0?[1,8]:l,c=n.zoom,f=c===void 0?1:c,p=ee.useContext(Co),m=p.width,g=p.height,v=p.projection,y=Or(e,2),w=y[0],_=y[1],x=ee.useState({x:0,y:0,k:1}),A=Or(x,2),C=A[0],b=A[1],R=ee.useRef({x:0,y:0,k:1}),E=ee.useRef(),B=ee.useRef(),D=ee.useRef(!1),U=Or(a,2),z=U[0],Y=U[1],P=Or(z,2),F=P[0],G=P[1],ie=Or(Y,2),N=ie[0],V=ie[1],j=Or(u,2),W=j[0],k=j[1];return ee.useEffect(function(){var Q=Ko(E.current);function q(me){!r||D.current||r({coordinates:v.invert(lT(m,g,me.transform)),zoom:me.transform.k},me)}function X(me){if(!D.current){var Me=me.transform,Se=me.sourceEvent;b({x:Me.x,y:Me.y,k:Me.k,dragging:Se}),s&&s({x:Me.x,y:Me.y,zoom:Me.k,dragging:Se},me)}}function J(me){if(D.current){D.current=!1;return}var Me=v.invert(lT(m,g,me.transform)),Se=Or(Me,2),se=Se[0],ye=Se[1];R.current={x:se,y:ye,k:me.transform.k},i&&i({coordinates:[se,ye],zoom:me.transform.k},me)}function ae(me){return t?t(me):me?!me.ctrlKey&&!me.button:!1}var re=HG().filter(ae).scaleExtent([W,k]).translateExtent([[F,G],[N,V]]).on("start",q).on("zoom",X).on("end",J);B.current=re,Q.call(re)},[m,g,F,G,N,V,W,k,v,r,s,i,t]),ee.useEffect(function(){if(!(w===R.current.x&&_===R.current.y&&f===R.current.k)){var Q=v([w,_]),q=Q[0]*f,X=Q[1]*f,J=Ko(E.current);D.current=!0,J.call(B.current.transform,lM.translate(m/2-q,g/2-X).scale(f)),b({x:m/2-q,y:g/2-X,k:f}),R.current={x:w,y:_,k:f}}},[w,_,f,m,g,v]),{mapRef:E,position:C,transformString:"translate(".concat(C.x," ").concat(C.y,") scale(").concat(C.k,")")}}var p8=["center","zoom","minZoom","maxZoom","translateExtent","filterZoomEvent","onMoveStart","onMove","onMoveEnd","className"],$I=ee.forwardRef(function(n,e){var t=n.center,r=t===void 0?[0,0]:t,i=n.zoom,s=i===void 0?1:i,o=n.minZoom,a=o===void 0?1:o,l=n.maxZoom,u=l===void 0?8:l,c=n.translateExtent,f=n.filterZoomEvent,p=n.onMoveStart,m=n.onMove,g=n.onMoveEnd,v=n.className,y=bs(n,p8),w=ee.useContext(Co),_=w.width,x=w.height,A=d8({center:r,filterZoomEvent:f,onMoveStart:p,onMove:m,onMoveEnd:g,scaleExtent:[a,u],translateExtent:c,zoom:s}),C=A.mapRef,b=A.transformString,R=A.position;return pn.createElement(qI,{value:{x:R.x,y:R.y,k:R.k,transformString:b}},pn.createElement("g",{ref:C},pn.createElement("rect",{width:_,height:x,fill:"transparent"}),pn.createElement("g",Ni({ref:e,transform:b,className:"rsm-zoomable-group ".concat(v)},y))))});$I.displayName="ZoomableGroup";$I.propTypes={center:rt.array,zoom:rt.number,minZoom:rt.number,maxZoom:rt.number,translateExtent:rt.arrayOf(rt.array),onMoveStart:rt.func,onMove:rt.func,onMoveEnd:rt.func,className:rt.string};var m8=["id","fill","stroke","strokeWidth","className"],dM=ee.forwardRef(function(n,e){var t=n.id,r=t===void 0?"rsm-sphere":t,i=n.fill,s=i===void 0?"transparent":i,o=n.stroke,a=o===void 0?"currentcolor":o,l=n.strokeWidth,u=l===void 0?.5:l,c=n.className,f=c===void 0?"":c,p=bs(n,m8),m=ee.useContext(Co),g=m.path,v=ee.useMemo(function(){return g({type:"Sphere"})},[g]);return pn.createElement(ee.Fragment,null,pn.createElement("defs",null,pn.createElement("clipPath",{id:r},pn.createElement("path",{d:v}))),pn.createElement("path",Ni({ref:e,d:v,fill:s,stroke:a,strokeWidth:u,style:{pointerEvents:"none"},className:"rsm-sphere ".concat(f)},p)))});dM.displayName="Sphere";dM.propTypes={id:rt.string,fill:rt.string,stroke:rt.string,strokeWidth:rt.number,className:rt.string};ee.memo(dM);var g8=["coordinates","children","onMouseEnter","onMouseLeave","onMouseDown","onMouseUp","onFocus","onBlur","style","className"],eL=ee.forwardRef(function(n,e){var t=n.coordinates,r=n.children,i=n.onMouseEnter,s=n.onMouseLeave,o=n.onMouseDown,a=n.onMouseUp,l=n.onFocus,u=n.onBlur,c=n.style,f=c===void 0?{}:c,p=n.className,m=p===void 0?"":p,g=bs(n,g8),v=ee.useContext(Co),y=v.projection,w=ee.useState(!1),_=Or(w,2),x=_[0],A=_[1],C=ee.useState(!1),b=Or(C,2),R=b[0],E=b[1],B=y(t),D=Or(B,2),U=D[0],z=D[1];function Y(V){E(!0),i&&i(V)}function P(V){E(!1),x&&A(!1),s&&s(V)}function F(V){E(!0),l&&l(V)}function G(V){E(!1),x&&A(!1),u&&u(V)}function ie(V){A(!0),o&&o(V)}function N(V){A(!1),a&&a(V)}return pn.createElement("g",Ni({ref:e,transform:"translate(".concat(U,", ").concat(z,")"),className:"rsm-marker ".concat(m),onMouseEnter:Y,onMouseLeave:P,onFocus:F,onBlur:G,onMouseDown:ie,onMouseUp:N,style:f[x||R?x?"pressed":"hover":"default"]},g),r)});eL.displayName="Marker";eL.propTypes={coordinates:rt.array,children:rt.oneOfType([rt.node,rt.arrayOf(rt.node)]),onMouseEnter:rt.func,onMouseLeave:rt.func,onMouseDown:rt.func,onMouseUp:rt.func,onFocus:rt.func,onBlur:rt.func,style:rt.object,className:rt.string};var v8=["from","to","coordinates","stroke","strokeWidth","fill","className"],tL=ee.forwardRef(function(n,e){var t=n.from,r=t===void 0?[0,0]:t,i=n.to,s=i===void 0?[0,0]:i,o=n.coordinates,a=n.stroke,l=a===void 0?"currentcolor":a,u=n.strokeWidth,c=u===void 0?3:u,f=n.fill,p=f===void 0?"transparent":f,m=n.className,g=m===void 0?"":m,v=bs(n,v8),y=ee.useContext(Co),w=y.path,_={type:"LineString",coordinates:o||[r,s]};return pn.createElement("path",Ni({ref:e,d:w(_),className:"rsm-line ".concat(g),stroke:l,strokeWidth:c,fill:p},v))});tL.displayName="Line";tL.propTypes={from:rt.array,to:rt.array,coordinates:rt.array,stroke:rt.string,strokeWidth:rt.number,fill:rt.string,className:rt.string};var y8=["subject","children","connectorProps","dx","dy","curve","className"],pM=ee.forwardRef(function(n,e){var t=n.subject,r=n.children,i=n.connectorProps,s=n.dx,o=s===void 0?30:s,a=n.dy,l=a===void 0?30:a,u=n.curve,c=u===void 0?0:u,f=n.className,p=f===void 0?"":f,m=bs(n,y8),g=ee.useContext(Co),v=g.projection,y=v(t),w=Or(y,2),_=w[0],x=w[1],A=r8(o,l,c);return pn.createElement("g",Ni({ref:e,transform:"translate(".concat(_+o,", ").concat(x+l,")"),className:"rsm-annotation ".concat(p)},m),pn.createElement("path",Ni({d:A,fill:"transparent",stroke:"#000"},i)),r)});pM.displayName="Annotation";pM.propTypes={subject:rt.array,children:rt.oneOfType([rt.node,rt.arrayOf(rt.node)]),dx:rt.number,dy:rt.number,curve:rt.number,connectorProps:rt.object,className:rt.string};const x8=()=>Et(uM,{projection:"geoAzimuthalEqualArea",projectionConfig:{rotate:[-110,-1,0],center:[-5,0],scale:2e3},style:{width:"100%",height:"100%"},children:[he(cM,{geography:"./features.json",fill:"#340062",stroke:"#FFFFFF",strokeWidth:.5,children:({geographies:n})=>n.map(e=>he(l8,{geography:e},e.rsmKey))}),he(pM,{subject:[103.8198,1.3521],dx:90,dy:-30,connectorProps:{stroke:"white",strokeWidth:2,strokeLinecap:"round"},children:he("text",{x:"80",textAnchor:"end",alignmentBaseline:"middle",fill:"white",children:"Singapore"})})]}),Yd={_origin:"https://api.emailjs.com"},_8=(n,e="https://api.emailjs.com")=>{Yd._userID=n,Yd._origin=e},nL=(n,e,t)=>{if(!n)throw"The public key is required. Visit https://dashboard.emailjs.com/admin/account";if(!e)throw"The service ID is required. Visit https://dashboard.emailjs.com/admin";if(!t)throw"The template ID is required. Visit https://dashboard.emailjs.com/admin/templates";return!0};class fT{constructor(e){this.status=e?e.status:0,this.text=e?e.responseText:"Network Error"}}const rL=(n,e,t={})=>new Promise((r,i)=>{const s=new XMLHttpRequest;s.addEventListener("load",({target:o})=>{const a=new fT(o);a.status===200||a.text==="OK"?r(a):i(a)}),s.addEventListener("error",({target:o})=>{i(new fT(o))}),s.open("POST",Yd._origin+n,!0),Object.keys(t).forEach(o=>{s.setRequestHeader(o,t[o])}),s.send(e)}),w8=(n,e,t,r)=>{const i=r||Yd._userID;return nL(i,n,e),rL("/api/v1.0/email/send",JSON.stringify({lib_version:"3.10.0",user_id:i,service_id:n,template_id:e,template_params:t}),{"Content-type":"application/json"})},S8=n=>{let e;if(typeof n=="string"?e=document.querySelector(n):e=n,!e||e.nodeName!=="FORM")throw"The 3rd parameter is expected to be the HTML form element or the style selector of form";return e},A8=(n,e,t,r)=>{const i=r||Yd._userID,s=S8(t);nL(i,n,e);const o=new FormData(s);return o.append("lib_version","3.10.0"),o.append("service_id",n),o.append("template_id",e),o.append("user_id",i),rL("/api/v1.0/email/send-form",o)},M8={init:_8,send:w8,sendForm:A8},E8=pt.div` - height: 100vh; - scroll-snap-align: center; - padding-top: 10vh; - - @media screen and (max-width: 768px){ - padding-top: 0; - } -`,C8=pt.div` - width: 100%; - height: 100%; - display: flex; - justify-content: space-between; - gap: 3%; - - @media screen and (max-width: 768px){ - height: 100%; - flex-direction: column; - align-items: center; - justify-content: center; - } -`,b8=pt.div` - flex: 1; - display: flex; - justify-content: flex-end; - align-items: center; - - @media screen and (max-width: 768px){ - justify-content: center; - } -`,T8=pt.h1` - font-family: 'Roboto Mono', monospace; - color: #00d0f4; -`,R8=pt.form` - width: 50%; - display: flex; - flex-direction: column; - gap: 20px; - - @media screen and (max-width: 768px){ - width: 100%; - } -`,hT=pt.input` - padding: 20px; - border: none; - border-radius: 5px; -`,B8=pt.textarea` - padding: 20px; - border: none; - border-radius: 5px; -`,P8=pt.button` - height: min-content; - padding: 10px; - background-color: #da4ea2; - color: white; - border: none; - border-radius: 5px; - font-family: 'Open Sans', sans-serif; - cursor: pointer; -`,I8=pt.div` - flex: 1; - - @media screen and (max-width: 768px) { - display: none; - } -`,L8=()=>{const n=ee.useRef(),[e,t]=ee.useState(null);return he(E8,{id:"Contact",children:Et(C8,{children:[he(b8,{children:Et(R8,{ref:n,onSubmit:i=>{i.preventDefault(),M8.sendForm("service_g8b787m","template_m8bxs4g",n.current,"c5b0B1oBs4YtW-0cM").then(s=>{console.log(s.text),t(!0)},s=>{console.log(s.text),t(!1)})},children:[he(T8,{children:"Contact Me"}),he(hT,{placeholder:"Name",name:"name"}),he(hT,{placeholder:"Email",name:"email"}),he(B8,{placeholder:"Write Message",rows:10,name:"message"}),he(P8,{type:"submit",children:"Send"}),e&&"Email sent. I will get back to you soon!"]})}),he(I8,{children:he(x8,{})})]})})};function Tr(){return Tr=Object.assign?Object.assign.bind():function(n){for(var e=1;e>8&255]+Qr[n>>16&255]+Qr[n>>24&255]+"-"+Qr[e&255]+Qr[e>>8&255]+"-"+Qr[e>>16&15|64]+Qr[e>>24&255]+"-"+Qr[t&63|128]+Qr[t>>8&255]+"-"+Qr[t>>16&255]+Qr[t>>24&255]+Qr[r&255]+Qr[r>>8&255]+Qr[r>>16&255]+Qr[r>>24&255]).toLowerCase()}function ir(n,e,t){return Math.max(e,Math.min(t,n))}function MM(n,e){return(n%e+e)%e}function c9(n,e,t,r,i){return r+(n-e)*(i-r)/(t-e)}function f9(n,e,t){return n!==e?(t-n)/(e-n):0}function md(n,e,t){return(1-t)*n+t*e}function h9(n,e,t,r){return md(n,e,1-Math.exp(-t*r))}function d9(n,e=1){return e-Math.abs(MM(n,e*2)-e)}function p9(n,e,t){return n<=e?0:n>=t?1:(n=(n-e)/(t-e),n*n*(3-2*n))}function m9(n,e,t){return n<=e?0:n>=t?1:(n=(n-e)/(t-e),n*n*n*(n*(n*6-15)+10))}function g9(n,e){return n+Math.floor(Math.random()*(e-n+1))}function v9(n,e){return n+Math.random()*(e-n)}function y9(n){return n*(.5-Math.random())}function x9(n){n!==void 0&&(dT=n);let e=dT+=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 _9(n){return n*mu}function w9(n){return n*$d}function mS(n){return(n&n-1)===0&&n!==0}function $L(n){return Math.pow(2,Math.ceil(Math.log(n)/Math.LN2))}function eD(n){return Math.pow(2,Math.floor(Math.log(n)/Math.LN2))}function S9(n,e,t,r,i){const s=Math.cos,o=Math.sin,a=s(t/2),l=o(t/2),u=s((e+r)/2),c=o((e+r)/2),f=s((e-r)/2),p=o((e-r)/2),m=s((r-e)/2),g=o((r-e)/2);switch(i){case"XYX":n.set(a*c,l*f,l*p,a*u);break;case"YZY":n.set(l*p,a*c,l*f,a*u);break;case"ZXZ":n.set(l*f,l*p,a*c,a*u);break;case"XZX":n.set(a*c,l*g,l*m,a*u);break;case"YXY":n.set(l*m,a*c,l*g,a*u);break;case"ZYZ":n.set(l*g,l*m,a*c,a*u);break;default:console.warn("THREE.MathUtils: .setQuaternionFromProperEuler() encountered an unknown order: "+i)}}function na(n,e){switch(e.constructor){case Float32Array:return n;case Uint16Array:return n/65535;case Uint8Array:return n/255;case Int16Array:return Math.max(n/32767,-1);case Int8Array:return Math.max(n/127,-1);default:throw new Error("Invalid component type.")}}function En(n,e){switch(e.constructor){case Float32Array:return n;case Uint16Array:return Math.round(n*65535);case Uint8Array:return Math.round(n*255);case Int16Array:return Math.round(n*32767);case Int8Array:return Math.round(n*127);default:throw new Error("Invalid component type.")}}const go={DEG2RAD:mu,RAD2DEG:$d,generateUUID:ts,clamp:ir,euclideanModulo:MM,mapLinear:c9,inverseLerp:f9,lerp:md,damp:h9,pingpong:d9,smoothstep:p9,smootherstep:m9,randInt:g9,randFloat:v9,randFloatSpread:y9,seededRandom:x9,degToRad:_9,radToDeg:w9,isPowerOfTwo:mS,ceilPowerOfTwo:$L,floorPowerOfTwo:eD,setQuaternionFromProperEuler:S9,normalize:En,denormalize:na};class ze{constructor(e=0,t=0){ze.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,r=this.y,i=e.elements;return this.x=i[0]*t+i[3]*r+i[6],this.y=i[1]*t+i[4]*r+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=Math.max(e.x,Math.min(t.x,this.x)),this.y=Math.max(e.y,Math.min(t.y,this.y)),this}clampScalar(e,t){return this.x=Math.max(e,Math.min(t,this.x)),this.y=Math.max(e,Math.min(t,this.y)),this}clampLength(e,t){const r=this.length();return this.divideScalar(r||1).multiplyScalar(Math.max(e,Math.min(t,r)))}floor(){return this.x=Math.floor(this.x),this.y=Math.floor(this.y),this}ceil(){return this.x=Math.ceil(this.x),this.y=Math.ceil(this.y),this}round(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this}roundToZero(){return this.x=this.x<0?Math.ceil(this.x):Math.floor(this.x),this.y=this.y<0?Math.ceil(this.y):Math.floor(this.y),this}negate(){return this.x=-this.x,this.y=-this.y,this}dot(e){return this.x*e.x+this.y*e.y}cross(e){return this.x*e.y-this.y*e.x}lengthSq(){return this.x*this.x+this.y*this.y}length(){return Math.sqrt(this.x*this.x+this.y*this.y)}manhattanLength(){return Math.abs(this.x)+Math.abs(this.y)}normalize(){return this.divideScalar(this.length()||1)}angle(){return Math.atan2(-this.y,-this.x)+Math.PI}distanceTo(e){return Math.sqrt(this.distanceToSquared(e))}distanceToSquared(e){const t=this.x-e.x,r=this.y-e.y;return t*t+r*r}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,r){return this.x=e.x+(t.x-e.x)*r,this.y=e.y+(t.y-e.y)*r,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 r=Math.cos(t),i=Math.sin(t),s=this.x-e.x,o=this.y-e.y;return this.x=s*r-o*i+e.x,this.y=s*i+o*r+e.y,this}random(){return this.x=Math.random(),this.y=Math.random(),this}*[Symbol.iterator](){yield this.x,yield this.y}}class Rr{constructor(){Rr.prototype.isMatrix3=!0,this.elements=[1,0,0,0,1,0,0,0,1]}set(e,t,r,i,s,o,a,l,u){const c=this.elements;return c[0]=e,c[1]=i,c[2]=a,c[3]=t,c[4]=s,c[5]=l,c[6]=r,c[7]=o,c[8]=u,this}identity(){return this.set(1,0,0,0,1,0,0,0,1),this}copy(e){const t=this.elements,r=e.elements;return t[0]=r[0],t[1]=r[1],t[2]=r[2],t[3]=r[3],t[4]=r[4],t[5]=r[5],t[6]=r[6],t[7]=r[7],t[8]=r[8],this}extractBasis(e,t,r){return e.setFromMatrix3Column(this,0),t.setFromMatrix3Column(this,1),r.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 r=e.elements,i=t.elements,s=this.elements,o=r[0],a=r[3],l=r[6],u=r[1],c=r[4],f=r[7],p=r[2],m=r[5],g=r[8],v=i[0],y=i[3],w=i[6],_=i[1],x=i[4],A=i[7],C=i[2],b=i[5],R=i[8];return s[0]=o*v+a*_+l*C,s[3]=o*y+a*x+l*b,s[6]=o*w+a*A+l*R,s[1]=u*v+c*_+f*C,s[4]=u*y+c*x+f*b,s[7]=u*w+c*A+f*R,s[2]=p*v+m*_+g*C,s[5]=p*y+m*x+g*b,s[8]=p*w+m*A+g*R,this}multiplyScalar(e){const t=this.elements;return t[0]*=e,t[3]*=e,t[6]*=e,t[1]*=e,t[4]*=e,t[7]*=e,t[2]*=e,t[5]*=e,t[8]*=e,this}determinant(){const e=this.elements,t=e[0],r=e[1],i=e[2],s=e[3],o=e[4],a=e[5],l=e[6],u=e[7],c=e[8];return t*o*c-t*a*u-r*s*c+r*a*l+i*s*u-i*o*l}invert(){const e=this.elements,t=e[0],r=e[1],i=e[2],s=e[3],o=e[4],a=e[5],l=e[6],u=e[7],c=e[8],f=c*o-a*u,p=a*l-c*s,m=u*s-o*l,g=t*f+r*p+i*m;if(g===0)return this.set(0,0,0,0,0,0,0,0,0);const v=1/g;return e[0]=f*v,e[1]=(i*u-c*r)*v,e[2]=(a*r-i*o)*v,e[3]=p*v,e[4]=(c*t-i*l)*v,e[5]=(i*s-a*t)*v,e[6]=m*v,e[7]=(r*l-u*t)*v,e[8]=(o*t-r*s)*v,this}transpose(){let e;const t=this.elements;return e=t[1],t[1]=t[3],t[3]=e,e=t[2],t[2]=t[6],t[6]=e,e=t[5],t[5]=t[7],t[7]=e,this}getNormalMatrix(e){return this.setFromMatrix4(e).invert().transpose()}transposeIntoArray(e){const t=this.elements;return e[0]=t[0],e[1]=t[3],e[2]=t[6],e[3]=t[1],e[4]=t[4],e[5]=t[7],e[6]=t[2],e[7]=t[5],e[8]=t[8],this}setUvTransform(e,t,r,i,s,o,a){const l=Math.cos(s),u=Math.sin(s);return this.set(r*l,r*u,-r*(l*o+u*a)+o+e,-i*u,i*l,-i*(-u*o+l*a)+a+t,0,0,1),this}scale(e,t){return this.premultiply(ax.makeScale(e,t)),this}rotate(e){return this.premultiply(ax.makeRotation(-e)),this}translate(e,t){return this.premultiply(ax.makeTranslation(e,t)),this}makeTranslation(e,t){return this.set(1,0,e,0,1,t,0,0,1),this}makeRotation(e){const t=Math.cos(e),r=Math.sin(e);return this.set(t,-r,0,r,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,r=e.elements;for(let i=0;i<9;i++)if(t[i]!==r[i])return!1;return!0}fromArray(e,t=0){for(let r=0;r<9;r++)this.elements[r]=e[r+t];return this}toArray(e=[],t=0){const r=this.elements;return e[t]=r[0],e[t+1]=r[1],e[t+2]=r[2],e[t+3]=r[3],e[t+4]=r[4],e[t+5]=r[5],e[t+6]=r[6],e[t+7]=r[7],e[t+8]=r[8],e}clone(){return new this.constructor().fromArray(this.elements)}}const ax=new Rr;function tD(n){for(let e=n.length-1;e>=0;--e)if(n[e]>=65535)return!0;return!1}const A9={Int8Array,Uint8Array,Uint8ClampedArray,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array};function Uc(n,e){return new A9[n](e)}function ep(n){return document.createElementNS("http://www.w3.org/1999/xhtml",n)}class Pr{constructor(e=0,t=0,r=0,i=1){this.isQuaternion=!0,this._x=e,this._y=t,this._z=r,this._w=i}static slerpFlat(e,t,r,i,s,o,a){let l=r[i+0],u=r[i+1],c=r[i+2],f=r[i+3];const p=s[o+0],m=s[o+1],g=s[o+2],v=s[o+3];if(a===0){e[t+0]=l,e[t+1]=u,e[t+2]=c,e[t+3]=f;return}if(a===1){e[t+0]=p,e[t+1]=m,e[t+2]=g,e[t+3]=v;return}if(f!==v||l!==p||u!==m||c!==g){let y=1-a;const w=l*p+u*m+c*g+f*v,_=w>=0?1:-1,x=1-w*w;if(x>Number.EPSILON){const C=Math.sqrt(x),b=Math.atan2(C,w*_);y=Math.sin(y*b)/C,a=Math.sin(a*b)/C}const A=a*_;if(l=l*y+p*A,u=u*y+m*A,c=c*y+g*A,f=f*y+v*A,y===1-a){const C=1/Math.sqrt(l*l+u*u+c*c+f*f);l*=C,u*=C,c*=C,f*=C}}e[t]=l,e[t+1]=u,e[t+2]=c,e[t+3]=f}static multiplyQuaternionsFlat(e,t,r,i,s,o){const a=r[i],l=r[i+1],u=r[i+2],c=r[i+3],f=s[o],p=s[o+1],m=s[o+2],g=s[o+3];return e[t]=a*g+c*f+l*m-u*p,e[t+1]=l*g+c*p+u*f-a*m,e[t+2]=u*g+c*m+a*p-l*f,e[t+3]=c*g-a*f-l*p-u*m,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,r,i){return this._x=e,this._y=t,this._z=r,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){const r=e._x,i=e._y,s=e._z,o=e._order,a=Math.cos,l=Math.sin,u=a(r/2),c=a(i/2),f=a(s/2),p=l(r/2),m=l(i/2),g=l(s/2);switch(o){case"XYZ":this._x=p*c*f+u*m*g,this._y=u*m*f-p*c*g,this._z=u*c*g+p*m*f,this._w=u*c*f-p*m*g;break;case"YXZ":this._x=p*c*f+u*m*g,this._y=u*m*f-p*c*g,this._z=u*c*g-p*m*f,this._w=u*c*f+p*m*g;break;case"ZXY":this._x=p*c*f-u*m*g,this._y=u*m*f+p*c*g,this._z=u*c*g+p*m*f,this._w=u*c*f-p*m*g;break;case"ZYX":this._x=p*c*f-u*m*g,this._y=u*m*f+p*c*g,this._z=u*c*g-p*m*f,this._w=u*c*f+p*m*g;break;case"YZX":this._x=p*c*f+u*m*g,this._y=u*m*f+p*c*g,this._z=u*c*g-p*m*f,this._w=u*c*f-p*m*g;break;case"XZY":this._x=p*c*f-u*m*g,this._y=u*m*f-p*c*g,this._z=u*c*g+p*m*f,this._w=u*c*f+p*m*g;break;default:console.warn("THREE.Quaternion: .setFromEuler() encountered an unknown order: "+o)}return t!==!1&&this._onChangeCallback(),this}setFromAxisAngle(e,t){const r=t/2,i=Math.sin(r);return this._x=e.x*i,this._y=e.y*i,this._z=e.z*i,this._w=Math.cos(r),this._onChangeCallback(),this}setFromRotationMatrix(e){const t=e.elements,r=t[0],i=t[4],s=t[8],o=t[1],a=t[5],l=t[9],u=t[2],c=t[6],f=t[10],p=r+a+f;if(p>0){const m=.5/Math.sqrt(p+1);this._w=.25/m,this._x=(c-l)*m,this._y=(s-u)*m,this._z=(o-i)*m}else if(r>a&&r>f){const m=2*Math.sqrt(1+r-a-f);this._w=(c-l)/m,this._x=.25*m,this._y=(i+o)/m,this._z=(s+u)/m}else if(a>f){const m=2*Math.sqrt(1+a-r-f);this._w=(s-u)/m,this._x=(i+o)/m,this._y=.25*m,this._z=(l+c)/m}else{const m=2*Math.sqrt(1+f-r-a);this._w=(o-i)/m,this._x=(s+u)/m,this._y=(l+c)/m,this._z=.25*m}return this._onChangeCallback(),this}setFromUnitVectors(e,t){let r=e.dot(t)+1;return rMath.abs(e.z)?(this._x=-e.y,this._y=e.x,this._z=0,this._w=r):(this._x=0,this._y=-e.z,this._z=e.y,this._w=r)):(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=r),this.normalize()}angleTo(e){return 2*Math.acos(Math.abs(ir(this.dot(e),-1,1)))}rotateTowards(e,t){const r=this.angleTo(e);if(r===0)return this;const i=Math.min(1,t/r);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 r=e._x,i=e._y,s=e._z,o=e._w,a=t._x,l=t._y,u=t._z,c=t._w;return this._x=r*c+o*a+i*u-s*l,this._y=i*c+o*l+s*a-r*u,this._z=s*c+o*u+r*l-i*a,this._w=o*c-r*a-i*l-s*u,this._onChangeCallback(),this}slerp(e,t){if(t===0)return this;if(t===1)return this.copy(e);const r=this._x,i=this._y,s=this._z,o=this._w;let a=o*e._w+r*e._x+i*e._y+s*e._z;if(a<0?(this._w=-e._w,this._x=-e._x,this._y=-e._y,this._z=-e._z,a=-a):this.copy(e),a>=1)return this._w=o,this._x=r,this._y=i,this._z=s,this;const l=1-a*a;if(l<=Number.EPSILON){const m=1-t;return this._w=m*o+t*this._w,this._x=m*r+t*this._x,this._y=m*i+t*this._y,this._z=m*s+t*this._z,this.normalize(),this._onChangeCallback(),this}const u=Math.sqrt(l),c=Math.atan2(u,a),f=Math.sin((1-t)*c)/u,p=Math.sin(t*c)/u;return this._w=o*f+this._w*p,this._x=r*f+this._x*p,this._y=i*f+this._y*p,this._z=s*f+this._z*p,this._onChangeCallback(),this}slerpQuaternions(e,t,r){return this.copy(e).slerp(t,r)}random(){const e=Math.random(),t=Math.sqrt(1-e),r=Math.sqrt(e),i=2*Math.PI*Math.random(),s=2*Math.PI*Math.random();return this.set(t*Math.cos(i),r*Math.sin(s),r*Math.cos(s),t*Math.sin(i))}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}_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,r=0){Z.prototype.isVector3=!0,this.x=e,this.y=t,this.z=r}set(e,t,r){return r===void 0&&(r=this.z),this.x=e,this.y=t,this.z=r,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(pT.setFromEuler(e))}applyAxisAngle(e,t){return this.applyQuaternion(pT.setFromAxisAngle(e,t))}applyMatrix3(e){const t=this.x,r=this.y,i=this.z,s=e.elements;return this.x=s[0]*t+s[3]*r+s[6]*i,this.y=s[1]*t+s[4]*r+s[7]*i,this.z=s[2]*t+s[5]*r+s[8]*i,this}applyNormalMatrix(e){return this.applyMatrix3(e).normalize()}applyMatrix4(e){const t=this.x,r=this.y,i=this.z,s=e.elements,o=1/(s[3]*t+s[7]*r+s[11]*i+s[15]);return this.x=(s[0]*t+s[4]*r+s[8]*i+s[12])*o,this.y=(s[1]*t+s[5]*r+s[9]*i+s[13])*o,this.z=(s[2]*t+s[6]*r+s[10]*i+s[14])*o,this}applyQuaternion(e){const t=this.x,r=this.y,i=this.z,s=e.x,o=e.y,a=e.z,l=e.w,u=l*t+o*i-a*r,c=l*r+a*t-s*i,f=l*i+s*r-o*t,p=-s*t-o*r-a*i;return this.x=u*l+p*-s+c*-a-f*-o,this.y=c*l+p*-o+f*-s-u*-a,this.z=f*l+p*-a+u*-o-c*-s,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,r=this.y,i=this.z,s=e.elements;return this.x=s[0]*t+s[4]*r+s[8]*i,this.y=s[1]*t+s[5]*r+s[9]*i,this.z=s[2]*t+s[6]*r+s[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=Math.max(e.x,Math.min(t.x,this.x)),this.y=Math.max(e.y,Math.min(t.y,this.y)),this.z=Math.max(e.z,Math.min(t.z,this.z)),this}clampScalar(e,t){return this.x=Math.max(e,Math.min(t,this.x)),this.y=Math.max(e,Math.min(t,this.y)),this.z=Math.max(e,Math.min(t,this.z)),this}clampLength(e,t){const r=this.length();return this.divideScalar(r||1).multiplyScalar(Math.max(e,Math.min(t,r)))}floor(){return this.x=Math.floor(this.x),this.y=Math.floor(this.y),this.z=Math.floor(this.z),this}ceil(){return this.x=Math.ceil(this.x),this.y=Math.ceil(this.y),this.z=Math.ceil(this.z),this}round(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this.z=Math.round(this.z),this}roundToZero(){return this.x=this.x<0?Math.ceil(this.x):Math.floor(this.x),this.y=this.y<0?Math.ceil(this.y):Math.floor(this.y),this.z=this.z<0?Math.ceil(this.z):Math.floor(this.z),this}negate(){return this.x=-this.x,this.y=-this.y,this.z=-this.z,this}dot(e){return this.x*e.x+this.y*e.y+this.z*e.z}lengthSq(){return this.x*this.x+this.y*this.y+this.z*this.z}length(){return Math.sqrt(this.x*this.x+this.y*this.y+this.z*this.z)}manhattanLength(){return Math.abs(this.x)+Math.abs(this.y)+Math.abs(this.z)}normalize(){return this.divideScalar(this.length()||1)}setLength(e){return this.normalize().multiplyScalar(e)}lerp(e,t){return this.x+=(e.x-this.x)*t,this.y+=(e.y-this.y)*t,this.z+=(e.z-this.z)*t,this}lerpVectors(e,t,r){return this.x=e.x+(t.x-e.x)*r,this.y=e.y+(t.y-e.y)*r,this.z=e.z+(t.z-e.z)*r,this}cross(e){return this.crossVectors(this,e)}crossVectors(e,t){const r=e.x,i=e.y,s=e.z,o=t.x,a=t.y,l=t.z;return this.x=i*l-s*a,this.y=s*o-r*l,this.z=r*a-i*o,this}projectOnVector(e){const t=e.lengthSq();if(t===0)return this.set(0,0,0);const r=e.dot(this)/t;return this.copy(e).multiplyScalar(r)}projectOnPlane(e){return lx.copy(this).projectOnVector(e),this.sub(lx)}reflect(e){return this.sub(lx.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 r=this.dot(e)/t;return Math.acos(ir(r,-1,1))}distanceTo(e){return Math.sqrt(this.distanceToSquared(e))}distanceToSquared(e){const t=this.x-e.x,r=this.y-e.y,i=this.z-e.z;return t*t+r*r+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,r){const i=Math.sin(t)*e;return this.x=i*Math.sin(r),this.y=Math.cos(t)*e,this.z=i*Math.cos(r),this}setFromCylindrical(e){return this.setFromCylindricalCoords(e.radius,e.theta,e.y)}setFromCylindricalCoords(e,t,r){return this.x=e*Math.sin(t),this.y=r,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(),r=this.setFromMatrixColumn(e,1).length(),i=this.setFromMatrixColumn(e,2).length();return this.x=t,this.y=r,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}equals(e){return e.x===this.x&&e.y===this.y&&e.z===this.z}fromArray(e,t=0){return this.x=e[t],this.y=e[t+1],this.z=e[t+2],this}toArray(e=[],t=0){return e[t]=this.x,e[t+1]=this.y,e[t+2]=this.z,e}fromBufferAttribute(e,t){return this.x=e.getX(t),this.y=e.getY(t),this.z=e.getZ(t),this}random(){return this.x=Math.random(),this.y=Math.random(),this.z=Math.random(),this}randomDirection(){const e=(Math.random()-.5)*2,t=Math.random()*Math.PI*2,r=Math.sqrt(1-e**2);return this.x=r*Math.cos(t),this.y=r*Math.sin(t),this.z=e,this}*[Symbol.iterator](){yield this.x,yield this.y,yield this.z}}const lx=new Z,pT=new Pr;function qc(n){return n<.04045?n*.0773993808:Math.pow(n*.9478672986+.0521327014,2.4)}function ux(n){return n<.0031308?n*12.92:1.055*Math.pow(n,.41666)-.055}const M9=new Rr().fromArray([.8224621,.0331941,.0170827,.177538,.9668058,.0723974,-1e-7,1e-7,.9105199]),E9=new Rr().fromArray([1.2249401,-.0420569,-.0196376,-.2249404,1.0420571,-.0786361,1e-7,0,1.0982735]),Za=new Z;function C9(n){return n.convertSRGBToLinear(),Za.set(n.r,n.g,n.b).applyMatrix3(E9),n.setRGB(Za.x,Za.y,Za.z)}function b9(n){return Za.set(n.r,n.g,n.b).applyMatrix3(M9),n.setRGB(Za.x,Za.y,Za.z).convertLinearToSRGB()}const T9={[xf]:n=>n,[Os]:n=>n.convertSRGBToLinear(),[AM]:C9},R9={[xf]:n=>n,[Os]:n=>n.convertLinearToSRGB(),[AM]:b9},$r={enabled:!1,get legacyMode(){return console.warn("THREE.ColorManagement: .legacyMode=false renamed to .enabled=true in r150."),!this.enabled},set legacyMode(n){console.warn("THREE.ColorManagement: .legacyMode=false renamed to .enabled=true in r150."),this.enabled=!n},get workingColorSpace(){return xf},set workingColorSpace(n){console.warn("THREE.ColorManagement: .workingColorSpace is readonly.")},convert:function(n,e,t){if(this.enabled===!1||e===t||!e||!t)return n;const r=T9[e],i=R9[t];if(r===void 0||i===void 0)throw new Error(`Unsupported color space conversion, "${e}" to "${t}".`);return i(r(n))},fromWorkingColorSpace:function(n,e){return this.convert(n,this.workingColorSpace,e)},toWorkingColorSpace:function(n,e){return this.convert(n,e,this.workingColorSpace)}};let tc;class EM{static getDataURL(e){if(/^data:/i.test(e.src)||typeof HTMLCanvasElement>"u")return e.src;let t;if(e instanceof HTMLCanvasElement)t=e;else{tc===void 0&&(tc=ep("canvas")),tc.width=e.width,tc.height=e.height;const r=tc.getContext("2d");e instanceof ImageData?r.putImageData(e,0,0):r.drawImage(e,0,0,e.width,e.height),t=tc}return t.width>2048||t.height>2048?(console.warn("THREE.ImageUtils.getDataURL: Image converted to jpg for performance reasons",e),t.toDataURL("image/jpeg",.6)):t.toDataURL("image/png")}static sRGBToLinear(e){if(typeof HTMLImageElement<"u"&&e instanceof HTMLImageElement||typeof HTMLCanvasElement<"u"&&e instanceof HTMLCanvasElement||typeof ImageBitmap<"u"&&e instanceof ImageBitmap){const t=ep("canvas");t.width=e.width,t.height=e.height;const r=t.getContext("2d");r.drawImage(e,0,0,e.width,e.height);const i=r.getImageData(0,0,e.width,e.height),s=i.data;for(let o=0;o0&&(r.userData=this.userData),t||(e.textures[this.uuid]=r),r}dispose(){this.dispatchEvent({type:"dispose"})}transformUv(e){if(this.mapping!==hy)return e;if(e.applyMatrix3(this.matrix),e.x<0||e.x>1)switch(this.wrapS){case dl:e.x=e.x-Math.floor(e.x);break;case Ur:e.x=e.x<0?0:1;break;case vf: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 dl:e.y=e.y-Math.floor(e.y);break;case Ur:e.y=e.y<0?0:1;break;case vf: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)}}Rn.DEFAULT_IMAGE=null;Rn.DEFAULT_MAPPING=hy;Rn.DEFAULT_ANISOTROPY=1;class vn{constructor(e=0,t=0,r=0,i=1){vn.prototype.isVector4=!0,this.x=e,this.y=t,this.z=r,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,r,i){return this.x=e,this.y=t,this.z=r,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,r=this.y,i=this.z,s=this.w,o=e.elements;return this.x=o[0]*t+o[4]*r+o[8]*i+o[12]*s,this.y=o[1]*t+o[5]*r+o[9]*i+o[13]*s,this.z=o[2]*t+o[6]*r+o[10]*i+o[14]*s,this.w=o[3]*t+o[7]*r+o[11]*i+o[15]*s,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,r,i,s;const l=e.elements,u=l[0],c=l[4],f=l[8],p=l[1],m=l[5],g=l[9],v=l[2],y=l[6],w=l[10];if(Math.abs(c-p)<.01&&Math.abs(f-v)<.01&&Math.abs(g-y)<.01){if(Math.abs(c+p)<.1&&Math.abs(f+v)<.1&&Math.abs(g+y)<.1&&Math.abs(u+m+w-3)<.1)return this.set(1,0,0,0),this;t=Math.PI;const x=(u+1)/2,A=(m+1)/2,C=(w+1)/2,b=(c+p)/4,R=(f+v)/4,E=(g+y)/4;return x>A&&x>C?x<.01?(r=0,i=.707106781,s=.707106781):(r=Math.sqrt(x),i=b/r,s=R/r):A>C?A<.01?(r=.707106781,i=0,s=.707106781):(i=Math.sqrt(A),r=b/i,s=E/i):C<.01?(r=.707106781,i=.707106781,s=0):(s=Math.sqrt(C),r=R/s,i=E/s),this.set(r,i,s,t),this}let _=Math.sqrt((y-g)*(y-g)+(f-v)*(f-v)+(p-c)*(p-c));return Math.abs(_)<.001&&(_=1),this.x=(y-g)/_,this.y=(f-v)/_,this.z=(p-c)/_,this.w=Math.acos((u+m+w-1)/2),this}min(e){return this.x=Math.min(this.x,e.x),this.y=Math.min(this.y,e.y),this.z=Math.min(this.z,e.z),this.w=Math.min(this.w,e.w),this}max(e){return this.x=Math.max(this.x,e.x),this.y=Math.max(this.y,e.y),this.z=Math.max(this.z,e.z),this.w=Math.max(this.w,e.w),this}clamp(e,t){return this.x=Math.max(e.x,Math.min(t.x,this.x)),this.y=Math.max(e.y,Math.min(t.y,this.y)),this.z=Math.max(e.z,Math.min(t.z,this.z)),this.w=Math.max(e.w,Math.min(t.w,this.w)),this}clampScalar(e,t){return this.x=Math.max(e,Math.min(t,this.x)),this.y=Math.max(e,Math.min(t,this.y)),this.z=Math.max(e,Math.min(t,this.z)),this.w=Math.max(e,Math.min(t,this.w)),this}clampLength(e,t){const r=this.length();return this.divideScalar(r||1).multiplyScalar(Math.max(e,Math.min(t,r)))}floor(){return this.x=Math.floor(this.x),this.y=Math.floor(this.y),this.z=Math.floor(this.z),this.w=Math.floor(this.w),this}ceil(){return this.x=Math.ceil(this.x),this.y=Math.ceil(this.y),this.z=Math.ceil(this.z),this.w=Math.ceil(this.w),this}round(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this.z=Math.round(this.z),this.w=Math.round(this.w),this}roundToZero(){return this.x=this.x<0?Math.ceil(this.x):Math.floor(this.x),this.y=this.y<0?Math.ceil(this.y):Math.floor(this.y),this.z=this.z<0?Math.ceil(this.z):Math.floor(this.z),this.w=this.w<0?Math.ceil(this.w):Math.floor(this.w),this}negate(){return this.x=-this.x,this.y=-this.y,this.z=-this.z,this.w=-this.w,this}dot(e){return this.x*e.x+this.y*e.y+this.z*e.z+this.w*e.w}lengthSq(){return this.x*this.x+this.y*this.y+this.z*this.z+this.w*this.w}length(){return Math.sqrt(this.x*this.x+this.y*this.y+this.z*this.z+this.w*this.w)}manhattanLength(){return Math.abs(this.x)+Math.abs(this.y)+Math.abs(this.z)+Math.abs(this.w)}normalize(){return this.divideScalar(this.length()||1)}setLength(e){return this.normalize().multiplyScalar(e)}lerp(e,t){return this.x+=(e.x-this.x)*t,this.y+=(e.y-this.y)*t,this.z+=(e.z-this.z)*t,this.w+=(e.w-this.w)*t,this}lerpVectors(e,t,r){return this.x=e.x+(t.x-e.x)*r,this.y=e.y+(t.y-e.y)*r,this.z=e.z+(t.z-e.z)*r,this.w=e.w+(t.w-e.w)*r,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 ri extends bo{constructor(e=1,t=1,r={}){super(),this.isWebGLRenderTarget=!0,this.width=e,this.height=t,this.depth=1,this.scissor=new vn(0,0,e,t),this.scissorTest=!1,this.viewport=new vn(0,0,e,t);const i={width:e,height:t,depth:1};this.texture=new Rn(i,r.mapping,r.wrapS,r.wrapT,r.magFilter,r.minFilter,r.format,r.type,r.anisotropy,r.encoding),this.texture.isRenderTargetTexture=!0,this.texture.flipY=!1,this.texture.generateMipmaps=r.generateMipmaps!==void 0?r.generateMipmaps:!1,this.texture.internalFormat=r.internalFormat!==void 0?r.internalFormat:null,this.texture.minFilter=r.minFilter!==void 0?r.minFilter:gn,this.depthBuffer=r.depthBuffer!==void 0?r.depthBuffer:!0,this.stencilBuffer=r.stencilBuffer!==void 0?r.stencilBuffer:!1,this.depthTexture=r.depthTexture!==void 0?r.depthTexture:null,this.samples=r.samples!==void 0?r.samples:0}setSize(e,t,r=1){(this.width!==e||this.height!==t||this.depth!==r)&&(this.width=e,this.height=t,this.depth=r,this.texture.image.width=e,this.texture.image.height=t,this.texture.image.depth=r,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.viewport.copy(e.viewport),this.texture=e.texture.clone(),this.texture.isRenderTargetTexture=!0;const t=Object.assign({},e.texture.image);return this.texture.source=new lu(t),this.depthBuffer=e.depthBuffer,this.stencilBuffer=e.stencilBuffer,e.depthTexture!==null&&(this.depthTexture=e.depthTexture.clone()),this.samples=e.samples,this}dispose(){this.dispatchEvent({type:"dispose"})}}class my extends Rn{constructor(e=null,t=1,r=1,i=1){super(null),this.isDataArrayTexture=!0,this.image={data:e,width:t,height:r,depth:i},this.magFilter=Zn,this.minFilter=Zn,this.wrapR=Ur,this.generateMipmaps=!1,this.flipY=!1,this.unpackAlignment=1}}class P9 extends ri{constructor(e=1,t=1,r=1){super(e,t),this.isWebGLArrayRenderTarget=!0,this.depth=r,this.texture=new my(null,e,t,r),this.texture.isRenderTargetTexture=!0}}class CM extends Rn{constructor(e=null,t=1,r=1,i=1){super(null),this.isData3DTexture=!0,this.image={data:e,width:t,height:r,depth:i},this.magFilter=Zn,this.minFilter=Zn,this.wrapR=Ur,this.generateMipmaps=!1,this.flipY=!1,this.unpackAlignment=1}}class I9 extends ri{constructor(e=1,t=1,r=1){super(e,t),this.isWebGL3DRenderTarget=!0,this.depth=r,this.texture=new CM(null,e,t,r),this.texture.isRenderTargetTexture=!0}}class L9 extends ri{constructor(e=1,t=1,r=1,i={}){super(e,t,i),this.isWebGLMultipleRenderTargets=!0;const s=this.texture;this.texture=[];for(let o=0;os&&(s=c),f>o&&(o=f),p>a&&(a=p)}return this.min.set(t,r,i),this.max.set(s,o,a),this}setFromBufferAttribute(e){let t=1/0,r=1/0,i=1/0,s=-1/0,o=-1/0,a=-1/0;for(let l=0,u=e.count;ls&&(s=c),f>o&&(o=f),p>a&&(a=p)}return this.min.set(t,r,i),this.max.set(s,o,a),this}setFromPoints(e){this.makeEmpty();for(let t=0,r=e.length;tthis.max.x||e.ythis.max.y||e.zthis.max.z)}containsBox(e){return this.min.x<=e.min.x&&e.max.x<=this.max.x&&this.min.y<=e.min.y&&e.max.y<=this.max.y&&this.min.z<=e.min.z&&e.max.z<=this.max.z}getParameter(e,t){return t.set((e.x-this.min.x)/(this.max.x-this.min.x),(e.y-this.min.y)/(this.max.y-this.min.y),(e.z-this.min.z)/(this.max.z-this.min.z))}intersectsBox(e){return!(e.max.xthis.max.x||e.max.ythis.max.y||e.max.zthis.max.z)}intersectsSphere(e){return this.clampPoint(e.center,Ol),Ol.distanceToSquared(e.center)<=e.radius*e.radius}intersectsPlane(e){let t,r;return e.normal.x>0?(t=e.normal.x*this.min.x,r=e.normal.x*this.max.x):(t=e.normal.x*this.max.x,r=e.normal.x*this.min.x),e.normal.y>0?(t+=e.normal.y*this.min.y,r+=e.normal.y*this.max.y):(t+=e.normal.y*this.max.y,r+=e.normal.y*this.min.y),e.normal.z>0?(t+=e.normal.z*this.min.z,r+=e.normal.z*this.max.z):(t+=e.normal.z*this.max.z,r+=e.normal.z*this.min.z),t<=-e.constant&&r>=-e.constant}intersectsTriangle(e){if(this.isEmpty())return!1;this.getCenter(wh),og.subVectors(this.max,wh),nc.subVectors(e.a,wh),rc.subVectors(e.b,wh),ic.subVectors(e.c,wh),Pa.subVectors(rc,nc),Ia.subVectors(ic,rc),Ul.subVectors(nc,ic);let t=[0,-Pa.z,Pa.y,0,-Ia.z,Ia.y,0,-Ul.z,Ul.y,Pa.z,0,-Pa.x,Ia.z,0,-Ia.x,Ul.z,0,-Ul.x,-Pa.y,Pa.x,0,-Ia.y,Ia.x,0,-Ul.y,Ul.x,0];return!hx(t,nc,rc,ic,og)||(t=[1,0,0,0,1,0,0,0,1],!hx(t,nc,rc,ic,og))?!1:(ag.crossVectors(Pa,Ia),t=[ag.x,ag.y,ag.z],hx(t,nc,rc,ic,og))}clampPoint(e,t){return t.copy(e).clamp(this.min,this.max)}distanceToPoint(e){return this.clampPoint(e,Ol).distanceTo(e)}getBoundingSphere(e){return this.isEmpty()?e.makeEmpty():(this.getCenter(e.center),e.radius=this.getSize(Ol).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:(zo[0].set(this.min.x,this.min.y,this.min.z).applyMatrix4(e),zo[1].set(this.min.x,this.min.y,this.max.z).applyMatrix4(e),zo[2].set(this.min.x,this.max.y,this.min.z).applyMatrix4(e),zo[3].set(this.min.x,this.max.y,this.max.z).applyMatrix4(e),zo[4].set(this.max.x,this.min.y,this.min.z).applyMatrix4(e),zo[5].set(this.max.x,this.min.y,this.max.z).applyMatrix4(e),zo[6].set(this.max.x,this.max.y,this.min.z).applyMatrix4(e),zo[7].set(this.max.x,this.max.y,this.max.z).applyMatrix4(e),this.setFromPoints(zo),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 zo=[new Z,new Z,new Z,new Z,new Z,new Z,new Z,new Z],Ol=new Z,fx=new Zs,nc=new Z,rc=new Z,ic=new Z,Pa=new Z,Ia=new Z,Ul=new Z,wh=new Z,og=new Z,ag=new Z,zl=new Z;function hx(n,e,t,r,i){for(let s=0,o=n.length-3;s<=o;s+=3){zl.fromArray(n,s);const a=i.x*Math.abs(zl.x)+i.y*Math.abs(zl.y)+i.z*Math.abs(zl.z),l=e.dot(zl),u=t.dot(zl),c=r.dot(zl);if(Math.max(-Math.max(l,u,c),Math.min(l,u,c))>a)return!1}return!0}const D9=new Zs,Sh=new Z,dx=new Z;let To=class{constructor(e=new Z,t=-1){this.center=e,this.radius=t}set(e,t){return this.center.copy(e),this.radius=t,this}setFromPoints(e,t){const r=this.center;t!==void 0?r.copy(t):D9.setFromPoints(e).getCenter(r);let i=0;for(let s=0,o=e.length;sthis.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;Sh.subVectors(e,this.center);const t=Sh.lengthSq();if(t>this.radius*this.radius){const r=Math.sqrt(t),i=(r-this.radius)*.5;this.center.addScaledVector(Sh,i/r),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):(dx.subVectors(e.center,this.center).setLength(e.radius),this.expandByPoint(Sh.copy(e.center).add(dx)),this.expandByPoint(Sh.copy(e.center).sub(dx))),this)}equals(e){return e.center.equals(this.center)&&e.radius===this.radius}clone(){return new this.constructor().copy(this)}};const Go=new Z,px=new Z,lg=new Z,La=new Z,mx=new Z,ug=new Z,gx=new Z;class Sp{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,Go)),this}closestPointToPoint(e,t){t.subVectors(e,this.origin);const r=t.dot(this.direction);return r<0?t.copy(this.origin):t.copy(this.origin).addScaledVector(this.direction,r)}distanceToPoint(e){return Math.sqrt(this.distanceSqToPoint(e))}distanceSqToPoint(e){const t=Go.subVectors(e,this.origin).dot(this.direction);return t<0?this.origin.distanceToSquared(e):(Go.copy(this.origin).addScaledVector(this.direction,t),Go.distanceToSquared(e))}distanceSqToSegment(e,t,r,i){px.copy(e).add(t).multiplyScalar(.5),lg.copy(t).sub(e).normalize(),La.copy(this.origin).sub(px);const s=e.distanceTo(t)*.5,o=-this.direction.dot(lg),a=La.dot(this.direction),l=-La.dot(lg),u=La.lengthSq(),c=Math.abs(1-o*o);let f,p,m,g;if(c>0)if(f=o*l-a,p=o*a-l,g=s*c,f>=0)if(p>=-g)if(p<=g){const v=1/c;f*=v,p*=v,m=f*(f+o*p+2*a)+p*(o*f+p+2*l)+u}else p=s,f=Math.max(0,-(o*p+a)),m=-f*f+p*(p+2*l)+u;else p=-s,f=Math.max(0,-(o*p+a)),m=-f*f+p*(p+2*l)+u;else p<=-g?(f=Math.max(0,-(-o*s+a)),p=f>0?-s:Math.min(Math.max(-s,-l),s),m=-f*f+p*(p+2*l)+u):p<=g?(f=0,p=Math.min(Math.max(-s,-l),s),m=p*(p+2*l)+u):(f=Math.max(0,-(o*s+a)),p=f>0?s:Math.min(Math.max(-s,-l),s),m=-f*f+p*(p+2*l)+u);else p=o>0?-s:s,f=Math.max(0,-(o*p+a)),m=-f*f+p*(p+2*l)+u;return r&&r.copy(this.origin).addScaledVector(this.direction,f),i&&i.copy(px).addScaledVector(lg,p),m}intersectSphere(e,t){Go.subVectors(e.center,this.origin);const r=Go.dot(this.direction),i=Go.dot(Go)-r*r,s=e.radius*e.radius;if(i>s)return null;const o=Math.sqrt(s-i),a=r-o,l=r+o;return l<0?null:a<0?this.at(l,t):this.at(a,t)}intersectsSphere(e){return this.distanceSqToPoint(e.center)<=e.radius*e.radius}distanceToPlane(e){const t=e.normal.dot(this.direction);if(t===0)return e.distanceToPoint(this.origin)===0?0:null;const r=-(this.origin.dot(e.normal)+e.constant)/t;return r>=0?r:null}intersectPlane(e,t){const r=this.distanceToPlane(e);return r===null?null:this.at(r,t)}intersectsPlane(e){const t=e.distanceToPoint(this.origin);return t===0||e.normal.dot(this.direction)*t<0}intersectBox(e,t){let r,i,s,o,a,l;const u=1/this.direction.x,c=1/this.direction.y,f=1/this.direction.z,p=this.origin;return u>=0?(r=(e.min.x-p.x)*u,i=(e.max.x-p.x)*u):(r=(e.max.x-p.x)*u,i=(e.min.x-p.x)*u),c>=0?(s=(e.min.y-p.y)*c,o=(e.max.y-p.y)*c):(s=(e.max.y-p.y)*c,o=(e.min.y-p.y)*c),r>o||s>i||((s>r||isNaN(r))&&(r=s),(o=0?(a=(e.min.z-p.z)*f,l=(e.max.z-p.z)*f):(a=(e.max.z-p.z)*f,l=(e.min.z-p.z)*f),r>l||a>i)||((a>r||r!==r)&&(r=a),(l=0?r:i,t)}intersectsBox(e){return this.intersectBox(e,Go)!==null}intersectTriangle(e,t,r,i,s){mx.subVectors(t,e),ug.subVectors(r,e),gx.crossVectors(mx,ug);let o=this.direction.dot(gx),a;if(o>0){if(i)return null;a=1}else if(o<0)a=-1,o=-o;else return null;La.subVectors(this.origin,e);const l=a*this.direction.dot(ug.crossVectors(La,ug));if(l<0)return null;const u=a*this.direction.dot(mx.cross(La));if(u<0||l+u>o)return null;const c=-a*La.dot(gx);return c<0?null:this.at(c/o,s)}applyMatrix4(e){return this.origin.applyMatrix4(e),this.direction.transformDirection(e),this}equals(e){return e.origin.equals(this.origin)&&e.direction.equals(this.direction)}clone(){return new this.constructor().copy(this)}}class Lt{constructor(){Lt.prototype.isMatrix4=!0,this.elements=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1]}set(e,t,r,i,s,o,a,l,u,c,f,p,m,g,v,y){const w=this.elements;return w[0]=e,w[4]=t,w[8]=r,w[12]=i,w[1]=s,w[5]=o,w[9]=a,w[13]=l,w[2]=u,w[6]=c,w[10]=f,w[14]=p,w[3]=m,w[7]=g,w[11]=v,w[15]=y,this}identity(){return this.set(1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1),this}clone(){return new Lt().fromArray(this.elements)}copy(e){const t=this.elements,r=e.elements;return t[0]=r[0],t[1]=r[1],t[2]=r[2],t[3]=r[3],t[4]=r[4],t[5]=r[5],t[6]=r[6],t[7]=r[7],t[8]=r[8],t[9]=r[9],t[10]=r[10],t[11]=r[11],t[12]=r[12],t[13]=r[13],t[14]=r[14],t[15]=r[15],this}copyPosition(e){const t=this.elements,r=e.elements;return t[12]=r[12],t[13]=r[13],t[14]=r[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,r){return e.setFromMatrixColumn(this,0),t.setFromMatrixColumn(this,1),r.setFromMatrixColumn(this,2),this}makeBasis(e,t,r){return this.set(e.x,t.x,r.x,0,e.y,t.y,r.y,0,e.z,t.z,r.z,0,0,0,0,1),this}extractRotation(e){const t=this.elements,r=e.elements,i=1/sc.setFromMatrixColumn(e,0).length(),s=1/sc.setFromMatrixColumn(e,1).length(),o=1/sc.setFromMatrixColumn(e,2).length();return t[0]=r[0]*i,t[1]=r[1]*i,t[2]=r[2]*i,t[3]=0,t[4]=r[4]*s,t[5]=r[5]*s,t[6]=r[6]*s,t[7]=0,t[8]=r[8]*o,t[9]=r[9]*o,t[10]=r[10]*o,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,this}makeRotationFromEuler(e){const t=this.elements,r=e.x,i=e.y,s=e.z,o=Math.cos(r),a=Math.sin(r),l=Math.cos(i),u=Math.sin(i),c=Math.cos(s),f=Math.sin(s);if(e.order==="XYZ"){const p=o*c,m=o*f,g=a*c,v=a*f;t[0]=l*c,t[4]=-l*f,t[8]=u,t[1]=m+g*u,t[5]=p-v*u,t[9]=-a*l,t[2]=v-p*u,t[6]=g+m*u,t[10]=o*l}else if(e.order==="YXZ"){const p=l*c,m=l*f,g=u*c,v=u*f;t[0]=p+v*a,t[4]=g*a-m,t[8]=o*u,t[1]=o*f,t[5]=o*c,t[9]=-a,t[2]=m*a-g,t[6]=v+p*a,t[10]=o*l}else if(e.order==="ZXY"){const p=l*c,m=l*f,g=u*c,v=u*f;t[0]=p-v*a,t[4]=-o*f,t[8]=g+m*a,t[1]=m+g*a,t[5]=o*c,t[9]=v-p*a,t[2]=-o*u,t[6]=a,t[10]=o*l}else if(e.order==="ZYX"){const p=o*c,m=o*f,g=a*c,v=a*f;t[0]=l*c,t[4]=g*u-m,t[8]=p*u+v,t[1]=l*f,t[5]=v*u+p,t[9]=m*u-g,t[2]=-u,t[6]=a*l,t[10]=o*l}else if(e.order==="YZX"){const p=o*l,m=o*u,g=a*l,v=a*u;t[0]=l*c,t[4]=v-p*f,t[8]=g*f+m,t[1]=f,t[5]=o*c,t[9]=-a*c,t[2]=-u*c,t[6]=m*f+g,t[10]=p-v*f}else if(e.order==="XZY"){const p=o*l,m=o*u,g=a*l,v=a*u;t[0]=l*c,t[4]=-f,t[8]=u*c,t[1]=p*f+v,t[5]=o*c,t[9]=m*f-g,t[2]=g*f-m,t[6]=a*c,t[10]=v*f+p}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(k9,e,F9)}lookAt(e,t,r){const i=this.elements;return ji.subVectors(e,t),ji.lengthSq()===0&&(ji.z=1),ji.normalize(),Da.crossVectors(r,ji),Da.lengthSq()===0&&(Math.abs(r.z)===1?ji.x+=1e-4:ji.z+=1e-4,ji.normalize(),Da.crossVectors(r,ji)),Da.normalize(),cg.crossVectors(ji,Da),i[0]=Da.x,i[4]=cg.x,i[8]=ji.x,i[1]=Da.y,i[5]=cg.y,i[9]=ji.y,i[2]=Da.z,i[6]=cg.z,i[10]=ji.z,this}multiply(e){return this.multiplyMatrices(this,e)}premultiply(e){return this.multiplyMatrices(e,this)}multiplyMatrices(e,t){const r=e.elements,i=t.elements,s=this.elements,o=r[0],a=r[4],l=r[8],u=r[12],c=r[1],f=r[5],p=r[9],m=r[13],g=r[2],v=r[6],y=r[10],w=r[14],_=r[3],x=r[7],A=r[11],C=r[15],b=i[0],R=i[4],E=i[8],B=i[12],D=i[1],U=i[5],z=i[9],Y=i[13],P=i[2],F=i[6],G=i[10],ie=i[14],N=i[3],V=i[7],j=i[11],W=i[15];return s[0]=o*b+a*D+l*P+u*N,s[4]=o*R+a*U+l*F+u*V,s[8]=o*E+a*z+l*G+u*j,s[12]=o*B+a*Y+l*ie+u*W,s[1]=c*b+f*D+p*P+m*N,s[5]=c*R+f*U+p*F+m*V,s[9]=c*E+f*z+p*G+m*j,s[13]=c*B+f*Y+p*ie+m*W,s[2]=g*b+v*D+y*P+w*N,s[6]=g*R+v*U+y*F+w*V,s[10]=g*E+v*z+y*G+w*j,s[14]=g*B+v*Y+y*ie+w*W,s[3]=_*b+x*D+A*P+C*N,s[7]=_*R+x*U+A*F+C*V,s[11]=_*E+x*z+A*G+C*j,s[15]=_*B+x*Y+A*ie+C*W,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],r=e[4],i=e[8],s=e[12],o=e[1],a=e[5],l=e[9],u=e[13],c=e[2],f=e[6],p=e[10],m=e[14],g=e[3],v=e[7],y=e[11],w=e[15];return g*(+s*l*f-i*u*f-s*a*p+r*u*p+i*a*m-r*l*m)+v*(+t*l*m-t*u*p+s*o*p-i*o*m+i*u*c-s*l*c)+y*(+t*u*f-t*a*m-s*o*f+r*o*m+s*a*c-r*u*c)+w*(-i*a*c-t*l*f+t*a*p+i*o*f-r*o*p+r*l*c)}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,r){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]=r),this}invert(){const e=this.elements,t=e[0],r=e[1],i=e[2],s=e[3],o=e[4],a=e[5],l=e[6],u=e[7],c=e[8],f=e[9],p=e[10],m=e[11],g=e[12],v=e[13],y=e[14],w=e[15],_=f*y*u-v*p*u+v*l*m-a*y*m-f*l*w+a*p*w,x=g*p*u-c*y*u-g*l*m+o*y*m+c*l*w-o*p*w,A=c*v*u-g*f*u+g*a*m-o*v*m-c*a*w+o*f*w,C=g*f*l-c*v*l-g*a*p+o*v*p+c*a*y-o*f*y,b=t*_+r*x+i*A+s*C;if(b===0)return this.set(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0);const R=1/b;return e[0]=_*R,e[1]=(v*p*s-f*y*s-v*i*m+r*y*m+f*i*w-r*p*w)*R,e[2]=(a*y*s-v*l*s+v*i*u-r*y*u-a*i*w+r*l*w)*R,e[3]=(f*l*s-a*p*s-f*i*u+r*p*u+a*i*m-r*l*m)*R,e[4]=x*R,e[5]=(c*y*s-g*p*s+g*i*m-t*y*m-c*i*w+t*p*w)*R,e[6]=(g*l*s-o*y*s-g*i*u+t*y*u+o*i*w-t*l*w)*R,e[7]=(o*p*s-c*l*s+c*i*u-t*p*u-o*i*m+t*l*m)*R,e[8]=A*R,e[9]=(g*f*s-c*v*s-g*r*m+t*v*m+c*r*w-t*f*w)*R,e[10]=(o*v*s-g*a*s+g*r*u-t*v*u-o*r*w+t*a*w)*R,e[11]=(c*a*s-o*f*s-c*r*u+t*f*u+o*r*m-t*a*m)*R,e[12]=C*R,e[13]=(c*v*i-g*f*i+g*r*p-t*v*p-c*r*y+t*f*y)*R,e[14]=(g*a*i-o*v*i-g*r*l+t*v*l+o*r*y-t*a*y)*R,e[15]=(o*f*i-c*a*i+c*r*l-t*f*l-o*r*p+t*a*p)*R,this}scale(e){const t=this.elements,r=e.x,i=e.y,s=e.z;return t[0]*=r,t[4]*=i,t[8]*=s,t[1]*=r,t[5]*=i,t[9]*=s,t[2]*=r,t[6]*=i,t[10]*=s,t[3]*=r,t[7]*=i,t[11]*=s,this}getMaxScaleOnAxis(){const e=this.elements,t=e[0]*e[0]+e[1]*e[1]+e[2]*e[2],r=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,r,i))}makeTranslation(e,t,r){return this.set(1,0,0,e,0,1,0,t,0,0,1,r,0,0,0,1),this}makeRotationX(e){const t=Math.cos(e),r=Math.sin(e);return this.set(1,0,0,0,0,t,-r,0,0,r,t,0,0,0,0,1),this}makeRotationY(e){const t=Math.cos(e),r=Math.sin(e);return this.set(t,0,r,0,0,1,0,0,-r,0,t,0,0,0,0,1),this}makeRotationZ(e){const t=Math.cos(e),r=Math.sin(e);return this.set(t,-r,0,0,r,t,0,0,0,0,1,0,0,0,0,1),this}makeRotationAxis(e,t){const r=Math.cos(t),i=Math.sin(t),s=1-r,o=e.x,a=e.y,l=e.z,u=s*o,c=s*a;return this.set(u*o+r,u*a-i*l,u*l+i*a,0,u*a+i*l,c*a+r,c*l-i*o,0,u*l-i*a,c*l+i*o,s*l*l+r,0,0,0,0,1),this}makeScale(e,t,r){return this.set(e,0,0,0,0,t,0,0,0,0,r,0,0,0,0,1),this}makeShear(e,t,r,i,s,o){return this.set(1,r,s,0,e,1,o,0,t,i,1,0,0,0,0,1),this}compose(e,t,r){const i=this.elements,s=t._x,o=t._y,a=t._z,l=t._w,u=s+s,c=o+o,f=a+a,p=s*u,m=s*c,g=s*f,v=o*c,y=o*f,w=a*f,_=l*u,x=l*c,A=l*f,C=r.x,b=r.y,R=r.z;return i[0]=(1-(v+w))*C,i[1]=(m+A)*C,i[2]=(g-x)*C,i[3]=0,i[4]=(m-A)*b,i[5]=(1-(p+w))*b,i[6]=(y+_)*b,i[7]=0,i[8]=(g+x)*R,i[9]=(y-_)*R,i[10]=(1-(p+v))*R,i[11]=0,i[12]=e.x,i[13]=e.y,i[14]=e.z,i[15]=1,this}decompose(e,t,r){const i=this.elements;let s=sc.set(i[0],i[1],i[2]).length();const o=sc.set(i[4],i[5],i[6]).length(),a=sc.set(i[8],i[9],i[10]).length();this.determinant()<0&&(s=-s),e.x=i[12],e.y=i[13],e.z=i[14],Is.copy(this);const u=1/s,c=1/o,f=1/a;return Is.elements[0]*=u,Is.elements[1]*=u,Is.elements[2]*=u,Is.elements[4]*=c,Is.elements[5]*=c,Is.elements[6]*=c,Is.elements[8]*=f,Is.elements[9]*=f,Is.elements[10]*=f,t.setFromRotationMatrix(Is),r.x=s,r.y=o,r.z=a,this}makePerspective(e,t,r,i,s,o){const a=this.elements,l=2*s/(t-e),u=2*s/(r-i),c=(t+e)/(t-e),f=(r+i)/(r-i),p=-(o+s)/(o-s),m=-2*o*s/(o-s);return a[0]=l,a[4]=0,a[8]=c,a[12]=0,a[1]=0,a[5]=u,a[9]=f,a[13]=0,a[2]=0,a[6]=0,a[10]=p,a[14]=m,a[3]=0,a[7]=0,a[11]=-1,a[15]=0,this}makeOrthographic(e,t,r,i,s,o){const a=this.elements,l=1/(t-e),u=1/(r-i),c=1/(o-s),f=(t+e)*l,p=(r+i)*u,m=(o+s)*c;return a[0]=2*l,a[4]=0,a[8]=0,a[12]=-f,a[1]=0,a[5]=2*u,a[9]=0,a[13]=-p,a[2]=0,a[6]=0,a[10]=-2*c,a[14]=-m,a[3]=0,a[7]=0,a[11]=0,a[15]=1,this}equals(e){const t=this.elements,r=e.elements;for(let i=0;i<16;i++)if(t[i]!==r[i])return!1;return!0}fromArray(e,t=0){for(let r=0;r<16;r++)this.elements[r]=e[r+t];return this}toArray(e=[],t=0){const r=this.elements;return e[t]=r[0],e[t+1]=r[1],e[t+2]=r[2],e[t+3]=r[3],e[t+4]=r[4],e[t+5]=r[5],e[t+6]=r[6],e[t+7]=r[7],e[t+8]=r[8],e[t+9]=r[9],e[t+10]=r[10],e[t+11]=r[11],e[t+12]=r[12],e[t+13]=r[13],e[t+14]=r[14],e[t+15]=r[15],e}}const sc=new Z,Is=new Lt,k9=new Z(0,0,0),F9=new Z(1,1,1),Da=new Z,cg=new Z,ji=new Z,mT=new Lt,gT=new Pr;class Ap{constructor(e=0,t=0,r=0,i=Ap.DEFAULT_ORDER){this.isEuler=!0,this._x=e,this._y=t,this._z=r,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,r,i=this._order){return this._x=e,this._y=t,this._z=r,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,r=!0){const i=e.elements,s=i[0],o=i[4],a=i[8],l=i[1],u=i[5],c=i[9],f=i[2],p=i[6],m=i[10];switch(t){case"XYZ":this._y=Math.asin(ir(a,-1,1)),Math.abs(a)<.9999999?(this._x=Math.atan2(-c,m),this._z=Math.atan2(-o,s)):(this._x=Math.atan2(p,u),this._z=0);break;case"YXZ":this._x=Math.asin(-ir(c,-1,1)),Math.abs(c)<.9999999?(this._y=Math.atan2(a,m),this._z=Math.atan2(l,u)):(this._y=Math.atan2(-f,s),this._z=0);break;case"ZXY":this._x=Math.asin(ir(p,-1,1)),Math.abs(p)<.9999999?(this._y=Math.atan2(-f,m),this._z=Math.atan2(-o,u)):(this._y=0,this._z=Math.atan2(l,s));break;case"ZYX":this._y=Math.asin(-ir(f,-1,1)),Math.abs(f)<.9999999?(this._x=Math.atan2(p,m),this._z=Math.atan2(l,s)):(this._x=0,this._z=Math.atan2(-o,u));break;case"YZX":this._z=Math.asin(ir(l,-1,1)),Math.abs(l)<.9999999?(this._x=Math.atan2(-c,u),this._y=Math.atan2(-f,s)):(this._x=0,this._y=Math.atan2(a,m));break;case"XZY":this._z=Math.asin(-ir(o,-1,1)),Math.abs(o)<.9999999?(this._x=Math.atan2(p,u),this._y=Math.atan2(a,s)):(this._x=Math.atan2(-c,m),this._y=0);break;default:console.warn("THREE.Euler: .setFromRotationMatrix() encountered an unknown order: "+t)}return this._order=t,r===!0&&this._onChangeCallback(),this}setFromQuaternion(e,t,r){return mT.makeRotationFromQuaternion(e),this.setFromRotationMatrix(mT,t,r)}setFromVector3(e,t=this._order){return this.set(e.x,e.y,e.z,t)}reorder(e){return gT.setFromEuler(this),this.setFromQuaternion(gT,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}}Ap.DEFAULT_ORDER="XYZ";class gu{constructor(){this.mask=1}set(e){this.mask=(1<>>0}enable(e){this.mask|=1<1){for(let t=0;t1){for(let r=0;r0&&(r=r.concat(o))}return r}getWorldPosition(e){return this.updateWorldMatrix(!0,!1),e.setFromMatrixPosition(this.matrixWorld)}getWorldQuaternion(e){return this.updateWorldMatrix(!0,!1),this.matrixWorld.decompose(Ah,e,O9),e}getWorldScale(e){return this.updateWorldMatrix(!0,!1),this.matrixWorld.decompose(Ah,U9,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 r=0,i=t.length;r0&&(i.userData=this.userData),i.layers=this.layers.mask,i.matrix=this.matrix.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()));function s(a,l){return a[l.uuid]===void 0&&(a[l.uuid]=l.toJSON(e)),l.uuid}if(this.isScene)this.background&&(this.background.isColor?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=s(e.geometries,this.geometry);const a=this.geometry.parameters;if(a!==void 0&&a.shapes!==void 0){const l=a.shapes;if(Array.isArray(l))for(let u=0,c=l.length;u0){i.children=[];for(let a=0;a0){i.animations=[];for(let a=0;a0&&(r.geometries=a),l.length>0&&(r.materials=l),u.length>0&&(r.textures=u),c.length>0&&(r.images=c),f.length>0&&(r.shapes=f),p.length>0&&(r.skeletons=p),m.length>0&&(r.animations=m),g.length>0&&(r.nodes=g)}return r.object=i,r;function o(a){const l=[];for(const u in a){const c=a[u];delete c.metadata,l.push(c)}return l}}clone(e){return new this.constructor().copy(this,e)}copy(e,t=!0){if(this.name=e.name,this.up.copy(e.up),this.position.copy(e.position),this.rotation.order=e.rotation.order,this.quaternion.copy(e.quaternion),this.scale.copy(e.scale),this.matrix.copy(e.matrix),this.matrixWorld.copy(e.matrixWorld),this.matrixAutoUpdate=e.matrixAutoUpdate,this.matrixWorldNeedsUpdate=e.matrixWorldNeedsUpdate,this.matrixWorldAutoUpdate=e.matrixWorldAutoUpdate,this.layers.mask=e.layers.mask,this.visible=e.visible,this.castShadow=e.castShadow,this.receiveShadow=e.receiveShadow,this.frustumCulled=e.frustumCulled,this.renderOrder=e.renderOrder,this.userData=JSON.parse(JSON.stringify(e.userData)),t===!0)for(let r=0;r0?i.multiplyScalar(1/Math.sqrt(s)):i.set(0,0,0)}static getBarycoord(e,t,r,i,s){Ls.subVectors(i,t),Vo.subVectors(r,t),vx.subVectors(e,t);const o=Ls.dot(Ls),a=Ls.dot(Vo),l=Ls.dot(vx),u=Vo.dot(Vo),c=Vo.dot(vx),f=o*u-a*a;if(f===0)return s.set(-2,-1,-1);const p=1/f,m=(u*l-a*c)*p,g=(o*c-a*l)*p;return s.set(1-m-g,g,m)}static containsPoint(e,t,r,i){return this.getBarycoord(e,t,r,i,Wo),Wo.x>=0&&Wo.y>=0&&Wo.x+Wo.y<=1}static getUV(e,t,r,i,s,o,a,l){return this.getBarycoord(e,t,r,i,Wo),l.set(0,0),l.addScaledVector(s,Wo.x),l.addScaledVector(o,Wo.y),l.addScaledVector(a,Wo.z),l}static isFrontFacing(e,t,r,i){return Ls.subVectors(r,t),Vo.subVectors(e,t),Ls.cross(Vo).dot(i)<0}set(e,t,r){return this.a.copy(e),this.b.copy(t),this.c.copy(r),this}setFromPointsAndIndices(e,t,r,i){return this.a.copy(e[t]),this.b.copy(e[r]),this.c.copy(e[i]),this}setFromAttributeAndIndices(e,t,r,i){return this.a.fromBufferAttribute(e,t),this.b.fromBufferAttribute(e,r),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 Ls.subVectors(this.c,this.b),Vo.subVectors(this.a,this.b),Ls.cross(Vo).length()*.5}getMidpoint(e){return e.addVectors(this.a,this.b).add(this.c).multiplyScalar(1/3)}getNormal(e){return _s.getNormal(this.a,this.b,this.c,e)}getPlane(e){return e.setFromCoplanarPoints(this.a,this.b,this.c)}getBarycoord(e,t){return _s.getBarycoord(e,this.a,this.b,this.c,t)}getUV(e,t,r,i,s){return _s.getUV(e,this.a,this.b,this.c,t,r,i,s)}containsPoint(e){return _s.containsPoint(e,this.a,this.b,this.c)}isFrontFacing(e){return _s.isFrontFacing(this.a,this.b,this.c,e)}intersectsBox(e){return e.intersectsTriangle(this)}closestPointToPoint(e,t){const r=this.a,i=this.b,s=this.c;let o,a;ac.subVectors(i,r),lc.subVectors(s,r),yx.subVectors(e,r);const l=ac.dot(yx),u=lc.dot(yx);if(l<=0&&u<=0)return t.copy(r);xx.subVectors(e,i);const c=ac.dot(xx),f=lc.dot(xx);if(c>=0&&f<=c)return t.copy(i);const p=l*f-c*u;if(p<=0&&l>=0&&c<=0)return o=l/(l-c),t.copy(r).addScaledVector(ac,o);_x.subVectors(e,s);const m=ac.dot(_x),g=lc.dot(_x);if(g>=0&&m<=g)return t.copy(s);const v=m*u-l*g;if(v<=0&&u>=0&&g<=0)return a=u/(u-g),t.copy(r).addScaledVector(lc,a);const y=c*g-m*f;if(y<=0&&f-c>=0&&m-g>=0)return ST.subVectors(s,i),a=(f-c)/(f-c+(m-g)),t.copy(i).addScaledVector(ST,a);const w=1/(y+v+p);return o=v*w,a=p*w,t.copy(r).addScaledVector(ac,o).addScaledVector(lc,a)}equals(e){return e.a.equals(this.a)&&e.b.equals(this.b)&&e.c.equals(this.c)}}let G9=0;class fr extends bo{constructor(){super(),this.isMaterial=!0,Object.defineProperty(this,"id",{value:G9++}),this.uuid=ts(),this.name="",this.type="Material",this.blending=du,this.side=Ys,this.vertexColors=!1,this.opacity=1,this.transparent=!1,this.blendSrc=mM,this.blendDst=gM,this.blendEquation=eu,this.blendSrcAlpha=null,this.blendDstAlpha=null,this.blendEquationAlpha=null,this.depthFunc=Pv,this.depthTest=!0,this.depthWrite=!0,this.stencilWriteMask=255,this.stencilFunc=qL,this.stencilRef=0,this.stencilFuncMask=255,this.stencilFail=E0,this.stencilZFail=E0,this.stencilZPass=E0,this.stencilWrite=!1,this.clippingPlanes=null,this.clipIntersection=!1,this.clipShadows=!1,this.shadowSide=null,this.colorWrite=!0,this.precision=null,this.polygonOffset=!1,this.polygonOffsetFactor=0,this.polygonOffsetUnits=0,this.dithering=!1,this.alphaToCoverage=!1,this.premultipliedAlpha=!1,this.forceSinglePass=!1,this.visible=!0,this.toneMapped=!0,this.userData={},this.version=0,this._alphaTest=0}get alphaTest(){return this._alphaTest}set alphaTest(e){this._alphaTest>0!=e>0&&this.version++,this._alphaTest=e}onBuild(){}onBeforeRender(){}onBeforeCompile(){}customProgramCacheKey(){return this.onBeforeCompile.toString()}setValues(e){if(e!==void 0)for(const t in e){const r=e[t];if(r===void 0){console.warn("THREE.Material: '"+t+"' parameter is undefined.");continue}const i=this[t];if(i===void 0){console.warn("THREE."+this.type+": '"+t+"' is not a property of this material.");continue}i&&i.isColor?i.set(r):i&&i.isVector3&&r&&r.isVector3?i.copy(r):this[t]=r}}toJSON(e){const t=e===void 0||typeof e=="string";t&&(e={textures:{},images:{}});const r={metadata:{version:4.5,type:"Material",generator:"Material.toJSON"}};r.uuid=this.uuid,r.type=this.type,this.name!==""&&(r.name=this.name),this.color&&this.color.isColor&&(r.color=this.color.getHex()),this.roughness!==void 0&&(r.roughness=this.roughness),this.metalness!==void 0&&(r.metalness=this.metalness),this.sheen!==void 0&&(r.sheen=this.sheen),this.sheenColor&&this.sheenColor.isColor&&(r.sheenColor=this.sheenColor.getHex()),this.sheenRoughness!==void 0&&(r.sheenRoughness=this.sheenRoughness),this.emissive&&this.emissive.isColor&&(r.emissive=this.emissive.getHex()),this.emissiveIntensity&&this.emissiveIntensity!==1&&(r.emissiveIntensity=this.emissiveIntensity),this.specular&&this.specular.isColor&&(r.specular=this.specular.getHex()),this.specularIntensity!==void 0&&(r.specularIntensity=this.specularIntensity),this.specularColor&&this.specularColor.isColor&&(r.specularColor=this.specularColor.getHex()),this.shininess!==void 0&&(r.shininess=this.shininess),this.clearcoat!==void 0&&(r.clearcoat=this.clearcoat),this.clearcoatRoughness!==void 0&&(r.clearcoatRoughness=this.clearcoatRoughness),this.clearcoatMap&&this.clearcoatMap.isTexture&&(r.clearcoatMap=this.clearcoatMap.toJSON(e).uuid),this.clearcoatRoughnessMap&&this.clearcoatRoughnessMap.isTexture&&(r.clearcoatRoughnessMap=this.clearcoatRoughnessMap.toJSON(e).uuid),this.clearcoatNormalMap&&this.clearcoatNormalMap.isTexture&&(r.clearcoatNormalMap=this.clearcoatNormalMap.toJSON(e).uuid,r.clearcoatNormalScale=this.clearcoatNormalScale.toArray()),this.iridescence!==void 0&&(r.iridescence=this.iridescence),this.iridescenceIOR!==void 0&&(r.iridescenceIOR=this.iridescenceIOR),this.iridescenceThicknessRange!==void 0&&(r.iridescenceThicknessRange=this.iridescenceThicknessRange),this.iridescenceMap&&this.iridescenceMap.isTexture&&(r.iridescenceMap=this.iridescenceMap.toJSON(e).uuid),this.iridescenceThicknessMap&&this.iridescenceThicknessMap.isTexture&&(r.iridescenceThicknessMap=this.iridescenceThicknessMap.toJSON(e).uuid),this.map&&this.map.isTexture&&(r.map=this.map.toJSON(e).uuid),this.matcap&&this.matcap.isTexture&&(r.matcap=this.matcap.toJSON(e).uuid),this.alphaMap&&this.alphaMap.isTexture&&(r.alphaMap=this.alphaMap.toJSON(e).uuid),this.lightMap&&this.lightMap.isTexture&&(r.lightMap=this.lightMap.toJSON(e).uuid,r.lightMapIntensity=this.lightMapIntensity),this.aoMap&&this.aoMap.isTexture&&(r.aoMap=this.aoMap.toJSON(e).uuid,r.aoMapIntensity=this.aoMapIntensity),this.bumpMap&&this.bumpMap.isTexture&&(r.bumpMap=this.bumpMap.toJSON(e).uuid,r.bumpScale=this.bumpScale),this.normalMap&&this.normalMap.isTexture&&(r.normalMap=this.normalMap.toJSON(e).uuid,r.normalMapType=this.normalMapType,r.normalScale=this.normalScale.toArray()),this.displacementMap&&this.displacementMap.isTexture&&(r.displacementMap=this.displacementMap.toJSON(e).uuid,r.displacementScale=this.displacementScale,r.displacementBias=this.displacementBias),this.roughnessMap&&this.roughnessMap.isTexture&&(r.roughnessMap=this.roughnessMap.toJSON(e).uuid),this.metalnessMap&&this.metalnessMap.isTexture&&(r.metalnessMap=this.metalnessMap.toJSON(e).uuid),this.emissiveMap&&this.emissiveMap.isTexture&&(r.emissiveMap=this.emissiveMap.toJSON(e).uuid),this.specularMap&&this.specularMap.isTexture&&(r.specularMap=this.specularMap.toJSON(e).uuid),this.specularIntensityMap&&this.specularIntensityMap.isTexture&&(r.specularIntensityMap=this.specularIntensityMap.toJSON(e).uuid),this.specularColorMap&&this.specularColorMap.isTexture&&(r.specularColorMap=this.specularColorMap.toJSON(e).uuid),this.envMap&&this.envMap.isTexture&&(r.envMap=this.envMap.toJSON(e).uuid,this.combine!==void 0&&(r.combine=this.combine)),this.envMapIntensity!==void 0&&(r.envMapIntensity=this.envMapIntensity),this.reflectivity!==void 0&&(r.reflectivity=this.reflectivity),this.refractionRatio!==void 0&&(r.refractionRatio=this.refractionRatio),this.gradientMap&&this.gradientMap.isTexture&&(r.gradientMap=this.gradientMap.toJSON(e).uuid),this.transmission!==void 0&&(r.transmission=this.transmission),this.transmissionMap&&this.transmissionMap.isTexture&&(r.transmissionMap=this.transmissionMap.toJSON(e).uuid),this.thickness!==void 0&&(r.thickness=this.thickness),this.thicknessMap&&this.thicknessMap.isTexture&&(r.thicknessMap=this.thicknessMap.toJSON(e).uuid),this.attenuationDistance!==void 0&&this.attenuationDistance!==1/0&&(r.attenuationDistance=this.attenuationDistance),this.attenuationColor!==void 0&&(r.attenuationColor=this.attenuationColor.getHex()),this.size!==void 0&&(r.size=this.size),this.shadowSide!==null&&(r.shadowSide=this.shadowSide),this.sizeAttenuation!==void 0&&(r.sizeAttenuation=this.sizeAttenuation),this.blending!==du&&(r.blending=this.blending),this.side!==Ys&&(r.side=this.side),this.vertexColors&&(r.vertexColors=!0),this.opacity<1&&(r.opacity=this.opacity),this.transparent===!0&&(r.transparent=this.transparent),r.depthFunc=this.depthFunc,r.depthTest=this.depthTest,r.depthWrite=this.depthWrite,r.colorWrite=this.colorWrite,r.stencilWrite=this.stencilWrite,r.stencilWriteMask=this.stencilWriteMask,r.stencilFunc=this.stencilFunc,r.stencilRef=this.stencilRef,r.stencilFuncMask=this.stencilFuncMask,r.stencilFail=this.stencilFail,r.stencilZFail=this.stencilZFail,r.stencilZPass=this.stencilZPass,this.rotation!==void 0&&this.rotation!==0&&(r.rotation=this.rotation),this.polygonOffset===!0&&(r.polygonOffset=!0),this.polygonOffsetFactor!==0&&(r.polygonOffsetFactor=this.polygonOffsetFactor),this.polygonOffsetUnits!==0&&(r.polygonOffsetUnits=this.polygonOffsetUnits),this.linewidth!==void 0&&this.linewidth!==1&&(r.linewidth=this.linewidth),this.dashSize!==void 0&&(r.dashSize=this.dashSize),this.gapSize!==void 0&&(r.gapSize=this.gapSize),this.scale!==void 0&&(r.scale=this.scale),this.dithering===!0&&(r.dithering=!0),this.alphaTest>0&&(r.alphaTest=this.alphaTest),this.alphaToCoverage===!0&&(r.alphaToCoverage=this.alphaToCoverage),this.premultipliedAlpha===!0&&(r.premultipliedAlpha=this.premultipliedAlpha),this.forceSinglePass===!0&&(r.forceSinglePass=this.forceSinglePass),this.wireframe===!0&&(r.wireframe=this.wireframe),this.wireframeLinewidth>1&&(r.wireframeLinewidth=this.wireframeLinewidth),this.wireframeLinecap!=="round"&&(r.wireframeLinecap=this.wireframeLinecap),this.wireframeLinejoin!=="round"&&(r.wireframeLinejoin=this.wireframeLinejoin),this.flatShading===!0&&(r.flatShading=this.flatShading),this.visible===!1&&(r.visible=!1),this.toneMapped===!1&&(r.toneMapped=!1),this.fog===!1&&(r.fog=!1),Object.keys(this.userData).length>0&&(r.userData=this.userData);function i(s){const o=[];for(const a in s){const l=s[a];delete l.metadata,o.push(l)}return o}if(t){const s=i(e.textures),o=i(e.images);s.length>0&&(r.textures=s),o.length>0&&(r.images=o)}return r}clone(){return new this.constructor().copy(this)}copy(e){this.name=e.name,this.blending=e.blending,this.side=e.side,this.vertexColors=e.vertexColors,this.opacity=e.opacity,this.transparent=e.transparent,this.blendSrc=e.blendSrc,this.blendDst=e.blendDst,this.blendEquation=e.blendEquation,this.blendSrcAlpha=e.blendSrcAlpha,this.blendDstAlpha=e.blendDstAlpha,this.blendEquationAlpha=e.blendEquationAlpha,this.depthFunc=e.depthFunc,this.depthTest=e.depthTest,this.depthWrite=e.depthWrite,this.stencilWriteMask=e.stencilWriteMask,this.stencilFunc=e.stencilFunc,this.stencilRef=e.stencilRef,this.stencilFuncMask=e.stencilFuncMask,this.stencilFail=e.stencilFail,this.stencilZFail=e.stencilZFail,this.stencilZPass=e.stencilZPass,this.stencilWrite=e.stencilWrite;const t=e.clippingPlanes;let r=null;if(t!==null){const i=t.length;r=new Array(i);for(let s=0;s!==i;++s)r[s]=t[s].clone()}return this.clippingPlanes=r,this.clipIntersection=e.clipIntersection,this.clipShadows=e.clipShadows,this.shadowSide=e.shadowSide,this.colorWrite=e.colorWrite,this.precision=e.precision,this.polygonOffset=e.polygonOffset,this.polygonOffsetFactor=e.polygonOffsetFactor,this.polygonOffsetUnits=e.polygonOffsetUnits,this.dithering=e.dithering,this.alphaTest=e.alphaTest,this.alphaToCoverage=e.alphaToCoverage,this.premultipliedAlpha=e.premultipliedAlpha,this.forceSinglePass=e.forceSinglePass,this.visible=e.visible,this.toneMapped=e.toneMapped,this.userData=JSON.parse(JSON.stringify(e.userData)),this}dispose(){this.dispatchEvent({type:"dispose"})}set needsUpdate(e){e===!0&&this.version++}}const nD={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},Ds={h:0,s:0,l:0},hg={h:0,s:0,l:0};function wx(n,e,t){return t<0&&(t+=1),t>1&&(t-=1),t<1/6?n+(e-n)*6*t:t<1/2?e:t<2/3?n+(e-n)*6*(2/3-t):n}class st{constructor(e,t,r){return this.isColor=!0,this.r=1,this.g=1,this.b=1,t===void 0&&r===void 0?this.set(e):this.setRGB(e,t,r)}set(e){return e&&e.isColor?this.copy(e):typeof e=="number"?this.setHex(e):typeof e=="string"&&this.setStyle(e),this}setScalar(e){return this.r=e,this.g=e,this.b=e,this}setHex(e,t=Os){return e=Math.floor(e),this.r=(e>>16&255)/255,this.g=(e>>8&255)/255,this.b=(e&255)/255,$r.toWorkingColorSpace(this,t),this}setRGB(e,t,r,i=$r.workingColorSpace){return this.r=e,this.g=t,this.b=r,$r.toWorkingColorSpace(this,i),this}setHSL(e,t,r,i=$r.workingColorSpace){if(e=MM(e,1),t=ir(t,0,1),r=ir(r,0,1),t===0)this.r=this.g=this.b=r;else{const s=r<=.5?r*(1+t):r+t-r*t,o=2*r-s;this.r=wx(o,s,e+1/3),this.g=wx(o,s,e),this.b=wx(o,s,e-1/3)}return $r.toWorkingColorSpace(this,i),this}setStyle(e,t=Os){function r(s){s!==void 0&&parseFloat(s)<1&&console.warn("THREE.Color: Alpha component of "+e+" will be ignored.")}let i;if(i=/^(\w+)\(([^\)]*)\)/.exec(e)){let s;const o=i[1],a=i[2];switch(o){case"rgb":case"rgba":if(s=/^\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec(a))return this.r=Math.min(255,parseInt(s[1],10))/255,this.g=Math.min(255,parseInt(s[2],10))/255,this.b=Math.min(255,parseInt(s[3],10))/255,$r.toWorkingColorSpace(this,t),r(s[4]),this;if(s=/^\s*(\d+)\%\s*,\s*(\d+)\%\s*,\s*(\d+)\%\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec(a))return this.r=Math.min(100,parseInt(s[1],10))/100,this.g=Math.min(100,parseInt(s[2],10))/100,this.b=Math.min(100,parseInt(s[3],10))/100,$r.toWorkingColorSpace(this,t),r(s[4]),this;break;case"hsl":case"hsla":if(s=/^\s*(\d*\.?\d+)\s*,\s*(\d*\.?\d+)\%\s*,\s*(\d*\.?\d+)\%\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec(a)){const l=parseFloat(s[1])/360,u=parseFloat(s[2])/100,c=parseFloat(s[3])/100;return r(s[4]),this.setHSL(l,u,c,t)}break;default:console.warn("THREE.Color: Unknown color model "+e)}}else if(i=/^\#([A-Fa-f\d]+)$/.exec(e)){const s=i[1],o=s.length;if(o===3)return this.r=parseInt(s.charAt(0)+s.charAt(0),16)/255,this.g=parseInt(s.charAt(1)+s.charAt(1),16)/255,this.b=parseInt(s.charAt(2)+s.charAt(2),16)/255,$r.toWorkingColorSpace(this,t),this;if(o===6)return this.r=parseInt(s.charAt(0)+s.charAt(1),16)/255,this.g=parseInt(s.charAt(2)+s.charAt(3),16)/255,this.b=parseInt(s.charAt(4)+s.charAt(5),16)/255,$r.toWorkingColorSpace(this,t),this;console.warn("THREE.Color: Invalid hex color "+e)}else if(e&&e.length>0)return this.setColorName(e,t);return this}setColorName(e,t=Os){const r=nD[e.toLowerCase()];return r!==void 0?this.setHex(r,t):console.warn("THREE.Color: Unknown color "+e),this}clone(){return new this.constructor(this.r,this.g,this.b)}copy(e){return this.r=e.r,this.g=e.g,this.b=e.b,this}copySRGBToLinear(e){return this.r=qc(e.r),this.g=qc(e.g),this.b=qc(e.b),this}copyLinearToSRGB(e){return this.r=ux(e.r),this.g=ux(e.g),this.b=ux(e.b),this}convertSRGBToLinear(){return this.copySRGBToLinear(this),this}convertLinearToSRGB(){return this.copyLinearToSRGB(this),this}getHex(e=Os){return $r.fromWorkingColorSpace(qr.copy(this),e),ir(qr.r*255,0,255)<<16^ir(qr.g*255,0,255)<<8^ir(qr.b*255,0,255)<<0}getHexString(e=Os){return("000000"+this.getHex(e).toString(16)).slice(-6)}getHSL(e,t=$r.workingColorSpace){$r.fromWorkingColorSpace(qr.copy(this),t);const r=qr.r,i=qr.g,s=qr.b,o=Math.max(r,i,s),a=Math.min(r,i,s);let l,u;const c=(a+o)/2;if(a===o)l=0,u=0;else{const f=o-a;switch(u=c<=.5?f/(o+a):f/(2-o-a),o){case r:l=(i-s)/f+(i0&&(e.userData=this.userData),this.parameters!==void 0){const l=this.parameters;for(const u in l)l[u]!==void 0&&(e[u]=l[u]);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 r=this.attributes;for(const l in r){const u=r[l];e.data.attributes[l]=u.toJSON(e.data)}const i={};let s=!1;for(const l in this.morphAttributes){const u=this.morphAttributes[l],c=[];for(let f=0,p=u.length;f0&&(i[l]=c,s=!0)}s&&(e.data.morphAttributes=i,e.data.morphTargetsRelative=this.morphTargetsRelative);const o=this.groups;o.length>0&&(e.data.groups=JSON.parse(JSON.stringify(o)));const a=this.boundingSphere;return a!==null&&(e.data.boundingSphere={center:a.center.toArray(),radius:a.radius}),e}clone(){return new this.constructor().copy(this)}copy(e){this.index=null,this.attributes={},this.morphAttributes={},this.groups=[],this.boundingBox=null,this.boundingSphere=null;const t={};this.name=e.name;const r=e.index;r!==null&&this.setIndex(r.clone(t));const i=e.attributes;for(const u in i){const c=i[u];this.setAttribute(u,c.clone(t))}const s=e.morphAttributes;for(const u in s){const c=[],f=s[u];for(let p=0,m=f.length;p0){const i=t[r[0]];if(i!==void 0){this.morphTargetInfluences=[],this.morphTargetDictionary={};for(let s=0,o=i.length;s(e.far-e.near)**2))||(AT.copy(s).invert(),uo.copy(e.ray).applyMatrix4(AT),r.boundingBox!==null&&uo.intersectsBox(r.boundingBox)===!1))return;let o;const a=r.index,l=r.attributes.position,u=r.attributes.uv,c=r.attributes.uv2,f=r.groups,p=r.drawRange;if(a!==null)if(Array.isArray(i))for(let m=0,g=f.length;mt.far?null:{distance:u,point:xg.clone(),object:n}}function _g(n,e,t,r,i,s,o,a,l){n.getVertexPosition(o,Eh),n.getVertexPosition(a,Ch),n.getVertexPosition(l,bh);const u=Z9(n,e,t,r,Eh,Ch,bh,Mx);if(u){i&&(gg.fromBufferAttribute(i,o),vg.fromBufferAttribute(i,a),yg.fromBufferAttribute(i,l),u.uv=_s.getUV(Mx,Eh,Ch,bh,gg,vg,yg,new ze)),s&&(gg.fromBufferAttribute(s,o),vg.fromBufferAttribute(s,a),yg.fromBufferAttribute(s,l),u.uv2=_s.getUV(Mx,Eh,Ch,bh,gg,vg,yg,new ze));const c={a:o,b:a,c:l,normal:new Z,materialIndex:0};_s.getNormal(Eh,Ch,bh,c.normal),u.face=c}return u}class _l extends Ut{constructor(e=1,t=1,r=1,i=1,s=1,o=1){super(),this.type="BoxGeometry",this.parameters={width:e,height:t,depth:r,widthSegments:i,heightSegments:s,depthSegments:o};const a=this;i=Math.floor(i),s=Math.floor(s),o=Math.floor(o);const l=[],u=[],c=[],f=[];let p=0,m=0;g("z","y","x",-1,-1,r,t,e,o,s,0),g("z","y","x",1,-1,r,t,-e,o,s,1),g("x","z","y",1,1,e,r,t,i,o,2),g("x","z","y",1,-1,e,r,-t,i,o,3),g("x","y","z",1,-1,e,t,r,i,s,4),g("x","y","z",-1,-1,e,t,-r,i,s,5),this.setIndex(l),this.setAttribute("position",new xt(u,3)),this.setAttribute("normal",new xt(c,3)),this.setAttribute("uv",new xt(f,2));function g(v,y,w,_,x,A,C,b,R,E,B){const D=A/R,U=C/E,z=A/2,Y=C/2,P=b/2,F=R+1,G=E+1;let ie=0,N=0;const V=new Z;for(let j=0;j0?1:-1,c.push(V.x,V.y,V.z),f.push(k/R),f.push(1-j/E),ie+=1}}for(let j=0;j0&&(t.defines=this.defines),t.vertexShader=this.vertexShader,t.fragmentShader=this.fragmentShader;const r={};for(const i in this.extensions)this.extensions[i]===!0&&(r[i]=!0);return Object.keys(r).length>0&&(t.extensions=r),t}}class Mp extends sn{constructor(){super(),this.isCamera=!0,this.type="Camera",this.matrixWorldInverse=new Lt,this.projectionMatrix=new Lt,this.projectionMatrixInverse=new Lt}copy(e,t){return super.copy(e,t),this.matrixWorldInverse.copy(e.matrixWorldInverse),this.projectionMatrix.copy(e.projectionMatrix),this.projectionMatrixInverse.copy(e.projectionMatrixInverse),this}getWorldDirection(e){this.updateWorldMatrix(!0,!1);const t=this.matrixWorld.elements;return e.set(-t[8],-t[9],-t[10]).normalize()}updateMatrixWorld(e){super.updateMatrixWorld(e),this.matrixWorldInverse.copy(this.matrixWorld).invert()}updateWorldMatrix(e,t){super.updateWorldMatrix(e,t),this.matrixWorldInverse.copy(this.matrixWorld).invert()}clone(){return new this.constructor().copy(this)}}let Qn=class extends Mp{constructor(e=50,t=1,r=.1,i=2e3){super(),this.isPerspectiveCamera=!0,this.type="PerspectiveCamera",this.fov=e,this.zoom=1,this.near=r,this.far=i,this.focus=10,this.aspect=t,this.view=null,this.filmGauge=35,this.filmOffset=0,this.updateProjectionMatrix()}copy(e,t){return super.copy(e,t),this.fov=e.fov,this.zoom=e.zoom,this.near=e.near,this.far=e.far,this.focus=e.focus,this.aspect=e.aspect,this.view=e.view===null?null:Object.assign({},e.view),this.filmGauge=e.filmGauge,this.filmOffset=e.filmOffset,this}setFocalLength(e){const t=.5*this.getFilmHeight()/e;this.fov=$d*2*Math.atan(t),this.updateProjectionMatrix()}getFocalLength(){const e=Math.tan(mu*.5*this.fov);return .5*this.getFilmHeight()/e}getEffectiveFOV(){return $d*2*Math.atan(Math.tan(mu*.5*this.fov)/this.zoom)}getFilmWidth(){return this.filmGauge*Math.min(this.aspect,1)}getFilmHeight(){return this.filmGauge/Math.max(this.aspect,1)}setViewOffset(e,t,r,i,s,o){this.aspect=e/t,this.view===null&&(this.view={enabled:!0,fullWidth:1,fullHeight:1,offsetX:0,offsetY:0,width:1,height:1}),this.view.enabled=!0,this.view.fullWidth=e,this.view.fullHeight=t,this.view.offsetX=r,this.view.offsetY=i,this.view.width=s,this.view.height=o,this.updateProjectionMatrix()}clearViewOffset(){this.view!==null&&(this.view.enabled=!1),this.updateProjectionMatrix()}updateProjectionMatrix(){const e=this.near;let t=e*Math.tan(mu*.5*this.fov)/this.zoom,r=2*t,i=this.aspect*r,s=-.5*i;const o=this.view;if(this.view!==null&&this.view.enabled){const l=o.fullWidth,u=o.fullHeight;s+=o.offsetX*i/l,t-=o.offsetY*r/u,i*=o.width/l,r*=o.height/u}const a=this.filmOffset;a!==0&&(s+=e*a/this.getFilmWidth()),this.projectionMatrix.makePerspective(s,s+i,t,t-r,e,this.far),this.projectionMatrixInverse.copy(this.projectionMatrix).invert()}toJSON(e){const t=super.toJSON(e);return t.object.fov=this.fov,t.object.zoom=this.zoom,t.object.near=this.near,t.object.far=this.far,t.object.focus=this.focus,t.object.aspect=this.aspect,this.view!==null&&(t.object.view=Object.assign({},this.view)),t.object.filmGauge=this.filmGauge,t.object.filmOffset=this.filmOffset,t}};const cc=-90,fc=1;class iD extends sn{constructor(e,t,r){super(),this.type="CubeCamera",this.renderTarget=r;const i=new Qn(cc,fc,e,t);i.layers=this.layers,i.up.set(0,1,0),i.lookAt(1,0,0),this.add(i);const s=new Qn(cc,fc,e,t);s.layers=this.layers,s.up.set(0,1,0),s.lookAt(-1,0,0),this.add(s);const o=new Qn(cc,fc,e,t);o.layers=this.layers,o.up.set(0,0,-1),o.lookAt(0,1,0),this.add(o);const a=new Qn(cc,fc,e,t);a.layers=this.layers,a.up.set(0,0,1),a.lookAt(0,-1,0),this.add(a);const l=new Qn(cc,fc,e,t);l.layers=this.layers,l.up.set(0,1,0),l.lookAt(0,0,1),this.add(l);const u=new Qn(cc,fc,e,t);u.layers=this.layers,u.up.set(0,1,0),u.lookAt(0,0,-1),this.add(u)}update(e,t){this.parent===null&&this.updateMatrixWorld();const r=this.renderTarget,[i,s,o,a,l,u]=this.children,c=e.getRenderTarget(),f=e.toneMapping,p=e.xr.enabled;e.toneMapping=js,e.xr.enabled=!1;const m=r.texture.generateMipmaps;r.texture.generateMipmaps=!1,e.setRenderTarget(r,0),e.render(t,i),e.setRenderTarget(r,1),e.render(t,s),e.setRenderTarget(r,2),e.render(t,o),e.setRenderTarget(r,3),e.render(t,a),e.setRenderTarget(r,4),e.render(t,l),r.texture.generateMipmaps=m,e.setRenderTarget(r,5),e.render(t,u),e.setRenderTarget(c),e.toneMapping=f,e.xr.enabled=p,r.texture.needsPMREMUpdate=!0}}class Ep extends Rn{constructor(e,t,r,i,s,o,a,l,u,c){e=e!==void 0?e:[],t=t!==void 0?t:da,super(e,t,r,i,s,o,a,l,u,c),this.isCubeTexture=!0,this.flipY=!1}get images(){return this.image}set images(e){this.image=e}}class RM extends ri{constructor(e=1,t={}){super(e,e,t),this.isWebGLCubeRenderTarget=!0;const r={width:e,height:e,depth:1},i=[r,r,r,r,r,r];this.texture=new Ep(i,t.mapping,t.wrapS,t.wrapT,t.magFilter,t.minFilter,t.format,t.type,t.anisotropy,t.encoding),this.texture.isRenderTargetTexture=!0,this.texture.generateMipmaps=t.generateMipmaps!==void 0?t.generateMipmaps:!1,this.texture.minFilter=t.minFilter!==void 0?t.minFilter:gn}fromEquirectangularTexture(e,t){this.texture.type=t.type,this.texture.encoding=t.encoding,this.texture.generateMipmaps=t.generateMipmaps,this.texture.minFilter=t.minFilter,this.texture.magFilter=t.magFilter;const r={uniforms:{tEquirect:{value:null}},vertexShader:` - - varying vec3 vWorldDirection; - - vec3 transformDirection( in vec3 dir, in mat4 matrix ) { - - return normalize( ( matrix * vec4( dir, 0.0 ) ).xyz ); - - } - - void main() { - - vWorldDirection = transformDirection( position, modelMatrix ); - - #include - #include - - } - `,fragmentShader:` - - uniform sampler2D tEquirect; - - varying vec3 vWorldDirection; - - #include - - void main() { - - vec3 direction = normalize( vWorldDirection ); - - vec2 sampleUV = equirectUv( direction ); - - gl_FragColor = texture2D( tEquirect, sampleUV ); - - } - `},i=new _l(5,5,5),s=new Oi({name:"CubemapFromEquirect",uniforms:_f(r.uniforms),vertexShader:r.vertexShader,fragmentShader:r.fragmentShader,side:vi,blending:sa});s.uniforms.tEquirect.value=t;const o=new Vn(i,s),a=t.minFilter;return t.minFilter===Ao&&(t.minFilter=gn),new iD(1,10,this).update(e,o),t.minFilter=a,o.geometry.dispose(),o.material.dispose(),this}clear(e,t,r,i){const s=e.getRenderTarget();for(let o=0;o<6;o++)e.setRenderTarget(this,o),e.clear(t,r,i);e.setRenderTarget(s)}}const Ex=new Z,eH=new Z,tH=new Rr;class Ha{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,r,i){return this.normal.set(e,t,r),this.constant=i,this}setFromNormalAndCoplanarPoint(e,t){return this.normal.copy(e),this.constant=-t.dot(this.normal),this}setFromCoplanarPoints(e,t,r){const i=Ex.subVectors(r,t).cross(eH.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 r=e.delta(Ex),i=this.normal.dot(r);if(i===0)return this.distanceToPoint(e.start)===0?t.copy(e.start):null;const s=-(e.start.dot(this.normal)+this.constant)/i;return s<0||s>1?null:t.copy(e.start).addScaledVector(r,s)}intersectsLine(e){const t=this.distanceToPoint(e.start),r=this.distanceToPoint(e.end);return t<0&&r>0||r<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 r=t||tH.getNormalMatrix(e),i=this.coplanarPoint(Ex).applyMatrix4(e),s=this.normal.applyMatrix3(r).normalize();return this.constant=-i.dot(s),this}translate(e){return this.constant-=e.dot(this.normal),this}equals(e){return e.normal.equals(this.normal)&&e.constant===this.constant}clone(){return new this.constructor().copy(this)}}const hc=new To,wg=new Z;class vy{constructor(e=new Ha,t=new Ha,r=new Ha,i=new Ha,s=new Ha,o=new Ha){this.planes=[e,t,r,i,s,o]}set(e,t,r,i,s,o){const a=this.planes;return a[0].copy(e),a[1].copy(t),a[2].copy(r),a[3].copy(i),a[4].copy(s),a[5].copy(o),this}copy(e){const t=this.planes;for(let r=0;r<6;r++)t[r].copy(e.planes[r]);return this}setFromProjectionMatrix(e){const t=this.planes,r=e.elements,i=r[0],s=r[1],o=r[2],a=r[3],l=r[4],u=r[5],c=r[6],f=r[7],p=r[8],m=r[9],g=r[10],v=r[11],y=r[12],w=r[13],_=r[14],x=r[15];return t[0].setComponents(a-i,f-l,v-p,x-y).normalize(),t[1].setComponents(a+i,f+l,v+p,x+y).normalize(),t[2].setComponents(a+s,f+u,v+m,x+w).normalize(),t[3].setComponents(a-s,f-u,v-m,x-w).normalize(),t[4].setComponents(a-o,f-c,v-g,x-_).normalize(),t[5].setComponents(a+o,f+c,v+g,x+_).normalize(),this}intersectsObject(e){const t=e.geometry;return t.boundingSphere===null&&t.computeBoundingSphere(),hc.copy(t.boundingSphere).applyMatrix4(e.matrixWorld),this.intersectsSphere(hc)}intersectsSprite(e){return hc.center.set(0,0,0),hc.radius=.7071067811865476,hc.applyMatrix4(e.matrixWorld),this.intersectsSphere(hc)}intersectsSphere(e){const t=this.planes,r=e.center,i=-e.radius;for(let s=0;s<6;s++)if(t[s].distanceToPoint(r)0?e.max.x:e.min.x,wg.y=i.normal.y>0?e.max.y:e.min.y,wg.z=i.normal.z>0?e.max.z:e.min.z,i.distanceToPoint(wg)<0)return!1}return!0}containsPoint(e){const t=this.planes;for(let r=0;r<6;r++)if(t[r].distanceToPoint(e)<0)return!1;return!0}clone(){return new this.constructor().copy(this)}}function sD(){let n=null,e=!1,t=null,r=null;function i(s,o){t(s,o),r=n.requestAnimationFrame(i)}return{start:function(){e!==!0&&t!==null&&(r=n.requestAnimationFrame(i),e=!0)},stop:function(){n.cancelAnimationFrame(r),e=!1},setAnimationLoop:function(s){t=s},setContext:function(s){n=s}}}function nH(n,e){const t=e.isWebGL2,r=new WeakMap;function i(u,c){const f=u.array,p=u.usage,m=n.createBuffer();n.bindBuffer(c,m),n.bufferData(c,f,p),u.onUploadCallback();let g;if(f instanceof Float32Array)g=5126;else if(f instanceof Uint16Array)if(u.isFloat16BufferAttribute)if(t)g=5131;else throw new Error("THREE.WebGLAttributes: Usage of Float16BufferAttribute requires WebGL2.");else g=5123;else if(f instanceof Int16Array)g=5122;else if(f instanceof Uint32Array)g=5125;else if(f instanceof Int32Array)g=5124;else if(f instanceof Int8Array)g=5120;else if(f instanceof Uint8Array)g=5121;else if(f instanceof Uint8ClampedArray)g=5121;else throw new Error("THREE.WebGLAttributes: Unsupported buffer data format: "+f);return{buffer:m,type:g,bytesPerElement:f.BYTES_PER_ELEMENT,version:u.version}}function s(u,c,f){const p=c.array,m=c.updateRange;n.bindBuffer(f,u),m.count===-1?n.bufferSubData(f,0,p):(t?n.bufferSubData(f,m.offset*p.BYTES_PER_ELEMENT,p,m.offset,m.count):n.bufferSubData(f,m.offset*p.BYTES_PER_ELEMENT,p.subarray(m.offset,m.offset+m.count)),m.count=-1),c.onUploadCallback()}function o(u){return u.isInterleavedBufferAttribute&&(u=u.data),r.get(u)}function a(u){u.isInterleavedBufferAttribute&&(u=u.data);const c=r.get(u);c&&(n.deleteBuffer(c.buffer),r.delete(u))}function l(u,c){if(u.isGLBufferAttribute){const p=r.get(u);(!p||p.version 0.0 ) ? v : 0.5 * inversesqrt( max( 1.0 - x * x, 1e-7 ) ) - v; - return cross( v1, v2 ) * theta_sintheta; -} -vec3 LTC_Evaluate( const in vec3 N, const in vec3 V, const in vec3 P, const in mat3 mInv, const in vec3 rectCoords[ 4 ] ) { - vec3 v1 = rectCoords[ 1 ] - rectCoords[ 0 ]; - vec3 v2 = rectCoords[ 3 ] - rectCoords[ 0 ]; - vec3 lightNormal = cross( v1, v2 ); - if( dot( lightNormal, P - rectCoords[ 0 ] ) < 0.0 ) return vec3( 0.0 ); - vec3 T1, T2; - T1 = normalize( V - N * dot( V, N ) ); - T2 = - cross( N, T1 ); - mat3 mat = mInv * transposeMat3( mat3( T1, T2, N ) ); - vec3 coords[ 4 ]; - coords[ 0 ] = mat * ( rectCoords[ 0 ] - P ); - coords[ 1 ] = mat * ( rectCoords[ 1 ] - P ); - coords[ 2 ] = mat * ( rectCoords[ 2 ] - P ); - coords[ 3 ] = mat * ( rectCoords[ 3 ] - P ); - coords[ 0 ] = normalize( coords[ 0 ] ); - coords[ 1 ] = normalize( coords[ 1 ] ); - coords[ 2 ] = normalize( coords[ 2 ] ); - coords[ 3 ] = normalize( coords[ 3 ] ); - vec3 vectorFormFactor = vec3( 0.0 ); - vectorFormFactor += LTC_EdgeVectorFormFactor( coords[ 0 ], coords[ 1 ] ); - vectorFormFactor += LTC_EdgeVectorFormFactor( coords[ 1 ], coords[ 2 ] ); - vectorFormFactor += LTC_EdgeVectorFormFactor( coords[ 2 ], coords[ 3 ] ); - vectorFormFactor += LTC_EdgeVectorFormFactor( coords[ 3 ], coords[ 0 ] ); - float result = LTC_ClippedSphereFormFactor( vectorFormFactor ); - return vec3( result ); -} -float G_BlinnPhong_Implicit( ) { - return 0.25; -} -float D_BlinnPhong( const in float shininess, const in float dotNH ) { - return RECIPROCAL_PI * ( shininess * 0.5 + 1.0 ) * pow( dotNH, shininess ); -} -vec3 BRDF_BlinnPhong( const in vec3 lightDir, const in vec3 viewDir, const in vec3 normal, const in vec3 specularColor, const in float shininess ) { - vec3 halfDir = normalize( lightDir + viewDir ); - float dotNH = saturate( dot( normal, halfDir ) ); - float dotVH = saturate( dot( viewDir, halfDir ) ); - vec3 F = F_Schlick( specularColor, 1.0, dotVH ); - float G = G_BlinnPhong_Implicit( ); - float D = D_BlinnPhong( shininess, dotNH ); - return F * ( G * D ); -} -#if defined( USE_SHEEN ) -float D_Charlie( float roughness, float dotNH ) { - float alpha = pow2( roughness ); - float invAlpha = 1.0 / alpha; - float cos2h = dotNH * dotNH; - float sin2h = max( 1.0 - cos2h, 0.0078125 ); - return ( 2.0 + invAlpha ) * pow( sin2h, invAlpha * 0.5 ) / ( 2.0 * PI ); -} -float V_Neubelt( float dotNV, float dotNL ) { - return saturate( 1.0 / ( 4.0 * ( dotNL + dotNV - dotNL * dotNV ) ) ); -} -vec3 BRDF_Sheen( const in vec3 lightDir, const in vec3 viewDir, const in vec3 normal, vec3 sheenColor, const in float sheenRoughness ) { - vec3 halfDir = normalize( lightDir + viewDir ); - float dotNL = saturate( dot( normal, lightDir ) ); - float dotNV = saturate( dot( normal, viewDir ) ); - float dotNH = saturate( dot( normal, halfDir ) ); - float D = D_Charlie( sheenRoughness, dotNH ); - float V = V_Neubelt( dotNV, dotNL ); - return sheenColor * ( D * V ); -} -#endif`,hH=`#ifdef USE_IRIDESCENCE - const mat3 XYZ_TO_REC709 = mat3( - 3.2404542, -0.9692660, 0.0556434, - -1.5371385, 1.8760108, -0.2040259, - -0.4985314, 0.0415560, 1.0572252 - ); - vec3 Fresnel0ToIor( vec3 fresnel0 ) { - vec3 sqrtF0 = sqrt( fresnel0 ); - return ( vec3( 1.0 ) + sqrtF0 ) / ( vec3( 1.0 ) - sqrtF0 ); - } - vec3 IorToFresnel0( vec3 transmittedIor, float incidentIor ) { - return pow2( ( transmittedIor - vec3( incidentIor ) ) / ( transmittedIor + vec3( incidentIor ) ) ); - } - float IorToFresnel0( float transmittedIor, float incidentIor ) { - return pow2( ( transmittedIor - incidentIor ) / ( transmittedIor + incidentIor )); - } - vec3 evalSensitivity( float OPD, vec3 shift ) { - float phase = 2.0 * PI * OPD * 1.0e-9; - vec3 val = vec3( 5.4856e-13, 4.4201e-13, 5.2481e-13 ); - vec3 pos = vec3( 1.6810e+06, 1.7953e+06, 2.2084e+06 ); - vec3 var = vec3( 4.3278e+09, 9.3046e+09, 6.6121e+09 ); - vec3 xyz = val * sqrt( 2.0 * PI * var ) * cos( pos * phase + shift ) * exp( - pow2( phase ) * var ); - xyz.x += 9.7470e-14 * sqrt( 2.0 * PI * 4.5282e+09 ) * cos( 2.2399e+06 * phase + shift[ 0 ] ) * exp( - 4.5282e+09 * pow2( phase ) ); - xyz /= 1.0685e-7; - vec3 rgb = XYZ_TO_REC709 * xyz; - return rgb; - } - vec3 evalIridescence( float outsideIOR, float eta2, float cosTheta1, float thinFilmThickness, vec3 baseF0 ) { - vec3 I; - float iridescenceIOR = mix( outsideIOR, eta2, smoothstep( 0.0, 0.03, thinFilmThickness ) ); - float sinTheta2Sq = pow2( outsideIOR / iridescenceIOR ) * ( 1.0 - pow2( cosTheta1 ) ); - float cosTheta2Sq = 1.0 - sinTheta2Sq; - if ( cosTheta2Sq < 0.0 ) { - return vec3( 1.0 ); - } - float cosTheta2 = sqrt( cosTheta2Sq ); - float R0 = IorToFresnel0( iridescenceIOR, outsideIOR ); - float R12 = F_Schlick( R0, 1.0, cosTheta1 ); - float R21 = R12; - float T121 = 1.0 - R12; - float phi12 = 0.0; - if ( iridescenceIOR < outsideIOR ) phi12 = PI; - float phi21 = PI - phi12; - vec3 baseIOR = Fresnel0ToIor( clamp( baseF0, 0.0, 0.9999 ) ); vec3 R1 = IorToFresnel0( baseIOR, iridescenceIOR ); - vec3 R23 = F_Schlick( R1, 1.0, cosTheta2 ); - vec3 phi23 = vec3( 0.0 ); - if ( baseIOR[ 0 ] < iridescenceIOR ) phi23[ 0 ] = PI; - if ( baseIOR[ 1 ] < iridescenceIOR ) phi23[ 1 ] = PI; - if ( baseIOR[ 2 ] < iridescenceIOR ) phi23[ 2 ] = PI; - float OPD = 2.0 * iridescenceIOR * thinFilmThickness * cosTheta2; - vec3 phi = vec3( phi21 ) + phi23; - vec3 R123 = clamp( R12 * R23, 1e-5, 0.9999 ); - vec3 r123 = sqrt( R123 ); - vec3 Rs = pow2( T121 ) * R23 / ( vec3( 1.0 ) - R123 ); - vec3 C0 = R12 + Rs; - I = C0; - vec3 Cm = Rs - T121; - for ( int m = 1; m <= 2; ++ m ) { - Cm *= r123; - vec3 Sm = 2.0 * evalSensitivity( float( m ) * OPD, float( m ) * phi ); - I += Cm * Sm; - } - return max( I, vec3( 0.0 ) ); - } -#endif`,dH=`#ifdef USE_BUMPMAP - uniform sampler2D bumpMap; - uniform float bumpScale; - vec2 dHdxy_fwd() { - vec2 dSTdx = dFdx( vUv ); - vec2 dSTdy = dFdy( vUv ); - float Hll = bumpScale * texture2D( bumpMap, vUv ).x; - float dBx = bumpScale * texture2D( bumpMap, vUv + dSTdx ).x - Hll; - float dBy = bumpScale * texture2D( bumpMap, vUv + dSTdy ).x - Hll; - return vec2( dBx, dBy ); - } - vec3 perturbNormalArb( vec3 surf_pos, vec3 surf_norm, vec2 dHdxy, float faceDirection ) { - vec3 vSigmaX = dFdx( surf_pos.xyz ); - vec3 vSigmaY = dFdy( surf_pos.xyz ); - vec3 vN = surf_norm; - vec3 R1 = cross( vSigmaY, vN ); - vec3 R2 = cross( vN, vSigmaX ); - float fDet = dot( vSigmaX, R1 ) * faceDirection; - vec3 vGrad = sign( fDet ) * ( dHdxy.x * R1 + dHdxy.y * R2 ); - return normalize( abs( fDet ) * surf_norm - vGrad ); - } -#endif`,pH=`#if NUM_CLIPPING_PLANES > 0 - vec4 plane; - #pragma unroll_loop_start - for ( int i = 0; i < UNION_CLIPPING_PLANES; i ++ ) { - plane = clippingPlanes[ i ]; - if ( dot( vClipPosition, plane.xyz ) > plane.w ) discard; - } - #pragma unroll_loop_end - #if UNION_CLIPPING_PLANES < NUM_CLIPPING_PLANES - bool clipped = true; - #pragma unroll_loop_start - for ( int i = UNION_CLIPPING_PLANES; i < NUM_CLIPPING_PLANES; i ++ ) { - plane = clippingPlanes[ i ]; - clipped = ( dot( vClipPosition, plane.xyz ) > plane.w ) && clipped; - } - #pragma unroll_loop_end - if ( clipped ) discard; - #endif -#endif`,mH=`#if NUM_CLIPPING_PLANES > 0 - varying vec3 vClipPosition; - uniform vec4 clippingPlanes[ NUM_CLIPPING_PLANES ]; -#endif`,gH=`#if NUM_CLIPPING_PLANES > 0 - varying vec3 vClipPosition; -#endif`,vH=`#if NUM_CLIPPING_PLANES > 0 - vClipPosition = - mvPosition.xyz; -#endif`,yH=`#if defined( USE_COLOR_ALPHA ) - diffuseColor *= vColor; -#elif defined( USE_COLOR ) - diffuseColor.rgb *= vColor; -#endif`,xH=`#if defined( USE_COLOR_ALPHA ) - varying vec4 vColor; -#elif defined( USE_COLOR ) - varying vec3 vColor; -#endif`,_H=`#if defined( USE_COLOR_ALPHA ) - varying vec4 vColor; -#elif defined( USE_COLOR ) || defined( USE_INSTANCING_COLOR ) - varying vec3 vColor; -#endif`,wH=`#if defined( USE_COLOR_ALPHA ) - vColor = vec4( 1.0 ); -#elif defined( USE_COLOR ) || defined( USE_INSTANCING_COLOR ) - vColor = vec3( 1.0 ); -#endif -#ifdef USE_COLOR - vColor *= color; -#endif -#ifdef USE_INSTANCING_COLOR - vColor.xyz *= instanceColor.xyz; -#endif`,SH=`#define PI 3.141592653589793 -#define PI2 6.283185307179586 -#define PI_HALF 1.5707963267948966 -#define RECIPROCAL_PI 0.3183098861837907 -#define RECIPROCAL_PI2 0.15915494309189535 -#define EPSILON 1e-6 -#ifndef saturate -#define saturate( a ) clamp( a, 0.0, 1.0 ) -#endif -#define whiteComplement( a ) ( 1.0 - saturate( a ) ) -float pow2( const in float x ) { return x*x; } -vec3 pow2( const in vec3 x ) { return x*x; } -float pow3( const in float x ) { return x*x*x; } -float pow4( const in float x ) { float x2 = x*x; return x2*x2; } -float max3( const in vec3 v ) { return max( max( v.x, v.y ), v.z ); } -float average( const in vec3 v ) { return dot( v, vec3( 0.3333333 ) ); } -highp float rand( const in vec2 uv ) { - const highp float a = 12.9898, b = 78.233, c = 43758.5453; - highp float dt = dot( uv.xy, vec2( a,b ) ), sn = mod( dt, PI ); - return fract( sin( sn ) * c ); -} -#ifdef HIGH_PRECISION - float precisionSafeLength( vec3 v ) { return length( v ); } -#else - float precisionSafeLength( vec3 v ) { - float maxComponent = max3( abs( v ) ); - return length( v / maxComponent ) * maxComponent; - } -#endif -struct IncidentLight { - vec3 color; - vec3 direction; - bool visible; -}; -struct ReflectedLight { - vec3 directDiffuse; - vec3 directSpecular; - vec3 indirectDiffuse; - vec3 indirectSpecular; -}; -struct GeometricContext { - vec3 position; - vec3 normal; - vec3 viewDir; -#ifdef USE_CLEARCOAT - vec3 clearcoatNormal; -#endif -}; -vec3 transformDirection( in vec3 dir, in mat4 matrix ) { - return normalize( ( matrix * vec4( dir, 0.0 ) ).xyz ); -} -vec3 inverseTransformDirection( in vec3 dir, in mat4 matrix ) { - return normalize( ( vec4( dir, 0.0 ) * matrix ).xyz ); -} -mat3 transposeMat3( const in mat3 m ) { - mat3 tmp; - tmp[ 0 ] = vec3( m[ 0 ].x, m[ 1 ].x, m[ 2 ].x ); - tmp[ 1 ] = vec3( m[ 0 ].y, m[ 1 ].y, m[ 2 ].y ); - tmp[ 2 ] = vec3( m[ 0 ].z, m[ 1 ].z, m[ 2 ].z ); - return tmp; -} -float luminance( const in vec3 rgb ) { - const vec3 weights = vec3( 0.2126729, 0.7151522, 0.0721750 ); - return dot( weights, rgb ); -} -bool isPerspectiveMatrix( mat4 m ) { - return m[ 2 ][ 3 ] == - 1.0; -} -vec2 equirectUv( in vec3 dir ) { - float u = atan( dir.z, dir.x ) * RECIPROCAL_PI2 + 0.5; - float v = asin( clamp( dir.y, - 1.0, 1.0 ) ) * RECIPROCAL_PI + 0.5; - return vec2( u, v ); -}`,AH=`#ifdef ENVMAP_TYPE_CUBE_UV - #define cubeUV_minMipLevel 4.0 - #define cubeUV_minTileSize 16.0 - float getFace( vec3 direction ) { - vec3 absDirection = abs( direction ); - float face = - 1.0; - if ( absDirection.x > absDirection.z ) { - if ( absDirection.x > absDirection.y ) - face = direction.x > 0.0 ? 0.0 : 3.0; - else - face = direction.y > 0.0 ? 1.0 : 4.0; - } else { - if ( absDirection.z > absDirection.y ) - face = direction.z > 0.0 ? 2.0 : 5.0; - else - face = direction.y > 0.0 ? 1.0 : 4.0; - } - return face; - } - vec2 getUV( vec3 direction, float face ) { - vec2 uv; - if ( face == 0.0 ) { - uv = vec2( direction.z, direction.y ) / abs( direction.x ); - } else if ( face == 1.0 ) { - uv = vec2( - direction.x, - direction.z ) / abs( direction.y ); - } else if ( face == 2.0 ) { - uv = vec2( - direction.x, direction.y ) / abs( direction.z ); - } else if ( face == 3.0 ) { - uv = vec2( - direction.z, direction.y ) / abs( direction.x ); - } else if ( face == 4.0 ) { - uv = vec2( - direction.x, direction.z ) / abs( direction.y ); - } else { - uv = vec2( direction.x, direction.y ) / abs( direction.z ); - } - return 0.5 * ( uv + 1.0 ); - } - vec3 bilinearCubeUV( sampler2D envMap, vec3 direction, float mipInt ) { - float face = getFace( direction ); - float filterInt = max( cubeUV_minMipLevel - mipInt, 0.0 ); - mipInt = max( mipInt, cubeUV_minMipLevel ); - float faceSize = exp2( mipInt ); - highp vec2 uv = getUV( direction, face ) * ( faceSize - 2.0 ) + 1.0; - if ( face > 2.0 ) { - uv.y += faceSize; - face -= 3.0; - } - uv.x += face * faceSize; - uv.x += filterInt * 3.0 * cubeUV_minTileSize; - uv.y += 4.0 * ( exp2( CUBEUV_MAX_MIP ) - faceSize ); - uv.x *= CUBEUV_TEXEL_WIDTH; - uv.y *= CUBEUV_TEXEL_HEIGHT; - #ifdef texture2DGradEXT - return texture2DGradEXT( envMap, uv, vec2( 0.0 ), vec2( 0.0 ) ).rgb; - #else - return texture2D( envMap, uv ).rgb; - #endif - } - #define cubeUV_r0 1.0 - #define cubeUV_v0 0.339 - #define cubeUV_m0 - 2.0 - #define cubeUV_r1 0.8 - #define cubeUV_v1 0.276 - #define cubeUV_m1 - 1.0 - #define cubeUV_r4 0.4 - #define cubeUV_v4 0.046 - #define cubeUV_m4 2.0 - #define cubeUV_r5 0.305 - #define cubeUV_v5 0.016 - #define cubeUV_m5 3.0 - #define cubeUV_r6 0.21 - #define cubeUV_v6 0.0038 - #define cubeUV_m6 4.0 - float roughnessToMip( float roughness ) { - float mip = 0.0; - if ( roughness >= cubeUV_r1 ) { - mip = ( cubeUV_r0 - roughness ) * ( cubeUV_m1 - cubeUV_m0 ) / ( cubeUV_r0 - cubeUV_r1 ) + cubeUV_m0; - } else if ( roughness >= cubeUV_r4 ) { - mip = ( cubeUV_r1 - roughness ) * ( cubeUV_m4 - cubeUV_m1 ) / ( cubeUV_r1 - cubeUV_r4 ) + cubeUV_m1; - } else if ( roughness >= cubeUV_r5 ) { - mip = ( cubeUV_r4 - roughness ) * ( cubeUV_m5 - cubeUV_m4 ) / ( cubeUV_r4 - cubeUV_r5 ) + cubeUV_m4; - } else if ( roughness >= cubeUV_r6 ) { - mip = ( cubeUV_r5 - roughness ) * ( cubeUV_m6 - cubeUV_m5 ) / ( cubeUV_r5 - cubeUV_r6 ) + cubeUV_m5; - } else { - mip = - 2.0 * log2( 1.16 * roughness ); } - return mip; - } - vec4 textureCubeUV( sampler2D envMap, vec3 sampleDir, float roughness ) { - float mip = clamp( roughnessToMip( roughness ), cubeUV_m0, CUBEUV_MAX_MIP ); - float mipF = fract( mip ); - float mipInt = floor( mip ); - vec3 color0 = bilinearCubeUV( envMap, sampleDir, mipInt ); - if ( mipF == 0.0 ) { - return vec4( color0, 1.0 ); - } else { - vec3 color1 = bilinearCubeUV( envMap, sampleDir, mipInt + 1.0 ); - return vec4( mix( color0, color1, mipF ), 1.0 ); - } - } -#endif`,MH=`vec3 transformedNormal = objectNormal; -#ifdef USE_INSTANCING - mat3 m = mat3( instanceMatrix ); - transformedNormal /= vec3( dot( m[ 0 ], m[ 0 ] ), dot( m[ 1 ], m[ 1 ] ), dot( m[ 2 ], m[ 2 ] ) ); - transformedNormal = m * transformedNormal; -#endif -transformedNormal = normalMatrix * transformedNormal; -#ifdef FLIP_SIDED - transformedNormal = - transformedNormal; -#endif -#ifdef USE_TANGENT - vec3 transformedTangent = ( modelViewMatrix * vec4( objectTangent, 0.0 ) ).xyz; - #ifdef FLIP_SIDED - transformedTangent = - transformedTangent; - #endif -#endif`,EH=`#ifdef USE_DISPLACEMENTMAP - uniform sampler2D displacementMap; - uniform float displacementScale; - uniform float displacementBias; -#endif`,CH=`#ifdef USE_DISPLACEMENTMAP - transformed += normalize( objectNormal ) * ( texture2D( displacementMap, vUv ).x * displacementScale + displacementBias ); -#endif`,bH=`#ifdef USE_EMISSIVEMAP - vec4 emissiveColor = texture2D( emissiveMap, vUv ); - totalEmissiveRadiance *= emissiveColor.rgb; -#endif`,TH=`#ifdef USE_EMISSIVEMAP - uniform sampler2D emissiveMap; -#endif`,RH="gl_FragColor = linearToOutputTexel( gl_FragColor );",BH=`vec4 LinearToLinear( in vec4 value ) { - return value; -} -vec4 LinearTosRGB( in vec4 value ) { - return vec4( mix( pow( value.rgb, vec3( 0.41666 ) ) * 1.055 - vec3( 0.055 ), value.rgb * 12.92, vec3( lessThanEqual( value.rgb, vec3( 0.0031308 ) ) ) ), value.a ); -}`,PH=`#ifdef USE_ENVMAP - #ifdef ENV_WORLDPOS - vec3 cameraToFrag; - if ( isOrthographic ) { - cameraToFrag = normalize( vec3( - viewMatrix[ 0 ][ 2 ], - viewMatrix[ 1 ][ 2 ], - viewMatrix[ 2 ][ 2 ] ) ); - } else { - cameraToFrag = normalize( vWorldPosition - cameraPosition ); - } - vec3 worldNormal = inverseTransformDirection( normal, viewMatrix ); - #ifdef ENVMAP_MODE_REFLECTION - vec3 reflectVec = reflect( cameraToFrag, worldNormal ); - #else - vec3 reflectVec = refract( cameraToFrag, worldNormal, refractionRatio ); - #endif - #else - vec3 reflectVec = vReflect; - #endif - #ifdef ENVMAP_TYPE_CUBE - vec4 envColor = textureCube( envMap, vec3( flipEnvMap * reflectVec.x, reflectVec.yz ) ); - #else - vec4 envColor = vec4( 0.0 ); - #endif - #ifdef ENVMAP_BLENDING_MULTIPLY - outgoingLight = mix( outgoingLight, outgoingLight * envColor.xyz, specularStrength * reflectivity ); - #elif defined( ENVMAP_BLENDING_MIX ) - outgoingLight = mix( outgoingLight, envColor.xyz, specularStrength * reflectivity ); - #elif defined( ENVMAP_BLENDING_ADD ) - outgoingLight += envColor.xyz * specularStrength * reflectivity; - #endif -#endif`,IH=`#ifdef USE_ENVMAP - uniform float envMapIntensity; - uniform float flipEnvMap; - #ifdef ENVMAP_TYPE_CUBE - uniform samplerCube envMap; - #else - uniform sampler2D envMap; - #endif - -#endif`,LH=`#ifdef USE_ENVMAP - uniform float reflectivity; - #if defined( USE_BUMPMAP ) || defined( USE_NORMALMAP ) || defined( PHONG ) || defined( LAMBERT ) - #define ENV_WORLDPOS - #endif - #ifdef ENV_WORLDPOS - varying vec3 vWorldPosition; - uniform float refractionRatio; - #else - varying vec3 vReflect; - #endif -#endif`,DH=`#ifdef USE_ENVMAP - #if defined( USE_BUMPMAP ) || defined( USE_NORMALMAP ) || defined( PHONG ) || defined( LAMBERT ) - #define ENV_WORLDPOS - #endif - #ifdef ENV_WORLDPOS - - varying vec3 vWorldPosition; - #else - varying vec3 vReflect; - uniform float refractionRatio; - #endif -#endif`,kH=`#ifdef USE_ENVMAP - #ifdef ENV_WORLDPOS - vWorldPosition = worldPosition.xyz; - #else - vec3 cameraToVertex; - if ( isOrthographic ) { - cameraToVertex = normalize( vec3( - viewMatrix[ 0 ][ 2 ], - viewMatrix[ 1 ][ 2 ], - viewMatrix[ 2 ][ 2 ] ) ); - } else { - cameraToVertex = normalize( worldPosition.xyz - cameraPosition ); - } - vec3 worldNormal = inverseTransformDirection( transformedNormal, viewMatrix ); - #ifdef ENVMAP_MODE_REFLECTION - vReflect = reflect( cameraToVertex, worldNormal ); - #else - vReflect = refract( cameraToVertex, worldNormal, refractionRatio ); - #endif - #endif -#endif`,FH=`#ifdef USE_FOG - vFogDepth = - mvPosition.z; -#endif`,NH=`#ifdef USE_FOG - varying float vFogDepth; -#endif`,OH=`#ifdef USE_FOG - #ifdef FOG_EXP2 - float fogFactor = 1.0 - exp( - fogDensity * fogDensity * vFogDepth * vFogDepth ); - #else - float fogFactor = smoothstep( fogNear, fogFar, vFogDepth ); - #endif - gl_FragColor.rgb = mix( gl_FragColor.rgb, fogColor, fogFactor ); -#endif`,UH=`#ifdef USE_FOG - uniform vec3 fogColor; - varying float vFogDepth; - #ifdef FOG_EXP2 - uniform float fogDensity; - #else - uniform float fogNear; - uniform float fogFar; - #endif -#endif`,zH=`#ifdef USE_GRADIENTMAP - uniform sampler2D gradientMap; -#endif -vec3 getGradientIrradiance( vec3 normal, vec3 lightDirection ) { - float dotNL = dot( normal, lightDirection ); - vec2 coord = vec2( dotNL * 0.5 + 0.5, 0.0 ); - #ifdef USE_GRADIENTMAP - return vec3( texture2D( gradientMap, coord ).r ); - #else - vec2 fw = fwidth( coord ) * 0.5; - return mix( vec3( 0.7 ), vec3( 1.0 ), smoothstep( 0.7 - fw.x, 0.7 + fw.x, coord.x ) ); - #endif -}`,GH=`#ifdef USE_LIGHTMAP - vec4 lightMapTexel = texture2D( lightMap, vUv2 ); - vec3 lightMapIrradiance = lightMapTexel.rgb * lightMapIntensity; - reflectedLight.indirectDiffuse += lightMapIrradiance; -#endif`,HH=`#ifdef USE_LIGHTMAP - uniform sampler2D lightMap; - uniform float lightMapIntensity; -#endif`,VH=`LambertMaterial material; -material.diffuseColor = diffuseColor.rgb; -material.specularStrength = specularStrength;`,WH=`varying vec3 vViewPosition; -struct LambertMaterial { - vec3 diffuseColor; - float specularStrength; -}; -void RE_Direct_Lambert( const in IncidentLight directLight, const in GeometricContext geometry, const in LambertMaterial material, inout ReflectedLight reflectedLight ) { - float dotNL = saturate( dot( geometry.normal, directLight.direction ) ); - vec3 irradiance = dotNL * directLight.color; - reflectedLight.directDiffuse += irradiance * BRDF_Lambert( material.diffuseColor ); -} -void RE_IndirectDiffuse_Lambert( const in vec3 irradiance, const in GeometricContext geometry, const in LambertMaterial material, inout ReflectedLight reflectedLight ) { - reflectedLight.indirectDiffuse += irradiance * BRDF_Lambert( material.diffuseColor ); -} -#define RE_Direct RE_Direct_Lambert -#define RE_IndirectDiffuse RE_IndirectDiffuse_Lambert`,JH=`uniform bool receiveShadow; -uniform vec3 ambientLightColor; -uniform vec3 lightProbe[ 9 ]; -vec3 shGetIrradianceAt( in vec3 normal, in vec3 shCoefficients[ 9 ] ) { - float x = normal.x, y = normal.y, z = normal.z; - vec3 result = shCoefficients[ 0 ] * 0.886227; - result += shCoefficients[ 1 ] * 2.0 * 0.511664 * y; - result += shCoefficients[ 2 ] * 2.0 * 0.511664 * z; - result += shCoefficients[ 3 ] * 2.0 * 0.511664 * x; - result += shCoefficients[ 4 ] * 2.0 * 0.429043 * x * y; - result += shCoefficients[ 5 ] * 2.0 * 0.429043 * y * z; - result += shCoefficients[ 6 ] * ( 0.743125 * z * z - 0.247708 ); - result += shCoefficients[ 7 ] * 2.0 * 0.429043 * x * z; - result += shCoefficients[ 8 ] * 0.429043 * ( x * x - y * y ); - return result; -} -vec3 getLightProbeIrradiance( const in vec3 lightProbe[ 9 ], const in vec3 normal ) { - vec3 worldNormal = inverseTransformDirection( normal, viewMatrix ); - vec3 irradiance = shGetIrradianceAt( worldNormal, lightProbe ); - return irradiance; -} -vec3 getAmbientLightIrradiance( const in vec3 ambientLightColor ) { - vec3 irradiance = ambientLightColor; - return irradiance; -} -float getDistanceAttenuation( const in float lightDistance, const in float cutoffDistance, const in float decayExponent ) { - #if defined ( LEGACY_LIGHTS ) - if ( cutoffDistance > 0.0 && decayExponent > 0.0 ) { - return pow( saturate( - lightDistance / cutoffDistance + 1.0 ), decayExponent ); - } - return 1.0; - #else - float distanceFalloff = 1.0 / max( pow( lightDistance, decayExponent ), 0.01 ); - if ( cutoffDistance > 0.0 ) { - distanceFalloff *= pow2( saturate( 1.0 - pow4( lightDistance / cutoffDistance ) ) ); - } - return distanceFalloff; - #endif -} -float getSpotAttenuation( const in float coneCosine, const in float penumbraCosine, const in float angleCosine ) { - return smoothstep( coneCosine, penumbraCosine, angleCosine ); -} -#if NUM_DIR_LIGHTS > 0 - struct DirectionalLight { - vec3 direction; - vec3 color; - }; - uniform DirectionalLight directionalLights[ NUM_DIR_LIGHTS ]; - void getDirectionalLightInfo( const in DirectionalLight directionalLight, const in GeometricContext geometry, out IncidentLight light ) { - light.color = directionalLight.color; - light.direction = directionalLight.direction; - light.visible = true; - } -#endif -#if NUM_POINT_LIGHTS > 0 - struct PointLight { - vec3 position; - vec3 color; - float distance; - float decay; - }; - uniform PointLight pointLights[ NUM_POINT_LIGHTS ]; - void getPointLightInfo( const in PointLight pointLight, const in GeometricContext geometry, out IncidentLight light ) { - vec3 lVector = pointLight.position - geometry.position; - light.direction = normalize( lVector ); - float lightDistance = length( lVector ); - light.color = pointLight.color; - light.color *= getDistanceAttenuation( lightDistance, pointLight.distance, pointLight.decay ); - light.visible = ( light.color != vec3( 0.0 ) ); - } -#endif -#if NUM_SPOT_LIGHTS > 0 - struct SpotLight { - vec3 position; - vec3 direction; - vec3 color; - float distance; - float decay; - float coneCos; - float penumbraCos; - }; - uniform SpotLight spotLights[ NUM_SPOT_LIGHTS ]; - void getSpotLightInfo( const in SpotLight spotLight, const in GeometricContext geometry, out IncidentLight light ) { - vec3 lVector = spotLight.position - geometry.position; - light.direction = normalize( lVector ); - float angleCos = dot( light.direction, spotLight.direction ); - float spotAttenuation = getSpotAttenuation( spotLight.coneCos, spotLight.penumbraCos, angleCos ); - if ( spotAttenuation > 0.0 ) { - float lightDistance = length( lVector ); - light.color = spotLight.color * spotAttenuation; - light.color *= getDistanceAttenuation( lightDistance, spotLight.distance, spotLight.decay ); - light.visible = ( light.color != vec3( 0.0 ) ); - } else { - light.color = vec3( 0.0 ); - light.visible = false; - } - } -#endif -#if NUM_RECT_AREA_LIGHTS > 0 - struct RectAreaLight { - vec3 color; - vec3 position; - vec3 halfWidth; - vec3 halfHeight; - }; - uniform sampler2D ltc_1; uniform sampler2D ltc_2; - uniform RectAreaLight rectAreaLights[ NUM_RECT_AREA_LIGHTS ]; -#endif -#if NUM_HEMI_LIGHTS > 0 - struct HemisphereLight { - vec3 direction; - vec3 skyColor; - vec3 groundColor; - }; - uniform HemisphereLight hemisphereLights[ NUM_HEMI_LIGHTS ]; - vec3 getHemisphereLightIrradiance( const in HemisphereLight hemiLight, const in vec3 normal ) { - float dotNL = dot( normal, hemiLight.direction ); - float hemiDiffuseWeight = 0.5 * dotNL + 0.5; - vec3 irradiance = mix( hemiLight.groundColor, hemiLight.skyColor, hemiDiffuseWeight ); - return irradiance; - } -#endif`,jH=`#if defined( USE_ENVMAP ) - vec3 getIBLIrradiance( const in vec3 normal ) { - #if defined( ENVMAP_TYPE_CUBE_UV ) - vec3 worldNormal = inverseTransformDirection( normal, viewMatrix ); - vec4 envMapColor = textureCubeUV( envMap, worldNormal, 1.0 ); - return PI * envMapColor.rgb * envMapIntensity; - #else - return vec3( 0.0 ); - #endif - } - vec3 getIBLRadiance( const in vec3 viewDir, const in vec3 normal, const in float roughness ) { - #if defined( ENVMAP_TYPE_CUBE_UV ) - vec3 reflectVec = reflect( - viewDir, normal ); - reflectVec = normalize( mix( reflectVec, normal, roughness * roughness) ); - reflectVec = inverseTransformDirection( reflectVec, viewMatrix ); - vec4 envMapColor = textureCubeUV( envMap, reflectVec, roughness ); - return envMapColor.rgb * envMapIntensity; - #else - return vec3( 0.0 ); - #endif - } -#endif`,XH=`ToonMaterial material; -material.diffuseColor = diffuseColor.rgb;`,YH=`varying vec3 vViewPosition; -struct ToonMaterial { - vec3 diffuseColor; -}; -void RE_Direct_Toon( const in IncidentLight directLight, const in GeometricContext geometry, const in ToonMaterial material, inout ReflectedLight reflectedLight ) { - vec3 irradiance = getGradientIrradiance( geometry.normal, directLight.direction ) * directLight.color; - reflectedLight.directDiffuse += irradiance * BRDF_Lambert( material.diffuseColor ); -} -void RE_IndirectDiffuse_Toon( const in vec3 irradiance, const in GeometricContext geometry, const in ToonMaterial material, inout ReflectedLight reflectedLight ) { - reflectedLight.indirectDiffuse += irradiance * BRDF_Lambert( material.diffuseColor ); -} -#define RE_Direct RE_Direct_Toon -#define RE_IndirectDiffuse RE_IndirectDiffuse_Toon`,KH=`BlinnPhongMaterial material; -material.diffuseColor = diffuseColor.rgb; -material.specularColor = specular; -material.specularShininess = shininess; -material.specularStrength = specularStrength;`,ZH=`varying vec3 vViewPosition; -struct BlinnPhongMaterial { - vec3 diffuseColor; - vec3 specularColor; - float specularShininess; - float specularStrength; -}; -void RE_Direct_BlinnPhong( const in IncidentLight directLight, const in GeometricContext geometry, const in BlinnPhongMaterial material, inout ReflectedLight reflectedLight ) { - float dotNL = saturate( dot( geometry.normal, directLight.direction ) ); - vec3 irradiance = dotNL * directLight.color; - reflectedLight.directDiffuse += irradiance * BRDF_Lambert( material.diffuseColor ); - reflectedLight.directSpecular += irradiance * BRDF_BlinnPhong( directLight.direction, geometry.viewDir, geometry.normal, material.specularColor, material.specularShininess ) * material.specularStrength; -} -void RE_IndirectDiffuse_BlinnPhong( const in vec3 irradiance, const in GeometricContext geometry, const in BlinnPhongMaterial material, inout ReflectedLight reflectedLight ) { - reflectedLight.indirectDiffuse += irradiance * BRDF_Lambert( material.diffuseColor ); -} -#define RE_Direct RE_Direct_BlinnPhong -#define RE_IndirectDiffuse RE_IndirectDiffuse_BlinnPhong`,QH=`PhysicalMaterial material; -material.diffuseColor = diffuseColor.rgb * ( 1.0 - metalnessFactor ); -vec3 dxy = max( abs( dFdx( geometryNormal ) ), abs( dFdy( geometryNormal ) ) ); -float geometryRoughness = max( max( dxy.x, dxy.y ), dxy.z ); -material.roughness = max( roughnessFactor, 0.0525 );material.roughness += geometryRoughness; -material.roughness = min( material.roughness, 1.0 ); -#ifdef IOR - material.ior = ior; - #ifdef SPECULAR - float specularIntensityFactor = specularIntensity; - vec3 specularColorFactor = specularColor; - #ifdef USE_SPECULARINTENSITYMAP - specularIntensityFactor *= texture2D( specularIntensityMap, vUv ).a; - #endif - #ifdef USE_SPECULARCOLORMAP - specularColorFactor *= texture2D( specularColorMap, vUv ).rgb; - #endif - material.specularF90 = mix( specularIntensityFactor, 1.0, metalnessFactor ); - #else - float specularIntensityFactor = 1.0; - vec3 specularColorFactor = vec3( 1.0 ); - material.specularF90 = 1.0; - #endif - material.specularColor = mix( min( pow2( ( material.ior - 1.0 ) / ( material.ior + 1.0 ) ) * specularColorFactor, vec3( 1.0 ) ) * specularIntensityFactor, diffuseColor.rgb, metalnessFactor ); -#else - material.specularColor = mix( vec3( 0.04 ), diffuseColor.rgb, metalnessFactor ); - material.specularF90 = 1.0; -#endif -#ifdef USE_CLEARCOAT - material.clearcoat = clearcoat; - material.clearcoatRoughness = clearcoatRoughness; - material.clearcoatF0 = vec3( 0.04 ); - material.clearcoatF90 = 1.0; - #ifdef USE_CLEARCOATMAP - material.clearcoat *= texture2D( clearcoatMap, vUv ).x; - #endif - #ifdef USE_CLEARCOAT_ROUGHNESSMAP - material.clearcoatRoughness *= texture2D( clearcoatRoughnessMap, vUv ).y; - #endif - material.clearcoat = saturate( material.clearcoat ); material.clearcoatRoughness = max( material.clearcoatRoughness, 0.0525 ); - material.clearcoatRoughness += geometryRoughness; - material.clearcoatRoughness = min( material.clearcoatRoughness, 1.0 ); -#endif -#ifdef USE_IRIDESCENCE - material.iridescence = iridescence; - material.iridescenceIOR = iridescenceIOR; - #ifdef USE_IRIDESCENCEMAP - material.iridescence *= texture2D( iridescenceMap, vUv ).r; - #endif - #ifdef USE_IRIDESCENCE_THICKNESSMAP - material.iridescenceThickness = (iridescenceThicknessMaximum - iridescenceThicknessMinimum) * texture2D( iridescenceThicknessMap, vUv ).g + iridescenceThicknessMinimum; - #else - material.iridescenceThickness = iridescenceThicknessMaximum; - #endif -#endif -#ifdef USE_SHEEN - material.sheenColor = sheenColor; - #ifdef USE_SHEENCOLORMAP - material.sheenColor *= texture2D( sheenColorMap, vUv ).rgb; - #endif - material.sheenRoughness = clamp( sheenRoughness, 0.07, 1.0 ); - #ifdef USE_SHEENROUGHNESSMAP - material.sheenRoughness *= texture2D( sheenRoughnessMap, vUv ).a; - #endif -#endif`,qH=`struct PhysicalMaterial { - vec3 diffuseColor; - float roughness; - vec3 specularColor; - float specularF90; - #ifdef USE_CLEARCOAT - float clearcoat; - float clearcoatRoughness; - vec3 clearcoatF0; - float clearcoatF90; - #endif - #ifdef USE_IRIDESCENCE - float iridescence; - float iridescenceIOR; - float iridescenceThickness; - vec3 iridescenceFresnel; - vec3 iridescenceF0; - #endif - #ifdef USE_SHEEN - vec3 sheenColor; - float sheenRoughness; - #endif - #ifdef IOR - float ior; - #endif - #ifdef USE_TRANSMISSION - float transmission; - float transmissionAlpha; - float thickness; - float attenuationDistance; - vec3 attenuationColor; - #endif -}; -vec3 clearcoatSpecular = vec3( 0.0 ); -vec3 sheenSpecular = vec3( 0.0 ); -float IBLSheenBRDF( const in vec3 normal, const in vec3 viewDir, const in float roughness ) { - float dotNV = saturate( dot( normal, viewDir ) ); - float r2 = roughness * roughness; - float a = roughness < 0.25 ? -339.2 * r2 + 161.4 * roughness - 25.9 : -8.48 * r2 + 14.3 * roughness - 9.95; - float b = roughness < 0.25 ? 44.0 * r2 - 23.7 * roughness + 3.26 : 1.97 * r2 - 3.27 * roughness + 0.72; - float DG = exp( a * dotNV + b ) + ( roughness < 0.25 ? 0.0 : 0.1 * ( roughness - 0.25 ) ); - return saturate( DG * RECIPROCAL_PI ); -} -vec2 DFGApprox( const in vec3 normal, const in vec3 viewDir, const in float roughness ) { - float dotNV = saturate( dot( normal, viewDir ) ); - const vec4 c0 = vec4( - 1, - 0.0275, - 0.572, 0.022 ); - const vec4 c1 = vec4( 1, 0.0425, 1.04, - 0.04 ); - vec4 r = roughness * c0 + c1; - float a004 = min( r.x * r.x, exp2( - 9.28 * dotNV ) ) * r.x + r.y; - vec2 fab = vec2( - 1.04, 1.04 ) * a004 + r.zw; - return fab; -} -vec3 EnvironmentBRDF( const in vec3 normal, const in vec3 viewDir, const in vec3 specularColor, const in float specularF90, const in float roughness ) { - vec2 fab = DFGApprox( normal, viewDir, roughness ); - return specularColor * fab.x + specularF90 * fab.y; -} -#ifdef USE_IRIDESCENCE -void computeMultiscatteringIridescence( const in vec3 normal, const in vec3 viewDir, const in vec3 specularColor, const in float specularF90, const in float iridescence, const in vec3 iridescenceF0, const in float roughness, inout vec3 singleScatter, inout vec3 multiScatter ) { -#else -void computeMultiscattering( const in vec3 normal, const in vec3 viewDir, const in vec3 specularColor, const in float specularF90, const in float roughness, inout vec3 singleScatter, inout vec3 multiScatter ) { -#endif - vec2 fab = DFGApprox( normal, viewDir, roughness ); - #ifdef USE_IRIDESCENCE - vec3 Fr = mix( specularColor, iridescenceF0, iridescence ); - #else - vec3 Fr = specularColor; - #endif - vec3 FssEss = Fr * fab.x + specularF90 * fab.y; - float Ess = fab.x + fab.y; - float Ems = 1.0 - Ess; - vec3 Favg = Fr + ( 1.0 - Fr ) * 0.047619; vec3 Fms = FssEss * Favg / ( 1.0 - Ems * Favg ); - singleScatter += FssEss; - multiScatter += Fms * Ems; -} -#if NUM_RECT_AREA_LIGHTS > 0 - void RE_Direct_RectArea_Physical( const in RectAreaLight rectAreaLight, const in GeometricContext geometry, const in PhysicalMaterial material, inout ReflectedLight reflectedLight ) { - vec3 normal = geometry.normal; - vec3 viewDir = geometry.viewDir; - vec3 position = geometry.position; - vec3 lightPos = rectAreaLight.position; - vec3 halfWidth = rectAreaLight.halfWidth; - vec3 halfHeight = rectAreaLight.halfHeight; - vec3 lightColor = rectAreaLight.color; - float roughness = material.roughness; - vec3 rectCoords[ 4 ]; - rectCoords[ 0 ] = lightPos + halfWidth - halfHeight; rectCoords[ 1 ] = lightPos - halfWidth - halfHeight; - rectCoords[ 2 ] = lightPos - halfWidth + halfHeight; - rectCoords[ 3 ] = lightPos + halfWidth + halfHeight; - vec2 uv = LTC_Uv( normal, viewDir, roughness ); - vec4 t1 = texture2D( ltc_1, uv ); - vec4 t2 = texture2D( ltc_2, uv ); - mat3 mInv = mat3( - vec3( t1.x, 0, t1.y ), - vec3( 0, 1, 0 ), - vec3( t1.z, 0, t1.w ) - ); - vec3 fresnel = ( material.specularColor * t2.x + ( vec3( 1.0 ) - material.specularColor ) * t2.y ); - reflectedLight.directSpecular += lightColor * fresnel * LTC_Evaluate( normal, viewDir, position, mInv, rectCoords ); - reflectedLight.directDiffuse += lightColor * material.diffuseColor * LTC_Evaluate( normal, viewDir, position, mat3( 1.0 ), rectCoords ); - } -#endif -void RE_Direct_Physical( const in IncidentLight directLight, const in GeometricContext geometry, const in PhysicalMaterial material, inout ReflectedLight reflectedLight ) { - float dotNL = saturate( dot( geometry.normal, directLight.direction ) ); - vec3 irradiance = dotNL * directLight.color; - #ifdef USE_CLEARCOAT - float dotNLcc = saturate( dot( geometry.clearcoatNormal, directLight.direction ) ); - vec3 ccIrradiance = dotNLcc * directLight.color; - clearcoatSpecular += ccIrradiance * BRDF_GGX( directLight.direction, geometry.viewDir, geometry.clearcoatNormal, material.clearcoatF0, material.clearcoatF90, material.clearcoatRoughness ); - #endif - #ifdef USE_SHEEN - sheenSpecular += irradiance * BRDF_Sheen( directLight.direction, geometry.viewDir, geometry.normal, material.sheenColor, material.sheenRoughness ); - #endif - #ifdef USE_IRIDESCENCE - reflectedLight.directSpecular += irradiance * BRDF_GGX_Iridescence( directLight.direction, geometry.viewDir, geometry.normal, material.specularColor, material.specularF90, material.iridescence, material.iridescenceFresnel, material.roughness ); - #else - reflectedLight.directSpecular += irradiance * BRDF_GGX( directLight.direction, geometry.viewDir, geometry.normal, material.specularColor, material.specularF90, material.roughness ); - #endif - reflectedLight.directDiffuse += irradiance * BRDF_Lambert( material.diffuseColor ); -} -void RE_IndirectDiffuse_Physical( const in vec3 irradiance, const in GeometricContext geometry, const in PhysicalMaterial material, inout ReflectedLight reflectedLight ) { - reflectedLight.indirectDiffuse += irradiance * BRDF_Lambert( material.diffuseColor ); -} -void RE_IndirectSpecular_Physical( const in vec3 radiance, const in vec3 irradiance, const in vec3 clearcoatRadiance, const in GeometricContext geometry, const in PhysicalMaterial material, inout ReflectedLight reflectedLight) { - #ifdef USE_CLEARCOAT - clearcoatSpecular += clearcoatRadiance * EnvironmentBRDF( geometry.clearcoatNormal, geometry.viewDir, material.clearcoatF0, material.clearcoatF90, material.clearcoatRoughness ); - #endif - #ifdef USE_SHEEN - sheenSpecular += irradiance * material.sheenColor * IBLSheenBRDF( geometry.normal, geometry.viewDir, material.sheenRoughness ); - #endif - vec3 singleScattering = vec3( 0.0 ); - vec3 multiScattering = vec3( 0.0 ); - vec3 cosineWeightedIrradiance = irradiance * RECIPROCAL_PI; - #ifdef USE_IRIDESCENCE - computeMultiscatteringIridescence( geometry.normal, geometry.viewDir, material.specularColor, material.specularF90, material.iridescence, material.iridescenceFresnel, material.roughness, singleScattering, multiScattering ); - #else - computeMultiscattering( geometry.normal, geometry.viewDir, material.specularColor, material.specularF90, material.roughness, singleScattering, multiScattering ); - #endif - vec3 totalScattering = singleScattering + multiScattering; - vec3 diffuse = material.diffuseColor * ( 1.0 - max( max( totalScattering.r, totalScattering.g ), totalScattering.b ) ); - reflectedLight.indirectSpecular += radiance * singleScattering; - reflectedLight.indirectSpecular += multiScattering * cosineWeightedIrradiance; - reflectedLight.indirectDiffuse += diffuse * cosineWeightedIrradiance; -} -#define RE_Direct RE_Direct_Physical -#define RE_Direct_RectArea RE_Direct_RectArea_Physical -#define RE_IndirectDiffuse RE_IndirectDiffuse_Physical -#define RE_IndirectSpecular RE_IndirectSpecular_Physical -float computeSpecularOcclusion( const in float dotNV, const in float ambientOcclusion, const in float roughness ) { - return saturate( pow( dotNV + ambientOcclusion, exp2( - 16.0 * roughness - 1.0 ) ) - 1.0 + ambientOcclusion ); -}`,$H=` -GeometricContext geometry; -geometry.position = - vViewPosition; -geometry.normal = normal; -geometry.viewDir = ( isOrthographic ) ? vec3( 0, 0, 1 ) : normalize( vViewPosition ); -#ifdef USE_CLEARCOAT - geometry.clearcoatNormal = clearcoatNormal; -#endif -#ifdef USE_IRIDESCENCE - float dotNVi = saturate( dot( normal, geometry.viewDir ) ); - if ( material.iridescenceThickness == 0.0 ) { - material.iridescence = 0.0; - } else { - material.iridescence = saturate( material.iridescence ); - } - if ( material.iridescence > 0.0 ) { - material.iridescenceFresnel = evalIridescence( 1.0, material.iridescenceIOR, dotNVi, material.iridescenceThickness, material.specularColor ); - material.iridescenceF0 = Schlick_to_F0( material.iridescenceFresnel, 1.0, dotNVi ); - } -#endif -IncidentLight directLight; -#if ( NUM_POINT_LIGHTS > 0 ) && defined( RE_Direct ) - PointLight pointLight; - #if defined( USE_SHADOWMAP ) && NUM_POINT_LIGHT_SHADOWS > 0 - PointLightShadow pointLightShadow; - #endif - #pragma unroll_loop_start - for ( int i = 0; i < NUM_POINT_LIGHTS; i ++ ) { - pointLight = pointLights[ i ]; - getPointLightInfo( pointLight, geometry, directLight ); - #if defined( USE_SHADOWMAP ) && ( UNROLLED_LOOP_INDEX < NUM_POINT_LIGHT_SHADOWS ) - pointLightShadow = pointLightShadows[ i ]; - directLight.color *= ( directLight.visible && receiveShadow ) ? getPointShadow( pointShadowMap[ i ], pointLightShadow.shadowMapSize, pointLightShadow.shadowBias, pointLightShadow.shadowRadius, vPointShadowCoord[ i ], pointLightShadow.shadowCameraNear, pointLightShadow.shadowCameraFar ) : 1.0; - #endif - RE_Direct( directLight, geometry, material, reflectedLight ); - } - #pragma unroll_loop_end -#endif -#if ( NUM_SPOT_LIGHTS > 0 ) && defined( RE_Direct ) - SpotLight spotLight; - vec4 spotColor; - vec3 spotLightCoord; - bool inSpotLightMap; - #if defined( USE_SHADOWMAP ) && NUM_SPOT_LIGHT_SHADOWS > 0 - SpotLightShadow spotLightShadow; - #endif - #pragma unroll_loop_start - for ( int i = 0; i < NUM_SPOT_LIGHTS; i ++ ) { - spotLight = spotLights[ i ]; - getSpotLightInfo( spotLight, geometry, directLight ); - #if ( UNROLLED_LOOP_INDEX < NUM_SPOT_LIGHT_SHADOWS_WITH_MAPS ) - #define SPOT_LIGHT_MAP_INDEX UNROLLED_LOOP_INDEX - #elif ( UNROLLED_LOOP_INDEX < NUM_SPOT_LIGHT_SHADOWS ) - #define SPOT_LIGHT_MAP_INDEX NUM_SPOT_LIGHT_MAPS - #else - #define SPOT_LIGHT_MAP_INDEX ( UNROLLED_LOOP_INDEX - NUM_SPOT_LIGHT_SHADOWS + NUM_SPOT_LIGHT_SHADOWS_WITH_MAPS ) - #endif - #if ( SPOT_LIGHT_MAP_INDEX < NUM_SPOT_LIGHT_MAPS ) - spotLightCoord = vSpotLightCoord[ i ].xyz / vSpotLightCoord[ i ].w; - inSpotLightMap = all( lessThan( abs( spotLightCoord * 2. - 1. ), vec3( 1.0 ) ) ); - spotColor = texture2D( spotLightMap[ SPOT_LIGHT_MAP_INDEX ], spotLightCoord.xy ); - directLight.color = inSpotLightMap ? directLight.color * spotColor.rgb : directLight.color; - #endif - #undef SPOT_LIGHT_MAP_INDEX - #if defined( USE_SHADOWMAP ) && ( UNROLLED_LOOP_INDEX < NUM_SPOT_LIGHT_SHADOWS ) - spotLightShadow = spotLightShadows[ i ]; - directLight.color *= ( directLight.visible && receiveShadow ) ? getShadow( spotShadowMap[ i ], spotLightShadow.shadowMapSize, spotLightShadow.shadowBias, spotLightShadow.shadowRadius, vSpotLightCoord[ i ] ) : 1.0; - #endif - RE_Direct( directLight, geometry, material, reflectedLight ); - } - #pragma unroll_loop_end -#endif -#if ( NUM_DIR_LIGHTS > 0 ) && defined( RE_Direct ) - DirectionalLight directionalLight; - #if defined( USE_SHADOWMAP ) && NUM_DIR_LIGHT_SHADOWS > 0 - DirectionalLightShadow directionalLightShadow; - #endif - #pragma unroll_loop_start - for ( int i = 0; i < NUM_DIR_LIGHTS; i ++ ) { - directionalLight = directionalLights[ i ]; - getDirectionalLightInfo( directionalLight, geometry, directLight ); - #if defined( USE_SHADOWMAP ) && ( UNROLLED_LOOP_INDEX < NUM_DIR_LIGHT_SHADOWS ) - directionalLightShadow = directionalLightShadows[ i ]; - directLight.color *= ( directLight.visible && receiveShadow ) ? getShadow( directionalShadowMap[ i ], directionalLightShadow.shadowMapSize, directionalLightShadow.shadowBias, directionalLightShadow.shadowRadius, vDirectionalShadowCoord[ i ] ) : 1.0; - #endif - RE_Direct( directLight, geometry, material, reflectedLight ); - } - #pragma unroll_loop_end -#endif -#if ( NUM_RECT_AREA_LIGHTS > 0 ) && defined( RE_Direct_RectArea ) - RectAreaLight rectAreaLight; - #pragma unroll_loop_start - for ( int i = 0; i < NUM_RECT_AREA_LIGHTS; i ++ ) { - rectAreaLight = rectAreaLights[ i ]; - RE_Direct_RectArea( rectAreaLight, geometry, material, reflectedLight ); - } - #pragma unroll_loop_end -#endif -#if defined( RE_IndirectDiffuse ) - vec3 iblIrradiance = vec3( 0.0 ); - vec3 irradiance = getAmbientLightIrradiance( ambientLightColor ); - irradiance += getLightProbeIrradiance( lightProbe, geometry.normal ); - #if ( NUM_HEMI_LIGHTS > 0 ) - #pragma unroll_loop_start - for ( int i = 0; i < NUM_HEMI_LIGHTS; i ++ ) { - irradiance += getHemisphereLightIrradiance( hemisphereLights[ i ], geometry.normal ); - } - #pragma unroll_loop_end - #endif -#endif -#if defined( RE_IndirectSpecular ) - vec3 radiance = vec3( 0.0 ); - vec3 clearcoatRadiance = vec3( 0.0 ); -#endif`,eV=`#if defined( RE_IndirectDiffuse ) - #ifdef USE_LIGHTMAP - vec4 lightMapTexel = texture2D( lightMap, vUv2 ); - vec3 lightMapIrradiance = lightMapTexel.rgb * lightMapIntensity; - irradiance += lightMapIrradiance; - #endif - #if defined( USE_ENVMAP ) && defined( STANDARD ) && defined( ENVMAP_TYPE_CUBE_UV ) - iblIrradiance += getIBLIrradiance( geometry.normal ); - #endif -#endif -#if defined( USE_ENVMAP ) && defined( RE_IndirectSpecular ) - radiance += getIBLRadiance( geometry.viewDir, geometry.normal, material.roughness ); - #ifdef USE_CLEARCOAT - clearcoatRadiance += getIBLRadiance( geometry.viewDir, geometry.clearcoatNormal, material.clearcoatRoughness ); - #endif -#endif`,tV=`#if defined( RE_IndirectDiffuse ) - RE_IndirectDiffuse( irradiance, geometry, material, reflectedLight ); -#endif -#if defined( RE_IndirectSpecular ) - RE_IndirectSpecular( radiance, iblIrradiance, clearcoatRadiance, geometry, material, reflectedLight ); -#endif`,nV=`#if defined( USE_LOGDEPTHBUF ) && defined( USE_LOGDEPTHBUF_EXT ) - gl_FragDepthEXT = vIsPerspective == 0.0 ? gl_FragCoord.z : log2( vFragDepth ) * logDepthBufFC * 0.5; -#endif`,rV=`#if defined( USE_LOGDEPTHBUF ) && defined( USE_LOGDEPTHBUF_EXT ) - uniform float logDepthBufFC; - varying float vFragDepth; - varying float vIsPerspective; -#endif`,iV=`#ifdef USE_LOGDEPTHBUF - #ifdef USE_LOGDEPTHBUF_EXT - varying float vFragDepth; - varying float vIsPerspective; - #else - uniform float logDepthBufFC; - #endif -#endif`,sV=`#ifdef USE_LOGDEPTHBUF - #ifdef USE_LOGDEPTHBUF_EXT - vFragDepth = 1.0 + gl_Position.w; - vIsPerspective = float( isPerspectiveMatrix( projectionMatrix ) ); - #else - if ( isPerspectiveMatrix( projectionMatrix ) ) { - gl_Position.z = log2( max( EPSILON, gl_Position.w + 1.0 ) ) * logDepthBufFC - 1.0; - gl_Position.z *= gl_Position.w; - } - #endif -#endif`,oV=`#ifdef USE_MAP - vec4 sampledDiffuseColor = texture2D( map, vUv ); - #ifdef DECODE_VIDEO_TEXTURE - sampledDiffuseColor = vec4( mix( pow( sampledDiffuseColor.rgb * 0.9478672986 + vec3( 0.0521327014 ), vec3( 2.4 ) ), sampledDiffuseColor.rgb * 0.0773993808, vec3( lessThanEqual( sampledDiffuseColor.rgb, vec3( 0.04045 ) ) ) ), sampledDiffuseColor.w ); - #endif - diffuseColor *= sampledDiffuseColor; -#endif`,aV=`#ifdef USE_MAP - uniform sampler2D map; -#endif`,lV=`#if defined( USE_MAP ) || defined( USE_ALPHAMAP ) - vec2 uv = ( uvTransform * vec3( gl_PointCoord.x, 1.0 - gl_PointCoord.y, 1 ) ).xy; -#endif -#ifdef USE_MAP - diffuseColor *= texture2D( map, uv ); -#endif -#ifdef USE_ALPHAMAP - diffuseColor.a *= texture2D( alphaMap, uv ).g; -#endif`,uV=`#if defined( USE_MAP ) || defined( USE_ALPHAMAP ) - uniform mat3 uvTransform; -#endif -#ifdef USE_MAP - uniform sampler2D map; -#endif -#ifdef USE_ALPHAMAP - uniform sampler2D alphaMap; -#endif`,cV=`float metalnessFactor = metalness; -#ifdef USE_METALNESSMAP - vec4 texelMetalness = texture2D( metalnessMap, vUv ); - metalnessFactor *= texelMetalness.b; -#endif`,fV=`#ifdef USE_METALNESSMAP - uniform sampler2D metalnessMap; -#endif`,hV=`#if defined( USE_MORPHCOLORS ) && defined( MORPHTARGETS_TEXTURE ) - vColor *= morphTargetBaseInfluence; - for ( int i = 0; i < MORPHTARGETS_COUNT; i ++ ) { - #if defined( USE_COLOR_ALPHA ) - if ( morphTargetInfluences[ i ] != 0.0 ) vColor += getMorph( gl_VertexID, i, 2 ) * morphTargetInfluences[ i ]; - #elif defined( USE_COLOR ) - if ( morphTargetInfluences[ i ] != 0.0 ) vColor += getMorph( gl_VertexID, i, 2 ).rgb * morphTargetInfluences[ i ]; - #endif - } -#endif`,dV=`#ifdef USE_MORPHNORMALS - objectNormal *= morphTargetBaseInfluence; - #ifdef MORPHTARGETS_TEXTURE - for ( int i = 0; i < MORPHTARGETS_COUNT; i ++ ) { - if ( morphTargetInfluences[ i ] != 0.0 ) objectNormal += getMorph( gl_VertexID, i, 1 ).xyz * morphTargetInfluences[ i ]; - } - #else - objectNormal += morphNormal0 * morphTargetInfluences[ 0 ]; - objectNormal += morphNormal1 * morphTargetInfluences[ 1 ]; - objectNormal += morphNormal2 * morphTargetInfluences[ 2 ]; - objectNormal += morphNormal3 * morphTargetInfluences[ 3 ]; - #endif -#endif`,pV=`#ifdef USE_MORPHTARGETS - uniform float morphTargetBaseInfluence; - #ifdef MORPHTARGETS_TEXTURE - uniform float morphTargetInfluences[ MORPHTARGETS_COUNT ]; - uniform sampler2DArray morphTargetsTexture; - uniform ivec2 morphTargetsTextureSize; - vec4 getMorph( const in int vertexIndex, const in int morphTargetIndex, const in int offset ) { - int texelIndex = vertexIndex * MORPHTARGETS_TEXTURE_STRIDE + offset; - int y = texelIndex / morphTargetsTextureSize.x; - int x = texelIndex - y * morphTargetsTextureSize.x; - ivec3 morphUV = ivec3( x, y, morphTargetIndex ); - return texelFetch( morphTargetsTexture, morphUV, 0 ); - } - #else - #ifndef USE_MORPHNORMALS - uniform float morphTargetInfluences[ 8 ]; - #else - uniform float morphTargetInfluences[ 4 ]; - #endif - #endif -#endif`,mV=`#ifdef USE_MORPHTARGETS - transformed *= morphTargetBaseInfluence; - #ifdef MORPHTARGETS_TEXTURE - for ( int i = 0; i < MORPHTARGETS_COUNT; i ++ ) { - if ( morphTargetInfluences[ i ] != 0.0 ) transformed += getMorph( gl_VertexID, i, 0 ).xyz * morphTargetInfluences[ i ]; - } - #else - transformed += morphTarget0 * morphTargetInfluences[ 0 ]; - transformed += morphTarget1 * morphTargetInfluences[ 1 ]; - transformed += morphTarget2 * morphTargetInfluences[ 2 ]; - transformed += morphTarget3 * morphTargetInfluences[ 3 ]; - #ifndef USE_MORPHNORMALS - transformed += morphTarget4 * morphTargetInfluences[ 4 ]; - transformed += morphTarget5 * morphTargetInfluences[ 5 ]; - transformed += morphTarget6 * morphTargetInfluences[ 6 ]; - transformed += morphTarget7 * morphTargetInfluences[ 7 ]; - #endif - #endif -#endif`,gV=`float faceDirection = gl_FrontFacing ? 1.0 : - 1.0; -#ifdef FLAT_SHADED - vec3 fdx = dFdx( vViewPosition ); - vec3 fdy = dFdy( vViewPosition ); - vec3 normal = normalize( cross( fdx, fdy ) ); -#else - vec3 normal = normalize( vNormal ); - #ifdef DOUBLE_SIDED - normal = normal * faceDirection; - #endif - #ifdef USE_TANGENT - vec3 tangent = normalize( vTangent ); - vec3 bitangent = normalize( vBitangent ); - #ifdef DOUBLE_SIDED - tangent = tangent * faceDirection; - bitangent = bitangent * faceDirection; - #endif - #if defined( TANGENTSPACE_NORMALMAP ) || defined( USE_CLEARCOAT_NORMALMAP ) - mat3 vTBN = mat3( tangent, bitangent, normal ); - #endif - #endif -#endif -vec3 geometryNormal = normal;`,vV=`#ifdef OBJECTSPACE_NORMALMAP - normal = texture2D( normalMap, vUv ).xyz * 2.0 - 1.0; - #ifdef FLIP_SIDED - normal = - normal; - #endif - #ifdef DOUBLE_SIDED - normal = normal * faceDirection; - #endif - normal = normalize( normalMatrix * normal ); -#elif defined( TANGENTSPACE_NORMALMAP ) - vec3 mapN = texture2D( normalMap, vUv ).xyz * 2.0 - 1.0; - mapN.xy *= normalScale; - #ifdef USE_TANGENT - normal = normalize( vTBN * mapN ); - #else - normal = perturbNormal2Arb( - vViewPosition, normal, mapN, faceDirection ); - #endif -#elif defined( USE_BUMPMAP ) - normal = perturbNormalArb( - vViewPosition, normal, dHdxy_fwd(), faceDirection ); -#endif`,yV=`#ifndef FLAT_SHADED - varying vec3 vNormal; - #ifdef USE_TANGENT - varying vec3 vTangent; - varying vec3 vBitangent; - #endif -#endif`,xV=`#ifndef FLAT_SHADED - varying vec3 vNormal; - #ifdef USE_TANGENT - varying vec3 vTangent; - varying vec3 vBitangent; - #endif -#endif`,_V=`#ifndef FLAT_SHADED - vNormal = normalize( transformedNormal ); - #ifdef USE_TANGENT - vTangent = normalize( transformedTangent ); - vBitangent = normalize( cross( vNormal, vTangent ) * tangent.w ); - #endif -#endif`,wV=`#ifdef USE_NORMALMAP - uniform sampler2D normalMap; - uniform vec2 normalScale; -#endif -#ifdef OBJECTSPACE_NORMALMAP - uniform mat3 normalMatrix; -#endif -#if ! defined ( USE_TANGENT ) && ( defined ( TANGENTSPACE_NORMALMAP ) || defined ( USE_CLEARCOAT_NORMALMAP ) ) - vec3 perturbNormal2Arb( vec3 eye_pos, vec3 surf_norm, vec3 mapN, float faceDirection ) { - vec3 q0 = dFdx( eye_pos.xyz ); - vec3 q1 = dFdy( eye_pos.xyz ); - vec2 st0 = dFdx( vUv.st ); - vec2 st1 = dFdy( vUv.st ); - vec3 N = surf_norm; - vec3 q1perp = cross( q1, N ); - vec3 q0perp = cross( N, q0 ); - vec3 T = q1perp * st0.x + q0perp * st1.x; - vec3 B = q1perp * st0.y + q0perp * st1.y; - float det = max( dot( T, T ), dot( B, B ) ); - float scale = ( det == 0.0 ) ? 0.0 : faceDirection * inversesqrt( det ); - return normalize( T * ( mapN.x * scale ) + B * ( mapN.y * scale ) + N * mapN.z ); - } -#endif`,SV=`#ifdef USE_CLEARCOAT - vec3 clearcoatNormal = geometryNormal; -#endif`,AV=`#ifdef USE_CLEARCOAT_NORMALMAP - vec3 clearcoatMapN = texture2D( clearcoatNormalMap, vUv ).xyz * 2.0 - 1.0; - clearcoatMapN.xy *= clearcoatNormalScale; - #ifdef USE_TANGENT - clearcoatNormal = normalize( vTBN * clearcoatMapN ); - #else - clearcoatNormal = perturbNormal2Arb( - vViewPosition, clearcoatNormal, clearcoatMapN, faceDirection ); - #endif -#endif`,MV=`#ifdef USE_CLEARCOATMAP - uniform sampler2D clearcoatMap; -#endif -#ifdef USE_CLEARCOAT_ROUGHNESSMAP - uniform sampler2D clearcoatRoughnessMap; -#endif -#ifdef USE_CLEARCOAT_NORMALMAP - uniform sampler2D clearcoatNormalMap; - uniform vec2 clearcoatNormalScale; -#endif`,EV=`#ifdef USE_IRIDESCENCEMAP - uniform sampler2D iridescenceMap; -#endif -#ifdef USE_IRIDESCENCE_THICKNESSMAP - uniform sampler2D iridescenceThicknessMap; -#endif`,CV=`#ifdef OPAQUE -diffuseColor.a = 1.0; -#endif -#ifdef USE_TRANSMISSION -diffuseColor.a *= material.transmissionAlpha + 0.1; -#endif -gl_FragColor = vec4( outgoingLight, diffuseColor.a );`,bV=`vec3 packNormalToRGB( const in vec3 normal ) { - return normalize( normal ) * 0.5 + 0.5; -} -vec3 unpackRGBToNormal( const in vec3 rgb ) { - return 2.0 * rgb.xyz - 1.0; -} -const float PackUpscale = 256. / 255.;const float UnpackDownscale = 255. / 256.; -const vec3 PackFactors = vec3( 256. * 256. * 256., 256. * 256., 256. ); -const vec4 UnpackFactors = UnpackDownscale / vec4( PackFactors, 1. ); -const float ShiftRight8 = 1. / 256.; -vec4 packDepthToRGBA( const in float v ) { - vec4 r = vec4( fract( v * PackFactors ), v ); - r.yzw -= r.xyz * ShiftRight8; return r * PackUpscale; -} -float unpackRGBAToDepth( const in vec4 v ) { - return dot( v, UnpackFactors ); -} -vec2 packDepthToRG( in highp float v ) { - return packDepthToRGBA( v ).yx; -} -float unpackRGToDepth( const in highp vec2 v ) { - return unpackRGBAToDepth( vec4( v.xy, 0.0, 0.0 ) ); -} -vec4 pack2HalfToRGBA( vec2 v ) { - vec4 r = vec4( v.x, fract( v.x * 255.0 ), v.y, fract( v.y * 255.0 ) ); - return vec4( r.x - r.y / 255.0, r.y, r.z - r.w / 255.0, r.w ); -} -vec2 unpackRGBATo2Half( vec4 v ) { - return vec2( v.x + ( v.y / 255.0 ), v.z + ( v.w / 255.0 ) ); -} -float viewZToOrthographicDepth( const in float viewZ, const in float near, const in float far ) { - return ( viewZ + near ) / ( near - far ); -} -float orthographicDepthToViewZ( const in float linearClipZ, const in float near, const in float far ) { - return linearClipZ * ( near - far ) - near; -} -float viewZToPerspectiveDepth( const in float viewZ, const in float near, const in float far ) { - return ( ( near + viewZ ) * far ) / ( ( far - near ) * viewZ ); -} -float perspectiveDepthToViewZ( const in float invClipZ, const in float near, const in float far ) { - return ( near * far ) / ( ( far - near ) * invClipZ - far ); -}`,TV=`#ifdef PREMULTIPLIED_ALPHA - gl_FragColor.rgb *= gl_FragColor.a; -#endif`,RV=`vec4 mvPosition = vec4( transformed, 1.0 ); -#ifdef USE_INSTANCING - mvPosition = instanceMatrix * mvPosition; -#endif -mvPosition = modelViewMatrix * mvPosition; -gl_Position = projectionMatrix * mvPosition;`,BV=`#ifdef DITHERING - gl_FragColor.rgb = dithering( gl_FragColor.rgb ); -#endif`,PV=`#ifdef DITHERING - vec3 dithering( vec3 color ) { - float grid_position = rand( gl_FragCoord.xy ); - vec3 dither_shift_RGB = vec3( 0.25 / 255.0, -0.25 / 255.0, 0.25 / 255.0 ); - dither_shift_RGB = mix( 2.0 * dither_shift_RGB, -2.0 * dither_shift_RGB, grid_position ); - return color + dither_shift_RGB; - } -#endif`,IV=`float roughnessFactor = roughness; -#ifdef USE_ROUGHNESSMAP - vec4 texelRoughness = texture2D( roughnessMap, vUv ); - roughnessFactor *= texelRoughness.g; -#endif`,LV=`#ifdef USE_ROUGHNESSMAP - uniform sampler2D roughnessMap; -#endif`,DV=`#if NUM_SPOT_LIGHT_COORDS > 0 - varying vec4 vSpotLightCoord[ NUM_SPOT_LIGHT_COORDS ]; -#endif -#if NUM_SPOT_LIGHT_MAPS > 0 - uniform sampler2D spotLightMap[ NUM_SPOT_LIGHT_MAPS ]; -#endif -#ifdef USE_SHADOWMAP - #if NUM_DIR_LIGHT_SHADOWS > 0 - uniform sampler2D directionalShadowMap[ NUM_DIR_LIGHT_SHADOWS ]; - varying vec4 vDirectionalShadowCoord[ NUM_DIR_LIGHT_SHADOWS ]; - struct DirectionalLightShadow { - float shadowBias; - float shadowNormalBias; - float shadowRadius; - vec2 shadowMapSize; - }; - uniform DirectionalLightShadow directionalLightShadows[ NUM_DIR_LIGHT_SHADOWS ]; - #endif - #if NUM_SPOT_LIGHT_SHADOWS > 0 - uniform sampler2D spotShadowMap[ NUM_SPOT_LIGHT_SHADOWS ]; - struct SpotLightShadow { - float shadowBias; - float shadowNormalBias; - float shadowRadius; - vec2 shadowMapSize; - }; - uniform SpotLightShadow spotLightShadows[ NUM_SPOT_LIGHT_SHADOWS ]; - #endif - #if NUM_POINT_LIGHT_SHADOWS > 0 - uniform sampler2D pointShadowMap[ NUM_POINT_LIGHT_SHADOWS ]; - varying vec4 vPointShadowCoord[ NUM_POINT_LIGHT_SHADOWS ]; - struct PointLightShadow { - float shadowBias; - float shadowNormalBias; - float shadowRadius; - vec2 shadowMapSize; - float shadowCameraNear; - float shadowCameraFar; - }; - uniform PointLightShadow pointLightShadows[ NUM_POINT_LIGHT_SHADOWS ]; - #endif - float texture2DCompare( sampler2D depths, vec2 uv, float compare ) { - return step( compare, unpackRGBAToDepth( texture2D( depths, uv ) ) ); - } - vec2 texture2DDistribution( sampler2D shadow, vec2 uv ) { - return unpackRGBATo2Half( texture2D( shadow, uv ) ); - } - float VSMShadow (sampler2D shadow, vec2 uv, float compare ){ - float occlusion = 1.0; - vec2 distribution = texture2DDistribution( shadow, uv ); - float hard_shadow = step( compare , distribution.x ); - if (hard_shadow != 1.0 ) { - float distance = compare - distribution.x ; - float variance = max( 0.00000, distribution.y * distribution.y ); - float softness_probability = variance / (variance + distance * distance ); softness_probability = clamp( ( softness_probability - 0.3 ) / ( 0.95 - 0.3 ), 0.0, 1.0 ); occlusion = clamp( max( hard_shadow, softness_probability ), 0.0, 1.0 ); - } - return occlusion; - } - float getShadow( sampler2D shadowMap, vec2 shadowMapSize, float shadowBias, float shadowRadius, vec4 shadowCoord ) { - float shadow = 1.0; - shadowCoord.xyz /= shadowCoord.w; - shadowCoord.z += shadowBias; - bool inFrustum = shadowCoord.x >= 0.0 && shadowCoord.x <= 1.0 && shadowCoord.y >= 0.0 && shadowCoord.y <= 1.0; - bool frustumTest = inFrustum && shadowCoord.z <= 1.0; - if ( frustumTest ) { - #if defined( SHADOWMAP_TYPE_PCF ) - vec2 texelSize = vec2( 1.0 ) / shadowMapSize; - float dx0 = - texelSize.x * shadowRadius; - float dy0 = - texelSize.y * shadowRadius; - float dx1 = + texelSize.x * shadowRadius; - float dy1 = + texelSize.y * shadowRadius; - float dx2 = dx0 / 2.0; - float dy2 = dy0 / 2.0; - float dx3 = dx1 / 2.0; - float dy3 = dy1 / 2.0; - shadow = ( - texture2DCompare( shadowMap, shadowCoord.xy + vec2( dx0, dy0 ), shadowCoord.z ) + - texture2DCompare( shadowMap, shadowCoord.xy + vec2( 0.0, dy0 ), shadowCoord.z ) + - texture2DCompare( shadowMap, shadowCoord.xy + vec2( dx1, dy0 ), shadowCoord.z ) + - texture2DCompare( shadowMap, shadowCoord.xy + vec2( dx2, dy2 ), shadowCoord.z ) + - texture2DCompare( shadowMap, shadowCoord.xy + vec2( 0.0, dy2 ), shadowCoord.z ) + - texture2DCompare( shadowMap, shadowCoord.xy + vec2( dx3, dy2 ), shadowCoord.z ) + - texture2DCompare( shadowMap, shadowCoord.xy + vec2( dx0, 0.0 ), shadowCoord.z ) + - texture2DCompare( shadowMap, shadowCoord.xy + vec2( dx2, 0.0 ), shadowCoord.z ) + - texture2DCompare( shadowMap, shadowCoord.xy, shadowCoord.z ) + - texture2DCompare( shadowMap, shadowCoord.xy + vec2( dx3, 0.0 ), shadowCoord.z ) + - texture2DCompare( shadowMap, shadowCoord.xy + vec2( dx1, 0.0 ), shadowCoord.z ) + - texture2DCompare( shadowMap, shadowCoord.xy + vec2( dx2, dy3 ), shadowCoord.z ) + - texture2DCompare( shadowMap, shadowCoord.xy + vec2( 0.0, dy3 ), shadowCoord.z ) + - texture2DCompare( shadowMap, shadowCoord.xy + vec2( dx3, dy3 ), shadowCoord.z ) + - texture2DCompare( shadowMap, shadowCoord.xy + vec2( dx0, dy1 ), shadowCoord.z ) + - texture2DCompare( shadowMap, shadowCoord.xy + vec2( 0.0, dy1 ), shadowCoord.z ) + - texture2DCompare( shadowMap, shadowCoord.xy + vec2( dx1, dy1 ), shadowCoord.z ) - ) * ( 1.0 / 17.0 ); - #elif defined( SHADOWMAP_TYPE_PCF_SOFT ) - vec2 texelSize = vec2( 1.0 ) / shadowMapSize; - float dx = texelSize.x; - float dy = texelSize.y; - vec2 uv = shadowCoord.xy; - vec2 f = fract( uv * shadowMapSize + 0.5 ); - uv -= f * texelSize; - shadow = ( - texture2DCompare( shadowMap, uv, shadowCoord.z ) + - texture2DCompare( shadowMap, uv + vec2( dx, 0.0 ), shadowCoord.z ) + - texture2DCompare( shadowMap, uv + vec2( 0.0, dy ), shadowCoord.z ) + - texture2DCompare( shadowMap, uv + texelSize, shadowCoord.z ) + - mix( texture2DCompare( shadowMap, uv + vec2( -dx, 0.0 ), shadowCoord.z ), - texture2DCompare( shadowMap, uv + vec2( 2.0 * dx, 0.0 ), shadowCoord.z ), - f.x ) + - mix( texture2DCompare( shadowMap, uv + vec2( -dx, dy ), shadowCoord.z ), - texture2DCompare( shadowMap, uv + vec2( 2.0 * dx, dy ), shadowCoord.z ), - f.x ) + - mix( texture2DCompare( shadowMap, uv + vec2( 0.0, -dy ), shadowCoord.z ), - texture2DCompare( shadowMap, uv + vec2( 0.0, 2.0 * dy ), shadowCoord.z ), - f.y ) + - mix( texture2DCompare( shadowMap, uv + vec2( dx, -dy ), shadowCoord.z ), - texture2DCompare( shadowMap, uv + vec2( dx, 2.0 * dy ), shadowCoord.z ), - f.y ) + - mix( mix( texture2DCompare( shadowMap, uv + vec2( -dx, -dy ), shadowCoord.z ), - texture2DCompare( shadowMap, uv + vec2( 2.0 * dx, -dy ), shadowCoord.z ), - f.x ), - mix( texture2DCompare( shadowMap, uv + vec2( -dx, 2.0 * dy ), shadowCoord.z ), - texture2DCompare( shadowMap, uv + vec2( 2.0 * dx, 2.0 * dy ), shadowCoord.z ), - f.x ), - f.y ) - ) * ( 1.0 / 9.0 ); - #elif defined( SHADOWMAP_TYPE_VSM ) - shadow = VSMShadow( shadowMap, shadowCoord.xy, shadowCoord.z ); - #else - shadow = texture2DCompare( shadowMap, shadowCoord.xy, shadowCoord.z ); - #endif - } - return shadow; - } - vec2 cubeToUV( vec3 v, float texelSizeY ) { - vec3 absV = abs( v ); - float scaleToCube = 1.0 / max( absV.x, max( absV.y, absV.z ) ); - absV *= scaleToCube; - v *= scaleToCube * ( 1.0 - 2.0 * texelSizeY ); - vec2 planar = v.xy; - float almostATexel = 1.5 * texelSizeY; - float almostOne = 1.0 - almostATexel; - if ( absV.z >= almostOne ) { - if ( v.z > 0.0 ) - planar.x = 4.0 - v.x; - } else if ( absV.x >= almostOne ) { - float signX = sign( v.x ); - planar.x = v.z * signX + 2.0 * signX; - } else if ( absV.y >= almostOne ) { - float signY = sign( v.y ); - planar.x = v.x + 2.0 * signY + 2.0; - planar.y = v.z * signY - 2.0; - } - return vec2( 0.125, 0.25 ) * planar + vec2( 0.375, 0.75 ); - } - float getPointShadow( sampler2D shadowMap, vec2 shadowMapSize, float shadowBias, float shadowRadius, vec4 shadowCoord, float shadowCameraNear, float shadowCameraFar ) { - vec2 texelSize = vec2( 1.0 ) / ( shadowMapSize * vec2( 4.0, 2.0 ) ); - vec3 lightToPosition = shadowCoord.xyz; - float dp = ( length( lightToPosition ) - shadowCameraNear ) / ( shadowCameraFar - shadowCameraNear ); dp += shadowBias; - vec3 bd3D = normalize( lightToPosition ); - #if defined( SHADOWMAP_TYPE_PCF ) || defined( SHADOWMAP_TYPE_PCF_SOFT ) || defined( SHADOWMAP_TYPE_VSM ) - vec2 offset = vec2( - 1, 1 ) * shadowRadius * texelSize.y; - return ( - texture2DCompare( shadowMap, cubeToUV( bd3D + offset.xyy, texelSize.y ), dp ) + - texture2DCompare( shadowMap, cubeToUV( bd3D + offset.yyy, texelSize.y ), dp ) + - texture2DCompare( shadowMap, cubeToUV( bd3D + offset.xyx, texelSize.y ), dp ) + - texture2DCompare( shadowMap, cubeToUV( bd3D + offset.yyx, texelSize.y ), dp ) + - texture2DCompare( shadowMap, cubeToUV( bd3D, texelSize.y ), dp ) + - texture2DCompare( shadowMap, cubeToUV( bd3D + offset.xxy, texelSize.y ), dp ) + - texture2DCompare( shadowMap, cubeToUV( bd3D + offset.yxy, texelSize.y ), dp ) + - texture2DCompare( shadowMap, cubeToUV( bd3D + offset.xxx, texelSize.y ), dp ) + - texture2DCompare( shadowMap, cubeToUV( bd3D + offset.yxx, texelSize.y ), dp ) - ) * ( 1.0 / 9.0 ); - #else - return texture2DCompare( shadowMap, cubeToUV( bd3D, texelSize.y ), dp ); - #endif - } -#endif`,kV=`#if NUM_SPOT_LIGHT_COORDS > 0 - uniform mat4 spotLightMatrix[ NUM_SPOT_LIGHT_COORDS ]; - varying vec4 vSpotLightCoord[ NUM_SPOT_LIGHT_COORDS ]; -#endif -#ifdef USE_SHADOWMAP - #if NUM_DIR_LIGHT_SHADOWS > 0 - uniform mat4 directionalShadowMatrix[ NUM_DIR_LIGHT_SHADOWS ]; - varying vec4 vDirectionalShadowCoord[ NUM_DIR_LIGHT_SHADOWS ]; - struct DirectionalLightShadow { - float shadowBias; - float shadowNormalBias; - float shadowRadius; - vec2 shadowMapSize; - }; - uniform DirectionalLightShadow directionalLightShadows[ NUM_DIR_LIGHT_SHADOWS ]; - #endif - #if NUM_SPOT_LIGHT_SHADOWS > 0 - struct SpotLightShadow { - float shadowBias; - float shadowNormalBias; - float shadowRadius; - vec2 shadowMapSize; - }; - uniform SpotLightShadow spotLightShadows[ NUM_SPOT_LIGHT_SHADOWS ]; - #endif - #if NUM_POINT_LIGHT_SHADOWS > 0 - uniform mat4 pointShadowMatrix[ NUM_POINT_LIGHT_SHADOWS ]; - varying vec4 vPointShadowCoord[ NUM_POINT_LIGHT_SHADOWS ]; - struct PointLightShadow { - float shadowBias; - float shadowNormalBias; - float shadowRadius; - vec2 shadowMapSize; - float shadowCameraNear; - float shadowCameraFar; - }; - uniform PointLightShadow pointLightShadows[ NUM_POINT_LIGHT_SHADOWS ]; - #endif -#endif`,FV=`#if ( defined( USE_SHADOWMAP ) && ( NUM_DIR_LIGHT_SHADOWS > 0 || NUM_POINT_LIGHT_SHADOWS > 0 ) ) || ( NUM_SPOT_LIGHT_COORDS > 0 ) - vec3 shadowWorldNormal = inverseTransformDirection( transformedNormal, viewMatrix ); - vec4 shadowWorldPosition; -#endif -#if defined( USE_SHADOWMAP ) - #if NUM_DIR_LIGHT_SHADOWS > 0 - #pragma unroll_loop_start - for ( int i = 0; i < NUM_DIR_LIGHT_SHADOWS; i ++ ) { - shadowWorldPosition = worldPosition + vec4( shadowWorldNormal * directionalLightShadows[ i ].shadowNormalBias, 0 ); - vDirectionalShadowCoord[ i ] = directionalShadowMatrix[ i ] * shadowWorldPosition; - } - #pragma unroll_loop_end - #endif - #if NUM_POINT_LIGHT_SHADOWS > 0 - #pragma unroll_loop_start - for ( int i = 0; i < NUM_POINT_LIGHT_SHADOWS; i ++ ) { - shadowWorldPosition = worldPosition + vec4( shadowWorldNormal * pointLightShadows[ i ].shadowNormalBias, 0 ); - vPointShadowCoord[ i ] = pointShadowMatrix[ i ] * shadowWorldPosition; - } - #pragma unroll_loop_end - #endif -#endif -#if NUM_SPOT_LIGHT_COORDS > 0 - #pragma unroll_loop_start - for ( int i = 0; i < NUM_SPOT_LIGHT_COORDS; i ++ ) { - shadowWorldPosition = worldPosition; - #if ( defined( USE_SHADOWMAP ) && UNROLLED_LOOP_INDEX < NUM_SPOT_LIGHT_SHADOWS ) - shadowWorldPosition.xyz += shadowWorldNormal * spotLightShadows[ i ].shadowNormalBias; - #endif - vSpotLightCoord[ i ] = spotLightMatrix[ i ] * shadowWorldPosition; - } - #pragma unroll_loop_end -#endif`,NV=`float getShadowMask() { - float shadow = 1.0; - #ifdef USE_SHADOWMAP - #if NUM_DIR_LIGHT_SHADOWS > 0 - DirectionalLightShadow directionalLight; - #pragma unroll_loop_start - for ( int i = 0; i < NUM_DIR_LIGHT_SHADOWS; i ++ ) { - directionalLight = directionalLightShadows[ i ]; - shadow *= receiveShadow ? getShadow( directionalShadowMap[ i ], directionalLight.shadowMapSize, directionalLight.shadowBias, directionalLight.shadowRadius, vDirectionalShadowCoord[ i ] ) : 1.0; - } - #pragma unroll_loop_end - #endif - #if NUM_SPOT_LIGHT_SHADOWS > 0 - SpotLightShadow spotLight; - #pragma unroll_loop_start - for ( int i = 0; i < NUM_SPOT_LIGHT_SHADOWS; i ++ ) { - spotLight = spotLightShadows[ i ]; - shadow *= receiveShadow ? getShadow( spotShadowMap[ i ], spotLight.shadowMapSize, spotLight.shadowBias, spotLight.shadowRadius, vSpotLightCoord[ i ] ) : 1.0; - } - #pragma unroll_loop_end - #endif - #if NUM_POINT_LIGHT_SHADOWS > 0 - PointLightShadow pointLight; - #pragma unroll_loop_start - for ( int i = 0; i < NUM_POINT_LIGHT_SHADOWS; i ++ ) { - pointLight = pointLightShadows[ i ]; - shadow *= receiveShadow ? getPointShadow( pointShadowMap[ i ], pointLight.shadowMapSize, pointLight.shadowBias, pointLight.shadowRadius, vPointShadowCoord[ i ], pointLight.shadowCameraNear, pointLight.shadowCameraFar ) : 1.0; - } - #pragma unroll_loop_end - #endif - #endif - return shadow; -}`,OV=`#ifdef USE_SKINNING - mat4 boneMatX = getBoneMatrix( skinIndex.x ); - mat4 boneMatY = getBoneMatrix( skinIndex.y ); - mat4 boneMatZ = getBoneMatrix( skinIndex.z ); - mat4 boneMatW = getBoneMatrix( skinIndex.w ); -#endif`,UV=`#ifdef USE_SKINNING - uniform mat4 bindMatrix; - uniform mat4 bindMatrixInverse; - uniform highp sampler2D boneTexture; - uniform int boneTextureSize; - mat4 getBoneMatrix( const in float i ) { - float j = i * 4.0; - float x = mod( j, float( boneTextureSize ) ); - float y = floor( j / float( boneTextureSize ) ); - float dx = 1.0 / float( boneTextureSize ); - float dy = 1.0 / float( boneTextureSize ); - y = dy * ( y + 0.5 ); - vec4 v1 = texture2D( boneTexture, vec2( dx * ( x + 0.5 ), y ) ); - vec4 v2 = texture2D( boneTexture, vec2( dx * ( x + 1.5 ), y ) ); - vec4 v3 = texture2D( boneTexture, vec2( dx * ( x + 2.5 ), y ) ); - vec4 v4 = texture2D( boneTexture, vec2( dx * ( x + 3.5 ), y ) ); - mat4 bone = mat4( v1, v2, v3, v4 ); - return bone; - } -#endif`,zV=`#ifdef USE_SKINNING - vec4 skinVertex = bindMatrix * vec4( transformed, 1.0 ); - vec4 skinned = vec4( 0.0 ); - skinned += boneMatX * skinVertex * skinWeight.x; - skinned += boneMatY * skinVertex * skinWeight.y; - skinned += boneMatZ * skinVertex * skinWeight.z; - skinned += boneMatW * skinVertex * skinWeight.w; - transformed = ( bindMatrixInverse * skinned ).xyz; -#endif`,GV=`#ifdef USE_SKINNING - mat4 skinMatrix = mat4( 0.0 ); - skinMatrix += skinWeight.x * boneMatX; - skinMatrix += skinWeight.y * boneMatY; - skinMatrix += skinWeight.z * boneMatZ; - skinMatrix += skinWeight.w * boneMatW; - skinMatrix = bindMatrixInverse * skinMatrix * bindMatrix; - objectNormal = vec4( skinMatrix * vec4( objectNormal, 0.0 ) ).xyz; - #ifdef USE_TANGENT - objectTangent = vec4( skinMatrix * vec4( objectTangent, 0.0 ) ).xyz; - #endif -#endif`,HV=`float specularStrength; -#ifdef USE_SPECULARMAP - vec4 texelSpecular = texture2D( specularMap, vUv ); - specularStrength = texelSpecular.r; -#else - specularStrength = 1.0; -#endif`,VV=`#ifdef USE_SPECULARMAP - uniform sampler2D specularMap; -#endif`,WV=`#if defined( TONE_MAPPING ) - gl_FragColor.rgb = toneMapping( gl_FragColor.rgb ); -#endif`,JV=`#ifndef saturate -#define saturate( a ) clamp( a, 0.0, 1.0 ) -#endif -uniform float toneMappingExposure; -vec3 LinearToneMapping( vec3 color ) { - return toneMappingExposure * color; -} -vec3 ReinhardToneMapping( vec3 color ) { - color *= toneMappingExposure; - return saturate( color / ( vec3( 1.0 ) + color ) ); -} -vec3 OptimizedCineonToneMapping( vec3 color ) { - color *= toneMappingExposure; - color = max( vec3( 0.0 ), color - 0.004 ); - return pow( ( color * ( 6.2 * color + 0.5 ) ) / ( color * ( 6.2 * color + 1.7 ) + 0.06 ), vec3( 2.2 ) ); -} -vec3 RRTAndODTFit( vec3 v ) { - vec3 a = v * ( v + 0.0245786 ) - 0.000090537; - vec3 b = v * ( 0.983729 * v + 0.4329510 ) + 0.238081; - return a / b; -} -vec3 ACESFilmicToneMapping( vec3 color ) { - const mat3 ACESInputMat = mat3( - vec3( 0.59719, 0.07600, 0.02840 ), vec3( 0.35458, 0.90834, 0.13383 ), - vec3( 0.04823, 0.01566, 0.83777 ) - ); - const mat3 ACESOutputMat = mat3( - vec3( 1.60475, -0.10208, -0.00327 ), vec3( -0.53108, 1.10813, -0.07276 ), - vec3( -0.07367, -0.00605, 1.07602 ) - ); - color *= toneMappingExposure / 0.6; - color = ACESInputMat * color; - color = RRTAndODTFit( color ); - color = ACESOutputMat * color; - return saturate( color ); -} -vec3 CustomToneMapping( vec3 color ) { return color; }`,jV=`#ifdef USE_TRANSMISSION - material.transmission = transmission; - material.transmissionAlpha = 1.0; - material.thickness = thickness; - material.attenuationDistance = attenuationDistance; - material.attenuationColor = attenuationColor; - #ifdef USE_TRANSMISSIONMAP - material.transmission *= texture2D( transmissionMap, vUv ).r; - #endif - #ifdef USE_THICKNESSMAP - material.thickness *= texture2D( thicknessMap, vUv ).g; - #endif - vec3 pos = vWorldPosition; - vec3 v = normalize( cameraPosition - pos ); - vec3 n = inverseTransformDirection( normal, viewMatrix ); - vec4 transmission = getIBLVolumeRefraction( - n, v, material.roughness, material.diffuseColor, material.specularColor, material.specularF90, - pos, modelMatrix, viewMatrix, projectionMatrix, material.ior, material.thickness, - material.attenuationColor, material.attenuationDistance ); - material.transmissionAlpha = mix( material.transmissionAlpha, transmission.a, material.transmission ); - totalDiffuse = mix( totalDiffuse, transmission.rgb, material.transmission ); -#endif`,XV=`#ifdef USE_TRANSMISSION - uniform float transmission; - uniform float thickness; - uniform float attenuationDistance; - uniform vec3 attenuationColor; - #ifdef USE_TRANSMISSIONMAP - uniform sampler2D transmissionMap; - #endif - #ifdef USE_THICKNESSMAP - uniform sampler2D thicknessMap; - #endif - uniform vec2 transmissionSamplerSize; - uniform sampler2D transmissionSamplerMap; - uniform mat4 modelMatrix; - uniform mat4 projectionMatrix; - varying vec3 vWorldPosition; - float w0( float a ) { - return ( 1.0 / 6.0 ) * ( a * ( a * ( - a + 3.0 ) - 3.0 ) + 1.0 ); - } - float w1( float a ) { - return ( 1.0 / 6.0 ) * ( a * a * ( 3.0 * a - 6.0 ) + 4.0 ); - } - float w2( float a ){ - return ( 1.0 / 6.0 ) * ( a * ( a * ( - 3.0 * a + 3.0 ) + 3.0 ) + 1.0 ); - } - float w3( float a ) { - return ( 1.0 / 6.0 ) * ( a * a * a ); - } - float g0( float a ) { - return w0( a ) + w1( a ); - } - float g1( float a ) { - return w2( a ) + w3( a ); - } - float h0( float a ) { - return - 1.0 + w1( a ) / ( w0( a ) + w1( a ) ); - } - float h1( float a ) { - return 1.0 + w3( a ) / ( w2( a ) + w3( a ) ); - } - vec4 bicubic( sampler2D tex, vec2 uv, vec4 texelSize, vec2 fullSize, float lod ) { - uv = uv * texelSize.zw + 0.5; - vec2 iuv = floor( uv ); - vec2 fuv = fract( uv ); - float g0x = g0( fuv.x ); - float g1x = g1( fuv.x ); - float h0x = h0( fuv.x ); - float h1x = h1( fuv.x ); - float h0y = h0( fuv.y ); - float h1y = h1( fuv.y ); - vec2 p0 = ( vec2( iuv.x + h0x, iuv.y + h0y ) - 0.5 ) * texelSize.xy; - vec2 p1 = ( vec2( iuv.x + h1x, iuv.y + h0y ) - 0.5 ) * texelSize.xy; - vec2 p2 = ( vec2( iuv.x + h0x, iuv.y + h1y ) - 0.5 ) * texelSize.xy; - vec2 p3 = ( vec2( iuv.x + h1x, iuv.y + h1y ) - 0.5 ) * texelSize.xy; - - vec2 lodFudge = pow( 1.95, lod ) / fullSize; - return g0( fuv.y ) * ( g0x * textureLod( tex, p0, lod ) + g1x * textureLod( tex, p1, lod ) ) + - g1( fuv.y ) * ( g0x * textureLod( tex, p2, lod ) + g1x * textureLod( tex, p3, lod ) ); - } - vec4 textureBicubic( sampler2D sampler, vec2 uv, float lod ) { - vec2 fLodSize = vec2( textureSize( sampler, int( lod ) ) ); - vec2 cLodSize = vec2( textureSize( sampler, int( lod + 1.0 ) ) ); - vec2 fLodSizeInv = 1.0 / fLodSize; - vec2 cLodSizeInv = 1.0 / cLodSize; - vec2 fullSize = vec2( textureSize( sampler, 0 ) ); - vec4 fSample = bicubic( sampler, uv, vec4( fLodSizeInv, fLodSize ), fullSize, floor( lod ) ); - vec4 cSample = bicubic( sampler, uv, vec4( cLodSizeInv, cLodSize ), fullSize, ceil( lod ) ); - return mix( fSample, cSample, fract( lod ) ); - } - vec3 getVolumeTransmissionRay( const in vec3 n, const in vec3 v, const in float thickness, const in float ior, const in mat4 modelMatrix ) { - vec3 refractionVector = refract( - v, normalize( n ), 1.0 / ior ); - vec3 modelScale; - modelScale.x = length( vec3( modelMatrix[ 0 ].xyz ) ); - modelScale.y = length( vec3( modelMatrix[ 1 ].xyz ) ); - modelScale.z = length( vec3( modelMatrix[ 2 ].xyz ) ); - return normalize( refractionVector ) * thickness * modelScale; - } - float applyIorToRoughness( const in float roughness, const in float ior ) { - return roughness * clamp( ior * 2.0 - 2.0, 0.0, 1.0 ); - } - vec4 getTransmissionSample( const in vec2 fragCoord, const in float roughness, const in float ior ) { - float lod = log2( transmissionSamplerSize.x ) * applyIorToRoughness( roughness, ior ); - return textureBicubic( transmissionSamplerMap, fragCoord.xy, lod ); - } - vec3 applyVolumeAttenuation( const in vec3 radiance, const in float transmissionDistance, const in vec3 attenuationColor, const in float attenuationDistance ) { - if ( isinf( attenuationDistance ) ) { - return radiance; - } else { - vec3 attenuationCoefficient = -log( attenuationColor ) / attenuationDistance; - vec3 transmittance = exp( - attenuationCoefficient * transmissionDistance ); return transmittance * radiance; - } - } - vec4 getIBLVolumeRefraction( const in vec3 n, const in vec3 v, const in float roughness, const in vec3 diffuseColor, - const in vec3 specularColor, const in float specularF90, const in vec3 position, const in mat4 modelMatrix, - const in mat4 viewMatrix, const in mat4 projMatrix, const in float ior, const in float thickness, - const in vec3 attenuationColor, const in float attenuationDistance ) { - vec3 transmissionRay = getVolumeTransmissionRay( n, v, thickness, ior, modelMatrix ); - vec3 refractedRayExit = position + transmissionRay; - vec4 ndcPos = projMatrix * viewMatrix * vec4( refractedRayExit, 1.0 ); - vec2 refractionCoords = ndcPos.xy / ndcPos.w; - refractionCoords += 1.0; - refractionCoords /= 2.0; - vec4 transmittedLight = getTransmissionSample( refractionCoords, roughness, ior ); - vec3 attenuatedColor = applyVolumeAttenuation( transmittedLight.rgb, length( transmissionRay ), attenuationColor, attenuationDistance ); - vec3 F = EnvironmentBRDF( n, v, specularColor, specularF90, roughness ); - return vec4( ( 1.0 - F ) * attenuatedColor * diffuseColor, transmittedLight.a ); - } -#endif`,YV=`#if ( defined( USE_UV ) && ! defined( UVS_VERTEX_ONLY ) ) - varying vec2 vUv; -#endif`,KV=`#ifdef USE_UV - #ifdef UVS_VERTEX_ONLY - vec2 vUv; - #else - varying vec2 vUv; - #endif - uniform mat3 uvTransform; -#endif`,ZV=`#ifdef USE_UV - vUv = ( uvTransform * vec3( uv, 1 ) ).xy; -#endif`,QV=`#if defined( USE_LIGHTMAP ) || defined( USE_AOMAP ) - varying vec2 vUv2; -#endif`,qV=`#if defined( USE_LIGHTMAP ) || defined( USE_AOMAP ) - attribute vec2 uv2; - varying vec2 vUv2; - uniform mat3 uv2Transform; -#endif`,$V=`#if defined( USE_LIGHTMAP ) || defined( USE_AOMAP ) - vUv2 = ( uv2Transform * vec3( uv2, 1 ) ).xy; -#endif`,eW=`#if defined( USE_ENVMAP ) || defined( DISTANCE ) || defined ( USE_SHADOWMAP ) || defined ( USE_TRANSMISSION ) || NUM_SPOT_LIGHT_COORDS > 0 - vec4 worldPosition = vec4( transformed, 1.0 ); - #ifdef USE_INSTANCING - worldPosition = instanceMatrix * worldPosition; - #endif - worldPosition = modelMatrix * worldPosition; -#endif`;const tW=`varying vec2 vUv; -uniform mat3 uvTransform; -void main() { - vUv = ( uvTransform * vec3( uv, 1 ) ).xy; - gl_Position = vec4( position.xy, 1.0, 1.0 ); -}`,nW=`uniform sampler2D t2D; -uniform float backgroundIntensity; -varying vec2 vUv; -void main() { - vec4 texColor = texture2D( t2D, vUv ); - #ifdef DECODE_VIDEO_TEXTURE - texColor = vec4( mix( pow( texColor.rgb * 0.9478672986 + vec3( 0.0521327014 ), vec3( 2.4 ) ), texColor.rgb * 0.0773993808, vec3( lessThanEqual( texColor.rgb, vec3( 0.04045 ) ) ) ), texColor.w ); - #endif - texColor.rgb *= backgroundIntensity; - gl_FragColor = texColor; - #include - #include -}`,rW=`varying vec3 vWorldDirection; -#include -void main() { - vWorldDirection = transformDirection( position, modelMatrix ); - #include - #include - gl_Position.z = gl_Position.w; -}`,iW=`#ifdef ENVMAP_TYPE_CUBE - uniform samplerCube envMap; -#elif defined( ENVMAP_TYPE_CUBE_UV ) - uniform sampler2D envMap; -#endif -uniform float flipEnvMap; -uniform float backgroundBlurriness; -uniform float backgroundIntensity; -varying vec3 vWorldDirection; -#include -void main() { - #ifdef ENVMAP_TYPE_CUBE - vec4 texColor = textureCube( envMap, vec3( flipEnvMap * vWorldDirection.x, vWorldDirection.yz ) ); - #elif defined( ENVMAP_TYPE_CUBE_UV ) - vec4 texColor = textureCubeUV( envMap, vWorldDirection, backgroundBlurriness ); - #else - vec4 texColor = vec4( 0.0, 0.0, 0.0, 1.0 ); - #endif - texColor.rgb *= backgroundIntensity; - gl_FragColor = texColor; - #include - #include -}`,sW=`varying vec3 vWorldDirection; -#include -void main() { - vWorldDirection = transformDirection( position, modelMatrix ); - #include - #include - gl_Position.z = gl_Position.w; -}`,oW=`uniform samplerCube tCube; -uniform float tFlip; -uniform float opacity; -varying vec3 vWorldDirection; -void main() { - vec4 texColor = textureCube( tCube, vec3( tFlip * vWorldDirection.x, vWorldDirection.yz ) ); - gl_FragColor = texColor; - gl_FragColor.a *= opacity; - #include - #include -}`,aW=`#include -#include -#include -#include -#include -#include -#include -varying vec2 vHighPrecisionZW; -void main() { - #include - #include - #ifdef USE_DISPLACEMENTMAP - #include - #include - #include - #endif - #include - #include - #include - #include - #include - #include - #include - vHighPrecisionZW = gl_Position.zw; -}`,lW=`#if DEPTH_PACKING == 3200 - uniform float opacity; -#endif -#include -#include -#include -#include -#include -#include -#include -#include -varying vec2 vHighPrecisionZW; -void main() { - #include - vec4 diffuseColor = vec4( 1.0 ); - #if DEPTH_PACKING == 3200 - diffuseColor.a = opacity; - #endif - #include - #include - #include - #include - float fragCoordZ = 0.5 * vHighPrecisionZW[0] / vHighPrecisionZW[1] + 0.5; - #if DEPTH_PACKING == 3200 - gl_FragColor = vec4( vec3( 1.0 - fragCoordZ ), opacity ); - #elif DEPTH_PACKING == 3201 - gl_FragColor = packDepthToRGBA( fragCoordZ ); - #endif -}`,uW=`#define DISTANCE -varying vec3 vWorldPosition; -#include -#include -#include -#include -#include -#include -void main() { - #include - #include - #ifdef USE_DISPLACEMENTMAP - #include - #include - #include - #endif - #include - #include - #include - #include - #include - #include - #include - vWorldPosition = worldPosition.xyz; -}`,cW=`#define DISTANCE -uniform vec3 referencePosition; -uniform float nearDistance; -uniform float farDistance; -varying vec3 vWorldPosition; -#include -#include -#include -#include -#include -#include -#include -void main () { - #include - vec4 diffuseColor = vec4( 1.0 ); - #include - #include - #include - float dist = length( vWorldPosition - referencePosition ); - dist = ( dist - nearDistance ) / ( farDistance - nearDistance ); - dist = saturate( dist ); - gl_FragColor = packDepthToRGBA( dist ); -}`,fW=`varying vec3 vWorldDirection; -#include -void main() { - vWorldDirection = transformDirection( position, modelMatrix ); - #include - #include -}`,hW=`uniform sampler2D tEquirect; -varying vec3 vWorldDirection; -#include -void main() { - vec3 direction = normalize( vWorldDirection ); - vec2 sampleUV = equirectUv( direction ); - gl_FragColor = texture2D( tEquirect, sampleUV ); - #include - #include -}`,dW=`uniform float scale; -attribute float lineDistance; -varying float vLineDistance; -#include -#include -#include -#include -#include -#include -void main() { - vLineDistance = scale * lineDistance; - #include - #include - #include - #include - #include - #include - #include - #include -}`,pW=`uniform vec3 diffuse; -uniform float opacity; -uniform float dashSize; -uniform float totalSize; -varying float vLineDistance; -#include -#include -#include -#include -#include -void main() { - #include - if ( mod( vLineDistance, totalSize ) > dashSize ) { - discard; - } - vec3 outgoingLight = vec3( 0.0 ); - vec4 diffuseColor = vec4( diffuse, opacity ); - #include - #include - outgoingLight = diffuseColor.rgb; - #include - #include - #include - #include - #include -}`,mW=`#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -void main() { - #include - #include - #include - #include - #if defined ( USE_ENVMAP ) || defined ( USE_SKINNING ) - #include - #include - #include - #include - #include - #endif - #include - #include - #include - #include - #include - #include - #include - #include - #include -}`,gW=`uniform vec3 diffuse; -uniform float opacity; -#ifndef FLAT_SHADED - varying vec3 vNormal; -#endif -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -void main() { - #include - vec4 diffuseColor = vec4( diffuse, opacity ); - #include - #include - #include - #include - #include - #include - ReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) ); - #ifdef USE_LIGHTMAP - vec4 lightMapTexel = texture2D( lightMap, vUv2 ); - reflectedLight.indirectDiffuse += lightMapTexel.rgb * lightMapIntensity * RECIPROCAL_PI; - #else - reflectedLight.indirectDiffuse += vec3( 1.0 ); - #endif - #include - reflectedLight.indirectDiffuse *= diffuseColor.rgb; - vec3 outgoingLight = reflectedLight.indirectDiffuse; - #include - #include - #include - #include - #include - #include - #include -}`,vW=`#define LAMBERT -varying vec3 vViewPosition; -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -void main() { - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - vViewPosition = - mvPosition.xyz; - #include - #include - #include - #include -}`,yW=`#define LAMBERT -uniform vec3 diffuse; -uniform vec3 emissive; -uniform float opacity; -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -void main() { - #include - vec4 diffuseColor = vec4( diffuse, opacity ); - ReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) ); - vec3 totalEmissiveRadiance = emissive; - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - vec3 outgoingLight = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse + totalEmissiveRadiance; - #include - #include - #include - #include - #include - #include - #include -}`,xW=`#define MATCAP -varying vec3 vViewPosition; -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -void main() { - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - vViewPosition = - mvPosition.xyz; -}`,_W=`#define MATCAP -uniform vec3 diffuse; -uniform float opacity; -uniform sampler2D matcap; -varying vec3 vViewPosition; -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -void main() { - #include - vec4 diffuseColor = vec4( diffuse, opacity ); - #include - #include - #include - #include - #include - #include - #include - vec3 viewDir = normalize( vViewPosition ); - vec3 x = normalize( vec3( viewDir.z, 0.0, - viewDir.x ) ); - vec3 y = cross( viewDir, x ); - vec2 uv = vec2( dot( x, normal ), dot( y, normal ) ) * 0.495 + 0.5; - #ifdef USE_MATCAP - vec4 matcapColor = texture2D( matcap, uv ); - #else - vec4 matcapColor = vec4( vec3( mix( 0.2, 0.8, uv.y ) ), 1.0 ); - #endif - vec3 outgoingLight = diffuseColor.rgb * matcapColor.rgb; - #include - #include - #include - #include - #include - #include -}`,wW=`#define NORMAL -#if defined( FLAT_SHADED ) || defined( USE_BUMPMAP ) || defined( TANGENTSPACE_NORMALMAP ) - varying vec3 vViewPosition; -#endif -#include -#include -#include -#include -#include -#include -#include -#include -void main() { - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include -#if defined( FLAT_SHADED ) || defined( USE_BUMPMAP ) || defined( TANGENTSPACE_NORMALMAP ) - vViewPosition = - mvPosition.xyz; -#endif -}`,SW=`#define NORMAL -uniform float opacity; -#if defined( FLAT_SHADED ) || defined( USE_BUMPMAP ) || defined( TANGENTSPACE_NORMALMAP ) - varying vec3 vViewPosition; -#endif -#include -#include -#include -#include -#include -#include -#include -void main() { - #include - #include - #include - #include - gl_FragColor = vec4( packNormalToRGB( normal ), opacity ); - #ifdef OPAQUE - gl_FragColor.a = 1.0; - #endif -}`,AW=`#define PHONG -varying vec3 vViewPosition; -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -void main() { - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - vViewPosition = - mvPosition.xyz; - #include - #include - #include - #include -}`,MW=`#define PHONG -uniform vec3 diffuse; -uniform vec3 emissive; -uniform vec3 specular; -uniform float shininess; -uniform float opacity; -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -void main() { - #include - vec4 diffuseColor = vec4( diffuse, opacity ); - ReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) ); - vec3 totalEmissiveRadiance = emissive; - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - vec3 outgoingLight = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse + reflectedLight.directSpecular + reflectedLight.indirectSpecular + totalEmissiveRadiance; - #include - #include - #include - #include - #include - #include - #include -}`,EW=`#define STANDARD -varying vec3 vViewPosition; -#ifdef USE_TRANSMISSION - varying vec3 vWorldPosition; -#endif -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -void main() { - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - vViewPosition = - mvPosition.xyz; - #include - #include - #include -#ifdef USE_TRANSMISSION - vWorldPosition = worldPosition.xyz; -#endif -}`,CW=`#define STANDARD -#ifdef PHYSICAL - #define IOR - #define SPECULAR -#endif -uniform vec3 diffuse; -uniform vec3 emissive; -uniform float roughness; -uniform float metalness; -uniform float opacity; -#ifdef IOR - uniform float ior; -#endif -#ifdef SPECULAR - uniform float specularIntensity; - uniform vec3 specularColor; - #ifdef USE_SPECULARINTENSITYMAP - uniform sampler2D specularIntensityMap; - #endif - #ifdef USE_SPECULARCOLORMAP - uniform sampler2D specularColorMap; - #endif -#endif -#ifdef USE_CLEARCOAT - uniform float clearcoat; - uniform float clearcoatRoughness; -#endif -#ifdef USE_IRIDESCENCE - uniform float iridescence; - uniform float iridescenceIOR; - uniform float iridescenceThicknessMinimum; - uniform float iridescenceThicknessMaximum; -#endif -#ifdef USE_SHEEN - uniform vec3 sheenColor; - uniform float sheenRoughness; - #ifdef USE_SHEENCOLORMAP - uniform sampler2D sheenColorMap; - #endif - #ifdef USE_SHEENROUGHNESSMAP - uniform sampler2D sheenRoughnessMap; - #endif -#endif -varying vec3 vViewPosition; -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -void main() { - #include - vec4 diffuseColor = vec4( diffuse, opacity ); - ReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) ); - vec3 totalEmissiveRadiance = emissive; - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - vec3 totalDiffuse = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse; - vec3 totalSpecular = reflectedLight.directSpecular + reflectedLight.indirectSpecular; - #include - vec3 outgoingLight = totalDiffuse + totalSpecular + totalEmissiveRadiance; - #ifdef USE_SHEEN - float sheenEnergyComp = 1.0 - 0.157 * max3( material.sheenColor ); - outgoingLight = outgoingLight * sheenEnergyComp + sheenSpecular; - #endif - #ifdef USE_CLEARCOAT - float dotNVcc = saturate( dot( geometry.clearcoatNormal, geometry.viewDir ) ); - vec3 Fcc = F_Schlick( material.clearcoatF0, material.clearcoatF90, dotNVcc ); - outgoingLight = outgoingLight * ( 1.0 - material.clearcoat * Fcc ) + clearcoatSpecular * material.clearcoat; - #endif - #include - #include - #include - #include - #include - #include -}`,bW=`#define TOON -varying vec3 vViewPosition; -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -void main() { - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - vViewPosition = - mvPosition.xyz; - #include - #include - #include -}`,TW=`#define TOON -uniform vec3 diffuse; -uniform vec3 emissive; -uniform float opacity; -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -void main() { - #include - vec4 diffuseColor = vec4( diffuse, opacity ); - ReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) ); - vec3 totalEmissiveRadiance = emissive; - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - vec3 outgoingLight = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse + totalEmissiveRadiance; - #include - #include - #include - #include - #include - #include -}`,RW=`uniform float size; -uniform float scale; -#include -#include -#include -#include -#include -#include -void main() { - #include - #include - #include - #include - #include - gl_PointSize = size; - #ifdef USE_SIZEATTENUATION - bool isPerspective = isPerspectiveMatrix( projectionMatrix ); - if ( isPerspective ) gl_PointSize *= ( scale / - mvPosition.z ); - #endif - #include - #include - #include - #include -}`,BW=`uniform vec3 diffuse; -uniform float opacity; -#include -#include -#include -#include -#include -#include -#include -void main() { - #include - vec3 outgoingLight = vec3( 0.0 ); - vec4 diffuseColor = vec4( diffuse, opacity ); - #include - #include - #include - #include - outgoingLight = diffuseColor.rgb; - #include - #include - #include - #include - #include -}`,PW=`#include -#include -#include -#include -#include -#include -void main() { - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include -}`,IW=`uniform vec3 color; -uniform float opacity; -#include -#include -#include -#include -#include -#include -#include -#include -void main() { - #include - gl_FragColor = vec4( color, opacity * ( 1.0 - getShadowMask() ) ); - #include - #include - #include -}`,LW=`uniform float rotation; -uniform vec2 center; -#include -#include -#include -#include -#include -void main() { - #include - vec4 mvPosition = modelViewMatrix * vec4( 0.0, 0.0, 0.0, 1.0 ); - vec2 scale; - scale.x = length( vec3( modelMatrix[ 0 ].x, modelMatrix[ 0 ].y, modelMatrix[ 0 ].z ) ); - scale.y = length( vec3( modelMatrix[ 1 ].x, modelMatrix[ 1 ].y, modelMatrix[ 1 ].z ) ); - #ifndef USE_SIZEATTENUATION - bool isPerspective = isPerspectiveMatrix( projectionMatrix ); - if ( isPerspective ) scale *= - mvPosition.z; - #endif - vec2 alignedPosition = ( position.xy - ( center - vec2( 0.5 ) ) ) * scale; - vec2 rotatedPosition; - rotatedPosition.x = cos( rotation ) * alignedPosition.x - sin( rotation ) * alignedPosition.y; - rotatedPosition.y = sin( rotation ) * alignedPosition.x + cos( rotation ) * alignedPosition.y; - mvPosition.xy += rotatedPosition; - gl_Position = projectionMatrix * mvPosition; - #include - #include - #include -}`,DW=`uniform vec3 diffuse; -uniform float opacity; -#include -#include -#include -#include -#include -#include -#include -#include -void main() { - #include - vec3 outgoingLight = vec3( 0.0 ); - vec4 diffuseColor = vec4( diffuse, opacity ); - #include - #include - #include - #include - outgoingLight = diffuseColor.rgb; - #include - #include - #include - #include -}`,zt={alphamap_fragment:rH,alphamap_pars_fragment:iH,alphatest_fragment:sH,alphatest_pars_fragment:oH,aomap_fragment:aH,aomap_pars_fragment:lH,begin_vertex:uH,beginnormal_vertex:cH,bsdfs:fH,iridescence_fragment:hH,bumpmap_pars_fragment:dH,clipping_planes_fragment:pH,clipping_planes_pars_fragment:mH,clipping_planes_pars_vertex:gH,clipping_planes_vertex:vH,color_fragment:yH,color_pars_fragment:xH,color_pars_vertex:_H,color_vertex:wH,common:SH,cube_uv_reflection_fragment:AH,defaultnormal_vertex:MH,displacementmap_pars_vertex:EH,displacementmap_vertex:CH,emissivemap_fragment:bH,emissivemap_pars_fragment:TH,encodings_fragment:RH,encodings_pars_fragment:BH,envmap_fragment:PH,envmap_common_pars_fragment:IH,envmap_pars_fragment:LH,envmap_pars_vertex:DH,envmap_physical_pars_fragment:jH,envmap_vertex:kH,fog_vertex:FH,fog_pars_vertex:NH,fog_fragment:OH,fog_pars_fragment:UH,gradientmap_pars_fragment:zH,lightmap_fragment:GH,lightmap_pars_fragment:HH,lights_lambert_fragment:VH,lights_lambert_pars_fragment:WH,lights_pars_begin:JH,lights_toon_fragment:XH,lights_toon_pars_fragment:YH,lights_phong_fragment:KH,lights_phong_pars_fragment:ZH,lights_physical_fragment:QH,lights_physical_pars_fragment:qH,lights_fragment_begin:$H,lights_fragment_maps:eV,lights_fragment_end:tV,logdepthbuf_fragment:nV,logdepthbuf_pars_fragment:rV,logdepthbuf_pars_vertex:iV,logdepthbuf_vertex:sV,map_fragment:oV,map_pars_fragment:aV,map_particle_fragment:lV,map_particle_pars_fragment:uV,metalnessmap_fragment:cV,metalnessmap_pars_fragment:fV,morphcolor_vertex:hV,morphnormal_vertex:dV,morphtarget_pars_vertex:pV,morphtarget_vertex:mV,normal_fragment_begin:gV,normal_fragment_maps:vV,normal_pars_fragment:yV,normal_pars_vertex:xV,normal_vertex:_V,normalmap_pars_fragment:wV,clearcoat_normal_fragment_begin:SV,clearcoat_normal_fragment_maps:AV,clearcoat_pars_fragment:MV,iridescence_pars_fragment:EV,output_fragment:CV,packing:bV,premultiplied_alpha_fragment:TV,project_vertex:RV,dithering_fragment:BV,dithering_pars_fragment:PV,roughnessmap_fragment:IV,roughnessmap_pars_fragment:LV,shadowmap_pars_fragment:DV,shadowmap_pars_vertex:kV,shadowmap_vertex:FV,shadowmask_pars_fragment:NV,skinbase_vertex:OV,skinning_pars_vertex:UV,skinning_vertex:zV,skinnormal_vertex:GV,specularmap_fragment:HV,specularmap_pars_fragment:VV,tonemapping_fragment:WV,tonemapping_pars_fragment:JV,transmission_fragment:jV,transmission_pars_fragment:XV,uv_pars_fragment:YV,uv_pars_vertex:KV,uv_vertex:ZV,uv2_pars_fragment:QV,uv2_pars_vertex:qV,uv2_vertex:$V,worldpos_vertex:eW,background_vert:tW,background_frag:nW,backgroundCube_vert:rW,backgroundCube_frag:iW,cube_vert:sW,cube_frag:oW,depth_vert:aW,depth_frag:lW,distanceRGBA_vert:uW,distanceRGBA_frag:cW,equirect_vert:fW,equirect_frag:hW,linedashed_vert:dW,linedashed_frag:pW,meshbasic_vert:mW,meshbasic_frag:gW,meshlambert_vert:vW,meshlambert_frag:yW,meshmatcap_vert:xW,meshmatcap_frag:_W,meshnormal_vert:wW,meshnormal_frag:SW,meshphong_vert:AW,meshphong_frag:MW,meshphysical_vert:EW,meshphysical_frag:CW,meshtoon_vert:bW,meshtoon_frag:TW,points_vert:RW,points_frag:BW,shadow_vert:PW,shadow_frag:IW,sprite_vert:LW,sprite_frag:DW},at={common:{diffuse:{value:new st(16777215)},opacity:{value:1},map:{value:null},uvTransform:{value:new Rr},uv2Transform:{value:new Rr},alphaMap:{value:null},alphaTest:{value:0}},specularmap:{specularMap:{value:null}},envmap:{envMap:{value:null},flipEnvMap:{value:-1},reflectivity:{value:1},ior:{value:1.5},refractionRatio:{value:.98}},aomap:{aoMap:{value:null},aoMapIntensity:{value:1}},lightmap:{lightMap:{value:null},lightMapIntensity:{value:1}},emissivemap:{emissiveMap:{value:null}},bumpmap:{bumpMap:{value:null},bumpScale:{value:1}},normalmap:{normalMap:{value:null},normalScale:{value:new ze(1,1)}},displacementmap:{displacementMap:{value:null},displacementScale:{value:1},displacementBias:{value:0}},roughnessmap:{roughnessMap:{value:null}},metalnessmap:{metalnessMap:{value:null}},gradientmap:{gradientMap:{value:null}},fog:{fogDensity:{value:25e-5},fogNear:{value:1},fogFar:{value:2e3},fogColor:{value:new st(16777215)}},lights:{ambientLightColor:{value:[]},lightProbe:{value:[]},directionalLights:{value:[],properties:{direction:{},color:{}}},directionalLightShadows:{value:[],properties:{shadowBias:{},shadowNormalBias:{},shadowRadius:{},shadowMapSize:{}}},directionalShadowMap:{value:[]},directionalShadowMatrix:{value:[]},spotLights:{value:[],properties:{color:{},position:{},direction:{},distance:{},coneCos:{},penumbraCos:{},decay:{}}},spotLightShadows:{value:[],properties:{shadowBias:{},shadowNormalBias:{},shadowRadius:{},shadowMapSize:{}}},spotLightMap:{value:[]},spotShadowMap:{value:[]},spotLightMatrix:{value:[]},pointLights:{value:[],properties:{color:{},position:{},decay:{},distance:{}}},pointLightShadows:{value:[],properties:{shadowBias:{},shadowNormalBias:{},shadowRadius:{},shadowMapSize:{},shadowCameraNear:{},shadowCameraFar:{}}},pointShadowMap:{value:[]},pointShadowMatrix:{value:[]},hemisphereLights:{value:[],properties:{direction:{},skyColor:{},groundColor:{}}},rectAreaLights:{value:[],properties:{color:{},position:{},width:{},height:{}}},ltc_1:{value:null},ltc_2:{value:null}},points:{diffuse:{value:new st(16777215)},opacity:{value:1},size:{value:1},scale:{value:1},map:{value:null},alphaMap:{value:null},alphaTest:{value:0},uvTransform:{value:new Rr}},sprite:{diffuse:{value:new st(16777215)},opacity:{value:1},center:{value:new ze(.5,.5)},rotation:{value:0},map:{value:null},alphaMap:{value:null},alphaTest:{value:0},uvTransform:{value:new Rr}}},zs={basic:{uniforms:ci([at.common,at.specularmap,at.envmap,at.aomap,at.lightmap,at.fog]),vertexShader:zt.meshbasic_vert,fragmentShader:zt.meshbasic_frag},lambert:{uniforms:ci([at.common,at.specularmap,at.envmap,at.aomap,at.lightmap,at.emissivemap,at.bumpmap,at.normalmap,at.displacementmap,at.fog,at.lights,{emissive:{value:new st(0)}}]),vertexShader:zt.meshlambert_vert,fragmentShader:zt.meshlambert_frag},phong:{uniforms:ci([at.common,at.specularmap,at.envmap,at.aomap,at.lightmap,at.emissivemap,at.bumpmap,at.normalmap,at.displacementmap,at.fog,at.lights,{emissive:{value:new st(0)},specular:{value:new st(1118481)},shininess:{value:30}}]),vertexShader:zt.meshphong_vert,fragmentShader:zt.meshphong_frag},standard:{uniforms:ci([at.common,at.envmap,at.aomap,at.lightmap,at.emissivemap,at.bumpmap,at.normalmap,at.displacementmap,at.roughnessmap,at.metalnessmap,at.fog,at.lights,{emissive:{value:new st(0)},roughness:{value:1},metalness:{value:0},envMapIntensity:{value:1}}]),vertexShader:zt.meshphysical_vert,fragmentShader:zt.meshphysical_frag},toon:{uniforms:ci([at.common,at.aomap,at.lightmap,at.emissivemap,at.bumpmap,at.normalmap,at.displacementmap,at.gradientmap,at.fog,at.lights,{emissive:{value:new st(0)}}]),vertexShader:zt.meshtoon_vert,fragmentShader:zt.meshtoon_frag},matcap:{uniforms:ci([at.common,at.bumpmap,at.normalmap,at.displacementmap,at.fog,{matcap:{value:null}}]),vertexShader:zt.meshmatcap_vert,fragmentShader:zt.meshmatcap_frag},points:{uniforms:ci([at.points,at.fog]),vertexShader:zt.points_vert,fragmentShader:zt.points_frag},dashed:{uniforms:ci([at.common,at.fog,{scale:{value:1},dashSize:{value:1},totalSize:{value:2}}]),vertexShader:zt.linedashed_vert,fragmentShader:zt.linedashed_frag},depth:{uniforms:ci([at.common,at.displacementmap]),vertexShader:zt.depth_vert,fragmentShader:zt.depth_frag},normal:{uniforms:ci([at.common,at.bumpmap,at.normalmap,at.displacementmap,{opacity:{value:1}}]),vertexShader:zt.meshnormal_vert,fragmentShader:zt.meshnormal_frag},sprite:{uniforms:ci([at.sprite,at.fog]),vertexShader:zt.sprite_vert,fragmentShader:zt.sprite_frag},background:{uniforms:{uvTransform:{value:new Rr},t2D:{value:null},backgroundIntensity:{value:1}},vertexShader:zt.background_vert,fragmentShader:zt.background_frag},backgroundCube:{uniforms:{envMap:{value:null},flipEnvMap:{value:-1},backgroundBlurriness:{value:0},backgroundIntensity:{value:1}},vertexShader:zt.backgroundCube_vert,fragmentShader:zt.backgroundCube_frag},cube:{uniforms:{tCube:{value:null},tFlip:{value:-1},opacity:{value:1}},vertexShader:zt.cube_vert,fragmentShader:zt.cube_frag},equirect:{uniforms:{tEquirect:{value:null}},vertexShader:zt.equirect_vert,fragmentShader:zt.equirect_frag},distanceRGBA:{uniforms:ci([at.common,at.displacementmap,{referencePosition:{value:new Z},nearDistance:{value:1},farDistance:{value:1e3}}]),vertexShader:zt.distanceRGBA_vert,fragmentShader:zt.distanceRGBA_frag},shadow:{uniforms:ci([at.lights,at.fog,{color:{value:new st(0)},opacity:{value:1}}]),vertexShader:zt.shadow_vert,fragmentShader:zt.shadow_frag}};zs.physical={uniforms:ci([zs.standard.uniforms,{clearcoat:{value:0},clearcoatMap:{value:null},clearcoatRoughness:{value:0},clearcoatRoughnessMap:{value:null},clearcoatNormalScale:{value:new ze(1,1)},clearcoatNormalMap:{value:null},iridescence:{value:0},iridescenceMap:{value:null},iridescenceIOR:{value:1.3},iridescenceThicknessMinimum:{value:100},iridescenceThicknessMaximum:{value:400},iridescenceThicknessMap:{value:null},sheen:{value:0},sheenColor:{value:new st(0)},sheenColorMap:{value:null},sheenRoughness:{value:1},sheenRoughnessMap:{value:null},transmission:{value:0},transmissionMap:{value:null},transmissionSamplerSize:{value:new ze},transmissionSamplerMap:{value:null},thickness:{value:0},thicknessMap:{value:null},attenuationDistance:{value:0},attenuationColor:{value:new st(0)},specularIntensity:{value:1},specularIntensityMap:{value:null},specularColor:{value:new st(1,1,1)},specularColorMap:{value:null}}]),vertexShader:zt.meshphysical_vert,fragmentShader:zt.meshphysical_frag};const Sg={r:0,b:0,g:0};function kW(n,e,t,r,i,s,o){const a=new st(0);let l=s===!0?0:1,u,c,f=null,p=0,m=null;function g(y,w){let _=!1,x=w.isScene===!0?w.background:null;x&&x.isTexture&&(x=(w.backgroundBlurriness>0?t:e).get(x));const A=n.xr,C=A.getSession&&A.getSession();C&&C.environmentBlendMode==="additive"&&(x=null),x===null?v(a,l):x&&x.isColor&&(v(x,1),_=!0),(n.autoClear||_)&&n.clear(n.autoClearColor,n.autoClearDepth,n.autoClearStencil),x&&(x.isCubeTexture||x.mapping===Bf)?(c===void 0&&(c=new Vn(new _l(1,1,1),new Oi({name:"BackgroundCubeMaterial",uniforms:_f(zs.backgroundCube.uniforms),vertexShader:zs.backgroundCube.vertexShader,fragmentShader:zs.backgroundCube.fragmentShader,side:vi,depthTest:!1,depthWrite:!1,fog:!1})),c.geometry.deleteAttribute("normal"),c.geometry.deleteAttribute("uv"),c.onBeforeRender=function(b,R,E){this.matrixWorld.copyPosition(E.matrixWorld)},Object.defineProperty(c.material,"envMap",{get:function(){return this.uniforms.envMap.value}}),i.update(c)),c.material.uniforms.envMap.value=x,c.material.uniforms.flipEnvMap.value=x.isCubeTexture&&x.isRenderTargetTexture===!1?-1:1,c.material.uniforms.backgroundBlurriness.value=w.backgroundBlurriness,c.material.uniforms.backgroundIntensity.value=w.backgroundIntensity,c.material.toneMapped=x.encoding!==wn,(f!==x||p!==x.version||m!==n.toneMapping)&&(c.material.needsUpdate=!0,f=x,p=x.version,m=n.toneMapping),c.layers.enableAll(),y.unshift(c,c.geometry,c.material,0,0,null)):x&&x.isTexture&&(u===void 0&&(u=new Vn(new Ro(2,2),new Oi({name:"BackgroundMaterial",uniforms:_f(zs.background.uniforms),vertexShader:zs.background.vertexShader,fragmentShader:zs.background.fragmentShader,side:Ys,depthTest:!1,depthWrite:!1,fog:!1})),u.geometry.deleteAttribute("normal"),Object.defineProperty(u.material,"map",{get:function(){return this.uniforms.t2D.value}}),i.update(u)),u.material.uniforms.t2D.value=x,u.material.uniforms.backgroundIntensity.value=w.backgroundIntensity,u.material.toneMapped=x.encoding!==wn,x.matrixAutoUpdate===!0&&x.updateMatrix(),u.material.uniforms.uvTransform.value.copy(x.matrix),(f!==x||p!==x.version||m!==n.toneMapping)&&(u.material.needsUpdate=!0,f=x,p=x.version,m=n.toneMapping),u.layers.enableAll(),y.unshift(u,u.geometry,u.material,0,0,null))}function v(y,w){y.getRGB(Sg,rD(n)),r.buffers.color.setClear(Sg.r,Sg.g,Sg.b,w,o)}return{getClearColor:function(){return a},setClearColor:function(y,w=1){a.set(y),l=w,v(a,l)},getClearAlpha:function(){return l},setClearAlpha:function(y){l=y,v(a,l)},render:g}}function FW(n,e,t,r){const i=n.getParameter(34921),s=r.isWebGL2?null:e.get("OES_vertex_array_object"),o=r.isWebGL2||s!==null,a={},l=y(null);let u=l,c=!1;function f(P,F,G,ie,N){let V=!1;if(o){const j=v(ie,G,F);u!==j&&(u=j,m(u.object)),V=w(P,ie,G,N),V&&_(P,ie,G,N)}else{const j=F.wireframe===!0;(u.geometry!==ie.id||u.program!==G.id||u.wireframe!==j)&&(u.geometry=ie.id,u.program=G.id,u.wireframe=j,V=!0)}N!==null&&t.update(N,34963),(V||c)&&(c=!1,E(P,F,G,ie),N!==null&&n.bindBuffer(34963,t.get(N).buffer))}function p(){return r.isWebGL2?n.createVertexArray():s.createVertexArrayOES()}function m(P){return r.isWebGL2?n.bindVertexArray(P):s.bindVertexArrayOES(P)}function g(P){return r.isWebGL2?n.deleteVertexArray(P):s.deleteVertexArrayOES(P)}function v(P,F,G){const ie=G.wireframe===!0;let N=a[P.id];N===void 0&&(N={},a[P.id]=N);let V=N[F.id];V===void 0&&(V={},N[F.id]=V);let j=V[ie];return j===void 0&&(j=y(p()),V[ie]=j),j}function y(P){const F=[],G=[],ie=[];for(let N=0;N=0){const q=N[k];let X=V[k];if(X===void 0&&(k==="instanceMatrix"&&P.instanceMatrix&&(X=P.instanceMatrix),k==="instanceColor"&&P.instanceColor&&(X=P.instanceColor)),q===void 0||q.attribute!==X||X&&q.data!==X.data)return!0;j++}return u.attributesNum!==j||u.index!==ie}function _(P,F,G,ie){const N={},V=F.attributes;let j=0;const W=G.getAttributes();for(const k in W)if(W[k].location>=0){let q=V[k];q===void 0&&(k==="instanceMatrix"&&P.instanceMatrix&&(q=P.instanceMatrix),k==="instanceColor"&&P.instanceColor&&(q=P.instanceColor));const X={};X.attribute=q,q&&q.data&&(X.data=q.data),N[k]=X,j++}u.attributes=N,u.attributesNum=j,u.index=ie}function x(){const P=u.newAttributes;for(let F=0,G=P.length;F=0){let Q=N[W];if(Q===void 0&&(W==="instanceMatrix"&&P.instanceMatrix&&(Q=P.instanceMatrix),W==="instanceColor"&&P.instanceColor&&(Q=P.instanceColor)),Q!==void 0){const q=Q.normalized,X=Q.itemSize,J=t.get(Q);if(J===void 0)continue;const ae=J.buffer,re=J.type,me=J.bytesPerElement;if(Q.isInterleavedBufferAttribute){const Me=Q.data,Se=Me.stride,se=Q.offset;if(Me.isInstancedInterleavedBuffer){for(let ye=0;ye0&&n.getShaderPrecisionFormat(35632,36338).precision>0)return"highp";R="mediump"}return R==="mediump"&&n.getShaderPrecisionFormat(35633,36337).precision>0&&n.getShaderPrecisionFormat(35632,36337).precision>0?"mediump":"lowp"}const o=typeof WebGL2RenderingContext<"u"&&n instanceof WebGL2RenderingContext;let a=t.precision!==void 0?t.precision:"highp";const l=s(a);l!==a&&(console.warn("THREE.WebGLRenderer:",a,"not supported, using",l,"instead."),a=l);const u=o||e.has("WEBGL_draw_buffers"),c=t.logarithmicDepthBuffer===!0,f=n.getParameter(34930),p=n.getParameter(35660),m=n.getParameter(3379),g=n.getParameter(34076),v=n.getParameter(34921),y=n.getParameter(36347),w=n.getParameter(36348),_=n.getParameter(36349),x=p>0,A=o||e.has("OES_texture_float"),C=x&&A,b=o?n.getParameter(36183):0;return{isWebGL2:o,drawBuffers:u,getMaxAnisotropy:i,getMaxPrecision:s,precision:a,logarithmicDepthBuffer:c,maxTextures:f,maxVertexTextures:p,maxTextureSize:m,maxCubemapSize:g,maxAttributes:v,maxVertexUniforms:y,maxVaryings:w,maxFragmentUniforms:_,vertexTextures:x,floatFragmentTextures:A,floatVertexTextures:C,maxSamples:b}}function UW(n){const e=this;let t=null,r=0,i=!1,s=!1;const o=new Ha,a=new Rr,l={value:null,needsUpdate:!1};this.uniform=l,this.numPlanes=0,this.numIntersection=0,this.init=function(f,p){const m=f.length!==0||p||r!==0||i;return i=p,r=f.length,m},this.beginShadows=function(){s=!0,c(null)},this.endShadows=function(){s=!1},this.setGlobalState=function(f,p){t=c(f,p,0)},this.setState=function(f,p,m){const g=f.clippingPlanes,v=f.clipIntersection,y=f.clipShadows,w=n.get(f);if(!i||g===null||g.length===0||s&&!y)s?c(null):u();else{const _=s?0:r,x=_*4;let A=w.clippingState||null;l.value=A,A=c(g,p,x,m);for(let C=0;C!==x;++C)A[C]=t[C];w.clippingState=A,this.numIntersection=v?this.numPlanes:0,this.numPlanes+=_}};function u(){l.value!==t&&(l.value=t,l.needsUpdate=r>0),e.numPlanes=r,e.numIntersection=0}function c(f,p,m,g){const v=f!==null?f.length:0;let y=null;if(v!==0){if(y=l.value,g!==!0||y===null){const w=m+v*4,_=p.matrixWorldInverse;a.getNormalMatrix(_),(y===null||y.length0){const u=new RM(l.height/2);return u.fromEquirectangularTexture(n,o),e.set(o,u),o.addEventListener("dispose",i),t(u.texture,o.mapping)}else return null}}return o}function i(o){const a=o.target;a.removeEventListener("dispose",i);const l=e.get(a);l!==void 0&&(e.delete(a),l.dispose())}function s(){e=new WeakMap}return{get:r,dispose:s}}class oa extends Mp{constructor(e=-1,t=1,r=1,i=-1,s=.1,o=2e3){super(),this.isOrthographicCamera=!0,this.type="OrthographicCamera",this.zoom=1,this.view=null,this.left=e,this.right=t,this.top=r,this.bottom=i,this.near=s,this.far=o,this.updateProjectionMatrix()}copy(e,t){return super.copy(e,t),this.left=e.left,this.right=e.right,this.top=e.top,this.bottom=e.bottom,this.near=e.near,this.far=e.far,this.zoom=e.zoom,this.view=e.view===null?null:Object.assign({},e.view),this}setViewOffset(e,t,r,i,s,o){this.view===null&&(this.view={enabled:!0,fullWidth:1,fullHeight:1,offsetX:0,offsetY:0,width:1,height:1}),this.view.enabled=!0,this.view.fullWidth=e,this.view.fullHeight=t,this.view.offsetX=r,this.view.offsetY=i,this.view.width=s,this.view.height=o,this.updateProjectionMatrix()}clearViewOffset(){this.view!==null&&(this.view.enabled=!1),this.updateProjectionMatrix()}updateProjectionMatrix(){const e=(this.right-this.left)/(2*this.zoom),t=(this.top-this.bottom)/(2*this.zoom),r=(this.right+this.left)/2,i=(this.top+this.bottom)/2;let s=r-e,o=r+e,a=i+t,l=i-t;if(this.view!==null&&this.view.enabled){const u=(this.right-this.left)/this.view.fullWidth/this.zoom,c=(this.top-this.bottom)/this.view.fullHeight/this.zoom;s+=u*this.view.offsetX,o=s+u*this.view.width,a-=c*this.view.offsetY,l=a-c*this.view.height}this.projectionMatrix.makeOrthographic(s,o,a,l,this.near,this.far),this.projectionMatrixInverse.copy(this.projectionMatrix).invert()}toJSON(e){const t=super.toJSON(e);return t.object.zoom=this.zoom,t.object.left=this.left,t.object.right=this.right,t.object.top=this.top,t.object.bottom=this.bottom,t.object.near=this.near,t.object.far=this.far,this.view!==null&&(t.object.view=Object.assign({},this.view)),t}}const zc=4,ET=[.125,.215,.35,.446,.526,.582],tu=20,Cx=new oa,CT=new st;let bx=null;const $l=(1+Math.sqrt(5))/2,dc=1/$l,bT=[new Z(1,1,1),new Z(-1,1,1),new Z(1,1,-1),new Z(-1,1,-1),new Z(0,$l,dc),new Z(0,$l,-dc),new Z(dc,0,$l),new Z(-dc,0,$l),new Z($l,dc,0),new Z(-$l,dc,0)];class gS{constructor(e){this._renderer=e,this._pingPongRenderTarget=null,this._lodMax=0,this._cubeSize=0,this._lodPlanes=[],this._sizeLods=[],this._sigmas=[],this._blurMaterial=null,this._cubemapMaterial=null,this._equirectMaterial=null,this._compileMaterial(this._blurMaterial)}fromScene(e,t=0,r=.1,i=100){bx=this._renderer.getRenderTarget(),this._setSize(256);const s=this._allocateTargets();return s.depthBuffer=!0,this._sceneToCubeUV(e,r,i,s),t>0&&this._blur(s,0,0,t),this._applyPMREM(s),this._cleanup(s),s}fromEquirectangular(e,t=null){return this._fromTexture(e,t)}fromCubemap(e,t=null){return this._fromTexture(e,t)}compileCubemapShader(){this._cubemapMaterial===null&&(this._cubemapMaterial=BT(),this._compileMaterial(this._cubemapMaterial))}compileEquirectangularShader(){this._equirectMaterial===null&&(this._equirectMaterial=RT(),this._compileMaterial(this._equirectMaterial))}dispose(){this._dispose(),this._cubemapMaterial!==null&&this._cubemapMaterial.dispose(),this._equirectMaterial!==null&&this._equirectMaterial.dispose()}_setSize(e){this._lodMax=Math.floor(Math.log2(e)),this._cubeSize=Math.pow(2,this._lodMax)}_dispose(){this._blurMaterial!==null&&this._blurMaterial.dispose(),this._pingPongRenderTarget!==null&&this._pingPongRenderTarget.dispose();for(let e=0;e2?x:0,x,x),c.setRenderTarget(i),v&&c.render(g,a),c.render(e,a)}g.geometry.dispose(),g.material.dispose(),c.toneMapping=p,c.autoClear=f,e.background=y}_textureToCubeUV(e,t){const r=this._renderer,i=e.mapping===da||e.mapping===hl;i?(this._cubemapMaterial===null&&(this._cubemapMaterial=BT()),this._cubemapMaterial.uniforms.flipEnvMap.value=e.isRenderTargetTexture===!1?-1:1):this._equirectMaterial===null&&(this._equirectMaterial=RT());const s=i?this._cubemapMaterial:this._equirectMaterial,o=new Vn(this._lodPlanes[0],s),a=s.uniforms;a.envMap.value=e;const l=this._cubeSize;Ag(t,0,0,3*l,2*l),r.setRenderTarget(t),r.render(o,Cx)}_applyPMREM(e){const t=this._renderer,r=t.autoClear;t.autoClear=!1;for(let i=1;itu&&console.warn(`sigmaRadians, ${s}, is too large and will clip, as it requested ${y} samples when the maximum is set to ${tu}`);const w=[];let _=0;for(let R=0;Rx-zc?i-x+zc:0),b=4*(this._cubeSize-A);Ag(t,C,b,3*A,2*A),l.setRenderTarget(t),l.render(f,Cx)}}function GW(n){const e=[],t=[],r=[];let i=n;const s=n-zc+1+ET.length;for(let o=0;on-zc?l=ET[o-n+zc-1]:o===0&&(l=0),r.push(l);const u=1/(a-2),c=-u,f=1+u,p=[c,c,f,c,f,f,c,c,f,f,c,f],m=6,g=6,v=3,y=2,w=1,_=new Float32Array(v*g*m),x=new Float32Array(y*g*m),A=new Float32Array(w*g*m);for(let b=0;b2?0:-1,B=[R,E,0,R+2/3,E,0,R+2/3,E+1,0,R,E,0,R+2/3,E+1,0,R,E+1,0];_.set(B,v*g*b),x.set(p,y*g*b);const D=[b,b,b,b,b,b];A.set(D,w*g*b)}const C=new Ut;C.setAttribute("position",new mn(_,v)),C.setAttribute("uv",new mn(x,y)),C.setAttribute("faceIndex",new mn(A,w)),e.push(C),i>zc&&i--}return{lodPlanes:e,sizeLods:t,sigmas:r}}function TT(n,e,t){const r=new ri(n,e,t);return r.texture.mapping=Bf,r.texture.name="PMREM.cubeUv",r.scissorTest=!0,r}function Ag(n,e,t,r,i){n.viewport.set(e,t,r,i),n.scissor.set(e,t,r,i)}function HW(n,e,t){const r=new Float32Array(tu),i=new Z(0,1,0);return new Oi({name:"SphericalGaussianBlur",defines:{n:tu,CUBEUV_TEXEL_WIDTH:1/e,CUBEUV_TEXEL_HEIGHT:1/t,CUBEUV_MAX_MIP:`${n}.0`},uniforms:{envMap:{value:null},samples:{value:1},weights:{value:r},latitudinal:{value:!1},dTheta:{value:0},mipInt:{value:0},poleAxis:{value:i}},vertexShader:BM(),fragmentShader:` - - precision mediump float; - precision mediump int; - - varying vec3 vOutputDirection; - - uniform sampler2D envMap; - uniform int samples; - uniform float weights[ n ]; - uniform bool latitudinal; - uniform float dTheta; - uniform float mipInt; - uniform vec3 poleAxis; - - #define ENVMAP_TYPE_CUBE_UV - #include - - vec3 getSample( float theta, vec3 axis ) { - - float cosTheta = cos( theta ); - // Rodrigues' axis-angle rotation - vec3 sampleDirection = vOutputDirection * cosTheta - + cross( axis, vOutputDirection ) * sin( theta ) - + axis * dot( axis, vOutputDirection ) * ( 1.0 - cosTheta ); - - return bilinearCubeUV( envMap, sampleDirection, mipInt ); - - } - - void main() { - - vec3 axis = latitudinal ? poleAxis : cross( poleAxis, vOutputDirection ); - - if ( all( equal( axis, vec3( 0.0 ) ) ) ) { - - axis = vec3( vOutputDirection.z, 0.0, - vOutputDirection.x ); - - } - - axis = normalize( axis ); - - gl_FragColor = vec4( 0.0, 0.0, 0.0, 1.0 ); - gl_FragColor.rgb += weights[ 0 ] * getSample( 0.0, axis ); - - for ( int i = 1; i < n; i++ ) { - - if ( i >= samples ) { - - break; - - } - - float theta = dTheta * float( i ); - gl_FragColor.rgb += weights[ i ] * getSample( -1.0 * theta, axis ); - gl_FragColor.rgb += weights[ i ] * getSample( theta, axis ); - - } - - } - `,blending:sa,depthTest:!1,depthWrite:!1})}function RT(){return new Oi({name:"EquirectangularToCubeUV",uniforms:{envMap:{value:null}},vertexShader:BM(),fragmentShader:` - - precision mediump float; - precision mediump int; - - varying vec3 vOutputDirection; - - uniform sampler2D envMap; - - #include - - void main() { - - vec3 outputDirection = normalize( vOutputDirection ); - vec2 uv = equirectUv( outputDirection ); - - gl_FragColor = vec4( texture2D ( envMap, uv ).rgb, 1.0 ); - - } - `,blending:sa,depthTest:!1,depthWrite:!1})}function BT(){return new Oi({name:"CubemapToCubeUV",uniforms:{envMap:{value:null},flipEnvMap:{value:-1}},vertexShader:BM(),fragmentShader:` - - precision mediump float; - precision mediump int; - - uniform float flipEnvMap; - - varying vec3 vOutputDirection; - - uniform samplerCube envMap; - - void main() { - - gl_FragColor = textureCube( envMap, vec3( flipEnvMap * vOutputDirection.x, vOutputDirection.yz ) ); - - } - `,blending:sa,depthTest:!1,depthWrite:!1})}function BM(){return` - - precision mediump float; - precision mediump int; - - attribute float faceIndex; - - varying vec3 vOutputDirection; - - // RH coordinate system; PMREM face-indexing convention - vec3 getDirection( vec2 uv, float face ) { - - uv = 2.0 * uv - 1.0; - - vec3 direction = vec3( uv, 1.0 ); - - if ( face == 0.0 ) { - - direction = direction.zyx; // ( 1, v, u ) pos x - - } else if ( face == 1.0 ) { - - direction = direction.xzy; - direction.xz *= -1.0; // ( -u, 1, -v ) pos y - - } else if ( face == 2.0 ) { - - direction.x *= -1.0; // ( -u, v, 1 ) pos z - - } else if ( face == 3.0 ) { - - direction = direction.zyx; - direction.xz *= -1.0; // ( -1, v, -u ) neg x - - } else if ( face == 4.0 ) { - - direction = direction.xzy; - direction.xy *= -1.0; // ( -u, -1, v ) neg y - - } else if ( face == 5.0 ) { - - direction.z *= -1.0; // ( u, v, -1 ) neg z - - } - - return direction; - - } - - void main() { - - vOutputDirection = getDirection( uv, faceIndex ); - gl_Position = vec4( position, 1.0 ); - - } - `}function VW(n){let e=new WeakMap,t=null;function r(a){if(a&&a.isTexture){const l=a.mapping,u=l===gf||l===Kd,c=l===da||l===hl;if(u||c)if(a.isRenderTargetTexture&&a.needsPMREMUpdate===!0){a.needsPMREMUpdate=!1;let f=e.get(a);return t===null&&(t=new gS(n)),f=u?t.fromEquirectangular(a,f):t.fromCubemap(a,f),e.set(a,f),f.texture}else{if(e.has(a))return e.get(a).texture;{const f=a.image;if(u&&f&&f.height>0||c&&f&&i(f)){t===null&&(t=new gS(n));const p=u?t.fromEquirectangular(a):t.fromCubemap(a);return e.set(a,p),a.addEventListener("dispose",s),p.texture}else return null}}}return a}function i(a){let l=0;const u=6;for(let c=0;ce.maxTextureSize&&(U=Math.ceil(D/e.maxTextureSize),D=e.maxTextureSize);const z=new Float32Array(D*U*4*v),Y=new my(z,D,U,v);Y.type=zr,Y.needsUpdate=!0;const P=B*4;for(let G=0;G0)return n;const i=e*t;let s=PT[i];if(s===void 0&&(s=new Float32Array(i),PT[i]=s),e!==0){r.toArray(s,0);for(let o=1,a=0;o!==e;++o)a+=t,n[o].toArray(s,a)}return s}function yr(n,e){if(n.length!==e.length)return!1;for(let t=0,r=n.length;t":" "} ${a}: ${t[o]}`)}return r.join(` -`)}function W7(n){switch(n){case ma:return["Linear","( value )"];case wn:return["sRGB","( value )"];default:return console.warn("THREE.WebGLProgram: Unsupported encoding:",n),["Linear","( value )"]}}function OT(n,e,t){const r=n.getShaderParameter(e,35713),i=n.getShaderInfoLog(e).trim();if(r&&i==="")return"";const s=/ERROR: 0:(\d+)/.exec(i);if(s){const o=parseInt(s[1]);return t.toUpperCase()+` - -`+i+` - -`+V7(n.getShaderSource(e),o)}else return i}function J7(n,e){const t=W7(e);return"vec4 "+n+"( vec4 value ) { return LinearTo"+t[0]+t[1]+"; }"}function j7(n,e){let t;switch(e){case TL:t="Linear";break;case RL:t="Reinhard";break;case BL:t="OptimizedCineon";break;case vM:t="ACESFilmic";break;case PL:t="Custom";break;default:console.warn("THREE.WebGLProgram: Unsupported toneMapping:",e),t="Linear"}return"vec3 "+n+"( vec3 color ) { return "+t+"ToneMapping( color ); }"}function X7(n){return[n.extensionDerivatives||n.envMapCubeUVHeight||n.bumpMap||n.tangentSpaceNormalMap||n.clearcoatNormalMap||n.flatShading||n.shaderID==="physical"?"#extension GL_OES_standard_derivatives : enable":"",(n.extensionFragDepth||n.logarithmicDepthBuffer)&&n.rendererExtensionFragDepth?"#extension GL_EXT_frag_depth : enable":"",n.extensionDrawBuffers&&n.rendererExtensionDrawBuffers?"#extension GL_EXT_draw_buffers : require":"",(n.extensionShaderTextureLOD||n.envMap||n.transmission)&&n.rendererExtensionShaderTextureLod?"#extension GL_EXT_shader_texture_lod : enable":""].filter(qh).join(` -`)}function Y7(n){const e=[];for(const t in n){const r=n[t];r!==!1&&e.push("#define "+t+" "+r)}return e.join(` -`)}function K7(n,e){const t={},r=n.getProgramParameter(e,35721);for(let i=0;i/gm;function vS(n){return n.replace(Z7,Q7)}function Q7(n,e){const t=zt[e];if(t===void 0)throw new Error("Can not resolve #include <"+e+">");return vS(t)}const q7=/#pragma unroll_loop_start\s+for\s*\(\s*int\s+i\s*=\s*(\d+)\s*;\s*i\s*<\s*(\d+)\s*;\s*i\s*\+\+\s*\)\s*{([\s\S]+?)}\s+#pragma unroll_loop_end/g;function GT(n){return n.replace(q7,$7)}function $7(n,e,t,r){let i="";for(let s=parseInt(e);s0&&(y+=` -`),w=[m,g].filter(qh).join(` -`),w.length>0&&(w+=` -`)):(y=[HT(t),"#define SHADER_NAME "+t.shaderName,g,t.instancing?"#define USE_INSTANCING":"",t.instancingColor?"#define USE_INSTANCING_COLOR":"",t.supportsVertexTextures?"#define VERTEX_TEXTURES":"",t.useFog&&t.fog?"#define USE_FOG":"",t.useFog&&t.fogExp2?"#define FOG_EXP2":"",t.map?"#define USE_MAP":"",t.envMap?"#define USE_ENVMAP":"",t.envMap?"#define "+c:"",t.lightMap?"#define USE_LIGHTMAP":"",t.aoMap?"#define USE_AOMAP":"",t.emissiveMap?"#define USE_EMISSIVEMAP":"",t.bumpMap?"#define USE_BUMPMAP":"",t.normalMap?"#define USE_NORMALMAP":"",t.normalMap&&t.objectSpaceNormalMap?"#define OBJECTSPACE_NORMALMAP":"",t.normalMap&&t.tangentSpaceNormalMap?"#define TANGENTSPACE_NORMALMAP":"",t.clearcoatMap?"#define USE_CLEARCOATMAP":"",t.clearcoatRoughnessMap?"#define USE_CLEARCOAT_ROUGHNESSMAP":"",t.clearcoatNormalMap?"#define USE_CLEARCOAT_NORMALMAP":"",t.iridescenceMap?"#define USE_IRIDESCENCEMAP":"",t.iridescenceThicknessMap?"#define USE_IRIDESCENCE_THICKNESSMAP":"",t.displacementMap&&t.supportsVertexTextures?"#define USE_DISPLACEMENTMAP":"",t.specularMap?"#define USE_SPECULARMAP":"",t.specularIntensityMap?"#define USE_SPECULARINTENSITYMAP":"",t.specularColorMap?"#define USE_SPECULARCOLORMAP":"",t.roughnessMap?"#define USE_ROUGHNESSMAP":"",t.metalnessMap?"#define USE_METALNESSMAP":"",t.alphaMap?"#define USE_ALPHAMAP":"",t.transmission?"#define USE_TRANSMISSION":"",t.transmissionMap?"#define USE_TRANSMISSIONMAP":"",t.thicknessMap?"#define USE_THICKNESSMAP":"",t.sheenColorMap?"#define USE_SHEENCOLORMAP":"",t.sheenRoughnessMap?"#define USE_SHEENROUGHNESSMAP":"",t.vertexTangents?"#define USE_TANGENT":"",t.vertexColors?"#define USE_COLOR":"",t.vertexAlphas?"#define USE_COLOR_ALPHA":"",t.vertexUvs?"#define USE_UV":"",t.uvsVertexOnly?"#define UVS_VERTEX_ONLY":"",t.flatShading?"#define FLAT_SHADED":"",t.skinning?"#define USE_SKINNING":"",t.morphTargets?"#define USE_MORPHTARGETS":"",t.morphNormals&&t.flatShading===!1?"#define USE_MORPHNORMALS":"",t.morphColors&&t.isWebGL2?"#define USE_MORPHCOLORS":"",t.morphTargetsCount>0&&t.isWebGL2?"#define MORPHTARGETS_TEXTURE":"",t.morphTargetsCount>0&&t.isWebGL2?"#define MORPHTARGETS_TEXTURE_STRIDE "+t.morphTextureStride:"",t.morphTargetsCount>0&&t.isWebGL2?"#define MORPHTARGETS_COUNT "+t.morphTargetsCount:"",t.doubleSided?"#define DOUBLE_SIDED":"",t.flipSided?"#define FLIP_SIDED":"",t.shadowMapEnabled?"#define USE_SHADOWMAP":"",t.shadowMapEnabled?"#define "+l:"",t.sizeAttenuation?"#define USE_SIZEATTENUATION":"",t.logarithmicDepthBuffer?"#define USE_LOGDEPTHBUF":"",t.logarithmicDepthBuffer&&t.rendererExtensionFragDepth?"#define USE_LOGDEPTHBUF_EXT":"","uniform mat4 modelMatrix;","uniform mat4 modelViewMatrix;","uniform mat4 projectionMatrix;","uniform mat4 viewMatrix;","uniform mat3 normalMatrix;","uniform vec3 cameraPosition;","uniform bool isOrthographic;","#ifdef USE_INSTANCING"," attribute mat4 instanceMatrix;","#endif","#ifdef USE_INSTANCING_COLOR"," attribute vec3 instanceColor;","#endif","attribute vec3 position;","attribute vec3 normal;","attribute vec2 uv;","#ifdef USE_TANGENT"," attribute vec4 tangent;","#endif","#if defined( USE_COLOR_ALPHA )"," attribute vec4 color;","#elif defined( USE_COLOR )"," attribute vec3 color;","#endif","#if ( defined( USE_MORPHTARGETS ) && ! defined( MORPHTARGETS_TEXTURE ) )"," attribute vec3 morphTarget0;"," attribute vec3 morphTarget1;"," attribute vec3 morphTarget2;"," attribute vec3 morphTarget3;"," #ifdef USE_MORPHNORMALS"," attribute vec3 morphNormal0;"," attribute vec3 morphNormal1;"," attribute vec3 morphNormal2;"," attribute vec3 morphNormal3;"," #else"," attribute vec3 morphTarget4;"," attribute vec3 morphTarget5;"," attribute vec3 morphTarget6;"," attribute vec3 morphTarget7;"," #endif","#endif","#ifdef USE_SKINNING"," attribute vec4 skinIndex;"," attribute vec4 skinWeight;","#endif",` -`].filter(qh).join(` -`),w=[m,HT(t),"#define SHADER_NAME "+t.shaderName,g,t.useFog&&t.fog?"#define USE_FOG":"",t.useFog&&t.fogExp2?"#define FOG_EXP2":"",t.map?"#define USE_MAP":"",t.matcap?"#define USE_MATCAP":"",t.envMap?"#define USE_ENVMAP":"",t.envMap?"#define "+u:"",t.envMap?"#define "+c:"",t.envMap?"#define "+f:"",p?"#define CUBEUV_TEXEL_WIDTH "+p.texelWidth:"",p?"#define CUBEUV_TEXEL_HEIGHT "+p.texelHeight:"",p?"#define CUBEUV_MAX_MIP "+p.maxMip+".0":"",t.lightMap?"#define USE_LIGHTMAP":"",t.aoMap?"#define USE_AOMAP":"",t.emissiveMap?"#define USE_EMISSIVEMAP":"",t.bumpMap?"#define USE_BUMPMAP":"",t.normalMap?"#define USE_NORMALMAP":"",t.normalMap&&t.objectSpaceNormalMap?"#define OBJECTSPACE_NORMALMAP":"",t.normalMap&&t.tangentSpaceNormalMap?"#define TANGENTSPACE_NORMALMAP":"",t.clearcoat?"#define USE_CLEARCOAT":"",t.clearcoatMap?"#define USE_CLEARCOATMAP":"",t.clearcoatRoughnessMap?"#define USE_CLEARCOAT_ROUGHNESSMAP":"",t.clearcoatNormalMap?"#define USE_CLEARCOAT_NORMALMAP":"",t.iridescence?"#define USE_IRIDESCENCE":"",t.iridescenceMap?"#define USE_IRIDESCENCEMAP":"",t.iridescenceThicknessMap?"#define USE_IRIDESCENCE_THICKNESSMAP":"",t.specularMap?"#define USE_SPECULARMAP":"",t.specularIntensityMap?"#define USE_SPECULARINTENSITYMAP":"",t.specularColorMap?"#define USE_SPECULARCOLORMAP":"",t.roughnessMap?"#define USE_ROUGHNESSMAP":"",t.metalnessMap?"#define USE_METALNESSMAP":"",t.alphaMap?"#define USE_ALPHAMAP":"",t.alphaTest?"#define USE_ALPHATEST":"",t.sheen?"#define USE_SHEEN":"",t.sheenColorMap?"#define USE_SHEENCOLORMAP":"",t.sheenRoughnessMap?"#define USE_SHEENROUGHNESSMAP":"",t.transmission?"#define USE_TRANSMISSION":"",t.transmissionMap?"#define USE_TRANSMISSIONMAP":"",t.thicknessMap?"#define USE_THICKNESSMAP":"",t.decodeVideoTexture?"#define DECODE_VIDEO_TEXTURE":"",t.vertexTangents?"#define USE_TANGENT":"",t.vertexColors||t.instancingColor?"#define USE_COLOR":"",t.vertexAlphas?"#define USE_COLOR_ALPHA":"",t.vertexUvs?"#define USE_UV":"",t.uvsVertexOnly?"#define UVS_VERTEX_ONLY":"",t.gradientMap?"#define USE_GRADIENTMAP":"",t.flatShading?"#define FLAT_SHADED":"",t.doubleSided?"#define DOUBLE_SIDED":"",t.flipSided?"#define FLIP_SIDED":"",t.shadowMapEnabled?"#define USE_SHADOWMAP":"",t.shadowMapEnabled?"#define "+l:"",t.premultipliedAlpha?"#define PREMULTIPLIED_ALPHA":"",t.useLegacyLights?"#define LEGACY_LIGHTS":"",t.logarithmicDepthBuffer?"#define USE_LOGDEPTHBUF":"",t.logarithmicDepthBuffer&&t.rendererExtensionFragDepth?"#define USE_LOGDEPTHBUF_EXT":"","uniform mat4 viewMatrix;","uniform vec3 cameraPosition;","uniform bool isOrthographic;",t.toneMapping!==js?"#define TONE_MAPPING":"",t.toneMapping!==js?zt.tonemapping_pars_fragment:"",t.toneMapping!==js?j7("toneMapping",t.toneMapping):"",t.dithering?"#define DITHERING":"",t.opaque?"#define OPAQUE":"",zt.encodings_pars_fragment,J7("linearToOutputTexel",t.outputEncoding),t.useDepthPacking?"#define DEPTH_PACKING "+t.depthPacking:"",` -`].filter(qh).join(` -`)),o=vS(o),o=UT(o,t),o=zT(o,t),a=vS(a),a=UT(a,t),a=zT(a,t),o=GT(o),a=GT(a),t.isWebGL2&&t.isRawShaderMaterial!==!0&&(_=`#version 300 es -`,y=["precision mediump sampler2DArray;","#define attribute in","#define varying out","#define texture2D texture"].join(` -`)+` -`+y,w=["#define varying in",t.glslVersion===pS?"":"layout(location = 0) out highp vec4 pc_fragColor;",t.glslVersion===pS?"":"#define gl_FragColor pc_fragColor","#define gl_FragDepthEXT gl_FragDepth","#define texture2D texture","#define textureCube texture","#define texture2DProj textureProj","#define texture2DLodEXT textureLod","#define texture2DProjLodEXT textureProjLod","#define textureCubeLodEXT textureLod","#define texture2DGradEXT textureGrad","#define texture2DProjGradEXT textureProjGrad","#define textureCubeGradEXT textureGrad"].join(` -`)+` -`+w);const x=_+y+o,A=_+w+a,C=NT(i,35633,x),b=NT(i,35632,A);if(i.attachShader(v,C),i.attachShader(v,b),t.index0AttributeName!==void 0?i.bindAttribLocation(v,0,t.index0AttributeName):t.morphTargets===!0&&i.bindAttribLocation(v,0,"position"),i.linkProgram(v),n.debug.checkShaderErrors){const B=i.getProgramInfoLog(v).trim(),D=i.getShaderInfoLog(C).trim(),U=i.getShaderInfoLog(b).trim();let z=!0,Y=!0;if(i.getProgramParameter(v,35714)===!1){z=!1;const P=OT(i,C,"vertex"),F=OT(i,b,"fragment");console.error("THREE.WebGLProgram: Shader Error "+i.getError()+" - VALIDATE_STATUS "+i.getProgramParameter(v,35715)+` - -Program Info Log: `+B+` -`+P+` -`+F)}else B!==""?console.warn("THREE.WebGLProgram: Program Info Log:",B):(D===""||U==="")&&(Y=!1);Y&&(this.diagnostics={runnable:z,programLog:B,vertexShader:{log:D,prefix:y},fragmentShader:{log:U,prefix:w}})}i.deleteShader(C),i.deleteShader(b);let R;this.getUniforms=function(){return R===void 0&&(R=new C0(i,v)),R};let E;return this.getAttributes=function(){return E===void 0&&(E=K7(i,v)),E},this.destroy=function(){r.releaseStatesOfProgram(this),i.deleteProgram(v),this.program=void 0},this.name=t.shaderName,this.id=H7++,this.cacheKey=e,this.usedTimes=1,this.program=v,this.vertexShader=C,this.fragmentShader=b,this}let oJ=0;class aJ{constructor(){this.shaderCache=new Map,this.materialCache=new Map}update(e){const t=e.vertexShader,r=e.fragmentShader,i=this._getShaderStage(t),s=this._getShaderStage(r),o=this._getShaderCacheForMaterial(e);return o.has(i)===!1&&(o.add(i),i.usedTimes++),o.has(s)===!1&&(o.add(s),s.usedTimes++),this}remove(e){const t=this.materialCache.get(e);for(const r of t)r.usedTimes--,r.usedTimes===0&&this.shaderCache.delete(r.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 r=t.get(e);return r===void 0&&(r=new Set,t.set(e,r)),r}_getShaderStage(e){const t=this.shaderCache;let r=t.get(e);return r===void 0&&(r=new lJ(e),t.set(e,r)),r}}class lJ{constructor(e){this.id=oJ++,this.code=e,this.usedTimes=0}}function uJ(n,e,t,r,i,s,o){const a=new gu,l=new aJ,u=[],c=i.isWebGL2,f=i.logarithmicDepthBuffer,p=i.vertexTextures;let m=i.precision;const g={MeshDepthMaterial:"depth",MeshDistanceMaterial:"distanceRGBA",MeshNormalMaterial:"normal",MeshBasicMaterial:"basic",MeshLambertMaterial:"lambert",MeshPhongMaterial:"phong",MeshToonMaterial:"toon",MeshStandardMaterial:"physical",MeshPhysicalMaterial:"physical",MeshMatcapMaterial:"matcap",LineBasicMaterial:"basic",LineDashedMaterial:"dashed",PointsMaterial:"points",ShadowMaterial:"shadow",SpriteMaterial:"sprite"};function v(E,B,D,U,z){const Y=U.fog,P=z.geometry,F=E.isMeshStandardMaterial?U.environment:null,G=(E.isMeshStandardMaterial?t:e).get(E.envMap||F),ie=G&&G.mapping===Bf?G.image.height:null,N=g[E.type];E.precision!==null&&(m=i.getMaxPrecision(E.precision),m!==E.precision&&console.warn("THREE.WebGLProgram.getParameters:",E.precision,"not supported, using",m,"instead."));const V=P.morphAttributes.position||P.morphAttributes.normal||P.morphAttributes.color,j=V!==void 0?V.length:0;let W=0;P.morphAttributes.position!==void 0&&(W=1),P.morphAttributes.normal!==void 0&&(W=2),P.morphAttributes.color!==void 0&&(W=3);let k,Q,q,X;if(N){const Se=zs[N];k=Se.vertexShader,Q=Se.fragmentShader}else k=E.vertexShader,Q=E.fragmentShader,l.update(E),q=l.getVertexShaderID(E),X=l.getFragmentShaderID(E);const J=n.getRenderTarget(),ae=E.alphaTest>0,re=E.clearcoat>0,me=E.iridescence>0;return{isWebGL2:c,shaderID:N,shaderName:E.type,vertexShader:k,fragmentShader:Q,defines:E.defines,customVertexShaderID:q,customFragmentShaderID:X,isRawShaderMaterial:E.isRawShaderMaterial===!0,glslVersion:E.glslVersion,precision:m,instancing:z.isInstancedMesh===!0,instancingColor:z.isInstancedMesh===!0&&z.instanceColor!==null,supportsVertexTextures:p,outputEncoding:J===null?n.outputEncoding:J.isXRRenderTarget===!0?J.texture.encoding:ma,map:!!E.map,matcap:!!E.matcap,envMap:!!G,envMapMode:G&&G.mapping,envMapCubeUVHeight:ie,lightMap:!!E.lightMap,aoMap:!!E.aoMap,emissiveMap:!!E.emissiveMap,bumpMap:!!E.bumpMap,normalMap:!!E.normalMap,objectSpaceNormalMap:E.normalMapType===QL,tangentSpaceNormalMap:E.normalMapType===xl,decodeVideoTexture:!!E.map&&E.map.isVideoTexture===!0&&E.map.encoding===wn,clearcoat:re,clearcoatMap:re&&!!E.clearcoatMap,clearcoatRoughnessMap:re&&!!E.clearcoatRoughnessMap,clearcoatNormalMap:re&&!!E.clearcoatNormalMap,iridescence:me,iridescenceMap:me&&!!E.iridescenceMap,iridescenceThicknessMap:me&&!!E.iridescenceThicknessMap,displacementMap:!!E.displacementMap,roughnessMap:!!E.roughnessMap,metalnessMap:!!E.metalnessMap,specularMap:!!E.specularMap,specularIntensityMap:!!E.specularIntensityMap,specularColorMap:!!E.specularColorMap,opaque:E.transparent===!1&&E.blending===du,alphaMap:!!E.alphaMap,alphaTest:ae,gradientMap:!!E.gradientMap,sheen:E.sheen>0,sheenColorMap:!!E.sheenColorMap,sheenRoughnessMap:!!E.sheenRoughnessMap,transmission:E.transmission>0,transmissionMap:!!E.transmissionMap,thicknessMap:!!E.thicknessMap,combine:E.combine,vertexTangents:!!E.normalMap&&!!P.attributes.tangent,vertexColors:E.vertexColors,vertexAlphas:E.vertexColors===!0&&!!P.attributes.color&&P.attributes.color.itemSize===4,vertexUvs:!!E.map||!!E.bumpMap||!!E.normalMap||!!E.specularMap||!!E.alphaMap||!!E.emissiveMap||!!E.roughnessMap||!!E.metalnessMap||!!E.clearcoatMap||!!E.clearcoatRoughnessMap||!!E.clearcoatNormalMap||!!E.iridescenceMap||!!E.iridescenceThicknessMap||!!E.displacementMap||!!E.transmissionMap||!!E.thicknessMap||!!E.specularIntensityMap||!!E.specularColorMap||!!E.sheenColorMap||!!E.sheenRoughnessMap,uvsVertexOnly:!(E.map||E.bumpMap||E.normalMap||E.specularMap||E.alphaMap||E.emissiveMap||E.roughnessMap||E.metalnessMap||E.clearcoatNormalMap||E.iridescenceMap||E.iridescenceThicknessMap||E.transmission>0||E.transmissionMap||E.thicknessMap||E.specularIntensityMap||E.specularColorMap||E.sheen>0||E.sheenColorMap||E.sheenRoughnessMap)&&!!E.displacementMap,fog:!!Y,useFog:E.fog===!0,fogExp2:Y&&Y.isFogExp2,flatShading:!!E.flatShading,sizeAttenuation:E.sizeAttenuation,logarithmicDepthBuffer:f,skinning:z.isSkinnedMesh===!0,morphTargets:P.morphAttributes.position!==void 0,morphNormals:P.morphAttributes.normal!==void 0,morphColors:P.morphAttributes.color!==void 0,morphTargetsCount:j,morphTextureStride:W,numDirLights:B.directional.length,numPointLights:B.point.length,numSpotLights:B.spot.length,numSpotLightMaps:B.spotLightMap.length,numRectAreaLights:B.rectArea.length,numHemiLights:B.hemi.length,numDirLightShadows:B.directionalShadowMap.length,numPointLightShadows:B.pointShadowMap.length,numSpotLightShadows:B.spotShadowMap.length,numSpotLightShadowsWithMaps:B.numSpotLightShadowsWithMaps,numClippingPlanes:o.numPlanes,numClipIntersection:o.numIntersection,dithering:E.dithering,shadowMapEnabled:n.shadowMap.enabled&&D.length>0,shadowMapType:n.shadowMap.type,toneMapping:E.toneMapped?n.toneMapping:js,useLegacyLights:n.useLegacyLights,premultipliedAlpha:E.premultipliedAlpha,doubleSided:E.side===$i,flipSided:E.side===vi,useDepthPacking:!!E.depthPacking,depthPacking:E.depthPacking||0,index0AttributeName:E.index0AttributeName,extensionDerivatives:E.extensions&&E.extensions.derivatives,extensionFragDepth:E.extensions&&E.extensions.fragDepth,extensionDrawBuffers:E.extensions&&E.extensions.drawBuffers,extensionShaderTextureLOD:E.extensions&&E.extensions.shaderTextureLOD,rendererExtensionFragDepth:c||r.has("EXT_frag_depth"),rendererExtensionDrawBuffers:c||r.has("WEBGL_draw_buffers"),rendererExtensionShaderTextureLod:c||r.has("EXT_shader_texture_lod"),customProgramCacheKey:E.customProgramCacheKey()}}function y(E){const B=[];if(E.shaderID?B.push(E.shaderID):(B.push(E.customVertexShaderID),B.push(E.customFragmentShaderID)),E.defines!==void 0)for(const D in E.defines)B.push(D),B.push(E.defines[D]);return E.isRawShaderMaterial===!1&&(w(B,E),_(B,E),B.push(n.outputEncoding)),B.push(E.customProgramCacheKey),B.join()}function w(E,B){E.push(B.precision),E.push(B.outputEncoding),E.push(B.envMapMode),E.push(B.envMapCubeUVHeight),E.push(B.combine),E.push(B.vertexUvs),E.push(B.fogExp2),E.push(B.sizeAttenuation),E.push(B.morphTargetsCount),E.push(B.morphAttributeCount),E.push(B.numDirLights),E.push(B.numPointLights),E.push(B.numSpotLights),E.push(B.numSpotLightMaps),E.push(B.numHemiLights),E.push(B.numRectAreaLights),E.push(B.numDirLightShadows),E.push(B.numPointLightShadows),E.push(B.numSpotLightShadows),E.push(B.numSpotLightShadowsWithMaps),E.push(B.shadowMapType),E.push(B.toneMapping),E.push(B.numClippingPlanes),E.push(B.numClipIntersection),E.push(B.depthPacking)}function _(E,B){a.disableAll(),B.isWebGL2&&a.enable(0),B.supportsVertexTextures&&a.enable(1),B.instancing&&a.enable(2),B.instancingColor&&a.enable(3),B.map&&a.enable(4),B.matcap&&a.enable(5),B.envMap&&a.enable(6),B.lightMap&&a.enable(7),B.aoMap&&a.enable(8),B.emissiveMap&&a.enable(9),B.bumpMap&&a.enable(10),B.normalMap&&a.enable(11),B.objectSpaceNormalMap&&a.enable(12),B.tangentSpaceNormalMap&&a.enable(13),B.clearcoat&&a.enable(14),B.clearcoatMap&&a.enable(15),B.clearcoatRoughnessMap&&a.enable(16),B.clearcoatNormalMap&&a.enable(17),B.iridescence&&a.enable(18),B.iridescenceMap&&a.enable(19),B.iridescenceThicknessMap&&a.enable(20),B.displacementMap&&a.enable(21),B.specularMap&&a.enable(22),B.roughnessMap&&a.enable(23),B.metalnessMap&&a.enable(24),B.gradientMap&&a.enable(25),B.alphaMap&&a.enable(26),B.alphaTest&&a.enable(27),B.vertexColors&&a.enable(28),B.vertexAlphas&&a.enable(29),B.vertexUvs&&a.enable(30),B.vertexTangents&&a.enable(31),B.uvsVertexOnly&&a.enable(32),E.push(a.mask),a.disableAll(),B.fog&&a.enable(0),B.useFog&&a.enable(1),B.flatShading&&a.enable(2),B.logarithmicDepthBuffer&&a.enable(3),B.skinning&&a.enable(4),B.morphTargets&&a.enable(5),B.morphNormals&&a.enable(6),B.morphColors&&a.enable(7),B.premultipliedAlpha&&a.enable(8),B.shadowMapEnabled&&a.enable(9),B.useLegacyLights&&a.enable(10),B.doubleSided&&a.enable(11),B.flipSided&&a.enable(12),B.useDepthPacking&&a.enable(13),B.dithering&&a.enable(14),B.specularIntensityMap&&a.enable(15),B.specularColorMap&&a.enable(16),B.transmission&&a.enable(17),B.transmissionMap&&a.enable(18),B.thicknessMap&&a.enable(19),B.sheen&&a.enable(20),B.sheenColorMap&&a.enable(21),B.sheenRoughnessMap&&a.enable(22),B.decodeVideoTexture&&a.enable(23),B.opaque&&a.enable(24),E.push(a.mask)}function x(E){const B=g[E.type];let D;if(B){const U=zs[B];D=gy.clone(U.uniforms)}else D=E.uniforms;return D}function A(E,B){let D;for(let U=0,z=u.length;U0?r.push(w):m.transparent===!0?i.push(w):t.push(w)}function l(f,p,m,g,v,y){const w=o(f,p,m,g,v,y);m.transmission>0?r.unshift(w):m.transparent===!0?i.unshift(w):t.unshift(w)}function u(f,p){t.length>1&&t.sort(f||fJ),r.length>1&&r.sort(p||VT),i.length>1&&i.sort(p||VT)}function c(){for(let f=e,p=n.length;f=s.length?(o=new WT,s.push(o)):o=s[i],o}function t(){n=new WeakMap}return{get:e,dispose:t}}function dJ(){const n={};return{get:function(e){if(n[e.id]!==void 0)return n[e.id];let t;switch(e.type){case"DirectionalLight":t={direction:new Z,color:new st};break;case"SpotLight":t={position:new Z,direction:new Z,color:new st,distance:0,coneCos:0,penumbraCos:0,decay:0};break;case"PointLight":t={position:new Z,color:new st,distance:0,decay:0};break;case"HemisphereLight":t={direction:new Z,skyColor:new st,groundColor:new st};break;case"RectAreaLight":t={color:new st,position:new Z,halfWidth:new Z,halfHeight:new Z};break}return n[e.id]=t,t}}}function pJ(){const n={};return{get:function(e){if(n[e.id]!==void 0)return n[e.id];let t;switch(e.type){case"DirectionalLight":t={shadowBias:0,shadowNormalBias:0,shadowRadius:1,shadowMapSize:new ze};break;case"SpotLight":t={shadowBias:0,shadowNormalBias:0,shadowRadius:1,shadowMapSize:new ze};break;case"PointLight":t={shadowBias:0,shadowNormalBias:0,shadowRadius:1,shadowMapSize:new ze,shadowCameraNear:1,shadowCameraFar:1e3};break}return n[e.id]=t,t}}}let mJ=0;function gJ(n,e){return(e.castShadow?2:0)-(n.castShadow?2:0)+(e.map?1:0)-(n.map?1:0)}function vJ(n,e){const t=new dJ,r=pJ(),i={version:0,hash:{directionalLength:-1,pointLength:-1,spotLength:-1,rectAreaLength:-1,hemiLength:-1,numDirectionalShadows:-1,numPointShadows:-1,numSpotShadows:-1,numSpotMaps:-1},ambient:[0,0,0],probe:[],directional:[],directionalShadow:[],directionalShadowMap:[],directionalShadowMatrix:[],spot:[],spotLightMap:[],spotShadow:[],spotShadowMap:[],spotLightMatrix:[],rectArea:[],rectAreaLTC1:null,rectAreaLTC2:null,point:[],pointShadow:[],pointShadowMap:[],pointShadowMatrix:[],hemi:[],numSpotLightShadowsWithMaps:0};for(let c=0;c<9;c++)i.probe.push(new Z);const s=new Z,o=new Lt,a=new Lt;function l(c,f){let p=0,m=0,g=0;for(let U=0;U<9;U++)i.probe[U].set(0,0,0);let v=0,y=0,w=0,_=0,x=0,A=0,C=0,b=0,R=0,E=0;c.sort(gJ);const B=f===!0?Math.PI:1;for(let U=0,z=c.length;U0&&(e.isWebGL2||n.has("OES_texture_float_linear")===!0?(i.rectAreaLTC1=at.LTC_FLOAT_1,i.rectAreaLTC2=at.LTC_FLOAT_2):n.has("OES_texture_half_float_linear")===!0?(i.rectAreaLTC1=at.LTC_HALF_1,i.rectAreaLTC2=at.LTC_HALF_2):console.error("THREE.WebGLRenderer: Unable to use RectAreaLight. Missing WebGL extensions.")),i.ambient[0]=p,i.ambient[1]=m,i.ambient[2]=g;const D=i.hash;(D.directionalLength!==v||D.pointLength!==y||D.spotLength!==w||D.rectAreaLength!==_||D.hemiLength!==x||D.numDirectionalShadows!==A||D.numPointShadows!==C||D.numSpotShadows!==b||D.numSpotMaps!==R)&&(i.directional.length=v,i.spot.length=w,i.rectArea.length=_,i.point.length=y,i.hemi.length=x,i.directionalShadow.length=A,i.directionalShadowMap.length=A,i.pointShadow.length=C,i.pointShadowMap.length=C,i.spotShadow.length=b,i.spotShadowMap.length=b,i.directionalShadowMatrix.length=A,i.pointShadowMatrix.length=C,i.spotLightMatrix.length=b+R-E,i.spotLightMap.length=R,i.numSpotLightShadowsWithMaps=E,D.directionalLength=v,D.pointLength=y,D.spotLength=w,D.rectAreaLength=_,D.hemiLength=x,D.numDirectionalShadows=A,D.numPointShadows=C,D.numSpotShadows=b,D.numSpotMaps=R,i.version=mJ++)}function u(c,f){let p=0,m=0,g=0,v=0,y=0;const w=f.matrixWorldInverse;for(let _=0,x=c.length;_=a.length?(l=new JT(n,e),a.push(l)):l=a[o],l}function i(){t=new WeakMap}return{get:r,dispose:i}}class Cp extends fr{constructor(e){super(),this.isMeshDepthMaterial=!0,this.type="MeshDepthMaterial",this.depthPacking=ZL,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 xy extends fr{constructor(e){super(),this.isMeshDistanceMaterial=!0,this.type="MeshDistanceMaterial",this.referencePosition=new Z,this.nearDistance=1,this.farDistance=1e3,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.referencePosition.copy(e.referencePosition),this.nearDistance=e.nearDistance,this.farDistance=e.farDistance,this.map=e.map,this.alphaMap=e.alphaMap,this.displacementMap=e.displacementMap,this.displacementScale=e.displacementScale,this.displacementBias=e.displacementBias,this}}const xJ=`void main() { - gl_Position = vec4( position, 1.0 ); -}`,_J=`uniform sampler2D shadow_pass; -uniform vec2 resolution; -uniform float radius; -#include -void main() { - const float samples = float( VSM_SAMPLES ); - float mean = 0.0; - float squared_mean = 0.0; - float uvStride = samples <= 1.0 ? 0.0 : 2.0 / ( samples - 1.0 ); - float uvStart = samples <= 1.0 ? 0.0 : - 1.0; - for ( float i = 0.0; i < samples; i ++ ) { - float uvOffset = uvStart + i * uvStride; - #ifdef HORIZONTAL_PASS - vec2 distribution = unpackRGBATo2Half( texture2D( shadow_pass, ( gl_FragCoord.xy + vec2( uvOffset, 0.0 ) * radius ) / resolution ) ); - mean += distribution.x; - squared_mean += distribution.y * distribution.y + distribution.x * distribution.x; - #else - float depth = unpackRGBAToDepth( texture2D( shadow_pass, ( gl_FragCoord.xy + vec2( 0.0, uvOffset ) * radius ) / resolution ) ); - mean += depth; - squared_mean += depth * depth; - #endif - } - mean = mean / samples; - squared_mean = squared_mean / samples; - float std_dev = sqrt( squared_mean - mean * mean ); - gl_FragColor = pack2HalfToRGBA( vec2( mean, std_dev ) ); -}`;function wJ(n,e,t){let r=new vy;const i=new ze,s=new ze,o=new vn,a=new Cp({depthPacking:SM}),l=new xy,u={},c=t.maxTextureSize,f={[Ys]:vi,[vi]:Ys,[$i]:$i},p=new Oi({defines:{VSM_SAMPLES:8},uniforms:{shadow_pass:{value:null},resolution:{value:new ze},radius:{value:4}},vertexShader:xJ,fragmentShader:_J}),m=p.clone();m.defines.HORIZONTAL_PASS=1;const g=new Ut;g.setAttribute("position",new mn(new Float32Array([-1,-1,.5,3,-1,.5,-1,3,.5]),3));const v=new Vn(g,p),y=this;this.enabled=!1,this.autoUpdate=!0,this.needsUpdate=!1,this.type=fy,this.render=function(A,C,b){if(y.enabled===!1||y.autoUpdate===!1&&y.needsUpdate===!1||A.length===0)return;const R=n.getRenderTarget(),E=n.getActiveCubeFace(),B=n.getActiveMipmapLevel(),D=n.state;D.setBlending(sa),D.buffers.color.setClear(1,1,1,1),D.buffers.depth.setTest(!0),D.setScissorTest(!1);for(let U=0,z=A.length;Uc||i.y>c)&&(i.x>c&&(s.x=Math.floor(c/F.x),i.x=s.x*F.x,P.mapSize.x=s.x),i.y>c&&(s.y=Math.floor(c/F.y),i.y=s.y*F.y,P.mapSize.y=s.y)),P.map===null){const ie=this.type!==su?{minFilter:Zn,magFilter:Zn}:{};P.map=new ri(i.x,i.y,ie),P.map.texture.name=Y.name+".shadowMap",P.camera.updateProjectionMatrix()}n.setRenderTarget(P.map),n.clear();const G=P.getViewportCount();for(let ie=0;ie0||C.map&&C.alphaTest>0){const z=D.uuid,Y=C.uuid;let P=u[z];P===void 0&&(P={},u[z]=P);let F=P[Y];F===void 0&&(F=D.clone(),P[Y]=F),D=F}return D.visible=C.visible,D.wireframe=C.wireframe,B===su?D.side=C.shadowSide!==null?C.shadowSide:C.side:D.side=C.shadowSide!==null?C.shadowSide:f[C.side],D.alphaMap=C.alphaMap,D.alphaTest=C.alphaTest,D.map=C.map,D.clipShadows=C.clipShadows,D.clippingPlanes=C.clippingPlanes,D.clipIntersection=C.clipIntersection,D.displacementMap=C.displacementMap,D.displacementScale=C.displacementScale,D.displacementBias=C.displacementBias,D.wireframeLinewidth=C.wireframeLinewidth,D.linewidth=C.linewidth,b.isPointLight===!0&&D.isMeshDistanceMaterial===!0&&(D.referencePosition.setFromMatrixPosition(b.matrixWorld),D.nearDistance=R,D.farDistance=E),D}function x(A,C,b,R,E){if(A.visible===!1)return;if(A.layers.test(C.layers)&&(A.isMesh||A.isLine||A.isPoints)&&(A.castShadow||A.receiveShadow&&E===su)&&(!A.frustumCulled||r.intersectsObject(A))){A.modelViewMatrix.multiplyMatrices(b.matrixWorldInverse,A.matrixWorld);const U=e.update(A),z=A.material;if(Array.isArray(z)){const Y=U.groups;for(let P=0,F=Y.length;P=1):N.indexOf("OpenGL ES")!==-1&&(ie=parseFloat(/^OpenGL ES (\d)/.exec(N)[1]),G=ie>=2);let V=null,j={};const W=n.getParameter(3088),k=n.getParameter(2978),Q=new vn().fromArray(W),q=new vn().fromArray(k);function X(ue,ce,Ue){const ot=new Uint8Array(4),ct=n.createTexture();n.bindTexture(ue,ct),n.texParameteri(ue,10241,9728),n.texParameteri(ue,10240,9728);for(let Ht=0;Ht"u"?!1:/OculusBrowser/g.test(navigator.userAgent),g=new WeakMap;let v;const y=new WeakMap;let w=!1;try{w=typeof OffscreenCanvas<"u"&&new OffscreenCanvas(1,1).getContext("2d")!==null}catch{}function _(K,O){return w?new OffscreenCanvas(K,O):ep("canvas")}function x(K,O,le,_e){let Ge=1;if((K.width>_e||K.height>_e)&&(Ge=_e/Math.max(K.width,K.height)),Ge<1||O===!0)if(typeof HTMLImageElement<"u"&&K instanceof HTMLImageElement||typeof HTMLCanvasElement<"u"&&K instanceof HTMLCanvasElement||typeof ImageBitmap<"u"&&K instanceof ImageBitmap){const Je=O?eD:Math.floor,Ve=Je(Ge*K.width),Ye=Je(Ge*K.height);v===void 0&&(v=_(Ve,Ye));const Le=le?_(Ve,Ye):v;return Le.width=Ve,Le.height=Ye,Le.getContext("2d").drawImage(K,0,0,Ve,Ye),console.warn("THREE.WebGLRenderer: Texture has been resized from ("+K.width+"x"+K.height+") to ("+Ve+"x"+Ye+")."),Le}else return"data"in K&&console.warn("THREE.WebGLRenderer: Image in DataTexture is too big ("+K.width+"x"+K.height+")."),K;return K}function A(K){return mS(K.width)&&mS(K.height)}function C(K){return a?!1:K.wrapS!==Ur||K.wrapT!==Ur||K.minFilter!==Zn&&K.minFilter!==gn}function b(K,O){return K.generateMipmaps&&O&&K.minFilter!==Zn&&K.minFilter!==gn}function R(K){n.generateMipmap(K)}function E(K,O,le,_e,Ge=!1){if(a===!1)return O;if(K!==null){if(n[K]!==void 0)return n[K];console.warn("THREE.WebGLRenderer: Attempt to use non-existing WebGL internal format '"+K+"'")}let Je=O;return O===6403&&(le===5126&&(Je=33326),le===5131&&(Je=33325),le===5121&&(Je=33321)),O===33319&&(le===5126&&(Je=33328),le===5131&&(Je=33327),le===5121&&(Je=33323)),O===6408&&(le===5126&&(Je=34836),le===5131&&(Je=34842),le===5121&&(Je=_e===wn&&Ge===!1?35907:32856),le===32819&&(Je=32854),le===32820&&(Je=32855)),(Je===33325||Je===33326||Je===33327||Je===33328||Je===34842||Je===34836)&&e.get("EXT_color_buffer_float"),Je}function B(K,O,le){return b(K,le)===!0||K.isFramebufferTexture&&K.minFilter!==Zn&&K.minFilter!==gn?Math.log2(Math.max(O.width,O.height))+1:K.mipmaps!==void 0&&K.mipmaps.length>0?K.mipmaps.length:K.isCompressedTexture&&Array.isArray(K.image)?O.mipmaps.length:1}function D(K){return K===Zn||K===Zd||K===Qc?9728:9729}function U(K){const O=K.target;O.removeEventListener("dispose",U),Y(O),O.isVideoTexture&&g.delete(O)}function z(K){const O=K.target;O.removeEventListener("dispose",z),F(O)}function Y(K){const O=r.get(K);if(O.__webglInit===void 0)return;const le=K.source,_e=y.get(le);if(_e){const Ge=_e[O.__cacheKey];Ge.usedTimes--,Ge.usedTimes===0&&P(K),Object.keys(_e).length===0&&y.delete(le)}r.remove(K)}function P(K){const O=r.get(K);n.deleteTexture(O.__webglTexture);const le=K.source,_e=y.get(le);delete _e[O.__cacheKey],o.memory.textures--}function F(K){const O=K.texture,le=r.get(K),_e=r.get(O);if(_e.__webglTexture!==void 0&&(n.deleteTexture(_e.__webglTexture),o.memory.textures--),K.depthTexture&&K.depthTexture.dispose(),K.isWebGLCubeRenderTarget)for(let Ge=0;Ge<6;Ge++)n.deleteFramebuffer(le.__webglFramebuffer[Ge]),le.__webglDepthbuffer&&n.deleteRenderbuffer(le.__webglDepthbuffer[Ge]);else{if(n.deleteFramebuffer(le.__webglFramebuffer),le.__webglDepthbuffer&&n.deleteRenderbuffer(le.__webglDepthbuffer),le.__webglMultisampledFramebuffer&&n.deleteFramebuffer(le.__webglMultisampledFramebuffer),le.__webglColorRenderbuffer)for(let Ge=0;Ge=l&&console.warn("THREE.WebGLTextures: Trying to use "+K+" texture units while this GPU supports only "+l),G+=1,K}function V(K){const O=[];return O.push(K.wrapS),O.push(K.wrapT),O.push(K.wrapR||0),O.push(K.magFilter),O.push(K.minFilter),O.push(K.anisotropy),O.push(K.internalFormat),O.push(K.format),O.push(K.type),O.push(K.generateMipmaps),O.push(K.premultiplyAlpha),O.push(K.flipY),O.push(K.unpackAlignment),O.push(K.encoding),O.join()}function j(K,O){const le=r.get(K);if(K.isVideoTexture&&He(K),K.isRenderTargetTexture===!1&&K.version>0&&le.__version!==K.version){const _e=K.image;if(_e===null)console.warn("THREE.WebGLRenderer: Texture marked for update but no image data found.");else if(_e.complete===!1)console.warn("THREE.WebGLRenderer: Texture marked for update but image is incomplete");else{re(le,K,O);return}}t.bindTexture(3553,le.__webglTexture,33984+O)}function W(K,O){const le=r.get(K);if(K.version>0&&le.__version!==K.version){re(le,K,O);return}t.bindTexture(35866,le.__webglTexture,33984+O)}function k(K,O){const le=r.get(K);if(K.version>0&&le.__version!==K.version){re(le,K,O);return}t.bindTexture(32879,le.__webglTexture,33984+O)}function Q(K,O){const le=r.get(K);if(K.version>0&&le.__version!==K.version){me(le,K,O);return}t.bindTexture(34067,le.__webglTexture,33984+O)}const q={[dl]:10497,[Ur]:33071,[vf]:33648},X={[Zn]:9728,[Zd]:9984,[Qc]:9986,[gn]:9729,[dy]:9985,[Ao]:9987};function J(K,O,le){if(le?(n.texParameteri(K,10242,q[O.wrapS]),n.texParameteri(K,10243,q[O.wrapT]),(K===32879||K===35866)&&n.texParameteri(K,32882,q[O.wrapR]),n.texParameteri(K,10240,X[O.magFilter]),n.texParameteri(K,10241,X[O.minFilter])):(n.texParameteri(K,10242,33071),n.texParameteri(K,10243,33071),(K===32879||K===35866)&&n.texParameteri(K,32882,33071),(O.wrapS!==Ur||O.wrapT!==Ur)&&console.warn("THREE.WebGLRenderer: Texture is not power of two. Texture.wrapS and Texture.wrapT should be set to THREE.ClampToEdgeWrapping."),n.texParameteri(K,10240,D(O.magFilter)),n.texParameteri(K,10241,D(O.minFilter)),O.minFilter!==Zn&&O.minFilter!==gn&&console.warn("THREE.WebGLRenderer: Texture is not power of two. Texture.minFilter should be set to THREE.NearestFilter or THREE.LinearFilter.")),e.has("EXT_texture_filter_anisotropic")===!0){const _e=e.get("EXT_texture_filter_anisotropic");if(O.magFilter===Zn||O.minFilter!==Qc&&O.minFilter!==Ao||O.type===zr&&e.has("OES_texture_float_linear")===!1||a===!1&&O.type===Gr&&e.has("OES_texture_half_float_linear")===!1)return;(O.anisotropy>1||r.get(O).__currentAnisotropy)&&(n.texParameterf(K,_e.TEXTURE_MAX_ANISOTROPY_EXT,Math.min(O.anisotropy,i.getMaxAnisotropy())),r.get(O).__currentAnisotropy=O.anisotropy)}}function ae(K,O){let le=!1;K.__webglInit===void 0&&(K.__webglInit=!0,O.addEventListener("dispose",U));const _e=O.source;let Ge=y.get(_e);Ge===void 0&&(Ge={},y.set(_e,Ge));const Je=V(O);if(Je!==K.__cacheKey){Ge[Je]===void 0&&(Ge[Je]={texture:n.createTexture(),usedTimes:0},o.memory.textures++,le=!0),Ge[Je].usedTimes++;const Ve=Ge[K.__cacheKey];Ve!==void 0&&(Ge[K.__cacheKey].usedTimes--,Ve.usedTimes===0&&P(O)),K.__cacheKey=Je,K.__webglTexture=Ge[Je].texture}return le}function re(K,O,le){let _e=3553;(O.isDataArrayTexture||O.isCompressedArrayTexture)&&(_e=35866),O.isData3DTexture&&(_e=32879);const Ge=ae(K,O),Je=O.source;t.bindTexture(_e,K.__webglTexture,33984+le);const Ve=r.get(Je);if(Je.version!==Ve.__version||Ge===!0){t.activeTexture(33984+le),n.pixelStorei(37440,O.flipY),n.pixelStorei(37441,O.premultiplyAlpha),n.pixelStorei(3317,O.unpackAlignment),n.pixelStorei(37443,0);const Ye=C(O)&&A(O.image)===!1;let Le=x(O.image,Ye,!1,c);Le=Ie(O,Le);const nt=A(Le)||a,te=s.convert(O.format,O.encoding);let Ee=s.convert(O.type),be=E(O.internalFormat,te,Ee,O.encoding,O.isVideoTexture);J(_e,O,nt);let De;const Qe=O.mipmaps,lt=a&&O.isVideoTexture!==!0,yt=Ve.__version===void 0||Ge===!0,ue=B(O,Le,nt);if(O.isDepthTexture)be=6402,a?O.type===zr?be=36012:O.type===Ka?be=33190:O.type===pu?be=35056:be=33189:O.type===zr&&console.error("WebGLRenderer: Floating point depth texture requires WebGL2."),O.format===ll&&be===6402&&O.type!==yM&&O.type!==Ka&&(console.warn("THREE.WebGLRenderer: Use UnsignedShortType or UnsignedIntType for DepthFormat DepthTexture."),O.type=Ka,Ee=s.convert(O.type)),O.format===bu&&be===6402&&(be=34041,O.type!==pu&&(console.warn("THREE.WebGLRenderer: Use UnsignedInt248Type for DepthStencilFormat DepthTexture."),O.type=pu,Ee=s.convert(O.type))),yt&&(lt?t.texStorage2D(3553,1,be,Le.width,Le.height):t.texImage2D(3553,0,be,Le.width,Le.height,0,te,Ee,null));else if(O.isDataTexture)if(Qe.length>0&&nt){lt&&yt&&t.texStorage2D(3553,ue,be,Qe[0].width,Qe[0].height);for(let ce=0,Ue=Qe.length;ce>=1,Ue>>=1}}else if(Qe.length>0&&nt){lt&&yt&&t.texStorage2D(3553,ue,be,Qe[0].width,Qe[0].height);for(let ce=0,Ue=Qe.length;ce0&&yt++,t.texStorage2D(34067,yt,De,Le[0].width,Le[0].height));for(let ce=0;ce<6;ce++)if(Ye){Qe?t.texSubImage2D(34069+ce,0,0,0,Le[ce].width,Le[ce].height,Ee,be,Le[ce].data):t.texImage2D(34069+ce,0,De,Le[ce].width,Le[ce].height,0,Ee,be,Le[ce].data);for(let Ue=0;Ue=34069&&Ge<=34074)&&n.framebufferTexture2D(36160,_e,Ge,r.get(le).__webglTexture,0),t.bindFramebuffer(36160,null)}function Se(K,O,le){if(n.bindRenderbuffer(36161,K),O.depthBuffer&&!O.stencilBuffer){let _e=33189;if(le||je(O)){const Ge=O.depthTexture;Ge&&Ge.isDepthTexture&&(Ge.type===zr?_e=36012:Ge.type===Ka&&(_e=33190));const Je=Ce(O);je(O)?p.renderbufferStorageMultisampleEXT(36161,Je,_e,O.width,O.height):n.renderbufferStorageMultisample(36161,Je,_e,O.width,O.height)}else n.renderbufferStorage(36161,_e,O.width,O.height);n.framebufferRenderbuffer(36160,36096,36161,K)}else if(O.depthBuffer&&O.stencilBuffer){const _e=Ce(O);le&&je(O)===!1?n.renderbufferStorageMultisample(36161,_e,35056,O.width,O.height):je(O)?p.renderbufferStorageMultisampleEXT(36161,_e,35056,O.width,O.height):n.renderbufferStorage(36161,34041,O.width,O.height),n.framebufferRenderbuffer(36160,33306,36161,K)}else{const _e=O.isWebGLMultipleRenderTargets===!0?O.texture:[O.texture];for(let Ge=0;Ge<_e.length;Ge++){const Je=_e[Ge],Ve=s.convert(Je.format,Je.encoding),Ye=s.convert(Je.type),Le=E(Je.internalFormat,Ve,Ye,Je.encoding),nt=Ce(O);le&&je(O)===!1?n.renderbufferStorageMultisample(36161,nt,Le,O.width,O.height):je(O)?p.renderbufferStorageMultisampleEXT(36161,nt,Le,O.width,O.height):n.renderbufferStorage(36161,Le,O.width,O.height)}}n.bindRenderbuffer(36161,null)}function se(K,O){if(O&&O.isWebGLCubeRenderTarget)throw new Error("Depth Texture with cube render targets is not supported");if(t.bindFramebuffer(36160,K),!(O.depthTexture&&O.depthTexture.isDepthTexture))throw new Error("renderTarget.depthTexture must be an instance of THREE.DepthTexture");(!r.get(O.depthTexture).__webglTexture||O.depthTexture.image.width!==O.width||O.depthTexture.image.height!==O.height)&&(O.depthTexture.image.width=O.width,O.depthTexture.image.height=O.height,O.depthTexture.needsUpdate=!0),j(O.depthTexture,0);const _e=r.get(O.depthTexture).__webglTexture,Ge=Ce(O);if(O.depthTexture.format===ll)je(O)?p.framebufferTexture2DMultisampleEXT(36160,36096,3553,_e,0,Ge):n.framebufferTexture2D(36160,36096,3553,_e,0);else if(O.depthTexture.format===bu)je(O)?p.framebufferTexture2DMultisampleEXT(36160,33306,3553,_e,0,Ge):n.framebufferTexture2D(36160,33306,3553,_e,0);else throw new Error("Unknown depthTexture format")}function ye(K){const O=r.get(K),le=K.isWebGLCubeRenderTarget===!0;if(K.depthTexture&&!O.__autoAllocateDepthBuffer){if(le)throw new Error("target.depthTexture not supported in Cube render targets");se(O.__webglFramebuffer,K)}else if(le){O.__webglDepthbuffer=[];for(let _e=0;_e<6;_e++)t.bindFramebuffer(36160,O.__webglFramebuffer[_e]),O.__webglDepthbuffer[_e]=n.createRenderbuffer(),Se(O.__webglDepthbuffer[_e],K,!1)}else t.bindFramebuffer(36160,O.__webglFramebuffer),O.__webglDepthbuffer=n.createRenderbuffer(),Se(O.__webglDepthbuffer,K,!1);t.bindFramebuffer(36160,null)}function ke(K,O,le){const _e=r.get(K);O!==void 0&&Me(_e.__webglFramebuffer,K,K.texture,36064,3553),le!==void 0&&ye(K)}function Te(K){const O=K.texture,le=r.get(K),_e=r.get(O);K.addEventListener("dispose",z),K.isWebGLMultipleRenderTargets!==!0&&(_e.__webglTexture===void 0&&(_e.__webglTexture=n.createTexture()),_e.__version=O.version,o.memory.textures++);const Ge=K.isWebGLCubeRenderTarget===!0,Je=K.isWebGLMultipleRenderTargets===!0,Ve=A(K)||a;if(Ge){le.__webglFramebuffer=[];for(let Ye=0;Ye<6;Ye++)le.__webglFramebuffer[Ye]=n.createFramebuffer()}else{if(le.__webglFramebuffer=n.createFramebuffer(),Je)if(i.drawBuffers){const Ye=K.texture;for(let Le=0,nt=Ye.length;Le0&&je(K)===!1){const Ye=Je?O:[O];le.__webglMultisampledFramebuffer=n.createFramebuffer(),le.__webglColorRenderbuffer=[],t.bindFramebuffer(36160,le.__webglMultisampledFramebuffer);for(let Le=0;Le0&&je(K)===!1){const O=K.isWebGLMultipleRenderTargets?K.texture:[K.texture],le=K.width,_e=K.height;let Ge=16384;const Je=[],Ve=K.stencilBuffer?33306:36096,Ye=r.get(K),Le=K.isWebGLMultipleRenderTargets===!0;if(Le)for(let nt=0;nt0&&e.has("WEBGL_multisampled_render_to_texture")===!0&&O.__useRenderToTexture!==!1}function He(K){const O=o.render.frame;g.get(K)!==O&&(g.set(K,O),K.update())}function Ie(K,O){const le=K.encoding,_e=K.format,Ge=K.type;return K.isCompressedTexture===!0||K.isVideoTexture===!0||K.format===Lv||le!==ma&&(le===wn?a===!1?e.has("EXT_sRGB")===!0&&_e===mi?(K.format=Lv,K.minFilter=gn,K.generateMipmaps=!1):O=EM.sRGBToLinear(O):(_e!==mi||Ge!==pa)&&console.warn("THREE.WebGLTextures: sRGB encoded textures have to use RGBAFormat and UnsignedByteType."):console.error("THREE.WebGLTextures: Unsupported texture encoding:",le)),O}this.allocateTextureUnit=N,this.resetTextureUnits=ie,this.setTexture2D=j,this.setTexture2DArray=W,this.setTexture3D=k,this.setTextureCube=Q,this.rebindTextures=ke,this.setupRenderTarget=Te,this.updateRenderTargetMipmap=Pe,this.updateMultisampleRenderTarget=We,this.setupDepthRenderbuffer=ye,this.setupFrameBufferTexture=Me,this.useMultisampledRTT=je}function cD(n,e,t){const r=t.isWebGL2;function i(s,o=null){let a;if(s===pa)return 5121;if(s===kL)return 32819;if(s===FL)return 32820;if(s===IL)return 5120;if(s===LL)return 5122;if(s===yM)return 5123;if(s===DL)return 5124;if(s===Ka)return 5125;if(s===zr)return 5126;if(s===Gr)return r?5131:(a=e.get("OES_texture_half_float"),a!==null?a.HALF_FLOAT_OES:null);if(s===NL)return 6406;if(s===mi)return 6408;if(s===OL)return 6409;if(s===UL)return 6410;if(s===ll)return 6402;if(s===bu)return 34041;if(s===Lv)return a=e.get("EXT_sRGB"),a!==null?a.SRGB_ALPHA_EXT:null;if(s===xM)return 6403;if(s===zL)return 36244;if(s===GL)return 33319;if(s===HL)return 33320;if(s===VL)return 36249;if(s===x0||s===_0||s===w0||s===S0)if(o===wn)if(a=e.get("WEBGL_compressed_texture_s3tc_srgb"),a!==null){if(s===x0)return a.COMPRESSED_SRGB_S3TC_DXT1_EXT;if(s===_0)return a.COMPRESSED_SRGB_ALPHA_S3TC_DXT1_EXT;if(s===w0)return a.COMPRESSED_SRGB_ALPHA_S3TC_DXT3_EXT;if(s===S0)return a.COMPRESSED_SRGB_ALPHA_S3TC_DXT5_EXT}else return null;else if(a=e.get("WEBGL_compressed_texture_s3tc"),a!==null){if(s===x0)return a.COMPRESSED_RGB_S3TC_DXT1_EXT;if(s===_0)return a.COMPRESSED_RGBA_S3TC_DXT1_EXT;if(s===w0)return a.COMPRESSED_RGBA_S3TC_DXT3_EXT;if(s===S0)return a.COMPRESSED_RGBA_S3TC_DXT5_EXT}else return null;if(s===Jw||s===jw||s===Xw||s===Yw)if(a=e.get("WEBGL_compressed_texture_pvrtc"),a!==null){if(s===Jw)return a.COMPRESSED_RGB_PVRTC_4BPPV1_IMG;if(s===jw)return a.COMPRESSED_RGB_PVRTC_2BPPV1_IMG;if(s===Xw)return a.COMPRESSED_RGBA_PVRTC_4BPPV1_IMG;if(s===Yw)return a.COMPRESSED_RGBA_PVRTC_2BPPV1_IMG}else return null;if(s===WL)return a=e.get("WEBGL_compressed_texture_etc1"),a!==null?a.COMPRESSED_RGB_ETC1_WEBGL:null;if(s===Kw||s===Zw)if(a=e.get("WEBGL_compressed_texture_etc"),a!==null){if(s===Kw)return o===wn?a.COMPRESSED_SRGB8_ETC2:a.COMPRESSED_RGB8_ETC2;if(s===Zw)return o===wn?a.COMPRESSED_SRGB8_ALPHA8_ETC2_EAC:a.COMPRESSED_RGBA8_ETC2_EAC}else return null;if(s===Qw||s===qw||s===$w||s===eS||s===tS||s===nS||s===rS||s===iS||s===sS||s===oS||s===aS||s===lS||s===uS||s===cS)if(a=e.get("WEBGL_compressed_texture_astc"),a!==null){if(s===Qw)return o===wn?a.COMPRESSED_SRGB8_ALPHA8_ASTC_4x4_KHR:a.COMPRESSED_RGBA_ASTC_4x4_KHR;if(s===qw)return o===wn?a.COMPRESSED_SRGB8_ALPHA8_ASTC_5x4_KHR:a.COMPRESSED_RGBA_ASTC_5x4_KHR;if(s===$w)return o===wn?a.COMPRESSED_SRGB8_ALPHA8_ASTC_5x5_KHR:a.COMPRESSED_RGBA_ASTC_5x5_KHR;if(s===eS)return o===wn?a.COMPRESSED_SRGB8_ALPHA8_ASTC_6x5_KHR:a.COMPRESSED_RGBA_ASTC_6x5_KHR;if(s===tS)return o===wn?a.COMPRESSED_SRGB8_ALPHA8_ASTC_6x6_KHR:a.COMPRESSED_RGBA_ASTC_6x6_KHR;if(s===nS)return o===wn?a.COMPRESSED_SRGB8_ALPHA8_ASTC_8x5_KHR:a.COMPRESSED_RGBA_ASTC_8x5_KHR;if(s===rS)return o===wn?a.COMPRESSED_SRGB8_ALPHA8_ASTC_8x6_KHR:a.COMPRESSED_RGBA_ASTC_8x6_KHR;if(s===iS)return o===wn?a.COMPRESSED_SRGB8_ALPHA8_ASTC_8x8_KHR:a.COMPRESSED_RGBA_ASTC_8x8_KHR;if(s===sS)return o===wn?a.COMPRESSED_SRGB8_ALPHA8_ASTC_10x5_KHR:a.COMPRESSED_RGBA_ASTC_10x5_KHR;if(s===oS)return o===wn?a.COMPRESSED_SRGB8_ALPHA8_ASTC_10x6_KHR:a.COMPRESSED_RGBA_ASTC_10x6_KHR;if(s===aS)return o===wn?a.COMPRESSED_SRGB8_ALPHA8_ASTC_10x8_KHR:a.COMPRESSED_RGBA_ASTC_10x8_KHR;if(s===lS)return o===wn?a.COMPRESSED_SRGB8_ALPHA8_ASTC_10x10_KHR:a.COMPRESSED_RGBA_ASTC_10x10_KHR;if(s===uS)return o===wn?a.COMPRESSED_SRGB8_ALPHA8_ASTC_12x10_KHR:a.COMPRESSED_RGBA_ASTC_12x10_KHR;if(s===cS)return o===wn?a.COMPRESSED_SRGB8_ALPHA8_ASTC_12x12_KHR:a.COMPRESSED_RGBA_ASTC_12x12_KHR}else return null;if(s===A0)if(a=e.get("EXT_texture_compression_bptc"),a!==null){if(s===A0)return o===wn?a.COMPRESSED_SRGB_ALPHA_BPTC_UNORM_EXT:a.COMPRESSED_RGBA_BPTC_UNORM_EXT}else return null;if(s===JL||s===fS||s===hS||s===dS)if(a=e.get("EXT_texture_compression_rgtc"),a!==null){if(s===A0)return a.COMPRESSED_RED_RGTC1_EXT;if(s===fS)return a.COMPRESSED_SIGNED_RED_RGTC1_EXT;if(s===hS)return a.COMPRESSED_RED_GREEN_RGTC2_EXT;if(s===dS)return a.COMPRESSED_SIGNED_RED_GREEN_RGTC2_EXT}else return null;return s===pu?r?34042:(a=e.get("WEBGL_depth_texture"),a!==null?a.UNSIGNED_INT_24_8_WEBGL:null):n[s]!==void 0?n[s]:null}return{convert:i}}class fD extends Qn{constructor(e=[]){super(),this.isArrayCamera=!0,this.cameras=e}}class ra extends sn{constructor(){super(),this.isGroup=!0,this.type="Group"}}const MJ={type:"move"};class Rx{constructor(){this._targetRay=null,this._grip=null,this._hand=null}getHandSpace(){return this._hand===null&&(this._hand=new ra,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 ra,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 ra,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 r of e.hand.values())this._getHandJoint(t,r)}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,r){let i=null,s=null,o=null;const a=this._targetRay,l=this._grip,u=this._hand;if(e&&t.session.visibilityState!=="visible-blurred"){if(u&&e.hand){o=!0;for(const v of e.hand.values()){const y=t.getJointPose(v,r),w=this._getHandJoint(u,v);y!==null&&(w.matrix.fromArray(y.transform.matrix),w.matrix.decompose(w.position,w.rotation,w.scale),w.jointRadius=y.radius),w.visible=y!==null}const c=u.joints["index-finger-tip"],f=u.joints["thumb-tip"],p=c.position.distanceTo(f.position),m=.02,g=.005;u.inputState.pinching&&p>m+g?(u.inputState.pinching=!1,this.dispatchEvent({type:"pinchend",handedness:e.handedness,target:this})):!u.inputState.pinching&&p<=m-g&&(u.inputState.pinching=!0,this.dispatchEvent({type:"pinchstart",handedness:e.handedness,target:this}))}else l!==null&&e.gripSpace&&(s=t.getPose(e.gripSpace,r),s!==null&&(l.matrix.fromArray(s.transform.matrix),l.matrix.decompose(l.position,l.rotation,l.scale),s.linearVelocity?(l.hasLinearVelocity=!0,l.linearVelocity.copy(s.linearVelocity)):l.hasLinearVelocity=!1,s.angularVelocity?(l.hasAngularVelocity=!0,l.angularVelocity.copy(s.angularVelocity)):l.hasAngularVelocity=!1));a!==null&&(i=t.getPose(e.targetRaySpace,r),i===null&&s!==null&&(i=s),i!==null&&(a.matrix.fromArray(i.transform.matrix),a.matrix.decompose(a.position,a.rotation,a.scale),i.linearVelocity?(a.hasLinearVelocity=!0,a.linearVelocity.copy(i.linearVelocity)):a.hasLinearVelocity=!1,i.angularVelocity?(a.hasAngularVelocity=!0,a.angularVelocity.copy(i.angularVelocity)):a.hasAngularVelocity=!1,this.dispatchEvent(MJ)))}return a!==null&&(a.visible=i!==null),l!==null&&(l.visible=s!==null),u!==null&&(u.visible=o!==null),this}_getHandJoint(e,t){if(e.joints[t.jointName]===void 0){const r=new ra;r.matrixAutoUpdate=!1,r.visible=!1,e.joints[t.jointName]=r,e.add(r)}return e.joints[t.jointName]}}class PM extends Rn{constructor(e,t,r,i,s,o,a,l,u,c){if(c=c!==void 0?c:ll,c!==ll&&c!==bu)throw new Error("DepthTexture format must be either THREE.DepthFormat or THREE.DepthStencilFormat");r===void 0&&c===ll&&(r=Ka),r===void 0&&c===bu&&(r=pu),super(null,i,s,o,a,l,c,r,u),this.isDepthTexture=!0,this.image={width:e,height:t},this.magFilter=a!==void 0?a:Zn,this.minFilter=l!==void 0?l:Zn,this.flipY=!1,this.generateMipmaps=!1}}class EJ extends bo{constructor(e,t){super();const r=this;let i=null,s=1,o=null,a="local-floor",l=1,u=null,c=null,f=null,p=null,m=null,g=null;const v=t.getContextAttributes();let y=null,w=null;const _=[],x=[],A=new Set,C=new Map,b=new Qn;b.layers.enable(1),b.viewport=new vn;const R=new Qn;R.layers.enable(2),R.viewport=new vn;const E=[b,R],B=new fD;B.layers.enable(1),B.layers.enable(2);let D=null,U=null;this.cameraAutoUpdate=!0,this.enabled=!1,this.isPresenting=!1,this.getController=function(k){let Q=_[k];return Q===void 0&&(Q=new Rx,_[k]=Q),Q.getTargetRaySpace()},this.getControllerGrip=function(k){let Q=_[k];return Q===void 0&&(Q=new Rx,_[k]=Q),Q.getGripSpace()},this.getHand=function(k){let Q=_[k];return Q===void 0&&(Q=new Rx,_[k]=Q),Q.getHandSpace()};function z(k){const Q=x.indexOf(k.inputSource);if(Q===-1)return;const q=_[Q];q!==void 0&&q.dispatchEvent({type:k.type,data:k.inputSource})}function Y(){i.removeEventListener("select",z),i.removeEventListener("selectstart",z),i.removeEventListener("selectend",z),i.removeEventListener("squeeze",z),i.removeEventListener("squeezestart",z),i.removeEventListener("squeezeend",z),i.removeEventListener("end",Y),i.removeEventListener("inputsourceschange",P);for(let k=0;k<_.length;k++){const Q=x[k];Q!==null&&(x[k]=null,_[k].disconnect(Q))}D=null,U=null,e.setRenderTarget(y),m=null,p=null,f=null,i=null,w=null,W.stop(),r.isPresenting=!1,r.dispatchEvent({type:"sessionend"})}this.setFramebufferScaleFactor=function(k){s=k,r.isPresenting===!0&&console.warn("THREE.WebXRManager: Cannot change framebuffer scale while presenting.")},this.setReferenceSpaceType=function(k){a=k,r.isPresenting===!0&&console.warn("THREE.WebXRManager: Cannot change reference space type while presenting.")},this.getReferenceSpace=function(){return u||o},this.setReferenceSpace=function(k){u=k},this.getBaseLayer=function(){return p!==null?p:m},this.getBinding=function(){return f},this.getFrame=function(){return g},this.getSession=function(){return i},this.setSession=async function(k){if(i=k,i!==null){if(y=e.getRenderTarget(),i.addEventListener("select",z),i.addEventListener("selectstart",z),i.addEventListener("selectend",z),i.addEventListener("squeeze",z),i.addEventListener("squeezestart",z),i.addEventListener("squeezeend",z),i.addEventListener("end",Y),i.addEventListener("inputsourceschange",P),v.xrCompatible!==!0&&await t.makeXRCompatible(),i.renderState.layers===void 0||e.capabilities.isWebGL2===!1){const Q={antialias:i.renderState.layers===void 0?v.antialias:!0,alpha:v.alpha,depth:v.depth,stencil:v.stencil,framebufferScaleFactor:s};m=new XRWebGLLayer(i,t,Q),i.updateRenderState({baseLayer:m}),w=new ri(m.framebufferWidth,m.framebufferHeight,{format:mi,type:pa,encoding:e.outputEncoding,stencilBuffer:v.stencil})}else{let Q=null,q=null,X=null;v.depth&&(X=v.stencil?35056:33190,Q=v.stencil?bu:ll,q=v.stencil?pu:Ka);const J={colorFormat:32856,depthFormat:X,scaleFactor:s};f=new XRWebGLBinding(i,t),p=f.createProjectionLayer(J),i.updateRenderState({layers:[p]}),w=new ri(p.textureWidth,p.textureHeight,{format:mi,type:pa,depthTexture:new PM(p.textureWidth,p.textureHeight,q,void 0,void 0,void 0,void 0,void 0,void 0,Q),stencilBuffer:v.stencil,encoding:e.outputEncoding,samples:v.antialias?4:0});const ae=e.properties.get(w);ae.__ignoreDepthValues=p.ignoreDepthValues}w.isXRRenderTarget=!0,this.setFoveation(l),u=null,o=await i.requestReferenceSpace(a),W.setContext(i),W.start(),r.isPresenting=!0,r.dispatchEvent({type:"sessionstart"})}};function P(k){for(let Q=0;Q=0&&(x[X]=null,_[X].disconnect(q))}for(let Q=0;Q=x.length){x.push(q),X=ae;break}else if(x[ae]===null){x[ae]=q,X=ae;break}if(X===-1)break}const J=_[X];J&&J.connect(q)}}const F=new Z,G=new Z;function ie(k,Q,q){F.setFromMatrixPosition(Q.matrixWorld),G.setFromMatrixPosition(q.matrixWorld);const X=F.distanceTo(G),J=Q.projectionMatrix.elements,ae=q.projectionMatrix.elements,re=J[14]/(J[10]-1),me=J[14]/(J[10]+1),Me=(J[9]+1)/J[5],Se=(J[9]-1)/J[5],se=(J[8]-1)/J[0],ye=(ae[8]+1)/ae[0],ke=re*se,Te=re*ye,Pe=X/(-se+ye),We=Pe*-se;Q.matrixWorld.decompose(k.position,k.quaternion,k.scale),k.translateX(We),k.translateZ(Pe),k.matrixWorld.compose(k.position,k.quaternion,k.scale),k.matrixWorldInverse.copy(k.matrixWorld).invert();const Ce=re+Pe,je=me+Pe,He=ke-We,Ie=Te+(X-We),K=Me*me/je*Ce,O=Se*me/je*Ce;k.projectionMatrix.makePerspective(He,Ie,K,O,Ce,je)}function N(k,Q){Q===null?k.matrixWorld.copy(k.matrix):k.matrixWorld.multiplyMatrices(Q.matrixWorld,k.matrix),k.matrixWorldInverse.copy(k.matrixWorld).invert()}this.updateCamera=function(k){if(i===null)return;B.near=R.near=b.near=k.near,B.far=R.far=b.far=k.far,(D!==B.near||U!==B.far)&&(i.updateRenderState({depthNear:B.near,depthFar:B.far}),D=B.near,U=B.far);const Q=k.parent,q=B.cameras;N(B,Q);for(let J=0;JJ&&(C.set(X,X.lastChangedTime),r.dispatchEvent({type:"planechanged",data:X}))}}g=null}const W=new sD;W.setAnimationLoop(j),this.setAnimationLoop=function(k){V=k},this.dispose=function(){}}}function CJ(n,e){function t(v,y){y.color.getRGB(v.fogColor.value,rD(n)),y.isFog?(v.fogNear.value=y.near,v.fogFar.value=y.far):y.isFogExp2&&(v.fogDensity.value=y.density)}function r(v,y,w,_,x){y.isMeshBasicMaterial||y.isMeshLambertMaterial?i(v,y):y.isMeshToonMaterial?(i(v,y),c(v,y)):y.isMeshPhongMaterial?(i(v,y),u(v,y)):y.isMeshStandardMaterial?(i(v,y),f(v,y),y.isMeshPhysicalMaterial&&p(v,y,x)):y.isMeshMatcapMaterial?(i(v,y),m(v,y)):y.isMeshDepthMaterial?i(v,y):y.isMeshDistanceMaterial?(i(v,y),g(v,y)):y.isMeshNormalMaterial?i(v,y):y.isLineBasicMaterial?(s(v,y),y.isLineDashedMaterial&&o(v,y)):y.isPointsMaterial?a(v,y,w,_):y.isSpriteMaterial?l(v,y):y.isShadowMaterial?(v.color.value.copy(y.color),v.opacity.value=y.opacity):y.isShaderMaterial&&(y.uniformsNeedUpdate=!1)}function i(v,y){v.opacity.value=y.opacity,y.color&&v.diffuse.value.copy(y.color),y.emissive&&v.emissive.value.copy(y.emissive).multiplyScalar(y.emissiveIntensity),y.map&&(v.map.value=y.map),y.alphaMap&&(v.alphaMap.value=y.alphaMap),y.bumpMap&&(v.bumpMap.value=y.bumpMap,v.bumpScale.value=y.bumpScale,y.side===vi&&(v.bumpScale.value*=-1)),y.displacementMap&&(v.displacementMap.value=y.displacementMap,v.displacementScale.value=y.displacementScale,v.displacementBias.value=y.displacementBias),y.emissiveMap&&(v.emissiveMap.value=y.emissiveMap),y.normalMap&&(v.normalMap.value=y.normalMap,v.normalScale.value.copy(y.normalScale),y.side===vi&&v.normalScale.value.negate()),y.specularMap&&(v.specularMap.value=y.specularMap),y.alphaTest>0&&(v.alphaTest.value=y.alphaTest);const w=e.get(y).envMap;if(w&&(v.envMap.value=w,v.flipEnvMap.value=w.isCubeTexture&&w.isRenderTargetTexture===!1?-1:1,v.reflectivity.value=y.reflectivity,v.ior.value=y.ior,v.refractionRatio.value=y.refractionRatio),y.lightMap){v.lightMap.value=y.lightMap;const A=n.useLegacyLights===!0?Math.PI:1;v.lightMapIntensity.value=y.lightMapIntensity*A}y.aoMap&&(v.aoMap.value=y.aoMap,v.aoMapIntensity.value=y.aoMapIntensity);let _;y.map?_=y.map:y.specularMap?_=y.specularMap:y.displacementMap?_=y.displacementMap:y.normalMap?_=y.normalMap:y.bumpMap?_=y.bumpMap:y.roughnessMap?_=y.roughnessMap:y.metalnessMap?_=y.metalnessMap:y.alphaMap?_=y.alphaMap:y.emissiveMap?_=y.emissiveMap:y.clearcoatMap?_=y.clearcoatMap:y.clearcoatNormalMap?_=y.clearcoatNormalMap:y.clearcoatRoughnessMap?_=y.clearcoatRoughnessMap:y.iridescenceMap?_=y.iridescenceMap:y.iridescenceThicknessMap?_=y.iridescenceThicknessMap:y.specularIntensityMap?_=y.specularIntensityMap:y.specularColorMap?_=y.specularColorMap:y.transmissionMap?_=y.transmissionMap:y.thicknessMap?_=y.thicknessMap:y.sheenColorMap?_=y.sheenColorMap:y.sheenRoughnessMap&&(_=y.sheenRoughnessMap),_!==void 0&&(_.isWebGLRenderTarget&&(_=_.texture),_.matrixAutoUpdate===!0&&_.updateMatrix(),v.uvTransform.value.copy(_.matrix));let x;y.aoMap?x=y.aoMap:y.lightMap&&(x=y.lightMap),x!==void 0&&(x.isWebGLRenderTarget&&(x=x.texture),x.matrixAutoUpdate===!0&&x.updateMatrix(),v.uv2Transform.value.copy(x.matrix))}function s(v,y){v.diffuse.value.copy(y.color),v.opacity.value=y.opacity}function o(v,y){v.dashSize.value=y.dashSize,v.totalSize.value=y.dashSize+y.gapSize,v.scale.value=y.scale}function a(v,y,w,_){v.diffuse.value.copy(y.color),v.opacity.value=y.opacity,v.size.value=y.size*w,v.scale.value=_*.5,y.map&&(v.map.value=y.map),y.alphaMap&&(v.alphaMap.value=y.alphaMap),y.alphaTest>0&&(v.alphaTest.value=y.alphaTest);let x;y.map?x=y.map:y.alphaMap&&(x=y.alphaMap),x!==void 0&&(x.matrixAutoUpdate===!0&&x.updateMatrix(),v.uvTransform.value.copy(x.matrix))}function l(v,y){v.diffuse.value.copy(y.color),v.opacity.value=y.opacity,v.rotation.value=y.rotation,y.map&&(v.map.value=y.map),y.alphaMap&&(v.alphaMap.value=y.alphaMap),y.alphaTest>0&&(v.alphaTest.value=y.alphaTest);let w;y.map?w=y.map:y.alphaMap&&(w=y.alphaMap),w!==void 0&&(w.matrixAutoUpdate===!0&&w.updateMatrix(),v.uvTransform.value.copy(w.matrix))}function u(v,y){v.specular.value.copy(y.specular),v.shininess.value=Math.max(y.shininess,1e-4)}function c(v,y){y.gradientMap&&(v.gradientMap.value=y.gradientMap)}function f(v,y){v.roughness.value=y.roughness,v.metalness.value=y.metalness,y.roughnessMap&&(v.roughnessMap.value=y.roughnessMap),y.metalnessMap&&(v.metalnessMap.value=y.metalnessMap),e.get(y).envMap&&(v.envMapIntensity.value=y.envMapIntensity)}function p(v,y,w){v.ior.value=y.ior,y.sheen>0&&(v.sheenColor.value.copy(y.sheenColor).multiplyScalar(y.sheen),v.sheenRoughness.value=y.sheenRoughness,y.sheenColorMap&&(v.sheenColorMap.value=y.sheenColorMap),y.sheenRoughnessMap&&(v.sheenRoughnessMap.value=y.sheenRoughnessMap)),y.clearcoat>0&&(v.clearcoat.value=y.clearcoat,v.clearcoatRoughness.value=y.clearcoatRoughness,y.clearcoatMap&&(v.clearcoatMap.value=y.clearcoatMap),y.clearcoatRoughnessMap&&(v.clearcoatRoughnessMap.value=y.clearcoatRoughnessMap),y.clearcoatNormalMap&&(v.clearcoatNormalScale.value.copy(y.clearcoatNormalScale),v.clearcoatNormalMap.value=y.clearcoatNormalMap,y.side===vi&&v.clearcoatNormalScale.value.negate())),y.iridescence>0&&(v.iridescence.value=y.iridescence,v.iridescenceIOR.value=y.iridescenceIOR,v.iridescenceThicknessMinimum.value=y.iridescenceThicknessRange[0],v.iridescenceThicknessMaximum.value=y.iridescenceThicknessRange[1],y.iridescenceMap&&(v.iridescenceMap.value=y.iridescenceMap),y.iridescenceThicknessMap&&(v.iridescenceThicknessMap.value=y.iridescenceThicknessMap)),y.transmission>0&&(v.transmission.value=y.transmission,v.transmissionSamplerMap.value=w.texture,v.transmissionSamplerSize.value.set(w.width,w.height),y.transmissionMap&&(v.transmissionMap.value=y.transmissionMap),v.thickness.value=y.thickness,y.thicknessMap&&(v.thicknessMap.value=y.thicknessMap),v.attenuationDistance.value=y.attenuationDistance,v.attenuationColor.value.copy(y.attenuationColor)),v.specularIntensity.value=y.specularIntensity,v.specularColor.value.copy(y.specularColor),y.specularIntensityMap&&(v.specularIntensityMap.value=y.specularIntensityMap),y.specularColorMap&&(v.specularColorMap.value=y.specularColorMap)}function m(v,y){y.matcap&&(v.matcap.value=y.matcap)}function g(v,y){v.referencePosition.value.copy(y.referencePosition),v.nearDistance.value=y.nearDistance,v.farDistance.value=y.farDistance}return{refreshFogUniforms:t,refreshMaterialUniforms:r}}function bJ(n,e,t,r){let i={},s={},o=[];const a=t.isWebGL2?n.getParameter(35375):0;function l(_,x){const A=x.program;r.uniformBlockBinding(_,A)}function u(_,x){let A=i[_.id];A===void 0&&(g(_),A=c(_),i[_.id]=A,_.addEventListener("dispose",y));const C=x.program;r.updateUBOMapping(_,C);const b=e.render.frame;s[_.id]!==b&&(p(_),s[_.id]=b)}function c(_){const x=f();_.__bindingPointIndex=x;const A=n.createBuffer(),C=_.__size,b=_.usage;return n.bindBuffer(35345,A),n.bufferData(35345,C,b),n.bindBuffer(35345,null),n.bindBufferBase(35345,x,A),A}function f(){for(let _=0;_0){b=A%C;const z=C-b;b!==0&&z-D.boundary<0&&(A+=C-b,B.__offset=A)}A+=D.storage}return b=A%C,b>0&&(A+=C-b),_.__size=A,_.__cache={},this}function v(_){const x={boundary:0,storage:0};return typeof _=="number"?(x.boundary=4,x.storage=4):_.isVector2?(x.boundary=8,x.storage=8):_.isVector3||_.isColor?(x.boundary=16,x.storage=12):_.isVector4?(x.boundary=16,x.storage=16):_.isMatrix3?(x.boundary=48,x.storage=48):_.isMatrix4?(x.boundary=64,x.storage=64):_.isTexture?console.warn("THREE.WebGLRenderer: Texture samplers can not be part of an uniforms group."):console.warn("THREE.WebGLRenderer: Unsupported uniform value type.",_),x}function y(_){const x=_.target;x.removeEventListener("dispose",y);const A=o.indexOf(x.__bindingPointIndex);o.splice(A,1),n.deleteBuffer(i[x.id]),delete i[x.id],delete s[x.id]}function w(){for(const _ in i)n.deleteBuffer(i[_]);o=[],i={},s={}}return{bind:l,update:u,dispose:w}}function TJ(){const n=ep("canvas");return n.style.display="block",n}function _y(n={}){this.isWebGLRenderer=!0;const e=n.canvas!==void 0?n.canvas:TJ(),t=n.context!==void 0?n.context:null,r=n.depth!==void 0?n.depth:!0,i=n.stencil!==void 0?n.stencil:!0,s=n.antialias!==void 0?n.antialias:!1,o=n.premultipliedAlpha!==void 0?n.premultipliedAlpha:!0,a=n.preserveDrawingBuffer!==void 0?n.preserveDrawingBuffer:!1,l=n.powerPreference!==void 0?n.powerPreference:"default",u=n.failIfMajorPerformanceCaveat!==void 0?n.failIfMajorPerformanceCaveat:!1;let c;t!==null?c=t.getContextAttributes().alpha:c=n.alpha!==void 0?n.alpha:!1;let f=null,p=null;const m=[],g=[];this.domElement=e,this.debug={checkShaderErrors:!0},this.autoClear=!0,this.autoClearColor=!0,this.autoClearDepth=!0,this.autoClearStencil=!0,this.sortObjects=!0,this.clippingPlanes=[],this.localClippingEnabled=!1,this.outputEncoding=ma,this.useLegacyLights=!0,this.toneMapping=js,this.toneMappingExposure=1;const v=this;let y=!1,w=0,_=0,x=null,A=-1,C=null;const b=new vn,R=new vn;let E=null,B=e.width,D=e.height,U=1,z=null,Y=null;const P=new vn(0,0,B,D),F=new vn(0,0,B,D);let G=!1;const ie=new vy;let N=!1,V=!1,j=null;const W=new Lt,k=new Z,Q={background:null,fog:null,environment:null,overrideMaterial:null,isScene:!0};function q(){return x===null?U:1}let X=t;function J($,Ae){for(let Be=0;Be<$.length;Be++){const fe=$[Be],Fe=e.getContext(fe,Ae);if(Fe!==null)return Fe}return null}try{const $={alpha:!0,depth:r,stencil:i,antialias:s,premultipliedAlpha:o,preserveDrawingBuffer:a,powerPreference:l,failIfMajorPerformanceCaveat:u};if("setAttribute"in e&&e.setAttribute("data-engine",`three.js r${_p}`),e.addEventListener("webglcontextlost",Ee,!1),e.addEventListener("webglcontextrestored",be,!1),e.addEventListener("webglcontextcreationerror",De,!1),X===null){const Ae=["webgl2","webgl","experimental-webgl"];if(v.isWebGL1Renderer===!0&&Ae.shift(),X=J(Ae,$),X===null)throw J(Ae)?new Error("Error creating WebGL context with your selected attributes."):new Error("Error creating WebGL context.")}X.getShaderPrecisionFormat===void 0&&(X.getShaderPrecisionFormat=function(){return{rangeMin:1,rangeMax:1,precision:1}})}catch($){throw console.error("THREE.WebGLRenderer: "+$.message),$}let ae,re,me,Me,Se,se,ye,ke,Te,Pe,We,Ce,je,He,Ie,K,O,le,_e,Ge,Je,Ve,Ye,Le;function nt(){ae=new WW(X),re=new OW(X,ae,n),ae.init(re),Ve=new cD(X,ae,re),me=new SJ(X,ae,re),Me=new XW,Se=new cJ,se=new AJ(X,ae,me,Se,re,Ve,Me),ye=new zW(v),ke=new VW(v),Te=new nH(X,re),Ye=new FW(X,ae,Te,re),Pe=new JW(X,Te,Me,Ye),We=new QW(X,Pe,Te,Me),_e=new ZW(X,re,se),K=new UW(Se),Ce=new uJ(v,ye,ke,ae,re,Ye,K),je=new CJ(v,Se),He=new hJ,Ie=new yJ(ae,re),le=new kW(v,ye,ke,me,We,c,o),O=new wJ(v,We,re),Le=new bJ(X,Me,re,me),Ge=new NW(X,ae,Me,re),Je=new jW(X,ae,Me,re),Me.programs=Ce.programs,v.capabilities=re,v.extensions=ae,v.properties=Se,v.renderLists=He,v.shadowMap=O,v.state=me,v.info=Me}nt();const te=new EJ(v,X);this.xr=te,this.getContext=function(){return X},this.getContextAttributes=function(){return X.getContextAttributes()},this.forceContextLoss=function(){const $=ae.get("WEBGL_lose_context");$&&$.loseContext()},this.forceContextRestore=function(){const $=ae.get("WEBGL_lose_context");$&&$.restoreContext()},this.getPixelRatio=function(){return U},this.setPixelRatio=function($){$!==void 0&&(U=$,this.setSize(B,D,!1))},this.getSize=function($){return $.set(B,D)},this.setSize=function($,Ae,Be=!0){if(te.isPresenting){console.warn("THREE.WebGLRenderer: Can't change size while VR device is presenting.");return}B=$,D=Ae,e.width=Math.floor($*U),e.height=Math.floor(Ae*U),Be===!0&&(e.style.width=$+"px",e.style.height=Ae+"px"),this.setViewport(0,0,$,Ae)},this.getDrawingBufferSize=function($){return $.set(B*U,D*U).floor()},this.setDrawingBufferSize=function($,Ae,Be){B=$,D=Ae,U=Be,e.width=Math.floor($*Be),e.height=Math.floor(Ae*Be),this.setViewport(0,0,$,Ae)},this.getCurrentViewport=function($){return $.copy(b)},this.getViewport=function($){return $.copy(P)},this.setViewport=function($,Ae,Be,fe){$.isVector4?P.set($.x,$.y,$.z,$.w):P.set($,Ae,Be,fe),me.viewport(b.copy(P).multiplyScalar(U).floor())},this.getScissor=function($){return $.copy(F)},this.setScissor=function($,Ae,Be,fe){$.isVector4?F.set($.x,$.y,$.z,$.w):F.set($,Ae,Be,fe),me.scissor(R.copy(F).multiplyScalar(U).floor())},this.getScissorTest=function(){return G},this.setScissorTest=function($){me.setScissorTest(G=$)},this.setOpaqueSort=function($){z=$},this.setTransparentSort=function($){Y=$},this.getClearColor=function($){return $.copy(le.getClearColor())},this.setClearColor=function(){le.setClearColor.apply(le,arguments)},this.getClearAlpha=function(){return le.getClearAlpha()},this.setClearAlpha=function(){le.setClearAlpha.apply(le,arguments)},this.clear=function($=!0,Ae=!0,Be=!0){let fe=0;$&&(fe|=16384),Ae&&(fe|=256),Be&&(fe|=1024),X.clear(fe)},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(){e.removeEventListener("webglcontextlost",Ee,!1),e.removeEventListener("webglcontextrestored",be,!1),e.removeEventListener("webglcontextcreationerror",De,!1),He.dispose(),Ie.dispose(),Se.dispose(),ye.dispose(),ke.dispose(),We.dispose(),Ye.dispose(),Le.dispose(),Ce.dispose(),te.dispose(),te.removeEventListener("sessionstart",Ue),te.removeEventListener("sessionend",ot),j&&(j.dispose(),j=null),ct.stop()};function Ee($){$.preventDefault(),console.log("THREE.WebGLRenderer: Context Lost."),y=!0}function be(){console.log("THREE.WebGLRenderer: Context Restored."),y=!1;const $=Me.autoReset,Ae=O.enabled,Be=O.autoUpdate,fe=O.needsUpdate,Fe=O.type;nt(),Me.autoReset=$,O.enabled=Ae,O.autoUpdate=Be,O.needsUpdate=fe,O.type=Fe}function De($){console.error("THREE.WebGLRenderer: A WebGL context could not be created. Reason: ",$.statusMessage)}function Qe($){const Ae=$.target;Ae.removeEventListener("dispose",Qe),lt(Ae)}function lt($){yt($),Se.remove($)}function yt($){const Ae=Se.get($).programs;Ae!==void 0&&(Ae.forEach(function(Be){Ce.releaseProgram(Be)}),$.isShaderMaterial&&Ce.releaseShaderCache($))}this.renderBufferDirect=function($,Ae,Be,fe,Fe,vt){Ae===null&&(Ae=Q);const L=Fe.isMesh&&Fe.matrixWorld.determinant()<0,H=Dr($,Ae,Be,fe,Fe);me.setMaterial(fe,L);let oe=Be.index,pe=1;fe.wireframe===!0&&(oe=Pe.getWireframeAttribute(Be),pe=2);const xe=Be.drawRange,we=Be.attributes.position;let Ke=xe.start*pe,Xe=(xe.start+xe.count)*pe;vt!==null&&(Ke=Math.max(Ke,vt.start*pe),Xe=Math.min(Xe,(vt.start+vt.count)*pe)),oe!==null?(Ke=Math.max(Ke,0),Xe=Math.min(Xe,oe.count)):we!=null&&(Ke=Math.max(Ke,0),Xe=Math.min(Xe,we.count));const qe=Xe-Ke;if(qe<0||qe===1/0)return;Ye.setup(Fe,fe,H,Be,oe);let $e,Ze=Ge;if(oe!==null&&($e=Te.get(oe),Ze=Je,Ze.setIndex($e)),Fe.isMesh)fe.wireframe===!0?(me.setLineWidth(fe.wireframeLinewidth*q()),Ze.setMode(1)):Ze.setMode(4);else if(Fe.isLine){let ge=fe.linewidth;ge===void 0&&(ge=1),me.setLineWidth(ge*q()),Fe.isLineSegments?Ze.setMode(1):Fe.isLineLoop?Ze.setMode(2):Ze.setMode(3)}else Fe.isPoints?Ze.setMode(0):Fe.isSprite&&Ze.setMode(4);if(Fe.isInstancedMesh)Ze.renderInstances(Ke,qe,Fe.count);else if(Be.isInstancedBufferGeometry){const ge=Be._maxInstanceCount!==void 0?Be._maxInstanceCount:1/0,Wt=Math.min(Be.instanceCount,ge);Ze.renderInstances(Ke,qe,Wt)}else Ze.render(Ke,qe)},this.compile=function($,Ae){function Be(fe,Fe,vt){fe.transparent===!0&&fe.side===$i&&fe.forceSinglePass===!1?(fe.side=vi,fe.needsUpdate=!0,Vt(fe,Fe,vt),fe.side=Ys,fe.needsUpdate=!0,Vt(fe,Fe,vt),fe.side=$i):Vt(fe,Fe,vt)}p=Ie.get($),p.init(),g.push(p),$.traverseVisible(function(fe){fe.isLight&&fe.layers.test(Ae.layers)&&(p.pushLight(fe),fe.castShadow&&p.pushShadow(fe))}),p.setupLights(v.useLegacyLights),$.traverse(function(fe){const Fe=fe.material;if(Fe)if(Array.isArray(Fe))for(let vt=0;vt0?p=g[g.length-1]:p=null,m.pop(),m.length>0?f=m[m.length-1]:f=null};function Ht($,Ae,Be,fe){if($.visible===!1)return;if($.layers.test(Ae.layers)){if($.isGroup)Be=$.renderOrder;else if($.isLOD)$.autoUpdate===!0&&$.update(Ae);else if($.isLight)p.pushLight($),$.castShadow&&p.pushShadow($);else if($.isSprite){if(!$.frustumCulled||ie.intersectsSprite($)){fe&&k.setFromMatrixPosition($.matrixWorld).applyMatrix4(W);const L=We.update($),H=$.material;H.visible&&f.push($,L,H,Be,k.z,null)}}else if(($.isMesh||$.isLine||$.isPoints)&&($.isSkinnedMesh&&$.skeleton.frame!==Me.render.frame&&($.skeleton.update(),$.skeleton.frame=Me.render.frame),!$.frustumCulled||ie.intersectsObject($))){fe&&k.setFromMatrixPosition($.matrixWorld).applyMatrix4(W);const L=We.update($),H=$.material;if(Array.isArray(H)){const oe=L.groups;for(let pe=0,xe=oe.length;pe0&&un(Fe,Ae,Be),fe&&me.viewport(b.copy(fe)),Fe.length>0&&Xt(Fe,Ae,Be),vt.length>0&&Xt(vt,Ae,Be),L.length>0&&Xt(L,Ae,Be),me.buffers.depth.setTest(!0),me.buffers.depth.setMask(!0),me.buffers.color.setMask(!0),me.setPolygonOffset(!1)}function un($,Ae,Be){const fe=re.isWebGL2;j===null&&(j=new ri(1024,1024,{generateMipmaps:!0,type:ae.has("EXT_color_buffer_half_float")?Gr:pa,minFilter:Ao,samples:fe&&s===!0?4:0}));const Fe=v.getRenderTarget();v.setRenderTarget(j),v.clear();const vt=v.toneMapping;v.toneMapping=js,Xt($,Ae,Be),v.toneMapping=vt,se.updateMultisampleRenderTarget(j),se.updateRenderTargetMipmap(j),v.setRenderTarget(Fe)}function Xt($,Ae,Be){const fe=Ae.isScene===!0?Ae.overrideMaterial:null;for(let Fe=0,vt=$.length;Fe0&&se.useMultisampledRTT($)===!1?Fe=Se.get($).__webglMultisampledFramebuffer:Fe=xe,b.copy($.viewport),R.copy($.scissor),E=$.scissorTest}else b.copy(P).multiplyScalar(U).floor(),R.copy(F).multiplyScalar(U).floor(),E=G;if(me.bindFramebuffer(36160,Fe)&&re.drawBuffers&&fe&&me.drawBuffers($,Fe),me.viewport(b),me.scissor(R),me.setScissorTest(E),vt){const oe=Se.get($.texture);X.framebufferTexture2D(36160,36064,34069+Ae,oe.__webglTexture,Be)}else if(L){const oe=Se.get($.texture),pe=Ae||0;X.framebufferTextureLayer(36160,36064,oe.__webglTexture,Be||0,pe)}A=-1},this.readRenderTargetPixels=function($,Ae,Be,fe,Fe,vt,L){if(!($&&$.isWebGLRenderTarget)){console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not THREE.WebGLRenderTarget.");return}let H=Se.get($).__webglFramebuffer;if($.isWebGLCubeRenderTarget&&L!==void 0&&(H=H[L]),H){me.bindFramebuffer(36160,H);try{const oe=$.texture,pe=oe.format,xe=oe.type;if(pe!==mi&&Ve.convert(pe)!==X.getParameter(35739)){console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not in RGBA or implementation defined format.");return}const we=xe===Gr&&(ae.has("EXT_color_buffer_half_float")||re.isWebGL2&&ae.has("EXT_color_buffer_float"));if(xe!==pa&&Ve.convert(xe)!==X.getParameter(35738)&&!(xe===zr&&(re.isWebGL2||ae.has("OES_texture_float")||ae.has("WEBGL_color_buffer_float")))&&!we){console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not in UnsignedByteType or implementation defined type.");return}Ae>=0&&Ae<=$.width-fe&&Be>=0&&Be<=$.height-Fe&&X.readPixels(Ae,Be,fe,Fe,Ve.convert(pe),Ve.convert(xe),vt)}finally{const oe=x!==null?Se.get(x).__webglFramebuffer:null;me.bindFramebuffer(36160,oe)}}},this.copyFramebufferToTexture=function($,Ae,Be=0){const fe=Math.pow(2,-Be),Fe=Math.floor(Ae.image.width*fe),vt=Math.floor(Ae.image.height*fe);se.setTexture2D(Ae,0),X.copyTexSubImage2D(3553,Be,0,0,$.x,$.y,Fe,vt),me.unbindTexture()},this.copyTextureToTexture=function($,Ae,Be,fe=0){const Fe=Ae.image.width,vt=Ae.image.height,L=Ve.convert(Be.format),H=Ve.convert(Be.type);se.setTexture2D(Be,0),X.pixelStorei(37440,Be.flipY),X.pixelStorei(37441,Be.premultiplyAlpha),X.pixelStorei(3317,Be.unpackAlignment),Ae.isDataTexture?X.texSubImage2D(3553,fe,$.x,$.y,Fe,vt,L,H,Ae.image.data):Ae.isCompressedTexture?X.compressedTexSubImage2D(3553,fe,$.x,$.y,Ae.mipmaps[0].width,Ae.mipmaps[0].height,L,Ae.mipmaps[0].data):X.texSubImage2D(3553,fe,$.x,$.y,L,H,Ae.image),fe===0&&Be.generateMipmaps&&X.generateMipmap(3553),me.unbindTexture()},this.copyTextureToTexture3D=function($,Ae,Be,fe,Fe=0){if(v.isWebGL1Renderer){console.warn("THREE.WebGLRenderer.copyTextureToTexture3D: can only be used with WebGL2.");return}const vt=$.max.x-$.min.x+1,L=$.max.y-$.min.y+1,H=$.max.z-$.min.z+1,oe=Ve.convert(fe.format),pe=Ve.convert(fe.type);let xe;if(fe.isData3DTexture)se.setTexture3D(fe,0),xe=32879;else if(fe.isDataArrayTexture)se.setTexture2DArray(fe,0),xe=35866;else{console.warn("THREE.WebGLRenderer.copyTextureToTexture3D: only supports THREE.DataTexture3D and THREE.DataTexture2DArray.");return}X.pixelStorei(37440,fe.flipY),X.pixelStorei(37441,fe.premultiplyAlpha),X.pixelStorei(3317,fe.unpackAlignment);const we=X.getParameter(3314),Ke=X.getParameter(32878),Xe=X.getParameter(3316),qe=X.getParameter(3315),$e=X.getParameter(32877),Ze=Be.isCompressedTexture?Be.mipmaps[0]:Be.image;X.pixelStorei(3314,Ze.width),X.pixelStorei(32878,Ze.height),X.pixelStorei(3316,$.min.x),X.pixelStorei(3315,$.min.y),X.pixelStorei(32877,$.min.z),Be.isDataTexture||Be.isData3DTexture?X.texSubImage3D(xe,Fe,Ae.x,Ae.y,Ae.z,vt,L,H,oe,pe,Ze.data):Be.isCompressedArrayTexture?(console.warn("THREE.WebGLRenderer.copyTextureToTexture3D: untested support for compressed srcTexture."),X.compressedTexSubImage3D(xe,Fe,Ae.x,Ae.y,Ae.z,vt,L,H,oe,Ze.data)):X.texSubImage3D(xe,Fe,Ae.x,Ae.y,Ae.z,vt,L,H,oe,pe,Ze),X.pixelStorei(3314,we),X.pixelStorei(32878,Ke),X.pixelStorei(3316,Xe),X.pixelStorei(3315,qe),X.pixelStorei(32877,$e),Fe===0&&fe.generateMipmaps&&X.generateMipmap(xe),me.unbindTexture()},this.initTexture=function($){$.isCubeTexture?se.setTextureCube($,0):$.isData3DTexture?se.setTexture3D($,0):$.isDataArrayTexture||$.isCompressedArrayTexture?se.setTexture2DArray($,0):se.setTexture2D($,0),me.unbindTexture()},this.resetState=function(){w=0,_=0,x=null,me.reset(),Ye.reset()},typeof __THREE_DEVTOOLS__<"u"&&__THREE_DEVTOOLS__.dispatchEvent(new CustomEvent("observe",{detail:this}))}Object.defineProperties(_y.prototype,{physicallyCorrectLights:{get:function(){return console.warn("THREE.WebGLRenderer: the property .physicallyCorrectLights has been removed. Set renderer.useLegacyLights instead."),!this.useLegacyLights},set:function(n){console.warn("THREE.WebGLRenderer: the property .physicallyCorrectLights has been removed. Set renderer.useLegacyLights instead."),this.useLegacyLights=!n}}});class hD extends _y{}hD.prototype.isWebGL1Renderer=!0;class wy{constructor(e,t=25e-5){this.isFogExp2=!0,this.name="",this.color=new st(e),this.density=t}clone(){return new wy(this.color,this.density)}toJSON(){return{type:"FogExp2",color:this.color.getHex(),density:this.density}}}class Sy{constructor(e,t=1,r=1e3){this.isFog=!0,this.name="",this.color=new st(e),this.near=t,this.far=r}clone(){return new Sy(this.color,this.near,this.far)}toJSON(){return{type:"Fog",color:this.color.getHex(),near:this.near,far:this.far}}}class wf extends sn{constructor(){super(),this.isScene=!0,this.type="Scene",this.background=null,this.environment=null,this.fog=null,this.backgroundBlurriness=0,this.backgroundIntensity=1,this.overrideMaterial=null,typeof __THREE_DEVTOOLS__<"u"&&__THREE_DEVTOOLS__.dispatchEvent(new CustomEvent("observe",{detail:this}))}copy(e,t){return super.copy(e,t),e.background!==null&&(this.background=e.background.clone()),e.environment!==null&&(this.environment=e.environment.clone()),e.fog!==null&&(this.fog=e.fog.clone()),this.backgroundBlurriness=e.backgroundBlurriness,this.backgroundIntensity=e.backgroundIntensity,e.overrideMaterial!==null&&(this.overrideMaterial=e.overrideMaterial.clone()),this.matrixAutoUpdate=e.matrixAutoUpdate,this}toJSON(e){const t=super.toJSON(e);return this.fog!==null&&(t.object.fog=this.fog.toJSON()),this.backgroundBlurriness>0&&(t.object.backgroundBlurriness=this.backgroundBlurriness),this.backgroundIntensity!==1&&(t.object.backgroundIntensity=this.backgroundIntensity),t}get autoUpdate(){return console.warn("THREE.Scene: autoUpdate was renamed to matrixWorldAutoUpdate in r144."),this.matrixWorldAutoUpdate}set autoUpdate(e){console.warn("THREE.Scene: autoUpdate was renamed to matrixWorldAutoUpdate in r144."),this.matrixWorldAutoUpdate=e}}class bp{constructor(e,t){this.isInterleavedBuffer=!0,this.array=e,this.stride=t,this.count=e!==void 0?e.length/t:0,this.usage=qd,this.updateRange={offset:0,count:-1},this.version=0,this.uuid=ts()}onUploadCallback(){}set needsUpdate(e){e===!0&&this.version++}setUsage(e){return this.usage=e,this}copy(e){return this.array=new e.array.constructor(e.array),this.count=e.count,this.stride=e.stride,this.usage=e.usage,this}copyAt(e,t,r){e*=this.stride,r*=t.stride;for(let i=0,s=this.stride;ie.far||t.push({distance:l,point:Th.clone(),uv:_s.getUV(Th,Mg,Bh,Eg,jT,Bx,XT,new ze),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 Cg(n,e,t,r,i,s){vc.subVectors(n,t).addScalar(.5).multiply(r),i!==void 0?(Rh.x=s*vc.x-i*vc.y,Rh.y=i*vc.x+s*vc.y):Rh.copy(vc),n.copy(e),n.x+=Rh.x,n.y+=Rh.y,n.applyMatrix4(dD)}const bg=new Z,YT=new Z;class mD extends sn{constructor(){super(),this._currentLevel=0,this.type="LOD",Object.defineProperties(this,{levels:{enumerable:!0,value:[]},isLOD:{value:!0}}),this.autoUpdate=!0}copy(e){super.copy(e,!1);const t=e.levels;for(let r=0,i=t.length;r0){let r,i;for(r=1,i=t.length;r0){bg.setFromMatrixPosition(this.matrixWorld);const i=e.ray.origin.distanceTo(bg);this.getObjectForDistance(i).raycast(e,t)}}update(e){const t=this.levels;if(t.length>1){bg.setFromMatrixPosition(e.matrixWorld),YT.setFromMatrixPosition(this.matrixWorld);const r=bg.distanceTo(YT)/e.zoom;t[0].object.visible=!0;let i,s;for(i=1,s=t.length;i=o)t[i-1].object.visible=!1,t[i].object.visible=!0;else break}for(this._currentLevel=i-1;il)continue;p.applyMatrix4(this.matrixWorld);const E=e.ray.origin.distanceTo(p);Ee.far||t.push({distance:E,point:f.clone().applyMatrix4(this.matrixWorld),index:x,face:null,faceIndex:null,object:this})}}else{const w=Math.max(0,o.start),_=Math.min(y.count,o.start+o.count);for(let x=w,A=_-1;xl)continue;p.applyMatrix4(this.matrixWorld);const b=e.ray.origin.distanceTo(p);be.far||t.push({distance:b,point:f.clone().applyMatrix4(this.matrixWorld),index:x,face:null,faceIndex:null,object:this})}}}updateMorphTargets(){const t=this.geometry.morphAttributes,r=Object.keys(t);if(r.length>0){const i=t[r[0]];if(i!==void 0){this.morphTargetInfluences=[],this.morphTargetDictionary={};for(let s=0,o=i.length;s0){const i=t[r[0]];if(i!==void 0){this.morphTargetInfluences=[],this.morphTargetDictionary={};for(let s=0,o=i.length;si.far)return;s.push({distance:u,distanceToRay:Math.sqrt(a),point:l,index:e,face:null,object:o})}}class IJ extends Rn{constructor(e,t,r,i,s,o,a,l,u){super(e,t,r,i,s,o,a,l,u),this.isVideoTexture=!0,this.minFilter=o!==void 0?o:gn,this.magFilter=s!==void 0?s:gn,this.generateMipmaps=!1;const c=this;function f(){c.needsUpdate=!0,e.requestVideoFrameCallback(f)}"requestVideoFrameCallback"in e&&e.requestVideoFrameCallback(f)}clone(){return new this.constructor(this.image).copy(this)}update(){const e=this.image;"requestVideoFrameCallback"in e===!1&&e.readyState>=e.HAVE_CURRENT_DATA&&(this.needsUpdate=!0)}}class LJ extends Rn{constructor(e,t,r){super({width:e,height:t}),this.isFramebufferTexture=!0,this.format=r,this.magFilter=Zn,this.minFilter=Zn,this.generateMipmaps=!1,this.needsUpdate=!0}}class NM extends Rn{constructor(e,t,r,i,s,o,a,l,u,c,f,p){super(null,o,a,l,u,c,i,s,f,p),this.isCompressedTexture=!0,this.image={width:t,height:r},this.mipmaps=e,this.flipY=!1,this.generateMipmaps=!1}}class DJ extends NM{constructor(e,t,r,i,s,o){super(e,t,r,s,o),this.isCompressedArrayTexture=!0,this.image.depth=i,this.wrapR=Ur}}class kJ extends Rn{constructor(e,t,r,i,s,o,a,l,u){super(e,t,r,i,s,o,a,l,u),this.isCanvasTexture=!0,this.needsUpdate=!0}}class qs{constructor(){this.type="Curve",this.arcLengthDivisions=200}getPoint(){return console.warn("THREE.Curve: .getPoint() not implemented."),null}getPointAt(e,t){const r=this.getUtoTmapping(e);return this.getPoint(r,t)}getPoints(e=5){const t=[];for(let r=0;r<=e;r++)t.push(this.getPoint(r/e));return t}getSpacedPoints(e=5){const t=[];for(let r=0;r<=e;r++)t.push(this.getPointAt(r/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 r,i=this.getPoint(0),s=0;t.push(0);for(let o=1;o<=e;o++)r=this.getPoint(o/e),s+=r.distanceTo(i),t.push(s),i=r;return this.cacheArcLengths=t,t}updateArcLengths(){this.needsUpdate=!0,this.getLengths()}getUtoTmapping(e,t){const r=this.getLengths();let i=0;const s=r.length;let o;t?o=t:o=e*r[s-1];let a=0,l=s-1,u;for(;a<=l;)if(i=Math.floor(a+(l-a)/2),u=r[i]-o,u<0)a=i+1;else if(u>0)l=i-1;else{l=i;break}if(i=l,r[i]===o)return i/(s-1);const c=r[i],p=r[i+1]-c,m=(o-c)/p;return(i+m)/(s-1)}getTangent(e,t){let i=e-1e-4,s=e+1e-4;i<0&&(i=0),s>1&&(s=1);const o=this.getPoint(i),a=this.getPoint(s),l=t||(o.isVector2?new ze:new Z);return l.copy(a).sub(o).normalize(),l}getTangentAt(e,t){const r=this.getUtoTmapping(e);return this.getTangent(r,t)}computeFrenetFrames(e,t){const r=new Z,i=[],s=[],o=[],a=new Z,l=new Lt;for(let m=0;m<=e;m++){const g=m/e;i[m]=this.getTangentAt(g,new Z)}s[0]=new Z,o[0]=new Z;let u=Number.MAX_VALUE;const c=Math.abs(i[0].x),f=Math.abs(i[0].y),p=Math.abs(i[0].z);c<=u&&(u=c,r.set(1,0,0)),f<=u&&(u=f,r.set(0,1,0)),p<=u&&r.set(0,0,1),a.crossVectors(i[0],r).normalize(),s[0].crossVectors(i[0],a),o[0].crossVectors(i[0],s[0]);for(let m=1;m<=e;m++){if(s[m]=s[m-1].clone(),o[m]=o[m-1].clone(),a.crossVectors(i[m-1],i[m]),a.length()>Number.EPSILON){a.normalize();const g=Math.acos(ir(i[m-1].dot(i[m]),-1,1));s[m].applyMatrix4(l.makeRotationAxis(a,g))}o[m].crossVectors(i[m],s[m])}if(t===!0){let m=Math.acos(ir(s[0].dot(s[e]),-1,1));m/=e,i[0].dot(a.crossVectors(s[0],s[e]))>0&&(m=-m);for(let g=1;g<=e;g++)s[g].applyMatrix4(l.makeRotationAxis(i[g],m*g)),o[g].crossVectors(i[g],s[g])}return{tangents:i,normals:s,binormals:o}}clone(){return new this.constructor().copy(this)}copy(e){return this.arcLengthDivisions=e.arcLengthDivisions,this}toJSON(){const e={metadata:{version:4.5,type:"Curve",generator:"Curve.toJSON"}};return e.arcLengthDivisions=this.arcLengthDivisions,e.type=this.type,e}fromJSON(e){return this.arcLengthDivisions=e.arcLengthDivisions,this}}class Ey extends qs{constructor(e=0,t=0,r=1,i=1,s=0,o=Math.PI*2,a=!1,l=0){super(),this.isEllipseCurve=!0,this.type="EllipseCurve",this.aX=e,this.aY=t,this.xRadius=r,this.yRadius=i,this.aStartAngle=s,this.aEndAngle=o,this.aClockwise=a,this.aRotation=l}getPoint(e,t){const r=t||new ze,i=Math.PI*2;let s=this.aEndAngle-this.aStartAngle;const o=Math.abs(s)i;)s-=i;s0?0:(Math.floor(Math.abs(a)/s)+1)*s:l===0&&a===s-1&&(a=s-2,l=1);let u,c;this.closed||a>0?u=i[(a-1)%s]:(Ig.subVectors(i[0],i[1]).add(i[0]),u=Ig);const f=i[a%s],p=i[(a+1)%s];if(this.closed||a+2i.length-2?i.length-1:o+1],f=i[o>i.length-3?i.length-1:o+2];return r.set(u3(a,l.x,u.x,c.x,f.x),u3(a,l.y,u.y,c.y,f.y)),r}copy(e){super.copy(e),this.points=[];for(let t=0,r=e.points.length;t=r){const o=i[s]-r,a=this.curves[s],l=a.getLength(),u=l===0?0:1-o/l;return a.getPointAt(u,t)}s++}return null}getLength(){const e=this.getCurveLengths();return e[e.length-1]}updateArcLengths(){this.needsUpdate=!0,this.cacheLengths=null,this.getCurveLengths()}getCurveLengths(){if(this.cacheLengths&&this.cacheLengths.length===this.curves.length)return this.cacheLengths;const e=[];let t=0;for(let r=0,i=this.curves.length;r1&&!t[t.length-1].equals(t[0])&&t.push(t[0]),t}copy(e){super.copy(e),this.curves=[];for(let t=0,r=e.curves.length;t0){const f=u.getPoint(0);f.equals(this.currentPoint)||this.lineTo(f.x,f.y)}this.curves.push(u);const c=u.getPoint(1);return this.currentPoint.copy(c),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 If extends Ut{constructor(e=[new ze(0,-.5),new ze(.5,0),new ze(0,.5)],t=12,r=0,i=Math.PI*2){super(),this.type="LatheGeometry",this.parameters={points:e,segments:t,phiStart:r,phiLength:i},t=Math.floor(t),i=ir(i,0,Math.PI*2);const s=[],o=[],a=[],l=[],u=[],c=1/t,f=new Z,p=new ze,m=new Z,g=new Z,v=new Z;let y=0,w=0;for(let _=0;_<=e.length-1;_++)switch(_){case 0:y=e[_+1].x-e[_].x,w=e[_+1].y-e[_].y,m.x=w*1,m.y=-y,m.z=w*0,v.copy(m),m.normalize(),l.push(m.x,m.y,m.z);break;case e.length-1:l.push(v.x,v.y,v.z);break;default:y=e[_+1].x-e[_].x,w=e[_+1].y-e[_].y,m.x=w*1,m.y=-y,m.z=w*0,g.copy(m),m.x+=v.x,m.y+=v.y,m.z+=v.z,m.normalize(),l.push(m.x,m.y,m.z),v.copy(g)}for(let _=0;_<=t;_++){const x=r+_*c*i,A=Math.sin(x),C=Math.cos(x);for(let b=0;b<=e.length-1;b++){f.x=e[b].x*A,f.y=e[b].y,f.z=e[b].x*C,o.push(f.x,f.y,f.z),p.x=_/t,p.y=b/(e.length-1),a.push(p.x,p.y);const R=l[3*b+0]*A,E=l[3*b+1],B=l[3*b+0]*C;u.push(R,E,B)}}for(let _=0;_0&&x(!0),t>0&&x(!1)),this.setIndex(c),this.setAttribute("position",new xt(f,3)),this.setAttribute("normal",new xt(p,3)),this.setAttribute("uv",new xt(m,2));function _(){const A=new Z,C=new Z;let b=0;const R=(t-e)/r;for(let E=0;E<=s;E++){const B=[],D=E/s,U=D*(t-e)+e;for(let z=0;z<=i;z++){const Y=z/i,P=Y*l+a,F=Math.sin(P),G=Math.cos(P);C.x=U*F,C.y=-D*r+y,C.z=U*G,f.push(C.x,C.y,C.z),A.set(F,R,G).normalize(),p.push(A.x,A.y,A.z),m.push(Y,1-D),B.push(g++)}v.push(B)}for(let E=0;E.9&&R<.1&&(x<.2&&(o[_+0]+=1),A<.2&&(o[_+2]+=1),C<.2&&(o[_+4]+=1))}}function p(_){s.push(_.x,_.y,_.z)}function m(_,x){const A=_*3;x.x=e[A+0],x.y=e[A+1],x.z=e[A+2]}function g(){const _=new Z,x=new Z,A=new Z,C=new Z,b=new ze,R=new ze,E=new ze;for(let B=0,D=0;B80*t){a=u=n[0],l=c=n[1];for(let g=t;gu&&(u=f),p>c&&(c=p);m=Math.max(u-a,c-l),m=m!==0?32767/m:0}return np(s,o,t,a,l,m,0),o}};function SD(n,e,t,r,i){let s,o;if(i===sj(n,e,t,r)>0)for(s=e;s=e;s-=r)o=c3(s,n[s],n[s+1],o);return o&&by(o,o.next)&&(ip(o),o=o.next),o}function Bu(n,e){if(!n)return n;e||(e=n);let t=n,r;do if(r=!1,!t.steiner&&(by(t,t.next)||Hn(t.prev,t,t.next)===0)){if(ip(t),t=e=t.prev,t===t.next)break;r=!0}else t=t.next;while(r||t!==e);return e}function np(n,e,t,r,i,s,o){if(!n)return;!o&&s&&$J(n,r,i,s);let a=n,l,u;for(;n.prev!==n.next;){if(l=n.prev,u=n.next,s?JJ(n,r,i,s):WJ(n)){e.push(l.i/t|0),e.push(n.i/t|0),e.push(u.i/t|0),ip(n),n=u.next,a=u.next;continue}if(n=u,n===a){o?o===1?(n=jJ(Bu(n),e,t),np(n,e,t,r,i,s,2)):o===2&&XJ(n,e,t,r,i,s):np(Bu(n),e,t,r,i,s,1);break}}}function WJ(n){const e=n.prev,t=n,r=n.next;if(Hn(e,t,r)>=0)return!1;const i=e.x,s=t.x,o=r.x,a=e.y,l=t.y,u=r.y,c=is?i>o?i:o:s>o?s:o,m=a>l?a>u?a:u:l>u?l:u;let g=r.next;for(;g!==e;){if(g.x>=c&&g.x<=p&&g.y>=f&&g.y<=m&&Gc(i,a,s,l,o,u,g.x,g.y)&&Hn(g.prev,g,g.next)>=0)return!1;g=g.next}return!0}function JJ(n,e,t,r){const i=n.prev,s=n,o=n.next;if(Hn(i,s,o)>=0)return!1;const a=i.x,l=s.x,u=o.x,c=i.y,f=s.y,p=o.y,m=al?a>u?a:u:l>u?l:u,y=c>f?c>p?c:p:f>p?f:p,w=xS(m,g,e,t,r),_=xS(v,y,e,t,r);let x=n.prevZ,A=n.nextZ;for(;x&&x.z>=w&&A&&A.z<=_;){if(x.x>=m&&x.x<=v&&x.y>=g&&x.y<=y&&x!==i&&x!==o&&Gc(a,c,l,f,u,p,x.x,x.y)&&Hn(x.prev,x,x.next)>=0||(x=x.prevZ,A.x>=m&&A.x<=v&&A.y>=g&&A.y<=y&&A!==i&&A!==o&&Gc(a,c,l,f,u,p,A.x,A.y)&&Hn(A.prev,A,A.next)>=0))return!1;A=A.nextZ}for(;x&&x.z>=w;){if(x.x>=m&&x.x<=v&&x.y>=g&&x.y<=y&&x!==i&&x!==o&&Gc(a,c,l,f,u,p,x.x,x.y)&&Hn(x.prev,x,x.next)>=0)return!1;x=x.prevZ}for(;A&&A.z<=_;){if(A.x>=m&&A.x<=v&&A.y>=g&&A.y<=y&&A!==i&&A!==o&&Gc(a,c,l,f,u,p,A.x,A.y)&&Hn(A.prev,A,A.next)>=0)return!1;A=A.nextZ}return!0}function jJ(n,e,t){let r=n;do{const i=r.prev,s=r.next.next;!by(i,s)&&AD(i,r,r.next,s)&&rp(i,s)&&rp(s,i)&&(e.push(i.i/t|0),e.push(r.i/t|0),e.push(s.i/t|0),ip(r),ip(r.next),r=n=s),r=r.next}while(r!==n);return Bu(r)}function XJ(n,e,t,r,i,s){let o=n;do{let a=o.next.next;for(;a!==o.prev;){if(o.i!==a.i&&nj(o,a)){let l=MD(o,a);o=Bu(o,o.next),l=Bu(l,l.next),np(o,e,t,r,i,s,0),np(l,e,t,r,i,s,0);return}a=a.next}o=o.next}while(o!==n)}function YJ(n,e,t,r){const i=[];let s,o,a,l,u;for(s=0,o=e.length;s=t.next.y&&t.next.y!==t.y){const p=t.x+(o-t.y)*(t.next.x-t.x)/(t.next.y-t.y);if(p<=s&&p>r&&(r=p,i=t.x=t.x&&t.x>=l&&s!==t.x&&Gc(oi.x||t.x===i.x&&qJ(i,t)))&&(i=t,c=f)),t=t.next;while(t!==a);return i}function qJ(n,e){return Hn(n.prev,n,e.prev)<0&&Hn(e.next,n,n.next)<0}function $J(n,e,t,r){let i=n;do i.z===0&&(i.z=xS(i.x,i.y,e,t,r)),i.prevZ=i.prev,i.nextZ=i.next,i=i.next;while(i!==n);i.prevZ.nextZ=null,i.prevZ=null,ej(i)}function ej(n){let e,t,r,i,s,o,a,l,u=1;do{for(t=n,n=null,s=null,o=0;t;){for(o++,r=t,a=0,e=0;e0||l>0&&r;)a!==0&&(l===0||!r||t.z<=r.z)?(i=t,t=t.nextZ,a--):(i=r,r=r.nextZ,l--),s?s.nextZ=i:n=i,i.prevZ=s,s=i;t=r}s.nextZ=null,u*=2}while(o>1);return n}function xS(n,e,t,r,i){return n=(n-t)*i|0,e=(e-r)*i|0,n=(n|n<<8)&16711935,n=(n|n<<4)&252645135,n=(n|n<<2)&858993459,n=(n|n<<1)&1431655765,e=(e|e<<8)&16711935,e=(e|e<<4)&252645135,e=(e|e<<2)&858993459,e=(e|e<<1)&1431655765,n|e<<1}function tj(n){let e=n,t=n;do(e.x=(n-o)*(s-a)&&(n-o)*(r-a)>=(t-o)*(e-a)&&(t-o)*(s-a)>=(i-o)*(r-a)}function nj(n,e){return n.next.i!==e.i&&n.prev.i!==e.i&&!rj(n,e)&&(rp(n,e)&&rp(e,n)&&ij(n,e)&&(Hn(n.prev,n,e.prev)||Hn(n,e.prev,e))||by(n,e)&&Hn(n.prev,n,n.next)>0&&Hn(e.prev,e,e.next)>0)}function Hn(n,e,t){return(e.y-n.y)*(t.x-e.x)-(e.x-n.x)*(t.y-e.y)}function by(n,e){return n.x===e.x&&n.y===e.y}function AD(n,e,t,r){const i=Ng(Hn(n,e,t)),s=Ng(Hn(n,e,r)),o=Ng(Hn(t,r,n)),a=Ng(Hn(t,r,e));return!!(i!==s&&o!==a||i===0&&Fg(n,t,e)||s===0&&Fg(n,r,e)||o===0&&Fg(t,n,r)||a===0&&Fg(t,e,r))}function Fg(n,e,t){return e.x<=Math.max(n.x,t.x)&&e.x>=Math.min(n.x,t.x)&&e.y<=Math.max(n.y,t.y)&&e.y>=Math.min(n.y,t.y)}function Ng(n){return n>0?1:n<0?-1:0}function rj(n,e){let t=n;do{if(t.i!==n.i&&t.next.i!==n.i&&t.i!==e.i&&t.next.i!==e.i&&AD(t,t.next,n,e))return!0;t=t.next}while(t!==n);return!1}function rp(n,e){return Hn(n.prev,n,n.next)<0?Hn(n,e,n.next)>=0&&Hn(n,n.prev,e)>=0:Hn(n,e,n.prev)<0||Hn(n,n.next,e)<0}function ij(n,e){let t=n,r=!1;const i=(n.x+e.x)/2,s=(n.y+e.y)/2;do t.y>s!=t.next.y>s&&t.next.y!==t.y&&i<(t.next.x-t.x)*(s-t.y)/(t.next.y-t.y)+t.x&&(r=!r),t=t.next;while(t!==n);return r}function MD(n,e){const t=new _S(n.i,n.x,n.y),r=new _S(e.i,e.x,e.y),i=n.next,s=e.prev;return n.next=e,e.prev=n,t.next=i,i.prev=t,r.next=t,t.prev=r,s.next=r,r.prev=s,r}function c3(n,e,t,r){const i=new _S(n,e,t);return r?(i.next=r.next,i.prev=r,r.next.prev=i,r.next=i):(i.prev=i,i.next=i),i}function ip(n){n.next.prev=n.prev,n.prev.next=n.next,n.prevZ&&(n.prevZ.nextZ=n.nextZ),n.nextZ&&(n.nextZ.prevZ=n.prevZ)}function _S(n,e,t){this.i=n,this.x=e,this.y=t,this.prev=null,this.next=null,this.z=0,this.prevZ=null,this.nextZ=null,this.steiner=!1}function sj(n,e,t,r){let i=0;for(let s=e,o=t-r;s2&&n[e-1].equals(n[0])&&n.pop()}function h3(n,e){for(let t=0;tNumber.EPSILON){const le=Math.sqrt(K),_e=Math.sqrt(He*He+Ie*Ie),Ge=ye.x-je/le,Je=ye.y+Ce/le,Ve=ke.x-Ie/_e,Ye=ke.y+He/_e,Le=((Ve-Ge)*Ie-(Ye-Je)*He)/(Ce*Ie-je*He);Te=Ge+Ce*Le-se.x,Pe=Je+je*Le-se.y;const nt=Te*Te+Pe*Pe;if(nt<=2)return new ze(Te,Pe);We=Math.sqrt(nt/2)}else{let le=!1;Ce>Number.EPSILON?He>Number.EPSILON&&(le=!0):Ce<-Number.EPSILON?He<-Number.EPSILON&&(le=!0):Math.sign(je)===Math.sign(Ie)&&(le=!0),le?(Te=-je,Pe=Ce,We=Math.sqrt(K)):(Te=Ce,Pe=je,We=Math.sqrt(K/2))}return new ze(Te/We,Pe/We)}const V=[];for(let se=0,ye=P.length,ke=ye-1,Te=se+1;se=0;se--){const ye=se/y,ke=m*Math.cos(ye*Math.PI/2),Te=g*Math.sin(ye*Math.PI/2)+v;for(let Pe=0,We=P.length;Pe=0;){const Te=ke;let Pe=ke-1;Pe<0&&(Pe=se.length-1);for(let We=0,Ce=c+y*2;We0)&&m.push(x,A,b),(w!==r-1||l0!=e>0&&this.version++,this._sheen=e}get clearcoat(){return this._clearcoat}set clearcoat(e){this._clearcoat>0!=e>0&&this.version++,this._clearcoat=e}get iridescence(){return this._iridescence}set iridescence(e){this._iridescence>0!=e>0&&this.version++,this._iridescence=e}get transmission(){return this._transmission}set transmission(e){this._transmission>0!=e>0&&this.version++,this._transmission=e}copy(e){return super.copy(e),this.defines={STANDARD:"",PHYSICAL:""},this.clearcoat=e.clearcoat,this.clearcoatMap=e.clearcoatMap,this.clearcoatRoughness=e.clearcoatRoughness,this.clearcoatRoughnessMap=e.clearcoatRoughnessMap,this.clearcoatNormalMap=e.clearcoatNormalMap,this.clearcoatNormalScale.copy(e.clearcoatNormalScale),this.ior=e.ior,this.iridescence=e.iridescence,this.iridescenceMap=e.iridescenceMap,this.iridescenceIOR=e.iridescenceIOR,this.iridescenceThicknessRange=[...e.iridescenceThicknessRange],this.iridescenceThicknessMap=e.iridescenceThicknessMap,this.sheen=e.sheen,this.sheenColor.copy(e.sheenColor),this.sheenColorMap=e.sheenColorMap,this.sheenRoughness=e.sheenRoughness,this.sheenRoughnessMap=e.sheenRoughnessMap,this.transmission=e.transmission,this.transmissionMap=e.transmissionMap,this.thickness=e.thickness,this.thicknessMap=e.thicknessMap,this.attenuationDistance=e.attenuationDistance,this.attenuationColor.copy(e.attenuationColor),this.specularIntensity=e.specularIntensity,this.specularIntensityMap=e.specularIntensityMap,this.specularColor.copy(e.specularColor),this.specularColorMap=e.specularColorMap,this}}class TD extends fr{constructor(e){super(),this.isMeshPhongMaterial=!0,this.type="MeshPhongMaterial",this.color=new st(16777215),this.specular=new st(1118481),this.shininess=30,this.map=null,this.lightMap=null,this.lightMapIntensity=1,this.aoMap=null,this.aoMapIntensity=1,this.emissive=new st(0),this.emissiveIntensity=1,this.emissiveMap=null,this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=xl,this.normalScale=new ze(1,1),this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.specularMap=null,this.alphaMap=null,this.envMap=null,this.combine=wp,this.reflectivity=1,this.refractionRatio=.98,this.wireframe=!1,this.wireframeLinewidth=1,this.wireframeLinecap="round",this.wireframeLinejoin="round",this.flatShading=!1,this.fog=!0,this.setValues(e)}copy(e){return super.copy(e),this.color.copy(e.color),this.specular.copy(e.specular),this.shininess=e.shininess,this.map=e.map,this.lightMap=e.lightMap,this.lightMapIntensity=e.lightMapIntensity,this.aoMap=e.aoMap,this.aoMapIntensity=e.aoMapIntensity,this.emissive.copy(e.emissive),this.emissiveMap=e.emissiveMap,this.emissiveIntensity=e.emissiveIntensity,this.bumpMap=e.bumpMap,this.bumpScale=e.bumpScale,this.normalMap=e.normalMap,this.normalMapType=e.normalMapType,this.normalScale.copy(e.normalScale),this.displacementMap=e.displacementMap,this.displacementScale=e.displacementScale,this.displacementBias=e.displacementBias,this.specularMap=e.specularMap,this.alphaMap=e.alphaMap,this.envMap=e.envMap,this.combine=e.combine,this.reflectivity=e.reflectivity,this.refractionRatio=e.refractionRatio,this.wireframe=e.wireframe,this.wireframeLinewidth=e.wireframeLinewidth,this.wireframeLinecap=e.wireframeLinecap,this.wireframeLinejoin=e.wireframeLinejoin,this.flatShading=e.flatShading,this.fog=e.fog,this}}class RD extends fr{constructor(e){super(),this.isMeshToonMaterial=!0,this.defines={TOON:""},this.type="MeshToonMaterial",this.color=new st(16777215),this.map=null,this.gradientMap=null,this.lightMap=null,this.lightMapIntensity=1,this.aoMap=null,this.aoMapIntensity=1,this.emissive=new st(0),this.emissiveIntensity=1,this.emissiveMap=null,this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=xl,this.normalScale=new ze(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 BD extends fr{constructor(e){super(),this.isMeshNormalMaterial=!0,this.type="MeshNormalMaterial",this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=xl,this.normalScale=new ze(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 WM extends fr{constructor(e){super(),this.isMeshLambertMaterial=!0,this.type="MeshLambertMaterial",this.color=new st(16777215),this.map=null,this.lightMap=null,this.lightMapIntensity=1,this.aoMap=null,this.aoMapIntensity=1,this.emissive=new st(0),this.emissiveIntensity=1,this.emissiveMap=null,this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=xl,this.normalScale=new ze(1,1),this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.specularMap=null,this.alphaMap=null,this.envMap=null,this.combine=wp,this.reflectivity=1,this.refractionRatio=.98,this.wireframe=!1,this.wireframeLinewidth=1,this.wireframeLinecap="round",this.wireframeLinejoin="round",this.flatShading=!1,this.fog=!0,this.setValues(e)}copy(e){return super.copy(e),this.color.copy(e.color),this.map=e.map,this.lightMap=e.lightMap,this.lightMapIntensity=e.lightMapIntensity,this.aoMap=e.aoMap,this.aoMapIntensity=e.aoMapIntensity,this.emissive.copy(e.emissive),this.emissiveMap=e.emissiveMap,this.emissiveIntensity=e.emissiveIntensity,this.bumpMap=e.bumpMap,this.bumpScale=e.bumpScale,this.normalMap=e.normalMap,this.normalMapType=e.normalMapType,this.normalScale.copy(e.normalScale),this.displacementMap=e.displacementMap,this.displacementScale=e.displacementScale,this.displacementBias=e.displacementBias,this.specularMap=e.specularMap,this.alphaMap=e.alphaMap,this.envMap=e.envMap,this.combine=e.combine,this.reflectivity=e.reflectivity,this.refractionRatio=e.refractionRatio,this.wireframe=e.wireframe,this.wireframeLinewidth=e.wireframeLinewidth,this.wireframeLinecap=e.wireframeLinecap,this.wireframeLinejoin=e.wireframeLinejoin,this.flatShading=e.flatShading,this.fog=e.fog,this}}class PD extends fr{constructor(e){super(),this.isMeshMatcapMaterial=!0,this.defines={MATCAP:""},this.type="MeshMatcapMaterial",this.color=new st(16777215),this.matcap=null,this.map=null,this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=xl,this.normalScale=new ze(1,1),this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.alphaMap=null,this.flatShading=!1,this.fog=!0,this.setValues(e)}copy(e){return super.copy(e),this.defines={MATCAP:""},this.color.copy(e.color),this.matcap=e.matcap,this.map=e.map,this.bumpMap=e.bumpMap,this.bumpScale=e.bumpScale,this.normalMap=e.normalMap,this.normalMapType=e.normalMapType,this.normalScale.copy(e.normalScale),this.displacementMap=e.displacementMap,this.displacementScale=e.displacementScale,this.displacementBias=e.displacementBias,this.alphaMap=e.alphaMap,this.flatShading=e.flatShading,this.fog=e.fog,this}}class ID extends ii{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 vs(n,e,t){return JM(n)?new n.constructor(n.subarray(e,t!==void 0?t:n.length)):n.slice(e,t)}function uu(n,e,t){return!n||!t&&n.constructor===e?n:typeof e.BYTES_PER_ELEMENT=="number"?new e(n):Array.prototype.slice.call(n)}function JM(n){return ArrayBuffer.isView(n)&&!(n instanceof DataView)}function LD(n){function e(i,s){return n[i]-n[s]}const t=n.length,r=new Array(t);for(let i=0;i!==t;++i)r[i]=i;return r.sort(e),r}function wS(n,e,t){const r=n.length,i=new n.constructor(r);for(let s=0,o=0;o!==r;++s){const a=t[s]*e;for(let l=0;l!==e;++l)i[o++]=n[a+l]}return i}function jM(n,e,t,r){let i=1,s=n[0];for(;s!==void 0&&s[r]===void 0;)s=n[i++];if(s===void 0)return;let o=s[r];if(o!==void 0)if(Array.isArray(o))do o=s[r],o!==void 0&&(e.push(s.time),t.push.apply(t,o)),s=n[i++];while(s!==void 0);else if(o.toArray!==void 0)do o=s[r],o!==void 0&&(e.push(s.time),o.toArray(t,t.length)),s=n[i++];while(s!==void 0);else do o=s[r],o!==void 0&&(e.push(s.time),t.push(o)),s=n[i++];while(s!==void 0)}function uj(n,e,t,r,i=30){const s=n.clone();s.name=e;const o=[];for(let l=0;l=r)){f.push(u.times[m]);for(let v=0;vs.tracks[l].times[0]&&(a=s.tracks[l].times[0]);for(let l=0;l=a.times[g]){const w=g*f+c,_=w+f-c;v=vs(a.values,w,_)}else{const w=a.createInterpolant(),_=c,x=f-c;w.evaluate(s),v=vs(w.resultBuffer,_,x)}l==="quaternion"&&new Pr().fromArray(v).normalize().conjugate().toArray(v);const y=u.times.length;for(let w=0;w=s)){const a=t[1];e=s)break t}o=r,r=0;break n}break e}for(;r>>1;et;)--o;if(++o,s!==0||o!==i){s>=o&&(o=Math.max(o,1),s=o-1);const a=this.getValueSize();this.times=vs(r,s,o),this.values=vs(this.values,s*a,o*a)}return this}validate(){let e=!0;const t=this.getValueSize();t-Math.floor(t)!==0&&(console.error("THREE.KeyframeTrack: Invalid value size in track.",this),e=!1);const r=this.times,i=this.values,s=r.length;s===0&&(console.error("THREE.KeyframeTrack: Track is empty.",this),e=!1);let o=null;for(let a=0;a!==s;a++){const l=r[a];if(typeof l=="number"&&isNaN(l)){console.error("THREE.KeyframeTrack: Time is not a valid number.",this,a,l),e=!1;break}if(o!==null&&o>l){console.error("THREE.KeyframeTrack: Out of order keys.",this,a,l,o),e=!1;break}o=l}if(i!==void 0&&JM(i))for(let a=0,l=i.length;a!==l;++a){const u=i[a];if(isNaN(u)){console.error("THREE.KeyframeTrack: Value is not a valid number.",this,a,u),e=!1;break}}return e}optimize(){const e=vs(this.times),t=vs(this.values),r=this.getValueSize(),i=this.getInterpolation()===M0,s=e.length-1;let o=1;for(let a=1;a0){e[o]=e[s];for(let a=s*r,l=o*r,u=0;u!==r;++u)t[l+u]=t[a+u];++o}return o!==e.length?(this.times=vs(e,0,o),this.values=vs(t,0,o*r)):(this.times=e,this.values=t),this}clone(){const e=vs(this.times,0),t=vs(this.values,0),r=this.constructor,i=new r(this.name,e,t);return i.createInterpolant=this.createInterpolant,i}}eo.prototype.TimeBufferType=Float32Array;eo.prototype.ValueBufferType=Float32Array;eo.prototype.DefaultInterpolation=Tu;class ku extends eo{}ku.prototype.ValueTypeName="bool";ku.prototype.ValueBufferType=Array;ku.prototype.DefaultInterpolation=yf;ku.prototype.InterpolantFactoryMethodLinear=void 0;ku.prototype.InterpolantFactoryMethodSmooth=void 0;class YM extends eo{}YM.prototype.ValueTypeName="color";class Sf extends eo{}Sf.prototype.ValueTypeName="number";class FD extends Ff{constructor(e,t,r,i){super(e,t,r,i)}interpolate_(e,t,r,i){const s=this.resultBuffer,o=this.sampleValues,a=this.valueSize,l=(r-t)/(i-t);let u=e*a;for(let c=u+a;u!==c;u+=4)Pr.slerpFlat(s,0,o,u-a,o,u,l);return s}}class ml extends eo{InterpolantFactoryMethodLinear(e){return new FD(this.times,this.values,this.getValueSize(),e)}}ml.prototype.ValueTypeName="quaternion";ml.prototype.DefaultInterpolation=Tu;ml.prototype.InterpolantFactoryMethodSmooth=void 0;class Fu extends eo{}Fu.prototype.ValueTypeName="string";Fu.prototype.ValueBufferType=Array;Fu.prototype.DefaultInterpolation=yf;Fu.prototype.InterpolantFactoryMethodLinear=void 0;Fu.prototype.InterpolantFactoryMethodSmooth=void 0;class Af extends eo{}Af.prototype.ValueTypeName="vector";class Mf{constructor(e,t=-1,r,i=py){this.name=e,this.tracks=r,this.duration=t,this.blendMode=i,this.uuid=ts(),this.duration<0&&this.resetDuration()}static parse(e){const t=[],r=e.tracks,i=1/(e.fps||1);for(let o=0,a=r.length;o!==a;++o)t.push(dj(r[o]).scale(i));const s=new this(e.name,e.duration,t,e.blendMode);return s.uuid=e.uuid,s}static toJSON(e){const t=[],r=e.tracks,i={name:e.name,duration:e.duration,tracks:t,uuid:e.uuid,blendMode:e.blendMode};for(let s=0,o=r.length;s!==o;++s)t.push(eo.toJSON(r[s]));return i}static CreateFromMorphTargetSequence(e,t,r,i){const s=t.length,o=[];for(let a=0;a1){const f=c[1];let p=i[f];p||(i[f]=p=[]),p.push(u)}}const o=[];for(const a in i)o.push(this.CreateFromMorphTargetSequence(a,i[a],t,r));return o}static parseAnimation(e,t){if(!e)return console.error("THREE.AnimationClip: No animation in JSONLoader data."),null;const r=function(f,p,m,g,v){if(m.length!==0){const y=[],w=[];jM(m,y,w,g),y.length!==0&&v.push(new f(p,y,w))}},i=[],s=e.name||"default",o=e.fps||30,a=e.blendMode;let l=e.length||-1;const u=e.hierarchy||[];for(let f=0;f{t&&t(s),this.manager.itemEnd(e)},0),s;if(Jo[e]!==void 0){Jo[e].push({onLoad:t,onProgress:r,onError:i});return}Jo[e]=[],Jo[e].push({onLoad:t,onProgress:r,onError:i});const o=new Request(e,{headers:new Headers(this.requestHeader),credentials:this.withCredentials?"include":"same-origin"}),a=this.mimeType,l=this.responseType;fetch(o).then(u=>{if(u.status===200||u.status===0){if(u.status===0&&console.warn("THREE.FileLoader: HTTP Status 0 received."),typeof ReadableStream>"u"||u.body===void 0||u.body.getReader===void 0)return u;const c=Jo[e],f=u.body.getReader(),p=u.headers.get("Content-Length")||u.headers.get("X-File-Size"),m=p?parseInt(p):0,g=m!==0;let v=0;const y=new ReadableStream({start(w){_();function _(){f.read().then(({done:x,value:A})=>{if(x)w.close();else{v+=A.byteLength;const C=new ProgressEvent("progress",{lengthComputable:g,loaded:v,total:m});for(let b=0,R=c.length;b{switch(l){case"arraybuffer":return u.arrayBuffer();case"blob":return u.blob();case"document":return u.text().then(c=>new DOMParser().parseFromString(c,a));case"json":return u.json();default:if(a===void 0)return u.text();{const f=/charset="?([^;"\s]*)"?/i.exec(a),p=f&&f[1]?f[1].toLowerCase():void 0,m=new TextDecoder(p);return u.arrayBuffer().then(g=>m.decode(g))}}}).then(u=>{Pu.add(e,u);const c=Jo[e];delete Jo[e];for(let f=0,p=c.length;f{const c=Jo[e];if(c===void 0)throw this.manager.itemError(e),u;delete Jo[e];for(let f=0,p=c.length;f{this.manager.itemEnd(e)}),this.manager.itemStart(e)}setResponseType(e){return this.responseType=e,this}setMimeType(e){return this.mimeType=e,this}}class mj extends Ai{constructor(e){super(e)}load(e,t,r,i){const s=this,o=new rs(this.manager);o.setPath(this.path),o.setRequestHeader(this.requestHeader),o.setWithCredentials(this.withCredentials),o.load(e,function(a){try{t(s.parse(JSON.parse(a)))}catch(l){i?i(l):console.error(l),s.manager.itemError(e)}},r,i)}parse(e){const t=[];for(let r=0;r0:i.vertexColors=e.vertexColors),e.uniforms!==void 0)for(const s in e.uniforms){const o=e.uniforms[s];switch(i.uniforms[s]={},o.type){case"t":i.uniforms[s].value=r(o.value);break;case"c":i.uniforms[s].value=new st().setHex(o.value);break;case"v2":i.uniforms[s].value=new ze().fromArray(o.value);break;case"v3":i.uniforms[s].value=new Z().fromArray(o.value);break;case"v4":i.uniforms[s].value=new vn().fromArray(o.value);break;case"m3":i.uniforms[s].value=new Rr().fromArray(o.value);break;case"m4":i.uniforms[s].value=new Lt().fromArray(o.value);break;default:i.uniforms[s].value=o.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 s in e.extensions)i.extensions[s]=e.extensions[s];if(e.size!==void 0&&(i.size=e.size),e.sizeAttenuation!==void 0&&(i.sizeAttenuation=e.sizeAttenuation),e.map!==void 0&&(i.map=r(e.map)),e.matcap!==void 0&&(i.matcap=r(e.matcap)),e.alphaMap!==void 0&&(i.alphaMap=r(e.alphaMap)),e.bumpMap!==void 0&&(i.bumpMap=r(e.bumpMap)),e.bumpScale!==void 0&&(i.bumpScale=e.bumpScale),e.normalMap!==void 0&&(i.normalMap=r(e.normalMap)),e.normalMapType!==void 0&&(i.normalMapType=e.normalMapType),e.normalScale!==void 0){let s=e.normalScale;Array.isArray(s)===!1&&(s=[s,s]),i.normalScale=new ze().fromArray(s)}return e.displacementMap!==void 0&&(i.displacementMap=r(e.displacementMap)),e.displacementScale!==void 0&&(i.displacementScale=e.displacementScale),e.displacementBias!==void 0&&(i.displacementBias=e.displacementBias),e.roughnessMap!==void 0&&(i.roughnessMap=r(e.roughnessMap)),e.metalnessMap!==void 0&&(i.metalnessMap=r(e.metalnessMap)),e.emissiveMap!==void 0&&(i.emissiveMap=r(e.emissiveMap)),e.emissiveIntensity!==void 0&&(i.emissiveIntensity=e.emissiveIntensity),e.specularMap!==void 0&&(i.specularMap=r(e.specularMap)),e.specularIntensityMap!==void 0&&(i.specularIntensityMap=r(e.specularIntensityMap)),e.specularColorMap!==void 0&&(i.specularColorMap=r(e.specularColorMap)),e.envMap!==void 0&&(i.envMap=r(e.envMap)),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=r(e.lightMap)),e.lightMapIntensity!==void 0&&(i.lightMapIntensity=e.lightMapIntensity),e.aoMap!==void 0&&(i.aoMap=r(e.aoMap)),e.aoMapIntensity!==void 0&&(i.aoMapIntensity=e.aoMapIntensity),e.gradientMap!==void 0&&(i.gradientMap=r(e.gradientMap)),e.clearcoatMap!==void 0&&(i.clearcoatMap=r(e.clearcoatMap)),e.clearcoatRoughnessMap!==void 0&&(i.clearcoatRoughnessMap=r(e.clearcoatRoughnessMap)),e.clearcoatNormalMap!==void 0&&(i.clearcoatNormalMap=r(e.clearcoatNormalMap)),e.clearcoatNormalScale!==void 0&&(i.clearcoatNormalScale=new ze().fromArray(e.clearcoatNormalScale)),e.iridescenceMap!==void 0&&(i.iridescenceMap=r(e.iridescenceMap)),e.iridescenceThicknessMap!==void 0&&(i.iridescenceThicknessMap=r(e.iridescenceThicknessMap)),e.transmissionMap!==void 0&&(i.transmissionMap=r(e.transmissionMap)),e.thicknessMap!==void 0&&(i.thicknessMap=r(e.thicknessMap)),e.sheenColorMap!==void 0&&(i.sheenColorMap=r(e.sheenColorMap)),e.sheenRoughnessMap!==void 0&&(i.sheenRoughnessMap=r(e.sheenRoughnessMap)),i}setTextures(e){return this.textures=e,this}static createMaterialFromType(e){const t={ShadowMaterial:CD,SpriteMaterial:IM,RawShaderMaterial:bD,ShaderMaterial:Oi,PointsMaterial:My,MeshPhysicalMaterial:$s,MeshStandardMaterial:zp,MeshPhongMaterial:TD,MeshToonMaterial:RD,MeshNormalMaterial:BD,MeshLambertMaterial:WM,MeshDepthMaterial:Cp,MeshDistanceMaterial:xy,MeshBasicMaterial:Ii,MeshMatcapMaterial:PD,LineDashedMaterial:ID,LineBasicMaterial:ii,Material:fr};return new t[e]}}class wo{static decodeText(e){if(typeof TextDecoder<"u")return new TextDecoder().decode(e);let t="";for(let r=0,i=e.length;r0){const l=new KM(t);s=new sp(l),s.setCrossOrigin(this.crossOrigin);for(let u=0,c=e.length;u0){i=new sp(this.manager),i.setCrossOrigin(this.crossOrigin);for(let o=0,a=e.length;o"u"&&console.warn("THREE.ImageBitmapLoader: createImageBitmap() not supported."),typeof fetch>"u"&&console.warn("THREE.ImageBitmapLoader: fetch() not supported."),this.options={premultiplyAlpha:"none"}}setOptions(e){return this.options=e,this}load(e,t,r,i){e===void 0&&(e=""),this.path!==void 0&&(e=this.path+e),e=this.manager.resolveURL(e);const s=this,o=Pu.get(e);if(o!==void 0)return s.manager.itemStart(e),setTimeout(function(){t&&t(o),s.manager.itemEnd(e)},0),o;const a={};a.credentials=this.crossOrigin==="anonymous"?"same-origin":"include",a.headers=this.requestHeader,fetch(e,a).then(function(l){return l.blob()}).then(function(l){return createImageBitmap(l,Object.assign(s.options,{colorSpaceConversion:"none"}))}).then(function(l){Pu.add(e,l),t&&t(l),s.manager.itemEnd(e)}).catch(function(l){i&&i(l),s.manager.itemError(e),s.manager.itemEnd(e)}),s.manager.itemStart(e)}}let Og;class n2{static getContext(){return Og===void 0&&(Og=new(window.AudioContext||window.webkitAudioContext)),Og}static setContext(e){Og=e}}class Sj extends Ai{constructor(e){super(e)}load(e,t,r,i){const s=this,o=new rs(this.manager);o.setResponseType("arraybuffer"),o.setPath(this.path),o.setRequestHeader(this.requestHeader),o.setWithCredentials(this.withCredentials),o.load(e,function(a){try{const l=a.slice(0);n2.getContext().decodeAudioData(l,function(c){t(c)})}catch(l){i?i(l):console.error(l),s.manager.itemError(e)}},r,i)}}class Aj extends Ty{constructor(e,t,r=1){super(void 0,r),this.isHemisphereLightProbe=!0;const i=new st().set(e),s=new st().set(t),o=new Z(i.r,i.g,i.b),a=new Z(s.r,s.g,s.b),l=Math.sqrt(Math.PI),u=l*Math.sqrt(.75);this.sh.coefficients[0].copy(o).add(a).multiplyScalar(l),this.sh.coefficients[1].copy(o).sub(a).multiplyScalar(u)}}class Mj extends Ty{constructor(e,t=1){super(void 0,t),this.isAmbientLightProbe=!0;const r=new st().set(e);this.sh.coefficients[0].set(r.r,r.g,r.b).multiplyScalar(2*Math.sqrt(Math.PI))}}const _3=new Lt,w3=new Lt,Gl=new Lt;class Ej{constructor(){this.type="StereoCamera",this.aspect=1,this.eyeSep=.064,this.cameraL=new Qn,this.cameraL.layers.enable(1),this.cameraL.matrixAutoUpdate=!1,this.cameraR=new Qn,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,Gl.copy(e.projectionMatrix);const i=t.eyeSep/2,s=i*t.near/t.focus,o=t.near*Math.tan(mu*t.fov*.5)/t.zoom;let a,l;w3.elements[12]=-i,_3.elements[12]=i,a=-o*t.aspect+s,l=o*t.aspect+s,Gl.elements[0]=2*t.near/(l-a),Gl.elements[8]=(l+a)/(l-a),this.cameraL.projectionMatrix.copy(Gl),a=-o*t.aspect-s,l=o*t.aspect-s,Gl.elements[0]=2*t.near/(l-a),Gl.elements[8]=(l+a)/(l-a),this.cameraR.projectionMatrix.copy(Gl)}this.cameraL.matrixWorld.copy(e.matrixWorld).multiply(w3),this.cameraR.matrixWorld.copy(e.matrixWorld).multiply(_3)}}class r2{constructor(e=!0){this.autoStart=e,this.startTime=0,this.oldTime=0,this.elapsedTime=0,this.running=!1}start(){this.startTime=S3(),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=S3();e=(t-this.oldTime)/1e3,this.oldTime=t,this.elapsedTime+=e}return e}}function S3(){return(typeof performance>"u"?Date:performance).now()}const Hl=new Z,A3=new Pr,Cj=new Z,Vl=new Z;class bj extends sn{constructor(){super(),this.type="AudioListener",this.context=n2.getContext(),this.gain=this.context.createGain(),this.gain.connect(this.context.destination),this.filter=null,this.timeDelta=0,this._clock=new r2}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,r=this.up;if(this.timeDelta=this._clock.getDelta(),this.matrixWorld.decompose(Hl,A3,Cj),Vl.set(0,0,-1).applyQuaternion(A3),t.positionX){const i=this.context.currentTime+this.timeDelta;t.positionX.linearRampToValueAtTime(Hl.x,i),t.positionY.linearRampToValueAtTime(Hl.y,i),t.positionZ.linearRampToValueAtTime(Hl.z,i),t.forwardX.linearRampToValueAtTime(Vl.x,i),t.forwardY.linearRampToValueAtTime(Vl.y,i),t.forwardZ.linearRampToValueAtTime(Vl.z,i),t.upX.linearRampToValueAtTime(r.x,i),t.upY.linearRampToValueAtTime(r.y,i),t.upZ.linearRampToValueAtTime(r.z,i)}else t.setPosition(Hl.x,Hl.y,Hl.z),t.setOrientation(Vl.x,Vl.y,Vl.z,r.x,r.y,r.z)}}class jD extends sn{constructor(e){super(),this.type="Audio",this.listener=e,this.context=e.context,this.gain=this.context.createGain(),this.gain.connect(e.getInput()),this.autoplay=!1,this.buffer=null,this.detune=0,this.loop=!1,this.loopStart=0,this.loopEnd=0,this.offset=0,this.duration=void 0,this.playbackRate=1,this.isPlaying=!1,this.hasPlaybackControl=!0,this.source=null,this.sourceType="empty",this._startedAt=0,this._progress=0,this._connected=!1,this.filters=[]}getOutput(){return this.gain}setNodeSource(e){return this.hasPlaybackControl=!1,this.sourceType="audioNode",this.source=e,this.connect(),this}setMediaElementSource(e){return this.hasPlaybackControl=!1,this.sourceType="mediaNode",this.source=this.context.createMediaElementSource(e),this.connect(),this}setMediaStreamSource(e){return this.hasPlaybackControl=!1,this.sourceType="mediaStreamNode",this.source=this.context.createMediaStreamSource(e),this.connect(),this}setBuffer(e){return this.buffer=e,this.sourceType="buffer",this.autoplay&&this.play(),this}play(e=0){if(this.isPlaying===!0){console.warn("THREE.Audio: Audio is already playing.");return}if(this.hasPlaybackControl===!1){console.warn("THREE.Audio: this Audio has no playback control.");return}this._startedAt=this.context.currentTime+e;const t=this.context.createBufferSource();return t.buffer=this.buffer,t.loop=this.loop,t.loopStart=this.loopStart,t.loopEnd=this.loopEnd,t.onended=this.onEnded.bind(this),t.start(this._startedAt,this._progress+this.offset,this.duration),this.isPlaying=!0,this.source=t,this.setDetune(this.detune),this.setPlaybackRate(this.playbackRate),this.connect()}pause(){if(this.hasPlaybackControl===!1){console.warn("THREE.Audio: this Audio has no playback control.");return}return this.isPlaying===!0&&(this._progress+=Math.max(this.context.currentTime-this._startedAt,0)*this.playbackRate,this.loop===!0&&(this._progress=this._progress%(this.duration||this.buffer.duration)),this.source.stop(),this.source.onended=null,this.isPlaying=!1),this}stop(){if(this.hasPlaybackControl===!1){console.warn("THREE.Audio: this Audio has no playback control.");return}return this._progress=0,this.source!==null&&(this.source.stop(),this.source.onended=null),this.isPlaying=!1,this}connect(){if(this.filters.length>0){this.source.connect(this.filters[0]);for(let e=1,t=this.filters.length;e0){this.source.disconnect(this.filters[0]);for(let e=1,t=this.filters.length;e0&&this._mixBufferRegionAdditive(r,i,this._addIndex*t,1,t);for(let l=t,u=t+t;l!==u;++l)if(r[l]!==r[l+t]){a.setValue(r,i);break}}saveOriginalState(){const e=this.binding,t=this.buffer,r=this.valueSize,i=r*this._origIndex;e.getValue(t,i);for(let s=r,o=i;s!==o;++s)t[s]=t[i+s%r];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 r=e;r=.5)for(let o=0;o!==s;++o)e[t+o]=e[r+o]}_slerp(e,t,r,i){Pr.slerpFlat(e,t,e,t,e,r,i)}_slerpAdditive(e,t,r,i,s){const o=this._workIndex*s;Pr.multiplyQuaternionsFlat(e,o,e,t,e,r),Pr.slerpFlat(e,t,e,t,e,o,i)}_lerp(e,t,r,i,s){const o=1-i;for(let a=0;a!==s;++a){const l=t+a;e[l]=e[l]*o+e[r+a]*i}}_lerpAdditive(e,t,r,i,s){for(let o=0;o!==s;++o){const a=t+o;e[a]=e[a]+e[r+o]*i}}}const i2="\\[\\]\\.:\\/",Pj=new RegExp("["+i2+"]","g"),s2="[^"+i2+"]",Ij="[^"+i2.replace("\\.","")+"]",Lj=/((?:WC+[\/:])*)/.source.replace("WC",s2),Dj=/(WCOD+)?/.source.replace("WCOD",Ij),kj=/(?:\.(WC+)(?:\[(.+)\])?)?/.source.replace("WC",s2),Fj=/\.(WC+)(?:\[(.+)\])?/.source.replace("WC",s2),Nj=new RegExp("^"+Lj+Dj+kj+Fj+"$"),Oj=["material","materials","bones","map"];class Uj{constructor(e,t,r){const i=r||ln.parseTrackName(t);this._targetGroup=e,this._bindings=e.subscribe_(t,i)}getValue(e,t){this.bind();const r=this._targetGroup.nCachedObjects_,i=this._bindings[r];i!==void 0&&i.getValue(e,t)}setValue(e,t){const r=this._bindings;for(let i=this._targetGroup.nCachedObjects_,s=r.length;i!==s;++i)r[i].setValue(e,t)}bind(){const e=this._bindings;for(let t=this._targetGroup.nCachedObjects_,r=e.length;t!==r;++t)e[t].bind()}unbind(){const e=this._bindings;for(let t=this._targetGroup.nCachedObjects_,r=e.length;t!==r;++t)e[t].unbind()}}class ln{constructor(e,t,r){this.path=t,this.parsedPath=r||ln.parseTrackName(t),this.node=ln.findNode(e,this.parsedPath.nodeName),this.rootNode=e,this.getValue=this._getValue_unbound,this.setValue=this._setValue_unbound}static create(e,t,r){return e&&e.isAnimationObjectGroup?new ln.Composite(e,t,r):new ln(e,t,r)}static sanitizeNodeName(e){return e.replace(/\s/g,"_").replace(Pj,"")}static parseTrackName(e){const t=Nj.exec(e);if(t===null)throw new Error("PropertyBinding: Cannot parse trackName: "+e);const r={nodeName:t[2],objectName:t[3],objectIndex:t[4],propertyName:t[5],propertyIndex:t[6]},i=r.nodeName&&r.nodeName.lastIndexOf(".");if(i!==void 0&&i!==-1){const s=r.nodeName.substring(i+1);Oj.indexOf(s)!==-1&&(r.nodeName=r.nodeName.substring(0,i),r.objectName=s)}if(r.propertyName===null||r.propertyName.length===0)throw new Error("PropertyBinding: can not parse propertyName from trackName: "+e);return r}static findNode(e,t){if(t===void 0||t===""||t==="."||t===-1||t===e.name||t===e.uuid)return e;if(e.skeleton){const r=e.skeleton.getBoneByName(t);if(r!==void 0)return r}if(e.children){const r=function(s){for(let o=0;o=s){const f=s++,p=e[f];t[p.uuid]=c,e[c]=p,t[u]=f,e[f]=l;for(let m=0,g=i;m!==g;++m){const v=r[m],y=v[f],w=v[c];v[c]=y,v[f]=w}}}this.nCachedObjects_=s}uncache(){const e=this._objects,t=this._indicesByUUID,r=this._bindings,i=r.length;let s=this.nCachedObjects_,o=e.length;for(let a=0,l=arguments.length;a!==l;++a){const u=arguments[a],c=u.uuid,f=t[c];if(f!==void 0)if(delete t[c],f0&&(t[m.uuid]=f),e[f]=m,e.pop();for(let g=0,v=i;g!==v;++g){const y=r[g];y[f]=y[p],y.pop()}}}this.nCachedObjects_=s}subscribe_(e,t){const r=this._bindingsIndicesByPath;let i=r[e];const s=this._bindings;if(i!==void 0)return s[i];const o=this._paths,a=this._parsedPaths,l=this._objects,u=l.length,c=this.nCachedObjects_,f=new Array(u);i=s.length,r[e]=i,o.push(e),a.push(t),s.push(f);for(let p=c,m=l.length;p!==m;++p){const g=l[p];f[p]=new ln(g,e,t)}return f}unsubscribe_(e){const t=this._bindingsIndicesByPath,r=t[e];if(r!==void 0){const i=this._paths,s=this._parsedPaths,o=this._bindings,a=o.length-1,l=o[a],u=e[a];t[u]=r,o[r]=l,o.pop(),s[r]=s[a],s.pop(),i[r]=i[a],i.pop()}}}class Gj{constructor(e,t,r=null,i=t.blendMode){this._mixer=e,this._clip=t,this._localRoot=r,this.blendMode=i;const s=t.tracks,o=s.length,a=new Array(o),l={endingStart:ou,endingEnd:ou};for(let u=0;u!==o;++u){const c=s[u].createInterpolant(null);a[u]=c,c.settings=l}this._interpolantSettings=l,this._interpolants=a,this._propertyBindings=new Array(o),this._cacheIndex=null,this._byClipCacheIndex=null,this._timeScaleInterpolant=null,this._weightInterpolant=null,this.loop=XL,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,r){if(e.fadeOut(t),this.fadeIn(t),r){const i=this._clip.duration,s=e._clip.duration,o=s/i,a=i/s;e.warp(1,o,t),this.warp(a,1,t)}return this}crossFadeTo(e,t,r){return e.crossFadeFrom(this,t,r)}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,r){const i=this._mixer,s=i.time,o=this.timeScale;let a=this._timeScaleInterpolant;a===null&&(a=i._lendControlInterpolant(),this._timeScaleInterpolant=a);const l=a.parameterPositions,u=a.sampleValues;return l[0]=s,l[1]=s+r,u[0]=e/o,u[1]=t/o,this}stopWarping(){const e=this._timeScaleInterpolant;return e!==null&&(this._timeScaleInterpolant=null,this._mixer._takeBackControlInterpolant(e)),this}getMixer(){return this._mixer}getClip(){return this._clip}getRoot(){return this._localRoot||this._mixer._root}_update(e,t,r,i){if(!this.enabled){this._updateWeight(e);return}const s=this._startTime;if(s!==null){const l=(e-s)*r;l<0||r===0?t=0:(this._startTime=null,t=r*l)}t*=this._updateTimeScale(e);const o=this._updateTime(t),a=this._updateWeight(e);if(a>0){const l=this._interpolants,u=this._propertyBindings;switch(this.blendMode){case _M:for(let c=0,f=l.length;c!==f;++c)l[c].evaluate(o),u[c].accumulateAdditive(a);break;case py:default:for(let c=0,f=l.length;c!==f;++c)l[c].evaluate(o),u[c].accumulate(i,a)}}}_updateWeight(e){let t=0;if(this.enabled){t=this.weight;const r=this._weightInterpolant;if(r!==null){const i=r.evaluate(e)[0];t*=i,e>r.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 r=this._timeScaleInterpolant;if(r!==null){const i=r.evaluate(e)[0];t*=i,e>r.parameterPositions[1]&&(this.stopWarping(),t===0?this.paused=!0:this.timeScale=t)}}return this._effectiveTimeScale=t,t}_updateTime(e){const t=this._clip.duration,r=this.loop;let i=this.time+e,s=this._loopCount;const o=r===YL;if(e===0)return s===-1?i:o&&(s&1)===1?t-i:i;if(r===jL){s===-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(s===-1&&(e>=0?(s=0,this._setEndings(!0,this.repetitions===0,o)):this._setEndings(this.repetitions===0,!0,o)),i>=t||i<0){const a=Math.floor(i/t);i-=t*a,s+=Math.abs(a);const l=this.repetitions-s;if(l<=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(l===1){const u=e<0;this._setEndings(u,!u,o)}else this._setEndings(!1,!1,o);this._loopCount=s,this.time=i,this._mixer.dispatchEvent({type:"loop",action:this,loopDelta:a})}}else this.time=i;if(o&&(s&1)===1)return t-i}return i}_setEndings(e,t,r){const i=this._interpolantSettings;r?(i.endingStart=au,i.endingEnd=au):(e?i.endingStart=this.zeroSlopeAtStart?au:ou:i.endingStart=Qd,t?i.endingEnd=this.zeroSlopeAtEnd?au:ou:i.endingEnd=Qd)}_scheduleFading(e,t,r){const i=this._mixer,s=i.time;let o=this._weightInterpolant;o===null&&(o=i._lendControlInterpolant(),this._weightInterpolant=o);const a=o.parameterPositions,l=o.sampleValues;return a[0]=s,l[0]=t,a[1]=s+e,l[1]=r,this}}const Hj=new Float32Array(1);class Vj extends bo{constructor(e){super(),this._root=e,this._initMemoryManager(),this._accuIndex=0,this.time=0,this.timeScale=1}_bindAction(e,t){const r=e._localRoot||this._root,i=e._clip.tracks,s=i.length,o=e._propertyBindings,a=e._interpolants,l=r.uuid,u=this._bindingsByRootAndName;let c=u[l];c===void 0&&(c={},u[l]=c);for(let f=0;f!==s;++f){const p=i[f],m=p.name;let g=c[m];if(g!==void 0)++g.referenceCount,o[f]=g;else{if(g=o[f],g!==void 0){g._cacheIndex===null&&(++g.referenceCount,this._addInactiveBinding(g,l,m));continue}const v=t&&t._propertyBindings[f].binding.parsedPath;g=new XD(ln.create(r,m,v),p.ValueTypeName,p.getValueSize()),++g.referenceCount,this._addInactiveBinding(g,l,m),o[f]=g}a[f].resultBuffer=g.buffer}}_activateAction(e){if(!this._isActiveAction(e)){if(e._cacheIndex===null){const r=(e._localRoot||this._root).uuid,i=e._clip.uuid,s=this._actionsByClip[i];this._bindAction(e,s&&s.knownActions[0]),this._addInactiveAction(e,i,r)}const t=e._propertyBindings;for(let r=0,i=t.length;r!==i;++r){const s=t[r];s.useCount++===0&&(this._lendBinding(s),s.saveOriginalState())}this._lendAction(e)}}_deactivateAction(e){if(this._isActiveAction(e)){const t=e._propertyBindings;for(let r=0,i=t.length;r!==i;++r){const s=t[r];--s.useCount===0&&(s.restoreOriginalState(),this._takeBackBinding(s))}this._takeBackAction(e)}}_initMemoryManager(){this._actions=[],this._nActiveActions=0,this._actionsByClip={},this._bindings=[],this._nActiveBindings=0,this._bindingsByRootAndName={},this._controlInterpolants=[],this._nActiveControlInterpolants=0;const e=this;this.stats={actions:{get total(){return e._actions.length},get inUse(){return e._nActiveActions}},bindings:{get total(){return e._bindings.length},get inUse(){return e._nActiveBindings}},controlInterpolants:{get total(){return e._controlInterpolants.length},get inUse(){return e._nActiveControlInterpolants}}}}_isActiveAction(e){const t=e._cacheIndex;return t!==null&&t=0;--r)e[r].stop();return this}update(e){e*=this.timeScale;const t=this._actions,r=this._nActiveActions,i=this.time+=e,s=Math.sign(e),o=this._accuIndex^=1;for(let u=0;u!==r;++u)t[u]._update(i,e,s,o);const a=this._bindings,l=this._nActiveBindings;for(let u=0;u!==l;++u)a[u].apply(o);return this}setTime(e){this.time=0;for(let t=0;tthis.max.x||e.ythis.max.y)}containsBox(e){return this.min.x<=e.min.x&&e.max.x<=this.max.x&&this.min.y<=e.min.y&&e.max.y<=this.max.y}getParameter(e,t){return t.set((e.x-this.min.x)/(this.max.x-this.min.x),(e.y-this.min.y)/(this.max.y-this.min.y))}intersectsBox(e){return!(e.max.xthis.max.x||e.max.ythis.max.y)}clampPoint(e,t){return t.copy(e).clamp(this.min,this.max)}distanceToPoint(e){return this.clampPoint(e,C3).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 b3=new Z,Ug=new Z;class Zj{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){b3.subVectors(e,this.start),Ug.subVectors(this.end,this.start);const r=Ug.dot(Ug);let s=Ug.dot(b3)/r;return t&&(s=ir(s,0,1)),s}closestPointToPoint(e,t,r){const i=this.closestPointToPointParameter(e,t);return this.delta(r).multiplyScalar(i).add(this.start)}applyMatrix4(e){return this.start.applyMatrix4(e),this.end.applyMatrix4(e),this}equals(e){return e.start.equals(this.start)&&e.end.equals(this.end)}clone(){return new this.constructor().copy(this)}}const T3=new Z;class Qj extends sn{constructor(e,t){super(),this.light=e,this.matrix=e.matrixWorld,this.matrixAutoUpdate=!1,this.color=t,this.type="SpotLightHelper";const r=new Ut,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 o=0,a=1,l=32;o1)for(let f=0;f.99999)this.quaternion.set(0,0,0,1);else if(e.y<-.99999)this.quaternion.set(1,0,0,0);else{L3.set(e.z,0,-e.x).normalize();const t=Math.acos(e.y);this.quaternion.setFromAxisAngle(L3,t)}}setLength(e,t=e*.2,r=t*.2){this.line.scale.set(1,Math.max(1e-4,e-t),1),this.line.updateMatrix(),this.cone.scale.set(r,t,r),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 cX extends Qs{constructor(e=1){const t=[0,0,0,e,0,0,0,0,0,0,e,0,0,0,0,0,0,e],r=[1,0,0,1,.6,0,0,1,0,.6,1,0,0,0,1,0,.6,1],i=new Ut;i.setAttribute("position",new xt(t,3)),i.setAttribute("color",new xt(r,3));const s=new ii({vertexColors:!0,toneMapped:!1});super(i,s),this.type="AxesHelper"}setColors(e,t,r){const i=new st,s=this.geometry.attributes.color.array;return i.set(e),i.toArray(s,0),i.toArray(s,3),i.set(t),i.toArray(s,6),i.toArray(s,9),i.set(r),i.toArray(s,12),i.toArray(s,15),this.geometry.attributes.color.needsUpdate=!0,this}dispose(){this.geometry.dispose(),this.material.dispose()}}class fX{constructor(){this.type="ShapePath",this.color=new st,this.subPaths=[],this.currentPath=null}moveTo(e,t){return this.currentPath=new tp,this.subPaths.push(this.currentPath),this.currentPath.moveTo(e,t),this}lineTo(e,t){return this.currentPath.lineTo(e,t),this}quadraticCurveTo(e,t,r,i){return this.currentPath.quadraticCurveTo(e,t,r,i),this}bezierCurveTo(e,t,r,i,s,o){return this.currentPath.bezierCurveTo(e,t,r,i,s,o),this}splineThru(e){return this.currentPath.splineThru(e),this}toShapes(e){function t(w){const _=[];for(let x=0,A=w.length;xNumber.EPSILON){if(D<0&&(R=_[b],B=-B,E=_[C],D=-D),w.yE.y)continue;if(w.y===R.y){if(w.x===R.x)return!0}else{const U=D*(w.x-R.x)-B*(w.y-R.y);if(U===0)return!0;if(U<0)continue;A=!A}}else{if(w.y!==R.y)continue;if(E.x<=w.x&&w.x<=R.x||R.x<=w.x&&w.x<=E.x)return!0}}return A}const i=_o.isClockWise,s=this.subPaths;if(s.length===0)return[];let o,a,l;const u=[];if(s.length===1)return a=s[0],l=new vu,l.curves=a.curves,u.push(l),u;let c=!i(s[0].getPoints());c=e?!c:c;const f=[],p=[];let m=[],g=0,v;p[g]=void 0,m[g]=[];for(let w=0,_=s.length;w<_;w++)a=s[w],v=a.getPoints(),o=i(v),o=e?!o:o,o?(!c&&p[g]&&g++,p[g]={s:new vu,p:v},p[g].s.curves=a.curves,c&&g++,m[g]=[]):m[g].push({h:a,p:v[0]});if(!p[0])return t(s);if(p.length>1){let w=!1,_=0;for(let x=0,A=p.length;x0&&w===!1&&(m=f)}let y;for(let w=0,_=p.length;w<_;w++){l=p[w].s,u.push(l),y=m[w];for(let x=0,A=y.length;x>-u-14,r[l|256]=1024>>-u-14|32768,i[l]=-u-1,i[l|256]=-u-1):u<=15?(r[l]=u+15<<10,r[l|256]=u+15<<10|32768,i[l]=13,i[l|256]=13):u<128?(r[l]=31744,r[l|256]=64512,i[l]=24,i[l|256]=24):(r[l]=31744,r[l|256]=64512,i[l]=13,i[l|256]=13)}const s=new Uint32Array(2048),o=new Uint32Array(64),a=new Uint32Array(64);for(let l=1;l<1024;++l){let u=l<<13,c=0;for(;!(u&8388608);)u<<=1,c-=8388608;u&=-8388609,c+=947912704,s[l]=u|c}for(let l=1024;l<2048;++l)s[l]=939524096+(l-1024<<13);for(let l=1;l<31;++l)o[l]=l<<23;o[31]=1199570944,o[32]=2147483648;for(let l=33;l<63;++l)o[l]=2147483648+(l-32<<23);o[63]=3347054592;for(let l=1;l<64;++l)l!==32&&(a[l]=1024);return{floatView:e,uint32View:t,baseTable:r,shiftTable:i,mantissaTable:s,exponentTable:o,offsetTable:a}}function dX(n){Math.abs(n)>65504&&console.warn("THREE.DataUtils.toHalfFloat(): Value out of range."),n=ir(n,-65504,65504),Zo.floatView[0]=n;const e=Zo.uint32View[0],t=e>>23&511;return Zo.baseTable[t]+((e&8388607)>>Zo.shiftTable[t])}function pX(n){const e=n>>10;return Zo.uint32View[0]=Zo.mantissaTable[Zo.offsetTable[e]+(n&1023)]+Zo.exponentTable[e],Zo.floatView[0]}const cu={toHalfFloat:dX,fromHalfFloat:pX};class mX extends _l{constructor(e,t,r,i,s,o){console.warn("THREE.BoxBufferGeometry has been renamed to THREE.BoxGeometry."),super(e,t,r,i,s,o)}}class gX extends Rp{constructor(e,t,r,i){console.warn("THREE.CapsuleBufferGeometry has been renamed to THREE.CapsuleGeometry."),super(e,t,r,i)}}class vX extends Bp{constructor(e,t,r,i){console.warn("THREE.CircleBufferGeometry has been renamed to THREE.CircleGeometry."),super(e,t,r,i)}}class yX extends Pp{constructor(e,t,r,i,s,o,a){console.warn("THREE.ConeBufferGeometry has been renamed to THREE.ConeGeometry."),super(e,t,r,i,s,o,a)}}class xX extends Du{constructor(e,t,r,i,s,o,a,l){console.warn("THREE.CylinderBufferGeometry has been renamed to THREE.CylinderGeometry."),super(e,t,r,i,s,o,a,l)}}class _X extends Ip{constructor(e,t){console.warn("THREE.DodecahedronBufferGeometry has been renamed to THREE.DodecahedronGeometry."),super(e,t)}}class wX extends Lp{constructor(e,t){console.warn("THREE.ExtrudeBufferGeometry has been renamed to THREE.ExtrudeGeometry."),super(e,t)}}class SX extends Lf{constructor(e,t){console.warn("THREE.IcosahedronBufferGeometry has been renamed to THREE.IcosahedronGeometry."),super(e,t)}}class AX extends If{constructor(e,t,r,i){console.warn("THREE.LatheBufferGeometry has been renamed to THREE.LatheGeometry."),super(e,t,r,i)}}class MX extends Df{constructor(e,t){console.warn("THREE.OctahedronBufferGeometry has been renamed to THREE.OctahedronGeometry."),super(e,t)}}class EX extends Ro{constructor(e,t,r,i){console.warn("THREE.PlaneBufferGeometry has been renamed to THREE.PlaneGeometry."),super(e,t,r,i)}}class CX extends ya{constructor(e,t,r,i){console.warn("THREE.PolyhedronBufferGeometry has been renamed to THREE.PolyhedronGeometry."),super(e,t,r,i)}}class bX extends Dp{constructor(e,t,r,i,s,o){console.warn("THREE.RingBufferGeometry has been renamed to THREE.RingGeometry."),super(e,t,r,i,s,o)}}class TX extends kp{constructor(e,t){console.warn("THREE.ShapeBufferGeometry has been renamed to THREE.ShapeGeometry."),super(e,t)}}class RX extends kf{constructor(e,t,r,i,s,o,a){console.warn("THREE.SphereBufferGeometry has been renamed to THREE.SphereGeometry."),super(e,t,r,i,s,o,a)}}class BX extends Fp{constructor(e,t){console.warn("THREE.TetrahedronBufferGeometry has been renamed to THREE.TetrahedronGeometry."),super(e,t)}}class PX extends Np{constructor(e,t,r,i,s){console.warn("THREE.TorusBufferGeometry has been renamed to THREE.TorusGeometry."),super(e,t,r,i,s)}}class IX extends Op{constructor(e,t,r,i,s,o){console.warn("THREE.TorusKnotBufferGeometry has been renamed to THREE.TorusKnotGeometry."),super(e,t,r,i,s,o)}}class LX extends Up{constructor(e,t,r,i,s){console.warn("THREE.TubeBufferGeometry has been renamed to THREE.TubeGeometry."),super(e,t,r,i,s)}}typeof __THREE_DEVTOOLS__<"u"&&__THREE_DEVTOOLS__.dispatchEvent(new CustomEvent("register",{detail:{revision:_p}}));typeof window<"u"&&(window.__THREE__?console.warn("WARNING: Multiple instances of Three.js being imported."):window.__THREE__=_p);const DX=Object.freeze(Object.defineProperty({__proto__:null,ACESFilmicToneMapping:vM,AddEquation:eu,AddOperation:bL,AdditiveAnimationBlendMode:_M,AdditiveBlending:zw,AlphaFormat:NL,AlwaysDepth:_L,AlwaysStencilFunc:qL,AmbientLight:GD,AmbientLightProbe:Mj,AnimationClip:Mf,AnimationLoader:mj,AnimationMixer:Vj,AnimationObjectGroup:zj,AnimationUtils:fj,ArcCurve:gD,ArrayCamera:fD,ArrowHelper:uX,Audio:jD,AudioAnalyser:Bj,AudioContext:n2,AudioListener:bj,AudioLoader:Sj,AxesHelper:cX,BackSide:vi,BasicDepthPacking:ZL,BasicShadowMap:oL,Bone:Ay,BooleanKeyframeTrack:ku,Box2:Kj,Box3:Zs,Box3Helper:aX,BoxBufferGeometry:mX,BoxGeometry:_l,BoxHelper:oX,BufferAttribute:mn,BufferGeometry:Ut,BufferGeometryLoader:WD,ByteType:IL,Cache:Pu,Camera:Mp,CameraHelper:sX,CanvasTexture:kJ,CapsuleBufferGeometry:gX,CapsuleGeometry:Rp,CatmullRomCurve3:vD,CineonToneMapping:BL,CircleBufferGeometry:vX,CircleGeometry:Bp,ClampToEdgeWrapping:Ur,Clock:r2,Color:st,ColorKeyframeTrack:YM,ColorManagement:$r,CompressedArrayTexture:DJ,CompressedTexture:NM,CompressedTextureLoader:gj,ConeBufferGeometry:yX,ConeGeometry:Pp,CubeCamera:iD,CubeReflectionMapping:da,CubeRefractionMapping:hl,CubeTexture:Ep,CubeTextureLoader:OD,CubeUVReflectionMapping:Bf,CubicBezierCurve:UM,CubicBezierCurve3:yD,CubicInterpolant:DD,CullFaceBack:Uw,CullFaceFront:sL,CullFaceFrontBack:D8,CullFaceNone:iL,Curve:qs,CurvePath:_D,CustomBlending:aL,CustomToneMapping:PL,CylinderBufferGeometry:xX,CylinderGeometry:Du,Cylindrical:Yj,Data3DTexture:CM,DataArrayTexture:my,DataTexture:$c,DataTextureLoader:ZM,DataUtils:cu,DecrementStencilOp:W8,DecrementWrapStencilOp:j8,DefaultLoadingManager:ND,DepthFormat:ll,DepthStencilFormat:bu,DepthTexture:PM,DirectionalLight:e2,DirectionalLightHelper:iX,DiscreteInterpolant:kD,DisplayP3ColorSpace:AM,DodecahedronBufferGeometry:_X,DodecahedronGeometry:Ip,DoubleSide:$i,DstAlphaFactor:pL,DstColorFactor:gL,DynamicCopyUsage:a9,DynamicDrawUsage:t9,DynamicReadUsage:i9,EdgesGeometry:wD,EllipseCurve:Ey,EqualDepth:SL,EqualStencilFunc:Z8,EquirectangularReflectionMapping:gf,EquirectangularRefractionMapping:Kd,Euler:Ap,EventDispatcher:bo,ExtrudeBufferGeometry:wX,ExtrudeGeometry:Lp,FileLoader:rs,Float16BufferAttribute:X9,Float32BufferAttribute:xt,Float64BufferAttribute:Y9,FloatType:zr,Fog:Sy,FogExp2:wy,FramebufferTexture:LJ,FrontSide:Ys,Frustum:vy,GLBufferAttribute:Xj,GLSL1:u9,GLSL3:pS,GreaterDepth:ML,GreaterEqualDepth:AL,GreaterEqualStencilFunc:e9,GreaterStencilFunc:q8,GridHelper:nX,Group:ra,HalfFloatType:Gr,HemisphereLight:zD,HemisphereLightHelper:tX,HemisphereLightProbe:Aj,IcosahedronBufferGeometry:SX,IcosahedronGeometry:Lf,ImageBitmapLoader:JD,ImageLoader:sp,ImageUtils:EM,IncrementStencilOp:V8,IncrementWrapStencilOp:J8,InstancedBufferAttribute:Ru,InstancedBufferGeometry:t2,InstancedInterleavedBuffer:jj,InstancedMesh:DM,Int16BufferAttribute:J9,Int32BufferAttribute:j9,Int8BufferAttribute:H9,IntType:DL,InterleavedBuffer:bp,InterleavedBufferAttribute:pl,Interpolant:Ff,InterpolateDiscrete:yf,InterpolateLinear:Tu,InterpolateSmooth:M0,InvertStencilOp:X8,KeepStencilOp:E0,KeyframeTrack:eo,LOD:mD,LatheBufferGeometry:AX,LatheGeometry:If,Layers:gu,LessDepth:wL,LessEqualDepth:Pv,LessEqualStencilFunc:Q8,LessStencilFunc:K8,Light:wl,LightProbe:Ty,Line:ga,Line3:Zj,LineBasicMaterial:ii,LineCurve:Cy,LineCurve3:xD,LineDashedMaterial:ID,LineLoop:kM,LineSegments:Qs,LinearEncoding:ma,LinearFilter:gn,LinearInterpolant:XM,LinearMipMapLinearFilter:U8,LinearMipMapNearestFilter:O8,LinearMipmapLinearFilter:Ao,LinearMipmapNearestFilter:dy,LinearSRGBColorSpace:xf,LinearToneMapping:TL,Loader:Ai,LoaderUtils:wo,LoadingManager:KM,LoopOnce:jL,LoopPingPong:YL,LoopRepeat:XL,LuminanceAlphaFormat:UL,LuminanceFormat:OL,MOUSE:Ql,Material:fr,MaterialLoader:Ry,MathUtils:go,Matrix3:Rr,Matrix4:Lt,MaxEquation:Ww,Mesh:Vn,MeshBasicMaterial:Ii,MeshDepthMaterial:Cp,MeshDistanceMaterial:xy,MeshLambertMaterial:WM,MeshMatcapMaterial:PD,MeshNormalMaterial:BD,MeshPhongMaterial:TD,MeshPhysicalMaterial:$s,MeshStandardMaterial:zp,MeshToonMaterial:RD,MinEquation:Vw,MirroredRepeatWrapping:vf,MixOperation:CL,MultiplyBlending:Hw,MultiplyOperation:wp,NearestFilter:Zn,NearestMipMapLinearFilter:N8,NearestMipMapNearestFilter:F8,NearestMipmapLinearFilter:Qc,NearestMipmapNearestFilter:Zd,NeverDepth:xL,NeverStencilFunc:Y8,NoBlending:sa,NoColorSpace:z8,NoToneMapping:js,NormalAnimationBlendMode:py,NormalBlending:du,NotEqualDepth:EL,NotEqualStencilFunc:$8,NumberKeyframeTrack:Sf,Object3D:sn,ObjectLoader:_j,ObjectSpaceNormalMap:QL,OctahedronBufferGeometry:MX,OctahedronGeometry:Df,OneFactor:fL,OneMinusDstAlphaFactor:mL,OneMinusDstColorFactor:vL,OneMinusSrcAlphaFactor:gM,OneMinusSrcColorFactor:dL,OrthographicCamera:oa,PCFShadowMap:fy,PCFSoftShadowMap:pd,PMREMGenerator:gS,Path:tp,PerspectiveCamera:Qn,Plane:Ha,PlaneBufferGeometry:EX,PlaneGeometry:Ro,PlaneHelper:lX,PointLight:$M,PointLightHelper:$j,Points:FM,PointsMaterial:My,PolarGridHelper:rX,PolyhedronBufferGeometry:CX,PolyhedronGeometry:ya,PositionalAudio:Rj,PropertyBinding:ln,PropertyMixer:XD,QuadraticBezierCurve:zM,QuadraticBezierCurve3:GM,Quaternion:Pr,QuaternionKeyframeTrack:ml,QuaternionLinearInterpolant:FD,RED_GREEN_RGTC2_Format:hS,RED_RGTC1_Format:JL,REVISION:_p,RGBADepthPacking:SM,RGBAFormat:mi,RGBAIntegerFormat:VL,RGBA_ASTC_10x10_Format:lS,RGBA_ASTC_10x5_Format:sS,RGBA_ASTC_10x6_Format:oS,RGBA_ASTC_10x8_Format:aS,RGBA_ASTC_12x10_Format:uS,RGBA_ASTC_12x12_Format:cS,RGBA_ASTC_4x4_Format:Qw,RGBA_ASTC_5x4_Format:qw,RGBA_ASTC_5x5_Format:$w,RGBA_ASTC_6x5_Format:eS,RGBA_ASTC_6x6_Format:tS,RGBA_ASTC_8x5_Format:nS,RGBA_ASTC_8x6_Format:rS,RGBA_ASTC_8x8_Format:iS,RGBA_BPTC_Format:A0,RGBA_ETC2_EAC_Format:Zw,RGBA_PVRTC_2BPPV1_Format:Yw,RGBA_PVRTC_4BPPV1_Format:Xw,RGBA_S3TC_DXT1_Format:_0,RGBA_S3TC_DXT3_Format:w0,RGBA_S3TC_DXT5_Format:S0,RGB_ETC1_Format:WL,RGB_ETC2_Format:Kw,RGB_PVRTC_2BPPV1_Format:jw,RGB_PVRTC_4BPPV1_Format:Jw,RGB_S3TC_DXT1_Format:x0,RGFormat:GL,RGIntegerFormat:HL,RawShaderMaterial:bD,Ray:Sp,Raycaster:a2,RectAreaLight:HD,RedFormat:xM,RedIntegerFormat:zL,ReinhardToneMapping:RL,RepeatWrapping:dl,ReplaceStencilOp:H8,ReverseSubtractEquation:uL,RingBufferGeometry:bX,RingGeometry:Dp,SIGNED_RED_GREEN_RGTC2_Format:dS,SIGNED_RED_RGTC1_Format:fS,SRGBColorSpace:Os,Scene:wf,ShaderChunk:zt,ShaderLib:zs,ShaderMaterial:Oi,ShadowMaterial:CD,Shape:vu,ShapeBufferGeometry:TX,ShapeGeometry:kp,ShapePath:fX,ShapeUtils:_o,ShortType:LL,Skeleton:Tp,SkeletonHelper:qj,SkinnedMesh:LM,Source:lu,Sphere:To,SphereBufferGeometry:RX,SphereGeometry:kf,Spherical:AS,SphericalHarmonics3:VD,SplineCurve:HM,SpotLight:qM,SpotLightHelper:Qj,Sprite:pD,SpriteMaterial:IM,SrcAlphaFactor:mM,SrcAlphaSaturateFactor:yL,SrcColorFactor:hL,StaticCopyUsage:o9,StaticDrawUsage:qd,StaticReadUsage:r9,StereoCamera:Ej,StreamCopyUsage:l9,StreamDrawUsage:n9,StreamReadUsage:s9,StringKeyframeTrack:Fu,SubtractEquation:lL,SubtractiveBlending:Gw,TOUCH:ql,TangentSpaceNormalMap:xl,TetrahedronBufferGeometry:BX,TetrahedronGeometry:Fp,Texture:Rn,TextureLoader:UD,TorusBufferGeometry:PX,TorusGeometry:Np,TorusKnotBufferGeometry:IX,TorusKnotGeometry:Op,Triangle:_s,TriangleFanDrawMode:Iv,TriangleStripDrawMode:wM,TrianglesDrawMode:KL,TubeBufferGeometry:LX,TubeGeometry:Up,TwoPassDoubleSide:k8,UVMapping:hy,Uint16BufferAttribute:bM,Uint32BufferAttribute:TM,Uint8BufferAttribute:V9,Uint8ClampedBufferAttribute:W9,Uniform:o2,UniformsGroup:Jj,UniformsLib:at,UniformsUtils:gy,UnsignedByteType:pa,UnsignedInt248Type:pu,UnsignedIntType:Ka,UnsignedShort4444Type:kL,UnsignedShort5551Type:FL,UnsignedShortType:yM,VSMShadowMap:su,Vector2:ze,Vector3:Z,Vector4:vn,VectorKeyframeTrack:Af,VideoTexture:IJ,WebGL1Renderer:hD,WebGL3DRenderTarget:I9,WebGLArrayRenderTarget:P9,WebGLCubeRenderTarget:RM,WebGLMultipleRenderTargets:L9,WebGLRenderTarget:ri,WebGLRenderer:_y,WebGLUtils:cD,WireframeGeometry:ED,WrapAroundEnding:Qd,ZeroCurvatureEnding:ou,ZeroFactor:cL,ZeroSlopeEnding:au,ZeroStencilOp:G8,_SRGBAFormat:Lv,sRGBEncoding:wn},Symbol.toStringTag,{value:"Module"}));var Qa={},kX={get exports(){return Qa},set exports(n){Qa=n}},Nu={};/** - * @license React - * react-reconciler-constants.production.min.js - * - * Copyright (c) Facebook, Inc. and its affiliates. - * - * This source code is licensed under the MIT license found in the - * LICENSE file in the root directory of this source tree. - */Nu.ConcurrentRoot=1;Nu.ContinuousEventPriority=4;Nu.DefaultEventPriority=16;Nu.DiscreteEventPriority=1;Nu.IdleEventPriority=536870912;Nu.LegacyRoot=0;(function(n){n.exports=Nu})(kX);function FX(n){let e;const t=new Set,r=(u,c)=>{const f=typeof u=="function"?u(e):u;if(f!==e){const p=e;e=c?f:Object.assign({},e,f),t.forEach(m=>m(e,p))}},i=()=>e,s=(u,c=i,f=Object.is)=>{console.warn("[DEPRECATED] Please use `subscribeWithSelector` middleware");let p=c(e);function m(){const g=c(e);if(!f(p,g)){const v=p;u(p=g,v)}}return t.add(m),()=>t.delete(m)},l={setState:r,getState:i,subscribe:(u,c,f)=>c||f?s(u,c,f):(t.add(u),()=>t.delete(u)),destroy:()=>t.clear()};return e=n(r,i,l),l}const NX=typeof window>"u"||!window.navigator||/ServerSideRendering|^Deno\//.test(window.navigator.userAgent),D3=NX?ee.useEffect:ee.useLayoutEffect;function KD(n){const e=typeof n=="function"?FX(n):n,t=(r=e.getState,i=Object.is)=>{const[,s]=ee.useReducer(y=>y+1,0),o=e.getState(),a=ee.useRef(o),l=ee.useRef(r),u=ee.useRef(i),c=ee.useRef(!1),f=ee.useRef();f.current===void 0&&(f.current=r(o));let p,m=!1;(a.current!==o||l.current!==r||u.current!==i||c.current)&&(p=r(o),m=!i(f.current,p)),D3(()=>{m&&(f.current=p),a.current=o,l.current=r,u.current=i,c.current=!1});const g=ee.useRef(o);D3(()=>{const y=()=>{try{const _=e.getState(),x=l.current(_);u.current(f.current,x)||(a.current=_,f.current=x,s())}catch{c.current=!0,s()}},w=e.subscribe(y);return e.getState()!==g.current&&y(),w},[]);const v=m?p:f.current;return ee.useDebugValue(v),v};return Object.assign(t,e),t[Symbol.iterator]=function(){console.warn("[useStore, api] = create() is deprecated and will be removed in v4");const r=[t,e];return{next(){const i=r.length<=0;return{value:r.shift(),done:i}}}},t}var MS={},OX={get exports(){return MS},set exports(n){MS=n}},op={},UX={get exports(){return op},set exports(n){op=n}},ZD={};/** - * @license React - * scheduler.production.min.js - * - * Copyright (c) Facebook, Inc. and its affiliates. - * - * This source code is licensed under the MIT license found in the - * LICENSE file in the root directory of this source tree. - */(function(n){function e(N,V){var j=N.length;N.push(V);e:for(;0>>1,k=N[W];if(0>>1;Wi(X,j))Ji(ae,X)?(N[W]=ae,N[J]=j,W=J):(N[W]=X,N[q]=j,W=q);else if(Ji(ae,j))N[W]=ae,N[J]=j,W=J;else break e}}return V}function i(N,V){var j=N.sortIndex-V.sortIndex;return j!==0?j:N.id-V.id}if(typeof performance=="object"&&typeof performance.now=="function"){var s=performance;n.unstable_now=function(){return s.now()}}else{var o=Date,a=o.now();n.unstable_now=function(){return o.now()-a}}var l=[],u=[],c=1,f=null,p=3,m=!1,g=!1,v=!1,y=typeof setTimeout=="function"?setTimeout:null,w=typeof clearTimeout=="function"?clearTimeout:null,_=typeof setImmediate<"u"?setImmediate:null;typeof navigator<"u"&&navigator.scheduling!==void 0&&navigator.scheduling.isInputPending!==void 0&&navigator.scheduling.isInputPending.bind(navigator.scheduling);function x(N){for(var V=t(u);V!==null;){if(V.callback===null)r(u);else if(V.startTime<=N)r(u),V.sortIndex=V.expirationTime,e(l,V);else break;V=t(u)}}function A(N){if(v=!1,x(N),!g)if(t(l)!==null)g=!0,G(C);else{var V=t(u);V!==null&&ie(A,V.startTime-N)}}function C(N,V){g=!1,v&&(v=!1,w(E),E=-1),m=!0;var j=p;try{for(x(V),f=t(l);f!==null&&(!(f.expirationTime>V)||N&&!U());){var W=f.callback;if(typeof W=="function"){f.callback=null,p=f.priorityLevel;var k=W(f.expirationTime<=V);V=n.unstable_now(),typeof k=="function"?f.callback=k:f===t(l)&&r(l),x(V)}else r(l);f=t(l)}if(f!==null)var Q=!0;else{var q=t(u);q!==null&&ie(A,q.startTime-V),Q=!1}return Q}finally{f=null,p=j,m=!1}}var b=!1,R=null,E=-1,B=5,D=-1;function U(){return!(n.unstable_now()-DN||125W?(N.sortIndex=j,e(u,N),t(l)===null&&N===t(u)&&(v?(w(E),E=-1):v=!0,ie(A,j-W))):(N.sortIndex=k,e(l,N),g||m||(g=!0,G(C))),N},n.unstable_shouldYield=U,n.unstable_wrapCallback=function(N){var V=p;return function(){var j=p;p=V;try{return N.apply(this,arguments)}finally{p=j}}}})(ZD);(function(n){n.exports=ZD})(UX);/** - * @license React - * react-reconciler.production.min.js - * - * Copyright (c) Facebook, Inc. and its affiliates. - * - * This source code is licensed under the MIT license found in the - * LICENSE file in the root directory of this source tree. - */var zX=function(e){var t={},r=ee,i=op,s=Object.assign;function o(h){for(var d="https://reactjs.org/docs/error-decoder.html?invariant="+h,S=1;Sde||T[ne]!==I[de]){var Oe=` -`+T[ne].replace(" at new "," at ");return h.displayName&&Oe.includes("")&&(Oe=Oe.replace("",h.displayName)),Oe}while(1<=ne&&0<=de);break}}}finally{it=!1,Error.prepareStackTrace=S}return(h=h?h.displayName||h.name:"")?Wt(h):""}var It=Object.prototype.hasOwnProperty,Tt=[],kt=-1;function At(h){return{current:h}}function Mt(h){0>kt||(h.current=Tt[kt],Tt[kt]=null,kt--)}function Pt(h,d){kt++,Tt[kt]=h.current,h.current=d}var Rt={},$t=At(Rt),Dt=At(!1),en=Rt;function sr(h,d){var S=h.type.contextTypes;if(!S)return Rt;var M=h.stateNode;if(M&&M.__reactInternalMemoizedUnmaskedChildContext===d)return M.__reactInternalMemoizedMaskedChildContext;var T={},I;for(I in S)T[I]=d[I];return M&&(h=h.stateNode,h.__reactInternalMemoizedUnmaskedChildContext=d,h.__reactInternalMemoizedMaskedChildContext=T),T}function Sn(h){return h=h.childContextTypes,h!=null}function $n(){Mt(Dt),Mt($t)}function on(h,d,S){if($t.current!==Rt)throw Error(o(168));Pt($t,d),Pt(Dt,S)}function Nn(h,d,S){var M=h.stateNode;if(d=d.childContextTypes,typeof M.getChildContext!="function")return S;M=M.getChildContext();for(var T in M)if(!(T in d))throw Error(o(108,E(h)||"Unknown",T));return s({},S,M)}function tn(h){return h=(h=h.stateNode)&&h.__reactInternalMemoizedMergedChildContext||Rt,en=$t.current,Pt($t,h),Pt(Dt,Dt.current),!0}function an(h,d,S){var M=h.stateNode;if(!M)throw Error(o(169));S?(h=Nn(h,d,en),M.__reactInternalMemoizedMergedChildContext=h,Mt(Dt),Mt($t),Pt($t,h)):Mt(Dt),Pt(Dt,S)}var yn=Math.clz32?Math.clz32:Ui,Mi=Math.log,er=Math.LN2;function Ui(h){return h>>>=0,h===0?32:31-(Mi(h)/er|0)|0}var Bo=64,Po=4194304;function Io(h){switch(h&-h){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return h&4194240;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return h&130023424;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 1073741824;default:return h}}function Al(h,d){var S=h.pendingLanes;if(S===0)return 0;var M=0,T=h.suspendedLanes,I=h.pingedLanes,ne=S&268435455;if(ne!==0){var de=ne&~T;de!==0?M=Io(de):(I&=ne,I!==0&&(M=Io(I)))}else ne=S&~T,ne!==0?M=Io(ne):I!==0&&(M=Io(I));if(M===0)return 0;if(d!==0&&d!==M&&!(d&T)&&(T=M&-M,I=d&-d,T>=I||T===16&&(I&4194240)!==0))return d;if(M&4&&(M|=S&16),d=h.entangledLanes,d!==0)for(h=h.entanglements,d&=M;0S;S++)d.push(h);return d}function to(h,d,S){h.pendingLanes|=d,d!==536870912&&(h.suspendedLanes=0,h.pingedLanes=0),h=h.eventTimes,d=31-yn(d),h[d]=S}function xa(h,d){var S=h.pendingLanes&~d;h.pendingLanes=d,h.suspendedLanes=0,h.pingedLanes=0,h.expiredLanes&=d,h.mutableReadLanes&=d,h.entangledLanes&=d,d=h.entanglements;var M=h.eventTimes;for(h=h.expirationTimes;0>=ne,T-=ne,Fo=1<<32-yn(d)+T|S<hn?(Ar=Nt,Nt=null):Ar=Nt.sibling;var dn=Bt(Re,Nt,Ne[hn],ft);if(dn===null){Nt===null&&(Nt=Ar);break}h&&Nt&&dn.alternate===null&&d(Re,Nt),ve=I(dn,ve,hn),Gt===null?wt=dn:Gt.sibling=dn,Gt=dn,Nt=Ar}if(hn===Ne.length)return S(Re,Nt),kn&&Tl(Re,hn),wt;if(Nt===null){for(;hnhn?(Ar=Nt,Nt=null):Ar=Nt.sibling;var Ra=Bt(Re,Nt,dn.value,ft);if(Ra===null){Nt===null&&(Nt=Ar);break}h&&Nt&&Ra.alternate===null&&d(Re,Nt),ve=I(Ra,ve,hn),Gt===null?wt=Ra:Gt.sibling=Ra,Gt=Ra,Nt=Ar}if(dn.done)return S(Re,Nt),kn&&Tl(Re,hn),wt;if(Nt===null){for(;!dn.done;hn++,dn=Ne.next())dn=Ft(Re,dn.value,ft),dn!==null&&(ve=I(dn,ve,hn),Gt===null?wt=dn:Gt.sibling=dn,Gt=dn);return kn&&Tl(Re,hn),wt}for(Nt=M(Re,Nt);!dn.done;hn++,dn=Ne.next())dn=Mn(Nt,Re,hn,dn.value,ft),dn!==null&&(h&&dn.alternate!==null&&Nt.delete(dn.key===null?hn:dn.key),ve=I(dn,ve,hn),Gt===null?wt=dn:Gt.sibling=dn,Gt=dn);return h&&Nt.forEach(function(_F){return d(Re,_F)}),kn&&Tl(Re,hn),wt}function ps(Re,ve,Ne,ft){if(typeof Ne=="object"&&Ne!==null&&Ne.type===c&&Ne.key===null&&(Ne=Ne.props.children),typeof Ne=="object"&&Ne!==null){switch(Ne.$$typeof){case l:e:{for(var wt=Ne.key,Gt=ve;Gt!==null;){if(Gt.key===wt){if(wt=Ne.type,wt===c){if(Gt.tag===7){S(Re,Gt.sibling),ve=T(Gt,Ne.props.children),ve.return=Re,Re=ve;break e}}else if(Gt.elementType===wt||typeof wt=="object"&&wt!==null&&wt.$$typeof===x&&R2(wt)===Gt.type){S(Re,Gt.sibling),ve=T(Gt,Ne.props),ve.ref=Zf(Re,Gt,Ne),ve.return=Re,Re=ve;break e}S(Re,Gt);break}else d(Re,Gt);Gt=Gt.sibling}Ne.type===c?(ve=kl(Ne.props.children,Re.mode,ft,Ne.key),ve.return=Re,Re=ve):(ft=Bm(Ne.type,Ne.key,Ne.props,null,Re.mode,ft),ft.ref=Zf(Re,ve,Ne),ft.return=Re,Re=ft)}return ne(Re);case u:e:{for(Gt=Ne.key;ve!==null;){if(ve.key===Gt)if(ve.tag===4&&ve.stateNode.containerInfo===Ne.containerInfo&&ve.stateNode.implementation===Ne.implementation){S(Re,ve.sibling),ve=T(ve,Ne.children||[]),ve.return=Re,Re=ve;break e}else{S(Re,ve);break}else d(Re,ve);ve=ve.sibling}ve=S1(Ne,Re.mode,ft),ve.return=Re,Re=ve}return ne(Re);case x:return Gt=Ne._init,ps(Re,ve,Gt(Ne._payload),ft)}if(F(Ne))return St(Re,ve,Ne,ft);if(b(Ne))return Yr(Re,ve,Ne,ft);$p(Re,Ne)}return typeof Ne=="string"&&Ne!==""||typeof Ne=="number"?(Ne=""+Ne,ve!==null&&ve.tag===6?(S(Re,ve.sibling),ve=T(ve,Ne),ve.return=Re,Re=ve):(S(Re,ve),ve=w1(Ne,Re.mode,ft),ve.return=Re,Re=ve),ne(Re)):S(Re,ve)}return ps}var ju=B2(!0),P2=B2(!1),Qf={},cs=At(Qf),qf=At(Qf),Xu=At(Qf);function so(h){if(h===Qf)throw Error(o(174));return h}function Uy(h,d){Pt(Xu,d),Pt(qf,h),Pt(cs,Qf),h=ie(d),Mt(cs),Pt(cs,h)}function Yu(){Mt(cs),Mt(qf),Mt(Xu)}function I2(h){var d=so(Xu.current),S=so(cs.current);d=N(S,h.type,d),S!==d&&(Pt(qf,h),Pt(cs,d))}function zy(h){qf.current===h&&(Mt(cs),Mt(qf))}var On=At(0);function em(h){for(var d=h;d!==null;){if(d.tag===13){var S=d.memoizedState;if(S!==null&&(S=S.dehydrated,S===null||Zt(S)||$(S)))return d}else if(d.tag===19&&d.memoizedProps.revealOrder!==void 0){if(d.flags&128)return d}else if(d.child!==null){d.child.return=d,d=d.child;continue}if(d===h)break;for(;d.sibling===null;){if(d.return===null||d.return===h)return null;d=d.return}d.sibling.return=d.return,d=d.sibling}return null}var Gy=[];function Hy(){for(var h=0;hS?S:4,h(!0);var M=fs.transition;fs.transition={};try{h(!1),d()}finally{Yt=S,fs.transition=M}}function j2(){return oo().memoizedState}function Xk(h,d,S){var M=Ca(h);S={lane:M,action:S,hasEagerState:!1,eagerState:null,next:null},X2(h)?Y2(d,S):(K2(h,d,S),S=li(),h=hs(h,M,S),h!==null&&Z2(h,d,M))}function Yk(h,d,S){var M=Ca(h),T={lane:M,action:S,hasEagerState:!1,eagerState:null,next:null};if(X2(h))Y2(d,T);else{K2(h,d,T);var I=h.alternate;if(h.lanes===0&&(I===null||I.lanes===0)&&(I=d.lastRenderedReducer,I!==null))try{var ne=d.lastRenderedState,de=I(ne,S);if(T.hasEagerState=!0,T.eagerState=de,Gi(de,ne))return}catch{}finally{}S=li(),h=hs(h,M,S),h!==null&&Z2(h,d,M)}}function X2(h){var d=h.alternate;return h===jn||d!==null&&d===jn}function Y2(h,d){$f=nm=!0;var S=h.pending;S===null?d.next=d:(d.next=S.next,S.next=d),h.pending=d}function K2(h,d,S){ar!==null&&h.mode&1&&!(Jt&2)?(h=d.interleaved,h===null?(S.next=S,dr===null?dr=[d]:dr.push(d)):(S.next=h.next,h.next=S),d.interleaved=S):(h=d.pending,h===null?S.next=S:(S.next=h.next,h.next=S),d.pending=S)}function Z2(h,d,S){if(S&4194240){var M=d.lanes;M&=h.pendingLanes,S|=M,d.lanes=S,no(h,S)}}var am={readContext:An,useCallback:jr,useContext:jr,useEffect:jr,useImperativeHandle:jr,useInsertionEffect:jr,useLayoutEffect:jr,useMemo:jr,useReducer:jr,useRef:jr,useState:jr,useDebugValue:jr,useDeferredValue:jr,useTransition:jr,useMutableSource:jr,useSyncExternalStore:jr,useId:jr,unstable_isNewReconciler:!1},Kk={readContext:An,useCallback:function(h,d){return Oo().memoizedState=[h,d===void 0?null:d],h},useContext:An,useEffect:Xy,useImperativeHandle:function(h,d,S){return S=S!=null?S.concat([h]):null,sm(4194308,4,H2.bind(null,d,h),S)},useLayoutEffect:function(h,d){return sm(4194308,4,h,d)},useInsertionEffect:function(h,d){return sm(4,2,h,d)},useMemo:function(h,d){var S=Oo();return d=d===void 0?null:d,h=h(),S.memoizedState=[h,d],h},useReducer:function(h,d,S){var M=Oo();return d=S!==void 0?S(d):d,M.memoizedState=M.baseState=d,h={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:h,lastRenderedState:d},M.queue=h,h=h.dispatch=Xk.bind(null,jn,h),[M.memoizedState,h]},useRef:function(h){var d=Oo();return h={current:h},d.memoizedState=h},useState:jy,useDebugValue:Yy,useDeferredValue:function(h){var d=jy(h),S=d[0],M=d[1];return Xy(function(){var T=fs.transition;fs.transition={};try{M(h)}finally{fs.transition=T}},[h]),S},useTransition:function(){var h=jy(!1),d=h[0];return h=jk.bind(null,h[1]),Oo().memoizedState=h,[d,h]},useMutableSource:function(){},useSyncExternalStore:function(h,d,S){var M=jn,T=Oo();if(kn){if(S===void 0)throw Error(o(407));S=S()}else{if(S=d(),ar===null)throw Error(o(349));Ku&30||k2(M,d,S)}T.memoizedState=S;var I={value:S,getSnapshot:d};return T.queue=I,Xy(N2.bind(null,M,I,h),[h]),M.flags|=2048,th(9,F2.bind(null,M,I,S,d),void 0,null),S},useId:function(){var h=Oo(),d=ar.identifierPrefix;if(kn){var S=No,M=Fo;S=(M&~(1<<32-yn(M)-1)).toString(32)+S,d=":"+d+"R"+S,S=eh++,0d1&&(d.flags|=128,M=!0,sh(T,!1),d.lanes=4194304)}else{if(!M)if(h=em(I),h!==null){if(d.flags|=128,M=!0,h=h.updateQueue,h!==null&&(d.updateQueue=h,d.flags|=4),sh(T,!0),T.tail===null&&T.tailMode==="hidden"&&!I.alternate&&!kn)return Xr(d),null}else 2*Dn()-T.renderingStartTime>d1&&S!==1073741824&&(d.flags|=128,M=!0,sh(T,!1),d.lanes=4194304);T.isBackwards?(I.sibling=d.child,d.child=I):(h=T.last,h!==null?h.sibling=I:d.child=I,T.last=I)}return T.tail!==null?(d=T.tail,T.rendering=d,T.tail=d.sibling,T.renderingStartTime=Dn(),d.sibling=null,h=On.current,Pt(On,M?h&1|2:h&1),d):(Xr(d),null);case 22:case 23:return y1(),M=d.memoizedState!==null,h!==null&&h.memoizedState!==null!==M&&(d.flags|=8192),M&&d.mode&1?Ji&1073741824&&(Xr(d),Se&&d.subtreeFlags&6&&(d.flags|=8192)):Xr(d),null;case 24:return null;case 25:return null}throw Error(o(156,d.tag))}var eF=a.ReactCurrentOwner,Wi=!1;function ai(h,d,S,M){d.child=h===null?P2(d,null,S,M):ju(d,h.child,S,M)}function iE(h,d,S,M,T){S=S.render;var I=d.ref;return wr(d,T),M=Wy(h,d,S,M,I,T),S=Jy(),h!==null&&!Wi?(d.updateQueue=h.updateQueue,d.flags&=-2053,h.lanes&=~T,Uo(h,d,T)):(kn&&S&&Dy(d),d.flags|=1,ai(h,d,M,T),d.child)}function sE(h,d,S,M,T){if(h===null){var I=S.type;return typeof I=="function"&&!_1(I)&&I.defaultProps===void 0&&S.compare===null&&S.defaultProps===void 0?(d.tag=15,d.type=I,oE(h,d,I,M,T)):(h=Bm(S.type,null,M,d,d.mode,T),h.ref=d.ref,h.return=d,d.child=h)}if(I=h.child,!(h.lanes&T)){var ne=I.memoizedProps;if(S=S.compare,S=S!==null?S:El,S(ne,M)&&h.ref===d.ref)return Uo(h,d,T)}return d.flags|=1,h=Ta(I,M),h.ref=d.ref,h.return=d,d.child=h}function oE(h,d,S,M,T){if(h!==null&&El(h.memoizedProps,M)&&h.ref===d.ref)if(Wi=!1,(h.lanes&T)!==0)h.flags&131072&&(Wi=!0);else return d.lanes=h.lanes,Uo(h,d,T);return Qy(h,d,S,M,T)}function aE(h,d,S){var M=d.pendingProps,T=M.children,I=h!==null?h.memoizedState:null;if(M.mode==="hidden")if(!(d.mode&1))d.memoizedState={baseLanes:0,cachePool:null},Pt(Zu,Ji),Ji|=S;else if(S&1073741824)d.memoizedState={baseLanes:0,cachePool:null},M=I!==null?I.baseLanes:S,Pt(Zu,Ji),Ji|=M;else return h=I!==null?I.baseLanes|S:S,d.lanes=d.childLanes=1073741824,d.memoizedState={baseLanes:h,cachePool:null},d.updateQueue=null,Pt(Zu,Ji),Ji|=h,null;else I!==null?(M=I.baseLanes|S,d.memoizedState=null):M=S,Pt(Zu,Ji),Ji|=M;return ai(h,d,T,S),d.child}function lE(h,d){var S=d.ref;(h===null&&S!==null||h!==null&&h.ref!==S)&&(d.flags|=512,d.flags|=2097152)}function Qy(h,d,S,M,T){var I=Sn(S)?en:$t.current;return I=sr(d,I),wr(d,T),S=Wy(h,d,S,M,I,T),M=Jy(),h!==null&&!Wi?(d.updateQueue=h.updateQueue,d.flags&=-2053,h.lanes&=~T,Uo(h,d,T)):(kn&&M&&Dy(d),d.flags|=1,ai(h,d,S,T),d.child)}function uE(h,d,S,M,T){if(Sn(S)){var I=!0;tn(d)}else I=!1;if(wr(d,T),d.stateNode===null)h!==null&&(h.alternate=null,d.alternate=null,d.flags|=2),A2(d,S,M),Ly(d,S,M,T),M=!0;else if(h===null){var ne=d.stateNode,de=d.memoizedProps;ne.props=de;var Oe=ne.context,tt=S.contextType;typeof tt=="object"&&tt!==null?tt=An(tt):(tt=Sn(S)?en:$t.current,tt=sr(d,tt));var gt=S.getDerivedStateFromProps,Ft=typeof gt=="function"||typeof ne.getSnapshotBeforeUpdate=="function";Ft||typeof ne.UNSAFE_componentWillReceiveProps!="function"&&typeof ne.componentWillReceiveProps!="function"||(de!==M||Oe!==tt)&&M2(d,ne,M,tt),Rs=!1;var Bt=d.memoizedState;ne.state=Bt,Kp(d,M,ne,T),Oe=d.memoizedState,de!==M||Bt!==Oe||Dt.current||Rs?(typeof gt=="function"&&(Iy(d,S,gt,M),Oe=d.memoizedState),(de=Rs||S2(d,S,de,M,Bt,Oe,tt))?(Ft||typeof ne.UNSAFE_componentWillMount!="function"&&typeof ne.componentWillMount!="function"||(typeof ne.componentWillMount=="function"&&ne.componentWillMount(),typeof ne.UNSAFE_componentWillMount=="function"&&ne.UNSAFE_componentWillMount()),typeof ne.componentDidMount=="function"&&(d.flags|=4194308)):(typeof ne.componentDidMount=="function"&&(d.flags|=4194308),d.memoizedProps=M,d.memoizedState=Oe),ne.props=M,ne.state=Oe,ne.context=tt,M=de):(typeof ne.componentDidMount=="function"&&(d.flags|=4194308),M=!1)}else{ne=d.stateNode,y2(h,d),de=d.memoizedProps,tt=d.type===d.elementType?de:Wr(d.type,de),ne.props=tt,Ft=d.pendingProps,Bt=ne.context,Oe=S.contextType,typeof Oe=="object"&&Oe!==null?Oe=An(Oe):(Oe=Sn(S)?en:$t.current,Oe=sr(d,Oe));var Mn=S.getDerivedStateFromProps;(gt=typeof Mn=="function"||typeof ne.getSnapshotBeforeUpdate=="function")||typeof ne.UNSAFE_componentWillReceiveProps!="function"&&typeof ne.componentWillReceiveProps!="function"||(de!==Ft||Bt!==Oe)&&M2(d,ne,M,Oe),Rs=!1,Bt=d.memoizedState,ne.state=Bt,Kp(d,M,ne,T);var St=d.memoizedState;de!==Ft||Bt!==St||Dt.current||Rs?(typeof Mn=="function"&&(Iy(d,S,Mn,M),St=d.memoizedState),(tt=Rs||S2(d,S,tt,M,Bt,St,Oe)||!1)?(gt||typeof ne.UNSAFE_componentWillUpdate!="function"&&typeof ne.componentWillUpdate!="function"||(typeof ne.componentWillUpdate=="function"&&ne.componentWillUpdate(M,St,Oe),typeof ne.UNSAFE_componentWillUpdate=="function"&&ne.UNSAFE_componentWillUpdate(M,St,Oe)),typeof ne.componentDidUpdate=="function"&&(d.flags|=4),typeof ne.getSnapshotBeforeUpdate=="function"&&(d.flags|=1024)):(typeof ne.componentDidUpdate!="function"||de===h.memoizedProps&&Bt===h.memoizedState||(d.flags|=4),typeof ne.getSnapshotBeforeUpdate!="function"||de===h.memoizedProps&&Bt===h.memoizedState||(d.flags|=1024),d.memoizedProps=M,d.memoizedState=St),ne.props=M,ne.state=St,ne.context=Oe,M=tt):(typeof ne.componentDidUpdate!="function"||de===h.memoizedProps&&Bt===h.memoizedState||(d.flags|=4),typeof ne.getSnapshotBeforeUpdate!="function"||de===h.memoizedProps&&Bt===h.memoizedState||(d.flags|=1024),M=!1)}return qy(h,d,S,M,I,T)}function qy(h,d,S,M,T,I){lE(h,d);var ne=(d.flags&128)!==0;if(!M&&!ne)return T&&an(d,S,!1),Uo(h,d,I);M=d.stateNode,eF.current=d;var de=ne&&typeof S.getDerivedStateFromError!="function"?null:M.render();return d.flags|=1,h!==null&&ne?(d.child=ju(d,h.child,null,I),d.child=ju(d,null,de,I)):ai(h,d,de,I),d.memoizedState=M.state,T&&an(d,S,!0),d.child}function cE(h){var d=h.stateNode;d.pendingContext?on(h,d.pendingContext,d.pendingContext!==d.context):d.context&&on(h,d.context,!1),Uy(h,d.containerInfo)}function fE(h,d,S,M,T){return Ju(),Oy(T),d.flags|=256,ai(h,d,S,M),d.child}var cm={dehydrated:null,treeContext:null,retryLane:0};function fm(h){return{baseLanes:h,cachePool:null}}function hE(h,d,S){var M=d.pendingProps,T=On.current,I=!1,ne=(d.flags&128)!==0,de;if((de=ne)||(de=h!==null&&h.memoizedState===null?!1:(T&2)!==0),de?(I=!0,d.flags&=-129):(h===null||h.memoizedState!==null)&&(T|=1),Pt(On,T&1),h===null)return Ny(d),h=d.memoizedState,h!==null&&(h=h.dehydrated,h!==null)?(d.mode&1?$(h)?d.lanes=8:d.lanes=1073741824:d.lanes=1,null):(T=M.children,h=M.fallback,I?(M=d.mode,I=d.child,T={mode:"hidden",children:T},!(M&1)&&I!==null?(I.childLanes=0,I.pendingProps=T):I=Pm(T,M,0,null),h=kl(h,M,S,null),I.return=d,h.return=d,I.sibling=h,d.child=I,d.child.memoizedState=fm(S),d.memoizedState=cm,h):$y(d,T));if(T=h.memoizedState,T!==null){if(de=T.dehydrated,de!==null){if(ne)return d.flags&256?(d.flags&=-257,hm(h,d,S,Error(o(422)))):d.memoizedState!==null?(d.child=h.child,d.flags|=128,null):(I=M.fallback,T=d.mode,M=Pm({mode:"visible",children:M.children},T,0,null),I=kl(I,T,S,null),I.flags|=2,M.return=d,I.return=d,M.sibling=I,d.child=M,d.mode&1&&ju(d,h.child,null,S),d.child.memoizedState=fm(S),d.memoizedState=cm,I);if(!(d.mode&1))d=hm(h,d,S,null);else if($(de))d=hm(h,d,S,Error(o(419)));else if(M=(S&h.childLanes)!==0,Wi||M){if(M=ar,M!==null){switch(S&-S){case 4:I=2;break;case 16:I=8;break;case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:I=32;break;case 536870912:I=268435456;break;default:I=0}M=I&(M.suspendedLanes|S)?0:I,M!==0&&M!==T.retryLane&&(T.retryLane=M,hs(h,M,-1))}x1(),d=hm(h,d,S,Error(o(421)))}else Zt(de)?(d.flags|=128,d.child=h.child,d=dF.bind(null,h),Ae(de,d),d=null):(S=T.treeContext,ye&&(Vi=vt(de),Hi=d,kn=!0,Bs=null,Yf=!1,S!==null&&(ls[us++]=Fo,ls[us++]=No,ls[us++]=bl,Fo=S.id,No=S.overflow,bl=d)),d=$y(d,d.pendingProps.children),d.flags|=4096);return d}return I?(M=pE(h,d,M.children,M.fallback,S),I=d.child,T=h.child.memoizedState,I.memoizedState=T===null?fm(S):{baseLanes:T.baseLanes|S,cachePool:null},I.childLanes=h.childLanes&~S,d.memoizedState=cm,M):(S=dE(h,d,M.children,S),d.memoizedState=null,S)}return I?(M=pE(h,d,M.children,M.fallback,S),I=d.child,T=h.child.memoizedState,I.memoizedState=T===null?fm(S):{baseLanes:T.baseLanes|S,cachePool:null},I.childLanes=h.childLanes&~S,d.memoizedState=cm,M):(S=dE(h,d,M.children,S),d.memoizedState=null,S)}function $y(h,d){return d=Pm({mode:"visible",children:d},h.mode,0,null),d.return=h,h.child=d}function dE(h,d,S,M){var T=h.child;return h=T.sibling,S=Ta(T,{mode:"visible",children:S}),!(d.mode&1)&&(S.lanes=M),S.return=d,S.sibling=null,h!==null&&(M=d.deletions,M===null?(d.deletions=[h],d.flags|=16):M.push(h)),d.child=S}function pE(h,d,S,M,T){var I=d.mode;h=h.child;var ne=h.sibling,de={mode:"hidden",children:S};return!(I&1)&&d.child!==h?(S=d.child,S.childLanes=0,S.pendingProps=de,d.deletions=null):(S=Ta(h,de),S.subtreeFlags=h.subtreeFlags&14680064),ne!==null?M=Ta(ne,M):(M=kl(M,I,T,null),M.flags|=2),M.return=d,S.return=d,S.sibling=M,d.child=S,M}function hm(h,d,S,M){return M!==null&&Oy(M),ju(d,h.child,null,S),h=$y(d,d.pendingProps.children),h.flags|=2,d.memoizedState=null,h}function mE(h,d,S){h.lanes|=d;var M=h.alternate;M!==null&&(M.lanes|=d),or(h.return,d,S)}function e1(h,d,S,M,T){var I=h.memoizedState;I===null?h.memoizedState={isBackwards:d,rendering:null,renderingStartTime:0,last:M,tail:S,tailMode:T}:(I.isBackwards=d,I.rendering=null,I.renderingStartTime=0,I.last=M,I.tail=S,I.tailMode=T)}function gE(h,d,S){var M=d.pendingProps,T=M.revealOrder,I=M.tail;if(ai(h,d,M.children,S),M=On.current,M&2)M=M&1|2,d.flags|=128;else{if(h!==null&&h.flags&128)e:for(h=d.child;h!==null;){if(h.tag===13)h.memoizedState!==null&&mE(h,S,d);else if(h.tag===19)mE(h,S,d);else if(h.child!==null){h.child.return=h,h=h.child;continue}if(h===d)break e;for(;h.sibling===null;){if(h.return===null||h.return===d)break e;h=h.return}h.sibling.return=h.return,h=h.sibling}M&=1}if(Pt(On,M),!(d.mode&1))d.memoizedState=null;else switch(T){case"forwards":for(S=d.child,T=null;S!==null;)h=S.alternate,h!==null&&em(h)===null&&(T=S),S=S.sibling;S=T,S===null?(T=d.child,d.child=null):(T=S.sibling,S.sibling=null),e1(d,!1,T,S,I);break;case"backwards":for(S=null,T=d.child,d.child=null;T!==null;){if(h=T.alternate,h!==null&&em(h)===null){d.child=T;break}h=T.sibling,T.sibling=S,S=T,T=h}e1(d,!0,S,null,I);break;case"together":e1(d,!1,null,null,void 0);break;default:d.memoizedState=null}return d.child}function Uo(h,d,S){if(h!==null&&(d.dependencies=h.dependencies),Qu|=d.lanes,!(S&d.childLanes))return null;if(h!==null&&d.child!==h.child)throw Error(o(153));if(d.child!==null){for(h=d.child,S=Ta(h,h.pendingProps),d.child=S,S.return=d;h.sibling!==null;)h=h.sibling,S=S.sibling=Ta(h,h.pendingProps),S.return=d;S.sibling=null}return d.child}function tF(h,d,S){switch(d.tag){case 3:cE(d),Ju();break;case 5:I2(d);break;case 1:Sn(d.type)&&tn(d);break;case 4:Uy(d,d.stateNode.containerInfo);break;case 10:Xp(d,d.type._context,d.memoizedProps.value);break;case 13:var M=d.memoizedState;if(M!==null)return M.dehydrated!==null?(Pt(On,On.current&1),d.flags|=128,null):S&d.child.childLanes?hE(h,d,S):(Pt(On,On.current&1),h=Uo(h,d,S),h!==null?h.sibling:null);Pt(On,On.current&1);break;case 19:if(M=(S&d.childLanes)!==0,h.flags&128){if(M)return gE(h,d,S);d.flags|=128}var T=d.memoizedState;if(T!==null&&(T.rendering=null,T.tail=null,T.lastEffect=null),Pt(On,On.current),M)break;return null;case 22:case 23:return d.lanes=0,aE(h,d,S)}return Uo(h,d,S)}function nF(h,d){switch(ky(d),d.tag){case 1:return Sn(d.type)&&$n(),h=d.flags,h&65536?(d.flags=h&-65537|128,d):null;case 3:return Yu(),Mt(Dt),Mt($t),Hy(),h=d.flags,h&65536&&!(h&128)?(d.flags=h&-65537|128,d):null;case 5:return zy(d),null;case 13:if(Mt(On),h=d.memoizedState,h!==null&&h.dehydrated!==null){if(d.alternate===null)throw Error(o(340));Ju()}return h=d.flags,h&65536?(d.flags=h&-65537|128,d):null;case 19:return Mt(On),null;case 4:return Yu(),null;case 10:return io(d.type._context),null;case 22:case 23:return y1(),null;case 24:return null;default:return null}}var dm=!1,Bl=!1,rF=typeof WeakSet=="function"?WeakSet:Set,ut=null;function pm(h,d){var S=h.ref;if(S!==null)if(typeof S=="function")try{S(null)}catch(M){Ti(h,d,M)}else S.current=null}function t1(h,d,S){try{S()}catch(M){Ti(h,d,M)}}var vE=!1;function iF(h,d){for(V(h.containerInfo),ut=d;ut!==null;)if(h=ut,d=h.child,(h.subtreeFlags&1028)!==0&&d!==null)d.return=h,ut=d;else for(;ut!==null;){h=ut;try{var S=h.alternate;if(h.flags&1024)switch(h.tag){case 0:case 11:case 15:break;case 1:if(S!==null){var M=S.memoizedProps,T=S.memoizedState,I=h.stateNode,ne=I.getSnapshotBeforeUpdate(h.elementType===h.type?M:Wr(h.type,M),T);I.__reactInternalSnapshotBeforeUpdate=ne}break;case 3:Se&&ot(h.stateNode.containerInfo);break;case 5:case 6:case 4:case 17:break;default:throw Error(o(163))}}catch(de){Ti(h,h.return,de)}if(d=h.sibling,d!==null){d.return=h.return,ut=d;break}ut=h.return}return S=vE,vE=!1,S}function Pl(h,d,S){var M=d.updateQueue;if(M=M!==null?M.lastEffect:null,M!==null){var T=M=M.next;do{if((T.tag&h)===h){var I=T.destroy;T.destroy=void 0,I!==void 0&&t1(d,S,I)}T=T.next}while(T!==M)}}function oh(h,d){if(d=d.updateQueue,d=d!==null?d.lastEffect:null,d!==null){var S=d=d.next;do{if((S.tag&h)===h){var M=S.create;S.destroy=M()}S=S.next}while(S!==d)}}function n1(h){var d=h.ref;if(d!==null){var S=h.stateNode;switch(h.tag){case 5:h=G(S);break;default:h=S}typeof d=="function"?d(h):d.current=h}}function yE(h,d,S){if(zi&&typeof zi.onCommitFiberUnmount=="function")try{zi.onCommitFiberUnmount(wa,d)}catch{}switch(d.tag){case 0:case 11:case 14:case 15:if(h=d.updateQueue,h!==null&&(h=h.lastEffect,h!==null)){var M=h=h.next;do{var T=M,I=T.destroy;T=T.tag,I!==void 0&&(T&2||T&4)&&t1(d,S,I),M=M.next}while(M!==h)}break;case 1:if(pm(d,S),h=d.stateNode,typeof h.componentWillUnmount=="function")try{h.props=d.memoizedProps,h.state=d.memoizedState,h.componentWillUnmount()}catch(ne){Ti(d,S,ne)}break;case 5:pm(d,S);break;case 4:Se?ME(h,d,S):se&&se&&(d=d.stateNode.containerInfo,S=Ht(d),Xt(d,S))}}function xE(h,d,S){for(var M=d;;)if(yE(h,M,S),M.child===null||Se&&M.tag===4){if(M===d)break;for(;M.sibling===null;){if(M.return===null||M.return===d)return;M=M.return}M.sibling.return=M.return,M=M.sibling}else M.child.return=M,M=M.child}function _E(h){var d=h.alternate;d!==null&&(h.alternate=null,_E(d)),h.child=null,h.deletions=null,h.sibling=null,h.tag===5&&(d=h.stateNode,d!==null&&We(d)),h.stateNode=null,h.return=null,h.dependencies=null,h.memoizedProps=null,h.memoizedState=null,h.pendingProps=null,h.stateNode=null,h.updateQueue=null}function wE(h){return h.tag===5||h.tag===3||h.tag===4}function SE(h){e:for(;;){for(;h.sibling===null;){if(h.return===null||wE(h.return))return null;h=h.return}for(h.sibling.return=h.return,h=h.sibling;h.tag!==5&&h.tag!==6&&h.tag!==18;){if(h.flags&2||h.child===null||h.tag===4)continue e;h.child.return=h,h=h.child}if(!(h.flags&2))return h.stateNode}}function AE(h){if(Se){e:{for(var d=h.return;d!==null;){if(wE(d))break e;d=d.return}throw Error(o(160))}var S=d;switch(S.tag){case 5:d=S.stateNode,S.flags&32&&(lt(d),S.flags&=-33),S=SE(h),i1(h,S,d);break;case 3:case 4:d=S.stateNode.containerInfo,S=SE(h),r1(h,S,d);break;default:throw Error(o(161))}}}function r1(h,d,S){var M=h.tag;if(M===5||M===6)h=h.stateNode,d?be(S,h,d):Ye(S,h);else if(M!==4&&(h=h.child,h!==null))for(r1(h,d,S),h=h.sibling;h!==null;)r1(h,d,S),h=h.sibling}function i1(h,d,S){var M=h.tag;if(M===5||M===6)h=h.stateNode,d?Ee(S,h,d):Ve(S,h);else if(M!==4&&(h=h.child,h!==null))for(i1(h,d,S),h=h.sibling;h!==null;)i1(h,d,S),h=h.sibling}function ME(h,d,S){for(var M=d,T=!1,I,ne;;){if(!T){T=M.return;e:for(;;){if(T===null)throw Error(o(160));switch(I=T.stateNode,T.tag){case 5:ne=!1;break e;case 3:I=I.containerInfo,ne=!0;break e;case 4:I=I.containerInfo,ne=!0;break e}T=T.return}T=!0}if(M.tag===5||M.tag===6)xE(h,M,S),ne?Qe(I,M.stateNode):De(I,M.stateNode);else if(M.tag===18)ne?Xe(I,M.stateNode):Ke(I,M.stateNode);else if(M.tag===4){if(M.child!==null){I=M.stateNode.containerInfo,ne=!0,M.child.return=M,M=M.child;continue}}else if(yE(h,M,S),M.child!==null){M.child.return=M,M=M.child;continue}if(M===d)break;for(;M.sibling===null;){if(M.return===null||M.return===d)return;M=M.return,M.tag===4&&(T=!1)}M.sibling.return=M.return,M=M.sibling}}function s1(h,d){if(Se){switch(d.tag){case 0:case 11:case 14:case 15:Pl(3,d,d.return),oh(3,d),Pl(5,d,d.return);return;case 1:return;case 5:var S=d.stateNode;if(S!=null){var M=d.memoizedProps;h=h!==null?h.memoizedProps:M;var T=d.type,I=d.updateQueue;d.updateQueue=null,I!==null&&te(S,I,T,h,M,d)}return;case 6:if(d.stateNode===null)throw Error(o(162));S=d.memoizedProps,Le(d.stateNode,h!==null?h.memoizedProps:S,S);return;case 3:ye&&h!==null&&h.memoizedState.isDehydrated&&xe(d.stateNode.containerInfo);return;case 12:return;case 13:mm(d);return;case 19:mm(d);return;case 17:return}throw Error(o(163))}switch(d.tag){case 0:case 11:case 14:case 15:Pl(3,d,d.return),oh(3,d),Pl(5,d,d.return);return;case 12:return;case 13:mm(d);return;case 19:mm(d);return;case 3:ye&&h!==null&&h.memoizedState.isDehydrated&&xe(d.stateNode.containerInfo);break;case 22:case 23:return}e:if(se){switch(d.tag){case 1:case 5:case 6:break e;case 3:case 4:d=d.stateNode,Xt(d.containerInfo,d.pendingChildren);break e}throw Error(o(163))}}function mm(h){var d=h.updateQueue;if(d!==null){h.updateQueue=null;var S=h.stateNode;S===null&&(S=h.stateNode=new rF),d.forEach(function(M){var T=pF.bind(null,h,M);S.has(M)||(S.add(M),M.then(T,T))})}}function sF(h,d){for(ut=d;ut!==null;){d=ut;var S=d.deletions;if(S!==null)for(var M=0;M";case vm:return":has("+(l1(h)||"")+")";case ym:return'[role="'+h.value+'"]';case _m:return'"'+h.value+'"';case xm:return'[data-testname="'+h.value+'"]';default:throw Error(o(365))}}function RE(h,d){var S=[];h=[h,0];for(var M=0;MT&&(T=ne),M&=~I}if(M=T,M=Dn()-M,M=(120>M?120:480>M?480:1080>M?1080:1920>M?1920:3e3>M?3e3:4320>M?4320:1960*aF(M/1960))-M,10h?16:h,Ea===null)var M=!1;else{if(h=Ea,Ea=null,Em=0,Jt&6)throw Error(o(331));var T=Jt;for(Jt|=4,ut=h.current;ut!==null;){var I=ut,ne=I.child;if(ut.flags&16){var de=I.deletions;if(de!==null){for(var Oe=0;OeDn()-h1?Il(h,0):f1|=S),bi(h,d)}function OE(h,d){d===0&&(h.mode&1?(d=Po,Po<<=1,!(Po&130023424)&&(Po=4194304)):d=1);var S=li();h=Tm(h,d),h!==null&&(to(h,d,S),bi(h,S))}function dF(h){var d=h.memoizedState,S=0;d!==null&&(S=d.retryLane),OE(h,S)}function pF(h,d){var S=0;switch(h.tag){case 13:var M=h.stateNode,T=h.memoizedState;T!==null&&(S=T.retryLane);break;case 19:M=h.stateNode;break;default:throw Error(o(314))}M!==null&&M.delete(d),OE(h,S)}var UE;UE=function(h,d,S){if(h!==null)if(h.memoizedProps!==d.pendingProps||Dt.current)Wi=!0;else{if(!(h.lanes&S)&&!(d.flags&128))return Wi=!1,tF(h,d,S);Wi=!!(h.flags&131072)}else Wi=!1,kn&&d.flags&1048576&&E2(d,qp,d.index);switch(d.lanes=0,d.tag){case 2:var M=d.type;h!==null&&(h.alternate=null,d.alternate=null,d.flags|=2),h=d.pendingProps;var T=sr(d,$t.current);wr(d,S),T=Wy(null,d,M,h,T,S);var I=Jy();return d.flags|=1,typeof T=="object"&&T!==null&&typeof T.render=="function"&&T.$$typeof===void 0?(d.tag=1,d.memoizedState=null,d.updateQueue=null,Sn(M)?(I=!0,tn(d)):I=!1,d.memoizedState=T.state!==null&&T.state!==void 0?T.state:null,Py(d),T.updater=Zp,d.stateNode=T,T._reactInternals=d,Ly(d,M,h,S),d=qy(null,d,M,!0,I,S)):(d.tag=0,kn&&I&&Dy(d),ai(null,d,T,S),d=d.child),d;case 16:M=d.elementType;e:{switch(h!==null&&(h.alternate=null,d.alternate=null,d.flags|=2),h=d.pendingProps,T=M._init,M=T(M._payload),d.type=M,T=d.tag=gF(M),h=Wr(M,h),T){case 0:d=Qy(null,d,M,h,S);break e;case 1:d=uE(null,d,M,h,S);break e;case 11:d=iE(null,d,M,h,S);break e;case 14:d=sE(null,d,M,Wr(M.type,h),S);break e}throw Error(o(306,M,""))}return d;case 0:return M=d.type,T=d.pendingProps,T=d.elementType===M?T:Wr(M,T),Qy(h,d,M,T,S);case 1:return M=d.type,T=d.pendingProps,T=d.elementType===M?T:Wr(M,T),uE(h,d,M,T,S);case 3:e:{if(cE(d),h===null)throw Error(o(387));M=d.pendingProps,I=d.memoizedState,T=I.element,y2(h,d),Kp(d,M,null,S);var ne=d.memoizedState;if(M=ne.element,ye&&I.isDehydrated)if(I={element:M,isDehydrated:!1,cache:ne.cache,transitions:ne.transitions},d.updateQueue.baseState=I,d.memoizedState=I,d.flags&256){T=Error(o(423)),d=fE(h,d,M,S,T);break e}else if(M!==T){T=Error(o(424)),d=fE(h,d,M,S,T);break e}else for(ye&&(Vi=Fe(d.stateNode.containerInfo),Hi=d,kn=!0,Bs=null,Yf=!1),S=P2(d,null,M,S),d.child=S;S;)S.flags=S.flags&-3|4096,S=S.sibling;else{if(Ju(),M===T){d=Uo(h,d,S);break e}ai(h,d,M,S)}d=d.child}return d;case 5:return I2(d),h===null&&Ny(d),M=d.type,T=d.pendingProps,I=h!==null?h.memoizedProps:null,ne=T.children,X(M,T)?ne=null:I!==null&&X(M,I)&&(d.flags|=32),lE(h,d),ai(h,d,ne,S),d.child;case 6:return h===null&&Ny(d),null;case 13:return hE(h,d,S);case 4:return Uy(d,d.stateNode.containerInfo),M=d.pendingProps,h===null?d.child=ju(d,null,M,S):ai(h,d,M,S),d.child;case 11:return M=d.type,T=d.pendingProps,T=d.elementType===M?T:Wr(M,T),iE(h,d,M,T,S);case 7:return ai(h,d,d.pendingProps,S),d.child;case 8:return ai(h,d,d.pendingProps.children,S),d.child;case 12:return ai(h,d,d.pendingProps.children,S),d.child;case 10:e:{if(M=d.type._context,T=d.pendingProps,I=d.memoizedProps,ne=T.value,Xp(d,M,ne),I!==null)if(Gi(I.value,ne)){if(I.children===T.children&&!Dt.current){d=Uo(h,d,S);break e}}else for(I=d.child,I!==null&&(I.return=d);I!==null;){var de=I.dependencies;if(de!==null){ne=I.child;for(var Oe=de.firstContext;Oe!==null;){if(Oe.context===M){if(I.tag===1){Oe=ko(-1,S&-S),Oe.tag=2;var tt=I.updateQueue;if(tt!==null){tt=tt.shared;var gt=tt.pending;gt===null?Oe.next=Oe:(Oe.next=gt.next,gt.next=Oe),tt.pending=Oe}}I.lanes|=S,Oe=I.alternate,Oe!==null&&(Oe.lanes|=S),or(I.return,S,d),de.lanes|=S;break}Oe=Oe.next}}else if(I.tag===10)ne=I.type===d.type?null:I.child;else if(I.tag===18){if(ne=I.return,ne===null)throw Error(o(341));ne.lanes|=S,de=ne.alternate,de!==null&&(de.lanes|=S),or(ne,S,d),ne=I.sibling}else ne=I.child;if(ne!==null)ne.return=I;else for(ne=I;ne!==null;){if(ne===d){ne=null;break}if(I=ne.sibling,I!==null){I.return=ne.return,ne=I;break}ne=ne.return}I=ne}ai(h,d,T.children,S),d=d.child}return d;case 9:return T=d.type,M=d.pendingProps.children,wr(d,S),T=An(T),M=M(T),d.flags|=1,ai(h,d,M,S),d.child;case 14:return M=d.type,T=Wr(M,d.pendingProps),T=Wr(M.type,T),sE(h,d,M,T,S);case 15:return oE(h,d,d.type,d.pendingProps,S);case 17:return M=d.type,T=d.pendingProps,T=d.elementType===M?T:Wr(M,T),h!==null&&(h.alternate=null,d.alternate=null,d.flags|=2),d.tag=1,Sn(M)?(h=!0,tn(d)):h=!1,wr(d,S),A2(d,M,T),Ly(d,M,T,S),qy(null,d,M,!0,h,S);case 19:return gE(h,d,S);case 22:return aE(h,d,S)}throw Error(o(156,d.tag))};function zE(h,d){return Do(h,d)}function mF(h,d,S,M){this.tag=h,this.key=S,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.ref=null,this.pendingProps=d,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 ds(h,d,S,M){return new mF(h,d,S,M)}function _1(h){return h=h.prototype,!(!h||!h.isReactComponent)}function gF(h){if(typeof h=="function")return _1(h)?1:0;if(h!=null){if(h=h.$$typeof,h===v)return 11;if(h===_)return 14}return 2}function Ta(h,d){var S=h.alternate;return S===null?(S=ds(h.tag,d,h.key,h.mode),S.elementType=h.elementType,S.type=h.type,S.stateNode=h.stateNode,S.alternate=h,h.alternate=S):(S.pendingProps=d,S.type=h.type,S.flags=0,S.subtreeFlags=0,S.deletions=null),S.flags=h.flags&14680064,S.childLanes=h.childLanes,S.lanes=h.lanes,S.child=h.child,S.memoizedProps=h.memoizedProps,S.memoizedState=h.memoizedState,S.updateQueue=h.updateQueue,d=h.dependencies,S.dependencies=d===null?null:{lanes:d.lanes,firstContext:d.firstContext},S.sibling=h.sibling,S.index=h.index,S.ref=h.ref,S}function Bm(h,d,S,M,T,I){var ne=2;if(M=h,typeof h=="function")_1(h)&&(ne=1);else if(typeof h=="string")ne=5;else e:switch(h){case c:return kl(S.children,T,I,d);case f:ne=8,T|=8;break;case p:return h=ds(12,S,d,T|2),h.elementType=p,h.lanes=I,h;case y:return h=ds(13,S,d,T),h.elementType=y,h.lanes=I,h;case w:return h=ds(19,S,d,T),h.elementType=w,h.lanes=I,h;case A:return Pm(S,T,I,d);default:if(typeof h=="object"&&h!==null)switch(h.$$typeof){case m:ne=10;break e;case g:ne=9;break e;case v:ne=11;break e;case _:ne=14;break e;case x:ne=16,M=null;break e}throw Error(o(130,h==null?h:typeof h,""))}return d=ds(ne,S,d,T),d.elementType=h,d.type=M,d.lanes=I,d}function kl(h,d,S,M){return h=ds(7,h,M,d),h.lanes=S,h}function Pm(h,d,S,M){return h=ds(22,h,M,d),h.elementType=A,h.lanes=S,h.stateNode={},h}function w1(h,d,S){return h=ds(6,h,null,d),h.lanes=S,h}function S1(h,d,S){return d=ds(4,h.children!==null?h.children:[],h.key,d),d.lanes=S,d.stateNode={containerInfo:h.containerInfo,pendingChildren:null,implementation:h.implementation},d}function vF(h,d,S,M,T){this.tag=d,this.containerInfo=h,this.finishedWork=this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=me,this.callbackNode=this.pendingContext=this.context=null,this.callbackPriority=0,this.eventTimes=Ou(0),this.expirationTimes=Ou(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=Ou(0),this.identifierPrefix=M,this.onRecoverableError=T,ye&&(this.mutableSourceEagerHydrationData=null)}function GE(h,d,S,M,T,I,ne,de,Oe){return h=new vF(h,d,S,de,Oe),d===1?(d=1,I===!0&&(d|=8)):d=0,I=ds(3,null,null,d),h.current=I,I.stateNode=h,I.memoizedState={element:M,isDehydrated:S,cache:null,transitions:null},Py(I),h}function HE(h){if(!h)return Rt;h=h._reactInternals;e:{if(B(h)!==h||h.tag!==1)throw Error(o(170));var d=h;do{switch(d.tag){case 3:d=d.stateNode.context;break e;case 1:if(Sn(d.type)){d=d.stateNode.__reactInternalMemoizedMergedChildContext;break e}}d=d.return}while(d!==null);throw Error(o(171))}if(h.tag===1){var S=h.type;if(Sn(S))return Nn(h,S,d)}return d}function VE(h){var d=h._reactInternals;if(d===void 0)throw typeof h.render=="function"?Error(o(188)):(h=Object.keys(h).join(","),Error(o(268,h)));return h=z(d),h===null?null:h.stateNode}function WE(h,d){if(h=h.memoizedState,h!==null&&h.dehydrated!==null){var S=h.retryLane;h.retryLane=S!==0&&S=tt&&I>=Ft&&T<=gt&&ne<=Bt){h.splice(d,1);break}else if(M!==tt||S.width!==Oe.width||Btne){if(!(I!==Ft||S.height!==Oe.height||gtT)){tt>M&&(Oe.width+=tt-M,Oe.x=M),gtI&&(Oe.height+=Ft-I,Oe.y=I),BtS&&(S=ne)),ne ")+` - -No matching component was found for: - `)+h.join(" > ")}return null},t.getPublicRootInstance=function(h){if(h=h.current,!h.child)return null;switch(h.child.tag){case 5:return G(h.child.stateNode);default:return h.child.stateNode}},t.injectIntoDevTools=function(h){if(h={bundleType:h.bundleType,version:h.version,rendererPackageName:h.rendererPackageName,rendererConfig:h.rendererConfig,overrideHookState:null,overrideHookStateDeletePath:null,overrideHookStateRenamePath:null,overrideProps:null,overridePropsDeletePath:null,overridePropsRenamePath:null,setErrorHandler:null,setSuspenseHandler:null,scheduleUpdate:null,currentDispatcherRef:a.ReactCurrentDispatcher,findHostInstanceByFiber:yF,findFiberByHostInstance:h.findFiberByHostInstance||xF,findHostInstancesForRefresh:null,scheduleRefresh:null,scheduleRoot:null,setRefreshHandler:null,getCurrentFiber:null,reconcilerVersion:"18.0.0-fc46dba67-20220329"},typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u")h=!1;else{var d=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(d.isDisabled||!d.supportsFiber)h=!0;else{try{wa=d.inject(h),zi=d}catch{}h=!!d.checkDCE}}return h},t.isAlreadyRendering=function(){return!1},t.observeVisibleRects=function(h,d,S,M){if(!He)throw Error(o(363));h=u1(h,d);var T=Je(h,S,M).disconnect;return{disconnect:function(){T()}}},t.registerMutableSourceForHydration=function(h,d){var S=d._getVersion;S=S(d._source),h.mutableSourceEagerHydrationData==null?h.mutableSourceEagerHydrationData=[d,S]:h.mutableSourceEagerHydrationData.push(d,S)},t.runWithPriority=function(h,d){var S=Yt;try{return Yt=h,d()}finally{Yt=S}},t.shouldError=function(){return null},t.shouldSuspend=function(){return!1},t.updateContainer=function(h,d,S,M){var T=d.current,I=li(),ne=Ca(T);return S=HE(S),d.context===null?d.context=S:d.pendingContext=S,d=ko(I,ne),d.payload={element:h},M=M===void 0?null:M,M!==null&&(d.callback=M),Aa(T,d),h=hs(T,ne,I),h!==null&&Yp(h,T,ne),ne},t};(function(n){n.exports=zX})(OX);const GX=gR(MS);function QD(n,e,t=(r,i)=>r===i){if(n===e)return!0;if(!n||!e)return!1;const r=n.length;if(e.length!==r)return!1;for(let i=0;ii.response=s).then(()=>{r.lifespan&&r.lifespan>0&&setTimeout(()=>{const s=Qo.indexOf(i);s!==-1&&Qo.splice(s,1)},r.lifespan)}).catch(s=>i.error=s)};if(Qo.push(i),!t)throw i.promise}const HX=(n,e,t)=>qD(n,e,!1,t),VX=(n,e,t)=>void qD(n,e,!0,t),WX=n=>{if(n===void 0||n.length===0)Qo.splice(0,Qo.length);else{const e=Qo.find(t=>QD(n,t.keys,t.equal));if(e){const t=Qo.indexOf(e);t!==-1&&Qo.splice(t,1)}}},l2={},u2=n=>void Object.assign(l2,n);function JX(n,e){function t(c,{args:f=[],attach:p,...m},g){let v=`${c[0].toUpperCase()}${c.slice(1)}`,y;if(c==="primitive"){if(m.object===void 0)throw new Error("R3F: Primitives without 'object' are invalid!");const w=m.object;y=wc(w,{type:c,root:g,attach:p,primitive:!0})}else{const w=l2[v];if(!w)throw new Error(`R3F: ${v} is not part of the THREE namespace! Did you forget to extend? See: https://docs.pmnd.rs/react-three-fiber/api/objects#using-3rd-party-objects-declaratively`);if(!Array.isArray(f))throw new Error("R3F: The args prop must be an array!");y=wc(new w(...f),{type:c,root:g,attach:p,memoizedProps:{args:f}})}return y.__r3f.attach===void 0&&(y instanceof Ut?y.__r3f.attach="geometry":y instanceof fr&&(y.__r3f.attach="material")),v!=="inject"&&Gx(y,m),y}function r(c,f){let p=!1;if(f){var m,g;(m=f.__r3f)!=null&&m.attach?zx(c,f,f.__r3f.attach):f.isObject3D&&c.isObject3D&&(c.add(f),p=!0),p||(g=c.__r3f)==null||g.objects.push(f),f.__r3f||wc(f,{}),f.__r3f.parent=c,CS(f),Sc(f)}}function i(c,f,p){let m=!1;if(f){var g,v;if((g=f.__r3f)!=null&&g.attach)zx(c,f,f.__r3f.attach);else if(f.isObject3D&&c.isObject3D){f.parent=c,f.dispatchEvent({type:"added"});const y=c.children.filter(_=>_!==f),w=y.indexOf(p);c.children=[...y.slice(0,w),f,...y.slice(w)],m=!0}m||(v=c.__r3f)==null||v.objects.push(f),f.__r3f||wc(f,{}),f.__r3f.parent=c,CS(f),Sc(f)}}function s(c,f,p=!1){c&&[...c].forEach(m=>o(f,m,p))}function o(c,f,p){if(f){var m,g,v;if(f.__r3f&&(f.__r3f.parent=null),(m=c.__r3f)!=null&&m.objects&&(c.__r3f.objects=c.__r3f.objects.filter(A=>A!==f)),(g=f.__r3f)!=null&&g.attach)U3(c,f,f.__r3f.attach);else if(f.isObject3D&&c.isObject3D){var y;c.remove(f),(y=f.__r3f)!=null&&y.root&&qX(f.__r3f.root,f)}const _=(v=f.__r3f)==null?void 0:v.primitive,x=p===void 0?f.dispose!==null&&!_:p;if(!_){var w;s((w=f.__r3f)==null?void 0:w.objects,f,x),s(f.children,f,x)}f.__r3f&&(delete f.__r3f.root,delete f.__r3f.objects,delete f.__r3f.handlers,delete f.__r3f.memoizedProps,_||delete f.__r3f),x&&f.dispose&&f.type!=="Scene"&&op.unstable_scheduleCallback(op.unstable_IdlePriority,()=>{try{f.dispose()}catch{}}),Sc(c)}}function a(c,f,p,m){var g;const v=(g=c.__r3f)==null?void 0:g.parent;if(!v)return;const y=t(f,p,c.__r3f.root);if(c.children){for(const w of c.children)w.__r3f&&r(y,w);c.children=c.children.filter(w=>!w.__r3f)}c.__r3f.objects.forEach(w=>r(y,w)),c.__r3f.objects=[],c.__r3f.autoRemovedBeforeAppend||o(v,c),y.parent&&(y.__r3f.autoRemovedBeforeAppend=!0),r(v,y),y.raycast&&y.__r3f.eventCount&&y.__r3f.root.getState().internal.interaction.push(y),[m,m.alternate].forEach(w=>{w!==null&&(w.stateNode=y,w.ref&&(typeof w.ref=="function"?w.ref(y):w.ref.current=y))})}const l=()=>console.warn("Text is not allowed in the R3F tree! This could be stray whitespace or characters.");return{reconciler:GX({createInstance:t,removeChild:o,appendChild:r,appendInitialChild:r,insertBefore:i,supportsMutation:!0,isPrimaryRenderer:!1,supportsPersistence:!1,supportsHydration:!1,noTimeout:-1,appendChildToContainer:(c,f)=>{if(!f)return;const p=c.getState().scene;p.__r3f&&(p.__r3f.root=c,r(p,f))},removeChildFromContainer:(c,f)=>{f&&o(c.getState().scene,f)},insertInContainerBefore:(c,f,p)=>{if(!f||!p)return;const m=c.getState().scene;m.__r3f&&i(m,f,p)},getRootHostContext:()=>null,getChildHostContext:c=>c,finalizeInitialChildren(c){var f;return!!((f=c==null?void 0:c.__r3f)!=null?f:{}).handlers},prepareUpdate(c,f,p,m){if(c.__r3f.primitive&&m.object&&m.object!==c)return[!0];{const{args:g=[],children:v,...y}=m,{args:w=[],children:_,...x}=p;if(!Array.isArray(g))throw new Error("R3F: the args prop must be an array!");if(g.some((C,b)=>C!==w[b]))return[!0];const A=sk(c,y,x,!0);return A.changes.length?[!1,A]:null}},commitUpdate(c,[f,p],m,g,v,y){f?a(c,m,v,y):Gx(c,p)},commitMount(c,f,p,m){var g;const v=(g=c.__r3f)!=null?g:{};c.raycast&&v.handlers&&v.eventCount&&c.__r3f.root.getState().internal.interaction.push(c)},getPublicInstance:c=>c,prepareForCommit:()=>null,preparePortalMount:c=>wc(c.getState().scene),resetAfterCommit:()=>{},shouldSetTextContent:()=>!1,clearContainer:()=>!1,hideInstance(c){var f;const{attach:p,parent:m}=(f=c.__r3f)!=null?f:{};p&&m&&U3(m,c,p),c.isObject3D&&(c.visible=!1),Sc(c)},unhideInstance(c,f){var p;const{attach:m,parent:g}=(p=c.__r3f)!=null?p:{};m&&g&&zx(g,c,m),(c.isObject3D&&f.visible==null||f.visible)&&(c.visible=!0),Sc(c)},createTextInstance:l,hideTextInstance:l,unhideTextInstance:l,getCurrentEventPriority:()=>e?e():Qa.DefaultEventPriority,beforeActiveInstanceBlur:()=>{},afterActiveInstanceBlur:()=>{},detachDeletedInstance:()=>{},now:typeof performance<"u"&&Pn.fun(performance.now)?performance.now:Pn.fun(Date.now)?Date.now:()=>0,scheduleTimeout:Pn.fun(setTimeout)?setTimeout:void 0,cancelTimeout:Pn.fun(clearTimeout)?clearTimeout:void 0}),applyProps:Gx}}var k3,F3;const $D=()=>{var n;return(n=l2.ColorManagement)!=null?n:null},ek=n=>n&&n.isOrthographicCamera,jX=n=>n&&n.hasOwnProperty("current"),Gp=typeof window<"u"&&((k3=window.document)!=null&&k3.createElement||((F3=window.navigator)==null?void 0:F3.product)==="ReactNative")?ee.useLayoutEffect:ee.useEffect;function tk(n){const e=ee.useRef(n);return Gp(()=>void(e.current=n),[n]),e}function XX({set:n}){return Gp(()=>(n(new Promise(()=>null)),()=>n(!1)),[n]),null}class nk extends ee.Component{constructor(...e){super(...e),this.state={error:!1}}componentDidCatch(e){this.props.set(e)}render(){return this.state.error?null:this.props.children}}nk.getDerivedStateFromError=()=>({error:!0});const rk="__default",N3=new Map,YX=n=>n&&!!n.memoized&&!!n.changes;function ik(n){const e=typeof window<"u"?window.devicePixelRatio:1;return Array.isArray(n)?Math.min(Math.max(n[0],e),n[1]):n}const Lh=n=>{var e;return(e=n.__r3f)==null?void 0:e.root.getState()},Pn={obj:n=>n===Object(n)&&!Pn.arr(n)&&typeof n!="function",fun:n=>typeof n=="function",str:n=>typeof n=="string",num:n=>typeof n=="number",boo:n=>typeof n=="boolean",und:n=>n===void 0,arr:n=>Array.isArray(n),equ(n,e,{arrays:t="shallow",objects:r="reference",strict:i=!0}={}){if(typeof n!=typeof e||!!n!=!!e)return!1;if(Pn.str(n)||Pn.num(n))return n===e;const s=Pn.obj(n);if(s&&r==="reference")return n===e;const o=Pn.arr(n);if(o&&t==="reference")return n===e;if((o||s)&&n===e)return!0;let a;for(a in n)if(!(a in e))return!1;if(s&&t==="shallow"&&r==="shallow"){for(a in i?e:n)if(!Pn.equ(n[a],e[a],{strict:i,objects:"reference"}))return!1}else for(a in i?e:n)if(n[a]!==e[a])return!1;if(Pn.und(a)){if(o&&n.length===0&&e.length===0||s&&Object.keys(n).length===0&&Object.keys(e).length===0)return!0;if(n!==e)return!1}return!0}};function KX(n){const e={nodes:{},materials:{}};return n&&n.traverse(t=>{t.name&&(e.nodes[t.name]=t),t.material&&!e.materials[t.material.name]&&(e.materials[t.material.name]=t.material)}),e}function ZX(n){n.dispose&&n.type!=="Scene"&&n.dispose();for(const e in n)e.dispose==null||e.dispose(),delete n[e]}function wc(n,e){const t=n;return(e!=null&&e.primitive||!t.__r3f)&&(t.__r3f={type:"",root:null,previousAttach:null,memoizedProps:{},eventCount:0,handlers:{},objects:[],parent:null,...e}),n}function ES(n,e){let t=n;if(e.includes("-")){const r=e.split("-"),i=r.pop();return t=r.reduce((s,o)=>s[o],n),{target:t,key:i}}else return{target:t,key:e}}const O3=/-\d+$/;function zx(n,e,t){if(Pn.str(t)){if(O3.test(t)){const s=t.replace(O3,""),{target:o,key:a}=ES(n,s);Array.isArray(o[a])||(o[a]=[])}const{target:r,key:i}=ES(n,t);e.__r3f.previousAttach=r[i],r[i]=e}else e.__r3f.previousAttach=t(n,e)}function U3(n,e,t){var r,i;if(Pn.str(t)){const{target:s,key:o}=ES(n,t),a=e.__r3f.previousAttach;a===void 0?delete s[o]:s[o]=a}else(r=e.__r3f)==null||r.previousAttach==null||r.previousAttach(n,e);(i=e.__r3f)==null||delete i.previousAttach}function sk(n,{children:e,key:t,ref:r,...i},{children:s,key:o,ref:a,...l}={},u=!1){var c;const f=(c=n==null?void 0:n.__r3f)!=null?c:{},p=Object.entries(i),m=[];if(u){const v=Object.keys(l);for(let y=0;y{var w;if((w=n.__r3f)!=null&&w.primitive&&v==="object"||Pn.equ(y,l[v]))return;if(/^on(Pointer|Click|DoubleClick|ContextMenu|Wheel)/.test(v))return m.push([v,y,!0,[]]);let _=[];v.includes("-")&&(_=v.split("-")),m.push([v,y,!1,_]);for(const x in i){const A=i[x];x.startsWith(`${v}-`)&&m.push([x,A,!1,x.split("-")])}});const g={...i};return f.memoizedProps&&f.memoizedProps.args&&(g.args=f.memoizedProps.args),f.memoizedProps&&f.memoizedProps.attach&&(g.attach=f.memoizedProps.attach),{memoized:g,changes:m}}function Gx(n,e){var t,r,i;const s=(t=n.__r3f)!=null?t:{},o=s.root,a=(r=o==null||o.getState==null?void 0:o.getState())!=null?r:{},{memoized:l,changes:u}=YX(e)?e:sk(n,e),c=s.eventCount;n.__r3f&&(n.__r3f.memoizedProps=l);for(let p=0;px[A],n),!(_&&_.set))){const[x,...A]=y.reverse();w=A.reverse().reduce((C,b)=>C[b],n),m=x}if(g===rk+"remove")if(w.constructor){let x=N3.get(w.constructor);x||(x=new w.constructor,N3.set(w.constructor,x)),g=x[m]}else g=0;if(v)g?s.handlers[m]=g:delete s.handlers[m],s.eventCount=Object.keys(s.handlers).length;else if(_&&_.set&&(_.copy||_ instanceof gu)){if(Array.isArray(g))_.fromArray?_.fromArray(g):_.set(...g);else if(_.copy&&g&&g.constructor&&_.constructor===g.constructor)_.copy(g);else if(g!==void 0){const x=_ instanceof st;!x&&_.setScalar?_.setScalar(g):_ instanceof gu&&g instanceof gu?_.mask=g.mask:_.set(g),!$D()&&!a.linear&&x&&_.convertSRGBToLinear()}}else w[m]=g,!a.linear&&w[m]instanceof Rn&&w[m].format===mi&&w[m].type===pa&&(w[m].encoding=wn);Sc(n)}if(s.parent&&a.internal&&n.raycast&&c!==s.eventCount){const p=a.internal.interaction.indexOf(n);p>-1&&a.internal.interaction.splice(p,1),s.eventCount&&a.internal.interaction.push(n)}return!(u.length===1&&u[0][0]==="onUpdate")&&u.length&&(i=n.__r3f)!=null&&i.parent&&CS(n),n}function Sc(n){var e,t;const r=(e=n.__r3f)==null||(t=e.root)==null||t.getState==null?void 0:t.getState();r&&r.internal.frames===0&&r.invalidate()}function CS(n){n.onUpdate==null||n.onUpdate(n)}function ok(n,e){n.manual||(ek(n)?(n.left=e.width/-2,n.right=e.width/2,n.top=e.height/2,n.bottom=e.height/-2):n.aspect=e.width/e.height,n.updateProjectionMatrix(),n.updateMatrixWorld())}function Jg(n){return(n.eventObject||n.object).uuid+"/"+n.index+n.instanceId}function QX(){var n;const e=typeof self<"u"&&self||typeof window<"u"&&window;if(!e)return Qa.DefaultEventPriority;switch((n=e.event)==null?void 0:n.type){case"click":case"contextmenu":case"dblclick":case"pointercancel":case"pointerdown":case"pointerup":return Qa.DiscreteEventPriority;case"pointermove":case"pointerout":case"pointerover":case"pointerenter":case"pointerleave":case"wheel":return Qa.ContinuousEventPriority;default:return Qa.DefaultEventPriority}}function ak(n,e,t,r){const i=t.get(e);i&&(t.delete(e),t.size===0&&(n.delete(r),i.target.releasePointerCapture(r)))}function qX(n,e){const{internal:t}=n.getState();t.interaction=t.interaction.filter(r=>r!==e),t.initialHits=t.initialHits.filter(r=>r!==e),t.hovered.forEach((r,i)=>{(r.eventObject===e||r.object===e)&&t.hovered.delete(i)}),t.capturedMap.forEach((r,i)=>{ak(t.capturedMap,e,r,i)})}function $X(n){function e(l){const{internal:u}=n.getState(),c=l.offsetX-u.initialClick[0],f=l.offsetY-u.initialClick[1];return Math.round(Math.sqrt(c*c+f*f))}function t(l){return l.filter(u=>["Move","Over","Enter","Out","Leave"].some(c=>{var f;return(f=u.__r3f)==null?void 0:f.handlers["onPointer"+c]}))}function r(l,u){const c=n.getState(),f=new Set,p=[],m=u?u(c.internal.interaction):c.internal.interaction;for(let w=0;w{const x=Lh(w.object),A=Lh(_.object);return!x||!A?w.distance-_.distance:A.events.priority-x.events.priority||w.distance-_.distance}).filter(w=>{const _=Jg(w);return f.has(_)?!1:(f.add(_),!0)});c.events.filter&&(v=c.events.filter(v,c));for(const w of v){let _=w.object;for(;_;){var y;(y=_.__r3f)!=null&&y.eventCount&&p.push({...w,eventObject:_}),_=_.parent}}if("pointerId"in l&&c.internal.capturedMap.has(l.pointerId))for(let w of c.internal.capturedMap.get(l.pointerId).values())f.has(Jg(w.intersection))||p.push(w.intersection);return p}function i(l,u,c,f){const p=n.getState();if(l.length){const m={stopped:!1};for(const g of l){const v=Lh(g.object)||p,{raycaster:y,pointer:w,camera:_,internal:x}=v,A=new Z(w.x,w.y,0).unproject(_),C=D=>{var U,z;return(U=(z=x.capturedMap.get(D))==null?void 0:z.has(g.eventObject))!=null?U:!1},b=D=>{const U={intersection:g,target:u.target};x.capturedMap.has(D)?x.capturedMap.get(D).set(g.eventObject,U):x.capturedMap.set(D,new Map([[g.eventObject,U]])),u.target.setPointerCapture(D)},R=D=>{const U=x.capturedMap.get(D);U&&ak(x.capturedMap,g.eventObject,U,D)};let E={};for(let D in u){let U=u[D];typeof U!="function"&&(E[D]=U)}let B={...g,...E,pointer:w,intersections:l,stopped:m.stopped,delta:c,unprojectedPoint:A,ray:y.ray,camera:_,stopPropagation(){const D="pointerId"in u&&x.capturedMap.get(u.pointerId);if((!D||D.has(g.eventObject))&&(B.stopped=m.stopped=!0,x.hovered.size&&Array.from(x.hovered.values()).find(U=>U.eventObject===g.eventObject))){const U=l.slice(0,l.indexOf(g));s([...U,g])}},target:{hasPointerCapture:C,setPointerCapture:b,releasePointerCapture:R},currentTarget:{hasPointerCapture:C,setPointerCapture:b,releasePointerCapture:R},nativeEvent:u};if(f(B),m.stopped===!0)break}}return l}function s(l){const{internal:u}=n.getState();for(const c of u.hovered.values())if(!l.length||!l.find(f=>f.object===c.object&&f.index===c.index&&f.instanceId===c.instanceId)){const p=c.eventObject.__r3f,m=p==null?void 0:p.handlers;if(u.hovered.delete(Jg(c)),p!=null&&p.eventCount){const g={...c,intersections:l};m.onPointerOut==null||m.onPointerOut(g),m.onPointerLeave==null||m.onPointerLeave(g)}}}function o(l,u){for(let c=0;cs([]);case"onLostPointerCapture":return u=>{const{internal:c}=n.getState();"pointerId"in u&&c.capturedMap.has(u.pointerId)&&requestAnimationFrame(()=>{c.capturedMap.has(u.pointerId)&&(c.capturedMap.delete(u.pointerId),s([]))})}}return function(c){const{onPointerMissed:f,internal:p}=n.getState();p.lastEvent.current=c;const m=l==="onPointerMove",g=l==="onClick"||l==="onContextMenu"||l==="onDoubleClick",y=r(c,m?t:void 0),w=g?e(c):0;l==="onPointerDown"&&(p.initialClick=[c.offsetX,c.offsetY],p.initialHits=y.map(x=>x.eventObject)),g&&!y.length&&w<=2&&(o(c,p.interaction),f&&f(c)),m&&s(y);function _(x){const A=x.eventObject,C=A.__r3f,b=C==null?void 0:C.handlers;if(C!=null&&C.eventCount)if(m){if(b.onPointerOver||b.onPointerEnter||b.onPointerOut||b.onPointerLeave){const R=Jg(x),E=p.hovered.get(R);E?E.stopped&&x.stopPropagation():(p.hovered.set(R,x),b.onPointerOver==null||b.onPointerOver(x),b.onPointerEnter==null||b.onPointerEnter(x))}b.onPointerMove==null||b.onPointerMove(x)}else{const R=b[l];R?(!g||p.initialHits.includes(A))&&(o(c,p.interaction.filter(E=>!p.initialHits.includes(E))),R(x)):g&&p.initialHits.includes(A)&&o(c,p.interaction.filter(E=>!p.initialHits.includes(E)))}}i(y,c,w,_)}}return{handlePointer:a}}const eY=["set","get","setSize","setFrameloop","setDpr","events","invalidate","advance","size","viewport"],lk=n=>!!(n!=null&&n.render),c2=ee.createContext(null),tY=(n,e)=>{const t=KD((a,l)=>{const u=new Z,c=new Z,f=new Z;function p(w=l().camera,_=c,x=l().size){const{width:A,height:C,top:b,left:R}=x,E=A/C;_ instanceof Z?f.copy(_):f.set(..._);const B=w.getWorldPosition(u).distanceTo(f);if(ek(w))return{width:A/w.zoom,height:C/w.zoom,top:b,left:R,factor:1,distance:B,aspect:E};{const D=w.fov*Math.PI/180,U=2*Math.tan(D/2)*B,z=U*(A/C);return{width:z,height:U,top:b,left:R,factor:A/z,distance:B,aspect:E}}}let m;const g=w=>a(_=>({performance:{..._.performance,current:w}})),v=new ze;return{set:a,get:l,gl:null,camera:null,raycaster:null,events:{priority:1,enabled:!0,connected:!1},xr:null,scene:null,invalidate:(w=1)=>n(l(),w),advance:(w,_)=>e(w,_,l()),legacy:!1,linear:!1,flat:!1,controls:null,clock:new r2,pointer:v,mouse:v,frameloop:"always",onPointerMissed:void 0,performance:{current:1,min:.5,max:1,debounce:200,regress:()=>{const w=l();m&&clearTimeout(m),w.performance.current!==w.performance.min&&g(w.performance.min),m=setTimeout(()=>g(l().performance.max),w.performance.debounce)}},size:{width:0,height:0,top:0,left:0,updateStyle:!1},viewport:{initialDpr:0,dpr:0,width:0,height:0,top:0,left:0,aspect:0,distance:0,factor:0,getCurrentViewport:p},setEvents:w=>a(_=>({..._,events:{..._.events,...w}})),setSize:(w,_,x,A,C)=>{const b=l().camera,R={width:w,height:_,top:A||0,left:C||0,updateStyle:x};a(E=>({size:R,viewport:{...E.viewport,...p(b,c,R)}}))},setDpr:w=>a(_=>{const x=ik(w);return{viewport:{..._.viewport,dpr:x,initialDpr:_.viewport.initialDpr||x}}}),setFrameloop:(w="always")=>{const _=l().clock;_.stop(),_.elapsedTime=0,w!=="never"&&(_.start(),_.elapsedTime=0),a(()=>({frameloop:w}))},previousRoot:void 0,internal:{active:!1,priority:0,frames:0,lastEvent:ee.createRef(),interaction:[],hovered:new Map,subscribers:[],initialClick:[0,0],initialHits:[],capturedMap:new Map,subscribe:(w,_,x)=>{const A=l().internal;return A.priority=A.priority+(_>0?1:0),A.subscribers.push({ref:w,priority:_,store:x}),A.subscribers=A.subscribers.sort((C,b)=>C.priority-b.priority),()=>{const C=l().internal;C!=null&&C.subscribers&&(C.priority=C.priority-(_>0?1:0),C.subscribers=C.subscribers.filter(b=>b.ref!==w))}}}}}),r=t.getState();let i=r.size,s=r.viewport.dpr,o=r.camera;return t.subscribe(()=>{const{camera:a,size:l,viewport:u,gl:c,set:f}=t.getState();if(l!==i||u.dpr!==s){var p;i=l,s=u.dpr,ok(a,l),c.setPixelRatio(u.dpr);const m=(p=l.updateStyle)!=null?p:typeof HTMLCanvasElement<"u"&&c.domElement instanceof HTMLCanvasElement;c.setSize(l.width,l.height,m)}a!==o&&(o=a,f(m=>({viewport:{...m.viewport,...m.viewport.getCurrentViewport(a)}})))}),t.subscribe(a=>n(a)),t};let jg,nY=new Set,rY=new Set,iY=new Set;function Hx(n,e){if(n.size)for(const{callback:t}of n.values())t(e)}function Dh(n,e){switch(n){case"before":return Hx(nY,e);case"after":return Hx(rY,e);case"tail":return Hx(iY,e)}}let Vx,Wx;function Jx(n,e,t){let r=e.clock.getDelta();for(e.frameloop==="never"&&typeof n=="number"&&(r=n-e.clock.elapsedTime,e.clock.oldTime=e.clock.elapsedTime,e.clock.elapsedTime=n),Vx=e.internal.subscribers,jg=0;jg0)&&!((u=i.gl.xr)!=null&&u.isPresenting)&&(t+=Jx(l,i))}if(Dh("after",l),t===0)return Dh("tail",l),e=!1,cancelAnimationFrame(r)}function o(l,u=1){var c;if(!l)return n.forEach(f=>o(f.store.getState()),u);(c=l.gl.xr)!=null&&c.isPresenting||!l.internal.active||l.frameloop==="never"||(l.internal.frames=Math.min(60,l.internal.frames+u),e||(e=!0,requestAnimationFrame(s)))}function a(l,u=!0,c,f){if(u&&Dh("before",l),c)Jx(l,c,f);else for(const p of n.values())Jx(l,p.store.getState());u&&Dh("after",l)}return{loop:s,invalidate:o,advance:a}}function f2(){const n=ee.useContext(c2);if(!n)throw new Error("R3F: Hooks can only be used within the Canvas component!");return n}function bn(n=t=>t,e){return f2()(n,e)}function Sl(n,e=0){const t=f2(),r=t.getState().internal.subscribe,i=tk(n);return Gp(()=>r(i,e,t),[e,r,t]),null}function uk(n,e){return function(t,...r){const i=new t;return n&&n(i),Promise.all(r.map(s=>new Promise((o,a)=>i.load(s,l=>{l.scene&&Object.assign(l,KX(l.scene)),o(l)},e,l=>a(new Error(`Could not load ${s}: ${l.message})`))))))}}function Nf(n,e,t,r){const i=Array.isArray(e)?e:[e],s=HX(uk(t,r),[n,...i],{equal:Pn.equ});return Array.isArray(e)?s:s[0]}Nf.preload=function(n,e,t){const r=Array.isArray(e)?e:[e];return VX(uk(t),[n,...r])};Nf.clear=function(n,e){const t=Array.isArray(e)?e:[e];return WX([n,...t])};const Ef=new Map,{invalidate:z3,advance:G3}=sY(Ef),{reconciler:ap,applyProps:kh}=JX(Ef,QX),yc={objects:"shallow",strict:!1},oY=(n,e)=>{const t=typeof n=="function"?n(e):n;return lk(t)?t:new _y({powerPreference:"high-performance",canvas:e,antialias:!0,alpha:!0,...n})};function aY(n,e){if(e)return e;if(typeof HTMLCanvasElement<"u"&&n instanceof HTMLCanvasElement&&n.parentElement){const{width:t,height:r,top:i,left:s}=n.parentElement.getBoundingClientRect();return{width:t,height:r,top:i,left:s}}else if(typeof OffscreenCanvas<"u"&&n instanceof OffscreenCanvas)return{width:n.width,height:n.height,top:0,left:0};return{width:0,height:0,top:0,left:0}}function lY(n){const e=Ef.get(n),t=e==null?void 0:e.fiber,r=e==null?void 0:e.store;e&&console.warn("R3F.createRoot should only be called once!");const i=typeof reportError=="function"?reportError:console.error,s=r||tY(z3,G3),o=t||ap.createContainer(s,Qa.ConcurrentRoot,null,!1,null,"",i,null);e||Ef.set(n,{fiber:o,store:s});let a,l=!1,u;return{configure(c={}){let{gl:f,size:p,scene:m,events:g,onCreated:v,shadows:y=!1,linear:w=!1,flat:_=!1,legacy:x=!1,orthographic:A=!1,frameloop:C="always",dpr:b=[1,2],performance:R,raycaster:E,camera:B,onPointerMissed:D}=c,U=s.getState(),z=U.gl;U.gl||U.set({gl:z=oY(f,n)});let Y=U.raycaster;Y||U.set({raycaster:Y=new a2});const{params:P,...F}=E||{};if(Pn.equ(F,Y,yc)||kh(Y,{...F}),Pn.equ(P,Y.params,yc)||kh(Y,{params:{...Y.params,...P}}),!U.camera||U.camera===u&&!Pn.equ(u,B,yc)){u=B;const W=B instanceof Mp,k=W?B:A?new oa(0,0,0,0,.1,1e3):new Qn(75,0,.1,1e3);W||(k.position.z=5,B&&kh(k,B),!U.camera&&!(B!=null&&B.rotation)&&k.lookAt(0,0,0)),U.set({camera:k})}if(!U.scene){let W;m instanceof wf?W=m:(W=new wf,m&&kh(W,m)),U.set({scene:wc(W)})}if(!U.xr){const W=(q,X)=>{const J=s.getState();J.frameloop!=="never"&&G3(q,!0,J,X)},k=()=>{const q=s.getState();q.gl.xr.enabled=q.gl.xr.isPresenting,q.gl.xr.setAnimationLoop(q.gl.xr.isPresenting?W:null),q.gl.xr.isPresenting||z3(q)},Q={connect(){const q=s.getState().gl;q.xr.addEventListener("sessionstart",k),q.xr.addEventListener("sessionend",k)},disconnect(){const q=s.getState().gl;q.xr.removeEventListener("sessionstart",k),q.xr.removeEventListener("sessionend",k)}};z.xr&&Q.connect(),U.set({xr:Q})}if(z.shadowMap){const W=z.shadowMap.enabled,k=z.shadowMap.type;if(z.shadowMap.enabled=!!y,Pn.boo(y))z.shadowMap.type=pd;else if(Pn.str(y)){var G;const Q={basic:oL,percentage:fy,soft:pd,variance:su};z.shadowMap.type=(G=Q[y])!=null?G:pd}else Pn.obj(y)&&Object.assign(z.shadowMap,y);(W!==z.shadowMap.enabled||k!==z.shadowMap.type)&&(z.shadowMap.needsUpdate=!0)}const ie=$D();ie&&("enabled"in ie?ie.enabled=!x:"legacyMode"in ie&&(ie.legacyMode=x));const N=w?ma:wn,V=_?js:vM;z.outputEncoding!==N&&(z.outputEncoding=N),z.toneMapping!==V&&(z.toneMapping=V),U.legacy!==x&&U.set(()=>({legacy:x})),U.linear!==w&&U.set(()=>({linear:w})),U.flat!==_&&U.set(()=>({flat:_})),f&&!Pn.fun(f)&&!lk(f)&&!Pn.equ(f,z,yc)&&kh(z,f),g&&!U.events.handlers&&U.set({events:g(s)});const j=aY(n,p);return Pn.equ(j,U.size,yc)||U.setSize(j.width,j.height,j.updateStyle,j.top,j.left),b&&U.viewport.dpr!==ik(b)&&U.setDpr(b),U.frameloop!==C&&U.setFrameloop(C),U.onPointerMissed||U.set({onPointerMissed:D}),R&&!Pn.equ(R,U.performance,yc)&&U.set(W=>({performance:{...W.performance,...R}})),a=v,l=!0,this},render(c){return l||this.configure(),ap.updateContainer(ee.createElement(uY,{store:s,children:c,onCreated:a,rootElement:n}),o,null,()=>{}),s},unmount(){ck(n)}}}function uY({store:n,children:e,onCreated:t,rootElement:r}){return Gp(()=>{const i=n.getState();i.set(s=>({internal:{...s.internal,active:!0}})),t&&t(i),n.getState().events.connected||i.events.connect==null||i.events.connect(r)},[]),ee.createElement(c2.Provider,{value:n},e)}function ck(n,e){const t=Ef.get(n),r=t==null?void 0:t.fiber;if(r){const i=t==null?void 0:t.store.getState();i&&(i.internal.active=!1),ap.updateContainer(null,r,null,()=>{i&&setTimeout(()=>{try{var s,o,a,l;i.events.disconnect==null||i.events.disconnect(),(s=i.gl)==null||(o=s.renderLists)==null||o.dispose==null||o.dispose(),(a=i.gl)==null||a.forceContextLoss==null||a.forceContextLoss(),(l=i.gl)!=null&&l.xr&&i.xr.disconnect(),ZX(i),Ef.delete(n),e&&e(n)}catch{}},500)})}}function fk(n,e,t){return ee.createElement(cY,{key:e.uuid,children:n,container:e,state:t})}function cY({state:n={},children:e,container:t}){const{events:r,size:i,...s}=n,o=f2(),[a]=ee.useState(()=>new a2),[l]=ee.useState(()=>new ze),u=ee.useCallback((f,p)=>{const m={...f};Object.keys(f).forEach(v=>{(eY.includes(v)||f[v]!==p[v]&&p[v])&&delete m[v]});let g;if(p&&i){const v=p.camera;g=f.viewport.getCurrentViewport(v,new Z,i),v!==f.camera&&ok(v,i)}return{...m,scene:t,raycaster:a,pointer:l,mouse:l,previousRoot:o,events:{...f.events,...p==null?void 0:p.events,...r},size:{...f.size,...i},viewport:{...f.viewport,...g},...s}},[n]),[c]=ee.useState(()=>{const f=o.getState();return KD((m,g)=>({...f,scene:t,raycaster:a,pointer:l,mouse:l,previousRoot:o,events:{...f.events,...r},size:{...f.size,...i},...s,set:m,get:g,setEvents:v=>m(y=>({...y,events:{...y.events,...v}}))}))});return ee.useEffect(()=>{const f=o.subscribe(p=>c.setState(m=>u(p,m)));return()=>{f(),c.destroy()}},[]),ee.useEffect(()=>{c.setState(f=>u(o.getState(),f))},[u]),ee.createElement(ee.Fragment,null,ap.createPortal(ee.createElement(c2.Provider,{value:c},e),c,null))}ap.injectIntoDevTools({bundleType:0,rendererPackageName:"@react-three/fiber",version:ee.version});function bS(n,e,t){var r,i,s,o,a;e==null&&(e=100);function l(){var c=Date.now()-o;c=0?r=setTimeout(l,e-c):(r=null,t||(a=n.apply(s,i),s=i=null))}var u=function(){s=this,i=arguments,o=Date.now();var c=t&&!r;return r||(r=setTimeout(l,e)),c&&(a=n.apply(s,i),s=i=null),a};return u.clear=function(){r&&(clearTimeout(r),r=null)},u.flush=function(){r&&(a=n.apply(s,i),s=i=null,clearTimeout(r),r=null)},u}bS.debounce=bS;var H3=bS;function fY(n){let{debounce:e,scroll:t,polyfill:r,offsetSize:i}=n===void 0?{debounce:0,scroll:!1,offsetSize:!1}:n;const s=r||(typeof window>"u"?class{}:window.ResizeObserver);if(!s)throw new Error("This browser does not support ResizeObserver out of the box. See: https://github.com/react-spring/react-use-measure/#resize-observer-polyfills");const[o,a]=ee.useState({left:0,top:0,width:0,height:0,bottom:0,right:0,x:0,y:0}),l=ee.useRef({element:null,scrollContainers:null,resizeObserver:null,lastBounds:o}),u=e?typeof e=="number"?e:e.scroll:null,c=e?typeof e=="number"?e:e.resize:null,f=ee.useRef(!1);ee.useEffect(()=>(f.current=!0,()=>void(f.current=!1)));const[p,m,g]=ee.useMemo(()=>{const _=()=>{if(!l.current.element)return;const{left:x,top:A,width:C,height:b,bottom:R,right:E,x:B,y:D}=l.current.element.getBoundingClientRect(),U={left:x,top:A,width:C,height:b,bottom:R,right:E,x:B,y:D};l.current.element instanceof HTMLElement&&i&&(U.height=l.current.element.offsetHeight,U.width=l.current.element.offsetWidth),Object.freeze(U),f.current&&!mY(l.current.lastBounds,U)&&a(l.current.lastBounds=U)};return[_,c?H3(_,c):_,u?H3(_,u):_]},[a,i,u,c]);function v(){l.current.scrollContainers&&(l.current.scrollContainers.forEach(_=>_.removeEventListener("scroll",g,!0)),l.current.scrollContainers=null),l.current.resizeObserver&&(l.current.resizeObserver.disconnect(),l.current.resizeObserver=null)}function y(){l.current.element&&(l.current.resizeObserver=new s(g),l.current.resizeObserver.observe(l.current.element),t&&l.current.scrollContainers&&l.current.scrollContainers.forEach(_=>_.addEventListener("scroll",g,{capture:!0,passive:!0})))}const w=_=>{!_||_===l.current.element||(v(),l.current.element=_,l.current.scrollContainers=hk(_),y())};return dY(g,!!t),hY(m),ee.useEffect(()=>{v(),y()},[t,g,m]),ee.useEffect(()=>v,[]),[w,o,p]}function hY(n){ee.useEffect(()=>{const e=n;return window.addEventListener("resize",e),()=>void window.removeEventListener("resize",e)},[n])}function dY(n,e){ee.useEffect(()=>{if(e){const t=n;return window.addEventListener("scroll",t,{capture:!0,passive:!0}),()=>void window.removeEventListener("scroll",t,!0)}},[n,e])}function hk(n){const e=[];if(!n||n===document.body)return e;const{overflow:t,overflowX:r,overflowY:i}=window.getComputedStyle(n);return[t,r,i].some(s=>s==="auto"||s==="scroll")&&e.push(n),[...e,...hk(n.parentElement)]}const pY=["x","y","top","bottom","left","right","width","height"],mY=(n,e)=>pY.every(t=>n[t]===e[t]);var gY=Object.defineProperty,vY=Object.defineProperties,yY=Object.getOwnPropertyDescriptors,V3=Object.getOwnPropertySymbols,xY=Object.prototype.hasOwnProperty,_Y=Object.prototype.propertyIsEnumerable,W3=(n,e,t)=>e in n?gY(n,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):n[e]=t,J3=(n,e)=>{for(var t in e||(e={}))xY.call(e,t)&&W3(n,t,e[t]);if(V3)for(var t of V3(e))_Y.call(e,t)&&W3(n,t,e[t]);return n},wY=(n,e)=>vY(n,yY(e));function dk(n,e,t){if(!n)return;if(t(n)===!0)return n;let r=e?n.return:n.child;for(;r;){const i=dk(r,e,t);if(i)return i;r=e?null:r.sibling}}function pk(n){try{return Object.defineProperties(n,{_currentRenderer:{get(){return null},set(){}},_currentRenderer2:{get(){return null},set(){}}})}catch{return n}}const h2=pk(ee.createContext(null));class mk extends ee.Component{render(){return ee.createElement(h2.Provider,{value:this._reactInternals},this.props.children)}}const{ReactCurrentOwner:j3,ReactCurrentDispatcher:X3}=ee.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;function SY(){const n=ee.useContext(h2);if(n===null)throw new Error("its-fine: useFiber must be called within a !");const e=ee.useId();return ee.useMemo(()=>{var r;return(r=j3==null?void 0:j3.current)!=null?r:dk(n,!1,i=>{let s=i.memoizedState;for(;s;){if(s.memoizedState===e)return!0;s=s.next}})},[n,e])}function AY(){var n,e;const t=SY(),[r]=ee.useState(()=>new Map);r.clear();let i=t;for(;i;){const s=(n=i.type)==null?void 0:n._context;s&&s!==h2&&!r.has(s)&&r.set(s,(e=X3==null?void 0:X3.current)==null?void 0:e.readContext(pk(s))),i=i.return}return r}function MY(){const n=AY();return ee.useMemo(()=>Array.from(n.keys()).reduce((e,t)=>r=>ee.createElement(e,null,ee.createElement(t.Provider,wY(J3({},r),{value:n.get(t)}))),e=>ee.createElement(mk,J3({},e))),[n])}const jx={onClick:["click",!1],onContextMenu:["contextmenu",!1],onDoubleClick:["dblclick",!1],onWheel:["wheel",!0],onPointerDown:["pointerdown",!0],onPointerUp:["pointerup",!0],onPointerLeave:["pointerleave",!0],onPointerMove:["pointermove",!0],onPointerCancel:["pointercancel",!0],onLostPointerCapture:["lostpointercapture",!0]};function EY(n){const{handlePointer:e}=$X(n);return{priority:1,enabled:!0,compute(t,r,i){r.pointer.set(t.offsetX/r.size.width*2-1,-(t.offsetY/r.size.height)*2+1),r.raycaster.setFromCamera(r.pointer,r.camera)},connected:void 0,handlers:Object.keys(jx).reduce((t,r)=>({...t,[r]:e(r)}),{}),update:()=>{var t;const{events:r,internal:i}=n.getState();(t=i.lastEvent)!=null&&t.current&&r.handlers&&r.handlers.onPointerMove(i.lastEvent.current)},connect:t=>{var r;const{set:i,events:s}=n.getState();s.disconnect==null||s.disconnect(),i(o=>({events:{...o.events,connected:t}})),Object.entries((r=s.handlers)!=null?r:[]).forEach(([o,a])=>{const[l,u]=jx[o];t.addEventListener(l,a,{passive:u})})},disconnect:()=>{const{set:t,events:r}=n.getState();if(r.connected){var i;Object.entries((i=r.handlers)!=null?i:[]).forEach(([s,o])=>{if(r&&r.connected instanceof HTMLElement){const[a]=jx[s];r.connected.removeEventListener(a,o)}}),t(s=>({events:{...s.events,connected:void 0}}))}}}}const CY=ee.forwardRef(function({children:e,fallback:t,resize:r,style:i,gl:s,events:o=EY,eventSource:a,eventPrefix:l,shadows:u,linear:c,flat:f,legacy:p,orthographic:m,frameloop:g,dpr:v,performance:y,raycaster:w,camera:_,onPointerMissed:x,onCreated:A,...C},b){ee.useMemo(()=>u2(DX),[]);const R=MY(),[E,B]=fY({scroll:!0,debounce:{scroll:50,resize:0},...r}),D=ee.useRef(null),U=ee.useRef(null);ee.useImperativeHandle(b,()=>D.current);const z=tk(x),[Y,P]=ee.useState(!1),[F,G]=ee.useState(!1);if(Y)throw Y;if(F)throw F;const ie=ee.useRef(null);Gp(()=>{const V=D.current;B.width>0&&B.height>0&&V&&(ie.current||(ie.current=lY(V)),ie.current.configure({gl:s,events:o,shadows:u,linear:c,flat:f,legacy:p,orthographic:m,frameloop:g,dpr:v,performance:y,raycaster:w,camera:_,size:B,onPointerMissed:(...j)=>z.current==null?void 0:z.current(...j),onCreated:j=>{j.events.connect==null||j.events.connect(a?jX(a)?a.current:a:U.current),l&&j.setEvents({compute:(W,k)=>{const Q=W[l+"X"],q=W[l+"Y"];k.pointer.set(Q/k.size.width*2-1,-(q/k.size.height)*2+1),k.raycaster.setFromCamera(k.pointer,k.camera)}}),A==null||A(j)}}),ie.current.render(ee.createElement(R,null,ee.createElement(nk,{set:G},ee.createElement(ee.Suspense,{fallback:ee.createElement(XX,{set:P})},e)))))}),ee.useEffect(()=>{const V=D.current;if(V)return()=>ck(V)},[]);const N=a?"none":"auto";return ee.createElement("div",Tr({ref:U,style:{position:"relative",width:"100%",height:"100%",overflow:"hidden",pointerEvents:N,...i}},C),ee.createElement("div",{ref:E,style:{width:"100%",height:"100%"}},ee.createElement("canvas",{ref:D,style:{display:"block"}},t)))}),Of=ee.forwardRef(function(e,t){return ee.createElement(mk,null,ee.createElement(CY,Tr({},e,{ref:t})))});function bY(n){return function(e){n.forEach(function(t){typeof t=="function"?t(e):t!=null&&(t.current=e)})}}function Y3(n,e){if(e===KL)return console.warn("THREE.BufferGeometryUtils.toTrianglesDrawMode(): Geometry already defined as triangles."),n;if(e===Iv||e===wM){let t=n.getIndex();if(t===null){const o=[],a=n.getAttribute("position");if(a!==void 0){for(let l=0;l>>1|(In&21845)<<1;Fa=(Fa&52428)>>>2|(Fa&13107)<<2,Fa=(Fa&61680)>>>4|(Fa&3855)<<4,RS[In]=((Fa&65280)>>>8|(Fa&255)<<8)>>>1}var yd=function(n,e,t){for(var r=n.length,i=0,s=new qa(e);i>>l]=u}else for(a=new qa(r),i=0;i>>15-n[i]);return a},Hp=new ws(288);for(var In=0;In<144;++In)Hp[In]=8;for(var In=144;In<256;++In)Hp[In]=9;for(var In=256;In<280;++In)Hp[In]=7;for(var In=280;In<288;++In)Hp[In]=8;var wk=new ws(32);for(var In=0;In<32;++In)wk[In]=5;var IY=yd(Hp,9,1),LY=yd(wk,5,1),Xx=function(n){for(var e=n[0],t=1;te&&(e=n[t]);return e},ks=function(n,e,t){var r=e/8|0;return(n[r]|n[r+1]<<8)>>(e&7)&t},Yx=function(n,e){var t=e/8|0;return(n[t]|n[t+1]<<8|n[t+2]<<16)>>(e&7)},DY=function(n){return(n/8|0)+(n&7&&1)},kY=function(n,e,t){(e==null||e<0)&&(e=0),(t==null||t>n.length)&&(t=n.length);var r=new(n instanceof qa?qa:n instanceof TS?TS:ws)(t-e);return r.set(n.subarray(e,t)),r},FY=function(n,e,t){var r=n.length;if(!r||t&&!t.l&&r<5)return e||new ws(0);var i=!e||t,s=!t||t.i;t||(t={}),e||(e=new ws(r*3));var o=function(J){var ae=e.length;if(J>ae){var re=new ws(Math.max(ae*2,J));re.set(e),e=re}},a=t.f||0,l=t.p||0,u=t.b||0,c=t.l,f=t.d,p=t.m,m=t.n,g=r*8;do{if(!c){t.f=a=ks(n,l,1);var v=ks(n,l+1,3);if(l+=3,v)if(v==1)c=IY,f=LY,p=9,m=5;else if(v==2){var x=ks(n,l,31)+257,A=ks(n,l+10,15)+4,C=x+ks(n,l+5,31)+1;l+=14;for(var b=new ws(C),R=new ws(19),E=0;E>>4;if(y<16)b[E++]=y;else{var Y=0,P=0;for(y==16?(P=3+ks(n,l,3),l+=2,Y=b[E-1]):y==17?(P=3+ks(n,l,7),l+=3):y==18&&(P=11+ks(n,l,127),l+=7);P--;)b[E++]=Y}}var F=b.subarray(0,x),G=b.subarray(x);p=Xx(F),m=Xx(G),c=yd(F,p,1),f=yd(G,m,1)}else throw"invalid block type";else{var y=DY(l)+4,w=n[y-4]|n[y-3]<<8,_=y+w;if(_>r){if(s)throw"unexpected EOF";break}i&&o(u+w),e.set(n.subarray(y,_),u),t.b=u+=w,t.p=l=_*8;continue}if(l>g){if(s)throw"unexpected EOF";break}}i&&o(u+131072);for(var ie=(1<>>4;if(l+=Y&15,l>g){if(s)throw"unexpected EOF";break}if(!Y)throw"invalid length/literal";if(j<256)e[u++]=j;else if(j==256){V=l,c=null;break}else{var W=j-254;if(j>264){var E=j-257,k=gk[E];W=ks(n,l,(1<>>4;if(!Q)throw"invalid distance";l+=Q&15;var G=PY[q];if(q>3){var k=vk[q];G+=Yx(n,l)&(1<g){if(s)throw"unexpected EOF";break}i&&o(u+131072);for(var X=u+W;u>>4>7||(n[0]<<8|n[1])%31)throw"invalid zlib data";if(n[1]&32)throw"invalid zlib data: preset dictionaries not supported"};function Xg(n,e){return FY((OY(n),n.subarray(2,-4)),e)}var UY=typeof TextDecoder<"u"&&new TextDecoder,zY=0;try{UY.decode(NY,{stream:!0}),zY=1}catch{}const GY=n=>n&&n.isCubeTexture;class HY extends Vn{constructor(e,t){var r,i;const s=GY(e),a=((i=s?(r=e.image[0])==null?void 0:r.width:e.image.width)!=null?i:1024)/4,l=Math.floor(Math.log2(a)),u=Math.pow(2,l),c=3*Math.max(u,16*7),f=4*u,p=[s?"#define ENVMAP_TYPE_CUBE":"",`#define CUBEUV_TEXEL_WIDTH ${1/c}`,`#define CUBEUV_TEXEL_HEIGHT ${1/f}`,`#define CUBEUV_MAX_MIP ${l}.0`],m=` - varying vec3 vWorldPosition; - void main() - { - vec4 worldPosition = ( modelMatrix * vec4( position, 1.0 ) ); - vWorldPosition = worldPosition.xyz; - - gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 ); - } - `,g=p.join(` -`)+` - #define ENVMAP_TYPE_CUBE_UV - varying vec3 vWorldPosition; - uniform float radius; - uniform float height; - uniform float angle; - #ifdef ENVMAP_TYPE_CUBE - uniform samplerCube map; - #else - uniform sampler2D map; - #endif - // From: https://www.shadertoy.com/view/4tsBD7 - float diskIntersectWithBackFaceCulling( vec3 ro, vec3 rd, vec3 c, vec3 n, float r ) - { - float d = dot ( rd, n ); - - if( d > 0.0 ) { return 1e6; } - - vec3 o = ro - c; - float t = - dot( n, o ) / d; - vec3 q = o + rd * t; - - return ( dot( q, q ) < r * r ) ? t : 1e6; - } - // From: https://www.iquilezles.org/www/articles/intersectors/intersectors.htm - float sphereIntersect( vec3 ro, vec3 rd, vec3 ce, float ra ) - { - vec3 oc = ro - ce; - float b = dot( oc, rd ); - float c = dot( oc, oc ) - ra * ra; - float h = b * b - c; - - if( h < 0.0 ) { return -1.0; } - - h = sqrt( h ); - - return - b + h; - } - vec3 project() - { - vec3 p = normalize( vWorldPosition ); - vec3 camPos = cameraPosition; - camPos.y -= height; - float intersection = sphereIntersect( camPos, p, vec3( 0.0 ), radius ); - if( intersection > 0.0 ) { - - vec3 h = vec3( 0.0, - height, 0.0 ); - float intersection2 = diskIntersectWithBackFaceCulling( camPos, p, h, vec3( 0.0, 1.0, 0.0 ), radius ); - p = ( camPos + min( intersection, intersection2 ) * p ) / radius; - } else { - p = vec3( 0.0, 1.0, 0.0 ); - } - return p; - } - #include - #include - void main() - { - vec3 projectedWorldPosition = project(); - - #ifdef ENVMAP_TYPE_CUBE - vec3 outcolor = textureCube( map, projectedWorldPosition ).rgb; - #else - vec3 direction = normalize( projectedWorldPosition ); - vec2 uv = equirectUv( direction ); - vec3 outcolor = texture2D( map, uv ).rgb; - #endif - gl_FragColor = vec4( outcolor, 1.0 ); - #include - #include - } - `,v={map:{value:e},height:{value:(t==null?void 0:t.height)||15},radius:{value:(t==null?void 0:t.radius)||100}},y=new Lf(1,16),w=new Oi({uniforms:v,fragmentShader:g,vertexShader:m,side:$i});super(y,w)}set radius(e){this.material.uniforms.radius.value=e}get radius(){return this.material.uniforms.radius.value}set height(e){this.material.uniforms.height.value=e}get height(){return this.material.uniforms.height.value}}var VY=Object.defineProperty,WY=(n,e,t)=>e in n?VY(n,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):n[e]=t,Ot=(n,e,t)=>(WY(n,typeof e!="symbol"?e+"":e,t),t);const K3=(n,e)=>(n%e+e)%e;let JY=class extends bo{constructor(e,t){super(),Ot(this,"object"),Ot(this,"domElement"),Ot(this,"enabled",!0),Ot(this,"target",new Z),Ot(this,"minDistance",0),Ot(this,"maxDistance",1/0),Ot(this,"minZoom",0),Ot(this,"maxZoom",1/0),Ot(this,"minPolarAngle",0),Ot(this,"maxPolarAngle",Math.PI),Ot(this,"minAzimuthAngle",-1/0),Ot(this,"maxAzimuthAngle",1/0),Ot(this,"enableDamping",!1),Ot(this,"dampingFactor",.05),Ot(this,"enableZoom",!0),Ot(this,"zoomSpeed",1),Ot(this,"enableRotate",!0),Ot(this,"rotateSpeed",1),Ot(this,"enablePan",!0),Ot(this,"panSpeed",1),Ot(this,"screenSpacePanning",!0),Ot(this,"keyPanSpeed",7),Ot(this,"autoRotate",!1),Ot(this,"autoRotateSpeed",2),Ot(this,"reverseOrbit",!1),Ot(this,"keys",{LEFT:"ArrowLeft",UP:"ArrowUp",RIGHT:"ArrowRight",BOTTOM:"ArrowDown"}),Ot(this,"mouseButtons",{LEFT:Ql.ROTATE,MIDDLE:Ql.DOLLY,RIGHT:Ql.PAN}),Ot(this,"touches",{ONE:ql.ROTATE,TWO:ql.DOLLY_PAN}),Ot(this,"target0"),Ot(this,"position0"),Ot(this,"zoom0"),Ot(this,"_domElementKeyEvents",null),Ot(this,"getPolarAngle"),Ot(this,"getAzimuthalAngle"),Ot(this,"setPolarAngle"),Ot(this,"setAzimuthalAngle"),Ot(this,"getDistance"),Ot(this,"listenToKeyEvents"),Ot(this,"saveState"),Ot(this,"reset"),Ot(this,"update"),Ot(this,"connect"),Ot(this,"dispose"),this.object=e,this.domElement=t,this.target0=this.target.clone(),this.position0=this.object.position.clone(),this.zoom0=this.object.zoom,this.getPolarAngle=()=>c.phi,this.getAzimuthalAngle=()=>c.theta,this.setPolarAngle=te=>{let Ee=K3(te,2*Math.PI),be=c.phi;be<0&&(be+=2*Math.PI),Ee<0&&(Ee+=2*Math.PI);let De=Math.abs(Ee-be);2*Math.PI-De{let Ee=K3(te,2*Math.PI),be=c.theta;be<0&&(be+=2*Math.PI),Ee<0&&(Ee+=2*Math.PI);let De=Math.abs(Ee-be);2*Math.PI-Der.object.position.distanceTo(r.target),this.listenToKeyEvents=te=>{te.addEventListener("keydown",le),this._domElementKeyEvents=te},this.saveState=()=>{r.target0.copy(r.target),r.position0.copy(r.object.position),r.zoom0=r.object.zoom},this.reset=()=>{r.target.copy(r.target0),r.object.position.copy(r.position0),r.object.zoom=r.zoom0,r.object.updateProjectionMatrix(),r.dispatchEvent(i),r.update(),l=a.NONE},this.update=(()=>{const te=new Z,Ee=new Pr().setFromUnitVectors(e.up,new Z(0,1,0)),be=Ee.clone().invert(),De=new Z,Qe=new Pr,lt=2*Math.PI;return function(){const ue=r.object.position;te.copy(ue).sub(r.target),te.applyQuaternion(Ee),c.setFromVector3(te),r.autoRotate&&l===a.NONE&&z(D()),r.enableDamping?(c.theta+=f.theta*r.dampingFactor,c.phi+=f.phi*r.dampingFactor):(c.theta+=f.theta,c.phi+=f.phi);let ce=r.minAzimuthAngle,Ue=r.maxAzimuthAngle;return isFinite(ce)&&isFinite(Ue)&&(ce<-Math.PI?ce+=lt:ce>Math.PI&&(ce-=lt),Ue<-Math.PI?Ue+=lt:Ue>Math.PI&&(Ue-=lt),ce<=Ue?c.theta=Math.max(ce,Math.min(Ue,c.theta)):c.theta=c.theta>(ce+Ue)/2?Math.max(ce,c.theta):Math.min(Ue,c.theta)),c.phi=Math.max(r.minPolarAngle,Math.min(r.maxPolarAngle,c.phi)),c.makeSafe(),c.radius*=p,c.radius=Math.max(r.minDistance,Math.min(r.maxDistance,c.radius)),r.enableDamping===!0?r.target.addScaledVector(m,r.dampingFactor):r.target.add(m),te.setFromSpherical(c),te.applyQuaternion(be),ue.copy(r.target).add(te),r.object.lookAt(r.target),r.enableDamping===!0?(f.theta*=1-r.dampingFactor,f.phi*=1-r.dampingFactor,m.multiplyScalar(1-r.dampingFactor)):(f.set(0,0,0),m.set(0,0,0)),p=1,g||De.distanceToSquared(r.object.position)>u||8*(1-Qe.dot(r.object.quaternion))>u?(r.dispatchEvent(i),De.copy(r.object.position),Qe.copy(r.object.quaternion),g=!1,!0):!1}})(),this.connect=te=>{te===document&&console.error('THREE.OrbitControls: "document" should not be used as the target "domElement". Please use "renderer.domElement" instead.'),r.domElement=te,r.domElement.style.touchAction="none",r.domElement.addEventListener("contextmenu",Je),r.domElement.addEventListener("pointerdown",We),r.domElement.addEventListener("pointercancel",He),r.domElement.addEventListener("wheel",O)},this.dispose=()=>{var te,Ee,be,De,Qe,lt;(te=r.domElement)==null||te.removeEventListener("contextmenu",Je),(Ee=r.domElement)==null||Ee.removeEventListener("pointerdown",We),(be=r.domElement)==null||be.removeEventListener("pointercancel",He),(De=r.domElement)==null||De.removeEventListener("wheel",O),(Qe=r.domElement)==null||Qe.ownerDocument.removeEventListener("pointermove",Ce),(lt=r.domElement)==null||lt.ownerDocument.removeEventListener("pointerup",je),r._domElementKeyEvents!==null&&r._domElementKeyEvents.removeEventListener("keydown",le)};const r=this,i={type:"change"},s={type:"start"},o={type:"end"},a={NONE:-1,ROTATE:0,DOLLY:1,PAN:2,TOUCH_ROTATE:3,TOUCH_PAN:4,TOUCH_DOLLY_PAN:5,TOUCH_DOLLY_ROTATE:6};let l=a.NONE;const u=1e-6,c=new AS,f=new AS;let p=1;const m=new Z;let g=!1;const v=new ze,y=new ze,w=new ze,_=new ze,x=new ze,A=new ze,C=new ze,b=new ze,R=new ze,E=[],B={};function D(){return 2*Math.PI/60/60*r.autoRotateSpeed}function U(){return Math.pow(.95,r.zoomSpeed)}function z(te){r.reverseOrbit?f.theta+=te:f.theta-=te}function Y(te){r.reverseOrbit?f.phi+=te:f.phi-=te}const P=(()=>{const te=new Z;return function(be,De){te.setFromMatrixColumn(De,0),te.multiplyScalar(-be),m.add(te)}})(),F=(()=>{const te=new Z;return function(be,De){r.screenSpacePanning===!0?te.setFromMatrixColumn(De,1):(te.setFromMatrixColumn(De,0),te.crossVectors(r.object.up,te)),te.multiplyScalar(be),m.add(te)}})(),G=(()=>{const te=new Z;return function(be,De){const Qe=r.domElement;if(Qe&&r.object instanceof Qn&&r.object.isPerspectiveCamera){const lt=r.object.position;te.copy(lt).sub(r.target);let yt=te.length();yt*=Math.tan(r.object.fov/2*Math.PI/180),P(2*be*yt/Qe.clientHeight,r.object.matrix),F(2*De*yt/Qe.clientHeight,r.object.matrix)}else Qe&&r.object instanceof oa&&r.object.isOrthographicCamera?(P(be*(r.object.right-r.object.left)/r.object.zoom/Qe.clientWidth,r.object.matrix),F(De*(r.object.top-r.object.bottom)/r.object.zoom/Qe.clientHeight,r.object.matrix)):(console.warn("WARNING: OrbitControls.js encountered an unknown camera type - pan disabled."),r.enablePan=!1)}})();function ie(te){r.object instanceof Qn&&r.object.isPerspectiveCamera?p/=te:r.object instanceof oa&&r.object.isOrthographicCamera?(r.object.zoom=Math.max(r.minZoom,Math.min(r.maxZoom,r.object.zoom*te)),r.object.updateProjectionMatrix(),g=!0):(console.warn("WARNING: OrbitControls.js encountered an unknown camera type - dolly/zoom disabled."),r.enableZoom=!1)}function N(te){r.object instanceof Qn&&r.object.isPerspectiveCamera?p*=te:r.object instanceof oa&&r.object.isOrthographicCamera?(r.object.zoom=Math.max(r.minZoom,Math.min(r.maxZoom,r.object.zoom/te)),r.object.updateProjectionMatrix(),g=!0):(console.warn("WARNING: OrbitControls.js encountered an unknown camera type - dolly/zoom disabled."),r.enableZoom=!1)}function V(te){v.set(te.clientX,te.clientY)}function j(te){C.set(te.clientX,te.clientY)}function W(te){_.set(te.clientX,te.clientY)}function k(te){y.set(te.clientX,te.clientY),w.subVectors(y,v).multiplyScalar(r.rotateSpeed);const Ee=r.domElement;Ee&&(z(2*Math.PI*w.x/Ee.clientHeight),Y(2*Math.PI*w.y/Ee.clientHeight)),v.copy(y),r.update()}function Q(te){b.set(te.clientX,te.clientY),R.subVectors(b,C),R.y>0?ie(U()):R.y<0&&N(U()),C.copy(b),r.update()}function q(te){x.set(te.clientX,te.clientY),A.subVectors(x,_).multiplyScalar(r.panSpeed),G(A.x,A.y),_.copy(x),r.update()}function X(te){te.deltaY<0?N(U()):te.deltaY>0&&ie(U()),r.update()}function J(te){let Ee=!1;switch(te.code){case r.keys.UP:G(0,r.keyPanSpeed),Ee=!0;break;case r.keys.BOTTOM:G(0,-r.keyPanSpeed),Ee=!0;break;case r.keys.LEFT:G(r.keyPanSpeed,0),Ee=!0;break;case r.keys.RIGHT:G(-r.keyPanSpeed,0),Ee=!0;break}Ee&&(te.preventDefault(),r.update())}function ae(){if(E.length==1)v.set(E[0].pageX,E[0].pageY);else{const te=.5*(E[0].pageX+E[1].pageX),Ee=.5*(E[0].pageY+E[1].pageY);v.set(te,Ee)}}function re(){if(E.length==1)_.set(E[0].pageX,E[0].pageY);else{const te=.5*(E[0].pageX+E[1].pageX),Ee=.5*(E[0].pageY+E[1].pageY);_.set(te,Ee)}}function me(){const te=E[0].pageX-E[1].pageX,Ee=E[0].pageY-E[1].pageY,be=Math.sqrt(te*te+Ee*Ee);C.set(0,be)}function Me(){r.enableZoom&&me(),r.enablePan&&re()}function Se(){r.enableZoom&&me(),r.enableRotate&&ae()}function se(te){if(E.length==1)y.set(te.pageX,te.pageY);else{const be=nt(te),De=.5*(te.pageX+be.x),Qe=.5*(te.pageY+be.y);y.set(De,Qe)}w.subVectors(y,v).multiplyScalar(r.rotateSpeed);const Ee=r.domElement;Ee&&(z(2*Math.PI*w.x/Ee.clientHeight),Y(2*Math.PI*w.y/Ee.clientHeight)),v.copy(y)}function ye(te){if(E.length==1)x.set(te.pageX,te.pageY);else{const Ee=nt(te),be=.5*(te.pageX+Ee.x),De=.5*(te.pageY+Ee.y);x.set(be,De)}A.subVectors(x,_).multiplyScalar(r.panSpeed),G(A.x,A.y),_.copy(x)}function ke(te){const Ee=nt(te),be=te.pageX-Ee.x,De=te.pageY-Ee.y,Qe=Math.sqrt(be*be+De*De);b.set(0,Qe),R.set(0,Math.pow(b.y/C.y,r.zoomSpeed)),ie(R.y),C.copy(b)}function Te(te){r.enableZoom&&ke(te),r.enablePan&&ye(te)}function Pe(te){r.enableZoom&&ke(te),r.enableRotate&&se(te)}function We(te){var Ee,be;r.enabled!==!1&&(E.length===0&&((Ee=r.domElement)==null||Ee.ownerDocument.addEventListener("pointermove",Ce),(be=r.domElement)==null||be.ownerDocument.addEventListener("pointerup",je)),Ve(te),te.pointerType==="touch"?_e(te):Ie(te))}function Ce(te){r.enabled!==!1&&(te.pointerType==="touch"?Ge(te):K(te))}function je(te){var Ee,be,De;Ye(te),E.length===0&&((Ee=r.domElement)==null||Ee.releasePointerCapture(te.pointerId),(be=r.domElement)==null||be.ownerDocument.removeEventListener("pointermove",Ce),(De=r.domElement)==null||De.ownerDocument.removeEventListener("pointerup",je)),r.dispatchEvent(o),l=a.NONE}function He(te){Ye(te)}function Ie(te){let Ee;switch(te.button){case 0:Ee=r.mouseButtons.LEFT;break;case 1:Ee=r.mouseButtons.MIDDLE;break;case 2:Ee=r.mouseButtons.RIGHT;break;default:Ee=-1}switch(Ee){case Ql.DOLLY:if(r.enableZoom===!1)return;j(te),l=a.DOLLY;break;case Ql.ROTATE:if(te.ctrlKey||te.metaKey||te.shiftKey){if(r.enablePan===!1)return;W(te),l=a.PAN}else{if(r.enableRotate===!1)return;V(te),l=a.ROTATE}break;case Ql.PAN:if(te.ctrlKey||te.metaKey||te.shiftKey){if(r.enableRotate===!1)return;V(te),l=a.ROTATE}else{if(r.enablePan===!1)return;W(te),l=a.PAN}break;default:l=a.NONE}l!==a.NONE&&r.dispatchEvent(s)}function K(te){if(r.enabled!==!1)switch(l){case a.ROTATE:if(r.enableRotate===!1)return;k(te);break;case a.DOLLY:if(r.enableZoom===!1)return;Q(te);break;case a.PAN:if(r.enablePan===!1)return;q(te);break}}function O(te){r.enabled===!1||r.enableZoom===!1||l!==a.NONE&&l!==a.ROTATE||(te.preventDefault(),r.dispatchEvent(s),X(te),r.dispatchEvent(o))}function le(te){r.enabled===!1||r.enablePan===!1||J(te)}function _e(te){switch(Le(te),E.length){case 1:switch(r.touches.ONE){case ql.ROTATE:if(r.enableRotate===!1)return;ae(),l=a.TOUCH_ROTATE;break;case ql.PAN:if(r.enablePan===!1)return;re(),l=a.TOUCH_PAN;break;default:l=a.NONE}break;case 2:switch(r.touches.TWO){case ql.DOLLY_PAN:if(r.enableZoom===!1&&r.enablePan===!1)return;Me(),l=a.TOUCH_DOLLY_PAN;break;case ql.DOLLY_ROTATE:if(r.enableZoom===!1&&r.enableRotate===!1)return;Se(),l=a.TOUCH_DOLLY_ROTATE;break;default:l=a.NONE}break;default:l=a.NONE}l!==a.NONE&&r.dispatchEvent(s)}function Ge(te){switch(Le(te),l){case a.TOUCH_ROTATE:if(r.enableRotate===!1)return;se(te),r.update();break;case a.TOUCH_PAN:if(r.enablePan===!1)return;ye(te),r.update();break;case a.TOUCH_DOLLY_PAN:if(r.enableZoom===!1&&r.enablePan===!1)return;Te(te),r.update();break;case a.TOUCH_DOLLY_ROTATE:if(r.enableZoom===!1&&r.enableRotate===!1)return;Pe(te),r.update();break;default:l=a.NONE}}function Je(te){r.enabled!==!1&&te.preventDefault()}function Ve(te){E.push(te)}function Ye(te){delete B[te.pointerId];for(let Ee=0;Ee=2.0 are supported."));return}const l=new SK(s,{path:t||this.resourcePath||"",crossOrigin:this.crossOrigin,requestHeader:this.requestHeader,manager:this.manager,ktx2Loader:this.ktx2Loader,meshoptDecoder:this.meshoptDecoder});l.fileLoader.setRequestHeader(this.requestHeader);for(let u=0;u=0&&a[c]===void 0&&console.warn('THREE.GLTFLoader: Unknown extension "'+c+'".')}}l.setExtensions(o),l.setPlugins(a),l.parse(r,i)}parseAsync(e,t){const r=this;return new Promise(function(i,s){r.parse(e,t,i,s)})}}function jY(){let n={};return{get:function(e){return n[e]},add:function(e,t){n[e]=t},remove:function(e){delete n[e]},removeAll:function(){n={}}}}const nn={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_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_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 XY{constructor(e){this.parser=e,this.name=nn.KHR_LIGHTS_PUNCTUAL,this.cache={refs:{},uses:{}}}_markDefs(){const e=this.parser,t=this.parser.json.nodes||[];for(let r=0,i=t.length;r=0)throw new Error("THREE.GLTFLoader: setKTX2Loader must be called before loading KTX2 textures");return null}return t.loadTextureImage(e,s.source,o)}}class sK{constructor(e){this.parser=e,this.name=nn.EXT_TEXTURE_WEBP,this.isSupported=null}loadTexture(e){const t=this.name,r=this.parser,i=r.json,s=i.textures[e];if(!s.extensions||!s.extensions[t])return null;const o=s.extensions[t],a=i.images[o.source];let l=r.textureLoader;if(a.uri){const u=r.options.manager.getHandler(a.uri);u!==null&&(l=u)}return this.detectSupport().then(function(u){if(u)return r.loadTextureImage(e,o.source,l);if(i.extensionsRequired&&i.extensionsRequired.indexOf(t)>=0)throw new Error("THREE.GLTFLoader: WebP required by asset but unsupported.");return r.loadTexture(e)})}detectSupport(){return this.isSupported||(this.isSupported=new Promise(function(e){const t=new Image;t.src="data:image/webp;base64,UklGRiIAAABXRUJQVlA4IBYAAAAwAQCdASoBAAEADsD+JaQAA3AAAAAA",t.onload=t.onerror=function(){e(t.height===1)}})),this.isSupported}}class oK{constructor(e){this.parser=e,this.name=nn.EXT_TEXTURE_AVIF,this.isSupported=null}loadTexture(e){const t=this.name,r=this.parser,i=r.json,s=i.textures[e];if(!s.extensions||!s.extensions[t])return null;const o=s.extensions[t],a=i.images[o.source];let l=r.textureLoader;if(a.uri){const u=r.options.manager.getHandler(a.uri);u!==null&&(l=u)}return this.detectSupport().then(function(u){if(u)return r.loadTextureImage(e,o.source,l);if(i.extensionsRequired&&i.extensionsRequired.indexOf(t)>=0)throw new Error("THREE.GLTFLoader: AVIF required by asset but unsupported.");return r.loadTexture(e)})}detectSupport(){return this.isSupported||(this.isSupported=new Promise(function(e){const t=new Image;t.src="data:image/avif;base64,AAAAIGZ0eXBhdmlmAAAAAGF2aWZtaWYxbWlhZk1BMUIAAADybWV0YQAAAAAAAAAoaGRscgAAAAAAAAAAcGljdAAAAAAAAAAAAAAAAGxpYmF2aWYAAAAADnBpdG0AAAAAAAEAAAAeaWxvYwAAAABEAAABAAEAAAABAAABGgAAABcAAAAoaWluZgAAAAAAAQAAABppbmZlAgAAAAABAABhdjAxQ29sb3IAAAAAamlwcnAAAABLaXBjbwAAABRpc3BlAAAAAAAAAAEAAAABAAAAEHBpeGkAAAAAAwgICAAAAAxhdjFDgQAMAAAAABNjb2xybmNseAACAAIABoAAAAAXaXBtYQAAAAAAAAABAAEEAQKDBAAAAB9tZGF0EgAKCBgABogQEDQgMgkQAAAAB8dSLfI=",t.onload=t.onerror=function(){e(t.height===1)}})),this.isSupported}}class aK{constructor(e){this.name=nn.EXT_MESHOPT_COMPRESSION,this.parser=e}loadBufferView(e){const t=this.parser.json,r=t.bufferViews[e];if(r.extensions&&r.extensions[this.name]){const i=r.extensions[this.name],s=this.parser.getDependency("buffer",i.buffer),o=this.parser.options.meshoptDecoder;if(!o||!o.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 s.then(function(a){const l=i.byteOffset||0,u=i.byteLength||0,c=i.count,f=i.byteStride,p=new Uint8Array(a,l,u);return o.decodeGltfBufferAsync?o.decodeGltfBufferAsync(c,f,p,i.mode,i.filter).then(function(m){return m.buffer}):o.ready.then(function(){const m=new ArrayBuffer(c*f);return o.decodeGltfBuffer(new Uint8Array(m),c,f,p,i.mode,i.filter),m})})}else return null}}class lK{constructor(e){this.name=nn.EXT_MESH_GPU_INSTANCING,this.parser=e}createNodeMesh(e){const t=this.parser.json,r=t.nodes[e];if(!r.extensions||!r.extensions[this.name]||r.mesh===void 0)return null;const i=t.meshes[r.mesh];for(const u of i.primitives)if(u.mode!==gs.TRIANGLES&&u.mode!==gs.TRIANGLE_STRIP&&u.mode!==gs.TRIANGLE_FAN&&u.mode!==void 0)return null;const o=r.extensions[this.name].attributes,a=[],l={};for(const u in o)a.push(this.parser.getDependency("accessor",o[u]).then(c=>(l[u]=c,l[u])));return a.length<1?null:(a.push(this.parser.createNodeMesh(e)),Promise.all(a).then(u=>{const c=u.pop(),f=c.isGroup?c.children:[c],p=u[0].count,m=[];for(const g of f){const v=new Lt,y=new Z,w=new Pr,_=new Z(1,1,1),x=new DM(g.geometry,g.material,p);for(let A=0;A=152?{TEXCOORD_0:"uv",TEXCOORD_1:"uv1",TEXCOORD_2:"uv2",TEXCOORD_3:"uv3"}:{TEXCOORD_0:"uv",TEXCOORD_1:"uv2"},COLOR_0:"color",WEIGHTS_0:"skinWeight",JOINTS_0:"skinIndex"},Na={scale:"scale",translation:"position",rotation:"quaternion",weights:"morphTargetInfluences"},mK={CUBICSPLINE:void 0,LINEAR:Tu,STEP:yf},Zx={OPAQUE:"OPAQUE",MASK:"MASK",BLEND:"BLEND"};function gK(n){return n.DefaultMaterial===void 0&&(n.DefaultMaterial=new zp({color:16777215,emissive:0,metalness:1,roughness:1,transparent:!1,depthTest:!0,side:Ys})),n.DefaultMaterial}function jl(n,e,t){for(const r in t.extensions)n[r]===void 0&&(e.userData.gltfExtensions=e.userData.gltfExtensions||{},e.userData.gltfExtensions[r]=t.extensions[r])}function Va(n,e){e.extras!==void 0&&(typeof e.extras=="object"?Object.assign(n.userData,e.extras):console.warn("THREE.GLTFLoader: Ignoring primitive type .extras, "+e.extras))}function vK(n,e,t){let r=!1,i=!1,s=!1;for(let u=0,c=e.length;u0||n.search(/^data\:image\/jpeg/)===0?"image/jpeg":n.search(/\.webp($|\?)/i)>0||n.search(/^data\:image\/webp/)===0?"image/webp":"image/png"}const wK=new Lt;class SK{constructor(e={},t={}){this.json=e,this.extensions={},this.plugins={},this.options=t,this.cache=new jY,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 r=!1,i=!1,s=-1;typeof navigator<"u"&&typeof navigator.userAgent<"u"&&(r=/^((?!chrome|android).)*safari/i.test(navigator.userAgent)===!0,i=navigator.userAgent.indexOf("Firefox")>-1,s=i?navigator.userAgent.match(/Firefox\/([0-9]+)\./)[1]:-1),typeof createImageBitmap>"u"||r||i&&s<98?this.textureLoader=new UD(this.options.manager):this.textureLoader=new JD(this.options.manager),this.textureLoader.setCrossOrigin(this.options.crossOrigin),this.textureLoader.setRequestHeader(this.options.requestHeader),this.fileLoader=new rs(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 r=this,i=this.json,s=this.extensions;this.cache.removeAll(),this.nodeCache={},this._invokeAll(function(o){return o._markDefs&&o._markDefs()}),Promise.all(this._invokeAll(function(o){return o.beforeRoot&&o.beforeRoot()})).then(function(){return Promise.all([r.getDependencies("scene"),r.getDependencies("animation"),r.getDependencies("camera")])}).then(function(o){const a={scene:o[0][i.scene||0],scenes:o[0],animations:o[1],cameras:o[2],asset:i.asset,parser:r,userData:{}};jl(s,a,i),Va(a,i),Promise.all(r._invokeAll(function(l){return l.afterRoot&&l.afterRoot(a)})).then(function(){e(a)})}).catch(t)}_markDefs(){const e=this.json.nodes||[],t=this.json.skins||[],r=this.json.meshes||[];for(let i=0,s=t.length;i{const l=this.associations.get(o);l!=null&&this.associations.set(a,l);for(const[u,c]of o.children.entries())s(c,a.children[u])};return s(r,i),i.name+="_instance_"+e.uses[t]++,i}_invokeOne(e){const t=Object.values(this.plugins);t.push(this);for(let r=0;r=2&&y.setY(B,b[R*l+1]),l>=3&&y.setZ(B,b[R*l+2]),l>=4&&y.setW(B,b[R*l+3]),l>=5)throw new Error("THREE.GLTFLoader: Unsupported itemSize in sparse BufferAttribute.")}}return y})}loadTexture(e){const t=this.json,r=this.options,s=t.textures[e].source,o=t.images[s];let a=this.textureLoader;if(o.uri){const l=r.manager.getHandler(o.uri);l!==null&&(a=l)}return this.loadTextureImage(e,s,a)}loadTextureImage(e,t,r){const i=this,s=this.json,o=s.textures[e],a=s.images[t],l=(a.uri||a.bufferView)+":"+o.sampler;if(this.textureCache[l])return this.textureCache[l];const u=this.loadImageSource(t,r).then(function(c){c.flipY=!1,c.name=o.name||a.name||"",c.name===""&&typeof a.uri=="string"&&a.uri.startsWith("data:image/")===!1&&(c.name=a.uri);const p=(s.samplers||{})[o.sampler]||{};return c.magFilter=Q3[p.magFilter]||gn,c.minFilter=Q3[p.minFilter]||Ao,c.wrapS=q3[p.wrapS]||dl,c.wrapT=q3[p.wrapT]||dl,i.associations.set(c,{textures:e}),c}).catch(function(){return null});return this.textureCache[l]=u,u}loadImageSource(e,t){const r=this,i=this.json,s=this.options;if(this.sourceCache[e]!==void 0)return this.sourceCache[e].then(f=>f.clone());const o=i.images[e],a=self.URL||self.webkitURL;let l=o.uri||"",u=!1;if(o.bufferView!==void 0)l=r.getDependency("bufferView",o.bufferView).then(function(f){u=!0;const p=new Blob([f],{type:o.mimeType});return l=a.createObjectURL(p),l});else if(o.uri===void 0)throw new Error("THREE.GLTFLoader: Image "+e+" is missing URI and bufferView");const c=Promise.resolve(l).then(function(f){return new Promise(function(p,m){let g=p;t.isImageBitmapLoader===!0&&(g=function(v){const y=new Rn(v);y.needsUpdate=!0,p(y)}),t.load(wo.resolveURL(f,s.path),g,void 0,m)})}).then(function(f){return u===!0&&a.revokeObjectURL(l),f.userData.mimeType=o.mimeType||_K(o.uri),f}).catch(function(f){throw console.error("THREE.GLTFLoader: Couldn't load texture",l),f});return this.sourceCache[e]=c,c}assignTexture(e,t,r,i){const s=this;return this.getDependency("texture",r.index).then(function(o){if(!o)return null;if(r.texCoord!==void 0&&r.texCoord>0&&(o=o.clone(),o.channel=r.texCoord),s.extensions[nn.KHR_TEXTURE_TRANSFORM]){const a=r.extensions!==void 0?r.extensions[nn.KHR_TEXTURE_TRANSFORM]:void 0;if(a){const l=s.associations.get(o);o=s.extensions[nn.KHR_TEXTURE_TRANSFORM].extendTexture(o,a),s.associations.set(o,l)}}return i!==void 0&&("colorSpace"in o?o.colorSpace=i===3001?"srgb":"srgb-linear":o.encoding=i),e[t]=o,o})}assignFinalMaterial(e){const t=e.geometry;let r=e.material;const i=t.attributes.tangent===void 0,s=t.attributes.color!==void 0,o=t.attributes.normal===void 0;if(e.isPoints){const a="PointsMaterial:"+r.uuid;let l=this.cache.get(a);l||(l=new My,fr.prototype.copy.call(l,r),l.color.copy(r.color),l.map=r.map,l.sizeAttenuation=!1,this.cache.add(a,l)),r=l}else if(e.isLine){const a="LineBasicMaterial:"+r.uuid;let l=this.cache.get(a);l||(l=new ii,fr.prototype.copy.call(l,r),l.color.copy(r.color),l.map=r.map,this.cache.add(a,l)),r=l}if(i||s||o){let a="ClonedMaterial:"+r.uuid+":";i&&(a+="derivative-tangents:"),s&&(a+="vertex-colors:"),o&&(a+="flat-shading:");let l=this.cache.get(a);l||(l=r.clone(),s&&(l.vertexColors=!0),o&&(l.flatShading=!0),i&&(l.normalScale&&(l.normalScale.y*=-1),l.clearcoatNormalScale&&(l.clearcoatNormalScale.y*=-1)),this.cache.add(a,l),this.associations.set(l,this.associations.get(r))),r=l}e.material=r}getMaterialType(){return zp}loadMaterial(e){const t=this,r=this.json,i=this.extensions,s=r.materials[e];let o;const a={},l=s.extensions||{},u=[];if(l[nn.KHR_MATERIALS_UNLIT]){const f=i[nn.KHR_MATERIALS_UNLIT];o=f.getMaterialType(),u.push(f.extendParams(a,s,t))}else{const f=s.pbrMetallicRoughness||{};if(a.color=new st(1,1,1),a.opacity=1,Array.isArray(f.baseColorFactor)){const p=f.baseColorFactor;a.color.fromArray(p),a.opacity=p[3]}f.baseColorTexture!==void 0&&u.push(t.assignTexture(a,"map",f.baseColorTexture,3001)),a.metalness=f.metallicFactor!==void 0?f.metallicFactor:1,a.roughness=f.roughnessFactor!==void 0?f.roughnessFactor:1,f.metallicRoughnessTexture!==void 0&&(u.push(t.assignTexture(a,"metalnessMap",f.metallicRoughnessTexture)),u.push(t.assignTexture(a,"roughnessMap",f.metallicRoughnessTexture))),o=this._invokeOne(function(p){return p.getMaterialType&&p.getMaterialType(e)}),u.push(Promise.all(this._invokeAll(function(p){return p.extendMaterialParams&&p.extendMaterialParams(e,a)})))}s.doubleSided===!0&&(a.side=$i);const c=s.alphaMode||Zx.OPAQUE;if(c===Zx.BLEND?(a.transparent=!0,a.depthWrite=!1):(a.transparent=!1,c===Zx.MASK&&(a.alphaTest=s.alphaCutoff!==void 0?s.alphaCutoff:.5)),s.normalTexture!==void 0&&o!==Ii&&(u.push(t.assignTexture(a,"normalMap",s.normalTexture)),a.normalScale=new ze(1,1),s.normalTexture.scale!==void 0)){const f=s.normalTexture.scale;a.normalScale.set(f,f)}return s.occlusionTexture!==void 0&&o!==Ii&&(u.push(t.assignTexture(a,"aoMap",s.occlusionTexture)),s.occlusionTexture.strength!==void 0&&(a.aoMapIntensity=s.occlusionTexture.strength)),s.emissiveFactor!==void 0&&o!==Ii&&(a.emissive=new st().fromArray(s.emissiveFactor)),s.emissiveTexture!==void 0&&o!==Ii&&u.push(t.assignTexture(a,"emissiveMap",s.emissiveTexture,3001)),Promise.all(u).then(function(){const f=new o(a);return s.name&&(f.name=s.name),Va(f,s),t.associations.set(f,{materials:e}),s.extensions&&jl(i,f,s),f})}createUniqueName(e){const t=ln.sanitizeNodeName(e||"");return t in this.nodeNamesUsed?t+"_"+ ++this.nodeNamesUsed[t]:(this.nodeNamesUsed[t]=0,t)}loadGeometries(e){const t=this,r=this.extensions,i=this.primitiveCache;function s(a){return r[nn.KHR_DRACO_MESH_COMPRESSION].decodePrimitive(a,t).then(function(l){return $3(l,a,t)})}const o=[];for(let a=0,l=e.length;a0&&yK(w,s),w.name=t.createUniqueName(s.name||"mesh_"+e),Va(w,s),y.extensions&&jl(i,w,y),t.assignFinalMaterial(w),f.push(w)}for(let m=0,g=f.length;m1?c=new ra:u.length===1?c=u[0]:c=new sn,c!==u[0])for(let f=0,p=u.length;f{const f=new Map;for(const[p,m]of i.associations)(p instanceof fr||p instanceof Rn)&&f.set(p,m);return c.traverse(p=>{const m=i.associations.get(p);m!=null&&f.set(p,m)}),f};return i.associations=u(s),s})}}function AK(n,e,t){const r=e.attributes,i=new Zs;if(r.POSITION!==void 0){const a=t.json.accessors[r.POSITION],l=a.min,u=a.max;if(l!==void 0&&u!==void 0){if(i.set(new Z(l[0],l[1],l[2]),new Z(u[0],u[1],u[2])),a.normalized){const c=PS(ef[a.componentType]);i.min.multiplyScalar(c),i.max.multiplyScalar(c)}}else{console.warn("THREE.GLTFLoader: Missing min/max properties for accessor POSITION.");return}}else return;const s=e.targets;if(s!==void 0){const a=new Z,l=new Z;for(let u=0,c=s.length;u(E=U.indexOf(f))&&B=x.byteLength||!(D=p(x)))return a(1,"no header found");if(!(U=D.match(A)))return a(3,"bad initial token");for(B.valid|=1,B.programtype=U[1],B.string+=D+` -`;D=p(x),D!==!1;){if(B.string+=D+` -`,D.charAt(0)==="#"){B.comments+=D+` -`;continue}if((U=D.match(C))&&(B.gamma=parseFloat(U[1])),(U=D.match(b))&&(B.exposure=parseFloat(U[1])),(U=D.match(R))&&(B.valid|=2,B.format=U[1]),(U=D.match(E))&&(B.valid|=4,B.height=parseInt(U[1],10),B.width=parseInt(U[2],10)),B.valid&2&&B.valid&4)break}return B.valid&2?B.valid&4?B:a(3,"missing image size specifier"):a(3,"missing format specifier")},g=function(x,A,C){const b=A;if(b<8||b>32767||x[0]!==2||x[1]!==2||x[2]&128)return new Uint8Array(x);if(b!==(x[2]<<8|x[3]))return a(3,"wrong scanline width");const R=new Uint8Array(4*A*C);if(!R.length)return a(4,"unable to allocate buffer space");let E=0,B=0;const D=4*b,U=new Uint8Array(4),z=new Uint8Array(D);let Y=C;for(;Y>0&&Bx.byteLength)return a(1);if(U[0]=x[B++],U[1]=x[B++],U[2]=x[B++],U[3]=x[B++],U[0]!=2||U[1]!=2||(U[2]<<8|U[3])!=b)return a(3,"bad rgbe scanline format");let P=0,F;for(;P128;if(ie&&(F-=128),F===0||P+F>D)return a(3,"bad scanline data");if(ie){const N=x[B++];for(let V=0;V>3]&1<<(pe&7))&&(H[oe++]=pe);for(var xe=oe-1;oe<65536;)H[oe++]=0;return xe}function U(L){for(var H=0;H<16384;H++)L[H]={},L[H].len=0,L[H].lit=0,L[H].p=null}const z={l:0,c:0,lc:0};function Y(L,H,oe,pe,xe){for(;oe>oe&(1<0;--H){var pe=oe+P[H]>>1;P[H]=oe,oe=pe}for(var H=0;H<65537;++H){var xe=L[H];xe>0&&(L[H]=xe|P[xe]++<<6)}}function G(L,H,oe,pe,xe,we,Ke){for(var Xe=oe,qe=0,$e=0;xe<=we;xe++){if(Xe.value-oe.value>pe)return!1;Y(6,qe,$e,L,Xe);var Ze=z.l;if(qe=z.c,$e=z.lc,Ke[xe]=Ze,Ze==63){if(Xe.value-oe.value>pe)throw"Something wrong with hufUnpackEncTable";Y(8,qe,$e,L,Xe);var ge=z.l+6;if(qe=z.c,$e=z.lc,xe+ge>we+1)throw"Something wrong with hufUnpackEncTable";for(;ge--;)Ke[xe++]=0;xe--}else if(Ze>=59){var ge=Ze-59+2;if(xe+ge>we+1)throw"Something wrong with hufUnpackEncTable";for(;ge--;)Ke[xe++]=0;xe--}}F(Ke)}function ie(L){return L&63}function N(L){return L>>6}function V(L,H,oe,pe){for(;H<=oe;H++){var xe=N(L[H]),we=ie(L[H]);if(xe>>we)throw"Invalid table entry";if(we>14){var Ke=pe[xe>>we-14];if(Ke.len)throw"Invalid table entry";if(Ke.lit++,Ke.p){var Xe=Ke.p;Ke.p=new Array(Ke.lit);for(var qe=0;qe0;qe--){var Ke=pe[(xe<<14-we)+$e];if(Ke.len||Ke.p)throw"Invalid table entry";Ke.len=we,Ke.lit=H,$e++}}return!0}const j={c:0,lc:0};function W(L,H,oe,pe){L=L<<8|De(oe,pe),H+=8,j.c=L,j.lc=H}const k={c:0,lc:0};function Q(L,H,oe,pe,xe,we,Ke,Xe,qe,$e){if(L==H){pe<8&&(W(oe,pe,xe,Ke),oe=j.c,pe=j.lc),pe-=8;var Ze=oe>>pe,Ze=new Uint8Array([Ze])[0];if(qe.value+Ze>$e)return!1;for(var ge=Xe[qe.value-1];Ze-- >0;)Xe[qe.value++]=ge}else if(qe.value<$e)Xe[qe.value++]=L;else return!1;k.c=oe,k.lc=pe}function q(L){return L&65535}function X(L){var H=q(L);return H>32767?H-65536:H}const J={a:0,b:0};function ae(L,H){var oe=X(L),pe=X(H),xe=pe,we=oe+(xe&1)+(xe>>1),Ke=we,Xe=we-xe;J.a=Ke,J.b=Xe}function re(L,H){var oe=q(L),pe=q(H),xe=oe-(pe>>1)&65535,we=pe+xe-32768&65535;J.a=we,J.b=xe}function me(L,H,oe,pe,xe,we,Ke){for(var Xe=Ke<16384,qe=oe>xe?xe:oe,$e=1,Ze;$e<=qe;)$e<<=1;for($e>>=1,Ze=$e,$e>>=1;$e>=1;){for(var ge=0,Wt=ge+we*(xe-Ze),it=we*$e,ht=we*Ze,It=pe*$e,Tt=pe*Ze,kt,At,Mt,Pt;ge<=Wt;ge+=ht){for(var Rt=ge,$t=ge+pe*(oe-Ze);Rt<=$t;Rt+=Tt){var Dt=Rt+It,en=Rt+it,sr=en+It;Xe?(ae(L[Rt+H],L[en+H]),kt=J.a,Mt=J.b,ae(L[Dt+H],L[sr+H]),At=J.a,Pt=J.b,ae(kt,At),L[Rt+H]=J.a,L[Dt+H]=J.b,ae(Mt,Pt),L[en+H]=J.a,L[sr+H]=J.b):(re(L[Rt+H],L[en+H]),kt=J.a,Mt=J.b,re(L[Dt+H],L[sr+H]),At=J.a,Pt=J.b,re(kt,At),L[Rt+H]=J.a,L[Dt+H]=J.b,re(Mt,Pt),L[en+H]=J.a,L[sr+H]=J.b)}if(oe&$e){var en=Rt+it;Xe?ae(L[Rt+H],L[en+H]):re(L[Rt+H],L[en+H]),kt=J.a,L[en+H]=J.b,L[Rt+H]=kt}}if(xe&$e)for(var Rt=ge,$t=ge+pe*(oe-Ze);Rt<=$t;Rt+=Tt){var Dt=Rt+It;Xe?ae(L[Rt+H],L[Dt+H]):re(L[Rt+H],L[Dt+H]),kt=J.a,L[Dt+H]=J.b,L[Rt+H]=kt}Ze=$e,$e>>=1}return ge}function Me(L,H,oe,pe,xe,we,Ke,Xe,qe,$e){for(var Ze=0,ge=0,Wt=Xe,it=Math.trunc(xe.value+(we+7)/8);xe.value=14;){var ht=Ze>>ge-14&16383,It=H[ht];if(It.len)ge-=It.len,Q(It.lit,Ke,Ze,ge,oe,pe,xe,qe,$e,Wt),Ze=k.c,ge=k.lc;else{if(!It.p)throw"hufDecode issues";var Tt;for(Tt=0;Tt=kt&&N(L[It.p[Tt]])==(Ze>>ge-kt&(1<>=At,ge-=At;ge>0;){var It=H[Ze<<14-ge&16383];if(It.len)ge-=It.len,Q(It.lit,Ke,Ze,ge,oe,pe,xe,qe,$e,Wt),Ze=k.c,ge=k.lc;else throw"hufDecode issues"}return!0}function Se(L,H,oe,pe,xe,we){var Ke={value:0},Xe=oe.value,qe=be(H,oe),$e=be(H,oe);oe.value+=4;var Ze=be(H,oe);if(oe.value+=4,qe<0||qe>=65537||$e<0||$e>=65537)throw"Something wrong with HUF_ENCSIZE";var ge=new Array(65537),Wt=new Array(16384);U(Wt);var it=pe-(oe.value-Xe);if(G(L,H,oe,it,qe,$e,ge),Ze>8*(pe-(oe.value-Xe)))throw"Something wrong with hufUncompress";V(ge,qe,$e,Wt),Me(ge,Wt,L,H,oe,Ze,$e,we,xe,Ke)}function se(L,H,oe){for(var pe=0;pewe||(H[xe++]=L[oe++],xe>we));)H[xe++]=L[pe++]}function Te(L){for(var H=L.byteLength,oe=new Array,pe=0,xe=new DataView(L);H>0;){var we=xe.getInt8(pe++);if(we<0){var Ke=-we;H-=Ke+1;for(var Xe=0;Xe>8==255?xe+=pe&255:(oe[xe]=pe,xe++),L.value++}function Ce(L,H){H[0]=ce(L[0]),H[1]=ce(L[1]),H[2]=ce(L[5]),H[3]=ce(L[6]),H[4]=ce(L[14]),H[5]=ce(L[15]),H[6]=ce(L[27]),H[7]=ce(L[28]),H[8]=ce(L[2]),H[9]=ce(L[4]),H[10]=ce(L[7]),H[11]=ce(L[13]),H[12]=ce(L[16]),H[13]=ce(L[26]),H[14]=ce(L[29]),H[15]=ce(L[42]),H[16]=ce(L[3]),H[17]=ce(L[8]),H[18]=ce(L[12]),H[19]=ce(L[17]),H[20]=ce(L[25]),H[21]=ce(L[30]),H[22]=ce(L[41]),H[23]=ce(L[43]),H[24]=ce(L[9]),H[25]=ce(L[11]),H[26]=ce(L[18]),H[27]=ce(L[24]),H[28]=ce(L[31]),H[29]=ce(L[40]),H[30]=ce(L[44]),H[31]=ce(L[53]),H[32]=ce(L[10]),H[33]=ce(L[19]),H[34]=ce(L[23]),H[35]=ce(L[32]),H[36]=ce(L[39]),H[37]=ce(L[45]),H[38]=ce(L[52]),H[39]=ce(L[54]),H[40]=ce(L[20]),H[41]=ce(L[22]),H[42]=ce(L[33]),H[43]=ce(L[38]),H[44]=ce(L[46]),H[45]=ce(L[51]),H[46]=ce(L[55]),H[47]=ce(L[60]),H[48]=ce(L[21]),H[49]=ce(L[34]),H[50]=ce(L[37]),H[51]=ce(L[47]),H[52]=ce(L[50]),H[53]=ce(L[56]),H[54]=ce(L[59]),H[55]=ce(L[61]),H[56]=ce(L[35]),H[57]=ce(L[36]),H[58]=ce(L[48]),H[59]=ce(L[49]),H[60]=ce(L[57]),H[61]=ce(L[58]),H[62]=ce(L[62]),H[63]=ce(L[63])}function je(L){const H=.5*Math.cos(.7853975),oe=.5*Math.cos(3.14159/16),pe=.5*Math.cos(3.14159/8),xe=.5*Math.cos(3*3.14159/16),we=.5*Math.cos(5*3.14159/16),Ke=.5*Math.cos(3*3.14159/8),Xe=.5*Math.cos(7*3.14159/16);for(var qe=new Array(4),$e=new Array(4),Ze=new Array(4),ge=new Array(4),Wt=0;Wt<8;++Wt){var it=Wt*8;qe[0]=pe*L[it+2],qe[1]=Ke*L[it+2],qe[2]=pe*L[it+6],qe[3]=Ke*L[it+6],$e[0]=oe*L[it+1]+xe*L[it+3]+we*L[it+5]+Xe*L[it+7],$e[1]=xe*L[it+1]-Xe*L[it+3]-oe*L[it+5]-we*L[it+7],$e[2]=we*L[it+1]-oe*L[it+3]+Xe*L[it+5]+xe*L[it+7],$e[3]=Xe*L[it+1]-we*L[it+3]+xe*L[it+5]-oe*L[it+7],Ze[0]=H*(L[it+0]+L[it+4]),Ze[3]=H*(L[it+0]-L[it+4]),Ze[1]=qe[0]+qe[3],Ze[2]=qe[1]-qe[2],ge[0]=Ze[0]+Ze[1],ge[1]=Ze[3]+Ze[2],ge[2]=Ze[3]-Ze[2],ge[3]=Ze[0]-Ze[1],L[it+0]=ge[0]+$e[0],L[it+1]=ge[1]+$e[1],L[it+2]=ge[2]+$e[2],L[it+3]=ge[3]+$e[3],L[it+4]=ge[3]-$e[3],L[it+5]=ge[2]-$e[2],L[it+6]=ge[1]-$e[1],L[it+7]=ge[0]-$e[0]}for(var ht=0;ht<8;++ht)qe[0]=pe*L[16+ht],qe[1]=Ke*L[16+ht],qe[2]=pe*L[48+ht],qe[3]=Ke*L[48+ht],$e[0]=oe*L[8+ht]+xe*L[24+ht]+we*L[40+ht]+Xe*L[56+ht],$e[1]=xe*L[8+ht]-Xe*L[24+ht]-oe*L[40+ht]-we*L[56+ht],$e[2]=we*L[8+ht]-oe*L[24+ht]+Xe*L[40+ht]+xe*L[56+ht],$e[3]=Xe*L[8+ht]-we*L[24+ht]+xe*L[40+ht]-oe*L[56+ht],Ze[0]=H*(L[ht]+L[32+ht]),Ze[3]=H*(L[ht]-L[32+ht]),Ze[1]=qe[0]+qe[3],Ze[2]=qe[1]-qe[2],ge[0]=Ze[0]+Ze[1],ge[1]=Ze[3]+Ze[2],ge[2]=Ze[3]-Ze[2],ge[3]=Ze[0]-Ze[1],L[0+ht]=ge[0]+$e[0],L[8+ht]=ge[1]+$e[1],L[16+ht]=ge[2]+$e[2],L[24+ht]=ge[3]+$e[3],L[32+ht]=ge[3]-$e[3],L[40+ht]=ge[2]-$e[2],L[48+ht]=ge[1]-$e[1],L[56+ht]=ge[0]-$e[0]}function He(L){for(var H=0;H<64;++H){var oe=L[0][H],pe=L[1][H],xe=L[2][H];L[0][H]=oe+1.5747*xe,L[1][H]=oe-.1873*pe-.4682*xe,L[2][H]=oe+1.8556*pe}}function Ie(L,H,oe){for(var pe=0;pe<64;++pe)H[oe+pe]=cu.toHalfFloat(K(L[pe]))}function K(L){return L<=1?Math.sign(L)*Math.pow(Math.abs(L),2.2):Math.sign(L)*Math.pow(B,Math.abs(L)-1)}function O(L){return new DataView(L.array.buffer,L.offset.value,L.size)}function le(L){var H=L.viewer.buffer.slice(L.offset.value,L.offset.value+L.size),oe=new Uint8Array(Te(H)),pe=new Uint8Array(oe.length);return ye(oe),ke(oe,pe),new DataView(pe.buffer)}function _e(L){var H=L.array.slice(L.offset.value,L.offset.value+L.size),oe=Xg(H),pe=new Uint8Array(oe.length);return ye(oe),ke(oe,pe),new DataView(pe.buffer)}function Ge(L){for(var H=L.viewer,oe={value:L.offset.value},pe=new Uint16Array(L.width*L.scanlineBlockSize*(L.channels*L.type)),xe=new Uint8Array(8192),we=0,Ke=new Array(L.channels),Xe=0;Xe=8192)throw"Something is wrong with PIZ_COMPRESSION BITMAP_SIZE";if(qe<=$e)for(var Xe=0;Xe<$e-qe+1;Xe++)xe[Xe+qe]=Qe(H,oe);var Ze=new Uint16Array(65536),ge=D(xe,Ze),Wt=be(H,oe);Se(L.array,H,oe,Wt,pe,we);for(var Xe=0;Xe0;){var Xe=Ye(H.buffer,oe),qe=Qe(H,oe),$e=qe>>2&3,Ze=(qe>>4)-1,ge=new Int8Array([Ze])[0],Wt=Qe(H,oe);we.push({name:Xe,index:ge,type:Wt,compression:$e}),Ke-=Xe.length+3}for(var it=Be.channels,ht=new Array(L.channels),It=0;It=0&&(At.idx[Pt.index]=Mt),Tt.offset=Mt)}if(xe.acCompressedSize>0)switch(xe.acCompression){case 0:var Dt=new Uint16Array(xe.totalAcUncompressedCount);Se(L.array,H,oe,xe.acCompressedSize,Dt,xe.totalAcUncompressedCount);break;case 1:var Rt=L.array.slice(oe.value,oe.value+xe.totalAcUncompressedCount),$t=Xg(Rt),Dt=new Uint16Array($t.buffer);oe.value+=xe.totalAcUncompressedCount;break}if(xe.dcCompressedSize>0){var en={array:L.array,offset:oe,size:xe.dcCompressedSize},sr=new Uint16Array(_e(en).buffer);oe.value+=xe.dcCompressedSize}if(xe.rleRawSize>0){var Rt=L.array.slice(oe.value,oe.value+xe.rleCompressedSize),$t=Xg(Rt),Sn=Te($t.buffer);oe.value+=xe.rleCompressedSize}for(var $n=0,on=new Array(ht.length),It=0;It>10,oe=L&1023;return(L>>15?-1:1)*(H?H===31?oe?NaN:1/0:Math.pow(2,H-15)*(1+oe/1024):6103515625e-14*(oe/1024))}function Ue(L,H){var oe=L.getUint16(H.value,!0);return H.value+=2,oe}function ot(L,H){return ce(Ue(L,H))}function ct(L,H,oe,pe){for(var xe=oe.value,we=[];oe.valuefe.height?fe.height-H:fe.scanlineBlockSize;const pe=fe.size=fe.height)break;for(let Ke=0;Ke{const a={attributeIDs:this.defaultAttributeIDs,attributeTypes:this.defaultAttributeTypes,useUniqueIDs:!1};this.decodeGeometry(o,a).then(t).catch(i)},r,i)}decodeDracoFile(e,t,r,i){const s={attributeIDs:r||this.defaultAttributeIDs,attributeTypes:i||this.defaultAttributeTypes,useUniqueIDs:!!r};this.decodeGeometry(e,s).then(t)}decodeGeometry(e,t){for(const l in t.attributeTypes){const u=t.attributeTypes[l];u.BYTES_PER_ELEMENT!==void 0&&(t.attributeTypes[l]=u.name)}const r=JSON.stringify(t);if(qx.has(e)){const l=qx.get(e);if(l.key===r)return l.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 s=this.workerNextTaskID++,o=e.byteLength,a=this._getWorker(s,o).then(l=>(i=l,new Promise((u,c)=>{i._callbacks[s]={resolve:u,reject:c},i.postMessage({type:"decode",id:s,taskConfig:t,buffer:e},[e])}))).then(l=>this._createGeometry(l.geometry));return a.catch(()=>!0).then(()=>{i&&s&&this._releaseTask(i,s)}),qx.set(e,{key:r,promise:a}),a}_createGeometry(e){const t=new Ut;e.index&&t.setIndex(new mn(e.index.array,1));for(let r=0;r{r.load(e,i,void 0,s)})}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(r=>{const i=r[0];e||(this.decoderConfig.wasmBinary=r[1]);const s=RK.toString(),o=["/* draco decoder */",i,"","/* worker */",s.substring(s.indexOf("{")+1,s.lastIndexOf("}"))].join(` -`);this.workerSourceURL=URL.createObjectURL(new Blob([o]))}),this.decoderPending}_getWorker(e,t){return this._initDecoder().then(()=>{if(this.workerPool.lengths._taskLoad?-1:1});const r=this.workerPool[this.workerPool.length-1];return r._taskCosts[e]=t,r._taskLoad+=t,r})}_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{const f=c.draco,p=new f.Decoder,m=new f.DecoderBuffer;m.Init(new Int8Array(l),l.byteLength);try{const g=t(f,p,m,u),v=g.attributes.map(y=>y.array.buffer);g.index&&v.push(g.index.array.buffer),self.postMessage({type:"decode",id:a.id,geometry:g},v)}catch(g){console.error(g),self.postMessage({type:"error",id:a.id,error:g.message})}finally{f.destroy(m),f.destroy(p)}});break}};function t(o,a,l,u){const c=u.attributeIDs,f=u.attributeTypes;let p,m;const g=a.GetEncodedGeometryType(l);if(g===o.TRIANGULAR_MESH)p=new o.Mesh,m=a.DecodeBufferToMesh(l,p);else if(g===o.POINT_CLOUD)p=new o.PointCloud,m=a.DecodeBufferToPointCloud(l,p);else throw new Error("THREE.DRACOLoader: Unexpected geometry type.");if(!m.ok()||p.ptr===0)throw new Error("THREE.DRACOLoader: Decoding failed: "+m.error_msg());const v={index:null,attributes:[]};for(const y in c){const w=self[f[y]];let _,x;if(u.useUniqueIDs)x=c[y],_=a.GetAttributeByUniqueId(p,x);else{if(x=a.GetAttributeId(p,o[c[y]]),x===-1)continue;_=a.GetAttribute(p,x)}v.attributes.push(i(o,a,p,y,w,_))}return g===o.TRIANGULAR_MESH&&(v.index=r(o,a,p)),o.destroy(p),v}function r(o,a,l){const c=l.num_faces()*3,f=c*4,p=o._malloc(f);a.GetTrianglesUInt32Array(l,f,p);const m=new Uint32Array(o.HEAPF32.buffer,p,c).slice();return o._free(p),{array:m,itemSize:1}}function i(o,a,l,u,c,f){const p=f.num_components(),g=l.num_points()*p,v=g*c.BYTES_PER_ELEMENT,y=s(o,c),w=o._malloc(v);a.GetAttributeDataArrayForAllPoints(l,f,y,v,w);const _=new c(o.HEAPF32.buffer,w,g).slice();return o._free(w),{name:u,array:_,itemSize:p}}function s(o,a){switch(a){case Float32Array:return o.DT_FLOAT32;case Int8Array:return o.DT_INT8;case Int16Array:return o.DT_INT16;case Int32Array:return o.DT_INT32;case Uint8Array:return o.DT_UINT8;case Uint16Array:return o.DT_UINT16;case Uint32Array:return o.DT_UINT32}}}let Yg;const $x=()=>{if(Yg)return Yg;const n="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]),r=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=n;WebAssembly.validate(t)&&(i=e);let s;const o=WebAssembly.instantiate(a(i),{}).then(f=>{s=f.instance,s.exports.__wasm_call_ctors()});function a(f){const p=new Uint8Array(f.length);for(let g=0;g96?v-71:v>64?v-65:v>47?v+4:v>46?63:62}let m=0;for(let g=0;g.init",u),c&&(c=r("<"+a+">.getTransferables",c));var f=null;typeof u=="function"?f=u.apply(void 0,l):console.error("worker module init function failed to rehydrate"),n[o]={id:o,value:f,getTransferables:c},s(f)}catch(p){p&&p.noLog||console.error(p),s(p)}}function t(i,s){var o,a=i.id,l=i.args;(!n[a]||typeof n[a].value!="function")&&s(new Error("Worker module "+a+": not found or its 'init' did not return a function"));try{var u=(o=n[a]).value.apply(o,l);u&&typeof u.then=="function"?u.then(c,function(f){return s(f instanceof Error?f:new Error(""+f))}):c(u)}catch(f){s(f)}function c(f){try{var p=n[a].getTransferables&&n[a].getTransferables(f);(!p||!Array.isArray(p)||!p.length)&&(p=void 0),s(f,p)}catch(m){console.error(m),s(m)}}}function r(i,s){var o=void 0;self.troikaDefine=function(l){return o=l};var a=URL.createObjectURL(new Blob(["/** "+i.replace(/\*/g,"")+` **/ - -troikaDefine( -`+s+` -)`],{type:"application/javascript"}));try{importScripts(a)}catch(l){console.error(l)}return URL.revokeObjectURL(a),delete self.troikaDefine,o}self.addEventListener("message",function(i){var s=i.data,o=s.messageId,a=s.action,l=s.data;try{a==="registerModule"&&e(l,function(u){u instanceof Error?postMessage({messageId:o,success:!1,error:u.message}):postMessage({messageId:o,success:!0,result:{isCallable:typeof u=="function"}})}),a==="callModule"&&t(l,function(u,c){u instanceof Error?postMessage({messageId:o,success:!1,error:u.message}):postMessage({messageId:o,success:!0,result:u},c||void 0)})}catch(u){postMessage({messageId:o,success:!1,error:u.stack})}})}function PK(n){var e=function(){for(var t=[],r=arguments.length;r--;)t[r]=arguments[r];return e._getInitResult().then(function(i){if(typeof i=="function")return i.apply(void 0,t);throw new Error("Worker module function was called but `init` did not return a callable function")})};return e._getInitResult=function(){var t=n.dependencies,r=n.init;t=Array.isArray(t)?t.map(function(s){return s&&s._getInitResult?s._getInitResult():s}):[];var i=Promise.all(t).then(function(s){return r.apply(null,s)});return e._getInitResult=function(){return i},i},e}var Mk=function(){var n=!1;if(typeof window<"u"&&typeof window.document<"u")try{var e=new Worker(URL.createObjectURL(new Blob([""],{type:"application/javascript"})));e.terminate(),n=!0}catch(t){typeof process<"u",console.log("Troika createWorkerModule: web workers not allowed; falling back to main thread execution. Cause: ["+t.message+"]")}return Mk=function(){return n},n},IK=0,LK=0,e_=!1,xd=Object.create(null),_d=Object.create(null),IS=Object.create(null);function Vp(n){if((!n||typeof n.init!="function")&&!e_)throw new Error("requires `options.init` function");var e=n.dependencies,t=n.init,r=n.getTransferables,i=n.workerId;if(!Mk())return PK(n);i==null&&(i="#default");var s="workerModule"+ ++IK,o=n.name||s,a=null;e=e&&e.map(function(u){return typeof u=="function"&&!u.workerModuleData&&(e_=!0,u=Vp({workerId:i,name:"<"+o+"> function dependency: "+u.name,init:`function(){return ( -`+b0(u)+` -)}`}),e_=!1),u&&u.workerModuleData&&(u=u.workerModuleData),u});function l(){for(var u=[],c=arguments.length;c--;)u[c]=arguments[c];if(!a){a=eR(i,"registerModule",l.workerModuleData);var f=function(){a=null,_d[i].delete(f)};(_d[i]||(_d[i]=new Set)).add(f)}return a.then(function(p){var m=p.isCallable;if(m)return eR(i,"callModule",{id:s,args:u});throw new Error("Worker module function was called but `init` did not return a callable function")})}return l.workerModuleData={isWorkerModule:!0,id:s,name:o,dependencies:e,init:b0(t),getTransferables:r&&b0(r)},l}function DK(n){_d[n]&&_d[n].forEach(function(e){e()}),xd[n]&&(xd[n].terminate(),delete xd[n])}function b0(n){var e=n.toString();return!/^function/.test(e)&&/^\w+\s*\(/.test(e)&&(e="function "+e),e}function kK(n){var e=xd[n];if(!e){var t=b0(BK);e=xd[n]=new Worker(URL.createObjectURL(new Blob(["/** Worker Module Bootstrap: "+n.replace(/\*/g,"")+` **/ - -;(`+t+")()"],{type:"application/javascript"}))),e.onmessage=function(r){var i=r.data,s=i.messageId,o=IS[s];if(!o)throw new Error("WorkerModule response with empty or unknown messageId");delete IS[s],o(i)}}return e}function eR(n,e,t){return new Promise(function(r,i){var s=++LK;IS[s]=function(o){o.success?r(o.result):i(new Error("Error in worker "+e+" call: "+o.error))},kK(n).postMessage({messageId:s,action:e,data:t})})}function Ek(){var n=function(e){function t(V,j,W,k,Q,q,X,J){var ae=1-X;J.x=ae*ae*V+2*ae*X*W+X*X*Q,J.y=ae*ae*j+2*ae*X*k+X*X*q}function r(V,j,W,k,Q,q,X,J,ae,re){var me=1-ae;re.x=me*me*me*V+3*me*me*ae*W+3*me*ae*ae*Q+ae*ae*ae*X,re.y=me*me*me*j+3*me*me*ae*k+3*me*ae*ae*q+ae*ae*ae*J}function i(V,j){for(var W=/([MLQCZ])([^MLQCZ]*)/g,k,Q,q,X,J;k=W.exec(V);){var ae=k[2].replace(/^\s*|\s*$/g,"").split(/[,\s]+/).map(function(re){return parseFloat(re)});switch(k[1]){case"M":X=Q=ae[0],J=q=ae[1];break;case"L":(ae[0]!==X||ae[1]!==J)&&j("L",X,J,X=ae[0],J=ae[1]);break;case"Q":{j("Q",X,J,X=ae[2],J=ae[3],ae[0],ae[1]);break}case"C":{j("C",X,J,X=ae[4],J=ae[5],ae[0],ae[1],ae[2],ae[3]);break}case"Z":(X!==Q||J!==q)&&j("L",X,J,Q,q);break}}}function s(V,j,W){W===void 0&&(W=16);var k={x:0,y:0};i(V,function(Q,q,X,J,ae,re,me,Me,Se){switch(Q){case"L":j(q,X,J,ae);break;case"Q":{for(var se=q,ye=X,ke=1;ke0;)Ee[be]=arguments[be+2];var De=Ge[te]||(Ge[te]=W.getUniformLocation(Je,te));W["uniform"+nt].apply(W,[De].concat(Ee))},setAttribute:function(nt,te,Ee,be,De){var Qe=_e[nt];Qe||(Qe=_e[nt]={buf:W.createBuffer(),loc:W.getAttribLocation(Je,nt),data:null}),W.bindBuffer(W.ARRAY_BUFFER,Qe.buf),W.vertexAttribPointer(Qe.loc,te,W.FLOAT,!1,0,0),W.enableVertexAttribArray(Qe.loc),Q?W.vertexAttribDivisor(Qe.loc,be):Te("ANGLE_instanced_arrays").vertexAttribDivisorANGLE(Qe.loc,be),De!==Qe.data&&(W.bufferData(W.ARRAY_BUFFER,De,Ee),Qe.data=De)}})}}}X[Ie].transaction(le)},Ce=function(Ie,K){ae++;try{W.activeTexture(W.TEXTURE0+ae);var O=J[Ie];O||(O=J[Ie]=W.createTexture(),W.bindTexture(W.TEXTURE_2D,O),W.texParameteri(W.TEXTURE_2D,W.TEXTURE_MIN_FILTER,W.NEAREST),W.texParameteri(W.TEXTURE_2D,W.TEXTURE_MAG_FILTER,W.NEAREST)),W.bindTexture(W.TEXTURE_2D,O),K(O,ae)}finally{ae--}},je=function(Ie,K,O){var le=W.createFramebuffer();re.push(le),W.bindFramebuffer(W.FRAMEBUFFER,le),W.activeTexture(W.TEXTURE0+K),W.bindTexture(W.TEXTURE_2D,Ie),W.framebufferTexture2D(W.FRAMEBUFFER,W.COLOR_ATTACHMENT0,W.TEXTURE_2D,Ie,0);try{O(le)}finally{W.deleteFramebuffer(le),W.bindFramebuffer(W.FRAMEBUFFER,re[--re.length-1]||null)}},He=function(){q={},X={},J={},ae=-1,re.length=0};var me=Te,Me=Pe,Se=We,se=Ce,ye=je,ke=He,Q=typeof WebGL2RenderingContext<"u"&&W instanceof WebGL2RenderingContext,q={},X={},J={},ae=-1,re=[];W.canvas.addEventListener("webglcontextlost",function(Ie){He(),Ie.preventDefault()},!1),l.set(W,k={gl:W,isWebGL2:Q,getExtension:Te,withProgram:We,withTexture:Ce,withTextureFramebuffer:je,handleContextLoss:He})}j(k)}function f(V,j,W,k,Q,q,X,J){X===void 0&&(X=15),J===void 0&&(J=null),c(V,function(ae){var re=ae.gl,me=ae.withProgram,Me=ae.withTexture;Me("copy",function(Se,se){re.texImage2D(re.TEXTURE_2D,0,re.RGBA,Q,q,0,re.RGBA,re.UNSIGNED_BYTE,j),me("copy",o,a,function(ye){var ke=ye.setUniform,Te=ye.setAttribute;Te("aUV",2,re.STATIC_DRAW,0,new Float32Array([0,0,2,0,0,2])),ke("1i","image",se),re.bindFramebuffer(re.FRAMEBUFFER,J||null),re.disable(re.BLEND),re.colorMask(X&8,X&4,X&2,X&1),re.viewport(W,k,Q,q),re.scissor(W,k,Q,q),re.drawArrays(re.TRIANGLES,0,3)})})})}function p(V,j,W){var k=V.width,Q=V.height;c(V,function(q){var X=q.gl,J=new Uint8Array(k*Q*4);X.readPixels(0,0,k,Q,X.RGBA,X.UNSIGNED_BYTE,J),V.width=j,V.height=W,f(X,J,0,0,k,Q)})}var m=Object.freeze({__proto__:null,withWebGLContext:c,renderImageData:f,resizeWebGLCanvasWithoutClearing:p});function g(V,j,W,k,Q,q){q===void 0&&(q=1);var X=new Uint8Array(V*j),J=k[2]-k[0],ae=k[3]-k[1],re=[];s(W,function(Te,Pe,We,Ce){re.push({x1:Te,y1:Pe,x2:We,y2:Ce,minX:Math.min(Te,We),minY:Math.min(Pe,Ce),maxX:Math.max(Te,We),maxY:Math.max(Pe,Ce)})}),re.sort(function(Te,Pe){return Te.maxX-Pe.maxX});for(var me=0;meHe.minX&&Pe-CeHe.minY){var Ie=w(Te,Pe,He.x1,He.y1,He.x2,He.y2);IePe!=je.y2>Pe&&Te<(je.x2-je.x1)*(Pe-je.y1)/(je.y2-je.y1)+je.x1;He&&(We+=je.y1p.y!=seg.w>p.y)&&(p.x<(seg.z-seg.x)*(p.y-seg.y)/(seg.w-seg.y)+seg.x);bool crossingUp=crossing&&vLineSegment.y1,1e>2,u>2,2wt>1,1>1,1ge>1,1wp>1,1j>1,f>1,hm>1,1>1,u>1,u6>1,1>1,+5,28>1,w>1,1>1,+3,b8>1,1>1,+3,1>3,-1>-1,3>1,1>1,+2,1s>1,1>1,x>1,th>1,1>1,+2,db>1,1>1,+3,3>1,1>1,+2,14qm>1,1>1,+1,4q>1,1e>2,u>2,2>1,+1",canonical:"6f1>-6dx,6dy>-6dx,6ec>-6ed,6ee>-6ed,6ww>2jj,-2ji>2jj,14r4>-1e7l,1e7m>-1e7l,1e7m>-1e5c,1e5d>-1e5b,1e5c>-14qx,14qy>-14qx,14vn>-1ecg,1ech>-1ecg,1edu>-1ecg,1eci>-1ecg,1eda>-1ecg,1eci>-1ecg,1eci>-168q,168r>-168q,168s>-14ye,14yf>-14ye"};function v(Ce,je){var He=36,Ie=0,K=new Map,O=je&&new Map,le;return Ce.split(",").forEach(function _e(Ge){if(Ge.indexOf("+")!==-1)for(var Je=+Ge;Je--;)_e(le);else{le=Ge;var Ve=Ge.split(">"),Ye=Ve[0],Le=Ve[1];Ye=String.fromCodePoint(Ie+=parseInt(Ye,He)),Le=String.fromCodePoint(Ie+=parseInt(Le,He)),K.set(Ye,Le),je&&O.set(Le,Ye)}}),{map:K,reverseMap:O}}var y,w,_;function x(){if(!y){var Ce=v(g.pairs,!0),je=Ce.map,He=Ce.reverseMap;y=je,w=He,_=v(g.canonical,!1).map}}function A(Ce){return x(),y.get(Ce)||null}function C(Ce){return x(),w.get(Ce)||null}function b(Ce){return x(),_.get(Ce)||null}var R=r.L,E=r.R,B=r.EN,D=r.ES,U=r.ET,z=r.AN,Y=r.CS,P=r.B,F=r.S,G=r.ON,ie=r.BN,N=r.NSM,V=r.AL,j=r.LRO,W=r.RLO,k=r.LRE,Q=r.RLE,q=r.PDF,X=r.LRI,J=r.RLI,ae=r.FSI,re=r.PDI;function me(Ce,je){for(var He=125,Ie=new Uint32Array(Ce.length),K=0;K0)Qe--;else if(yt>0){for(lt=0;!be[be.length-1]._isolate;)be.pop();var Ht=be[be.length-1]._isolInitIndex;Ht!=null&&(Ge.set(Ht,ue),Ge.set(ue,Ht)),be.pop(),yt--}De=be[be.length-1],_e[ue]=De._level,De._override&&le(ue,De._override)}else ce&q?(Qe===0&&(lt>0?lt--:!De._isolate&&be.length>1&&(be.pop(),De=be[be.length-1])),_e[ue]=De._level):ce&P&&(_e[ue]=Ve.level);else _e[ue]=De._level,De._override&&ce!==ie&&le(ue,De._override)}for(var Qt=[],un=null,Xt=Ve.start;Xt<=Ve.end;Xt++){var fn=Ie[Xt];if(!(fn&l)){var Vt=_e[Xt],Kt=fn&s,Dr=fn===re;un&&Vt===un._level?(un._end=Xt,un._endsWithIsolInit=Kt):Qt.push(un={_start:Xt,_end:Xt,_level:Vt,_startsWithPDI:Dr,_endsWithIsolInit:Kt})}}for(var hr=[],Zt=0;Zt=0;xe--)if(!(Ie[xe]&l)){pe=_e[xe];break}var we=Fe[Fe.length-1],Ke=_e[we],Xe=Ve.level;if(!(Ie[we]&s)){for(var qe=we+1;qe<=Ve.end;qe++)if(!(Ie[qe]&l)){Xe=_e[qe];break}}hr.push({_seqIndices:Fe,_sosType:Math.max(pe,oe)%2?E:R,_eosType:Math.max(Xe,Ke)%2?E:R})}}for(var $e=0;$e=0;kt--)if(!(Ie[ge[kt]]&l)){Tt=Ie[ge[kt]];break}le(It,Tt&(s|re)?G:Tt)}}if(O.get(B))for(var At=0;At=-1;Pt--){var Rt=Pt===-1?Wt:Ie[ge[Pt]];if(Rt&o){Rt===V&&le(Mt,z);break}}}if(O.get(V))for(var $t=0;$t=0&&(Sn=Ie[ge[on]],!!(Sn&l));on--);for(var Nn=en+1;Nn=0&&Ie[ge[yn]]&(U|l);yn--)le(ge[yn],B);for(var Mi=tn+1;Mi=0&&Ie[ge[Bo]]&l;Bo--)le(ge[Bo],G);for(var Po=er+1;Po=0;Do--){var Uu=xa[Do].char;if(Uu===Hf||Uu===C(b(Yt))||A(b(Uu))===Yt){to.push([xa[Do].seqIndex,no]),xa.length=Do;break}}}to.sort(function(or,wr){return or[0]-wr[0]})}for(var Vf=0;Vf=0;Jf--){var zu=ge[Jf];if(Ie[zu]&Ou){var Gi=Ie[zu]&Lo?E:R;Gi!==io(zu)?si=Gi:si=io(zu);break}}}if(si){if(Ie[ge[Dn]]=Ie[ge[_a]]=si,si!==io(ge[Dn])){for(var oi=Dn+1;oi=0;Ml--)if(Ie[ge[Ml]]&l)jf=Ml;else{Ei=Ie[ge[Ml]]&Lo?E:R;break}for(var El=it,Cl=as+1;Cl=0&&p(Ce[Sa])&u;Sa--)_e[Sa]=Ve.level}}return{levels:_e,paragraphs:Je};function Hu(or,wr){for(var An=or;An=_e&&p(Ce[Ve])&u;Ve--)Je[Ve]=le.level;for(var Ye=le.level,Le=1/0,nt=0;ntYe&&(Ye=te),te=Le;Ee--)for(var be=0;be=Ee){for(var De=be;be+1=Ee;)be++;be>De&&O.push([De+He,be+He])}}}),O}function Pe(Ce,je,He,Ie){var K=We(Ce,je,He,Ie),O=[].concat(Ce);return K.forEach(function(le,_e){O[_e]=(je.levels[le]&1?ye(Ce[le]):null)||Ce[le]}),O.join("")}function We(Ce,je,He,Ie){for(var K=Te(Ce,je,He,Ie),O=[],le=0;le/gm;function t(r,i){let s=zt[i];return s?LS(s):r}return n.replace(e,t)}const Fr=[];for(let n=0;n<256;n++)Fr[n]=(n<16?"0":"")+n.toString(16);function NK(){const n=Math.random()*4294967295|0,e=Math.random()*4294967295|0,t=Math.random()*4294967295|0,r=Math.random()*4294967295|0;return(Fr[n&255]+Fr[n>>8&255]+Fr[n>>16&255]+Fr[n>>24&255]+"-"+Fr[e&255]+Fr[e>>8&255]+"-"+Fr[e>>16&15|64]+Fr[e>>24&255]+"-"+Fr[t&63|128]+Fr[t>>8&255]+"-"+Fr[t>>16&255]+Fr[t>>24&255]+Fr[r&255]+Fr[r>>8&255]+Fr[r>>16&255]+Fr[r>>24&255]).toUpperCase()}const Xl=Object.assign||function(){let n=arguments[0];for(let e=1,t=arguments.length;e/gm,` -//!BEGIN_POST_CHUNK $1 -$& -//!END_POST_CHUNK -`),t=LS(t)),m){let v=m({vertexShader:e,fragmentShader:t});e=v.vertexShader,t=v.fragmentShader}if(p){let v=[];t=t.replace(/^\/\/!BEGIN_POST_CHUNK[^]+?^\/\/!END_POST_CHUNK/gm,y=>(v.push(y),"")),f=`${p} -${v.join(` -`)} -${f}`}if(g){const v=` -uniform float ${g}; -`;s=v+s,u=v+u}return l&&(e=`vec3 troika_position_${i}; -vec3 troika_normal_${i}; -vec2 troika_uv_${i}; -${e} -`,s=`${s} -void troikaVertexTransform${i}(inout vec3 position, inout vec3 normal, inout vec2 uv) { - ${l} -} -`,o=` -troika_position_${i} = vec3(position); -troika_normal_${i} = vec3(normal); -troika_uv_${i} = vec2(uv); -troikaVertexTransform${i}(troika_position_${i}, troika_normal_${i}, troika_uv_${i}); -${o} -`,e=e.replace(/\b(position|normal|uv)\b/g,(v,y,w,_)=>/\battribute\s+vec[23]\s+$/.test(_.substr(0,w))?y:`troika_${y}_${i}`),n.map&&n.map.channel>0||(e=e.replace(/\bMAP_UV\b/g,`troika_uv_${i}`))),e=rR(e,i,s,o,a),t=rR(t,i,u,c,f),{vertexShader:e,fragmentShader:t}}function rR(n,e,t,r,i){return(r||i||t)&&(n=n.replace(Ck,` -${t} -void troikaOrigMain${e}() {`),n+=` -void main() { - ${r} - troikaOrigMain${e}(); - ${i} -}`),n}function GK(n,e){return n==="uniforms"?void 0:typeof e=="function"?e.toString():e}let HK=0;const iR=new Map;function VK(n){const e=JSON.stringify(n,GK);let t=iR.get(e);return t==null&&iR.set(e,t=++HK),t}function WK(n,e,t){const{defaultFontURL:r}=t,i=Object.create(null),s=1/0,o=/[\u00AD\u034F\u061C\u115F-\u1160\u17B4-\u17B5\u180B-\u180E\u200B-\u200F\u202A-\u202E\u2060-\u206F\u3164\uFE00-\uFE0F\uFEFF\uFFA0\uFFF0-\uFFF8]/,a="[^\\S\\u00A0]",l=new RegExp(`${a}|[\\-\\u007C\\u00AD\\u2010\\u2012-\\u2014\\u2027\\u2056\\u2E17\\u2E40]`);function u(_,x){function A(){const C=b=>{console.error(`Failure loading font ${_}${_===r?"":"; trying fallback"}`,b),_!==r&&(_=r,A())};try{const b=new XMLHttpRequest;b.open("get",_,!0),b.responseType="arraybuffer",b.onload=function(){if(b.status>=400)C(new Error(b.statusText));else if(b.status>0)try{const R=n(b.response);x(R)}catch(R){C(R)}},b.onerror=C,b.send()}catch(b){C(b)}}A()}function c(_,x){_||(_=r);let A=i[_];A?A.pending?A.pending.push(x):x(A):(i[_]={pending:[x]},u(_,C=>{let b=i[_].pending;i[_]=C,b.forEach(R=>R(C))}))}function f({text:_="",font:x=r,sdfGlyphSize:A=64,fontSize:C=1,letterSpacing:b=0,lineHeight:R="normal",maxWidth:E=s,direction:B,textAlign:D="left",textIndent:U=0,whiteSpace:z="normal",overflowWrap:Y="normal",anchorX:P=0,anchorY:F=0,includeCaretPositions:G=!1,chunkedBoundsSize:ie=8192,colorRanges:N=null},V,j=!1){const W=v(),k={fontLoad:0,typesetting:0};_.indexOf("\r")>-1&&(console.info("Typesetter: got text with \\r chars; normalizing to \\n"),_=_.replace(/\r\n/g,` -`).replace(/\r/g,` -`)),C=+C,b=+b,E=+E,R=R||"normal",U=+U,c(x,Q=>{const q=isFinite(E);let X=null,J=null,ae=null,re=null,me=null,Me=null,Se=null,se=0,ye=0,ke=z!=="nowrap";const{ascender:Te,descender:Pe,unitsPerEm:We,lineGap:Ce,capHeight:je,xHeight:He}=Q;k.fontLoad=v()-W;const Ie=v(),K=C/We;R==="normal"&&(R=(Te-Pe+Ce)/We),R=R*C;const O=(R-(Te-Pe)*K)/2,le=-(Te*K+O),_e=Math.min(R,(Te-Pe)*K),Ge=(Te+Pe)/2*K-_e/2;let Je=U,Ve=new y;const Ye=[Ve];Q.forEachGlyph(_,C,b,(te,Ee,be)=>{const De=_.charAt(be),Qe=te.advanceWidth*K,lt=Ve.count;let yt;if("isEmpty"in te||(te.isWhitespace=!!De&&new RegExp(a).test(De),te.canBreakAfter=!!De&&l.test(De),te.isEmpty=te.xMin===te.xMax||te.yMin===te.yMax||o.test(De)),!te.isWhitespace&&!te.isEmpty&&ye++,ke&&q&&!te.isWhitespace&&Ee+Qe+Je>E&<){if(Ve.glyphAt(lt-1).glyphObj.canBreakAfter)yt=new y,Je=-Ee;else for(let ce=lt;ce--;)if(ce===0&&Y==="break-word"){yt=new y,Je=-Ee;break}else if(Ve.glyphAt(ce).glyphObj.canBreakAfter){yt=Ve.splitAt(ce+1);const Ue=yt.glyphAt(0).x;Je-=Ue;for(let ot=yt.count;ot--;)yt.glyphAt(ot).x-=Ue;break}yt&&(Ve.isSoftWrapped=!0,Ve=yt,Ye.push(Ve),se=E)}let ue=Ve.glyphAt(Ve.count);ue.glyphObj=te,ue.x=Ee+Je,ue.width=Qe,ue.charIndex=be,De===` -`&&(Ve=new y,Ye.push(Ve),Je=-(Ee+Qe+b*C)+U)}),Ye.forEach(te=>{for(let Ee=te.count;Ee--;){let{glyphObj:be,x:De,width:Qe}=te.glyphAt(Ee);if(!be.isWhitespace){te.width=De+Qe,te.width>se&&(se=te.width);return}}});let Le=0,nt=0;if(P&&(typeof P=="number"?Le=-P:typeof P=="string"&&(Le=-se*(P==="left"?0:P==="center"?.5:P==="right"?1:m(P)))),F){if(typeof F=="number")nt=-F;else if(typeof F=="string"){let te=Ye.length*R;nt=F==="top"?0:F==="top-baseline"?-le:F==="top-cap"?-le-je*K:F==="top-ex"?-le-He*K:F==="middle"?te/2:F==="bottom"?te:F==="bottom-baseline"?te-O+Pe*K:m(F)*te}}if(!j){const te=e.getEmbeddingLevels(_,B);X=new Uint16Array(ye),J=new Float32Array(ye*2),ae={},Me=[s,s,-s,-s],Se=[];let Ee=le;G&&(me=new Float32Array(_.length*3)),N&&(re=new Uint8Array(ye*3));let be=0,De=-1,Qe=-1,lt,yt;if(Ye.forEach((ue,ce)=>{let{count:Ue,width:ot}=ue;if(Ue>0){let ct=0;for(let Vt=Ue;Vt--&&ue.glyphAt(Vt).glyphObj.isWhitespace;)ct++;let Ht=0,Qt=0;if(D==="center")Ht=(se-ot)/2;else if(D==="right")Ht=se-ot;else if(D==="justify"&&ue.isSoftWrapped){let Vt=0;for(let Kt=Ue-ct;Kt--;)ue.glyphAt(Kt).glyphObj.isWhitespace&&Vt++;Qt=(se-ot)/Vt}if(Qt||Ht){let Vt=0;for(let Kt=0;Kt=Kt){let Ae=$,Be=$;for(;BeDr)break;BeXt=Vt;for(let Vt=0;Vt1&&g(me,De,Be),De=Zt}if(N){const{charIndex:Zt}=Kt;for(;Zt>Qe;)Qe++,N.hasOwnProperty(Qe)&&(yt=N[Qe])}if(!Xt.isWhitespace&&!Xt.isEmpty){const Zt=be++;ae[Dr]||(ae[Dr]={path:Xt.path,pathBounds:[Xt.xMin,Xt.yMin,Xt.xMax,Xt.yMax]});const $=Kt.x+Le,Ae=Ee+nt;J[Zt*2]=$,J[Zt*2+1]=Ae;const Be=$+Xt.xMin*K,fe=Ae+Xt.yMin*K,Fe=$+Xt.xMax*K,vt=Ae+Xt.yMax*K;BeMe[2]&&(Me[2]=Fe),vt>Me[3]&&(Me[3]=vt),Zt%ie===0&&(lt={start:Zt,end:Zt,rect:[s,s,-s,-s]},Se.push(lt)),lt.end++;const L=lt.rect;if(BeL[2]&&(L[2]=Fe),vt>L[3]&&(L[3]=vt),X[Zt]=Dr,N){const H=Zt*3;re[H]=yt>>16&255,re[H+1]=yt>>8&255,re[H+2]=yt&255}}}}Ee-=R}),me){const ue=_.length-De;ue>1&&g(me,De,ue)}}k.typesetting=v()-Ie,V({glyphIds:X,glyphPositions:J,glyphData:ae,caretPositions:me,caretHeight:_e,glyphColors:re,chunkedBounds:Se,fontSize:C,unitsPerEm:We,ascender:Te*K,descender:Pe*K,capHeight:je*K,xHeight:He*K,lineHeight:R,topBaseline:le,blockBounds:[Le,nt-Ye.length*R,Le+se,nt],visibleBounds:Me,timings:k})})}function p(_,x){f(_,A=>{const[C,b,R,E]=A.blockBounds;x({width:R-C,height:E-b})},{metricsOnly:!0})}function m(_){let x=_.match(/^([\d.]+)%$/),A=x?parseFloat(x[1]):NaN;return isNaN(A)?0:A/100}function g(_,x,A){const C=_[x*3],b=_[x*3+1],R=_[x*3+2],E=(b-C)/A;for(let B=0;B(Object.defineProperty(_,x,{get(){return this.data[this.index*w.length+A]},set(b){this.data[this.index*w.length+A]=b}}),_),{data:null,index:0}),{typeset:f,measure:p,loadFont:c}}const yu=()=>(self.performance||Date).now(),By=Ek();let sR;function JK(n,e,t,r,i,s,o,a,l,u,c=!0){return c?XK(n,e,t,r,i,s,o,a,l,u).then(null,f=>(sR||(console.warn("WebGL SDF generation failed, falling back to JS",f),sR=!0),aR(n,e,t,r,i,s,o,a,l,u))):aR(n,e,t,r,i,s,o,a,l,u)}const T0=[],jK=5;let kS=0;function bk(){const n=yu();for(;T0.length&&yu()-nnew Promise((e,t)=>{T0.push(()=>{const r=yu();try{By.webgl.generateIntoCanvas(...n),e({timing:yu()-r})}catch(i){t(i)}}),kS||(kS=setTimeout(bk,0))}),YK=4,KK=2e3,oR={};let ZK=0;function aR(n,e,t,r,i,s,o,a,l,u){const c="TroikaTextSDFGenerator_JS_"+ZK++%YK;let f=oR[c];return f||(f=oR[c]={workerModule:Vp({name:c,workerId:c,dependencies:[Ek,yu],init(p,m){const g=p().javascript.generate;return function(...v){const y=m();return{textureData:g(...v),timing:m()-y}}},getTransferables(p){return[p.textureData.buffer]}}),requests:0,idleTimer:null}),f.requests++,clearTimeout(f.idleTimer),f.workerModule(n,e,t,r,i,s).then(({textureData:p,timing:m})=>{const g=yu(),v=new Uint8Array(p.length*4);for(let y=0;y{DK(c)},KK)),{timing:m}})}function QK(n){n._warm||(By.webgl.isSupported(n),n._warm=!0)}const qK=By.webglUtils.resizeWebGLCanvasWithoutClearing;/*! -Custom build of Typr.ts (https://github.com/fredli74/Typr.ts) for use in Troika text rendering. -Original MIT license applies: https://github.com/fredli74/Typr.ts/blob/master/LICENSE -*/function $K(){return typeof window>"u"&&(self.window=self),function(n){var e={parse:function(i){var s=e._bin,o=new Uint8Array(i);if(s.readASCII(o,0,4)=="ttcf"){var a=4;s.readUshort(o,a),a+=2,s.readUshort(o,a),a+=2;var l=s.readUint(o,a);a+=4;for(var u=[],c=0;c>>o&1&&s++;return s},e._lctf.readClassDef=function(i,s){var o=e._bin,a=[],l=o.readUshort(i,s);if(s+=2,l==1){var u=o.readUshort(i,s);s+=2;var c=o.readUshort(i,s);s+=2;for(var f=0;f0&&(l.featureParams=a+u);var c=o.readUshort(i,s);s+=2,l.tab=[];for(var f=0;f255?-1:e.CFF.glyphByUnicode(i,e.CFF.tableSE[s])},e.CFF.readEncoding=function(i,s,o){e._bin;var a=[".notdef"],l=i[s];if(s++,l!=0)throw"error: unknown encoding format: "+l;var u=i[s];s++;for(var c=0;c>4,_=15&y;if(w!=15&&v.push(w),_!=15&&v.push(_),_==15)break}for(var x="",A=[0,1,2,3,4,5,6,7,8,9,".","e","e-","reserved","-","endOfNumber"],C=0;C=u.xMax||u.yMin>=u.yMax)return null;if(u.noc>0){u.endPts=[];for(var c=0;c=1&&c.fmt<=2){p=l.readUshort(i,o),o+=2;var g=l.readUshort(i,o);o+=2,m=e._lctf.numOfOnes(p);var v=e._lctf.numOfOnes(g);if(c.fmt==1){c.pairsets=[];var y=l.readUshort(i,o);o+=2;for(var w=0;w=1&&c.fmt<=2){if(c.fmt==1)c.delta=l.readShort(i,o),o+=2;else if(c.fmt==2){var p=l.readUshort(i,o);o+=2,c.newg=l.readUshorts(i,o,p),o+=2*c.newg.length}}else if(s==4){c.vals=[],p=l.readUshort(i,o),o+=2;for(var m=0;m>>8;if((g&=15)!=0)throw"unknown kern table format: "+g;s=e.kern.readFormat0(i,s,f)}return f},e.kern.parseV1=function(i,s,o,a){var l=e._bin;l.readFixed(i,s),s+=4;var u=l.readUint(i,s);s+=4;for(var c={glyph1:[],rval:[]},f=0;f>>8;if((m&=15)!=0)throw"unknown kern table format: "+m;s=e.kern.readFormat0(i,s,c)}return c},e.kern.readFormat0=function(i,s,o){var a=e._bin,l=-1,u=a.readUshort(i,s);s+=2,a.readUshort(i,s),s+=2,a.readUshort(i,s),s+=2,a.readUshort(i,s),s+=2;for(var c=0;c=l.map.length?0:l.map[s];if(l.format==4){for(var u=-1,c=0;cs?0:65535&(l.idRangeOffset[u]!=0?l.glyphIdArray[s-l.startCount[u]+(l.idRangeOffset[u]>>1)-(l.idRangeOffset.length-u)]:s+l.idDelta[u])}if(l.format==12){if(s>l.groups[l.groups.length-1][1])return 0;for(c=0;c-1?e.U._simpleGlyph(a,o):e.U._compoGlyph(a,s,o))},e.U._simpleGlyph=function(i,s){for(var o=0;ol)){for(var y=!0,w=0,_=0;_l)){for(y=!0,_=0;_>1,u.length=0,f=!0;else if(z=="o3"||z=="o23")u.length%2!=0&&!f&&(p=u.shift()+a.nominalWidthX),c+=u.length>>1,u.length=0,f=!0;else if(z=="o4")u.length>1&&!f&&(p=u.shift()+a.nominalWidthX,f=!0),m&&e.U.P.closePath(l),y+=u.pop(),e.U.P.moveTo(l,v,y),m=!0;else if(z=="o5")for(;u.length>0;)v+=u.shift(),y+=u.shift(),e.U.P.lineTo(l,v,y);else if(z=="o6"||z=="o7")for(var Y=u.length,P=z=="o6",F=0;FMath.abs(E-y)?v=R+u.shift():y=E+u.shift(),e.U.P.curveTo(l,w,_,x,A,B,D),e.U.P.curveTo(l,C,b,R,E,v,y));else if(z=="o14"){if(u.length>0&&!f&&(p=u.shift()+o.nominalWidthX,f=!0),u.length==4){var N=u.shift(),V=u.shift(),j=u.shift(),W=u.shift(),k=e.CFF.glyphBySE(o,j),Q=e.CFF.glyphBySE(o,W);e.U._drawCFF(o.CharStrings[k],s,o,a,l),s.x=N,s.y=V,e.U._drawCFF(o.CharStrings[Q],s,o,a,l)}m&&(e.U.P.closePath(l),m=!1)}else if(z=="o19"||z=="o20")u.length%2!=0&&!f&&(p=u.shift()+a.nominalWidthX),c+=u.length>>1,u.length=0,f=!0,g+=c+7>>3;else if(z=="o21")u.length>2&&!f&&(p=u.shift()+a.nominalWidthX,f=!0),y+=u.pop(),v+=u.pop(),m&&e.U.P.closePath(l),e.U.P.moveTo(l,v,y),m=!0;else if(z=="o22")u.length>1&&!f&&(p=u.shift()+a.nominalWidthX,f=!0),v+=u.pop(),m&&e.U.P.closePath(l),e.U.P.moveTo(l,v,y),m=!0;else if(z=="o25"){for(;u.length>6;)v+=u.shift(),y+=u.shift(),e.U.P.lineTo(l,v,y);w=v+u.shift(),_=y+u.shift(),x=w+u.shift(),A=_+u.shift(),v=x+u.shift(),y=A+u.shift(),e.U.P.curveTo(l,w,_,x,A,v,y)}else if(z=="o26")for(u.length%2&&(v+=u.shift());u.length>0;)w=v,_=y+u.shift(),v=x=w+u.shift(),y=(A=_+u.shift())+u.shift(),e.U.P.curveTo(l,w,_,x,A,v,y);else if(z=="o27")for(u.length%2&&(y+=u.shift());u.length>0;)_=y,x=(w=v+u.shift())+u.shift(),A=_+u.shift(),v=x+u.shift(),y=A,e.U.P.curveTo(l,w,_,x,A,v,y);else if(z=="o10"||z=="o29"){var q=z=="o10"?a:o;if(u.length==0)console.debug("error: empty stack");else{var X=u.pop(),J=q.Subrs[X+q.Bias];s.x=v,s.y=y,s.nStems=c,s.haveWidth=f,s.width=p,s.open=m,e.U._drawCFF(J,s,o,a,l),v=s.x,y=s.y,c=s.nStems,f=s.haveWidth,p=s.width,m=s.open}}else if(z=="o30"||z=="o31"){var ae=u.length,re=(ie=0,z=="o31");for(ie+=ae-(Y=-3&ae);ie>>1|(21845&m)<<1;g=(61680&(g=(52428&g)>>>2|(13107&g)<<2))>>>4|(3855&g)<<4,p[m]=((65280&g)>>>8|(255&g)<<8)>>>1}var v=function(z,Y,P){for(var F=z.length,G=0,ie=new t(Y);G>>j]=W}else for(N=new t(F),G=0;G>>15-z[G]);return N},y=new e(288);for(m=0;m<144;++m)y[m]=8;for(m=144;m<256;++m)y[m]=9;for(m=256;m<280;++m)y[m]=7;for(m=280;m<288;++m)y[m]=8;var w=new e(32);for(m=0;m<32;++m)w[m]=5;var _=v(y,9,1),x=v(w,5,1),A=function(z){for(var Y=z[0],P=1;PY&&(Y=z[P]);return Y},C=function(z,Y,P){var F=Y/8|0;return(z[F]|z[F+1]<<8)>>(7&Y)&P},b=function(z,Y){var P=Y/8|0;return(z[P]|z[P+1]<<8|z[P+2]<<16)>>(7&Y)},R=["unexpected EOF","invalid block type","invalid length/literal","invalid distance","stream finished","no stream handler",,"no callback","invalid UTF-8 data","extra field too long","date not in range 1980-2099","filename too long","stream finishing","invalid zip data"],E=function(z,Y,P){var F=new Error(Y||R[z]);if(F.code=z,Error.captureStackTrace&&Error.captureStackTrace(F,E),!P)throw F;return F},B=function(z,Y,P){var F=z.length;if(!F||P&&!P.l&&F<5)return Y||new e(0);var G=!Y||P,ie=!P||P.i;P||(P={}),Y||(Y=new e(3*F));var N,V=function(De){var Qe=Y.length;if(De>Qe){var lt=new e(Math.max(2*Qe,De));lt.set(Y),Y=lt}},j=P.f||0,W=P.p||0,k=P.b||0,Q=P.l,q=P.d,X=P.m,J=P.n,ae=8*F;do{if(!Q){P.f=j=C(z,W,1);var re=C(z,W+1,3);if(W+=3,!re){var me=z[(He=((N=W)/8|0)+(7&N&&1)+4)-4]|z[He-3]<<8,Me=He+me;if(Me>F){ie&&E(0);break}G&&V(k+me),Y.set(z.subarray(He,Me),k),P.b=k+=me,P.p=W=8*Me;continue}if(re==1)Q=_,q=x,X=9,J=5;else if(re==2){var Se=C(z,W,31)+257,se=C(z,W+10,15)+4,ye=Se+C(z,W+5,31)+1;W+=14;for(var ke=new e(ye),Te=new e(19),Pe=0;Pe>>4)<16)ke[Pe++]=He;else{var K=0,O=0;for(He==16?(O=3+C(z,W,3),W+=2,K=ke[Pe-1]):He==17?(O=3+C(z,W,7),W+=3):He==18&&(O=11+C(z,W,127),W+=7);O--;)ke[Pe++]=K}}var le=ke.subarray(0,Se),_e=ke.subarray(Se);X=A(le),J=A(_e),Q=v(le,X,1),q=v(_e,J,1)}else E(1);if(W>ae){ie&&E(0);break}}G&&V(k+131072);for(var Ge=(1<>>4;if((W+=15&K)>ae){ie&&E(0);break}if(K||E(2),Ye<256)Y[k++]=Ye;else{if(Ye==256){Ve=W,Q=null;break}var Le=Ye-254;if(Ye>264){var nt=i[Pe=Ye-257];Le=C(z,W,(1<>>4;if(te||E(3),W+=15&te,_e=f[Ee],Ee>3&&(nt=s[Ee],_e+=b(z,W)&(1<ae){ie&&E(0);break}G&&V(k+131072);for(var be=k+Le;kDe.length)&&(lt=De.length);var yt=new(De instanceof t?t:De instanceof r?r:e)(lt-Qe);return yt.set(De.subarray(Qe,lt)),yt}(Y,0,k)},D=new e(0),U=typeof TextDecoder<"u"&&new TextDecoder;try{U.decode(D,{stream:!0})}catch{}return n.convert_streams=function(z){var Y=new DataView(z),P=0;function F(){var Se=Y.getUint16(P);return P+=2,Se}function G(){var Se=Y.getUint32(P);return P+=4,Se}function ie(Se){me.setUint16(Me,Se),Me+=2}function N(Se){me.setUint32(Me,Se),Me+=4}for(var V={signature:G(),flavor:G(),length:G(),numTables:F(),reserved:F(),totalSfntSize:G(),majorVersion:F(),minorVersion:F(),metaOffset:G(),metaLength:G(),metaOrigLength:G(),privOffset:G(),privLength:G()},j=0;Math.pow(2,j)<=V.numTables;)j++;j--;for(var W=16*Math.pow(2,j),k=16*V.numTables-W,Q=12,q=[],X=0;X{let[D,U]=B.split("+");D=parseInt(D,36),U=U?parseInt(U,36):0,c.set(E+=D,b[R]);for(let z=U;z--;)c.set(++E,b[R])})}}return c.get(C)||u}const p=1,m=2,g=3,v=4,y=[null,"isol","init","fina","medi"];function w(C){const b=new Uint8Array(C.length);let R=u,E=p,B=-1;for(let D=0;D65535&&D++)}return b}function _(C,b){const R=[];for(let B=0;B65535&&B++,R.push(n.U.codeToGlyph(C,D))}const E=C.GSUB;if(E){const{lookupList:B,featureList:D}=E;let U;const z=/^(rlig|liga|mset|isol|init|fina|medi|half|pres|blws)$/,Y=[];D.forEach(P=>{if(z.test(P.tag))for(let F=0;F{if(W!==-1){let Q=b[W];if(!Q){const{cmds:q,crds:X}=n.U.glyphToPath(C,W);let J="",ae=0;for(let se=0,ye=q.length;se1?",":"")+X[ae++]}let re,me,Me,Se;if(X.length){re=me=1/0,Me=Se=-1/0;for(let se=0,ye=X.length;seMe&&(Me=ke),Te>Se&&(Se=Te)}}else re=Me=me=Se=0;Q=b[W]={index:W,advanceWidth:C.hmtx.aWidth[W],xMin:re,yMin:me,xMax:Me,yMax:Se,path:J,pathCommandCount:q.length}}j!==-1&&(G+=n.U.getPairAdjustment(C,j,W)*ie),F.call(null,Q,G,V),Q.advanceWidth&&(G+=Q.advanceWidth*ie),P&&(G+=P*Y),j=W}V+=z.codePointAt(V)>65535?2:1}),G}};return U}return function(b){const R=new Uint8Array(b,0,4),E=n._bin.readASCII(R,0,4);if(E==="wOFF")b=e(b);else if(E==="wOF2")throw new Error("woff2 fonts not supported");return A(n.parse(b)[0])}}const nZ=Vp({name:"Typr Font Parser",dependencies:[$K,eZ,tZ],init(n,e,t){const r=n(),i=e();return t(r,i)}}),Hc={defaultFontURL:"https://fonts.gstatic.com/s/roboto/v18/KFOmCnqEu92Fr1Mu4mxM.woff",sdfGlyphSize:64,sdfMargin:1/16,sdfExponent:9,textureWidth:2048},rZ=new st;function xc(){return(self.performance||Date).now()}const lR=Object.create(null);function Tk(n,e){n=oZ({},n);const t=xc();if(n.font=aZ(n.font||Hc.defaultFontURL),n.text=""+n.text,n.sdfGlyphSize=n.sdfGlyphSize||Hc.sdfGlyphSize,n.colorRanges!=null){let f={};for(let p in n.colorRanges)if(n.colorRanges.hasOwnProperty(p)){let m=n.colorRanges[p];typeof m!="number"&&(m=rZ.set(m).getHex()),f[p]=m}n.colorRanges=f}Object.freeze(n);const{textureWidth:r,sdfExponent:i}=Hc,{sdfGlyphSize:s}=n,o=r/s*4;let a=lR[s];if(!a){const f=document.createElement("canvas");f.width=r,f.height=s*256/o,a=lR[s]={glyphCount:0,sdfGlyphSize:s,sdfCanvas:f,sdfTexture:new Rn(f,void 0,void 0,void 0,gn,gn),contextLost:!1,glyphsByFont:new Map},a.sdfTexture.generateMipmaps=!1,iZ(a)}const{sdfTexture:l,sdfCanvas:u}=a;let c=a.glyphsByFont.get(n.font);c||a.glyphsByFont.set(n.font,c=new Map),uZ(n).then(f=>{const{glyphIds:p,glyphPositions:m,fontSize:g,unitsPerEm:v,timings:y}=f,w=[],_=new Float32Array(p.length*4),x=g/v;let A=0,C=0;const b=xc();p.forEach((U,z)=>{let Y=c.get(U);if(!Y){const{path:ie,pathBounds:N}=f.glyphData[U],V=Math.max(N[2]-N[0],N[3]-N[1])/s*(Hc.sdfMargin*s+.5),j=a.glyphCount++,W=[N[0]-V,N[1]-V,N[2]+V,N[3]+V];c.set(U,Y={path:ie,atlasIndex:j,sdfViewBox:W}),w.push(Y)}const{sdfViewBox:P}=Y,F=m[C++],G=m[C++];_[A++]=F+P[0]*x,_[A++]=G+P[1]*x,_[A++]=F+P[2]*x,_[A++]=G+P[3]*x,p[z]=Y.atlasIndex}),y.quads=(y.quads||0)+(xc()-b);const R=xc();y.sdf={};const E=u.height,B=Math.ceil(a.glyphCount/o),D=Math.pow(2,Math.ceil(Math.log2(B*s)));D>E&&(console.info(`Increasing SDF texture size ${E}->${D}`),qK(u,r,D),l.dispose()),Promise.all(w.map(U=>Rk(U,a,n.gpuAccelerateSDF).then(({timing:z})=>{y.sdf[U.atlasIndex]=z}))).then(()=>{w.length&&!a.contextLost&&(Bk(a),l.needsUpdate=!0),y.sdfTotal=xc()-R,y.total=xc()-t,e(Object.freeze({parameters:n,sdfTexture:l,sdfGlyphSize:s,sdfExponent:i,glyphBounds:_,glyphAtlasIndices:p,glyphColors:f.glyphColors,caretPositions:f.caretPositions,caretHeight:f.caretHeight,chunkedBounds:f.chunkedBounds,ascender:f.ascender,descender:f.descender,lineHeight:f.lineHeight,capHeight:f.capHeight,xHeight:f.xHeight,topBaseline:f.topBaseline,blockBounds:f.blockBounds,visibleBounds:f.visibleBounds,timings:f.timings}))})}),Promise.resolve().then(()=>{a.contextLost||QK(u)})}function Rk({path:n,atlasIndex:e,sdfViewBox:t},{sdfGlyphSize:r,sdfCanvas:i,contextLost:s},o){if(s)return Promise.resolve({timing:-1});const{textureWidth:a,sdfExponent:l}=Hc,u=Math.max(t[2]-t[0],t[3]-t[1]),c=Math.floor(e/4),f=c%(a/r)*r,p=Math.floor(c/(a/r))*r,m=e%4;return JK(r,r,n,t,u,l,i,f,p,m,o)}function iZ(n){const e=n.sdfCanvas;e.addEventListener("webglcontextlost",t=>{console.log("Context Lost",t),t.preventDefault(),n.contextLost=!0}),e.addEventListener("webglcontextrestored",t=>{console.log("Context Restored",t),n.contextLost=!1;const r=[];n.glyphsByFont.forEach(i=>{i.forEach(s=>{r.push(Rk(s,n,!0))})}),Promise.all(r).then(()=>{Bk(n),n.sdfTexture.needsUpdate=!0})})}function sZ({font:n,characters:e,sdfGlyphSize:t},r){let i=Array.isArray(e)?e.join(` -`):""+e;Tk({font:n,sdfGlyphSize:t,text:i},r)}function oZ(n,e){for(let t in e)e.hasOwnProperty(t)&&(n[t]=e[t]);return n}let Kg;function aZ(n){return Kg||(Kg=typeof document>"u"?{}:document.createElement("a")),Kg.href=n,Kg.href}function Bk(n){if(typeof createImageBitmap!="function"){console.info("Safari<15: applying SDF canvas workaround");const{sdfCanvas:e,sdfTexture:t}=n,{width:r,height:i}=e,s=n.sdfCanvas.getContext("webgl");let o=t.image.data;(!o||o.length!==r*i*4)&&(o=new Uint8Array(r*i*4),t.image={width:r,height:i,data:o},t.flipY=!1,t.isDataTexture=!0),s.readPixels(0,0,r,i,s.RGBA,s.UNSIGNED_BYTE,o)}}const lZ=Vp({name:"Typesetter",dependencies:[Hc,nZ,WK,FK],init(n,e,t,r){const{defaultFontURL:i}=n;return t(e,r(),{defaultFontURL:i})}}),uZ=Vp({name:"Typesetter",dependencies:[lZ],init(n){return function(e){return new Promise(t=>{n.typeset(e,t)})}},getTransferables(n){const e=[n.glyphPositions.buffer,n.glyphIds.buffer];return n.caretPositions&&e.push(n.caretPositions.buffer),n.glyphColors&&e.push(n.glyphColors.buffer),e}}),uR={};function cZ(n){let e=uR[n];if(!e){const t=new Ro(1,1,n,n),r=t.clone(),i=t.attributes,s=r.attributes,o=new Ut,a=i.uv.count;for(let l=0;l{o.setAttribute(l,new xt([...i[l].array,...s[l].array],i[l].itemSize))}),o.setIndex([...t.index.array,...r.index.array.map(l=>l+a)]),o.translate(.5,.5,0),e=uR[n]=o}return e}const fZ="aTroikaGlyphBounds",cR="aTroikaGlyphIndex",hZ="aTroikaGlyphColor";class dZ extends t2{constructor(){super(),this.detail=1,this.curveRadius=0,this.groups=[{start:0,count:1/0,materialIndex:0},{start:0,count:1/0,materialIndex:1}],this.boundingSphere=new To,this.boundingBox=new Zs}computeBoundingSphere(){}computeBoundingBox(){}setSide(e){const t=this.getIndex().count;this.setDrawRange(e===vi?t/2:0,e===$i?t:t/2)}set detail(e){if(e!==this._detail){this._detail=e,(typeof e!="number"||e<1)&&(e=1);let t=cZ(e);["position","normal","uv"].forEach(r=>{this.attributes[r]=t.attributes[r].clone()}),this.setIndex(t.getIndex().clone())}}get detail(){return this._detail}set curveRadius(e){e!==this._curveRadius&&(this._curveRadius=e,this._updateBounds())}get curveRadius(){return this._curveRadius}updateGlyphs(e,t,r,i,s){t_(this,fZ,e,4),t_(this,cR,t,1),t_(this,hZ,s,3),this._blockBounds=r,this._chunkedBounds=i,this.instanceCount=t.length,this._updateBounds()}_updateBounds(){const e=this._blockBounds;if(e){const{curveRadius:t,boundingBox:r}=this;if(t){const{PI:i,floor:s,min:o,max:a,sin:l,cos:u}=Math,c=i/2,f=i*2,p=Math.abs(t),m=e[0]/p,g=e[2]/p,v=s((m+c)/f)!==s((g+c)/f)?-p:o(l(m)*p,l(g)*p),y=s((m-c)/f)!==s((g-c)/f)?p:a(l(m)*p,l(g)*p),w=s((m+i)/f)!==s((g+i)/f)?p*2:a(p-u(m)*p,p-u(g)*p);r.min.set(v,e[1],t<0?-w:0),r.max.set(y,e[3],t<0?0:w)}else r.min.set(e[0],e[1],0),r.max.set(e[2],e[3],0);r.getBoundingSphere(this.boundingSphere)}}applyClipRect(e){let t=this.getAttribute(cR).count,r=this._chunkedBounds;if(r)for(let i=r.length;i--;){t=r[i].end;let s=r[i].rect;if(s[1]e.y&&s[0]e.x)break}this.instanceCount=t}}function t_(n,e,t,r){const i=n.getAttribute(e);t?i&&i.array.length===t.length?(i.array.set(t),i.needsUpdate=!0):(n.setAttribute(e,new Ru(t,r)),delete n._maxInstanceCount,n.dispose()):i&&n.deleteAttribute(e)}const pZ=` -uniform vec2 uTroikaSDFTextureSize; -uniform float uTroikaSDFGlyphSize; -uniform vec4 uTroikaTotalBounds; -uniform vec4 uTroikaClipRect; -uniform mat3 uTroikaOrient; -uniform bool uTroikaUseGlyphColors; -uniform float uTroikaDistanceOffset; -uniform float uTroikaBlurRadius; -uniform vec2 uTroikaPositionOffset; -uniform float uTroikaCurveRadius; -attribute vec4 aTroikaGlyphBounds; -attribute float aTroikaGlyphIndex; -attribute vec3 aTroikaGlyphColor; -varying vec2 vTroikaGlyphUV; -varying vec4 vTroikaTextureUVBounds; -varying float vTroikaTextureChannel; -varying vec3 vTroikaGlyphColor; -varying vec2 vTroikaGlyphDimensions; -`,mZ=` -vec4 bounds = aTroikaGlyphBounds; -bounds.xz += uTroikaPositionOffset.x; -bounds.yw -= uTroikaPositionOffset.y; - -vec4 outlineBounds = vec4( - bounds.xy - uTroikaDistanceOffset - uTroikaBlurRadius, - bounds.zw + uTroikaDistanceOffset + uTroikaBlurRadius -); -vec4 clippedBounds = vec4( - clamp(outlineBounds.xy, uTroikaClipRect.xy, uTroikaClipRect.zw), - clamp(outlineBounds.zw, uTroikaClipRect.xy, uTroikaClipRect.zw) -); - -vec2 clippedXY = (mix(clippedBounds.xy, clippedBounds.zw, position.xy) - bounds.xy) / (bounds.zw - bounds.xy); - -position.xy = mix(bounds.xy, bounds.zw, clippedXY); - -uv = (position.xy - uTroikaTotalBounds.xy) / (uTroikaTotalBounds.zw - uTroikaTotalBounds.xy); - -float rad = uTroikaCurveRadius; -if (rad != 0.0) { - float angle = position.x / rad; - position.xz = vec2(sin(angle) * rad, rad - cos(angle) * rad); - normal.xz = vec2(sin(angle), cos(angle)); -} - -position = uTroikaOrient * position; -normal = uTroikaOrient * normal; - -vTroikaGlyphUV = clippedXY.xy; -vTroikaGlyphDimensions = vec2(bounds[2] - bounds[0], bounds[3] - bounds[1]); - - -float txCols = uTroikaSDFTextureSize.x / uTroikaSDFGlyphSize; -vec2 txUvPerSquare = uTroikaSDFGlyphSize / uTroikaSDFTextureSize; -vec2 txStartUV = txUvPerSquare * vec2( - mod(floor(aTroikaGlyphIndex / 4.0), txCols), - floor(floor(aTroikaGlyphIndex / 4.0) / txCols) -); -vTroikaTextureUVBounds = vec4(txStartUV, vec2(txStartUV) + txUvPerSquare); -vTroikaTextureChannel = mod(aTroikaGlyphIndex, 4.0); -`,gZ=` -uniform sampler2D uTroikaSDFTexture; -uniform vec2 uTroikaSDFTextureSize; -uniform float uTroikaSDFGlyphSize; -uniform float uTroikaSDFExponent; -uniform float uTroikaDistanceOffset; -uniform float uTroikaFillOpacity; -uniform float uTroikaOutlineOpacity; -uniform float uTroikaBlurRadius; -uniform vec3 uTroikaStrokeColor; -uniform float uTroikaStrokeWidth; -uniform float uTroikaStrokeOpacity; -uniform bool uTroikaSDFDebug; -varying vec2 vTroikaGlyphUV; -varying vec4 vTroikaTextureUVBounds; -varying float vTroikaTextureChannel; -varying vec2 vTroikaGlyphDimensions; - -float troikaSdfValueToSignedDistance(float alpha) { - // Inverse of exponential encoding in webgl-sdf-generator - - float maxDimension = max(vTroikaGlyphDimensions.x, vTroikaGlyphDimensions.y); - float absDist = (1.0 - pow(2.0 * (alpha > 0.5 ? 1.0 - alpha : alpha), 1.0 / uTroikaSDFExponent)) * maxDimension; - float signedDist = absDist * (alpha > 0.5 ? -1.0 : 1.0); - return signedDist; -} - -float troikaGlyphUvToSdfValue(vec2 glyphUV) { - vec2 textureUV = mix(vTroikaTextureUVBounds.xy, vTroikaTextureUVBounds.zw, glyphUV); - vec4 rgba = texture2D(uTroikaSDFTexture, textureUV); - float ch = floor(vTroikaTextureChannel + 0.5); //NOTE: can't use round() in WebGL1 - return ch == 0.0 ? rgba.r : ch == 1.0 ? rgba.g : ch == 2.0 ? rgba.b : rgba.a; -} - -float troikaGlyphUvToDistance(vec2 uv) { - return troikaSdfValueToSignedDistance(troikaGlyphUvToSdfValue(uv)); -} - -float troikaGetAADist() { - - #if defined(GL_OES_standard_derivatives) || __VERSION__ >= 300 - return length(fwidth(vTroikaGlyphUV * vTroikaGlyphDimensions)) * 0.5; - #else - return vTroikaGlyphDimensions.x / 64.0; - #endif -} - -float troikaGetFragDistValue() { - vec2 clampedGlyphUV = clamp(vTroikaGlyphUV, 0.5 / uTroikaSDFGlyphSize, 1.0 - 0.5 / uTroikaSDFGlyphSize); - float distance = troikaGlyphUvToDistance(clampedGlyphUV); - - // Extrapolate distance when outside bounds: - distance += clampedGlyphUV == vTroikaGlyphUV ? 0.0 : - length((vTroikaGlyphUV - clampedGlyphUV) * vTroikaGlyphDimensions); - - - - return distance; -} - -float troikaGetEdgeAlpha(float distance, float distanceOffset, float aaDist) { - #if defined(IS_DEPTH_MATERIAL) || defined(IS_DISTANCE_MATERIAL) - float alpha = step(-distanceOffset, -distance); - #else - - float alpha = smoothstep( - distanceOffset + aaDist, - distanceOffset - aaDist, - distance - ); - #endif - - return alpha; -} -`,vZ=` -float aaDist = troikaGetAADist(); -float fragDistance = troikaGetFragDistValue(); -float edgeAlpha = uTroikaSDFDebug ? - troikaGlyphUvToSdfValue(vTroikaGlyphUV) : - troikaGetEdgeAlpha(fragDistance, uTroikaDistanceOffset, max(aaDist, uTroikaBlurRadius)); - -#if !defined(IS_DEPTH_MATERIAL) && !defined(IS_DISTANCE_MATERIAL) -vec4 fillRGBA = gl_FragColor; -fillRGBA.a *= uTroikaFillOpacity; -vec4 strokeRGBA = uTroikaStrokeWidth == 0.0 ? fillRGBA : vec4(uTroikaStrokeColor, uTroikaStrokeOpacity); -if (fillRGBA.a == 0.0) fillRGBA.rgb = strokeRGBA.rgb; -gl_FragColor = mix(fillRGBA, strokeRGBA, smoothstep( - -uTroikaStrokeWidth - aaDist, - -uTroikaStrokeWidth + aaDist, - fragDistance -)); -gl_FragColor.a *= edgeAlpha; -#endif - -if (edgeAlpha == 0.0) { - discard; -} -`;function yZ(n){const e=DS(n,{chained:!0,extensions:{derivatives:!0},uniforms:{uTroikaSDFTexture:{value:null},uTroikaSDFTextureSize:{value:new ze},uTroikaSDFGlyphSize:{value:0},uTroikaSDFExponent:{value:0},uTroikaTotalBounds:{value:new vn(0,0,0,0)},uTroikaClipRect:{value:new vn(0,0,0,0)},uTroikaDistanceOffset:{value:0},uTroikaOutlineOpacity:{value:0},uTroikaFillOpacity:{value:1},uTroikaPositionOffset:{value:new ze},uTroikaCurveRadius:{value:0},uTroikaBlurRadius:{value:0},uTroikaStrokeWidth:{value:0},uTroikaStrokeColor:{value:new st},uTroikaStrokeOpacity:{value:1},uTroikaOrient:{value:new Rr},uTroikaUseGlyphColors:{value:!0},uTroikaSDFDebug:{value:!1}},vertexDefs:pZ,vertexTransform:mZ,fragmentDefs:gZ,fragmentColorTransform:vZ,customRewriter({vertexShader:t,fragmentShader:r}){let i=/\buniform\s+vec3\s+diffuse\b/;return i.test(r)&&(r=r.replace(i,"varying vec3 vTroikaGlyphColor").replace(/\bdiffuse\b/g,"vTroikaGlyphColor"),i.test(t)||(t=t.replace(Ck,`uniform vec3 diffuse; -$& -vTroikaGlyphColor = uTroikaUseGlyphColors ? aTroikaGlyphColor / 255.0 : diffuse; -`))),{vertexShader:t,fragmentShader:r}}});return e.transparent=!0,Object.defineProperties(e,{isTroikaTextMaterial:{value:!0},shadowSide:{get(){return this.side},set(){}}}),e}const p2=new Ii({color:16777215,side:$i,transparent:!0}),fR=8421504,hR=new Lt,Zg=new Z,n_=new Z,Oh=[],xZ=new Z,r_="+x+y";function dR(n){return Array.isArray(n)?n[0]:n}let Pk=()=>{const n=new Vn(new Ro(1,1),p2);return Pk=()=>n,n},Ik=()=>{const n=new Vn(new Ro(1,1,32,1),p2);return Ik=()=>n,n};const _Z={type:"syncstart"},wZ={type:"synccomplete"},Lk=["font","fontSize","letterSpacing","lineHeight","maxWidth","overflowWrap","text","direction","textAlign","textIndent","whiteSpace","anchorX","anchorY","colorRanges","sdfGlyphSize"],SZ=Lk.concat("material","color","depthOffset","clipRect","curveRadius","orientation","glyphGeometryDetail");let Dk=class extends Vn{constructor(){const e=new dZ;super(e,null),this.text="",this.anchorX=0,this.anchorY=0,this.curveRadius=0,this.direction="auto",this.font=null,this.fontSize=.1,this.letterSpacing=0,this.lineHeight="normal",this.maxWidth=1/0,this.overflowWrap="normal",this.textAlign="left",this.textIndent=0,this.whiteSpace="normal",this.material=null,this.color=null,this.colorRanges=null,this.outlineWidth=0,this.outlineColor=0,this.outlineOpacity=1,this.outlineBlur=0,this.outlineOffsetX=0,this.outlineOffsetY=0,this.strokeWidth=0,this.strokeColor=fR,this.strokeOpacity=1,this.fillOpacity=1,this.depthOffset=0,this.clipRect=null,this.orientation=r_,this.glyphGeometryDetail=1,this.sdfGlyphSize=null,this.gpuAccelerateSDF=!0,this.debugSDF=!1}sync(e){this._needsSync&&(this._needsSync=!1,this._isSyncing?(this._queuedSyncs||(this._queuedSyncs=[])).push(e):(this._isSyncing=!0,this.dispatchEvent(_Z),Tk({text:this.text,font:this.font,fontSize:this.fontSize||.1,letterSpacing:this.letterSpacing||0,lineHeight:this.lineHeight||"normal",maxWidth:this.maxWidth,direction:this.direction||"auto",textAlign:this.textAlign,textIndent:this.textIndent,whiteSpace:this.whiteSpace,overflowWrap:this.overflowWrap,anchorX:this.anchorX,anchorY:this.anchorY,colorRanges:this.colorRanges,includeCaretPositions:!0,sdfGlyphSize:this.sdfGlyphSize,gpuAccelerateSDF:this.gpuAccelerateSDF},t=>{this._isSyncing=!1,this._textRenderInfo=t,this.geometry.updateGlyphs(t.glyphBounds,t.glyphAtlasIndices,t.blockBounds,t.chunkedBounds,t.glyphColors);const r=this._queuedSyncs;r&&(this._queuedSyncs=null,this._needsSync=!0,this.sync(()=>{r.forEach(i=>i&&i())})),this.dispatchEvent(wZ),e&&e()})))}onBeforeRender(e,t,r,i,s,o){this.sync(),s.isTroikaTextMaterial&&this._prepareForRender(s),s._hadOwnSide=s.hasOwnProperty("side"),this.geometry.setSide(s._actualSide=s.side),s.side=Ys}onAfterRender(e,t,r,i,s,o){s._hadOwnSide?s.side=s._actualSide:delete s.side}dispose(){this.geometry.dispose()}get textRenderInfo(){return this._textRenderInfo||null}get material(){let e=this._derivedMaterial;const t=this._baseMaterial||this._defaultMaterial||(this._defaultMaterial=p2.clone());if((!e||e.baseMaterial!==t)&&(e=this._derivedMaterial=yZ(t),t.addEventListener("dispose",function r(){t.removeEventListener("dispose",r),e.dispose()})),this.outlineWidth||this.outlineBlur||this.outlineOffsetX||this.outlineOffsetY){let r=e._outlineMtl;return r||(r=e._outlineMtl=Object.create(e,{id:{value:e.id+.1}}),r.isTextOutlineMaterial=!0,r.depthWrite=!1,r.map=null,e.addEventListener("dispose",function i(){e.removeEventListener("dispose",i),r.dispose()})),[r,e]}else return e}set material(e){e&&e.isTroikaTextMaterial?(this._derivedMaterial=e,this._baseMaterial=e.baseMaterial):this._baseMaterial=e}get glyphGeometryDetail(){return this.geometry.detail}set glyphGeometryDetail(e){this.geometry.detail=e}get curveRadius(){return this.geometry.curveRadius}set curveRadius(e){this.geometry.curveRadius=e}get customDepthMaterial(){return dR(this.material).getDepthMaterial()}get customDistanceMaterial(){return dR(this.material).getDistanceMaterial()}_prepareForRender(e){const t=e.isTextOutlineMaterial,r=e.uniforms,i=this.textRenderInfo;if(i){const{sdfTexture:a,blockBounds:l}=i;r.uTroikaSDFTexture.value=a,r.uTroikaSDFTextureSize.value.set(a.image.width,a.image.height),r.uTroikaSDFGlyphSize.value=i.sdfGlyphSize,r.uTroikaSDFExponent.value=i.sdfExponent,r.uTroikaTotalBounds.value.fromArray(l),r.uTroikaUseGlyphColors.value=!t&&!!i.glyphColors;let u=0,c=0,f=0,p,m,g,v=0,y=0;if(t){let{outlineWidth:_,outlineOffsetX:x,outlineOffsetY:A,outlineBlur:C,outlineOpacity:b}=this;u=this._parsePercent(_)||0,c=Math.max(0,this._parsePercent(C)||0),p=b,v=this._parsePercent(x)||0,y=this._parsePercent(A)||0}else f=Math.max(0,this._parsePercent(this.strokeWidth)||0),f&&(g=this.strokeColor,r.uTroikaStrokeColor.value.set(g??fR),m=this.strokeOpacity,m==null&&(m=1)),p=this.fillOpacity;r.uTroikaDistanceOffset.value=u,r.uTroikaPositionOffset.value.set(v,y),r.uTroikaBlurRadius.value=c,r.uTroikaStrokeWidth.value=f,r.uTroikaStrokeOpacity.value=m,r.uTroikaFillOpacity.value=p??1,r.uTroikaCurveRadius.value=this.curveRadius||0;let w=this.clipRect;if(w&&Array.isArray(w)&&w.length===4)r.uTroikaClipRect.value.fromArray(w);else{const _=(this.fontSize||.1)*100;r.uTroikaClipRect.value.set(l[0]-_,l[1]-_,l[2]+_,l[3]+_)}this.geometry.applyClipRect(r.uTroikaClipRect.value)}r.uTroikaSDFDebug.value=!!this.debugSDF,e.polygonOffset=!!this.depthOffset,e.polygonOffsetFactor=e.polygonOffsetUnits=this.depthOffset||0;const s=t?this.outlineColor||0:this.color;if(s==null)delete e.color;else{const a=e.hasOwnProperty("color")?e.color:e.color=new st;(s!==a._input||typeof s=="object")&&a.set(a._input=s)}let o=this.orientation||r_;if(o!==e._orientation){let a=r.uTroikaOrient.value;o=o.replace(/[^-+xyz]/g,"");let l=o!==r_&&o.match(/^([-+])([xyz])([-+])([xyz])$/);if(l){let[,u,c,f,p]=l;Zg.set(0,0,0)[c]=u==="-"?1:-1,n_.set(0,0,0)[p]=f==="-"?-1:1,hR.lookAt(xZ,Zg.cross(n_),n_),a.setFromMatrix4(hR)}else a.identity();e._orientation=o}}_parsePercent(e){if(typeof e=="string"){let t=e.match(/^(-?[\d.]+)%$/),r=t?parseFloat(t[1]):NaN;e=(isNaN(r)?0:r/100)*this.fontSize}return e}localPositionToTextCoords(e,t=new ze){t.copy(e);const r=this.curveRadius;return r&&(t.x=Math.atan2(e.x,Math.abs(r)-Math.abs(e.z))*Math.abs(r)),t}worldPositionToTextCoords(e,t=new ze){return Zg.copy(e),this.localPositionToTextCoords(this.worldToLocal(Zg),t)}raycast(e,t){const{textRenderInfo:r,curveRadius:i}=this;if(r){const s=r.blockBounds,o=i?Ik():Pk(),a=o.geometry,{position:l,uv:u}=a.attributes;for(let c=0;c{this[r]=e[r]}),this}clone(){return new this.constructor().copy(this)}};Lk.forEach(n=>{const e="_private_"+n;Object.defineProperty(Dk.prototype,n,{get(){return this[e]},set(t){t!==this[e]&&(this[e]=t,this._needsSync=!0)}})});const AZ=n=>typeof n=="object"&&typeof n.then=="function",Qg=[];function MZ(n,e,t=(r,i)=>r===i){if(n===e)return!0;if(!n||!e)return!1;const r=n.length;if(e.length!==r)return!1;for(let i=0;i0&&(s.timeout&&clearTimeout(s.timeout),s.timeout=setTimeout(s.remove,r.lifespan)),s.response;if(!t)throw s.promise}const i={keys:e,equal:r.equal,remove:()=>{const s=Qg.indexOf(i);s!==-1&&Qg.splice(s,1)},promise:(AZ(n)?n:n(...e)).then(s=>{i.response=s,r.lifespan&&r.lifespan>0&&(i.timeout=setTimeout(i.remove,r.lifespan))}).catch(s=>i.error=s)};if(Qg.push(i),!t)throw i.promise}const CZ=(n,e,t)=>EZ(n,e,!1,t),gr=ee.forwardRef(({sdfGlyphSize:n=64,anchorX:e="center",anchorY:t="middle",font:r,fontSize:i=1,children:s,characters:o,onSync:a,...l},u)=>{const c=bn(({invalidate:g})=>g),[f]=ee.useState(()=>new Dk),[p,m]=ee.useMemo(()=>{const g=[];let v="";return ee.Children.forEach(s,y=>{typeof y=="string"||typeof y=="number"?v+=y:g.push(y)}),[g,v]},[s]);return CZ(()=>new Promise(g=>sZ({font:r,characters:o},g)),["troika-text",r,o]),ee.useLayoutEffect(()=>void f.sync(()=>{c(),a&&a(f)})),ee.useEffect(()=>()=>f.dispose(),[f]),ee.createElement("primitive",Tr({object:f,ref:u,font:r,text:m,anchorX:e,anchorY:t,fontSize:i,sdfGlyphSize:n},l),p)});function kk(n,e,t,r){const i=class extends Oi{constructor(o={}){const a=Object.entries(n);super({uniforms:a.reduce((l,[u,c])=>{const f=gy.clone({[u]:{value:c}});return{...l,...f}},{}),vertexShader:e,fragmentShader:t}),this.key="",a.forEach(([l])=>Object.defineProperty(this,l,{get:()=>this.uniforms[l].value,set:u=>this.uniforms[l].value=u})),Object.assign(this,o),r&&r(this)}};return i.key=go.generateUUID(),i}let qg=null;function Fk(n,e,t){return r=>{t&&t(r),n&&(qg||(qg=new TK),qg.setDecoderPath(typeof n=="string"?n:"https://www.gstatic.com/draco/versioned/decoders/1.5.5/"),r.setDRACOLoader(qg)),e&&r.setMeshoptDecoder(typeof $x=="function"?$x():$x)}}function Uf(n,e=!0,t=!0,r){return Nf(d2,n,Fk(e,t,r))}Uf.preload=(n,e=!0,t=!0,r)=>Nf.preload(d2,n,Fk(e,t,r));Uf.clear=n=>Nf.clear(d2,n);function Nk(n,e,t){const r=bn(p=>p.size),i=bn(p=>p.viewport),s=typeof n=="number"?n:r.width*i.dpr,o=typeof e=="number"?e:r.height*i.dpr,a=(typeof n=="number"?t:n)||{},{samples:l=0,depth:u,...c}=a,f=ee.useMemo(()=>{const p=new ri(s,o,{minFilter:gn,magFilter:gn,type:Gr,...c});return u&&(p.depthTexture=new PM(s,o,zr)),p.samples=l,p},[]);return ee.useLayoutEffect(()=>{f.setSize(s,o),l&&(f.samples=l)},[l,f,s,o]),ee.useEffect(()=>()=>f.dispose(),[]),f}const bZ=n=>typeof n=="function",Cr=ee.forwardRef(({envMap:n,resolution:e=256,frames:t=1/0,makeDefault:r,children:i,...s},o)=>{const a=bn(({set:y})=>y),l=bn(({camera:y})=>y),u=bn(({size:y})=>y),c=ee.useRef(null),f=ee.useRef(null),p=Nk(e);ee.useLayoutEffect(()=>{s.manual||(c.current.aspect=u.width/u.height)},[u,s]),ee.useLayoutEffect(()=>{c.current.updateProjectionMatrix()});let m=0,g=null;const v=bZ(i);return Sl(y=>{v&&(t===1/0||m{if(r){const y=l;return a(()=>({camera:c.current})),()=>a(()=>({camera:y}))}},[c,r,a]),ee.createElement(ee.Fragment,null,ee.createElement("perspectiveCamera",Tr({ref:bY([c,o])},s),!v&&i),ee.createElement("group",{ref:f},v&&i(p.texture)))}),zf=ee.forwardRef(({makeDefault:n,camera:e,regress:t,domElement:r,enableDamping:i=!0,keyEvents:s=!1,onChange:o,onStart:a,onEnd:l,...u},c)=>{const f=bn(b=>b.invalidate),p=bn(b=>b.camera),m=bn(b=>b.gl),g=bn(b=>b.events),v=bn(b=>b.setEvents),y=bn(b=>b.set),w=bn(b=>b.get),_=bn(b=>b.performance),x=e||p,A=r||g.connected||m.domElement,C=ee.useMemo(()=>new JY(x),[x]);return Sl(()=>{C.enabled&&C.update()},-1),ee.useEffect(()=>(s&&C.connect(s===!0?A:s),C.connect(A),()=>void C.dispose()),[s,A,t,C,f]),ee.useEffect(()=>{const b=B=>{f(),t&&_.regress(),o&&o(B)},R=B=>{a&&a(B)},E=B=>{l&&l(B)};return C.addEventListener("change",b),C.addEventListener("start",R),C.addEventListener("end",E),()=>{C.removeEventListener("start",R),C.removeEventListener("end",E),C.removeEventListener("change",b)}},[o,a,l,C,f,v]),ee.useEffect(()=>{if(n){const b=w().controls;return y({controls:C}),()=>y({controls:b})}},[n,C]),ee.createElement("primitive",Tr({ref:c,object:C,enableDamping:i},u))}),TZ=ee.forwardRef(function({children:e,disable:t,disableX:r,disableY:i,disableZ:s,left:o,right:a,top:l,bottom:u,front:c,back:f,onCentered:p,precise:m=!0,cacheKey:g=0,...v},y){const w=ee.useRef(null),_=ee.useRef(null),x=ee.useRef(null);return ee.useLayoutEffect(()=>{_.current.matrixWorld.identity();const A=new Zs().setFromObject(x.current,m),C=new Z,b=new To,R=A.max.x-A.min.x,E=A.max.y-A.min.y,B=A.max.z-A.min.z;A.getCenter(C),A.getBoundingSphere(b);const D=l?E/2:u?-E/2:0,U=o?-R/2:a?R/2:0,z=c?B/2:f?-B/2:0;_.current.position.set(t||r?0:-C.x+U,t||i?0:-C.y+D,t||s?0:-C.z+z),typeof p<"u"&&p({parent:w.current.parent,container:w.current,width:R,height:E,depth:B,boundingBox:A,boundingSphere:b,center:C,verticalAlignment:D,horizontalAlignment:U,depthAlignment:z})},[g,p,l,o,c,t,r,i,s,m,a,u,f]),ee.useImperativeHandle(y,()=>w.current,[]),ee.createElement("group",Tr({ref:w},v),ee.createElement("group",{ref:_},ee.createElement("group",{ref:x},e)))});var RZ=`#define GLSLIFY 1 -vec3 mod289(vec3 x){return x-floor(x*(1.0/289.0))*289.0;}vec4 mod289(vec4 x){return x-floor(x*(1.0/289.0))*289.0;}vec4 permute(vec4 x){return mod289(((x*34.0)+1.0)*x);}vec4 taylorInvSqrt(vec4 r){return 1.79284291400159-0.85373472095314*r;}float snoise(vec3 v){const vec2 C=vec2(1.0/6.0,1.0/3.0);const vec4 D=vec4(0.0,0.5,1.0,2.0);vec3 i=floor(v+dot(v,C.yyy));vec3 x0=v-i+dot(i,C.xxx);vec3 g=step(x0.yzx,x0.xyz);vec3 l=1.0-g;vec3 i1=min(g.xyz,l.zxy);vec3 i2=max(g.xyz,l.zxy);vec3 x1=x0-i1+C.xxx;vec3 x2=x0-i2+C.yyy;vec3 x3=x0-D.yyy;i=mod289(i);vec4 p=permute(permute(permute(i.z+vec4(0.0,i1.z,i2.z,1.0))+i.y+vec4(0.0,i1.y,i2.y,1.0))+i.x+vec4(0.0,i1.x,i2.x,1.0));float n_=0.142857142857;vec3 ns=n_*D.wyz-D.xzx;vec4 j=p-49.0*floor(p*ns.z*ns.z);vec4 x_=floor(j*ns.z);vec4 y_=floor(j-7.0*x_);vec4 x=x_*ns.x+ns.yyyy;vec4 y=y_*ns.x+ns.yyyy;vec4 h=1.0-abs(x)-abs(y);vec4 b0=vec4(x.xy,y.xy);vec4 b1=vec4(x.zw,y.zw);vec4 s0=floor(b0)*2.0+1.0;vec4 s1=floor(b1)*2.0+1.0;vec4 sh=-step(h,vec4(0.0));vec4 a0=b0.xzyw+s0.xzyw*sh.xxyy;vec4 a1=b1.xzyw+s1.xzyw*sh.zzww;vec3 p0=vec3(a0.xy,h.x);vec3 p1=vec3(a0.zw,h.y);vec3 p2=vec3(a1.xy,h.z);vec3 p3=vec3(a1.zw,h.w);vec4 norm=taylorInvSqrt(vec4(dot(p0,p0),dot(p1,p1),dot(p2,p2),dot(p3,p3)));p0*=norm.x;p1*=norm.y;p2*=norm.z;p3*=norm.w;vec4 m=max(0.6-vec4(dot(x0,x0),dot(x1,x1),dot(x2,x2),dot(x3,x3)),0.0);m=m*m;return 42.0*dot(m*m,vec4(dot(p0,x0),dot(p1,x1),dot(p2,x2),dot(p3,x3)));}`;class BZ extends $s{constructor(e={}){super(e),this.setValues(e),this._time={value:0},this._distort={value:.4},this._radius={value:1}}onBeforeCompile(e){e.uniforms.time=this._time,e.uniforms.radius=this._radius,e.uniforms.distort=this._distort,e.vertexShader=` - uniform float time; - uniform float radius; - uniform float distort; - ${RZ} - ${e.vertexShader} - `,e.vertexShader=e.vertexShader.replace("#include ",` - float updateTime = time / 50.0; - float noise = snoise(vec3(position / 2.0 + updateTime * 5.0)); - vec3 transformed = vec3(position * (noise * pow(distort, 2.0) + radius)); - `)}get time(){return this._time.value}set time(e){this._time.value=e}get distort(){return this._distort.value}set distort(e){this._distort.value=e}get radius(){return this._radius.value}set radius(e){this._radius.value=e}}const PZ=ee.forwardRef(({speed:n=1,...e},t)=>{const[r]=ee.useState(()=>new BZ);return Sl(i=>r&&(r.time=i.clock.getElapsedTime()*n)),ee.createElement("primitive",Tr({object:r,ref:t,attach:"material"},e))}),IZ=kk({},"void main() { }","void main() { gl_FragColor = vec4(0.0, 0.0, 0.0, 0.0); discard; }");function LZ(n,e){const t=n+"Geometry";return ee.forwardRef(({args:r,children:i,...s},o)=>{const a=ee.useRef(null);return ee.useImperativeHandle(o,()=>a.current),ee.useLayoutEffect(()=>void(e==null?void 0:e(a.current))),ee.createElement("mesh",Tr({ref:a},s),ee.createElement(t,{attach:"geometry",args:r}),i)})}const DZ=LZ("sphere"),_c=n=>n&&n.isOrthographicCamera,kZ=n=>n&&n.isBox3,Ok=ee.createContext(null);function FZ({children:n,damping:e=6,fit:t,clip:r,observe:i,margin:s=1.2,eps:o=.01,onFit:a}){const l=ee.useRef(null),{camera:u,invalidate:c,size:f,controls:p}=bn(),m=p,g=ee.useRef(a);g.current=a;function v(b,R){return Math.abs(b.x-R.x)({animating:!1,focus:new Z,camera:new Z,zoom:1})),[_]=ee.useState(()=>({focus:new Z,camera:new Z,zoom:1})),[x]=ee.useState(()=>new Zs),A=ee.useMemo(()=>{function b(){const R=x.getSize(new Z),E=x.getCenter(new Z),B=Math.max(R.x,R.y,R.z),D=_c(u)?B*4:B/(2*Math.atan(Math.PI*u.fov/360)),U=_c(u)?B*4:D/u.aspect,z=s*Math.max(D,U);return{box:x,size:R,center:E,distance:z}}return{getSize:b,refresh(R){if(kZ(R))x.copy(R);else{const E=R||l.current;E.updateWorldMatrix(!0,!0),x.setFromObject(E)}if(x.isEmpty()){const E=u.position.length()||10;x.setFromCenterAndSize(new Z,new Z(E,E,E))}if((m==null?void 0:m.constructor.name)==="OrthographicTrackballControls"){const{distance:E}=b(),B=u.position.clone().sub(m.target).normalize().multiplyScalar(E),D=m.target.clone().add(B);u.position.copy(D)}return this},clip(){const{distance:R}=b();return m&&(m.maxDistance=R*10),u.near=R/100,u.far=R*100,u.updateProjectionMatrix(),m&&m.update(),c(),this},to({position:R,target:E}){w.camera.copy(u.position);const{center:B}=b();return _.camera.set(...R),E?_.focus.set(...E):_.focus.copy(B),e?w.animating=!0:u.position.set(...R),this},fit(){w.camera.copy(u.position),m&&w.focus.copy(m.target);const{center:R,distance:E}=b(),B=R.clone().sub(u.position).normalize().multiplyScalar(E);if(_.camera.copy(R).sub(B),_.focus.copy(R),_c(u)){w.zoom=u.zoom;let D=0,U=0;const z=[new Z(x.min.x,x.min.y,x.min.z),new Z(x.min.x,x.max.y,x.min.z),new Z(x.min.x,x.min.y,x.max.z),new Z(x.min.x,x.max.y,x.max.z),new Z(x.max.x,x.max.y,x.max.z),new Z(x.max.x,x.max.y,x.min.z),new Z(x.max.x,x.min.y,x.max.z),new Z(x.max.x,x.min.y,x.min.z)];R.applyMatrix4(u.matrixWorldInverse);for(const F of z)F.applyMatrix4(u.matrixWorldInverse),D=Math.max(D,Math.abs(F.y-R.y)),U=Math.max(U,Math.abs(F.x-R.x));D*=2,U*=2;const Y=(u.top-u.bottom)/D,P=(u.right-u.left)/U;_.zoom=Math.min(Y,P)/s,e||(u.zoom=_.zoom,u.updateProjectionMatrix())}return e?w.animating=!0:(u.position.copy(_.camera),u.lookAt(_.focus),m&&(m.target.copy(_.focus),m.update())),g.current&&g.current(this.getSize()),c(),this}}},[x,u,m,s,e,c]);ee.useLayoutEffect(()=>{if(m){const b=()=>w.animating=!1;return m.addEventListener("start",b),()=>m.removeEventListener("start",b)}},[m]);const C=ee.useRef(0);return ee.useLayoutEffect(()=>{(i||C.current++===0)&&(A.refresh(),t&&A.fit(),r&&A.clip())},[f,r,t,i,u,m]),Sl((b,R)=>{if(w.animating){if(y(w.focus,_.focus,e,R),y(w.camera,_.camera,e,R),w.zoom=go.damp(w.zoom,_.zoom,e,R),u.position.copy(w.camera),_c(u)&&(u.zoom=w.zoom,u.updateProjectionMatrix()),m?(m.target.copy(w.focus),m.update()):u.lookAt(w.focus),c(),_c(u)&&!(Math.abs(w.zoom-_.zoom)Array.isArray(n);function Uk({files:n=["/px.png","/nx.png","/py.png","/ny.png","/pz.png","/nz.png"],path:e="",preset:t=void 0,encoding:r=void 0,extensions:i}={}){var s;let o=null,a=!1,l;if(t){if(!(t in i_))throw new Error("Preset must be one of: "+Object.keys(i_).join(", "));n=i_[t],e=OZ}if(a=pR(n),l=pR(n)?"cube":n.startsWith("data:application/exr")?"exr":n.startsWith("data:application/hdr")?"hdr":(s=n.split(".").pop())==null?void 0:s.toLowerCase(),o=a?OD:l==="hdr"?CK:l==="exr"?bK:null,!o)throw new Error("useEnvironment: Unrecognized file extension: "+n);const u=Nf(o,a?[n]:n,m=>{m.setPath==null||m.setPath(e),i&&i(m)}),c=a?u[0]:u;c.mapping=a?da:gf;const f=3001,p=3e3;return"colorSpace"in c?c.colorSpace=r??a?"srgb":"srgb-linear":c.encoding=r??a?f:p,c}const UZ=n=>n.current&&n.current.isScene,zZ=n=>UZ(n)?n.current:n;function m2(n,e,t,r,i=0){const s=zZ(e||t),o=s.background,a=s.environment,l=s.backgroundBlurriness||0;return n!=="only"&&(s.environment=r),n&&(s.background=r),n&&s.backgroundBlurriness!==void 0&&(s.backgroundBlurriness=i),()=>{n!=="only"&&(s.environment=a),n&&(s.background=o),n&&s.backgroundBlurriness!==void 0&&(s.backgroundBlurriness=l)}}function g2({scene:n,background:e=!1,blur:t,map:r}){const i=bn(s=>s.scene);return ee.useLayoutEffect(()=>{if(r)return m2(e,n,i,r,t)},[i,n,r,e,t]),null}function zk({background:n=!1,scene:e,blur:t,...r}){const i=Uk(r),s=bn(o=>o.scene);return ee.useLayoutEffect(()=>m2(n,e,s,i,t),[i,n,e,s,t]),null}function GZ({children:n,near:e=1,far:t=1e3,resolution:r=256,frames:i=1,map:s,background:o=!1,blur:a,scene:l,files:u,path:c,preset:f=void 0,extensions:p}){const m=bn(x=>x.gl),g=bn(x=>x.scene),v=ee.useRef(null),[y]=ee.useState(()=>new wf),w=ee.useMemo(()=>{const x=new RM(r);return x.texture.type=Gr,x},[r]);ee.useLayoutEffect(()=>(i===1&&v.current.update(m,y),m2(o,l,g,w.texture,a)),[n,y,w.texture,l,g,o,i,m]);let _=1;return Sl(()=>{(i===1/0||_u2({GroundProjectedEnvImpl:HY}),[]);const a=ee.useMemo(()=>[o],[o]),l=(e=n.ground)==null?void 0:e.height,u=(t=n.ground)==null?void 0:t.radius,c=(r=(i=n.ground)==null?void 0:i.scale)!==null&&r!==void 0?r:1e3;return ee.createElement(ee.Fragment,null,ee.createElement(g2,Tr({},n,{map:o})),ee.createElement("groundProjectedEnvImpl",{args:a,scale:c,height:l,radius:u}))}function VZ(n){return n.ground?ee.createElement(HZ,n):n.map?ee.createElement(g2,n):n.children?ee.createElement(GZ,n):ee.createElement(zk,n)}const WZ=ee.forwardRef(({scale:n=10,frames:e=1/0,opacity:t=1,width:r=1,height:i=1,blur:s=1,near:o=0,far:a=10,resolution:l=512,smooth:u=!0,color:c="#000000",depthWrite:f=!1,renderOrder:p,...m},g)=>{const v=ee.useRef(null),y=bn(P=>P.scene),w=bn(P=>P.gl),_=ee.useRef(null);r=r*(Array.isArray(n)?n[0]:n||1),i=i*(Array.isArray(n)?n[1]:n||1);const[x,A,C,b,R,E,B]=ee.useMemo(()=>{const P=new ri(l,l),F=new ri(l,l);F.texture.generateMipmaps=P.texture.generateMipmaps=!1;const G=new Ro(r,i).rotateX(Math.PI/2),ie=new Vn(G),N=new Cp;N.depthTest=N.depthWrite=!1,N.onBeforeCompile=W=>{W.uniforms={...W.uniforms,ucolor:{value:new st(c)}},W.fragmentShader=W.fragmentShader.replace("void main() {",`uniform vec3 ucolor; - void main() { - `),W.fragmentShader=W.fragmentShader.replace("vec4( vec3( 1.0 - fragCoordZ ), opacity );","vec4( ucolor * fragCoordZ * 2.0, ( 1.0 - fragCoordZ ) * 1.0 );")};const V=new Oi(MK),j=new Oi(EK);return j.depthTest=V.depthTest=!1,[P,G,N,ie,V,j,F]},[l,r,i,n,c]),D=P=>{b.visible=!0,b.material=R,R.uniforms.tDiffuse.value=x.texture,R.uniforms.h.value=P*1/256,w.setRenderTarget(B),w.render(b,_.current),b.material=E,E.uniforms.tDiffuse.value=B.texture,E.uniforms.v.value=P*1/256,w.setRenderTarget(x),w.render(b,_.current),b.visible=!1};let U=0,z,Y;return Sl(()=>{_.current&&(e===1/0||Uv.current,[]),ee.createElement("group",Tr({"rotation-x":Math.PI/2},m,{ref:v}),ee.createElement("mesh",{renderOrder:p,geometry:A,scale:[1,-1,1],rotation:[-Math.PI/2,0,0]},ee.createElement("meshBasicMaterial",{transparent:!0,map:x.texture,opacity:t,depthWrite:f})),ee.createElement("orthographicCamera",{ref:_,args:[-r/2,r/2,i/2,-i/2,o,a]}))});function JZ(n){return n.isLight}function jZ(n){return!!n.geometry}const Gk=ee.createContext(null),XZ=kk({color:new st,blend:2,alphaTest:.75,opacity:0,map:null},`varying vec2 vUv; - void main() { - gl_Position = projectionMatrix * viewMatrix * modelMatrix * vec4(position, 1.); - vUv = uv; - }`,`varying vec2 vUv; - uniform sampler2D map; - uniform vec3 color; - uniform float opacity; - uniform float alphaTest; - uniform float blend; - void main() { - vec4 sampledDiffuseColor = texture2D(map, vUv); - gl_FragColor = vec4(color * sampledDiffuseColor.r * blend, max(0.0, (1.0 - (sampledDiffuseColor.r + sampledDiffuseColor.g + sampledDiffuseColor.b) / alphaTest)) * opacity); - #include - #include - }`),YZ=ee.forwardRef(({children:n,temporal:e,frames:t=40,limit:r=1/0,blend:i=20,scale:s=10,opacity:o=1,alphaTest:a=.75,color:l="black",colorBlend:u=2,resolution:c=1024,toneMapped:f=!0,...p},m)=>{u2({SoftShadowMaterial:XZ});const g=bn(b=>b.gl),v=bn(b=>b.scene),y=bn(b=>b.camera),w=bn(b=>b.invalidate),_=ee.useRef(null),x=ee.useRef(null),[A]=ee.useState(()=>new ZZ(g,v,c));ee.useLayoutEffect(()=>{A.configure(_.current)},[]);const C=ee.useMemo(()=>({lights:new Map,temporal:!!e,frames:Math.max(2,t),blend:Math.max(2,t===1/0?i:t),count:0,getMesh:()=>_.current,reset:()=>{A.clear();const b=_.current.material;b.opacity=0,b.alphaTest=0,C.count=0},update:(b=1)=>{const R=_.current.material;C.temporal?(R.opacity=Math.min(o,R.opacity+o/C.blend),R.alphaTest=Math.min(a,R.alphaTest+a/C.blend)):(R.opacity=o,R.alphaTest=a),x.current.visible=!0,A.prepare();for(let E=0;EB.update()),A.update(y,C.blend);x.current.visible=!1,A.finish()}}),[A,y,v,e,t,i,o,a]);return ee.useLayoutEffect(()=>{C.reset(),!C.temporal&&C.frames!==1/0&&C.update(C.blend)}),ee.useImperativeHandle(m,()=>C,[C]),Sl(()=>{(C.temporal||C.frames===1/0)&&C.countnull,ref:x},ee.createElement(Gk.Provider,{value:C},n)),ee.createElement("mesh",{receiveShadow:!0,ref:_,scale:s,rotation:[-Math.PI/2,0,0]},ee.createElement("planeGeometry",null),ee.createElement("softShadowMaterial",{transparent:!0,depthWrite:!1,toneMapped:f,color:l,blend:u,map:A.progressiveLightMap2.texture})))}),KZ=ee.forwardRef(({castShadow:n=!0,bias:e=.001,mapSize:t=512,size:r=5,near:i=.5,far:s=500,frames:o=1,position:a=[0,0,0],radius:l=1,amount:u=8,intensity:c=1,ambient:f=.5,...p},m)=>{const g=ee.useRef(null),v=new Z(...a).length(),y=ee.useContext(Gk),w=ee.useCallback(()=>{let x;if(g.current)for(let A=0;Af)x.position.set(a[0]+go.randFloatSpread(l),a[1]+go.randFloatSpread(l),a[2]+go.randFloatSpread(l));else{let C=Math.acos(2*Math.random()-1)-Math.PI/2,b=2*Math.PI*Math.random();x.position.set(Math.cos(C)*Math.cos(b)*v,Math.abs(Math.cos(C)*Math.sin(b)*v),Math.sin(C)*v)}},[l,f,v,...a]),_=ee.useMemo(()=>({update:w}),[w]);return ee.useImperativeHandle(m,()=>_,[_]),ee.useLayoutEffect(()=>{const x=g.current;return y&&y.lights.set(x.uuid,_),()=>void y.lights.delete(x.uuid)},[y,_]),ee.createElement("group",Tr({ref:g},p),Array.from({length:u},(x,A)=>ee.createElement("directionalLight",{key:A,castShadow:n,"shadow-bias":e,"shadow-mapSize":[t,t],intensity:c/u},ee.createElement("orthographicCamera",{attach:"shadow-camera",args:[-r,r,r,-r,i,s]}))))});class ZZ{constructor(e,t,r=1024){this.renderer=e,this.res=r,this.scene=t,this.buffer1Active=!1,this.lights=[],this.meshes=[],this.object=null,this.clearColor=new st,this.clearAlpha=0;const i=/(Android|iPad|iPhone|iPod)/g.test(navigator.userAgent)?Gr:zr;this.progressiveLightMap1=new ri(this.res,this.res,{type:i}),this.progressiveLightMap2=new ri(this.res,this.res,{type:i}),this.discardMat=new IZ,this.targetMat=new WM({fog:!1}),this.previousShadowMap={value:this.progressiveLightMap1.texture},this.averagingWindow={value:100},this.targetMat.onBeforeCompile=s=>{s.vertexShader=`varying vec2 vUv; -`+s.vertexShader.slice(0,-1)+"vUv = uv; gl_Position = vec4((uv - 0.5) * 2.0, 1.0, 1.0); }";const o=s.fragmentShader.indexOf("void main() {");s.fragmentShader=`varying vec2 vUv; -`+s.fragmentShader.slice(0,o)+`uniform sampler2D previousShadowMap; - uniform float averagingWindow; -`+s.fragmentShader.slice(o-1,-1)+` -vec3 texelOld = texture2D(previousShadowMap, vUv).rgb; - gl_FragColor.rgb = mix(texelOld, gl_FragColor.rgb, 1.0/ averagingWindow); - }`,s.uniforms.previousShadowMap=this.previousShadowMap,s.uniforms.averagingWindow=this.averagingWindow}}clear(){this.renderer.getClearColor(this.clearColor),this.clearAlpha=this.renderer.getClearAlpha(),this.renderer.setClearColor("black",1),this.renderer.setRenderTarget(this.progressiveLightMap1),this.renderer.clear(),this.renderer.setRenderTarget(this.progressiveLightMap2),this.renderer.clear(),this.renderer.setRenderTarget(null),this.renderer.setClearColor(this.clearColor,this.clearAlpha),this.lights=[],this.meshes=[],this.scene.traverse(e=>{jZ(e)?this.meshes.push({object:e,material:e.material}):JZ(e)&&this.lights.push({object:e,intensity:e.intensity})})}prepare(){this.lights.forEach(e=>e.object.intensity=0),this.meshes.forEach(e=>e.object.material=this.discardMat)}finish(){this.lights.forEach(e=>e.object.intensity=e.intensity),this.meshes.forEach(e=>e.object.material=e.material)}configure(e){this.object=e}update(e,t=100){if(!this.object)return;this.averagingWindow.value=t,this.object.material=this.targetMat;const r=this.buffer1Active?this.progressiveLightMap1:this.progressiveLightMap2,i=this.buffer1Active?this.progressiveLightMap2:this.progressiveLightMap1,s=this.scene.background;this.scene.background=null,this.renderer.setRenderTarget(r),this.previousShadowMap.value=i.texture,this.buffer1Active=!this.buffer1Active,this.renderer.render(this.scene,e),this.renderer.setRenderTarget(null),this.scene.background=s}}const QZ={rembrandt:{main:[1,2,1],fill:[-2,-.5,-2]},portrait:{main:[-1,2,.5],fill:[-1,.5,-1.5]},upfront:{main:[0,2,1],fill:[-1,.5,-1.5]},soft:{main:[-2,4,4],fill:[-1,.5,-1.5]}};function qZ({radius:n,adjustCamera:e}){const t=NZ();return ee.useEffect(()=>{e&&t.refresh().clip().fit()},[n,e]),null}function Hk({children:n,center:e,adjustCamera:t=!0,intensity:r=.5,shadows:i="contact",environment:s="city",preset:o="rembrandt",...a}){var l,u,c,f,p,m,g,v;const y=typeof o=="string"?QZ[o]:o,[{radius:w,height:_},x]=ee.useState({radius:0,width:0,height:0,depth:0}),A=(l=i==null?void 0:i.bias)!==null&&l!==void 0?l:-1e-4,C=(u=i==null?void 0:i.normalBias)!==null&&u!==void 0?u:0,b=(c=i==null?void 0:i.size)!==null&&c!==void 0?c:1024,R=(f=i==null?void 0:i.offset)!==null&&f!==void 0?f:0,E=i==="contact"||(i==null?void 0:i.type)==="contact",B=i==="accumulative"||(i==null?void 0:i.type)==="accumulative",D={...typeof i=="object"?i:{}},U=s?typeof s=="string"?{preset:s}:s:null,z=ee.useCallback(Y=>{const{width:P,height:F,depth:G,boundingSphere:ie}=Y;x({radius:ie.radius,width:P,height:F,depth:G}),e!=null&&e.onCentered&&e.onCentered(Y)},[]);return ee.createElement(ee.Fragment,null,ee.createElement("ambientLight",{intensity:r/3}),ee.createElement("spotLight",{penumbra:1,position:[y.main[0]*w,y.main[1]*w,y.main[2]*w],intensity:r*2,castShadow:!!i,"shadow-bias":A,"shadow-normalBias":C,"shadow-mapSize":b}),ee.createElement("pointLight",{position:[y.fill[0]*w,y.fill[1]*w,y.fill[2]*w],intensity:r}),ee.createElement(FZ,Tr({fit:!!t,clip:!!t,margin:Number(t),observe:!0},a),ee.createElement(qZ,{radius:w,adjustCamera:t}),ee.createElement(TZ,Tr({},e,{position:[0,R/2,0],onCentered:z}),n)),ee.createElement("group",{position:[0,-_/2-R/2,0]},E&&ee.createElement(WZ,Tr({scale:w*4,far:w,blur:2},D)),B&&ee.createElement(YZ,Tr({temporal:!0,frames:100,alphaTest:.9,toneMapped:!0,scale:w*4},D),ee.createElement(KZ,{amount:(p=D.amount)!==null&&p!==void 0?p:8,radius:(m=D.radius)!==null&&m!==void 0?m:w,ambient:(g=D.ambient)!==null&&g!==void 0?g:.5,intensity:(v=D.intensity)!==null&&v!==void 0?v:1,position:[y.main[0]*w,y.main[1]*w,y.main[2]*w],size:w*4,bias:-A,mapSize:b}))),s&&ee.createElement(VZ,U))}const br=ee.forwardRef(({children:n,compute:e,width:t,height:r,samples:i=8,renderPriority:s=0,eventPriority:o=0,frames:a=1/0,stencilBuffer:l=!1,depthBuffer:u=!0,generateMipmaps:c=!1,...f},p)=>{const{size:m,viewport:g}=bn(),v=Nk((t||m.width)*g.dpr,(r||m.height)*g.dpr,{samples:i,stencilBuffer:l,depthBuffer:u,generateMipmaps:c}),[y]=ee.useState(()=>new wf),w=ee.useCallback((_,x,A)=>{var C,b;let R=(C=v.texture)==null?void 0:C.__r3f.parent;for(;R&&!(R instanceof sn);)R=R.__r3f.parent;if(!R)return!1;A.raycaster.camera||A.events.compute(_,A,(b=A.previousRoot)==null?void 0:b.getState());const[E]=A.raycaster.intersectObject(R);if(!E)return!1;const B=E.uv;if(!B)return!1;x.raycaster.setFromCamera(x.pointer.set(B.x*2-1,B.y*2-1),x.camera)},[]);return ee.useImperativeHandle(p,()=>v.texture,[v]),ee.createElement(ee.Fragment,null,fk(ee.createElement($Z,{renderPriority:s,frames:a,fbo:v},n,ee.createElement("group",{onPointerOver:()=>null})),y,{events:{compute:e||w,priority:o}}),ee.createElement("primitive",Tr({object:v.texture},f)))});function $Z({frames:n,renderPriority:e,children:t,fbo:r}){let i=0,s;return Sl(o=>{(n===1/0||ihe(oQ,{id:"Home",children:Et(aQ,{children:[Et(lQ,{children:[he(uQ,{children:"Hello, I am Rui Jie"}),he(cQ,{children:"Aspiring Full-Stack Software Engineer"}),Et(fQ,{children:["I am a Singaporean Computer Science student skilled in Java, JavaScript and Python.",he("br",{}),he("br",{}),"Adept at working in teams and both frontend and backend programming, and pursuing a career in Software Engineering.",he("br",{}),he("br",{}),"My life motto is to be the best you can be, and I always strive for excellence in my work.",he("br",{}),he("br",{}),"Other languages/frameworks include React, React Native, GoLang, Node.js, Three.js, SQL, HTML and TailwindCSS."]}),Et(hQ,{children:[he(s_,{href:"https://github.com/rjkoh",target:"_blank",children:he(nQ,{size:40})}),he(s_,{href:"https://www.linkedin.com/in/kohruijie/",target:"_blank",children:he(rQ,{size:40})}),he(s_,{href:"#Contact",children:he(iQ,{size:40})})]})]}),he(dQ,{children:Et(Of,{children:[he(Hk,{environment:"city",children:he(sQ,{})}),he(zf,{autoRotate:!0})]})})]})}),mQ=pt.div` - display: flex; - flex-direction: column; - justify-content: space-around; - height: 80%; -`,gQ=()=>he(mQ,{children:Et(Of,{children:[he(zf,{enableZoom:!1,autoRotate:!0,autoRotateSpeed:5,rotation:!0}),he("ambientLight",{intensity:1}),Et("mesh",{children:[he("boxGeometry",{attach:"geometry",args:[2.5,2.5,2.5]}),he("meshStandardMaterial",{attach:"material-4",children:Et(br,{attach:"map",children:[he(Cr,{makeDefault:!0,position:[0,0,2]}),he("color",{attach:"background",args:["#bdbdbd"]}),he(gr,{fontSize:.5,color:"#e75902",children:"Java"})]})}),he("meshBasicMaterial",{attach:"material-1",children:Et(br,{attach:"map",children:[he(Cr,{makeDefault:!0,position:[0,0,2]}),he("color",{attach:"background",args:["#0c41ac"]}),he(gr,{fontSize:.5,color:"#deea00",children:"Python"})]})}),he("meshBasicMaterial",{attach:"material-0",children:Et(br,{attach:"map",children:[he(Cr,{makeDefault:!0,position:[0,0,2]}),he("color",{attach:"background",args:["#72A75E"]}),he(gr,{fontSize:.5,color:"black",children:"Node.js"})]})}),he("meshBasicMaterial",{attach:"material-3",children:Et(br,{attach:"map",children:[he(Cr,{makeDefault:!0,position:[0,0,2]}),he("color",{attach:"background",args:["#4eb6c4"]}),he(gr,{fontSize:.5,color:"white",children:"Go"})]})}),he("meshBasicMaterial",{attach:"material-2",children:Et(br,{attach:"map",children:[he(Cr,{makeDefault:!0,position:[0,0,2]}),he("color",{attach:"background",args:["#6093C9"]}),he(gr,{fontSize:.5,color:"white",children:"C++"})]})}),he("meshBasicMaterial",{attach:"material-5",children:Et(br,{attach:"map",children:[he(Cr,{makeDefault:!0,position:[0,0,2]}),he("color",{attach:"background",args:["#2E5C8C"]}),he(gr,{fontSize:.5,color:"white",children:"SQL"})]})})]})]})}),vQ=pt.div` - display: flex; - flex-direction: column; - justify-content: space-around; - height: 80%; -`,yQ=()=>he(vQ,{children:Et(Of,{children:[he(zf,{enableZoom:!1,autoRotate:!0,autoRotateSpeed:5,rotation:!0}),he("ambientLight",{intensity:1}),Et("mesh",{children:[he("boxGeometry",{attach:"geometry",args:[2.5,2.5,2.5]}),he("meshStandardMaterial",{attach:"material-0",children:Et(br,{attach:"map",children:[he(Cr,{makeDefault:!0,position:[0,0,2]}),he("color",{attach:"background",args:["#fd8300"]}),he(gr,{fontSize:.4,color:"blue",children:"Firebase"})]})}),he("meshBasicMaterial",{attach:"material-4",children:Et(br,{attach:"map",children:[he(Cr,{makeDefault:!0,position:[0,0,2]}),he("color",{attach:"background",args:["#306792"]}),he(gr,{fontSize:.2,color:"white",position:[0,.15,0],children:"PostgreSQL"}),he(gr,{fontSize:.2,color:"white",position:[0,-.15,0],children:"MySQL"})]})}),he("meshBasicMaterial",{attach:"material-1",children:Et(br,{attach:"map",children:[he(Cr,{makeDefault:!0,position:[0,0,2]}),he("color",{attach:"background",args:["white"]}),he(gr,{fontSize:.5,color:"black",children:"Git"})]})}),he("meshBasicMaterial",{attach:"material-3",children:Et(br,{attach:"map",children:[he(Cr,{makeDefault:!0,position:[0,0,2]}),he("color",{attach:"background",args:["#9D2146"]}),he(gr,{fontSize:.5,color:"#F5C501",children:"UML"})]})}),he("meshBasicMaterial",{attach:"material-2",children:Et(br,{attach:"map",children:[he(Cr,{makeDefault:!0,position:[0,0,2]}),he("color",{attach:"background",args:["#e2d700"]}),he(gr,{fontSize:.5,color:"black",children:"JSON"})]})}),he("meshBasicMaterial",{attach:"material-5",children:Et(br,{attach:"map",children:[he(Cr,{makeDefault:!0,position:[0,0,2]}),he("color",{attach:"background",args:["#2E5C8C"]}),he(gr,{fontSize:.3,color:"white",children:"RESTful APIs"})]})})]})]})}),xQ=pt.div` - display: flex; - flex-direction: column; - justify-content: space-around; - height: 80%; -`,_Q=()=>he(xQ,{children:Et(Of,{children:[he(zf,{enableZoom:!1,autoRotate:!0,autoRotateSpeed:5,rotation:!0}),he("ambientLight",{intensity:1}),Et("mesh",{children:[he("boxGeometry",{attach:"geometry",args:[2.5,2.5,2.5]}),he("meshStandardMaterial",{attach:"material-4",children:Et(br,{attach:"map",children:[he(Cr,{makeDefault:!0,position:[0,0,2]}),he("color",{attach:"background",args:["#00D2F4"]}),he(gr,{fontSize:.5,color:"white",children:"React"})]})}),he("meshBasicMaterial",{attach:"material-1",children:Et(br,{attach:"map",children:[he(Cr,{makeDefault:!0,position:[0,0,2]}),he("color",{attach:"background",args:["#DA4924"]}),he(gr,{fontSize:.5,color:"white",children:"HTML"})]})}),he("meshBasicMaterial",{attach:"material-0",children:Et(br,{attach:"map",children:[he(Cr,{makeDefault:!0,position:[0,0,2]}),he("color",{attach:"background",args:["#151B2B"]}),he(gr,{fontSize:.25,color:"#17B6C1",children:"CSS (Tailwind)"})]})}),he("meshBasicMaterial",{attach:"material-3",children:Et(br,{attach:"map",children:[he(Cr,{makeDefault:!0,position:[0,0,2]}),he("color",{attach:"background",args:["white"]}),he(gr,{fontSize:.5,color:"black",children:"Three.js"})]})}),he("meshBasicMaterial",{attach:"material-5",children:Et(br,{attach:"map",children:[he(Cr,{makeDefault:!0,position:[0,0,2]}),he("color",{attach:"background",args:["#DD6A00"]}),he(gr,{fontSize:.5,color:"#4F7C97",children:"JavaFX"})]})}),he("meshBasicMaterial",{attach:"material-2",children:Et(br,{attach:"map",children:[he(Cr,{makeDefault:!0,position:[0,0,2]}),he("color",{attach:"background",args:["#9B54F3"]}),he(gr,{fontSize:.5,color:"#05C77C",children:"Figma"})]})})]})]})}),wQ=["Backend","Frontend","Others"],SQ=pt.div` - height: 100vh; - scroll-snap-align: center; - display: flex; - justify-content: center; - padding-top: 10vh; -`,AQ=pt.div` - height: 100vh; - scroll-snap-align: center; - display: flex; - justify-content: space-between; - width: 80%; - - @media screen and (max-width: 768px){ - height: 100%; - flex-direction: column; - align-items: center; - justify-content: center; - width: 100%; - } -`,MQ=pt.div` - flex: 1; - display: flex; - align-items: center; -`,EQ=pt.ul` - list-style: none; - display: flex; - flex-direction: column; - gap: 2%; -`,CQ=pt.li` - font-size: 80px; - font-weight: bold; - cursor: pointer; - color: transparent; - -webkit-text-stroke: 1px white; - position: relative; - - ::after{ - content: "${n=>n.text}"; - position: absolute; - top: 0; - left: 0; - color: pink; - width: 0; - overflow: hidden; - white-space: nowrap; - } - - &:hover{ - ::after{ - animation: moveText 0.5s linear both; - - @keyframes moveText { - to{ - width: 100%; - } - } - } - } - - @media screen and (max-width: 768px){ - font-size: 56px; - } -`,bQ=pt.div` - flex: 1; -`,TQ=()=>{const[n,e]=ee.useState("Backend");return he(SQ,{id:"Languages",children:Et(AQ,{children:[he(MQ,{children:he(EQ,{children:wQ.map(t=>he(CQ,{text:t,onClick:()=>e(t),children:t},t))})}),he(bQ,{children:n=="Backend"?he(gQ,{}):n=="Frontend"?he(_Q,{}):he(yQ,{})})]})})},RQ=pt.div` - height: 5vh; - position: fixed; - width: 100%; - display: flex; - justify-content: center; - - @media screen and (max-width: 768px) { - height: 4%; - } -`,BQ=pt.div` - width: 80%; - display: flex; - justify-content: center; - margin-top: 10px; -`,PQ=pt.img` - height: 40px; - align-self: center; - cursor: pointer; - - @media screen and (max-width: 768px){ - display: none; - } -`,IQ=pt.ul` - display: flex; - justify-content: center; - gap: 10%; - width: 60%; - list-style: none; - align-self: center; - - @media screen and (max-width: 768px){ - font-size: 12px; - } -`,Uh=pt.li` - cursor: pointer; -`,LQ=()=>{const n=e=>{const t=document.getElementById(e);t&&t.scrollIntoView({behavior:"smooth"})};return he(RQ,{children:Et(BQ,{children:[he(PQ,{src:"./Logo.png",onClick:()=>n("Home")}),Et(IQ,{children:[he(Uh,{onClick:()=>n("Home"),children:"Home"}),he(Uh,{onClick:()=>n("Who"),children:"About"}),he(Uh,{onClick:()=>n("Languages"),children:"Languages"}),he(Uh,{onClick:()=>n("Works"),children:"Works"}),he(Uh,{onClick:()=>n("Contact"),children:"Contact"})]})]})})},DQ=pt.div` - height: 100vh; - scroll-snap-align: center; - padding-top: 10vh; - - @media screen and (max-width: 768px){ - height: 200vh; - } -`,kQ=pt.div` - height: 100vh; - scroll-snap-align: center; - display: flex; - justify-content: space-between; - width: 80%; - - @media screen and (max-width: 768px){ - height: 100%; - flex-direction: column; - align-items: center; - justify-content: center; - width: 100%; - } -`,FQ=pt.div` - flex: 1; - display: flex; - flex-direction: column; - justify-content: center; - gap: 2%; - - @media screen and (max-width: 768px){ - scroll-snap-align: center; - padding-left: 10px; - padding-right: 10px; - } -`,NQ=pt.h1` - font-size: 64px; - color: #00d0f4; - font-family: 'Roboto Mono', monospace; - - @media screen and (max-width: 768px){ - text-align: center; - font-size: 56px; - } -`,OQ=pt.h2` - color: #da4ea2; - font-family: 'Open Sans', sans-serif; - @media screen and (max-width: 768px){ - text-align: center; - } -`,UQ=pt.p` -font-family: 'Open Sans', sans-serif; - @media screen and (max-width: 768px){ - font-size: 14px; - } -`,zQ=pt.div` - flex: 1; - position: relative; - - @media screen and (max-width: 768px){ - scroll-snap-align: center; - } -`,GQ=pt.img` - width: 70%; - object-fit: contain; - position: absolute; - top: 0; - bottom: 0; - left: 0; - right: 0; - margin: auto; - animation: animate 2s infinite ease alternate; - - @keyframes animate { - to{ - transform: translateY(5%); - } - } -`,HQ=()=>he(DQ,{id:"Who",children:Et(kQ,{children:[Et(zQ,{children:[Et(Of,{children:[he(zf,{enableZoom:!1,enableRotate:!1}),he("ambientLight",{intensity:1}),he("directionalLight",{position:[3,2,1]}),he(DZ,{args:[1,100,200],scale:2,children:he(PZ,{color:"#400562",attach:"material",distort:.6,speed:2})})]}),he(GQ,{src:"./profile.jpeg",style:{borderRadius:"50%",borderWidth:"thick",borderColor:"white",borderStyle:"solid"}})]}),Et(FQ,{children:[he(NQ,{children:"About me"}),he(OQ,{children:"Hello!"}),Et(UQ,{children:["I am Rui Jie, a current Year 3 Student at National University of Singapore, majoring in Computer Science. I am currently also specialising in the focus areas of Software Engineering and Artificial Intelligence / Machine Learning.",he("br",{}),he("br",{}),"My interest started out from curiosity through learning how to build my own telegram bot, which blossomed into a passion for software engineering. I am a driven individual with a knack for leadership, teamwork, and problem-solving. Through my various modules and my own project, I have learnt numerous frontend and backend softwares, which you may find out more about here on this website.",he("br",{}),he("br",{}),"In my free time, I enjoy running, gaming, and watching sports (Football, Basketball, and Formula 1)."]})]})]})}),VQ=pt.div` - height: 100%; - width: 90%; - display: flex; - flex-direction: column; - justify-content: center; - align-items: center; - gap: 3%; - - @media screen and (max-width: 768px) { - height: 70%; - width: 95%; - padding-left: 10px; - padding-right: 10px; - } -`,WQ=pt.img` - width: 80%; - - @media screen and (max-width: 768px) { - width: 70%; - } -`,JQ=pt.h2` - color: #da4ea2; - font-family: 'Open Sans', sans-serif; - - @media screen and (max-width: 768px) { - font-size: 18px; - text-align: center; - } -`,jQ=pt.p` - text-align: justify; - font-family: 'Open Sans', sans-serif; - - @media screen and (max-width: 768px) { - font-size: 12px; - } -`,XQ=()=>Et(VQ,{children:[he(WQ,{src:"./ConnectNUS.png"}),he(JQ,{children:"A desktop application for Module Planning"}),Et(jQ,{children:["A brownfield project engineered to tackle the lack of collaborative platforms during the Module Bidding exercise in NUS, in a team of 5 as part of a software engineering module. Led the team in full-stack programming, testing and documentation (User and Developer Guide), as well as implementing CI.",he("br",{})," ",he("br",{}),"Written in Java as backend and JavaFX as frontend. Supported by Git, CSS, CodeCov, Gradle, Jekyll, GitHub Actions, and GitHub pages, as well as UML modelling with PlantUML."]})]}),YQ=pt.div` - height: 100%; - width: 90%; - display: flex; - flex-direction: column; - justify-content: center; - align-items: center; - gap: 3%; - - @media screen and (max-width: 768px) { - height: 70%; - width: 95%; - padding-left: 10px; - padding-right: 10px; - } -`,KQ=pt.img` - width: 110%; - - @media screen and (max-width: 768px) { - width: 95%; - } -`,ZQ=pt.h2` - color: #da4ea2; - font-family: 'Open Sans', sans-serif; - - @media screen and (max-width: 768px) { - font-size: 18px; - text-align: center; - } -`,QQ=pt.p` - text-align: justify; - font-family: 'Open Sans', sans-serif; - - @media screen and (max-width: 768px) { - font-size: 12px; - } -`,qQ=()=>{var n=1;const[e,t]=ee.useState("./gorestapi/1.png");return ee.useEffect(()=>{setInterval(()=>{n++,n>4&&(n=1),t(`./gorestapi/${n}.png`)},5e3)},[]),Et(YQ,{children:[he(KQ,{src:e}),he(ZQ,{children:"A Local Backend API that responds to HTTP requests for various data"}),Et(QQ,{children:["This API allows a user to add and update a database and tables with data in JSON body. The user can also query intersections between tables using parameters in the request URL. The API uses Regexs to extract data from strings within JSON Body and sends HTTP responses with SQL rows as JSON, and HTTP Status Bad Request with error message on errors in JSON",he("br",{})," ",he("br",{}),"Written in GoLang, with MySQL as database."]})]})},$Q=pt.div` - height: 100%; - width: 90%; - display: flex; - flex-direction: column; - justify-content: center; - align-items: center; - gap: 3%; - - @media screen and (max-width: 768px) { - height: 70%; - width: 95%; - padding-left: 10px; - padding-right: 10px; - } -`,eq=pt.img` - width: 30%; -`,tq=pt.h2` - color: #da4ea2; - font-family: 'Open Sans', sans-serif; - - @media screen and (max-width: 768px) { - font-size: 18px; - text-align: center; - } -`,nq=pt.p` - text-align: justify; - font-family: 'Open Sans', sans-serif; - @media screen and (max-width: 768px) { - font-size: 12px; - } -`,rq=()=>{var n=1;const[e,t]=ee.useState("./hallinone/1.png");return ee.useEffect(()=>{setInterval(()=>{n++,n>9&&(n=1),t(`./hallinone/${n}.png`)},5e3)},[]),Et($Q,{children:[he(eq,{src:e,id:"image"}),he(tq,{children:"A booking mobile application for common facilities in hall"}),Et(nq,{children:["Having seen many of my peers using ineffective platforms to reserve certain facilities, I wrote this application along with a partner to facilitate bookings. Written in React Native (JavaScript) for the frontend and NodeJS for the backend, and supported with Firebase Authentication and Firestore.",he("br",{})," ",he("br",{}),"Engineered as part of Orbital 2022, achieving Apollo 11 (Advanced) level."]})]})};function iq(n){const{nodes:e,materials:t}=Uf("./keyboard-transformed.glb");return he("group",{...n,dispose:null,children:Et("group",{rotation:[-Math.PI/2,0,0],children:[he("mesh",{geometry:e.Object_2.geometry,material:t.Big_Buttons}),he("mesh",{geometry:e.Object_3.geometry,material:t.Chassis}),he("mesh",{geometry:e.Object_4.geometry,material:t.Small_Buttons})]})})}Uf.preload("./keyboard-transformed.glb");const sq=pt.div` - height: 100%; - width: 90%; - display: flex; - flex-direction: column; - justify-content: center; - align-items: center; - gap: 3%; - - @media screen and (max-width: 768px) { - height: 70%; - width: 95%; - padding-left: 10px; - padding-right: 10px; - } -`,oq=pt.img` - width: 25%; -`,aq=pt.h2` - color: #da4ea2; - font-family: 'Open Sans', sans-serif; - - @media screen and (max-width: 768px) { - font-size: 16px; - text-align: center; - } -`,lq=pt.p` - text-align: justify; - font-family: 'Open Sans', sans-serif; - - @media screen and (max-width: 768px) { - font-size: 12px; - } -`,uq=()=>{var n=1;const[e,t]=ee.useState("./rcycl/1.png");return ee.useEffect(()=>{setInterval(()=>{n++,n>4&&(n=1),t(`./rcycl/${n}.png`)},5e3)},[]),Et(sq,{children:[he(oq,{src:e}),he(aq,{children:"A mobile application that awards Green CrypoTokens for recycling"}),Et(lq,{children:["This application was written as an exploration into blockchain and to support to environment. RCYCL is linked to cryptocurrency wallets lke metamask, to award tokens to users for recycling. RCYCL uses Google Maps API to obtain a user's location and find the nearest recycling bins, and has a QR code scanner to scan QR codes on recycling bins after recycling. Using location services and camera permissions, RCYCL ensures that the user is near the bin before awarding the token. Written as part of NUS Hacker's HackNRoll 2023 in 24 hours.",he("br",{})," ",he("br",{}),"Written in React Native, supported by NodeJS, Firebase, Git and Ether."]})]})},cq=["hALLinOne","ConnectNUS","RCYCL","Go REST API","More"],fq=pt.div` - height: 100vh; - scroll-snap-align: center; - display: flex; - justify-content: center; - padding-top: 10vh; - - @media screen and (max-width: 768px){ - padding-top: 0; - } -`,hq=pt.div` - height: 100%; - scroll-snap-align: center; - display: flex; - justify-content: space-between; - width: 80%; - - @media screen and (max-width: 768px){ - height: 100%; - scroll-snap-align: none; - flex-direction: column-reverse; - align-items: center; - width: 100%; - justify-content: space-evenly; - } -`,dq=pt.div` - flex: 1; - display: flex; - align-items: center; -`,pq=pt.ul` - list-style: none; - display: flex; - flex-direction: column; - gap: 2%; -`,mq=pt.li` - font-size: 80px; - font-weight: bold; - cursor: pointer; - color: transparent; - -webkit-text-stroke: 1px white; - position: relative; - - ::after{ - content: "${n=>n.text}"; - position: absolute; - top: 0; - left: 0; - color: pink; - width: 0; - overflow: hidden; - white-space: nowrap; - } - - &:hover{ - ::after{ - animation: moveText 0.5s linear both; - - @keyframes moveText { - to{ - width: 100%; - } - } - } - } - - @media screen and (max-width: 768px){ - font-size: 24px; - text-align: center; - } -`,gq=pt.div` - flex: 1; -`,vq=pt.div` - display: flex; - flex-direction: column; - width: 100%; - height: 70%; - justify-content: center; - align-items: center; -`,yq=pt.div` - flex: 8; -`,xq=pt.div` - flex: 1; -`,_q=pt.button` - padding-inline: 10px; - padding-block: 5px; - border-radius: 5px; - border: none; - font-size: 20px; - background-color: #00d0f4; - font-family: 'Open Sans', sans-serif; -`,wq=()=>{const[n,e]=ee.useState("hALLinOne");return he(fq,{id:"Works",children:Et(hq,{children:[he(gq,{children:n=="hALLinOne"?he(rq,{}):n=="ConnectNUS"?he(XQ,{}):n=="RCYCL"?he(uq,{}):n=="Go REST API"?he(qQ,{}):Et(vq,{children:[he(yq,{children:Et(Of,{children:[he(Hk,{environment:"city",children:he(iq,{})}),he(zf,{autoRotate:!0})]})}),he(xq,{children:he(_q,{onClick:()=>window.open("https://github.com/rjkoh","_blank"),children:"View Github"})})]})}),he(dq,{children:he(pq,{children:cq.map(t=>he(mq,{text:t,onClick:()=>e(t),children:t},t))})})]})})},Sq=pt.div` - height: 100vh; - scroll-snap-type: y mandatory; - scroll-behavior: smooth; - overflow-y: auto; - scrollbar-width: none; - color: white; - background: url("./bg.jpeg"); - &::-webkit-scrollbar{ - display: none; - } -`;function Aq(){return Et(Sq,{children:[he(LQ,{}),he(pQ,{}),he(HQ,{}),he(TQ,{}),he(wq,{}),he(L8,{})]})}o_.createRoot(document.getElementById("root")).render(he(pn.StrictMode,{children:he(Aq,{})})); diff --git a/index.html b/index.html index 531f5c1..0e33226 100644 --- a/index.html +++ b/index.html @@ -20,7 +20,7 @@ Rui Jie - +