numbl 0.0.16 → 0.0.18

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,18 +1,18 @@
1
- (function(){const t=document.createElement("link").relList;if(t&&t.supports&&t.supports("modulepreload"))return;for(const l of document.querySelectorAll('link[rel="modulepreload"]'))s(l);new MutationObserver(l=>{for(const c of l)if(c.type==="childList")for(const h of c.addedNodes)h.tagName==="LINK"&&h.rel==="modulepreload"&&s(h)}).observe(document,{childList:!0,subtree:!0});function i(l){const c={};return l.integrity&&(c.integrity=l.integrity),l.referrerPolicy&&(c.referrerPolicy=l.referrerPolicy),l.crossOrigin==="use-credentials"?c.credentials="include":l.crossOrigin==="anonymous"?c.credentials="omit":c.credentials="same-origin",c}function s(l){if(l.ep)return;l.ep=!0;const c=i(l);fetch(l.href,c)}})();var Lh={exports:{}},$o={};var g_;function Py(){if(g_)return $o;g_=1;var r=Symbol.for("react.transitional.element"),t=Symbol.for("react.fragment");function i(s,l,c){var h=null;if(c!==void 0&&(h=""+c),l.key!==void 0&&(h=""+l.key),"key"in l){c={};for(var d in l)d!=="key"&&(c[d]=l[d])}else c=l;return l=c.ref,{$$typeof:r,type:s,key:h,ref:l!==void 0?l:null,props:c}}return $o.Fragment=t,$o.jsx=i,$o.jsxs=i,$o}var __;function zy(){return __||(__=1,Lh.exports=Py()),Lh.exports}var sn=zy(),Nh={exports:{}},oe={};var v_;function Iy(){if(v_)return oe;v_=1;var r=Symbol.for("react.transitional.element"),t=Symbol.for("react.portal"),i=Symbol.for("react.fragment"),s=Symbol.for("react.strict_mode"),l=Symbol.for("react.profiler"),c=Symbol.for("react.consumer"),h=Symbol.for("react.context"),d=Symbol.for("react.forward_ref"),m=Symbol.for("react.suspense"),p=Symbol.for("react.memo"),v=Symbol.for("react.lazy"),g=Symbol.for("react.activity"),_=Symbol.iterator;function M(N){return N===null||typeof N!="object"?null:(N=_&&N[_]||N["@@iterator"],typeof N=="function"?N:null)}var E={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},A=Object.assign,x={};function y(N,k,ut){this.props=N,this.context=k,this.refs=x,this.updater=ut||E}y.prototype.isReactComponent={},y.prototype.setState=function(N,k){if(typeof N!="object"&&typeof N!="function"&&N!=null)throw Error("takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,N,k,"setState")},y.prototype.forceUpdate=function(N){this.updater.enqueueForceUpdate(this,N,"forceUpdate")};function w(){}w.prototype=y.prototype;function D(N,k,ut){this.props=N,this.context=k,this.refs=x,this.updater=ut||E}var U=D.prototype=new w;U.constructor=D,A(U,y.prototype),U.isPureReactComponent=!0;var H=Array.isArray;function F(){}var I={H:null,A:null,T:null,S:null},T=Object.prototype.hasOwnProperty;function L(N,k,ut){var vt=ut.ref;return{$$typeof:r,type:N,key:k,ref:vt!==void 0?vt:null,props:ut}}function Q(N,k){return L(N.type,k,N.props)}function P(N){return typeof N=="object"&&N!==null&&N.$$typeof===r}function W(N){var k={"=":"=0",":":"=2"};return"$"+N.replace(/[=:]/g,function(ut){return k[ut]})}var J=/\/+/g;function rt(N,k){return typeof N=="object"&&N!==null&&N.key!=null?W(""+N.key):k.toString(36)}function et(N){switch(N.status){case"fulfilled":return N.value;case"rejected":throw N.reason;default:switch(typeof N.status=="string"?N.then(F,F):(N.status="pending",N.then(function(k){N.status==="pending"&&(N.status="fulfilled",N.value=k)},function(k){N.status==="pending"&&(N.status="rejected",N.reason=k)})),N.status){case"fulfilled":return N.value;case"rejected":throw N.reason}}throw N}function O(N,k,ut,vt,Rt){var Z=typeof N;(Z==="undefined"||Z==="boolean")&&(N=null);var dt=!1;if(N===null)dt=!0;else switch(Z){case"bigint":case"string":case"number":dt=!0;break;case"object":switch(N.$$typeof){case r:case t:dt=!0;break;case v:return dt=N._init,O(dt(N._payload),k,ut,vt,Rt)}}if(dt)return Rt=Rt(N),dt=vt===""?"."+rt(N,0):vt,H(Rt)?(ut="",dt!=null&&(ut=dt.replace(J,"$&/")+"/"),O(Rt,k,ut,"",function(Ft){return Ft})):Rt!=null&&(P(Rt)&&(Rt=Q(Rt,ut+(Rt.key==null||N&&N.key===Rt.key?"":(""+Rt.key).replace(J,"$&/")+"/")+dt)),k.push(Rt)),1;dt=0;var yt=vt===""?".":vt+":";if(H(N))for(var Ut=0;Ut<N.length;Ut++)vt=N[Ut],Z=yt+rt(vt,Ut),dt+=O(vt,k,ut,Z,Rt);else if(Ut=M(N),typeof Ut=="function")for(N=Ut.call(N),Ut=0;!(vt=N.next()).done;)vt=vt.value,Z=yt+rt(vt,Ut++),dt+=O(vt,k,ut,Z,Rt);else if(Z==="object"){if(typeof N.then=="function")return O(et(N),k,ut,vt,Rt);throw k=String(N),Error("Objects are not valid as a React child (found: "+(k==="[object Object]"?"object with keys {"+Object.keys(N).join(", ")+"}":k)+"). If you meant to render a collection of children, use an array instead.")}return dt}function B(N,k,ut){if(N==null)return N;var vt=[],Rt=0;return O(N,vt,"","",function(Z){return k.call(ut,Z,Rt++)}),vt}function at(N){if(N._status===-1){var k=N._result;k=k(),k.then(function(ut){(N._status===0||N._status===-1)&&(N._status=1,N._result=ut)},function(ut){(N._status===0||N._status===-1)&&(N._status=2,N._result=ut)}),N._status===-1&&(N._status=0,N._result=k)}if(N._status===1)return N._result.default;throw N._result}var $=typeof reportError=="function"?reportError:function(N){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var k=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof N=="object"&&N!==null&&typeof N.message=="string"?String(N.message):String(N),error:N});if(!window.dispatchEvent(k))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",N);return}console.error(N)},lt={map:B,forEach:function(N,k,ut){B(N,function(){k.apply(this,arguments)},ut)},count:function(N){var k=0;return B(N,function(){k++}),k},toArray:function(N){return B(N,function(k){return k})||[]},only:function(N){if(!P(N))throw Error("React.Children.only expected to receive a single React element child.");return N}};return oe.Activity=g,oe.Children=lt,oe.Component=y,oe.Fragment=i,oe.Profiler=l,oe.PureComponent=D,oe.StrictMode=s,oe.Suspense=m,oe.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=I,oe.__COMPILER_RUNTIME={__proto__:null,c:function(N){return I.H.useMemoCache(N)}},oe.cache=function(N){return function(){return N.apply(null,arguments)}},oe.cacheSignal=function(){return null},oe.cloneElement=function(N,k,ut){if(N==null)throw Error("The argument must be a React element, but you passed "+N+".");var vt=A({},N.props),Rt=N.key;if(k!=null)for(Z in k.key!==void 0&&(Rt=""+k.key),k)!T.call(k,Z)||Z==="key"||Z==="__self"||Z==="__source"||Z==="ref"&&k.ref===void 0||(vt[Z]=k[Z]);var Z=arguments.length-2;if(Z===1)vt.children=ut;else if(1<Z){for(var dt=Array(Z),yt=0;yt<Z;yt++)dt[yt]=arguments[yt+2];vt.children=dt}return L(N.type,Rt,vt)},oe.createContext=function(N){return N={$$typeof:h,_currentValue:N,_currentValue2:N,_threadCount:0,Provider:null,Consumer:null},N.Provider=N,N.Consumer={$$typeof:c,_context:N},N},oe.createElement=function(N,k,ut){var vt,Rt={},Z=null;if(k!=null)for(vt in k.key!==void 0&&(Z=""+k.key),k)T.call(k,vt)&&vt!=="key"&&vt!=="__self"&&vt!=="__source"&&(Rt[vt]=k[vt]);var dt=arguments.length-2;if(dt===1)Rt.children=ut;else if(1<dt){for(var yt=Array(dt),Ut=0;Ut<dt;Ut++)yt[Ut]=arguments[Ut+2];Rt.children=yt}if(N&&N.defaultProps)for(vt in dt=N.defaultProps,dt)Rt[vt]===void 0&&(Rt[vt]=dt[vt]);return L(N,Z,Rt)},oe.createRef=function(){return{current:null}},oe.forwardRef=function(N){return{$$typeof:d,render:N}},oe.isValidElement=P,oe.lazy=function(N){return{$$typeof:v,_payload:{_status:-1,_result:N},_init:at}},oe.memo=function(N,k){return{$$typeof:p,type:N,compare:k===void 0?null:k}},oe.startTransition=function(N){var k=I.T,ut={};I.T=ut;try{var vt=N(),Rt=I.S;Rt!==null&&Rt(ut,vt),typeof vt=="object"&&vt!==null&&typeof vt.then=="function"&&vt.then(F,$)}catch(Z){$(Z)}finally{k!==null&&ut.types!==null&&(k.types=ut.types),I.T=k}},oe.unstable_useCacheRefresh=function(){return I.H.useCacheRefresh()},oe.use=function(N){return I.H.use(N)},oe.useActionState=function(N,k,ut){return I.H.useActionState(N,k,ut)},oe.useCallback=function(N,k){return I.H.useCallback(N,k)},oe.useContext=function(N){return I.H.useContext(N)},oe.useDebugValue=function(){},oe.useDeferredValue=function(N,k){return I.H.useDeferredValue(N,k)},oe.useEffect=function(N,k){return I.H.useEffect(N,k)},oe.useEffectEvent=function(N){return I.H.useEffectEvent(N)},oe.useId=function(){return I.H.useId()},oe.useImperativeHandle=function(N,k,ut){return I.H.useImperativeHandle(N,k,ut)},oe.useInsertionEffect=function(N,k){return I.H.useInsertionEffect(N,k)},oe.useLayoutEffect=function(N,k){return I.H.useLayoutEffect(N,k)},oe.useMemo=function(N,k){return I.H.useMemo(N,k)},oe.useOptimistic=function(N,k){return I.H.useOptimistic(N,k)},oe.useReducer=function(N,k,ut){return I.H.useReducer(N,k,ut)},oe.useRef=function(N){return I.H.useRef(N)},oe.useState=function(N){return I.H.useState(N)},oe.useSyncExternalStore=function(N,k,ut){return I.H.useSyncExternalStore(N,k,ut)},oe.useTransition=function(){return I.H.useTransition()},oe.version="19.2.4",oe}var x_;function vp(){return x_||(x_=1,Nh.exports=Iy()),Nh.exports}var Yn=vp(),Oh={exports:{}},tl={},Ph={exports:{}},zh={};var S_;function Fy(){return S_||(S_=1,(function(r){function t(O,B){var at=O.length;O.push(B);t:for(;0<at;){var $=at-1>>>1,lt=O[$];if(0<l(lt,B))O[$]=B,O[at]=lt,at=$;else break t}}function i(O){return O.length===0?null:O[0]}function s(O){if(O.length===0)return null;var B=O[0],at=O.pop();if(at!==B){O[0]=at;t:for(var $=0,lt=O.length,N=lt>>>1;$<N;){var k=2*($+1)-1,ut=O[k],vt=k+1,Rt=O[vt];if(0>l(ut,at))vt<lt&&0>l(Rt,ut)?(O[$]=Rt,O[vt]=at,$=vt):(O[$]=ut,O[k]=at,$=k);else if(vt<lt&&0>l(Rt,at))O[$]=Rt,O[vt]=at,$=vt;else break t}}return B}function l(O,B){var at=O.sortIndex-B.sortIndex;return at!==0?at:O.id-B.id}if(r.unstable_now=void 0,typeof performance=="object"&&typeof performance.now=="function"){var c=performance;r.unstable_now=function(){return c.now()}}else{var h=Date,d=h.now();r.unstable_now=function(){return h.now()-d}}var m=[],p=[],v=1,g=null,_=3,M=!1,E=!1,A=!1,x=!1,y=typeof setTimeout=="function"?setTimeout:null,w=typeof clearTimeout=="function"?clearTimeout:null,D=typeof setImmediate<"u"?setImmediate:null;function U(O){for(var B=i(p);B!==null;){if(B.callback===null)s(p);else if(B.startTime<=O)s(p),B.sortIndex=B.expirationTime,t(m,B);else break;B=i(p)}}function H(O){if(A=!1,U(O),!E)if(i(m)!==null)E=!0,F||(F=!0,W());else{var B=i(p);B!==null&&et(H,B.startTime-O)}}var F=!1,I=-1,T=5,L=-1;function Q(){return x?!0:!(r.unstable_now()-L<T)}function P(){if(x=!1,F){var O=r.unstable_now();L=O;var B=!0;try{t:{E=!1,A&&(A=!1,w(I),I=-1),M=!0;var at=_;try{e:{for(U(O),g=i(m);g!==null&&!(g.expirationTime>O&&Q());){var $=g.callback;if(typeof $=="function"){g.callback=null,_=g.priorityLevel;var lt=$(g.expirationTime<=O);if(O=r.unstable_now(),typeof lt=="function"){g.callback=lt,U(O),B=!0;break e}g===i(m)&&s(m),U(O)}else s(m);g=i(m)}if(g!==null)B=!0;else{var N=i(p);N!==null&&et(H,N.startTime-O),B=!1}}break t}finally{g=null,_=at,M=!1}B=void 0}}finally{B?W():F=!1}}}var W;if(typeof D=="function")W=function(){D(P)};else if(typeof MessageChannel<"u"){var J=new MessageChannel,rt=J.port2;J.port1.onmessage=P,W=function(){rt.postMessage(null)}}else W=function(){y(P,0)};function et(O,B){I=y(function(){O(r.unstable_now())},B)}r.unstable_IdlePriority=5,r.unstable_ImmediatePriority=1,r.unstable_LowPriority=4,r.unstable_NormalPriority=3,r.unstable_Profiling=null,r.unstable_UserBlockingPriority=2,r.unstable_cancelCallback=function(O){O.callback=null},r.unstable_forceFrameRate=function(O){0>O||125<O?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):T=0<O?Math.floor(1e3/O):5},r.unstable_getCurrentPriorityLevel=function(){return _},r.unstable_next=function(O){switch(_){case 1:case 2:case 3:var B=3;break;default:B=_}var at=_;_=B;try{return O()}finally{_=at}},r.unstable_requestPaint=function(){x=!0},r.unstable_runWithPriority=function(O,B){switch(O){case 1:case 2:case 3:case 4:case 5:break;default:O=3}var at=_;_=O;try{return B()}finally{_=at}},r.unstable_scheduleCallback=function(O,B,at){var $=r.unstable_now();switch(typeof at=="object"&&at!==null?(at=at.delay,at=typeof at=="number"&&0<at?$+at:$):at=$,O){case 1:var lt=-1;break;case 2:lt=250;break;case 5:lt=1073741823;break;case 4:lt=1e4;break;default:lt=5e3}return lt=at+lt,O={id:v++,callback:B,priorityLevel:O,startTime:at,expirationTime:lt,sortIndex:-1},at>$?(O.sortIndex=at,t(p,O),i(m)===null&&O===i(p)&&(A?(w(I),I=-1):A=!0,et(H,at-$))):(O.sortIndex=lt,t(m,O),E||M||(E=!0,F||(F=!0,W()))),O},r.unstable_shouldYield=Q,r.unstable_wrapCallback=function(O){var B=_;return function(){var at=_;_=B;try{return O.apply(this,arguments)}finally{_=at}}}})(zh)),zh}var y_;function By(){return y_||(y_=1,Ph.exports=Fy()),Ph.exports}var Ih={exports:{}},zn={};var M_;function Hy(){if(M_)return zn;M_=1;var r=vp();function t(m){var p="https://react.dev/errors/"+m;if(1<arguments.length){p+="?args[]="+encodeURIComponent(arguments[1]);for(var v=2;v<arguments.length;v++)p+="&args[]="+encodeURIComponent(arguments[v])}return"Minified React error #"+m+"; visit "+p+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function i(){}var s={d:{f:i,r:function(){throw Error(t(522))},D:i,C:i,L:i,m:i,X:i,S:i,M:i},p:0,findDOMNode:null},l=Symbol.for("react.portal");function c(m,p,v){var g=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:l,key:g==null?null:""+g,children:m,containerInfo:p,implementation:v}}var h=r.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;function d(m,p){if(m==="font")return"";if(typeof p=="string")return p==="use-credentials"?p:""}return zn.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=s,zn.createPortal=function(m,p){var v=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!p||p.nodeType!==1&&p.nodeType!==9&&p.nodeType!==11)throw Error(t(299));return c(m,p,null,v)},zn.flushSync=function(m){var p=h.T,v=s.p;try{if(h.T=null,s.p=2,m)return m()}finally{h.T=p,s.p=v,s.d.f()}},zn.preconnect=function(m,p){typeof m=="string"&&(p?(p=p.crossOrigin,p=typeof p=="string"?p==="use-credentials"?p:"":void 0):p=null,s.d.C(m,p))},zn.prefetchDNS=function(m){typeof m=="string"&&s.d.D(m)},zn.preinit=function(m,p){if(typeof m=="string"&&p&&typeof p.as=="string"){var v=p.as,g=d(v,p.crossOrigin),_=typeof p.integrity=="string"?p.integrity:void 0,M=typeof p.fetchPriority=="string"?p.fetchPriority:void 0;v==="style"?s.d.S(m,typeof p.precedence=="string"?p.precedence:void 0,{crossOrigin:g,integrity:_,fetchPriority:M}):v==="script"&&s.d.X(m,{crossOrigin:g,integrity:_,fetchPriority:M,nonce:typeof p.nonce=="string"?p.nonce:void 0})}},zn.preinitModule=function(m,p){if(typeof m=="string")if(typeof p=="object"&&p!==null){if(p.as==null||p.as==="script"){var v=d(p.as,p.crossOrigin);s.d.M(m,{crossOrigin:v,integrity:typeof p.integrity=="string"?p.integrity:void 0,nonce:typeof p.nonce=="string"?p.nonce:void 0})}}else p==null&&s.d.M(m)},zn.preload=function(m,p){if(typeof m=="string"&&typeof p=="object"&&p!==null&&typeof p.as=="string"){var v=p.as,g=d(v,p.crossOrigin);s.d.L(m,v,{crossOrigin:g,integrity:typeof p.integrity=="string"?p.integrity:void 0,nonce:typeof p.nonce=="string"?p.nonce:void 0,type:typeof p.type=="string"?p.type:void 0,fetchPriority:typeof p.fetchPriority=="string"?p.fetchPriority:void 0,referrerPolicy:typeof p.referrerPolicy=="string"?p.referrerPolicy:void 0,imageSrcSet:typeof p.imageSrcSet=="string"?p.imageSrcSet:void 0,imageSizes:typeof p.imageSizes=="string"?p.imageSizes:void 0,media:typeof p.media=="string"?p.media:void 0})}},zn.preloadModule=function(m,p){if(typeof m=="string")if(p){var v=d(p.as,p.crossOrigin);s.d.m(m,{as:typeof p.as=="string"&&p.as!=="script"?p.as:void 0,crossOrigin:v,integrity:typeof p.integrity=="string"?p.integrity:void 0})}else s.d.m(m)},zn.requestFormReset=function(m){s.d.r(m)},zn.unstable_batchedUpdates=function(m,p){return m(p)},zn.useFormState=function(m,p,v){return h.H.useFormState(m,p,v)},zn.useFormStatus=function(){return h.H.useHostTransitionStatus()},zn.version="19.2.4",zn}var E_;function Gy(){if(E_)return Ih.exports;E_=1;function r(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(r)}catch(t){console.error(t)}}return r(),Ih.exports=Hy(),Ih.exports}var b_;function Vy(){if(b_)return tl;b_=1;var r=By(),t=vp(),i=Gy();function s(e){var n="https://react.dev/errors/"+e;if(1<arguments.length){n+="?args[]="+encodeURIComponent(arguments[1]);for(var a=2;a<arguments.length;a++)n+="&args[]="+encodeURIComponent(arguments[a])}return"Minified React error #"+e+"; visit "+n+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function l(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11)}function c(e){var n=e,a=e;if(e.alternate)for(;n.return;)n=n.return;else{e=n;do n=e,(n.flags&4098)!==0&&(a=n.return),e=n.return;while(e)}return n.tag===3?a:null}function h(e){if(e.tag===13){var n=e.memoizedState;if(n===null&&(e=e.alternate,e!==null&&(n=e.memoizedState)),n!==null)return n.dehydrated}return null}function d(e){if(e.tag===31){var n=e.memoizedState;if(n===null&&(e=e.alternate,e!==null&&(n=e.memoizedState)),n!==null)return n.dehydrated}return null}function m(e){if(c(e)!==e)throw Error(s(188))}function p(e){var n=e.alternate;if(!n){if(n=c(e),n===null)throw Error(s(188));return n!==e?null:e}for(var a=e,o=n;;){var u=a.return;if(u===null)break;var f=u.alternate;if(f===null){if(o=u.return,o!==null){a=o;continue}break}if(u.child===f.child){for(f=u.child;f;){if(f===a)return m(u),e;if(f===o)return m(u),n;f=f.sibling}throw Error(s(188))}if(a.return!==o.return)a=u,o=f;else{for(var S=!1,R=u.child;R;){if(R===a){S=!0,a=u,o=f;break}if(R===o){S=!0,o=u,a=f;break}R=R.sibling}if(!S){for(R=f.child;R;){if(R===a){S=!0,a=f,o=u;break}if(R===o){S=!0,o=f,a=u;break}R=R.sibling}if(!S)throw Error(s(189))}}if(a.alternate!==o)throw Error(s(190))}if(a.tag!==3)throw Error(s(188));return a.stateNode.current===a?e:n}function v(e){var n=e.tag;if(n===5||n===26||n===27||n===6)return e;for(e=e.child;e!==null;){if(n=v(e),n!==null)return n;e=e.sibling}return null}var g=Object.assign,_=Symbol.for("react.element"),M=Symbol.for("react.transitional.element"),E=Symbol.for("react.portal"),A=Symbol.for("react.fragment"),x=Symbol.for("react.strict_mode"),y=Symbol.for("react.profiler"),w=Symbol.for("react.consumer"),D=Symbol.for("react.context"),U=Symbol.for("react.forward_ref"),H=Symbol.for("react.suspense"),F=Symbol.for("react.suspense_list"),I=Symbol.for("react.memo"),T=Symbol.for("react.lazy"),L=Symbol.for("react.activity"),Q=Symbol.for("react.memo_cache_sentinel"),P=Symbol.iterator;function W(e){return e===null||typeof e!="object"?null:(e=P&&e[P]||e["@@iterator"],typeof e=="function"?e:null)}var J=Symbol.for("react.client.reference");function rt(e){if(e==null)return null;if(typeof e=="function")return e.$$typeof===J?null:e.displayName||e.name||null;if(typeof e=="string")return e;switch(e){case A:return"Fragment";case y:return"Profiler";case x:return"StrictMode";case H:return"Suspense";case F:return"SuspenseList";case L:return"Activity"}if(typeof e=="object")switch(e.$$typeof){case E:return"Portal";case D:return e.displayName||"Context";case w:return(e._context.displayName||"Context")+".Consumer";case U:var n=e.render;return e=e.displayName,e||(e=n.displayName||n.name||"",e=e!==""?"ForwardRef("+e+")":"ForwardRef"),e;case I:return n=e.displayName||null,n!==null?n:rt(e.type)||"Memo";case T:n=e._payload,e=e._init;try{return rt(e(n))}catch{}}return null}var et=Array.isArray,O=t.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,B=i.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,at={pending:!1,data:null,method:null,action:null},$=[],lt=-1;function N(e){return{current:e}}function k(e){0>lt||(e.current=$[lt],$[lt]=null,lt--)}function ut(e,n){lt++,$[lt]=e.current,e.current=n}var vt=N(null),Rt=N(null),Z=N(null),dt=N(null);function yt(e,n){switch(ut(Z,n),ut(Rt,e),ut(vt,null),n.nodeType){case 9:case 11:e=(e=n.documentElement)&&(e=e.namespaceURI)?B0(e):0;break;default:if(e=n.tagName,n=n.namespaceURI)n=B0(n),e=H0(n,e);else switch(e){case"svg":e=1;break;case"math":e=2;break;default:e=0}}k(vt),ut(vt,e)}function Ut(){k(vt),k(Rt),k(Z)}function Ft(e){e.memoizedState!==null&&ut(dt,e);var n=vt.current,a=H0(n,e.type);n!==a&&(ut(Rt,e),ut(vt,a))}function Xt(e){Rt.current===e&&(k(vt),k(Rt)),dt.current===e&&(k(dt),Zo._currentValue=at)}var ge,Jt;function _e(e){if(ge===void 0)try{throw Error()}catch(a){var n=a.stack.trim().match(/\n( *(at )?)/);ge=n&&n[1]||"",Jt=-1<a.stack.indexOf(`
1
+ (function(){const t=document.createElement("link").relList;if(t&&t.supports&&t.supports("modulepreload"))return;for(const l of document.querySelectorAll('link[rel="modulepreload"]'))s(l);new MutationObserver(l=>{for(const c of l)if(c.type==="childList")for(const h of c.addedNodes)h.tagName==="LINK"&&h.rel==="modulepreload"&&s(h)}).observe(document,{childList:!0,subtree:!0});function i(l){const c={};return l.integrity&&(c.integrity=l.integrity),l.referrerPolicy&&(c.referrerPolicy=l.referrerPolicy),l.crossOrigin==="use-credentials"?c.credentials="include":l.crossOrigin==="anonymous"?c.credentials="omit":c.credentials="same-origin",c}function s(l){if(l.ep)return;l.ep=!0;const c=i(l);fetch(l.href,c)}})();var Oh={exports:{}},el={};var __;function Fy(){if(__)return el;__=1;var r=Symbol.for("react.transitional.element"),t=Symbol.for("react.fragment");function i(s,l,c){var h=null;if(c!==void 0&&(h=""+c),l.key!==void 0&&(h=""+l.key),"key"in l){c={};for(var d in l)d!=="key"&&(c[d]=l[d])}else c=l;return l=c.ref,{$$typeof:r,type:s,key:h,ref:l!==void 0?l:null,props:c}}return el.Fragment=t,el.jsx=i,el.jsxs=i,el}var v_;function By(){return v_||(v_=1,Oh.exports=Fy()),Oh.exports}var sn=By(),Ph={exports:{}},oe={};var x_;function Hy(){if(x_)return oe;x_=1;var r=Symbol.for("react.transitional.element"),t=Symbol.for("react.portal"),i=Symbol.for("react.fragment"),s=Symbol.for("react.strict_mode"),l=Symbol.for("react.profiler"),c=Symbol.for("react.consumer"),h=Symbol.for("react.context"),d=Symbol.for("react.forward_ref"),m=Symbol.for("react.suspense"),p=Symbol.for("react.memo"),v=Symbol.for("react.lazy"),g=Symbol.for("react.activity"),_=Symbol.iterator;function M(N){return N===null||typeof N!="object"?null:(N=_&&N[_]||N["@@iterator"],typeof N=="function"?N:null)}var E={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},A=Object.assign,y={};function S(N,k,ut){this.props=N,this.context=k,this.refs=y,this.updater=ut||E}S.prototype.isReactComponent={},S.prototype.setState=function(N,k){if(typeof N!="object"&&typeof N!="function"&&N!=null)throw Error("takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,N,k,"setState")},S.prototype.forceUpdate=function(N){this.updater.enqueueForceUpdate(this,N,"forceUpdate")};function w(){}w.prototype=S.prototype;function D(N,k,ut){this.props=N,this.context=k,this.refs=y,this.updater=ut||E}var U=D.prototype=new w;U.constructor=D,A(U,S.prototype),U.isPureReactComponent=!0;var H=Array.isArray;function F(){}var I={H:null,A:null,T:null,S:null},T=Object.prototype.hasOwnProperty;function L(N,k,ut){var vt=ut.ref;return{$$typeof:r,type:N,key:k,ref:vt!==void 0?vt:null,props:ut}}function Q(N,k){return L(N.type,k,N.props)}function P(N){return typeof N=="object"&&N!==null&&N.$$typeof===r}function W(N){var k={"=":"=0",":":"=2"};return"$"+N.replace(/[=:]/g,function(ut){return k[ut]})}var J=/\/+/g;function rt(N,k){return typeof N=="object"&&N!==null&&N.key!=null?W(""+N.key):k.toString(36)}function et(N){switch(N.status){case"fulfilled":return N.value;case"rejected":throw N.reason;default:switch(typeof N.status=="string"?N.then(F,F):(N.status="pending",N.then(function(k){N.status==="pending"&&(N.status="fulfilled",N.value=k)},function(k){N.status==="pending"&&(N.status="rejected",N.reason=k)})),N.status){case"fulfilled":return N.value;case"rejected":throw N.reason}}throw N}function O(N,k,ut,vt,Rt){var Z=typeof N;(Z==="undefined"||Z==="boolean")&&(N=null);var dt=!1;if(N===null)dt=!0;else switch(Z){case"bigint":case"string":case"number":dt=!0;break;case"object":switch(N.$$typeof){case r:case t:dt=!0;break;case v:return dt=N._init,O(dt(N._payload),k,ut,vt,Rt)}}if(dt)return Rt=Rt(N),dt=vt===""?"."+rt(N,0):vt,H(Rt)?(ut="",dt!=null&&(ut=dt.replace(J,"$&/")+"/"),O(Rt,k,ut,"",function(Ft){return Ft})):Rt!=null&&(P(Rt)&&(Rt=Q(Rt,ut+(Rt.key==null||N&&N.key===Rt.key?"":(""+Rt.key).replace(J,"$&/")+"/")+dt)),k.push(Rt)),1;dt=0;var yt=vt===""?".":vt+":";if(H(N))for(var Ut=0;Ut<N.length;Ut++)vt=N[Ut],Z=yt+rt(vt,Ut),dt+=O(vt,k,ut,Z,Rt);else if(Ut=M(N),typeof Ut=="function")for(N=Ut.call(N),Ut=0;!(vt=N.next()).done;)vt=vt.value,Z=yt+rt(vt,Ut++),dt+=O(vt,k,ut,Z,Rt);else if(Z==="object"){if(typeof N.then=="function")return O(et(N),k,ut,vt,Rt);throw k=String(N),Error("Objects are not valid as a React child (found: "+(k==="[object Object]"?"object with keys {"+Object.keys(N).join(", ")+"}":k)+"). If you meant to render a collection of children, use an array instead.")}return dt}function B(N,k,ut){if(N==null)return N;var vt=[],Rt=0;return O(N,vt,"","",function(Z){return k.call(ut,Z,Rt++)}),vt}function at(N){if(N._status===-1){var k=N._result;k=k(),k.then(function(ut){(N._status===0||N._status===-1)&&(N._status=1,N._result=ut)},function(ut){(N._status===0||N._status===-1)&&(N._status=2,N._result=ut)}),N._status===-1&&(N._status=0,N._result=k)}if(N._status===1)return N._result.default;throw N._result}var $=typeof reportError=="function"?reportError:function(N){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var k=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof N=="object"&&N!==null&&typeof N.message=="string"?String(N.message):String(N),error:N});if(!window.dispatchEvent(k))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",N);return}console.error(N)},lt={map:B,forEach:function(N,k,ut){B(N,function(){k.apply(this,arguments)},ut)},count:function(N){var k=0;return B(N,function(){k++}),k},toArray:function(N){return B(N,function(k){return k})||[]},only:function(N){if(!P(N))throw Error("React.Children.only expected to receive a single React element child.");return N}};return oe.Activity=g,oe.Children=lt,oe.Component=S,oe.Fragment=i,oe.Profiler=l,oe.PureComponent=D,oe.StrictMode=s,oe.Suspense=m,oe.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=I,oe.__COMPILER_RUNTIME={__proto__:null,c:function(N){return I.H.useMemoCache(N)}},oe.cache=function(N){return function(){return N.apply(null,arguments)}},oe.cacheSignal=function(){return null},oe.cloneElement=function(N,k,ut){if(N==null)throw Error("The argument must be a React element, but you passed "+N+".");var vt=A({},N.props),Rt=N.key;if(k!=null)for(Z in k.key!==void 0&&(Rt=""+k.key),k)!T.call(k,Z)||Z==="key"||Z==="__self"||Z==="__source"||Z==="ref"&&k.ref===void 0||(vt[Z]=k[Z]);var Z=arguments.length-2;if(Z===1)vt.children=ut;else if(1<Z){for(var dt=Array(Z),yt=0;yt<Z;yt++)dt[yt]=arguments[yt+2];vt.children=dt}return L(N.type,Rt,vt)},oe.createContext=function(N){return N={$$typeof:h,_currentValue:N,_currentValue2:N,_threadCount:0,Provider:null,Consumer:null},N.Provider=N,N.Consumer={$$typeof:c,_context:N},N},oe.createElement=function(N,k,ut){var vt,Rt={},Z=null;if(k!=null)for(vt in k.key!==void 0&&(Z=""+k.key),k)T.call(k,vt)&&vt!=="key"&&vt!=="__self"&&vt!=="__source"&&(Rt[vt]=k[vt]);var dt=arguments.length-2;if(dt===1)Rt.children=ut;else if(1<dt){for(var yt=Array(dt),Ut=0;Ut<dt;Ut++)yt[Ut]=arguments[Ut+2];Rt.children=yt}if(N&&N.defaultProps)for(vt in dt=N.defaultProps,dt)Rt[vt]===void 0&&(Rt[vt]=dt[vt]);return L(N,Z,Rt)},oe.createRef=function(){return{current:null}},oe.forwardRef=function(N){return{$$typeof:d,render:N}},oe.isValidElement=P,oe.lazy=function(N){return{$$typeof:v,_payload:{_status:-1,_result:N},_init:at}},oe.memo=function(N,k){return{$$typeof:p,type:N,compare:k===void 0?null:k}},oe.startTransition=function(N){var k=I.T,ut={};I.T=ut;try{var vt=N(),Rt=I.S;Rt!==null&&Rt(ut,vt),typeof vt=="object"&&vt!==null&&typeof vt.then=="function"&&vt.then(F,$)}catch(Z){$(Z)}finally{k!==null&&ut.types!==null&&(k.types=ut.types),I.T=k}},oe.unstable_useCacheRefresh=function(){return I.H.useCacheRefresh()},oe.use=function(N){return I.H.use(N)},oe.useActionState=function(N,k,ut){return I.H.useActionState(N,k,ut)},oe.useCallback=function(N,k){return I.H.useCallback(N,k)},oe.useContext=function(N){return I.H.useContext(N)},oe.useDebugValue=function(){},oe.useDeferredValue=function(N,k){return I.H.useDeferredValue(N,k)},oe.useEffect=function(N,k){return I.H.useEffect(N,k)},oe.useEffectEvent=function(N){return I.H.useEffectEvent(N)},oe.useId=function(){return I.H.useId()},oe.useImperativeHandle=function(N,k,ut){return I.H.useImperativeHandle(N,k,ut)},oe.useInsertionEffect=function(N,k){return I.H.useInsertionEffect(N,k)},oe.useLayoutEffect=function(N,k){return I.H.useLayoutEffect(N,k)},oe.useMemo=function(N,k){return I.H.useMemo(N,k)},oe.useOptimistic=function(N,k){return I.H.useOptimistic(N,k)},oe.useReducer=function(N,k,ut){return I.H.useReducer(N,k,ut)},oe.useRef=function(N){return I.H.useRef(N)},oe.useState=function(N){return I.H.useState(N)},oe.useSyncExternalStore=function(N,k,ut){return I.H.useSyncExternalStore(N,k,ut)},oe.useTransition=function(){return I.H.useTransition()},oe.version="19.2.4",oe}var S_;function xp(){return S_||(S_=1,Ph.exports=Hy()),Ph.exports}var Xn=xp(),zh={exports:{}},nl={},Ih={exports:{}},Fh={};var y_;function Gy(){return y_||(y_=1,(function(r){function t(O,B){var at=O.length;O.push(B);t:for(;0<at;){var $=at-1>>>1,lt=O[$];if(0<l(lt,B))O[$]=B,O[at]=lt,at=$;else break t}}function i(O){return O.length===0?null:O[0]}function s(O){if(O.length===0)return null;var B=O[0],at=O.pop();if(at!==B){O[0]=at;t:for(var $=0,lt=O.length,N=lt>>>1;$<N;){var k=2*($+1)-1,ut=O[k],vt=k+1,Rt=O[vt];if(0>l(ut,at))vt<lt&&0>l(Rt,ut)?(O[$]=Rt,O[vt]=at,$=vt):(O[$]=ut,O[k]=at,$=k);else if(vt<lt&&0>l(Rt,at))O[$]=Rt,O[vt]=at,$=vt;else break t}}return B}function l(O,B){var at=O.sortIndex-B.sortIndex;return at!==0?at:O.id-B.id}if(r.unstable_now=void 0,typeof performance=="object"&&typeof performance.now=="function"){var c=performance;r.unstable_now=function(){return c.now()}}else{var h=Date,d=h.now();r.unstable_now=function(){return h.now()-d}}var m=[],p=[],v=1,g=null,_=3,M=!1,E=!1,A=!1,y=!1,S=typeof setTimeout=="function"?setTimeout:null,w=typeof clearTimeout=="function"?clearTimeout:null,D=typeof setImmediate<"u"?setImmediate:null;function U(O){for(var B=i(p);B!==null;){if(B.callback===null)s(p);else if(B.startTime<=O)s(p),B.sortIndex=B.expirationTime,t(m,B);else break;B=i(p)}}function H(O){if(A=!1,U(O),!E)if(i(m)!==null)E=!0,F||(F=!0,W());else{var B=i(p);B!==null&&et(H,B.startTime-O)}}var F=!1,I=-1,T=5,L=-1;function Q(){return y?!0:!(r.unstable_now()-L<T)}function P(){if(y=!1,F){var O=r.unstable_now();L=O;var B=!0;try{t:{E=!1,A&&(A=!1,w(I),I=-1),M=!0;var at=_;try{e:{for(U(O),g=i(m);g!==null&&!(g.expirationTime>O&&Q());){var $=g.callback;if(typeof $=="function"){g.callback=null,_=g.priorityLevel;var lt=$(g.expirationTime<=O);if(O=r.unstable_now(),typeof lt=="function"){g.callback=lt,U(O),B=!0;break e}g===i(m)&&s(m),U(O)}else s(m);g=i(m)}if(g!==null)B=!0;else{var N=i(p);N!==null&&et(H,N.startTime-O),B=!1}}break t}finally{g=null,_=at,M=!1}B=void 0}}finally{B?W():F=!1}}}var W;if(typeof D=="function")W=function(){D(P)};else if(typeof MessageChannel<"u"){var J=new MessageChannel,rt=J.port2;J.port1.onmessage=P,W=function(){rt.postMessage(null)}}else W=function(){S(P,0)};function et(O,B){I=S(function(){O(r.unstable_now())},B)}r.unstable_IdlePriority=5,r.unstable_ImmediatePriority=1,r.unstable_LowPriority=4,r.unstable_NormalPriority=3,r.unstable_Profiling=null,r.unstable_UserBlockingPriority=2,r.unstable_cancelCallback=function(O){O.callback=null},r.unstable_forceFrameRate=function(O){0>O||125<O?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):T=0<O?Math.floor(1e3/O):5},r.unstable_getCurrentPriorityLevel=function(){return _},r.unstable_next=function(O){switch(_){case 1:case 2:case 3:var B=3;break;default:B=_}var at=_;_=B;try{return O()}finally{_=at}},r.unstable_requestPaint=function(){y=!0},r.unstable_runWithPriority=function(O,B){switch(O){case 1:case 2:case 3:case 4:case 5:break;default:O=3}var at=_;_=O;try{return B()}finally{_=at}},r.unstable_scheduleCallback=function(O,B,at){var $=r.unstable_now();switch(typeof at=="object"&&at!==null?(at=at.delay,at=typeof at=="number"&&0<at?$+at:$):at=$,O){case 1:var lt=-1;break;case 2:lt=250;break;case 5:lt=1073741823;break;case 4:lt=1e4;break;default:lt=5e3}return lt=at+lt,O={id:v++,callback:B,priorityLevel:O,startTime:at,expirationTime:lt,sortIndex:-1},at>$?(O.sortIndex=at,t(p,O),i(m)===null&&O===i(p)&&(A?(w(I),I=-1):A=!0,et(H,at-$))):(O.sortIndex=lt,t(m,O),E||M||(E=!0,F||(F=!0,W()))),O},r.unstable_shouldYield=Q,r.unstable_wrapCallback=function(O){var B=_;return function(){var at=_;_=B;try{return O.apply(this,arguments)}finally{_=at}}}})(Fh)),Fh}var M_;function Vy(){return M_||(M_=1,Ih.exports=Gy()),Ih.exports}var Bh={exports:{}},Nn={};var E_;function ky(){if(E_)return Nn;E_=1;var r=xp();function t(m){var p="https://react.dev/errors/"+m;if(1<arguments.length){p+="?args[]="+encodeURIComponent(arguments[1]);for(var v=2;v<arguments.length;v++)p+="&args[]="+encodeURIComponent(arguments[v])}return"Minified React error #"+m+"; visit "+p+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function i(){}var s={d:{f:i,r:function(){throw Error(t(522))},D:i,C:i,L:i,m:i,X:i,S:i,M:i},p:0,findDOMNode:null},l=Symbol.for("react.portal");function c(m,p,v){var g=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:l,key:g==null?null:""+g,children:m,containerInfo:p,implementation:v}}var h=r.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;function d(m,p){if(m==="font")return"";if(typeof p=="string")return p==="use-credentials"?p:""}return Nn.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=s,Nn.createPortal=function(m,p){var v=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!p||p.nodeType!==1&&p.nodeType!==9&&p.nodeType!==11)throw Error(t(299));return c(m,p,null,v)},Nn.flushSync=function(m){var p=h.T,v=s.p;try{if(h.T=null,s.p=2,m)return m()}finally{h.T=p,s.p=v,s.d.f()}},Nn.preconnect=function(m,p){typeof m=="string"&&(p?(p=p.crossOrigin,p=typeof p=="string"?p==="use-credentials"?p:"":void 0):p=null,s.d.C(m,p))},Nn.prefetchDNS=function(m){typeof m=="string"&&s.d.D(m)},Nn.preinit=function(m,p){if(typeof m=="string"&&p&&typeof p.as=="string"){var v=p.as,g=d(v,p.crossOrigin),_=typeof p.integrity=="string"?p.integrity:void 0,M=typeof p.fetchPriority=="string"?p.fetchPriority:void 0;v==="style"?s.d.S(m,typeof p.precedence=="string"?p.precedence:void 0,{crossOrigin:g,integrity:_,fetchPriority:M}):v==="script"&&s.d.X(m,{crossOrigin:g,integrity:_,fetchPriority:M,nonce:typeof p.nonce=="string"?p.nonce:void 0})}},Nn.preinitModule=function(m,p){if(typeof m=="string")if(typeof p=="object"&&p!==null){if(p.as==null||p.as==="script"){var v=d(p.as,p.crossOrigin);s.d.M(m,{crossOrigin:v,integrity:typeof p.integrity=="string"?p.integrity:void 0,nonce:typeof p.nonce=="string"?p.nonce:void 0})}}else p==null&&s.d.M(m)},Nn.preload=function(m,p){if(typeof m=="string"&&typeof p=="object"&&p!==null&&typeof p.as=="string"){var v=p.as,g=d(v,p.crossOrigin);s.d.L(m,v,{crossOrigin:g,integrity:typeof p.integrity=="string"?p.integrity:void 0,nonce:typeof p.nonce=="string"?p.nonce:void 0,type:typeof p.type=="string"?p.type:void 0,fetchPriority:typeof p.fetchPriority=="string"?p.fetchPriority:void 0,referrerPolicy:typeof p.referrerPolicy=="string"?p.referrerPolicy:void 0,imageSrcSet:typeof p.imageSrcSet=="string"?p.imageSrcSet:void 0,imageSizes:typeof p.imageSizes=="string"?p.imageSizes:void 0,media:typeof p.media=="string"?p.media:void 0})}},Nn.preloadModule=function(m,p){if(typeof m=="string")if(p){var v=d(p.as,p.crossOrigin);s.d.m(m,{as:typeof p.as=="string"&&p.as!=="script"?p.as:void 0,crossOrigin:v,integrity:typeof p.integrity=="string"?p.integrity:void 0})}else s.d.m(m)},Nn.requestFormReset=function(m){s.d.r(m)},Nn.unstable_batchedUpdates=function(m,p){return m(p)},Nn.useFormState=function(m,p,v){return h.H.useFormState(m,p,v)},Nn.useFormStatus=function(){return h.H.useHostTransitionStatus()},Nn.version="19.2.4",Nn}var b_;function Xy(){if(b_)return Bh.exports;b_=1;function r(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(r)}catch(t){console.error(t)}}return r(),Bh.exports=ky(),Bh.exports}var T_;function Wy(){if(T_)return nl;T_=1;var r=Vy(),t=xp(),i=Xy();function s(e){var n="https://react.dev/errors/"+e;if(1<arguments.length){n+="?args[]="+encodeURIComponent(arguments[1]);for(var a=2;a<arguments.length;a++)n+="&args[]="+encodeURIComponent(arguments[a])}return"Minified React error #"+e+"; visit "+n+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function l(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11)}function c(e){var n=e,a=e;if(e.alternate)for(;n.return;)n=n.return;else{e=n;do n=e,(n.flags&4098)!==0&&(a=n.return),e=n.return;while(e)}return n.tag===3?a:null}function h(e){if(e.tag===13){var n=e.memoizedState;if(n===null&&(e=e.alternate,e!==null&&(n=e.memoizedState)),n!==null)return n.dehydrated}return null}function d(e){if(e.tag===31){var n=e.memoizedState;if(n===null&&(e=e.alternate,e!==null&&(n=e.memoizedState)),n!==null)return n.dehydrated}return null}function m(e){if(c(e)!==e)throw Error(s(188))}function p(e){var n=e.alternate;if(!n){if(n=c(e),n===null)throw Error(s(188));return n!==e?null:e}for(var a=e,o=n;;){var u=a.return;if(u===null)break;var f=u.alternate;if(f===null){if(o=u.return,o!==null){a=o;continue}break}if(u.child===f.child){for(f=u.child;f;){if(f===a)return m(u),e;if(f===o)return m(u),n;f=f.sibling}throw Error(s(188))}if(a.return!==o.return)a=u,o=f;else{for(var x=!1,R=u.child;R;){if(R===a){x=!0,a=u,o=f;break}if(R===o){x=!0,o=u,a=f;break}R=R.sibling}if(!x){for(R=f.child;R;){if(R===a){x=!0,a=f,o=u;break}if(R===o){x=!0,o=f,a=u;break}R=R.sibling}if(!x)throw Error(s(189))}}if(a.alternate!==o)throw Error(s(190))}if(a.tag!==3)throw Error(s(188));return a.stateNode.current===a?e:n}function v(e){var n=e.tag;if(n===5||n===26||n===27||n===6)return e;for(e=e.child;e!==null;){if(n=v(e),n!==null)return n;e=e.sibling}return null}var g=Object.assign,_=Symbol.for("react.element"),M=Symbol.for("react.transitional.element"),E=Symbol.for("react.portal"),A=Symbol.for("react.fragment"),y=Symbol.for("react.strict_mode"),S=Symbol.for("react.profiler"),w=Symbol.for("react.consumer"),D=Symbol.for("react.context"),U=Symbol.for("react.forward_ref"),H=Symbol.for("react.suspense"),F=Symbol.for("react.suspense_list"),I=Symbol.for("react.memo"),T=Symbol.for("react.lazy"),L=Symbol.for("react.activity"),Q=Symbol.for("react.memo_cache_sentinel"),P=Symbol.iterator;function W(e){return e===null||typeof e!="object"?null:(e=P&&e[P]||e["@@iterator"],typeof e=="function"?e:null)}var J=Symbol.for("react.client.reference");function rt(e){if(e==null)return null;if(typeof e=="function")return e.$$typeof===J?null:e.displayName||e.name||null;if(typeof e=="string")return e;switch(e){case A:return"Fragment";case S:return"Profiler";case y:return"StrictMode";case H:return"Suspense";case F:return"SuspenseList";case L:return"Activity"}if(typeof e=="object")switch(e.$$typeof){case E:return"Portal";case D:return e.displayName||"Context";case w:return(e._context.displayName||"Context")+".Consumer";case U:var n=e.render;return e=e.displayName,e||(e=n.displayName||n.name||"",e=e!==""?"ForwardRef("+e+")":"ForwardRef"),e;case I:return n=e.displayName||null,n!==null?n:rt(e.type)||"Memo";case T:n=e._payload,e=e._init;try{return rt(e(n))}catch{}}return null}var et=Array.isArray,O=t.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,B=i.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,at={pending:!1,data:null,method:null,action:null},$=[],lt=-1;function N(e){return{current:e}}function k(e){0>lt||(e.current=$[lt],$[lt]=null,lt--)}function ut(e,n){lt++,$[lt]=e.current,e.current=n}var vt=N(null),Rt=N(null),Z=N(null),dt=N(null);function yt(e,n){switch(ut(Z,n),ut(Rt,e),ut(vt,null),n.nodeType){case 9:case 11:e=(e=n.documentElement)&&(e=e.namespaceURI)?H0(e):0;break;default:if(e=n.tagName,n=n.namespaceURI)n=H0(n),e=G0(n,e);else switch(e){case"svg":e=1;break;case"math":e=2;break;default:e=0}}k(vt),ut(vt,e)}function Ut(){k(vt),k(Rt),k(Z)}function Ft(e){e.memoizedState!==null&&ut(dt,e);var n=vt.current,a=G0(n,e.type);n!==a&&(ut(Rt,e),ut(vt,a))}function Xt(e){Rt.current===e&&(k(vt),k(Rt)),dt.current===e&&(k(dt),Qo._currentValue=at)}var ge,Jt;function _e(e){if(ge===void 0)try{throw Error()}catch(a){var n=a.stack.trim().match(/\n( *(at )?)/);ge=n&&n[1]||"",Jt=-1<a.stack.indexOf(`
2
2
  at`)?" (<anonymous>)":-1<a.stack.indexOf("@")?"@unknown:0:0":""}return`
3
- `+ge+e+Jt}var Te=!1;function ae(e,n){if(!e||Te)return"";Te=!0;var a=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{var o={DetermineComponentFrameRoot:function(){try{if(n){var St=function(){throw Error()};if(Object.defineProperty(St.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(St,[])}catch(ht){var ct=ht}Reflect.construct(e,[],St)}else{try{St.call()}catch(ht){ct=ht}e.call(St.prototype)}}else{try{throw Error()}catch(ht){ct=ht}(St=e())&&typeof St.catch=="function"&&St.catch(function(){})}}catch(ht){if(ht&&ct&&typeof ht.stack=="string")return[ht.stack,ct.stack]}return[null,null]}};o.DetermineComponentFrameRoot.displayName="DetermineComponentFrameRoot";var u=Object.getOwnPropertyDescriptor(o.DetermineComponentFrameRoot,"name");u&&u.configurable&&Object.defineProperty(o.DetermineComponentFrameRoot,"name",{value:"DetermineComponentFrameRoot"});var f=o.DetermineComponentFrameRoot(),S=f[0],R=f[1];if(S&&R){var G=S.split(`
3
+ `+ge+e+Jt}var Te=!1;function ae(e,n){if(!e||Te)return"";Te=!0;var a=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{var o={DetermineComponentFrameRoot:function(){try{if(n){var St=function(){throw Error()};if(Object.defineProperty(St.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(St,[])}catch(ht){var ct=ht}Reflect.construct(e,[],St)}else{try{St.call()}catch(ht){ct=ht}e.call(St.prototype)}}else{try{throw Error()}catch(ht){ct=ht}(St=e())&&typeof St.catch=="function"&&St.catch(function(){})}}catch(ht){if(ht&&ct&&typeof ht.stack=="string")return[ht.stack,ct.stack]}return[null,null]}};o.DetermineComponentFrameRoot.displayName="DetermineComponentFrameRoot";var u=Object.getOwnPropertyDescriptor(o.DetermineComponentFrameRoot,"name");u&&u.configurable&&Object.defineProperty(o.DetermineComponentFrameRoot,"name",{value:"DetermineComponentFrameRoot"});var f=o.DetermineComponentFrameRoot(),x=f[0],R=f[1];if(x&&R){var G=x.split(`
4
4
  `),st=R.split(`
5
5
  `);for(u=o=0;o<G.length&&!G[o].includes("DetermineComponentFrameRoot");)o++;for(;u<st.length&&!st[u].includes("DetermineComponentFrameRoot");)u++;if(o===G.length||u===st.length)for(o=G.length-1,u=st.length-1;1<=o&&0<=u&&G[o]!==st[u];)u--;for(;1<=o&&0<=u;o--,u--)if(G[o]!==st[u]){if(o!==1||u!==1)do if(o--,u--,0>u||G[o]!==st[u]){var gt=`
6
6
  `+G[o].replace(" at new "," at ");return e.displayName&&gt.includes("<anonymous>")&&(gt=gt.replace("<anonymous>",e.displayName)),gt}while(1<=o&&0<=u);break}}}finally{Te=!1,Error.prepareStackTrace=a}return(a=e?e.displayName||e.name:"")?_e(a):""}function $e(e,n){switch(e.tag){case 26:case 27:case 5:return _e(e.type);case 16:return _e("Lazy");case 13:return e.child!==n&&n!==null?_e("Suspense Fallback"):_e("Suspense");case 19:return _e("SuspenseList");case 0:case 15:return ae(e.type,!1);case 11:return ae(e.type.render,!1);case 1:return ae(e.type,!0);case 31:return _e("Activity");default:return""}}function V(e){try{var n="",a=null;do n+=$e(e,a),a=e,e=e.return;while(e);return n}catch(o){return`
7
7
  Error generating stack: `+o.message+`
8
- `+o.stack}}var je=Object.prototype.hasOwnProperty,be=r.unstable_scheduleCallback,Ne=r.unstable_cancelCallback,Yt=r.unstable_shouldYield,z=r.unstable_requestPaint,b=r.unstable_now,K=r.unstable_getCurrentPriorityLevel,_t=r.unstable_ImmediatePriority,Mt=r.unstable_UserBlockingPriority,mt=r.unstable_NormalPriority,Wt=r.unstable_LowPriority,wt=r.unstable_IdlePriority,Kt=r.log,te=r.unstable_setDisableYieldValue,Tt=null,Et=null;function Pt(e){if(typeof Kt=="function"&&te(e),Et&&typeof Et.setStrictMode=="function")try{Et.setStrictMode(Tt,e)}catch{}}var Ot=Math.clz32?Math.clz32:Y,zt=Math.log,fe=Math.LN2;function Y(e){return e>>>=0,e===0?32:31-(zt(e)/fe|0)|0}var Ct=256,At=262144,It=4194304;function bt(e){var n=e&42;if(n!==0)return n;switch(e&-e){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:return 64;case 128:return 128;case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:return e&261888;case 262144:case 524288:case 1048576:case 2097152:return e&3932160;case 4194304:case 8388608:case 16777216:case 33554432:return e&62914560;case 67108864:return 67108864;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 0;default:return e}}function pt(e,n,a){var o=e.pendingLanes;if(o===0)return 0;var u=0,f=e.suspendedLanes,S=e.pingedLanes;e=e.warmLanes;var R=o&134217727;return R!==0?(o=R&~f,o!==0?u=bt(o):(S&=R,S!==0?u=bt(S):a||(a=R&~e,a!==0&&(u=bt(a))))):(R=o&~f,R!==0?u=bt(R):S!==0?u=bt(S):a||(a=o&~e,a!==0&&(u=bt(a)))),u===0?0:n!==0&&n!==u&&(n&f)===0&&(f=u&-u,a=n&-n,f>=a||f===32&&(a&4194048)!==0)?n:u}function Ht(e,n){return(e.pendingLanes&~(e.suspendedLanes&~e.pingedLanes)&n)===0}function ie(e,n){switch(e){case 1:case 2:case 4:case 8:case 64:return n+250;case 16:case 32:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return n+5e3;case 4194304:case 8388608:case 16777216:case 33554432:return-1;case 67108864:case 134217728:case 268435456:case 536870912:case 1073741824:return-1;default:return-1}}function Pe(){var e=It;return It<<=1,(It&62914560)===0&&(It=4194304),e}function Ae(e){for(var n=[],a=0;31>a;a++)n.push(e);return n}function Hn(e,n){e.pendingLanes|=n,n!==268435456&&(e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0)}function Ci(e,n,a,o,u,f){var S=e.pendingLanes;e.pendingLanes=a,e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0,e.expiredLanes&=a,e.entangledLanes&=a,e.errorRecoveryDisabledLanes&=a,e.shellSuspendCounter=0;var R=e.entanglements,G=e.expirationTimes,st=e.hiddenUpdates;for(a=S&~a;0<a;){var gt=31-Ot(a),St=1<<gt;R[gt]=0,G[gt]=-1;var ct=st[gt];if(ct!==null)for(st[gt]=null,gt=0;gt<ct.length;gt++){var ht=ct[gt];ht!==null&&(ht.lane&=-536870913)}a&=~St}o!==0&&co(e,o,0),f!==0&&u===0&&e.tag!==0&&(e.suspendedLanes|=f&~(S&~n))}function co(e,n,a){e.pendingLanes|=n,e.suspendedLanes&=~n;var o=31-Ot(n);e.entangledLanes|=n,e.entanglements[o]=e.entanglements[o]|1073741824|a&261930}function $s(e,n){var a=e.entangledLanes|=n;for(e=e.entanglements;a;){var o=31-Ot(a),u=1<<o;u&n|e[o]&n&&(e[o]|=n),a&=~u}}function xl(e,n){var a=n&-n;return a=(a&42)!==0?1:tr(a),(a&(e.suspendedLanes|n))!==0?0:a}function tr(e){switch(e){case 2:e=1;break;case 8:e=4;break;case 32:e=16;break;case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:case 4194304:case 8388608:case 16777216:case 33554432:e=128;break;case 268435456:e=134217728;break;default:e=0}return e}function er(e){return e&=-e,2<e?8<e?(e&134217727)!==0?32:268435456:8:2}function Wi(){var e=B.p;return e!==0?e:(e=window.event,e===void 0?32:c_(e.type))}function nr(e,n){var a=B.p;try{return B.p=e,n()}finally{B.p=a}}var wi=Math.random().toString(36).slice(2),rn="__reactFiber$"+wi,mn="__reactProps$"+wi,oa="__reactContainer$"+wi,Ia="__reactEvents$"+wi,Sl="__reactListeners$"+wi,yl="__reactHandles$"+wi,Ml="__reactResources$"+wi,Ms="__reactMarker$"+wi;function uo(e){delete e[rn],delete e[mn],delete e[Ia],delete e[Sl],delete e[yl]}function Fa(e){var n=e[rn];if(n)return n;for(var a=e.parentNode;a;){if(n=a[oa]||a[rn]){if(a=n.alternate,n.child!==null||a!==null&&a.child!==null)for(e=Y0(e);e!==null;){if(a=e[rn])return a;e=Y0(e)}return n}e=a,a=e.parentNode}return null}function Ba(e){if(e=e[rn]||e[oa]){var n=e.tag;if(n===5||n===6||n===13||n===31||n===26||n===27||n===3)return e}return null}function Es(e){var n=e.tag;if(n===5||n===26||n===27||n===6)return e.stateNode;throw Error(s(33))}function C(e){var n=e[Ml];return n||(n=e[Ml]={hoistableStyles:new Map,hoistableScripts:new Map}),n}function q(e){e[Ms]=!0}var ft=new Set,ot={};function nt(e,n){Dt(e,n),Dt(e+"Capture",n)}function Dt(e,n){for(ot[e]=n,e=0;e<n.length;e++)ft.add(n[e])}var Bt=RegExp("^[:A-Z_a-z\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD][:A-Z_a-z\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD\\-.0-9\\u00B7\\u0300-\\u036F\\u203F-\\u2040]*$"),Nt={},qt={};function Zt(e){return je.call(qt,e)?!0:je.call(Nt,e)?!1:Bt.test(e)?qt[e]=!0:(Nt[e]=!0,!1)}function ne(e,n,a){if(Zt(n))if(a===null)e.removeAttribute(n);else{switch(typeof a){case"undefined":case"function":case"symbol":e.removeAttribute(n);return;case"boolean":var o=n.toLowerCase().slice(0,5);if(o!=="data-"&&o!=="aria-"){e.removeAttribute(n);return}}e.setAttribute(n,""+a)}}function re(e,n,a){if(a===null)e.removeAttribute(n);else{switch(typeof a){case"undefined":case"function":case"symbol":case"boolean":e.removeAttribute(n);return}e.setAttribute(n,""+a)}}function Gt(e,n,a,o){if(o===null)e.removeAttribute(a);else{switch(typeof o){case"undefined":case"function":case"symbol":case"boolean":e.removeAttribute(a);return}e.setAttributeNS(n,a,""+o)}}function he(e){switch(typeof e){case"bigint":case"boolean":case"number":case"string":case"undefined":return e;case"object":return e;default:return""}}function Ze(e){var n=e.type;return(e=e.nodeName)&&e.toLowerCase()==="input"&&(n==="checkbox"||n==="radio")}function Ke(e,n,a){var o=Object.getOwnPropertyDescriptor(e.constructor.prototype,n);if(!e.hasOwnProperty(n)&&typeof o<"u"&&typeof o.get=="function"&&typeof o.set=="function"){var u=o.get,f=o.set;return Object.defineProperty(e,n,{configurable:!0,get:function(){return u.call(this)},set:function(S){a=""+S,f.call(this,S)}}),Object.defineProperty(e,n,{enumerable:o.enumerable}),{getValue:function(){return a},setValue:function(S){a=""+S},stopTracking:function(){e._valueTracker=null,delete e[n]}}}}function Ce(e){if(!e._valueTracker){var n=Ze(e)?"checked":"value";e._valueTracker=Ke(e,n,""+e[n])}}function gn(e){if(!e)return!1;var n=e._valueTracker;if(!n)return!0;var a=n.getValue(),o="";return e&&(o=Ze(e)?e.checked?"true":"false":e.value),e=o,e!==a?(n.setValue(e),!0):!1}function kt(e){if(e=e||(typeof document<"u"?document:void 0),typeof e>"u")return null;try{return e.activeElement||e.body}catch{return e.body}}var Gn=/[\n"\\]/g;function se(e){return e.replace(Gn,function(n){return"\\"+n.charCodeAt(0).toString(16)+" "})}function Vn(e,n,a,o,u,f,S,R){e.name="",S!=null&&typeof S!="function"&&typeof S!="symbol"&&typeof S!="boolean"?e.type=S:e.removeAttribute("type"),n!=null?S==="number"?(n===0&&e.value===""||e.value!=n)&&(e.value=""+he(n)):e.value!==""+he(n)&&(e.value=""+he(n)):S!=="submit"&&S!=="reset"||e.removeAttribute("value"),n!=null?Di(e,S,he(n)):a!=null?Di(e,S,he(a)):o!=null&&e.removeAttribute("value"),u==null&&f!=null&&(e.defaultChecked=!!f),u!=null&&(e.checked=u&&typeof u!="function"&&typeof u!="symbol"),R!=null&&typeof R!="function"&&typeof R!="symbol"&&typeof R!="boolean"?e.name=""+he(R):e.removeAttribute("name")}function ai(e,n,a,o,u,f,S,R){if(f!=null&&typeof f!="function"&&typeof f!="symbol"&&typeof f!="boolean"&&(e.type=f),n!=null||a!=null){if(!(f!=="submit"&&f!=="reset"||n!=null)){Ce(e);return}a=a!=null?""+he(a):"",n=n!=null?""+he(n):a,R||n===e.value||(e.value=n),e.defaultValue=n}o=o??u,o=typeof o!="function"&&typeof o!="symbol"&&!!o,e.checked=R?e.checked:!!o,e.defaultChecked=!!o,S!=null&&typeof S!="function"&&typeof S!="symbol"&&typeof S!="boolean"&&(e.name=S),Ce(e)}function Di(e,n,a){n==="number"&&kt(e.ownerDocument)===e||e.defaultValue===""+a||(e.defaultValue=""+a)}function si(e,n,a,o){if(e=e.options,n){n={};for(var u=0;u<a.length;u++)n["$"+a[u]]=!0;for(a=0;a<e.length;a++)u=n.hasOwnProperty("$"+e[a].value),e[a].selected!==u&&(e[a].selected=u),u&&o&&(e[a].defaultSelected=!0)}else{for(a=""+he(a),n=null,u=0;u<e.length;u++){if(e[u].value===a){e[u].selected=!0,o&&(e[u].defaultSelected=!0);return}n!==null||e[u].disabled||(n=e[u])}n!==null&&(n.selected=!0)}}function Oe(e,n,a){if(n!=null&&(n=""+he(n),n!==e.value&&(e.value=n),a==null)){e.defaultValue!==n&&(e.defaultValue=n);return}e.defaultValue=a!=null?""+he(a):""}function on(e,n,a,o){if(n==null){if(o!=null){if(a!=null)throw Error(s(92));if(et(o)){if(1<o.length)throw Error(s(93));o=o[0]}a=o}a==null&&(a=""),n=a}a=he(n),e.defaultValue=a,o=e.textContent,o===a&&o!==""&&o!==null&&(e.value=o),Ce(e)}function kn(e,n){if(n){var a=e.firstChild;if(a&&a===e.lastChild&&a.nodeType===3){a.nodeValue=n;return}}e.textContent=n}var ln=new Set("animationIterationCount aspectRatio borderImageOutset borderImageSlice borderImageWidth boxFlex boxFlexGroup boxOrdinalGroup columnCount columns flex flexGrow flexPositive flexShrink flexNegative flexOrder gridArea gridRow gridRowEnd gridRowSpan gridRowStart gridColumn gridColumnEnd gridColumnSpan gridColumnStart fontWeight lineClamp lineHeight opacity order orphans scale tabSize widows zIndex zoom fillOpacity floodOpacity stopOpacity strokeDasharray strokeDashoffset strokeMiterlimit strokeOpacity strokeWidth MozAnimationIterationCount MozBoxFlex MozBoxFlexGroup MozLineClamp msAnimationIterationCount msFlex msZoom msFlexGrow msFlexNegative msFlexOrder msFlexPositive msFlexShrink msGridColumn msGridColumnSpan msGridRow msGridRowSpan WebkitAnimationIterationCount WebkitBoxFlex WebKitBoxFlexGroup WebkitBoxOrdinalGroup WebkitColumnCount WebkitColumns WebkitFlex WebkitFlexGrow WebkitFlexPositive WebkitFlexShrink WebkitLineClamp".split(" "));function Ui(e,n,a){var o=n.indexOf("--")===0;a==null||typeof a=="boolean"||a===""?o?e.setProperty(n,""):n==="float"?e.cssFloat="":e[n]="":o?e.setProperty(n,a):typeof a!="number"||a===0||ln.has(n)?n==="float"?e.cssFloat=a:e[n]=(""+a).trim():e[n]=a+"px"}function la(e,n,a){if(n!=null&&typeof n!="object")throw Error(s(62));if(e=e.style,a!=null){for(var o in a)!a.hasOwnProperty(o)||n!=null&&n.hasOwnProperty(o)||(o.indexOf("--")===0?e.setProperty(o,""):o==="float"?e.cssFloat="":e[o]="");for(var u in n)o=n[u],n.hasOwnProperty(u)&&a[u]!==o&&Ui(e,u,o)}else for(var f in n)n.hasOwnProperty(f)&&Ui(e,f,n[f])}function ir(e){if(e.indexOf("-")===-1)return!1;switch(e){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 Ux=new Map([["acceptCharset","accept-charset"],["htmlFor","for"],["httpEquiv","http-equiv"],["crossOrigin","crossorigin"],["accentHeight","accent-height"],["alignmentBaseline","alignment-baseline"],["arabicForm","arabic-form"],["baselineShift","baseline-shift"],["capHeight","cap-height"],["clipPath","clip-path"],["clipRule","clip-rule"],["colorInterpolation","color-interpolation"],["colorInterpolationFilters","color-interpolation-filters"],["colorProfile","color-profile"],["colorRendering","color-rendering"],["dominantBaseline","dominant-baseline"],["enableBackground","enable-background"],["fillOpacity","fill-opacity"],["fillRule","fill-rule"],["floodColor","flood-color"],["floodOpacity","flood-opacity"],["fontFamily","font-family"],["fontSize","font-size"],["fontSizeAdjust","font-size-adjust"],["fontStretch","font-stretch"],["fontStyle","font-style"],["fontVariant","font-variant"],["fontWeight","font-weight"],["glyphName","glyph-name"],["glyphOrientationHorizontal","glyph-orientation-horizontal"],["glyphOrientationVertical","glyph-orientation-vertical"],["horizAdvX","horiz-adv-x"],["horizOriginX","horiz-origin-x"],["imageRendering","image-rendering"],["letterSpacing","letter-spacing"],["lightingColor","lighting-color"],["markerEnd","marker-end"],["markerMid","marker-mid"],["markerStart","marker-start"],["overlinePosition","overline-position"],["overlineThickness","overline-thickness"],["paintOrder","paint-order"],["panose-1","panose-1"],["pointerEvents","pointer-events"],["renderingIntent","rendering-intent"],["shapeRendering","shape-rendering"],["stopColor","stop-color"],["stopOpacity","stop-opacity"],["strikethroughPosition","strikethrough-position"],["strikethroughThickness","strikethrough-thickness"],["strokeDasharray","stroke-dasharray"],["strokeDashoffset","stroke-dashoffset"],["strokeLinecap","stroke-linecap"],["strokeLinejoin","stroke-linejoin"],["strokeMiterlimit","stroke-miterlimit"],["strokeOpacity","stroke-opacity"],["strokeWidth","stroke-width"],["textAnchor","text-anchor"],["textDecoration","text-decoration"],["textRendering","text-rendering"],["transformOrigin","transform-origin"],["underlinePosition","underline-position"],["underlineThickness","underline-thickness"],["unicodeBidi","unicode-bidi"],["unicodeRange","unicode-range"],["unitsPerEm","units-per-em"],["vAlphabetic","v-alphabetic"],["vHanging","v-hanging"],["vIdeographic","v-ideographic"],["vMathematical","v-mathematical"],["vectorEffect","vector-effect"],["vertAdvY","vert-adv-y"],["vertOriginX","vert-origin-x"],["vertOriginY","vert-origin-y"],["wordSpacing","word-spacing"],["writingMode","writing-mode"],["xmlnsXlink","xmlns:xlink"],["xHeight","x-height"]]),Lx=/^[\u0000-\u001F ]*j[\r\n\t]*a[\r\n\t]*v[\r\n\t]*a[\r\n\t]*s[\r\n\t]*c[\r\n\t]*r[\r\n\t]*i[\r\n\t]*p[\r\n\t]*t[\r\n\t]*:/i;function El(e){return Lx.test(""+e)?"javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')":e}function ca(){}var Cu=null;function wu(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var ar=null,sr=null;function Fp(e){var n=Ba(e);if(n&&(e=n.stateNode)){var a=e[mn]||null;t:switch(e=n.stateNode,n.type){case"input":if(Vn(e,a.value,a.defaultValue,a.defaultValue,a.checked,a.defaultChecked,a.type,a.name),n=a.name,a.type==="radio"&&n!=null){for(a=e;a.parentNode;)a=a.parentNode;for(a=a.querySelectorAll('input[name="'+se(""+n)+'"][type="radio"]'),n=0;n<a.length;n++){var o=a[n];if(o!==e&&o.form===e.form){var u=o[mn]||null;if(!u)throw Error(s(90));Vn(o,u.value,u.defaultValue,u.defaultValue,u.checked,u.defaultChecked,u.type,u.name)}}for(n=0;n<a.length;n++)o=a[n],o.form===e.form&&gn(o)}break t;case"textarea":Oe(e,a.value,a.defaultValue);break t;case"select":n=a.value,n!=null&&si(e,!!a.multiple,n,!1)}}}var Du=!1;function Bp(e,n,a){if(Du)return e(n,a);Du=!0;try{var o=e(n);return o}finally{if(Du=!1,(ar!==null||sr!==null)&&(uc(),ar&&(n=ar,e=sr,sr=ar=null,Fp(n),e)))for(n=0;n<e.length;n++)Fp(e[n])}}function fo(e,n){var a=e.stateNode;if(a===null)return null;var o=a[mn]||null;if(o===null)return null;a=o[n];t:switch(n){case"onClick":case"onClickCapture":case"onDoubleClick":case"onDoubleClickCapture":case"onMouseDown":case"onMouseDownCapture":case"onMouseMove":case"onMouseMoveCapture":case"onMouseUp":case"onMouseUpCapture":case"onMouseEnter":(o=!o.disabled)||(e=e.type,o=!(e==="button"||e==="input"||e==="select"||e==="textarea")),e=!o;break t;default:e=!1}if(e)return null;if(a&&typeof a!="function")throw Error(s(231,n,typeof a));return a}var ua=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),Uu=!1;if(ua)try{var ho={};Object.defineProperty(ho,"passive",{get:function(){Uu=!0}}),window.addEventListener("test",ho,ho),window.removeEventListener("test",ho,ho)}catch{Uu=!1}var Ha=null,Lu=null,bl=null;function Hp(){if(bl)return bl;var e,n=Lu,a=n.length,o,u="value"in Ha?Ha.value:Ha.textContent,f=u.length;for(e=0;e<a&&n[e]===u[e];e++);var S=a-e;for(o=1;o<=S&&n[a-o]===u[f-o];o++);return bl=u.slice(e,1<o?1-o:void 0)}function Tl(e){var n=e.keyCode;return"charCode"in e?(e=e.charCode,e===0&&n===13&&(e=13)):e=n,e===10&&(e=13),32<=e||e===13?e:0}function Al(){return!0}function Gp(){return!1}function Zn(e){function n(a,o,u,f,S){this._reactName=a,this._targetInst=u,this.type=o,this.nativeEvent=f,this.target=S,this.currentTarget=null;for(var R in e)e.hasOwnProperty(R)&&(a=e[R],this[R]=a?a(f):f[R]);return this.isDefaultPrevented=(f.defaultPrevented!=null?f.defaultPrevented:f.returnValue===!1)?Al:Gp,this.isPropagationStopped=Gp,this}return g(n.prototype,{preventDefault:function(){this.defaultPrevented=!0;var a=this.nativeEvent;a&&(a.preventDefault?a.preventDefault():typeof a.returnValue!="unknown"&&(a.returnValue=!1),this.isDefaultPrevented=Al)},stopPropagation:function(){var a=this.nativeEvent;a&&(a.stopPropagation?a.stopPropagation():typeof a.cancelBubble!="unknown"&&(a.cancelBubble=!0),this.isPropagationStopped=Al)},persist:function(){},isPersistent:Al}),n}var bs={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(e){return e.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},Rl=Zn(bs),po=g({},bs,{view:0,detail:0}),Nx=Zn(po),Nu,Ou,mo,Cl=g({},po,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:zu,button:0,buttons:0,relatedTarget:function(e){return e.relatedTarget===void 0?e.fromElement===e.srcElement?e.toElement:e.fromElement:e.relatedTarget},movementX:function(e){return"movementX"in e?e.movementX:(e!==mo&&(mo&&e.type==="mousemove"?(Nu=e.screenX-mo.screenX,Ou=e.screenY-mo.screenY):Ou=Nu=0,mo=e),Nu)},movementY:function(e){return"movementY"in e?e.movementY:Ou}}),Vp=Zn(Cl),Ox=g({},Cl,{dataTransfer:0}),Px=Zn(Ox),zx=g({},po,{relatedTarget:0}),Pu=Zn(zx),Ix=g({},bs,{animationName:0,elapsedTime:0,pseudoElement:0}),Fx=Zn(Ix),Bx=g({},bs,{clipboardData:function(e){return"clipboardData"in e?e.clipboardData:window.clipboardData}}),Hx=Zn(Bx),Gx=g({},bs,{data:0}),kp=Zn(Gx),Vx={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},kx={8:"Backspace",9:"Tab",12:"Clear",13:"Enter",16:"Shift",17:"Control",18:"Alt",19:"Pause",20:"CapsLock",27:"Escape",32:" ",33:"PageUp",34:"PageDown",35:"End",36:"Home",37:"ArrowLeft",38:"ArrowUp",39:"ArrowRight",40:"ArrowDown",45:"Insert",46:"Delete",112:"F1",113:"F2",114:"F3",115:"F4",116:"F5",117:"F6",118:"F7",119:"F8",120:"F9",121:"F10",122:"F11",123:"F12",144:"NumLock",145:"ScrollLock",224:"Meta"},Xx={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function Wx(e){var n=this.nativeEvent;return n.getModifierState?n.getModifierState(e):(e=Xx[e])?!!n[e]:!1}function zu(){return Wx}var qx=g({},po,{key:function(e){if(e.key){var n=Vx[e.key]||e.key;if(n!=="Unidentified")return n}return e.type==="keypress"?(e=Tl(e),e===13?"Enter":String.fromCharCode(e)):e.type==="keydown"||e.type==="keyup"?kx[e.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:zu,charCode:function(e){return e.type==="keypress"?Tl(e):0},keyCode:function(e){return e.type==="keydown"||e.type==="keyup"?e.keyCode:0},which:function(e){return e.type==="keypress"?Tl(e):e.type==="keydown"||e.type==="keyup"?e.keyCode:0}}),Yx=Zn(qx),jx=g({},Cl,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),Xp=Zn(jx),Zx=g({},po,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:zu}),Kx=Zn(Zx),Qx=g({},bs,{propertyName:0,elapsedTime:0,pseudoElement:0}),Jx=Zn(Qx),$x=g({},Cl,{deltaX:function(e){return"deltaX"in e?e.deltaX:"wheelDeltaX"in e?-e.wheelDeltaX:0},deltaY:function(e){return"deltaY"in e?e.deltaY:"wheelDeltaY"in e?-e.wheelDeltaY:"wheelDelta"in e?-e.wheelDelta:0},deltaZ:0,deltaMode:0}),tS=Zn($x),eS=g({},bs,{newState:0,oldState:0}),nS=Zn(eS),iS=[9,13,27,32],Iu=ua&&"CompositionEvent"in window,go=null;ua&&"documentMode"in document&&(go=document.documentMode);var aS=ua&&"TextEvent"in window&&!go,Wp=ua&&(!Iu||go&&8<go&&11>=go),qp=" ",Yp=!1;function jp(e,n){switch(e){case"keyup":return iS.indexOf(n.keyCode)!==-1;case"keydown":return n.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function Zp(e){return e=e.detail,typeof e=="object"&&"data"in e?e.data:null}var rr=!1;function sS(e,n){switch(e){case"compositionend":return Zp(n);case"keypress":return n.which!==32?null:(Yp=!0,qp);case"textInput":return e=n.data,e===qp&&Yp?null:e;default:return null}}function rS(e,n){if(rr)return e==="compositionend"||!Iu&&jp(e,n)?(e=Hp(),bl=Lu=Ha=null,rr=!1,e):null;switch(e){case"paste":return null;case"keypress":if(!(n.ctrlKey||n.altKey||n.metaKey)||n.ctrlKey&&n.altKey){if(n.char&&1<n.char.length)return n.char;if(n.which)return String.fromCharCode(n.which)}return null;case"compositionend":return Wp&&n.locale!=="ko"?null:n.data;default:return null}}var oS={color:!0,date:!0,datetime:!0,"datetime-local":!0,email:!0,month:!0,number:!0,password:!0,range:!0,search:!0,tel:!0,text:!0,time:!0,url:!0,week:!0};function Kp(e){var n=e&&e.nodeName&&e.nodeName.toLowerCase();return n==="input"?!!oS[e.type]:n==="textarea"}function Qp(e,n,a,o){ar?sr?sr.push(o):sr=[o]:ar=o,n=_c(n,"onChange"),0<n.length&&(a=new Rl("onChange","change",null,a,o),e.push({event:a,listeners:n}))}var _o=null,vo=null;function lS(e){N0(e,0)}function wl(e){var n=Es(e);if(gn(n))return e}function Jp(e,n){if(e==="change")return n}var $p=!1;if(ua){var Fu;if(ua){var Bu="oninput"in document;if(!Bu){var tm=document.createElement("div");tm.setAttribute("oninput","return;"),Bu=typeof tm.oninput=="function"}Fu=Bu}else Fu=!1;$p=Fu&&(!document.documentMode||9<document.documentMode)}function em(){_o&&(_o.detachEvent("onpropertychange",nm),vo=_o=null)}function nm(e){if(e.propertyName==="value"&&wl(vo)){var n=[];Qp(n,vo,e,wu(e)),Bp(lS,n)}}function cS(e,n,a){e==="focusin"?(em(),_o=n,vo=a,_o.attachEvent("onpropertychange",nm)):e==="focusout"&&em()}function uS(e){if(e==="selectionchange"||e==="keyup"||e==="keydown")return wl(vo)}function fS(e,n){if(e==="click")return wl(n)}function hS(e,n){if(e==="input"||e==="change")return wl(n)}function dS(e,n){return e===n&&(e!==0||1/e===1/n)||e!==e&&n!==n}var ri=typeof Object.is=="function"?Object.is:dS;function xo(e,n){if(ri(e,n))return!0;if(typeof e!="object"||e===null||typeof n!="object"||n===null)return!1;var a=Object.keys(e),o=Object.keys(n);if(a.length!==o.length)return!1;for(o=0;o<a.length;o++){var u=a[o];if(!je.call(n,u)||!ri(e[u],n[u]))return!1}return!0}function im(e){for(;e&&e.firstChild;)e=e.firstChild;return e}function am(e,n){var a=im(e);e=0;for(var o;a;){if(a.nodeType===3){if(o=e+a.textContent.length,e<=n&&o>=n)return{node:a,offset:n-e};e=o}t:{for(;a;){if(a.nextSibling){a=a.nextSibling;break t}a=a.parentNode}a=void 0}a=im(a)}}function sm(e,n){return e&&n?e===n?!0:e&&e.nodeType===3?!1:n&&n.nodeType===3?sm(e,n.parentNode):"contains"in e?e.contains(n):e.compareDocumentPosition?!!(e.compareDocumentPosition(n)&16):!1:!1}function rm(e){e=e!=null&&e.ownerDocument!=null&&e.ownerDocument.defaultView!=null?e.ownerDocument.defaultView:window;for(var n=kt(e.document);n instanceof e.HTMLIFrameElement;){try{var a=typeof n.contentWindow.location.href=="string"}catch{a=!1}if(a)e=n.contentWindow;else break;n=kt(e.document)}return n}function Hu(e){var n=e&&e.nodeName&&e.nodeName.toLowerCase();return n&&(n==="input"&&(e.type==="text"||e.type==="search"||e.type==="tel"||e.type==="url"||e.type==="password")||n==="textarea"||e.contentEditable==="true")}var pS=ua&&"documentMode"in document&&11>=document.documentMode,or=null,Gu=null,So=null,Vu=!1;function om(e,n,a){var o=a.window===a?a.document:a.nodeType===9?a:a.ownerDocument;Vu||or==null||or!==kt(o)||(o=or,"selectionStart"in o&&Hu(o)?o={start:o.selectionStart,end:o.selectionEnd}:(o=(o.ownerDocument&&o.ownerDocument.defaultView||window).getSelection(),o={anchorNode:o.anchorNode,anchorOffset:o.anchorOffset,focusNode:o.focusNode,focusOffset:o.focusOffset}),So&&xo(So,o)||(So=o,o=_c(Gu,"onSelect"),0<o.length&&(n=new Rl("onSelect","select",null,n,a),e.push({event:n,listeners:o}),n.target=or)))}function Ts(e,n){var a={};return a[e.toLowerCase()]=n.toLowerCase(),a["Webkit"+e]="webkit"+n,a["Moz"+e]="moz"+n,a}var lr={animationend:Ts("Animation","AnimationEnd"),animationiteration:Ts("Animation","AnimationIteration"),animationstart:Ts("Animation","AnimationStart"),transitionrun:Ts("Transition","TransitionRun"),transitionstart:Ts("Transition","TransitionStart"),transitioncancel:Ts("Transition","TransitionCancel"),transitionend:Ts("Transition","TransitionEnd")},ku={},lm={};ua&&(lm=document.createElement("div").style,"AnimationEvent"in window||(delete lr.animationend.animation,delete lr.animationiteration.animation,delete lr.animationstart.animation),"TransitionEvent"in window||delete lr.transitionend.transition);function As(e){if(ku[e])return ku[e];if(!lr[e])return e;var n=lr[e],a;for(a in n)if(n.hasOwnProperty(a)&&a in lm)return ku[e]=n[a];return e}var cm=As("animationend"),um=As("animationiteration"),fm=As("animationstart"),mS=As("transitionrun"),gS=As("transitionstart"),_S=As("transitioncancel"),hm=As("transitionend"),dm=new Map,Xu="abort auxClick beforeToggle cancel canPlay canPlayThrough click close contextMenu copy cut drag dragEnd dragEnter dragExit dragLeave dragOver dragStart drop durationChange emptied encrypted ended error gotPointerCapture input invalid keyDown keyPress keyUp load loadedData loadedMetadata loadStart lostPointerCapture mouseDown mouseMove mouseOut mouseOver mouseUp paste pause play playing pointerCancel pointerDown pointerMove pointerOut pointerOver pointerUp progress rateChange reset resize seeked seeking stalled submit suspend timeUpdate touchCancel touchEnd touchStart volumeChange scroll toggle touchMove waiting wheel".split(" ");Xu.push("scrollEnd");function Li(e,n){dm.set(e,n),nt(n,[e])}var Dl=typeof reportError=="function"?reportError:function(e){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var n=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof e=="object"&&e!==null&&typeof e.message=="string"?String(e.message):String(e),error:e});if(!window.dispatchEvent(n))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",e);return}console.error(e)},vi=[],cr=0,Wu=0;function Ul(){for(var e=cr,n=Wu=cr=0;n<e;){var a=vi[n];vi[n++]=null;var o=vi[n];vi[n++]=null;var u=vi[n];vi[n++]=null;var f=vi[n];if(vi[n++]=null,o!==null&&u!==null){var S=o.pending;S===null?u.next=u:(u.next=S.next,S.next=u),o.pending=u}f!==0&&pm(a,u,f)}}function Ll(e,n,a,o){vi[cr++]=e,vi[cr++]=n,vi[cr++]=a,vi[cr++]=o,Wu|=o,e.lanes|=o,e=e.alternate,e!==null&&(e.lanes|=o)}function qu(e,n,a,o){return Ll(e,n,a,o),Nl(e)}function Rs(e,n){return Ll(e,null,null,n),Nl(e)}function pm(e,n,a){e.lanes|=a;var o=e.alternate;o!==null&&(o.lanes|=a);for(var u=!1,f=e.return;f!==null;)f.childLanes|=a,o=f.alternate,o!==null&&(o.childLanes|=a),f.tag===22&&(e=f.stateNode,e===null||e._visibility&1||(u=!0)),e=f,f=f.return;return e.tag===3?(f=e.stateNode,u&&n!==null&&(u=31-Ot(a),e=f.hiddenUpdates,o=e[u],o===null?e[u]=[n]:o.push(n),n.lane=a|536870912),f):null}function Nl(e){if(50<Vo)throw Vo=0,nh=null,Error(s(185));for(var n=e.return;n!==null;)e=n,n=e.return;return e.tag===3?e.stateNode:null}var ur={};function vS(e,n,a,o){this.tag=e,this.key=a,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.refCleanup=this.ref=null,this.pendingProps=n,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=o,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function oi(e,n,a,o){return new vS(e,n,a,o)}function Yu(e){return e=e.prototype,!(!e||!e.isReactComponent)}function fa(e,n){var a=e.alternate;return a===null?(a=oi(e.tag,n,e.key,e.mode),a.elementType=e.elementType,a.type=e.type,a.stateNode=e.stateNode,a.alternate=e,e.alternate=a):(a.pendingProps=n,a.type=e.type,a.flags=0,a.subtreeFlags=0,a.deletions=null),a.flags=e.flags&65011712,a.childLanes=e.childLanes,a.lanes=e.lanes,a.child=e.child,a.memoizedProps=e.memoizedProps,a.memoizedState=e.memoizedState,a.updateQueue=e.updateQueue,n=e.dependencies,a.dependencies=n===null?null:{lanes:n.lanes,firstContext:n.firstContext},a.sibling=e.sibling,a.index=e.index,a.ref=e.ref,a.refCleanup=e.refCleanup,a}function mm(e,n){e.flags&=65011714;var a=e.alternate;return a===null?(e.childLanes=0,e.lanes=n,e.child=null,e.subtreeFlags=0,e.memoizedProps=null,e.memoizedState=null,e.updateQueue=null,e.dependencies=null,e.stateNode=null):(e.childLanes=a.childLanes,e.lanes=a.lanes,e.child=a.child,e.subtreeFlags=0,e.deletions=null,e.memoizedProps=a.memoizedProps,e.memoizedState=a.memoizedState,e.updateQueue=a.updateQueue,e.type=a.type,n=a.dependencies,e.dependencies=n===null?null:{lanes:n.lanes,firstContext:n.firstContext}),e}function Ol(e,n,a,o,u,f){var S=0;if(o=e,typeof e=="function")Yu(e)&&(S=1);else if(typeof e=="string")S=Ey(e,a,vt.current)?26:e==="html"||e==="head"||e==="body"?27:5;else t:switch(e){case L:return e=oi(31,a,n,u),e.elementType=L,e.lanes=f,e;case A:return Cs(a.children,u,f,n);case x:S=8,u|=24;break;case y:return e=oi(12,a,n,u|2),e.elementType=y,e.lanes=f,e;case H:return e=oi(13,a,n,u),e.elementType=H,e.lanes=f,e;case F:return e=oi(19,a,n,u),e.elementType=F,e.lanes=f,e;default:if(typeof e=="object"&&e!==null)switch(e.$$typeof){case D:S=10;break t;case w:S=9;break t;case U:S=11;break t;case I:S=14;break t;case T:S=16,o=null;break t}S=29,a=Error(s(130,e===null?"null":typeof e,"")),o=null}return n=oi(S,a,n,u),n.elementType=e,n.type=o,n.lanes=f,n}function Cs(e,n,a,o){return e=oi(7,e,o,n),e.lanes=a,e}function ju(e,n,a){return e=oi(6,e,null,n),e.lanes=a,e}function gm(e){var n=oi(18,null,null,0);return n.stateNode=e,n}function Zu(e,n,a){return n=oi(4,e.children!==null?e.children:[],e.key,n),n.lanes=a,n.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},n}var _m=new WeakMap;function xi(e,n){if(typeof e=="object"&&e!==null){var a=_m.get(e);return a!==void 0?a:(n={value:e,source:n,stack:V(n)},_m.set(e,n),n)}return{value:e,source:n,stack:V(n)}}var fr=[],hr=0,Pl=null,yo=0,Si=[],yi=0,Ga=null,qi=1,Yi="";function ha(e,n){fr[hr++]=yo,fr[hr++]=Pl,Pl=e,yo=n}function vm(e,n,a){Si[yi++]=qi,Si[yi++]=Yi,Si[yi++]=Ga,Ga=e;var o=qi;e=Yi;var u=32-Ot(o)-1;o&=~(1<<u),a+=1;var f=32-Ot(n)+u;if(30<f){var S=u-u%5;f=(o&(1<<S)-1).toString(32),o>>=S,u-=S,qi=1<<32-Ot(n)+u|a<<u|o,Yi=f+e}else qi=1<<f|a<<u|o,Yi=e}function Ku(e){e.return!==null&&(ha(e,1),vm(e,1,0))}function Qu(e){for(;e===Pl;)Pl=fr[--hr],fr[hr]=null,yo=fr[--hr],fr[hr]=null;for(;e===Ga;)Ga=Si[--yi],Si[yi]=null,Yi=Si[--yi],Si[yi]=null,qi=Si[--yi],Si[yi]=null}function xm(e,n){Si[yi++]=qi,Si[yi++]=Yi,Si[yi++]=Ga,qi=n.id,Yi=n.overflow,Ga=e}var An=null,qe=null,Ee=!1,Va=null,Mi=!1,Ju=Error(s(519));function ka(e){var n=Error(s(418,1<arguments.length&&arguments[1]!==void 0&&arguments[1]?"text":"HTML",""));throw Mo(xi(n,e)),Ju}function Sm(e){var n=e.stateNode,a=e.type,o=e.memoizedProps;switch(n[rn]=e,n[mn]=o,a){case"dialog":xe("cancel",n),xe("close",n);break;case"iframe":case"object":case"embed":xe("load",n);break;case"video":case"audio":for(a=0;a<Xo.length;a++)xe(Xo[a],n);break;case"source":xe("error",n);break;case"img":case"image":case"link":xe("error",n),xe("load",n);break;case"details":xe("toggle",n);break;case"input":xe("invalid",n),ai(n,o.value,o.defaultValue,o.checked,o.defaultChecked,o.type,o.name,!0);break;case"select":xe("invalid",n);break;case"textarea":xe("invalid",n),on(n,o.value,o.defaultValue,o.children)}a=o.children,typeof a!="string"&&typeof a!="number"&&typeof a!="bigint"||n.textContent===""+a||o.suppressHydrationWarning===!0||I0(n.textContent,a)?(o.popover!=null&&(xe("beforetoggle",n),xe("toggle",n)),o.onScroll!=null&&xe("scroll",n),o.onScrollEnd!=null&&xe("scrollend",n),o.onClick!=null&&(n.onclick=ca),n=!0):n=!1,n||ka(e,!0)}function ym(e){for(An=e.return;An;)switch(An.tag){case 5:case 31:case 13:Mi=!1;return;case 27:case 3:Mi=!0;return;default:An=An.return}}function dr(e){if(e!==An)return!1;if(!Ee)return ym(e),Ee=!0,!1;var n=e.tag,a;if((a=n!==3&&n!==27)&&((a=n===5)&&(a=e.type,a=!(a!=="form"&&a!=="button")||_h(e.type,e.memoizedProps)),a=!a),a&&qe&&ka(e),ym(e),n===13){if(e=e.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(s(317));qe=q0(e)}else if(n===31){if(e=e.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(s(317));qe=q0(e)}else n===27?(n=qe,is(e.type)?(e=Mh,Mh=null,qe=e):qe=n):qe=An?bi(e.stateNode.nextSibling):null;return!0}function ws(){qe=An=null,Ee=!1}function $u(){var e=Va;return e!==null&&($n===null?$n=e:$n.push.apply($n,e),Va=null),e}function Mo(e){Va===null?Va=[e]:Va.push(e)}var tf=N(null),Ds=null,da=null;function Xa(e,n,a){ut(tf,n._currentValue),n._currentValue=a}function pa(e){e._currentValue=tf.current,k(tf)}function ef(e,n,a){for(;e!==null;){var o=e.alternate;if((e.childLanes&n)!==n?(e.childLanes|=n,o!==null&&(o.childLanes|=n)):o!==null&&(o.childLanes&n)!==n&&(o.childLanes|=n),e===a)break;e=e.return}}function nf(e,n,a,o){var u=e.child;for(u!==null&&(u.return=e);u!==null;){var f=u.dependencies;if(f!==null){var S=u.child;f=f.firstContext;t:for(;f!==null;){var R=f;f=u;for(var G=0;G<n.length;G++)if(R.context===n[G]){f.lanes|=a,R=f.alternate,R!==null&&(R.lanes|=a),ef(f.return,a,e),o||(S=null);break t}f=R.next}}else if(u.tag===18){if(S=u.return,S===null)throw Error(s(341));S.lanes|=a,f=S.alternate,f!==null&&(f.lanes|=a),ef(S,a,e),S=null}else S=u.child;if(S!==null)S.return=u;else for(S=u;S!==null;){if(S===e){S=null;break}if(u=S.sibling,u!==null){u.return=S.return,S=u;break}S=S.return}u=S}}function pr(e,n,a,o){e=null;for(var u=n,f=!1;u!==null;){if(!f){if((u.flags&524288)!==0)f=!0;else if((u.flags&262144)!==0)break}if(u.tag===10){var S=u.alternate;if(S===null)throw Error(s(387));if(S=S.memoizedProps,S!==null){var R=u.type;ri(u.pendingProps.value,S.value)||(e!==null?e.push(R):e=[R])}}else if(u===dt.current){if(S=u.alternate,S===null)throw Error(s(387));S.memoizedState.memoizedState!==u.memoizedState.memoizedState&&(e!==null?e.push(Zo):e=[Zo])}u=u.return}e!==null&&nf(n,e,a,o),n.flags|=262144}function zl(e){for(e=e.firstContext;e!==null;){if(!ri(e.context._currentValue,e.memoizedValue))return!0;e=e.next}return!1}function Us(e){Ds=e,da=null,e=e.dependencies,e!==null&&(e.firstContext=null)}function Rn(e){return Mm(Ds,e)}function Il(e,n){return Ds===null&&Us(e),Mm(e,n)}function Mm(e,n){var a=n._currentValue;if(n={context:n,memoizedValue:a,next:null},da===null){if(e===null)throw Error(s(308));da=n,e.dependencies={lanes:0,firstContext:n},e.flags|=524288}else da=da.next=n;return a}var xS=typeof AbortController<"u"?AbortController:function(){var e=[],n=this.signal={aborted:!1,addEventListener:function(a,o){e.push(o)}};this.abort=function(){n.aborted=!0,e.forEach(function(a){return a()})}},SS=r.unstable_scheduleCallback,yS=r.unstable_NormalPriority,cn={$$typeof:D,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function af(){return{controller:new xS,data:new Map,refCount:0}}function Eo(e){e.refCount--,e.refCount===0&&SS(yS,function(){e.controller.abort()})}var bo=null,sf=0,mr=0,gr=null;function MS(e,n){if(bo===null){var a=bo=[];sf=0,mr=lh(),gr={status:"pending",value:void 0,then:function(o){a.push(o)}}}return sf++,n.then(Em,Em),n}function Em(){if(--sf===0&&bo!==null){gr!==null&&(gr.status="fulfilled");var e=bo;bo=null,mr=0,gr=null;for(var n=0;n<e.length;n++)(0,e[n])()}}function ES(e,n){var a=[],o={status:"pending",value:null,reason:null,then:function(u){a.push(u)}};return e.then(function(){o.status="fulfilled",o.value=n;for(var u=0;u<a.length;u++)(0,a[u])(n)},function(u){for(o.status="rejected",o.reason=u,u=0;u<a.length;u++)(0,a[u])(void 0)}),o}var bm=O.S;O.S=function(e,n){o0=b(),typeof n=="object"&&n!==null&&typeof n.then=="function"&&MS(e,n),bm!==null&&bm(e,n)};var Ls=N(null);function rf(){var e=Ls.current;return e!==null?e:Xe.pooledCache}function Fl(e,n){n===null?ut(Ls,Ls.current):ut(Ls,n.pool)}function Tm(){var e=rf();return e===null?null:{parent:cn._currentValue,pool:e}}var _r=Error(s(460)),of=Error(s(474)),Bl=Error(s(542)),Hl={then:function(){}};function Am(e){return e=e.status,e==="fulfilled"||e==="rejected"}function Rm(e,n,a){switch(a=e[a],a===void 0?e.push(n):a!==n&&(n.then(ca,ca),n=a),n.status){case"fulfilled":return n.value;case"rejected":throw e=n.reason,wm(e),e;default:if(typeof n.status=="string")n.then(ca,ca);else{if(e=Xe,e!==null&&100<e.shellSuspendCounter)throw Error(s(482));e=n,e.status="pending",e.then(function(o){if(n.status==="pending"){var u=n;u.status="fulfilled",u.value=o}},function(o){if(n.status==="pending"){var u=n;u.status="rejected",u.reason=o}})}switch(n.status){case"fulfilled":return n.value;case"rejected":throw e=n.reason,wm(e),e}throw Os=n,_r}}function Ns(e){try{var n=e._init;return n(e._payload)}catch(a){throw a!==null&&typeof a=="object"&&typeof a.then=="function"?(Os=a,_r):a}}var Os=null;function Cm(){if(Os===null)throw Error(s(459));var e=Os;return Os=null,e}function wm(e){if(e===_r||e===Bl)throw Error(s(483))}var vr=null,To=0;function Gl(e){var n=To;return To+=1,vr===null&&(vr=[]),Rm(vr,e,n)}function Ao(e,n){n=n.props.ref,e.ref=n!==void 0?n:null}function Vl(e,n){throw n.$$typeof===_?Error(s(525)):(e=Object.prototype.toString.call(n),Error(s(31,e==="[object Object]"?"object with keys {"+Object.keys(n).join(", ")+"}":e)))}function Dm(e){function n(tt,X){if(e){var it=tt.deletions;it===null?(tt.deletions=[X],tt.flags|=16):it.push(X)}}function a(tt,X){if(!e)return null;for(;X!==null;)n(tt,X),X=X.sibling;return null}function o(tt){for(var X=new Map;tt!==null;)tt.key!==null?X.set(tt.key,tt):X.set(tt.index,tt),tt=tt.sibling;return X}function u(tt,X){return tt=fa(tt,X),tt.index=0,tt.sibling=null,tt}function f(tt,X,it){return tt.index=it,e?(it=tt.alternate,it!==null?(it=it.index,it<X?(tt.flags|=67108866,X):it):(tt.flags|=67108866,X)):(tt.flags|=1048576,X)}function S(tt){return e&&tt.alternate===null&&(tt.flags|=67108866),tt}function R(tt,X,it,xt){return X===null||X.tag!==6?(X=ju(it,tt.mode,xt),X.return=tt,X):(X=u(X,it),X.return=tt,X)}function G(tt,X,it,xt){var Qt=it.type;return Qt===A?gt(tt,X,it.props.children,xt,it.key):X!==null&&(X.elementType===Qt||typeof Qt=="object"&&Qt!==null&&Qt.$$typeof===T&&Ns(Qt)===X.type)?(X=u(X,it.props),Ao(X,it),X.return=tt,X):(X=Ol(it.type,it.key,it.props,null,tt.mode,xt),Ao(X,it),X.return=tt,X)}function st(tt,X,it,xt){return X===null||X.tag!==4||X.stateNode.containerInfo!==it.containerInfo||X.stateNode.implementation!==it.implementation?(X=Zu(it,tt.mode,xt),X.return=tt,X):(X=u(X,it.children||[]),X.return=tt,X)}function gt(tt,X,it,xt,Qt){return X===null||X.tag!==7?(X=Cs(it,tt.mode,xt,Qt),X.return=tt,X):(X=u(X,it),X.return=tt,X)}function St(tt,X,it){if(typeof X=="string"&&X!==""||typeof X=="number"||typeof X=="bigint")return X=ju(""+X,tt.mode,it),X.return=tt,X;if(typeof X=="object"&&X!==null){switch(X.$$typeof){case M:return it=Ol(X.type,X.key,X.props,null,tt.mode,it),Ao(it,X),it.return=tt,it;case E:return X=Zu(X,tt.mode,it),X.return=tt,X;case T:return X=Ns(X),St(tt,X,it)}if(et(X)||W(X))return X=Cs(X,tt.mode,it,null),X.return=tt,X;if(typeof X.then=="function")return St(tt,Gl(X),it);if(X.$$typeof===D)return St(tt,Il(tt,X),it);Vl(tt,X)}return null}function ct(tt,X,it,xt){var Qt=X!==null?X.key:null;if(typeof it=="string"&&it!==""||typeof it=="number"||typeof it=="bigint")return Qt!==null?null:R(tt,X,""+it,xt);if(typeof it=="object"&&it!==null){switch(it.$$typeof){case M:return it.key===Qt?G(tt,X,it,xt):null;case E:return it.key===Qt?st(tt,X,it,xt):null;case T:return it=Ns(it),ct(tt,X,it,xt)}if(et(it)||W(it))return Qt!==null?null:gt(tt,X,it,xt,null);if(typeof it.then=="function")return ct(tt,X,Gl(it),xt);if(it.$$typeof===D)return ct(tt,X,Il(tt,it),xt);Vl(tt,it)}return null}function ht(tt,X,it,xt,Qt){if(typeof xt=="string"&&xt!==""||typeof xt=="number"||typeof xt=="bigint")return tt=tt.get(it)||null,R(X,tt,""+xt,Qt);if(typeof xt=="object"&&xt!==null){switch(xt.$$typeof){case M:return tt=tt.get(xt.key===null?it:xt.key)||null,G(X,tt,xt,Qt);case E:return tt=tt.get(xt.key===null?it:xt.key)||null,st(X,tt,xt,Qt);case T:return xt=Ns(xt),ht(tt,X,it,xt,Qt)}if(et(xt)||W(xt))return tt=tt.get(it)||null,gt(X,tt,xt,Qt,null);if(typeof xt.then=="function")return ht(tt,X,it,Gl(xt),Qt);if(xt.$$typeof===D)return ht(tt,X,it,Il(X,xt),Qt);Vl(X,xt)}return null}function Vt(tt,X,it,xt){for(var Qt=null,we=null,jt=X,de=X=0,Me=null;jt!==null&&de<it.length;de++){jt.index>de?(Me=jt,jt=null):Me=jt.sibling;var De=ct(tt,jt,it[de],xt);if(De===null){jt===null&&(jt=Me);break}e&&jt&&De.alternate===null&&n(tt,jt),X=f(De,X,de),we===null?Qt=De:we.sibling=De,we=De,jt=Me}if(de===it.length)return a(tt,jt),Ee&&ha(tt,de),Qt;if(jt===null){for(;de<it.length;de++)jt=St(tt,it[de],xt),jt!==null&&(X=f(jt,X,de),we===null?Qt=jt:we.sibling=jt,we=jt);return Ee&&ha(tt,de),Qt}for(jt=o(jt);de<it.length;de++)Me=ht(jt,tt,de,it[de],xt),Me!==null&&(e&&Me.alternate!==null&&jt.delete(Me.key===null?de:Me.key),X=f(Me,X,de),we===null?Qt=Me:we.sibling=Me,we=Me);return e&&jt.forEach(function(ls){return n(tt,ls)}),Ee&&ha(tt,de),Qt}function $t(tt,X,it,xt){if(it==null)throw Error(s(151));for(var Qt=null,we=null,jt=X,de=X=0,Me=null,De=it.next();jt!==null&&!De.done;de++,De=it.next()){jt.index>de?(Me=jt,jt=null):Me=jt.sibling;var ls=ct(tt,jt,De.value,xt);if(ls===null){jt===null&&(jt=Me);break}e&&jt&&ls.alternate===null&&n(tt,jt),X=f(ls,X,de),we===null?Qt=ls:we.sibling=ls,we=ls,jt=Me}if(De.done)return a(tt,jt),Ee&&ha(tt,de),Qt;if(jt===null){for(;!De.done;de++,De=it.next())De=St(tt,De.value,xt),De!==null&&(X=f(De,X,de),we===null?Qt=De:we.sibling=De,we=De);return Ee&&ha(tt,de),Qt}for(jt=o(jt);!De.done;de++,De=it.next())De=ht(jt,tt,de,De.value,xt),De!==null&&(e&&De.alternate!==null&&jt.delete(De.key===null?de:De.key),X=f(De,X,de),we===null?Qt=De:we.sibling=De,we=De);return e&&jt.forEach(function(Oy){return n(tt,Oy)}),Ee&&ha(tt,de),Qt}function Ve(tt,X,it,xt){if(typeof it=="object"&&it!==null&&it.type===A&&it.key===null&&(it=it.props.children),typeof it=="object"&&it!==null){switch(it.$$typeof){case M:t:{for(var Qt=it.key;X!==null;){if(X.key===Qt){if(Qt=it.type,Qt===A){if(X.tag===7){a(tt,X.sibling),xt=u(X,it.props.children),xt.return=tt,tt=xt;break t}}else if(X.elementType===Qt||typeof Qt=="object"&&Qt!==null&&Qt.$$typeof===T&&Ns(Qt)===X.type){a(tt,X.sibling),xt=u(X,it.props),Ao(xt,it),xt.return=tt,tt=xt;break t}a(tt,X);break}else n(tt,X);X=X.sibling}it.type===A?(xt=Cs(it.props.children,tt.mode,xt,it.key),xt.return=tt,tt=xt):(xt=Ol(it.type,it.key,it.props,null,tt.mode,xt),Ao(xt,it),xt.return=tt,tt=xt)}return S(tt);case E:t:{for(Qt=it.key;X!==null;){if(X.key===Qt)if(X.tag===4&&X.stateNode.containerInfo===it.containerInfo&&X.stateNode.implementation===it.implementation){a(tt,X.sibling),xt=u(X,it.children||[]),xt.return=tt,tt=xt;break t}else{a(tt,X);break}else n(tt,X);X=X.sibling}xt=Zu(it,tt.mode,xt),xt.return=tt,tt=xt}return S(tt);case T:return it=Ns(it),Ve(tt,X,it,xt)}if(et(it))return Vt(tt,X,it,xt);if(W(it)){if(Qt=W(it),typeof Qt!="function")throw Error(s(150));return it=Qt.call(it),$t(tt,X,it,xt)}if(typeof it.then=="function")return Ve(tt,X,Gl(it),xt);if(it.$$typeof===D)return Ve(tt,X,Il(tt,it),xt);Vl(tt,it)}return typeof it=="string"&&it!==""||typeof it=="number"||typeof it=="bigint"?(it=""+it,X!==null&&X.tag===6?(a(tt,X.sibling),xt=u(X,it),xt.return=tt,tt=xt):(a(tt,X),xt=ju(it,tt.mode,xt),xt.return=tt,tt=xt),S(tt)):a(tt,X)}return function(tt,X,it,xt){try{To=0;var Qt=Ve(tt,X,it,xt);return vr=null,Qt}catch(jt){if(jt===_r||jt===Bl)throw jt;var we=oi(29,jt,null,tt.mode);return we.lanes=xt,we.return=tt,we}}}var Ps=Dm(!0),Um=Dm(!1),Wa=!1;function lf(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function cf(e,n){e=e.updateQueue,n.updateQueue===e&&(n.updateQueue={baseState:e.baseState,firstBaseUpdate:e.firstBaseUpdate,lastBaseUpdate:e.lastBaseUpdate,shared:e.shared,callbacks:null})}function qa(e){return{lane:e,tag:0,payload:null,callback:null,next:null}}function Ya(e,n,a){var o=e.updateQueue;if(o===null)return null;if(o=o.shared,(Le&2)!==0){var u=o.pending;return u===null?n.next=n:(n.next=u.next,u.next=n),o.pending=n,n=Nl(e),pm(e,null,a),n}return Ll(e,o,n,a),Nl(e)}function Ro(e,n,a){if(n=n.updateQueue,n!==null&&(n=n.shared,(a&4194048)!==0)){var o=n.lanes;o&=e.pendingLanes,a|=o,n.lanes=a,$s(e,a)}}function uf(e,n){var a=e.updateQueue,o=e.alternate;if(o!==null&&(o=o.updateQueue,a===o)){var u=null,f=null;if(a=a.firstBaseUpdate,a!==null){do{var S={lane:a.lane,tag:a.tag,payload:a.payload,callback:null,next:null};f===null?u=f=S:f=f.next=S,a=a.next}while(a!==null);f===null?u=f=n:f=f.next=n}else u=f=n;a={baseState:o.baseState,firstBaseUpdate:u,lastBaseUpdate:f,shared:o.shared,callbacks:o.callbacks},e.updateQueue=a;return}e=a.lastBaseUpdate,e===null?a.firstBaseUpdate=n:e.next=n,a.lastBaseUpdate=n}var ff=!1;function Co(){if(ff){var e=gr;if(e!==null)throw e}}function wo(e,n,a,o){ff=!1;var u=e.updateQueue;Wa=!1;var f=u.firstBaseUpdate,S=u.lastBaseUpdate,R=u.shared.pending;if(R!==null){u.shared.pending=null;var G=R,st=G.next;G.next=null,S===null?f=st:S.next=st,S=G;var gt=e.alternate;gt!==null&&(gt=gt.updateQueue,R=gt.lastBaseUpdate,R!==S&&(R===null?gt.firstBaseUpdate=st:R.next=st,gt.lastBaseUpdate=G))}if(f!==null){var St=u.baseState;S=0,gt=st=G=null,R=f;do{var ct=R.lane&-536870913,ht=ct!==R.lane;if(ht?(ye&ct)===ct:(o&ct)===ct){ct!==0&&ct===mr&&(ff=!0),gt!==null&&(gt=gt.next={lane:0,tag:R.tag,payload:R.payload,callback:null,next:null});t:{var Vt=e,$t=R;ct=n;var Ve=a;switch($t.tag){case 1:if(Vt=$t.payload,typeof Vt=="function"){St=Vt.call(Ve,St,ct);break t}St=Vt;break t;case 3:Vt.flags=Vt.flags&-65537|128;case 0:if(Vt=$t.payload,ct=typeof Vt=="function"?Vt.call(Ve,St,ct):Vt,ct==null)break t;St=g({},St,ct);break t;case 2:Wa=!0}}ct=R.callback,ct!==null&&(e.flags|=64,ht&&(e.flags|=8192),ht=u.callbacks,ht===null?u.callbacks=[ct]:ht.push(ct))}else ht={lane:ct,tag:R.tag,payload:R.payload,callback:R.callback,next:null},gt===null?(st=gt=ht,G=St):gt=gt.next=ht,S|=ct;if(R=R.next,R===null){if(R=u.shared.pending,R===null)break;ht=R,R=ht.next,ht.next=null,u.lastBaseUpdate=ht,u.shared.pending=null}}while(!0);gt===null&&(G=St),u.baseState=G,u.firstBaseUpdate=st,u.lastBaseUpdate=gt,f===null&&(u.shared.lanes=0),Ja|=S,e.lanes=S,e.memoizedState=St}}function Lm(e,n){if(typeof e!="function")throw Error(s(191,e));e.call(n)}function Nm(e,n){var a=e.callbacks;if(a!==null)for(e.callbacks=null,e=0;e<a.length;e++)Lm(a[e],n)}var xr=N(null),kl=N(0);function Om(e,n){e=Ea,ut(kl,e),ut(xr,n),Ea=e|n.baseLanes}function hf(){ut(kl,Ea),ut(xr,xr.current)}function df(){Ea=kl.current,k(xr),k(kl)}var li=N(null),Ei=null;function ja(e){var n=e.alternate;ut(nn,nn.current&1),ut(li,e),Ei===null&&(n===null||xr.current!==null||n.memoizedState!==null)&&(Ei=e)}function pf(e){ut(nn,nn.current),ut(li,e),Ei===null&&(Ei=e)}function Pm(e){e.tag===22?(ut(nn,nn.current),ut(li,e),Ei===null&&(Ei=e)):Za()}function Za(){ut(nn,nn.current),ut(li,li.current)}function ci(e){k(li),Ei===e&&(Ei=null),k(nn)}var nn=N(0);function Xl(e){for(var n=e;n!==null;){if(n.tag===13){var a=n.memoizedState;if(a!==null&&(a=a.dehydrated,a===null||Sh(a)||yh(a)))return n}else if(n.tag===19&&(n.memoizedProps.revealOrder==="forwards"||n.memoizedProps.revealOrder==="backwards"||n.memoizedProps.revealOrder==="unstable_legacy-backwards"||n.memoizedProps.revealOrder==="together")){if((n.flags&128)!==0)return n}else if(n.child!==null){n.child.return=n,n=n.child;continue}if(n===e)break;for(;n.sibling===null;){if(n.return===null||n.return===e)return null;n=n.return}n.sibling.return=n.return,n=n.sibling}return null}var ma=0,ue=null,He=null,un=null,Wl=!1,Sr=!1,zs=!1,ql=0,Do=0,yr=null,bS=0;function tn(){throw Error(s(321))}function mf(e,n){if(n===null)return!1;for(var a=0;a<n.length&&a<e.length;a++)if(!ri(e[a],n[a]))return!1;return!0}function gf(e,n,a,o,u,f){return ma=f,ue=n,n.memoizedState=null,n.updateQueue=null,n.lanes=0,O.H=e===null||e.memoizedState===null?vg:Uf,zs=!1,f=a(o,u),zs=!1,Sr&&(f=Im(n,a,o,u)),zm(e),f}function zm(e){O.H=No;var n=He!==null&&He.next!==null;if(ma=0,un=He=ue=null,Wl=!1,Do=0,yr=null,n)throw Error(s(300));e===null||fn||(e=e.dependencies,e!==null&&zl(e)&&(fn=!0))}function Im(e,n,a,o){ue=e;var u=0;do{if(Sr&&(yr=null),Do=0,Sr=!1,25<=u)throw Error(s(301));if(u+=1,un=He=null,e.updateQueue!=null){var f=e.updateQueue;f.lastEffect=null,f.events=null,f.stores=null,f.memoCache!=null&&(f.memoCache.index=0)}O.H=xg,f=n(a,o)}while(Sr);return f}function TS(){var e=O.H,n=e.useState()[0];return n=typeof n.then=="function"?Uo(n):n,e=e.useState()[0],(He!==null?He.memoizedState:null)!==e&&(ue.flags|=1024),n}function _f(){var e=ql!==0;return ql=0,e}function vf(e,n,a){n.updateQueue=e.updateQueue,n.flags&=-2053,e.lanes&=~a}function xf(e){if(Wl){for(e=e.memoizedState;e!==null;){var n=e.queue;n!==null&&(n.pending=null),e=e.next}Wl=!1}ma=0,un=He=ue=null,Sr=!1,Do=ql=0,yr=null}function Xn(){var e={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return un===null?ue.memoizedState=un=e:un=un.next=e,un}function an(){if(He===null){var e=ue.alternate;e=e!==null?e.memoizedState:null}else e=He.next;var n=un===null?ue.memoizedState:un.next;if(n!==null)un=n,He=e;else{if(e===null)throw ue.alternate===null?Error(s(467)):Error(s(310));He=e,e={memoizedState:He.memoizedState,baseState:He.baseState,baseQueue:He.baseQueue,queue:He.queue,next:null},un===null?ue.memoizedState=un=e:un=un.next=e}return un}function Yl(){return{lastEffect:null,events:null,stores:null,memoCache:null}}function Uo(e){var n=Do;return Do+=1,yr===null&&(yr=[]),e=Rm(yr,e,n),n=ue,(un===null?n.memoizedState:un.next)===null&&(n=n.alternate,O.H=n===null||n.memoizedState===null?vg:Uf),e}function jl(e){if(e!==null&&typeof e=="object"){if(typeof e.then=="function")return Uo(e);if(e.$$typeof===D)return Rn(e)}throw Error(s(438,String(e)))}function Sf(e){var n=null,a=ue.updateQueue;if(a!==null&&(n=a.memoCache),n==null){var o=ue.alternate;o!==null&&(o=o.updateQueue,o!==null&&(o=o.memoCache,o!=null&&(n={data:o.data.map(function(u){return u.slice()}),index:0})))}if(n==null&&(n={data:[],index:0}),a===null&&(a=Yl(),ue.updateQueue=a),a.memoCache=n,a=n.data[n.index],a===void 0)for(a=n.data[n.index]=Array(e),o=0;o<e;o++)a[o]=Q;return n.index++,a}function ga(e,n){return typeof n=="function"?n(e):n}function Zl(e){var n=an();return yf(n,He,e)}function yf(e,n,a){var o=e.queue;if(o===null)throw Error(s(311));o.lastRenderedReducer=a;var u=e.baseQueue,f=o.pending;if(f!==null){if(u!==null){var S=u.next;u.next=f.next,f.next=S}n.baseQueue=u=f,o.pending=null}if(f=e.baseState,u===null)e.memoizedState=f;else{n=u.next;var R=S=null,G=null,st=n,gt=!1;do{var St=st.lane&-536870913;if(St!==st.lane?(ye&St)===St:(ma&St)===St){var ct=st.revertLane;if(ct===0)G!==null&&(G=G.next={lane:0,revertLane:0,gesture:null,action:st.action,hasEagerState:st.hasEagerState,eagerState:st.eagerState,next:null}),St===mr&&(gt=!0);else if((ma&ct)===ct){st=st.next,ct===mr&&(gt=!0);continue}else St={lane:0,revertLane:st.revertLane,gesture:null,action:st.action,hasEagerState:st.hasEagerState,eagerState:st.eagerState,next:null},G===null?(R=G=St,S=f):G=G.next=St,ue.lanes|=ct,Ja|=ct;St=st.action,zs&&a(f,St),f=st.hasEagerState?st.eagerState:a(f,St)}else ct={lane:St,revertLane:st.revertLane,gesture:st.gesture,action:st.action,hasEagerState:st.hasEagerState,eagerState:st.eagerState,next:null},G===null?(R=G=ct,S=f):G=G.next=ct,ue.lanes|=St,Ja|=St;st=st.next}while(st!==null&&st!==n);if(G===null?S=f:G.next=R,!ri(f,e.memoizedState)&&(fn=!0,gt&&(a=gr,a!==null)))throw a;e.memoizedState=f,e.baseState=S,e.baseQueue=G,o.lastRenderedState=f}return u===null&&(o.lanes=0),[e.memoizedState,o.dispatch]}function Mf(e){var n=an(),a=n.queue;if(a===null)throw Error(s(311));a.lastRenderedReducer=e;var o=a.dispatch,u=a.pending,f=n.memoizedState;if(u!==null){a.pending=null;var S=u=u.next;do f=e(f,S.action),S=S.next;while(S!==u);ri(f,n.memoizedState)||(fn=!0),n.memoizedState=f,n.baseQueue===null&&(n.baseState=f),a.lastRenderedState=f}return[f,o]}function Fm(e,n,a){var o=ue,u=an(),f=Ee;if(f){if(a===void 0)throw Error(s(407));a=a()}else a=n();var S=!ri((He||u).memoizedState,a);if(S&&(u.memoizedState=a,fn=!0),u=u.queue,Tf(Gm.bind(null,o,u,e),[e]),u.getSnapshot!==n||S||un!==null&&un.memoizedState.tag&1){if(o.flags|=2048,Mr(9,{destroy:void 0},Hm.bind(null,o,u,a,n),null),Xe===null)throw Error(s(349));f||(ma&127)!==0||Bm(o,n,a)}return a}function Bm(e,n,a){e.flags|=16384,e={getSnapshot:n,value:a},n=ue.updateQueue,n===null?(n=Yl(),ue.updateQueue=n,n.stores=[e]):(a=n.stores,a===null?n.stores=[e]:a.push(e))}function Hm(e,n,a,o){n.value=a,n.getSnapshot=o,Vm(n)&&km(e)}function Gm(e,n,a){return a(function(){Vm(n)&&km(e)})}function Vm(e){var n=e.getSnapshot;e=e.value;try{var a=n();return!ri(e,a)}catch{return!0}}function km(e){var n=Rs(e,2);n!==null&&ti(n,e,2)}function Ef(e){var n=Xn();if(typeof e=="function"){var a=e;if(e=a(),zs){Pt(!0);try{a()}finally{Pt(!1)}}}return n.memoizedState=n.baseState=e,n.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:ga,lastRenderedState:e},n}function Xm(e,n,a,o){return e.baseState=a,yf(e,He,typeof o=="function"?o:ga)}function AS(e,n,a,o,u){if(Jl(e))throw Error(s(485));if(e=n.action,e!==null){var f={payload:u,action:e,next:null,isTransition:!0,status:"pending",value:null,reason:null,listeners:[],then:function(S){f.listeners.push(S)}};O.T!==null?a(!0):f.isTransition=!1,o(f),a=n.pending,a===null?(f.next=n.pending=f,Wm(n,f)):(f.next=a.next,n.pending=a.next=f)}}function Wm(e,n){var a=n.action,o=n.payload,u=e.state;if(n.isTransition){var f=O.T,S={};O.T=S;try{var R=a(u,o),G=O.S;G!==null&&G(S,R),qm(e,n,R)}catch(st){bf(e,n,st)}finally{f!==null&&S.types!==null&&(f.types=S.types),O.T=f}}else try{f=a(u,o),qm(e,n,f)}catch(st){bf(e,n,st)}}function qm(e,n,a){a!==null&&typeof a=="object"&&typeof a.then=="function"?a.then(function(o){Ym(e,n,o)},function(o){return bf(e,n,o)}):Ym(e,n,a)}function Ym(e,n,a){n.status="fulfilled",n.value=a,jm(n),e.state=a,n=e.pending,n!==null&&(a=n.next,a===n?e.pending=null:(a=a.next,n.next=a,Wm(e,a)))}function bf(e,n,a){var o=e.pending;if(e.pending=null,o!==null){o=o.next;do n.status="rejected",n.reason=a,jm(n),n=n.next;while(n!==o)}e.action=null}function jm(e){e=e.listeners;for(var n=0;n<e.length;n++)(0,e[n])()}function Zm(e,n){return n}function Km(e,n){if(Ee){var a=Xe.formState;if(a!==null){t:{var o=ue;if(Ee){if(qe){e:{for(var u=qe,f=Mi;u.nodeType!==8;){if(!f){u=null;break e}if(u=bi(u.nextSibling),u===null){u=null;break e}}f=u.data,u=f==="F!"||f==="F"?u:null}if(u){qe=bi(u.nextSibling),o=u.data==="F!";break t}}ka(o)}o=!1}o&&(n=a[0])}}return a=Xn(),a.memoizedState=a.baseState=n,o={pending:null,lanes:0,dispatch:null,lastRenderedReducer:Zm,lastRenderedState:n},a.queue=o,a=mg.bind(null,ue,o),o.dispatch=a,o=Ef(!1),f=Df.bind(null,ue,!1,o.queue),o=Xn(),u={state:n,dispatch:null,action:e,pending:null},o.queue=u,a=AS.bind(null,ue,u,f,a),u.dispatch=a,o.memoizedState=e,[n,a,!1]}function Qm(e){var n=an();return Jm(n,He,e)}function Jm(e,n,a){if(n=yf(e,n,Zm)[0],e=Zl(ga)[0],typeof n=="object"&&n!==null&&typeof n.then=="function")try{var o=Uo(n)}catch(S){throw S===_r?Bl:S}else o=n;n=an();var u=n.queue,f=u.dispatch;return a!==n.memoizedState&&(ue.flags|=2048,Mr(9,{destroy:void 0},RS.bind(null,u,a),null)),[o,f,e]}function RS(e,n){e.action=n}function $m(e){var n=an(),a=He;if(a!==null)return Jm(n,a,e);an(),n=n.memoizedState,a=an();var o=a.queue.dispatch;return a.memoizedState=e,[n,o,!1]}function Mr(e,n,a,o){return e={tag:e,create:a,deps:o,inst:n,next:null},n=ue.updateQueue,n===null&&(n=Yl(),ue.updateQueue=n),a=n.lastEffect,a===null?n.lastEffect=e.next=e:(o=a.next,a.next=e,e.next=o,n.lastEffect=e),e}function tg(){return an().memoizedState}function Kl(e,n,a,o){var u=Xn();ue.flags|=e,u.memoizedState=Mr(1|n,{destroy:void 0},a,o===void 0?null:o)}function Ql(e,n,a,o){var u=an();o=o===void 0?null:o;var f=u.memoizedState.inst;He!==null&&o!==null&&mf(o,He.memoizedState.deps)?u.memoizedState=Mr(n,f,a,o):(ue.flags|=e,u.memoizedState=Mr(1|n,f,a,o))}function eg(e,n){Kl(8390656,8,e,n)}function Tf(e,n){Ql(2048,8,e,n)}function CS(e){ue.flags|=4;var n=ue.updateQueue;if(n===null)n=Yl(),ue.updateQueue=n,n.events=[e];else{var a=n.events;a===null?n.events=[e]:a.push(e)}}function ng(e){var n=an().memoizedState;return CS({ref:n,nextImpl:e}),function(){if((Le&2)!==0)throw Error(s(440));return n.impl.apply(void 0,arguments)}}function ig(e,n){return Ql(4,2,e,n)}function ag(e,n){return Ql(4,4,e,n)}function sg(e,n){if(typeof n=="function"){e=e();var a=n(e);return function(){typeof a=="function"?a():n(null)}}if(n!=null)return e=e(),n.current=e,function(){n.current=null}}function rg(e,n,a){a=a!=null?a.concat([e]):null,Ql(4,4,sg.bind(null,n,e),a)}function Af(){}function og(e,n){var a=an();n=n===void 0?null:n;var o=a.memoizedState;return n!==null&&mf(n,o[1])?o[0]:(a.memoizedState=[e,n],e)}function lg(e,n){var a=an();n=n===void 0?null:n;var o=a.memoizedState;if(n!==null&&mf(n,o[1]))return o[0];if(o=e(),zs){Pt(!0);try{e()}finally{Pt(!1)}}return a.memoizedState=[o,n],o}function Rf(e,n,a){return a===void 0||(ma&1073741824)!==0&&(ye&261930)===0?e.memoizedState=n:(e.memoizedState=a,e=c0(),ue.lanes|=e,Ja|=e,a)}function cg(e,n,a,o){return ri(a,n)?a:xr.current!==null?(e=Rf(e,a,o),ri(e,n)||(fn=!0),e):(ma&42)===0||(ma&1073741824)!==0&&(ye&261930)===0?(fn=!0,e.memoizedState=a):(e=c0(),ue.lanes|=e,Ja|=e,n)}function ug(e,n,a,o,u){var f=B.p;B.p=f!==0&&8>f?f:8;var S=O.T,R={};O.T=R,Df(e,!1,n,a);try{var G=u(),st=O.S;if(st!==null&&st(R,G),G!==null&&typeof G=="object"&&typeof G.then=="function"){var gt=ES(G,o);Lo(e,n,gt,hi(e))}else Lo(e,n,o,hi(e))}catch(St){Lo(e,n,{then:function(){},status:"rejected",reason:St},hi())}finally{B.p=f,S!==null&&R.types!==null&&(S.types=R.types),O.T=S}}function wS(){}function Cf(e,n,a,o){if(e.tag!==5)throw Error(s(476));var u=fg(e).queue;ug(e,u,n,at,a===null?wS:function(){return hg(e),a(o)})}function fg(e){var n=e.memoizedState;if(n!==null)return n;n={memoizedState:at,baseState:at,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:ga,lastRenderedState:at},next:null};var a={};return n.next={memoizedState:a,baseState:a,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:ga,lastRenderedState:a},next:null},e.memoizedState=n,e=e.alternate,e!==null&&(e.memoizedState=n),n}function hg(e){var n=fg(e);n.next===null&&(n=e.alternate.memoizedState),Lo(e,n.next.queue,{},hi())}function wf(){return Rn(Zo)}function dg(){return an().memoizedState}function pg(){return an().memoizedState}function DS(e){for(var n=e.return;n!==null;){switch(n.tag){case 24:case 3:var a=hi();e=qa(a);var o=Ya(n,e,a);o!==null&&(ti(o,n,a),Ro(o,n,a)),n={cache:af()},e.payload=n;return}n=n.return}}function US(e,n,a){var o=hi();a={lane:o,revertLane:0,gesture:null,action:a,hasEagerState:!1,eagerState:null,next:null},Jl(e)?gg(n,a):(a=qu(e,n,a,o),a!==null&&(ti(a,e,o),_g(a,n,o)))}function mg(e,n,a){var o=hi();Lo(e,n,a,o)}function Lo(e,n,a,o){var u={lane:o,revertLane:0,gesture:null,action:a,hasEagerState:!1,eagerState:null,next:null};if(Jl(e))gg(n,u);else{var f=e.alternate;if(e.lanes===0&&(f===null||f.lanes===0)&&(f=n.lastRenderedReducer,f!==null))try{var S=n.lastRenderedState,R=f(S,a);if(u.hasEagerState=!0,u.eagerState=R,ri(R,S))return Ll(e,n,u,0),Xe===null&&Ul(),!1}catch{}if(a=qu(e,n,u,o),a!==null)return ti(a,e,o),_g(a,n,o),!0}return!1}function Df(e,n,a,o){if(o={lane:2,revertLane:lh(),gesture:null,action:o,hasEagerState:!1,eagerState:null,next:null},Jl(e)){if(n)throw Error(s(479))}else n=qu(e,a,o,2),n!==null&&ti(n,e,2)}function Jl(e){var n=e.alternate;return e===ue||n!==null&&n===ue}function gg(e,n){Sr=Wl=!0;var a=e.pending;a===null?n.next=n:(n.next=a.next,a.next=n),e.pending=n}function _g(e,n,a){if((a&4194048)!==0){var o=n.lanes;o&=e.pendingLanes,a|=o,n.lanes=a,$s(e,a)}}var No={readContext:Rn,use:jl,useCallback:tn,useContext:tn,useEffect:tn,useImperativeHandle:tn,useLayoutEffect:tn,useInsertionEffect:tn,useMemo:tn,useReducer:tn,useRef:tn,useState:tn,useDebugValue:tn,useDeferredValue:tn,useTransition:tn,useSyncExternalStore:tn,useId:tn,useHostTransitionStatus:tn,useFormState:tn,useActionState:tn,useOptimistic:tn,useMemoCache:tn,useCacheRefresh:tn};No.useEffectEvent=tn;var vg={readContext:Rn,use:jl,useCallback:function(e,n){return Xn().memoizedState=[e,n===void 0?null:n],e},useContext:Rn,useEffect:eg,useImperativeHandle:function(e,n,a){a=a!=null?a.concat([e]):null,Kl(4194308,4,sg.bind(null,n,e),a)},useLayoutEffect:function(e,n){return Kl(4194308,4,e,n)},useInsertionEffect:function(e,n){Kl(4,2,e,n)},useMemo:function(e,n){var a=Xn();n=n===void 0?null:n;var o=e();if(zs){Pt(!0);try{e()}finally{Pt(!1)}}return a.memoizedState=[o,n],o},useReducer:function(e,n,a){var o=Xn();if(a!==void 0){var u=a(n);if(zs){Pt(!0);try{a(n)}finally{Pt(!1)}}}else u=n;return o.memoizedState=o.baseState=u,e={pending:null,lanes:0,dispatch:null,lastRenderedReducer:e,lastRenderedState:u},o.queue=e,e=e.dispatch=US.bind(null,ue,e),[o.memoizedState,e]},useRef:function(e){var n=Xn();return e={current:e},n.memoizedState=e},useState:function(e){e=Ef(e);var n=e.queue,a=mg.bind(null,ue,n);return n.dispatch=a,[e.memoizedState,a]},useDebugValue:Af,useDeferredValue:function(e,n){var a=Xn();return Rf(a,e,n)},useTransition:function(){var e=Ef(!1);return e=ug.bind(null,ue,e.queue,!0,!1),Xn().memoizedState=e,[!1,e]},useSyncExternalStore:function(e,n,a){var o=ue,u=Xn();if(Ee){if(a===void 0)throw Error(s(407));a=a()}else{if(a=n(),Xe===null)throw Error(s(349));(ye&127)!==0||Bm(o,n,a)}u.memoizedState=a;var f={value:a,getSnapshot:n};return u.queue=f,eg(Gm.bind(null,o,f,e),[e]),o.flags|=2048,Mr(9,{destroy:void 0},Hm.bind(null,o,f,a,n),null),a},useId:function(){var e=Xn(),n=Xe.identifierPrefix;if(Ee){var a=Yi,o=qi;a=(o&~(1<<32-Ot(o)-1)).toString(32)+a,n="_"+n+"R_"+a,a=ql++,0<a&&(n+="H"+a.toString(32)),n+="_"}else a=bS++,n="_"+n+"r_"+a.toString(32)+"_";return e.memoizedState=n},useHostTransitionStatus:wf,useFormState:Km,useActionState:Km,useOptimistic:function(e){var n=Xn();n.memoizedState=n.baseState=e;var a={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return n.queue=a,n=Df.bind(null,ue,!0,a),a.dispatch=n,[e,n]},useMemoCache:Sf,useCacheRefresh:function(){return Xn().memoizedState=DS.bind(null,ue)},useEffectEvent:function(e){var n=Xn(),a={impl:e};return n.memoizedState=a,function(){if((Le&2)!==0)throw Error(s(440));return a.impl.apply(void 0,arguments)}}},Uf={readContext:Rn,use:jl,useCallback:og,useContext:Rn,useEffect:Tf,useImperativeHandle:rg,useInsertionEffect:ig,useLayoutEffect:ag,useMemo:lg,useReducer:Zl,useRef:tg,useState:function(){return Zl(ga)},useDebugValue:Af,useDeferredValue:function(e,n){var a=an();return cg(a,He.memoizedState,e,n)},useTransition:function(){var e=Zl(ga)[0],n=an().memoizedState;return[typeof e=="boolean"?e:Uo(e),n]},useSyncExternalStore:Fm,useId:dg,useHostTransitionStatus:wf,useFormState:Qm,useActionState:Qm,useOptimistic:function(e,n){var a=an();return Xm(a,He,e,n)},useMemoCache:Sf,useCacheRefresh:pg};Uf.useEffectEvent=ng;var xg={readContext:Rn,use:jl,useCallback:og,useContext:Rn,useEffect:Tf,useImperativeHandle:rg,useInsertionEffect:ig,useLayoutEffect:ag,useMemo:lg,useReducer:Mf,useRef:tg,useState:function(){return Mf(ga)},useDebugValue:Af,useDeferredValue:function(e,n){var a=an();return He===null?Rf(a,e,n):cg(a,He.memoizedState,e,n)},useTransition:function(){var e=Mf(ga)[0],n=an().memoizedState;return[typeof e=="boolean"?e:Uo(e),n]},useSyncExternalStore:Fm,useId:dg,useHostTransitionStatus:wf,useFormState:$m,useActionState:$m,useOptimistic:function(e,n){var a=an();return He!==null?Xm(a,He,e,n):(a.baseState=e,[e,a.queue.dispatch])},useMemoCache:Sf,useCacheRefresh:pg};xg.useEffectEvent=ng;function Lf(e,n,a,o){n=e.memoizedState,a=a(o,n),a=a==null?n:g({},n,a),e.memoizedState=a,e.lanes===0&&(e.updateQueue.baseState=a)}var Nf={enqueueSetState:function(e,n,a){e=e._reactInternals;var o=hi(),u=qa(o);u.payload=n,a!=null&&(u.callback=a),n=Ya(e,u,o),n!==null&&(ti(n,e,o),Ro(n,e,o))},enqueueReplaceState:function(e,n,a){e=e._reactInternals;var o=hi(),u=qa(o);u.tag=1,u.payload=n,a!=null&&(u.callback=a),n=Ya(e,u,o),n!==null&&(ti(n,e,o),Ro(n,e,o))},enqueueForceUpdate:function(e,n){e=e._reactInternals;var a=hi(),o=qa(a);o.tag=2,n!=null&&(o.callback=n),n=Ya(e,o,a),n!==null&&(ti(n,e,a),Ro(n,e,a))}};function Sg(e,n,a,o,u,f,S){return e=e.stateNode,typeof e.shouldComponentUpdate=="function"?e.shouldComponentUpdate(o,f,S):n.prototype&&n.prototype.isPureReactComponent?!xo(a,o)||!xo(u,f):!0}function yg(e,n,a,o){e=n.state,typeof n.componentWillReceiveProps=="function"&&n.componentWillReceiveProps(a,o),typeof n.UNSAFE_componentWillReceiveProps=="function"&&n.UNSAFE_componentWillReceiveProps(a,o),n.state!==e&&Nf.enqueueReplaceState(n,n.state,null)}function Is(e,n){var a=n;if("ref"in n){a={};for(var o in n)o!=="ref"&&(a[o]=n[o])}if(e=e.defaultProps){a===n&&(a=g({},a));for(var u in e)a[u]===void 0&&(a[u]=e[u])}return a}function Mg(e){Dl(e)}function Eg(e){console.error(e)}function bg(e){Dl(e)}function $l(e,n){try{var a=e.onUncaughtError;a(n.value,{componentStack:n.stack})}catch(o){setTimeout(function(){throw o})}}function Tg(e,n,a){try{var o=e.onCaughtError;o(a.value,{componentStack:a.stack,errorBoundary:n.tag===1?n.stateNode:null})}catch(u){setTimeout(function(){throw u})}}function Of(e,n,a){return a=qa(a),a.tag=3,a.payload={element:null},a.callback=function(){$l(e,n)},a}function Ag(e){return e=qa(e),e.tag=3,e}function Rg(e,n,a,o){var u=a.type.getDerivedStateFromError;if(typeof u=="function"){var f=o.value;e.payload=function(){return u(f)},e.callback=function(){Tg(n,a,o)}}var S=a.stateNode;S!==null&&typeof S.componentDidCatch=="function"&&(e.callback=function(){Tg(n,a,o),typeof u!="function"&&($a===null?$a=new Set([this]):$a.add(this));var R=o.stack;this.componentDidCatch(o.value,{componentStack:R!==null?R:""})})}function LS(e,n,a,o,u){if(a.flags|=32768,o!==null&&typeof o=="object"&&typeof o.then=="function"){if(n=a.alternate,n!==null&&pr(n,a,u,!0),a=li.current,a!==null){switch(a.tag){case 31:case 13:return Ei===null?fc():a.alternate===null&&en===0&&(en=3),a.flags&=-257,a.flags|=65536,a.lanes=u,o===Hl?a.flags|=16384:(n=a.updateQueue,n===null?a.updateQueue=new Set([o]):n.add(o),sh(e,o,u)),!1;case 22:return a.flags|=65536,o===Hl?a.flags|=16384:(n=a.updateQueue,n===null?(n={transitions:null,markerInstances:null,retryQueue:new Set([o])},a.updateQueue=n):(a=n.retryQueue,a===null?n.retryQueue=new Set([o]):a.add(o)),sh(e,o,u)),!1}throw Error(s(435,a.tag))}return sh(e,o,u),fc(),!1}if(Ee)return n=li.current,n!==null?((n.flags&65536)===0&&(n.flags|=256),n.flags|=65536,n.lanes=u,o!==Ju&&(e=Error(s(422),{cause:o}),Mo(xi(e,a)))):(o!==Ju&&(n=Error(s(423),{cause:o}),Mo(xi(n,a))),e=e.current.alternate,e.flags|=65536,u&=-u,e.lanes|=u,o=xi(o,a),u=Of(e.stateNode,o,u),uf(e,u),en!==4&&(en=2)),!1;var f=Error(s(520),{cause:o});if(f=xi(f,a),Go===null?Go=[f]:Go.push(f),en!==4&&(en=2),n===null)return!0;o=xi(o,a),a=n;do{switch(a.tag){case 3:return a.flags|=65536,e=u&-u,a.lanes|=e,e=Of(a.stateNode,o,e),uf(a,e),!1;case 1:if(n=a.type,f=a.stateNode,(a.flags&128)===0&&(typeof n.getDerivedStateFromError=="function"||f!==null&&typeof f.componentDidCatch=="function"&&($a===null||!$a.has(f))))return a.flags|=65536,u&=-u,a.lanes|=u,u=Ag(u),Rg(u,e,a,o),uf(a,u),!1}a=a.return}while(a!==null);return!1}var Pf=Error(s(461)),fn=!1;function Cn(e,n,a,o){n.child=e===null?Um(n,null,a,o):Ps(n,e.child,a,o)}function Cg(e,n,a,o,u){a=a.render;var f=n.ref;if("ref"in o){var S={};for(var R in o)R!=="ref"&&(S[R]=o[R])}else S=o;return Us(n),o=gf(e,n,a,S,f,u),R=_f(),e!==null&&!fn?(vf(e,n,u),_a(e,n,u)):(Ee&&R&&Ku(n),n.flags|=1,Cn(e,n,o,u),n.child)}function wg(e,n,a,o,u){if(e===null){var f=a.type;return typeof f=="function"&&!Yu(f)&&f.defaultProps===void 0&&a.compare===null?(n.tag=15,n.type=f,Dg(e,n,f,o,u)):(e=Ol(a.type,null,o,n,n.mode,u),e.ref=n.ref,e.return=n,n.child=e)}if(f=e.child,!kf(e,u)){var S=f.memoizedProps;if(a=a.compare,a=a!==null?a:xo,a(S,o)&&e.ref===n.ref)return _a(e,n,u)}return n.flags|=1,e=fa(f,o),e.ref=n.ref,e.return=n,n.child=e}function Dg(e,n,a,o,u){if(e!==null){var f=e.memoizedProps;if(xo(f,o)&&e.ref===n.ref)if(fn=!1,n.pendingProps=o=f,kf(e,u))(e.flags&131072)!==0&&(fn=!0);else return n.lanes=e.lanes,_a(e,n,u)}return zf(e,n,a,o,u)}function Ug(e,n,a,o){var u=o.children,f=e!==null?e.memoizedState:null;if(e===null&&n.stateNode===null&&(n.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),o.mode==="hidden"){if((n.flags&128)!==0){if(f=f!==null?f.baseLanes|a:a,e!==null){for(o=n.child=e.child,u=0;o!==null;)u=u|o.lanes|o.childLanes,o=o.sibling;o=u&~f}else o=0,n.child=null;return Lg(e,n,f,a,o)}if((a&536870912)!==0)n.memoizedState={baseLanes:0,cachePool:null},e!==null&&Fl(n,f!==null?f.cachePool:null),f!==null?Om(n,f):hf(),Pm(n);else return o=n.lanes=536870912,Lg(e,n,f!==null?f.baseLanes|a:a,a,o)}else f!==null?(Fl(n,f.cachePool),Om(n,f),Za(),n.memoizedState=null):(e!==null&&Fl(n,null),hf(),Za());return Cn(e,n,u,a),n.child}function Oo(e,n){return e!==null&&e.tag===22||n.stateNode!==null||(n.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),n.sibling}function Lg(e,n,a,o,u){var f=rf();return f=f===null?null:{parent:cn._currentValue,pool:f},n.memoizedState={baseLanes:a,cachePool:f},e!==null&&Fl(n,null),hf(),Pm(n),e!==null&&pr(e,n,o,!0),n.childLanes=u,null}function tc(e,n){return n=nc({mode:n.mode,children:n.children},e.mode),n.ref=e.ref,e.child=n,n.return=e,n}function Ng(e,n,a){return Ps(n,e.child,null,a),e=tc(n,n.pendingProps),e.flags|=2,ci(n),n.memoizedState=null,e}function NS(e,n,a){var o=n.pendingProps,u=(n.flags&128)!==0;if(n.flags&=-129,e===null){if(Ee){if(o.mode==="hidden")return e=tc(n,o),n.lanes=536870912,Oo(null,e);if(pf(n),(e=qe)?(e=W0(e,Mi),e=e!==null&&e.data==="&"?e:null,e!==null&&(n.memoizedState={dehydrated:e,treeContext:Ga!==null?{id:qi,overflow:Yi}:null,retryLane:536870912,hydrationErrors:null},a=gm(e),a.return=n,n.child=a,An=n,qe=null)):e=null,e===null)throw ka(n);return n.lanes=536870912,null}return tc(n,o)}var f=e.memoizedState;if(f!==null){var S=f.dehydrated;if(pf(n),u)if(n.flags&256)n.flags&=-257,n=Ng(e,n,a);else if(n.memoizedState!==null)n.child=e.child,n.flags|=128,n=null;else throw Error(s(558));else if(fn||pr(e,n,a,!1),u=(a&e.childLanes)!==0,fn||u){if(o=Xe,o!==null&&(S=xl(o,a),S!==0&&S!==f.retryLane))throw f.retryLane=S,Rs(e,S),ti(o,e,S),Pf;fc(),n=Ng(e,n,a)}else e=f.treeContext,qe=bi(S.nextSibling),An=n,Ee=!0,Va=null,Mi=!1,e!==null&&xm(n,e),n=tc(n,o),n.flags|=4096;return n}return e=fa(e.child,{mode:o.mode,children:o.children}),e.ref=n.ref,n.child=e,e.return=n,e}function ec(e,n){var a=n.ref;if(a===null)e!==null&&e.ref!==null&&(n.flags|=4194816);else{if(typeof a!="function"&&typeof a!="object")throw Error(s(284));(e===null||e.ref!==a)&&(n.flags|=4194816)}}function zf(e,n,a,o,u){return Us(n),a=gf(e,n,a,o,void 0,u),o=_f(),e!==null&&!fn?(vf(e,n,u),_a(e,n,u)):(Ee&&o&&Ku(n),n.flags|=1,Cn(e,n,a,u),n.child)}function Og(e,n,a,o,u,f){return Us(n),n.updateQueue=null,a=Im(n,o,a,u),zm(e),o=_f(),e!==null&&!fn?(vf(e,n,f),_a(e,n,f)):(Ee&&o&&Ku(n),n.flags|=1,Cn(e,n,a,f),n.child)}function Pg(e,n,a,o,u){if(Us(n),n.stateNode===null){var f=ur,S=a.contextType;typeof S=="object"&&S!==null&&(f=Rn(S)),f=new a(o,f),n.memoizedState=f.state!==null&&f.state!==void 0?f.state:null,f.updater=Nf,n.stateNode=f,f._reactInternals=n,f=n.stateNode,f.props=o,f.state=n.memoizedState,f.refs={},lf(n),S=a.contextType,f.context=typeof S=="object"&&S!==null?Rn(S):ur,f.state=n.memoizedState,S=a.getDerivedStateFromProps,typeof S=="function"&&(Lf(n,a,S,o),f.state=n.memoizedState),typeof a.getDerivedStateFromProps=="function"||typeof f.getSnapshotBeforeUpdate=="function"||typeof f.UNSAFE_componentWillMount!="function"&&typeof f.componentWillMount!="function"||(S=f.state,typeof f.componentWillMount=="function"&&f.componentWillMount(),typeof f.UNSAFE_componentWillMount=="function"&&f.UNSAFE_componentWillMount(),S!==f.state&&Nf.enqueueReplaceState(f,f.state,null),wo(n,o,f,u),Co(),f.state=n.memoizedState),typeof f.componentDidMount=="function"&&(n.flags|=4194308),o=!0}else if(e===null){f=n.stateNode;var R=n.memoizedProps,G=Is(a,R);f.props=G;var st=f.context,gt=a.contextType;S=ur,typeof gt=="object"&&gt!==null&&(S=Rn(gt));var St=a.getDerivedStateFromProps;gt=typeof St=="function"||typeof f.getSnapshotBeforeUpdate=="function",R=n.pendingProps!==R,gt||typeof f.UNSAFE_componentWillReceiveProps!="function"&&typeof f.componentWillReceiveProps!="function"||(R||st!==S)&&yg(n,f,o,S),Wa=!1;var ct=n.memoizedState;f.state=ct,wo(n,o,f,u),Co(),st=n.memoizedState,R||ct!==st||Wa?(typeof St=="function"&&(Lf(n,a,St,o),st=n.memoizedState),(G=Wa||Sg(n,a,G,o,ct,st,S))?(gt||typeof f.UNSAFE_componentWillMount!="function"&&typeof f.componentWillMount!="function"||(typeof f.componentWillMount=="function"&&f.componentWillMount(),typeof f.UNSAFE_componentWillMount=="function"&&f.UNSAFE_componentWillMount()),typeof f.componentDidMount=="function"&&(n.flags|=4194308)):(typeof f.componentDidMount=="function"&&(n.flags|=4194308),n.memoizedProps=o,n.memoizedState=st),f.props=o,f.state=st,f.context=S,o=G):(typeof f.componentDidMount=="function"&&(n.flags|=4194308),o=!1)}else{f=n.stateNode,cf(e,n),S=n.memoizedProps,gt=Is(a,S),f.props=gt,St=n.pendingProps,ct=f.context,st=a.contextType,G=ur,typeof st=="object"&&st!==null&&(G=Rn(st)),R=a.getDerivedStateFromProps,(st=typeof R=="function"||typeof f.getSnapshotBeforeUpdate=="function")||typeof f.UNSAFE_componentWillReceiveProps!="function"&&typeof f.componentWillReceiveProps!="function"||(S!==St||ct!==G)&&yg(n,f,o,G),Wa=!1,ct=n.memoizedState,f.state=ct,wo(n,o,f,u),Co();var ht=n.memoizedState;S!==St||ct!==ht||Wa||e!==null&&e.dependencies!==null&&zl(e.dependencies)?(typeof R=="function"&&(Lf(n,a,R,o),ht=n.memoizedState),(gt=Wa||Sg(n,a,gt,o,ct,ht,G)||e!==null&&e.dependencies!==null&&zl(e.dependencies))?(st||typeof f.UNSAFE_componentWillUpdate!="function"&&typeof f.componentWillUpdate!="function"||(typeof f.componentWillUpdate=="function"&&f.componentWillUpdate(o,ht,G),typeof f.UNSAFE_componentWillUpdate=="function"&&f.UNSAFE_componentWillUpdate(o,ht,G)),typeof f.componentDidUpdate=="function"&&(n.flags|=4),typeof f.getSnapshotBeforeUpdate=="function"&&(n.flags|=1024)):(typeof f.componentDidUpdate!="function"||S===e.memoizedProps&&ct===e.memoizedState||(n.flags|=4),typeof f.getSnapshotBeforeUpdate!="function"||S===e.memoizedProps&&ct===e.memoizedState||(n.flags|=1024),n.memoizedProps=o,n.memoizedState=ht),f.props=o,f.state=ht,f.context=G,o=gt):(typeof f.componentDidUpdate!="function"||S===e.memoizedProps&&ct===e.memoizedState||(n.flags|=4),typeof f.getSnapshotBeforeUpdate!="function"||S===e.memoizedProps&&ct===e.memoizedState||(n.flags|=1024),o=!1)}return f=o,ec(e,n),o=(n.flags&128)!==0,f||o?(f=n.stateNode,a=o&&typeof a.getDerivedStateFromError!="function"?null:f.render(),n.flags|=1,e!==null&&o?(n.child=Ps(n,e.child,null,u),n.child=Ps(n,null,a,u)):Cn(e,n,a,u),n.memoizedState=f.state,e=n.child):e=_a(e,n,u),e}function zg(e,n,a,o){return ws(),n.flags|=256,Cn(e,n,a,o),n.child}var If={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function Ff(e){return{baseLanes:e,cachePool:Tm()}}function Bf(e,n,a){return e=e!==null?e.childLanes&~a:0,n&&(e|=fi),e}function Ig(e,n,a){var o=n.pendingProps,u=!1,f=(n.flags&128)!==0,S;if((S=f)||(S=e!==null&&e.memoizedState===null?!1:(nn.current&2)!==0),S&&(u=!0,n.flags&=-129),S=(n.flags&32)!==0,n.flags&=-33,e===null){if(Ee){if(u?ja(n):Za(),(e=qe)?(e=W0(e,Mi),e=e!==null&&e.data!=="&"?e:null,e!==null&&(n.memoizedState={dehydrated:e,treeContext:Ga!==null?{id:qi,overflow:Yi}:null,retryLane:536870912,hydrationErrors:null},a=gm(e),a.return=n,n.child=a,An=n,qe=null)):e=null,e===null)throw ka(n);return yh(e)?n.lanes=32:n.lanes=536870912,null}var R=o.children;return o=o.fallback,u?(Za(),u=n.mode,R=nc({mode:"hidden",children:R},u),o=Cs(o,u,a,null),R.return=n,o.return=n,R.sibling=o,n.child=R,o=n.child,o.memoizedState=Ff(a),o.childLanes=Bf(e,S,a),n.memoizedState=If,Oo(null,o)):(ja(n),Hf(n,R))}var G=e.memoizedState;if(G!==null&&(R=G.dehydrated,R!==null)){if(f)n.flags&256?(ja(n),n.flags&=-257,n=Gf(e,n,a)):n.memoizedState!==null?(Za(),n.child=e.child,n.flags|=128,n=null):(Za(),R=o.fallback,u=n.mode,o=nc({mode:"visible",children:o.children},u),R=Cs(R,u,a,null),R.flags|=2,o.return=n,R.return=n,o.sibling=R,n.child=o,Ps(n,e.child,null,a),o=n.child,o.memoizedState=Ff(a),o.childLanes=Bf(e,S,a),n.memoizedState=If,n=Oo(null,o));else if(ja(n),yh(R)){if(S=R.nextSibling&&R.nextSibling.dataset,S)var st=S.dgst;S=st,o=Error(s(419)),o.stack="",o.digest=S,Mo({value:o,source:null,stack:null}),n=Gf(e,n,a)}else if(fn||pr(e,n,a,!1),S=(a&e.childLanes)!==0,fn||S){if(S=Xe,S!==null&&(o=xl(S,a),o!==0&&o!==G.retryLane))throw G.retryLane=o,Rs(e,o),ti(S,e,o),Pf;Sh(R)||fc(),n=Gf(e,n,a)}else Sh(R)?(n.flags|=192,n.child=e.child,n=null):(e=G.treeContext,qe=bi(R.nextSibling),An=n,Ee=!0,Va=null,Mi=!1,e!==null&&xm(n,e),n=Hf(n,o.children),n.flags|=4096);return n}return u?(Za(),R=o.fallback,u=n.mode,G=e.child,st=G.sibling,o=fa(G,{mode:"hidden",children:o.children}),o.subtreeFlags=G.subtreeFlags&65011712,st!==null?R=fa(st,R):(R=Cs(R,u,a,null),R.flags|=2),R.return=n,o.return=n,o.sibling=R,n.child=o,Oo(null,o),o=n.child,R=e.child.memoizedState,R===null?R=Ff(a):(u=R.cachePool,u!==null?(G=cn._currentValue,u=u.parent!==G?{parent:G,pool:G}:u):u=Tm(),R={baseLanes:R.baseLanes|a,cachePool:u}),o.memoizedState=R,o.childLanes=Bf(e,S,a),n.memoizedState=If,Oo(e.child,o)):(ja(n),a=e.child,e=a.sibling,a=fa(a,{mode:"visible",children:o.children}),a.return=n,a.sibling=null,e!==null&&(S=n.deletions,S===null?(n.deletions=[e],n.flags|=16):S.push(e)),n.child=a,n.memoizedState=null,a)}function Hf(e,n){return n=nc({mode:"visible",children:n},e.mode),n.return=e,e.child=n}function nc(e,n){return e=oi(22,e,null,n),e.lanes=0,e}function Gf(e,n,a){return Ps(n,e.child,null,a),e=Hf(n,n.pendingProps.children),e.flags|=2,n.memoizedState=null,e}function Fg(e,n,a){e.lanes|=n;var o=e.alternate;o!==null&&(o.lanes|=n),ef(e.return,n,a)}function Vf(e,n,a,o,u,f){var S=e.memoizedState;S===null?e.memoizedState={isBackwards:n,rendering:null,renderingStartTime:0,last:o,tail:a,tailMode:u,treeForkCount:f}:(S.isBackwards=n,S.rendering=null,S.renderingStartTime=0,S.last=o,S.tail=a,S.tailMode=u,S.treeForkCount=f)}function Bg(e,n,a){var o=n.pendingProps,u=o.revealOrder,f=o.tail;o=o.children;var S=nn.current,R=(S&2)!==0;if(R?(S=S&1|2,n.flags|=128):S&=1,ut(nn,S),Cn(e,n,o,a),o=Ee?yo:0,!R&&e!==null&&(e.flags&128)!==0)t:for(e=n.child;e!==null;){if(e.tag===13)e.memoizedState!==null&&Fg(e,a,n);else if(e.tag===19)Fg(e,a,n);else if(e.child!==null){e.child.return=e,e=e.child;continue}if(e===n)break t;for(;e.sibling===null;){if(e.return===null||e.return===n)break t;e=e.return}e.sibling.return=e.return,e=e.sibling}switch(u){case"forwards":for(a=n.child,u=null;a!==null;)e=a.alternate,e!==null&&Xl(e)===null&&(u=a),a=a.sibling;a=u,a===null?(u=n.child,n.child=null):(u=a.sibling,a.sibling=null),Vf(n,!1,u,a,f,o);break;case"backwards":case"unstable_legacy-backwards":for(a=null,u=n.child,n.child=null;u!==null;){if(e=u.alternate,e!==null&&Xl(e)===null){n.child=u;break}e=u.sibling,u.sibling=a,a=u,u=e}Vf(n,!0,a,null,f,o);break;case"together":Vf(n,!1,null,null,void 0,o);break;default:n.memoizedState=null}return n.child}function _a(e,n,a){if(e!==null&&(n.dependencies=e.dependencies),Ja|=n.lanes,(a&n.childLanes)===0)if(e!==null){if(pr(e,n,a,!1),(a&n.childLanes)===0)return null}else return null;if(e!==null&&n.child!==e.child)throw Error(s(153));if(n.child!==null){for(e=n.child,a=fa(e,e.pendingProps),n.child=a,a.return=n;e.sibling!==null;)e=e.sibling,a=a.sibling=fa(e,e.pendingProps),a.return=n;a.sibling=null}return n.child}function kf(e,n){return(e.lanes&n)!==0?!0:(e=e.dependencies,!!(e!==null&&zl(e)))}function OS(e,n,a){switch(n.tag){case 3:yt(n,n.stateNode.containerInfo),Xa(n,cn,e.memoizedState.cache),ws();break;case 27:case 5:Ft(n);break;case 4:yt(n,n.stateNode.containerInfo);break;case 10:Xa(n,n.type,n.memoizedProps.value);break;case 31:if(n.memoizedState!==null)return n.flags|=128,pf(n),null;break;case 13:var o=n.memoizedState;if(o!==null)return o.dehydrated!==null?(ja(n),n.flags|=128,null):(a&n.child.childLanes)!==0?Ig(e,n,a):(ja(n),e=_a(e,n,a),e!==null?e.sibling:null);ja(n);break;case 19:var u=(e.flags&128)!==0;if(o=(a&n.childLanes)!==0,o||(pr(e,n,a,!1),o=(a&n.childLanes)!==0),u){if(o)return Bg(e,n,a);n.flags|=128}if(u=n.memoizedState,u!==null&&(u.rendering=null,u.tail=null,u.lastEffect=null),ut(nn,nn.current),o)break;return null;case 22:return n.lanes=0,Ug(e,n,a,n.pendingProps);case 24:Xa(n,cn,e.memoizedState.cache)}return _a(e,n,a)}function Hg(e,n,a){if(e!==null)if(e.memoizedProps!==n.pendingProps)fn=!0;else{if(!kf(e,a)&&(n.flags&128)===0)return fn=!1,OS(e,n,a);fn=(e.flags&131072)!==0}else fn=!1,Ee&&(n.flags&1048576)!==0&&vm(n,yo,n.index);switch(n.lanes=0,n.tag){case 16:t:{var o=n.pendingProps;if(e=Ns(n.elementType),n.type=e,typeof e=="function")Yu(e)?(o=Is(e,o),n.tag=1,n=Pg(null,n,e,o,a)):(n.tag=0,n=zf(null,n,e,o,a));else{if(e!=null){var u=e.$$typeof;if(u===U){n.tag=11,n=Cg(null,n,e,o,a);break t}else if(u===I){n.tag=14,n=wg(null,n,e,o,a);break t}}throw n=rt(e)||e,Error(s(306,n,""))}}return n;case 0:return zf(e,n,n.type,n.pendingProps,a);case 1:return o=n.type,u=Is(o,n.pendingProps),Pg(e,n,o,u,a);case 3:t:{if(yt(n,n.stateNode.containerInfo),e===null)throw Error(s(387));o=n.pendingProps;var f=n.memoizedState;u=f.element,cf(e,n),wo(n,o,null,a);var S=n.memoizedState;if(o=S.cache,Xa(n,cn,o),o!==f.cache&&nf(n,[cn],a,!0),Co(),o=S.element,f.isDehydrated)if(f={element:o,isDehydrated:!1,cache:S.cache},n.updateQueue.baseState=f,n.memoizedState=f,n.flags&256){n=zg(e,n,o,a);break t}else if(o!==u){u=xi(Error(s(424)),n),Mo(u),n=zg(e,n,o,a);break t}else for(e=n.stateNode.containerInfo,e.nodeType===9?e=e.body:e=e.nodeName==="HTML"?e.ownerDocument.body:e,qe=bi(e.firstChild),An=n,Ee=!0,Va=null,Mi=!0,a=Um(n,null,o,a),n.child=a;a;)a.flags=a.flags&-3|4096,a=a.sibling;else{if(ws(),o===u){n=_a(e,n,a);break t}Cn(e,n,o,a)}n=n.child}return n;case 26:return ec(e,n),e===null?(a=Q0(n.type,null,n.pendingProps,null))?n.memoizedState=a:Ee||(a=n.type,e=n.pendingProps,o=vc(Z.current).createElement(a),o[rn]=n,o[mn]=e,wn(o,a,e),q(o),n.stateNode=o):n.memoizedState=Q0(n.type,e.memoizedProps,n.pendingProps,e.memoizedState),null;case 27:return Ft(n),e===null&&Ee&&(o=n.stateNode=j0(n.type,n.pendingProps,Z.current),An=n,Mi=!0,u=qe,is(n.type)?(Mh=u,qe=bi(o.firstChild)):qe=u),Cn(e,n,n.pendingProps.children,a),ec(e,n),e===null&&(n.flags|=4194304),n.child;case 5:return e===null&&Ee&&((u=o=qe)&&(o=uy(o,n.type,n.pendingProps,Mi),o!==null?(n.stateNode=o,An=n,qe=bi(o.firstChild),Mi=!1,u=!0):u=!1),u||ka(n)),Ft(n),u=n.type,f=n.pendingProps,S=e!==null?e.memoizedProps:null,o=f.children,_h(u,f)?o=null:S!==null&&_h(u,S)&&(n.flags|=32),n.memoizedState!==null&&(u=gf(e,n,TS,null,null,a),Zo._currentValue=u),ec(e,n),Cn(e,n,o,a),n.child;case 6:return e===null&&Ee&&((e=a=qe)&&(a=fy(a,n.pendingProps,Mi),a!==null?(n.stateNode=a,An=n,qe=null,e=!0):e=!1),e||ka(n)),null;case 13:return Ig(e,n,a);case 4:return yt(n,n.stateNode.containerInfo),o=n.pendingProps,e===null?n.child=Ps(n,null,o,a):Cn(e,n,o,a),n.child;case 11:return Cg(e,n,n.type,n.pendingProps,a);case 7:return Cn(e,n,n.pendingProps,a),n.child;case 8:return Cn(e,n,n.pendingProps.children,a),n.child;case 12:return Cn(e,n,n.pendingProps.children,a),n.child;case 10:return o=n.pendingProps,Xa(n,n.type,o.value),Cn(e,n,o.children,a),n.child;case 9:return u=n.type._context,o=n.pendingProps.children,Us(n),u=Rn(u),o=o(u),n.flags|=1,Cn(e,n,o,a),n.child;case 14:return wg(e,n,n.type,n.pendingProps,a);case 15:return Dg(e,n,n.type,n.pendingProps,a);case 19:return Bg(e,n,a);case 31:return NS(e,n,a);case 22:return Ug(e,n,a,n.pendingProps);case 24:return Us(n),o=Rn(cn),e===null?(u=rf(),u===null&&(u=Xe,f=af(),u.pooledCache=f,f.refCount++,f!==null&&(u.pooledCacheLanes|=a),u=f),n.memoizedState={parent:o,cache:u},lf(n),Xa(n,cn,u)):((e.lanes&a)!==0&&(cf(e,n),wo(n,null,null,a),Co()),u=e.memoizedState,f=n.memoizedState,u.parent!==o?(u={parent:o,cache:o},n.memoizedState=u,n.lanes===0&&(n.memoizedState=n.updateQueue.baseState=u),Xa(n,cn,o)):(o=f.cache,Xa(n,cn,o),o!==u.cache&&nf(n,[cn],a,!0))),Cn(e,n,n.pendingProps.children,a),n.child;case 29:throw n.pendingProps}throw Error(s(156,n.tag))}function va(e){e.flags|=4}function Xf(e,n,a,o,u){if((n=(e.mode&32)!==0)&&(n=!1),n){if(e.flags|=16777216,(u&335544128)===u)if(e.stateNode.complete)e.flags|=8192;else if(d0())e.flags|=8192;else throw Os=Hl,of}else e.flags&=-16777217}function Gg(e,n){if(n.type!=="stylesheet"||(n.state.loading&4)!==0)e.flags&=-16777217;else if(e.flags|=16777216,!n_(n))if(d0())e.flags|=8192;else throw Os=Hl,of}function ic(e,n){n!==null&&(e.flags|=4),e.flags&16384&&(n=e.tag!==22?Pe():536870912,e.lanes|=n,Ar|=n)}function Po(e,n){if(!Ee)switch(e.tailMode){case"hidden":n=e.tail;for(var a=null;n!==null;)n.alternate!==null&&(a=n),n=n.sibling;a===null?e.tail=null:a.sibling=null;break;case"collapsed":a=e.tail;for(var o=null;a!==null;)a.alternate!==null&&(o=a),a=a.sibling;o===null?n||e.tail===null?e.tail=null:e.tail.sibling=null:o.sibling=null}}function Ye(e){var n=e.alternate!==null&&e.alternate.child===e.child,a=0,o=0;if(n)for(var u=e.child;u!==null;)a|=u.lanes|u.childLanes,o|=u.subtreeFlags&65011712,o|=u.flags&65011712,u.return=e,u=u.sibling;else for(u=e.child;u!==null;)a|=u.lanes|u.childLanes,o|=u.subtreeFlags,o|=u.flags,u.return=e,u=u.sibling;return e.subtreeFlags|=o,e.childLanes=a,n}function PS(e,n,a){var o=n.pendingProps;switch(Qu(n),n.tag){case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return Ye(n),null;case 1:return Ye(n),null;case 3:return a=n.stateNode,o=null,e!==null&&(o=e.memoizedState.cache),n.memoizedState.cache!==o&&(n.flags|=2048),pa(cn),Ut(),a.pendingContext&&(a.context=a.pendingContext,a.pendingContext=null),(e===null||e.child===null)&&(dr(n)?va(n):e===null||e.memoizedState.isDehydrated&&(n.flags&256)===0||(n.flags|=1024,$u())),Ye(n),null;case 26:var u=n.type,f=n.memoizedState;return e===null?(va(n),f!==null?(Ye(n),Gg(n,f)):(Ye(n),Xf(n,u,null,o,a))):f?f!==e.memoizedState?(va(n),Ye(n),Gg(n,f)):(Ye(n),n.flags&=-16777217):(e=e.memoizedProps,e!==o&&va(n),Ye(n),Xf(n,u,e,o,a)),null;case 27:if(Xt(n),a=Z.current,u=n.type,e!==null&&n.stateNode!=null)e.memoizedProps!==o&&va(n);else{if(!o){if(n.stateNode===null)throw Error(s(166));return Ye(n),null}e=vt.current,dr(n)?Sm(n):(e=j0(u,o,a),n.stateNode=e,va(n))}return Ye(n),null;case 5:if(Xt(n),u=n.type,e!==null&&n.stateNode!=null)e.memoizedProps!==o&&va(n);else{if(!o){if(n.stateNode===null)throw Error(s(166));return Ye(n),null}if(f=vt.current,dr(n))Sm(n);else{var S=vc(Z.current);switch(f){case 1:f=S.createElementNS("http://www.w3.org/2000/svg",u);break;case 2:f=S.createElementNS("http://www.w3.org/1998/Math/MathML",u);break;default:switch(u){case"svg":f=S.createElementNS("http://www.w3.org/2000/svg",u);break;case"math":f=S.createElementNS("http://www.w3.org/1998/Math/MathML",u);break;case"script":f=S.createElement("div"),f.innerHTML="<script><\/script>",f=f.removeChild(f.firstChild);break;case"select":f=typeof o.is=="string"?S.createElement("select",{is:o.is}):S.createElement("select"),o.multiple?f.multiple=!0:o.size&&(f.size=o.size);break;default:f=typeof o.is=="string"?S.createElement(u,{is:o.is}):S.createElement(u)}}f[rn]=n,f[mn]=o;t:for(S=n.child;S!==null;){if(S.tag===5||S.tag===6)f.appendChild(S.stateNode);else if(S.tag!==4&&S.tag!==27&&S.child!==null){S.child.return=S,S=S.child;continue}if(S===n)break t;for(;S.sibling===null;){if(S.return===null||S.return===n)break t;S=S.return}S.sibling.return=S.return,S=S.sibling}n.stateNode=f;t:switch(wn(f,u,o),u){case"button":case"input":case"select":case"textarea":o=!!o.autoFocus;break t;case"img":o=!0;break t;default:o=!1}o&&va(n)}}return Ye(n),Xf(n,n.type,e===null?null:e.memoizedProps,n.pendingProps,a),null;case 6:if(e&&n.stateNode!=null)e.memoizedProps!==o&&va(n);else{if(typeof o!="string"&&n.stateNode===null)throw Error(s(166));if(e=Z.current,dr(n)){if(e=n.stateNode,a=n.memoizedProps,o=null,u=An,u!==null)switch(u.tag){case 27:case 5:o=u.memoizedProps}e[rn]=n,e=!!(e.nodeValue===a||o!==null&&o.suppressHydrationWarning===!0||I0(e.nodeValue,a)),e||ka(n,!0)}else e=vc(e).createTextNode(o),e[rn]=n,n.stateNode=e}return Ye(n),null;case 31:if(a=n.memoizedState,e===null||e.memoizedState!==null){if(o=dr(n),a!==null){if(e===null){if(!o)throw Error(s(318));if(e=n.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(s(557));e[rn]=n}else ws(),(n.flags&128)===0&&(n.memoizedState=null),n.flags|=4;Ye(n),e=!1}else a=$u(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=a),e=!0;if(!e)return n.flags&256?(ci(n),n):(ci(n),null);if((n.flags&128)!==0)throw Error(s(558))}return Ye(n),null;case 13:if(o=n.memoizedState,e===null||e.memoizedState!==null&&e.memoizedState.dehydrated!==null){if(u=dr(n),o!==null&&o.dehydrated!==null){if(e===null){if(!u)throw Error(s(318));if(u=n.memoizedState,u=u!==null?u.dehydrated:null,!u)throw Error(s(317));u[rn]=n}else ws(),(n.flags&128)===0&&(n.memoizedState=null),n.flags|=4;Ye(n),u=!1}else u=$u(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=u),u=!0;if(!u)return n.flags&256?(ci(n),n):(ci(n),null)}return ci(n),(n.flags&128)!==0?(n.lanes=a,n):(a=o!==null,e=e!==null&&e.memoizedState!==null,a&&(o=n.child,u=null,o.alternate!==null&&o.alternate.memoizedState!==null&&o.alternate.memoizedState.cachePool!==null&&(u=o.alternate.memoizedState.cachePool.pool),f=null,o.memoizedState!==null&&o.memoizedState.cachePool!==null&&(f=o.memoizedState.cachePool.pool),f!==u&&(o.flags|=2048)),a!==e&&a&&(n.child.flags|=8192),ic(n,n.updateQueue),Ye(n),null);case 4:return Ut(),e===null&&hh(n.stateNode.containerInfo),Ye(n),null;case 10:return pa(n.type),Ye(n),null;case 19:if(k(nn),o=n.memoizedState,o===null)return Ye(n),null;if(u=(n.flags&128)!==0,f=o.rendering,f===null)if(u)Po(o,!1);else{if(en!==0||e!==null&&(e.flags&128)!==0)for(e=n.child;e!==null;){if(f=Xl(e),f!==null){for(n.flags|=128,Po(o,!1),e=f.updateQueue,n.updateQueue=e,ic(n,e),n.subtreeFlags=0,e=a,a=n.child;a!==null;)mm(a,e),a=a.sibling;return ut(nn,nn.current&1|2),Ee&&ha(n,o.treeForkCount),n.child}e=e.sibling}o.tail!==null&&b()>lc&&(n.flags|=128,u=!0,Po(o,!1),n.lanes=4194304)}else{if(!u)if(e=Xl(f),e!==null){if(n.flags|=128,u=!0,e=e.updateQueue,n.updateQueue=e,ic(n,e),Po(o,!0),o.tail===null&&o.tailMode==="hidden"&&!f.alternate&&!Ee)return Ye(n),null}else 2*b()-o.renderingStartTime>lc&&a!==536870912&&(n.flags|=128,u=!0,Po(o,!1),n.lanes=4194304);o.isBackwards?(f.sibling=n.child,n.child=f):(e=o.last,e!==null?e.sibling=f:n.child=f,o.last=f)}return o.tail!==null?(e=o.tail,o.rendering=e,o.tail=e.sibling,o.renderingStartTime=b(),e.sibling=null,a=nn.current,ut(nn,u?a&1|2:a&1),Ee&&ha(n,o.treeForkCount),e):(Ye(n),null);case 22:case 23:return ci(n),df(),o=n.memoizedState!==null,e!==null?e.memoizedState!==null!==o&&(n.flags|=8192):o&&(n.flags|=8192),o?(a&536870912)!==0&&(n.flags&128)===0&&(Ye(n),n.subtreeFlags&6&&(n.flags|=8192)):Ye(n),a=n.updateQueue,a!==null&&ic(n,a.retryQueue),a=null,e!==null&&e.memoizedState!==null&&e.memoizedState.cachePool!==null&&(a=e.memoizedState.cachePool.pool),o=null,n.memoizedState!==null&&n.memoizedState.cachePool!==null&&(o=n.memoizedState.cachePool.pool),o!==a&&(n.flags|=2048),e!==null&&k(Ls),null;case 24:return a=null,e!==null&&(a=e.memoizedState.cache),n.memoizedState.cache!==a&&(n.flags|=2048),pa(cn),Ye(n),null;case 25:return null;case 30:return null}throw Error(s(156,n.tag))}function zS(e,n){switch(Qu(n),n.tag){case 1:return e=n.flags,e&65536?(n.flags=e&-65537|128,n):null;case 3:return pa(cn),Ut(),e=n.flags,(e&65536)!==0&&(e&128)===0?(n.flags=e&-65537|128,n):null;case 26:case 27:case 5:return Xt(n),null;case 31:if(n.memoizedState!==null){if(ci(n),n.alternate===null)throw Error(s(340));ws()}return e=n.flags,e&65536?(n.flags=e&-65537|128,n):null;case 13:if(ci(n),e=n.memoizedState,e!==null&&e.dehydrated!==null){if(n.alternate===null)throw Error(s(340));ws()}return e=n.flags,e&65536?(n.flags=e&-65537|128,n):null;case 19:return k(nn),null;case 4:return Ut(),null;case 10:return pa(n.type),null;case 22:case 23:return ci(n),df(),e!==null&&k(Ls),e=n.flags,e&65536?(n.flags=e&-65537|128,n):null;case 24:return pa(cn),null;case 25:return null;default:return null}}function Vg(e,n){switch(Qu(n),n.tag){case 3:pa(cn),Ut();break;case 26:case 27:case 5:Xt(n);break;case 4:Ut();break;case 31:n.memoizedState!==null&&ci(n);break;case 13:ci(n);break;case 19:k(nn);break;case 10:pa(n.type);break;case 22:case 23:ci(n),df(),e!==null&&k(Ls);break;case 24:pa(cn)}}function zo(e,n){try{var a=n.updateQueue,o=a!==null?a.lastEffect:null;if(o!==null){var u=o.next;a=u;do{if((a.tag&e)===e){o=void 0;var f=a.create,S=a.inst;o=f(),S.destroy=o}a=a.next}while(a!==u)}}catch(R){Ie(n,n.return,R)}}function Ka(e,n,a){try{var o=n.updateQueue,u=o!==null?o.lastEffect:null;if(u!==null){var f=u.next;o=f;do{if((o.tag&e)===e){var S=o.inst,R=S.destroy;if(R!==void 0){S.destroy=void 0,u=n;var G=a,st=R;try{st()}catch(gt){Ie(u,G,gt)}}}o=o.next}while(o!==f)}}catch(gt){Ie(n,n.return,gt)}}function kg(e){var n=e.updateQueue;if(n!==null){var a=e.stateNode;try{Nm(n,a)}catch(o){Ie(e,e.return,o)}}}function Xg(e,n,a){a.props=Is(e.type,e.memoizedProps),a.state=e.memoizedState;try{a.componentWillUnmount()}catch(o){Ie(e,n,o)}}function Io(e,n){try{var a=e.ref;if(a!==null){switch(e.tag){case 26:case 27:case 5:var o=e.stateNode;break;case 30:o=e.stateNode;break;default:o=e.stateNode}typeof a=="function"?e.refCleanup=a(o):a.current=o}}catch(u){Ie(e,n,u)}}function ji(e,n){var a=e.ref,o=e.refCleanup;if(a!==null)if(typeof o=="function")try{o()}catch(u){Ie(e,n,u)}finally{e.refCleanup=null,e=e.alternate,e!=null&&(e.refCleanup=null)}else if(typeof a=="function")try{a(null)}catch(u){Ie(e,n,u)}else a.current=null}function Wg(e){var n=e.type,a=e.memoizedProps,o=e.stateNode;try{t:switch(n){case"button":case"input":case"select":case"textarea":a.autoFocus&&o.focus();break t;case"img":a.src?o.src=a.src:a.srcSet&&(o.srcset=a.srcSet)}}catch(u){Ie(e,e.return,u)}}function Wf(e,n,a){try{var o=e.stateNode;ay(o,e.type,a,n),o[mn]=n}catch(u){Ie(e,e.return,u)}}function qg(e){return e.tag===5||e.tag===3||e.tag===26||e.tag===27&&is(e.type)||e.tag===4}function qf(e){t:for(;;){for(;e.sibling===null;){if(e.return===null||qg(e.return))return null;e=e.return}for(e.sibling.return=e.return,e=e.sibling;e.tag!==5&&e.tag!==6&&e.tag!==18;){if(e.tag===27&&is(e.type)||e.flags&2||e.child===null||e.tag===4)continue t;e.child.return=e,e=e.child}if(!(e.flags&2))return e.stateNode}}function Yf(e,n,a){var o=e.tag;if(o===5||o===6)e=e.stateNode,n?(a.nodeType===9?a.body:a.nodeName==="HTML"?a.ownerDocument.body:a).insertBefore(e,n):(n=a.nodeType===9?a.body:a.nodeName==="HTML"?a.ownerDocument.body:a,n.appendChild(e),a=a._reactRootContainer,a!=null||n.onclick!==null||(n.onclick=ca));else if(o!==4&&(o===27&&is(e.type)&&(a=e.stateNode,n=null),e=e.child,e!==null))for(Yf(e,n,a),e=e.sibling;e!==null;)Yf(e,n,a),e=e.sibling}function ac(e,n,a){var o=e.tag;if(o===5||o===6)e=e.stateNode,n?a.insertBefore(e,n):a.appendChild(e);else if(o!==4&&(o===27&&is(e.type)&&(a=e.stateNode),e=e.child,e!==null))for(ac(e,n,a),e=e.sibling;e!==null;)ac(e,n,a),e=e.sibling}function Yg(e){var n=e.stateNode,a=e.memoizedProps;try{for(var o=e.type,u=n.attributes;u.length;)n.removeAttributeNode(u[0]);wn(n,o,a),n[rn]=e,n[mn]=a}catch(f){Ie(e,e.return,f)}}var xa=!1,hn=!1,jf=!1,jg=typeof WeakSet=="function"?WeakSet:Set,yn=null;function IS(e,n){if(e=e.containerInfo,mh=Tc,e=rm(e),Hu(e)){if("selectionStart"in e)var a={start:e.selectionStart,end:e.selectionEnd};else t:{a=(a=e.ownerDocument)&&a.defaultView||window;var o=a.getSelection&&a.getSelection();if(o&&o.rangeCount!==0){a=o.anchorNode;var u=o.anchorOffset,f=o.focusNode;o=o.focusOffset;try{a.nodeType,f.nodeType}catch{a=null;break t}var S=0,R=-1,G=-1,st=0,gt=0,St=e,ct=null;e:for(;;){for(var ht;St!==a||u!==0&&St.nodeType!==3||(R=S+u),St!==f||o!==0&&St.nodeType!==3||(G=S+o),St.nodeType===3&&(S+=St.nodeValue.length),(ht=St.firstChild)!==null;)ct=St,St=ht;for(;;){if(St===e)break e;if(ct===a&&++st===u&&(R=S),ct===f&&++gt===o&&(G=S),(ht=St.nextSibling)!==null)break;St=ct,ct=St.parentNode}St=ht}a=R===-1||G===-1?null:{start:R,end:G}}else a=null}a=a||{start:0,end:0}}else a=null;for(gh={focusedElem:e,selectionRange:a},Tc=!1,yn=n;yn!==null;)if(n=yn,e=n.child,(n.subtreeFlags&1028)!==0&&e!==null)e.return=n,yn=e;else for(;yn!==null;){switch(n=yn,f=n.alternate,e=n.flags,n.tag){case 0:if((e&4)!==0&&(e=n.updateQueue,e=e!==null?e.events:null,e!==null))for(a=0;a<e.length;a++)u=e[a],u.ref.impl=u.nextImpl;break;case 11:case 15:break;case 1:if((e&1024)!==0&&f!==null){e=void 0,a=n,u=f.memoizedProps,f=f.memoizedState,o=a.stateNode;try{var Vt=Is(a.type,u);e=o.getSnapshotBeforeUpdate(Vt,f),o.__reactInternalSnapshotBeforeUpdate=e}catch($t){Ie(a,a.return,$t)}}break;case 3:if((e&1024)!==0){if(e=n.stateNode.containerInfo,a=e.nodeType,a===9)xh(e);else if(a===1)switch(e.nodeName){case"HEAD":case"HTML":case"BODY":xh(e);break;default:e.textContent=""}}break;case 5:case 26:case 27:case 6:case 4:case 17:break;default:if((e&1024)!==0)throw Error(s(163))}if(e=n.sibling,e!==null){e.return=n.return,yn=e;break}yn=n.return}}function Zg(e,n,a){var o=a.flags;switch(a.tag){case 0:case 11:case 15:ya(e,a),o&4&&zo(5,a);break;case 1:if(ya(e,a),o&4)if(e=a.stateNode,n===null)try{e.componentDidMount()}catch(S){Ie(a,a.return,S)}else{var u=Is(a.type,n.memoizedProps);n=n.memoizedState;try{e.componentDidUpdate(u,n,e.__reactInternalSnapshotBeforeUpdate)}catch(S){Ie(a,a.return,S)}}o&64&&kg(a),o&512&&Io(a,a.return);break;case 3:if(ya(e,a),o&64&&(e=a.updateQueue,e!==null)){if(n=null,a.child!==null)switch(a.child.tag){case 27:case 5:n=a.child.stateNode;break;case 1:n=a.child.stateNode}try{Nm(e,n)}catch(S){Ie(a,a.return,S)}}break;case 27:n===null&&o&4&&Yg(a);case 26:case 5:ya(e,a),n===null&&o&4&&Wg(a),o&512&&Io(a,a.return);break;case 12:ya(e,a);break;case 31:ya(e,a),o&4&&Jg(e,a);break;case 13:ya(e,a),o&4&&$g(e,a),o&64&&(e=a.memoizedState,e!==null&&(e=e.dehydrated,e!==null&&(a=qS.bind(null,a),hy(e,a))));break;case 22:if(o=a.memoizedState!==null||xa,!o){n=n!==null&&n.memoizedState!==null||hn,u=xa;var f=hn;xa=o,(hn=n)&&!f?Ma(e,a,(a.subtreeFlags&8772)!==0):ya(e,a),xa=u,hn=f}break;case 30:break;default:ya(e,a)}}function Kg(e){var n=e.alternate;n!==null&&(e.alternate=null,Kg(n)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(n=e.stateNode,n!==null&&uo(n)),e.stateNode=null,e.return=null,e.dependencies=null,e.memoizedProps=null,e.memoizedState=null,e.pendingProps=null,e.stateNode=null,e.updateQueue=null}var Qe=null,Kn=!1;function Sa(e,n,a){for(a=a.child;a!==null;)Qg(e,n,a),a=a.sibling}function Qg(e,n,a){if(Et&&typeof Et.onCommitFiberUnmount=="function")try{Et.onCommitFiberUnmount(Tt,a)}catch{}switch(a.tag){case 26:hn||ji(a,n),Sa(e,n,a),a.memoizedState?a.memoizedState.count--:a.stateNode&&(a=a.stateNode,a.parentNode.removeChild(a));break;case 27:hn||ji(a,n);var o=Qe,u=Kn;is(a.type)&&(Qe=a.stateNode,Kn=!1),Sa(e,n,a),qo(a.stateNode),Qe=o,Kn=u;break;case 5:hn||ji(a,n);case 6:if(o=Qe,u=Kn,Qe=null,Sa(e,n,a),Qe=o,Kn=u,Qe!==null)if(Kn)try{(Qe.nodeType===9?Qe.body:Qe.nodeName==="HTML"?Qe.ownerDocument.body:Qe).removeChild(a.stateNode)}catch(f){Ie(a,n,f)}else try{Qe.removeChild(a.stateNode)}catch(f){Ie(a,n,f)}break;case 18:Qe!==null&&(Kn?(e=Qe,k0(e.nodeType===9?e.body:e.nodeName==="HTML"?e.ownerDocument.body:e,a.stateNode),Or(e)):k0(Qe,a.stateNode));break;case 4:o=Qe,u=Kn,Qe=a.stateNode.containerInfo,Kn=!0,Sa(e,n,a),Qe=o,Kn=u;break;case 0:case 11:case 14:case 15:Ka(2,a,n),hn||Ka(4,a,n),Sa(e,n,a);break;case 1:hn||(ji(a,n),o=a.stateNode,typeof o.componentWillUnmount=="function"&&Xg(a,n,o)),Sa(e,n,a);break;case 21:Sa(e,n,a);break;case 22:hn=(o=hn)||a.memoizedState!==null,Sa(e,n,a),hn=o;break;default:Sa(e,n,a)}}function Jg(e,n){if(n.memoizedState===null&&(e=n.alternate,e!==null&&(e=e.memoizedState,e!==null))){e=e.dehydrated;try{Or(e)}catch(a){Ie(n,n.return,a)}}}function $g(e,n){if(n.memoizedState===null&&(e=n.alternate,e!==null&&(e=e.memoizedState,e!==null&&(e=e.dehydrated,e!==null))))try{Or(e)}catch(a){Ie(n,n.return,a)}}function FS(e){switch(e.tag){case 31:case 13:case 19:var n=e.stateNode;return n===null&&(n=e.stateNode=new jg),n;case 22:return e=e.stateNode,n=e._retryCache,n===null&&(n=e._retryCache=new jg),n;default:throw Error(s(435,e.tag))}}function sc(e,n){var a=FS(e);n.forEach(function(o){if(!a.has(o)){a.add(o);var u=YS.bind(null,e,o);o.then(u,u)}})}function Qn(e,n){var a=n.deletions;if(a!==null)for(var o=0;o<a.length;o++){var u=a[o],f=e,S=n,R=S;t:for(;R!==null;){switch(R.tag){case 27:if(is(R.type)){Qe=R.stateNode,Kn=!1;break t}break;case 5:Qe=R.stateNode,Kn=!1;break t;case 3:case 4:Qe=R.stateNode.containerInfo,Kn=!0;break t}R=R.return}if(Qe===null)throw Error(s(160));Qg(f,S,u),Qe=null,Kn=!1,f=u.alternate,f!==null&&(f.return=null),u.return=null}if(n.subtreeFlags&13886)for(n=n.child;n!==null;)t0(n,e),n=n.sibling}var Ni=null;function t0(e,n){var a=e.alternate,o=e.flags;switch(e.tag){case 0:case 11:case 14:case 15:Qn(n,e),Jn(e),o&4&&(Ka(3,e,e.return),zo(3,e),Ka(5,e,e.return));break;case 1:Qn(n,e),Jn(e),o&512&&(hn||a===null||ji(a,a.return)),o&64&&xa&&(e=e.updateQueue,e!==null&&(o=e.callbacks,o!==null&&(a=e.shared.hiddenCallbacks,e.shared.hiddenCallbacks=a===null?o:a.concat(o))));break;case 26:var u=Ni;if(Qn(n,e),Jn(e),o&512&&(hn||a===null||ji(a,a.return)),o&4){var f=a!==null?a.memoizedState:null;if(o=e.memoizedState,a===null)if(o===null)if(e.stateNode===null){t:{o=e.type,a=e.memoizedProps,u=u.ownerDocument||u;e:switch(o){case"title":f=u.getElementsByTagName("title")[0],(!f||f[Ms]||f[rn]||f.namespaceURI==="http://www.w3.org/2000/svg"||f.hasAttribute("itemprop"))&&(f=u.createElement(o),u.head.insertBefore(f,u.querySelector("head > title"))),wn(f,o,a),f[rn]=e,q(f),o=f;break t;case"link":var S=t_("link","href",u).get(o+(a.href||""));if(S){for(var R=0;R<S.length;R++)if(f=S[R],f.getAttribute("href")===(a.href==null||a.href===""?null:a.href)&&f.getAttribute("rel")===(a.rel==null?null:a.rel)&&f.getAttribute("title")===(a.title==null?null:a.title)&&f.getAttribute("crossorigin")===(a.crossOrigin==null?null:a.crossOrigin)){S.splice(R,1);break e}}f=u.createElement(o),wn(f,o,a),u.head.appendChild(f);break;case"meta":if(S=t_("meta","content",u).get(o+(a.content||""))){for(R=0;R<S.length;R++)if(f=S[R],f.getAttribute("content")===(a.content==null?null:""+a.content)&&f.getAttribute("name")===(a.name==null?null:a.name)&&f.getAttribute("property")===(a.property==null?null:a.property)&&f.getAttribute("http-equiv")===(a.httpEquiv==null?null:a.httpEquiv)&&f.getAttribute("charset")===(a.charSet==null?null:a.charSet)){S.splice(R,1);break e}}f=u.createElement(o),wn(f,o,a),u.head.appendChild(f);break;default:throw Error(s(468,o))}f[rn]=e,q(f),o=f}e.stateNode=o}else e_(u,e.type,e.stateNode);else e.stateNode=$0(u,o,e.memoizedProps);else f!==o?(f===null?a.stateNode!==null&&(a=a.stateNode,a.parentNode.removeChild(a)):f.count--,o===null?e_(u,e.type,e.stateNode):$0(u,o,e.memoizedProps)):o===null&&e.stateNode!==null&&Wf(e,e.memoizedProps,a.memoizedProps)}break;case 27:Qn(n,e),Jn(e),o&512&&(hn||a===null||ji(a,a.return)),a!==null&&o&4&&Wf(e,e.memoizedProps,a.memoizedProps);break;case 5:if(Qn(n,e),Jn(e),o&512&&(hn||a===null||ji(a,a.return)),e.flags&32){u=e.stateNode;try{kn(u,"")}catch(Vt){Ie(e,e.return,Vt)}}o&4&&e.stateNode!=null&&(u=e.memoizedProps,Wf(e,u,a!==null?a.memoizedProps:u)),o&1024&&(jf=!0);break;case 6:if(Qn(n,e),Jn(e),o&4){if(e.stateNode===null)throw Error(s(162));o=e.memoizedProps,a=e.stateNode;try{a.nodeValue=o}catch(Vt){Ie(e,e.return,Vt)}}break;case 3:if(yc=null,u=Ni,Ni=xc(n.containerInfo),Qn(n,e),Ni=u,Jn(e),o&4&&a!==null&&a.memoizedState.isDehydrated)try{Or(n.containerInfo)}catch(Vt){Ie(e,e.return,Vt)}jf&&(jf=!1,e0(e));break;case 4:o=Ni,Ni=xc(e.stateNode.containerInfo),Qn(n,e),Jn(e),Ni=o;break;case 12:Qn(n,e),Jn(e);break;case 31:Qn(n,e),Jn(e),o&4&&(o=e.updateQueue,o!==null&&(e.updateQueue=null,sc(e,o)));break;case 13:Qn(n,e),Jn(e),e.child.flags&8192&&e.memoizedState!==null!=(a!==null&&a.memoizedState!==null)&&(oc=b()),o&4&&(o=e.updateQueue,o!==null&&(e.updateQueue=null,sc(e,o)));break;case 22:u=e.memoizedState!==null;var G=a!==null&&a.memoizedState!==null,st=xa,gt=hn;if(xa=st||u,hn=gt||G,Qn(n,e),hn=gt,xa=st,Jn(e),o&8192)t:for(n=e.stateNode,n._visibility=u?n._visibility&-2:n._visibility|1,u&&(a===null||G||xa||hn||Fs(e)),a=null,n=e;;){if(n.tag===5||n.tag===26){if(a===null){G=a=n;try{if(f=G.stateNode,u)S=f.style,typeof S.setProperty=="function"?S.setProperty("display","none","important"):S.display="none";else{R=G.stateNode;var St=G.memoizedProps.style,ct=St!=null&&St.hasOwnProperty("display")?St.display:null;R.style.display=ct==null||typeof ct=="boolean"?"":(""+ct).trim()}}catch(Vt){Ie(G,G.return,Vt)}}}else if(n.tag===6){if(a===null){G=n;try{G.stateNode.nodeValue=u?"":G.memoizedProps}catch(Vt){Ie(G,G.return,Vt)}}}else if(n.tag===18){if(a===null){G=n;try{var ht=G.stateNode;u?X0(ht,!0):X0(G.stateNode,!1)}catch(Vt){Ie(G,G.return,Vt)}}}else if((n.tag!==22&&n.tag!==23||n.memoizedState===null||n===e)&&n.child!==null){n.child.return=n,n=n.child;continue}if(n===e)break t;for(;n.sibling===null;){if(n.return===null||n.return===e)break t;a===n&&(a=null),n=n.return}a===n&&(a=null),n.sibling.return=n.return,n=n.sibling}o&4&&(o=e.updateQueue,o!==null&&(a=o.retryQueue,a!==null&&(o.retryQueue=null,sc(e,a))));break;case 19:Qn(n,e),Jn(e),o&4&&(o=e.updateQueue,o!==null&&(e.updateQueue=null,sc(e,o)));break;case 30:break;case 21:break;default:Qn(n,e),Jn(e)}}function Jn(e){var n=e.flags;if(n&2){try{for(var a,o=e.return;o!==null;){if(qg(o)){a=o;break}o=o.return}if(a==null)throw Error(s(160));switch(a.tag){case 27:var u=a.stateNode,f=qf(e);ac(e,f,u);break;case 5:var S=a.stateNode;a.flags&32&&(kn(S,""),a.flags&=-33);var R=qf(e);ac(e,R,S);break;case 3:case 4:var G=a.stateNode.containerInfo,st=qf(e);Yf(e,st,G);break;default:throw Error(s(161))}}catch(gt){Ie(e,e.return,gt)}e.flags&=-3}n&4096&&(e.flags&=-4097)}function e0(e){if(e.subtreeFlags&1024)for(e=e.child;e!==null;){var n=e;e0(n),n.tag===5&&n.flags&1024&&n.stateNode.reset(),e=e.sibling}}function ya(e,n){if(n.subtreeFlags&8772)for(n=n.child;n!==null;)Zg(e,n.alternate,n),n=n.sibling}function Fs(e){for(e=e.child;e!==null;){var n=e;switch(n.tag){case 0:case 11:case 14:case 15:Ka(4,n,n.return),Fs(n);break;case 1:ji(n,n.return);var a=n.stateNode;typeof a.componentWillUnmount=="function"&&Xg(n,n.return,a),Fs(n);break;case 27:qo(n.stateNode);case 26:case 5:ji(n,n.return),Fs(n);break;case 22:n.memoizedState===null&&Fs(n);break;case 30:Fs(n);break;default:Fs(n)}e=e.sibling}}function Ma(e,n,a){for(a=a&&(n.subtreeFlags&8772)!==0,n=n.child;n!==null;){var o=n.alternate,u=e,f=n,S=f.flags;switch(f.tag){case 0:case 11:case 15:Ma(u,f,a),zo(4,f);break;case 1:if(Ma(u,f,a),o=f,u=o.stateNode,typeof u.componentDidMount=="function")try{u.componentDidMount()}catch(st){Ie(o,o.return,st)}if(o=f,u=o.updateQueue,u!==null){var R=o.stateNode;try{var G=u.shared.hiddenCallbacks;if(G!==null)for(u.shared.hiddenCallbacks=null,u=0;u<G.length;u++)Lm(G[u],R)}catch(st){Ie(o,o.return,st)}}a&&S&64&&kg(f),Io(f,f.return);break;case 27:Yg(f);case 26:case 5:Ma(u,f,a),a&&o===null&&S&4&&Wg(f),Io(f,f.return);break;case 12:Ma(u,f,a);break;case 31:Ma(u,f,a),a&&S&4&&Jg(u,f);break;case 13:Ma(u,f,a),a&&S&4&&$g(u,f);break;case 22:f.memoizedState===null&&Ma(u,f,a),Io(f,f.return);break;case 30:break;default:Ma(u,f,a)}n=n.sibling}}function Zf(e,n){var a=null;e!==null&&e.memoizedState!==null&&e.memoizedState.cachePool!==null&&(a=e.memoizedState.cachePool.pool),e=null,n.memoizedState!==null&&n.memoizedState.cachePool!==null&&(e=n.memoizedState.cachePool.pool),e!==a&&(e!=null&&e.refCount++,a!=null&&Eo(a))}function Kf(e,n){e=null,n.alternate!==null&&(e=n.alternate.memoizedState.cache),n=n.memoizedState.cache,n!==e&&(n.refCount++,e!=null&&Eo(e))}function Oi(e,n,a,o){if(n.subtreeFlags&10256)for(n=n.child;n!==null;)n0(e,n,a,o),n=n.sibling}function n0(e,n,a,o){var u=n.flags;switch(n.tag){case 0:case 11:case 15:Oi(e,n,a,o),u&2048&&zo(9,n);break;case 1:Oi(e,n,a,o);break;case 3:Oi(e,n,a,o),u&2048&&(e=null,n.alternate!==null&&(e=n.alternate.memoizedState.cache),n=n.memoizedState.cache,n!==e&&(n.refCount++,e!=null&&Eo(e)));break;case 12:if(u&2048){Oi(e,n,a,o),e=n.stateNode;try{var f=n.memoizedProps,S=f.id,R=f.onPostCommit;typeof R=="function"&&R(S,n.alternate===null?"mount":"update",e.passiveEffectDuration,-0)}catch(G){Ie(n,n.return,G)}}else Oi(e,n,a,o);break;case 31:Oi(e,n,a,o);break;case 13:Oi(e,n,a,o);break;case 23:break;case 22:f=n.stateNode,S=n.alternate,n.memoizedState!==null?f._visibility&2?Oi(e,n,a,o):Fo(e,n):f._visibility&2?Oi(e,n,a,o):(f._visibility|=2,Er(e,n,a,o,(n.subtreeFlags&10256)!==0||!1)),u&2048&&Zf(S,n);break;case 24:Oi(e,n,a,o),u&2048&&Kf(n.alternate,n);break;default:Oi(e,n,a,o)}}function Er(e,n,a,o,u){for(u=u&&((n.subtreeFlags&10256)!==0||!1),n=n.child;n!==null;){var f=e,S=n,R=a,G=o,st=S.flags;switch(S.tag){case 0:case 11:case 15:Er(f,S,R,G,u),zo(8,S);break;case 23:break;case 22:var gt=S.stateNode;S.memoizedState!==null?gt._visibility&2?Er(f,S,R,G,u):Fo(f,S):(gt._visibility|=2,Er(f,S,R,G,u)),u&&st&2048&&Zf(S.alternate,S);break;case 24:Er(f,S,R,G,u),u&&st&2048&&Kf(S.alternate,S);break;default:Er(f,S,R,G,u)}n=n.sibling}}function Fo(e,n){if(n.subtreeFlags&10256)for(n=n.child;n!==null;){var a=e,o=n,u=o.flags;switch(o.tag){case 22:Fo(a,o),u&2048&&Zf(o.alternate,o);break;case 24:Fo(a,o),u&2048&&Kf(o.alternate,o);break;default:Fo(a,o)}n=n.sibling}}var Bo=8192;function br(e,n,a){if(e.subtreeFlags&Bo)for(e=e.child;e!==null;)i0(e,n,a),e=e.sibling}function i0(e,n,a){switch(e.tag){case 26:br(e,n,a),e.flags&Bo&&e.memoizedState!==null&&by(a,Ni,e.memoizedState,e.memoizedProps);break;case 5:br(e,n,a);break;case 3:case 4:var o=Ni;Ni=xc(e.stateNode.containerInfo),br(e,n,a),Ni=o;break;case 22:e.memoizedState===null&&(o=e.alternate,o!==null&&o.memoizedState!==null?(o=Bo,Bo=16777216,br(e,n,a),Bo=o):br(e,n,a));break;default:br(e,n,a)}}function a0(e){var n=e.alternate;if(n!==null&&(e=n.child,e!==null)){n.child=null;do n=e.sibling,e.sibling=null,e=n;while(e!==null)}}function Ho(e){var n=e.deletions;if((e.flags&16)!==0){if(n!==null)for(var a=0;a<n.length;a++){var o=n[a];yn=o,r0(o,e)}a0(e)}if(e.subtreeFlags&10256)for(e=e.child;e!==null;)s0(e),e=e.sibling}function s0(e){switch(e.tag){case 0:case 11:case 15:Ho(e),e.flags&2048&&Ka(9,e,e.return);break;case 3:Ho(e);break;case 12:Ho(e);break;case 22:var n=e.stateNode;e.memoizedState!==null&&n._visibility&2&&(e.return===null||e.return.tag!==13)?(n._visibility&=-3,rc(e)):Ho(e);break;default:Ho(e)}}function rc(e){var n=e.deletions;if((e.flags&16)!==0){if(n!==null)for(var a=0;a<n.length;a++){var o=n[a];yn=o,r0(o,e)}a0(e)}for(e=e.child;e!==null;){switch(n=e,n.tag){case 0:case 11:case 15:Ka(8,n,n.return),rc(n);break;case 22:a=n.stateNode,a._visibility&2&&(a._visibility&=-3,rc(n));break;default:rc(n)}e=e.sibling}}function r0(e,n){for(;yn!==null;){var a=yn;switch(a.tag){case 0:case 11:case 15:Ka(8,a,n);break;case 23:case 22:if(a.memoizedState!==null&&a.memoizedState.cachePool!==null){var o=a.memoizedState.cachePool.pool;o!=null&&o.refCount++}break;case 24:Eo(a.memoizedState.cache)}if(o=a.child,o!==null)o.return=a,yn=o;else t:for(a=e;yn!==null;){o=yn;var u=o.sibling,f=o.return;if(Kg(o),o===a){yn=null;break t}if(u!==null){u.return=f,yn=u;break t}yn=f}}}var BS={getCacheForType:function(e){var n=Rn(cn),a=n.data.get(e);return a===void 0&&(a=e(),n.data.set(e,a)),a},cacheSignal:function(){return Rn(cn).controller.signal}},HS=typeof WeakMap=="function"?WeakMap:Map,Le=0,Xe=null,ve=null,ye=0,ze=0,ui=null,Qa=!1,Tr=!1,Qf=!1,Ea=0,en=0,Ja=0,Bs=0,Jf=0,fi=0,Ar=0,Go=null,$n=null,$f=!1,oc=0,o0=0,lc=1/0,cc=null,$a=null,_n=0,ts=null,Rr=null,ba=0,th=0,eh=null,l0=null,Vo=0,nh=null;function hi(){return(Le&2)!==0&&ye!==0?ye&-ye:O.T!==null?lh():Wi()}function c0(){if(fi===0)if((ye&536870912)===0||Ee){var e=At;At<<=1,(At&3932160)===0&&(At=262144),fi=e}else fi=536870912;return e=li.current,e!==null&&(e.flags|=32),fi}function ti(e,n,a){(e===Xe&&(ze===2||ze===9)||e.cancelPendingCommit!==null)&&(Cr(e,0),es(e,ye,fi,!1)),Hn(e,a),((Le&2)===0||e!==Xe)&&(e===Xe&&((Le&2)===0&&(Bs|=a),en===4&&es(e,ye,fi,!1)),Zi(e))}function u0(e,n,a){if((Le&6)!==0)throw Error(s(327));var o=!a&&(n&127)===0&&(n&e.expiredLanes)===0||Ht(e,n),u=o?kS(e,n):ah(e,n,!0),f=o;do{if(u===0){Tr&&!o&&es(e,n,0,!1);break}else{if(a=e.current.alternate,f&&!GS(a)){u=ah(e,n,!1),f=!1;continue}if(u===2){if(f=n,e.errorRecoveryDisabledLanes&f)var S=0;else S=e.pendingLanes&-536870913,S=S!==0?S:S&536870912?536870912:0;if(S!==0){n=S;t:{var R=e;u=Go;var G=R.current.memoizedState.isDehydrated;if(G&&(Cr(R,S).flags|=256),S=ah(R,S,!1),S!==2){if(Qf&&!G){R.errorRecoveryDisabledLanes|=f,Bs|=f,u=4;break t}f=$n,$n=u,f!==null&&($n===null?$n=f:$n.push.apply($n,f))}u=S}if(f=!1,u!==2)continue}}if(u===1){Cr(e,0),es(e,n,0,!0);break}t:{switch(o=e,f=u,f){case 0:case 1:throw Error(s(345));case 4:if((n&4194048)!==n)break;case 6:es(o,n,fi,!Qa);break t;case 2:$n=null;break;case 3:case 5:break;default:throw Error(s(329))}if((n&62914560)===n&&(u=oc+300-b(),10<u)){if(es(o,n,fi,!Qa),pt(o,0,!0)!==0)break t;ba=n,o.timeoutHandle=G0(f0.bind(null,o,a,$n,cc,$f,n,fi,Bs,Ar,Qa,f,"Throttled",-0,0),u);break t}f0(o,a,$n,cc,$f,n,fi,Bs,Ar,Qa,f,null,-0,0)}}break}while(!0);Zi(e)}function f0(e,n,a,o,u,f,S,R,G,st,gt,St,ct,ht){if(e.timeoutHandle=-1,St=n.subtreeFlags,St&8192||(St&16785408)===16785408){St={stylesheets:null,count:0,imgCount:0,imgBytes:0,suspenseyImages:[],waitingForImages:!0,waitingForViewTransition:!1,unsuspend:ca},i0(n,f,St);var Vt=(f&62914560)===f?oc-b():(f&4194048)===f?o0-b():0;if(Vt=Ty(St,Vt),Vt!==null){ba=f,e.cancelPendingCommit=Vt(x0.bind(null,e,n,f,a,o,u,S,R,G,gt,St,null,ct,ht)),es(e,f,S,!st);return}}x0(e,n,f,a,o,u,S,R,G)}function GS(e){for(var n=e;;){var a=n.tag;if((a===0||a===11||a===15)&&n.flags&16384&&(a=n.updateQueue,a!==null&&(a=a.stores,a!==null)))for(var o=0;o<a.length;o++){var u=a[o],f=u.getSnapshot;u=u.value;try{if(!ri(f(),u))return!1}catch{return!1}}if(a=n.child,n.subtreeFlags&16384&&a!==null)a.return=n,n=a;else{if(n===e)break;for(;n.sibling===null;){if(n.return===null||n.return===e)return!0;n=n.return}n.sibling.return=n.return,n=n.sibling}}return!0}function es(e,n,a,o){n&=~Jf,n&=~Bs,e.suspendedLanes|=n,e.pingedLanes&=~n,o&&(e.warmLanes|=n),o=e.expirationTimes;for(var u=n;0<u;){var f=31-Ot(u),S=1<<f;o[f]=-1,u&=~S}a!==0&&co(e,a,n)}function uc(){return(Le&6)===0?(ko(0),!1):!0}function ih(){if(ve!==null){if(ze===0)var e=ve.return;else e=ve,da=Ds=null,xf(e),vr=null,To=0,e=ve;for(;e!==null;)Vg(e.alternate,e),e=e.return;ve=null}}function Cr(e,n){var a=e.timeoutHandle;a!==-1&&(e.timeoutHandle=-1,oy(a)),a=e.cancelPendingCommit,a!==null&&(e.cancelPendingCommit=null,a()),ba=0,ih(),Xe=e,ve=a=fa(e.current,null),ye=n,ze=0,ui=null,Qa=!1,Tr=Ht(e,n),Qf=!1,Ar=fi=Jf=Bs=Ja=en=0,$n=Go=null,$f=!1,(n&8)!==0&&(n|=n&32);var o=e.entangledLanes;if(o!==0)for(e=e.entanglements,o&=n;0<o;){var u=31-Ot(o),f=1<<u;n|=e[u],o&=~f}return Ea=n,Ul(),a}function h0(e,n){ue=null,O.H=No,n===_r||n===Bl?(n=Cm(),ze=3):n===of?(n=Cm(),ze=4):ze=n===Pf?8:n!==null&&typeof n=="object"&&typeof n.then=="function"?6:1,ui=n,ve===null&&(en=1,$l(e,xi(n,e.current)))}function d0(){var e=li.current;return e===null?!0:(ye&4194048)===ye?Ei===null:(ye&62914560)===ye||(ye&536870912)!==0?e===Ei:!1}function p0(){var e=O.H;return O.H=No,e===null?No:e}function m0(){var e=O.A;return O.A=BS,e}function fc(){en=4,Qa||(ye&4194048)!==ye&&li.current!==null||(Tr=!0),(Ja&134217727)===0&&(Bs&134217727)===0||Xe===null||es(Xe,ye,fi,!1)}function ah(e,n,a){var o=Le;Le|=2;var u=p0(),f=m0();(Xe!==e||ye!==n)&&(cc=null,Cr(e,n)),n=!1;var S=en;t:do try{if(ze!==0&&ve!==null){var R=ve,G=ui;switch(ze){case 8:ih(),S=6;break t;case 3:case 2:case 9:case 6:li.current===null&&(n=!0);var st=ze;if(ze=0,ui=null,wr(e,R,G,st),a&&Tr){S=0;break t}break;default:st=ze,ze=0,ui=null,wr(e,R,G,st)}}VS(),S=en;break}catch(gt){h0(e,gt)}while(!0);return n&&e.shellSuspendCounter++,da=Ds=null,Le=o,O.H=u,O.A=f,ve===null&&(Xe=null,ye=0,Ul()),S}function VS(){for(;ve!==null;)g0(ve)}function kS(e,n){var a=Le;Le|=2;var o=p0(),u=m0();Xe!==e||ye!==n?(cc=null,lc=b()+500,Cr(e,n)):Tr=Ht(e,n);t:do try{if(ze!==0&&ve!==null){n=ve;var f=ui;e:switch(ze){case 1:ze=0,ui=null,wr(e,n,f,1);break;case 2:case 9:if(Am(f)){ze=0,ui=null,_0(n);break}n=function(){ze!==2&&ze!==9||Xe!==e||(ze=7),Zi(e)},f.then(n,n);break t;case 3:ze=7;break t;case 4:ze=5;break t;case 7:Am(f)?(ze=0,ui=null,_0(n)):(ze=0,ui=null,wr(e,n,f,7));break;case 5:var S=null;switch(ve.tag){case 26:S=ve.memoizedState;case 5:case 27:var R=ve;if(S?n_(S):R.stateNode.complete){ze=0,ui=null;var G=R.sibling;if(G!==null)ve=G;else{var st=R.return;st!==null?(ve=st,hc(st)):ve=null}break e}}ze=0,ui=null,wr(e,n,f,5);break;case 6:ze=0,ui=null,wr(e,n,f,6);break;case 8:ih(),en=6;break t;default:throw Error(s(462))}}XS();break}catch(gt){h0(e,gt)}while(!0);return da=Ds=null,O.H=o,O.A=u,Le=a,ve!==null?0:(Xe=null,ye=0,Ul(),en)}function XS(){for(;ve!==null&&!Yt();)g0(ve)}function g0(e){var n=Hg(e.alternate,e,Ea);e.memoizedProps=e.pendingProps,n===null?hc(e):ve=n}function _0(e){var n=e,a=n.alternate;switch(n.tag){case 15:case 0:n=Og(a,n,n.pendingProps,n.type,void 0,ye);break;case 11:n=Og(a,n,n.pendingProps,n.type.render,n.ref,ye);break;case 5:xf(n);default:Vg(a,n),n=ve=mm(n,Ea),n=Hg(a,n,Ea)}e.memoizedProps=e.pendingProps,n===null?hc(e):ve=n}function wr(e,n,a,o){da=Ds=null,xf(n),vr=null,To=0;var u=n.return;try{if(LS(e,u,n,a,ye)){en=1,$l(e,xi(a,e.current)),ve=null;return}}catch(f){if(u!==null)throw ve=u,f;en=1,$l(e,xi(a,e.current)),ve=null;return}n.flags&32768?(Ee||o===1?e=!0:Tr||(ye&536870912)!==0?e=!1:(Qa=e=!0,(o===2||o===9||o===3||o===6)&&(o=li.current,o!==null&&o.tag===13&&(o.flags|=16384))),v0(n,e)):hc(n)}function hc(e){var n=e;do{if((n.flags&32768)!==0){v0(n,Qa);return}e=n.return;var a=PS(n.alternate,n,Ea);if(a!==null){ve=a;return}if(n=n.sibling,n!==null){ve=n;return}ve=n=e}while(n!==null);en===0&&(en=5)}function v0(e,n){do{var a=zS(e.alternate,e);if(a!==null){a.flags&=32767,ve=a;return}if(a=e.return,a!==null&&(a.flags|=32768,a.subtreeFlags=0,a.deletions=null),!n&&(e=e.sibling,e!==null)){ve=e;return}ve=e=a}while(e!==null);en=6,ve=null}function x0(e,n,a,o,u,f,S,R,G){e.cancelPendingCommit=null;do dc();while(_n!==0);if((Le&6)!==0)throw Error(s(327));if(n!==null){if(n===e.current)throw Error(s(177));if(f=n.lanes|n.childLanes,f|=Wu,Ci(e,a,f,S,R,G),e===Xe&&(ve=Xe=null,ye=0),Rr=n,ts=e,ba=a,th=f,eh=u,l0=o,(n.subtreeFlags&10256)!==0||(n.flags&10256)!==0?(e.callbackNode=null,e.callbackPriority=0,jS(mt,function(){return b0(),null})):(e.callbackNode=null,e.callbackPriority=0),o=(n.flags&13878)!==0,(n.subtreeFlags&13878)!==0||o){o=O.T,O.T=null,u=B.p,B.p=2,S=Le,Le|=4;try{IS(e,n,a)}finally{Le=S,B.p=u,O.T=o}}_n=1,S0(),y0(),M0()}}function S0(){if(_n===1){_n=0;var e=ts,n=Rr,a=(n.flags&13878)!==0;if((n.subtreeFlags&13878)!==0||a){a=O.T,O.T=null;var o=B.p;B.p=2;var u=Le;Le|=4;try{t0(n,e);var f=gh,S=rm(e.containerInfo),R=f.focusedElem,G=f.selectionRange;if(S!==R&&R&&R.ownerDocument&&sm(R.ownerDocument.documentElement,R)){if(G!==null&&Hu(R)){var st=G.start,gt=G.end;if(gt===void 0&&(gt=st),"selectionStart"in R)R.selectionStart=st,R.selectionEnd=Math.min(gt,R.value.length);else{var St=R.ownerDocument||document,ct=St&&St.defaultView||window;if(ct.getSelection){var ht=ct.getSelection(),Vt=R.textContent.length,$t=Math.min(G.start,Vt),Ve=G.end===void 0?$t:Math.min(G.end,Vt);!ht.extend&&$t>Ve&&(S=Ve,Ve=$t,$t=S);var tt=am(R,$t),X=am(R,Ve);if(tt&&X&&(ht.rangeCount!==1||ht.anchorNode!==tt.node||ht.anchorOffset!==tt.offset||ht.focusNode!==X.node||ht.focusOffset!==X.offset)){var it=St.createRange();it.setStart(tt.node,tt.offset),ht.removeAllRanges(),$t>Ve?(ht.addRange(it),ht.extend(X.node,X.offset)):(it.setEnd(X.node,X.offset),ht.addRange(it))}}}}for(St=[],ht=R;ht=ht.parentNode;)ht.nodeType===1&&St.push({element:ht,left:ht.scrollLeft,top:ht.scrollTop});for(typeof R.focus=="function"&&R.focus(),R=0;R<St.length;R++){var xt=St[R];xt.element.scrollLeft=xt.left,xt.element.scrollTop=xt.top}}Tc=!!mh,gh=mh=null}finally{Le=u,B.p=o,O.T=a}}e.current=n,_n=2}}function y0(){if(_n===2){_n=0;var e=ts,n=Rr,a=(n.flags&8772)!==0;if((n.subtreeFlags&8772)!==0||a){a=O.T,O.T=null;var o=B.p;B.p=2;var u=Le;Le|=4;try{Zg(e,n.alternate,n)}finally{Le=u,B.p=o,O.T=a}}_n=3}}function M0(){if(_n===4||_n===3){_n=0,z();var e=ts,n=Rr,a=ba,o=l0;(n.subtreeFlags&10256)!==0||(n.flags&10256)!==0?_n=5:(_n=0,Rr=ts=null,E0(e,e.pendingLanes));var u=e.pendingLanes;if(u===0&&($a=null),er(a),n=n.stateNode,Et&&typeof Et.onCommitFiberRoot=="function")try{Et.onCommitFiberRoot(Tt,n,void 0,(n.current.flags&128)===128)}catch{}if(o!==null){n=O.T,u=B.p,B.p=2,O.T=null;try{for(var f=e.onRecoverableError,S=0;S<o.length;S++){var R=o[S];f(R.value,{componentStack:R.stack})}}finally{O.T=n,B.p=u}}(ba&3)!==0&&dc(),Zi(e),u=e.pendingLanes,(a&261930)!==0&&(u&42)!==0?e===nh?Vo++:(Vo=0,nh=e):Vo=0,ko(0)}}function E0(e,n){(e.pooledCacheLanes&=n)===0&&(n=e.pooledCache,n!=null&&(e.pooledCache=null,Eo(n)))}function dc(){return S0(),y0(),M0(),b0()}function b0(){if(_n!==5)return!1;var e=ts,n=th;th=0;var a=er(ba),o=O.T,u=B.p;try{B.p=32>a?32:a,O.T=null,a=eh,eh=null;var f=ts,S=ba;if(_n=0,Rr=ts=null,ba=0,(Le&6)!==0)throw Error(s(331));var R=Le;if(Le|=4,s0(f.current),n0(f,f.current,S,a),Le=R,ko(0,!1),Et&&typeof Et.onPostCommitFiberRoot=="function")try{Et.onPostCommitFiberRoot(Tt,f)}catch{}return!0}finally{B.p=u,O.T=o,E0(e,n)}}function T0(e,n,a){n=xi(a,n),n=Of(e.stateNode,n,2),e=Ya(e,n,2),e!==null&&(Hn(e,2),Zi(e))}function Ie(e,n,a){if(e.tag===3)T0(e,e,a);else for(;n!==null;){if(n.tag===3){T0(n,e,a);break}else if(n.tag===1){var o=n.stateNode;if(typeof n.type.getDerivedStateFromError=="function"||typeof o.componentDidCatch=="function"&&($a===null||!$a.has(o))){e=xi(a,e),a=Ag(2),o=Ya(n,a,2),o!==null&&(Rg(a,o,n,e),Hn(o,2),Zi(o));break}}n=n.return}}function sh(e,n,a){var o=e.pingCache;if(o===null){o=e.pingCache=new HS;var u=new Set;o.set(n,u)}else u=o.get(n),u===void 0&&(u=new Set,o.set(n,u));u.has(a)||(Qf=!0,u.add(a),e=WS.bind(null,e,n,a),n.then(e,e))}function WS(e,n,a){var o=e.pingCache;o!==null&&o.delete(n),e.pingedLanes|=e.suspendedLanes&a,e.warmLanes&=~a,Xe===e&&(ye&a)===a&&(en===4||en===3&&(ye&62914560)===ye&&300>b()-oc?(Le&2)===0&&Cr(e,0):Jf|=a,Ar===ye&&(Ar=0)),Zi(e)}function A0(e,n){n===0&&(n=Pe()),e=Rs(e,n),e!==null&&(Hn(e,n),Zi(e))}function qS(e){var n=e.memoizedState,a=0;n!==null&&(a=n.retryLane),A0(e,a)}function YS(e,n){var a=0;switch(e.tag){case 31:case 13:var o=e.stateNode,u=e.memoizedState;u!==null&&(a=u.retryLane);break;case 19:o=e.stateNode;break;case 22:o=e.stateNode._retryCache;break;default:throw Error(s(314))}o!==null&&o.delete(n),A0(e,a)}function jS(e,n){return be(e,n)}var pc=null,Dr=null,rh=!1,mc=!1,oh=!1,ns=0;function Zi(e){e!==Dr&&e.next===null&&(Dr===null?pc=Dr=e:Dr=Dr.next=e),mc=!0,rh||(rh=!0,KS())}function ko(e,n){if(!oh&&mc){oh=!0;do for(var a=!1,o=pc;o!==null;){if(e!==0){var u=o.pendingLanes;if(u===0)var f=0;else{var S=o.suspendedLanes,R=o.pingedLanes;f=(1<<31-Ot(42|e)+1)-1,f&=u&~(S&~R),f=f&201326741?f&201326741|1:f?f|2:0}f!==0&&(a=!0,D0(o,f))}else f=ye,f=pt(o,o===Xe?f:0,o.cancelPendingCommit!==null||o.timeoutHandle!==-1),(f&3)===0||Ht(o,f)||(a=!0,D0(o,f));o=o.next}while(a);oh=!1}}function ZS(){R0()}function R0(){mc=rh=!1;var e=0;ns!==0&&ry()&&(e=ns);for(var n=b(),a=null,o=pc;o!==null;){var u=o.next,f=C0(o,n);f===0?(o.next=null,a===null?pc=u:a.next=u,u===null&&(Dr=a)):(a=o,(e!==0||(f&3)!==0)&&(mc=!0)),o=u}_n!==0&&_n!==5||ko(e),ns!==0&&(ns=0)}function C0(e,n){for(var a=e.suspendedLanes,o=e.pingedLanes,u=e.expirationTimes,f=e.pendingLanes&-62914561;0<f;){var S=31-Ot(f),R=1<<S,G=u[S];G===-1?((R&a)===0||(R&o)!==0)&&(u[S]=ie(R,n)):G<=n&&(e.expiredLanes|=R),f&=~R}if(n=Xe,a=ye,a=pt(e,e===n?a:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),o=e.callbackNode,a===0||e===n&&(ze===2||ze===9)||e.cancelPendingCommit!==null)return o!==null&&o!==null&&Ne(o),e.callbackNode=null,e.callbackPriority=0;if((a&3)===0||Ht(e,a)){if(n=a&-a,n===e.callbackPriority)return n;switch(o!==null&&Ne(o),er(a)){case 2:case 8:a=Mt;break;case 32:a=mt;break;case 268435456:a=wt;break;default:a=mt}return o=w0.bind(null,e),a=be(a,o),e.callbackPriority=n,e.callbackNode=a,n}return o!==null&&o!==null&&Ne(o),e.callbackPriority=2,e.callbackNode=null,2}function w0(e,n){if(_n!==0&&_n!==5)return e.callbackNode=null,e.callbackPriority=0,null;var a=e.callbackNode;if(dc()&&e.callbackNode!==a)return null;var o=ye;return o=pt(e,e===Xe?o:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),o===0?null:(u0(e,o,n),C0(e,b()),e.callbackNode!=null&&e.callbackNode===a?w0.bind(null,e):null)}function D0(e,n){if(dc())return null;u0(e,n,!0)}function KS(){ly(function(){(Le&6)!==0?be(_t,ZS):R0()})}function lh(){if(ns===0){var e=mr;e===0&&(e=Ct,Ct<<=1,(Ct&261888)===0&&(Ct=256)),ns=e}return ns}function U0(e){return e==null||typeof e=="symbol"||typeof e=="boolean"?null:typeof e=="function"?e:El(""+e)}function L0(e,n){var a=n.ownerDocument.createElement("input");return a.name=n.name,a.value=n.value,e.id&&a.setAttribute("form",e.id),n.parentNode.insertBefore(a,n),e=new FormData(e),a.parentNode.removeChild(a),e}function QS(e,n,a,o,u){if(n==="submit"&&a&&a.stateNode===u){var f=U0((u[mn]||null).action),S=o.submitter;S&&(n=(n=S[mn]||null)?U0(n.formAction):S.getAttribute("formAction"),n!==null&&(f=n,S=null));var R=new Rl("action","action",null,o,u);e.push({event:R,listeners:[{instance:null,listener:function(){if(o.defaultPrevented){if(ns!==0){var G=S?L0(u,S):new FormData(u);Cf(a,{pending:!0,data:G,method:u.method,action:f},null,G)}}else typeof f=="function"&&(R.preventDefault(),G=S?L0(u,S):new FormData(u),Cf(a,{pending:!0,data:G,method:u.method,action:f},f,G))},currentTarget:u}]})}}for(var ch=0;ch<Xu.length;ch++){var uh=Xu[ch],JS=uh.toLowerCase(),$S=uh[0].toUpperCase()+uh.slice(1);Li(JS,"on"+$S)}Li(cm,"onAnimationEnd"),Li(um,"onAnimationIteration"),Li(fm,"onAnimationStart"),Li("dblclick","onDoubleClick"),Li("focusin","onFocus"),Li("focusout","onBlur"),Li(mS,"onTransitionRun"),Li(gS,"onTransitionStart"),Li(_S,"onTransitionCancel"),Li(hm,"onTransitionEnd"),Dt("onMouseEnter",["mouseout","mouseover"]),Dt("onMouseLeave",["mouseout","mouseover"]),Dt("onPointerEnter",["pointerout","pointerover"]),Dt("onPointerLeave",["pointerout","pointerover"]),nt("onChange","change click focusin focusout input keydown keyup selectionchange".split(" ")),nt("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" ")),nt("onBeforeInput",["compositionend","keypress","textInput","paste"]),nt("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" ")),nt("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" ")),nt("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var Xo="abort canplay canplaythrough durationchange emptied encrypted ended error loadeddata loadedmetadata loadstart pause play playing progress ratechange resize seeked seeking stalled suspend timeupdate volumechange waiting".split(" "),ty=new Set("beforetoggle cancel close invalid load scroll scrollend toggle".split(" ").concat(Xo));function N0(e,n){n=(n&4)!==0;for(var a=0;a<e.length;a++){var o=e[a],u=o.event;o=o.listeners;t:{var f=void 0;if(n)for(var S=o.length-1;0<=S;S--){var R=o[S],G=R.instance,st=R.currentTarget;if(R=R.listener,G!==f&&u.isPropagationStopped())break t;f=R,u.currentTarget=st;try{f(u)}catch(gt){Dl(gt)}u.currentTarget=null,f=G}else for(S=0;S<o.length;S++){if(R=o[S],G=R.instance,st=R.currentTarget,R=R.listener,G!==f&&u.isPropagationStopped())break t;f=R,u.currentTarget=st;try{f(u)}catch(gt){Dl(gt)}u.currentTarget=null,f=G}}}}function xe(e,n){var a=n[Ia];a===void 0&&(a=n[Ia]=new Set);var o=e+"__bubble";a.has(o)||(O0(n,e,2,!1),a.add(o))}function fh(e,n,a){var o=0;n&&(o|=4),O0(a,e,o,n)}var gc="_reactListening"+Math.random().toString(36).slice(2);function hh(e){if(!e[gc]){e[gc]=!0,ft.forEach(function(a){a!=="selectionchange"&&(ty.has(a)||fh(a,!1,e),fh(a,!0,e))});var n=e.nodeType===9?e:e.ownerDocument;n===null||n[gc]||(n[gc]=!0,fh("selectionchange",!1,n))}}function O0(e,n,a,o){switch(c_(n)){case 2:var u=Cy;break;case 8:u=wy;break;default:u=Rh}a=u.bind(null,n,a,e),u=void 0,!Uu||n!=="touchstart"&&n!=="touchmove"&&n!=="wheel"||(u=!0),o?u!==void 0?e.addEventListener(n,a,{capture:!0,passive:u}):e.addEventListener(n,a,!0):u!==void 0?e.addEventListener(n,a,{passive:u}):e.addEventListener(n,a,!1)}function dh(e,n,a,o,u){var f=o;if((n&1)===0&&(n&2)===0&&o!==null)t:for(;;){if(o===null)return;var S=o.tag;if(S===3||S===4){var R=o.stateNode.containerInfo;if(R===u)break;if(S===4)for(S=o.return;S!==null;){var G=S.tag;if((G===3||G===4)&&S.stateNode.containerInfo===u)return;S=S.return}for(;R!==null;){if(S=Fa(R),S===null)return;if(G=S.tag,G===5||G===6||G===26||G===27){o=f=S;continue t}R=R.parentNode}}o=o.return}Bp(function(){var st=f,gt=wu(a),St=[];t:{var ct=dm.get(e);if(ct!==void 0){var ht=Rl,Vt=e;switch(e){case"keypress":if(Tl(a)===0)break t;case"keydown":case"keyup":ht=Yx;break;case"focusin":Vt="focus",ht=Pu;break;case"focusout":Vt="blur",ht=Pu;break;case"beforeblur":case"afterblur":ht=Pu;break;case"click":if(a.button===2)break t;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":ht=Vp;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":ht=Px;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":ht=Kx;break;case cm:case um:case fm:ht=Fx;break;case hm:ht=Jx;break;case"scroll":case"scrollend":ht=Nx;break;case"wheel":ht=tS;break;case"copy":case"cut":case"paste":ht=Hx;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":ht=Xp;break;case"toggle":case"beforetoggle":ht=nS}var $t=(n&4)!==0,Ve=!$t&&(e==="scroll"||e==="scrollend"),tt=$t?ct!==null?ct+"Capture":null:ct;$t=[];for(var X=st,it;X!==null;){var xt=X;if(it=xt.stateNode,xt=xt.tag,xt!==5&&xt!==26&&xt!==27||it===null||tt===null||(xt=fo(X,tt),xt!=null&&$t.push(Wo(X,xt,it))),Ve)break;X=X.return}0<$t.length&&(ct=new ht(ct,Vt,null,a,gt),St.push({event:ct,listeners:$t}))}}if((n&7)===0){t:{if(ct=e==="mouseover"||e==="pointerover",ht=e==="mouseout"||e==="pointerout",ct&&a!==Cu&&(Vt=a.relatedTarget||a.fromElement)&&(Fa(Vt)||Vt[oa]))break t;if((ht||ct)&&(ct=gt.window===gt?gt:(ct=gt.ownerDocument)?ct.defaultView||ct.parentWindow:window,ht?(Vt=a.relatedTarget||a.toElement,ht=st,Vt=Vt?Fa(Vt):null,Vt!==null&&(Ve=c(Vt),$t=Vt.tag,Vt!==Ve||$t!==5&&$t!==27&&$t!==6)&&(Vt=null)):(ht=null,Vt=st),ht!==Vt)){if($t=Vp,xt="onMouseLeave",tt="onMouseEnter",X="mouse",(e==="pointerout"||e==="pointerover")&&($t=Xp,xt="onPointerLeave",tt="onPointerEnter",X="pointer"),Ve=ht==null?ct:Es(ht),it=Vt==null?ct:Es(Vt),ct=new $t(xt,X+"leave",ht,a,gt),ct.target=Ve,ct.relatedTarget=it,xt=null,Fa(gt)===st&&($t=new $t(tt,X+"enter",Vt,a,gt),$t.target=it,$t.relatedTarget=Ve,xt=$t),Ve=xt,ht&&Vt)e:{for($t=ey,tt=ht,X=Vt,it=0,xt=tt;xt;xt=$t(xt))it++;xt=0;for(var Qt=X;Qt;Qt=$t(Qt))xt++;for(;0<it-xt;)tt=$t(tt),it--;for(;0<xt-it;)X=$t(X),xt--;for(;it--;){if(tt===X||X!==null&&tt===X.alternate){$t=tt;break e}tt=$t(tt),X=$t(X)}$t=null}else $t=null;ht!==null&&P0(St,ct,ht,$t,!1),Vt!==null&&Ve!==null&&P0(St,Ve,Vt,$t,!0)}}t:{if(ct=st?Es(st):window,ht=ct.nodeName&&ct.nodeName.toLowerCase(),ht==="select"||ht==="input"&&ct.type==="file")var we=Jp;else if(Kp(ct))if($p)we=hS;else{we=uS;var jt=cS}else ht=ct.nodeName,!ht||ht.toLowerCase()!=="input"||ct.type!=="checkbox"&&ct.type!=="radio"?st&&ir(st.elementType)&&(we=Jp):we=fS;if(we&&(we=we(e,st))){Qp(St,we,a,gt);break t}jt&&jt(e,ct,st),e==="focusout"&&st&&ct.type==="number"&&st.memoizedProps.value!=null&&Di(ct,"number",ct.value)}switch(jt=st?Es(st):window,e){case"focusin":(Kp(jt)||jt.contentEditable==="true")&&(or=jt,Gu=st,So=null);break;case"focusout":So=Gu=or=null;break;case"mousedown":Vu=!0;break;case"contextmenu":case"mouseup":case"dragend":Vu=!1,om(St,a,gt);break;case"selectionchange":if(pS)break;case"keydown":case"keyup":om(St,a,gt)}var de;if(Iu)t:{switch(e){case"compositionstart":var Me="onCompositionStart";break t;case"compositionend":Me="onCompositionEnd";break t;case"compositionupdate":Me="onCompositionUpdate";break t}Me=void 0}else rr?jp(e,a)&&(Me="onCompositionEnd"):e==="keydown"&&a.keyCode===229&&(Me="onCompositionStart");Me&&(Wp&&a.locale!=="ko"&&(rr||Me!=="onCompositionStart"?Me==="onCompositionEnd"&&rr&&(de=Hp()):(Ha=gt,Lu="value"in Ha?Ha.value:Ha.textContent,rr=!0)),jt=_c(st,Me),0<jt.length&&(Me=new kp(Me,e,null,a,gt),St.push({event:Me,listeners:jt}),de?Me.data=de:(de=Zp(a),de!==null&&(Me.data=de)))),(de=aS?sS(e,a):rS(e,a))&&(Me=_c(st,"onBeforeInput"),0<Me.length&&(jt=new kp("onBeforeInput","beforeinput",null,a,gt),St.push({event:jt,listeners:Me}),jt.data=de)),QS(St,e,st,a,gt)}N0(St,n)})}function Wo(e,n,a){return{instance:e,listener:n,currentTarget:a}}function _c(e,n){for(var a=n+"Capture",o=[];e!==null;){var u=e,f=u.stateNode;if(u=u.tag,u!==5&&u!==26&&u!==27||f===null||(u=fo(e,a),u!=null&&o.unshift(Wo(e,u,f)),u=fo(e,n),u!=null&&o.push(Wo(e,u,f))),e.tag===3)return o;e=e.return}return[]}function ey(e){if(e===null)return null;do e=e.return;while(e&&e.tag!==5&&e.tag!==27);return e||null}function P0(e,n,a,o,u){for(var f=n._reactName,S=[];a!==null&&a!==o;){var R=a,G=R.alternate,st=R.stateNode;if(R=R.tag,G!==null&&G===o)break;R!==5&&R!==26&&R!==27||st===null||(G=st,u?(st=fo(a,f),st!=null&&S.unshift(Wo(a,st,G))):u||(st=fo(a,f),st!=null&&S.push(Wo(a,st,G)))),a=a.return}S.length!==0&&e.push({event:n,listeners:S})}var ny=/\r\n?/g,iy=/\u0000|\uFFFD/g;function z0(e){return(typeof e=="string"?e:""+e).replace(ny,`
9
- `).replace(iy,"")}function I0(e,n){return n=z0(n),z0(e)===n}function Ge(e,n,a,o,u,f){switch(a){case"children":typeof o=="string"?n==="body"||n==="textarea"&&o===""||kn(e,o):(typeof o=="number"||typeof o=="bigint")&&n!=="body"&&kn(e,""+o);break;case"className":re(e,"class",o);break;case"tabIndex":re(e,"tabindex",o);break;case"dir":case"role":case"viewBox":case"width":case"height":re(e,a,o);break;case"style":la(e,o,f);break;case"data":if(n!=="object"){re(e,"data",o);break}case"src":case"href":if(o===""&&(n!=="a"||a!=="href")){e.removeAttribute(a);break}if(o==null||typeof o=="function"||typeof o=="symbol"||typeof o=="boolean"){e.removeAttribute(a);break}o=El(""+o),e.setAttribute(a,o);break;case"action":case"formAction":if(typeof o=="function"){e.setAttribute(a,"javascript:throw new Error('A React form was unexpectedly submitted. If you called form.submit() manually, consider using form.requestSubmit() instead. If you\\'re trying to use event.stopPropagation() in a submit event handler, consider also calling event.preventDefault().')");break}else typeof f=="function"&&(a==="formAction"?(n!=="input"&&Ge(e,n,"name",u.name,u,null),Ge(e,n,"formEncType",u.formEncType,u,null),Ge(e,n,"formMethod",u.formMethod,u,null),Ge(e,n,"formTarget",u.formTarget,u,null)):(Ge(e,n,"encType",u.encType,u,null),Ge(e,n,"method",u.method,u,null),Ge(e,n,"target",u.target,u,null)));if(o==null||typeof o=="symbol"||typeof o=="boolean"){e.removeAttribute(a);break}o=El(""+o),e.setAttribute(a,o);break;case"onClick":o!=null&&(e.onclick=ca);break;case"onScroll":o!=null&&xe("scroll",e);break;case"onScrollEnd":o!=null&&xe("scrollend",e);break;case"dangerouslySetInnerHTML":if(o!=null){if(typeof o!="object"||!("__html"in o))throw Error(s(61));if(a=o.__html,a!=null){if(u.children!=null)throw Error(s(60));e.innerHTML=a}}break;case"multiple":e.multiple=o&&typeof o!="function"&&typeof o!="symbol";break;case"muted":e.muted=o&&typeof o!="function"&&typeof o!="symbol";break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"defaultValue":case"defaultChecked":case"innerHTML":case"ref":break;case"autoFocus":break;case"xlinkHref":if(o==null||typeof o=="function"||typeof o=="boolean"||typeof o=="symbol"){e.removeAttribute("xlink:href");break}a=El(""+o),e.setAttributeNS("http://www.w3.org/1999/xlink","xlink:href",a);break;case"contentEditable":case"spellCheck":case"draggable":case"value":case"autoReverse":case"externalResourcesRequired":case"focusable":case"preserveAlpha":o!=null&&typeof o!="function"&&typeof o!="symbol"?e.setAttribute(a,""+o):e.removeAttribute(a);break;case"inert":case"allowFullScreen":case"async":case"autoPlay":case"controls":case"default":case"defer":case"disabled":case"disablePictureInPicture":case"disableRemotePlayback":case"formNoValidate":case"hidden":case"loop":case"noModule":case"noValidate":case"open":case"playsInline":case"readOnly":case"required":case"reversed":case"scoped":case"seamless":case"itemScope":o&&typeof o!="function"&&typeof o!="symbol"?e.setAttribute(a,""):e.removeAttribute(a);break;case"capture":case"download":o===!0?e.setAttribute(a,""):o!==!1&&o!=null&&typeof o!="function"&&typeof o!="symbol"?e.setAttribute(a,o):e.removeAttribute(a);break;case"cols":case"rows":case"size":case"span":o!=null&&typeof o!="function"&&typeof o!="symbol"&&!isNaN(o)&&1<=o?e.setAttribute(a,o):e.removeAttribute(a);break;case"rowSpan":case"start":o==null||typeof o=="function"||typeof o=="symbol"||isNaN(o)?e.removeAttribute(a):e.setAttribute(a,o);break;case"popover":xe("beforetoggle",e),xe("toggle",e),ne(e,"popover",o);break;case"xlinkActuate":Gt(e,"http://www.w3.org/1999/xlink","xlink:actuate",o);break;case"xlinkArcrole":Gt(e,"http://www.w3.org/1999/xlink","xlink:arcrole",o);break;case"xlinkRole":Gt(e,"http://www.w3.org/1999/xlink","xlink:role",o);break;case"xlinkShow":Gt(e,"http://www.w3.org/1999/xlink","xlink:show",o);break;case"xlinkTitle":Gt(e,"http://www.w3.org/1999/xlink","xlink:title",o);break;case"xlinkType":Gt(e,"http://www.w3.org/1999/xlink","xlink:type",o);break;case"xmlBase":Gt(e,"http://www.w3.org/XML/1998/namespace","xml:base",o);break;case"xmlLang":Gt(e,"http://www.w3.org/XML/1998/namespace","xml:lang",o);break;case"xmlSpace":Gt(e,"http://www.w3.org/XML/1998/namespace","xml:space",o);break;case"is":ne(e,"is",o);break;case"innerText":case"textContent":break;default:(!(2<a.length)||a[0]!=="o"&&a[0]!=="O"||a[1]!=="n"&&a[1]!=="N")&&(a=Ux.get(a)||a,ne(e,a,o))}}function ph(e,n,a,o,u,f){switch(a){case"style":la(e,o,f);break;case"dangerouslySetInnerHTML":if(o!=null){if(typeof o!="object"||!("__html"in o))throw Error(s(61));if(a=o.__html,a!=null){if(u.children!=null)throw Error(s(60));e.innerHTML=a}}break;case"children":typeof o=="string"?kn(e,o):(typeof o=="number"||typeof o=="bigint")&&kn(e,""+o);break;case"onScroll":o!=null&&xe("scroll",e);break;case"onScrollEnd":o!=null&&xe("scrollend",e);break;case"onClick":o!=null&&(e.onclick=ca);break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"innerHTML":case"ref":break;case"innerText":case"textContent":break;default:if(!ot.hasOwnProperty(a))t:{if(a[0]==="o"&&a[1]==="n"&&(u=a.endsWith("Capture"),n=a.slice(2,u?a.length-7:void 0),f=e[mn]||null,f=f!=null?f[a]:null,typeof f=="function"&&e.removeEventListener(n,f,u),typeof o=="function")){typeof f!="function"&&f!==null&&(a in e?e[a]=null:e.hasAttribute(a)&&e.removeAttribute(a)),e.addEventListener(n,o,u);break t}a in e?e[a]=o:o===!0?e.setAttribute(a,""):ne(e,a,o)}}}function wn(e,n,a){switch(n){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"img":xe("error",e),xe("load",e);var o=!1,u=!1,f;for(f in a)if(a.hasOwnProperty(f)){var S=a[f];if(S!=null)switch(f){case"src":o=!0;break;case"srcSet":u=!0;break;case"children":case"dangerouslySetInnerHTML":throw Error(s(137,n));default:Ge(e,n,f,S,a,null)}}u&&Ge(e,n,"srcSet",a.srcSet,a,null),o&&Ge(e,n,"src",a.src,a,null);return;case"input":xe("invalid",e);var R=f=S=u=null,G=null,st=null;for(o in a)if(a.hasOwnProperty(o)){var gt=a[o];if(gt!=null)switch(o){case"name":u=gt;break;case"type":S=gt;break;case"checked":G=gt;break;case"defaultChecked":st=gt;break;case"value":f=gt;break;case"defaultValue":R=gt;break;case"children":case"dangerouslySetInnerHTML":if(gt!=null)throw Error(s(137,n));break;default:Ge(e,n,o,gt,a,null)}}ai(e,f,R,G,st,S,u,!1);return;case"select":xe("invalid",e),o=S=f=null;for(u in a)if(a.hasOwnProperty(u)&&(R=a[u],R!=null))switch(u){case"value":f=R;break;case"defaultValue":S=R;break;case"multiple":o=R;default:Ge(e,n,u,R,a,null)}n=f,a=S,e.multiple=!!o,n!=null?si(e,!!o,n,!1):a!=null&&si(e,!!o,a,!0);return;case"textarea":xe("invalid",e),f=u=o=null;for(S in a)if(a.hasOwnProperty(S)&&(R=a[S],R!=null))switch(S){case"value":o=R;break;case"defaultValue":u=R;break;case"children":f=R;break;case"dangerouslySetInnerHTML":if(R!=null)throw Error(s(91));break;default:Ge(e,n,S,R,a,null)}on(e,o,u,f);return;case"option":for(G in a)a.hasOwnProperty(G)&&(o=a[G],o!=null)&&(G==="selected"?e.selected=o&&typeof o!="function"&&typeof o!="symbol":Ge(e,n,G,o,a,null));return;case"dialog":xe("beforetoggle",e),xe("toggle",e),xe("cancel",e),xe("close",e);break;case"iframe":case"object":xe("load",e);break;case"video":case"audio":for(o=0;o<Xo.length;o++)xe(Xo[o],e);break;case"image":xe("error",e),xe("load",e);break;case"details":xe("toggle",e);break;case"embed":case"source":case"link":xe("error",e),xe("load",e);case"area":case"base":case"br":case"col":case"hr":case"keygen":case"meta":case"param":case"track":case"wbr":case"menuitem":for(st in a)if(a.hasOwnProperty(st)&&(o=a[st],o!=null))switch(st){case"children":case"dangerouslySetInnerHTML":throw Error(s(137,n));default:Ge(e,n,st,o,a,null)}return;default:if(ir(n)){for(gt in a)a.hasOwnProperty(gt)&&(o=a[gt],o!==void 0&&ph(e,n,gt,o,a,void 0));return}}for(R in a)a.hasOwnProperty(R)&&(o=a[R],o!=null&&Ge(e,n,R,o,a,null))}function ay(e,n,a,o){switch(n){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"input":var u=null,f=null,S=null,R=null,G=null,st=null,gt=null;for(ht in a){var St=a[ht];if(a.hasOwnProperty(ht)&&St!=null)switch(ht){case"checked":break;case"value":break;case"defaultValue":G=St;default:o.hasOwnProperty(ht)||Ge(e,n,ht,null,o,St)}}for(var ct in o){var ht=o[ct];if(St=a[ct],o.hasOwnProperty(ct)&&(ht!=null||St!=null))switch(ct){case"type":f=ht;break;case"name":u=ht;break;case"checked":st=ht;break;case"defaultChecked":gt=ht;break;case"value":S=ht;break;case"defaultValue":R=ht;break;case"children":case"dangerouslySetInnerHTML":if(ht!=null)throw Error(s(137,n));break;default:ht!==St&&Ge(e,n,ct,ht,o,St)}}Vn(e,S,R,G,st,gt,f,u);return;case"select":ht=S=R=ct=null;for(f in a)if(G=a[f],a.hasOwnProperty(f)&&G!=null)switch(f){case"value":break;case"multiple":ht=G;default:o.hasOwnProperty(f)||Ge(e,n,f,null,o,G)}for(u in o)if(f=o[u],G=a[u],o.hasOwnProperty(u)&&(f!=null||G!=null))switch(u){case"value":ct=f;break;case"defaultValue":R=f;break;case"multiple":S=f;default:f!==G&&Ge(e,n,u,f,o,G)}n=R,a=S,o=ht,ct!=null?si(e,!!a,ct,!1):!!o!=!!a&&(n!=null?si(e,!!a,n,!0):si(e,!!a,a?[]:"",!1));return;case"textarea":ht=ct=null;for(R in a)if(u=a[R],a.hasOwnProperty(R)&&u!=null&&!o.hasOwnProperty(R))switch(R){case"value":break;case"children":break;default:Ge(e,n,R,null,o,u)}for(S in o)if(u=o[S],f=a[S],o.hasOwnProperty(S)&&(u!=null||f!=null))switch(S){case"value":ct=u;break;case"defaultValue":ht=u;break;case"children":break;case"dangerouslySetInnerHTML":if(u!=null)throw Error(s(91));break;default:u!==f&&Ge(e,n,S,u,o,f)}Oe(e,ct,ht);return;case"option":for(var Vt in a)ct=a[Vt],a.hasOwnProperty(Vt)&&ct!=null&&!o.hasOwnProperty(Vt)&&(Vt==="selected"?e.selected=!1:Ge(e,n,Vt,null,o,ct));for(G in o)ct=o[G],ht=a[G],o.hasOwnProperty(G)&&ct!==ht&&(ct!=null||ht!=null)&&(G==="selected"?e.selected=ct&&typeof ct!="function"&&typeof ct!="symbol":Ge(e,n,G,ct,o,ht));return;case"img":case"link":case"area":case"base":case"br":case"col":case"embed":case"hr":case"keygen":case"meta":case"param":case"source":case"track":case"wbr":case"menuitem":for(var $t in a)ct=a[$t],a.hasOwnProperty($t)&&ct!=null&&!o.hasOwnProperty($t)&&Ge(e,n,$t,null,o,ct);for(st in o)if(ct=o[st],ht=a[st],o.hasOwnProperty(st)&&ct!==ht&&(ct!=null||ht!=null))switch(st){case"children":case"dangerouslySetInnerHTML":if(ct!=null)throw Error(s(137,n));break;default:Ge(e,n,st,ct,o,ht)}return;default:if(ir(n)){for(var Ve in a)ct=a[Ve],a.hasOwnProperty(Ve)&&ct!==void 0&&!o.hasOwnProperty(Ve)&&ph(e,n,Ve,void 0,o,ct);for(gt in o)ct=o[gt],ht=a[gt],!o.hasOwnProperty(gt)||ct===ht||ct===void 0&&ht===void 0||ph(e,n,gt,ct,o,ht);return}}for(var tt in a)ct=a[tt],a.hasOwnProperty(tt)&&ct!=null&&!o.hasOwnProperty(tt)&&Ge(e,n,tt,null,o,ct);for(St in o)ct=o[St],ht=a[St],!o.hasOwnProperty(St)||ct===ht||ct==null&&ht==null||Ge(e,n,St,ct,o,ht)}function F0(e){switch(e){case"css":case"script":case"font":case"img":case"image":case"input":case"link":return!0;default:return!1}}function sy(){if(typeof performance.getEntriesByType=="function"){for(var e=0,n=0,a=performance.getEntriesByType("resource"),o=0;o<a.length;o++){var u=a[o],f=u.transferSize,S=u.initiatorType,R=u.duration;if(f&&R&&F0(S)){for(S=0,R=u.responseEnd,o+=1;o<a.length;o++){var G=a[o],st=G.startTime;if(st>R)break;var gt=G.transferSize,St=G.initiatorType;gt&&F0(St)&&(G=G.responseEnd,S+=gt*(G<R?1:(R-st)/(G-st)))}if(--o,n+=8*(f+S)/(u.duration/1e3),e++,10<e)break}}if(0<e)return n/e/1e6}return navigator.connection&&(e=navigator.connection.downlink,typeof e=="number")?e:5}var mh=null,gh=null;function vc(e){return e.nodeType===9?e:e.ownerDocument}function B0(e){switch(e){case"http://www.w3.org/2000/svg":return 1;case"http://www.w3.org/1998/Math/MathML":return 2;default:return 0}}function H0(e,n){if(e===0)switch(n){case"svg":return 1;case"math":return 2;default:return 0}return e===1&&n==="foreignObject"?0:e}function _h(e,n){return e==="textarea"||e==="noscript"||typeof n.children=="string"||typeof n.children=="number"||typeof n.children=="bigint"||typeof n.dangerouslySetInnerHTML=="object"&&n.dangerouslySetInnerHTML!==null&&n.dangerouslySetInnerHTML.__html!=null}var vh=null;function ry(){var e=window.event;return e&&e.type==="popstate"?e===vh?!1:(vh=e,!0):(vh=null,!1)}var G0=typeof setTimeout=="function"?setTimeout:void 0,oy=typeof clearTimeout=="function"?clearTimeout:void 0,V0=typeof Promise=="function"?Promise:void 0,ly=typeof queueMicrotask=="function"?queueMicrotask:typeof V0<"u"?function(e){return V0.resolve(null).then(e).catch(cy)}:G0;function cy(e){setTimeout(function(){throw e})}function is(e){return e==="head"}function k0(e,n){var a=n,o=0;do{var u=a.nextSibling;if(e.removeChild(a),u&&u.nodeType===8)if(a=u.data,a==="/$"||a==="/&"){if(o===0){e.removeChild(u),Or(n);return}o--}else if(a==="$"||a==="$?"||a==="$~"||a==="$!"||a==="&")o++;else if(a==="html")qo(e.ownerDocument.documentElement);else if(a==="head"){a=e.ownerDocument.head,qo(a);for(var f=a.firstChild;f;){var S=f.nextSibling,R=f.nodeName;f[Ms]||R==="SCRIPT"||R==="STYLE"||R==="LINK"&&f.rel.toLowerCase()==="stylesheet"||a.removeChild(f),f=S}}else a==="body"&&qo(e.ownerDocument.body);a=u}while(a);Or(n)}function X0(e,n){var a=e;e=0;do{var o=a.nextSibling;if(a.nodeType===1?n?(a._stashedDisplay=a.style.display,a.style.display="none"):(a.style.display=a._stashedDisplay||"",a.getAttribute("style")===""&&a.removeAttribute("style")):a.nodeType===3&&(n?(a._stashedText=a.nodeValue,a.nodeValue=""):a.nodeValue=a._stashedText||""),o&&o.nodeType===8)if(a=o.data,a==="/$"){if(e===0)break;e--}else a!=="$"&&a!=="$?"&&a!=="$~"&&a!=="$!"||e++;a=o}while(a)}function xh(e){var n=e.firstChild;for(n&&n.nodeType===10&&(n=n.nextSibling);n;){var a=n;switch(n=n.nextSibling,a.nodeName){case"HTML":case"HEAD":case"BODY":xh(a),uo(a);continue;case"SCRIPT":case"STYLE":continue;case"LINK":if(a.rel.toLowerCase()==="stylesheet")continue}e.removeChild(a)}}function uy(e,n,a,o){for(;e.nodeType===1;){var u=a;if(e.nodeName.toLowerCase()!==n.toLowerCase()){if(!o&&(e.nodeName!=="INPUT"||e.type!=="hidden"))break}else if(o){if(!e[Ms])switch(n){case"meta":if(!e.hasAttribute("itemprop"))break;return e;case"link":if(f=e.getAttribute("rel"),f==="stylesheet"&&e.hasAttribute("data-precedence"))break;if(f!==u.rel||e.getAttribute("href")!==(u.href==null||u.href===""?null:u.href)||e.getAttribute("crossorigin")!==(u.crossOrigin==null?null:u.crossOrigin)||e.getAttribute("title")!==(u.title==null?null:u.title))break;return e;case"style":if(e.hasAttribute("data-precedence"))break;return e;case"script":if(f=e.getAttribute("src"),(f!==(u.src==null?null:u.src)||e.getAttribute("type")!==(u.type==null?null:u.type)||e.getAttribute("crossorigin")!==(u.crossOrigin==null?null:u.crossOrigin))&&f&&e.hasAttribute("async")&&!e.hasAttribute("itemprop"))break;return e;default:return e}}else if(n==="input"&&e.type==="hidden"){var f=u.name==null?null:""+u.name;if(u.type==="hidden"&&e.getAttribute("name")===f)return e}else return e;if(e=bi(e.nextSibling),e===null)break}return null}function fy(e,n,a){if(n==="")return null;for(;e.nodeType!==3;)if((e.nodeType!==1||e.nodeName!=="INPUT"||e.type!=="hidden")&&!a||(e=bi(e.nextSibling),e===null))return null;return e}function W0(e,n){for(;e.nodeType!==8;)if((e.nodeType!==1||e.nodeName!=="INPUT"||e.type!=="hidden")&&!n||(e=bi(e.nextSibling),e===null))return null;return e}function Sh(e){return e.data==="$?"||e.data==="$~"}function yh(e){return e.data==="$!"||e.data==="$?"&&e.ownerDocument.readyState!=="loading"}function hy(e,n){var a=e.ownerDocument;if(e.data==="$~")e._reactRetry=n;else if(e.data!=="$?"||a.readyState!=="loading")n();else{var o=function(){n(),a.removeEventListener("DOMContentLoaded",o)};a.addEventListener("DOMContentLoaded",o),e._reactRetry=o}}function bi(e){for(;e!=null;e=e.nextSibling){var n=e.nodeType;if(n===1||n===3)break;if(n===8){if(n=e.data,n==="$"||n==="$!"||n==="$?"||n==="$~"||n==="&"||n==="F!"||n==="F")break;if(n==="/$"||n==="/&")return null}}return e}var Mh=null;function q0(e){e=e.nextSibling;for(var n=0;e;){if(e.nodeType===8){var a=e.data;if(a==="/$"||a==="/&"){if(n===0)return bi(e.nextSibling);n--}else a!=="$"&&a!=="$!"&&a!=="$?"&&a!=="$~"&&a!=="&"||n++}e=e.nextSibling}return null}function Y0(e){e=e.previousSibling;for(var n=0;e;){if(e.nodeType===8){var a=e.data;if(a==="$"||a==="$!"||a==="$?"||a==="$~"||a==="&"){if(n===0)return e;n--}else a!=="/$"&&a!=="/&"||n++}e=e.previousSibling}return null}function j0(e,n,a){switch(n=vc(a),e){case"html":if(e=n.documentElement,!e)throw Error(s(452));return e;case"head":if(e=n.head,!e)throw Error(s(453));return e;case"body":if(e=n.body,!e)throw Error(s(454));return e;default:throw Error(s(451))}}function qo(e){for(var n=e.attributes;n.length;)e.removeAttributeNode(n[0]);uo(e)}var Ti=new Map,Z0=new Set;function xc(e){return typeof e.getRootNode=="function"?e.getRootNode():e.nodeType===9?e:e.ownerDocument}var Ta=B.d;B.d={f:dy,r:py,D:my,C:gy,L:_y,m:vy,X:Sy,S:xy,M:yy};function dy(){var e=Ta.f(),n=uc();return e||n}function py(e){var n=Ba(e);n!==null&&n.tag===5&&n.type==="form"?hg(n):Ta.r(e)}var Ur=typeof document>"u"?null:document;function K0(e,n,a){var o=Ur;if(o&&typeof n=="string"&&n){var u=se(n);u='link[rel="'+e+'"][href="'+u+'"]',typeof a=="string"&&(u+='[crossorigin="'+a+'"]'),Z0.has(u)||(Z0.add(u),e={rel:e,crossOrigin:a,href:n},o.querySelector(u)===null&&(n=o.createElement("link"),wn(n,"link",e),q(n),o.head.appendChild(n)))}}function my(e){Ta.D(e),K0("dns-prefetch",e,null)}function gy(e,n){Ta.C(e,n),K0("preconnect",e,n)}function _y(e,n,a){Ta.L(e,n,a);var o=Ur;if(o&&e&&n){var u='link[rel="preload"][as="'+se(n)+'"]';n==="image"&&a&&a.imageSrcSet?(u+='[imagesrcset="'+se(a.imageSrcSet)+'"]',typeof a.imageSizes=="string"&&(u+='[imagesizes="'+se(a.imageSizes)+'"]')):u+='[href="'+se(e)+'"]';var f=u;switch(n){case"style":f=Lr(e);break;case"script":f=Nr(e)}Ti.has(f)||(e=g({rel:"preload",href:n==="image"&&a&&a.imageSrcSet?void 0:e,as:n},a),Ti.set(f,e),o.querySelector(u)!==null||n==="style"&&o.querySelector(Yo(f))||n==="script"&&o.querySelector(jo(f))||(n=o.createElement("link"),wn(n,"link",e),q(n),o.head.appendChild(n)))}}function vy(e,n){Ta.m(e,n);var a=Ur;if(a&&e){var o=n&&typeof n.as=="string"?n.as:"script",u='link[rel="modulepreload"][as="'+se(o)+'"][href="'+se(e)+'"]',f=u;switch(o){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":f=Nr(e)}if(!Ti.has(f)&&(e=g({rel:"modulepreload",href:e},n),Ti.set(f,e),a.querySelector(u)===null)){switch(o){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(a.querySelector(jo(f)))return}o=a.createElement("link"),wn(o,"link",e),q(o),a.head.appendChild(o)}}}function xy(e,n,a){Ta.S(e,n,a);var o=Ur;if(o&&e){var u=C(o).hoistableStyles,f=Lr(e);n=n||"default";var S=u.get(f);if(!S){var R={loading:0,preload:null};if(S=o.querySelector(Yo(f)))R.loading=5;else{e=g({rel:"stylesheet",href:e,"data-precedence":n},a),(a=Ti.get(f))&&Eh(e,a);var G=S=o.createElement("link");q(G),wn(G,"link",e),G._p=new Promise(function(st,gt){G.onload=st,G.onerror=gt}),G.addEventListener("load",function(){R.loading|=1}),G.addEventListener("error",function(){R.loading|=2}),R.loading|=4,Sc(S,n,o)}S={type:"stylesheet",instance:S,count:1,state:R},u.set(f,S)}}}function Sy(e,n){Ta.X(e,n);var a=Ur;if(a&&e){var o=C(a).hoistableScripts,u=Nr(e),f=o.get(u);f||(f=a.querySelector(jo(u)),f||(e=g({src:e,async:!0},n),(n=Ti.get(u))&&bh(e,n),f=a.createElement("script"),q(f),wn(f,"link",e),a.head.appendChild(f)),f={type:"script",instance:f,count:1,state:null},o.set(u,f))}}function yy(e,n){Ta.M(e,n);var a=Ur;if(a&&e){var o=C(a).hoistableScripts,u=Nr(e),f=o.get(u);f||(f=a.querySelector(jo(u)),f||(e=g({src:e,async:!0,type:"module"},n),(n=Ti.get(u))&&bh(e,n),f=a.createElement("script"),q(f),wn(f,"link",e),a.head.appendChild(f)),f={type:"script",instance:f,count:1,state:null},o.set(u,f))}}function Q0(e,n,a,o){var u=(u=Z.current)?xc(u):null;if(!u)throw Error(s(446));switch(e){case"meta":case"title":return null;case"style":return typeof a.precedence=="string"&&typeof a.href=="string"?(n=Lr(a.href),a=C(u).hoistableStyles,o=a.get(n),o||(o={type:"style",instance:null,count:0,state:null},a.set(n,o)),o):{type:"void",instance:null,count:0,state:null};case"link":if(a.rel==="stylesheet"&&typeof a.href=="string"&&typeof a.precedence=="string"){e=Lr(a.href);var f=C(u).hoistableStyles,S=f.get(e);if(S||(u=u.ownerDocument||u,S={type:"stylesheet",instance:null,count:0,state:{loading:0,preload:null}},f.set(e,S),(f=u.querySelector(Yo(e)))&&!f._p&&(S.instance=f,S.state.loading=5),Ti.has(e)||(a={rel:"preload",as:"style",href:a.href,crossOrigin:a.crossOrigin,integrity:a.integrity,media:a.media,hrefLang:a.hrefLang,referrerPolicy:a.referrerPolicy},Ti.set(e,a),f||My(u,e,a,S.state))),n&&o===null)throw Error(s(528,""));return S}if(n&&o!==null)throw Error(s(529,""));return null;case"script":return n=a.async,a=a.src,typeof a=="string"&&n&&typeof n!="function"&&typeof n!="symbol"?(n=Nr(a),a=C(u).hoistableScripts,o=a.get(n),o||(o={type:"script",instance:null,count:0,state:null},a.set(n,o)),o):{type:"void",instance:null,count:0,state:null};default:throw Error(s(444,e))}}function Lr(e){return'href="'+se(e)+'"'}function Yo(e){return'link[rel="stylesheet"]['+e+"]"}function J0(e){return g({},e,{"data-precedence":e.precedence,precedence:null})}function My(e,n,a,o){e.querySelector('link[rel="preload"][as="style"]['+n+"]")?o.loading=1:(n=e.createElement("link"),o.preload=n,n.addEventListener("load",function(){return o.loading|=1}),n.addEventListener("error",function(){return o.loading|=2}),wn(n,"link",a),q(n),e.head.appendChild(n))}function Nr(e){return'[src="'+se(e)+'"]'}function jo(e){return"script[async]"+e}function $0(e,n,a){if(n.count++,n.instance===null)switch(n.type){case"style":var o=e.querySelector('style[data-href~="'+se(a.href)+'"]');if(o)return n.instance=o,q(o),o;var u=g({},a,{"data-href":a.href,"data-precedence":a.precedence,href:null,precedence:null});return o=(e.ownerDocument||e).createElement("style"),q(o),wn(o,"style",u),Sc(o,a.precedence,e),n.instance=o;case"stylesheet":u=Lr(a.href);var f=e.querySelector(Yo(u));if(f)return n.state.loading|=4,n.instance=f,q(f),f;o=J0(a),(u=Ti.get(u))&&Eh(o,u),f=(e.ownerDocument||e).createElement("link"),q(f);var S=f;return S._p=new Promise(function(R,G){S.onload=R,S.onerror=G}),wn(f,"link",o),n.state.loading|=4,Sc(f,a.precedence,e),n.instance=f;case"script":return f=Nr(a.src),(u=e.querySelector(jo(f)))?(n.instance=u,q(u),u):(o=a,(u=Ti.get(f))&&(o=g({},a),bh(o,u)),e=e.ownerDocument||e,u=e.createElement("script"),q(u),wn(u,"link",o),e.head.appendChild(u),n.instance=u);case"void":return null;default:throw Error(s(443,n.type))}else n.type==="stylesheet"&&(n.state.loading&4)===0&&(o=n.instance,n.state.loading|=4,Sc(o,a.precedence,e));return n.instance}function Sc(e,n,a){for(var o=a.querySelectorAll('link[rel="stylesheet"][data-precedence],style[data-precedence]'),u=o.length?o[o.length-1]:null,f=u,S=0;S<o.length;S++){var R=o[S];if(R.dataset.precedence===n)f=R;else if(f!==u)break}f?f.parentNode.insertBefore(e,f.nextSibling):(n=a.nodeType===9?a.head:a,n.insertBefore(e,n.firstChild))}function Eh(e,n){e.crossOrigin==null&&(e.crossOrigin=n.crossOrigin),e.referrerPolicy==null&&(e.referrerPolicy=n.referrerPolicy),e.title==null&&(e.title=n.title)}function bh(e,n){e.crossOrigin==null&&(e.crossOrigin=n.crossOrigin),e.referrerPolicy==null&&(e.referrerPolicy=n.referrerPolicy),e.integrity==null&&(e.integrity=n.integrity)}var yc=null;function t_(e,n,a){if(yc===null){var o=new Map,u=yc=new Map;u.set(a,o)}else u=yc,o=u.get(a),o||(o=new Map,u.set(a,o));if(o.has(e))return o;for(o.set(e,null),a=a.getElementsByTagName(e),u=0;u<a.length;u++){var f=a[u];if(!(f[Ms]||f[rn]||e==="link"&&f.getAttribute("rel")==="stylesheet")&&f.namespaceURI!=="http://www.w3.org/2000/svg"){var S=f.getAttribute(n)||"";S=e+S;var R=o.get(S);R?R.push(f):o.set(S,[f])}}return o}function e_(e,n,a){e=e.ownerDocument||e,e.head.insertBefore(a,n==="title"?e.querySelector("head > title"):null)}function Ey(e,n,a){if(a===1||n.itemProp!=null)return!1;switch(e){case"meta":case"title":return!0;case"style":if(typeof n.precedence!="string"||typeof n.href!="string"||n.href==="")break;return!0;case"link":if(typeof n.rel!="string"||typeof n.href!="string"||n.href===""||n.onLoad||n.onError)break;return n.rel==="stylesheet"?(e=n.disabled,typeof n.precedence=="string"&&e==null):!0;case"script":if(n.async&&typeof n.async!="function"&&typeof n.async!="symbol"&&!n.onLoad&&!n.onError&&n.src&&typeof n.src=="string")return!0}return!1}function n_(e){return!(e.type==="stylesheet"&&(e.state.loading&3)===0)}function by(e,n,a,o){if(a.type==="stylesheet"&&(typeof o.media!="string"||matchMedia(o.media).matches!==!1)&&(a.state.loading&4)===0){if(a.instance===null){var u=Lr(o.href),f=n.querySelector(Yo(u));if(f){n=f._p,n!==null&&typeof n=="object"&&typeof n.then=="function"&&(e.count++,e=Mc.bind(e),n.then(e,e)),a.state.loading|=4,a.instance=f,q(f);return}f=n.ownerDocument||n,o=J0(o),(u=Ti.get(u))&&Eh(o,u),f=f.createElement("link"),q(f);var S=f;S._p=new Promise(function(R,G){S.onload=R,S.onerror=G}),wn(f,"link",o),a.instance=f}e.stylesheets===null&&(e.stylesheets=new Map),e.stylesheets.set(a,n),(n=a.state.preload)&&(a.state.loading&3)===0&&(e.count++,a=Mc.bind(e),n.addEventListener("load",a),n.addEventListener("error",a))}}var Th=0;function Ty(e,n){return e.stylesheets&&e.count===0&&bc(e,e.stylesheets),0<e.count||0<e.imgCount?function(a){var o=setTimeout(function(){if(e.stylesheets&&bc(e,e.stylesheets),e.unsuspend){var f=e.unsuspend;e.unsuspend=null,f()}},6e4+n);0<e.imgBytes&&Th===0&&(Th=62500*sy());var u=setTimeout(function(){if(e.waitingForImages=!1,e.count===0&&(e.stylesheets&&bc(e,e.stylesheets),e.unsuspend)){var f=e.unsuspend;e.unsuspend=null,f()}},(e.imgBytes>Th?50:800)+n);return e.unsuspend=a,function(){e.unsuspend=null,clearTimeout(o),clearTimeout(u)}}:null}function Mc(){if(this.count--,this.count===0&&(this.imgCount===0||!this.waitingForImages)){if(this.stylesheets)bc(this,this.stylesheets);else if(this.unsuspend){var e=this.unsuspend;this.unsuspend=null,e()}}}var Ec=null;function bc(e,n){e.stylesheets=null,e.unsuspend!==null&&(e.count++,Ec=new Map,n.forEach(Ay,e),Ec=null,Mc.call(e))}function Ay(e,n){if(!(n.state.loading&4)){var a=Ec.get(e);if(a)var o=a.get(null);else{a=new Map,Ec.set(e,a);for(var u=e.querySelectorAll("link[data-precedence],style[data-precedence]"),f=0;f<u.length;f++){var S=u[f];(S.nodeName==="LINK"||S.getAttribute("media")!=="not all")&&(a.set(S.dataset.precedence,S),o=S)}o&&a.set(null,o)}u=n.instance,S=u.getAttribute("data-precedence"),f=a.get(S)||o,f===o&&a.set(null,u),a.set(S,u),this.count++,o=Mc.bind(this),u.addEventListener("load",o),u.addEventListener("error",o),f?f.parentNode.insertBefore(u,f.nextSibling):(e=e.nodeType===9?e.head:e,e.insertBefore(u,e.firstChild)),n.state.loading|=4}}var Zo={$$typeof:D,Provider:null,Consumer:null,_currentValue:at,_currentValue2:at,_threadCount:0};function Ry(e,n,a,o,u,f,S,R,G){this.tag=1,this.containerInfo=e,this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.next=this.pendingContext=this.context=this.cancelPendingCommit=null,this.callbackPriority=0,this.expirationTimes=Ae(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=Ae(0),this.hiddenUpdates=Ae(null),this.identifierPrefix=o,this.onUncaughtError=u,this.onCaughtError=f,this.onRecoverableError=S,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=G,this.incompleteTransitions=new Map}function i_(e,n,a,o,u,f,S,R,G,st,gt,St){return e=new Ry(e,n,a,S,G,st,gt,St,R),n=1,f===!0&&(n|=24),f=oi(3,null,null,n),e.current=f,f.stateNode=e,n=af(),n.refCount++,e.pooledCache=n,n.refCount++,f.memoizedState={element:o,isDehydrated:a,cache:n},lf(f),e}function a_(e){return e?(e=ur,e):ur}function s_(e,n,a,o,u,f){u=a_(u),o.context===null?o.context=u:o.pendingContext=u,o=qa(n),o.payload={element:a},f=f===void 0?null:f,f!==null&&(o.callback=f),a=Ya(e,o,n),a!==null&&(ti(a,e,n),Ro(a,e,n))}function r_(e,n){if(e=e.memoizedState,e!==null&&e.dehydrated!==null){var a=e.retryLane;e.retryLane=a!==0&&a<n?a:n}}function Ah(e,n){r_(e,n),(e=e.alternate)&&r_(e,n)}function o_(e){if(e.tag===13||e.tag===31){var n=Rs(e,67108864);n!==null&&ti(n,e,67108864),Ah(e,67108864)}}function l_(e){if(e.tag===13||e.tag===31){var n=hi();n=tr(n);var a=Rs(e,n);a!==null&&ti(a,e,n),Ah(e,n)}}var Tc=!0;function Cy(e,n,a,o){var u=O.T;O.T=null;var f=B.p;try{B.p=2,Rh(e,n,a,o)}finally{B.p=f,O.T=u}}function wy(e,n,a,o){var u=O.T;O.T=null;var f=B.p;try{B.p=8,Rh(e,n,a,o)}finally{B.p=f,O.T=u}}function Rh(e,n,a,o){if(Tc){var u=Ch(o);if(u===null)dh(e,n,o,Ac,a),u_(e,o);else if(Uy(u,e,n,a,o))o.stopPropagation();else if(u_(e,o),n&4&&-1<Dy.indexOf(e)){for(;u!==null;){var f=Ba(u);if(f!==null)switch(f.tag){case 3:if(f=f.stateNode,f.current.memoizedState.isDehydrated){var S=bt(f.pendingLanes);if(S!==0){var R=f;for(R.pendingLanes|=2,R.entangledLanes|=2;S;){var G=1<<31-Ot(S);R.entanglements[1]|=G,S&=~G}Zi(f),(Le&6)===0&&(lc=b()+500,ko(0))}}break;case 31:case 13:R=Rs(f,2),R!==null&&ti(R,f,2),uc(),Ah(f,2)}if(f=Ch(o),f===null&&dh(e,n,o,Ac,a),f===u)break;u=f}u!==null&&o.stopPropagation()}else dh(e,n,o,null,a)}}function Ch(e){return e=wu(e),wh(e)}var Ac=null;function wh(e){if(Ac=null,e=Fa(e),e!==null){var n=c(e);if(n===null)e=null;else{var a=n.tag;if(a===13){if(e=h(n),e!==null)return e;e=null}else if(a===31){if(e=d(n),e!==null)return e;e=null}else if(a===3){if(n.stateNode.current.memoizedState.isDehydrated)return n.tag===3?n.stateNode.containerInfo:null;e=null}else n!==e&&(e=null)}}return Ac=e,null}function c_(e){switch(e){case"beforetoggle":case"cancel":case"click":case"close":case"contextmenu":case"copy":case"cut":case"auxclick":case"dblclick":case"dragend":case"dragstart":case"drop":case"focusin":case"focusout":case"input":case"invalid":case"keydown":case"keypress":case"keyup":case"mousedown":case"mouseup":case"paste":case"pause":case"play":case"pointercancel":case"pointerdown":case"pointerup":case"ratechange":case"reset":case"resize":case"seeked":case"submit":case"toggle":case"touchcancel":case"touchend":case"touchstart":case"volumechange":case"change":case"selectionchange":case"textInput":case"compositionstart":case"compositionend":case"compositionupdate":case"beforeblur":case"afterblur":case"beforeinput":case"blur":case"fullscreenchange":case"focus":case"hashchange":case"popstate":case"select":case"selectstart":return 2;case"drag":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"mousemove":case"mouseout":case"mouseover":case"pointermove":case"pointerout":case"pointerover":case"scroll":case"touchmove":case"wheel":case"mouseenter":case"mouseleave":case"pointerenter":case"pointerleave":return 8;case"message":switch(K()){case _t:return 2;case Mt:return 8;case mt:case Wt:return 32;case wt:return 268435456;default:return 32}default:return 32}}var Dh=!1,as=null,ss=null,rs=null,Ko=new Map,Qo=new Map,os=[],Dy="mousedown mouseup touchcancel touchend touchstart auxclick dblclick pointercancel pointerdown pointerup dragend dragstart drop compositionend compositionstart keydown keypress keyup input textInput copy cut paste click change contextmenu reset".split(" ");function u_(e,n){switch(e){case"focusin":case"focusout":as=null;break;case"dragenter":case"dragleave":ss=null;break;case"mouseover":case"mouseout":rs=null;break;case"pointerover":case"pointerout":Ko.delete(n.pointerId);break;case"gotpointercapture":case"lostpointercapture":Qo.delete(n.pointerId)}}function Jo(e,n,a,o,u,f){return e===null||e.nativeEvent!==f?(e={blockedOn:n,domEventName:a,eventSystemFlags:o,nativeEvent:f,targetContainers:[u]},n!==null&&(n=Ba(n),n!==null&&o_(n)),e):(e.eventSystemFlags|=o,n=e.targetContainers,u!==null&&n.indexOf(u)===-1&&n.push(u),e)}function Uy(e,n,a,o,u){switch(n){case"focusin":return as=Jo(as,e,n,a,o,u),!0;case"dragenter":return ss=Jo(ss,e,n,a,o,u),!0;case"mouseover":return rs=Jo(rs,e,n,a,o,u),!0;case"pointerover":var f=u.pointerId;return Ko.set(f,Jo(Ko.get(f)||null,e,n,a,o,u)),!0;case"gotpointercapture":return f=u.pointerId,Qo.set(f,Jo(Qo.get(f)||null,e,n,a,o,u)),!0}return!1}function f_(e){var n=Fa(e.target);if(n!==null){var a=c(n);if(a!==null){if(n=a.tag,n===13){if(n=h(a),n!==null){e.blockedOn=n,nr(e.priority,function(){l_(a)});return}}else if(n===31){if(n=d(a),n!==null){e.blockedOn=n,nr(e.priority,function(){l_(a)});return}}else if(n===3&&a.stateNode.current.memoizedState.isDehydrated){e.blockedOn=a.tag===3?a.stateNode.containerInfo:null;return}}}e.blockedOn=null}function Rc(e){if(e.blockedOn!==null)return!1;for(var n=e.targetContainers;0<n.length;){var a=Ch(e.nativeEvent);if(a===null){a=e.nativeEvent;var o=new a.constructor(a.type,a);Cu=o,a.target.dispatchEvent(o),Cu=null}else return n=Ba(a),n!==null&&o_(n),e.blockedOn=a,!1;n.shift()}return!0}function h_(e,n,a){Rc(e)&&a.delete(n)}function Ly(){Dh=!1,as!==null&&Rc(as)&&(as=null),ss!==null&&Rc(ss)&&(ss=null),rs!==null&&Rc(rs)&&(rs=null),Ko.forEach(h_),Qo.forEach(h_)}function Cc(e,n){e.blockedOn===n&&(e.blockedOn=null,Dh||(Dh=!0,r.unstable_scheduleCallback(r.unstable_NormalPriority,Ly)))}var wc=null;function d_(e){wc!==e&&(wc=e,r.unstable_scheduleCallback(r.unstable_NormalPriority,function(){wc===e&&(wc=null);for(var n=0;n<e.length;n+=3){var a=e[n],o=e[n+1],u=e[n+2];if(typeof o!="function"){if(wh(o||a)===null)continue;break}var f=Ba(a);f!==null&&(e.splice(n,3),n-=3,Cf(f,{pending:!0,data:u,method:a.method,action:o},o,u))}}))}function Or(e){function n(G){return Cc(G,e)}as!==null&&Cc(as,e),ss!==null&&Cc(ss,e),rs!==null&&Cc(rs,e),Ko.forEach(n),Qo.forEach(n);for(var a=0;a<os.length;a++){var o=os[a];o.blockedOn===e&&(o.blockedOn=null)}for(;0<os.length&&(a=os[0],a.blockedOn===null);)f_(a),a.blockedOn===null&&os.shift();if(a=(e.ownerDocument||e).$$reactFormReplay,a!=null)for(o=0;o<a.length;o+=3){var u=a[o],f=a[o+1],S=u[mn]||null;if(typeof f=="function")S||d_(a);else if(S){var R=null;if(f&&f.hasAttribute("formAction")){if(u=f,S=f[mn]||null)R=S.formAction;else if(wh(u)!==null)continue}else R=S.action;typeof R=="function"?a[o+1]=R:(a.splice(o,3),o-=3),d_(a)}}}function p_(){function e(f){f.canIntercept&&f.info==="react-transition"&&f.intercept({handler:function(){return new Promise(function(S){return u=S})},focusReset:"manual",scroll:"manual"})}function n(){u!==null&&(u(),u=null),o||setTimeout(a,20)}function a(){if(!o&&!navigation.transition){var f=navigation.currentEntry;f&&f.url!=null&&navigation.navigate(f.url,{state:f.getState(),info:"react-transition",history:"replace"})}}if(typeof navigation=="object"){var o=!1,u=null;return navigation.addEventListener("navigate",e),navigation.addEventListener("navigatesuccess",n),navigation.addEventListener("navigateerror",n),setTimeout(a,100),function(){o=!0,navigation.removeEventListener("navigate",e),navigation.removeEventListener("navigatesuccess",n),navigation.removeEventListener("navigateerror",n),u!==null&&(u(),u=null)}}}function Uh(e){this._internalRoot=e}Dc.prototype.render=Uh.prototype.render=function(e){var n=this._internalRoot;if(n===null)throw Error(s(409));var a=n.current,o=hi();s_(a,o,e,n,null,null)},Dc.prototype.unmount=Uh.prototype.unmount=function(){var e=this._internalRoot;if(e!==null){this._internalRoot=null;var n=e.containerInfo;s_(e.current,2,null,e,null,null),uc(),n[oa]=null}};function Dc(e){this._internalRoot=e}Dc.prototype.unstable_scheduleHydration=function(e){if(e){var n=Wi();e={blockedOn:null,target:e,priority:n};for(var a=0;a<os.length&&n!==0&&n<os[a].priority;a++);os.splice(a,0,e),a===0&&f_(e)}};var m_=t.version;if(m_!=="19.2.4")throw Error(s(527,m_,"19.2.4"));B.findDOMNode=function(e){var n=e._reactInternals;if(n===void 0)throw typeof e.render=="function"?Error(s(188)):(e=Object.keys(e).join(","),Error(s(268,e)));return e=p(n),e=e!==null?v(e):null,e=e===null?null:e.stateNode,e};var Ny={bundleType:0,version:"19.2.4",rendererPackageName:"react-dom",currentDispatcherRef:O,reconcilerVersion:"19.2.4"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var Uc=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!Uc.isDisabled&&Uc.supportsFiber)try{Tt=Uc.inject(Ny),Et=Uc}catch{}}return tl.createRoot=function(e,n){if(!l(e))throw Error(s(299));var a=!1,o="",u=Mg,f=Eg,S=bg;return n!=null&&(n.unstable_strictMode===!0&&(a=!0),n.identifierPrefix!==void 0&&(o=n.identifierPrefix),n.onUncaughtError!==void 0&&(u=n.onUncaughtError),n.onCaughtError!==void 0&&(f=n.onCaughtError),n.onRecoverableError!==void 0&&(S=n.onRecoverableError)),n=i_(e,1,!1,null,null,a,o,null,u,f,S,p_),e[oa]=n.current,hh(e),new Uh(n)},tl.hydrateRoot=function(e,n,a){if(!l(e))throw Error(s(299));var o=!1,u="",f=Mg,S=Eg,R=bg,G=null;return a!=null&&(a.unstable_strictMode===!0&&(o=!0),a.identifierPrefix!==void 0&&(u=a.identifierPrefix),a.onUncaughtError!==void 0&&(f=a.onUncaughtError),a.onCaughtError!==void 0&&(S=a.onCaughtError),a.onRecoverableError!==void 0&&(R=a.onRecoverableError),a.formState!==void 0&&(G=a.formState)),n=i_(e,1,!0,n,a??null,o,u,G,f,S,R,p_),n.context=a_(null),a=n.current,o=hi(),o=tr(o),u=qa(o),u.callback=null,Ya(a,u,o),a=o,n.current.lanes=a,Hn(n,a),Zi(n),e[oa]=n.current,hh(e),new Dc(n)},tl.version="19.2.4",tl}var T_;function ky(){if(T_)return Oh.exports;T_=1;function r(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(r)}catch(t){console.error(t)}}return r(),Oh.exports=Vy(),Oh.exports}var Xy=ky();const xp="183",Jr={ROTATE:0,DOLLY:1,PAN:2},Qr={ROTATE:0,PAN:1,DOLLY_PAN:2,DOLLY_ROTATE:3},Wy=0,A_=1,qy=2,uu=1,Yy=2,ll=3,xs=0,ii=1,Hi=2,La=0,$r=1,R_=2,C_=3,w_=4,jy=5,qs=100,Zy=101,Ky=102,Qy=103,Jy=104,$y=200,tM=201,eM=202,nM=203,Md=204,Ed=205,iM=206,aM=207,sM=208,rM=209,oM=210,lM=211,cM=212,uM=213,fM=214,bd=0,Td=1,Ad=2,eo=3,Rd=4,Cd=5,wd=6,Dd=7,Sp=0,hM=1,dM=2,ia=0,kv=1,Xv=2,Wv=3,qv=4,Yv=5,jv=6,Zv=7,Kv=300,Qs=301,no=302,Fh=303,Bh=304,Eu=306,Ud=1e3,Ua=1001,Ld=1002,Nn=1003,pM=1004,Lc=1005,Bn=1006,Hh=1007,js=1008,mi=1009,Qv=1010,Jv=1011,hl=1012,yp=1013,sa=1014,ea=1015,Pa=1016,Mp=1017,Ep=1018,dl=1020,$v=35902,tx=35899,ex=1021,nx=1022,ki=1023,za=1026,Zs=1027,ix=1028,bp=1029,io=1030,Tp=1031,Ap=1033,fu=33776,hu=33777,du=33778,pu=33779,Nd=35840,Od=35841,Pd=35842,zd=35843,Id=36196,Fd=37492,Bd=37496,Hd=37488,Gd=37489,Vd=37490,kd=37491,Xd=37808,Wd=37809,qd=37810,Yd=37811,jd=37812,Zd=37813,Kd=37814,Qd=37815,Jd=37816,$d=37817,tp=37818,ep=37819,np=37820,ip=37821,ap=36492,sp=36494,rp=36495,op=36283,lp=36284,cp=36285,up=36286,mM=3200,ax=0,gM=1,gs="",Ri="srgb",ao="srgb-linear",gu="linear",Fe="srgb",Pr=7680,D_=519,_M=512,vM=513,xM=514,Rp=515,SM=516,yM=517,Cp=518,MM=519,fp=35044,U_="300 es",na=2e3,pl=2001;function EM(r){for(let t=r.length-1;t>=0;--t)if(r[t]>=65535)return!0;return!1}function _u(r){return document.createElementNS("http://www.w3.org/1999/xhtml",r)}function bM(){const r=_u("canvas");return r.style.display="block",r}const L_={};function vu(...r){const t="THREE."+r.shift();console.log(t,...r)}function sx(r){const t=r[0];if(typeof t=="string"&&t.startsWith("TSL:")){const i=r[1];i&&i.isStackTrace?r[0]+=" "+i.getLocation():r[1]='Stack trace not available. Enable "THREE.Node.captureStackTrace" to capture stack traces.'}return r}function ee(...r){r=sx(r);const t="THREE."+r.shift();{const i=r[0];i&&i.isStackTrace?console.warn(i.getError(t)):console.warn(t,...r)}}function Ue(...r){r=sx(r);const t="THREE."+r.shift();{const i=r[0];i&&i.isStackTrace?console.error(i.getError(t)):console.error(t,...r)}}function xu(...r){const t=r.join(" ");t in L_||(L_[t]=!0,ee(...r))}function TM(r,t,i){return new Promise(function(s,l){function c(){switch(r.clientWaitSync(t,r.SYNC_FLUSH_COMMANDS_BIT,0)){case r.WAIT_FAILED:l();break;case r.TIMEOUT_EXPIRED:setTimeout(c,i);break;default:s()}}setTimeout(c,i)})}const AM={[bd]:Td,[Ad]:wd,[Rd]:Dd,[eo]:Cd,[Td]:bd,[wd]:Ad,[Dd]:Rd,[Cd]:eo};class Js{addEventListener(t,i){this._listeners===void 0&&(this._listeners={});const s=this._listeners;s[t]===void 0&&(s[t]=[]),s[t].indexOf(i)===-1&&s[t].push(i)}hasEventListener(t,i){const s=this._listeners;return s===void 0?!1:s[t]!==void 0&&s[t].indexOf(i)!==-1}removeEventListener(t,i){const s=this._listeners;if(s===void 0)return;const l=s[t];if(l!==void 0){const c=l.indexOf(i);c!==-1&&l.splice(c,1)}}dispatchEvent(t){const i=this._listeners;if(i===void 0)return;const s=i[t.type];if(s!==void 0){t.target=this;const l=s.slice(0);for(let c=0,h=l.length;c<h;c++)l[c].call(this,t);t.target=null}}}const In=["00","01","02","03","04","05","06","07","08","09","0a","0b","0c","0d","0e","0f","10","11","12","13","14","15","16","17","18","19","1a","1b","1c","1d","1e","1f","20","21","22","23","24","25","26","27","28","29","2a","2b","2c","2d","2e","2f","30","31","32","33","34","35","36","37","38","39","3a","3b","3c","3d","3e","3f","40","41","42","43","44","45","46","47","48","49","4a","4b","4c","4d","4e","4f","50","51","52","53","54","55","56","57","58","59","5a","5b","5c","5d","5e","5f","60","61","62","63","64","65","66","67","68","69","6a","6b","6c","6d","6e","6f","70","71","72","73","74","75","76","77","78","79","7a","7b","7c","7d","7e","7f","80","81","82","83","84","85","86","87","88","89","8a","8b","8c","8d","8e","8f","90","91","92","93","94","95","96","97","98","99","9a","9b","9c","9d","9e","9f","a0","a1","a2","a3","a4","a5","a6","a7","a8","a9","aa","ab","ac","ad","ae","af","b0","b1","b2","b3","b4","b5","b6","b7","b8","b9","ba","bb","bc","bd","be","bf","c0","c1","c2","c3","c4","c5","c6","c7","c8","c9","ca","cb","cc","cd","ce","cf","d0","d1","d2","d3","d4","d5","d6","d7","d8","d9","da","db","dc","dd","de","df","e0","e1","e2","e3","e4","e5","e6","e7","e8","e9","ea","eb","ec","ed","ee","ef","f0","f1","f2","f3","f4","f5","f6","f7","f8","f9","fa","fb","fc","fd","fe","ff"];let N_=1234567;const ul=Math.PI/180,ml=180/Math.PI;function Na(){const r=Math.random()*4294967295|0,t=Math.random()*4294967295|0,i=Math.random()*4294967295|0,s=Math.random()*4294967295|0;return(In[r&255]+In[r>>8&255]+In[r>>16&255]+In[r>>24&255]+"-"+In[t&255]+In[t>>8&255]+"-"+In[t>>16&15|64]+In[t>>24&255]+"-"+In[i&63|128]+In[i>>8&255]+"-"+In[i>>16&255]+In[i>>24&255]+In[s&255]+In[s>>8&255]+In[s>>16&255]+In[s>>24&255]).toLowerCase()}function ce(r,t,i){return Math.max(t,Math.min(i,r))}function wp(r,t){return(r%t+t)%t}function RM(r,t,i,s,l){return s+(r-t)*(l-s)/(i-t)}function CM(r,t,i){return r!==t?(i-r)/(t-r):0}function fl(r,t,i){return(1-i)*r+i*t}function wM(r,t,i,s){return fl(r,t,1-Math.exp(-i*s))}function DM(r,t=1){return t-Math.abs(wp(r,t*2)-t)}function UM(r,t,i){return r<=t?0:r>=i?1:(r=(r-t)/(i-t),r*r*(3-2*r))}function LM(r,t,i){return r<=t?0:r>=i?1:(r=(r-t)/(i-t),r*r*r*(r*(r*6-15)+10))}function NM(r,t){return r+Math.floor(Math.random()*(t-r+1))}function OM(r,t){return r+Math.random()*(t-r)}function PM(r){return r*(.5-Math.random())}function zM(r){r!==void 0&&(N_=r);let t=N_+=1831565813;return t=Math.imul(t^t>>>15,t|1),t^=t+Math.imul(t^t>>>7,t|61),((t^t>>>14)>>>0)/4294967296}function IM(r){return r*ul}function FM(r){return r*ml}function BM(r){return(r&r-1)===0&&r!==0}function HM(r){return Math.pow(2,Math.ceil(Math.log(r)/Math.LN2))}function GM(r){return Math.pow(2,Math.floor(Math.log(r)/Math.LN2))}function VM(r,t,i,s,l){const c=Math.cos,h=Math.sin,d=c(i/2),m=h(i/2),p=c((t+s)/2),v=h((t+s)/2),g=c((t-s)/2),_=h((t-s)/2),M=c((s-t)/2),E=h((s-t)/2);switch(l){case"XYX":r.set(d*v,m*g,m*_,d*p);break;case"YZY":r.set(m*_,d*v,m*g,d*p);break;case"ZXZ":r.set(m*g,m*_,d*v,d*p);break;case"XZX":r.set(d*v,m*E,m*M,d*p);break;case"YXY":r.set(m*M,d*v,m*E,d*p);break;case"ZYZ":r.set(m*E,m*M,d*v,d*p);break;default:ee("MathUtils: .setQuaternionFromProperEuler() encountered an unknown order: "+l)}}function Gi(r,t){switch(t.constructor){case Float32Array:return r;case Uint32Array:return r/4294967295;case Uint16Array:return r/65535;case Uint8Array:return r/255;case Int32Array:return Math.max(r/2147483647,-1);case Int16Array:return Math.max(r/32767,-1);case Int8Array:return Math.max(r/127,-1);default:throw new Error("Invalid component type.")}}function Be(r,t){switch(t.constructor){case Float32Array:return r;case Uint32Array:return Math.round(r*4294967295);case Uint16Array:return Math.round(r*65535);case Uint8Array:return Math.round(r*255);case Int32Array:return Math.round(r*2147483647);case Int16Array:return Math.round(r*32767);case Int8Array:return Math.round(r*127);default:throw new Error("Invalid component type.")}}const rx={DEG2RAD:ul,RAD2DEG:ml,generateUUID:Na,clamp:ce,euclideanModulo:wp,mapLinear:RM,inverseLerp:CM,lerp:fl,damp:wM,pingpong:DM,smoothstep:UM,smootherstep:LM,randInt:NM,randFloat:OM,randFloatSpread:PM,seededRandom:zM,degToRad:IM,radToDeg:FM,isPowerOfTwo:BM,ceilPowerOfTwo:HM,floorPowerOfTwo:GM,setQuaternionFromProperEuler:VM,normalize:Be,denormalize:Gi};class le{constructor(t=0,i=0){le.prototype.isVector2=!0,this.x=t,this.y=i}get width(){return this.x}set width(t){this.x=t}get height(){return this.y}set height(t){this.y=t}set(t,i){return this.x=t,this.y=i,this}setScalar(t){return this.x=t,this.y=t,this}setX(t){return this.x=t,this}setY(t){return this.y=t,this}setComponent(t,i){switch(t){case 0:this.x=i;break;case 1:this.y=i;break;default:throw new Error("index is out of range: "+t)}return this}getComponent(t){switch(t){case 0:return this.x;case 1:return this.y;default:throw new Error("index is out of range: "+t)}}clone(){return new this.constructor(this.x,this.y)}copy(t){return this.x=t.x,this.y=t.y,this}add(t){return this.x+=t.x,this.y+=t.y,this}addScalar(t){return this.x+=t,this.y+=t,this}addVectors(t,i){return this.x=t.x+i.x,this.y=t.y+i.y,this}addScaledVector(t,i){return this.x+=t.x*i,this.y+=t.y*i,this}sub(t){return this.x-=t.x,this.y-=t.y,this}subScalar(t){return this.x-=t,this.y-=t,this}subVectors(t,i){return this.x=t.x-i.x,this.y=t.y-i.y,this}multiply(t){return this.x*=t.x,this.y*=t.y,this}multiplyScalar(t){return this.x*=t,this.y*=t,this}divide(t){return this.x/=t.x,this.y/=t.y,this}divideScalar(t){return this.multiplyScalar(1/t)}applyMatrix3(t){const i=this.x,s=this.y,l=t.elements;return this.x=l[0]*i+l[3]*s+l[6],this.y=l[1]*i+l[4]*s+l[7],this}min(t){return this.x=Math.min(this.x,t.x),this.y=Math.min(this.y,t.y),this}max(t){return this.x=Math.max(this.x,t.x),this.y=Math.max(this.y,t.y),this}clamp(t,i){return this.x=ce(this.x,t.x,i.x),this.y=ce(this.y,t.y,i.y),this}clampScalar(t,i){return this.x=ce(this.x,t,i),this.y=ce(this.y,t,i),this}clampLength(t,i){const s=this.length();return this.divideScalar(s||1).multiplyScalar(ce(s,t,i))}floor(){return this.x=Math.floor(this.x),this.y=Math.floor(this.y),this}ceil(){return this.x=Math.ceil(this.x),this.y=Math.ceil(this.y),this}round(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this}roundToZero(){return this.x=Math.trunc(this.x),this.y=Math.trunc(this.y),this}negate(){return this.x=-this.x,this.y=-this.y,this}dot(t){return this.x*t.x+this.y*t.y}cross(t){return this.x*t.y-this.y*t.x}lengthSq(){return this.x*this.x+this.y*this.y}length(){return Math.sqrt(this.x*this.x+this.y*this.y)}manhattanLength(){return Math.abs(this.x)+Math.abs(this.y)}normalize(){return this.divideScalar(this.length()||1)}angle(){return Math.atan2(-this.y,-this.x)+Math.PI}angleTo(t){const i=Math.sqrt(this.lengthSq()*t.lengthSq());if(i===0)return Math.PI/2;const s=this.dot(t)/i;return Math.acos(ce(s,-1,1))}distanceTo(t){return Math.sqrt(this.distanceToSquared(t))}distanceToSquared(t){const i=this.x-t.x,s=this.y-t.y;return i*i+s*s}manhattanDistanceTo(t){return Math.abs(this.x-t.x)+Math.abs(this.y-t.y)}setLength(t){return this.normalize().multiplyScalar(t)}lerp(t,i){return this.x+=(t.x-this.x)*i,this.y+=(t.y-this.y)*i,this}lerpVectors(t,i,s){return this.x=t.x+(i.x-t.x)*s,this.y=t.y+(i.y-t.y)*s,this}equals(t){return t.x===this.x&&t.y===this.y}fromArray(t,i=0){return this.x=t[i],this.y=t[i+1],this}toArray(t=[],i=0){return t[i]=this.x,t[i+1]=this.y,t}fromBufferAttribute(t,i){return this.x=t.getX(i),this.y=t.getY(i),this}rotateAround(t,i){const s=Math.cos(i),l=Math.sin(i),c=this.x-t.x,h=this.y-t.y;return this.x=c*s-h*l+t.x,this.y=c*l+h*s+t.y,this}random(){return this.x=Math.random(),this.y=Math.random(),this}*[Symbol.iterator](){yield this.x,yield this.y}}class Ss{constructor(t=0,i=0,s=0,l=1){this.isQuaternion=!0,this._x=t,this._y=i,this._z=s,this._w=l}static slerpFlat(t,i,s,l,c,h,d){let m=s[l+0],p=s[l+1],v=s[l+2],g=s[l+3],_=c[h+0],M=c[h+1],E=c[h+2],A=c[h+3];if(g!==A||m!==_||p!==M||v!==E){let x=m*_+p*M+v*E+g*A;x<0&&(_=-_,M=-M,E=-E,A=-A,x=-x);let y=1-d;if(x<.9995){const w=Math.acos(x),D=Math.sin(w);y=Math.sin(y*w)/D,d=Math.sin(d*w)/D,m=m*y+_*d,p=p*y+M*d,v=v*y+E*d,g=g*y+A*d}else{m=m*y+_*d,p=p*y+M*d,v=v*y+E*d,g=g*y+A*d;const w=1/Math.sqrt(m*m+p*p+v*v+g*g);m*=w,p*=w,v*=w,g*=w}}t[i]=m,t[i+1]=p,t[i+2]=v,t[i+3]=g}static multiplyQuaternionsFlat(t,i,s,l,c,h){const d=s[l],m=s[l+1],p=s[l+2],v=s[l+3],g=c[h],_=c[h+1],M=c[h+2],E=c[h+3];return t[i]=d*E+v*g+m*M-p*_,t[i+1]=m*E+v*_+p*g-d*M,t[i+2]=p*E+v*M+d*_-m*g,t[i+3]=v*E-d*g-m*_-p*M,t}get x(){return this._x}set x(t){this._x=t,this._onChangeCallback()}get y(){return this._y}set y(t){this._y=t,this._onChangeCallback()}get z(){return this._z}set z(t){this._z=t,this._onChangeCallback()}get w(){return this._w}set w(t){this._w=t,this._onChangeCallback()}set(t,i,s,l){return this._x=t,this._y=i,this._z=s,this._w=l,this._onChangeCallback(),this}clone(){return new this.constructor(this._x,this._y,this._z,this._w)}copy(t){return this._x=t.x,this._y=t.y,this._z=t.z,this._w=t.w,this._onChangeCallback(),this}setFromEuler(t,i=!0){const s=t._x,l=t._y,c=t._z,h=t._order,d=Math.cos,m=Math.sin,p=d(s/2),v=d(l/2),g=d(c/2),_=m(s/2),M=m(l/2),E=m(c/2);switch(h){case"XYZ":this._x=_*v*g+p*M*E,this._y=p*M*g-_*v*E,this._z=p*v*E+_*M*g,this._w=p*v*g-_*M*E;break;case"YXZ":this._x=_*v*g+p*M*E,this._y=p*M*g-_*v*E,this._z=p*v*E-_*M*g,this._w=p*v*g+_*M*E;break;case"ZXY":this._x=_*v*g-p*M*E,this._y=p*M*g+_*v*E,this._z=p*v*E+_*M*g,this._w=p*v*g-_*M*E;break;case"ZYX":this._x=_*v*g-p*M*E,this._y=p*M*g+_*v*E,this._z=p*v*E-_*M*g,this._w=p*v*g+_*M*E;break;case"YZX":this._x=_*v*g+p*M*E,this._y=p*M*g+_*v*E,this._z=p*v*E-_*M*g,this._w=p*v*g-_*M*E;break;case"XZY":this._x=_*v*g-p*M*E,this._y=p*M*g-_*v*E,this._z=p*v*E+_*M*g,this._w=p*v*g+_*M*E;break;default:ee("Quaternion: .setFromEuler() encountered an unknown order: "+h)}return i===!0&&this._onChangeCallback(),this}setFromAxisAngle(t,i){const s=i/2,l=Math.sin(s);return this._x=t.x*l,this._y=t.y*l,this._z=t.z*l,this._w=Math.cos(s),this._onChangeCallback(),this}setFromRotationMatrix(t){const i=t.elements,s=i[0],l=i[4],c=i[8],h=i[1],d=i[5],m=i[9],p=i[2],v=i[6],g=i[10],_=s+d+g;if(_>0){const M=.5/Math.sqrt(_+1);this._w=.25/M,this._x=(v-m)*M,this._y=(c-p)*M,this._z=(h-l)*M}else if(s>d&&s>g){const M=2*Math.sqrt(1+s-d-g);this._w=(v-m)/M,this._x=.25*M,this._y=(l+h)/M,this._z=(c+p)/M}else if(d>g){const M=2*Math.sqrt(1+d-s-g);this._w=(c-p)/M,this._x=(l+h)/M,this._y=.25*M,this._z=(m+v)/M}else{const M=2*Math.sqrt(1+g-s-d);this._w=(h-l)/M,this._x=(c+p)/M,this._y=(m+v)/M,this._z=.25*M}return this._onChangeCallback(),this}setFromUnitVectors(t,i){let s=t.dot(i)+1;return s<1e-8?(s=0,Math.abs(t.x)>Math.abs(t.z)?(this._x=-t.y,this._y=t.x,this._z=0,this._w=s):(this._x=0,this._y=-t.z,this._z=t.y,this._w=s)):(this._x=t.y*i.z-t.z*i.y,this._y=t.z*i.x-t.x*i.z,this._z=t.x*i.y-t.y*i.x,this._w=s),this.normalize()}angleTo(t){return 2*Math.acos(Math.abs(ce(this.dot(t),-1,1)))}rotateTowards(t,i){const s=this.angleTo(t);if(s===0)return this;const l=Math.min(1,i/s);return this.slerp(t,l),this}identity(){return this.set(0,0,0,1)}invert(){return this.conjugate()}conjugate(){return this._x*=-1,this._y*=-1,this._z*=-1,this._onChangeCallback(),this}dot(t){return this._x*t._x+this._y*t._y+this._z*t._z+this._w*t._w}lengthSq(){return this._x*this._x+this._y*this._y+this._z*this._z+this._w*this._w}length(){return Math.sqrt(this._x*this._x+this._y*this._y+this._z*this._z+this._w*this._w)}normalize(){let t=this.length();return t===0?(this._x=0,this._y=0,this._z=0,this._w=1):(t=1/t,this._x=this._x*t,this._y=this._y*t,this._z=this._z*t,this._w=this._w*t),this._onChangeCallback(),this}multiply(t){return this.multiplyQuaternions(this,t)}premultiply(t){return this.multiplyQuaternions(t,this)}multiplyQuaternions(t,i){const s=t._x,l=t._y,c=t._z,h=t._w,d=i._x,m=i._y,p=i._z,v=i._w;return this._x=s*v+h*d+l*p-c*m,this._y=l*v+h*m+c*d-s*p,this._z=c*v+h*p+s*m-l*d,this._w=h*v-s*d-l*m-c*p,this._onChangeCallback(),this}slerp(t,i){let s=t._x,l=t._y,c=t._z,h=t._w,d=this.dot(t);d<0&&(s=-s,l=-l,c=-c,h=-h,d=-d);let m=1-i;if(d<.9995){const p=Math.acos(d),v=Math.sin(p);m=Math.sin(m*p)/v,i=Math.sin(i*p)/v,this._x=this._x*m+s*i,this._y=this._y*m+l*i,this._z=this._z*m+c*i,this._w=this._w*m+h*i,this._onChangeCallback()}else this._x=this._x*m+s*i,this._y=this._y*m+l*i,this._z=this._z*m+c*i,this._w=this._w*m+h*i,this.normalize();return this}slerpQuaternions(t,i,s){return this.copy(t).slerp(i,s)}random(){const t=2*Math.PI*Math.random(),i=2*Math.PI*Math.random(),s=Math.random(),l=Math.sqrt(1-s),c=Math.sqrt(s);return this.set(l*Math.sin(t),l*Math.cos(t),c*Math.sin(i),c*Math.cos(i))}equals(t){return t._x===this._x&&t._y===this._y&&t._z===this._z&&t._w===this._w}fromArray(t,i=0){return this._x=t[i],this._y=t[i+1],this._z=t[i+2],this._w=t[i+3],this._onChangeCallback(),this}toArray(t=[],i=0){return t[i]=this._x,t[i+1]=this._y,t[i+2]=this._z,t[i+3]=this._w,t}fromBufferAttribute(t,i){return this._x=t.getX(i),this._y=t.getY(i),this._z=t.getZ(i),this._w=t.getW(i),this._onChangeCallback(),this}toJSON(){return this.toArray()}_onChange(t){return this._onChangeCallback=t,this}_onChangeCallback(){}*[Symbol.iterator](){yield this._x,yield this._y,yield this._z,yield this._w}}class j{constructor(t=0,i=0,s=0){j.prototype.isVector3=!0,this.x=t,this.y=i,this.z=s}set(t,i,s){return s===void 0&&(s=this.z),this.x=t,this.y=i,this.z=s,this}setScalar(t){return this.x=t,this.y=t,this.z=t,this}setX(t){return this.x=t,this}setY(t){return this.y=t,this}setZ(t){return this.z=t,this}setComponent(t,i){switch(t){case 0:this.x=i;break;case 1:this.y=i;break;case 2:this.z=i;break;default:throw new Error("index is out of range: "+t)}return this}getComponent(t){switch(t){case 0:return this.x;case 1:return this.y;case 2:return this.z;default:throw new Error("index is out of range: "+t)}}clone(){return new this.constructor(this.x,this.y,this.z)}copy(t){return this.x=t.x,this.y=t.y,this.z=t.z,this}add(t){return this.x+=t.x,this.y+=t.y,this.z+=t.z,this}addScalar(t){return this.x+=t,this.y+=t,this.z+=t,this}addVectors(t,i){return this.x=t.x+i.x,this.y=t.y+i.y,this.z=t.z+i.z,this}addScaledVector(t,i){return this.x+=t.x*i,this.y+=t.y*i,this.z+=t.z*i,this}sub(t){return this.x-=t.x,this.y-=t.y,this.z-=t.z,this}subScalar(t){return this.x-=t,this.y-=t,this.z-=t,this}subVectors(t,i){return this.x=t.x-i.x,this.y=t.y-i.y,this.z=t.z-i.z,this}multiply(t){return this.x*=t.x,this.y*=t.y,this.z*=t.z,this}multiplyScalar(t){return this.x*=t,this.y*=t,this.z*=t,this}multiplyVectors(t,i){return this.x=t.x*i.x,this.y=t.y*i.y,this.z=t.z*i.z,this}applyEuler(t){return this.applyQuaternion(O_.setFromEuler(t))}applyAxisAngle(t,i){return this.applyQuaternion(O_.setFromAxisAngle(t,i))}applyMatrix3(t){const i=this.x,s=this.y,l=this.z,c=t.elements;return this.x=c[0]*i+c[3]*s+c[6]*l,this.y=c[1]*i+c[4]*s+c[7]*l,this.z=c[2]*i+c[5]*s+c[8]*l,this}applyNormalMatrix(t){return this.applyMatrix3(t).normalize()}applyMatrix4(t){const i=this.x,s=this.y,l=this.z,c=t.elements,h=1/(c[3]*i+c[7]*s+c[11]*l+c[15]);return this.x=(c[0]*i+c[4]*s+c[8]*l+c[12])*h,this.y=(c[1]*i+c[5]*s+c[9]*l+c[13])*h,this.z=(c[2]*i+c[6]*s+c[10]*l+c[14])*h,this}applyQuaternion(t){const i=this.x,s=this.y,l=this.z,c=t.x,h=t.y,d=t.z,m=t.w,p=2*(h*l-d*s),v=2*(d*i-c*l),g=2*(c*s-h*i);return this.x=i+m*p+h*g-d*v,this.y=s+m*v+d*p-c*g,this.z=l+m*g+c*v-h*p,this}project(t){return this.applyMatrix4(t.matrixWorldInverse).applyMatrix4(t.projectionMatrix)}unproject(t){return this.applyMatrix4(t.projectionMatrixInverse).applyMatrix4(t.matrixWorld)}transformDirection(t){const i=this.x,s=this.y,l=this.z,c=t.elements;return this.x=c[0]*i+c[4]*s+c[8]*l,this.y=c[1]*i+c[5]*s+c[9]*l,this.z=c[2]*i+c[6]*s+c[10]*l,this.normalize()}divide(t){return this.x/=t.x,this.y/=t.y,this.z/=t.z,this}divideScalar(t){return this.multiplyScalar(1/t)}min(t){return this.x=Math.min(this.x,t.x),this.y=Math.min(this.y,t.y),this.z=Math.min(this.z,t.z),this}max(t){return this.x=Math.max(this.x,t.x),this.y=Math.max(this.y,t.y),this.z=Math.max(this.z,t.z),this}clamp(t,i){return this.x=ce(this.x,t.x,i.x),this.y=ce(this.y,t.y,i.y),this.z=ce(this.z,t.z,i.z),this}clampScalar(t,i){return this.x=ce(this.x,t,i),this.y=ce(this.y,t,i),this.z=ce(this.z,t,i),this}clampLength(t,i){const s=this.length();return this.divideScalar(s||1).multiplyScalar(ce(s,t,i))}floor(){return this.x=Math.floor(this.x),this.y=Math.floor(this.y),this.z=Math.floor(this.z),this}ceil(){return this.x=Math.ceil(this.x),this.y=Math.ceil(this.y),this.z=Math.ceil(this.z),this}round(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this.z=Math.round(this.z),this}roundToZero(){return this.x=Math.trunc(this.x),this.y=Math.trunc(this.y),this.z=Math.trunc(this.z),this}negate(){return this.x=-this.x,this.y=-this.y,this.z=-this.z,this}dot(t){return this.x*t.x+this.y*t.y+this.z*t.z}lengthSq(){return this.x*this.x+this.y*this.y+this.z*this.z}length(){return Math.sqrt(this.x*this.x+this.y*this.y+this.z*this.z)}manhattanLength(){return Math.abs(this.x)+Math.abs(this.y)+Math.abs(this.z)}normalize(){return this.divideScalar(this.length()||1)}setLength(t){return this.normalize().multiplyScalar(t)}lerp(t,i){return this.x+=(t.x-this.x)*i,this.y+=(t.y-this.y)*i,this.z+=(t.z-this.z)*i,this}lerpVectors(t,i,s){return this.x=t.x+(i.x-t.x)*s,this.y=t.y+(i.y-t.y)*s,this.z=t.z+(i.z-t.z)*s,this}cross(t){return this.crossVectors(this,t)}crossVectors(t,i){const s=t.x,l=t.y,c=t.z,h=i.x,d=i.y,m=i.z;return this.x=l*m-c*d,this.y=c*h-s*m,this.z=s*d-l*h,this}projectOnVector(t){const i=t.lengthSq();if(i===0)return this.set(0,0,0);const s=t.dot(this)/i;return this.copy(t).multiplyScalar(s)}projectOnPlane(t){return Gh.copy(this).projectOnVector(t),this.sub(Gh)}reflect(t){return this.sub(Gh.copy(t).multiplyScalar(2*this.dot(t)))}angleTo(t){const i=Math.sqrt(this.lengthSq()*t.lengthSq());if(i===0)return Math.PI/2;const s=this.dot(t)/i;return Math.acos(ce(s,-1,1))}distanceTo(t){return Math.sqrt(this.distanceToSquared(t))}distanceToSquared(t){const i=this.x-t.x,s=this.y-t.y,l=this.z-t.z;return i*i+s*s+l*l}manhattanDistanceTo(t){return Math.abs(this.x-t.x)+Math.abs(this.y-t.y)+Math.abs(this.z-t.z)}setFromSpherical(t){return this.setFromSphericalCoords(t.radius,t.phi,t.theta)}setFromSphericalCoords(t,i,s){const l=Math.sin(i)*t;return this.x=l*Math.sin(s),this.y=Math.cos(i)*t,this.z=l*Math.cos(s),this}setFromCylindrical(t){return this.setFromCylindricalCoords(t.radius,t.theta,t.y)}setFromCylindricalCoords(t,i,s){return this.x=t*Math.sin(i),this.y=s,this.z=t*Math.cos(i),this}setFromMatrixPosition(t){const i=t.elements;return this.x=i[12],this.y=i[13],this.z=i[14],this}setFromMatrixScale(t){const i=this.setFromMatrixColumn(t,0).length(),s=this.setFromMatrixColumn(t,1).length(),l=this.setFromMatrixColumn(t,2).length();return this.x=i,this.y=s,this.z=l,this}setFromMatrixColumn(t,i){return this.fromArray(t.elements,i*4)}setFromMatrix3Column(t,i){return this.fromArray(t.elements,i*3)}setFromEuler(t){return this.x=t._x,this.y=t._y,this.z=t._z,this}setFromColor(t){return this.x=t.r,this.y=t.g,this.z=t.b,this}equals(t){return t.x===this.x&&t.y===this.y&&t.z===this.z}fromArray(t,i=0){return this.x=t[i],this.y=t[i+1],this.z=t[i+2],this}toArray(t=[],i=0){return t[i]=this.x,t[i+1]=this.y,t[i+2]=this.z,t}fromBufferAttribute(t,i){return this.x=t.getX(i),this.y=t.getY(i),this.z=t.getZ(i),this}random(){return this.x=Math.random(),this.y=Math.random(),this.z=Math.random(),this}randomDirection(){const t=Math.random()*Math.PI*2,i=Math.random()*2-1,s=Math.sqrt(1-i*i);return this.x=s*Math.cos(t),this.y=i,this.z=s*Math.sin(t),this}*[Symbol.iterator](){yield this.x,yield this.y,yield this.z}}const Gh=new j,O_=new Ss;class pe{constructor(t,i,s,l,c,h,d,m,p){pe.prototype.isMatrix3=!0,this.elements=[1,0,0,0,1,0,0,0,1],t!==void 0&&this.set(t,i,s,l,c,h,d,m,p)}set(t,i,s,l,c,h,d,m,p){const v=this.elements;return v[0]=t,v[1]=l,v[2]=d,v[3]=i,v[4]=c,v[5]=m,v[6]=s,v[7]=h,v[8]=p,this}identity(){return this.set(1,0,0,0,1,0,0,0,1),this}copy(t){const i=this.elements,s=t.elements;return i[0]=s[0],i[1]=s[1],i[2]=s[2],i[3]=s[3],i[4]=s[4],i[5]=s[5],i[6]=s[6],i[7]=s[7],i[8]=s[8],this}extractBasis(t,i,s){return t.setFromMatrix3Column(this,0),i.setFromMatrix3Column(this,1),s.setFromMatrix3Column(this,2),this}setFromMatrix4(t){const i=t.elements;return this.set(i[0],i[4],i[8],i[1],i[5],i[9],i[2],i[6],i[10]),this}multiply(t){return this.multiplyMatrices(this,t)}premultiply(t){return this.multiplyMatrices(t,this)}multiplyMatrices(t,i){const s=t.elements,l=i.elements,c=this.elements,h=s[0],d=s[3],m=s[6],p=s[1],v=s[4],g=s[7],_=s[2],M=s[5],E=s[8],A=l[0],x=l[3],y=l[6],w=l[1],D=l[4],U=l[7],H=l[2],F=l[5],I=l[8];return c[0]=h*A+d*w+m*H,c[3]=h*x+d*D+m*F,c[6]=h*y+d*U+m*I,c[1]=p*A+v*w+g*H,c[4]=p*x+v*D+g*F,c[7]=p*y+v*U+g*I,c[2]=_*A+M*w+E*H,c[5]=_*x+M*D+E*F,c[8]=_*y+M*U+E*I,this}multiplyScalar(t){const i=this.elements;return i[0]*=t,i[3]*=t,i[6]*=t,i[1]*=t,i[4]*=t,i[7]*=t,i[2]*=t,i[5]*=t,i[8]*=t,this}determinant(){const t=this.elements,i=t[0],s=t[1],l=t[2],c=t[3],h=t[4],d=t[5],m=t[6],p=t[7],v=t[8];return i*h*v-i*d*p-s*c*v+s*d*m+l*c*p-l*h*m}invert(){const t=this.elements,i=t[0],s=t[1],l=t[2],c=t[3],h=t[4],d=t[5],m=t[6],p=t[7],v=t[8],g=v*h-d*p,_=d*m-v*c,M=p*c-h*m,E=i*g+s*_+l*M;if(E===0)return this.set(0,0,0,0,0,0,0,0,0);const A=1/E;return t[0]=g*A,t[1]=(l*p-v*s)*A,t[2]=(d*s-l*h)*A,t[3]=_*A,t[4]=(v*i-l*m)*A,t[5]=(l*c-d*i)*A,t[6]=M*A,t[7]=(s*m-p*i)*A,t[8]=(h*i-s*c)*A,this}transpose(){let t;const i=this.elements;return t=i[1],i[1]=i[3],i[3]=t,t=i[2],i[2]=i[6],i[6]=t,t=i[5],i[5]=i[7],i[7]=t,this}getNormalMatrix(t){return this.setFromMatrix4(t).invert().transpose()}transposeIntoArray(t){const i=this.elements;return t[0]=i[0],t[1]=i[3],t[2]=i[6],t[3]=i[1],t[4]=i[4],t[5]=i[7],t[6]=i[2],t[7]=i[5],t[8]=i[8],this}setUvTransform(t,i,s,l,c,h,d){const m=Math.cos(c),p=Math.sin(c);return this.set(s*m,s*p,-s*(m*h+p*d)+h+t,-l*p,l*m,-l*(-p*h+m*d)+d+i,0,0,1),this}scale(t,i){return this.premultiply(Vh.makeScale(t,i)),this}rotate(t){return this.premultiply(Vh.makeRotation(-t)),this}translate(t,i){return this.premultiply(Vh.makeTranslation(t,i)),this}makeTranslation(t,i){return t.isVector2?this.set(1,0,t.x,0,1,t.y,0,0,1):this.set(1,0,t,0,1,i,0,0,1),this}makeRotation(t){const i=Math.cos(t),s=Math.sin(t);return this.set(i,-s,0,s,i,0,0,0,1),this}makeScale(t,i){return this.set(t,0,0,0,i,0,0,0,1),this}equals(t){const i=this.elements,s=t.elements;for(let l=0;l<9;l++)if(i[l]!==s[l])return!1;return!0}fromArray(t,i=0){for(let s=0;s<9;s++)this.elements[s]=t[s+i];return this}toArray(t=[],i=0){const s=this.elements;return t[i]=s[0],t[i+1]=s[1],t[i+2]=s[2],t[i+3]=s[3],t[i+4]=s[4],t[i+5]=s[5],t[i+6]=s[6],t[i+7]=s[7],t[i+8]=s[8],t}clone(){return new this.constructor().fromArray(this.elements)}}const Vh=new pe,P_=new pe().set(.4123908,.3575843,.1804808,.212639,.7151687,.0721923,.0193308,.1191948,.9505322),z_=new pe().set(3.2409699,-1.5373832,-.4986108,-.9692436,1.8759675,.0415551,.0556301,-.203977,1.0569715);function kM(){const r={enabled:!0,workingColorSpace:ao,spaces:{},convert:function(l,c,h){return this.enabled===!1||c===h||!c||!h||(this.spaces[c].transfer===Fe&&(l.r=Oa(l.r),l.g=Oa(l.g),l.b=Oa(l.b)),this.spaces[c].primaries!==this.spaces[h].primaries&&(l.applyMatrix3(this.spaces[c].toXYZ),l.applyMatrix3(this.spaces[h].fromXYZ)),this.spaces[h].transfer===Fe&&(l.r=to(l.r),l.g=to(l.g),l.b=to(l.b))),l},workingToColorSpace:function(l,c){return this.convert(l,this.workingColorSpace,c)},colorSpaceToWorking:function(l,c){return this.convert(l,c,this.workingColorSpace)},getPrimaries:function(l){return this.spaces[l].primaries},getTransfer:function(l){return l===gs?gu:this.spaces[l].transfer},getToneMappingMode:function(l){return this.spaces[l].outputColorSpaceConfig.toneMappingMode||"standard"},getLuminanceCoefficients:function(l,c=this.workingColorSpace){return l.fromArray(this.spaces[c].luminanceCoefficients)},define:function(l){Object.assign(this.spaces,l)},_getMatrix:function(l,c,h){return l.copy(this.spaces[c].toXYZ).multiply(this.spaces[h].fromXYZ)},_getDrawingBufferColorSpace:function(l){return this.spaces[l].outputColorSpaceConfig.drawingBufferColorSpace},_getUnpackColorSpace:function(l=this.workingColorSpace){return this.spaces[l].workingColorSpaceConfig.unpackColorSpace},fromWorkingColorSpace:function(l,c){return xu("ColorManagement: .fromWorkingColorSpace() has been renamed to .workingToColorSpace()."),r.workingToColorSpace(l,c)},toWorkingColorSpace:function(l,c){return xu("ColorManagement: .toWorkingColorSpace() has been renamed to .colorSpaceToWorking()."),r.colorSpaceToWorking(l,c)}},t=[.64,.33,.3,.6,.15,.06],i=[.2126,.7152,.0722],s=[.3127,.329];return r.define({[ao]:{primaries:t,whitePoint:s,transfer:gu,toXYZ:P_,fromXYZ:z_,luminanceCoefficients:i,workingColorSpaceConfig:{unpackColorSpace:Ri},outputColorSpaceConfig:{drawingBufferColorSpace:Ri}},[Ri]:{primaries:t,whitePoint:s,transfer:Fe,toXYZ:P_,fromXYZ:z_,luminanceCoefficients:i,outputColorSpaceConfig:{drawingBufferColorSpace:Ri}}}),r}const Re=kM();function Oa(r){return r<.04045?r*.0773993808:Math.pow(r*.9478672986+.0521327014,2.4)}function to(r){return r<.0031308?r*12.92:1.055*Math.pow(r,.41666)-.055}let zr;class XM{static getDataURL(t,i="image/png"){if(/^data:/i.test(t.src)||typeof HTMLCanvasElement>"u")return t.src;let s;if(t instanceof HTMLCanvasElement)s=t;else{zr===void 0&&(zr=_u("canvas")),zr.width=t.width,zr.height=t.height;const l=zr.getContext("2d");t instanceof ImageData?l.putImageData(t,0,0):l.drawImage(t,0,0,t.width,t.height),s=zr}return s.toDataURL(i)}static sRGBToLinear(t){if(typeof HTMLImageElement<"u"&&t instanceof HTMLImageElement||typeof HTMLCanvasElement<"u"&&t instanceof HTMLCanvasElement||typeof ImageBitmap<"u"&&t instanceof ImageBitmap){const i=_u("canvas");i.width=t.width,i.height=t.height;const s=i.getContext("2d");s.drawImage(t,0,0,t.width,t.height);const l=s.getImageData(0,0,t.width,t.height),c=l.data;for(let h=0;h<c.length;h++)c[h]=Oa(c[h]/255)*255;return s.putImageData(l,0,0),i}else if(t.data){const i=t.data.slice(0);for(let s=0;s<i.length;s++)i instanceof Uint8Array||i instanceof Uint8ClampedArray?i[s]=Math.floor(Oa(i[s]/255)*255):i[s]=Oa(i[s]);return{data:i,width:t.width,height:t.height}}else return ee("ImageUtils.sRGBToLinear(): Unsupported image type. No color space conversion applied."),t}}let WM=0;class Dp{constructor(t=null){this.isSource=!0,Object.defineProperty(this,"id",{value:WM++}),this.uuid=Na(),this.data=t,this.dataReady=!0,this.version=0}getSize(t){const i=this.data;return typeof HTMLVideoElement<"u"&&i instanceof HTMLVideoElement?t.set(i.videoWidth,i.videoHeight,0):typeof VideoFrame<"u"&&i instanceof VideoFrame?t.set(i.displayHeight,i.displayWidth,0):i!==null?t.set(i.width,i.height,i.depth||0):t.set(0,0,0),t}set needsUpdate(t){t===!0&&this.version++}toJSON(t){const i=t===void 0||typeof t=="string";if(!i&&t.images[this.uuid]!==void 0)return t.images[this.uuid];const s={uuid:this.uuid,url:""},l=this.data;if(l!==null){let c;if(Array.isArray(l)){c=[];for(let h=0,d=l.length;h<d;h++)l[h].isDataTexture?c.push(kh(l[h].image)):c.push(kh(l[h]))}else c=kh(l);s.url=c}return i||(t.images[this.uuid]=s),s}}function kh(r){return typeof HTMLImageElement<"u"&&r instanceof HTMLImageElement||typeof HTMLCanvasElement<"u"&&r instanceof HTMLCanvasElement||typeof ImageBitmap<"u"&&r instanceof ImageBitmap?XM.getDataURL(r):r.data?{data:Array.from(r.data),width:r.width,height:r.height,type:r.data.constructor.name}:(ee("Texture: Unable to serialize Texture."),{})}let qM=0;const Xh=new j;class jn extends Js{constructor(t=jn.DEFAULT_IMAGE,i=jn.DEFAULT_MAPPING,s=Ua,l=Ua,c=Bn,h=js,d=ki,m=mi,p=jn.DEFAULT_ANISOTROPY,v=gs){super(),this.isTexture=!0,Object.defineProperty(this,"id",{value:qM++}),this.uuid=Na(),this.name="",this.source=new Dp(t),this.mipmaps=[],this.mapping=i,this.channel=0,this.wrapS=s,this.wrapT=l,this.magFilter=c,this.minFilter=h,this.anisotropy=p,this.format=d,this.internalFormat=null,this.type=m,this.offset=new le(0,0),this.repeat=new le(1,1),this.center=new le(0,0),this.rotation=0,this.matrixAutoUpdate=!0,this.matrix=new pe,this.generateMipmaps=!0,this.premultiplyAlpha=!1,this.flipY=!0,this.unpackAlignment=4,this.colorSpace=v,this.userData={},this.updateRanges=[],this.version=0,this.onUpdate=null,this.renderTarget=null,this.isRenderTargetTexture=!1,this.isArrayTexture=!!(t&&t.depth&&t.depth>1),this.pmremVersion=0}get width(){return this.source.getSize(Xh).x}get height(){return this.source.getSize(Xh).y}get depth(){return this.source.getSize(Xh).z}get image(){return this.source.data}set image(t=null){this.source.data=t}updateMatrix(){this.matrix.setUvTransform(this.offset.x,this.offset.y,this.repeat.x,this.repeat.y,this.rotation,this.center.x,this.center.y)}addUpdateRange(t,i){this.updateRanges.push({start:t,count:i})}clearUpdateRanges(){this.updateRanges.length=0}clone(){return new this.constructor().copy(this)}copy(t){return this.name=t.name,this.source=t.source,this.mipmaps=t.mipmaps.slice(0),this.mapping=t.mapping,this.channel=t.channel,this.wrapS=t.wrapS,this.wrapT=t.wrapT,this.magFilter=t.magFilter,this.minFilter=t.minFilter,this.anisotropy=t.anisotropy,this.format=t.format,this.internalFormat=t.internalFormat,this.type=t.type,this.offset.copy(t.offset),this.repeat.copy(t.repeat),this.center.copy(t.center),this.rotation=t.rotation,this.matrixAutoUpdate=t.matrixAutoUpdate,this.matrix.copy(t.matrix),this.generateMipmaps=t.generateMipmaps,this.premultiplyAlpha=t.premultiplyAlpha,this.flipY=t.flipY,this.unpackAlignment=t.unpackAlignment,this.colorSpace=t.colorSpace,this.renderTarget=t.renderTarget,this.isRenderTargetTexture=t.isRenderTargetTexture,this.isArrayTexture=t.isArrayTexture,this.userData=JSON.parse(JSON.stringify(t.userData)),this.needsUpdate=!0,this}setValues(t){for(const i in t){const s=t[i];if(s===void 0){ee(`Texture.setValues(): parameter '${i}' has value of undefined.`);continue}const l=this[i];if(l===void 0){ee(`Texture.setValues(): property '${i}' does not exist.`);continue}l&&s&&l.isVector2&&s.isVector2||l&&s&&l.isVector3&&s.isVector3||l&&s&&l.isMatrix3&&s.isMatrix3?l.copy(s):this[i]=s}}toJSON(t){const i=t===void 0||typeof t=="string";if(!i&&t.textures[this.uuid]!==void 0)return t.textures[this.uuid];const s={metadata:{version:4.7,type:"Texture",generator:"Texture.toJSON"},uuid:this.uuid,name:this.name,image:this.source.toJSON(t).uuid,mapping:this.mapping,channel:this.channel,repeat:[this.repeat.x,this.repeat.y],offset:[this.offset.x,this.offset.y],center:[this.center.x,this.center.y],rotation:this.rotation,wrap:[this.wrapS,this.wrapT],format:this.format,internalFormat:this.internalFormat,type:this.type,colorSpace:this.colorSpace,minFilter:this.minFilter,magFilter:this.magFilter,anisotropy:this.anisotropy,flipY:this.flipY,generateMipmaps:this.generateMipmaps,premultiplyAlpha:this.premultiplyAlpha,unpackAlignment:this.unpackAlignment};return Object.keys(this.userData).length>0&&(s.userData=this.userData),i||(t.textures[this.uuid]=s),s}dispose(){this.dispatchEvent({type:"dispose"})}transformUv(t){if(this.mapping!==Kv)return t;if(t.applyMatrix3(this.matrix),t.x<0||t.x>1)switch(this.wrapS){case Ud:t.x=t.x-Math.floor(t.x);break;case Ua:t.x=t.x<0?0:1;break;case Ld:Math.abs(Math.floor(t.x)%2)===1?t.x=Math.ceil(t.x)-t.x:t.x=t.x-Math.floor(t.x);break}if(t.y<0||t.y>1)switch(this.wrapT){case Ud:t.y=t.y-Math.floor(t.y);break;case Ua:t.y=t.y<0?0:1;break;case Ld:Math.abs(Math.floor(t.y)%2)===1?t.y=Math.ceil(t.y)-t.y:t.y=t.y-Math.floor(t.y);break}return this.flipY&&(t.y=1-t.y),t}set needsUpdate(t){t===!0&&(this.version++,this.source.needsUpdate=!0)}set needsPMREMUpdate(t){t===!0&&this.pmremVersion++}}jn.DEFAULT_IMAGE=null;jn.DEFAULT_MAPPING=Kv;jn.DEFAULT_ANISOTROPY=1;class We{constructor(t=0,i=0,s=0,l=1){We.prototype.isVector4=!0,this.x=t,this.y=i,this.z=s,this.w=l}get width(){return this.z}set width(t){this.z=t}get height(){return this.w}set height(t){this.w=t}set(t,i,s,l){return this.x=t,this.y=i,this.z=s,this.w=l,this}setScalar(t){return this.x=t,this.y=t,this.z=t,this.w=t,this}setX(t){return this.x=t,this}setY(t){return this.y=t,this}setZ(t){return this.z=t,this}setW(t){return this.w=t,this}setComponent(t,i){switch(t){case 0:this.x=i;break;case 1:this.y=i;break;case 2:this.z=i;break;case 3:this.w=i;break;default:throw new Error("index is out of range: "+t)}return this}getComponent(t){switch(t){case 0:return this.x;case 1:return this.y;case 2:return this.z;case 3:return this.w;default:throw new Error("index is out of range: "+t)}}clone(){return new this.constructor(this.x,this.y,this.z,this.w)}copy(t){return this.x=t.x,this.y=t.y,this.z=t.z,this.w=t.w!==void 0?t.w:1,this}add(t){return this.x+=t.x,this.y+=t.y,this.z+=t.z,this.w+=t.w,this}addScalar(t){return this.x+=t,this.y+=t,this.z+=t,this.w+=t,this}addVectors(t,i){return this.x=t.x+i.x,this.y=t.y+i.y,this.z=t.z+i.z,this.w=t.w+i.w,this}addScaledVector(t,i){return this.x+=t.x*i,this.y+=t.y*i,this.z+=t.z*i,this.w+=t.w*i,this}sub(t){return this.x-=t.x,this.y-=t.y,this.z-=t.z,this.w-=t.w,this}subScalar(t){return this.x-=t,this.y-=t,this.z-=t,this.w-=t,this}subVectors(t,i){return this.x=t.x-i.x,this.y=t.y-i.y,this.z=t.z-i.z,this.w=t.w-i.w,this}multiply(t){return this.x*=t.x,this.y*=t.y,this.z*=t.z,this.w*=t.w,this}multiplyScalar(t){return this.x*=t,this.y*=t,this.z*=t,this.w*=t,this}applyMatrix4(t){const i=this.x,s=this.y,l=this.z,c=this.w,h=t.elements;return this.x=h[0]*i+h[4]*s+h[8]*l+h[12]*c,this.y=h[1]*i+h[5]*s+h[9]*l+h[13]*c,this.z=h[2]*i+h[6]*s+h[10]*l+h[14]*c,this.w=h[3]*i+h[7]*s+h[11]*l+h[15]*c,this}divide(t){return this.x/=t.x,this.y/=t.y,this.z/=t.z,this.w/=t.w,this}divideScalar(t){return this.multiplyScalar(1/t)}setAxisAngleFromQuaternion(t){this.w=2*Math.acos(t.w);const i=Math.sqrt(1-t.w*t.w);return i<1e-4?(this.x=1,this.y=0,this.z=0):(this.x=t.x/i,this.y=t.y/i,this.z=t.z/i),this}setAxisAngleFromRotationMatrix(t){let i,s,l,c;const m=t.elements,p=m[0],v=m[4],g=m[8],_=m[1],M=m[5],E=m[9],A=m[2],x=m[6],y=m[10];if(Math.abs(v-_)<.01&&Math.abs(g-A)<.01&&Math.abs(E-x)<.01){if(Math.abs(v+_)<.1&&Math.abs(g+A)<.1&&Math.abs(E+x)<.1&&Math.abs(p+M+y-3)<.1)return this.set(1,0,0,0),this;i=Math.PI;const D=(p+1)/2,U=(M+1)/2,H=(y+1)/2,F=(v+_)/4,I=(g+A)/4,T=(E+x)/4;return D>U&&D>H?D<.01?(s=0,l=.707106781,c=.707106781):(s=Math.sqrt(D),l=F/s,c=I/s):U>H?U<.01?(s=.707106781,l=0,c=.707106781):(l=Math.sqrt(U),s=F/l,c=T/l):H<.01?(s=.707106781,l=.707106781,c=0):(c=Math.sqrt(H),s=I/c,l=T/c),this.set(s,l,c,i),this}let w=Math.sqrt((x-E)*(x-E)+(g-A)*(g-A)+(_-v)*(_-v));return Math.abs(w)<.001&&(w=1),this.x=(x-E)/w,this.y=(g-A)/w,this.z=(_-v)/w,this.w=Math.acos((p+M+y-1)/2),this}setFromMatrixPosition(t){const i=t.elements;return this.x=i[12],this.y=i[13],this.z=i[14],this.w=i[15],this}min(t){return this.x=Math.min(this.x,t.x),this.y=Math.min(this.y,t.y),this.z=Math.min(this.z,t.z),this.w=Math.min(this.w,t.w),this}max(t){return this.x=Math.max(this.x,t.x),this.y=Math.max(this.y,t.y),this.z=Math.max(this.z,t.z),this.w=Math.max(this.w,t.w),this}clamp(t,i){return this.x=ce(this.x,t.x,i.x),this.y=ce(this.y,t.y,i.y),this.z=ce(this.z,t.z,i.z),this.w=ce(this.w,t.w,i.w),this}clampScalar(t,i){return this.x=ce(this.x,t,i),this.y=ce(this.y,t,i),this.z=ce(this.z,t,i),this.w=ce(this.w,t,i),this}clampLength(t,i){const s=this.length();return this.divideScalar(s||1).multiplyScalar(ce(s,t,i))}floor(){return this.x=Math.floor(this.x),this.y=Math.floor(this.y),this.z=Math.floor(this.z),this.w=Math.floor(this.w),this}ceil(){return this.x=Math.ceil(this.x),this.y=Math.ceil(this.y),this.z=Math.ceil(this.z),this.w=Math.ceil(this.w),this}round(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this.z=Math.round(this.z),this.w=Math.round(this.w),this}roundToZero(){return this.x=Math.trunc(this.x),this.y=Math.trunc(this.y),this.z=Math.trunc(this.z),this.w=Math.trunc(this.w),this}negate(){return this.x=-this.x,this.y=-this.y,this.z=-this.z,this.w=-this.w,this}dot(t){return this.x*t.x+this.y*t.y+this.z*t.z+this.w*t.w}lengthSq(){return this.x*this.x+this.y*this.y+this.z*this.z+this.w*this.w}length(){return Math.sqrt(this.x*this.x+this.y*this.y+this.z*this.z+this.w*this.w)}manhattanLength(){return Math.abs(this.x)+Math.abs(this.y)+Math.abs(this.z)+Math.abs(this.w)}normalize(){return this.divideScalar(this.length()||1)}setLength(t){return this.normalize().multiplyScalar(t)}lerp(t,i){return this.x+=(t.x-this.x)*i,this.y+=(t.y-this.y)*i,this.z+=(t.z-this.z)*i,this.w+=(t.w-this.w)*i,this}lerpVectors(t,i,s){return this.x=t.x+(i.x-t.x)*s,this.y=t.y+(i.y-t.y)*s,this.z=t.z+(i.z-t.z)*s,this.w=t.w+(i.w-t.w)*s,this}equals(t){return t.x===this.x&&t.y===this.y&&t.z===this.z&&t.w===this.w}fromArray(t,i=0){return this.x=t[i],this.y=t[i+1],this.z=t[i+2],this.w=t[i+3],this}toArray(t=[],i=0){return t[i]=this.x,t[i+1]=this.y,t[i+2]=this.z,t[i+3]=this.w,t}fromBufferAttribute(t,i){return this.x=t.getX(i),this.y=t.getY(i),this.z=t.getZ(i),this.w=t.getW(i),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 YM extends Js{constructor(t=1,i=1,s={}){super(),s=Object.assign({generateMipmaps:!1,internalFormat:null,minFilter:Bn,depthBuffer:!0,stencilBuffer:!1,resolveDepthBuffer:!0,resolveStencilBuffer:!0,depthTexture:null,samples:0,count:1,depth:1,multiview:!1},s),this.isRenderTarget=!0,this.width=t,this.height=i,this.depth=s.depth,this.scissor=new We(0,0,t,i),this.scissorTest=!1,this.viewport=new We(0,0,t,i),this.textures=[];const l={width:t,height:i,depth:s.depth},c=new jn(l),h=s.count;for(let d=0;d<h;d++)this.textures[d]=c.clone(),this.textures[d].isRenderTargetTexture=!0,this.textures[d].renderTarget=this;this._setTextureOptions(s),this.depthBuffer=s.depthBuffer,this.stencilBuffer=s.stencilBuffer,this.resolveDepthBuffer=s.resolveDepthBuffer,this.resolveStencilBuffer=s.resolveStencilBuffer,this._depthTexture=null,this.depthTexture=s.depthTexture,this.samples=s.samples,this.multiview=s.multiview}_setTextureOptions(t={}){const i={minFilter:Bn,generateMipmaps:!1,flipY:!1,internalFormat:null};t.mapping!==void 0&&(i.mapping=t.mapping),t.wrapS!==void 0&&(i.wrapS=t.wrapS),t.wrapT!==void 0&&(i.wrapT=t.wrapT),t.wrapR!==void 0&&(i.wrapR=t.wrapR),t.magFilter!==void 0&&(i.magFilter=t.magFilter),t.minFilter!==void 0&&(i.minFilter=t.minFilter),t.format!==void 0&&(i.format=t.format),t.type!==void 0&&(i.type=t.type),t.anisotropy!==void 0&&(i.anisotropy=t.anisotropy),t.colorSpace!==void 0&&(i.colorSpace=t.colorSpace),t.flipY!==void 0&&(i.flipY=t.flipY),t.generateMipmaps!==void 0&&(i.generateMipmaps=t.generateMipmaps),t.internalFormat!==void 0&&(i.internalFormat=t.internalFormat);for(let s=0;s<this.textures.length;s++)this.textures[s].setValues(i)}get texture(){return this.textures[0]}set texture(t){this.textures[0]=t}set depthTexture(t){this._depthTexture!==null&&(this._depthTexture.renderTarget=null),t!==null&&(t.renderTarget=this),this._depthTexture=t}get depthTexture(){return this._depthTexture}setSize(t,i,s=1){if(this.width!==t||this.height!==i||this.depth!==s){this.width=t,this.height=i,this.depth=s;for(let l=0,c=this.textures.length;l<c;l++)this.textures[l].image.width=t,this.textures[l].image.height=i,this.textures[l].image.depth=s,this.textures[l].isData3DTexture!==!0&&(this.textures[l].isArrayTexture=this.textures[l].image.depth>1);this.dispose()}this.viewport.set(0,0,t,i),this.scissor.set(0,0,t,i)}clone(){return new this.constructor().copy(this)}copy(t){this.width=t.width,this.height=t.height,this.depth=t.depth,this.scissor.copy(t.scissor),this.scissorTest=t.scissorTest,this.viewport.copy(t.viewport),this.textures.length=0;for(let i=0,s=t.textures.length;i<s;i++){this.textures[i]=t.textures[i].clone(),this.textures[i].isRenderTargetTexture=!0,this.textures[i].renderTarget=this;const l=Object.assign({},t.textures[i].image);this.textures[i].source=new Dp(l)}return this.depthBuffer=t.depthBuffer,this.stencilBuffer=t.stencilBuffer,this.resolveDepthBuffer=t.resolveDepthBuffer,this.resolveStencilBuffer=t.resolveStencilBuffer,t.depthTexture!==null&&(this.depthTexture=t.depthTexture.clone()),this.samples=t.samples,this}dispose(){this.dispatchEvent({type:"dispose"})}}class aa extends YM{constructor(t=1,i=1,s={}){super(t,i,s),this.isWebGLRenderTarget=!0}}class ox extends jn{constructor(t=null,i=1,s=1,l=1){super(null),this.isDataArrayTexture=!0,this.image={data:t,width:i,height:s,depth:l},this.magFilter=Nn,this.minFilter=Nn,this.wrapR=Ua,this.generateMipmaps=!1,this.flipY=!1,this.unpackAlignment=1,this.layerUpdates=new Set}addLayerUpdate(t){this.layerUpdates.add(t)}clearLayerUpdates(){this.layerUpdates.clear()}}class jM extends jn{constructor(t=null,i=1,s=1,l=1){super(null),this.isData3DTexture=!0,this.image={data:t,width:i,height:s,depth:l},this.magFilter=Nn,this.minFilter=Nn,this.wrapR=Ua,this.generateMipmaps=!1,this.flipY=!1,this.unpackAlignment=1}}class Je{constructor(t,i,s,l,c,h,d,m,p,v,g,_,M,E,A,x){Je.prototype.isMatrix4=!0,this.elements=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1],t!==void 0&&this.set(t,i,s,l,c,h,d,m,p,v,g,_,M,E,A,x)}set(t,i,s,l,c,h,d,m,p,v,g,_,M,E,A,x){const y=this.elements;return y[0]=t,y[4]=i,y[8]=s,y[12]=l,y[1]=c,y[5]=h,y[9]=d,y[13]=m,y[2]=p,y[6]=v,y[10]=g,y[14]=_,y[3]=M,y[7]=E,y[11]=A,y[15]=x,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 Je().fromArray(this.elements)}copy(t){const i=this.elements,s=t.elements;return i[0]=s[0],i[1]=s[1],i[2]=s[2],i[3]=s[3],i[4]=s[4],i[5]=s[5],i[6]=s[6],i[7]=s[7],i[8]=s[8],i[9]=s[9],i[10]=s[10],i[11]=s[11],i[12]=s[12],i[13]=s[13],i[14]=s[14],i[15]=s[15],this}copyPosition(t){const i=this.elements,s=t.elements;return i[12]=s[12],i[13]=s[13],i[14]=s[14],this}setFromMatrix3(t){const i=t.elements;return this.set(i[0],i[3],i[6],0,i[1],i[4],i[7],0,i[2],i[5],i[8],0,0,0,0,1),this}extractBasis(t,i,s){return this.determinant()===0?(t.set(1,0,0),i.set(0,1,0),s.set(0,0,1),this):(t.setFromMatrixColumn(this,0),i.setFromMatrixColumn(this,1),s.setFromMatrixColumn(this,2),this)}makeBasis(t,i,s){return this.set(t.x,i.x,s.x,0,t.y,i.y,s.y,0,t.z,i.z,s.z,0,0,0,0,1),this}extractRotation(t){if(t.determinant()===0)return this.identity();const i=this.elements,s=t.elements,l=1/Ir.setFromMatrixColumn(t,0).length(),c=1/Ir.setFromMatrixColumn(t,1).length(),h=1/Ir.setFromMatrixColumn(t,2).length();return i[0]=s[0]*l,i[1]=s[1]*l,i[2]=s[2]*l,i[3]=0,i[4]=s[4]*c,i[5]=s[5]*c,i[6]=s[6]*c,i[7]=0,i[8]=s[8]*h,i[9]=s[9]*h,i[10]=s[10]*h,i[11]=0,i[12]=0,i[13]=0,i[14]=0,i[15]=1,this}makeRotationFromEuler(t){const i=this.elements,s=t.x,l=t.y,c=t.z,h=Math.cos(s),d=Math.sin(s),m=Math.cos(l),p=Math.sin(l),v=Math.cos(c),g=Math.sin(c);if(t.order==="XYZ"){const _=h*v,M=h*g,E=d*v,A=d*g;i[0]=m*v,i[4]=-m*g,i[8]=p,i[1]=M+E*p,i[5]=_-A*p,i[9]=-d*m,i[2]=A-_*p,i[6]=E+M*p,i[10]=h*m}else if(t.order==="YXZ"){const _=m*v,M=m*g,E=p*v,A=p*g;i[0]=_+A*d,i[4]=E*d-M,i[8]=h*p,i[1]=h*g,i[5]=h*v,i[9]=-d,i[2]=M*d-E,i[6]=A+_*d,i[10]=h*m}else if(t.order==="ZXY"){const _=m*v,M=m*g,E=p*v,A=p*g;i[0]=_-A*d,i[4]=-h*g,i[8]=E+M*d,i[1]=M+E*d,i[5]=h*v,i[9]=A-_*d,i[2]=-h*p,i[6]=d,i[10]=h*m}else if(t.order==="ZYX"){const _=h*v,M=h*g,E=d*v,A=d*g;i[0]=m*v,i[4]=E*p-M,i[8]=_*p+A,i[1]=m*g,i[5]=A*p+_,i[9]=M*p-E,i[2]=-p,i[6]=d*m,i[10]=h*m}else if(t.order==="YZX"){const _=h*m,M=h*p,E=d*m,A=d*p;i[0]=m*v,i[4]=A-_*g,i[8]=E*g+M,i[1]=g,i[5]=h*v,i[9]=-d*v,i[2]=-p*v,i[6]=M*g+E,i[10]=_-A*g}else if(t.order==="XZY"){const _=h*m,M=h*p,E=d*m,A=d*p;i[0]=m*v,i[4]=-g,i[8]=p*v,i[1]=_*g+A,i[5]=h*v,i[9]=M*g-E,i[2]=E*g-M,i[6]=d*v,i[10]=A*g+_}return i[3]=0,i[7]=0,i[11]=0,i[12]=0,i[13]=0,i[14]=0,i[15]=1,this}makeRotationFromQuaternion(t){return this.compose(ZM,t,KM)}lookAt(t,i,s){const l=this.elements;return di.subVectors(t,i),di.lengthSq()===0&&(di.z=1),di.normalize(),cs.crossVectors(s,di),cs.lengthSq()===0&&(Math.abs(s.z)===1?di.x+=1e-4:di.z+=1e-4,di.normalize(),cs.crossVectors(s,di)),cs.normalize(),Nc.crossVectors(di,cs),l[0]=cs.x,l[4]=Nc.x,l[8]=di.x,l[1]=cs.y,l[5]=Nc.y,l[9]=di.y,l[2]=cs.z,l[6]=Nc.z,l[10]=di.z,this}multiply(t){return this.multiplyMatrices(this,t)}premultiply(t){return this.multiplyMatrices(t,this)}multiplyMatrices(t,i){const s=t.elements,l=i.elements,c=this.elements,h=s[0],d=s[4],m=s[8],p=s[12],v=s[1],g=s[5],_=s[9],M=s[13],E=s[2],A=s[6],x=s[10],y=s[14],w=s[3],D=s[7],U=s[11],H=s[15],F=l[0],I=l[4],T=l[8],L=l[12],Q=l[1],P=l[5],W=l[9],J=l[13],rt=l[2],et=l[6],O=l[10],B=l[14],at=l[3],$=l[7],lt=l[11],N=l[15];return c[0]=h*F+d*Q+m*rt+p*at,c[4]=h*I+d*P+m*et+p*$,c[8]=h*T+d*W+m*O+p*lt,c[12]=h*L+d*J+m*B+p*N,c[1]=v*F+g*Q+_*rt+M*at,c[5]=v*I+g*P+_*et+M*$,c[9]=v*T+g*W+_*O+M*lt,c[13]=v*L+g*J+_*B+M*N,c[2]=E*F+A*Q+x*rt+y*at,c[6]=E*I+A*P+x*et+y*$,c[10]=E*T+A*W+x*O+y*lt,c[14]=E*L+A*J+x*B+y*N,c[3]=w*F+D*Q+U*rt+H*at,c[7]=w*I+D*P+U*et+H*$,c[11]=w*T+D*W+U*O+H*lt,c[15]=w*L+D*J+U*B+H*N,this}multiplyScalar(t){const i=this.elements;return i[0]*=t,i[4]*=t,i[8]*=t,i[12]*=t,i[1]*=t,i[5]*=t,i[9]*=t,i[13]*=t,i[2]*=t,i[6]*=t,i[10]*=t,i[14]*=t,i[3]*=t,i[7]*=t,i[11]*=t,i[15]*=t,this}determinant(){const t=this.elements,i=t[0],s=t[4],l=t[8],c=t[12],h=t[1],d=t[5],m=t[9],p=t[13],v=t[2],g=t[6],_=t[10],M=t[14],E=t[3],A=t[7],x=t[11],y=t[15],w=m*M-p*_,D=d*M-p*g,U=d*_-m*g,H=h*M-p*v,F=h*_-m*v,I=h*g-d*v;return i*(A*w-x*D+y*U)-s*(E*w-x*H+y*F)+l*(E*D-A*H+y*I)-c*(E*U-A*F+x*I)}transpose(){const t=this.elements;let i;return i=t[1],t[1]=t[4],t[4]=i,i=t[2],t[2]=t[8],t[8]=i,i=t[6],t[6]=t[9],t[9]=i,i=t[3],t[3]=t[12],t[12]=i,i=t[7],t[7]=t[13],t[13]=i,i=t[11],t[11]=t[14],t[14]=i,this}setPosition(t,i,s){const l=this.elements;return t.isVector3?(l[12]=t.x,l[13]=t.y,l[14]=t.z):(l[12]=t,l[13]=i,l[14]=s),this}invert(){const t=this.elements,i=t[0],s=t[1],l=t[2],c=t[3],h=t[4],d=t[5],m=t[6],p=t[7],v=t[8],g=t[9],_=t[10],M=t[11],E=t[12],A=t[13],x=t[14],y=t[15],w=i*d-s*h,D=i*m-l*h,U=i*p-c*h,H=s*m-l*d,F=s*p-c*d,I=l*p-c*m,T=v*A-g*E,L=v*x-_*E,Q=v*y-M*E,P=g*x-_*A,W=g*y-M*A,J=_*y-M*x,rt=w*J-D*W+U*P+H*Q-F*L+I*T;if(rt===0)return this.set(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0);const et=1/rt;return t[0]=(d*J-m*W+p*P)*et,t[1]=(l*W-s*J-c*P)*et,t[2]=(A*I-x*F+y*H)*et,t[3]=(_*F-g*I-M*H)*et,t[4]=(m*Q-h*J-p*L)*et,t[5]=(i*J-l*Q+c*L)*et,t[6]=(x*U-E*I-y*D)*et,t[7]=(v*I-_*U+M*D)*et,t[8]=(h*W-d*Q+p*T)*et,t[9]=(s*Q-i*W-c*T)*et,t[10]=(E*F-A*U+y*w)*et,t[11]=(g*U-v*F-M*w)*et,t[12]=(d*L-h*P-m*T)*et,t[13]=(i*P-s*L+l*T)*et,t[14]=(A*D-E*H-x*w)*et,t[15]=(v*H-g*D+_*w)*et,this}scale(t){const i=this.elements,s=t.x,l=t.y,c=t.z;return i[0]*=s,i[4]*=l,i[8]*=c,i[1]*=s,i[5]*=l,i[9]*=c,i[2]*=s,i[6]*=l,i[10]*=c,i[3]*=s,i[7]*=l,i[11]*=c,this}getMaxScaleOnAxis(){const t=this.elements,i=t[0]*t[0]+t[1]*t[1]+t[2]*t[2],s=t[4]*t[4]+t[5]*t[5]+t[6]*t[6],l=t[8]*t[8]+t[9]*t[9]+t[10]*t[10];return Math.sqrt(Math.max(i,s,l))}makeTranslation(t,i,s){return t.isVector3?this.set(1,0,0,t.x,0,1,0,t.y,0,0,1,t.z,0,0,0,1):this.set(1,0,0,t,0,1,0,i,0,0,1,s,0,0,0,1),this}makeRotationX(t){const i=Math.cos(t),s=Math.sin(t);return this.set(1,0,0,0,0,i,-s,0,0,s,i,0,0,0,0,1),this}makeRotationY(t){const i=Math.cos(t),s=Math.sin(t);return this.set(i,0,s,0,0,1,0,0,-s,0,i,0,0,0,0,1),this}makeRotationZ(t){const i=Math.cos(t),s=Math.sin(t);return this.set(i,-s,0,0,s,i,0,0,0,0,1,0,0,0,0,1),this}makeRotationAxis(t,i){const s=Math.cos(i),l=Math.sin(i),c=1-s,h=t.x,d=t.y,m=t.z,p=c*h,v=c*d;return this.set(p*h+s,p*d-l*m,p*m+l*d,0,p*d+l*m,v*d+s,v*m-l*h,0,p*m-l*d,v*m+l*h,c*m*m+s,0,0,0,0,1),this}makeScale(t,i,s){return this.set(t,0,0,0,0,i,0,0,0,0,s,0,0,0,0,1),this}makeShear(t,i,s,l,c,h){return this.set(1,s,c,0,t,1,h,0,i,l,1,0,0,0,0,1),this}compose(t,i,s){const l=this.elements,c=i._x,h=i._y,d=i._z,m=i._w,p=c+c,v=h+h,g=d+d,_=c*p,M=c*v,E=c*g,A=h*v,x=h*g,y=d*g,w=m*p,D=m*v,U=m*g,H=s.x,F=s.y,I=s.z;return l[0]=(1-(A+y))*H,l[1]=(M+U)*H,l[2]=(E-D)*H,l[3]=0,l[4]=(M-U)*F,l[5]=(1-(_+y))*F,l[6]=(x+w)*F,l[7]=0,l[8]=(E+D)*I,l[9]=(x-w)*I,l[10]=(1-(_+A))*I,l[11]=0,l[12]=t.x,l[13]=t.y,l[14]=t.z,l[15]=1,this}decompose(t,i,s){const l=this.elements;t.x=l[12],t.y=l[13],t.z=l[14];const c=this.determinant();if(c===0)return s.set(1,1,1),i.identity(),this;let h=Ir.set(l[0],l[1],l[2]).length();const d=Ir.set(l[4],l[5],l[6]).length(),m=Ir.set(l[8],l[9],l[10]).length();c<0&&(h=-h),Pi.copy(this);const p=1/h,v=1/d,g=1/m;return Pi.elements[0]*=p,Pi.elements[1]*=p,Pi.elements[2]*=p,Pi.elements[4]*=v,Pi.elements[5]*=v,Pi.elements[6]*=v,Pi.elements[8]*=g,Pi.elements[9]*=g,Pi.elements[10]*=g,i.setFromRotationMatrix(Pi),s.x=h,s.y=d,s.z=m,this}makePerspective(t,i,s,l,c,h,d=na,m=!1){const p=this.elements,v=2*c/(i-t),g=2*c/(s-l),_=(i+t)/(i-t),M=(s+l)/(s-l);let E,A;if(m)E=c/(h-c),A=h*c/(h-c);else if(d===na)E=-(h+c)/(h-c),A=-2*h*c/(h-c);else if(d===pl)E=-h/(h-c),A=-h*c/(h-c);else throw new Error("THREE.Matrix4.makePerspective(): Invalid coordinate system: "+d);return p[0]=v,p[4]=0,p[8]=_,p[12]=0,p[1]=0,p[5]=g,p[9]=M,p[13]=0,p[2]=0,p[6]=0,p[10]=E,p[14]=A,p[3]=0,p[7]=0,p[11]=-1,p[15]=0,this}makeOrthographic(t,i,s,l,c,h,d=na,m=!1){const p=this.elements,v=2/(i-t),g=2/(s-l),_=-(i+t)/(i-t),M=-(s+l)/(s-l);let E,A;if(m)E=1/(h-c),A=h/(h-c);else if(d===na)E=-2/(h-c),A=-(h+c)/(h-c);else if(d===pl)E=-1/(h-c),A=-c/(h-c);else throw new Error("THREE.Matrix4.makeOrthographic(): Invalid coordinate system: "+d);return p[0]=v,p[4]=0,p[8]=0,p[12]=_,p[1]=0,p[5]=g,p[9]=0,p[13]=M,p[2]=0,p[6]=0,p[10]=E,p[14]=A,p[3]=0,p[7]=0,p[11]=0,p[15]=1,this}equals(t){const i=this.elements,s=t.elements;for(let l=0;l<16;l++)if(i[l]!==s[l])return!1;return!0}fromArray(t,i=0){for(let s=0;s<16;s++)this.elements[s]=t[s+i];return this}toArray(t=[],i=0){const s=this.elements;return t[i]=s[0],t[i+1]=s[1],t[i+2]=s[2],t[i+3]=s[3],t[i+4]=s[4],t[i+5]=s[5],t[i+6]=s[6],t[i+7]=s[7],t[i+8]=s[8],t[i+9]=s[9],t[i+10]=s[10],t[i+11]=s[11],t[i+12]=s[12],t[i+13]=s[13],t[i+14]=s[14],t[i+15]=s[15],t}}const Ir=new j,Pi=new Je,ZM=new j(0,0,0),KM=new j(1,1,1),cs=new j,Nc=new j,di=new j,I_=new Je,F_=new Ss;class ra{constructor(t=0,i=0,s=0,l=ra.DEFAULT_ORDER){this.isEuler=!0,this._x=t,this._y=i,this._z=s,this._order=l}get x(){return this._x}set x(t){this._x=t,this._onChangeCallback()}get y(){return this._y}set y(t){this._y=t,this._onChangeCallback()}get z(){return this._z}set z(t){this._z=t,this._onChangeCallback()}get order(){return this._order}set order(t){this._order=t,this._onChangeCallback()}set(t,i,s,l=this._order){return this._x=t,this._y=i,this._z=s,this._order=l,this._onChangeCallback(),this}clone(){return new this.constructor(this._x,this._y,this._z,this._order)}copy(t){return this._x=t._x,this._y=t._y,this._z=t._z,this._order=t._order,this._onChangeCallback(),this}setFromRotationMatrix(t,i=this._order,s=!0){const l=t.elements,c=l[0],h=l[4],d=l[8],m=l[1],p=l[5],v=l[9],g=l[2],_=l[6],M=l[10];switch(i){case"XYZ":this._y=Math.asin(ce(d,-1,1)),Math.abs(d)<.9999999?(this._x=Math.atan2(-v,M),this._z=Math.atan2(-h,c)):(this._x=Math.atan2(_,p),this._z=0);break;case"YXZ":this._x=Math.asin(-ce(v,-1,1)),Math.abs(v)<.9999999?(this._y=Math.atan2(d,M),this._z=Math.atan2(m,p)):(this._y=Math.atan2(-g,c),this._z=0);break;case"ZXY":this._x=Math.asin(ce(_,-1,1)),Math.abs(_)<.9999999?(this._y=Math.atan2(-g,M),this._z=Math.atan2(-h,p)):(this._y=0,this._z=Math.atan2(m,c));break;case"ZYX":this._y=Math.asin(-ce(g,-1,1)),Math.abs(g)<.9999999?(this._x=Math.atan2(_,M),this._z=Math.atan2(m,c)):(this._x=0,this._z=Math.atan2(-h,p));break;case"YZX":this._z=Math.asin(ce(m,-1,1)),Math.abs(m)<.9999999?(this._x=Math.atan2(-v,p),this._y=Math.atan2(-g,c)):(this._x=0,this._y=Math.atan2(d,M));break;case"XZY":this._z=Math.asin(-ce(h,-1,1)),Math.abs(h)<.9999999?(this._x=Math.atan2(_,p),this._y=Math.atan2(d,c)):(this._x=Math.atan2(-v,M),this._y=0);break;default:ee("Euler: .setFromRotationMatrix() encountered an unknown order: "+i)}return this._order=i,s===!0&&this._onChangeCallback(),this}setFromQuaternion(t,i,s){return I_.makeRotationFromQuaternion(t),this.setFromRotationMatrix(I_,i,s)}setFromVector3(t,i=this._order){return this.set(t.x,t.y,t.z,i)}reorder(t){return F_.setFromEuler(this),this.setFromQuaternion(F_,t)}equals(t){return t._x===this._x&&t._y===this._y&&t._z===this._z&&t._order===this._order}fromArray(t){return this._x=t[0],this._y=t[1],this._z=t[2],t[3]!==void 0&&(this._order=t[3]),this._onChangeCallback(),this}toArray(t=[],i=0){return t[i]=this._x,t[i+1]=this._y,t[i+2]=this._z,t[i+3]=this._order,t}_onChange(t){return this._onChangeCallback=t,this}_onChangeCallback(){}*[Symbol.iterator](){yield this._x,yield this._y,yield this._z,yield this._order}}ra.DEFAULT_ORDER="XYZ";class lx{constructor(){this.mask=1}set(t){this.mask=(1<<t|0)>>>0}enable(t){this.mask|=1<<t|0}enableAll(){this.mask=-1}toggle(t){this.mask^=1<<t|0}disable(t){this.mask&=~(1<<t|0)}disableAll(){this.mask=0}test(t){return(this.mask&t.mask)!==0}isEnabled(t){return(this.mask&(1<<t|0))!==0}}let QM=0;const B_=new j,Fr=new Ss,Aa=new Je,Oc=new j,el=new j,JM=new j,$M=new Ss,H_=new j(1,0,0),G_=new j(0,1,0),V_=new j(0,0,1),k_={type:"added"},tE={type:"removed"},Br={type:"childadded",child:null},Wh={type:"childremoved",child:null};class On extends Js{constructor(){super(),this.isObject3D=!0,Object.defineProperty(this,"id",{value:QM++}),this.uuid=Na(),this.name="",this.type="Object3D",this.parent=null,this.children=[],this.up=On.DEFAULT_UP.clone();const t=new j,i=new ra,s=new Ss,l=new j(1,1,1);function c(){s.setFromEuler(i,!1)}function h(){i.setFromQuaternion(s,void 0,!1)}i._onChange(c),s._onChange(h),Object.defineProperties(this,{position:{configurable:!0,enumerable:!0,value:t},rotation:{configurable:!0,enumerable:!0,value:i},quaternion:{configurable:!0,enumerable:!0,value:s},scale:{configurable:!0,enumerable:!0,value:l},modelViewMatrix:{value:new Je},normalMatrix:{value:new pe}}),this.matrix=new Je,this.matrixWorld=new Je,this.matrixAutoUpdate=On.DEFAULT_MATRIX_AUTO_UPDATE,this.matrixWorldAutoUpdate=On.DEFAULT_MATRIX_WORLD_AUTO_UPDATE,this.matrixWorldNeedsUpdate=!1,this.layers=new lx,this.visible=!0,this.castShadow=!1,this.receiveShadow=!1,this.frustumCulled=!0,this.renderOrder=0,this.animations=[],this.customDepthMaterial=void 0,this.customDistanceMaterial=void 0,this.static=!1,this.userData={},this.pivot=null}onBeforeShadow(){}onAfterShadow(){}onBeforeRender(){}onAfterRender(){}applyMatrix4(t){this.matrixAutoUpdate&&this.updateMatrix(),this.matrix.premultiply(t),this.matrix.decompose(this.position,this.quaternion,this.scale)}applyQuaternion(t){return this.quaternion.premultiply(t),this}setRotationFromAxisAngle(t,i){this.quaternion.setFromAxisAngle(t,i)}setRotationFromEuler(t){this.quaternion.setFromEuler(t,!0)}setRotationFromMatrix(t){this.quaternion.setFromRotationMatrix(t)}setRotationFromQuaternion(t){this.quaternion.copy(t)}rotateOnAxis(t,i){return Fr.setFromAxisAngle(t,i),this.quaternion.multiply(Fr),this}rotateOnWorldAxis(t,i){return Fr.setFromAxisAngle(t,i),this.quaternion.premultiply(Fr),this}rotateX(t){return this.rotateOnAxis(H_,t)}rotateY(t){return this.rotateOnAxis(G_,t)}rotateZ(t){return this.rotateOnAxis(V_,t)}translateOnAxis(t,i){return B_.copy(t).applyQuaternion(this.quaternion),this.position.add(B_.multiplyScalar(i)),this}translateX(t){return this.translateOnAxis(H_,t)}translateY(t){return this.translateOnAxis(G_,t)}translateZ(t){return this.translateOnAxis(V_,t)}localToWorld(t){return this.updateWorldMatrix(!0,!1),t.applyMatrix4(this.matrixWorld)}worldToLocal(t){return this.updateWorldMatrix(!0,!1),t.applyMatrix4(Aa.copy(this.matrixWorld).invert())}lookAt(t,i,s){t.isVector3?Oc.copy(t):Oc.set(t,i,s);const l=this.parent;this.updateWorldMatrix(!0,!1),el.setFromMatrixPosition(this.matrixWorld),this.isCamera||this.isLight?Aa.lookAt(el,Oc,this.up):Aa.lookAt(Oc,el,this.up),this.quaternion.setFromRotationMatrix(Aa),l&&(Aa.extractRotation(l.matrixWorld),Fr.setFromRotationMatrix(Aa),this.quaternion.premultiply(Fr.invert()))}add(t){if(arguments.length>1){for(let i=0;i<arguments.length;i++)this.add(arguments[i]);return this}return t===this?(Ue("Object3D.add: object can't be added as a child of itself.",t),this):(t&&t.isObject3D?(t.removeFromParent(),t.parent=this,this.children.push(t),t.dispatchEvent(k_),Br.child=t,this.dispatchEvent(Br),Br.child=null):Ue("Object3D.add: object not an instance of THREE.Object3D.",t),this)}remove(t){if(arguments.length>1){for(let s=0;s<arguments.length;s++)this.remove(arguments[s]);return this}const i=this.children.indexOf(t);return i!==-1&&(t.parent=null,this.children.splice(i,1),t.dispatchEvent(tE),Wh.child=t,this.dispatchEvent(Wh),Wh.child=null),this}removeFromParent(){const t=this.parent;return t!==null&&t.remove(this),this}clear(){return this.remove(...this.children)}attach(t){return this.updateWorldMatrix(!0,!1),Aa.copy(this.matrixWorld).invert(),t.parent!==null&&(t.parent.updateWorldMatrix(!0,!1),Aa.multiply(t.parent.matrixWorld)),t.applyMatrix4(Aa),t.removeFromParent(),t.parent=this,this.children.push(t),t.updateWorldMatrix(!1,!0),t.dispatchEvent(k_),Br.child=t,this.dispatchEvent(Br),Br.child=null,this}getObjectById(t){return this.getObjectByProperty("id",t)}getObjectByName(t){return this.getObjectByProperty("name",t)}getObjectByProperty(t,i){if(this[t]===i)return this;for(let s=0,l=this.children.length;s<l;s++){const h=this.children[s].getObjectByProperty(t,i);if(h!==void 0)return h}}getObjectsByProperty(t,i,s=[]){this[t]===i&&s.push(this);const l=this.children;for(let c=0,h=l.length;c<h;c++)l[c].getObjectsByProperty(t,i,s);return s}getWorldPosition(t){return this.updateWorldMatrix(!0,!1),t.setFromMatrixPosition(this.matrixWorld)}getWorldQuaternion(t){return this.updateWorldMatrix(!0,!1),this.matrixWorld.decompose(el,t,JM),t}getWorldScale(t){return this.updateWorldMatrix(!0,!1),this.matrixWorld.decompose(el,$M,t),t}getWorldDirection(t){this.updateWorldMatrix(!0,!1);const i=this.matrixWorld.elements;return t.set(i[8],i[9],i[10]).normalize()}raycast(){}traverse(t){t(this);const i=this.children;for(let s=0,l=i.length;s<l;s++)i[s].traverse(t)}traverseVisible(t){if(this.visible===!1)return;t(this);const i=this.children;for(let s=0,l=i.length;s<l;s++)i[s].traverseVisible(t)}traverseAncestors(t){const i=this.parent;i!==null&&(t(i),i.traverseAncestors(t))}updateMatrix(){this.matrix.compose(this.position,this.quaternion,this.scale);const t=this.pivot;if(t!==null){const i=t.x,s=t.y,l=t.z,c=this.matrix.elements;c[12]+=i-c[0]*i-c[4]*s-c[8]*l,c[13]+=s-c[1]*i-c[5]*s-c[9]*l,c[14]+=l-c[2]*i-c[6]*s-c[10]*l}this.matrixWorldNeedsUpdate=!0}updateMatrixWorld(t){this.matrixAutoUpdate&&this.updateMatrix(),(this.matrixWorldNeedsUpdate||t)&&(this.matrixWorldAutoUpdate===!0&&(this.parent===null?this.matrixWorld.copy(this.matrix):this.matrixWorld.multiplyMatrices(this.parent.matrixWorld,this.matrix)),this.matrixWorldNeedsUpdate=!1,t=!0);const i=this.children;for(let s=0,l=i.length;s<l;s++)i[s].updateMatrixWorld(t)}updateWorldMatrix(t,i){const s=this.parent;if(t===!0&&s!==null&&s.updateWorldMatrix(!0,!1),this.matrixAutoUpdate&&this.updateMatrix(),this.matrixWorldAutoUpdate===!0&&(this.parent===null?this.matrixWorld.copy(this.matrix):this.matrixWorld.multiplyMatrices(this.parent.matrixWorld,this.matrix)),i===!0){const l=this.children;for(let c=0,h=l.length;c<h;c++)l[c].updateWorldMatrix(!1,!0)}}toJSON(t){const i=t===void 0||typeof t=="string",s={};i&&(t={geometries:{},materials:{},textures:{},images:{},shapes:{},skeletons:{},animations:{},nodes:{}},s.metadata={version:4.7,type:"Object",generator:"Object3D.toJSON"});const l={};l.uuid=this.uuid,l.type=this.type,this.name!==""&&(l.name=this.name),this.castShadow===!0&&(l.castShadow=!0),this.receiveShadow===!0&&(l.receiveShadow=!0),this.visible===!1&&(l.visible=!1),this.frustumCulled===!1&&(l.frustumCulled=!1),this.renderOrder!==0&&(l.renderOrder=this.renderOrder),this.static!==!1&&(l.static=this.static),Object.keys(this.userData).length>0&&(l.userData=this.userData),l.layers=this.layers.mask,l.matrix=this.matrix.toArray(),l.up=this.up.toArray(),this.pivot!==null&&(l.pivot=this.pivot.toArray()),this.matrixAutoUpdate===!1&&(l.matrixAutoUpdate=!1),this.morphTargetDictionary!==void 0&&(l.morphTargetDictionary=Object.assign({},this.morphTargetDictionary)),this.morphTargetInfluences!==void 0&&(l.morphTargetInfluences=this.morphTargetInfluences.slice()),this.isInstancedMesh&&(l.type="InstancedMesh",l.count=this.count,l.instanceMatrix=this.instanceMatrix.toJSON(),this.instanceColor!==null&&(l.instanceColor=this.instanceColor.toJSON())),this.isBatchedMesh&&(l.type="BatchedMesh",l.perObjectFrustumCulled=this.perObjectFrustumCulled,l.sortObjects=this.sortObjects,l.drawRanges=this._drawRanges,l.reservedRanges=this._reservedRanges,l.geometryInfo=this._geometryInfo.map(d=>({...d,boundingBox:d.boundingBox?d.boundingBox.toJSON():void 0,boundingSphere:d.boundingSphere?d.boundingSphere.toJSON():void 0})),l.instanceInfo=this._instanceInfo.map(d=>({...d})),l.availableInstanceIds=this._availableInstanceIds.slice(),l.availableGeometryIds=this._availableGeometryIds.slice(),l.nextIndexStart=this._nextIndexStart,l.nextVertexStart=this._nextVertexStart,l.geometryCount=this._geometryCount,l.maxInstanceCount=this._maxInstanceCount,l.maxVertexCount=this._maxVertexCount,l.maxIndexCount=this._maxIndexCount,l.geometryInitialized=this._geometryInitialized,l.matricesTexture=this._matricesTexture.toJSON(t),l.indirectTexture=this._indirectTexture.toJSON(t),this._colorsTexture!==null&&(l.colorsTexture=this._colorsTexture.toJSON(t)),this.boundingSphere!==null&&(l.boundingSphere=this.boundingSphere.toJSON()),this.boundingBox!==null&&(l.boundingBox=this.boundingBox.toJSON()));function c(d,m){return d[m.uuid]===void 0&&(d[m.uuid]=m.toJSON(t)),m.uuid}if(this.isScene)this.background&&(this.background.isColor?l.background=this.background.toJSON():this.background.isTexture&&(l.background=this.background.toJSON(t).uuid)),this.environment&&this.environment.isTexture&&this.environment.isRenderTargetTexture!==!0&&(l.environment=this.environment.toJSON(t).uuid);else if(this.isMesh||this.isLine||this.isPoints){l.geometry=c(t.geometries,this.geometry);const d=this.geometry.parameters;if(d!==void 0&&d.shapes!==void 0){const m=d.shapes;if(Array.isArray(m))for(let p=0,v=m.length;p<v;p++){const g=m[p];c(t.shapes,g)}else c(t.shapes,m)}}if(this.isSkinnedMesh&&(l.bindMode=this.bindMode,l.bindMatrix=this.bindMatrix.toArray(),this.skeleton!==void 0&&(c(t.skeletons,this.skeleton),l.skeleton=this.skeleton.uuid)),this.material!==void 0)if(Array.isArray(this.material)){const d=[];for(let m=0,p=this.material.length;m<p;m++)d.push(c(t.materials,this.material[m]));l.material=d}else l.material=c(t.materials,this.material);if(this.children.length>0){l.children=[];for(let d=0;d<this.children.length;d++)l.children.push(this.children[d].toJSON(t).object)}if(this.animations.length>0){l.animations=[];for(let d=0;d<this.animations.length;d++){const m=this.animations[d];l.animations.push(c(t.animations,m))}}if(i){const d=h(t.geometries),m=h(t.materials),p=h(t.textures),v=h(t.images),g=h(t.shapes),_=h(t.skeletons),M=h(t.animations),E=h(t.nodes);d.length>0&&(s.geometries=d),m.length>0&&(s.materials=m),p.length>0&&(s.textures=p),v.length>0&&(s.images=v),g.length>0&&(s.shapes=g),_.length>0&&(s.skeletons=_),M.length>0&&(s.animations=M),E.length>0&&(s.nodes=E)}return s.object=l,s;function h(d){const m=[];for(const p in d){const v=d[p];delete v.metadata,m.push(v)}return m}}clone(t){return new this.constructor().copy(this,t)}copy(t,i=!0){if(this.name=t.name,this.up.copy(t.up),this.position.copy(t.position),this.rotation.order=t.rotation.order,this.quaternion.copy(t.quaternion),this.scale.copy(t.scale),t.pivot!==null&&(this.pivot=t.pivot.clone()),this.matrix.copy(t.matrix),this.matrixWorld.copy(t.matrixWorld),this.matrixAutoUpdate=t.matrixAutoUpdate,this.matrixWorldAutoUpdate=t.matrixWorldAutoUpdate,this.matrixWorldNeedsUpdate=t.matrixWorldNeedsUpdate,this.layers.mask=t.layers.mask,this.visible=t.visible,this.castShadow=t.castShadow,this.receiveShadow=t.receiveShadow,this.frustumCulled=t.frustumCulled,this.renderOrder=t.renderOrder,this.static=t.static,this.animations=t.animations.slice(),this.userData=JSON.parse(JSON.stringify(t.userData)),i===!0)for(let s=0;s<t.children.length;s++){const l=t.children[s];this.add(l.clone())}return this}}On.DEFAULT_UP=new j(0,1,0);On.DEFAULT_MATRIX_AUTO_UPDATE=!0;On.DEFAULT_MATRIX_WORLD_AUTO_UPDATE=!0;class Pc extends On{constructor(){super(),this.isGroup=!0,this.type="Group"}}const eE={type:"move"};class qh{constructor(){this._targetRay=null,this._grip=null,this._hand=null}getHandSpace(){return this._hand===null&&(this._hand=new Pc,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 Pc,this._targetRay.matrixAutoUpdate=!1,this._targetRay.visible=!1,this._targetRay.hasLinearVelocity=!1,this._targetRay.linearVelocity=new j,this._targetRay.hasAngularVelocity=!1,this._targetRay.angularVelocity=new j),this._targetRay}getGripSpace(){return this._grip===null&&(this._grip=new Pc,this._grip.matrixAutoUpdate=!1,this._grip.visible=!1,this._grip.hasLinearVelocity=!1,this._grip.linearVelocity=new j,this._grip.hasAngularVelocity=!1,this._grip.angularVelocity=new j),this._grip}dispatchEvent(t){return this._targetRay!==null&&this._targetRay.dispatchEvent(t),this._grip!==null&&this._grip.dispatchEvent(t),this._hand!==null&&this._hand.dispatchEvent(t),this}connect(t){if(t&&t.hand){const i=this._hand;if(i)for(const s of t.hand.values())this._getHandJoint(i,s)}return this.dispatchEvent({type:"connected",data:t}),this}disconnect(t){return this.dispatchEvent({type:"disconnected",data:t}),this._targetRay!==null&&(this._targetRay.visible=!1),this._grip!==null&&(this._grip.visible=!1),this._hand!==null&&(this._hand.visible=!1),this}update(t,i,s){let l=null,c=null,h=null;const d=this._targetRay,m=this._grip,p=this._hand;if(t&&i.session.visibilityState!=="visible-blurred"){if(p&&t.hand){h=!0;for(const A of t.hand.values()){const x=i.getJointPose(A,s),y=this._getHandJoint(p,A);x!==null&&(y.matrix.fromArray(x.transform.matrix),y.matrix.decompose(y.position,y.rotation,y.scale),y.matrixWorldNeedsUpdate=!0,y.jointRadius=x.radius),y.visible=x!==null}const v=p.joints["index-finger-tip"],g=p.joints["thumb-tip"],_=v.position.distanceTo(g.position),M=.02,E=.005;p.inputState.pinching&&_>M+E?(p.inputState.pinching=!1,this.dispatchEvent({type:"pinchend",handedness:t.handedness,target:this})):!p.inputState.pinching&&_<=M-E&&(p.inputState.pinching=!0,this.dispatchEvent({type:"pinchstart",handedness:t.handedness,target:this}))}else m!==null&&t.gripSpace&&(c=i.getPose(t.gripSpace,s),c!==null&&(m.matrix.fromArray(c.transform.matrix),m.matrix.decompose(m.position,m.rotation,m.scale),m.matrixWorldNeedsUpdate=!0,c.linearVelocity?(m.hasLinearVelocity=!0,m.linearVelocity.copy(c.linearVelocity)):m.hasLinearVelocity=!1,c.angularVelocity?(m.hasAngularVelocity=!0,m.angularVelocity.copy(c.angularVelocity)):m.hasAngularVelocity=!1));d!==null&&(l=i.getPose(t.targetRaySpace,s),l===null&&c!==null&&(l=c),l!==null&&(d.matrix.fromArray(l.transform.matrix),d.matrix.decompose(d.position,d.rotation,d.scale),d.matrixWorldNeedsUpdate=!0,l.linearVelocity?(d.hasLinearVelocity=!0,d.linearVelocity.copy(l.linearVelocity)):d.hasLinearVelocity=!1,l.angularVelocity?(d.hasAngularVelocity=!0,d.angularVelocity.copy(l.angularVelocity)):d.hasAngularVelocity=!1,this.dispatchEvent(eE)))}return d!==null&&(d.visible=l!==null),m!==null&&(m.visible=c!==null),p!==null&&(p.visible=h!==null),this}_getHandJoint(t,i){if(t.joints[i.jointName]===void 0){const s=new Pc;s.matrixAutoUpdate=!1,s.visible=!1,t.joints[i.jointName]=s,t.add(s)}return t.joints[i.jointName]}}const cx={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},us={h:0,s:0,l:0},zc={h:0,s:0,l:0};function Yh(r,t,i){return i<0&&(i+=1),i>1&&(i-=1),i<1/6?r+(t-r)*6*i:i<1/2?t:i<2/3?r+(t-r)*6*(2/3-i):r}class Se{constructor(t,i,s){return this.isColor=!0,this.r=1,this.g=1,this.b=1,this.set(t,i,s)}set(t,i,s){if(i===void 0&&s===void 0){const l=t;l&&l.isColor?this.copy(l):typeof l=="number"?this.setHex(l):typeof l=="string"&&this.setStyle(l)}else this.setRGB(t,i,s);return this}setScalar(t){return this.r=t,this.g=t,this.b=t,this}setHex(t,i=Ri){return t=Math.floor(t),this.r=(t>>16&255)/255,this.g=(t>>8&255)/255,this.b=(t&255)/255,Re.colorSpaceToWorking(this,i),this}setRGB(t,i,s,l=Re.workingColorSpace){return this.r=t,this.g=i,this.b=s,Re.colorSpaceToWorking(this,l),this}setHSL(t,i,s,l=Re.workingColorSpace){if(t=wp(t,1),i=ce(i,0,1),s=ce(s,0,1),i===0)this.r=this.g=this.b=s;else{const c=s<=.5?s*(1+i):s+i-s*i,h=2*s-c;this.r=Yh(h,c,t+1/3),this.g=Yh(h,c,t),this.b=Yh(h,c,t-1/3)}return Re.colorSpaceToWorking(this,l),this}setStyle(t,i=Ri){function s(c){c!==void 0&&parseFloat(c)<1&&ee("Color: Alpha component of "+t+" will be ignored.")}let l;if(l=/^(\w+)\(([^\)]*)\)/.exec(t)){let c;const h=l[1],d=l[2];switch(h){case"rgb":case"rgba":if(c=/^\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec(d))return s(c[4]),this.setRGB(Math.min(255,parseInt(c[1],10))/255,Math.min(255,parseInt(c[2],10))/255,Math.min(255,parseInt(c[3],10))/255,i);if(c=/^\s*(\d+)\%\s*,\s*(\d+)\%\s*,\s*(\d+)\%\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec(d))return s(c[4]),this.setRGB(Math.min(100,parseInt(c[1],10))/100,Math.min(100,parseInt(c[2],10))/100,Math.min(100,parseInt(c[3],10))/100,i);break;case"hsl":case"hsla":if(c=/^\s*(\d*\.?\d+)\s*,\s*(\d*\.?\d+)\%\s*,\s*(\d*\.?\d+)\%\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec(d))return s(c[4]),this.setHSL(parseFloat(c[1])/360,parseFloat(c[2])/100,parseFloat(c[3])/100,i);break;default:ee("Color: Unknown color model "+t)}}else if(l=/^\#([A-Fa-f\d]+)$/.exec(t)){const c=l[1],h=c.length;if(h===3)return this.setRGB(parseInt(c.charAt(0),16)/15,parseInt(c.charAt(1),16)/15,parseInt(c.charAt(2),16)/15,i);if(h===6)return this.setHex(parseInt(c,16),i);ee("Color: Invalid hex color "+t)}else if(t&&t.length>0)return this.setColorName(t,i);return this}setColorName(t,i=Ri){const s=cx[t.toLowerCase()];return s!==void 0?this.setHex(s,i):ee("Color: Unknown color "+t),this}clone(){return new this.constructor(this.r,this.g,this.b)}copy(t){return this.r=t.r,this.g=t.g,this.b=t.b,this}copySRGBToLinear(t){return this.r=Oa(t.r),this.g=Oa(t.g),this.b=Oa(t.b),this}copyLinearToSRGB(t){return this.r=to(t.r),this.g=to(t.g),this.b=to(t.b),this}convertSRGBToLinear(){return this.copySRGBToLinear(this),this}convertLinearToSRGB(){return this.copyLinearToSRGB(this),this}getHex(t=Ri){return Re.workingToColorSpace(Fn.copy(this),t),Math.round(ce(Fn.r*255,0,255))*65536+Math.round(ce(Fn.g*255,0,255))*256+Math.round(ce(Fn.b*255,0,255))}getHexString(t=Ri){return("000000"+this.getHex(t).toString(16)).slice(-6)}getHSL(t,i=Re.workingColorSpace){Re.workingToColorSpace(Fn.copy(this),i);const s=Fn.r,l=Fn.g,c=Fn.b,h=Math.max(s,l,c),d=Math.min(s,l,c);let m,p;const v=(d+h)/2;if(d===h)m=0,p=0;else{const g=h-d;switch(p=v<=.5?g/(h+d):g/(2-h-d),h){case s:m=(l-c)/g+(l<c?6:0);break;case l:m=(c-s)/g+2;break;case c:m=(s-l)/g+4;break}m/=6}return t.h=m,t.s=p,t.l=v,t}getRGB(t,i=Re.workingColorSpace){return Re.workingToColorSpace(Fn.copy(this),i),t.r=Fn.r,t.g=Fn.g,t.b=Fn.b,t}getStyle(t=Ri){Re.workingToColorSpace(Fn.copy(this),t);const i=Fn.r,s=Fn.g,l=Fn.b;return t!==Ri?`color(${t} ${i.toFixed(3)} ${s.toFixed(3)} ${l.toFixed(3)})`:`rgb(${Math.round(i*255)},${Math.round(s*255)},${Math.round(l*255)})`}offsetHSL(t,i,s){return this.getHSL(us),this.setHSL(us.h+t,us.s+i,us.l+s)}add(t){return this.r+=t.r,this.g+=t.g,this.b+=t.b,this}addColors(t,i){return this.r=t.r+i.r,this.g=t.g+i.g,this.b=t.b+i.b,this}addScalar(t){return this.r+=t,this.g+=t,this.b+=t,this}sub(t){return this.r=Math.max(0,this.r-t.r),this.g=Math.max(0,this.g-t.g),this.b=Math.max(0,this.b-t.b),this}multiply(t){return this.r*=t.r,this.g*=t.g,this.b*=t.b,this}multiplyScalar(t){return this.r*=t,this.g*=t,this.b*=t,this}lerp(t,i){return this.r+=(t.r-this.r)*i,this.g+=(t.g-this.g)*i,this.b+=(t.b-this.b)*i,this}lerpColors(t,i,s){return this.r=t.r+(i.r-t.r)*s,this.g=t.g+(i.g-t.g)*s,this.b=t.b+(i.b-t.b)*s,this}lerpHSL(t,i){this.getHSL(us),t.getHSL(zc);const s=fl(us.h,zc.h,i),l=fl(us.s,zc.s,i),c=fl(us.l,zc.l,i);return this.setHSL(s,l,c),this}setFromVector3(t){return this.r=t.x,this.g=t.y,this.b=t.z,this}applyMatrix3(t){const i=this.r,s=this.g,l=this.b,c=t.elements;return this.r=c[0]*i+c[3]*s+c[6]*l,this.g=c[1]*i+c[4]*s+c[7]*l,this.b=c[2]*i+c[5]*s+c[8]*l,this}equals(t){return t.r===this.r&&t.g===this.g&&t.b===this.b}fromArray(t,i=0){return this.r=t[i],this.g=t[i+1],this.b=t[i+2],this}toArray(t=[],i=0){return t[i]=this.r,t[i+1]=this.g,t[i+2]=this.b,t}fromBufferAttribute(t,i){return this.r=t.getX(i),this.g=t.getY(i),this.b=t.getZ(i),this}toJSON(){return this.getHex()}*[Symbol.iterator](){yield this.r,yield this.g,yield this.b}}const Fn=new Se;Se.NAMES=cx;class nE extends On{constructor(){super(),this.isScene=!0,this.type="Scene",this.background=null,this.environment=null,this.fog=null,this.backgroundBlurriness=0,this.backgroundIntensity=1,this.backgroundRotation=new ra,this.environmentIntensity=1,this.environmentRotation=new ra,this.overrideMaterial=null,typeof __THREE_DEVTOOLS__<"u"&&__THREE_DEVTOOLS__.dispatchEvent(new CustomEvent("observe",{detail:this}))}copy(t,i){return super.copy(t,i),t.background!==null&&(this.background=t.background.clone()),t.environment!==null&&(this.environment=t.environment.clone()),t.fog!==null&&(this.fog=t.fog.clone()),this.backgroundBlurriness=t.backgroundBlurriness,this.backgroundIntensity=t.backgroundIntensity,this.backgroundRotation.copy(t.backgroundRotation),this.environmentIntensity=t.environmentIntensity,this.environmentRotation.copy(t.environmentRotation),t.overrideMaterial!==null&&(this.overrideMaterial=t.overrideMaterial.clone()),this.matrixAutoUpdate=t.matrixAutoUpdate,this}toJSON(t){const i=super.toJSON(t);return this.fog!==null&&(i.object.fog=this.fog.toJSON()),this.backgroundBlurriness>0&&(i.object.backgroundBlurriness=this.backgroundBlurriness),this.backgroundIntensity!==1&&(i.object.backgroundIntensity=this.backgroundIntensity),i.object.backgroundRotation=this.backgroundRotation.toArray(),this.environmentIntensity!==1&&(i.object.environmentIntensity=this.environmentIntensity),i.object.environmentRotation=this.environmentRotation.toArray(),i}}const zi=new j,Ra=new j,jh=new j,Ca=new j,Hr=new j,Gr=new j,X_=new j,Zh=new j,Kh=new j,Qh=new j,Jh=new We,$h=new We,td=new We;class Vi{constructor(t=new j,i=new j,s=new j){this.a=t,this.b=i,this.c=s}static getNormal(t,i,s,l){l.subVectors(s,i),zi.subVectors(t,i),l.cross(zi);const c=l.lengthSq();return c>0?l.multiplyScalar(1/Math.sqrt(c)):l.set(0,0,0)}static getBarycoord(t,i,s,l,c){zi.subVectors(l,i),Ra.subVectors(s,i),jh.subVectors(t,i);const h=zi.dot(zi),d=zi.dot(Ra),m=zi.dot(jh),p=Ra.dot(Ra),v=Ra.dot(jh),g=h*p-d*d;if(g===0)return c.set(0,0,0),null;const _=1/g,M=(p*m-d*v)*_,E=(h*v-d*m)*_;return c.set(1-M-E,E,M)}static containsPoint(t,i,s,l){return this.getBarycoord(t,i,s,l,Ca)===null?!1:Ca.x>=0&&Ca.y>=0&&Ca.x+Ca.y<=1}static getInterpolation(t,i,s,l,c,h,d,m){return this.getBarycoord(t,i,s,l,Ca)===null?(m.x=0,m.y=0,"z"in m&&(m.z=0),"w"in m&&(m.w=0),null):(m.setScalar(0),m.addScaledVector(c,Ca.x),m.addScaledVector(h,Ca.y),m.addScaledVector(d,Ca.z),m)}static getInterpolatedAttribute(t,i,s,l,c,h){return Jh.setScalar(0),$h.setScalar(0),td.setScalar(0),Jh.fromBufferAttribute(t,i),$h.fromBufferAttribute(t,s),td.fromBufferAttribute(t,l),h.setScalar(0),h.addScaledVector(Jh,c.x),h.addScaledVector($h,c.y),h.addScaledVector(td,c.z),h}static isFrontFacing(t,i,s,l){return zi.subVectors(s,i),Ra.subVectors(t,i),zi.cross(Ra).dot(l)<0}set(t,i,s){return this.a.copy(t),this.b.copy(i),this.c.copy(s),this}setFromPointsAndIndices(t,i,s,l){return this.a.copy(t[i]),this.b.copy(t[s]),this.c.copy(t[l]),this}setFromAttributeAndIndices(t,i,s,l){return this.a.fromBufferAttribute(t,i),this.b.fromBufferAttribute(t,s),this.c.fromBufferAttribute(t,l),this}clone(){return new this.constructor().copy(this)}copy(t){return this.a.copy(t.a),this.b.copy(t.b),this.c.copy(t.c),this}getArea(){return zi.subVectors(this.c,this.b),Ra.subVectors(this.a,this.b),zi.cross(Ra).length()*.5}getMidpoint(t){return t.addVectors(this.a,this.b).add(this.c).multiplyScalar(1/3)}getNormal(t){return Vi.getNormal(this.a,this.b,this.c,t)}getPlane(t){return t.setFromCoplanarPoints(this.a,this.b,this.c)}getBarycoord(t,i){return Vi.getBarycoord(t,this.a,this.b,this.c,i)}getInterpolation(t,i,s,l,c){return Vi.getInterpolation(t,this.a,this.b,this.c,i,s,l,c)}containsPoint(t){return Vi.containsPoint(t,this.a,this.b,this.c)}isFrontFacing(t){return Vi.isFrontFacing(this.a,this.b,this.c,t)}intersectsBox(t){return t.intersectsTriangle(this)}closestPointToPoint(t,i){const s=this.a,l=this.b,c=this.c;let h,d;Hr.subVectors(l,s),Gr.subVectors(c,s),Zh.subVectors(t,s);const m=Hr.dot(Zh),p=Gr.dot(Zh);if(m<=0&&p<=0)return i.copy(s);Kh.subVectors(t,l);const v=Hr.dot(Kh),g=Gr.dot(Kh);if(v>=0&&g<=v)return i.copy(l);const _=m*g-v*p;if(_<=0&&m>=0&&v<=0)return h=m/(m-v),i.copy(s).addScaledVector(Hr,h);Qh.subVectors(t,c);const M=Hr.dot(Qh),E=Gr.dot(Qh);if(E>=0&&M<=E)return i.copy(c);const A=M*p-m*E;if(A<=0&&p>=0&&E<=0)return d=p/(p-E),i.copy(s).addScaledVector(Gr,d);const x=v*E-M*g;if(x<=0&&g-v>=0&&M-E>=0)return X_.subVectors(c,l),d=(g-v)/(g-v+(M-E)),i.copy(l).addScaledVector(X_,d);const y=1/(x+A+_);return h=A*y,d=_*y,i.copy(s).addScaledVector(Hr,h).addScaledVector(Gr,d)}equals(t){return t.a.equals(this.a)&&t.b.equals(this.b)&&t.c.equals(this.c)}}class ys{constructor(t=new j(1/0,1/0,1/0),i=new j(-1/0,-1/0,-1/0)){this.isBox3=!0,this.min=t,this.max=i}set(t,i){return this.min.copy(t),this.max.copy(i),this}setFromArray(t){this.makeEmpty();for(let i=0,s=t.length;i<s;i+=3)this.expandByPoint(Ii.fromArray(t,i));return this}setFromBufferAttribute(t){this.makeEmpty();for(let i=0,s=t.count;i<s;i++)this.expandByPoint(Ii.fromBufferAttribute(t,i));return this}setFromPoints(t){this.makeEmpty();for(let i=0,s=t.length;i<s;i++)this.expandByPoint(t[i]);return this}setFromCenterAndSize(t,i){const s=Ii.copy(i).multiplyScalar(.5);return this.min.copy(t).sub(s),this.max.copy(t).add(s),this}setFromObject(t,i=!1){return this.makeEmpty(),this.expandByObject(t,i)}clone(){return new this.constructor().copy(this)}copy(t){return this.min.copy(t.min),this.max.copy(t.max),this}makeEmpty(){return this.min.x=this.min.y=this.min.z=1/0,this.max.x=this.max.y=this.max.z=-1/0,this}isEmpty(){return this.max.x<this.min.x||this.max.y<this.min.y||this.max.z<this.min.z}getCenter(t){return this.isEmpty()?t.set(0,0,0):t.addVectors(this.min,this.max).multiplyScalar(.5)}getSize(t){return this.isEmpty()?t.set(0,0,0):t.subVectors(this.max,this.min)}expandByPoint(t){return this.min.min(t),this.max.max(t),this}expandByVector(t){return this.min.sub(t),this.max.add(t),this}expandByScalar(t){return this.min.addScalar(-t),this.max.addScalar(t),this}expandByObject(t,i=!1){t.updateWorldMatrix(!1,!1);const s=t.geometry;if(s!==void 0){const c=s.getAttribute("position");if(i===!0&&c!==void 0&&t.isInstancedMesh!==!0)for(let h=0,d=c.count;h<d;h++)t.isMesh===!0?t.getVertexPosition(h,Ii):Ii.fromBufferAttribute(c,h),Ii.applyMatrix4(t.matrixWorld),this.expandByPoint(Ii);else t.boundingBox!==void 0?(t.boundingBox===null&&t.computeBoundingBox(),Ic.copy(t.boundingBox)):(s.boundingBox===null&&s.computeBoundingBox(),Ic.copy(s.boundingBox)),Ic.applyMatrix4(t.matrixWorld),this.union(Ic)}const l=t.children;for(let c=0,h=l.length;c<h;c++)this.expandByObject(l[c],i);return this}containsPoint(t){return t.x>=this.min.x&&t.x<=this.max.x&&t.y>=this.min.y&&t.y<=this.max.y&&t.z>=this.min.z&&t.z<=this.max.z}containsBox(t){return this.min.x<=t.min.x&&t.max.x<=this.max.x&&this.min.y<=t.min.y&&t.max.y<=this.max.y&&this.min.z<=t.min.z&&t.max.z<=this.max.z}getParameter(t,i){return i.set((t.x-this.min.x)/(this.max.x-this.min.x),(t.y-this.min.y)/(this.max.y-this.min.y),(t.z-this.min.z)/(this.max.z-this.min.z))}intersectsBox(t){return t.max.x>=this.min.x&&t.min.x<=this.max.x&&t.max.y>=this.min.y&&t.min.y<=this.max.y&&t.max.z>=this.min.z&&t.min.z<=this.max.z}intersectsSphere(t){return this.clampPoint(t.center,Ii),Ii.distanceToSquared(t.center)<=t.radius*t.radius}intersectsPlane(t){let i,s;return t.normal.x>0?(i=t.normal.x*this.min.x,s=t.normal.x*this.max.x):(i=t.normal.x*this.max.x,s=t.normal.x*this.min.x),t.normal.y>0?(i+=t.normal.y*this.min.y,s+=t.normal.y*this.max.y):(i+=t.normal.y*this.max.y,s+=t.normal.y*this.min.y),t.normal.z>0?(i+=t.normal.z*this.min.z,s+=t.normal.z*this.max.z):(i+=t.normal.z*this.max.z,s+=t.normal.z*this.min.z),i<=-t.constant&&s>=-t.constant}intersectsTriangle(t){if(this.isEmpty())return!1;this.getCenter(nl),Fc.subVectors(this.max,nl),Vr.subVectors(t.a,nl),kr.subVectors(t.b,nl),Xr.subVectors(t.c,nl),fs.subVectors(kr,Vr),hs.subVectors(Xr,kr),Hs.subVectors(Vr,Xr);let i=[0,-fs.z,fs.y,0,-hs.z,hs.y,0,-Hs.z,Hs.y,fs.z,0,-fs.x,hs.z,0,-hs.x,Hs.z,0,-Hs.x,-fs.y,fs.x,0,-hs.y,hs.x,0,-Hs.y,Hs.x,0];return!ed(i,Vr,kr,Xr,Fc)||(i=[1,0,0,0,1,0,0,0,1],!ed(i,Vr,kr,Xr,Fc))?!1:(Bc.crossVectors(fs,hs),i=[Bc.x,Bc.y,Bc.z],ed(i,Vr,kr,Xr,Fc))}clampPoint(t,i){return i.copy(t).clamp(this.min,this.max)}distanceToPoint(t){return this.clampPoint(t,Ii).distanceTo(t)}getBoundingSphere(t){return this.isEmpty()?t.makeEmpty():(this.getCenter(t.center),t.radius=this.getSize(Ii).length()*.5),t}intersect(t){return this.min.max(t.min),this.max.min(t.max),this.isEmpty()&&this.makeEmpty(),this}union(t){return this.min.min(t.min),this.max.max(t.max),this}applyMatrix4(t){return this.isEmpty()?this:(wa[0].set(this.min.x,this.min.y,this.min.z).applyMatrix4(t),wa[1].set(this.min.x,this.min.y,this.max.z).applyMatrix4(t),wa[2].set(this.min.x,this.max.y,this.min.z).applyMatrix4(t),wa[3].set(this.min.x,this.max.y,this.max.z).applyMatrix4(t),wa[4].set(this.max.x,this.min.y,this.min.z).applyMatrix4(t),wa[5].set(this.max.x,this.min.y,this.max.z).applyMatrix4(t),wa[6].set(this.max.x,this.max.y,this.min.z).applyMatrix4(t),wa[7].set(this.max.x,this.max.y,this.max.z).applyMatrix4(t),this.setFromPoints(wa),this)}translate(t){return this.min.add(t),this.max.add(t),this}equals(t){return t.min.equals(this.min)&&t.max.equals(this.max)}toJSON(){return{min:this.min.toArray(),max:this.max.toArray()}}fromJSON(t){return this.min.fromArray(t.min),this.max.fromArray(t.max),this}}const wa=[new j,new j,new j,new j,new j,new j,new j,new j],Ii=new j,Ic=new ys,Vr=new j,kr=new j,Xr=new j,fs=new j,hs=new j,Hs=new j,nl=new j,Fc=new j,Bc=new j,Gs=new j;function ed(r,t,i,s,l){for(let c=0,h=r.length-3;c<=h;c+=3){Gs.fromArray(r,c);const d=l.x*Math.abs(Gs.x)+l.y*Math.abs(Gs.y)+l.z*Math.abs(Gs.z),m=t.dot(Gs),p=i.dot(Gs),v=s.dot(Gs);if(Math.max(-Math.max(m,p,v),Math.min(m,p,v))>d)return!1}return!0}const dn=new j,Hc=new le;let iE=0;class gi{constructor(t,i,s=!1){if(Array.isArray(t))throw new TypeError("THREE.BufferAttribute: array should be a Typed Array.");this.isBufferAttribute=!0,Object.defineProperty(this,"id",{value:iE++}),this.name="",this.array=t,this.itemSize=i,this.count=t!==void 0?t.length/i:0,this.normalized=s,this.usage=fp,this.updateRanges=[],this.gpuType=ea,this.version=0}onUploadCallback(){}set needsUpdate(t){t===!0&&this.version++}setUsage(t){return this.usage=t,this}addUpdateRange(t,i){this.updateRanges.push({start:t,count:i})}clearUpdateRanges(){this.updateRanges.length=0}copy(t){return this.name=t.name,this.array=new t.array.constructor(t.array),this.itemSize=t.itemSize,this.count=t.count,this.normalized=t.normalized,this.usage=t.usage,this.gpuType=t.gpuType,this}copyAt(t,i,s){t*=this.itemSize,s*=i.itemSize;for(let l=0,c=this.itemSize;l<c;l++)this.array[t+l]=i.array[s+l];return this}copyArray(t){return this.array.set(t),this}applyMatrix3(t){if(this.itemSize===2)for(let i=0,s=this.count;i<s;i++)Hc.fromBufferAttribute(this,i),Hc.applyMatrix3(t),this.setXY(i,Hc.x,Hc.y);else if(this.itemSize===3)for(let i=0,s=this.count;i<s;i++)dn.fromBufferAttribute(this,i),dn.applyMatrix3(t),this.setXYZ(i,dn.x,dn.y,dn.z);return this}applyMatrix4(t){for(let i=0,s=this.count;i<s;i++)dn.fromBufferAttribute(this,i),dn.applyMatrix4(t),this.setXYZ(i,dn.x,dn.y,dn.z);return this}applyNormalMatrix(t){for(let i=0,s=this.count;i<s;i++)dn.fromBufferAttribute(this,i),dn.applyNormalMatrix(t),this.setXYZ(i,dn.x,dn.y,dn.z);return this}transformDirection(t){for(let i=0,s=this.count;i<s;i++)dn.fromBufferAttribute(this,i),dn.transformDirection(t),this.setXYZ(i,dn.x,dn.y,dn.z);return this}set(t,i=0){return this.array.set(t,i),this}getComponent(t,i){let s=this.array[t*this.itemSize+i];return this.normalized&&(s=Gi(s,this.array)),s}setComponent(t,i,s){return this.normalized&&(s=Be(s,this.array)),this.array[t*this.itemSize+i]=s,this}getX(t){let i=this.array[t*this.itemSize];return this.normalized&&(i=Gi(i,this.array)),i}setX(t,i){return this.normalized&&(i=Be(i,this.array)),this.array[t*this.itemSize]=i,this}getY(t){let i=this.array[t*this.itemSize+1];return this.normalized&&(i=Gi(i,this.array)),i}setY(t,i){return this.normalized&&(i=Be(i,this.array)),this.array[t*this.itemSize+1]=i,this}getZ(t){let i=this.array[t*this.itemSize+2];return this.normalized&&(i=Gi(i,this.array)),i}setZ(t,i){return this.normalized&&(i=Be(i,this.array)),this.array[t*this.itemSize+2]=i,this}getW(t){let i=this.array[t*this.itemSize+3];return this.normalized&&(i=Gi(i,this.array)),i}setW(t,i){return this.normalized&&(i=Be(i,this.array)),this.array[t*this.itemSize+3]=i,this}setXY(t,i,s){return t*=this.itemSize,this.normalized&&(i=Be(i,this.array),s=Be(s,this.array)),this.array[t+0]=i,this.array[t+1]=s,this}setXYZ(t,i,s,l){return t*=this.itemSize,this.normalized&&(i=Be(i,this.array),s=Be(s,this.array),l=Be(l,this.array)),this.array[t+0]=i,this.array[t+1]=s,this.array[t+2]=l,this}setXYZW(t,i,s,l,c){return t*=this.itemSize,this.normalized&&(i=Be(i,this.array),s=Be(s,this.array),l=Be(l,this.array),c=Be(c,this.array)),this.array[t+0]=i,this.array[t+1]=s,this.array[t+2]=l,this.array[t+3]=c,this}onUpload(t){return this.onUploadCallback=t,this}clone(){return new this.constructor(this.array,this.itemSize).copy(this)}toJSON(){const t={itemSize:this.itemSize,type:this.array.constructor.name,array:Array.from(this.array),normalized:this.normalized};return this.name!==""&&(t.name=this.name),this.usage!==fp&&(t.usage=this.usage),t}}class ux extends gi{constructor(t,i,s){super(new Uint16Array(t),i,s)}}class fx extends gi{constructor(t,i,s){super(new Uint32Array(t),i,s)}}class Tn extends gi{constructor(t,i,s){super(new Float32Array(t),i,s)}}const aE=new ys,il=new j,nd=new j;class ro{constructor(t=new j,i=-1){this.isSphere=!0,this.center=t,this.radius=i}set(t,i){return this.center.copy(t),this.radius=i,this}setFromPoints(t,i){const s=this.center;i!==void 0?s.copy(i):aE.setFromPoints(t).getCenter(s);let l=0;for(let c=0,h=t.length;c<h;c++)l=Math.max(l,s.distanceToSquared(t[c]));return this.radius=Math.sqrt(l),this}copy(t){return this.center.copy(t.center),this.radius=t.radius,this}isEmpty(){return this.radius<0}makeEmpty(){return this.center.set(0,0,0),this.radius=-1,this}containsPoint(t){return t.distanceToSquared(this.center)<=this.radius*this.radius}distanceToPoint(t){return t.distanceTo(this.center)-this.radius}intersectsSphere(t){const i=this.radius+t.radius;return t.center.distanceToSquared(this.center)<=i*i}intersectsBox(t){return t.intersectsSphere(this)}intersectsPlane(t){return Math.abs(t.distanceToPoint(this.center))<=this.radius}clampPoint(t,i){const s=this.center.distanceToSquared(t);return i.copy(t),s>this.radius*this.radius&&(i.sub(this.center).normalize(),i.multiplyScalar(this.radius).add(this.center)),i}getBoundingBox(t){return this.isEmpty()?(t.makeEmpty(),t):(t.set(this.center,this.center),t.expandByScalar(this.radius),t)}applyMatrix4(t){return this.center.applyMatrix4(t),this.radius=this.radius*t.getMaxScaleOnAxis(),this}translate(t){return this.center.add(t),this}expandByPoint(t){if(this.isEmpty())return this.center.copy(t),this.radius=0,this;il.subVectors(t,this.center);const i=il.lengthSq();if(i>this.radius*this.radius){const s=Math.sqrt(i),l=(s-this.radius)*.5;this.center.addScaledVector(il,l/s),this.radius+=l}return this}union(t){return t.isEmpty()?this:this.isEmpty()?(this.copy(t),this):(this.center.equals(t.center)===!0?this.radius=Math.max(this.radius,t.radius):(nd.subVectors(t.center,this.center).setLength(t.radius),this.expandByPoint(il.copy(t.center).add(nd)),this.expandByPoint(il.copy(t.center).sub(nd))),this)}equals(t){return t.center.equals(this.center)&&t.radius===this.radius}clone(){return new this.constructor().copy(this)}toJSON(){return{radius:this.radius,center:this.center.toArray()}}fromJSON(t){return this.radius=t.radius,this.center.fromArray(t.center),this}}let sE=0;const Ai=new Je,id=new On,Wr=new j,pi=new ys,al=new ys,Mn=new j;class Pn extends Js{constructor(){super(),this.isBufferGeometry=!0,Object.defineProperty(this,"id",{value:sE++}),this.uuid=Na(),this.name="",this.type="BufferGeometry",this.index=null,this.indirect=null,this.indirectOffset=0,this.attributes={},this.morphAttributes={},this.morphTargetsRelative=!1,this.groups=[],this.boundingBox=null,this.boundingSphere=null,this.drawRange={start:0,count:1/0},this.userData={}}getIndex(){return this.index}setIndex(t){return Array.isArray(t)?this.index=new(EM(t)?fx:ux)(t,1):this.index=t,this}setIndirect(t,i=0){return this.indirect=t,this.indirectOffset=i,this}getIndirect(){return this.indirect}getAttribute(t){return this.attributes[t]}setAttribute(t,i){return this.attributes[t]=i,this}deleteAttribute(t){return delete this.attributes[t],this}hasAttribute(t){return this.attributes[t]!==void 0}addGroup(t,i,s=0){this.groups.push({start:t,count:i,materialIndex:s})}clearGroups(){this.groups=[]}setDrawRange(t,i){this.drawRange.start=t,this.drawRange.count=i}applyMatrix4(t){const i=this.attributes.position;i!==void 0&&(i.applyMatrix4(t),i.needsUpdate=!0);const s=this.attributes.normal;if(s!==void 0){const c=new pe().getNormalMatrix(t);s.applyNormalMatrix(c),s.needsUpdate=!0}const l=this.attributes.tangent;return l!==void 0&&(l.transformDirection(t),l.needsUpdate=!0),this.boundingBox!==null&&this.computeBoundingBox(),this.boundingSphere!==null&&this.computeBoundingSphere(),this}applyQuaternion(t){return Ai.makeRotationFromQuaternion(t),this.applyMatrix4(Ai),this}rotateX(t){return Ai.makeRotationX(t),this.applyMatrix4(Ai),this}rotateY(t){return Ai.makeRotationY(t),this.applyMatrix4(Ai),this}rotateZ(t){return Ai.makeRotationZ(t),this.applyMatrix4(Ai),this}translate(t,i,s){return Ai.makeTranslation(t,i,s),this.applyMatrix4(Ai),this}scale(t,i,s){return Ai.makeScale(t,i,s),this.applyMatrix4(Ai),this}lookAt(t){return id.lookAt(t),id.updateMatrix(),this.applyMatrix4(id.matrix),this}center(){return this.computeBoundingBox(),this.boundingBox.getCenter(Wr).negate(),this.translate(Wr.x,Wr.y,Wr.z),this}setFromPoints(t){const i=this.getAttribute("position");if(i===void 0){const s=[];for(let l=0,c=t.length;l<c;l++){const h=t[l];s.push(h.x,h.y,h.z||0)}this.setAttribute("position",new Tn(s,3))}else{const s=Math.min(t.length,i.count);for(let l=0;l<s;l++){const c=t[l];i.setXYZ(l,c.x,c.y,c.z||0)}t.length>i.count&&ee("BufferGeometry: Buffer size too small for points data. Use .dispose() and create a new geometry."),i.needsUpdate=!0}return this}computeBoundingBox(){this.boundingBox===null&&(this.boundingBox=new ys);const t=this.attributes.position,i=this.morphAttributes.position;if(t&&t.isGLBufferAttribute){Ue("BufferGeometry.computeBoundingBox(): GLBufferAttribute requires a manual bounding box.",this),this.boundingBox.set(new j(-1/0,-1/0,-1/0),new j(1/0,1/0,1/0));return}if(t!==void 0){if(this.boundingBox.setFromBufferAttribute(t),i)for(let s=0,l=i.length;s<l;s++){const c=i[s];pi.setFromBufferAttribute(c),this.morphTargetsRelative?(Mn.addVectors(this.boundingBox.min,pi.min),this.boundingBox.expandByPoint(Mn),Mn.addVectors(this.boundingBox.max,pi.max),this.boundingBox.expandByPoint(Mn)):(this.boundingBox.expandByPoint(pi.min),this.boundingBox.expandByPoint(pi.max))}}else this.boundingBox.makeEmpty();(isNaN(this.boundingBox.min.x)||isNaN(this.boundingBox.min.y)||isNaN(this.boundingBox.min.z))&&Ue('BufferGeometry.computeBoundingBox(): Computed min/max have NaN values. The "position" attribute is likely to have NaN values.',this)}computeBoundingSphere(){this.boundingSphere===null&&(this.boundingSphere=new ro);const t=this.attributes.position,i=this.morphAttributes.position;if(t&&t.isGLBufferAttribute){Ue("BufferGeometry.computeBoundingSphere(): GLBufferAttribute requires a manual bounding sphere.",this),this.boundingSphere.set(new j,1/0);return}if(t){const s=this.boundingSphere.center;if(pi.setFromBufferAttribute(t),i)for(let c=0,h=i.length;c<h;c++){const d=i[c];al.setFromBufferAttribute(d),this.morphTargetsRelative?(Mn.addVectors(pi.min,al.min),pi.expandByPoint(Mn),Mn.addVectors(pi.max,al.max),pi.expandByPoint(Mn)):(pi.expandByPoint(al.min),pi.expandByPoint(al.max))}pi.getCenter(s);let l=0;for(let c=0,h=t.count;c<h;c++)Mn.fromBufferAttribute(t,c),l=Math.max(l,s.distanceToSquared(Mn));if(i)for(let c=0,h=i.length;c<h;c++){const d=i[c],m=this.morphTargetsRelative;for(let p=0,v=d.count;p<v;p++)Mn.fromBufferAttribute(d,p),m&&(Wr.fromBufferAttribute(t,p),Mn.add(Wr)),l=Math.max(l,s.distanceToSquared(Mn))}this.boundingSphere.radius=Math.sqrt(l),isNaN(this.boundingSphere.radius)&&Ue('BufferGeometry.computeBoundingSphere(): Computed radius is NaN. The "position" attribute is likely to have NaN values.',this)}}computeTangents(){const t=this.index,i=this.attributes;if(t===null||i.position===void 0||i.normal===void 0||i.uv===void 0){Ue("BufferGeometry: .computeTangents() failed. Missing required attributes (index, position, normal or uv)");return}const s=i.position,l=i.normal,c=i.uv;this.hasAttribute("tangent")===!1&&this.setAttribute("tangent",new gi(new Float32Array(4*s.count),4));const h=this.getAttribute("tangent"),d=[],m=[];for(let T=0;T<s.count;T++)d[T]=new j,m[T]=new j;const p=new j,v=new j,g=new j,_=new le,M=new le,E=new le,A=new j,x=new j;function y(T,L,Q){p.fromBufferAttribute(s,T),v.fromBufferAttribute(s,L),g.fromBufferAttribute(s,Q),_.fromBufferAttribute(c,T),M.fromBufferAttribute(c,L),E.fromBufferAttribute(c,Q),v.sub(p),g.sub(p),M.sub(_),E.sub(_);const P=1/(M.x*E.y-E.x*M.y);isFinite(P)&&(A.copy(v).multiplyScalar(E.y).addScaledVector(g,-M.y).multiplyScalar(P),x.copy(g).multiplyScalar(M.x).addScaledVector(v,-E.x).multiplyScalar(P),d[T].add(A),d[L].add(A),d[Q].add(A),m[T].add(x),m[L].add(x),m[Q].add(x))}let w=this.groups;w.length===0&&(w=[{start:0,count:t.count}]);for(let T=0,L=w.length;T<L;++T){const Q=w[T],P=Q.start,W=Q.count;for(let J=P,rt=P+W;J<rt;J+=3)y(t.getX(J+0),t.getX(J+1),t.getX(J+2))}const D=new j,U=new j,H=new j,F=new j;function I(T){H.fromBufferAttribute(l,T),F.copy(H);const L=d[T];D.copy(L),D.sub(H.multiplyScalar(H.dot(L))).normalize(),U.crossVectors(F,L);const P=U.dot(m[T])<0?-1:1;h.setXYZW(T,D.x,D.y,D.z,P)}for(let T=0,L=w.length;T<L;++T){const Q=w[T],P=Q.start,W=Q.count;for(let J=P,rt=P+W;J<rt;J+=3)I(t.getX(J+0)),I(t.getX(J+1)),I(t.getX(J+2))}}computeVertexNormals(){const t=this.index,i=this.getAttribute("position");if(i!==void 0){let s=this.getAttribute("normal");if(s===void 0)s=new gi(new Float32Array(i.count*3),3),this.setAttribute("normal",s);else for(let _=0,M=s.count;_<M;_++)s.setXYZ(_,0,0,0);const l=new j,c=new j,h=new j,d=new j,m=new j,p=new j,v=new j,g=new j;if(t)for(let _=0,M=t.count;_<M;_+=3){const E=t.getX(_+0),A=t.getX(_+1),x=t.getX(_+2);l.fromBufferAttribute(i,E),c.fromBufferAttribute(i,A),h.fromBufferAttribute(i,x),v.subVectors(h,c),g.subVectors(l,c),v.cross(g),d.fromBufferAttribute(s,E),m.fromBufferAttribute(s,A),p.fromBufferAttribute(s,x),d.add(v),m.add(v),p.add(v),s.setXYZ(E,d.x,d.y,d.z),s.setXYZ(A,m.x,m.y,m.z),s.setXYZ(x,p.x,p.y,p.z)}else for(let _=0,M=i.count;_<M;_+=3)l.fromBufferAttribute(i,_+0),c.fromBufferAttribute(i,_+1),h.fromBufferAttribute(i,_+2),v.subVectors(h,c),g.subVectors(l,c),v.cross(g),s.setXYZ(_+0,v.x,v.y,v.z),s.setXYZ(_+1,v.x,v.y,v.z),s.setXYZ(_+2,v.x,v.y,v.z);this.normalizeNormals(),s.needsUpdate=!0}}normalizeNormals(){const t=this.attributes.normal;for(let i=0,s=t.count;i<s;i++)Mn.fromBufferAttribute(t,i),Mn.normalize(),t.setXYZ(i,Mn.x,Mn.y,Mn.z)}toNonIndexed(){function t(d,m){const p=d.array,v=d.itemSize,g=d.normalized,_=new p.constructor(m.length*v);let M=0,E=0;for(let A=0,x=m.length;A<x;A++){d.isInterleavedBufferAttribute?M=m[A]*d.data.stride+d.offset:M=m[A]*v;for(let y=0;y<v;y++)_[E++]=p[M++]}return new gi(_,v,g)}if(this.index===null)return ee("BufferGeometry.toNonIndexed(): BufferGeometry is already non-indexed."),this;const i=new Pn,s=this.index.array,l=this.attributes;for(const d in l){const m=l[d],p=t(m,s);i.setAttribute(d,p)}const c=this.morphAttributes;for(const d in c){const m=[],p=c[d];for(let v=0,g=p.length;v<g;v++){const _=p[v],M=t(_,s);m.push(M)}i.morphAttributes[d]=m}i.morphTargetsRelative=this.morphTargetsRelative;const h=this.groups;for(let d=0,m=h.length;d<m;d++){const p=h[d];i.addGroup(p.start,p.count,p.materialIndex)}return i}toJSON(){const t={metadata:{version:4.7,type:"BufferGeometry",generator:"BufferGeometry.toJSON"}};if(t.uuid=this.uuid,t.type=this.type,this.name!==""&&(t.name=this.name),Object.keys(this.userData).length>0&&(t.userData=this.userData),this.parameters!==void 0){const m=this.parameters;for(const p in m)m[p]!==void 0&&(t[p]=m[p]);return t}t.data={attributes:{}};const i=this.index;i!==null&&(t.data.index={type:i.array.constructor.name,array:Array.prototype.slice.call(i.array)});const s=this.attributes;for(const m in s){const p=s[m];t.data.attributes[m]=p.toJSON(t.data)}const l={};let c=!1;for(const m in this.morphAttributes){const p=this.morphAttributes[m],v=[];for(let g=0,_=p.length;g<_;g++){const M=p[g];v.push(M.toJSON(t.data))}v.length>0&&(l[m]=v,c=!0)}c&&(t.data.morphAttributes=l,t.data.morphTargetsRelative=this.morphTargetsRelative);const h=this.groups;h.length>0&&(t.data.groups=JSON.parse(JSON.stringify(h)));const d=this.boundingSphere;return d!==null&&(t.data.boundingSphere=d.toJSON()),t}clone(){return new this.constructor().copy(this)}copy(t){this.index=null,this.attributes={},this.morphAttributes={},this.groups=[],this.boundingBox=null,this.boundingSphere=null;const i={};this.name=t.name;const s=t.index;s!==null&&this.setIndex(s.clone());const l=t.attributes;for(const p in l){const v=l[p];this.setAttribute(p,v.clone(i))}const c=t.morphAttributes;for(const p in c){const v=[],g=c[p];for(let _=0,M=g.length;_<M;_++)v.push(g[_].clone(i));this.morphAttributes[p]=v}this.morphTargetsRelative=t.morphTargetsRelative;const h=t.groups;for(let p=0,v=h.length;p<v;p++){const g=h[p];this.addGroup(g.start,g.count,g.materialIndex)}const d=t.boundingBox;d!==null&&(this.boundingBox=d.clone());const m=t.boundingSphere;return m!==null&&(this.boundingSphere=m.clone()),this.drawRange.start=t.drawRange.start,this.drawRange.count=t.drawRange.count,this.userData=t.userData,this}dispose(){this.dispatchEvent({type:"dispose"})}}class rE{constructor(t,i){this.isInterleavedBuffer=!0,this.array=t,this.stride=i,this.count=t!==void 0?t.length/i:0,this.usage=fp,this.updateRanges=[],this.version=0,this.uuid=Na()}onUploadCallback(){}set needsUpdate(t){t===!0&&this.version++}setUsage(t){return this.usage=t,this}addUpdateRange(t,i){this.updateRanges.push({start:t,count:i})}clearUpdateRanges(){this.updateRanges.length=0}copy(t){return this.array=new t.array.constructor(t.array),this.count=t.count,this.stride=t.stride,this.usage=t.usage,this}copyAt(t,i,s){t*=this.stride,s*=i.stride;for(let l=0,c=this.stride;l<c;l++)this.array[t+l]=i.array[s+l];return this}set(t,i=0){return this.array.set(t,i),this}clone(t){t.arrayBuffers===void 0&&(t.arrayBuffers={}),this.array.buffer._uuid===void 0&&(this.array.buffer._uuid=Na()),t.arrayBuffers[this.array.buffer._uuid]===void 0&&(t.arrayBuffers[this.array.buffer._uuid]=this.array.slice(0).buffer);const i=new this.array.constructor(t.arrayBuffers[this.array.buffer._uuid]),s=new this.constructor(i,this.stride);return s.setUsage(this.usage),s}onUpload(t){return this.onUploadCallback=t,this}toJSON(t){return t.arrayBuffers===void 0&&(t.arrayBuffers={}),this.array.buffer._uuid===void 0&&(this.array.buffer._uuid=Na()),t.arrayBuffers[this.array.buffer._uuid]===void 0&&(t.arrayBuffers[this.array.buffer._uuid]=Array.from(new Uint32Array(this.array.buffer))),{uuid:this.uuid,buffer:this.array.buffer._uuid,type:this.array.constructor.name,stride:this.stride}}}const Wn=new j;class _s{constructor(t,i,s,l=!1){this.isInterleavedBufferAttribute=!0,this.name="",this.data=t,this.itemSize=i,this.offset=s,this.normalized=l}get count(){return this.data.count}get array(){return this.data.array}set needsUpdate(t){this.data.needsUpdate=t}applyMatrix4(t){for(let i=0,s=this.data.count;i<s;i++)Wn.fromBufferAttribute(this,i),Wn.applyMatrix4(t),this.setXYZ(i,Wn.x,Wn.y,Wn.z);return this}applyNormalMatrix(t){for(let i=0,s=this.count;i<s;i++)Wn.fromBufferAttribute(this,i),Wn.applyNormalMatrix(t),this.setXYZ(i,Wn.x,Wn.y,Wn.z);return this}transformDirection(t){for(let i=0,s=this.count;i<s;i++)Wn.fromBufferAttribute(this,i),Wn.transformDirection(t),this.setXYZ(i,Wn.x,Wn.y,Wn.z);return this}getComponent(t,i){let s=this.array[t*this.data.stride+this.offset+i];return this.normalized&&(s=Gi(s,this.array)),s}setComponent(t,i,s){return this.normalized&&(s=Be(s,this.array)),this.data.array[t*this.data.stride+this.offset+i]=s,this}setX(t,i){return this.normalized&&(i=Be(i,this.array)),this.data.array[t*this.data.stride+this.offset]=i,this}setY(t,i){return this.normalized&&(i=Be(i,this.array)),this.data.array[t*this.data.stride+this.offset+1]=i,this}setZ(t,i){return this.normalized&&(i=Be(i,this.array)),this.data.array[t*this.data.stride+this.offset+2]=i,this}setW(t,i){return this.normalized&&(i=Be(i,this.array)),this.data.array[t*this.data.stride+this.offset+3]=i,this}getX(t){let i=this.data.array[t*this.data.stride+this.offset];return this.normalized&&(i=Gi(i,this.array)),i}getY(t){let i=this.data.array[t*this.data.stride+this.offset+1];return this.normalized&&(i=Gi(i,this.array)),i}getZ(t){let i=this.data.array[t*this.data.stride+this.offset+2];return this.normalized&&(i=Gi(i,this.array)),i}getW(t){let i=this.data.array[t*this.data.stride+this.offset+3];return this.normalized&&(i=Gi(i,this.array)),i}setXY(t,i,s){return t=t*this.data.stride+this.offset,this.normalized&&(i=Be(i,this.array),s=Be(s,this.array)),this.data.array[t+0]=i,this.data.array[t+1]=s,this}setXYZ(t,i,s,l){return t=t*this.data.stride+this.offset,this.normalized&&(i=Be(i,this.array),s=Be(s,this.array),l=Be(l,this.array)),this.data.array[t+0]=i,this.data.array[t+1]=s,this.data.array[t+2]=l,this}setXYZW(t,i,s,l,c){return t=t*this.data.stride+this.offset,this.normalized&&(i=Be(i,this.array),s=Be(s,this.array),l=Be(l,this.array),c=Be(c,this.array)),this.data.array[t+0]=i,this.data.array[t+1]=s,this.data.array[t+2]=l,this.data.array[t+3]=c,this}clone(t){if(t===void 0){vu("InterleavedBufferAttribute.clone(): Cloning an interleaved buffer attribute will de-interleave buffer data.");const i=[];for(let s=0;s<this.count;s++){const l=s*this.data.stride+this.offset;for(let c=0;c<this.itemSize;c++)i.push(this.data.array[l+c])}return new gi(new this.array.constructor(i),this.itemSize,this.normalized)}else return t.interleavedBuffers===void 0&&(t.interleavedBuffers={}),t.interleavedBuffers[this.data.uuid]===void 0&&(t.interleavedBuffers[this.data.uuid]=this.data.clone(t)),new _s(t.interleavedBuffers[this.data.uuid],this.itemSize,this.offset,this.normalized)}toJSON(t){if(t===void 0){vu("InterleavedBufferAttribute.toJSON(): Serializing an interleaved buffer attribute will de-interleave buffer data.");const i=[];for(let s=0;s<this.count;s++){const l=s*this.data.stride+this.offset;for(let c=0;c<this.itemSize;c++)i.push(this.data.array[l+c])}return{itemSize:this.itemSize,type:this.array.constructor.name,array:i,normalized:this.normalized}}else return t.interleavedBuffers===void 0&&(t.interleavedBuffers={}),t.interleavedBuffers[this.data.uuid]===void 0&&(t.interleavedBuffers[this.data.uuid]=this.data.toJSON(t)),{isInterleavedBufferAttribute:!0,itemSize:this.itemSize,data:this.data.uuid,offset:this.offset,normalized:this.normalized}}}let oE=0;class oo extends Js{constructor(){super(),this.isMaterial=!0,Object.defineProperty(this,"id",{value:oE++}),this.uuid=Na(),this.name="",this.type="Material",this.blending=$r,this.side=xs,this.vertexColors=!1,this.opacity=1,this.transparent=!1,this.alphaHash=!1,this.blendSrc=Md,this.blendDst=Ed,this.blendEquation=qs,this.blendSrcAlpha=null,this.blendDstAlpha=null,this.blendEquationAlpha=null,this.blendColor=new Se(0,0,0),this.blendAlpha=0,this.depthFunc=eo,this.depthTest=!0,this.depthWrite=!0,this.stencilWriteMask=255,this.stencilFunc=D_,this.stencilRef=0,this.stencilFuncMask=255,this.stencilFail=Pr,this.stencilZFail=Pr,this.stencilZPass=Pr,this.stencilWrite=!1,this.clippingPlanes=null,this.clipIntersection=!1,this.clipShadows=!1,this.shadowSide=null,this.colorWrite=!0,this.precision=null,this.polygonOffset=!1,this.polygonOffsetFactor=0,this.polygonOffsetUnits=0,this.dithering=!1,this.alphaToCoverage=!1,this.premultipliedAlpha=!1,this.forceSinglePass=!1,this.allowOverride=!0,this.visible=!0,this.toneMapped=!0,this.userData={},this.version=0,this._alphaTest=0}get alphaTest(){return this._alphaTest}set alphaTest(t){this._alphaTest>0!=t>0&&this.version++,this._alphaTest=t}onBeforeRender(){}onBeforeCompile(){}customProgramCacheKey(){return this.onBeforeCompile.toString()}setValues(t){if(t!==void 0)for(const i in t){const s=t[i];if(s===void 0){ee(`Material: parameter '${i}' has value of undefined.`);continue}const l=this[i];if(l===void 0){ee(`Material: '${i}' is not a property of THREE.${this.type}.`);continue}l&&l.isColor?l.set(s):l&&l.isVector3&&s&&s.isVector3?l.copy(s):this[i]=s}}toJSON(t){const i=t===void 0||typeof t=="string";i&&(t={textures:{},images:{}});const s={metadata:{version:4.7,type:"Material",generator:"Material.toJSON"}};s.uuid=this.uuid,s.type=this.type,this.name!==""&&(s.name=this.name),this.color&&this.color.isColor&&(s.color=this.color.getHex()),this.roughness!==void 0&&(s.roughness=this.roughness),this.metalness!==void 0&&(s.metalness=this.metalness),this.sheen!==void 0&&(s.sheen=this.sheen),this.sheenColor&&this.sheenColor.isColor&&(s.sheenColor=this.sheenColor.getHex()),this.sheenRoughness!==void 0&&(s.sheenRoughness=this.sheenRoughness),this.emissive&&this.emissive.isColor&&(s.emissive=this.emissive.getHex()),this.emissiveIntensity!==void 0&&this.emissiveIntensity!==1&&(s.emissiveIntensity=this.emissiveIntensity),this.specular&&this.specular.isColor&&(s.specular=this.specular.getHex()),this.specularIntensity!==void 0&&(s.specularIntensity=this.specularIntensity),this.specularColor&&this.specularColor.isColor&&(s.specularColor=this.specularColor.getHex()),this.shininess!==void 0&&(s.shininess=this.shininess),this.clearcoat!==void 0&&(s.clearcoat=this.clearcoat),this.clearcoatRoughness!==void 0&&(s.clearcoatRoughness=this.clearcoatRoughness),this.clearcoatMap&&this.clearcoatMap.isTexture&&(s.clearcoatMap=this.clearcoatMap.toJSON(t).uuid),this.clearcoatRoughnessMap&&this.clearcoatRoughnessMap.isTexture&&(s.clearcoatRoughnessMap=this.clearcoatRoughnessMap.toJSON(t).uuid),this.clearcoatNormalMap&&this.clearcoatNormalMap.isTexture&&(s.clearcoatNormalMap=this.clearcoatNormalMap.toJSON(t).uuid,s.clearcoatNormalScale=this.clearcoatNormalScale.toArray()),this.sheenColorMap&&this.sheenColorMap.isTexture&&(s.sheenColorMap=this.sheenColorMap.toJSON(t).uuid),this.sheenRoughnessMap&&this.sheenRoughnessMap.isTexture&&(s.sheenRoughnessMap=this.sheenRoughnessMap.toJSON(t).uuid),this.dispersion!==void 0&&(s.dispersion=this.dispersion),this.iridescence!==void 0&&(s.iridescence=this.iridescence),this.iridescenceIOR!==void 0&&(s.iridescenceIOR=this.iridescenceIOR),this.iridescenceThicknessRange!==void 0&&(s.iridescenceThicknessRange=this.iridescenceThicknessRange),this.iridescenceMap&&this.iridescenceMap.isTexture&&(s.iridescenceMap=this.iridescenceMap.toJSON(t).uuid),this.iridescenceThicknessMap&&this.iridescenceThicknessMap.isTexture&&(s.iridescenceThicknessMap=this.iridescenceThicknessMap.toJSON(t).uuid),this.anisotropy!==void 0&&(s.anisotropy=this.anisotropy),this.anisotropyRotation!==void 0&&(s.anisotropyRotation=this.anisotropyRotation),this.anisotropyMap&&this.anisotropyMap.isTexture&&(s.anisotropyMap=this.anisotropyMap.toJSON(t).uuid),this.map&&this.map.isTexture&&(s.map=this.map.toJSON(t).uuid),this.matcap&&this.matcap.isTexture&&(s.matcap=this.matcap.toJSON(t).uuid),this.alphaMap&&this.alphaMap.isTexture&&(s.alphaMap=this.alphaMap.toJSON(t).uuid),this.lightMap&&this.lightMap.isTexture&&(s.lightMap=this.lightMap.toJSON(t).uuid,s.lightMapIntensity=this.lightMapIntensity),this.aoMap&&this.aoMap.isTexture&&(s.aoMap=this.aoMap.toJSON(t).uuid,s.aoMapIntensity=this.aoMapIntensity),this.bumpMap&&this.bumpMap.isTexture&&(s.bumpMap=this.bumpMap.toJSON(t).uuid,s.bumpScale=this.bumpScale),this.normalMap&&this.normalMap.isTexture&&(s.normalMap=this.normalMap.toJSON(t).uuid,s.normalMapType=this.normalMapType,s.normalScale=this.normalScale.toArray()),this.displacementMap&&this.displacementMap.isTexture&&(s.displacementMap=this.displacementMap.toJSON(t).uuid,s.displacementScale=this.displacementScale,s.displacementBias=this.displacementBias),this.roughnessMap&&this.roughnessMap.isTexture&&(s.roughnessMap=this.roughnessMap.toJSON(t).uuid),this.metalnessMap&&this.metalnessMap.isTexture&&(s.metalnessMap=this.metalnessMap.toJSON(t).uuid),this.emissiveMap&&this.emissiveMap.isTexture&&(s.emissiveMap=this.emissiveMap.toJSON(t).uuid),this.specularMap&&this.specularMap.isTexture&&(s.specularMap=this.specularMap.toJSON(t).uuid),this.specularIntensityMap&&this.specularIntensityMap.isTexture&&(s.specularIntensityMap=this.specularIntensityMap.toJSON(t).uuid),this.specularColorMap&&this.specularColorMap.isTexture&&(s.specularColorMap=this.specularColorMap.toJSON(t).uuid),this.envMap&&this.envMap.isTexture&&(s.envMap=this.envMap.toJSON(t).uuid,this.combine!==void 0&&(s.combine=this.combine)),this.envMapRotation!==void 0&&(s.envMapRotation=this.envMapRotation.toArray()),this.envMapIntensity!==void 0&&(s.envMapIntensity=this.envMapIntensity),this.reflectivity!==void 0&&(s.reflectivity=this.reflectivity),this.refractionRatio!==void 0&&(s.refractionRatio=this.refractionRatio),this.gradientMap&&this.gradientMap.isTexture&&(s.gradientMap=this.gradientMap.toJSON(t).uuid),this.transmission!==void 0&&(s.transmission=this.transmission),this.transmissionMap&&this.transmissionMap.isTexture&&(s.transmissionMap=this.transmissionMap.toJSON(t).uuid),this.thickness!==void 0&&(s.thickness=this.thickness),this.thicknessMap&&this.thicknessMap.isTexture&&(s.thicknessMap=this.thicknessMap.toJSON(t).uuid),this.attenuationDistance!==void 0&&this.attenuationDistance!==1/0&&(s.attenuationDistance=this.attenuationDistance),this.attenuationColor!==void 0&&(s.attenuationColor=this.attenuationColor.getHex()),this.size!==void 0&&(s.size=this.size),this.shadowSide!==null&&(s.shadowSide=this.shadowSide),this.sizeAttenuation!==void 0&&(s.sizeAttenuation=this.sizeAttenuation),this.blending!==$r&&(s.blending=this.blending),this.side!==xs&&(s.side=this.side),this.vertexColors===!0&&(s.vertexColors=!0),this.opacity<1&&(s.opacity=this.opacity),this.transparent===!0&&(s.transparent=!0),this.blendSrc!==Md&&(s.blendSrc=this.blendSrc),this.blendDst!==Ed&&(s.blendDst=this.blendDst),this.blendEquation!==qs&&(s.blendEquation=this.blendEquation),this.blendSrcAlpha!==null&&(s.blendSrcAlpha=this.blendSrcAlpha),this.blendDstAlpha!==null&&(s.blendDstAlpha=this.blendDstAlpha),this.blendEquationAlpha!==null&&(s.blendEquationAlpha=this.blendEquationAlpha),this.blendColor&&this.blendColor.isColor&&(s.blendColor=this.blendColor.getHex()),this.blendAlpha!==0&&(s.blendAlpha=this.blendAlpha),this.depthFunc!==eo&&(s.depthFunc=this.depthFunc),this.depthTest===!1&&(s.depthTest=this.depthTest),this.depthWrite===!1&&(s.depthWrite=this.depthWrite),this.colorWrite===!1&&(s.colorWrite=this.colorWrite),this.stencilWriteMask!==255&&(s.stencilWriteMask=this.stencilWriteMask),this.stencilFunc!==D_&&(s.stencilFunc=this.stencilFunc),this.stencilRef!==0&&(s.stencilRef=this.stencilRef),this.stencilFuncMask!==255&&(s.stencilFuncMask=this.stencilFuncMask),this.stencilFail!==Pr&&(s.stencilFail=this.stencilFail),this.stencilZFail!==Pr&&(s.stencilZFail=this.stencilZFail),this.stencilZPass!==Pr&&(s.stencilZPass=this.stencilZPass),this.stencilWrite===!0&&(s.stencilWrite=this.stencilWrite),this.rotation!==void 0&&this.rotation!==0&&(s.rotation=this.rotation),this.polygonOffset===!0&&(s.polygonOffset=!0),this.polygonOffsetFactor!==0&&(s.polygonOffsetFactor=this.polygonOffsetFactor),this.polygonOffsetUnits!==0&&(s.polygonOffsetUnits=this.polygonOffsetUnits),this.linewidth!==void 0&&this.linewidth!==1&&(s.linewidth=this.linewidth),this.dashSize!==void 0&&(s.dashSize=this.dashSize),this.gapSize!==void 0&&(s.gapSize=this.gapSize),this.scale!==void 0&&(s.scale=this.scale),this.dithering===!0&&(s.dithering=!0),this.alphaTest>0&&(s.alphaTest=this.alphaTest),this.alphaHash===!0&&(s.alphaHash=!0),this.alphaToCoverage===!0&&(s.alphaToCoverage=!0),this.premultipliedAlpha===!0&&(s.premultipliedAlpha=!0),this.forceSinglePass===!0&&(s.forceSinglePass=!0),this.allowOverride===!1&&(s.allowOverride=!1),this.wireframe===!0&&(s.wireframe=!0),this.wireframeLinewidth>1&&(s.wireframeLinewidth=this.wireframeLinewidth),this.wireframeLinecap!=="round"&&(s.wireframeLinecap=this.wireframeLinecap),this.wireframeLinejoin!=="round"&&(s.wireframeLinejoin=this.wireframeLinejoin),this.flatShading===!0&&(s.flatShading=!0),this.visible===!1&&(s.visible=!1),this.toneMapped===!1&&(s.toneMapped=!1),this.fog===!1&&(s.fog=!1),Object.keys(this.userData).length>0&&(s.userData=this.userData);function l(c){const h=[];for(const d in c){const m=c[d];delete m.metadata,h.push(m)}return h}if(i){const c=l(t.textures),h=l(t.images);c.length>0&&(s.textures=c),h.length>0&&(s.images=h)}return s}clone(){return new this.constructor().copy(this)}copy(t){this.name=t.name,this.blending=t.blending,this.side=t.side,this.vertexColors=t.vertexColors,this.opacity=t.opacity,this.transparent=t.transparent,this.blendSrc=t.blendSrc,this.blendDst=t.blendDst,this.blendEquation=t.blendEquation,this.blendSrcAlpha=t.blendSrcAlpha,this.blendDstAlpha=t.blendDstAlpha,this.blendEquationAlpha=t.blendEquationAlpha,this.blendColor.copy(t.blendColor),this.blendAlpha=t.blendAlpha,this.depthFunc=t.depthFunc,this.depthTest=t.depthTest,this.depthWrite=t.depthWrite,this.stencilWriteMask=t.stencilWriteMask,this.stencilFunc=t.stencilFunc,this.stencilRef=t.stencilRef,this.stencilFuncMask=t.stencilFuncMask,this.stencilFail=t.stencilFail,this.stencilZFail=t.stencilZFail,this.stencilZPass=t.stencilZPass,this.stencilWrite=t.stencilWrite;const i=t.clippingPlanes;let s=null;if(i!==null){const l=i.length;s=new Array(l);for(let c=0;c!==l;++c)s[c]=i[c].clone()}return this.clippingPlanes=s,this.clipIntersection=t.clipIntersection,this.clipShadows=t.clipShadows,this.shadowSide=t.shadowSide,this.colorWrite=t.colorWrite,this.precision=t.precision,this.polygonOffset=t.polygonOffset,this.polygonOffsetFactor=t.polygonOffsetFactor,this.polygonOffsetUnits=t.polygonOffsetUnits,this.dithering=t.dithering,this.alphaTest=t.alphaTest,this.alphaHash=t.alphaHash,this.alphaToCoverage=t.alphaToCoverage,this.premultipliedAlpha=t.premultipliedAlpha,this.forceSinglePass=t.forceSinglePass,this.allowOverride=t.allowOverride,this.visible=t.visible,this.toneMapped=t.toneMapped,this.userData=JSON.parse(JSON.stringify(t.userData)),this}dispose(){this.dispatchEvent({type:"dispose"})}set needsUpdate(t){t===!0&&this.version++}}const Da=new j,ad=new j,Gc=new j,ds=new j,sd=new j,Vc=new j,rd=new j;class Up{constructor(t=new j,i=new j(0,0,-1)){this.origin=t,this.direction=i}set(t,i){return this.origin.copy(t),this.direction.copy(i),this}copy(t){return this.origin.copy(t.origin),this.direction.copy(t.direction),this}at(t,i){return i.copy(this.origin).addScaledVector(this.direction,t)}lookAt(t){return this.direction.copy(t).sub(this.origin).normalize(),this}recast(t){return this.origin.copy(this.at(t,Da)),this}closestPointToPoint(t,i){i.subVectors(t,this.origin);const s=i.dot(this.direction);return s<0?i.copy(this.origin):i.copy(this.origin).addScaledVector(this.direction,s)}distanceToPoint(t){return Math.sqrt(this.distanceSqToPoint(t))}distanceSqToPoint(t){const i=Da.subVectors(t,this.origin).dot(this.direction);return i<0?this.origin.distanceToSquared(t):(Da.copy(this.origin).addScaledVector(this.direction,i),Da.distanceToSquared(t))}distanceSqToSegment(t,i,s,l){ad.copy(t).add(i).multiplyScalar(.5),Gc.copy(i).sub(t).normalize(),ds.copy(this.origin).sub(ad);const c=t.distanceTo(i)*.5,h=-this.direction.dot(Gc),d=ds.dot(this.direction),m=-ds.dot(Gc),p=ds.lengthSq(),v=Math.abs(1-h*h);let g,_,M,E;if(v>0)if(g=h*m-d,_=h*d-m,E=c*v,g>=0)if(_>=-E)if(_<=E){const A=1/v;g*=A,_*=A,M=g*(g+h*_+2*d)+_*(h*g+_+2*m)+p}else _=c,g=Math.max(0,-(h*_+d)),M=-g*g+_*(_+2*m)+p;else _=-c,g=Math.max(0,-(h*_+d)),M=-g*g+_*(_+2*m)+p;else _<=-E?(g=Math.max(0,-(-h*c+d)),_=g>0?-c:Math.min(Math.max(-c,-m),c),M=-g*g+_*(_+2*m)+p):_<=E?(g=0,_=Math.min(Math.max(-c,-m),c),M=_*(_+2*m)+p):(g=Math.max(0,-(h*c+d)),_=g>0?c:Math.min(Math.max(-c,-m),c),M=-g*g+_*(_+2*m)+p);else _=h>0?-c:c,g=Math.max(0,-(h*_+d)),M=-g*g+_*(_+2*m)+p;return s&&s.copy(this.origin).addScaledVector(this.direction,g),l&&l.copy(ad).addScaledVector(Gc,_),M}intersectSphere(t,i){Da.subVectors(t.center,this.origin);const s=Da.dot(this.direction),l=Da.dot(Da)-s*s,c=t.radius*t.radius;if(l>c)return null;const h=Math.sqrt(c-l),d=s-h,m=s+h;return m<0?null:d<0?this.at(m,i):this.at(d,i)}intersectsSphere(t){return t.radius<0?!1:this.distanceSqToPoint(t.center)<=t.radius*t.radius}distanceToPlane(t){const i=t.normal.dot(this.direction);if(i===0)return t.distanceToPoint(this.origin)===0?0:null;const s=-(this.origin.dot(t.normal)+t.constant)/i;return s>=0?s:null}intersectPlane(t,i){const s=this.distanceToPlane(t);return s===null?null:this.at(s,i)}intersectsPlane(t){const i=t.distanceToPoint(this.origin);return i===0||t.normal.dot(this.direction)*i<0}intersectBox(t,i){let s,l,c,h,d,m;const p=1/this.direction.x,v=1/this.direction.y,g=1/this.direction.z,_=this.origin;return p>=0?(s=(t.min.x-_.x)*p,l=(t.max.x-_.x)*p):(s=(t.max.x-_.x)*p,l=(t.min.x-_.x)*p),v>=0?(c=(t.min.y-_.y)*v,h=(t.max.y-_.y)*v):(c=(t.max.y-_.y)*v,h=(t.min.y-_.y)*v),s>h||c>l||((c>s||isNaN(s))&&(s=c),(h<l||isNaN(l))&&(l=h),g>=0?(d=(t.min.z-_.z)*g,m=(t.max.z-_.z)*g):(d=(t.max.z-_.z)*g,m=(t.min.z-_.z)*g),s>m||d>l)||((d>s||s!==s)&&(s=d),(m<l||l!==l)&&(l=m),l<0)?null:this.at(s>=0?s:l,i)}intersectsBox(t){return this.intersectBox(t,Da)!==null}intersectTriangle(t,i,s,l,c){sd.subVectors(i,t),Vc.subVectors(s,t),rd.crossVectors(sd,Vc);let h=this.direction.dot(rd),d;if(h>0){if(l)return null;d=1}else if(h<0)d=-1,h=-h;else return null;ds.subVectors(this.origin,t);const m=d*this.direction.dot(Vc.crossVectors(ds,Vc));if(m<0)return null;const p=d*this.direction.dot(sd.cross(ds));if(p<0||m+p>h)return null;const v=-d*ds.dot(rd);return v<0?null:this.at(v/h,c)}applyMatrix4(t){return this.origin.applyMatrix4(t),this.direction.transformDirection(t),this}equals(t){return t.origin.equals(this.origin)&&t.direction.equals(this.direction)}clone(){return new this.constructor().copy(this)}}class Lp extends oo{constructor(t){super(),this.isMeshBasicMaterial=!0,this.type="MeshBasicMaterial",this.color=new Se(16777215),this.map=null,this.lightMap=null,this.lightMapIntensity=1,this.aoMap=null,this.aoMapIntensity=1,this.specularMap=null,this.alphaMap=null,this.envMap=null,this.envMapRotation=new ra,this.combine=Sp,this.reflectivity=1,this.refractionRatio=.98,this.wireframe=!1,this.wireframeLinewidth=1,this.wireframeLinecap="round",this.wireframeLinejoin="round",this.fog=!0,this.setValues(t)}copy(t){return super.copy(t),this.color.copy(t.color),this.map=t.map,this.lightMap=t.lightMap,this.lightMapIntensity=t.lightMapIntensity,this.aoMap=t.aoMap,this.aoMapIntensity=t.aoMapIntensity,this.specularMap=t.specularMap,this.alphaMap=t.alphaMap,this.envMap=t.envMap,this.envMapRotation.copy(t.envMapRotation),this.combine=t.combine,this.reflectivity=t.reflectivity,this.refractionRatio=t.refractionRatio,this.wireframe=t.wireframe,this.wireframeLinewidth=t.wireframeLinewidth,this.wireframeLinecap=t.wireframeLinecap,this.wireframeLinejoin=t.wireframeLinejoin,this.fog=t.fog,this}}const W_=new Je,Vs=new Up,kc=new ro,q_=new j,Xc=new j,Wc=new j,qc=new j,od=new j,Yc=new j,Y_=new j,jc=new j;class _i extends On{constructor(t=new Pn,i=new Lp){super(),this.isMesh=!0,this.type="Mesh",this.geometry=t,this.material=i,this.morphTargetDictionary=void 0,this.morphTargetInfluences=void 0,this.count=1,this.updateMorphTargets()}copy(t,i){return super.copy(t,i),t.morphTargetInfluences!==void 0&&(this.morphTargetInfluences=t.morphTargetInfluences.slice()),t.morphTargetDictionary!==void 0&&(this.morphTargetDictionary=Object.assign({},t.morphTargetDictionary)),this.material=Array.isArray(t.material)?t.material.slice():t.material,this.geometry=t.geometry,this}updateMorphTargets(){const i=this.geometry.morphAttributes,s=Object.keys(i);if(s.length>0){const l=i[s[0]];if(l!==void 0){this.morphTargetInfluences=[],this.morphTargetDictionary={};for(let c=0,h=l.length;c<h;c++){const d=l[c].name||String(c);this.morphTargetInfluences.push(0),this.morphTargetDictionary[d]=c}}}}getVertexPosition(t,i){const s=this.geometry,l=s.attributes.position,c=s.morphAttributes.position,h=s.morphTargetsRelative;i.fromBufferAttribute(l,t);const d=this.morphTargetInfluences;if(c&&d){Yc.set(0,0,0);for(let m=0,p=c.length;m<p;m++){const v=d[m],g=c[m];v!==0&&(od.fromBufferAttribute(g,t),h?Yc.addScaledVector(od,v):Yc.addScaledVector(od.sub(i),v))}i.add(Yc)}return i}raycast(t,i){const s=this.geometry,l=this.material,c=this.matrixWorld;l!==void 0&&(s.boundingSphere===null&&s.computeBoundingSphere(),kc.copy(s.boundingSphere),kc.applyMatrix4(c),Vs.copy(t.ray).recast(t.near),!(kc.containsPoint(Vs.origin)===!1&&(Vs.intersectSphere(kc,q_)===null||Vs.origin.distanceToSquared(q_)>(t.far-t.near)**2))&&(W_.copy(c).invert(),Vs.copy(t.ray).applyMatrix4(W_),!(s.boundingBox!==null&&Vs.intersectsBox(s.boundingBox)===!1)&&this._computeIntersections(t,i,Vs)))}_computeIntersections(t,i,s){let l;const c=this.geometry,h=this.material,d=c.index,m=c.attributes.position,p=c.attributes.uv,v=c.attributes.uv1,g=c.attributes.normal,_=c.groups,M=c.drawRange;if(d!==null)if(Array.isArray(h))for(let E=0,A=_.length;E<A;E++){const x=_[E],y=h[x.materialIndex],w=Math.max(x.start,M.start),D=Math.min(d.count,Math.min(x.start+x.count,M.start+M.count));for(let U=w,H=D;U<H;U+=3){const F=d.getX(U),I=d.getX(U+1),T=d.getX(U+2);l=Zc(this,y,t,s,p,v,g,F,I,T),l&&(l.faceIndex=Math.floor(U/3),l.face.materialIndex=x.materialIndex,i.push(l))}}else{const E=Math.max(0,M.start),A=Math.min(d.count,M.start+M.count);for(let x=E,y=A;x<y;x+=3){const w=d.getX(x),D=d.getX(x+1),U=d.getX(x+2);l=Zc(this,h,t,s,p,v,g,w,D,U),l&&(l.faceIndex=Math.floor(x/3),i.push(l))}}else if(m!==void 0)if(Array.isArray(h))for(let E=0,A=_.length;E<A;E++){const x=_[E],y=h[x.materialIndex],w=Math.max(x.start,M.start),D=Math.min(m.count,Math.min(x.start+x.count,M.start+M.count));for(let U=w,H=D;U<H;U+=3){const F=U,I=U+1,T=U+2;l=Zc(this,y,t,s,p,v,g,F,I,T),l&&(l.faceIndex=Math.floor(U/3),l.face.materialIndex=x.materialIndex,i.push(l))}}else{const E=Math.max(0,M.start),A=Math.min(m.count,M.start+M.count);for(let x=E,y=A;x<y;x+=3){const w=x,D=x+1,U=x+2;l=Zc(this,h,t,s,p,v,g,w,D,U),l&&(l.faceIndex=Math.floor(x/3),i.push(l))}}}}function lE(r,t,i,s,l,c,h,d){let m;if(t.side===ii?m=s.intersectTriangle(h,c,l,!0,d):m=s.intersectTriangle(l,c,h,t.side===xs,d),m===null)return null;jc.copy(d),jc.applyMatrix4(r.matrixWorld);const p=i.ray.origin.distanceTo(jc);return p<i.near||p>i.far?null:{distance:p,point:jc.clone(),object:r}}function Zc(r,t,i,s,l,c,h,d,m,p){r.getVertexPosition(d,Xc),r.getVertexPosition(m,Wc),r.getVertexPosition(p,qc);const v=lE(r,t,i,s,Xc,Wc,qc,Y_);if(v){const g=new j;Vi.getBarycoord(Y_,Xc,Wc,qc,g),l&&(v.uv=Vi.getInterpolatedAttribute(l,d,m,p,g,new le)),c&&(v.uv1=Vi.getInterpolatedAttribute(c,d,m,p,g,new le)),h&&(v.normal=Vi.getInterpolatedAttribute(h,d,m,p,g,new j),v.normal.dot(s.direction)>0&&v.normal.multiplyScalar(-1));const _={a:d,b:m,c:p,normal:new j,materialIndex:0};Vi.getNormal(Xc,Wc,qc,_.normal),v.face=_,v.barycoord=g}return v}class cE extends jn{constructor(t=null,i=1,s=1,l,c,h,d,m,p=Nn,v=Nn,g,_){super(null,h,d,m,p,v,l,c,g,_),this.isDataTexture=!0,this.image={data:t,width:i,height:s},this.generateMipmaps=!1,this.flipY=!1,this.unpackAlignment=1}}const ld=new j,uE=new j,fE=new pe;class ms{constructor(t=new j(1,0,0),i=0){this.isPlane=!0,this.normal=t,this.constant=i}set(t,i){return this.normal.copy(t),this.constant=i,this}setComponents(t,i,s,l){return this.normal.set(t,i,s),this.constant=l,this}setFromNormalAndCoplanarPoint(t,i){return this.normal.copy(t),this.constant=-i.dot(this.normal),this}setFromCoplanarPoints(t,i,s){const l=ld.subVectors(s,i).cross(uE.subVectors(t,i)).normalize();return this.setFromNormalAndCoplanarPoint(l,t),this}copy(t){return this.normal.copy(t.normal),this.constant=t.constant,this}normalize(){const t=1/this.normal.length();return this.normal.multiplyScalar(t),this.constant*=t,this}negate(){return this.constant*=-1,this.normal.negate(),this}distanceToPoint(t){return this.normal.dot(t)+this.constant}distanceToSphere(t){return this.distanceToPoint(t.center)-t.radius}projectPoint(t,i){return i.copy(t).addScaledVector(this.normal,-this.distanceToPoint(t))}intersectLine(t,i){const s=t.delta(ld),l=this.normal.dot(s);if(l===0)return this.distanceToPoint(t.start)===0?i.copy(t.start):null;const c=-(t.start.dot(this.normal)+this.constant)/l;return c<0||c>1?null:i.copy(t.start).addScaledVector(s,c)}intersectsLine(t){const i=this.distanceToPoint(t.start),s=this.distanceToPoint(t.end);return i<0&&s>0||s<0&&i>0}intersectsBox(t){return t.intersectsPlane(this)}intersectsSphere(t){return t.intersectsPlane(this)}coplanarPoint(t){return t.copy(this.normal).multiplyScalar(-this.constant)}applyMatrix4(t,i){const s=i||fE.getNormalMatrix(t),l=this.coplanarPoint(ld).applyMatrix4(t),c=this.normal.applyMatrix3(s).normalize();return this.constant=-l.dot(c),this}translate(t){return this.constant-=t.dot(this.normal),this}equals(t){return t.normal.equals(this.normal)&&t.constant===this.constant}clone(){return new this.constructor().copy(this)}}const ks=new ro,hE=new le(.5,.5),Kc=new j;class Np{constructor(t=new ms,i=new ms,s=new ms,l=new ms,c=new ms,h=new ms){this.planes=[t,i,s,l,c,h]}set(t,i,s,l,c,h){const d=this.planes;return d[0].copy(t),d[1].copy(i),d[2].copy(s),d[3].copy(l),d[4].copy(c),d[5].copy(h),this}copy(t){const i=this.planes;for(let s=0;s<6;s++)i[s].copy(t.planes[s]);return this}setFromProjectionMatrix(t,i=na,s=!1){const l=this.planes,c=t.elements,h=c[0],d=c[1],m=c[2],p=c[3],v=c[4],g=c[5],_=c[6],M=c[7],E=c[8],A=c[9],x=c[10],y=c[11],w=c[12],D=c[13],U=c[14],H=c[15];if(l[0].setComponents(p-h,M-v,y-E,H-w).normalize(),l[1].setComponents(p+h,M+v,y+E,H+w).normalize(),l[2].setComponents(p+d,M+g,y+A,H+D).normalize(),l[3].setComponents(p-d,M-g,y-A,H-D).normalize(),s)l[4].setComponents(m,_,x,U).normalize(),l[5].setComponents(p-m,M-_,y-x,H-U).normalize();else if(l[4].setComponents(p-m,M-_,y-x,H-U).normalize(),i===na)l[5].setComponents(p+m,M+_,y+x,H+U).normalize();else if(i===pl)l[5].setComponents(m,_,x,U).normalize();else throw new Error("THREE.Frustum.setFromProjectionMatrix(): Invalid coordinate system: "+i);return this}intersectsObject(t){if(t.boundingSphere!==void 0)t.boundingSphere===null&&t.computeBoundingSphere(),ks.copy(t.boundingSphere).applyMatrix4(t.matrixWorld);else{const i=t.geometry;i.boundingSphere===null&&i.computeBoundingSphere(),ks.copy(i.boundingSphere).applyMatrix4(t.matrixWorld)}return this.intersectsSphere(ks)}intersectsSprite(t){ks.center.set(0,0,0);const i=hE.distanceTo(t.center);return ks.radius=.7071067811865476+i,ks.applyMatrix4(t.matrixWorld),this.intersectsSphere(ks)}intersectsSphere(t){const i=this.planes,s=t.center,l=-t.radius;for(let c=0;c<6;c++)if(i[c].distanceToPoint(s)<l)return!1;return!0}intersectsBox(t){const i=this.planes;for(let s=0;s<6;s++){const l=i[s];if(Kc.x=l.normal.x>0?t.max.x:t.min.x,Kc.y=l.normal.y>0?t.max.y:t.min.y,Kc.z=l.normal.z>0?t.max.z:t.min.z,l.distanceToPoint(Kc)<0)return!1}return!0}containsPoint(t){const i=this.planes;for(let s=0;s<6;s++)if(i[s].distanceToPoint(t)<0)return!1;return!0}clone(){return new this.constructor().copy(this)}}class gl extends oo{constructor(t){super(),this.isLineBasicMaterial=!0,this.type="LineBasicMaterial",this.color=new Se(16777215),this.map=null,this.linewidth=1,this.linecap="round",this.linejoin="round",this.fog=!0,this.setValues(t)}copy(t){return super.copy(t),this.color.copy(t.color),this.map=t.map,this.linewidth=t.linewidth,this.linecap=t.linecap,this.linejoin=t.linejoin,this.fog=t.fog,this}}const Su=new j,yu=new j,j_=new Je,sl=new Up,Qc=new ro,cd=new j,Z_=new j;class Mu extends On{constructor(t=new Pn,i=new gl){super(),this.isLine=!0,this.type="Line",this.geometry=t,this.material=i,this.morphTargetDictionary=void 0,this.morphTargetInfluences=void 0,this.updateMorphTargets()}copy(t,i){return super.copy(t,i),this.material=Array.isArray(t.material)?t.material.slice():t.material,this.geometry=t.geometry,this}computeLineDistances(){const t=this.geometry;if(t.index===null){const i=t.attributes.position,s=[0];for(let l=1,c=i.count;l<c;l++)Su.fromBufferAttribute(i,l-1),yu.fromBufferAttribute(i,l),s[l]=s[l-1],s[l]+=Su.distanceTo(yu);t.setAttribute("lineDistance",new Tn(s,1))}else ee("Line.computeLineDistances(): Computation only possible with non-indexed BufferGeometry.");return this}raycast(t,i){const s=this.geometry,l=this.matrixWorld,c=t.params.Line.threshold,h=s.drawRange;if(s.boundingSphere===null&&s.computeBoundingSphere(),Qc.copy(s.boundingSphere),Qc.applyMatrix4(l),Qc.radius+=c,t.ray.intersectsSphere(Qc)===!1)return;j_.copy(l).invert(),sl.copy(t.ray).applyMatrix4(j_);const d=c/((this.scale.x+this.scale.y+this.scale.z)/3),m=d*d,p=this.isLineSegments?2:1,v=s.index,_=s.attributes.position;if(v!==null){const M=Math.max(0,h.start),E=Math.min(v.count,h.start+h.count);for(let A=M,x=E-1;A<x;A+=p){const y=v.getX(A),w=v.getX(A+1),D=Jc(this,t,sl,m,y,w,A);D&&i.push(D)}if(this.isLineLoop){const A=v.getX(E-1),x=v.getX(M),y=Jc(this,t,sl,m,A,x,E-1);y&&i.push(y)}}else{const M=Math.max(0,h.start),E=Math.min(_.count,h.start+h.count);for(let A=M,x=E-1;A<x;A+=p){const y=Jc(this,t,sl,m,A,A+1,A);y&&i.push(y)}if(this.isLineLoop){const A=Jc(this,t,sl,m,E-1,M,E-1);A&&i.push(A)}}}updateMorphTargets(){const i=this.geometry.morphAttributes,s=Object.keys(i);if(s.length>0){const l=i[s[0]];if(l!==void 0){this.morphTargetInfluences=[],this.morphTargetDictionary={};for(let c=0,h=l.length;c<h;c++){const d=l[c].name||String(c);this.morphTargetInfluences.push(0),this.morphTargetDictionary[d]=c}}}}}function Jc(r,t,i,s,l,c,h){const d=r.geometry.attributes.position;if(Su.fromBufferAttribute(d,l),yu.fromBufferAttribute(d,c),i.distanceSqToSegment(Su,yu,cd,Z_)>s)return;cd.applyMatrix4(r.matrixWorld);const p=t.ray.origin.distanceTo(cd);if(!(p<t.near||p>t.far))return{distance:p,point:Z_.clone().applyMatrix4(r.matrixWorld),index:h,face:null,faceIndex:null,barycoord:null,object:r}}const K_=new j,Q_=new j;class J_ extends Mu{constructor(t,i){super(t,i),this.isLineSegments=!0,this.type="LineSegments"}computeLineDistances(){const t=this.geometry;if(t.index===null){const i=t.attributes.position,s=[];for(let l=0,c=i.count;l<c;l+=2)K_.fromBufferAttribute(i,l),Q_.fromBufferAttribute(i,l+1),s[l]=l===0?0:s[l-1],s[l+1]=s[l]+K_.distanceTo(Q_);t.setAttribute("lineDistance",new Tn(s,1))}else ee("LineSegments.computeLineDistances(): Computation only possible with non-indexed BufferGeometry.");return this}}class hx extends jn{constructor(t=[],i=Qs,s,l,c,h,d,m,p,v){super(t,i,s,l,c,h,d,m,p,v),this.isCubeTexture=!0,this.flipY=!1}get images(){return this.image}set images(t){this.image=t}}class _l extends jn{constructor(t,i,s=sa,l,c,h,d=Nn,m=Nn,p,v=za,g=1){if(v!==za&&v!==Zs)throw new Error("DepthTexture format must be either THREE.DepthFormat or THREE.DepthStencilFormat");const _={width:t,height:i,depth:g};super(_,l,c,h,d,m,v,s,p),this.isDepthTexture=!0,this.flipY=!1,this.generateMipmaps=!1,this.compareFunction=null}copy(t){return super.copy(t),this.source=new Dp(Object.assign({},t.image)),this.compareFunction=t.compareFunction,this}toJSON(t){const i=super.toJSON(t);return this.compareFunction!==null&&(i.compareFunction=this.compareFunction),i}}class dE extends _l{constructor(t,i=sa,s=Qs,l,c,h=Nn,d=Nn,m,p=za){const v={width:t,height:t,depth:1},g=[v,v,v,v,v,v];super(t,t,i,s,l,c,h,d,m,p),this.image=g,this.isCubeDepthTexture=!0,this.isCubeTexture=!0}get images(){return this.image}set images(t){this.image=t}}class dx extends jn{constructor(t=null){super(),this.sourceTexture=t,this.isExternalTexture=!0}copy(t){return super.copy(t),this.sourceTexture=t.sourceTexture,this}}class vl extends Pn{constructor(t=1,i=1,s=1,l=1,c=1,h=1){super(),this.type="BoxGeometry",this.parameters={width:t,height:i,depth:s,widthSegments:l,heightSegments:c,depthSegments:h};const d=this;l=Math.floor(l),c=Math.floor(c),h=Math.floor(h);const m=[],p=[],v=[],g=[];let _=0,M=0;E("z","y","x",-1,-1,s,i,t,h,c,0),E("z","y","x",1,-1,s,i,-t,h,c,1),E("x","z","y",1,1,t,s,i,l,h,2),E("x","z","y",1,-1,t,s,-i,l,h,3),E("x","y","z",1,-1,t,i,s,l,c,4),E("x","y","z",-1,-1,t,i,-s,l,c,5),this.setIndex(m),this.setAttribute("position",new Tn(p,3)),this.setAttribute("normal",new Tn(v,3)),this.setAttribute("uv",new Tn(g,2));function E(A,x,y,w,D,U,H,F,I,T,L){const Q=U/I,P=H/T,W=U/2,J=H/2,rt=F/2,et=I+1,O=T+1;let B=0,at=0;const $=new j;for(let lt=0;lt<O;lt++){const N=lt*P-J;for(let k=0;k<et;k++){const ut=k*Q-W;$[A]=ut*w,$[x]=N*D,$[y]=rt,p.push($.x,$.y,$.z),$[A]=0,$[x]=0,$[y]=F>0?1:-1,v.push($.x,$.y,$.z),g.push(k/I),g.push(1-lt/T),B+=1}}for(let lt=0;lt<T;lt++)for(let N=0;N<I;N++){const k=_+N+et*lt,ut=_+N+et*(lt+1),vt=_+(N+1)+et*(lt+1),Rt=_+(N+1)+et*lt;m.push(k,ut,Rt),m.push(ut,vt,Rt),at+=6}d.addGroup(M,at,L),M+=at,_+=B}}copy(t){return super.copy(t),this.parameters=Object.assign({},t.parameters),this}static fromJSON(t){return new vl(t.width,t.height,t.depth,t.widthSegments,t.heightSegments,t.depthSegments)}}class bu extends Pn{constructor(t=1,i=1,s=1,l=1){super(),this.type="PlaneGeometry",this.parameters={width:t,height:i,widthSegments:s,heightSegments:l};const c=t/2,h=i/2,d=Math.floor(s),m=Math.floor(l),p=d+1,v=m+1,g=t/d,_=i/m,M=[],E=[],A=[],x=[];for(let y=0;y<v;y++){const w=y*_-h;for(let D=0;D<p;D++){const U=D*g-c;E.push(U,-w,0),A.push(0,0,1),x.push(D/d),x.push(1-y/m)}}for(let y=0;y<m;y++)for(let w=0;w<d;w++){const D=w+p*y,U=w+p*(y+1),H=w+1+p*(y+1),F=w+1+p*y;M.push(D,U,F),M.push(U,H,F)}this.setIndex(M),this.setAttribute("position",new Tn(E,3)),this.setAttribute("normal",new Tn(A,3)),this.setAttribute("uv",new Tn(x,2))}copy(t){return super.copy(t),this.parameters=Object.assign({},t.parameters),this}static fromJSON(t){return new bu(t.width,t.height,t.widthSegments,t.heightSegments)}}class Op extends Pn{constructor(t=1,i=32,s=16,l=0,c=Math.PI*2,h=0,d=Math.PI){super(),this.type="SphereGeometry",this.parameters={radius:t,widthSegments:i,heightSegments:s,phiStart:l,phiLength:c,thetaStart:h,thetaLength:d},i=Math.max(3,Math.floor(i)),s=Math.max(2,Math.floor(s));const m=Math.min(h+d,Math.PI);let p=0;const v=[],g=new j,_=new j,M=[],E=[],A=[],x=[];for(let y=0;y<=s;y++){const w=[],D=y/s;let U=0;y===0&&h===0?U=.5/i:y===s&&m===Math.PI&&(U=-.5/i);for(let H=0;H<=i;H++){const F=H/i;g.x=-t*Math.cos(l+F*c)*Math.sin(h+D*d),g.y=t*Math.cos(h+D*d),g.z=t*Math.sin(l+F*c)*Math.sin(h+D*d),E.push(g.x,g.y,g.z),_.copy(g).normalize(),A.push(_.x,_.y,_.z),x.push(F+U,1-D),w.push(p++)}v.push(w)}for(let y=0;y<s;y++)for(let w=0;w<i;w++){const D=v[y][w+1],U=v[y][w],H=v[y+1][w],F=v[y+1][w+1];(y!==0||h>0)&&M.push(D,U,F),(y!==s-1||m<Math.PI)&&M.push(U,H,F)}this.setIndex(M),this.setAttribute("position",new Tn(E,3)),this.setAttribute("normal",new Tn(A,3)),this.setAttribute("uv",new Tn(x,2))}copy(t){return super.copy(t),this.parameters=Object.assign({},t.parameters),this}static fromJSON(t){return new Op(t.radius,t.widthSegments,t.heightSegments,t.phiStart,t.phiLength,t.thetaStart,t.thetaLength)}}class pE extends Pn{constructor(t=null){if(super(),this.type="WireframeGeometry",this.parameters={geometry:t},t!==null){const i=[],s=new Set,l=new j,c=new j;if(t.index!==null){const h=t.attributes.position,d=t.index;let m=t.groups;m.length===0&&(m=[{start:0,count:d.count,materialIndex:0}]);for(let p=0,v=m.length;p<v;++p){const g=m[p],_=g.start,M=g.count;for(let E=_,A=_+M;E<A;E+=3)for(let x=0;x<3;x++){const y=d.getX(E+x),w=d.getX(E+(x+1)%3);l.fromBufferAttribute(h,y),c.fromBufferAttribute(h,w),$_(l,c,s)===!0&&(i.push(l.x,l.y,l.z),i.push(c.x,c.y,c.z))}}}else{const h=t.attributes.position;for(let d=0,m=h.count/3;d<m;d++)for(let p=0;p<3;p++){const v=3*d+p,g=3*d+(p+1)%3;l.fromBufferAttribute(h,v),c.fromBufferAttribute(h,g),$_(l,c,s)===!0&&(i.push(l.x,l.y,l.z),i.push(c.x,c.y,c.z))}}this.setAttribute("position",new Tn(i,3))}}copy(t){return super.copy(t),this.parameters=Object.assign({},t.parameters),this}}function $_(r,t,i){const s=`${r.x},${r.y},${r.z}-${t.x},${t.y},${t.z}`,l=`${t.x},${t.y},${t.z}-${r.x},${r.y},${r.z}`;return i.has(s)===!0||i.has(l)===!0?!1:(i.add(s),i.add(l),!0)}function so(r){const t={};for(const i in r){t[i]={};for(const s in r[i]){const l=r[i][s];l&&(l.isColor||l.isMatrix3||l.isMatrix4||l.isVector2||l.isVector3||l.isVector4||l.isTexture||l.isQuaternion)?l.isRenderTargetTexture?(ee("UniformsUtils: Textures of render targets cannot be cloned via cloneUniforms() or mergeUniforms()."),t[i][s]=null):t[i][s]=l.clone():Array.isArray(l)?t[i][s]=l.slice():t[i][s]=l}}return t}function qn(r){const t={};for(let i=0;i<r.length;i++){const s=so(r[i]);for(const l in s)t[l]=s[l]}return t}function mE(r){const t=[];for(let i=0;i<r.length;i++)t.push(r[i].clone());return t}function px(r){const t=r.getRenderTarget();return t===null?r.outputColorSpace:t.isXRRenderTarget===!0?t.texture.colorSpace:Re.workingColorSpace}const Pp={clone:so,merge:qn};var gE=`void main() {
8
+ `+o.stack}}var je=Object.prototype.hasOwnProperty,be=r.unstable_scheduleCallback,Ne=r.unstable_cancelCallback,Yt=r.unstable_shouldYield,z=r.unstable_requestPaint,b=r.unstable_now,K=r.unstable_getCurrentPriorityLevel,_t=r.unstable_ImmediatePriority,Mt=r.unstable_UserBlockingPriority,mt=r.unstable_NormalPriority,Wt=r.unstable_LowPriority,wt=r.unstable_IdlePriority,Kt=r.log,te=r.unstable_setDisableYieldValue,Tt=null,Et=null;function Pt(e){if(typeof Kt=="function"&&te(e),Et&&typeof Et.setStrictMode=="function")try{Et.setStrictMode(Tt,e)}catch{}}var Ot=Math.clz32?Math.clz32:Y,zt=Math.log,fe=Math.LN2;function Y(e){return e>>>=0,e===0?32:31-(zt(e)/fe|0)|0}var Ct=256,At=262144,It=4194304;function bt(e){var n=e&42;if(n!==0)return n;switch(e&-e){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:return 64;case 128:return 128;case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:return e&261888;case 262144:case 524288:case 1048576:case 2097152:return e&3932160;case 4194304:case 8388608:case 16777216:case 33554432:return e&62914560;case 67108864:return 67108864;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 0;default:return e}}function pt(e,n,a){var o=e.pendingLanes;if(o===0)return 0;var u=0,f=e.suspendedLanes,x=e.pingedLanes;e=e.warmLanes;var R=o&134217727;return R!==0?(o=R&~f,o!==0?u=bt(o):(x&=R,x!==0?u=bt(x):a||(a=R&~e,a!==0&&(u=bt(a))))):(R=o&~f,R!==0?u=bt(R):x!==0?u=bt(x):a||(a=o&~e,a!==0&&(u=bt(a)))),u===0?0:n!==0&&n!==u&&(n&f)===0&&(f=u&-u,a=n&-n,f>=a||f===32&&(a&4194048)!==0)?n:u}function Ht(e,n){return(e.pendingLanes&~(e.suspendedLanes&~e.pingedLanes)&n)===0}function ie(e,n){switch(e){case 1:case 2:case 4:case 8:case 64:return n+250;case 16:case 32:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return n+5e3;case 4194304:case 8388608:case 16777216:case 33554432:return-1;case 67108864:case 134217728:case 268435456:case 536870912:case 1073741824:return-1;default:return-1}}function Pe(){var e=It;return It<<=1,(It&62914560)===0&&(It=4194304),e}function Ae(e){for(var n=[],a=0;31>a;a++)n.push(e);return n}function In(e,n){e.pendingLanes|=n,n!==268435456&&(e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0)}function Ri(e,n,a,o,u,f){var x=e.pendingLanes;e.pendingLanes=a,e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0,e.expiredLanes&=a,e.entangledLanes&=a,e.errorRecoveryDisabledLanes&=a,e.shellSuspendCounter=0;var R=e.entanglements,G=e.expirationTimes,st=e.hiddenUpdates;for(a=x&~a;0<a;){var gt=31-Ot(a),St=1<<gt;R[gt]=0,G[gt]=-1;var ct=st[gt];if(ct!==null)for(st[gt]=null,gt=0;gt<ct.length;gt++){var ht=ct[gt];ht!==null&&(ht.lane&=-536870913)}a&=~St}o!==0&&fo(e,o,0),f!==0&&u===0&&e.tag!==0&&(e.suspendedLanes|=f&~(x&~n))}function fo(e,n,a){e.pendingLanes|=n,e.suspendedLanes&=~n;var o=31-Ot(n);e.entangledLanes|=n,e.entanglements[o]=e.entanglements[o]|1073741824|a&261930}function tr(e,n){var a=e.entangledLanes|=n;for(e=e.entanglements;a;){var o=31-Ot(a),u=1<<o;u&n|e[o]&n&&(e[o]|=n),a&=~u}}function yl(e,n){var a=n&-n;return a=(a&42)!==0?1:er(a),(a&(e.suspendedLanes|n))!==0?0:a}function er(e){switch(e){case 2:e=1;break;case 8:e=4;break;case 32:e=16;break;case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:case 4194304:case 8388608:case 16777216:case 33554432:e=128;break;case 268435456:e=134217728;break;default:e=0}return e}function nr(e){return e&=-e,2<e?8<e?(e&134217727)!==0?32:268435456:8:2}function Xi(){var e=B.p;return e!==0?e:(e=window.event,e===void 0?32:u_(e.type))}function ir(e,n){var a=B.p;try{return B.p=e,n()}finally{B.p=a}}var Ci=Math.random().toString(36).slice(2),rn="__reactFiber$"+Ci,pn="__reactProps$"+Ci,ra="__reactContainer$"+Ci,Ia="__reactEvents$"+Ci,Ml="__reactListeners$"+Ci,El="__reactHandles$"+Ci,bl="__reactResources$"+Ci,Ms="__reactMarker$"+Ci;function ho(e){delete e[rn],delete e[pn],delete e[Ia],delete e[Ml],delete e[El]}function Fa(e){var n=e[rn];if(n)return n;for(var a=e.parentNode;a;){if(n=a[ra]||a[rn]){if(a=n.alternate,n.child!==null||a!==null&&a.child!==null)for(e=j0(e);e!==null;){if(a=e[rn])return a;e=j0(e)}return n}e=a,a=e.parentNode}return null}function Ba(e){if(e=e[rn]||e[ra]){var n=e.tag;if(n===5||n===6||n===13||n===31||n===26||n===27||n===3)return e}return null}function Es(e){var n=e.tag;if(n===5||n===26||n===27||n===6)return e.stateNode;throw Error(s(33))}function C(e){var n=e[bl];return n||(n=e[bl]={hoistableStyles:new Map,hoistableScripts:new Map}),n}function q(e){e[Ms]=!0}var ft=new Set,ot={};function nt(e,n){Dt(e,n),Dt(e+"Capture",n)}function Dt(e,n){for(ot[e]=n,e=0;e<n.length;e++)ft.add(n[e])}var Bt=RegExp("^[:A-Z_a-z\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD][:A-Z_a-z\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD\\-.0-9\\u00B7\\u0300-\\u036F\\u203F-\\u2040]*$"),Nt={},qt={};function Zt(e){return je.call(qt,e)?!0:je.call(Nt,e)?!1:Bt.test(e)?qt[e]=!0:(Nt[e]=!0,!1)}function ne(e,n,a){if(Zt(n))if(a===null)e.removeAttribute(n);else{switch(typeof a){case"undefined":case"function":case"symbol":e.removeAttribute(n);return;case"boolean":var o=n.toLowerCase().slice(0,5);if(o!=="data-"&&o!=="aria-"){e.removeAttribute(n);return}}e.setAttribute(n,""+a)}}function re(e,n,a){if(a===null)e.removeAttribute(n);else{switch(typeof a){case"undefined":case"function":case"symbol":case"boolean":e.removeAttribute(n);return}e.setAttribute(n,""+a)}}function Gt(e,n,a,o){if(o===null)e.removeAttribute(a);else{switch(typeof o){case"undefined":case"function":case"symbol":case"boolean":e.removeAttribute(a);return}e.setAttributeNS(n,a,""+o)}}function he(e){switch(typeof e){case"bigint":case"boolean":case"number":case"string":case"undefined":return e;case"object":return e;default:return""}}function Ze(e){var n=e.type;return(e=e.nodeName)&&e.toLowerCase()==="input"&&(n==="checkbox"||n==="radio")}function Ke(e,n,a){var o=Object.getOwnPropertyDescriptor(e.constructor.prototype,n);if(!e.hasOwnProperty(n)&&typeof o<"u"&&typeof o.get=="function"&&typeof o.set=="function"){var u=o.get,f=o.set;return Object.defineProperty(e,n,{configurable:!0,get:function(){return u.call(this)},set:function(x){a=""+x,f.call(this,x)}}),Object.defineProperty(e,n,{enumerable:o.enumerable}),{getValue:function(){return a},setValue:function(x){a=""+x},stopTracking:function(){e._valueTracker=null,delete e[n]}}}}function Ce(e){if(!e._valueTracker){var n=Ze(e)?"checked":"value";e._valueTracker=Ke(e,n,""+e[n])}}function mn(e){if(!e)return!1;var n=e._valueTracker;if(!n)return!0;var a=n.getValue(),o="";return e&&(o=Ze(e)?e.checked?"true":"false":e.value),e=o,e!==a?(n.setValue(e),!0):!1}function kt(e){if(e=e||(typeof document<"u"?document:void 0),typeof e>"u")return null;try{return e.activeElement||e.body}catch{return e.body}}var Fn=/[\n"\\]/g;function se(e){return e.replace(Fn,function(n){return"\\"+n.charCodeAt(0).toString(16)+" "})}function Bn(e,n,a,o,u,f,x,R){e.name="",x!=null&&typeof x!="function"&&typeof x!="symbol"&&typeof x!="boolean"?e.type=x:e.removeAttribute("type"),n!=null?x==="number"?(n===0&&e.value===""||e.value!=n)&&(e.value=""+he(n)):e.value!==""+he(n)&&(e.value=""+he(n)):x!=="submit"&&x!=="reset"||e.removeAttribute("value"),n!=null?wi(e,x,he(n)):a!=null?wi(e,x,he(a)):o!=null&&e.removeAttribute("value"),u==null&&f!=null&&(e.defaultChecked=!!f),u!=null&&(e.checked=u&&typeof u!="function"&&typeof u!="symbol"),R!=null&&typeof R!="function"&&typeof R!="symbol"&&typeof R!="boolean"?e.name=""+he(R):e.removeAttribute("name")}function ei(e,n,a,o,u,f,x,R){if(f!=null&&typeof f!="function"&&typeof f!="symbol"&&typeof f!="boolean"&&(e.type=f),n!=null||a!=null){if(!(f!=="submit"&&f!=="reset"||n!=null)){Ce(e);return}a=a!=null?""+he(a):"",n=n!=null?""+he(n):a,R||n===e.value||(e.value=n),e.defaultValue=n}o=o??u,o=typeof o!="function"&&typeof o!="symbol"&&!!o,e.checked=R?e.checked:!!o,e.defaultChecked=!!o,x!=null&&typeof x!="function"&&typeof x!="symbol"&&typeof x!="boolean"&&(e.name=x),Ce(e)}function wi(e,n,a){n==="number"&&kt(e.ownerDocument)===e||e.defaultValue===""+a||(e.defaultValue=""+a)}function ni(e,n,a,o){if(e=e.options,n){n={};for(var u=0;u<a.length;u++)n["$"+a[u]]=!0;for(a=0;a<e.length;a++)u=n.hasOwnProperty("$"+e[a].value),e[a].selected!==u&&(e[a].selected=u),u&&o&&(e[a].defaultSelected=!0)}else{for(a=""+he(a),n=null,u=0;u<e.length;u++){if(e[u].value===a){e[u].selected=!0,o&&(e[u].defaultSelected=!0);return}n!==null||e[u].disabled||(n=e[u])}n!==null&&(n.selected=!0)}}function Oe(e,n,a){if(n!=null&&(n=""+he(n),n!==e.value&&(e.value=n),a==null)){e.defaultValue!==n&&(e.defaultValue=n);return}e.defaultValue=a!=null?""+he(a):""}function on(e,n,a,o){if(n==null){if(o!=null){if(a!=null)throw Error(s(92));if(et(o)){if(1<o.length)throw Error(s(93));o=o[0]}a=o}a==null&&(a=""),n=a}a=he(n),e.defaultValue=a,o=e.textContent,o===a&&o!==""&&o!==null&&(e.value=o),Ce(e)}function Hn(e,n){if(n){var a=e.firstChild;if(a&&a===e.lastChild&&a.nodeType===3){a.nodeValue=n;return}}e.textContent=n}var ln=new Set("animationIterationCount aspectRatio borderImageOutset borderImageSlice borderImageWidth boxFlex boxFlexGroup boxOrdinalGroup columnCount columns flex flexGrow flexPositive flexShrink flexNegative flexOrder gridArea gridRow gridRowEnd gridRowSpan gridRowStart gridColumn gridColumnEnd gridColumnSpan gridColumnStart fontWeight lineClamp lineHeight opacity order orphans scale tabSize widows zIndex zoom fillOpacity floodOpacity stopOpacity strokeDasharray strokeDashoffset strokeMiterlimit strokeOpacity strokeWidth MozAnimationIterationCount MozBoxFlex MozBoxFlexGroup MozLineClamp msAnimationIterationCount msFlex msZoom msFlexGrow msFlexNegative msFlexOrder msFlexPositive msFlexShrink msGridColumn msGridColumnSpan msGridRow msGridRowSpan WebkitAnimationIterationCount WebkitBoxFlex WebKitBoxFlexGroup WebkitBoxOrdinalGroup WebkitColumnCount WebkitColumns WebkitFlex WebkitFlexGrow WebkitFlexPositive WebkitFlexShrink WebkitLineClamp".split(" "));function Di(e,n,a){var o=n.indexOf("--")===0;a==null||typeof a=="boolean"||a===""?o?e.setProperty(n,""):n==="float"?e.cssFloat="":e[n]="":o?e.setProperty(n,a):typeof a!="number"||a===0||ln.has(n)?n==="float"?e.cssFloat=a:e[n]=(""+a).trim():e[n]=a+"px"}function oa(e,n,a){if(n!=null&&typeof n!="object")throw Error(s(62));if(e=e.style,a!=null){for(var o in a)!a.hasOwnProperty(o)||n!=null&&n.hasOwnProperty(o)||(o.indexOf("--")===0?e.setProperty(o,""):o==="float"?e.cssFloat="":e[o]="");for(var u in n)o=n[u],n.hasOwnProperty(u)&&a[u]!==o&&Di(e,u,o)}else for(var f in n)n.hasOwnProperty(f)&&Di(e,f,n[f])}function ar(e){if(e.indexOf("-")===-1)return!1;switch(e){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 Ox=new Map([["acceptCharset","accept-charset"],["htmlFor","for"],["httpEquiv","http-equiv"],["crossOrigin","crossorigin"],["accentHeight","accent-height"],["alignmentBaseline","alignment-baseline"],["arabicForm","arabic-form"],["baselineShift","baseline-shift"],["capHeight","cap-height"],["clipPath","clip-path"],["clipRule","clip-rule"],["colorInterpolation","color-interpolation"],["colorInterpolationFilters","color-interpolation-filters"],["colorProfile","color-profile"],["colorRendering","color-rendering"],["dominantBaseline","dominant-baseline"],["enableBackground","enable-background"],["fillOpacity","fill-opacity"],["fillRule","fill-rule"],["floodColor","flood-color"],["floodOpacity","flood-opacity"],["fontFamily","font-family"],["fontSize","font-size"],["fontSizeAdjust","font-size-adjust"],["fontStretch","font-stretch"],["fontStyle","font-style"],["fontVariant","font-variant"],["fontWeight","font-weight"],["glyphName","glyph-name"],["glyphOrientationHorizontal","glyph-orientation-horizontal"],["glyphOrientationVertical","glyph-orientation-vertical"],["horizAdvX","horiz-adv-x"],["horizOriginX","horiz-origin-x"],["imageRendering","image-rendering"],["letterSpacing","letter-spacing"],["lightingColor","lighting-color"],["markerEnd","marker-end"],["markerMid","marker-mid"],["markerStart","marker-start"],["overlinePosition","overline-position"],["overlineThickness","overline-thickness"],["paintOrder","paint-order"],["panose-1","panose-1"],["pointerEvents","pointer-events"],["renderingIntent","rendering-intent"],["shapeRendering","shape-rendering"],["stopColor","stop-color"],["stopOpacity","stop-opacity"],["strikethroughPosition","strikethrough-position"],["strikethroughThickness","strikethrough-thickness"],["strokeDasharray","stroke-dasharray"],["strokeDashoffset","stroke-dashoffset"],["strokeLinecap","stroke-linecap"],["strokeLinejoin","stroke-linejoin"],["strokeMiterlimit","stroke-miterlimit"],["strokeOpacity","stroke-opacity"],["strokeWidth","stroke-width"],["textAnchor","text-anchor"],["textDecoration","text-decoration"],["textRendering","text-rendering"],["transformOrigin","transform-origin"],["underlinePosition","underline-position"],["underlineThickness","underline-thickness"],["unicodeBidi","unicode-bidi"],["unicodeRange","unicode-range"],["unitsPerEm","units-per-em"],["vAlphabetic","v-alphabetic"],["vHanging","v-hanging"],["vIdeographic","v-ideographic"],["vMathematical","v-mathematical"],["vectorEffect","vector-effect"],["vertAdvY","vert-adv-y"],["vertOriginX","vert-origin-x"],["vertOriginY","vert-origin-y"],["wordSpacing","word-spacing"],["writingMode","writing-mode"],["xmlnsXlink","xmlns:xlink"],["xHeight","x-height"]]),Px=/^[\u0000-\u001F ]*j[\r\n\t]*a[\r\n\t]*v[\r\n\t]*a[\r\n\t]*s[\r\n\t]*c[\r\n\t]*r[\r\n\t]*i[\r\n\t]*p[\r\n\t]*t[\r\n\t]*:/i;function Tl(e){return Px.test(""+e)?"javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')":e}function la(){}var Du=null;function Uu(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var sr=null,rr=null;function Bp(e){var n=Ba(e);if(n&&(e=n.stateNode)){var a=e[pn]||null;t:switch(e=n.stateNode,n.type){case"input":if(Bn(e,a.value,a.defaultValue,a.defaultValue,a.checked,a.defaultChecked,a.type,a.name),n=a.name,a.type==="radio"&&n!=null){for(a=e;a.parentNode;)a=a.parentNode;for(a=a.querySelectorAll('input[name="'+se(""+n)+'"][type="radio"]'),n=0;n<a.length;n++){var o=a[n];if(o!==e&&o.form===e.form){var u=o[pn]||null;if(!u)throw Error(s(90));Bn(o,u.value,u.defaultValue,u.defaultValue,u.checked,u.defaultChecked,u.type,u.name)}}for(n=0;n<a.length;n++)o=a[n],o.form===e.form&&mn(o)}break t;case"textarea":Oe(e,a.value,a.defaultValue);break t;case"select":n=a.value,n!=null&&ni(e,!!a.multiple,n,!1)}}}var Lu=!1;function Hp(e,n,a){if(Lu)return e(n,a);Lu=!0;try{var o=e(n);return o}finally{if(Lu=!1,(sr!==null||rr!==null)&&(hc(),sr&&(n=sr,e=rr,rr=sr=null,Bp(n),e)))for(n=0;n<e.length;n++)Bp(e[n])}}function po(e,n){var a=e.stateNode;if(a===null)return null;var o=a[pn]||null;if(o===null)return null;a=o[n];t:switch(n){case"onClick":case"onClickCapture":case"onDoubleClick":case"onDoubleClickCapture":case"onMouseDown":case"onMouseDownCapture":case"onMouseMove":case"onMouseMoveCapture":case"onMouseUp":case"onMouseUpCapture":case"onMouseEnter":(o=!o.disabled)||(e=e.type,o=!(e==="button"||e==="input"||e==="select"||e==="textarea")),e=!o;break t;default:e=!1}if(e)return null;if(a&&typeof a!="function")throw Error(s(231,n,typeof a));return a}var ca=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),Nu=!1;if(ca)try{var mo={};Object.defineProperty(mo,"passive",{get:function(){Nu=!0}}),window.addEventListener("test",mo,mo),window.removeEventListener("test",mo,mo)}catch{Nu=!1}var Ha=null,Ou=null,Al=null;function Gp(){if(Al)return Al;var e,n=Ou,a=n.length,o,u="value"in Ha?Ha.value:Ha.textContent,f=u.length;for(e=0;e<a&&n[e]===u[e];e++);var x=a-e;for(o=1;o<=x&&n[a-o]===u[f-o];o++);return Al=u.slice(e,1<o?1-o:void 0)}function Rl(e){var n=e.keyCode;return"charCode"in e?(e=e.charCode,e===0&&n===13&&(e=13)):e=n,e===10&&(e=13),32<=e||e===13?e:0}function Cl(){return!0}function Vp(){return!1}function qn(e){function n(a,o,u,f,x){this._reactName=a,this._targetInst=u,this.type=o,this.nativeEvent=f,this.target=x,this.currentTarget=null;for(var R in e)e.hasOwnProperty(R)&&(a=e[R],this[R]=a?a(f):f[R]);return this.isDefaultPrevented=(f.defaultPrevented!=null?f.defaultPrevented:f.returnValue===!1)?Cl:Vp,this.isPropagationStopped=Vp,this}return g(n.prototype,{preventDefault:function(){this.defaultPrevented=!0;var a=this.nativeEvent;a&&(a.preventDefault?a.preventDefault():typeof a.returnValue!="unknown"&&(a.returnValue=!1),this.isDefaultPrevented=Cl)},stopPropagation:function(){var a=this.nativeEvent;a&&(a.stopPropagation?a.stopPropagation():typeof a.cancelBubble!="unknown"&&(a.cancelBubble=!0),this.isPropagationStopped=Cl)},persist:function(){},isPersistent:Cl}),n}var bs={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(e){return e.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},wl=qn(bs),go=g({},bs,{view:0,detail:0}),zx=qn(go),Pu,zu,_o,Dl=g({},go,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:Fu,button:0,buttons:0,relatedTarget:function(e){return e.relatedTarget===void 0?e.fromElement===e.srcElement?e.toElement:e.fromElement:e.relatedTarget},movementX:function(e){return"movementX"in e?e.movementX:(e!==_o&&(_o&&e.type==="mousemove"?(Pu=e.screenX-_o.screenX,zu=e.screenY-_o.screenY):zu=Pu=0,_o=e),Pu)},movementY:function(e){return"movementY"in e?e.movementY:zu}}),kp=qn(Dl),Ix=g({},Dl,{dataTransfer:0}),Fx=qn(Ix),Bx=g({},go,{relatedTarget:0}),Iu=qn(Bx),Hx=g({},bs,{animationName:0,elapsedTime:0,pseudoElement:0}),Gx=qn(Hx),Vx=g({},bs,{clipboardData:function(e){return"clipboardData"in e?e.clipboardData:window.clipboardData}}),kx=qn(Vx),Xx=g({},bs,{data:0}),Xp=qn(Xx),Wx={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},qx={8:"Backspace",9:"Tab",12:"Clear",13:"Enter",16:"Shift",17:"Control",18:"Alt",19:"Pause",20:"CapsLock",27:"Escape",32:" ",33:"PageUp",34:"PageDown",35:"End",36:"Home",37:"ArrowLeft",38:"ArrowUp",39:"ArrowRight",40:"ArrowDown",45:"Insert",46:"Delete",112:"F1",113:"F2",114:"F3",115:"F4",116:"F5",117:"F6",118:"F7",119:"F8",120:"F9",121:"F10",122:"F11",123:"F12",144:"NumLock",145:"ScrollLock",224:"Meta"},Yx={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function jx(e){var n=this.nativeEvent;return n.getModifierState?n.getModifierState(e):(e=Yx[e])?!!n[e]:!1}function Fu(){return jx}var Zx=g({},go,{key:function(e){if(e.key){var n=Wx[e.key]||e.key;if(n!=="Unidentified")return n}return e.type==="keypress"?(e=Rl(e),e===13?"Enter":String.fromCharCode(e)):e.type==="keydown"||e.type==="keyup"?qx[e.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:Fu,charCode:function(e){return e.type==="keypress"?Rl(e):0},keyCode:function(e){return e.type==="keydown"||e.type==="keyup"?e.keyCode:0},which:function(e){return e.type==="keypress"?Rl(e):e.type==="keydown"||e.type==="keyup"?e.keyCode:0}}),Kx=qn(Zx),Qx=g({},Dl,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),Wp=qn(Qx),Jx=g({},go,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:Fu}),$x=qn(Jx),tS=g({},bs,{propertyName:0,elapsedTime:0,pseudoElement:0}),eS=qn(tS),nS=g({},Dl,{deltaX:function(e){return"deltaX"in e?e.deltaX:"wheelDeltaX"in e?-e.wheelDeltaX:0},deltaY:function(e){return"deltaY"in e?e.deltaY:"wheelDeltaY"in e?-e.wheelDeltaY:"wheelDelta"in e?-e.wheelDelta:0},deltaZ:0,deltaMode:0}),iS=qn(nS),aS=g({},bs,{newState:0,oldState:0}),sS=qn(aS),rS=[9,13,27,32],Bu=ca&&"CompositionEvent"in window,vo=null;ca&&"documentMode"in document&&(vo=document.documentMode);var oS=ca&&"TextEvent"in window&&!vo,qp=ca&&(!Bu||vo&&8<vo&&11>=vo),Yp=" ",jp=!1;function Zp(e,n){switch(e){case"keyup":return rS.indexOf(n.keyCode)!==-1;case"keydown":return n.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function Kp(e){return e=e.detail,typeof e=="object"&&"data"in e?e.data:null}var or=!1;function lS(e,n){switch(e){case"compositionend":return Kp(n);case"keypress":return n.which!==32?null:(jp=!0,Yp);case"textInput":return e=n.data,e===Yp&&jp?null:e;default:return null}}function cS(e,n){if(or)return e==="compositionend"||!Bu&&Zp(e,n)?(e=Gp(),Al=Ou=Ha=null,or=!1,e):null;switch(e){case"paste":return null;case"keypress":if(!(n.ctrlKey||n.altKey||n.metaKey)||n.ctrlKey&&n.altKey){if(n.char&&1<n.char.length)return n.char;if(n.which)return String.fromCharCode(n.which)}return null;case"compositionend":return qp&&n.locale!=="ko"?null:n.data;default:return null}}var uS={color:!0,date:!0,datetime:!0,"datetime-local":!0,email:!0,month:!0,number:!0,password:!0,range:!0,search:!0,tel:!0,text:!0,time:!0,url:!0,week:!0};function Qp(e){var n=e&&e.nodeName&&e.nodeName.toLowerCase();return n==="input"?!!uS[e.type]:n==="textarea"}function Jp(e,n,a,o){sr?rr?rr.push(o):rr=[o]:sr=o,n=xc(n,"onChange"),0<n.length&&(a=new wl("onChange","change",null,a,o),e.push({event:a,listeners:n}))}var xo=null,So=null;function fS(e){O0(e,0)}function Ul(e){var n=Es(e);if(mn(n))return e}function $p(e,n){if(e==="change")return n}var tm=!1;if(ca){var Hu;if(ca){var Gu="oninput"in document;if(!Gu){var em=document.createElement("div");em.setAttribute("oninput","return;"),Gu=typeof em.oninput=="function"}Hu=Gu}else Hu=!1;tm=Hu&&(!document.documentMode||9<document.documentMode)}function nm(){xo&&(xo.detachEvent("onpropertychange",im),So=xo=null)}function im(e){if(e.propertyName==="value"&&Ul(So)){var n=[];Jp(n,So,e,Uu(e)),Hp(fS,n)}}function hS(e,n,a){e==="focusin"?(nm(),xo=n,So=a,xo.attachEvent("onpropertychange",im)):e==="focusout"&&nm()}function dS(e){if(e==="selectionchange"||e==="keyup"||e==="keydown")return Ul(So)}function pS(e,n){if(e==="click")return Ul(n)}function mS(e,n){if(e==="input"||e==="change")return Ul(n)}function gS(e,n){return e===n&&(e!==0||1/e===1/n)||e!==e&&n!==n}var ii=typeof Object.is=="function"?Object.is:gS;function yo(e,n){if(ii(e,n))return!0;if(typeof e!="object"||e===null||typeof n!="object"||n===null)return!1;var a=Object.keys(e),o=Object.keys(n);if(a.length!==o.length)return!1;for(o=0;o<a.length;o++){var u=a[o];if(!je.call(n,u)||!ii(e[u],n[u]))return!1}return!0}function am(e){for(;e&&e.firstChild;)e=e.firstChild;return e}function sm(e,n){var a=am(e);e=0;for(var o;a;){if(a.nodeType===3){if(o=e+a.textContent.length,e<=n&&o>=n)return{node:a,offset:n-e};e=o}t:{for(;a;){if(a.nextSibling){a=a.nextSibling;break t}a=a.parentNode}a=void 0}a=am(a)}}function rm(e,n){return e&&n?e===n?!0:e&&e.nodeType===3?!1:n&&n.nodeType===3?rm(e,n.parentNode):"contains"in e?e.contains(n):e.compareDocumentPosition?!!(e.compareDocumentPosition(n)&16):!1:!1}function om(e){e=e!=null&&e.ownerDocument!=null&&e.ownerDocument.defaultView!=null?e.ownerDocument.defaultView:window;for(var n=kt(e.document);n instanceof e.HTMLIFrameElement;){try{var a=typeof n.contentWindow.location.href=="string"}catch{a=!1}if(a)e=n.contentWindow;else break;n=kt(e.document)}return n}function Vu(e){var n=e&&e.nodeName&&e.nodeName.toLowerCase();return n&&(n==="input"&&(e.type==="text"||e.type==="search"||e.type==="tel"||e.type==="url"||e.type==="password")||n==="textarea"||e.contentEditable==="true")}var _S=ca&&"documentMode"in document&&11>=document.documentMode,lr=null,ku=null,Mo=null,Xu=!1;function lm(e,n,a){var o=a.window===a?a.document:a.nodeType===9?a:a.ownerDocument;Xu||lr==null||lr!==kt(o)||(o=lr,"selectionStart"in o&&Vu(o)?o={start:o.selectionStart,end:o.selectionEnd}:(o=(o.ownerDocument&&o.ownerDocument.defaultView||window).getSelection(),o={anchorNode:o.anchorNode,anchorOffset:o.anchorOffset,focusNode:o.focusNode,focusOffset:o.focusOffset}),Mo&&yo(Mo,o)||(Mo=o,o=xc(ku,"onSelect"),0<o.length&&(n=new wl("onSelect","select",null,n,a),e.push({event:n,listeners:o}),n.target=lr)))}function Ts(e,n){var a={};return a[e.toLowerCase()]=n.toLowerCase(),a["Webkit"+e]="webkit"+n,a["Moz"+e]="moz"+n,a}var cr={animationend:Ts("Animation","AnimationEnd"),animationiteration:Ts("Animation","AnimationIteration"),animationstart:Ts("Animation","AnimationStart"),transitionrun:Ts("Transition","TransitionRun"),transitionstart:Ts("Transition","TransitionStart"),transitioncancel:Ts("Transition","TransitionCancel"),transitionend:Ts("Transition","TransitionEnd")},Wu={},cm={};ca&&(cm=document.createElement("div").style,"AnimationEvent"in window||(delete cr.animationend.animation,delete cr.animationiteration.animation,delete cr.animationstart.animation),"TransitionEvent"in window||delete cr.transitionend.transition);function As(e){if(Wu[e])return Wu[e];if(!cr[e])return e;var n=cr[e],a;for(a in n)if(n.hasOwnProperty(a)&&a in cm)return Wu[e]=n[a];return e}var um=As("animationend"),fm=As("animationiteration"),hm=As("animationstart"),vS=As("transitionrun"),xS=As("transitionstart"),SS=As("transitioncancel"),dm=As("transitionend"),pm=new Map,qu="abort auxClick beforeToggle cancel canPlay canPlayThrough click close contextMenu copy cut drag dragEnd dragEnter dragExit dragLeave dragOver dragStart drop durationChange emptied encrypted ended error gotPointerCapture input invalid keyDown keyPress keyUp load loadedData loadedMetadata loadStart lostPointerCapture mouseDown mouseMove mouseOut mouseOver mouseUp paste pause play playing pointerCancel pointerDown pointerMove pointerOut pointerOver pointerUp progress rateChange reset resize seeked seeking stalled submit suspend timeUpdate touchCancel touchEnd touchStart volumeChange scroll toggle touchMove waiting wheel".split(" ");qu.push("scrollEnd");function Ui(e,n){pm.set(e,n),nt(n,[e])}var Ll=typeof reportError=="function"?reportError:function(e){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var n=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof e=="object"&&e!==null&&typeof e.message=="string"?String(e.message):String(e),error:e});if(!window.dispatchEvent(n))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",e);return}console.error(e)},gi=[],ur=0,Yu=0;function Nl(){for(var e=ur,n=Yu=ur=0;n<e;){var a=gi[n];gi[n++]=null;var o=gi[n];gi[n++]=null;var u=gi[n];gi[n++]=null;var f=gi[n];if(gi[n++]=null,o!==null&&u!==null){var x=o.pending;x===null?u.next=u:(u.next=x.next,x.next=u),o.pending=u}f!==0&&mm(a,u,f)}}function Ol(e,n,a,o){gi[ur++]=e,gi[ur++]=n,gi[ur++]=a,gi[ur++]=o,Yu|=o,e.lanes|=o,e=e.alternate,e!==null&&(e.lanes|=o)}function ju(e,n,a,o){return Ol(e,n,a,o),Pl(e)}function Rs(e,n){return Ol(e,null,null,n),Pl(e)}function mm(e,n,a){e.lanes|=a;var o=e.alternate;o!==null&&(o.lanes|=a);for(var u=!1,f=e.return;f!==null;)f.childLanes|=a,o=f.alternate,o!==null&&(o.childLanes|=a),f.tag===22&&(e=f.stateNode,e===null||e._visibility&1||(u=!0)),e=f,f=f.return;return e.tag===3?(f=e.stateNode,u&&n!==null&&(u=31-Ot(a),e=f.hiddenUpdates,o=e[u],o===null?e[u]=[n]:o.push(n),n.lane=a|536870912),f):null}function Pl(e){if(50<Xo)throw Xo=0,ah=null,Error(s(185));for(var n=e.return;n!==null;)e=n,n=e.return;return e.tag===3?e.stateNode:null}var fr={};function yS(e,n,a,o){this.tag=e,this.key=a,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.refCleanup=this.ref=null,this.pendingProps=n,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=o,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function ai(e,n,a,o){return new yS(e,n,a,o)}function Zu(e){return e=e.prototype,!(!e||!e.isReactComponent)}function ua(e,n){var a=e.alternate;return a===null?(a=ai(e.tag,n,e.key,e.mode),a.elementType=e.elementType,a.type=e.type,a.stateNode=e.stateNode,a.alternate=e,e.alternate=a):(a.pendingProps=n,a.type=e.type,a.flags=0,a.subtreeFlags=0,a.deletions=null),a.flags=e.flags&65011712,a.childLanes=e.childLanes,a.lanes=e.lanes,a.child=e.child,a.memoizedProps=e.memoizedProps,a.memoizedState=e.memoizedState,a.updateQueue=e.updateQueue,n=e.dependencies,a.dependencies=n===null?null:{lanes:n.lanes,firstContext:n.firstContext},a.sibling=e.sibling,a.index=e.index,a.ref=e.ref,a.refCleanup=e.refCleanup,a}function gm(e,n){e.flags&=65011714;var a=e.alternate;return a===null?(e.childLanes=0,e.lanes=n,e.child=null,e.subtreeFlags=0,e.memoizedProps=null,e.memoizedState=null,e.updateQueue=null,e.dependencies=null,e.stateNode=null):(e.childLanes=a.childLanes,e.lanes=a.lanes,e.child=a.child,e.subtreeFlags=0,e.deletions=null,e.memoizedProps=a.memoizedProps,e.memoizedState=a.memoizedState,e.updateQueue=a.updateQueue,e.type=a.type,n=a.dependencies,e.dependencies=n===null?null:{lanes:n.lanes,firstContext:n.firstContext}),e}function zl(e,n,a,o,u,f){var x=0;if(o=e,typeof e=="function")Zu(e)&&(x=1);else if(typeof e=="string")x=Ay(e,a,vt.current)?26:e==="html"||e==="head"||e==="body"?27:5;else t:switch(e){case L:return e=ai(31,a,n,u),e.elementType=L,e.lanes=f,e;case A:return Cs(a.children,u,f,n);case y:x=8,u|=24;break;case S:return e=ai(12,a,n,u|2),e.elementType=S,e.lanes=f,e;case H:return e=ai(13,a,n,u),e.elementType=H,e.lanes=f,e;case F:return e=ai(19,a,n,u),e.elementType=F,e.lanes=f,e;default:if(typeof e=="object"&&e!==null)switch(e.$$typeof){case D:x=10;break t;case w:x=9;break t;case U:x=11;break t;case I:x=14;break t;case T:x=16,o=null;break t}x=29,a=Error(s(130,e===null?"null":typeof e,"")),o=null}return n=ai(x,a,n,u),n.elementType=e,n.type=o,n.lanes=f,n}function Cs(e,n,a,o){return e=ai(7,e,o,n),e.lanes=a,e}function Ku(e,n,a){return e=ai(6,e,null,n),e.lanes=a,e}function _m(e){var n=ai(18,null,null,0);return n.stateNode=e,n}function Qu(e,n,a){return n=ai(4,e.children!==null?e.children:[],e.key,n),n.lanes=a,n.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},n}var vm=new WeakMap;function _i(e,n){if(typeof e=="object"&&e!==null){var a=vm.get(e);return a!==void 0?a:(n={value:e,source:n,stack:V(n)},vm.set(e,n),n)}return{value:e,source:n,stack:V(n)}}var hr=[],dr=0,Il=null,Eo=0,vi=[],xi=0,Ga=null,Wi=1,qi="";function fa(e,n){hr[dr++]=Eo,hr[dr++]=Il,Il=e,Eo=n}function xm(e,n,a){vi[xi++]=Wi,vi[xi++]=qi,vi[xi++]=Ga,Ga=e;var o=Wi;e=qi;var u=32-Ot(o)-1;o&=~(1<<u),a+=1;var f=32-Ot(n)+u;if(30<f){var x=u-u%5;f=(o&(1<<x)-1).toString(32),o>>=x,u-=x,Wi=1<<32-Ot(n)+u|a<<u|o,qi=f+e}else Wi=1<<f|a<<u|o,qi=e}function Ju(e){e.return!==null&&(fa(e,1),xm(e,1,0))}function $u(e){for(;e===Il;)Il=hr[--dr],hr[dr]=null,Eo=hr[--dr],hr[dr]=null;for(;e===Ga;)Ga=vi[--xi],vi[xi]=null,qi=vi[--xi],vi[xi]=null,Wi=vi[--xi],vi[xi]=null}function Sm(e,n){vi[xi++]=Wi,vi[xi++]=qi,vi[xi++]=Ga,Wi=n.id,qi=n.overflow,Ga=e}var En=null,qe=null,Ee=!1,Va=null,Si=!1,tf=Error(s(519));function ka(e){var n=Error(s(418,1<arguments.length&&arguments[1]!==void 0&&arguments[1]?"text":"HTML",""));throw bo(_i(n,e)),tf}function ym(e){var n=e.stateNode,a=e.type,o=e.memoizedProps;switch(n[rn]=e,n[pn]=o,a){case"dialog":xe("cancel",n),xe("close",n);break;case"iframe":case"object":case"embed":xe("load",n);break;case"video":case"audio":for(a=0;a<qo.length;a++)xe(qo[a],n);break;case"source":xe("error",n);break;case"img":case"image":case"link":xe("error",n),xe("load",n);break;case"details":xe("toggle",n);break;case"input":xe("invalid",n),ei(n,o.value,o.defaultValue,o.checked,o.defaultChecked,o.type,o.name,!0);break;case"select":xe("invalid",n);break;case"textarea":xe("invalid",n),on(n,o.value,o.defaultValue,o.children)}a=o.children,typeof a!="string"&&typeof a!="number"&&typeof a!="bigint"||n.textContent===""+a||o.suppressHydrationWarning===!0||F0(n.textContent,a)?(o.popover!=null&&(xe("beforetoggle",n),xe("toggle",n)),o.onScroll!=null&&xe("scroll",n),o.onScrollEnd!=null&&xe("scrollend",n),o.onClick!=null&&(n.onclick=la),n=!0):n=!1,n||ka(e,!0)}function Mm(e){for(En=e.return;En;)switch(En.tag){case 5:case 31:case 13:Si=!1;return;case 27:case 3:Si=!0;return;default:En=En.return}}function pr(e){if(e!==En)return!1;if(!Ee)return Mm(e),Ee=!0,!1;var n=e.tag,a;if((a=n!==3&&n!==27)&&((a=n===5)&&(a=e.type,a=!(a!=="form"&&a!=="button")||xh(e.type,e.memoizedProps)),a=!a),a&&qe&&ka(e),Mm(e),n===13){if(e=e.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(s(317));qe=Y0(e)}else if(n===31){if(e=e.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(s(317));qe=Y0(e)}else n===27?(n=qe,is(e.type)?(e=bh,bh=null,qe=e):qe=n):qe=En?Mi(e.stateNode.nextSibling):null;return!0}function ws(){qe=En=null,Ee=!1}function ef(){var e=Va;return e!==null&&(Kn===null?Kn=e:Kn.push.apply(Kn,e),Va=null),e}function bo(e){Va===null?Va=[e]:Va.push(e)}var nf=N(null),Ds=null,ha=null;function Xa(e,n,a){ut(nf,n._currentValue),n._currentValue=a}function da(e){e._currentValue=nf.current,k(nf)}function af(e,n,a){for(;e!==null;){var o=e.alternate;if((e.childLanes&n)!==n?(e.childLanes|=n,o!==null&&(o.childLanes|=n)):o!==null&&(o.childLanes&n)!==n&&(o.childLanes|=n),e===a)break;e=e.return}}function sf(e,n,a,o){var u=e.child;for(u!==null&&(u.return=e);u!==null;){var f=u.dependencies;if(f!==null){var x=u.child;f=f.firstContext;t:for(;f!==null;){var R=f;f=u;for(var G=0;G<n.length;G++)if(R.context===n[G]){f.lanes|=a,R=f.alternate,R!==null&&(R.lanes|=a),af(f.return,a,e),o||(x=null);break t}f=R.next}}else if(u.tag===18){if(x=u.return,x===null)throw Error(s(341));x.lanes|=a,f=x.alternate,f!==null&&(f.lanes|=a),af(x,a,e),x=null}else x=u.child;if(x!==null)x.return=u;else for(x=u;x!==null;){if(x===e){x=null;break}if(u=x.sibling,u!==null){u.return=x.return,x=u;break}x=x.return}u=x}}function mr(e,n,a,o){e=null;for(var u=n,f=!1;u!==null;){if(!f){if((u.flags&524288)!==0)f=!0;else if((u.flags&262144)!==0)break}if(u.tag===10){var x=u.alternate;if(x===null)throw Error(s(387));if(x=x.memoizedProps,x!==null){var R=u.type;ii(u.pendingProps.value,x.value)||(e!==null?e.push(R):e=[R])}}else if(u===dt.current){if(x=u.alternate,x===null)throw Error(s(387));x.memoizedState.memoizedState!==u.memoizedState.memoizedState&&(e!==null?e.push(Qo):e=[Qo])}u=u.return}e!==null&&sf(n,e,a,o),n.flags|=262144}function Fl(e){for(e=e.firstContext;e!==null;){if(!ii(e.context._currentValue,e.memoizedValue))return!0;e=e.next}return!1}function Us(e){Ds=e,ha=null,e=e.dependencies,e!==null&&(e.firstContext=null)}function bn(e){return Em(Ds,e)}function Bl(e,n){return Ds===null&&Us(e),Em(e,n)}function Em(e,n){var a=n._currentValue;if(n={context:n,memoizedValue:a,next:null},ha===null){if(e===null)throw Error(s(308));ha=n,e.dependencies={lanes:0,firstContext:n},e.flags|=524288}else ha=ha.next=n;return a}var MS=typeof AbortController<"u"?AbortController:function(){var e=[],n=this.signal={aborted:!1,addEventListener:function(a,o){e.push(o)}};this.abort=function(){n.aborted=!0,e.forEach(function(a){return a()})}},ES=r.unstable_scheduleCallback,bS=r.unstable_NormalPriority,cn={$$typeof:D,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function rf(){return{controller:new MS,data:new Map,refCount:0}}function To(e){e.refCount--,e.refCount===0&&ES(bS,function(){e.controller.abort()})}var Ao=null,of=0,gr=0,_r=null;function TS(e,n){if(Ao===null){var a=Ao=[];of=0,gr=uh(),_r={status:"pending",value:void 0,then:function(o){a.push(o)}}}return of++,n.then(bm,bm),n}function bm(){if(--of===0&&Ao!==null){_r!==null&&(_r.status="fulfilled");var e=Ao;Ao=null,gr=0,_r=null;for(var n=0;n<e.length;n++)(0,e[n])()}}function AS(e,n){var a=[],o={status:"pending",value:null,reason:null,then:function(u){a.push(u)}};return e.then(function(){o.status="fulfilled",o.value=n;for(var u=0;u<a.length;u++)(0,a[u])(n)},function(u){for(o.status="rejected",o.reason=u,u=0;u<a.length;u++)(0,a[u])(void 0)}),o}var Tm=O.S;O.S=function(e,n){l0=b(),typeof n=="object"&&n!==null&&typeof n.then=="function"&&TS(e,n),Tm!==null&&Tm(e,n)};var Ls=N(null);function lf(){var e=Ls.current;return e!==null?e:Xe.pooledCache}function Hl(e,n){n===null?ut(Ls,Ls.current):ut(Ls,n.pool)}function Am(){var e=lf();return e===null?null:{parent:cn._currentValue,pool:e}}var vr=Error(s(460)),cf=Error(s(474)),Gl=Error(s(542)),Vl={then:function(){}};function Rm(e){return e=e.status,e==="fulfilled"||e==="rejected"}function Cm(e,n,a){switch(a=e[a],a===void 0?e.push(n):a!==n&&(n.then(la,la),n=a),n.status){case"fulfilled":return n.value;case"rejected":throw e=n.reason,Dm(e),e;default:if(typeof n.status=="string")n.then(la,la);else{if(e=Xe,e!==null&&100<e.shellSuspendCounter)throw Error(s(482));e=n,e.status="pending",e.then(function(o){if(n.status==="pending"){var u=n;u.status="fulfilled",u.value=o}},function(o){if(n.status==="pending"){var u=n;u.status="rejected",u.reason=o}})}switch(n.status){case"fulfilled":return n.value;case"rejected":throw e=n.reason,Dm(e),e}throw Os=n,vr}}function Ns(e){try{var n=e._init;return n(e._payload)}catch(a){throw a!==null&&typeof a=="object"&&typeof a.then=="function"?(Os=a,vr):a}}var Os=null;function wm(){if(Os===null)throw Error(s(459));var e=Os;return Os=null,e}function Dm(e){if(e===vr||e===Gl)throw Error(s(483))}var xr=null,Ro=0;function kl(e){var n=Ro;return Ro+=1,xr===null&&(xr=[]),Cm(xr,e,n)}function Co(e,n){n=n.props.ref,e.ref=n!==void 0?n:null}function Xl(e,n){throw n.$$typeof===_?Error(s(525)):(e=Object.prototype.toString.call(n),Error(s(31,e==="[object Object]"?"object with keys {"+Object.keys(n).join(", ")+"}":e)))}function Um(e){function n(tt,X){if(e){var it=tt.deletions;it===null?(tt.deletions=[X],tt.flags|=16):it.push(X)}}function a(tt,X){if(!e)return null;for(;X!==null;)n(tt,X),X=X.sibling;return null}function o(tt){for(var X=new Map;tt!==null;)tt.key!==null?X.set(tt.key,tt):X.set(tt.index,tt),tt=tt.sibling;return X}function u(tt,X){return tt=ua(tt,X),tt.index=0,tt.sibling=null,tt}function f(tt,X,it){return tt.index=it,e?(it=tt.alternate,it!==null?(it=it.index,it<X?(tt.flags|=67108866,X):it):(tt.flags|=67108866,X)):(tt.flags|=1048576,X)}function x(tt){return e&&tt.alternate===null&&(tt.flags|=67108866),tt}function R(tt,X,it,xt){return X===null||X.tag!==6?(X=Ku(it,tt.mode,xt),X.return=tt,X):(X=u(X,it),X.return=tt,X)}function G(tt,X,it,xt){var Qt=it.type;return Qt===A?gt(tt,X,it.props.children,xt,it.key):X!==null&&(X.elementType===Qt||typeof Qt=="object"&&Qt!==null&&Qt.$$typeof===T&&Ns(Qt)===X.type)?(X=u(X,it.props),Co(X,it),X.return=tt,X):(X=zl(it.type,it.key,it.props,null,tt.mode,xt),Co(X,it),X.return=tt,X)}function st(tt,X,it,xt){return X===null||X.tag!==4||X.stateNode.containerInfo!==it.containerInfo||X.stateNode.implementation!==it.implementation?(X=Qu(it,tt.mode,xt),X.return=tt,X):(X=u(X,it.children||[]),X.return=tt,X)}function gt(tt,X,it,xt,Qt){return X===null||X.tag!==7?(X=Cs(it,tt.mode,xt,Qt),X.return=tt,X):(X=u(X,it),X.return=tt,X)}function St(tt,X,it){if(typeof X=="string"&&X!==""||typeof X=="number"||typeof X=="bigint")return X=Ku(""+X,tt.mode,it),X.return=tt,X;if(typeof X=="object"&&X!==null){switch(X.$$typeof){case M:return it=zl(X.type,X.key,X.props,null,tt.mode,it),Co(it,X),it.return=tt,it;case E:return X=Qu(X,tt.mode,it),X.return=tt,X;case T:return X=Ns(X),St(tt,X,it)}if(et(X)||W(X))return X=Cs(X,tt.mode,it,null),X.return=tt,X;if(typeof X.then=="function")return St(tt,kl(X),it);if(X.$$typeof===D)return St(tt,Bl(tt,X),it);Xl(tt,X)}return null}function ct(tt,X,it,xt){var Qt=X!==null?X.key:null;if(typeof it=="string"&&it!==""||typeof it=="number"||typeof it=="bigint")return Qt!==null?null:R(tt,X,""+it,xt);if(typeof it=="object"&&it!==null){switch(it.$$typeof){case M:return it.key===Qt?G(tt,X,it,xt):null;case E:return it.key===Qt?st(tt,X,it,xt):null;case T:return it=Ns(it),ct(tt,X,it,xt)}if(et(it)||W(it))return Qt!==null?null:gt(tt,X,it,xt,null);if(typeof it.then=="function")return ct(tt,X,kl(it),xt);if(it.$$typeof===D)return ct(tt,X,Bl(tt,it),xt);Xl(tt,it)}return null}function ht(tt,X,it,xt,Qt){if(typeof xt=="string"&&xt!==""||typeof xt=="number"||typeof xt=="bigint")return tt=tt.get(it)||null,R(X,tt,""+xt,Qt);if(typeof xt=="object"&&xt!==null){switch(xt.$$typeof){case M:return tt=tt.get(xt.key===null?it:xt.key)||null,G(X,tt,xt,Qt);case E:return tt=tt.get(xt.key===null?it:xt.key)||null,st(X,tt,xt,Qt);case T:return xt=Ns(xt),ht(tt,X,it,xt,Qt)}if(et(xt)||W(xt))return tt=tt.get(it)||null,gt(X,tt,xt,Qt,null);if(typeof xt.then=="function")return ht(tt,X,it,kl(xt),Qt);if(xt.$$typeof===D)return ht(tt,X,it,Bl(X,xt),Qt);Xl(X,xt)}return null}function Vt(tt,X,it,xt){for(var Qt=null,we=null,jt=X,de=X=0,Me=null;jt!==null&&de<it.length;de++){jt.index>de?(Me=jt,jt=null):Me=jt.sibling;var De=ct(tt,jt,it[de],xt);if(De===null){jt===null&&(jt=Me);break}e&&jt&&De.alternate===null&&n(tt,jt),X=f(De,X,de),we===null?Qt=De:we.sibling=De,we=De,jt=Me}if(de===it.length)return a(tt,jt),Ee&&fa(tt,de),Qt;if(jt===null){for(;de<it.length;de++)jt=St(tt,it[de],xt),jt!==null&&(X=f(jt,X,de),we===null?Qt=jt:we.sibling=jt,we=jt);return Ee&&fa(tt,de),Qt}for(jt=o(jt);de<it.length;de++)Me=ht(jt,tt,de,it[de],xt),Me!==null&&(e&&Me.alternate!==null&&jt.delete(Me.key===null?de:Me.key),X=f(Me,X,de),we===null?Qt=Me:we.sibling=Me,we=Me);return e&&jt.forEach(function(ls){return n(tt,ls)}),Ee&&fa(tt,de),Qt}function $t(tt,X,it,xt){if(it==null)throw Error(s(151));for(var Qt=null,we=null,jt=X,de=X=0,Me=null,De=it.next();jt!==null&&!De.done;de++,De=it.next()){jt.index>de?(Me=jt,jt=null):Me=jt.sibling;var ls=ct(tt,jt,De.value,xt);if(ls===null){jt===null&&(jt=Me);break}e&&jt&&ls.alternate===null&&n(tt,jt),X=f(ls,X,de),we===null?Qt=ls:we.sibling=ls,we=ls,jt=Me}if(De.done)return a(tt,jt),Ee&&fa(tt,de),Qt;if(jt===null){for(;!De.done;de++,De=it.next())De=St(tt,De.value,xt),De!==null&&(X=f(De,X,de),we===null?Qt=De:we.sibling=De,we=De);return Ee&&fa(tt,de),Qt}for(jt=o(jt);!De.done;de++,De=it.next())De=ht(jt,tt,de,De.value,xt),De!==null&&(e&&De.alternate!==null&&jt.delete(De.key===null?de:De.key),X=f(De,X,de),we===null?Qt=De:we.sibling=De,we=De);return e&&jt.forEach(function(Iy){return n(tt,Iy)}),Ee&&fa(tt,de),Qt}function Ve(tt,X,it,xt){if(typeof it=="object"&&it!==null&&it.type===A&&it.key===null&&(it=it.props.children),typeof it=="object"&&it!==null){switch(it.$$typeof){case M:t:{for(var Qt=it.key;X!==null;){if(X.key===Qt){if(Qt=it.type,Qt===A){if(X.tag===7){a(tt,X.sibling),xt=u(X,it.props.children),xt.return=tt,tt=xt;break t}}else if(X.elementType===Qt||typeof Qt=="object"&&Qt!==null&&Qt.$$typeof===T&&Ns(Qt)===X.type){a(tt,X.sibling),xt=u(X,it.props),Co(xt,it),xt.return=tt,tt=xt;break t}a(tt,X);break}else n(tt,X);X=X.sibling}it.type===A?(xt=Cs(it.props.children,tt.mode,xt,it.key),xt.return=tt,tt=xt):(xt=zl(it.type,it.key,it.props,null,tt.mode,xt),Co(xt,it),xt.return=tt,tt=xt)}return x(tt);case E:t:{for(Qt=it.key;X!==null;){if(X.key===Qt)if(X.tag===4&&X.stateNode.containerInfo===it.containerInfo&&X.stateNode.implementation===it.implementation){a(tt,X.sibling),xt=u(X,it.children||[]),xt.return=tt,tt=xt;break t}else{a(tt,X);break}else n(tt,X);X=X.sibling}xt=Qu(it,tt.mode,xt),xt.return=tt,tt=xt}return x(tt);case T:return it=Ns(it),Ve(tt,X,it,xt)}if(et(it))return Vt(tt,X,it,xt);if(W(it)){if(Qt=W(it),typeof Qt!="function")throw Error(s(150));return it=Qt.call(it),$t(tt,X,it,xt)}if(typeof it.then=="function")return Ve(tt,X,kl(it),xt);if(it.$$typeof===D)return Ve(tt,X,Bl(tt,it),xt);Xl(tt,it)}return typeof it=="string"&&it!==""||typeof it=="number"||typeof it=="bigint"?(it=""+it,X!==null&&X.tag===6?(a(tt,X.sibling),xt=u(X,it),xt.return=tt,tt=xt):(a(tt,X),xt=Ku(it,tt.mode,xt),xt.return=tt,tt=xt),x(tt)):a(tt,X)}return function(tt,X,it,xt){try{Ro=0;var Qt=Ve(tt,X,it,xt);return xr=null,Qt}catch(jt){if(jt===vr||jt===Gl)throw jt;var we=ai(29,jt,null,tt.mode);return we.lanes=xt,we.return=tt,we}}}var Ps=Um(!0),Lm=Um(!1),Wa=!1;function uf(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function ff(e,n){e=e.updateQueue,n.updateQueue===e&&(n.updateQueue={baseState:e.baseState,firstBaseUpdate:e.firstBaseUpdate,lastBaseUpdate:e.lastBaseUpdate,shared:e.shared,callbacks:null})}function qa(e){return{lane:e,tag:0,payload:null,callback:null,next:null}}function Ya(e,n,a){var o=e.updateQueue;if(o===null)return null;if(o=o.shared,(Le&2)!==0){var u=o.pending;return u===null?n.next=n:(n.next=u.next,u.next=n),o.pending=n,n=Pl(e),mm(e,null,a),n}return Ol(e,o,n,a),Pl(e)}function wo(e,n,a){if(n=n.updateQueue,n!==null&&(n=n.shared,(a&4194048)!==0)){var o=n.lanes;o&=e.pendingLanes,a|=o,n.lanes=a,tr(e,a)}}function hf(e,n){var a=e.updateQueue,o=e.alternate;if(o!==null&&(o=o.updateQueue,a===o)){var u=null,f=null;if(a=a.firstBaseUpdate,a!==null){do{var x={lane:a.lane,tag:a.tag,payload:a.payload,callback:null,next:null};f===null?u=f=x:f=f.next=x,a=a.next}while(a!==null);f===null?u=f=n:f=f.next=n}else u=f=n;a={baseState:o.baseState,firstBaseUpdate:u,lastBaseUpdate:f,shared:o.shared,callbacks:o.callbacks},e.updateQueue=a;return}e=a.lastBaseUpdate,e===null?a.firstBaseUpdate=n:e.next=n,a.lastBaseUpdate=n}var df=!1;function Do(){if(df){var e=_r;if(e!==null)throw e}}function Uo(e,n,a,o){df=!1;var u=e.updateQueue;Wa=!1;var f=u.firstBaseUpdate,x=u.lastBaseUpdate,R=u.shared.pending;if(R!==null){u.shared.pending=null;var G=R,st=G.next;G.next=null,x===null?f=st:x.next=st,x=G;var gt=e.alternate;gt!==null&&(gt=gt.updateQueue,R=gt.lastBaseUpdate,R!==x&&(R===null?gt.firstBaseUpdate=st:R.next=st,gt.lastBaseUpdate=G))}if(f!==null){var St=u.baseState;x=0,gt=st=G=null,R=f;do{var ct=R.lane&-536870913,ht=ct!==R.lane;if(ht?(ye&ct)===ct:(o&ct)===ct){ct!==0&&ct===gr&&(df=!0),gt!==null&&(gt=gt.next={lane:0,tag:R.tag,payload:R.payload,callback:null,next:null});t:{var Vt=e,$t=R;ct=n;var Ve=a;switch($t.tag){case 1:if(Vt=$t.payload,typeof Vt=="function"){St=Vt.call(Ve,St,ct);break t}St=Vt;break t;case 3:Vt.flags=Vt.flags&-65537|128;case 0:if(Vt=$t.payload,ct=typeof Vt=="function"?Vt.call(Ve,St,ct):Vt,ct==null)break t;St=g({},St,ct);break t;case 2:Wa=!0}}ct=R.callback,ct!==null&&(e.flags|=64,ht&&(e.flags|=8192),ht=u.callbacks,ht===null?u.callbacks=[ct]:ht.push(ct))}else ht={lane:ct,tag:R.tag,payload:R.payload,callback:R.callback,next:null},gt===null?(st=gt=ht,G=St):gt=gt.next=ht,x|=ct;if(R=R.next,R===null){if(R=u.shared.pending,R===null)break;ht=R,R=ht.next,ht.next=null,u.lastBaseUpdate=ht,u.shared.pending=null}}while(!0);gt===null&&(G=St),u.baseState=G,u.firstBaseUpdate=st,u.lastBaseUpdate=gt,f===null&&(u.shared.lanes=0),Ja|=x,e.lanes=x,e.memoizedState=St}}function Nm(e,n){if(typeof e!="function")throw Error(s(191,e));e.call(n)}function Om(e,n){var a=e.callbacks;if(a!==null)for(e.callbacks=null,e=0;e<a.length;e++)Nm(a[e],n)}var Sr=N(null),Wl=N(0);function Pm(e,n){e=Ma,ut(Wl,e),ut(Sr,n),Ma=e|n.baseLanes}function pf(){ut(Wl,Ma),ut(Sr,Sr.current)}function mf(){Ma=Wl.current,k(Sr),k(Wl)}var si=N(null),yi=null;function ja(e){var n=e.alternate;ut(nn,nn.current&1),ut(si,e),yi===null&&(n===null||Sr.current!==null||n.memoizedState!==null)&&(yi=e)}function gf(e){ut(nn,nn.current),ut(si,e),yi===null&&(yi=e)}function zm(e){e.tag===22?(ut(nn,nn.current),ut(si,e),yi===null&&(yi=e)):Za()}function Za(){ut(nn,nn.current),ut(si,si.current)}function ri(e){k(si),yi===e&&(yi=null),k(nn)}var nn=N(0);function ql(e){for(var n=e;n!==null;){if(n.tag===13){var a=n.memoizedState;if(a!==null&&(a=a.dehydrated,a===null||Mh(a)||Eh(a)))return n}else if(n.tag===19&&(n.memoizedProps.revealOrder==="forwards"||n.memoizedProps.revealOrder==="backwards"||n.memoizedProps.revealOrder==="unstable_legacy-backwards"||n.memoizedProps.revealOrder==="together")){if((n.flags&128)!==0)return n}else if(n.child!==null){n.child.return=n,n=n.child;continue}if(n===e)break;for(;n.sibling===null;){if(n.return===null||n.return===e)return null;n=n.return}n.sibling.return=n.return,n=n.sibling}return null}var pa=0,ue=null,He=null,un=null,Yl=!1,yr=!1,zs=!1,jl=0,Lo=0,Mr=null,RS=0;function tn(){throw Error(s(321))}function _f(e,n){if(n===null)return!1;for(var a=0;a<n.length&&a<e.length;a++)if(!ii(e[a],n[a]))return!1;return!0}function vf(e,n,a,o,u,f){return pa=f,ue=n,n.memoizedState=null,n.updateQueue=null,n.lanes=0,O.H=e===null||e.memoizedState===null?xg:Nf,zs=!1,f=a(o,u),zs=!1,yr&&(f=Fm(n,a,o,u)),Im(e),f}function Im(e){O.H=Po;var n=He!==null&&He.next!==null;if(pa=0,un=He=ue=null,Yl=!1,Lo=0,Mr=null,n)throw Error(s(300));e===null||fn||(e=e.dependencies,e!==null&&Fl(e)&&(fn=!0))}function Fm(e,n,a,o){ue=e;var u=0;do{if(yr&&(Mr=null),Lo=0,yr=!1,25<=u)throw Error(s(301));if(u+=1,un=He=null,e.updateQueue!=null){var f=e.updateQueue;f.lastEffect=null,f.events=null,f.stores=null,f.memoCache!=null&&(f.memoCache.index=0)}O.H=Sg,f=n(a,o)}while(yr);return f}function CS(){var e=O.H,n=e.useState()[0];return n=typeof n.then=="function"?No(n):n,e=e.useState()[0],(He!==null?He.memoizedState:null)!==e&&(ue.flags|=1024),n}function xf(){var e=jl!==0;return jl=0,e}function Sf(e,n,a){n.updateQueue=e.updateQueue,n.flags&=-2053,e.lanes&=~a}function yf(e){if(Yl){for(e=e.memoizedState;e!==null;){var n=e.queue;n!==null&&(n.pending=null),e=e.next}Yl=!1}pa=0,un=He=ue=null,yr=!1,Lo=jl=0,Mr=null}function Gn(){var e={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return un===null?ue.memoizedState=un=e:un=un.next=e,un}function an(){if(He===null){var e=ue.alternate;e=e!==null?e.memoizedState:null}else e=He.next;var n=un===null?ue.memoizedState:un.next;if(n!==null)un=n,He=e;else{if(e===null)throw ue.alternate===null?Error(s(467)):Error(s(310));He=e,e={memoizedState:He.memoizedState,baseState:He.baseState,baseQueue:He.baseQueue,queue:He.queue,next:null},un===null?ue.memoizedState=un=e:un=un.next=e}return un}function Zl(){return{lastEffect:null,events:null,stores:null,memoCache:null}}function No(e){var n=Lo;return Lo+=1,Mr===null&&(Mr=[]),e=Cm(Mr,e,n),n=ue,(un===null?n.memoizedState:un.next)===null&&(n=n.alternate,O.H=n===null||n.memoizedState===null?xg:Nf),e}function Kl(e){if(e!==null&&typeof e=="object"){if(typeof e.then=="function")return No(e);if(e.$$typeof===D)return bn(e)}throw Error(s(438,String(e)))}function Mf(e){var n=null,a=ue.updateQueue;if(a!==null&&(n=a.memoCache),n==null){var o=ue.alternate;o!==null&&(o=o.updateQueue,o!==null&&(o=o.memoCache,o!=null&&(n={data:o.data.map(function(u){return u.slice()}),index:0})))}if(n==null&&(n={data:[],index:0}),a===null&&(a=Zl(),ue.updateQueue=a),a.memoCache=n,a=n.data[n.index],a===void 0)for(a=n.data[n.index]=Array(e),o=0;o<e;o++)a[o]=Q;return n.index++,a}function ma(e,n){return typeof n=="function"?n(e):n}function Ql(e){var n=an();return Ef(n,He,e)}function Ef(e,n,a){var o=e.queue;if(o===null)throw Error(s(311));o.lastRenderedReducer=a;var u=e.baseQueue,f=o.pending;if(f!==null){if(u!==null){var x=u.next;u.next=f.next,f.next=x}n.baseQueue=u=f,o.pending=null}if(f=e.baseState,u===null)e.memoizedState=f;else{n=u.next;var R=x=null,G=null,st=n,gt=!1;do{var St=st.lane&-536870913;if(St!==st.lane?(ye&St)===St:(pa&St)===St){var ct=st.revertLane;if(ct===0)G!==null&&(G=G.next={lane:0,revertLane:0,gesture:null,action:st.action,hasEagerState:st.hasEagerState,eagerState:st.eagerState,next:null}),St===gr&&(gt=!0);else if((pa&ct)===ct){st=st.next,ct===gr&&(gt=!0);continue}else St={lane:0,revertLane:st.revertLane,gesture:null,action:st.action,hasEagerState:st.hasEagerState,eagerState:st.eagerState,next:null},G===null?(R=G=St,x=f):G=G.next=St,ue.lanes|=ct,Ja|=ct;St=st.action,zs&&a(f,St),f=st.hasEagerState?st.eagerState:a(f,St)}else ct={lane:St,revertLane:st.revertLane,gesture:st.gesture,action:st.action,hasEagerState:st.hasEagerState,eagerState:st.eagerState,next:null},G===null?(R=G=ct,x=f):G=G.next=ct,ue.lanes|=St,Ja|=St;st=st.next}while(st!==null&&st!==n);if(G===null?x=f:G.next=R,!ii(f,e.memoizedState)&&(fn=!0,gt&&(a=_r,a!==null)))throw a;e.memoizedState=f,e.baseState=x,e.baseQueue=G,o.lastRenderedState=f}return u===null&&(o.lanes=0),[e.memoizedState,o.dispatch]}function bf(e){var n=an(),a=n.queue;if(a===null)throw Error(s(311));a.lastRenderedReducer=e;var o=a.dispatch,u=a.pending,f=n.memoizedState;if(u!==null){a.pending=null;var x=u=u.next;do f=e(f,x.action),x=x.next;while(x!==u);ii(f,n.memoizedState)||(fn=!0),n.memoizedState=f,n.baseQueue===null&&(n.baseState=f),a.lastRenderedState=f}return[f,o]}function Bm(e,n,a){var o=ue,u=an(),f=Ee;if(f){if(a===void 0)throw Error(s(407));a=a()}else a=n();var x=!ii((He||u).memoizedState,a);if(x&&(u.memoizedState=a,fn=!0),u=u.queue,Rf(Vm.bind(null,o,u,e),[e]),u.getSnapshot!==n||x||un!==null&&un.memoizedState.tag&1){if(o.flags|=2048,Er(9,{destroy:void 0},Gm.bind(null,o,u,a,n),null),Xe===null)throw Error(s(349));f||(pa&127)!==0||Hm(o,n,a)}return a}function Hm(e,n,a){e.flags|=16384,e={getSnapshot:n,value:a},n=ue.updateQueue,n===null?(n=Zl(),ue.updateQueue=n,n.stores=[e]):(a=n.stores,a===null?n.stores=[e]:a.push(e))}function Gm(e,n,a,o){n.value=a,n.getSnapshot=o,km(n)&&Xm(e)}function Vm(e,n,a){return a(function(){km(n)&&Xm(e)})}function km(e){var n=e.getSnapshot;e=e.value;try{var a=n();return!ii(e,a)}catch{return!0}}function Xm(e){var n=Rs(e,2);n!==null&&Qn(n,e,2)}function Tf(e){var n=Gn();if(typeof e=="function"){var a=e;if(e=a(),zs){Pt(!0);try{a()}finally{Pt(!1)}}}return n.memoizedState=n.baseState=e,n.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:ma,lastRenderedState:e},n}function Wm(e,n,a,o){return e.baseState=a,Ef(e,He,typeof o=="function"?o:ma)}function wS(e,n,a,o,u){if(tc(e))throw Error(s(485));if(e=n.action,e!==null){var f={payload:u,action:e,next:null,isTransition:!0,status:"pending",value:null,reason:null,listeners:[],then:function(x){f.listeners.push(x)}};O.T!==null?a(!0):f.isTransition=!1,o(f),a=n.pending,a===null?(f.next=n.pending=f,qm(n,f)):(f.next=a.next,n.pending=a.next=f)}}function qm(e,n){var a=n.action,o=n.payload,u=e.state;if(n.isTransition){var f=O.T,x={};O.T=x;try{var R=a(u,o),G=O.S;G!==null&&G(x,R),Ym(e,n,R)}catch(st){Af(e,n,st)}finally{f!==null&&x.types!==null&&(f.types=x.types),O.T=f}}else try{f=a(u,o),Ym(e,n,f)}catch(st){Af(e,n,st)}}function Ym(e,n,a){a!==null&&typeof a=="object"&&typeof a.then=="function"?a.then(function(o){jm(e,n,o)},function(o){return Af(e,n,o)}):jm(e,n,a)}function jm(e,n,a){n.status="fulfilled",n.value=a,Zm(n),e.state=a,n=e.pending,n!==null&&(a=n.next,a===n?e.pending=null:(a=a.next,n.next=a,qm(e,a)))}function Af(e,n,a){var o=e.pending;if(e.pending=null,o!==null){o=o.next;do n.status="rejected",n.reason=a,Zm(n),n=n.next;while(n!==o)}e.action=null}function Zm(e){e=e.listeners;for(var n=0;n<e.length;n++)(0,e[n])()}function Km(e,n){return n}function Qm(e,n){if(Ee){var a=Xe.formState;if(a!==null){t:{var o=ue;if(Ee){if(qe){e:{for(var u=qe,f=Si;u.nodeType!==8;){if(!f){u=null;break e}if(u=Mi(u.nextSibling),u===null){u=null;break e}}f=u.data,u=f==="F!"||f==="F"?u:null}if(u){qe=Mi(u.nextSibling),o=u.data==="F!";break t}}ka(o)}o=!1}o&&(n=a[0])}}return a=Gn(),a.memoizedState=a.baseState=n,o={pending:null,lanes:0,dispatch:null,lastRenderedReducer:Km,lastRenderedState:n},a.queue=o,a=gg.bind(null,ue,o),o.dispatch=a,o=Tf(!1),f=Lf.bind(null,ue,!1,o.queue),o=Gn(),u={state:n,dispatch:null,action:e,pending:null},o.queue=u,a=wS.bind(null,ue,u,f,a),u.dispatch=a,o.memoizedState=e,[n,a,!1]}function Jm(e){var n=an();return $m(n,He,e)}function $m(e,n,a){if(n=Ef(e,n,Km)[0],e=Ql(ma)[0],typeof n=="object"&&n!==null&&typeof n.then=="function")try{var o=No(n)}catch(x){throw x===vr?Gl:x}else o=n;n=an();var u=n.queue,f=u.dispatch;return a!==n.memoizedState&&(ue.flags|=2048,Er(9,{destroy:void 0},DS.bind(null,u,a),null)),[o,f,e]}function DS(e,n){e.action=n}function tg(e){var n=an(),a=He;if(a!==null)return $m(n,a,e);an(),n=n.memoizedState,a=an();var o=a.queue.dispatch;return a.memoizedState=e,[n,o,!1]}function Er(e,n,a,o){return e={tag:e,create:a,deps:o,inst:n,next:null},n=ue.updateQueue,n===null&&(n=Zl(),ue.updateQueue=n),a=n.lastEffect,a===null?n.lastEffect=e.next=e:(o=a.next,a.next=e,e.next=o,n.lastEffect=e),e}function eg(){return an().memoizedState}function Jl(e,n,a,o){var u=Gn();ue.flags|=e,u.memoizedState=Er(1|n,{destroy:void 0},a,o===void 0?null:o)}function $l(e,n,a,o){var u=an();o=o===void 0?null:o;var f=u.memoizedState.inst;He!==null&&o!==null&&_f(o,He.memoizedState.deps)?u.memoizedState=Er(n,f,a,o):(ue.flags|=e,u.memoizedState=Er(1|n,f,a,o))}function ng(e,n){Jl(8390656,8,e,n)}function Rf(e,n){$l(2048,8,e,n)}function US(e){ue.flags|=4;var n=ue.updateQueue;if(n===null)n=Zl(),ue.updateQueue=n,n.events=[e];else{var a=n.events;a===null?n.events=[e]:a.push(e)}}function ig(e){var n=an().memoizedState;return US({ref:n,nextImpl:e}),function(){if((Le&2)!==0)throw Error(s(440));return n.impl.apply(void 0,arguments)}}function ag(e,n){return $l(4,2,e,n)}function sg(e,n){return $l(4,4,e,n)}function rg(e,n){if(typeof n=="function"){e=e();var a=n(e);return function(){typeof a=="function"?a():n(null)}}if(n!=null)return e=e(),n.current=e,function(){n.current=null}}function og(e,n,a){a=a!=null?a.concat([e]):null,$l(4,4,rg.bind(null,n,e),a)}function Cf(){}function lg(e,n){var a=an();n=n===void 0?null:n;var o=a.memoizedState;return n!==null&&_f(n,o[1])?o[0]:(a.memoizedState=[e,n],e)}function cg(e,n){var a=an();n=n===void 0?null:n;var o=a.memoizedState;if(n!==null&&_f(n,o[1]))return o[0];if(o=e(),zs){Pt(!0);try{e()}finally{Pt(!1)}}return a.memoizedState=[o,n],o}function wf(e,n,a){return a===void 0||(pa&1073741824)!==0&&(ye&261930)===0?e.memoizedState=n:(e.memoizedState=a,e=u0(),ue.lanes|=e,Ja|=e,a)}function ug(e,n,a,o){return ii(a,n)?a:Sr.current!==null?(e=wf(e,a,o),ii(e,n)||(fn=!0),e):(pa&42)===0||(pa&1073741824)!==0&&(ye&261930)===0?(fn=!0,e.memoizedState=a):(e=u0(),ue.lanes|=e,Ja|=e,n)}function fg(e,n,a,o,u){var f=B.p;B.p=f!==0&&8>f?f:8;var x=O.T,R={};O.T=R,Lf(e,!1,n,a);try{var G=u(),st=O.S;if(st!==null&&st(R,G),G!==null&&typeof G=="object"&&typeof G.then=="function"){var gt=AS(G,o);Oo(e,n,gt,ci(e))}else Oo(e,n,o,ci(e))}catch(St){Oo(e,n,{then:function(){},status:"rejected",reason:St},ci())}finally{B.p=f,x!==null&&R.types!==null&&(x.types=R.types),O.T=x}}function LS(){}function Df(e,n,a,o){if(e.tag!==5)throw Error(s(476));var u=hg(e).queue;fg(e,u,n,at,a===null?LS:function(){return dg(e),a(o)})}function hg(e){var n=e.memoizedState;if(n!==null)return n;n={memoizedState:at,baseState:at,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:ma,lastRenderedState:at},next:null};var a={};return n.next={memoizedState:a,baseState:a,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:ma,lastRenderedState:a},next:null},e.memoizedState=n,e=e.alternate,e!==null&&(e.memoizedState=n),n}function dg(e){var n=hg(e);n.next===null&&(n=e.alternate.memoizedState),Oo(e,n.next.queue,{},ci())}function Uf(){return bn(Qo)}function pg(){return an().memoizedState}function mg(){return an().memoizedState}function NS(e){for(var n=e.return;n!==null;){switch(n.tag){case 24:case 3:var a=ci();e=qa(a);var o=Ya(n,e,a);o!==null&&(Qn(o,n,a),wo(o,n,a)),n={cache:rf()},e.payload=n;return}n=n.return}}function OS(e,n,a){var o=ci();a={lane:o,revertLane:0,gesture:null,action:a,hasEagerState:!1,eagerState:null,next:null},tc(e)?_g(n,a):(a=ju(e,n,a,o),a!==null&&(Qn(a,e,o),vg(a,n,o)))}function gg(e,n,a){var o=ci();Oo(e,n,a,o)}function Oo(e,n,a,o){var u={lane:o,revertLane:0,gesture:null,action:a,hasEagerState:!1,eagerState:null,next:null};if(tc(e))_g(n,u);else{var f=e.alternate;if(e.lanes===0&&(f===null||f.lanes===0)&&(f=n.lastRenderedReducer,f!==null))try{var x=n.lastRenderedState,R=f(x,a);if(u.hasEagerState=!0,u.eagerState=R,ii(R,x))return Ol(e,n,u,0),Xe===null&&Nl(),!1}catch{}if(a=ju(e,n,u,o),a!==null)return Qn(a,e,o),vg(a,n,o),!0}return!1}function Lf(e,n,a,o){if(o={lane:2,revertLane:uh(),gesture:null,action:o,hasEagerState:!1,eagerState:null,next:null},tc(e)){if(n)throw Error(s(479))}else n=ju(e,a,o,2),n!==null&&Qn(n,e,2)}function tc(e){var n=e.alternate;return e===ue||n!==null&&n===ue}function _g(e,n){yr=Yl=!0;var a=e.pending;a===null?n.next=n:(n.next=a.next,a.next=n),e.pending=n}function vg(e,n,a){if((a&4194048)!==0){var o=n.lanes;o&=e.pendingLanes,a|=o,n.lanes=a,tr(e,a)}}var Po={readContext:bn,use:Kl,useCallback:tn,useContext:tn,useEffect:tn,useImperativeHandle:tn,useLayoutEffect:tn,useInsertionEffect:tn,useMemo:tn,useReducer:tn,useRef:tn,useState:tn,useDebugValue:tn,useDeferredValue:tn,useTransition:tn,useSyncExternalStore:tn,useId:tn,useHostTransitionStatus:tn,useFormState:tn,useActionState:tn,useOptimistic:tn,useMemoCache:tn,useCacheRefresh:tn};Po.useEffectEvent=tn;var xg={readContext:bn,use:Kl,useCallback:function(e,n){return Gn().memoizedState=[e,n===void 0?null:n],e},useContext:bn,useEffect:ng,useImperativeHandle:function(e,n,a){a=a!=null?a.concat([e]):null,Jl(4194308,4,rg.bind(null,n,e),a)},useLayoutEffect:function(e,n){return Jl(4194308,4,e,n)},useInsertionEffect:function(e,n){Jl(4,2,e,n)},useMemo:function(e,n){var a=Gn();n=n===void 0?null:n;var o=e();if(zs){Pt(!0);try{e()}finally{Pt(!1)}}return a.memoizedState=[o,n],o},useReducer:function(e,n,a){var o=Gn();if(a!==void 0){var u=a(n);if(zs){Pt(!0);try{a(n)}finally{Pt(!1)}}}else u=n;return o.memoizedState=o.baseState=u,e={pending:null,lanes:0,dispatch:null,lastRenderedReducer:e,lastRenderedState:u},o.queue=e,e=e.dispatch=OS.bind(null,ue,e),[o.memoizedState,e]},useRef:function(e){var n=Gn();return e={current:e},n.memoizedState=e},useState:function(e){e=Tf(e);var n=e.queue,a=gg.bind(null,ue,n);return n.dispatch=a,[e.memoizedState,a]},useDebugValue:Cf,useDeferredValue:function(e,n){var a=Gn();return wf(a,e,n)},useTransition:function(){var e=Tf(!1);return e=fg.bind(null,ue,e.queue,!0,!1),Gn().memoizedState=e,[!1,e]},useSyncExternalStore:function(e,n,a){var o=ue,u=Gn();if(Ee){if(a===void 0)throw Error(s(407));a=a()}else{if(a=n(),Xe===null)throw Error(s(349));(ye&127)!==0||Hm(o,n,a)}u.memoizedState=a;var f={value:a,getSnapshot:n};return u.queue=f,ng(Vm.bind(null,o,f,e),[e]),o.flags|=2048,Er(9,{destroy:void 0},Gm.bind(null,o,f,a,n),null),a},useId:function(){var e=Gn(),n=Xe.identifierPrefix;if(Ee){var a=qi,o=Wi;a=(o&~(1<<32-Ot(o)-1)).toString(32)+a,n="_"+n+"R_"+a,a=jl++,0<a&&(n+="H"+a.toString(32)),n+="_"}else a=RS++,n="_"+n+"r_"+a.toString(32)+"_";return e.memoizedState=n},useHostTransitionStatus:Uf,useFormState:Qm,useActionState:Qm,useOptimistic:function(e){var n=Gn();n.memoizedState=n.baseState=e;var a={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return n.queue=a,n=Lf.bind(null,ue,!0,a),a.dispatch=n,[e,n]},useMemoCache:Mf,useCacheRefresh:function(){return Gn().memoizedState=NS.bind(null,ue)},useEffectEvent:function(e){var n=Gn(),a={impl:e};return n.memoizedState=a,function(){if((Le&2)!==0)throw Error(s(440));return a.impl.apply(void 0,arguments)}}},Nf={readContext:bn,use:Kl,useCallback:lg,useContext:bn,useEffect:Rf,useImperativeHandle:og,useInsertionEffect:ag,useLayoutEffect:sg,useMemo:cg,useReducer:Ql,useRef:eg,useState:function(){return Ql(ma)},useDebugValue:Cf,useDeferredValue:function(e,n){var a=an();return ug(a,He.memoizedState,e,n)},useTransition:function(){var e=Ql(ma)[0],n=an().memoizedState;return[typeof e=="boolean"?e:No(e),n]},useSyncExternalStore:Bm,useId:pg,useHostTransitionStatus:Uf,useFormState:Jm,useActionState:Jm,useOptimistic:function(e,n){var a=an();return Wm(a,He,e,n)},useMemoCache:Mf,useCacheRefresh:mg};Nf.useEffectEvent=ig;var Sg={readContext:bn,use:Kl,useCallback:lg,useContext:bn,useEffect:Rf,useImperativeHandle:og,useInsertionEffect:ag,useLayoutEffect:sg,useMemo:cg,useReducer:bf,useRef:eg,useState:function(){return bf(ma)},useDebugValue:Cf,useDeferredValue:function(e,n){var a=an();return He===null?wf(a,e,n):ug(a,He.memoizedState,e,n)},useTransition:function(){var e=bf(ma)[0],n=an().memoizedState;return[typeof e=="boolean"?e:No(e),n]},useSyncExternalStore:Bm,useId:pg,useHostTransitionStatus:Uf,useFormState:tg,useActionState:tg,useOptimistic:function(e,n){var a=an();return He!==null?Wm(a,He,e,n):(a.baseState=e,[e,a.queue.dispatch])},useMemoCache:Mf,useCacheRefresh:mg};Sg.useEffectEvent=ig;function Of(e,n,a,o){n=e.memoizedState,a=a(o,n),a=a==null?n:g({},n,a),e.memoizedState=a,e.lanes===0&&(e.updateQueue.baseState=a)}var Pf={enqueueSetState:function(e,n,a){e=e._reactInternals;var o=ci(),u=qa(o);u.payload=n,a!=null&&(u.callback=a),n=Ya(e,u,o),n!==null&&(Qn(n,e,o),wo(n,e,o))},enqueueReplaceState:function(e,n,a){e=e._reactInternals;var o=ci(),u=qa(o);u.tag=1,u.payload=n,a!=null&&(u.callback=a),n=Ya(e,u,o),n!==null&&(Qn(n,e,o),wo(n,e,o))},enqueueForceUpdate:function(e,n){e=e._reactInternals;var a=ci(),o=qa(a);o.tag=2,n!=null&&(o.callback=n),n=Ya(e,o,a),n!==null&&(Qn(n,e,a),wo(n,e,a))}};function yg(e,n,a,o,u,f,x){return e=e.stateNode,typeof e.shouldComponentUpdate=="function"?e.shouldComponentUpdate(o,f,x):n.prototype&&n.prototype.isPureReactComponent?!yo(a,o)||!yo(u,f):!0}function Mg(e,n,a,o){e=n.state,typeof n.componentWillReceiveProps=="function"&&n.componentWillReceiveProps(a,o),typeof n.UNSAFE_componentWillReceiveProps=="function"&&n.UNSAFE_componentWillReceiveProps(a,o),n.state!==e&&Pf.enqueueReplaceState(n,n.state,null)}function Is(e,n){var a=n;if("ref"in n){a={};for(var o in n)o!=="ref"&&(a[o]=n[o])}if(e=e.defaultProps){a===n&&(a=g({},a));for(var u in e)a[u]===void 0&&(a[u]=e[u])}return a}function Eg(e){Ll(e)}function bg(e){console.error(e)}function Tg(e){Ll(e)}function ec(e,n){try{var a=e.onUncaughtError;a(n.value,{componentStack:n.stack})}catch(o){setTimeout(function(){throw o})}}function Ag(e,n,a){try{var o=e.onCaughtError;o(a.value,{componentStack:a.stack,errorBoundary:n.tag===1?n.stateNode:null})}catch(u){setTimeout(function(){throw u})}}function zf(e,n,a){return a=qa(a),a.tag=3,a.payload={element:null},a.callback=function(){ec(e,n)},a}function Rg(e){return e=qa(e),e.tag=3,e}function Cg(e,n,a,o){var u=a.type.getDerivedStateFromError;if(typeof u=="function"){var f=o.value;e.payload=function(){return u(f)},e.callback=function(){Ag(n,a,o)}}var x=a.stateNode;x!==null&&typeof x.componentDidCatch=="function"&&(e.callback=function(){Ag(n,a,o),typeof u!="function"&&($a===null?$a=new Set([this]):$a.add(this));var R=o.stack;this.componentDidCatch(o.value,{componentStack:R!==null?R:""})})}function PS(e,n,a,o,u){if(a.flags|=32768,o!==null&&typeof o=="object"&&typeof o.then=="function"){if(n=a.alternate,n!==null&&mr(n,a,u,!0),a=si.current,a!==null){switch(a.tag){case 31:case 13:return yi===null?dc():a.alternate===null&&en===0&&(en=3),a.flags&=-257,a.flags|=65536,a.lanes=u,o===Vl?a.flags|=16384:(n=a.updateQueue,n===null?a.updateQueue=new Set([o]):n.add(o),oh(e,o,u)),!1;case 22:return a.flags|=65536,o===Vl?a.flags|=16384:(n=a.updateQueue,n===null?(n={transitions:null,markerInstances:null,retryQueue:new Set([o])},a.updateQueue=n):(a=n.retryQueue,a===null?n.retryQueue=new Set([o]):a.add(o)),oh(e,o,u)),!1}throw Error(s(435,a.tag))}return oh(e,o,u),dc(),!1}if(Ee)return n=si.current,n!==null?((n.flags&65536)===0&&(n.flags|=256),n.flags|=65536,n.lanes=u,o!==tf&&(e=Error(s(422),{cause:o}),bo(_i(e,a)))):(o!==tf&&(n=Error(s(423),{cause:o}),bo(_i(n,a))),e=e.current.alternate,e.flags|=65536,u&=-u,e.lanes|=u,o=_i(o,a),u=zf(e.stateNode,o,u),hf(e,u),en!==4&&(en=2)),!1;var f=Error(s(520),{cause:o});if(f=_i(f,a),ko===null?ko=[f]:ko.push(f),en!==4&&(en=2),n===null)return!0;o=_i(o,a),a=n;do{switch(a.tag){case 3:return a.flags|=65536,e=u&-u,a.lanes|=e,e=zf(a.stateNode,o,e),hf(a,e),!1;case 1:if(n=a.type,f=a.stateNode,(a.flags&128)===0&&(typeof n.getDerivedStateFromError=="function"||f!==null&&typeof f.componentDidCatch=="function"&&($a===null||!$a.has(f))))return a.flags|=65536,u&=-u,a.lanes|=u,u=Rg(u),Cg(u,e,a,o),hf(a,u),!1}a=a.return}while(a!==null);return!1}var If=Error(s(461)),fn=!1;function Tn(e,n,a,o){n.child=e===null?Lm(n,null,a,o):Ps(n,e.child,a,o)}function wg(e,n,a,o,u){a=a.render;var f=n.ref;if("ref"in o){var x={};for(var R in o)R!=="ref"&&(x[R]=o[R])}else x=o;return Us(n),o=vf(e,n,a,x,f,u),R=xf(),e!==null&&!fn?(Sf(e,n,u),ga(e,n,u)):(Ee&&R&&Ju(n),n.flags|=1,Tn(e,n,o,u),n.child)}function Dg(e,n,a,o,u){if(e===null){var f=a.type;return typeof f=="function"&&!Zu(f)&&f.defaultProps===void 0&&a.compare===null?(n.tag=15,n.type=f,Ug(e,n,f,o,u)):(e=zl(a.type,null,o,n,n.mode,u),e.ref=n.ref,e.return=n,n.child=e)}if(f=e.child,!Wf(e,u)){var x=f.memoizedProps;if(a=a.compare,a=a!==null?a:yo,a(x,o)&&e.ref===n.ref)return ga(e,n,u)}return n.flags|=1,e=ua(f,o),e.ref=n.ref,e.return=n,n.child=e}function Ug(e,n,a,o,u){if(e!==null){var f=e.memoizedProps;if(yo(f,o)&&e.ref===n.ref)if(fn=!1,n.pendingProps=o=f,Wf(e,u))(e.flags&131072)!==0&&(fn=!0);else return n.lanes=e.lanes,ga(e,n,u)}return Ff(e,n,a,o,u)}function Lg(e,n,a,o){var u=o.children,f=e!==null?e.memoizedState:null;if(e===null&&n.stateNode===null&&(n.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),o.mode==="hidden"){if((n.flags&128)!==0){if(f=f!==null?f.baseLanes|a:a,e!==null){for(o=n.child=e.child,u=0;o!==null;)u=u|o.lanes|o.childLanes,o=o.sibling;o=u&~f}else o=0,n.child=null;return Ng(e,n,f,a,o)}if((a&536870912)!==0)n.memoizedState={baseLanes:0,cachePool:null},e!==null&&Hl(n,f!==null?f.cachePool:null),f!==null?Pm(n,f):pf(),zm(n);else return o=n.lanes=536870912,Ng(e,n,f!==null?f.baseLanes|a:a,a,o)}else f!==null?(Hl(n,f.cachePool),Pm(n,f),Za(),n.memoizedState=null):(e!==null&&Hl(n,null),pf(),Za());return Tn(e,n,u,a),n.child}function zo(e,n){return e!==null&&e.tag===22||n.stateNode!==null||(n.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),n.sibling}function Ng(e,n,a,o,u){var f=lf();return f=f===null?null:{parent:cn._currentValue,pool:f},n.memoizedState={baseLanes:a,cachePool:f},e!==null&&Hl(n,null),pf(),zm(n),e!==null&&mr(e,n,o,!0),n.childLanes=u,null}function nc(e,n){return n=ac({mode:n.mode,children:n.children},e.mode),n.ref=e.ref,e.child=n,n.return=e,n}function Og(e,n,a){return Ps(n,e.child,null,a),e=nc(n,n.pendingProps),e.flags|=2,ri(n),n.memoizedState=null,e}function zS(e,n,a){var o=n.pendingProps,u=(n.flags&128)!==0;if(n.flags&=-129,e===null){if(Ee){if(o.mode==="hidden")return e=nc(n,o),n.lanes=536870912,zo(null,e);if(gf(n),(e=qe)?(e=q0(e,Si),e=e!==null&&e.data==="&"?e:null,e!==null&&(n.memoizedState={dehydrated:e,treeContext:Ga!==null?{id:Wi,overflow:qi}:null,retryLane:536870912,hydrationErrors:null},a=_m(e),a.return=n,n.child=a,En=n,qe=null)):e=null,e===null)throw ka(n);return n.lanes=536870912,null}return nc(n,o)}var f=e.memoizedState;if(f!==null){var x=f.dehydrated;if(gf(n),u)if(n.flags&256)n.flags&=-257,n=Og(e,n,a);else if(n.memoizedState!==null)n.child=e.child,n.flags|=128,n=null;else throw Error(s(558));else if(fn||mr(e,n,a,!1),u=(a&e.childLanes)!==0,fn||u){if(o=Xe,o!==null&&(x=yl(o,a),x!==0&&x!==f.retryLane))throw f.retryLane=x,Rs(e,x),Qn(o,e,x),If;dc(),n=Og(e,n,a)}else e=f.treeContext,qe=Mi(x.nextSibling),En=n,Ee=!0,Va=null,Si=!1,e!==null&&Sm(n,e),n=nc(n,o),n.flags|=4096;return n}return e=ua(e.child,{mode:o.mode,children:o.children}),e.ref=n.ref,n.child=e,e.return=n,e}function ic(e,n){var a=n.ref;if(a===null)e!==null&&e.ref!==null&&(n.flags|=4194816);else{if(typeof a!="function"&&typeof a!="object")throw Error(s(284));(e===null||e.ref!==a)&&(n.flags|=4194816)}}function Ff(e,n,a,o,u){return Us(n),a=vf(e,n,a,o,void 0,u),o=xf(),e!==null&&!fn?(Sf(e,n,u),ga(e,n,u)):(Ee&&o&&Ju(n),n.flags|=1,Tn(e,n,a,u),n.child)}function Pg(e,n,a,o,u,f){return Us(n),n.updateQueue=null,a=Fm(n,o,a,u),Im(e),o=xf(),e!==null&&!fn?(Sf(e,n,f),ga(e,n,f)):(Ee&&o&&Ju(n),n.flags|=1,Tn(e,n,a,f),n.child)}function zg(e,n,a,o,u){if(Us(n),n.stateNode===null){var f=fr,x=a.contextType;typeof x=="object"&&x!==null&&(f=bn(x)),f=new a(o,f),n.memoizedState=f.state!==null&&f.state!==void 0?f.state:null,f.updater=Pf,n.stateNode=f,f._reactInternals=n,f=n.stateNode,f.props=o,f.state=n.memoizedState,f.refs={},uf(n),x=a.contextType,f.context=typeof x=="object"&&x!==null?bn(x):fr,f.state=n.memoizedState,x=a.getDerivedStateFromProps,typeof x=="function"&&(Of(n,a,x,o),f.state=n.memoizedState),typeof a.getDerivedStateFromProps=="function"||typeof f.getSnapshotBeforeUpdate=="function"||typeof f.UNSAFE_componentWillMount!="function"&&typeof f.componentWillMount!="function"||(x=f.state,typeof f.componentWillMount=="function"&&f.componentWillMount(),typeof f.UNSAFE_componentWillMount=="function"&&f.UNSAFE_componentWillMount(),x!==f.state&&Pf.enqueueReplaceState(f,f.state,null),Uo(n,o,f,u),Do(),f.state=n.memoizedState),typeof f.componentDidMount=="function"&&(n.flags|=4194308),o=!0}else if(e===null){f=n.stateNode;var R=n.memoizedProps,G=Is(a,R);f.props=G;var st=f.context,gt=a.contextType;x=fr,typeof gt=="object"&&gt!==null&&(x=bn(gt));var St=a.getDerivedStateFromProps;gt=typeof St=="function"||typeof f.getSnapshotBeforeUpdate=="function",R=n.pendingProps!==R,gt||typeof f.UNSAFE_componentWillReceiveProps!="function"&&typeof f.componentWillReceiveProps!="function"||(R||st!==x)&&Mg(n,f,o,x),Wa=!1;var ct=n.memoizedState;f.state=ct,Uo(n,o,f,u),Do(),st=n.memoizedState,R||ct!==st||Wa?(typeof St=="function"&&(Of(n,a,St,o),st=n.memoizedState),(G=Wa||yg(n,a,G,o,ct,st,x))?(gt||typeof f.UNSAFE_componentWillMount!="function"&&typeof f.componentWillMount!="function"||(typeof f.componentWillMount=="function"&&f.componentWillMount(),typeof f.UNSAFE_componentWillMount=="function"&&f.UNSAFE_componentWillMount()),typeof f.componentDidMount=="function"&&(n.flags|=4194308)):(typeof f.componentDidMount=="function"&&(n.flags|=4194308),n.memoizedProps=o,n.memoizedState=st),f.props=o,f.state=st,f.context=x,o=G):(typeof f.componentDidMount=="function"&&(n.flags|=4194308),o=!1)}else{f=n.stateNode,ff(e,n),x=n.memoizedProps,gt=Is(a,x),f.props=gt,St=n.pendingProps,ct=f.context,st=a.contextType,G=fr,typeof st=="object"&&st!==null&&(G=bn(st)),R=a.getDerivedStateFromProps,(st=typeof R=="function"||typeof f.getSnapshotBeforeUpdate=="function")||typeof f.UNSAFE_componentWillReceiveProps!="function"&&typeof f.componentWillReceiveProps!="function"||(x!==St||ct!==G)&&Mg(n,f,o,G),Wa=!1,ct=n.memoizedState,f.state=ct,Uo(n,o,f,u),Do();var ht=n.memoizedState;x!==St||ct!==ht||Wa||e!==null&&e.dependencies!==null&&Fl(e.dependencies)?(typeof R=="function"&&(Of(n,a,R,o),ht=n.memoizedState),(gt=Wa||yg(n,a,gt,o,ct,ht,G)||e!==null&&e.dependencies!==null&&Fl(e.dependencies))?(st||typeof f.UNSAFE_componentWillUpdate!="function"&&typeof f.componentWillUpdate!="function"||(typeof f.componentWillUpdate=="function"&&f.componentWillUpdate(o,ht,G),typeof f.UNSAFE_componentWillUpdate=="function"&&f.UNSAFE_componentWillUpdate(o,ht,G)),typeof f.componentDidUpdate=="function"&&(n.flags|=4),typeof f.getSnapshotBeforeUpdate=="function"&&(n.flags|=1024)):(typeof f.componentDidUpdate!="function"||x===e.memoizedProps&&ct===e.memoizedState||(n.flags|=4),typeof f.getSnapshotBeforeUpdate!="function"||x===e.memoizedProps&&ct===e.memoizedState||(n.flags|=1024),n.memoizedProps=o,n.memoizedState=ht),f.props=o,f.state=ht,f.context=G,o=gt):(typeof f.componentDidUpdate!="function"||x===e.memoizedProps&&ct===e.memoizedState||(n.flags|=4),typeof f.getSnapshotBeforeUpdate!="function"||x===e.memoizedProps&&ct===e.memoizedState||(n.flags|=1024),o=!1)}return f=o,ic(e,n),o=(n.flags&128)!==0,f||o?(f=n.stateNode,a=o&&typeof a.getDerivedStateFromError!="function"?null:f.render(),n.flags|=1,e!==null&&o?(n.child=Ps(n,e.child,null,u),n.child=Ps(n,null,a,u)):Tn(e,n,a,u),n.memoizedState=f.state,e=n.child):e=ga(e,n,u),e}function Ig(e,n,a,o){return ws(),n.flags|=256,Tn(e,n,a,o),n.child}var Bf={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function Hf(e){return{baseLanes:e,cachePool:Am()}}function Gf(e,n,a){return e=e!==null?e.childLanes&~a:0,n&&(e|=li),e}function Fg(e,n,a){var o=n.pendingProps,u=!1,f=(n.flags&128)!==0,x;if((x=f)||(x=e!==null&&e.memoizedState===null?!1:(nn.current&2)!==0),x&&(u=!0,n.flags&=-129),x=(n.flags&32)!==0,n.flags&=-33,e===null){if(Ee){if(u?ja(n):Za(),(e=qe)?(e=q0(e,Si),e=e!==null&&e.data!=="&"?e:null,e!==null&&(n.memoizedState={dehydrated:e,treeContext:Ga!==null?{id:Wi,overflow:qi}:null,retryLane:536870912,hydrationErrors:null},a=_m(e),a.return=n,n.child=a,En=n,qe=null)):e=null,e===null)throw ka(n);return Eh(e)?n.lanes=32:n.lanes=536870912,null}var R=o.children;return o=o.fallback,u?(Za(),u=n.mode,R=ac({mode:"hidden",children:R},u),o=Cs(o,u,a,null),R.return=n,o.return=n,R.sibling=o,n.child=R,o=n.child,o.memoizedState=Hf(a),o.childLanes=Gf(e,x,a),n.memoizedState=Bf,zo(null,o)):(ja(n),Vf(n,R))}var G=e.memoizedState;if(G!==null&&(R=G.dehydrated,R!==null)){if(f)n.flags&256?(ja(n),n.flags&=-257,n=kf(e,n,a)):n.memoizedState!==null?(Za(),n.child=e.child,n.flags|=128,n=null):(Za(),R=o.fallback,u=n.mode,o=ac({mode:"visible",children:o.children},u),R=Cs(R,u,a,null),R.flags|=2,o.return=n,R.return=n,o.sibling=R,n.child=o,Ps(n,e.child,null,a),o=n.child,o.memoizedState=Hf(a),o.childLanes=Gf(e,x,a),n.memoizedState=Bf,n=zo(null,o));else if(ja(n),Eh(R)){if(x=R.nextSibling&&R.nextSibling.dataset,x)var st=x.dgst;x=st,o=Error(s(419)),o.stack="",o.digest=x,bo({value:o,source:null,stack:null}),n=kf(e,n,a)}else if(fn||mr(e,n,a,!1),x=(a&e.childLanes)!==0,fn||x){if(x=Xe,x!==null&&(o=yl(x,a),o!==0&&o!==G.retryLane))throw G.retryLane=o,Rs(e,o),Qn(x,e,o),If;Mh(R)||dc(),n=kf(e,n,a)}else Mh(R)?(n.flags|=192,n.child=e.child,n=null):(e=G.treeContext,qe=Mi(R.nextSibling),En=n,Ee=!0,Va=null,Si=!1,e!==null&&Sm(n,e),n=Vf(n,o.children),n.flags|=4096);return n}return u?(Za(),R=o.fallback,u=n.mode,G=e.child,st=G.sibling,o=ua(G,{mode:"hidden",children:o.children}),o.subtreeFlags=G.subtreeFlags&65011712,st!==null?R=ua(st,R):(R=Cs(R,u,a,null),R.flags|=2),R.return=n,o.return=n,o.sibling=R,n.child=o,zo(null,o),o=n.child,R=e.child.memoizedState,R===null?R=Hf(a):(u=R.cachePool,u!==null?(G=cn._currentValue,u=u.parent!==G?{parent:G,pool:G}:u):u=Am(),R={baseLanes:R.baseLanes|a,cachePool:u}),o.memoizedState=R,o.childLanes=Gf(e,x,a),n.memoizedState=Bf,zo(e.child,o)):(ja(n),a=e.child,e=a.sibling,a=ua(a,{mode:"visible",children:o.children}),a.return=n,a.sibling=null,e!==null&&(x=n.deletions,x===null?(n.deletions=[e],n.flags|=16):x.push(e)),n.child=a,n.memoizedState=null,a)}function Vf(e,n){return n=ac({mode:"visible",children:n},e.mode),n.return=e,e.child=n}function ac(e,n){return e=ai(22,e,null,n),e.lanes=0,e}function kf(e,n,a){return Ps(n,e.child,null,a),e=Vf(n,n.pendingProps.children),e.flags|=2,n.memoizedState=null,e}function Bg(e,n,a){e.lanes|=n;var o=e.alternate;o!==null&&(o.lanes|=n),af(e.return,n,a)}function Xf(e,n,a,o,u,f){var x=e.memoizedState;x===null?e.memoizedState={isBackwards:n,rendering:null,renderingStartTime:0,last:o,tail:a,tailMode:u,treeForkCount:f}:(x.isBackwards=n,x.rendering=null,x.renderingStartTime=0,x.last=o,x.tail=a,x.tailMode=u,x.treeForkCount=f)}function Hg(e,n,a){var o=n.pendingProps,u=o.revealOrder,f=o.tail;o=o.children;var x=nn.current,R=(x&2)!==0;if(R?(x=x&1|2,n.flags|=128):x&=1,ut(nn,x),Tn(e,n,o,a),o=Ee?Eo:0,!R&&e!==null&&(e.flags&128)!==0)t:for(e=n.child;e!==null;){if(e.tag===13)e.memoizedState!==null&&Bg(e,a,n);else if(e.tag===19)Bg(e,a,n);else if(e.child!==null){e.child.return=e,e=e.child;continue}if(e===n)break t;for(;e.sibling===null;){if(e.return===null||e.return===n)break t;e=e.return}e.sibling.return=e.return,e=e.sibling}switch(u){case"forwards":for(a=n.child,u=null;a!==null;)e=a.alternate,e!==null&&ql(e)===null&&(u=a),a=a.sibling;a=u,a===null?(u=n.child,n.child=null):(u=a.sibling,a.sibling=null),Xf(n,!1,u,a,f,o);break;case"backwards":case"unstable_legacy-backwards":for(a=null,u=n.child,n.child=null;u!==null;){if(e=u.alternate,e!==null&&ql(e)===null){n.child=u;break}e=u.sibling,u.sibling=a,a=u,u=e}Xf(n,!0,a,null,f,o);break;case"together":Xf(n,!1,null,null,void 0,o);break;default:n.memoizedState=null}return n.child}function ga(e,n,a){if(e!==null&&(n.dependencies=e.dependencies),Ja|=n.lanes,(a&n.childLanes)===0)if(e!==null){if(mr(e,n,a,!1),(a&n.childLanes)===0)return null}else return null;if(e!==null&&n.child!==e.child)throw Error(s(153));if(n.child!==null){for(e=n.child,a=ua(e,e.pendingProps),n.child=a,a.return=n;e.sibling!==null;)e=e.sibling,a=a.sibling=ua(e,e.pendingProps),a.return=n;a.sibling=null}return n.child}function Wf(e,n){return(e.lanes&n)!==0?!0:(e=e.dependencies,!!(e!==null&&Fl(e)))}function IS(e,n,a){switch(n.tag){case 3:yt(n,n.stateNode.containerInfo),Xa(n,cn,e.memoizedState.cache),ws();break;case 27:case 5:Ft(n);break;case 4:yt(n,n.stateNode.containerInfo);break;case 10:Xa(n,n.type,n.memoizedProps.value);break;case 31:if(n.memoizedState!==null)return n.flags|=128,gf(n),null;break;case 13:var o=n.memoizedState;if(o!==null)return o.dehydrated!==null?(ja(n),n.flags|=128,null):(a&n.child.childLanes)!==0?Fg(e,n,a):(ja(n),e=ga(e,n,a),e!==null?e.sibling:null);ja(n);break;case 19:var u=(e.flags&128)!==0;if(o=(a&n.childLanes)!==0,o||(mr(e,n,a,!1),o=(a&n.childLanes)!==0),u){if(o)return Hg(e,n,a);n.flags|=128}if(u=n.memoizedState,u!==null&&(u.rendering=null,u.tail=null,u.lastEffect=null),ut(nn,nn.current),o)break;return null;case 22:return n.lanes=0,Lg(e,n,a,n.pendingProps);case 24:Xa(n,cn,e.memoizedState.cache)}return ga(e,n,a)}function Gg(e,n,a){if(e!==null)if(e.memoizedProps!==n.pendingProps)fn=!0;else{if(!Wf(e,a)&&(n.flags&128)===0)return fn=!1,IS(e,n,a);fn=(e.flags&131072)!==0}else fn=!1,Ee&&(n.flags&1048576)!==0&&xm(n,Eo,n.index);switch(n.lanes=0,n.tag){case 16:t:{var o=n.pendingProps;if(e=Ns(n.elementType),n.type=e,typeof e=="function")Zu(e)?(o=Is(e,o),n.tag=1,n=zg(null,n,e,o,a)):(n.tag=0,n=Ff(null,n,e,o,a));else{if(e!=null){var u=e.$$typeof;if(u===U){n.tag=11,n=wg(null,n,e,o,a);break t}else if(u===I){n.tag=14,n=Dg(null,n,e,o,a);break t}}throw n=rt(e)||e,Error(s(306,n,""))}}return n;case 0:return Ff(e,n,n.type,n.pendingProps,a);case 1:return o=n.type,u=Is(o,n.pendingProps),zg(e,n,o,u,a);case 3:t:{if(yt(n,n.stateNode.containerInfo),e===null)throw Error(s(387));o=n.pendingProps;var f=n.memoizedState;u=f.element,ff(e,n),Uo(n,o,null,a);var x=n.memoizedState;if(o=x.cache,Xa(n,cn,o),o!==f.cache&&sf(n,[cn],a,!0),Do(),o=x.element,f.isDehydrated)if(f={element:o,isDehydrated:!1,cache:x.cache},n.updateQueue.baseState=f,n.memoizedState=f,n.flags&256){n=Ig(e,n,o,a);break t}else if(o!==u){u=_i(Error(s(424)),n),bo(u),n=Ig(e,n,o,a);break t}else for(e=n.stateNode.containerInfo,e.nodeType===9?e=e.body:e=e.nodeName==="HTML"?e.ownerDocument.body:e,qe=Mi(e.firstChild),En=n,Ee=!0,Va=null,Si=!0,a=Lm(n,null,o,a),n.child=a;a;)a.flags=a.flags&-3|4096,a=a.sibling;else{if(ws(),o===u){n=ga(e,n,a);break t}Tn(e,n,o,a)}n=n.child}return n;case 26:return ic(e,n),e===null?(a=J0(n.type,null,n.pendingProps,null))?n.memoizedState=a:Ee||(a=n.type,e=n.pendingProps,o=Sc(Z.current).createElement(a),o[rn]=n,o[pn]=e,An(o,a,e),q(o),n.stateNode=o):n.memoizedState=J0(n.type,e.memoizedProps,n.pendingProps,e.memoizedState),null;case 27:return Ft(n),e===null&&Ee&&(o=n.stateNode=Z0(n.type,n.pendingProps,Z.current),En=n,Si=!0,u=qe,is(n.type)?(bh=u,qe=Mi(o.firstChild)):qe=u),Tn(e,n,n.pendingProps.children,a),ic(e,n),e===null&&(n.flags|=4194304),n.child;case 5:return e===null&&Ee&&((u=o=qe)&&(o=dy(o,n.type,n.pendingProps,Si),o!==null?(n.stateNode=o,En=n,qe=Mi(o.firstChild),Si=!1,u=!0):u=!1),u||ka(n)),Ft(n),u=n.type,f=n.pendingProps,x=e!==null?e.memoizedProps:null,o=f.children,xh(u,f)?o=null:x!==null&&xh(u,x)&&(n.flags|=32),n.memoizedState!==null&&(u=vf(e,n,CS,null,null,a),Qo._currentValue=u),ic(e,n),Tn(e,n,o,a),n.child;case 6:return e===null&&Ee&&((e=a=qe)&&(a=py(a,n.pendingProps,Si),a!==null?(n.stateNode=a,En=n,qe=null,e=!0):e=!1),e||ka(n)),null;case 13:return Fg(e,n,a);case 4:return yt(n,n.stateNode.containerInfo),o=n.pendingProps,e===null?n.child=Ps(n,null,o,a):Tn(e,n,o,a),n.child;case 11:return wg(e,n,n.type,n.pendingProps,a);case 7:return Tn(e,n,n.pendingProps,a),n.child;case 8:return Tn(e,n,n.pendingProps.children,a),n.child;case 12:return Tn(e,n,n.pendingProps.children,a),n.child;case 10:return o=n.pendingProps,Xa(n,n.type,o.value),Tn(e,n,o.children,a),n.child;case 9:return u=n.type._context,o=n.pendingProps.children,Us(n),u=bn(u),o=o(u),n.flags|=1,Tn(e,n,o,a),n.child;case 14:return Dg(e,n,n.type,n.pendingProps,a);case 15:return Ug(e,n,n.type,n.pendingProps,a);case 19:return Hg(e,n,a);case 31:return zS(e,n,a);case 22:return Lg(e,n,a,n.pendingProps);case 24:return Us(n),o=bn(cn),e===null?(u=lf(),u===null&&(u=Xe,f=rf(),u.pooledCache=f,f.refCount++,f!==null&&(u.pooledCacheLanes|=a),u=f),n.memoizedState={parent:o,cache:u},uf(n),Xa(n,cn,u)):((e.lanes&a)!==0&&(ff(e,n),Uo(n,null,null,a),Do()),u=e.memoizedState,f=n.memoizedState,u.parent!==o?(u={parent:o,cache:o},n.memoizedState=u,n.lanes===0&&(n.memoizedState=n.updateQueue.baseState=u),Xa(n,cn,o)):(o=f.cache,Xa(n,cn,o),o!==u.cache&&sf(n,[cn],a,!0))),Tn(e,n,n.pendingProps.children,a),n.child;case 29:throw n.pendingProps}throw Error(s(156,n.tag))}function _a(e){e.flags|=4}function qf(e,n,a,o,u){if((n=(e.mode&32)!==0)&&(n=!1),n){if(e.flags|=16777216,(u&335544128)===u)if(e.stateNode.complete)e.flags|=8192;else if(p0())e.flags|=8192;else throw Os=Vl,cf}else e.flags&=-16777217}function Vg(e,n){if(n.type!=="stylesheet"||(n.state.loading&4)!==0)e.flags&=-16777217;else if(e.flags|=16777216,!i_(n))if(p0())e.flags|=8192;else throw Os=Vl,cf}function sc(e,n){n!==null&&(e.flags|=4),e.flags&16384&&(n=e.tag!==22?Pe():536870912,e.lanes|=n,Rr|=n)}function Io(e,n){if(!Ee)switch(e.tailMode){case"hidden":n=e.tail;for(var a=null;n!==null;)n.alternate!==null&&(a=n),n=n.sibling;a===null?e.tail=null:a.sibling=null;break;case"collapsed":a=e.tail;for(var o=null;a!==null;)a.alternate!==null&&(o=a),a=a.sibling;o===null?n||e.tail===null?e.tail=null:e.tail.sibling=null:o.sibling=null}}function Ye(e){var n=e.alternate!==null&&e.alternate.child===e.child,a=0,o=0;if(n)for(var u=e.child;u!==null;)a|=u.lanes|u.childLanes,o|=u.subtreeFlags&65011712,o|=u.flags&65011712,u.return=e,u=u.sibling;else for(u=e.child;u!==null;)a|=u.lanes|u.childLanes,o|=u.subtreeFlags,o|=u.flags,u.return=e,u=u.sibling;return e.subtreeFlags|=o,e.childLanes=a,n}function FS(e,n,a){var o=n.pendingProps;switch($u(n),n.tag){case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return Ye(n),null;case 1:return Ye(n),null;case 3:return a=n.stateNode,o=null,e!==null&&(o=e.memoizedState.cache),n.memoizedState.cache!==o&&(n.flags|=2048),da(cn),Ut(),a.pendingContext&&(a.context=a.pendingContext,a.pendingContext=null),(e===null||e.child===null)&&(pr(n)?_a(n):e===null||e.memoizedState.isDehydrated&&(n.flags&256)===0||(n.flags|=1024,ef())),Ye(n),null;case 26:var u=n.type,f=n.memoizedState;return e===null?(_a(n),f!==null?(Ye(n),Vg(n,f)):(Ye(n),qf(n,u,null,o,a))):f?f!==e.memoizedState?(_a(n),Ye(n),Vg(n,f)):(Ye(n),n.flags&=-16777217):(e=e.memoizedProps,e!==o&&_a(n),Ye(n),qf(n,u,e,o,a)),null;case 27:if(Xt(n),a=Z.current,u=n.type,e!==null&&n.stateNode!=null)e.memoizedProps!==o&&_a(n);else{if(!o){if(n.stateNode===null)throw Error(s(166));return Ye(n),null}e=vt.current,pr(n)?ym(n):(e=Z0(u,o,a),n.stateNode=e,_a(n))}return Ye(n),null;case 5:if(Xt(n),u=n.type,e!==null&&n.stateNode!=null)e.memoizedProps!==o&&_a(n);else{if(!o){if(n.stateNode===null)throw Error(s(166));return Ye(n),null}if(f=vt.current,pr(n))ym(n);else{var x=Sc(Z.current);switch(f){case 1:f=x.createElementNS("http://www.w3.org/2000/svg",u);break;case 2:f=x.createElementNS("http://www.w3.org/1998/Math/MathML",u);break;default:switch(u){case"svg":f=x.createElementNS("http://www.w3.org/2000/svg",u);break;case"math":f=x.createElementNS("http://www.w3.org/1998/Math/MathML",u);break;case"script":f=x.createElement("div"),f.innerHTML="<script><\/script>",f=f.removeChild(f.firstChild);break;case"select":f=typeof o.is=="string"?x.createElement("select",{is:o.is}):x.createElement("select"),o.multiple?f.multiple=!0:o.size&&(f.size=o.size);break;default:f=typeof o.is=="string"?x.createElement(u,{is:o.is}):x.createElement(u)}}f[rn]=n,f[pn]=o;t:for(x=n.child;x!==null;){if(x.tag===5||x.tag===6)f.appendChild(x.stateNode);else if(x.tag!==4&&x.tag!==27&&x.child!==null){x.child.return=x,x=x.child;continue}if(x===n)break t;for(;x.sibling===null;){if(x.return===null||x.return===n)break t;x=x.return}x.sibling.return=x.return,x=x.sibling}n.stateNode=f;t:switch(An(f,u,o),u){case"button":case"input":case"select":case"textarea":o=!!o.autoFocus;break t;case"img":o=!0;break t;default:o=!1}o&&_a(n)}}return Ye(n),qf(n,n.type,e===null?null:e.memoizedProps,n.pendingProps,a),null;case 6:if(e&&n.stateNode!=null)e.memoizedProps!==o&&_a(n);else{if(typeof o!="string"&&n.stateNode===null)throw Error(s(166));if(e=Z.current,pr(n)){if(e=n.stateNode,a=n.memoizedProps,o=null,u=En,u!==null)switch(u.tag){case 27:case 5:o=u.memoizedProps}e[rn]=n,e=!!(e.nodeValue===a||o!==null&&o.suppressHydrationWarning===!0||F0(e.nodeValue,a)),e||ka(n,!0)}else e=Sc(e).createTextNode(o),e[rn]=n,n.stateNode=e}return Ye(n),null;case 31:if(a=n.memoizedState,e===null||e.memoizedState!==null){if(o=pr(n),a!==null){if(e===null){if(!o)throw Error(s(318));if(e=n.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(s(557));e[rn]=n}else ws(),(n.flags&128)===0&&(n.memoizedState=null),n.flags|=4;Ye(n),e=!1}else a=ef(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=a),e=!0;if(!e)return n.flags&256?(ri(n),n):(ri(n),null);if((n.flags&128)!==0)throw Error(s(558))}return Ye(n),null;case 13:if(o=n.memoizedState,e===null||e.memoizedState!==null&&e.memoizedState.dehydrated!==null){if(u=pr(n),o!==null&&o.dehydrated!==null){if(e===null){if(!u)throw Error(s(318));if(u=n.memoizedState,u=u!==null?u.dehydrated:null,!u)throw Error(s(317));u[rn]=n}else ws(),(n.flags&128)===0&&(n.memoizedState=null),n.flags|=4;Ye(n),u=!1}else u=ef(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=u),u=!0;if(!u)return n.flags&256?(ri(n),n):(ri(n),null)}return ri(n),(n.flags&128)!==0?(n.lanes=a,n):(a=o!==null,e=e!==null&&e.memoizedState!==null,a&&(o=n.child,u=null,o.alternate!==null&&o.alternate.memoizedState!==null&&o.alternate.memoizedState.cachePool!==null&&(u=o.alternate.memoizedState.cachePool.pool),f=null,o.memoizedState!==null&&o.memoizedState.cachePool!==null&&(f=o.memoizedState.cachePool.pool),f!==u&&(o.flags|=2048)),a!==e&&a&&(n.child.flags|=8192),sc(n,n.updateQueue),Ye(n),null);case 4:return Ut(),e===null&&ph(n.stateNode.containerInfo),Ye(n),null;case 10:return da(n.type),Ye(n),null;case 19:if(k(nn),o=n.memoizedState,o===null)return Ye(n),null;if(u=(n.flags&128)!==0,f=o.rendering,f===null)if(u)Io(o,!1);else{if(en!==0||e!==null&&(e.flags&128)!==0)for(e=n.child;e!==null;){if(f=ql(e),f!==null){for(n.flags|=128,Io(o,!1),e=f.updateQueue,n.updateQueue=e,sc(n,e),n.subtreeFlags=0,e=a,a=n.child;a!==null;)gm(a,e),a=a.sibling;return ut(nn,nn.current&1|2),Ee&&fa(n,o.treeForkCount),n.child}e=e.sibling}o.tail!==null&&b()>uc&&(n.flags|=128,u=!0,Io(o,!1),n.lanes=4194304)}else{if(!u)if(e=ql(f),e!==null){if(n.flags|=128,u=!0,e=e.updateQueue,n.updateQueue=e,sc(n,e),Io(o,!0),o.tail===null&&o.tailMode==="hidden"&&!f.alternate&&!Ee)return Ye(n),null}else 2*b()-o.renderingStartTime>uc&&a!==536870912&&(n.flags|=128,u=!0,Io(o,!1),n.lanes=4194304);o.isBackwards?(f.sibling=n.child,n.child=f):(e=o.last,e!==null?e.sibling=f:n.child=f,o.last=f)}return o.tail!==null?(e=o.tail,o.rendering=e,o.tail=e.sibling,o.renderingStartTime=b(),e.sibling=null,a=nn.current,ut(nn,u?a&1|2:a&1),Ee&&fa(n,o.treeForkCount),e):(Ye(n),null);case 22:case 23:return ri(n),mf(),o=n.memoizedState!==null,e!==null?e.memoizedState!==null!==o&&(n.flags|=8192):o&&(n.flags|=8192),o?(a&536870912)!==0&&(n.flags&128)===0&&(Ye(n),n.subtreeFlags&6&&(n.flags|=8192)):Ye(n),a=n.updateQueue,a!==null&&sc(n,a.retryQueue),a=null,e!==null&&e.memoizedState!==null&&e.memoizedState.cachePool!==null&&(a=e.memoizedState.cachePool.pool),o=null,n.memoizedState!==null&&n.memoizedState.cachePool!==null&&(o=n.memoizedState.cachePool.pool),o!==a&&(n.flags|=2048),e!==null&&k(Ls),null;case 24:return a=null,e!==null&&(a=e.memoizedState.cache),n.memoizedState.cache!==a&&(n.flags|=2048),da(cn),Ye(n),null;case 25:return null;case 30:return null}throw Error(s(156,n.tag))}function BS(e,n){switch($u(n),n.tag){case 1:return e=n.flags,e&65536?(n.flags=e&-65537|128,n):null;case 3:return da(cn),Ut(),e=n.flags,(e&65536)!==0&&(e&128)===0?(n.flags=e&-65537|128,n):null;case 26:case 27:case 5:return Xt(n),null;case 31:if(n.memoizedState!==null){if(ri(n),n.alternate===null)throw Error(s(340));ws()}return e=n.flags,e&65536?(n.flags=e&-65537|128,n):null;case 13:if(ri(n),e=n.memoizedState,e!==null&&e.dehydrated!==null){if(n.alternate===null)throw Error(s(340));ws()}return e=n.flags,e&65536?(n.flags=e&-65537|128,n):null;case 19:return k(nn),null;case 4:return Ut(),null;case 10:return da(n.type),null;case 22:case 23:return ri(n),mf(),e!==null&&k(Ls),e=n.flags,e&65536?(n.flags=e&-65537|128,n):null;case 24:return da(cn),null;case 25:return null;default:return null}}function kg(e,n){switch($u(n),n.tag){case 3:da(cn),Ut();break;case 26:case 27:case 5:Xt(n);break;case 4:Ut();break;case 31:n.memoizedState!==null&&ri(n);break;case 13:ri(n);break;case 19:k(nn);break;case 10:da(n.type);break;case 22:case 23:ri(n),mf(),e!==null&&k(Ls);break;case 24:da(cn)}}function Fo(e,n){try{var a=n.updateQueue,o=a!==null?a.lastEffect:null;if(o!==null){var u=o.next;a=u;do{if((a.tag&e)===e){o=void 0;var f=a.create,x=a.inst;o=f(),x.destroy=o}a=a.next}while(a!==u)}}catch(R){Ie(n,n.return,R)}}function Ka(e,n,a){try{var o=n.updateQueue,u=o!==null?o.lastEffect:null;if(u!==null){var f=u.next;o=f;do{if((o.tag&e)===e){var x=o.inst,R=x.destroy;if(R!==void 0){x.destroy=void 0,u=n;var G=a,st=R;try{st()}catch(gt){Ie(u,G,gt)}}}o=o.next}while(o!==f)}}catch(gt){Ie(n,n.return,gt)}}function Xg(e){var n=e.updateQueue;if(n!==null){var a=e.stateNode;try{Om(n,a)}catch(o){Ie(e,e.return,o)}}}function Wg(e,n,a){a.props=Is(e.type,e.memoizedProps),a.state=e.memoizedState;try{a.componentWillUnmount()}catch(o){Ie(e,n,o)}}function Bo(e,n){try{var a=e.ref;if(a!==null){switch(e.tag){case 26:case 27:case 5:var o=e.stateNode;break;case 30:o=e.stateNode;break;default:o=e.stateNode}typeof a=="function"?e.refCleanup=a(o):a.current=o}}catch(u){Ie(e,n,u)}}function Yi(e,n){var a=e.ref,o=e.refCleanup;if(a!==null)if(typeof o=="function")try{o()}catch(u){Ie(e,n,u)}finally{e.refCleanup=null,e=e.alternate,e!=null&&(e.refCleanup=null)}else if(typeof a=="function")try{a(null)}catch(u){Ie(e,n,u)}else a.current=null}function qg(e){var n=e.type,a=e.memoizedProps,o=e.stateNode;try{t:switch(n){case"button":case"input":case"select":case"textarea":a.autoFocus&&o.focus();break t;case"img":a.src?o.src=a.src:a.srcSet&&(o.srcset=a.srcSet)}}catch(u){Ie(e,e.return,u)}}function Yf(e,n,a){try{var o=e.stateNode;oy(o,e.type,a,n),o[pn]=n}catch(u){Ie(e,e.return,u)}}function Yg(e){return e.tag===5||e.tag===3||e.tag===26||e.tag===27&&is(e.type)||e.tag===4}function jf(e){t:for(;;){for(;e.sibling===null;){if(e.return===null||Yg(e.return))return null;e=e.return}for(e.sibling.return=e.return,e=e.sibling;e.tag!==5&&e.tag!==6&&e.tag!==18;){if(e.tag===27&&is(e.type)||e.flags&2||e.child===null||e.tag===4)continue t;e.child.return=e,e=e.child}if(!(e.flags&2))return e.stateNode}}function Zf(e,n,a){var o=e.tag;if(o===5||o===6)e=e.stateNode,n?(a.nodeType===9?a.body:a.nodeName==="HTML"?a.ownerDocument.body:a).insertBefore(e,n):(n=a.nodeType===9?a.body:a.nodeName==="HTML"?a.ownerDocument.body:a,n.appendChild(e),a=a._reactRootContainer,a!=null||n.onclick!==null||(n.onclick=la));else if(o!==4&&(o===27&&is(e.type)&&(a=e.stateNode,n=null),e=e.child,e!==null))for(Zf(e,n,a),e=e.sibling;e!==null;)Zf(e,n,a),e=e.sibling}function rc(e,n,a){var o=e.tag;if(o===5||o===6)e=e.stateNode,n?a.insertBefore(e,n):a.appendChild(e);else if(o!==4&&(o===27&&is(e.type)&&(a=e.stateNode),e=e.child,e!==null))for(rc(e,n,a),e=e.sibling;e!==null;)rc(e,n,a),e=e.sibling}function jg(e){var n=e.stateNode,a=e.memoizedProps;try{for(var o=e.type,u=n.attributes;u.length;)n.removeAttributeNode(u[0]);An(n,o,a),n[rn]=e,n[pn]=a}catch(f){Ie(e,e.return,f)}}var va=!1,hn=!1,Kf=!1,Zg=typeof WeakSet=="function"?WeakSet:Set,Sn=null;function HS(e,n){if(e=e.containerInfo,_h=Rc,e=om(e),Vu(e)){if("selectionStart"in e)var a={start:e.selectionStart,end:e.selectionEnd};else t:{a=(a=e.ownerDocument)&&a.defaultView||window;var o=a.getSelection&&a.getSelection();if(o&&o.rangeCount!==0){a=o.anchorNode;var u=o.anchorOffset,f=o.focusNode;o=o.focusOffset;try{a.nodeType,f.nodeType}catch{a=null;break t}var x=0,R=-1,G=-1,st=0,gt=0,St=e,ct=null;e:for(;;){for(var ht;St!==a||u!==0&&St.nodeType!==3||(R=x+u),St!==f||o!==0&&St.nodeType!==3||(G=x+o),St.nodeType===3&&(x+=St.nodeValue.length),(ht=St.firstChild)!==null;)ct=St,St=ht;for(;;){if(St===e)break e;if(ct===a&&++st===u&&(R=x),ct===f&&++gt===o&&(G=x),(ht=St.nextSibling)!==null)break;St=ct,ct=St.parentNode}St=ht}a=R===-1||G===-1?null:{start:R,end:G}}else a=null}a=a||{start:0,end:0}}else a=null;for(vh={focusedElem:e,selectionRange:a},Rc=!1,Sn=n;Sn!==null;)if(n=Sn,e=n.child,(n.subtreeFlags&1028)!==0&&e!==null)e.return=n,Sn=e;else for(;Sn!==null;){switch(n=Sn,f=n.alternate,e=n.flags,n.tag){case 0:if((e&4)!==0&&(e=n.updateQueue,e=e!==null?e.events:null,e!==null))for(a=0;a<e.length;a++)u=e[a],u.ref.impl=u.nextImpl;break;case 11:case 15:break;case 1:if((e&1024)!==0&&f!==null){e=void 0,a=n,u=f.memoizedProps,f=f.memoizedState,o=a.stateNode;try{var Vt=Is(a.type,u);e=o.getSnapshotBeforeUpdate(Vt,f),o.__reactInternalSnapshotBeforeUpdate=e}catch($t){Ie(a,a.return,$t)}}break;case 3:if((e&1024)!==0){if(e=n.stateNode.containerInfo,a=e.nodeType,a===9)yh(e);else if(a===1)switch(e.nodeName){case"HEAD":case"HTML":case"BODY":yh(e);break;default:e.textContent=""}}break;case 5:case 26:case 27:case 6:case 4:case 17:break;default:if((e&1024)!==0)throw Error(s(163))}if(e=n.sibling,e!==null){e.return=n.return,Sn=e;break}Sn=n.return}}function Kg(e,n,a){var o=a.flags;switch(a.tag){case 0:case 11:case 15:Sa(e,a),o&4&&Fo(5,a);break;case 1:if(Sa(e,a),o&4)if(e=a.stateNode,n===null)try{e.componentDidMount()}catch(x){Ie(a,a.return,x)}else{var u=Is(a.type,n.memoizedProps);n=n.memoizedState;try{e.componentDidUpdate(u,n,e.__reactInternalSnapshotBeforeUpdate)}catch(x){Ie(a,a.return,x)}}o&64&&Xg(a),o&512&&Bo(a,a.return);break;case 3:if(Sa(e,a),o&64&&(e=a.updateQueue,e!==null)){if(n=null,a.child!==null)switch(a.child.tag){case 27:case 5:n=a.child.stateNode;break;case 1:n=a.child.stateNode}try{Om(e,n)}catch(x){Ie(a,a.return,x)}}break;case 27:n===null&&o&4&&jg(a);case 26:case 5:Sa(e,a),n===null&&o&4&&qg(a),o&512&&Bo(a,a.return);break;case 12:Sa(e,a);break;case 31:Sa(e,a),o&4&&$g(e,a);break;case 13:Sa(e,a),o&4&&t0(e,a),o&64&&(e=a.memoizedState,e!==null&&(e=e.dehydrated,e!==null&&(a=ZS.bind(null,a),my(e,a))));break;case 22:if(o=a.memoizedState!==null||va,!o){n=n!==null&&n.memoizedState!==null||hn,u=va;var f=hn;va=o,(hn=n)&&!f?ya(e,a,(a.subtreeFlags&8772)!==0):Sa(e,a),va=u,hn=f}break;case 30:break;default:Sa(e,a)}}function Qg(e){var n=e.alternate;n!==null&&(e.alternate=null,Qg(n)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(n=e.stateNode,n!==null&&ho(n)),e.stateNode=null,e.return=null,e.dependencies=null,e.memoizedProps=null,e.memoizedState=null,e.pendingProps=null,e.stateNode=null,e.updateQueue=null}var Qe=null,Yn=!1;function xa(e,n,a){for(a=a.child;a!==null;)Jg(e,n,a),a=a.sibling}function Jg(e,n,a){if(Et&&typeof Et.onCommitFiberUnmount=="function")try{Et.onCommitFiberUnmount(Tt,a)}catch{}switch(a.tag){case 26:hn||Yi(a,n),xa(e,n,a),a.memoizedState?a.memoizedState.count--:a.stateNode&&(a=a.stateNode,a.parentNode.removeChild(a));break;case 27:hn||Yi(a,n);var o=Qe,u=Yn;is(a.type)&&(Qe=a.stateNode,Yn=!1),xa(e,n,a),jo(a.stateNode),Qe=o,Yn=u;break;case 5:hn||Yi(a,n);case 6:if(o=Qe,u=Yn,Qe=null,xa(e,n,a),Qe=o,Yn=u,Qe!==null)if(Yn)try{(Qe.nodeType===9?Qe.body:Qe.nodeName==="HTML"?Qe.ownerDocument.body:Qe).removeChild(a.stateNode)}catch(f){Ie(a,n,f)}else try{Qe.removeChild(a.stateNode)}catch(f){Ie(a,n,f)}break;case 18:Qe!==null&&(Yn?(e=Qe,X0(e.nodeType===9?e.body:e.nodeName==="HTML"?e.ownerDocument.body:e,a.stateNode),Pr(e)):X0(Qe,a.stateNode));break;case 4:o=Qe,u=Yn,Qe=a.stateNode.containerInfo,Yn=!0,xa(e,n,a),Qe=o,Yn=u;break;case 0:case 11:case 14:case 15:Ka(2,a,n),hn||Ka(4,a,n),xa(e,n,a);break;case 1:hn||(Yi(a,n),o=a.stateNode,typeof o.componentWillUnmount=="function"&&Wg(a,n,o)),xa(e,n,a);break;case 21:xa(e,n,a);break;case 22:hn=(o=hn)||a.memoizedState!==null,xa(e,n,a),hn=o;break;default:xa(e,n,a)}}function $g(e,n){if(n.memoizedState===null&&(e=n.alternate,e!==null&&(e=e.memoizedState,e!==null))){e=e.dehydrated;try{Pr(e)}catch(a){Ie(n,n.return,a)}}}function t0(e,n){if(n.memoizedState===null&&(e=n.alternate,e!==null&&(e=e.memoizedState,e!==null&&(e=e.dehydrated,e!==null))))try{Pr(e)}catch(a){Ie(n,n.return,a)}}function GS(e){switch(e.tag){case 31:case 13:case 19:var n=e.stateNode;return n===null&&(n=e.stateNode=new Zg),n;case 22:return e=e.stateNode,n=e._retryCache,n===null&&(n=e._retryCache=new Zg),n;default:throw Error(s(435,e.tag))}}function oc(e,n){var a=GS(e);n.forEach(function(o){if(!a.has(o)){a.add(o);var u=KS.bind(null,e,o);o.then(u,u)}})}function jn(e,n){var a=n.deletions;if(a!==null)for(var o=0;o<a.length;o++){var u=a[o],f=e,x=n,R=x;t:for(;R!==null;){switch(R.tag){case 27:if(is(R.type)){Qe=R.stateNode,Yn=!1;break t}break;case 5:Qe=R.stateNode,Yn=!1;break t;case 3:case 4:Qe=R.stateNode.containerInfo,Yn=!0;break t}R=R.return}if(Qe===null)throw Error(s(160));Jg(f,x,u),Qe=null,Yn=!1,f=u.alternate,f!==null&&(f.return=null),u.return=null}if(n.subtreeFlags&13886)for(n=n.child;n!==null;)e0(n,e),n=n.sibling}var Li=null;function e0(e,n){var a=e.alternate,o=e.flags;switch(e.tag){case 0:case 11:case 14:case 15:jn(n,e),Zn(e),o&4&&(Ka(3,e,e.return),Fo(3,e),Ka(5,e,e.return));break;case 1:jn(n,e),Zn(e),o&512&&(hn||a===null||Yi(a,a.return)),o&64&&va&&(e=e.updateQueue,e!==null&&(o=e.callbacks,o!==null&&(a=e.shared.hiddenCallbacks,e.shared.hiddenCallbacks=a===null?o:a.concat(o))));break;case 26:var u=Li;if(jn(n,e),Zn(e),o&512&&(hn||a===null||Yi(a,a.return)),o&4){var f=a!==null?a.memoizedState:null;if(o=e.memoizedState,a===null)if(o===null)if(e.stateNode===null){t:{o=e.type,a=e.memoizedProps,u=u.ownerDocument||u;e:switch(o){case"title":f=u.getElementsByTagName("title")[0],(!f||f[Ms]||f[rn]||f.namespaceURI==="http://www.w3.org/2000/svg"||f.hasAttribute("itemprop"))&&(f=u.createElement(o),u.head.insertBefore(f,u.querySelector("head > title"))),An(f,o,a),f[rn]=e,q(f),o=f;break t;case"link":var x=e_("link","href",u).get(o+(a.href||""));if(x){for(var R=0;R<x.length;R++)if(f=x[R],f.getAttribute("href")===(a.href==null||a.href===""?null:a.href)&&f.getAttribute("rel")===(a.rel==null?null:a.rel)&&f.getAttribute("title")===(a.title==null?null:a.title)&&f.getAttribute("crossorigin")===(a.crossOrigin==null?null:a.crossOrigin)){x.splice(R,1);break e}}f=u.createElement(o),An(f,o,a),u.head.appendChild(f);break;case"meta":if(x=e_("meta","content",u).get(o+(a.content||""))){for(R=0;R<x.length;R++)if(f=x[R],f.getAttribute("content")===(a.content==null?null:""+a.content)&&f.getAttribute("name")===(a.name==null?null:a.name)&&f.getAttribute("property")===(a.property==null?null:a.property)&&f.getAttribute("http-equiv")===(a.httpEquiv==null?null:a.httpEquiv)&&f.getAttribute("charset")===(a.charSet==null?null:a.charSet)){x.splice(R,1);break e}}f=u.createElement(o),An(f,o,a),u.head.appendChild(f);break;default:throw Error(s(468,o))}f[rn]=e,q(f),o=f}e.stateNode=o}else n_(u,e.type,e.stateNode);else e.stateNode=t_(u,o,e.memoizedProps);else f!==o?(f===null?a.stateNode!==null&&(a=a.stateNode,a.parentNode.removeChild(a)):f.count--,o===null?n_(u,e.type,e.stateNode):t_(u,o,e.memoizedProps)):o===null&&e.stateNode!==null&&Yf(e,e.memoizedProps,a.memoizedProps)}break;case 27:jn(n,e),Zn(e),o&512&&(hn||a===null||Yi(a,a.return)),a!==null&&o&4&&Yf(e,e.memoizedProps,a.memoizedProps);break;case 5:if(jn(n,e),Zn(e),o&512&&(hn||a===null||Yi(a,a.return)),e.flags&32){u=e.stateNode;try{Hn(u,"")}catch(Vt){Ie(e,e.return,Vt)}}o&4&&e.stateNode!=null&&(u=e.memoizedProps,Yf(e,u,a!==null?a.memoizedProps:u)),o&1024&&(Kf=!0);break;case 6:if(jn(n,e),Zn(e),o&4){if(e.stateNode===null)throw Error(s(162));o=e.memoizedProps,a=e.stateNode;try{a.nodeValue=o}catch(Vt){Ie(e,e.return,Vt)}}break;case 3:if(Ec=null,u=Li,Li=yc(n.containerInfo),jn(n,e),Li=u,Zn(e),o&4&&a!==null&&a.memoizedState.isDehydrated)try{Pr(n.containerInfo)}catch(Vt){Ie(e,e.return,Vt)}Kf&&(Kf=!1,n0(e));break;case 4:o=Li,Li=yc(e.stateNode.containerInfo),jn(n,e),Zn(e),Li=o;break;case 12:jn(n,e),Zn(e);break;case 31:jn(n,e),Zn(e),o&4&&(o=e.updateQueue,o!==null&&(e.updateQueue=null,oc(e,o)));break;case 13:jn(n,e),Zn(e),e.child.flags&8192&&e.memoizedState!==null!=(a!==null&&a.memoizedState!==null)&&(cc=b()),o&4&&(o=e.updateQueue,o!==null&&(e.updateQueue=null,oc(e,o)));break;case 22:u=e.memoizedState!==null;var G=a!==null&&a.memoizedState!==null,st=va,gt=hn;if(va=st||u,hn=gt||G,jn(n,e),hn=gt,va=st,Zn(e),o&8192)t:for(n=e.stateNode,n._visibility=u?n._visibility&-2:n._visibility|1,u&&(a===null||G||va||hn||Fs(e)),a=null,n=e;;){if(n.tag===5||n.tag===26){if(a===null){G=a=n;try{if(f=G.stateNode,u)x=f.style,typeof x.setProperty=="function"?x.setProperty("display","none","important"):x.display="none";else{R=G.stateNode;var St=G.memoizedProps.style,ct=St!=null&&St.hasOwnProperty("display")?St.display:null;R.style.display=ct==null||typeof ct=="boolean"?"":(""+ct).trim()}}catch(Vt){Ie(G,G.return,Vt)}}}else if(n.tag===6){if(a===null){G=n;try{G.stateNode.nodeValue=u?"":G.memoizedProps}catch(Vt){Ie(G,G.return,Vt)}}}else if(n.tag===18){if(a===null){G=n;try{var ht=G.stateNode;u?W0(ht,!0):W0(G.stateNode,!1)}catch(Vt){Ie(G,G.return,Vt)}}}else if((n.tag!==22&&n.tag!==23||n.memoizedState===null||n===e)&&n.child!==null){n.child.return=n,n=n.child;continue}if(n===e)break t;for(;n.sibling===null;){if(n.return===null||n.return===e)break t;a===n&&(a=null),n=n.return}a===n&&(a=null),n.sibling.return=n.return,n=n.sibling}o&4&&(o=e.updateQueue,o!==null&&(a=o.retryQueue,a!==null&&(o.retryQueue=null,oc(e,a))));break;case 19:jn(n,e),Zn(e),o&4&&(o=e.updateQueue,o!==null&&(e.updateQueue=null,oc(e,o)));break;case 30:break;case 21:break;default:jn(n,e),Zn(e)}}function Zn(e){var n=e.flags;if(n&2){try{for(var a,o=e.return;o!==null;){if(Yg(o)){a=o;break}o=o.return}if(a==null)throw Error(s(160));switch(a.tag){case 27:var u=a.stateNode,f=jf(e);rc(e,f,u);break;case 5:var x=a.stateNode;a.flags&32&&(Hn(x,""),a.flags&=-33);var R=jf(e);rc(e,R,x);break;case 3:case 4:var G=a.stateNode.containerInfo,st=jf(e);Zf(e,st,G);break;default:throw Error(s(161))}}catch(gt){Ie(e,e.return,gt)}e.flags&=-3}n&4096&&(e.flags&=-4097)}function n0(e){if(e.subtreeFlags&1024)for(e=e.child;e!==null;){var n=e;n0(n),n.tag===5&&n.flags&1024&&n.stateNode.reset(),e=e.sibling}}function Sa(e,n){if(n.subtreeFlags&8772)for(n=n.child;n!==null;)Kg(e,n.alternate,n),n=n.sibling}function Fs(e){for(e=e.child;e!==null;){var n=e;switch(n.tag){case 0:case 11:case 14:case 15:Ka(4,n,n.return),Fs(n);break;case 1:Yi(n,n.return);var a=n.stateNode;typeof a.componentWillUnmount=="function"&&Wg(n,n.return,a),Fs(n);break;case 27:jo(n.stateNode);case 26:case 5:Yi(n,n.return),Fs(n);break;case 22:n.memoizedState===null&&Fs(n);break;case 30:Fs(n);break;default:Fs(n)}e=e.sibling}}function ya(e,n,a){for(a=a&&(n.subtreeFlags&8772)!==0,n=n.child;n!==null;){var o=n.alternate,u=e,f=n,x=f.flags;switch(f.tag){case 0:case 11:case 15:ya(u,f,a),Fo(4,f);break;case 1:if(ya(u,f,a),o=f,u=o.stateNode,typeof u.componentDidMount=="function")try{u.componentDidMount()}catch(st){Ie(o,o.return,st)}if(o=f,u=o.updateQueue,u!==null){var R=o.stateNode;try{var G=u.shared.hiddenCallbacks;if(G!==null)for(u.shared.hiddenCallbacks=null,u=0;u<G.length;u++)Nm(G[u],R)}catch(st){Ie(o,o.return,st)}}a&&x&64&&Xg(f),Bo(f,f.return);break;case 27:jg(f);case 26:case 5:ya(u,f,a),a&&o===null&&x&4&&qg(f),Bo(f,f.return);break;case 12:ya(u,f,a);break;case 31:ya(u,f,a),a&&x&4&&$g(u,f);break;case 13:ya(u,f,a),a&&x&4&&t0(u,f);break;case 22:f.memoizedState===null&&ya(u,f,a),Bo(f,f.return);break;case 30:break;default:ya(u,f,a)}n=n.sibling}}function Qf(e,n){var a=null;e!==null&&e.memoizedState!==null&&e.memoizedState.cachePool!==null&&(a=e.memoizedState.cachePool.pool),e=null,n.memoizedState!==null&&n.memoizedState.cachePool!==null&&(e=n.memoizedState.cachePool.pool),e!==a&&(e!=null&&e.refCount++,a!=null&&To(a))}function Jf(e,n){e=null,n.alternate!==null&&(e=n.alternate.memoizedState.cache),n=n.memoizedState.cache,n!==e&&(n.refCount++,e!=null&&To(e))}function Ni(e,n,a,o){if(n.subtreeFlags&10256)for(n=n.child;n!==null;)i0(e,n,a,o),n=n.sibling}function i0(e,n,a,o){var u=n.flags;switch(n.tag){case 0:case 11:case 15:Ni(e,n,a,o),u&2048&&Fo(9,n);break;case 1:Ni(e,n,a,o);break;case 3:Ni(e,n,a,o),u&2048&&(e=null,n.alternate!==null&&(e=n.alternate.memoizedState.cache),n=n.memoizedState.cache,n!==e&&(n.refCount++,e!=null&&To(e)));break;case 12:if(u&2048){Ni(e,n,a,o),e=n.stateNode;try{var f=n.memoizedProps,x=f.id,R=f.onPostCommit;typeof R=="function"&&R(x,n.alternate===null?"mount":"update",e.passiveEffectDuration,-0)}catch(G){Ie(n,n.return,G)}}else Ni(e,n,a,o);break;case 31:Ni(e,n,a,o);break;case 13:Ni(e,n,a,o);break;case 23:break;case 22:f=n.stateNode,x=n.alternate,n.memoizedState!==null?f._visibility&2?Ni(e,n,a,o):Ho(e,n):f._visibility&2?Ni(e,n,a,o):(f._visibility|=2,br(e,n,a,o,(n.subtreeFlags&10256)!==0||!1)),u&2048&&Qf(x,n);break;case 24:Ni(e,n,a,o),u&2048&&Jf(n.alternate,n);break;default:Ni(e,n,a,o)}}function br(e,n,a,o,u){for(u=u&&((n.subtreeFlags&10256)!==0||!1),n=n.child;n!==null;){var f=e,x=n,R=a,G=o,st=x.flags;switch(x.tag){case 0:case 11:case 15:br(f,x,R,G,u),Fo(8,x);break;case 23:break;case 22:var gt=x.stateNode;x.memoizedState!==null?gt._visibility&2?br(f,x,R,G,u):Ho(f,x):(gt._visibility|=2,br(f,x,R,G,u)),u&&st&2048&&Qf(x.alternate,x);break;case 24:br(f,x,R,G,u),u&&st&2048&&Jf(x.alternate,x);break;default:br(f,x,R,G,u)}n=n.sibling}}function Ho(e,n){if(n.subtreeFlags&10256)for(n=n.child;n!==null;){var a=e,o=n,u=o.flags;switch(o.tag){case 22:Ho(a,o),u&2048&&Qf(o.alternate,o);break;case 24:Ho(a,o),u&2048&&Jf(o.alternate,o);break;default:Ho(a,o)}n=n.sibling}}var Go=8192;function Tr(e,n,a){if(e.subtreeFlags&Go)for(e=e.child;e!==null;)a0(e,n,a),e=e.sibling}function a0(e,n,a){switch(e.tag){case 26:Tr(e,n,a),e.flags&Go&&e.memoizedState!==null&&Ry(a,Li,e.memoizedState,e.memoizedProps);break;case 5:Tr(e,n,a);break;case 3:case 4:var o=Li;Li=yc(e.stateNode.containerInfo),Tr(e,n,a),Li=o;break;case 22:e.memoizedState===null&&(o=e.alternate,o!==null&&o.memoizedState!==null?(o=Go,Go=16777216,Tr(e,n,a),Go=o):Tr(e,n,a));break;default:Tr(e,n,a)}}function s0(e){var n=e.alternate;if(n!==null&&(e=n.child,e!==null)){n.child=null;do n=e.sibling,e.sibling=null,e=n;while(e!==null)}}function Vo(e){var n=e.deletions;if((e.flags&16)!==0){if(n!==null)for(var a=0;a<n.length;a++){var o=n[a];Sn=o,o0(o,e)}s0(e)}if(e.subtreeFlags&10256)for(e=e.child;e!==null;)r0(e),e=e.sibling}function r0(e){switch(e.tag){case 0:case 11:case 15:Vo(e),e.flags&2048&&Ka(9,e,e.return);break;case 3:Vo(e);break;case 12:Vo(e);break;case 22:var n=e.stateNode;e.memoizedState!==null&&n._visibility&2&&(e.return===null||e.return.tag!==13)?(n._visibility&=-3,lc(e)):Vo(e);break;default:Vo(e)}}function lc(e){var n=e.deletions;if((e.flags&16)!==0){if(n!==null)for(var a=0;a<n.length;a++){var o=n[a];Sn=o,o0(o,e)}s0(e)}for(e=e.child;e!==null;){switch(n=e,n.tag){case 0:case 11:case 15:Ka(8,n,n.return),lc(n);break;case 22:a=n.stateNode,a._visibility&2&&(a._visibility&=-3,lc(n));break;default:lc(n)}e=e.sibling}}function o0(e,n){for(;Sn!==null;){var a=Sn;switch(a.tag){case 0:case 11:case 15:Ka(8,a,n);break;case 23:case 22:if(a.memoizedState!==null&&a.memoizedState.cachePool!==null){var o=a.memoizedState.cachePool.pool;o!=null&&o.refCount++}break;case 24:To(a.memoizedState.cache)}if(o=a.child,o!==null)o.return=a,Sn=o;else t:for(a=e;Sn!==null;){o=Sn;var u=o.sibling,f=o.return;if(Qg(o),o===a){Sn=null;break t}if(u!==null){u.return=f,Sn=u;break t}Sn=f}}}var VS={getCacheForType:function(e){var n=bn(cn),a=n.data.get(e);return a===void 0&&(a=e(),n.data.set(e,a)),a},cacheSignal:function(){return bn(cn).controller.signal}},kS=typeof WeakMap=="function"?WeakMap:Map,Le=0,Xe=null,ve=null,ye=0,ze=0,oi=null,Qa=!1,Ar=!1,$f=!1,Ma=0,en=0,Ja=0,Bs=0,th=0,li=0,Rr=0,ko=null,Kn=null,eh=!1,cc=0,l0=0,uc=1/0,fc=null,$a=null,gn=0,ts=null,Cr=null,Ea=0,nh=0,ih=null,c0=null,Xo=0,ah=null;function ci(){return(Le&2)!==0&&ye!==0?ye&-ye:O.T!==null?uh():Xi()}function u0(){if(li===0)if((ye&536870912)===0||Ee){var e=At;At<<=1,(At&3932160)===0&&(At=262144),li=e}else li=536870912;return e=si.current,e!==null&&(e.flags|=32),li}function Qn(e,n,a){(e===Xe&&(ze===2||ze===9)||e.cancelPendingCommit!==null)&&(wr(e,0),es(e,ye,li,!1)),In(e,a),((Le&2)===0||e!==Xe)&&(e===Xe&&((Le&2)===0&&(Bs|=a),en===4&&es(e,ye,li,!1)),ji(e))}function f0(e,n,a){if((Le&6)!==0)throw Error(s(327));var o=!a&&(n&127)===0&&(n&e.expiredLanes)===0||Ht(e,n),u=o?qS(e,n):rh(e,n,!0),f=o;do{if(u===0){Ar&&!o&&es(e,n,0,!1);break}else{if(a=e.current.alternate,f&&!XS(a)){u=rh(e,n,!1),f=!1;continue}if(u===2){if(f=n,e.errorRecoveryDisabledLanes&f)var x=0;else x=e.pendingLanes&-536870913,x=x!==0?x:x&536870912?536870912:0;if(x!==0){n=x;t:{var R=e;u=ko;var G=R.current.memoizedState.isDehydrated;if(G&&(wr(R,x).flags|=256),x=rh(R,x,!1),x!==2){if($f&&!G){R.errorRecoveryDisabledLanes|=f,Bs|=f,u=4;break t}f=Kn,Kn=u,f!==null&&(Kn===null?Kn=f:Kn.push.apply(Kn,f))}u=x}if(f=!1,u!==2)continue}}if(u===1){wr(e,0),es(e,n,0,!0);break}t:{switch(o=e,f=u,f){case 0:case 1:throw Error(s(345));case 4:if((n&4194048)!==n)break;case 6:es(o,n,li,!Qa);break t;case 2:Kn=null;break;case 3:case 5:break;default:throw Error(s(329))}if((n&62914560)===n&&(u=cc+300-b(),10<u)){if(es(o,n,li,!Qa),pt(o,0,!0)!==0)break t;Ea=n,o.timeoutHandle=V0(h0.bind(null,o,a,Kn,fc,eh,n,li,Bs,Rr,Qa,f,"Throttled",-0,0),u);break t}h0(o,a,Kn,fc,eh,n,li,Bs,Rr,Qa,f,null,-0,0)}}break}while(!0);ji(e)}function h0(e,n,a,o,u,f,x,R,G,st,gt,St,ct,ht){if(e.timeoutHandle=-1,St=n.subtreeFlags,St&8192||(St&16785408)===16785408){St={stylesheets:null,count:0,imgCount:0,imgBytes:0,suspenseyImages:[],waitingForImages:!0,waitingForViewTransition:!1,unsuspend:la},a0(n,f,St);var Vt=(f&62914560)===f?cc-b():(f&4194048)===f?l0-b():0;if(Vt=Cy(St,Vt),Vt!==null){Ea=f,e.cancelPendingCommit=Vt(S0.bind(null,e,n,f,a,o,u,x,R,G,gt,St,null,ct,ht)),es(e,f,x,!st);return}}S0(e,n,f,a,o,u,x,R,G)}function XS(e){for(var n=e;;){var a=n.tag;if((a===0||a===11||a===15)&&n.flags&16384&&(a=n.updateQueue,a!==null&&(a=a.stores,a!==null)))for(var o=0;o<a.length;o++){var u=a[o],f=u.getSnapshot;u=u.value;try{if(!ii(f(),u))return!1}catch{return!1}}if(a=n.child,n.subtreeFlags&16384&&a!==null)a.return=n,n=a;else{if(n===e)break;for(;n.sibling===null;){if(n.return===null||n.return===e)return!0;n=n.return}n.sibling.return=n.return,n=n.sibling}}return!0}function es(e,n,a,o){n&=~th,n&=~Bs,e.suspendedLanes|=n,e.pingedLanes&=~n,o&&(e.warmLanes|=n),o=e.expirationTimes;for(var u=n;0<u;){var f=31-Ot(u),x=1<<f;o[f]=-1,u&=~x}a!==0&&fo(e,a,n)}function hc(){return(Le&6)===0?(Wo(0),!1):!0}function sh(){if(ve!==null){if(ze===0)var e=ve.return;else e=ve,ha=Ds=null,yf(e),xr=null,Ro=0,e=ve;for(;e!==null;)kg(e.alternate,e),e=e.return;ve=null}}function wr(e,n){var a=e.timeoutHandle;a!==-1&&(e.timeoutHandle=-1,uy(a)),a=e.cancelPendingCommit,a!==null&&(e.cancelPendingCommit=null,a()),Ea=0,sh(),Xe=e,ve=a=ua(e.current,null),ye=n,ze=0,oi=null,Qa=!1,Ar=Ht(e,n),$f=!1,Rr=li=th=Bs=Ja=en=0,Kn=ko=null,eh=!1,(n&8)!==0&&(n|=n&32);var o=e.entangledLanes;if(o!==0)for(e=e.entanglements,o&=n;0<o;){var u=31-Ot(o),f=1<<u;n|=e[u],o&=~f}return Ma=n,Nl(),a}function d0(e,n){ue=null,O.H=Po,n===vr||n===Gl?(n=wm(),ze=3):n===cf?(n=wm(),ze=4):ze=n===If?8:n!==null&&typeof n=="object"&&typeof n.then=="function"?6:1,oi=n,ve===null&&(en=1,ec(e,_i(n,e.current)))}function p0(){var e=si.current;return e===null?!0:(ye&4194048)===ye?yi===null:(ye&62914560)===ye||(ye&536870912)!==0?e===yi:!1}function m0(){var e=O.H;return O.H=Po,e===null?Po:e}function g0(){var e=O.A;return O.A=VS,e}function dc(){en=4,Qa||(ye&4194048)!==ye&&si.current!==null||(Ar=!0),(Ja&134217727)===0&&(Bs&134217727)===0||Xe===null||es(Xe,ye,li,!1)}function rh(e,n,a){var o=Le;Le|=2;var u=m0(),f=g0();(Xe!==e||ye!==n)&&(fc=null,wr(e,n)),n=!1;var x=en;t:do try{if(ze!==0&&ve!==null){var R=ve,G=oi;switch(ze){case 8:sh(),x=6;break t;case 3:case 2:case 9:case 6:si.current===null&&(n=!0);var st=ze;if(ze=0,oi=null,Dr(e,R,G,st),a&&Ar){x=0;break t}break;default:st=ze,ze=0,oi=null,Dr(e,R,G,st)}}WS(),x=en;break}catch(gt){d0(e,gt)}while(!0);return n&&e.shellSuspendCounter++,ha=Ds=null,Le=o,O.H=u,O.A=f,ve===null&&(Xe=null,ye=0,Nl()),x}function WS(){for(;ve!==null;)_0(ve)}function qS(e,n){var a=Le;Le|=2;var o=m0(),u=g0();Xe!==e||ye!==n?(fc=null,uc=b()+500,wr(e,n)):Ar=Ht(e,n);t:do try{if(ze!==0&&ve!==null){n=ve;var f=oi;e:switch(ze){case 1:ze=0,oi=null,Dr(e,n,f,1);break;case 2:case 9:if(Rm(f)){ze=0,oi=null,v0(n);break}n=function(){ze!==2&&ze!==9||Xe!==e||(ze=7),ji(e)},f.then(n,n);break t;case 3:ze=7;break t;case 4:ze=5;break t;case 7:Rm(f)?(ze=0,oi=null,v0(n)):(ze=0,oi=null,Dr(e,n,f,7));break;case 5:var x=null;switch(ve.tag){case 26:x=ve.memoizedState;case 5:case 27:var R=ve;if(x?i_(x):R.stateNode.complete){ze=0,oi=null;var G=R.sibling;if(G!==null)ve=G;else{var st=R.return;st!==null?(ve=st,pc(st)):ve=null}break e}}ze=0,oi=null,Dr(e,n,f,5);break;case 6:ze=0,oi=null,Dr(e,n,f,6);break;case 8:sh(),en=6;break t;default:throw Error(s(462))}}YS();break}catch(gt){d0(e,gt)}while(!0);return ha=Ds=null,O.H=o,O.A=u,Le=a,ve!==null?0:(Xe=null,ye=0,Nl(),en)}function YS(){for(;ve!==null&&!Yt();)_0(ve)}function _0(e){var n=Gg(e.alternate,e,Ma);e.memoizedProps=e.pendingProps,n===null?pc(e):ve=n}function v0(e){var n=e,a=n.alternate;switch(n.tag){case 15:case 0:n=Pg(a,n,n.pendingProps,n.type,void 0,ye);break;case 11:n=Pg(a,n,n.pendingProps,n.type.render,n.ref,ye);break;case 5:yf(n);default:kg(a,n),n=ve=gm(n,Ma),n=Gg(a,n,Ma)}e.memoizedProps=e.pendingProps,n===null?pc(e):ve=n}function Dr(e,n,a,o){ha=Ds=null,yf(n),xr=null,Ro=0;var u=n.return;try{if(PS(e,u,n,a,ye)){en=1,ec(e,_i(a,e.current)),ve=null;return}}catch(f){if(u!==null)throw ve=u,f;en=1,ec(e,_i(a,e.current)),ve=null;return}n.flags&32768?(Ee||o===1?e=!0:Ar||(ye&536870912)!==0?e=!1:(Qa=e=!0,(o===2||o===9||o===3||o===6)&&(o=si.current,o!==null&&o.tag===13&&(o.flags|=16384))),x0(n,e)):pc(n)}function pc(e){var n=e;do{if((n.flags&32768)!==0){x0(n,Qa);return}e=n.return;var a=FS(n.alternate,n,Ma);if(a!==null){ve=a;return}if(n=n.sibling,n!==null){ve=n;return}ve=n=e}while(n!==null);en===0&&(en=5)}function x0(e,n){do{var a=BS(e.alternate,e);if(a!==null){a.flags&=32767,ve=a;return}if(a=e.return,a!==null&&(a.flags|=32768,a.subtreeFlags=0,a.deletions=null),!n&&(e=e.sibling,e!==null)){ve=e;return}ve=e=a}while(e!==null);en=6,ve=null}function S0(e,n,a,o,u,f,x,R,G){e.cancelPendingCommit=null;do mc();while(gn!==0);if((Le&6)!==0)throw Error(s(327));if(n!==null){if(n===e.current)throw Error(s(177));if(f=n.lanes|n.childLanes,f|=Yu,Ri(e,a,f,x,R,G),e===Xe&&(ve=Xe=null,ye=0),Cr=n,ts=e,Ea=a,nh=f,ih=u,c0=o,(n.subtreeFlags&10256)!==0||(n.flags&10256)!==0?(e.callbackNode=null,e.callbackPriority=0,QS(mt,function(){return T0(),null})):(e.callbackNode=null,e.callbackPriority=0),o=(n.flags&13878)!==0,(n.subtreeFlags&13878)!==0||o){o=O.T,O.T=null,u=B.p,B.p=2,x=Le,Le|=4;try{HS(e,n,a)}finally{Le=x,B.p=u,O.T=o}}gn=1,y0(),M0(),E0()}}function y0(){if(gn===1){gn=0;var e=ts,n=Cr,a=(n.flags&13878)!==0;if((n.subtreeFlags&13878)!==0||a){a=O.T,O.T=null;var o=B.p;B.p=2;var u=Le;Le|=4;try{e0(n,e);var f=vh,x=om(e.containerInfo),R=f.focusedElem,G=f.selectionRange;if(x!==R&&R&&R.ownerDocument&&rm(R.ownerDocument.documentElement,R)){if(G!==null&&Vu(R)){var st=G.start,gt=G.end;if(gt===void 0&&(gt=st),"selectionStart"in R)R.selectionStart=st,R.selectionEnd=Math.min(gt,R.value.length);else{var St=R.ownerDocument||document,ct=St&&St.defaultView||window;if(ct.getSelection){var ht=ct.getSelection(),Vt=R.textContent.length,$t=Math.min(G.start,Vt),Ve=G.end===void 0?$t:Math.min(G.end,Vt);!ht.extend&&$t>Ve&&(x=Ve,Ve=$t,$t=x);var tt=sm(R,$t),X=sm(R,Ve);if(tt&&X&&(ht.rangeCount!==1||ht.anchorNode!==tt.node||ht.anchorOffset!==tt.offset||ht.focusNode!==X.node||ht.focusOffset!==X.offset)){var it=St.createRange();it.setStart(tt.node,tt.offset),ht.removeAllRanges(),$t>Ve?(ht.addRange(it),ht.extend(X.node,X.offset)):(it.setEnd(X.node,X.offset),ht.addRange(it))}}}}for(St=[],ht=R;ht=ht.parentNode;)ht.nodeType===1&&St.push({element:ht,left:ht.scrollLeft,top:ht.scrollTop});for(typeof R.focus=="function"&&R.focus(),R=0;R<St.length;R++){var xt=St[R];xt.element.scrollLeft=xt.left,xt.element.scrollTop=xt.top}}Rc=!!_h,vh=_h=null}finally{Le=u,B.p=o,O.T=a}}e.current=n,gn=2}}function M0(){if(gn===2){gn=0;var e=ts,n=Cr,a=(n.flags&8772)!==0;if((n.subtreeFlags&8772)!==0||a){a=O.T,O.T=null;var o=B.p;B.p=2;var u=Le;Le|=4;try{Kg(e,n.alternate,n)}finally{Le=u,B.p=o,O.T=a}}gn=3}}function E0(){if(gn===4||gn===3){gn=0,z();var e=ts,n=Cr,a=Ea,o=c0;(n.subtreeFlags&10256)!==0||(n.flags&10256)!==0?gn=5:(gn=0,Cr=ts=null,b0(e,e.pendingLanes));var u=e.pendingLanes;if(u===0&&($a=null),nr(a),n=n.stateNode,Et&&typeof Et.onCommitFiberRoot=="function")try{Et.onCommitFiberRoot(Tt,n,void 0,(n.current.flags&128)===128)}catch{}if(o!==null){n=O.T,u=B.p,B.p=2,O.T=null;try{for(var f=e.onRecoverableError,x=0;x<o.length;x++){var R=o[x];f(R.value,{componentStack:R.stack})}}finally{O.T=n,B.p=u}}(Ea&3)!==0&&mc(),ji(e),u=e.pendingLanes,(a&261930)!==0&&(u&42)!==0?e===ah?Xo++:(Xo=0,ah=e):Xo=0,Wo(0)}}function b0(e,n){(e.pooledCacheLanes&=n)===0&&(n=e.pooledCache,n!=null&&(e.pooledCache=null,To(n)))}function mc(){return y0(),M0(),E0(),T0()}function T0(){if(gn!==5)return!1;var e=ts,n=nh;nh=0;var a=nr(Ea),o=O.T,u=B.p;try{B.p=32>a?32:a,O.T=null,a=ih,ih=null;var f=ts,x=Ea;if(gn=0,Cr=ts=null,Ea=0,(Le&6)!==0)throw Error(s(331));var R=Le;if(Le|=4,r0(f.current),i0(f,f.current,x,a),Le=R,Wo(0,!1),Et&&typeof Et.onPostCommitFiberRoot=="function")try{Et.onPostCommitFiberRoot(Tt,f)}catch{}return!0}finally{B.p=u,O.T=o,b0(e,n)}}function A0(e,n,a){n=_i(a,n),n=zf(e.stateNode,n,2),e=Ya(e,n,2),e!==null&&(In(e,2),ji(e))}function Ie(e,n,a){if(e.tag===3)A0(e,e,a);else for(;n!==null;){if(n.tag===3){A0(n,e,a);break}else if(n.tag===1){var o=n.stateNode;if(typeof n.type.getDerivedStateFromError=="function"||typeof o.componentDidCatch=="function"&&($a===null||!$a.has(o))){e=_i(a,e),a=Rg(2),o=Ya(n,a,2),o!==null&&(Cg(a,o,n,e),In(o,2),ji(o));break}}n=n.return}}function oh(e,n,a){var o=e.pingCache;if(o===null){o=e.pingCache=new kS;var u=new Set;o.set(n,u)}else u=o.get(n),u===void 0&&(u=new Set,o.set(n,u));u.has(a)||($f=!0,u.add(a),e=jS.bind(null,e,n,a),n.then(e,e))}function jS(e,n,a){var o=e.pingCache;o!==null&&o.delete(n),e.pingedLanes|=e.suspendedLanes&a,e.warmLanes&=~a,Xe===e&&(ye&a)===a&&(en===4||en===3&&(ye&62914560)===ye&&300>b()-cc?(Le&2)===0&&wr(e,0):th|=a,Rr===ye&&(Rr=0)),ji(e)}function R0(e,n){n===0&&(n=Pe()),e=Rs(e,n),e!==null&&(In(e,n),ji(e))}function ZS(e){var n=e.memoizedState,a=0;n!==null&&(a=n.retryLane),R0(e,a)}function KS(e,n){var a=0;switch(e.tag){case 31:case 13:var o=e.stateNode,u=e.memoizedState;u!==null&&(a=u.retryLane);break;case 19:o=e.stateNode;break;case 22:o=e.stateNode._retryCache;break;default:throw Error(s(314))}o!==null&&o.delete(n),R0(e,a)}function QS(e,n){return be(e,n)}var gc=null,Ur=null,lh=!1,_c=!1,ch=!1,ns=0;function ji(e){e!==Ur&&e.next===null&&(Ur===null?gc=Ur=e:Ur=Ur.next=e),_c=!0,lh||(lh=!0,$S())}function Wo(e,n){if(!ch&&_c){ch=!0;do for(var a=!1,o=gc;o!==null;){if(e!==0){var u=o.pendingLanes;if(u===0)var f=0;else{var x=o.suspendedLanes,R=o.pingedLanes;f=(1<<31-Ot(42|e)+1)-1,f&=u&~(x&~R),f=f&201326741?f&201326741|1:f?f|2:0}f!==0&&(a=!0,U0(o,f))}else f=ye,f=pt(o,o===Xe?f:0,o.cancelPendingCommit!==null||o.timeoutHandle!==-1),(f&3)===0||Ht(o,f)||(a=!0,U0(o,f));o=o.next}while(a);ch=!1}}function JS(){C0()}function C0(){_c=lh=!1;var e=0;ns!==0&&cy()&&(e=ns);for(var n=b(),a=null,o=gc;o!==null;){var u=o.next,f=w0(o,n);f===0?(o.next=null,a===null?gc=u:a.next=u,u===null&&(Ur=a)):(a=o,(e!==0||(f&3)!==0)&&(_c=!0)),o=u}gn!==0&&gn!==5||Wo(e),ns!==0&&(ns=0)}function w0(e,n){for(var a=e.suspendedLanes,o=e.pingedLanes,u=e.expirationTimes,f=e.pendingLanes&-62914561;0<f;){var x=31-Ot(f),R=1<<x,G=u[x];G===-1?((R&a)===0||(R&o)!==0)&&(u[x]=ie(R,n)):G<=n&&(e.expiredLanes|=R),f&=~R}if(n=Xe,a=ye,a=pt(e,e===n?a:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),o=e.callbackNode,a===0||e===n&&(ze===2||ze===9)||e.cancelPendingCommit!==null)return o!==null&&o!==null&&Ne(o),e.callbackNode=null,e.callbackPriority=0;if((a&3)===0||Ht(e,a)){if(n=a&-a,n===e.callbackPriority)return n;switch(o!==null&&Ne(o),nr(a)){case 2:case 8:a=Mt;break;case 32:a=mt;break;case 268435456:a=wt;break;default:a=mt}return o=D0.bind(null,e),a=be(a,o),e.callbackPriority=n,e.callbackNode=a,n}return o!==null&&o!==null&&Ne(o),e.callbackPriority=2,e.callbackNode=null,2}function D0(e,n){if(gn!==0&&gn!==5)return e.callbackNode=null,e.callbackPriority=0,null;var a=e.callbackNode;if(mc()&&e.callbackNode!==a)return null;var o=ye;return o=pt(e,e===Xe?o:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),o===0?null:(f0(e,o,n),w0(e,b()),e.callbackNode!=null&&e.callbackNode===a?D0.bind(null,e):null)}function U0(e,n){if(mc())return null;f0(e,n,!0)}function $S(){fy(function(){(Le&6)!==0?be(_t,JS):C0()})}function uh(){if(ns===0){var e=gr;e===0&&(e=Ct,Ct<<=1,(Ct&261888)===0&&(Ct=256)),ns=e}return ns}function L0(e){return e==null||typeof e=="symbol"||typeof e=="boolean"?null:typeof e=="function"?e:Tl(""+e)}function N0(e,n){var a=n.ownerDocument.createElement("input");return a.name=n.name,a.value=n.value,e.id&&a.setAttribute("form",e.id),n.parentNode.insertBefore(a,n),e=new FormData(e),a.parentNode.removeChild(a),e}function ty(e,n,a,o,u){if(n==="submit"&&a&&a.stateNode===u){var f=L0((u[pn]||null).action),x=o.submitter;x&&(n=(n=x[pn]||null)?L0(n.formAction):x.getAttribute("formAction"),n!==null&&(f=n,x=null));var R=new wl("action","action",null,o,u);e.push({event:R,listeners:[{instance:null,listener:function(){if(o.defaultPrevented){if(ns!==0){var G=x?N0(u,x):new FormData(u);Df(a,{pending:!0,data:G,method:u.method,action:f},null,G)}}else typeof f=="function"&&(R.preventDefault(),G=x?N0(u,x):new FormData(u),Df(a,{pending:!0,data:G,method:u.method,action:f},f,G))},currentTarget:u}]})}}for(var fh=0;fh<qu.length;fh++){var hh=qu[fh],ey=hh.toLowerCase(),ny=hh[0].toUpperCase()+hh.slice(1);Ui(ey,"on"+ny)}Ui(um,"onAnimationEnd"),Ui(fm,"onAnimationIteration"),Ui(hm,"onAnimationStart"),Ui("dblclick","onDoubleClick"),Ui("focusin","onFocus"),Ui("focusout","onBlur"),Ui(vS,"onTransitionRun"),Ui(xS,"onTransitionStart"),Ui(SS,"onTransitionCancel"),Ui(dm,"onTransitionEnd"),Dt("onMouseEnter",["mouseout","mouseover"]),Dt("onMouseLeave",["mouseout","mouseover"]),Dt("onPointerEnter",["pointerout","pointerover"]),Dt("onPointerLeave",["pointerout","pointerover"]),nt("onChange","change click focusin focusout input keydown keyup selectionchange".split(" ")),nt("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" ")),nt("onBeforeInput",["compositionend","keypress","textInput","paste"]),nt("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" ")),nt("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" ")),nt("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var qo="abort canplay canplaythrough durationchange emptied encrypted ended error loadeddata loadedmetadata loadstart pause play playing progress ratechange resize seeked seeking stalled suspend timeupdate volumechange waiting".split(" "),iy=new Set("beforetoggle cancel close invalid load scroll scrollend toggle".split(" ").concat(qo));function O0(e,n){n=(n&4)!==0;for(var a=0;a<e.length;a++){var o=e[a],u=o.event;o=o.listeners;t:{var f=void 0;if(n)for(var x=o.length-1;0<=x;x--){var R=o[x],G=R.instance,st=R.currentTarget;if(R=R.listener,G!==f&&u.isPropagationStopped())break t;f=R,u.currentTarget=st;try{f(u)}catch(gt){Ll(gt)}u.currentTarget=null,f=G}else for(x=0;x<o.length;x++){if(R=o[x],G=R.instance,st=R.currentTarget,R=R.listener,G!==f&&u.isPropagationStopped())break t;f=R,u.currentTarget=st;try{f(u)}catch(gt){Ll(gt)}u.currentTarget=null,f=G}}}}function xe(e,n){var a=n[Ia];a===void 0&&(a=n[Ia]=new Set);var o=e+"__bubble";a.has(o)||(P0(n,e,2,!1),a.add(o))}function dh(e,n,a){var o=0;n&&(o|=4),P0(a,e,o,n)}var vc="_reactListening"+Math.random().toString(36).slice(2);function ph(e){if(!e[vc]){e[vc]=!0,ft.forEach(function(a){a!=="selectionchange"&&(iy.has(a)||dh(a,!1,e),dh(a,!0,e))});var n=e.nodeType===9?e:e.ownerDocument;n===null||n[vc]||(n[vc]=!0,dh("selectionchange",!1,n))}}function P0(e,n,a,o){switch(u_(n)){case 2:var u=Uy;break;case 8:u=Ly;break;default:u=wh}a=u.bind(null,n,a,e),u=void 0,!Nu||n!=="touchstart"&&n!=="touchmove"&&n!=="wheel"||(u=!0),o?u!==void 0?e.addEventListener(n,a,{capture:!0,passive:u}):e.addEventListener(n,a,!0):u!==void 0?e.addEventListener(n,a,{passive:u}):e.addEventListener(n,a,!1)}function mh(e,n,a,o,u){var f=o;if((n&1)===0&&(n&2)===0&&o!==null)t:for(;;){if(o===null)return;var x=o.tag;if(x===3||x===4){var R=o.stateNode.containerInfo;if(R===u)break;if(x===4)for(x=o.return;x!==null;){var G=x.tag;if((G===3||G===4)&&x.stateNode.containerInfo===u)return;x=x.return}for(;R!==null;){if(x=Fa(R),x===null)return;if(G=x.tag,G===5||G===6||G===26||G===27){o=f=x;continue t}R=R.parentNode}}o=o.return}Hp(function(){var st=f,gt=Uu(a),St=[];t:{var ct=pm.get(e);if(ct!==void 0){var ht=wl,Vt=e;switch(e){case"keypress":if(Rl(a)===0)break t;case"keydown":case"keyup":ht=Kx;break;case"focusin":Vt="focus",ht=Iu;break;case"focusout":Vt="blur",ht=Iu;break;case"beforeblur":case"afterblur":ht=Iu;break;case"click":if(a.button===2)break t;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":ht=kp;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":ht=Fx;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":ht=$x;break;case um:case fm:case hm:ht=Gx;break;case dm:ht=eS;break;case"scroll":case"scrollend":ht=zx;break;case"wheel":ht=iS;break;case"copy":case"cut":case"paste":ht=kx;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":ht=Wp;break;case"toggle":case"beforetoggle":ht=sS}var $t=(n&4)!==0,Ve=!$t&&(e==="scroll"||e==="scrollend"),tt=$t?ct!==null?ct+"Capture":null:ct;$t=[];for(var X=st,it;X!==null;){var xt=X;if(it=xt.stateNode,xt=xt.tag,xt!==5&&xt!==26&&xt!==27||it===null||tt===null||(xt=po(X,tt),xt!=null&&$t.push(Yo(X,xt,it))),Ve)break;X=X.return}0<$t.length&&(ct=new ht(ct,Vt,null,a,gt),St.push({event:ct,listeners:$t}))}}if((n&7)===0){t:{if(ct=e==="mouseover"||e==="pointerover",ht=e==="mouseout"||e==="pointerout",ct&&a!==Du&&(Vt=a.relatedTarget||a.fromElement)&&(Fa(Vt)||Vt[ra]))break t;if((ht||ct)&&(ct=gt.window===gt?gt:(ct=gt.ownerDocument)?ct.defaultView||ct.parentWindow:window,ht?(Vt=a.relatedTarget||a.toElement,ht=st,Vt=Vt?Fa(Vt):null,Vt!==null&&(Ve=c(Vt),$t=Vt.tag,Vt!==Ve||$t!==5&&$t!==27&&$t!==6)&&(Vt=null)):(ht=null,Vt=st),ht!==Vt)){if($t=kp,xt="onMouseLeave",tt="onMouseEnter",X="mouse",(e==="pointerout"||e==="pointerover")&&($t=Wp,xt="onPointerLeave",tt="onPointerEnter",X="pointer"),Ve=ht==null?ct:Es(ht),it=Vt==null?ct:Es(Vt),ct=new $t(xt,X+"leave",ht,a,gt),ct.target=Ve,ct.relatedTarget=it,xt=null,Fa(gt)===st&&($t=new $t(tt,X+"enter",Vt,a,gt),$t.target=it,$t.relatedTarget=Ve,xt=$t),Ve=xt,ht&&Vt)e:{for($t=ay,tt=ht,X=Vt,it=0,xt=tt;xt;xt=$t(xt))it++;xt=0;for(var Qt=X;Qt;Qt=$t(Qt))xt++;for(;0<it-xt;)tt=$t(tt),it--;for(;0<xt-it;)X=$t(X),xt--;for(;it--;){if(tt===X||X!==null&&tt===X.alternate){$t=tt;break e}tt=$t(tt),X=$t(X)}$t=null}else $t=null;ht!==null&&z0(St,ct,ht,$t,!1),Vt!==null&&Ve!==null&&z0(St,Ve,Vt,$t,!0)}}t:{if(ct=st?Es(st):window,ht=ct.nodeName&&ct.nodeName.toLowerCase(),ht==="select"||ht==="input"&&ct.type==="file")var we=$p;else if(Qp(ct))if(tm)we=mS;else{we=dS;var jt=hS}else ht=ct.nodeName,!ht||ht.toLowerCase()!=="input"||ct.type!=="checkbox"&&ct.type!=="radio"?st&&ar(st.elementType)&&(we=$p):we=pS;if(we&&(we=we(e,st))){Jp(St,we,a,gt);break t}jt&&jt(e,ct,st),e==="focusout"&&st&&ct.type==="number"&&st.memoizedProps.value!=null&&wi(ct,"number",ct.value)}switch(jt=st?Es(st):window,e){case"focusin":(Qp(jt)||jt.contentEditable==="true")&&(lr=jt,ku=st,Mo=null);break;case"focusout":Mo=ku=lr=null;break;case"mousedown":Xu=!0;break;case"contextmenu":case"mouseup":case"dragend":Xu=!1,lm(St,a,gt);break;case"selectionchange":if(_S)break;case"keydown":case"keyup":lm(St,a,gt)}var de;if(Bu)t:{switch(e){case"compositionstart":var Me="onCompositionStart";break t;case"compositionend":Me="onCompositionEnd";break t;case"compositionupdate":Me="onCompositionUpdate";break t}Me=void 0}else or?Zp(e,a)&&(Me="onCompositionEnd"):e==="keydown"&&a.keyCode===229&&(Me="onCompositionStart");Me&&(qp&&a.locale!=="ko"&&(or||Me!=="onCompositionStart"?Me==="onCompositionEnd"&&or&&(de=Gp()):(Ha=gt,Ou="value"in Ha?Ha.value:Ha.textContent,or=!0)),jt=xc(st,Me),0<jt.length&&(Me=new Xp(Me,e,null,a,gt),St.push({event:Me,listeners:jt}),de?Me.data=de:(de=Kp(a),de!==null&&(Me.data=de)))),(de=oS?lS(e,a):cS(e,a))&&(Me=xc(st,"onBeforeInput"),0<Me.length&&(jt=new Xp("onBeforeInput","beforeinput",null,a,gt),St.push({event:jt,listeners:Me}),jt.data=de)),ty(St,e,st,a,gt)}O0(St,n)})}function Yo(e,n,a){return{instance:e,listener:n,currentTarget:a}}function xc(e,n){for(var a=n+"Capture",o=[];e!==null;){var u=e,f=u.stateNode;if(u=u.tag,u!==5&&u!==26&&u!==27||f===null||(u=po(e,a),u!=null&&o.unshift(Yo(e,u,f)),u=po(e,n),u!=null&&o.push(Yo(e,u,f))),e.tag===3)return o;e=e.return}return[]}function ay(e){if(e===null)return null;do e=e.return;while(e&&e.tag!==5&&e.tag!==27);return e||null}function z0(e,n,a,o,u){for(var f=n._reactName,x=[];a!==null&&a!==o;){var R=a,G=R.alternate,st=R.stateNode;if(R=R.tag,G!==null&&G===o)break;R!==5&&R!==26&&R!==27||st===null||(G=st,u?(st=po(a,f),st!=null&&x.unshift(Yo(a,st,G))):u||(st=po(a,f),st!=null&&x.push(Yo(a,st,G)))),a=a.return}x.length!==0&&e.push({event:n,listeners:x})}var sy=/\r\n?/g,ry=/\u0000|\uFFFD/g;function I0(e){return(typeof e=="string"?e:""+e).replace(sy,`
9
+ `).replace(ry,"")}function F0(e,n){return n=I0(n),I0(e)===n}function Ge(e,n,a,o,u,f){switch(a){case"children":typeof o=="string"?n==="body"||n==="textarea"&&o===""||Hn(e,o):(typeof o=="number"||typeof o=="bigint")&&n!=="body"&&Hn(e,""+o);break;case"className":re(e,"class",o);break;case"tabIndex":re(e,"tabindex",o);break;case"dir":case"role":case"viewBox":case"width":case"height":re(e,a,o);break;case"style":oa(e,o,f);break;case"data":if(n!=="object"){re(e,"data",o);break}case"src":case"href":if(o===""&&(n!=="a"||a!=="href")){e.removeAttribute(a);break}if(o==null||typeof o=="function"||typeof o=="symbol"||typeof o=="boolean"){e.removeAttribute(a);break}o=Tl(""+o),e.setAttribute(a,o);break;case"action":case"formAction":if(typeof o=="function"){e.setAttribute(a,"javascript:throw new Error('A React form was unexpectedly submitted. If you called form.submit() manually, consider using form.requestSubmit() instead. If you\\'re trying to use event.stopPropagation() in a submit event handler, consider also calling event.preventDefault().')");break}else typeof f=="function"&&(a==="formAction"?(n!=="input"&&Ge(e,n,"name",u.name,u,null),Ge(e,n,"formEncType",u.formEncType,u,null),Ge(e,n,"formMethod",u.formMethod,u,null),Ge(e,n,"formTarget",u.formTarget,u,null)):(Ge(e,n,"encType",u.encType,u,null),Ge(e,n,"method",u.method,u,null),Ge(e,n,"target",u.target,u,null)));if(o==null||typeof o=="symbol"||typeof o=="boolean"){e.removeAttribute(a);break}o=Tl(""+o),e.setAttribute(a,o);break;case"onClick":o!=null&&(e.onclick=la);break;case"onScroll":o!=null&&xe("scroll",e);break;case"onScrollEnd":o!=null&&xe("scrollend",e);break;case"dangerouslySetInnerHTML":if(o!=null){if(typeof o!="object"||!("__html"in o))throw Error(s(61));if(a=o.__html,a!=null){if(u.children!=null)throw Error(s(60));e.innerHTML=a}}break;case"multiple":e.multiple=o&&typeof o!="function"&&typeof o!="symbol";break;case"muted":e.muted=o&&typeof o!="function"&&typeof o!="symbol";break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"defaultValue":case"defaultChecked":case"innerHTML":case"ref":break;case"autoFocus":break;case"xlinkHref":if(o==null||typeof o=="function"||typeof o=="boolean"||typeof o=="symbol"){e.removeAttribute("xlink:href");break}a=Tl(""+o),e.setAttributeNS("http://www.w3.org/1999/xlink","xlink:href",a);break;case"contentEditable":case"spellCheck":case"draggable":case"value":case"autoReverse":case"externalResourcesRequired":case"focusable":case"preserveAlpha":o!=null&&typeof o!="function"&&typeof o!="symbol"?e.setAttribute(a,""+o):e.removeAttribute(a);break;case"inert":case"allowFullScreen":case"async":case"autoPlay":case"controls":case"default":case"defer":case"disabled":case"disablePictureInPicture":case"disableRemotePlayback":case"formNoValidate":case"hidden":case"loop":case"noModule":case"noValidate":case"open":case"playsInline":case"readOnly":case"required":case"reversed":case"scoped":case"seamless":case"itemScope":o&&typeof o!="function"&&typeof o!="symbol"?e.setAttribute(a,""):e.removeAttribute(a);break;case"capture":case"download":o===!0?e.setAttribute(a,""):o!==!1&&o!=null&&typeof o!="function"&&typeof o!="symbol"?e.setAttribute(a,o):e.removeAttribute(a);break;case"cols":case"rows":case"size":case"span":o!=null&&typeof o!="function"&&typeof o!="symbol"&&!isNaN(o)&&1<=o?e.setAttribute(a,o):e.removeAttribute(a);break;case"rowSpan":case"start":o==null||typeof o=="function"||typeof o=="symbol"||isNaN(o)?e.removeAttribute(a):e.setAttribute(a,o);break;case"popover":xe("beforetoggle",e),xe("toggle",e),ne(e,"popover",o);break;case"xlinkActuate":Gt(e,"http://www.w3.org/1999/xlink","xlink:actuate",o);break;case"xlinkArcrole":Gt(e,"http://www.w3.org/1999/xlink","xlink:arcrole",o);break;case"xlinkRole":Gt(e,"http://www.w3.org/1999/xlink","xlink:role",o);break;case"xlinkShow":Gt(e,"http://www.w3.org/1999/xlink","xlink:show",o);break;case"xlinkTitle":Gt(e,"http://www.w3.org/1999/xlink","xlink:title",o);break;case"xlinkType":Gt(e,"http://www.w3.org/1999/xlink","xlink:type",o);break;case"xmlBase":Gt(e,"http://www.w3.org/XML/1998/namespace","xml:base",o);break;case"xmlLang":Gt(e,"http://www.w3.org/XML/1998/namespace","xml:lang",o);break;case"xmlSpace":Gt(e,"http://www.w3.org/XML/1998/namespace","xml:space",o);break;case"is":ne(e,"is",o);break;case"innerText":case"textContent":break;default:(!(2<a.length)||a[0]!=="o"&&a[0]!=="O"||a[1]!=="n"&&a[1]!=="N")&&(a=Ox.get(a)||a,ne(e,a,o))}}function gh(e,n,a,o,u,f){switch(a){case"style":oa(e,o,f);break;case"dangerouslySetInnerHTML":if(o!=null){if(typeof o!="object"||!("__html"in o))throw Error(s(61));if(a=o.__html,a!=null){if(u.children!=null)throw Error(s(60));e.innerHTML=a}}break;case"children":typeof o=="string"?Hn(e,o):(typeof o=="number"||typeof o=="bigint")&&Hn(e,""+o);break;case"onScroll":o!=null&&xe("scroll",e);break;case"onScrollEnd":o!=null&&xe("scrollend",e);break;case"onClick":o!=null&&(e.onclick=la);break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"innerHTML":case"ref":break;case"innerText":case"textContent":break;default:if(!ot.hasOwnProperty(a))t:{if(a[0]==="o"&&a[1]==="n"&&(u=a.endsWith("Capture"),n=a.slice(2,u?a.length-7:void 0),f=e[pn]||null,f=f!=null?f[a]:null,typeof f=="function"&&e.removeEventListener(n,f,u),typeof o=="function")){typeof f!="function"&&f!==null&&(a in e?e[a]=null:e.hasAttribute(a)&&e.removeAttribute(a)),e.addEventListener(n,o,u);break t}a in e?e[a]=o:o===!0?e.setAttribute(a,""):ne(e,a,o)}}}function An(e,n,a){switch(n){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"img":xe("error",e),xe("load",e);var o=!1,u=!1,f;for(f in a)if(a.hasOwnProperty(f)){var x=a[f];if(x!=null)switch(f){case"src":o=!0;break;case"srcSet":u=!0;break;case"children":case"dangerouslySetInnerHTML":throw Error(s(137,n));default:Ge(e,n,f,x,a,null)}}u&&Ge(e,n,"srcSet",a.srcSet,a,null),o&&Ge(e,n,"src",a.src,a,null);return;case"input":xe("invalid",e);var R=f=x=u=null,G=null,st=null;for(o in a)if(a.hasOwnProperty(o)){var gt=a[o];if(gt!=null)switch(o){case"name":u=gt;break;case"type":x=gt;break;case"checked":G=gt;break;case"defaultChecked":st=gt;break;case"value":f=gt;break;case"defaultValue":R=gt;break;case"children":case"dangerouslySetInnerHTML":if(gt!=null)throw Error(s(137,n));break;default:Ge(e,n,o,gt,a,null)}}ei(e,f,R,G,st,x,u,!1);return;case"select":xe("invalid",e),o=x=f=null;for(u in a)if(a.hasOwnProperty(u)&&(R=a[u],R!=null))switch(u){case"value":f=R;break;case"defaultValue":x=R;break;case"multiple":o=R;default:Ge(e,n,u,R,a,null)}n=f,a=x,e.multiple=!!o,n!=null?ni(e,!!o,n,!1):a!=null&&ni(e,!!o,a,!0);return;case"textarea":xe("invalid",e),f=u=o=null;for(x in a)if(a.hasOwnProperty(x)&&(R=a[x],R!=null))switch(x){case"value":o=R;break;case"defaultValue":u=R;break;case"children":f=R;break;case"dangerouslySetInnerHTML":if(R!=null)throw Error(s(91));break;default:Ge(e,n,x,R,a,null)}on(e,o,u,f);return;case"option":for(G in a)a.hasOwnProperty(G)&&(o=a[G],o!=null)&&(G==="selected"?e.selected=o&&typeof o!="function"&&typeof o!="symbol":Ge(e,n,G,o,a,null));return;case"dialog":xe("beforetoggle",e),xe("toggle",e),xe("cancel",e),xe("close",e);break;case"iframe":case"object":xe("load",e);break;case"video":case"audio":for(o=0;o<qo.length;o++)xe(qo[o],e);break;case"image":xe("error",e),xe("load",e);break;case"details":xe("toggle",e);break;case"embed":case"source":case"link":xe("error",e),xe("load",e);case"area":case"base":case"br":case"col":case"hr":case"keygen":case"meta":case"param":case"track":case"wbr":case"menuitem":for(st in a)if(a.hasOwnProperty(st)&&(o=a[st],o!=null))switch(st){case"children":case"dangerouslySetInnerHTML":throw Error(s(137,n));default:Ge(e,n,st,o,a,null)}return;default:if(ar(n)){for(gt in a)a.hasOwnProperty(gt)&&(o=a[gt],o!==void 0&&gh(e,n,gt,o,a,void 0));return}}for(R in a)a.hasOwnProperty(R)&&(o=a[R],o!=null&&Ge(e,n,R,o,a,null))}function oy(e,n,a,o){switch(n){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"input":var u=null,f=null,x=null,R=null,G=null,st=null,gt=null;for(ht in a){var St=a[ht];if(a.hasOwnProperty(ht)&&St!=null)switch(ht){case"checked":break;case"value":break;case"defaultValue":G=St;default:o.hasOwnProperty(ht)||Ge(e,n,ht,null,o,St)}}for(var ct in o){var ht=o[ct];if(St=a[ct],o.hasOwnProperty(ct)&&(ht!=null||St!=null))switch(ct){case"type":f=ht;break;case"name":u=ht;break;case"checked":st=ht;break;case"defaultChecked":gt=ht;break;case"value":x=ht;break;case"defaultValue":R=ht;break;case"children":case"dangerouslySetInnerHTML":if(ht!=null)throw Error(s(137,n));break;default:ht!==St&&Ge(e,n,ct,ht,o,St)}}Bn(e,x,R,G,st,gt,f,u);return;case"select":ht=x=R=ct=null;for(f in a)if(G=a[f],a.hasOwnProperty(f)&&G!=null)switch(f){case"value":break;case"multiple":ht=G;default:o.hasOwnProperty(f)||Ge(e,n,f,null,o,G)}for(u in o)if(f=o[u],G=a[u],o.hasOwnProperty(u)&&(f!=null||G!=null))switch(u){case"value":ct=f;break;case"defaultValue":R=f;break;case"multiple":x=f;default:f!==G&&Ge(e,n,u,f,o,G)}n=R,a=x,o=ht,ct!=null?ni(e,!!a,ct,!1):!!o!=!!a&&(n!=null?ni(e,!!a,n,!0):ni(e,!!a,a?[]:"",!1));return;case"textarea":ht=ct=null;for(R in a)if(u=a[R],a.hasOwnProperty(R)&&u!=null&&!o.hasOwnProperty(R))switch(R){case"value":break;case"children":break;default:Ge(e,n,R,null,o,u)}for(x in o)if(u=o[x],f=a[x],o.hasOwnProperty(x)&&(u!=null||f!=null))switch(x){case"value":ct=u;break;case"defaultValue":ht=u;break;case"children":break;case"dangerouslySetInnerHTML":if(u!=null)throw Error(s(91));break;default:u!==f&&Ge(e,n,x,u,o,f)}Oe(e,ct,ht);return;case"option":for(var Vt in a)ct=a[Vt],a.hasOwnProperty(Vt)&&ct!=null&&!o.hasOwnProperty(Vt)&&(Vt==="selected"?e.selected=!1:Ge(e,n,Vt,null,o,ct));for(G in o)ct=o[G],ht=a[G],o.hasOwnProperty(G)&&ct!==ht&&(ct!=null||ht!=null)&&(G==="selected"?e.selected=ct&&typeof ct!="function"&&typeof ct!="symbol":Ge(e,n,G,ct,o,ht));return;case"img":case"link":case"area":case"base":case"br":case"col":case"embed":case"hr":case"keygen":case"meta":case"param":case"source":case"track":case"wbr":case"menuitem":for(var $t in a)ct=a[$t],a.hasOwnProperty($t)&&ct!=null&&!o.hasOwnProperty($t)&&Ge(e,n,$t,null,o,ct);for(st in o)if(ct=o[st],ht=a[st],o.hasOwnProperty(st)&&ct!==ht&&(ct!=null||ht!=null))switch(st){case"children":case"dangerouslySetInnerHTML":if(ct!=null)throw Error(s(137,n));break;default:Ge(e,n,st,ct,o,ht)}return;default:if(ar(n)){for(var Ve in a)ct=a[Ve],a.hasOwnProperty(Ve)&&ct!==void 0&&!o.hasOwnProperty(Ve)&&gh(e,n,Ve,void 0,o,ct);for(gt in o)ct=o[gt],ht=a[gt],!o.hasOwnProperty(gt)||ct===ht||ct===void 0&&ht===void 0||gh(e,n,gt,ct,o,ht);return}}for(var tt in a)ct=a[tt],a.hasOwnProperty(tt)&&ct!=null&&!o.hasOwnProperty(tt)&&Ge(e,n,tt,null,o,ct);for(St in o)ct=o[St],ht=a[St],!o.hasOwnProperty(St)||ct===ht||ct==null&&ht==null||Ge(e,n,St,ct,o,ht)}function B0(e){switch(e){case"css":case"script":case"font":case"img":case"image":case"input":case"link":return!0;default:return!1}}function ly(){if(typeof performance.getEntriesByType=="function"){for(var e=0,n=0,a=performance.getEntriesByType("resource"),o=0;o<a.length;o++){var u=a[o],f=u.transferSize,x=u.initiatorType,R=u.duration;if(f&&R&&B0(x)){for(x=0,R=u.responseEnd,o+=1;o<a.length;o++){var G=a[o],st=G.startTime;if(st>R)break;var gt=G.transferSize,St=G.initiatorType;gt&&B0(St)&&(G=G.responseEnd,x+=gt*(G<R?1:(R-st)/(G-st)))}if(--o,n+=8*(f+x)/(u.duration/1e3),e++,10<e)break}}if(0<e)return n/e/1e6}return navigator.connection&&(e=navigator.connection.downlink,typeof e=="number")?e:5}var _h=null,vh=null;function Sc(e){return e.nodeType===9?e:e.ownerDocument}function H0(e){switch(e){case"http://www.w3.org/2000/svg":return 1;case"http://www.w3.org/1998/Math/MathML":return 2;default:return 0}}function G0(e,n){if(e===0)switch(n){case"svg":return 1;case"math":return 2;default:return 0}return e===1&&n==="foreignObject"?0:e}function xh(e,n){return e==="textarea"||e==="noscript"||typeof n.children=="string"||typeof n.children=="number"||typeof n.children=="bigint"||typeof n.dangerouslySetInnerHTML=="object"&&n.dangerouslySetInnerHTML!==null&&n.dangerouslySetInnerHTML.__html!=null}var Sh=null;function cy(){var e=window.event;return e&&e.type==="popstate"?e===Sh?!1:(Sh=e,!0):(Sh=null,!1)}var V0=typeof setTimeout=="function"?setTimeout:void 0,uy=typeof clearTimeout=="function"?clearTimeout:void 0,k0=typeof Promise=="function"?Promise:void 0,fy=typeof queueMicrotask=="function"?queueMicrotask:typeof k0<"u"?function(e){return k0.resolve(null).then(e).catch(hy)}:V0;function hy(e){setTimeout(function(){throw e})}function is(e){return e==="head"}function X0(e,n){var a=n,o=0;do{var u=a.nextSibling;if(e.removeChild(a),u&&u.nodeType===8)if(a=u.data,a==="/$"||a==="/&"){if(o===0){e.removeChild(u),Pr(n);return}o--}else if(a==="$"||a==="$?"||a==="$~"||a==="$!"||a==="&")o++;else if(a==="html")jo(e.ownerDocument.documentElement);else if(a==="head"){a=e.ownerDocument.head,jo(a);for(var f=a.firstChild;f;){var x=f.nextSibling,R=f.nodeName;f[Ms]||R==="SCRIPT"||R==="STYLE"||R==="LINK"&&f.rel.toLowerCase()==="stylesheet"||a.removeChild(f),f=x}}else a==="body"&&jo(e.ownerDocument.body);a=u}while(a);Pr(n)}function W0(e,n){var a=e;e=0;do{var o=a.nextSibling;if(a.nodeType===1?n?(a._stashedDisplay=a.style.display,a.style.display="none"):(a.style.display=a._stashedDisplay||"",a.getAttribute("style")===""&&a.removeAttribute("style")):a.nodeType===3&&(n?(a._stashedText=a.nodeValue,a.nodeValue=""):a.nodeValue=a._stashedText||""),o&&o.nodeType===8)if(a=o.data,a==="/$"){if(e===0)break;e--}else a!=="$"&&a!=="$?"&&a!=="$~"&&a!=="$!"||e++;a=o}while(a)}function yh(e){var n=e.firstChild;for(n&&n.nodeType===10&&(n=n.nextSibling);n;){var a=n;switch(n=n.nextSibling,a.nodeName){case"HTML":case"HEAD":case"BODY":yh(a),ho(a);continue;case"SCRIPT":case"STYLE":continue;case"LINK":if(a.rel.toLowerCase()==="stylesheet")continue}e.removeChild(a)}}function dy(e,n,a,o){for(;e.nodeType===1;){var u=a;if(e.nodeName.toLowerCase()!==n.toLowerCase()){if(!o&&(e.nodeName!=="INPUT"||e.type!=="hidden"))break}else if(o){if(!e[Ms])switch(n){case"meta":if(!e.hasAttribute("itemprop"))break;return e;case"link":if(f=e.getAttribute("rel"),f==="stylesheet"&&e.hasAttribute("data-precedence"))break;if(f!==u.rel||e.getAttribute("href")!==(u.href==null||u.href===""?null:u.href)||e.getAttribute("crossorigin")!==(u.crossOrigin==null?null:u.crossOrigin)||e.getAttribute("title")!==(u.title==null?null:u.title))break;return e;case"style":if(e.hasAttribute("data-precedence"))break;return e;case"script":if(f=e.getAttribute("src"),(f!==(u.src==null?null:u.src)||e.getAttribute("type")!==(u.type==null?null:u.type)||e.getAttribute("crossorigin")!==(u.crossOrigin==null?null:u.crossOrigin))&&f&&e.hasAttribute("async")&&!e.hasAttribute("itemprop"))break;return e;default:return e}}else if(n==="input"&&e.type==="hidden"){var f=u.name==null?null:""+u.name;if(u.type==="hidden"&&e.getAttribute("name")===f)return e}else return e;if(e=Mi(e.nextSibling),e===null)break}return null}function py(e,n,a){if(n==="")return null;for(;e.nodeType!==3;)if((e.nodeType!==1||e.nodeName!=="INPUT"||e.type!=="hidden")&&!a||(e=Mi(e.nextSibling),e===null))return null;return e}function q0(e,n){for(;e.nodeType!==8;)if((e.nodeType!==1||e.nodeName!=="INPUT"||e.type!=="hidden")&&!n||(e=Mi(e.nextSibling),e===null))return null;return e}function Mh(e){return e.data==="$?"||e.data==="$~"}function Eh(e){return e.data==="$!"||e.data==="$?"&&e.ownerDocument.readyState!=="loading"}function my(e,n){var a=e.ownerDocument;if(e.data==="$~")e._reactRetry=n;else if(e.data!=="$?"||a.readyState!=="loading")n();else{var o=function(){n(),a.removeEventListener("DOMContentLoaded",o)};a.addEventListener("DOMContentLoaded",o),e._reactRetry=o}}function Mi(e){for(;e!=null;e=e.nextSibling){var n=e.nodeType;if(n===1||n===3)break;if(n===8){if(n=e.data,n==="$"||n==="$!"||n==="$?"||n==="$~"||n==="&"||n==="F!"||n==="F")break;if(n==="/$"||n==="/&")return null}}return e}var bh=null;function Y0(e){e=e.nextSibling;for(var n=0;e;){if(e.nodeType===8){var a=e.data;if(a==="/$"||a==="/&"){if(n===0)return Mi(e.nextSibling);n--}else a!=="$"&&a!=="$!"&&a!=="$?"&&a!=="$~"&&a!=="&"||n++}e=e.nextSibling}return null}function j0(e){e=e.previousSibling;for(var n=0;e;){if(e.nodeType===8){var a=e.data;if(a==="$"||a==="$!"||a==="$?"||a==="$~"||a==="&"){if(n===0)return e;n--}else a!=="/$"&&a!=="/&"||n++}e=e.previousSibling}return null}function Z0(e,n,a){switch(n=Sc(a),e){case"html":if(e=n.documentElement,!e)throw Error(s(452));return e;case"head":if(e=n.head,!e)throw Error(s(453));return e;case"body":if(e=n.body,!e)throw Error(s(454));return e;default:throw Error(s(451))}}function jo(e){for(var n=e.attributes;n.length;)e.removeAttributeNode(n[0]);ho(e)}var Ei=new Map,K0=new Set;function yc(e){return typeof e.getRootNode=="function"?e.getRootNode():e.nodeType===9?e:e.ownerDocument}var ba=B.d;B.d={f:gy,r:_y,D:vy,C:xy,L:Sy,m:yy,X:Ey,S:My,M:by};function gy(){var e=ba.f(),n=hc();return e||n}function _y(e){var n=Ba(e);n!==null&&n.tag===5&&n.type==="form"?dg(n):ba.r(e)}var Lr=typeof document>"u"?null:document;function Q0(e,n,a){var o=Lr;if(o&&typeof n=="string"&&n){var u=se(n);u='link[rel="'+e+'"][href="'+u+'"]',typeof a=="string"&&(u+='[crossorigin="'+a+'"]'),K0.has(u)||(K0.add(u),e={rel:e,crossOrigin:a,href:n},o.querySelector(u)===null&&(n=o.createElement("link"),An(n,"link",e),q(n),o.head.appendChild(n)))}}function vy(e){ba.D(e),Q0("dns-prefetch",e,null)}function xy(e,n){ba.C(e,n),Q0("preconnect",e,n)}function Sy(e,n,a){ba.L(e,n,a);var o=Lr;if(o&&e&&n){var u='link[rel="preload"][as="'+se(n)+'"]';n==="image"&&a&&a.imageSrcSet?(u+='[imagesrcset="'+se(a.imageSrcSet)+'"]',typeof a.imageSizes=="string"&&(u+='[imagesizes="'+se(a.imageSizes)+'"]')):u+='[href="'+se(e)+'"]';var f=u;switch(n){case"style":f=Nr(e);break;case"script":f=Or(e)}Ei.has(f)||(e=g({rel:"preload",href:n==="image"&&a&&a.imageSrcSet?void 0:e,as:n},a),Ei.set(f,e),o.querySelector(u)!==null||n==="style"&&o.querySelector(Zo(f))||n==="script"&&o.querySelector(Ko(f))||(n=o.createElement("link"),An(n,"link",e),q(n),o.head.appendChild(n)))}}function yy(e,n){ba.m(e,n);var a=Lr;if(a&&e){var o=n&&typeof n.as=="string"?n.as:"script",u='link[rel="modulepreload"][as="'+se(o)+'"][href="'+se(e)+'"]',f=u;switch(o){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":f=Or(e)}if(!Ei.has(f)&&(e=g({rel:"modulepreload",href:e},n),Ei.set(f,e),a.querySelector(u)===null)){switch(o){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(a.querySelector(Ko(f)))return}o=a.createElement("link"),An(o,"link",e),q(o),a.head.appendChild(o)}}}function My(e,n,a){ba.S(e,n,a);var o=Lr;if(o&&e){var u=C(o).hoistableStyles,f=Nr(e);n=n||"default";var x=u.get(f);if(!x){var R={loading:0,preload:null};if(x=o.querySelector(Zo(f)))R.loading=5;else{e=g({rel:"stylesheet",href:e,"data-precedence":n},a),(a=Ei.get(f))&&Th(e,a);var G=x=o.createElement("link");q(G),An(G,"link",e),G._p=new Promise(function(st,gt){G.onload=st,G.onerror=gt}),G.addEventListener("load",function(){R.loading|=1}),G.addEventListener("error",function(){R.loading|=2}),R.loading|=4,Mc(x,n,o)}x={type:"stylesheet",instance:x,count:1,state:R},u.set(f,x)}}}function Ey(e,n){ba.X(e,n);var a=Lr;if(a&&e){var o=C(a).hoistableScripts,u=Or(e),f=o.get(u);f||(f=a.querySelector(Ko(u)),f||(e=g({src:e,async:!0},n),(n=Ei.get(u))&&Ah(e,n),f=a.createElement("script"),q(f),An(f,"link",e),a.head.appendChild(f)),f={type:"script",instance:f,count:1,state:null},o.set(u,f))}}function by(e,n){ba.M(e,n);var a=Lr;if(a&&e){var o=C(a).hoistableScripts,u=Or(e),f=o.get(u);f||(f=a.querySelector(Ko(u)),f||(e=g({src:e,async:!0,type:"module"},n),(n=Ei.get(u))&&Ah(e,n),f=a.createElement("script"),q(f),An(f,"link",e),a.head.appendChild(f)),f={type:"script",instance:f,count:1,state:null},o.set(u,f))}}function J0(e,n,a,o){var u=(u=Z.current)?yc(u):null;if(!u)throw Error(s(446));switch(e){case"meta":case"title":return null;case"style":return typeof a.precedence=="string"&&typeof a.href=="string"?(n=Nr(a.href),a=C(u).hoistableStyles,o=a.get(n),o||(o={type:"style",instance:null,count:0,state:null},a.set(n,o)),o):{type:"void",instance:null,count:0,state:null};case"link":if(a.rel==="stylesheet"&&typeof a.href=="string"&&typeof a.precedence=="string"){e=Nr(a.href);var f=C(u).hoistableStyles,x=f.get(e);if(x||(u=u.ownerDocument||u,x={type:"stylesheet",instance:null,count:0,state:{loading:0,preload:null}},f.set(e,x),(f=u.querySelector(Zo(e)))&&!f._p&&(x.instance=f,x.state.loading=5),Ei.has(e)||(a={rel:"preload",as:"style",href:a.href,crossOrigin:a.crossOrigin,integrity:a.integrity,media:a.media,hrefLang:a.hrefLang,referrerPolicy:a.referrerPolicy},Ei.set(e,a),f||Ty(u,e,a,x.state))),n&&o===null)throw Error(s(528,""));return x}if(n&&o!==null)throw Error(s(529,""));return null;case"script":return n=a.async,a=a.src,typeof a=="string"&&n&&typeof n!="function"&&typeof n!="symbol"?(n=Or(a),a=C(u).hoistableScripts,o=a.get(n),o||(o={type:"script",instance:null,count:0,state:null},a.set(n,o)),o):{type:"void",instance:null,count:0,state:null};default:throw Error(s(444,e))}}function Nr(e){return'href="'+se(e)+'"'}function Zo(e){return'link[rel="stylesheet"]['+e+"]"}function $0(e){return g({},e,{"data-precedence":e.precedence,precedence:null})}function Ty(e,n,a,o){e.querySelector('link[rel="preload"][as="style"]['+n+"]")?o.loading=1:(n=e.createElement("link"),o.preload=n,n.addEventListener("load",function(){return o.loading|=1}),n.addEventListener("error",function(){return o.loading|=2}),An(n,"link",a),q(n),e.head.appendChild(n))}function Or(e){return'[src="'+se(e)+'"]'}function Ko(e){return"script[async]"+e}function t_(e,n,a){if(n.count++,n.instance===null)switch(n.type){case"style":var o=e.querySelector('style[data-href~="'+se(a.href)+'"]');if(o)return n.instance=o,q(o),o;var u=g({},a,{"data-href":a.href,"data-precedence":a.precedence,href:null,precedence:null});return o=(e.ownerDocument||e).createElement("style"),q(o),An(o,"style",u),Mc(o,a.precedence,e),n.instance=o;case"stylesheet":u=Nr(a.href);var f=e.querySelector(Zo(u));if(f)return n.state.loading|=4,n.instance=f,q(f),f;o=$0(a),(u=Ei.get(u))&&Th(o,u),f=(e.ownerDocument||e).createElement("link"),q(f);var x=f;return x._p=new Promise(function(R,G){x.onload=R,x.onerror=G}),An(f,"link",o),n.state.loading|=4,Mc(f,a.precedence,e),n.instance=f;case"script":return f=Or(a.src),(u=e.querySelector(Ko(f)))?(n.instance=u,q(u),u):(o=a,(u=Ei.get(f))&&(o=g({},a),Ah(o,u)),e=e.ownerDocument||e,u=e.createElement("script"),q(u),An(u,"link",o),e.head.appendChild(u),n.instance=u);case"void":return null;default:throw Error(s(443,n.type))}else n.type==="stylesheet"&&(n.state.loading&4)===0&&(o=n.instance,n.state.loading|=4,Mc(o,a.precedence,e));return n.instance}function Mc(e,n,a){for(var o=a.querySelectorAll('link[rel="stylesheet"][data-precedence],style[data-precedence]'),u=o.length?o[o.length-1]:null,f=u,x=0;x<o.length;x++){var R=o[x];if(R.dataset.precedence===n)f=R;else if(f!==u)break}f?f.parentNode.insertBefore(e,f.nextSibling):(n=a.nodeType===9?a.head:a,n.insertBefore(e,n.firstChild))}function Th(e,n){e.crossOrigin==null&&(e.crossOrigin=n.crossOrigin),e.referrerPolicy==null&&(e.referrerPolicy=n.referrerPolicy),e.title==null&&(e.title=n.title)}function Ah(e,n){e.crossOrigin==null&&(e.crossOrigin=n.crossOrigin),e.referrerPolicy==null&&(e.referrerPolicy=n.referrerPolicy),e.integrity==null&&(e.integrity=n.integrity)}var Ec=null;function e_(e,n,a){if(Ec===null){var o=new Map,u=Ec=new Map;u.set(a,o)}else u=Ec,o=u.get(a),o||(o=new Map,u.set(a,o));if(o.has(e))return o;for(o.set(e,null),a=a.getElementsByTagName(e),u=0;u<a.length;u++){var f=a[u];if(!(f[Ms]||f[rn]||e==="link"&&f.getAttribute("rel")==="stylesheet")&&f.namespaceURI!=="http://www.w3.org/2000/svg"){var x=f.getAttribute(n)||"";x=e+x;var R=o.get(x);R?R.push(f):o.set(x,[f])}}return o}function n_(e,n,a){e=e.ownerDocument||e,e.head.insertBefore(a,n==="title"?e.querySelector("head > title"):null)}function Ay(e,n,a){if(a===1||n.itemProp!=null)return!1;switch(e){case"meta":case"title":return!0;case"style":if(typeof n.precedence!="string"||typeof n.href!="string"||n.href==="")break;return!0;case"link":if(typeof n.rel!="string"||typeof n.href!="string"||n.href===""||n.onLoad||n.onError)break;return n.rel==="stylesheet"?(e=n.disabled,typeof n.precedence=="string"&&e==null):!0;case"script":if(n.async&&typeof n.async!="function"&&typeof n.async!="symbol"&&!n.onLoad&&!n.onError&&n.src&&typeof n.src=="string")return!0}return!1}function i_(e){return!(e.type==="stylesheet"&&(e.state.loading&3)===0)}function Ry(e,n,a,o){if(a.type==="stylesheet"&&(typeof o.media!="string"||matchMedia(o.media).matches!==!1)&&(a.state.loading&4)===0){if(a.instance===null){var u=Nr(o.href),f=n.querySelector(Zo(u));if(f){n=f._p,n!==null&&typeof n=="object"&&typeof n.then=="function"&&(e.count++,e=bc.bind(e),n.then(e,e)),a.state.loading|=4,a.instance=f,q(f);return}f=n.ownerDocument||n,o=$0(o),(u=Ei.get(u))&&Th(o,u),f=f.createElement("link"),q(f);var x=f;x._p=new Promise(function(R,G){x.onload=R,x.onerror=G}),An(f,"link",o),a.instance=f}e.stylesheets===null&&(e.stylesheets=new Map),e.stylesheets.set(a,n),(n=a.state.preload)&&(a.state.loading&3)===0&&(e.count++,a=bc.bind(e),n.addEventListener("load",a),n.addEventListener("error",a))}}var Rh=0;function Cy(e,n){return e.stylesheets&&e.count===0&&Ac(e,e.stylesheets),0<e.count||0<e.imgCount?function(a){var o=setTimeout(function(){if(e.stylesheets&&Ac(e,e.stylesheets),e.unsuspend){var f=e.unsuspend;e.unsuspend=null,f()}},6e4+n);0<e.imgBytes&&Rh===0&&(Rh=62500*ly());var u=setTimeout(function(){if(e.waitingForImages=!1,e.count===0&&(e.stylesheets&&Ac(e,e.stylesheets),e.unsuspend)){var f=e.unsuspend;e.unsuspend=null,f()}},(e.imgBytes>Rh?50:800)+n);return e.unsuspend=a,function(){e.unsuspend=null,clearTimeout(o),clearTimeout(u)}}:null}function bc(){if(this.count--,this.count===0&&(this.imgCount===0||!this.waitingForImages)){if(this.stylesheets)Ac(this,this.stylesheets);else if(this.unsuspend){var e=this.unsuspend;this.unsuspend=null,e()}}}var Tc=null;function Ac(e,n){e.stylesheets=null,e.unsuspend!==null&&(e.count++,Tc=new Map,n.forEach(wy,e),Tc=null,bc.call(e))}function wy(e,n){if(!(n.state.loading&4)){var a=Tc.get(e);if(a)var o=a.get(null);else{a=new Map,Tc.set(e,a);for(var u=e.querySelectorAll("link[data-precedence],style[data-precedence]"),f=0;f<u.length;f++){var x=u[f];(x.nodeName==="LINK"||x.getAttribute("media")!=="not all")&&(a.set(x.dataset.precedence,x),o=x)}o&&a.set(null,o)}u=n.instance,x=u.getAttribute("data-precedence"),f=a.get(x)||o,f===o&&a.set(null,u),a.set(x,u),this.count++,o=bc.bind(this),u.addEventListener("load",o),u.addEventListener("error",o),f?f.parentNode.insertBefore(u,f.nextSibling):(e=e.nodeType===9?e.head:e,e.insertBefore(u,e.firstChild)),n.state.loading|=4}}var Qo={$$typeof:D,Provider:null,Consumer:null,_currentValue:at,_currentValue2:at,_threadCount:0};function Dy(e,n,a,o,u,f,x,R,G){this.tag=1,this.containerInfo=e,this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.next=this.pendingContext=this.context=this.cancelPendingCommit=null,this.callbackPriority=0,this.expirationTimes=Ae(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=Ae(0),this.hiddenUpdates=Ae(null),this.identifierPrefix=o,this.onUncaughtError=u,this.onCaughtError=f,this.onRecoverableError=x,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=G,this.incompleteTransitions=new Map}function a_(e,n,a,o,u,f,x,R,G,st,gt,St){return e=new Dy(e,n,a,x,G,st,gt,St,R),n=1,f===!0&&(n|=24),f=ai(3,null,null,n),e.current=f,f.stateNode=e,n=rf(),n.refCount++,e.pooledCache=n,n.refCount++,f.memoizedState={element:o,isDehydrated:a,cache:n},uf(f),e}function s_(e){return e?(e=fr,e):fr}function r_(e,n,a,o,u,f){u=s_(u),o.context===null?o.context=u:o.pendingContext=u,o=qa(n),o.payload={element:a},f=f===void 0?null:f,f!==null&&(o.callback=f),a=Ya(e,o,n),a!==null&&(Qn(a,e,n),wo(a,e,n))}function o_(e,n){if(e=e.memoizedState,e!==null&&e.dehydrated!==null){var a=e.retryLane;e.retryLane=a!==0&&a<n?a:n}}function Ch(e,n){o_(e,n),(e=e.alternate)&&o_(e,n)}function l_(e){if(e.tag===13||e.tag===31){var n=Rs(e,67108864);n!==null&&Qn(n,e,67108864),Ch(e,67108864)}}function c_(e){if(e.tag===13||e.tag===31){var n=ci();n=er(n);var a=Rs(e,n);a!==null&&Qn(a,e,n),Ch(e,n)}}var Rc=!0;function Uy(e,n,a,o){var u=O.T;O.T=null;var f=B.p;try{B.p=2,wh(e,n,a,o)}finally{B.p=f,O.T=u}}function Ly(e,n,a,o){var u=O.T;O.T=null;var f=B.p;try{B.p=8,wh(e,n,a,o)}finally{B.p=f,O.T=u}}function wh(e,n,a,o){if(Rc){var u=Dh(o);if(u===null)mh(e,n,o,Cc,a),f_(e,o);else if(Oy(u,e,n,a,o))o.stopPropagation();else if(f_(e,o),n&4&&-1<Ny.indexOf(e)){for(;u!==null;){var f=Ba(u);if(f!==null)switch(f.tag){case 3:if(f=f.stateNode,f.current.memoizedState.isDehydrated){var x=bt(f.pendingLanes);if(x!==0){var R=f;for(R.pendingLanes|=2,R.entangledLanes|=2;x;){var G=1<<31-Ot(x);R.entanglements[1]|=G,x&=~G}ji(f),(Le&6)===0&&(uc=b()+500,Wo(0))}}break;case 31:case 13:R=Rs(f,2),R!==null&&Qn(R,f,2),hc(),Ch(f,2)}if(f=Dh(o),f===null&&mh(e,n,o,Cc,a),f===u)break;u=f}u!==null&&o.stopPropagation()}else mh(e,n,o,null,a)}}function Dh(e){return e=Uu(e),Uh(e)}var Cc=null;function Uh(e){if(Cc=null,e=Fa(e),e!==null){var n=c(e);if(n===null)e=null;else{var a=n.tag;if(a===13){if(e=h(n),e!==null)return e;e=null}else if(a===31){if(e=d(n),e!==null)return e;e=null}else if(a===3){if(n.stateNode.current.memoizedState.isDehydrated)return n.tag===3?n.stateNode.containerInfo:null;e=null}else n!==e&&(e=null)}}return Cc=e,null}function u_(e){switch(e){case"beforetoggle":case"cancel":case"click":case"close":case"contextmenu":case"copy":case"cut":case"auxclick":case"dblclick":case"dragend":case"dragstart":case"drop":case"focusin":case"focusout":case"input":case"invalid":case"keydown":case"keypress":case"keyup":case"mousedown":case"mouseup":case"paste":case"pause":case"play":case"pointercancel":case"pointerdown":case"pointerup":case"ratechange":case"reset":case"resize":case"seeked":case"submit":case"toggle":case"touchcancel":case"touchend":case"touchstart":case"volumechange":case"change":case"selectionchange":case"textInput":case"compositionstart":case"compositionend":case"compositionupdate":case"beforeblur":case"afterblur":case"beforeinput":case"blur":case"fullscreenchange":case"focus":case"hashchange":case"popstate":case"select":case"selectstart":return 2;case"drag":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"mousemove":case"mouseout":case"mouseover":case"pointermove":case"pointerout":case"pointerover":case"scroll":case"touchmove":case"wheel":case"mouseenter":case"mouseleave":case"pointerenter":case"pointerleave":return 8;case"message":switch(K()){case _t:return 2;case Mt:return 8;case mt:case Wt:return 32;case wt:return 268435456;default:return 32}default:return 32}}var Lh=!1,as=null,ss=null,rs=null,Jo=new Map,$o=new Map,os=[],Ny="mousedown mouseup touchcancel touchend touchstart auxclick dblclick pointercancel pointerdown pointerup dragend dragstart drop compositionend compositionstart keydown keypress keyup input textInput copy cut paste click change contextmenu reset".split(" ");function f_(e,n){switch(e){case"focusin":case"focusout":as=null;break;case"dragenter":case"dragleave":ss=null;break;case"mouseover":case"mouseout":rs=null;break;case"pointerover":case"pointerout":Jo.delete(n.pointerId);break;case"gotpointercapture":case"lostpointercapture":$o.delete(n.pointerId)}}function tl(e,n,a,o,u,f){return e===null||e.nativeEvent!==f?(e={blockedOn:n,domEventName:a,eventSystemFlags:o,nativeEvent:f,targetContainers:[u]},n!==null&&(n=Ba(n),n!==null&&l_(n)),e):(e.eventSystemFlags|=o,n=e.targetContainers,u!==null&&n.indexOf(u)===-1&&n.push(u),e)}function Oy(e,n,a,o,u){switch(n){case"focusin":return as=tl(as,e,n,a,o,u),!0;case"dragenter":return ss=tl(ss,e,n,a,o,u),!0;case"mouseover":return rs=tl(rs,e,n,a,o,u),!0;case"pointerover":var f=u.pointerId;return Jo.set(f,tl(Jo.get(f)||null,e,n,a,o,u)),!0;case"gotpointercapture":return f=u.pointerId,$o.set(f,tl($o.get(f)||null,e,n,a,o,u)),!0}return!1}function h_(e){var n=Fa(e.target);if(n!==null){var a=c(n);if(a!==null){if(n=a.tag,n===13){if(n=h(a),n!==null){e.blockedOn=n,ir(e.priority,function(){c_(a)});return}}else if(n===31){if(n=d(a),n!==null){e.blockedOn=n,ir(e.priority,function(){c_(a)});return}}else if(n===3&&a.stateNode.current.memoizedState.isDehydrated){e.blockedOn=a.tag===3?a.stateNode.containerInfo:null;return}}}e.blockedOn=null}function wc(e){if(e.blockedOn!==null)return!1;for(var n=e.targetContainers;0<n.length;){var a=Dh(e.nativeEvent);if(a===null){a=e.nativeEvent;var o=new a.constructor(a.type,a);Du=o,a.target.dispatchEvent(o),Du=null}else return n=Ba(a),n!==null&&l_(n),e.blockedOn=a,!1;n.shift()}return!0}function d_(e,n,a){wc(e)&&a.delete(n)}function Py(){Lh=!1,as!==null&&wc(as)&&(as=null),ss!==null&&wc(ss)&&(ss=null),rs!==null&&wc(rs)&&(rs=null),Jo.forEach(d_),$o.forEach(d_)}function Dc(e,n){e.blockedOn===n&&(e.blockedOn=null,Lh||(Lh=!0,r.unstable_scheduleCallback(r.unstable_NormalPriority,Py)))}var Uc=null;function p_(e){Uc!==e&&(Uc=e,r.unstable_scheduleCallback(r.unstable_NormalPriority,function(){Uc===e&&(Uc=null);for(var n=0;n<e.length;n+=3){var a=e[n],o=e[n+1],u=e[n+2];if(typeof o!="function"){if(Uh(o||a)===null)continue;break}var f=Ba(a);f!==null&&(e.splice(n,3),n-=3,Df(f,{pending:!0,data:u,method:a.method,action:o},o,u))}}))}function Pr(e){function n(G){return Dc(G,e)}as!==null&&Dc(as,e),ss!==null&&Dc(ss,e),rs!==null&&Dc(rs,e),Jo.forEach(n),$o.forEach(n);for(var a=0;a<os.length;a++){var o=os[a];o.blockedOn===e&&(o.blockedOn=null)}for(;0<os.length&&(a=os[0],a.blockedOn===null);)h_(a),a.blockedOn===null&&os.shift();if(a=(e.ownerDocument||e).$$reactFormReplay,a!=null)for(o=0;o<a.length;o+=3){var u=a[o],f=a[o+1],x=u[pn]||null;if(typeof f=="function")x||p_(a);else if(x){var R=null;if(f&&f.hasAttribute("formAction")){if(u=f,x=f[pn]||null)R=x.formAction;else if(Uh(u)!==null)continue}else R=x.action;typeof R=="function"?a[o+1]=R:(a.splice(o,3),o-=3),p_(a)}}}function m_(){function e(f){f.canIntercept&&f.info==="react-transition"&&f.intercept({handler:function(){return new Promise(function(x){return u=x})},focusReset:"manual",scroll:"manual"})}function n(){u!==null&&(u(),u=null),o||setTimeout(a,20)}function a(){if(!o&&!navigation.transition){var f=navigation.currentEntry;f&&f.url!=null&&navigation.navigate(f.url,{state:f.getState(),info:"react-transition",history:"replace"})}}if(typeof navigation=="object"){var o=!1,u=null;return navigation.addEventListener("navigate",e),navigation.addEventListener("navigatesuccess",n),navigation.addEventListener("navigateerror",n),setTimeout(a,100),function(){o=!0,navigation.removeEventListener("navigate",e),navigation.removeEventListener("navigatesuccess",n),navigation.removeEventListener("navigateerror",n),u!==null&&(u(),u=null)}}}function Nh(e){this._internalRoot=e}Lc.prototype.render=Nh.prototype.render=function(e){var n=this._internalRoot;if(n===null)throw Error(s(409));var a=n.current,o=ci();r_(a,o,e,n,null,null)},Lc.prototype.unmount=Nh.prototype.unmount=function(){var e=this._internalRoot;if(e!==null){this._internalRoot=null;var n=e.containerInfo;r_(e.current,2,null,e,null,null),hc(),n[ra]=null}};function Lc(e){this._internalRoot=e}Lc.prototype.unstable_scheduleHydration=function(e){if(e){var n=Xi();e={blockedOn:null,target:e,priority:n};for(var a=0;a<os.length&&n!==0&&n<os[a].priority;a++);os.splice(a,0,e),a===0&&h_(e)}};var g_=t.version;if(g_!=="19.2.4")throw Error(s(527,g_,"19.2.4"));B.findDOMNode=function(e){var n=e._reactInternals;if(n===void 0)throw typeof e.render=="function"?Error(s(188)):(e=Object.keys(e).join(","),Error(s(268,e)));return e=p(n),e=e!==null?v(e):null,e=e===null?null:e.stateNode,e};var zy={bundleType:0,version:"19.2.4",rendererPackageName:"react-dom",currentDispatcherRef:O,reconcilerVersion:"19.2.4"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var Nc=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!Nc.isDisabled&&Nc.supportsFiber)try{Tt=Nc.inject(zy),Et=Nc}catch{}}return nl.createRoot=function(e,n){if(!l(e))throw Error(s(299));var a=!1,o="",u=Eg,f=bg,x=Tg;return n!=null&&(n.unstable_strictMode===!0&&(a=!0),n.identifierPrefix!==void 0&&(o=n.identifierPrefix),n.onUncaughtError!==void 0&&(u=n.onUncaughtError),n.onCaughtError!==void 0&&(f=n.onCaughtError),n.onRecoverableError!==void 0&&(x=n.onRecoverableError)),n=a_(e,1,!1,null,null,a,o,null,u,f,x,m_),e[ra]=n.current,ph(e),new Nh(n)},nl.hydrateRoot=function(e,n,a){if(!l(e))throw Error(s(299));var o=!1,u="",f=Eg,x=bg,R=Tg,G=null;return a!=null&&(a.unstable_strictMode===!0&&(o=!0),a.identifierPrefix!==void 0&&(u=a.identifierPrefix),a.onUncaughtError!==void 0&&(f=a.onUncaughtError),a.onCaughtError!==void 0&&(x=a.onCaughtError),a.onRecoverableError!==void 0&&(R=a.onRecoverableError),a.formState!==void 0&&(G=a.formState)),n=a_(e,1,!0,n,a??null,o,u,G,f,x,R,m_),n.context=s_(null),a=n.current,o=ci(),o=er(o),u=qa(o),u.callback=null,Ya(a,u,o),a=o,n.current.lanes=a,In(n,a),ji(n),e[ra]=n.current,ph(e),new Lc(n)},nl.version="19.2.4",nl}var A_;function qy(){if(A_)return zh.exports;A_=1;function r(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(r)}catch(t){console.error(t)}}return r(),zh.exports=Wy(),zh.exports}var Yy=qy();const Sp="183",to={ROTATE:0,DOLLY:1,PAN:2},$r={ROTATE:0,PAN:1,DOLLY_PAN:2,DOLLY_ROTATE:3},jy=0,R_=1,Zy=2,hu=1,Ky=2,ul=3,xs=0,ti=1,Bi=2,La=0,eo=1,C_=2,w_=3,D_=4,Qy=5,qs=100,Jy=101,$y=102,tM=103,eM=104,nM=200,iM=201,aM=202,sM=203,bd=204,Td=205,rM=206,oM=207,lM=208,cM=209,uM=210,fM=211,hM=212,dM=213,pM=214,Ad=0,Rd=1,Cd=2,io=3,wd=4,Dd=5,Ud=6,Ld=7,yp=0,mM=1,gM=2,na=0,Xv=1,Wv=2,qv=3,Yv=4,jv=5,Zv=6,Kv=7,Qv=300,Js=301,ao=302,Hh=303,Gh=304,Tu=306,Nd=1e3,Ua=1001,Od=1002,Dn=1003,_M=1004,Oc=1005,zn=1006,Vh=1007,Zs=1008,di=1009,Jv=1010,$v=1011,pl=1012,Mp=1013,aa=1014,ta=1015,Pa=1016,Ep=1017,bp=1018,ml=1020,tx=35902,ex=35899,nx=1021,ix=1022,Vi=1023,za=1026,Ks=1027,ax=1028,Tp=1029,so=1030,Ap=1031,Rp=1033,du=33776,pu=33777,mu=33778,gu=33779,Pd=35840,zd=35841,Id=35842,Fd=35843,Bd=36196,Hd=37492,Gd=37496,Vd=37488,kd=37489,Xd=37490,Wd=37491,qd=37808,Yd=37809,jd=37810,Zd=37811,Kd=37812,Qd=37813,Jd=37814,$d=37815,tp=37816,ep=37817,np=37818,ip=37819,ap=37820,sp=37821,rp=36492,op=36494,lp=36495,cp=36283,up=36284,fp=36285,hp=36286,vM=3200,sx=0,xM=1,gs="",Ai="srgb",ro="srgb-linear",vu="linear",Fe="srgb",zr=7680,U_=519,SM=512,yM=513,MM=514,Cp=515,EM=516,bM=517,wp=518,TM=519,dp=35044,L_="300 es",ea=2e3,gl=2001;function AM(r){for(let t=r.length-1;t>=0;--t)if(r[t]>=65535)return!0;return!1}function xu(r){return document.createElementNS("http://www.w3.org/1999/xhtml",r)}function RM(){const r=xu("canvas");return r.style.display="block",r}const N_={};function Su(...r){const t="THREE."+r.shift();console.log(t,...r)}function rx(r){const t=r[0];if(typeof t=="string"&&t.startsWith("TSL:")){const i=r[1];i&&i.isStackTrace?r[0]+=" "+i.getLocation():r[1]='Stack trace not available. Enable "THREE.Node.captureStackTrace" to capture stack traces.'}return r}function ee(...r){r=rx(r);const t="THREE."+r.shift();{const i=r[0];i&&i.isStackTrace?console.warn(i.getError(t)):console.warn(t,...r)}}function Ue(...r){r=rx(r);const t="THREE."+r.shift();{const i=r[0];i&&i.isStackTrace?console.error(i.getError(t)):console.error(t,...r)}}function yu(...r){const t=r.join(" ");t in N_||(N_[t]=!0,ee(...r))}function CM(r,t,i){return new Promise(function(s,l){function c(){switch(r.clientWaitSync(t,r.SYNC_FLUSH_COMMANDS_BIT,0)){case r.WAIT_FAILED:l();break;case r.TIMEOUT_EXPIRED:setTimeout(c,i);break;default:s()}}setTimeout(c,i)})}const wM={[Ad]:Rd,[Cd]:Ud,[wd]:Ld,[io]:Dd,[Rd]:Ad,[Ud]:Cd,[Ld]:wd,[Dd]:io};class $s{addEventListener(t,i){this._listeners===void 0&&(this._listeners={});const s=this._listeners;s[t]===void 0&&(s[t]=[]),s[t].indexOf(i)===-1&&s[t].push(i)}hasEventListener(t,i){const s=this._listeners;return s===void 0?!1:s[t]!==void 0&&s[t].indexOf(i)!==-1}removeEventListener(t,i){const s=this._listeners;if(s===void 0)return;const l=s[t];if(l!==void 0){const c=l.indexOf(i);c!==-1&&l.splice(c,1)}}dispatchEvent(t){const i=this._listeners;if(i===void 0)return;const s=i[t.type];if(s!==void 0){t.target=this;const l=s.slice(0);for(let c=0,h=l.length;c<h;c++)l[c].call(this,t);t.target=null}}}const On=["00","01","02","03","04","05","06","07","08","09","0a","0b","0c","0d","0e","0f","10","11","12","13","14","15","16","17","18","19","1a","1b","1c","1d","1e","1f","20","21","22","23","24","25","26","27","28","29","2a","2b","2c","2d","2e","2f","30","31","32","33","34","35","36","37","38","39","3a","3b","3c","3d","3e","3f","40","41","42","43","44","45","46","47","48","49","4a","4b","4c","4d","4e","4f","50","51","52","53","54","55","56","57","58","59","5a","5b","5c","5d","5e","5f","60","61","62","63","64","65","66","67","68","69","6a","6b","6c","6d","6e","6f","70","71","72","73","74","75","76","77","78","79","7a","7b","7c","7d","7e","7f","80","81","82","83","84","85","86","87","88","89","8a","8b","8c","8d","8e","8f","90","91","92","93","94","95","96","97","98","99","9a","9b","9c","9d","9e","9f","a0","a1","a2","a3","a4","a5","a6","a7","a8","a9","aa","ab","ac","ad","ae","af","b0","b1","b2","b3","b4","b5","b6","b7","b8","b9","ba","bb","bc","bd","be","bf","c0","c1","c2","c3","c4","c5","c6","c7","c8","c9","ca","cb","cc","cd","ce","cf","d0","d1","d2","d3","d4","d5","d6","d7","d8","d9","da","db","dc","dd","de","df","e0","e1","e2","e3","e4","e5","e6","e7","e8","e9","ea","eb","ec","ed","ee","ef","f0","f1","f2","f3","f4","f5","f6","f7","f8","f9","fa","fb","fc","fd","fe","ff"];let O_=1234567;const hl=Math.PI/180,_l=180/Math.PI;function Na(){const r=Math.random()*4294967295|0,t=Math.random()*4294967295|0,i=Math.random()*4294967295|0,s=Math.random()*4294967295|0;return(On[r&255]+On[r>>8&255]+On[r>>16&255]+On[r>>24&255]+"-"+On[t&255]+On[t>>8&255]+"-"+On[t>>16&15|64]+On[t>>24&255]+"-"+On[i&63|128]+On[i>>8&255]+"-"+On[i>>16&255]+On[i>>24&255]+On[s&255]+On[s>>8&255]+On[s>>16&255]+On[s>>24&255]).toLowerCase()}function ce(r,t,i){return Math.max(t,Math.min(i,r))}function Dp(r,t){return(r%t+t)%t}function DM(r,t,i,s,l){return s+(r-t)*(l-s)/(i-t)}function UM(r,t,i){return r!==t?(i-r)/(t-r):0}function dl(r,t,i){return(1-i)*r+i*t}function LM(r,t,i,s){return dl(r,t,1-Math.exp(-i*s))}function NM(r,t=1){return t-Math.abs(Dp(r,t*2)-t)}function OM(r,t,i){return r<=t?0:r>=i?1:(r=(r-t)/(i-t),r*r*(3-2*r))}function PM(r,t,i){return r<=t?0:r>=i?1:(r=(r-t)/(i-t),r*r*r*(r*(r*6-15)+10))}function zM(r,t){return r+Math.floor(Math.random()*(t-r+1))}function IM(r,t){return r+Math.random()*(t-r)}function FM(r){return r*(.5-Math.random())}function BM(r){r!==void 0&&(O_=r);let t=O_+=1831565813;return t=Math.imul(t^t>>>15,t|1),t^=t+Math.imul(t^t>>>7,t|61),((t^t>>>14)>>>0)/4294967296}function HM(r){return r*hl}function GM(r){return r*_l}function VM(r){return(r&r-1)===0&&r!==0}function kM(r){return Math.pow(2,Math.ceil(Math.log(r)/Math.LN2))}function XM(r){return Math.pow(2,Math.floor(Math.log(r)/Math.LN2))}function WM(r,t,i,s,l){const c=Math.cos,h=Math.sin,d=c(i/2),m=h(i/2),p=c((t+s)/2),v=h((t+s)/2),g=c((t-s)/2),_=h((t-s)/2),M=c((s-t)/2),E=h((s-t)/2);switch(l){case"XYX":r.set(d*v,m*g,m*_,d*p);break;case"YZY":r.set(m*_,d*v,m*g,d*p);break;case"ZXZ":r.set(m*g,m*_,d*v,d*p);break;case"XZX":r.set(d*v,m*E,m*M,d*p);break;case"YXY":r.set(m*M,d*v,m*E,d*p);break;case"ZYZ":r.set(m*E,m*M,d*v,d*p);break;default:ee("MathUtils: .setQuaternionFromProperEuler() encountered an unknown order: "+l)}}function Hi(r,t){switch(t.constructor){case Float32Array:return r;case Uint32Array:return r/4294967295;case Uint16Array:return r/65535;case Uint8Array:return r/255;case Int32Array:return Math.max(r/2147483647,-1);case Int16Array:return Math.max(r/32767,-1);case Int8Array:return Math.max(r/127,-1);default:throw new Error("Invalid component type.")}}function Be(r,t){switch(t.constructor){case Float32Array:return r;case Uint32Array:return Math.round(r*4294967295);case Uint16Array:return Math.round(r*65535);case Uint8Array:return Math.round(r*255);case Int32Array:return Math.round(r*2147483647);case Int16Array:return Math.round(r*32767);case Int8Array:return Math.round(r*127);default:throw new Error("Invalid component type.")}}const ox={DEG2RAD:hl,RAD2DEG:_l,generateUUID:Na,clamp:ce,euclideanModulo:Dp,mapLinear:DM,inverseLerp:UM,lerp:dl,damp:LM,pingpong:NM,smoothstep:OM,smootherstep:PM,randInt:zM,randFloat:IM,randFloatSpread:FM,seededRandom:BM,degToRad:HM,radToDeg:GM,isPowerOfTwo:VM,ceilPowerOfTwo:kM,floorPowerOfTwo:XM,setQuaternionFromProperEuler:WM,normalize:Be,denormalize:Hi};class le{constructor(t=0,i=0){le.prototype.isVector2=!0,this.x=t,this.y=i}get width(){return this.x}set width(t){this.x=t}get height(){return this.y}set height(t){this.y=t}set(t,i){return this.x=t,this.y=i,this}setScalar(t){return this.x=t,this.y=t,this}setX(t){return this.x=t,this}setY(t){return this.y=t,this}setComponent(t,i){switch(t){case 0:this.x=i;break;case 1:this.y=i;break;default:throw new Error("index is out of range: "+t)}return this}getComponent(t){switch(t){case 0:return this.x;case 1:return this.y;default:throw new Error("index is out of range: "+t)}}clone(){return new this.constructor(this.x,this.y)}copy(t){return this.x=t.x,this.y=t.y,this}add(t){return this.x+=t.x,this.y+=t.y,this}addScalar(t){return this.x+=t,this.y+=t,this}addVectors(t,i){return this.x=t.x+i.x,this.y=t.y+i.y,this}addScaledVector(t,i){return this.x+=t.x*i,this.y+=t.y*i,this}sub(t){return this.x-=t.x,this.y-=t.y,this}subScalar(t){return this.x-=t,this.y-=t,this}subVectors(t,i){return this.x=t.x-i.x,this.y=t.y-i.y,this}multiply(t){return this.x*=t.x,this.y*=t.y,this}multiplyScalar(t){return this.x*=t,this.y*=t,this}divide(t){return this.x/=t.x,this.y/=t.y,this}divideScalar(t){return this.multiplyScalar(1/t)}applyMatrix3(t){const i=this.x,s=this.y,l=t.elements;return this.x=l[0]*i+l[3]*s+l[6],this.y=l[1]*i+l[4]*s+l[7],this}min(t){return this.x=Math.min(this.x,t.x),this.y=Math.min(this.y,t.y),this}max(t){return this.x=Math.max(this.x,t.x),this.y=Math.max(this.y,t.y),this}clamp(t,i){return this.x=ce(this.x,t.x,i.x),this.y=ce(this.y,t.y,i.y),this}clampScalar(t,i){return this.x=ce(this.x,t,i),this.y=ce(this.y,t,i),this}clampLength(t,i){const s=this.length();return this.divideScalar(s||1).multiplyScalar(ce(s,t,i))}floor(){return this.x=Math.floor(this.x),this.y=Math.floor(this.y),this}ceil(){return this.x=Math.ceil(this.x),this.y=Math.ceil(this.y),this}round(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this}roundToZero(){return this.x=Math.trunc(this.x),this.y=Math.trunc(this.y),this}negate(){return this.x=-this.x,this.y=-this.y,this}dot(t){return this.x*t.x+this.y*t.y}cross(t){return this.x*t.y-this.y*t.x}lengthSq(){return this.x*this.x+this.y*this.y}length(){return Math.sqrt(this.x*this.x+this.y*this.y)}manhattanLength(){return Math.abs(this.x)+Math.abs(this.y)}normalize(){return this.divideScalar(this.length()||1)}angle(){return Math.atan2(-this.y,-this.x)+Math.PI}angleTo(t){const i=Math.sqrt(this.lengthSq()*t.lengthSq());if(i===0)return Math.PI/2;const s=this.dot(t)/i;return Math.acos(ce(s,-1,1))}distanceTo(t){return Math.sqrt(this.distanceToSquared(t))}distanceToSquared(t){const i=this.x-t.x,s=this.y-t.y;return i*i+s*s}manhattanDistanceTo(t){return Math.abs(this.x-t.x)+Math.abs(this.y-t.y)}setLength(t){return this.normalize().multiplyScalar(t)}lerp(t,i){return this.x+=(t.x-this.x)*i,this.y+=(t.y-this.y)*i,this}lerpVectors(t,i,s){return this.x=t.x+(i.x-t.x)*s,this.y=t.y+(i.y-t.y)*s,this}equals(t){return t.x===this.x&&t.y===this.y}fromArray(t,i=0){return this.x=t[i],this.y=t[i+1],this}toArray(t=[],i=0){return t[i]=this.x,t[i+1]=this.y,t}fromBufferAttribute(t,i){return this.x=t.getX(i),this.y=t.getY(i),this}rotateAround(t,i){const s=Math.cos(i),l=Math.sin(i),c=this.x-t.x,h=this.y-t.y;return this.x=c*s-h*l+t.x,this.y=c*l+h*s+t.y,this}random(){return this.x=Math.random(),this.y=Math.random(),this}*[Symbol.iterator](){yield this.x,yield this.y}}class Ss{constructor(t=0,i=0,s=0,l=1){this.isQuaternion=!0,this._x=t,this._y=i,this._z=s,this._w=l}static slerpFlat(t,i,s,l,c,h,d){let m=s[l+0],p=s[l+1],v=s[l+2],g=s[l+3],_=c[h+0],M=c[h+1],E=c[h+2],A=c[h+3];if(g!==A||m!==_||p!==M||v!==E){let y=m*_+p*M+v*E+g*A;y<0&&(_=-_,M=-M,E=-E,A=-A,y=-y);let S=1-d;if(y<.9995){const w=Math.acos(y),D=Math.sin(w);S=Math.sin(S*w)/D,d=Math.sin(d*w)/D,m=m*S+_*d,p=p*S+M*d,v=v*S+E*d,g=g*S+A*d}else{m=m*S+_*d,p=p*S+M*d,v=v*S+E*d,g=g*S+A*d;const w=1/Math.sqrt(m*m+p*p+v*v+g*g);m*=w,p*=w,v*=w,g*=w}}t[i]=m,t[i+1]=p,t[i+2]=v,t[i+3]=g}static multiplyQuaternionsFlat(t,i,s,l,c,h){const d=s[l],m=s[l+1],p=s[l+2],v=s[l+3],g=c[h],_=c[h+1],M=c[h+2],E=c[h+3];return t[i]=d*E+v*g+m*M-p*_,t[i+1]=m*E+v*_+p*g-d*M,t[i+2]=p*E+v*M+d*_-m*g,t[i+3]=v*E-d*g-m*_-p*M,t}get x(){return this._x}set x(t){this._x=t,this._onChangeCallback()}get y(){return this._y}set y(t){this._y=t,this._onChangeCallback()}get z(){return this._z}set z(t){this._z=t,this._onChangeCallback()}get w(){return this._w}set w(t){this._w=t,this._onChangeCallback()}set(t,i,s,l){return this._x=t,this._y=i,this._z=s,this._w=l,this._onChangeCallback(),this}clone(){return new this.constructor(this._x,this._y,this._z,this._w)}copy(t){return this._x=t.x,this._y=t.y,this._z=t.z,this._w=t.w,this._onChangeCallback(),this}setFromEuler(t,i=!0){const s=t._x,l=t._y,c=t._z,h=t._order,d=Math.cos,m=Math.sin,p=d(s/2),v=d(l/2),g=d(c/2),_=m(s/2),M=m(l/2),E=m(c/2);switch(h){case"XYZ":this._x=_*v*g+p*M*E,this._y=p*M*g-_*v*E,this._z=p*v*E+_*M*g,this._w=p*v*g-_*M*E;break;case"YXZ":this._x=_*v*g+p*M*E,this._y=p*M*g-_*v*E,this._z=p*v*E-_*M*g,this._w=p*v*g+_*M*E;break;case"ZXY":this._x=_*v*g-p*M*E,this._y=p*M*g+_*v*E,this._z=p*v*E+_*M*g,this._w=p*v*g-_*M*E;break;case"ZYX":this._x=_*v*g-p*M*E,this._y=p*M*g+_*v*E,this._z=p*v*E-_*M*g,this._w=p*v*g+_*M*E;break;case"YZX":this._x=_*v*g+p*M*E,this._y=p*M*g+_*v*E,this._z=p*v*E-_*M*g,this._w=p*v*g-_*M*E;break;case"XZY":this._x=_*v*g-p*M*E,this._y=p*M*g-_*v*E,this._z=p*v*E+_*M*g,this._w=p*v*g+_*M*E;break;default:ee("Quaternion: .setFromEuler() encountered an unknown order: "+h)}return i===!0&&this._onChangeCallback(),this}setFromAxisAngle(t,i){const s=i/2,l=Math.sin(s);return this._x=t.x*l,this._y=t.y*l,this._z=t.z*l,this._w=Math.cos(s),this._onChangeCallback(),this}setFromRotationMatrix(t){const i=t.elements,s=i[0],l=i[4],c=i[8],h=i[1],d=i[5],m=i[9],p=i[2],v=i[6],g=i[10],_=s+d+g;if(_>0){const M=.5/Math.sqrt(_+1);this._w=.25/M,this._x=(v-m)*M,this._y=(c-p)*M,this._z=(h-l)*M}else if(s>d&&s>g){const M=2*Math.sqrt(1+s-d-g);this._w=(v-m)/M,this._x=.25*M,this._y=(l+h)/M,this._z=(c+p)/M}else if(d>g){const M=2*Math.sqrt(1+d-s-g);this._w=(c-p)/M,this._x=(l+h)/M,this._y=.25*M,this._z=(m+v)/M}else{const M=2*Math.sqrt(1+g-s-d);this._w=(h-l)/M,this._x=(c+p)/M,this._y=(m+v)/M,this._z=.25*M}return this._onChangeCallback(),this}setFromUnitVectors(t,i){let s=t.dot(i)+1;return s<1e-8?(s=0,Math.abs(t.x)>Math.abs(t.z)?(this._x=-t.y,this._y=t.x,this._z=0,this._w=s):(this._x=0,this._y=-t.z,this._z=t.y,this._w=s)):(this._x=t.y*i.z-t.z*i.y,this._y=t.z*i.x-t.x*i.z,this._z=t.x*i.y-t.y*i.x,this._w=s),this.normalize()}angleTo(t){return 2*Math.acos(Math.abs(ce(this.dot(t),-1,1)))}rotateTowards(t,i){const s=this.angleTo(t);if(s===0)return this;const l=Math.min(1,i/s);return this.slerp(t,l),this}identity(){return this.set(0,0,0,1)}invert(){return this.conjugate()}conjugate(){return this._x*=-1,this._y*=-1,this._z*=-1,this._onChangeCallback(),this}dot(t){return this._x*t._x+this._y*t._y+this._z*t._z+this._w*t._w}lengthSq(){return this._x*this._x+this._y*this._y+this._z*this._z+this._w*this._w}length(){return Math.sqrt(this._x*this._x+this._y*this._y+this._z*this._z+this._w*this._w)}normalize(){let t=this.length();return t===0?(this._x=0,this._y=0,this._z=0,this._w=1):(t=1/t,this._x=this._x*t,this._y=this._y*t,this._z=this._z*t,this._w=this._w*t),this._onChangeCallback(),this}multiply(t){return this.multiplyQuaternions(this,t)}premultiply(t){return this.multiplyQuaternions(t,this)}multiplyQuaternions(t,i){const s=t._x,l=t._y,c=t._z,h=t._w,d=i._x,m=i._y,p=i._z,v=i._w;return this._x=s*v+h*d+l*p-c*m,this._y=l*v+h*m+c*d-s*p,this._z=c*v+h*p+s*m-l*d,this._w=h*v-s*d-l*m-c*p,this._onChangeCallback(),this}slerp(t,i){let s=t._x,l=t._y,c=t._z,h=t._w,d=this.dot(t);d<0&&(s=-s,l=-l,c=-c,h=-h,d=-d);let m=1-i;if(d<.9995){const p=Math.acos(d),v=Math.sin(p);m=Math.sin(m*p)/v,i=Math.sin(i*p)/v,this._x=this._x*m+s*i,this._y=this._y*m+l*i,this._z=this._z*m+c*i,this._w=this._w*m+h*i,this._onChangeCallback()}else this._x=this._x*m+s*i,this._y=this._y*m+l*i,this._z=this._z*m+c*i,this._w=this._w*m+h*i,this.normalize();return this}slerpQuaternions(t,i,s){return this.copy(t).slerp(i,s)}random(){const t=2*Math.PI*Math.random(),i=2*Math.PI*Math.random(),s=Math.random(),l=Math.sqrt(1-s),c=Math.sqrt(s);return this.set(l*Math.sin(t),l*Math.cos(t),c*Math.sin(i),c*Math.cos(i))}equals(t){return t._x===this._x&&t._y===this._y&&t._z===this._z&&t._w===this._w}fromArray(t,i=0){return this._x=t[i],this._y=t[i+1],this._z=t[i+2],this._w=t[i+3],this._onChangeCallback(),this}toArray(t=[],i=0){return t[i]=this._x,t[i+1]=this._y,t[i+2]=this._z,t[i+3]=this._w,t}fromBufferAttribute(t,i){return this._x=t.getX(i),this._y=t.getY(i),this._z=t.getZ(i),this._w=t.getW(i),this._onChangeCallback(),this}toJSON(){return this.toArray()}_onChange(t){return this._onChangeCallback=t,this}_onChangeCallback(){}*[Symbol.iterator](){yield this._x,yield this._y,yield this._z,yield this._w}}class j{constructor(t=0,i=0,s=0){j.prototype.isVector3=!0,this.x=t,this.y=i,this.z=s}set(t,i,s){return s===void 0&&(s=this.z),this.x=t,this.y=i,this.z=s,this}setScalar(t){return this.x=t,this.y=t,this.z=t,this}setX(t){return this.x=t,this}setY(t){return this.y=t,this}setZ(t){return this.z=t,this}setComponent(t,i){switch(t){case 0:this.x=i;break;case 1:this.y=i;break;case 2:this.z=i;break;default:throw new Error("index is out of range: "+t)}return this}getComponent(t){switch(t){case 0:return this.x;case 1:return this.y;case 2:return this.z;default:throw new Error("index is out of range: "+t)}}clone(){return new this.constructor(this.x,this.y,this.z)}copy(t){return this.x=t.x,this.y=t.y,this.z=t.z,this}add(t){return this.x+=t.x,this.y+=t.y,this.z+=t.z,this}addScalar(t){return this.x+=t,this.y+=t,this.z+=t,this}addVectors(t,i){return this.x=t.x+i.x,this.y=t.y+i.y,this.z=t.z+i.z,this}addScaledVector(t,i){return this.x+=t.x*i,this.y+=t.y*i,this.z+=t.z*i,this}sub(t){return this.x-=t.x,this.y-=t.y,this.z-=t.z,this}subScalar(t){return this.x-=t,this.y-=t,this.z-=t,this}subVectors(t,i){return this.x=t.x-i.x,this.y=t.y-i.y,this.z=t.z-i.z,this}multiply(t){return this.x*=t.x,this.y*=t.y,this.z*=t.z,this}multiplyScalar(t){return this.x*=t,this.y*=t,this.z*=t,this}multiplyVectors(t,i){return this.x=t.x*i.x,this.y=t.y*i.y,this.z=t.z*i.z,this}applyEuler(t){return this.applyQuaternion(P_.setFromEuler(t))}applyAxisAngle(t,i){return this.applyQuaternion(P_.setFromAxisAngle(t,i))}applyMatrix3(t){const i=this.x,s=this.y,l=this.z,c=t.elements;return this.x=c[0]*i+c[3]*s+c[6]*l,this.y=c[1]*i+c[4]*s+c[7]*l,this.z=c[2]*i+c[5]*s+c[8]*l,this}applyNormalMatrix(t){return this.applyMatrix3(t).normalize()}applyMatrix4(t){const i=this.x,s=this.y,l=this.z,c=t.elements,h=1/(c[3]*i+c[7]*s+c[11]*l+c[15]);return this.x=(c[0]*i+c[4]*s+c[8]*l+c[12])*h,this.y=(c[1]*i+c[5]*s+c[9]*l+c[13])*h,this.z=(c[2]*i+c[6]*s+c[10]*l+c[14])*h,this}applyQuaternion(t){const i=this.x,s=this.y,l=this.z,c=t.x,h=t.y,d=t.z,m=t.w,p=2*(h*l-d*s),v=2*(d*i-c*l),g=2*(c*s-h*i);return this.x=i+m*p+h*g-d*v,this.y=s+m*v+d*p-c*g,this.z=l+m*g+c*v-h*p,this}project(t){return this.applyMatrix4(t.matrixWorldInverse).applyMatrix4(t.projectionMatrix)}unproject(t){return this.applyMatrix4(t.projectionMatrixInverse).applyMatrix4(t.matrixWorld)}transformDirection(t){const i=this.x,s=this.y,l=this.z,c=t.elements;return this.x=c[0]*i+c[4]*s+c[8]*l,this.y=c[1]*i+c[5]*s+c[9]*l,this.z=c[2]*i+c[6]*s+c[10]*l,this.normalize()}divide(t){return this.x/=t.x,this.y/=t.y,this.z/=t.z,this}divideScalar(t){return this.multiplyScalar(1/t)}min(t){return this.x=Math.min(this.x,t.x),this.y=Math.min(this.y,t.y),this.z=Math.min(this.z,t.z),this}max(t){return this.x=Math.max(this.x,t.x),this.y=Math.max(this.y,t.y),this.z=Math.max(this.z,t.z),this}clamp(t,i){return this.x=ce(this.x,t.x,i.x),this.y=ce(this.y,t.y,i.y),this.z=ce(this.z,t.z,i.z),this}clampScalar(t,i){return this.x=ce(this.x,t,i),this.y=ce(this.y,t,i),this.z=ce(this.z,t,i),this}clampLength(t,i){const s=this.length();return this.divideScalar(s||1).multiplyScalar(ce(s,t,i))}floor(){return this.x=Math.floor(this.x),this.y=Math.floor(this.y),this.z=Math.floor(this.z),this}ceil(){return this.x=Math.ceil(this.x),this.y=Math.ceil(this.y),this.z=Math.ceil(this.z),this}round(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this.z=Math.round(this.z),this}roundToZero(){return this.x=Math.trunc(this.x),this.y=Math.trunc(this.y),this.z=Math.trunc(this.z),this}negate(){return this.x=-this.x,this.y=-this.y,this.z=-this.z,this}dot(t){return this.x*t.x+this.y*t.y+this.z*t.z}lengthSq(){return this.x*this.x+this.y*this.y+this.z*this.z}length(){return Math.sqrt(this.x*this.x+this.y*this.y+this.z*this.z)}manhattanLength(){return Math.abs(this.x)+Math.abs(this.y)+Math.abs(this.z)}normalize(){return this.divideScalar(this.length()||1)}setLength(t){return this.normalize().multiplyScalar(t)}lerp(t,i){return this.x+=(t.x-this.x)*i,this.y+=(t.y-this.y)*i,this.z+=(t.z-this.z)*i,this}lerpVectors(t,i,s){return this.x=t.x+(i.x-t.x)*s,this.y=t.y+(i.y-t.y)*s,this.z=t.z+(i.z-t.z)*s,this}cross(t){return this.crossVectors(this,t)}crossVectors(t,i){const s=t.x,l=t.y,c=t.z,h=i.x,d=i.y,m=i.z;return this.x=l*m-c*d,this.y=c*h-s*m,this.z=s*d-l*h,this}projectOnVector(t){const i=t.lengthSq();if(i===0)return this.set(0,0,0);const s=t.dot(this)/i;return this.copy(t).multiplyScalar(s)}projectOnPlane(t){return kh.copy(this).projectOnVector(t),this.sub(kh)}reflect(t){return this.sub(kh.copy(t).multiplyScalar(2*this.dot(t)))}angleTo(t){const i=Math.sqrt(this.lengthSq()*t.lengthSq());if(i===0)return Math.PI/2;const s=this.dot(t)/i;return Math.acos(ce(s,-1,1))}distanceTo(t){return Math.sqrt(this.distanceToSquared(t))}distanceToSquared(t){const i=this.x-t.x,s=this.y-t.y,l=this.z-t.z;return i*i+s*s+l*l}manhattanDistanceTo(t){return Math.abs(this.x-t.x)+Math.abs(this.y-t.y)+Math.abs(this.z-t.z)}setFromSpherical(t){return this.setFromSphericalCoords(t.radius,t.phi,t.theta)}setFromSphericalCoords(t,i,s){const l=Math.sin(i)*t;return this.x=l*Math.sin(s),this.y=Math.cos(i)*t,this.z=l*Math.cos(s),this}setFromCylindrical(t){return this.setFromCylindricalCoords(t.radius,t.theta,t.y)}setFromCylindricalCoords(t,i,s){return this.x=t*Math.sin(i),this.y=s,this.z=t*Math.cos(i),this}setFromMatrixPosition(t){const i=t.elements;return this.x=i[12],this.y=i[13],this.z=i[14],this}setFromMatrixScale(t){const i=this.setFromMatrixColumn(t,0).length(),s=this.setFromMatrixColumn(t,1).length(),l=this.setFromMatrixColumn(t,2).length();return this.x=i,this.y=s,this.z=l,this}setFromMatrixColumn(t,i){return this.fromArray(t.elements,i*4)}setFromMatrix3Column(t,i){return this.fromArray(t.elements,i*3)}setFromEuler(t){return this.x=t._x,this.y=t._y,this.z=t._z,this}setFromColor(t){return this.x=t.r,this.y=t.g,this.z=t.b,this}equals(t){return t.x===this.x&&t.y===this.y&&t.z===this.z}fromArray(t,i=0){return this.x=t[i],this.y=t[i+1],this.z=t[i+2],this}toArray(t=[],i=0){return t[i]=this.x,t[i+1]=this.y,t[i+2]=this.z,t}fromBufferAttribute(t,i){return this.x=t.getX(i),this.y=t.getY(i),this.z=t.getZ(i),this}random(){return this.x=Math.random(),this.y=Math.random(),this.z=Math.random(),this}randomDirection(){const t=Math.random()*Math.PI*2,i=Math.random()*2-1,s=Math.sqrt(1-i*i);return this.x=s*Math.cos(t),this.y=i,this.z=s*Math.sin(t),this}*[Symbol.iterator](){yield this.x,yield this.y,yield this.z}}const kh=new j,P_=new Ss;class pe{constructor(t,i,s,l,c,h,d,m,p){pe.prototype.isMatrix3=!0,this.elements=[1,0,0,0,1,0,0,0,1],t!==void 0&&this.set(t,i,s,l,c,h,d,m,p)}set(t,i,s,l,c,h,d,m,p){const v=this.elements;return v[0]=t,v[1]=l,v[2]=d,v[3]=i,v[4]=c,v[5]=m,v[6]=s,v[7]=h,v[8]=p,this}identity(){return this.set(1,0,0,0,1,0,0,0,1),this}copy(t){const i=this.elements,s=t.elements;return i[0]=s[0],i[1]=s[1],i[2]=s[2],i[3]=s[3],i[4]=s[4],i[5]=s[5],i[6]=s[6],i[7]=s[7],i[8]=s[8],this}extractBasis(t,i,s){return t.setFromMatrix3Column(this,0),i.setFromMatrix3Column(this,1),s.setFromMatrix3Column(this,2),this}setFromMatrix4(t){const i=t.elements;return this.set(i[0],i[4],i[8],i[1],i[5],i[9],i[2],i[6],i[10]),this}multiply(t){return this.multiplyMatrices(this,t)}premultiply(t){return this.multiplyMatrices(t,this)}multiplyMatrices(t,i){const s=t.elements,l=i.elements,c=this.elements,h=s[0],d=s[3],m=s[6],p=s[1],v=s[4],g=s[7],_=s[2],M=s[5],E=s[8],A=l[0],y=l[3],S=l[6],w=l[1],D=l[4],U=l[7],H=l[2],F=l[5],I=l[8];return c[0]=h*A+d*w+m*H,c[3]=h*y+d*D+m*F,c[6]=h*S+d*U+m*I,c[1]=p*A+v*w+g*H,c[4]=p*y+v*D+g*F,c[7]=p*S+v*U+g*I,c[2]=_*A+M*w+E*H,c[5]=_*y+M*D+E*F,c[8]=_*S+M*U+E*I,this}multiplyScalar(t){const i=this.elements;return i[0]*=t,i[3]*=t,i[6]*=t,i[1]*=t,i[4]*=t,i[7]*=t,i[2]*=t,i[5]*=t,i[8]*=t,this}determinant(){const t=this.elements,i=t[0],s=t[1],l=t[2],c=t[3],h=t[4],d=t[5],m=t[6],p=t[7],v=t[8];return i*h*v-i*d*p-s*c*v+s*d*m+l*c*p-l*h*m}invert(){const t=this.elements,i=t[0],s=t[1],l=t[2],c=t[3],h=t[4],d=t[5],m=t[6],p=t[7],v=t[8],g=v*h-d*p,_=d*m-v*c,M=p*c-h*m,E=i*g+s*_+l*M;if(E===0)return this.set(0,0,0,0,0,0,0,0,0);const A=1/E;return t[0]=g*A,t[1]=(l*p-v*s)*A,t[2]=(d*s-l*h)*A,t[3]=_*A,t[4]=(v*i-l*m)*A,t[5]=(l*c-d*i)*A,t[6]=M*A,t[7]=(s*m-p*i)*A,t[8]=(h*i-s*c)*A,this}transpose(){let t;const i=this.elements;return t=i[1],i[1]=i[3],i[3]=t,t=i[2],i[2]=i[6],i[6]=t,t=i[5],i[5]=i[7],i[7]=t,this}getNormalMatrix(t){return this.setFromMatrix4(t).invert().transpose()}transposeIntoArray(t){const i=this.elements;return t[0]=i[0],t[1]=i[3],t[2]=i[6],t[3]=i[1],t[4]=i[4],t[5]=i[7],t[6]=i[2],t[7]=i[5],t[8]=i[8],this}setUvTransform(t,i,s,l,c,h,d){const m=Math.cos(c),p=Math.sin(c);return this.set(s*m,s*p,-s*(m*h+p*d)+h+t,-l*p,l*m,-l*(-p*h+m*d)+d+i,0,0,1),this}scale(t,i){return this.premultiply(Xh.makeScale(t,i)),this}rotate(t){return this.premultiply(Xh.makeRotation(-t)),this}translate(t,i){return this.premultiply(Xh.makeTranslation(t,i)),this}makeTranslation(t,i){return t.isVector2?this.set(1,0,t.x,0,1,t.y,0,0,1):this.set(1,0,t,0,1,i,0,0,1),this}makeRotation(t){const i=Math.cos(t),s=Math.sin(t);return this.set(i,-s,0,s,i,0,0,0,1),this}makeScale(t,i){return this.set(t,0,0,0,i,0,0,0,1),this}equals(t){const i=this.elements,s=t.elements;for(let l=0;l<9;l++)if(i[l]!==s[l])return!1;return!0}fromArray(t,i=0){for(let s=0;s<9;s++)this.elements[s]=t[s+i];return this}toArray(t=[],i=0){const s=this.elements;return t[i]=s[0],t[i+1]=s[1],t[i+2]=s[2],t[i+3]=s[3],t[i+4]=s[4],t[i+5]=s[5],t[i+6]=s[6],t[i+7]=s[7],t[i+8]=s[8],t}clone(){return new this.constructor().fromArray(this.elements)}}const Xh=new pe,z_=new pe().set(.4123908,.3575843,.1804808,.212639,.7151687,.0721923,.0193308,.1191948,.9505322),I_=new pe().set(3.2409699,-1.5373832,-.4986108,-.9692436,1.8759675,.0415551,.0556301,-.203977,1.0569715);function qM(){const r={enabled:!0,workingColorSpace:ro,spaces:{},convert:function(l,c,h){return this.enabled===!1||c===h||!c||!h||(this.spaces[c].transfer===Fe&&(l.r=Oa(l.r),l.g=Oa(l.g),l.b=Oa(l.b)),this.spaces[c].primaries!==this.spaces[h].primaries&&(l.applyMatrix3(this.spaces[c].toXYZ),l.applyMatrix3(this.spaces[h].fromXYZ)),this.spaces[h].transfer===Fe&&(l.r=no(l.r),l.g=no(l.g),l.b=no(l.b))),l},workingToColorSpace:function(l,c){return this.convert(l,this.workingColorSpace,c)},colorSpaceToWorking:function(l,c){return this.convert(l,c,this.workingColorSpace)},getPrimaries:function(l){return this.spaces[l].primaries},getTransfer:function(l){return l===gs?vu:this.spaces[l].transfer},getToneMappingMode:function(l){return this.spaces[l].outputColorSpaceConfig.toneMappingMode||"standard"},getLuminanceCoefficients:function(l,c=this.workingColorSpace){return l.fromArray(this.spaces[c].luminanceCoefficients)},define:function(l){Object.assign(this.spaces,l)},_getMatrix:function(l,c,h){return l.copy(this.spaces[c].toXYZ).multiply(this.spaces[h].fromXYZ)},_getDrawingBufferColorSpace:function(l){return this.spaces[l].outputColorSpaceConfig.drawingBufferColorSpace},_getUnpackColorSpace:function(l=this.workingColorSpace){return this.spaces[l].workingColorSpaceConfig.unpackColorSpace},fromWorkingColorSpace:function(l,c){return yu("ColorManagement: .fromWorkingColorSpace() has been renamed to .workingToColorSpace()."),r.workingToColorSpace(l,c)},toWorkingColorSpace:function(l,c){return yu("ColorManagement: .toWorkingColorSpace() has been renamed to .colorSpaceToWorking()."),r.colorSpaceToWorking(l,c)}},t=[.64,.33,.3,.6,.15,.06],i=[.2126,.7152,.0722],s=[.3127,.329];return r.define({[ro]:{primaries:t,whitePoint:s,transfer:vu,toXYZ:z_,fromXYZ:I_,luminanceCoefficients:i,workingColorSpaceConfig:{unpackColorSpace:Ai},outputColorSpaceConfig:{drawingBufferColorSpace:Ai}},[Ai]:{primaries:t,whitePoint:s,transfer:Fe,toXYZ:z_,fromXYZ:I_,luminanceCoefficients:i,outputColorSpaceConfig:{drawingBufferColorSpace:Ai}}}),r}const Re=qM();function Oa(r){return r<.04045?r*.0773993808:Math.pow(r*.9478672986+.0521327014,2.4)}function no(r){return r<.0031308?r*12.92:1.055*Math.pow(r,.41666)-.055}let Ir;class YM{static getDataURL(t,i="image/png"){if(/^data:/i.test(t.src)||typeof HTMLCanvasElement>"u")return t.src;let s;if(t instanceof HTMLCanvasElement)s=t;else{Ir===void 0&&(Ir=xu("canvas")),Ir.width=t.width,Ir.height=t.height;const l=Ir.getContext("2d");t instanceof ImageData?l.putImageData(t,0,0):l.drawImage(t,0,0,t.width,t.height),s=Ir}return s.toDataURL(i)}static sRGBToLinear(t){if(typeof HTMLImageElement<"u"&&t instanceof HTMLImageElement||typeof HTMLCanvasElement<"u"&&t instanceof HTMLCanvasElement||typeof ImageBitmap<"u"&&t instanceof ImageBitmap){const i=xu("canvas");i.width=t.width,i.height=t.height;const s=i.getContext("2d");s.drawImage(t,0,0,t.width,t.height);const l=s.getImageData(0,0,t.width,t.height),c=l.data;for(let h=0;h<c.length;h++)c[h]=Oa(c[h]/255)*255;return s.putImageData(l,0,0),i}else if(t.data){const i=t.data.slice(0);for(let s=0;s<i.length;s++)i instanceof Uint8Array||i instanceof Uint8ClampedArray?i[s]=Math.floor(Oa(i[s]/255)*255):i[s]=Oa(i[s]);return{data:i,width:t.width,height:t.height}}else return ee("ImageUtils.sRGBToLinear(): Unsupported image type. No color space conversion applied."),t}}let jM=0;class Up{constructor(t=null){this.isSource=!0,Object.defineProperty(this,"id",{value:jM++}),this.uuid=Na(),this.data=t,this.dataReady=!0,this.version=0}getSize(t){const i=this.data;return typeof HTMLVideoElement<"u"&&i instanceof HTMLVideoElement?t.set(i.videoWidth,i.videoHeight,0):typeof VideoFrame<"u"&&i instanceof VideoFrame?t.set(i.displayHeight,i.displayWidth,0):i!==null?t.set(i.width,i.height,i.depth||0):t.set(0,0,0),t}set needsUpdate(t){t===!0&&this.version++}toJSON(t){const i=t===void 0||typeof t=="string";if(!i&&t.images[this.uuid]!==void 0)return t.images[this.uuid];const s={uuid:this.uuid,url:""},l=this.data;if(l!==null){let c;if(Array.isArray(l)){c=[];for(let h=0,d=l.length;h<d;h++)l[h].isDataTexture?c.push(Wh(l[h].image)):c.push(Wh(l[h]))}else c=Wh(l);s.url=c}return i||(t.images[this.uuid]=s),s}}function Wh(r){return typeof HTMLImageElement<"u"&&r instanceof HTMLImageElement||typeof HTMLCanvasElement<"u"&&r instanceof HTMLCanvasElement||typeof ImageBitmap<"u"&&r instanceof ImageBitmap?YM.getDataURL(r):r.data?{data:Array.from(r.data),width:r.width,height:r.height,type:r.data.constructor.name}:(ee("Texture: Unable to serialize Texture."),{})}let ZM=0;const qh=new j;class Wn extends $s{constructor(t=Wn.DEFAULT_IMAGE,i=Wn.DEFAULT_MAPPING,s=Ua,l=Ua,c=zn,h=Zs,d=Vi,m=di,p=Wn.DEFAULT_ANISOTROPY,v=gs){super(),this.isTexture=!0,Object.defineProperty(this,"id",{value:ZM++}),this.uuid=Na(),this.name="",this.source=new Up(t),this.mipmaps=[],this.mapping=i,this.channel=0,this.wrapS=s,this.wrapT=l,this.magFilter=c,this.minFilter=h,this.anisotropy=p,this.format=d,this.internalFormat=null,this.type=m,this.offset=new le(0,0),this.repeat=new le(1,1),this.center=new le(0,0),this.rotation=0,this.matrixAutoUpdate=!0,this.matrix=new pe,this.generateMipmaps=!0,this.premultiplyAlpha=!1,this.flipY=!0,this.unpackAlignment=4,this.colorSpace=v,this.userData={},this.updateRanges=[],this.version=0,this.onUpdate=null,this.renderTarget=null,this.isRenderTargetTexture=!1,this.isArrayTexture=!!(t&&t.depth&&t.depth>1),this.pmremVersion=0}get width(){return this.source.getSize(qh).x}get height(){return this.source.getSize(qh).y}get depth(){return this.source.getSize(qh).z}get image(){return this.source.data}set image(t=null){this.source.data=t}updateMatrix(){this.matrix.setUvTransform(this.offset.x,this.offset.y,this.repeat.x,this.repeat.y,this.rotation,this.center.x,this.center.y)}addUpdateRange(t,i){this.updateRanges.push({start:t,count:i})}clearUpdateRanges(){this.updateRanges.length=0}clone(){return new this.constructor().copy(this)}copy(t){return this.name=t.name,this.source=t.source,this.mipmaps=t.mipmaps.slice(0),this.mapping=t.mapping,this.channel=t.channel,this.wrapS=t.wrapS,this.wrapT=t.wrapT,this.magFilter=t.magFilter,this.minFilter=t.minFilter,this.anisotropy=t.anisotropy,this.format=t.format,this.internalFormat=t.internalFormat,this.type=t.type,this.offset.copy(t.offset),this.repeat.copy(t.repeat),this.center.copy(t.center),this.rotation=t.rotation,this.matrixAutoUpdate=t.matrixAutoUpdate,this.matrix.copy(t.matrix),this.generateMipmaps=t.generateMipmaps,this.premultiplyAlpha=t.premultiplyAlpha,this.flipY=t.flipY,this.unpackAlignment=t.unpackAlignment,this.colorSpace=t.colorSpace,this.renderTarget=t.renderTarget,this.isRenderTargetTexture=t.isRenderTargetTexture,this.isArrayTexture=t.isArrayTexture,this.userData=JSON.parse(JSON.stringify(t.userData)),this.needsUpdate=!0,this}setValues(t){for(const i in t){const s=t[i];if(s===void 0){ee(`Texture.setValues(): parameter '${i}' has value of undefined.`);continue}const l=this[i];if(l===void 0){ee(`Texture.setValues(): property '${i}' does not exist.`);continue}l&&s&&l.isVector2&&s.isVector2||l&&s&&l.isVector3&&s.isVector3||l&&s&&l.isMatrix3&&s.isMatrix3?l.copy(s):this[i]=s}}toJSON(t){const i=t===void 0||typeof t=="string";if(!i&&t.textures[this.uuid]!==void 0)return t.textures[this.uuid];const s={metadata:{version:4.7,type:"Texture",generator:"Texture.toJSON"},uuid:this.uuid,name:this.name,image:this.source.toJSON(t).uuid,mapping:this.mapping,channel:this.channel,repeat:[this.repeat.x,this.repeat.y],offset:[this.offset.x,this.offset.y],center:[this.center.x,this.center.y],rotation:this.rotation,wrap:[this.wrapS,this.wrapT],format:this.format,internalFormat:this.internalFormat,type:this.type,colorSpace:this.colorSpace,minFilter:this.minFilter,magFilter:this.magFilter,anisotropy:this.anisotropy,flipY:this.flipY,generateMipmaps:this.generateMipmaps,premultiplyAlpha:this.premultiplyAlpha,unpackAlignment:this.unpackAlignment};return Object.keys(this.userData).length>0&&(s.userData=this.userData),i||(t.textures[this.uuid]=s),s}dispose(){this.dispatchEvent({type:"dispose"})}transformUv(t){if(this.mapping!==Qv)return t;if(t.applyMatrix3(this.matrix),t.x<0||t.x>1)switch(this.wrapS){case Nd:t.x=t.x-Math.floor(t.x);break;case Ua:t.x=t.x<0?0:1;break;case Od:Math.abs(Math.floor(t.x)%2)===1?t.x=Math.ceil(t.x)-t.x:t.x=t.x-Math.floor(t.x);break}if(t.y<0||t.y>1)switch(this.wrapT){case Nd:t.y=t.y-Math.floor(t.y);break;case Ua:t.y=t.y<0?0:1;break;case Od:Math.abs(Math.floor(t.y)%2)===1?t.y=Math.ceil(t.y)-t.y:t.y=t.y-Math.floor(t.y);break}return this.flipY&&(t.y=1-t.y),t}set needsUpdate(t){t===!0&&(this.version++,this.source.needsUpdate=!0)}set needsPMREMUpdate(t){t===!0&&this.pmremVersion++}}Wn.DEFAULT_IMAGE=null;Wn.DEFAULT_MAPPING=Qv;Wn.DEFAULT_ANISOTROPY=1;class We{constructor(t=0,i=0,s=0,l=1){We.prototype.isVector4=!0,this.x=t,this.y=i,this.z=s,this.w=l}get width(){return this.z}set width(t){this.z=t}get height(){return this.w}set height(t){this.w=t}set(t,i,s,l){return this.x=t,this.y=i,this.z=s,this.w=l,this}setScalar(t){return this.x=t,this.y=t,this.z=t,this.w=t,this}setX(t){return this.x=t,this}setY(t){return this.y=t,this}setZ(t){return this.z=t,this}setW(t){return this.w=t,this}setComponent(t,i){switch(t){case 0:this.x=i;break;case 1:this.y=i;break;case 2:this.z=i;break;case 3:this.w=i;break;default:throw new Error("index is out of range: "+t)}return this}getComponent(t){switch(t){case 0:return this.x;case 1:return this.y;case 2:return this.z;case 3:return this.w;default:throw new Error("index is out of range: "+t)}}clone(){return new this.constructor(this.x,this.y,this.z,this.w)}copy(t){return this.x=t.x,this.y=t.y,this.z=t.z,this.w=t.w!==void 0?t.w:1,this}add(t){return this.x+=t.x,this.y+=t.y,this.z+=t.z,this.w+=t.w,this}addScalar(t){return this.x+=t,this.y+=t,this.z+=t,this.w+=t,this}addVectors(t,i){return this.x=t.x+i.x,this.y=t.y+i.y,this.z=t.z+i.z,this.w=t.w+i.w,this}addScaledVector(t,i){return this.x+=t.x*i,this.y+=t.y*i,this.z+=t.z*i,this.w+=t.w*i,this}sub(t){return this.x-=t.x,this.y-=t.y,this.z-=t.z,this.w-=t.w,this}subScalar(t){return this.x-=t,this.y-=t,this.z-=t,this.w-=t,this}subVectors(t,i){return this.x=t.x-i.x,this.y=t.y-i.y,this.z=t.z-i.z,this.w=t.w-i.w,this}multiply(t){return this.x*=t.x,this.y*=t.y,this.z*=t.z,this.w*=t.w,this}multiplyScalar(t){return this.x*=t,this.y*=t,this.z*=t,this.w*=t,this}applyMatrix4(t){const i=this.x,s=this.y,l=this.z,c=this.w,h=t.elements;return this.x=h[0]*i+h[4]*s+h[8]*l+h[12]*c,this.y=h[1]*i+h[5]*s+h[9]*l+h[13]*c,this.z=h[2]*i+h[6]*s+h[10]*l+h[14]*c,this.w=h[3]*i+h[7]*s+h[11]*l+h[15]*c,this}divide(t){return this.x/=t.x,this.y/=t.y,this.z/=t.z,this.w/=t.w,this}divideScalar(t){return this.multiplyScalar(1/t)}setAxisAngleFromQuaternion(t){this.w=2*Math.acos(t.w);const i=Math.sqrt(1-t.w*t.w);return i<1e-4?(this.x=1,this.y=0,this.z=0):(this.x=t.x/i,this.y=t.y/i,this.z=t.z/i),this}setAxisAngleFromRotationMatrix(t){let i,s,l,c;const m=t.elements,p=m[0],v=m[4],g=m[8],_=m[1],M=m[5],E=m[9],A=m[2],y=m[6],S=m[10];if(Math.abs(v-_)<.01&&Math.abs(g-A)<.01&&Math.abs(E-y)<.01){if(Math.abs(v+_)<.1&&Math.abs(g+A)<.1&&Math.abs(E+y)<.1&&Math.abs(p+M+S-3)<.1)return this.set(1,0,0,0),this;i=Math.PI;const D=(p+1)/2,U=(M+1)/2,H=(S+1)/2,F=(v+_)/4,I=(g+A)/4,T=(E+y)/4;return D>U&&D>H?D<.01?(s=0,l=.707106781,c=.707106781):(s=Math.sqrt(D),l=F/s,c=I/s):U>H?U<.01?(s=.707106781,l=0,c=.707106781):(l=Math.sqrt(U),s=F/l,c=T/l):H<.01?(s=.707106781,l=.707106781,c=0):(c=Math.sqrt(H),s=I/c,l=T/c),this.set(s,l,c,i),this}let w=Math.sqrt((y-E)*(y-E)+(g-A)*(g-A)+(_-v)*(_-v));return Math.abs(w)<.001&&(w=1),this.x=(y-E)/w,this.y=(g-A)/w,this.z=(_-v)/w,this.w=Math.acos((p+M+S-1)/2),this}setFromMatrixPosition(t){const i=t.elements;return this.x=i[12],this.y=i[13],this.z=i[14],this.w=i[15],this}min(t){return this.x=Math.min(this.x,t.x),this.y=Math.min(this.y,t.y),this.z=Math.min(this.z,t.z),this.w=Math.min(this.w,t.w),this}max(t){return this.x=Math.max(this.x,t.x),this.y=Math.max(this.y,t.y),this.z=Math.max(this.z,t.z),this.w=Math.max(this.w,t.w),this}clamp(t,i){return this.x=ce(this.x,t.x,i.x),this.y=ce(this.y,t.y,i.y),this.z=ce(this.z,t.z,i.z),this.w=ce(this.w,t.w,i.w),this}clampScalar(t,i){return this.x=ce(this.x,t,i),this.y=ce(this.y,t,i),this.z=ce(this.z,t,i),this.w=ce(this.w,t,i),this}clampLength(t,i){const s=this.length();return this.divideScalar(s||1).multiplyScalar(ce(s,t,i))}floor(){return this.x=Math.floor(this.x),this.y=Math.floor(this.y),this.z=Math.floor(this.z),this.w=Math.floor(this.w),this}ceil(){return this.x=Math.ceil(this.x),this.y=Math.ceil(this.y),this.z=Math.ceil(this.z),this.w=Math.ceil(this.w),this}round(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this.z=Math.round(this.z),this.w=Math.round(this.w),this}roundToZero(){return this.x=Math.trunc(this.x),this.y=Math.trunc(this.y),this.z=Math.trunc(this.z),this.w=Math.trunc(this.w),this}negate(){return this.x=-this.x,this.y=-this.y,this.z=-this.z,this.w=-this.w,this}dot(t){return this.x*t.x+this.y*t.y+this.z*t.z+this.w*t.w}lengthSq(){return this.x*this.x+this.y*this.y+this.z*this.z+this.w*this.w}length(){return Math.sqrt(this.x*this.x+this.y*this.y+this.z*this.z+this.w*this.w)}manhattanLength(){return Math.abs(this.x)+Math.abs(this.y)+Math.abs(this.z)+Math.abs(this.w)}normalize(){return this.divideScalar(this.length()||1)}setLength(t){return this.normalize().multiplyScalar(t)}lerp(t,i){return this.x+=(t.x-this.x)*i,this.y+=(t.y-this.y)*i,this.z+=(t.z-this.z)*i,this.w+=(t.w-this.w)*i,this}lerpVectors(t,i,s){return this.x=t.x+(i.x-t.x)*s,this.y=t.y+(i.y-t.y)*s,this.z=t.z+(i.z-t.z)*s,this.w=t.w+(i.w-t.w)*s,this}equals(t){return t.x===this.x&&t.y===this.y&&t.z===this.z&&t.w===this.w}fromArray(t,i=0){return this.x=t[i],this.y=t[i+1],this.z=t[i+2],this.w=t[i+3],this}toArray(t=[],i=0){return t[i]=this.x,t[i+1]=this.y,t[i+2]=this.z,t[i+3]=this.w,t}fromBufferAttribute(t,i){return this.x=t.getX(i),this.y=t.getY(i),this.z=t.getZ(i),this.w=t.getW(i),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 KM extends $s{constructor(t=1,i=1,s={}){super(),s=Object.assign({generateMipmaps:!1,internalFormat:null,minFilter:zn,depthBuffer:!0,stencilBuffer:!1,resolveDepthBuffer:!0,resolveStencilBuffer:!0,depthTexture:null,samples:0,count:1,depth:1,multiview:!1},s),this.isRenderTarget=!0,this.width=t,this.height=i,this.depth=s.depth,this.scissor=new We(0,0,t,i),this.scissorTest=!1,this.viewport=new We(0,0,t,i),this.textures=[];const l={width:t,height:i,depth:s.depth},c=new Wn(l),h=s.count;for(let d=0;d<h;d++)this.textures[d]=c.clone(),this.textures[d].isRenderTargetTexture=!0,this.textures[d].renderTarget=this;this._setTextureOptions(s),this.depthBuffer=s.depthBuffer,this.stencilBuffer=s.stencilBuffer,this.resolveDepthBuffer=s.resolveDepthBuffer,this.resolveStencilBuffer=s.resolveStencilBuffer,this._depthTexture=null,this.depthTexture=s.depthTexture,this.samples=s.samples,this.multiview=s.multiview}_setTextureOptions(t={}){const i={minFilter:zn,generateMipmaps:!1,flipY:!1,internalFormat:null};t.mapping!==void 0&&(i.mapping=t.mapping),t.wrapS!==void 0&&(i.wrapS=t.wrapS),t.wrapT!==void 0&&(i.wrapT=t.wrapT),t.wrapR!==void 0&&(i.wrapR=t.wrapR),t.magFilter!==void 0&&(i.magFilter=t.magFilter),t.minFilter!==void 0&&(i.minFilter=t.minFilter),t.format!==void 0&&(i.format=t.format),t.type!==void 0&&(i.type=t.type),t.anisotropy!==void 0&&(i.anisotropy=t.anisotropy),t.colorSpace!==void 0&&(i.colorSpace=t.colorSpace),t.flipY!==void 0&&(i.flipY=t.flipY),t.generateMipmaps!==void 0&&(i.generateMipmaps=t.generateMipmaps),t.internalFormat!==void 0&&(i.internalFormat=t.internalFormat);for(let s=0;s<this.textures.length;s++)this.textures[s].setValues(i)}get texture(){return this.textures[0]}set texture(t){this.textures[0]=t}set depthTexture(t){this._depthTexture!==null&&(this._depthTexture.renderTarget=null),t!==null&&(t.renderTarget=this),this._depthTexture=t}get depthTexture(){return this._depthTexture}setSize(t,i,s=1){if(this.width!==t||this.height!==i||this.depth!==s){this.width=t,this.height=i,this.depth=s;for(let l=0,c=this.textures.length;l<c;l++)this.textures[l].image.width=t,this.textures[l].image.height=i,this.textures[l].image.depth=s,this.textures[l].isData3DTexture!==!0&&(this.textures[l].isArrayTexture=this.textures[l].image.depth>1);this.dispose()}this.viewport.set(0,0,t,i),this.scissor.set(0,0,t,i)}clone(){return new this.constructor().copy(this)}copy(t){this.width=t.width,this.height=t.height,this.depth=t.depth,this.scissor.copy(t.scissor),this.scissorTest=t.scissorTest,this.viewport.copy(t.viewport),this.textures.length=0;for(let i=0,s=t.textures.length;i<s;i++){this.textures[i]=t.textures[i].clone(),this.textures[i].isRenderTargetTexture=!0,this.textures[i].renderTarget=this;const l=Object.assign({},t.textures[i].image);this.textures[i].source=new Up(l)}return this.depthBuffer=t.depthBuffer,this.stencilBuffer=t.stencilBuffer,this.resolveDepthBuffer=t.resolveDepthBuffer,this.resolveStencilBuffer=t.resolveStencilBuffer,t.depthTexture!==null&&(this.depthTexture=t.depthTexture.clone()),this.samples=t.samples,this}dispose(){this.dispatchEvent({type:"dispose"})}}class ia extends KM{constructor(t=1,i=1,s={}){super(t,i,s),this.isWebGLRenderTarget=!0}}class lx extends Wn{constructor(t=null,i=1,s=1,l=1){super(null),this.isDataArrayTexture=!0,this.image={data:t,width:i,height:s,depth:l},this.magFilter=Dn,this.minFilter=Dn,this.wrapR=Ua,this.generateMipmaps=!1,this.flipY=!1,this.unpackAlignment=1,this.layerUpdates=new Set}addLayerUpdate(t){this.layerUpdates.add(t)}clearLayerUpdates(){this.layerUpdates.clear()}}class QM extends Wn{constructor(t=null,i=1,s=1,l=1){super(null),this.isData3DTexture=!0,this.image={data:t,width:i,height:s,depth:l},this.magFilter=Dn,this.minFilter=Dn,this.wrapR=Ua,this.generateMipmaps=!1,this.flipY=!1,this.unpackAlignment=1}}class Je{constructor(t,i,s,l,c,h,d,m,p,v,g,_,M,E,A,y){Je.prototype.isMatrix4=!0,this.elements=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1],t!==void 0&&this.set(t,i,s,l,c,h,d,m,p,v,g,_,M,E,A,y)}set(t,i,s,l,c,h,d,m,p,v,g,_,M,E,A,y){const S=this.elements;return S[0]=t,S[4]=i,S[8]=s,S[12]=l,S[1]=c,S[5]=h,S[9]=d,S[13]=m,S[2]=p,S[6]=v,S[10]=g,S[14]=_,S[3]=M,S[7]=E,S[11]=A,S[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 Je().fromArray(this.elements)}copy(t){const i=this.elements,s=t.elements;return i[0]=s[0],i[1]=s[1],i[2]=s[2],i[3]=s[3],i[4]=s[4],i[5]=s[5],i[6]=s[6],i[7]=s[7],i[8]=s[8],i[9]=s[9],i[10]=s[10],i[11]=s[11],i[12]=s[12],i[13]=s[13],i[14]=s[14],i[15]=s[15],this}copyPosition(t){const i=this.elements,s=t.elements;return i[12]=s[12],i[13]=s[13],i[14]=s[14],this}setFromMatrix3(t){const i=t.elements;return this.set(i[0],i[3],i[6],0,i[1],i[4],i[7],0,i[2],i[5],i[8],0,0,0,0,1),this}extractBasis(t,i,s){return this.determinant()===0?(t.set(1,0,0),i.set(0,1,0),s.set(0,0,1),this):(t.setFromMatrixColumn(this,0),i.setFromMatrixColumn(this,1),s.setFromMatrixColumn(this,2),this)}makeBasis(t,i,s){return this.set(t.x,i.x,s.x,0,t.y,i.y,s.y,0,t.z,i.z,s.z,0,0,0,0,1),this}extractRotation(t){if(t.determinant()===0)return this.identity();const i=this.elements,s=t.elements,l=1/Fr.setFromMatrixColumn(t,0).length(),c=1/Fr.setFromMatrixColumn(t,1).length(),h=1/Fr.setFromMatrixColumn(t,2).length();return i[0]=s[0]*l,i[1]=s[1]*l,i[2]=s[2]*l,i[3]=0,i[4]=s[4]*c,i[5]=s[5]*c,i[6]=s[6]*c,i[7]=0,i[8]=s[8]*h,i[9]=s[9]*h,i[10]=s[10]*h,i[11]=0,i[12]=0,i[13]=0,i[14]=0,i[15]=1,this}makeRotationFromEuler(t){const i=this.elements,s=t.x,l=t.y,c=t.z,h=Math.cos(s),d=Math.sin(s),m=Math.cos(l),p=Math.sin(l),v=Math.cos(c),g=Math.sin(c);if(t.order==="XYZ"){const _=h*v,M=h*g,E=d*v,A=d*g;i[0]=m*v,i[4]=-m*g,i[8]=p,i[1]=M+E*p,i[5]=_-A*p,i[9]=-d*m,i[2]=A-_*p,i[6]=E+M*p,i[10]=h*m}else if(t.order==="YXZ"){const _=m*v,M=m*g,E=p*v,A=p*g;i[0]=_+A*d,i[4]=E*d-M,i[8]=h*p,i[1]=h*g,i[5]=h*v,i[9]=-d,i[2]=M*d-E,i[6]=A+_*d,i[10]=h*m}else if(t.order==="ZXY"){const _=m*v,M=m*g,E=p*v,A=p*g;i[0]=_-A*d,i[4]=-h*g,i[8]=E+M*d,i[1]=M+E*d,i[5]=h*v,i[9]=A-_*d,i[2]=-h*p,i[6]=d,i[10]=h*m}else if(t.order==="ZYX"){const _=h*v,M=h*g,E=d*v,A=d*g;i[0]=m*v,i[4]=E*p-M,i[8]=_*p+A,i[1]=m*g,i[5]=A*p+_,i[9]=M*p-E,i[2]=-p,i[6]=d*m,i[10]=h*m}else if(t.order==="YZX"){const _=h*m,M=h*p,E=d*m,A=d*p;i[0]=m*v,i[4]=A-_*g,i[8]=E*g+M,i[1]=g,i[5]=h*v,i[9]=-d*v,i[2]=-p*v,i[6]=M*g+E,i[10]=_-A*g}else if(t.order==="XZY"){const _=h*m,M=h*p,E=d*m,A=d*p;i[0]=m*v,i[4]=-g,i[8]=p*v,i[1]=_*g+A,i[5]=h*v,i[9]=M*g-E,i[2]=E*g-M,i[6]=d*v,i[10]=A*g+_}return i[3]=0,i[7]=0,i[11]=0,i[12]=0,i[13]=0,i[14]=0,i[15]=1,this}makeRotationFromQuaternion(t){return this.compose(JM,t,$M)}lookAt(t,i,s){const l=this.elements;return ui.subVectors(t,i),ui.lengthSq()===0&&(ui.z=1),ui.normalize(),cs.crossVectors(s,ui),cs.lengthSq()===0&&(Math.abs(s.z)===1?ui.x+=1e-4:ui.z+=1e-4,ui.normalize(),cs.crossVectors(s,ui)),cs.normalize(),Pc.crossVectors(ui,cs),l[0]=cs.x,l[4]=Pc.x,l[8]=ui.x,l[1]=cs.y,l[5]=Pc.y,l[9]=ui.y,l[2]=cs.z,l[6]=Pc.z,l[10]=ui.z,this}multiply(t){return this.multiplyMatrices(this,t)}premultiply(t){return this.multiplyMatrices(t,this)}multiplyMatrices(t,i){const s=t.elements,l=i.elements,c=this.elements,h=s[0],d=s[4],m=s[8],p=s[12],v=s[1],g=s[5],_=s[9],M=s[13],E=s[2],A=s[6],y=s[10],S=s[14],w=s[3],D=s[7],U=s[11],H=s[15],F=l[0],I=l[4],T=l[8],L=l[12],Q=l[1],P=l[5],W=l[9],J=l[13],rt=l[2],et=l[6],O=l[10],B=l[14],at=l[3],$=l[7],lt=l[11],N=l[15];return c[0]=h*F+d*Q+m*rt+p*at,c[4]=h*I+d*P+m*et+p*$,c[8]=h*T+d*W+m*O+p*lt,c[12]=h*L+d*J+m*B+p*N,c[1]=v*F+g*Q+_*rt+M*at,c[5]=v*I+g*P+_*et+M*$,c[9]=v*T+g*W+_*O+M*lt,c[13]=v*L+g*J+_*B+M*N,c[2]=E*F+A*Q+y*rt+S*at,c[6]=E*I+A*P+y*et+S*$,c[10]=E*T+A*W+y*O+S*lt,c[14]=E*L+A*J+y*B+S*N,c[3]=w*F+D*Q+U*rt+H*at,c[7]=w*I+D*P+U*et+H*$,c[11]=w*T+D*W+U*O+H*lt,c[15]=w*L+D*J+U*B+H*N,this}multiplyScalar(t){const i=this.elements;return i[0]*=t,i[4]*=t,i[8]*=t,i[12]*=t,i[1]*=t,i[5]*=t,i[9]*=t,i[13]*=t,i[2]*=t,i[6]*=t,i[10]*=t,i[14]*=t,i[3]*=t,i[7]*=t,i[11]*=t,i[15]*=t,this}determinant(){const t=this.elements,i=t[0],s=t[4],l=t[8],c=t[12],h=t[1],d=t[5],m=t[9],p=t[13],v=t[2],g=t[6],_=t[10],M=t[14],E=t[3],A=t[7],y=t[11],S=t[15],w=m*M-p*_,D=d*M-p*g,U=d*_-m*g,H=h*M-p*v,F=h*_-m*v,I=h*g-d*v;return i*(A*w-y*D+S*U)-s*(E*w-y*H+S*F)+l*(E*D-A*H+S*I)-c*(E*U-A*F+y*I)}transpose(){const t=this.elements;let i;return i=t[1],t[1]=t[4],t[4]=i,i=t[2],t[2]=t[8],t[8]=i,i=t[6],t[6]=t[9],t[9]=i,i=t[3],t[3]=t[12],t[12]=i,i=t[7],t[7]=t[13],t[13]=i,i=t[11],t[11]=t[14],t[14]=i,this}setPosition(t,i,s){const l=this.elements;return t.isVector3?(l[12]=t.x,l[13]=t.y,l[14]=t.z):(l[12]=t,l[13]=i,l[14]=s),this}invert(){const t=this.elements,i=t[0],s=t[1],l=t[2],c=t[3],h=t[4],d=t[5],m=t[6],p=t[7],v=t[8],g=t[9],_=t[10],M=t[11],E=t[12],A=t[13],y=t[14],S=t[15],w=i*d-s*h,D=i*m-l*h,U=i*p-c*h,H=s*m-l*d,F=s*p-c*d,I=l*p-c*m,T=v*A-g*E,L=v*y-_*E,Q=v*S-M*E,P=g*y-_*A,W=g*S-M*A,J=_*S-M*y,rt=w*J-D*W+U*P+H*Q-F*L+I*T;if(rt===0)return this.set(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0);const et=1/rt;return t[0]=(d*J-m*W+p*P)*et,t[1]=(l*W-s*J-c*P)*et,t[2]=(A*I-y*F+S*H)*et,t[3]=(_*F-g*I-M*H)*et,t[4]=(m*Q-h*J-p*L)*et,t[5]=(i*J-l*Q+c*L)*et,t[6]=(y*U-E*I-S*D)*et,t[7]=(v*I-_*U+M*D)*et,t[8]=(h*W-d*Q+p*T)*et,t[9]=(s*Q-i*W-c*T)*et,t[10]=(E*F-A*U+S*w)*et,t[11]=(g*U-v*F-M*w)*et,t[12]=(d*L-h*P-m*T)*et,t[13]=(i*P-s*L+l*T)*et,t[14]=(A*D-E*H-y*w)*et,t[15]=(v*H-g*D+_*w)*et,this}scale(t){const i=this.elements,s=t.x,l=t.y,c=t.z;return i[0]*=s,i[4]*=l,i[8]*=c,i[1]*=s,i[5]*=l,i[9]*=c,i[2]*=s,i[6]*=l,i[10]*=c,i[3]*=s,i[7]*=l,i[11]*=c,this}getMaxScaleOnAxis(){const t=this.elements,i=t[0]*t[0]+t[1]*t[1]+t[2]*t[2],s=t[4]*t[4]+t[5]*t[5]+t[6]*t[6],l=t[8]*t[8]+t[9]*t[9]+t[10]*t[10];return Math.sqrt(Math.max(i,s,l))}makeTranslation(t,i,s){return t.isVector3?this.set(1,0,0,t.x,0,1,0,t.y,0,0,1,t.z,0,0,0,1):this.set(1,0,0,t,0,1,0,i,0,0,1,s,0,0,0,1),this}makeRotationX(t){const i=Math.cos(t),s=Math.sin(t);return this.set(1,0,0,0,0,i,-s,0,0,s,i,0,0,0,0,1),this}makeRotationY(t){const i=Math.cos(t),s=Math.sin(t);return this.set(i,0,s,0,0,1,0,0,-s,0,i,0,0,0,0,1),this}makeRotationZ(t){const i=Math.cos(t),s=Math.sin(t);return this.set(i,-s,0,0,s,i,0,0,0,0,1,0,0,0,0,1),this}makeRotationAxis(t,i){const s=Math.cos(i),l=Math.sin(i),c=1-s,h=t.x,d=t.y,m=t.z,p=c*h,v=c*d;return this.set(p*h+s,p*d-l*m,p*m+l*d,0,p*d+l*m,v*d+s,v*m-l*h,0,p*m-l*d,v*m+l*h,c*m*m+s,0,0,0,0,1),this}makeScale(t,i,s){return this.set(t,0,0,0,0,i,0,0,0,0,s,0,0,0,0,1),this}makeShear(t,i,s,l,c,h){return this.set(1,s,c,0,t,1,h,0,i,l,1,0,0,0,0,1),this}compose(t,i,s){const l=this.elements,c=i._x,h=i._y,d=i._z,m=i._w,p=c+c,v=h+h,g=d+d,_=c*p,M=c*v,E=c*g,A=h*v,y=h*g,S=d*g,w=m*p,D=m*v,U=m*g,H=s.x,F=s.y,I=s.z;return l[0]=(1-(A+S))*H,l[1]=(M+U)*H,l[2]=(E-D)*H,l[3]=0,l[4]=(M-U)*F,l[5]=(1-(_+S))*F,l[6]=(y+w)*F,l[7]=0,l[8]=(E+D)*I,l[9]=(y-w)*I,l[10]=(1-(_+A))*I,l[11]=0,l[12]=t.x,l[13]=t.y,l[14]=t.z,l[15]=1,this}decompose(t,i,s){const l=this.elements;t.x=l[12],t.y=l[13],t.z=l[14];const c=this.determinant();if(c===0)return s.set(1,1,1),i.identity(),this;let h=Fr.set(l[0],l[1],l[2]).length();const d=Fr.set(l[4],l[5],l[6]).length(),m=Fr.set(l[8],l[9],l[10]).length();c<0&&(h=-h),Oi.copy(this);const p=1/h,v=1/d,g=1/m;return Oi.elements[0]*=p,Oi.elements[1]*=p,Oi.elements[2]*=p,Oi.elements[4]*=v,Oi.elements[5]*=v,Oi.elements[6]*=v,Oi.elements[8]*=g,Oi.elements[9]*=g,Oi.elements[10]*=g,i.setFromRotationMatrix(Oi),s.x=h,s.y=d,s.z=m,this}makePerspective(t,i,s,l,c,h,d=ea,m=!1){const p=this.elements,v=2*c/(i-t),g=2*c/(s-l),_=(i+t)/(i-t),M=(s+l)/(s-l);let E,A;if(m)E=c/(h-c),A=h*c/(h-c);else if(d===ea)E=-(h+c)/(h-c),A=-2*h*c/(h-c);else if(d===gl)E=-h/(h-c),A=-h*c/(h-c);else throw new Error("THREE.Matrix4.makePerspective(): Invalid coordinate system: "+d);return p[0]=v,p[4]=0,p[8]=_,p[12]=0,p[1]=0,p[5]=g,p[9]=M,p[13]=0,p[2]=0,p[6]=0,p[10]=E,p[14]=A,p[3]=0,p[7]=0,p[11]=-1,p[15]=0,this}makeOrthographic(t,i,s,l,c,h,d=ea,m=!1){const p=this.elements,v=2/(i-t),g=2/(s-l),_=-(i+t)/(i-t),M=-(s+l)/(s-l);let E,A;if(m)E=1/(h-c),A=h/(h-c);else if(d===ea)E=-2/(h-c),A=-(h+c)/(h-c);else if(d===gl)E=-1/(h-c),A=-c/(h-c);else throw new Error("THREE.Matrix4.makeOrthographic(): Invalid coordinate system: "+d);return p[0]=v,p[4]=0,p[8]=0,p[12]=_,p[1]=0,p[5]=g,p[9]=0,p[13]=M,p[2]=0,p[6]=0,p[10]=E,p[14]=A,p[3]=0,p[7]=0,p[11]=0,p[15]=1,this}equals(t){const i=this.elements,s=t.elements;for(let l=0;l<16;l++)if(i[l]!==s[l])return!1;return!0}fromArray(t,i=0){for(let s=0;s<16;s++)this.elements[s]=t[s+i];return this}toArray(t=[],i=0){const s=this.elements;return t[i]=s[0],t[i+1]=s[1],t[i+2]=s[2],t[i+3]=s[3],t[i+4]=s[4],t[i+5]=s[5],t[i+6]=s[6],t[i+7]=s[7],t[i+8]=s[8],t[i+9]=s[9],t[i+10]=s[10],t[i+11]=s[11],t[i+12]=s[12],t[i+13]=s[13],t[i+14]=s[14],t[i+15]=s[15],t}}const Fr=new j,Oi=new Je,JM=new j(0,0,0),$M=new j(1,1,1),cs=new j,Pc=new j,ui=new j,F_=new Je,B_=new Ss;class sa{constructor(t=0,i=0,s=0,l=sa.DEFAULT_ORDER){this.isEuler=!0,this._x=t,this._y=i,this._z=s,this._order=l}get x(){return this._x}set x(t){this._x=t,this._onChangeCallback()}get y(){return this._y}set y(t){this._y=t,this._onChangeCallback()}get z(){return this._z}set z(t){this._z=t,this._onChangeCallback()}get order(){return this._order}set order(t){this._order=t,this._onChangeCallback()}set(t,i,s,l=this._order){return this._x=t,this._y=i,this._z=s,this._order=l,this._onChangeCallback(),this}clone(){return new this.constructor(this._x,this._y,this._z,this._order)}copy(t){return this._x=t._x,this._y=t._y,this._z=t._z,this._order=t._order,this._onChangeCallback(),this}setFromRotationMatrix(t,i=this._order,s=!0){const l=t.elements,c=l[0],h=l[4],d=l[8],m=l[1],p=l[5],v=l[9],g=l[2],_=l[6],M=l[10];switch(i){case"XYZ":this._y=Math.asin(ce(d,-1,1)),Math.abs(d)<.9999999?(this._x=Math.atan2(-v,M),this._z=Math.atan2(-h,c)):(this._x=Math.atan2(_,p),this._z=0);break;case"YXZ":this._x=Math.asin(-ce(v,-1,1)),Math.abs(v)<.9999999?(this._y=Math.atan2(d,M),this._z=Math.atan2(m,p)):(this._y=Math.atan2(-g,c),this._z=0);break;case"ZXY":this._x=Math.asin(ce(_,-1,1)),Math.abs(_)<.9999999?(this._y=Math.atan2(-g,M),this._z=Math.atan2(-h,p)):(this._y=0,this._z=Math.atan2(m,c));break;case"ZYX":this._y=Math.asin(-ce(g,-1,1)),Math.abs(g)<.9999999?(this._x=Math.atan2(_,M),this._z=Math.atan2(m,c)):(this._x=0,this._z=Math.atan2(-h,p));break;case"YZX":this._z=Math.asin(ce(m,-1,1)),Math.abs(m)<.9999999?(this._x=Math.atan2(-v,p),this._y=Math.atan2(-g,c)):(this._x=0,this._y=Math.atan2(d,M));break;case"XZY":this._z=Math.asin(-ce(h,-1,1)),Math.abs(h)<.9999999?(this._x=Math.atan2(_,p),this._y=Math.atan2(d,c)):(this._x=Math.atan2(-v,M),this._y=0);break;default:ee("Euler: .setFromRotationMatrix() encountered an unknown order: "+i)}return this._order=i,s===!0&&this._onChangeCallback(),this}setFromQuaternion(t,i,s){return F_.makeRotationFromQuaternion(t),this.setFromRotationMatrix(F_,i,s)}setFromVector3(t,i=this._order){return this.set(t.x,t.y,t.z,i)}reorder(t){return B_.setFromEuler(this),this.setFromQuaternion(B_,t)}equals(t){return t._x===this._x&&t._y===this._y&&t._z===this._z&&t._order===this._order}fromArray(t){return this._x=t[0],this._y=t[1],this._z=t[2],t[3]!==void 0&&(this._order=t[3]),this._onChangeCallback(),this}toArray(t=[],i=0){return t[i]=this._x,t[i+1]=this._y,t[i+2]=this._z,t[i+3]=this._order,t}_onChange(t){return this._onChangeCallback=t,this}_onChangeCallback(){}*[Symbol.iterator](){yield this._x,yield this._y,yield this._z,yield this._order}}sa.DEFAULT_ORDER="XYZ";class cx{constructor(){this.mask=1}set(t){this.mask=(1<<t|0)>>>0}enable(t){this.mask|=1<<t|0}enableAll(){this.mask=-1}toggle(t){this.mask^=1<<t|0}disable(t){this.mask&=~(1<<t|0)}disableAll(){this.mask=0}test(t){return(this.mask&t.mask)!==0}isEnabled(t){return(this.mask&(1<<t|0))!==0}}let tE=0;const H_=new j,Br=new Ss,Ta=new Je,zc=new j,il=new j,eE=new j,nE=new Ss,G_=new j(1,0,0),V_=new j(0,1,0),k_=new j(0,0,1),X_={type:"added"},iE={type:"removed"},Hr={type:"childadded",child:null},Yh={type:"childremoved",child:null};class Un extends $s{constructor(){super(),this.isObject3D=!0,Object.defineProperty(this,"id",{value:tE++}),this.uuid=Na(),this.name="",this.type="Object3D",this.parent=null,this.children=[],this.up=Un.DEFAULT_UP.clone();const t=new j,i=new sa,s=new Ss,l=new j(1,1,1);function c(){s.setFromEuler(i,!1)}function h(){i.setFromQuaternion(s,void 0,!1)}i._onChange(c),s._onChange(h),Object.defineProperties(this,{position:{configurable:!0,enumerable:!0,value:t},rotation:{configurable:!0,enumerable:!0,value:i},quaternion:{configurable:!0,enumerable:!0,value:s},scale:{configurable:!0,enumerable:!0,value:l},modelViewMatrix:{value:new Je},normalMatrix:{value:new pe}}),this.matrix=new Je,this.matrixWorld=new Je,this.matrixAutoUpdate=Un.DEFAULT_MATRIX_AUTO_UPDATE,this.matrixWorldAutoUpdate=Un.DEFAULT_MATRIX_WORLD_AUTO_UPDATE,this.matrixWorldNeedsUpdate=!1,this.layers=new cx,this.visible=!0,this.castShadow=!1,this.receiveShadow=!1,this.frustumCulled=!0,this.renderOrder=0,this.animations=[],this.customDepthMaterial=void 0,this.customDistanceMaterial=void 0,this.static=!1,this.userData={},this.pivot=null}onBeforeShadow(){}onAfterShadow(){}onBeforeRender(){}onAfterRender(){}applyMatrix4(t){this.matrixAutoUpdate&&this.updateMatrix(),this.matrix.premultiply(t),this.matrix.decompose(this.position,this.quaternion,this.scale)}applyQuaternion(t){return this.quaternion.premultiply(t),this}setRotationFromAxisAngle(t,i){this.quaternion.setFromAxisAngle(t,i)}setRotationFromEuler(t){this.quaternion.setFromEuler(t,!0)}setRotationFromMatrix(t){this.quaternion.setFromRotationMatrix(t)}setRotationFromQuaternion(t){this.quaternion.copy(t)}rotateOnAxis(t,i){return Br.setFromAxisAngle(t,i),this.quaternion.multiply(Br),this}rotateOnWorldAxis(t,i){return Br.setFromAxisAngle(t,i),this.quaternion.premultiply(Br),this}rotateX(t){return this.rotateOnAxis(G_,t)}rotateY(t){return this.rotateOnAxis(V_,t)}rotateZ(t){return this.rotateOnAxis(k_,t)}translateOnAxis(t,i){return H_.copy(t).applyQuaternion(this.quaternion),this.position.add(H_.multiplyScalar(i)),this}translateX(t){return this.translateOnAxis(G_,t)}translateY(t){return this.translateOnAxis(V_,t)}translateZ(t){return this.translateOnAxis(k_,t)}localToWorld(t){return this.updateWorldMatrix(!0,!1),t.applyMatrix4(this.matrixWorld)}worldToLocal(t){return this.updateWorldMatrix(!0,!1),t.applyMatrix4(Ta.copy(this.matrixWorld).invert())}lookAt(t,i,s){t.isVector3?zc.copy(t):zc.set(t,i,s);const l=this.parent;this.updateWorldMatrix(!0,!1),il.setFromMatrixPosition(this.matrixWorld),this.isCamera||this.isLight?Ta.lookAt(il,zc,this.up):Ta.lookAt(zc,il,this.up),this.quaternion.setFromRotationMatrix(Ta),l&&(Ta.extractRotation(l.matrixWorld),Br.setFromRotationMatrix(Ta),this.quaternion.premultiply(Br.invert()))}add(t){if(arguments.length>1){for(let i=0;i<arguments.length;i++)this.add(arguments[i]);return this}return t===this?(Ue("Object3D.add: object can't be added as a child of itself.",t),this):(t&&t.isObject3D?(t.removeFromParent(),t.parent=this,this.children.push(t),t.dispatchEvent(X_),Hr.child=t,this.dispatchEvent(Hr),Hr.child=null):Ue("Object3D.add: object not an instance of THREE.Object3D.",t),this)}remove(t){if(arguments.length>1){for(let s=0;s<arguments.length;s++)this.remove(arguments[s]);return this}const i=this.children.indexOf(t);return i!==-1&&(t.parent=null,this.children.splice(i,1),t.dispatchEvent(iE),Yh.child=t,this.dispatchEvent(Yh),Yh.child=null),this}removeFromParent(){const t=this.parent;return t!==null&&t.remove(this),this}clear(){return this.remove(...this.children)}attach(t){return this.updateWorldMatrix(!0,!1),Ta.copy(this.matrixWorld).invert(),t.parent!==null&&(t.parent.updateWorldMatrix(!0,!1),Ta.multiply(t.parent.matrixWorld)),t.applyMatrix4(Ta),t.removeFromParent(),t.parent=this,this.children.push(t),t.updateWorldMatrix(!1,!0),t.dispatchEvent(X_),Hr.child=t,this.dispatchEvent(Hr),Hr.child=null,this}getObjectById(t){return this.getObjectByProperty("id",t)}getObjectByName(t){return this.getObjectByProperty("name",t)}getObjectByProperty(t,i){if(this[t]===i)return this;for(let s=0,l=this.children.length;s<l;s++){const h=this.children[s].getObjectByProperty(t,i);if(h!==void 0)return h}}getObjectsByProperty(t,i,s=[]){this[t]===i&&s.push(this);const l=this.children;for(let c=0,h=l.length;c<h;c++)l[c].getObjectsByProperty(t,i,s);return s}getWorldPosition(t){return this.updateWorldMatrix(!0,!1),t.setFromMatrixPosition(this.matrixWorld)}getWorldQuaternion(t){return this.updateWorldMatrix(!0,!1),this.matrixWorld.decompose(il,t,eE),t}getWorldScale(t){return this.updateWorldMatrix(!0,!1),this.matrixWorld.decompose(il,nE,t),t}getWorldDirection(t){this.updateWorldMatrix(!0,!1);const i=this.matrixWorld.elements;return t.set(i[8],i[9],i[10]).normalize()}raycast(){}traverse(t){t(this);const i=this.children;for(let s=0,l=i.length;s<l;s++)i[s].traverse(t)}traverseVisible(t){if(this.visible===!1)return;t(this);const i=this.children;for(let s=0,l=i.length;s<l;s++)i[s].traverseVisible(t)}traverseAncestors(t){const i=this.parent;i!==null&&(t(i),i.traverseAncestors(t))}updateMatrix(){this.matrix.compose(this.position,this.quaternion,this.scale);const t=this.pivot;if(t!==null){const i=t.x,s=t.y,l=t.z,c=this.matrix.elements;c[12]+=i-c[0]*i-c[4]*s-c[8]*l,c[13]+=s-c[1]*i-c[5]*s-c[9]*l,c[14]+=l-c[2]*i-c[6]*s-c[10]*l}this.matrixWorldNeedsUpdate=!0}updateMatrixWorld(t){this.matrixAutoUpdate&&this.updateMatrix(),(this.matrixWorldNeedsUpdate||t)&&(this.matrixWorldAutoUpdate===!0&&(this.parent===null?this.matrixWorld.copy(this.matrix):this.matrixWorld.multiplyMatrices(this.parent.matrixWorld,this.matrix)),this.matrixWorldNeedsUpdate=!1,t=!0);const i=this.children;for(let s=0,l=i.length;s<l;s++)i[s].updateMatrixWorld(t)}updateWorldMatrix(t,i){const s=this.parent;if(t===!0&&s!==null&&s.updateWorldMatrix(!0,!1),this.matrixAutoUpdate&&this.updateMatrix(),this.matrixWorldAutoUpdate===!0&&(this.parent===null?this.matrixWorld.copy(this.matrix):this.matrixWorld.multiplyMatrices(this.parent.matrixWorld,this.matrix)),i===!0){const l=this.children;for(let c=0,h=l.length;c<h;c++)l[c].updateWorldMatrix(!1,!0)}}toJSON(t){const i=t===void 0||typeof t=="string",s={};i&&(t={geometries:{},materials:{},textures:{},images:{},shapes:{},skeletons:{},animations:{},nodes:{}},s.metadata={version:4.7,type:"Object",generator:"Object3D.toJSON"});const l={};l.uuid=this.uuid,l.type=this.type,this.name!==""&&(l.name=this.name),this.castShadow===!0&&(l.castShadow=!0),this.receiveShadow===!0&&(l.receiveShadow=!0),this.visible===!1&&(l.visible=!1),this.frustumCulled===!1&&(l.frustumCulled=!1),this.renderOrder!==0&&(l.renderOrder=this.renderOrder),this.static!==!1&&(l.static=this.static),Object.keys(this.userData).length>0&&(l.userData=this.userData),l.layers=this.layers.mask,l.matrix=this.matrix.toArray(),l.up=this.up.toArray(),this.pivot!==null&&(l.pivot=this.pivot.toArray()),this.matrixAutoUpdate===!1&&(l.matrixAutoUpdate=!1),this.morphTargetDictionary!==void 0&&(l.morphTargetDictionary=Object.assign({},this.morphTargetDictionary)),this.morphTargetInfluences!==void 0&&(l.morphTargetInfluences=this.morphTargetInfluences.slice()),this.isInstancedMesh&&(l.type="InstancedMesh",l.count=this.count,l.instanceMatrix=this.instanceMatrix.toJSON(),this.instanceColor!==null&&(l.instanceColor=this.instanceColor.toJSON())),this.isBatchedMesh&&(l.type="BatchedMesh",l.perObjectFrustumCulled=this.perObjectFrustumCulled,l.sortObjects=this.sortObjects,l.drawRanges=this._drawRanges,l.reservedRanges=this._reservedRanges,l.geometryInfo=this._geometryInfo.map(d=>({...d,boundingBox:d.boundingBox?d.boundingBox.toJSON():void 0,boundingSphere:d.boundingSphere?d.boundingSphere.toJSON():void 0})),l.instanceInfo=this._instanceInfo.map(d=>({...d})),l.availableInstanceIds=this._availableInstanceIds.slice(),l.availableGeometryIds=this._availableGeometryIds.slice(),l.nextIndexStart=this._nextIndexStart,l.nextVertexStart=this._nextVertexStart,l.geometryCount=this._geometryCount,l.maxInstanceCount=this._maxInstanceCount,l.maxVertexCount=this._maxVertexCount,l.maxIndexCount=this._maxIndexCount,l.geometryInitialized=this._geometryInitialized,l.matricesTexture=this._matricesTexture.toJSON(t),l.indirectTexture=this._indirectTexture.toJSON(t),this._colorsTexture!==null&&(l.colorsTexture=this._colorsTexture.toJSON(t)),this.boundingSphere!==null&&(l.boundingSphere=this.boundingSphere.toJSON()),this.boundingBox!==null&&(l.boundingBox=this.boundingBox.toJSON()));function c(d,m){return d[m.uuid]===void 0&&(d[m.uuid]=m.toJSON(t)),m.uuid}if(this.isScene)this.background&&(this.background.isColor?l.background=this.background.toJSON():this.background.isTexture&&(l.background=this.background.toJSON(t).uuid)),this.environment&&this.environment.isTexture&&this.environment.isRenderTargetTexture!==!0&&(l.environment=this.environment.toJSON(t).uuid);else if(this.isMesh||this.isLine||this.isPoints){l.geometry=c(t.geometries,this.geometry);const d=this.geometry.parameters;if(d!==void 0&&d.shapes!==void 0){const m=d.shapes;if(Array.isArray(m))for(let p=0,v=m.length;p<v;p++){const g=m[p];c(t.shapes,g)}else c(t.shapes,m)}}if(this.isSkinnedMesh&&(l.bindMode=this.bindMode,l.bindMatrix=this.bindMatrix.toArray(),this.skeleton!==void 0&&(c(t.skeletons,this.skeleton),l.skeleton=this.skeleton.uuid)),this.material!==void 0)if(Array.isArray(this.material)){const d=[];for(let m=0,p=this.material.length;m<p;m++)d.push(c(t.materials,this.material[m]));l.material=d}else l.material=c(t.materials,this.material);if(this.children.length>0){l.children=[];for(let d=0;d<this.children.length;d++)l.children.push(this.children[d].toJSON(t).object)}if(this.animations.length>0){l.animations=[];for(let d=0;d<this.animations.length;d++){const m=this.animations[d];l.animations.push(c(t.animations,m))}}if(i){const d=h(t.geometries),m=h(t.materials),p=h(t.textures),v=h(t.images),g=h(t.shapes),_=h(t.skeletons),M=h(t.animations),E=h(t.nodes);d.length>0&&(s.geometries=d),m.length>0&&(s.materials=m),p.length>0&&(s.textures=p),v.length>0&&(s.images=v),g.length>0&&(s.shapes=g),_.length>0&&(s.skeletons=_),M.length>0&&(s.animations=M),E.length>0&&(s.nodes=E)}return s.object=l,s;function h(d){const m=[];for(const p in d){const v=d[p];delete v.metadata,m.push(v)}return m}}clone(t){return new this.constructor().copy(this,t)}copy(t,i=!0){if(this.name=t.name,this.up.copy(t.up),this.position.copy(t.position),this.rotation.order=t.rotation.order,this.quaternion.copy(t.quaternion),this.scale.copy(t.scale),t.pivot!==null&&(this.pivot=t.pivot.clone()),this.matrix.copy(t.matrix),this.matrixWorld.copy(t.matrixWorld),this.matrixAutoUpdate=t.matrixAutoUpdate,this.matrixWorldAutoUpdate=t.matrixWorldAutoUpdate,this.matrixWorldNeedsUpdate=t.matrixWorldNeedsUpdate,this.layers.mask=t.layers.mask,this.visible=t.visible,this.castShadow=t.castShadow,this.receiveShadow=t.receiveShadow,this.frustumCulled=t.frustumCulled,this.renderOrder=t.renderOrder,this.static=t.static,this.animations=t.animations.slice(),this.userData=JSON.parse(JSON.stringify(t.userData)),i===!0)for(let s=0;s<t.children.length;s++){const l=t.children[s];this.add(l.clone())}return this}}Un.DEFAULT_UP=new j(0,1,0);Un.DEFAULT_MATRIX_AUTO_UPDATE=!0;Un.DEFAULT_MATRIX_WORLD_AUTO_UPDATE=!0;class Ic extends Un{constructor(){super(),this.isGroup=!0,this.type="Group"}}const aE={type:"move"};class jh{constructor(){this._targetRay=null,this._grip=null,this._hand=null}getHandSpace(){return this._hand===null&&(this._hand=new Ic,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 Ic,this._targetRay.matrixAutoUpdate=!1,this._targetRay.visible=!1,this._targetRay.hasLinearVelocity=!1,this._targetRay.linearVelocity=new j,this._targetRay.hasAngularVelocity=!1,this._targetRay.angularVelocity=new j),this._targetRay}getGripSpace(){return this._grip===null&&(this._grip=new Ic,this._grip.matrixAutoUpdate=!1,this._grip.visible=!1,this._grip.hasLinearVelocity=!1,this._grip.linearVelocity=new j,this._grip.hasAngularVelocity=!1,this._grip.angularVelocity=new j),this._grip}dispatchEvent(t){return this._targetRay!==null&&this._targetRay.dispatchEvent(t),this._grip!==null&&this._grip.dispatchEvent(t),this._hand!==null&&this._hand.dispatchEvent(t),this}connect(t){if(t&&t.hand){const i=this._hand;if(i)for(const s of t.hand.values())this._getHandJoint(i,s)}return this.dispatchEvent({type:"connected",data:t}),this}disconnect(t){return this.dispatchEvent({type:"disconnected",data:t}),this._targetRay!==null&&(this._targetRay.visible=!1),this._grip!==null&&(this._grip.visible=!1),this._hand!==null&&(this._hand.visible=!1),this}update(t,i,s){let l=null,c=null,h=null;const d=this._targetRay,m=this._grip,p=this._hand;if(t&&i.session.visibilityState!=="visible-blurred"){if(p&&t.hand){h=!0;for(const A of t.hand.values()){const y=i.getJointPose(A,s),S=this._getHandJoint(p,A);y!==null&&(S.matrix.fromArray(y.transform.matrix),S.matrix.decompose(S.position,S.rotation,S.scale),S.matrixWorldNeedsUpdate=!0,S.jointRadius=y.radius),S.visible=y!==null}const v=p.joints["index-finger-tip"],g=p.joints["thumb-tip"],_=v.position.distanceTo(g.position),M=.02,E=.005;p.inputState.pinching&&_>M+E?(p.inputState.pinching=!1,this.dispatchEvent({type:"pinchend",handedness:t.handedness,target:this})):!p.inputState.pinching&&_<=M-E&&(p.inputState.pinching=!0,this.dispatchEvent({type:"pinchstart",handedness:t.handedness,target:this}))}else m!==null&&t.gripSpace&&(c=i.getPose(t.gripSpace,s),c!==null&&(m.matrix.fromArray(c.transform.matrix),m.matrix.decompose(m.position,m.rotation,m.scale),m.matrixWorldNeedsUpdate=!0,c.linearVelocity?(m.hasLinearVelocity=!0,m.linearVelocity.copy(c.linearVelocity)):m.hasLinearVelocity=!1,c.angularVelocity?(m.hasAngularVelocity=!0,m.angularVelocity.copy(c.angularVelocity)):m.hasAngularVelocity=!1));d!==null&&(l=i.getPose(t.targetRaySpace,s),l===null&&c!==null&&(l=c),l!==null&&(d.matrix.fromArray(l.transform.matrix),d.matrix.decompose(d.position,d.rotation,d.scale),d.matrixWorldNeedsUpdate=!0,l.linearVelocity?(d.hasLinearVelocity=!0,d.linearVelocity.copy(l.linearVelocity)):d.hasLinearVelocity=!1,l.angularVelocity?(d.hasAngularVelocity=!0,d.angularVelocity.copy(l.angularVelocity)):d.hasAngularVelocity=!1,this.dispatchEvent(aE)))}return d!==null&&(d.visible=l!==null),m!==null&&(m.visible=c!==null),p!==null&&(p.visible=h!==null),this}_getHandJoint(t,i){if(t.joints[i.jointName]===void 0){const s=new Ic;s.matrixAutoUpdate=!1,s.visible=!1,t.joints[i.jointName]=s,t.add(s)}return t.joints[i.jointName]}}const ux={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},us={h:0,s:0,l:0},Fc={h:0,s:0,l:0};function Zh(r,t,i){return i<0&&(i+=1),i>1&&(i-=1),i<1/6?r+(t-r)*6*i:i<1/2?t:i<2/3?r+(t-r)*6*(2/3-i):r}class Se{constructor(t,i,s){return this.isColor=!0,this.r=1,this.g=1,this.b=1,this.set(t,i,s)}set(t,i,s){if(i===void 0&&s===void 0){const l=t;l&&l.isColor?this.copy(l):typeof l=="number"?this.setHex(l):typeof l=="string"&&this.setStyle(l)}else this.setRGB(t,i,s);return this}setScalar(t){return this.r=t,this.g=t,this.b=t,this}setHex(t,i=Ai){return t=Math.floor(t),this.r=(t>>16&255)/255,this.g=(t>>8&255)/255,this.b=(t&255)/255,Re.colorSpaceToWorking(this,i),this}setRGB(t,i,s,l=Re.workingColorSpace){return this.r=t,this.g=i,this.b=s,Re.colorSpaceToWorking(this,l),this}setHSL(t,i,s,l=Re.workingColorSpace){if(t=Dp(t,1),i=ce(i,0,1),s=ce(s,0,1),i===0)this.r=this.g=this.b=s;else{const c=s<=.5?s*(1+i):s+i-s*i,h=2*s-c;this.r=Zh(h,c,t+1/3),this.g=Zh(h,c,t),this.b=Zh(h,c,t-1/3)}return Re.colorSpaceToWorking(this,l),this}setStyle(t,i=Ai){function s(c){c!==void 0&&parseFloat(c)<1&&ee("Color: Alpha component of "+t+" will be ignored.")}let l;if(l=/^(\w+)\(([^\)]*)\)/.exec(t)){let c;const h=l[1],d=l[2];switch(h){case"rgb":case"rgba":if(c=/^\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec(d))return s(c[4]),this.setRGB(Math.min(255,parseInt(c[1],10))/255,Math.min(255,parseInt(c[2],10))/255,Math.min(255,parseInt(c[3],10))/255,i);if(c=/^\s*(\d+)\%\s*,\s*(\d+)\%\s*,\s*(\d+)\%\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec(d))return s(c[4]),this.setRGB(Math.min(100,parseInt(c[1],10))/100,Math.min(100,parseInt(c[2],10))/100,Math.min(100,parseInt(c[3],10))/100,i);break;case"hsl":case"hsla":if(c=/^\s*(\d*\.?\d+)\s*,\s*(\d*\.?\d+)\%\s*,\s*(\d*\.?\d+)\%\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec(d))return s(c[4]),this.setHSL(parseFloat(c[1])/360,parseFloat(c[2])/100,parseFloat(c[3])/100,i);break;default:ee("Color: Unknown color model "+t)}}else if(l=/^\#([A-Fa-f\d]+)$/.exec(t)){const c=l[1],h=c.length;if(h===3)return this.setRGB(parseInt(c.charAt(0),16)/15,parseInt(c.charAt(1),16)/15,parseInt(c.charAt(2),16)/15,i);if(h===6)return this.setHex(parseInt(c,16),i);ee("Color: Invalid hex color "+t)}else if(t&&t.length>0)return this.setColorName(t,i);return this}setColorName(t,i=Ai){const s=ux[t.toLowerCase()];return s!==void 0?this.setHex(s,i):ee("Color: Unknown color "+t),this}clone(){return new this.constructor(this.r,this.g,this.b)}copy(t){return this.r=t.r,this.g=t.g,this.b=t.b,this}copySRGBToLinear(t){return this.r=Oa(t.r),this.g=Oa(t.g),this.b=Oa(t.b),this}copyLinearToSRGB(t){return this.r=no(t.r),this.g=no(t.g),this.b=no(t.b),this}convertSRGBToLinear(){return this.copySRGBToLinear(this),this}convertLinearToSRGB(){return this.copyLinearToSRGB(this),this}getHex(t=Ai){return Re.workingToColorSpace(Pn.copy(this),t),Math.round(ce(Pn.r*255,0,255))*65536+Math.round(ce(Pn.g*255,0,255))*256+Math.round(ce(Pn.b*255,0,255))}getHexString(t=Ai){return("000000"+this.getHex(t).toString(16)).slice(-6)}getHSL(t,i=Re.workingColorSpace){Re.workingToColorSpace(Pn.copy(this),i);const s=Pn.r,l=Pn.g,c=Pn.b,h=Math.max(s,l,c),d=Math.min(s,l,c);let m,p;const v=(d+h)/2;if(d===h)m=0,p=0;else{const g=h-d;switch(p=v<=.5?g/(h+d):g/(2-h-d),h){case s:m=(l-c)/g+(l<c?6:0);break;case l:m=(c-s)/g+2;break;case c:m=(s-l)/g+4;break}m/=6}return t.h=m,t.s=p,t.l=v,t}getRGB(t,i=Re.workingColorSpace){return Re.workingToColorSpace(Pn.copy(this),i),t.r=Pn.r,t.g=Pn.g,t.b=Pn.b,t}getStyle(t=Ai){Re.workingToColorSpace(Pn.copy(this),t);const i=Pn.r,s=Pn.g,l=Pn.b;return t!==Ai?`color(${t} ${i.toFixed(3)} ${s.toFixed(3)} ${l.toFixed(3)})`:`rgb(${Math.round(i*255)},${Math.round(s*255)},${Math.round(l*255)})`}offsetHSL(t,i,s){return this.getHSL(us),this.setHSL(us.h+t,us.s+i,us.l+s)}add(t){return this.r+=t.r,this.g+=t.g,this.b+=t.b,this}addColors(t,i){return this.r=t.r+i.r,this.g=t.g+i.g,this.b=t.b+i.b,this}addScalar(t){return this.r+=t,this.g+=t,this.b+=t,this}sub(t){return this.r=Math.max(0,this.r-t.r),this.g=Math.max(0,this.g-t.g),this.b=Math.max(0,this.b-t.b),this}multiply(t){return this.r*=t.r,this.g*=t.g,this.b*=t.b,this}multiplyScalar(t){return this.r*=t,this.g*=t,this.b*=t,this}lerp(t,i){return this.r+=(t.r-this.r)*i,this.g+=(t.g-this.g)*i,this.b+=(t.b-this.b)*i,this}lerpColors(t,i,s){return this.r=t.r+(i.r-t.r)*s,this.g=t.g+(i.g-t.g)*s,this.b=t.b+(i.b-t.b)*s,this}lerpHSL(t,i){this.getHSL(us),t.getHSL(Fc);const s=dl(us.h,Fc.h,i),l=dl(us.s,Fc.s,i),c=dl(us.l,Fc.l,i);return this.setHSL(s,l,c),this}setFromVector3(t){return this.r=t.x,this.g=t.y,this.b=t.z,this}applyMatrix3(t){const i=this.r,s=this.g,l=this.b,c=t.elements;return this.r=c[0]*i+c[3]*s+c[6]*l,this.g=c[1]*i+c[4]*s+c[7]*l,this.b=c[2]*i+c[5]*s+c[8]*l,this}equals(t){return t.r===this.r&&t.g===this.g&&t.b===this.b}fromArray(t,i=0){return this.r=t[i],this.g=t[i+1],this.b=t[i+2],this}toArray(t=[],i=0){return t[i]=this.r,t[i+1]=this.g,t[i+2]=this.b,t}fromBufferAttribute(t,i){return this.r=t.getX(i),this.g=t.getY(i),this.b=t.getZ(i),this}toJSON(){return this.getHex()}*[Symbol.iterator](){yield this.r,yield this.g,yield this.b}}const Pn=new Se;Se.NAMES=ux;class sE extends Un{constructor(){super(),this.isScene=!0,this.type="Scene",this.background=null,this.environment=null,this.fog=null,this.backgroundBlurriness=0,this.backgroundIntensity=1,this.backgroundRotation=new sa,this.environmentIntensity=1,this.environmentRotation=new sa,this.overrideMaterial=null,typeof __THREE_DEVTOOLS__<"u"&&__THREE_DEVTOOLS__.dispatchEvent(new CustomEvent("observe",{detail:this}))}copy(t,i){return super.copy(t,i),t.background!==null&&(this.background=t.background.clone()),t.environment!==null&&(this.environment=t.environment.clone()),t.fog!==null&&(this.fog=t.fog.clone()),this.backgroundBlurriness=t.backgroundBlurriness,this.backgroundIntensity=t.backgroundIntensity,this.backgroundRotation.copy(t.backgroundRotation),this.environmentIntensity=t.environmentIntensity,this.environmentRotation.copy(t.environmentRotation),t.overrideMaterial!==null&&(this.overrideMaterial=t.overrideMaterial.clone()),this.matrixAutoUpdate=t.matrixAutoUpdate,this}toJSON(t){const i=super.toJSON(t);return this.fog!==null&&(i.object.fog=this.fog.toJSON()),this.backgroundBlurriness>0&&(i.object.backgroundBlurriness=this.backgroundBlurriness),this.backgroundIntensity!==1&&(i.object.backgroundIntensity=this.backgroundIntensity),i.object.backgroundRotation=this.backgroundRotation.toArray(),this.environmentIntensity!==1&&(i.object.environmentIntensity=this.environmentIntensity),i.object.environmentRotation=this.environmentRotation.toArray(),i}}const Pi=new j,Aa=new j,Kh=new j,Ra=new j,Gr=new j,Vr=new j,W_=new j,Qh=new j,Jh=new j,$h=new j,td=new We,ed=new We,nd=new We;class Gi{constructor(t=new j,i=new j,s=new j){this.a=t,this.b=i,this.c=s}static getNormal(t,i,s,l){l.subVectors(s,i),Pi.subVectors(t,i),l.cross(Pi);const c=l.lengthSq();return c>0?l.multiplyScalar(1/Math.sqrt(c)):l.set(0,0,0)}static getBarycoord(t,i,s,l,c){Pi.subVectors(l,i),Aa.subVectors(s,i),Kh.subVectors(t,i);const h=Pi.dot(Pi),d=Pi.dot(Aa),m=Pi.dot(Kh),p=Aa.dot(Aa),v=Aa.dot(Kh),g=h*p-d*d;if(g===0)return c.set(0,0,0),null;const _=1/g,M=(p*m-d*v)*_,E=(h*v-d*m)*_;return c.set(1-M-E,E,M)}static containsPoint(t,i,s,l){return this.getBarycoord(t,i,s,l,Ra)===null?!1:Ra.x>=0&&Ra.y>=0&&Ra.x+Ra.y<=1}static getInterpolation(t,i,s,l,c,h,d,m){return this.getBarycoord(t,i,s,l,Ra)===null?(m.x=0,m.y=0,"z"in m&&(m.z=0),"w"in m&&(m.w=0),null):(m.setScalar(0),m.addScaledVector(c,Ra.x),m.addScaledVector(h,Ra.y),m.addScaledVector(d,Ra.z),m)}static getInterpolatedAttribute(t,i,s,l,c,h){return td.setScalar(0),ed.setScalar(0),nd.setScalar(0),td.fromBufferAttribute(t,i),ed.fromBufferAttribute(t,s),nd.fromBufferAttribute(t,l),h.setScalar(0),h.addScaledVector(td,c.x),h.addScaledVector(ed,c.y),h.addScaledVector(nd,c.z),h}static isFrontFacing(t,i,s,l){return Pi.subVectors(s,i),Aa.subVectors(t,i),Pi.cross(Aa).dot(l)<0}set(t,i,s){return this.a.copy(t),this.b.copy(i),this.c.copy(s),this}setFromPointsAndIndices(t,i,s,l){return this.a.copy(t[i]),this.b.copy(t[s]),this.c.copy(t[l]),this}setFromAttributeAndIndices(t,i,s,l){return this.a.fromBufferAttribute(t,i),this.b.fromBufferAttribute(t,s),this.c.fromBufferAttribute(t,l),this}clone(){return new this.constructor().copy(this)}copy(t){return this.a.copy(t.a),this.b.copy(t.b),this.c.copy(t.c),this}getArea(){return Pi.subVectors(this.c,this.b),Aa.subVectors(this.a,this.b),Pi.cross(Aa).length()*.5}getMidpoint(t){return t.addVectors(this.a,this.b).add(this.c).multiplyScalar(1/3)}getNormal(t){return Gi.getNormal(this.a,this.b,this.c,t)}getPlane(t){return t.setFromCoplanarPoints(this.a,this.b,this.c)}getBarycoord(t,i){return Gi.getBarycoord(t,this.a,this.b,this.c,i)}getInterpolation(t,i,s,l,c){return Gi.getInterpolation(t,this.a,this.b,this.c,i,s,l,c)}containsPoint(t){return Gi.containsPoint(t,this.a,this.b,this.c)}isFrontFacing(t){return Gi.isFrontFacing(this.a,this.b,this.c,t)}intersectsBox(t){return t.intersectsTriangle(this)}closestPointToPoint(t,i){const s=this.a,l=this.b,c=this.c;let h,d;Gr.subVectors(l,s),Vr.subVectors(c,s),Qh.subVectors(t,s);const m=Gr.dot(Qh),p=Vr.dot(Qh);if(m<=0&&p<=0)return i.copy(s);Jh.subVectors(t,l);const v=Gr.dot(Jh),g=Vr.dot(Jh);if(v>=0&&g<=v)return i.copy(l);const _=m*g-v*p;if(_<=0&&m>=0&&v<=0)return h=m/(m-v),i.copy(s).addScaledVector(Gr,h);$h.subVectors(t,c);const M=Gr.dot($h),E=Vr.dot($h);if(E>=0&&M<=E)return i.copy(c);const A=M*p-m*E;if(A<=0&&p>=0&&E<=0)return d=p/(p-E),i.copy(s).addScaledVector(Vr,d);const y=v*E-M*g;if(y<=0&&g-v>=0&&M-E>=0)return W_.subVectors(c,l),d=(g-v)/(g-v+(M-E)),i.copy(l).addScaledVector(W_,d);const S=1/(y+A+_);return h=A*S,d=_*S,i.copy(s).addScaledVector(Gr,h).addScaledVector(Vr,d)}equals(t){return t.a.equals(this.a)&&t.b.equals(this.b)&&t.c.equals(this.c)}}class ys{constructor(t=new j(1/0,1/0,1/0),i=new j(-1/0,-1/0,-1/0)){this.isBox3=!0,this.min=t,this.max=i}set(t,i){return this.min.copy(t),this.max.copy(i),this}setFromArray(t){this.makeEmpty();for(let i=0,s=t.length;i<s;i+=3)this.expandByPoint(zi.fromArray(t,i));return this}setFromBufferAttribute(t){this.makeEmpty();for(let i=0,s=t.count;i<s;i++)this.expandByPoint(zi.fromBufferAttribute(t,i));return this}setFromPoints(t){this.makeEmpty();for(let i=0,s=t.length;i<s;i++)this.expandByPoint(t[i]);return this}setFromCenterAndSize(t,i){const s=zi.copy(i).multiplyScalar(.5);return this.min.copy(t).sub(s),this.max.copy(t).add(s),this}setFromObject(t,i=!1){return this.makeEmpty(),this.expandByObject(t,i)}clone(){return new this.constructor().copy(this)}copy(t){return this.min.copy(t.min),this.max.copy(t.max),this}makeEmpty(){return this.min.x=this.min.y=this.min.z=1/0,this.max.x=this.max.y=this.max.z=-1/0,this}isEmpty(){return this.max.x<this.min.x||this.max.y<this.min.y||this.max.z<this.min.z}getCenter(t){return this.isEmpty()?t.set(0,0,0):t.addVectors(this.min,this.max).multiplyScalar(.5)}getSize(t){return this.isEmpty()?t.set(0,0,0):t.subVectors(this.max,this.min)}expandByPoint(t){return this.min.min(t),this.max.max(t),this}expandByVector(t){return this.min.sub(t),this.max.add(t),this}expandByScalar(t){return this.min.addScalar(-t),this.max.addScalar(t),this}expandByObject(t,i=!1){t.updateWorldMatrix(!1,!1);const s=t.geometry;if(s!==void 0){const c=s.getAttribute("position");if(i===!0&&c!==void 0&&t.isInstancedMesh!==!0)for(let h=0,d=c.count;h<d;h++)t.isMesh===!0?t.getVertexPosition(h,zi):zi.fromBufferAttribute(c,h),zi.applyMatrix4(t.matrixWorld),this.expandByPoint(zi);else t.boundingBox!==void 0?(t.boundingBox===null&&t.computeBoundingBox(),Bc.copy(t.boundingBox)):(s.boundingBox===null&&s.computeBoundingBox(),Bc.copy(s.boundingBox)),Bc.applyMatrix4(t.matrixWorld),this.union(Bc)}const l=t.children;for(let c=0,h=l.length;c<h;c++)this.expandByObject(l[c],i);return this}containsPoint(t){return t.x>=this.min.x&&t.x<=this.max.x&&t.y>=this.min.y&&t.y<=this.max.y&&t.z>=this.min.z&&t.z<=this.max.z}containsBox(t){return this.min.x<=t.min.x&&t.max.x<=this.max.x&&this.min.y<=t.min.y&&t.max.y<=this.max.y&&this.min.z<=t.min.z&&t.max.z<=this.max.z}getParameter(t,i){return i.set((t.x-this.min.x)/(this.max.x-this.min.x),(t.y-this.min.y)/(this.max.y-this.min.y),(t.z-this.min.z)/(this.max.z-this.min.z))}intersectsBox(t){return t.max.x>=this.min.x&&t.min.x<=this.max.x&&t.max.y>=this.min.y&&t.min.y<=this.max.y&&t.max.z>=this.min.z&&t.min.z<=this.max.z}intersectsSphere(t){return this.clampPoint(t.center,zi),zi.distanceToSquared(t.center)<=t.radius*t.radius}intersectsPlane(t){let i,s;return t.normal.x>0?(i=t.normal.x*this.min.x,s=t.normal.x*this.max.x):(i=t.normal.x*this.max.x,s=t.normal.x*this.min.x),t.normal.y>0?(i+=t.normal.y*this.min.y,s+=t.normal.y*this.max.y):(i+=t.normal.y*this.max.y,s+=t.normal.y*this.min.y),t.normal.z>0?(i+=t.normal.z*this.min.z,s+=t.normal.z*this.max.z):(i+=t.normal.z*this.max.z,s+=t.normal.z*this.min.z),i<=-t.constant&&s>=-t.constant}intersectsTriangle(t){if(this.isEmpty())return!1;this.getCenter(al),Hc.subVectors(this.max,al),kr.subVectors(t.a,al),Xr.subVectors(t.b,al),Wr.subVectors(t.c,al),fs.subVectors(Xr,kr),hs.subVectors(Wr,Xr),Hs.subVectors(kr,Wr);let i=[0,-fs.z,fs.y,0,-hs.z,hs.y,0,-Hs.z,Hs.y,fs.z,0,-fs.x,hs.z,0,-hs.x,Hs.z,0,-Hs.x,-fs.y,fs.x,0,-hs.y,hs.x,0,-Hs.y,Hs.x,0];return!id(i,kr,Xr,Wr,Hc)||(i=[1,0,0,0,1,0,0,0,1],!id(i,kr,Xr,Wr,Hc))?!1:(Gc.crossVectors(fs,hs),i=[Gc.x,Gc.y,Gc.z],id(i,kr,Xr,Wr,Hc))}clampPoint(t,i){return i.copy(t).clamp(this.min,this.max)}distanceToPoint(t){return this.clampPoint(t,zi).distanceTo(t)}getBoundingSphere(t){return this.isEmpty()?t.makeEmpty():(this.getCenter(t.center),t.radius=this.getSize(zi).length()*.5),t}intersect(t){return this.min.max(t.min),this.max.min(t.max),this.isEmpty()&&this.makeEmpty(),this}union(t){return this.min.min(t.min),this.max.max(t.max),this}applyMatrix4(t){return this.isEmpty()?this:(Ca[0].set(this.min.x,this.min.y,this.min.z).applyMatrix4(t),Ca[1].set(this.min.x,this.min.y,this.max.z).applyMatrix4(t),Ca[2].set(this.min.x,this.max.y,this.min.z).applyMatrix4(t),Ca[3].set(this.min.x,this.max.y,this.max.z).applyMatrix4(t),Ca[4].set(this.max.x,this.min.y,this.min.z).applyMatrix4(t),Ca[5].set(this.max.x,this.min.y,this.max.z).applyMatrix4(t),Ca[6].set(this.max.x,this.max.y,this.min.z).applyMatrix4(t),Ca[7].set(this.max.x,this.max.y,this.max.z).applyMatrix4(t),this.setFromPoints(Ca),this)}translate(t){return this.min.add(t),this.max.add(t),this}equals(t){return t.min.equals(this.min)&&t.max.equals(this.max)}toJSON(){return{min:this.min.toArray(),max:this.max.toArray()}}fromJSON(t){return this.min.fromArray(t.min),this.max.fromArray(t.max),this}}const Ca=[new j,new j,new j,new j,new j,new j,new j,new j],zi=new j,Bc=new ys,kr=new j,Xr=new j,Wr=new j,fs=new j,hs=new j,Hs=new j,al=new j,Hc=new j,Gc=new j,Gs=new j;function id(r,t,i,s,l){for(let c=0,h=r.length-3;c<=h;c+=3){Gs.fromArray(r,c);const d=l.x*Math.abs(Gs.x)+l.y*Math.abs(Gs.y)+l.z*Math.abs(Gs.z),m=t.dot(Gs),p=i.dot(Gs),v=s.dot(Gs);if(Math.max(-Math.max(m,p,v),Math.min(m,p,v))>d)return!1}return!0}const dn=new j,Vc=new le;let rE=0;class pi{constructor(t,i,s=!1){if(Array.isArray(t))throw new TypeError("THREE.BufferAttribute: array should be a Typed Array.");this.isBufferAttribute=!0,Object.defineProperty(this,"id",{value:rE++}),this.name="",this.array=t,this.itemSize=i,this.count=t!==void 0?t.length/i:0,this.normalized=s,this.usage=dp,this.updateRanges=[],this.gpuType=ta,this.version=0}onUploadCallback(){}set needsUpdate(t){t===!0&&this.version++}setUsage(t){return this.usage=t,this}addUpdateRange(t,i){this.updateRanges.push({start:t,count:i})}clearUpdateRanges(){this.updateRanges.length=0}copy(t){return this.name=t.name,this.array=new t.array.constructor(t.array),this.itemSize=t.itemSize,this.count=t.count,this.normalized=t.normalized,this.usage=t.usage,this.gpuType=t.gpuType,this}copyAt(t,i,s){t*=this.itemSize,s*=i.itemSize;for(let l=0,c=this.itemSize;l<c;l++)this.array[t+l]=i.array[s+l];return this}copyArray(t){return this.array.set(t),this}applyMatrix3(t){if(this.itemSize===2)for(let i=0,s=this.count;i<s;i++)Vc.fromBufferAttribute(this,i),Vc.applyMatrix3(t),this.setXY(i,Vc.x,Vc.y);else if(this.itemSize===3)for(let i=0,s=this.count;i<s;i++)dn.fromBufferAttribute(this,i),dn.applyMatrix3(t),this.setXYZ(i,dn.x,dn.y,dn.z);return this}applyMatrix4(t){for(let i=0,s=this.count;i<s;i++)dn.fromBufferAttribute(this,i),dn.applyMatrix4(t),this.setXYZ(i,dn.x,dn.y,dn.z);return this}applyNormalMatrix(t){for(let i=0,s=this.count;i<s;i++)dn.fromBufferAttribute(this,i),dn.applyNormalMatrix(t),this.setXYZ(i,dn.x,dn.y,dn.z);return this}transformDirection(t){for(let i=0,s=this.count;i<s;i++)dn.fromBufferAttribute(this,i),dn.transformDirection(t),this.setXYZ(i,dn.x,dn.y,dn.z);return this}set(t,i=0){return this.array.set(t,i),this}getComponent(t,i){let s=this.array[t*this.itemSize+i];return this.normalized&&(s=Hi(s,this.array)),s}setComponent(t,i,s){return this.normalized&&(s=Be(s,this.array)),this.array[t*this.itemSize+i]=s,this}getX(t){let i=this.array[t*this.itemSize];return this.normalized&&(i=Hi(i,this.array)),i}setX(t,i){return this.normalized&&(i=Be(i,this.array)),this.array[t*this.itemSize]=i,this}getY(t){let i=this.array[t*this.itemSize+1];return this.normalized&&(i=Hi(i,this.array)),i}setY(t,i){return this.normalized&&(i=Be(i,this.array)),this.array[t*this.itemSize+1]=i,this}getZ(t){let i=this.array[t*this.itemSize+2];return this.normalized&&(i=Hi(i,this.array)),i}setZ(t,i){return this.normalized&&(i=Be(i,this.array)),this.array[t*this.itemSize+2]=i,this}getW(t){let i=this.array[t*this.itemSize+3];return this.normalized&&(i=Hi(i,this.array)),i}setW(t,i){return this.normalized&&(i=Be(i,this.array)),this.array[t*this.itemSize+3]=i,this}setXY(t,i,s){return t*=this.itemSize,this.normalized&&(i=Be(i,this.array),s=Be(s,this.array)),this.array[t+0]=i,this.array[t+1]=s,this}setXYZ(t,i,s,l){return t*=this.itemSize,this.normalized&&(i=Be(i,this.array),s=Be(s,this.array),l=Be(l,this.array)),this.array[t+0]=i,this.array[t+1]=s,this.array[t+2]=l,this}setXYZW(t,i,s,l,c){return t*=this.itemSize,this.normalized&&(i=Be(i,this.array),s=Be(s,this.array),l=Be(l,this.array),c=Be(c,this.array)),this.array[t+0]=i,this.array[t+1]=s,this.array[t+2]=l,this.array[t+3]=c,this}onUpload(t){return this.onUploadCallback=t,this}clone(){return new this.constructor(this.array,this.itemSize).copy(this)}toJSON(){const t={itemSize:this.itemSize,type:this.array.constructor.name,array:Array.from(this.array),normalized:this.normalized};return this.name!==""&&(t.name=this.name),this.usage!==dp&&(t.usage=this.usage),t}}class fx extends pi{constructor(t,i,s){super(new Uint16Array(t),i,s)}}class hx extends pi{constructor(t,i,s){super(new Uint32Array(t),i,s)}}class Mn extends pi{constructor(t,i,s){super(new Float32Array(t),i,s)}}const oE=new ys,sl=new j,ad=new j;class lo{constructor(t=new j,i=-1){this.isSphere=!0,this.center=t,this.radius=i}set(t,i){return this.center.copy(t),this.radius=i,this}setFromPoints(t,i){const s=this.center;i!==void 0?s.copy(i):oE.setFromPoints(t).getCenter(s);let l=0;for(let c=0,h=t.length;c<h;c++)l=Math.max(l,s.distanceToSquared(t[c]));return this.radius=Math.sqrt(l),this}copy(t){return this.center.copy(t.center),this.radius=t.radius,this}isEmpty(){return this.radius<0}makeEmpty(){return this.center.set(0,0,0),this.radius=-1,this}containsPoint(t){return t.distanceToSquared(this.center)<=this.radius*this.radius}distanceToPoint(t){return t.distanceTo(this.center)-this.radius}intersectsSphere(t){const i=this.radius+t.radius;return t.center.distanceToSquared(this.center)<=i*i}intersectsBox(t){return t.intersectsSphere(this)}intersectsPlane(t){return Math.abs(t.distanceToPoint(this.center))<=this.radius}clampPoint(t,i){const s=this.center.distanceToSquared(t);return i.copy(t),s>this.radius*this.radius&&(i.sub(this.center).normalize(),i.multiplyScalar(this.radius).add(this.center)),i}getBoundingBox(t){return this.isEmpty()?(t.makeEmpty(),t):(t.set(this.center,this.center),t.expandByScalar(this.radius),t)}applyMatrix4(t){return this.center.applyMatrix4(t),this.radius=this.radius*t.getMaxScaleOnAxis(),this}translate(t){return this.center.add(t),this}expandByPoint(t){if(this.isEmpty())return this.center.copy(t),this.radius=0,this;sl.subVectors(t,this.center);const i=sl.lengthSq();if(i>this.radius*this.radius){const s=Math.sqrt(i),l=(s-this.radius)*.5;this.center.addScaledVector(sl,l/s),this.radius+=l}return this}union(t){return t.isEmpty()?this:this.isEmpty()?(this.copy(t),this):(this.center.equals(t.center)===!0?this.radius=Math.max(this.radius,t.radius):(ad.subVectors(t.center,this.center).setLength(t.radius),this.expandByPoint(sl.copy(t.center).add(ad)),this.expandByPoint(sl.copy(t.center).sub(ad))),this)}equals(t){return t.center.equals(this.center)&&t.radius===this.radius}clone(){return new this.constructor().copy(this)}toJSON(){return{radius:this.radius,center:this.center.toArray()}}fromJSON(t){return this.radius=t.radius,this.center.fromArray(t.center),this}}let lE=0;const bi=new Je,sd=new Un,qr=new j,fi=new ys,rl=new ys,yn=new j;class Ln extends $s{constructor(){super(),this.isBufferGeometry=!0,Object.defineProperty(this,"id",{value:lE++}),this.uuid=Na(),this.name="",this.type="BufferGeometry",this.index=null,this.indirect=null,this.indirectOffset=0,this.attributes={},this.morphAttributes={},this.morphTargetsRelative=!1,this.groups=[],this.boundingBox=null,this.boundingSphere=null,this.drawRange={start:0,count:1/0},this.userData={}}getIndex(){return this.index}setIndex(t){return Array.isArray(t)?this.index=new(AM(t)?hx:fx)(t,1):this.index=t,this}setIndirect(t,i=0){return this.indirect=t,this.indirectOffset=i,this}getIndirect(){return this.indirect}getAttribute(t){return this.attributes[t]}setAttribute(t,i){return this.attributes[t]=i,this}deleteAttribute(t){return delete this.attributes[t],this}hasAttribute(t){return this.attributes[t]!==void 0}addGroup(t,i,s=0){this.groups.push({start:t,count:i,materialIndex:s})}clearGroups(){this.groups=[]}setDrawRange(t,i){this.drawRange.start=t,this.drawRange.count=i}applyMatrix4(t){const i=this.attributes.position;i!==void 0&&(i.applyMatrix4(t),i.needsUpdate=!0);const s=this.attributes.normal;if(s!==void 0){const c=new pe().getNormalMatrix(t);s.applyNormalMatrix(c),s.needsUpdate=!0}const l=this.attributes.tangent;return l!==void 0&&(l.transformDirection(t),l.needsUpdate=!0),this.boundingBox!==null&&this.computeBoundingBox(),this.boundingSphere!==null&&this.computeBoundingSphere(),this}applyQuaternion(t){return bi.makeRotationFromQuaternion(t),this.applyMatrix4(bi),this}rotateX(t){return bi.makeRotationX(t),this.applyMatrix4(bi),this}rotateY(t){return bi.makeRotationY(t),this.applyMatrix4(bi),this}rotateZ(t){return bi.makeRotationZ(t),this.applyMatrix4(bi),this}translate(t,i,s){return bi.makeTranslation(t,i,s),this.applyMatrix4(bi),this}scale(t,i,s){return bi.makeScale(t,i,s),this.applyMatrix4(bi),this}lookAt(t){return sd.lookAt(t),sd.updateMatrix(),this.applyMatrix4(sd.matrix),this}center(){return this.computeBoundingBox(),this.boundingBox.getCenter(qr).negate(),this.translate(qr.x,qr.y,qr.z),this}setFromPoints(t){const i=this.getAttribute("position");if(i===void 0){const s=[];for(let l=0,c=t.length;l<c;l++){const h=t[l];s.push(h.x,h.y,h.z||0)}this.setAttribute("position",new Mn(s,3))}else{const s=Math.min(t.length,i.count);for(let l=0;l<s;l++){const c=t[l];i.setXYZ(l,c.x,c.y,c.z||0)}t.length>i.count&&ee("BufferGeometry: Buffer size too small for points data. Use .dispose() and create a new geometry."),i.needsUpdate=!0}return this}computeBoundingBox(){this.boundingBox===null&&(this.boundingBox=new ys);const t=this.attributes.position,i=this.morphAttributes.position;if(t&&t.isGLBufferAttribute){Ue("BufferGeometry.computeBoundingBox(): GLBufferAttribute requires a manual bounding box.",this),this.boundingBox.set(new j(-1/0,-1/0,-1/0),new j(1/0,1/0,1/0));return}if(t!==void 0){if(this.boundingBox.setFromBufferAttribute(t),i)for(let s=0,l=i.length;s<l;s++){const c=i[s];fi.setFromBufferAttribute(c),this.morphTargetsRelative?(yn.addVectors(this.boundingBox.min,fi.min),this.boundingBox.expandByPoint(yn),yn.addVectors(this.boundingBox.max,fi.max),this.boundingBox.expandByPoint(yn)):(this.boundingBox.expandByPoint(fi.min),this.boundingBox.expandByPoint(fi.max))}}else this.boundingBox.makeEmpty();(isNaN(this.boundingBox.min.x)||isNaN(this.boundingBox.min.y)||isNaN(this.boundingBox.min.z))&&Ue('BufferGeometry.computeBoundingBox(): Computed min/max have NaN values. The "position" attribute is likely to have NaN values.',this)}computeBoundingSphere(){this.boundingSphere===null&&(this.boundingSphere=new lo);const t=this.attributes.position,i=this.morphAttributes.position;if(t&&t.isGLBufferAttribute){Ue("BufferGeometry.computeBoundingSphere(): GLBufferAttribute requires a manual bounding sphere.",this),this.boundingSphere.set(new j,1/0);return}if(t){const s=this.boundingSphere.center;if(fi.setFromBufferAttribute(t),i)for(let c=0,h=i.length;c<h;c++){const d=i[c];rl.setFromBufferAttribute(d),this.morphTargetsRelative?(yn.addVectors(fi.min,rl.min),fi.expandByPoint(yn),yn.addVectors(fi.max,rl.max),fi.expandByPoint(yn)):(fi.expandByPoint(rl.min),fi.expandByPoint(rl.max))}fi.getCenter(s);let l=0;for(let c=0,h=t.count;c<h;c++)yn.fromBufferAttribute(t,c),l=Math.max(l,s.distanceToSquared(yn));if(i)for(let c=0,h=i.length;c<h;c++){const d=i[c],m=this.morphTargetsRelative;for(let p=0,v=d.count;p<v;p++)yn.fromBufferAttribute(d,p),m&&(qr.fromBufferAttribute(t,p),yn.add(qr)),l=Math.max(l,s.distanceToSquared(yn))}this.boundingSphere.radius=Math.sqrt(l),isNaN(this.boundingSphere.radius)&&Ue('BufferGeometry.computeBoundingSphere(): Computed radius is NaN. The "position" attribute is likely to have NaN values.',this)}}computeTangents(){const t=this.index,i=this.attributes;if(t===null||i.position===void 0||i.normal===void 0||i.uv===void 0){Ue("BufferGeometry: .computeTangents() failed. Missing required attributes (index, position, normal or uv)");return}const s=i.position,l=i.normal,c=i.uv;this.hasAttribute("tangent")===!1&&this.setAttribute("tangent",new pi(new Float32Array(4*s.count),4));const h=this.getAttribute("tangent"),d=[],m=[];for(let T=0;T<s.count;T++)d[T]=new j,m[T]=new j;const p=new j,v=new j,g=new j,_=new le,M=new le,E=new le,A=new j,y=new j;function S(T,L,Q){p.fromBufferAttribute(s,T),v.fromBufferAttribute(s,L),g.fromBufferAttribute(s,Q),_.fromBufferAttribute(c,T),M.fromBufferAttribute(c,L),E.fromBufferAttribute(c,Q),v.sub(p),g.sub(p),M.sub(_),E.sub(_);const P=1/(M.x*E.y-E.x*M.y);isFinite(P)&&(A.copy(v).multiplyScalar(E.y).addScaledVector(g,-M.y).multiplyScalar(P),y.copy(g).multiplyScalar(M.x).addScaledVector(v,-E.x).multiplyScalar(P),d[T].add(A),d[L].add(A),d[Q].add(A),m[T].add(y),m[L].add(y),m[Q].add(y))}let w=this.groups;w.length===0&&(w=[{start:0,count:t.count}]);for(let T=0,L=w.length;T<L;++T){const Q=w[T],P=Q.start,W=Q.count;for(let J=P,rt=P+W;J<rt;J+=3)S(t.getX(J+0),t.getX(J+1),t.getX(J+2))}const D=new j,U=new j,H=new j,F=new j;function I(T){H.fromBufferAttribute(l,T),F.copy(H);const L=d[T];D.copy(L),D.sub(H.multiplyScalar(H.dot(L))).normalize(),U.crossVectors(F,L);const P=U.dot(m[T])<0?-1:1;h.setXYZW(T,D.x,D.y,D.z,P)}for(let T=0,L=w.length;T<L;++T){const Q=w[T],P=Q.start,W=Q.count;for(let J=P,rt=P+W;J<rt;J+=3)I(t.getX(J+0)),I(t.getX(J+1)),I(t.getX(J+2))}}computeVertexNormals(){const t=this.index,i=this.getAttribute("position");if(i!==void 0){let s=this.getAttribute("normal");if(s===void 0)s=new pi(new Float32Array(i.count*3),3),this.setAttribute("normal",s);else for(let _=0,M=s.count;_<M;_++)s.setXYZ(_,0,0,0);const l=new j,c=new j,h=new j,d=new j,m=new j,p=new j,v=new j,g=new j;if(t)for(let _=0,M=t.count;_<M;_+=3){const E=t.getX(_+0),A=t.getX(_+1),y=t.getX(_+2);l.fromBufferAttribute(i,E),c.fromBufferAttribute(i,A),h.fromBufferAttribute(i,y),v.subVectors(h,c),g.subVectors(l,c),v.cross(g),d.fromBufferAttribute(s,E),m.fromBufferAttribute(s,A),p.fromBufferAttribute(s,y),d.add(v),m.add(v),p.add(v),s.setXYZ(E,d.x,d.y,d.z),s.setXYZ(A,m.x,m.y,m.z),s.setXYZ(y,p.x,p.y,p.z)}else for(let _=0,M=i.count;_<M;_+=3)l.fromBufferAttribute(i,_+0),c.fromBufferAttribute(i,_+1),h.fromBufferAttribute(i,_+2),v.subVectors(h,c),g.subVectors(l,c),v.cross(g),s.setXYZ(_+0,v.x,v.y,v.z),s.setXYZ(_+1,v.x,v.y,v.z),s.setXYZ(_+2,v.x,v.y,v.z);this.normalizeNormals(),s.needsUpdate=!0}}normalizeNormals(){const t=this.attributes.normal;for(let i=0,s=t.count;i<s;i++)yn.fromBufferAttribute(t,i),yn.normalize(),t.setXYZ(i,yn.x,yn.y,yn.z)}toNonIndexed(){function t(d,m){const p=d.array,v=d.itemSize,g=d.normalized,_=new p.constructor(m.length*v);let M=0,E=0;for(let A=0,y=m.length;A<y;A++){d.isInterleavedBufferAttribute?M=m[A]*d.data.stride+d.offset:M=m[A]*v;for(let S=0;S<v;S++)_[E++]=p[M++]}return new pi(_,v,g)}if(this.index===null)return ee("BufferGeometry.toNonIndexed(): BufferGeometry is already non-indexed."),this;const i=new Ln,s=this.index.array,l=this.attributes;for(const d in l){const m=l[d],p=t(m,s);i.setAttribute(d,p)}const c=this.morphAttributes;for(const d in c){const m=[],p=c[d];for(let v=0,g=p.length;v<g;v++){const _=p[v],M=t(_,s);m.push(M)}i.morphAttributes[d]=m}i.morphTargetsRelative=this.morphTargetsRelative;const h=this.groups;for(let d=0,m=h.length;d<m;d++){const p=h[d];i.addGroup(p.start,p.count,p.materialIndex)}return i}toJSON(){const t={metadata:{version:4.7,type:"BufferGeometry",generator:"BufferGeometry.toJSON"}};if(t.uuid=this.uuid,t.type=this.type,this.name!==""&&(t.name=this.name),Object.keys(this.userData).length>0&&(t.userData=this.userData),this.parameters!==void 0){const m=this.parameters;for(const p in m)m[p]!==void 0&&(t[p]=m[p]);return t}t.data={attributes:{}};const i=this.index;i!==null&&(t.data.index={type:i.array.constructor.name,array:Array.prototype.slice.call(i.array)});const s=this.attributes;for(const m in s){const p=s[m];t.data.attributes[m]=p.toJSON(t.data)}const l={};let c=!1;for(const m in this.morphAttributes){const p=this.morphAttributes[m],v=[];for(let g=0,_=p.length;g<_;g++){const M=p[g];v.push(M.toJSON(t.data))}v.length>0&&(l[m]=v,c=!0)}c&&(t.data.morphAttributes=l,t.data.morphTargetsRelative=this.morphTargetsRelative);const h=this.groups;h.length>0&&(t.data.groups=JSON.parse(JSON.stringify(h)));const d=this.boundingSphere;return d!==null&&(t.data.boundingSphere=d.toJSON()),t}clone(){return new this.constructor().copy(this)}copy(t){this.index=null,this.attributes={},this.morphAttributes={},this.groups=[],this.boundingBox=null,this.boundingSphere=null;const i={};this.name=t.name;const s=t.index;s!==null&&this.setIndex(s.clone());const l=t.attributes;for(const p in l){const v=l[p];this.setAttribute(p,v.clone(i))}const c=t.morphAttributes;for(const p in c){const v=[],g=c[p];for(let _=0,M=g.length;_<M;_++)v.push(g[_].clone(i));this.morphAttributes[p]=v}this.morphTargetsRelative=t.morphTargetsRelative;const h=t.groups;for(let p=0,v=h.length;p<v;p++){const g=h[p];this.addGroup(g.start,g.count,g.materialIndex)}const d=t.boundingBox;d!==null&&(this.boundingBox=d.clone());const m=t.boundingSphere;return m!==null&&(this.boundingSphere=m.clone()),this.drawRange.start=t.drawRange.start,this.drawRange.count=t.drawRange.count,this.userData=t.userData,this}dispose(){this.dispatchEvent({type:"dispose"})}}class cE{constructor(t,i){this.isInterleavedBuffer=!0,this.array=t,this.stride=i,this.count=t!==void 0?t.length/i:0,this.usage=dp,this.updateRanges=[],this.version=0,this.uuid=Na()}onUploadCallback(){}set needsUpdate(t){t===!0&&this.version++}setUsage(t){return this.usage=t,this}addUpdateRange(t,i){this.updateRanges.push({start:t,count:i})}clearUpdateRanges(){this.updateRanges.length=0}copy(t){return this.array=new t.array.constructor(t.array),this.count=t.count,this.stride=t.stride,this.usage=t.usage,this}copyAt(t,i,s){t*=this.stride,s*=i.stride;for(let l=0,c=this.stride;l<c;l++)this.array[t+l]=i.array[s+l];return this}set(t,i=0){return this.array.set(t,i),this}clone(t){t.arrayBuffers===void 0&&(t.arrayBuffers={}),this.array.buffer._uuid===void 0&&(this.array.buffer._uuid=Na()),t.arrayBuffers[this.array.buffer._uuid]===void 0&&(t.arrayBuffers[this.array.buffer._uuid]=this.array.slice(0).buffer);const i=new this.array.constructor(t.arrayBuffers[this.array.buffer._uuid]),s=new this.constructor(i,this.stride);return s.setUsage(this.usage),s}onUpload(t){return this.onUploadCallback=t,this}toJSON(t){return t.arrayBuffers===void 0&&(t.arrayBuffers={}),this.array.buffer._uuid===void 0&&(this.array.buffer._uuid=Na()),t.arrayBuffers[this.array.buffer._uuid]===void 0&&(t.arrayBuffers[this.array.buffer._uuid]=Array.from(new Uint32Array(this.array.buffer))),{uuid:this.uuid,buffer:this.array.buffer._uuid,type:this.array.constructor.name,stride:this.stride}}}const Vn=new j;class _s{constructor(t,i,s,l=!1){this.isInterleavedBufferAttribute=!0,this.name="",this.data=t,this.itemSize=i,this.offset=s,this.normalized=l}get count(){return this.data.count}get array(){return this.data.array}set needsUpdate(t){this.data.needsUpdate=t}applyMatrix4(t){for(let i=0,s=this.data.count;i<s;i++)Vn.fromBufferAttribute(this,i),Vn.applyMatrix4(t),this.setXYZ(i,Vn.x,Vn.y,Vn.z);return this}applyNormalMatrix(t){for(let i=0,s=this.count;i<s;i++)Vn.fromBufferAttribute(this,i),Vn.applyNormalMatrix(t),this.setXYZ(i,Vn.x,Vn.y,Vn.z);return this}transformDirection(t){for(let i=0,s=this.count;i<s;i++)Vn.fromBufferAttribute(this,i),Vn.transformDirection(t),this.setXYZ(i,Vn.x,Vn.y,Vn.z);return this}getComponent(t,i){let s=this.array[t*this.data.stride+this.offset+i];return this.normalized&&(s=Hi(s,this.array)),s}setComponent(t,i,s){return this.normalized&&(s=Be(s,this.array)),this.data.array[t*this.data.stride+this.offset+i]=s,this}setX(t,i){return this.normalized&&(i=Be(i,this.array)),this.data.array[t*this.data.stride+this.offset]=i,this}setY(t,i){return this.normalized&&(i=Be(i,this.array)),this.data.array[t*this.data.stride+this.offset+1]=i,this}setZ(t,i){return this.normalized&&(i=Be(i,this.array)),this.data.array[t*this.data.stride+this.offset+2]=i,this}setW(t,i){return this.normalized&&(i=Be(i,this.array)),this.data.array[t*this.data.stride+this.offset+3]=i,this}getX(t){let i=this.data.array[t*this.data.stride+this.offset];return this.normalized&&(i=Hi(i,this.array)),i}getY(t){let i=this.data.array[t*this.data.stride+this.offset+1];return this.normalized&&(i=Hi(i,this.array)),i}getZ(t){let i=this.data.array[t*this.data.stride+this.offset+2];return this.normalized&&(i=Hi(i,this.array)),i}getW(t){let i=this.data.array[t*this.data.stride+this.offset+3];return this.normalized&&(i=Hi(i,this.array)),i}setXY(t,i,s){return t=t*this.data.stride+this.offset,this.normalized&&(i=Be(i,this.array),s=Be(s,this.array)),this.data.array[t+0]=i,this.data.array[t+1]=s,this}setXYZ(t,i,s,l){return t=t*this.data.stride+this.offset,this.normalized&&(i=Be(i,this.array),s=Be(s,this.array),l=Be(l,this.array)),this.data.array[t+0]=i,this.data.array[t+1]=s,this.data.array[t+2]=l,this}setXYZW(t,i,s,l,c){return t=t*this.data.stride+this.offset,this.normalized&&(i=Be(i,this.array),s=Be(s,this.array),l=Be(l,this.array),c=Be(c,this.array)),this.data.array[t+0]=i,this.data.array[t+1]=s,this.data.array[t+2]=l,this.data.array[t+3]=c,this}clone(t){if(t===void 0){Su("InterleavedBufferAttribute.clone(): Cloning an interleaved buffer attribute will de-interleave buffer data.");const i=[];for(let s=0;s<this.count;s++){const l=s*this.data.stride+this.offset;for(let c=0;c<this.itemSize;c++)i.push(this.data.array[l+c])}return new pi(new this.array.constructor(i),this.itemSize,this.normalized)}else return t.interleavedBuffers===void 0&&(t.interleavedBuffers={}),t.interleavedBuffers[this.data.uuid]===void 0&&(t.interleavedBuffers[this.data.uuid]=this.data.clone(t)),new _s(t.interleavedBuffers[this.data.uuid],this.itemSize,this.offset,this.normalized)}toJSON(t){if(t===void 0){Su("InterleavedBufferAttribute.toJSON(): Serializing an interleaved buffer attribute will de-interleave buffer data.");const i=[];for(let s=0;s<this.count;s++){const l=s*this.data.stride+this.offset;for(let c=0;c<this.itemSize;c++)i.push(this.data.array[l+c])}return{itemSize:this.itemSize,type:this.array.constructor.name,array:i,normalized:this.normalized}}else return t.interleavedBuffers===void 0&&(t.interleavedBuffers={}),t.interleavedBuffers[this.data.uuid]===void 0&&(t.interleavedBuffers[this.data.uuid]=this.data.toJSON(t)),{isInterleavedBufferAttribute:!0,itemSize:this.itemSize,data:this.data.uuid,offset:this.offset,normalized:this.normalized}}}let uE=0;class co extends $s{constructor(){super(),this.isMaterial=!0,Object.defineProperty(this,"id",{value:uE++}),this.uuid=Na(),this.name="",this.type="Material",this.blending=eo,this.side=xs,this.vertexColors=!1,this.opacity=1,this.transparent=!1,this.alphaHash=!1,this.blendSrc=bd,this.blendDst=Td,this.blendEquation=qs,this.blendSrcAlpha=null,this.blendDstAlpha=null,this.blendEquationAlpha=null,this.blendColor=new Se(0,0,0),this.blendAlpha=0,this.depthFunc=io,this.depthTest=!0,this.depthWrite=!0,this.stencilWriteMask=255,this.stencilFunc=U_,this.stencilRef=0,this.stencilFuncMask=255,this.stencilFail=zr,this.stencilZFail=zr,this.stencilZPass=zr,this.stencilWrite=!1,this.clippingPlanes=null,this.clipIntersection=!1,this.clipShadows=!1,this.shadowSide=null,this.colorWrite=!0,this.precision=null,this.polygonOffset=!1,this.polygonOffsetFactor=0,this.polygonOffsetUnits=0,this.dithering=!1,this.alphaToCoverage=!1,this.premultipliedAlpha=!1,this.forceSinglePass=!1,this.allowOverride=!0,this.visible=!0,this.toneMapped=!0,this.userData={},this.version=0,this._alphaTest=0}get alphaTest(){return this._alphaTest}set alphaTest(t){this._alphaTest>0!=t>0&&this.version++,this._alphaTest=t}onBeforeRender(){}onBeforeCompile(){}customProgramCacheKey(){return this.onBeforeCompile.toString()}setValues(t){if(t!==void 0)for(const i in t){const s=t[i];if(s===void 0){ee(`Material: parameter '${i}' has value of undefined.`);continue}const l=this[i];if(l===void 0){ee(`Material: '${i}' is not a property of THREE.${this.type}.`);continue}l&&l.isColor?l.set(s):l&&l.isVector3&&s&&s.isVector3?l.copy(s):this[i]=s}}toJSON(t){const i=t===void 0||typeof t=="string";i&&(t={textures:{},images:{}});const s={metadata:{version:4.7,type:"Material",generator:"Material.toJSON"}};s.uuid=this.uuid,s.type=this.type,this.name!==""&&(s.name=this.name),this.color&&this.color.isColor&&(s.color=this.color.getHex()),this.roughness!==void 0&&(s.roughness=this.roughness),this.metalness!==void 0&&(s.metalness=this.metalness),this.sheen!==void 0&&(s.sheen=this.sheen),this.sheenColor&&this.sheenColor.isColor&&(s.sheenColor=this.sheenColor.getHex()),this.sheenRoughness!==void 0&&(s.sheenRoughness=this.sheenRoughness),this.emissive&&this.emissive.isColor&&(s.emissive=this.emissive.getHex()),this.emissiveIntensity!==void 0&&this.emissiveIntensity!==1&&(s.emissiveIntensity=this.emissiveIntensity),this.specular&&this.specular.isColor&&(s.specular=this.specular.getHex()),this.specularIntensity!==void 0&&(s.specularIntensity=this.specularIntensity),this.specularColor&&this.specularColor.isColor&&(s.specularColor=this.specularColor.getHex()),this.shininess!==void 0&&(s.shininess=this.shininess),this.clearcoat!==void 0&&(s.clearcoat=this.clearcoat),this.clearcoatRoughness!==void 0&&(s.clearcoatRoughness=this.clearcoatRoughness),this.clearcoatMap&&this.clearcoatMap.isTexture&&(s.clearcoatMap=this.clearcoatMap.toJSON(t).uuid),this.clearcoatRoughnessMap&&this.clearcoatRoughnessMap.isTexture&&(s.clearcoatRoughnessMap=this.clearcoatRoughnessMap.toJSON(t).uuid),this.clearcoatNormalMap&&this.clearcoatNormalMap.isTexture&&(s.clearcoatNormalMap=this.clearcoatNormalMap.toJSON(t).uuid,s.clearcoatNormalScale=this.clearcoatNormalScale.toArray()),this.sheenColorMap&&this.sheenColorMap.isTexture&&(s.sheenColorMap=this.sheenColorMap.toJSON(t).uuid),this.sheenRoughnessMap&&this.sheenRoughnessMap.isTexture&&(s.sheenRoughnessMap=this.sheenRoughnessMap.toJSON(t).uuid),this.dispersion!==void 0&&(s.dispersion=this.dispersion),this.iridescence!==void 0&&(s.iridescence=this.iridescence),this.iridescenceIOR!==void 0&&(s.iridescenceIOR=this.iridescenceIOR),this.iridescenceThicknessRange!==void 0&&(s.iridescenceThicknessRange=this.iridescenceThicknessRange),this.iridescenceMap&&this.iridescenceMap.isTexture&&(s.iridescenceMap=this.iridescenceMap.toJSON(t).uuid),this.iridescenceThicknessMap&&this.iridescenceThicknessMap.isTexture&&(s.iridescenceThicknessMap=this.iridescenceThicknessMap.toJSON(t).uuid),this.anisotropy!==void 0&&(s.anisotropy=this.anisotropy),this.anisotropyRotation!==void 0&&(s.anisotropyRotation=this.anisotropyRotation),this.anisotropyMap&&this.anisotropyMap.isTexture&&(s.anisotropyMap=this.anisotropyMap.toJSON(t).uuid),this.map&&this.map.isTexture&&(s.map=this.map.toJSON(t).uuid),this.matcap&&this.matcap.isTexture&&(s.matcap=this.matcap.toJSON(t).uuid),this.alphaMap&&this.alphaMap.isTexture&&(s.alphaMap=this.alphaMap.toJSON(t).uuid),this.lightMap&&this.lightMap.isTexture&&(s.lightMap=this.lightMap.toJSON(t).uuid,s.lightMapIntensity=this.lightMapIntensity),this.aoMap&&this.aoMap.isTexture&&(s.aoMap=this.aoMap.toJSON(t).uuid,s.aoMapIntensity=this.aoMapIntensity),this.bumpMap&&this.bumpMap.isTexture&&(s.bumpMap=this.bumpMap.toJSON(t).uuid,s.bumpScale=this.bumpScale),this.normalMap&&this.normalMap.isTexture&&(s.normalMap=this.normalMap.toJSON(t).uuid,s.normalMapType=this.normalMapType,s.normalScale=this.normalScale.toArray()),this.displacementMap&&this.displacementMap.isTexture&&(s.displacementMap=this.displacementMap.toJSON(t).uuid,s.displacementScale=this.displacementScale,s.displacementBias=this.displacementBias),this.roughnessMap&&this.roughnessMap.isTexture&&(s.roughnessMap=this.roughnessMap.toJSON(t).uuid),this.metalnessMap&&this.metalnessMap.isTexture&&(s.metalnessMap=this.metalnessMap.toJSON(t).uuid),this.emissiveMap&&this.emissiveMap.isTexture&&(s.emissiveMap=this.emissiveMap.toJSON(t).uuid),this.specularMap&&this.specularMap.isTexture&&(s.specularMap=this.specularMap.toJSON(t).uuid),this.specularIntensityMap&&this.specularIntensityMap.isTexture&&(s.specularIntensityMap=this.specularIntensityMap.toJSON(t).uuid),this.specularColorMap&&this.specularColorMap.isTexture&&(s.specularColorMap=this.specularColorMap.toJSON(t).uuid),this.envMap&&this.envMap.isTexture&&(s.envMap=this.envMap.toJSON(t).uuid,this.combine!==void 0&&(s.combine=this.combine)),this.envMapRotation!==void 0&&(s.envMapRotation=this.envMapRotation.toArray()),this.envMapIntensity!==void 0&&(s.envMapIntensity=this.envMapIntensity),this.reflectivity!==void 0&&(s.reflectivity=this.reflectivity),this.refractionRatio!==void 0&&(s.refractionRatio=this.refractionRatio),this.gradientMap&&this.gradientMap.isTexture&&(s.gradientMap=this.gradientMap.toJSON(t).uuid),this.transmission!==void 0&&(s.transmission=this.transmission),this.transmissionMap&&this.transmissionMap.isTexture&&(s.transmissionMap=this.transmissionMap.toJSON(t).uuid),this.thickness!==void 0&&(s.thickness=this.thickness),this.thicknessMap&&this.thicknessMap.isTexture&&(s.thicknessMap=this.thicknessMap.toJSON(t).uuid),this.attenuationDistance!==void 0&&this.attenuationDistance!==1/0&&(s.attenuationDistance=this.attenuationDistance),this.attenuationColor!==void 0&&(s.attenuationColor=this.attenuationColor.getHex()),this.size!==void 0&&(s.size=this.size),this.shadowSide!==null&&(s.shadowSide=this.shadowSide),this.sizeAttenuation!==void 0&&(s.sizeAttenuation=this.sizeAttenuation),this.blending!==eo&&(s.blending=this.blending),this.side!==xs&&(s.side=this.side),this.vertexColors===!0&&(s.vertexColors=!0),this.opacity<1&&(s.opacity=this.opacity),this.transparent===!0&&(s.transparent=!0),this.blendSrc!==bd&&(s.blendSrc=this.blendSrc),this.blendDst!==Td&&(s.blendDst=this.blendDst),this.blendEquation!==qs&&(s.blendEquation=this.blendEquation),this.blendSrcAlpha!==null&&(s.blendSrcAlpha=this.blendSrcAlpha),this.blendDstAlpha!==null&&(s.blendDstAlpha=this.blendDstAlpha),this.blendEquationAlpha!==null&&(s.blendEquationAlpha=this.blendEquationAlpha),this.blendColor&&this.blendColor.isColor&&(s.blendColor=this.blendColor.getHex()),this.blendAlpha!==0&&(s.blendAlpha=this.blendAlpha),this.depthFunc!==io&&(s.depthFunc=this.depthFunc),this.depthTest===!1&&(s.depthTest=this.depthTest),this.depthWrite===!1&&(s.depthWrite=this.depthWrite),this.colorWrite===!1&&(s.colorWrite=this.colorWrite),this.stencilWriteMask!==255&&(s.stencilWriteMask=this.stencilWriteMask),this.stencilFunc!==U_&&(s.stencilFunc=this.stencilFunc),this.stencilRef!==0&&(s.stencilRef=this.stencilRef),this.stencilFuncMask!==255&&(s.stencilFuncMask=this.stencilFuncMask),this.stencilFail!==zr&&(s.stencilFail=this.stencilFail),this.stencilZFail!==zr&&(s.stencilZFail=this.stencilZFail),this.stencilZPass!==zr&&(s.stencilZPass=this.stencilZPass),this.stencilWrite===!0&&(s.stencilWrite=this.stencilWrite),this.rotation!==void 0&&this.rotation!==0&&(s.rotation=this.rotation),this.polygonOffset===!0&&(s.polygonOffset=!0),this.polygonOffsetFactor!==0&&(s.polygonOffsetFactor=this.polygonOffsetFactor),this.polygonOffsetUnits!==0&&(s.polygonOffsetUnits=this.polygonOffsetUnits),this.linewidth!==void 0&&this.linewidth!==1&&(s.linewidth=this.linewidth),this.dashSize!==void 0&&(s.dashSize=this.dashSize),this.gapSize!==void 0&&(s.gapSize=this.gapSize),this.scale!==void 0&&(s.scale=this.scale),this.dithering===!0&&(s.dithering=!0),this.alphaTest>0&&(s.alphaTest=this.alphaTest),this.alphaHash===!0&&(s.alphaHash=!0),this.alphaToCoverage===!0&&(s.alphaToCoverage=!0),this.premultipliedAlpha===!0&&(s.premultipliedAlpha=!0),this.forceSinglePass===!0&&(s.forceSinglePass=!0),this.allowOverride===!1&&(s.allowOverride=!1),this.wireframe===!0&&(s.wireframe=!0),this.wireframeLinewidth>1&&(s.wireframeLinewidth=this.wireframeLinewidth),this.wireframeLinecap!=="round"&&(s.wireframeLinecap=this.wireframeLinecap),this.wireframeLinejoin!=="round"&&(s.wireframeLinejoin=this.wireframeLinejoin),this.flatShading===!0&&(s.flatShading=!0),this.visible===!1&&(s.visible=!1),this.toneMapped===!1&&(s.toneMapped=!1),this.fog===!1&&(s.fog=!1),Object.keys(this.userData).length>0&&(s.userData=this.userData);function l(c){const h=[];for(const d in c){const m=c[d];delete m.metadata,h.push(m)}return h}if(i){const c=l(t.textures),h=l(t.images);c.length>0&&(s.textures=c),h.length>0&&(s.images=h)}return s}clone(){return new this.constructor().copy(this)}copy(t){this.name=t.name,this.blending=t.blending,this.side=t.side,this.vertexColors=t.vertexColors,this.opacity=t.opacity,this.transparent=t.transparent,this.blendSrc=t.blendSrc,this.blendDst=t.blendDst,this.blendEquation=t.blendEquation,this.blendSrcAlpha=t.blendSrcAlpha,this.blendDstAlpha=t.blendDstAlpha,this.blendEquationAlpha=t.blendEquationAlpha,this.blendColor.copy(t.blendColor),this.blendAlpha=t.blendAlpha,this.depthFunc=t.depthFunc,this.depthTest=t.depthTest,this.depthWrite=t.depthWrite,this.stencilWriteMask=t.stencilWriteMask,this.stencilFunc=t.stencilFunc,this.stencilRef=t.stencilRef,this.stencilFuncMask=t.stencilFuncMask,this.stencilFail=t.stencilFail,this.stencilZFail=t.stencilZFail,this.stencilZPass=t.stencilZPass,this.stencilWrite=t.stencilWrite;const i=t.clippingPlanes;let s=null;if(i!==null){const l=i.length;s=new Array(l);for(let c=0;c!==l;++c)s[c]=i[c].clone()}return this.clippingPlanes=s,this.clipIntersection=t.clipIntersection,this.clipShadows=t.clipShadows,this.shadowSide=t.shadowSide,this.colorWrite=t.colorWrite,this.precision=t.precision,this.polygonOffset=t.polygonOffset,this.polygonOffsetFactor=t.polygonOffsetFactor,this.polygonOffsetUnits=t.polygonOffsetUnits,this.dithering=t.dithering,this.alphaTest=t.alphaTest,this.alphaHash=t.alphaHash,this.alphaToCoverage=t.alphaToCoverage,this.premultipliedAlpha=t.premultipliedAlpha,this.forceSinglePass=t.forceSinglePass,this.allowOverride=t.allowOverride,this.visible=t.visible,this.toneMapped=t.toneMapped,this.userData=JSON.parse(JSON.stringify(t.userData)),this}dispose(){this.dispatchEvent({type:"dispose"})}set needsUpdate(t){t===!0&&this.version++}}const wa=new j,rd=new j,kc=new j,ds=new j,od=new j,Xc=new j,ld=new j;class Lp{constructor(t=new j,i=new j(0,0,-1)){this.origin=t,this.direction=i}set(t,i){return this.origin.copy(t),this.direction.copy(i),this}copy(t){return this.origin.copy(t.origin),this.direction.copy(t.direction),this}at(t,i){return i.copy(this.origin).addScaledVector(this.direction,t)}lookAt(t){return this.direction.copy(t).sub(this.origin).normalize(),this}recast(t){return this.origin.copy(this.at(t,wa)),this}closestPointToPoint(t,i){i.subVectors(t,this.origin);const s=i.dot(this.direction);return s<0?i.copy(this.origin):i.copy(this.origin).addScaledVector(this.direction,s)}distanceToPoint(t){return Math.sqrt(this.distanceSqToPoint(t))}distanceSqToPoint(t){const i=wa.subVectors(t,this.origin).dot(this.direction);return i<0?this.origin.distanceToSquared(t):(wa.copy(this.origin).addScaledVector(this.direction,i),wa.distanceToSquared(t))}distanceSqToSegment(t,i,s,l){rd.copy(t).add(i).multiplyScalar(.5),kc.copy(i).sub(t).normalize(),ds.copy(this.origin).sub(rd);const c=t.distanceTo(i)*.5,h=-this.direction.dot(kc),d=ds.dot(this.direction),m=-ds.dot(kc),p=ds.lengthSq(),v=Math.abs(1-h*h);let g,_,M,E;if(v>0)if(g=h*m-d,_=h*d-m,E=c*v,g>=0)if(_>=-E)if(_<=E){const A=1/v;g*=A,_*=A,M=g*(g+h*_+2*d)+_*(h*g+_+2*m)+p}else _=c,g=Math.max(0,-(h*_+d)),M=-g*g+_*(_+2*m)+p;else _=-c,g=Math.max(0,-(h*_+d)),M=-g*g+_*(_+2*m)+p;else _<=-E?(g=Math.max(0,-(-h*c+d)),_=g>0?-c:Math.min(Math.max(-c,-m),c),M=-g*g+_*(_+2*m)+p):_<=E?(g=0,_=Math.min(Math.max(-c,-m),c),M=_*(_+2*m)+p):(g=Math.max(0,-(h*c+d)),_=g>0?c:Math.min(Math.max(-c,-m),c),M=-g*g+_*(_+2*m)+p);else _=h>0?-c:c,g=Math.max(0,-(h*_+d)),M=-g*g+_*(_+2*m)+p;return s&&s.copy(this.origin).addScaledVector(this.direction,g),l&&l.copy(rd).addScaledVector(kc,_),M}intersectSphere(t,i){wa.subVectors(t.center,this.origin);const s=wa.dot(this.direction),l=wa.dot(wa)-s*s,c=t.radius*t.radius;if(l>c)return null;const h=Math.sqrt(c-l),d=s-h,m=s+h;return m<0?null:d<0?this.at(m,i):this.at(d,i)}intersectsSphere(t){return t.radius<0?!1:this.distanceSqToPoint(t.center)<=t.radius*t.radius}distanceToPlane(t){const i=t.normal.dot(this.direction);if(i===0)return t.distanceToPoint(this.origin)===0?0:null;const s=-(this.origin.dot(t.normal)+t.constant)/i;return s>=0?s:null}intersectPlane(t,i){const s=this.distanceToPlane(t);return s===null?null:this.at(s,i)}intersectsPlane(t){const i=t.distanceToPoint(this.origin);return i===0||t.normal.dot(this.direction)*i<0}intersectBox(t,i){let s,l,c,h,d,m;const p=1/this.direction.x,v=1/this.direction.y,g=1/this.direction.z,_=this.origin;return p>=0?(s=(t.min.x-_.x)*p,l=(t.max.x-_.x)*p):(s=(t.max.x-_.x)*p,l=(t.min.x-_.x)*p),v>=0?(c=(t.min.y-_.y)*v,h=(t.max.y-_.y)*v):(c=(t.max.y-_.y)*v,h=(t.min.y-_.y)*v),s>h||c>l||((c>s||isNaN(s))&&(s=c),(h<l||isNaN(l))&&(l=h),g>=0?(d=(t.min.z-_.z)*g,m=(t.max.z-_.z)*g):(d=(t.max.z-_.z)*g,m=(t.min.z-_.z)*g),s>m||d>l)||((d>s||s!==s)&&(s=d),(m<l||l!==l)&&(l=m),l<0)?null:this.at(s>=0?s:l,i)}intersectsBox(t){return this.intersectBox(t,wa)!==null}intersectTriangle(t,i,s,l,c){od.subVectors(i,t),Xc.subVectors(s,t),ld.crossVectors(od,Xc);let h=this.direction.dot(ld),d;if(h>0){if(l)return null;d=1}else if(h<0)d=-1,h=-h;else return null;ds.subVectors(this.origin,t);const m=d*this.direction.dot(Xc.crossVectors(ds,Xc));if(m<0)return null;const p=d*this.direction.dot(od.cross(ds));if(p<0||m+p>h)return null;const v=-d*ds.dot(ld);return v<0?null:this.at(v/h,c)}applyMatrix4(t){return this.origin.applyMatrix4(t),this.direction.transformDirection(t),this}equals(t){return t.origin.equals(this.origin)&&t.direction.equals(this.direction)}clone(){return new this.constructor().copy(this)}}class Np extends co{constructor(t){super(),this.isMeshBasicMaterial=!0,this.type="MeshBasicMaterial",this.color=new Se(16777215),this.map=null,this.lightMap=null,this.lightMapIntensity=1,this.aoMap=null,this.aoMapIntensity=1,this.specularMap=null,this.alphaMap=null,this.envMap=null,this.envMapRotation=new sa,this.combine=yp,this.reflectivity=1,this.refractionRatio=.98,this.wireframe=!1,this.wireframeLinewidth=1,this.wireframeLinecap="round",this.wireframeLinejoin="round",this.fog=!0,this.setValues(t)}copy(t){return super.copy(t),this.color.copy(t.color),this.map=t.map,this.lightMap=t.lightMap,this.lightMapIntensity=t.lightMapIntensity,this.aoMap=t.aoMap,this.aoMapIntensity=t.aoMapIntensity,this.specularMap=t.specularMap,this.alphaMap=t.alphaMap,this.envMap=t.envMap,this.envMapRotation.copy(t.envMapRotation),this.combine=t.combine,this.reflectivity=t.reflectivity,this.refractionRatio=t.refractionRatio,this.wireframe=t.wireframe,this.wireframeLinewidth=t.wireframeLinewidth,this.wireframeLinecap=t.wireframeLinecap,this.wireframeLinejoin=t.wireframeLinejoin,this.fog=t.fog,this}}const q_=new Je,Vs=new Lp,Wc=new lo,Y_=new j,qc=new j,Yc=new j,jc=new j,cd=new j,Zc=new j,j_=new j,Kc=new j;class mi extends Un{constructor(t=new Ln,i=new Np){super(),this.isMesh=!0,this.type="Mesh",this.geometry=t,this.material=i,this.morphTargetDictionary=void 0,this.morphTargetInfluences=void 0,this.count=1,this.updateMorphTargets()}copy(t,i){return super.copy(t,i),t.morphTargetInfluences!==void 0&&(this.morphTargetInfluences=t.morphTargetInfluences.slice()),t.morphTargetDictionary!==void 0&&(this.morphTargetDictionary=Object.assign({},t.morphTargetDictionary)),this.material=Array.isArray(t.material)?t.material.slice():t.material,this.geometry=t.geometry,this}updateMorphTargets(){const i=this.geometry.morphAttributes,s=Object.keys(i);if(s.length>0){const l=i[s[0]];if(l!==void 0){this.morphTargetInfluences=[],this.morphTargetDictionary={};for(let c=0,h=l.length;c<h;c++){const d=l[c].name||String(c);this.morphTargetInfluences.push(0),this.morphTargetDictionary[d]=c}}}}getVertexPosition(t,i){const s=this.geometry,l=s.attributes.position,c=s.morphAttributes.position,h=s.morphTargetsRelative;i.fromBufferAttribute(l,t);const d=this.morphTargetInfluences;if(c&&d){Zc.set(0,0,0);for(let m=0,p=c.length;m<p;m++){const v=d[m],g=c[m];v!==0&&(cd.fromBufferAttribute(g,t),h?Zc.addScaledVector(cd,v):Zc.addScaledVector(cd.sub(i),v))}i.add(Zc)}return i}raycast(t,i){const s=this.geometry,l=this.material,c=this.matrixWorld;l!==void 0&&(s.boundingSphere===null&&s.computeBoundingSphere(),Wc.copy(s.boundingSphere),Wc.applyMatrix4(c),Vs.copy(t.ray).recast(t.near),!(Wc.containsPoint(Vs.origin)===!1&&(Vs.intersectSphere(Wc,Y_)===null||Vs.origin.distanceToSquared(Y_)>(t.far-t.near)**2))&&(q_.copy(c).invert(),Vs.copy(t.ray).applyMatrix4(q_),!(s.boundingBox!==null&&Vs.intersectsBox(s.boundingBox)===!1)&&this._computeIntersections(t,i,Vs)))}_computeIntersections(t,i,s){let l;const c=this.geometry,h=this.material,d=c.index,m=c.attributes.position,p=c.attributes.uv,v=c.attributes.uv1,g=c.attributes.normal,_=c.groups,M=c.drawRange;if(d!==null)if(Array.isArray(h))for(let E=0,A=_.length;E<A;E++){const y=_[E],S=h[y.materialIndex],w=Math.max(y.start,M.start),D=Math.min(d.count,Math.min(y.start+y.count,M.start+M.count));for(let U=w,H=D;U<H;U+=3){const F=d.getX(U),I=d.getX(U+1),T=d.getX(U+2);l=Qc(this,S,t,s,p,v,g,F,I,T),l&&(l.faceIndex=Math.floor(U/3),l.face.materialIndex=y.materialIndex,i.push(l))}}else{const E=Math.max(0,M.start),A=Math.min(d.count,M.start+M.count);for(let y=E,S=A;y<S;y+=3){const w=d.getX(y),D=d.getX(y+1),U=d.getX(y+2);l=Qc(this,h,t,s,p,v,g,w,D,U),l&&(l.faceIndex=Math.floor(y/3),i.push(l))}}else if(m!==void 0)if(Array.isArray(h))for(let E=0,A=_.length;E<A;E++){const y=_[E],S=h[y.materialIndex],w=Math.max(y.start,M.start),D=Math.min(m.count,Math.min(y.start+y.count,M.start+M.count));for(let U=w,H=D;U<H;U+=3){const F=U,I=U+1,T=U+2;l=Qc(this,S,t,s,p,v,g,F,I,T),l&&(l.faceIndex=Math.floor(U/3),l.face.materialIndex=y.materialIndex,i.push(l))}}else{const E=Math.max(0,M.start),A=Math.min(m.count,M.start+M.count);for(let y=E,S=A;y<S;y+=3){const w=y,D=y+1,U=y+2;l=Qc(this,h,t,s,p,v,g,w,D,U),l&&(l.faceIndex=Math.floor(y/3),i.push(l))}}}}function fE(r,t,i,s,l,c,h,d){let m;if(t.side===ti?m=s.intersectTriangle(h,c,l,!0,d):m=s.intersectTriangle(l,c,h,t.side===xs,d),m===null)return null;Kc.copy(d),Kc.applyMatrix4(r.matrixWorld);const p=i.ray.origin.distanceTo(Kc);return p<i.near||p>i.far?null:{distance:p,point:Kc.clone(),object:r}}function Qc(r,t,i,s,l,c,h,d,m,p){r.getVertexPosition(d,qc),r.getVertexPosition(m,Yc),r.getVertexPosition(p,jc);const v=fE(r,t,i,s,qc,Yc,jc,j_);if(v){const g=new j;Gi.getBarycoord(j_,qc,Yc,jc,g),l&&(v.uv=Gi.getInterpolatedAttribute(l,d,m,p,g,new le)),c&&(v.uv1=Gi.getInterpolatedAttribute(c,d,m,p,g,new le)),h&&(v.normal=Gi.getInterpolatedAttribute(h,d,m,p,g,new j),v.normal.dot(s.direction)>0&&v.normal.multiplyScalar(-1));const _={a:d,b:m,c:p,normal:new j,materialIndex:0};Gi.getNormal(qc,Yc,jc,_.normal),v.face=_,v.barycoord=g}return v}class hE extends Wn{constructor(t=null,i=1,s=1,l,c,h,d,m,p=Dn,v=Dn,g,_){super(null,h,d,m,p,v,l,c,g,_),this.isDataTexture=!0,this.image={data:t,width:i,height:s},this.generateMipmaps=!1,this.flipY=!1,this.unpackAlignment=1}}const ud=new j,dE=new j,pE=new pe;class ms{constructor(t=new j(1,0,0),i=0){this.isPlane=!0,this.normal=t,this.constant=i}set(t,i){return this.normal.copy(t),this.constant=i,this}setComponents(t,i,s,l){return this.normal.set(t,i,s),this.constant=l,this}setFromNormalAndCoplanarPoint(t,i){return this.normal.copy(t),this.constant=-i.dot(this.normal),this}setFromCoplanarPoints(t,i,s){const l=ud.subVectors(s,i).cross(dE.subVectors(t,i)).normalize();return this.setFromNormalAndCoplanarPoint(l,t),this}copy(t){return this.normal.copy(t.normal),this.constant=t.constant,this}normalize(){const t=1/this.normal.length();return this.normal.multiplyScalar(t),this.constant*=t,this}negate(){return this.constant*=-1,this.normal.negate(),this}distanceToPoint(t){return this.normal.dot(t)+this.constant}distanceToSphere(t){return this.distanceToPoint(t.center)-t.radius}projectPoint(t,i){return i.copy(t).addScaledVector(this.normal,-this.distanceToPoint(t))}intersectLine(t,i){const s=t.delta(ud),l=this.normal.dot(s);if(l===0)return this.distanceToPoint(t.start)===0?i.copy(t.start):null;const c=-(t.start.dot(this.normal)+this.constant)/l;return c<0||c>1?null:i.copy(t.start).addScaledVector(s,c)}intersectsLine(t){const i=this.distanceToPoint(t.start),s=this.distanceToPoint(t.end);return i<0&&s>0||s<0&&i>0}intersectsBox(t){return t.intersectsPlane(this)}intersectsSphere(t){return t.intersectsPlane(this)}coplanarPoint(t){return t.copy(this.normal).multiplyScalar(-this.constant)}applyMatrix4(t,i){const s=i||pE.getNormalMatrix(t),l=this.coplanarPoint(ud).applyMatrix4(t),c=this.normal.applyMatrix3(s).normalize();return this.constant=-l.dot(c),this}translate(t){return this.constant-=t.dot(this.normal),this}equals(t){return t.normal.equals(this.normal)&&t.constant===this.constant}clone(){return new this.constructor().copy(this)}}const ks=new lo,mE=new le(.5,.5),Jc=new j;class Op{constructor(t=new ms,i=new ms,s=new ms,l=new ms,c=new ms,h=new ms){this.planes=[t,i,s,l,c,h]}set(t,i,s,l,c,h){const d=this.planes;return d[0].copy(t),d[1].copy(i),d[2].copy(s),d[3].copy(l),d[4].copy(c),d[5].copy(h),this}copy(t){const i=this.planes;for(let s=0;s<6;s++)i[s].copy(t.planes[s]);return this}setFromProjectionMatrix(t,i=ea,s=!1){const l=this.planes,c=t.elements,h=c[0],d=c[1],m=c[2],p=c[3],v=c[4],g=c[5],_=c[6],M=c[7],E=c[8],A=c[9],y=c[10],S=c[11],w=c[12],D=c[13],U=c[14],H=c[15];if(l[0].setComponents(p-h,M-v,S-E,H-w).normalize(),l[1].setComponents(p+h,M+v,S+E,H+w).normalize(),l[2].setComponents(p+d,M+g,S+A,H+D).normalize(),l[3].setComponents(p-d,M-g,S-A,H-D).normalize(),s)l[4].setComponents(m,_,y,U).normalize(),l[5].setComponents(p-m,M-_,S-y,H-U).normalize();else if(l[4].setComponents(p-m,M-_,S-y,H-U).normalize(),i===ea)l[5].setComponents(p+m,M+_,S+y,H+U).normalize();else if(i===gl)l[5].setComponents(m,_,y,U).normalize();else throw new Error("THREE.Frustum.setFromProjectionMatrix(): Invalid coordinate system: "+i);return this}intersectsObject(t){if(t.boundingSphere!==void 0)t.boundingSphere===null&&t.computeBoundingSphere(),ks.copy(t.boundingSphere).applyMatrix4(t.matrixWorld);else{const i=t.geometry;i.boundingSphere===null&&i.computeBoundingSphere(),ks.copy(i.boundingSphere).applyMatrix4(t.matrixWorld)}return this.intersectsSphere(ks)}intersectsSprite(t){ks.center.set(0,0,0);const i=mE.distanceTo(t.center);return ks.radius=.7071067811865476+i,ks.applyMatrix4(t.matrixWorld),this.intersectsSphere(ks)}intersectsSphere(t){const i=this.planes,s=t.center,l=-t.radius;for(let c=0;c<6;c++)if(i[c].distanceToPoint(s)<l)return!1;return!0}intersectsBox(t){const i=this.planes;for(let s=0;s<6;s++){const l=i[s];if(Jc.x=l.normal.x>0?t.max.x:t.min.x,Jc.y=l.normal.y>0?t.max.y:t.min.y,Jc.z=l.normal.z>0?t.max.z:t.min.z,l.distanceToPoint(Jc)<0)return!1}return!0}containsPoint(t){const i=this.planes;for(let s=0;s<6;s++)if(i[s].distanceToPoint(t)<0)return!1;return!0}clone(){return new this.constructor().copy(this)}}class vl extends co{constructor(t){super(),this.isLineBasicMaterial=!0,this.type="LineBasicMaterial",this.color=new Se(16777215),this.map=null,this.linewidth=1,this.linecap="round",this.linejoin="round",this.fog=!0,this.setValues(t)}copy(t){return super.copy(t),this.color.copy(t.color),this.map=t.map,this.linewidth=t.linewidth,this.linecap=t.linecap,this.linejoin=t.linejoin,this.fog=t.fog,this}}const Mu=new j,Eu=new j,Z_=new Je,ol=new Lp,$c=new lo,fd=new j,K_=new j;class bu extends Un{constructor(t=new Ln,i=new vl){super(),this.isLine=!0,this.type="Line",this.geometry=t,this.material=i,this.morphTargetDictionary=void 0,this.morphTargetInfluences=void 0,this.updateMorphTargets()}copy(t,i){return super.copy(t,i),this.material=Array.isArray(t.material)?t.material.slice():t.material,this.geometry=t.geometry,this}computeLineDistances(){const t=this.geometry;if(t.index===null){const i=t.attributes.position,s=[0];for(let l=1,c=i.count;l<c;l++)Mu.fromBufferAttribute(i,l-1),Eu.fromBufferAttribute(i,l),s[l]=s[l-1],s[l]+=Mu.distanceTo(Eu);t.setAttribute("lineDistance",new Mn(s,1))}else ee("Line.computeLineDistances(): Computation only possible with non-indexed BufferGeometry.");return this}raycast(t,i){const s=this.geometry,l=this.matrixWorld,c=t.params.Line.threshold,h=s.drawRange;if(s.boundingSphere===null&&s.computeBoundingSphere(),$c.copy(s.boundingSphere),$c.applyMatrix4(l),$c.radius+=c,t.ray.intersectsSphere($c)===!1)return;Z_.copy(l).invert(),ol.copy(t.ray).applyMatrix4(Z_);const d=c/((this.scale.x+this.scale.y+this.scale.z)/3),m=d*d,p=this.isLineSegments?2:1,v=s.index,_=s.attributes.position;if(v!==null){const M=Math.max(0,h.start),E=Math.min(v.count,h.start+h.count);for(let A=M,y=E-1;A<y;A+=p){const S=v.getX(A),w=v.getX(A+1),D=tu(this,t,ol,m,S,w,A);D&&i.push(D)}if(this.isLineLoop){const A=v.getX(E-1),y=v.getX(M),S=tu(this,t,ol,m,A,y,E-1);S&&i.push(S)}}else{const M=Math.max(0,h.start),E=Math.min(_.count,h.start+h.count);for(let A=M,y=E-1;A<y;A+=p){const S=tu(this,t,ol,m,A,A+1,A);S&&i.push(S)}if(this.isLineLoop){const A=tu(this,t,ol,m,E-1,M,E-1);A&&i.push(A)}}}updateMorphTargets(){const i=this.geometry.morphAttributes,s=Object.keys(i);if(s.length>0){const l=i[s[0]];if(l!==void 0){this.morphTargetInfluences=[],this.morphTargetDictionary={};for(let c=0,h=l.length;c<h;c++){const d=l[c].name||String(c);this.morphTargetInfluences.push(0),this.morphTargetDictionary[d]=c}}}}}function tu(r,t,i,s,l,c,h){const d=r.geometry.attributes.position;if(Mu.fromBufferAttribute(d,l),Eu.fromBufferAttribute(d,c),i.distanceSqToSegment(Mu,Eu,fd,K_)>s)return;fd.applyMatrix4(r.matrixWorld);const p=t.ray.origin.distanceTo(fd);if(!(p<t.near||p>t.far))return{distance:p,point:K_.clone().applyMatrix4(r.matrixWorld),index:h,face:null,faceIndex:null,barycoord:null,object:r}}const Q_=new j,J_=new j;class $_ extends bu{constructor(t,i){super(t,i),this.isLineSegments=!0,this.type="LineSegments"}computeLineDistances(){const t=this.geometry;if(t.index===null){const i=t.attributes.position,s=[];for(let l=0,c=i.count;l<c;l+=2)Q_.fromBufferAttribute(i,l),J_.fromBufferAttribute(i,l+1),s[l]=l===0?0:s[l-1],s[l+1]=s[l]+Q_.distanceTo(J_);t.setAttribute("lineDistance",new Mn(s,1))}else ee("LineSegments.computeLineDistances(): Computation only possible with non-indexed BufferGeometry.");return this}}class dx extends Wn{constructor(t=[],i=Js,s,l,c,h,d,m,p,v){super(t,i,s,l,c,h,d,m,p,v),this.isCubeTexture=!0,this.flipY=!1}get images(){return this.image}set images(t){this.image=t}}class xl extends Wn{constructor(t,i,s=aa,l,c,h,d=Dn,m=Dn,p,v=za,g=1){if(v!==za&&v!==Ks)throw new Error("DepthTexture format must be either THREE.DepthFormat or THREE.DepthStencilFormat");const _={width:t,height:i,depth:g};super(_,l,c,h,d,m,v,s,p),this.isDepthTexture=!0,this.flipY=!1,this.generateMipmaps=!1,this.compareFunction=null}copy(t){return super.copy(t),this.source=new Up(Object.assign({},t.image)),this.compareFunction=t.compareFunction,this}toJSON(t){const i=super.toJSON(t);return this.compareFunction!==null&&(i.compareFunction=this.compareFunction),i}}class gE extends xl{constructor(t,i=aa,s=Js,l,c,h=Dn,d=Dn,m,p=za){const v={width:t,height:t,depth:1},g=[v,v,v,v,v,v];super(t,t,i,s,l,c,h,d,m,p),this.image=g,this.isCubeDepthTexture=!0,this.isCubeTexture=!0}get images(){return this.image}set images(t){this.image=t}}class px extends Wn{constructor(t=null){super(),this.sourceTexture=t,this.isExternalTexture=!0}copy(t){return super.copy(t),this.sourceTexture=t.sourceTexture,this}}class Sl extends Ln{constructor(t=1,i=1,s=1,l=1,c=1,h=1){super(),this.type="BoxGeometry",this.parameters={width:t,height:i,depth:s,widthSegments:l,heightSegments:c,depthSegments:h};const d=this;l=Math.floor(l),c=Math.floor(c),h=Math.floor(h);const m=[],p=[],v=[],g=[];let _=0,M=0;E("z","y","x",-1,-1,s,i,t,h,c,0),E("z","y","x",1,-1,s,i,-t,h,c,1),E("x","z","y",1,1,t,s,i,l,h,2),E("x","z","y",1,-1,t,s,-i,l,h,3),E("x","y","z",1,-1,t,i,s,l,c,4),E("x","y","z",-1,-1,t,i,-s,l,c,5),this.setIndex(m),this.setAttribute("position",new Mn(p,3)),this.setAttribute("normal",new Mn(v,3)),this.setAttribute("uv",new Mn(g,2));function E(A,y,S,w,D,U,H,F,I,T,L){const Q=U/I,P=H/T,W=U/2,J=H/2,rt=F/2,et=I+1,O=T+1;let B=0,at=0;const $=new j;for(let lt=0;lt<O;lt++){const N=lt*P-J;for(let k=0;k<et;k++){const ut=k*Q-W;$[A]=ut*w,$[y]=N*D,$[S]=rt,p.push($.x,$.y,$.z),$[A]=0,$[y]=0,$[S]=F>0?1:-1,v.push($.x,$.y,$.z),g.push(k/I),g.push(1-lt/T),B+=1}}for(let lt=0;lt<T;lt++)for(let N=0;N<I;N++){const k=_+N+et*lt,ut=_+N+et*(lt+1),vt=_+(N+1)+et*(lt+1),Rt=_+(N+1)+et*lt;m.push(k,ut,Rt),m.push(ut,vt,Rt),at+=6}d.addGroup(M,at,L),M+=at,_+=B}}copy(t){return super.copy(t),this.parameters=Object.assign({},t.parameters),this}static fromJSON(t){return new Sl(t.width,t.height,t.depth,t.widthSegments,t.heightSegments,t.depthSegments)}}class Au extends Ln{constructor(t=1,i=1,s=1,l=1){super(),this.type="PlaneGeometry",this.parameters={width:t,height:i,widthSegments:s,heightSegments:l};const c=t/2,h=i/2,d=Math.floor(s),m=Math.floor(l),p=d+1,v=m+1,g=t/d,_=i/m,M=[],E=[],A=[],y=[];for(let S=0;S<v;S++){const w=S*_-h;for(let D=0;D<p;D++){const U=D*g-c;E.push(U,-w,0),A.push(0,0,1),y.push(D/d),y.push(1-S/m)}}for(let S=0;S<m;S++)for(let w=0;w<d;w++){const D=w+p*S,U=w+p*(S+1),H=w+1+p*(S+1),F=w+1+p*S;M.push(D,U,F),M.push(U,H,F)}this.setIndex(M),this.setAttribute("position",new Mn(E,3)),this.setAttribute("normal",new Mn(A,3)),this.setAttribute("uv",new Mn(y,2))}copy(t){return super.copy(t),this.parameters=Object.assign({},t.parameters),this}static fromJSON(t){return new Au(t.width,t.height,t.widthSegments,t.heightSegments)}}class Pp extends Ln{constructor(t=1,i=32,s=16,l=0,c=Math.PI*2,h=0,d=Math.PI){super(),this.type="SphereGeometry",this.parameters={radius:t,widthSegments:i,heightSegments:s,phiStart:l,phiLength:c,thetaStart:h,thetaLength:d},i=Math.max(3,Math.floor(i)),s=Math.max(2,Math.floor(s));const m=Math.min(h+d,Math.PI);let p=0;const v=[],g=new j,_=new j,M=[],E=[],A=[],y=[];for(let S=0;S<=s;S++){const w=[],D=S/s;let U=0;S===0&&h===0?U=.5/i:S===s&&m===Math.PI&&(U=-.5/i);for(let H=0;H<=i;H++){const F=H/i;g.x=-t*Math.cos(l+F*c)*Math.sin(h+D*d),g.y=t*Math.cos(h+D*d),g.z=t*Math.sin(l+F*c)*Math.sin(h+D*d),E.push(g.x,g.y,g.z),_.copy(g).normalize(),A.push(_.x,_.y,_.z),y.push(F+U,1-D),w.push(p++)}v.push(w)}for(let S=0;S<s;S++)for(let w=0;w<i;w++){const D=v[S][w+1],U=v[S][w],H=v[S+1][w],F=v[S+1][w+1];(S!==0||h>0)&&M.push(D,U,F),(S!==s-1||m<Math.PI)&&M.push(U,H,F)}this.setIndex(M),this.setAttribute("position",new Mn(E,3)),this.setAttribute("normal",new Mn(A,3)),this.setAttribute("uv",new Mn(y,2))}copy(t){return super.copy(t),this.parameters=Object.assign({},t.parameters),this}static fromJSON(t){return new Pp(t.radius,t.widthSegments,t.heightSegments,t.phiStart,t.phiLength,t.thetaStart,t.thetaLength)}}class _E extends Ln{constructor(t=null){if(super(),this.type="WireframeGeometry",this.parameters={geometry:t},t!==null){const i=[],s=new Set,l=new j,c=new j;if(t.index!==null){const h=t.attributes.position,d=t.index;let m=t.groups;m.length===0&&(m=[{start:0,count:d.count,materialIndex:0}]);for(let p=0,v=m.length;p<v;++p){const g=m[p],_=g.start,M=g.count;for(let E=_,A=_+M;E<A;E+=3)for(let y=0;y<3;y++){const S=d.getX(E+y),w=d.getX(E+(y+1)%3);l.fromBufferAttribute(h,S),c.fromBufferAttribute(h,w),tv(l,c,s)===!0&&(i.push(l.x,l.y,l.z),i.push(c.x,c.y,c.z))}}}else{const h=t.attributes.position;for(let d=0,m=h.count/3;d<m;d++)for(let p=0;p<3;p++){const v=3*d+p,g=3*d+(p+1)%3;l.fromBufferAttribute(h,v),c.fromBufferAttribute(h,g),tv(l,c,s)===!0&&(i.push(l.x,l.y,l.z),i.push(c.x,c.y,c.z))}}this.setAttribute("position",new Mn(i,3))}}copy(t){return super.copy(t),this.parameters=Object.assign({},t.parameters),this}}function tv(r,t,i){const s=`${r.x},${r.y},${r.z}-${t.x},${t.y},${t.z}`,l=`${t.x},${t.y},${t.z}-${r.x},${r.y},${r.z}`;return i.has(s)===!0||i.has(l)===!0?!1:(i.add(s),i.add(l),!0)}function oo(r){const t={};for(const i in r){t[i]={};for(const s in r[i]){const l=r[i][s];l&&(l.isColor||l.isMatrix3||l.isMatrix4||l.isVector2||l.isVector3||l.isVector4||l.isTexture||l.isQuaternion)?l.isRenderTargetTexture?(ee("UniformsUtils: Textures of render targets cannot be cloned via cloneUniforms() or mergeUniforms()."),t[i][s]=null):t[i][s]=l.clone():Array.isArray(l)?t[i][s]=l.slice():t[i][s]=l}}return t}function kn(r){const t={};for(let i=0;i<r.length;i++){const s=oo(r[i]);for(const l in s)t[l]=s[l]}return t}function vE(r){const t=[];for(let i=0;i<r.length;i++)t.push(r[i].clone());return t}function mx(r){const t=r.getRenderTarget();return t===null?r.outputColorSpace:t.isXRRenderTarget===!0?t.texture.colorSpace:Re.workingColorSpace}const zp={clone:oo,merge:kn};var xE=`void main() {
10
10
  gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );
11
- }`,_E=`void main() {
11
+ }`,SE=`void main() {
12
12
  gl_FragColor = vec4( 1.0, 0.0, 0.0, 1.0 );
13
- }`;class Xi extends oo{constructor(t){super(),this.isShaderMaterial=!0,this.type="ShaderMaterial",this.defines={},this.uniforms={},this.uniformsGroups=[],this.vertexShader=gE,this.fragmentShader=_E,this.linewidth=1,this.wireframe=!1,this.wireframeLinewidth=1,this.fog=!1,this.lights=!1,this.clipping=!1,this.forceSinglePass=!0,this.extensions={clipCullDistance:!1,multiDraw:!1},this.defaultAttributeValues={color:[1,1,1],uv:[0,0],uv1:[0,0]},this.index0AttributeName=void 0,this.uniformsNeedUpdate=!1,this.glslVersion=null,t!==void 0&&this.setValues(t)}copy(t){return super.copy(t),this.fragmentShader=t.fragmentShader,this.vertexShader=t.vertexShader,this.uniforms=so(t.uniforms),this.uniformsGroups=mE(t.uniformsGroups),this.defines=Object.assign({},t.defines),this.wireframe=t.wireframe,this.wireframeLinewidth=t.wireframeLinewidth,this.fog=t.fog,this.lights=t.lights,this.clipping=t.clipping,this.extensions=Object.assign({},t.extensions),this.glslVersion=t.glslVersion,this.defaultAttributeValues=Object.assign({},t.defaultAttributeValues),this.index0AttributeName=t.index0AttributeName,this.uniformsNeedUpdate=t.uniformsNeedUpdate,this}toJSON(t){const i=super.toJSON(t);i.glslVersion=this.glslVersion,i.uniforms={};for(const l in this.uniforms){const h=this.uniforms[l].value;h&&h.isTexture?i.uniforms[l]={type:"t",value:h.toJSON(t).uuid}:h&&h.isColor?i.uniforms[l]={type:"c",value:h.getHex()}:h&&h.isVector2?i.uniforms[l]={type:"v2",value:h.toArray()}:h&&h.isVector3?i.uniforms[l]={type:"v3",value:h.toArray()}:h&&h.isVector4?i.uniforms[l]={type:"v4",value:h.toArray()}:h&&h.isMatrix3?i.uniforms[l]={type:"m3",value:h.toArray()}:h&&h.isMatrix4?i.uniforms[l]={type:"m4",value:h.toArray()}:i.uniforms[l]={value:h}}Object.keys(this.defines).length>0&&(i.defines=this.defines),i.vertexShader=this.vertexShader,i.fragmentShader=this.fragmentShader,i.lights=this.lights,i.clipping=this.clipping;const s={};for(const l in this.extensions)this.extensions[l]===!0&&(s[l]=!0);return Object.keys(s).length>0&&(i.extensions=s),i}}class vE extends Xi{constructor(t){super(t),this.isRawShaderMaterial=!0,this.type="RawShaderMaterial"}}class tv extends oo{constructor(t){super(),this.isMeshPhongMaterial=!0,this.type="MeshPhongMaterial",this.color=new Se(16777215),this.specular=new Se(1118481),this.shininess=30,this.map=null,this.lightMap=null,this.lightMapIntensity=1,this.aoMap=null,this.aoMapIntensity=1,this.emissive=new Se(0),this.emissiveIntensity=1,this.emissiveMap=null,this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=ax,this.normalScale=new le(1,1),this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.specularMap=null,this.alphaMap=null,this.envMap=null,this.envMapRotation=new ra,this.combine=Sp,this.reflectivity=1,this.envMapIntensity=1,this.refractionRatio=.98,this.wireframe=!1,this.wireframeLinewidth=1,this.wireframeLinecap="round",this.wireframeLinejoin="round",this.flatShading=!1,this.fog=!0,this.setValues(t)}copy(t){return super.copy(t),this.color.copy(t.color),this.specular.copy(t.specular),this.shininess=t.shininess,this.map=t.map,this.lightMap=t.lightMap,this.lightMapIntensity=t.lightMapIntensity,this.aoMap=t.aoMap,this.aoMapIntensity=t.aoMapIntensity,this.emissive.copy(t.emissive),this.emissiveMap=t.emissiveMap,this.emissiveIntensity=t.emissiveIntensity,this.bumpMap=t.bumpMap,this.bumpScale=t.bumpScale,this.normalMap=t.normalMap,this.normalMapType=t.normalMapType,this.normalScale.copy(t.normalScale),this.displacementMap=t.displacementMap,this.displacementScale=t.displacementScale,this.displacementBias=t.displacementBias,this.specularMap=t.specularMap,this.alphaMap=t.alphaMap,this.envMap=t.envMap,this.envMapRotation.copy(t.envMapRotation),this.combine=t.combine,this.reflectivity=t.reflectivity,this.envMapIntensity=t.envMapIntensity,this.refractionRatio=t.refractionRatio,this.wireframe=t.wireframe,this.wireframeLinewidth=t.wireframeLinewidth,this.wireframeLinecap=t.wireframeLinecap,this.wireframeLinejoin=t.wireframeLinejoin,this.flatShading=t.flatShading,this.fog=t.fog,this}}class xE extends oo{constructor(t){super(),this.isMeshDepthMaterial=!0,this.type="MeshDepthMaterial",this.depthPacking=mM,this.map=null,this.alphaMap=null,this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.wireframe=!1,this.wireframeLinewidth=1,this.setValues(t)}copy(t){return super.copy(t),this.depthPacking=t.depthPacking,this.map=t.map,this.alphaMap=t.alphaMap,this.displacementMap=t.displacementMap,this.displacementScale=t.displacementScale,this.displacementBias=t.displacementBias,this.wireframe=t.wireframe,this.wireframeLinewidth=t.wireframeLinewidth,this}}class SE extends oo{constructor(t){super(),this.isMeshDistanceMaterial=!0,this.type="MeshDistanceMaterial",this.map=null,this.alphaMap=null,this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.setValues(t)}copy(t){return super.copy(t),this.map=t.map,this.alphaMap=t.alphaMap,this.displacementMap=t.displacementMap,this.displacementScale=t.displacementScale,this.displacementBias=t.displacementBias,this}}class yE extends gl{constructor(t){super(),this.isLineDashedMaterial=!0,this.type="LineDashedMaterial",this.scale=1,this.dashSize=3,this.gapSize=1,this.setValues(t)}copy(t){return super.copy(t),this.scale=t.scale,this.dashSize=t.dashSize,this.gapSize=t.gapSize,this}}class mx extends On{constructor(t,i=1){super(),this.isLight=!0,this.type="Light",this.color=new Se(t),this.intensity=i}dispose(){this.dispatchEvent({type:"dispose"})}copy(t,i){return super.copy(t,i),this.color.copy(t.color),this.intensity=t.intensity,this}toJSON(t){const i=super.toJSON(t);return i.object.color=this.color.getHex(),i.object.intensity=this.intensity,i}}const ud=new Je,ev=new j,nv=new j;class ME{constructor(t){this.camera=t,this.intensity=1,this.bias=0,this.biasNode=null,this.normalBias=0,this.radius=1,this.blurSamples=8,this.mapSize=new le(512,512),this.mapType=mi,this.map=null,this.mapPass=null,this.matrix=new Je,this.autoUpdate=!0,this.needsUpdate=!1,this._frustum=new Np,this._frameExtents=new le(1,1),this._viewportCount=1,this._viewports=[new We(0,0,1,1)]}getViewportCount(){return this._viewportCount}getFrustum(){return this._frustum}updateMatrices(t){const i=this.camera,s=this.matrix;ev.setFromMatrixPosition(t.matrixWorld),i.position.copy(ev),nv.setFromMatrixPosition(t.target.matrixWorld),i.lookAt(nv),i.updateMatrixWorld(),ud.multiplyMatrices(i.projectionMatrix,i.matrixWorldInverse),this._frustum.setFromProjectionMatrix(ud,i.coordinateSystem,i.reversedDepth),i.coordinateSystem===pl||i.reversedDepth?s.set(.5,0,0,.5,0,.5,0,.5,0,0,1,0,0,0,0,1):s.set(.5,0,0,.5,0,.5,0,.5,0,0,.5,.5,0,0,0,1),s.multiply(ud)}getViewport(t){return this._viewports[t]}getFrameExtents(){return this._frameExtents}dispose(){this.map&&this.map.dispose(),this.mapPass&&this.mapPass.dispose()}copy(t){return this.camera=t.camera.clone(),this.intensity=t.intensity,this.bias=t.bias,this.radius=t.radius,this.autoUpdate=t.autoUpdate,this.needsUpdate=t.needsUpdate,this.normalBias=t.normalBias,this.blurSamples=t.blurSamples,this.mapSize.copy(t.mapSize),this.biasNode=t.biasNode,this}clone(){return new this.constructor().copy(this)}toJSON(){const t={};return this.intensity!==1&&(t.intensity=this.intensity),this.bias!==0&&(t.bias=this.bias),this.normalBias!==0&&(t.normalBias=this.normalBias),this.radius!==1&&(t.radius=this.radius),(this.mapSize.x!==512||this.mapSize.y!==512)&&(t.mapSize=this.mapSize.toArray()),t.camera=this.camera.toJSON(!1).object,delete t.camera.matrix,t}}const $c=new j,tu=new Ss,Ki=new j;class gx extends On{constructor(){super(),this.isCamera=!0,this.type="Camera",this.matrixWorldInverse=new Je,this.projectionMatrix=new Je,this.projectionMatrixInverse=new Je,this.coordinateSystem=na,this._reversedDepth=!1}get reversedDepth(){return this._reversedDepth}copy(t,i){return super.copy(t,i),this.matrixWorldInverse.copy(t.matrixWorldInverse),this.projectionMatrix.copy(t.projectionMatrix),this.projectionMatrixInverse.copy(t.projectionMatrixInverse),this.coordinateSystem=t.coordinateSystem,this}getWorldDirection(t){return super.getWorldDirection(t).negate()}updateMatrixWorld(t){super.updateMatrixWorld(t),this.matrixWorld.decompose($c,tu,Ki),Ki.x===1&&Ki.y===1&&Ki.z===1?this.matrixWorldInverse.copy(this.matrixWorld).invert():this.matrixWorldInverse.compose($c,tu,Ki.set(1,1,1)).invert()}updateWorldMatrix(t,i){super.updateWorldMatrix(t,i),this.matrixWorld.decompose($c,tu,Ki),Ki.x===1&&Ki.y===1&&Ki.z===1?this.matrixWorldInverse.copy(this.matrixWorld).invert():this.matrixWorldInverse.compose($c,tu,Ki.set(1,1,1)).invert()}clone(){return new this.constructor().copy(this)}}const ps=new j,iv=new le,av=new le;class Bi extends gx{constructor(t=50,i=1,s=.1,l=2e3){super(),this.isPerspectiveCamera=!0,this.type="PerspectiveCamera",this.fov=t,this.zoom=1,this.near=s,this.far=l,this.focus=10,this.aspect=i,this.view=null,this.filmGauge=35,this.filmOffset=0,this.updateProjectionMatrix()}copy(t,i){return super.copy(t,i),this.fov=t.fov,this.zoom=t.zoom,this.near=t.near,this.far=t.far,this.focus=t.focus,this.aspect=t.aspect,this.view=t.view===null?null:Object.assign({},t.view),this.filmGauge=t.filmGauge,this.filmOffset=t.filmOffset,this}setFocalLength(t){const i=.5*this.getFilmHeight()/t;this.fov=ml*2*Math.atan(i),this.updateProjectionMatrix()}getFocalLength(){const t=Math.tan(ul*.5*this.fov);return .5*this.getFilmHeight()/t}getEffectiveFOV(){return ml*2*Math.atan(Math.tan(ul*.5*this.fov)/this.zoom)}getFilmWidth(){return this.filmGauge*Math.min(this.aspect,1)}getFilmHeight(){return this.filmGauge/Math.max(this.aspect,1)}getViewBounds(t,i,s){ps.set(-1,-1,.5).applyMatrix4(this.projectionMatrixInverse),i.set(ps.x,ps.y).multiplyScalar(-t/ps.z),ps.set(1,1,.5).applyMatrix4(this.projectionMatrixInverse),s.set(ps.x,ps.y).multiplyScalar(-t/ps.z)}getViewSize(t,i){return this.getViewBounds(t,iv,av),i.subVectors(av,iv)}setViewOffset(t,i,s,l,c,h){this.aspect=t/i,this.view===null&&(this.view={enabled:!0,fullWidth:1,fullHeight:1,offsetX:0,offsetY:0,width:1,height:1}),this.view.enabled=!0,this.view.fullWidth=t,this.view.fullHeight=i,this.view.offsetX=s,this.view.offsetY=l,this.view.width=c,this.view.height=h,this.updateProjectionMatrix()}clearViewOffset(){this.view!==null&&(this.view.enabled=!1),this.updateProjectionMatrix()}updateProjectionMatrix(){const t=this.near;let i=t*Math.tan(ul*.5*this.fov)/this.zoom,s=2*i,l=this.aspect*s,c=-.5*l;const h=this.view;if(this.view!==null&&this.view.enabled){const m=h.fullWidth,p=h.fullHeight;c+=h.offsetX*l/m,i-=h.offsetY*s/p,l*=h.width/m,s*=h.height/p}const d=this.filmOffset;d!==0&&(c+=t*d/this.getFilmWidth()),this.projectionMatrix.makePerspective(c,c+l,i,i-s,t,this.far,this.coordinateSystem,this.reversedDepth),this.projectionMatrixInverse.copy(this.projectionMatrix).invert()}toJSON(t){const i=super.toJSON(t);return i.object.fov=this.fov,i.object.zoom=this.zoom,i.object.near=this.near,i.object.far=this.far,i.object.focus=this.focus,i.object.aspect=this.aspect,this.view!==null&&(i.object.view=Object.assign({},this.view)),i.object.filmGauge=this.filmGauge,i.object.filmOffset=this.filmOffset,i}}class Tu extends gx{constructor(t=-1,i=1,s=1,l=-1,c=.1,h=2e3){super(),this.isOrthographicCamera=!0,this.type="OrthographicCamera",this.zoom=1,this.view=null,this.left=t,this.right=i,this.top=s,this.bottom=l,this.near=c,this.far=h,this.updateProjectionMatrix()}copy(t,i){return super.copy(t,i),this.left=t.left,this.right=t.right,this.top=t.top,this.bottom=t.bottom,this.near=t.near,this.far=t.far,this.zoom=t.zoom,this.view=t.view===null?null:Object.assign({},t.view),this}setViewOffset(t,i,s,l,c,h){this.view===null&&(this.view={enabled:!0,fullWidth:1,fullHeight:1,offsetX:0,offsetY:0,width:1,height:1}),this.view.enabled=!0,this.view.fullWidth=t,this.view.fullHeight=i,this.view.offsetX=s,this.view.offsetY=l,this.view.width=c,this.view.height=h,this.updateProjectionMatrix()}clearViewOffset(){this.view!==null&&(this.view.enabled=!1),this.updateProjectionMatrix()}updateProjectionMatrix(){const t=(this.right-this.left)/(2*this.zoom),i=(this.top-this.bottom)/(2*this.zoom),s=(this.right+this.left)/2,l=(this.top+this.bottom)/2;let c=s-t,h=s+t,d=l+i,m=l-i;if(this.view!==null&&this.view.enabled){const p=(this.right-this.left)/this.view.fullWidth/this.zoom,v=(this.top-this.bottom)/this.view.fullHeight/this.zoom;c+=p*this.view.offsetX,h=c+p*this.view.width,d-=v*this.view.offsetY,m=d-v*this.view.height}this.projectionMatrix.makeOrthographic(c,h,d,m,this.near,this.far,this.coordinateSystem,this.reversedDepth),this.projectionMatrixInverse.copy(this.projectionMatrix).invert()}toJSON(t){const i=super.toJSON(t);return i.object.zoom=this.zoom,i.object.left=this.left,i.object.right=this.right,i.object.top=this.top,i.object.bottom=this.bottom,i.object.near=this.near,i.object.far=this.far,this.view!==null&&(i.object.view=Object.assign({},this.view)),i}}class EE extends ME{constructor(){super(new Tu(-5,5,5,-5,.5,500)),this.isDirectionalLightShadow=!0}}class bE extends mx{constructor(t,i){super(t,i),this.isDirectionalLight=!0,this.type="DirectionalLight",this.position.copy(On.DEFAULT_UP),this.updateMatrix(),this.target=new On,this.shadow=new EE}dispose(){super.dispose(),this.shadow.dispose()}copy(t){return super.copy(t),this.target=t.target.clone(),this.shadow=t.shadow.clone(),this}toJSON(t){const i=super.toJSON(t);return i.object.shadow=this.shadow.toJSON(),i.object.target=this.target.uuid,i}}class TE extends mx{constructor(t,i){super(t,i),this.isAmbientLight=!0,this.type="AmbientLight"}}class AE extends Pn{constructor(){super(),this.isInstancedBufferGeometry=!0,this.type="InstancedBufferGeometry",this.instanceCount=1/0}copy(t){return super.copy(t),this.instanceCount=t.instanceCount,this}toJSON(){const t=super.toJSON();return t.instanceCount=this.instanceCount,t.isInstancedBufferGeometry=!0,t}}const qr=-90,Yr=1;class RE extends On{constructor(t,i,s){super(),this.type="CubeCamera",this.renderTarget=s,this.coordinateSystem=null,this.activeMipmapLevel=0;const l=new Bi(qr,Yr,t,i);l.layers=this.layers,this.add(l);const c=new Bi(qr,Yr,t,i);c.layers=this.layers,this.add(c);const h=new Bi(qr,Yr,t,i);h.layers=this.layers,this.add(h);const d=new Bi(qr,Yr,t,i);d.layers=this.layers,this.add(d);const m=new Bi(qr,Yr,t,i);m.layers=this.layers,this.add(m);const p=new Bi(qr,Yr,t,i);p.layers=this.layers,this.add(p)}updateCoordinateSystem(){const t=this.coordinateSystem,i=this.children.concat(),[s,l,c,h,d,m]=i;for(const p of i)this.remove(p);if(t===na)s.up.set(0,1,0),s.lookAt(1,0,0),l.up.set(0,1,0),l.lookAt(-1,0,0),c.up.set(0,0,-1),c.lookAt(0,1,0),h.up.set(0,0,1),h.lookAt(0,-1,0),d.up.set(0,1,0),d.lookAt(0,0,1),m.up.set(0,1,0),m.lookAt(0,0,-1);else if(t===pl)s.up.set(0,-1,0),s.lookAt(-1,0,0),l.up.set(0,-1,0),l.lookAt(1,0,0),c.up.set(0,0,1),c.lookAt(0,1,0),h.up.set(0,0,-1),h.lookAt(0,-1,0),d.up.set(0,-1,0),d.lookAt(0,0,1),m.up.set(0,-1,0),m.lookAt(0,0,-1);else throw new Error("THREE.CubeCamera.updateCoordinateSystem(): Invalid coordinate system: "+t);for(const p of i)this.add(p),p.updateMatrixWorld()}update(t,i){this.parent===null&&this.updateMatrixWorld();const{renderTarget:s,activeMipmapLevel:l}=this;this.coordinateSystem!==t.coordinateSystem&&(this.coordinateSystem=t.coordinateSystem,this.updateCoordinateSystem());const[c,h,d,m,p,v]=this.children,g=t.getRenderTarget(),_=t.getActiveCubeFace(),M=t.getActiveMipmapLevel(),E=t.xr.enabled;t.xr.enabled=!1;const A=s.texture.generateMipmaps;s.texture.generateMipmaps=!1;let x=!1;t.isWebGLRenderer===!0?x=t.state.buffers.depth.getReversed():x=t.reversedDepthBuffer,t.setRenderTarget(s,0,l),x&&t.autoClear===!1&&t.clearDepth(),t.render(i,c),t.setRenderTarget(s,1,l),x&&t.autoClear===!1&&t.clearDepth(),t.render(i,h),t.setRenderTarget(s,2,l),x&&t.autoClear===!1&&t.clearDepth(),t.render(i,d),t.setRenderTarget(s,3,l),x&&t.autoClear===!1&&t.clearDepth(),t.render(i,m),t.setRenderTarget(s,4,l),x&&t.autoClear===!1&&t.clearDepth(),t.render(i,p),s.texture.generateMipmaps=A,t.setRenderTarget(s,5,l),x&&t.autoClear===!1&&t.clearDepth(),t.render(i,v),t.setRenderTarget(g,_,M),t.xr.enabled=E,s.texture.needsPMREMUpdate=!0}}class CE extends Bi{constructor(t=[]){super(),this.isArrayCamera=!0,this.isMultiViewCamera=!1,this.cameras=t}}class hp extends rE{constructor(t,i,s=1){super(t,i),this.isInstancedInterleavedBuffer=!0,this.meshPerAttribute=s}copy(t){return super.copy(t),this.meshPerAttribute=t.meshPerAttribute,this}clone(t){const i=super.clone(t);return i.meshPerAttribute=this.meshPerAttribute,i}toJSON(t){const i=super.toJSON(t);return i.isInstancedInterleavedBuffer=!0,i.meshPerAttribute=this.meshPerAttribute,i}}class sv{constructor(t=1,i=0,s=0){this.radius=t,this.phi=i,this.theta=s}set(t,i,s){return this.radius=t,this.phi=i,this.theta=s,this}copy(t){return this.radius=t.radius,this.phi=t.phi,this.theta=t.theta,this}makeSafe(){return this.phi=ce(this.phi,1e-6,Math.PI-1e-6),this}setFromVector3(t){return this.setFromCartesianCoords(t.x,t.y,t.z)}setFromCartesianCoords(t,i,s){return this.radius=Math.sqrt(t*t+i*i+s*s),this.radius===0?(this.theta=0,this.phi=0):(this.theta=Math.atan2(t,s),this.phi=Math.acos(ce(i/this.radius,-1,1))),this}clone(){return new this.constructor().copy(this)}}const rv=new j,eu=new j,jr=new j,Zr=new j,fd=new j,wE=new j,DE=new j;class UE{constructor(t=new j,i=new j){this.start=t,this.end=i}set(t,i){return this.start.copy(t),this.end.copy(i),this}copy(t){return this.start.copy(t.start),this.end.copy(t.end),this}getCenter(t){return t.addVectors(this.start,this.end).multiplyScalar(.5)}delta(t){return t.subVectors(this.end,this.start)}distanceSq(){return this.start.distanceToSquared(this.end)}distance(){return this.start.distanceTo(this.end)}at(t,i){return this.delta(i).multiplyScalar(t).add(this.start)}closestPointToPointParameter(t,i){rv.subVectors(t,this.start),eu.subVectors(this.end,this.start);const s=eu.dot(eu);let c=eu.dot(rv)/s;return i&&(c=ce(c,0,1)),c}closestPointToPoint(t,i,s){const l=this.closestPointToPointParameter(t,i);return this.delta(s).multiplyScalar(l).add(this.start)}distanceSqToLine3(t,i=wE,s=DE){const l=10000000000000001e-32;let c,h;const d=this.start,m=t.start,p=this.end,v=t.end;jr.subVectors(p,d),Zr.subVectors(v,m),fd.subVectors(d,m);const g=jr.dot(jr),_=Zr.dot(Zr),M=Zr.dot(fd);if(g<=l&&_<=l)return i.copy(d),s.copy(m),i.sub(s),i.dot(i);if(g<=l)c=0,h=M/_,h=ce(h,0,1);else{const E=jr.dot(fd);if(_<=l)h=0,c=ce(-E/g,0,1);else{const A=jr.dot(Zr),x=g*_-A*A;x!==0?c=ce((A*M-E*_)/x,0,1):c=0,h=(A*c+M)/_,h<0?(h=0,c=ce(-E/g,0,1)):h>1&&(h=1,c=ce((A-E)/g,0,1))}}return i.copy(d).addScaledVector(jr,c),s.copy(m).addScaledVector(Zr,h),i.distanceToSquared(s)}applyMatrix4(t){return this.start.applyMatrix4(t),this.end.applyMatrix4(t),this}equals(t){return t.start.equals(this.start)&&t.end.equals(this.end)}clone(){return new this.constructor().copy(this)}}class LE extends Js{constructor(t,i=null){super(),this.object=t,this.domElement=i,this.enabled=!0,this.state=-1,this.keys={},this.mouseButtons={LEFT:null,MIDDLE:null,RIGHT:null},this.touches={ONE:null,TWO:null}}connect(t){if(t===void 0){ee("Controls: connect() now requires an element.");return}this.domElement!==null&&this.disconnect(),this.domElement=t}disconnect(){}dispose(){}update(){}}function ov(r,t,i,s){const l=NE(s);switch(i){case ex:return r*t;case ix:return r*t/l.components*l.byteLength;case bp:return r*t/l.components*l.byteLength;case io:return r*t*2/l.components*l.byteLength;case Tp:return r*t*2/l.components*l.byteLength;case nx:return r*t*3/l.components*l.byteLength;case ki:return r*t*4/l.components*l.byteLength;case Ap:return r*t*4/l.components*l.byteLength;case fu:case hu:return Math.floor((r+3)/4)*Math.floor((t+3)/4)*8;case du:case pu:return Math.floor((r+3)/4)*Math.floor((t+3)/4)*16;case Od:case zd:return Math.max(r,16)*Math.max(t,8)/4;case Nd:case Pd:return Math.max(r,8)*Math.max(t,8)/2;case Id:case Fd:case Hd:case Gd:return Math.floor((r+3)/4)*Math.floor((t+3)/4)*8;case Bd:case Vd:case kd:return Math.floor((r+3)/4)*Math.floor((t+3)/4)*16;case Xd:return Math.floor((r+3)/4)*Math.floor((t+3)/4)*16;case Wd:return Math.floor((r+4)/5)*Math.floor((t+3)/4)*16;case qd:return Math.floor((r+4)/5)*Math.floor((t+4)/5)*16;case Yd:return Math.floor((r+5)/6)*Math.floor((t+4)/5)*16;case jd:return Math.floor((r+5)/6)*Math.floor((t+5)/6)*16;case Zd:return Math.floor((r+7)/8)*Math.floor((t+4)/5)*16;case Kd:return Math.floor((r+7)/8)*Math.floor((t+5)/6)*16;case Qd:return Math.floor((r+7)/8)*Math.floor((t+7)/8)*16;case Jd:return Math.floor((r+9)/10)*Math.floor((t+4)/5)*16;case $d:return Math.floor((r+9)/10)*Math.floor((t+5)/6)*16;case tp:return Math.floor((r+9)/10)*Math.floor((t+7)/8)*16;case ep:return Math.floor((r+9)/10)*Math.floor((t+9)/10)*16;case np:return Math.floor((r+11)/12)*Math.floor((t+9)/10)*16;case ip:return Math.floor((r+11)/12)*Math.floor((t+11)/12)*16;case ap:case sp:case rp:return Math.ceil(r/4)*Math.ceil(t/4)*16;case op:case lp:return Math.ceil(r/4)*Math.ceil(t/4)*8;case cp:case up:return Math.ceil(r/4)*Math.ceil(t/4)*16}throw new Error(`Unable to determine texture byte length for ${i} format.`)}function NE(r){switch(r){case mi:case Qv:return{byteLength:1,components:1};case hl:case Jv:case Pa:return{byteLength:2,components:1};case Mp:case Ep:return{byteLength:2,components:4};case sa:case yp:case ea:return{byteLength:4,components:1};case $v:case tx:return{byteLength:4,components:3}}throw new Error(`Unknown texture type ${r}.`)}typeof __THREE_DEVTOOLS__<"u"&&__THREE_DEVTOOLS__.dispatchEvent(new CustomEvent("register",{detail:{revision:xp}}));typeof window<"u"&&(window.__THREE__?ee("WARNING: Multiple instances of Three.js being imported."):window.__THREE__=xp);function _x(){let r=null,t=!1,i=null,s=null;function l(c,h){i(c,h),s=r.requestAnimationFrame(l)}return{start:function(){t!==!0&&i!==null&&(s=r.requestAnimationFrame(l),t=!0)},stop:function(){r.cancelAnimationFrame(s),t=!1},setAnimationLoop:function(c){i=c},setContext:function(c){r=c}}}function OE(r){const t=new WeakMap;function i(d,m){const p=d.array,v=d.usage,g=p.byteLength,_=r.createBuffer();r.bindBuffer(m,_),r.bufferData(m,p,v),d.onUploadCallback();let M;if(p instanceof Float32Array)M=r.FLOAT;else if(typeof Float16Array<"u"&&p instanceof Float16Array)M=r.HALF_FLOAT;else if(p instanceof Uint16Array)d.isFloat16BufferAttribute?M=r.HALF_FLOAT:M=r.UNSIGNED_SHORT;else if(p instanceof Int16Array)M=r.SHORT;else if(p instanceof Uint32Array)M=r.UNSIGNED_INT;else if(p instanceof Int32Array)M=r.INT;else if(p instanceof Int8Array)M=r.BYTE;else if(p instanceof Uint8Array)M=r.UNSIGNED_BYTE;else if(p instanceof Uint8ClampedArray)M=r.UNSIGNED_BYTE;else throw new Error("THREE.WebGLAttributes: Unsupported buffer data format: "+p);return{buffer:_,type:M,bytesPerElement:p.BYTES_PER_ELEMENT,version:d.version,size:g}}function s(d,m,p){const v=m.array,g=m.updateRanges;if(r.bindBuffer(p,d),g.length===0)r.bufferSubData(p,0,v);else{g.sort((M,E)=>M.start-E.start);let _=0;for(let M=1;M<g.length;M++){const E=g[_],A=g[M];A.start<=E.start+E.count+1?E.count=Math.max(E.count,A.start+A.count-E.start):(++_,g[_]=A)}g.length=_+1;for(let M=0,E=g.length;M<E;M++){const A=g[M];r.bufferSubData(p,A.start*v.BYTES_PER_ELEMENT,v,A.start,A.count)}m.clearUpdateRanges()}m.onUploadCallback()}function l(d){return d.isInterleavedBufferAttribute&&(d=d.data),t.get(d)}function c(d){d.isInterleavedBufferAttribute&&(d=d.data);const m=t.get(d);m&&(r.deleteBuffer(m.buffer),t.delete(d))}function h(d,m){if(d.isInterleavedBufferAttribute&&(d=d.data),d.isGLBufferAttribute){const v=t.get(d);(!v||v.version<d.version)&&t.set(d,{buffer:d.buffer,type:d.type,bytesPerElement:d.elementSize,version:d.version});return}const p=t.get(d);if(p===void 0)t.set(d,i(d,m));else if(p.version<d.version){if(p.size!==d.array.byteLength)throw new Error("THREE.WebGLAttributes: The size of the buffer attribute's array buffer does not match the original size. Resizing buffer attributes is not supported.");s(p.buffer,d,m),p.version=d.version}}return{get:l,remove:c,update:h}}var PE=`#ifdef USE_ALPHAHASH
13
+ }`;class ki extends co{constructor(t){super(),this.isShaderMaterial=!0,this.type="ShaderMaterial",this.defines={},this.uniforms={},this.uniformsGroups=[],this.vertexShader=xE,this.fragmentShader=SE,this.linewidth=1,this.wireframe=!1,this.wireframeLinewidth=1,this.fog=!1,this.lights=!1,this.clipping=!1,this.forceSinglePass=!0,this.extensions={clipCullDistance:!1,multiDraw:!1},this.defaultAttributeValues={color:[1,1,1],uv:[0,0],uv1:[0,0]},this.index0AttributeName=void 0,this.uniformsNeedUpdate=!1,this.glslVersion=null,t!==void 0&&this.setValues(t)}copy(t){return super.copy(t),this.fragmentShader=t.fragmentShader,this.vertexShader=t.vertexShader,this.uniforms=oo(t.uniforms),this.uniformsGroups=vE(t.uniformsGroups),this.defines=Object.assign({},t.defines),this.wireframe=t.wireframe,this.wireframeLinewidth=t.wireframeLinewidth,this.fog=t.fog,this.lights=t.lights,this.clipping=t.clipping,this.extensions=Object.assign({},t.extensions),this.glslVersion=t.glslVersion,this.defaultAttributeValues=Object.assign({},t.defaultAttributeValues),this.index0AttributeName=t.index0AttributeName,this.uniformsNeedUpdate=t.uniformsNeedUpdate,this}toJSON(t){const i=super.toJSON(t);i.glslVersion=this.glslVersion,i.uniforms={};for(const l in this.uniforms){const h=this.uniforms[l].value;h&&h.isTexture?i.uniforms[l]={type:"t",value:h.toJSON(t).uuid}:h&&h.isColor?i.uniforms[l]={type:"c",value:h.getHex()}:h&&h.isVector2?i.uniforms[l]={type:"v2",value:h.toArray()}:h&&h.isVector3?i.uniforms[l]={type:"v3",value:h.toArray()}:h&&h.isVector4?i.uniforms[l]={type:"v4",value:h.toArray()}:h&&h.isMatrix3?i.uniforms[l]={type:"m3",value:h.toArray()}:h&&h.isMatrix4?i.uniforms[l]={type:"m4",value:h.toArray()}:i.uniforms[l]={value:h}}Object.keys(this.defines).length>0&&(i.defines=this.defines),i.vertexShader=this.vertexShader,i.fragmentShader=this.fragmentShader,i.lights=this.lights,i.clipping=this.clipping;const s={};for(const l in this.extensions)this.extensions[l]===!0&&(s[l]=!0);return Object.keys(s).length>0&&(i.extensions=s),i}}class yE extends ki{constructor(t){super(t),this.isRawShaderMaterial=!0,this.type="RawShaderMaterial"}}class ev extends co{constructor(t){super(),this.isMeshPhongMaterial=!0,this.type="MeshPhongMaterial",this.color=new Se(16777215),this.specular=new Se(1118481),this.shininess=30,this.map=null,this.lightMap=null,this.lightMapIntensity=1,this.aoMap=null,this.aoMapIntensity=1,this.emissive=new Se(0),this.emissiveIntensity=1,this.emissiveMap=null,this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=sx,this.normalScale=new le(1,1),this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.specularMap=null,this.alphaMap=null,this.envMap=null,this.envMapRotation=new sa,this.combine=yp,this.reflectivity=1,this.envMapIntensity=1,this.refractionRatio=.98,this.wireframe=!1,this.wireframeLinewidth=1,this.wireframeLinecap="round",this.wireframeLinejoin="round",this.flatShading=!1,this.fog=!0,this.setValues(t)}copy(t){return super.copy(t),this.color.copy(t.color),this.specular.copy(t.specular),this.shininess=t.shininess,this.map=t.map,this.lightMap=t.lightMap,this.lightMapIntensity=t.lightMapIntensity,this.aoMap=t.aoMap,this.aoMapIntensity=t.aoMapIntensity,this.emissive.copy(t.emissive),this.emissiveMap=t.emissiveMap,this.emissiveIntensity=t.emissiveIntensity,this.bumpMap=t.bumpMap,this.bumpScale=t.bumpScale,this.normalMap=t.normalMap,this.normalMapType=t.normalMapType,this.normalScale.copy(t.normalScale),this.displacementMap=t.displacementMap,this.displacementScale=t.displacementScale,this.displacementBias=t.displacementBias,this.specularMap=t.specularMap,this.alphaMap=t.alphaMap,this.envMap=t.envMap,this.envMapRotation.copy(t.envMapRotation),this.combine=t.combine,this.reflectivity=t.reflectivity,this.envMapIntensity=t.envMapIntensity,this.refractionRatio=t.refractionRatio,this.wireframe=t.wireframe,this.wireframeLinewidth=t.wireframeLinewidth,this.wireframeLinecap=t.wireframeLinecap,this.wireframeLinejoin=t.wireframeLinejoin,this.flatShading=t.flatShading,this.fog=t.fog,this}}class ME extends co{constructor(t){super(),this.isMeshDepthMaterial=!0,this.type="MeshDepthMaterial",this.depthPacking=vM,this.map=null,this.alphaMap=null,this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.wireframe=!1,this.wireframeLinewidth=1,this.setValues(t)}copy(t){return super.copy(t),this.depthPacking=t.depthPacking,this.map=t.map,this.alphaMap=t.alphaMap,this.displacementMap=t.displacementMap,this.displacementScale=t.displacementScale,this.displacementBias=t.displacementBias,this.wireframe=t.wireframe,this.wireframeLinewidth=t.wireframeLinewidth,this}}class EE extends co{constructor(t){super(),this.isMeshDistanceMaterial=!0,this.type="MeshDistanceMaterial",this.map=null,this.alphaMap=null,this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.setValues(t)}copy(t){return super.copy(t),this.map=t.map,this.alphaMap=t.alphaMap,this.displacementMap=t.displacementMap,this.displacementScale=t.displacementScale,this.displacementBias=t.displacementBias,this}}class bE extends vl{constructor(t){super(),this.isLineDashedMaterial=!0,this.type="LineDashedMaterial",this.scale=1,this.dashSize=3,this.gapSize=1,this.setValues(t)}copy(t){return super.copy(t),this.scale=t.scale,this.dashSize=t.dashSize,this.gapSize=t.gapSize,this}}class gx extends Un{constructor(t,i=1){super(),this.isLight=!0,this.type="Light",this.color=new Se(t),this.intensity=i}dispose(){this.dispatchEvent({type:"dispose"})}copy(t,i){return super.copy(t,i),this.color.copy(t.color),this.intensity=t.intensity,this}toJSON(t){const i=super.toJSON(t);return i.object.color=this.color.getHex(),i.object.intensity=this.intensity,i}}const hd=new Je,nv=new j,iv=new j;class TE{constructor(t){this.camera=t,this.intensity=1,this.bias=0,this.biasNode=null,this.normalBias=0,this.radius=1,this.blurSamples=8,this.mapSize=new le(512,512),this.mapType=di,this.map=null,this.mapPass=null,this.matrix=new Je,this.autoUpdate=!0,this.needsUpdate=!1,this._frustum=new Op,this._frameExtents=new le(1,1),this._viewportCount=1,this._viewports=[new We(0,0,1,1)]}getViewportCount(){return this._viewportCount}getFrustum(){return this._frustum}updateMatrices(t){const i=this.camera,s=this.matrix;nv.setFromMatrixPosition(t.matrixWorld),i.position.copy(nv),iv.setFromMatrixPosition(t.target.matrixWorld),i.lookAt(iv),i.updateMatrixWorld(),hd.multiplyMatrices(i.projectionMatrix,i.matrixWorldInverse),this._frustum.setFromProjectionMatrix(hd,i.coordinateSystem,i.reversedDepth),i.coordinateSystem===gl||i.reversedDepth?s.set(.5,0,0,.5,0,.5,0,.5,0,0,1,0,0,0,0,1):s.set(.5,0,0,.5,0,.5,0,.5,0,0,.5,.5,0,0,0,1),s.multiply(hd)}getViewport(t){return this._viewports[t]}getFrameExtents(){return this._frameExtents}dispose(){this.map&&this.map.dispose(),this.mapPass&&this.mapPass.dispose()}copy(t){return this.camera=t.camera.clone(),this.intensity=t.intensity,this.bias=t.bias,this.radius=t.radius,this.autoUpdate=t.autoUpdate,this.needsUpdate=t.needsUpdate,this.normalBias=t.normalBias,this.blurSamples=t.blurSamples,this.mapSize.copy(t.mapSize),this.biasNode=t.biasNode,this}clone(){return new this.constructor().copy(this)}toJSON(){const t={};return this.intensity!==1&&(t.intensity=this.intensity),this.bias!==0&&(t.bias=this.bias),this.normalBias!==0&&(t.normalBias=this.normalBias),this.radius!==1&&(t.radius=this.radius),(this.mapSize.x!==512||this.mapSize.y!==512)&&(t.mapSize=this.mapSize.toArray()),t.camera=this.camera.toJSON(!1).object,delete t.camera.matrix,t}}const eu=new j,nu=new Ss,Zi=new j;class _x extends Un{constructor(){super(),this.isCamera=!0,this.type="Camera",this.matrixWorldInverse=new Je,this.projectionMatrix=new Je,this.projectionMatrixInverse=new Je,this.coordinateSystem=ea,this._reversedDepth=!1}get reversedDepth(){return this._reversedDepth}copy(t,i){return super.copy(t,i),this.matrixWorldInverse.copy(t.matrixWorldInverse),this.projectionMatrix.copy(t.projectionMatrix),this.projectionMatrixInverse.copy(t.projectionMatrixInverse),this.coordinateSystem=t.coordinateSystem,this}getWorldDirection(t){return super.getWorldDirection(t).negate()}updateMatrixWorld(t){super.updateMatrixWorld(t),this.matrixWorld.decompose(eu,nu,Zi),Zi.x===1&&Zi.y===1&&Zi.z===1?this.matrixWorldInverse.copy(this.matrixWorld).invert():this.matrixWorldInverse.compose(eu,nu,Zi.set(1,1,1)).invert()}updateWorldMatrix(t,i){super.updateWorldMatrix(t,i),this.matrixWorld.decompose(eu,nu,Zi),Zi.x===1&&Zi.y===1&&Zi.z===1?this.matrixWorldInverse.copy(this.matrixWorld).invert():this.matrixWorldInverse.compose(eu,nu,Zi.set(1,1,1)).invert()}clone(){return new this.constructor().copy(this)}}const ps=new j,av=new le,sv=new le;class Fi extends _x{constructor(t=50,i=1,s=.1,l=2e3){super(),this.isPerspectiveCamera=!0,this.type="PerspectiveCamera",this.fov=t,this.zoom=1,this.near=s,this.far=l,this.focus=10,this.aspect=i,this.view=null,this.filmGauge=35,this.filmOffset=0,this.updateProjectionMatrix()}copy(t,i){return super.copy(t,i),this.fov=t.fov,this.zoom=t.zoom,this.near=t.near,this.far=t.far,this.focus=t.focus,this.aspect=t.aspect,this.view=t.view===null?null:Object.assign({},t.view),this.filmGauge=t.filmGauge,this.filmOffset=t.filmOffset,this}setFocalLength(t){const i=.5*this.getFilmHeight()/t;this.fov=_l*2*Math.atan(i),this.updateProjectionMatrix()}getFocalLength(){const t=Math.tan(hl*.5*this.fov);return .5*this.getFilmHeight()/t}getEffectiveFOV(){return _l*2*Math.atan(Math.tan(hl*.5*this.fov)/this.zoom)}getFilmWidth(){return this.filmGauge*Math.min(this.aspect,1)}getFilmHeight(){return this.filmGauge/Math.max(this.aspect,1)}getViewBounds(t,i,s){ps.set(-1,-1,.5).applyMatrix4(this.projectionMatrixInverse),i.set(ps.x,ps.y).multiplyScalar(-t/ps.z),ps.set(1,1,.5).applyMatrix4(this.projectionMatrixInverse),s.set(ps.x,ps.y).multiplyScalar(-t/ps.z)}getViewSize(t,i){return this.getViewBounds(t,av,sv),i.subVectors(sv,av)}setViewOffset(t,i,s,l,c,h){this.aspect=t/i,this.view===null&&(this.view={enabled:!0,fullWidth:1,fullHeight:1,offsetX:0,offsetY:0,width:1,height:1}),this.view.enabled=!0,this.view.fullWidth=t,this.view.fullHeight=i,this.view.offsetX=s,this.view.offsetY=l,this.view.width=c,this.view.height=h,this.updateProjectionMatrix()}clearViewOffset(){this.view!==null&&(this.view.enabled=!1),this.updateProjectionMatrix()}updateProjectionMatrix(){const t=this.near;let i=t*Math.tan(hl*.5*this.fov)/this.zoom,s=2*i,l=this.aspect*s,c=-.5*l;const h=this.view;if(this.view!==null&&this.view.enabled){const m=h.fullWidth,p=h.fullHeight;c+=h.offsetX*l/m,i-=h.offsetY*s/p,l*=h.width/m,s*=h.height/p}const d=this.filmOffset;d!==0&&(c+=t*d/this.getFilmWidth()),this.projectionMatrix.makePerspective(c,c+l,i,i-s,t,this.far,this.coordinateSystem,this.reversedDepth),this.projectionMatrixInverse.copy(this.projectionMatrix).invert()}toJSON(t){const i=super.toJSON(t);return i.object.fov=this.fov,i.object.zoom=this.zoom,i.object.near=this.near,i.object.far=this.far,i.object.focus=this.focus,i.object.aspect=this.aspect,this.view!==null&&(i.object.view=Object.assign({},this.view)),i.object.filmGauge=this.filmGauge,i.object.filmOffset=this.filmOffset,i}}class Ru extends _x{constructor(t=-1,i=1,s=1,l=-1,c=.1,h=2e3){super(),this.isOrthographicCamera=!0,this.type="OrthographicCamera",this.zoom=1,this.view=null,this.left=t,this.right=i,this.top=s,this.bottom=l,this.near=c,this.far=h,this.updateProjectionMatrix()}copy(t,i){return super.copy(t,i),this.left=t.left,this.right=t.right,this.top=t.top,this.bottom=t.bottom,this.near=t.near,this.far=t.far,this.zoom=t.zoom,this.view=t.view===null?null:Object.assign({},t.view),this}setViewOffset(t,i,s,l,c,h){this.view===null&&(this.view={enabled:!0,fullWidth:1,fullHeight:1,offsetX:0,offsetY:0,width:1,height:1}),this.view.enabled=!0,this.view.fullWidth=t,this.view.fullHeight=i,this.view.offsetX=s,this.view.offsetY=l,this.view.width=c,this.view.height=h,this.updateProjectionMatrix()}clearViewOffset(){this.view!==null&&(this.view.enabled=!1),this.updateProjectionMatrix()}updateProjectionMatrix(){const t=(this.right-this.left)/(2*this.zoom),i=(this.top-this.bottom)/(2*this.zoom),s=(this.right+this.left)/2,l=(this.top+this.bottom)/2;let c=s-t,h=s+t,d=l+i,m=l-i;if(this.view!==null&&this.view.enabled){const p=(this.right-this.left)/this.view.fullWidth/this.zoom,v=(this.top-this.bottom)/this.view.fullHeight/this.zoom;c+=p*this.view.offsetX,h=c+p*this.view.width,d-=v*this.view.offsetY,m=d-v*this.view.height}this.projectionMatrix.makeOrthographic(c,h,d,m,this.near,this.far,this.coordinateSystem,this.reversedDepth),this.projectionMatrixInverse.copy(this.projectionMatrix).invert()}toJSON(t){const i=super.toJSON(t);return i.object.zoom=this.zoom,i.object.left=this.left,i.object.right=this.right,i.object.top=this.top,i.object.bottom=this.bottom,i.object.near=this.near,i.object.far=this.far,this.view!==null&&(i.object.view=Object.assign({},this.view)),i}}class AE extends TE{constructor(){super(new Ru(-5,5,5,-5,.5,500)),this.isDirectionalLightShadow=!0}}class RE extends gx{constructor(t,i){super(t,i),this.isDirectionalLight=!0,this.type="DirectionalLight",this.position.copy(Un.DEFAULT_UP),this.updateMatrix(),this.target=new Un,this.shadow=new AE}dispose(){super.dispose(),this.shadow.dispose()}copy(t){return super.copy(t),this.target=t.target.clone(),this.shadow=t.shadow.clone(),this}toJSON(t){const i=super.toJSON(t);return i.object.shadow=this.shadow.toJSON(),i.object.target=this.target.uuid,i}}class CE extends gx{constructor(t,i){super(t,i),this.isAmbientLight=!0,this.type="AmbientLight"}}class wE extends Ln{constructor(){super(),this.isInstancedBufferGeometry=!0,this.type="InstancedBufferGeometry",this.instanceCount=1/0}copy(t){return super.copy(t),this.instanceCount=t.instanceCount,this}toJSON(){const t=super.toJSON();return t.instanceCount=this.instanceCount,t.isInstancedBufferGeometry=!0,t}}const Yr=-90,jr=1;class DE extends Un{constructor(t,i,s){super(),this.type="CubeCamera",this.renderTarget=s,this.coordinateSystem=null,this.activeMipmapLevel=0;const l=new Fi(Yr,jr,t,i);l.layers=this.layers,this.add(l);const c=new Fi(Yr,jr,t,i);c.layers=this.layers,this.add(c);const h=new Fi(Yr,jr,t,i);h.layers=this.layers,this.add(h);const d=new Fi(Yr,jr,t,i);d.layers=this.layers,this.add(d);const m=new Fi(Yr,jr,t,i);m.layers=this.layers,this.add(m);const p=new Fi(Yr,jr,t,i);p.layers=this.layers,this.add(p)}updateCoordinateSystem(){const t=this.coordinateSystem,i=this.children.concat(),[s,l,c,h,d,m]=i;for(const p of i)this.remove(p);if(t===ea)s.up.set(0,1,0),s.lookAt(1,0,0),l.up.set(0,1,0),l.lookAt(-1,0,0),c.up.set(0,0,-1),c.lookAt(0,1,0),h.up.set(0,0,1),h.lookAt(0,-1,0),d.up.set(0,1,0),d.lookAt(0,0,1),m.up.set(0,1,0),m.lookAt(0,0,-1);else if(t===gl)s.up.set(0,-1,0),s.lookAt(-1,0,0),l.up.set(0,-1,0),l.lookAt(1,0,0),c.up.set(0,0,1),c.lookAt(0,1,0),h.up.set(0,0,-1),h.lookAt(0,-1,0),d.up.set(0,-1,0),d.lookAt(0,0,1),m.up.set(0,-1,0),m.lookAt(0,0,-1);else throw new Error("THREE.CubeCamera.updateCoordinateSystem(): Invalid coordinate system: "+t);for(const p of i)this.add(p),p.updateMatrixWorld()}update(t,i){this.parent===null&&this.updateMatrixWorld();const{renderTarget:s,activeMipmapLevel:l}=this;this.coordinateSystem!==t.coordinateSystem&&(this.coordinateSystem=t.coordinateSystem,this.updateCoordinateSystem());const[c,h,d,m,p,v]=this.children,g=t.getRenderTarget(),_=t.getActiveCubeFace(),M=t.getActiveMipmapLevel(),E=t.xr.enabled;t.xr.enabled=!1;const A=s.texture.generateMipmaps;s.texture.generateMipmaps=!1;let y=!1;t.isWebGLRenderer===!0?y=t.state.buffers.depth.getReversed():y=t.reversedDepthBuffer,t.setRenderTarget(s,0,l),y&&t.autoClear===!1&&t.clearDepth(),t.render(i,c),t.setRenderTarget(s,1,l),y&&t.autoClear===!1&&t.clearDepth(),t.render(i,h),t.setRenderTarget(s,2,l),y&&t.autoClear===!1&&t.clearDepth(),t.render(i,d),t.setRenderTarget(s,3,l),y&&t.autoClear===!1&&t.clearDepth(),t.render(i,m),t.setRenderTarget(s,4,l),y&&t.autoClear===!1&&t.clearDepth(),t.render(i,p),s.texture.generateMipmaps=A,t.setRenderTarget(s,5,l),y&&t.autoClear===!1&&t.clearDepth(),t.render(i,v),t.setRenderTarget(g,_,M),t.xr.enabled=E,s.texture.needsPMREMUpdate=!0}}class UE extends Fi{constructor(t=[]){super(),this.isArrayCamera=!0,this.isMultiViewCamera=!1,this.cameras=t}}class pp extends cE{constructor(t,i,s=1){super(t,i),this.isInstancedInterleavedBuffer=!0,this.meshPerAttribute=s}copy(t){return super.copy(t),this.meshPerAttribute=t.meshPerAttribute,this}clone(t){const i=super.clone(t);return i.meshPerAttribute=this.meshPerAttribute,i}toJSON(t){const i=super.toJSON(t);return i.isInstancedInterleavedBuffer=!0,i.meshPerAttribute=this.meshPerAttribute,i}}class rv{constructor(t=1,i=0,s=0){this.radius=t,this.phi=i,this.theta=s}set(t,i,s){return this.radius=t,this.phi=i,this.theta=s,this}copy(t){return this.radius=t.radius,this.phi=t.phi,this.theta=t.theta,this}makeSafe(){return this.phi=ce(this.phi,1e-6,Math.PI-1e-6),this}setFromVector3(t){return this.setFromCartesianCoords(t.x,t.y,t.z)}setFromCartesianCoords(t,i,s){return this.radius=Math.sqrt(t*t+i*i+s*s),this.radius===0?(this.theta=0,this.phi=0):(this.theta=Math.atan2(t,s),this.phi=Math.acos(ce(i/this.radius,-1,1))),this}clone(){return new this.constructor().copy(this)}}const ov=new j,iu=new j,Zr=new j,Kr=new j,dd=new j,LE=new j,NE=new j;class OE{constructor(t=new j,i=new j){this.start=t,this.end=i}set(t,i){return this.start.copy(t),this.end.copy(i),this}copy(t){return this.start.copy(t.start),this.end.copy(t.end),this}getCenter(t){return t.addVectors(this.start,this.end).multiplyScalar(.5)}delta(t){return t.subVectors(this.end,this.start)}distanceSq(){return this.start.distanceToSquared(this.end)}distance(){return this.start.distanceTo(this.end)}at(t,i){return this.delta(i).multiplyScalar(t).add(this.start)}closestPointToPointParameter(t,i){ov.subVectors(t,this.start),iu.subVectors(this.end,this.start);const s=iu.dot(iu);let c=iu.dot(ov)/s;return i&&(c=ce(c,0,1)),c}closestPointToPoint(t,i,s){const l=this.closestPointToPointParameter(t,i);return this.delta(s).multiplyScalar(l).add(this.start)}distanceSqToLine3(t,i=LE,s=NE){const l=10000000000000001e-32;let c,h;const d=this.start,m=t.start,p=this.end,v=t.end;Zr.subVectors(p,d),Kr.subVectors(v,m),dd.subVectors(d,m);const g=Zr.dot(Zr),_=Kr.dot(Kr),M=Kr.dot(dd);if(g<=l&&_<=l)return i.copy(d),s.copy(m),i.sub(s),i.dot(i);if(g<=l)c=0,h=M/_,h=ce(h,0,1);else{const E=Zr.dot(dd);if(_<=l)h=0,c=ce(-E/g,0,1);else{const A=Zr.dot(Kr),y=g*_-A*A;y!==0?c=ce((A*M-E*_)/y,0,1):c=0,h=(A*c+M)/_,h<0?(h=0,c=ce(-E/g,0,1)):h>1&&(h=1,c=ce((A-E)/g,0,1))}}return i.copy(d).addScaledVector(Zr,c),s.copy(m).addScaledVector(Kr,h),i.distanceToSquared(s)}applyMatrix4(t){return this.start.applyMatrix4(t),this.end.applyMatrix4(t),this}equals(t){return t.start.equals(this.start)&&t.end.equals(this.end)}clone(){return new this.constructor().copy(this)}}class PE extends $s{constructor(t,i=null){super(),this.object=t,this.domElement=i,this.enabled=!0,this.state=-1,this.keys={},this.mouseButtons={LEFT:null,MIDDLE:null,RIGHT:null},this.touches={ONE:null,TWO:null}}connect(t){if(t===void 0){ee("Controls: connect() now requires an element.");return}this.domElement!==null&&this.disconnect(),this.domElement=t}disconnect(){}dispose(){}update(){}}function lv(r,t,i,s){const l=zE(s);switch(i){case nx:return r*t;case ax:return r*t/l.components*l.byteLength;case Tp:return r*t/l.components*l.byteLength;case so:return r*t*2/l.components*l.byteLength;case Ap:return r*t*2/l.components*l.byteLength;case ix:return r*t*3/l.components*l.byteLength;case Vi:return r*t*4/l.components*l.byteLength;case Rp:return r*t*4/l.components*l.byteLength;case du:case pu:return Math.floor((r+3)/4)*Math.floor((t+3)/4)*8;case mu:case gu:return Math.floor((r+3)/4)*Math.floor((t+3)/4)*16;case zd:case Fd:return Math.max(r,16)*Math.max(t,8)/4;case Pd:case Id:return Math.max(r,8)*Math.max(t,8)/2;case Bd:case Hd:case Vd:case kd:return Math.floor((r+3)/4)*Math.floor((t+3)/4)*8;case Gd:case Xd:case Wd:return Math.floor((r+3)/4)*Math.floor((t+3)/4)*16;case qd:return Math.floor((r+3)/4)*Math.floor((t+3)/4)*16;case Yd:return Math.floor((r+4)/5)*Math.floor((t+3)/4)*16;case jd:return Math.floor((r+4)/5)*Math.floor((t+4)/5)*16;case Zd:return Math.floor((r+5)/6)*Math.floor((t+4)/5)*16;case Kd:return Math.floor((r+5)/6)*Math.floor((t+5)/6)*16;case Qd:return Math.floor((r+7)/8)*Math.floor((t+4)/5)*16;case Jd:return Math.floor((r+7)/8)*Math.floor((t+5)/6)*16;case $d:return Math.floor((r+7)/8)*Math.floor((t+7)/8)*16;case tp:return Math.floor((r+9)/10)*Math.floor((t+4)/5)*16;case ep:return Math.floor((r+9)/10)*Math.floor((t+5)/6)*16;case np:return Math.floor((r+9)/10)*Math.floor((t+7)/8)*16;case ip:return Math.floor((r+9)/10)*Math.floor((t+9)/10)*16;case ap:return Math.floor((r+11)/12)*Math.floor((t+9)/10)*16;case sp:return Math.floor((r+11)/12)*Math.floor((t+11)/12)*16;case rp:case op:case lp:return Math.ceil(r/4)*Math.ceil(t/4)*16;case cp:case up:return Math.ceil(r/4)*Math.ceil(t/4)*8;case fp:case hp:return Math.ceil(r/4)*Math.ceil(t/4)*16}throw new Error(`Unable to determine texture byte length for ${i} format.`)}function zE(r){switch(r){case di:case Jv:return{byteLength:1,components:1};case pl:case $v:case Pa:return{byteLength:2,components:1};case Ep:case bp:return{byteLength:2,components:4};case aa:case Mp:case ta:return{byteLength:4,components:1};case tx:case ex:return{byteLength:4,components:3}}throw new Error(`Unknown texture type ${r}.`)}typeof __THREE_DEVTOOLS__<"u"&&__THREE_DEVTOOLS__.dispatchEvent(new CustomEvent("register",{detail:{revision:Sp}}));typeof window<"u"&&(window.__THREE__?ee("WARNING: Multiple instances of Three.js being imported."):window.__THREE__=Sp);function vx(){let r=null,t=!1,i=null,s=null;function l(c,h){i(c,h),s=r.requestAnimationFrame(l)}return{start:function(){t!==!0&&i!==null&&(s=r.requestAnimationFrame(l),t=!0)},stop:function(){r.cancelAnimationFrame(s),t=!1},setAnimationLoop:function(c){i=c},setContext:function(c){r=c}}}function IE(r){const t=new WeakMap;function i(d,m){const p=d.array,v=d.usage,g=p.byteLength,_=r.createBuffer();r.bindBuffer(m,_),r.bufferData(m,p,v),d.onUploadCallback();let M;if(p instanceof Float32Array)M=r.FLOAT;else if(typeof Float16Array<"u"&&p instanceof Float16Array)M=r.HALF_FLOAT;else if(p instanceof Uint16Array)d.isFloat16BufferAttribute?M=r.HALF_FLOAT:M=r.UNSIGNED_SHORT;else if(p instanceof Int16Array)M=r.SHORT;else if(p instanceof Uint32Array)M=r.UNSIGNED_INT;else if(p instanceof Int32Array)M=r.INT;else if(p instanceof Int8Array)M=r.BYTE;else if(p instanceof Uint8Array)M=r.UNSIGNED_BYTE;else if(p instanceof Uint8ClampedArray)M=r.UNSIGNED_BYTE;else throw new Error("THREE.WebGLAttributes: Unsupported buffer data format: "+p);return{buffer:_,type:M,bytesPerElement:p.BYTES_PER_ELEMENT,version:d.version,size:g}}function s(d,m,p){const v=m.array,g=m.updateRanges;if(r.bindBuffer(p,d),g.length===0)r.bufferSubData(p,0,v);else{g.sort((M,E)=>M.start-E.start);let _=0;for(let M=1;M<g.length;M++){const E=g[_],A=g[M];A.start<=E.start+E.count+1?E.count=Math.max(E.count,A.start+A.count-E.start):(++_,g[_]=A)}g.length=_+1;for(let M=0,E=g.length;M<E;M++){const A=g[M];r.bufferSubData(p,A.start*v.BYTES_PER_ELEMENT,v,A.start,A.count)}m.clearUpdateRanges()}m.onUploadCallback()}function l(d){return d.isInterleavedBufferAttribute&&(d=d.data),t.get(d)}function c(d){d.isInterleavedBufferAttribute&&(d=d.data);const m=t.get(d);m&&(r.deleteBuffer(m.buffer),t.delete(d))}function h(d,m){if(d.isInterleavedBufferAttribute&&(d=d.data),d.isGLBufferAttribute){const v=t.get(d);(!v||v.version<d.version)&&t.set(d,{buffer:d.buffer,type:d.type,bytesPerElement:d.elementSize,version:d.version});return}const p=t.get(d);if(p===void 0)t.set(d,i(d,m));else if(p.version<d.version){if(p.size!==d.array.byteLength)throw new Error("THREE.WebGLAttributes: The size of the buffer attribute's array buffer does not match the original size. Resizing buffer attributes is not supported.");s(p.buffer,d,m),p.version=d.version}}return{get:l,remove:c,update:h}}var FE=`#ifdef USE_ALPHAHASH
14
14
  if ( diffuseColor.a < getAlphaHashThreshold( vPosition ) ) discard;
15
- #endif`,zE=`#ifdef USE_ALPHAHASH
15
+ #endif`,BE=`#ifdef USE_ALPHAHASH
16
16
  const float ALPHA_HASH_SCALE = 0.05;
17
17
  float hash2D( vec2 value ) {
18
18
  return fract( 1.0e4 * sin( 17.0 * value.x + 0.1 * value.y ) * ( 0.1 + abs( sin( 13.0 * value.y + value.x ) ) ) );
@@ -47,20 +47,20 @@ Error generating stack: `+o.message+`
47
47
  : cases.z;
48
48
  return clamp( threshold , 1.0e-6, 1.0 );
49
49
  }
50
- #endif`,IE=`#ifdef USE_ALPHAMAP
50
+ #endif`,HE=`#ifdef USE_ALPHAMAP
51
51
  diffuseColor.a *= texture2D( alphaMap, vAlphaMapUv ).g;
52
- #endif`,FE=`#ifdef USE_ALPHAMAP
52
+ #endif`,GE=`#ifdef USE_ALPHAMAP
53
53
  uniform sampler2D alphaMap;
54
- #endif`,BE=`#ifdef USE_ALPHATEST
54
+ #endif`,VE=`#ifdef USE_ALPHATEST
55
55
  #ifdef ALPHA_TO_COVERAGE
56
56
  diffuseColor.a = smoothstep( alphaTest, alphaTest + fwidth( diffuseColor.a ), diffuseColor.a );
57
57
  if ( diffuseColor.a == 0.0 ) discard;
58
58
  #else
59
59
  if ( diffuseColor.a < alphaTest ) discard;
60
60
  #endif
61
- #endif`,HE=`#ifdef USE_ALPHATEST
61
+ #endif`,kE=`#ifdef USE_ALPHATEST
62
62
  uniform float alphaTest;
63
- #endif`,GE=`#ifdef USE_AOMAP
63
+ #endif`,XE=`#ifdef USE_AOMAP
64
64
  float ambientOcclusion = ( texture2D( aoMap, vAoMapUv ).r - 1.0 ) * aoMapIntensity + 1.0;
65
65
  reflectedLight.indirectDiffuse *= ambientOcclusion;
66
66
  #if defined( USE_CLEARCOAT )
@@ -73,10 +73,10 @@ Error generating stack: `+o.message+`
73
73
  float dotNV = saturate( dot( geometryNormal, geometryViewDir ) );
74
74
  reflectedLight.indirectSpecular *= computeSpecularOcclusion( dotNV, ambientOcclusion, material.roughness );
75
75
  #endif
76
- #endif`,VE=`#ifdef USE_AOMAP
76
+ #endif`,WE=`#ifdef USE_AOMAP
77
77
  uniform sampler2D aoMap;
78
78
  uniform float aoMapIntensity;
79
- #endif`,kE=`#ifdef USE_BATCHING
79
+ #endif`,qE=`#ifdef USE_BATCHING
80
80
  #if ! defined( GL_ANGLE_multi_draw )
81
81
  #define gl_DrawID _gl_DrawID
82
82
  uniform int _gl_DrawID;
@@ -110,15 +110,15 @@ Error generating stack: `+o.message+`
110
110
  int y = j / size;
111
111
  return texelFetch( batchingColorTexture, ivec2( x, y ), 0 );
112
112
  }
113
- #endif`,XE=`#ifdef USE_BATCHING
113
+ #endif`,YE=`#ifdef USE_BATCHING
114
114
  mat4 batchingMatrix = getBatchingMatrix( getIndirectIndex( gl_DrawID ) );
115
- #endif`,WE=`vec3 transformed = vec3( position );
115
+ #endif`,jE=`vec3 transformed = vec3( position );
116
116
  #ifdef USE_ALPHAHASH
117
117
  vPosition = vec3( position );
118
- #endif`,qE=`vec3 objectNormal = vec3( normal );
118
+ #endif`,ZE=`vec3 objectNormal = vec3( normal );
119
119
  #ifdef USE_TANGENT
120
120
  vec3 objectTangent = vec3( tangent.xyz );
121
- #endif`,YE=`float G_BlinnPhong_Implicit( ) {
121
+ #endif`,KE=`float G_BlinnPhong_Implicit( ) {
122
122
  return 0.25;
123
123
  }
124
124
  float D_BlinnPhong( const in float shininess, const in float dotNH ) {
@@ -132,7 +132,7 @@ vec3 BRDF_BlinnPhong( const in vec3 lightDir, const in vec3 viewDir, const in ve
132
132
  float G = G_BlinnPhong_Implicit( );
133
133
  float D = D_BlinnPhong( shininess, dotNH );
134
134
  return F * ( G * D );
135
- } // validated`,jE=`#ifdef USE_IRIDESCENCE
135
+ } // validated`,QE=`#ifdef USE_IRIDESCENCE
136
136
  const mat3 XYZ_TO_REC709 = mat3(
137
137
  3.2404542, -0.9692660, 0.0556434,
138
138
  -1.5371385, 1.8760108, -0.2040259,
@@ -195,7 +195,7 @@ vec3 BRDF_BlinnPhong( const in vec3 lightDir, const in vec3 viewDir, const in ve
195
195
  }
196
196
  return max( I, vec3( 0.0 ) );
197
197
  }
198
- #endif`,ZE=`#ifdef USE_BUMPMAP
198
+ #endif`,JE=`#ifdef USE_BUMPMAP
199
199
  uniform sampler2D bumpMap;
200
200
  uniform float bumpScale;
201
201
  vec2 dHdxy_fwd() {
@@ -216,7 +216,7 @@ vec3 BRDF_BlinnPhong( const in vec3 lightDir, const in vec3 viewDir, const in ve
216
216
  vec3 vGrad = sign( fDet ) * ( dHdxy.x * R1 + dHdxy.y * R2 );
217
217
  return normalize( abs( fDet ) * surf_norm - vGrad );
218
218
  }
219
- #endif`,KE=`#if NUM_CLIPPING_PLANES > 0
219
+ #endif`,$E=`#if NUM_CLIPPING_PLANES > 0
220
220
  vec4 plane;
221
221
  #ifdef ALPHA_TO_COVERAGE
222
222
  float distanceToPlane, distanceGradient;
@@ -262,20 +262,20 @@ vec3 BRDF_BlinnPhong( const in vec3 lightDir, const in vec3 viewDir, const in ve
262
262
  if ( clipped ) discard;
263
263
  #endif
264
264
  #endif
265
- #endif`,QE=`#if NUM_CLIPPING_PLANES > 0
265
+ #endif`,tb=`#if NUM_CLIPPING_PLANES > 0
266
266
  varying vec3 vClipPosition;
267
267
  uniform vec4 clippingPlanes[ NUM_CLIPPING_PLANES ];
268
- #endif`,JE=`#if NUM_CLIPPING_PLANES > 0
268
+ #endif`,eb=`#if NUM_CLIPPING_PLANES > 0
269
269
  varying vec3 vClipPosition;
270
- #endif`,$E=`#if NUM_CLIPPING_PLANES > 0
270
+ #endif`,nb=`#if NUM_CLIPPING_PLANES > 0
271
271
  vClipPosition = - mvPosition.xyz;
272
- #endif`,tb=`#if defined( USE_COLOR ) || defined( USE_COLOR_ALPHA )
272
+ #endif`,ib=`#if defined( USE_COLOR ) || defined( USE_COLOR_ALPHA )
273
273
  diffuseColor *= vColor;
274
- #endif`,eb=`#if defined( USE_COLOR ) || defined( USE_COLOR_ALPHA )
274
+ #endif`,ab=`#if defined( USE_COLOR ) || defined( USE_COLOR_ALPHA )
275
275
  varying vec4 vColor;
276
- #endif`,nb=`#if defined( USE_COLOR ) || defined( USE_COLOR_ALPHA ) || defined( USE_INSTANCING_COLOR ) || defined( USE_BATCHING_COLOR )
276
+ #endif`,sb=`#if defined( USE_COLOR ) || defined( USE_COLOR_ALPHA ) || defined( USE_INSTANCING_COLOR ) || defined( USE_BATCHING_COLOR )
277
277
  varying vec4 vColor;
278
- #endif`,ib=`#if defined( USE_COLOR ) || defined( USE_COLOR_ALPHA ) || defined( USE_INSTANCING_COLOR ) || defined( USE_BATCHING_COLOR )
278
+ #endif`,rb=`#if defined( USE_COLOR ) || defined( USE_COLOR_ALPHA ) || defined( USE_INSTANCING_COLOR ) || defined( USE_BATCHING_COLOR )
279
279
  vColor = vec4( 1.0 );
280
280
  #endif
281
281
  #ifdef USE_COLOR_ALPHA
@@ -288,7 +288,7 @@ vec3 BRDF_BlinnPhong( const in vec3 lightDir, const in vec3 viewDir, const in ve
288
288
  #endif
289
289
  #ifdef USE_BATCHING_COLOR
290
290
  vColor *= getBatchingColor( getIndirectIndex( gl_DrawID ) );
291
- #endif`,ab=`#define PI 3.141592653589793
291
+ #endif`,ob=`#define PI 3.141592653589793
292
292
  #define PI2 6.283185307179586
293
293
  #define PI_HALF 1.5707963267948966
294
294
  #define RECIPROCAL_PI 0.3183098861837907
@@ -355,7 +355,7 @@ vec3 F_Schlick( const in vec3 f0, const in float f90, const in float dotVH ) {
355
355
  float F_Schlick( const in float f0, const in float f90, const in float dotVH ) {
356
356
  float fresnel = exp2( ( - 5.55473 * dotVH - 6.98316 ) * dotVH );
357
357
  return f0 * ( 1.0 - fresnel ) + ( f90 * fresnel );
358
- } // validated`,sb=`#ifdef ENVMAP_TYPE_CUBE_UV
358
+ } // validated`,lb=`#ifdef ENVMAP_TYPE_CUBE_UV
359
359
  #define cubeUV_minMipLevel 4.0
360
360
  #define cubeUV_minTileSize 16.0
361
361
  float getFace( vec3 direction ) {
@@ -448,7 +448,7 @@ float F_Schlick( const in float f0, const in float f90, const in float dotVH ) {
448
448
  return vec4( mix( color0, color1, mipF ), 1.0 );
449
449
  }
450
450
  }
451
- #endif`,rb=`vec3 transformedNormal = objectNormal;
451
+ #endif`,cb=`vec3 transformedNormal = objectNormal;
452
452
  #ifdef USE_TANGENT
453
453
  vec3 transformedTangent = objectTangent;
454
454
  #endif
@@ -477,21 +477,21 @@ transformedNormal = normalMatrix * transformedNormal;
477
477
  #ifdef FLIP_SIDED
478
478
  transformedTangent = - transformedTangent;
479
479
  #endif
480
- #endif`,ob=`#ifdef USE_DISPLACEMENTMAP
480
+ #endif`,ub=`#ifdef USE_DISPLACEMENTMAP
481
481
  uniform sampler2D displacementMap;
482
482
  uniform float displacementScale;
483
483
  uniform float displacementBias;
484
- #endif`,lb=`#ifdef USE_DISPLACEMENTMAP
484
+ #endif`,fb=`#ifdef USE_DISPLACEMENTMAP
485
485
  transformed += normalize( objectNormal ) * ( texture2D( displacementMap, vDisplacementMapUv ).x * displacementScale + displacementBias );
486
- #endif`,cb=`#ifdef USE_EMISSIVEMAP
486
+ #endif`,hb=`#ifdef USE_EMISSIVEMAP
487
487
  vec4 emissiveColor = texture2D( emissiveMap, vEmissiveMapUv );
488
488
  #ifdef DECODE_VIDEO_TEXTURE_EMISSIVE
489
489
  emissiveColor = sRGBTransferEOTF( emissiveColor );
490
490
  #endif
491
491
  totalEmissiveRadiance *= emissiveColor.rgb;
492
- #endif`,ub=`#ifdef USE_EMISSIVEMAP
492
+ #endif`,db=`#ifdef USE_EMISSIVEMAP
493
493
  uniform sampler2D emissiveMap;
494
- #endif`,fb="gl_FragColor = linearToOutputTexel( gl_FragColor );",hb=`vec4 LinearTransferOETF( in vec4 value ) {
494
+ #endif`,pb="gl_FragColor = linearToOutputTexel( gl_FragColor );",mb=`vec4 LinearTransferOETF( in vec4 value ) {
495
495
  return value;
496
496
  }
497
497
  vec4 sRGBTransferEOTF( in vec4 value ) {
@@ -499,7 +499,7 @@ vec4 sRGBTransferEOTF( in vec4 value ) {
499
499
  }
500
500
  vec4 sRGBTransferOETF( in vec4 value ) {
501
501
  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 );
502
- }`,db=`#ifdef USE_ENVMAP
502
+ }`,gb=`#ifdef USE_ENVMAP
503
503
  #ifdef ENV_WORLDPOS
504
504
  vec3 cameraToFrag;
505
505
  if ( isOrthographic ) {
@@ -526,7 +526,7 @@ vec4 sRGBTransferOETF( in vec4 value ) {
526
526
  outgoingLight += envColor.xyz * specularStrength * reflectivity;
527
527
  #endif
528
528
  #endif
529
- #endif`,pb=`#ifdef USE_ENVMAP
529
+ #endif`,_b=`#ifdef USE_ENVMAP
530
530
  uniform float envMapIntensity;
531
531
  uniform float flipEnvMap;
532
532
  uniform mat3 envMapRotation;
@@ -535,7 +535,7 @@ vec4 sRGBTransferOETF( in vec4 value ) {
535
535
  #else
536
536
  uniform sampler2D envMap;
537
537
  #endif
538
- #endif`,mb=`#ifdef USE_ENVMAP
538
+ #endif`,vb=`#ifdef USE_ENVMAP
539
539
  uniform float reflectivity;
540
540
  #if defined( USE_BUMPMAP ) || defined( USE_NORMALMAP ) || defined( PHONG ) || defined( LAMBERT )
541
541
  #define ENV_WORLDPOS
@@ -546,7 +546,7 @@ vec4 sRGBTransferOETF( in vec4 value ) {
546
546
  #else
547
547
  varying vec3 vReflect;
548
548
  #endif
549
- #endif`,gb=`#ifdef USE_ENVMAP
549
+ #endif`,xb=`#ifdef USE_ENVMAP
550
550
  #if defined( USE_BUMPMAP ) || defined( USE_NORMALMAP ) || defined( PHONG ) || defined( LAMBERT )
551
551
  #define ENV_WORLDPOS
552
552
  #endif
@@ -557,7 +557,7 @@ vec4 sRGBTransferOETF( in vec4 value ) {
557
557
  varying vec3 vReflect;
558
558
  uniform float refractionRatio;
559
559
  #endif
560
- #endif`,_b=`#ifdef USE_ENVMAP
560
+ #endif`,Sb=`#ifdef USE_ENVMAP
561
561
  #ifdef ENV_WORLDPOS
562
562
  vWorldPosition = worldPosition.xyz;
563
563
  #else
@@ -574,18 +574,18 @@ vec4 sRGBTransferOETF( in vec4 value ) {
574
574
  vReflect = refract( cameraToVertex, worldNormal, refractionRatio );
575
575
  #endif
576
576
  #endif
577
- #endif`,vb=`#ifdef USE_FOG
577
+ #endif`,yb=`#ifdef USE_FOG
578
578
  vFogDepth = - mvPosition.z;
579
- #endif`,xb=`#ifdef USE_FOG
579
+ #endif`,Mb=`#ifdef USE_FOG
580
580
  varying float vFogDepth;
581
- #endif`,Sb=`#ifdef USE_FOG
581
+ #endif`,Eb=`#ifdef USE_FOG
582
582
  #ifdef FOG_EXP2
583
583
  float fogFactor = 1.0 - exp( - fogDensity * fogDensity * vFogDepth * vFogDepth );
584
584
  #else
585
585
  float fogFactor = smoothstep( fogNear, fogFar, vFogDepth );
586
586
  #endif
587
587
  gl_FragColor.rgb = mix( gl_FragColor.rgb, fogColor, fogFactor );
588
- #endif`,yb=`#ifdef USE_FOG
588
+ #endif`,bb=`#ifdef USE_FOG
589
589
  uniform vec3 fogColor;
590
590
  varying float vFogDepth;
591
591
  #ifdef FOG_EXP2
@@ -594,7 +594,7 @@ vec4 sRGBTransferOETF( in vec4 value ) {
594
594
  uniform float fogNear;
595
595
  uniform float fogFar;
596
596
  #endif
597
- #endif`,Mb=`#ifdef USE_GRADIENTMAP
597
+ #endif`,Tb=`#ifdef USE_GRADIENTMAP
598
598
  uniform sampler2D gradientMap;
599
599
  #endif
600
600
  vec3 getGradientIrradiance( vec3 normal, vec3 lightDirection ) {
@@ -606,12 +606,12 @@ vec3 getGradientIrradiance( vec3 normal, vec3 lightDirection ) {
606
606
  vec2 fw = fwidth( coord ) * 0.5;
607
607
  return mix( vec3( 0.7 ), vec3( 1.0 ), smoothstep( 0.7 - fw.x, 0.7 + fw.x, coord.x ) );
608
608
  #endif
609
- }`,Eb=`#ifdef USE_LIGHTMAP
609
+ }`,Ab=`#ifdef USE_LIGHTMAP
610
610
  uniform sampler2D lightMap;
611
611
  uniform float lightMapIntensity;
612
- #endif`,bb=`LambertMaterial material;
612
+ #endif`,Rb=`LambertMaterial material;
613
613
  material.diffuseColor = diffuseColor.rgb;
614
- material.specularStrength = specularStrength;`,Tb=`varying vec3 vViewPosition;
614
+ material.specularStrength = specularStrength;`,Cb=`varying vec3 vViewPosition;
615
615
  struct LambertMaterial {
616
616
  vec3 diffuseColor;
617
617
  float specularStrength;
@@ -625,7 +625,7 @@ void RE_IndirectDiffuse_Lambert( const in vec3 irradiance, const in vec3 geometr
625
625
  reflectedLight.indirectDiffuse += irradiance * BRDF_Lambert( material.diffuseColor );
626
626
  }
627
627
  #define RE_Direct RE_Direct_Lambert
628
- #define RE_IndirectDiffuse RE_IndirectDiffuse_Lambert`,Ab=`uniform bool receiveShadow;
628
+ #define RE_IndirectDiffuse RE_IndirectDiffuse_Lambert`,wb=`uniform bool receiveShadow;
629
629
  uniform vec3 ambientLightColor;
630
630
  #if defined( USE_LIGHT_PROBES )
631
631
  uniform vec3 lightProbe[ 9 ];
@@ -741,7 +741,7 @@ float getSpotAttenuation( const in float coneCosine, const in float penumbraCosi
741
741
  vec3 irradiance = mix( hemiLight.groundColor, hemiLight.skyColor, hemiDiffuseWeight );
742
742
  return irradiance;
743
743
  }
744
- #endif`,Rb=`#ifdef USE_ENVMAP
744
+ #endif`,Db=`#ifdef USE_ENVMAP
745
745
  vec3 getIBLIrradiance( const in vec3 normal ) {
746
746
  #ifdef ENVMAP_TYPE_CUBE_UV
747
747
  vec3 worldNormal = inverseTransformDirection( normal, viewMatrix );
@@ -774,8 +774,8 @@ float getSpotAttenuation( const in float coneCosine, const in float penumbraCosi
774
774
  #endif
775
775
  }
776
776
  #endif
777
- #endif`,Cb=`ToonMaterial material;
778
- material.diffuseColor = diffuseColor.rgb;`,wb=`varying vec3 vViewPosition;
777
+ #endif`,Ub=`ToonMaterial material;
778
+ material.diffuseColor = diffuseColor.rgb;`,Lb=`varying vec3 vViewPosition;
779
779
  struct ToonMaterial {
780
780
  vec3 diffuseColor;
781
781
  };
@@ -787,11 +787,11 @@ void RE_IndirectDiffuse_Toon( const in vec3 irradiance, const in vec3 geometryPo
787
787
  reflectedLight.indirectDiffuse += irradiance * BRDF_Lambert( material.diffuseColor );
788
788
  }
789
789
  #define RE_Direct RE_Direct_Toon
790
- #define RE_IndirectDiffuse RE_IndirectDiffuse_Toon`,Db=`BlinnPhongMaterial material;
790
+ #define RE_IndirectDiffuse RE_IndirectDiffuse_Toon`,Nb=`BlinnPhongMaterial material;
791
791
  material.diffuseColor = diffuseColor.rgb;
792
792
  material.specularColor = specular;
793
793
  material.specularShininess = shininess;
794
- material.specularStrength = specularStrength;`,Ub=`varying vec3 vViewPosition;
794
+ material.specularStrength = specularStrength;`,Ob=`varying vec3 vViewPosition;
795
795
  struct BlinnPhongMaterial {
796
796
  vec3 diffuseColor;
797
797
  vec3 specularColor;
@@ -808,7 +808,7 @@ void RE_IndirectDiffuse_BlinnPhong( const in vec3 irradiance, const in vec3 geom
808
808
  reflectedLight.indirectDiffuse += irradiance * BRDF_Lambert( material.diffuseColor );
809
809
  }
810
810
  #define RE_Direct RE_Direct_BlinnPhong
811
- #define RE_IndirectDiffuse RE_IndirectDiffuse_BlinnPhong`,Lb=`PhysicalMaterial material;
811
+ #define RE_IndirectDiffuse RE_IndirectDiffuse_BlinnPhong`,Pb=`PhysicalMaterial material;
812
812
  material.diffuseColor = diffuseColor.rgb;
813
813
  material.diffuseContribution = diffuseColor.rgb * ( 1.0 - metalnessFactor );
814
814
  material.metalness = metalnessFactor;
@@ -898,7 +898,7 @@ material.roughness = min( material.roughness, 1.0 );
898
898
  material.alphaT = mix( pow2( material.roughness ), 1.0, pow2( material.anisotropy ) );
899
899
  material.anisotropyT = tbn[ 0 ] * anisotropyV.x + tbn[ 1 ] * anisotropyV.y;
900
900
  material.anisotropyB = tbn[ 1 ] * anisotropyV.x - tbn[ 0 ] * anisotropyV.y;
901
- #endif`,Nb=`uniform sampler2D dfgLUT;
901
+ #endif`,zb=`uniform sampler2D dfgLUT;
902
902
  struct PhysicalMaterial {
903
903
  vec3 diffuseColor;
904
904
  vec3 diffuseContribution;
@@ -1259,7 +1259,7 @@ void RE_IndirectSpecular_Physical( const in vec3 radiance, const in vec3 irradia
1259
1259
  #define RE_IndirectSpecular RE_IndirectSpecular_Physical
1260
1260
  float computeSpecularOcclusion( const in float dotNV, const in float ambientOcclusion, const in float roughness ) {
1261
1261
  return saturate( pow( dotNV + ambientOcclusion, exp2( - 16.0 * roughness - 1.0 ) ) - 1.0 + ambientOcclusion );
1262
- }`,Ob=`
1262
+ }`,Ib=`
1263
1263
  vec3 geometryPosition = - vViewPosition;
1264
1264
  vec3 geometryNormal = normal;
1265
1265
  vec3 geometryViewDir = ( isOrthographic ) ? vec3( 0, 0, 1 ) : normalize( vViewPosition );
@@ -1376,7 +1376,7 @@ IncidentLight directLight;
1376
1376
  #if defined( RE_IndirectSpecular )
1377
1377
  vec3 radiance = vec3( 0.0 );
1378
1378
  vec3 clearcoatRadiance = vec3( 0.0 );
1379
- #endif`,Pb=`#if defined( RE_IndirectDiffuse )
1379
+ #endif`,Fb=`#if defined( RE_IndirectDiffuse )
1380
1380
  #ifdef USE_LIGHTMAP
1381
1381
  vec4 lightMapTexel = texture2D( lightMap, vLightMapUv );
1382
1382
  vec3 lightMapIrradiance = lightMapTexel.rgb * lightMapIntensity;
@@ -1397,7 +1397,7 @@ IncidentLight directLight;
1397
1397
  #ifdef USE_CLEARCOAT
1398
1398
  clearcoatRadiance += getIBLRadiance( geometryViewDir, geometryClearcoatNormal, material.clearcoatRoughness );
1399
1399
  #endif
1400
- #endif`,zb=`#if defined( RE_IndirectDiffuse )
1400
+ #endif`,Bb=`#if defined( RE_IndirectDiffuse )
1401
1401
  #if defined( LAMBERT ) || defined( PHONG )
1402
1402
  irradiance += iblIrradiance;
1403
1403
  #endif
@@ -1405,27 +1405,27 @@ IncidentLight directLight;
1405
1405
  #endif
1406
1406
  #if defined( RE_IndirectSpecular )
1407
1407
  RE_IndirectSpecular( radiance, iblIrradiance, clearcoatRadiance, geometryPosition, geometryNormal, geometryViewDir, geometryClearcoatNormal, material, reflectedLight );
1408
- #endif`,Ib=`#if defined( USE_LOGARITHMIC_DEPTH_BUFFER )
1408
+ #endif`,Hb=`#if defined( USE_LOGARITHMIC_DEPTH_BUFFER )
1409
1409
  gl_FragDepth = vIsPerspective == 0.0 ? gl_FragCoord.z : log2( vFragDepth ) * logDepthBufFC * 0.5;
1410
- #endif`,Fb=`#if defined( USE_LOGARITHMIC_DEPTH_BUFFER )
1410
+ #endif`,Gb=`#if defined( USE_LOGARITHMIC_DEPTH_BUFFER )
1411
1411
  uniform float logDepthBufFC;
1412
1412
  varying float vFragDepth;
1413
1413
  varying float vIsPerspective;
1414
- #endif`,Bb=`#ifdef USE_LOGARITHMIC_DEPTH_BUFFER
1414
+ #endif`,Vb=`#ifdef USE_LOGARITHMIC_DEPTH_BUFFER
1415
1415
  varying float vFragDepth;
1416
1416
  varying float vIsPerspective;
1417
- #endif`,Hb=`#ifdef USE_LOGARITHMIC_DEPTH_BUFFER
1417
+ #endif`,kb=`#ifdef USE_LOGARITHMIC_DEPTH_BUFFER
1418
1418
  vFragDepth = 1.0 + gl_Position.w;
1419
1419
  vIsPerspective = float( isPerspectiveMatrix( projectionMatrix ) );
1420
- #endif`,Gb=`#ifdef USE_MAP
1420
+ #endif`,Xb=`#ifdef USE_MAP
1421
1421
  vec4 sampledDiffuseColor = texture2D( map, vMapUv );
1422
1422
  #ifdef DECODE_VIDEO_TEXTURE
1423
1423
  sampledDiffuseColor = sRGBTransferEOTF( sampledDiffuseColor );
1424
1424
  #endif
1425
1425
  diffuseColor *= sampledDiffuseColor;
1426
- #endif`,Vb=`#ifdef USE_MAP
1426
+ #endif`,Wb=`#ifdef USE_MAP
1427
1427
  uniform sampler2D map;
1428
- #endif`,kb=`#if defined( USE_MAP ) || defined( USE_ALPHAMAP )
1428
+ #endif`,qb=`#if defined( USE_MAP ) || defined( USE_ALPHAMAP )
1429
1429
  #if defined( USE_POINTS_UV )
1430
1430
  vec2 uv = vUv;
1431
1431
  #else
@@ -1437,7 +1437,7 @@ IncidentLight directLight;
1437
1437
  #endif
1438
1438
  #ifdef USE_ALPHAMAP
1439
1439
  diffuseColor.a *= texture2D( alphaMap, uv ).g;
1440
- #endif`,Xb=`#if defined( USE_POINTS_UV )
1440
+ #endif`,Yb=`#if defined( USE_POINTS_UV )
1441
1441
  varying vec2 vUv;
1442
1442
  #else
1443
1443
  #if defined( USE_MAP ) || defined( USE_ALPHAMAP )
@@ -1449,19 +1449,19 @@ IncidentLight directLight;
1449
1449
  #endif
1450
1450
  #ifdef USE_ALPHAMAP
1451
1451
  uniform sampler2D alphaMap;
1452
- #endif`,Wb=`float metalnessFactor = metalness;
1452
+ #endif`,jb=`float metalnessFactor = metalness;
1453
1453
  #ifdef USE_METALNESSMAP
1454
1454
  vec4 texelMetalness = texture2D( metalnessMap, vMetalnessMapUv );
1455
1455
  metalnessFactor *= texelMetalness.b;
1456
- #endif`,qb=`#ifdef USE_METALNESSMAP
1456
+ #endif`,Zb=`#ifdef USE_METALNESSMAP
1457
1457
  uniform sampler2D metalnessMap;
1458
- #endif`,Yb=`#ifdef USE_INSTANCING_MORPH
1458
+ #endif`,Kb=`#ifdef USE_INSTANCING_MORPH
1459
1459
  float morphTargetInfluences[ MORPHTARGETS_COUNT ];
1460
1460
  float morphTargetBaseInfluence = texelFetch( morphTexture, ivec2( 0, gl_InstanceID ), 0 ).r;
1461
1461
  for ( int i = 0; i < MORPHTARGETS_COUNT; i ++ ) {
1462
1462
  morphTargetInfluences[i] = texelFetch( morphTexture, ivec2( i + 1, gl_InstanceID ), 0 ).r;
1463
1463
  }
1464
- #endif`,jb=`#if defined( USE_MORPHCOLORS )
1464
+ #endif`,Qb=`#if defined( USE_MORPHCOLORS )
1465
1465
  vColor *= morphTargetBaseInfluence;
1466
1466
  for ( int i = 0; i < MORPHTARGETS_COUNT; i ++ ) {
1467
1467
  #if defined( USE_COLOR_ALPHA )
@@ -1470,12 +1470,12 @@ IncidentLight directLight;
1470
1470
  if ( morphTargetInfluences[ i ] != 0.0 ) vColor += getMorph( gl_VertexID, i, 2 ).rgb * morphTargetInfluences[ i ];
1471
1471
  #endif
1472
1472
  }
1473
- #endif`,Zb=`#ifdef USE_MORPHNORMALS
1473
+ #endif`,Jb=`#ifdef USE_MORPHNORMALS
1474
1474
  objectNormal *= morphTargetBaseInfluence;
1475
1475
  for ( int i = 0; i < MORPHTARGETS_COUNT; i ++ ) {
1476
1476
  if ( morphTargetInfluences[ i ] != 0.0 ) objectNormal += getMorph( gl_VertexID, i, 1 ).xyz * morphTargetInfluences[ i ];
1477
1477
  }
1478
- #endif`,Kb=`#ifdef USE_MORPHTARGETS
1478
+ #endif`,$b=`#ifdef USE_MORPHTARGETS
1479
1479
  #ifndef USE_INSTANCING_MORPH
1480
1480
  uniform float morphTargetBaseInfluence;
1481
1481
  uniform float morphTargetInfluences[ MORPHTARGETS_COUNT ];
@@ -1489,12 +1489,12 @@ IncidentLight directLight;
1489
1489
  ivec3 morphUV = ivec3( x, y, morphTargetIndex );
1490
1490
  return texelFetch( morphTargetsTexture, morphUV, 0 );
1491
1491
  }
1492
- #endif`,Qb=`#ifdef USE_MORPHTARGETS
1492
+ #endif`,tT=`#ifdef USE_MORPHTARGETS
1493
1493
  transformed *= morphTargetBaseInfluence;
1494
1494
  for ( int i = 0; i < MORPHTARGETS_COUNT; i ++ ) {
1495
1495
  if ( morphTargetInfluences[ i ] != 0.0 ) transformed += getMorph( gl_VertexID, i, 0 ).xyz * morphTargetInfluences[ i ];
1496
1496
  }
1497
- #endif`,Jb=`float faceDirection = gl_FrontFacing ? 1.0 : - 1.0;
1497
+ #endif`,eT=`float faceDirection = gl_FrontFacing ? 1.0 : - 1.0;
1498
1498
  #ifdef FLAT_SHADED
1499
1499
  vec3 fdx = dFdx( vViewPosition );
1500
1500
  vec3 fdy = dFdy( vViewPosition );
@@ -1535,7 +1535,7 @@ IncidentLight directLight;
1535
1535
  tbn2[1] *= faceDirection;
1536
1536
  #endif
1537
1537
  #endif
1538
- vec3 nonPerturbedNormal = normal;`,$b=`#ifdef USE_NORMALMAP_OBJECTSPACE
1538
+ vec3 nonPerturbedNormal = normal;`,nT=`#ifdef USE_NORMALMAP_OBJECTSPACE
1539
1539
  normal = texture2D( normalMap, vNormalMapUv ).xyz * 2.0 - 1.0;
1540
1540
  #ifdef FLIP_SIDED
1541
1541
  normal = - normal;
@@ -1550,25 +1550,25 @@ vec3 nonPerturbedNormal = normal;`,$b=`#ifdef USE_NORMALMAP_OBJECTSPACE
1550
1550
  normal = normalize( tbn * mapN );
1551
1551
  #elif defined( USE_BUMPMAP )
1552
1552
  normal = perturbNormalArb( - vViewPosition, normal, dHdxy_fwd(), faceDirection );
1553
- #endif`,tT=`#ifndef FLAT_SHADED
1553
+ #endif`,iT=`#ifndef FLAT_SHADED
1554
1554
  varying vec3 vNormal;
1555
1555
  #ifdef USE_TANGENT
1556
1556
  varying vec3 vTangent;
1557
1557
  varying vec3 vBitangent;
1558
1558
  #endif
1559
- #endif`,eT=`#ifndef FLAT_SHADED
1559
+ #endif`,aT=`#ifndef FLAT_SHADED
1560
1560
  varying vec3 vNormal;
1561
1561
  #ifdef USE_TANGENT
1562
1562
  varying vec3 vTangent;
1563
1563
  varying vec3 vBitangent;
1564
1564
  #endif
1565
- #endif`,nT=`#ifndef FLAT_SHADED
1565
+ #endif`,sT=`#ifndef FLAT_SHADED
1566
1566
  vNormal = normalize( transformedNormal );
1567
1567
  #ifdef USE_TANGENT
1568
1568
  vTangent = normalize( transformedTangent );
1569
1569
  vBitangent = normalize( cross( vNormal, vTangent ) * tangent.w );
1570
1570
  #endif
1571
- #endif`,iT=`#ifdef USE_NORMALMAP
1571
+ #endif`,rT=`#ifdef USE_NORMALMAP
1572
1572
  uniform sampler2D normalMap;
1573
1573
  uniform vec2 normalScale;
1574
1574
  #endif
@@ -1590,13 +1590,13 @@ vec3 nonPerturbedNormal = normal;`,$b=`#ifdef USE_NORMALMAP_OBJECTSPACE
1590
1590
  float scale = ( det == 0.0 ) ? 0.0 : inversesqrt( det );
1591
1591
  return mat3( T * scale, B * scale, N );
1592
1592
  }
1593
- #endif`,aT=`#ifdef USE_CLEARCOAT
1593
+ #endif`,oT=`#ifdef USE_CLEARCOAT
1594
1594
  vec3 clearcoatNormal = nonPerturbedNormal;
1595
- #endif`,sT=`#ifdef USE_CLEARCOAT_NORMALMAP
1595
+ #endif`,lT=`#ifdef USE_CLEARCOAT_NORMALMAP
1596
1596
  vec3 clearcoatMapN = texture2D( clearcoatNormalMap, vClearcoatNormalMapUv ).xyz * 2.0 - 1.0;
1597
1597
  clearcoatMapN.xy *= clearcoatNormalScale;
1598
1598
  clearcoatNormal = normalize( tbn2 * clearcoatMapN );
1599
- #endif`,rT=`#ifdef USE_CLEARCOATMAP
1599
+ #endif`,cT=`#ifdef USE_CLEARCOATMAP
1600
1600
  uniform sampler2D clearcoatMap;
1601
1601
  #endif
1602
1602
  #ifdef USE_CLEARCOAT_NORMALMAP
@@ -1605,18 +1605,18 @@ vec3 nonPerturbedNormal = normal;`,$b=`#ifdef USE_NORMALMAP_OBJECTSPACE
1605
1605
  #endif
1606
1606
  #ifdef USE_CLEARCOAT_ROUGHNESSMAP
1607
1607
  uniform sampler2D clearcoatRoughnessMap;
1608
- #endif`,oT=`#ifdef USE_IRIDESCENCEMAP
1608
+ #endif`,uT=`#ifdef USE_IRIDESCENCEMAP
1609
1609
  uniform sampler2D iridescenceMap;
1610
1610
  #endif
1611
1611
  #ifdef USE_IRIDESCENCE_THICKNESSMAP
1612
1612
  uniform sampler2D iridescenceThicknessMap;
1613
- #endif`,lT=`#ifdef OPAQUE
1613
+ #endif`,fT=`#ifdef OPAQUE
1614
1614
  diffuseColor.a = 1.0;
1615
1615
  #endif
1616
1616
  #ifdef USE_TRANSMISSION
1617
1617
  diffuseColor.a *= material.transmissionAlpha;
1618
1618
  #endif
1619
- gl_FragColor = vec4( outgoingLight, diffuseColor.a );`,cT=`vec3 packNormalToRGB( const in vec3 normal ) {
1619
+ gl_FragColor = vec4( outgoingLight, diffuseColor.a );`,hT=`vec3 packNormalToRGB( const in vec3 normal ) {
1620
1620
  return normalize( normal ) * 0.5 + 0.5;
1621
1621
  }
1622
1622
  vec3 unpackRGBToNormal( const in vec3 rgb ) {
@@ -1695,9 +1695,9 @@ float perspectiveDepthToViewZ( const in float depth, const in float near, const
1695
1695
  #else
1696
1696
  return ( near * far ) / ( ( far - near ) * depth - far );
1697
1697
  #endif
1698
- }`,uT=`#ifdef PREMULTIPLIED_ALPHA
1698
+ }`,dT=`#ifdef PREMULTIPLIED_ALPHA
1699
1699
  gl_FragColor.rgb *= gl_FragColor.a;
1700
- #endif`,fT=`vec4 mvPosition = vec4( transformed, 1.0 );
1700
+ #endif`,pT=`vec4 mvPosition = vec4( transformed, 1.0 );
1701
1701
  #ifdef USE_BATCHING
1702
1702
  mvPosition = batchingMatrix * mvPosition;
1703
1703
  #endif
@@ -1705,22 +1705,22 @@ float perspectiveDepthToViewZ( const in float depth, const in float near, const
1705
1705
  mvPosition = instanceMatrix * mvPosition;
1706
1706
  #endif
1707
1707
  mvPosition = modelViewMatrix * mvPosition;
1708
- gl_Position = projectionMatrix * mvPosition;`,hT=`#ifdef DITHERING
1708
+ gl_Position = projectionMatrix * mvPosition;`,mT=`#ifdef DITHERING
1709
1709
  gl_FragColor.rgb = dithering( gl_FragColor.rgb );
1710
- #endif`,dT=`#ifdef DITHERING
1710
+ #endif`,gT=`#ifdef DITHERING
1711
1711
  vec3 dithering( vec3 color ) {
1712
1712
  float grid_position = rand( gl_FragCoord.xy );
1713
1713
  vec3 dither_shift_RGB = vec3( 0.25 / 255.0, -0.25 / 255.0, 0.25 / 255.0 );
1714
1714
  dither_shift_RGB = mix( 2.0 * dither_shift_RGB, -2.0 * dither_shift_RGB, grid_position );
1715
1715
  return color + dither_shift_RGB;
1716
1716
  }
1717
- #endif`,pT=`float roughnessFactor = roughness;
1717
+ #endif`,_T=`float roughnessFactor = roughness;
1718
1718
  #ifdef USE_ROUGHNESSMAP
1719
1719
  vec4 texelRoughness = texture2D( roughnessMap, vRoughnessMapUv );
1720
1720
  roughnessFactor *= texelRoughness.g;
1721
- #endif`,mT=`#ifdef USE_ROUGHNESSMAP
1721
+ #endif`,vT=`#ifdef USE_ROUGHNESSMAP
1722
1722
  uniform sampler2D roughnessMap;
1723
- #endif`,gT=`#if NUM_SPOT_LIGHT_COORDS > 0
1723
+ #endif`,xT=`#if NUM_SPOT_LIGHT_COORDS > 0
1724
1724
  varying vec4 vSpotLightCoord[ NUM_SPOT_LIGHT_COORDS ];
1725
1725
  #endif
1726
1726
  #if NUM_SPOT_LIGHT_MAPS > 0
@@ -1920,7 +1920,7 @@ gl_Position = projectionMatrix * mvPosition;`,hT=`#ifdef DITHERING
1920
1920
  }
1921
1921
  #endif
1922
1922
  #endif
1923
- #endif`,_T=`#if NUM_SPOT_LIGHT_COORDS > 0
1923
+ #endif`,ST=`#if NUM_SPOT_LIGHT_COORDS > 0
1924
1924
  uniform mat4 spotLightMatrix[ NUM_SPOT_LIGHT_COORDS ];
1925
1925
  varying vec4 vSpotLightCoord[ NUM_SPOT_LIGHT_COORDS ];
1926
1926
  #endif
@@ -1961,7 +1961,7 @@ gl_Position = projectionMatrix * mvPosition;`,hT=`#ifdef DITHERING
1961
1961
  };
1962
1962
  uniform PointLightShadow pointLightShadows[ NUM_POINT_LIGHT_SHADOWS ];
1963
1963
  #endif
1964
- #endif`,vT=`#if ( defined( USE_SHADOWMAP ) && ( NUM_DIR_LIGHT_SHADOWS > 0 || NUM_POINT_LIGHT_SHADOWS > 0 ) ) || ( NUM_SPOT_LIGHT_COORDS > 0 )
1964
+ #endif`,yT=`#if ( defined( USE_SHADOWMAP ) && ( NUM_DIR_LIGHT_SHADOWS > 0 || NUM_POINT_LIGHT_SHADOWS > 0 ) ) || ( NUM_SPOT_LIGHT_COORDS > 0 )
1965
1965
  vec3 shadowWorldNormal = inverseTransformDirection( transformedNormal, viewMatrix );
1966
1966
  vec4 shadowWorldPosition;
1967
1967
  #endif
@@ -1993,7 +1993,7 @@ gl_Position = projectionMatrix * mvPosition;`,hT=`#ifdef DITHERING
1993
1993
  vSpotLightCoord[ i ] = spotLightMatrix[ i ] * shadowWorldPosition;
1994
1994
  }
1995
1995
  #pragma unroll_loop_end
1996
- #endif`,xT=`float getShadowMask() {
1996
+ #endif`,MT=`float getShadowMask() {
1997
1997
  float shadow = 1.0;
1998
1998
  #ifdef USE_SHADOWMAP
1999
1999
  #if NUM_DIR_LIGHT_SHADOWS > 0
@@ -2025,12 +2025,12 @@ gl_Position = projectionMatrix * mvPosition;`,hT=`#ifdef DITHERING
2025
2025
  #endif
2026
2026
  #endif
2027
2027
  return shadow;
2028
- }`,ST=`#ifdef USE_SKINNING
2028
+ }`,ET=`#ifdef USE_SKINNING
2029
2029
  mat4 boneMatX = getBoneMatrix( skinIndex.x );
2030
2030
  mat4 boneMatY = getBoneMatrix( skinIndex.y );
2031
2031
  mat4 boneMatZ = getBoneMatrix( skinIndex.z );
2032
2032
  mat4 boneMatW = getBoneMatrix( skinIndex.w );
2033
- #endif`,yT=`#ifdef USE_SKINNING
2033
+ #endif`,bT=`#ifdef USE_SKINNING
2034
2034
  uniform mat4 bindMatrix;
2035
2035
  uniform mat4 bindMatrixInverse;
2036
2036
  uniform highp sampler2D boneTexture;
@@ -2045,7 +2045,7 @@ gl_Position = projectionMatrix * mvPosition;`,hT=`#ifdef DITHERING
2045
2045
  vec4 v4 = texelFetch( boneTexture, ivec2( x + 3, y ), 0 );
2046
2046
  return mat4( v1, v2, v3, v4 );
2047
2047
  }
2048
- #endif`,MT=`#ifdef USE_SKINNING
2048
+ #endif`,TT=`#ifdef USE_SKINNING
2049
2049
  vec4 skinVertex = bindMatrix * vec4( transformed, 1.0 );
2050
2050
  vec4 skinned = vec4( 0.0 );
2051
2051
  skinned += boneMatX * skinVertex * skinWeight.x;
@@ -2053,7 +2053,7 @@ gl_Position = projectionMatrix * mvPosition;`,hT=`#ifdef DITHERING
2053
2053
  skinned += boneMatZ * skinVertex * skinWeight.z;
2054
2054
  skinned += boneMatW * skinVertex * skinWeight.w;
2055
2055
  transformed = ( bindMatrixInverse * skinned ).xyz;
2056
- #endif`,ET=`#ifdef USE_SKINNING
2056
+ #endif`,AT=`#ifdef USE_SKINNING
2057
2057
  mat4 skinMatrix = mat4( 0.0 );
2058
2058
  skinMatrix += skinWeight.x * boneMatX;
2059
2059
  skinMatrix += skinWeight.y * boneMatY;
@@ -2064,17 +2064,17 @@ gl_Position = projectionMatrix * mvPosition;`,hT=`#ifdef DITHERING
2064
2064
  #ifdef USE_TANGENT
2065
2065
  objectTangent = vec4( skinMatrix * vec4( objectTangent, 0.0 ) ).xyz;
2066
2066
  #endif
2067
- #endif`,bT=`float specularStrength;
2067
+ #endif`,RT=`float specularStrength;
2068
2068
  #ifdef USE_SPECULARMAP
2069
2069
  vec4 texelSpecular = texture2D( specularMap, vSpecularMapUv );
2070
2070
  specularStrength = texelSpecular.r;
2071
2071
  #else
2072
2072
  specularStrength = 1.0;
2073
- #endif`,TT=`#ifdef USE_SPECULARMAP
2073
+ #endif`,CT=`#ifdef USE_SPECULARMAP
2074
2074
  uniform sampler2D specularMap;
2075
- #endif`,AT=`#if defined( TONE_MAPPING )
2075
+ #endif`,wT=`#if defined( TONE_MAPPING )
2076
2076
  gl_FragColor.rgb = toneMapping( gl_FragColor.rgb );
2077
- #endif`,RT=`#ifndef saturate
2077
+ #endif`,DT=`#ifndef saturate
2078
2078
  #define saturate( a ) clamp( a, 0.0, 1.0 )
2079
2079
  #endif
2080
2080
  uniform float toneMappingExposure;
@@ -2171,7 +2171,7 @@ vec3 NeutralToneMapping( vec3 color ) {
2171
2171
  float g = 1. - 1. / ( Desaturation * ( peak - newPeak ) + 1. );
2172
2172
  return mix( color, vec3( newPeak ), g );
2173
2173
  }
2174
- vec3 CustomToneMapping( vec3 color ) { return color; }`,CT=`#ifdef USE_TRANSMISSION
2174
+ vec3 CustomToneMapping( vec3 color ) { return color; }`,UT=`#ifdef USE_TRANSMISSION
2175
2175
  material.transmission = transmission;
2176
2176
  material.transmissionAlpha = 1.0;
2177
2177
  material.thickness = thickness;
@@ -2192,7 +2192,7 @@ vec3 CustomToneMapping( vec3 color ) { return color; }`,CT=`#ifdef USE_TRANSMISS
2192
2192
  material.attenuationColor, material.attenuationDistance );
2193
2193
  material.transmissionAlpha = mix( material.transmissionAlpha, transmitted.a, material.transmission );
2194
2194
  totalDiffuse = mix( totalDiffuse, transmitted.rgb, material.transmission );
2195
- #endif`,wT=`#ifdef USE_TRANSMISSION
2195
+ #endif`,LT=`#ifdef USE_TRANSMISSION
2196
2196
  uniform float transmission;
2197
2197
  uniform float thickness;
2198
2198
  uniform float attenuationDistance;
@@ -2318,7 +2318,7 @@ vec3 CustomToneMapping( vec3 color ) { return color; }`,CT=`#ifdef USE_TRANSMISS
2318
2318
  float transmittanceFactor = ( transmittance.r + transmittance.g + transmittance.b ) / 3.0;
2319
2319
  return vec4( ( 1.0 - F ) * attenuatedColor, 1.0 - ( 1.0 - transmittedLight.a ) * transmittanceFactor );
2320
2320
  }
2321
- #endif`,DT=`#if defined( USE_UV ) || defined( USE_ANISOTROPY )
2321
+ #endif`,NT=`#if defined( USE_UV ) || defined( USE_ANISOTROPY )
2322
2322
  varying vec2 vUv;
2323
2323
  #endif
2324
2324
  #ifdef USE_MAP
@@ -2388,7 +2388,7 @@ vec3 CustomToneMapping( vec3 color ) { return color; }`,CT=`#ifdef USE_TRANSMISS
2388
2388
  #ifdef USE_THICKNESSMAP
2389
2389
  uniform mat3 thicknessMapTransform;
2390
2390
  varying vec2 vThicknessMapUv;
2391
- #endif`,UT=`#if defined( USE_UV ) || defined( USE_ANISOTROPY )
2391
+ #endif`,OT=`#if defined( USE_UV ) || defined( USE_ANISOTROPY )
2392
2392
  varying vec2 vUv;
2393
2393
  #endif
2394
2394
  #ifdef USE_MAP
@@ -2482,7 +2482,7 @@ vec3 CustomToneMapping( vec3 color ) { return color; }`,CT=`#ifdef USE_TRANSMISS
2482
2482
  #ifdef USE_THICKNESSMAP
2483
2483
  uniform mat3 thicknessMapTransform;
2484
2484
  varying vec2 vThicknessMapUv;
2485
- #endif`,LT=`#if defined( USE_UV ) || defined( USE_ANISOTROPY )
2485
+ #endif`,PT=`#if defined( USE_UV ) || defined( USE_ANISOTROPY )
2486
2486
  vUv = vec3( uv, 1 ).xy;
2487
2487
  #endif
2488
2488
  #ifdef USE_MAP
@@ -2553,7 +2553,7 @@ vec3 CustomToneMapping( vec3 color ) { return color; }`,CT=`#ifdef USE_TRANSMISS
2553
2553
  #endif
2554
2554
  #ifdef USE_THICKNESSMAP
2555
2555
  vThicknessMapUv = ( thicknessMapTransform * vec3( THICKNESSMAP_UV, 1 ) ).xy;
2556
- #endif`,NT=`#if defined( USE_ENVMAP ) || defined( DISTANCE ) || defined ( USE_SHADOWMAP ) || defined ( USE_TRANSMISSION ) || NUM_SPOT_LIGHT_COORDS > 0
2556
+ #endif`,zT=`#if defined( USE_ENVMAP ) || defined( DISTANCE ) || defined ( USE_SHADOWMAP ) || defined ( USE_TRANSMISSION ) || NUM_SPOT_LIGHT_COORDS > 0
2557
2557
  vec4 worldPosition = vec4( transformed, 1.0 );
2558
2558
  #ifdef USE_BATCHING
2559
2559
  worldPosition = batchingMatrix * worldPosition;
@@ -2562,12 +2562,12 @@ vec3 CustomToneMapping( vec3 color ) { return color; }`,CT=`#ifdef USE_TRANSMISS
2562
2562
  worldPosition = instanceMatrix * worldPosition;
2563
2563
  #endif
2564
2564
  worldPosition = modelMatrix * worldPosition;
2565
- #endif`;const OT=`varying vec2 vUv;
2565
+ #endif`;const IT=`varying vec2 vUv;
2566
2566
  uniform mat3 uvTransform;
2567
2567
  void main() {
2568
2568
  vUv = ( uvTransform * vec3( uv, 1 ) ).xy;
2569
2569
  gl_Position = vec4( position.xy, 1.0, 1.0 );
2570
- }`,PT=`uniform sampler2D t2D;
2570
+ }`,FT=`uniform sampler2D t2D;
2571
2571
  uniform float backgroundIntensity;
2572
2572
  varying vec2 vUv;
2573
2573
  void main() {
@@ -2579,14 +2579,14 @@ void main() {
2579
2579
  gl_FragColor = texColor;
2580
2580
  #include <tonemapping_fragment>
2581
2581
  #include <colorspace_fragment>
2582
- }`,zT=`varying vec3 vWorldDirection;
2582
+ }`,BT=`varying vec3 vWorldDirection;
2583
2583
  #include <common>
2584
2584
  void main() {
2585
2585
  vWorldDirection = transformDirection( position, modelMatrix );
2586
2586
  #include <begin_vertex>
2587
2587
  #include <project_vertex>
2588
2588
  gl_Position.z = gl_Position.w;
2589
- }`,IT=`#ifdef ENVMAP_TYPE_CUBE
2589
+ }`,HT=`#ifdef ENVMAP_TYPE_CUBE
2590
2590
  uniform samplerCube envMap;
2591
2591
  #elif defined( ENVMAP_TYPE_CUBE_UV )
2592
2592
  uniform sampler2D envMap;
@@ -2609,14 +2609,14 @@ void main() {
2609
2609
  gl_FragColor = texColor;
2610
2610
  #include <tonemapping_fragment>
2611
2611
  #include <colorspace_fragment>
2612
- }`,FT=`varying vec3 vWorldDirection;
2612
+ }`,GT=`varying vec3 vWorldDirection;
2613
2613
  #include <common>
2614
2614
  void main() {
2615
2615
  vWorldDirection = transformDirection( position, modelMatrix );
2616
2616
  #include <begin_vertex>
2617
2617
  #include <project_vertex>
2618
2618
  gl_Position.z = gl_Position.w;
2619
- }`,BT=`uniform samplerCube tCube;
2619
+ }`,VT=`uniform samplerCube tCube;
2620
2620
  uniform float tFlip;
2621
2621
  uniform float opacity;
2622
2622
  varying vec3 vWorldDirection;
@@ -2626,7 +2626,7 @@ void main() {
2626
2626
  gl_FragColor.a *= opacity;
2627
2627
  #include <tonemapping_fragment>
2628
2628
  #include <colorspace_fragment>
2629
- }`,HT=`#include <common>
2629
+ }`,kT=`#include <common>
2630
2630
  #include <batching_pars_vertex>
2631
2631
  #include <uv_pars_vertex>
2632
2632
  #include <displacementmap_pars_vertex>
@@ -2653,7 +2653,7 @@ void main() {
2653
2653
  #include <logdepthbuf_vertex>
2654
2654
  #include <clipping_planes_vertex>
2655
2655
  vHighPrecisionZW = gl_Position.zw;
2656
- }`,GT=`#if DEPTH_PACKING == 3200
2656
+ }`,XT=`#if DEPTH_PACKING == 3200
2657
2657
  uniform float opacity;
2658
2658
  #endif
2659
2659
  #include <common>
@@ -2691,7 +2691,7 @@ void main() {
2691
2691
  #elif DEPTH_PACKING == 3203
2692
2692
  gl_FragColor = vec4( packDepthToRG( fragCoordZ ), 0.0, 1.0 );
2693
2693
  #endif
2694
- }`,VT=`#define DISTANCE
2694
+ }`,WT=`#define DISTANCE
2695
2695
  varying vec3 vWorldPosition;
2696
2696
  #include <common>
2697
2697
  #include <batching_pars_vertex>
@@ -2718,7 +2718,7 @@ void main() {
2718
2718
  #include <worldpos_vertex>
2719
2719
  #include <clipping_planes_vertex>
2720
2720
  vWorldPosition = worldPosition.xyz;
2721
- }`,kT=`#define DISTANCE
2721
+ }`,qT=`#define DISTANCE
2722
2722
  uniform vec3 referencePosition;
2723
2723
  uniform float nearDistance;
2724
2724
  uniform float farDistance;
@@ -2741,13 +2741,13 @@ void main () {
2741
2741
  dist = ( dist - nearDistance ) / ( farDistance - nearDistance );
2742
2742
  dist = saturate( dist );
2743
2743
  gl_FragColor = vec4( dist, 0.0, 0.0, 1.0 );
2744
- }`,XT=`varying vec3 vWorldDirection;
2744
+ }`,YT=`varying vec3 vWorldDirection;
2745
2745
  #include <common>
2746
2746
  void main() {
2747
2747
  vWorldDirection = transformDirection( position, modelMatrix );
2748
2748
  #include <begin_vertex>
2749
2749
  #include <project_vertex>
2750
- }`,WT=`uniform sampler2D tEquirect;
2750
+ }`,jT=`uniform sampler2D tEquirect;
2751
2751
  varying vec3 vWorldDirection;
2752
2752
  #include <common>
2753
2753
  void main() {
@@ -2756,7 +2756,7 @@ void main() {
2756
2756
  gl_FragColor = texture2D( tEquirect, sampleUV );
2757
2757
  #include <tonemapping_fragment>
2758
2758
  #include <colorspace_fragment>
2759
- }`,qT=`uniform float scale;
2759
+ }`,ZT=`uniform float scale;
2760
2760
  attribute float lineDistance;
2761
2761
  varying float vLineDistance;
2762
2762
  #include <common>
@@ -2778,7 +2778,7 @@ void main() {
2778
2778
  #include <logdepthbuf_vertex>
2779
2779
  #include <clipping_planes_vertex>
2780
2780
  #include <fog_vertex>
2781
- }`,YT=`uniform vec3 diffuse;
2781
+ }`,KT=`uniform vec3 diffuse;
2782
2782
  uniform float opacity;
2783
2783
  uniform float dashSize;
2784
2784
  uniform float totalSize;
@@ -2806,7 +2806,7 @@ void main() {
2806
2806
  #include <colorspace_fragment>
2807
2807
  #include <fog_fragment>
2808
2808
  #include <premultiplied_alpha_fragment>
2809
- }`,jT=`#include <common>
2809
+ }`,QT=`#include <common>
2810
2810
  #include <batching_pars_vertex>
2811
2811
  #include <uv_pars_vertex>
2812
2812
  #include <envmap_pars_vertex>
@@ -2838,7 +2838,7 @@ void main() {
2838
2838
  #include <worldpos_vertex>
2839
2839
  #include <envmap_vertex>
2840
2840
  #include <fog_vertex>
2841
- }`,ZT=`uniform vec3 diffuse;
2841
+ }`,JT=`uniform vec3 diffuse;
2842
2842
  uniform float opacity;
2843
2843
  #ifndef FLAT_SHADED
2844
2844
  varying vec3 vNormal;
@@ -2886,7 +2886,7 @@ void main() {
2886
2886
  #include <fog_fragment>
2887
2887
  #include <premultiplied_alpha_fragment>
2888
2888
  #include <dithering_fragment>
2889
- }`,KT=`#define LAMBERT
2889
+ }`,$T=`#define LAMBERT
2890
2890
  varying vec3 vViewPosition;
2891
2891
  #include <common>
2892
2892
  #include <batching_pars_vertex>
@@ -2925,7 +2925,7 @@ void main() {
2925
2925
  #include <envmap_vertex>
2926
2926
  #include <shadowmap_vertex>
2927
2927
  #include <fog_vertex>
2928
- }`,QT=`#define LAMBERT
2928
+ }`,t1=`#define LAMBERT
2929
2929
  uniform vec3 diffuse;
2930
2930
  uniform vec3 emissive;
2931
2931
  uniform float opacity;
@@ -2983,7 +2983,7 @@ void main() {
2983
2983
  #include <fog_fragment>
2984
2984
  #include <premultiplied_alpha_fragment>
2985
2985
  #include <dithering_fragment>
2986
- }`,JT=`#define MATCAP
2986
+ }`,e1=`#define MATCAP
2987
2987
  varying vec3 vViewPosition;
2988
2988
  #include <common>
2989
2989
  #include <batching_pars_vertex>
@@ -3017,7 +3017,7 @@ void main() {
3017
3017
  #include <clipping_planes_vertex>
3018
3018
  #include <fog_vertex>
3019
3019
  vViewPosition = - mvPosition.xyz;
3020
- }`,$T=`#define MATCAP
3020
+ }`,n1=`#define MATCAP
3021
3021
  uniform vec3 diffuse;
3022
3022
  uniform float opacity;
3023
3023
  uniform sampler2D matcap;
@@ -3063,7 +3063,7 @@ void main() {
3063
3063
  #include <fog_fragment>
3064
3064
  #include <premultiplied_alpha_fragment>
3065
3065
  #include <dithering_fragment>
3066
- }`,t1=`#define NORMAL
3066
+ }`,i1=`#define NORMAL
3067
3067
  #if defined( FLAT_SHADED ) || defined( USE_BUMPMAP ) || defined( USE_NORMALMAP_TANGENTSPACE )
3068
3068
  varying vec3 vViewPosition;
3069
3069
  #endif
@@ -3096,7 +3096,7 @@ void main() {
3096
3096
  #if defined( FLAT_SHADED ) || defined( USE_BUMPMAP ) || defined( USE_NORMALMAP_TANGENTSPACE )
3097
3097
  vViewPosition = - mvPosition.xyz;
3098
3098
  #endif
3099
- }`,e1=`#define NORMAL
3099
+ }`,a1=`#define NORMAL
3100
3100
  uniform float opacity;
3101
3101
  #if defined( FLAT_SHADED ) || defined( USE_BUMPMAP ) || defined( USE_NORMALMAP_TANGENTSPACE )
3102
3102
  varying vec3 vViewPosition;
@@ -3117,7 +3117,7 @@ void main() {
3117
3117
  #ifdef OPAQUE
3118
3118
  gl_FragColor.a = 1.0;
3119
3119
  #endif
3120
- }`,n1=`#define PHONG
3120
+ }`,s1=`#define PHONG
3121
3121
  varying vec3 vViewPosition;
3122
3122
  #include <common>
3123
3123
  #include <batching_pars_vertex>
@@ -3156,7 +3156,7 @@ void main() {
3156
3156
  #include <envmap_vertex>
3157
3157
  #include <shadowmap_vertex>
3158
3158
  #include <fog_vertex>
3159
- }`,i1=`#define PHONG
3159
+ }`,r1=`#define PHONG
3160
3160
  uniform vec3 diffuse;
3161
3161
  uniform vec3 emissive;
3162
3162
  uniform vec3 specular;
@@ -3216,7 +3216,7 @@ void main() {
3216
3216
  #include <fog_fragment>
3217
3217
  #include <premultiplied_alpha_fragment>
3218
3218
  #include <dithering_fragment>
3219
- }`,a1=`#define STANDARD
3219
+ }`,o1=`#define STANDARD
3220
3220
  varying vec3 vViewPosition;
3221
3221
  #ifdef USE_TRANSMISSION
3222
3222
  varying vec3 vWorldPosition;
@@ -3259,7 +3259,7 @@ void main() {
3259
3259
  #ifdef USE_TRANSMISSION
3260
3260
  vWorldPosition = worldPosition.xyz;
3261
3261
  #endif
3262
- }`,s1=`#define STANDARD
3262
+ }`,l1=`#define STANDARD
3263
3263
  #ifdef PHYSICAL
3264
3264
  #define IOR
3265
3265
  #define USE_SPECULAR
@@ -3384,7 +3384,7 @@ void main() {
3384
3384
  #include <fog_fragment>
3385
3385
  #include <premultiplied_alpha_fragment>
3386
3386
  #include <dithering_fragment>
3387
- }`,r1=`#define TOON
3387
+ }`,c1=`#define TOON
3388
3388
  varying vec3 vViewPosition;
3389
3389
  #include <common>
3390
3390
  #include <batching_pars_vertex>
@@ -3421,7 +3421,7 @@ void main() {
3421
3421
  #include <worldpos_vertex>
3422
3422
  #include <shadowmap_vertex>
3423
3423
  #include <fog_vertex>
3424
- }`,o1=`#define TOON
3424
+ }`,u1=`#define TOON
3425
3425
  uniform vec3 diffuse;
3426
3426
  uniform vec3 emissive;
3427
3427
  uniform float opacity;
@@ -3473,7 +3473,7 @@ void main() {
3473
3473
  #include <fog_fragment>
3474
3474
  #include <premultiplied_alpha_fragment>
3475
3475
  #include <dithering_fragment>
3476
- }`,l1=`uniform float size;
3476
+ }`,f1=`uniform float size;
3477
3477
  uniform float scale;
3478
3478
  #include <common>
3479
3479
  #include <color_pars_vertex>
@@ -3504,7 +3504,7 @@ void main() {
3504
3504
  #include <clipping_planes_vertex>
3505
3505
  #include <worldpos_vertex>
3506
3506
  #include <fog_vertex>
3507
- }`,c1=`uniform vec3 diffuse;
3507
+ }`,h1=`uniform vec3 diffuse;
3508
3508
  uniform float opacity;
3509
3509
  #include <common>
3510
3510
  #include <color_pars_fragment>
@@ -3529,7 +3529,7 @@ void main() {
3529
3529
  #include <colorspace_fragment>
3530
3530
  #include <fog_fragment>
3531
3531
  #include <premultiplied_alpha_fragment>
3532
- }`,u1=`#include <common>
3532
+ }`,d1=`#include <common>
3533
3533
  #include <batching_pars_vertex>
3534
3534
  #include <fog_pars_vertex>
3535
3535
  #include <morphtarget_pars_vertex>
@@ -3552,7 +3552,7 @@ void main() {
3552
3552
  #include <worldpos_vertex>
3553
3553
  #include <shadowmap_vertex>
3554
3554
  #include <fog_vertex>
3555
- }`,f1=`uniform vec3 color;
3555
+ }`,p1=`uniform vec3 color;
3556
3556
  uniform float opacity;
3557
3557
  #include <common>
3558
3558
  #include <fog_pars_fragment>
@@ -3568,7 +3568,7 @@ void main() {
3568
3568
  #include <colorspace_fragment>
3569
3569
  #include <fog_fragment>
3570
3570
  #include <premultiplied_alpha_fragment>
3571
- }`,h1=`uniform float rotation;
3571
+ }`,m1=`uniform float rotation;
3572
3572
  uniform vec2 center;
3573
3573
  #include <common>
3574
3574
  #include <uv_pars_vertex>
@@ -3592,7 +3592,7 @@ void main() {
3592
3592
  #include <logdepthbuf_vertex>
3593
3593
  #include <clipping_planes_vertex>
3594
3594
  #include <fog_vertex>
3595
- }`,d1=`uniform vec3 diffuse;
3595
+ }`,g1=`uniform vec3 diffuse;
3596
3596
  uniform float opacity;
3597
3597
  #include <common>
3598
3598
  #include <uv_pars_fragment>
@@ -3617,7 +3617,7 @@ void main() {
3617
3617
  #include <tonemapping_fragment>
3618
3618
  #include <colorspace_fragment>
3619
3619
  #include <fog_fragment>
3620
- }`,me={alphahash_fragment:PE,alphahash_pars_fragment:zE,alphamap_fragment:IE,alphamap_pars_fragment:FE,alphatest_fragment:BE,alphatest_pars_fragment:HE,aomap_fragment:GE,aomap_pars_fragment:VE,batching_pars_vertex:kE,batching_vertex:XE,begin_vertex:WE,beginnormal_vertex:qE,bsdfs:YE,iridescence_fragment:jE,bumpmap_pars_fragment:ZE,clipping_planes_fragment:KE,clipping_planes_pars_fragment:QE,clipping_planes_pars_vertex:JE,clipping_planes_vertex:$E,color_fragment:tb,color_pars_fragment:eb,color_pars_vertex:nb,color_vertex:ib,common:ab,cube_uv_reflection_fragment:sb,defaultnormal_vertex:rb,displacementmap_pars_vertex:ob,displacementmap_vertex:lb,emissivemap_fragment:cb,emissivemap_pars_fragment:ub,colorspace_fragment:fb,colorspace_pars_fragment:hb,envmap_fragment:db,envmap_common_pars_fragment:pb,envmap_pars_fragment:mb,envmap_pars_vertex:gb,envmap_physical_pars_fragment:Rb,envmap_vertex:_b,fog_vertex:vb,fog_pars_vertex:xb,fog_fragment:Sb,fog_pars_fragment:yb,gradientmap_pars_fragment:Mb,lightmap_pars_fragment:Eb,lights_lambert_fragment:bb,lights_lambert_pars_fragment:Tb,lights_pars_begin:Ab,lights_toon_fragment:Cb,lights_toon_pars_fragment:wb,lights_phong_fragment:Db,lights_phong_pars_fragment:Ub,lights_physical_fragment:Lb,lights_physical_pars_fragment:Nb,lights_fragment_begin:Ob,lights_fragment_maps:Pb,lights_fragment_end:zb,logdepthbuf_fragment:Ib,logdepthbuf_pars_fragment:Fb,logdepthbuf_pars_vertex:Bb,logdepthbuf_vertex:Hb,map_fragment:Gb,map_pars_fragment:Vb,map_particle_fragment:kb,map_particle_pars_fragment:Xb,metalnessmap_fragment:Wb,metalnessmap_pars_fragment:qb,morphinstance_vertex:Yb,morphcolor_vertex:jb,morphnormal_vertex:Zb,morphtarget_pars_vertex:Kb,morphtarget_vertex:Qb,normal_fragment_begin:Jb,normal_fragment_maps:$b,normal_pars_fragment:tT,normal_pars_vertex:eT,normal_vertex:nT,normalmap_pars_fragment:iT,clearcoat_normal_fragment_begin:aT,clearcoat_normal_fragment_maps:sT,clearcoat_pars_fragment:rT,iridescence_pars_fragment:oT,opaque_fragment:lT,packing:cT,premultiplied_alpha_fragment:uT,project_vertex:fT,dithering_fragment:hT,dithering_pars_fragment:dT,roughnessmap_fragment:pT,roughnessmap_pars_fragment:mT,shadowmap_pars_fragment:gT,shadowmap_pars_vertex:_T,shadowmap_vertex:vT,shadowmask_pars_fragment:xT,skinbase_vertex:ST,skinning_pars_vertex:yT,skinning_vertex:MT,skinnormal_vertex:ET,specularmap_fragment:bT,specularmap_pars_fragment:TT,tonemapping_fragment:AT,tonemapping_pars_fragment:RT,transmission_fragment:CT,transmission_pars_fragment:wT,uv_pars_fragment:DT,uv_pars_vertex:UT,uv_vertex:LT,worldpos_vertex:NT,background_vert:OT,background_frag:PT,backgroundCube_vert:zT,backgroundCube_frag:IT,cube_vert:FT,cube_frag:BT,depth_vert:HT,depth_frag:GT,distance_vert:VT,distance_frag:kT,equirect_vert:XT,equirect_frag:WT,linedashed_vert:qT,linedashed_frag:YT,meshbasic_vert:jT,meshbasic_frag:ZT,meshlambert_vert:KT,meshlambert_frag:QT,meshmatcap_vert:JT,meshmatcap_frag:$T,meshnormal_vert:t1,meshnormal_frag:e1,meshphong_vert:n1,meshphong_frag:i1,meshphysical_vert:a1,meshphysical_frag:s1,meshtoon_vert:r1,meshtoon_frag:o1,points_vert:l1,points_frag:c1,shadow_vert:u1,shadow_frag:f1,sprite_vert:h1,sprite_frag:d1},Lt={common:{diffuse:{value:new Se(16777215)},opacity:{value:1},map:{value:null},mapTransform:{value:new pe},alphaMap:{value:null},alphaMapTransform:{value:new pe},alphaTest:{value:0}},specularmap:{specularMap:{value:null},specularMapTransform:{value:new pe}},envmap:{envMap:{value:null},envMapRotation:{value:new pe},flipEnvMap:{value:-1},reflectivity:{value:1},ior:{value:1.5},refractionRatio:{value:.98},dfgLUT:{value:null}},aomap:{aoMap:{value:null},aoMapIntensity:{value:1},aoMapTransform:{value:new pe}},lightmap:{lightMap:{value:null},lightMapIntensity:{value:1},lightMapTransform:{value:new pe}},bumpmap:{bumpMap:{value:null},bumpMapTransform:{value:new pe},bumpScale:{value:1}},normalmap:{normalMap:{value:null},normalMapTransform:{value:new pe},normalScale:{value:new le(1,1)}},displacementmap:{displacementMap:{value:null},displacementMapTransform:{value:new pe},displacementScale:{value:1},displacementBias:{value:0}},emissivemap:{emissiveMap:{value:null},emissiveMapTransform:{value:new pe}},metalnessmap:{metalnessMap:{value:null},metalnessMapTransform:{value:new pe}},roughnessmap:{roughnessMap:{value:null},roughnessMapTransform:{value:new pe}},gradientmap:{gradientMap:{value:null}},fog:{fogDensity:{value:25e-5},fogNear:{value:1},fogFar:{value:2e3},fogColor:{value:new Se(16777215)}},lights:{ambientLightColor:{value:[]},lightProbe:{value:[]},directionalLights:{value:[],properties:{direction:{},color:{}}},directionalLightShadows:{value:[],properties:{shadowIntensity:1,shadowBias:{},shadowNormalBias:{},shadowRadius:{},shadowMapSize:{}}},directionalShadowMatrix:{value:[]},spotLights:{value:[],properties:{color:{},position:{},direction:{},distance:{},coneCos:{},penumbraCos:{},decay:{}}},spotLightShadows:{value:[],properties:{shadowIntensity:1,shadowBias:{},shadowNormalBias:{},shadowRadius:{},shadowMapSize:{}}},spotLightMap:{value:[]},spotLightMatrix:{value:[]},pointLights:{value:[],properties:{color:{},position:{},decay:{},distance:{}}},pointLightShadows:{value:[],properties:{shadowIntensity:1,shadowBias:{},shadowNormalBias:{},shadowRadius:{},shadowMapSize:{},shadowCameraNear:{},shadowCameraFar:{}}},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 Se(16777215)},opacity:{value:1},size:{value:1},scale:{value:1},map:{value:null},alphaMap:{value:null},alphaMapTransform:{value:new pe},alphaTest:{value:0},uvTransform:{value:new pe}},sprite:{diffuse:{value:new Se(16777215)},opacity:{value:1},center:{value:new le(.5,.5)},rotation:{value:0},map:{value:null},mapTransform:{value:new pe},alphaMap:{value:null},alphaMapTransform:{value:new pe},alphaTest:{value:0}}},ni={basic:{uniforms:qn([Lt.common,Lt.specularmap,Lt.envmap,Lt.aomap,Lt.lightmap,Lt.fog]),vertexShader:me.meshbasic_vert,fragmentShader:me.meshbasic_frag},lambert:{uniforms:qn([Lt.common,Lt.specularmap,Lt.envmap,Lt.aomap,Lt.lightmap,Lt.emissivemap,Lt.bumpmap,Lt.normalmap,Lt.displacementmap,Lt.fog,Lt.lights,{emissive:{value:new Se(0)},envMapIntensity:{value:1}}]),vertexShader:me.meshlambert_vert,fragmentShader:me.meshlambert_frag},phong:{uniforms:qn([Lt.common,Lt.specularmap,Lt.envmap,Lt.aomap,Lt.lightmap,Lt.emissivemap,Lt.bumpmap,Lt.normalmap,Lt.displacementmap,Lt.fog,Lt.lights,{emissive:{value:new Se(0)},specular:{value:new Se(1118481)},shininess:{value:30},envMapIntensity:{value:1}}]),vertexShader:me.meshphong_vert,fragmentShader:me.meshphong_frag},standard:{uniforms:qn([Lt.common,Lt.envmap,Lt.aomap,Lt.lightmap,Lt.emissivemap,Lt.bumpmap,Lt.normalmap,Lt.displacementmap,Lt.roughnessmap,Lt.metalnessmap,Lt.fog,Lt.lights,{emissive:{value:new Se(0)},roughness:{value:1},metalness:{value:0},envMapIntensity:{value:1}}]),vertexShader:me.meshphysical_vert,fragmentShader:me.meshphysical_frag},toon:{uniforms:qn([Lt.common,Lt.aomap,Lt.lightmap,Lt.emissivemap,Lt.bumpmap,Lt.normalmap,Lt.displacementmap,Lt.gradientmap,Lt.fog,Lt.lights,{emissive:{value:new Se(0)}}]),vertexShader:me.meshtoon_vert,fragmentShader:me.meshtoon_frag},matcap:{uniforms:qn([Lt.common,Lt.bumpmap,Lt.normalmap,Lt.displacementmap,Lt.fog,{matcap:{value:null}}]),vertexShader:me.meshmatcap_vert,fragmentShader:me.meshmatcap_frag},points:{uniforms:qn([Lt.points,Lt.fog]),vertexShader:me.points_vert,fragmentShader:me.points_frag},dashed:{uniforms:qn([Lt.common,Lt.fog,{scale:{value:1},dashSize:{value:1},totalSize:{value:2}}]),vertexShader:me.linedashed_vert,fragmentShader:me.linedashed_frag},depth:{uniforms:qn([Lt.common,Lt.displacementmap]),vertexShader:me.depth_vert,fragmentShader:me.depth_frag},normal:{uniforms:qn([Lt.common,Lt.bumpmap,Lt.normalmap,Lt.displacementmap,{opacity:{value:1}}]),vertexShader:me.meshnormal_vert,fragmentShader:me.meshnormal_frag},sprite:{uniforms:qn([Lt.sprite,Lt.fog]),vertexShader:me.sprite_vert,fragmentShader:me.sprite_frag},background:{uniforms:{uvTransform:{value:new pe},t2D:{value:null},backgroundIntensity:{value:1}},vertexShader:me.background_vert,fragmentShader:me.background_frag},backgroundCube:{uniforms:{envMap:{value:null},flipEnvMap:{value:-1},backgroundBlurriness:{value:0},backgroundIntensity:{value:1},backgroundRotation:{value:new pe}},vertexShader:me.backgroundCube_vert,fragmentShader:me.backgroundCube_frag},cube:{uniforms:{tCube:{value:null},tFlip:{value:-1},opacity:{value:1}},vertexShader:me.cube_vert,fragmentShader:me.cube_frag},equirect:{uniforms:{tEquirect:{value:null}},vertexShader:me.equirect_vert,fragmentShader:me.equirect_frag},distance:{uniforms:qn([Lt.common,Lt.displacementmap,{referencePosition:{value:new j},nearDistance:{value:1},farDistance:{value:1e3}}]),vertexShader:me.distance_vert,fragmentShader:me.distance_frag},shadow:{uniforms:qn([Lt.lights,Lt.fog,{color:{value:new Se(0)},opacity:{value:1}}]),vertexShader:me.shadow_vert,fragmentShader:me.shadow_frag}};ni.physical={uniforms:qn([ni.standard.uniforms,{clearcoat:{value:0},clearcoatMap:{value:null},clearcoatMapTransform:{value:new pe},clearcoatNormalMap:{value:null},clearcoatNormalMapTransform:{value:new pe},clearcoatNormalScale:{value:new le(1,1)},clearcoatRoughness:{value:0},clearcoatRoughnessMap:{value:null},clearcoatRoughnessMapTransform:{value:new pe},dispersion:{value:0},iridescence:{value:0},iridescenceMap:{value:null},iridescenceMapTransform:{value:new pe},iridescenceIOR:{value:1.3},iridescenceThicknessMinimum:{value:100},iridescenceThicknessMaximum:{value:400},iridescenceThicknessMap:{value:null},iridescenceThicknessMapTransform:{value:new pe},sheen:{value:0},sheenColor:{value:new Se(0)},sheenColorMap:{value:null},sheenColorMapTransform:{value:new pe},sheenRoughness:{value:1},sheenRoughnessMap:{value:null},sheenRoughnessMapTransform:{value:new pe},transmission:{value:0},transmissionMap:{value:null},transmissionMapTransform:{value:new pe},transmissionSamplerSize:{value:new le},transmissionSamplerMap:{value:null},thickness:{value:0},thicknessMap:{value:null},thicknessMapTransform:{value:new pe},attenuationDistance:{value:0},attenuationColor:{value:new Se(0)},specularColor:{value:new Se(1,1,1)},specularColorMap:{value:null},specularColorMapTransform:{value:new pe},specularIntensity:{value:1},specularIntensityMap:{value:null},specularIntensityMapTransform:{value:new pe},anisotropyVector:{value:new le},anisotropyMap:{value:null},anisotropyMapTransform:{value:new pe}}]),vertexShader:me.meshphysical_vert,fragmentShader:me.meshphysical_frag};const nu={r:0,b:0,g:0},Xs=new ra,p1=new Je;function m1(r,t,i,s,l,c){const h=new Se(0);let d=l===!0?0:1,m,p,v=null,g=0,_=null;function M(w){let D=w.isScene===!0?w.background:null;if(D&&D.isTexture){const U=w.backgroundBlurriness>0;D=t.get(D,U)}return D}function E(w){let D=!1;const U=M(w);U===null?x(h,d):U&&U.isColor&&(x(U,1),D=!0);const H=r.xr.getEnvironmentBlendMode();H==="additive"?i.buffers.color.setClear(0,0,0,1,c):H==="alpha-blend"&&i.buffers.color.setClear(0,0,0,0,c),(r.autoClear||D)&&(i.buffers.depth.setTest(!0),i.buffers.depth.setMask(!0),i.buffers.color.setMask(!0),r.clear(r.autoClearColor,r.autoClearDepth,r.autoClearStencil))}function A(w,D){const U=M(D);U&&(U.isCubeTexture||U.mapping===Eu)?(p===void 0&&(p=new _i(new vl(1,1,1),new Xi({name:"BackgroundCubeMaterial",uniforms:so(ni.backgroundCube.uniforms),vertexShader:ni.backgroundCube.vertexShader,fragmentShader:ni.backgroundCube.fragmentShader,side:ii,depthTest:!1,depthWrite:!1,fog:!1,allowOverride:!1})),p.geometry.deleteAttribute("normal"),p.geometry.deleteAttribute("uv"),p.onBeforeRender=function(H,F,I){this.matrixWorld.copyPosition(I.matrixWorld)},Object.defineProperty(p.material,"envMap",{get:function(){return this.uniforms.envMap.value}}),s.update(p)),Xs.copy(D.backgroundRotation),Xs.x*=-1,Xs.y*=-1,Xs.z*=-1,U.isCubeTexture&&U.isRenderTargetTexture===!1&&(Xs.y*=-1,Xs.z*=-1),p.material.uniforms.envMap.value=U,p.material.uniforms.flipEnvMap.value=U.isCubeTexture&&U.isRenderTargetTexture===!1?-1:1,p.material.uniforms.backgroundBlurriness.value=D.backgroundBlurriness,p.material.uniforms.backgroundIntensity.value=D.backgroundIntensity,p.material.uniforms.backgroundRotation.value.setFromMatrix4(p1.makeRotationFromEuler(Xs)),p.material.toneMapped=Re.getTransfer(U.colorSpace)!==Fe,(v!==U||g!==U.version||_!==r.toneMapping)&&(p.material.needsUpdate=!0,v=U,g=U.version,_=r.toneMapping),p.layers.enableAll(),w.unshift(p,p.geometry,p.material,0,0,null)):U&&U.isTexture&&(m===void 0&&(m=new _i(new bu(2,2),new Xi({name:"BackgroundMaterial",uniforms:so(ni.background.uniforms),vertexShader:ni.background.vertexShader,fragmentShader:ni.background.fragmentShader,side:xs,depthTest:!1,depthWrite:!1,fog:!1,allowOverride:!1})),m.geometry.deleteAttribute("normal"),Object.defineProperty(m.material,"map",{get:function(){return this.uniforms.t2D.value}}),s.update(m)),m.material.uniforms.t2D.value=U,m.material.uniforms.backgroundIntensity.value=D.backgroundIntensity,m.material.toneMapped=Re.getTransfer(U.colorSpace)!==Fe,U.matrixAutoUpdate===!0&&U.updateMatrix(),m.material.uniforms.uvTransform.value.copy(U.matrix),(v!==U||g!==U.version||_!==r.toneMapping)&&(m.material.needsUpdate=!0,v=U,g=U.version,_=r.toneMapping),m.layers.enableAll(),w.unshift(m,m.geometry,m.material,0,0,null))}function x(w,D){w.getRGB(nu,px(r)),i.buffers.color.setClear(nu.r,nu.g,nu.b,D,c)}function y(){p!==void 0&&(p.geometry.dispose(),p.material.dispose(),p=void 0),m!==void 0&&(m.geometry.dispose(),m.material.dispose(),m=void 0)}return{getClearColor:function(){return h},setClearColor:function(w,D=1){h.set(w),d=D,x(h,d)},getClearAlpha:function(){return d},setClearAlpha:function(w){d=w,x(h,d)},render:E,addToRenderList:A,dispose:y}}function g1(r,t){const i=r.getParameter(r.MAX_VERTEX_ATTRIBS),s={},l=_(null);let c=l,h=!1;function d(P,W,J,rt,et){let O=!1;const B=g(P,rt,J,W);c!==B&&(c=B,p(c.object)),O=M(P,rt,J,et),O&&E(P,rt,J,et),et!==null&&t.update(et,r.ELEMENT_ARRAY_BUFFER),(O||h)&&(h=!1,U(P,W,J,rt),et!==null&&r.bindBuffer(r.ELEMENT_ARRAY_BUFFER,t.get(et).buffer))}function m(){return r.createVertexArray()}function p(P){return r.bindVertexArray(P)}function v(P){return r.deleteVertexArray(P)}function g(P,W,J,rt){const et=rt.wireframe===!0;let O=s[W.id];O===void 0&&(O={},s[W.id]=O);const B=P.isInstancedMesh===!0?P.id:0;let at=O[B];at===void 0&&(at={},O[B]=at);let $=at[J.id];$===void 0&&($={},at[J.id]=$);let lt=$[et];return lt===void 0&&(lt=_(m()),$[et]=lt),lt}function _(P){const W=[],J=[],rt=[];for(let et=0;et<i;et++)W[et]=0,J[et]=0,rt[et]=0;return{geometry:null,program:null,wireframe:!1,newAttributes:W,enabledAttributes:J,attributeDivisors:rt,object:P,attributes:{},index:null}}function M(P,W,J,rt){const et=c.attributes,O=W.attributes;let B=0;const at=J.getAttributes();for(const $ in at)if(at[$].location>=0){const N=et[$];let k=O[$];if(k===void 0&&($==="instanceMatrix"&&P.instanceMatrix&&(k=P.instanceMatrix),$==="instanceColor"&&P.instanceColor&&(k=P.instanceColor)),N===void 0||N.attribute!==k||k&&N.data!==k.data)return!0;B++}return c.attributesNum!==B||c.index!==rt}function E(P,W,J,rt){const et={},O=W.attributes;let B=0;const at=J.getAttributes();for(const $ in at)if(at[$].location>=0){let N=O[$];N===void 0&&($==="instanceMatrix"&&P.instanceMatrix&&(N=P.instanceMatrix),$==="instanceColor"&&P.instanceColor&&(N=P.instanceColor));const k={};k.attribute=N,N&&N.data&&(k.data=N.data),et[$]=k,B++}c.attributes=et,c.attributesNum=B,c.index=rt}function A(){const P=c.newAttributes;for(let W=0,J=P.length;W<J;W++)P[W]=0}function x(P){y(P,0)}function y(P,W){const J=c.newAttributes,rt=c.enabledAttributes,et=c.attributeDivisors;J[P]=1,rt[P]===0&&(r.enableVertexAttribArray(P),rt[P]=1),et[P]!==W&&(r.vertexAttribDivisor(P,W),et[P]=W)}function w(){const P=c.newAttributes,W=c.enabledAttributes;for(let J=0,rt=W.length;J<rt;J++)W[J]!==P[J]&&(r.disableVertexAttribArray(J),W[J]=0)}function D(P,W,J,rt,et,O,B){B===!0?r.vertexAttribIPointer(P,W,J,et,O):r.vertexAttribPointer(P,W,J,rt,et,O)}function U(P,W,J,rt){A();const et=rt.attributes,O=J.getAttributes(),B=W.defaultAttributeValues;for(const at in O){const $=O[at];if($.location>=0){let lt=et[at];if(lt===void 0&&(at==="instanceMatrix"&&P.instanceMatrix&&(lt=P.instanceMatrix),at==="instanceColor"&&P.instanceColor&&(lt=P.instanceColor)),lt!==void 0){const N=lt.normalized,k=lt.itemSize,ut=t.get(lt);if(ut===void 0)continue;const vt=ut.buffer,Rt=ut.type,Z=ut.bytesPerElement,dt=Rt===r.INT||Rt===r.UNSIGNED_INT||lt.gpuType===yp;if(lt.isInterleavedBufferAttribute){const yt=lt.data,Ut=yt.stride,Ft=lt.offset;if(yt.isInstancedInterleavedBuffer){for(let Xt=0;Xt<$.locationSize;Xt++)y($.location+Xt,yt.meshPerAttribute);P.isInstancedMesh!==!0&&rt._maxInstanceCount===void 0&&(rt._maxInstanceCount=yt.meshPerAttribute*yt.count)}else for(let Xt=0;Xt<$.locationSize;Xt++)x($.location+Xt);r.bindBuffer(r.ARRAY_BUFFER,vt);for(let Xt=0;Xt<$.locationSize;Xt++)D($.location+Xt,k/$.locationSize,Rt,N,Ut*Z,(Ft+k/$.locationSize*Xt)*Z,dt)}else{if(lt.isInstancedBufferAttribute){for(let yt=0;yt<$.locationSize;yt++)y($.location+yt,lt.meshPerAttribute);P.isInstancedMesh!==!0&&rt._maxInstanceCount===void 0&&(rt._maxInstanceCount=lt.meshPerAttribute*lt.count)}else for(let yt=0;yt<$.locationSize;yt++)x($.location+yt);r.bindBuffer(r.ARRAY_BUFFER,vt);for(let yt=0;yt<$.locationSize;yt++)D($.location+yt,k/$.locationSize,Rt,N,k*Z,k/$.locationSize*yt*Z,dt)}}else if(B!==void 0){const N=B[at];if(N!==void 0)switch(N.length){case 2:r.vertexAttrib2fv($.location,N);break;case 3:r.vertexAttrib3fv($.location,N);break;case 4:r.vertexAttrib4fv($.location,N);break;default:r.vertexAttrib1fv($.location,N)}}}}w()}function H(){L();for(const P in s){const W=s[P];for(const J in W){const rt=W[J];for(const et in rt){const O=rt[et];for(const B in O)v(O[B].object),delete O[B];delete rt[et]}}delete s[P]}}function F(P){if(s[P.id]===void 0)return;const W=s[P.id];for(const J in W){const rt=W[J];for(const et in rt){const O=rt[et];for(const B in O)v(O[B].object),delete O[B];delete rt[et]}}delete s[P.id]}function I(P){for(const W in s){const J=s[W];for(const rt in J){const et=J[rt];if(et[P.id]===void 0)continue;const O=et[P.id];for(const B in O)v(O[B].object),delete O[B];delete et[P.id]}}}function T(P){for(const W in s){const J=s[W],rt=P.isInstancedMesh===!0?P.id:0,et=J[rt];if(et!==void 0){for(const O in et){const B=et[O];for(const at in B)v(B[at].object),delete B[at];delete et[O]}delete J[rt],Object.keys(J).length===0&&delete s[W]}}}function L(){Q(),h=!0,c!==l&&(c=l,p(c.object))}function Q(){l.geometry=null,l.program=null,l.wireframe=!1}return{setup:d,reset:L,resetDefaultState:Q,dispose:H,releaseStatesOfGeometry:F,releaseStatesOfObject:T,releaseStatesOfProgram:I,initAttributes:A,enableAttribute:x,disableUnusedAttributes:w}}function _1(r,t,i){let s;function l(p){s=p}function c(p,v){r.drawArrays(s,p,v),i.update(v,s,1)}function h(p,v,g){g!==0&&(r.drawArraysInstanced(s,p,v,g),i.update(v,s,g))}function d(p,v,g){if(g===0)return;t.get("WEBGL_multi_draw").multiDrawArraysWEBGL(s,p,0,v,0,g);let M=0;for(let E=0;E<g;E++)M+=v[E];i.update(M,s,1)}function m(p,v,g,_){if(g===0)return;const M=t.get("WEBGL_multi_draw");if(M===null)for(let E=0;E<p.length;E++)h(p[E],v[E],_[E]);else{M.multiDrawArraysInstancedWEBGL(s,p,0,v,0,_,0,g);let E=0;for(let A=0;A<g;A++)E+=v[A]*_[A];i.update(E,s,1)}}this.setMode=l,this.render=c,this.renderInstances=h,this.renderMultiDraw=d,this.renderMultiDrawInstances=m}function v1(r,t,i,s){let l;function c(){if(l!==void 0)return l;if(t.has("EXT_texture_filter_anisotropic")===!0){const I=t.get("EXT_texture_filter_anisotropic");l=r.getParameter(I.MAX_TEXTURE_MAX_ANISOTROPY_EXT)}else l=0;return l}function h(I){return!(I!==ki&&s.convert(I)!==r.getParameter(r.IMPLEMENTATION_COLOR_READ_FORMAT))}function d(I){const T=I===Pa&&(t.has("EXT_color_buffer_half_float")||t.has("EXT_color_buffer_float"));return!(I!==mi&&s.convert(I)!==r.getParameter(r.IMPLEMENTATION_COLOR_READ_TYPE)&&I!==ea&&!T)}function m(I){if(I==="highp"){if(r.getShaderPrecisionFormat(r.VERTEX_SHADER,r.HIGH_FLOAT).precision>0&&r.getShaderPrecisionFormat(r.FRAGMENT_SHADER,r.HIGH_FLOAT).precision>0)return"highp";I="mediump"}return I==="mediump"&&r.getShaderPrecisionFormat(r.VERTEX_SHADER,r.MEDIUM_FLOAT).precision>0&&r.getShaderPrecisionFormat(r.FRAGMENT_SHADER,r.MEDIUM_FLOAT).precision>0?"mediump":"lowp"}let p=i.precision!==void 0?i.precision:"highp";const v=m(p);v!==p&&(ee("WebGLRenderer:",p,"not supported, using",v,"instead."),p=v);const g=i.logarithmicDepthBuffer===!0,_=i.reversedDepthBuffer===!0&&t.has("EXT_clip_control"),M=r.getParameter(r.MAX_TEXTURE_IMAGE_UNITS),E=r.getParameter(r.MAX_VERTEX_TEXTURE_IMAGE_UNITS),A=r.getParameter(r.MAX_TEXTURE_SIZE),x=r.getParameter(r.MAX_CUBE_MAP_TEXTURE_SIZE),y=r.getParameter(r.MAX_VERTEX_ATTRIBS),w=r.getParameter(r.MAX_VERTEX_UNIFORM_VECTORS),D=r.getParameter(r.MAX_VARYING_VECTORS),U=r.getParameter(r.MAX_FRAGMENT_UNIFORM_VECTORS),H=r.getParameter(r.MAX_SAMPLES),F=r.getParameter(r.SAMPLES);return{isWebGL2:!0,getMaxAnisotropy:c,getMaxPrecision:m,textureFormatReadable:h,textureTypeReadable:d,precision:p,logarithmicDepthBuffer:g,reversedDepthBuffer:_,maxTextures:M,maxVertexTextures:E,maxTextureSize:A,maxCubemapSize:x,maxAttributes:y,maxVertexUniforms:w,maxVaryings:D,maxFragmentUniforms:U,maxSamples:H,samples:F}}function x1(r){const t=this;let i=null,s=0,l=!1,c=!1;const h=new ms,d=new pe,m={value:null,needsUpdate:!1};this.uniform=m,this.numPlanes=0,this.numIntersection=0,this.init=function(g,_){const M=g.length!==0||_||s!==0||l;return l=_,s=g.length,M},this.beginShadows=function(){c=!0,v(null)},this.endShadows=function(){c=!1},this.setGlobalState=function(g,_){i=v(g,_,0)},this.setState=function(g,_,M){const E=g.clippingPlanes,A=g.clipIntersection,x=g.clipShadows,y=r.get(g);if(!l||E===null||E.length===0||c&&!x)c?v(null):p();else{const w=c?0:s,D=w*4;let U=y.clippingState||null;m.value=U,U=v(E,_,D,M);for(let H=0;H!==D;++H)U[H]=i[H];y.clippingState=U,this.numIntersection=A?this.numPlanes:0,this.numPlanes+=w}};function p(){m.value!==i&&(m.value=i,m.needsUpdate=s>0),t.numPlanes=s,t.numIntersection=0}function v(g,_,M,E){const A=g!==null?g.length:0;let x=null;if(A!==0){if(x=m.value,E!==!0||x===null){const y=M+A*4,w=_.matrixWorldInverse;d.getNormalMatrix(w),(x===null||x.length<y)&&(x=new Float32Array(y));for(let D=0,U=M;D!==A;++D,U+=4)h.copy(g[D]).applyMatrix4(w,d),h.normal.toArray(x,U),x[U+3]=h.constant}m.value=x,m.needsUpdate=!0}return t.numPlanes=A,t.numIntersection=0,x}}const vs=4,lv=[.125,.215,.35,.446,.526,.582],Ys=20,S1=256,rl=new Tu,cv=new Se;let hd=null,dd=0,pd=0,md=!1;const y1=new j;class uv{constructor(t){this._renderer=t,this._pingPongRenderTarget=null,this._lodMax=0,this._cubeSize=0,this._sizeLods=[],this._sigmas=[],this._lodMeshes=[],this._backgroundBox=null,this._cubemapMaterial=null,this._equirectMaterial=null,this._blurMaterial=null,this._ggxMaterial=null}fromScene(t,i=0,s=.1,l=100,c={}){const{size:h=256,position:d=y1}=c;hd=this._renderer.getRenderTarget(),dd=this._renderer.getActiveCubeFace(),pd=this._renderer.getActiveMipmapLevel(),md=this._renderer.xr.enabled,this._renderer.xr.enabled=!1,this._setSize(h);const m=this._allocateTargets();return m.depthBuffer=!0,this._sceneToCubeUV(t,s,l,m,d),i>0&&this._blur(m,0,0,i),this._applyPMREM(m),this._cleanup(m),m}fromEquirectangular(t,i=null){return this._fromTexture(t,i)}fromCubemap(t,i=null){return this._fromTexture(t,i)}compileCubemapShader(){this._cubemapMaterial===null&&(this._cubemapMaterial=dv(),this._compileMaterial(this._cubemapMaterial))}compileEquirectangularShader(){this._equirectMaterial===null&&(this._equirectMaterial=hv(),this._compileMaterial(this._equirectMaterial))}dispose(){this._dispose(),this._cubemapMaterial!==null&&this._cubemapMaterial.dispose(),this._equirectMaterial!==null&&this._equirectMaterial.dispose(),this._backgroundBox!==null&&(this._backgroundBox.geometry.dispose(),this._backgroundBox.material.dispose())}_setSize(t){this._lodMax=Math.floor(Math.log2(t)),this._cubeSize=Math.pow(2,this._lodMax)}_dispose(){this._blurMaterial!==null&&this._blurMaterial.dispose(),this._ggxMaterial!==null&&this._ggxMaterial.dispose(),this._pingPongRenderTarget!==null&&this._pingPongRenderTarget.dispose();for(let t=0;t<this._lodMeshes.length;t++)this._lodMeshes[t].geometry.dispose()}_cleanup(t){this._renderer.setRenderTarget(hd,dd,pd),this._renderer.xr.enabled=md,t.scissorTest=!1,Kr(t,0,0,t.width,t.height)}_fromTexture(t,i){t.mapping===Qs||t.mapping===no?this._setSize(t.image.length===0?16:t.image[0].width||t.image[0].image.width):this._setSize(t.image.width/4),hd=this._renderer.getRenderTarget(),dd=this._renderer.getActiveCubeFace(),pd=this._renderer.getActiveMipmapLevel(),md=this._renderer.xr.enabled,this._renderer.xr.enabled=!1;const s=i||this._allocateTargets();return this._textureToCubeUV(t,s),this._applyPMREM(s),this._cleanup(s),s}_allocateTargets(){const t=3*Math.max(this._cubeSize,112),i=4*this._cubeSize,s={magFilter:Bn,minFilter:Bn,generateMipmaps:!1,type:Pa,format:ki,colorSpace:ao,depthBuffer:!1},l=fv(t,i,s);if(this._pingPongRenderTarget===null||this._pingPongRenderTarget.width!==t||this._pingPongRenderTarget.height!==i){this._pingPongRenderTarget!==null&&this._dispose(),this._pingPongRenderTarget=fv(t,i,s);const{_lodMax:c}=this;({lodMeshes:this._lodMeshes,sizeLods:this._sizeLods,sigmas:this._sigmas}=M1(c)),this._blurMaterial=b1(c,t,i),this._ggxMaterial=E1(c,t,i)}return l}_compileMaterial(t){const i=new _i(new Pn,t);this._renderer.compile(i,rl)}_sceneToCubeUV(t,i,s,l,c){const m=new Bi(90,1,i,s),p=[1,-1,1,1,1,1],v=[1,1,1,-1,-1,-1],g=this._renderer,_=g.autoClear,M=g.toneMapping;g.getClearColor(cv),g.toneMapping=ia,g.autoClear=!1,g.state.buffers.depth.getReversed()&&(g.setRenderTarget(l),g.clearDepth(),g.setRenderTarget(null)),this._backgroundBox===null&&(this._backgroundBox=new _i(new vl,new Lp({name:"PMREM.Background",side:ii,depthWrite:!1,depthTest:!1})));const A=this._backgroundBox,x=A.material;let y=!1;const w=t.background;w?w.isColor&&(x.color.copy(w),t.background=null,y=!0):(x.color.copy(cv),y=!0);for(let D=0;D<6;D++){const U=D%3;U===0?(m.up.set(0,p[D],0),m.position.set(c.x,c.y,c.z),m.lookAt(c.x+v[D],c.y,c.z)):U===1?(m.up.set(0,0,p[D]),m.position.set(c.x,c.y,c.z),m.lookAt(c.x,c.y+v[D],c.z)):(m.up.set(0,p[D],0),m.position.set(c.x,c.y,c.z),m.lookAt(c.x,c.y,c.z+v[D]));const H=this._cubeSize;Kr(l,U*H,D>2?H:0,H,H),g.setRenderTarget(l),y&&g.render(A,m),g.render(t,m)}g.toneMapping=M,g.autoClear=_,t.background=w}_textureToCubeUV(t,i){const s=this._renderer,l=t.mapping===Qs||t.mapping===no;l?(this._cubemapMaterial===null&&(this._cubemapMaterial=dv()),this._cubemapMaterial.uniforms.flipEnvMap.value=t.isRenderTargetTexture===!1?-1:1):this._equirectMaterial===null&&(this._equirectMaterial=hv());const c=l?this._cubemapMaterial:this._equirectMaterial,h=this._lodMeshes[0];h.material=c;const d=c.uniforms;d.envMap.value=t;const m=this._cubeSize;Kr(i,0,0,3*m,2*m),s.setRenderTarget(i),s.render(h,rl)}_applyPMREM(t){const i=this._renderer,s=i.autoClear;i.autoClear=!1;const l=this._lodMeshes.length;for(let c=1;c<l;c++)this._applyGGXFilter(t,c-1,c);i.autoClear=s}_applyGGXFilter(t,i,s){const l=this._renderer,c=this._pingPongRenderTarget,h=this._ggxMaterial,d=this._lodMeshes[s];d.material=h;const m=h.uniforms,p=s/(this._lodMeshes.length-1),v=i/(this._lodMeshes.length-1),g=Math.sqrt(p*p-v*v),_=0+p*1.25,M=g*_,{_lodMax:E}=this,A=this._sizeLods[s],x=3*A*(s>E-vs?s-E+vs:0),y=4*(this._cubeSize-A);m.envMap.value=t.texture,m.roughness.value=M,m.mipInt.value=E-i,Kr(c,x,y,3*A,2*A),l.setRenderTarget(c),l.render(d,rl),m.envMap.value=c.texture,m.roughness.value=0,m.mipInt.value=E-s,Kr(t,x,y,3*A,2*A),l.setRenderTarget(t),l.render(d,rl)}_blur(t,i,s,l,c){const h=this._pingPongRenderTarget;this._halfBlur(t,h,i,s,l,"latitudinal",c),this._halfBlur(h,t,s,s,l,"longitudinal",c)}_halfBlur(t,i,s,l,c,h,d){const m=this._renderer,p=this._blurMaterial;h!=="latitudinal"&&h!=="longitudinal"&&Ue("blur direction must be either latitudinal or longitudinal!");const v=3,g=this._lodMeshes[l];g.material=p;const _=p.uniforms,M=this._sizeLods[s]-1,E=isFinite(c)?Math.PI/(2*M):2*Math.PI/(2*Ys-1),A=c/E,x=isFinite(c)?1+Math.floor(v*A):Ys;x>Ys&&ee(`sigmaRadians, ${c}, is too large and will clip, as it requested ${x} samples when the maximum is set to ${Ys}`);const y=[];let w=0;for(let I=0;I<Ys;++I){const T=I/A,L=Math.exp(-T*T/2);y.push(L),I===0?w+=L:I<x&&(w+=2*L)}for(let I=0;I<y.length;I++)y[I]=y[I]/w;_.envMap.value=t.texture,_.samples.value=x,_.weights.value=y,_.latitudinal.value=h==="latitudinal",d&&(_.poleAxis.value=d);const{_lodMax:D}=this;_.dTheta.value=E,_.mipInt.value=D-s;const U=this._sizeLods[l],H=3*U*(l>D-vs?l-D+vs:0),F=4*(this._cubeSize-U);Kr(i,H,F,3*U,2*U),m.setRenderTarget(i),m.render(g,rl)}}function M1(r){const t=[],i=[],s=[];let l=r;const c=r-vs+1+lv.length;for(let h=0;h<c;h++){const d=Math.pow(2,l);t.push(d);let m=1/d;h>r-vs?m=lv[h-r+vs-1]:h===0&&(m=0),i.push(m);const p=1/(d-2),v=-p,g=1+p,_=[v,v,g,v,g,g,v,v,g,g,v,g],M=6,E=6,A=3,x=2,y=1,w=new Float32Array(A*E*M),D=new Float32Array(x*E*M),U=new Float32Array(y*E*M);for(let F=0;F<M;F++){const I=F%3*2/3-1,T=F>2?0:-1,L=[I,T,0,I+2/3,T,0,I+2/3,T+1,0,I,T,0,I+2/3,T+1,0,I,T+1,0];w.set(L,A*E*F),D.set(_,x*E*F);const Q=[F,F,F,F,F,F];U.set(Q,y*E*F)}const H=new Pn;H.setAttribute("position",new gi(w,A)),H.setAttribute("uv",new gi(D,x)),H.setAttribute("faceIndex",new gi(U,y)),s.push(new _i(H,null)),l>vs&&l--}return{lodMeshes:s,sizeLods:t,sigmas:i}}function fv(r,t,i){const s=new aa(r,t,i);return s.texture.mapping=Eu,s.texture.name="PMREM.cubeUv",s.scissorTest=!0,s}function Kr(r,t,i,s,l){r.viewport.set(t,i,s,l),r.scissor.set(t,i,s,l)}function E1(r,t,i){return new Xi({name:"PMREMGGXConvolution",defines:{GGX_SAMPLES:S1,CUBEUV_TEXEL_WIDTH:1/t,CUBEUV_TEXEL_HEIGHT:1/i,CUBEUV_MAX_MIP:`${r}.0`},uniforms:{envMap:{value:null},roughness:{value:0},mipInt:{value:0}},vertexShader:Au(),fragmentShader:`
3620
+ }`,me={alphahash_fragment:FE,alphahash_pars_fragment:BE,alphamap_fragment:HE,alphamap_pars_fragment:GE,alphatest_fragment:VE,alphatest_pars_fragment:kE,aomap_fragment:XE,aomap_pars_fragment:WE,batching_pars_vertex:qE,batching_vertex:YE,begin_vertex:jE,beginnormal_vertex:ZE,bsdfs:KE,iridescence_fragment:QE,bumpmap_pars_fragment:JE,clipping_planes_fragment:$E,clipping_planes_pars_fragment:tb,clipping_planes_pars_vertex:eb,clipping_planes_vertex:nb,color_fragment:ib,color_pars_fragment:ab,color_pars_vertex:sb,color_vertex:rb,common:ob,cube_uv_reflection_fragment:lb,defaultnormal_vertex:cb,displacementmap_pars_vertex:ub,displacementmap_vertex:fb,emissivemap_fragment:hb,emissivemap_pars_fragment:db,colorspace_fragment:pb,colorspace_pars_fragment:mb,envmap_fragment:gb,envmap_common_pars_fragment:_b,envmap_pars_fragment:vb,envmap_pars_vertex:xb,envmap_physical_pars_fragment:Db,envmap_vertex:Sb,fog_vertex:yb,fog_pars_vertex:Mb,fog_fragment:Eb,fog_pars_fragment:bb,gradientmap_pars_fragment:Tb,lightmap_pars_fragment:Ab,lights_lambert_fragment:Rb,lights_lambert_pars_fragment:Cb,lights_pars_begin:wb,lights_toon_fragment:Ub,lights_toon_pars_fragment:Lb,lights_phong_fragment:Nb,lights_phong_pars_fragment:Ob,lights_physical_fragment:Pb,lights_physical_pars_fragment:zb,lights_fragment_begin:Ib,lights_fragment_maps:Fb,lights_fragment_end:Bb,logdepthbuf_fragment:Hb,logdepthbuf_pars_fragment:Gb,logdepthbuf_pars_vertex:Vb,logdepthbuf_vertex:kb,map_fragment:Xb,map_pars_fragment:Wb,map_particle_fragment:qb,map_particle_pars_fragment:Yb,metalnessmap_fragment:jb,metalnessmap_pars_fragment:Zb,morphinstance_vertex:Kb,morphcolor_vertex:Qb,morphnormal_vertex:Jb,morphtarget_pars_vertex:$b,morphtarget_vertex:tT,normal_fragment_begin:eT,normal_fragment_maps:nT,normal_pars_fragment:iT,normal_pars_vertex:aT,normal_vertex:sT,normalmap_pars_fragment:rT,clearcoat_normal_fragment_begin:oT,clearcoat_normal_fragment_maps:lT,clearcoat_pars_fragment:cT,iridescence_pars_fragment:uT,opaque_fragment:fT,packing:hT,premultiplied_alpha_fragment:dT,project_vertex:pT,dithering_fragment:mT,dithering_pars_fragment:gT,roughnessmap_fragment:_T,roughnessmap_pars_fragment:vT,shadowmap_pars_fragment:xT,shadowmap_pars_vertex:ST,shadowmap_vertex:yT,shadowmask_pars_fragment:MT,skinbase_vertex:ET,skinning_pars_vertex:bT,skinning_vertex:TT,skinnormal_vertex:AT,specularmap_fragment:RT,specularmap_pars_fragment:CT,tonemapping_fragment:wT,tonemapping_pars_fragment:DT,transmission_fragment:UT,transmission_pars_fragment:LT,uv_pars_fragment:NT,uv_pars_vertex:OT,uv_vertex:PT,worldpos_vertex:zT,background_vert:IT,background_frag:FT,backgroundCube_vert:BT,backgroundCube_frag:HT,cube_vert:GT,cube_frag:VT,depth_vert:kT,depth_frag:XT,distance_vert:WT,distance_frag:qT,equirect_vert:YT,equirect_frag:jT,linedashed_vert:ZT,linedashed_frag:KT,meshbasic_vert:QT,meshbasic_frag:JT,meshlambert_vert:$T,meshlambert_frag:t1,meshmatcap_vert:e1,meshmatcap_frag:n1,meshnormal_vert:i1,meshnormal_frag:a1,meshphong_vert:s1,meshphong_frag:r1,meshphysical_vert:o1,meshphysical_frag:l1,meshtoon_vert:c1,meshtoon_frag:u1,points_vert:f1,points_frag:h1,shadow_vert:d1,shadow_frag:p1,sprite_vert:m1,sprite_frag:g1},Lt={common:{diffuse:{value:new Se(16777215)},opacity:{value:1},map:{value:null},mapTransform:{value:new pe},alphaMap:{value:null},alphaMapTransform:{value:new pe},alphaTest:{value:0}},specularmap:{specularMap:{value:null},specularMapTransform:{value:new pe}},envmap:{envMap:{value:null},envMapRotation:{value:new pe},flipEnvMap:{value:-1},reflectivity:{value:1},ior:{value:1.5},refractionRatio:{value:.98},dfgLUT:{value:null}},aomap:{aoMap:{value:null},aoMapIntensity:{value:1},aoMapTransform:{value:new pe}},lightmap:{lightMap:{value:null},lightMapIntensity:{value:1},lightMapTransform:{value:new pe}},bumpmap:{bumpMap:{value:null},bumpMapTransform:{value:new pe},bumpScale:{value:1}},normalmap:{normalMap:{value:null},normalMapTransform:{value:new pe},normalScale:{value:new le(1,1)}},displacementmap:{displacementMap:{value:null},displacementMapTransform:{value:new pe},displacementScale:{value:1},displacementBias:{value:0}},emissivemap:{emissiveMap:{value:null},emissiveMapTransform:{value:new pe}},metalnessmap:{metalnessMap:{value:null},metalnessMapTransform:{value:new pe}},roughnessmap:{roughnessMap:{value:null},roughnessMapTransform:{value:new pe}},gradientmap:{gradientMap:{value:null}},fog:{fogDensity:{value:25e-5},fogNear:{value:1},fogFar:{value:2e3},fogColor:{value:new Se(16777215)}},lights:{ambientLightColor:{value:[]},lightProbe:{value:[]},directionalLights:{value:[],properties:{direction:{},color:{}}},directionalLightShadows:{value:[],properties:{shadowIntensity:1,shadowBias:{},shadowNormalBias:{},shadowRadius:{},shadowMapSize:{}}},directionalShadowMatrix:{value:[]},spotLights:{value:[],properties:{color:{},position:{},direction:{},distance:{},coneCos:{},penumbraCos:{},decay:{}}},spotLightShadows:{value:[],properties:{shadowIntensity:1,shadowBias:{},shadowNormalBias:{},shadowRadius:{},shadowMapSize:{}}},spotLightMap:{value:[]},spotLightMatrix:{value:[]},pointLights:{value:[],properties:{color:{},position:{},decay:{},distance:{}}},pointLightShadows:{value:[],properties:{shadowIntensity:1,shadowBias:{},shadowNormalBias:{},shadowRadius:{},shadowMapSize:{},shadowCameraNear:{},shadowCameraFar:{}}},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 Se(16777215)},opacity:{value:1},size:{value:1},scale:{value:1},map:{value:null},alphaMap:{value:null},alphaMapTransform:{value:new pe},alphaTest:{value:0},uvTransform:{value:new pe}},sprite:{diffuse:{value:new Se(16777215)},opacity:{value:1},center:{value:new le(.5,.5)},rotation:{value:0},map:{value:null},mapTransform:{value:new pe},alphaMap:{value:null},alphaMapTransform:{value:new pe},alphaTest:{value:0}}},$n={basic:{uniforms:kn([Lt.common,Lt.specularmap,Lt.envmap,Lt.aomap,Lt.lightmap,Lt.fog]),vertexShader:me.meshbasic_vert,fragmentShader:me.meshbasic_frag},lambert:{uniforms:kn([Lt.common,Lt.specularmap,Lt.envmap,Lt.aomap,Lt.lightmap,Lt.emissivemap,Lt.bumpmap,Lt.normalmap,Lt.displacementmap,Lt.fog,Lt.lights,{emissive:{value:new Se(0)},envMapIntensity:{value:1}}]),vertexShader:me.meshlambert_vert,fragmentShader:me.meshlambert_frag},phong:{uniforms:kn([Lt.common,Lt.specularmap,Lt.envmap,Lt.aomap,Lt.lightmap,Lt.emissivemap,Lt.bumpmap,Lt.normalmap,Lt.displacementmap,Lt.fog,Lt.lights,{emissive:{value:new Se(0)},specular:{value:new Se(1118481)},shininess:{value:30},envMapIntensity:{value:1}}]),vertexShader:me.meshphong_vert,fragmentShader:me.meshphong_frag},standard:{uniforms:kn([Lt.common,Lt.envmap,Lt.aomap,Lt.lightmap,Lt.emissivemap,Lt.bumpmap,Lt.normalmap,Lt.displacementmap,Lt.roughnessmap,Lt.metalnessmap,Lt.fog,Lt.lights,{emissive:{value:new Se(0)},roughness:{value:1},metalness:{value:0},envMapIntensity:{value:1}}]),vertexShader:me.meshphysical_vert,fragmentShader:me.meshphysical_frag},toon:{uniforms:kn([Lt.common,Lt.aomap,Lt.lightmap,Lt.emissivemap,Lt.bumpmap,Lt.normalmap,Lt.displacementmap,Lt.gradientmap,Lt.fog,Lt.lights,{emissive:{value:new Se(0)}}]),vertexShader:me.meshtoon_vert,fragmentShader:me.meshtoon_frag},matcap:{uniforms:kn([Lt.common,Lt.bumpmap,Lt.normalmap,Lt.displacementmap,Lt.fog,{matcap:{value:null}}]),vertexShader:me.meshmatcap_vert,fragmentShader:me.meshmatcap_frag},points:{uniforms:kn([Lt.points,Lt.fog]),vertexShader:me.points_vert,fragmentShader:me.points_frag},dashed:{uniforms:kn([Lt.common,Lt.fog,{scale:{value:1},dashSize:{value:1},totalSize:{value:2}}]),vertexShader:me.linedashed_vert,fragmentShader:me.linedashed_frag},depth:{uniforms:kn([Lt.common,Lt.displacementmap]),vertexShader:me.depth_vert,fragmentShader:me.depth_frag},normal:{uniforms:kn([Lt.common,Lt.bumpmap,Lt.normalmap,Lt.displacementmap,{opacity:{value:1}}]),vertexShader:me.meshnormal_vert,fragmentShader:me.meshnormal_frag},sprite:{uniforms:kn([Lt.sprite,Lt.fog]),vertexShader:me.sprite_vert,fragmentShader:me.sprite_frag},background:{uniforms:{uvTransform:{value:new pe},t2D:{value:null},backgroundIntensity:{value:1}},vertexShader:me.background_vert,fragmentShader:me.background_frag},backgroundCube:{uniforms:{envMap:{value:null},flipEnvMap:{value:-1},backgroundBlurriness:{value:0},backgroundIntensity:{value:1},backgroundRotation:{value:new pe}},vertexShader:me.backgroundCube_vert,fragmentShader:me.backgroundCube_frag},cube:{uniforms:{tCube:{value:null},tFlip:{value:-1},opacity:{value:1}},vertexShader:me.cube_vert,fragmentShader:me.cube_frag},equirect:{uniforms:{tEquirect:{value:null}},vertexShader:me.equirect_vert,fragmentShader:me.equirect_frag},distance:{uniforms:kn([Lt.common,Lt.displacementmap,{referencePosition:{value:new j},nearDistance:{value:1},farDistance:{value:1e3}}]),vertexShader:me.distance_vert,fragmentShader:me.distance_frag},shadow:{uniforms:kn([Lt.lights,Lt.fog,{color:{value:new Se(0)},opacity:{value:1}}]),vertexShader:me.shadow_vert,fragmentShader:me.shadow_frag}};$n.physical={uniforms:kn([$n.standard.uniforms,{clearcoat:{value:0},clearcoatMap:{value:null},clearcoatMapTransform:{value:new pe},clearcoatNormalMap:{value:null},clearcoatNormalMapTransform:{value:new pe},clearcoatNormalScale:{value:new le(1,1)},clearcoatRoughness:{value:0},clearcoatRoughnessMap:{value:null},clearcoatRoughnessMapTransform:{value:new pe},dispersion:{value:0},iridescence:{value:0},iridescenceMap:{value:null},iridescenceMapTransform:{value:new pe},iridescenceIOR:{value:1.3},iridescenceThicknessMinimum:{value:100},iridescenceThicknessMaximum:{value:400},iridescenceThicknessMap:{value:null},iridescenceThicknessMapTransform:{value:new pe},sheen:{value:0},sheenColor:{value:new Se(0)},sheenColorMap:{value:null},sheenColorMapTransform:{value:new pe},sheenRoughness:{value:1},sheenRoughnessMap:{value:null},sheenRoughnessMapTransform:{value:new pe},transmission:{value:0},transmissionMap:{value:null},transmissionMapTransform:{value:new pe},transmissionSamplerSize:{value:new le},transmissionSamplerMap:{value:null},thickness:{value:0},thicknessMap:{value:null},thicknessMapTransform:{value:new pe},attenuationDistance:{value:0},attenuationColor:{value:new Se(0)},specularColor:{value:new Se(1,1,1)},specularColorMap:{value:null},specularColorMapTransform:{value:new pe},specularIntensity:{value:1},specularIntensityMap:{value:null},specularIntensityMapTransform:{value:new pe},anisotropyVector:{value:new le},anisotropyMap:{value:null},anisotropyMapTransform:{value:new pe}}]),vertexShader:me.meshphysical_vert,fragmentShader:me.meshphysical_frag};const au={r:0,b:0,g:0},Xs=new sa,_1=new Je;function v1(r,t,i,s,l,c){const h=new Se(0);let d=l===!0?0:1,m,p,v=null,g=0,_=null;function M(w){let D=w.isScene===!0?w.background:null;if(D&&D.isTexture){const U=w.backgroundBlurriness>0;D=t.get(D,U)}return D}function E(w){let D=!1;const U=M(w);U===null?y(h,d):U&&U.isColor&&(y(U,1),D=!0);const H=r.xr.getEnvironmentBlendMode();H==="additive"?i.buffers.color.setClear(0,0,0,1,c):H==="alpha-blend"&&i.buffers.color.setClear(0,0,0,0,c),(r.autoClear||D)&&(i.buffers.depth.setTest(!0),i.buffers.depth.setMask(!0),i.buffers.color.setMask(!0),r.clear(r.autoClearColor,r.autoClearDepth,r.autoClearStencil))}function A(w,D){const U=M(D);U&&(U.isCubeTexture||U.mapping===Tu)?(p===void 0&&(p=new mi(new Sl(1,1,1),new ki({name:"BackgroundCubeMaterial",uniforms:oo($n.backgroundCube.uniforms),vertexShader:$n.backgroundCube.vertexShader,fragmentShader:$n.backgroundCube.fragmentShader,side:ti,depthTest:!1,depthWrite:!1,fog:!1,allowOverride:!1})),p.geometry.deleteAttribute("normal"),p.geometry.deleteAttribute("uv"),p.onBeforeRender=function(H,F,I){this.matrixWorld.copyPosition(I.matrixWorld)},Object.defineProperty(p.material,"envMap",{get:function(){return this.uniforms.envMap.value}}),s.update(p)),Xs.copy(D.backgroundRotation),Xs.x*=-1,Xs.y*=-1,Xs.z*=-1,U.isCubeTexture&&U.isRenderTargetTexture===!1&&(Xs.y*=-1,Xs.z*=-1),p.material.uniforms.envMap.value=U,p.material.uniforms.flipEnvMap.value=U.isCubeTexture&&U.isRenderTargetTexture===!1?-1:1,p.material.uniforms.backgroundBlurriness.value=D.backgroundBlurriness,p.material.uniforms.backgroundIntensity.value=D.backgroundIntensity,p.material.uniforms.backgroundRotation.value.setFromMatrix4(_1.makeRotationFromEuler(Xs)),p.material.toneMapped=Re.getTransfer(U.colorSpace)!==Fe,(v!==U||g!==U.version||_!==r.toneMapping)&&(p.material.needsUpdate=!0,v=U,g=U.version,_=r.toneMapping),p.layers.enableAll(),w.unshift(p,p.geometry,p.material,0,0,null)):U&&U.isTexture&&(m===void 0&&(m=new mi(new Au(2,2),new ki({name:"BackgroundMaterial",uniforms:oo($n.background.uniforms),vertexShader:$n.background.vertexShader,fragmentShader:$n.background.fragmentShader,side:xs,depthTest:!1,depthWrite:!1,fog:!1,allowOverride:!1})),m.geometry.deleteAttribute("normal"),Object.defineProperty(m.material,"map",{get:function(){return this.uniforms.t2D.value}}),s.update(m)),m.material.uniforms.t2D.value=U,m.material.uniforms.backgroundIntensity.value=D.backgroundIntensity,m.material.toneMapped=Re.getTransfer(U.colorSpace)!==Fe,U.matrixAutoUpdate===!0&&U.updateMatrix(),m.material.uniforms.uvTransform.value.copy(U.matrix),(v!==U||g!==U.version||_!==r.toneMapping)&&(m.material.needsUpdate=!0,v=U,g=U.version,_=r.toneMapping),m.layers.enableAll(),w.unshift(m,m.geometry,m.material,0,0,null))}function y(w,D){w.getRGB(au,mx(r)),i.buffers.color.setClear(au.r,au.g,au.b,D,c)}function S(){p!==void 0&&(p.geometry.dispose(),p.material.dispose(),p=void 0),m!==void 0&&(m.geometry.dispose(),m.material.dispose(),m=void 0)}return{getClearColor:function(){return h},setClearColor:function(w,D=1){h.set(w),d=D,y(h,d)},getClearAlpha:function(){return d},setClearAlpha:function(w){d=w,y(h,d)},render:E,addToRenderList:A,dispose:S}}function x1(r,t){const i=r.getParameter(r.MAX_VERTEX_ATTRIBS),s={},l=_(null);let c=l,h=!1;function d(P,W,J,rt,et){let O=!1;const B=g(P,rt,J,W);c!==B&&(c=B,p(c.object)),O=M(P,rt,J,et),O&&E(P,rt,J,et),et!==null&&t.update(et,r.ELEMENT_ARRAY_BUFFER),(O||h)&&(h=!1,U(P,W,J,rt),et!==null&&r.bindBuffer(r.ELEMENT_ARRAY_BUFFER,t.get(et).buffer))}function m(){return r.createVertexArray()}function p(P){return r.bindVertexArray(P)}function v(P){return r.deleteVertexArray(P)}function g(P,W,J,rt){const et=rt.wireframe===!0;let O=s[W.id];O===void 0&&(O={},s[W.id]=O);const B=P.isInstancedMesh===!0?P.id:0;let at=O[B];at===void 0&&(at={},O[B]=at);let $=at[J.id];$===void 0&&($={},at[J.id]=$);let lt=$[et];return lt===void 0&&(lt=_(m()),$[et]=lt),lt}function _(P){const W=[],J=[],rt=[];for(let et=0;et<i;et++)W[et]=0,J[et]=0,rt[et]=0;return{geometry:null,program:null,wireframe:!1,newAttributes:W,enabledAttributes:J,attributeDivisors:rt,object:P,attributes:{},index:null}}function M(P,W,J,rt){const et=c.attributes,O=W.attributes;let B=0;const at=J.getAttributes();for(const $ in at)if(at[$].location>=0){const N=et[$];let k=O[$];if(k===void 0&&($==="instanceMatrix"&&P.instanceMatrix&&(k=P.instanceMatrix),$==="instanceColor"&&P.instanceColor&&(k=P.instanceColor)),N===void 0||N.attribute!==k||k&&N.data!==k.data)return!0;B++}return c.attributesNum!==B||c.index!==rt}function E(P,W,J,rt){const et={},O=W.attributes;let B=0;const at=J.getAttributes();for(const $ in at)if(at[$].location>=0){let N=O[$];N===void 0&&($==="instanceMatrix"&&P.instanceMatrix&&(N=P.instanceMatrix),$==="instanceColor"&&P.instanceColor&&(N=P.instanceColor));const k={};k.attribute=N,N&&N.data&&(k.data=N.data),et[$]=k,B++}c.attributes=et,c.attributesNum=B,c.index=rt}function A(){const P=c.newAttributes;for(let W=0,J=P.length;W<J;W++)P[W]=0}function y(P){S(P,0)}function S(P,W){const J=c.newAttributes,rt=c.enabledAttributes,et=c.attributeDivisors;J[P]=1,rt[P]===0&&(r.enableVertexAttribArray(P),rt[P]=1),et[P]!==W&&(r.vertexAttribDivisor(P,W),et[P]=W)}function w(){const P=c.newAttributes,W=c.enabledAttributes;for(let J=0,rt=W.length;J<rt;J++)W[J]!==P[J]&&(r.disableVertexAttribArray(J),W[J]=0)}function D(P,W,J,rt,et,O,B){B===!0?r.vertexAttribIPointer(P,W,J,et,O):r.vertexAttribPointer(P,W,J,rt,et,O)}function U(P,W,J,rt){A();const et=rt.attributes,O=J.getAttributes(),B=W.defaultAttributeValues;for(const at in O){const $=O[at];if($.location>=0){let lt=et[at];if(lt===void 0&&(at==="instanceMatrix"&&P.instanceMatrix&&(lt=P.instanceMatrix),at==="instanceColor"&&P.instanceColor&&(lt=P.instanceColor)),lt!==void 0){const N=lt.normalized,k=lt.itemSize,ut=t.get(lt);if(ut===void 0)continue;const vt=ut.buffer,Rt=ut.type,Z=ut.bytesPerElement,dt=Rt===r.INT||Rt===r.UNSIGNED_INT||lt.gpuType===Mp;if(lt.isInterleavedBufferAttribute){const yt=lt.data,Ut=yt.stride,Ft=lt.offset;if(yt.isInstancedInterleavedBuffer){for(let Xt=0;Xt<$.locationSize;Xt++)S($.location+Xt,yt.meshPerAttribute);P.isInstancedMesh!==!0&&rt._maxInstanceCount===void 0&&(rt._maxInstanceCount=yt.meshPerAttribute*yt.count)}else for(let Xt=0;Xt<$.locationSize;Xt++)y($.location+Xt);r.bindBuffer(r.ARRAY_BUFFER,vt);for(let Xt=0;Xt<$.locationSize;Xt++)D($.location+Xt,k/$.locationSize,Rt,N,Ut*Z,(Ft+k/$.locationSize*Xt)*Z,dt)}else{if(lt.isInstancedBufferAttribute){for(let yt=0;yt<$.locationSize;yt++)S($.location+yt,lt.meshPerAttribute);P.isInstancedMesh!==!0&&rt._maxInstanceCount===void 0&&(rt._maxInstanceCount=lt.meshPerAttribute*lt.count)}else for(let yt=0;yt<$.locationSize;yt++)y($.location+yt);r.bindBuffer(r.ARRAY_BUFFER,vt);for(let yt=0;yt<$.locationSize;yt++)D($.location+yt,k/$.locationSize,Rt,N,k*Z,k/$.locationSize*yt*Z,dt)}}else if(B!==void 0){const N=B[at];if(N!==void 0)switch(N.length){case 2:r.vertexAttrib2fv($.location,N);break;case 3:r.vertexAttrib3fv($.location,N);break;case 4:r.vertexAttrib4fv($.location,N);break;default:r.vertexAttrib1fv($.location,N)}}}}w()}function H(){L();for(const P in s){const W=s[P];for(const J in W){const rt=W[J];for(const et in rt){const O=rt[et];for(const B in O)v(O[B].object),delete O[B];delete rt[et]}}delete s[P]}}function F(P){if(s[P.id]===void 0)return;const W=s[P.id];for(const J in W){const rt=W[J];for(const et in rt){const O=rt[et];for(const B in O)v(O[B].object),delete O[B];delete rt[et]}}delete s[P.id]}function I(P){for(const W in s){const J=s[W];for(const rt in J){const et=J[rt];if(et[P.id]===void 0)continue;const O=et[P.id];for(const B in O)v(O[B].object),delete O[B];delete et[P.id]}}}function T(P){for(const W in s){const J=s[W],rt=P.isInstancedMesh===!0?P.id:0,et=J[rt];if(et!==void 0){for(const O in et){const B=et[O];for(const at in B)v(B[at].object),delete B[at];delete et[O]}delete J[rt],Object.keys(J).length===0&&delete s[W]}}}function L(){Q(),h=!0,c!==l&&(c=l,p(c.object))}function Q(){l.geometry=null,l.program=null,l.wireframe=!1}return{setup:d,reset:L,resetDefaultState:Q,dispose:H,releaseStatesOfGeometry:F,releaseStatesOfObject:T,releaseStatesOfProgram:I,initAttributes:A,enableAttribute:y,disableUnusedAttributes:w}}function S1(r,t,i){let s;function l(p){s=p}function c(p,v){r.drawArrays(s,p,v),i.update(v,s,1)}function h(p,v,g){g!==0&&(r.drawArraysInstanced(s,p,v,g),i.update(v,s,g))}function d(p,v,g){if(g===0)return;t.get("WEBGL_multi_draw").multiDrawArraysWEBGL(s,p,0,v,0,g);let M=0;for(let E=0;E<g;E++)M+=v[E];i.update(M,s,1)}function m(p,v,g,_){if(g===0)return;const M=t.get("WEBGL_multi_draw");if(M===null)for(let E=0;E<p.length;E++)h(p[E],v[E],_[E]);else{M.multiDrawArraysInstancedWEBGL(s,p,0,v,0,_,0,g);let E=0;for(let A=0;A<g;A++)E+=v[A]*_[A];i.update(E,s,1)}}this.setMode=l,this.render=c,this.renderInstances=h,this.renderMultiDraw=d,this.renderMultiDrawInstances=m}function y1(r,t,i,s){let l;function c(){if(l!==void 0)return l;if(t.has("EXT_texture_filter_anisotropic")===!0){const I=t.get("EXT_texture_filter_anisotropic");l=r.getParameter(I.MAX_TEXTURE_MAX_ANISOTROPY_EXT)}else l=0;return l}function h(I){return!(I!==Vi&&s.convert(I)!==r.getParameter(r.IMPLEMENTATION_COLOR_READ_FORMAT))}function d(I){const T=I===Pa&&(t.has("EXT_color_buffer_half_float")||t.has("EXT_color_buffer_float"));return!(I!==di&&s.convert(I)!==r.getParameter(r.IMPLEMENTATION_COLOR_READ_TYPE)&&I!==ta&&!T)}function m(I){if(I==="highp"){if(r.getShaderPrecisionFormat(r.VERTEX_SHADER,r.HIGH_FLOAT).precision>0&&r.getShaderPrecisionFormat(r.FRAGMENT_SHADER,r.HIGH_FLOAT).precision>0)return"highp";I="mediump"}return I==="mediump"&&r.getShaderPrecisionFormat(r.VERTEX_SHADER,r.MEDIUM_FLOAT).precision>0&&r.getShaderPrecisionFormat(r.FRAGMENT_SHADER,r.MEDIUM_FLOAT).precision>0?"mediump":"lowp"}let p=i.precision!==void 0?i.precision:"highp";const v=m(p);v!==p&&(ee("WebGLRenderer:",p,"not supported, using",v,"instead."),p=v);const g=i.logarithmicDepthBuffer===!0,_=i.reversedDepthBuffer===!0&&t.has("EXT_clip_control"),M=r.getParameter(r.MAX_TEXTURE_IMAGE_UNITS),E=r.getParameter(r.MAX_VERTEX_TEXTURE_IMAGE_UNITS),A=r.getParameter(r.MAX_TEXTURE_SIZE),y=r.getParameter(r.MAX_CUBE_MAP_TEXTURE_SIZE),S=r.getParameter(r.MAX_VERTEX_ATTRIBS),w=r.getParameter(r.MAX_VERTEX_UNIFORM_VECTORS),D=r.getParameter(r.MAX_VARYING_VECTORS),U=r.getParameter(r.MAX_FRAGMENT_UNIFORM_VECTORS),H=r.getParameter(r.MAX_SAMPLES),F=r.getParameter(r.SAMPLES);return{isWebGL2:!0,getMaxAnisotropy:c,getMaxPrecision:m,textureFormatReadable:h,textureTypeReadable:d,precision:p,logarithmicDepthBuffer:g,reversedDepthBuffer:_,maxTextures:M,maxVertexTextures:E,maxTextureSize:A,maxCubemapSize:y,maxAttributes:S,maxVertexUniforms:w,maxVaryings:D,maxFragmentUniforms:U,maxSamples:H,samples:F}}function M1(r){const t=this;let i=null,s=0,l=!1,c=!1;const h=new ms,d=new pe,m={value:null,needsUpdate:!1};this.uniform=m,this.numPlanes=0,this.numIntersection=0,this.init=function(g,_){const M=g.length!==0||_||s!==0||l;return l=_,s=g.length,M},this.beginShadows=function(){c=!0,v(null)},this.endShadows=function(){c=!1},this.setGlobalState=function(g,_){i=v(g,_,0)},this.setState=function(g,_,M){const E=g.clippingPlanes,A=g.clipIntersection,y=g.clipShadows,S=r.get(g);if(!l||E===null||E.length===0||c&&!y)c?v(null):p();else{const w=c?0:s,D=w*4;let U=S.clippingState||null;m.value=U,U=v(E,_,D,M);for(let H=0;H!==D;++H)U[H]=i[H];S.clippingState=U,this.numIntersection=A?this.numPlanes:0,this.numPlanes+=w}};function p(){m.value!==i&&(m.value=i,m.needsUpdate=s>0),t.numPlanes=s,t.numIntersection=0}function v(g,_,M,E){const A=g!==null?g.length:0;let y=null;if(A!==0){if(y=m.value,E!==!0||y===null){const S=M+A*4,w=_.matrixWorldInverse;d.getNormalMatrix(w),(y===null||y.length<S)&&(y=new Float32Array(S));for(let D=0,U=M;D!==A;++D,U+=4)h.copy(g[D]).applyMatrix4(w,d),h.normal.toArray(y,U),y[U+3]=h.constant}m.value=y,m.needsUpdate=!0}return t.numPlanes=A,t.numIntersection=0,y}}const vs=4,cv=[.125,.215,.35,.446,.526,.582],Ys=20,E1=256,ll=new Ru,uv=new Se;let pd=null,md=0,gd=0,_d=!1;const b1=new j;class fv{constructor(t){this._renderer=t,this._pingPongRenderTarget=null,this._lodMax=0,this._cubeSize=0,this._sizeLods=[],this._sigmas=[],this._lodMeshes=[],this._backgroundBox=null,this._cubemapMaterial=null,this._equirectMaterial=null,this._blurMaterial=null,this._ggxMaterial=null}fromScene(t,i=0,s=.1,l=100,c={}){const{size:h=256,position:d=b1}=c;pd=this._renderer.getRenderTarget(),md=this._renderer.getActiveCubeFace(),gd=this._renderer.getActiveMipmapLevel(),_d=this._renderer.xr.enabled,this._renderer.xr.enabled=!1,this._setSize(h);const m=this._allocateTargets();return m.depthBuffer=!0,this._sceneToCubeUV(t,s,l,m,d),i>0&&this._blur(m,0,0,i),this._applyPMREM(m),this._cleanup(m),m}fromEquirectangular(t,i=null){return this._fromTexture(t,i)}fromCubemap(t,i=null){return this._fromTexture(t,i)}compileCubemapShader(){this._cubemapMaterial===null&&(this._cubemapMaterial=pv(),this._compileMaterial(this._cubemapMaterial))}compileEquirectangularShader(){this._equirectMaterial===null&&(this._equirectMaterial=dv(),this._compileMaterial(this._equirectMaterial))}dispose(){this._dispose(),this._cubemapMaterial!==null&&this._cubemapMaterial.dispose(),this._equirectMaterial!==null&&this._equirectMaterial.dispose(),this._backgroundBox!==null&&(this._backgroundBox.geometry.dispose(),this._backgroundBox.material.dispose())}_setSize(t){this._lodMax=Math.floor(Math.log2(t)),this._cubeSize=Math.pow(2,this._lodMax)}_dispose(){this._blurMaterial!==null&&this._blurMaterial.dispose(),this._ggxMaterial!==null&&this._ggxMaterial.dispose(),this._pingPongRenderTarget!==null&&this._pingPongRenderTarget.dispose();for(let t=0;t<this._lodMeshes.length;t++)this._lodMeshes[t].geometry.dispose()}_cleanup(t){this._renderer.setRenderTarget(pd,md,gd),this._renderer.xr.enabled=_d,t.scissorTest=!1,Qr(t,0,0,t.width,t.height)}_fromTexture(t,i){t.mapping===Js||t.mapping===ao?this._setSize(t.image.length===0?16:t.image[0].width||t.image[0].image.width):this._setSize(t.image.width/4),pd=this._renderer.getRenderTarget(),md=this._renderer.getActiveCubeFace(),gd=this._renderer.getActiveMipmapLevel(),_d=this._renderer.xr.enabled,this._renderer.xr.enabled=!1;const s=i||this._allocateTargets();return this._textureToCubeUV(t,s),this._applyPMREM(s),this._cleanup(s),s}_allocateTargets(){const t=3*Math.max(this._cubeSize,112),i=4*this._cubeSize,s={magFilter:zn,minFilter:zn,generateMipmaps:!1,type:Pa,format:Vi,colorSpace:ro,depthBuffer:!1},l=hv(t,i,s);if(this._pingPongRenderTarget===null||this._pingPongRenderTarget.width!==t||this._pingPongRenderTarget.height!==i){this._pingPongRenderTarget!==null&&this._dispose(),this._pingPongRenderTarget=hv(t,i,s);const{_lodMax:c}=this;({lodMeshes:this._lodMeshes,sizeLods:this._sizeLods,sigmas:this._sigmas}=T1(c)),this._blurMaterial=R1(c,t,i),this._ggxMaterial=A1(c,t,i)}return l}_compileMaterial(t){const i=new mi(new Ln,t);this._renderer.compile(i,ll)}_sceneToCubeUV(t,i,s,l,c){const m=new Fi(90,1,i,s),p=[1,-1,1,1,1,1],v=[1,1,1,-1,-1,-1],g=this._renderer,_=g.autoClear,M=g.toneMapping;g.getClearColor(uv),g.toneMapping=na,g.autoClear=!1,g.state.buffers.depth.getReversed()&&(g.setRenderTarget(l),g.clearDepth(),g.setRenderTarget(null)),this._backgroundBox===null&&(this._backgroundBox=new mi(new Sl,new Np({name:"PMREM.Background",side:ti,depthWrite:!1,depthTest:!1})));const A=this._backgroundBox,y=A.material;let S=!1;const w=t.background;w?w.isColor&&(y.color.copy(w),t.background=null,S=!0):(y.color.copy(uv),S=!0);for(let D=0;D<6;D++){const U=D%3;U===0?(m.up.set(0,p[D],0),m.position.set(c.x,c.y,c.z),m.lookAt(c.x+v[D],c.y,c.z)):U===1?(m.up.set(0,0,p[D]),m.position.set(c.x,c.y,c.z),m.lookAt(c.x,c.y+v[D],c.z)):(m.up.set(0,p[D],0),m.position.set(c.x,c.y,c.z),m.lookAt(c.x,c.y,c.z+v[D]));const H=this._cubeSize;Qr(l,U*H,D>2?H:0,H,H),g.setRenderTarget(l),S&&g.render(A,m),g.render(t,m)}g.toneMapping=M,g.autoClear=_,t.background=w}_textureToCubeUV(t,i){const s=this._renderer,l=t.mapping===Js||t.mapping===ao;l?(this._cubemapMaterial===null&&(this._cubemapMaterial=pv()),this._cubemapMaterial.uniforms.flipEnvMap.value=t.isRenderTargetTexture===!1?-1:1):this._equirectMaterial===null&&(this._equirectMaterial=dv());const c=l?this._cubemapMaterial:this._equirectMaterial,h=this._lodMeshes[0];h.material=c;const d=c.uniforms;d.envMap.value=t;const m=this._cubeSize;Qr(i,0,0,3*m,2*m),s.setRenderTarget(i),s.render(h,ll)}_applyPMREM(t){const i=this._renderer,s=i.autoClear;i.autoClear=!1;const l=this._lodMeshes.length;for(let c=1;c<l;c++)this._applyGGXFilter(t,c-1,c);i.autoClear=s}_applyGGXFilter(t,i,s){const l=this._renderer,c=this._pingPongRenderTarget,h=this._ggxMaterial,d=this._lodMeshes[s];d.material=h;const m=h.uniforms,p=s/(this._lodMeshes.length-1),v=i/(this._lodMeshes.length-1),g=Math.sqrt(p*p-v*v),_=0+p*1.25,M=g*_,{_lodMax:E}=this,A=this._sizeLods[s],y=3*A*(s>E-vs?s-E+vs:0),S=4*(this._cubeSize-A);m.envMap.value=t.texture,m.roughness.value=M,m.mipInt.value=E-i,Qr(c,y,S,3*A,2*A),l.setRenderTarget(c),l.render(d,ll),m.envMap.value=c.texture,m.roughness.value=0,m.mipInt.value=E-s,Qr(t,y,S,3*A,2*A),l.setRenderTarget(t),l.render(d,ll)}_blur(t,i,s,l,c){const h=this._pingPongRenderTarget;this._halfBlur(t,h,i,s,l,"latitudinal",c),this._halfBlur(h,t,s,s,l,"longitudinal",c)}_halfBlur(t,i,s,l,c,h,d){const m=this._renderer,p=this._blurMaterial;h!=="latitudinal"&&h!=="longitudinal"&&Ue("blur direction must be either latitudinal or longitudinal!");const v=3,g=this._lodMeshes[l];g.material=p;const _=p.uniforms,M=this._sizeLods[s]-1,E=isFinite(c)?Math.PI/(2*M):2*Math.PI/(2*Ys-1),A=c/E,y=isFinite(c)?1+Math.floor(v*A):Ys;y>Ys&&ee(`sigmaRadians, ${c}, is too large and will clip, as it requested ${y} samples when the maximum is set to ${Ys}`);const S=[];let w=0;for(let I=0;I<Ys;++I){const T=I/A,L=Math.exp(-T*T/2);S.push(L),I===0?w+=L:I<y&&(w+=2*L)}for(let I=0;I<S.length;I++)S[I]=S[I]/w;_.envMap.value=t.texture,_.samples.value=y,_.weights.value=S,_.latitudinal.value=h==="latitudinal",d&&(_.poleAxis.value=d);const{_lodMax:D}=this;_.dTheta.value=E,_.mipInt.value=D-s;const U=this._sizeLods[l],H=3*U*(l>D-vs?l-D+vs:0),F=4*(this._cubeSize-U);Qr(i,H,F,3*U,2*U),m.setRenderTarget(i),m.render(g,ll)}}function T1(r){const t=[],i=[],s=[];let l=r;const c=r-vs+1+cv.length;for(let h=0;h<c;h++){const d=Math.pow(2,l);t.push(d);let m=1/d;h>r-vs?m=cv[h-r+vs-1]:h===0&&(m=0),i.push(m);const p=1/(d-2),v=-p,g=1+p,_=[v,v,g,v,g,g,v,v,g,g,v,g],M=6,E=6,A=3,y=2,S=1,w=new Float32Array(A*E*M),D=new Float32Array(y*E*M),U=new Float32Array(S*E*M);for(let F=0;F<M;F++){const I=F%3*2/3-1,T=F>2?0:-1,L=[I,T,0,I+2/3,T,0,I+2/3,T+1,0,I,T,0,I+2/3,T+1,0,I,T+1,0];w.set(L,A*E*F),D.set(_,y*E*F);const Q=[F,F,F,F,F,F];U.set(Q,S*E*F)}const H=new Ln;H.setAttribute("position",new pi(w,A)),H.setAttribute("uv",new pi(D,y)),H.setAttribute("faceIndex",new pi(U,S)),s.push(new mi(H,null)),l>vs&&l--}return{lodMeshes:s,sizeLods:t,sigmas:i}}function hv(r,t,i){const s=new ia(r,t,i);return s.texture.mapping=Tu,s.texture.name="PMREM.cubeUv",s.scissorTest=!0,s}function Qr(r,t,i,s,l){r.viewport.set(t,i,s,l),r.scissor.set(t,i,s,l)}function A1(r,t,i){return new ki({name:"PMREMGGXConvolution",defines:{GGX_SAMPLES:E1,CUBEUV_TEXEL_WIDTH:1/t,CUBEUV_TEXEL_HEIGHT:1/i,CUBEUV_MAX_MIP:`${r}.0`},uniforms:{envMap:{value:null},roughness:{value:0},mipInt:{value:0}},vertexShader:Cu(),fragmentShader:`
3621
3621
 
3622
3622
  precision highp float;
3623
3623
  precision highp int;
@@ -3721,7 +3721,7 @@ void main() {
3721
3721
 
3722
3722
  gl_FragColor = vec4(prefilteredColor, 1.0);
3723
3723
  }
3724
- `,blending:La,depthTest:!1,depthWrite:!1})}function b1(r,t,i){const s=new Float32Array(Ys),l=new j(0,1,0);return new Xi({name:"SphericalGaussianBlur",defines:{n:Ys,CUBEUV_TEXEL_WIDTH:1/t,CUBEUV_TEXEL_HEIGHT:1/i,CUBEUV_MAX_MIP:`${r}.0`},uniforms:{envMap:{value:null},samples:{value:1},weights:{value:s},latitudinal:{value:!1},dTheta:{value:0},mipInt:{value:0},poleAxis:{value:l}},vertexShader:Au(),fragmentShader:`
3724
+ `,blending:La,depthTest:!1,depthWrite:!1})}function R1(r,t,i){const s=new Float32Array(Ys),l=new j(0,1,0);return new ki({name:"SphericalGaussianBlur",defines:{n:Ys,CUBEUV_TEXEL_WIDTH:1/t,CUBEUV_TEXEL_HEIGHT:1/i,CUBEUV_MAX_MIP:`${r}.0`},uniforms:{envMap:{value:null},samples:{value:1},weights:{value:s},latitudinal:{value:!1},dTheta:{value:0},mipInt:{value:0},poleAxis:{value:l}},vertexShader:Cu(),fragmentShader:`
3725
3725
 
3726
3726
  precision mediump float;
3727
3727
  precision mediump int;
@@ -3781,7 +3781,7 @@ void main() {
3781
3781
  }
3782
3782
 
3783
3783
  }
3784
- `,blending:La,depthTest:!1,depthWrite:!1})}function hv(){return new Xi({name:"EquirectangularToCubeUV",uniforms:{envMap:{value:null}},vertexShader:Au(),fragmentShader:`
3784
+ `,blending:La,depthTest:!1,depthWrite:!1})}function dv(){return new ki({name:"EquirectangularToCubeUV",uniforms:{envMap:{value:null}},vertexShader:Cu(),fragmentShader:`
3785
3785
 
3786
3786
  precision mediump float;
3787
3787
  precision mediump int;
@@ -3800,7 +3800,7 @@ void main() {
3800
3800
  gl_FragColor = vec4( texture2D ( envMap, uv ).rgb, 1.0 );
3801
3801
 
3802
3802
  }
3803
- `,blending:La,depthTest:!1,depthWrite:!1})}function dv(){return new Xi({name:"CubemapToCubeUV",uniforms:{envMap:{value:null},flipEnvMap:{value:-1}},vertexShader:Au(),fragmentShader:`
3803
+ `,blending:La,depthTest:!1,depthWrite:!1})}function pv(){return new ki({name:"CubemapToCubeUV",uniforms:{envMap:{value:null},flipEnvMap:{value:-1}},vertexShader:Cu(),fragmentShader:`
3804
3804
 
3805
3805
  precision mediump float;
3806
3806
  precision mediump int;
@@ -3816,7 +3816,7 @@ void main() {
3816
3816
  gl_FragColor = textureCube( envMap, vec3( flipEnvMap * vOutputDirection.x, vOutputDirection.yz ) );
3817
3817
 
3818
3818
  }
3819
- `,blending:La,depthTest:!1,depthWrite:!1})}function Au(){return`
3819
+ `,blending:La,depthTest:!1,depthWrite:!1})}function Cu(){return`
3820
3820
 
3821
3821
  precision mediump float;
3822
3822
  precision mediump int;
@@ -3871,7 +3871,7 @@ void main() {
3871
3871
  gl_Position = vec4( position, 1.0 );
3872
3872
 
3873
3873
  }
3874
- `}class vx extends aa{constructor(t=1,i={}){super(t,t,i),this.isWebGLCubeRenderTarget=!0;const s={width:t,height:t,depth:1},l=[s,s,s,s,s,s];this.texture=new hx(l),this._setTextureOptions(i),this.texture.isRenderTargetTexture=!0}fromEquirectangularTexture(t,i){this.texture.type=i.type,this.texture.colorSpace=i.colorSpace,this.texture.generateMipmaps=i.generateMipmaps,this.texture.minFilter=i.minFilter,this.texture.magFilter=i.magFilter;const s={uniforms:{tEquirect:{value:null}},vertexShader:`
3874
+ `}class xx extends ia{constructor(t=1,i={}){super(t,t,i),this.isWebGLCubeRenderTarget=!0;const s={width:t,height:t,depth:1},l=[s,s,s,s,s,s];this.texture=new dx(l),this._setTextureOptions(i),this.texture.isRenderTargetTexture=!0}fromEquirectangularTexture(t,i){this.texture.type=i.type,this.texture.colorSpace=i.colorSpace,this.texture.generateMipmaps=i.generateMipmaps,this.texture.minFilter=i.minFilter,this.texture.magFilter=i.magFilter;const s={uniforms:{tEquirect:{value:null}},vertexShader:`
3875
3875
 
3876
3876
  varying vec3 vWorldDirection;
3877
3877
 
@@ -3906,7 +3906,7 @@ void main() {
3906
3906
  gl_FragColor = texture2D( tEquirect, sampleUV );
3907
3907
 
3908
3908
  }
3909
- `},l=new vl(5,5,5),c=new Xi({name:"CubemapFromEquirect",uniforms:so(s.uniforms),vertexShader:s.vertexShader,fragmentShader:s.fragmentShader,side:ii,blending:La});c.uniforms.tEquirect.value=i;const h=new _i(l,c),d=i.minFilter;return i.minFilter===js&&(i.minFilter=Bn),new RE(1,10,this).update(t,h),i.minFilter=d,h.geometry.dispose(),h.material.dispose(),this}clear(t,i=!0,s=!0,l=!0){const c=t.getRenderTarget();for(let h=0;h<6;h++)t.setRenderTarget(this,h),t.clear(i,s,l);t.setRenderTarget(c)}}function T1(r){let t=new WeakMap,i=new WeakMap,s=null;function l(_,M=!1){return _==null?null:M?h(_):c(_)}function c(_){if(_&&_.isTexture){const M=_.mapping;if(M===Fh||M===Bh)if(t.has(_)){const E=t.get(_).texture;return d(E,_.mapping)}else{const E=_.image;if(E&&E.height>0){const A=new vx(E.height);return A.fromEquirectangularTexture(r,_),t.set(_,A),_.addEventListener("dispose",p),d(A.texture,_.mapping)}else return null}}return _}function h(_){if(_&&_.isTexture){const M=_.mapping,E=M===Fh||M===Bh,A=M===Qs||M===no;if(E||A){let x=i.get(_);const y=x!==void 0?x.texture.pmremVersion:0;if(_.isRenderTargetTexture&&_.pmremVersion!==y)return s===null&&(s=new uv(r)),x=E?s.fromEquirectangular(_,x):s.fromCubemap(_,x),x.texture.pmremVersion=_.pmremVersion,i.set(_,x),x.texture;if(x!==void 0)return x.texture;{const w=_.image;return E&&w&&w.height>0||A&&w&&m(w)?(s===null&&(s=new uv(r)),x=E?s.fromEquirectangular(_):s.fromCubemap(_),x.texture.pmremVersion=_.pmremVersion,i.set(_,x),_.addEventListener("dispose",v),x.texture):null}}}return _}function d(_,M){return M===Fh?_.mapping=Qs:M===Bh&&(_.mapping=no),_}function m(_){let M=0;const E=6;for(let A=0;A<E;A++)_[A]!==void 0&&M++;return M===E}function p(_){const M=_.target;M.removeEventListener("dispose",p);const E=t.get(M);E!==void 0&&(t.delete(M),E.dispose())}function v(_){const M=_.target;M.removeEventListener("dispose",v);const E=i.get(M);E!==void 0&&(i.delete(M),E.dispose())}function g(){t=new WeakMap,i=new WeakMap,s!==null&&(s.dispose(),s=null)}return{get:l,dispose:g}}function A1(r){const t={};function i(s){if(t[s]!==void 0)return t[s];const l=r.getExtension(s);return t[s]=l,l}return{has:function(s){return i(s)!==null},init:function(){i("EXT_color_buffer_float"),i("WEBGL_clip_cull_distance"),i("OES_texture_float_linear"),i("EXT_color_buffer_half_float"),i("WEBGL_multisampled_render_to_texture"),i("WEBGL_render_shared_exponent")},get:function(s){const l=i(s);return l===null&&xu("WebGLRenderer: "+s+" extension not supported."),l}}}function R1(r,t,i,s){const l={},c=new WeakMap;function h(g){const _=g.target;_.index!==null&&t.remove(_.index);for(const E in _.attributes)t.remove(_.attributes[E]);_.removeEventListener("dispose",h),delete l[_.id];const M=c.get(_);M&&(t.remove(M),c.delete(_)),s.releaseStatesOfGeometry(_),_.isInstancedBufferGeometry===!0&&delete _._maxInstanceCount,i.memory.geometries--}function d(g,_){return l[_.id]===!0||(_.addEventListener("dispose",h),l[_.id]=!0,i.memory.geometries++),_}function m(g){const _=g.attributes;for(const M in _)t.update(_[M],r.ARRAY_BUFFER)}function p(g){const _=[],M=g.index,E=g.attributes.position;let A=0;if(E===void 0)return;if(M!==null){const w=M.array;A=M.version;for(let D=0,U=w.length;D<U;D+=3){const H=w[D+0],F=w[D+1],I=w[D+2];_.push(H,F,F,I,I,H)}}else{const w=E.array;A=E.version;for(let D=0,U=w.length/3-1;D<U;D+=3){const H=D+0,F=D+1,I=D+2;_.push(H,F,F,I,I,H)}}const x=new(E.count>=65535?fx:ux)(_,1);x.version=A;const y=c.get(g);y&&t.remove(y),c.set(g,x)}function v(g){const _=c.get(g);if(_){const M=g.index;M!==null&&_.version<M.version&&p(g)}else p(g);return c.get(g)}return{get:d,update:m,getWireframeAttribute:v}}function C1(r,t,i){let s;function l(_){s=_}let c,h;function d(_){c=_.type,h=_.bytesPerElement}function m(_,M){r.drawElements(s,M,c,_*h),i.update(M,s,1)}function p(_,M,E){E!==0&&(r.drawElementsInstanced(s,M,c,_*h,E),i.update(M,s,E))}function v(_,M,E){if(E===0)return;t.get("WEBGL_multi_draw").multiDrawElementsWEBGL(s,M,0,c,_,0,E);let x=0;for(let y=0;y<E;y++)x+=M[y];i.update(x,s,1)}function g(_,M,E,A){if(E===0)return;const x=t.get("WEBGL_multi_draw");if(x===null)for(let y=0;y<_.length;y++)p(_[y]/h,M[y],A[y]);else{x.multiDrawElementsInstancedWEBGL(s,M,0,c,_,0,A,0,E);let y=0;for(let w=0;w<E;w++)y+=M[w]*A[w];i.update(y,s,1)}}this.setMode=l,this.setIndex=d,this.render=m,this.renderInstances=p,this.renderMultiDraw=v,this.renderMultiDrawInstances=g}function w1(r){const t={geometries:0,textures:0},i={frame:0,calls:0,triangles:0,points:0,lines:0};function s(c,h,d){switch(i.calls++,h){case r.TRIANGLES:i.triangles+=d*(c/3);break;case r.LINES:i.lines+=d*(c/2);break;case r.LINE_STRIP:i.lines+=d*(c-1);break;case r.LINE_LOOP:i.lines+=d*c;break;case r.POINTS:i.points+=d*c;break;default:Ue("WebGLInfo: Unknown draw mode:",h);break}}function l(){i.calls=0,i.triangles=0,i.points=0,i.lines=0}return{memory:t,render:i,programs:null,autoReset:!0,reset:l,update:s}}function D1(r,t,i){const s=new WeakMap,l=new We;function c(h,d,m){const p=h.morphTargetInfluences,v=d.morphAttributes.position||d.morphAttributes.normal||d.morphAttributes.color,g=v!==void 0?v.length:0;let _=s.get(d);if(_===void 0||_.count!==g){let Q=function(){T.dispose(),s.delete(d),d.removeEventListener("dispose",Q)};var M=Q;_!==void 0&&_.texture.dispose();const E=d.morphAttributes.position!==void 0,A=d.morphAttributes.normal!==void 0,x=d.morphAttributes.color!==void 0,y=d.morphAttributes.position||[],w=d.morphAttributes.normal||[],D=d.morphAttributes.color||[];let U=0;E===!0&&(U=1),A===!0&&(U=2),x===!0&&(U=3);let H=d.attributes.position.count*U,F=1;H>t.maxTextureSize&&(F=Math.ceil(H/t.maxTextureSize),H=t.maxTextureSize);const I=new Float32Array(H*F*4*g),T=new ox(I,H,F,g);T.type=ea,T.needsUpdate=!0;const L=U*4;for(let P=0;P<g;P++){const W=y[P],J=w[P],rt=D[P],et=H*F*4*P;for(let O=0;O<W.count;O++){const B=O*L;E===!0&&(l.fromBufferAttribute(W,O),I[et+B+0]=l.x,I[et+B+1]=l.y,I[et+B+2]=l.z,I[et+B+3]=0),A===!0&&(l.fromBufferAttribute(J,O),I[et+B+4]=l.x,I[et+B+5]=l.y,I[et+B+6]=l.z,I[et+B+7]=0),x===!0&&(l.fromBufferAttribute(rt,O),I[et+B+8]=l.x,I[et+B+9]=l.y,I[et+B+10]=l.z,I[et+B+11]=rt.itemSize===4?l.w:1)}}_={count:g,texture:T,size:new le(H,F)},s.set(d,_),d.addEventListener("dispose",Q)}if(h.isInstancedMesh===!0&&h.morphTexture!==null)m.getUniforms().setValue(r,"morphTexture",h.morphTexture,i);else{let E=0;for(let x=0;x<p.length;x++)E+=p[x];const A=d.morphTargetsRelative?1:1-E;m.getUniforms().setValue(r,"morphTargetBaseInfluence",A),m.getUniforms().setValue(r,"morphTargetInfluences",p)}m.getUniforms().setValue(r,"morphTargetsTexture",_.texture,i),m.getUniforms().setValue(r,"morphTargetsTextureSize",_.size)}return{update:c}}function U1(r,t,i,s,l){let c=new WeakMap;function h(p){const v=l.render.frame,g=p.geometry,_=t.get(p,g);if(c.get(_)!==v&&(t.update(_),c.set(_,v)),p.isInstancedMesh&&(p.hasEventListener("dispose",m)===!1&&p.addEventListener("dispose",m),c.get(p)!==v&&(i.update(p.instanceMatrix,r.ARRAY_BUFFER),p.instanceColor!==null&&i.update(p.instanceColor,r.ARRAY_BUFFER),c.set(p,v))),p.isSkinnedMesh){const M=p.skeleton;c.get(M)!==v&&(M.update(),c.set(M,v))}return _}function d(){c=new WeakMap}function m(p){const v=p.target;v.removeEventListener("dispose",m),s.releaseStatesOfObject(v),i.remove(v.instanceMatrix),v.instanceColor!==null&&i.remove(v.instanceColor)}return{update:h,dispose:d}}const L1={[kv]:"LINEAR_TONE_MAPPING",[Xv]:"REINHARD_TONE_MAPPING",[Wv]:"CINEON_TONE_MAPPING",[qv]:"ACES_FILMIC_TONE_MAPPING",[jv]:"AGX_TONE_MAPPING",[Zv]:"NEUTRAL_TONE_MAPPING",[Yv]:"CUSTOM_TONE_MAPPING"};function N1(r,t,i,s,l){const c=new aa(t,i,{type:r,depthBuffer:s,stencilBuffer:l}),h=new aa(t,i,{type:Pa,depthBuffer:!1,stencilBuffer:!1}),d=new Pn;d.setAttribute("position",new Tn([-1,3,0,-1,-1,0,3,-1,0],3)),d.setAttribute("uv",new Tn([0,2,0,0,2,0],2));const m=new vE({uniforms:{tDiffuse:{value:null}},vertexShader:`
3909
+ `},l=new Sl(5,5,5),c=new ki({name:"CubemapFromEquirect",uniforms:oo(s.uniforms),vertexShader:s.vertexShader,fragmentShader:s.fragmentShader,side:ti,blending:La});c.uniforms.tEquirect.value=i;const h=new mi(l,c),d=i.minFilter;return i.minFilter===Zs&&(i.minFilter=zn),new DE(1,10,this).update(t,h),i.minFilter=d,h.geometry.dispose(),h.material.dispose(),this}clear(t,i=!0,s=!0,l=!0){const c=t.getRenderTarget();for(let h=0;h<6;h++)t.setRenderTarget(this,h),t.clear(i,s,l);t.setRenderTarget(c)}}function C1(r){let t=new WeakMap,i=new WeakMap,s=null;function l(_,M=!1){return _==null?null:M?h(_):c(_)}function c(_){if(_&&_.isTexture){const M=_.mapping;if(M===Hh||M===Gh)if(t.has(_)){const E=t.get(_).texture;return d(E,_.mapping)}else{const E=_.image;if(E&&E.height>0){const A=new xx(E.height);return A.fromEquirectangularTexture(r,_),t.set(_,A),_.addEventListener("dispose",p),d(A.texture,_.mapping)}else return null}}return _}function h(_){if(_&&_.isTexture){const M=_.mapping,E=M===Hh||M===Gh,A=M===Js||M===ao;if(E||A){let y=i.get(_);const S=y!==void 0?y.texture.pmremVersion:0;if(_.isRenderTargetTexture&&_.pmremVersion!==S)return s===null&&(s=new fv(r)),y=E?s.fromEquirectangular(_,y):s.fromCubemap(_,y),y.texture.pmremVersion=_.pmremVersion,i.set(_,y),y.texture;if(y!==void 0)return y.texture;{const w=_.image;return E&&w&&w.height>0||A&&w&&m(w)?(s===null&&(s=new fv(r)),y=E?s.fromEquirectangular(_):s.fromCubemap(_),y.texture.pmremVersion=_.pmremVersion,i.set(_,y),_.addEventListener("dispose",v),y.texture):null}}}return _}function d(_,M){return M===Hh?_.mapping=Js:M===Gh&&(_.mapping=ao),_}function m(_){let M=0;const E=6;for(let A=0;A<E;A++)_[A]!==void 0&&M++;return M===E}function p(_){const M=_.target;M.removeEventListener("dispose",p);const E=t.get(M);E!==void 0&&(t.delete(M),E.dispose())}function v(_){const M=_.target;M.removeEventListener("dispose",v);const E=i.get(M);E!==void 0&&(i.delete(M),E.dispose())}function g(){t=new WeakMap,i=new WeakMap,s!==null&&(s.dispose(),s=null)}return{get:l,dispose:g}}function w1(r){const t={};function i(s){if(t[s]!==void 0)return t[s];const l=r.getExtension(s);return t[s]=l,l}return{has:function(s){return i(s)!==null},init:function(){i("EXT_color_buffer_float"),i("WEBGL_clip_cull_distance"),i("OES_texture_float_linear"),i("EXT_color_buffer_half_float"),i("WEBGL_multisampled_render_to_texture"),i("WEBGL_render_shared_exponent")},get:function(s){const l=i(s);return l===null&&yu("WebGLRenderer: "+s+" extension not supported."),l}}}function D1(r,t,i,s){const l={},c=new WeakMap;function h(g){const _=g.target;_.index!==null&&t.remove(_.index);for(const E in _.attributes)t.remove(_.attributes[E]);_.removeEventListener("dispose",h),delete l[_.id];const M=c.get(_);M&&(t.remove(M),c.delete(_)),s.releaseStatesOfGeometry(_),_.isInstancedBufferGeometry===!0&&delete _._maxInstanceCount,i.memory.geometries--}function d(g,_){return l[_.id]===!0||(_.addEventListener("dispose",h),l[_.id]=!0,i.memory.geometries++),_}function m(g){const _=g.attributes;for(const M in _)t.update(_[M],r.ARRAY_BUFFER)}function p(g){const _=[],M=g.index,E=g.attributes.position;let A=0;if(E===void 0)return;if(M!==null){const w=M.array;A=M.version;for(let D=0,U=w.length;D<U;D+=3){const H=w[D+0],F=w[D+1],I=w[D+2];_.push(H,F,F,I,I,H)}}else{const w=E.array;A=E.version;for(let D=0,U=w.length/3-1;D<U;D+=3){const H=D+0,F=D+1,I=D+2;_.push(H,F,F,I,I,H)}}const y=new(E.count>=65535?hx:fx)(_,1);y.version=A;const S=c.get(g);S&&t.remove(S),c.set(g,y)}function v(g){const _=c.get(g);if(_){const M=g.index;M!==null&&_.version<M.version&&p(g)}else p(g);return c.get(g)}return{get:d,update:m,getWireframeAttribute:v}}function U1(r,t,i){let s;function l(_){s=_}let c,h;function d(_){c=_.type,h=_.bytesPerElement}function m(_,M){r.drawElements(s,M,c,_*h),i.update(M,s,1)}function p(_,M,E){E!==0&&(r.drawElementsInstanced(s,M,c,_*h,E),i.update(M,s,E))}function v(_,M,E){if(E===0)return;t.get("WEBGL_multi_draw").multiDrawElementsWEBGL(s,M,0,c,_,0,E);let y=0;for(let S=0;S<E;S++)y+=M[S];i.update(y,s,1)}function g(_,M,E,A){if(E===0)return;const y=t.get("WEBGL_multi_draw");if(y===null)for(let S=0;S<_.length;S++)p(_[S]/h,M[S],A[S]);else{y.multiDrawElementsInstancedWEBGL(s,M,0,c,_,0,A,0,E);let S=0;for(let w=0;w<E;w++)S+=M[w]*A[w];i.update(S,s,1)}}this.setMode=l,this.setIndex=d,this.render=m,this.renderInstances=p,this.renderMultiDraw=v,this.renderMultiDrawInstances=g}function L1(r){const t={geometries:0,textures:0},i={frame:0,calls:0,triangles:0,points:0,lines:0};function s(c,h,d){switch(i.calls++,h){case r.TRIANGLES:i.triangles+=d*(c/3);break;case r.LINES:i.lines+=d*(c/2);break;case r.LINE_STRIP:i.lines+=d*(c-1);break;case r.LINE_LOOP:i.lines+=d*c;break;case r.POINTS:i.points+=d*c;break;default:Ue("WebGLInfo: Unknown draw mode:",h);break}}function l(){i.calls=0,i.triangles=0,i.points=0,i.lines=0}return{memory:t,render:i,programs:null,autoReset:!0,reset:l,update:s}}function N1(r,t,i){const s=new WeakMap,l=new We;function c(h,d,m){const p=h.morphTargetInfluences,v=d.morphAttributes.position||d.morphAttributes.normal||d.morphAttributes.color,g=v!==void 0?v.length:0;let _=s.get(d);if(_===void 0||_.count!==g){let Q=function(){T.dispose(),s.delete(d),d.removeEventListener("dispose",Q)};var M=Q;_!==void 0&&_.texture.dispose();const E=d.morphAttributes.position!==void 0,A=d.morphAttributes.normal!==void 0,y=d.morphAttributes.color!==void 0,S=d.morphAttributes.position||[],w=d.morphAttributes.normal||[],D=d.morphAttributes.color||[];let U=0;E===!0&&(U=1),A===!0&&(U=2),y===!0&&(U=3);let H=d.attributes.position.count*U,F=1;H>t.maxTextureSize&&(F=Math.ceil(H/t.maxTextureSize),H=t.maxTextureSize);const I=new Float32Array(H*F*4*g),T=new lx(I,H,F,g);T.type=ta,T.needsUpdate=!0;const L=U*4;for(let P=0;P<g;P++){const W=S[P],J=w[P],rt=D[P],et=H*F*4*P;for(let O=0;O<W.count;O++){const B=O*L;E===!0&&(l.fromBufferAttribute(W,O),I[et+B+0]=l.x,I[et+B+1]=l.y,I[et+B+2]=l.z,I[et+B+3]=0),A===!0&&(l.fromBufferAttribute(J,O),I[et+B+4]=l.x,I[et+B+5]=l.y,I[et+B+6]=l.z,I[et+B+7]=0),y===!0&&(l.fromBufferAttribute(rt,O),I[et+B+8]=l.x,I[et+B+9]=l.y,I[et+B+10]=l.z,I[et+B+11]=rt.itemSize===4?l.w:1)}}_={count:g,texture:T,size:new le(H,F)},s.set(d,_),d.addEventListener("dispose",Q)}if(h.isInstancedMesh===!0&&h.morphTexture!==null)m.getUniforms().setValue(r,"morphTexture",h.morphTexture,i);else{let E=0;for(let y=0;y<p.length;y++)E+=p[y];const A=d.morphTargetsRelative?1:1-E;m.getUniforms().setValue(r,"morphTargetBaseInfluence",A),m.getUniforms().setValue(r,"morphTargetInfluences",p)}m.getUniforms().setValue(r,"morphTargetsTexture",_.texture,i),m.getUniforms().setValue(r,"morphTargetsTextureSize",_.size)}return{update:c}}function O1(r,t,i,s,l){let c=new WeakMap;function h(p){const v=l.render.frame,g=p.geometry,_=t.get(p,g);if(c.get(_)!==v&&(t.update(_),c.set(_,v)),p.isInstancedMesh&&(p.hasEventListener("dispose",m)===!1&&p.addEventListener("dispose",m),c.get(p)!==v&&(i.update(p.instanceMatrix,r.ARRAY_BUFFER),p.instanceColor!==null&&i.update(p.instanceColor,r.ARRAY_BUFFER),c.set(p,v))),p.isSkinnedMesh){const M=p.skeleton;c.get(M)!==v&&(M.update(),c.set(M,v))}return _}function d(){c=new WeakMap}function m(p){const v=p.target;v.removeEventListener("dispose",m),s.releaseStatesOfObject(v),i.remove(v.instanceMatrix),v.instanceColor!==null&&i.remove(v.instanceColor)}return{update:h,dispose:d}}const P1={[Xv]:"LINEAR_TONE_MAPPING",[Wv]:"REINHARD_TONE_MAPPING",[qv]:"CINEON_TONE_MAPPING",[Yv]:"ACES_FILMIC_TONE_MAPPING",[Zv]:"AGX_TONE_MAPPING",[Kv]:"NEUTRAL_TONE_MAPPING",[jv]:"CUSTOM_TONE_MAPPING"};function z1(r,t,i,s,l){const c=new ia(t,i,{type:r,depthBuffer:s,stencilBuffer:l}),h=new ia(t,i,{type:Pa,depthBuffer:!1,stencilBuffer:!1}),d=new Ln;d.setAttribute("position",new Mn([-1,3,0,-1,-1,0,3,-1,0],3)),d.setAttribute("uv",new Mn([0,2,0,0,2,0],2));const m=new yE({uniforms:{tDiffuse:{value:null}},vertexShader:`
3910
3910
  precision highp float;
3911
3911
 
3912
3912
  uniform mat4 modelViewMatrix;
@@ -3952,17 +3952,17 @@ void main() {
3952
3952
  #ifdef SRGB_TRANSFER
3953
3953
  gl_FragColor = sRGBTransferOETF( gl_FragColor );
3954
3954
  #endif
3955
- }`,depthTest:!1,depthWrite:!1}),p=new _i(d,m),v=new Tu(-1,1,1,-1,0,1);let g=null,_=null,M=!1,E,A=null,x=[],y=!1;this.setSize=function(w,D){c.setSize(w,D),h.setSize(w,D);for(let U=0;U<x.length;U++){const H=x[U];H.setSize&&H.setSize(w,D)}},this.setEffects=function(w){x=w,y=x.length>0&&x[0].isRenderPass===!0;const D=c.width,U=c.height;for(let H=0;H<x.length;H++){const F=x[H];F.setSize&&F.setSize(D,U)}},this.begin=function(w,D){if(M||w.toneMapping===ia&&x.length===0)return!1;if(A=D,D!==null){const U=D.width,H=D.height;(c.width!==U||c.height!==H)&&this.setSize(U,H)}return y===!1&&w.setRenderTarget(c),E=w.toneMapping,w.toneMapping=ia,!0},this.hasRenderPass=function(){return y},this.end=function(w,D){w.toneMapping=E,M=!0;let U=c,H=h;for(let F=0;F<x.length;F++){const I=x[F];if(I.enabled!==!1&&(I.render(w,H,U,D),I.needsSwap!==!1)){const T=U;U=H,H=T}}if(g!==w.outputColorSpace||_!==w.toneMapping){g=w.outputColorSpace,_=w.toneMapping,m.defines={},Re.getTransfer(g)===Fe&&(m.defines.SRGB_TRANSFER="");const F=L1[_];F&&(m.defines[F]=""),m.needsUpdate=!0}m.uniforms.tDiffuse.value=U.texture,w.setRenderTarget(A),w.render(p,v),A=null,M=!1},this.isCompositing=function(){return M},this.dispose=function(){c.dispose(),h.dispose(),d.dispose(),m.dispose()}}const xx=new jn,dp=new _l(1,1),Sx=new ox,yx=new jM,Mx=new hx,pv=[],mv=[],gv=new Float32Array(16),_v=new Float32Array(9),vv=new Float32Array(4);function lo(r,t,i){const s=r[0];if(s<=0||s>0)return r;const l=t*i;let c=pv[l];if(c===void 0&&(c=new Float32Array(l),pv[l]=c),t!==0){s.toArray(c,0);for(let h=1,d=0;h!==t;++h)d+=i,r[h].toArray(c,d)}return c}function xn(r,t){if(r.length!==t.length)return!1;for(let i=0,s=r.length;i<s;i++)if(r[i]!==t[i])return!1;return!0}function Sn(r,t){for(let i=0,s=t.length;i<s;i++)r[i]=t[i]}function Ru(r,t){let i=mv[t];i===void 0&&(i=new Int32Array(t),mv[t]=i);for(let s=0;s!==t;++s)i[s]=r.allocateTextureUnit();return i}function O1(r,t){const i=this.cache;i[0]!==t&&(r.uniform1f(this.addr,t),i[0]=t)}function P1(r,t){const i=this.cache;if(t.x!==void 0)(i[0]!==t.x||i[1]!==t.y)&&(r.uniform2f(this.addr,t.x,t.y),i[0]=t.x,i[1]=t.y);else{if(xn(i,t))return;r.uniform2fv(this.addr,t),Sn(i,t)}}function z1(r,t){const i=this.cache;if(t.x!==void 0)(i[0]!==t.x||i[1]!==t.y||i[2]!==t.z)&&(r.uniform3f(this.addr,t.x,t.y,t.z),i[0]=t.x,i[1]=t.y,i[2]=t.z);else if(t.r!==void 0)(i[0]!==t.r||i[1]!==t.g||i[2]!==t.b)&&(r.uniform3f(this.addr,t.r,t.g,t.b),i[0]=t.r,i[1]=t.g,i[2]=t.b);else{if(xn(i,t))return;r.uniform3fv(this.addr,t),Sn(i,t)}}function I1(r,t){const i=this.cache;if(t.x!==void 0)(i[0]!==t.x||i[1]!==t.y||i[2]!==t.z||i[3]!==t.w)&&(r.uniform4f(this.addr,t.x,t.y,t.z,t.w),i[0]=t.x,i[1]=t.y,i[2]=t.z,i[3]=t.w);else{if(xn(i,t))return;r.uniform4fv(this.addr,t),Sn(i,t)}}function F1(r,t){const i=this.cache,s=t.elements;if(s===void 0){if(xn(i,t))return;r.uniformMatrix2fv(this.addr,!1,t),Sn(i,t)}else{if(xn(i,s))return;vv.set(s),r.uniformMatrix2fv(this.addr,!1,vv),Sn(i,s)}}function B1(r,t){const i=this.cache,s=t.elements;if(s===void 0){if(xn(i,t))return;r.uniformMatrix3fv(this.addr,!1,t),Sn(i,t)}else{if(xn(i,s))return;_v.set(s),r.uniformMatrix3fv(this.addr,!1,_v),Sn(i,s)}}function H1(r,t){const i=this.cache,s=t.elements;if(s===void 0){if(xn(i,t))return;r.uniformMatrix4fv(this.addr,!1,t),Sn(i,t)}else{if(xn(i,s))return;gv.set(s),r.uniformMatrix4fv(this.addr,!1,gv),Sn(i,s)}}function G1(r,t){const i=this.cache;i[0]!==t&&(r.uniform1i(this.addr,t),i[0]=t)}function V1(r,t){const i=this.cache;if(t.x!==void 0)(i[0]!==t.x||i[1]!==t.y)&&(r.uniform2i(this.addr,t.x,t.y),i[0]=t.x,i[1]=t.y);else{if(xn(i,t))return;r.uniform2iv(this.addr,t),Sn(i,t)}}function k1(r,t){const i=this.cache;if(t.x!==void 0)(i[0]!==t.x||i[1]!==t.y||i[2]!==t.z)&&(r.uniform3i(this.addr,t.x,t.y,t.z),i[0]=t.x,i[1]=t.y,i[2]=t.z);else{if(xn(i,t))return;r.uniform3iv(this.addr,t),Sn(i,t)}}function X1(r,t){const i=this.cache;if(t.x!==void 0)(i[0]!==t.x||i[1]!==t.y||i[2]!==t.z||i[3]!==t.w)&&(r.uniform4i(this.addr,t.x,t.y,t.z,t.w),i[0]=t.x,i[1]=t.y,i[2]=t.z,i[3]=t.w);else{if(xn(i,t))return;r.uniform4iv(this.addr,t),Sn(i,t)}}function W1(r,t){const i=this.cache;i[0]!==t&&(r.uniform1ui(this.addr,t),i[0]=t)}function q1(r,t){const i=this.cache;if(t.x!==void 0)(i[0]!==t.x||i[1]!==t.y)&&(r.uniform2ui(this.addr,t.x,t.y),i[0]=t.x,i[1]=t.y);else{if(xn(i,t))return;r.uniform2uiv(this.addr,t),Sn(i,t)}}function Y1(r,t){const i=this.cache;if(t.x!==void 0)(i[0]!==t.x||i[1]!==t.y||i[2]!==t.z)&&(r.uniform3ui(this.addr,t.x,t.y,t.z),i[0]=t.x,i[1]=t.y,i[2]=t.z);else{if(xn(i,t))return;r.uniform3uiv(this.addr,t),Sn(i,t)}}function j1(r,t){const i=this.cache;if(t.x!==void 0)(i[0]!==t.x||i[1]!==t.y||i[2]!==t.z||i[3]!==t.w)&&(r.uniform4ui(this.addr,t.x,t.y,t.z,t.w),i[0]=t.x,i[1]=t.y,i[2]=t.z,i[3]=t.w);else{if(xn(i,t))return;r.uniform4uiv(this.addr,t),Sn(i,t)}}function Z1(r,t,i){const s=this.cache,l=i.allocateTextureUnit();s[0]!==l&&(r.uniform1i(this.addr,l),s[0]=l);let c;this.type===r.SAMPLER_2D_SHADOW?(dp.compareFunction=i.isReversedDepthBuffer()?Cp:Rp,c=dp):c=xx,i.setTexture2D(t||c,l)}function K1(r,t,i){const s=this.cache,l=i.allocateTextureUnit();s[0]!==l&&(r.uniform1i(this.addr,l),s[0]=l),i.setTexture3D(t||yx,l)}function Q1(r,t,i){const s=this.cache,l=i.allocateTextureUnit();s[0]!==l&&(r.uniform1i(this.addr,l),s[0]=l),i.setTextureCube(t||Mx,l)}function J1(r,t,i){const s=this.cache,l=i.allocateTextureUnit();s[0]!==l&&(r.uniform1i(this.addr,l),s[0]=l),i.setTexture2DArray(t||Sx,l)}function $1(r){switch(r){case 5126:return O1;case 35664:return P1;case 35665:return z1;case 35666:return I1;case 35674:return F1;case 35675:return B1;case 35676:return H1;case 5124:case 35670:return G1;case 35667:case 35671:return V1;case 35668:case 35672:return k1;case 35669:case 35673:return X1;case 5125:return W1;case 36294:return q1;case 36295:return Y1;case 36296:return j1;case 35678:case 36198:case 36298:case 36306:case 35682:return Z1;case 35679:case 36299:case 36307:return K1;case 35680:case 36300:case 36308:case 36293:return Q1;case 36289:case 36303:case 36311:case 36292:return J1}}function tA(r,t){r.uniform1fv(this.addr,t)}function eA(r,t){const i=lo(t,this.size,2);r.uniform2fv(this.addr,i)}function nA(r,t){const i=lo(t,this.size,3);r.uniform3fv(this.addr,i)}function iA(r,t){const i=lo(t,this.size,4);r.uniform4fv(this.addr,i)}function aA(r,t){const i=lo(t,this.size,4);r.uniformMatrix2fv(this.addr,!1,i)}function sA(r,t){const i=lo(t,this.size,9);r.uniformMatrix3fv(this.addr,!1,i)}function rA(r,t){const i=lo(t,this.size,16);r.uniformMatrix4fv(this.addr,!1,i)}function oA(r,t){r.uniform1iv(this.addr,t)}function lA(r,t){r.uniform2iv(this.addr,t)}function cA(r,t){r.uniform3iv(this.addr,t)}function uA(r,t){r.uniform4iv(this.addr,t)}function fA(r,t){r.uniform1uiv(this.addr,t)}function hA(r,t){r.uniform2uiv(this.addr,t)}function dA(r,t){r.uniform3uiv(this.addr,t)}function pA(r,t){r.uniform4uiv(this.addr,t)}function mA(r,t,i){const s=this.cache,l=t.length,c=Ru(i,l);xn(s,c)||(r.uniform1iv(this.addr,c),Sn(s,c));let h;this.type===r.SAMPLER_2D_SHADOW?h=dp:h=xx;for(let d=0;d!==l;++d)i.setTexture2D(t[d]||h,c[d])}function gA(r,t,i){const s=this.cache,l=t.length,c=Ru(i,l);xn(s,c)||(r.uniform1iv(this.addr,c),Sn(s,c));for(let h=0;h!==l;++h)i.setTexture3D(t[h]||yx,c[h])}function _A(r,t,i){const s=this.cache,l=t.length,c=Ru(i,l);xn(s,c)||(r.uniform1iv(this.addr,c),Sn(s,c));for(let h=0;h!==l;++h)i.setTextureCube(t[h]||Mx,c[h])}function vA(r,t,i){const s=this.cache,l=t.length,c=Ru(i,l);xn(s,c)||(r.uniform1iv(this.addr,c),Sn(s,c));for(let h=0;h!==l;++h)i.setTexture2DArray(t[h]||Sx,c[h])}function xA(r){switch(r){case 5126:return tA;case 35664:return eA;case 35665:return nA;case 35666:return iA;case 35674:return aA;case 35675:return sA;case 35676:return rA;case 5124:case 35670:return oA;case 35667:case 35671:return lA;case 35668:case 35672:return cA;case 35669:case 35673:return uA;case 5125:return fA;case 36294:return hA;case 36295:return dA;case 36296:return pA;case 35678:case 36198:case 36298:case 36306:case 35682:return mA;case 35679:case 36299:case 36307:return gA;case 35680:case 36300:case 36308:case 36293:return _A;case 36289:case 36303:case 36311:case 36292:return vA}}class SA{constructor(t,i,s){this.id=t,this.addr=s,this.cache=[],this.type=i.type,this.setValue=$1(i.type)}}class yA{constructor(t,i,s){this.id=t,this.addr=s,this.cache=[],this.type=i.type,this.size=i.size,this.setValue=xA(i.type)}}class MA{constructor(t){this.id=t,this.seq=[],this.map={}}setValue(t,i,s){const l=this.seq;for(let c=0,h=l.length;c!==h;++c){const d=l[c];d.setValue(t,i[d.id],s)}}}const gd=/(\w+)(\])?(\[|\.)?/g;function xv(r,t){r.seq.push(t),r.map[t.id]=t}function EA(r,t,i){const s=r.name,l=s.length;for(gd.lastIndex=0;;){const c=gd.exec(s),h=gd.lastIndex;let d=c[1];const m=c[2]==="]",p=c[3];if(m&&(d=d|0),p===void 0||p==="["&&h+2===l){xv(i,p===void 0?new SA(d,r,t):new yA(d,r,t));break}else{let g=i.map[d];g===void 0&&(g=new MA(d),xv(i,g)),i=g}}}class mu{constructor(t,i){this.seq=[],this.map={};const s=t.getProgramParameter(i,t.ACTIVE_UNIFORMS);for(let h=0;h<s;++h){const d=t.getActiveUniform(i,h),m=t.getUniformLocation(i,d.name);EA(d,m,this)}const l=[],c=[];for(const h of this.seq)h.type===t.SAMPLER_2D_SHADOW||h.type===t.SAMPLER_CUBE_SHADOW||h.type===t.SAMPLER_2D_ARRAY_SHADOW?l.push(h):c.push(h);l.length>0&&(this.seq=l.concat(c))}setValue(t,i,s,l){const c=this.map[i];c!==void 0&&c.setValue(t,s,l)}setOptional(t,i,s){const l=i[s];l!==void 0&&this.setValue(t,s,l)}static upload(t,i,s,l){for(let c=0,h=i.length;c!==h;++c){const d=i[c],m=s[d.id];m.needsUpdate!==!1&&d.setValue(t,m.value,l)}}static seqWithValue(t,i){const s=[];for(let l=0,c=t.length;l!==c;++l){const h=t[l];h.id in i&&s.push(h)}return s}}function Sv(r,t,i){const s=r.createShader(t);return r.shaderSource(s,i),r.compileShader(s),s}const bA=37297;let TA=0;function AA(r,t){const i=r.split(`
3955
+ }`,depthTest:!1,depthWrite:!1}),p=new mi(d,m),v=new Ru(-1,1,1,-1,0,1);let g=null,_=null,M=!1,E,A=null,y=[],S=!1;this.setSize=function(w,D){c.setSize(w,D),h.setSize(w,D);for(let U=0;U<y.length;U++){const H=y[U];H.setSize&&H.setSize(w,D)}},this.setEffects=function(w){y=w,S=y.length>0&&y[0].isRenderPass===!0;const D=c.width,U=c.height;for(let H=0;H<y.length;H++){const F=y[H];F.setSize&&F.setSize(D,U)}},this.begin=function(w,D){if(M||w.toneMapping===na&&y.length===0)return!1;if(A=D,D!==null){const U=D.width,H=D.height;(c.width!==U||c.height!==H)&&this.setSize(U,H)}return S===!1&&w.setRenderTarget(c),E=w.toneMapping,w.toneMapping=na,!0},this.hasRenderPass=function(){return S},this.end=function(w,D){w.toneMapping=E,M=!0;let U=c,H=h;for(let F=0;F<y.length;F++){const I=y[F];if(I.enabled!==!1&&(I.render(w,H,U,D),I.needsSwap!==!1)){const T=U;U=H,H=T}}if(g!==w.outputColorSpace||_!==w.toneMapping){g=w.outputColorSpace,_=w.toneMapping,m.defines={},Re.getTransfer(g)===Fe&&(m.defines.SRGB_TRANSFER="");const F=P1[_];F&&(m.defines[F]=""),m.needsUpdate=!0}m.uniforms.tDiffuse.value=U.texture,w.setRenderTarget(A),w.render(p,v),A=null,M=!1},this.isCompositing=function(){return M},this.dispose=function(){c.dispose(),h.dispose(),d.dispose(),m.dispose()}}const Sx=new Wn,mp=new xl(1,1),yx=new lx,Mx=new QM,Ex=new dx,mv=[],gv=[],_v=new Float32Array(16),vv=new Float32Array(9),xv=new Float32Array(4);function uo(r,t,i){const s=r[0];if(s<=0||s>0)return r;const l=t*i;let c=mv[l];if(c===void 0&&(c=new Float32Array(l),mv[l]=c),t!==0){s.toArray(c,0);for(let h=1,d=0;h!==t;++h)d+=i,r[h].toArray(c,d)}return c}function vn(r,t){if(r.length!==t.length)return!1;for(let i=0,s=r.length;i<s;i++)if(r[i]!==t[i])return!1;return!0}function xn(r,t){for(let i=0,s=t.length;i<s;i++)r[i]=t[i]}function wu(r,t){let i=gv[t];i===void 0&&(i=new Int32Array(t),gv[t]=i);for(let s=0;s!==t;++s)i[s]=r.allocateTextureUnit();return i}function I1(r,t){const i=this.cache;i[0]!==t&&(r.uniform1f(this.addr,t),i[0]=t)}function F1(r,t){const i=this.cache;if(t.x!==void 0)(i[0]!==t.x||i[1]!==t.y)&&(r.uniform2f(this.addr,t.x,t.y),i[0]=t.x,i[1]=t.y);else{if(vn(i,t))return;r.uniform2fv(this.addr,t),xn(i,t)}}function B1(r,t){const i=this.cache;if(t.x!==void 0)(i[0]!==t.x||i[1]!==t.y||i[2]!==t.z)&&(r.uniform3f(this.addr,t.x,t.y,t.z),i[0]=t.x,i[1]=t.y,i[2]=t.z);else if(t.r!==void 0)(i[0]!==t.r||i[1]!==t.g||i[2]!==t.b)&&(r.uniform3f(this.addr,t.r,t.g,t.b),i[0]=t.r,i[1]=t.g,i[2]=t.b);else{if(vn(i,t))return;r.uniform3fv(this.addr,t),xn(i,t)}}function H1(r,t){const i=this.cache;if(t.x!==void 0)(i[0]!==t.x||i[1]!==t.y||i[2]!==t.z||i[3]!==t.w)&&(r.uniform4f(this.addr,t.x,t.y,t.z,t.w),i[0]=t.x,i[1]=t.y,i[2]=t.z,i[3]=t.w);else{if(vn(i,t))return;r.uniform4fv(this.addr,t),xn(i,t)}}function G1(r,t){const i=this.cache,s=t.elements;if(s===void 0){if(vn(i,t))return;r.uniformMatrix2fv(this.addr,!1,t),xn(i,t)}else{if(vn(i,s))return;xv.set(s),r.uniformMatrix2fv(this.addr,!1,xv),xn(i,s)}}function V1(r,t){const i=this.cache,s=t.elements;if(s===void 0){if(vn(i,t))return;r.uniformMatrix3fv(this.addr,!1,t),xn(i,t)}else{if(vn(i,s))return;vv.set(s),r.uniformMatrix3fv(this.addr,!1,vv),xn(i,s)}}function k1(r,t){const i=this.cache,s=t.elements;if(s===void 0){if(vn(i,t))return;r.uniformMatrix4fv(this.addr,!1,t),xn(i,t)}else{if(vn(i,s))return;_v.set(s),r.uniformMatrix4fv(this.addr,!1,_v),xn(i,s)}}function X1(r,t){const i=this.cache;i[0]!==t&&(r.uniform1i(this.addr,t),i[0]=t)}function W1(r,t){const i=this.cache;if(t.x!==void 0)(i[0]!==t.x||i[1]!==t.y)&&(r.uniform2i(this.addr,t.x,t.y),i[0]=t.x,i[1]=t.y);else{if(vn(i,t))return;r.uniform2iv(this.addr,t),xn(i,t)}}function q1(r,t){const i=this.cache;if(t.x!==void 0)(i[0]!==t.x||i[1]!==t.y||i[2]!==t.z)&&(r.uniform3i(this.addr,t.x,t.y,t.z),i[0]=t.x,i[1]=t.y,i[2]=t.z);else{if(vn(i,t))return;r.uniform3iv(this.addr,t),xn(i,t)}}function Y1(r,t){const i=this.cache;if(t.x!==void 0)(i[0]!==t.x||i[1]!==t.y||i[2]!==t.z||i[3]!==t.w)&&(r.uniform4i(this.addr,t.x,t.y,t.z,t.w),i[0]=t.x,i[1]=t.y,i[2]=t.z,i[3]=t.w);else{if(vn(i,t))return;r.uniform4iv(this.addr,t),xn(i,t)}}function j1(r,t){const i=this.cache;i[0]!==t&&(r.uniform1ui(this.addr,t),i[0]=t)}function Z1(r,t){const i=this.cache;if(t.x!==void 0)(i[0]!==t.x||i[1]!==t.y)&&(r.uniform2ui(this.addr,t.x,t.y),i[0]=t.x,i[1]=t.y);else{if(vn(i,t))return;r.uniform2uiv(this.addr,t),xn(i,t)}}function K1(r,t){const i=this.cache;if(t.x!==void 0)(i[0]!==t.x||i[1]!==t.y||i[2]!==t.z)&&(r.uniform3ui(this.addr,t.x,t.y,t.z),i[0]=t.x,i[1]=t.y,i[2]=t.z);else{if(vn(i,t))return;r.uniform3uiv(this.addr,t),xn(i,t)}}function Q1(r,t){const i=this.cache;if(t.x!==void 0)(i[0]!==t.x||i[1]!==t.y||i[2]!==t.z||i[3]!==t.w)&&(r.uniform4ui(this.addr,t.x,t.y,t.z,t.w),i[0]=t.x,i[1]=t.y,i[2]=t.z,i[3]=t.w);else{if(vn(i,t))return;r.uniform4uiv(this.addr,t),xn(i,t)}}function J1(r,t,i){const s=this.cache,l=i.allocateTextureUnit();s[0]!==l&&(r.uniform1i(this.addr,l),s[0]=l);let c;this.type===r.SAMPLER_2D_SHADOW?(mp.compareFunction=i.isReversedDepthBuffer()?wp:Cp,c=mp):c=Sx,i.setTexture2D(t||c,l)}function $1(r,t,i){const s=this.cache,l=i.allocateTextureUnit();s[0]!==l&&(r.uniform1i(this.addr,l),s[0]=l),i.setTexture3D(t||Mx,l)}function tA(r,t,i){const s=this.cache,l=i.allocateTextureUnit();s[0]!==l&&(r.uniform1i(this.addr,l),s[0]=l),i.setTextureCube(t||Ex,l)}function eA(r,t,i){const s=this.cache,l=i.allocateTextureUnit();s[0]!==l&&(r.uniform1i(this.addr,l),s[0]=l),i.setTexture2DArray(t||yx,l)}function nA(r){switch(r){case 5126:return I1;case 35664:return F1;case 35665:return B1;case 35666:return H1;case 35674:return G1;case 35675:return V1;case 35676:return k1;case 5124:case 35670:return X1;case 35667:case 35671:return W1;case 35668:case 35672:return q1;case 35669:case 35673:return Y1;case 5125:return j1;case 36294:return Z1;case 36295:return K1;case 36296:return Q1;case 35678:case 36198:case 36298:case 36306:case 35682:return J1;case 35679:case 36299:case 36307:return $1;case 35680:case 36300:case 36308:case 36293:return tA;case 36289:case 36303:case 36311:case 36292:return eA}}function iA(r,t){r.uniform1fv(this.addr,t)}function aA(r,t){const i=uo(t,this.size,2);r.uniform2fv(this.addr,i)}function sA(r,t){const i=uo(t,this.size,3);r.uniform3fv(this.addr,i)}function rA(r,t){const i=uo(t,this.size,4);r.uniform4fv(this.addr,i)}function oA(r,t){const i=uo(t,this.size,4);r.uniformMatrix2fv(this.addr,!1,i)}function lA(r,t){const i=uo(t,this.size,9);r.uniformMatrix3fv(this.addr,!1,i)}function cA(r,t){const i=uo(t,this.size,16);r.uniformMatrix4fv(this.addr,!1,i)}function uA(r,t){r.uniform1iv(this.addr,t)}function fA(r,t){r.uniform2iv(this.addr,t)}function hA(r,t){r.uniform3iv(this.addr,t)}function dA(r,t){r.uniform4iv(this.addr,t)}function pA(r,t){r.uniform1uiv(this.addr,t)}function mA(r,t){r.uniform2uiv(this.addr,t)}function gA(r,t){r.uniform3uiv(this.addr,t)}function _A(r,t){r.uniform4uiv(this.addr,t)}function vA(r,t,i){const s=this.cache,l=t.length,c=wu(i,l);vn(s,c)||(r.uniform1iv(this.addr,c),xn(s,c));let h;this.type===r.SAMPLER_2D_SHADOW?h=mp:h=Sx;for(let d=0;d!==l;++d)i.setTexture2D(t[d]||h,c[d])}function xA(r,t,i){const s=this.cache,l=t.length,c=wu(i,l);vn(s,c)||(r.uniform1iv(this.addr,c),xn(s,c));for(let h=0;h!==l;++h)i.setTexture3D(t[h]||Mx,c[h])}function SA(r,t,i){const s=this.cache,l=t.length,c=wu(i,l);vn(s,c)||(r.uniform1iv(this.addr,c),xn(s,c));for(let h=0;h!==l;++h)i.setTextureCube(t[h]||Ex,c[h])}function yA(r,t,i){const s=this.cache,l=t.length,c=wu(i,l);vn(s,c)||(r.uniform1iv(this.addr,c),xn(s,c));for(let h=0;h!==l;++h)i.setTexture2DArray(t[h]||yx,c[h])}function MA(r){switch(r){case 5126:return iA;case 35664:return aA;case 35665:return sA;case 35666:return rA;case 35674:return oA;case 35675:return lA;case 35676:return cA;case 5124:case 35670:return uA;case 35667:case 35671:return fA;case 35668:case 35672:return hA;case 35669:case 35673:return dA;case 5125:return pA;case 36294:return mA;case 36295:return gA;case 36296:return _A;case 35678:case 36198:case 36298:case 36306:case 35682:return vA;case 35679:case 36299:case 36307:return xA;case 35680:case 36300:case 36308:case 36293:return SA;case 36289:case 36303:case 36311:case 36292:return yA}}class EA{constructor(t,i,s){this.id=t,this.addr=s,this.cache=[],this.type=i.type,this.setValue=nA(i.type)}}class bA{constructor(t,i,s){this.id=t,this.addr=s,this.cache=[],this.type=i.type,this.size=i.size,this.setValue=MA(i.type)}}class TA{constructor(t){this.id=t,this.seq=[],this.map={}}setValue(t,i,s){const l=this.seq;for(let c=0,h=l.length;c!==h;++c){const d=l[c];d.setValue(t,i[d.id],s)}}}const vd=/(\w+)(\])?(\[|\.)?/g;function Sv(r,t){r.seq.push(t),r.map[t.id]=t}function AA(r,t,i){const s=r.name,l=s.length;for(vd.lastIndex=0;;){const c=vd.exec(s),h=vd.lastIndex;let d=c[1];const m=c[2]==="]",p=c[3];if(m&&(d=d|0),p===void 0||p==="["&&h+2===l){Sv(i,p===void 0?new EA(d,r,t):new bA(d,r,t));break}else{let g=i.map[d];g===void 0&&(g=new TA(d),Sv(i,g)),i=g}}}class _u{constructor(t,i){this.seq=[],this.map={};const s=t.getProgramParameter(i,t.ACTIVE_UNIFORMS);for(let h=0;h<s;++h){const d=t.getActiveUniform(i,h),m=t.getUniformLocation(i,d.name);AA(d,m,this)}const l=[],c=[];for(const h of this.seq)h.type===t.SAMPLER_2D_SHADOW||h.type===t.SAMPLER_CUBE_SHADOW||h.type===t.SAMPLER_2D_ARRAY_SHADOW?l.push(h):c.push(h);l.length>0&&(this.seq=l.concat(c))}setValue(t,i,s,l){const c=this.map[i];c!==void 0&&c.setValue(t,s,l)}setOptional(t,i,s){const l=i[s];l!==void 0&&this.setValue(t,s,l)}static upload(t,i,s,l){for(let c=0,h=i.length;c!==h;++c){const d=i[c],m=s[d.id];m.needsUpdate!==!1&&d.setValue(t,m.value,l)}}static seqWithValue(t,i){const s=[];for(let l=0,c=t.length;l!==c;++l){const h=t[l];h.id in i&&s.push(h)}return s}}function yv(r,t,i){const s=r.createShader(t);return r.shaderSource(s,i),r.compileShader(s),s}const RA=37297;let CA=0;function wA(r,t){const i=r.split(`
3956
3956
  `),s=[],l=Math.max(t-6,0),c=Math.min(t+6,i.length);for(let h=l;h<c;h++){const d=h+1;s.push(`${d===t?">":" "} ${d}: ${i[h]}`)}return s.join(`
3957
- `)}const yv=new pe;function RA(r){Re._getMatrix(yv,Re.workingColorSpace,r);const t=`mat3( ${yv.elements.map(i=>i.toFixed(4))} )`;switch(Re.getTransfer(r)){case gu:return[t,"LinearTransferOETF"];case Fe:return[t,"sRGBTransferOETF"];default:return ee("WebGLProgram: Unsupported color space: ",r),[t,"LinearTransferOETF"]}}function Mv(r,t,i){const s=r.getShaderParameter(t,r.COMPILE_STATUS),c=(r.getShaderInfoLog(t)||"").trim();if(s&&c==="")return"";const h=/ERROR: 0:(\d+)/.exec(c);if(h){const d=parseInt(h[1]);return i.toUpperCase()+`
3957
+ `)}const Mv=new pe;function DA(r){Re._getMatrix(Mv,Re.workingColorSpace,r);const t=`mat3( ${Mv.elements.map(i=>i.toFixed(4))} )`;switch(Re.getTransfer(r)){case vu:return[t,"LinearTransferOETF"];case Fe:return[t,"sRGBTransferOETF"];default:return ee("WebGLProgram: Unsupported color space: ",r),[t,"LinearTransferOETF"]}}function Ev(r,t,i){const s=r.getShaderParameter(t,r.COMPILE_STATUS),c=(r.getShaderInfoLog(t)||"").trim();if(s&&c==="")return"";const h=/ERROR: 0:(\d+)/.exec(c);if(h){const d=parseInt(h[1]);return i.toUpperCase()+`
3958
3958
 
3959
3959
  `+c+`
3960
3960
 
3961
- `+AA(r.getShaderSource(t),d)}else return c}function CA(r,t){const i=RA(t);return[`vec4 ${r}( vec4 value ) {`,` return ${i[1]}( vec4( value.rgb * ${i[0]}, value.a ) );`,"}"].join(`
3962
- `)}const wA={[kv]:"Linear",[Xv]:"Reinhard",[Wv]:"Cineon",[qv]:"ACESFilmic",[jv]:"AgX",[Zv]:"Neutral",[Yv]:"Custom"};function DA(r,t){const i=wA[t];return i===void 0?(ee("WebGLProgram: Unsupported toneMapping:",t),"vec3 "+r+"( vec3 color ) { return LinearToneMapping( color ); }"):"vec3 "+r+"( vec3 color ) { return "+i+"ToneMapping( color ); }"}const iu=new j;function UA(){Re.getLuminanceCoefficients(iu);const r=iu.x.toFixed(4),t=iu.y.toFixed(4),i=iu.z.toFixed(4);return["float luminance( const in vec3 rgb ) {",` const vec3 weights = vec3( ${r}, ${t}, ${i} );`," return dot( weights, rgb );","}"].join(`
3963
- `)}function LA(r){return[r.extensionClipCullDistance?"#extension GL_ANGLE_clip_cull_distance : require":"",r.extensionMultiDraw?"#extension GL_ANGLE_multi_draw : require":""].filter(cl).join(`
3964
- `)}function NA(r){const t=[];for(const i in r){const s=r[i];s!==!1&&t.push("#define "+i+" "+s)}return t.join(`
3965
- `)}function OA(r,t){const i={},s=r.getProgramParameter(t,r.ACTIVE_ATTRIBUTES);for(let l=0;l<s;l++){const c=r.getActiveAttrib(t,l),h=c.name;let d=1;c.type===r.FLOAT_MAT2&&(d=2),c.type===r.FLOAT_MAT3&&(d=3),c.type===r.FLOAT_MAT4&&(d=4),i[h]={type:c.type,location:r.getAttribLocation(t,h),locationSize:d}}return i}function cl(r){return r!==""}function Ev(r,t){const i=t.numSpotLightShadows+t.numSpotLightMaps-t.numSpotLightShadowsWithMaps;return r.replace(/NUM_DIR_LIGHTS/g,t.numDirLights).replace(/NUM_SPOT_LIGHTS/g,t.numSpotLights).replace(/NUM_SPOT_LIGHT_MAPS/g,t.numSpotLightMaps).replace(/NUM_SPOT_LIGHT_COORDS/g,i).replace(/NUM_RECT_AREA_LIGHTS/g,t.numRectAreaLights).replace(/NUM_POINT_LIGHTS/g,t.numPointLights).replace(/NUM_HEMI_LIGHTS/g,t.numHemiLights).replace(/NUM_DIR_LIGHT_SHADOWS/g,t.numDirLightShadows).replace(/NUM_SPOT_LIGHT_SHADOWS_WITH_MAPS/g,t.numSpotLightShadowsWithMaps).replace(/NUM_SPOT_LIGHT_SHADOWS/g,t.numSpotLightShadows).replace(/NUM_POINT_LIGHT_SHADOWS/g,t.numPointLightShadows)}function bv(r,t){return r.replace(/NUM_CLIPPING_PLANES/g,t.numClippingPlanes).replace(/UNION_CLIPPING_PLANES/g,t.numClippingPlanes-t.numClipIntersection)}const PA=/^[ \t]*#include +<([\w\d./]+)>/gm;function pp(r){return r.replace(PA,IA)}const zA=new Map;function IA(r,t){let i=me[t];if(i===void 0){const s=zA.get(t);if(s!==void 0)i=me[s],ee('WebGLRenderer: Shader chunk "%s" has been deprecated. Use "%s" instead.',t,s);else throw new Error("Can not resolve #include <"+t+">")}return pp(i)}const FA=/#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 Tv(r){return r.replace(FA,BA)}function BA(r,t,i,s){let l="";for(let c=parseInt(t);c<parseInt(i);c++)l+=s.replace(/\[\s*i\s*\]/g,"[ "+c+" ]").replace(/UNROLLED_LOOP_INDEX/g,c);return l}function Av(r){let t=`precision ${r.precision} float;
3961
+ `+wA(r.getShaderSource(t),d)}else return c}function UA(r,t){const i=DA(t);return[`vec4 ${r}( vec4 value ) {`,` return ${i[1]}( vec4( value.rgb * ${i[0]}, value.a ) );`,"}"].join(`
3962
+ `)}const LA={[Xv]:"Linear",[Wv]:"Reinhard",[qv]:"Cineon",[Yv]:"ACESFilmic",[Zv]:"AgX",[Kv]:"Neutral",[jv]:"Custom"};function NA(r,t){const i=LA[t];return i===void 0?(ee("WebGLProgram: Unsupported toneMapping:",t),"vec3 "+r+"( vec3 color ) { return LinearToneMapping( color ); }"):"vec3 "+r+"( vec3 color ) { return "+i+"ToneMapping( color ); }"}const su=new j;function OA(){Re.getLuminanceCoefficients(su);const r=su.x.toFixed(4),t=su.y.toFixed(4),i=su.z.toFixed(4);return["float luminance( const in vec3 rgb ) {",` const vec3 weights = vec3( ${r}, ${t}, ${i} );`," return dot( weights, rgb );","}"].join(`
3963
+ `)}function PA(r){return[r.extensionClipCullDistance?"#extension GL_ANGLE_clip_cull_distance : require":"",r.extensionMultiDraw?"#extension GL_ANGLE_multi_draw : require":""].filter(fl).join(`
3964
+ `)}function zA(r){const t=[];for(const i in r){const s=r[i];s!==!1&&t.push("#define "+i+" "+s)}return t.join(`
3965
+ `)}function IA(r,t){const i={},s=r.getProgramParameter(t,r.ACTIVE_ATTRIBUTES);for(let l=0;l<s;l++){const c=r.getActiveAttrib(t,l),h=c.name;let d=1;c.type===r.FLOAT_MAT2&&(d=2),c.type===r.FLOAT_MAT3&&(d=3),c.type===r.FLOAT_MAT4&&(d=4),i[h]={type:c.type,location:r.getAttribLocation(t,h),locationSize:d}}return i}function fl(r){return r!==""}function bv(r,t){const i=t.numSpotLightShadows+t.numSpotLightMaps-t.numSpotLightShadowsWithMaps;return r.replace(/NUM_DIR_LIGHTS/g,t.numDirLights).replace(/NUM_SPOT_LIGHTS/g,t.numSpotLights).replace(/NUM_SPOT_LIGHT_MAPS/g,t.numSpotLightMaps).replace(/NUM_SPOT_LIGHT_COORDS/g,i).replace(/NUM_RECT_AREA_LIGHTS/g,t.numRectAreaLights).replace(/NUM_POINT_LIGHTS/g,t.numPointLights).replace(/NUM_HEMI_LIGHTS/g,t.numHemiLights).replace(/NUM_DIR_LIGHT_SHADOWS/g,t.numDirLightShadows).replace(/NUM_SPOT_LIGHT_SHADOWS_WITH_MAPS/g,t.numSpotLightShadowsWithMaps).replace(/NUM_SPOT_LIGHT_SHADOWS/g,t.numSpotLightShadows).replace(/NUM_POINT_LIGHT_SHADOWS/g,t.numPointLightShadows)}function Tv(r,t){return r.replace(/NUM_CLIPPING_PLANES/g,t.numClippingPlanes).replace(/UNION_CLIPPING_PLANES/g,t.numClippingPlanes-t.numClipIntersection)}const FA=/^[ \t]*#include +<([\w\d./]+)>/gm;function gp(r){return r.replace(FA,HA)}const BA=new Map;function HA(r,t){let i=me[t];if(i===void 0){const s=BA.get(t);if(s!==void 0)i=me[s],ee('WebGLRenderer: Shader chunk "%s" has been deprecated. Use "%s" instead.',t,s);else throw new Error("Can not resolve #include <"+t+">")}return gp(i)}const GA=/#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 Av(r){return r.replace(GA,VA)}function VA(r,t,i,s){let l="";for(let c=parseInt(t);c<parseInt(i);c++)l+=s.replace(/\[\s*i\s*\]/g,"[ "+c+" ]").replace(/UNROLLED_LOOP_INDEX/g,c);return l}function Rv(r){let t=`precision ${r.precision} float;
3966
3966
  precision ${r.precision} int;
3967
3967
  precision ${r.precision} sampler2D;
3968
3968
  precision ${r.precision} samplerCube;
@@ -3982,30 +3982,30 @@ void main() {
3982
3982
  `;return r.precision==="highp"?t+=`
3983
3983
  #define HIGH_PRECISION`:r.precision==="mediump"?t+=`
3984
3984
  #define MEDIUM_PRECISION`:r.precision==="lowp"&&(t+=`
3985
- #define LOW_PRECISION`),t}const HA={[uu]:"SHADOWMAP_TYPE_PCF",[ll]:"SHADOWMAP_TYPE_VSM"};function GA(r){return HA[r.shadowMapType]||"SHADOWMAP_TYPE_BASIC"}const VA={[Qs]:"ENVMAP_TYPE_CUBE",[no]:"ENVMAP_TYPE_CUBE",[Eu]:"ENVMAP_TYPE_CUBE_UV"};function kA(r){return r.envMap===!1?"ENVMAP_TYPE_CUBE":VA[r.envMapMode]||"ENVMAP_TYPE_CUBE"}const XA={[no]:"ENVMAP_MODE_REFRACTION"};function WA(r){return r.envMap===!1?"ENVMAP_MODE_REFLECTION":XA[r.envMapMode]||"ENVMAP_MODE_REFLECTION"}const qA={[Sp]:"ENVMAP_BLENDING_MULTIPLY",[hM]:"ENVMAP_BLENDING_MIX",[dM]:"ENVMAP_BLENDING_ADD"};function YA(r){return r.envMap===!1?"ENVMAP_BLENDING_NONE":qA[r.combine]||"ENVMAP_BLENDING_NONE"}function jA(r){const t=r.envMapCubeUVHeight;if(t===null)return null;const i=Math.log2(t)-2,s=1/t;return{texelWidth:1/(3*Math.max(Math.pow(2,i),112)),texelHeight:s,maxMip:i}}function ZA(r,t,i,s){const l=r.getContext(),c=i.defines;let h=i.vertexShader,d=i.fragmentShader;const m=GA(i),p=kA(i),v=WA(i),g=YA(i),_=jA(i),M=LA(i),E=NA(c),A=l.createProgram();let x,y,w=i.glslVersion?"#version "+i.glslVersion+`
3986
- `:"";i.isRawShaderMaterial?(x=["#define SHADER_TYPE "+i.shaderType,"#define SHADER_NAME "+i.shaderName,E].filter(cl).join(`
3987
- `),x.length>0&&(x+=`
3988
- `),y=["#define SHADER_TYPE "+i.shaderType,"#define SHADER_NAME "+i.shaderName,E].filter(cl).join(`
3985
+ #define LOW_PRECISION`),t}const kA={[hu]:"SHADOWMAP_TYPE_PCF",[ul]:"SHADOWMAP_TYPE_VSM"};function XA(r){return kA[r.shadowMapType]||"SHADOWMAP_TYPE_BASIC"}const WA={[Js]:"ENVMAP_TYPE_CUBE",[ao]:"ENVMAP_TYPE_CUBE",[Tu]:"ENVMAP_TYPE_CUBE_UV"};function qA(r){return r.envMap===!1?"ENVMAP_TYPE_CUBE":WA[r.envMapMode]||"ENVMAP_TYPE_CUBE"}const YA={[ao]:"ENVMAP_MODE_REFRACTION"};function jA(r){return r.envMap===!1?"ENVMAP_MODE_REFLECTION":YA[r.envMapMode]||"ENVMAP_MODE_REFLECTION"}const ZA={[yp]:"ENVMAP_BLENDING_MULTIPLY",[mM]:"ENVMAP_BLENDING_MIX",[gM]:"ENVMAP_BLENDING_ADD"};function KA(r){return r.envMap===!1?"ENVMAP_BLENDING_NONE":ZA[r.combine]||"ENVMAP_BLENDING_NONE"}function QA(r){const t=r.envMapCubeUVHeight;if(t===null)return null;const i=Math.log2(t)-2,s=1/t;return{texelWidth:1/(3*Math.max(Math.pow(2,i),112)),texelHeight:s,maxMip:i}}function JA(r,t,i,s){const l=r.getContext(),c=i.defines;let h=i.vertexShader,d=i.fragmentShader;const m=XA(i),p=qA(i),v=jA(i),g=KA(i),_=QA(i),M=PA(i),E=zA(c),A=l.createProgram();let y,S,w=i.glslVersion?"#version "+i.glslVersion+`
3986
+ `:"";i.isRawShaderMaterial?(y=["#define SHADER_TYPE "+i.shaderType,"#define SHADER_NAME "+i.shaderName,E].filter(fl).join(`
3989
3987
  `),y.length>0&&(y+=`
3990
- `)):(x=[Av(i),"#define SHADER_TYPE "+i.shaderType,"#define SHADER_NAME "+i.shaderName,E,i.extensionClipCullDistance?"#define USE_CLIP_DISTANCE":"",i.batching?"#define USE_BATCHING":"",i.batchingColor?"#define USE_BATCHING_COLOR":"",i.instancing?"#define USE_INSTANCING":"",i.instancingColor?"#define USE_INSTANCING_COLOR":"",i.instancingMorph?"#define USE_INSTANCING_MORPH":"",i.useFog&&i.fog?"#define USE_FOG":"",i.useFog&&i.fogExp2?"#define FOG_EXP2":"",i.map?"#define USE_MAP":"",i.envMap?"#define USE_ENVMAP":"",i.envMap?"#define "+v:"",i.lightMap?"#define USE_LIGHTMAP":"",i.aoMap?"#define USE_AOMAP":"",i.bumpMap?"#define USE_BUMPMAP":"",i.normalMap?"#define USE_NORMALMAP":"",i.normalMapObjectSpace?"#define USE_NORMALMAP_OBJECTSPACE":"",i.normalMapTangentSpace?"#define USE_NORMALMAP_TANGENTSPACE":"",i.displacementMap?"#define USE_DISPLACEMENTMAP":"",i.emissiveMap?"#define USE_EMISSIVEMAP":"",i.anisotropy?"#define USE_ANISOTROPY":"",i.anisotropyMap?"#define USE_ANISOTROPYMAP":"",i.clearcoatMap?"#define USE_CLEARCOATMAP":"",i.clearcoatRoughnessMap?"#define USE_CLEARCOAT_ROUGHNESSMAP":"",i.clearcoatNormalMap?"#define USE_CLEARCOAT_NORMALMAP":"",i.iridescenceMap?"#define USE_IRIDESCENCEMAP":"",i.iridescenceThicknessMap?"#define USE_IRIDESCENCE_THICKNESSMAP":"",i.specularMap?"#define USE_SPECULARMAP":"",i.specularColorMap?"#define USE_SPECULAR_COLORMAP":"",i.specularIntensityMap?"#define USE_SPECULAR_INTENSITYMAP":"",i.roughnessMap?"#define USE_ROUGHNESSMAP":"",i.metalnessMap?"#define USE_METALNESSMAP":"",i.alphaMap?"#define USE_ALPHAMAP":"",i.alphaHash?"#define USE_ALPHAHASH":"",i.transmission?"#define USE_TRANSMISSION":"",i.transmissionMap?"#define USE_TRANSMISSIONMAP":"",i.thicknessMap?"#define USE_THICKNESSMAP":"",i.sheenColorMap?"#define USE_SHEEN_COLORMAP":"",i.sheenRoughnessMap?"#define USE_SHEEN_ROUGHNESSMAP":"",i.mapUv?"#define MAP_UV "+i.mapUv:"",i.alphaMapUv?"#define ALPHAMAP_UV "+i.alphaMapUv:"",i.lightMapUv?"#define LIGHTMAP_UV "+i.lightMapUv:"",i.aoMapUv?"#define AOMAP_UV "+i.aoMapUv:"",i.emissiveMapUv?"#define EMISSIVEMAP_UV "+i.emissiveMapUv:"",i.bumpMapUv?"#define BUMPMAP_UV "+i.bumpMapUv:"",i.normalMapUv?"#define NORMALMAP_UV "+i.normalMapUv:"",i.displacementMapUv?"#define DISPLACEMENTMAP_UV "+i.displacementMapUv:"",i.metalnessMapUv?"#define METALNESSMAP_UV "+i.metalnessMapUv:"",i.roughnessMapUv?"#define ROUGHNESSMAP_UV "+i.roughnessMapUv:"",i.anisotropyMapUv?"#define ANISOTROPYMAP_UV "+i.anisotropyMapUv:"",i.clearcoatMapUv?"#define CLEARCOATMAP_UV "+i.clearcoatMapUv:"",i.clearcoatNormalMapUv?"#define CLEARCOAT_NORMALMAP_UV "+i.clearcoatNormalMapUv:"",i.clearcoatRoughnessMapUv?"#define CLEARCOAT_ROUGHNESSMAP_UV "+i.clearcoatRoughnessMapUv:"",i.iridescenceMapUv?"#define IRIDESCENCEMAP_UV "+i.iridescenceMapUv:"",i.iridescenceThicknessMapUv?"#define IRIDESCENCE_THICKNESSMAP_UV "+i.iridescenceThicknessMapUv:"",i.sheenColorMapUv?"#define SHEEN_COLORMAP_UV "+i.sheenColorMapUv:"",i.sheenRoughnessMapUv?"#define SHEEN_ROUGHNESSMAP_UV "+i.sheenRoughnessMapUv:"",i.specularMapUv?"#define SPECULARMAP_UV "+i.specularMapUv:"",i.specularColorMapUv?"#define SPECULAR_COLORMAP_UV "+i.specularColorMapUv:"",i.specularIntensityMapUv?"#define SPECULAR_INTENSITYMAP_UV "+i.specularIntensityMapUv:"",i.transmissionMapUv?"#define TRANSMISSIONMAP_UV "+i.transmissionMapUv:"",i.thicknessMapUv?"#define THICKNESSMAP_UV "+i.thicknessMapUv:"",i.vertexTangents&&i.flatShading===!1?"#define USE_TANGENT":"",i.vertexColors?"#define USE_COLOR":"",i.vertexAlphas?"#define USE_COLOR_ALPHA":"",i.vertexUv1s?"#define USE_UV1":"",i.vertexUv2s?"#define USE_UV2":"",i.vertexUv3s?"#define USE_UV3":"",i.pointsUvs?"#define USE_POINTS_UV":"",i.flatShading?"#define FLAT_SHADED":"",i.skinning?"#define USE_SKINNING":"",i.morphTargets?"#define USE_MORPHTARGETS":"",i.morphNormals&&i.flatShading===!1?"#define USE_MORPHNORMALS":"",i.morphColors?"#define USE_MORPHCOLORS":"",i.morphTargetsCount>0?"#define MORPHTARGETS_TEXTURE_STRIDE "+i.morphTextureStride:"",i.morphTargetsCount>0?"#define MORPHTARGETS_COUNT "+i.morphTargetsCount:"",i.doubleSided?"#define DOUBLE_SIDED":"",i.flipSided?"#define FLIP_SIDED":"",i.shadowMapEnabled?"#define USE_SHADOWMAP":"",i.shadowMapEnabled?"#define "+m:"",i.sizeAttenuation?"#define USE_SIZEATTENUATION":"",i.numLightProbes>0?"#define USE_LIGHT_PROBES":"",i.logarithmicDepthBuffer?"#define USE_LOGARITHMIC_DEPTH_BUFFER":"",i.reversedDepthBuffer?"#define USE_REVERSED_DEPTH_BUFFER":"","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","#ifdef USE_INSTANCING_MORPH"," uniform sampler2D morphTexture;","#endif","attribute vec3 position;","attribute vec3 normal;","attribute vec2 uv;","#ifdef USE_UV1"," attribute vec2 uv1;","#endif","#ifdef USE_UV2"," attribute vec2 uv2;","#endif","#ifdef USE_UV3"," attribute vec2 uv3;","#endif","#ifdef USE_TANGENT"," attribute vec4 tangent;","#endif","#if defined( USE_COLOR_ALPHA )"," attribute vec4 color;","#elif defined( USE_COLOR )"," attribute vec3 color;","#endif","#ifdef USE_SKINNING"," attribute vec4 skinIndex;"," attribute vec4 skinWeight;","#endif",`
3991
- `].filter(cl).join(`
3992
- `),y=[Av(i),"#define SHADER_TYPE "+i.shaderType,"#define SHADER_NAME "+i.shaderName,E,i.useFog&&i.fog?"#define USE_FOG":"",i.useFog&&i.fogExp2?"#define FOG_EXP2":"",i.alphaToCoverage?"#define ALPHA_TO_COVERAGE":"",i.map?"#define USE_MAP":"",i.matcap?"#define USE_MATCAP":"",i.envMap?"#define USE_ENVMAP":"",i.envMap?"#define "+p:"",i.envMap?"#define "+v:"",i.envMap?"#define "+g:"",_?"#define CUBEUV_TEXEL_WIDTH "+_.texelWidth:"",_?"#define CUBEUV_TEXEL_HEIGHT "+_.texelHeight:"",_?"#define CUBEUV_MAX_MIP "+_.maxMip+".0":"",i.lightMap?"#define USE_LIGHTMAP":"",i.aoMap?"#define USE_AOMAP":"",i.bumpMap?"#define USE_BUMPMAP":"",i.normalMap?"#define USE_NORMALMAP":"",i.normalMapObjectSpace?"#define USE_NORMALMAP_OBJECTSPACE":"",i.normalMapTangentSpace?"#define USE_NORMALMAP_TANGENTSPACE":"",i.emissiveMap?"#define USE_EMISSIVEMAP":"",i.anisotropy?"#define USE_ANISOTROPY":"",i.anisotropyMap?"#define USE_ANISOTROPYMAP":"",i.clearcoat?"#define USE_CLEARCOAT":"",i.clearcoatMap?"#define USE_CLEARCOATMAP":"",i.clearcoatRoughnessMap?"#define USE_CLEARCOAT_ROUGHNESSMAP":"",i.clearcoatNormalMap?"#define USE_CLEARCOAT_NORMALMAP":"",i.dispersion?"#define USE_DISPERSION":"",i.iridescence?"#define USE_IRIDESCENCE":"",i.iridescenceMap?"#define USE_IRIDESCENCEMAP":"",i.iridescenceThicknessMap?"#define USE_IRIDESCENCE_THICKNESSMAP":"",i.specularMap?"#define USE_SPECULARMAP":"",i.specularColorMap?"#define USE_SPECULAR_COLORMAP":"",i.specularIntensityMap?"#define USE_SPECULAR_INTENSITYMAP":"",i.roughnessMap?"#define USE_ROUGHNESSMAP":"",i.metalnessMap?"#define USE_METALNESSMAP":"",i.alphaMap?"#define USE_ALPHAMAP":"",i.alphaTest?"#define USE_ALPHATEST":"",i.alphaHash?"#define USE_ALPHAHASH":"",i.sheen?"#define USE_SHEEN":"",i.sheenColorMap?"#define USE_SHEEN_COLORMAP":"",i.sheenRoughnessMap?"#define USE_SHEEN_ROUGHNESSMAP":"",i.transmission?"#define USE_TRANSMISSION":"",i.transmissionMap?"#define USE_TRANSMISSIONMAP":"",i.thicknessMap?"#define USE_THICKNESSMAP":"",i.vertexTangents&&i.flatShading===!1?"#define USE_TANGENT":"",i.vertexColors||i.instancingColor?"#define USE_COLOR":"",i.vertexAlphas||i.batchingColor?"#define USE_COLOR_ALPHA":"",i.vertexUv1s?"#define USE_UV1":"",i.vertexUv2s?"#define USE_UV2":"",i.vertexUv3s?"#define USE_UV3":"",i.pointsUvs?"#define USE_POINTS_UV":"",i.gradientMap?"#define USE_GRADIENTMAP":"",i.flatShading?"#define FLAT_SHADED":"",i.doubleSided?"#define DOUBLE_SIDED":"",i.flipSided?"#define FLIP_SIDED":"",i.shadowMapEnabled?"#define USE_SHADOWMAP":"",i.shadowMapEnabled?"#define "+m:"",i.premultipliedAlpha?"#define PREMULTIPLIED_ALPHA":"",i.numLightProbes>0?"#define USE_LIGHT_PROBES":"",i.decodeVideoTexture?"#define DECODE_VIDEO_TEXTURE":"",i.decodeVideoTextureEmissive?"#define DECODE_VIDEO_TEXTURE_EMISSIVE":"",i.logarithmicDepthBuffer?"#define USE_LOGARITHMIC_DEPTH_BUFFER":"",i.reversedDepthBuffer?"#define USE_REVERSED_DEPTH_BUFFER":"","uniform mat4 viewMatrix;","uniform vec3 cameraPosition;","uniform bool isOrthographic;",i.toneMapping!==ia?"#define TONE_MAPPING":"",i.toneMapping!==ia?me.tonemapping_pars_fragment:"",i.toneMapping!==ia?DA("toneMapping",i.toneMapping):"",i.dithering?"#define DITHERING":"",i.opaque?"#define OPAQUE":"",me.colorspace_pars_fragment,CA("linearToOutputTexel",i.outputColorSpace),UA(),i.useDepthPacking?"#define DEPTH_PACKING "+i.depthPacking:"",`
3993
- `].filter(cl).join(`
3994
- `)),h=pp(h),h=Ev(h,i),h=bv(h,i),d=pp(d),d=Ev(d,i),d=bv(d,i),h=Tv(h),d=Tv(d),i.isRawShaderMaterial!==!0&&(w=`#version 300 es
3995
- `,x=[M,"#define attribute in","#define varying out","#define texture2D texture"].join(`
3988
+ `),S=["#define SHADER_TYPE "+i.shaderType,"#define SHADER_NAME "+i.shaderName,E].filter(fl).join(`
3989
+ `),S.length>0&&(S+=`
3990
+ `)):(y=[Rv(i),"#define SHADER_TYPE "+i.shaderType,"#define SHADER_NAME "+i.shaderName,E,i.extensionClipCullDistance?"#define USE_CLIP_DISTANCE":"",i.batching?"#define USE_BATCHING":"",i.batchingColor?"#define USE_BATCHING_COLOR":"",i.instancing?"#define USE_INSTANCING":"",i.instancingColor?"#define USE_INSTANCING_COLOR":"",i.instancingMorph?"#define USE_INSTANCING_MORPH":"",i.useFog&&i.fog?"#define USE_FOG":"",i.useFog&&i.fogExp2?"#define FOG_EXP2":"",i.map?"#define USE_MAP":"",i.envMap?"#define USE_ENVMAP":"",i.envMap?"#define "+v:"",i.lightMap?"#define USE_LIGHTMAP":"",i.aoMap?"#define USE_AOMAP":"",i.bumpMap?"#define USE_BUMPMAP":"",i.normalMap?"#define USE_NORMALMAP":"",i.normalMapObjectSpace?"#define USE_NORMALMAP_OBJECTSPACE":"",i.normalMapTangentSpace?"#define USE_NORMALMAP_TANGENTSPACE":"",i.displacementMap?"#define USE_DISPLACEMENTMAP":"",i.emissiveMap?"#define USE_EMISSIVEMAP":"",i.anisotropy?"#define USE_ANISOTROPY":"",i.anisotropyMap?"#define USE_ANISOTROPYMAP":"",i.clearcoatMap?"#define USE_CLEARCOATMAP":"",i.clearcoatRoughnessMap?"#define USE_CLEARCOAT_ROUGHNESSMAP":"",i.clearcoatNormalMap?"#define USE_CLEARCOAT_NORMALMAP":"",i.iridescenceMap?"#define USE_IRIDESCENCEMAP":"",i.iridescenceThicknessMap?"#define USE_IRIDESCENCE_THICKNESSMAP":"",i.specularMap?"#define USE_SPECULARMAP":"",i.specularColorMap?"#define USE_SPECULAR_COLORMAP":"",i.specularIntensityMap?"#define USE_SPECULAR_INTENSITYMAP":"",i.roughnessMap?"#define USE_ROUGHNESSMAP":"",i.metalnessMap?"#define USE_METALNESSMAP":"",i.alphaMap?"#define USE_ALPHAMAP":"",i.alphaHash?"#define USE_ALPHAHASH":"",i.transmission?"#define USE_TRANSMISSION":"",i.transmissionMap?"#define USE_TRANSMISSIONMAP":"",i.thicknessMap?"#define USE_THICKNESSMAP":"",i.sheenColorMap?"#define USE_SHEEN_COLORMAP":"",i.sheenRoughnessMap?"#define USE_SHEEN_ROUGHNESSMAP":"",i.mapUv?"#define MAP_UV "+i.mapUv:"",i.alphaMapUv?"#define ALPHAMAP_UV "+i.alphaMapUv:"",i.lightMapUv?"#define LIGHTMAP_UV "+i.lightMapUv:"",i.aoMapUv?"#define AOMAP_UV "+i.aoMapUv:"",i.emissiveMapUv?"#define EMISSIVEMAP_UV "+i.emissiveMapUv:"",i.bumpMapUv?"#define BUMPMAP_UV "+i.bumpMapUv:"",i.normalMapUv?"#define NORMALMAP_UV "+i.normalMapUv:"",i.displacementMapUv?"#define DISPLACEMENTMAP_UV "+i.displacementMapUv:"",i.metalnessMapUv?"#define METALNESSMAP_UV "+i.metalnessMapUv:"",i.roughnessMapUv?"#define ROUGHNESSMAP_UV "+i.roughnessMapUv:"",i.anisotropyMapUv?"#define ANISOTROPYMAP_UV "+i.anisotropyMapUv:"",i.clearcoatMapUv?"#define CLEARCOATMAP_UV "+i.clearcoatMapUv:"",i.clearcoatNormalMapUv?"#define CLEARCOAT_NORMALMAP_UV "+i.clearcoatNormalMapUv:"",i.clearcoatRoughnessMapUv?"#define CLEARCOAT_ROUGHNESSMAP_UV "+i.clearcoatRoughnessMapUv:"",i.iridescenceMapUv?"#define IRIDESCENCEMAP_UV "+i.iridescenceMapUv:"",i.iridescenceThicknessMapUv?"#define IRIDESCENCE_THICKNESSMAP_UV "+i.iridescenceThicknessMapUv:"",i.sheenColorMapUv?"#define SHEEN_COLORMAP_UV "+i.sheenColorMapUv:"",i.sheenRoughnessMapUv?"#define SHEEN_ROUGHNESSMAP_UV "+i.sheenRoughnessMapUv:"",i.specularMapUv?"#define SPECULARMAP_UV "+i.specularMapUv:"",i.specularColorMapUv?"#define SPECULAR_COLORMAP_UV "+i.specularColorMapUv:"",i.specularIntensityMapUv?"#define SPECULAR_INTENSITYMAP_UV "+i.specularIntensityMapUv:"",i.transmissionMapUv?"#define TRANSMISSIONMAP_UV "+i.transmissionMapUv:"",i.thicknessMapUv?"#define THICKNESSMAP_UV "+i.thicknessMapUv:"",i.vertexTangents&&i.flatShading===!1?"#define USE_TANGENT":"",i.vertexColors?"#define USE_COLOR":"",i.vertexAlphas?"#define USE_COLOR_ALPHA":"",i.vertexUv1s?"#define USE_UV1":"",i.vertexUv2s?"#define USE_UV2":"",i.vertexUv3s?"#define USE_UV3":"",i.pointsUvs?"#define USE_POINTS_UV":"",i.flatShading?"#define FLAT_SHADED":"",i.skinning?"#define USE_SKINNING":"",i.morphTargets?"#define USE_MORPHTARGETS":"",i.morphNormals&&i.flatShading===!1?"#define USE_MORPHNORMALS":"",i.morphColors?"#define USE_MORPHCOLORS":"",i.morphTargetsCount>0?"#define MORPHTARGETS_TEXTURE_STRIDE "+i.morphTextureStride:"",i.morphTargetsCount>0?"#define MORPHTARGETS_COUNT "+i.morphTargetsCount:"",i.doubleSided?"#define DOUBLE_SIDED":"",i.flipSided?"#define FLIP_SIDED":"",i.shadowMapEnabled?"#define USE_SHADOWMAP":"",i.shadowMapEnabled?"#define "+m:"",i.sizeAttenuation?"#define USE_SIZEATTENUATION":"",i.numLightProbes>0?"#define USE_LIGHT_PROBES":"",i.logarithmicDepthBuffer?"#define USE_LOGARITHMIC_DEPTH_BUFFER":"",i.reversedDepthBuffer?"#define USE_REVERSED_DEPTH_BUFFER":"","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","#ifdef USE_INSTANCING_MORPH"," uniform sampler2D morphTexture;","#endif","attribute vec3 position;","attribute vec3 normal;","attribute vec2 uv;","#ifdef USE_UV1"," attribute vec2 uv1;","#endif","#ifdef USE_UV2"," attribute vec2 uv2;","#endif","#ifdef USE_UV3"," attribute vec2 uv3;","#endif","#ifdef USE_TANGENT"," attribute vec4 tangent;","#endif","#if defined( USE_COLOR_ALPHA )"," attribute vec4 color;","#elif defined( USE_COLOR )"," attribute vec3 color;","#endif","#ifdef USE_SKINNING"," attribute vec4 skinIndex;"," attribute vec4 skinWeight;","#endif",`
3991
+ `].filter(fl).join(`
3992
+ `),S=[Rv(i),"#define SHADER_TYPE "+i.shaderType,"#define SHADER_NAME "+i.shaderName,E,i.useFog&&i.fog?"#define USE_FOG":"",i.useFog&&i.fogExp2?"#define FOG_EXP2":"",i.alphaToCoverage?"#define ALPHA_TO_COVERAGE":"",i.map?"#define USE_MAP":"",i.matcap?"#define USE_MATCAP":"",i.envMap?"#define USE_ENVMAP":"",i.envMap?"#define "+p:"",i.envMap?"#define "+v:"",i.envMap?"#define "+g:"",_?"#define CUBEUV_TEXEL_WIDTH "+_.texelWidth:"",_?"#define CUBEUV_TEXEL_HEIGHT "+_.texelHeight:"",_?"#define CUBEUV_MAX_MIP "+_.maxMip+".0":"",i.lightMap?"#define USE_LIGHTMAP":"",i.aoMap?"#define USE_AOMAP":"",i.bumpMap?"#define USE_BUMPMAP":"",i.normalMap?"#define USE_NORMALMAP":"",i.normalMapObjectSpace?"#define USE_NORMALMAP_OBJECTSPACE":"",i.normalMapTangentSpace?"#define USE_NORMALMAP_TANGENTSPACE":"",i.emissiveMap?"#define USE_EMISSIVEMAP":"",i.anisotropy?"#define USE_ANISOTROPY":"",i.anisotropyMap?"#define USE_ANISOTROPYMAP":"",i.clearcoat?"#define USE_CLEARCOAT":"",i.clearcoatMap?"#define USE_CLEARCOATMAP":"",i.clearcoatRoughnessMap?"#define USE_CLEARCOAT_ROUGHNESSMAP":"",i.clearcoatNormalMap?"#define USE_CLEARCOAT_NORMALMAP":"",i.dispersion?"#define USE_DISPERSION":"",i.iridescence?"#define USE_IRIDESCENCE":"",i.iridescenceMap?"#define USE_IRIDESCENCEMAP":"",i.iridescenceThicknessMap?"#define USE_IRIDESCENCE_THICKNESSMAP":"",i.specularMap?"#define USE_SPECULARMAP":"",i.specularColorMap?"#define USE_SPECULAR_COLORMAP":"",i.specularIntensityMap?"#define USE_SPECULAR_INTENSITYMAP":"",i.roughnessMap?"#define USE_ROUGHNESSMAP":"",i.metalnessMap?"#define USE_METALNESSMAP":"",i.alphaMap?"#define USE_ALPHAMAP":"",i.alphaTest?"#define USE_ALPHATEST":"",i.alphaHash?"#define USE_ALPHAHASH":"",i.sheen?"#define USE_SHEEN":"",i.sheenColorMap?"#define USE_SHEEN_COLORMAP":"",i.sheenRoughnessMap?"#define USE_SHEEN_ROUGHNESSMAP":"",i.transmission?"#define USE_TRANSMISSION":"",i.transmissionMap?"#define USE_TRANSMISSIONMAP":"",i.thicknessMap?"#define USE_THICKNESSMAP":"",i.vertexTangents&&i.flatShading===!1?"#define USE_TANGENT":"",i.vertexColors||i.instancingColor?"#define USE_COLOR":"",i.vertexAlphas||i.batchingColor?"#define USE_COLOR_ALPHA":"",i.vertexUv1s?"#define USE_UV1":"",i.vertexUv2s?"#define USE_UV2":"",i.vertexUv3s?"#define USE_UV3":"",i.pointsUvs?"#define USE_POINTS_UV":"",i.gradientMap?"#define USE_GRADIENTMAP":"",i.flatShading?"#define FLAT_SHADED":"",i.doubleSided?"#define DOUBLE_SIDED":"",i.flipSided?"#define FLIP_SIDED":"",i.shadowMapEnabled?"#define USE_SHADOWMAP":"",i.shadowMapEnabled?"#define "+m:"",i.premultipliedAlpha?"#define PREMULTIPLIED_ALPHA":"",i.numLightProbes>0?"#define USE_LIGHT_PROBES":"",i.decodeVideoTexture?"#define DECODE_VIDEO_TEXTURE":"",i.decodeVideoTextureEmissive?"#define DECODE_VIDEO_TEXTURE_EMISSIVE":"",i.logarithmicDepthBuffer?"#define USE_LOGARITHMIC_DEPTH_BUFFER":"",i.reversedDepthBuffer?"#define USE_REVERSED_DEPTH_BUFFER":"","uniform mat4 viewMatrix;","uniform vec3 cameraPosition;","uniform bool isOrthographic;",i.toneMapping!==na?"#define TONE_MAPPING":"",i.toneMapping!==na?me.tonemapping_pars_fragment:"",i.toneMapping!==na?NA("toneMapping",i.toneMapping):"",i.dithering?"#define DITHERING":"",i.opaque?"#define OPAQUE":"",me.colorspace_pars_fragment,UA("linearToOutputTexel",i.outputColorSpace),OA(),i.useDepthPacking?"#define DEPTH_PACKING "+i.depthPacking:"",`
3993
+ `].filter(fl).join(`
3994
+ `)),h=gp(h),h=bv(h,i),h=Tv(h,i),d=gp(d),d=bv(d,i),d=Tv(d,i),h=Av(h),d=Av(d),i.isRawShaderMaterial!==!0&&(w=`#version 300 es
3995
+ `,y=[M,"#define attribute in","#define varying out","#define texture2D texture"].join(`
3996
3996
  `)+`
3997
- `+x,y=["#define varying in",i.glslVersion===U_?"":"layout(location = 0) out highp vec4 pc_fragColor;",i.glslVersion===U_?"":"#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(`
3997
+ `+y,S=["#define varying in",i.glslVersion===L_?"":"layout(location = 0) out highp vec4 pc_fragColor;",i.glslVersion===L_?"":"#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(`
3998
3998
  `)+`
3999
- `+y);const D=w+x+h,U=w+y+d,H=Sv(l,l.VERTEX_SHADER,D),F=Sv(l,l.FRAGMENT_SHADER,U);l.attachShader(A,H),l.attachShader(A,F),i.index0AttributeName!==void 0?l.bindAttribLocation(A,0,i.index0AttributeName):i.morphTargets===!0&&l.bindAttribLocation(A,0,"position"),l.linkProgram(A);function I(P){if(r.debug.checkShaderErrors){const W=l.getProgramInfoLog(A)||"",J=l.getShaderInfoLog(H)||"",rt=l.getShaderInfoLog(F)||"",et=W.trim(),O=J.trim(),B=rt.trim();let at=!0,$=!0;if(l.getProgramParameter(A,l.LINK_STATUS)===!1)if(at=!1,typeof r.debug.onShaderError=="function")r.debug.onShaderError(l,A,H,F);else{const lt=Mv(l,H,"vertex"),N=Mv(l,F,"fragment");Ue("THREE.WebGLProgram: Shader Error "+l.getError()+" - VALIDATE_STATUS "+l.getProgramParameter(A,l.VALIDATE_STATUS)+`
3999
+ `+S);const D=w+y+h,U=w+S+d,H=yv(l,l.VERTEX_SHADER,D),F=yv(l,l.FRAGMENT_SHADER,U);l.attachShader(A,H),l.attachShader(A,F),i.index0AttributeName!==void 0?l.bindAttribLocation(A,0,i.index0AttributeName):i.morphTargets===!0&&l.bindAttribLocation(A,0,"position"),l.linkProgram(A);function I(P){if(r.debug.checkShaderErrors){const W=l.getProgramInfoLog(A)||"",J=l.getShaderInfoLog(H)||"",rt=l.getShaderInfoLog(F)||"",et=W.trim(),O=J.trim(),B=rt.trim();let at=!0,$=!0;if(l.getProgramParameter(A,l.LINK_STATUS)===!1)if(at=!1,typeof r.debug.onShaderError=="function")r.debug.onShaderError(l,A,H,F);else{const lt=Ev(l,H,"vertex"),N=Ev(l,F,"fragment");Ue("THREE.WebGLProgram: Shader Error "+l.getError()+" - VALIDATE_STATUS "+l.getProgramParameter(A,l.VALIDATE_STATUS)+`
4000
4000
 
4001
4001
  Material Name: `+P.name+`
4002
4002
  Material Type: `+P.type+`
4003
4003
 
4004
4004
  Program Info Log: `+et+`
4005
4005
  `+lt+`
4006
- `+N)}else et!==""?ee("WebGLProgram: Program Info Log:",et):(O===""||B==="")&&($=!1);$&&(P.diagnostics={runnable:at,programLog:et,vertexShader:{log:O,prefix:x},fragmentShader:{log:B,prefix:y}})}l.deleteShader(H),l.deleteShader(F),T=new mu(l,A),L=OA(l,A)}let T;this.getUniforms=function(){return T===void 0&&I(this),T};let L;this.getAttributes=function(){return L===void 0&&I(this),L};let Q=i.rendererExtensionParallelShaderCompile===!1;return this.isReady=function(){return Q===!1&&(Q=l.getProgramParameter(A,bA)),Q},this.destroy=function(){s.releaseStatesOfProgram(this),l.deleteProgram(A),this.program=void 0},this.type=i.shaderType,this.name=i.shaderName,this.id=TA++,this.cacheKey=t,this.usedTimes=1,this.program=A,this.vertexShader=H,this.fragmentShader=F,this}let KA=0;class QA{constructor(){this.shaderCache=new Map,this.materialCache=new Map}update(t){const i=t.vertexShader,s=t.fragmentShader,l=this._getShaderStage(i),c=this._getShaderStage(s),h=this._getShaderCacheForMaterial(t);return h.has(l)===!1&&(h.add(l),l.usedTimes++),h.has(c)===!1&&(h.add(c),c.usedTimes++),this}remove(t){const i=this.materialCache.get(t);for(const s of i)s.usedTimes--,s.usedTimes===0&&this.shaderCache.delete(s.code);return this.materialCache.delete(t),this}getVertexShaderID(t){return this._getShaderStage(t.vertexShader).id}getFragmentShaderID(t){return this._getShaderStage(t.fragmentShader).id}dispose(){this.shaderCache.clear(),this.materialCache.clear()}_getShaderCacheForMaterial(t){const i=this.materialCache;let s=i.get(t);return s===void 0&&(s=new Set,i.set(t,s)),s}_getShaderStage(t){const i=this.shaderCache;let s=i.get(t);return s===void 0&&(s=new JA(t),i.set(t,s)),s}}class JA{constructor(t){this.id=KA++,this.code=t,this.usedTimes=0}}function $A(r,t,i,s,l,c){const h=new lx,d=new QA,m=new Set,p=[],v=new Map,g=s.logarithmicDepthBuffer;let _=s.precision;const M={MeshDepthMaterial:"depth",MeshDistanceMaterial:"distance",MeshNormalMaterial:"normal",MeshBasicMaterial:"basic",MeshLambertMaterial:"lambert",MeshPhongMaterial:"phong",MeshToonMaterial:"toon",MeshStandardMaterial:"physical",MeshPhysicalMaterial:"physical",MeshMatcapMaterial:"matcap",LineBasicMaterial:"basic",LineDashedMaterial:"dashed",PointsMaterial:"points",ShadowMaterial:"shadow",SpriteMaterial:"sprite"};function E(T){return m.add(T),T===0?"uv":`uv${T}`}function A(T,L,Q,P,W){const J=P.fog,rt=W.geometry,et=T.isMeshStandardMaterial||T.isMeshLambertMaterial||T.isMeshPhongMaterial?P.environment:null,O=T.isMeshStandardMaterial||T.isMeshLambertMaterial&&!T.envMap||T.isMeshPhongMaterial&&!T.envMap,B=t.get(T.envMap||et,O),at=B&&B.mapping===Eu?B.image.height:null,$=M[T.type];T.precision!==null&&(_=s.getMaxPrecision(T.precision),_!==T.precision&&ee("WebGLProgram.getParameters:",T.precision,"not supported, using",_,"instead."));const lt=rt.morphAttributes.position||rt.morphAttributes.normal||rt.morphAttributes.color,N=lt!==void 0?lt.length:0;let k=0;rt.morphAttributes.position!==void 0&&(k=1),rt.morphAttributes.normal!==void 0&&(k=2),rt.morphAttributes.color!==void 0&&(k=3);let ut,vt,Rt,Z;if($){const Ae=ni[$];ut=Ae.vertexShader,vt=Ae.fragmentShader}else ut=T.vertexShader,vt=T.fragmentShader,d.update(T),Rt=d.getVertexShaderID(T),Z=d.getFragmentShaderID(T);const dt=r.getRenderTarget(),yt=r.state.buffers.depth.getReversed(),Ut=W.isInstancedMesh===!0,Ft=W.isBatchedMesh===!0,Xt=!!T.map,ge=!!T.matcap,Jt=!!B,_e=!!T.aoMap,Te=!!T.lightMap,ae=!!T.bumpMap,$e=!!T.normalMap,V=!!T.displacementMap,je=!!T.emissiveMap,be=!!T.metalnessMap,Ne=!!T.roughnessMap,Yt=T.anisotropy>0,z=T.clearcoat>0,b=T.dispersion>0,K=T.iridescence>0,_t=T.sheen>0,Mt=T.transmission>0,mt=Yt&&!!T.anisotropyMap,Wt=z&&!!T.clearcoatMap,wt=z&&!!T.clearcoatNormalMap,Kt=z&&!!T.clearcoatRoughnessMap,te=K&&!!T.iridescenceMap,Tt=K&&!!T.iridescenceThicknessMap,Et=_t&&!!T.sheenColorMap,Pt=_t&&!!T.sheenRoughnessMap,Ot=!!T.specularMap,zt=!!T.specularColorMap,fe=!!T.specularIntensityMap,Y=Mt&&!!T.transmissionMap,Ct=Mt&&!!T.thicknessMap,At=!!T.gradientMap,It=!!T.alphaMap,bt=T.alphaTest>0,pt=!!T.alphaHash,Ht=!!T.extensions;let ie=ia;T.toneMapped&&(dt===null||dt.isXRRenderTarget===!0)&&(ie=r.toneMapping);const Pe={shaderID:$,shaderType:T.type,shaderName:T.name,vertexShader:ut,fragmentShader:vt,defines:T.defines,customVertexShaderID:Rt,customFragmentShaderID:Z,isRawShaderMaterial:T.isRawShaderMaterial===!0,glslVersion:T.glslVersion,precision:_,batching:Ft,batchingColor:Ft&&W._colorsTexture!==null,instancing:Ut,instancingColor:Ut&&W.instanceColor!==null,instancingMorph:Ut&&W.morphTexture!==null,outputColorSpace:dt===null?r.outputColorSpace:dt.isXRRenderTarget===!0?dt.texture.colorSpace:ao,alphaToCoverage:!!T.alphaToCoverage,map:Xt,matcap:ge,envMap:Jt,envMapMode:Jt&&B.mapping,envMapCubeUVHeight:at,aoMap:_e,lightMap:Te,bumpMap:ae,normalMap:$e,displacementMap:V,emissiveMap:je,normalMapObjectSpace:$e&&T.normalMapType===gM,normalMapTangentSpace:$e&&T.normalMapType===ax,metalnessMap:be,roughnessMap:Ne,anisotropy:Yt,anisotropyMap:mt,clearcoat:z,clearcoatMap:Wt,clearcoatNormalMap:wt,clearcoatRoughnessMap:Kt,dispersion:b,iridescence:K,iridescenceMap:te,iridescenceThicknessMap:Tt,sheen:_t,sheenColorMap:Et,sheenRoughnessMap:Pt,specularMap:Ot,specularColorMap:zt,specularIntensityMap:fe,transmission:Mt,transmissionMap:Y,thicknessMap:Ct,gradientMap:At,opaque:T.transparent===!1&&T.blending===$r&&T.alphaToCoverage===!1,alphaMap:It,alphaTest:bt,alphaHash:pt,combine:T.combine,mapUv:Xt&&E(T.map.channel),aoMapUv:_e&&E(T.aoMap.channel),lightMapUv:Te&&E(T.lightMap.channel),bumpMapUv:ae&&E(T.bumpMap.channel),normalMapUv:$e&&E(T.normalMap.channel),displacementMapUv:V&&E(T.displacementMap.channel),emissiveMapUv:je&&E(T.emissiveMap.channel),metalnessMapUv:be&&E(T.metalnessMap.channel),roughnessMapUv:Ne&&E(T.roughnessMap.channel),anisotropyMapUv:mt&&E(T.anisotropyMap.channel),clearcoatMapUv:Wt&&E(T.clearcoatMap.channel),clearcoatNormalMapUv:wt&&E(T.clearcoatNormalMap.channel),clearcoatRoughnessMapUv:Kt&&E(T.clearcoatRoughnessMap.channel),iridescenceMapUv:te&&E(T.iridescenceMap.channel),iridescenceThicknessMapUv:Tt&&E(T.iridescenceThicknessMap.channel),sheenColorMapUv:Et&&E(T.sheenColorMap.channel),sheenRoughnessMapUv:Pt&&E(T.sheenRoughnessMap.channel),specularMapUv:Ot&&E(T.specularMap.channel),specularColorMapUv:zt&&E(T.specularColorMap.channel),specularIntensityMapUv:fe&&E(T.specularIntensityMap.channel),transmissionMapUv:Y&&E(T.transmissionMap.channel),thicknessMapUv:Ct&&E(T.thicknessMap.channel),alphaMapUv:It&&E(T.alphaMap.channel),vertexTangents:!!rt.attributes.tangent&&($e||Yt),vertexColors:T.vertexColors,vertexAlphas:T.vertexColors===!0&&!!rt.attributes.color&&rt.attributes.color.itemSize===4,pointsUvs:W.isPoints===!0&&!!rt.attributes.uv&&(Xt||It),fog:!!J,useFog:T.fog===!0,fogExp2:!!J&&J.isFogExp2,flatShading:T.wireframe===!1&&(T.flatShading===!0||rt.attributes.normal===void 0&&$e===!1&&(T.isMeshLambertMaterial||T.isMeshPhongMaterial||T.isMeshStandardMaterial||T.isMeshPhysicalMaterial)),sizeAttenuation:T.sizeAttenuation===!0,logarithmicDepthBuffer:g,reversedDepthBuffer:yt,skinning:W.isSkinnedMesh===!0,morphTargets:rt.morphAttributes.position!==void 0,morphNormals:rt.morphAttributes.normal!==void 0,morphColors:rt.morphAttributes.color!==void 0,morphTargetsCount:N,morphTextureStride:k,numDirLights:L.directional.length,numPointLights:L.point.length,numSpotLights:L.spot.length,numSpotLightMaps:L.spotLightMap.length,numRectAreaLights:L.rectArea.length,numHemiLights:L.hemi.length,numDirLightShadows:L.directionalShadowMap.length,numPointLightShadows:L.pointShadowMap.length,numSpotLightShadows:L.spotShadowMap.length,numSpotLightShadowsWithMaps:L.numSpotLightShadowsWithMaps,numLightProbes:L.numLightProbes,numClippingPlanes:c.numPlanes,numClipIntersection:c.numIntersection,dithering:T.dithering,shadowMapEnabled:r.shadowMap.enabled&&Q.length>0,shadowMapType:r.shadowMap.type,toneMapping:ie,decodeVideoTexture:Xt&&T.map.isVideoTexture===!0&&Re.getTransfer(T.map.colorSpace)===Fe,decodeVideoTextureEmissive:je&&T.emissiveMap.isVideoTexture===!0&&Re.getTransfer(T.emissiveMap.colorSpace)===Fe,premultipliedAlpha:T.premultipliedAlpha,doubleSided:T.side===Hi,flipSided:T.side===ii,useDepthPacking:T.depthPacking>=0,depthPacking:T.depthPacking||0,index0AttributeName:T.index0AttributeName,extensionClipCullDistance:Ht&&T.extensions.clipCullDistance===!0&&i.has("WEBGL_clip_cull_distance"),extensionMultiDraw:(Ht&&T.extensions.multiDraw===!0||Ft)&&i.has("WEBGL_multi_draw"),rendererExtensionParallelShaderCompile:i.has("KHR_parallel_shader_compile"),customProgramCacheKey:T.customProgramCacheKey()};return Pe.vertexUv1s=m.has(1),Pe.vertexUv2s=m.has(2),Pe.vertexUv3s=m.has(3),m.clear(),Pe}function x(T){const L=[];if(T.shaderID?L.push(T.shaderID):(L.push(T.customVertexShaderID),L.push(T.customFragmentShaderID)),T.defines!==void 0)for(const Q in T.defines)L.push(Q),L.push(T.defines[Q]);return T.isRawShaderMaterial===!1&&(y(L,T),w(L,T),L.push(r.outputColorSpace)),L.push(T.customProgramCacheKey),L.join()}function y(T,L){T.push(L.precision),T.push(L.outputColorSpace),T.push(L.envMapMode),T.push(L.envMapCubeUVHeight),T.push(L.mapUv),T.push(L.alphaMapUv),T.push(L.lightMapUv),T.push(L.aoMapUv),T.push(L.bumpMapUv),T.push(L.normalMapUv),T.push(L.displacementMapUv),T.push(L.emissiveMapUv),T.push(L.metalnessMapUv),T.push(L.roughnessMapUv),T.push(L.anisotropyMapUv),T.push(L.clearcoatMapUv),T.push(L.clearcoatNormalMapUv),T.push(L.clearcoatRoughnessMapUv),T.push(L.iridescenceMapUv),T.push(L.iridescenceThicknessMapUv),T.push(L.sheenColorMapUv),T.push(L.sheenRoughnessMapUv),T.push(L.specularMapUv),T.push(L.specularColorMapUv),T.push(L.specularIntensityMapUv),T.push(L.transmissionMapUv),T.push(L.thicknessMapUv),T.push(L.combine),T.push(L.fogExp2),T.push(L.sizeAttenuation),T.push(L.morphTargetsCount),T.push(L.morphAttributeCount),T.push(L.numDirLights),T.push(L.numPointLights),T.push(L.numSpotLights),T.push(L.numSpotLightMaps),T.push(L.numHemiLights),T.push(L.numRectAreaLights),T.push(L.numDirLightShadows),T.push(L.numPointLightShadows),T.push(L.numSpotLightShadows),T.push(L.numSpotLightShadowsWithMaps),T.push(L.numLightProbes),T.push(L.shadowMapType),T.push(L.toneMapping),T.push(L.numClippingPlanes),T.push(L.numClipIntersection),T.push(L.depthPacking)}function w(T,L){h.disableAll(),L.instancing&&h.enable(0),L.instancingColor&&h.enable(1),L.instancingMorph&&h.enable(2),L.matcap&&h.enable(3),L.envMap&&h.enable(4),L.normalMapObjectSpace&&h.enable(5),L.normalMapTangentSpace&&h.enable(6),L.clearcoat&&h.enable(7),L.iridescence&&h.enable(8),L.alphaTest&&h.enable(9),L.vertexColors&&h.enable(10),L.vertexAlphas&&h.enable(11),L.vertexUv1s&&h.enable(12),L.vertexUv2s&&h.enable(13),L.vertexUv3s&&h.enable(14),L.vertexTangents&&h.enable(15),L.anisotropy&&h.enable(16),L.alphaHash&&h.enable(17),L.batching&&h.enable(18),L.dispersion&&h.enable(19),L.batchingColor&&h.enable(20),L.gradientMap&&h.enable(21),T.push(h.mask),h.disableAll(),L.fog&&h.enable(0),L.useFog&&h.enable(1),L.flatShading&&h.enable(2),L.logarithmicDepthBuffer&&h.enable(3),L.reversedDepthBuffer&&h.enable(4),L.skinning&&h.enable(5),L.morphTargets&&h.enable(6),L.morphNormals&&h.enable(7),L.morphColors&&h.enable(8),L.premultipliedAlpha&&h.enable(9),L.shadowMapEnabled&&h.enable(10),L.doubleSided&&h.enable(11),L.flipSided&&h.enable(12),L.useDepthPacking&&h.enable(13),L.dithering&&h.enable(14),L.transmission&&h.enable(15),L.sheen&&h.enable(16),L.opaque&&h.enable(17),L.pointsUvs&&h.enable(18),L.decodeVideoTexture&&h.enable(19),L.decodeVideoTextureEmissive&&h.enable(20),L.alphaToCoverage&&h.enable(21),T.push(h.mask)}function D(T){const L=M[T.type];let Q;if(L){const P=ni[L];Q=Pp.clone(P.uniforms)}else Q=T.uniforms;return Q}function U(T,L){let Q=v.get(L);return Q!==void 0?++Q.usedTimes:(Q=new ZA(r,L,T,l),p.push(Q),v.set(L,Q)),Q}function H(T){if(--T.usedTimes===0){const L=p.indexOf(T);p[L]=p[p.length-1],p.pop(),v.delete(T.cacheKey),T.destroy()}}function F(T){d.remove(T)}function I(){d.dispose()}return{getParameters:A,getProgramCacheKey:x,getUniforms:D,acquireProgram:U,releaseProgram:H,releaseShaderCache:F,programs:p,dispose:I}}function tR(){let r=new WeakMap;function t(h){return r.has(h)}function i(h){let d=r.get(h);return d===void 0&&(d={},r.set(h,d)),d}function s(h){r.delete(h)}function l(h,d,m){r.get(h)[d]=m}function c(){r=new WeakMap}return{has:t,get:i,remove:s,update:l,dispose:c}}function eR(r,t){return r.groupOrder!==t.groupOrder?r.groupOrder-t.groupOrder:r.renderOrder!==t.renderOrder?r.renderOrder-t.renderOrder:r.material.id!==t.material.id?r.material.id-t.material.id:r.materialVariant!==t.materialVariant?r.materialVariant-t.materialVariant:r.z!==t.z?r.z-t.z:r.id-t.id}function Rv(r,t){return r.groupOrder!==t.groupOrder?r.groupOrder-t.groupOrder:r.renderOrder!==t.renderOrder?r.renderOrder-t.renderOrder:r.z!==t.z?t.z-r.z:r.id-t.id}function Cv(){const r=[];let t=0;const i=[],s=[],l=[];function c(){t=0,i.length=0,s.length=0,l.length=0}function h(_){let M=0;return _.isInstancedMesh&&(M+=2),_.isSkinnedMesh&&(M+=1),M}function d(_,M,E,A,x,y){let w=r[t];return w===void 0?(w={id:_.id,object:_,geometry:M,material:E,materialVariant:h(_),groupOrder:A,renderOrder:_.renderOrder,z:x,group:y},r[t]=w):(w.id=_.id,w.object=_,w.geometry=M,w.material=E,w.materialVariant=h(_),w.groupOrder=A,w.renderOrder=_.renderOrder,w.z=x,w.group=y),t++,w}function m(_,M,E,A,x,y){const w=d(_,M,E,A,x,y);E.transmission>0?s.push(w):E.transparent===!0?l.push(w):i.push(w)}function p(_,M,E,A,x,y){const w=d(_,M,E,A,x,y);E.transmission>0?s.unshift(w):E.transparent===!0?l.unshift(w):i.unshift(w)}function v(_,M){i.length>1&&i.sort(_||eR),s.length>1&&s.sort(M||Rv),l.length>1&&l.sort(M||Rv)}function g(){for(let _=t,M=r.length;_<M;_++){const E=r[_];if(E.id===null)break;E.id=null,E.object=null,E.geometry=null,E.material=null,E.group=null}}return{opaque:i,transmissive:s,transparent:l,init:c,push:m,unshift:p,finish:g,sort:v}}function nR(){let r=new WeakMap;function t(s,l){const c=r.get(s);let h;return c===void 0?(h=new Cv,r.set(s,[h])):l>=c.length?(h=new Cv,c.push(h)):h=c[l],h}function i(){r=new WeakMap}return{get:t,dispose:i}}function iR(){const r={};return{get:function(t){if(r[t.id]!==void 0)return r[t.id];let i;switch(t.type){case"DirectionalLight":i={direction:new j,color:new Se};break;case"SpotLight":i={position:new j,direction:new j,color:new Se,distance:0,coneCos:0,penumbraCos:0,decay:0};break;case"PointLight":i={position:new j,color:new Se,distance:0,decay:0};break;case"HemisphereLight":i={direction:new j,skyColor:new Se,groundColor:new Se};break;case"RectAreaLight":i={color:new Se,position:new j,halfWidth:new j,halfHeight:new j};break}return r[t.id]=i,i}}}function aR(){const r={};return{get:function(t){if(r[t.id]!==void 0)return r[t.id];let i;switch(t.type){case"DirectionalLight":i={shadowIntensity:1,shadowBias:0,shadowNormalBias:0,shadowRadius:1,shadowMapSize:new le};break;case"SpotLight":i={shadowIntensity:1,shadowBias:0,shadowNormalBias:0,shadowRadius:1,shadowMapSize:new le};break;case"PointLight":i={shadowIntensity:1,shadowBias:0,shadowNormalBias:0,shadowRadius:1,shadowMapSize:new le,shadowCameraNear:1,shadowCameraFar:1e3};break}return r[t.id]=i,i}}}let sR=0;function rR(r,t){return(t.castShadow?2:0)-(r.castShadow?2:0)+(t.map?1:0)-(r.map?1:0)}function oR(r){const t=new iR,i=aR(),s={version:0,hash:{directionalLength:-1,pointLength:-1,spotLength:-1,rectAreaLength:-1,hemiLength:-1,numDirectionalShadows:-1,numPointShadows:-1,numSpotShadows:-1,numSpotMaps:-1,numLightProbes:-1},ambient:[0,0,0],probe:[],directional:[],directionalShadow:[],directionalShadowMap:[],directionalShadowMatrix:[],spot:[],spotLightMap:[],spotShadow:[],spotShadowMap:[],spotLightMatrix:[],rectArea:[],rectAreaLTC1:null,rectAreaLTC2:null,point:[],pointShadow:[],pointShadowMap:[],pointShadowMatrix:[],hemi:[],numSpotLightShadowsWithMaps:0,numLightProbes:0};for(let p=0;p<9;p++)s.probe.push(new j);const l=new j,c=new Je,h=new Je;function d(p){let v=0,g=0,_=0;for(let L=0;L<9;L++)s.probe[L].set(0,0,0);let M=0,E=0,A=0,x=0,y=0,w=0,D=0,U=0,H=0,F=0,I=0;p.sort(rR);for(let L=0,Q=p.length;L<Q;L++){const P=p[L],W=P.color,J=P.intensity,rt=P.distance;let et=null;if(P.shadow&&P.shadow.map&&(P.shadow.map.texture.format===io?et=P.shadow.map.texture:et=P.shadow.map.depthTexture||P.shadow.map.texture),P.isAmbientLight)v+=W.r*J,g+=W.g*J,_+=W.b*J;else if(P.isLightProbe){for(let O=0;O<9;O++)s.probe[O].addScaledVector(P.sh.coefficients[O],J);I++}else if(P.isDirectionalLight){const O=t.get(P);if(O.color.copy(P.color).multiplyScalar(P.intensity),P.castShadow){const B=P.shadow,at=i.get(P);at.shadowIntensity=B.intensity,at.shadowBias=B.bias,at.shadowNormalBias=B.normalBias,at.shadowRadius=B.radius,at.shadowMapSize=B.mapSize,s.directionalShadow[M]=at,s.directionalShadowMap[M]=et,s.directionalShadowMatrix[M]=P.shadow.matrix,w++}s.directional[M]=O,M++}else if(P.isSpotLight){const O=t.get(P);O.position.setFromMatrixPosition(P.matrixWorld),O.color.copy(W).multiplyScalar(J),O.distance=rt,O.coneCos=Math.cos(P.angle),O.penumbraCos=Math.cos(P.angle*(1-P.penumbra)),O.decay=P.decay,s.spot[A]=O;const B=P.shadow;if(P.map&&(s.spotLightMap[H]=P.map,H++,B.updateMatrices(P),P.castShadow&&F++),s.spotLightMatrix[A]=B.matrix,P.castShadow){const at=i.get(P);at.shadowIntensity=B.intensity,at.shadowBias=B.bias,at.shadowNormalBias=B.normalBias,at.shadowRadius=B.radius,at.shadowMapSize=B.mapSize,s.spotShadow[A]=at,s.spotShadowMap[A]=et,U++}A++}else if(P.isRectAreaLight){const O=t.get(P);O.color.copy(W).multiplyScalar(J),O.halfWidth.set(P.width*.5,0,0),O.halfHeight.set(0,P.height*.5,0),s.rectArea[x]=O,x++}else if(P.isPointLight){const O=t.get(P);if(O.color.copy(P.color).multiplyScalar(P.intensity),O.distance=P.distance,O.decay=P.decay,P.castShadow){const B=P.shadow,at=i.get(P);at.shadowIntensity=B.intensity,at.shadowBias=B.bias,at.shadowNormalBias=B.normalBias,at.shadowRadius=B.radius,at.shadowMapSize=B.mapSize,at.shadowCameraNear=B.camera.near,at.shadowCameraFar=B.camera.far,s.pointShadow[E]=at,s.pointShadowMap[E]=et,s.pointShadowMatrix[E]=P.shadow.matrix,D++}s.point[E]=O,E++}else if(P.isHemisphereLight){const O=t.get(P);O.skyColor.copy(P.color).multiplyScalar(J),O.groundColor.copy(P.groundColor).multiplyScalar(J),s.hemi[y]=O,y++}}x>0&&(r.has("OES_texture_float_linear")===!0?(s.rectAreaLTC1=Lt.LTC_FLOAT_1,s.rectAreaLTC2=Lt.LTC_FLOAT_2):(s.rectAreaLTC1=Lt.LTC_HALF_1,s.rectAreaLTC2=Lt.LTC_HALF_2)),s.ambient[0]=v,s.ambient[1]=g,s.ambient[2]=_;const T=s.hash;(T.directionalLength!==M||T.pointLength!==E||T.spotLength!==A||T.rectAreaLength!==x||T.hemiLength!==y||T.numDirectionalShadows!==w||T.numPointShadows!==D||T.numSpotShadows!==U||T.numSpotMaps!==H||T.numLightProbes!==I)&&(s.directional.length=M,s.spot.length=A,s.rectArea.length=x,s.point.length=E,s.hemi.length=y,s.directionalShadow.length=w,s.directionalShadowMap.length=w,s.pointShadow.length=D,s.pointShadowMap.length=D,s.spotShadow.length=U,s.spotShadowMap.length=U,s.directionalShadowMatrix.length=w,s.pointShadowMatrix.length=D,s.spotLightMatrix.length=U+H-F,s.spotLightMap.length=H,s.numSpotLightShadowsWithMaps=F,s.numLightProbes=I,T.directionalLength=M,T.pointLength=E,T.spotLength=A,T.rectAreaLength=x,T.hemiLength=y,T.numDirectionalShadows=w,T.numPointShadows=D,T.numSpotShadows=U,T.numSpotMaps=H,T.numLightProbes=I,s.version=sR++)}function m(p,v){let g=0,_=0,M=0,E=0,A=0;const x=v.matrixWorldInverse;for(let y=0,w=p.length;y<w;y++){const D=p[y];if(D.isDirectionalLight){const U=s.directional[g];U.direction.setFromMatrixPosition(D.matrixWorld),l.setFromMatrixPosition(D.target.matrixWorld),U.direction.sub(l),U.direction.transformDirection(x),g++}else if(D.isSpotLight){const U=s.spot[M];U.position.setFromMatrixPosition(D.matrixWorld),U.position.applyMatrix4(x),U.direction.setFromMatrixPosition(D.matrixWorld),l.setFromMatrixPosition(D.target.matrixWorld),U.direction.sub(l),U.direction.transformDirection(x),M++}else if(D.isRectAreaLight){const U=s.rectArea[E];U.position.setFromMatrixPosition(D.matrixWorld),U.position.applyMatrix4(x),h.identity(),c.copy(D.matrixWorld),c.premultiply(x),h.extractRotation(c),U.halfWidth.set(D.width*.5,0,0),U.halfHeight.set(0,D.height*.5,0),U.halfWidth.applyMatrix4(h),U.halfHeight.applyMatrix4(h),E++}else if(D.isPointLight){const U=s.point[_];U.position.setFromMatrixPosition(D.matrixWorld),U.position.applyMatrix4(x),_++}else if(D.isHemisphereLight){const U=s.hemi[A];U.direction.setFromMatrixPosition(D.matrixWorld),U.direction.transformDirection(x),A++}}}return{setup:d,setupView:m,state:s}}function wv(r){const t=new oR(r),i=[],s=[];function l(v){p.camera=v,i.length=0,s.length=0}function c(v){i.push(v)}function h(v){s.push(v)}function d(){t.setup(i)}function m(v){t.setupView(i,v)}const p={lightsArray:i,shadowsArray:s,camera:null,lights:t,transmissionRenderTarget:{}};return{init:l,state:p,setupLights:d,setupLightsView:m,pushLight:c,pushShadow:h}}function lR(r){let t=new WeakMap;function i(l,c=0){const h=t.get(l);let d;return h===void 0?(d=new wv(r),t.set(l,[d])):c>=h.length?(d=new wv(r),h.push(d)):d=h[c],d}function s(){t=new WeakMap}return{get:i,dispose:s}}const cR=`void main() {
4006
+ `+N)}else et!==""?ee("WebGLProgram: Program Info Log:",et):(O===""||B==="")&&($=!1);$&&(P.diagnostics={runnable:at,programLog:et,vertexShader:{log:O,prefix:y},fragmentShader:{log:B,prefix:S}})}l.deleteShader(H),l.deleteShader(F),T=new _u(l,A),L=IA(l,A)}let T;this.getUniforms=function(){return T===void 0&&I(this),T};let L;this.getAttributes=function(){return L===void 0&&I(this),L};let Q=i.rendererExtensionParallelShaderCompile===!1;return this.isReady=function(){return Q===!1&&(Q=l.getProgramParameter(A,RA)),Q},this.destroy=function(){s.releaseStatesOfProgram(this),l.deleteProgram(A),this.program=void 0},this.type=i.shaderType,this.name=i.shaderName,this.id=CA++,this.cacheKey=t,this.usedTimes=1,this.program=A,this.vertexShader=H,this.fragmentShader=F,this}let $A=0;class tR{constructor(){this.shaderCache=new Map,this.materialCache=new Map}update(t){const i=t.vertexShader,s=t.fragmentShader,l=this._getShaderStage(i),c=this._getShaderStage(s),h=this._getShaderCacheForMaterial(t);return h.has(l)===!1&&(h.add(l),l.usedTimes++),h.has(c)===!1&&(h.add(c),c.usedTimes++),this}remove(t){const i=this.materialCache.get(t);for(const s of i)s.usedTimes--,s.usedTimes===0&&this.shaderCache.delete(s.code);return this.materialCache.delete(t),this}getVertexShaderID(t){return this._getShaderStage(t.vertexShader).id}getFragmentShaderID(t){return this._getShaderStage(t.fragmentShader).id}dispose(){this.shaderCache.clear(),this.materialCache.clear()}_getShaderCacheForMaterial(t){const i=this.materialCache;let s=i.get(t);return s===void 0&&(s=new Set,i.set(t,s)),s}_getShaderStage(t){const i=this.shaderCache;let s=i.get(t);return s===void 0&&(s=new eR(t),i.set(t,s)),s}}class eR{constructor(t){this.id=$A++,this.code=t,this.usedTimes=0}}function nR(r,t,i,s,l,c){const h=new cx,d=new tR,m=new Set,p=[],v=new Map,g=s.logarithmicDepthBuffer;let _=s.precision;const M={MeshDepthMaterial:"depth",MeshDistanceMaterial:"distance",MeshNormalMaterial:"normal",MeshBasicMaterial:"basic",MeshLambertMaterial:"lambert",MeshPhongMaterial:"phong",MeshToonMaterial:"toon",MeshStandardMaterial:"physical",MeshPhysicalMaterial:"physical",MeshMatcapMaterial:"matcap",LineBasicMaterial:"basic",LineDashedMaterial:"dashed",PointsMaterial:"points",ShadowMaterial:"shadow",SpriteMaterial:"sprite"};function E(T){return m.add(T),T===0?"uv":`uv${T}`}function A(T,L,Q,P,W){const J=P.fog,rt=W.geometry,et=T.isMeshStandardMaterial||T.isMeshLambertMaterial||T.isMeshPhongMaterial?P.environment:null,O=T.isMeshStandardMaterial||T.isMeshLambertMaterial&&!T.envMap||T.isMeshPhongMaterial&&!T.envMap,B=t.get(T.envMap||et,O),at=B&&B.mapping===Tu?B.image.height:null,$=M[T.type];T.precision!==null&&(_=s.getMaxPrecision(T.precision),_!==T.precision&&ee("WebGLProgram.getParameters:",T.precision,"not supported, using",_,"instead."));const lt=rt.morphAttributes.position||rt.morphAttributes.normal||rt.morphAttributes.color,N=lt!==void 0?lt.length:0;let k=0;rt.morphAttributes.position!==void 0&&(k=1),rt.morphAttributes.normal!==void 0&&(k=2),rt.morphAttributes.color!==void 0&&(k=3);let ut,vt,Rt,Z;if($){const Ae=$n[$];ut=Ae.vertexShader,vt=Ae.fragmentShader}else ut=T.vertexShader,vt=T.fragmentShader,d.update(T),Rt=d.getVertexShaderID(T),Z=d.getFragmentShaderID(T);const dt=r.getRenderTarget(),yt=r.state.buffers.depth.getReversed(),Ut=W.isInstancedMesh===!0,Ft=W.isBatchedMesh===!0,Xt=!!T.map,ge=!!T.matcap,Jt=!!B,_e=!!T.aoMap,Te=!!T.lightMap,ae=!!T.bumpMap,$e=!!T.normalMap,V=!!T.displacementMap,je=!!T.emissiveMap,be=!!T.metalnessMap,Ne=!!T.roughnessMap,Yt=T.anisotropy>0,z=T.clearcoat>0,b=T.dispersion>0,K=T.iridescence>0,_t=T.sheen>0,Mt=T.transmission>0,mt=Yt&&!!T.anisotropyMap,Wt=z&&!!T.clearcoatMap,wt=z&&!!T.clearcoatNormalMap,Kt=z&&!!T.clearcoatRoughnessMap,te=K&&!!T.iridescenceMap,Tt=K&&!!T.iridescenceThicknessMap,Et=_t&&!!T.sheenColorMap,Pt=_t&&!!T.sheenRoughnessMap,Ot=!!T.specularMap,zt=!!T.specularColorMap,fe=!!T.specularIntensityMap,Y=Mt&&!!T.transmissionMap,Ct=Mt&&!!T.thicknessMap,At=!!T.gradientMap,It=!!T.alphaMap,bt=T.alphaTest>0,pt=!!T.alphaHash,Ht=!!T.extensions;let ie=na;T.toneMapped&&(dt===null||dt.isXRRenderTarget===!0)&&(ie=r.toneMapping);const Pe={shaderID:$,shaderType:T.type,shaderName:T.name,vertexShader:ut,fragmentShader:vt,defines:T.defines,customVertexShaderID:Rt,customFragmentShaderID:Z,isRawShaderMaterial:T.isRawShaderMaterial===!0,glslVersion:T.glslVersion,precision:_,batching:Ft,batchingColor:Ft&&W._colorsTexture!==null,instancing:Ut,instancingColor:Ut&&W.instanceColor!==null,instancingMorph:Ut&&W.morphTexture!==null,outputColorSpace:dt===null?r.outputColorSpace:dt.isXRRenderTarget===!0?dt.texture.colorSpace:ro,alphaToCoverage:!!T.alphaToCoverage,map:Xt,matcap:ge,envMap:Jt,envMapMode:Jt&&B.mapping,envMapCubeUVHeight:at,aoMap:_e,lightMap:Te,bumpMap:ae,normalMap:$e,displacementMap:V,emissiveMap:je,normalMapObjectSpace:$e&&T.normalMapType===xM,normalMapTangentSpace:$e&&T.normalMapType===sx,metalnessMap:be,roughnessMap:Ne,anisotropy:Yt,anisotropyMap:mt,clearcoat:z,clearcoatMap:Wt,clearcoatNormalMap:wt,clearcoatRoughnessMap:Kt,dispersion:b,iridescence:K,iridescenceMap:te,iridescenceThicknessMap:Tt,sheen:_t,sheenColorMap:Et,sheenRoughnessMap:Pt,specularMap:Ot,specularColorMap:zt,specularIntensityMap:fe,transmission:Mt,transmissionMap:Y,thicknessMap:Ct,gradientMap:At,opaque:T.transparent===!1&&T.blending===eo&&T.alphaToCoverage===!1,alphaMap:It,alphaTest:bt,alphaHash:pt,combine:T.combine,mapUv:Xt&&E(T.map.channel),aoMapUv:_e&&E(T.aoMap.channel),lightMapUv:Te&&E(T.lightMap.channel),bumpMapUv:ae&&E(T.bumpMap.channel),normalMapUv:$e&&E(T.normalMap.channel),displacementMapUv:V&&E(T.displacementMap.channel),emissiveMapUv:je&&E(T.emissiveMap.channel),metalnessMapUv:be&&E(T.metalnessMap.channel),roughnessMapUv:Ne&&E(T.roughnessMap.channel),anisotropyMapUv:mt&&E(T.anisotropyMap.channel),clearcoatMapUv:Wt&&E(T.clearcoatMap.channel),clearcoatNormalMapUv:wt&&E(T.clearcoatNormalMap.channel),clearcoatRoughnessMapUv:Kt&&E(T.clearcoatRoughnessMap.channel),iridescenceMapUv:te&&E(T.iridescenceMap.channel),iridescenceThicknessMapUv:Tt&&E(T.iridescenceThicknessMap.channel),sheenColorMapUv:Et&&E(T.sheenColorMap.channel),sheenRoughnessMapUv:Pt&&E(T.sheenRoughnessMap.channel),specularMapUv:Ot&&E(T.specularMap.channel),specularColorMapUv:zt&&E(T.specularColorMap.channel),specularIntensityMapUv:fe&&E(T.specularIntensityMap.channel),transmissionMapUv:Y&&E(T.transmissionMap.channel),thicknessMapUv:Ct&&E(T.thicknessMap.channel),alphaMapUv:It&&E(T.alphaMap.channel),vertexTangents:!!rt.attributes.tangent&&($e||Yt),vertexColors:T.vertexColors,vertexAlphas:T.vertexColors===!0&&!!rt.attributes.color&&rt.attributes.color.itemSize===4,pointsUvs:W.isPoints===!0&&!!rt.attributes.uv&&(Xt||It),fog:!!J,useFog:T.fog===!0,fogExp2:!!J&&J.isFogExp2,flatShading:T.wireframe===!1&&(T.flatShading===!0||rt.attributes.normal===void 0&&$e===!1&&(T.isMeshLambertMaterial||T.isMeshPhongMaterial||T.isMeshStandardMaterial||T.isMeshPhysicalMaterial)),sizeAttenuation:T.sizeAttenuation===!0,logarithmicDepthBuffer:g,reversedDepthBuffer:yt,skinning:W.isSkinnedMesh===!0,morphTargets:rt.morphAttributes.position!==void 0,morphNormals:rt.morphAttributes.normal!==void 0,morphColors:rt.morphAttributes.color!==void 0,morphTargetsCount:N,morphTextureStride:k,numDirLights:L.directional.length,numPointLights:L.point.length,numSpotLights:L.spot.length,numSpotLightMaps:L.spotLightMap.length,numRectAreaLights:L.rectArea.length,numHemiLights:L.hemi.length,numDirLightShadows:L.directionalShadowMap.length,numPointLightShadows:L.pointShadowMap.length,numSpotLightShadows:L.spotShadowMap.length,numSpotLightShadowsWithMaps:L.numSpotLightShadowsWithMaps,numLightProbes:L.numLightProbes,numClippingPlanes:c.numPlanes,numClipIntersection:c.numIntersection,dithering:T.dithering,shadowMapEnabled:r.shadowMap.enabled&&Q.length>0,shadowMapType:r.shadowMap.type,toneMapping:ie,decodeVideoTexture:Xt&&T.map.isVideoTexture===!0&&Re.getTransfer(T.map.colorSpace)===Fe,decodeVideoTextureEmissive:je&&T.emissiveMap.isVideoTexture===!0&&Re.getTransfer(T.emissiveMap.colorSpace)===Fe,premultipliedAlpha:T.premultipliedAlpha,doubleSided:T.side===Bi,flipSided:T.side===ti,useDepthPacking:T.depthPacking>=0,depthPacking:T.depthPacking||0,index0AttributeName:T.index0AttributeName,extensionClipCullDistance:Ht&&T.extensions.clipCullDistance===!0&&i.has("WEBGL_clip_cull_distance"),extensionMultiDraw:(Ht&&T.extensions.multiDraw===!0||Ft)&&i.has("WEBGL_multi_draw"),rendererExtensionParallelShaderCompile:i.has("KHR_parallel_shader_compile"),customProgramCacheKey:T.customProgramCacheKey()};return Pe.vertexUv1s=m.has(1),Pe.vertexUv2s=m.has(2),Pe.vertexUv3s=m.has(3),m.clear(),Pe}function y(T){const L=[];if(T.shaderID?L.push(T.shaderID):(L.push(T.customVertexShaderID),L.push(T.customFragmentShaderID)),T.defines!==void 0)for(const Q in T.defines)L.push(Q),L.push(T.defines[Q]);return T.isRawShaderMaterial===!1&&(S(L,T),w(L,T),L.push(r.outputColorSpace)),L.push(T.customProgramCacheKey),L.join()}function S(T,L){T.push(L.precision),T.push(L.outputColorSpace),T.push(L.envMapMode),T.push(L.envMapCubeUVHeight),T.push(L.mapUv),T.push(L.alphaMapUv),T.push(L.lightMapUv),T.push(L.aoMapUv),T.push(L.bumpMapUv),T.push(L.normalMapUv),T.push(L.displacementMapUv),T.push(L.emissiveMapUv),T.push(L.metalnessMapUv),T.push(L.roughnessMapUv),T.push(L.anisotropyMapUv),T.push(L.clearcoatMapUv),T.push(L.clearcoatNormalMapUv),T.push(L.clearcoatRoughnessMapUv),T.push(L.iridescenceMapUv),T.push(L.iridescenceThicknessMapUv),T.push(L.sheenColorMapUv),T.push(L.sheenRoughnessMapUv),T.push(L.specularMapUv),T.push(L.specularColorMapUv),T.push(L.specularIntensityMapUv),T.push(L.transmissionMapUv),T.push(L.thicknessMapUv),T.push(L.combine),T.push(L.fogExp2),T.push(L.sizeAttenuation),T.push(L.morphTargetsCount),T.push(L.morphAttributeCount),T.push(L.numDirLights),T.push(L.numPointLights),T.push(L.numSpotLights),T.push(L.numSpotLightMaps),T.push(L.numHemiLights),T.push(L.numRectAreaLights),T.push(L.numDirLightShadows),T.push(L.numPointLightShadows),T.push(L.numSpotLightShadows),T.push(L.numSpotLightShadowsWithMaps),T.push(L.numLightProbes),T.push(L.shadowMapType),T.push(L.toneMapping),T.push(L.numClippingPlanes),T.push(L.numClipIntersection),T.push(L.depthPacking)}function w(T,L){h.disableAll(),L.instancing&&h.enable(0),L.instancingColor&&h.enable(1),L.instancingMorph&&h.enable(2),L.matcap&&h.enable(3),L.envMap&&h.enable(4),L.normalMapObjectSpace&&h.enable(5),L.normalMapTangentSpace&&h.enable(6),L.clearcoat&&h.enable(7),L.iridescence&&h.enable(8),L.alphaTest&&h.enable(9),L.vertexColors&&h.enable(10),L.vertexAlphas&&h.enable(11),L.vertexUv1s&&h.enable(12),L.vertexUv2s&&h.enable(13),L.vertexUv3s&&h.enable(14),L.vertexTangents&&h.enable(15),L.anisotropy&&h.enable(16),L.alphaHash&&h.enable(17),L.batching&&h.enable(18),L.dispersion&&h.enable(19),L.batchingColor&&h.enable(20),L.gradientMap&&h.enable(21),T.push(h.mask),h.disableAll(),L.fog&&h.enable(0),L.useFog&&h.enable(1),L.flatShading&&h.enable(2),L.logarithmicDepthBuffer&&h.enable(3),L.reversedDepthBuffer&&h.enable(4),L.skinning&&h.enable(5),L.morphTargets&&h.enable(6),L.morphNormals&&h.enable(7),L.morphColors&&h.enable(8),L.premultipliedAlpha&&h.enable(9),L.shadowMapEnabled&&h.enable(10),L.doubleSided&&h.enable(11),L.flipSided&&h.enable(12),L.useDepthPacking&&h.enable(13),L.dithering&&h.enable(14),L.transmission&&h.enable(15),L.sheen&&h.enable(16),L.opaque&&h.enable(17),L.pointsUvs&&h.enable(18),L.decodeVideoTexture&&h.enable(19),L.decodeVideoTextureEmissive&&h.enable(20),L.alphaToCoverage&&h.enable(21),T.push(h.mask)}function D(T){const L=M[T.type];let Q;if(L){const P=$n[L];Q=zp.clone(P.uniforms)}else Q=T.uniforms;return Q}function U(T,L){let Q=v.get(L);return Q!==void 0?++Q.usedTimes:(Q=new JA(r,L,T,l),p.push(Q),v.set(L,Q)),Q}function H(T){if(--T.usedTimes===0){const L=p.indexOf(T);p[L]=p[p.length-1],p.pop(),v.delete(T.cacheKey),T.destroy()}}function F(T){d.remove(T)}function I(){d.dispose()}return{getParameters:A,getProgramCacheKey:y,getUniforms:D,acquireProgram:U,releaseProgram:H,releaseShaderCache:F,programs:p,dispose:I}}function iR(){let r=new WeakMap;function t(h){return r.has(h)}function i(h){let d=r.get(h);return d===void 0&&(d={},r.set(h,d)),d}function s(h){r.delete(h)}function l(h,d,m){r.get(h)[d]=m}function c(){r=new WeakMap}return{has:t,get:i,remove:s,update:l,dispose:c}}function aR(r,t){return r.groupOrder!==t.groupOrder?r.groupOrder-t.groupOrder:r.renderOrder!==t.renderOrder?r.renderOrder-t.renderOrder:r.material.id!==t.material.id?r.material.id-t.material.id:r.materialVariant!==t.materialVariant?r.materialVariant-t.materialVariant:r.z!==t.z?r.z-t.z:r.id-t.id}function Cv(r,t){return r.groupOrder!==t.groupOrder?r.groupOrder-t.groupOrder:r.renderOrder!==t.renderOrder?r.renderOrder-t.renderOrder:r.z!==t.z?t.z-r.z:r.id-t.id}function wv(){const r=[];let t=0;const i=[],s=[],l=[];function c(){t=0,i.length=0,s.length=0,l.length=0}function h(_){let M=0;return _.isInstancedMesh&&(M+=2),_.isSkinnedMesh&&(M+=1),M}function d(_,M,E,A,y,S){let w=r[t];return w===void 0?(w={id:_.id,object:_,geometry:M,material:E,materialVariant:h(_),groupOrder:A,renderOrder:_.renderOrder,z:y,group:S},r[t]=w):(w.id=_.id,w.object=_,w.geometry=M,w.material=E,w.materialVariant=h(_),w.groupOrder=A,w.renderOrder=_.renderOrder,w.z=y,w.group=S),t++,w}function m(_,M,E,A,y,S){const w=d(_,M,E,A,y,S);E.transmission>0?s.push(w):E.transparent===!0?l.push(w):i.push(w)}function p(_,M,E,A,y,S){const w=d(_,M,E,A,y,S);E.transmission>0?s.unshift(w):E.transparent===!0?l.unshift(w):i.unshift(w)}function v(_,M){i.length>1&&i.sort(_||aR),s.length>1&&s.sort(M||Cv),l.length>1&&l.sort(M||Cv)}function g(){for(let _=t,M=r.length;_<M;_++){const E=r[_];if(E.id===null)break;E.id=null,E.object=null,E.geometry=null,E.material=null,E.group=null}}return{opaque:i,transmissive:s,transparent:l,init:c,push:m,unshift:p,finish:g,sort:v}}function sR(){let r=new WeakMap;function t(s,l){const c=r.get(s);let h;return c===void 0?(h=new wv,r.set(s,[h])):l>=c.length?(h=new wv,c.push(h)):h=c[l],h}function i(){r=new WeakMap}return{get:t,dispose:i}}function rR(){const r={};return{get:function(t){if(r[t.id]!==void 0)return r[t.id];let i;switch(t.type){case"DirectionalLight":i={direction:new j,color:new Se};break;case"SpotLight":i={position:new j,direction:new j,color:new Se,distance:0,coneCos:0,penumbraCos:0,decay:0};break;case"PointLight":i={position:new j,color:new Se,distance:0,decay:0};break;case"HemisphereLight":i={direction:new j,skyColor:new Se,groundColor:new Se};break;case"RectAreaLight":i={color:new Se,position:new j,halfWidth:new j,halfHeight:new j};break}return r[t.id]=i,i}}}function oR(){const r={};return{get:function(t){if(r[t.id]!==void 0)return r[t.id];let i;switch(t.type){case"DirectionalLight":i={shadowIntensity:1,shadowBias:0,shadowNormalBias:0,shadowRadius:1,shadowMapSize:new le};break;case"SpotLight":i={shadowIntensity:1,shadowBias:0,shadowNormalBias:0,shadowRadius:1,shadowMapSize:new le};break;case"PointLight":i={shadowIntensity:1,shadowBias:0,shadowNormalBias:0,shadowRadius:1,shadowMapSize:new le,shadowCameraNear:1,shadowCameraFar:1e3};break}return r[t.id]=i,i}}}let lR=0;function cR(r,t){return(t.castShadow?2:0)-(r.castShadow?2:0)+(t.map?1:0)-(r.map?1:0)}function uR(r){const t=new rR,i=oR(),s={version:0,hash:{directionalLength:-1,pointLength:-1,spotLength:-1,rectAreaLength:-1,hemiLength:-1,numDirectionalShadows:-1,numPointShadows:-1,numSpotShadows:-1,numSpotMaps:-1,numLightProbes:-1},ambient:[0,0,0],probe:[],directional:[],directionalShadow:[],directionalShadowMap:[],directionalShadowMatrix:[],spot:[],spotLightMap:[],spotShadow:[],spotShadowMap:[],spotLightMatrix:[],rectArea:[],rectAreaLTC1:null,rectAreaLTC2:null,point:[],pointShadow:[],pointShadowMap:[],pointShadowMatrix:[],hemi:[],numSpotLightShadowsWithMaps:0,numLightProbes:0};for(let p=0;p<9;p++)s.probe.push(new j);const l=new j,c=new Je,h=new Je;function d(p){let v=0,g=0,_=0;for(let L=0;L<9;L++)s.probe[L].set(0,0,0);let M=0,E=0,A=0,y=0,S=0,w=0,D=0,U=0,H=0,F=0,I=0;p.sort(cR);for(let L=0,Q=p.length;L<Q;L++){const P=p[L],W=P.color,J=P.intensity,rt=P.distance;let et=null;if(P.shadow&&P.shadow.map&&(P.shadow.map.texture.format===so?et=P.shadow.map.texture:et=P.shadow.map.depthTexture||P.shadow.map.texture),P.isAmbientLight)v+=W.r*J,g+=W.g*J,_+=W.b*J;else if(P.isLightProbe){for(let O=0;O<9;O++)s.probe[O].addScaledVector(P.sh.coefficients[O],J);I++}else if(P.isDirectionalLight){const O=t.get(P);if(O.color.copy(P.color).multiplyScalar(P.intensity),P.castShadow){const B=P.shadow,at=i.get(P);at.shadowIntensity=B.intensity,at.shadowBias=B.bias,at.shadowNormalBias=B.normalBias,at.shadowRadius=B.radius,at.shadowMapSize=B.mapSize,s.directionalShadow[M]=at,s.directionalShadowMap[M]=et,s.directionalShadowMatrix[M]=P.shadow.matrix,w++}s.directional[M]=O,M++}else if(P.isSpotLight){const O=t.get(P);O.position.setFromMatrixPosition(P.matrixWorld),O.color.copy(W).multiplyScalar(J),O.distance=rt,O.coneCos=Math.cos(P.angle),O.penumbraCos=Math.cos(P.angle*(1-P.penumbra)),O.decay=P.decay,s.spot[A]=O;const B=P.shadow;if(P.map&&(s.spotLightMap[H]=P.map,H++,B.updateMatrices(P),P.castShadow&&F++),s.spotLightMatrix[A]=B.matrix,P.castShadow){const at=i.get(P);at.shadowIntensity=B.intensity,at.shadowBias=B.bias,at.shadowNormalBias=B.normalBias,at.shadowRadius=B.radius,at.shadowMapSize=B.mapSize,s.spotShadow[A]=at,s.spotShadowMap[A]=et,U++}A++}else if(P.isRectAreaLight){const O=t.get(P);O.color.copy(W).multiplyScalar(J),O.halfWidth.set(P.width*.5,0,0),O.halfHeight.set(0,P.height*.5,0),s.rectArea[y]=O,y++}else if(P.isPointLight){const O=t.get(P);if(O.color.copy(P.color).multiplyScalar(P.intensity),O.distance=P.distance,O.decay=P.decay,P.castShadow){const B=P.shadow,at=i.get(P);at.shadowIntensity=B.intensity,at.shadowBias=B.bias,at.shadowNormalBias=B.normalBias,at.shadowRadius=B.radius,at.shadowMapSize=B.mapSize,at.shadowCameraNear=B.camera.near,at.shadowCameraFar=B.camera.far,s.pointShadow[E]=at,s.pointShadowMap[E]=et,s.pointShadowMatrix[E]=P.shadow.matrix,D++}s.point[E]=O,E++}else if(P.isHemisphereLight){const O=t.get(P);O.skyColor.copy(P.color).multiplyScalar(J),O.groundColor.copy(P.groundColor).multiplyScalar(J),s.hemi[S]=O,S++}}y>0&&(r.has("OES_texture_float_linear")===!0?(s.rectAreaLTC1=Lt.LTC_FLOAT_1,s.rectAreaLTC2=Lt.LTC_FLOAT_2):(s.rectAreaLTC1=Lt.LTC_HALF_1,s.rectAreaLTC2=Lt.LTC_HALF_2)),s.ambient[0]=v,s.ambient[1]=g,s.ambient[2]=_;const T=s.hash;(T.directionalLength!==M||T.pointLength!==E||T.spotLength!==A||T.rectAreaLength!==y||T.hemiLength!==S||T.numDirectionalShadows!==w||T.numPointShadows!==D||T.numSpotShadows!==U||T.numSpotMaps!==H||T.numLightProbes!==I)&&(s.directional.length=M,s.spot.length=A,s.rectArea.length=y,s.point.length=E,s.hemi.length=S,s.directionalShadow.length=w,s.directionalShadowMap.length=w,s.pointShadow.length=D,s.pointShadowMap.length=D,s.spotShadow.length=U,s.spotShadowMap.length=U,s.directionalShadowMatrix.length=w,s.pointShadowMatrix.length=D,s.spotLightMatrix.length=U+H-F,s.spotLightMap.length=H,s.numSpotLightShadowsWithMaps=F,s.numLightProbes=I,T.directionalLength=M,T.pointLength=E,T.spotLength=A,T.rectAreaLength=y,T.hemiLength=S,T.numDirectionalShadows=w,T.numPointShadows=D,T.numSpotShadows=U,T.numSpotMaps=H,T.numLightProbes=I,s.version=lR++)}function m(p,v){let g=0,_=0,M=0,E=0,A=0;const y=v.matrixWorldInverse;for(let S=0,w=p.length;S<w;S++){const D=p[S];if(D.isDirectionalLight){const U=s.directional[g];U.direction.setFromMatrixPosition(D.matrixWorld),l.setFromMatrixPosition(D.target.matrixWorld),U.direction.sub(l),U.direction.transformDirection(y),g++}else if(D.isSpotLight){const U=s.spot[M];U.position.setFromMatrixPosition(D.matrixWorld),U.position.applyMatrix4(y),U.direction.setFromMatrixPosition(D.matrixWorld),l.setFromMatrixPosition(D.target.matrixWorld),U.direction.sub(l),U.direction.transformDirection(y),M++}else if(D.isRectAreaLight){const U=s.rectArea[E];U.position.setFromMatrixPosition(D.matrixWorld),U.position.applyMatrix4(y),h.identity(),c.copy(D.matrixWorld),c.premultiply(y),h.extractRotation(c),U.halfWidth.set(D.width*.5,0,0),U.halfHeight.set(0,D.height*.5,0),U.halfWidth.applyMatrix4(h),U.halfHeight.applyMatrix4(h),E++}else if(D.isPointLight){const U=s.point[_];U.position.setFromMatrixPosition(D.matrixWorld),U.position.applyMatrix4(y),_++}else if(D.isHemisphereLight){const U=s.hemi[A];U.direction.setFromMatrixPosition(D.matrixWorld),U.direction.transformDirection(y),A++}}}return{setup:d,setupView:m,state:s}}function Dv(r){const t=new uR(r),i=[],s=[];function l(v){p.camera=v,i.length=0,s.length=0}function c(v){i.push(v)}function h(v){s.push(v)}function d(){t.setup(i)}function m(v){t.setupView(i,v)}const p={lightsArray:i,shadowsArray:s,camera:null,lights:t,transmissionRenderTarget:{}};return{init:l,state:p,setupLights:d,setupLightsView:m,pushLight:c,pushShadow:h}}function fR(r){let t=new WeakMap;function i(l,c=0){const h=t.get(l);let d;return h===void 0?(d=new Dv(r),t.set(l,[d])):c>=h.length?(d=new Dv(r),h.push(d)):d=h[c],d}function s(){t=new WeakMap}return{get:i,dispose:s}}const hR=`void main() {
4007
4007
  gl_Position = vec4( position, 1.0 );
4008
- }`,uR=`uniform sampler2D shadow_pass;
4008
+ }`,dR=`uniform sampler2D shadow_pass;
4009
4009
  uniform vec2 resolution;
4010
4010
  uniform float radius;
4011
4011
  void main() {
@@ -4030,12 +4030,12 @@ void main() {
4030
4030
  squared_mean = squared_mean / samples;
4031
4031
  float std_dev = sqrt( max( 0.0, squared_mean - mean * mean ) );
4032
4032
  gl_FragColor = vec4( mean, std_dev, 0.0, 1.0 );
4033
- }`,fR=[new j(1,0,0),new j(-1,0,0),new j(0,1,0),new j(0,-1,0),new j(0,0,1),new j(0,0,-1)],hR=[new j(0,-1,0),new j(0,-1,0),new j(0,0,1),new j(0,0,-1),new j(0,-1,0),new j(0,-1,0)],Dv=new Je,ol=new j,_d=new j;function dR(r,t,i){let s=new Np;const l=new le,c=new le,h=new We,d=new xE,m=new SE,p={},v=i.maxTextureSize,g={[xs]:ii,[ii]:xs,[Hi]:Hi},_=new Xi({defines:{VSM_SAMPLES:8},uniforms:{shadow_pass:{value:null},resolution:{value:new le},radius:{value:4}},vertexShader:cR,fragmentShader:uR}),M=_.clone();M.defines.HORIZONTAL_PASS=1;const E=new Pn;E.setAttribute("position",new gi(new Float32Array([-1,-1,.5,3,-1,.5,-1,3,.5]),3));const A=new _i(E,_),x=this;this.enabled=!1,this.autoUpdate=!0,this.needsUpdate=!1,this.type=uu;let y=this.type;this.render=function(F,I,T){if(x.enabled===!1||x.autoUpdate===!1&&x.needsUpdate===!1||F.length===0)return;this.type===Yy&&(ee("WebGLShadowMap: PCFSoftShadowMap has been deprecated. Using PCFShadowMap instead."),this.type=uu);const L=r.getRenderTarget(),Q=r.getActiveCubeFace(),P=r.getActiveMipmapLevel(),W=r.state;W.setBlending(La),W.buffers.depth.getReversed()===!0?W.buffers.color.setClear(0,0,0,0):W.buffers.color.setClear(1,1,1,1),W.buffers.depth.setTest(!0),W.setScissorTest(!1);const J=y!==this.type;J&&I.traverse(function(rt){rt.material&&(Array.isArray(rt.material)?rt.material.forEach(et=>et.needsUpdate=!0):rt.material.needsUpdate=!0)});for(let rt=0,et=F.length;rt<et;rt++){const O=F[rt],B=O.shadow;if(B===void 0){ee("WebGLShadowMap:",O,"has no shadow.");continue}if(B.autoUpdate===!1&&B.needsUpdate===!1)continue;l.copy(B.mapSize);const at=B.getFrameExtents();l.multiply(at),c.copy(B.mapSize),(l.x>v||l.y>v)&&(l.x>v&&(c.x=Math.floor(v/at.x),l.x=c.x*at.x,B.mapSize.x=c.x),l.y>v&&(c.y=Math.floor(v/at.y),l.y=c.y*at.y,B.mapSize.y=c.y));const $=r.state.buffers.depth.getReversed();if(B.camera._reversedDepth=$,B.map===null||J===!0){if(B.map!==null&&(B.map.depthTexture!==null&&(B.map.depthTexture.dispose(),B.map.depthTexture=null),B.map.dispose()),this.type===ll){if(O.isPointLight){ee("WebGLShadowMap: VSM shadow maps are not supported for PointLights. Use PCF or BasicShadowMap instead.");continue}B.map=new aa(l.x,l.y,{format:io,type:Pa,minFilter:Bn,magFilter:Bn,generateMipmaps:!1}),B.map.texture.name=O.name+".shadowMap",B.map.depthTexture=new _l(l.x,l.y,ea),B.map.depthTexture.name=O.name+".shadowMapDepth",B.map.depthTexture.format=za,B.map.depthTexture.compareFunction=null,B.map.depthTexture.minFilter=Nn,B.map.depthTexture.magFilter=Nn}else O.isPointLight?(B.map=new vx(l.x),B.map.depthTexture=new dE(l.x,sa)):(B.map=new aa(l.x,l.y),B.map.depthTexture=new _l(l.x,l.y,sa)),B.map.depthTexture.name=O.name+".shadowMap",B.map.depthTexture.format=za,this.type===uu?(B.map.depthTexture.compareFunction=$?Cp:Rp,B.map.depthTexture.minFilter=Bn,B.map.depthTexture.magFilter=Bn):(B.map.depthTexture.compareFunction=null,B.map.depthTexture.minFilter=Nn,B.map.depthTexture.magFilter=Nn);B.camera.updateProjectionMatrix()}const lt=B.map.isWebGLCubeRenderTarget?6:1;for(let N=0;N<lt;N++){if(B.map.isWebGLCubeRenderTarget)r.setRenderTarget(B.map,N),r.clear();else{N===0&&(r.setRenderTarget(B.map),r.clear());const k=B.getViewport(N);h.set(c.x*k.x,c.y*k.y,c.x*k.z,c.y*k.w),W.viewport(h)}if(O.isPointLight){const k=B.camera,ut=B.matrix,vt=O.distance||k.far;vt!==k.far&&(k.far=vt,k.updateProjectionMatrix()),ol.setFromMatrixPosition(O.matrixWorld),k.position.copy(ol),_d.copy(k.position),_d.add(fR[N]),k.up.copy(hR[N]),k.lookAt(_d),k.updateMatrixWorld(),ut.makeTranslation(-ol.x,-ol.y,-ol.z),Dv.multiplyMatrices(k.projectionMatrix,k.matrixWorldInverse),B._frustum.setFromProjectionMatrix(Dv,k.coordinateSystem,k.reversedDepth)}else B.updateMatrices(O);s=B.getFrustum(),U(I,T,B.camera,O,this.type)}B.isPointLightShadow!==!0&&this.type===ll&&w(B,T),B.needsUpdate=!1}y=this.type,x.needsUpdate=!1,r.setRenderTarget(L,Q,P)};function w(F,I){const T=t.update(A);_.defines.VSM_SAMPLES!==F.blurSamples&&(_.defines.VSM_SAMPLES=F.blurSamples,M.defines.VSM_SAMPLES=F.blurSamples,_.needsUpdate=!0,M.needsUpdate=!0),F.mapPass===null&&(F.mapPass=new aa(l.x,l.y,{format:io,type:Pa})),_.uniforms.shadow_pass.value=F.map.depthTexture,_.uniforms.resolution.value=F.mapSize,_.uniforms.radius.value=F.radius,r.setRenderTarget(F.mapPass),r.clear(),r.renderBufferDirect(I,null,T,_,A,null),M.uniforms.shadow_pass.value=F.mapPass.texture,M.uniforms.resolution.value=F.mapSize,M.uniforms.radius.value=F.radius,r.setRenderTarget(F.map),r.clear(),r.renderBufferDirect(I,null,T,M,A,null)}function D(F,I,T,L){let Q=null;const P=T.isPointLight===!0?F.customDistanceMaterial:F.customDepthMaterial;if(P!==void 0)Q=P;else if(Q=T.isPointLight===!0?m:d,r.localClippingEnabled&&I.clipShadows===!0&&Array.isArray(I.clippingPlanes)&&I.clippingPlanes.length!==0||I.displacementMap&&I.displacementScale!==0||I.alphaMap&&I.alphaTest>0||I.map&&I.alphaTest>0||I.alphaToCoverage===!0){const W=Q.uuid,J=I.uuid;let rt=p[W];rt===void 0&&(rt={},p[W]=rt);let et=rt[J];et===void 0&&(et=Q.clone(),rt[J]=et,I.addEventListener("dispose",H)),Q=et}if(Q.visible=I.visible,Q.wireframe=I.wireframe,L===ll?Q.side=I.shadowSide!==null?I.shadowSide:I.side:Q.side=I.shadowSide!==null?I.shadowSide:g[I.side],Q.alphaMap=I.alphaMap,Q.alphaTest=I.alphaToCoverage===!0?.5:I.alphaTest,Q.map=I.map,Q.clipShadows=I.clipShadows,Q.clippingPlanes=I.clippingPlanes,Q.clipIntersection=I.clipIntersection,Q.displacementMap=I.displacementMap,Q.displacementScale=I.displacementScale,Q.displacementBias=I.displacementBias,Q.wireframeLinewidth=I.wireframeLinewidth,Q.linewidth=I.linewidth,T.isPointLight===!0&&Q.isMeshDistanceMaterial===!0){const W=r.properties.get(Q);W.light=T}return Q}function U(F,I,T,L,Q){if(F.visible===!1)return;if(F.layers.test(I.layers)&&(F.isMesh||F.isLine||F.isPoints)&&(F.castShadow||F.receiveShadow&&Q===ll)&&(!F.frustumCulled||s.intersectsObject(F))){F.modelViewMatrix.multiplyMatrices(T.matrixWorldInverse,F.matrixWorld);const J=t.update(F),rt=F.material;if(Array.isArray(rt)){const et=J.groups;for(let O=0,B=et.length;O<B;O++){const at=et[O],$=rt[at.materialIndex];if($&&$.visible){const lt=D(F,$,L,Q);F.onBeforeShadow(r,F,I,T,J,lt,at),r.renderBufferDirect(T,null,J,lt,F,at),F.onAfterShadow(r,F,I,T,J,lt,at)}}}else if(rt.visible){const et=D(F,rt,L,Q);F.onBeforeShadow(r,F,I,T,J,et,null),r.renderBufferDirect(T,null,J,et,F,null),F.onAfterShadow(r,F,I,T,J,et,null)}}const W=F.children;for(let J=0,rt=W.length;J<rt;J++)U(W[J],I,T,L,Q)}function H(F){F.target.removeEventListener("dispose",H);for(const T in p){const L=p[T],Q=F.target.uuid;Q in L&&(L[Q].dispose(),delete L[Q])}}}function pR(r,t){function i(){let Y=!1;const Ct=new We;let At=null;const It=new We(0,0,0,0);return{setMask:function(bt){At!==bt&&!Y&&(r.colorMask(bt,bt,bt,bt),At=bt)},setLocked:function(bt){Y=bt},setClear:function(bt,pt,Ht,ie,Pe){Pe===!0&&(bt*=ie,pt*=ie,Ht*=ie),Ct.set(bt,pt,Ht,ie),It.equals(Ct)===!1&&(r.clearColor(bt,pt,Ht,ie),It.copy(Ct))},reset:function(){Y=!1,At=null,It.set(-1,0,0,0)}}}function s(){let Y=!1,Ct=!1,At=null,It=null,bt=null;return{setReversed:function(pt){if(Ct!==pt){const Ht=t.get("EXT_clip_control");pt?Ht.clipControlEXT(Ht.LOWER_LEFT_EXT,Ht.ZERO_TO_ONE_EXT):Ht.clipControlEXT(Ht.LOWER_LEFT_EXT,Ht.NEGATIVE_ONE_TO_ONE_EXT),Ct=pt;const ie=bt;bt=null,this.setClear(ie)}},getReversed:function(){return Ct},setTest:function(pt){pt?dt(r.DEPTH_TEST):yt(r.DEPTH_TEST)},setMask:function(pt){At!==pt&&!Y&&(r.depthMask(pt),At=pt)},setFunc:function(pt){if(Ct&&(pt=AM[pt]),It!==pt){switch(pt){case bd:r.depthFunc(r.NEVER);break;case Td:r.depthFunc(r.ALWAYS);break;case Ad:r.depthFunc(r.LESS);break;case eo:r.depthFunc(r.LEQUAL);break;case Rd:r.depthFunc(r.EQUAL);break;case Cd:r.depthFunc(r.GEQUAL);break;case wd:r.depthFunc(r.GREATER);break;case Dd:r.depthFunc(r.NOTEQUAL);break;default:r.depthFunc(r.LEQUAL)}It=pt}},setLocked:function(pt){Y=pt},setClear:function(pt){bt!==pt&&(bt=pt,Ct&&(pt=1-pt),r.clearDepth(pt))},reset:function(){Y=!1,At=null,It=null,bt=null,Ct=!1}}}function l(){let Y=!1,Ct=null,At=null,It=null,bt=null,pt=null,Ht=null,ie=null,Pe=null;return{setTest:function(Ae){Y||(Ae?dt(r.STENCIL_TEST):yt(r.STENCIL_TEST))},setMask:function(Ae){Ct!==Ae&&!Y&&(r.stencilMask(Ae),Ct=Ae)},setFunc:function(Ae,Hn,Ci){(At!==Ae||It!==Hn||bt!==Ci)&&(r.stencilFunc(Ae,Hn,Ci),At=Ae,It=Hn,bt=Ci)},setOp:function(Ae,Hn,Ci){(pt!==Ae||Ht!==Hn||ie!==Ci)&&(r.stencilOp(Ae,Hn,Ci),pt=Ae,Ht=Hn,ie=Ci)},setLocked:function(Ae){Y=Ae},setClear:function(Ae){Pe!==Ae&&(r.clearStencil(Ae),Pe=Ae)},reset:function(){Y=!1,Ct=null,At=null,It=null,bt=null,pt=null,Ht=null,ie=null,Pe=null}}}const c=new i,h=new s,d=new l,m=new WeakMap,p=new WeakMap;let v={},g={},_=new WeakMap,M=[],E=null,A=!1,x=null,y=null,w=null,D=null,U=null,H=null,F=null,I=new Se(0,0,0),T=0,L=!1,Q=null,P=null,W=null,J=null,rt=null;const et=r.getParameter(r.MAX_COMBINED_TEXTURE_IMAGE_UNITS);let O=!1,B=0;const at=r.getParameter(r.VERSION);at.indexOf("WebGL")!==-1?(B=parseFloat(/^WebGL (\d)/.exec(at)[1]),O=B>=1):at.indexOf("OpenGL ES")!==-1&&(B=parseFloat(/^OpenGL ES (\d)/.exec(at)[1]),O=B>=2);let $=null,lt={};const N=r.getParameter(r.SCISSOR_BOX),k=r.getParameter(r.VIEWPORT),ut=new We().fromArray(N),vt=new We().fromArray(k);function Rt(Y,Ct,At,It){const bt=new Uint8Array(4),pt=r.createTexture();r.bindTexture(Y,pt),r.texParameteri(Y,r.TEXTURE_MIN_FILTER,r.NEAREST),r.texParameteri(Y,r.TEXTURE_MAG_FILTER,r.NEAREST);for(let Ht=0;Ht<At;Ht++)Y===r.TEXTURE_3D||Y===r.TEXTURE_2D_ARRAY?r.texImage3D(Ct,0,r.RGBA,1,1,It,0,r.RGBA,r.UNSIGNED_BYTE,bt):r.texImage2D(Ct+Ht,0,r.RGBA,1,1,0,r.RGBA,r.UNSIGNED_BYTE,bt);return pt}const Z={};Z[r.TEXTURE_2D]=Rt(r.TEXTURE_2D,r.TEXTURE_2D,1),Z[r.TEXTURE_CUBE_MAP]=Rt(r.TEXTURE_CUBE_MAP,r.TEXTURE_CUBE_MAP_POSITIVE_X,6),Z[r.TEXTURE_2D_ARRAY]=Rt(r.TEXTURE_2D_ARRAY,r.TEXTURE_2D_ARRAY,1,1),Z[r.TEXTURE_3D]=Rt(r.TEXTURE_3D,r.TEXTURE_3D,1,1),c.setClear(0,0,0,1),h.setClear(1),d.setClear(0),dt(r.DEPTH_TEST),h.setFunc(eo),ae(!1),$e(A_),dt(r.CULL_FACE),_e(La);function dt(Y){v[Y]!==!0&&(r.enable(Y),v[Y]=!0)}function yt(Y){v[Y]!==!1&&(r.disable(Y),v[Y]=!1)}function Ut(Y,Ct){return g[Y]!==Ct?(r.bindFramebuffer(Y,Ct),g[Y]=Ct,Y===r.DRAW_FRAMEBUFFER&&(g[r.FRAMEBUFFER]=Ct),Y===r.FRAMEBUFFER&&(g[r.DRAW_FRAMEBUFFER]=Ct),!0):!1}function Ft(Y,Ct){let At=M,It=!1;if(Y){At=_.get(Ct),At===void 0&&(At=[],_.set(Ct,At));const bt=Y.textures;if(At.length!==bt.length||At[0]!==r.COLOR_ATTACHMENT0){for(let pt=0,Ht=bt.length;pt<Ht;pt++)At[pt]=r.COLOR_ATTACHMENT0+pt;At.length=bt.length,It=!0}}else At[0]!==r.BACK&&(At[0]=r.BACK,It=!0);It&&r.drawBuffers(At)}function Xt(Y){return E!==Y?(r.useProgram(Y),E=Y,!0):!1}const ge={[qs]:r.FUNC_ADD,[Zy]:r.FUNC_SUBTRACT,[Ky]:r.FUNC_REVERSE_SUBTRACT};ge[Qy]=r.MIN,ge[Jy]=r.MAX;const Jt={[$y]:r.ZERO,[tM]:r.ONE,[eM]:r.SRC_COLOR,[Md]:r.SRC_ALPHA,[oM]:r.SRC_ALPHA_SATURATE,[sM]:r.DST_COLOR,[iM]:r.DST_ALPHA,[nM]:r.ONE_MINUS_SRC_COLOR,[Ed]:r.ONE_MINUS_SRC_ALPHA,[rM]:r.ONE_MINUS_DST_COLOR,[aM]:r.ONE_MINUS_DST_ALPHA,[lM]:r.CONSTANT_COLOR,[cM]:r.ONE_MINUS_CONSTANT_COLOR,[uM]:r.CONSTANT_ALPHA,[fM]:r.ONE_MINUS_CONSTANT_ALPHA};function _e(Y,Ct,At,It,bt,pt,Ht,ie,Pe,Ae){if(Y===La){A===!0&&(yt(r.BLEND),A=!1);return}if(A===!1&&(dt(r.BLEND),A=!0),Y!==jy){if(Y!==x||Ae!==L){if((y!==qs||U!==qs)&&(r.blendEquation(r.FUNC_ADD),y=qs,U=qs),Ae)switch(Y){case $r:r.blendFuncSeparate(r.ONE,r.ONE_MINUS_SRC_ALPHA,r.ONE,r.ONE_MINUS_SRC_ALPHA);break;case R_:r.blendFunc(r.ONE,r.ONE);break;case C_:r.blendFuncSeparate(r.ZERO,r.ONE_MINUS_SRC_COLOR,r.ZERO,r.ONE);break;case w_:r.blendFuncSeparate(r.DST_COLOR,r.ONE_MINUS_SRC_ALPHA,r.ZERO,r.ONE);break;default:Ue("WebGLState: Invalid blending: ",Y);break}else switch(Y){case $r:r.blendFuncSeparate(r.SRC_ALPHA,r.ONE_MINUS_SRC_ALPHA,r.ONE,r.ONE_MINUS_SRC_ALPHA);break;case R_:r.blendFuncSeparate(r.SRC_ALPHA,r.ONE,r.ONE,r.ONE);break;case C_:Ue("WebGLState: SubtractiveBlending requires material.premultipliedAlpha = true");break;case w_:Ue("WebGLState: MultiplyBlending requires material.premultipliedAlpha = true");break;default:Ue("WebGLState: Invalid blending: ",Y);break}w=null,D=null,H=null,F=null,I.set(0,0,0),T=0,x=Y,L=Ae}return}bt=bt||Ct,pt=pt||At,Ht=Ht||It,(Ct!==y||bt!==U)&&(r.blendEquationSeparate(ge[Ct],ge[bt]),y=Ct,U=bt),(At!==w||It!==D||pt!==H||Ht!==F)&&(r.blendFuncSeparate(Jt[At],Jt[It],Jt[pt],Jt[Ht]),w=At,D=It,H=pt,F=Ht),(ie.equals(I)===!1||Pe!==T)&&(r.blendColor(ie.r,ie.g,ie.b,Pe),I.copy(ie),T=Pe),x=Y,L=!1}function Te(Y,Ct){Y.side===Hi?yt(r.CULL_FACE):dt(r.CULL_FACE);let At=Y.side===ii;Ct&&(At=!At),ae(At),Y.blending===$r&&Y.transparent===!1?_e(La):_e(Y.blending,Y.blendEquation,Y.blendSrc,Y.blendDst,Y.blendEquationAlpha,Y.blendSrcAlpha,Y.blendDstAlpha,Y.blendColor,Y.blendAlpha,Y.premultipliedAlpha),h.setFunc(Y.depthFunc),h.setTest(Y.depthTest),h.setMask(Y.depthWrite),c.setMask(Y.colorWrite);const It=Y.stencilWrite;d.setTest(It),It&&(d.setMask(Y.stencilWriteMask),d.setFunc(Y.stencilFunc,Y.stencilRef,Y.stencilFuncMask),d.setOp(Y.stencilFail,Y.stencilZFail,Y.stencilZPass)),je(Y.polygonOffset,Y.polygonOffsetFactor,Y.polygonOffsetUnits),Y.alphaToCoverage===!0?dt(r.SAMPLE_ALPHA_TO_COVERAGE):yt(r.SAMPLE_ALPHA_TO_COVERAGE)}function ae(Y){Q!==Y&&(Y?r.frontFace(r.CW):r.frontFace(r.CCW),Q=Y)}function $e(Y){Y!==Wy?(dt(r.CULL_FACE),Y!==P&&(Y===A_?r.cullFace(r.BACK):Y===qy?r.cullFace(r.FRONT):r.cullFace(r.FRONT_AND_BACK))):yt(r.CULL_FACE),P=Y}function V(Y){Y!==W&&(O&&r.lineWidth(Y),W=Y)}function je(Y,Ct,At){Y?(dt(r.POLYGON_OFFSET_FILL),(J!==Ct||rt!==At)&&(J=Ct,rt=At,h.getReversed()&&(Ct=-Ct),r.polygonOffset(Ct,At))):yt(r.POLYGON_OFFSET_FILL)}function be(Y){Y?dt(r.SCISSOR_TEST):yt(r.SCISSOR_TEST)}function Ne(Y){Y===void 0&&(Y=r.TEXTURE0+et-1),$!==Y&&(r.activeTexture(Y),$=Y)}function Yt(Y,Ct,At){At===void 0&&($===null?At=r.TEXTURE0+et-1:At=$);let It=lt[At];It===void 0&&(It={type:void 0,texture:void 0},lt[At]=It),(It.type!==Y||It.texture!==Ct)&&($!==At&&(r.activeTexture(At),$=At),r.bindTexture(Y,Ct||Z[Y]),It.type=Y,It.texture=Ct)}function z(){const Y=lt[$];Y!==void 0&&Y.type!==void 0&&(r.bindTexture(Y.type,null),Y.type=void 0,Y.texture=void 0)}function b(){try{r.compressedTexImage2D(...arguments)}catch(Y){Ue("WebGLState:",Y)}}function K(){try{r.compressedTexImage3D(...arguments)}catch(Y){Ue("WebGLState:",Y)}}function _t(){try{r.texSubImage2D(...arguments)}catch(Y){Ue("WebGLState:",Y)}}function Mt(){try{r.texSubImage3D(...arguments)}catch(Y){Ue("WebGLState:",Y)}}function mt(){try{r.compressedTexSubImage2D(...arguments)}catch(Y){Ue("WebGLState:",Y)}}function Wt(){try{r.compressedTexSubImage3D(...arguments)}catch(Y){Ue("WebGLState:",Y)}}function wt(){try{r.texStorage2D(...arguments)}catch(Y){Ue("WebGLState:",Y)}}function Kt(){try{r.texStorage3D(...arguments)}catch(Y){Ue("WebGLState:",Y)}}function te(){try{r.texImage2D(...arguments)}catch(Y){Ue("WebGLState:",Y)}}function Tt(){try{r.texImage3D(...arguments)}catch(Y){Ue("WebGLState:",Y)}}function Et(Y){ut.equals(Y)===!1&&(r.scissor(Y.x,Y.y,Y.z,Y.w),ut.copy(Y))}function Pt(Y){vt.equals(Y)===!1&&(r.viewport(Y.x,Y.y,Y.z,Y.w),vt.copy(Y))}function Ot(Y,Ct){let At=p.get(Ct);At===void 0&&(At=new WeakMap,p.set(Ct,At));let It=At.get(Y);It===void 0&&(It=r.getUniformBlockIndex(Ct,Y.name),At.set(Y,It))}function zt(Y,Ct){const It=p.get(Ct).get(Y);m.get(Ct)!==It&&(r.uniformBlockBinding(Ct,It,Y.__bindingPointIndex),m.set(Ct,It))}function fe(){r.disable(r.BLEND),r.disable(r.CULL_FACE),r.disable(r.DEPTH_TEST),r.disable(r.POLYGON_OFFSET_FILL),r.disable(r.SCISSOR_TEST),r.disable(r.STENCIL_TEST),r.disable(r.SAMPLE_ALPHA_TO_COVERAGE),r.blendEquation(r.FUNC_ADD),r.blendFunc(r.ONE,r.ZERO),r.blendFuncSeparate(r.ONE,r.ZERO,r.ONE,r.ZERO),r.blendColor(0,0,0,0),r.colorMask(!0,!0,!0,!0),r.clearColor(0,0,0,0),r.depthMask(!0),r.depthFunc(r.LESS),h.setReversed(!1),r.clearDepth(1),r.stencilMask(4294967295),r.stencilFunc(r.ALWAYS,0,4294967295),r.stencilOp(r.KEEP,r.KEEP,r.KEEP),r.clearStencil(0),r.cullFace(r.BACK),r.frontFace(r.CCW),r.polygonOffset(0,0),r.activeTexture(r.TEXTURE0),r.bindFramebuffer(r.FRAMEBUFFER,null),r.bindFramebuffer(r.DRAW_FRAMEBUFFER,null),r.bindFramebuffer(r.READ_FRAMEBUFFER,null),r.useProgram(null),r.lineWidth(1),r.scissor(0,0,r.canvas.width,r.canvas.height),r.viewport(0,0,r.canvas.width,r.canvas.height),v={},$=null,lt={},g={},_=new WeakMap,M=[],E=null,A=!1,x=null,y=null,w=null,D=null,U=null,H=null,F=null,I=new Se(0,0,0),T=0,L=!1,Q=null,P=null,W=null,J=null,rt=null,ut.set(0,0,r.canvas.width,r.canvas.height),vt.set(0,0,r.canvas.width,r.canvas.height),c.reset(),h.reset(),d.reset()}return{buffers:{color:c,depth:h,stencil:d},enable:dt,disable:yt,bindFramebuffer:Ut,drawBuffers:Ft,useProgram:Xt,setBlending:_e,setMaterial:Te,setFlipSided:ae,setCullFace:$e,setLineWidth:V,setPolygonOffset:je,setScissorTest:be,activeTexture:Ne,bindTexture:Yt,unbindTexture:z,compressedTexImage2D:b,compressedTexImage3D:K,texImage2D:te,texImage3D:Tt,updateUBOMapping:Ot,uniformBlockBinding:zt,texStorage2D:wt,texStorage3D:Kt,texSubImage2D:_t,texSubImage3D:Mt,compressedTexSubImage2D:mt,compressedTexSubImage3D:Wt,scissor:Et,viewport:Pt,reset:fe}}function mR(r,t,i,s,l,c,h){const d=t.has("WEBGL_multisampled_render_to_texture")?t.get("WEBGL_multisampled_render_to_texture"):null,m=typeof navigator>"u"?!1:/OculusBrowser/g.test(navigator.userAgent),p=new le,v=new WeakMap;let g;const _=new WeakMap;let M=!1;try{M=typeof OffscreenCanvas<"u"&&new OffscreenCanvas(1,1).getContext("2d")!==null}catch{}function E(z,b){return M?new OffscreenCanvas(z,b):_u("canvas")}function A(z,b,K){let _t=1;const Mt=Yt(z);if((Mt.width>K||Mt.height>K)&&(_t=K/Math.max(Mt.width,Mt.height)),_t<1)if(typeof HTMLImageElement<"u"&&z instanceof HTMLImageElement||typeof HTMLCanvasElement<"u"&&z instanceof HTMLCanvasElement||typeof ImageBitmap<"u"&&z instanceof ImageBitmap||typeof VideoFrame<"u"&&z instanceof VideoFrame){const mt=Math.floor(_t*Mt.width),Wt=Math.floor(_t*Mt.height);g===void 0&&(g=E(mt,Wt));const wt=b?E(mt,Wt):g;return wt.width=mt,wt.height=Wt,wt.getContext("2d").drawImage(z,0,0,mt,Wt),ee("WebGLRenderer: Texture has been resized from ("+Mt.width+"x"+Mt.height+") to ("+mt+"x"+Wt+")."),wt}else return"data"in z&&ee("WebGLRenderer: Image in DataTexture is too big ("+Mt.width+"x"+Mt.height+")."),z;return z}function x(z){return z.generateMipmaps}function y(z){r.generateMipmap(z)}function w(z){return z.isWebGLCubeRenderTarget?r.TEXTURE_CUBE_MAP:z.isWebGL3DRenderTarget?r.TEXTURE_3D:z.isWebGLArrayRenderTarget||z.isCompressedArrayTexture?r.TEXTURE_2D_ARRAY:r.TEXTURE_2D}function D(z,b,K,_t,Mt=!1){if(z!==null){if(r[z]!==void 0)return r[z];ee("WebGLRenderer: Attempt to use non-existing WebGL internal format '"+z+"'")}let mt=b;if(b===r.RED&&(K===r.FLOAT&&(mt=r.R32F),K===r.HALF_FLOAT&&(mt=r.R16F),K===r.UNSIGNED_BYTE&&(mt=r.R8)),b===r.RED_INTEGER&&(K===r.UNSIGNED_BYTE&&(mt=r.R8UI),K===r.UNSIGNED_SHORT&&(mt=r.R16UI),K===r.UNSIGNED_INT&&(mt=r.R32UI),K===r.BYTE&&(mt=r.R8I),K===r.SHORT&&(mt=r.R16I),K===r.INT&&(mt=r.R32I)),b===r.RG&&(K===r.FLOAT&&(mt=r.RG32F),K===r.HALF_FLOAT&&(mt=r.RG16F),K===r.UNSIGNED_BYTE&&(mt=r.RG8)),b===r.RG_INTEGER&&(K===r.UNSIGNED_BYTE&&(mt=r.RG8UI),K===r.UNSIGNED_SHORT&&(mt=r.RG16UI),K===r.UNSIGNED_INT&&(mt=r.RG32UI),K===r.BYTE&&(mt=r.RG8I),K===r.SHORT&&(mt=r.RG16I),K===r.INT&&(mt=r.RG32I)),b===r.RGB_INTEGER&&(K===r.UNSIGNED_BYTE&&(mt=r.RGB8UI),K===r.UNSIGNED_SHORT&&(mt=r.RGB16UI),K===r.UNSIGNED_INT&&(mt=r.RGB32UI),K===r.BYTE&&(mt=r.RGB8I),K===r.SHORT&&(mt=r.RGB16I),K===r.INT&&(mt=r.RGB32I)),b===r.RGBA_INTEGER&&(K===r.UNSIGNED_BYTE&&(mt=r.RGBA8UI),K===r.UNSIGNED_SHORT&&(mt=r.RGBA16UI),K===r.UNSIGNED_INT&&(mt=r.RGBA32UI),K===r.BYTE&&(mt=r.RGBA8I),K===r.SHORT&&(mt=r.RGBA16I),K===r.INT&&(mt=r.RGBA32I)),b===r.RGB&&(K===r.UNSIGNED_INT_5_9_9_9_REV&&(mt=r.RGB9_E5),K===r.UNSIGNED_INT_10F_11F_11F_REV&&(mt=r.R11F_G11F_B10F)),b===r.RGBA){const Wt=Mt?gu:Re.getTransfer(_t);K===r.FLOAT&&(mt=r.RGBA32F),K===r.HALF_FLOAT&&(mt=r.RGBA16F),K===r.UNSIGNED_BYTE&&(mt=Wt===Fe?r.SRGB8_ALPHA8:r.RGBA8),K===r.UNSIGNED_SHORT_4_4_4_4&&(mt=r.RGBA4),K===r.UNSIGNED_SHORT_5_5_5_1&&(mt=r.RGB5_A1)}return(mt===r.R16F||mt===r.R32F||mt===r.RG16F||mt===r.RG32F||mt===r.RGBA16F||mt===r.RGBA32F)&&t.get("EXT_color_buffer_float"),mt}function U(z,b){let K;return z?b===null||b===sa||b===dl?K=r.DEPTH24_STENCIL8:b===ea?K=r.DEPTH32F_STENCIL8:b===hl&&(K=r.DEPTH24_STENCIL8,ee("DepthTexture: 16 bit depth attachment is not supported with stencil. Using 24-bit attachment.")):b===null||b===sa||b===dl?K=r.DEPTH_COMPONENT24:b===ea?K=r.DEPTH_COMPONENT32F:b===hl&&(K=r.DEPTH_COMPONENT16),K}function H(z,b){return x(z)===!0||z.isFramebufferTexture&&z.minFilter!==Nn&&z.minFilter!==Bn?Math.log2(Math.max(b.width,b.height))+1:z.mipmaps!==void 0&&z.mipmaps.length>0?z.mipmaps.length:z.isCompressedTexture&&Array.isArray(z.image)?b.mipmaps.length:1}function F(z){const b=z.target;b.removeEventListener("dispose",F),T(b),b.isVideoTexture&&v.delete(b)}function I(z){const b=z.target;b.removeEventListener("dispose",I),Q(b)}function T(z){const b=s.get(z);if(b.__webglInit===void 0)return;const K=z.source,_t=_.get(K);if(_t){const Mt=_t[b.__cacheKey];Mt.usedTimes--,Mt.usedTimes===0&&L(z),Object.keys(_t).length===0&&_.delete(K)}s.remove(z)}function L(z){const b=s.get(z);r.deleteTexture(b.__webglTexture);const K=z.source,_t=_.get(K);delete _t[b.__cacheKey],h.memory.textures--}function Q(z){const b=s.get(z);if(z.depthTexture&&(z.depthTexture.dispose(),s.remove(z.depthTexture)),z.isWebGLCubeRenderTarget)for(let _t=0;_t<6;_t++){if(Array.isArray(b.__webglFramebuffer[_t]))for(let Mt=0;Mt<b.__webglFramebuffer[_t].length;Mt++)r.deleteFramebuffer(b.__webglFramebuffer[_t][Mt]);else r.deleteFramebuffer(b.__webglFramebuffer[_t]);b.__webglDepthbuffer&&r.deleteRenderbuffer(b.__webglDepthbuffer[_t])}else{if(Array.isArray(b.__webglFramebuffer))for(let _t=0;_t<b.__webglFramebuffer.length;_t++)r.deleteFramebuffer(b.__webglFramebuffer[_t]);else r.deleteFramebuffer(b.__webglFramebuffer);if(b.__webglDepthbuffer&&r.deleteRenderbuffer(b.__webglDepthbuffer),b.__webglMultisampledFramebuffer&&r.deleteFramebuffer(b.__webglMultisampledFramebuffer),b.__webglColorRenderbuffer)for(let _t=0;_t<b.__webglColorRenderbuffer.length;_t++)b.__webglColorRenderbuffer[_t]&&r.deleteRenderbuffer(b.__webglColorRenderbuffer[_t]);b.__webglDepthRenderbuffer&&r.deleteRenderbuffer(b.__webglDepthRenderbuffer)}const K=z.textures;for(let _t=0,Mt=K.length;_t<Mt;_t++){const mt=s.get(K[_t]);mt.__webglTexture&&(r.deleteTexture(mt.__webglTexture),h.memory.textures--),s.remove(K[_t])}s.remove(z)}let P=0;function W(){P=0}function J(){const z=P;return z>=l.maxTextures&&ee("WebGLTextures: Trying to use "+z+" texture units while this GPU supports only "+l.maxTextures),P+=1,z}function rt(z){const b=[];return b.push(z.wrapS),b.push(z.wrapT),b.push(z.wrapR||0),b.push(z.magFilter),b.push(z.minFilter),b.push(z.anisotropy),b.push(z.internalFormat),b.push(z.format),b.push(z.type),b.push(z.generateMipmaps),b.push(z.premultiplyAlpha),b.push(z.flipY),b.push(z.unpackAlignment),b.push(z.colorSpace),b.join()}function et(z,b){const K=s.get(z);if(z.isVideoTexture&&be(z),z.isRenderTargetTexture===!1&&z.isExternalTexture!==!0&&z.version>0&&K.__version!==z.version){const _t=z.image;if(_t===null)ee("WebGLRenderer: Texture marked for update but no image data found.");else if(_t.complete===!1)ee("WebGLRenderer: Texture marked for update but image is incomplete");else{Z(K,z,b);return}}else z.isExternalTexture&&(K.__webglTexture=z.sourceTexture?z.sourceTexture:null);i.bindTexture(r.TEXTURE_2D,K.__webglTexture,r.TEXTURE0+b)}function O(z,b){const K=s.get(z);if(z.isRenderTargetTexture===!1&&z.version>0&&K.__version!==z.version){Z(K,z,b);return}else z.isExternalTexture&&(K.__webglTexture=z.sourceTexture?z.sourceTexture:null);i.bindTexture(r.TEXTURE_2D_ARRAY,K.__webglTexture,r.TEXTURE0+b)}function B(z,b){const K=s.get(z);if(z.isRenderTargetTexture===!1&&z.version>0&&K.__version!==z.version){Z(K,z,b);return}i.bindTexture(r.TEXTURE_3D,K.__webglTexture,r.TEXTURE0+b)}function at(z,b){const K=s.get(z);if(z.isCubeDepthTexture!==!0&&z.version>0&&K.__version!==z.version){dt(K,z,b);return}i.bindTexture(r.TEXTURE_CUBE_MAP,K.__webglTexture,r.TEXTURE0+b)}const $={[Ud]:r.REPEAT,[Ua]:r.CLAMP_TO_EDGE,[Ld]:r.MIRRORED_REPEAT},lt={[Nn]:r.NEAREST,[pM]:r.NEAREST_MIPMAP_NEAREST,[Lc]:r.NEAREST_MIPMAP_LINEAR,[Bn]:r.LINEAR,[Hh]:r.LINEAR_MIPMAP_NEAREST,[js]:r.LINEAR_MIPMAP_LINEAR},N={[_M]:r.NEVER,[MM]:r.ALWAYS,[vM]:r.LESS,[Rp]:r.LEQUAL,[xM]:r.EQUAL,[Cp]:r.GEQUAL,[SM]:r.GREATER,[yM]:r.NOTEQUAL};function k(z,b){if(b.type===ea&&t.has("OES_texture_float_linear")===!1&&(b.magFilter===Bn||b.magFilter===Hh||b.magFilter===Lc||b.magFilter===js||b.minFilter===Bn||b.minFilter===Hh||b.minFilter===Lc||b.minFilter===js)&&ee("WebGLRenderer: Unable to use linear filtering with floating point textures. OES_texture_float_linear not supported on this device."),r.texParameteri(z,r.TEXTURE_WRAP_S,$[b.wrapS]),r.texParameteri(z,r.TEXTURE_WRAP_T,$[b.wrapT]),(z===r.TEXTURE_3D||z===r.TEXTURE_2D_ARRAY)&&r.texParameteri(z,r.TEXTURE_WRAP_R,$[b.wrapR]),r.texParameteri(z,r.TEXTURE_MAG_FILTER,lt[b.magFilter]),r.texParameteri(z,r.TEXTURE_MIN_FILTER,lt[b.minFilter]),b.compareFunction&&(r.texParameteri(z,r.TEXTURE_COMPARE_MODE,r.COMPARE_REF_TO_TEXTURE),r.texParameteri(z,r.TEXTURE_COMPARE_FUNC,N[b.compareFunction])),t.has("EXT_texture_filter_anisotropic")===!0){if(b.magFilter===Nn||b.minFilter!==Lc&&b.minFilter!==js||b.type===ea&&t.has("OES_texture_float_linear")===!1)return;if(b.anisotropy>1||s.get(b).__currentAnisotropy){const K=t.get("EXT_texture_filter_anisotropic");r.texParameterf(z,K.TEXTURE_MAX_ANISOTROPY_EXT,Math.min(b.anisotropy,l.getMaxAnisotropy())),s.get(b).__currentAnisotropy=b.anisotropy}}}function ut(z,b){let K=!1;z.__webglInit===void 0&&(z.__webglInit=!0,b.addEventListener("dispose",F));const _t=b.source;let Mt=_.get(_t);Mt===void 0&&(Mt={},_.set(_t,Mt));const mt=rt(b);if(mt!==z.__cacheKey){Mt[mt]===void 0&&(Mt[mt]={texture:r.createTexture(),usedTimes:0},h.memory.textures++,K=!0),Mt[mt].usedTimes++;const Wt=Mt[z.__cacheKey];Wt!==void 0&&(Mt[z.__cacheKey].usedTimes--,Wt.usedTimes===0&&L(b)),z.__cacheKey=mt,z.__webglTexture=Mt[mt].texture}return K}function vt(z,b,K){return Math.floor(Math.floor(z/K)/b)}function Rt(z,b,K,_t){const mt=z.updateRanges;if(mt.length===0)i.texSubImage2D(r.TEXTURE_2D,0,0,0,b.width,b.height,K,_t,b.data);else{mt.sort((Tt,Et)=>Tt.start-Et.start);let Wt=0;for(let Tt=1;Tt<mt.length;Tt++){const Et=mt[Wt],Pt=mt[Tt],Ot=Et.start+Et.count,zt=vt(Pt.start,b.width,4),fe=vt(Et.start,b.width,4);Pt.start<=Ot+1&&zt===fe&&vt(Pt.start+Pt.count-1,b.width,4)===zt?Et.count=Math.max(Et.count,Pt.start+Pt.count-Et.start):(++Wt,mt[Wt]=Pt)}mt.length=Wt+1;const wt=r.getParameter(r.UNPACK_ROW_LENGTH),Kt=r.getParameter(r.UNPACK_SKIP_PIXELS),te=r.getParameter(r.UNPACK_SKIP_ROWS);r.pixelStorei(r.UNPACK_ROW_LENGTH,b.width);for(let Tt=0,Et=mt.length;Tt<Et;Tt++){const Pt=mt[Tt],Ot=Math.floor(Pt.start/4),zt=Math.ceil(Pt.count/4),fe=Ot%b.width,Y=Math.floor(Ot/b.width),Ct=zt,At=1;r.pixelStorei(r.UNPACK_SKIP_PIXELS,fe),r.pixelStorei(r.UNPACK_SKIP_ROWS,Y),i.texSubImage2D(r.TEXTURE_2D,0,fe,Y,Ct,At,K,_t,b.data)}z.clearUpdateRanges(),r.pixelStorei(r.UNPACK_ROW_LENGTH,wt),r.pixelStorei(r.UNPACK_SKIP_PIXELS,Kt),r.pixelStorei(r.UNPACK_SKIP_ROWS,te)}}function Z(z,b,K){let _t=r.TEXTURE_2D;(b.isDataArrayTexture||b.isCompressedArrayTexture)&&(_t=r.TEXTURE_2D_ARRAY),b.isData3DTexture&&(_t=r.TEXTURE_3D);const Mt=ut(z,b),mt=b.source;i.bindTexture(_t,z.__webglTexture,r.TEXTURE0+K);const Wt=s.get(mt);if(mt.version!==Wt.__version||Mt===!0){i.activeTexture(r.TEXTURE0+K);const wt=Re.getPrimaries(Re.workingColorSpace),Kt=b.colorSpace===gs?null:Re.getPrimaries(b.colorSpace),te=b.colorSpace===gs||wt===Kt?r.NONE:r.BROWSER_DEFAULT_WEBGL;r.pixelStorei(r.UNPACK_FLIP_Y_WEBGL,b.flipY),r.pixelStorei(r.UNPACK_PREMULTIPLY_ALPHA_WEBGL,b.premultiplyAlpha),r.pixelStorei(r.UNPACK_ALIGNMENT,b.unpackAlignment),r.pixelStorei(r.UNPACK_COLORSPACE_CONVERSION_WEBGL,te);let Tt=A(b.image,!1,l.maxTextureSize);Tt=Ne(b,Tt);const Et=c.convert(b.format,b.colorSpace),Pt=c.convert(b.type);let Ot=D(b.internalFormat,Et,Pt,b.colorSpace,b.isVideoTexture);k(_t,b);let zt;const fe=b.mipmaps,Y=b.isVideoTexture!==!0,Ct=Wt.__version===void 0||Mt===!0,At=mt.dataReady,It=H(b,Tt);if(b.isDepthTexture)Ot=U(b.format===Zs,b.type),Ct&&(Y?i.texStorage2D(r.TEXTURE_2D,1,Ot,Tt.width,Tt.height):i.texImage2D(r.TEXTURE_2D,0,Ot,Tt.width,Tt.height,0,Et,Pt,null));else if(b.isDataTexture)if(fe.length>0){Y&&Ct&&i.texStorage2D(r.TEXTURE_2D,It,Ot,fe[0].width,fe[0].height);for(let bt=0,pt=fe.length;bt<pt;bt++)zt=fe[bt],Y?At&&i.texSubImage2D(r.TEXTURE_2D,bt,0,0,zt.width,zt.height,Et,Pt,zt.data):i.texImage2D(r.TEXTURE_2D,bt,Ot,zt.width,zt.height,0,Et,Pt,zt.data);b.generateMipmaps=!1}else Y?(Ct&&i.texStorage2D(r.TEXTURE_2D,It,Ot,Tt.width,Tt.height),At&&Rt(b,Tt,Et,Pt)):i.texImage2D(r.TEXTURE_2D,0,Ot,Tt.width,Tt.height,0,Et,Pt,Tt.data);else if(b.isCompressedTexture)if(b.isCompressedArrayTexture){Y&&Ct&&i.texStorage3D(r.TEXTURE_2D_ARRAY,It,Ot,fe[0].width,fe[0].height,Tt.depth);for(let bt=0,pt=fe.length;bt<pt;bt++)if(zt=fe[bt],b.format!==ki)if(Et!==null)if(Y){if(At)if(b.layerUpdates.size>0){const Ht=ov(zt.width,zt.height,b.format,b.type);for(const ie of b.layerUpdates){const Pe=zt.data.subarray(ie*Ht/zt.data.BYTES_PER_ELEMENT,(ie+1)*Ht/zt.data.BYTES_PER_ELEMENT);i.compressedTexSubImage3D(r.TEXTURE_2D_ARRAY,bt,0,0,ie,zt.width,zt.height,1,Et,Pe)}b.clearLayerUpdates()}else i.compressedTexSubImage3D(r.TEXTURE_2D_ARRAY,bt,0,0,0,zt.width,zt.height,Tt.depth,Et,zt.data)}else i.compressedTexImage3D(r.TEXTURE_2D_ARRAY,bt,Ot,zt.width,zt.height,Tt.depth,0,zt.data,0,0);else ee("WebGLRenderer: Attempt to load unsupported compressed texture format in .uploadTexture()");else Y?At&&i.texSubImage3D(r.TEXTURE_2D_ARRAY,bt,0,0,0,zt.width,zt.height,Tt.depth,Et,Pt,zt.data):i.texImage3D(r.TEXTURE_2D_ARRAY,bt,Ot,zt.width,zt.height,Tt.depth,0,Et,Pt,zt.data)}else{Y&&Ct&&i.texStorage2D(r.TEXTURE_2D,It,Ot,fe[0].width,fe[0].height);for(let bt=0,pt=fe.length;bt<pt;bt++)zt=fe[bt],b.format!==ki?Et!==null?Y?At&&i.compressedTexSubImage2D(r.TEXTURE_2D,bt,0,0,zt.width,zt.height,Et,zt.data):i.compressedTexImage2D(r.TEXTURE_2D,bt,Ot,zt.width,zt.height,0,zt.data):ee("WebGLRenderer: Attempt to load unsupported compressed texture format in .uploadTexture()"):Y?At&&i.texSubImage2D(r.TEXTURE_2D,bt,0,0,zt.width,zt.height,Et,Pt,zt.data):i.texImage2D(r.TEXTURE_2D,bt,Ot,zt.width,zt.height,0,Et,Pt,zt.data)}else if(b.isDataArrayTexture)if(Y){if(Ct&&i.texStorage3D(r.TEXTURE_2D_ARRAY,It,Ot,Tt.width,Tt.height,Tt.depth),At)if(b.layerUpdates.size>0){const bt=ov(Tt.width,Tt.height,b.format,b.type);for(const pt of b.layerUpdates){const Ht=Tt.data.subarray(pt*bt/Tt.data.BYTES_PER_ELEMENT,(pt+1)*bt/Tt.data.BYTES_PER_ELEMENT);i.texSubImage3D(r.TEXTURE_2D_ARRAY,0,0,0,pt,Tt.width,Tt.height,1,Et,Pt,Ht)}b.clearLayerUpdates()}else i.texSubImage3D(r.TEXTURE_2D_ARRAY,0,0,0,0,Tt.width,Tt.height,Tt.depth,Et,Pt,Tt.data)}else i.texImage3D(r.TEXTURE_2D_ARRAY,0,Ot,Tt.width,Tt.height,Tt.depth,0,Et,Pt,Tt.data);else if(b.isData3DTexture)Y?(Ct&&i.texStorage3D(r.TEXTURE_3D,It,Ot,Tt.width,Tt.height,Tt.depth),At&&i.texSubImage3D(r.TEXTURE_3D,0,0,0,0,Tt.width,Tt.height,Tt.depth,Et,Pt,Tt.data)):i.texImage3D(r.TEXTURE_3D,0,Ot,Tt.width,Tt.height,Tt.depth,0,Et,Pt,Tt.data);else if(b.isFramebufferTexture){if(Ct)if(Y)i.texStorage2D(r.TEXTURE_2D,It,Ot,Tt.width,Tt.height);else{let bt=Tt.width,pt=Tt.height;for(let Ht=0;Ht<It;Ht++)i.texImage2D(r.TEXTURE_2D,Ht,Ot,bt,pt,0,Et,Pt,null),bt>>=1,pt>>=1}}else if(fe.length>0){if(Y&&Ct){const bt=Yt(fe[0]);i.texStorage2D(r.TEXTURE_2D,It,Ot,bt.width,bt.height)}for(let bt=0,pt=fe.length;bt<pt;bt++)zt=fe[bt],Y?At&&i.texSubImage2D(r.TEXTURE_2D,bt,0,0,Et,Pt,zt):i.texImage2D(r.TEXTURE_2D,bt,Ot,Et,Pt,zt);b.generateMipmaps=!1}else if(Y){if(Ct){const bt=Yt(Tt);i.texStorage2D(r.TEXTURE_2D,It,Ot,bt.width,bt.height)}At&&i.texSubImage2D(r.TEXTURE_2D,0,0,0,Et,Pt,Tt)}else i.texImage2D(r.TEXTURE_2D,0,Ot,Et,Pt,Tt);x(b)&&y(_t),Wt.__version=mt.version,b.onUpdate&&b.onUpdate(b)}z.__version=b.version}function dt(z,b,K){if(b.image.length!==6)return;const _t=ut(z,b),Mt=b.source;i.bindTexture(r.TEXTURE_CUBE_MAP,z.__webglTexture,r.TEXTURE0+K);const mt=s.get(Mt);if(Mt.version!==mt.__version||_t===!0){i.activeTexture(r.TEXTURE0+K);const Wt=Re.getPrimaries(Re.workingColorSpace),wt=b.colorSpace===gs?null:Re.getPrimaries(b.colorSpace),Kt=b.colorSpace===gs||Wt===wt?r.NONE:r.BROWSER_DEFAULT_WEBGL;r.pixelStorei(r.UNPACK_FLIP_Y_WEBGL,b.flipY),r.pixelStorei(r.UNPACK_PREMULTIPLY_ALPHA_WEBGL,b.premultiplyAlpha),r.pixelStorei(r.UNPACK_ALIGNMENT,b.unpackAlignment),r.pixelStorei(r.UNPACK_COLORSPACE_CONVERSION_WEBGL,Kt);const te=b.isCompressedTexture||b.image[0].isCompressedTexture,Tt=b.image[0]&&b.image[0].isDataTexture,Et=[];for(let pt=0;pt<6;pt++)!te&&!Tt?Et[pt]=A(b.image[pt],!0,l.maxCubemapSize):Et[pt]=Tt?b.image[pt].image:b.image[pt],Et[pt]=Ne(b,Et[pt]);const Pt=Et[0],Ot=c.convert(b.format,b.colorSpace),zt=c.convert(b.type),fe=D(b.internalFormat,Ot,zt,b.colorSpace),Y=b.isVideoTexture!==!0,Ct=mt.__version===void 0||_t===!0,At=Mt.dataReady;let It=H(b,Pt);k(r.TEXTURE_CUBE_MAP,b);let bt;if(te){Y&&Ct&&i.texStorage2D(r.TEXTURE_CUBE_MAP,It,fe,Pt.width,Pt.height);for(let pt=0;pt<6;pt++){bt=Et[pt].mipmaps;for(let Ht=0;Ht<bt.length;Ht++){const ie=bt[Ht];b.format!==ki?Ot!==null?Y?At&&i.compressedTexSubImage2D(r.TEXTURE_CUBE_MAP_POSITIVE_X+pt,Ht,0,0,ie.width,ie.height,Ot,ie.data):i.compressedTexImage2D(r.TEXTURE_CUBE_MAP_POSITIVE_X+pt,Ht,fe,ie.width,ie.height,0,ie.data):ee("WebGLRenderer: Attempt to load unsupported compressed texture format in .setTextureCube()"):Y?At&&i.texSubImage2D(r.TEXTURE_CUBE_MAP_POSITIVE_X+pt,Ht,0,0,ie.width,ie.height,Ot,zt,ie.data):i.texImage2D(r.TEXTURE_CUBE_MAP_POSITIVE_X+pt,Ht,fe,ie.width,ie.height,0,Ot,zt,ie.data)}}}else{if(bt=b.mipmaps,Y&&Ct){bt.length>0&&It++;const pt=Yt(Et[0]);i.texStorage2D(r.TEXTURE_CUBE_MAP,It,fe,pt.width,pt.height)}for(let pt=0;pt<6;pt++)if(Tt){Y?At&&i.texSubImage2D(r.TEXTURE_CUBE_MAP_POSITIVE_X+pt,0,0,0,Et[pt].width,Et[pt].height,Ot,zt,Et[pt].data):i.texImage2D(r.TEXTURE_CUBE_MAP_POSITIVE_X+pt,0,fe,Et[pt].width,Et[pt].height,0,Ot,zt,Et[pt].data);for(let Ht=0;Ht<bt.length;Ht++){const Pe=bt[Ht].image[pt].image;Y?At&&i.texSubImage2D(r.TEXTURE_CUBE_MAP_POSITIVE_X+pt,Ht+1,0,0,Pe.width,Pe.height,Ot,zt,Pe.data):i.texImage2D(r.TEXTURE_CUBE_MAP_POSITIVE_X+pt,Ht+1,fe,Pe.width,Pe.height,0,Ot,zt,Pe.data)}}else{Y?At&&i.texSubImage2D(r.TEXTURE_CUBE_MAP_POSITIVE_X+pt,0,0,0,Ot,zt,Et[pt]):i.texImage2D(r.TEXTURE_CUBE_MAP_POSITIVE_X+pt,0,fe,Ot,zt,Et[pt]);for(let Ht=0;Ht<bt.length;Ht++){const ie=bt[Ht];Y?At&&i.texSubImage2D(r.TEXTURE_CUBE_MAP_POSITIVE_X+pt,Ht+1,0,0,Ot,zt,ie.image[pt]):i.texImage2D(r.TEXTURE_CUBE_MAP_POSITIVE_X+pt,Ht+1,fe,Ot,zt,ie.image[pt])}}}x(b)&&y(r.TEXTURE_CUBE_MAP),mt.__version=Mt.version,b.onUpdate&&b.onUpdate(b)}z.__version=b.version}function yt(z,b,K,_t,Mt,mt){const Wt=c.convert(K.format,K.colorSpace),wt=c.convert(K.type),Kt=D(K.internalFormat,Wt,wt,K.colorSpace),te=s.get(b),Tt=s.get(K);if(Tt.__renderTarget=b,!te.__hasExternalTextures){const Et=Math.max(1,b.width>>mt),Pt=Math.max(1,b.height>>mt);Mt===r.TEXTURE_3D||Mt===r.TEXTURE_2D_ARRAY?i.texImage3D(Mt,mt,Kt,Et,Pt,b.depth,0,Wt,wt,null):i.texImage2D(Mt,mt,Kt,Et,Pt,0,Wt,wt,null)}i.bindFramebuffer(r.FRAMEBUFFER,z),je(b)?d.framebufferTexture2DMultisampleEXT(r.FRAMEBUFFER,_t,Mt,Tt.__webglTexture,0,V(b)):(Mt===r.TEXTURE_2D||Mt>=r.TEXTURE_CUBE_MAP_POSITIVE_X&&Mt<=r.TEXTURE_CUBE_MAP_NEGATIVE_Z)&&r.framebufferTexture2D(r.FRAMEBUFFER,_t,Mt,Tt.__webglTexture,mt),i.bindFramebuffer(r.FRAMEBUFFER,null)}function Ut(z,b,K){if(r.bindRenderbuffer(r.RENDERBUFFER,z),b.depthBuffer){const _t=b.depthTexture,Mt=_t&&_t.isDepthTexture?_t.type:null,mt=U(b.stencilBuffer,Mt),Wt=b.stencilBuffer?r.DEPTH_STENCIL_ATTACHMENT:r.DEPTH_ATTACHMENT;je(b)?d.renderbufferStorageMultisampleEXT(r.RENDERBUFFER,V(b),mt,b.width,b.height):K?r.renderbufferStorageMultisample(r.RENDERBUFFER,V(b),mt,b.width,b.height):r.renderbufferStorage(r.RENDERBUFFER,mt,b.width,b.height),r.framebufferRenderbuffer(r.FRAMEBUFFER,Wt,r.RENDERBUFFER,z)}else{const _t=b.textures;for(let Mt=0;Mt<_t.length;Mt++){const mt=_t[Mt],Wt=c.convert(mt.format,mt.colorSpace),wt=c.convert(mt.type),Kt=D(mt.internalFormat,Wt,wt,mt.colorSpace);je(b)?d.renderbufferStorageMultisampleEXT(r.RENDERBUFFER,V(b),Kt,b.width,b.height):K?r.renderbufferStorageMultisample(r.RENDERBUFFER,V(b),Kt,b.width,b.height):r.renderbufferStorage(r.RENDERBUFFER,Kt,b.width,b.height)}}r.bindRenderbuffer(r.RENDERBUFFER,null)}function Ft(z,b,K){const _t=b.isWebGLCubeRenderTarget===!0;if(i.bindFramebuffer(r.FRAMEBUFFER,z),!(b.depthTexture&&b.depthTexture.isDepthTexture))throw new Error("renderTarget.depthTexture must be an instance of THREE.DepthTexture");const Mt=s.get(b.depthTexture);if(Mt.__renderTarget=b,(!Mt.__webglTexture||b.depthTexture.image.width!==b.width||b.depthTexture.image.height!==b.height)&&(b.depthTexture.image.width=b.width,b.depthTexture.image.height=b.height,b.depthTexture.needsUpdate=!0),_t){if(Mt.__webglInit===void 0&&(Mt.__webglInit=!0,b.depthTexture.addEventListener("dispose",F)),Mt.__webglTexture===void 0){Mt.__webglTexture=r.createTexture(),i.bindTexture(r.TEXTURE_CUBE_MAP,Mt.__webglTexture),k(r.TEXTURE_CUBE_MAP,b.depthTexture);const te=c.convert(b.depthTexture.format),Tt=c.convert(b.depthTexture.type);let Et;b.depthTexture.format===za?Et=r.DEPTH_COMPONENT24:b.depthTexture.format===Zs&&(Et=r.DEPTH24_STENCIL8);for(let Pt=0;Pt<6;Pt++)r.texImage2D(r.TEXTURE_CUBE_MAP_POSITIVE_X+Pt,0,Et,b.width,b.height,0,te,Tt,null)}}else et(b.depthTexture,0);const mt=Mt.__webglTexture,Wt=V(b),wt=_t?r.TEXTURE_CUBE_MAP_POSITIVE_X+K:r.TEXTURE_2D,Kt=b.depthTexture.format===Zs?r.DEPTH_STENCIL_ATTACHMENT:r.DEPTH_ATTACHMENT;if(b.depthTexture.format===za)je(b)?d.framebufferTexture2DMultisampleEXT(r.FRAMEBUFFER,Kt,wt,mt,0,Wt):r.framebufferTexture2D(r.FRAMEBUFFER,Kt,wt,mt,0);else if(b.depthTexture.format===Zs)je(b)?d.framebufferTexture2DMultisampleEXT(r.FRAMEBUFFER,Kt,wt,mt,0,Wt):r.framebufferTexture2D(r.FRAMEBUFFER,Kt,wt,mt,0);else throw new Error("Unknown depthTexture format")}function Xt(z){const b=s.get(z),K=z.isWebGLCubeRenderTarget===!0;if(b.__boundDepthTexture!==z.depthTexture){const _t=z.depthTexture;if(b.__depthDisposeCallback&&b.__depthDisposeCallback(),_t){const Mt=()=>{delete b.__boundDepthTexture,delete b.__depthDisposeCallback,_t.removeEventListener("dispose",Mt)};_t.addEventListener("dispose",Mt),b.__depthDisposeCallback=Mt}b.__boundDepthTexture=_t}if(z.depthTexture&&!b.__autoAllocateDepthBuffer)if(K)for(let _t=0;_t<6;_t++)Ft(b.__webglFramebuffer[_t],z,_t);else{const _t=z.texture.mipmaps;_t&&_t.length>0?Ft(b.__webglFramebuffer[0],z,0):Ft(b.__webglFramebuffer,z,0)}else if(K){b.__webglDepthbuffer=[];for(let _t=0;_t<6;_t++)if(i.bindFramebuffer(r.FRAMEBUFFER,b.__webglFramebuffer[_t]),b.__webglDepthbuffer[_t]===void 0)b.__webglDepthbuffer[_t]=r.createRenderbuffer(),Ut(b.__webglDepthbuffer[_t],z,!1);else{const Mt=z.stencilBuffer?r.DEPTH_STENCIL_ATTACHMENT:r.DEPTH_ATTACHMENT,mt=b.__webglDepthbuffer[_t];r.bindRenderbuffer(r.RENDERBUFFER,mt),r.framebufferRenderbuffer(r.FRAMEBUFFER,Mt,r.RENDERBUFFER,mt)}}else{const _t=z.texture.mipmaps;if(_t&&_t.length>0?i.bindFramebuffer(r.FRAMEBUFFER,b.__webglFramebuffer[0]):i.bindFramebuffer(r.FRAMEBUFFER,b.__webglFramebuffer),b.__webglDepthbuffer===void 0)b.__webglDepthbuffer=r.createRenderbuffer(),Ut(b.__webglDepthbuffer,z,!1);else{const Mt=z.stencilBuffer?r.DEPTH_STENCIL_ATTACHMENT:r.DEPTH_ATTACHMENT,mt=b.__webglDepthbuffer;r.bindRenderbuffer(r.RENDERBUFFER,mt),r.framebufferRenderbuffer(r.FRAMEBUFFER,Mt,r.RENDERBUFFER,mt)}}i.bindFramebuffer(r.FRAMEBUFFER,null)}function ge(z,b,K){const _t=s.get(z);b!==void 0&&yt(_t.__webglFramebuffer,z,z.texture,r.COLOR_ATTACHMENT0,r.TEXTURE_2D,0),K!==void 0&&Xt(z)}function Jt(z){const b=z.texture,K=s.get(z),_t=s.get(b);z.addEventListener("dispose",I);const Mt=z.textures,mt=z.isWebGLCubeRenderTarget===!0,Wt=Mt.length>1;if(Wt||(_t.__webglTexture===void 0&&(_t.__webglTexture=r.createTexture()),_t.__version=b.version,h.memory.textures++),mt){K.__webglFramebuffer=[];for(let wt=0;wt<6;wt++)if(b.mipmaps&&b.mipmaps.length>0){K.__webglFramebuffer[wt]=[];for(let Kt=0;Kt<b.mipmaps.length;Kt++)K.__webglFramebuffer[wt][Kt]=r.createFramebuffer()}else K.__webglFramebuffer[wt]=r.createFramebuffer()}else{if(b.mipmaps&&b.mipmaps.length>0){K.__webglFramebuffer=[];for(let wt=0;wt<b.mipmaps.length;wt++)K.__webglFramebuffer[wt]=r.createFramebuffer()}else K.__webglFramebuffer=r.createFramebuffer();if(Wt)for(let wt=0,Kt=Mt.length;wt<Kt;wt++){const te=s.get(Mt[wt]);te.__webglTexture===void 0&&(te.__webglTexture=r.createTexture(),h.memory.textures++)}if(z.samples>0&&je(z)===!1){K.__webglMultisampledFramebuffer=r.createFramebuffer(),K.__webglColorRenderbuffer=[],i.bindFramebuffer(r.FRAMEBUFFER,K.__webglMultisampledFramebuffer);for(let wt=0;wt<Mt.length;wt++){const Kt=Mt[wt];K.__webglColorRenderbuffer[wt]=r.createRenderbuffer(),r.bindRenderbuffer(r.RENDERBUFFER,K.__webglColorRenderbuffer[wt]);const te=c.convert(Kt.format,Kt.colorSpace),Tt=c.convert(Kt.type),Et=D(Kt.internalFormat,te,Tt,Kt.colorSpace,z.isXRRenderTarget===!0),Pt=V(z);r.renderbufferStorageMultisample(r.RENDERBUFFER,Pt,Et,z.width,z.height),r.framebufferRenderbuffer(r.FRAMEBUFFER,r.COLOR_ATTACHMENT0+wt,r.RENDERBUFFER,K.__webglColorRenderbuffer[wt])}r.bindRenderbuffer(r.RENDERBUFFER,null),z.depthBuffer&&(K.__webglDepthRenderbuffer=r.createRenderbuffer(),Ut(K.__webglDepthRenderbuffer,z,!0)),i.bindFramebuffer(r.FRAMEBUFFER,null)}}if(mt){i.bindTexture(r.TEXTURE_CUBE_MAP,_t.__webglTexture),k(r.TEXTURE_CUBE_MAP,b);for(let wt=0;wt<6;wt++)if(b.mipmaps&&b.mipmaps.length>0)for(let Kt=0;Kt<b.mipmaps.length;Kt++)yt(K.__webglFramebuffer[wt][Kt],z,b,r.COLOR_ATTACHMENT0,r.TEXTURE_CUBE_MAP_POSITIVE_X+wt,Kt);else yt(K.__webglFramebuffer[wt],z,b,r.COLOR_ATTACHMENT0,r.TEXTURE_CUBE_MAP_POSITIVE_X+wt,0);x(b)&&y(r.TEXTURE_CUBE_MAP),i.unbindTexture()}else if(Wt){for(let wt=0,Kt=Mt.length;wt<Kt;wt++){const te=Mt[wt],Tt=s.get(te);let Et=r.TEXTURE_2D;(z.isWebGL3DRenderTarget||z.isWebGLArrayRenderTarget)&&(Et=z.isWebGL3DRenderTarget?r.TEXTURE_3D:r.TEXTURE_2D_ARRAY),i.bindTexture(Et,Tt.__webglTexture),k(Et,te),yt(K.__webglFramebuffer,z,te,r.COLOR_ATTACHMENT0+wt,Et,0),x(te)&&y(Et)}i.unbindTexture()}else{let wt=r.TEXTURE_2D;if((z.isWebGL3DRenderTarget||z.isWebGLArrayRenderTarget)&&(wt=z.isWebGL3DRenderTarget?r.TEXTURE_3D:r.TEXTURE_2D_ARRAY),i.bindTexture(wt,_t.__webglTexture),k(wt,b),b.mipmaps&&b.mipmaps.length>0)for(let Kt=0;Kt<b.mipmaps.length;Kt++)yt(K.__webglFramebuffer[Kt],z,b,r.COLOR_ATTACHMENT0,wt,Kt);else yt(K.__webglFramebuffer,z,b,r.COLOR_ATTACHMENT0,wt,0);x(b)&&y(wt),i.unbindTexture()}z.depthBuffer&&Xt(z)}function _e(z){const b=z.textures;for(let K=0,_t=b.length;K<_t;K++){const Mt=b[K];if(x(Mt)){const mt=w(z),Wt=s.get(Mt).__webglTexture;i.bindTexture(mt,Wt),y(mt),i.unbindTexture()}}}const Te=[],ae=[];function $e(z){if(z.samples>0){if(je(z)===!1){const b=z.textures,K=z.width,_t=z.height;let Mt=r.COLOR_BUFFER_BIT;const mt=z.stencilBuffer?r.DEPTH_STENCIL_ATTACHMENT:r.DEPTH_ATTACHMENT,Wt=s.get(z),wt=b.length>1;if(wt)for(let te=0;te<b.length;te++)i.bindFramebuffer(r.FRAMEBUFFER,Wt.__webglMultisampledFramebuffer),r.framebufferRenderbuffer(r.FRAMEBUFFER,r.COLOR_ATTACHMENT0+te,r.RENDERBUFFER,null),i.bindFramebuffer(r.FRAMEBUFFER,Wt.__webglFramebuffer),r.framebufferTexture2D(r.DRAW_FRAMEBUFFER,r.COLOR_ATTACHMENT0+te,r.TEXTURE_2D,null,0);i.bindFramebuffer(r.READ_FRAMEBUFFER,Wt.__webglMultisampledFramebuffer);const Kt=z.texture.mipmaps;Kt&&Kt.length>0?i.bindFramebuffer(r.DRAW_FRAMEBUFFER,Wt.__webglFramebuffer[0]):i.bindFramebuffer(r.DRAW_FRAMEBUFFER,Wt.__webglFramebuffer);for(let te=0;te<b.length;te++){if(z.resolveDepthBuffer&&(z.depthBuffer&&(Mt|=r.DEPTH_BUFFER_BIT),z.stencilBuffer&&z.resolveStencilBuffer&&(Mt|=r.STENCIL_BUFFER_BIT)),wt){r.framebufferRenderbuffer(r.READ_FRAMEBUFFER,r.COLOR_ATTACHMENT0,r.RENDERBUFFER,Wt.__webglColorRenderbuffer[te]);const Tt=s.get(b[te]).__webglTexture;r.framebufferTexture2D(r.DRAW_FRAMEBUFFER,r.COLOR_ATTACHMENT0,r.TEXTURE_2D,Tt,0)}r.blitFramebuffer(0,0,K,_t,0,0,K,_t,Mt,r.NEAREST),m===!0&&(Te.length=0,ae.length=0,Te.push(r.COLOR_ATTACHMENT0+te),z.depthBuffer&&z.resolveDepthBuffer===!1&&(Te.push(mt),ae.push(mt),r.invalidateFramebuffer(r.DRAW_FRAMEBUFFER,ae)),r.invalidateFramebuffer(r.READ_FRAMEBUFFER,Te))}if(i.bindFramebuffer(r.READ_FRAMEBUFFER,null),i.bindFramebuffer(r.DRAW_FRAMEBUFFER,null),wt)for(let te=0;te<b.length;te++){i.bindFramebuffer(r.FRAMEBUFFER,Wt.__webglMultisampledFramebuffer),r.framebufferRenderbuffer(r.FRAMEBUFFER,r.COLOR_ATTACHMENT0+te,r.RENDERBUFFER,Wt.__webglColorRenderbuffer[te]);const Tt=s.get(b[te]).__webglTexture;i.bindFramebuffer(r.FRAMEBUFFER,Wt.__webglFramebuffer),r.framebufferTexture2D(r.DRAW_FRAMEBUFFER,r.COLOR_ATTACHMENT0+te,r.TEXTURE_2D,Tt,0)}i.bindFramebuffer(r.DRAW_FRAMEBUFFER,Wt.__webglMultisampledFramebuffer)}else if(z.depthBuffer&&z.resolveDepthBuffer===!1&&m){const b=z.stencilBuffer?r.DEPTH_STENCIL_ATTACHMENT:r.DEPTH_ATTACHMENT;r.invalidateFramebuffer(r.DRAW_FRAMEBUFFER,[b])}}}function V(z){return Math.min(l.maxSamples,z.samples)}function je(z){const b=s.get(z);return z.samples>0&&t.has("WEBGL_multisampled_render_to_texture")===!0&&b.__useRenderToTexture!==!1}function be(z){const b=h.render.frame;v.get(z)!==b&&(v.set(z,b),z.update())}function Ne(z,b){const K=z.colorSpace,_t=z.format,Mt=z.type;return z.isCompressedTexture===!0||z.isVideoTexture===!0||K!==ao&&K!==gs&&(Re.getTransfer(K)===Fe?(_t!==ki||Mt!==mi)&&ee("WebGLTextures: sRGB encoded textures have to use RGBAFormat and UnsignedByteType."):Ue("WebGLTextures: Unsupported texture color space:",K)),b}function Yt(z){return typeof HTMLImageElement<"u"&&z instanceof HTMLImageElement?(p.width=z.naturalWidth||z.width,p.height=z.naturalHeight||z.height):typeof VideoFrame<"u"&&z instanceof VideoFrame?(p.width=z.displayWidth,p.height=z.displayHeight):(p.width=z.width,p.height=z.height),p}this.allocateTextureUnit=J,this.resetTextureUnits=W,this.setTexture2D=et,this.setTexture2DArray=O,this.setTexture3D=B,this.setTextureCube=at,this.rebindTextures=ge,this.setupRenderTarget=Jt,this.updateRenderTargetMipmap=_e,this.updateMultisampleRenderTarget=$e,this.setupDepthRenderbuffer=Xt,this.setupFrameBufferTexture=yt,this.useMultisampledRTT=je,this.isReversedDepthBuffer=function(){return i.buffers.depth.getReversed()}}function gR(r,t){function i(s,l=gs){let c;const h=Re.getTransfer(l);if(s===mi)return r.UNSIGNED_BYTE;if(s===Mp)return r.UNSIGNED_SHORT_4_4_4_4;if(s===Ep)return r.UNSIGNED_SHORT_5_5_5_1;if(s===$v)return r.UNSIGNED_INT_5_9_9_9_REV;if(s===tx)return r.UNSIGNED_INT_10F_11F_11F_REV;if(s===Qv)return r.BYTE;if(s===Jv)return r.SHORT;if(s===hl)return r.UNSIGNED_SHORT;if(s===yp)return r.INT;if(s===sa)return r.UNSIGNED_INT;if(s===ea)return r.FLOAT;if(s===Pa)return r.HALF_FLOAT;if(s===ex)return r.ALPHA;if(s===nx)return r.RGB;if(s===ki)return r.RGBA;if(s===za)return r.DEPTH_COMPONENT;if(s===Zs)return r.DEPTH_STENCIL;if(s===ix)return r.RED;if(s===bp)return r.RED_INTEGER;if(s===io)return r.RG;if(s===Tp)return r.RG_INTEGER;if(s===Ap)return r.RGBA_INTEGER;if(s===fu||s===hu||s===du||s===pu)if(h===Fe)if(c=t.get("WEBGL_compressed_texture_s3tc_srgb"),c!==null){if(s===fu)return c.COMPRESSED_SRGB_S3TC_DXT1_EXT;if(s===hu)return c.COMPRESSED_SRGB_ALPHA_S3TC_DXT1_EXT;if(s===du)return c.COMPRESSED_SRGB_ALPHA_S3TC_DXT3_EXT;if(s===pu)return c.COMPRESSED_SRGB_ALPHA_S3TC_DXT5_EXT}else return null;else if(c=t.get("WEBGL_compressed_texture_s3tc"),c!==null){if(s===fu)return c.COMPRESSED_RGB_S3TC_DXT1_EXT;if(s===hu)return c.COMPRESSED_RGBA_S3TC_DXT1_EXT;if(s===du)return c.COMPRESSED_RGBA_S3TC_DXT3_EXT;if(s===pu)return c.COMPRESSED_RGBA_S3TC_DXT5_EXT}else return null;if(s===Nd||s===Od||s===Pd||s===zd)if(c=t.get("WEBGL_compressed_texture_pvrtc"),c!==null){if(s===Nd)return c.COMPRESSED_RGB_PVRTC_4BPPV1_IMG;if(s===Od)return c.COMPRESSED_RGB_PVRTC_2BPPV1_IMG;if(s===Pd)return c.COMPRESSED_RGBA_PVRTC_4BPPV1_IMG;if(s===zd)return c.COMPRESSED_RGBA_PVRTC_2BPPV1_IMG}else return null;if(s===Id||s===Fd||s===Bd||s===Hd||s===Gd||s===Vd||s===kd)if(c=t.get("WEBGL_compressed_texture_etc"),c!==null){if(s===Id||s===Fd)return h===Fe?c.COMPRESSED_SRGB8_ETC2:c.COMPRESSED_RGB8_ETC2;if(s===Bd)return h===Fe?c.COMPRESSED_SRGB8_ALPHA8_ETC2_EAC:c.COMPRESSED_RGBA8_ETC2_EAC;if(s===Hd)return c.COMPRESSED_R11_EAC;if(s===Gd)return c.COMPRESSED_SIGNED_R11_EAC;if(s===Vd)return c.COMPRESSED_RG11_EAC;if(s===kd)return c.COMPRESSED_SIGNED_RG11_EAC}else return null;if(s===Xd||s===Wd||s===qd||s===Yd||s===jd||s===Zd||s===Kd||s===Qd||s===Jd||s===$d||s===tp||s===ep||s===np||s===ip)if(c=t.get("WEBGL_compressed_texture_astc"),c!==null){if(s===Xd)return h===Fe?c.COMPRESSED_SRGB8_ALPHA8_ASTC_4x4_KHR:c.COMPRESSED_RGBA_ASTC_4x4_KHR;if(s===Wd)return h===Fe?c.COMPRESSED_SRGB8_ALPHA8_ASTC_5x4_KHR:c.COMPRESSED_RGBA_ASTC_5x4_KHR;if(s===qd)return h===Fe?c.COMPRESSED_SRGB8_ALPHA8_ASTC_5x5_KHR:c.COMPRESSED_RGBA_ASTC_5x5_KHR;if(s===Yd)return h===Fe?c.COMPRESSED_SRGB8_ALPHA8_ASTC_6x5_KHR:c.COMPRESSED_RGBA_ASTC_6x5_KHR;if(s===jd)return h===Fe?c.COMPRESSED_SRGB8_ALPHA8_ASTC_6x6_KHR:c.COMPRESSED_RGBA_ASTC_6x6_KHR;if(s===Zd)return h===Fe?c.COMPRESSED_SRGB8_ALPHA8_ASTC_8x5_KHR:c.COMPRESSED_RGBA_ASTC_8x5_KHR;if(s===Kd)return h===Fe?c.COMPRESSED_SRGB8_ALPHA8_ASTC_8x6_KHR:c.COMPRESSED_RGBA_ASTC_8x6_KHR;if(s===Qd)return h===Fe?c.COMPRESSED_SRGB8_ALPHA8_ASTC_8x8_KHR:c.COMPRESSED_RGBA_ASTC_8x8_KHR;if(s===Jd)return h===Fe?c.COMPRESSED_SRGB8_ALPHA8_ASTC_10x5_KHR:c.COMPRESSED_RGBA_ASTC_10x5_KHR;if(s===$d)return h===Fe?c.COMPRESSED_SRGB8_ALPHA8_ASTC_10x6_KHR:c.COMPRESSED_RGBA_ASTC_10x6_KHR;if(s===tp)return h===Fe?c.COMPRESSED_SRGB8_ALPHA8_ASTC_10x8_KHR:c.COMPRESSED_RGBA_ASTC_10x8_KHR;if(s===ep)return h===Fe?c.COMPRESSED_SRGB8_ALPHA8_ASTC_10x10_KHR:c.COMPRESSED_RGBA_ASTC_10x10_KHR;if(s===np)return h===Fe?c.COMPRESSED_SRGB8_ALPHA8_ASTC_12x10_KHR:c.COMPRESSED_RGBA_ASTC_12x10_KHR;if(s===ip)return h===Fe?c.COMPRESSED_SRGB8_ALPHA8_ASTC_12x12_KHR:c.COMPRESSED_RGBA_ASTC_12x12_KHR}else return null;if(s===ap||s===sp||s===rp)if(c=t.get("EXT_texture_compression_bptc"),c!==null){if(s===ap)return h===Fe?c.COMPRESSED_SRGB_ALPHA_BPTC_UNORM_EXT:c.COMPRESSED_RGBA_BPTC_UNORM_EXT;if(s===sp)return c.COMPRESSED_RGB_BPTC_SIGNED_FLOAT_EXT;if(s===rp)return c.COMPRESSED_RGB_BPTC_UNSIGNED_FLOAT_EXT}else return null;if(s===op||s===lp||s===cp||s===up)if(c=t.get("EXT_texture_compression_rgtc"),c!==null){if(s===op)return c.COMPRESSED_RED_RGTC1_EXT;if(s===lp)return c.COMPRESSED_SIGNED_RED_RGTC1_EXT;if(s===cp)return c.COMPRESSED_RED_GREEN_RGTC2_EXT;if(s===up)return c.COMPRESSED_SIGNED_RED_GREEN_RGTC2_EXT}else return null;return s===dl?r.UNSIGNED_INT_24_8:r[s]!==void 0?r[s]:null}return{convert:i}}const _R=`
4033
+ }`,pR=[new j(1,0,0),new j(-1,0,0),new j(0,1,0),new j(0,-1,0),new j(0,0,1),new j(0,0,-1)],mR=[new j(0,-1,0),new j(0,-1,0),new j(0,0,1),new j(0,0,-1),new j(0,-1,0),new j(0,-1,0)],Uv=new Je,cl=new j,xd=new j;function gR(r,t,i){let s=new Op;const l=new le,c=new le,h=new We,d=new ME,m=new EE,p={},v=i.maxTextureSize,g={[xs]:ti,[ti]:xs,[Bi]:Bi},_=new ki({defines:{VSM_SAMPLES:8},uniforms:{shadow_pass:{value:null},resolution:{value:new le},radius:{value:4}},vertexShader:hR,fragmentShader:dR}),M=_.clone();M.defines.HORIZONTAL_PASS=1;const E=new Ln;E.setAttribute("position",new pi(new Float32Array([-1,-1,.5,3,-1,.5,-1,3,.5]),3));const A=new mi(E,_),y=this;this.enabled=!1,this.autoUpdate=!0,this.needsUpdate=!1,this.type=hu;let S=this.type;this.render=function(F,I,T){if(y.enabled===!1||y.autoUpdate===!1&&y.needsUpdate===!1||F.length===0)return;this.type===Ky&&(ee("WebGLShadowMap: PCFSoftShadowMap has been deprecated. Using PCFShadowMap instead."),this.type=hu);const L=r.getRenderTarget(),Q=r.getActiveCubeFace(),P=r.getActiveMipmapLevel(),W=r.state;W.setBlending(La),W.buffers.depth.getReversed()===!0?W.buffers.color.setClear(0,0,0,0):W.buffers.color.setClear(1,1,1,1),W.buffers.depth.setTest(!0),W.setScissorTest(!1);const J=S!==this.type;J&&I.traverse(function(rt){rt.material&&(Array.isArray(rt.material)?rt.material.forEach(et=>et.needsUpdate=!0):rt.material.needsUpdate=!0)});for(let rt=0,et=F.length;rt<et;rt++){const O=F[rt],B=O.shadow;if(B===void 0){ee("WebGLShadowMap:",O,"has no shadow.");continue}if(B.autoUpdate===!1&&B.needsUpdate===!1)continue;l.copy(B.mapSize);const at=B.getFrameExtents();l.multiply(at),c.copy(B.mapSize),(l.x>v||l.y>v)&&(l.x>v&&(c.x=Math.floor(v/at.x),l.x=c.x*at.x,B.mapSize.x=c.x),l.y>v&&(c.y=Math.floor(v/at.y),l.y=c.y*at.y,B.mapSize.y=c.y));const $=r.state.buffers.depth.getReversed();if(B.camera._reversedDepth=$,B.map===null||J===!0){if(B.map!==null&&(B.map.depthTexture!==null&&(B.map.depthTexture.dispose(),B.map.depthTexture=null),B.map.dispose()),this.type===ul){if(O.isPointLight){ee("WebGLShadowMap: VSM shadow maps are not supported for PointLights. Use PCF or BasicShadowMap instead.");continue}B.map=new ia(l.x,l.y,{format:so,type:Pa,minFilter:zn,magFilter:zn,generateMipmaps:!1}),B.map.texture.name=O.name+".shadowMap",B.map.depthTexture=new xl(l.x,l.y,ta),B.map.depthTexture.name=O.name+".shadowMapDepth",B.map.depthTexture.format=za,B.map.depthTexture.compareFunction=null,B.map.depthTexture.minFilter=Dn,B.map.depthTexture.magFilter=Dn}else O.isPointLight?(B.map=new xx(l.x),B.map.depthTexture=new gE(l.x,aa)):(B.map=new ia(l.x,l.y),B.map.depthTexture=new xl(l.x,l.y,aa)),B.map.depthTexture.name=O.name+".shadowMap",B.map.depthTexture.format=za,this.type===hu?(B.map.depthTexture.compareFunction=$?wp:Cp,B.map.depthTexture.minFilter=zn,B.map.depthTexture.magFilter=zn):(B.map.depthTexture.compareFunction=null,B.map.depthTexture.minFilter=Dn,B.map.depthTexture.magFilter=Dn);B.camera.updateProjectionMatrix()}const lt=B.map.isWebGLCubeRenderTarget?6:1;for(let N=0;N<lt;N++){if(B.map.isWebGLCubeRenderTarget)r.setRenderTarget(B.map,N),r.clear();else{N===0&&(r.setRenderTarget(B.map),r.clear());const k=B.getViewport(N);h.set(c.x*k.x,c.y*k.y,c.x*k.z,c.y*k.w),W.viewport(h)}if(O.isPointLight){const k=B.camera,ut=B.matrix,vt=O.distance||k.far;vt!==k.far&&(k.far=vt,k.updateProjectionMatrix()),cl.setFromMatrixPosition(O.matrixWorld),k.position.copy(cl),xd.copy(k.position),xd.add(pR[N]),k.up.copy(mR[N]),k.lookAt(xd),k.updateMatrixWorld(),ut.makeTranslation(-cl.x,-cl.y,-cl.z),Uv.multiplyMatrices(k.projectionMatrix,k.matrixWorldInverse),B._frustum.setFromProjectionMatrix(Uv,k.coordinateSystem,k.reversedDepth)}else B.updateMatrices(O);s=B.getFrustum(),U(I,T,B.camera,O,this.type)}B.isPointLightShadow!==!0&&this.type===ul&&w(B,T),B.needsUpdate=!1}S=this.type,y.needsUpdate=!1,r.setRenderTarget(L,Q,P)};function w(F,I){const T=t.update(A);_.defines.VSM_SAMPLES!==F.blurSamples&&(_.defines.VSM_SAMPLES=F.blurSamples,M.defines.VSM_SAMPLES=F.blurSamples,_.needsUpdate=!0,M.needsUpdate=!0),F.mapPass===null&&(F.mapPass=new ia(l.x,l.y,{format:so,type:Pa})),_.uniforms.shadow_pass.value=F.map.depthTexture,_.uniforms.resolution.value=F.mapSize,_.uniforms.radius.value=F.radius,r.setRenderTarget(F.mapPass),r.clear(),r.renderBufferDirect(I,null,T,_,A,null),M.uniforms.shadow_pass.value=F.mapPass.texture,M.uniforms.resolution.value=F.mapSize,M.uniforms.radius.value=F.radius,r.setRenderTarget(F.map),r.clear(),r.renderBufferDirect(I,null,T,M,A,null)}function D(F,I,T,L){let Q=null;const P=T.isPointLight===!0?F.customDistanceMaterial:F.customDepthMaterial;if(P!==void 0)Q=P;else if(Q=T.isPointLight===!0?m:d,r.localClippingEnabled&&I.clipShadows===!0&&Array.isArray(I.clippingPlanes)&&I.clippingPlanes.length!==0||I.displacementMap&&I.displacementScale!==0||I.alphaMap&&I.alphaTest>0||I.map&&I.alphaTest>0||I.alphaToCoverage===!0){const W=Q.uuid,J=I.uuid;let rt=p[W];rt===void 0&&(rt={},p[W]=rt);let et=rt[J];et===void 0&&(et=Q.clone(),rt[J]=et,I.addEventListener("dispose",H)),Q=et}if(Q.visible=I.visible,Q.wireframe=I.wireframe,L===ul?Q.side=I.shadowSide!==null?I.shadowSide:I.side:Q.side=I.shadowSide!==null?I.shadowSide:g[I.side],Q.alphaMap=I.alphaMap,Q.alphaTest=I.alphaToCoverage===!0?.5:I.alphaTest,Q.map=I.map,Q.clipShadows=I.clipShadows,Q.clippingPlanes=I.clippingPlanes,Q.clipIntersection=I.clipIntersection,Q.displacementMap=I.displacementMap,Q.displacementScale=I.displacementScale,Q.displacementBias=I.displacementBias,Q.wireframeLinewidth=I.wireframeLinewidth,Q.linewidth=I.linewidth,T.isPointLight===!0&&Q.isMeshDistanceMaterial===!0){const W=r.properties.get(Q);W.light=T}return Q}function U(F,I,T,L,Q){if(F.visible===!1)return;if(F.layers.test(I.layers)&&(F.isMesh||F.isLine||F.isPoints)&&(F.castShadow||F.receiveShadow&&Q===ul)&&(!F.frustumCulled||s.intersectsObject(F))){F.modelViewMatrix.multiplyMatrices(T.matrixWorldInverse,F.matrixWorld);const J=t.update(F),rt=F.material;if(Array.isArray(rt)){const et=J.groups;for(let O=0,B=et.length;O<B;O++){const at=et[O],$=rt[at.materialIndex];if($&&$.visible){const lt=D(F,$,L,Q);F.onBeforeShadow(r,F,I,T,J,lt,at),r.renderBufferDirect(T,null,J,lt,F,at),F.onAfterShadow(r,F,I,T,J,lt,at)}}}else if(rt.visible){const et=D(F,rt,L,Q);F.onBeforeShadow(r,F,I,T,J,et,null),r.renderBufferDirect(T,null,J,et,F,null),F.onAfterShadow(r,F,I,T,J,et,null)}}const W=F.children;for(let J=0,rt=W.length;J<rt;J++)U(W[J],I,T,L,Q)}function H(F){F.target.removeEventListener("dispose",H);for(const T in p){const L=p[T],Q=F.target.uuid;Q in L&&(L[Q].dispose(),delete L[Q])}}}function _R(r,t){function i(){let Y=!1;const Ct=new We;let At=null;const It=new We(0,0,0,0);return{setMask:function(bt){At!==bt&&!Y&&(r.colorMask(bt,bt,bt,bt),At=bt)},setLocked:function(bt){Y=bt},setClear:function(bt,pt,Ht,ie,Pe){Pe===!0&&(bt*=ie,pt*=ie,Ht*=ie),Ct.set(bt,pt,Ht,ie),It.equals(Ct)===!1&&(r.clearColor(bt,pt,Ht,ie),It.copy(Ct))},reset:function(){Y=!1,At=null,It.set(-1,0,0,0)}}}function s(){let Y=!1,Ct=!1,At=null,It=null,bt=null;return{setReversed:function(pt){if(Ct!==pt){const Ht=t.get("EXT_clip_control");pt?Ht.clipControlEXT(Ht.LOWER_LEFT_EXT,Ht.ZERO_TO_ONE_EXT):Ht.clipControlEXT(Ht.LOWER_LEFT_EXT,Ht.NEGATIVE_ONE_TO_ONE_EXT),Ct=pt;const ie=bt;bt=null,this.setClear(ie)}},getReversed:function(){return Ct},setTest:function(pt){pt?dt(r.DEPTH_TEST):yt(r.DEPTH_TEST)},setMask:function(pt){At!==pt&&!Y&&(r.depthMask(pt),At=pt)},setFunc:function(pt){if(Ct&&(pt=wM[pt]),It!==pt){switch(pt){case Ad:r.depthFunc(r.NEVER);break;case Rd:r.depthFunc(r.ALWAYS);break;case Cd:r.depthFunc(r.LESS);break;case io:r.depthFunc(r.LEQUAL);break;case wd:r.depthFunc(r.EQUAL);break;case Dd:r.depthFunc(r.GEQUAL);break;case Ud:r.depthFunc(r.GREATER);break;case Ld:r.depthFunc(r.NOTEQUAL);break;default:r.depthFunc(r.LEQUAL)}It=pt}},setLocked:function(pt){Y=pt},setClear:function(pt){bt!==pt&&(bt=pt,Ct&&(pt=1-pt),r.clearDepth(pt))},reset:function(){Y=!1,At=null,It=null,bt=null,Ct=!1}}}function l(){let Y=!1,Ct=null,At=null,It=null,bt=null,pt=null,Ht=null,ie=null,Pe=null;return{setTest:function(Ae){Y||(Ae?dt(r.STENCIL_TEST):yt(r.STENCIL_TEST))},setMask:function(Ae){Ct!==Ae&&!Y&&(r.stencilMask(Ae),Ct=Ae)},setFunc:function(Ae,In,Ri){(At!==Ae||It!==In||bt!==Ri)&&(r.stencilFunc(Ae,In,Ri),At=Ae,It=In,bt=Ri)},setOp:function(Ae,In,Ri){(pt!==Ae||Ht!==In||ie!==Ri)&&(r.stencilOp(Ae,In,Ri),pt=Ae,Ht=In,ie=Ri)},setLocked:function(Ae){Y=Ae},setClear:function(Ae){Pe!==Ae&&(r.clearStencil(Ae),Pe=Ae)},reset:function(){Y=!1,Ct=null,At=null,It=null,bt=null,pt=null,Ht=null,ie=null,Pe=null}}}const c=new i,h=new s,d=new l,m=new WeakMap,p=new WeakMap;let v={},g={},_=new WeakMap,M=[],E=null,A=!1,y=null,S=null,w=null,D=null,U=null,H=null,F=null,I=new Se(0,0,0),T=0,L=!1,Q=null,P=null,W=null,J=null,rt=null;const et=r.getParameter(r.MAX_COMBINED_TEXTURE_IMAGE_UNITS);let O=!1,B=0;const at=r.getParameter(r.VERSION);at.indexOf("WebGL")!==-1?(B=parseFloat(/^WebGL (\d)/.exec(at)[1]),O=B>=1):at.indexOf("OpenGL ES")!==-1&&(B=parseFloat(/^OpenGL ES (\d)/.exec(at)[1]),O=B>=2);let $=null,lt={};const N=r.getParameter(r.SCISSOR_BOX),k=r.getParameter(r.VIEWPORT),ut=new We().fromArray(N),vt=new We().fromArray(k);function Rt(Y,Ct,At,It){const bt=new Uint8Array(4),pt=r.createTexture();r.bindTexture(Y,pt),r.texParameteri(Y,r.TEXTURE_MIN_FILTER,r.NEAREST),r.texParameteri(Y,r.TEXTURE_MAG_FILTER,r.NEAREST);for(let Ht=0;Ht<At;Ht++)Y===r.TEXTURE_3D||Y===r.TEXTURE_2D_ARRAY?r.texImage3D(Ct,0,r.RGBA,1,1,It,0,r.RGBA,r.UNSIGNED_BYTE,bt):r.texImage2D(Ct+Ht,0,r.RGBA,1,1,0,r.RGBA,r.UNSIGNED_BYTE,bt);return pt}const Z={};Z[r.TEXTURE_2D]=Rt(r.TEXTURE_2D,r.TEXTURE_2D,1),Z[r.TEXTURE_CUBE_MAP]=Rt(r.TEXTURE_CUBE_MAP,r.TEXTURE_CUBE_MAP_POSITIVE_X,6),Z[r.TEXTURE_2D_ARRAY]=Rt(r.TEXTURE_2D_ARRAY,r.TEXTURE_2D_ARRAY,1,1),Z[r.TEXTURE_3D]=Rt(r.TEXTURE_3D,r.TEXTURE_3D,1,1),c.setClear(0,0,0,1),h.setClear(1),d.setClear(0),dt(r.DEPTH_TEST),h.setFunc(io),ae(!1),$e(R_),dt(r.CULL_FACE),_e(La);function dt(Y){v[Y]!==!0&&(r.enable(Y),v[Y]=!0)}function yt(Y){v[Y]!==!1&&(r.disable(Y),v[Y]=!1)}function Ut(Y,Ct){return g[Y]!==Ct?(r.bindFramebuffer(Y,Ct),g[Y]=Ct,Y===r.DRAW_FRAMEBUFFER&&(g[r.FRAMEBUFFER]=Ct),Y===r.FRAMEBUFFER&&(g[r.DRAW_FRAMEBUFFER]=Ct),!0):!1}function Ft(Y,Ct){let At=M,It=!1;if(Y){At=_.get(Ct),At===void 0&&(At=[],_.set(Ct,At));const bt=Y.textures;if(At.length!==bt.length||At[0]!==r.COLOR_ATTACHMENT0){for(let pt=0,Ht=bt.length;pt<Ht;pt++)At[pt]=r.COLOR_ATTACHMENT0+pt;At.length=bt.length,It=!0}}else At[0]!==r.BACK&&(At[0]=r.BACK,It=!0);It&&r.drawBuffers(At)}function Xt(Y){return E!==Y?(r.useProgram(Y),E=Y,!0):!1}const ge={[qs]:r.FUNC_ADD,[Jy]:r.FUNC_SUBTRACT,[$y]:r.FUNC_REVERSE_SUBTRACT};ge[tM]=r.MIN,ge[eM]=r.MAX;const Jt={[nM]:r.ZERO,[iM]:r.ONE,[aM]:r.SRC_COLOR,[bd]:r.SRC_ALPHA,[uM]:r.SRC_ALPHA_SATURATE,[lM]:r.DST_COLOR,[rM]:r.DST_ALPHA,[sM]:r.ONE_MINUS_SRC_COLOR,[Td]:r.ONE_MINUS_SRC_ALPHA,[cM]:r.ONE_MINUS_DST_COLOR,[oM]:r.ONE_MINUS_DST_ALPHA,[fM]:r.CONSTANT_COLOR,[hM]:r.ONE_MINUS_CONSTANT_COLOR,[dM]:r.CONSTANT_ALPHA,[pM]:r.ONE_MINUS_CONSTANT_ALPHA};function _e(Y,Ct,At,It,bt,pt,Ht,ie,Pe,Ae){if(Y===La){A===!0&&(yt(r.BLEND),A=!1);return}if(A===!1&&(dt(r.BLEND),A=!0),Y!==Qy){if(Y!==y||Ae!==L){if((S!==qs||U!==qs)&&(r.blendEquation(r.FUNC_ADD),S=qs,U=qs),Ae)switch(Y){case eo:r.blendFuncSeparate(r.ONE,r.ONE_MINUS_SRC_ALPHA,r.ONE,r.ONE_MINUS_SRC_ALPHA);break;case C_:r.blendFunc(r.ONE,r.ONE);break;case w_:r.blendFuncSeparate(r.ZERO,r.ONE_MINUS_SRC_COLOR,r.ZERO,r.ONE);break;case D_:r.blendFuncSeparate(r.DST_COLOR,r.ONE_MINUS_SRC_ALPHA,r.ZERO,r.ONE);break;default:Ue("WebGLState: Invalid blending: ",Y);break}else switch(Y){case eo:r.blendFuncSeparate(r.SRC_ALPHA,r.ONE_MINUS_SRC_ALPHA,r.ONE,r.ONE_MINUS_SRC_ALPHA);break;case C_:r.blendFuncSeparate(r.SRC_ALPHA,r.ONE,r.ONE,r.ONE);break;case w_:Ue("WebGLState: SubtractiveBlending requires material.premultipliedAlpha = true");break;case D_:Ue("WebGLState: MultiplyBlending requires material.premultipliedAlpha = true");break;default:Ue("WebGLState: Invalid blending: ",Y);break}w=null,D=null,H=null,F=null,I.set(0,0,0),T=0,y=Y,L=Ae}return}bt=bt||Ct,pt=pt||At,Ht=Ht||It,(Ct!==S||bt!==U)&&(r.blendEquationSeparate(ge[Ct],ge[bt]),S=Ct,U=bt),(At!==w||It!==D||pt!==H||Ht!==F)&&(r.blendFuncSeparate(Jt[At],Jt[It],Jt[pt],Jt[Ht]),w=At,D=It,H=pt,F=Ht),(ie.equals(I)===!1||Pe!==T)&&(r.blendColor(ie.r,ie.g,ie.b,Pe),I.copy(ie),T=Pe),y=Y,L=!1}function Te(Y,Ct){Y.side===Bi?yt(r.CULL_FACE):dt(r.CULL_FACE);let At=Y.side===ti;Ct&&(At=!At),ae(At),Y.blending===eo&&Y.transparent===!1?_e(La):_e(Y.blending,Y.blendEquation,Y.blendSrc,Y.blendDst,Y.blendEquationAlpha,Y.blendSrcAlpha,Y.blendDstAlpha,Y.blendColor,Y.blendAlpha,Y.premultipliedAlpha),h.setFunc(Y.depthFunc),h.setTest(Y.depthTest),h.setMask(Y.depthWrite),c.setMask(Y.colorWrite);const It=Y.stencilWrite;d.setTest(It),It&&(d.setMask(Y.stencilWriteMask),d.setFunc(Y.stencilFunc,Y.stencilRef,Y.stencilFuncMask),d.setOp(Y.stencilFail,Y.stencilZFail,Y.stencilZPass)),je(Y.polygonOffset,Y.polygonOffsetFactor,Y.polygonOffsetUnits),Y.alphaToCoverage===!0?dt(r.SAMPLE_ALPHA_TO_COVERAGE):yt(r.SAMPLE_ALPHA_TO_COVERAGE)}function ae(Y){Q!==Y&&(Y?r.frontFace(r.CW):r.frontFace(r.CCW),Q=Y)}function $e(Y){Y!==jy?(dt(r.CULL_FACE),Y!==P&&(Y===R_?r.cullFace(r.BACK):Y===Zy?r.cullFace(r.FRONT):r.cullFace(r.FRONT_AND_BACK))):yt(r.CULL_FACE),P=Y}function V(Y){Y!==W&&(O&&r.lineWidth(Y),W=Y)}function je(Y,Ct,At){Y?(dt(r.POLYGON_OFFSET_FILL),(J!==Ct||rt!==At)&&(J=Ct,rt=At,h.getReversed()&&(Ct=-Ct),r.polygonOffset(Ct,At))):yt(r.POLYGON_OFFSET_FILL)}function be(Y){Y?dt(r.SCISSOR_TEST):yt(r.SCISSOR_TEST)}function Ne(Y){Y===void 0&&(Y=r.TEXTURE0+et-1),$!==Y&&(r.activeTexture(Y),$=Y)}function Yt(Y,Ct,At){At===void 0&&($===null?At=r.TEXTURE0+et-1:At=$);let It=lt[At];It===void 0&&(It={type:void 0,texture:void 0},lt[At]=It),(It.type!==Y||It.texture!==Ct)&&($!==At&&(r.activeTexture(At),$=At),r.bindTexture(Y,Ct||Z[Y]),It.type=Y,It.texture=Ct)}function z(){const Y=lt[$];Y!==void 0&&Y.type!==void 0&&(r.bindTexture(Y.type,null),Y.type=void 0,Y.texture=void 0)}function b(){try{r.compressedTexImage2D(...arguments)}catch(Y){Ue("WebGLState:",Y)}}function K(){try{r.compressedTexImage3D(...arguments)}catch(Y){Ue("WebGLState:",Y)}}function _t(){try{r.texSubImage2D(...arguments)}catch(Y){Ue("WebGLState:",Y)}}function Mt(){try{r.texSubImage3D(...arguments)}catch(Y){Ue("WebGLState:",Y)}}function mt(){try{r.compressedTexSubImage2D(...arguments)}catch(Y){Ue("WebGLState:",Y)}}function Wt(){try{r.compressedTexSubImage3D(...arguments)}catch(Y){Ue("WebGLState:",Y)}}function wt(){try{r.texStorage2D(...arguments)}catch(Y){Ue("WebGLState:",Y)}}function Kt(){try{r.texStorage3D(...arguments)}catch(Y){Ue("WebGLState:",Y)}}function te(){try{r.texImage2D(...arguments)}catch(Y){Ue("WebGLState:",Y)}}function Tt(){try{r.texImage3D(...arguments)}catch(Y){Ue("WebGLState:",Y)}}function Et(Y){ut.equals(Y)===!1&&(r.scissor(Y.x,Y.y,Y.z,Y.w),ut.copy(Y))}function Pt(Y){vt.equals(Y)===!1&&(r.viewport(Y.x,Y.y,Y.z,Y.w),vt.copy(Y))}function Ot(Y,Ct){let At=p.get(Ct);At===void 0&&(At=new WeakMap,p.set(Ct,At));let It=At.get(Y);It===void 0&&(It=r.getUniformBlockIndex(Ct,Y.name),At.set(Y,It))}function zt(Y,Ct){const It=p.get(Ct).get(Y);m.get(Ct)!==It&&(r.uniformBlockBinding(Ct,It,Y.__bindingPointIndex),m.set(Ct,It))}function fe(){r.disable(r.BLEND),r.disable(r.CULL_FACE),r.disable(r.DEPTH_TEST),r.disable(r.POLYGON_OFFSET_FILL),r.disable(r.SCISSOR_TEST),r.disable(r.STENCIL_TEST),r.disable(r.SAMPLE_ALPHA_TO_COVERAGE),r.blendEquation(r.FUNC_ADD),r.blendFunc(r.ONE,r.ZERO),r.blendFuncSeparate(r.ONE,r.ZERO,r.ONE,r.ZERO),r.blendColor(0,0,0,0),r.colorMask(!0,!0,!0,!0),r.clearColor(0,0,0,0),r.depthMask(!0),r.depthFunc(r.LESS),h.setReversed(!1),r.clearDepth(1),r.stencilMask(4294967295),r.stencilFunc(r.ALWAYS,0,4294967295),r.stencilOp(r.KEEP,r.KEEP,r.KEEP),r.clearStencil(0),r.cullFace(r.BACK),r.frontFace(r.CCW),r.polygonOffset(0,0),r.activeTexture(r.TEXTURE0),r.bindFramebuffer(r.FRAMEBUFFER,null),r.bindFramebuffer(r.DRAW_FRAMEBUFFER,null),r.bindFramebuffer(r.READ_FRAMEBUFFER,null),r.useProgram(null),r.lineWidth(1),r.scissor(0,0,r.canvas.width,r.canvas.height),r.viewport(0,0,r.canvas.width,r.canvas.height),v={},$=null,lt={},g={},_=new WeakMap,M=[],E=null,A=!1,y=null,S=null,w=null,D=null,U=null,H=null,F=null,I=new Se(0,0,0),T=0,L=!1,Q=null,P=null,W=null,J=null,rt=null,ut.set(0,0,r.canvas.width,r.canvas.height),vt.set(0,0,r.canvas.width,r.canvas.height),c.reset(),h.reset(),d.reset()}return{buffers:{color:c,depth:h,stencil:d},enable:dt,disable:yt,bindFramebuffer:Ut,drawBuffers:Ft,useProgram:Xt,setBlending:_e,setMaterial:Te,setFlipSided:ae,setCullFace:$e,setLineWidth:V,setPolygonOffset:je,setScissorTest:be,activeTexture:Ne,bindTexture:Yt,unbindTexture:z,compressedTexImage2D:b,compressedTexImage3D:K,texImage2D:te,texImage3D:Tt,updateUBOMapping:Ot,uniformBlockBinding:zt,texStorage2D:wt,texStorage3D:Kt,texSubImage2D:_t,texSubImage3D:Mt,compressedTexSubImage2D:mt,compressedTexSubImage3D:Wt,scissor:Et,viewport:Pt,reset:fe}}function vR(r,t,i,s,l,c,h){const d=t.has("WEBGL_multisampled_render_to_texture")?t.get("WEBGL_multisampled_render_to_texture"):null,m=typeof navigator>"u"?!1:/OculusBrowser/g.test(navigator.userAgent),p=new le,v=new WeakMap;let g;const _=new WeakMap;let M=!1;try{M=typeof OffscreenCanvas<"u"&&new OffscreenCanvas(1,1).getContext("2d")!==null}catch{}function E(z,b){return M?new OffscreenCanvas(z,b):xu("canvas")}function A(z,b,K){let _t=1;const Mt=Yt(z);if((Mt.width>K||Mt.height>K)&&(_t=K/Math.max(Mt.width,Mt.height)),_t<1)if(typeof HTMLImageElement<"u"&&z instanceof HTMLImageElement||typeof HTMLCanvasElement<"u"&&z instanceof HTMLCanvasElement||typeof ImageBitmap<"u"&&z instanceof ImageBitmap||typeof VideoFrame<"u"&&z instanceof VideoFrame){const mt=Math.floor(_t*Mt.width),Wt=Math.floor(_t*Mt.height);g===void 0&&(g=E(mt,Wt));const wt=b?E(mt,Wt):g;return wt.width=mt,wt.height=Wt,wt.getContext("2d").drawImage(z,0,0,mt,Wt),ee("WebGLRenderer: Texture has been resized from ("+Mt.width+"x"+Mt.height+") to ("+mt+"x"+Wt+")."),wt}else return"data"in z&&ee("WebGLRenderer: Image in DataTexture is too big ("+Mt.width+"x"+Mt.height+")."),z;return z}function y(z){return z.generateMipmaps}function S(z){r.generateMipmap(z)}function w(z){return z.isWebGLCubeRenderTarget?r.TEXTURE_CUBE_MAP:z.isWebGL3DRenderTarget?r.TEXTURE_3D:z.isWebGLArrayRenderTarget||z.isCompressedArrayTexture?r.TEXTURE_2D_ARRAY:r.TEXTURE_2D}function D(z,b,K,_t,Mt=!1){if(z!==null){if(r[z]!==void 0)return r[z];ee("WebGLRenderer: Attempt to use non-existing WebGL internal format '"+z+"'")}let mt=b;if(b===r.RED&&(K===r.FLOAT&&(mt=r.R32F),K===r.HALF_FLOAT&&(mt=r.R16F),K===r.UNSIGNED_BYTE&&(mt=r.R8)),b===r.RED_INTEGER&&(K===r.UNSIGNED_BYTE&&(mt=r.R8UI),K===r.UNSIGNED_SHORT&&(mt=r.R16UI),K===r.UNSIGNED_INT&&(mt=r.R32UI),K===r.BYTE&&(mt=r.R8I),K===r.SHORT&&(mt=r.R16I),K===r.INT&&(mt=r.R32I)),b===r.RG&&(K===r.FLOAT&&(mt=r.RG32F),K===r.HALF_FLOAT&&(mt=r.RG16F),K===r.UNSIGNED_BYTE&&(mt=r.RG8)),b===r.RG_INTEGER&&(K===r.UNSIGNED_BYTE&&(mt=r.RG8UI),K===r.UNSIGNED_SHORT&&(mt=r.RG16UI),K===r.UNSIGNED_INT&&(mt=r.RG32UI),K===r.BYTE&&(mt=r.RG8I),K===r.SHORT&&(mt=r.RG16I),K===r.INT&&(mt=r.RG32I)),b===r.RGB_INTEGER&&(K===r.UNSIGNED_BYTE&&(mt=r.RGB8UI),K===r.UNSIGNED_SHORT&&(mt=r.RGB16UI),K===r.UNSIGNED_INT&&(mt=r.RGB32UI),K===r.BYTE&&(mt=r.RGB8I),K===r.SHORT&&(mt=r.RGB16I),K===r.INT&&(mt=r.RGB32I)),b===r.RGBA_INTEGER&&(K===r.UNSIGNED_BYTE&&(mt=r.RGBA8UI),K===r.UNSIGNED_SHORT&&(mt=r.RGBA16UI),K===r.UNSIGNED_INT&&(mt=r.RGBA32UI),K===r.BYTE&&(mt=r.RGBA8I),K===r.SHORT&&(mt=r.RGBA16I),K===r.INT&&(mt=r.RGBA32I)),b===r.RGB&&(K===r.UNSIGNED_INT_5_9_9_9_REV&&(mt=r.RGB9_E5),K===r.UNSIGNED_INT_10F_11F_11F_REV&&(mt=r.R11F_G11F_B10F)),b===r.RGBA){const Wt=Mt?vu:Re.getTransfer(_t);K===r.FLOAT&&(mt=r.RGBA32F),K===r.HALF_FLOAT&&(mt=r.RGBA16F),K===r.UNSIGNED_BYTE&&(mt=Wt===Fe?r.SRGB8_ALPHA8:r.RGBA8),K===r.UNSIGNED_SHORT_4_4_4_4&&(mt=r.RGBA4),K===r.UNSIGNED_SHORT_5_5_5_1&&(mt=r.RGB5_A1)}return(mt===r.R16F||mt===r.R32F||mt===r.RG16F||mt===r.RG32F||mt===r.RGBA16F||mt===r.RGBA32F)&&t.get("EXT_color_buffer_float"),mt}function U(z,b){let K;return z?b===null||b===aa||b===ml?K=r.DEPTH24_STENCIL8:b===ta?K=r.DEPTH32F_STENCIL8:b===pl&&(K=r.DEPTH24_STENCIL8,ee("DepthTexture: 16 bit depth attachment is not supported with stencil. Using 24-bit attachment.")):b===null||b===aa||b===ml?K=r.DEPTH_COMPONENT24:b===ta?K=r.DEPTH_COMPONENT32F:b===pl&&(K=r.DEPTH_COMPONENT16),K}function H(z,b){return y(z)===!0||z.isFramebufferTexture&&z.minFilter!==Dn&&z.minFilter!==zn?Math.log2(Math.max(b.width,b.height))+1:z.mipmaps!==void 0&&z.mipmaps.length>0?z.mipmaps.length:z.isCompressedTexture&&Array.isArray(z.image)?b.mipmaps.length:1}function F(z){const b=z.target;b.removeEventListener("dispose",F),T(b),b.isVideoTexture&&v.delete(b)}function I(z){const b=z.target;b.removeEventListener("dispose",I),Q(b)}function T(z){const b=s.get(z);if(b.__webglInit===void 0)return;const K=z.source,_t=_.get(K);if(_t){const Mt=_t[b.__cacheKey];Mt.usedTimes--,Mt.usedTimes===0&&L(z),Object.keys(_t).length===0&&_.delete(K)}s.remove(z)}function L(z){const b=s.get(z);r.deleteTexture(b.__webglTexture);const K=z.source,_t=_.get(K);delete _t[b.__cacheKey],h.memory.textures--}function Q(z){const b=s.get(z);if(z.depthTexture&&(z.depthTexture.dispose(),s.remove(z.depthTexture)),z.isWebGLCubeRenderTarget)for(let _t=0;_t<6;_t++){if(Array.isArray(b.__webglFramebuffer[_t]))for(let Mt=0;Mt<b.__webglFramebuffer[_t].length;Mt++)r.deleteFramebuffer(b.__webglFramebuffer[_t][Mt]);else r.deleteFramebuffer(b.__webglFramebuffer[_t]);b.__webglDepthbuffer&&r.deleteRenderbuffer(b.__webglDepthbuffer[_t])}else{if(Array.isArray(b.__webglFramebuffer))for(let _t=0;_t<b.__webglFramebuffer.length;_t++)r.deleteFramebuffer(b.__webglFramebuffer[_t]);else r.deleteFramebuffer(b.__webglFramebuffer);if(b.__webglDepthbuffer&&r.deleteRenderbuffer(b.__webglDepthbuffer),b.__webglMultisampledFramebuffer&&r.deleteFramebuffer(b.__webglMultisampledFramebuffer),b.__webglColorRenderbuffer)for(let _t=0;_t<b.__webglColorRenderbuffer.length;_t++)b.__webglColorRenderbuffer[_t]&&r.deleteRenderbuffer(b.__webglColorRenderbuffer[_t]);b.__webglDepthRenderbuffer&&r.deleteRenderbuffer(b.__webglDepthRenderbuffer)}const K=z.textures;for(let _t=0,Mt=K.length;_t<Mt;_t++){const mt=s.get(K[_t]);mt.__webglTexture&&(r.deleteTexture(mt.__webglTexture),h.memory.textures--),s.remove(K[_t])}s.remove(z)}let P=0;function W(){P=0}function J(){const z=P;return z>=l.maxTextures&&ee("WebGLTextures: Trying to use "+z+" texture units while this GPU supports only "+l.maxTextures),P+=1,z}function rt(z){const b=[];return b.push(z.wrapS),b.push(z.wrapT),b.push(z.wrapR||0),b.push(z.magFilter),b.push(z.minFilter),b.push(z.anisotropy),b.push(z.internalFormat),b.push(z.format),b.push(z.type),b.push(z.generateMipmaps),b.push(z.premultiplyAlpha),b.push(z.flipY),b.push(z.unpackAlignment),b.push(z.colorSpace),b.join()}function et(z,b){const K=s.get(z);if(z.isVideoTexture&&be(z),z.isRenderTargetTexture===!1&&z.isExternalTexture!==!0&&z.version>0&&K.__version!==z.version){const _t=z.image;if(_t===null)ee("WebGLRenderer: Texture marked for update but no image data found.");else if(_t.complete===!1)ee("WebGLRenderer: Texture marked for update but image is incomplete");else{Z(K,z,b);return}}else z.isExternalTexture&&(K.__webglTexture=z.sourceTexture?z.sourceTexture:null);i.bindTexture(r.TEXTURE_2D,K.__webglTexture,r.TEXTURE0+b)}function O(z,b){const K=s.get(z);if(z.isRenderTargetTexture===!1&&z.version>0&&K.__version!==z.version){Z(K,z,b);return}else z.isExternalTexture&&(K.__webglTexture=z.sourceTexture?z.sourceTexture:null);i.bindTexture(r.TEXTURE_2D_ARRAY,K.__webglTexture,r.TEXTURE0+b)}function B(z,b){const K=s.get(z);if(z.isRenderTargetTexture===!1&&z.version>0&&K.__version!==z.version){Z(K,z,b);return}i.bindTexture(r.TEXTURE_3D,K.__webglTexture,r.TEXTURE0+b)}function at(z,b){const K=s.get(z);if(z.isCubeDepthTexture!==!0&&z.version>0&&K.__version!==z.version){dt(K,z,b);return}i.bindTexture(r.TEXTURE_CUBE_MAP,K.__webglTexture,r.TEXTURE0+b)}const $={[Nd]:r.REPEAT,[Ua]:r.CLAMP_TO_EDGE,[Od]:r.MIRRORED_REPEAT},lt={[Dn]:r.NEAREST,[_M]:r.NEAREST_MIPMAP_NEAREST,[Oc]:r.NEAREST_MIPMAP_LINEAR,[zn]:r.LINEAR,[Vh]:r.LINEAR_MIPMAP_NEAREST,[Zs]:r.LINEAR_MIPMAP_LINEAR},N={[SM]:r.NEVER,[TM]:r.ALWAYS,[yM]:r.LESS,[Cp]:r.LEQUAL,[MM]:r.EQUAL,[wp]:r.GEQUAL,[EM]:r.GREATER,[bM]:r.NOTEQUAL};function k(z,b){if(b.type===ta&&t.has("OES_texture_float_linear")===!1&&(b.magFilter===zn||b.magFilter===Vh||b.magFilter===Oc||b.magFilter===Zs||b.minFilter===zn||b.minFilter===Vh||b.minFilter===Oc||b.minFilter===Zs)&&ee("WebGLRenderer: Unable to use linear filtering with floating point textures. OES_texture_float_linear not supported on this device."),r.texParameteri(z,r.TEXTURE_WRAP_S,$[b.wrapS]),r.texParameteri(z,r.TEXTURE_WRAP_T,$[b.wrapT]),(z===r.TEXTURE_3D||z===r.TEXTURE_2D_ARRAY)&&r.texParameteri(z,r.TEXTURE_WRAP_R,$[b.wrapR]),r.texParameteri(z,r.TEXTURE_MAG_FILTER,lt[b.magFilter]),r.texParameteri(z,r.TEXTURE_MIN_FILTER,lt[b.minFilter]),b.compareFunction&&(r.texParameteri(z,r.TEXTURE_COMPARE_MODE,r.COMPARE_REF_TO_TEXTURE),r.texParameteri(z,r.TEXTURE_COMPARE_FUNC,N[b.compareFunction])),t.has("EXT_texture_filter_anisotropic")===!0){if(b.magFilter===Dn||b.minFilter!==Oc&&b.minFilter!==Zs||b.type===ta&&t.has("OES_texture_float_linear")===!1)return;if(b.anisotropy>1||s.get(b).__currentAnisotropy){const K=t.get("EXT_texture_filter_anisotropic");r.texParameterf(z,K.TEXTURE_MAX_ANISOTROPY_EXT,Math.min(b.anisotropy,l.getMaxAnisotropy())),s.get(b).__currentAnisotropy=b.anisotropy}}}function ut(z,b){let K=!1;z.__webglInit===void 0&&(z.__webglInit=!0,b.addEventListener("dispose",F));const _t=b.source;let Mt=_.get(_t);Mt===void 0&&(Mt={},_.set(_t,Mt));const mt=rt(b);if(mt!==z.__cacheKey){Mt[mt]===void 0&&(Mt[mt]={texture:r.createTexture(),usedTimes:0},h.memory.textures++,K=!0),Mt[mt].usedTimes++;const Wt=Mt[z.__cacheKey];Wt!==void 0&&(Mt[z.__cacheKey].usedTimes--,Wt.usedTimes===0&&L(b)),z.__cacheKey=mt,z.__webglTexture=Mt[mt].texture}return K}function vt(z,b,K){return Math.floor(Math.floor(z/K)/b)}function Rt(z,b,K,_t){const mt=z.updateRanges;if(mt.length===0)i.texSubImage2D(r.TEXTURE_2D,0,0,0,b.width,b.height,K,_t,b.data);else{mt.sort((Tt,Et)=>Tt.start-Et.start);let Wt=0;for(let Tt=1;Tt<mt.length;Tt++){const Et=mt[Wt],Pt=mt[Tt],Ot=Et.start+Et.count,zt=vt(Pt.start,b.width,4),fe=vt(Et.start,b.width,4);Pt.start<=Ot+1&&zt===fe&&vt(Pt.start+Pt.count-1,b.width,4)===zt?Et.count=Math.max(Et.count,Pt.start+Pt.count-Et.start):(++Wt,mt[Wt]=Pt)}mt.length=Wt+1;const wt=r.getParameter(r.UNPACK_ROW_LENGTH),Kt=r.getParameter(r.UNPACK_SKIP_PIXELS),te=r.getParameter(r.UNPACK_SKIP_ROWS);r.pixelStorei(r.UNPACK_ROW_LENGTH,b.width);for(let Tt=0,Et=mt.length;Tt<Et;Tt++){const Pt=mt[Tt],Ot=Math.floor(Pt.start/4),zt=Math.ceil(Pt.count/4),fe=Ot%b.width,Y=Math.floor(Ot/b.width),Ct=zt,At=1;r.pixelStorei(r.UNPACK_SKIP_PIXELS,fe),r.pixelStorei(r.UNPACK_SKIP_ROWS,Y),i.texSubImage2D(r.TEXTURE_2D,0,fe,Y,Ct,At,K,_t,b.data)}z.clearUpdateRanges(),r.pixelStorei(r.UNPACK_ROW_LENGTH,wt),r.pixelStorei(r.UNPACK_SKIP_PIXELS,Kt),r.pixelStorei(r.UNPACK_SKIP_ROWS,te)}}function Z(z,b,K){let _t=r.TEXTURE_2D;(b.isDataArrayTexture||b.isCompressedArrayTexture)&&(_t=r.TEXTURE_2D_ARRAY),b.isData3DTexture&&(_t=r.TEXTURE_3D);const Mt=ut(z,b),mt=b.source;i.bindTexture(_t,z.__webglTexture,r.TEXTURE0+K);const Wt=s.get(mt);if(mt.version!==Wt.__version||Mt===!0){i.activeTexture(r.TEXTURE0+K);const wt=Re.getPrimaries(Re.workingColorSpace),Kt=b.colorSpace===gs?null:Re.getPrimaries(b.colorSpace),te=b.colorSpace===gs||wt===Kt?r.NONE:r.BROWSER_DEFAULT_WEBGL;r.pixelStorei(r.UNPACK_FLIP_Y_WEBGL,b.flipY),r.pixelStorei(r.UNPACK_PREMULTIPLY_ALPHA_WEBGL,b.premultiplyAlpha),r.pixelStorei(r.UNPACK_ALIGNMENT,b.unpackAlignment),r.pixelStorei(r.UNPACK_COLORSPACE_CONVERSION_WEBGL,te);let Tt=A(b.image,!1,l.maxTextureSize);Tt=Ne(b,Tt);const Et=c.convert(b.format,b.colorSpace),Pt=c.convert(b.type);let Ot=D(b.internalFormat,Et,Pt,b.colorSpace,b.isVideoTexture);k(_t,b);let zt;const fe=b.mipmaps,Y=b.isVideoTexture!==!0,Ct=Wt.__version===void 0||Mt===!0,At=mt.dataReady,It=H(b,Tt);if(b.isDepthTexture)Ot=U(b.format===Ks,b.type),Ct&&(Y?i.texStorage2D(r.TEXTURE_2D,1,Ot,Tt.width,Tt.height):i.texImage2D(r.TEXTURE_2D,0,Ot,Tt.width,Tt.height,0,Et,Pt,null));else if(b.isDataTexture)if(fe.length>0){Y&&Ct&&i.texStorage2D(r.TEXTURE_2D,It,Ot,fe[0].width,fe[0].height);for(let bt=0,pt=fe.length;bt<pt;bt++)zt=fe[bt],Y?At&&i.texSubImage2D(r.TEXTURE_2D,bt,0,0,zt.width,zt.height,Et,Pt,zt.data):i.texImage2D(r.TEXTURE_2D,bt,Ot,zt.width,zt.height,0,Et,Pt,zt.data);b.generateMipmaps=!1}else Y?(Ct&&i.texStorage2D(r.TEXTURE_2D,It,Ot,Tt.width,Tt.height),At&&Rt(b,Tt,Et,Pt)):i.texImage2D(r.TEXTURE_2D,0,Ot,Tt.width,Tt.height,0,Et,Pt,Tt.data);else if(b.isCompressedTexture)if(b.isCompressedArrayTexture){Y&&Ct&&i.texStorage3D(r.TEXTURE_2D_ARRAY,It,Ot,fe[0].width,fe[0].height,Tt.depth);for(let bt=0,pt=fe.length;bt<pt;bt++)if(zt=fe[bt],b.format!==Vi)if(Et!==null)if(Y){if(At)if(b.layerUpdates.size>0){const Ht=lv(zt.width,zt.height,b.format,b.type);for(const ie of b.layerUpdates){const Pe=zt.data.subarray(ie*Ht/zt.data.BYTES_PER_ELEMENT,(ie+1)*Ht/zt.data.BYTES_PER_ELEMENT);i.compressedTexSubImage3D(r.TEXTURE_2D_ARRAY,bt,0,0,ie,zt.width,zt.height,1,Et,Pe)}b.clearLayerUpdates()}else i.compressedTexSubImage3D(r.TEXTURE_2D_ARRAY,bt,0,0,0,zt.width,zt.height,Tt.depth,Et,zt.data)}else i.compressedTexImage3D(r.TEXTURE_2D_ARRAY,bt,Ot,zt.width,zt.height,Tt.depth,0,zt.data,0,0);else ee("WebGLRenderer: Attempt to load unsupported compressed texture format in .uploadTexture()");else Y?At&&i.texSubImage3D(r.TEXTURE_2D_ARRAY,bt,0,0,0,zt.width,zt.height,Tt.depth,Et,Pt,zt.data):i.texImage3D(r.TEXTURE_2D_ARRAY,bt,Ot,zt.width,zt.height,Tt.depth,0,Et,Pt,zt.data)}else{Y&&Ct&&i.texStorage2D(r.TEXTURE_2D,It,Ot,fe[0].width,fe[0].height);for(let bt=0,pt=fe.length;bt<pt;bt++)zt=fe[bt],b.format!==Vi?Et!==null?Y?At&&i.compressedTexSubImage2D(r.TEXTURE_2D,bt,0,0,zt.width,zt.height,Et,zt.data):i.compressedTexImage2D(r.TEXTURE_2D,bt,Ot,zt.width,zt.height,0,zt.data):ee("WebGLRenderer: Attempt to load unsupported compressed texture format in .uploadTexture()"):Y?At&&i.texSubImage2D(r.TEXTURE_2D,bt,0,0,zt.width,zt.height,Et,Pt,zt.data):i.texImage2D(r.TEXTURE_2D,bt,Ot,zt.width,zt.height,0,Et,Pt,zt.data)}else if(b.isDataArrayTexture)if(Y){if(Ct&&i.texStorage3D(r.TEXTURE_2D_ARRAY,It,Ot,Tt.width,Tt.height,Tt.depth),At)if(b.layerUpdates.size>0){const bt=lv(Tt.width,Tt.height,b.format,b.type);for(const pt of b.layerUpdates){const Ht=Tt.data.subarray(pt*bt/Tt.data.BYTES_PER_ELEMENT,(pt+1)*bt/Tt.data.BYTES_PER_ELEMENT);i.texSubImage3D(r.TEXTURE_2D_ARRAY,0,0,0,pt,Tt.width,Tt.height,1,Et,Pt,Ht)}b.clearLayerUpdates()}else i.texSubImage3D(r.TEXTURE_2D_ARRAY,0,0,0,0,Tt.width,Tt.height,Tt.depth,Et,Pt,Tt.data)}else i.texImage3D(r.TEXTURE_2D_ARRAY,0,Ot,Tt.width,Tt.height,Tt.depth,0,Et,Pt,Tt.data);else if(b.isData3DTexture)Y?(Ct&&i.texStorage3D(r.TEXTURE_3D,It,Ot,Tt.width,Tt.height,Tt.depth),At&&i.texSubImage3D(r.TEXTURE_3D,0,0,0,0,Tt.width,Tt.height,Tt.depth,Et,Pt,Tt.data)):i.texImage3D(r.TEXTURE_3D,0,Ot,Tt.width,Tt.height,Tt.depth,0,Et,Pt,Tt.data);else if(b.isFramebufferTexture){if(Ct)if(Y)i.texStorage2D(r.TEXTURE_2D,It,Ot,Tt.width,Tt.height);else{let bt=Tt.width,pt=Tt.height;for(let Ht=0;Ht<It;Ht++)i.texImage2D(r.TEXTURE_2D,Ht,Ot,bt,pt,0,Et,Pt,null),bt>>=1,pt>>=1}}else if(fe.length>0){if(Y&&Ct){const bt=Yt(fe[0]);i.texStorage2D(r.TEXTURE_2D,It,Ot,bt.width,bt.height)}for(let bt=0,pt=fe.length;bt<pt;bt++)zt=fe[bt],Y?At&&i.texSubImage2D(r.TEXTURE_2D,bt,0,0,Et,Pt,zt):i.texImage2D(r.TEXTURE_2D,bt,Ot,Et,Pt,zt);b.generateMipmaps=!1}else if(Y){if(Ct){const bt=Yt(Tt);i.texStorage2D(r.TEXTURE_2D,It,Ot,bt.width,bt.height)}At&&i.texSubImage2D(r.TEXTURE_2D,0,0,0,Et,Pt,Tt)}else i.texImage2D(r.TEXTURE_2D,0,Ot,Et,Pt,Tt);y(b)&&S(_t),Wt.__version=mt.version,b.onUpdate&&b.onUpdate(b)}z.__version=b.version}function dt(z,b,K){if(b.image.length!==6)return;const _t=ut(z,b),Mt=b.source;i.bindTexture(r.TEXTURE_CUBE_MAP,z.__webglTexture,r.TEXTURE0+K);const mt=s.get(Mt);if(Mt.version!==mt.__version||_t===!0){i.activeTexture(r.TEXTURE0+K);const Wt=Re.getPrimaries(Re.workingColorSpace),wt=b.colorSpace===gs?null:Re.getPrimaries(b.colorSpace),Kt=b.colorSpace===gs||Wt===wt?r.NONE:r.BROWSER_DEFAULT_WEBGL;r.pixelStorei(r.UNPACK_FLIP_Y_WEBGL,b.flipY),r.pixelStorei(r.UNPACK_PREMULTIPLY_ALPHA_WEBGL,b.premultiplyAlpha),r.pixelStorei(r.UNPACK_ALIGNMENT,b.unpackAlignment),r.pixelStorei(r.UNPACK_COLORSPACE_CONVERSION_WEBGL,Kt);const te=b.isCompressedTexture||b.image[0].isCompressedTexture,Tt=b.image[0]&&b.image[0].isDataTexture,Et=[];for(let pt=0;pt<6;pt++)!te&&!Tt?Et[pt]=A(b.image[pt],!0,l.maxCubemapSize):Et[pt]=Tt?b.image[pt].image:b.image[pt],Et[pt]=Ne(b,Et[pt]);const Pt=Et[0],Ot=c.convert(b.format,b.colorSpace),zt=c.convert(b.type),fe=D(b.internalFormat,Ot,zt,b.colorSpace),Y=b.isVideoTexture!==!0,Ct=mt.__version===void 0||_t===!0,At=Mt.dataReady;let It=H(b,Pt);k(r.TEXTURE_CUBE_MAP,b);let bt;if(te){Y&&Ct&&i.texStorage2D(r.TEXTURE_CUBE_MAP,It,fe,Pt.width,Pt.height);for(let pt=0;pt<6;pt++){bt=Et[pt].mipmaps;for(let Ht=0;Ht<bt.length;Ht++){const ie=bt[Ht];b.format!==Vi?Ot!==null?Y?At&&i.compressedTexSubImage2D(r.TEXTURE_CUBE_MAP_POSITIVE_X+pt,Ht,0,0,ie.width,ie.height,Ot,ie.data):i.compressedTexImage2D(r.TEXTURE_CUBE_MAP_POSITIVE_X+pt,Ht,fe,ie.width,ie.height,0,ie.data):ee("WebGLRenderer: Attempt to load unsupported compressed texture format in .setTextureCube()"):Y?At&&i.texSubImage2D(r.TEXTURE_CUBE_MAP_POSITIVE_X+pt,Ht,0,0,ie.width,ie.height,Ot,zt,ie.data):i.texImage2D(r.TEXTURE_CUBE_MAP_POSITIVE_X+pt,Ht,fe,ie.width,ie.height,0,Ot,zt,ie.data)}}}else{if(bt=b.mipmaps,Y&&Ct){bt.length>0&&It++;const pt=Yt(Et[0]);i.texStorage2D(r.TEXTURE_CUBE_MAP,It,fe,pt.width,pt.height)}for(let pt=0;pt<6;pt++)if(Tt){Y?At&&i.texSubImage2D(r.TEXTURE_CUBE_MAP_POSITIVE_X+pt,0,0,0,Et[pt].width,Et[pt].height,Ot,zt,Et[pt].data):i.texImage2D(r.TEXTURE_CUBE_MAP_POSITIVE_X+pt,0,fe,Et[pt].width,Et[pt].height,0,Ot,zt,Et[pt].data);for(let Ht=0;Ht<bt.length;Ht++){const Pe=bt[Ht].image[pt].image;Y?At&&i.texSubImage2D(r.TEXTURE_CUBE_MAP_POSITIVE_X+pt,Ht+1,0,0,Pe.width,Pe.height,Ot,zt,Pe.data):i.texImage2D(r.TEXTURE_CUBE_MAP_POSITIVE_X+pt,Ht+1,fe,Pe.width,Pe.height,0,Ot,zt,Pe.data)}}else{Y?At&&i.texSubImage2D(r.TEXTURE_CUBE_MAP_POSITIVE_X+pt,0,0,0,Ot,zt,Et[pt]):i.texImage2D(r.TEXTURE_CUBE_MAP_POSITIVE_X+pt,0,fe,Ot,zt,Et[pt]);for(let Ht=0;Ht<bt.length;Ht++){const ie=bt[Ht];Y?At&&i.texSubImage2D(r.TEXTURE_CUBE_MAP_POSITIVE_X+pt,Ht+1,0,0,Ot,zt,ie.image[pt]):i.texImage2D(r.TEXTURE_CUBE_MAP_POSITIVE_X+pt,Ht+1,fe,Ot,zt,ie.image[pt])}}}y(b)&&S(r.TEXTURE_CUBE_MAP),mt.__version=Mt.version,b.onUpdate&&b.onUpdate(b)}z.__version=b.version}function yt(z,b,K,_t,Mt,mt){const Wt=c.convert(K.format,K.colorSpace),wt=c.convert(K.type),Kt=D(K.internalFormat,Wt,wt,K.colorSpace),te=s.get(b),Tt=s.get(K);if(Tt.__renderTarget=b,!te.__hasExternalTextures){const Et=Math.max(1,b.width>>mt),Pt=Math.max(1,b.height>>mt);Mt===r.TEXTURE_3D||Mt===r.TEXTURE_2D_ARRAY?i.texImage3D(Mt,mt,Kt,Et,Pt,b.depth,0,Wt,wt,null):i.texImage2D(Mt,mt,Kt,Et,Pt,0,Wt,wt,null)}i.bindFramebuffer(r.FRAMEBUFFER,z),je(b)?d.framebufferTexture2DMultisampleEXT(r.FRAMEBUFFER,_t,Mt,Tt.__webglTexture,0,V(b)):(Mt===r.TEXTURE_2D||Mt>=r.TEXTURE_CUBE_MAP_POSITIVE_X&&Mt<=r.TEXTURE_CUBE_MAP_NEGATIVE_Z)&&r.framebufferTexture2D(r.FRAMEBUFFER,_t,Mt,Tt.__webglTexture,mt),i.bindFramebuffer(r.FRAMEBUFFER,null)}function Ut(z,b,K){if(r.bindRenderbuffer(r.RENDERBUFFER,z),b.depthBuffer){const _t=b.depthTexture,Mt=_t&&_t.isDepthTexture?_t.type:null,mt=U(b.stencilBuffer,Mt),Wt=b.stencilBuffer?r.DEPTH_STENCIL_ATTACHMENT:r.DEPTH_ATTACHMENT;je(b)?d.renderbufferStorageMultisampleEXT(r.RENDERBUFFER,V(b),mt,b.width,b.height):K?r.renderbufferStorageMultisample(r.RENDERBUFFER,V(b),mt,b.width,b.height):r.renderbufferStorage(r.RENDERBUFFER,mt,b.width,b.height),r.framebufferRenderbuffer(r.FRAMEBUFFER,Wt,r.RENDERBUFFER,z)}else{const _t=b.textures;for(let Mt=0;Mt<_t.length;Mt++){const mt=_t[Mt],Wt=c.convert(mt.format,mt.colorSpace),wt=c.convert(mt.type),Kt=D(mt.internalFormat,Wt,wt,mt.colorSpace);je(b)?d.renderbufferStorageMultisampleEXT(r.RENDERBUFFER,V(b),Kt,b.width,b.height):K?r.renderbufferStorageMultisample(r.RENDERBUFFER,V(b),Kt,b.width,b.height):r.renderbufferStorage(r.RENDERBUFFER,Kt,b.width,b.height)}}r.bindRenderbuffer(r.RENDERBUFFER,null)}function Ft(z,b,K){const _t=b.isWebGLCubeRenderTarget===!0;if(i.bindFramebuffer(r.FRAMEBUFFER,z),!(b.depthTexture&&b.depthTexture.isDepthTexture))throw new Error("renderTarget.depthTexture must be an instance of THREE.DepthTexture");const Mt=s.get(b.depthTexture);if(Mt.__renderTarget=b,(!Mt.__webglTexture||b.depthTexture.image.width!==b.width||b.depthTexture.image.height!==b.height)&&(b.depthTexture.image.width=b.width,b.depthTexture.image.height=b.height,b.depthTexture.needsUpdate=!0),_t){if(Mt.__webglInit===void 0&&(Mt.__webglInit=!0,b.depthTexture.addEventListener("dispose",F)),Mt.__webglTexture===void 0){Mt.__webglTexture=r.createTexture(),i.bindTexture(r.TEXTURE_CUBE_MAP,Mt.__webglTexture),k(r.TEXTURE_CUBE_MAP,b.depthTexture);const te=c.convert(b.depthTexture.format),Tt=c.convert(b.depthTexture.type);let Et;b.depthTexture.format===za?Et=r.DEPTH_COMPONENT24:b.depthTexture.format===Ks&&(Et=r.DEPTH24_STENCIL8);for(let Pt=0;Pt<6;Pt++)r.texImage2D(r.TEXTURE_CUBE_MAP_POSITIVE_X+Pt,0,Et,b.width,b.height,0,te,Tt,null)}}else et(b.depthTexture,0);const mt=Mt.__webglTexture,Wt=V(b),wt=_t?r.TEXTURE_CUBE_MAP_POSITIVE_X+K:r.TEXTURE_2D,Kt=b.depthTexture.format===Ks?r.DEPTH_STENCIL_ATTACHMENT:r.DEPTH_ATTACHMENT;if(b.depthTexture.format===za)je(b)?d.framebufferTexture2DMultisampleEXT(r.FRAMEBUFFER,Kt,wt,mt,0,Wt):r.framebufferTexture2D(r.FRAMEBUFFER,Kt,wt,mt,0);else if(b.depthTexture.format===Ks)je(b)?d.framebufferTexture2DMultisampleEXT(r.FRAMEBUFFER,Kt,wt,mt,0,Wt):r.framebufferTexture2D(r.FRAMEBUFFER,Kt,wt,mt,0);else throw new Error("Unknown depthTexture format")}function Xt(z){const b=s.get(z),K=z.isWebGLCubeRenderTarget===!0;if(b.__boundDepthTexture!==z.depthTexture){const _t=z.depthTexture;if(b.__depthDisposeCallback&&b.__depthDisposeCallback(),_t){const Mt=()=>{delete b.__boundDepthTexture,delete b.__depthDisposeCallback,_t.removeEventListener("dispose",Mt)};_t.addEventListener("dispose",Mt),b.__depthDisposeCallback=Mt}b.__boundDepthTexture=_t}if(z.depthTexture&&!b.__autoAllocateDepthBuffer)if(K)for(let _t=0;_t<6;_t++)Ft(b.__webglFramebuffer[_t],z,_t);else{const _t=z.texture.mipmaps;_t&&_t.length>0?Ft(b.__webglFramebuffer[0],z,0):Ft(b.__webglFramebuffer,z,0)}else if(K){b.__webglDepthbuffer=[];for(let _t=0;_t<6;_t++)if(i.bindFramebuffer(r.FRAMEBUFFER,b.__webglFramebuffer[_t]),b.__webglDepthbuffer[_t]===void 0)b.__webglDepthbuffer[_t]=r.createRenderbuffer(),Ut(b.__webglDepthbuffer[_t],z,!1);else{const Mt=z.stencilBuffer?r.DEPTH_STENCIL_ATTACHMENT:r.DEPTH_ATTACHMENT,mt=b.__webglDepthbuffer[_t];r.bindRenderbuffer(r.RENDERBUFFER,mt),r.framebufferRenderbuffer(r.FRAMEBUFFER,Mt,r.RENDERBUFFER,mt)}}else{const _t=z.texture.mipmaps;if(_t&&_t.length>0?i.bindFramebuffer(r.FRAMEBUFFER,b.__webglFramebuffer[0]):i.bindFramebuffer(r.FRAMEBUFFER,b.__webglFramebuffer),b.__webglDepthbuffer===void 0)b.__webglDepthbuffer=r.createRenderbuffer(),Ut(b.__webglDepthbuffer,z,!1);else{const Mt=z.stencilBuffer?r.DEPTH_STENCIL_ATTACHMENT:r.DEPTH_ATTACHMENT,mt=b.__webglDepthbuffer;r.bindRenderbuffer(r.RENDERBUFFER,mt),r.framebufferRenderbuffer(r.FRAMEBUFFER,Mt,r.RENDERBUFFER,mt)}}i.bindFramebuffer(r.FRAMEBUFFER,null)}function ge(z,b,K){const _t=s.get(z);b!==void 0&&yt(_t.__webglFramebuffer,z,z.texture,r.COLOR_ATTACHMENT0,r.TEXTURE_2D,0),K!==void 0&&Xt(z)}function Jt(z){const b=z.texture,K=s.get(z),_t=s.get(b);z.addEventListener("dispose",I);const Mt=z.textures,mt=z.isWebGLCubeRenderTarget===!0,Wt=Mt.length>1;if(Wt||(_t.__webglTexture===void 0&&(_t.__webglTexture=r.createTexture()),_t.__version=b.version,h.memory.textures++),mt){K.__webglFramebuffer=[];for(let wt=0;wt<6;wt++)if(b.mipmaps&&b.mipmaps.length>0){K.__webglFramebuffer[wt]=[];for(let Kt=0;Kt<b.mipmaps.length;Kt++)K.__webglFramebuffer[wt][Kt]=r.createFramebuffer()}else K.__webglFramebuffer[wt]=r.createFramebuffer()}else{if(b.mipmaps&&b.mipmaps.length>0){K.__webglFramebuffer=[];for(let wt=0;wt<b.mipmaps.length;wt++)K.__webglFramebuffer[wt]=r.createFramebuffer()}else K.__webglFramebuffer=r.createFramebuffer();if(Wt)for(let wt=0,Kt=Mt.length;wt<Kt;wt++){const te=s.get(Mt[wt]);te.__webglTexture===void 0&&(te.__webglTexture=r.createTexture(),h.memory.textures++)}if(z.samples>0&&je(z)===!1){K.__webglMultisampledFramebuffer=r.createFramebuffer(),K.__webglColorRenderbuffer=[],i.bindFramebuffer(r.FRAMEBUFFER,K.__webglMultisampledFramebuffer);for(let wt=0;wt<Mt.length;wt++){const Kt=Mt[wt];K.__webglColorRenderbuffer[wt]=r.createRenderbuffer(),r.bindRenderbuffer(r.RENDERBUFFER,K.__webglColorRenderbuffer[wt]);const te=c.convert(Kt.format,Kt.colorSpace),Tt=c.convert(Kt.type),Et=D(Kt.internalFormat,te,Tt,Kt.colorSpace,z.isXRRenderTarget===!0),Pt=V(z);r.renderbufferStorageMultisample(r.RENDERBUFFER,Pt,Et,z.width,z.height),r.framebufferRenderbuffer(r.FRAMEBUFFER,r.COLOR_ATTACHMENT0+wt,r.RENDERBUFFER,K.__webglColorRenderbuffer[wt])}r.bindRenderbuffer(r.RENDERBUFFER,null),z.depthBuffer&&(K.__webglDepthRenderbuffer=r.createRenderbuffer(),Ut(K.__webglDepthRenderbuffer,z,!0)),i.bindFramebuffer(r.FRAMEBUFFER,null)}}if(mt){i.bindTexture(r.TEXTURE_CUBE_MAP,_t.__webglTexture),k(r.TEXTURE_CUBE_MAP,b);for(let wt=0;wt<6;wt++)if(b.mipmaps&&b.mipmaps.length>0)for(let Kt=0;Kt<b.mipmaps.length;Kt++)yt(K.__webglFramebuffer[wt][Kt],z,b,r.COLOR_ATTACHMENT0,r.TEXTURE_CUBE_MAP_POSITIVE_X+wt,Kt);else yt(K.__webglFramebuffer[wt],z,b,r.COLOR_ATTACHMENT0,r.TEXTURE_CUBE_MAP_POSITIVE_X+wt,0);y(b)&&S(r.TEXTURE_CUBE_MAP),i.unbindTexture()}else if(Wt){for(let wt=0,Kt=Mt.length;wt<Kt;wt++){const te=Mt[wt],Tt=s.get(te);let Et=r.TEXTURE_2D;(z.isWebGL3DRenderTarget||z.isWebGLArrayRenderTarget)&&(Et=z.isWebGL3DRenderTarget?r.TEXTURE_3D:r.TEXTURE_2D_ARRAY),i.bindTexture(Et,Tt.__webglTexture),k(Et,te),yt(K.__webglFramebuffer,z,te,r.COLOR_ATTACHMENT0+wt,Et,0),y(te)&&S(Et)}i.unbindTexture()}else{let wt=r.TEXTURE_2D;if((z.isWebGL3DRenderTarget||z.isWebGLArrayRenderTarget)&&(wt=z.isWebGL3DRenderTarget?r.TEXTURE_3D:r.TEXTURE_2D_ARRAY),i.bindTexture(wt,_t.__webglTexture),k(wt,b),b.mipmaps&&b.mipmaps.length>0)for(let Kt=0;Kt<b.mipmaps.length;Kt++)yt(K.__webglFramebuffer[Kt],z,b,r.COLOR_ATTACHMENT0,wt,Kt);else yt(K.__webglFramebuffer,z,b,r.COLOR_ATTACHMENT0,wt,0);y(b)&&S(wt),i.unbindTexture()}z.depthBuffer&&Xt(z)}function _e(z){const b=z.textures;for(let K=0,_t=b.length;K<_t;K++){const Mt=b[K];if(y(Mt)){const mt=w(z),Wt=s.get(Mt).__webglTexture;i.bindTexture(mt,Wt),S(mt),i.unbindTexture()}}}const Te=[],ae=[];function $e(z){if(z.samples>0){if(je(z)===!1){const b=z.textures,K=z.width,_t=z.height;let Mt=r.COLOR_BUFFER_BIT;const mt=z.stencilBuffer?r.DEPTH_STENCIL_ATTACHMENT:r.DEPTH_ATTACHMENT,Wt=s.get(z),wt=b.length>1;if(wt)for(let te=0;te<b.length;te++)i.bindFramebuffer(r.FRAMEBUFFER,Wt.__webglMultisampledFramebuffer),r.framebufferRenderbuffer(r.FRAMEBUFFER,r.COLOR_ATTACHMENT0+te,r.RENDERBUFFER,null),i.bindFramebuffer(r.FRAMEBUFFER,Wt.__webglFramebuffer),r.framebufferTexture2D(r.DRAW_FRAMEBUFFER,r.COLOR_ATTACHMENT0+te,r.TEXTURE_2D,null,0);i.bindFramebuffer(r.READ_FRAMEBUFFER,Wt.__webglMultisampledFramebuffer);const Kt=z.texture.mipmaps;Kt&&Kt.length>0?i.bindFramebuffer(r.DRAW_FRAMEBUFFER,Wt.__webglFramebuffer[0]):i.bindFramebuffer(r.DRAW_FRAMEBUFFER,Wt.__webglFramebuffer);for(let te=0;te<b.length;te++){if(z.resolveDepthBuffer&&(z.depthBuffer&&(Mt|=r.DEPTH_BUFFER_BIT),z.stencilBuffer&&z.resolveStencilBuffer&&(Mt|=r.STENCIL_BUFFER_BIT)),wt){r.framebufferRenderbuffer(r.READ_FRAMEBUFFER,r.COLOR_ATTACHMENT0,r.RENDERBUFFER,Wt.__webglColorRenderbuffer[te]);const Tt=s.get(b[te]).__webglTexture;r.framebufferTexture2D(r.DRAW_FRAMEBUFFER,r.COLOR_ATTACHMENT0,r.TEXTURE_2D,Tt,0)}r.blitFramebuffer(0,0,K,_t,0,0,K,_t,Mt,r.NEAREST),m===!0&&(Te.length=0,ae.length=0,Te.push(r.COLOR_ATTACHMENT0+te),z.depthBuffer&&z.resolveDepthBuffer===!1&&(Te.push(mt),ae.push(mt),r.invalidateFramebuffer(r.DRAW_FRAMEBUFFER,ae)),r.invalidateFramebuffer(r.READ_FRAMEBUFFER,Te))}if(i.bindFramebuffer(r.READ_FRAMEBUFFER,null),i.bindFramebuffer(r.DRAW_FRAMEBUFFER,null),wt)for(let te=0;te<b.length;te++){i.bindFramebuffer(r.FRAMEBUFFER,Wt.__webglMultisampledFramebuffer),r.framebufferRenderbuffer(r.FRAMEBUFFER,r.COLOR_ATTACHMENT0+te,r.RENDERBUFFER,Wt.__webglColorRenderbuffer[te]);const Tt=s.get(b[te]).__webglTexture;i.bindFramebuffer(r.FRAMEBUFFER,Wt.__webglFramebuffer),r.framebufferTexture2D(r.DRAW_FRAMEBUFFER,r.COLOR_ATTACHMENT0+te,r.TEXTURE_2D,Tt,0)}i.bindFramebuffer(r.DRAW_FRAMEBUFFER,Wt.__webglMultisampledFramebuffer)}else if(z.depthBuffer&&z.resolveDepthBuffer===!1&&m){const b=z.stencilBuffer?r.DEPTH_STENCIL_ATTACHMENT:r.DEPTH_ATTACHMENT;r.invalidateFramebuffer(r.DRAW_FRAMEBUFFER,[b])}}}function V(z){return Math.min(l.maxSamples,z.samples)}function je(z){const b=s.get(z);return z.samples>0&&t.has("WEBGL_multisampled_render_to_texture")===!0&&b.__useRenderToTexture!==!1}function be(z){const b=h.render.frame;v.get(z)!==b&&(v.set(z,b),z.update())}function Ne(z,b){const K=z.colorSpace,_t=z.format,Mt=z.type;return z.isCompressedTexture===!0||z.isVideoTexture===!0||K!==ro&&K!==gs&&(Re.getTransfer(K)===Fe?(_t!==Vi||Mt!==di)&&ee("WebGLTextures: sRGB encoded textures have to use RGBAFormat and UnsignedByteType."):Ue("WebGLTextures: Unsupported texture color space:",K)),b}function Yt(z){return typeof HTMLImageElement<"u"&&z instanceof HTMLImageElement?(p.width=z.naturalWidth||z.width,p.height=z.naturalHeight||z.height):typeof VideoFrame<"u"&&z instanceof VideoFrame?(p.width=z.displayWidth,p.height=z.displayHeight):(p.width=z.width,p.height=z.height),p}this.allocateTextureUnit=J,this.resetTextureUnits=W,this.setTexture2D=et,this.setTexture2DArray=O,this.setTexture3D=B,this.setTextureCube=at,this.rebindTextures=ge,this.setupRenderTarget=Jt,this.updateRenderTargetMipmap=_e,this.updateMultisampleRenderTarget=$e,this.setupDepthRenderbuffer=Xt,this.setupFrameBufferTexture=yt,this.useMultisampledRTT=je,this.isReversedDepthBuffer=function(){return i.buffers.depth.getReversed()}}function xR(r,t){function i(s,l=gs){let c;const h=Re.getTransfer(l);if(s===di)return r.UNSIGNED_BYTE;if(s===Ep)return r.UNSIGNED_SHORT_4_4_4_4;if(s===bp)return r.UNSIGNED_SHORT_5_5_5_1;if(s===tx)return r.UNSIGNED_INT_5_9_9_9_REV;if(s===ex)return r.UNSIGNED_INT_10F_11F_11F_REV;if(s===Jv)return r.BYTE;if(s===$v)return r.SHORT;if(s===pl)return r.UNSIGNED_SHORT;if(s===Mp)return r.INT;if(s===aa)return r.UNSIGNED_INT;if(s===ta)return r.FLOAT;if(s===Pa)return r.HALF_FLOAT;if(s===nx)return r.ALPHA;if(s===ix)return r.RGB;if(s===Vi)return r.RGBA;if(s===za)return r.DEPTH_COMPONENT;if(s===Ks)return r.DEPTH_STENCIL;if(s===ax)return r.RED;if(s===Tp)return r.RED_INTEGER;if(s===so)return r.RG;if(s===Ap)return r.RG_INTEGER;if(s===Rp)return r.RGBA_INTEGER;if(s===du||s===pu||s===mu||s===gu)if(h===Fe)if(c=t.get("WEBGL_compressed_texture_s3tc_srgb"),c!==null){if(s===du)return c.COMPRESSED_SRGB_S3TC_DXT1_EXT;if(s===pu)return c.COMPRESSED_SRGB_ALPHA_S3TC_DXT1_EXT;if(s===mu)return c.COMPRESSED_SRGB_ALPHA_S3TC_DXT3_EXT;if(s===gu)return c.COMPRESSED_SRGB_ALPHA_S3TC_DXT5_EXT}else return null;else if(c=t.get("WEBGL_compressed_texture_s3tc"),c!==null){if(s===du)return c.COMPRESSED_RGB_S3TC_DXT1_EXT;if(s===pu)return c.COMPRESSED_RGBA_S3TC_DXT1_EXT;if(s===mu)return c.COMPRESSED_RGBA_S3TC_DXT3_EXT;if(s===gu)return c.COMPRESSED_RGBA_S3TC_DXT5_EXT}else return null;if(s===Pd||s===zd||s===Id||s===Fd)if(c=t.get("WEBGL_compressed_texture_pvrtc"),c!==null){if(s===Pd)return c.COMPRESSED_RGB_PVRTC_4BPPV1_IMG;if(s===zd)return c.COMPRESSED_RGB_PVRTC_2BPPV1_IMG;if(s===Id)return c.COMPRESSED_RGBA_PVRTC_4BPPV1_IMG;if(s===Fd)return c.COMPRESSED_RGBA_PVRTC_2BPPV1_IMG}else return null;if(s===Bd||s===Hd||s===Gd||s===Vd||s===kd||s===Xd||s===Wd)if(c=t.get("WEBGL_compressed_texture_etc"),c!==null){if(s===Bd||s===Hd)return h===Fe?c.COMPRESSED_SRGB8_ETC2:c.COMPRESSED_RGB8_ETC2;if(s===Gd)return h===Fe?c.COMPRESSED_SRGB8_ALPHA8_ETC2_EAC:c.COMPRESSED_RGBA8_ETC2_EAC;if(s===Vd)return c.COMPRESSED_R11_EAC;if(s===kd)return c.COMPRESSED_SIGNED_R11_EAC;if(s===Xd)return c.COMPRESSED_RG11_EAC;if(s===Wd)return c.COMPRESSED_SIGNED_RG11_EAC}else return null;if(s===qd||s===Yd||s===jd||s===Zd||s===Kd||s===Qd||s===Jd||s===$d||s===tp||s===ep||s===np||s===ip||s===ap||s===sp)if(c=t.get("WEBGL_compressed_texture_astc"),c!==null){if(s===qd)return h===Fe?c.COMPRESSED_SRGB8_ALPHA8_ASTC_4x4_KHR:c.COMPRESSED_RGBA_ASTC_4x4_KHR;if(s===Yd)return h===Fe?c.COMPRESSED_SRGB8_ALPHA8_ASTC_5x4_KHR:c.COMPRESSED_RGBA_ASTC_5x4_KHR;if(s===jd)return h===Fe?c.COMPRESSED_SRGB8_ALPHA8_ASTC_5x5_KHR:c.COMPRESSED_RGBA_ASTC_5x5_KHR;if(s===Zd)return h===Fe?c.COMPRESSED_SRGB8_ALPHA8_ASTC_6x5_KHR:c.COMPRESSED_RGBA_ASTC_6x5_KHR;if(s===Kd)return h===Fe?c.COMPRESSED_SRGB8_ALPHA8_ASTC_6x6_KHR:c.COMPRESSED_RGBA_ASTC_6x6_KHR;if(s===Qd)return h===Fe?c.COMPRESSED_SRGB8_ALPHA8_ASTC_8x5_KHR:c.COMPRESSED_RGBA_ASTC_8x5_KHR;if(s===Jd)return h===Fe?c.COMPRESSED_SRGB8_ALPHA8_ASTC_8x6_KHR:c.COMPRESSED_RGBA_ASTC_8x6_KHR;if(s===$d)return h===Fe?c.COMPRESSED_SRGB8_ALPHA8_ASTC_8x8_KHR:c.COMPRESSED_RGBA_ASTC_8x8_KHR;if(s===tp)return h===Fe?c.COMPRESSED_SRGB8_ALPHA8_ASTC_10x5_KHR:c.COMPRESSED_RGBA_ASTC_10x5_KHR;if(s===ep)return h===Fe?c.COMPRESSED_SRGB8_ALPHA8_ASTC_10x6_KHR:c.COMPRESSED_RGBA_ASTC_10x6_KHR;if(s===np)return h===Fe?c.COMPRESSED_SRGB8_ALPHA8_ASTC_10x8_KHR:c.COMPRESSED_RGBA_ASTC_10x8_KHR;if(s===ip)return h===Fe?c.COMPRESSED_SRGB8_ALPHA8_ASTC_10x10_KHR:c.COMPRESSED_RGBA_ASTC_10x10_KHR;if(s===ap)return h===Fe?c.COMPRESSED_SRGB8_ALPHA8_ASTC_12x10_KHR:c.COMPRESSED_RGBA_ASTC_12x10_KHR;if(s===sp)return h===Fe?c.COMPRESSED_SRGB8_ALPHA8_ASTC_12x12_KHR:c.COMPRESSED_RGBA_ASTC_12x12_KHR}else return null;if(s===rp||s===op||s===lp)if(c=t.get("EXT_texture_compression_bptc"),c!==null){if(s===rp)return h===Fe?c.COMPRESSED_SRGB_ALPHA_BPTC_UNORM_EXT:c.COMPRESSED_RGBA_BPTC_UNORM_EXT;if(s===op)return c.COMPRESSED_RGB_BPTC_SIGNED_FLOAT_EXT;if(s===lp)return c.COMPRESSED_RGB_BPTC_UNSIGNED_FLOAT_EXT}else return null;if(s===cp||s===up||s===fp||s===hp)if(c=t.get("EXT_texture_compression_rgtc"),c!==null){if(s===cp)return c.COMPRESSED_RED_RGTC1_EXT;if(s===up)return c.COMPRESSED_SIGNED_RED_RGTC1_EXT;if(s===fp)return c.COMPRESSED_RED_GREEN_RGTC2_EXT;if(s===hp)return c.COMPRESSED_SIGNED_RED_GREEN_RGTC2_EXT}else return null;return s===ml?r.UNSIGNED_INT_24_8:r[s]!==void 0?r[s]:null}return{convert:i}}const SR=`
4034
4034
  void main() {
4035
4035
 
4036
4036
  gl_Position = vec4( position, 1.0 );
4037
4037
 
4038
- }`,vR=`
4038
+ }`,yR=`
4039
4039
  uniform sampler2DArray depthColor;
4040
4040
  uniform float depthWidth;
4041
4041
  uniform float depthHeight;
@@ -4054,7 +4054,7 @@ void main() {
4054
4054
 
4055
4055
  }
4056
4056
 
4057
- }`;class xR{constructor(){this.texture=null,this.mesh=null,this.depthNear=0,this.depthFar=0}init(t,i){if(this.texture===null){const s=new dx(t.texture);(t.depthNear!==i.depthNear||t.depthFar!==i.depthFar)&&(this.depthNear=t.depthNear,this.depthFar=t.depthFar),this.texture=s}}getMesh(t){if(this.texture!==null&&this.mesh===null){const i=t.cameras[0].viewport,s=new Xi({vertexShader:_R,fragmentShader:vR,uniforms:{depthColor:{value:this.texture},depthWidth:{value:i.z},depthHeight:{value:i.w}}});this.mesh=new _i(new bu(20,20),s)}return this.mesh}reset(){this.texture=null,this.mesh=null}getDepthTexture(){return this.texture}}class SR extends Js{constructor(t,i){super();const s=this;let l=null,c=1,h=null,d="local-floor",m=1,p=null,v=null,g=null,_=null,M=null,E=null;const A=typeof XRWebGLBinding<"u",x=new xR,y={},w=i.getContextAttributes();let D=null,U=null;const H=[],F=[],I=new le;let T=null;const L=new Bi;L.viewport=new We;const Q=new Bi;Q.viewport=new We;const P=[L,Q],W=new CE;let J=null,rt=null;this.cameraAutoUpdate=!0,this.enabled=!1,this.isPresenting=!1,this.getController=function(Z){let dt=H[Z];return dt===void 0&&(dt=new qh,H[Z]=dt),dt.getTargetRaySpace()},this.getControllerGrip=function(Z){let dt=H[Z];return dt===void 0&&(dt=new qh,H[Z]=dt),dt.getGripSpace()},this.getHand=function(Z){let dt=H[Z];return dt===void 0&&(dt=new qh,H[Z]=dt),dt.getHandSpace()};function et(Z){const dt=F.indexOf(Z.inputSource);if(dt===-1)return;const yt=H[dt];yt!==void 0&&(yt.update(Z.inputSource,Z.frame,p||h),yt.dispatchEvent({type:Z.type,data:Z.inputSource}))}function O(){l.removeEventListener("select",et),l.removeEventListener("selectstart",et),l.removeEventListener("selectend",et),l.removeEventListener("squeeze",et),l.removeEventListener("squeezestart",et),l.removeEventListener("squeezeend",et),l.removeEventListener("end",O),l.removeEventListener("inputsourceschange",B);for(let Z=0;Z<H.length;Z++){const dt=F[Z];dt!==null&&(F[Z]=null,H[Z].disconnect(dt))}J=null,rt=null,x.reset();for(const Z in y)delete y[Z];t.setRenderTarget(D),M=null,_=null,g=null,l=null,U=null,Rt.stop(),s.isPresenting=!1,t.setPixelRatio(T),t.setSize(I.width,I.height,!1),s.dispatchEvent({type:"sessionend"})}this.setFramebufferScaleFactor=function(Z){c=Z,s.isPresenting===!0&&ee("WebXRManager: Cannot change framebuffer scale while presenting.")},this.setReferenceSpaceType=function(Z){d=Z,s.isPresenting===!0&&ee("WebXRManager: Cannot change reference space type while presenting.")},this.getReferenceSpace=function(){return p||h},this.setReferenceSpace=function(Z){p=Z},this.getBaseLayer=function(){return _!==null?_:M},this.getBinding=function(){return g===null&&A&&(g=new XRWebGLBinding(l,i)),g},this.getFrame=function(){return E},this.getSession=function(){return l},this.setSession=async function(Z){if(l=Z,l!==null){if(D=t.getRenderTarget(),l.addEventListener("select",et),l.addEventListener("selectstart",et),l.addEventListener("selectend",et),l.addEventListener("squeeze",et),l.addEventListener("squeezestart",et),l.addEventListener("squeezeend",et),l.addEventListener("end",O),l.addEventListener("inputsourceschange",B),w.xrCompatible!==!0&&await i.makeXRCompatible(),T=t.getPixelRatio(),t.getSize(I),A&&"createProjectionLayer"in XRWebGLBinding.prototype){let yt=null,Ut=null,Ft=null;w.depth&&(Ft=w.stencil?i.DEPTH24_STENCIL8:i.DEPTH_COMPONENT24,yt=w.stencil?Zs:za,Ut=w.stencil?dl:sa);const Xt={colorFormat:i.RGBA8,depthFormat:Ft,scaleFactor:c};g=this.getBinding(),_=g.createProjectionLayer(Xt),l.updateRenderState({layers:[_]}),t.setPixelRatio(1),t.setSize(_.textureWidth,_.textureHeight,!1),U=new aa(_.textureWidth,_.textureHeight,{format:ki,type:mi,depthTexture:new _l(_.textureWidth,_.textureHeight,Ut,void 0,void 0,void 0,void 0,void 0,void 0,yt),stencilBuffer:w.stencil,colorSpace:t.outputColorSpace,samples:w.antialias?4:0,resolveDepthBuffer:_.ignoreDepthValues===!1,resolveStencilBuffer:_.ignoreDepthValues===!1})}else{const yt={antialias:w.antialias,alpha:!0,depth:w.depth,stencil:w.stencil,framebufferScaleFactor:c};M=new XRWebGLLayer(l,i,yt),l.updateRenderState({baseLayer:M}),t.setPixelRatio(1),t.setSize(M.framebufferWidth,M.framebufferHeight,!1),U=new aa(M.framebufferWidth,M.framebufferHeight,{format:ki,type:mi,colorSpace:t.outputColorSpace,stencilBuffer:w.stencil,resolveDepthBuffer:M.ignoreDepthValues===!1,resolveStencilBuffer:M.ignoreDepthValues===!1})}U.isXRRenderTarget=!0,this.setFoveation(m),p=null,h=await l.requestReferenceSpace(d),Rt.setContext(l),Rt.start(),s.isPresenting=!0,s.dispatchEvent({type:"sessionstart"})}},this.getEnvironmentBlendMode=function(){if(l!==null)return l.environmentBlendMode},this.getDepthTexture=function(){return x.getDepthTexture()};function B(Z){for(let dt=0;dt<Z.removed.length;dt++){const yt=Z.removed[dt],Ut=F.indexOf(yt);Ut>=0&&(F[Ut]=null,H[Ut].disconnect(yt))}for(let dt=0;dt<Z.added.length;dt++){const yt=Z.added[dt];let Ut=F.indexOf(yt);if(Ut===-1){for(let Xt=0;Xt<H.length;Xt++)if(Xt>=F.length){F.push(yt),Ut=Xt;break}else if(F[Xt]===null){F[Xt]=yt,Ut=Xt;break}if(Ut===-1)break}const Ft=H[Ut];Ft&&Ft.connect(yt)}}const at=new j,$=new j;function lt(Z,dt,yt){at.setFromMatrixPosition(dt.matrixWorld),$.setFromMatrixPosition(yt.matrixWorld);const Ut=at.distanceTo($),Ft=dt.projectionMatrix.elements,Xt=yt.projectionMatrix.elements,ge=Ft[14]/(Ft[10]-1),Jt=Ft[14]/(Ft[10]+1),_e=(Ft[9]+1)/Ft[5],Te=(Ft[9]-1)/Ft[5],ae=(Ft[8]-1)/Ft[0],$e=(Xt[8]+1)/Xt[0],V=ge*ae,je=ge*$e,be=Ut/(-ae+$e),Ne=be*-ae;if(dt.matrixWorld.decompose(Z.position,Z.quaternion,Z.scale),Z.translateX(Ne),Z.translateZ(be),Z.matrixWorld.compose(Z.position,Z.quaternion,Z.scale),Z.matrixWorldInverse.copy(Z.matrixWorld).invert(),Ft[10]===-1)Z.projectionMatrix.copy(dt.projectionMatrix),Z.projectionMatrixInverse.copy(dt.projectionMatrixInverse);else{const Yt=ge+be,z=Jt+be,b=V-Ne,K=je+(Ut-Ne),_t=_e*Jt/z*Yt,Mt=Te*Jt/z*Yt;Z.projectionMatrix.makePerspective(b,K,_t,Mt,Yt,z),Z.projectionMatrixInverse.copy(Z.projectionMatrix).invert()}}function N(Z,dt){dt===null?Z.matrixWorld.copy(Z.matrix):Z.matrixWorld.multiplyMatrices(dt.matrixWorld,Z.matrix),Z.matrixWorldInverse.copy(Z.matrixWorld).invert()}this.updateCamera=function(Z){if(l===null)return;let dt=Z.near,yt=Z.far;x.texture!==null&&(x.depthNear>0&&(dt=x.depthNear),x.depthFar>0&&(yt=x.depthFar)),W.near=Q.near=L.near=dt,W.far=Q.far=L.far=yt,(J!==W.near||rt!==W.far)&&(l.updateRenderState({depthNear:W.near,depthFar:W.far}),J=W.near,rt=W.far),W.layers.mask=Z.layers.mask|6,L.layers.mask=W.layers.mask&-5,Q.layers.mask=W.layers.mask&-3;const Ut=Z.parent,Ft=W.cameras;N(W,Ut);for(let Xt=0;Xt<Ft.length;Xt++)N(Ft[Xt],Ut);Ft.length===2?lt(W,L,Q):W.projectionMatrix.copy(L.projectionMatrix),k(Z,W,Ut)};function k(Z,dt,yt){yt===null?Z.matrix.copy(dt.matrixWorld):(Z.matrix.copy(yt.matrixWorld),Z.matrix.invert(),Z.matrix.multiply(dt.matrixWorld)),Z.matrix.decompose(Z.position,Z.quaternion,Z.scale),Z.updateMatrixWorld(!0),Z.projectionMatrix.copy(dt.projectionMatrix),Z.projectionMatrixInverse.copy(dt.projectionMatrixInverse),Z.isPerspectiveCamera&&(Z.fov=ml*2*Math.atan(1/Z.projectionMatrix.elements[5]),Z.zoom=1)}this.getCamera=function(){return W},this.getFoveation=function(){if(!(_===null&&M===null))return m},this.setFoveation=function(Z){m=Z,_!==null&&(_.fixedFoveation=Z),M!==null&&M.fixedFoveation!==void 0&&(M.fixedFoveation=Z)},this.hasDepthSensing=function(){return x.texture!==null},this.getDepthSensingMesh=function(){return x.getMesh(W)},this.getCameraTexture=function(Z){return y[Z]};let ut=null;function vt(Z,dt){if(v=dt.getViewerPose(p||h),E=dt,v!==null){const yt=v.views;M!==null&&(t.setRenderTargetFramebuffer(U,M.framebuffer),t.setRenderTarget(U));let Ut=!1;yt.length!==W.cameras.length&&(W.cameras.length=0,Ut=!0);for(let Jt=0;Jt<yt.length;Jt++){const _e=yt[Jt];let Te=null;if(M!==null)Te=M.getViewport(_e);else{const $e=g.getViewSubImage(_,_e);Te=$e.viewport,Jt===0&&(t.setRenderTargetTextures(U,$e.colorTexture,$e.depthStencilTexture),t.setRenderTarget(U))}let ae=P[Jt];ae===void 0&&(ae=new Bi,ae.layers.enable(Jt),ae.viewport=new We,P[Jt]=ae),ae.matrix.fromArray(_e.transform.matrix),ae.matrix.decompose(ae.position,ae.quaternion,ae.scale),ae.projectionMatrix.fromArray(_e.projectionMatrix),ae.projectionMatrixInverse.copy(ae.projectionMatrix).invert(),ae.viewport.set(Te.x,Te.y,Te.width,Te.height),Jt===0&&(W.matrix.copy(ae.matrix),W.matrix.decompose(W.position,W.quaternion,W.scale)),Ut===!0&&W.cameras.push(ae)}const Ft=l.enabledFeatures;if(Ft&&Ft.includes("depth-sensing")&&l.depthUsage=="gpu-optimized"&&A){g=s.getBinding();const Jt=g.getDepthInformation(yt[0]);Jt&&Jt.isValid&&Jt.texture&&x.init(Jt,l.renderState)}if(Ft&&Ft.includes("camera-access")&&A){t.state.unbindTexture(),g=s.getBinding();for(let Jt=0;Jt<yt.length;Jt++){const _e=yt[Jt].camera;if(_e){let Te=y[_e];Te||(Te=new dx,y[_e]=Te);const ae=g.getCameraImage(_e);Te.sourceTexture=ae}}}}for(let yt=0;yt<H.length;yt++){const Ut=F[yt],Ft=H[yt];Ut!==null&&Ft!==void 0&&Ft.update(Ut,dt,p||h)}ut&&ut(Z,dt),dt.detectedPlanes&&s.dispatchEvent({type:"planesdetected",data:dt}),E=null}const Rt=new _x;Rt.setAnimationLoop(vt),this.setAnimationLoop=function(Z){ut=Z},this.dispose=function(){}}}const Ws=new ra,yR=new Je;function MR(r,t){function i(x,y){x.matrixAutoUpdate===!0&&x.updateMatrix(),y.value.copy(x.matrix)}function s(x,y){y.color.getRGB(x.fogColor.value,px(r)),y.isFog?(x.fogNear.value=y.near,x.fogFar.value=y.far):y.isFogExp2&&(x.fogDensity.value=y.density)}function l(x,y,w,D,U){y.isMeshBasicMaterial?c(x,y):y.isMeshLambertMaterial?(c(x,y),y.envMap&&(x.envMapIntensity.value=y.envMapIntensity)):y.isMeshToonMaterial?(c(x,y),g(x,y)):y.isMeshPhongMaterial?(c(x,y),v(x,y),y.envMap&&(x.envMapIntensity.value=y.envMapIntensity)):y.isMeshStandardMaterial?(c(x,y),_(x,y),y.isMeshPhysicalMaterial&&M(x,y,U)):y.isMeshMatcapMaterial?(c(x,y),E(x,y)):y.isMeshDepthMaterial?c(x,y):y.isMeshDistanceMaterial?(c(x,y),A(x,y)):y.isMeshNormalMaterial?c(x,y):y.isLineBasicMaterial?(h(x,y),y.isLineDashedMaterial&&d(x,y)):y.isPointsMaterial?m(x,y,w,D):y.isSpriteMaterial?p(x,y):y.isShadowMaterial?(x.color.value.copy(y.color),x.opacity.value=y.opacity):y.isShaderMaterial&&(y.uniformsNeedUpdate=!1)}function c(x,y){x.opacity.value=y.opacity,y.color&&x.diffuse.value.copy(y.color),y.emissive&&x.emissive.value.copy(y.emissive).multiplyScalar(y.emissiveIntensity),y.map&&(x.map.value=y.map,i(y.map,x.mapTransform)),y.alphaMap&&(x.alphaMap.value=y.alphaMap,i(y.alphaMap,x.alphaMapTransform)),y.bumpMap&&(x.bumpMap.value=y.bumpMap,i(y.bumpMap,x.bumpMapTransform),x.bumpScale.value=y.bumpScale,y.side===ii&&(x.bumpScale.value*=-1)),y.normalMap&&(x.normalMap.value=y.normalMap,i(y.normalMap,x.normalMapTransform),x.normalScale.value.copy(y.normalScale),y.side===ii&&x.normalScale.value.negate()),y.displacementMap&&(x.displacementMap.value=y.displacementMap,i(y.displacementMap,x.displacementMapTransform),x.displacementScale.value=y.displacementScale,x.displacementBias.value=y.displacementBias),y.emissiveMap&&(x.emissiveMap.value=y.emissiveMap,i(y.emissiveMap,x.emissiveMapTransform)),y.specularMap&&(x.specularMap.value=y.specularMap,i(y.specularMap,x.specularMapTransform)),y.alphaTest>0&&(x.alphaTest.value=y.alphaTest);const w=t.get(y),D=w.envMap,U=w.envMapRotation;D&&(x.envMap.value=D,Ws.copy(U),Ws.x*=-1,Ws.y*=-1,Ws.z*=-1,D.isCubeTexture&&D.isRenderTargetTexture===!1&&(Ws.y*=-1,Ws.z*=-1),x.envMapRotation.value.setFromMatrix4(yR.makeRotationFromEuler(Ws)),x.flipEnvMap.value=D.isCubeTexture&&D.isRenderTargetTexture===!1?-1:1,x.reflectivity.value=y.reflectivity,x.ior.value=y.ior,x.refractionRatio.value=y.refractionRatio),y.lightMap&&(x.lightMap.value=y.lightMap,x.lightMapIntensity.value=y.lightMapIntensity,i(y.lightMap,x.lightMapTransform)),y.aoMap&&(x.aoMap.value=y.aoMap,x.aoMapIntensity.value=y.aoMapIntensity,i(y.aoMap,x.aoMapTransform))}function h(x,y){x.diffuse.value.copy(y.color),x.opacity.value=y.opacity,y.map&&(x.map.value=y.map,i(y.map,x.mapTransform))}function d(x,y){x.dashSize.value=y.dashSize,x.totalSize.value=y.dashSize+y.gapSize,x.scale.value=y.scale}function m(x,y,w,D){x.diffuse.value.copy(y.color),x.opacity.value=y.opacity,x.size.value=y.size*w,x.scale.value=D*.5,y.map&&(x.map.value=y.map,i(y.map,x.uvTransform)),y.alphaMap&&(x.alphaMap.value=y.alphaMap,i(y.alphaMap,x.alphaMapTransform)),y.alphaTest>0&&(x.alphaTest.value=y.alphaTest)}function p(x,y){x.diffuse.value.copy(y.color),x.opacity.value=y.opacity,x.rotation.value=y.rotation,y.map&&(x.map.value=y.map,i(y.map,x.mapTransform)),y.alphaMap&&(x.alphaMap.value=y.alphaMap,i(y.alphaMap,x.alphaMapTransform)),y.alphaTest>0&&(x.alphaTest.value=y.alphaTest)}function v(x,y){x.specular.value.copy(y.specular),x.shininess.value=Math.max(y.shininess,1e-4)}function g(x,y){y.gradientMap&&(x.gradientMap.value=y.gradientMap)}function _(x,y){x.metalness.value=y.metalness,y.metalnessMap&&(x.metalnessMap.value=y.metalnessMap,i(y.metalnessMap,x.metalnessMapTransform)),x.roughness.value=y.roughness,y.roughnessMap&&(x.roughnessMap.value=y.roughnessMap,i(y.roughnessMap,x.roughnessMapTransform)),y.envMap&&(x.envMapIntensity.value=y.envMapIntensity)}function M(x,y,w){x.ior.value=y.ior,y.sheen>0&&(x.sheenColor.value.copy(y.sheenColor).multiplyScalar(y.sheen),x.sheenRoughness.value=y.sheenRoughness,y.sheenColorMap&&(x.sheenColorMap.value=y.sheenColorMap,i(y.sheenColorMap,x.sheenColorMapTransform)),y.sheenRoughnessMap&&(x.sheenRoughnessMap.value=y.sheenRoughnessMap,i(y.sheenRoughnessMap,x.sheenRoughnessMapTransform))),y.clearcoat>0&&(x.clearcoat.value=y.clearcoat,x.clearcoatRoughness.value=y.clearcoatRoughness,y.clearcoatMap&&(x.clearcoatMap.value=y.clearcoatMap,i(y.clearcoatMap,x.clearcoatMapTransform)),y.clearcoatRoughnessMap&&(x.clearcoatRoughnessMap.value=y.clearcoatRoughnessMap,i(y.clearcoatRoughnessMap,x.clearcoatRoughnessMapTransform)),y.clearcoatNormalMap&&(x.clearcoatNormalMap.value=y.clearcoatNormalMap,i(y.clearcoatNormalMap,x.clearcoatNormalMapTransform),x.clearcoatNormalScale.value.copy(y.clearcoatNormalScale),y.side===ii&&x.clearcoatNormalScale.value.negate())),y.dispersion>0&&(x.dispersion.value=y.dispersion),y.iridescence>0&&(x.iridescence.value=y.iridescence,x.iridescenceIOR.value=y.iridescenceIOR,x.iridescenceThicknessMinimum.value=y.iridescenceThicknessRange[0],x.iridescenceThicknessMaximum.value=y.iridescenceThicknessRange[1],y.iridescenceMap&&(x.iridescenceMap.value=y.iridescenceMap,i(y.iridescenceMap,x.iridescenceMapTransform)),y.iridescenceThicknessMap&&(x.iridescenceThicknessMap.value=y.iridescenceThicknessMap,i(y.iridescenceThicknessMap,x.iridescenceThicknessMapTransform))),y.transmission>0&&(x.transmission.value=y.transmission,x.transmissionSamplerMap.value=w.texture,x.transmissionSamplerSize.value.set(w.width,w.height),y.transmissionMap&&(x.transmissionMap.value=y.transmissionMap,i(y.transmissionMap,x.transmissionMapTransform)),x.thickness.value=y.thickness,y.thicknessMap&&(x.thicknessMap.value=y.thicknessMap,i(y.thicknessMap,x.thicknessMapTransform)),x.attenuationDistance.value=y.attenuationDistance,x.attenuationColor.value.copy(y.attenuationColor)),y.anisotropy>0&&(x.anisotropyVector.value.set(y.anisotropy*Math.cos(y.anisotropyRotation),y.anisotropy*Math.sin(y.anisotropyRotation)),y.anisotropyMap&&(x.anisotropyMap.value=y.anisotropyMap,i(y.anisotropyMap,x.anisotropyMapTransform))),x.specularIntensity.value=y.specularIntensity,x.specularColor.value.copy(y.specularColor),y.specularColorMap&&(x.specularColorMap.value=y.specularColorMap,i(y.specularColorMap,x.specularColorMapTransform)),y.specularIntensityMap&&(x.specularIntensityMap.value=y.specularIntensityMap,i(y.specularIntensityMap,x.specularIntensityMapTransform))}function E(x,y){y.matcap&&(x.matcap.value=y.matcap)}function A(x,y){const w=t.get(y).light;x.referencePosition.value.setFromMatrixPosition(w.matrixWorld),x.nearDistance.value=w.shadow.camera.near,x.farDistance.value=w.shadow.camera.far}return{refreshFogUniforms:s,refreshMaterialUniforms:l}}function ER(r,t,i,s){let l={},c={},h=[];const d=r.getParameter(r.MAX_UNIFORM_BUFFER_BINDINGS);function m(w,D){const U=D.program;s.uniformBlockBinding(w,U)}function p(w,D){let U=l[w.id];U===void 0&&(E(w),U=v(w),l[w.id]=U,w.addEventListener("dispose",x));const H=D.program;s.updateUBOMapping(w,H);const F=t.render.frame;c[w.id]!==F&&(_(w),c[w.id]=F)}function v(w){const D=g();w.__bindingPointIndex=D;const U=r.createBuffer(),H=w.__size,F=w.usage;return r.bindBuffer(r.UNIFORM_BUFFER,U),r.bufferData(r.UNIFORM_BUFFER,H,F),r.bindBuffer(r.UNIFORM_BUFFER,null),r.bindBufferBase(r.UNIFORM_BUFFER,D,U),U}function g(){for(let w=0;w<d;w++)if(h.indexOf(w)===-1)return h.push(w),w;return Ue("WebGLRenderer: Maximum number of simultaneously usable uniforms groups reached."),0}function _(w){const D=l[w.id],U=w.uniforms,H=w.__cache;r.bindBuffer(r.UNIFORM_BUFFER,D);for(let F=0,I=U.length;F<I;F++){const T=Array.isArray(U[F])?U[F]:[U[F]];for(let L=0,Q=T.length;L<Q;L++){const P=T[L];if(M(P,F,L,H)===!0){const W=P.__offset,J=Array.isArray(P.value)?P.value:[P.value];let rt=0;for(let et=0;et<J.length;et++){const O=J[et],B=A(O);typeof O=="number"||typeof O=="boolean"?(P.__data[0]=O,r.bufferSubData(r.UNIFORM_BUFFER,W+rt,P.__data)):O.isMatrix3?(P.__data[0]=O.elements[0],P.__data[1]=O.elements[1],P.__data[2]=O.elements[2],P.__data[3]=0,P.__data[4]=O.elements[3],P.__data[5]=O.elements[4],P.__data[6]=O.elements[5],P.__data[7]=0,P.__data[8]=O.elements[6],P.__data[9]=O.elements[7],P.__data[10]=O.elements[8],P.__data[11]=0):(O.toArray(P.__data,rt),rt+=B.storage/Float32Array.BYTES_PER_ELEMENT)}r.bufferSubData(r.UNIFORM_BUFFER,W,P.__data)}}}r.bindBuffer(r.UNIFORM_BUFFER,null)}function M(w,D,U,H){const F=w.value,I=D+"_"+U;if(H[I]===void 0)return typeof F=="number"||typeof F=="boolean"?H[I]=F:H[I]=F.clone(),!0;{const T=H[I];if(typeof F=="number"||typeof F=="boolean"){if(T!==F)return H[I]=F,!0}else if(T.equals(F)===!1)return T.copy(F),!0}return!1}function E(w){const D=w.uniforms;let U=0;const H=16;for(let I=0,T=D.length;I<T;I++){const L=Array.isArray(D[I])?D[I]:[D[I]];for(let Q=0,P=L.length;Q<P;Q++){const W=L[Q],J=Array.isArray(W.value)?W.value:[W.value];for(let rt=0,et=J.length;rt<et;rt++){const O=J[rt],B=A(O),at=U%H,$=at%B.boundary,lt=at+$;U+=$,lt!==0&&H-lt<B.storage&&(U+=H-lt),W.__data=new Float32Array(B.storage/Float32Array.BYTES_PER_ELEMENT),W.__offset=U,U+=B.storage}}}const F=U%H;return F>0&&(U+=H-F),w.__size=U,w.__cache={},this}function A(w){const D={boundary:0,storage:0};return typeof w=="number"||typeof w=="boolean"?(D.boundary=4,D.storage=4):w.isVector2?(D.boundary=8,D.storage=8):w.isVector3||w.isColor?(D.boundary=16,D.storage=12):w.isVector4?(D.boundary=16,D.storage=16):w.isMatrix3?(D.boundary=48,D.storage=48):w.isMatrix4?(D.boundary=64,D.storage=64):w.isTexture?ee("WebGLRenderer: Texture samplers can not be part of an uniforms group."):ee("WebGLRenderer: Unsupported uniform value type.",w),D}function x(w){const D=w.target;D.removeEventListener("dispose",x);const U=h.indexOf(D.__bindingPointIndex);h.splice(U,1),r.deleteBuffer(l[D.id]),delete l[D.id],delete c[D.id]}function y(){for(const w in l)r.deleteBuffer(l[w]);h=[],l={},c={}}return{bind:m,update:p,dispose:y}}const bR=new Uint16Array([12469,15057,12620,14925,13266,14620,13807,14376,14323,13990,14545,13625,14713,13328,14840,12882,14931,12528,14996,12233,15039,11829,15066,11525,15080,11295,15085,10976,15082,10705,15073,10495,13880,14564,13898,14542,13977,14430,14158,14124,14393,13732,14556,13410,14702,12996,14814,12596,14891,12291,14937,11834,14957,11489,14958,11194,14943,10803,14921,10506,14893,10278,14858,9960,14484,14039,14487,14025,14499,13941,14524,13740,14574,13468,14654,13106,14743,12678,14818,12344,14867,11893,14889,11509,14893,11180,14881,10751,14852,10428,14812,10128,14765,9754,14712,9466,14764,13480,14764,13475,14766,13440,14766,13347,14769,13070,14786,12713,14816,12387,14844,11957,14860,11549,14868,11215,14855,10751,14825,10403,14782,10044,14729,9651,14666,9352,14599,9029,14967,12835,14966,12831,14963,12804,14954,12723,14936,12564,14917,12347,14900,11958,14886,11569,14878,11247,14859,10765,14828,10401,14784,10011,14727,9600,14660,9289,14586,8893,14508,8533,15111,12234,15110,12234,15104,12216,15092,12156,15067,12010,15028,11776,14981,11500,14942,11205,14902,10752,14861,10393,14812,9991,14752,9570,14682,9252,14603,8808,14519,8445,14431,8145,15209,11449,15208,11451,15202,11451,15190,11438,15163,11384,15117,11274,15055,10979,14994,10648,14932,10343,14871,9936,14803,9532,14729,9218,14645,8742,14556,8381,14461,8020,14365,7603,15273,10603,15272,10607,15267,10619,15256,10631,15231,10614,15182,10535,15118,10389,15042,10167,14963,9787,14883,9447,14800,9115,14710,8665,14615,8318,14514,7911,14411,7507,14279,7198,15314,9675,15313,9683,15309,9712,15298,9759,15277,9797,15229,9773,15166,9668,15084,9487,14995,9274,14898,8910,14800,8539,14697,8234,14590,7790,14479,7409,14367,7067,14178,6621,15337,8619,15337,8631,15333,8677,15325,8769,15305,8871,15264,8940,15202,8909,15119,8775,15022,8565,14916,8328,14804,8009,14688,7614,14569,7287,14448,6888,14321,6483,14088,6171,15350,7402,15350,7419,15347,7480,15340,7613,15322,7804,15287,7973,15229,8057,15148,8012,15046,7846,14933,7611,14810,7357,14682,7069,14552,6656,14421,6316,14251,5948,14007,5528,15356,5942,15356,5977,15353,6119,15348,6294,15332,6551,15302,6824,15249,7044,15171,7122,15070,7050,14949,6861,14818,6611,14679,6349,14538,6067,14398,5651,14189,5311,13935,4958,15359,4123,15359,4153,15356,4296,15353,4646,15338,5160,15311,5508,15263,5829,15188,6042,15088,6094,14966,6001,14826,5796,14678,5543,14527,5287,14377,4985,14133,4586,13869,4257,15360,1563,15360,1642,15358,2076,15354,2636,15341,3350,15317,4019,15273,4429,15203,4732,15105,4911,14981,4932,14836,4818,14679,4621,14517,4386,14359,4156,14083,3795,13808,3437,15360,122,15360,137,15358,285,15355,636,15344,1274,15322,2177,15281,2765,15215,3223,15120,3451,14995,3569,14846,3567,14681,3466,14511,3305,14344,3121,14037,2800,13753,2467,15360,0,15360,1,15359,21,15355,89,15346,253,15325,479,15287,796,15225,1148,15133,1492,15008,1749,14856,1882,14685,1886,14506,1783,14324,1608,13996,1398,13702,1183]);let Qi=null;function TR(){return Qi===null&&(Qi=new cE(bR,16,16,io,Pa),Qi.name="DFG_LUT",Qi.minFilter=Bn,Qi.magFilter=Bn,Qi.wrapS=Ua,Qi.wrapT=Ua,Qi.generateMipmaps=!1,Qi.needsUpdate=!0),Qi}class AR{constructor(t={}){const{canvas:i=bM(),context:s=null,depth:l=!0,stencil:c=!1,alpha:h=!1,antialias:d=!1,premultipliedAlpha:m=!0,preserveDrawingBuffer:p=!1,powerPreference:v="default",failIfMajorPerformanceCaveat:g=!1,reversedDepthBuffer:_=!1,outputBufferType:M=mi}=t;this.isWebGLRenderer=!0;let E;if(s!==null){if(typeof WebGLRenderingContext<"u"&&s instanceof WebGLRenderingContext)throw new Error("THREE.WebGLRenderer: WebGL 1 is not supported since r163.");E=s.getContextAttributes().alpha}else E=h;const A=M,x=new Set([Ap,Tp,bp]),y=new Set([mi,sa,hl,dl,Mp,Ep]),w=new Uint32Array(4),D=new Int32Array(4);let U=null,H=null;const F=[],I=[];let T=null;this.domElement=i,this.debug={checkShaderErrors:!0,onShaderError:null},this.autoClear=!0,this.autoClearColor=!0,this.autoClearDepth=!0,this.autoClearStencil=!0,this.sortObjects=!0,this.clippingPlanes=[],this.localClippingEnabled=!1,this.toneMapping=ia,this.toneMappingExposure=1,this.transmissionResolutionScale=1;const L=this;let Q=!1;this._outputColorSpace=Ri;let P=0,W=0,J=null,rt=-1,et=null;const O=new We,B=new We;let at=null;const $=new Se(0);let lt=0,N=i.width,k=i.height,ut=1,vt=null,Rt=null;const Z=new We(0,0,N,k),dt=new We(0,0,N,k);let yt=!1;const Ut=new Np;let Ft=!1,Xt=!1;const ge=new Je,Jt=new j,_e=new We,Te={background:null,fog:null,environment:null,overrideMaterial:null,isScene:!0};let ae=!1;function $e(){return J===null?ut:1}let V=s;function je(C,q){return i.getContext(C,q)}try{const C={alpha:!0,depth:l,stencil:c,antialias:d,premultipliedAlpha:m,preserveDrawingBuffer:p,powerPreference:v,failIfMajorPerformanceCaveat:g};if("setAttribute"in i&&i.setAttribute("data-engine",`three.js r${xp}`),i.addEventListener("webglcontextlost",Ht,!1),i.addEventListener("webglcontextrestored",ie,!1),i.addEventListener("webglcontextcreationerror",Pe,!1),V===null){const q="webgl2";if(V=je(q,C),V===null)throw je(q)?new Error("Error creating WebGL context with your selected attributes."):new Error("Error creating WebGL context.")}}catch(C){throw Ue("WebGLRenderer: "+C.message),C}let be,Ne,Yt,z,b,K,_t,Mt,mt,Wt,wt,Kt,te,Tt,Et,Pt,Ot,zt,fe,Y,Ct,At,It;function bt(){be=new A1(V),be.init(),Ct=new gR(V,be),Ne=new v1(V,be,t,Ct),Yt=new pR(V,be),Ne.reversedDepthBuffer&&_&&Yt.buffers.depth.setReversed(!0),z=new w1(V),b=new tR,K=new mR(V,be,Yt,b,Ne,Ct,z),_t=new T1(L),Mt=new OE(V),At=new g1(V,Mt),mt=new R1(V,Mt,z,At),Wt=new U1(V,mt,Mt,At,z),zt=new D1(V,Ne,K),Et=new x1(b),wt=new $A(L,_t,be,Ne,At,Et),Kt=new MR(L,b),te=new nR,Tt=new lR(be),Ot=new m1(L,_t,Yt,Wt,E,m),Pt=new dR(L,Wt,Ne),It=new ER(V,z,Ne,Yt),fe=new _1(V,be,z),Y=new C1(V,be,z),z.programs=wt.programs,L.capabilities=Ne,L.extensions=be,L.properties=b,L.renderLists=te,L.shadowMap=Pt,L.state=Yt,L.info=z}bt(),A!==mi&&(T=new N1(A,i.width,i.height,l,c));const pt=new SR(L,V);this.xr=pt,this.getContext=function(){return V},this.getContextAttributes=function(){return V.getContextAttributes()},this.forceContextLoss=function(){const C=be.get("WEBGL_lose_context");C&&C.loseContext()},this.forceContextRestore=function(){const C=be.get("WEBGL_lose_context");C&&C.restoreContext()},this.getPixelRatio=function(){return ut},this.setPixelRatio=function(C){C!==void 0&&(ut=C,this.setSize(N,k,!1))},this.getSize=function(C){return C.set(N,k)},this.setSize=function(C,q,ft=!0){if(pt.isPresenting){ee("WebGLRenderer: Can't change size while VR device is presenting.");return}N=C,k=q,i.width=Math.floor(C*ut),i.height=Math.floor(q*ut),ft===!0&&(i.style.width=C+"px",i.style.height=q+"px"),T!==null&&T.setSize(i.width,i.height),this.setViewport(0,0,C,q)},this.getDrawingBufferSize=function(C){return C.set(N*ut,k*ut).floor()},this.setDrawingBufferSize=function(C,q,ft){N=C,k=q,ut=ft,i.width=Math.floor(C*ft),i.height=Math.floor(q*ft),this.setViewport(0,0,C,q)},this.setEffects=function(C){if(A===mi){console.error("THREE.WebGLRenderer: setEffects() requires outputBufferType set to HalfFloatType or FloatType.");return}if(C){for(let q=0;q<C.length;q++)if(C[q].isOutputPass===!0){console.warn("THREE.WebGLRenderer: OutputPass is not needed in setEffects(). Tone mapping and color space conversion are applied automatically.");break}}T.setEffects(C||[])},this.getCurrentViewport=function(C){return C.copy(O)},this.getViewport=function(C){return C.copy(Z)},this.setViewport=function(C,q,ft,ot){C.isVector4?Z.set(C.x,C.y,C.z,C.w):Z.set(C,q,ft,ot),Yt.viewport(O.copy(Z).multiplyScalar(ut).round())},this.getScissor=function(C){return C.copy(dt)},this.setScissor=function(C,q,ft,ot){C.isVector4?dt.set(C.x,C.y,C.z,C.w):dt.set(C,q,ft,ot),Yt.scissor(B.copy(dt).multiplyScalar(ut).round())},this.getScissorTest=function(){return yt},this.setScissorTest=function(C){Yt.setScissorTest(yt=C)},this.setOpaqueSort=function(C){vt=C},this.setTransparentSort=function(C){Rt=C},this.getClearColor=function(C){return C.copy(Ot.getClearColor())},this.setClearColor=function(){Ot.setClearColor(...arguments)},this.getClearAlpha=function(){return Ot.getClearAlpha()},this.setClearAlpha=function(){Ot.setClearAlpha(...arguments)},this.clear=function(C=!0,q=!0,ft=!0){let ot=0;if(C){let nt=!1;if(J!==null){const Dt=J.texture.format;nt=x.has(Dt)}if(nt){const Dt=J.texture.type,Bt=y.has(Dt),Nt=Ot.getClearColor(),qt=Ot.getClearAlpha(),Zt=Nt.r,ne=Nt.g,re=Nt.b;Bt?(w[0]=Zt,w[1]=ne,w[2]=re,w[3]=qt,V.clearBufferuiv(V.COLOR,0,w)):(D[0]=Zt,D[1]=ne,D[2]=re,D[3]=qt,V.clearBufferiv(V.COLOR,0,D))}else ot|=V.COLOR_BUFFER_BIT}q&&(ot|=V.DEPTH_BUFFER_BIT),ft&&(ot|=V.STENCIL_BUFFER_BIT,this.state.buffers.stencil.setMask(4294967295)),ot!==0&&V.clear(ot)},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(){i.removeEventListener("webglcontextlost",Ht,!1),i.removeEventListener("webglcontextrestored",ie,!1),i.removeEventListener("webglcontextcreationerror",Pe,!1),Ot.dispose(),te.dispose(),Tt.dispose(),b.dispose(),_t.dispose(),Wt.dispose(),At.dispose(),It.dispose(),wt.dispose(),pt.dispose(),pt.removeEventListener("sessionstart",tr),pt.removeEventListener("sessionend",er),Wi.stop()};function Ht(C){C.preventDefault(),vu("WebGLRenderer: Context Lost."),Q=!0}function ie(){vu("WebGLRenderer: Context Restored."),Q=!1;const C=z.autoReset,q=Pt.enabled,ft=Pt.autoUpdate,ot=Pt.needsUpdate,nt=Pt.type;bt(),z.autoReset=C,Pt.enabled=q,Pt.autoUpdate=ft,Pt.needsUpdate=ot,Pt.type=nt}function Pe(C){Ue("WebGLRenderer: A WebGL context could not be created. Reason: ",C.statusMessage)}function Ae(C){const q=C.target;q.removeEventListener("dispose",Ae),Hn(q)}function Hn(C){Ci(C),b.remove(C)}function Ci(C){const q=b.get(C).programs;q!==void 0&&(q.forEach(function(ft){wt.releaseProgram(ft)}),C.isShaderMaterial&&wt.releaseShaderCache(C))}this.renderBufferDirect=function(C,q,ft,ot,nt,Dt){q===null&&(q=Te);const Bt=nt.isMesh&&nt.matrixWorld.determinant()<0,Nt=Ml(C,q,ft,ot,nt);Yt.setMaterial(ot,Bt);let qt=ft.index,Zt=1;if(ot.wireframe===!0){if(qt=mt.getWireframeAttribute(ft),qt===void 0)return;Zt=2}const ne=ft.drawRange,re=ft.attributes.position;let Gt=ne.start*Zt,he=(ne.start+ne.count)*Zt;Dt!==null&&(Gt=Math.max(Gt,Dt.start*Zt),he=Math.min(he,(Dt.start+Dt.count)*Zt)),qt!==null?(Gt=Math.max(Gt,0),he=Math.min(he,qt.count)):re!=null&&(Gt=Math.max(Gt,0),he=Math.min(he,re.count));const Ze=he-Gt;if(Ze<0||Ze===1/0)return;At.setup(nt,ot,Nt,ft,qt);let Ke,Ce=fe;if(qt!==null&&(Ke=Mt.get(qt),Ce=Y,Ce.setIndex(Ke)),nt.isMesh)ot.wireframe===!0?(Yt.setLineWidth(ot.wireframeLinewidth*$e()),Ce.setMode(V.LINES)):Ce.setMode(V.TRIANGLES);else if(nt.isLine){let gn=ot.linewidth;gn===void 0&&(gn=1),Yt.setLineWidth(gn*$e()),nt.isLineSegments?Ce.setMode(V.LINES):nt.isLineLoop?Ce.setMode(V.LINE_LOOP):Ce.setMode(V.LINE_STRIP)}else nt.isPoints?Ce.setMode(V.POINTS):nt.isSprite&&Ce.setMode(V.TRIANGLES);if(nt.isBatchedMesh)if(nt._multiDrawInstances!==null)xu("WebGLRenderer: renderMultiDrawInstances has been deprecated and will be removed in r184. Append to renderMultiDraw arguments and use indirection."),Ce.renderMultiDrawInstances(nt._multiDrawStarts,nt._multiDrawCounts,nt._multiDrawCount,nt._multiDrawInstances);else if(be.get("WEBGL_multi_draw"))Ce.renderMultiDraw(nt._multiDrawStarts,nt._multiDrawCounts,nt._multiDrawCount);else{const gn=nt._multiDrawStarts,kt=nt._multiDrawCounts,Gn=nt._multiDrawCount,se=qt?Mt.get(qt).bytesPerElement:1,Vn=b.get(ot).currentProgram.getUniforms();for(let ai=0;ai<Gn;ai++)Vn.setValue(V,"_gl_DrawID",ai),Ce.render(gn[ai]/se,kt[ai])}else if(nt.isInstancedMesh)Ce.renderInstances(Gt,Ze,nt.count);else if(ft.isInstancedBufferGeometry){const gn=ft._maxInstanceCount!==void 0?ft._maxInstanceCount:1/0,kt=Math.min(ft.instanceCount,gn);Ce.renderInstances(Gt,Ze,kt)}else Ce.render(Gt,Ze)};function co(C,q,ft){C.transparent===!0&&C.side===Hi&&C.forceSinglePass===!1?(C.side=ii,C.needsUpdate=!0,Ia(C,q,ft),C.side=xs,C.needsUpdate=!0,Ia(C,q,ft),C.side=Hi):Ia(C,q,ft)}this.compile=function(C,q,ft=null){ft===null&&(ft=C),H=Tt.get(ft),H.init(q),I.push(H),ft.traverseVisible(function(nt){nt.isLight&&nt.layers.test(q.layers)&&(H.pushLight(nt),nt.castShadow&&H.pushShadow(nt))}),C!==ft&&C.traverseVisible(function(nt){nt.isLight&&nt.layers.test(q.layers)&&(H.pushLight(nt),nt.castShadow&&H.pushShadow(nt))}),H.setupLights();const ot=new Set;return C.traverse(function(nt){if(!(nt.isMesh||nt.isPoints||nt.isLine||nt.isSprite))return;const Dt=nt.material;if(Dt)if(Array.isArray(Dt))for(let Bt=0;Bt<Dt.length;Bt++){const Nt=Dt[Bt];co(Nt,ft,nt),ot.add(Nt)}else co(Dt,ft,nt),ot.add(Dt)}),H=I.pop(),ot},this.compileAsync=function(C,q,ft=null){const ot=this.compile(C,q,ft);return new Promise(nt=>{function Dt(){if(ot.forEach(function(Bt){b.get(Bt).currentProgram.isReady()&&ot.delete(Bt)}),ot.size===0){nt(C);return}setTimeout(Dt,10)}be.get("KHR_parallel_shader_compile")!==null?Dt():setTimeout(Dt,10)})};let $s=null;function xl(C){$s&&$s(C)}function tr(){Wi.stop()}function er(){Wi.start()}const Wi=new _x;Wi.setAnimationLoop(xl),typeof self<"u"&&Wi.setContext(self),this.setAnimationLoop=function(C){$s=C,pt.setAnimationLoop(C),C===null?Wi.stop():Wi.start()},pt.addEventListener("sessionstart",tr),pt.addEventListener("sessionend",er),this.render=function(C,q){if(q!==void 0&&q.isCamera!==!0){Ue("WebGLRenderer.render: camera is not an instance of THREE.Camera.");return}if(Q===!0)return;const ft=pt.enabled===!0&&pt.isPresenting===!0,ot=T!==null&&(J===null||ft)&&T.begin(L,J);if(C.matrixWorldAutoUpdate===!0&&C.updateMatrixWorld(),q.parent===null&&q.matrixWorldAutoUpdate===!0&&q.updateMatrixWorld(),pt.enabled===!0&&pt.isPresenting===!0&&(T===null||T.isCompositing()===!1)&&(pt.cameraAutoUpdate===!0&&pt.updateCamera(q),q=pt.getCamera()),C.isScene===!0&&C.onBeforeRender(L,C,q,J),H=Tt.get(C,I.length),H.init(q),I.push(H),ge.multiplyMatrices(q.projectionMatrix,q.matrixWorldInverse),Ut.setFromProjectionMatrix(ge,na,q.reversedDepth),Xt=this.localClippingEnabled,Ft=Et.init(this.clippingPlanes,Xt),U=te.get(C,F.length),U.init(),F.push(U),pt.enabled===!0&&pt.isPresenting===!0){const Bt=L.xr.getDepthSensingMesh();Bt!==null&&nr(Bt,q,-1/0,L.sortObjects)}nr(C,q,0,L.sortObjects),U.finish(),L.sortObjects===!0&&U.sort(vt,Rt),ae=pt.enabled===!1||pt.isPresenting===!1||pt.hasDepthSensing()===!1,ae&&Ot.addToRenderList(U,C),this.info.render.frame++,Ft===!0&&Et.beginShadows();const nt=H.state.shadowsArray;if(Pt.render(nt,C,q),Ft===!0&&Et.endShadows(),this.info.autoReset===!0&&this.info.reset(),(ot&&T.hasRenderPass())===!1){const Bt=U.opaque,Nt=U.transmissive;if(H.setupLights(),q.isArrayCamera){const qt=q.cameras;if(Nt.length>0)for(let Zt=0,ne=qt.length;Zt<ne;Zt++){const re=qt[Zt];rn(Bt,Nt,C,re)}ae&&Ot.render(C);for(let Zt=0,ne=qt.length;Zt<ne;Zt++){const re=qt[Zt];wi(U,C,re,re.viewport)}}else Nt.length>0&&rn(Bt,Nt,C,q),ae&&Ot.render(C),wi(U,C,q)}J!==null&&W===0&&(K.updateMultisampleRenderTarget(J),K.updateRenderTargetMipmap(J)),ot&&T.end(L),C.isScene===!0&&C.onAfterRender(L,C,q),At.resetDefaultState(),rt=-1,et=null,I.pop(),I.length>0?(H=I[I.length-1],Ft===!0&&Et.setGlobalState(L.clippingPlanes,H.state.camera)):H=null,F.pop(),F.length>0?U=F[F.length-1]:U=null};function nr(C,q,ft,ot){if(C.visible===!1)return;if(C.layers.test(q.layers)){if(C.isGroup)ft=C.renderOrder;else if(C.isLOD)C.autoUpdate===!0&&C.update(q);else if(C.isLight)H.pushLight(C),C.castShadow&&H.pushShadow(C);else if(C.isSprite){if(!C.frustumCulled||Ut.intersectsSprite(C)){ot&&_e.setFromMatrixPosition(C.matrixWorld).applyMatrix4(ge);const Bt=Wt.update(C),Nt=C.material;Nt.visible&&U.push(C,Bt,Nt,ft,_e.z,null)}}else if((C.isMesh||C.isLine||C.isPoints)&&(!C.frustumCulled||Ut.intersectsObject(C))){const Bt=Wt.update(C),Nt=C.material;if(ot&&(C.boundingSphere!==void 0?(C.boundingSphere===null&&C.computeBoundingSphere(),_e.copy(C.boundingSphere.center)):(Bt.boundingSphere===null&&Bt.computeBoundingSphere(),_e.copy(Bt.boundingSphere.center)),_e.applyMatrix4(C.matrixWorld).applyMatrix4(ge)),Array.isArray(Nt)){const qt=Bt.groups;for(let Zt=0,ne=qt.length;Zt<ne;Zt++){const re=qt[Zt],Gt=Nt[re.materialIndex];Gt&&Gt.visible&&U.push(C,Bt,Gt,ft,_e.z,re)}}else Nt.visible&&U.push(C,Bt,Nt,ft,_e.z,null)}}const Dt=C.children;for(let Bt=0,Nt=Dt.length;Bt<Nt;Bt++)nr(Dt[Bt],q,ft,ot)}function wi(C,q,ft,ot){const{opaque:nt,transmissive:Dt,transparent:Bt}=C;H.setupLightsView(ft),Ft===!0&&Et.setGlobalState(L.clippingPlanes,ft),ot&&Yt.viewport(O.copy(ot)),nt.length>0&&mn(nt,q,ft),Dt.length>0&&mn(Dt,q,ft),Bt.length>0&&mn(Bt,q,ft),Yt.buffers.depth.setTest(!0),Yt.buffers.depth.setMask(!0),Yt.buffers.color.setMask(!0),Yt.setPolygonOffset(!1)}function rn(C,q,ft,ot){if((ft.isScene===!0?ft.overrideMaterial:null)!==null)return;if(H.state.transmissionRenderTarget[ot.id]===void 0){const Gt=be.has("EXT_color_buffer_half_float")||be.has("EXT_color_buffer_float");H.state.transmissionRenderTarget[ot.id]=new aa(1,1,{generateMipmaps:!0,type:Gt?Pa:mi,minFilter:js,samples:Math.max(4,Ne.samples),stencilBuffer:c,resolveDepthBuffer:!1,resolveStencilBuffer:!1,colorSpace:Re.workingColorSpace})}const Dt=H.state.transmissionRenderTarget[ot.id],Bt=ot.viewport||O;Dt.setSize(Bt.z*L.transmissionResolutionScale,Bt.w*L.transmissionResolutionScale);const Nt=L.getRenderTarget(),qt=L.getActiveCubeFace(),Zt=L.getActiveMipmapLevel();L.setRenderTarget(Dt),L.getClearColor($),lt=L.getClearAlpha(),lt<1&&L.setClearColor(16777215,.5),L.clear(),ae&&Ot.render(ft);const ne=L.toneMapping;L.toneMapping=ia;const re=ot.viewport;if(ot.viewport!==void 0&&(ot.viewport=void 0),H.setupLightsView(ot),Ft===!0&&Et.setGlobalState(L.clippingPlanes,ot),mn(C,ft,ot),K.updateMultisampleRenderTarget(Dt),K.updateRenderTargetMipmap(Dt),be.has("WEBGL_multisampled_render_to_texture")===!1){let Gt=!1;for(let he=0,Ze=q.length;he<Ze;he++){const Ke=q[he],{object:Ce,geometry:gn,material:kt,group:Gn}=Ke;if(kt.side===Hi&&Ce.layers.test(ot.layers)){const se=kt.side;kt.side=ii,kt.needsUpdate=!0,oa(Ce,ft,ot,gn,kt,Gn),kt.side=se,kt.needsUpdate=!0,Gt=!0}}Gt===!0&&(K.updateMultisampleRenderTarget(Dt),K.updateRenderTargetMipmap(Dt))}L.setRenderTarget(Nt,qt,Zt),L.setClearColor($,lt),re!==void 0&&(ot.viewport=re),L.toneMapping=ne}function mn(C,q,ft){const ot=q.isScene===!0?q.overrideMaterial:null;for(let nt=0,Dt=C.length;nt<Dt;nt++){const Bt=C[nt],{object:Nt,geometry:qt,group:Zt}=Bt;let ne=Bt.material;ne.allowOverride===!0&&ot!==null&&(ne=ot),Nt.layers.test(ft.layers)&&oa(Nt,q,ft,qt,ne,Zt)}}function oa(C,q,ft,ot,nt,Dt){C.onBeforeRender(L,q,ft,ot,nt,Dt),C.modelViewMatrix.multiplyMatrices(ft.matrixWorldInverse,C.matrixWorld),C.normalMatrix.getNormalMatrix(C.modelViewMatrix),nt.onBeforeRender(L,q,ft,ot,C,Dt),nt.transparent===!0&&nt.side===Hi&&nt.forceSinglePass===!1?(nt.side=ii,nt.needsUpdate=!0,L.renderBufferDirect(ft,q,ot,nt,C,Dt),nt.side=xs,nt.needsUpdate=!0,L.renderBufferDirect(ft,q,ot,nt,C,Dt),nt.side=Hi):L.renderBufferDirect(ft,q,ot,nt,C,Dt),C.onAfterRender(L,q,ft,ot,nt,Dt)}function Ia(C,q,ft){q.isScene!==!0&&(q=Te);const ot=b.get(C),nt=H.state.lights,Dt=H.state.shadowsArray,Bt=nt.state.version,Nt=wt.getParameters(C,nt.state,Dt,q,ft),qt=wt.getProgramCacheKey(Nt);let Zt=ot.programs;ot.environment=C.isMeshStandardMaterial||C.isMeshLambertMaterial||C.isMeshPhongMaterial?q.environment:null,ot.fog=q.fog;const ne=C.isMeshStandardMaterial||C.isMeshLambertMaterial&&!C.envMap||C.isMeshPhongMaterial&&!C.envMap;ot.envMap=_t.get(C.envMap||ot.environment,ne),ot.envMapRotation=ot.environment!==null&&C.envMap===null?q.environmentRotation:C.envMapRotation,Zt===void 0&&(C.addEventListener("dispose",Ae),Zt=new Map,ot.programs=Zt);let re=Zt.get(qt);if(re!==void 0){if(ot.currentProgram===re&&ot.lightsStateVersion===Bt)return yl(C,Nt),re}else Nt.uniforms=wt.getUniforms(C),C.onBeforeCompile(Nt,L),re=wt.acquireProgram(Nt,qt),Zt.set(qt,re),ot.uniforms=Nt.uniforms;const Gt=ot.uniforms;return(!C.isShaderMaterial&&!C.isRawShaderMaterial||C.clipping===!0)&&(Gt.clippingPlanes=Et.uniform),yl(C,Nt),ot.needsLights=uo(C),ot.lightsStateVersion=Bt,ot.needsLights&&(Gt.ambientLightColor.value=nt.state.ambient,Gt.lightProbe.value=nt.state.probe,Gt.directionalLights.value=nt.state.directional,Gt.directionalLightShadows.value=nt.state.directionalShadow,Gt.spotLights.value=nt.state.spot,Gt.spotLightShadows.value=nt.state.spotShadow,Gt.rectAreaLights.value=nt.state.rectArea,Gt.ltc_1.value=nt.state.rectAreaLTC1,Gt.ltc_2.value=nt.state.rectAreaLTC2,Gt.pointLights.value=nt.state.point,Gt.pointLightShadows.value=nt.state.pointShadow,Gt.hemisphereLights.value=nt.state.hemi,Gt.directionalShadowMatrix.value=nt.state.directionalShadowMatrix,Gt.spotLightMatrix.value=nt.state.spotLightMatrix,Gt.spotLightMap.value=nt.state.spotLightMap,Gt.pointShadowMatrix.value=nt.state.pointShadowMatrix),ot.currentProgram=re,ot.uniformsList=null,re}function Sl(C){if(C.uniformsList===null){const q=C.currentProgram.getUniforms();C.uniformsList=mu.seqWithValue(q.seq,C.uniforms)}return C.uniformsList}function yl(C,q){const ft=b.get(C);ft.outputColorSpace=q.outputColorSpace,ft.batching=q.batching,ft.batchingColor=q.batchingColor,ft.instancing=q.instancing,ft.instancingColor=q.instancingColor,ft.instancingMorph=q.instancingMorph,ft.skinning=q.skinning,ft.morphTargets=q.morphTargets,ft.morphNormals=q.morphNormals,ft.morphColors=q.morphColors,ft.morphTargetsCount=q.morphTargetsCount,ft.numClippingPlanes=q.numClippingPlanes,ft.numIntersection=q.numClipIntersection,ft.vertexAlphas=q.vertexAlphas,ft.vertexTangents=q.vertexTangents,ft.toneMapping=q.toneMapping}function Ml(C,q,ft,ot,nt){q.isScene!==!0&&(q=Te),K.resetTextureUnits();const Dt=q.fog,Bt=ot.isMeshStandardMaterial||ot.isMeshLambertMaterial||ot.isMeshPhongMaterial?q.environment:null,Nt=J===null?L.outputColorSpace:J.isXRRenderTarget===!0?J.texture.colorSpace:ao,qt=ot.isMeshStandardMaterial||ot.isMeshLambertMaterial&&!ot.envMap||ot.isMeshPhongMaterial&&!ot.envMap,Zt=_t.get(ot.envMap||Bt,qt),ne=ot.vertexColors===!0&&!!ft.attributes.color&&ft.attributes.color.itemSize===4,re=!!ft.attributes.tangent&&(!!ot.normalMap||ot.anisotropy>0),Gt=!!ft.morphAttributes.position,he=!!ft.morphAttributes.normal,Ze=!!ft.morphAttributes.color;let Ke=ia;ot.toneMapped&&(J===null||J.isXRRenderTarget===!0)&&(Ke=L.toneMapping);const Ce=ft.morphAttributes.position||ft.morphAttributes.normal||ft.morphAttributes.color,gn=Ce!==void 0?Ce.length:0,kt=b.get(ot),Gn=H.state.lights;if(Ft===!0&&(Xt===!0||C!==et)){const ln=C===et&&ot.id===rt;Et.setState(ot,C,ln)}let se=!1;ot.version===kt.__version?(kt.needsLights&&kt.lightsStateVersion!==Gn.state.version||kt.outputColorSpace!==Nt||nt.isBatchedMesh&&kt.batching===!1||!nt.isBatchedMesh&&kt.batching===!0||nt.isBatchedMesh&&kt.batchingColor===!0&&nt.colorTexture===null||nt.isBatchedMesh&&kt.batchingColor===!1&&nt.colorTexture!==null||nt.isInstancedMesh&&kt.instancing===!1||!nt.isInstancedMesh&&kt.instancing===!0||nt.isSkinnedMesh&&kt.skinning===!1||!nt.isSkinnedMesh&&kt.skinning===!0||nt.isInstancedMesh&&kt.instancingColor===!0&&nt.instanceColor===null||nt.isInstancedMesh&&kt.instancingColor===!1&&nt.instanceColor!==null||nt.isInstancedMesh&&kt.instancingMorph===!0&&nt.morphTexture===null||nt.isInstancedMesh&&kt.instancingMorph===!1&&nt.morphTexture!==null||kt.envMap!==Zt||ot.fog===!0&&kt.fog!==Dt||kt.numClippingPlanes!==void 0&&(kt.numClippingPlanes!==Et.numPlanes||kt.numIntersection!==Et.numIntersection)||kt.vertexAlphas!==ne||kt.vertexTangents!==re||kt.morphTargets!==Gt||kt.morphNormals!==he||kt.morphColors!==Ze||kt.toneMapping!==Ke||kt.morphTargetsCount!==gn)&&(se=!0):(se=!0,kt.__version=ot.version);let Vn=kt.currentProgram;se===!0&&(Vn=Ia(ot,q,nt));let ai=!1,Di=!1,si=!1;const Oe=Vn.getUniforms(),on=kt.uniforms;if(Yt.useProgram(Vn.program)&&(ai=!0,Di=!0,si=!0),ot.id!==rt&&(rt=ot.id,Di=!0),ai||et!==C){Yt.buffers.depth.getReversed()&&C.reversedDepth!==!0&&(C._reversedDepth=!0,C.updateProjectionMatrix()),Oe.setValue(V,"projectionMatrix",C.projectionMatrix),Oe.setValue(V,"viewMatrix",C.matrixWorldInverse);const Ui=Oe.map.cameraPosition;Ui!==void 0&&Ui.setValue(V,Jt.setFromMatrixPosition(C.matrixWorld)),Ne.logarithmicDepthBuffer&&Oe.setValue(V,"logDepthBufFC",2/(Math.log(C.far+1)/Math.LN2)),(ot.isMeshPhongMaterial||ot.isMeshToonMaterial||ot.isMeshLambertMaterial||ot.isMeshBasicMaterial||ot.isMeshStandardMaterial||ot.isShaderMaterial)&&Oe.setValue(V,"isOrthographic",C.isOrthographicCamera===!0),et!==C&&(et=C,Di=!0,si=!0)}if(kt.needsLights&&(Gn.state.directionalShadowMap.length>0&&Oe.setValue(V,"directionalShadowMap",Gn.state.directionalShadowMap,K),Gn.state.spotShadowMap.length>0&&Oe.setValue(V,"spotShadowMap",Gn.state.spotShadowMap,K),Gn.state.pointShadowMap.length>0&&Oe.setValue(V,"pointShadowMap",Gn.state.pointShadowMap,K)),nt.isSkinnedMesh){Oe.setOptional(V,nt,"bindMatrix"),Oe.setOptional(V,nt,"bindMatrixInverse");const ln=nt.skeleton;ln&&(ln.boneTexture===null&&ln.computeBoneTexture(),Oe.setValue(V,"boneTexture",ln.boneTexture,K))}nt.isBatchedMesh&&(Oe.setOptional(V,nt,"batchingTexture"),Oe.setValue(V,"batchingTexture",nt._matricesTexture,K),Oe.setOptional(V,nt,"batchingIdTexture"),Oe.setValue(V,"batchingIdTexture",nt._indirectTexture,K),Oe.setOptional(V,nt,"batchingColorTexture"),nt._colorsTexture!==null&&Oe.setValue(V,"batchingColorTexture",nt._colorsTexture,K));const kn=ft.morphAttributes;if((kn.position!==void 0||kn.normal!==void 0||kn.color!==void 0)&&zt.update(nt,ft,Vn),(Di||kt.receiveShadow!==nt.receiveShadow)&&(kt.receiveShadow=nt.receiveShadow,Oe.setValue(V,"receiveShadow",nt.receiveShadow)),(ot.isMeshStandardMaterial||ot.isMeshLambertMaterial||ot.isMeshPhongMaterial)&&ot.envMap===null&&q.environment!==null&&(on.envMapIntensity.value=q.environmentIntensity),on.dfgLUT!==void 0&&(on.dfgLUT.value=TR()),Di&&(Oe.setValue(V,"toneMappingExposure",L.toneMappingExposure),kt.needsLights&&Ms(on,si),Dt&&ot.fog===!0&&Kt.refreshFogUniforms(on,Dt),Kt.refreshMaterialUniforms(on,ot,ut,k,H.state.transmissionRenderTarget[C.id]),mu.upload(V,Sl(kt),on,K)),ot.isShaderMaterial&&ot.uniformsNeedUpdate===!0&&(mu.upload(V,Sl(kt),on,K),ot.uniformsNeedUpdate=!1),ot.isSpriteMaterial&&Oe.setValue(V,"center",nt.center),Oe.setValue(V,"modelViewMatrix",nt.modelViewMatrix),Oe.setValue(V,"normalMatrix",nt.normalMatrix),Oe.setValue(V,"modelMatrix",nt.matrixWorld),ot.isShaderMaterial||ot.isRawShaderMaterial){const ln=ot.uniformsGroups;for(let Ui=0,la=ln.length;Ui<la;Ui++){const ir=ln[Ui];It.update(ir,Vn),It.bind(ir,Vn)}}return Vn}function Ms(C,q){C.ambientLightColor.needsUpdate=q,C.lightProbe.needsUpdate=q,C.directionalLights.needsUpdate=q,C.directionalLightShadows.needsUpdate=q,C.pointLights.needsUpdate=q,C.pointLightShadows.needsUpdate=q,C.spotLights.needsUpdate=q,C.spotLightShadows.needsUpdate=q,C.rectAreaLights.needsUpdate=q,C.hemisphereLights.needsUpdate=q}function uo(C){return C.isMeshLambertMaterial||C.isMeshToonMaterial||C.isMeshPhongMaterial||C.isMeshStandardMaterial||C.isShadowMaterial||C.isShaderMaterial&&C.lights===!0}this.getActiveCubeFace=function(){return P},this.getActiveMipmapLevel=function(){return W},this.getRenderTarget=function(){return J},this.setRenderTargetTextures=function(C,q,ft){const ot=b.get(C);ot.__autoAllocateDepthBuffer=C.resolveDepthBuffer===!1,ot.__autoAllocateDepthBuffer===!1&&(ot.__useRenderToTexture=!1),b.get(C.texture).__webglTexture=q,b.get(C.depthTexture).__webglTexture=ot.__autoAllocateDepthBuffer?void 0:ft,ot.__hasExternalTextures=!0},this.setRenderTargetFramebuffer=function(C,q){const ft=b.get(C);ft.__webglFramebuffer=q,ft.__useDefaultFramebuffer=q===void 0};const Fa=V.createFramebuffer();this.setRenderTarget=function(C,q=0,ft=0){J=C,P=q,W=ft;let ot=null,nt=!1,Dt=!1;if(C){const Nt=b.get(C);if(Nt.__useDefaultFramebuffer!==void 0){Yt.bindFramebuffer(V.FRAMEBUFFER,Nt.__webglFramebuffer),O.copy(C.viewport),B.copy(C.scissor),at=C.scissorTest,Yt.viewport(O),Yt.scissor(B),Yt.setScissorTest(at),rt=-1;return}else if(Nt.__webglFramebuffer===void 0)K.setupRenderTarget(C);else if(Nt.__hasExternalTextures)K.rebindTextures(C,b.get(C.texture).__webglTexture,b.get(C.depthTexture).__webglTexture);else if(C.depthBuffer){const ne=C.depthTexture;if(Nt.__boundDepthTexture!==ne){if(ne!==null&&b.has(ne)&&(C.width!==ne.image.width||C.height!==ne.image.height))throw new Error("WebGLRenderTarget: Attached DepthTexture is initialized to the incorrect size.");K.setupDepthRenderbuffer(C)}}const qt=C.texture;(qt.isData3DTexture||qt.isDataArrayTexture||qt.isCompressedArrayTexture)&&(Dt=!0);const Zt=b.get(C).__webglFramebuffer;C.isWebGLCubeRenderTarget?(Array.isArray(Zt[q])?ot=Zt[q][ft]:ot=Zt[q],nt=!0):C.samples>0&&K.useMultisampledRTT(C)===!1?ot=b.get(C).__webglMultisampledFramebuffer:Array.isArray(Zt)?ot=Zt[ft]:ot=Zt,O.copy(C.viewport),B.copy(C.scissor),at=C.scissorTest}else O.copy(Z).multiplyScalar(ut).floor(),B.copy(dt).multiplyScalar(ut).floor(),at=yt;if(ft!==0&&(ot=Fa),Yt.bindFramebuffer(V.FRAMEBUFFER,ot)&&Yt.drawBuffers(C,ot),Yt.viewport(O),Yt.scissor(B),Yt.setScissorTest(at),nt){const Nt=b.get(C.texture);V.framebufferTexture2D(V.FRAMEBUFFER,V.COLOR_ATTACHMENT0,V.TEXTURE_CUBE_MAP_POSITIVE_X+q,Nt.__webglTexture,ft)}else if(Dt){const Nt=q;for(let qt=0;qt<C.textures.length;qt++){const Zt=b.get(C.textures[qt]);V.framebufferTextureLayer(V.FRAMEBUFFER,V.COLOR_ATTACHMENT0+qt,Zt.__webglTexture,ft,Nt)}}else if(C!==null&&ft!==0){const Nt=b.get(C.texture);V.framebufferTexture2D(V.FRAMEBUFFER,V.COLOR_ATTACHMENT0,V.TEXTURE_2D,Nt.__webglTexture,ft)}rt=-1},this.readRenderTargetPixels=function(C,q,ft,ot,nt,Dt,Bt,Nt=0){if(!(C&&C.isWebGLRenderTarget)){Ue("WebGLRenderer.readRenderTargetPixels: renderTarget is not THREE.WebGLRenderTarget.");return}let qt=b.get(C).__webglFramebuffer;if(C.isWebGLCubeRenderTarget&&Bt!==void 0&&(qt=qt[Bt]),qt){Yt.bindFramebuffer(V.FRAMEBUFFER,qt);try{const Zt=C.textures[Nt],ne=Zt.format,re=Zt.type;if(C.textures.length>1&&V.readBuffer(V.COLOR_ATTACHMENT0+Nt),!Ne.textureFormatReadable(ne)){Ue("WebGLRenderer.readRenderTargetPixels: renderTarget is not in RGBA or implementation defined format.");return}if(!Ne.textureTypeReadable(re)){Ue("WebGLRenderer.readRenderTargetPixels: renderTarget is not in UnsignedByteType or implementation defined type.");return}q>=0&&q<=C.width-ot&&ft>=0&&ft<=C.height-nt&&V.readPixels(q,ft,ot,nt,Ct.convert(ne),Ct.convert(re),Dt)}finally{const Zt=J!==null?b.get(J).__webglFramebuffer:null;Yt.bindFramebuffer(V.FRAMEBUFFER,Zt)}}},this.readRenderTargetPixelsAsync=async function(C,q,ft,ot,nt,Dt,Bt,Nt=0){if(!(C&&C.isWebGLRenderTarget))throw new Error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not THREE.WebGLRenderTarget.");let qt=b.get(C).__webglFramebuffer;if(C.isWebGLCubeRenderTarget&&Bt!==void 0&&(qt=qt[Bt]),qt)if(q>=0&&q<=C.width-ot&&ft>=0&&ft<=C.height-nt){Yt.bindFramebuffer(V.FRAMEBUFFER,qt);const Zt=C.textures[Nt],ne=Zt.format,re=Zt.type;if(C.textures.length>1&&V.readBuffer(V.COLOR_ATTACHMENT0+Nt),!Ne.textureFormatReadable(ne))throw new Error("THREE.WebGLRenderer.readRenderTargetPixelsAsync: renderTarget is not in RGBA or implementation defined format.");if(!Ne.textureTypeReadable(re))throw new Error("THREE.WebGLRenderer.readRenderTargetPixelsAsync: renderTarget is not in UnsignedByteType or implementation defined type.");const Gt=V.createBuffer();V.bindBuffer(V.PIXEL_PACK_BUFFER,Gt),V.bufferData(V.PIXEL_PACK_BUFFER,Dt.byteLength,V.STREAM_READ),V.readPixels(q,ft,ot,nt,Ct.convert(ne),Ct.convert(re),0);const he=J!==null?b.get(J).__webglFramebuffer:null;Yt.bindFramebuffer(V.FRAMEBUFFER,he);const Ze=V.fenceSync(V.SYNC_GPU_COMMANDS_COMPLETE,0);return V.flush(),await TM(V,Ze,4),V.bindBuffer(V.PIXEL_PACK_BUFFER,Gt),V.getBufferSubData(V.PIXEL_PACK_BUFFER,0,Dt),V.deleteBuffer(Gt),V.deleteSync(Ze),Dt}else throw new Error("THREE.WebGLRenderer.readRenderTargetPixelsAsync: requested read bounds are out of range.")},this.copyFramebufferToTexture=function(C,q=null,ft=0){const ot=Math.pow(2,-ft),nt=Math.floor(C.image.width*ot),Dt=Math.floor(C.image.height*ot),Bt=q!==null?q.x:0,Nt=q!==null?q.y:0;K.setTexture2D(C,0),V.copyTexSubImage2D(V.TEXTURE_2D,ft,0,0,Bt,Nt,nt,Dt),Yt.unbindTexture()};const Ba=V.createFramebuffer(),Es=V.createFramebuffer();this.copyTextureToTexture=function(C,q,ft=null,ot=null,nt=0,Dt=0){let Bt,Nt,qt,Zt,ne,re,Gt,he,Ze;const Ke=C.isCompressedTexture?C.mipmaps[Dt]:C.image;if(ft!==null)Bt=ft.max.x-ft.min.x,Nt=ft.max.y-ft.min.y,qt=ft.isBox3?ft.max.z-ft.min.z:1,Zt=ft.min.x,ne=ft.min.y,re=ft.isBox3?ft.min.z:0;else{const on=Math.pow(2,-nt);Bt=Math.floor(Ke.width*on),Nt=Math.floor(Ke.height*on),C.isDataArrayTexture?qt=Ke.depth:C.isData3DTexture?qt=Math.floor(Ke.depth*on):qt=1,Zt=0,ne=0,re=0}ot!==null?(Gt=ot.x,he=ot.y,Ze=ot.z):(Gt=0,he=0,Ze=0);const Ce=Ct.convert(q.format),gn=Ct.convert(q.type);let kt;q.isData3DTexture?(K.setTexture3D(q,0),kt=V.TEXTURE_3D):q.isDataArrayTexture||q.isCompressedArrayTexture?(K.setTexture2DArray(q,0),kt=V.TEXTURE_2D_ARRAY):(K.setTexture2D(q,0),kt=V.TEXTURE_2D),V.pixelStorei(V.UNPACK_FLIP_Y_WEBGL,q.flipY),V.pixelStorei(V.UNPACK_PREMULTIPLY_ALPHA_WEBGL,q.premultiplyAlpha),V.pixelStorei(V.UNPACK_ALIGNMENT,q.unpackAlignment);const Gn=V.getParameter(V.UNPACK_ROW_LENGTH),se=V.getParameter(V.UNPACK_IMAGE_HEIGHT),Vn=V.getParameter(V.UNPACK_SKIP_PIXELS),ai=V.getParameter(V.UNPACK_SKIP_ROWS),Di=V.getParameter(V.UNPACK_SKIP_IMAGES);V.pixelStorei(V.UNPACK_ROW_LENGTH,Ke.width),V.pixelStorei(V.UNPACK_IMAGE_HEIGHT,Ke.height),V.pixelStorei(V.UNPACK_SKIP_PIXELS,Zt),V.pixelStorei(V.UNPACK_SKIP_ROWS,ne),V.pixelStorei(V.UNPACK_SKIP_IMAGES,re);const si=C.isDataArrayTexture||C.isData3DTexture,Oe=q.isDataArrayTexture||q.isData3DTexture;if(C.isDepthTexture){const on=b.get(C),kn=b.get(q),ln=b.get(on.__renderTarget),Ui=b.get(kn.__renderTarget);Yt.bindFramebuffer(V.READ_FRAMEBUFFER,ln.__webglFramebuffer),Yt.bindFramebuffer(V.DRAW_FRAMEBUFFER,Ui.__webglFramebuffer);for(let la=0;la<qt;la++)si&&(V.framebufferTextureLayer(V.READ_FRAMEBUFFER,V.COLOR_ATTACHMENT0,b.get(C).__webglTexture,nt,re+la),V.framebufferTextureLayer(V.DRAW_FRAMEBUFFER,V.COLOR_ATTACHMENT0,b.get(q).__webglTexture,Dt,Ze+la)),V.blitFramebuffer(Zt,ne,Bt,Nt,Gt,he,Bt,Nt,V.DEPTH_BUFFER_BIT,V.NEAREST);Yt.bindFramebuffer(V.READ_FRAMEBUFFER,null),Yt.bindFramebuffer(V.DRAW_FRAMEBUFFER,null)}else if(nt!==0||C.isRenderTargetTexture||b.has(C)){const on=b.get(C),kn=b.get(q);Yt.bindFramebuffer(V.READ_FRAMEBUFFER,Ba),Yt.bindFramebuffer(V.DRAW_FRAMEBUFFER,Es);for(let ln=0;ln<qt;ln++)si?V.framebufferTextureLayer(V.READ_FRAMEBUFFER,V.COLOR_ATTACHMENT0,on.__webglTexture,nt,re+ln):V.framebufferTexture2D(V.READ_FRAMEBUFFER,V.COLOR_ATTACHMENT0,V.TEXTURE_2D,on.__webglTexture,nt),Oe?V.framebufferTextureLayer(V.DRAW_FRAMEBUFFER,V.COLOR_ATTACHMENT0,kn.__webglTexture,Dt,Ze+ln):V.framebufferTexture2D(V.DRAW_FRAMEBUFFER,V.COLOR_ATTACHMENT0,V.TEXTURE_2D,kn.__webglTexture,Dt),nt!==0?V.blitFramebuffer(Zt,ne,Bt,Nt,Gt,he,Bt,Nt,V.COLOR_BUFFER_BIT,V.NEAREST):Oe?V.copyTexSubImage3D(kt,Dt,Gt,he,Ze+ln,Zt,ne,Bt,Nt):V.copyTexSubImage2D(kt,Dt,Gt,he,Zt,ne,Bt,Nt);Yt.bindFramebuffer(V.READ_FRAMEBUFFER,null),Yt.bindFramebuffer(V.DRAW_FRAMEBUFFER,null)}else Oe?C.isDataTexture||C.isData3DTexture?V.texSubImage3D(kt,Dt,Gt,he,Ze,Bt,Nt,qt,Ce,gn,Ke.data):q.isCompressedArrayTexture?V.compressedTexSubImage3D(kt,Dt,Gt,he,Ze,Bt,Nt,qt,Ce,Ke.data):V.texSubImage3D(kt,Dt,Gt,he,Ze,Bt,Nt,qt,Ce,gn,Ke):C.isDataTexture?V.texSubImage2D(V.TEXTURE_2D,Dt,Gt,he,Bt,Nt,Ce,gn,Ke.data):C.isCompressedTexture?V.compressedTexSubImage2D(V.TEXTURE_2D,Dt,Gt,he,Ke.width,Ke.height,Ce,Ke.data):V.texSubImage2D(V.TEXTURE_2D,Dt,Gt,he,Bt,Nt,Ce,gn,Ke);V.pixelStorei(V.UNPACK_ROW_LENGTH,Gn),V.pixelStorei(V.UNPACK_IMAGE_HEIGHT,se),V.pixelStorei(V.UNPACK_SKIP_PIXELS,Vn),V.pixelStorei(V.UNPACK_SKIP_ROWS,ai),V.pixelStorei(V.UNPACK_SKIP_IMAGES,Di),Dt===0&&q.generateMipmaps&&V.generateMipmap(kt),Yt.unbindTexture()},this.initRenderTarget=function(C){b.get(C).__webglFramebuffer===void 0&&K.setupRenderTarget(C)},this.initTexture=function(C){C.isCubeTexture?K.setTextureCube(C,0):C.isData3DTexture?K.setTexture3D(C,0):C.isDataArrayTexture||C.isCompressedArrayTexture?K.setTexture2DArray(C,0):K.setTexture2D(C,0),Yt.unbindTexture()},this.resetState=function(){P=0,W=0,J=null,Yt.reset(),At.reset()},typeof __THREE_DEVTOOLS__<"u"&&__THREE_DEVTOOLS__.dispatchEvent(new CustomEvent("observe",{detail:this}))}get coordinateSystem(){return na}get outputColorSpace(){return this._outputColorSpace}set outputColorSpace(t){this._outputColorSpace=t;const i=this.getContext();i.drawingBufferColorSpace=Re._getDrawingBufferColorSpace(t),i.unpackColorSpace=Re._getUnpackColorSpace()}}const Uv={type:"change"},zp={type:"start"},Ex={type:"end"},au=new Up,Lv=new ms,RR=Math.cos(70*rx.DEG2RAD),vn=new j,ei=2*Math.PI,ke={NONE:-1,ROTATE:0,DOLLY:1,PAN:2,TOUCH_ROTATE:3,TOUCH_PAN:4,TOUCH_DOLLY_PAN:5,TOUCH_DOLLY_ROTATE:6},vd=1e-6;class CR extends LE{constructor(t,i=null){super(t,i),this.state=ke.NONE,this.target=new j,this.cursor=new j,this.minDistance=0,this.maxDistance=1/0,this.minZoom=0,this.maxZoom=1/0,this.minTargetRadius=0,this.maxTargetRadius=1/0,this.minPolarAngle=0,this.maxPolarAngle=Math.PI,this.minAzimuthAngle=-1/0,this.maxAzimuthAngle=1/0,this.enableDamping=!1,this.dampingFactor=.05,this.enableZoom=!0,this.zoomSpeed=1,this.enableRotate=!0,this.rotateSpeed=1,this.keyRotateSpeed=1,this.enablePan=!0,this.panSpeed=1,this.screenSpacePanning=!0,this.keyPanSpeed=7,this.zoomToCursor=!1,this.autoRotate=!1,this.autoRotateSpeed=2,this.keys={LEFT:"ArrowLeft",UP:"ArrowUp",RIGHT:"ArrowRight",BOTTOM:"ArrowDown"},this.mouseButtons={LEFT:Jr.ROTATE,MIDDLE:Jr.DOLLY,RIGHT:Jr.PAN},this.touches={ONE:Qr.ROTATE,TWO:Qr.DOLLY_PAN},this.target0=this.target.clone(),this.position0=this.object.position.clone(),this.zoom0=this.object.zoom,this._cursorStyle="auto",this._domElementKeyEvents=null,this._lastPosition=new j,this._lastQuaternion=new Ss,this._lastTargetPosition=new j,this._quat=new Ss().setFromUnitVectors(t.up,new j(0,1,0)),this._quatInverse=this._quat.clone().invert(),this._spherical=new sv,this._sphericalDelta=new sv,this._scale=1,this._panOffset=new j,this._rotateStart=new le,this._rotateEnd=new le,this._rotateDelta=new le,this._panStart=new le,this._panEnd=new le,this._panDelta=new le,this._dollyStart=new le,this._dollyEnd=new le,this._dollyDelta=new le,this._dollyDirection=new j,this._mouse=new le,this._performCursorZoom=!1,this._pointers=[],this._pointerPositions={},this._controlActive=!1,this._onPointerMove=DR.bind(this),this._onPointerDown=wR.bind(this),this._onPointerUp=UR.bind(this),this._onContextMenu=FR.bind(this),this._onMouseWheel=OR.bind(this),this._onKeyDown=PR.bind(this),this._onTouchStart=zR.bind(this),this._onTouchMove=IR.bind(this),this._onMouseDown=LR.bind(this),this._onMouseMove=NR.bind(this),this._interceptControlDown=BR.bind(this),this._interceptControlUp=HR.bind(this),this.domElement!==null&&this.connect(this.domElement),this.update()}set cursorStyle(t){this._cursorStyle=t,t==="grab"?this.domElement.style.cursor="grab":this.domElement.style.cursor="auto"}get cursorStyle(){return this._cursorStyle}connect(t){super.connect(t),this.domElement.addEventListener("pointerdown",this._onPointerDown),this.domElement.addEventListener("pointercancel",this._onPointerUp),this.domElement.addEventListener("contextmenu",this._onContextMenu),this.domElement.addEventListener("wheel",this._onMouseWheel,{passive:!1}),this.domElement.getRootNode().addEventListener("keydown",this._interceptControlDown,{passive:!0,capture:!0}),this.domElement.style.touchAction="none"}disconnect(){this.domElement.removeEventListener("pointerdown",this._onPointerDown),this.domElement.ownerDocument.removeEventListener("pointermove",this._onPointerMove),this.domElement.ownerDocument.removeEventListener("pointerup",this._onPointerUp),this.domElement.removeEventListener("pointercancel",this._onPointerUp),this.domElement.removeEventListener("wheel",this._onMouseWheel),this.domElement.removeEventListener("contextmenu",this._onContextMenu),this.stopListenToKeyEvents(),this.domElement.getRootNode().removeEventListener("keydown",this._interceptControlDown,{capture:!0}),this.domElement.style.touchAction="auto"}dispose(){this.disconnect()}getPolarAngle(){return this._spherical.phi}getAzimuthalAngle(){return this._spherical.theta}getDistance(){return this.object.position.distanceTo(this.target)}listenToKeyEvents(t){t.addEventListener("keydown",this._onKeyDown),this._domElementKeyEvents=t}stopListenToKeyEvents(){this._domElementKeyEvents!==null&&(this._domElementKeyEvents.removeEventListener("keydown",this._onKeyDown),this._domElementKeyEvents=null)}saveState(){this.target0.copy(this.target),this.position0.copy(this.object.position),this.zoom0=this.object.zoom}reset(){this.target.copy(this.target0),this.object.position.copy(this.position0),this.object.zoom=this.zoom0,this.object.updateProjectionMatrix(),this.dispatchEvent(Uv),this.update(),this.state=ke.NONE}pan(t,i){this._pan(t,i),this.update()}dollyIn(t){this._dollyIn(t),this.update()}dollyOut(t){this._dollyOut(t),this.update()}rotateLeft(t){this._rotateLeft(t),this.update()}rotateUp(t){this._rotateUp(t),this.update()}update(t=null){const i=this.object.position;vn.copy(i).sub(this.target),vn.applyQuaternion(this._quat),this._spherical.setFromVector3(vn),this.autoRotate&&this.state===ke.NONE&&this._rotateLeft(this._getAutoRotationAngle(t)),this.enableDamping?(this._spherical.theta+=this._sphericalDelta.theta*this.dampingFactor,this._spherical.phi+=this._sphericalDelta.phi*this.dampingFactor):(this._spherical.theta+=this._sphericalDelta.theta,this._spherical.phi+=this._sphericalDelta.phi);let s=this.minAzimuthAngle,l=this.maxAzimuthAngle;isFinite(s)&&isFinite(l)&&(s<-Math.PI?s+=ei:s>Math.PI&&(s-=ei),l<-Math.PI?l+=ei:l>Math.PI&&(l-=ei),s<=l?this._spherical.theta=Math.max(s,Math.min(l,this._spherical.theta)):this._spherical.theta=this._spherical.theta>(s+l)/2?Math.max(s,this._spherical.theta):Math.min(l,this._spherical.theta)),this._spherical.phi=Math.max(this.minPolarAngle,Math.min(this.maxPolarAngle,this._spherical.phi)),this._spherical.makeSafe(),this.enableDamping===!0?this.target.addScaledVector(this._panOffset,this.dampingFactor):this.target.add(this._panOffset),this.target.sub(this.cursor),this.target.clampLength(this.minTargetRadius,this.maxTargetRadius),this.target.add(this.cursor);let c=!1;if(this.zoomToCursor&&this._performCursorZoom||this.object.isOrthographicCamera)this._spherical.radius=this._clampDistance(this._spherical.radius);else{const h=this._spherical.radius;this._spherical.radius=this._clampDistance(this._spherical.radius*this._scale),c=h!=this._spherical.radius}if(vn.setFromSpherical(this._spherical),vn.applyQuaternion(this._quatInverse),i.copy(this.target).add(vn),this.object.lookAt(this.target),this.enableDamping===!0?(this._sphericalDelta.theta*=1-this.dampingFactor,this._sphericalDelta.phi*=1-this.dampingFactor,this._panOffset.multiplyScalar(1-this.dampingFactor)):(this._sphericalDelta.set(0,0,0),this._panOffset.set(0,0,0)),this.zoomToCursor&&this._performCursorZoom){let h=null;if(this.object.isPerspectiveCamera){const d=vn.length();h=this._clampDistance(d*this._scale);const m=d-h;this.object.position.addScaledVector(this._dollyDirection,m),this.object.updateMatrixWorld(),c=!!m}else if(this.object.isOrthographicCamera){const d=new j(this._mouse.x,this._mouse.y,0);d.unproject(this.object);const m=this.object.zoom;this.object.zoom=Math.max(this.minZoom,Math.min(this.maxZoom,this.object.zoom/this._scale)),this.object.updateProjectionMatrix(),c=m!==this.object.zoom;const p=new j(this._mouse.x,this._mouse.y,0);p.unproject(this.object),this.object.position.sub(p).add(d),this.object.updateMatrixWorld(),h=vn.length()}else console.warn("WARNING: OrbitControls.js encountered an unknown camera type - zoom to cursor disabled."),this.zoomToCursor=!1;h!==null&&(this.screenSpacePanning?this.target.set(0,0,-1).transformDirection(this.object.matrix).multiplyScalar(h).add(this.object.position):(au.origin.copy(this.object.position),au.direction.set(0,0,-1).transformDirection(this.object.matrix),Math.abs(this.object.up.dot(au.direction))<RR?this.object.lookAt(this.target):(Lv.setFromNormalAndCoplanarPoint(this.object.up,this.target),au.intersectPlane(Lv,this.target))))}else if(this.object.isOrthographicCamera){const h=this.object.zoom;this.object.zoom=Math.max(this.minZoom,Math.min(this.maxZoom,this.object.zoom/this._scale)),h!==this.object.zoom&&(this.object.updateProjectionMatrix(),c=!0)}return this._scale=1,this._performCursorZoom=!1,c||this._lastPosition.distanceToSquared(this.object.position)>vd||8*(1-this._lastQuaternion.dot(this.object.quaternion))>vd||this._lastTargetPosition.distanceToSquared(this.target)>vd?(this.dispatchEvent(Uv),this._lastPosition.copy(this.object.position),this._lastQuaternion.copy(this.object.quaternion),this._lastTargetPosition.copy(this.target),!0):!1}_getAutoRotationAngle(t){return t!==null?ei/60*this.autoRotateSpeed*t:ei/60/60*this.autoRotateSpeed}_getZoomScale(t){const i=Math.abs(t*.01);return Math.pow(.95,this.zoomSpeed*i)}_rotateLeft(t){this._sphericalDelta.theta-=t}_rotateUp(t){this._sphericalDelta.phi-=t}_panLeft(t,i){vn.setFromMatrixColumn(i,0),vn.multiplyScalar(-t),this._panOffset.add(vn)}_panUp(t,i){this.screenSpacePanning===!0?vn.setFromMatrixColumn(i,1):(vn.setFromMatrixColumn(i,0),vn.crossVectors(this.object.up,vn)),vn.multiplyScalar(t),this._panOffset.add(vn)}_pan(t,i){const s=this.domElement;if(this.object.isPerspectiveCamera){const l=this.object.position;vn.copy(l).sub(this.target);let c=vn.length();c*=Math.tan(this.object.fov/2*Math.PI/180),this._panLeft(2*t*c/s.clientHeight,this.object.matrix),this._panUp(2*i*c/s.clientHeight,this.object.matrix)}else this.object.isOrthographicCamera?(this._panLeft(t*(this.object.right-this.object.left)/this.object.zoom/s.clientWidth,this.object.matrix),this._panUp(i*(this.object.top-this.object.bottom)/this.object.zoom/s.clientHeight,this.object.matrix)):(console.warn("WARNING: OrbitControls.js encountered an unknown camera type - pan disabled."),this.enablePan=!1)}_dollyOut(t){this.object.isPerspectiveCamera||this.object.isOrthographicCamera?this._scale/=t:(console.warn("WARNING: OrbitControls.js encountered an unknown camera type - dolly/zoom disabled."),this.enableZoom=!1)}_dollyIn(t){this.object.isPerspectiveCamera||this.object.isOrthographicCamera?this._scale*=t:(console.warn("WARNING: OrbitControls.js encountered an unknown camera type - dolly/zoom disabled."),this.enableZoom=!1)}_updateZoomParameters(t,i){if(!this.zoomToCursor)return;this._performCursorZoom=!0;const s=this.domElement.getBoundingClientRect(),l=t-s.left,c=i-s.top,h=s.width,d=s.height;this._mouse.x=l/h*2-1,this._mouse.y=-(c/d)*2+1,this._dollyDirection.set(this._mouse.x,this._mouse.y,1).unproject(this.object).sub(this.object.position).normalize()}_clampDistance(t){return Math.max(this.minDistance,Math.min(this.maxDistance,t))}_handleMouseDownRotate(t){this._rotateStart.set(t.clientX,t.clientY)}_handleMouseDownDolly(t){this._updateZoomParameters(t.clientX,t.clientX),this._dollyStart.set(t.clientX,t.clientY)}_handleMouseDownPan(t){this._panStart.set(t.clientX,t.clientY)}_handleMouseMoveRotate(t){this._rotateEnd.set(t.clientX,t.clientY),this._rotateDelta.subVectors(this._rotateEnd,this._rotateStart).multiplyScalar(this.rotateSpeed);const i=this.domElement;this._rotateLeft(ei*this._rotateDelta.x/i.clientHeight),this._rotateUp(ei*this._rotateDelta.y/i.clientHeight),this._rotateStart.copy(this._rotateEnd),this.update()}_handleMouseMoveDolly(t){this._dollyEnd.set(t.clientX,t.clientY),this._dollyDelta.subVectors(this._dollyEnd,this._dollyStart),this._dollyDelta.y>0?this._dollyOut(this._getZoomScale(this._dollyDelta.y)):this._dollyDelta.y<0&&this._dollyIn(this._getZoomScale(this._dollyDelta.y)),this._dollyStart.copy(this._dollyEnd),this.update()}_handleMouseMovePan(t){this._panEnd.set(t.clientX,t.clientY),this._panDelta.subVectors(this._panEnd,this._panStart).multiplyScalar(this.panSpeed),this._pan(this._panDelta.x,this._panDelta.y),this._panStart.copy(this._panEnd),this.update()}_handleMouseWheel(t){this._updateZoomParameters(t.clientX,t.clientY),t.deltaY<0?this._dollyIn(this._getZoomScale(t.deltaY)):t.deltaY>0&&this._dollyOut(this._getZoomScale(t.deltaY)),this.update()}_handleKeyDown(t){let i=!1;switch(t.code){case this.keys.UP:t.ctrlKey||t.metaKey||t.shiftKey?this.enableRotate&&this._rotateUp(ei*this.keyRotateSpeed/this.domElement.clientHeight):this.enablePan&&this._pan(0,this.keyPanSpeed),i=!0;break;case this.keys.BOTTOM:t.ctrlKey||t.metaKey||t.shiftKey?this.enableRotate&&this._rotateUp(-ei*this.keyRotateSpeed/this.domElement.clientHeight):this.enablePan&&this._pan(0,-this.keyPanSpeed),i=!0;break;case this.keys.LEFT:t.ctrlKey||t.metaKey||t.shiftKey?this.enableRotate&&this._rotateLeft(ei*this.keyRotateSpeed/this.domElement.clientHeight):this.enablePan&&this._pan(this.keyPanSpeed,0),i=!0;break;case this.keys.RIGHT:t.ctrlKey||t.metaKey||t.shiftKey?this.enableRotate&&this._rotateLeft(-ei*this.keyRotateSpeed/this.domElement.clientHeight):this.enablePan&&this._pan(-this.keyPanSpeed,0),i=!0;break}i&&(t.preventDefault(),this.update())}_handleTouchStartRotate(t){if(this._pointers.length===1)this._rotateStart.set(t.pageX,t.pageY);else{const i=this._getSecondPointerPosition(t),s=.5*(t.pageX+i.x),l=.5*(t.pageY+i.y);this._rotateStart.set(s,l)}}_handleTouchStartPan(t){if(this._pointers.length===1)this._panStart.set(t.pageX,t.pageY);else{const i=this._getSecondPointerPosition(t),s=.5*(t.pageX+i.x),l=.5*(t.pageY+i.y);this._panStart.set(s,l)}}_handleTouchStartDolly(t){const i=this._getSecondPointerPosition(t),s=t.pageX-i.x,l=t.pageY-i.y,c=Math.sqrt(s*s+l*l);this._dollyStart.set(0,c)}_handleTouchStartDollyPan(t){this.enableZoom&&this._handleTouchStartDolly(t),this.enablePan&&this._handleTouchStartPan(t)}_handleTouchStartDollyRotate(t){this.enableZoom&&this._handleTouchStartDolly(t),this.enableRotate&&this._handleTouchStartRotate(t)}_handleTouchMoveRotate(t){if(this._pointers.length==1)this._rotateEnd.set(t.pageX,t.pageY);else{const s=this._getSecondPointerPosition(t),l=.5*(t.pageX+s.x),c=.5*(t.pageY+s.y);this._rotateEnd.set(l,c)}this._rotateDelta.subVectors(this._rotateEnd,this._rotateStart).multiplyScalar(this.rotateSpeed);const i=this.domElement;this._rotateLeft(ei*this._rotateDelta.x/i.clientHeight),this._rotateUp(ei*this._rotateDelta.y/i.clientHeight),this._rotateStart.copy(this._rotateEnd)}_handleTouchMovePan(t){if(this._pointers.length===1)this._panEnd.set(t.pageX,t.pageY);else{const i=this._getSecondPointerPosition(t),s=.5*(t.pageX+i.x),l=.5*(t.pageY+i.y);this._panEnd.set(s,l)}this._panDelta.subVectors(this._panEnd,this._panStart).multiplyScalar(this.panSpeed),this._pan(this._panDelta.x,this._panDelta.y),this._panStart.copy(this._panEnd)}_handleTouchMoveDolly(t){const i=this._getSecondPointerPosition(t),s=t.pageX-i.x,l=t.pageY-i.y,c=Math.sqrt(s*s+l*l);this._dollyEnd.set(0,c),this._dollyDelta.set(0,Math.pow(this._dollyEnd.y/this._dollyStart.y,this.zoomSpeed)),this._dollyOut(this._dollyDelta.y),this._dollyStart.copy(this._dollyEnd);const h=(t.pageX+i.x)*.5,d=(t.pageY+i.y)*.5;this._updateZoomParameters(h,d)}_handleTouchMoveDollyPan(t){this.enableZoom&&this._handleTouchMoveDolly(t),this.enablePan&&this._handleTouchMovePan(t)}_handleTouchMoveDollyRotate(t){this.enableZoom&&this._handleTouchMoveDolly(t),this.enableRotate&&this._handleTouchMoveRotate(t)}_addPointer(t){this._pointers.push(t.pointerId)}_removePointer(t){delete this._pointerPositions[t.pointerId];for(let i=0;i<this._pointers.length;i++)if(this._pointers[i]==t.pointerId){this._pointers.splice(i,1);return}}_isTrackingPointer(t){for(let i=0;i<this._pointers.length;i++)if(this._pointers[i]==t.pointerId)return!0;return!1}_trackPointer(t){let i=this._pointerPositions[t.pointerId];i===void 0&&(i=new le,this._pointerPositions[t.pointerId]=i),i.set(t.pageX,t.pageY)}_getSecondPointerPosition(t){const i=t.pointerId===this._pointers[0]?this._pointers[1]:this._pointers[0];return this._pointerPositions[i]}_customWheelEvent(t){const i=t.deltaMode,s={clientX:t.clientX,clientY:t.clientY,deltaY:t.deltaY};switch(i){case 1:s.deltaY*=16;break;case 2:s.deltaY*=100;break}return t.ctrlKey&&!this._controlActive&&(s.deltaY*=10),s}}function wR(r){this.enabled!==!1&&(this._pointers.length===0&&(this.domElement.setPointerCapture(r.pointerId),this.domElement.ownerDocument.addEventListener("pointermove",this._onPointerMove),this.domElement.ownerDocument.addEventListener("pointerup",this._onPointerUp)),!this._isTrackingPointer(r)&&(this._addPointer(r),r.pointerType==="touch"?this._onTouchStart(r):this._onMouseDown(r),this._cursorStyle==="grab"&&(this.domElement.style.cursor="grabbing")))}function DR(r){this.enabled!==!1&&(r.pointerType==="touch"?this._onTouchMove(r):this._onMouseMove(r))}function UR(r){switch(this._removePointer(r),this._pointers.length){case 0:this.domElement.releasePointerCapture(r.pointerId),this.domElement.ownerDocument.removeEventListener("pointermove",this._onPointerMove),this.domElement.ownerDocument.removeEventListener("pointerup",this._onPointerUp),this.dispatchEvent(Ex),this.state=ke.NONE,this._cursorStyle==="grab"&&(this.domElement.style.cursor="grab");break;case 1:const t=this._pointers[0],i=this._pointerPositions[t];this._onTouchStart({pointerId:t,pageX:i.x,pageY:i.y});break}}function LR(r){let t;switch(r.button){case 0:t=this.mouseButtons.LEFT;break;case 1:t=this.mouseButtons.MIDDLE;break;case 2:t=this.mouseButtons.RIGHT;break;default:t=-1}switch(t){case Jr.DOLLY:if(this.enableZoom===!1)return;this._handleMouseDownDolly(r),this.state=ke.DOLLY;break;case Jr.ROTATE:if(r.ctrlKey||r.metaKey||r.shiftKey){if(this.enablePan===!1)return;this._handleMouseDownPan(r),this.state=ke.PAN}else{if(this.enableRotate===!1)return;this._handleMouseDownRotate(r),this.state=ke.ROTATE}break;case Jr.PAN:if(r.ctrlKey||r.metaKey||r.shiftKey){if(this.enableRotate===!1)return;this._handleMouseDownRotate(r),this.state=ke.ROTATE}else{if(this.enablePan===!1)return;this._handleMouseDownPan(r),this.state=ke.PAN}break;default:this.state=ke.NONE}this.state!==ke.NONE&&this.dispatchEvent(zp)}function NR(r){switch(this.state){case ke.ROTATE:if(this.enableRotate===!1)return;this._handleMouseMoveRotate(r);break;case ke.DOLLY:if(this.enableZoom===!1)return;this._handleMouseMoveDolly(r);break;case ke.PAN:if(this.enablePan===!1)return;this._handleMouseMovePan(r);break}}function OR(r){this.enabled===!1||this.enableZoom===!1||this.state!==ke.NONE||(r.preventDefault(),this.dispatchEvent(zp),this._handleMouseWheel(this._customWheelEvent(r)),this.dispatchEvent(Ex))}function PR(r){this.enabled!==!1&&this._handleKeyDown(r)}function zR(r){switch(this._trackPointer(r),this._pointers.length){case 1:switch(this.touches.ONE){case Qr.ROTATE:if(this.enableRotate===!1)return;this._handleTouchStartRotate(r),this.state=ke.TOUCH_ROTATE;break;case Qr.PAN:if(this.enablePan===!1)return;this._handleTouchStartPan(r),this.state=ke.TOUCH_PAN;break;default:this.state=ke.NONE}break;case 2:switch(this.touches.TWO){case Qr.DOLLY_PAN:if(this.enableZoom===!1&&this.enablePan===!1)return;this._handleTouchStartDollyPan(r),this.state=ke.TOUCH_DOLLY_PAN;break;case Qr.DOLLY_ROTATE:if(this.enableZoom===!1&&this.enableRotate===!1)return;this._handleTouchStartDollyRotate(r),this.state=ke.TOUCH_DOLLY_ROTATE;break;default:this.state=ke.NONE}break;default:this.state=ke.NONE}this.state!==ke.NONE&&this.dispatchEvent(zp)}function IR(r){switch(this._trackPointer(r),this.state){case ke.TOUCH_ROTATE:if(this.enableRotate===!1)return;this._handleTouchMoveRotate(r),this.update();break;case ke.TOUCH_PAN:if(this.enablePan===!1)return;this._handleTouchMovePan(r),this.update();break;case ke.TOUCH_DOLLY_PAN:if(this.enableZoom===!1&&this.enablePan===!1)return;this._handleTouchMoveDollyPan(r),this.update();break;case ke.TOUCH_DOLLY_ROTATE:if(this.enableZoom===!1&&this.enableRotate===!1)return;this._handleTouchMoveDollyRotate(r),this.update();break;default:this.state=ke.NONE}}function FR(r){this.enabled!==!1&&r.preventDefault()}function BR(r){r.key==="Control"&&(this._controlActive=!0,this.domElement.getRootNode().addEventListener("keyup",this._interceptControlUp,{passive:!0,capture:!0}))}function HR(r){r.key==="Control"&&(this._controlActive=!1,this.domElement.getRootNode().removeEventListener("keyup",this._interceptControlUp,{passive:!0,capture:!0}))}const Nv=new ys,su=new j;class bx extends AE{constructor(){super(),this.isLineSegmentsGeometry=!0,this.type="LineSegmentsGeometry";const t=[-1,2,0,1,2,0,-1,1,0,1,1,0,-1,0,0,1,0,0,-1,-1,0,1,-1,0],i=[-1,2,1,2,-1,1,1,1,-1,-1,1,-1,-1,-2,1,-2],s=[0,2,1,2,3,1,2,4,3,4,5,3,4,6,5,6,7,5];this.setIndex(s),this.setAttribute("position",new Tn(t,3)),this.setAttribute("uv",new Tn(i,2))}applyMatrix4(t){const i=this.attributes.instanceStart,s=this.attributes.instanceEnd;return i!==void 0&&(i.applyMatrix4(t),s.applyMatrix4(t),i.needsUpdate=!0),this.boundingBox!==null&&this.computeBoundingBox(),this.boundingSphere!==null&&this.computeBoundingSphere(),this}setPositions(t){let i;t instanceof Float32Array?i=t:Array.isArray(t)&&(i=new Float32Array(t));const s=new hp(i,6,1);return this.setAttribute("instanceStart",new _s(s,3,0)),this.setAttribute("instanceEnd",new _s(s,3,3)),this.instanceCount=this.attributes.instanceStart.count,this.computeBoundingBox(),this.computeBoundingSphere(),this}setColors(t){let i;t instanceof Float32Array?i=t:Array.isArray(t)&&(i=new Float32Array(t));const s=new hp(i,6,1);return this.setAttribute("instanceColorStart",new _s(s,3,0)),this.setAttribute("instanceColorEnd",new _s(s,3,3)),this}fromWireframeGeometry(t){return this.setPositions(t.attributes.position.array),this}fromEdgesGeometry(t){return this.setPositions(t.attributes.position.array),this}fromMesh(t){return this.fromWireframeGeometry(new pE(t.geometry)),this}fromLineSegments(t){const i=t.geometry;return this.setPositions(i.attributes.position.array),this}computeBoundingBox(){this.boundingBox===null&&(this.boundingBox=new ys);const t=this.attributes.instanceStart,i=this.attributes.instanceEnd;t!==void 0&&i!==void 0&&(this.boundingBox.setFromBufferAttribute(t),Nv.setFromBufferAttribute(i),this.boundingBox.union(Nv))}computeBoundingSphere(){this.boundingSphere===null&&(this.boundingSphere=new ro),this.boundingBox===null&&this.computeBoundingBox();const t=this.attributes.instanceStart,i=this.attributes.instanceEnd;if(t!==void 0&&i!==void 0){const s=this.boundingSphere.center;this.boundingBox.getCenter(s);let l=0;for(let c=0,h=t.count;c<h;c++)su.fromBufferAttribute(t,c),l=Math.max(l,s.distanceToSquared(su)),su.fromBufferAttribute(i,c),l=Math.max(l,s.distanceToSquared(su));this.boundingSphere.radius=Math.sqrt(l),isNaN(this.boundingSphere.radius)&&console.error("THREE.LineSegmentsGeometry.computeBoundingSphere(): Computed radius is NaN. The instanced position data is likely to have NaN values.",this)}}toJSON(){}}Lt.line={worldUnits:{value:1},linewidth:{value:1},resolution:{value:new le(1,1)},dashOffset:{value:0},dashScale:{value:1},dashSize:{value:1},gapSize:{value:1}};ni.line={uniforms:Pp.merge([Lt.common,Lt.fog,Lt.line]),vertexShader:`
4057
+ }`;class MR{constructor(){this.texture=null,this.mesh=null,this.depthNear=0,this.depthFar=0}init(t,i){if(this.texture===null){const s=new px(t.texture);(t.depthNear!==i.depthNear||t.depthFar!==i.depthFar)&&(this.depthNear=t.depthNear,this.depthFar=t.depthFar),this.texture=s}}getMesh(t){if(this.texture!==null&&this.mesh===null){const i=t.cameras[0].viewport,s=new ki({vertexShader:SR,fragmentShader:yR,uniforms:{depthColor:{value:this.texture},depthWidth:{value:i.z},depthHeight:{value:i.w}}});this.mesh=new mi(new Au(20,20),s)}return this.mesh}reset(){this.texture=null,this.mesh=null}getDepthTexture(){return this.texture}}class ER extends $s{constructor(t,i){super();const s=this;let l=null,c=1,h=null,d="local-floor",m=1,p=null,v=null,g=null,_=null,M=null,E=null;const A=typeof XRWebGLBinding<"u",y=new MR,S={},w=i.getContextAttributes();let D=null,U=null;const H=[],F=[],I=new le;let T=null;const L=new Fi;L.viewport=new We;const Q=new Fi;Q.viewport=new We;const P=[L,Q],W=new UE;let J=null,rt=null;this.cameraAutoUpdate=!0,this.enabled=!1,this.isPresenting=!1,this.getController=function(Z){let dt=H[Z];return dt===void 0&&(dt=new jh,H[Z]=dt),dt.getTargetRaySpace()},this.getControllerGrip=function(Z){let dt=H[Z];return dt===void 0&&(dt=new jh,H[Z]=dt),dt.getGripSpace()},this.getHand=function(Z){let dt=H[Z];return dt===void 0&&(dt=new jh,H[Z]=dt),dt.getHandSpace()};function et(Z){const dt=F.indexOf(Z.inputSource);if(dt===-1)return;const yt=H[dt];yt!==void 0&&(yt.update(Z.inputSource,Z.frame,p||h),yt.dispatchEvent({type:Z.type,data:Z.inputSource}))}function O(){l.removeEventListener("select",et),l.removeEventListener("selectstart",et),l.removeEventListener("selectend",et),l.removeEventListener("squeeze",et),l.removeEventListener("squeezestart",et),l.removeEventListener("squeezeend",et),l.removeEventListener("end",O),l.removeEventListener("inputsourceschange",B);for(let Z=0;Z<H.length;Z++){const dt=F[Z];dt!==null&&(F[Z]=null,H[Z].disconnect(dt))}J=null,rt=null,y.reset();for(const Z in S)delete S[Z];t.setRenderTarget(D),M=null,_=null,g=null,l=null,U=null,Rt.stop(),s.isPresenting=!1,t.setPixelRatio(T),t.setSize(I.width,I.height,!1),s.dispatchEvent({type:"sessionend"})}this.setFramebufferScaleFactor=function(Z){c=Z,s.isPresenting===!0&&ee("WebXRManager: Cannot change framebuffer scale while presenting.")},this.setReferenceSpaceType=function(Z){d=Z,s.isPresenting===!0&&ee("WebXRManager: Cannot change reference space type while presenting.")},this.getReferenceSpace=function(){return p||h},this.setReferenceSpace=function(Z){p=Z},this.getBaseLayer=function(){return _!==null?_:M},this.getBinding=function(){return g===null&&A&&(g=new XRWebGLBinding(l,i)),g},this.getFrame=function(){return E},this.getSession=function(){return l},this.setSession=async function(Z){if(l=Z,l!==null){if(D=t.getRenderTarget(),l.addEventListener("select",et),l.addEventListener("selectstart",et),l.addEventListener("selectend",et),l.addEventListener("squeeze",et),l.addEventListener("squeezestart",et),l.addEventListener("squeezeend",et),l.addEventListener("end",O),l.addEventListener("inputsourceschange",B),w.xrCompatible!==!0&&await i.makeXRCompatible(),T=t.getPixelRatio(),t.getSize(I),A&&"createProjectionLayer"in XRWebGLBinding.prototype){let yt=null,Ut=null,Ft=null;w.depth&&(Ft=w.stencil?i.DEPTH24_STENCIL8:i.DEPTH_COMPONENT24,yt=w.stencil?Ks:za,Ut=w.stencil?ml:aa);const Xt={colorFormat:i.RGBA8,depthFormat:Ft,scaleFactor:c};g=this.getBinding(),_=g.createProjectionLayer(Xt),l.updateRenderState({layers:[_]}),t.setPixelRatio(1),t.setSize(_.textureWidth,_.textureHeight,!1),U=new ia(_.textureWidth,_.textureHeight,{format:Vi,type:di,depthTexture:new xl(_.textureWidth,_.textureHeight,Ut,void 0,void 0,void 0,void 0,void 0,void 0,yt),stencilBuffer:w.stencil,colorSpace:t.outputColorSpace,samples:w.antialias?4:0,resolveDepthBuffer:_.ignoreDepthValues===!1,resolveStencilBuffer:_.ignoreDepthValues===!1})}else{const yt={antialias:w.antialias,alpha:!0,depth:w.depth,stencil:w.stencil,framebufferScaleFactor:c};M=new XRWebGLLayer(l,i,yt),l.updateRenderState({baseLayer:M}),t.setPixelRatio(1),t.setSize(M.framebufferWidth,M.framebufferHeight,!1),U=new ia(M.framebufferWidth,M.framebufferHeight,{format:Vi,type:di,colorSpace:t.outputColorSpace,stencilBuffer:w.stencil,resolveDepthBuffer:M.ignoreDepthValues===!1,resolveStencilBuffer:M.ignoreDepthValues===!1})}U.isXRRenderTarget=!0,this.setFoveation(m),p=null,h=await l.requestReferenceSpace(d),Rt.setContext(l),Rt.start(),s.isPresenting=!0,s.dispatchEvent({type:"sessionstart"})}},this.getEnvironmentBlendMode=function(){if(l!==null)return l.environmentBlendMode},this.getDepthTexture=function(){return y.getDepthTexture()};function B(Z){for(let dt=0;dt<Z.removed.length;dt++){const yt=Z.removed[dt],Ut=F.indexOf(yt);Ut>=0&&(F[Ut]=null,H[Ut].disconnect(yt))}for(let dt=0;dt<Z.added.length;dt++){const yt=Z.added[dt];let Ut=F.indexOf(yt);if(Ut===-1){for(let Xt=0;Xt<H.length;Xt++)if(Xt>=F.length){F.push(yt),Ut=Xt;break}else if(F[Xt]===null){F[Xt]=yt,Ut=Xt;break}if(Ut===-1)break}const Ft=H[Ut];Ft&&Ft.connect(yt)}}const at=new j,$=new j;function lt(Z,dt,yt){at.setFromMatrixPosition(dt.matrixWorld),$.setFromMatrixPosition(yt.matrixWorld);const Ut=at.distanceTo($),Ft=dt.projectionMatrix.elements,Xt=yt.projectionMatrix.elements,ge=Ft[14]/(Ft[10]-1),Jt=Ft[14]/(Ft[10]+1),_e=(Ft[9]+1)/Ft[5],Te=(Ft[9]-1)/Ft[5],ae=(Ft[8]-1)/Ft[0],$e=(Xt[8]+1)/Xt[0],V=ge*ae,je=ge*$e,be=Ut/(-ae+$e),Ne=be*-ae;if(dt.matrixWorld.decompose(Z.position,Z.quaternion,Z.scale),Z.translateX(Ne),Z.translateZ(be),Z.matrixWorld.compose(Z.position,Z.quaternion,Z.scale),Z.matrixWorldInverse.copy(Z.matrixWorld).invert(),Ft[10]===-1)Z.projectionMatrix.copy(dt.projectionMatrix),Z.projectionMatrixInverse.copy(dt.projectionMatrixInverse);else{const Yt=ge+be,z=Jt+be,b=V-Ne,K=je+(Ut-Ne),_t=_e*Jt/z*Yt,Mt=Te*Jt/z*Yt;Z.projectionMatrix.makePerspective(b,K,_t,Mt,Yt,z),Z.projectionMatrixInverse.copy(Z.projectionMatrix).invert()}}function N(Z,dt){dt===null?Z.matrixWorld.copy(Z.matrix):Z.matrixWorld.multiplyMatrices(dt.matrixWorld,Z.matrix),Z.matrixWorldInverse.copy(Z.matrixWorld).invert()}this.updateCamera=function(Z){if(l===null)return;let dt=Z.near,yt=Z.far;y.texture!==null&&(y.depthNear>0&&(dt=y.depthNear),y.depthFar>0&&(yt=y.depthFar)),W.near=Q.near=L.near=dt,W.far=Q.far=L.far=yt,(J!==W.near||rt!==W.far)&&(l.updateRenderState({depthNear:W.near,depthFar:W.far}),J=W.near,rt=W.far),W.layers.mask=Z.layers.mask|6,L.layers.mask=W.layers.mask&-5,Q.layers.mask=W.layers.mask&-3;const Ut=Z.parent,Ft=W.cameras;N(W,Ut);for(let Xt=0;Xt<Ft.length;Xt++)N(Ft[Xt],Ut);Ft.length===2?lt(W,L,Q):W.projectionMatrix.copy(L.projectionMatrix),k(Z,W,Ut)};function k(Z,dt,yt){yt===null?Z.matrix.copy(dt.matrixWorld):(Z.matrix.copy(yt.matrixWorld),Z.matrix.invert(),Z.matrix.multiply(dt.matrixWorld)),Z.matrix.decompose(Z.position,Z.quaternion,Z.scale),Z.updateMatrixWorld(!0),Z.projectionMatrix.copy(dt.projectionMatrix),Z.projectionMatrixInverse.copy(dt.projectionMatrixInverse),Z.isPerspectiveCamera&&(Z.fov=_l*2*Math.atan(1/Z.projectionMatrix.elements[5]),Z.zoom=1)}this.getCamera=function(){return W},this.getFoveation=function(){if(!(_===null&&M===null))return m},this.setFoveation=function(Z){m=Z,_!==null&&(_.fixedFoveation=Z),M!==null&&M.fixedFoveation!==void 0&&(M.fixedFoveation=Z)},this.hasDepthSensing=function(){return y.texture!==null},this.getDepthSensingMesh=function(){return y.getMesh(W)},this.getCameraTexture=function(Z){return S[Z]};let ut=null;function vt(Z,dt){if(v=dt.getViewerPose(p||h),E=dt,v!==null){const yt=v.views;M!==null&&(t.setRenderTargetFramebuffer(U,M.framebuffer),t.setRenderTarget(U));let Ut=!1;yt.length!==W.cameras.length&&(W.cameras.length=0,Ut=!0);for(let Jt=0;Jt<yt.length;Jt++){const _e=yt[Jt];let Te=null;if(M!==null)Te=M.getViewport(_e);else{const $e=g.getViewSubImage(_,_e);Te=$e.viewport,Jt===0&&(t.setRenderTargetTextures(U,$e.colorTexture,$e.depthStencilTexture),t.setRenderTarget(U))}let ae=P[Jt];ae===void 0&&(ae=new Fi,ae.layers.enable(Jt),ae.viewport=new We,P[Jt]=ae),ae.matrix.fromArray(_e.transform.matrix),ae.matrix.decompose(ae.position,ae.quaternion,ae.scale),ae.projectionMatrix.fromArray(_e.projectionMatrix),ae.projectionMatrixInverse.copy(ae.projectionMatrix).invert(),ae.viewport.set(Te.x,Te.y,Te.width,Te.height),Jt===0&&(W.matrix.copy(ae.matrix),W.matrix.decompose(W.position,W.quaternion,W.scale)),Ut===!0&&W.cameras.push(ae)}const Ft=l.enabledFeatures;if(Ft&&Ft.includes("depth-sensing")&&l.depthUsage=="gpu-optimized"&&A){g=s.getBinding();const Jt=g.getDepthInformation(yt[0]);Jt&&Jt.isValid&&Jt.texture&&y.init(Jt,l.renderState)}if(Ft&&Ft.includes("camera-access")&&A){t.state.unbindTexture(),g=s.getBinding();for(let Jt=0;Jt<yt.length;Jt++){const _e=yt[Jt].camera;if(_e){let Te=S[_e];Te||(Te=new px,S[_e]=Te);const ae=g.getCameraImage(_e);Te.sourceTexture=ae}}}}for(let yt=0;yt<H.length;yt++){const Ut=F[yt],Ft=H[yt];Ut!==null&&Ft!==void 0&&Ft.update(Ut,dt,p||h)}ut&&ut(Z,dt),dt.detectedPlanes&&s.dispatchEvent({type:"planesdetected",data:dt}),E=null}const Rt=new vx;Rt.setAnimationLoop(vt),this.setAnimationLoop=function(Z){ut=Z},this.dispose=function(){}}}const Ws=new sa,bR=new Je;function TR(r,t){function i(y,S){y.matrixAutoUpdate===!0&&y.updateMatrix(),S.value.copy(y.matrix)}function s(y,S){S.color.getRGB(y.fogColor.value,mx(r)),S.isFog?(y.fogNear.value=S.near,y.fogFar.value=S.far):S.isFogExp2&&(y.fogDensity.value=S.density)}function l(y,S,w,D,U){S.isMeshBasicMaterial?c(y,S):S.isMeshLambertMaterial?(c(y,S),S.envMap&&(y.envMapIntensity.value=S.envMapIntensity)):S.isMeshToonMaterial?(c(y,S),g(y,S)):S.isMeshPhongMaterial?(c(y,S),v(y,S),S.envMap&&(y.envMapIntensity.value=S.envMapIntensity)):S.isMeshStandardMaterial?(c(y,S),_(y,S),S.isMeshPhysicalMaterial&&M(y,S,U)):S.isMeshMatcapMaterial?(c(y,S),E(y,S)):S.isMeshDepthMaterial?c(y,S):S.isMeshDistanceMaterial?(c(y,S),A(y,S)):S.isMeshNormalMaterial?c(y,S):S.isLineBasicMaterial?(h(y,S),S.isLineDashedMaterial&&d(y,S)):S.isPointsMaterial?m(y,S,w,D):S.isSpriteMaterial?p(y,S):S.isShadowMaterial?(y.color.value.copy(S.color),y.opacity.value=S.opacity):S.isShaderMaterial&&(S.uniformsNeedUpdate=!1)}function c(y,S){y.opacity.value=S.opacity,S.color&&y.diffuse.value.copy(S.color),S.emissive&&y.emissive.value.copy(S.emissive).multiplyScalar(S.emissiveIntensity),S.map&&(y.map.value=S.map,i(S.map,y.mapTransform)),S.alphaMap&&(y.alphaMap.value=S.alphaMap,i(S.alphaMap,y.alphaMapTransform)),S.bumpMap&&(y.bumpMap.value=S.bumpMap,i(S.bumpMap,y.bumpMapTransform),y.bumpScale.value=S.bumpScale,S.side===ti&&(y.bumpScale.value*=-1)),S.normalMap&&(y.normalMap.value=S.normalMap,i(S.normalMap,y.normalMapTransform),y.normalScale.value.copy(S.normalScale),S.side===ti&&y.normalScale.value.negate()),S.displacementMap&&(y.displacementMap.value=S.displacementMap,i(S.displacementMap,y.displacementMapTransform),y.displacementScale.value=S.displacementScale,y.displacementBias.value=S.displacementBias),S.emissiveMap&&(y.emissiveMap.value=S.emissiveMap,i(S.emissiveMap,y.emissiveMapTransform)),S.specularMap&&(y.specularMap.value=S.specularMap,i(S.specularMap,y.specularMapTransform)),S.alphaTest>0&&(y.alphaTest.value=S.alphaTest);const w=t.get(S),D=w.envMap,U=w.envMapRotation;D&&(y.envMap.value=D,Ws.copy(U),Ws.x*=-1,Ws.y*=-1,Ws.z*=-1,D.isCubeTexture&&D.isRenderTargetTexture===!1&&(Ws.y*=-1,Ws.z*=-1),y.envMapRotation.value.setFromMatrix4(bR.makeRotationFromEuler(Ws)),y.flipEnvMap.value=D.isCubeTexture&&D.isRenderTargetTexture===!1?-1:1,y.reflectivity.value=S.reflectivity,y.ior.value=S.ior,y.refractionRatio.value=S.refractionRatio),S.lightMap&&(y.lightMap.value=S.lightMap,y.lightMapIntensity.value=S.lightMapIntensity,i(S.lightMap,y.lightMapTransform)),S.aoMap&&(y.aoMap.value=S.aoMap,y.aoMapIntensity.value=S.aoMapIntensity,i(S.aoMap,y.aoMapTransform))}function h(y,S){y.diffuse.value.copy(S.color),y.opacity.value=S.opacity,S.map&&(y.map.value=S.map,i(S.map,y.mapTransform))}function d(y,S){y.dashSize.value=S.dashSize,y.totalSize.value=S.dashSize+S.gapSize,y.scale.value=S.scale}function m(y,S,w,D){y.diffuse.value.copy(S.color),y.opacity.value=S.opacity,y.size.value=S.size*w,y.scale.value=D*.5,S.map&&(y.map.value=S.map,i(S.map,y.uvTransform)),S.alphaMap&&(y.alphaMap.value=S.alphaMap,i(S.alphaMap,y.alphaMapTransform)),S.alphaTest>0&&(y.alphaTest.value=S.alphaTest)}function p(y,S){y.diffuse.value.copy(S.color),y.opacity.value=S.opacity,y.rotation.value=S.rotation,S.map&&(y.map.value=S.map,i(S.map,y.mapTransform)),S.alphaMap&&(y.alphaMap.value=S.alphaMap,i(S.alphaMap,y.alphaMapTransform)),S.alphaTest>0&&(y.alphaTest.value=S.alphaTest)}function v(y,S){y.specular.value.copy(S.specular),y.shininess.value=Math.max(S.shininess,1e-4)}function g(y,S){S.gradientMap&&(y.gradientMap.value=S.gradientMap)}function _(y,S){y.metalness.value=S.metalness,S.metalnessMap&&(y.metalnessMap.value=S.metalnessMap,i(S.metalnessMap,y.metalnessMapTransform)),y.roughness.value=S.roughness,S.roughnessMap&&(y.roughnessMap.value=S.roughnessMap,i(S.roughnessMap,y.roughnessMapTransform)),S.envMap&&(y.envMapIntensity.value=S.envMapIntensity)}function M(y,S,w){y.ior.value=S.ior,S.sheen>0&&(y.sheenColor.value.copy(S.sheenColor).multiplyScalar(S.sheen),y.sheenRoughness.value=S.sheenRoughness,S.sheenColorMap&&(y.sheenColorMap.value=S.sheenColorMap,i(S.sheenColorMap,y.sheenColorMapTransform)),S.sheenRoughnessMap&&(y.sheenRoughnessMap.value=S.sheenRoughnessMap,i(S.sheenRoughnessMap,y.sheenRoughnessMapTransform))),S.clearcoat>0&&(y.clearcoat.value=S.clearcoat,y.clearcoatRoughness.value=S.clearcoatRoughness,S.clearcoatMap&&(y.clearcoatMap.value=S.clearcoatMap,i(S.clearcoatMap,y.clearcoatMapTransform)),S.clearcoatRoughnessMap&&(y.clearcoatRoughnessMap.value=S.clearcoatRoughnessMap,i(S.clearcoatRoughnessMap,y.clearcoatRoughnessMapTransform)),S.clearcoatNormalMap&&(y.clearcoatNormalMap.value=S.clearcoatNormalMap,i(S.clearcoatNormalMap,y.clearcoatNormalMapTransform),y.clearcoatNormalScale.value.copy(S.clearcoatNormalScale),S.side===ti&&y.clearcoatNormalScale.value.negate())),S.dispersion>0&&(y.dispersion.value=S.dispersion),S.iridescence>0&&(y.iridescence.value=S.iridescence,y.iridescenceIOR.value=S.iridescenceIOR,y.iridescenceThicknessMinimum.value=S.iridescenceThicknessRange[0],y.iridescenceThicknessMaximum.value=S.iridescenceThicknessRange[1],S.iridescenceMap&&(y.iridescenceMap.value=S.iridescenceMap,i(S.iridescenceMap,y.iridescenceMapTransform)),S.iridescenceThicknessMap&&(y.iridescenceThicknessMap.value=S.iridescenceThicknessMap,i(S.iridescenceThicknessMap,y.iridescenceThicknessMapTransform))),S.transmission>0&&(y.transmission.value=S.transmission,y.transmissionSamplerMap.value=w.texture,y.transmissionSamplerSize.value.set(w.width,w.height),S.transmissionMap&&(y.transmissionMap.value=S.transmissionMap,i(S.transmissionMap,y.transmissionMapTransform)),y.thickness.value=S.thickness,S.thicknessMap&&(y.thicknessMap.value=S.thicknessMap,i(S.thicknessMap,y.thicknessMapTransform)),y.attenuationDistance.value=S.attenuationDistance,y.attenuationColor.value.copy(S.attenuationColor)),S.anisotropy>0&&(y.anisotropyVector.value.set(S.anisotropy*Math.cos(S.anisotropyRotation),S.anisotropy*Math.sin(S.anisotropyRotation)),S.anisotropyMap&&(y.anisotropyMap.value=S.anisotropyMap,i(S.anisotropyMap,y.anisotropyMapTransform))),y.specularIntensity.value=S.specularIntensity,y.specularColor.value.copy(S.specularColor),S.specularColorMap&&(y.specularColorMap.value=S.specularColorMap,i(S.specularColorMap,y.specularColorMapTransform)),S.specularIntensityMap&&(y.specularIntensityMap.value=S.specularIntensityMap,i(S.specularIntensityMap,y.specularIntensityMapTransform))}function E(y,S){S.matcap&&(y.matcap.value=S.matcap)}function A(y,S){const w=t.get(S).light;y.referencePosition.value.setFromMatrixPosition(w.matrixWorld),y.nearDistance.value=w.shadow.camera.near,y.farDistance.value=w.shadow.camera.far}return{refreshFogUniforms:s,refreshMaterialUniforms:l}}function AR(r,t,i,s){let l={},c={},h=[];const d=r.getParameter(r.MAX_UNIFORM_BUFFER_BINDINGS);function m(w,D){const U=D.program;s.uniformBlockBinding(w,U)}function p(w,D){let U=l[w.id];U===void 0&&(E(w),U=v(w),l[w.id]=U,w.addEventListener("dispose",y));const H=D.program;s.updateUBOMapping(w,H);const F=t.render.frame;c[w.id]!==F&&(_(w),c[w.id]=F)}function v(w){const D=g();w.__bindingPointIndex=D;const U=r.createBuffer(),H=w.__size,F=w.usage;return r.bindBuffer(r.UNIFORM_BUFFER,U),r.bufferData(r.UNIFORM_BUFFER,H,F),r.bindBuffer(r.UNIFORM_BUFFER,null),r.bindBufferBase(r.UNIFORM_BUFFER,D,U),U}function g(){for(let w=0;w<d;w++)if(h.indexOf(w)===-1)return h.push(w),w;return Ue("WebGLRenderer: Maximum number of simultaneously usable uniforms groups reached."),0}function _(w){const D=l[w.id],U=w.uniforms,H=w.__cache;r.bindBuffer(r.UNIFORM_BUFFER,D);for(let F=0,I=U.length;F<I;F++){const T=Array.isArray(U[F])?U[F]:[U[F]];for(let L=0,Q=T.length;L<Q;L++){const P=T[L];if(M(P,F,L,H)===!0){const W=P.__offset,J=Array.isArray(P.value)?P.value:[P.value];let rt=0;for(let et=0;et<J.length;et++){const O=J[et],B=A(O);typeof O=="number"||typeof O=="boolean"?(P.__data[0]=O,r.bufferSubData(r.UNIFORM_BUFFER,W+rt,P.__data)):O.isMatrix3?(P.__data[0]=O.elements[0],P.__data[1]=O.elements[1],P.__data[2]=O.elements[2],P.__data[3]=0,P.__data[4]=O.elements[3],P.__data[5]=O.elements[4],P.__data[6]=O.elements[5],P.__data[7]=0,P.__data[8]=O.elements[6],P.__data[9]=O.elements[7],P.__data[10]=O.elements[8],P.__data[11]=0):(O.toArray(P.__data,rt),rt+=B.storage/Float32Array.BYTES_PER_ELEMENT)}r.bufferSubData(r.UNIFORM_BUFFER,W,P.__data)}}}r.bindBuffer(r.UNIFORM_BUFFER,null)}function M(w,D,U,H){const F=w.value,I=D+"_"+U;if(H[I]===void 0)return typeof F=="number"||typeof F=="boolean"?H[I]=F:H[I]=F.clone(),!0;{const T=H[I];if(typeof F=="number"||typeof F=="boolean"){if(T!==F)return H[I]=F,!0}else if(T.equals(F)===!1)return T.copy(F),!0}return!1}function E(w){const D=w.uniforms;let U=0;const H=16;for(let I=0,T=D.length;I<T;I++){const L=Array.isArray(D[I])?D[I]:[D[I]];for(let Q=0,P=L.length;Q<P;Q++){const W=L[Q],J=Array.isArray(W.value)?W.value:[W.value];for(let rt=0,et=J.length;rt<et;rt++){const O=J[rt],B=A(O),at=U%H,$=at%B.boundary,lt=at+$;U+=$,lt!==0&&H-lt<B.storage&&(U+=H-lt),W.__data=new Float32Array(B.storage/Float32Array.BYTES_PER_ELEMENT),W.__offset=U,U+=B.storage}}}const F=U%H;return F>0&&(U+=H-F),w.__size=U,w.__cache={},this}function A(w){const D={boundary:0,storage:0};return typeof w=="number"||typeof w=="boolean"?(D.boundary=4,D.storage=4):w.isVector2?(D.boundary=8,D.storage=8):w.isVector3||w.isColor?(D.boundary=16,D.storage=12):w.isVector4?(D.boundary=16,D.storage=16):w.isMatrix3?(D.boundary=48,D.storage=48):w.isMatrix4?(D.boundary=64,D.storage=64):w.isTexture?ee("WebGLRenderer: Texture samplers can not be part of an uniforms group."):ee("WebGLRenderer: Unsupported uniform value type.",w),D}function y(w){const D=w.target;D.removeEventListener("dispose",y);const U=h.indexOf(D.__bindingPointIndex);h.splice(U,1),r.deleteBuffer(l[D.id]),delete l[D.id],delete c[D.id]}function S(){for(const w in l)r.deleteBuffer(l[w]);h=[],l={},c={}}return{bind:m,update:p,dispose:S}}const RR=new Uint16Array([12469,15057,12620,14925,13266,14620,13807,14376,14323,13990,14545,13625,14713,13328,14840,12882,14931,12528,14996,12233,15039,11829,15066,11525,15080,11295,15085,10976,15082,10705,15073,10495,13880,14564,13898,14542,13977,14430,14158,14124,14393,13732,14556,13410,14702,12996,14814,12596,14891,12291,14937,11834,14957,11489,14958,11194,14943,10803,14921,10506,14893,10278,14858,9960,14484,14039,14487,14025,14499,13941,14524,13740,14574,13468,14654,13106,14743,12678,14818,12344,14867,11893,14889,11509,14893,11180,14881,10751,14852,10428,14812,10128,14765,9754,14712,9466,14764,13480,14764,13475,14766,13440,14766,13347,14769,13070,14786,12713,14816,12387,14844,11957,14860,11549,14868,11215,14855,10751,14825,10403,14782,10044,14729,9651,14666,9352,14599,9029,14967,12835,14966,12831,14963,12804,14954,12723,14936,12564,14917,12347,14900,11958,14886,11569,14878,11247,14859,10765,14828,10401,14784,10011,14727,9600,14660,9289,14586,8893,14508,8533,15111,12234,15110,12234,15104,12216,15092,12156,15067,12010,15028,11776,14981,11500,14942,11205,14902,10752,14861,10393,14812,9991,14752,9570,14682,9252,14603,8808,14519,8445,14431,8145,15209,11449,15208,11451,15202,11451,15190,11438,15163,11384,15117,11274,15055,10979,14994,10648,14932,10343,14871,9936,14803,9532,14729,9218,14645,8742,14556,8381,14461,8020,14365,7603,15273,10603,15272,10607,15267,10619,15256,10631,15231,10614,15182,10535,15118,10389,15042,10167,14963,9787,14883,9447,14800,9115,14710,8665,14615,8318,14514,7911,14411,7507,14279,7198,15314,9675,15313,9683,15309,9712,15298,9759,15277,9797,15229,9773,15166,9668,15084,9487,14995,9274,14898,8910,14800,8539,14697,8234,14590,7790,14479,7409,14367,7067,14178,6621,15337,8619,15337,8631,15333,8677,15325,8769,15305,8871,15264,8940,15202,8909,15119,8775,15022,8565,14916,8328,14804,8009,14688,7614,14569,7287,14448,6888,14321,6483,14088,6171,15350,7402,15350,7419,15347,7480,15340,7613,15322,7804,15287,7973,15229,8057,15148,8012,15046,7846,14933,7611,14810,7357,14682,7069,14552,6656,14421,6316,14251,5948,14007,5528,15356,5942,15356,5977,15353,6119,15348,6294,15332,6551,15302,6824,15249,7044,15171,7122,15070,7050,14949,6861,14818,6611,14679,6349,14538,6067,14398,5651,14189,5311,13935,4958,15359,4123,15359,4153,15356,4296,15353,4646,15338,5160,15311,5508,15263,5829,15188,6042,15088,6094,14966,6001,14826,5796,14678,5543,14527,5287,14377,4985,14133,4586,13869,4257,15360,1563,15360,1642,15358,2076,15354,2636,15341,3350,15317,4019,15273,4429,15203,4732,15105,4911,14981,4932,14836,4818,14679,4621,14517,4386,14359,4156,14083,3795,13808,3437,15360,122,15360,137,15358,285,15355,636,15344,1274,15322,2177,15281,2765,15215,3223,15120,3451,14995,3569,14846,3567,14681,3466,14511,3305,14344,3121,14037,2800,13753,2467,15360,0,15360,1,15359,21,15355,89,15346,253,15325,479,15287,796,15225,1148,15133,1492,15008,1749,14856,1882,14685,1886,14506,1783,14324,1608,13996,1398,13702,1183]);let Ki=null;function CR(){return Ki===null&&(Ki=new hE(RR,16,16,so,Pa),Ki.name="DFG_LUT",Ki.minFilter=zn,Ki.magFilter=zn,Ki.wrapS=Ua,Ki.wrapT=Ua,Ki.generateMipmaps=!1,Ki.needsUpdate=!0),Ki}class wR{constructor(t={}){const{canvas:i=RM(),context:s=null,depth:l=!0,stencil:c=!1,alpha:h=!1,antialias:d=!1,premultipliedAlpha:m=!0,preserveDrawingBuffer:p=!1,powerPreference:v="default",failIfMajorPerformanceCaveat:g=!1,reversedDepthBuffer:_=!1,outputBufferType:M=di}=t;this.isWebGLRenderer=!0;let E;if(s!==null){if(typeof WebGLRenderingContext<"u"&&s instanceof WebGLRenderingContext)throw new Error("THREE.WebGLRenderer: WebGL 1 is not supported since r163.");E=s.getContextAttributes().alpha}else E=h;const A=M,y=new Set([Rp,Ap,Tp]),S=new Set([di,aa,pl,ml,Ep,bp]),w=new Uint32Array(4),D=new Int32Array(4);let U=null,H=null;const F=[],I=[];let T=null;this.domElement=i,this.debug={checkShaderErrors:!0,onShaderError:null},this.autoClear=!0,this.autoClearColor=!0,this.autoClearDepth=!0,this.autoClearStencil=!0,this.sortObjects=!0,this.clippingPlanes=[],this.localClippingEnabled=!1,this.toneMapping=na,this.toneMappingExposure=1,this.transmissionResolutionScale=1;const L=this;let Q=!1;this._outputColorSpace=Ai;let P=0,W=0,J=null,rt=-1,et=null;const O=new We,B=new We;let at=null;const $=new Se(0);let lt=0,N=i.width,k=i.height,ut=1,vt=null,Rt=null;const Z=new We(0,0,N,k),dt=new We(0,0,N,k);let yt=!1;const Ut=new Op;let Ft=!1,Xt=!1;const ge=new Je,Jt=new j,_e=new We,Te={background:null,fog:null,environment:null,overrideMaterial:null,isScene:!0};let ae=!1;function $e(){return J===null?ut:1}let V=s;function je(C,q){return i.getContext(C,q)}try{const C={alpha:!0,depth:l,stencil:c,antialias:d,premultipliedAlpha:m,preserveDrawingBuffer:p,powerPreference:v,failIfMajorPerformanceCaveat:g};if("setAttribute"in i&&i.setAttribute("data-engine",`three.js r${Sp}`),i.addEventListener("webglcontextlost",Ht,!1),i.addEventListener("webglcontextrestored",ie,!1),i.addEventListener("webglcontextcreationerror",Pe,!1),V===null){const q="webgl2";if(V=je(q,C),V===null)throw je(q)?new Error("Error creating WebGL context with your selected attributes."):new Error("Error creating WebGL context.")}}catch(C){throw Ue("WebGLRenderer: "+C.message),C}let be,Ne,Yt,z,b,K,_t,Mt,mt,Wt,wt,Kt,te,Tt,Et,Pt,Ot,zt,fe,Y,Ct,At,It;function bt(){be=new w1(V),be.init(),Ct=new xR(V,be),Ne=new y1(V,be,t,Ct),Yt=new _R(V,be),Ne.reversedDepthBuffer&&_&&Yt.buffers.depth.setReversed(!0),z=new L1(V),b=new iR,K=new vR(V,be,Yt,b,Ne,Ct,z),_t=new C1(L),Mt=new IE(V),At=new x1(V,Mt),mt=new D1(V,Mt,z,At),Wt=new O1(V,mt,Mt,At,z),zt=new N1(V,Ne,K),Et=new M1(b),wt=new nR(L,_t,be,Ne,At,Et),Kt=new TR(L,b),te=new sR,Tt=new fR(be),Ot=new v1(L,_t,Yt,Wt,E,m),Pt=new gR(L,Wt,Ne),It=new AR(V,z,Ne,Yt),fe=new S1(V,be,z),Y=new U1(V,be,z),z.programs=wt.programs,L.capabilities=Ne,L.extensions=be,L.properties=b,L.renderLists=te,L.shadowMap=Pt,L.state=Yt,L.info=z}bt(),A!==di&&(T=new z1(A,i.width,i.height,l,c));const pt=new ER(L,V);this.xr=pt,this.getContext=function(){return V},this.getContextAttributes=function(){return V.getContextAttributes()},this.forceContextLoss=function(){const C=be.get("WEBGL_lose_context");C&&C.loseContext()},this.forceContextRestore=function(){const C=be.get("WEBGL_lose_context");C&&C.restoreContext()},this.getPixelRatio=function(){return ut},this.setPixelRatio=function(C){C!==void 0&&(ut=C,this.setSize(N,k,!1))},this.getSize=function(C){return C.set(N,k)},this.setSize=function(C,q,ft=!0){if(pt.isPresenting){ee("WebGLRenderer: Can't change size while VR device is presenting.");return}N=C,k=q,i.width=Math.floor(C*ut),i.height=Math.floor(q*ut),ft===!0&&(i.style.width=C+"px",i.style.height=q+"px"),T!==null&&T.setSize(i.width,i.height),this.setViewport(0,0,C,q)},this.getDrawingBufferSize=function(C){return C.set(N*ut,k*ut).floor()},this.setDrawingBufferSize=function(C,q,ft){N=C,k=q,ut=ft,i.width=Math.floor(C*ft),i.height=Math.floor(q*ft),this.setViewport(0,0,C,q)},this.setEffects=function(C){if(A===di){console.error("THREE.WebGLRenderer: setEffects() requires outputBufferType set to HalfFloatType or FloatType.");return}if(C){for(let q=0;q<C.length;q++)if(C[q].isOutputPass===!0){console.warn("THREE.WebGLRenderer: OutputPass is not needed in setEffects(). Tone mapping and color space conversion are applied automatically.");break}}T.setEffects(C||[])},this.getCurrentViewport=function(C){return C.copy(O)},this.getViewport=function(C){return C.copy(Z)},this.setViewport=function(C,q,ft,ot){C.isVector4?Z.set(C.x,C.y,C.z,C.w):Z.set(C,q,ft,ot),Yt.viewport(O.copy(Z).multiplyScalar(ut).round())},this.getScissor=function(C){return C.copy(dt)},this.setScissor=function(C,q,ft,ot){C.isVector4?dt.set(C.x,C.y,C.z,C.w):dt.set(C,q,ft,ot),Yt.scissor(B.copy(dt).multiplyScalar(ut).round())},this.getScissorTest=function(){return yt},this.setScissorTest=function(C){Yt.setScissorTest(yt=C)},this.setOpaqueSort=function(C){vt=C},this.setTransparentSort=function(C){Rt=C},this.getClearColor=function(C){return C.copy(Ot.getClearColor())},this.setClearColor=function(){Ot.setClearColor(...arguments)},this.getClearAlpha=function(){return Ot.getClearAlpha()},this.setClearAlpha=function(){Ot.setClearAlpha(...arguments)},this.clear=function(C=!0,q=!0,ft=!0){let ot=0;if(C){let nt=!1;if(J!==null){const Dt=J.texture.format;nt=y.has(Dt)}if(nt){const Dt=J.texture.type,Bt=S.has(Dt),Nt=Ot.getClearColor(),qt=Ot.getClearAlpha(),Zt=Nt.r,ne=Nt.g,re=Nt.b;Bt?(w[0]=Zt,w[1]=ne,w[2]=re,w[3]=qt,V.clearBufferuiv(V.COLOR,0,w)):(D[0]=Zt,D[1]=ne,D[2]=re,D[3]=qt,V.clearBufferiv(V.COLOR,0,D))}else ot|=V.COLOR_BUFFER_BIT}q&&(ot|=V.DEPTH_BUFFER_BIT),ft&&(ot|=V.STENCIL_BUFFER_BIT,this.state.buffers.stencil.setMask(4294967295)),ot!==0&&V.clear(ot)},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(){i.removeEventListener("webglcontextlost",Ht,!1),i.removeEventListener("webglcontextrestored",ie,!1),i.removeEventListener("webglcontextcreationerror",Pe,!1),Ot.dispose(),te.dispose(),Tt.dispose(),b.dispose(),_t.dispose(),Wt.dispose(),At.dispose(),It.dispose(),wt.dispose(),pt.dispose(),pt.removeEventListener("sessionstart",er),pt.removeEventListener("sessionend",nr),Xi.stop()};function Ht(C){C.preventDefault(),Su("WebGLRenderer: Context Lost."),Q=!0}function ie(){Su("WebGLRenderer: Context Restored."),Q=!1;const C=z.autoReset,q=Pt.enabled,ft=Pt.autoUpdate,ot=Pt.needsUpdate,nt=Pt.type;bt(),z.autoReset=C,Pt.enabled=q,Pt.autoUpdate=ft,Pt.needsUpdate=ot,Pt.type=nt}function Pe(C){Ue("WebGLRenderer: A WebGL context could not be created. Reason: ",C.statusMessage)}function Ae(C){const q=C.target;q.removeEventListener("dispose",Ae),In(q)}function In(C){Ri(C),b.remove(C)}function Ri(C){const q=b.get(C).programs;q!==void 0&&(q.forEach(function(ft){wt.releaseProgram(ft)}),C.isShaderMaterial&&wt.releaseShaderCache(C))}this.renderBufferDirect=function(C,q,ft,ot,nt,Dt){q===null&&(q=Te);const Bt=nt.isMesh&&nt.matrixWorld.determinant()<0,Nt=bl(C,q,ft,ot,nt);Yt.setMaterial(ot,Bt);let qt=ft.index,Zt=1;if(ot.wireframe===!0){if(qt=mt.getWireframeAttribute(ft),qt===void 0)return;Zt=2}const ne=ft.drawRange,re=ft.attributes.position;let Gt=ne.start*Zt,he=(ne.start+ne.count)*Zt;Dt!==null&&(Gt=Math.max(Gt,Dt.start*Zt),he=Math.min(he,(Dt.start+Dt.count)*Zt)),qt!==null?(Gt=Math.max(Gt,0),he=Math.min(he,qt.count)):re!=null&&(Gt=Math.max(Gt,0),he=Math.min(he,re.count));const Ze=he-Gt;if(Ze<0||Ze===1/0)return;At.setup(nt,ot,Nt,ft,qt);let Ke,Ce=fe;if(qt!==null&&(Ke=Mt.get(qt),Ce=Y,Ce.setIndex(Ke)),nt.isMesh)ot.wireframe===!0?(Yt.setLineWidth(ot.wireframeLinewidth*$e()),Ce.setMode(V.LINES)):Ce.setMode(V.TRIANGLES);else if(nt.isLine){let mn=ot.linewidth;mn===void 0&&(mn=1),Yt.setLineWidth(mn*$e()),nt.isLineSegments?Ce.setMode(V.LINES):nt.isLineLoop?Ce.setMode(V.LINE_LOOP):Ce.setMode(V.LINE_STRIP)}else nt.isPoints?Ce.setMode(V.POINTS):nt.isSprite&&Ce.setMode(V.TRIANGLES);if(nt.isBatchedMesh)if(nt._multiDrawInstances!==null)yu("WebGLRenderer: renderMultiDrawInstances has been deprecated and will be removed in r184. Append to renderMultiDraw arguments and use indirection."),Ce.renderMultiDrawInstances(nt._multiDrawStarts,nt._multiDrawCounts,nt._multiDrawCount,nt._multiDrawInstances);else if(be.get("WEBGL_multi_draw"))Ce.renderMultiDraw(nt._multiDrawStarts,nt._multiDrawCounts,nt._multiDrawCount);else{const mn=nt._multiDrawStarts,kt=nt._multiDrawCounts,Fn=nt._multiDrawCount,se=qt?Mt.get(qt).bytesPerElement:1,Bn=b.get(ot).currentProgram.getUniforms();for(let ei=0;ei<Fn;ei++)Bn.setValue(V,"_gl_DrawID",ei),Ce.render(mn[ei]/se,kt[ei])}else if(nt.isInstancedMesh)Ce.renderInstances(Gt,Ze,nt.count);else if(ft.isInstancedBufferGeometry){const mn=ft._maxInstanceCount!==void 0?ft._maxInstanceCount:1/0,kt=Math.min(ft.instanceCount,mn);Ce.renderInstances(Gt,Ze,kt)}else Ce.render(Gt,Ze)};function fo(C,q,ft){C.transparent===!0&&C.side===Bi&&C.forceSinglePass===!1?(C.side=ti,C.needsUpdate=!0,Ia(C,q,ft),C.side=xs,C.needsUpdate=!0,Ia(C,q,ft),C.side=Bi):Ia(C,q,ft)}this.compile=function(C,q,ft=null){ft===null&&(ft=C),H=Tt.get(ft),H.init(q),I.push(H),ft.traverseVisible(function(nt){nt.isLight&&nt.layers.test(q.layers)&&(H.pushLight(nt),nt.castShadow&&H.pushShadow(nt))}),C!==ft&&C.traverseVisible(function(nt){nt.isLight&&nt.layers.test(q.layers)&&(H.pushLight(nt),nt.castShadow&&H.pushShadow(nt))}),H.setupLights();const ot=new Set;return C.traverse(function(nt){if(!(nt.isMesh||nt.isPoints||nt.isLine||nt.isSprite))return;const Dt=nt.material;if(Dt)if(Array.isArray(Dt))for(let Bt=0;Bt<Dt.length;Bt++){const Nt=Dt[Bt];fo(Nt,ft,nt),ot.add(Nt)}else fo(Dt,ft,nt),ot.add(Dt)}),H=I.pop(),ot},this.compileAsync=function(C,q,ft=null){const ot=this.compile(C,q,ft);return new Promise(nt=>{function Dt(){if(ot.forEach(function(Bt){b.get(Bt).currentProgram.isReady()&&ot.delete(Bt)}),ot.size===0){nt(C);return}setTimeout(Dt,10)}be.get("KHR_parallel_shader_compile")!==null?Dt():setTimeout(Dt,10)})};let tr=null;function yl(C){tr&&tr(C)}function er(){Xi.stop()}function nr(){Xi.start()}const Xi=new vx;Xi.setAnimationLoop(yl),typeof self<"u"&&Xi.setContext(self),this.setAnimationLoop=function(C){tr=C,pt.setAnimationLoop(C),C===null?Xi.stop():Xi.start()},pt.addEventListener("sessionstart",er),pt.addEventListener("sessionend",nr),this.render=function(C,q){if(q!==void 0&&q.isCamera!==!0){Ue("WebGLRenderer.render: camera is not an instance of THREE.Camera.");return}if(Q===!0)return;const ft=pt.enabled===!0&&pt.isPresenting===!0,ot=T!==null&&(J===null||ft)&&T.begin(L,J);if(C.matrixWorldAutoUpdate===!0&&C.updateMatrixWorld(),q.parent===null&&q.matrixWorldAutoUpdate===!0&&q.updateMatrixWorld(),pt.enabled===!0&&pt.isPresenting===!0&&(T===null||T.isCompositing()===!1)&&(pt.cameraAutoUpdate===!0&&pt.updateCamera(q),q=pt.getCamera()),C.isScene===!0&&C.onBeforeRender(L,C,q,J),H=Tt.get(C,I.length),H.init(q),I.push(H),ge.multiplyMatrices(q.projectionMatrix,q.matrixWorldInverse),Ut.setFromProjectionMatrix(ge,ea,q.reversedDepth),Xt=this.localClippingEnabled,Ft=Et.init(this.clippingPlanes,Xt),U=te.get(C,F.length),U.init(),F.push(U),pt.enabled===!0&&pt.isPresenting===!0){const Bt=L.xr.getDepthSensingMesh();Bt!==null&&ir(Bt,q,-1/0,L.sortObjects)}ir(C,q,0,L.sortObjects),U.finish(),L.sortObjects===!0&&U.sort(vt,Rt),ae=pt.enabled===!1||pt.isPresenting===!1||pt.hasDepthSensing()===!1,ae&&Ot.addToRenderList(U,C),this.info.render.frame++,Ft===!0&&Et.beginShadows();const nt=H.state.shadowsArray;if(Pt.render(nt,C,q),Ft===!0&&Et.endShadows(),this.info.autoReset===!0&&this.info.reset(),(ot&&T.hasRenderPass())===!1){const Bt=U.opaque,Nt=U.transmissive;if(H.setupLights(),q.isArrayCamera){const qt=q.cameras;if(Nt.length>0)for(let Zt=0,ne=qt.length;Zt<ne;Zt++){const re=qt[Zt];rn(Bt,Nt,C,re)}ae&&Ot.render(C);for(let Zt=0,ne=qt.length;Zt<ne;Zt++){const re=qt[Zt];Ci(U,C,re,re.viewport)}}else Nt.length>0&&rn(Bt,Nt,C,q),ae&&Ot.render(C),Ci(U,C,q)}J!==null&&W===0&&(K.updateMultisampleRenderTarget(J),K.updateRenderTargetMipmap(J)),ot&&T.end(L),C.isScene===!0&&C.onAfterRender(L,C,q),At.resetDefaultState(),rt=-1,et=null,I.pop(),I.length>0?(H=I[I.length-1],Ft===!0&&Et.setGlobalState(L.clippingPlanes,H.state.camera)):H=null,F.pop(),F.length>0?U=F[F.length-1]:U=null};function ir(C,q,ft,ot){if(C.visible===!1)return;if(C.layers.test(q.layers)){if(C.isGroup)ft=C.renderOrder;else if(C.isLOD)C.autoUpdate===!0&&C.update(q);else if(C.isLight)H.pushLight(C),C.castShadow&&H.pushShadow(C);else if(C.isSprite){if(!C.frustumCulled||Ut.intersectsSprite(C)){ot&&_e.setFromMatrixPosition(C.matrixWorld).applyMatrix4(ge);const Bt=Wt.update(C),Nt=C.material;Nt.visible&&U.push(C,Bt,Nt,ft,_e.z,null)}}else if((C.isMesh||C.isLine||C.isPoints)&&(!C.frustumCulled||Ut.intersectsObject(C))){const Bt=Wt.update(C),Nt=C.material;if(ot&&(C.boundingSphere!==void 0?(C.boundingSphere===null&&C.computeBoundingSphere(),_e.copy(C.boundingSphere.center)):(Bt.boundingSphere===null&&Bt.computeBoundingSphere(),_e.copy(Bt.boundingSphere.center)),_e.applyMatrix4(C.matrixWorld).applyMatrix4(ge)),Array.isArray(Nt)){const qt=Bt.groups;for(let Zt=0,ne=qt.length;Zt<ne;Zt++){const re=qt[Zt],Gt=Nt[re.materialIndex];Gt&&Gt.visible&&U.push(C,Bt,Gt,ft,_e.z,re)}}else Nt.visible&&U.push(C,Bt,Nt,ft,_e.z,null)}}const Dt=C.children;for(let Bt=0,Nt=Dt.length;Bt<Nt;Bt++)ir(Dt[Bt],q,ft,ot)}function Ci(C,q,ft,ot){const{opaque:nt,transmissive:Dt,transparent:Bt}=C;H.setupLightsView(ft),Ft===!0&&Et.setGlobalState(L.clippingPlanes,ft),ot&&Yt.viewport(O.copy(ot)),nt.length>0&&pn(nt,q,ft),Dt.length>0&&pn(Dt,q,ft),Bt.length>0&&pn(Bt,q,ft),Yt.buffers.depth.setTest(!0),Yt.buffers.depth.setMask(!0),Yt.buffers.color.setMask(!0),Yt.setPolygonOffset(!1)}function rn(C,q,ft,ot){if((ft.isScene===!0?ft.overrideMaterial:null)!==null)return;if(H.state.transmissionRenderTarget[ot.id]===void 0){const Gt=be.has("EXT_color_buffer_half_float")||be.has("EXT_color_buffer_float");H.state.transmissionRenderTarget[ot.id]=new ia(1,1,{generateMipmaps:!0,type:Gt?Pa:di,minFilter:Zs,samples:Math.max(4,Ne.samples),stencilBuffer:c,resolveDepthBuffer:!1,resolveStencilBuffer:!1,colorSpace:Re.workingColorSpace})}const Dt=H.state.transmissionRenderTarget[ot.id],Bt=ot.viewport||O;Dt.setSize(Bt.z*L.transmissionResolutionScale,Bt.w*L.transmissionResolutionScale);const Nt=L.getRenderTarget(),qt=L.getActiveCubeFace(),Zt=L.getActiveMipmapLevel();L.setRenderTarget(Dt),L.getClearColor($),lt=L.getClearAlpha(),lt<1&&L.setClearColor(16777215,.5),L.clear(),ae&&Ot.render(ft);const ne=L.toneMapping;L.toneMapping=na;const re=ot.viewport;if(ot.viewport!==void 0&&(ot.viewport=void 0),H.setupLightsView(ot),Ft===!0&&Et.setGlobalState(L.clippingPlanes,ot),pn(C,ft,ot),K.updateMultisampleRenderTarget(Dt),K.updateRenderTargetMipmap(Dt),be.has("WEBGL_multisampled_render_to_texture")===!1){let Gt=!1;for(let he=0,Ze=q.length;he<Ze;he++){const Ke=q[he],{object:Ce,geometry:mn,material:kt,group:Fn}=Ke;if(kt.side===Bi&&Ce.layers.test(ot.layers)){const se=kt.side;kt.side=ti,kt.needsUpdate=!0,ra(Ce,ft,ot,mn,kt,Fn),kt.side=se,kt.needsUpdate=!0,Gt=!0}}Gt===!0&&(K.updateMultisampleRenderTarget(Dt),K.updateRenderTargetMipmap(Dt))}L.setRenderTarget(Nt,qt,Zt),L.setClearColor($,lt),re!==void 0&&(ot.viewport=re),L.toneMapping=ne}function pn(C,q,ft){const ot=q.isScene===!0?q.overrideMaterial:null;for(let nt=0,Dt=C.length;nt<Dt;nt++){const Bt=C[nt],{object:Nt,geometry:qt,group:Zt}=Bt;let ne=Bt.material;ne.allowOverride===!0&&ot!==null&&(ne=ot),Nt.layers.test(ft.layers)&&ra(Nt,q,ft,qt,ne,Zt)}}function ra(C,q,ft,ot,nt,Dt){C.onBeforeRender(L,q,ft,ot,nt,Dt),C.modelViewMatrix.multiplyMatrices(ft.matrixWorldInverse,C.matrixWorld),C.normalMatrix.getNormalMatrix(C.modelViewMatrix),nt.onBeforeRender(L,q,ft,ot,C,Dt),nt.transparent===!0&&nt.side===Bi&&nt.forceSinglePass===!1?(nt.side=ti,nt.needsUpdate=!0,L.renderBufferDirect(ft,q,ot,nt,C,Dt),nt.side=xs,nt.needsUpdate=!0,L.renderBufferDirect(ft,q,ot,nt,C,Dt),nt.side=Bi):L.renderBufferDirect(ft,q,ot,nt,C,Dt),C.onAfterRender(L,q,ft,ot,nt,Dt)}function Ia(C,q,ft){q.isScene!==!0&&(q=Te);const ot=b.get(C),nt=H.state.lights,Dt=H.state.shadowsArray,Bt=nt.state.version,Nt=wt.getParameters(C,nt.state,Dt,q,ft),qt=wt.getProgramCacheKey(Nt);let Zt=ot.programs;ot.environment=C.isMeshStandardMaterial||C.isMeshLambertMaterial||C.isMeshPhongMaterial?q.environment:null,ot.fog=q.fog;const ne=C.isMeshStandardMaterial||C.isMeshLambertMaterial&&!C.envMap||C.isMeshPhongMaterial&&!C.envMap;ot.envMap=_t.get(C.envMap||ot.environment,ne),ot.envMapRotation=ot.environment!==null&&C.envMap===null?q.environmentRotation:C.envMapRotation,Zt===void 0&&(C.addEventListener("dispose",Ae),Zt=new Map,ot.programs=Zt);let re=Zt.get(qt);if(re!==void 0){if(ot.currentProgram===re&&ot.lightsStateVersion===Bt)return El(C,Nt),re}else Nt.uniforms=wt.getUniforms(C),C.onBeforeCompile(Nt,L),re=wt.acquireProgram(Nt,qt),Zt.set(qt,re),ot.uniforms=Nt.uniforms;const Gt=ot.uniforms;return(!C.isShaderMaterial&&!C.isRawShaderMaterial||C.clipping===!0)&&(Gt.clippingPlanes=Et.uniform),El(C,Nt),ot.needsLights=ho(C),ot.lightsStateVersion=Bt,ot.needsLights&&(Gt.ambientLightColor.value=nt.state.ambient,Gt.lightProbe.value=nt.state.probe,Gt.directionalLights.value=nt.state.directional,Gt.directionalLightShadows.value=nt.state.directionalShadow,Gt.spotLights.value=nt.state.spot,Gt.spotLightShadows.value=nt.state.spotShadow,Gt.rectAreaLights.value=nt.state.rectArea,Gt.ltc_1.value=nt.state.rectAreaLTC1,Gt.ltc_2.value=nt.state.rectAreaLTC2,Gt.pointLights.value=nt.state.point,Gt.pointLightShadows.value=nt.state.pointShadow,Gt.hemisphereLights.value=nt.state.hemi,Gt.directionalShadowMatrix.value=nt.state.directionalShadowMatrix,Gt.spotLightMatrix.value=nt.state.spotLightMatrix,Gt.spotLightMap.value=nt.state.spotLightMap,Gt.pointShadowMatrix.value=nt.state.pointShadowMatrix),ot.currentProgram=re,ot.uniformsList=null,re}function Ml(C){if(C.uniformsList===null){const q=C.currentProgram.getUniforms();C.uniformsList=_u.seqWithValue(q.seq,C.uniforms)}return C.uniformsList}function El(C,q){const ft=b.get(C);ft.outputColorSpace=q.outputColorSpace,ft.batching=q.batching,ft.batchingColor=q.batchingColor,ft.instancing=q.instancing,ft.instancingColor=q.instancingColor,ft.instancingMorph=q.instancingMorph,ft.skinning=q.skinning,ft.morphTargets=q.morphTargets,ft.morphNormals=q.morphNormals,ft.morphColors=q.morphColors,ft.morphTargetsCount=q.morphTargetsCount,ft.numClippingPlanes=q.numClippingPlanes,ft.numIntersection=q.numClipIntersection,ft.vertexAlphas=q.vertexAlphas,ft.vertexTangents=q.vertexTangents,ft.toneMapping=q.toneMapping}function bl(C,q,ft,ot,nt){q.isScene!==!0&&(q=Te),K.resetTextureUnits();const Dt=q.fog,Bt=ot.isMeshStandardMaterial||ot.isMeshLambertMaterial||ot.isMeshPhongMaterial?q.environment:null,Nt=J===null?L.outputColorSpace:J.isXRRenderTarget===!0?J.texture.colorSpace:ro,qt=ot.isMeshStandardMaterial||ot.isMeshLambertMaterial&&!ot.envMap||ot.isMeshPhongMaterial&&!ot.envMap,Zt=_t.get(ot.envMap||Bt,qt),ne=ot.vertexColors===!0&&!!ft.attributes.color&&ft.attributes.color.itemSize===4,re=!!ft.attributes.tangent&&(!!ot.normalMap||ot.anisotropy>0),Gt=!!ft.morphAttributes.position,he=!!ft.morphAttributes.normal,Ze=!!ft.morphAttributes.color;let Ke=na;ot.toneMapped&&(J===null||J.isXRRenderTarget===!0)&&(Ke=L.toneMapping);const Ce=ft.morphAttributes.position||ft.morphAttributes.normal||ft.morphAttributes.color,mn=Ce!==void 0?Ce.length:0,kt=b.get(ot),Fn=H.state.lights;if(Ft===!0&&(Xt===!0||C!==et)){const ln=C===et&&ot.id===rt;Et.setState(ot,C,ln)}let se=!1;ot.version===kt.__version?(kt.needsLights&&kt.lightsStateVersion!==Fn.state.version||kt.outputColorSpace!==Nt||nt.isBatchedMesh&&kt.batching===!1||!nt.isBatchedMesh&&kt.batching===!0||nt.isBatchedMesh&&kt.batchingColor===!0&&nt.colorTexture===null||nt.isBatchedMesh&&kt.batchingColor===!1&&nt.colorTexture!==null||nt.isInstancedMesh&&kt.instancing===!1||!nt.isInstancedMesh&&kt.instancing===!0||nt.isSkinnedMesh&&kt.skinning===!1||!nt.isSkinnedMesh&&kt.skinning===!0||nt.isInstancedMesh&&kt.instancingColor===!0&&nt.instanceColor===null||nt.isInstancedMesh&&kt.instancingColor===!1&&nt.instanceColor!==null||nt.isInstancedMesh&&kt.instancingMorph===!0&&nt.morphTexture===null||nt.isInstancedMesh&&kt.instancingMorph===!1&&nt.morphTexture!==null||kt.envMap!==Zt||ot.fog===!0&&kt.fog!==Dt||kt.numClippingPlanes!==void 0&&(kt.numClippingPlanes!==Et.numPlanes||kt.numIntersection!==Et.numIntersection)||kt.vertexAlphas!==ne||kt.vertexTangents!==re||kt.morphTargets!==Gt||kt.morphNormals!==he||kt.morphColors!==Ze||kt.toneMapping!==Ke||kt.morphTargetsCount!==mn)&&(se=!0):(se=!0,kt.__version=ot.version);let Bn=kt.currentProgram;se===!0&&(Bn=Ia(ot,q,nt));let ei=!1,wi=!1,ni=!1;const Oe=Bn.getUniforms(),on=kt.uniforms;if(Yt.useProgram(Bn.program)&&(ei=!0,wi=!0,ni=!0),ot.id!==rt&&(rt=ot.id,wi=!0),ei||et!==C){Yt.buffers.depth.getReversed()&&C.reversedDepth!==!0&&(C._reversedDepth=!0,C.updateProjectionMatrix()),Oe.setValue(V,"projectionMatrix",C.projectionMatrix),Oe.setValue(V,"viewMatrix",C.matrixWorldInverse);const Di=Oe.map.cameraPosition;Di!==void 0&&Di.setValue(V,Jt.setFromMatrixPosition(C.matrixWorld)),Ne.logarithmicDepthBuffer&&Oe.setValue(V,"logDepthBufFC",2/(Math.log(C.far+1)/Math.LN2)),(ot.isMeshPhongMaterial||ot.isMeshToonMaterial||ot.isMeshLambertMaterial||ot.isMeshBasicMaterial||ot.isMeshStandardMaterial||ot.isShaderMaterial)&&Oe.setValue(V,"isOrthographic",C.isOrthographicCamera===!0),et!==C&&(et=C,wi=!0,ni=!0)}if(kt.needsLights&&(Fn.state.directionalShadowMap.length>0&&Oe.setValue(V,"directionalShadowMap",Fn.state.directionalShadowMap,K),Fn.state.spotShadowMap.length>0&&Oe.setValue(V,"spotShadowMap",Fn.state.spotShadowMap,K),Fn.state.pointShadowMap.length>0&&Oe.setValue(V,"pointShadowMap",Fn.state.pointShadowMap,K)),nt.isSkinnedMesh){Oe.setOptional(V,nt,"bindMatrix"),Oe.setOptional(V,nt,"bindMatrixInverse");const ln=nt.skeleton;ln&&(ln.boneTexture===null&&ln.computeBoneTexture(),Oe.setValue(V,"boneTexture",ln.boneTexture,K))}nt.isBatchedMesh&&(Oe.setOptional(V,nt,"batchingTexture"),Oe.setValue(V,"batchingTexture",nt._matricesTexture,K),Oe.setOptional(V,nt,"batchingIdTexture"),Oe.setValue(V,"batchingIdTexture",nt._indirectTexture,K),Oe.setOptional(V,nt,"batchingColorTexture"),nt._colorsTexture!==null&&Oe.setValue(V,"batchingColorTexture",nt._colorsTexture,K));const Hn=ft.morphAttributes;if((Hn.position!==void 0||Hn.normal!==void 0||Hn.color!==void 0)&&zt.update(nt,ft,Bn),(wi||kt.receiveShadow!==nt.receiveShadow)&&(kt.receiveShadow=nt.receiveShadow,Oe.setValue(V,"receiveShadow",nt.receiveShadow)),(ot.isMeshStandardMaterial||ot.isMeshLambertMaterial||ot.isMeshPhongMaterial)&&ot.envMap===null&&q.environment!==null&&(on.envMapIntensity.value=q.environmentIntensity),on.dfgLUT!==void 0&&(on.dfgLUT.value=CR()),wi&&(Oe.setValue(V,"toneMappingExposure",L.toneMappingExposure),kt.needsLights&&Ms(on,ni),Dt&&ot.fog===!0&&Kt.refreshFogUniforms(on,Dt),Kt.refreshMaterialUniforms(on,ot,ut,k,H.state.transmissionRenderTarget[C.id]),_u.upload(V,Ml(kt),on,K)),ot.isShaderMaterial&&ot.uniformsNeedUpdate===!0&&(_u.upload(V,Ml(kt),on,K),ot.uniformsNeedUpdate=!1),ot.isSpriteMaterial&&Oe.setValue(V,"center",nt.center),Oe.setValue(V,"modelViewMatrix",nt.modelViewMatrix),Oe.setValue(V,"normalMatrix",nt.normalMatrix),Oe.setValue(V,"modelMatrix",nt.matrixWorld),ot.isShaderMaterial||ot.isRawShaderMaterial){const ln=ot.uniformsGroups;for(let Di=0,oa=ln.length;Di<oa;Di++){const ar=ln[Di];It.update(ar,Bn),It.bind(ar,Bn)}}return Bn}function Ms(C,q){C.ambientLightColor.needsUpdate=q,C.lightProbe.needsUpdate=q,C.directionalLights.needsUpdate=q,C.directionalLightShadows.needsUpdate=q,C.pointLights.needsUpdate=q,C.pointLightShadows.needsUpdate=q,C.spotLights.needsUpdate=q,C.spotLightShadows.needsUpdate=q,C.rectAreaLights.needsUpdate=q,C.hemisphereLights.needsUpdate=q}function ho(C){return C.isMeshLambertMaterial||C.isMeshToonMaterial||C.isMeshPhongMaterial||C.isMeshStandardMaterial||C.isShadowMaterial||C.isShaderMaterial&&C.lights===!0}this.getActiveCubeFace=function(){return P},this.getActiveMipmapLevel=function(){return W},this.getRenderTarget=function(){return J},this.setRenderTargetTextures=function(C,q,ft){const ot=b.get(C);ot.__autoAllocateDepthBuffer=C.resolveDepthBuffer===!1,ot.__autoAllocateDepthBuffer===!1&&(ot.__useRenderToTexture=!1),b.get(C.texture).__webglTexture=q,b.get(C.depthTexture).__webglTexture=ot.__autoAllocateDepthBuffer?void 0:ft,ot.__hasExternalTextures=!0},this.setRenderTargetFramebuffer=function(C,q){const ft=b.get(C);ft.__webglFramebuffer=q,ft.__useDefaultFramebuffer=q===void 0};const Fa=V.createFramebuffer();this.setRenderTarget=function(C,q=0,ft=0){J=C,P=q,W=ft;let ot=null,nt=!1,Dt=!1;if(C){const Nt=b.get(C);if(Nt.__useDefaultFramebuffer!==void 0){Yt.bindFramebuffer(V.FRAMEBUFFER,Nt.__webglFramebuffer),O.copy(C.viewport),B.copy(C.scissor),at=C.scissorTest,Yt.viewport(O),Yt.scissor(B),Yt.setScissorTest(at),rt=-1;return}else if(Nt.__webglFramebuffer===void 0)K.setupRenderTarget(C);else if(Nt.__hasExternalTextures)K.rebindTextures(C,b.get(C.texture).__webglTexture,b.get(C.depthTexture).__webglTexture);else if(C.depthBuffer){const ne=C.depthTexture;if(Nt.__boundDepthTexture!==ne){if(ne!==null&&b.has(ne)&&(C.width!==ne.image.width||C.height!==ne.image.height))throw new Error("WebGLRenderTarget: Attached DepthTexture is initialized to the incorrect size.");K.setupDepthRenderbuffer(C)}}const qt=C.texture;(qt.isData3DTexture||qt.isDataArrayTexture||qt.isCompressedArrayTexture)&&(Dt=!0);const Zt=b.get(C).__webglFramebuffer;C.isWebGLCubeRenderTarget?(Array.isArray(Zt[q])?ot=Zt[q][ft]:ot=Zt[q],nt=!0):C.samples>0&&K.useMultisampledRTT(C)===!1?ot=b.get(C).__webglMultisampledFramebuffer:Array.isArray(Zt)?ot=Zt[ft]:ot=Zt,O.copy(C.viewport),B.copy(C.scissor),at=C.scissorTest}else O.copy(Z).multiplyScalar(ut).floor(),B.copy(dt).multiplyScalar(ut).floor(),at=yt;if(ft!==0&&(ot=Fa),Yt.bindFramebuffer(V.FRAMEBUFFER,ot)&&Yt.drawBuffers(C,ot),Yt.viewport(O),Yt.scissor(B),Yt.setScissorTest(at),nt){const Nt=b.get(C.texture);V.framebufferTexture2D(V.FRAMEBUFFER,V.COLOR_ATTACHMENT0,V.TEXTURE_CUBE_MAP_POSITIVE_X+q,Nt.__webglTexture,ft)}else if(Dt){const Nt=q;for(let qt=0;qt<C.textures.length;qt++){const Zt=b.get(C.textures[qt]);V.framebufferTextureLayer(V.FRAMEBUFFER,V.COLOR_ATTACHMENT0+qt,Zt.__webglTexture,ft,Nt)}}else if(C!==null&&ft!==0){const Nt=b.get(C.texture);V.framebufferTexture2D(V.FRAMEBUFFER,V.COLOR_ATTACHMENT0,V.TEXTURE_2D,Nt.__webglTexture,ft)}rt=-1},this.readRenderTargetPixels=function(C,q,ft,ot,nt,Dt,Bt,Nt=0){if(!(C&&C.isWebGLRenderTarget)){Ue("WebGLRenderer.readRenderTargetPixels: renderTarget is not THREE.WebGLRenderTarget.");return}let qt=b.get(C).__webglFramebuffer;if(C.isWebGLCubeRenderTarget&&Bt!==void 0&&(qt=qt[Bt]),qt){Yt.bindFramebuffer(V.FRAMEBUFFER,qt);try{const Zt=C.textures[Nt],ne=Zt.format,re=Zt.type;if(C.textures.length>1&&V.readBuffer(V.COLOR_ATTACHMENT0+Nt),!Ne.textureFormatReadable(ne)){Ue("WebGLRenderer.readRenderTargetPixels: renderTarget is not in RGBA or implementation defined format.");return}if(!Ne.textureTypeReadable(re)){Ue("WebGLRenderer.readRenderTargetPixels: renderTarget is not in UnsignedByteType or implementation defined type.");return}q>=0&&q<=C.width-ot&&ft>=0&&ft<=C.height-nt&&V.readPixels(q,ft,ot,nt,Ct.convert(ne),Ct.convert(re),Dt)}finally{const Zt=J!==null?b.get(J).__webglFramebuffer:null;Yt.bindFramebuffer(V.FRAMEBUFFER,Zt)}}},this.readRenderTargetPixelsAsync=async function(C,q,ft,ot,nt,Dt,Bt,Nt=0){if(!(C&&C.isWebGLRenderTarget))throw new Error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not THREE.WebGLRenderTarget.");let qt=b.get(C).__webglFramebuffer;if(C.isWebGLCubeRenderTarget&&Bt!==void 0&&(qt=qt[Bt]),qt)if(q>=0&&q<=C.width-ot&&ft>=0&&ft<=C.height-nt){Yt.bindFramebuffer(V.FRAMEBUFFER,qt);const Zt=C.textures[Nt],ne=Zt.format,re=Zt.type;if(C.textures.length>1&&V.readBuffer(V.COLOR_ATTACHMENT0+Nt),!Ne.textureFormatReadable(ne))throw new Error("THREE.WebGLRenderer.readRenderTargetPixelsAsync: renderTarget is not in RGBA or implementation defined format.");if(!Ne.textureTypeReadable(re))throw new Error("THREE.WebGLRenderer.readRenderTargetPixelsAsync: renderTarget is not in UnsignedByteType or implementation defined type.");const Gt=V.createBuffer();V.bindBuffer(V.PIXEL_PACK_BUFFER,Gt),V.bufferData(V.PIXEL_PACK_BUFFER,Dt.byteLength,V.STREAM_READ),V.readPixels(q,ft,ot,nt,Ct.convert(ne),Ct.convert(re),0);const he=J!==null?b.get(J).__webglFramebuffer:null;Yt.bindFramebuffer(V.FRAMEBUFFER,he);const Ze=V.fenceSync(V.SYNC_GPU_COMMANDS_COMPLETE,0);return V.flush(),await CM(V,Ze,4),V.bindBuffer(V.PIXEL_PACK_BUFFER,Gt),V.getBufferSubData(V.PIXEL_PACK_BUFFER,0,Dt),V.deleteBuffer(Gt),V.deleteSync(Ze),Dt}else throw new Error("THREE.WebGLRenderer.readRenderTargetPixelsAsync: requested read bounds are out of range.")},this.copyFramebufferToTexture=function(C,q=null,ft=0){const ot=Math.pow(2,-ft),nt=Math.floor(C.image.width*ot),Dt=Math.floor(C.image.height*ot),Bt=q!==null?q.x:0,Nt=q!==null?q.y:0;K.setTexture2D(C,0),V.copyTexSubImage2D(V.TEXTURE_2D,ft,0,0,Bt,Nt,nt,Dt),Yt.unbindTexture()};const Ba=V.createFramebuffer(),Es=V.createFramebuffer();this.copyTextureToTexture=function(C,q,ft=null,ot=null,nt=0,Dt=0){let Bt,Nt,qt,Zt,ne,re,Gt,he,Ze;const Ke=C.isCompressedTexture?C.mipmaps[Dt]:C.image;if(ft!==null)Bt=ft.max.x-ft.min.x,Nt=ft.max.y-ft.min.y,qt=ft.isBox3?ft.max.z-ft.min.z:1,Zt=ft.min.x,ne=ft.min.y,re=ft.isBox3?ft.min.z:0;else{const on=Math.pow(2,-nt);Bt=Math.floor(Ke.width*on),Nt=Math.floor(Ke.height*on),C.isDataArrayTexture?qt=Ke.depth:C.isData3DTexture?qt=Math.floor(Ke.depth*on):qt=1,Zt=0,ne=0,re=0}ot!==null?(Gt=ot.x,he=ot.y,Ze=ot.z):(Gt=0,he=0,Ze=0);const Ce=Ct.convert(q.format),mn=Ct.convert(q.type);let kt;q.isData3DTexture?(K.setTexture3D(q,0),kt=V.TEXTURE_3D):q.isDataArrayTexture||q.isCompressedArrayTexture?(K.setTexture2DArray(q,0),kt=V.TEXTURE_2D_ARRAY):(K.setTexture2D(q,0),kt=V.TEXTURE_2D),V.pixelStorei(V.UNPACK_FLIP_Y_WEBGL,q.flipY),V.pixelStorei(V.UNPACK_PREMULTIPLY_ALPHA_WEBGL,q.premultiplyAlpha),V.pixelStorei(V.UNPACK_ALIGNMENT,q.unpackAlignment);const Fn=V.getParameter(V.UNPACK_ROW_LENGTH),se=V.getParameter(V.UNPACK_IMAGE_HEIGHT),Bn=V.getParameter(V.UNPACK_SKIP_PIXELS),ei=V.getParameter(V.UNPACK_SKIP_ROWS),wi=V.getParameter(V.UNPACK_SKIP_IMAGES);V.pixelStorei(V.UNPACK_ROW_LENGTH,Ke.width),V.pixelStorei(V.UNPACK_IMAGE_HEIGHT,Ke.height),V.pixelStorei(V.UNPACK_SKIP_PIXELS,Zt),V.pixelStorei(V.UNPACK_SKIP_ROWS,ne),V.pixelStorei(V.UNPACK_SKIP_IMAGES,re);const ni=C.isDataArrayTexture||C.isData3DTexture,Oe=q.isDataArrayTexture||q.isData3DTexture;if(C.isDepthTexture){const on=b.get(C),Hn=b.get(q),ln=b.get(on.__renderTarget),Di=b.get(Hn.__renderTarget);Yt.bindFramebuffer(V.READ_FRAMEBUFFER,ln.__webglFramebuffer),Yt.bindFramebuffer(V.DRAW_FRAMEBUFFER,Di.__webglFramebuffer);for(let oa=0;oa<qt;oa++)ni&&(V.framebufferTextureLayer(V.READ_FRAMEBUFFER,V.COLOR_ATTACHMENT0,b.get(C).__webglTexture,nt,re+oa),V.framebufferTextureLayer(V.DRAW_FRAMEBUFFER,V.COLOR_ATTACHMENT0,b.get(q).__webglTexture,Dt,Ze+oa)),V.blitFramebuffer(Zt,ne,Bt,Nt,Gt,he,Bt,Nt,V.DEPTH_BUFFER_BIT,V.NEAREST);Yt.bindFramebuffer(V.READ_FRAMEBUFFER,null),Yt.bindFramebuffer(V.DRAW_FRAMEBUFFER,null)}else if(nt!==0||C.isRenderTargetTexture||b.has(C)){const on=b.get(C),Hn=b.get(q);Yt.bindFramebuffer(V.READ_FRAMEBUFFER,Ba),Yt.bindFramebuffer(V.DRAW_FRAMEBUFFER,Es);for(let ln=0;ln<qt;ln++)ni?V.framebufferTextureLayer(V.READ_FRAMEBUFFER,V.COLOR_ATTACHMENT0,on.__webglTexture,nt,re+ln):V.framebufferTexture2D(V.READ_FRAMEBUFFER,V.COLOR_ATTACHMENT0,V.TEXTURE_2D,on.__webglTexture,nt),Oe?V.framebufferTextureLayer(V.DRAW_FRAMEBUFFER,V.COLOR_ATTACHMENT0,Hn.__webglTexture,Dt,Ze+ln):V.framebufferTexture2D(V.DRAW_FRAMEBUFFER,V.COLOR_ATTACHMENT0,V.TEXTURE_2D,Hn.__webglTexture,Dt),nt!==0?V.blitFramebuffer(Zt,ne,Bt,Nt,Gt,he,Bt,Nt,V.COLOR_BUFFER_BIT,V.NEAREST):Oe?V.copyTexSubImage3D(kt,Dt,Gt,he,Ze+ln,Zt,ne,Bt,Nt):V.copyTexSubImage2D(kt,Dt,Gt,he,Zt,ne,Bt,Nt);Yt.bindFramebuffer(V.READ_FRAMEBUFFER,null),Yt.bindFramebuffer(V.DRAW_FRAMEBUFFER,null)}else Oe?C.isDataTexture||C.isData3DTexture?V.texSubImage3D(kt,Dt,Gt,he,Ze,Bt,Nt,qt,Ce,mn,Ke.data):q.isCompressedArrayTexture?V.compressedTexSubImage3D(kt,Dt,Gt,he,Ze,Bt,Nt,qt,Ce,Ke.data):V.texSubImage3D(kt,Dt,Gt,he,Ze,Bt,Nt,qt,Ce,mn,Ke):C.isDataTexture?V.texSubImage2D(V.TEXTURE_2D,Dt,Gt,he,Bt,Nt,Ce,mn,Ke.data):C.isCompressedTexture?V.compressedTexSubImage2D(V.TEXTURE_2D,Dt,Gt,he,Ke.width,Ke.height,Ce,Ke.data):V.texSubImage2D(V.TEXTURE_2D,Dt,Gt,he,Bt,Nt,Ce,mn,Ke);V.pixelStorei(V.UNPACK_ROW_LENGTH,Fn),V.pixelStorei(V.UNPACK_IMAGE_HEIGHT,se),V.pixelStorei(V.UNPACK_SKIP_PIXELS,Bn),V.pixelStorei(V.UNPACK_SKIP_ROWS,ei),V.pixelStorei(V.UNPACK_SKIP_IMAGES,wi),Dt===0&&q.generateMipmaps&&V.generateMipmap(kt),Yt.unbindTexture()},this.initRenderTarget=function(C){b.get(C).__webglFramebuffer===void 0&&K.setupRenderTarget(C)},this.initTexture=function(C){C.isCubeTexture?K.setTextureCube(C,0):C.isData3DTexture?K.setTexture3D(C,0):C.isDataArrayTexture||C.isCompressedArrayTexture?K.setTexture2DArray(C,0):K.setTexture2D(C,0),Yt.unbindTexture()},this.resetState=function(){P=0,W=0,J=null,Yt.reset(),At.reset()},typeof __THREE_DEVTOOLS__<"u"&&__THREE_DEVTOOLS__.dispatchEvent(new CustomEvent("observe",{detail:this}))}get coordinateSystem(){return ea}get outputColorSpace(){return this._outputColorSpace}set outputColorSpace(t){this._outputColorSpace=t;const i=this.getContext();i.drawingBufferColorSpace=Re._getDrawingBufferColorSpace(t),i.unpackColorSpace=Re._getUnpackColorSpace()}}const Lv={type:"change"},Ip={type:"start"},bx={type:"end"},ru=new Lp,Nv=new ms,DR=Math.cos(70*ox.DEG2RAD),_n=new j,Jn=2*Math.PI,ke={NONE:-1,ROTATE:0,DOLLY:1,PAN:2,TOUCH_ROTATE:3,TOUCH_PAN:4,TOUCH_DOLLY_PAN:5,TOUCH_DOLLY_ROTATE:6},Sd=1e-6;class UR extends PE{constructor(t,i=null){super(t,i),this.state=ke.NONE,this.target=new j,this.cursor=new j,this.minDistance=0,this.maxDistance=1/0,this.minZoom=0,this.maxZoom=1/0,this.minTargetRadius=0,this.maxTargetRadius=1/0,this.minPolarAngle=0,this.maxPolarAngle=Math.PI,this.minAzimuthAngle=-1/0,this.maxAzimuthAngle=1/0,this.enableDamping=!1,this.dampingFactor=.05,this.enableZoom=!0,this.zoomSpeed=1,this.enableRotate=!0,this.rotateSpeed=1,this.keyRotateSpeed=1,this.enablePan=!0,this.panSpeed=1,this.screenSpacePanning=!0,this.keyPanSpeed=7,this.zoomToCursor=!1,this.autoRotate=!1,this.autoRotateSpeed=2,this.keys={LEFT:"ArrowLeft",UP:"ArrowUp",RIGHT:"ArrowRight",BOTTOM:"ArrowDown"},this.mouseButtons={LEFT:to.ROTATE,MIDDLE:to.DOLLY,RIGHT:to.PAN},this.touches={ONE:$r.ROTATE,TWO:$r.DOLLY_PAN},this.target0=this.target.clone(),this.position0=this.object.position.clone(),this.zoom0=this.object.zoom,this._cursorStyle="auto",this._domElementKeyEvents=null,this._lastPosition=new j,this._lastQuaternion=new Ss,this._lastTargetPosition=new j,this._quat=new Ss().setFromUnitVectors(t.up,new j(0,1,0)),this._quatInverse=this._quat.clone().invert(),this._spherical=new rv,this._sphericalDelta=new rv,this._scale=1,this._panOffset=new j,this._rotateStart=new le,this._rotateEnd=new le,this._rotateDelta=new le,this._panStart=new le,this._panEnd=new le,this._panDelta=new le,this._dollyStart=new le,this._dollyEnd=new le,this._dollyDelta=new le,this._dollyDirection=new j,this._mouse=new le,this._performCursorZoom=!1,this._pointers=[],this._pointerPositions={},this._controlActive=!1,this._onPointerMove=NR.bind(this),this._onPointerDown=LR.bind(this),this._onPointerUp=OR.bind(this),this._onContextMenu=GR.bind(this),this._onMouseWheel=IR.bind(this),this._onKeyDown=FR.bind(this),this._onTouchStart=BR.bind(this),this._onTouchMove=HR.bind(this),this._onMouseDown=PR.bind(this),this._onMouseMove=zR.bind(this),this._interceptControlDown=VR.bind(this),this._interceptControlUp=kR.bind(this),this.domElement!==null&&this.connect(this.domElement),this.update()}set cursorStyle(t){this._cursorStyle=t,t==="grab"?this.domElement.style.cursor="grab":this.domElement.style.cursor="auto"}get cursorStyle(){return this._cursorStyle}connect(t){super.connect(t),this.domElement.addEventListener("pointerdown",this._onPointerDown),this.domElement.addEventListener("pointercancel",this._onPointerUp),this.domElement.addEventListener("contextmenu",this._onContextMenu),this.domElement.addEventListener("wheel",this._onMouseWheel,{passive:!1}),this.domElement.getRootNode().addEventListener("keydown",this._interceptControlDown,{passive:!0,capture:!0}),this.domElement.style.touchAction="none"}disconnect(){this.domElement.removeEventListener("pointerdown",this._onPointerDown),this.domElement.ownerDocument.removeEventListener("pointermove",this._onPointerMove),this.domElement.ownerDocument.removeEventListener("pointerup",this._onPointerUp),this.domElement.removeEventListener("pointercancel",this._onPointerUp),this.domElement.removeEventListener("wheel",this._onMouseWheel),this.domElement.removeEventListener("contextmenu",this._onContextMenu),this.stopListenToKeyEvents(),this.domElement.getRootNode().removeEventListener("keydown",this._interceptControlDown,{capture:!0}),this.domElement.style.touchAction="auto"}dispose(){this.disconnect()}getPolarAngle(){return this._spherical.phi}getAzimuthalAngle(){return this._spherical.theta}getDistance(){return this.object.position.distanceTo(this.target)}listenToKeyEvents(t){t.addEventListener("keydown",this._onKeyDown),this._domElementKeyEvents=t}stopListenToKeyEvents(){this._domElementKeyEvents!==null&&(this._domElementKeyEvents.removeEventListener("keydown",this._onKeyDown),this._domElementKeyEvents=null)}saveState(){this.target0.copy(this.target),this.position0.copy(this.object.position),this.zoom0=this.object.zoom}reset(){this.target.copy(this.target0),this.object.position.copy(this.position0),this.object.zoom=this.zoom0,this.object.updateProjectionMatrix(),this.dispatchEvent(Lv),this.update(),this.state=ke.NONE}pan(t,i){this._pan(t,i),this.update()}dollyIn(t){this._dollyIn(t),this.update()}dollyOut(t){this._dollyOut(t),this.update()}rotateLeft(t){this._rotateLeft(t),this.update()}rotateUp(t){this._rotateUp(t),this.update()}update(t=null){const i=this.object.position;_n.copy(i).sub(this.target),_n.applyQuaternion(this._quat),this._spherical.setFromVector3(_n),this.autoRotate&&this.state===ke.NONE&&this._rotateLeft(this._getAutoRotationAngle(t)),this.enableDamping?(this._spherical.theta+=this._sphericalDelta.theta*this.dampingFactor,this._spherical.phi+=this._sphericalDelta.phi*this.dampingFactor):(this._spherical.theta+=this._sphericalDelta.theta,this._spherical.phi+=this._sphericalDelta.phi);let s=this.minAzimuthAngle,l=this.maxAzimuthAngle;isFinite(s)&&isFinite(l)&&(s<-Math.PI?s+=Jn:s>Math.PI&&(s-=Jn),l<-Math.PI?l+=Jn:l>Math.PI&&(l-=Jn),s<=l?this._spherical.theta=Math.max(s,Math.min(l,this._spherical.theta)):this._spherical.theta=this._spherical.theta>(s+l)/2?Math.max(s,this._spherical.theta):Math.min(l,this._spherical.theta)),this._spherical.phi=Math.max(this.minPolarAngle,Math.min(this.maxPolarAngle,this._spherical.phi)),this._spherical.makeSafe(),this.enableDamping===!0?this.target.addScaledVector(this._panOffset,this.dampingFactor):this.target.add(this._panOffset),this.target.sub(this.cursor),this.target.clampLength(this.minTargetRadius,this.maxTargetRadius),this.target.add(this.cursor);let c=!1;if(this.zoomToCursor&&this._performCursorZoom||this.object.isOrthographicCamera)this._spherical.radius=this._clampDistance(this._spherical.radius);else{const h=this._spherical.radius;this._spherical.radius=this._clampDistance(this._spherical.radius*this._scale),c=h!=this._spherical.radius}if(_n.setFromSpherical(this._spherical),_n.applyQuaternion(this._quatInverse),i.copy(this.target).add(_n),this.object.lookAt(this.target),this.enableDamping===!0?(this._sphericalDelta.theta*=1-this.dampingFactor,this._sphericalDelta.phi*=1-this.dampingFactor,this._panOffset.multiplyScalar(1-this.dampingFactor)):(this._sphericalDelta.set(0,0,0),this._panOffset.set(0,0,0)),this.zoomToCursor&&this._performCursorZoom){let h=null;if(this.object.isPerspectiveCamera){const d=_n.length();h=this._clampDistance(d*this._scale);const m=d-h;this.object.position.addScaledVector(this._dollyDirection,m),this.object.updateMatrixWorld(),c=!!m}else if(this.object.isOrthographicCamera){const d=new j(this._mouse.x,this._mouse.y,0);d.unproject(this.object);const m=this.object.zoom;this.object.zoom=Math.max(this.minZoom,Math.min(this.maxZoom,this.object.zoom/this._scale)),this.object.updateProjectionMatrix(),c=m!==this.object.zoom;const p=new j(this._mouse.x,this._mouse.y,0);p.unproject(this.object),this.object.position.sub(p).add(d),this.object.updateMatrixWorld(),h=_n.length()}else console.warn("WARNING: OrbitControls.js encountered an unknown camera type - zoom to cursor disabled."),this.zoomToCursor=!1;h!==null&&(this.screenSpacePanning?this.target.set(0,0,-1).transformDirection(this.object.matrix).multiplyScalar(h).add(this.object.position):(ru.origin.copy(this.object.position),ru.direction.set(0,0,-1).transformDirection(this.object.matrix),Math.abs(this.object.up.dot(ru.direction))<DR?this.object.lookAt(this.target):(Nv.setFromNormalAndCoplanarPoint(this.object.up,this.target),ru.intersectPlane(Nv,this.target))))}else if(this.object.isOrthographicCamera){const h=this.object.zoom;this.object.zoom=Math.max(this.minZoom,Math.min(this.maxZoom,this.object.zoom/this._scale)),h!==this.object.zoom&&(this.object.updateProjectionMatrix(),c=!0)}return this._scale=1,this._performCursorZoom=!1,c||this._lastPosition.distanceToSquared(this.object.position)>Sd||8*(1-this._lastQuaternion.dot(this.object.quaternion))>Sd||this._lastTargetPosition.distanceToSquared(this.target)>Sd?(this.dispatchEvent(Lv),this._lastPosition.copy(this.object.position),this._lastQuaternion.copy(this.object.quaternion),this._lastTargetPosition.copy(this.target),!0):!1}_getAutoRotationAngle(t){return t!==null?Jn/60*this.autoRotateSpeed*t:Jn/60/60*this.autoRotateSpeed}_getZoomScale(t){const i=Math.abs(t*.01);return Math.pow(.95,this.zoomSpeed*i)}_rotateLeft(t){this._sphericalDelta.theta-=t}_rotateUp(t){this._sphericalDelta.phi-=t}_panLeft(t,i){_n.setFromMatrixColumn(i,0),_n.multiplyScalar(-t),this._panOffset.add(_n)}_panUp(t,i){this.screenSpacePanning===!0?_n.setFromMatrixColumn(i,1):(_n.setFromMatrixColumn(i,0),_n.crossVectors(this.object.up,_n)),_n.multiplyScalar(t),this._panOffset.add(_n)}_pan(t,i){const s=this.domElement;if(this.object.isPerspectiveCamera){const l=this.object.position;_n.copy(l).sub(this.target);let c=_n.length();c*=Math.tan(this.object.fov/2*Math.PI/180),this._panLeft(2*t*c/s.clientHeight,this.object.matrix),this._panUp(2*i*c/s.clientHeight,this.object.matrix)}else this.object.isOrthographicCamera?(this._panLeft(t*(this.object.right-this.object.left)/this.object.zoom/s.clientWidth,this.object.matrix),this._panUp(i*(this.object.top-this.object.bottom)/this.object.zoom/s.clientHeight,this.object.matrix)):(console.warn("WARNING: OrbitControls.js encountered an unknown camera type - pan disabled."),this.enablePan=!1)}_dollyOut(t){this.object.isPerspectiveCamera||this.object.isOrthographicCamera?this._scale/=t:(console.warn("WARNING: OrbitControls.js encountered an unknown camera type - dolly/zoom disabled."),this.enableZoom=!1)}_dollyIn(t){this.object.isPerspectiveCamera||this.object.isOrthographicCamera?this._scale*=t:(console.warn("WARNING: OrbitControls.js encountered an unknown camera type - dolly/zoom disabled."),this.enableZoom=!1)}_updateZoomParameters(t,i){if(!this.zoomToCursor)return;this._performCursorZoom=!0;const s=this.domElement.getBoundingClientRect(),l=t-s.left,c=i-s.top,h=s.width,d=s.height;this._mouse.x=l/h*2-1,this._mouse.y=-(c/d)*2+1,this._dollyDirection.set(this._mouse.x,this._mouse.y,1).unproject(this.object).sub(this.object.position).normalize()}_clampDistance(t){return Math.max(this.minDistance,Math.min(this.maxDistance,t))}_handleMouseDownRotate(t){this._rotateStart.set(t.clientX,t.clientY)}_handleMouseDownDolly(t){this._updateZoomParameters(t.clientX,t.clientX),this._dollyStart.set(t.clientX,t.clientY)}_handleMouseDownPan(t){this._panStart.set(t.clientX,t.clientY)}_handleMouseMoveRotate(t){this._rotateEnd.set(t.clientX,t.clientY),this._rotateDelta.subVectors(this._rotateEnd,this._rotateStart).multiplyScalar(this.rotateSpeed);const i=this.domElement;this._rotateLeft(Jn*this._rotateDelta.x/i.clientHeight),this._rotateUp(Jn*this._rotateDelta.y/i.clientHeight),this._rotateStart.copy(this._rotateEnd),this.update()}_handleMouseMoveDolly(t){this._dollyEnd.set(t.clientX,t.clientY),this._dollyDelta.subVectors(this._dollyEnd,this._dollyStart),this._dollyDelta.y>0?this._dollyOut(this._getZoomScale(this._dollyDelta.y)):this._dollyDelta.y<0&&this._dollyIn(this._getZoomScale(this._dollyDelta.y)),this._dollyStart.copy(this._dollyEnd),this.update()}_handleMouseMovePan(t){this._panEnd.set(t.clientX,t.clientY),this._panDelta.subVectors(this._panEnd,this._panStart).multiplyScalar(this.panSpeed),this._pan(this._panDelta.x,this._panDelta.y),this._panStart.copy(this._panEnd),this.update()}_handleMouseWheel(t){this._updateZoomParameters(t.clientX,t.clientY),t.deltaY<0?this._dollyIn(this._getZoomScale(t.deltaY)):t.deltaY>0&&this._dollyOut(this._getZoomScale(t.deltaY)),this.update()}_handleKeyDown(t){let i=!1;switch(t.code){case this.keys.UP:t.ctrlKey||t.metaKey||t.shiftKey?this.enableRotate&&this._rotateUp(Jn*this.keyRotateSpeed/this.domElement.clientHeight):this.enablePan&&this._pan(0,this.keyPanSpeed),i=!0;break;case this.keys.BOTTOM:t.ctrlKey||t.metaKey||t.shiftKey?this.enableRotate&&this._rotateUp(-Jn*this.keyRotateSpeed/this.domElement.clientHeight):this.enablePan&&this._pan(0,-this.keyPanSpeed),i=!0;break;case this.keys.LEFT:t.ctrlKey||t.metaKey||t.shiftKey?this.enableRotate&&this._rotateLeft(Jn*this.keyRotateSpeed/this.domElement.clientHeight):this.enablePan&&this._pan(this.keyPanSpeed,0),i=!0;break;case this.keys.RIGHT:t.ctrlKey||t.metaKey||t.shiftKey?this.enableRotate&&this._rotateLeft(-Jn*this.keyRotateSpeed/this.domElement.clientHeight):this.enablePan&&this._pan(-this.keyPanSpeed,0),i=!0;break}i&&(t.preventDefault(),this.update())}_handleTouchStartRotate(t){if(this._pointers.length===1)this._rotateStart.set(t.pageX,t.pageY);else{const i=this._getSecondPointerPosition(t),s=.5*(t.pageX+i.x),l=.5*(t.pageY+i.y);this._rotateStart.set(s,l)}}_handleTouchStartPan(t){if(this._pointers.length===1)this._panStart.set(t.pageX,t.pageY);else{const i=this._getSecondPointerPosition(t),s=.5*(t.pageX+i.x),l=.5*(t.pageY+i.y);this._panStart.set(s,l)}}_handleTouchStartDolly(t){const i=this._getSecondPointerPosition(t),s=t.pageX-i.x,l=t.pageY-i.y,c=Math.sqrt(s*s+l*l);this._dollyStart.set(0,c)}_handleTouchStartDollyPan(t){this.enableZoom&&this._handleTouchStartDolly(t),this.enablePan&&this._handleTouchStartPan(t)}_handleTouchStartDollyRotate(t){this.enableZoom&&this._handleTouchStartDolly(t),this.enableRotate&&this._handleTouchStartRotate(t)}_handleTouchMoveRotate(t){if(this._pointers.length==1)this._rotateEnd.set(t.pageX,t.pageY);else{const s=this._getSecondPointerPosition(t),l=.5*(t.pageX+s.x),c=.5*(t.pageY+s.y);this._rotateEnd.set(l,c)}this._rotateDelta.subVectors(this._rotateEnd,this._rotateStart).multiplyScalar(this.rotateSpeed);const i=this.domElement;this._rotateLeft(Jn*this._rotateDelta.x/i.clientHeight),this._rotateUp(Jn*this._rotateDelta.y/i.clientHeight),this._rotateStart.copy(this._rotateEnd)}_handleTouchMovePan(t){if(this._pointers.length===1)this._panEnd.set(t.pageX,t.pageY);else{const i=this._getSecondPointerPosition(t),s=.5*(t.pageX+i.x),l=.5*(t.pageY+i.y);this._panEnd.set(s,l)}this._panDelta.subVectors(this._panEnd,this._panStart).multiplyScalar(this.panSpeed),this._pan(this._panDelta.x,this._panDelta.y),this._panStart.copy(this._panEnd)}_handleTouchMoveDolly(t){const i=this._getSecondPointerPosition(t),s=t.pageX-i.x,l=t.pageY-i.y,c=Math.sqrt(s*s+l*l);this._dollyEnd.set(0,c),this._dollyDelta.set(0,Math.pow(this._dollyEnd.y/this._dollyStart.y,this.zoomSpeed)),this._dollyOut(this._dollyDelta.y),this._dollyStart.copy(this._dollyEnd);const h=(t.pageX+i.x)*.5,d=(t.pageY+i.y)*.5;this._updateZoomParameters(h,d)}_handleTouchMoveDollyPan(t){this.enableZoom&&this._handleTouchMoveDolly(t),this.enablePan&&this._handleTouchMovePan(t)}_handleTouchMoveDollyRotate(t){this.enableZoom&&this._handleTouchMoveDolly(t),this.enableRotate&&this._handleTouchMoveRotate(t)}_addPointer(t){this._pointers.push(t.pointerId)}_removePointer(t){delete this._pointerPositions[t.pointerId];for(let i=0;i<this._pointers.length;i++)if(this._pointers[i]==t.pointerId){this._pointers.splice(i,1);return}}_isTrackingPointer(t){for(let i=0;i<this._pointers.length;i++)if(this._pointers[i]==t.pointerId)return!0;return!1}_trackPointer(t){let i=this._pointerPositions[t.pointerId];i===void 0&&(i=new le,this._pointerPositions[t.pointerId]=i),i.set(t.pageX,t.pageY)}_getSecondPointerPosition(t){const i=t.pointerId===this._pointers[0]?this._pointers[1]:this._pointers[0];return this._pointerPositions[i]}_customWheelEvent(t){const i=t.deltaMode,s={clientX:t.clientX,clientY:t.clientY,deltaY:t.deltaY};switch(i){case 1:s.deltaY*=16;break;case 2:s.deltaY*=100;break}return t.ctrlKey&&!this._controlActive&&(s.deltaY*=10),s}}function LR(r){this.enabled!==!1&&(this._pointers.length===0&&(this.domElement.setPointerCapture(r.pointerId),this.domElement.ownerDocument.addEventListener("pointermove",this._onPointerMove),this.domElement.ownerDocument.addEventListener("pointerup",this._onPointerUp)),!this._isTrackingPointer(r)&&(this._addPointer(r),r.pointerType==="touch"?this._onTouchStart(r):this._onMouseDown(r),this._cursorStyle==="grab"&&(this.domElement.style.cursor="grabbing")))}function NR(r){this.enabled!==!1&&(r.pointerType==="touch"?this._onTouchMove(r):this._onMouseMove(r))}function OR(r){switch(this._removePointer(r),this._pointers.length){case 0:this.domElement.releasePointerCapture(r.pointerId),this.domElement.ownerDocument.removeEventListener("pointermove",this._onPointerMove),this.domElement.ownerDocument.removeEventListener("pointerup",this._onPointerUp),this.dispatchEvent(bx),this.state=ke.NONE,this._cursorStyle==="grab"&&(this.domElement.style.cursor="grab");break;case 1:const t=this._pointers[0],i=this._pointerPositions[t];this._onTouchStart({pointerId:t,pageX:i.x,pageY:i.y});break}}function PR(r){let t;switch(r.button){case 0:t=this.mouseButtons.LEFT;break;case 1:t=this.mouseButtons.MIDDLE;break;case 2:t=this.mouseButtons.RIGHT;break;default:t=-1}switch(t){case to.DOLLY:if(this.enableZoom===!1)return;this._handleMouseDownDolly(r),this.state=ke.DOLLY;break;case to.ROTATE:if(r.ctrlKey||r.metaKey||r.shiftKey){if(this.enablePan===!1)return;this._handleMouseDownPan(r),this.state=ke.PAN}else{if(this.enableRotate===!1)return;this._handleMouseDownRotate(r),this.state=ke.ROTATE}break;case to.PAN:if(r.ctrlKey||r.metaKey||r.shiftKey){if(this.enableRotate===!1)return;this._handleMouseDownRotate(r),this.state=ke.ROTATE}else{if(this.enablePan===!1)return;this._handleMouseDownPan(r),this.state=ke.PAN}break;default:this.state=ke.NONE}this.state!==ke.NONE&&this.dispatchEvent(Ip)}function zR(r){switch(this.state){case ke.ROTATE:if(this.enableRotate===!1)return;this._handleMouseMoveRotate(r);break;case ke.DOLLY:if(this.enableZoom===!1)return;this._handleMouseMoveDolly(r);break;case ke.PAN:if(this.enablePan===!1)return;this._handleMouseMovePan(r);break}}function IR(r){this.enabled===!1||this.enableZoom===!1||this.state!==ke.NONE||(r.preventDefault(),this.dispatchEvent(Ip),this._handleMouseWheel(this._customWheelEvent(r)),this.dispatchEvent(bx))}function FR(r){this.enabled!==!1&&this._handleKeyDown(r)}function BR(r){switch(this._trackPointer(r),this._pointers.length){case 1:switch(this.touches.ONE){case $r.ROTATE:if(this.enableRotate===!1)return;this._handleTouchStartRotate(r),this.state=ke.TOUCH_ROTATE;break;case $r.PAN:if(this.enablePan===!1)return;this._handleTouchStartPan(r),this.state=ke.TOUCH_PAN;break;default:this.state=ke.NONE}break;case 2:switch(this.touches.TWO){case $r.DOLLY_PAN:if(this.enableZoom===!1&&this.enablePan===!1)return;this._handleTouchStartDollyPan(r),this.state=ke.TOUCH_DOLLY_PAN;break;case $r.DOLLY_ROTATE:if(this.enableZoom===!1&&this.enableRotate===!1)return;this._handleTouchStartDollyRotate(r),this.state=ke.TOUCH_DOLLY_ROTATE;break;default:this.state=ke.NONE}break;default:this.state=ke.NONE}this.state!==ke.NONE&&this.dispatchEvent(Ip)}function HR(r){switch(this._trackPointer(r),this.state){case ke.TOUCH_ROTATE:if(this.enableRotate===!1)return;this._handleTouchMoveRotate(r),this.update();break;case ke.TOUCH_PAN:if(this.enablePan===!1)return;this._handleTouchMovePan(r),this.update();break;case ke.TOUCH_DOLLY_PAN:if(this.enableZoom===!1&&this.enablePan===!1)return;this._handleTouchMoveDollyPan(r),this.update();break;case ke.TOUCH_DOLLY_ROTATE:if(this.enableZoom===!1&&this.enableRotate===!1)return;this._handleTouchMoveDollyRotate(r),this.update();break;default:this.state=ke.NONE}}function GR(r){this.enabled!==!1&&r.preventDefault()}function VR(r){r.key==="Control"&&(this._controlActive=!0,this.domElement.getRootNode().addEventListener("keyup",this._interceptControlUp,{passive:!0,capture:!0}))}function kR(r){r.key==="Control"&&(this._controlActive=!1,this.domElement.getRootNode().removeEventListener("keyup",this._interceptControlUp,{passive:!0,capture:!0}))}const Ov=new ys,ou=new j;class Tx extends wE{constructor(){super(),this.isLineSegmentsGeometry=!0,this.type="LineSegmentsGeometry";const t=[-1,2,0,1,2,0,-1,1,0,1,1,0,-1,0,0,1,0,0,-1,-1,0,1,-1,0],i=[-1,2,1,2,-1,1,1,1,-1,-1,1,-1,-1,-2,1,-2],s=[0,2,1,2,3,1,2,4,3,4,5,3,4,6,5,6,7,5];this.setIndex(s),this.setAttribute("position",new Mn(t,3)),this.setAttribute("uv",new Mn(i,2))}applyMatrix4(t){const i=this.attributes.instanceStart,s=this.attributes.instanceEnd;return i!==void 0&&(i.applyMatrix4(t),s.applyMatrix4(t),i.needsUpdate=!0),this.boundingBox!==null&&this.computeBoundingBox(),this.boundingSphere!==null&&this.computeBoundingSphere(),this}setPositions(t){let i;t instanceof Float32Array?i=t:Array.isArray(t)&&(i=new Float32Array(t));const s=new pp(i,6,1);return this.setAttribute("instanceStart",new _s(s,3,0)),this.setAttribute("instanceEnd",new _s(s,3,3)),this.instanceCount=this.attributes.instanceStart.count,this.computeBoundingBox(),this.computeBoundingSphere(),this}setColors(t){let i;t instanceof Float32Array?i=t:Array.isArray(t)&&(i=new Float32Array(t));const s=new pp(i,6,1);return this.setAttribute("instanceColorStart",new _s(s,3,0)),this.setAttribute("instanceColorEnd",new _s(s,3,3)),this}fromWireframeGeometry(t){return this.setPositions(t.attributes.position.array),this}fromEdgesGeometry(t){return this.setPositions(t.attributes.position.array),this}fromMesh(t){return this.fromWireframeGeometry(new _E(t.geometry)),this}fromLineSegments(t){const i=t.geometry;return this.setPositions(i.attributes.position.array),this}computeBoundingBox(){this.boundingBox===null&&(this.boundingBox=new ys);const t=this.attributes.instanceStart,i=this.attributes.instanceEnd;t!==void 0&&i!==void 0&&(this.boundingBox.setFromBufferAttribute(t),Ov.setFromBufferAttribute(i),this.boundingBox.union(Ov))}computeBoundingSphere(){this.boundingSphere===null&&(this.boundingSphere=new lo),this.boundingBox===null&&this.computeBoundingBox();const t=this.attributes.instanceStart,i=this.attributes.instanceEnd;if(t!==void 0&&i!==void 0){const s=this.boundingSphere.center;this.boundingBox.getCenter(s);let l=0;for(let c=0,h=t.count;c<h;c++)ou.fromBufferAttribute(t,c),l=Math.max(l,s.distanceToSquared(ou)),ou.fromBufferAttribute(i,c),l=Math.max(l,s.distanceToSquared(ou));this.boundingSphere.radius=Math.sqrt(l),isNaN(this.boundingSphere.radius)&&console.error("THREE.LineSegmentsGeometry.computeBoundingSphere(): Computed radius is NaN. The instanced position data is likely to have NaN values.",this)}}toJSON(){}}Lt.line={worldUnits:{value:1},linewidth:{value:1},resolution:{value:new le(1,1)},dashOffset:{value:0},dashScale:{value:1},dashSize:{value:1},gapSize:{value:1}};$n.line={uniforms:zp.merge([Lt.common,Lt.fog,Lt.line]),vertexShader:`
4058
4058
  #include <common>
4059
4059
  #include <color_pars_vertex>
4060
4060
  #include <fog_pars_vertex>
@@ -4423,4 +4423,4 @@ void main() {
4423
4423
  #include <premultiplied_alpha_fragment>
4424
4424
 
4425
4425
  }
4426
- `};class Ip extends Xi{constructor(t){super({type:"LineMaterial",uniforms:Pp.clone(ni.line.uniforms),vertexShader:ni.line.vertexShader,fragmentShader:ni.line.fragmentShader,clipping:!0}),this.isLineMaterial=!0,this.setValues(t)}get color(){return this.uniforms.diffuse.value}set color(t){this.uniforms.diffuse.value=t}get worldUnits(){return"WORLD_UNITS"in this.defines}set worldUnits(t){t===!0!==this.worldUnits&&(this.needsUpdate=!0),t===!0?this.defines.WORLD_UNITS="":delete this.defines.WORLD_UNITS}get linewidth(){return this.uniforms.linewidth.value}set linewidth(t){this.uniforms.linewidth&&(this.uniforms.linewidth.value=t)}get dashed(){return"USE_DASH"in this.defines}set dashed(t){t===!0!==this.dashed&&(this.needsUpdate=!0),t===!0?this.defines.USE_DASH="":delete this.defines.USE_DASH}get dashScale(){return this.uniforms.dashScale.value}set dashScale(t){this.uniforms.dashScale.value=t}get dashSize(){return this.uniforms.dashSize.value}set dashSize(t){this.uniforms.dashSize.value=t}get dashOffset(){return this.uniforms.dashOffset.value}set dashOffset(t){this.uniforms.dashOffset.value=t}get gapSize(){return this.uniforms.gapSize.value}set gapSize(t){this.uniforms.gapSize.value=t}get opacity(){return this.uniforms.opacity.value}set opacity(t){this.uniforms&&(this.uniforms.opacity.value=t)}get resolution(){return this.uniforms.resolution.value}set resolution(t){this.uniforms.resolution.value.copy(t)}get alphaToCoverage(){return"USE_ALPHA_TO_COVERAGE"in this.defines}set alphaToCoverage(t){this.defines&&(t===!0!==this.alphaToCoverage&&(this.needsUpdate=!0),t===!0?this.defines.USE_ALPHA_TO_COVERAGE="":delete this.defines.USE_ALPHA_TO_COVERAGE)}}const xd=new We,Ov=new j,Pv=new j,Dn=new We,Un=new We,Ji=new We,Sd=new j,yd=new Je,Ln=new UE,zv=new j,ru=new ys,ou=new ro,$i=new We;let ta,Ks;function Iv(r,t,i){return $i.set(0,0,-t,1).applyMatrix4(r.projectionMatrix),$i.multiplyScalar(1/$i.w),$i.x=Ks/i.width,$i.y=Ks/i.height,$i.applyMatrix4(r.projectionMatrixInverse),$i.multiplyScalar(1/$i.w),Math.abs(Math.max($i.x,$i.y))}function GR(r,t){const i=r.matrixWorld,s=r.geometry,l=s.attributes.instanceStart,c=s.attributes.instanceEnd,h=Math.min(s.instanceCount,l.count);for(let d=0,m=h;d<m;d++){Ln.start.fromBufferAttribute(l,d),Ln.end.fromBufferAttribute(c,d),Ln.applyMatrix4(i);const p=new j,v=new j;ta.distanceSqToSegment(Ln.start,Ln.end,v,p),v.distanceTo(p)<Ks*.5&&t.push({point:v,pointOnLine:p,distance:ta.origin.distanceTo(v),object:r,face:null,faceIndex:d,uv:null,uv1:null})}}function VR(r,t,i){const s=t.projectionMatrix,c=r.material.resolution,h=r.matrixWorld,d=r.geometry,m=d.attributes.instanceStart,p=d.attributes.instanceEnd,v=Math.min(d.instanceCount,m.count),g=-t.near;ta.at(1,Ji),Ji.w=1,Ji.applyMatrix4(t.matrixWorldInverse),Ji.applyMatrix4(s),Ji.multiplyScalar(1/Ji.w),Ji.x*=c.x/2,Ji.y*=c.y/2,Ji.z=0,Sd.copy(Ji),yd.multiplyMatrices(t.matrixWorldInverse,h);for(let _=0,M=v;_<M;_++){if(Dn.fromBufferAttribute(m,_),Un.fromBufferAttribute(p,_),Dn.w=1,Un.w=1,Dn.applyMatrix4(yd),Un.applyMatrix4(yd),Dn.z>g&&Un.z>g)continue;if(Dn.z>g){const D=Dn.z-Un.z,U=(Dn.z-g)/D;Dn.lerp(Un,U)}else if(Un.z>g){const D=Un.z-Dn.z,U=(Un.z-g)/D;Un.lerp(Dn,U)}Dn.applyMatrix4(s),Un.applyMatrix4(s),Dn.multiplyScalar(1/Dn.w),Un.multiplyScalar(1/Un.w),Dn.x*=c.x/2,Dn.y*=c.y/2,Un.x*=c.x/2,Un.y*=c.y/2,Ln.start.copy(Dn),Ln.start.z=0,Ln.end.copy(Un),Ln.end.z=0;const A=Ln.closestPointToPointParameter(Sd,!0);Ln.at(A,zv);const x=rx.lerp(Dn.z,Un.z,A),y=x>=-1&&x<=1,w=Sd.distanceTo(zv)<Ks*.5;if(y&&w){Ln.start.fromBufferAttribute(m,_),Ln.end.fromBufferAttribute(p,_),Ln.start.applyMatrix4(h),Ln.end.applyMatrix4(h);const D=new j,U=new j;ta.distanceSqToSegment(Ln.start,Ln.end,U,D),i.push({point:U,pointOnLine:D,distance:ta.origin.distanceTo(U),object:r,face:null,faceIndex:_,uv:null,uv1:null})}}}class kR extends _i{constructor(t=new bx,i=new Ip({color:Math.random()*16777215})){super(t,i),this.isLineSegments2=!0,this.type="LineSegments2"}computeLineDistances(){const t=this.geometry,i=t.attributes.instanceStart,s=t.attributes.instanceEnd,l=new Float32Array(2*i.count);for(let h=0,d=0,m=i.count;h<m;h++,d+=2)Ov.fromBufferAttribute(i,h),Pv.fromBufferAttribute(s,h),l[d]=d===0?0:l[d-1],l[d+1]=l[d]+Ov.distanceTo(Pv);const c=new hp(l,2,1);return t.setAttribute("instanceDistanceStart",new _s(c,1,0)),t.setAttribute("instanceDistanceEnd",new _s(c,1,1)),this}raycast(t,i){const s=this.material.worldUnits,l=t.camera;l===null&&!s&&console.error('LineSegments2: "Raycaster.camera" needs to be set in order to raycast against LineSegments2 while worldUnits is set to false.');const c=t.params.Line2!==void 0&&t.params.Line2.threshold||0;ta=t.ray;const h=this.matrixWorld,d=this.geometry,m=this.material;Ks=m.linewidth+c,d.boundingSphere===null&&d.computeBoundingSphere(),ou.copy(d.boundingSphere).applyMatrix4(h);let p;if(s)p=Ks*.5;else{const g=Math.max(l.near,ou.distanceToPoint(ta.origin));p=Iv(l,g,m.resolution)}if(ou.radius+=p,ta.intersectsSphere(ou)===!1)return;d.boundingBox===null&&d.computeBoundingBox(),ru.copy(d.boundingBox).applyMatrix4(h);let v;if(s)v=Ks*.5;else{const g=Math.max(l.near,ru.distanceToPoint(ta.origin));v=Iv(l,g,m.resolution)}ru.expandByScalar(v),ta.intersectsBox(ru)!==!1&&(s?GR(this,i):VR(this,l,i))}onBeforeRender(t){const i=this.material.uniforms;i&&i.resolution&&(t.getViewport(xd),this.material.uniforms.resolution.value.set(xd.z,xd.w))}}class Tx extends bx{constructor(){super(),this.isLineGeometry=!0,this.type="LineGeometry"}setPositions(t){const i=t.length-3,s=new Float32Array(2*i);for(let l=0;l<i;l+=3)s[2*l]=t[l],s[2*l+1]=t[l+1],s[2*l+2]=t[l+2],s[2*l+3]=t[l+3],s[2*l+4]=t[l+4],s[2*l+5]=t[l+5];return super.setPositions(s),this}setColors(t){const i=t.length-3,s=new Float32Array(2*i);for(let l=0;l<i;l+=3)s[2*l]=t[l],s[2*l+1]=t[l+1],s[2*l+2]=t[l+2],s[2*l+3]=t[l+3],s[2*l+4]=t[l+4],s[2*l+5]=t[l+5];return super.setColors(s),this}setFromPoints(t){const i=t.length-1,s=new Float32Array(6*i);for(let l=0;l<i;l++)s[6*l]=t[l].x,s[6*l+1]=t[l].y,s[6*l+2]=t[l].z||0,s[6*l+3]=t[l+1].x,s[6*l+4]=t[l+1].y,s[6*l+5]=t[l+1].z||0;return super.setPositions(s),this}fromLine(t){const i=t.geometry;return this.setPositions(i.attributes.position.array),this}}class XR extends kR{constructor(t=new Tx,i=new Ip({color:Math.random()*16777215})){super(t,i),this.isLine2=!0,this.type="Line2"}}const Fi=[[.2422,.1504,.6603],[.281,.3228,.9579],[.1786,.5289,.9682],[.0689,.6948,.8394],[.128,.789,.5927],[.3391,.849,.3798],[.633,.8518,.2091],[.8902,.8044,.1137],[.9905,.6816,.0235],[.9763,.517,.034]];function WR(r){const i=Math.max(0,Math.min(1,r))*(Fi.length-1),s=Math.floor(i),l=Math.min(s+1,Fi.length-1),c=i-s;return[Fi[s][0]+c*(Fi[l][0]-Fi[s][0]),Fi[s][1]+c*(Fi[l][1]-Fi[s][1]),Fi[s][2]+c*(Fi[l][2]-Fi[s][2])]}const Fv=[[0,.447,.741],[.85,.325,.098],[.929,.694,.125],[.494,.184,.556],[.466,.674,.188],[.301,.745,.933],[.635,.078,.184]];function qR({surfTraces:r,plot3Traces:t=[],shading:i}){const s=Yn.useRef(null),l=Yn.useRef(null);return Yn.useEffect(()=>{const c=s.current;if(!c)return;const h=new AR({antialias:!0});h.setPixelRatio(window.devicePixelRatio),h.setClearColor(16777215),c.appendChild(h.domElement);const d=new nE,m=new Tu(-1,1,1,-1,.01,100);m.position.set(1.2,.8,1.2),m.lookAt(0,0,0);const p=new CR(m,h.domElement);p.enablePan=!1,p.enableZoom=!0,d.add(new TE(16777215,.6));const v=new bE(16777215,.6);v.position.set(2,3,2),d.add(v);const g=requestAnimationFrame(function M(){p.update(),h.render(d,m),l.current.animId=requestAnimationFrame(M)});l.current={renderer:h,scene:d,camera:m,controls:p,animId:g};const _=new ResizeObserver(()=>{const M=c.getBoundingClientRect();if(M.width===0||M.height===0)return;h.setSize(M.width,M.height);const E=M.width/M.height,A=1.2;m.left=-A*E,m.right=A*E,m.top=A,m.bottom=-A,m.updateProjectionMatrix()});return _.observe(c),()=>{_.disconnect(),cancelAnimationFrame(l.current?.animId??g),p.dispose(),h.dispose(),c.removeChild(h.domElement),l.current=null}},[]),Yn.useEffect(()=>{const c=l.current;if(!c)return;const{scene:h}=c,d=[];h.traverse(Q=>{(Q instanceof _i||Q instanceof J_||Q instanceof Mu)&&d.push(Q)});for(const Q of d)h.remove(Q),Q.geometry&&Q.geometry.dispose();if(r.length===0&&t.length===0)return;let m=1/0,p=-1/0,v=1/0,g=-1/0,_=1/0,M=-1/0;const E=(Q,P,W)=>{for(const J of Q)isFinite(J)&&(J<P.v&&(P.v=J),J>W.v&&(W.v=J))},A={v:m},x={v:p},y={v},w={v:g},D={v:_},U={v:M};for(const Q of r)E(Q.x,A,x),E(Q.y,y,w),E(Q.z,D,U);for(const Q of t)E(Q.x,A,x),E(Q.y,y,w),E(Q.z,D,U);if(m=A.v,p=x.v,v=y.v,g=w.v,_=D.v,M=U.v,!isFinite(m))return;p===m&&(m-=1,p+=1),g===v&&(v-=1,g+=1),M===_&&(_-=1,M+=1);const H=Math.max(p-m,g-v,M-_),F=(m+p)/2,I=(v+g)/2,T=(_+M)/2,L=(Q,P)=>(Q-P)/H;for(const Q of r){const{rows:P,cols:W,x:J,y:rt,z:et}=Q,O=M-_||1,B=Q.faceAlpha??1,at=new Float32Array(P*W*3),$=new Float32Array(P*W*3);for(let Z=0;Z<W;Z++)for(let dt=0;dt<P;dt++){const yt=Z*P+dt,Ut=dt*W+Z,Ft=L(J[yt],F),Xt=L(rt[yt],I),ge=L(et[yt],T);at[Ut*3]=Ft,at[Ut*3+1]=ge,at[Ut*3+2]=Xt;const Jt=Q.c?(Q.c[yt]-_)/O:(et[yt]-_)/O,[_e,Te,ae]=WR(Jt);$[Ut*3]=_e,$[Ut*3+1]=Te,$[Ut*3+2]=ae}const lt=[];for(let Z=0;Z<P-1;Z++)for(let dt=0;dt<W-1;dt++){const yt=Z*W+dt,Ut=Z*W+(dt+1),Ft=(Z+1)*W+dt,Xt=(Z+1)*W+(dt+1);lt.push(yt,Ft,Ut),lt.push(Ut,Ft,Xt)}const N=new Pn;N.setAttribute("position",new gi(at,3)),N.setAttribute("color",new gi($,3)),N.setIndex(lt),N.computeVertexNormals();const k=i??"faceted",ut=k==="faceted"||k==="flat";if(Q.faceColor!=="none"){let Z;if(Array.isArray(Q.faceColor)){const[dt,yt,Ut]=Q.faceColor;Z=new tv({color:new Se(dt,yt,Ut),flatShading:ut,opacity:B,transparent:B<1,side:Hi})}else Z=new tv({vertexColors:!0,flatShading:ut,opacity:B,transparent:B<1,side:Hi});h.add(new _i(N,Z))}if(Q.edgeColor!=="none"&&k==="faceted"){const Z=[],dt=[];for(let Ft=0;Ft<P;Ft++)for(let Xt=0;Xt<W;Xt++){const ge=Ft*W+Xt;if(Xt<W-1){const Jt=Ft*W+(Xt+1);Z.push(at[ge*3],at[ge*3+1],at[ge*3+2],at[Jt*3],at[Jt*3+1],at[Jt*3+2]),dt.push($[ge*3],$[ge*3+1],$[ge*3+2],$[Jt*3],$[Jt*3+1],$[Jt*3+2])}if(Ft<P-1){const Jt=(Ft+1)*W+Xt;Z.push(at[ge*3],at[ge*3+1],at[ge*3+2],at[Jt*3],at[Jt*3+1],at[Jt*3+2]),dt.push($[ge*3],$[ge*3+1],$[ge*3+2],$[Jt*3],$[Jt*3+1],$[Jt*3+2])}}const yt=new Pn;yt.setAttribute("position",new Tn(Z,3));let Ut;if(Array.isArray(Q.edgeColor)){const[Ft,Xt,ge]=Q.edgeColor;Ut=new gl({color:new Se(Ft,Xt,ge)})}else Ut=new gl({color:0,opacity:.3,transparent:!0});h.add(new J_(yt,Ut))}}for(let Q=0;Q<t.length;Q++){const P=t[Q],{x:W,y:J,z:rt}=P,et=Fv[Q%Fv.length],O=P.color??et,B=new Se(O[0],O[1],O[2]);if(P.lineStyle!=="none"){const $=[];let lt=[];for(let ut=0;ut<W.length;ut++)if(isFinite(W[ut])&&isFinite(J[ut])&&isFinite(rt[ut])){const vt=L(W[ut],F),Rt=L(J[ut],I),Z=L(rt[ut],T);lt.push(new j(vt,Z,Rt))}else lt.length>0&&($.push(lt),lt=[]);lt.length>0&&$.push(lt);const N=P.lineWidth??2,k=P.lineStyle==="--"||P.lineStyle===":"||P.lineStyle==="-.";for(const ut of $){if(ut.length<2)continue;const vt=[];for(const Rt of ut)vt.push(Rt.x,Rt.y,Rt.z);if(k){const Rt=new yE({color:B,linewidth:N,dashSize:P.lineStyle===":"?.01:.03,gapSize:P.lineStyle===":"?.02:.015}),Z=new Pn().setFromPoints(ut),dt=new Mu(Z,Rt);dt.computeLineDistances(),h.add(dt)}else{const Rt=new Tx;Rt.setPositions(vt);const Z=new Ip({color:B.getHex(),linewidth:N,worldUnits:!1,resolution:new le(c.renderer.domElement.width||800,c.renderer.domElement.height||600)});h.add(new XR(Rt,Z))}}}if(P.marker&&P.marker!=="none"){const $=(P.markerSize??6)/600,lt=P.markerEdgeColor?new Se(P.markerEdgeColor[0],P.markerEdgeColor[1],P.markerEdgeColor[2]):B,N=P.markerIndices?P.markerIndices.map(vt=>vt-1):Array.from({length:W.length},(vt,Rt)=>Rt),k=new Op($,8,8),ut=new Lp({color:lt});for(const vt of N){if(vt<0||vt>=W.length||!isFinite(W[vt])||!isFinite(J[vt])||!isFinite(rt[vt]))continue;const Rt=L(W[vt],F),Z=L(J[vt],I),dt=L(rt[vt],T),yt=new _i(k,ut);yt.position.set(Rt,dt,Z),h.add(yt)}}}YR(h,m,p,v,g,_,M,H,F,I,T)},[r,t,i]),sn.jsx("div",{ref:s,style:{width:"100%",height:"100%"}})}function YR(r,t,i,s,l,c,h,d,m,p,v){const g=(E,A)=>(E-A)/d,_=[{from:[t,s,c],to:[i,s,c]},{from:[t,s,c],to:[t,l,c]},{from:[t,s,c],to:[t,s,h]}],M=new gl({color:3355443});for(const E of _){const A=[E.from,E.to].map(([y,w,D])=>{const U=g(y,m),H=g(w,p),F=g(D,v);return new j(U,F,H)}),x=new Pn().setFromPoints(A);r.add(new Mu(x,M))}}const Bv=["#0072BD","#D95319","#EDB120","#7E2F8E","#77AC30","#4DBEEE","#A2142F"];function mp(r){return`rgb(${Math.round(r[0]*255)}, ${Math.round(r[1]*255)}, ${Math.round(r[2]*255)})`}function Ax(r,t){return r.color?mp(r.color):Bv[t%Bv.length]}function Rx(r){switch(r){case"--":return[8,4];case":":return[2,4];case"-.":return[8,4,2,4];default:return[]}}function jR(r,t){const i=r/t,s=Math.pow(10,Math.floor(Math.log10(i))),l=i/s;let c;return l<=1.5?c=1:l<=3.5?c=2:l<=7.5?c=5:c=10,c*s}function lu(r,t,i){const s=jR(t-r,i),l=[],c=Math.ceil(r/s)*s;for(let h=c;h<=t+s*.001;h+=s)l.push(h);return l}function Hv(r){return Math.abs(r)<1e-10?"0":Math.abs(r)>=1e4||Math.abs(r)<.01&&r!==0?r.toExponential(1):parseFloat(r.toPrecision(6)).toString()}function ZR(r,t,i,s,l){if(!t.marker||t.marker==="none")return;const c=(t.markerSize??6)/2,h=t.markerEdgeColor?mp(t.markerEdgeColor):l,d=t.markerFaceColor?mp(t.markerFaceColor):void 0,m=t.markerIndices?t.markerIndices.map(p=>p-1):Array.from({length:t.x.length},(p,v)=>v);r.lineWidth=1.5;for(const p of m){if(p<0||p>=t.x.length)continue;const v=t.x[p],g=t.y[p];if(!isFinite(v)||!isFinite(g))continue;const _=i(v),M=s(g);KR(r,t.marker,_,M,c,h,d)}}function KR(r,t,i,s,l,c,h){switch(r.strokeStyle=c,r.fillStyle=h??"transparent",t){case"o":{r.beginPath(),r.arc(i,s,l,0,Math.PI*2),h&&r.fill(),r.stroke();break}case"+":{r.beginPath(),r.moveTo(i-l,s),r.lineTo(i+l,s),r.moveTo(i,s-l),r.lineTo(i,s+l),r.stroke();break}case"*":{r.beginPath();for(let d=0;d<6;d++){const m=d*Math.PI/3;r.moveTo(i,s),r.lineTo(i+l*Math.cos(m),s+l*Math.sin(m))}r.stroke();break}case".":{r.beginPath(),r.arc(i,s,Math.max(l/3,1.5),0,Math.PI*2),r.fillStyle=c,r.fill();break}case"x":{const d=l*.707;r.beginPath(),r.moveTo(i-d,s-d),r.lineTo(i+d,s+d),r.moveTo(i+d,s-d),r.lineTo(i-d,s+d),r.stroke();break}case"_":{r.beginPath(),r.moveTo(i-l,s),r.lineTo(i+l,s),r.stroke();break}case"|":{r.beginPath(),r.moveTo(i,s-l),r.lineTo(i,s+l),r.stroke();break}case"s":{r.beginPath(),r.rect(i-l,s-l,l*2,l*2),h&&r.fill(),r.stroke();break}case"d":{r.beginPath(),r.moveTo(i,s-l),r.lineTo(i+l,s),r.lineTo(i,s+l),r.lineTo(i-l,s),r.closePath(),h&&r.fill(),r.stroke();break}case"^":{cu(r,i,s,l,0,h);break}case"v":{cu(r,i,s,l,Math.PI,h);break}case"<":{cu(r,i,s,l,-Math.PI/2,h);break}case">":{cu(r,i,s,l,Math.PI/2,h);break}case"p":{Gv(r,i,s,l,5,h);break}case"h":{Gv(r,i,s,l,6,h);break}}}function cu(r,t,i,s,l,c){r.beginPath();for(let h=0;h<3;h++){const d=l-Math.PI/2+h*2*Math.PI/3,m=t+s*Math.cos(d),p=i+s*Math.sin(d);h===0?r.moveTo(m,p):r.lineTo(m,p)}r.closePath(),c&&r.fill(),r.stroke()}function Gv(r,t,i,s,l,c){const h=s*.4;r.beginPath();for(let d=0;d<l*2;d++){const m=-Math.PI/2+d*Math.PI/l,p=d%2===0?s:h,v=t+p*Math.cos(m),g=i+p*Math.sin(m);d===0?r.moveTo(v,g):r.lineTo(v,g)}r.closePath(),c&&r.fill(),r.stroke()}function QR(r,t,i,s,l){r.font="11px sans-serif";let v=0;for(const A of i){const x=r.measureText(A).width;x>v&&(v=x)}const g=34+v+8,_=8+i.length*17+8,M=s-g-8,E=l+8;r.fillStyle="rgba(255,255,255,0.9)",r.fillRect(M,E,g,_),r.strokeStyle="#999",r.lineWidth=.5,r.strokeRect(M,E,g,_);for(let A=0;A<i.length;A++){const x=A<t.length?Ax(t[A],A):"#333",y=A<t.length?t[A].lineWidth??2:2,w=A<t.length?t[A].lineStyle:void 0,D=E+8+A*17+17/2;r.strokeStyle=x,r.lineWidth=y,r.setLineDash(Rx(w)),r.beginPath(),r.moveTo(M+8,D),r.lineTo(M+8+20,D),r.stroke(),r.setLineDash([]),r.fillStyle="#333",r.font="11px sans-serif",r.textAlign="left",r.textBaseline="middle",r.fillText(i[A],M+8+20+6,D)}}function JR(r,t,i,s,l,c,h,d,m,p,v){const g=r.getContext("2d"),_=t.length>0||d!==void 0||m&&m.length>0;if(!g||!_)return;const M=window.devicePixelRatio||1,E=r.width,A=r.height;g.setTransform(M,0,0,M,0,0);const x=E/M,y=A/M;g.fillStyle="#fff",g.fillRect(0,0,x,y);const w={top:i?40:20,right:20,bottom:s?56:40,left:l?76:60},D=x-w.left-w.right,U=y-w.top-w.bottom;if(D<=0||U<=0)return;let H=1/0,F=-1/0,I=1/0,T=-1/0;for(const $ of t){for(const lt of $.x)isFinite(lt)&&(lt<H&&(H=lt),lt>F&&(F=lt));for(const lt of $.y)isFinite(lt)&&(lt<I&&(I=lt),lt>T&&(T=lt))}if(d&&(d.x[0]<H&&(H=d.x[0]),d.x[1]>F&&(F=d.x[1]),d.y[0]<I&&(I=d.y[0]),d.y[1]>T&&(T=d.y[1])),m)for(const $ of m){for(const lt of $.x)isFinite(lt)&&(lt<H&&(H=lt),lt>F&&(F=lt));for(const lt of $.y)isFinite(lt)&&(lt<I&&(I=lt),lt>T&&(T=lt))}if(!isFinite(H))return;F===H&&(H-=1,F+=1),T===I&&(I-=1,T+=1);const L=v?.includes("tight")??!1,Q=v?.includes("equal")??!1;if(!L){const $=(F-H)*.05,lt=(T-I)*.05;H-=$,F+=$,I-=lt,T+=lt}let P=D,W=U,J=w.left,rt=w.top;if(Q){const $=F-H,lt=T-I,N=$/D,k=lt/U;if(L)N>k?(W=lt/N,rt=w.top+(U-W)/2):(P=$/k,J=w.left+(D-P)/2);else if(N>k){const ut=N*U,vt=(I+T)/2;I=vt-ut/2,T=vt+ut/2}else{const ut=k*D,vt=(H+F)/2;H=vt-ut/2,F=vt+ut/2}}const et=$=>J+($-H)/(F-H)*P,O=$=>rt+W-($-I)/(T-I)*W;if(h!==!1){g.strokeStyle="#ddd",g.lineWidth=.5;const $=lu(H,F,Math.max(3,Math.floor(P/80))),lt=lu(I,T,Math.max(3,Math.floor(W/50)));for(const N of $){const k=et(N);g.beginPath(),g.moveTo(k,rt),g.lineTo(k,rt+W),g.stroke()}for(const N of lt){const k=O(N);g.beginPath(),g.moveTo(J,k),g.lineTo(J+P,k),g.stroke()}}g.strokeStyle="#333",g.lineWidth=1,g.strokeRect(J,rt,P,W);const B=lu(H,F,Math.max(3,Math.floor(P/80))),at=lu(I,T,Math.max(3,Math.floor(W/50)));g.fillStyle="#333",g.font="11px monospace",g.textAlign="center",g.textBaseline="top";for(const $ of B)g.fillText(Hv($),et($),rt+W+5);g.textAlign="right",g.textBaseline="middle";for(const $ of at)g.fillText(Hv($),J-5,O($));if(g.fillStyle="#222",i&&(g.font="bold 13px sans-serif",g.textAlign="center",g.textBaseline="middle",g.fillText(i,J+P/2,rt/2)),s&&(g.font="12px sans-serif",g.textAlign="center",g.textBaseline="bottom",g.fillText(s,J+P/2,y-4)),l&&(g.font="12px sans-serif",g.textAlign="center",g.textBaseline="middle",g.save(),g.translate(14,rt+W/2),g.rotate(-Math.PI/2),g.fillText(l,0,0),g.restore()),g.save(),g.beginPath(),g.rect(J,rt,P,W),g.clip(),d&&e3(g,d,et,O,p),m)for(const $ of m)n3(g,$,et,O,p);for(let $=0;$<t.length;$++){const lt=t[$],N=Ax(lt,$);if(lt.lineStyle!=="none"){g.strokeStyle=N,g.lineWidth=lt.lineWidth??2,g.lineJoin="round",g.setLineDash(Rx(lt.lineStyle)),g.beginPath();let k=!1;for(let ut=0;ut<lt.x.length;ut++){const vt=lt.x[ut],Rt=lt.y[ut];if(!isFinite(vt)||!isFinite(Rt)){k=!1;continue}const Z=et(vt),dt=O(Rt);k?g.lineTo(Z,dt):(g.moveTo(Z,dt),k=!0)}g.stroke(),g.setLineDash([])}lt.marker&&ZR(g,lt,et,O,N)}g.restore(),c&&c.length>0&&QR(g,t,c,J+P,rt)}function gp(r,t){const i=Math.max(0,Math.min(1,r));return t==="jet"?t3(i):$R(i)}function $R(r){if(r<.5){const i=r*2;return[.2*(1-i),.1+.6*i,.9-.3*i]}const t=(r-.5)*2;return[.2+.8*t,.7+.3*t,.6-.5*t]}function t3(r){let t,i,s;return r<.125?(t=0,i=0,s=.5+r*4):r<.375?(t=0,i=(r-.125)*4,s=1):r<.625?(t=(r-.375)*4,i=1,s=1-(r-.375)*4):r<.875?(t=1,i=1-(r-.625)*4,s=0):(t=1-(r-.875)*4,i=0,s=0),[Math.max(0,Math.min(1,t)),Math.max(0,Math.min(1,i)),Math.max(0,Math.min(1,s))]}function e3(r,t,i,s,l){const{rows:c,cols:h,z:d,x:m,y:p}=t;if(c===0||h===0)return;let v=1/0,g=-1/0;for(const A of d)isFinite(A)&&(A<v&&(v=A),A>g&&(g=A));if(!isFinite(v))return;const _=g-v||1,M=(m[1]-m[0])/h,E=(p[1]-p[0])/c;for(let A=0;A<h;A++)for(let x=0;x<c;x++){const w=(d[A*c+x]-v)/_,[D,U,H]=gp(w,l),F=i(m[0]+A*M),I=s(p[0]+(x+1)*E),T=i(m[0]+(A+1)*M),L=s(p[0]+x*E);r.fillStyle=`rgb(${Math.round(D*255)},${Math.round(U*255)},${Math.round(H*255)})`,r.fillRect(F,I,T-F,L-I)}}function n3(r,t,i,s,l){const{rows:c,cols:h,z:d,x:m,y:p,nLevels:v,filled:g}=t;if(c<2||h<2)return;let _=1/0,M=-1/0;for(const D of d)isFinite(D)&&(D<_&&(_=D),D>M&&(M=D));if(!isFinite(_))return;const E=M-_||1,A=[];for(let D=0;D<=v;D++)A.push(_+D/v*E);const x=(D,U)=>d[U*c+D],y=(D,U)=>m[U*c+D],w=(D,U)=>p[U*c+D];if(g)for(let D=0;D<h-1;D++)for(let U=0;U<c-1;U++){const F=((x(U,D)+x(U+1,D)+x(U,D+1)+x(U+1,D+1))/4-_)/E,[I,T,L]=gp(F,l),Q=i(y(U,D)),P=s(w(U,D)),W=i(y(U+1,D+1)),J=s(w(U+1,D+1));r.fillStyle=`rgb(${Math.round(I*255)},${Math.round(T*255)},${Math.round(L*255)})`,r.fillRect(Math.min(Q,W),Math.min(P,J),Math.abs(W-Q)||1,Math.abs(J-P)||1)}else for(let D=1;D<A.length-1;D++){const U=A[D],H=(U-_)/E,[F,I,T]=gp(H,l);r.strokeStyle=`rgb(${Math.round(F*255)},${Math.round(I*255)},${Math.round(T*255)})`,r.lineWidth=1;for(let L=0;L<h-1;L++)for(let Q=0;Q<c-1;Q++){const P=x(Q,L),W=x(Q+1,L),J=x(Q,L+1),rt=x(Q+1,L+1),et=y(Q,L),O=w(Q,L),B=y(Q+1,L),at=w(Q+1,L),$=y(Q,L+1),lt=w(Q,L+1),N=y(Q+1,L+1),k=w(Q+1,L+1),ut=i3(P,W,J,rt,et,O,B,at,$,lt,N,k,U);for(const vt of ut)r.beginPath(),r.moveTo(i(vt[0]),s(vt[1])),r.lineTo(i(vt[2]),s(vt[3])),r.stroke()}}}function i3(r,t,i,s,l,c,h,d,m,p,v,g,_){const M=r>=_?1:0,E=t>=_?1:0,A=i>=_?1:0,x=s>=_?1:0,y=M|E<<1|A<<2|x<<3;if(y===0||y===15)return[];const w=(W,J,rt,et)=>{const O=(_-rt)/(et-rt||1);return W+O*(J-W)},D=w(l,h,r,t),U=w(c,d,r,t),H=w(h,v,t,s),F=w(d,g,t,s),I=w(m,v,i,s),T=w(p,g,i,s),L=w(l,m,r,i),Q=w(c,p,r,i),P=[];switch(y){case 1:case 14:P.push([D,U,L,Q]);break;case 2:case 13:P.push([D,U,H,F]);break;case 3:case 12:P.push([L,Q,H,F]);break;case 4:case 11:P.push([L,Q,I,T]);break;case 5:case 10:P.push([D,U,I,T]);break;case 6:case 9:P.push([D,U,L,Q]),P.push([I,T,H,F]);break;case 7:case 8:P.push([I,T,H,F]);break}return P}function a3({figure:r}){const{subplotGrid:t,sgtitle:i,axes:s}=r,l=Object.keys(s).map(Number).sort((d,m)=>d-m);if(l.length===0)return null;if(!t){const d=s[l[0]];return d?sn.jsx(Vv,{axes:d}):null}const{rows:c,cols:h}=t;return sn.jsxs("div",{style:{width:"100%",height:"100%",display:"flex",flexDirection:"column"},children:[i&&sn.jsx("div",{style:{textAlign:"center",fontWeight:"bold",fontSize:16,fontFamily:"sans-serif",padding:"8px 0 4px 0",flexShrink:0},children:i}),sn.jsx("div",{style:{flex:1,display:"grid",gridTemplateRows:`repeat(${c}, 1fr)`,gridTemplateColumns:`repeat(${h}, 1fr)`,gap:4,padding:4,minHeight:0},children:Array.from({length:c*h},(d,m)=>{const p=m+1,v=s[p],g=Math.floor(m/h),_=m%h;return sn.jsx("div",{style:{gridRow:g+1,gridColumn:_+1,minWidth:0,minHeight:0,overflow:"hidden"},children:v?sn.jsx(Vv,{axes:v}):null},p)})})]})}function Vv({axes:r}){return r.surfTraces&&r.surfTraces.length>0||r.plot3Traces&&r.plot3Traces.length>0?sn.jsx(qR,{surfTraces:r.surfTraces??[],plot3Traces:r.plot3Traces??[],shading:r.shading}):sn.jsx(s3,{traces:r.traces,title:r.title,xlabel:r.xlabel,ylabel:r.ylabel,legend:r.legend,gridOn:r.gridOn,imagescTrace:r.imagescTrace,contourTraces:r.contourTraces,colormap:r.colormap,axisMode:r.axisMode})}function s3({traces:r,title:t,xlabel:i,ylabel:s,legend:l,gridOn:c,imagescTrace:h,contourTraces:d,colormap:m,axisMode:p}){const v=Yn.useRef(null),g=Yn.useRef(null),_=Yn.useCallback(()=>{const M=v.current;M&&JR(M,r,t,i,s,l,c,h,d,m,p)},[r,t,i,s,l,c,h,d,m,p]);return Yn.useEffect(()=>{const M=v.current,E=g.current;if(!M||!E)return;const A=new ResizeObserver(()=>{const x=E.getBoundingClientRect(),y=window.devicePixelRatio||1;M.width=x.width*y,M.height=x.height*y,M.style.width=`${x.width}px`,M.style.height=`${x.height}px`,_()});return A.observe(E),()=>A.disconnect()},[_]),sn.jsx("div",{ref:g,style:{width:"100%",height:"100%"},children:sn.jsx("canvas",{ref:v,style:{display:"block"}})})}const Cx={holdOn:!1,traces:[],plot3Traces:[],surfTraces:[],contourTraces:[]};function En(r){return r.axes[r.currentAxesIndex]||{...Cx}}function bn(r,t){return{...r,axes:{...r.axes,[r.currentAxesIndex]:t}}}const _p={currentHandle:1,figs:{}},wx={currentAxesIndex:1,axes:{}};function pn(r){return r.figs[r.currentHandle]||{...wx}}const r3=(r,t)=>{switch(t.type){case"set_current_handle":return{...r,currentHandle:t.handle};case"set_hold":{const i=pn(r),s=En(i);return{...r,figs:{...r.figs,[r.currentHandle]:bn(i,{...s,holdOn:t.value})}}}case"add_plot":{const i=pn(r),s=En(i);return{...r,figs:{...r.figs,[r.currentHandle]:bn(i,{...s,traces:s.holdOn?[...s.traces,...t.traces]:[...t.traces],plot3Traces:s.holdOn?s.plot3Traces:[],surfTraces:s.holdOn?s.surfTraces:[]})}}}case"add_plot3":{const i=pn(r),s=En(i);return{...r,figs:{...r.figs,[r.currentHandle]:bn(i,{...s,traces:s.holdOn?s.traces:[],plot3Traces:s.holdOn?[...s.plot3Traces,...t.traces]:[...t.traces],surfTraces:s.holdOn?s.surfTraces:[]})}}}case"add_surf":{const i=pn(r),s=En(i);return{...r,figs:{...r.figs,[r.currentHandle]:bn(i,{...s,traces:s.holdOn?s.traces:[],plot3Traces:s.holdOn?s.plot3Traces:[],surfTraces:s.holdOn?[...s.surfTraces,t.trace]:[t.trace]})}}}case"add_imagesc":{const i=pn(r),s=En(i);return{...r,figs:{...r.figs,[r.currentHandle]:bn(i,{...s,imagescTrace:t.trace,traces:s.holdOn?s.traces:[],plot3Traces:s.holdOn?s.plot3Traces:[],surfTraces:s.holdOn?s.surfTraces:[],contourTraces:s.holdOn?s.contourTraces:[]})}}}case"add_contour":{const i=pn(r),s=En(i);return{...r,figs:{...r.figs,[r.currentHandle]:bn(i,{...s,contourTraces:s.holdOn?[...s.contourTraces,t.trace]:[t.trace],traces:s.holdOn?s.traces:[],plot3Traces:s.holdOn?s.plot3Traces:[],surfTraces:s.holdOn?s.surfTraces:[]})}}}case"add_mesh":{const i=pn(r),s=En(i);return{...r,figs:{...r.figs,[r.currentHandle]:bn(i,{...s,traces:s.holdOn?s.traces:[],plot3Traces:s.holdOn?s.plot3Traces:[],surfTraces:s.holdOn?[...s.surfTraces,t.trace]:[t.trace],contourTraces:s.holdOn?s.contourTraces:[]})}}}case"close":{const i=Object.fromEntries(Object.entries(r.figs).filter(([l])=>Number(l)!==r.currentHandle)),s=Object.keys(i).map(Number).sort((l,c)=>l-c);return{...r,currentHandle:s.length>0?s[s.length-1]:1,figs:i}}case"close_all":return _p;case"set_title":{const i=pn(r),s=En(i);return{...r,figs:{...r.figs,[r.currentHandle]:bn(i,{...s,title:t.text})}}}case"set_xlabel":{const i=pn(r),s=En(i);return{...r,figs:{...r.figs,[r.currentHandle]:bn(i,{...s,xlabel:t.text})}}}case"set_ylabel":{const i=pn(r),s=En(i);return{...r,figs:{...r.figs,[r.currentHandle]:bn(i,{...s,ylabel:t.text})}}}case"set_shading":{const i=pn(r),s=En(i);return{...r,figs:{...r.figs,[r.currentHandle]:bn(i,{...s,shading:t.shading})}}}case"clf":return r.figs[r.currentHandle]?{...r,figs:{...r.figs,[r.currentHandle]:{...wx}}}:r;case"clear":return _p;case"set_subplot":{const s={...pn(r),subplotGrid:{rows:t.rows,cols:t.cols},currentAxesIndex:t.index};return s.axes[t.index]||(s.axes={...s.axes,[t.index]:{...Cx}}),{...r,figs:{...r.figs,[r.currentHandle]:s}}}case"set_legend":{const i=pn(r),s=En(i);return{...r,figs:{...r.figs,[r.currentHandle]:bn(i,{...s,legend:t.labels})}}}case"set_sgtitle":{const i=pn(r);return{...r,figs:{...r.figs,[r.currentHandle]:{...i,sgtitle:t.text}}}}case"set_grid":{const i=pn(r),s=En(i);return{...r,figs:{...r.figs,[r.currentHandle]:bn(i,{...s,gridOn:t.value})}}}case"set_zlabel":{const i=pn(r),s=En(i);return{...r,figs:{...r.figs,[r.currentHandle]:bn(i,{...s,zlabel:t.text})}}}case"set_colorbar":{const i=pn(r),s=En(i);return{...r,figs:{...r.figs,[r.currentHandle]:bn(i,{...s,colorbar:t.value!=="off"})}}}case"set_colormap":{const i=pn(r),s=En(i);return{...r,figs:{...r.figs,[r.currentHandle]:bn(i,{...s,colormap:t.name})}}}case"set_view":{const i=pn(r),s=En(i);return{...r,figs:{...r.figs,[r.currentHandle]:bn(i,{...s,view:{az:t.az,el:t.el}})}}}case"set_axis":{const i=pn(r),s=En(i);return{...r,figs:{...r.figs,[r.currentHandle]:bn(i,{...s,axisMode:t.value})}}}default:return r}};function o3(r){switch(r.type){case"set_figure_handle":return{type:"set_current_handle",handle:r.handle};case"set_hold":return{type:"set_hold",value:r.value};case"plot":return{type:"add_plot",traces:r.traces};case"plot3":return{type:"add_plot3",traces:r.traces};case"surf":return{type:"add_surf",trace:r.trace};case"close":return{type:"close"};case"close_all":return{type:"close_all"};case"set_title":return{type:"set_title",text:r.text};case"set_xlabel":return{type:"set_xlabel",text:r.text};case"set_ylabel":return{type:"set_ylabel",text:r.text};case"set_shading":return{type:"set_shading",shading:r.shading};case"clf":return{type:"clf"};case"set_subplot":return{type:"set_subplot",rows:r.rows,cols:r.cols,index:r.index};case"set_legend":return{type:"set_legend",labels:r.labels};case"set_sgtitle":return{type:"set_sgtitle",text:r.text};case"set_grid":return{type:"set_grid",value:r.value};case"imagesc":return{type:"add_imagesc",trace:r.trace};case"contour":return{type:"add_contour",trace:r.trace};case"mesh":return{type:"add_mesh",trace:r.trace};case"set_zlabel":return{type:"set_zlabel",text:r.text};case"set_colorbar":return{type:"set_colorbar",value:r.value};case"set_colormap":return{type:"set_colormap",name:r.name};case"set_view":return{type:"set_view",az:r.az,el:r.el};case"set_axis":return{type:"set_axis",value:r.value};default:return}}function l3(){const[r,t]=Yn.useReducer(r3,_p),[i,s]=Yn.useState(!1),[l,c]=Yn.useState(1),h=Yn.useRef(l),d=Yn.useCallback(g=>{const _=o3(g);_&&t(_),g.type==="set_figure_handle"?(h.current=g.handle,c(g.handle)):g.type==="close_all"&&(h.current=1,c(1))},[]),m=(()=>{if(r.figs[l])return l;const g=Object.keys(r.figs).map(Number);return g.length===0?l:g.sort((M,E)=>M-E)[g.length-1]})();Yn.useEffect(()=>{const g=new EventSource("/events");return g.onmessage=_=>{const M=JSON.parse(_.data);for(const E of M){if(E.type==="plot")for(const A of E.traces){for(let x=0;x<A.x.length;x++)A.x[x]===null&&(A.x[x]=NaN);for(let x=0;x<A.y.length;x++)A.y[x]===null&&(A.y[x]=NaN)}if(E.type==="plot3")for(const A of E.traces){for(let x=0;x<A.x.length;x++)A.x[x]===null&&(A.x[x]=NaN);for(let x=0;x<A.y.length;x++)A.y[x]===null&&(A.y[x]=NaN);for(let x=0;x<A.z.length;x++)A.z[x]===null&&(A.z[x]=NaN)}d(E)}},g.addEventListener("done",()=>{s(!0)}),()=>g.close()},[d]);const p=Object.keys(r.figs).map(Number).sort((g,_)=>g-_),v=r.figs[m];return sn.jsxs("div",{style:{display:"flex",flexDirection:"column",height:"100vh"},children:[p.length>1&&sn.jsx("div",{style:c3,children:p.map(g=>sn.jsxs("button",{onClick:()=>c(g),style:g===m?u3:Dx,children:["Figure ",g]},g))}),sn.jsx("div",{style:{flex:1,position:"relative"},children:v?sn.jsx("div",{style:{position:"absolute",inset:0},children:sn.jsx(a3,{figure:v})}):sn.jsx("div",{style:{display:"flex",alignItems:"center",justifyContent:"center",height:"100%",color:"#999",fontFamily:"sans-serif"},children:"Waiting for plot data..."})}),sn.jsx("div",{style:f3,children:i?"Script complete. Press Ctrl+C in terminal to exit.":"Running..."})]})}const c3={display:"flex",gap:2,padding:"4px 8px",background:"#f0f0f0",borderBottom:"1px solid #ccc"},Dx={padding:"4px 12px",border:"1px solid #ccc",borderBottom:"none",background:"#e0e0e0",cursor:"pointer",fontFamily:"sans-serif",fontSize:13,borderRadius:"4px 4px 0 0"},u3={...Dx,background:"#fff",fontWeight:"bold"},f3={padding:"4px 12px",background:"#f5f5f5",borderTop:"1px solid #ddd",fontSize:12,fontFamily:"sans-serif",color:"#666"};Xy.createRoot(document.getElementById("root")).render(sn.jsx(Yn.StrictMode,{children:sn.jsx(l3,{})}));
4426
+ `};class Fp extends ki{constructor(t){super({type:"LineMaterial",uniforms:zp.clone($n.line.uniforms),vertexShader:$n.line.vertexShader,fragmentShader:$n.line.fragmentShader,clipping:!0}),this.isLineMaterial=!0,this.setValues(t)}get color(){return this.uniforms.diffuse.value}set color(t){this.uniforms.diffuse.value=t}get worldUnits(){return"WORLD_UNITS"in this.defines}set worldUnits(t){t===!0!==this.worldUnits&&(this.needsUpdate=!0),t===!0?this.defines.WORLD_UNITS="":delete this.defines.WORLD_UNITS}get linewidth(){return this.uniforms.linewidth.value}set linewidth(t){this.uniforms.linewidth&&(this.uniforms.linewidth.value=t)}get dashed(){return"USE_DASH"in this.defines}set dashed(t){t===!0!==this.dashed&&(this.needsUpdate=!0),t===!0?this.defines.USE_DASH="":delete this.defines.USE_DASH}get dashScale(){return this.uniforms.dashScale.value}set dashScale(t){this.uniforms.dashScale.value=t}get dashSize(){return this.uniforms.dashSize.value}set dashSize(t){this.uniforms.dashSize.value=t}get dashOffset(){return this.uniforms.dashOffset.value}set dashOffset(t){this.uniforms.dashOffset.value=t}get gapSize(){return this.uniforms.gapSize.value}set gapSize(t){this.uniforms.gapSize.value=t}get opacity(){return this.uniforms.opacity.value}set opacity(t){this.uniforms&&(this.uniforms.opacity.value=t)}get resolution(){return this.uniforms.resolution.value}set resolution(t){this.uniforms.resolution.value.copy(t)}get alphaToCoverage(){return"USE_ALPHA_TO_COVERAGE"in this.defines}set alphaToCoverage(t){this.defines&&(t===!0!==this.alphaToCoverage&&(this.needsUpdate=!0),t===!0?this.defines.USE_ALPHA_TO_COVERAGE="":delete this.defines.USE_ALPHA_TO_COVERAGE)}}const yd=new We,Pv=new j,zv=new j,Rn=new We,Cn=new We,Qi=new We,Md=new j,Ed=new Je,wn=new OE,Iv=new j,lu=new ys,cu=new lo,Ji=new We;let $i,Qs;function Fv(r,t,i){return Ji.set(0,0,-t,1).applyMatrix4(r.projectionMatrix),Ji.multiplyScalar(1/Ji.w),Ji.x=Qs/i.width,Ji.y=Qs/i.height,Ji.applyMatrix4(r.projectionMatrixInverse),Ji.multiplyScalar(1/Ji.w),Math.abs(Math.max(Ji.x,Ji.y))}function XR(r,t){const i=r.matrixWorld,s=r.geometry,l=s.attributes.instanceStart,c=s.attributes.instanceEnd,h=Math.min(s.instanceCount,l.count);for(let d=0,m=h;d<m;d++){wn.start.fromBufferAttribute(l,d),wn.end.fromBufferAttribute(c,d),wn.applyMatrix4(i);const p=new j,v=new j;$i.distanceSqToSegment(wn.start,wn.end,v,p),v.distanceTo(p)<Qs*.5&&t.push({point:v,pointOnLine:p,distance:$i.origin.distanceTo(v),object:r,face:null,faceIndex:d,uv:null,uv1:null})}}function WR(r,t,i){const s=t.projectionMatrix,c=r.material.resolution,h=r.matrixWorld,d=r.geometry,m=d.attributes.instanceStart,p=d.attributes.instanceEnd,v=Math.min(d.instanceCount,m.count),g=-t.near;$i.at(1,Qi),Qi.w=1,Qi.applyMatrix4(t.matrixWorldInverse),Qi.applyMatrix4(s),Qi.multiplyScalar(1/Qi.w),Qi.x*=c.x/2,Qi.y*=c.y/2,Qi.z=0,Md.copy(Qi),Ed.multiplyMatrices(t.matrixWorldInverse,h);for(let _=0,M=v;_<M;_++){if(Rn.fromBufferAttribute(m,_),Cn.fromBufferAttribute(p,_),Rn.w=1,Cn.w=1,Rn.applyMatrix4(Ed),Cn.applyMatrix4(Ed),Rn.z>g&&Cn.z>g)continue;if(Rn.z>g){const D=Rn.z-Cn.z,U=(Rn.z-g)/D;Rn.lerp(Cn,U)}else if(Cn.z>g){const D=Cn.z-Rn.z,U=(Cn.z-g)/D;Cn.lerp(Rn,U)}Rn.applyMatrix4(s),Cn.applyMatrix4(s),Rn.multiplyScalar(1/Rn.w),Cn.multiplyScalar(1/Cn.w),Rn.x*=c.x/2,Rn.y*=c.y/2,Cn.x*=c.x/2,Cn.y*=c.y/2,wn.start.copy(Rn),wn.start.z=0,wn.end.copy(Cn),wn.end.z=0;const A=wn.closestPointToPointParameter(Md,!0);wn.at(A,Iv);const y=ox.lerp(Rn.z,Cn.z,A),S=y>=-1&&y<=1,w=Md.distanceTo(Iv)<Qs*.5;if(S&&w){wn.start.fromBufferAttribute(m,_),wn.end.fromBufferAttribute(p,_),wn.start.applyMatrix4(h),wn.end.applyMatrix4(h);const D=new j,U=new j;$i.distanceSqToSegment(wn.start,wn.end,U,D),i.push({point:U,pointOnLine:D,distance:$i.origin.distanceTo(U),object:r,face:null,faceIndex:_,uv:null,uv1:null})}}}class qR extends mi{constructor(t=new Tx,i=new Fp({color:Math.random()*16777215})){super(t,i),this.isLineSegments2=!0,this.type="LineSegments2"}computeLineDistances(){const t=this.geometry,i=t.attributes.instanceStart,s=t.attributes.instanceEnd,l=new Float32Array(2*i.count);for(let h=0,d=0,m=i.count;h<m;h++,d+=2)Pv.fromBufferAttribute(i,h),zv.fromBufferAttribute(s,h),l[d]=d===0?0:l[d-1],l[d+1]=l[d]+Pv.distanceTo(zv);const c=new pp(l,2,1);return t.setAttribute("instanceDistanceStart",new _s(c,1,0)),t.setAttribute("instanceDistanceEnd",new _s(c,1,1)),this}raycast(t,i){const s=this.material.worldUnits,l=t.camera;l===null&&!s&&console.error('LineSegments2: "Raycaster.camera" needs to be set in order to raycast against LineSegments2 while worldUnits is set to false.');const c=t.params.Line2!==void 0&&t.params.Line2.threshold||0;$i=t.ray;const h=this.matrixWorld,d=this.geometry,m=this.material;Qs=m.linewidth+c,d.boundingSphere===null&&d.computeBoundingSphere(),cu.copy(d.boundingSphere).applyMatrix4(h);let p;if(s)p=Qs*.5;else{const g=Math.max(l.near,cu.distanceToPoint($i.origin));p=Fv(l,g,m.resolution)}if(cu.radius+=p,$i.intersectsSphere(cu)===!1)return;d.boundingBox===null&&d.computeBoundingBox(),lu.copy(d.boundingBox).applyMatrix4(h);let v;if(s)v=Qs*.5;else{const g=Math.max(l.near,lu.distanceToPoint($i.origin));v=Fv(l,g,m.resolution)}lu.expandByScalar(v),$i.intersectsBox(lu)!==!1&&(s?XR(this,i):WR(this,l,i))}onBeforeRender(t){const i=this.material.uniforms;i&&i.resolution&&(t.getViewport(yd),this.material.uniforms.resolution.value.set(yd.z,yd.w))}}class Ax extends Tx{constructor(){super(),this.isLineGeometry=!0,this.type="LineGeometry"}setPositions(t){const i=t.length-3,s=new Float32Array(2*i);for(let l=0;l<i;l+=3)s[2*l]=t[l],s[2*l+1]=t[l+1],s[2*l+2]=t[l+2],s[2*l+3]=t[l+3],s[2*l+4]=t[l+4],s[2*l+5]=t[l+5];return super.setPositions(s),this}setColors(t){const i=t.length-3,s=new Float32Array(2*i);for(let l=0;l<i;l+=3)s[2*l]=t[l],s[2*l+1]=t[l+1],s[2*l+2]=t[l+2],s[2*l+3]=t[l+3],s[2*l+4]=t[l+4],s[2*l+5]=t[l+5];return super.setColors(s),this}setFromPoints(t){const i=t.length-1,s=new Float32Array(6*i);for(let l=0;l<i;l++)s[6*l]=t[l].x,s[6*l+1]=t[l].y,s[6*l+2]=t[l].z||0,s[6*l+3]=t[l+1].x,s[6*l+4]=t[l+1].y,s[6*l+5]=t[l+1].z||0;return super.setPositions(s),this}fromLine(t){const i=t.geometry;return this.setPositions(i.attributes.position.array),this}}class YR extends qR{constructor(t=new Ax,i=new Fp({color:Math.random()*16777215})){super(t,i),this.isLine2=!0,this.type="Line2"}}const Ii=[[.2422,.1504,.6603],[.281,.3228,.9579],[.1786,.5289,.9682],[.0689,.6948,.8394],[.128,.789,.5927],[.3391,.849,.3798],[.633,.8518,.2091],[.8902,.8044,.1137],[.9905,.6816,.0235],[.9763,.517,.034]];function jR(r){const i=Math.max(0,Math.min(1,r))*(Ii.length-1),s=Math.floor(i),l=Math.min(s+1,Ii.length-1),c=i-s;return[Ii[s][0]+c*(Ii[l][0]-Ii[s][0]),Ii[s][1]+c*(Ii[l][1]-Ii[s][1]),Ii[s][2]+c*(Ii[l][2]-Ii[s][2])]}const Bv=[[0,.447,.741],[.85,.325,.098],[.929,.694,.125],[.494,.184,.556],[.466,.674,.188],[.301,.745,.933],[.635,.078,.184]];function ZR({surfTraces:r,plot3Traces:t=[],shading:i}){const s=Xn.useRef(null),l=Xn.useRef(null);return Xn.useEffect(()=>{const c=s.current;if(!c)return;const h=new wR({antialias:!0});h.setPixelRatio(window.devicePixelRatio),h.setClearColor(16777215),c.appendChild(h.domElement);const d=new sE,m=new Ru(-1,1,1,-1,.01,100);m.position.set(1.2,.8,1.2),m.lookAt(0,0,0);const p=new UR(m,h.domElement);p.enablePan=!1,p.enableZoom=!0,d.add(new CE(16777215,.6));const v=new RE(16777215,.6);v.position.set(2,3,2),d.add(v);const g=requestAnimationFrame(function M(){p.update(),h.render(d,m),l.current.animId=requestAnimationFrame(M)});l.current={renderer:h,scene:d,camera:m,controls:p,animId:g};const _=new ResizeObserver(()=>{const M=c.getBoundingClientRect();if(M.width===0||M.height===0)return;h.setSize(M.width,M.height);const E=M.width/M.height,A=1.2;m.left=-A*E,m.right=A*E,m.top=A,m.bottom=-A,m.updateProjectionMatrix()});return _.observe(c),()=>{_.disconnect(),cancelAnimationFrame(l.current?.animId??g),p.dispose(),h.dispose(),c.removeChild(h.domElement),l.current=null}},[]),Xn.useEffect(()=>{const c=l.current;if(!c)return;const{scene:h}=c,d=[];h.traverse(Q=>{(Q instanceof mi||Q instanceof $_||Q instanceof bu)&&d.push(Q)});for(const Q of d)h.remove(Q),Q.geometry&&Q.geometry.dispose();if(r.length===0&&t.length===0)return;let m=1/0,p=-1/0,v=1/0,g=-1/0,_=1/0,M=-1/0;const E=(Q,P,W)=>{for(const J of Q)isFinite(J)&&(J<P.v&&(P.v=J),J>W.v&&(W.v=J))},A={v:m},y={v:p},S={v},w={v:g},D={v:_},U={v:M};for(const Q of r)E(Q.x,A,y),E(Q.y,S,w),E(Q.z,D,U);for(const Q of t)E(Q.x,A,y),E(Q.y,S,w),E(Q.z,D,U);if(m=A.v,p=y.v,v=S.v,g=w.v,_=D.v,M=U.v,!isFinite(m))return;p===m&&(m-=1,p+=1),g===v&&(v-=1,g+=1),M===_&&(_-=1,M+=1);const H=Math.max(p-m,g-v,M-_),F=(m+p)/2,I=(v+g)/2,T=(_+M)/2,L=(Q,P)=>(Q-P)/H;for(const Q of r){const{rows:P,cols:W,x:J,y:rt,z:et}=Q,O=M-_||1,B=Q.faceAlpha??1,at=new Float32Array(P*W*3),$=new Float32Array(P*W*3);for(let Z=0;Z<W;Z++)for(let dt=0;dt<P;dt++){const yt=Z*P+dt,Ut=dt*W+Z,Ft=L(J[yt],F),Xt=L(rt[yt],I),ge=L(et[yt],T);at[Ut*3]=Ft,at[Ut*3+1]=ge,at[Ut*3+2]=Xt;const Jt=Q.c?(Q.c[yt]-_)/O:(et[yt]-_)/O,[_e,Te,ae]=jR(Jt);$[Ut*3]=_e,$[Ut*3+1]=Te,$[Ut*3+2]=ae}const lt=[];for(let Z=0;Z<P-1;Z++)for(let dt=0;dt<W-1;dt++){const yt=Z*W+dt,Ut=Z*W+(dt+1),Ft=(Z+1)*W+dt,Xt=(Z+1)*W+(dt+1);lt.push(yt,Ft,Ut),lt.push(Ut,Ft,Xt)}const N=new Ln;N.setAttribute("position",new pi(at,3)),N.setAttribute("color",new pi($,3)),N.setIndex(lt),N.computeVertexNormals();const k=i??"faceted",ut=k==="faceted"||k==="flat";if(Q.faceColor!=="none"){let Z;if(Array.isArray(Q.faceColor)){const[dt,yt,Ut]=Q.faceColor;Z=new ev({color:new Se(dt,yt,Ut),flatShading:ut,opacity:B,transparent:B<1,side:Bi})}else Z=new ev({vertexColors:!0,flatShading:ut,opacity:B,transparent:B<1,side:Bi});h.add(new mi(N,Z))}if(Q.edgeColor!=="none"&&k==="faceted"){const Z=[],dt=[];for(let Ft=0;Ft<P;Ft++)for(let Xt=0;Xt<W;Xt++){const ge=Ft*W+Xt;if(Xt<W-1){const Jt=Ft*W+(Xt+1);Z.push(at[ge*3],at[ge*3+1],at[ge*3+2],at[Jt*3],at[Jt*3+1],at[Jt*3+2]),dt.push($[ge*3],$[ge*3+1],$[ge*3+2],$[Jt*3],$[Jt*3+1],$[Jt*3+2])}if(Ft<P-1){const Jt=(Ft+1)*W+Xt;Z.push(at[ge*3],at[ge*3+1],at[ge*3+2],at[Jt*3],at[Jt*3+1],at[Jt*3+2]),dt.push($[ge*3],$[ge*3+1],$[ge*3+2],$[Jt*3],$[Jt*3+1],$[Jt*3+2])}}const yt=new Ln;yt.setAttribute("position",new Mn(Z,3));let Ut;if(Array.isArray(Q.edgeColor)){const[Ft,Xt,ge]=Q.edgeColor;Ut=new vl({color:new Se(Ft,Xt,ge)})}else Ut=new vl({color:0,opacity:.3,transparent:!0});h.add(new $_(yt,Ut))}}for(let Q=0;Q<t.length;Q++){const P=t[Q],{x:W,y:J,z:rt}=P,et=Bv[Q%Bv.length],O=P.color??et,B=new Se(O[0],O[1],O[2]);if(P.lineStyle!=="none"){const $=[];let lt=[];for(let ut=0;ut<W.length;ut++)if(isFinite(W[ut])&&isFinite(J[ut])&&isFinite(rt[ut])){const vt=L(W[ut],F),Rt=L(J[ut],I),Z=L(rt[ut],T);lt.push(new j(vt,Z,Rt))}else lt.length>0&&($.push(lt),lt=[]);lt.length>0&&$.push(lt);const N=P.lineWidth??2,k=P.lineStyle==="--"||P.lineStyle===":"||P.lineStyle==="-.";for(const ut of $){if(ut.length<2)continue;const vt=[];for(const Rt of ut)vt.push(Rt.x,Rt.y,Rt.z);if(k){const Rt=new bE({color:B,linewidth:N,dashSize:P.lineStyle===":"?.01:.03,gapSize:P.lineStyle===":"?.02:.015}),Z=new Ln().setFromPoints(ut),dt=new bu(Z,Rt);dt.computeLineDistances(),h.add(dt)}else{const Rt=new Ax;Rt.setPositions(vt);const Z=new Fp({color:B.getHex(),linewidth:N,worldUnits:!1,resolution:new le(c.renderer.domElement.width||800,c.renderer.domElement.height||600)});h.add(new YR(Rt,Z))}}}if(P.marker&&P.marker!=="none"){const $=(P.markerSize??6)/600,lt=P.markerEdgeColor?new Se(P.markerEdgeColor[0],P.markerEdgeColor[1],P.markerEdgeColor[2]):B,N=P.markerIndices?P.markerIndices.map(vt=>vt-1):Array.from({length:W.length},(vt,Rt)=>Rt),k=new Pp($,8,8),ut=new Np({color:lt});for(const vt of N){if(vt<0||vt>=W.length||!isFinite(W[vt])||!isFinite(J[vt])||!isFinite(rt[vt]))continue;const Rt=L(W[vt],F),Z=L(J[vt],I),dt=L(rt[vt],T),yt=new mi(k,ut);yt.position.set(Rt,dt,Z),h.add(yt)}}}KR(h,m,p,v,g,_,M,H,F,I,T)},[r,t,i]),sn.jsx("div",{ref:s,style:{width:"100%",height:"100%"}})}function KR(r,t,i,s,l,c,h,d,m,p,v){const g=(E,A)=>(E-A)/d,_=[{from:[t,s,c],to:[i,s,c]},{from:[t,s,c],to:[t,l,c]},{from:[t,s,c],to:[t,s,h]}],M=new vl({color:3355443});for(const E of _){const A=[E.from,E.to].map(([S,w,D])=>{const U=g(S,m),H=g(w,p),F=g(D,v);return new j(U,F,H)}),y=new Ln().setFromPoints(A);r.add(new bu(y,M))}}const Hv=["#0072BD","#D95319","#EDB120","#7E2F8E","#77AC30","#4DBEEE","#A2142F"];function _p(r){return`rgb(${Math.round(r[0]*255)}, ${Math.round(r[1]*255)}, ${Math.round(r[2]*255)})`}function Rx(r,t){return r.color?_p(r.color):Hv[t%Hv.length]}function Cx(r){switch(r){case"--":return[8,4];case":":return[2,4];case"-.":return[8,4,2,4];default:return[]}}function QR(r,t){const i=r/t,s=Math.pow(10,Math.floor(Math.log10(i))),l=i/s;let c;return l<=1.5?c=1:l<=3.5?c=2:l<=7.5?c=5:c=10,c*s}function uu(r,t,i){const s=QR(t-r,i),l=[],c=Math.ceil(r/s)*s;for(let h=c;h<=t+s*.001;h+=s)l.push(h);return l}function Gv(r){return Math.abs(r)<1e-10?"0":Math.abs(r)>=1e4||Math.abs(r)<.01&&r!==0?r.toExponential(1):parseFloat(r.toPrecision(6)).toString()}function JR(r,t,i,s,l){if(!t.marker||t.marker==="none")return;const c=(t.markerSize??6)/2,h=t.markerEdgeColor?_p(t.markerEdgeColor):l,d=t.markerFaceColor?_p(t.markerFaceColor):void 0,m=t.markerIndices?t.markerIndices.map(p=>p-1):Array.from({length:t.x.length},(p,v)=>v);r.lineWidth=1.5;for(const p of m){if(p<0||p>=t.x.length)continue;const v=t.x[p],g=t.y[p];if(!isFinite(v)||!isFinite(g))continue;const _=i(v),M=s(g);$R(r,t.marker,_,M,c,h,d)}}function $R(r,t,i,s,l,c,h){switch(r.strokeStyle=c,r.fillStyle=h??"transparent",t){case"o":{r.beginPath(),r.arc(i,s,l,0,Math.PI*2),h&&r.fill(),r.stroke();break}case"+":{r.beginPath(),r.moveTo(i-l,s),r.lineTo(i+l,s),r.moveTo(i,s-l),r.lineTo(i,s+l),r.stroke();break}case"*":{r.beginPath();for(let d=0;d<6;d++){const m=d*Math.PI/3;r.moveTo(i,s),r.lineTo(i+l*Math.cos(m),s+l*Math.sin(m))}r.stroke();break}case".":{r.beginPath(),r.arc(i,s,Math.max(l/3,1.5),0,Math.PI*2),r.fillStyle=c,r.fill();break}case"x":{const d=l*.707;r.beginPath(),r.moveTo(i-d,s-d),r.lineTo(i+d,s+d),r.moveTo(i+d,s-d),r.lineTo(i-d,s+d),r.stroke();break}case"_":{r.beginPath(),r.moveTo(i-l,s),r.lineTo(i+l,s),r.stroke();break}case"|":{r.beginPath(),r.moveTo(i,s-l),r.lineTo(i,s+l),r.stroke();break}case"s":{r.beginPath(),r.rect(i-l,s-l,l*2,l*2),h&&r.fill(),r.stroke();break}case"d":{r.beginPath(),r.moveTo(i,s-l),r.lineTo(i+l,s),r.lineTo(i,s+l),r.lineTo(i-l,s),r.closePath(),h&&r.fill(),r.stroke();break}case"^":{fu(r,i,s,l,0,h);break}case"v":{fu(r,i,s,l,Math.PI,h);break}case"<":{fu(r,i,s,l,-Math.PI/2,h);break}case">":{fu(r,i,s,l,Math.PI/2,h);break}case"p":{Vv(r,i,s,l,5,h);break}case"h":{Vv(r,i,s,l,6,h);break}}}function fu(r,t,i,s,l,c){r.beginPath();for(let h=0;h<3;h++){const d=l-Math.PI/2+h*2*Math.PI/3,m=t+s*Math.cos(d),p=i+s*Math.sin(d);h===0?r.moveTo(m,p):r.lineTo(m,p)}r.closePath(),c&&r.fill(),r.stroke()}function Vv(r,t,i,s,l,c){const h=s*.4;r.beginPath();for(let d=0;d<l*2;d++){const m=-Math.PI/2+d*Math.PI/l,p=d%2===0?s:h,v=t+p*Math.cos(m),g=i+p*Math.sin(m);d===0?r.moveTo(v,g):r.lineTo(v,g)}r.closePath(),c&&r.fill(),r.stroke()}function t3(r,t,i,s,l){r.font="11px sans-serif";let v=0;for(const A of i){const y=r.measureText(A).width;y>v&&(v=y)}const g=34+v+8,_=8+i.length*17+8,M=s-g-8,E=l+8;r.fillStyle="rgba(255,255,255,0.9)",r.fillRect(M,E,g,_),r.strokeStyle="#999",r.lineWidth=.5,r.strokeRect(M,E,g,_);for(let A=0;A<i.length;A++){const y=A<t.length?Rx(t[A],A):"#333",S=A<t.length?t[A].lineWidth??2:2,w=A<t.length?t[A].lineStyle:void 0,D=E+8+A*17+17/2;r.strokeStyle=y,r.lineWidth=S,r.setLineDash(Cx(w)),r.beginPath(),r.moveTo(M+8,D),r.lineTo(M+8+20,D),r.stroke(),r.setLineDash([]),r.fillStyle="#333",r.font="11px sans-serif",r.textAlign="left",r.textBaseline="middle",r.fillText(i[A],M+8+20+6,D)}}function e3(r,t,i,s,l,c,h,d,m,p,v){const g=r.getContext("2d"),_=t.length>0||d!==void 0||m&&m.length>0;if(!g||!_)return;const M=window.devicePixelRatio||1,E=r.width,A=r.height;g.setTransform(M,0,0,M,0,0);const y=E/M,S=A/M;g.fillStyle="#fff",g.fillRect(0,0,y,S);const w={top:i?40:20,right:20,bottom:s?56:40,left:l?76:60},D=y-w.left-w.right,U=S-w.top-w.bottom;if(D<=0||U<=0)return;let H=1/0,F=-1/0,I=1/0,T=-1/0;for(const $ of t){for(const lt of $.x)isFinite(lt)&&(lt<H&&(H=lt),lt>F&&(F=lt));for(const lt of $.y)isFinite(lt)&&(lt<I&&(I=lt),lt>T&&(T=lt))}if(d&&(d.x[0]<H&&(H=d.x[0]),d.x[1]>F&&(F=d.x[1]),d.y[0]<I&&(I=d.y[0]),d.y[1]>T&&(T=d.y[1])),m)for(const $ of m){for(const lt of $.x)isFinite(lt)&&(lt<H&&(H=lt),lt>F&&(F=lt));for(const lt of $.y)isFinite(lt)&&(lt<I&&(I=lt),lt>T&&(T=lt))}if(!isFinite(H))return;F===H&&(H-=1,F+=1),T===I&&(I-=1,T+=1);const L=v?.includes("tight")??!1,Q=v?.includes("equal")??!1;if(!L){const $=(F-H)*.05,lt=(T-I)*.05;H-=$,F+=$,I-=lt,T+=lt}let P=D,W=U,J=w.left,rt=w.top;if(Q){const $=F-H,lt=T-I,N=$/D,k=lt/U;if(L)N>k?(W=lt/N,rt=w.top+(U-W)/2):(P=$/k,J=w.left+(D-P)/2);else if(N>k){const ut=N*U,vt=(I+T)/2;I=vt-ut/2,T=vt+ut/2}else{const ut=k*D,vt=(H+F)/2;H=vt-ut/2,F=vt+ut/2}}const et=$=>J+($-H)/(F-H)*P,O=$=>rt+W-($-I)/(T-I)*W;if(h!==!1){g.strokeStyle="#ddd",g.lineWidth=.5;const $=uu(H,F,Math.max(3,Math.floor(P/80))),lt=uu(I,T,Math.max(3,Math.floor(W/50)));for(const N of $){const k=et(N);g.beginPath(),g.moveTo(k,rt),g.lineTo(k,rt+W),g.stroke()}for(const N of lt){const k=O(N);g.beginPath(),g.moveTo(J,k),g.lineTo(J+P,k),g.stroke()}}g.strokeStyle="#333",g.lineWidth=1,g.strokeRect(J,rt,P,W);const B=uu(H,F,Math.max(3,Math.floor(P/80))),at=uu(I,T,Math.max(3,Math.floor(W/50)));g.fillStyle="#333",g.font="11px monospace",g.textAlign="center",g.textBaseline="top";for(const $ of B)g.fillText(Gv($),et($),rt+W+5);g.textAlign="right",g.textBaseline="middle";for(const $ of at)g.fillText(Gv($),J-5,O($));if(g.fillStyle="#222",i&&(g.font="bold 13px sans-serif",g.textAlign="center",g.textBaseline="middle",g.fillText(i,J+P/2,rt/2)),s&&(g.font="12px sans-serif",g.textAlign="center",g.textBaseline="bottom",g.fillText(s,J+P/2,S-4)),l&&(g.font="12px sans-serif",g.textAlign="center",g.textBaseline="middle",g.save(),g.translate(14,rt+W/2),g.rotate(-Math.PI/2),g.fillText(l,0,0),g.restore()),g.save(),g.beginPath(),g.rect(J,rt,P,W),g.clip(),d&&a3(g,d,et,O,p),m)for(const $ of m)s3(g,$,et,O,p);for(let $=0;$<t.length;$++){const lt=t[$],N=Rx(lt,$);if(lt.lineStyle!=="none"){g.strokeStyle=N,g.lineWidth=lt.lineWidth??2,g.lineJoin="round",g.setLineDash(Cx(lt.lineStyle)),g.beginPath();let k=!1;for(let ut=0;ut<lt.x.length;ut++){const vt=lt.x[ut],Rt=lt.y[ut];if(!isFinite(vt)||!isFinite(Rt)){k=!1;continue}const Z=et(vt),dt=O(Rt);k?g.lineTo(Z,dt):(g.moveTo(Z,dt),k=!0)}g.stroke(),g.setLineDash([])}lt.marker&&JR(g,lt,et,O,N)}g.restore(),c&&c.length>0&&t3(g,t,c,J+P,rt)}function vp(r,t){const i=Math.max(0,Math.min(1,r));return t==="jet"?i3(i):n3(i)}function n3(r){if(r<.5){const i=r*2;return[.2*(1-i),.1+.6*i,.9-.3*i]}const t=(r-.5)*2;return[.2+.8*t,.7+.3*t,.6-.5*t]}function i3(r){let t,i,s;return r<.125?(t=0,i=0,s=.5+r*4):r<.375?(t=0,i=(r-.125)*4,s=1):r<.625?(t=(r-.375)*4,i=1,s=1-(r-.375)*4):r<.875?(t=1,i=1-(r-.625)*4,s=0):(t=1-(r-.875)*4,i=0,s=0),[Math.max(0,Math.min(1,t)),Math.max(0,Math.min(1,i)),Math.max(0,Math.min(1,s))]}function a3(r,t,i,s,l){const{rows:c,cols:h,z:d,x:m,y:p}=t;if(c===0||h===0)return;let v=1/0,g=-1/0;for(const A of d)isFinite(A)&&(A<v&&(v=A),A>g&&(g=A));if(!isFinite(v))return;const _=g-v||1,M=(m[1]-m[0])/h,E=(p[1]-p[0])/c;for(let A=0;A<h;A++)for(let y=0;y<c;y++){const w=(d[A*c+y]-v)/_,[D,U,H]=vp(w,l),F=i(m[0]+A*M),I=s(p[0]+(y+1)*E),T=i(m[0]+(A+1)*M),L=s(p[0]+y*E);r.fillStyle=`rgb(${Math.round(D*255)},${Math.round(U*255)},${Math.round(H*255)})`,r.fillRect(F,I,T-F,L-I)}}function s3(r,t,i,s,l){const{rows:c,cols:h,z:d,x:m,y:p,nLevels:v,filled:g}=t;if(c<2||h<2)return;let _=1/0,M=-1/0;for(const D of d)isFinite(D)&&(D<_&&(_=D),D>M&&(M=D));if(!isFinite(_))return;const E=M-_||1,A=[];for(let D=0;D<=v;D++)A.push(_+D/v*E);const y=(D,U)=>d[U*c+D],S=(D,U)=>m[U*c+D],w=(D,U)=>p[U*c+D];if(g)for(let D=0;D<h-1;D++)for(let U=0;U<c-1;U++){const F=((y(U,D)+y(U+1,D)+y(U,D+1)+y(U+1,D+1))/4-_)/E,[I,T,L]=vp(F,l),Q=i(S(U,D)),P=s(w(U,D)),W=i(S(U+1,D+1)),J=s(w(U+1,D+1));r.fillStyle=`rgb(${Math.round(I*255)},${Math.round(T*255)},${Math.round(L*255)})`,r.fillRect(Math.min(Q,W),Math.min(P,J),Math.abs(W-Q)||1,Math.abs(J-P)||1)}else for(let D=1;D<A.length-1;D++){const U=A[D],H=(U-_)/E,[F,I,T]=vp(H,l);r.strokeStyle=`rgb(${Math.round(F*255)},${Math.round(I*255)},${Math.round(T*255)})`,r.lineWidth=1;for(let L=0;L<h-1;L++)for(let Q=0;Q<c-1;Q++){const P=y(Q,L),W=y(Q+1,L),J=y(Q,L+1),rt=y(Q+1,L+1),et=S(Q,L),O=w(Q,L),B=S(Q+1,L),at=w(Q+1,L),$=S(Q,L+1),lt=w(Q,L+1),N=S(Q+1,L+1),k=w(Q+1,L+1),ut=r3(P,W,J,rt,et,O,B,at,$,lt,N,k,U);for(const vt of ut)r.beginPath(),r.moveTo(i(vt[0]),s(vt[1])),r.lineTo(i(vt[2]),s(vt[3])),r.stroke()}}}function r3(r,t,i,s,l,c,h,d,m,p,v,g,_){const M=r>=_?1:0,E=t>=_?1:0,A=i>=_?1:0,y=s>=_?1:0,S=M|E<<1|A<<2|y<<3;if(S===0||S===15)return[];const w=(W,J,rt,et)=>{const O=(_-rt)/(et-rt||1);return W+O*(J-W)},D=w(l,h,r,t),U=w(c,d,r,t),H=w(h,v,t,s),F=w(d,g,t,s),I=w(m,v,i,s),T=w(p,g,i,s),L=w(l,m,r,i),Q=w(c,p,r,i),P=[];switch(S){case 1:case 14:P.push([D,U,L,Q]);break;case 2:case 13:P.push([D,U,H,F]);break;case 3:case 12:P.push([L,Q,H,F]);break;case 4:case 11:P.push([L,Q,I,T]);break;case 5:case 10:P.push([D,U,I,T]);break;case 6:case 9:P.push([D,U,L,Q]),P.push([I,T,H,F]);break;case 7:case 8:P.push([I,T,H,F]);break}return P}function o3({figure:r}){const{subplotGrid:t,sgtitle:i,axes:s}=r,l=Object.keys(s).map(Number).sort((d,m)=>d-m);if(l.length===0)return null;if(!t){const d=s[l[0]];return d?sn.jsx(kv,{axes:d}):null}const{rows:c,cols:h}=t;return sn.jsxs("div",{style:{width:"100%",height:"100%",display:"flex",flexDirection:"column"},children:[i&&sn.jsx("div",{style:{textAlign:"center",fontWeight:"bold",fontSize:16,fontFamily:"sans-serif",padding:"8px 0 4px 0",flexShrink:0},children:i}),sn.jsx("div",{style:{flex:1,display:"grid",gridTemplateRows:`repeat(${c}, 1fr)`,gridTemplateColumns:`repeat(${h}, 1fr)`,gap:4,padding:4,minHeight:0},children:Array.from({length:c*h},(d,m)=>{const p=m+1,v=s[p],g=Math.floor(m/h),_=m%h;return sn.jsx("div",{style:{gridRow:g+1,gridColumn:_+1,minWidth:0,minHeight:0,overflow:"hidden"},children:v?sn.jsx(kv,{axes:v}):null},p)})})]})}function kv({axes:r}){return r.surfTraces&&r.surfTraces.length>0||r.plot3Traces&&r.plot3Traces.length>0?sn.jsx(ZR,{surfTraces:r.surfTraces??[],plot3Traces:r.plot3Traces??[],shading:r.shading}):sn.jsx(l3,{traces:r.traces,title:r.title,xlabel:r.xlabel,ylabel:r.ylabel,legend:r.legend,gridOn:r.gridOn,imagescTrace:r.imagescTrace,contourTraces:r.contourTraces,colormap:r.colormap,axisMode:r.axisMode})}function l3({traces:r,title:t,xlabel:i,ylabel:s,legend:l,gridOn:c,imagescTrace:h,contourTraces:d,colormap:m,axisMode:p}){const v=Xn.useRef(null),g=Xn.useRef(null),_=Xn.useCallback(()=>{const M=v.current;M&&e3(M,r,t,i,s,l,c,h,d,m,p)},[r,t,i,s,l,c,h,d,m,p]);return Xn.useEffect(()=>{const M=v.current,E=g.current;if(!M||!E)return;const A=new ResizeObserver(()=>{const y=E.getBoundingClientRect(),S=window.devicePixelRatio||1;M.width=y.width*S,M.height=y.height*S,M.style.width=`${y.width}px`,M.style.height=`${y.height}px`,_()});return A.observe(E),()=>A.disconnect()},[_]),sn.jsx("div",{ref:g,style:{width:"100%",height:"100%"},children:sn.jsx("canvas",{ref:v,style:{display:"block"}})})}const wx={holdOn:!1,traces:[],plot3Traces:[],surfTraces:[],contourTraces:[]};function js(r){return r.axes[r.currentAxesIndex]||{...wx}}function Dx(r,t){return{...r,axes:{...r.axes,[r.currentAxesIndex]:t}}}const Ux={currentHandle:1,figs:{}},Lx={currentAxesIndex:1,axes:{}};function Da(r){return r.figs[r.currentHandle]||{...Lx}}function Ti(r,t){const i=Da(r),s=js(i);return{...r,figs:{...r.figs,[r.currentHandle]:Dx(i,{...s,...t})}}}function Jr(r,t){const i=Da(r),s=js(i),l=s.holdOn;return{...r,figs:{...r.figs,[r.currentHandle]:Dx(i,{...s,traces:t.traces??(l?s.traces:[]),plot3Traces:t.plot3Traces??(l?s.plot3Traces:[]),surfTraces:t.surfTraces??(l?s.surfTraces:[]),contourTraces:t.contourTraces??(l?s.contourTraces:[]),...t.imagescTrace!==void 0?{imagescTrace:t.imagescTrace}:{}})}}}const c3=(r,t)=>{switch(t.type){case"set_figure_handle":return{...r,currentHandle:t.handle};case"set_hold":return Ti(r,{holdOn:t.value});case"plot":{const i=js(Da(r));return Jr(r,{traces:i.holdOn?[...i.traces,...t.traces]:[...t.traces]})}case"plot3":{const i=js(Da(r));return Jr(r,{plot3Traces:i.holdOn?[...i.plot3Traces,...t.traces]:[...t.traces]})}case"surf":{const i=js(Da(r));return Jr(r,{surfTraces:i.holdOn?[...i.surfTraces,t.trace]:[t.trace]})}case"imagesc":return Jr(r,{imagescTrace:t.trace});case"contour":{const i=js(Da(r));return Jr(r,{contourTraces:i.holdOn?[...i.contourTraces,t.trace]:[t.trace]})}case"mesh":{const i=js(Da(r));return Jr(r,{surfTraces:i.holdOn?[...i.surfTraces,t.trace]:[t.trace]})}case"close":{const i=Object.fromEntries(Object.entries(r.figs).filter(([l])=>Number(l)!==r.currentHandle)),s=Object.keys(i).map(Number).sort((l,c)=>l-c);return{...r,currentHandle:s.length>0?s[s.length-1]:1,figs:i}}case"close_all":case"clear":return Ux;case"set_title":return Ti(r,{title:t.text});case"set_xlabel":return Ti(r,{xlabel:t.text});case"set_ylabel":return Ti(r,{ylabel:t.text});case"set_zlabel":return Ti(r,{zlabel:t.text});case"set_shading":return Ti(r,{shading:t.shading});case"set_legend":return Ti(r,{legend:t.labels});case"set_sgtitle":{const i=Da(r);return{...r,figs:{...r.figs,[r.currentHandle]:{...i,sgtitle:t.text}}}}case"set_grid":return Ti(r,{gridOn:t.value});case"set_colorbar":return Ti(r,{colorbar:t.value!=="off"});case"set_colormap":return Ti(r,{colormap:t.name});case"set_view":return Ti(r,{view:{az:t.az,el:t.el}});case"set_axis":return Ti(r,{axisMode:t.value});case"clf":return r.figs[r.currentHandle]?{...r,figs:{...r.figs,[r.currentHandle]:{...Lx}}}:r;case"set_subplot":{const s={...Da(r),subplotGrid:{rows:t.rows,cols:t.cols},currentAxesIndex:t.index};return s.axes[t.index]||(s.axes={...s.axes,[t.index]:{...wx}}),{...r,figs:{...r.figs,[r.currentHandle]:s}}}default:return r}};function hi(r){for(let t=0;t<r.length;t++)r[t]===null&&(r[t]=NaN)}function u3(r){if(r.type==="plot")for(const t of r.traces)hi(t.x),hi(t.y);else if(r.type==="plot3")for(const t of r.traces)hi(t.x),hi(t.y),hi(t.z);else r.type==="surf"||r.type==="mesh"?(hi(r.trace.x),hi(r.trace.y),hi(r.trace.z),r.trace.c&&hi(r.trace.c)):r.type==="imagesc"?hi(r.trace.z):r.type==="contour"&&(hi(r.trace.x),hi(r.trace.y),hi(r.trace.z))}function f3(){const[r,t]=Xn.useReducer(c3,Ux),[i,s]=Xn.useState(!1),[l,c]=Xn.useState(1),h=Xn.useRef(l),d=Xn.useCallback(g=>{t(g),g.type==="set_figure_handle"?(h.current=g.handle,c(g.handle)):g.type==="close_all"&&(h.current=1,c(1))},[]),m=(()=>{if(r.figs[l])return l;const g=Object.keys(r.figs).map(Number);return g.length===0?l:g.sort((M,E)=>M-E)[g.length-1]})();Xn.useEffect(()=>{const g=new EventSource("/events");return g.onmessage=_=>{const M=JSON.parse(_.data);for(const E of M)u3(E),d(E)},g.addEventListener("done",()=>{s(!0)}),()=>g.close()},[d]);const p=Object.keys(r.figs).map(Number).sort((g,_)=>g-_),v=r.figs[m];return sn.jsxs("div",{style:{display:"flex",flexDirection:"column",height:"100vh"},children:[p.length>1&&sn.jsx("div",{style:h3,children:p.map(g=>sn.jsxs("button",{onClick:()=>c(g),style:g===m?d3:Nx,children:["Figure ",g]},g))}),sn.jsx("div",{style:{flex:1,position:"relative"},children:v?sn.jsx("div",{style:{position:"absolute",inset:0},children:sn.jsx(o3,{figure:v})}):sn.jsx("div",{style:{display:"flex",alignItems:"center",justifyContent:"center",height:"100%",color:"#999",fontFamily:"sans-serif"},children:"Waiting for plot data..."})}),sn.jsx("div",{style:p3,children:i?"Script complete. Press Ctrl+C in terminal to exit.":"Running..."})]})}const h3={display:"flex",gap:2,padding:"4px 8px",background:"#f0f0f0",borderBottom:"1px solid #ccc"},Nx={padding:"4px 12px",border:"1px solid #ccc",borderBottom:"none",background:"#e0e0e0",cursor:"pointer",fontFamily:"sans-serif",fontSize:13,borderRadius:"4px 4px 0 0"},d3={...Nx,background:"#fff",fontWeight:"bold"},p3={padding:"4px 12px",background:"#f5f5f5",borderTop:"1px solid #ddd",fontSize:12,fontFamily:"sans-serif",color:"#666"};Yy.createRoot(document.getElementById("root")).render(sn.jsx(Xn.StrictMode,{children:sn.jsx(f3,{})}));