(function(){const e=document.createElement("link").relList;if(e&&e.supports&&e.supports("modulepreload"))return;for(const r of document.querySelectorAll('link[rel="modulepreload"]'))n(r);new MutationObserver(r=>{for(const s of r)if(s.type==="childList")for(const a of s.addedNodes)a.tagName==="LINK"&&a.rel==="modulepreload"&&n(a)}).observe(document,{childList:!0,subtree:!0});function t(r){const s={};return r.integrity&&(s.integrity=r.integrity),r.referrerPolicy&&(s.referrerPolicy=r.referrerPolicy),r.crossOrigin==="use-credentials"?s.credentials="include":r.crossOrigin==="anonymous"?s.credentials="omit":s.credentials="same-origin",s}function n(r){if(r.ep)return;r.ep=!0;const s=t(r);fetch(r.href,s)}})();function hC(i){return i&&i.__esModule&&Object.prototype.hasOwnProperty.call(i,"default")?i.default:i}function pC(i){if(i.__esModule)return i;var e=i.default;if(typeof e=="function"){var t=function n(){return this instanceof n?Reflect.construct(e,arguments,this.constructor):e.apply(this,arguments)};t.prototype=e.prototype}else t={};return Object.defineProperty(t,"__esModule",{value:!0}),Object.keys(i).forEach(function(n){var r=Object.getOwnPropertyDescriptor(i,n);Object.defineProperty(t,n,r.get?r:{enumerable:!0,get:function(){return i[n]}})}),t}var Fv={exports:{}},rh={},Nv={exports:{}},an={};/**
 * @license React
 * react.production.min.js
 *
 * Copyright (c) Facebook, Inc. and its affiliates.
 *
 * This source code is licensed under the MIT license found in the
 * LICENSE file in the root directory of this source tree.
 */var R1;function mC(){if(R1)return an;R1=1;var i=Symbol.for("react.element"),e=Symbol.for("react.portal"),t=Symbol.for("react.fragment"),n=Symbol.for("react.strict_mode"),r=Symbol.for("react.profiler"),s=Symbol.for("react.provider"),a=Symbol.for("react.context"),u=Symbol.for("react.forward_ref"),d=Symbol.for("react.suspense"),h=Symbol.for("react.memo"),m=Symbol.for("react.lazy"),g=Symbol.iterator;function v(W){return W===null||typeof W!="object"?null:(W=g&&W[g]||W["@@iterator"],typeof W=="function"?W:null)}var _={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},A=Object.assign,C={};function M(W,ne,Fe){this.props=W,this.context=ne,this.refs=C,this.updater=Fe||_}M.prototype.isReactComponent={},M.prototype.setState=function(W,ne){if(typeof W!="object"&&typeof W!="function"&&W!=null)throw Error("setState(...): takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,W,ne,"setState")},M.prototype.forceUpdate=function(W){this.updater.enqueueForceUpdate(this,W,"forceUpdate")};function S(){}S.prototype=M.prototype;function b(W,ne,Fe){this.props=W,this.context=ne,this.refs=C,this.updater=Fe||_}var R=b.prototype=new S;R.constructor=b,A(R,M.prototype),R.isPureReactComponent=!0;var P=Array.isArray,U=Object.prototype.hasOwnProperty,F={current:null},k={key:!0,ref:!0,__self:!0,__source:!0};function G(W,ne,Fe){var ae,we={},De=null,Ie=null;if(ne!=null)for(ae in ne.ref!==void 0&&(Ie=ne.ref),ne.key!==void 0&&(De=""+ne.key),ne)U.call(ne,ae)&&!k.hasOwnProperty(ae)&&(we[ae]=ne[ae]);var Xe=arguments.length-2;if(Xe===1)we.children=Fe;else if(1<Xe){for(var _t=Array(Xe),Je=0;Je<Xe;Je++)_t[Je]=arguments[Je+2];we.children=_t}if(W&&W.defaultProps)for(ae in Xe=W.defaultProps,Xe)we[ae]===void 0&&(we[ae]=Xe[ae]);return{$$typeof:i,type:W,key:De,ref:Ie,props:we,_owner:F.current}}function D(W,ne){return{$$typeof:i,type:W.type,key:ne,ref:W.ref,props:W.props,_owner:W._owner}}function L(W){return typeof W=="object"&&W!==null&&W.$$typeof===i}function V(W){var ne={"=":"=0",":":"=2"};return"$"+W.replace(/[=:]/g,function(Fe){return ne[Fe]})}var oe=/\/+/g;function ie(W,ne){return typeof W=="object"&&W!==null&&W.key!=null?V(""+W.key):ne.toString(36)}function ge(W,ne,Fe,ae,we){var De=typeof W;(De==="undefined"||De==="boolean")&&(W=null);var Ie=!1;if(W===null)Ie=!0;else switch(De){case"string":case"number":Ie=!0;break;case"object":switch(W.$$typeof){case i:case e:Ie=!0}}if(Ie)return Ie=W,we=we(Ie),W=ae===""?"."+ie(Ie,0):ae,P(we)?(Fe="",W!=null&&(Fe=W.replace(oe,"$&/")+"/"),ge(we,ne,Fe,"",function(Je){return Je})):we!=null&&(L(we)&&(we=D(we,Fe+(!we.key||Ie&&Ie.key===we.key?"":(""+we.key).replace(oe,"$&/")+"/")+W)),ne.push(we)),1;if(Ie=0,ae=ae===""?".":ae+":",P(W))for(var Xe=0;Xe<W.length;Xe++){De=W[Xe];var _t=ae+ie(De,Xe);Ie+=ge(De,ne,Fe,_t,we)}else if(_t=v(W),typeof _t=="function")for(W=_t.call(W),Xe=0;!(De=W.next()).done;)De=De.value,_t=ae+ie(De,Xe++),Ie+=ge(De,ne,Fe,_t,we);else if(De==="object")throw ne=String(W),Error("Objects are not valid as a React child (found: "+(ne==="[object Object]"?"object with keys {"+Object.keys(W).join(", ")+"}":ne)+"). If you meant to render a collection of children, use an array instead.");return Ie}function ye(W,ne,Fe){if(W==null)return W;var ae=[],we=0;return ge(W,ae,"","",function(De){return ne.call(Fe,De,we++)}),ae}function he(W){if(W._status===-1){var ne=W._result;ne=ne(),ne.then(function(Fe){(W._status===0||W._status===-1)&&(W._status=1,W._result=Fe)},function(Fe){(W._status===0||W._status===-1)&&(W._status=2,W._result=Fe)}),W._status===-1&&(W._status=0,W._result=ne)}if(W._status===1)return W._result.default;throw W._result}var _e={current:null},H={transition:null},Z={ReactCurrentDispatcher:_e,ReactCurrentBatchConfig:H,ReactCurrentOwner:F};function q(){throw Error("act(...) is not supported in production builds of React.")}return an.Children={map:ye,forEach:function(W,ne,Fe){ye(W,function(){ne.apply(this,arguments)},Fe)},count:function(W){var ne=0;return ye(W,function(){ne++}),ne},toArray:function(W){return ye(W,function(ne){return ne})||[]},only:function(W){if(!L(W))throw Error("React.Children.only expected to receive a single React element child.");return W}},an.Component=M,an.Fragment=t,an.Profiler=r,an.PureComponent=b,an.StrictMode=n,an.Suspense=d,an.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=Z,an.act=q,an.cloneElement=function(W,ne,Fe){if(W==null)throw Error("React.cloneElement(...): The argument must be a React element, but you passed "+W+".");var ae=A({},W.props),we=W.key,De=W.ref,Ie=W._owner;if(ne!=null){if(ne.ref!==void 0&&(De=ne.ref,Ie=F.current),ne.key!==void 0&&(we=""+ne.key),W.type&&W.type.defaultProps)var Xe=W.type.defaultProps;for(_t in ne)U.call(ne,_t)&&!k.hasOwnProperty(_t)&&(ae[_t]=ne[_t]===void 0&&Xe!==void 0?Xe[_t]:ne[_t])}var _t=arguments.length-2;if(_t===1)ae.children=Fe;else if(1<_t){Xe=Array(_t);for(var Je=0;Je<_t;Je++)Xe[Je]=arguments[Je+2];ae.children=Xe}return{$$typeof:i,type:W.type,key:we,ref:De,props:ae,_owner:Ie}},an.createContext=function(W){return W={$$typeof:a,_currentValue:W,_currentValue2:W,_threadCount:0,Provider:null,Consumer:null,_defaultValue:null,_globalName:null},W.Provider={$$typeof:s,_context:W},W.Consumer=W},an.createElement=G,an.createFactory=function(W){var ne=G.bind(null,W);return ne.type=W,ne},an.createRef=function(){return{current:null}},an.forwardRef=function(W){return{$$typeof:u,render:W}},an.isValidElement=L,an.lazy=function(W){return{$$typeof:m,_payload:{_status:-1,_result:W},_init:he}},an.memo=function(W,ne){return{$$typeof:h,type:W,compare:ne===void 0?null:ne}},an.startTransition=function(W){var ne=H.transition;H.transition={};try{W()}finally{H.transition=ne}},an.unstable_act=q,an.useCallback=function(W,ne){return _e.current.useCallback(W,ne)},an.useContext=function(W){return _e.current.useContext(W)},an.useDebugValue=function(){},an.useDeferredValue=function(W){return _e.current.useDeferredValue(W)},an.useEffect=function(W,ne){return _e.current.useEffect(W,ne)},an.useId=function(){return _e.current.useId()},an.useImperativeHandle=function(W,ne,Fe){return _e.current.useImperativeHandle(W,ne,Fe)},an.useInsertionEffect=function(W,ne){return _e.current.useInsertionEffect(W,ne)},an.useLayoutEffect=function(W,ne){return _e.current.useLayoutEffect(W,ne)},an.useMemo=function(W,ne){return _e.current.useMemo(W,ne)},an.useReducer=function(W,ne,Fe){return _e.current.useReducer(W,ne,Fe)},an.useRef=function(W){return _e.current.useRef(W)},an.useState=function(W){return _e.current.useState(W)},an.useSyncExternalStore=function(W,ne,Fe){return _e.current.useSyncExternalStore(W,ne,Fe)},an.useTransition=function(){return _e.current.useTransition()},an.version="18.3.1",an}var I1;function td(){return I1||(I1=1,Nv.exports=mC()),Nv.exports}/**
 * @license React
 * react-jsx-runtime.production.min.js
 *
 * Copyright (c) Facebook, Inc. and its affiliates.
 *
 * This source code is licensed under the MIT license found in the
 * LICENSE file in the root directory of this source tree.
 */var P1;function gC(){if(P1)return rh;P1=1;var i=td(),e=Symbol.for("react.element"),t=Symbol.for("react.fragment"),n=Object.prototype.hasOwnProperty,r=i.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,s={key:!0,ref:!0,__self:!0,__source:!0};function a(u,d,h){var m,g={},v=null,_=null;h!==void 0&&(v=""+h),d.key!==void 0&&(v=""+d.key),d.ref!==void 0&&(_=d.ref);for(m in d)n.call(d,m)&&!s.hasOwnProperty(m)&&(g[m]=d[m]);if(u&&u.defaultProps)for(m in d=u.defaultProps,d)g[m]===void 0&&(g[m]=d[m]);return{$$typeof:e,type:u,key:v,ref:_,props:g,_owner:r.current}}return rh.Fragment=t,rh.jsx=a,rh.jsxs=a,rh}var B1;function vC(){return B1||(B1=1,Fv.exports=gC()),Fv.exports}var fe=vC(),Y=td(),mm={},Uv={exports:{}},Lr={},Ov={exports:{}},kv={};/**
 * @license React
 * scheduler.production.min.js
 *
 * Copyright (c) Facebook, Inc. and its affiliates.
 *
 * This source code is licensed under the MIT license found in the
 * LICENSE file in the root directory of this source tree.
 */var L1;function yC(){return L1||(L1=1,function(i){function e(H,Z){var q=H.length;H.push(Z);e:for(;0<q;){var W=q-1>>>1,ne=H[W];if(0<r(ne,Z))H[W]=Z,H[q]=ne,q=W;else break e}}function t(H){return H.length===0?null:H[0]}function n(H){if(H.length===0)return null;var Z=H[0],q=H.pop();if(q!==Z){H[0]=q;e:for(var W=0,ne=H.length,Fe=ne>>>1;W<Fe;){var ae=2*(W+1)-1,we=H[ae],De=ae+1,Ie=H[De];if(0>r(we,q))De<ne&&0>r(Ie,we)?(H[W]=Ie,H[De]=q,W=De):(H[W]=we,H[ae]=q,W=ae);else if(De<ne&&0>r(Ie,q))H[W]=Ie,H[De]=q,W=De;else break e}}return Z}function r(H,Z){var q=H.sortIndex-Z.sortIndex;return q!==0?q:H.id-Z.id}if(typeof performance=="object"&&typeof performance.now=="function"){var s=performance;i.unstable_now=function(){return s.now()}}else{var a=Date,u=a.now();i.unstable_now=function(){return a.now()-u}}var d=[],h=[],m=1,g=null,v=3,_=!1,A=!1,C=!1,M=typeof setTimeout=="function"?setTimeout:null,S=typeof clearTimeout=="function"?clearTimeout:null,b=typeof setImmediate<"u"?setImmediate:null;typeof navigator<"u"&&navigator.scheduling!==void 0&&navigator.scheduling.isInputPending!==void 0&&navigator.scheduling.isInputPending.bind(navigator.scheduling);function R(H){for(var Z=t(h);Z!==null;){if(Z.callback===null)n(h);else if(Z.startTime<=H)n(h),Z.sortIndex=Z.expirationTime,e(d,Z);else break;Z=t(h)}}function P(H){if(C=!1,R(H),!A)if(t(d)!==null)A=!0,he(U);else{var Z=t(h);Z!==null&&_e(P,Z.startTime-H)}}function U(H,Z){A=!1,C&&(C=!1,S(G),G=-1),_=!0;var q=v;try{for(R(Z),g=t(d);g!==null&&(!(g.expirationTime>Z)||H&&!V());){var W=g.callback;if(typeof W=="function"){g.callback=null,v=g.priorityLevel;var ne=W(g.expirationTime<=Z);Z=i.unstable_now(),typeof ne=="function"?g.callback=ne:g===t(d)&&n(d),R(Z)}else n(d);g=t(d)}if(g!==null)var Fe=!0;else{var ae=t(h);ae!==null&&_e(P,ae.startTime-Z),Fe=!1}return Fe}finally{g=null,v=q,_=!1}}var F=!1,k=null,G=-1,D=5,L=-1;function V(){return!(i.unstable_now()-L<D)}function oe(){if(k!==null){var H=i.unstable_now();L=H;var Z=!0;try{Z=k(!0,H)}finally{Z?ie():(F=!1,k=null)}}else F=!1}var ie;if(typeof b=="function")ie=function(){b(oe)};else if(typeof MessageChannel<"u"){var ge=new MessageChannel,ye=ge.port2;ge.port1.onmessage=oe,ie=function(){ye.postMessage(null)}}else ie=function(){M(oe,0)};function he(H){k=H,F||(F=!0,ie())}function _e(H,Z){G=M(function(){H(i.unstable_now())},Z)}i.unstable_IdlePriority=5,i.unstable_ImmediatePriority=1,i.unstable_LowPriority=4,i.unstable_NormalPriority=3,i.unstable_Profiling=null,i.unstable_UserBlockingPriority=2,i.unstable_cancelCallback=function(H){H.callback=null},i.unstable_continueExecution=function(){A||_||(A=!0,he(U))},i.unstable_forceFrameRate=function(H){0>H||125<H?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):D=0<H?Math.floor(1e3/H):5},i.unstable_getCurrentPriorityLevel=function(){return v},i.unstable_getFirstCallbackNode=function(){return t(d)},i.unstable_next=function(H){switch(v){case 1:case 2:case 3:var Z=3;break;default:Z=v}var q=v;v=Z;try{return H()}finally{v=q}},i.unstable_pauseExecution=function(){},i.unstable_requestPaint=function(){},i.unstable_runWithPriority=function(H,Z){switch(H){case 1:case 2:case 3:case 4:case 5:break;default:H=3}var q=v;v=H;try{return Z()}finally{v=q}},i.unstable_scheduleCallback=function(H,Z,q){var W=i.unstable_now();switch(typeof q=="object"&&q!==null?(q=q.delay,q=typeof q=="number"&&0<q?W+q:W):q=W,H){case 1:var ne=-1;break;case 2:ne=250;break;case 5:ne=1073741823;break;case 4:ne=1e4;break;default:ne=5e3}return ne=q+ne,H={id:m++,callback:Z,priorityLevel:H,startTime:q,expirationTime:ne,sortIndex:-1},q>W?(H.sortIndex=q,e(h,H),t(d)===null&&H===t(h)&&(C?(S(G),G=-1):C=!0,_e(P,q-W))):(H.sortIndex=ne,e(d,H),A||_||(A=!0,he(U))),H},i.unstable_shouldYield=V,i.unstable_wrapCallback=function(H){var Z=v;return function(){var q=v;v=Z;try{return H.apply(this,arguments)}finally{v=q}}}}(kv)),kv}var D1;function _C(){return D1||(D1=1,Ov.exports=yC()),Ov.exports}/**
 * @license React
 * react-dom.production.min.js
 *
 * Copyright (c) Facebook, Inc. and its affiliates.
 *
 * This source code is licensed under the MIT license found in the
 * LICENSE file in the root directory of this source tree.
 */var F1;function xC(){if(F1)return Lr;F1=1;var i=td(),e=_C();function t(o){for(var l="https://reactjs.org/docs/error-decoder.html?invariant="+o,p=1;p<arguments.length;p++)l+="&args[]="+encodeURIComponent(arguments[p]);return"Minified React error #"+o+"; visit "+l+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}var n=new Set,r={};function s(o,l){a(o,l),a(o+"Capture",l)}function a(o,l){for(r[o]=l,o=0;o<l.length;o++)n.add(l[o])}var u=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),d=Object.prototype.hasOwnProperty,h=/^[: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]*$/,m={},g={};function v(o){return d.call(g,o)?!0:d.call(m,o)?!1:h.test(o)?g[o]=!0:(m[o]=!0,!1)}function _(o,l,p,x){if(p!==null&&p.type===0)return!1;switch(typeof l){case"function":case"symbol":return!0;case"boolean":return x?!1:p!==null?!p.acceptsBooleans:(o=o.toLowerCase().slice(0,5),o!=="data-"&&o!=="aria-");default:return!1}}function A(o,l,p,x){if(l===null||typeof l>"u"||_(o,l,p,x))return!0;if(x)return!1;if(p!==null)switch(p.type){case 3:return!l;case 4:return l===!1;case 5:return isNaN(l);case 6:return isNaN(l)||1>l}return!1}function C(o,l,p,x,w,I,N){this.acceptsBooleans=l===2||l===3||l===4,this.attributeName=x,this.attributeNamespace=w,this.mustUseProperty=p,this.propertyName=o,this.type=l,this.sanitizeURL=I,this.removeEmptyString=N}var M={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(o){M[o]=new C(o,0,!1,o,null,!1,!1)}),[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(function(o){var l=o[0];M[l]=new C(l,1,!1,o[1],null,!1,!1)}),["contentEditable","draggable","spellCheck","value"].forEach(function(o){M[o]=new C(o,2,!1,o.toLowerCase(),null,!1,!1)}),["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(o){M[o]=new C(o,2,!1,o,null,!1,!1)}),"allowFullScreen async autoFocus autoPlay controls default defer disabled disablePictureInPicture disableRemotePlayback formNoValidate hidden loop noModule noValidate open playsInline readOnly required reversed scoped seamless itemScope".split(" ").forEach(function(o){M[o]=new C(o,3,!1,o.toLowerCase(),null,!1,!1)}),["checked","multiple","muted","selected"].forEach(function(o){M[o]=new C(o,3,!0,o,null,!1,!1)}),["capture","download"].forEach(function(o){M[o]=new C(o,4,!1,o,null,!1,!1)}),["cols","rows","size","span"].forEach(function(o){M[o]=new C(o,6,!1,o,null,!1,!1)}),["rowSpan","start"].forEach(function(o){M[o]=new C(o,5,!1,o.toLowerCase(),null,!1,!1)});var S=/[\-:]([a-z])/g;function b(o){return o[1].toUpperCase()}"accent-height alignment-baseline arabic-form baseline-shift cap-height clip-path clip-rule color-interpolation color-interpolation-filters color-profile color-rendering dominant-baseline enable-background fill-opacity fill-rule flood-color flood-opacity font-family font-size font-size-adjust font-stretch font-style font-variant font-weight glyph-name glyph-orientation-horizontal glyph-orientation-vertical horiz-adv-x horiz-origin-x image-rendering letter-spacing lighting-color marker-end marker-mid marker-start overline-position overline-thickness paint-order panose-1 pointer-events rendering-intent shape-rendering stop-color stop-opacity strikethrough-position strikethrough-thickness stroke-dasharray stroke-dashoffset stroke-linecap stroke-linejoin stroke-miterlimit stroke-opacity stroke-width text-anchor text-decoration text-rendering underline-position underline-thickness unicode-bidi unicode-range units-per-em v-alphabetic v-hanging v-ideographic v-mathematical vector-effect vert-adv-y vert-origin-x vert-origin-y word-spacing writing-mode xmlns:xlink x-height".split(" ").forEach(function(o){var l=o.replace(S,b);M[l]=new C(l,1,!1,o,null,!1,!1)}),"xlink:actuate xlink:arcrole xlink:role xlink:show xlink:title xlink:type".split(" ").forEach(function(o){var l=o.replace(S,b);M[l]=new C(l,1,!1,o,"http://www.w3.org/1999/xlink",!1,!1)}),["xml:base","xml:lang","xml:space"].forEach(function(o){var l=o.replace(S,b);M[l]=new C(l,1,!1,o,"http://www.w3.org/XML/1998/namespace",!1,!1)}),["tabIndex","crossOrigin"].forEach(function(o){M[o]=new C(o,1,!1,o.toLowerCase(),null,!1,!1)}),M.xlinkHref=new C("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1),["src","href","action","formAction"].forEach(function(o){M[o]=new C(o,1,!1,o.toLowerCase(),null,!0,!0)});function R(o,l,p,x){var w=M.hasOwnProperty(l)?M[l]:null;(w!==null?w.type!==0:x||!(2<l.length)||l[0]!=="o"&&l[0]!=="O"||l[1]!=="n"&&l[1]!=="N")&&(A(l,p,w,x)&&(p=null),x||w===null?v(l)&&(p===null?o.removeAttribute(l):o.setAttribute(l,""+p)):w.mustUseProperty?o[w.propertyName]=p===null?w.type===3?!1:"":p:(l=w.attributeName,x=w.attributeNamespace,p===null?o.removeAttribute(l):(w=w.type,p=w===3||w===4&&p===!0?"":""+p,x?o.setAttributeNS(x,l,p):o.setAttribute(l,p))))}var P=i.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED,U=Symbol.for("react.element"),F=Symbol.for("react.portal"),k=Symbol.for("react.fragment"),G=Symbol.for("react.strict_mode"),D=Symbol.for("react.profiler"),L=Symbol.for("react.provider"),V=Symbol.for("react.context"),oe=Symbol.for("react.forward_ref"),ie=Symbol.for("react.suspense"),ge=Symbol.for("react.suspense_list"),ye=Symbol.for("react.memo"),he=Symbol.for("react.lazy"),_e=Symbol.for("react.offscreen"),H=Symbol.iterator;function Z(o){return o===null||typeof o!="object"?null:(o=H&&o[H]||o["@@iterator"],typeof o=="function"?o:null)}var q=Object.assign,W;function ne(o){if(W===void 0)try{throw Error()}catch(p){var l=p.stack.trim().match(/\n( *(at )?)/);W=l&&l[1]||""}return`
`+W+o}var Fe=!1;function ae(o,l){if(!o||Fe)return"";Fe=!0;var p=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{if(l)if(l=function(){throw Error()},Object.defineProperty(l.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(l,[])}catch(Se){var x=Se}Reflect.construct(o,[],l)}else{try{l.call()}catch(Se){x=Se}o.call(l.prototype)}else{try{throw Error()}catch(Se){x=Se}o()}}catch(Se){if(Se&&x&&typeof Se.stack=="string"){for(var w=Se.stack.split(`
`),I=x.stack.split(`
`),N=w.length-1,Q=I.length-1;1<=N&&0<=Q&&w[N]!==I[Q];)Q--;for(;1<=N&&0<=Q;N--,Q--)if(w[N]!==I[Q]){if(N!==1||Q!==1)do if(N--,Q--,0>Q||w[N]!==I[Q]){var te=`
`+w[N].replace(" at new "," at ");return o.displayName&&te.includes("<anonymous>")&&(te=te.replace("<anonymous>",o.displayName)),te}while(1<=N&&0<=Q);break}}}finally{Fe=!1,Error.prepareStackTrace=p}return(o=o?o.displayName||o.name:"")?ne(o):""}function we(o){switch(o.tag){case 5:return ne(o.type);case 16:return ne("Lazy");case 13:return ne("Suspense");case 19:return ne("SuspenseList");case 0:case 2:case 15:return o=ae(o.type,!1),o;case 11:return o=ae(o.type.render,!1),o;case 1:return o=ae(o.type,!0),o;default:return""}}function De(o){if(o==null)return null;if(typeof o=="function")return o.displayName||o.name||null;if(typeof o=="string")return o;switch(o){case k:return"Fragment";case F:return"Portal";case D:return"Profiler";case G:return"StrictMode";case ie:return"Suspense";case ge:return"SuspenseList"}if(typeof o=="object")switch(o.$$typeof){case V:return(o.displayName||"Context")+".Consumer";case L:return(o._context.displayName||"Context")+".Provider";case oe:var l=o.render;return o=o.displayName,o||(o=l.displayName||l.name||"",o=o!==""?"ForwardRef("+o+")":"ForwardRef"),o;case ye:return l=o.displayName||null,l!==null?l:De(o.type)||"Memo";case he:l=o._payload,o=o._init;try{return De(o(l))}catch{}}return null}function Ie(o){var l=o.type;switch(o.tag){case 24:return"Cache";case 9:return(l.displayName||"Context")+".Consumer";case 10:return(l._context.displayName||"Context")+".Provider";case 18:return"DehydratedFragment";case 11:return o=l.render,o=o.displayName||o.name||"",l.displayName||(o!==""?"ForwardRef("+o+")":"ForwardRef");case 7:return"Fragment";case 5:return l;case 4:return"Portal";case 3:return"Root";case 6:return"Text";case 16:return De(l);case 8:return l===G?"StrictMode":"Mode";case 22:return"Offscreen";case 12:return"Profiler";case 21:return"Scope";case 13:return"Suspense";case 19:return"SuspenseList";case 25:return"TracingMarker";case 1:case 0:case 17:case 2:case 14:case 15:if(typeof l=="function")return l.displayName||l.name||null;if(typeof l=="string")return l}return null}function Xe(o){switch(typeof o){case"boolean":case"number":case"string":case"undefined":return o;case"object":return o;default:return""}}function _t(o){var l=o.type;return(o=o.nodeName)&&o.toLowerCase()==="input"&&(l==="checkbox"||l==="radio")}function Je(o){var l=_t(o)?"checked":"value",p=Object.getOwnPropertyDescriptor(o.constructor.prototype,l),x=""+o[l];if(!o.hasOwnProperty(l)&&typeof p<"u"&&typeof p.get=="function"&&typeof p.set=="function"){var w=p.get,I=p.set;return Object.defineProperty(o,l,{configurable:!0,get:function(){return w.call(this)},set:function(N){x=""+N,I.call(this,N)}}),Object.defineProperty(o,l,{enumerable:p.enumerable}),{getValue:function(){return x},setValue:function(N){x=""+N},stopTracking:function(){o._valueTracker=null,delete o[l]}}}}function st(o){o._valueTracker||(o._valueTracker=Je(o))}function Ne(o){if(!o)return!1;var l=o._valueTracker;if(!l)return!0;var p=l.getValue(),x="";return o&&(x=_t(o)?o.checked?"true":"false":o.value),o=x,o!==p?(l.setValue(o),!0):!1}function be(o){if(o=o||(typeof document<"u"?document:void 0),typeof o>"u")return null;try{return o.activeElement||o.body}catch{return o.body}}function J(o,l){var p=l.checked;return q({},l,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:p??o._wrapperState.initialChecked})}function mt(o,l){var p=l.defaultValue==null?"":l.defaultValue,x=l.checked!=null?l.checked:l.defaultChecked;p=Xe(l.value!=null?l.value:p),o._wrapperState={initialChecked:x,initialValue:p,controlled:l.type==="checkbox"||l.type==="radio"?l.checked!=null:l.value!=null}}function ke(o,l){l=l.checked,l!=null&&R(o,"checked",l,!1)}function et(o,l){ke(o,l);var p=Xe(l.value),x=l.type;if(p!=null)x==="number"?(p===0&&o.value===""||o.value!=p)&&(o.value=""+p):o.value!==""+p&&(o.value=""+p);else if(x==="submit"||x==="reset"){o.removeAttribute("value");return}l.hasOwnProperty("value")?wt(o,l.type,p):l.hasOwnProperty("defaultValue")&&wt(o,l.type,Xe(l.defaultValue)),l.checked==null&&l.defaultChecked!=null&&(o.defaultChecked=!!l.defaultChecked)}function je(o,l,p){if(l.hasOwnProperty("value")||l.hasOwnProperty("defaultValue")){var x=l.type;if(!(x!=="submit"&&x!=="reset"||l.value!==void 0&&l.value!==null))return;l=""+o._wrapperState.initialValue,p||l===o.value||(o.value=l),o.defaultValue=l}p=o.name,p!==""&&(o.name=""),o.defaultChecked=!!o._wrapperState.initialChecked,p!==""&&(o.name=p)}function wt(o,l,p){(l!=="number"||be(o.ownerDocument)!==o)&&(p==null?o.defaultValue=""+o._wrapperState.initialValue:o.defaultValue!==""+p&&(o.defaultValue=""+p))}var qe=Array.isArray;function j(o,l,p,x){if(o=o.options,l){l={};for(var w=0;w<p.length;w++)l["$"+p[w]]=!0;for(p=0;p<o.length;p++)w=l.hasOwnProperty("$"+o[p].value),o[p].selected!==w&&(o[p].selected=w),w&&x&&(o[p].defaultSelected=!0)}else{for(p=""+Xe(p),l=null,w=0;w<o.length;w++){if(o[w].value===p){o[w].selected=!0,x&&(o[w].defaultSelected=!0);return}l!==null||o[w].disabled||(l=o[w])}l!==null&&(l.selected=!0)}}function O(o,l){if(l.dangerouslySetInnerHTML!=null)throw Error(t(91));return q({},l,{value:void 0,defaultValue:void 0,children:""+o._wrapperState.initialValue})}function pe(o,l){var p=l.value;if(p==null){if(p=l.children,l=l.defaultValue,p!=null){if(l!=null)throw Error(t(92));if(qe(p)){if(1<p.length)throw Error(t(93));p=p[0]}l=p}l==null&&(l=""),p=l}o._wrapperState={initialValue:Xe(p)}}function Ce(o,l){var p=Xe(l.value),x=Xe(l.defaultValue);p!=null&&(p=""+p,p!==o.value&&(o.value=p),l.defaultValue==null&&o.defaultValue!==p&&(o.defaultValue=p)),x!=null&&(o.defaultValue=""+x)}function Ue(o){var l=o.textContent;l===o._wrapperState.initialValue&&l!==""&&l!==null&&(o.value=l)}function Pe(o){switch(o){case"svg":return"http://www.w3.org/2000/svg";case"math":return"http://www.w3.org/1998/Math/MathML";default:return"http://www.w3.org/1999/xhtml"}}function ot(o,l){return o==null||o==="http://www.w3.org/1999/xhtml"?Pe(l):o==="http://www.w3.org/2000/svg"&&l==="foreignObject"?"http://www.w3.org/1999/xhtml":o}var Ze,ct=function(o){return typeof MSApp<"u"&&MSApp.execUnsafeLocalFunction?function(l,p,x,w){MSApp.execUnsafeLocalFunction(function(){return o(l,p,x,w)})}:o}(function(o,l){if(o.namespaceURI!=="http://www.w3.org/2000/svg"||"innerHTML"in o)o.innerHTML=l;else{for(Ze=Ze||document.createElement("div"),Ze.innerHTML="<svg>"+l.valueOf().toString()+"</svg>",l=Ze.firstChild;o.firstChild;)o.removeChild(o.firstChild);for(;l.firstChild;)o.appendChild(l.firstChild)}});function zt(o,l){if(l){var p=o.firstChild;if(p&&p===o.lastChild&&p.nodeType===3){p.nodeValue=l;return}}o.textContent=l}var ze={animationIterationCount:!0,aspectRatio:!0,borderImageOutset:!0,borderImageSlice:!0,borderImageWidth:!0,boxFlex:!0,boxFlexGroup:!0,boxOrdinalGroup:!0,columnCount:!0,columns:!0,flex:!0,flexGrow:!0,flexPositive:!0,flexShrink:!0,flexNegative:!0,flexOrder:!0,gridArea:!0,gridRow:!0,gridRowEnd:!0,gridRowSpan:!0,gridRowStart:!0,gridColumn:!0,gridColumnEnd:!0,gridColumnSpan:!0,gridColumnStart:!0,fontWeight:!0,lineClamp:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,tabSize:!0,widows:!0,zIndex:!0,zoom:!0,fillOpacity:!0,floodOpacity:!0,stopOpacity:!0,strokeDasharray:!0,strokeDashoffset:!0,strokeMiterlimit:!0,strokeOpacity:!0,strokeWidth:!0},gt=["Webkit","ms","Moz","O"];Object.keys(ze).forEach(function(o){gt.forEach(function(l){l=l+o.charAt(0).toUpperCase()+o.substring(1),ze[l]=ze[o]})});function Pt(o,l,p){return l==null||typeof l=="boolean"||l===""?"":p||typeof l!="number"||l===0||ze.hasOwnProperty(o)&&ze[o]?(""+l).trim():l+"px"}function Dt(o,l){o=o.style;for(var p in l)if(l.hasOwnProperty(p)){var x=p.indexOf("--")===0,w=Pt(p,l[p],x);p==="float"&&(p="cssFloat"),x?o.setProperty(p,w):o[p]=w}}var ht=q({menuitem:!0},{area:!0,base:!0,br:!0,col:!0,embed:!0,hr:!0,img:!0,input:!0,keygen:!0,link:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0});function ee(o,l){if(l){if(ht[o]&&(l.children!=null||l.dangerouslySetInnerHTML!=null))throw Error(t(137,o));if(l.dangerouslySetInnerHTML!=null){if(l.children!=null)throw Error(t(60));if(typeof l.dangerouslySetInnerHTML!="object"||!("__html"in l.dangerouslySetInnerHTML))throw Error(t(61))}if(l.style!=null&&typeof l.style!="object")throw Error(t(62))}}function Re(o,l){if(o.indexOf("-")===-1)return typeof l.is=="string";switch(o){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 nt=null;function $(o){return o=o.target||o.srcElement||window,o.correspondingUseElement&&(o=o.correspondingUseElement),o.nodeType===3?o.parentNode:o}var Ve=null,Me=null,Be=null;function ut(o){if(o=Bs(o)){if(typeof Ve!="function")throw Error(t(280));var l=o.stateNode;l&&(l=Kc(l),Ve(o.stateNode,o.type,l))}}function it(o){Me?Be?Be.push(o):Be=[o]:Me=o}function It(){if(Me){var o=Me,l=Be;if(Be=Me=null,ut(o),l)for(o=0;o<l.length;o++)ut(l[o])}}function ln(o,l){return o(l)}function Cn(){}var Yt=!1;function Gn(o,l,p){if(Yt)return o(l,p);Yt=!0;try{return ln(o,l,p)}finally{Yt=!1,(Me!==null||Be!==null)&&(Cn(),It())}}function Kn(o,l){var p=o.stateNode;if(p===null)return null;var x=Kc(p);if(x===null)return null;p=x[l];e:switch(l){case"onClick":case"onClickCapture":case"onDoubleClick":case"onDoubleClickCapture":case"onMouseDown":case"onMouseDownCapture":case"onMouseMove":case"onMouseMoveCapture":case"onMouseUp":case"onMouseUpCapture":case"onMouseEnter":(x=!x.disabled)||(o=o.type,x=!(o==="button"||o==="input"||o==="select"||o==="textarea")),o=!x;break e;default:o=!1}if(o)return null;if(p&&typeof p!="function")throw Error(t(231,l,typeof p));return p}var Ba=!1;if(u)try{var oo={};Object.defineProperty(oo,"passive",{get:function(){Ba=!0}}),window.addEventListener("test",oo,oo),window.removeEventListener("test",oo,oo)}catch{Ba=!1}function rs(o,l,p,x,w,I,N,Q,te){var Se=Array.prototype.slice.call(arguments,3);try{l.apply(p,Se)}catch(He){this.onError(He)}}var kr=!1,Po=null,Hr=!1,ao=null,lc={onError:function(o){kr=!0,Po=o}};function La(o,l,p,x,w,I,N,Q,te){kr=!1,Po=null,rs.apply(lc,arguments)}function uc(o,l,p,x,w,I,N,Q,te){if(La.apply(this,arguments),kr){if(kr){var Se=Po;kr=!1,Po=null}else throw Error(t(198));Hr||(Hr=!0,ao=Se)}}function ss(o){var l=o,p=o;if(o.alternate)for(;l.return;)l=l.return;else{o=l;do l=o,l.flags&4098&&(p=l.return),o=l.return;while(o)}return l.tag===3?p:null}function cc(o){if(o.tag===13){var l=o.memoizedState;if(l===null&&(o=o.alternate,o!==null&&(l=o.memoizedState)),l!==null)return l.dehydrated}return null}function fc(o){if(ss(o)!==o)throw Error(t(188))}function dc(o){var l=o.alternate;if(!l){if(l=ss(o),l===null)throw Error(t(188));return l!==o?null:o}for(var p=o,x=l;;){var w=p.return;if(w===null)break;var I=w.alternate;if(I===null){if(x=w.return,x!==null){p=x;continue}break}if(w.child===I.child){for(I=w.child;I;){if(I===p)return fc(w),o;if(I===x)return fc(w),l;I=I.sibling}throw Error(t(188))}if(p.return!==x.return)p=w,x=I;else{for(var N=!1,Q=w.child;Q;){if(Q===p){N=!0,p=w,x=I;break}if(Q===x){N=!0,x=w,p=I;break}Q=Q.sibling}if(!N){for(Q=I.child;Q;){if(Q===p){N=!0,p=I,x=w;break}if(Q===x){N=!0,x=I,p=w;break}Q=Q.sibling}if(!N)throw Error(t(189))}}if(p.alternate!==x)throw Error(t(190))}if(p.tag!==3)throw Error(t(188));return p.stateNode.current===p?o:l}function hc(o){return o=dc(o),o!==null?pc(o):null}function pc(o){if(o.tag===5||o.tag===6)return o;for(o=o.child;o!==null;){var l=pc(o);if(l!==null)return l;o=o.sibling}return null}var mc=e.unstable_scheduleCallback,z=e.unstable_cancelCallback,le=e.unstable_shouldYield,Ae=e.unstable_requestPaint,de=e.unstable_now,ce=e.unstable_getCurrentPriorityLevel,Ge=e.unstable_ImmediatePriority,rt=e.unstable_UserBlockingPriority,dt=e.unstable_NormalPriority,vt=e.unstable_LowPriority,Bt=e.unstable_IdlePriority,Rt=null,Ye=null;function Mt(o){if(Ye&&typeof Ye.onCommitFiberRoot=="function")try{Ye.onCommitFiberRoot(Rt,o,void 0,(o.current.flags&128)===128)}catch{}}var kt=Math.clz32?Math.clz32:Qt,nn=Math.log,rn=Math.LN2;function Qt(o){return o>>>=0,o===0?32:31-(nn(o)/rn|0)|0}var St=64,un=4194304;function $t(o){switch(o&-o){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return o&4194240;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return o&130023424;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 1073741824;default:return o}}function mi(o,l){var p=o.pendingLanes;if(p===0)return 0;var x=0,w=o.suspendedLanes,I=o.pingedLanes,N=p&268435455;if(N!==0){var Q=N&~w;Q!==0?x=$t(Q):(I&=N,I!==0&&(x=$t(I)))}else N=p&~w,N!==0?x=$t(N):I!==0&&(x=$t(I));if(x===0)return 0;if(l!==0&&l!==x&&!(l&w)&&(w=x&-x,I=l&-l,w>=I||w===16&&(I&4194240)!==0))return l;if(x&4&&(x|=p&16),l=o.entangledLanes,l!==0)for(o=o.entanglements,l&=x;0<l;)p=31-kt(l),w=1<<p,x|=o[p],l&=~w;return x}function Ms(o,l){switch(o){case 1:case 2:case 4:return l+250;case 8:case 16:case 32:case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return l+5e3;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return-1;case 134217728:case 268435456:case 536870912:case 1073741824:return-1;default:return-1}}function oi(o,l){for(var p=o.suspendedLanes,x=o.pingedLanes,w=o.expirationTimes,I=o.pendingLanes;0<I;){var N=31-kt(I),Q=1<<N,te=w[N];te===-1?(!(Q&p)||Q&x)&&(w[N]=Ms(Q,l)):te<=l&&(o.expiredLanes|=Q),I&=~Q}}function os(o){return o=o.pendingLanes&-1073741825,o!==0?o:o&1073741824?1073741824:0}function sn(){var o=St;return St<<=1,!(St&4194240)&&(St=64),o}function Ti(o){for(var l=[],p=0;31>p;p++)l.push(o);return l}function ai(o,l,p){o.pendingLanes|=l,l!==536870912&&(o.suspendedLanes=0,o.pingedLanes=0),o=o.eventTimes,l=31-kt(l),o[l]=p}function gi(o,l){var p=o.pendingLanes&~l;o.pendingLanes=l,o.suspendedLanes=0,o.pingedLanes=0,o.expiredLanes&=l,o.mutableReadLanes&=l,o.entangledLanes&=l,l=o.entanglements;var x=o.eventTimes;for(o=o.expirationTimes;0<p;){var w=31-kt(p),I=1<<w;l[w]=0,x[w]=-1,o[w]=-1,p&=~I}}function Vn(o,l){var p=o.entangledLanes|=l;for(o=o.entanglements;p;){var x=31-kt(p),w=1<<x;w&l|o[x]&l&&(o[x]|=l),p&=~w}}var on=0;function Ji(o){return o&=-o,1<o?4<o?o&268435455?16:536870912:4:1}var Pl,cd,Mp,gc,vc,Bo=!1,yc=[],as=null,en=null,Es=null,Lo=new Map,Da=new Map,lo=[],ov="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 submit".split(" ");function ei(o,l){switch(o){case"focusin":case"focusout":as=null;break;case"dragenter":case"dragleave":en=null;break;case"mouseover":case"mouseout":Es=null;break;case"pointerover":case"pointerout":Lo.delete(l.pointerId);break;case"gotpointercapture":case"lostpointercapture":Da.delete(l.pointerId)}}function Do(o,l,p,x,w,I){return o===null||o.nativeEvent!==I?(o={blockedOn:l,domEventName:p,eventSystemFlags:x,nativeEvent:I,targetContainers:[w]},l!==null&&(l=Bs(l),l!==null&&cd(l)),o):(o.eventSystemFlags|=x,l=o.targetContainers,w!==null&&l.indexOf(w)===-1&&l.push(w),o)}function av(o,l,p,x,w){switch(l){case"focusin":return as=Do(as,o,l,p,x,w),!0;case"dragenter":return en=Do(en,o,l,p,x,w),!0;case"mouseover":return Es=Do(Es,o,l,p,x,w),!0;case"pointerover":var I=w.pointerId;return Lo.set(I,Do(Lo.get(I)||null,o,l,p,x,w)),!0;case"gotpointercapture":return I=w.pointerId,Da.set(I,Do(Da.get(I)||null,o,l,p,x,w)),!0}return!1}function _c(o){var l=go(o.target);if(l!==null){var p=ss(l);if(p!==null){if(l=p.tag,l===13){if(l=cc(p),l!==null){o.blockedOn=l,vc(o.priority,function(){Mp(p)});return}}else if(l===3&&p.stateNode.current.memoizedState.isDehydrated){o.blockedOn=p.tag===3?p.stateNode.containerInfo:null;return}}}o.blockedOn=null}function xc(o){if(o.blockedOn!==null)return!1;for(var l=o.targetContainers;0<l.length;){var p=Mr(o.domEventName,o.eventSystemFlags,l[0],o.nativeEvent);if(p===null){p=o.nativeEvent;var x=new p.constructor(p.type,p);nt=x,p.target.dispatchEvent(x),nt=null}else return l=Bs(p),l!==null&&cd(l),o.blockedOn=p,!1;l.shift()}return!0}function Bl(o,l,p){xc(o)&&p.delete(l)}function ls(){Bo=!1,as!==null&&xc(as)&&(as=null),en!==null&&xc(en)&&(en=null),Es!==null&&xc(Es)&&(Es=null),Lo.forEach(Bl),Da.forEach(Bl)}function Ll(o,l){o.blockedOn===l&&(o.blockedOn=null,Bo||(Bo=!0,e.unstable_scheduleCallback(e.unstable_NormalPriority,ls)))}function Dl(o){function l(w){return Ll(w,o)}if(0<yc.length){Ll(yc[0],o);for(var p=1;p<yc.length;p++){var x=yc[p];x.blockedOn===o&&(x.blockedOn=null)}}for(as!==null&&Ll(as,o),en!==null&&Ll(en,o),Es!==null&&Ll(Es,o),Lo.forEach(l),Da.forEach(l),p=0;p<lo.length;p++)x=lo[p],x.blockedOn===o&&(x.blockedOn=null);for(;0<lo.length&&(p=lo[0],p.blockedOn===null);)_c(p),p.blockedOn===null&&lo.shift()}var Ni=P.ReactCurrentBatchConfig,Sr=!0;function Ac(o,l,p,x){var w=on,I=Ni.transition;Ni.transition=null;try{on=1,Sc(o,l,p,x)}finally{on=w,Ni.transition=I}}function fd(o,l,p,x){var w=on,I=Ni.transition;Ni.transition=null;try{on=4,Sc(o,l,p,x)}finally{on=w,Ni.transition=I}}function Sc(o,l,p,x){if(Sr){var w=Mr(o,l,p,x);if(w===null)Gc(o,l,x,Mc,p),ei(o,x);else if(av(w,o,l,p,x))x.stopPropagation();else if(ei(o,x),l&4&&-1<ov.indexOf(o)){for(;w!==null;){var I=Bs(w);if(I!==null&&Pl(I),I=Mr(o,l,p,x),I===null&&Gc(o,l,x,Mc,p),I===w)break;w=I}w!==null&&x.stopPropagation()}else Gc(o,l,x,null,p)}}var Mc=null;function Mr(o,l,p,x){if(Mc=null,o=$(x),o=go(o),o!==null)if(l=ss(o),l===null)o=null;else if(p=l.tag,p===13){if(o=cc(l),o!==null)return o;o=null}else if(p===3){if(l.stateNode.current.memoizedState.isDehydrated)return l.tag===3?l.stateNode.containerInfo:null;o=null}else l!==o&&(o=null);return Mc=o,null}function Ep(o){switch(o){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"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 1;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"toggle":case"touchmove":case"wheel":case"mouseenter":case"mouseleave":case"pointerenter":case"pointerleave":return 4;case"message":switch(ce()){case Ge:return 1;case rt:return 4;case dt:case vt:return 16;case Bt:return 536870912;default:return 16}default:return 16}}var zr=null,dd=null,Ki=null;function Fl(){if(Ki)return Ki;var o,l=dd,p=l.length,x,w="value"in zr?zr.value:zr.textContent,I=w.length;for(o=0;o<p&&l[o]===w[o];o++);var N=p-o;for(x=1;x<=N&&l[p-x]===w[I-x];x++);return Ki=w.slice(o,1<x?1-x:void 0)}function Fo(o){var l=o.keyCode;return"charCode"in o?(o=o.charCode,o===0&&l===13&&(o=13)):o=l,o===10&&(o=13),32<=o||o===13?o:0}function ws(){return!0}function Ec(){return!1}function Ui(o){function l(p,x,w,I,N){this._reactName=p,this._targetInst=w,this.type=x,this.nativeEvent=I,this.target=N,this.currentTarget=null;for(var Q in o)o.hasOwnProperty(Q)&&(p=o[Q],this[Q]=p?p(I):I[Q]);return this.isDefaultPrevented=(I.defaultPrevented!=null?I.defaultPrevented:I.returnValue===!1)?ws:Ec,this.isPropagationStopped=Ec,this}return q(l.prototype,{preventDefault:function(){this.defaultPrevented=!0;var p=this.nativeEvent;p&&(p.preventDefault?p.preventDefault():typeof p.returnValue!="unknown"&&(p.returnValue=!1),this.isDefaultPrevented=ws)},stopPropagation:function(){var p=this.nativeEvent;p&&(p.stopPropagation?p.stopPropagation():typeof p.cancelBubble!="unknown"&&(p.cancelBubble=!0),this.isPropagationStopped=ws)},persist:function(){},isPersistent:ws}),l}var No={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(o){return o.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},Nl=Ui(No),Uo=q({},No,{view:0,detail:0}),Fa=Ui(Uo),Yi,Er,wr,Na=q({},Uo,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:co,button:0,buttons:0,relatedTarget:function(o){return o.relatedTarget===void 0?o.fromElement===o.srcElement?o.toElement:o.fromElement:o.relatedTarget},movementX:function(o){return"movementX"in o?o.movementX:(o!==wr&&(wr&&o.type==="mousemove"?(Yi=o.screenX-wr.screenX,Er=o.screenY-wr.screenY):Er=Yi=0,wr=o),Yi)},movementY:function(o){return"movementY"in o?o.movementY:Er}}),hd=Ui(Na),Cs=q({},Na,{dataTransfer:0}),uo=Ui(Cs),wc=q({},Uo,{relatedTarget:0}),Cc=Ui(wc),Tc=q({},No,{animationName:0,elapsedTime:0,pseudoElement:0}),wp=Ui(Tc),Cp=q({},No,{clipboardData:function(o){return"clipboardData"in o?o.clipboardData:window.clipboardData}}),pd=Ui(Cp),bc=q({},No,{data:0}),md=Ui(bc),Tp={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},bp={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"},gd={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function Ua(o){var l=this.nativeEvent;return l.getModifierState?l.getModifierState(o):(o=gd[o])?!!l[o]:!1}function co(){return Ua}var Rc=q({},Uo,{key:function(o){if(o.key){var l=Tp[o.key]||o.key;if(l!=="Unidentified")return l}return o.type==="keypress"?(o=Fo(o),o===13?"Enter":String.fromCharCode(o)):o.type==="keydown"||o.type==="keyup"?bp[o.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:co,charCode:function(o){return o.type==="keypress"?Fo(o):0},keyCode:function(o){return o.type==="keydown"||o.type==="keyup"?o.keyCode:0},which:function(o){return o.type==="keypress"?Fo(o):o.type==="keydown"||o.type==="keyup"?o.keyCode:0}}),Ic=Ui(Rc),Cr=q({},Na,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),lr=Ui(Cr),Oo=q({},Uo,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:co}),Ts=Ui(Oo),bs=q({},No,{propertyName:0,elapsedTime:0,pseudoElement:0}),ko=Ui(bs),Rp=q({},Na,{deltaX:function(o){return"deltaX"in o?o.deltaX:"wheelDeltaX"in o?-o.wheelDeltaX:0},deltaY:function(o){return"deltaY"in o?o.deltaY:"wheelDeltaY"in o?-o.wheelDeltaY:"wheelDelta"in o?-o.wheelDelta:0},deltaZ:0,deltaMode:0}),vd=Ui(Rp),yd=[9,13,27,32],Oi=u&&"CompositionEvent"in window,vi=null;u&&"documentMode"in document&&(vi=document.documentMode);var Bn=u&&"TextEvent"in window&&!vi,Oa=u&&(!Oi||vi&&8<vi&&11>=vi),Tr=" ",_d=!1;function xd(o,l){switch(o){case"keyup":return yd.indexOf(l.keyCode)!==-1;case"keydown":return l.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function Pc(o){return o=o.detail,typeof o=="object"&&"data"in o?o.data:null}var fo=!1;function Ip(o,l){switch(o){case"compositionend":return Pc(l);case"keypress":return l.which!==32?null:(_d=!0,Tr);case"textInput":return o=l.data,o===Tr&&_d?null:o;default:return null}}function Ul(o,l){if(fo)return o==="compositionend"||!Oi&&xd(o,l)?(o=Fl(),Ki=dd=zr=null,fo=!1,o):null;switch(o){case"paste":return null;case"keypress":if(!(l.ctrlKey||l.altKey||l.metaKey)||l.ctrlKey&&l.altKey){if(l.char&&1<l.char.length)return l.char;if(l.which)return String.fromCharCode(l.which)}return null;case"compositionend":return Oa&&l.locale!=="ko"?null:l.data;default:return null}}var ka={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 Bc(o){var l=o&&o.nodeName&&o.nodeName.toLowerCase();return l==="input"?!!ka[o.type]:l==="textarea"}function Ha(o,l,p,x){it(x),l=Vc(l,"onChange"),0<l.length&&(p=new Nl("onChange","change",null,p,x),o.push({event:p,listeners:l}))}var ho=null,za=null;function Pp(o){Xa(o,0)}function Rs(o){var l=Wn(o);if(Ne(l))return o}function Bp(o,l){if(o==="change")return l}var Ga=!1;if(u){var Qi;if(u){var Ho="oninput"in document;if(!Ho){var zo=document.createElement("div");zo.setAttribute("oninput","return;"),Ho=typeof zo.oninput=="function"}Qi=Ho}else Qi=!1;Ga=Qi&&(!document.documentMode||9<document.documentMode)}function Gr(){ho&&(ho.detachEvent("onpropertychange",Lc),za=ho=null)}function Lc(o){if(o.propertyName==="value"&&Rs(za)){var l=[];Ha(l,za,o,$(o)),Gn(Pp,l)}}function Va(o,l,p){o==="focusin"?(Gr(),ho=l,za=p,ho.attachEvent("onpropertychange",Lc)):o==="focusout"&&Gr()}function Lp(o){if(o==="selectionchange"||o==="keyup"||o==="keydown")return Rs(za)}function Ad(o,l){if(o==="click")return Rs(l)}function Fn(o,l){if(o==="input"||o==="change")return Rs(l)}function Dc(o,l){return o===l&&(o!==0||1/o===1/l)||o!==o&&l!==l}var ur=typeof Object.is=="function"?Object.is:Dc;function Go(o,l){if(ur(o,l))return!0;if(typeof o!="object"||o===null||typeof l!="object"||l===null)return!1;var p=Object.keys(o),x=Object.keys(l);if(p.length!==x.length)return!1;for(x=0;x<p.length;x++){var w=p[x];if(!d.call(l,w)||!ur(o[w],l[w]))return!1}return!0}function Ol(o){for(;o&&o.firstChild;)o=o.firstChild;return o}function cr(o,l){var p=Ol(o);o=0;for(var x;p;){if(p.nodeType===3){if(x=o+p.textContent.length,o<=l&&x>=l)return{node:p,offset:l-o};o=x}e:{for(;p;){if(p.nextSibling){p=p.nextSibling;break e}p=p.parentNode}p=void 0}p=Ol(p)}}function Vo(o,l){return o&&l?o===l?!0:o&&o.nodeType===3?!1:l&&l.nodeType===3?Vo(o,l.parentNode):"contains"in o?o.contains(l):o.compareDocumentPosition?!!(o.compareDocumentPosition(l)&16):!1:!1}function Nn(){for(var o=window,l=be();l instanceof o.HTMLIFrameElement;){try{var p=typeof l.contentWindow.location.href=="string"}catch{p=!1}if(p)o=l.contentWindow;else break;l=be(o.document)}return l}function li(o){var l=o&&o.nodeName&&o.nodeName.toLowerCase();return l&&(l==="input"&&(o.type==="text"||o.type==="search"||o.type==="tel"||o.type==="url"||o.type==="password")||l==="textarea"||o.contentEditable==="true")}function ui(o){var l=Nn(),p=o.focusedElem,x=o.selectionRange;if(l!==p&&p&&p.ownerDocument&&Vo(p.ownerDocument.documentElement,p)){if(x!==null&&li(p)){if(l=x.start,o=x.end,o===void 0&&(o=l),"selectionStart"in p)p.selectionStart=l,p.selectionEnd=Math.min(o,p.value.length);else if(o=(l=p.ownerDocument||document)&&l.defaultView||window,o.getSelection){o=o.getSelection();var w=p.textContent.length,I=Math.min(x.start,w);x=x.end===void 0?I:Math.min(x.end,w),!o.extend&&I>x&&(w=x,x=I,I=w),w=cr(p,I);var N=cr(p,x);w&&N&&(o.rangeCount!==1||o.anchorNode!==w.node||o.anchorOffset!==w.offset||o.focusNode!==N.node||o.focusOffset!==N.offset)&&(l=l.createRange(),l.setStart(w.node,w.offset),o.removeAllRanges(),I>x?(o.addRange(l),o.extend(N.node,N.offset)):(l.setEnd(N.node,N.offset),o.addRange(l)))}}for(l=[],o=p;o=o.parentNode;)o.nodeType===1&&l.push({element:o,left:o.scrollLeft,top:o.scrollTop});for(typeof p.focus=="function"&&p.focus(),p=0;p<l.length;p++)o=l[p],o.element.scrollLeft=o.left,o.element.scrollTop=o.top}}var Fc=u&&"documentMode"in document&&11>=document.documentMode,us=null,Wo=null,kl=null,ci=!1;function Nc(o,l,p){var x=p.window===p?p.document:p.nodeType===9?p:p.ownerDocument;ci||us==null||us!==be(x)||(x=us,"selectionStart"in x&&li(x)?x={start:x.selectionStart,end:x.selectionEnd}:(x=(x.ownerDocument&&x.ownerDocument.defaultView||window).getSelection(),x={anchorNode:x.anchorNode,anchorOffset:x.anchorOffset,focusNode:x.focusNode,focusOffset:x.focusOffset}),kl&&Go(kl,x)||(kl=x,x=Vc(Wo,"onSelect"),0<x.length&&(l=new Nl("onSelect","select",null,l,p),o.push({event:l,listeners:x}),l.target=us)))}function Wa(o,l){var p={};return p[o.toLowerCase()]=l.toLowerCase(),p["Webkit"+o]="webkit"+l,p["Moz"+o]="moz"+l,p}var po={animationend:Wa("Animation","AnimationEnd"),animationiteration:Wa("Animation","AnimationIteration"),animationstart:Wa("Animation","AnimationStart"),transitionend:Wa("Transition","TransitionEnd")},Vr={},Wr={};u&&(Wr=document.createElement("div").style,"AnimationEvent"in window||(delete po.animationend.animation,delete po.animationiteration.animation,delete po.animationstart.animation),"TransitionEvent"in window||delete po.transitionend.transition);function cs(o){if(Vr[o])return Vr[o];if(!po[o])return o;var l=po[o],p;for(p in l)if(l.hasOwnProperty(p)&&p in Wr)return Vr[o]=l[p];return o}var Hl=cs("animationend"),zl=cs("animationiteration"),Sd=cs("animationstart"),Md=cs("transitionend"),Ed=new Map,wd="abort auxClick 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(" ");function Is(o,l){Ed.set(o,l),s(l,[o])}for(var Uc=0;Uc<wd.length;Uc++){var Gl=wd[Uc],Vl=Gl.toLowerCase(),Dp=Gl[0].toUpperCase()+Gl.slice(1);Is(Vl,"on"+Dp)}Is(Hl,"onAnimationEnd"),Is(zl,"onAnimationIteration"),Is(Sd,"onAnimationStart"),Is("dblclick","onDoubleClick"),Is("focusin","onFocus"),Is("focusout","onBlur"),Is(Md,"onTransitionEnd"),a("onMouseEnter",["mouseout","mouseover"]),a("onMouseLeave",["mouseout","mouseover"]),a("onPointerEnter",["pointerout","pointerover"]),a("onPointerLeave",["pointerout","pointerover"]),s("onChange","change click focusin focusout input keydown keyup selectionchange".split(" ")),s("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" ")),s("onBeforeInput",["compositionend","keypress","textInput","paste"]),s("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" ")),s("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" ")),s("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var mo="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(" "),Oc=new Set("cancel close invalid load scroll toggle".split(" ").concat(mo));function kc(o,l,p){var x=o.type||"unknown-event";o.currentTarget=p,uc(x,l,void 0,o),o.currentTarget=null}function Xa(o,l){l=(l&4)!==0;for(var p=0;p<o.length;p++){var x=o[p],w=x.event;x=x.listeners;e:{var I=void 0;if(l)for(var N=x.length-1;0<=N;N--){var Q=x[N],te=Q.instance,Se=Q.currentTarget;if(Q=Q.listener,te!==I&&w.isPropagationStopped())break e;kc(w,Q,Se),I=te}else for(N=0;N<x.length;N++){if(Q=x[N],te=Q.instance,Se=Q.currentTarget,Q=Q.listener,te!==I&&w.isPropagationStopped())break e;kc(w,Q,Se),I=te}}}if(Hr)throw o=ao,Hr=!1,ao=null,o}function Tn(o,l){var p=l[Jo];p===void 0&&(p=l[Jo]=new Set);var x=o+"__bubble";p.has(x)||(zc(l,o,2,!1),p.add(x))}function Hc(o,l,p){var x=0;l&&(x|=4),zc(p,o,x,l)}var Wl="_reactListening"+Math.random().toString(36).slice(2);function ja(o){if(!o[Wl]){o[Wl]=!0,n.forEach(function(p){p!=="selectionchange"&&(Oc.has(p)||Hc(p,!1,o),Hc(p,!0,o))});var l=o.nodeType===9?o:o.ownerDocument;l===null||l[Wl]||(l[Wl]=!0,Hc("selectionchange",!1,l))}}function zc(o,l,p,x){switch(Ep(l)){case 1:var w=Ac;break;case 4:w=fd;break;default:w=Sc}p=w.bind(null,l,p,o),w=void 0,!Ba||l!=="touchstart"&&l!=="touchmove"&&l!=="wheel"||(w=!0),x?w!==void 0?o.addEventListener(l,p,{capture:!0,passive:w}):o.addEventListener(l,p,!0):w!==void 0?o.addEventListener(l,p,{passive:w}):o.addEventListener(l,p,!1)}function Gc(o,l,p,x,w){var I=x;if(!(l&1)&&!(l&2)&&x!==null)e:for(;;){if(x===null)return;var N=x.tag;if(N===3||N===4){var Q=x.stateNode.containerInfo;if(Q===w||Q.nodeType===8&&Q.parentNode===w)break;if(N===4)for(N=x.return;N!==null;){var te=N.tag;if((te===3||te===4)&&(te=N.stateNode.containerInfo,te===w||te.nodeType===8&&te.parentNode===w))return;N=N.return}for(;Q!==null;){if(N=go(Q),N===null)return;if(te=N.tag,te===5||te===6){x=I=N;continue e}Q=Q.parentNode}}x=x.return}Gn(function(){var Se=I,He=$(p),We=[];e:{var Oe=Ed.get(o);if(Oe!==void 0){var pt=Nl,At=o;switch(o){case"keypress":if(Fo(p)===0)break e;case"keydown":case"keyup":pt=Ic;break;case"focusin":At="focus",pt=Cc;break;case"focusout":At="blur",pt=Cc;break;case"beforeblur":case"afterblur":pt=Cc;break;case"click":if(p.button===2)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":pt=hd;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":pt=uo;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":pt=Ts;break;case Hl:case zl:case Sd:pt=wp;break;case Md:pt=ko;break;case"scroll":pt=Fa;break;case"wheel":pt=vd;break;case"copy":case"cut":case"paste":pt=pd;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":pt=lr}var Et=(l&4)!==0,ni=!Et&&o==="scroll",me=Et?Oe!==null?Oe+"Capture":null:Oe;Et=[];for(var re=Se,ve;re!==null;){ve=re;var Qe=ve.stateNode;if(ve.tag===5&&Qe!==null&&(ve=Qe,me!==null&&(Qe=Kn(re,me),Qe!=null&&Et.push(Ja(re,Qe,ve)))),ni)break;re=re.return}0<Et.length&&(Oe=new pt(Oe,At,null,p,He),We.push({event:Oe,listeners:Et}))}}if(!(l&7)){e:{if(Oe=o==="mouseover"||o==="pointerover",pt=o==="mouseout"||o==="pointerout",Oe&&p!==nt&&(At=p.relatedTarget||p.fromElement)&&(go(At)||At[fr]))break e;if((pt||Oe)&&(Oe=He.window===He?He:(Oe=He.ownerDocument)?Oe.defaultView||Oe.parentWindow:window,pt?(At=p.relatedTarget||p.toElement,pt=Se,At=At?go(At):null,At!==null&&(ni=ss(At),At!==ni||At.tag!==5&&At.tag!==6)&&(At=null)):(pt=null,At=Se),pt!==At)){if(Et=hd,Qe="onMouseLeave",me="onMouseEnter",re="mouse",(o==="pointerout"||o==="pointerover")&&(Et=lr,Qe="onPointerLeave",me="onPointerEnter",re="pointer"),ni=pt==null?Oe:Wn(pt),ve=At==null?Oe:Wn(At),Oe=new Et(Qe,re+"leave",pt,p,He),Oe.target=ni,Oe.relatedTarget=ve,Qe=null,go(He)===Se&&(Et=new Et(me,re+"enter",At,p,He),Et.target=ve,Et.relatedTarget=ni,Qe=Et),ni=Qe,pt&&At)t:{for(Et=pt,me=At,re=0,ve=Et;ve;ve=Xo(ve))re++;for(ve=0,Qe=me;Qe;Qe=Xo(Qe))ve++;for(;0<re-ve;)Et=Xo(Et),re--;for(;0<ve-re;)me=Xo(me),ve--;for(;re--;){if(Et===me||me!==null&&Et===me.alternate)break t;Et=Xo(Et),me=Xo(me)}Et=null}else Et=null;pt!==null&&Fp(We,Oe,pt,Et,!1),At!==null&&ni!==null&&Fp(We,ni,At,Et,!0)}}e:{if(Oe=Se?Wn(Se):window,pt=Oe.nodeName&&Oe.nodeName.toLowerCase(),pt==="select"||pt==="input"&&Oe.type==="file")var bt=Bp;else if(Bc(Oe))if(Ga)bt=Fn;else{bt=Lp;var Ft=Va}else(pt=Oe.nodeName)&&pt.toLowerCase()==="input"&&(Oe.type==="checkbox"||Oe.type==="radio")&&(bt=Ad);if(bt&&(bt=bt(o,Se))){Ha(We,bt,p,He);break e}Ft&&Ft(o,Oe,Se),o==="focusout"&&(Ft=Oe._wrapperState)&&Ft.controlled&&Oe.type==="number"&&wt(Oe,"number",Oe.value)}switch(Ft=Se?Wn(Se):window,o){case"focusin":(Bc(Ft)||Ft.contentEditable==="true")&&(us=Ft,Wo=Se,kl=null);break;case"focusout":kl=Wo=us=null;break;case"mousedown":ci=!0;break;case"contextmenu":case"mouseup":case"dragend":ci=!1,Nc(We,p,He);break;case"selectionchange":if(Fc)break;case"keydown":case"keyup":Nc(We,p,He)}var Nt;if(Oi)e:{switch(o){case"compositionstart":var Ht="onCompositionStart";break e;case"compositionend":Ht="onCompositionEnd";break e;case"compositionupdate":Ht="onCompositionUpdate";break e}Ht=void 0}else fo?xd(o,p)&&(Ht="onCompositionEnd"):o==="keydown"&&p.keyCode===229&&(Ht="onCompositionStart");Ht&&(Oa&&p.locale!=="ko"&&(fo||Ht!=="onCompositionStart"?Ht==="onCompositionEnd"&&fo&&(Nt=Fl()):(zr=He,dd="value"in zr?zr.value:zr.textContent,fo=!0)),Ft=Vc(Se,Ht),0<Ft.length&&(Ht=new md(Ht,o,null,p,He),We.push({event:Ht,listeners:Ft}),Nt?Ht.data=Nt:(Nt=Pc(p),Nt!==null&&(Ht.data=Nt)))),(Nt=Bn?Ip(o,p):Ul(o,p))&&(Se=Vc(Se,"onBeforeInput"),0<Se.length&&(He=new md("onBeforeInput","beforeinput",null,p,He),We.push({event:He,listeners:Se}),He.data=Nt))}Xa(We,l)})}function Ja(o,l,p){return{instance:o,listener:l,currentTarget:p}}function Vc(o,l){for(var p=l+"Capture",x=[];o!==null;){var w=o,I=w.stateNode;w.tag===5&&I!==null&&(w=I,I=Kn(o,p),I!=null&&x.unshift(Ja(o,I,w)),I=Kn(o,l),I!=null&&x.push(Ja(o,I,w))),o=o.return}return x}function Xo(o){if(o===null)return null;do o=o.return;while(o&&o.tag!==5);return o||null}function Fp(o,l,p,x,w){for(var I=l._reactName,N=[];p!==null&&p!==x;){var Q=p,te=Q.alternate,Se=Q.stateNode;if(te!==null&&te===x)break;Q.tag===5&&Se!==null&&(Q=Se,w?(te=Kn(p,I),te!=null&&N.unshift(Ja(p,te,Q))):w||(te=Kn(p,I),te!=null&&N.push(Ja(p,te,Q)))),p=p.return}N.length!==0&&o.push({event:l,listeners:N})}var lv=/\r\n?/g,Np=/\u0000|\uFFFD/g;function Cd(o){return(typeof o=="string"?o:""+o).replace(lv,`
`).replace(Np,"")}function Xl(o,l,p){if(l=Cd(l),Cd(o)!==l&&p)throw Error(t(425))}function jl(){}var Ka=null,Td=null;function bd(o,l){return o==="textarea"||o==="noscript"||typeof l.children=="string"||typeof l.children=="number"||typeof l.dangerouslySetInnerHTML=="object"&&l.dangerouslySetInnerHTML!==null&&l.dangerouslySetInnerHTML.__html!=null}var Rd=typeof setTimeout=="function"?setTimeout:void 0,Id=typeof clearTimeout=="function"?clearTimeout:void 0,Wc=typeof Promise=="function"?Promise:void 0,uv=typeof queueMicrotask=="function"?queueMicrotask:typeof Wc<"u"?function(o){return Wc.resolve(null).then(o).catch(Up)}:Rd;function Up(o){setTimeout(function(){throw o})}function Xc(o,l){var p=l,x=0;do{var w=p.nextSibling;if(o.removeChild(p),w&&w.nodeType===8)if(p=w.data,p==="/$"){if(x===0){o.removeChild(w),Dl(l);return}x--}else p!=="$"&&p!=="$?"&&p!=="$!"||x++;p=w}while(p);Dl(l)}function Ps(o){for(;o!=null;o=o.nextSibling){var l=o.nodeType;if(l===1||l===3)break;if(l===8){if(l=o.data,l==="$"||l==="$!"||l==="$?")break;if(l==="/$")return null}}return o}function Pd(o){o=o.previousSibling;for(var l=0;o;){if(o.nodeType===8){var p=o.data;if(p==="$"||p==="$!"||p==="$?"){if(l===0)return o;l--}else p==="/$"&&l++}o=o.previousSibling}return null}var jo=Math.random().toString(36).slice(2),ti="__reactFiber$"+jo,Ya="__reactProps$"+jo,fr="__reactContainer$"+jo,Jo="__reactEvents$"+jo,jc="__reactListeners$"+jo,Jc="__reactHandles$"+jo;function go(o){var l=o[ti];if(l)return l;for(var p=o.parentNode;p;){if(l=p[fr]||p[ti]){if(p=l.alternate,l.child!==null||p!==null&&p.child!==null)for(o=Pd(o);o!==null;){if(p=o[ti])return p;o=Pd(o)}return l}o=p,p=o.parentNode}return null}function Bs(o){return o=o[ti]||o[fr],!o||o.tag!==5&&o.tag!==6&&o.tag!==13&&o.tag!==3?null:o}function Wn(o){if(o.tag===5||o.tag===6)return o.stateNode;throw Error(t(33))}function Kc(o){return o[Ya]||null}var Bd=[],fi=-1;function Un(o){return{current:o}}function bn(o){0>fi||(o.current=Bd[fi],Bd[fi]=null,fi--)}function En(o,l){fi++,Bd[fi]=o.current,o.current=l}var Ls={},yi=Un(Ls),ki=Un(!1),Ds=Ls;function Ko(o,l){var p=o.type.contextTypes;if(!p)return Ls;var x=o.stateNode;if(x&&x.__reactInternalMemoizedUnmaskedChildContext===l)return x.__reactInternalMemoizedMaskedChildContext;var w={},I;for(I in p)w[I]=l[I];return x&&(o=o.stateNode,o.__reactInternalMemoizedUnmaskedChildContext=l,o.__reactInternalMemoizedMaskedChildContext=w),w}function bi(o){return o=o.childContextTypes,o!=null}function Jl(){bn(ki),bn(yi)}function Ld(o,l,p){if(yi.current!==Ls)throw Error(t(168));En(yi,l),En(ki,p)}function Kl(o,l,p){var x=o.stateNode;if(l=l.childContextTypes,typeof x.getChildContext!="function")return p;x=x.getChildContext();for(var w in x)if(!(w in l))throw Error(t(108,Ie(o)||"Unknown",w));return q({},p,x)}function Yo(o){return o=(o=o.stateNode)&&o.__reactInternalMemoizedMergedChildContext||Ls,Ds=yi.current,En(yi,o),En(ki,ki.current),!0}function Dd(o,l,p){var x=o.stateNode;if(!x)throw Error(t(169));p?(o=Kl(o,l,Ds),x.__reactInternalMemoizedMergedChildContext=o,bn(ki),bn(yi),En(yi,o)):bn(ki),En(ki,p)}var Xr=null,Yl=!1,Yc=!1;function Ql(o){Xr===null?Xr=[o]:Xr.push(o)}function Op(o){Yl=!0,Ql(o)}function fs(){if(!Yc&&Xr!==null){Yc=!0;var o=0,l=on;try{var p=Xr;for(on=1;o<p.length;o++){var x=p[o];do x=x(!0);while(x!==null)}Xr=null,Yl=!1}catch(w){throw Xr!==null&&(Xr=Xr.slice(o+1)),mc(Ge,fs),w}finally{on=l,Yc=!1}}return null}var Qo=[],qi=0,Qc=null,qc=0,Hi=[],di=0,qo=null,$e=1,br="";function Fs(o,l){Qo[qi++]=qc,Qo[qi++]=Qc,Qc=o,qc=l}function Fd(o,l,p){Hi[di++]=$e,Hi[di++]=br,Hi[di++]=qo,qo=o;var x=$e;o=br;var w=32-kt(x)-1;x&=~(1<<w),p+=1;var I=32-kt(l)+w;if(30<I){var N=w-w%5;I=(x&(1<<N)-1).toString(32),x>>=N,w-=N,$e=1<<32-kt(l)+w|p<<w|x,br=I+o}else $e=1<<I|p<<w|x,br=o}function Nd(o){o.return!==null&&(Fs(o,1),Fd(o,1,0))}function Ns(o){for(;o===Qc;)Qc=Qo[--qi],Qo[qi]=null,qc=Qo[--qi],Qo[qi]=null;for(;o===qo;)qo=Hi[--di],Hi[di]=null,br=Hi[--di],Hi[di]=null,$e=Hi[--di],Hi[di]=null}var _i=null,zi=null,In=!1,Rr=null;function Ud(o,l){var p=gs(5,null,null,0);p.elementType="DELETED",p.stateNode=l,p.return=o,l=o.deletions,l===null?(o.deletions=[p],o.flags|=16):l.push(p)}function Od(o,l){switch(o.tag){case 5:var p=o.type;return l=l.nodeType!==1||p.toLowerCase()!==l.nodeName.toLowerCase()?null:l,l!==null?(o.stateNode=l,_i=o,zi=Ps(l.firstChild),!0):!1;case 6:return l=o.pendingProps===""||l.nodeType!==3?null:l,l!==null?(o.stateNode=l,_i=o,zi=null,!0):!1;case 13:return l=l.nodeType!==8?null:l,l!==null?(p=qo!==null?{id:$e,overflow:br}:null,o.memoizedState={dehydrated:l,treeContext:p,retryLane:1073741824},p=gs(18,null,null,0),p.stateNode=l,p.return=o,o.child=p,_i=o,zi=null,!0):!1;default:return!1}}function Zc(o){return(o.mode&1)!==0&&(o.flags&128)===0}function $c(o){if(In){var l=zi;if(l){var p=l;if(!Od(o,l)){if(Zc(o))throw Error(t(418));l=Ps(p.nextSibling);var x=_i;l&&Od(o,l)?Ud(x,p):(o.flags=o.flags&-4097|2,In=!1,_i=o)}}else{if(Zc(o))throw Error(t(418));o.flags=o.flags&-4097|2,In=!1,_i=o}}}function ef(o){for(o=o.return;o!==null&&o.tag!==5&&o.tag!==3&&o.tag!==13;)o=o.return;_i=o}function Qa(o){if(o!==_i)return!1;if(!In)return ef(o),In=!0,!1;var l;if((l=o.tag!==3)&&!(l=o.tag!==5)&&(l=o.type,l=l!=="head"&&l!=="body"&&!bd(o.type,o.memoizedProps)),l&&(l=zi)){if(Zc(o))throw kd(),Error(t(418));for(;l;)Ud(o,l),l=Ps(l.nextSibling)}if(ef(o),o.tag===13){if(o=o.memoizedState,o=o!==null?o.dehydrated:null,!o)throw Error(t(317));e:{for(o=o.nextSibling,l=0;o;){if(o.nodeType===8){var p=o.data;if(p==="/$"){if(l===0){zi=Ps(o.nextSibling);break e}l--}else p!=="$"&&p!=="$!"&&p!=="$?"||l++}o=o.nextSibling}zi=null}}else zi=_i?Ps(o.stateNode.nextSibling):null;return!0}function kd(){for(var o=zi;o;)o=Ps(o.nextSibling)}function vo(){zi=_i=null,In=!1}function qa(o){Rr===null?Rr=[o]:Rr.push(o)}var cv=P.ReactCurrentBatchConfig;function ql(o,l,p){if(o=p.ref,o!==null&&typeof o!="function"&&typeof o!="object"){if(p._owner){if(p=p._owner,p){if(p.tag!==1)throw Error(t(309));var x=p.stateNode}if(!x)throw Error(t(147,o));var w=x,I=""+o;return l!==null&&l.ref!==null&&typeof l.ref=="function"&&l.ref._stringRef===I?l.ref:(l=function(N){var Q=w.refs;N===null?delete Q[I]:Q[I]=N},l._stringRef=I,l)}if(typeof o!="string")throw Error(t(284));if(!p._owner)throw Error(t(290,o))}return o}function Zl(o,l){throw o=Object.prototype.toString.call(l),Error(t(31,o==="[object Object]"?"object with keys {"+Object.keys(l).join(", ")+"}":o))}function Hd(o){var l=o._init;return l(o._payload)}function zd(o){function l(me,re){if(o){var ve=me.deletions;ve===null?(me.deletions=[re],me.flags|=16):ve.push(re)}}function p(me,re){if(!o)return null;for(;re!==null;)l(me,re),re=re.sibling;return null}function x(me,re){for(me=new Map;re!==null;)re.key!==null?me.set(re.key,re):me.set(re.index,re),re=re.sibling;return me}function w(me,re){return me=ll(me,re),me.index=0,me.sibling=null,me}function I(me,re,ve){return me.index=ve,o?(ve=me.alternate,ve!==null?(ve=ve.index,ve<re?(me.flags|=2,re):ve):(me.flags|=2,re)):(me.flags|=1048576,re)}function N(me){return o&&me.alternate===null&&(me.flags|=2),me}function Q(me,re,ve,Qe){return re===null||re.tag!==6?(re=Rv(ve,me.mode,Qe),re.return=me,re):(re=w(re,ve),re.return=me,re)}function te(me,re,ve,Qe){var bt=ve.type;return bt===k?He(me,re,ve.props.children,Qe,ve.key):re!==null&&(re.elementType===bt||typeof bt=="object"&&bt!==null&&bt.$$typeof===he&&Hd(bt)===re.type)?(Qe=w(re,ve.props),Qe.ref=ql(me,re,ve),Qe.return=me,Qe):(Qe=am(ve.type,ve.key,ve.props,null,me.mode,Qe),Qe.ref=ql(me,re,ve),Qe.return=me,Qe)}function Se(me,re,ve,Qe){return re===null||re.tag!==4||re.stateNode.containerInfo!==ve.containerInfo||re.stateNode.implementation!==ve.implementation?(re=Iv(ve,me.mode,Qe),re.return=me,re):(re=w(re,ve.children||[]),re.return=me,re)}function He(me,re,ve,Qe,bt){return re===null||re.tag!==7?(re=mu(ve,me.mode,Qe,bt),re.return=me,re):(re=w(re,ve),re.return=me,re)}function We(me,re,ve){if(typeof re=="string"&&re!==""||typeof re=="number")return re=Rv(""+re,me.mode,ve),re.return=me,re;if(typeof re=="object"&&re!==null){switch(re.$$typeof){case U:return ve=am(re.type,re.key,re.props,null,me.mode,ve),ve.ref=ql(me,null,re),ve.return=me,ve;case F:return re=Iv(re,me.mode,ve),re.return=me,re;case he:var Qe=re._init;return We(me,Qe(re._payload),ve)}if(qe(re)||Z(re))return re=mu(re,me.mode,ve,null),re.return=me,re;Zl(me,re)}return null}function Oe(me,re,ve,Qe){var bt=re!==null?re.key:null;if(typeof ve=="string"&&ve!==""||typeof ve=="number")return bt!==null?null:Q(me,re,""+ve,Qe);if(typeof ve=="object"&&ve!==null){switch(ve.$$typeof){case U:return ve.key===bt?te(me,re,ve,Qe):null;case F:return ve.key===bt?Se(me,re,ve,Qe):null;case he:return bt=ve._init,Oe(me,re,bt(ve._payload),Qe)}if(qe(ve)||Z(ve))return bt!==null?null:He(me,re,ve,Qe,null);Zl(me,ve)}return null}function pt(me,re,ve,Qe,bt){if(typeof Qe=="string"&&Qe!==""||typeof Qe=="number")return me=me.get(ve)||null,Q(re,me,""+Qe,bt);if(typeof Qe=="object"&&Qe!==null){switch(Qe.$$typeof){case U:return me=me.get(Qe.key===null?ve:Qe.key)||null,te(re,me,Qe,bt);case F:return me=me.get(Qe.key===null?ve:Qe.key)||null,Se(re,me,Qe,bt);case he:var Ft=Qe._init;return pt(me,re,ve,Ft(Qe._payload),bt)}if(qe(Qe)||Z(Qe))return me=me.get(ve)||null,He(re,me,Qe,bt,null);Zl(re,Qe)}return null}function At(me,re,ve,Qe){for(var bt=null,Ft=null,Nt=re,Ht=re=0,Bi=null;Nt!==null&&Ht<ve.length;Ht++){Nt.index>Ht?(Bi=Nt,Nt=null):Bi=Nt.sibling;var An=Oe(me,Nt,ve[Ht],Qe);if(An===null){Nt===null&&(Nt=Bi);break}o&&Nt&&An.alternate===null&&l(me,Nt),re=I(An,re,Ht),Ft===null?bt=An:Ft.sibling=An,Ft=An,Nt=Bi}if(Ht===ve.length)return p(me,Nt),In&&Fs(me,Ht),bt;if(Nt===null){for(;Ht<ve.length;Ht++)Nt=We(me,ve[Ht],Qe),Nt!==null&&(re=I(Nt,re,Ht),Ft===null?bt=Nt:Ft.sibling=Nt,Ft=Nt);return In&&Fs(me,Ht),bt}for(Nt=x(me,Nt);Ht<ve.length;Ht++)Bi=pt(Nt,me,Ht,ve[Ht],Qe),Bi!==null&&(o&&Bi.alternate!==null&&Nt.delete(Bi.key===null?Ht:Bi.key),re=I(Bi,re,Ht),Ft===null?bt=Bi:Ft.sibling=Bi,Ft=Bi);return o&&Nt.forEach(function(ul){return l(me,ul)}),In&&Fs(me,Ht),bt}function Et(me,re,ve,Qe){var bt=Z(ve);if(typeof bt!="function")throw Error(t(150));if(ve=bt.call(ve),ve==null)throw Error(t(151));for(var Ft=bt=null,Nt=re,Ht=re=0,Bi=null,An=ve.next();Nt!==null&&!An.done;Ht++,An=ve.next()){Nt.index>Ht?(Bi=Nt,Nt=null):Bi=Nt.sibling;var ul=Oe(me,Nt,An.value,Qe);if(ul===null){Nt===null&&(Nt=Bi);break}o&&Nt&&ul.alternate===null&&l(me,Nt),re=I(ul,re,Ht),Ft===null?bt=ul:Ft.sibling=ul,Ft=ul,Nt=Bi}if(An.done)return p(me,Nt),In&&Fs(me,Ht),bt;if(Nt===null){for(;!An.done;Ht++,An=ve.next())An=We(me,An.value,Qe),An!==null&&(re=I(An,re,Ht),Ft===null?bt=An:Ft.sibling=An,Ft=An);return In&&Fs(me,Ht),bt}for(Nt=x(me,Nt);!An.done;Ht++,An=ve.next())An=pt(Nt,me,Ht,An.value,Qe),An!==null&&(o&&An.alternate!==null&&Nt.delete(An.key===null?Ht:An.key),re=I(An,re,Ht),Ft===null?bt=An:Ft.sibling=An,Ft=An);return o&&Nt.forEach(function(dC){return l(me,dC)}),In&&Fs(me,Ht),bt}function ni(me,re,ve,Qe){if(typeof ve=="object"&&ve!==null&&ve.type===k&&ve.key===null&&(ve=ve.props.children),typeof ve=="object"&&ve!==null){switch(ve.$$typeof){case U:e:{for(var bt=ve.key,Ft=re;Ft!==null;){if(Ft.key===bt){if(bt=ve.type,bt===k){if(Ft.tag===7){p(me,Ft.sibling),re=w(Ft,ve.props.children),re.return=me,me=re;break e}}else if(Ft.elementType===bt||typeof bt=="object"&&bt!==null&&bt.$$typeof===he&&Hd(bt)===Ft.type){p(me,Ft.sibling),re=w(Ft,ve.props),re.ref=ql(me,Ft,ve),re.return=me,me=re;break e}p(me,Ft);break}else l(me,Ft);Ft=Ft.sibling}ve.type===k?(re=mu(ve.props.children,me.mode,Qe,ve.key),re.return=me,me=re):(Qe=am(ve.type,ve.key,ve.props,null,me.mode,Qe),Qe.ref=ql(me,re,ve),Qe.return=me,me=Qe)}return N(me);case F:e:{for(Ft=ve.key;re!==null;){if(re.key===Ft)if(re.tag===4&&re.stateNode.containerInfo===ve.containerInfo&&re.stateNode.implementation===ve.implementation){p(me,re.sibling),re=w(re,ve.children||[]),re.return=me,me=re;break e}else{p(me,re);break}else l(me,re);re=re.sibling}re=Iv(ve,me.mode,Qe),re.return=me,me=re}return N(me);case he:return Ft=ve._init,ni(me,re,Ft(ve._payload),Qe)}if(qe(ve))return At(me,re,ve,Qe);if(Z(ve))return Et(me,re,ve,Qe);Zl(me,ve)}return typeof ve=="string"&&ve!==""||typeof ve=="number"?(ve=""+ve,re!==null&&re.tag===6?(p(me,re.sibling),re=w(re,ve),re.return=me,me=re):(p(me,re),re=Rv(ve,me.mode,Qe),re.return=me,me=re),N(me)):p(me,re)}return ni}var Zo=zd(!0),$l=zd(!1),$o=Un(null),ea=null,Us=null,Za=null;function ta(){Za=Us=ea=null}function eu(o){var l=$o.current;bn($o),o._currentValue=l}function tu(o,l,p){for(;o!==null;){var x=o.alternate;if((o.childLanes&l)!==l?(o.childLanes|=l,x!==null&&(x.childLanes|=l)):x!==null&&(x.childLanes&l)!==l&&(x.childLanes|=l),o===p)break;o=o.return}}function yo(o,l){ea=o,Za=Us=null,o=o.dependencies,o!==null&&o.firstContext!==null&&(o.lanes&l&&(qt=!0),o.firstContext=null)}function dr(o){var l=o._currentValue;if(Za!==o)if(o={context:o,memoizedValue:l,next:null},Us===null){if(ea===null)throw Error(t(308));Us=o,ea.dependencies={lanes:0,firstContext:o}}else Us=Us.next=o;return l}var Os=null;function Gd(o){Os===null?Os=[o]:Os.push(o)}function nu(o,l,p,x){var w=l.interleaved;return w===null?(p.next=p,Gd(l)):(p.next=w.next,w.next=p),l.interleaved=p,jr(o,x)}function jr(o,l){o.lanes|=l;var p=o.alternate;for(p!==null&&(p.lanes|=l),p=o,o=o.return;o!==null;)o.childLanes|=l,p=o.alternate,p!==null&&(p.childLanes|=l),p=o,o=o.return;return p.tag===3?p.stateNode:null}var Sn=!1;function jt(o){o.updateQueue={baseState:o.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,interleaved:null,lanes:0},effects:null}}function Xn(o,l){o=o.updateQueue,l.updateQueue===o&&(l.updateQueue={baseState:o.baseState,firstBaseUpdate:o.firstBaseUpdate,lastBaseUpdate:o.lastBaseUpdate,shared:o.shared,effects:o.effects})}function Mn(o,l){return{eventTime:o,lane:l,tag:0,payload:null,callback:null,next:null}}function Ln(o,l,p){var x=o.updateQueue;if(x===null)return null;if(x=x.shared,yn&2){var w=x.pending;return w===null?l.next=l:(l.next=w.next,w.next=l),x.pending=l,jr(o,p)}return w=x.interleaved,w===null?(l.next=l,Gd(x)):(l.next=w.next,w.next=l),x.interleaved=l,jr(o,p)}function Ri(o,l,p){if(l=l.updateQueue,l!==null&&(l=l.shared,(p&4194240)!==0)){var x=l.lanes;x&=o.pendingLanes,p|=x,l.lanes=p,Vn(o,p)}}function na(o,l){var p=o.updateQueue,x=o.alternate;if(x!==null&&(x=x.updateQueue,p===x)){var w=null,I=null;if(p=p.firstBaseUpdate,p!==null){do{var N={eventTime:p.eventTime,lane:p.lane,tag:p.tag,payload:p.payload,callback:p.callback,next:null};I===null?w=I=N:I=I.next=N,p=p.next}while(p!==null);I===null?w=I=l:I=I.next=l}else w=I=l;p={baseState:x.baseState,firstBaseUpdate:w,lastBaseUpdate:I,shared:x.shared,effects:x.effects},o.updateQueue=p;return}o=p.lastBaseUpdate,o===null?p.firstBaseUpdate=l:o.next=l,p.lastBaseUpdate=l}function On(o,l,p,x){var w=o.updateQueue;Sn=!1;var I=w.firstBaseUpdate,N=w.lastBaseUpdate,Q=w.shared.pending;if(Q!==null){w.shared.pending=null;var te=Q,Se=te.next;te.next=null,N===null?I=Se:N.next=Se,N=te;var He=o.alternate;He!==null&&(He=He.updateQueue,Q=He.lastBaseUpdate,Q!==N&&(Q===null?He.firstBaseUpdate=Se:Q.next=Se,He.lastBaseUpdate=te))}if(I!==null){var We=w.baseState;N=0,He=Se=te=null,Q=I;do{var Oe=Q.lane,pt=Q.eventTime;if((x&Oe)===Oe){He!==null&&(He=He.next={eventTime:pt,lane:0,tag:Q.tag,payload:Q.payload,callback:Q.callback,next:null});e:{var At=o,Et=Q;switch(Oe=l,pt=p,Et.tag){case 1:if(At=Et.payload,typeof At=="function"){We=At.call(pt,We,Oe);break e}We=At;break e;case 3:At.flags=At.flags&-65537|128;case 0:if(At=Et.payload,Oe=typeof At=="function"?At.call(pt,We,Oe):At,Oe==null)break e;We=q({},We,Oe);break e;case 2:Sn=!0}}Q.callback!==null&&Q.lane!==0&&(o.flags|=64,Oe=w.effects,Oe===null?w.effects=[Q]:Oe.push(Q))}else pt={eventTime:pt,lane:Oe,tag:Q.tag,payload:Q.payload,callback:Q.callback,next:null},He===null?(Se=He=pt,te=We):He=He.next=pt,N|=Oe;if(Q=Q.next,Q===null){if(Q=w.shared.pending,Q===null)break;Oe=Q,Q=Oe.next,Oe.next=null,w.lastBaseUpdate=Oe,w.shared.pending=null}}while(!0);if(He===null&&(te=We),w.baseState=te,w.firstBaseUpdate=Se,w.lastBaseUpdate=He,l=w.shared.interleaved,l!==null){w=l;do N|=w.lane,w=w.next;while(w!==l)}else I===null&&(w.shared.lanes=0);fu|=N,o.lanes=N,o.memoizedState=We}}function $a(o,l,p){if(o=l.effects,l.effects=null,o!==null)for(l=0;l<o.length;l++){var x=o[l],w=x.callback;if(w!==null){if(x.callback=null,x=p,typeof w!="function")throw Error(t(191,w));w.call(x)}}}var ds={},hr=Un(ds),ia=Un(ds),ks=Un(ds);function Yn(o){if(o===ds)throw Error(t(174));return o}function iu(o,l){switch(En(ks,l),En(ia,o),En(hr,ds),o=l.nodeType,o){case 9:case 11:l=(l=l.documentElement)?l.namespaceURI:ot(null,"");break;default:o=o===8?l.parentNode:l,l=o.namespaceURI||null,o=o.tagName,l=ot(l,o)}bn(hr),En(hr,l)}function _o(){bn(hr),bn(ia),bn(ks)}function ra(o){Yn(ks.current);var l=Yn(hr.current),p=ot(l,o.type);l!==p&&(En(ia,o),En(hr,p))}function el(o){ia.current===o&&(bn(hr),bn(ia))}var Pn=Un(0);function Jr(o){for(var l=o;l!==null;){if(l.tag===13){var p=l.memoizedState;if(p!==null&&(p=p.dehydrated,p===null||p.data==="$?"||p.data==="$!"))return l}else if(l.tag===19&&l.memoizedProps.revealOrder!==void 0){if(l.flags&128)return l}else if(l.child!==null){l.child.return=l,l=l.child;continue}if(l===o)break;for(;l.sibling===null;){if(l.return===null||l.return===o)return null;l=l.return}l.sibling.return=l.return,l=l.sibling}return null}var tl=[];function hs(){for(var o=0;o<tl.length;o++)tl[o]._workInProgressVersionPrimary=null;tl.length=0}var sa=P.ReactCurrentDispatcher,oa=P.ReactCurrentBatchConfig,Hs=0,Rn=null,kn=null,pn=null,Kr=!1,Ii=!1,xo=0,Zi=0;function xi(){throw Error(t(321))}function ru(o,l){if(l===null)return!1;for(var p=0;p<l.length&&p<o.length;p++)if(!ur(o[p],l[p]))return!1;return!0}function su(o,l,p,x,w,I){if(Hs=I,Rn=l,l.memoizedState=null,l.updateQueue=null,l.lanes=0,sa.current=o===null||o.memoizedState===null?Xp:jp,o=p(x,w),Ii){I=0;do{if(Ii=!1,xo=0,25<=I)throw Error(t(301));I+=1,pn=kn=null,l.updateQueue=null,sa.current=Jp,o=p(x,w)}while(Ii)}if(sa.current=lf,l=kn!==null&&kn.next!==null,Hs=0,pn=kn=Rn=null,Kr=!1,l)throw Error(t(300));return o}function Vd(){var o=xo!==0;return xo=0,o}function Ai(){var o={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return pn===null?Rn.memoizedState=pn=o:pn=pn.next=o,pn}function pr(){if(kn===null){var o=Rn.alternate;o=o!==null?o.memoizedState:null}else o=kn.next;var l=pn===null?Rn.memoizedState:pn.next;if(l!==null)pn=l,kn=o;else{if(o===null)throw Error(t(310));kn=o,o={memoizedState:kn.memoizedState,baseState:kn.baseState,baseQueue:kn.baseQueue,queue:kn.queue,next:null},pn===null?Rn.memoizedState=pn=o:pn=pn.next=o}return pn}function nl(o,l){return typeof l=="function"?l(o):l}function ou(o){var l=pr(),p=l.queue;if(p===null)throw Error(t(311));p.lastRenderedReducer=o;var x=kn,w=x.baseQueue,I=p.pending;if(I!==null){if(w!==null){var N=w.next;w.next=I.next,I.next=N}x.baseQueue=w=I,p.pending=null}if(w!==null){I=w.next,x=x.baseState;var Q=N=null,te=null,Se=I;do{var He=Se.lane;if((Hs&He)===He)te!==null&&(te=te.next={lane:0,action:Se.action,hasEagerState:Se.hasEagerState,eagerState:Se.eagerState,next:null}),x=Se.hasEagerState?Se.eagerState:o(x,Se.action);else{var We={lane:He,action:Se.action,hasEagerState:Se.hasEagerState,eagerState:Se.eagerState,next:null};te===null?(Q=te=We,N=x):te=te.next=We,Rn.lanes|=He,fu|=He}Se=Se.next}while(Se!==null&&Se!==I);te===null?N=x:te.next=Q,ur(x,l.memoizedState)||(qt=!0),l.memoizedState=x,l.baseState=N,l.baseQueue=te,p.lastRenderedState=x}if(o=p.interleaved,o!==null){w=o;do I=w.lane,Rn.lanes|=I,fu|=I,w=w.next;while(w!==o)}else w===null&&(p.lanes=0);return[l.memoizedState,p.dispatch]}function zs(o){var l=pr(),p=l.queue;if(p===null)throw Error(t(311));p.lastRenderedReducer=o;var x=p.dispatch,w=p.pending,I=l.memoizedState;if(w!==null){p.pending=null;var N=w=w.next;do I=o(I,N.action),N=N.next;while(N!==w);ur(I,l.memoizedState)||(qt=!0),l.memoizedState=I,l.baseQueue===null&&(l.baseState=I),p.lastRenderedState=I}return[I,x]}function Wd(){}function Xd(o,l){var p=Rn,x=pr(),w=l(),I=!ur(x.memoizedState,w);if(I&&(x.memoizedState=w,qt=!0),x=x.queue,Kd(kp.bind(null,p,x,o),[o]),x.getSnapshot!==l||I||pn!==null&&pn.memoizedState.tag&1){if(p.flags|=2048,Yr(9,au.bind(null,p,x,w,l),void 0,null),Pi===null)throw Error(t(349));Hs&30||tf(p,l,w)}return w}function tf(o,l,p){o.flags|=16384,o={getSnapshot:l,value:p},l=Rn.updateQueue,l===null?(l={lastEffect:null,stores:null},Rn.updateQueue=l,l.stores=[o]):(p=l.stores,p===null?l.stores=[o]:p.push(o))}function au(o,l,p,x){l.value=p,l.getSnapshot=x,Hp(l)&&jd(o)}function kp(o,l,p){return p(function(){Hp(l)&&jd(o)})}function Hp(o){var l=o.getSnapshot;o=o.value;try{var p=l();return!ur(o,p)}catch{return!0}}function jd(o){var l=jr(o,1);l!==null&&js(l,o,1,-1)}function Jd(o){var l=Ai();return typeof o=="function"&&(o=o()),l.memoizedState=l.baseState=o,o={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:nl,lastRenderedState:o},l.queue=o,o=o.dispatch=aa.bind(null,Rn,o),[l.memoizedState,o]}function Yr(o,l,p,x){return o={tag:o,create:l,destroy:p,deps:x,next:null},l=Rn.updateQueue,l===null?(l={lastEffect:null,stores:null},Rn.updateQueue=l,l.lastEffect=o.next=o):(p=l.lastEffect,p===null?l.lastEffect=o.next=o:(x=p.next,p.next=o,o.next=x,l.lastEffect=o)),o}function zp(){return pr().memoizedState}function ps(o,l,p,x){var w=Ai();Rn.flags|=o,w.memoizedState=Yr(1|l,p,void 0,x===void 0?null:x)}function lu(o,l,p,x){var w=pr();x=x===void 0?null:x;var I=void 0;if(kn!==null){var N=kn.memoizedState;if(I=N.destroy,x!==null&&ru(x,N.deps)){w.memoizedState=Yr(l,p,I,x);return}}Rn.flags|=o,w.memoizedState=Yr(1|l,p,I,x)}function Gi(o,l){return ps(8390656,8,o,l)}function Kd(o,l){return lu(2048,8,o,l)}function Yd(o,l){return lu(4,2,o,l)}function Gp(o,l){return lu(4,4,o,l)}function Vp(o,l){if(typeof l=="function")return o=o(),l(o),function(){l(null)};if(l!=null)return o=o(),l.current=o,function(){l.current=null}}function Qd(o,l,p){return p=p!=null?p.concat([o]):null,lu(4,4,Vp.bind(null,l,o),p)}function nf(){}function Wp(o,l){var p=pr();l=l===void 0?null:l;var x=p.memoizedState;return x!==null&&l!==null&&ru(l,x[1])?x[0]:(p.memoizedState=[o,l],o)}function mr(o,l){var p=pr();l=l===void 0?null:l;var x=p.memoizedState;return x!==null&&l!==null&&ru(l,x[1])?x[0]:(o=o(),p.memoizedState=[o,l],o)}function rf(o,l,p){return Hs&21?(ur(p,l)||(p=sn(),Rn.lanes|=p,fu|=p,o.baseState=!0),l):(o.baseState&&(o.baseState=!1,qt=!0),o.memoizedState=p)}function fv(o,l){var p=on;on=p!==0&&4>p?p:4,o(!0);var x=oa.transition;oa.transition={};try{o(!1),l()}finally{on=p,oa.transition=x}}function Gs(){return pr().memoizedState}function sf(o,l,p){var x=ol(o);if(p={lane:x,action:p,hasEagerState:!1,eagerState:null,next:null},uu(o))of(l,p);else if(p=nu(o,l,p,x),p!==null){var w=vr();js(p,o,x,w),af(p,l,x)}}function aa(o,l,p){var x=ol(o),w={lane:x,action:p,hasEagerState:!1,eagerState:null,next:null};if(uu(o))of(l,w);else{var I=o.alternate;if(o.lanes===0&&(I===null||I.lanes===0)&&(I=l.lastRenderedReducer,I!==null))try{var N=l.lastRenderedState,Q=I(N,p);if(w.hasEagerState=!0,w.eagerState=Q,ur(Q,N)){var te=l.interleaved;te===null?(w.next=w,Gd(l)):(w.next=te.next,te.next=w),l.interleaved=w;return}}catch{}finally{}p=nu(o,l,w,x),p!==null&&(w=vr(),js(p,o,x,w),af(p,l,x))}}function uu(o){var l=o.alternate;return o===Rn||l!==null&&l===Rn}function of(o,l){Ii=Kr=!0;var p=o.pending;p===null?l.next=l:(l.next=p.next,p.next=l),o.pending=l}function af(o,l,p){if(p&4194240){var x=l.lanes;x&=o.pendingLanes,p|=x,l.lanes=p,Vn(o,p)}}var lf={readContext:dr,useCallback:xi,useContext:xi,useEffect:xi,useImperativeHandle:xi,useInsertionEffect:xi,useLayoutEffect:xi,useMemo:xi,useReducer:xi,useRef:xi,useState:xi,useDebugValue:xi,useDeferredValue:xi,useTransition:xi,useMutableSource:xi,useSyncExternalStore:xi,useId:xi,unstable_isNewReconciler:!1},Xp={readContext:dr,useCallback:function(o,l){return Ai().memoizedState=[o,l===void 0?null:l],o},useContext:dr,useEffect:Gi,useImperativeHandle:function(o,l,p){return p=p!=null?p.concat([o]):null,ps(4194308,4,Vp.bind(null,l,o),p)},useLayoutEffect:function(o,l){return ps(4194308,4,o,l)},useInsertionEffect:function(o,l){return ps(4,2,o,l)},useMemo:function(o,l){var p=Ai();return l=l===void 0?null:l,o=o(),p.memoizedState=[o,l],o},useReducer:function(o,l,p){var x=Ai();return l=p!==void 0?p(l):l,x.memoizedState=x.baseState=l,o={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:o,lastRenderedState:l},x.queue=o,o=o.dispatch=sf.bind(null,Rn,o),[x.memoizedState,o]},useRef:function(o){var l=Ai();return o={current:o},l.memoizedState=o},useState:Jd,useDebugValue:nf,useDeferredValue:function(o){return Ai().memoizedState=o},useTransition:function(){var o=Jd(!1),l=o[0];return o=fv.bind(null,o[1]),Ai().memoizedState=o,[l,o]},useMutableSource:function(){},useSyncExternalStore:function(o,l,p){var x=Rn,w=Ai();if(In){if(p===void 0)throw Error(t(407));p=p()}else{if(p=l(),Pi===null)throw Error(t(349));Hs&30||tf(x,l,p)}w.memoizedState=p;var I={value:p,getSnapshot:l};return w.queue=I,Gi(kp.bind(null,x,I,o),[o]),x.flags|=2048,Yr(9,au.bind(null,x,I,p,l),void 0,null),p},useId:function(){var o=Ai(),l=Pi.identifierPrefix;if(In){var p=br,x=$e;p=(x&~(1<<32-kt(x)-1)).toString(32)+p,l=":"+l+"R"+p,p=xo++,0<p&&(l+="H"+p.toString(32)),l+=":"}else p=Zi++,l=":"+l+"r"+p.toString(32)+":";return o.memoizedState=l},unstable_isNewReconciler:!1},jp={readContext:dr,useCallback:Wp,useContext:dr,useEffect:Kd,useImperativeHandle:Qd,useInsertionEffect:Yd,useLayoutEffect:Gp,useMemo:mr,useReducer:ou,useRef:zp,useState:function(){return ou(nl)},useDebugValue:nf,useDeferredValue:function(o){var l=pr();return rf(l,kn.memoizedState,o)},useTransition:function(){var o=ou(nl)[0],l=pr().memoizedState;return[o,l]},useMutableSource:Wd,useSyncExternalStore:Xd,useId:Gs,unstable_isNewReconciler:!1},Jp={readContext:dr,useCallback:Wp,useContext:dr,useEffect:Kd,useImperativeHandle:Qd,useInsertionEffect:Yd,useLayoutEffect:Gp,useMemo:mr,useReducer:zs,useRef:zp,useState:function(){return zs(nl)},useDebugValue:nf,useDeferredValue:function(o){var l=pr();return kn===null?l.memoizedState=o:rf(l,kn.memoizedState,o)},useTransition:function(){var o=zs(nl)[0],l=pr().memoizedState;return[o,l]},useMutableSource:Wd,useSyncExternalStore:Xd,useId:Gs,unstable_isNewReconciler:!1};function Ir(o,l){if(o&&o.defaultProps){l=q({},l),o=o.defaultProps;for(var p in o)l[p]===void 0&&(l[p]=o[p]);return l}return l}function cu(o,l,p,x){l=o.memoizedState,p=p(x,l),p=p==null?l:q({},l,p),o.memoizedState=p,o.lanes===0&&(o.updateQueue.baseState=p)}var uf={isMounted:function(o){return(o=o._reactInternals)?ss(o)===o:!1},enqueueSetState:function(o,l,p){o=o._reactInternals;var x=vr(),w=ol(o),I=Mn(x,w);I.payload=l,p!=null&&(I.callback=p),l=Ln(o,I,w),l!==null&&(js(l,o,w,x),Ri(l,o,w))},enqueueReplaceState:function(o,l,p){o=o._reactInternals;var x=vr(),w=ol(o),I=Mn(x,w);I.tag=1,I.payload=l,p!=null&&(I.callback=p),l=Ln(o,I,w),l!==null&&(js(l,o,w,x),Ri(l,o,w))},enqueueForceUpdate:function(o,l){o=o._reactInternals;var p=vr(),x=ol(o),w=Mn(p,x);w.tag=2,l!=null&&(w.callback=l),l=Ln(o,w,x),l!==null&&(js(l,o,x,p),Ri(l,o,x))}};function Kp(o,l,p,x,w,I,N){return o=o.stateNode,typeof o.shouldComponentUpdate=="function"?o.shouldComponentUpdate(x,I,N):l.prototype&&l.prototype.isPureReactComponent?!Go(p,x)||!Go(w,I):!0}function c(o,l,p){var x=!1,w=Ls,I=l.contextType;return typeof I=="object"&&I!==null?I=dr(I):(w=bi(l)?Ds:yi.current,x=l.contextTypes,I=(x=x!=null)?Ko(o,w):Ls),l=new l(p,I),o.memoizedState=l.state!==null&&l.state!==void 0?l.state:null,l.updater=uf,o.stateNode=l,l._reactInternals=o,x&&(o=o.stateNode,o.__reactInternalMemoizedUnmaskedChildContext=w,o.__reactInternalMemoizedMaskedChildContext=I),l}function f(o,l,p,x){o=l.state,typeof l.componentWillReceiveProps=="function"&&l.componentWillReceiveProps(p,x),typeof l.UNSAFE_componentWillReceiveProps=="function"&&l.UNSAFE_componentWillReceiveProps(p,x),l.state!==o&&uf.enqueueReplaceState(l,l.state,null)}function y(o,l,p,x){var w=o.stateNode;w.props=p,w.state=o.memoizedState,w.refs={},jt(o);var I=l.contextType;typeof I=="object"&&I!==null?w.context=dr(I):(I=bi(l)?Ds:yi.current,w.context=Ko(o,I)),w.state=o.memoizedState,I=l.getDerivedStateFromProps,typeof I=="function"&&(cu(o,l,I,p),w.state=o.memoizedState),typeof l.getDerivedStateFromProps=="function"||typeof w.getSnapshotBeforeUpdate=="function"||typeof w.UNSAFE_componentWillMount!="function"&&typeof w.componentWillMount!="function"||(l=w.state,typeof w.componentWillMount=="function"&&w.componentWillMount(),typeof w.UNSAFE_componentWillMount=="function"&&w.UNSAFE_componentWillMount(),l!==w.state&&uf.enqueueReplaceState(w,w.state,null),On(o,p,w,x),w.state=o.memoizedState),typeof w.componentDidMount=="function"&&(o.flags|=4194308)}function E(o,l){try{var p="",x=l;do p+=we(x),x=x.return;while(x);var w=p}catch(I){w=`
Error generating stack: `+I.message+`
`+I.stack}return{value:o,source:l,stack:w,digest:null}}function T(o,l,p){return{value:o,source:null,stack:p??null,digest:l??null}}function B(o,l){try{console.error(l.value)}catch(p){setTimeout(function(){throw p})}}var K=typeof WeakMap=="function"?WeakMap:Map;function se(o,l,p){p=Mn(-1,p),p.tag=3,p.payload={element:null};var x=l.value;return p.callback=function(){tm||(tm=!0,Av=x),B(o,l)},p}function Te(o,l,p){p=Mn(-1,p),p.tag=3;var x=o.type.getDerivedStateFromError;if(typeof x=="function"){var w=l.value;p.payload=function(){return x(w)},p.callback=function(){B(o,l)}}var I=o.stateNode;return I!==null&&typeof I.componentDidCatch=="function"&&(p.callback=function(){B(o,l),typeof x!="function"&&(rl===null?rl=new Set([this]):rl.add(this));var N=l.stack;this.componentDidCatch(l.value,{componentStack:N!==null?N:""})}),p}function Ke(o,l,p){var x=o.pingCache;if(x===null){x=o.pingCache=new K;var w=new Set;x.set(l,w)}else w=x.get(l),w===void 0&&(w=new Set,x.set(l,w));w.has(p)||(w.add(p),o=tC.bind(null,o,l,p),l.then(o,o))}function yt(o){do{var l;if((l=o.tag===13)&&(l=o.memoizedState,l=l!==null?l.dehydrated!==null:!0),l)return o;o=o.return}while(o!==null);return null}function Gt(o,l,p,x,w){return o.mode&1?(o.flags|=65536,o.lanes=w,o):(o===l?o.flags|=65536:(o.flags|=128,p.flags|=131072,p.flags&=-52805,p.tag===1&&(p.alternate===null?p.tag=17:(l=Mn(-1,1),l.tag=2,Ln(p,l,1))),p.lanes|=1),o)}var Lt=P.ReactCurrentOwner,qt=!1;function ft(o,l,p,x){l.child=o===null?$l(l,null,p,x):Zo(l,o.child,p,x)}function Si(o,l,p,x,w){p=p.render;var I=l.ref;return yo(l,w),x=su(o,l,p,x,I,w),p=Vd(),o!==null&&!qt?(l.updateQueue=o.updateQueue,l.flags&=-2053,o.lanes&=~w,la(o,l,w)):(In&&p&&Nd(l),l.flags|=1,ft(o,l,x,w),l.child)}function gr(o,l,p,x,w){if(o===null){var I=p.type;return typeof I=="function"&&!bv(I)&&I.defaultProps===void 0&&p.compare===null&&p.defaultProps===void 0?(l.tag=15,l.type=I,xe(o,l,I,x,w)):(o=am(p.type,null,x,l,l.mode,w),o.ref=l.ref,o.return=l,l.child=o)}if(I=o.child,!(o.lanes&w)){var N=I.memoizedProps;if(p=p.compare,p=p!==null?p:Go,p(N,x)&&o.ref===l.ref)return la(o,l,w)}return l.flags|=1,o=ll(I,x),o.ref=l.ref,o.return=l,l.child=o}function xe(o,l,p,x,w){if(o!==null){var I=o.memoizedProps;if(Go(I,x)&&o.ref===l.ref)if(qt=!1,l.pendingProps=x=I,(o.lanes&w)!==0)o.flags&131072&&(qt=!0);else return l.lanes=o.lanes,la(o,l,w)}return at(o,l,p,x,w)}function ue(o,l,p){var x=l.pendingProps,w=x.children,I=o!==null?o.memoizedState:null;if(x.mode==="hidden")if(!(l.mode&1))l.memoizedState={baseLanes:0,cachePool:null,transitions:null},En(ff,Qr),Qr|=p;else{if(!(p&1073741824))return o=I!==null?I.baseLanes|p:p,l.lanes=l.childLanes=1073741824,l.memoizedState={baseLanes:o,cachePool:null,transitions:null},l.updateQueue=null,En(ff,Qr),Qr|=o,null;l.memoizedState={baseLanes:0,cachePool:null,transitions:null},x=I!==null?I.baseLanes:p,En(ff,Qr),Qr|=x}else I!==null?(x=I.baseLanes|p,l.memoizedState=null):x=p,En(ff,Qr),Qr|=x;return ft(o,l,w,p),l.child}function Ee(o,l){var p=l.ref;(o===null&&p!==null||o!==null&&o.ref!==p)&&(l.flags|=512,l.flags|=2097152)}function at(o,l,p,x,w){var I=bi(p)?Ds:yi.current;return I=Ko(l,I),yo(l,w),p=su(o,l,p,x,I,w),x=Vd(),o!==null&&!qt?(l.updateQueue=o.updateQueue,l.flags&=-2053,o.lanes&=~w,la(o,l,w)):(In&&x&&Nd(l),l.flags|=1,ft(o,l,p,w),l.child)}function Ct(o,l,p,x,w){if(bi(p)){var I=!0;Yo(l)}else I=!1;if(yo(l,w),l.stateNode===null)Qp(o,l),c(l,p,x),y(l,p,x,w),x=!0;else if(o===null){var N=l.stateNode,Q=l.memoizedProps;N.props=Q;var te=N.context,Se=p.contextType;typeof Se=="object"&&Se!==null?Se=dr(Se):(Se=bi(p)?Ds:yi.current,Se=Ko(l,Se));var He=p.getDerivedStateFromProps,We=typeof He=="function"||typeof N.getSnapshotBeforeUpdate=="function";We||typeof N.UNSAFE_componentWillReceiveProps!="function"&&typeof N.componentWillReceiveProps!="function"||(Q!==x||te!==Se)&&f(l,N,x,Se),Sn=!1;var Oe=l.memoizedState;N.state=Oe,On(l,x,N,w),te=l.memoizedState,Q!==x||Oe!==te||ki.current||Sn?(typeof He=="function"&&(cu(l,p,He,x),te=l.memoizedState),(Q=Sn||Kp(l,p,Q,x,Oe,te,Se))?(We||typeof N.UNSAFE_componentWillMount!="function"&&typeof N.componentWillMount!="function"||(typeof N.componentWillMount=="function"&&N.componentWillMount(),typeof N.UNSAFE_componentWillMount=="function"&&N.UNSAFE_componentWillMount()),typeof N.componentDidMount=="function"&&(l.flags|=4194308)):(typeof N.componentDidMount=="function"&&(l.flags|=4194308),l.memoizedProps=x,l.memoizedState=te),N.props=x,N.state=te,N.context=Se,x=Q):(typeof N.componentDidMount=="function"&&(l.flags|=4194308),x=!1)}else{N=l.stateNode,Xn(o,l),Q=l.memoizedProps,Se=l.type===l.elementType?Q:Ir(l.type,Q),N.props=Se,We=l.pendingProps,Oe=N.context,te=p.contextType,typeof te=="object"&&te!==null?te=dr(te):(te=bi(p)?Ds:yi.current,te=Ko(l,te));var pt=p.getDerivedStateFromProps;(He=typeof pt=="function"||typeof N.getSnapshotBeforeUpdate=="function")||typeof N.UNSAFE_componentWillReceiveProps!="function"&&typeof N.componentWillReceiveProps!="function"||(Q!==We||Oe!==te)&&f(l,N,x,te),Sn=!1,Oe=l.memoizedState,N.state=Oe,On(l,x,N,w);var At=l.memoizedState;Q!==We||Oe!==At||ki.current||Sn?(typeof pt=="function"&&(cu(l,p,pt,x),At=l.memoizedState),(Se=Sn||Kp(l,p,Se,x,Oe,At,te)||!1)?(He||typeof N.UNSAFE_componentWillUpdate!="function"&&typeof N.componentWillUpdate!="function"||(typeof N.componentWillUpdate=="function"&&N.componentWillUpdate(x,At,te),typeof N.UNSAFE_componentWillUpdate=="function"&&N.UNSAFE_componentWillUpdate(x,At,te)),typeof N.componentDidUpdate=="function"&&(l.flags|=4),typeof N.getSnapshotBeforeUpdate=="function"&&(l.flags|=1024)):(typeof N.componentDidUpdate!="function"||Q===o.memoizedProps&&Oe===o.memoizedState||(l.flags|=4),typeof N.getSnapshotBeforeUpdate!="function"||Q===o.memoizedProps&&Oe===o.memoizedState||(l.flags|=1024),l.memoizedProps=x,l.memoizedState=At),N.props=x,N.state=At,N.context=te,x=Se):(typeof N.componentDidUpdate!="function"||Q===o.memoizedProps&&Oe===o.memoizedState||(l.flags|=4),typeof N.getSnapshotBeforeUpdate!="function"||Q===o.memoizedProps&&Oe===o.memoizedState||(l.flags|=1024),x=!1)}return Wt(o,l,p,x,I,w)}function Wt(o,l,p,x,w,I){Ee(o,l);var N=(l.flags&128)!==0;if(!x&&!N)return w&&Dd(l,p,!1),la(o,l,I);x=l.stateNode,Lt.current=l;var Q=N&&typeof p.getDerivedStateFromError!="function"?null:x.render();return l.flags|=1,o!==null&&N?(l.child=Zo(l,o.child,null,I),l.child=Zo(l,null,Q,I)):ft(o,l,Q,I),l.memoizedState=x.state,w&&Dd(l,p,!0),l.child}function Vt(o){var l=o.stateNode;l.pendingContext?Ld(o,l.pendingContext,l.pendingContext!==l.context):l.context&&Ld(o,l.context,!1),iu(o,l.containerInfo)}function hn(o,l,p,x,w){return vo(),qa(w),l.flags|=256,ft(o,l,p,x),l.child}var Qn={dehydrated:null,treeContext:null,retryLane:0};function dn(o){return{baseLanes:o,cachePool:null,transitions:null}}function Vs(o,l,p){var x=l.pendingProps,w=Pn.current,I=!1,N=(l.flags&128)!==0,Q;if((Q=N)||(Q=o!==null&&o.memoizedState===null?!1:(w&2)!==0),Q?(I=!0,l.flags&=-129):(o===null||o.memoizedState!==null)&&(w|=1),En(Pn,w&1),o===null)return $c(l),o=l.memoizedState,o!==null&&(o=o.dehydrated,o!==null)?(l.mode&1?o.data==="$!"?l.lanes=8:l.lanes=1073741824:l.lanes=1,null):(N=x.children,o=x.fallback,I?(x=l.mode,I=l.child,N={mode:"hidden",children:N},!(x&1)&&I!==null?(I.childLanes=0,I.pendingProps=N):I=lm(N,x,0,null),o=mu(o,x,p,null),I.return=l,o.return=l,I.sibling=o,l.child=I,l.child.memoizedState=dn(p),l.memoizedState=Qn,o):qd(l,N));if(w=o.memoizedState,w!==null&&(Q=w.dehydrated,Q!==null))return Vw(o,l,N,x,Q,w,p);if(I){I=x.fallback,N=l.mode,w=o.child,Q=w.sibling;var te={mode:"hidden",children:x.children};return!(N&1)&&l.child!==w?(x=l.child,x.childLanes=0,x.pendingProps=te,l.deletions=null):(x=ll(w,te),x.subtreeFlags=w.subtreeFlags&14680064),Q!==null?I=ll(Q,I):(I=mu(I,N,p,null),I.flags|=2),I.return=l,x.return=l,x.sibling=I,l.child=x,x=I,I=l.child,N=o.child.memoizedState,N=N===null?dn(p):{baseLanes:N.baseLanes|p,cachePool:null,transitions:N.transitions},I.memoizedState=N,I.childLanes=o.childLanes&~p,l.memoizedState=Qn,x}return I=o.child,o=I.sibling,x=ll(I,{mode:"visible",children:x.children}),!(l.mode&1)&&(x.lanes=p),x.return=l,x.sibling=null,o!==null&&(p=l.deletions,p===null?(l.deletions=[o],l.flags|=16):p.push(o)),l.child=x,l.memoizedState=null,x}function qd(o,l){return l=lm({mode:"visible",children:l},o.mode,0,null),l.return=o,o.child=l}function Yp(o,l,p,x){return x!==null&&qa(x),Zo(l,o.child,null,p),o=qd(l,l.pendingProps.children),o.flags|=2,l.memoizedState=null,o}function Vw(o,l,p,x,w,I,N){if(p)return l.flags&256?(l.flags&=-257,x=T(Error(t(422))),Yp(o,l,N,x)):l.memoizedState!==null?(l.child=o.child,l.flags|=128,null):(I=x.fallback,w=l.mode,x=lm({mode:"visible",children:x.children},w,0,null),I=mu(I,w,N,null),I.flags|=2,x.return=l,I.return=l,x.sibling=I,l.child=x,l.mode&1&&Zo(l,o.child,null,N),l.child.memoizedState=dn(N),l.memoizedState=Qn,I);if(!(l.mode&1))return Yp(o,l,N,null);if(w.data==="$!"){if(x=w.nextSibling&&w.nextSibling.dataset,x)var Q=x.dgst;return x=Q,I=Error(t(419)),x=T(I,x,void 0),Yp(o,l,N,x)}if(Q=(N&o.childLanes)!==0,qt||Q){if(x=Pi,x!==null){switch(N&-N){case 4:w=2;break;case 16:w=8;break;case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:w=32;break;case 536870912:w=268435456;break;default:w=0}w=w&(x.suspendedLanes|N)?0:w,w!==0&&w!==I.retryLane&&(I.retryLane=w,jr(o,w),js(x,o,w,-1))}return Tv(),x=T(Error(t(421))),Yp(o,l,N,x)}return w.data==="$?"?(l.flags|=128,l.child=o.child,l=nC.bind(null,o),w._reactRetry=l,null):(o=I.treeContext,zi=Ps(w.nextSibling),_i=l,In=!0,Rr=null,o!==null&&(Hi[di++]=$e,Hi[di++]=br,Hi[di++]=qo,$e=o.id,br=o.overflow,qo=l),l=qd(l,x.children),l.flags|=4096,l)}function Zx(o,l,p){o.lanes|=l;var x=o.alternate;x!==null&&(x.lanes|=l),tu(o.return,l,p)}function dv(o,l,p,x,w){var I=o.memoizedState;I===null?o.memoizedState={isBackwards:l,rendering:null,renderingStartTime:0,last:x,tail:p,tailMode:w}:(I.isBackwards=l,I.rendering=null,I.renderingStartTime=0,I.last=x,I.tail=p,I.tailMode=w)}function $x(o,l,p){var x=l.pendingProps,w=x.revealOrder,I=x.tail;if(ft(o,l,x.children,p),x=Pn.current,x&2)x=x&1|2,l.flags|=128;else{if(o!==null&&o.flags&128)e:for(o=l.child;o!==null;){if(o.tag===13)o.memoizedState!==null&&Zx(o,p,l);else if(o.tag===19)Zx(o,p,l);else if(o.child!==null){o.child.return=o,o=o.child;continue}if(o===l)break e;for(;o.sibling===null;){if(o.return===null||o.return===l)break e;o=o.return}o.sibling.return=o.return,o=o.sibling}x&=1}if(En(Pn,x),!(l.mode&1))l.memoizedState=null;else switch(w){case"forwards":for(p=l.child,w=null;p!==null;)o=p.alternate,o!==null&&Jr(o)===null&&(w=p),p=p.sibling;p=w,p===null?(w=l.child,l.child=null):(w=p.sibling,p.sibling=null),dv(l,!1,w,p,I);break;case"backwards":for(p=null,w=l.child,l.child=null;w!==null;){if(o=w.alternate,o!==null&&Jr(o)===null){l.child=w;break}o=w.sibling,w.sibling=p,p=w,w=o}dv(l,!0,p,null,I);break;case"together":dv(l,!1,null,null,void 0);break;default:l.memoizedState=null}return l.child}function Qp(o,l){!(l.mode&1)&&o!==null&&(o.alternate=null,l.alternate=null,l.flags|=2)}function la(o,l,p){if(o!==null&&(l.dependencies=o.dependencies),fu|=l.lanes,!(p&l.childLanes))return null;if(o!==null&&l.child!==o.child)throw Error(t(153));if(l.child!==null){for(o=l.child,p=ll(o,o.pendingProps),l.child=p,p.return=l;o.sibling!==null;)o=o.sibling,p=p.sibling=ll(o,o.pendingProps),p.return=l;p.sibling=null}return l.child}function Ww(o,l,p){switch(l.tag){case 3:Vt(l),vo();break;case 5:ra(l);break;case 1:bi(l.type)&&Yo(l);break;case 4:iu(l,l.stateNode.containerInfo);break;case 10:var x=l.type._context,w=l.memoizedProps.value;En($o,x._currentValue),x._currentValue=w;break;case 13:if(x=l.memoizedState,x!==null)return x.dehydrated!==null?(En(Pn,Pn.current&1),l.flags|=128,null):p&l.child.childLanes?Vs(o,l,p):(En(Pn,Pn.current&1),o=la(o,l,p),o!==null?o.sibling:null);En(Pn,Pn.current&1);break;case 19:if(x=(p&l.childLanes)!==0,o.flags&128){if(x)return $x(o,l,p);l.flags|=128}if(w=l.memoizedState,w!==null&&(w.rendering=null,w.tail=null,w.lastEffect=null),En(Pn,Pn.current),x)break;return null;case 22:case 23:return l.lanes=0,ue(o,l,p)}return la(o,l,p)}var e1,hv,t1,n1;e1=function(o,l){for(var p=l.child;p!==null;){if(p.tag===5||p.tag===6)o.appendChild(p.stateNode);else if(p.tag!==4&&p.child!==null){p.child.return=p,p=p.child;continue}if(p===l)break;for(;p.sibling===null;){if(p.return===null||p.return===l)return;p=p.return}p.sibling.return=p.return,p=p.sibling}},hv=function(){},t1=function(o,l,p,x){var w=o.memoizedProps;if(w!==x){o=l.stateNode,Yn(hr.current);var I=null;switch(p){case"input":w=J(o,w),x=J(o,x),I=[];break;case"select":w=q({},w,{value:void 0}),x=q({},x,{value:void 0}),I=[];break;case"textarea":w=O(o,w),x=O(o,x),I=[];break;default:typeof w.onClick!="function"&&typeof x.onClick=="function"&&(o.onclick=jl)}ee(p,x);var N;p=null;for(Se in w)if(!x.hasOwnProperty(Se)&&w.hasOwnProperty(Se)&&w[Se]!=null)if(Se==="style"){var Q=w[Se];for(N in Q)Q.hasOwnProperty(N)&&(p||(p={}),p[N]="")}else Se!=="dangerouslySetInnerHTML"&&Se!=="children"&&Se!=="suppressContentEditableWarning"&&Se!=="suppressHydrationWarning"&&Se!=="autoFocus"&&(r.hasOwnProperty(Se)?I||(I=[]):(I=I||[]).push(Se,null));for(Se in x){var te=x[Se];if(Q=w!=null?w[Se]:void 0,x.hasOwnProperty(Se)&&te!==Q&&(te!=null||Q!=null))if(Se==="style")if(Q){for(N in Q)!Q.hasOwnProperty(N)||te&&te.hasOwnProperty(N)||(p||(p={}),p[N]="");for(N in te)te.hasOwnProperty(N)&&Q[N]!==te[N]&&(p||(p={}),p[N]=te[N])}else p||(I||(I=[]),I.push(Se,p)),p=te;else Se==="dangerouslySetInnerHTML"?(te=te?te.__html:void 0,Q=Q?Q.__html:void 0,te!=null&&Q!==te&&(I=I||[]).push(Se,te)):Se==="children"?typeof te!="string"&&typeof te!="number"||(I=I||[]).push(Se,""+te):Se!=="suppressContentEditableWarning"&&Se!=="suppressHydrationWarning"&&(r.hasOwnProperty(Se)?(te!=null&&Se==="onScroll"&&Tn("scroll",o),I||Q===te||(I=[])):(I=I||[]).push(Se,te))}p&&(I=I||[]).push("style",p);var Se=I;(l.updateQueue=Se)&&(l.flags|=4)}},n1=function(o,l,p,x){p!==x&&(l.flags|=4)};function Zd(o,l){if(!In)switch(o.tailMode){case"hidden":l=o.tail;for(var p=null;l!==null;)l.alternate!==null&&(p=l),l=l.sibling;p===null?o.tail=null:p.sibling=null;break;case"collapsed":p=o.tail;for(var x=null;p!==null;)p.alternate!==null&&(x=p),p=p.sibling;x===null?l||o.tail===null?o.tail=null:o.tail.sibling=null:x.sibling=null}}function $i(o){var l=o.alternate!==null&&o.alternate.child===o.child,p=0,x=0;if(l)for(var w=o.child;w!==null;)p|=w.lanes|w.childLanes,x|=w.subtreeFlags&14680064,x|=w.flags&14680064,w.return=o,w=w.sibling;else for(w=o.child;w!==null;)p|=w.lanes|w.childLanes,x|=w.subtreeFlags,x|=w.flags,w.return=o,w=w.sibling;return o.subtreeFlags|=x,o.childLanes=p,l}function Xw(o,l,p){var x=l.pendingProps;switch(Ns(l),l.tag){case 2:case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return $i(l),null;case 1:return bi(l.type)&&Jl(),$i(l),null;case 3:return x=l.stateNode,_o(),bn(ki),bn(yi),hs(),x.pendingContext&&(x.context=x.pendingContext,x.pendingContext=null),(o===null||o.child===null)&&(Qa(l)?l.flags|=4:o===null||o.memoizedState.isDehydrated&&!(l.flags&256)||(l.flags|=1024,Rr!==null&&(Ev(Rr),Rr=null))),hv(o,l),$i(l),null;case 5:el(l);var w=Yn(ks.current);if(p=l.type,o!==null&&l.stateNode!=null)t1(o,l,p,x,w),o.ref!==l.ref&&(l.flags|=512,l.flags|=2097152);else{if(!x){if(l.stateNode===null)throw Error(t(166));return $i(l),null}if(o=Yn(hr.current),Qa(l)){x=l.stateNode,p=l.type;var I=l.memoizedProps;switch(x[ti]=l,x[Ya]=I,o=(l.mode&1)!==0,p){case"dialog":Tn("cancel",x),Tn("close",x);break;case"iframe":case"object":case"embed":Tn("load",x);break;case"video":case"audio":for(w=0;w<mo.length;w++)Tn(mo[w],x);break;case"source":Tn("error",x);break;case"img":case"image":case"link":Tn("error",x),Tn("load",x);break;case"details":Tn("toggle",x);break;case"input":mt(x,I),Tn("invalid",x);break;case"select":x._wrapperState={wasMultiple:!!I.multiple},Tn("invalid",x);break;case"textarea":pe(x,I),Tn("invalid",x)}ee(p,I),w=null;for(var N in I)if(I.hasOwnProperty(N)){var Q=I[N];N==="children"?typeof Q=="string"?x.textContent!==Q&&(I.suppressHydrationWarning!==!0&&Xl(x.textContent,Q,o),w=["children",Q]):typeof Q=="number"&&x.textContent!==""+Q&&(I.suppressHydrationWarning!==!0&&Xl(x.textContent,Q,o),w=["children",""+Q]):r.hasOwnProperty(N)&&Q!=null&&N==="onScroll"&&Tn("scroll",x)}switch(p){case"input":st(x),je(x,I,!0);break;case"textarea":st(x),Ue(x);break;case"select":case"option":break;default:typeof I.onClick=="function"&&(x.onclick=jl)}x=w,l.updateQueue=x,x!==null&&(l.flags|=4)}else{N=w.nodeType===9?w:w.ownerDocument,o==="http://www.w3.org/1999/xhtml"&&(o=Pe(p)),o==="http://www.w3.org/1999/xhtml"?p==="script"?(o=N.createElement("div"),o.innerHTML="<script><\/script>",o=o.removeChild(o.firstChild)):typeof x.is=="string"?o=N.createElement(p,{is:x.is}):(o=N.createElement(p),p==="select"&&(N=o,x.multiple?N.multiple=!0:x.size&&(N.size=x.size))):o=N.createElementNS(o,p),o[ti]=l,o[Ya]=x,e1(o,l,!1,!1),l.stateNode=o;e:{switch(N=Re(p,x),p){case"dialog":Tn("cancel",o),Tn("close",o),w=x;break;case"iframe":case"object":case"embed":Tn("load",o),w=x;break;case"video":case"audio":for(w=0;w<mo.length;w++)Tn(mo[w],o);w=x;break;case"source":Tn("error",o),w=x;break;case"img":case"image":case"link":Tn("error",o),Tn("load",o),w=x;break;case"details":Tn("toggle",o),w=x;break;case"input":mt(o,x),w=J(o,x),Tn("invalid",o);break;case"option":w=x;break;case"select":o._wrapperState={wasMultiple:!!x.multiple},w=q({},x,{value:void 0}),Tn("invalid",o);break;case"textarea":pe(o,x),w=O(o,x),Tn("invalid",o);break;default:w=x}ee(p,w),Q=w;for(I in Q)if(Q.hasOwnProperty(I)){var te=Q[I];I==="style"?Dt(o,te):I==="dangerouslySetInnerHTML"?(te=te?te.__html:void 0,te!=null&&ct(o,te)):I==="children"?typeof te=="string"?(p!=="textarea"||te!=="")&&zt(o,te):typeof te=="number"&&zt(o,""+te):I!=="suppressContentEditableWarning"&&I!=="suppressHydrationWarning"&&I!=="autoFocus"&&(r.hasOwnProperty(I)?te!=null&&I==="onScroll"&&Tn("scroll",o):te!=null&&R(o,I,te,N))}switch(p){case"input":st(o),je(o,x,!1);break;case"textarea":st(o),Ue(o);break;case"option":x.value!=null&&o.setAttribute("value",""+Xe(x.value));break;case"select":o.multiple=!!x.multiple,I=x.value,I!=null?j(o,!!x.multiple,I,!1):x.defaultValue!=null&&j(o,!!x.multiple,x.defaultValue,!0);break;default:typeof w.onClick=="function"&&(o.onclick=jl)}switch(p){case"button":case"input":case"select":case"textarea":x=!!x.autoFocus;break e;case"img":x=!0;break e;default:x=!1}}x&&(l.flags|=4)}l.ref!==null&&(l.flags|=512,l.flags|=2097152)}return $i(l),null;case 6:if(o&&l.stateNode!=null)n1(o,l,o.memoizedProps,x);else{if(typeof x!="string"&&l.stateNode===null)throw Error(t(166));if(p=Yn(ks.current),Yn(hr.current),Qa(l)){if(x=l.stateNode,p=l.memoizedProps,x[ti]=l,(I=x.nodeValue!==p)&&(o=_i,o!==null))switch(o.tag){case 3:Xl(x.nodeValue,p,(o.mode&1)!==0);break;case 5:o.memoizedProps.suppressHydrationWarning!==!0&&Xl(x.nodeValue,p,(o.mode&1)!==0)}I&&(l.flags|=4)}else x=(p.nodeType===9?p:p.ownerDocument).createTextNode(x),x[ti]=l,l.stateNode=x}return $i(l),null;case 13:if(bn(Pn),x=l.memoizedState,o===null||o.memoizedState!==null&&o.memoizedState.dehydrated!==null){if(In&&zi!==null&&l.mode&1&&!(l.flags&128))kd(),vo(),l.flags|=98560,I=!1;else if(I=Qa(l),x!==null&&x.dehydrated!==null){if(o===null){if(!I)throw Error(t(318));if(I=l.memoizedState,I=I!==null?I.dehydrated:null,!I)throw Error(t(317));I[ti]=l}else vo(),!(l.flags&128)&&(l.memoizedState=null),l.flags|=4;$i(l),I=!1}else Rr!==null&&(Ev(Rr),Rr=null),I=!0;if(!I)return l.flags&65536?l:null}return l.flags&128?(l.lanes=p,l):(x=x!==null,x!==(o!==null&&o.memoizedState!==null)&&x&&(l.child.flags|=8192,l.mode&1&&(o===null||Pn.current&1?Mi===0&&(Mi=3):Tv())),l.updateQueue!==null&&(l.flags|=4),$i(l),null);case 4:return _o(),hv(o,l),o===null&&ja(l.stateNode.containerInfo),$i(l),null;case 10:return eu(l.type._context),$i(l),null;case 17:return bi(l.type)&&Jl(),$i(l),null;case 19:if(bn(Pn),I=l.memoizedState,I===null)return $i(l),null;if(x=(l.flags&128)!==0,N=I.rendering,N===null)if(x)Zd(I,!1);else{if(Mi!==0||o!==null&&o.flags&128)for(o=l.child;o!==null;){if(N=Jr(o),N!==null){for(l.flags|=128,Zd(I,!1),x=N.updateQueue,x!==null&&(l.updateQueue=x,l.flags|=4),l.subtreeFlags=0,x=p,p=l.child;p!==null;)I=p,o=x,I.flags&=14680066,N=I.alternate,N===null?(I.childLanes=0,I.lanes=o,I.child=null,I.subtreeFlags=0,I.memoizedProps=null,I.memoizedState=null,I.updateQueue=null,I.dependencies=null,I.stateNode=null):(I.childLanes=N.childLanes,I.lanes=N.lanes,I.child=N.child,I.subtreeFlags=0,I.deletions=null,I.memoizedProps=N.memoizedProps,I.memoizedState=N.memoizedState,I.updateQueue=N.updateQueue,I.type=N.type,o=N.dependencies,I.dependencies=o===null?null:{lanes:o.lanes,firstContext:o.firstContext}),p=p.sibling;return En(Pn,Pn.current&1|2),l.child}o=o.sibling}I.tail!==null&&de()>df&&(l.flags|=128,x=!0,Zd(I,!1),l.lanes=4194304)}else{if(!x)if(o=Jr(N),o!==null){if(l.flags|=128,x=!0,p=o.updateQueue,p!==null&&(l.updateQueue=p,l.flags|=4),Zd(I,!0),I.tail===null&&I.tailMode==="hidden"&&!N.alternate&&!In)return $i(l),null}else 2*de()-I.renderingStartTime>df&&p!==1073741824&&(l.flags|=128,x=!0,Zd(I,!1),l.lanes=4194304);I.isBackwards?(N.sibling=l.child,l.child=N):(p=I.last,p!==null?p.sibling=N:l.child=N,I.last=N)}return I.tail!==null?(l=I.tail,I.rendering=l,I.tail=l.sibling,I.renderingStartTime=de(),l.sibling=null,p=Pn.current,En(Pn,x?p&1|2:p&1),l):($i(l),null);case 22:case 23:return Cv(),x=l.memoizedState!==null,o!==null&&o.memoizedState!==null!==x&&(l.flags|=8192),x&&l.mode&1?Qr&1073741824&&($i(l),l.subtreeFlags&6&&(l.flags|=8192)):$i(l),null;case 24:return null;case 25:return null}throw Error(t(156,l.tag))}function jw(o,l){switch(Ns(l),l.tag){case 1:return bi(l.type)&&Jl(),o=l.flags,o&65536?(l.flags=o&-65537|128,l):null;case 3:return _o(),bn(ki),bn(yi),hs(),o=l.flags,o&65536&&!(o&128)?(l.flags=o&-65537|128,l):null;case 5:return el(l),null;case 13:if(bn(Pn),o=l.memoizedState,o!==null&&o.dehydrated!==null){if(l.alternate===null)throw Error(t(340));vo()}return o=l.flags,o&65536?(l.flags=o&-65537|128,l):null;case 19:return bn(Pn),null;case 4:return _o(),null;case 10:return eu(l.type._context),null;case 22:case 23:return Cv(),null;case 24:return null;default:return null}}var qp=!1,er=!1,Jw=typeof WeakSet=="function"?WeakSet:Set,xt=null;function cf(o,l){var p=o.ref;if(p!==null)if(typeof p=="function")try{p(null)}catch(x){qn(o,l,x)}else p.current=null}function pv(o,l,p){try{p()}catch(x){qn(o,l,x)}}var i1=!1;function Kw(o,l){if(Ka=Sr,o=Nn(),li(o)){if("selectionStart"in o)var p={start:o.selectionStart,end:o.selectionEnd};else e:{p=(p=o.ownerDocument)&&p.defaultView||window;var x=p.getSelection&&p.getSelection();if(x&&x.rangeCount!==0){p=x.anchorNode;var w=x.anchorOffset,I=x.focusNode;x=x.focusOffset;try{p.nodeType,I.nodeType}catch{p=null;break e}var N=0,Q=-1,te=-1,Se=0,He=0,We=o,Oe=null;t:for(;;){for(var pt;We!==p||w!==0&&We.nodeType!==3||(Q=N+w),We!==I||x!==0&&We.nodeType!==3||(te=N+x),We.nodeType===3&&(N+=We.nodeValue.length),(pt=We.firstChild)!==null;)Oe=We,We=pt;for(;;){if(We===o)break t;if(Oe===p&&++Se===w&&(Q=N),Oe===I&&++He===x&&(te=N),(pt=We.nextSibling)!==null)break;We=Oe,Oe=We.parentNode}We=pt}p=Q===-1||te===-1?null:{start:Q,end:te}}else p=null}p=p||{start:0,end:0}}else p=null;for(Td={focusedElem:o,selectionRange:p},Sr=!1,xt=l;xt!==null;)if(l=xt,o=l.child,(l.subtreeFlags&1028)!==0&&o!==null)o.return=l,xt=o;else for(;xt!==null;){l=xt;try{var At=l.alternate;if(l.flags&1024)switch(l.tag){case 0:case 11:case 15:break;case 1:if(At!==null){var Et=At.memoizedProps,ni=At.memoizedState,me=l.stateNode,re=me.getSnapshotBeforeUpdate(l.elementType===l.type?Et:Ir(l.type,Et),ni);me.__reactInternalSnapshotBeforeUpdate=re}break;case 3:var ve=l.stateNode.containerInfo;ve.nodeType===1?ve.textContent="":ve.nodeType===9&&ve.documentElement&&ve.removeChild(ve.documentElement);break;case 5:case 6:case 4:case 17:break;default:throw Error(t(163))}}catch(Qe){qn(l,l.return,Qe)}if(o=l.sibling,o!==null){o.return=l.return,xt=o;break}xt=l.return}return At=i1,i1=!1,At}function $d(o,l,p){var x=l.updateQueue;if(x=x!==null?x.lastEffect:null,x!==null){var w=x=x.next;do{if((w.tag&o)===o){var I=w.destroy;w.destroy=void 0,I!==void 0&&pv(l,p,I)}w=w.next}while(w!==x)}}function Zp(o,l){if(l=l.updateQueue,l=l!==null?l.lastEffect:null,l!==null){var p=l=l.next;do{if((p.tag&o)===o){var x=p.create;p.destroy=x()}p=p.next}while(p!==l)}}function mv(o){var l=o.ref;if(l!==null){var p=o.stateNode;switch(o.tag){case 5:o=p;break;default:o=p}typeof l=="function"?l(o):l.current=o}}function r1(o){var l=o.alternate;l!==null&&(o.alternate=null,r1(l)),o.child=null,o.deletions=null,o.sibling=null,o.tag===5&&(l=o.stateNode,l!==null&&(delete l[ti],delete l[Ya],delete l[Jo],delete l[jc],delete l[Jc])),o.stateNode=null,o.return=null,o.dependencies=null,o.memoizedProps=null,o.memoizedState=null,o.pendingProps=null,o.stateNode=null,o.updateQueue=null}function s1(o){return o.tag===5||o.tag===3||o.tag===4}function o1(o){e:for(;;){for(;o.sibling===null;){if(o.return===null||s1(o.return))return null;o=o.return}for(o.sibling.return=o.return,o=o.sibling;o.tag!==5&&o.tag!==6&&o.tag!==18;){if(o.flags&2||o.child===null||o.tag===4)continue e;o.child.return=o,o=o.child}if(!(o.flags&2))return o.stateNode}}function gv(o,l,p){var x=o.tag;if(x===5||x===6)o=o.stateNode,l?p.nodeType===8?p.parentNode.insertBefore(o,l):p.insertBefore(o,l):(p.nodeType===8?(l=p.parentNode,l.insertBefore(o,p)):(l=p,l.appendChild(o)),p=p._reactRootContainer,p!=null||l.onclick!==null||(l.onclick=jl));else if(x!==4&&(o=o.child,o!==null))for(gv(o,l,p),o=o.sibling;o!==null;)gv(o,l,p),o=o.sibling}function vv(o,l,p){var x=o.tag;if(x===5||x===6)o=o.stateNode,l?p.insertBefore(o,l):p.appendChild(o);else if(x!==4&&(o=o.child,o!==null))for(vv(o,l,p),o=o.sibling;o!==null;)vv(o,l,p),o=o.sibling}var Vi=null,Ws=!1;function il(o,l,p){for(p=p.child;p!==null;)a1(o,l,p),p=p.sibling}function a1(o,l,p){if(Ye&&typeof Ye.onCommitFiberUnmount=="function")try{Ye.onCommitFiberUnmount(Rt,p)}catch{}switch(p.tag){case 5:er||cf(p,l);case 6:var x=Vi,w=Ws;Vi=null,il(o,l,p),Vi=x,Ws=w,Vi!==null&&(Ws?(o=Vi,p=p.stateNode,o.nodeType===8?o.parentNode.removeChild(p):o.removeChild(p)):Vi.removeChild(p.stateNode));break;case 18:Vi!==null&&(Ws?(o=Vi,p=p.stateNode,o.nodeType===8?Xc(o.parentNode,p):o.nodeType===1&&Xc(o,p),Dl(o)):Xc(Vi,p.stateNode));break;case 4:x=Vi,w=Ws,Vi=p.stateNode.containerInfo,Ws=!0,il(o,l,p),Vi=x,Ws=w;break;case 0:case 11:case 14:case 15:if(!er&&(x=p.updateQueue,x!==null&&(x=x.lastEffect,x!==null))){w=x=x.next;do{var I=w,N=I.destroy;I=I.tag,N!==void 0&&(I&2||I&4)&&pv(p,l,N),w=w.next}while(w!==x)}il(o,l,p);break;case 1:if(!er&&(cf(p,l),x=p.stateNode,typeof x.componentWillUnmount=="function"))try{x.props=p.memoizedProps,x.state=p.memoizedState,x.componentWillUnmount()}catch(Q){qn(p,l,Q)}il(o,l,p);break;case 21:il(o,l,p);break;case 22:p.mode&1?(er=(x=er)||p.memoizedState!==null,il(o,l,p),er=x):il(o,l,p);break;default:il(o,l,p)}}function l1(o){var l=o.updateQueue;if(l!==null){o.updateQueue=null;var p=o.stateNode;p===null&&(p=o.stateNode=new Jw),l.forEach(function(x){var w=iC.bind(null,o,x);p.has(x)||(p.add(x),x.then(w,w))})}}function Xs(o,l){var p=l.deletions;if(p!==null)for(var x=0;x<p.length;x++){var w=p[x];try{var I=o,N=l,Q=N;e:for(;Q!==null;){switch(Q.tag){case 5:Vi=Q.stateNode,Ws=!1;break e;case 3:Vi=Q.stateNode.containerInfo,Ws=!0;break e;case 4:Vi=Q.stateNode.containerInfo,Ws=!0;break e}Q=Q.return}if(Vi===null)throw Error(t(160));a1(I,N,w),Vi=null,Ws=!1;var te=w.alternate;te!==null&&(te.return=null),w.return=null}catch(Se){qn(w,l,Se)}}if(l.subtreeFlags&12854)for(l=l.child;l!==null;)u1(l,o),l=l.sibling}function u1(o,l){var p=o.alternate,x=o.flags;switch(o.tag){case 0:case 11:case 14:case 15:if(Xs(l,o),Ao(o),x&4){try{$d(3,o,o.return),Zp(3,o)}catch(Et){qn(o,o.return,Et)}try{$d(5,o,o.return)}catch(Et){qn(o,o.return,Et)}}break;case 1:Xs(l,o),Ao(o),x&512&&p!==null&&cf(p,p.return);break;case 5:if(Xs(l,o),Ao(o),x&512&&p!==null&&cf(p,p.return),o.flags&32){var w=o.stateNode;try{zt(w,"")}catch(Et){qn(o,o.return,Et)}}if(x&4&&(w=o.stateNode,w!=null)){var I=o.memoizedProps,N=p!==null?p.memoizedProps:I,Q=o.type,te=o.updateQueue;if(o.updateQueue=null,te!==null)try{Q==="input"&&I.type==="radio"&&I.name!=null&&ke(w,I),Re(Q,N);var Se=Re(Q,I);for(N=0;N<te.length;N+=2){var He=te[N],We=te[N+1];He==="style"?Dt(w,We):He==="dangerouslySetInnerHTML"?ct(w,We):He==="children"?zt(w,We):R(w,He,We,Se)}switch(Q){case"input":et(w,I);break;case"textarea":Ce(w,I);break;case"select":var Oe=w._wrapperState.wasMultiple;w._wrapperState.wasMultiple=!!I.multiple;var pt=I.value;pt!=null?j(w,!!I.multiple,pt,!1):Oe!==!!I.multiple&&(I.defaultValue!=null?j(w,!!I.multiple,I.defaultValue,!0):j(w,!!I.multiple,I.multiple?[]:"",!1))}w[Ya]=I}catch(Et){qn(o,o.return,Et)}}break;case 6:if(Xs(l,o),Ao(o),x&4){if(o.stateNode===null)throw Error(t(162));w=o.stateNode,I=o.memoizedProps;try{w.nodeValue=I}catch(Et){qn(o,o.return,Et)}}break;case 3:if(Xs(l,o),Ao(o),x&4&&p!==null&&p.memoizedState.isDehydrated)try{Dl(l.containerInfo)}catch(Et){qn(o,o.return,Et)}break;case 4:Xs(l,o),Ao(o);break;case 13:Xs(l,o),Ao(o),w=o.child,w.flags&8192&&(I=w.memoizedState!==null,w.stateNode.isHidden=I,!I||w.alternate!==null&&w.alternate.memoizedState!==null||(xv=de())),x&4&&l1(o);break;case 22:if(He=p!==null&&p.memoizedState!==null,o.mode&1?(er=(Se=er)||He,Xs(l,o),er=Se):Xs(l,o),Ao(o),x&8192){if(Se=o.memoizedState!==null,(o.stateNode.isHidden=Se)&&!He&&o.mode&1)for(xt=o,He=o.child;He!==null;){for(We=xt=He;xt!==null;){switch(Oe=xt,pt=Oe.child,Oe.tag){case 0:case 11:case 14:case 15:$d(4,Oe,Oe.return);break;case 1:cf(Oe,Oe.return);var At=Oe.stateNode;if(typeof At.componentWillUnmount=="function"){x=Oe,p=Oe.return;try{l=x,At.props=l.memoizedProps,At.state=l.memoizedState,At.componentWillUnmount()}catch(Et){qn(x,p,Et)}}break;case 5:cf(Oe,Oe.return);break;case 22:if(Oe.memoizedState!==null){d1(We);continue}}pt!==null?(pt.return=Oe,xt=pt):d1(We)}He=He.sibling}e:for(He=null,We=o;;){if(We.tag===5){if(He===null){He=We;try{w=We.stateNode,Se?(I=w.style,typeof I.setProperty=="function"?I.setProperty("display","none","important"):I.display="none"):(Q=We.stateNode,te=We.memoizedProps.style,N=te!=null&&te.hasOwnProperty("display")?te.display:null,Q.style.display=Pt("display",N))}catch(Et){qn(o,o.return,Et)}}}else if(We.tag===6){if(He===null)try{We.stateNode.nodeValue=Se?"":We.memoizedProps}catch(Et){qn(o,o.return,Et)}}else if((We.tag!==22&&We.tag!==23||We.memoizedState===null||We===o)&&We.child!==null){We.child.return=We,We=We.child;continue}if(We===o)break e;for(;We.sibling===null;){if(We.return===null||We.return===o)break e;He===We&&(He=null),We=We.return}He===We&&(He=null),We.sibling.return=We.return,We=We.sibling}}break;case 19:Xs(l,o),Ao(o),x&4&&l1(o);break;case 21:break;default:Xs(l,o),Ao(o)}}function Ao(o){var l=o.flags;if(l&2){try{e:{for(var p=o.return;p!==null;){if(s1(p)){var x=p;break e}p=p.return}throw Error(t(160))}switch(x.tag){case 5:var w=x.stateNode;x.flags&32&&(zt(w,""),x.flags&=-33);var I=o1(o);vv(o,I,w);break;case 3:case 4:var N=x.stateNode.containerInfo,Q=o1(o);gv(o,Q,N);break;default:throw Error(t(161))}}catch(te){qn(o,o.return,te)}o.flags&=-3}l&4096&&(o.flags&=-4097)}function Yw(o,l,p){xt=o,c1(o)}function c1(o,l,p){for(var x=(o.mode&1)!==0;xt!==null;){var w=xt,I=w.child;if(w.tag===22&&x){var N=w.memoizedState!==null||qp;if(!N){var Q=w.alternate,te=Q!==null&&Q.memoizedState!==null||er;Q=qp;var Se=er;if(qp=N,(er=te)&&!Se)for(xt=w;xt!==null;)N=xt,te=N.child,N.tag===22&&N.memoizedState!==null?h1(w):te!==null?(te.return=N,xt=te):h1(w);for(;I!==null;)xt=I,c1(I),I=I.sibling;xt=w,qp=Q,er=Se}f1(o)}else w.subtreeFlags&8772&&I!==null?(I.return=w,xt=I):f1(o)}}function f1(o){for(;xt!==null;){var l=xt;if(l.flags&8772){var p=l.alternate;try{if(l.flags&8772)switch(l.tag){case 0:case 11:case 15:er||Zp(5,l);break;case 1:var x=l.stateNode;if(l.flags&4&&!er)if(p===null)x.componentDidMount();else{var w=l.elementType===l.type?p.memoizedProps:Ir(l.type,p.memoizedProps);x.componentDidUpdate(w,p.memoizedState,x.__reactInternalSnapshotBeforeUpdate)}var I=l.updateQueue;I!==null&&$a(l,I,x);break;case 3:var N=l.updateQueue;if(N!==null){if(p=null,l.child!==null)switch(l.child.tag){case 5:p=l.child.stateNode;break;case 1:p=l.child.stateNode}$a(l,N,p)}break;case 5:var Q=l.stateNode;if(p===null&&l.flags&4){p=Q;var te=l.memoizedProps;switch(l.type){case"button":case"input":case"select":case"textarea":te.autoFocus&&p.focus();break;case"img":te.src&&(p.src=te.src)}}break;case 6:break;case 4:break;case 12:break;case 13:if(l.memoizedState===null){var Se=l.alternate;if(Se!==null){var He=Se.memoizedState;if(He!==null){var We=He.dehydrated;We!==null&&Dl(We)}}}break;case 19:case 17:case 21:case 22:case 23:case 25:break;default:throw Error(t(163))}er||l.flags&512&&mv(l)}catch(Oe){qn(l,l.return,Oe)}}if(l===o){xt=null;break}if(p=l.sibling,p!==null){p.return=l.return,xt=p;break}xt=l.return}}function d1(o){for(;xt!==null;){var l=xt;if(l===o){xt=null;break}var p=l.sibling;if(p!==null){p.return=l.return,xt=p;break}xt=l.return}}function h1(o){for(;xt!==null;){var l=xt;try{switch(l.tag){case 0:case 11:case 15:var p=l.return;try{Zp(4,l)}catch(te){qn(l,p,te)}break;case 1:var x=l.stateNode;if(typeof x.componentDidMount=="function"){var w=l.return;try{x.componentDidMount()}catch(te){qn(l,w,te)}}var I=l.return;try{mv(l)}catch(te){qn(l,I,te)}break;case 5:var N=l.return;try{mv(l)}catch(te){qn(l,N,te)}}}catch(te){qn(l,l.return,te)}if(l===o){xt=null;break}var Q=l.sibling;if(Q!==null){Q.return=l.return,xt=Q;break}xt=l.return}}var Qw=Math.ceil,$p=P.ReactCurrentDispatcher,yv=P.ReactCurrentOwner,ms=P.ReactCurrentBatchConfig,yn=0,Pi=null,hi=null,Wi=0,Qr=0,ff=Un(0),Mi=0,eh=null,fu=0,em=0,_v=0,th=null,Pr=null,xv=0,df=1/0,ua=null,tm=!1,Av=null,rl=null,nm=!1,sl=null,im=0,nh=0,Sv=null,rm=-1,sm=0;function vr(){return yn&6?de():rm!==-1?rm:rm=de()}function ol(o){return o.mode&1?yn&2&&Wi!==0?Wi&-Wi:cv.transition!==null?(sm===0&&(sm=sn()),sm):(o=on,o!==0||(o=window.event,o=o===void 0?16:Ep(o.type)),o):1}function js(o,l,p,x){if(50<nh)throw nh=0,Sv=null,Error(t(185));ai(o,p,x),(!(yn&2)||o!==Pi)&&(o===Pi&&(!(yn&2)&&(em|=p),Mi===4&&al(o,Wi)),Br(o,x),p===1&&yn===0&&!(l.mode&1)&&(df=de()+500,Yl&&fs()))}function Br(o,l){var p=o.callbackNode;oi(o,l);var x=mi(o,o===Pi?Wi:0);if(x===0)p!==null&&z(p),o.callbackNode=null,o.callbackPriority=0;else if(l=x&-x,o.callbackPriority!==l){if(p!=null&&z(p),l===1)o.tag===0?Op(m1.bind(null,o)):Ql(m1.bind(null,o)),uv(function(){!(yn&6)&&fs()}),p=null;else{switch(Ji(x)){case 1:p=Ge;break;case 4:p=rt;break;case 16:p=dt;break;case 536870912:p=Bt;break;default:p=dt}p=M1(p,p1.bind(null,o))}o.callbackPriority=l,o.callbackNode=p}}function p1(o,l){if(rm=-1,sm=0,yn&6)throw Error(t(327));var p=o.callbackNode;if(hf()&&o.callbackNode!==p)return null;var x=mi(o,o===Pi?Wi:0);if(x===0)return null;if(x&30||x&o.expiredLanes||l)l=om(o,x);else{l=x;var w=yn;yn|=2;var I=v1();(Pi!==o||Wi!==l)&&(ua=null,df=de()+500,hu(o,l));do try{$w();break}catch(Q){g1(o,Q)}while(!0);ta(),$p.current=I,yn=w,hi!==null?l=0:(Pi=null,Wi=0,l=Mi)}if(l!==0){if(l===2&&(w=os(o),w!==0&&(x=w,l=Mv(o,w))),l===1)throw p=eh,hu(o,0),al(o,x),Br(o,de()),p;if(l===6)al(o,x);else{if(w=o.current.alternate,!(x&30)&&!qw(w)&&(l=om(o,x),l===2&&(I=os(o),I!==0&&(x=I,l=Mv(o,I))),l===1))throw p=eh,hu(o,0),al(o,x),Br(o,de()),p;switch(o.finishedWork=w,o.finishedLanes=x,l){case 0:case 1:throw Error(t(345));case 2:pu(o,Pr,ua);break;case 3:if(al(o,x),(x&130023424)===x&&(l=xv+500-de(),10<l)){if(mi(o,0)!==0)break;if(w=o.suspendedLanes,(w&x)!==x){vr(),o.pingedLanes|=o.suspendedLanes&w;break}o.timeoutHandle=Rd(pu.bind(null,o,Pr,ua),l);break}pu(o,Pr,ua);break;case 4:if(al(o,x),(x&4194240)===x)break;for(l=o.eventTimes,w=-1;0<x;){var N=31-kt(x);I=1<<N,N=l[N],N>w&&(w=N),x&=~I}if(x=w,x=de()-x,x=(120>x?120:480>x?480:1080>x?1080:1920>x?1920:3e3>x?3e3:4320>x?4320:1960*Qw(x/1960))-x,10<x){o.timeoutHandle=Rd(pu.bind(null,o,Pr,ua),x);break}pu(o,Pr,ua);break;case 5:pu(o,Pr,ua);break;default:throw Error(t(329))}}}return Br(o,de()),o.callbackNode===p?p1.bind(null,o):null}function Mv(o,l){var p=th;return o.current.memoizedState.isDehydrated&&(hu(o,l).flags|=256),o=om(o,l),o!==2&&(l=Pr,Pr=p,l!==null&&Ev(l)),o}function Ev(o){Pr===null?Pr=o:Pr.push.apply(Pr,o)}function qw(o){for(var l=o;;){if(l.flags&16384){var p=l.updateQueue;if(p!==null&&(p=p.stores,p!==null))for(var x=0;x<p.length;x++){var w=p[x],I=w.getSnapshot;w=w.value;try{if(!ur(I(),w))return!1}catch{return!1}}}if(p=l.child,l.subtreeFlags&16384&&p!==null)p.return=l,l=p;else{if(l===o)break;for(;l.sibling===null;){if(l.return===null||l.return===o)return!0;l=l.return}l.sibling.return=l.return,l=l.sibling}}return!0}function al(o,l){for(l&=~_v,l&=~em,o.suspendedLanes|=l,o.pingedLanes&=~l,o=o.expirationTimes;0<l;){var p=31-kt(l),x=1<<p;o[p]=-1,l&=~x}}function m1(o){if(yn&6)throw Error(t(327));hf();var l=mi(o,0);if(!(l&1))return Br(o,de()),null;var p=om(o,l);if(o.tag!==0&&p===2){var x=os(o);x!==0&&(l=x,p=Mv(o,x))}if(p===1)throw p=eh,hu(o,0),al(o,l),Br(o,de()),p;if(p===6)throw Error(t(345));return o.finishedWork=o.current.alternate,o.finishedLanes=l,pu(o,Pr,ua),Br(o,de()),null}function wv(o,l){var p=yn;yn|=1;try{return o(l)}finally{yn=p,yn===0&&(df=de()+500,Yl&&fs())}}function du(o){sl!==null&&sl.tag===0&&!(yn&6)&&hf();var l=yn;yn|=1;var p=ms.transition,x=on;try{if(ms.transition=null,on=1,o)return o()}finally{on=x,ms.transition=p,yn=l,!(yn&6)&&fs()}}function Cv(){Qr=ff.current,bn(ff)}function hu(o,l){o.finishedWork=null,o.finishedLanes=0;var p=o.timeoutHandle;if(p!==-1&&(o.timeoutHandle=-1,Id(p)),hi!==null)for(p=hi.return;p!==null;){var x=p;switch(Ns(x),x.tag){case 1:x=x.type.childContextTypes,x!=null&&Jl();break;case 3:_o(),bn(ki),bn(yi),hs();break;case 5:el(x);break;case 4:_o();break;case 13:bn(Pn);break;case 19:bn(Pn);break;case 10:eu(x.type._context);break;case 22:case 23:Cv()}p=p.return}if(Pi=o,hi=o=ll(o.current,null),Wi=Qr=l,Mi=0,eh=null,_v=em=fu=0,Pr=th=null,Os!==null){for(l=0;l<Os.length;l++)if(p=Os[l],x=p.interleaved,x!==null){p.interleaved=null;var w=x.next,I=p.pending;if(I!==null){var N=I.next;I.next=w,x.next=N}p.pending=x}Os=null}return o}function g1(o,l){do{var p=hi;try{if(ta(),sa.current=lf,Kr){for(var x=Rn.memoizedState;x!==null;){var w=x.queue;w!==null&&(w.pending=null),x=x.next}Kr=!1}if(Hs=0,pn=kn=Rn=null,Ii=!1,xo=0,yv.current=null,p===null||p.return===null){Mi=1,eh=l,hi=null;break}e:{var I=o,N=p.return,Q=p,te=l;if(l=Wi,Q.flags|=32768,te!==null&&typeof te=="object"&&typeof te.then=="function"){var Se=te,He=Q,We=He.tag;if(!(He.mode&1)&&(We===0||We===11||We===15)){var Oe=He.alternate;Oe?(He.updateQueue=Oe.updateQueue,He.memoizedState=Oe.memoizedState,He.lanes=Oe.lanes):(He.updateQueue=null,He.memoizedState=null)}var pt=yt(N);if(pt!==null){pt.flags&=-257,Gt(pt,N,Q,I,l),pt.mode&1&&Ke(I,Se,l),l=pt,te=Se;var At=l.updateQueue;if(At===null){var Et=new Set;Et.add(te),l.updateQueue=Et}else At.add(te);break e}else{if(!(l&1)){Ke(I,Se,l),Tv();break e}te=Error(t(426))}}else if(In&&Q.mode&1){var ni=yt(N);if(ni!==null){!(ni.flags&65536)&&(ni.flags|=256),Gt(ni,N,Q,I,l),qa(E(te,Q));break e}}I=te=E(te,Q),Mi!==4&&(Mi=2),th===null?th=[I]:th.push(I),I=N;do{switch(I.tag){case 3:I.flags|=65536,l&=-l,I.lanes|=l;var me=se(I,te,l);na(I,me);break e;case 1:Q=te;var re=I.type,ve=I.stateNode;if(!(I.flags&128)&&(typeof re.getDerivedStateFromError=="function"||ve!==null&&typeof ve.componentDidCatch=="function"&&(rl===null||!rl.has(ve)))){I.flags|=65536,l&=-l,I.lanes|=l;var Qe=Te(I,Q,l);na(I,Qe);break e}}I=I.return}while(I!==null)}_1(p)}catch(bt){l=bt,hi===p&&p!==null&&(hi=p=p.return);continue}break}while(!0)}function v1(){var o=$p.current;return $p.current=lf,o===null?lf:o}function Tv(){(Mi===0||Mi===3||Mi===2)&&(Mi=4),Pi===null||!(fu&268435455)&&!(em&268435455)||al(Pi,Wi)}function om(o,l){var p=yn;yn|=2;var x=v1();(Pi!==o||Wi!==l)&&(ua=null,hu(o,l));do try{Zw();break}catch(w){g1(o,w)}while(!0);if(ta(),yn=p,$p.current=x,hi!==null)throw Error(t(261));return Pi=null,Wi=0,Mi}function Zw(){for(;hi!==null;)y1(hi)}function $w(){for(;hi!==null&&!le();)y1(hi)}function y1(o){var l=S1(o.alternate,o,Qr);o.memoizedProps=o.pendingProps,l===null?_1(o):hi=l,yv.current=null}function _1(o){var l=o;do{var p=l.alternate;if(o=l.return,l.flags&32768){if(p=jw(p,l),p!==null){p.flags&=32767,hi=p;return}if(o!==null)o.flags|=32768,o.subtreeFlags=0,o.deletions=null;else{Mi=6,hi=null;return}}else if(p=Xw(p,l,Qr),p!==null){hi=p;return}if(l=l.sibling,l!==null){hi=l;return}hi=l=o}while(l!==null);Mi===0&&(Mi=5)}function pu(o,l,p){var x=on,w=ms.transition;try{ms.transition=null,on=1,eC(o,l,p,x)}finally{ms.transition=w,on=x}return null}function eC(o,l,p,x){do hf();while(sl!==null);if(yn&6)throw Error(t(327));p=o.finishedWork;var w=o.finishedLanes;if(p===null)return null;if(o.finishedWork=null,o.finishedLanes=0,p===o.current)throw Error(t(177));o.callbackNode=null,o.callbackPriority=0;var I=p.lanes|p.childLanes;if(gi(o,I),o===Pi&&(hi=Pi=null,Wi=0),!(p.subtreeFlags&2064)&&!(p.flags&2064)||nm||(nm=!0,M1(dt,function(){return hf(),null})),I=(p.flags&15990)!==0,p.subtreeFlags&15990||I){I=ms.transition,ms.transition=null;var N=on;on=1;var Q=yn;yn|=4,yv.current=null,Kw(o,p),u1(p,o),ui(Td),Sr=!!Ka,Td=Ka=null,o.current=p,Yw(p),Ae(),yn=Q,on=N,ms.transition=I}else o.current=p;if(nm&&(nm=!1,sl=o,im=w),I=o.pendingLanes,I===0&&(rl=null),Mt(p.stateNode),Br(o,de()),l!==null)for(x=o.onRecoverableError,p=0;p<l.length;p++)w=l[p],x(w.value,{componentStack:w.stack,digest:w.digest});if(tm)throw tm=!1,o=Av,Av=null,o;return im&1&&o.tag!==0&&hf(),I=o.pendingLanes,I&1?o===Sv?nh++:(nh=0,Sv=o):nh=0,fs(),null}function hf(){if(sl!==null){var o=Ji(im),l=ms.transition,p=on;try{if(ms.transition=null,on=16>o?16:o,sl===null)var x=!1;else{if(o=sl,sl=null,im=0,yn&6)throw Error(t(331));var w=yn;for(yn|=4,xt=o.current;xt!==null;){var I=xt,N=I.child;if(xt.flags&16){var Q=I.deletions;if(Q!==null){for(var te=0;te<Q.length;te++){var Se=Q[te];for(xt=Se;xt!==null;){var He=xt;switch(He.tag){case 0:case 11:case 15:$d(8,He,I)}var We=He.child;if(We!==null)We.return=He,xt=We;else for(;xt!==null;){He=xt;var Oe=He.sibling,pt=He.return;if(r1(He),He===Se){xt=null;break}if(Oe!==null){Oe.return=pt,xt=Oe;break}xt=pt}}}var At=I.alternate;if(At!==null){var Et=At.child;if(Et!==null){At.child=null;do{var ni=Et.sibling;Et.sibling=null,Et=ni}while(Et!==null)}}xt=I}}if(I.subtreeFlags&2064&&N!==null)N.return=I,xt=N;else e:for(;xt!==null;){if(I=xt,I.flags&2048)switch(I.tag){case 0:case 11:case 15:$d(9,I,I.return)}var me=I.sibling;if(me!==null){me.return=I.return,xt=me;break e}xt=I.return}}var re=o.current;for(xt=re;xt!==null;){N=xt;var ve=N.child;if(N.subtreeFlags&2064&&ve!==null)ve.return=N,xt=ve;else e:for(N=re;xt!==null;){if(Q=xt,Q.flags&2048)try{switch(Q.tag){case 0:case 11:case 15:Zp(9,Q)}}catch(bt){qn(Q,Q.return,bt)}if(Q===N){xt=null;break e}var Qe=Q.sibling;if(Qe!==null){Qe.return=Q.return,xt=Qe;break e}xt=Q.return}}if(yn=w,fs(),Ye&&typeof Ye.onPostCommitFiberRoot=="function")try{Ye.onPostCommitFiberRoot(Rt,o)}catch{}x=!0}return x}finally{on=p,ms.transition=l}}return!1}function x1(o,l,p){l=E(p,l),l=se(o,l,1),o=Ln(o,l,1),l=vr(),o!==null&&(ai(o,1,l),Br(o,l))}function qn(o,l,p){if(o.tag===3)x1(o,o,p);else for(;l!==null;){if(l.tag===3){x1(l,o,p);break}else if(l.tag===1){var x=l.stateNode;if(typeof l.type.getDerivedStateFromError=="function"||typeof x.componentDidCatch=="function"&&(rl===null||!rl.has(x))){o=E(p,o),o=Te(l,o,1),l=Ln(l,o,1),o=vr(),l!==null&&(ai(l,1,o),Br(l,o));break}}l=l.return}}function tC(o,l,p){var x=o.pingCache;x!==null&&x.delete(l),l=vr(),o.pingedLanes|=o.suspendedLanes&p,Pi===o&&(Wi&p)===p&&(Mi===4||Mi===3&&(Wi&130023424)===Wi&&500>de()-xv?hu(o,0):_v|=p),Br(o,l)}function A1(o,l){l===0&&(o.mode&1?(l=un,un<<=1,!(un&130023424)&&(un=4194304)):l=1);var p=vr();o=jr(o,l),o!==null&&(ai(o,l,p),Br(o,p))}function nC(o){var l=o.memoizedState,p=0;l!==null&&(p=l.retryLane),A1(o,p)}function iC(o,l){var p=0;switch(o.tag){case 13:var x=o.stateNode,w=o.memoizedState;w!==null&&(p=w.retryLane);break;case 19:x=o.stateNode;break;default:throw Error(t(314))}x!==null&&x.delete(l),A1(o,p)}var S1;S1=function(o,l,p){if(o!==null)if(o.memoizedProps!==l.pendingProps||ki.current)qt=!0;else{if(!(o.lanes&p)&&!(l.flags&128))return qt=!1,Ww(o,l,p);qt=!!(o.flags&131072)}else qt=!1,In&&l.flags&1048576&&Fd(l,qc,l.index);switch(l.lanes=0,l.tag){case 2:var x=l.type;Qp(o,l),o=l.pendingProps;var w=Ko(l,yi.current);yo(l,p),w=su(null,l,x,o,w,p);var I=Vd();return l.flags|=1,typeof w=="object"&&w!==null&&typeof w.render=="function"&&w.$$typeof===void 0?(l.tag=1,l.memoizedState=null,l.updateQueue=null,bi(x)?(I=!0,Yo(l)):I=!1,l.memoizedState=w.state!==null&&w.state!==void 0?w.state:null,jt(l),w.updater=uf,l.stateNode=w,w._reactInternals=l,y(l,x,o,p),l=Wt(null,l,x,!0,I,p)):(l.tag=0,In&&I&&Nd(l),ft(null,l,w,p),l=l.child),l;case 16:x=l.elementType;e:{switch(Qp(o,l),o=l.pendingProps,w=x._init,x=w(x._payload),l.type=x,w=l.tag=sC(x),o=Ir(x,o),w){case 0:l=at(null,l,x,o,p);break e;case 1:l=Ct(null,l,x,o,p);break e;case 11:l=Si(null,l,x,o,p);break e;case 14:l=gr(null,l,x,Ir(x.type,o),p);break e}throw Error(t(306,x,""))}return l;case 0:return x=l.type,w=l.pendingProps,w=l.elementType===x?w:Ir(x,w),at(o,l,x,w,p);case 1:return x=l.type,w=l.pendingProps,w=l.elementType===x?w:Ir(x,w),Ct(o,l,x,w,p);case 3:e:{if(Vt(l),o===null)throw Error(t(387));x=l.pendingProps,I=l.memoizedState,w=I.element,Xn(o,l),On(l,x,null,p);var N=l.memoizedState;if(x=N.element,I.isDehydrated)if(I={element:x,isDehydrated:!1,cache:N.cache,pendingSuspenseBoundaries:N.pendingSuspenseBoundaries,transitions:N.transitions},l.updateQueue.baseState=I,l.memoizedState=I,l.flags&256){w=E(Error(t(423)),l),l=hn(o,l,x,p,w);break e}else if(x!==w){w=E(Error(t(424)),l),l=hn(o,l,x,p,w);break e}else for(zi=Ps(l.stateNode.containerInfo.firstChild),_i=l,In=!0,Rr=null,p=$l(l,null,x,p),l.child=p;p;)p.flags=p.flags&-3|4096,p=p.sibling;else{if(vo(),x===w){l=la(o,l,p);break e}ft(o,l,x,p)}l=l.child}return l;case 5:return ra(l),o===null&&$c(l),x=l.type,w=l.pendingProps,I=o!==null?o.memoizedProps:null,N=w.children,bd(x,w)?N=null:I!==null&&bd(x,I)&&(l.flags|=32),Ee(o,l),ft(o,l,N,p),l.child;case 6:return o===null&&$c(l),null;case 13:return Vs(o,l,p);case 4:return iu(l,l.stateNode.containerInfo),x=l.pendingProps,o===null?l.child=Zo(l,null,x,p):ft(o,l,x,p),l.child;case 11:return x=l.type,w=l.pendingProps,w=l.elementType===x?w:Ir(x,w),Si(o,l,x,w,p);case 7:return ft(o,l,l.pendingProps,p),l.child;case 8:return ft(o,l,l.pendingProps.children,p),l.child;case 12:return ft(o,l,l.pendingProps.children,p),l.child;case 10:e:{if(x=l.type._context,w=l.pendingProps,I=l.memoizedProps,N=w.value,En($o,x._currentValue),x._currentValue=N,I!==null)if(ur(I.value,N)){if(I.children===w.children&&!ki.current){l=la(o,l,p);break e}}else for(I=l.child,I!==null&&(I.return=l);I!==null;){var Q=I.dependencies;if(Q!==null){N=I.child;for(var te=Q.firstContext;te!==null;){if(te.context===x){if(I.tag===1){te=Mn(-1,p&-p),te.tag=2;var Se=I.updateQueue;if(Se!==null){Se=Se.shared;var He=Se.pending;He===null?te.next=te:(te.next=He.next,He.next=te),Se.pending=te}}I.lanes|=p,te=I.alternate,te!==null&&(te.lanes|=p),tu(I.return,p,l),Q.lanes|=p;break}te=te.next}}else if(I.tag===10)N=I.type===l.type?null:I.child;else if(I.tag===18){if(N=I.return,N===null)throw Error(t(341));N.lanes|=p,Q=N.alternate,Q!==null&&(Q.lanes|=p),tu(N,p,l),N=I.sibling}else N=I.child;if(N!==null)N.return=I;else for(N=I;N!==null;){if(N===l){N=null;break}if(I=N.sibling,I!==null){I.return=N.return,N=I;break}N=N.return}I=N}ft(o,l,w.children,p),l=l.child}return l;case 9:return w=l.type,x=l.pendingProps.children,yo(l,p),w=dr(w),x=x(w),l.flags|=1,ft(o,l,x,p),l.child;case 14:return x=l.type,w=Ir(x,l.pendingProps),w=Ir(x.type,w),gr(o,l,x,w,p);case 15:return xe(o,l,l.type,l.pendingProps,p);case 17:return x=l.type,w=l.pendingProps,w=l.elementType===x?w:Ir(x,w),Qp(o,l),l.tag=1,bi(x)?(o=!0,Yo(l)):o=!1,yo(l,p),c(l,x,w),y(l,x,w,p),Wt(null,l,x,!0,o,p);case 19:return $x(o,l,p);case 22:return ue(o,l,p)}throw Error(t(156,l.tag))};function M1(o,l){return mc(o,l)}function rC(o,l,p,x){this.tag=o,this.key=p,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.ref=null,this.pendingProps=l,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=x,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function gs(o,l,p,x){return new rC(o,l,p,x)}function bv(o){return o=o.prototype,!(!o||!o.isReactComponent)}function sC(o){if(typeof o=="function")return bv(o)?1:0;if(o!=null){if(o=o.$$typeof,o===oe)return 11;if(o===ye)return 14}return 2}function ll(o,l){var p=o.alternate;return p===null?(p=gs(o.tag,l,o.key,o.mode),p.elementType=o.elementType,p.type=o.type,p.stateNode=o.stateNode,p.alternate=o,o.alternate=p):(p.pendingProps=l,p.type=o.type,p.flags=0,p.subtreeFlags=0,p.deletions=null),p.flags=o.flags&14680064,p.childLanes=o.childLanes,p.lanes=o.lanes,p.child=o.child,p.memoizedProps=o.memoizedProps,p.memoizedState=o.memoizedState,p.updateQueue=o.updateQueue,l=o.dependencies,p.dependencies=l===null?null:{lanes:l.lanes,firstContext:l.firstContext},p.sibling=o.sibling,p.index=o.index,p.ref=o.ref,p}function am(o,l,p,x,w,I){var N=2;if(x=o,typeof o=="function")bv(o)&&(N=1);else if(typeof o=="string")N=5;else e:switch(o){case k:return mu(p.children,w,I,l);case G:N=8,w|=8;break;case D:return o=gs(12,p,l,w|2),o.elementType=D,o.lanes=I,o;case ie:return o=gs(13,p,l,w),o.elementType=ie,o.lanes=I,o;case ge:return o=gs(19,p,l,w),o.elementType=ge,o.lanes=I,o;case _e:return lm(p,w,I,l);default:if(typeof o=="object"&&o!==null)switch(o.$$typeof){case L:N=10;break e;case V:N=9;break e;case oe:N=11;break e;case ye:N=14;break e;case he:N=16,x=null;break e}throw Error(t(130,o==null?o:typeof o,""))}return l=gs(N,p,l,w),l.elementType=o,l.type=x,l.lanes=I,l}function mu(o,l,p,x){return o=gs(7,o,x,l),o.lanes=p,o}function lm(o,l,p,x){return o=gs(22,o,x,l),o.elementType=_e,o.lanes=p,o.stateNode={isHidden:!1},o}function Rv(o,l,p){return o=gs(6,o,null,l),o.lanes=p,o}function Iv(o,l,p){return l=gs(4,o.children!==null?o.children:[],o.key,l),l.lanes=p,l.stateNode={containerInfo:o.containerInfo,pendingChildren:null,implementation:o.implementation},l}function oC(o,l,p,x,w){this.tag=l,this.containerInfo=o,this.finishedWork=this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.pendingContext=this.context=null,this.callbackPriority=0,this.eventTimes=Ti(0),this.expirationTimes=Ti(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=Ti(0),this.identifierPrefix=x,this.onRecoverableError=w,this.mutableSourceEagerHydrationData=null}function Pv(o,l,p,x,w,I,N,Q,te){return o=new oC(o,l,p,Q,te),l===1?(l=1,I===!0&&(l|=8)):l=0,I=gs(3,null,null,l),o.current=I,I.stateNode=o,I.memoizedState={element:x,isDehydrated:p,cache:null,transitions:null,pendingSuspenseBoundaries:null},jt(I),o}function aC(o,l,p){var x=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:F,key:x==null?null:""+x,children:o,containerInfo:l,implementation:p}}function E1(o){if(!o)return Ls;o=o._reactInternals;e:{if(ss(o)!==o||o.tag!==1)throw Error(t(170));var l=o;do{switch(l.tag){case 3:l=l.stateNode.context;break e;case 1:if(bi(l.type)){l=l.stateNode.__reactInternalMemoizedMergedChildContext;break e}}l=l.return}while(l!==null);throw Error(t(171))}if(o.tag===1){var p=o.type;if(bi(p))return Kl(o,p,l)}return l}function w1(o,l,p,x,w,I,N,Q,te){return o=Pv(p,x,!0,o,w,I,N,Q,te),o.context=E1(null),p=o.current,x=vr(),w=ol(p),I=Mn(x,w),I.callback=l??null,Ln(p,I,w),o.current.lanes=w,ai(o,w,x),Br(o,x),o}function um(o,l,p,x){var w=l.current,I=vr(),N=ol(w);return p=E1(p),l.context===null?l.context=p:l.pendingContext=p,l=Mn(I,N),l.payload={element:o},x=x===void 0?null:x,x!==null&&(l.callback=x),o=Ln(w,l,N),o!==null&&(js(o,w,N,I),Ri(o,w,N)),N}function cm(o){if(o=o.current,!o.child)return null;switch(o.child.tag){case 5:return o.child.stateNode;default:return o.child.stateNode}}function C1(o,l){if(o=o.memoizedState,o!==null&&o.dehydrated!==null){var p=o.retryLane;o.retryLane=p!==0&&p<l?p:l}}function Bv(o,l){C1(o,l),(o=o.alternate)&&C1(o,l)}function lC(){return null}var T1=typeof reportError=="function"?reportError:function(o){console.error(o)};function Lv(o){this._internalRoot=o}fm.prototype.render=Lv.prototype.render=function(o){var l=this._internalRoot;if(l===null)throw Error(t(409));um(o,l,null,null)},fm.prototype.unmount=Lv.prototype.unmount=function(){var o=this._internalRoot;if(o!==null){this._internalRoot=null;var l=o.containerInfo;du(function(){um(null,o,null,null)}),l[fr]=null}};function fm(o){this._internalRoot=o}fm.prototype.unstable_scheduleHydration=function(o){if(o){var l=gc();o={blockedOn:null,target:o,priority:l};for(var p=0;p<lo.length&&l!==0&&l<lo[p].priority;p++);lo.splice(p,0,o),p===0&&_c(o)}};function Dv(o){return!(!o||o.nodeType!==1&&o.nodeType!==9&&o.nodeType!==11)}function dm(o){return!(!o||o.nodeType!==1&&o.nodeType!==9&&o.nodeType!==11&&(o.nodeType!==8||o.nodeValue!==" react-mount-point-unstable "))}function b1(){}function uC(o,l,p,x,w){if(w){if(typeof x=="function"){var I=x;x=function(){var Se=cm(N);I.call(Se)}}var N=w1(l,x,o,0,null,!1,!1,"",b1);return o._reactRootContainer=N,o[fr]=N.current,ja(o.nodeType===8?o.parentNode:o),du(),N}for(;w=o.lastChild;)o.removeChild(w);if(typeof x=="function"){var Q=x;x=function(){var Se=cm(te);Q.call(Se)}}var te=Pv(o,0,!1,null,null,!1,!1,"",b1);return o._reactRootContainer=te,o[fr]=te.current,ja(o.nodeType===8?o.parentNode:o),du(function(){um(l,te,p,x)}),te}function hm(o,l,p,x,w){var I=p._reactRootContainer;if(I){var N=I;if(typeof w=="function"){var Q=w;w=function(){var te=cm(N);Q.call(te)}}um(l,N,o,w)}else N=uC(p,l,o,w,x);return cm(N)}Pl=function(o){switch(o.tag){case 3:var l=o.stateNode;if(l.current.memoizedState.isDehydrated){var p=$t(l.pendingLanes);p!==0&&(Vn(l,p|1),Br(l,de()),!(yn&6)&&(df=de()+500,fs()))}break;case 13:du(function(){var x=jr(o,1);if(x!==null){var w=vr();js(x,o,1,w)}}),Bv(o,1)}},cd=function(o){if(o.tag===13){var l=jr(o,134217728);if(l!==null){var p=vr();js(l,o,134217728,p)}Bv(o,134217728)}},Mp=function(o){if(o.tag===13){var l=ol(o),p=jr(o,l);if(p!==null){var x=vr();js(p,o,l,x)}Bv(o,l)}},gc=function(){return on},vc=function(o,l){var p=on;try{return on=o,l()}finally{on=p}},Ve=function(o,l,p){switch(l){case"input":if(et(o,p),l=p.name,p.type==="radio"&&l!=null){for(p=o;p.parentNode;)p=p.parentNode;for(p=p.querySelectorAll("input[name="+JSON.stringify(""+l)+'][type="radio"]'),l=0;l<p.length;l++){var x=p[l];if(x!==o&&x.form===o.form){var w=Kc(x);if(!w)throw Error(t(90));Ne(x),et(x,w)}}}break;case"textarea":Ce(o,p);break;case"select":l=p.value,l!=null&&j(o,!!p.multiple,l,!1)}},ln=wv,Cn=du;var cC={usingClientEntryPoint:!1,Events:[Bs,Wn,Kc,it,It,wv]},ih={findFiberByHostInstance:go,bundleType:0,version:"18.3.1",rendererPackageName:"react-dom"},fC={bundleType:ih.bundleType,version:ih.version,rendererPackageName:ih.rendererPackageName,rendererConfig:ih.rendererConfig,overrideHookState:null,overrideHookStateDeletePath:null,overrideHookStateRenamePath:null,overrideProps:null,overridePropsDeletePath:null,overridePropsRenamePath:null,setErrorHandler:null,setSuspenseHandler:null,scheduleUpdate:null,currentDispatcherRef:P.ReactCurrentDispatcher,findHostInstanceByFiber:function(o){return o=hc(o),o===null?null:o.stateNode},findFiberByHostInstance:ih.findFiberByHostInstance||lC,findHostInstancesForRefresh:null,scheduleRefresh:null,scheduleRoot:null,setRefreshHandler:null,getCurrentFiber:null,reconcilerVersion:"18.3.1-next-f1338f8080-20240426"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var pm=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!pm.isDisabled&&pm.supportsFiber)try{Rt=pm.inject(fC),Ye=pm}catch{}}return Lr.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=cC,Lr.createPortal=function(o,l){var p=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!Dv(l))throw Error(t(200));return aC(o,l,null,p)},Lr.createRoot=function(o,l){if(!Dv(o))throw Error(t(299));var p=!1,x="",w=T1;return l!=null&&(l.unstable_strictMode===!0&&(p=!0),l.identifierPrefix!==void 0&&(x=l.identifierPrefix),l.onRecoverableError!==void 0&&(w=l.onRecoverableError)),l=Pv(o,1,!1,null,null,p,!1,x,w),o[fr]=l.current,ja(o.nodeType===8?o.parentNode:o),new Lv(l)},Lr.findDOMNode=function(o){if(o==null)return null;if(o.nodeType===1)return o;var l=o._reactInternals;if(l===void 0)throw typeof o.render=="function"?Error(t(188)):(o=Object.keys(o).join(","),Error(t(268,o)));return o=hc(l),o=o===null?null:o.stateNode,o},Lr.flushSync=function(o){return du(o)},Lr.hydrate=function(o,l,p){if(!dm(l))throw Error(t(200));return hm(null,o,l,!0,p)},Lr.hydrateRoot=function(o,l,p){if(!Dv(o))throw Error(t(405));var x=p!=null&&p.hydratedSources||null,w=!1,I="",N=T1;if(p!=null&&(p.unstable_strictMode===!0&&(w=!0),p.identifierPrefix!==void 0&&(I=p.identifierPrefix),p.onRecoverableError!==void 0&&(N=p.onRecoverableError)),l=w1(l,null,o,1,p??null,w,!1,I,N),o[fr]=l.current,ja(o),x)for(o=0;o<x.length;o++)p=x[o],w=p._getVersion,w=w(p._source),l.mutableSourceEagerHydrationData==null?l.mutableSourceEagerHydrationData=[p,w]:l.mutableSourceEagerHydrationData.push(p,w);return new fm(l)},Lr.render=function(o,l,p){if(!dm(l))throw Error(t(200));return hm(null,o,l,!1,p)},Lr.unmountComponentAtNode=function(o){if(!dm(o))throw Error(t(40));return o._reactRootContainer?(du(function(){hm(null,null,o,!1,function(){o._reactRootContainer=null,o[fr]=null})}),!0):!1},Lr.unstable_batchedUpdates=wv,Lr.unstable_renderSubtreeIntoContainer=function(o,l,p,x){if(!dm(p))throw Error(t(200));if(o==null||o._reactInternals===void 0)throw Error(t(38));return hm(o,l,p,!1,x)},Lr.version="18.3.1-next-f1338f8080-20240426",Lr}var N1;function AC(){if(N1)return Uv.exports;N1=1;function i(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(i)}catch(e){console.error(e)}}return i(),Uv.exports=xC(),Uv.exports}var U1;function SC(){if(U1)return mm;U1=1;var i=AC();return mm.createRoot=i.createRoot,mm.hydrateRoot=i.hydrateRoot,mm}var A2=SC(),sh={},O1;function MC(){if(O1)return sh;O1=1,Object.defineProperty(sh,"__esModule",{value:!0}),sh.parse=a,sh.serialize=h;const i=/^[\u0021-\u003A\u003C\u003E-\u007E]+$/,e=/^[\u0021-\u003A\u003C-\u007E]*$/,t=/^([.]?[a-z0-9]([a-z0-9-]{0,61}[a-z0-9])?)([.][a-z0-9]([a-z0-9-]{0,61}[a-z0-9])?)*$/i,n=/^[\u0020-\u003A\u003D-\u007E]*$/,r=Object.prototype.toString,s=(()=>{const v=function(){};return v.prototype=Object.create(null),v})();function a(v,_){const A=new s,C=v.length;if(C<2)return A;const M=(_==null?void 0:_.decode)||m;let S=0;do{const b=v.indexOf("=",S);if(b===-1)break;const R=v.indexOf(";",S),P=R===-1?C:R;if(b>P){S=v.lastIndexOf(";",b-1)+1;continue}const U=u(v,S,b),F=d(v,b,U),k=v.slice(U,F);if(A[k]===void 0){let G=u(v,b+1,P),D=d(v,P,G);const L=M(v.slice(G,D));A[k]=L}S=P+1}while(S<C);return A}function u(v,_,A){do{const C=v.charCodeAt(_);if(C!==32&&C!==9)return _}while(++_<A);return A}function d(v,_,A){for(;_>A;){const C=v.charCodeAt(--_);if(C!==32&&C!==9)return _+1}return A}function h(v,_,A){const C=(A==null?void 0:A.encode)||encodeURIComponent;if(!i.test(v))throw new TypeError(`argument name is invalid: ${v}`);const M=C(_);if(!e.test(M))throw new TypeError(`argument val is invalid: ${_}`);let S=v+"="+M;if(!A)return S;if(A.maxAge!==void 0){if(!Number.isInteger(A.maxAge))throw new TypeError(`option maxAge is invalid: ${A.maxAge}`);S+="; Max-Age="+A.maxAge}if(A.domain){if(!t.test(A.domain))throw new TypeError(`option domain is invalid: ${A.domain}`);S+="; Domain="+A.domain}if(A.path){if(!n.test(A.path))throw new TypeError(`option path is invalid: ${A.path}`);S+="; Path="+A.path}if(A.expires){if(!g(A.expires)||!Number.isFinite(A.expires.valueOf()))throw new TypeError(`option expires is invalid: ${A.expires}`);S+="; Expires="+A.expires.toUTCString()}if(A.httpOnly&&(S+="; HttpOnly"),A.secure&&(S+="; Secure"),A.partitioned&&(S+="; Partitioned"),A.priority)switch(typeof A.priority=="string"?A.priority.toLowerCase():void 0){case"low":S+="; Priority=Low";break;case"medium":S+="; Priority=Medium";break;case"high":S+="; Priority=High";break;default:throw new TypeError(`option priority is invalid: ${A.priority}`)}if(A.sameSite)switch(typeof A.sameSite=="string"?A.sameSite.toLowerCase():A.sameSite){case!0:case"strict":S+="; SameSite=Strict";break;case"lax":S+="; SameSite=Lax";break;case"none":S+="; SameSite=None";break;default:throw new TypeError(`option sameSite is invalid: ${A.sameSite}`)}return S}function m(v){if(v.indexOf("%")===-1)return v;try{return decodeURIComponent(v)}catch{return v}}function g(v){return r.call(v)==="[object Date]"}return sh}MC();/**
 * react-router v7.1.5
 *
 * Copyright (c) Remix Software Inc.
 *
 * This source code is licensed under the MIT license found in the
 * LICENSE.md file in the root directory of this source tree.
 *
 * @license MIT
 */var k1="popstate";function EC(i={}){function e(n,r){let{pathname:s,search:a,hash:u}=n.location;return r_("",{pathname:s,search:a,hash:u},r.state&&r.state.usr||null,r.state&&r.state.key||"default")}function t(n,r){return typeof r=="string"?r:Uh(r)}return CC(e,t,null,i)}function Jn(i,e){if(i===!1||i===null||typeof i>"u")throw new Error(e)}function Co(i,e){if(!i){typeof console<"u"&&console.warn(e);try{throw new Error(e)}catch{}}}function wC(){return Math.random().toString(36).substring(2,10)}function H1(i,e){return{usr:i.state,key:i.key,idx:e}}function r_(i,e,t=null,n){return{pathname:typeof i=="string"?i:i.pathname,search:"",hash:"",...typeof e=="string"?nd(e):e,state:t,key:e&&e.key||n||wC()}}function Uh({pathname:i="/",search:e="",hash:t=""}){return e&&e!=="?"&&(i+=e.charAt(0)==="?"?e:"?"+e),t&&t!=="#"&&(i+=t.charAt(0)==="#"?t:"#"+t),i}function nd(i){let e={};if(i){let t=i.indexOf("#");t>=0&&(e.hash=i.substring(t),i=i.substring(0,t));let n=i.indexOf("?");n>=0&&(e.search=i.substring(n),i=i.substring(0,n)),i&&(e.pathname=i)}return e}function CC(i,e,t,n={}){let{window:r=document.defaultView,v5Compat:s=!1}=n,a=r.history,u="POP",d=null,h=m();h==null&&(h=0,a.replaceState({...a.state,idx:h},""));function m(){return(a.state||{idx:null}).idx}function g(){u="POP";let M=m(),S=M==null?null:M-h;h=M,d&&d({action:u,location:C.location,delta:S})}function v(M,S){u="PUSH";let b=r_(C.location,M,S);h=m()+1;let R=H1(b,h),P=C.createHref(b);try{a.pushState(R,"",P)}catch(U){if(U instanceof DOMException&&U.name==="DataCloneError")throw U;r.location.assign(P)}s&&d&&d({action:u,location:C.location,delta:1})}function _(M,S){u="REPLACE";let b=r_(C.location,M,S);h=m();let R=H1(b,h),P=C.createHref(b);a.replaceState(R,"",P),s&&d&&d({action:u,location:C.location,delta:0})}function A(M){let S=r.location.origin!=="null"?r.location.origin:r.location.href,b=typeof M=="string"?M:Uh(M);return b=b.replace(/ $/,"%20"),Jn(S,`No window.location.(origin|href) available to create URL for href: ${b}`),new URL(b,S)}let C={get action(){return u},get location(){return i(r,a)},listen(M){if(d)throw new Error("A history only accepts one active listener");return r.addEventListener(k1,g),d=M,()=>{r.removeEventListener(k1,g),d=null}},createHref(M){return e(r,M)},createURL:A,encodeLocation(M){let S=A(M);return{pathname:S.pathname,search:S.search,hash:S.hash}},push:v,replace:_,go(M){return a.go(M)}};return C}function S2(i,e,t="/"){return TC(i,e,t,!1)}function TC(i,e,t,n){let r=typeof e=="string"?nd(e):e,s=El(r.pathname||"/",t);if(s==null)return null;let a=M2(i);bC(a);let u=null;for(let d=0;u==null&&d<a.length;++d){let h=kC(s);u=UC(a[d],h,n)}return u}function M2(i,e=[],t=[],n=""){let r=(s,a,u)=>{let d={relativePath:u===void 0?s.path||"":u,caseSensitive:s.caseSensitive===!0,childrenIndex:a,route:s};d.relativePath.startsWith("/")&&(Jn(d.relativePath.startsWith(n),`Absolute route path "${d.relativePath}" nested under path "${n}" is not valid. An absolute child route path must start with the combined path of all its parent routes.`),d.relativePath=d.relativePath.slice(n.length));let h=Sa([n,d.relativePath]),m=t.concat(d);s.children&&s.children.length>0&&(Jn(s.index!==!0,`Index routes must not have child routes. Please remove all child routes from route path "${h}".`),M2(s.children,e,m,h)),!(s.path==null&&!s.index)&&e.push({path:h,score:FC(h,s.index),routesMeta:m})};return i.forEach((s,a)=>{var u;if(s.path===""||!((u=s.path)!=null&&u.includes("?")))r(s,a);else for(let d of E2(s.path))r(s,a,d)}),e}function E2(i){let e=i.split("/");if(e.length===0)return[];let[t,...n]=e,r=t.endsWith("?"),s=t.replace(/\?$/,"");if(n.length===0)return r?[s,""]:[s];let a=E2(n.join("/")),u=[];return u.push(...a.map(d=>d===""?s:[s,d].join("/"))),r&&u.push(...a),u.map(d=>i.startsWith("/")&&d===""?"/":d)}function bC(i){i.sort((e,t)=>e.score!==t.score?t.score-e.score:NC(e.routesMeta.map(n=>n.childrenIndex),t.routesMeta.map(n=>n.childrenIndex)))}var RC=/^:[\w-]+$/,IC=3,PC=2,BC=1,LC=10,DC=-2,z1=i=>i==="*";function FC(i,e){let t=i.split("/"),n=t.length;return t.some(z1)&&(n+=DC),e&&(n+=PC),t.filter(r=>!z1(r)).reduce((r,s)=>r+(RC.test(s)?IC:s===""?BC:LC),n)}function NC(i,e){return i.length===e.length&&i.slice(0,-1).every((n,r)=>n===e[r])?i[i.length-1]-e[e.length-1]:0}function UC(i,e,t=!1){let{routesMeta:n}=i,r={},s="/",a=[];for(let u=0;u<n.length;++u){let d=n[u],h=u===n.length-1,m=s==="/"?e:e.slice(s.length)||"/",g=wg({path:d.relativePath,caseSensitive:d.caseSensitive,end:h},m),v=d.route;if(!g&&h&&t&&!n[n.length-1].route.index&&(g=wg({path:d.relativePath,caseSensitive:d.caseSensitive,end:!1},m)),!g)return null;Object.assign(r,g.params),a.push({params:r,pathname:Sa([s,g.pathname]),pathnameBase:VC(Sa([s,g.pathnameBase])),route:v}),g.pathnameBase!=="/"&&(s=Sa([s,g.pathnameBase]))}return a}function wg(i,e){typeof i=="string"&&(i={path:i,caseSensitive:!1,end:!0});let[t,n]=OC(i.path,i.caseSensitive,i.end),r=e.match(t);if(!r)return null;let s=r[0],a=s.replace(/(.)\/+$/,"$1"),u=r.slice(1);return{params:n.reduce((h,{paramName:m,isOptional:g},v)=>{if(m==="*"){let A=u[v]||"";a=s.slice(0,s.length-A.length).replace(/(.)\/+$/,"$1")}const _=u[v];return g&&!_?h[m]=void 0:h[m]=(_||"").replace(/%2F/g,"/"),h},{}),pathname:s,pathnameBase:a,pattern:i}}function OC(i,e=!1,t=!0){Co(i==="*"||!i.endsWith("*")||i.endsWith("/*"),`Route path "${i}" will be treated as if it were "${i.replace(/\*$/,"/*")}" because the \`*\` character must always follow a \`/\` in the pattern. To get rid of this warning, please change the route path to "${i.replace(/\*$/,"/*")}".`);let n=[],r="^"+i.replace(/\/*\*?$/,"").replace(/^\/*/,"/").replace(/[\\.*+^${}|()[\]]/g,"\\$&").replace(/\/:([\w-]+)(\?)?/g,(a,u,d)=>(n.push({paramName:u,isOptional:d!=null}),d?"/?([^\\/]+)?":"/([^\\/]+)"));return i.endsWith("*")?(n.push({paramName:"*"}),r+=i==="*"||i==="/*"?"(.*)$":"(?:\\/(.+)|\\/*)$"):t?r+="\\/*$":i!==""&&i!=="/"&&(r+="(?:(?=\\/|$))"),[new RegExp(r,e?void 0:"i"),n]}function kC(i){try{return i.split("/").map(e=>decodeURIComponent(e).replace(/\//g,"%2F")).join("/")}catch(e){return Co(!1,`The URL path "${i}" could not be decoded because it is a malformed URL segment. This is probably due to a bad percent encoding (${e}).`),i}}function El(i,e){if(e==="/")return i;if(!i.toLowerCase().startsWith(e.toLowerCase()))return null;let t=e.endsWith("/")?e.length-1:e.length,n=i.charAt(t);return n&&n!=="/"?null:i.slice(t)||"/"}function HC(i,e="/"){let{pathname:t,search:n="",hash:r=""}=typeof i=="string"?nd(i):i;return{pathname:t?t.startsWith("/")?t:zC(t,e):e,search:WC(n),hash:XC(r)}}function zC(i,e){let t=e.replace(/\/+$/,"").split("/");return i.split("/").forEach(r=>{r===".."?t.length>1&&t.pop():r!=="."&&t.push(r)}),t.length>1?t.join("/"):"/"}function Hv(i,e,t,n){return`Cannot include a '${i}' character in a manually specified \`to.${e}\` field [${JSON.stringify(n)}].  Please separate it out to the \`to.${t}\` field. Alternatively you may provide the full path as a string in <Link to="..."> and the router will parse it for you.`}function GC(i){return i.filter((e,t)=>t===0||e.route.path&&e.route.path.length>0)}function w2(i){let e=GC(i);return e.map((t,n)=>n===e.length-1?t.pathname:t.pathnameBase)}function C2(i,e,t,n=!1){let r;typeof i=="string"?r=nd(i):(r={...i},Jn(!r.pathname||!r.pathname.includes("?"),Hv("?","pathname","search",r)),Jn(!r.pathname||!r.pathname.includes("#"),Hv("#","pathname","hash",r)),Jn(!r.search||!r.search.includes("#"),Hv("#","search","hash",r)));let s=i===""||r.pathname==="",a=s?"/":r.pathname,u;if(a==null)u=t;else{let g=e.length-1;if(!n&&a.startsWith("..")){let v=a.split("/");for(;v[0]==="..";)v.shift(),g-=1;r.pathname=v.join("/")}u=g>=0?e[g]:"/"}let d=HC(r,u),h=a&&a!=="/"&&a.endsWith("/"),m=(s||a===".")&&t.endsWith("/");return!d.pathname.endsWith("/")&&(h||m)&&(d.pathname+="/"),d}var Sa=i=>i.join("/").replace(/\/\/+/g,"/"),VC=i=>i.replace(/\/+$/,"").replace(/^\/*/,"/"),WC=i=>!i||i==="?"?"":i.startsWith("?")?i:"?"+i,XC=i=>!i||i==="#"?"":i.startsWith("#")?i:"#"+i;function jC(i){return i!=null&&typeof i.status=="number"&&typeof i.statusText=="string"&&typeof i.internal=="boolean"&&"data"in i}var T2=["POST","PUT","PATCH","DELETE"];new Set(T2);var JC=["GET",...T2];new Set(JC);var id=Y.createContext(null);id.displayName="DataRouter";var A0=Y.createContext(null);A0.displayName="DataRouterState";var b2=Y.createContext({isTransitioning:!1});b2.displayName="ViewTransition";var KC=Y.createContext(new Map);KC.displayName="Fetchers";var YC=Y.createContext(null);YC.displayName="Await";var Ro=Y.createContext(null);Ro.displayName="Navigation";var ep=Y.createContext(null);ep.displayName="Location";var Ia=Y.createContext({outlet:null,matches:[],isDataRoute:!1});Ia.displayName="Route";var F_=Y.createContext(null);F_.displayName="RouteError";function QC(i,{relative:e}={}){Jn(tp(),"useHref() may be used only in the context of a <Router> component.");let{basename:t,navigator:n}=Y.useContext(Ro),{hash:r,pathname:s,search:a}=np(i,{relative:e}),u=s;return t!=="/"&&(u=s==="/"?t:Sa([t,s])),n.createHref({pathname:u,search:a,hash:r})}function tp(){return Y.useContext(ep)!=null}function ic(){return Jn(tp(),"useLocation() may be used only in the context of a <Router> component."),Y.useContext(ep).location}var R2="You should call navigate() in a React.useEffect(), not when your component is first rendered.";function I2(i){Y.useContext(Ro).static||Y.useLayoutEffect(i)}function qC(){let{isDataRoute:i}=Y.useContext(Ia);return i?cT():ZC()}function ZC(){Jn(tp(),"useNavigate() may be used only in the context of a <Router> component.");let i=Y.useContext(id),{basename:e,navigator:t}=Y.useContext(Ro),{matches:n}=Y.useContext(Ia),{pathname:r}=ic(),s=JSON.stringify(w2(n)),a=Y.useRef(!1);return I2(()=>{a.current=!0}),Y.useCallback((d,h={})=>{if(Co(a.current,R2),!a.current)return;if(typeof d=="number"){t.go(d);return}let m=C2(d,JSON.parse(s),r,h.relative==="path");i==null&&e!=="/"&&(m.pathname=m.pathname==="/"?e:Sa([e,m.pathname])),(h.replace?t.replace:t.push)(m,h.state,h)},[e,t,s,r,i])}Y.createContext(null);function np(i,{relative:e}={}){let{matches:t}=Y.useContext(Ia),{pathname:n}=ic(),r=JSON.stringify(w2(t));return Y.useMemo(()=>C2(i,JSON.parse(r),n,e==="path"),[i,r,n,e])}function $C(i,e){return P2(i,e)}function P2(i,e,t,n){var b;Jn(tp(),"useRoutes() may be used only in the context of a <Router> component.");let{navigator:r,static:s}=Y.useContext(Ro),{matches:a}=Y.useContext(Ia),u=a[a.length-1],d=u?u.params:{},h=u?u.pathname:"/",m=u?u.pathnameBase:"/",g=u&&u.route;{let R=g&&g.path||"";B2(h,!g||R.endsWith("*")||R.endsWith("*?"),`You rendered descendant <Routes> (or called \`useRoutes()\`) at "${h}" (under <Route path="${R}">) but the parent route path has no trailing "*". This means if you navigate deeper, the parent won't match anymore and therefore the child routes will never render.

Please change the parent <Route path="${R}"> to <Route path="${R==="/"?"*":`${R}/*`}">.`)}let v=ic(),_;if(e){let R=typeof e=="string"?nd(e):e;Jn(m==="/"||((b=R.pathname)==null?void 0:b.startsWith(m)),`When overriding the location using \`<Routes location>\` or \`useRoutes(routes, location)\`, the location pathname must begin with the portion of the URL pathname that was matched by all parent routes. The current pathname base is "${m}" but pathname "${R.pathname}" was given in the \`location\` prop.`),_=R}else _=v;let A=_.pathname||"/",C=A;if(m!=="/"){let R=m.replace(/^\//,"").split("/");C="/"+A.replace(/^\//,"").split("/").slice(R.length).join("/")}let M=!s&&t&&t.matches&&t.matches.length>0?t.matches:S2(i,{pathname:C});Co(g||M!=null,`No routes matched location "${_.pathname}${_.search}${_.hash}" `),Co(M==null||M[M.length-1].route.element!==void 0||M[M.length-1].route.Component!==void 0||M[M.length-1].route.lazy!==void 0,`Matched leaf route at location "${_.pathname}${_.search}${_.hash}" does not have an element or Component. This means it will render an <Outlet /> with a null value by default resulting in an "empty" page.`);let S=rT(M&&M.map(R=>Object.assign({},R,{params:Object.assign({},d,R.params),pathname:Sa([m,r.encodeLocation?r.encodeLocation(R.pathname).pathname:R.pathname]),pathnameBase:R.pathnameBase==="/"?m:Sa([m,r.encodeLocation?r.encodeLocation(R.pathnameBase).pathname:R.pathnameBase])})),a,t,n);return e&&S?Y.createElement(ep.Provider,{value:{location:{pathname:"/",search:"",hash:"",state:null,key:"default",..._},navigationType:"POP"}},S):S}function eT(){let i=uT(),e=jC(i)?`${i.status} ${i.statusText}`:i instanceof Error?i.message:JSON.stringify(i),t=i instanceof Error?i.stack:null,n="rgba(200,200,200, 0.5)",r={padding:"0.5rem",backgroundColor:n},s={padding:"2px 4px",backgroundColor:n},a=null;return console.error("Error handled by React Router default ErrorBoundary:",i),a=Y.createElement(Y.Fragment,null,Y.createElement("p",null,"💿 Hey developer 👋"),Y.createElement("p",null,"You can provide a way better UX than this when your app throws errors by providing your own ",Y.createElement("code",{style:s},"ErrorBoundary")," or"," ",Y.createElement("code",{style:s},"errorElement")," prop on your route.")),Y.createElement(Y.Fragment,null,Y.createElement("h2",null,"Unexpected Application Error!"),Y.createElement("h3",{style:{fontStyle:"italic"}},e),t?Y.createElement("pre",{style:r},t):null,a)}var tT=Y.createElement(eT,null),nT=class extends Y.Component{constructor(i){super(i),this.state={location:i.location,revalidation:i.revalidation,error:i.error}}static getDerivedStateFromError(i){return{error:i}}static getDerivedStateFromProps(i,e){return e.location!==i.location||e.revalidation!=="idle"&&i.revalidation==="idle"?{error:i.error,location:i.location,revalidation:i.revalidation}:{error:i.error!==void 0?i.error:e.error,location:e.location,revalidation:i.revalidation||e.revalidation}}componentDidCatch(i,e){console.error("React Router caught the following error during render",i,e)}render(){return this.state.error!==void 0?Y.createElement(Ia.Provider,{value:this.props.routeContext},Y.createElement(F_.Provider,{value:this.state.error,children:this.props.component})):this.props.children}};function iT({routeContext:i,match:e,children:t}){let n=Y.useContext(id);return n&&n.static&&n.staticContext&&(e.route.errorElement||e.route.ErrorBoundary)&&(n.staticContext._deepestRenderedBoundaryId=e.route.id),Y.createElement(Ia.Provider,{value:i},t)}function rT(i,e=[],t=null,n=null){if(i==null){if(!t)return null;if(t.errors)i=t.matches;else if(e.length===0&&!t.initialized&&t.matches.length>0)i=t.matches;else return null}let r=i,s=t==null?void 0:t.errors;if(s!=null){let d=r.findIndex(h=>h.route.id&&(s==null?void 0:s[h.route.id])!==void 0);Jn(d>=0,`Could not find a matching route for errors on route IDs: ${Object.keys(s).join(",")}`),r=r.slice(0,Math.min(r.length,d+1))}let a=!1,u=-1;if(t)for(let d=0;d<r.length;d++){let h=r[d];if((h.route.HydrateFallback||h.route.hydrateFallbackElement)&&(u=d),h.route.id){let{loaderData:m,errors:g}=t,v=h.route.loader&&!m.hasOwnProperty(h.route.id)&&(!g||g[h.route.id]===void 0);if(h.route.lazy||v){a=!0,u>=0?r=r.slice(0,u+1):r=[r[0]];break}}}return r.reduceRight((d,h,m)=>{let g,v=!1,_=null,A=null;t&&(g=s&&h.route.id?s[h.route.id]:void 0,_=h.route.errorElement||tT,a&&(u<0&&m===0?(B2("route-fallback",!1,"No `HydrateFallback` element provided to render during initial hydration"),v=!0,A=null):u===m&&(v=!0,A=h.route.hydrateFallbackElement||null)));let C=e.concat(r.slice(0,m+1)),M=()=>{let S;return g?S=_:v?S=A:h.route.Component?S=Y.createElement(h.route.Component,null):h.route.element?S=h.route.element:S=d,Y.createElement(iT,{match:h,routeContext:{outlet:d,matches:C,isDataRoute:t!=null},children:S})};return t&&(h.route.ErrorBoundary||h.route.errorElement||m===0)?Y.createElement(nT,{location:t.location,revalidation:t.revalidation,component:_,error:g,children:M(),routeContext:{outlet:null,matches:C,isDataRoute:!0}}):M()},null)}function N_(i){return`${i} must be used within a data router.  See https://reactrouter.com/en/main/routers/picking-a-router.`}function sT(i){let e=Y.useContext(id);return Jn(e,N_(i)),e}function oT(i){let e=Y.useContext(A0);return Jn(e,N_(i)),e}function aT(i){let e=Y.useContext(Ia);return Jn(e,N_(i)),e}function U_(i){let e=aT(i),t=e.matches[e.matches.length-1];return Jn(t.route.id,`${i} can only be used on routes that contain a unique "id"`),t.route.id}function lT(){return U_("useRouteId")}function uT(){var n;let i=Y.useContext(F_),e=oT("useRouteError"),t=U_("useRouteError");return i!==void 0?i:(n=e.errors)==null?void 0:n[t]}function cT(){let{router:i}=sT("useNavigate"),e=U_("useNavigate"),t=Y.useRef(!1);return I2(()=>{t.current=!0}),Y.useCallback(async(r,s={})=>{Co(t.current,R2),t.current&&(typeof r=="number"?i.navigate(r):await i.navigate(r,{fromRouteId:e,...s}))},[i,e])}var G1={};function B2(i,e,t){!e&&!G1[i]&&(G1[i]=!0,Co(!1,t))}Y.memo(fT);function fT({routes:i,future:e,state:t}){return P2(i,void 0,t,e)}function Eh(i){Jn(!1,"A <Route> is only ever to be used as the child of <Routes> element, never rendered directly. Please wrap your <Route> in a <Routes>.")}function dT({basename:i="/",children:e=null,location:t,navigationType:n="POP",navigator:r,static:s=!1}){Jn(!tp(),"You cannot render a <Router> inside another <Router>. You should never have more than one in your app.");let a=i.replace(/^\/*/,"/"),u=Y.useMemo(()=>({basename:a,navigator:r,static:s,future:{}}),[a,r,s]);typeof t=="string"&&(t=nd(t));let{pathname:d="/",search:h="",hash:m="",state:g=null,key:v="default"}=t,_=Y.useMemo(()=>{let A=El(d,a);return A==null?null:{location:{pathname:A,search:h,hash:m,state:g,key:v},navigationType:n}},[a,d,h,m,g,v,n]);return Co(_!=null,`<Router basename="${a}"> is not able to match the URL "${d}${h}${m}" because it does not start with the basename, so the <Router> won't render anything.`),_==null?null:Y.createElement(Ro.Provider,{value:u},Y.createElement(ep.Provider,{children:e,value:_}))}function hT({children:i,location:e}){return $C(s_(i),e)}function s_(i,e=[]){let t=[];return Y.Children.forEach(i,(n,r)=>{if(!Y.isValidElement(n))return;let s=[...e,r];if(n.type===Y.Fragment){t.push.apply(t,s_(n.props.children,s));return}Jn(n.type===Eh,`[${typeof n.type=="string"?n.type:n.type.name}] is not a <Route> component. All component children of <Routes> must be a <Route> or <React.Fragment>`),Jn(!n.props.index||!n.props.children,"An index route cannot have child routes.");let a={id:n.props.id||s.join("-"),caseSensitive:n.props.caseSensitive,element:n.props.element,Component:n.props.Component,index:n.props.index,path:n.props.path,loader:n.props.loader,action:n.props.action,hydrateFallbackElement:n.props.hydrateFallbackElement,HydrateFallback:n.props.HydrateFallback,errorElement:n.props.errorElement,ErrorBoundary:n.props.ErrorBoundary,hasErrorBoundary:n.props.hasErrorBoundary===!0||n.props.ErrorBoundary!=null||n.props.errorElement!=null,shouldRevalidate:n.props.shouldRevalidate,handle:n.props.handle,lazy:n.props.lazy};n.props.children&&(a.children=s_(n.props.children,s)),t.push(a)}),t}var gg="get",vg="application/x-www-form-urlencoded";function S0(i){return i!=null&&typeof i.tagName=="string"}function pT(i){return S0(i)&&i.tagName.toLowerCase()==="button"}function mT(i){return S0(i)&&i.tagName.toLowerCase()==="form"}function gT(i){return S0(i)&&i.tagName.toLowerCase()==="input"}function vT(i){return!!(i.metaKey||i.altKey||i.ctrlKey||i.shiftKey)}function yT(i,e){return i.button===0&&(!e||e==="_self")&&!vT(i)}var gm=null;function _T(){if(gm===null)try{new FormData(document.createElement("form"),0),gm=!1}catch{gm=!0}return gm}var xT=new Set(["application/x-www-form-urlencoded","multipart/form-data","text/plain"]);function zv(i){return i!=null&&!xT.has(i)?(Co(!1,`"${i}" is not a valid \`encType\` for \`<Form>\`/\`<fetcher.Form>\` and will default to "${vg}"`),null):i}function AT(i,e){let t,n,r,s,a;if(mT(i)){let u=i.getAttribute("action");n=u?El(u,e):null,t=i.getAttribute("method")||gg,r=zv(i.getAttribute("enctype"))||vg,s=new FormData(i)}else if(pT(i)||gT(i)&&(i.type==="submit"||i.type==="image")){let u=i.form;if(u==null)throw new Error('Cannot submit a <button> or <input type="submit"> without a <form>');let d=i.getAttribute("formaction")||u.getAttribute("action");if(n=d?El(d,e):null,t=i.getAttribute("formmethod")||u.getAttribute("method")||gg,r=zv(i.getAttribute("formenctype"))||zv(u.getAttribute("enctype"))||vg,s=new FormData(u,i),!_T()){let{name:h,type:m,value:g}=i;if(m==="image"){let v=h?`${h}.`:"";s.append(`${v}x`,"0"),s.append(`${v}y`,"0")}else h&&s.append(h,g)}}else{if(S0(i))throw new Error('Cannot submit element that is not <form>, <button>, or <input type="submit|image">');t=gg,n=null,r=vg,a=i}return s&&r==="text/plain"&&(a=s,s=void 0),{action:n,method:t.toLowerCase(),encType:r,formData:s,body:a}}function O_(i,e){if(i===!1||i===null||typeof i>"u")throw new Error(e)}async function ST(i,e){if(i.id in e)return e[i.id];try{let t=await import(i.module);return e[i.id]=t,t}catch(t){return console.error(`Error loading route module \`${i.module}\`, reloading page...`),console.error(t),window.__reactRouterContext&&window.__reactRouterContext.isSpaMode,window.location.reload(),new Promise(()=>{})}}function MT(i){return i==null?!1:i.href==null?i.rel==="preload"&&typeof i.imageSrcSet=="string"&&typeof i.imageSizes=="string":typeof i.rel=="string"&&typeof i.href=="string"}async function ET(i,e,t){let n=await Promise.all(i.map(async r=>{let s=e.routes[r.route.id];if(s){let a=await ST(s,t);return a.links?a.links():[]}return[]}));return bT(n.flat(1).filter(MT).filter(r=>r.rel==="stylesheet"||r.rel==="preload").map(r=>r.rel==="stylesheet"?{...r,rel:"prefetch",as:"style"}:{...r,rel:"prefetch"}))}function V1(i,e,t,n,r,s){let a=(d,h)=>t[h]?d.route.id!==t[h].route.id:!0,u=(d,h)=>{var m;return t[h].pathname!==d.pathname||((m=t[h].route.path)==null?void 0:m.endsWith("*"))&&t[h].params["*"]!==d.params["*"]};return s==="assets"?e.filter((d,h)=>a(d,h)||u(d,h)):s==="data"?e.filter((d,h)=>{var g;let m=n.routes[d.route.id];if(!m||!m.hasLoader)return!1;if(a(d,h)||u(d,h))return!0;if(d.route.shouldRevalidate){let v=d.route.shouldRevalidate({currentUrl:new URL(r.pathname+r.search+r.hash,window.origin),currentParams:((g=t[0])==null?void 0:g.params)||{},nextUrl:new URL(i,window.origin),nextParams:d.params,defaultShouldRevalidate:!0});if(typeof v=="boolean")return v}return!0}):[]}function wT(i,e){return CT(i.map(t=>{let n=e.routes[t.route.id];if(!n)return[];let r=[n.module];return n.imports&&(r=r.concat(n.imports)),r}).flat(1))}function CT(i){return[...new Set(i)]}function TT(i){let e={},t=Object.keys(i).sort();for(let n of t)e[n]=i[n];return e}function bT(i,e){let t=new Set;return new Set(e),i.reduce((n,r)=>{let s=JSON.stringify(TT(r));return t.has(s)||(t.add(s),n.push({key:s,link:r})),n},[])}function RT(i){let e=typeof i=="string"?new URL(i,typeof window>"u"?"server://singlefetch/":window.location.origin):i;return e.pathname==="/"?e.pathname="_root.data":e.pathname=`${e.pathname.replace(/\/$/,"")}.data`,e}function IT(){let i=Y.useContext(id);return O_(i,"You must render this element inside a <DataRouterContext.Provider> element"),i}function PT(){let i=Y.useContext(A0);return O_(i,"You must render this element inside a <DataRouterStateContext.Provider> element"),i}var k_=Y.createContext(void 0);k_.displayName="FrameworkContext";function L2(){let i=Y.useContext(k_);return O_(i,"You must render this element inside a <HydratedRouter> element"),i}function BT(i,e){let t=Y.useContext(k_),[n,r]=Y.useState(!1),[s,a]=Y.useState(!1),{onFocus:u,onBlur:d,onMouseEnter:h,onMouseLeave:m,onTouchStart:g}=e,v=Y.useRef(null);Y.useEffect(()=>{if(i==="render"&&a(!0),i==="viewport"){let C=S=>{S.forEach(b=>{a(b.isIntersecting)})},M=new IntersectionObserver(C,{threshold:.5});return v.current&&M.observe(v.current),()=>{M.disconnect()}}},[i]),Y.useEffect(()=>{if(n){let C=setTimeout(()=>{a(!0)},100);return()=>{clearTimeout(C)}}},[n]);let _=()=>{r(!0)},A=()=>{r(!1),a(!1)};return t?i!=="intent"?[s,v,{}]:[s,v,{onFocus:oh(u,_),onBlur:oh(d,A),onMouseEnter:oh(h,_),onMouseLeave:oh(m,A),onTouchStart:oh(g,_)}]:[!1,v,{}]}function oh(i,e){return t=>{i&&i(t),t.defaultPrevented||e(t)}}function LT({page:i,...e}){let{router:t}=IT(),n=Y.useMemo(()=>S2(t.routes,i,t.basename),[t.routes,i,t.basename]);return n?Y.createElement(FT,{page:i,matches:n,...e}):null}function DT(i){let{manifest:e,routeModules:t}=L2(),[n,r]=Y.useState([]);return Y.useEffect(()=>{let s=!1;return ET(i,e,t).then(a=>{s||r(a)}),()=>{s=!0}},[i,e,t]),n}function FT({page:i,matches:e,...t}){let n=ic(),{manifest:r,routeModules:s}=L2(),{loaderData:a,matches:u}=PT(),d=Y.useMemo(()=>V1(i,e,u,r,n,"data"),[i,e,u,r,n]),h=Y.useMemo(()=>V1(i,e,u,r,n,"assets"),[i,e,u,r,n]),m=Y.useMemo(()=>{if(i===n.pathname+n.search+n.hash)return[];let _=new Set,A=!1;if(e.forEach(M=>{var b;let S=r.routes[M.route.id];!S||!S.hasLoader||(!d.some(R=>R.route.id===M.route.id)&&M.route.id in a&&((b=s[M.route.id])!=null&&b.shouldRevalidate)||S.hasClientLoader?A=!0:_.add(M.route.id))}),_.size===0)return[];let C=RT(i);return A&&_.size>0&&C.searchParams.set("_routes",e.filter(M=>_.has(M.route.id)).map(M=>M.route.id).join(",")),[C.pathname+C.search]},[a,n,r,d,e,i,s]),g=Y.useMemo(()=>wT(h,r),[h,r]),v=DT(h);return Y.createElement(Y.Fragment,null,m.map(_=>Y.createElement("link",{key:_,rel:"prefetch",as:"fetch",href:_,...t})),g.map(_=>Y.createElement("link",{key:_,rel:"modulepreload",href:_,...t})),v.map(({key:_,link:A})=>Y.createElement("link",{key:_,...A})))}function NT(...i){return e=>{i.forEach(t=>{typeof t=="function"?t(e):t!=null&&(t.current=e)})}}var D2=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";try{D2&&(window.__reactRouterVersion="7.1.5")}catch{}function UT({basename:i,children:e,window:t}){let n=Y.useRef();n.current==null&&(n.current=EC({window:t,v5Compat:!0}));let r=n.current,[s,a]=Y.useState({action:r.action,location:r.location}),u=Y.useCallback(d=>{Y.startTransition(()=>a(d))},[a]);return Y.useLayoutEffect(()=>r.listen(u),[r,u]),Y.createElement(dT,{basename:i,children:e,location:s.location,navigationType:s.action,navigator:r})}var F2=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,zf=Y.forwardRef(function({onClick:e,discover:t="render",prefetch:n="none",relative:r,reloadDocument:s,replace:a,state:u,target:d,to:h,preventScrollReset:m,viewTransition:g,...v},_){let{basename:A}=Y.useContext(Ro),C=typeof h=="string"&&F2.test(h),M,S=!1;if(typeof h=="string"&&C&&(M=h,D2))try{let D=new URL(window.location.href),L=h.startsWith("//")?new URL(D.protocol+h):new URL(h),V=El(L.pathname,A);L.origin===D.origin&&V!=null?h=V+L.search+L.hash:S=!0}catch{Co(!1,`<Link to="${h}"> contains an invalid URL which will probably break when clicked - please update to a valid URL path.`)}let b=QC(h,{relative:r}),[R,P,U]=BT(n,v),F=HT(h,{replace:a,state:u,target:d,preventScrollReset:m,relative:r,viewTransition:g});function k(D){e&&e(D),D.defaultPrevented||F(D)}let G=Y.createElement("a",{...v,...U,href:M||b,onClick:S||s?e:k,ref:NT(_,P),target:d,"data-discover":!C&&t==="render"?"true":void 0});return R&&!C?Y.createElement(Y.Fragment,null,G,Y.createElement(LT,{page:b})):G});zf.displayName="Link";var yg=Y.forwardRef(function({"aria-current":e="page",caseSensitive:t=!1,className:n="",end:r=!1,style:s,to:a,viewTransition:u,children:d,...h},m){let g=np(a,{relative:h.relative}),v=ic(),_=Y.useContext(A0),{navigator:A,basename:C}=Y.useContext(Ro),M=_!=null&&XT(g)&&u===!0,S=A.encodeLocation?A.encodeLocation(g).pathname:g.pathname,b=v.pathname,R=_&&_.navigation&&_.navigation.location?_.navigation.location.pathname:null;t||(b=b.toLowerCase(),R=R?R.toLowerCase():null,S=S.toLowerCase()),R&&C&&(R=El(R,C)||R);const P=S!=="/"&&S.endsWith("/")?S.length-1:S.length;let U=b===S||!r&&b.startsWith(S)&&b.charAt(P)==="/",F=R!=null&&(R===S||!r&&R.startsWith(S)&&R.charAt(S.length)==="/"),k={isActive:U,isPending:F,isTransitioning:M},G=U?e:void 0,D;typeof n=="function"?D=n(k):D=[n,U?"active":null,F?"pending":null,M?"transitioning":null].filter(Boolean).join(" ");let L=typeof s=="function"?s(k):s;return Y.createElement(zf,{...h,"aria-current":G,className:D,ref:m,style:L,to:a,viewTransition:u},typeof d=="function"?d(k):d)});yg.displayName="NavLink";var OT=Y.forwardRef(({discover:i="render",fetcherKey:e,navigate:t,reloadDocument:n,replace:r,state:s,method:a=gg,action:u,onSubmit:d,relative:h,preventScrollReset:m,viewTransition:g,...v},_)=>{let A=VT(),C=WT(u,{relative:h}),M=a.toLowerCase()==="get"?"get":"post",S=typeof u=="string"&&F2.test(u),b=R=>{if(d&&d(R),R.defaultPrevented)return;R.preventDefault();let P=R.nativeEvent.submitter,U=(P==null?void 0:P.getAttribute("formmethod"))||a;A(P||R.currentTarget,{fetcherKey:e,method:U,navigate:t,replace:r,state:s,relative:h,preventScrollReset:m,viewTransition:g})};return Y.createElement("form",{ref:_,method:M,action:C,onSubmit:n?d:b,...v,"data-discover":!S&&i==="render"?"true":void 0})});OT.displayName="Form";function kT(i){return`${i} must be used within a data router.  See https://reactrouter.com/en/main/routers/picking-a-router.`}function N2(i){let e=Y.useContext(id);return Jn(e,kT(i)),e}function HT(i,{target:e,replace:t,state:n,preventScrollReset:r,relative:s,viewTransition:a}={}){let u=qC(),d=ic(),h=np(i,{relative:s});return Y.useCallback(m=>{if(yT(m,e)){m.preventDefault();let g=t!==void 0?t:Uh(d)===Uh(h);u(i,{replace:g,state:n,preventScrollReset:r,relative:s,viewTransition:a})}},[d,u,h,t,n,e,i,r,s,a])}var zT=0,GT=()=>`__${String(++zT)}__`;function VT(){let{router:i}=N2("useSubmit"),{basename:e}=Y.useContext(Ro),t=lT();return Y.useCallback(async(n,r={})=>{let{action:s,method:a,encType:u,formData:d,body:h}=AT(n,e);if(r.navigate===!1){let m=r.fetcherKey||GT();await i.fetch(m,t,r.action||s,{preventScrollReset:r.preventScrollReset,formData:d,body:h,formMethod:r.method||a,formEncType:r.encType||u,flushSync:r.flushSync})}else await i.navigate(r.action||s,{preventScrollReset:r.preventScrollReset,formData:d,body:h,formMethod:r.method||a,formEncType:r.encType||u,replace:r.replace,state:r.state,fromRouteId:t,flushSync:r.flushSync,viewTransition:r.viewTransition})},[i,e,t])}function WT(i,{relative:e}={}){let{basename:t}=Y.useContext(Ro),n=Y.useContext(Ia);Jn(n,"useFormAction must be used inside a RouteContext");let[r]=n.matches.slice(-1),s={...np(i||".",{relative:e})},a=ic();if(i==null){s.search=a.search;let u=new URLSearchParams(s.search),d=u.getAll("index");if(d.some(m=>m==="")){u.delete("index"),d.filter(g=>g).forEach(g=>u.append("index",g));let m=u.toString();s.search=m?`?${m}`:""}}return(!i||i===".")&&r.route.index&&(s.search=s.search?s.search.replace(/^\?/,"?index&"):"?index"),t!=="/"&&(s.pathname=s.pathname==="/"?t:Sa([t,s.pathname])),Uh(s)}function XT(i,e={}){let t=Y.useContext(b2);Jn(t!=null,"`useViewTransitionState` must be used within `react-router-dom`'s `RouterProvider`.  Did you accidentally import `RouterProvider` from `react-router`?");let{basename:n}=N2("useViewTransitionState"),r=np(i,{relative:e.relative});if(!t.isTransitioning)return!1;let s=El(t.currentLocation.pathname,n)||t.currentLocation.pathname,a=El(t.nextLocation.pathname,n)||t.nextLocation.pathname;return wg(r.pathname,a)!=null||wg(r.pathname,s)!=null}new TextEncoder;const jT=()=>fe.jsxs("header",{className:"header",children:[fe.jsx(yg,{to:"/",className:"w-10 h-10 rounded-lg bg-white flex items-center justify-center font-bold",children:fe.jsx("p",{className:"blue-gradient_text",children:"AH"})}),fe.jsxs("nav",{className:"flex text-lg gap-7 font-medium",children:[fe.jsx(yg,{to:"/about",className:({isActive:i})=>i?"text-blue-500":"text-white",children:"About"}),fe.jsx(yg,{to:"/projects",className:({isActive:i})=>i?"text-blue-500":"text-white",children:"Projects"})]})]});/**
 * @license
 * Copyright 2010-2025 Three.js Authors
 * SPDX-License-Identifier: MIT
 */const ip="173",Iu={LEFT:0,MIDDLE:1,RIGHT:2,ROTATE:0,DOLLY:1,PAN:2},Pu={ROTATE:0,PAN:1,DOLLY_PAN:2,DOLLY_ROTATE:3},U2=0,o_=1,O2=2,JT=3,k2=0,M0=1,Th=2,Qs=3,To=0,Ar=1,_s=2,Ma=0,Vu=1,a_=2,l_=3,u_=4,H2=5,_l=100,z2=101,G2=102,V2=103,W2=104,X2=200,j2=201,J2=202,K2=203,Cg=204,Tg=205,Y2=206,Q2=207,q2=208,Z2=209,$2=210,eM=211,tM=212,nM=213,iM=214,bg=0,Rg=1,Ig=2,Ku=3,Pg=4,Bg=5,Lg=6,Dg=7,rp=0,rM=1,sM=2,Mo=0,oM=1,aM=2,lM=3,H_=4,uM=5,cM=6,fM=7,c_="attached",dM="detached",E0=300,Ta=301,wl=302,Oh=303,kh=304,rd=306,Cl=1e3,$r=1001,jf=1002,Di=1003,w0=1004,KT=1004,Nu=1005,YT=1005,ri=1006,Gf=1007,QT=1007,As=1008,qT=1008,to=1009,z_=1010,G_=1011,Jf=1012,C0=1013,ba=1014,Or=1015,sd=1016,T0=1017,b0=1018,Yu=1020,V_=35902,W_=1021,X_=1022,rr=1023,j_=1024,J_=1025,Wu=1026,Qu=1027,R0=1028,sp=1029,K_=1030,I0=1031,ZT=1032,P0=1033,bh=33776,Rh=33777,Ih=33778,Ph=33779,Fg=35840,Ng=35841,Ug=35842,Og=35843,kg=36196,Hg=37492,zg=37496,Gg=37808,Vg=37809,Wg=37810,Xg=37811,jg=37812,Jg=37813,Kg=37814,Yg=37815,Qg=37816,qg=37817,Zg=37818,$g=37819,e0=37820,t0=37821,Bh=36492,n0=36494,i0=36495,Y_=36283,r0=36284,s0=36285,o0=36286,hM=2200,pM=2201,mM=2202,Kf=2300,Yf=2301,_g=2302,Uu=2400,Ou=2401,Hh=2402,B0=2500,Q_=2501,gM=0,q_=1,a0=2,vM=3200,yM=3201,$T=3202,eb=3203,bl=0,_M=1,ya="",Nr="srgb",qu="srgb-linear",zh="linear",wn="srgb",tb=0,Bu=7680,nb=7681,ib=7682,rb=7683,sb=34055,ob=34056,ab=5386,lb=512,ub=513,cb=514,fb=515,db=516,hb=517,pb=518,f_=519,xM=512,AM=513,SM=514,Z_=515,MM=516,EM=517,wM=518,CM=519,Gh=35044,mb=35048,gb=35040,vb=35045,yb=35049,_b=35041,xb=35046,Ab=35050,Sb=35042,Mb="100",d_="300 es",Zs=2e3,Vh=2001,Eb={COMPUTE:"compute",RENDER:"render"};let Io=class{addEventListener(e,t){this._listeners===void 0&&(this._listeners={});const n=this._listeners;n[e]===void 0&&(n[e]=[]),n[e].indexOf(t)===-1&&n[e].push(t)}hasEventListener(e,t){const n=this._listeners;return n===void 0?!1:n[e]!==void 0&&n[e].indexOf(t)!==-1}removeEventListener(e,t){const n=this._listeners;if(n===void 0)return;const r=n[e];if(r!==void 0){const s=r.indexOf(t);s!==-1&&r.splice(s,1)}}dispatchEvent(e){const t=this._listeners;if(t===void 0)return;const n=t[e.type];if(n!==void 0){e.target=this;const r=n.slice(0);for(let s=0,a=r.length;s<a;s++)r[s].call(this,e);e.target=null}}};const tr=["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 W1=1234567;const Xu=Math.PI/180,Qf=180/Math.PI;function ts(){const i=Math.random()*4294967295|0,e=Math.random()*4294967295|0,t=Math.random()*4294967295|0,n=Math.random()*4294967295|0;return(tr[i&255]+tr[i>>8&255]+tr[i>>16&255]+tr[i>>24&255]+"-"+tr[e&255]+tr[e>>8&255]+"-"+tr[e>>16&15|64]+tr[e>>24&255]+"-"+tr[t&63|128]+tr[t>>8&255]+"-"+tr[t>>16&255]+tr[t>>24&255]+tr[n&255]+tr[n>>8&255]+tr[n>>16&255]+tr[n>>24&255]).toLowerCase()}function Xt(i,e,t){return Math.max(e,Math.min(t,i))}function $_(i,e){return(i%e+e)%e}function wb(i,e,t,n,r){return n+(i-e)*(r-n)/(t-e)}function Cb(i,e,t){return i!==e?(t-i)/(e-i):0}function Lh(i,e,t){return(1-t)*i+t*e}function Tb(i,e,t,n){return Lh(i,e,1-Math.exp(-t*n))}function bb(i,e=1){return e-Math.abs($_(i,e*2)-e)}function Rb(i,e,t){return i<=e?0:i>=t?1:(i=(i-e)/(t-e),i*i*(3-2*i))}function Ib(i,e,t){return i<=e?0:i>=t?1:(i=(i-e)/(t-e),i*i*i*(i*(i*6-15)+10))}function Pb(i,e){return i+Math.floor(Math.random()*(e-i+1))}function Bb(i,e){return i+Math.random()*(e-i)}function Lb(i){return i*(.5-Math.random())}function Db(i){i!==void 0&&(W1=i);let e=W1+=1831565813;return e=Math.imul(e^e>>>15,e|1),e^=e+Math.imul(e^e>>>7,e|61),((e^e>>>14)>>>0)/4294967296}function Fb(i){return i*Xu}function Nb(i){return i*Qf}function Ub(i){return(i&i-1)===0&&i!==0}function Ob(i){return Math.pow(2,Math.ceil(Math.log(i)/Math.LN2))}function kb(i){return Math.pow(2,Math.floor(Math.log(i)/Math.LN2))}function Hb(i,e,t,n,r){const s=Math.cos,a=Math.sin,u=s(t/2),d=a(t/2),h=s((e+n)/2),m=a((e+n)/2),g=s((e-n)/2),v=a((e-n)/2),_=s((n-e)/2),A=a((n-e)/2);switch(r){case"XYX":i.set(u*m,d*g,d*v,u*h);break;case"YZY":i.set(d*v,u*m,d*g,u*h);break;case"ZXZ":i.set(d*g,d*v,u*m,u*h);break;case"XZX":i.set(u*m,d*A,d*_,u*h);break;case"YXY":i.set(d*_,u*m,d*A,u*h);break;case"ZYZ":i.set(d*A,d*_,u*m,u*h);break;default:console.warn("THREE.MathUtils: .setQuaternionFromProperEuler() encountered an unknown order: "+r)}}function xr(i,e){switch(e.constructor){case Float32Array:return i;case Uint32Array:return i/4294967295;case Uint16Array:return i/65535;case Uint8Array:return i/255;case Int32Array:return Math.max(i/2147483647,-1);case Int16Array:return Math.max(i/32767,-1);case Int8Array:return Math.max(i/127,-1);default:throw new Error("Invalid component type.")}}function Zt(i,e){switch(e.constructor){case Float32Array:return i;case Uint32Array:return Math.round(i*4294967295);case Uint16Array:return Math.round(i*65535);case Uint8Array:return Math.round(i*255);case Int32Array:return Math.round(i*2147483647);case Int16Array:return Math.round(i*32767);case Int8Array:return Math.round(i*127);default:throw new Error("Invalid component type.")}}const TM={DEG2RAD:Xu,RAD2DEG:Qf,generateUUID:ts,clamp:Xt,euclideanModulo:$_,mapLinear:wb,inverseLerp:Cb,lerp:Lh,damp:Tb,pingpong:bb,smoothstep:Rb,smootherstep:Ib,randInt:Pb,randFloat:Bb,randFloatSpread:Lb,seededRandom:Db,degToRad:Fb,radToDeg:Nb,isPowerOfTwo:Ub,ceilPowerOfTwo:Ob,floorPowerOfTwo:kb,setQuaternionFromProperEuler:Hb,normalize:Zt,denormalize:xr};class Le{constructor(e=0,t=0){Le.prototype.isVector2=!0,this.x=e,this.y=t}get width(){return this.x}set width(e){this.x=e}get height(){return this.y}set height(e){this.y=e}set(e,t){return this.x=e,this.y=t,this}setScalar(e){return this.x=e,this.y=e,this}setX(e){return this.x=e,this}setY(e){return this.y=e,this}setComponent(e,t){switch(e){case 0:this.x=t;break;case 1:this.y=t;break;default:throw new Error("index is out of range: "+e)}return this}getComponent(e){switch(e){case 0:return this.x;case 1:return this.y;default:throw new Error("index is out of range: "+e)}}clone(){return new this.constructor(this.x,this.y)}copy(e){return this.x=e.x,this.y=e.y,this}add(e){return this.x+=e.x,this.y+=e.y,this}addScalar(e){return this.x+=e,this.y+=e,this}addVectors(e,t){return this.x=e.x+t.x,this.y=e.y+t.y,this}addScaledVector(e,t){return this.x+=e.x*t,this.y+=e.y*t,this}sub(e){return this.x-=e.x,this.y-=e.y,this}subScalar(e){return this.x-=e,this.y-=e,this}subVectors(e,t){return this.x=e.x-t.x,this.y=e.y-t.y,this}multiply(e){return this.x*=e.x,this.y*=e.y,this}multiplyScalar(e){return this.x*=e,this.y*=e,this}divide(e){return this.x/=e.x,this.y/=e.y,this}divideScalar(e){return this.multiplyScalar(1/e)}applyMatrix3(e){const t=this.x,n=this.y,r=e.elements;return this.x=r[0]*t+r[3]*n+r[6],this.y=r[1]*t+r[4]*n+r[7],this}min(e){return this.x=Math.min(this.x,e.x),this.y=Math.min(this.y,e.y),this}max(e){return this.x=Math.max(this.x,e.x),this.y=Math.max(this.y,e.y),this}clamp(e,t){return this.x=Xt(this.x,e.x,t.x),this.y=Xt(this.y,e.y,t.y),this}clampScalar(e,t){return this.x=Xt(this.x,e,t),this.y=Xt(this.y,e,t),this}clampLength(e,t){const n=this.length();return this.divideScalar(n||1).multiplyScalar(Xt(n,e,t))}floor(){return this.x=Math.floor(this.x),this.y=Math.floor(this.y),this}ceil(){return this.x=Math.ceil(this.x),this.y=Math.ceil(this.y),this}round(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this}roundToZero(){return this.x=Math.trunc(this.x),this.y=Math.trunc(this.y),this}negate(){return this.x=-this.x,this.y=-this.y,this}dot(e){return this.x*e.x+this.y*e.y}cross(e){return this.x*e.y-this.y*e.x}lengthSq(){return this.x*this.x+this.y*this.y}length(){return Math.sqrt(this.x*this.x+this.y*this.y)}manhattanLength(){return Math.abs(this.x)+Math.abs(this.y)}normalize(){return this.divideScalar(this.length()||1)}angle(){return Math.atan2(-this.y,-this.x)+Math.PI}angleTo(e){const t=Math.sqrt(this.lengthSq()*e.lengthSq());if(t===0)return Math.PI/2;const n=this.dot(e)/t;return Math.acos(Xt(n,-1,1))}distanceTo(e){return Math.sqrt(this.distanceToSquared(e))}distanceToSquared(e){const t=this.x-e.x,n=this.y-e.y;return t*t+n*n}manhattanDistanceTo(e){return Math.abs(this.x-e.x)+Math.abs(this.y-e.y)}setLength(e){return this.normalize().multiplyScalar(e)}lerp(e,t){return this.x+=(e.x-this.x)*t,this.y+=(e.y-this.y)*t,this}lerpVectors(e,t,n){return this.x=e.x+(t.x-e.x)*n,this.y=e.y+(t.y-e.y)*n,this}equals(e){return e.x===this.x&&e.y===this.y}fromArray(e,t=0){return this.x=e[t],this.y=e[t+1],this}toArray(e=[],t=0){return e[t]=this.x,e[t+1]=this.y,e}fromBufferAttribute(e,t){return this.x=e.getX(t),this.y=e.getY(t),this}rotateAround(e,t){const n=Math.cos(t),r=Math.sin(t),s=this.x-e.x,a=this.y-e.y;return this.x=s*n-a*r+e.x,this.y=s*r+a*n+e.y,this}random(){return this.x=Math.random(),this.y=Math.random(),this}*[Symbol.iterator](){yield this.x,yield this.y}}class Jt{constructor(e,t,n,r,s,a,u,d,h){Jt.prototype.isMatrix3=!0,this.elements=[1,0,0,0,1,0,0,0,1],e!==void 0&&this.set(e,t,n,r,s,a,u,d,h)}set(e,t,n,r,s,a,u,d,h){const m=this.elements;return m[0]=e,m[1]=r,m[2]=u,m[3]=t,m[4]=s,m[5]=d,m[6]=n,m[7]=a,m[8]=h,this}identity(){return this.set(1,0,0,0,1,0,0,0,1),this}copy(e){const t=this.elements,n=e.elements;return t[0]=n[0],t[1]=n[1],t[2]=n[2],t[3]=n[3],t[4]=n[4],t[5]=n[5],t[6]=n[6],t[7]=n[7],t[8]=n[8],this}extractBasis(e,t,n){return e.setFromMatrix3Column(this,0),t.setFromMatrix3Column(this,1),n.setFromMatrix3Column(this,2),this}setFromMatrix4(e){const t=e.elements;return this.set(t[0],t[4],t[8],t[1],t[5],t[9],t[2],t[6],t[10]),this}multiply(e){return this.multiplyMatrices(this,e)}premultiply(e){return this.multiplyMatrices(e,this)}multiplyMatrices(e,t){const n=e.elements,r=t.elements,s=this.elements,a=n[0],u=n[3],d=n[6],h=n[1],m=n[4],g=n[7],v=n[2],_=n[5],A=n[8],C=r[0],M=r[3],S=r[6],b=r[1],R=r[4],P=r[7],U=r[2],F=r[5],k=r[8];return s[0]=a*C+u*b+d*U,s[3]=a*M+u*R+d*F,s[6]=a*S+u*P+d*k,s[1]=h*C+m*b+g*U,s[4]=h*M+m*R+g*F,s[7]=h*S+m*P+g*k,s[2]=v*C+_*b+A*U,s[5]=v*M+_*R+A*F,s[8]=v*S+_*P+A*k,this}multiplyScalar(e){const t=this.elements;return t[0]*=e,t[3]*=e,t[6]*=e,t[1]*=e,t[4]*=e,t[7]*=e,t[2]*=e,t[5]*=e,t[8]*=e,this}determinant(){const e=this.elements,t=e[0],n=e[1],r=e[2],s=e[3],a=e[4],u=e[5],d=e[6],h=e[7],m=e[8];return t*a*m-t*u*h-n*s*m+n*u*d+r*s*h-r*a*d}invert(){const e=this.elements,t=e[0],n=e[1],r=e[2],s=e[3],a=e[4],u=e[5],d=e[6],h=e[7],m=e[8],g=m*a-u*h,v=u*d-m*s,_=h*s-a*d,A=t*g+n*v+r*_;if(A===0)return this.set(0,0,0,0,0,0,0,0,0);const C=1/A;return e[0]=g*C,e[1]=(r*h-m*n)*C,e[2]=(u*n-r*a)*C,e[3]=v*C,e[4]=(m*t-r*d)*C,e[5]=(r*s-u*t)*C,e[6]=_*C,e[7]=(n*d-h*t)*C,e[8]=(a*t-n*s)*C,this}transpose(){let e;const t=this.elements;return e=t[1],t[1]=t[3],t[3]=e,e=t[2],t[2]=t[6],t[6]=e,e=t[5],t[5]=t[7],t[7]=e,this}getNormalMatrix(e){return this.setFromMatrix4(e).invert().transpose()}transposeIntoArray(e){const t=this.elements;return e[0]=t[0],e[1]=t[3],e[2]=t[6],e[3]=t[1],e[4]=t[4],e[5]=t[7],e[6]=t[2],e[7]=t[5],e[8]=t[8],this}setUvTransform(e,t,n,r,s,a,u){const d=Math.cos(s),h=Math.sin(s);return this.set(n*d,n*h,-n*(d*a+h*u)+a+e,-r*h,r*d,-r*(-h*a+d*u)+u+t,0,0,1),this}scale(e,t){return this.premultiply(Gv.makeScale(e,t)),this}rotate(e){return this.premultiply(Gv.makeRotation(-e)),this}translate(e,t){return this.premultiply(Gv.makeTranslation(e,t)),this}makeTranslation(e,t){return e.isVector2?this.set(1,0,e.x,0,1,e.y,0,0,1):this.set(1,0,e,0,1,t,0,0,1),this}makeRotation(e){const t=Math.cos(e),n=Math.sin(e);return this.set(t,-n,0,n,t,0,0,0,1),this}makeScale(e,t){return this.set(e,0,0,0,t,0,0,0,1),this}equals(e){const t=this.elements,n=e.elements;for(let r=0;r<9;r++)if(t[r]!==n[r])return!1;return!0}fromArray(e,t=0){for(let n=0;n<9;n++)this.elements[n]=e[n+t];return this}toArray(e=[],t=0){const n=this.elements;return e[t]=n[0],e[t+1]=n[1],e[t+2]=n[2],e[t+3]=n[3],e[t+4]=n[4],e[t+5]=n[5],e[t+6]=n[6],e[t+7]=n[7],e[t+8]=n[8],e}clone(){return new this.constructor().fromArray(this.elements)}}const Gv=new Jt;function bM(i){for(let e=i.length-1;e>=0;--e)if(i[e]>=65535)return!0;return!1}const zb={Int8Array,Uint8Array,Uint8ClampedArray,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array};function Uf(i,e){return new zb[i](e)}function Wh(i){return document.createElementNS("http://www.w3.org/1999/xhtml",i)}function RM(){const i=Wh("canvas");return i.style.display="block",i}const X1={};function Df(i){i in X1||(X1[i]=!0,console.warn(i))}function Gb(i,e,t){return new Promise(function(n,r){function s(){switch(i.clientWaitSync(e,i.SYNC_FLUSH_COMMANDS_BIT,0)){case i.WAIT_FAILED:r();break;case i.TIMEOUT_EXPIRED:setTimeout(s,t);break;default:n()}}setTimeout(s,t)})}function Vb(i){const e=i.elements;e[2]=.5*e[2]+.5*e[3],e[6]=.5*e[6]+.5*e[7],e[10]=.5*e[10]+.5*e[11],e[14]=.5*e[14]+.5*e[15]}function Wb(i){const e=i.elements;e[11]===-1?(e[10]=-e[10]-1,e[14]=-e[14]):(e[10]=-e[10],e[14]=-e[14]+1)}const j1=new Jt().set(.4123908,.3575843,.1804808,.212639,.7151687,.0721923,.0193308,.1191948,.9505322),J1=new Jt().set(3.2409699,-1.5373832,-.4986108,-.9692436,1.8759675,.0415551,.0556301,-.203977,1.0569715);function Xb(){const i={enabled:!0,workingColorSpace:qu,spaces:{},convert:function(r,s,a){return this.enabled===!1||s===a||!s||!a||(this.spaces[s].transfer===wn&&(r.r=Ea(r.r),r.g=Ea(r.g),r.b=Ea(r.b)),this.spaces[s].primaries!==this.spaces[a].primaries&&(r.applyMatrix3(this.spaces[s].toXYZ),r.applyMatrix3(this.spaces[a].fromXYZ)),this.spaces[a].transfer===wn&&(r.r=Vf(r.r),r.g=Vf(r.g),r.b=Vf(r.b))),r},fromWorkingColorSpace:function(r,s){return this.convert(r,this.workingColorSpace,s)},toWorkingColorSpace:function(r,s){return this.convert(r,s,this.workingColorSpace)},getPrimaries:function(r){return this.spaces[r].primaries},getTransfer:function(r){return r===ya?zh:this.spaces[r].transfer},getLuminanceCoefficients:function(r,s=this.workingColorSpace){return r.fromArray(this.spaces[s].luminanceCoefficients)},define:function(r){Object.assign(this.spaces,r)},_getMatrix:function(r,s,a){return r.copy(this.spaces[s].toXYZ).multiply(this.spaces[a].fromXYZ)},_getDrawingBufferColorSpace:function(r){return this.spaces[r].outputColorSpaceConfig.drawingBufferColorSpace},_getUnpackColorSpace:function(r=this.workingColorSpace){return this.spaces[r].workingColorSpaceConfig.unpackColorSpace}},e=[.64,.33,.3,.6,.15,.06],t=[.2126,.7152,.0722],n=[.3127,.329];return i.define({[qu]:{primaries:e,whitePoint:n,transfer:zh,toXYZ:j1,fromXYZ:J1,luminanceCoefficients:t,workingColorSpaceConfig:{unpackColorSpace:Nr},outputColorSpaceConfig:{drawingBufferColorSpace:Nr}},[Nr]:{primaries:e,whitePoint:n,transfer:wn,toXYZ:j1,fromXYZ:J1,luminanceCoefficients:t,outputColorSpaceConfig:{drawingBufferColorSpace:Nr}}}),i}const gn=Xb();function Ea(i){return i<.04045?i*.0773993808:Math.pow(i*.9478672986+.0521327014,2.4)}function Vf(i){return i<.0031308?i*12.92:1.055*Math.pow(i,.41666)-.055}let pf;class IM{static getDataURL(e){if(/^data:/i.test(e.src)||typeof HTMLCanvasElement>"u")return e.src;let t;if(e instanceof HTMLCanvasElement)t=e;else{pf===void 0&&(pf=Wh("canvas")),pf.width=e.width,pf.height=e.height;const n=pf.getContext("2d");e instanceof ImageData?n.putImageData(e,0,0):n.drawImage(e,0,0,e.width,e.height),t=pf}return t.toDataURL("image/png")}static sRGBToLinear(e){if(typeof HTMLImageElement<"u"&&e instanceof HTMLImageElement||typeof HTMLCanvasElement<"u"&&e instanceof HTMLCanvasElement||typeof ImageBitmap<"u"&&e instanceof ImageBitmap){const t=Wh("canvas");t.width=e.width,t.height=e.height;const n=t.getContext("2d");n.drawImage(e,0,0,e.width,e.height);const r=n.getImageData(0,0,e.width,e.height),s=r.data;for(let a=0;a<s.length;a++)s[a]=Ea(s[a]/255)*255;return n.putImageData(r,0,0),t}else if(e.data){const t=e.data.slice(0);for(let n=0;n<t.length;n++)t instanceof Uint8Array||t instanceof Uint8ClampedArray?t[n]=Math.floor(Ea(t[n]/255)*255):t[n]=Ea(t[n]);return{data:t,width:e.width,height:e.height}}else return console.warn("THREE.ImageUtils.sRGBToLinear(): Unsupported image type. No color space conversion applied."),e}}let jb=0;class ku{constructor(e=null){this.isSource=!0,Object.defineProperty(this,"id",{value:jb++}),this.uuid=ts(),this.data=e,this.dataReady=!0,this.version=0}set needsUpdate(e){e===!0&&this.version++}toJSON(e){const t=e===void 0||typeof e=="string";if(!t&&e.images[this.uuid]!==void 0)return e.images[this.uuid];const n={uuid:this.uuid,url:""},r=this.data;if(r!==null){let s;if(Array.isArray(r)){s=[];for(let a=0,u=r.length;a<u;a++)r[a].isDataTexture?s.push(Vv(r[a].image)):s.push(Vv(r[a]))}else s=Vv(r);n.url=s}return t||(e.images[this.uuid]=n),n}}function Vv(i){return typeof HTMLImageElement<"u"&&i instanceof HTMLImageElement||typeof HTMLCanvasElement<"u"&&i instanceof HTMLCanvasElement||typeof ImageBitmap<"u"&&i instanceof ImageBitmap?IM.getDataURL(i):i.data?{data:Array.from(i.data),width:i.width,height:i.height,type:i.data.constructor.name}:(console.warn("THREE.Texture: Unable to serialize Texture."),{})}let Jb=0;class zn extends Io{constructor(e=zn.DEFAULT_IMAGE,t=zn.DEFAULT_MAPPING,n=$r,r=$r,s=ri,a=As,u=rr,d=to,h=zn.DEFAULT_ANISOTROPY,m=ya){super(),this.isTexture=!0,Object.defineProperty(this,"id",{value:Jb++}),this.uuid=ts(),this.name="",this.source=new ku(e),this.mipmaps=[],this.mapping=t,this.channel=0,this.wrapS=n,this.wrapT=r,this.magFilter=s,this.minFilter=a,this.anisotropy=h,this.format=u,this.internalFormat=null,this.type=d,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 Jt,this.generateMipmaps=!0,this.premultiplyAlpha=!1,this.flipY=!0,this.unpackAlignment=4,this.colorSpace=m,this.userData={},this.version=0,this.onUpdate=null,this.renderTarget=null,this.isRenderTargetTexture=!1,this.pmremVersion=0}get image(){return this.source.data}set image(e=null){this.source.data=e}updateMatrix(){this.matrix.setUvTransform(this.offset.x,this.offset.y,this.repeat.x,this.repeat.y,this.rotation,this.center.x,this.center.y)}clone(){return new this.constructor().copy(this)}copy(e){return this.name=e.name,this.source=e.source,this.mipmaps=e.mipmaps.slice(0),this.mapping=e.mapping,this.channel=e.channel,this.wrapS=e.wrapS,this.wrapT=e.wrapT,this.magFilter=e.magFilter,this.minFilter=e.minFilter,this.anisotropy=e.anisotropy,this.format=e.format,this.internalFormat=e.internalFormat,this.type=e.type,this.offset.copy(e.offset),this.repeat.copy(e.repeat),this.center.copy(e.center),this.rotation=e.rotation,this.matrixAutoUpdate=e.matrixAutoUpdate,this.matrix.copy(e.matrix),this.generateMipmaps=e.generateMipmaps,this.premultiplyAlpha=e.premultiplyAlpha,this.flipY=e.flipY,this.unpackAlignment=e.unpackAlignment,this.colorSpace=e.colorSpace,this.renderTarget=e.renderTarget,this.isRenderTargetTexture=e.isRenderTargetTexture,this.userData=JSON.parse(JSON.stringify(e.userData)),this.needsUpdate=!0,this}toJSON(e){const t=e===void 0||typeof e=="string";if(!t&&e.textures[this.uuid]!==void 0)return e.textures[this.uuid];const n={metadata:{version:4.6,type:"Texture",generator:"Texture.toJSON"},uuid:this.uuid,name:this.name,image:this.source.toJSON(e).uuid,mapping:this.mapping,channel:this.channel,repeat:[this.repeat.x,this.repeat.y],offset:[this.offset.x,this.offset.y],center:[this.center.x,this.center.y],rotation:this.rotation,wrap:[this.wrapS,this.wrapT],format:this.format,internalFormat:this.internalFormat,type:this.type,colorSpace:this.colorSpace,minFilter:this.minFilter,magFilter:this.magFilter,anisotropy:this.anisotropy,flipY:this.flipY,generateMipmaps:this.generateMipmaps,premultiplyAlpha:this.premultiplyAlpha,unpackAlignment:this.unpackAlignment};return Object.keys(this.userData).length>0&&(n.userData=this.userData),t||(e.textures[this.uuid]=n),n}dispose(){this.dispatchEvent({type:"dispose"})}transformUv(e){if(this.mapping!==E0)return e;if(e.applyMatrix3(this.matrix),e.x<0||e.x>1)switch(this.wrapS){case Cl:e.x=e.x-Math.floor(e.x);break;case $r:e.x=e.x<0?0:1;break;case jf:Math.abs(Math.floor(e.x)%2)===1?e.x=Math.ceil(e.x)-e.x:e.x=e.x-Math.floor(e.x);break}if(e.y<0||e.y>1)switch(this.wrapT){case Cl:e.y=e.y-Math.floor(e.y);break;case $r:e.y=e.y<0?0:1;break;case jf:Math.abs(Math.floor(e.y)%2)===1?e.y=Math.ceil(e.y)-e.y:e.y=e.y-Math.floor(e.y);break}return this.flipY&&(e.y=1-e.y),e}set needsUpdate(e){e===!0&&(this.version++,this.source.needsUpdate=!0)}set needsPMREMUpdate(e){e===!0&&this.pmremVersion++}}zn.DEFAULT_IMAGE=null;zn.DEFAULT_MAPPING=E0;zn.DEFAULT_ANISOTROPY=1;class _n{constructor(e=0,t=0,n=0,r=1){_n.prototype.isVector4=!0,this.x=e,this.y=t,this.z=n,this.w=r}get width(){return this.z}set width(e){this.z=e}get height(){return this.w}set height(e){this.w=e}set(e,t,n,r){return this.x=e,this.y=t,this.z=n,this.w=r,this}setScalar(e){return this.x=e,this.y=e,this.z=e,this.w=e,this}setX(e){return this.x=e,this}setY(e){return this.y=e,this}setZ(e){return this.z=e,this}setW(e){return this.w=e,this}setComponent(e,t){switch(e){case 0:this.x=t;break;case 1:this.y=t;break;case 2:this.z=t;break;case 3:this.w=t;break;default:throw new Error("index is out of range: "+e)}return this}getComponent(e){switch(e){case 0:return this.x;case 1:return this.y;case 2:return this.z;case 3:return this.w;default:throw new Error("index is out of range: "+e)}}clone(){return new this.constructor(this.x,this.y,this.z,this.w)}copy(e){return this.x=e.x,this.y=e.y,this.z=e.z,this.w=e.w!==void 0?e.w:1,this}add(e){return this.x+=e.x,this.y+=e.y,this.z+=e.z,this.w+=e.w,this}addScalar(e){return this.x+=e,this.y+=e,this.z+=e,this.w+=e,this}addVectors(e,t){return this.x=e.x+t.x,this.y=e.y+t.y,this.z=e.z+t.z,this.w=e.w+t.w,this}addScaledVector(e,t){return this.x+=e.x*t,this.y+=e.y*t,this.z+=e.z*t,this.w+=e.w*t,this}sub(e){return this.x-=e.x,this.y-=e.y,this.z-=e.z,this.w-=e.w,this}subScalar(e){return this.x-=e,this.y-=e,this.z-=e,this.w-=e,this}subVectors(e,t){return this.x=e.x-t.x,this.y=e.y-t.y,this.z=e.z-t.z,this.w=e.w-t.w,this}multiply(e){return this.x*=e.x,this.y*=e.y,this.z*=e.z,this.w*=e.w,this}multiplyScalar(e){return this.x*=e,this.y*=e,this.z*=e,this.w*=e,this}applyMatrix4(e){const t=this.x,n=this.y,r=this.z,s=this.w,a=e.elements;return this.x=a[0]*t+a[4]*n+a[8]*r+a[12]*s,this.y=a[1]*t+a[5]*n+a[9]*r+a[13]*s,this.z=a[2]*t+a[6]*n+a[10]*r+a[14]*s,this.w=a[3]*t+a[7]*n+a[11]*r+a[15]*s,this}divide(e){return this.x/=e.x,this.y/=e.y,this.z/=e.z,this.w/=e.w,this}divideScalar(e){return this.multiplyScalar(1/e)}setAxisAngleFromQuaternion(e){this.w=2*Math.acos(e.w);const t=Math.sqrt(1-e.w*e.w);return t<1e-4?(this.x=1,this.y=0,this.z=0):(this.x=e.x/t,this.y=e.y/t,this.z=e.z/t),this}setAxisAngleFromRotationMatrix(e){let t,n,r,s;const d=e.elements,h=d[0],m=d[4],g=d[8],v=d[1],_=d[5],A=d[9],C=d[2],M=d[6],S=d[10];if(Math.abs(m-v)<.01&&Math.abs(g-C)<.01&&Math.abs(A-M)<.01){if(Math.abs(m+v)<.1&&Math.abs(g+C)<.1&&Math.abs(A+M)<.1&&Math.abs(h+_+S-3)<.1)return this.set(1,0,0,0),this;t=Math.PI;const R=(h+1)/2,P=(_+1)/2,U=(S+1)/2,F=(m+v)/4,k=(g+C)/4,G=(A+M)/4;return R>P&&R>U?R<.01?(n=0,r=.707106781,s=.707106781):(n=Math.sqrt(R),r=F/n,s=k/n):P>U?P<.01?(n=.707106781,r=0,s=.707106781):(r=Math.sqrt(P),n=F/r,s=G/r):U<.01?(n=.707106781,r=.707106781,s=0):(s=Math.sqrt(U),n=k/s,r=G/s),this.set(n,r,s,t),this}let b=Math.sqrt((M-A)*(M-A)+(g-C)*(g-C)+(v-m)*(v-m));return Math.abs(b)<.001&&(b=1),this.x=(M-A)/b,this.y=(g-C)/b,this.z=(v-m)/b,this.w=Math.acos((h+_+S-1)/2),this}setFromMatrixPosition(e){const t=e.elements;return this.x=t[12],this.y=t[13],this.z=t[14],this.w=t[15],this}min(e){return this.x=Math.min(this.x,e.x),this.y=Math.min(this.y,e.y),this.z=Math.min(this.z,e.z),this.w=Math.min(this.w,e.w),this}max(e){return this.x=Math.max(this.x,e.x),this.y=Math.max(this.y,e.y),this.z=Math.max(this.z,e.z),this.w=Math.max(this.w,e.w),this}clamp(e,t){return this.x=Xt(this.x,e.x,t.x),this.y=Xt(this.y,e.y,t.y),this.z=Xt(this.z,e.z,t.z),this.w=Xt(this.w,e.w,t.w),this}clampScalar(e,t){return this.x=Xt(this.x,e,t),this.y=Xt(this.y,e,t),this.z=Xt(this.z,e,t),this.w=Xt(this.w,e,t),this}clampLength(e,t){const n=this.length();return this.divideScalar(n||1).multiplyScalar(Xt(n,e,t))}floor(){return this.x=Math.floor(this.x),this.y=Math.floor(this.y),this.z=Math.floor(this.z),this.w=Math.floor(this.w),this}ceil(){return this.x=Math.ceil(this.x),this.y=Math.ceil(this.y),this.z=Math.ceil(this.z),this.w=Math.ceil(this.w),this}round(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this.z=Math.round(this.z),this.w=Math.round(this.w),this}roundToZero(){return this.x=Math.trunc(this.x),this.y=Math.trunc(this.y),this.z=Math.trunc(this.z),this.w=Math.trunc(this.w),this}negate(){return this.x=-this.x,this.y=-this.y,this.z=-this.z,this.w=-this.w,this}dot(e){return this.x*e.x+this.y*e.y+this.z*e.z+this.w*e.w}lengthSq(){return this.x*this.x+this.y*this.y+this.z*this.z+this.w*this.w}length(){return Math.sqrt(this.x*this.x+this.y*this.y+this.z*this.z+this.w*this.w)}manhattanLength(){return Math.abs(this.x)+Math.abs(this.y)+Math.abs(this.z)+Math.abs(this.w)}normalize(){return this.divideScalar(this.length()||1)}setLength(e){return this.normalize().multiplyScalar(e)}lerp(e,t){return this.x+=(e.x-this.x)*t,this.y+=(e.y-this.y)*t,this.z+=(e.z-this.z)*t,this.w+=(e.w-this.w)*t,this}lerpVectors(e,t,n){return this.x=e.x+(t.x-e.x)*n,this.y=e.y+(t.y-e.y)*n,this.z=e.z+(t.z-e.z)*n,this.w=e.w+(t.w-e.w)*n,this}equals(e){return e.x===this.x&&e.y===this.y&&e.z===this.z&&e.w===this.w}fromArray(e,t=0){return this.x=e[t],this.y=e[t+1],this.z=e[t+2],this.w=e[t+3],this}toArray(e=[],t=0){return e[t]=this.x,e[t+1]=this.y,e[t+2]=this.z,e[t+3]=this.w,e}fromBufferAttribute(e,t){return this.x=e.getX(t),this.y=e.getY(t),this.z=e.getZ(t),this.w=e.getW(t),this}random(){return this.x=Math.random(),this.y=Math.random(),this.z=Math.random(),this.w=Math.random(),this}*[Symbol.iterator](){yield this.x,yield this.y,yield this.z,yield this.w}}class L0 extends Io{constructor(e=1,t=1,n={}){super(),this.isRenderTarget=!0,this.width=e,this.height=t,this.depth=1,this.scissor=new _n(0,0,e,t),this.scissorTest=!1,this.viewport=new _n(0,0,e,t);const r={width:e,height:t,depth:1};n=Object.assign({generateMipmaps:!1,internalFormat:null,minFilter:ri,depthBuffer:!0,stencilBuffer:!1,resolveDepthBuffer:!0,resolveStencilBuffer:!0,depthTexture:null,samples:0,count:1},n);const s=new zn(r,n.mapping,n.wrapS,n.wrapT,n.magFilter,n.minFilter,n.format,n.type,n.anisotropy,n.colorSpace);s.flipY=!1,s.generateMipmaps=n.generateMipmaps,s.internalFormat=n.internalFormat,this.textures=[];const a=n.count;for(let u=0;u<a;u++)this.textures[u]=s.clone(),this.textures[u].isRenderTargetTexture=!0,this.textures[u].renderTarget=this;this.depthBuffer=n.depthBuffer,this.stencilBuffer=n.stencilBuffer,this.resolveDepthBuffer=n.resolveDepthBuffer,this.resolveStencilBuffer=n.resolveStencilBuffer,this._depthTexture=null,this.depthTexture=n.depthTexture,this.samples=n.samples}get texture(){return this.textures[0]}set texture(e){this.textures[0]=e}set depthTexture(e){this._depthTexture!==null&&(this._depthTexture.renderTarget=null),e!==null&&(e.renderTarget=this),this._depthTexture=e}get depthTexture(){return this._depthTexture}setSize(e,t,n=1){if(this.width!==e||this.height!==t||this.depth!==n){this.width=e,this.height=t,this.depth=n;for(let r=0,s=this.textures.length;r<s;r++)this.textures[r].image.width=e,this.textures[r].image.height=t,this.textures[r].image.depth=n;this.dispose()}this.viewport.set(0,0,e,t),this.scissor.set(0,0,e,t)}clone(){return new this.constructor().copy(this)}copy(e){this.width=e.width,this.height=e.height,this.depth=e.depth,this.scissor.copy(e.scissor),this.scissorTest=e.scissorTest,this.viewport.copy(e.viewport),this.textures.length=0;for(let n=0,r=e.textures.length;n<r;n++)this.textures[n]=e.textures[n].clone(),this.textures[n].isRenderTargetTexture=!0,this.textures[n].renderTarget=this;const t=Object.assign({},e.texture.image);return this.texture.source=new ku(t),this.depthBuffer=e.depthBuffer,this.stencilBuffer=e.stencilBuffer,this.resolveDepthBuffer=e.resolveDepthBuffer,this.resolveStencilBuffer=e.resolveStencilBuffer,e.depthTexture!==null&&(this.depthTexture=e.depthTexture.clone()),this.samples=e.samples,this}dispose(){this.dispatchEvent({type:"dispose"})}}class bo extends L0{constructor(e=1,t=1,n={}){super(e,t,n),this.isWebGLRenderTarget=!0}}class op extends zn{constructor(e=null,t=1,n=1,r=1){super(null),this.isDataArrayTexture=!0,this.image={data:e,width:t,height:n,depth:r},this.magFilter=Di,this.minFilter=Di,this.wrapR=$r,this.generateMipmaps=!1,this.flipY=!1,this.unpackAlignment=1,this.layerUpdates=new Set}addLayerUpdate(e){this.layerUpdates.add(e)}clearLayerUpdates(){this.layerUpdates.clear()}}class Kb extends bo{constructor(e=1,t=1,n=1,r={}){super(e,t,r),this.isWebGLArrayRenderTarget=!0,this.depth=n,this.texture=new op(null,e,t,n),this.texture.isRenderTargetTexture=!0}}class D0 extends zn{constructor(e=null,t=1,n=1,r=1){super(null),this.isData3DTexture=!0,this.image={data:e,width:t,height:n,depth:r},this.magFilter=Di,this.minFilter=Di,this.wrapR=$r,this.generateMipmaps=!1,this.flipY=!1,this.unpackAlignment=1}}class Yb extends bo{constructor(e=1,t=1,n=1,r={}){super(e,t,r),this.isWebGL3DRenderTarget=!0,this.depth=n,this.texture=new D0(null,e,t,n),this.texture.isRenderTargetTexture=!0}}class Fi{constructor(e=0,t=0,n=0,r=1){this.isQuaternion=!0,this._x=e,this._y=t,this._z=n,this._w=r}static slerpFlat(e,t,n,r,s,a,u){let d=n[r+0],h=n[r+1],m=n[r+2],g=n[r+3];const v=s[a+0],_=s[a+1],A=s[a+2],C=s[a+3];if(u===0){e[t+0]=d,e[t+1]=h,e[t+2]=m,e[t+3]=g;return}if(u===1){e[t+0]=v,e[t+1]=_,e[t+2]=A,e[t+3]=C;return}if(g!==C||d!==v||h!==_||m!==A){let M=1-u;const S=d*v+h*_+m*A+g*C,b=S>=0?1:-1,R=1-S*S;if(R>Number.EPSILON){const U=Math.sqrt(R),F=Math.atan2(U,S*b);M=Math.sin(M*F)/U,u=Math.sin(u*F)/U}const P=u*b;if(d=d*M+v*P,h=h*M+_*P,m=m*M+A*P,g=g*M+C*P,M===1-u){const U=1/Math.sqrt(d*d+h*h+m*m+g*g);d*=U,h*=U,m*=U,g*=U}}e[t]=d,e[t+1]=h,e[t+2]=m,e[t+3]=g}static multiplyQuaternionsFlat(e,t,n,r,s,a){const u=n[r],d=n[r+1],h=n[r+2],m=n[r+3],g=s[a],v=s[a+1],_=s[a+2],A=s[a+3];return e[t]=u*A+m*g+d*_-h*v,e[t+1]=d*A+m*v+h*g-u*_,e[t+2]=h*A+m*_+u*v-d*g,e[t+3]=m*A-u*g-d*v-h*_,e}get x(){return this._x}set x(e){this._x=e,this._onChangeCallback()}get y(){return this._y}set y(e){this._y=e,this._onChangeCallback()}get z(){return this._z}set z(e){this._z=e,this._onChangeCallback()}get w(){return this._w}set w(e){this._w=e,this._onChangeCallback()}set(e,t,n,r){return this._x=e,this._y=t,this._z=n,this._w=r,this._onChangeCallback(),this}clone(){return new this.constructor(this._x,this._y,this._z,this._w)}copy(e){return this._x=e.x,this._y=e.y,this._z=e.z,this._w=e.w,this._onChangeCallback(),this}setFromEuler(e,t=!0){const n=e._x,r=e._y,s=e._z,a=e._order,u=Math.cos,d=Math.sin,h=u(n/2),m=u(r/2),g=u(s/2),v=d(n/2),_=d(r/2),A=d(s/2);switch(a){case"XYZ":this._x=v*m*g+h*_*A,this._y=h*_*g-v*m*A,this._z=h*m*A+v*_*g,this._w=h*m*g-v*_*A;break;case"YXZ":this._x=v*m*g+h*_*A,this._y=h*_*g-v*m*A,this._z=h*m*A-v*_*g,this._w=h*m*g+v*_*A;break;case"ZXY":this._x=v*m*g-h*_*A,this._y=h*_*g+v*m*A,this._z=h*m*A+v*_*g,this._w=h*m*g-v*_*A;break;case"ZYX":this._x=v*m*g-h*_*A,this._y=h*_*g+v*m*A,this._z=h*m*A-v*_*g,this._w=h*m*g+v*_*A;break;case"YZX":this._x=v*m*g+h*_*A,this._y=h*_*g+v*m*A,this._z=h*m*A-v*_*g,this._w=h*m*g-v*_*A;break;case"XZY":this._x=v*m*g-h*_*A,this._y=h*_*g-v*m*A,this._z=h*m*A+v*_*g,this._w=h*m*g+v*_*A;break;default:console.warn("THREE.Quaternion: .setFromEuler() encountered an unknown order: "+a)}return t===!0&&this._onChangeCallback(),this}setFromAxisAngle(e,t){const n=t/2,r=Math.sin(n);return this._x=e.x*r,this._y=e.y*r,this._z=e.z*r,this._w=Math.cos(n),this._onChangeCallback(),this}setFromRotationMatrix(e){const t=e.elements,n=t[0],r=t[4],s=t[8],a=t[1],u=t[5],d=t[9],h=t[2],m=t[6],g=t[10],v=n+u+g;if(v>0){const _=.5/Math.sqrt(v+1);this._w=.25/_,this._x=(m-d)*_,this._y=(s-h)*_,this._z=(a-r)*_}else if(n>u&&n>g){const _=2*Math.sqrt(1+n-u-g);this._w=(m-d)/_,this._x=.25*_,this._y=(r+a)/_,this._z=(s+h)/_}else if(u>g){const _=2*Math.sqrt(1+u-n-g);this._w=(s-h)/_,this._x=(r+a)/_,this._y=.25*_,this._z=(d+m)/_}else{const _=2*Math.sqrt(1+g-n-u);this._w=(a-r)/_,this._x=(s+h)/_,this._y=(d+m)/_,this._z=.25*_}return this._onChangeCallback(),this}setFromUnitVectors(e,t){let n=e.dot(t)+1;return n<Number.EPSILON?(n=0,Math.abs(e.x)>Math.abs(e.z)?(this._x=-e.y,this._y=e.x,this._z=0,this._w=n):(this._x=0,this._y=-e.z,this._z=e.y,this._w=n)):(this._x=e.y*t.z-e.z*t.y,this._y=e.z*t.x-e.x*t.z,this._z=e.x*t.y-e.y*t.x,this._w=n),this.normalize()}angleTo(e){return 2*Math.acos(Math.abs(Xt(this.dot(e),-1,1)))}rotateTowards(e,t){const n=this.angleTo(e);if(n===0)return this;const r=Math.min(1,t/n);return this.slerp(e,r),this}identity(){return this.set(0,0,0,1)}invert(){return this.conjugate()}conjugate(){return this._x*=-1,this._y*=-1,this._z*=-1,this._onChangeCallback(),this}dot(e){return this._x*e._x+this._y*e._y+this._z*e._z+this._w*e._w}lengthSq(){return this._x*this._x+this._y*this._y+this._z*this._z+this._w*this._w}length(){return Math.sqrt(this._x*this._x+this._y*this._y+this._z*this._z+this._w*this._w)}normalize(){let e=this.length();return e===0?(this._x=0,this._y=0,this._z=0,this._w=1):(e=1/e,this._x=this._x*e,this._y=this._y*e,this._z=this._z*e,this._w=this._w*e),this._onChangeCallback(),this}multiply(e){return this.multiplyQuaternions(this,e)}premultiply(e){return this.multiplyQuaternions(e,this)}multiplyQuaternions(e,t){const n=e._x,r=e._y,s=e._z,a=e._w,u=t._x,d=t._y,h=t._z,m=t._w;return this._x=n*m+a*u+r*h-s*d,this._y=r*m+a*d+s*u-n*h,this._z=s*m+a*h+n*d-r*u,this._w=a*m-n*u-r*d-s*h,this._onChangeCallback(),this}slerp(e,t){if(t===0)return this;if(t===1)return this.copy(e);const n=this._x,r=this._y,s=this._z,a=this._w;let u=a*e._w+n*e._x+r*e._y+s*e._z;if(u<0?(this._w=-e._w,this._x=-e._x,this._y=-e._y,this._z=-e._z,u=-u):this.copy(e),u>=1)return this._w=a,this._x=n,this._y=r,this._z=s,this;const d=1-u*u;if(d<=Number.EPSILON){const _=1-t;return this._w=_*a+t*this._w,this._x=_*n+t*this._x,this._y=_*r+t*this._y,this._z=_*s+t*this._z,this.normalize(),this}const h=Math.sqrt(d),m=Math.atan2(h,u),g=Math.sin((1-t)*m)/h,v=Math.sin(t*m)/h;return this._w=a*g+this._w*v,this._x=n*g+this._x*v,this._y=r*g+this._y*v,this._z=s*g+this._z*v,this._onChangeCallback(),this}slerpQuaternions(e,t,n){return this.copy(e).slerp(t,n)}random(){const e=2*Math.PI*Math.random(),t=2*Math.PI*Math.random(),n=Math.random(),r=Math.sqrt(1-n),s=Math.sqrt(n);return this.set(r*Math.sin(e),r*Math.cos(e),s*Math.sin(t),s*Math.cos(t))}equals(e){return e._x===this._x&&e._y===this._y&&e._z===this._z&&e._w===this._w}fromArray(e,t=0){return this._x=e[t],this._y=e[t+1],this._z=e[t+2],this._w=e[t+3],this._onChangeCallback(),this}toArray(e=[],t=0){return e[t]=this._x,e[t+1]=this._y,e[t+2]=this._z,e[t+3]=this._w,e}fromBufferAttribute(e,t){return this._x=e.getX(t),this._y=e.getY(t),this._z=e.getZ(t),this._w=e.getW(t),this._onChangeCallback(),this}toJSON(){return this.toArray()}_onChange(e){return this._onChangeCallback=e,this}_onChangeCallback(){}*[Symbol.iterator](){yield this._x,yield this._y,yield this._z,yield this._w}}class X{constructor(e=0,t=0,n=0){X.prototype.isVector3=!0,this.x=e,this.y=t,this.z=n}set(e,t,n){return n===void 0&&(n=this.z),this.x=e,this.y=t,this.z=n,this}setScalar(e){return this.x=e,this.y=e,this.z=e,this}setX(e){return this.x=e,this}setY(e){return this.y=e,this}setZ(e){return this.z=e,this}setComponent(e,t){switch(e){case 0:this.x=t;break;case 1:this.y=t;break;case 2:this.z=t;break;default:throw new Error("index is out of range: "+e)}return this}getComponent(e){switch(e){case 0:return this.x;case 1:return this.y;case 2:return this.z;default:throw new Error("index is out of range: "+e)}}clone(){return new this.constructor(this.x,this.y,this.z)}copy(e){return this.x=e.x,this.y=e.y,this.z=e.z,this}add(e){return this.x+=e.x,this.y+=e.y,this.z+=e.z,this}addScalar(e){return this.x+=e,this.y+=e,this.z+=e,this}addVectors(e,t){return this.x=e.x+t.x,this.y=e.y+t.y,this.z=e.z+t.z,this}addScaledVector(e,t){return this.x+=e.x*t,this.y+=e.y*t,this.z+=e.z*t,this}sub(e){return this.x-=e.x,this.y-=e.y,this.z-=e.z,this}subScalar(e){return this.x-=e,this.y-=e,this.z-=e,this}subVectors(e,t){return this.x=e.x-t.x,this.y=e.y-t.y,this.z=e.z-t.z,this}multiply(e){return this.x*=e.x,this.y*=e.y,this.z*=e.z,this}multiplyScalar(e){return this.x*=e,this.y*=e,this.z*=e,this}multiplyVectors(e,t){return this.x=e.x*t.x,this.y=e.y*t.y,this.z=e.z*t.z,this}applyEuler(e){return this.applyQuaternion(K1.setFromEuler(e))}applyAxisAngle(e,t){return this.applyQuaternion(K1.setFromAxisAngle(e,t))}applyMatrix3(e){const t=this.x,n=this.y,r=this.z,s=e.elements;return this.x=s[0]*t+s[3]*n+s[6]*r,this.y=s[1]*t+s[4]*n+s[7]*r,this.z=s[2]*t+s[5]*n+s[8]*r,this}applyNormalMatrix(e){return this.applyMatrix3(e).normalize()}applyMatrix4(e){const t=this.x,n=this.y,r=this.z,s=e.elements,a=1/(s[3]*t+s[7]*n+s[11]*r+s[15]);return this.x=(s[0]*t+s[4]*n+s[8]*r+s[12])*a,this.y=(s[1]*t+s[5]*n+s[9]*r+s[13])*a,this.z=(s[2]*t+s[6]*n+s[10]*r+s[14])*a,this}applyQuaternion(e){const t=this.x,n=this.y,r=this.z,s=e.x,a=e.y,u=e.z,d=e.w,h=2*(a*r-u*n),m=2*(u*t-s*r),g=2*(s*n-a*t);return this.x=t+d*h+a*g-u*m,this.y=n+d*m+u*h-s*g,this.z=r+d*g+s*m-a*h,this}project(e){return this.applyMatrix4(e.matrixWorldInverse).applyMatrix4(e.projectionMatrix)}unproject(e){return this.applyMatrix4(e.projectionMatrixInverse).applyMatrix4(e.matrixWorld)}transformDirection(e){const t=this.x,n=this.y,r=this.z,s=e.elements;return this.x=s[0]*t+s[4]*n+s[8]*r,this.y=s[1]*t+s[5]*n+s[9]*r,this.z=s[2]*t+s[6]*n+s[10]*r,this.normalize()}divide(e){return this.x/=e.x,this.y/=e.y,this.z/=e.z,this}divideScalar(e){return this.multiplyScalar(1/e)}min(e){return this.x=Math.min(this.x,e.x),this.y=Math.min(this.y,e.y),this.z=Math.min(this.z,e.z),this}max(e){return this.x=Math.max(this.x,e.x),this.y=Math.max(this.y,e.y),this.z=Math.max(this.z,e.z),this}clamp(e,t){return this.x=Xt(this.x,e.x,t.x),this.y=Xt(this.y,e.y,t.y),this.z=Xt(this.z,e.z,t.z),this}clampScalar(e,t){return this.x=Xt(this.x,e,t),this.y=Xt(this.y,e,t),this.z=Xt(this.z,e,t),this}clampLength(e,t){const n=this.length();return this.divideScalar(n||1).multiplyScalar(Xt(n,e,t))}floor(){return this.x=Math.floor(this.x),this.y=Math.floor(this.y),this.z=Math.floor(this.z),this}ceil(){return this.x=Math.ceil(this.x),this.y=Math.ceil(this.y),this.z=Math.ceil(this.z),this}round(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this.z=Math.round(this.z),this}roundToZero(){return this.x=Math.trunc(this.x),this.y=Math.trunc(this.y),this.z=Math.trunc(this.z),this}negate(){return this.x=-this.x,this.y=-this.y,this.z=-this.z,this}dot(e){return this.x*e.x+this.y*e.y+this.z*e.z}lengthSq(){return this.x*this.x+this.y*this.y+this.z*this.z}length(){return Math.sqrt(this.x*this.x+this.y*this.y+this.z*this.z)}manhattanLength(){return Math.abs(this.x)+Math.abs(this.y)+Math.abs(this.z)}normalize(){return this.divideScalar(this.length()||1)}setLength(e){return this.normalize().multiplyScalar(e)}lerp(e,t){return this.x+=(e.x-this.x)*t,this.y+=(e.y-this.y)*t,this.z+=(e.z-this.z)*t,this}lerpVectors(e,t,n){return this.x=e.x+(t.x-e.x)*n,this.y=e.y+(t.y-e.y)*n,this.z=e.z+(t.z-e.z)*n,this}cross(e){return this.crossVectors(this,e)}crossVectors(e,t){const n=e.x,r=e.y,s=e.z,a=t.x,u=t.y,d=t.z;return this.x=r*d-s*u,this.y=s*a-n*d,this.z=n*u-r*a,this}projectOnVector(e){const t=e.lengthSq();if(t===0)return this.set(0,0,0);const n=e.dot(this)/t;return this.copy(e).multiplyScalar(n)}projectOnPlane(e){return Wv.copy(this).projectOnVector(e),this.sub(Wv)}reflect(e){return this.sub(Wv.copy(e).multiplyScalar(2*this.dot(e)))}angleTo(e){const t=Math.sqrt(this.lengthSq()*e.lengthSq());if(t===0)return Math.PI/2;const n=this.dot(e)/t;return Math.acos(Xt(n,-1,1))}distanceTo(e){return Math.sqrt(this.distanceToSquared(e))}distanceToSquared(e){const t=this.x-e.x,n=this.y-e.y,r=this.z-e.z;return t*t+n*n+r*r}manhattanDistanceTo(e){return Math.abs(this.x-e.x)+Math.abs(this.y-e.y)+Math.abs(this.z-e.z)}setFromSpherical(e){return this.setFromSphericalCoords(e.radius,e.phi,e.theta)}setFromSphericalCoords(e,t,n){const r=Math.sin(t)*e;return this.x=r*Math.sin(n),this.y=Math.cos(t)*e,this.z=r*Math.cos(n),this}setFromCylindrical(e){return this.setFromCylindricalCoords(e.radius,e.theta,e.y)}setFromCylindricalCoords(e,t,n){return this.x=e*Math.sin(t),this.y=n,this.z=e*Math.cos(t),this}setFromMatrixPosition(e){const t=e.elements;return this.x=t[12],this.y=t[13],this.z=t[14],this}setFromMatrixScale(e){const t=this.setFromMatrixColumn(e,0).length(),n=this.setFromMatrixColumn(e,1).length(),r=this.setFromMatrixColumn(e,2).length();return this.x=t,this.y=n,this.z=r,this}setFromMatrixColumn(e,t){return this.fromArray(e.elements,t*4)}setFromMatrix3Column(e,t){return this.fromArray(e.elements,t*3)}setFromEuler(e){return this.x=e._x,this.y=e._y,this.z=e._z,this}setFromColor(e){return this.x=e.r,this.y=e.g,this.z=e.b,this}equals(e){return e.x===this.x&&e.y===this.y&&e.z===this.z}fromArray(e,t=0){return this.x=e[t],this.y=e[t+1],this.z=e[t+2],this}toArray(e=[],t=0){return e[t]=this.x,e[t+1]=this.y,e[t+2]=this.z,e}fromBufferAttribute(e,t){return this.x=e.getX(t),this.y=e.getY(t),this.z=e.getZ(t),this}random(){return this.x=Math.random(),this.y=Math.random(),this.z=Math.random(),this}randomDirection(){const e=Math.random()*Math.PI*2,t=Math.random()*2-1,n=Math.sqrt(1-t*t);return this.x=n*Math.cos(e),this.y=t,this.z=n*Math.sin(e),this}*[Symbol.iterator](){yield this.x,yield this.y,yield this.z}}const Wv=new X,K1=new Fi;class sr{constructor(e=new X(1/0,1/0,1/0),t=new X(-1/0,-1/0,-1/0)){this.isBox3=!0,this.min=e,this.max=t}set(e,t){return this.min.copy(e),this.max.copy(t),this}setFromArray(e){this.makeEmpty();for(let t=0,n=e.length;t<n;t+=3)this.expandByPoint(Js.fromArray(e,t));return this}setFromBufferAttribute(e){this.makeEmpty();for(let t=0,n=e.count;t<n;t++)this.expandByPoint(Js.fromBufferAttribute(e,t));return this}setFromPoints(e){this.makeEmpty();for(let t=0,n=e.length;t<n;t++)this.expandByPoint(e[t]);return this}setFromCenterAndSize(e,t){const n=Js.copy(t).multiplyScalar(.5);return this.min.copy(e).sub(n),this.max.copy(e).add(n),this}setFromObject(e,t=!1){return this.makeEmpty(),this.expandByObject(e,t)}clone(){return new this.constructor().copy(this)}copy(e){return this.min.copy(e.min),this.max.copy(e.max),this}makeEmpty(){return this.min.x=this.min.y=this.min.z=1/0,this.max.x=this.max.y=this.max.z=-1/0,this}isEmpty(){return this.max.x<this.min.x||this.max.y<this.min.y||this.max.z<this.min.z}getCenter(e){return this.isEmpty()?e.set(0,0,0):e.addVectors(this.min,this.max).multiplyScalar(.5)}getSize(e){return this.isEmpty()?e.set(0,0,0):e.subVectors(this.max,this.min)}expandByPoint(e){return this.min.min(e),this.max.max(e),this}expandByVector(e){return this.min.sub(e),this.max.add(e),this}expandByScalar(e){return this.min.addScalar(-e),this.max.addScalar(e),this}expandByObject(e,t=!1){e.updateWorldMatrix(!1,!1);const n=e.geometry;if(n!==void 0){const s=n.getAttribute("position");if(t===!0&&s!==void 0&&e.isInstancedMesh!==!0)for(let a=0,u=s.count;a<u;a++)e.isMesh===!0?e.getVertexPosition(a,Js):Js.fromBufferAttribute(s,a),Js.applyMatrix4(e.matrixWorld),this.expandByPoint(Js);else e.boundingBox!==void 0?(e.boundingBox===null&&e.computeBoundingBox(),vm.copy(e.boundingBox)):(n.boundingBox===null&&n.computeBoundingBox(),vm.copy(n.boundingBox)),vm.applyMatrix4(e.matrixWorld),this.union(vm)}const r=e.children;for(let s=0,a=r.length;s<a;s++)this.expandByObject(r[s],t);return this}containsPoint(e){return e.x>=this.min.x&&e.x<=this.max.x&&e.y>=this.min.y&&e.y<=this.max.y&&e.z>=this.min.z&&e.z<=this.max.z}containsBox(e){return this.min.x<=e.min.x&&e.max.x<=this.max.x&&this.min.y<=e.min.y&&e.max.y<=this.max.y&&this.min.z<=e.min.z&&e.max.z<=this.max.z}getParameter(e,t){return t.set((e.x-this.min.x)/(this.max.x-this.min.x),(e.y-this.min.y)/(this.max.y-this.min.y),(e.z-this.min.z)/(this.max.z-this.min.z))}intersectsBox(e){return e.max.x>=this.min.x&&e.min.x<=this.max.x&&e.max.y>=this.min.y&&e.min.y<=this.max.y&&e.max.z>=this.min.z&&e.min.z<=this.max.z}intersectsSphere(e){return this.clampPoint(e.center,Js),Js.distanceToSquared(e.center)<=e.radius*e.radius}intersectsPlane(e){let t,n;return e.normal.x>0?(t=e.normal.x*this.min.x,n=e.normal.x*this.max.x):(t=e.normal.x*this.max.x,n=e.normal.x*this.min.x),e.normal.y>0?(t+=e.normal.y*this.min.y,n+=e.normal.y*this.max.y):(t+=e.normal.y*this.max.y,n+=e.normal.y*this.min.y),e.normal.z>0?(t+=e.normal.z*this.min.z,n+=e.normal.z*this.max.z):(t+=e.normal.z*this.max.z,n+=e.normal.z*this.min.z),t<=-e.constant&&n>=-e.constant}intersectsTriangle(e){if(this.isEmpty())return!1;this.getCenter(ah),ym.subVectors(this.max,ah),mf.subVectors(e.a,ah),gf.subVectors(e.b,ah),vf.subVectors(e.c,ah),cl.subVectors(gf,mf),fl.subVectors(vf,gf),gu.subVectors(mf,vf);let t=[0,-cl.z,cl.y,0,-fl.z,fl.y,0,-gu.z,gu.y,cl.z,0,-cl.x,fl.z,0,-fl.x,gu.z,0,-gu.x,-cl.y,cl.x,0,-fl.y,fl.x,0,-gu.y,gu.x,0];return!Xv(t,mf,gf,vf,ym)||(t=[1,0,0,0,1,0,0,0,1],!Xv(t,mf,gf,vf,ym))?!1:(_m.crossVectors(cl,fl),t=[_m.x,_m.y,_m.z],Xv(t,mf,gf,vf,ym))}clampPoint(e,t){return t.copy(e).clamp(this.min,this.max)}distanceToPoint(e){return this.clampPoint(e,Js).distanceTo(e)}getBoundingSphere(e){return this.isEmpty()?e.makeEmpty():(this.getCenter(e.center),e.radius=this.getSize(Js).length()*.5),e}intersect(e){return this.min.max(e.min),this.max.min(e.max),this.isEmpty()&&this.makeEmpty(),this}union(e){return this.min.min(e.min),this.max.max(e.max),this}applyMatrix4(e){return this.isEmpty()?this:(ca[0].set(this.min.x,this.min.y,this.min.z).applyMatrix4(e),ca[1].set(this.min.x,this.min.y,this.max.z).applyMatrix4(e),ca[2].set(this.min.x,this.max.y,this.min.z).applyMatrix4(e),ca[3].set(this.min.x,this.max.y,this.max.z).applyMatrix4(e),ca[4].set(this.max.x,this.min.y,this.min.z).applyMatrix4(e),ca[5].set(this.max.x,this.min.y,this.max.z).applyMatrix4(e),ca[6].set(this.max.x,this.max.y,this.min.z).applyMatrix4(e),ca[7].set(this.max.x,this.max.y,this.max.z).applyMatrix4(e),this.setFromPoints(ca),this)}translate(e){return this.min.add(e),this.max.add(e),this}equals(e){return e.min.equals(this.min)&&e.max.equals(this.max)}}const ca=[new X,new X,new X,new X,new X,new X,new X,new X],Js=new X,vm=new sr,mf=new X,gf=new X,vf=new X,cl=new X,fl=new X,gu=new X,ah=new X,ym=new X,_m=new X,vu=new X;function Xv(i,e,t,n,r){for(let s=0,a=i.length-3;s<=a;s+=3){vu.fromArray(i,s);const u=r.x*Math.abs(vu.x)+r.y*Math.abs(vu.y)+r.z*Math.abs(vu.z),d=e.dot(vu),h=t.dot(vu),m=n.dot(vu);if(Math.max(-Math.max(d,h,m),Math.min(d,h,m))>u)return!1}return!0}const Qb=new sr,lh=new X,jv=new X;class ji{constructor(e=new X,t=-1){this.isSphere=!0,this.center=e,this.radius=t}set(e,t){return this.center.copy(e),this.radius=t,this}setFromPoints(e,t){const n=this.center;t!==void 0?n.copy(t):Qb.setFromPoints(e).getCenter(n);let r=0;for(let s=0,a=e.length;s<a;s++)r=Math.max(r,n.distanceToSquared(e[s]));return this.radius=Math.sqrt(r),this}copy(e){return this.center.copy(e.center),this.radius=e.radius,this}isEmpty(){return this.radius<0}makeEmpty(){return this.center.set(0,0,0),this.radius=-1,this}containsPoint(e){return e.distanceToSquared(this.center)<=this.radius*this.radius}distanceToPoint(e){return e.distanceTo(this.center)-this.radius}intersectsSphere(e){const t=this.radius+e.radius;return e.center.distanceToSquared(this.center)<=t*t}intersectsBox(e){return e.intersectsSphere(this)}intersectsPlane(e){return Math.abs(e.distanceToPoint(this.center))<=this.radius}clampPoint(e,t){const n=this.center.distanceToSquared(e);return t.copy(e),n>this.radius*this.radius&&(t.sub(this.center).normalize(),t.multiplyScalar(this.radius).add(this.center)),t}getBoundingBox(e){return this.isEmpty()?(e.makeEmpty(),e):(e.set(this.center,this.center),e.expandByScalar(this.radius),e)}applyMatrix4(e){return this.center.applyMatrix4(e),this.radius=this.radius*e.getMaxScaleOnAxis(),this}translate(e){return this.center.add(e),this}expandByPoint(e){if(this.isEmpty())return this.center.copy(e),this.radius=0,this;lh.subVectors(e,this.center);const t=lh.lengthSq();if(t>this.radius*this.radius){const n=Math.sqrt(t),r=(n-this.radius)*.5;this.center.addScaledVector(lh,r/n),this.radius+=r}return this}union(e){return e.isEmpty()?this:this.isEmpty()?(this.copy(e),this):(this.center.equals(e.center)===!0?this.radius=Math.max(this.radius,e.radius):(jv.subVectors(e.center,this.center).setLength(e.radius),this.expandByPoint(lh.copy(e.center).add(jv)),this.expandByPoint(lh.copy(e.center).sub(jv))),this)}equals(e){return e.center.equals(this.center)&&e.radius===this.radius}clone(){return new this.constructor().copy(this)}}const fa=new X,Jv=new X,xm=new X,dl=new X,Kv=new X,Am=new X,Yv=new X;class rc{constructor(e=new X,t=new X(0,0,-1)){this.origin=e,this.direction=t}set(e,t){return this.origin.copy(e),this.direction.copy(t),this}copy(e){return this.origin.copy(e.origin),this.direction.copy(e.direction),this}at(e,t){return t.copy(this.origin).addScaledVector(this.direction,e)}lookAt(e){return this.direction.copy(e).sub(this.origin).normalize(),this}recast(e){return this.origin.copy(this.at(e,fa)),this}closestPointToPoint(e,t){t.subVectors(e,this.origin);const n=t.dot(this.direction);return n<0?t.copy(this.origin):t.copy(this.origin).addScaledVector(this.direction,n)}distanceToPoint(e){return Math.sqrt(this.distanceSqToPoint(e))}distanceSqToPoint(e){const t=fa.subVectors(e,this.origin).dot(this.direction);return t<0?this.origin.distanceToSquared(e):(fa.copy(this.origin).addScaledVector(this.direction,t),fa.distanceToSquared(e))}distanceSqToSegment(e,t,n,r){Jv.copy(e).add(t).multiplyScalar(.5),xm.copy(t).sub(e).normalize(),dl.copy(this.origin).sub(Jv);const s=e.distanceTo(t)*.5,a=-this.direction.dot(xm),u=dl.dot(this.direction),d=-dl.dot(xm),h=dl.lengthSq(),m=Math.abs(1-a*a);let g,v,_,A;if(m>0)if(g=a*d-u,v=a*u-d,A=s*m,g>=0)if(v>=-A)if(v<=A){const C=1/m;g*=C,v*=C,_=g*(g+a*v+2*u)+v*(a*g+v+2*d)+h}else v=s,g=Math.max(0,-(a*v+u)),_=-g*g+v*(v+2*d)+h;else v=-s,g=Math.max(0,-(a*v+u)),_=-g*g+v*(v+2*d)+h;else v<=-A?(g=Math.max(0,-(-a*s+u)),v=g>0?-s:Math.min(Math.max(-s,-d),s),_=-g*g+v*(v+2*d)+h):v<=A?(g=0,v=Math.min(Math.max(-s,-d),s),_=v*(v+2*d)+h):(g=Math.max(0,-(a*s+u)),v=g>0?s:Math.min(Math.max(-s,-d),s),_=-g*g+v*(v+2*d)+h);else v=a>0?-s:s,g=Math.max(0,-(a*v+u)),_=-g*g+v*(v+2*d)+h;return n&&n.copy(this.origin).addScaledVector(this.direction,g),r&&r.copy(Jv).addScaledVector(xm,v),_}intersectSphere(e,t){fa.subVectors(e.center,this.origin);const n=fa.dot(this.direction),r=fa.dot(fa)-n*n,s=e.radius*e.radius;if(r>s)return null;const a=Math.sqrt(s-r),u=n-a,d=n+a;return d<0?null:u<0?this.at(d,t):this.at(u,t)}intersectsSphere(e){return this.distanceSqToPoint(e.center)<=e.radius*e.radius}distanceToPlane(e){const t=e.normal.dot(this.direction);if(t===0)return e.distanceToPoint(this.origin)===0?0:null;const n=-(this.origin.dot(e.normal)+e.constant)/t;return n>=0?n:null}intersectPlane(e,t){const n=this.distanceToPlane(e);return n===null?null:this.at(n,t)}intersectsPlane(e){const t=e.distanceToPoint(this.origin);return t===0||e.normal.dot(this.direction)*t<0}intersectBox(e,t){let n,r,s,a,u,d;const h=1/this.direction.x,m=1/this.direction.y,g=1/this.direction.z,v=this.origin;return h>=0?(n=(e.min.x-v.x)*h,r=(e.max.x-v.x)*h):(n=(e.max.x-v.x)*h,r=(e.min.x-v.x)*h),m>=0?(s=(e.min.y-v.y)*m,a=(e.max.y-v.y)*m):(s=(e.max.y-v.y)*m,a=(e.min.y-v.y)*m),n>a||s>r||((s>n||isNaN(n))&&(n=s),(a<r||isNaN(r))&&(r=a),g>=0?(u=(e.min.z-v.z)*g,d=(e.max.z-v.z)*g):(u=(e.max.z-v.z)*g,d=(e.min.z-v.z)*g),n>d||u>r)||((u>n||n!==n)&&(n=u),(d<r||r!==r)&&(r=d),r<0)?null:this.at(n>=0?n:r,t)}intersectsBox(e){return this.intersectBox(e,fa)!==null}intersectTriangle(e,t,n,r,s){Kv.subVectors(t,e),Am.subVectors(n,e),Yv.crossVectors(Kv,Am);let a=this.direction.dot(Yv),u;if(a>0){if(r)return null;u=1}else if(a<0)u=-1,a=-a;else return null;dl.subVectors(this.origin,e);const d=u*this.direction.dot(Am.crossVectors(dl,Am));if(d<0)return null;const h=u*this.direction.dot(Kv.cross(dl));if(h<0||d+h>a)return null;const m=-u*dl.dot(Yv);return m<0?null:this.at(m/a,s)}applyMatrix4(e){return this.origin.applyMatrix4(e),this.direction.transformDirection(e),this}equals(e){return e.origin.equals(this.origin)&&e.direction.equals(this.direction)}clone(){return new this.constructor().copy(this)}}class Ot{constructor(e,t,n,r,s,a,u,d,h,m,g,v,_,A,C,M){Ot.prototype.isMatrix4=!0,this.elements=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1],e!==void 0&&this.set(e,t,n,r,s,a,u,d,h,m,g,v,_,A,C,M)}set(e,t,n,r,s,a,u,d,h,m,g,v,_,A,C,M){const S=this.elements;return S[0]=e,S[4]=t,S[8]=n,S[12]=r,S[1]=s,S[5]=a,S[9]=u,S[13]=d,S[2]=h,S[6]=m,S[10]=g,S[14]=v,S[3]=_,S[7]=A,S[11]=C,S[15]=M,this}identity(){return this.set(1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1),this}clone(){return new Ot().fromArray(this.elements)}copy(e){const t=this.elements,n=e.elements;return t[0]=n[0],t[1]=n[1],t[2]=n[2],t[3]=n[3],t[4]=n[4],t[5]=n[5],t[6]=n[6],t[7]=n[7],t[8]=n[8],t[9]=n[9],t[10]=n[10],t[11]=n[11],t[12]=n[12],t[13]=n[13],t[14]=n[14],t[15]=n[15],this}copyPosition(e){const t=this.elements,n=e.elements;return t[12]=n[12],t[13]=n[13],t[14]=n[14],this}setFromMatrix3(e){const t=e.elements;return this.set(t[0],t[3],t[6],0,t[1],t[4],t[7],0,t[2],t[5],t[8],0,0,0,0,1),this}extractBasis(e,t,n){return e.setFromMatrixColumn(this,0),t.setFromMatrixColumn(this,1),n.setFromMatrixColumn(this,2),this}makeBasis(e,t,n){return this.set(e.x,t.x,n.x,0,e.y,t.y,n.y,0,e.z,t.z,n.z,0,0,0,0,1),this}extractRotation(e){const t=this.elements,n=e.elements,r=1/yf.setFromMatrixColumn(e,0).length(),s=1/yf.setFromMatrixColumn(e,1).length(),a=1/yf.setFromMatrixColumn(e,2).length();return t[0]=n[0]*r,t[1]=n[1]*r,t[2]=n[2]*r,t[3]=0,t[4]=n[4]*s,t[5]=n[5]*s,t[6]=n[6]*s,t[7]=0,t[8]=n[8]*a,t[9]=n[9]*a,t[10]=n[10]*a,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,this}makeRotationFromEuler(e){const t=this.elements,n=e.x,r=e.y,s=e.z,a=Math.cos(n),u=Math.sin(n),d=Math.cos(r),h=Math.sin(r),m=Math.cos(s),g=Math.sin(s);if(e.order==="XYZ"){const v=a*m,_=a*g,A=u*m,C=u*g;t[0]=d*m,t[4]=-d*g,t[8]=h,t[1]=_+A*h,t[5]=v-C*h,t[9]=-u*d,t[2]=C-v*h,t[6]=A+_*h,t[10]=a*d}else if(e.order==="YXZ"){const v=d*m,_=d*g,A=h*m,C=h*g;t[0]=v+C*u,t[4]=A*u-_,t[8]=a*h,t[1]=a*g,t[5]=a*m,t[9]=-u,t[2]=_*u-A,t[6]=C+v*u,t[10]=a*d}else if(e.order==="ZXY"){const v=d*m,_=d*g,A=h*m,C=h*g;t[0]=v-C*u,t[4]=-a*g,t[8]=A+_*u,t[1]=_+A*u,t[5]=a*m,t[9]=C-v*u,t[2]=-a*h,t[6]=u,t[10]=a*d}else if(e.order==="ZYX"){const v=a*m,_=a*g,A=u*m,C=u*g;t[0]=d*m,t[4]=A*h-_,t[8]=v*h+C,t[1]=d*g,t[5]=C*h+v,t[9]=_*h-A,t[2]=-h,t[6]=u*d,t[10]=a*d}else if(e.order==="YZX"){const v=a*d,_=a*h,A=u*d,C=u*h;t[0]=d*m,t[4]=C-v*g,t[8]=A*g+_,t[1]=g,t[5]=a*m,t[9]=-u*m,t[2]=-h*m,t[6]=_*g+A,t[10]=v-C*g}else if(e.order==="XZY"){const v=a*d,_=a*h,A=u*d,C=u*h;t[0]=d*m,t[4]=-g,t[8]=h*m,t[1]=v*g+C,t[5]=a*m,t[9]=_*g-A,t[2]=A*g-_,t[6]=u*m,t[10]=C*g+v}return t[3]=0,t[7]=0,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,this}makeRotationFromQuaternion(e){return this.compose(qb,e,Zb)}lookAt(e,t,n){const r=this.elements;return qr.subVectors(e,t),qr.lengthSq()===0&&(qr.z=1),qr.normalize(),hl.crossVectors(n,qr),hl.lengthSq()===0&&(Math.abs(n.z)===1?qr.x+=1e-4:qr.z+=1e-4,qr.normalize(),hl.crossVectors(n,qr)),hl.normalize(),Sm.crossVectors(qr,hl),r[0]=hl.x,r[4]=Sm.x,r[8]=qr.x,r[1]=hl.y,r[5]=Sm.y,r[9]=qr.y,r[2]=hl.z,r[6]=Sm.z,r[10]=qr.z,this}multiply(e){return this.multiplyMatrices(this,e)}premultiply(e){return this.multiplyMatrices(e,this)}multiplyMatrices(e,t){const n=e.elements,r=t.elements,s=this.elements,a=n[0],u=n[4],d=n[8],h=n[12],m=n[1],g=n[5],v=n[9],_=n[13],A=n[2],C=n[6],M=n[10],S=n[14],b=n[3],R=n[7],P=n[11],U=n[15],F=r[0],k=r[4],G=r[8],D=r[12],L=r[1],V=r[5],oe=r[9],ie=r[13],ge=r[2],ye=r[6],he=r[10],_e=r[14],H=r[3],Z=r[7],q=r[11],W=r[15];return s[0]=a*F+u*L+d*ge+h*H,s[4]=a*k+u*V+d*ye+h*Z,s[8]=a*G+u*oe+d*he+h*q,s[12]=a*D+u*ie+d*_e+h*W,s[1]=m*F+g*L+v*ge+_*H,s[5]=m*k+g*V+v*ye+_*Z,s[9]=m*G+g*oe+v*he+_*q,s[13]=m*D+g*ie+v*_e+_*W,s[2]=A*F+C*L+M*ge+S*H,s[6]=A*k+C*V+M*ye+S*Z,s[10]=A*G+C*oe+M*he+S*q,s[14]=A*D+C*ie+M*_e+S*W,s[3]=b*F+R*L+P*ge+U*H,s[7]=b*k+R*V+P*ye+U*Z,s[11]=b*G+R*oe+P*he+U*q,s[15]=b*D+R*ie+P*_e+U*W,this}multiplyScalar(e){const t=this.elements;return t[0]*=e,t[4]*=e,t[8]*=e,t[12]*=e,t[1]*=e,t[5]*=e,t[9]*=e,t[13]*=e,t[2]*=e,t[6]*=e,t[10]*=e,t[14]*=e,t[3]*=e,t[7]*=e,t[11]*=e,t[15]*=e,this}determinant(){const e=this.elements,t=e[0],n=e[4],r=e[8],s=e[12],a=e[1],u=e[5],d=e[9],h=e[13],m=e[2],g=e[6],v=e[10],_=e[14],A=e[3],C=e[7],M=e[11],S=e[15];return A*(+s*d*g-r*h*g-s*u*v+n*h*v+r*u*_-n*d*_)+C*(+t*d*_-t*h*v+s*a*v-r*a*_+r*h*m-s*d*m)+M*(+t*h*g-t*u*_-s*a*g+n*a*_+s*u*m-n*h*m)+S*(-r*u*m-t*d*g+t*u*v+r*a*g-n*a*v+n*d*m)}transpose(){const e=this.elements;let t;return t=e[1],e[1]=e[4],e[4]=t,t=e[2],e[2]=e[8],e[8]=t,t=e[6],e[6]=e[9],e[9]=t,t=e[3],e[3]=e[12],e[12]=t,t=e[7],e[7]=e[13],e[13]=t,t=e[11],e[11]=e[14],e[14]=t,this}setPosition(e,t,n){const r=this.elements;return e.isVector3?(r[12]=e.x,r[13]=e.y,r[14]=e.z):(r[12]=e,r[13]=t,r[14]=n),this}invert(){const e=this.elements,t=e[0],n=e[1],r=e[2],s=e[3],a=e[4],u=e[5],d=e[6],h=e[7],m=e[8],g=e[9],v=e[10],_=e[11],A=e[12],C=e[13],M=e[14],S=e[15],b=g*M*h-C*v*h+C*d*_-u*M*_-g*d*S+u*v*S,R=A*v*h-m*M*h-A*d*_+a*M*_+m*d*S-a*v*S,P=m*C*h-A*g*h+A*u*_-a*C*_-m*u*S+a*g*S,U=A*g*d-m*C*d-A*u*v+a*C*v+m*u*M-a*g*M,F=t*b+n*R+r*P+s*U;if(F===0)return this.set(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0);const k=1/F;return e[0]=b*k,e[1]=(C*v*s-g*M*s-C*r*_+n*M*_+g*r*S-n*v*S)*k,e[2]=(u*M*s-C*d*s+C*r*h-n*M*h-u*r*S+n*d*S)*k,e[3]=(g*d*s-u*v*s-g*r*h+n*v*h+u*r*_-n*d*_)*k,e[4]=R*k,e[5]=(m*M*s-A*v*s+A*r*_-t*M*_-m*r*S+t*v*S)*k,e[6]=(A*d*s-a*M*s-A*r*h+t*M*h+a*r*S-t*d*S)*k,e[7]=(a*v*s-m*d*s+m*r*h-t*v*h-a*r*_+t*d*_)*k,e[8]=P*k,e[9]=(A*g*s-m*C*s-A*n*_+t*C*_+m*n*S-t*g*S)*k,e[10]=(a*C*s-A*u*s+A*n*h-t*C*h-a*n*S+t*u*S)*k,e[11]=(m*u*s-a*g*s-m*n*h+t*g*h+a*n*_-t*u*_)*k,e[12]=U*k,e[13]=(m*C*r-A*g*r+A*n*v-t*C*v-m*n*M+t*g*M)*k,e[14]=(A*u*r-a*C*r-A*n*d+t*C*d+a*n*M-t*u*M)*k,e[15]=(a*g*r-m*u*r+m*n*d-t*g*d-a*n*v+t*u*v)*k,this}scale(e){const t=this.elements,n=e.x,r=e.y,s=e.z;return t[0]*=n,t[4]*=r,t[8]*=s,t[1]*=n,t[5]*=r,t[9]*=s,t[2]*=n,t[6]*=r,t[10]*=s,t[3]*=n,t[7]*=r,t[11]*=s,this}getMaxScaleOnAxis(){const e=this.elements,t=e[0]*e[0]+e[1]*e[1]+e[2]*e[2],n=e[4]*e[4]+e[5]*e[5]+e[6]*e[6],r=e[8]*e[8]+e[9]*e[9]+e[10]*e[10];return Math.sqrt(Math.max(t,n,r))}makeTranslation(e,t,n){return e.isVector3?this.set(1,0,0,e.x,0,1,0,e.y,0,0,1,e.z,0,0,0,1):this.set(1,0,0,e,0,1,0,t,0,0,1,n,0,0,0,1),this}makeRotationX(e){const t=Math.cos(e),n=Math.sin(e);return this.set(1,0,0,0,0,t,-n,0,0,n,t,0,0,0,0,1),this}makeRotationY(e){const t=Math.cos(e),n=Math.sin(e);return this.set(t,0,n,0,0,1,0,0,-n,0,t,0,0,0,0,1),this}makeRotationZ(e){const t=Math.cos(e),n=Math.sin(e);return this.set(t,-n,0,0,n,t,0,0,0,0,1,0,0,0,0,1),this}makeRotationAxis(e,t){const n=Math.cos(t),r=Math.sin(t),s=1-n,a=e.x,u=e.y,d=e.z,h=s*a,m=s*u;return this.set(h*a+n,h*u-r*d,h*d+r*u,0,h*u+r*d,m*u+n,m*d-r*a,0,h*d-r*u,m*d+r*a,s*d*d+n,0,0,0,0,1),this}makeScale(e,t,n){return this.set(e,0,0,0,0,t,0,0,0,0,n,0,0,0,0,1),this}makeShear(e,t,n,r,s,a){return this.set(1,n,s,0,e,1,a,0,t,r,1,0,0,0,0,1),this}compose(e,t,n){const r=this.elements,s=t._x,a=t._y,u=t._z,d=t._w,h=s+s,m=a+a,g=u+u,v=s*h,_=s*m,A=s*g,C=a*m,M=a*g,S=u*g,b=d*h,R=d*m,P=d*g,U=n.x,F=n.y,k=n.z;return r[0]=(1-(C+S))*U,r[1]=(_+P)*U,r[2]=(A-R)*U,r[3]=0,r[4]=(_-P)*F,r[5]=(1-(v+S))*F,r[6]=(M+b)*F,r[7]=0,r[8]=(A+R)*k,r[9]=(M-b)*k,r[10]=(1-(v+C))*k,r[11]=0,r[12]=e.x,r[13]=e.y,r[14]=e.z,r[15]=1,this}decompose(e,t,n){const r=this.elements;let s=yf.set(r[0],r[1],r[2]).length();const a=yf.set(r[4],r[5],r[6]).length(),u=yf.set(r[8],r[9],r[10]).length();this.determinant()<0&&(s=-s),e.x=r[12],e.y=r[13],e.z=r[14],Ks.copy(this);const h=1/s,m=1/a,g=1/u;return Ks.elements[0]*=h,Ks.elements[1]*=h,Ks.elements[2]*=h,Ks.elements[4]*=m,Ks.elements[5]*=m,Ks.elements[6]*=m,Ks.elements[8]*=g,Ks.elements[9]*=g,Ks.elements[10]*=g,t.setFromRotationMatrix(Ks),n.x=s,n.y=a,n.z=u,this}makePerspective(e,t,n,r,s,a,u=Zs){const d=this.elements,h=2*s/(t-e),m=2*s/(n-r),g=(t+e)/(t-e),v=(n+r)/(n-r);let _,A;if(u===Zs)_=-(a+s)/(a-s),A=-2*a*s/(a-s);else if(u===Vh)_=-a/(a-s),A=-a*s/(a-s);else throw new Error("THREE.Matrix4.makePerspective(): Invalid coordinate system: "+u);return d[0]=h,d[4]=0,d[8]=g,d[12]=0,d[1]=0,d[5]=m,d[9]=v,d[13]=0,d[2]=0,d[6]=0,d[10]=_,d[14]=A,d[3]=0,d[7]=0,d[11]=-1,d[15]=0,this}makeOrthographic(e,t,n,r,s,a,u=Zs){const d=this.elements,h=1/(t-e),m=1/(n-r),g=1/(a-s),v=(t+e)*h,_=(n+r)*m;let A,C;if(u===Zs)A=(a+s)*g,C=-2*g;else if(u===Vh)A=s*g,C=-1*g;else throw new Error("THREE.Matrix4.makeOrthographic(): Invalid coordinate system: "+u);return d[0]=2*h,d[4]=0,d[8]=0,d[12]=-v,d[1]=0,d[5]=2*m,d[9]=0,d[13]=-_,d[2]=0,d[6]=0,d[10]=C,d[14]=-A,d[3]=0,d[7]=0,d[11]=0,d[15]=1,this}equals(e){const t=this.elements,n=e.elements;for(let r=0;r<16;r++)if(t[r]!==n[r])return!1;return!0}fromArray(e,t=0){for(let n=0;n<16;n++)this.elements[n]=e[n+t];return this}toArray(e=[],t=0){const n=this.elements;return e[t]=n[0],e[t+1]=n[1],e[t+2]=n[2],e[t+3]=n[3],e[t+4]=n[4],e[t+5]=n[5],e[t+6]=n[6],e[t+7]=n[7],e[t+8]=n[8],e[t+9]=n[9],e[t+10]=n[10],e[t+11]=n[11],e[t+12]=n[12],e[t+13]=n[13],e[t+14]=n[14],e[t+15]=n[15],e}}const yf=new X,Ks=new Ot,qb=new X(0,0,0),Zb=new X(1,1,1),hl=new X,Sm=new X,qr=new X,Y1=new Ot,Q1=new Fi;class ns{constructor(e=0,t=0,n=0,r=ns.DEFAULT_ORDER){this.isEuler=!0,this._x=e,this._y=t,this._z=n,this._order=r}get x(){return this._x}set x(e){this._x=e,this._onChangeCallback()}get y(){return this._y}set y(e){this._y=e,this._onChangeCallback()}get z(){return this._z}set z(e){this._z=e,this._onChangeCallback()}get order(){return this._order}set order(e){this._order=e,this._onChangeCallback()}set(e,t,n,r=this._order){return this._x=e,this._y=t,this._z=n,this._order=r,this._onChangeCallback(),this}clone(){return new this.constructor(this._x,this._y,this._z,this._order)}copy(e){return this._x=e._x,this._y=e._y,this._z=e._z,this._order=e._order,this._onChangeCallback(),this}setFromRotationMatrix(e,t=this._order,n=!0){const r=e.elements,s=r[0],a=r[4],u=r[8],d=r[1],h=r[5],m=r[9],g=r[2],v=r[6],_=r[10];switch(t){case"XYZ":this._y=Math.asin(Xt(u,-1,1)),Math.abs(u)<.9999999?(this._x=Math.atan2(-m,_),this._z=Math.atan2(-a,s)):(this._x=Math.atan2(v,h),this._z=0);break;case"YXZ":this._x=Math.asin(-Xt(m,-1,1)),Math.abs(m)<.9999999?(this._y=Math.atan2(u,_),this._z=Math.atan2(d,h)):(this._y=Math.atan2(-g,s),this._z=0);break;case"ZXY":this._x=Math.asin(Xt(v,-1,1)),Math.abs(v)<.9999999?(this._y=Math.atan2(-g,_),this._z=Math.atan2(-a,h)):(this._y=0,this._z=Math.atan2(d,s));break;case"ZYX":this._y=Math.asin(-Xt(g,-1,1)),Math.abs(g)<.9999999?(this._x=Math.atan2(v,_),this._z=Math.atan2(d,s)):(this._x=0,this._z=Math.atan2(-a,h));break;case"YZX":this._z=Math.asin(Xt(d,-1,1)),Math.abs(d)<.9999999?(this._x=Math.atan2(-m,h),this._y=Math.atan2(-g,s)):(this._x=0,this._y=Math.atan2(u,_));break;case"XZY":this._z=Math.asin(-Xt(a,-1,1)),Math.abs(a)<.9999999?(this._x=Math.atan2(v,h),this._y=Math.atan2(u,s)):(this._x=Math.atan2(-m,_),this._y=0);break;default:console.warn("THREE.Euler: .setFromRotationMatrix() encountered an unknown order: "+t)}return this._order=t,n===!0&&this._onChangeCallback(),this}setFromQuaternion(e,t,n){return Y1.makeRotationFromQuaternion(e),this.setFromRotationMatrix(Y1,t,n)}setFromVector3(e,t=this._order){return this.set(e.x,e.y,e.z,t)}reorder(e){return Q1.setFromEuler(this),this.setFromQuaternion(Q1,e)}equals(e){return e._x===this._x&&e._y===this._y&&e._z===this._z&&e._order===this._order}fromArray(e){return this._x=e[0],this._y=e[1],this._z=e[2],e[3]!==void 0&&(this._order=e[3]),this._onChangeCallback(),this}toArray(e=[],t=0){return e[t]=this._x,e[t+1]=this._y,e[t+2]=this._z,e[t+3]=this._order,e}_onChange(e){return this._onChangeCallback=e,this}_onChangeCallback(){}*[Symbol.iterator](){yield this._x,yield this._y,yield this._z,yield this._order}}ns.DEFAULT_ORDER="XYZ";class ju{constructor(){this.mask=1}set(e){this.mask=(1<<e|0)>>>0}enable(e){this.mask|=1<<e|0}enableAll(){this.mask=-1}toggle(e){this.mask^=1<<e|0}disable(e){this.mask&=~(1<<e|0)}disableAll(){this.mask=0}test(e){return(this.mask&e.mask)!==0}isEnabled(e){return(this.mask&(1<<e|0))!==0}}let $b=0;const q1=new X,_f=new Fi,da=new Ot,Mm=new X,uh=new X,e3=new X,t3=new Fi,Z1=new X(1,0,0),$1=new X(0,1,0),eA=new X(0,0,1),tA={type:"added"},n3={type:"removed"},xf={type:"childadded",child:null},Qv={type:"childremoved",child:null};class fn extends Io{constructor(){super(),this.isObject3D=!0,Object.defineProperty(this,"id",{value:$b++}),this.uuid=ts(),this.name="",this.type="Object3D",this.parent=null,this.children=[],this.up=fn.DEFAULT_UP.clone();const e=new X,t=new ns,n=new Fi,r=new X(1,1,1);function s(){n.setFromEuler(t,!1)}function a(){t.setFromQuaternion(n,void 0,!1)}t._onChange(s),n._onChange(a),Object.defineProperties(this,{position:{configurable:!0,enumerable:!0,value:e},rotation:{configurable:!0,enumerable:!0,value:t},quaternion:{configurable:!0,enumerable:!0,value:n},scale:{configurable:!0,enumerable:!0,value:r},modelViewMatrix:{value:new Ot},normalMatrix:{value:new Jt}}),this.matrix=new Ot,this.matrixWorld=new Ot,this.matrixAutoUpdate=fn.DEFAULT_MATRIX_AUTO_UPDATE,this.matrixWorldAutoUpdate=fn.DEFAULT_MATRIX_WORLD_AUTO_UPDATE,this.matrixWorldNeedsUpdate=!1,this.layers=new ju,this.visible=!0,this.castShadow=!1,this.receiveShadow=!1,this.frustumCulled=!0,this.renderOrder=0,this.animations=[],this.userData={}}onBeforeShadow(){}onAfterShadow(){}onBeforeRender(){}onAfterRender(){}applyMatrix4(e){this.matrixAutoUpdate&&this.updateMatrix(),this.matrix.premultiply(e),this.matrix.decompose(this.position,this.quaternion,this.scale)}applyQuaternion(e){return this.quaternion.premultiply(e),this}setRotationFromAxisAngle(e,t){this.quaternion.setFromAxisAngle(e,t)}setRotationFromEuler(e){this.quaternion.setFromEuler(e,!0)}setRotationFromMatrix(e){this.quaternion.setFromRotationMatrix(e)}setRotationFromQuaternion(e){this.quaternion.copy(e)}rotateOnAxis(e,t){return _f.setFromAxisAngle(e,t),this.quaternion.multiply(_f),this}rotateOnWorldAxis(e,t){return _f.setFromAxisAngle(e,t),this.quaternion.premultiply(_f),this}rotateX(e){return this.rotateOnAxis(Z1,e)}rotateY(e){return this.rotateOnAxis($1,e)}rotateZ(e){return this.rotateOnAxis(eA,e)}translateOnAxis(e,t){return q1.copy(e).applyQuaternion(this.quaternion),this.position.add(q1.multiplyScalar(t)),this}translateX(e){return this.translateOnAxis(Z1,e)}translateY(e){return this.translateOnAxis($1,e)}translateZ(e){return this.translateOnAxis(eA,e)}localToWorld(e){return this.updateWorldMatrix(!0,!1),e.applyMatrix4(this.matrixWorld)}worldToLocal(e){return this.updateWorldMatrix(!0,!1),e.applyMatrix4(da.copy(this.matrixWorld).invert())}lookAt(e,t,n){e.isVector3?Mm.copy(e):Mm.set(e,t,n);const r=this.parent;this.updateWorldMatrix(!0,!1),uh.setFromMatrixPosition(this.matrixWorld),this.isCamera||this.isLight?da.lookAt(uh,Mm,this.up):da.lookAt(Mm,uh,this.up),this.quaternion.setFromRotationMatrix(da),r&&(da.extractRotation(r.matrixWorld),_f.setFromRotationMatrix(da),this.quaternion.premultiply(_f.invert()))}add(e){if(arguments.length>1){for(let t=0;t<arguments.length;t++)this.add(arguments[t]);return this}return e===this?(console.error("THREE.Object3D.add: object can't be added as a child of itself.",e),this):(e&&e.isObject3D?(e.removeFromParent(),e.parent=this,this.children.push(e),e.dispatchEvent(tA),xf.child=e,this.dispatchEvent(xf),xf.child=null):console.error("THREE.Object3D.add: object not an instance of THREE.Object3D.",e),this)}remove(e){if(arguments.length>1){for(let n=0;n<arguments.length;n++)this.remove(arguments[n]);return this}const t=this.children.indexOf(e);return t!==-1&&(e.parent=null,this.children.splice(t,1),e.dispatchEvent(n3),Qv.child=e,this.dispatchEvent(Qv),Qv.child=null),this}removeFromParent(){const e=this.parent;return e!==null&&e.remove(this),this}clear(){return this.remove(...this.children)}attach(e){return this.updateWorldMatrix(!0,!1),da.copy(this.matrixWorld).invert(),e.parent!==null&&(e.parent.updateWorldMatrix(!0,!1),da.multiply(e.parent.matrixWorld)),e.applyMatrix4(da),e.removeFromParent(),e.parent=this,this.children.push(e),e.updateWorldMatrix(!1,!0),e.dispatchEvent(tA),xf.child=e,this.dispatchEvent(xf),xf.child=null,this}getObjectById(e){return this.getObjectByProperty("id",e)}getObjectByName(e){return this.getObjectByProperty("name",e)}getObjectByProperty(e,t){if(this[e]===t)return this;for(let n=0,r=this.children.length;n<r;n++){const a=this.children[n].getObjectByProperty(e,t);if(a!==void 0)return a}}getObjectsByProperty(e,t,n=[]){this[e]===t&&n.push(this);const r=this.children;for(let s=0,a=r.length;s<a;s++)r[s].getObjectsByProperty(e,t,n);return n}getWorldPosition(e){return this.updateWorldMatrix(!0,!1),e.setFromMatrixPosition(this.matrixWorld)}getWorldQuaternion(e){return this.updateWorldMatrix(!0,!1),this.matrixWorld.decompose(uh,e,e3),e}getWorldScale(e){return this.updateWorldMatrix(!0,!1),this.matrixWorld.decompose(uh,t3,e),e}getWorldDirection(e){this.updateWorldMatrix(!0,!1);const t=this.matrixWorld.elements;return e.set(t[8],t[9],t[10]).normalize()}raycast(){}traverse(e){e(this);const t=this.children;for(let n=0,r=t.length;n<r;n++)t[n].traverse(e)}traverseVisible(e){if(this.visible===!1)return;e(this);const t=this.children;for(let n=0,r=t.length;n<r;n++)t[n].traverseVisible(e)}traverseAncestors(e){const t=this.parent;t!==null&&(e(t),t.traverseAncestors(e))}updateMatrix(){this.matrix.compose(this.position,this.quaternion,this.scale),this.matrixWorldNeedsUpdate=!0}updateMatrixWorld(e){this.matrixAutoUpdate&&this.updateMatrix(),(this.matrixWorldNeedsUpdate||e)&&(this.matrixWorldAutoUpdate===!0&&(this.parent===null?this.matrixWorld.copy(this.matrix):this.matrixWorld.multiplyMatrices(this.parent.matrixWorld,this.matrix)),this.matrixWorldNeedsUpdate=!1,e=!0);const t=this.children;for(let n=0,r=t.length;n<r;n++)t[n].updateMatrixWorld(e)}updateWorldMatrix(e,t){const n=this.parent;if(e===!0&&n!==null&&n.updateWorldMatrix(!0,!1),this.matrixAutoUpdate&&this.updateMatrix(),this.matrixWorldAutoUpdate===!0&&(this.parent===null?this.matrixWorld.copy(this.matrix):this.matrixWorld.multiplyMatrices(this.parent.matrixWorld,this.matrix)),t===!0){const r=this.children;for(let s=0,a=r.length;s<a;s++)r[s].updateWorldMatrix(!1,!0)}}toJSON(e){const t=e===void 0||typeof e=="string",n={};t&&(e={geometries:{},materials:{},textures:{},images:{},shapes:{},skeletons:{},animations:{},nodes:{}},n.metadata={version:4.6,type:"Object",generator:"Object3D.toJSON"});const r={};r.uuid=this.uuid,r.type=this.type,this.name!==""&&(r.name=this.name),this.castShadow===!0&&(r.castShadow=!0),this.receiveShadow===!0&&(r.receiveShadow=!0),this.visible===!1&&(r.visible=!1),this.frustumCulled===!1&&(r.frustumCulled=!1),this.renderOrder!==0&&(r.renderOrder=this.renderOrder),Object.keys(this.userData).length>0&&(r.userData=this.userData),r.layers=this.layers.mask,r.matrix=this.matrix.toArray(),r.up=this.up.toArray(),this.matrixAutoUpdate===!1&&(r.matrixAutoUpdate=!1),this.isInstancedMesh&&(r.type="InstancedMesh",r.count=this.count,r.instanceMatrix=this.instanceMatrix.toJSON(),this.instanceColor!==null&&(r.instanceColor=this.instanceColor.toJSON())),this.isBatchedMesh&&(r.type="BatchedMesh",r.perObjectFrustumCulled=this.perObjectFrustumCulled,r.sortObjects=this.sortObjects,r.drawRanges=this._drawRanges,r.reservedRanges=this._reservedRanges,r.visibility=this._visibility,r.active=this._active,r.bounds=this._bounds.map(u=>({boxInitialized:u.boxInitialized,boxMin:u.box.min.toArray(),boxMax:u.box.max.toArray(),sphereInitialized:u.sphereInitialized,sphereRadius:u.sphere.radius,sphereCenter:u.sphere.center.toArray()})),r.maxInstanceCount=this._maxInstanceCount,r.maxVertexCount=this._maxVertexCount,r.maxIndexCount=this._maxIndexCount,r.geometryInitialized=this._geometryInitialized,r.geometryCount=this._geometryCount,r.matricesTexture=this._matricesTexture.toJSON(e),this._colorsTexture!==null&&(r.colorsTexture=this._colorsTexture.toJSON(e)),this.boundingSphere!==null&&(r.boundingSphere={center:r.boundingSphere.center.toArray(),radius:r.boundingSphere.radius}),this.boundingBox!==null&&(r.boundingBox={min:r.boundingBox.min.toArray(),max:r.boundingBox.max.toArray()}));function s(u,d){return u[d.uuid]===void 0&&(u[d.uuid]=d.toJSON(e)),d.uuid}if(this.isScene)this.background&&(this.background.isColor?r.background=this.background.toJSON():this.background.isTexture&&(r.background=this.background.toJSON(e).uuid)),this.environment&&this.environment.isTexture&&this.environment.isRenderTargetTexture!==!0&&(r.environment=this.environment.toJSON(e).uuid);else if(this.isMesh||this.isLine||this.isPoints){r.geometry=s(e.geometries,this.geometry);const u=this.geometry.parameters;if(u!==void 0&&u.shapes!==void 0){const d=u.shapes;if(Array.isArray(d))for(let h=0,m=d.length;h<m;h++){const g=d[h];s(e.shapes,g)}else s(e.shapes,d)}}if(this.isSkinnedMesh&&(r.bindMode=this.bindMode,r.bindMatrix=this.bindMatrix.toArray(),this.skeleton!==void 0&&(s(e.skeletons,this.skeleton),r.skeleton=this.skeleton.uuid)),this.material!==void 0)if(Array.isArray(this.material)){const u=[];for(let d=0,h=this.material.length;d<h;d++)u.push(s(e.materials,this.material[d]));r.material=u}else r.material=s(e.materials,this.material);if(this.children.length>0){r.children=[];for(let u=0;u<this.children.length;u++)r.children.push(this.children[u].toJSON(e).object)}if(this.animations.length>0){r.animations=[];for(let u=0;u<this.animations.length;u++){const d=this.animations[u];r.animations.push(s(e.animations,d))}}if(t){const u=a(e.geometries),d=a(e.materials),h=a(e.textures),m=a(e.images),g=a(e.shapes),v=a(e.skeletons),_=a(e.animations),A=a(e.nodes);u.length>0&&(n.geometries=u),d.length>0&&(n.materials=d),h.length>0&&(n.textures=h),m.length>0&&(n.images=m),g.length>0&&(n.shapes=g),v.length>0&&(n.skeletons=v),_.length>0&&(n.animations=_),A.length>0&&(n.nodes=A)}return n.object=r,n;function a(u){const d=[];for(const h in u){const m=u[h];delete m.metadata,d.push(m)}return d}}clone(e){return new this.constructor().copy(this,e)}copy(e,t=!0){if(this.name=e.name,this.up.copy(e.up),this.position.copy(e.position),this.rotation.order=e.rotation.order,this.quaternion.copy(e.quaternion),this.scale.copy(e.scale),this.matrix.copy(e.matrix),this.matrixWorld.copy(e.matrixWorld),this.matrixAutoUpdate=e.matrixAutoUpdate,this.matrixWorldAutoUpdate=e.matrixWorldAutoUpdate,this.matrixWorldNeedsUpdate=e.matrixWorldNeedsUpdate,this.layers.mask=e.layers.mask,this.visible=e.visible,this.castShadow=e.castShadow,this.receiveShadow=e.receiveShadow,this.frustumCulled=e.frustumCulled,this.renderOrder=e.renderOrder,this.animations=e.animations.slice(),this.userData=JSON.parse(JSON.stringify(e.userData)),t===!0)for(let n=0;n<e.children.length;n++){const r=e.children[n];this.add(r.clone())}return this}}fn.DEFAULT_UP=new X(0,1,0);fn.DEFAULT_MATRIX_AUTO_UPDATE=!0;fn.DEFAULT_MATRIX_WORLD_AUTO_UPDATE=!0;const Ys=new X,ha=new X,qv=new X,pa=new X,Af=new X,Sf=new X,nA=new X,Zv=new X,$v=new X,ey=new X,ty=new _n,ny=new _n,iy=new _n;class Ur{constructor(e=new X,t=new X,n=new X){this.a=e,this.b=t,this.c=n}static getNormal(e,t,n,r){r.subVectors(n,t),Ys.subVectors(e,t),r.cross(Ys);const s=r.lengthSq();return s>0?r.multiplyScalar(1/Math.sqrt(s)):r.set(0,0,0)}static getBarycoord(e,t,n,r,s){Ys.subVectors(r,t),ha.subVectors(n,t),qv.subVectors(e,t);const a=Ys.dot(Ys),u=Ys.dot(ha),d=Ys.dot(qv),h=ha.dot(ha),m=ha.dot(qv),g=a*h-u*u;if(g===0)return s.set(0,0,0),null;const v=1/g,_=(h*d-u*m)*v,A=(a*m-u*d)*v;return s.set(1-_-A,A,_)}static containsPoint(e,t,n,r){return this.getBarycoord(e,t,n,r,pa)===null?!1:pa.x>=0&&pa.y>=0&&pa.x+pa.y<=1}static getInterpolation(e,t,n,r,s,a,u,d){return this.getBarycoord(e,t,n,r,pa)===null?(d.x=0,d.y=0,"z"in d&&(d.z=0),"w"in d&&(d.w=0),null):(d.setScalar(0),d.addScaledVector(s,pa.x),d.addScaledVector(a,pa.y),d.addScaledVector(u,pa.z),d)}static getInterpolatedAttribute(e,t,n,r,s,a){return ty.setScalar(0),ny.setScalar(0),iy.setScalar(0),ty.fromBufferAttribute(e,t),ny.fromBufferAttribute(e,n),iy.fromBufferAttribute(e,r),a.setScalar(0),a.addScaledVector(ty,s.x),a.addScaledVector(ny,s.y),a.addScaledVector(iy,s.z),a}static isFrontFacing(e,t,n,r){return Ys.subVectors(n,t),ha.subVectors(e,t),Ys.cross(ha).dot(r)<0}set(e,t,n){return this.a.copy(e),this.b.copy(t),this.c.copy(n),this}setFromPointsAndIndices(e,t,n,r){return this.a.copy(e[t]),this.b.copy(e[n]),this.c.copy(e[r]),this}setFromAttributeAndIndices(e,t,n,r){return this.a.fromBufferAttribute(e,t),this.b.fromBufferAttribute(e,n),this.c.fromBufferAttribute(e,r),this}clone(){return new this.constructor().copy(this)}copy(e){return this.a.copy(e.a),this.b.copy(e.b),this.c.copy(e.c),this}getArea(){return Ys.subVectors(this.c,this.b),ha.subVectors(this.a,this.b),Ys.cross(ha).length()*.5}getMidpoint(e){return e.addVectors(this.a,this.b).add(this.c).multiplyScalar(1/3)}getNormal(e){return Ur.getNormal(this.a,this.b,this.c,e)}getPlane(e){return e.setFromCoplanarPoints(this.a,this.b,this.c)}getBarycoord(e,t){return Ur.getBarycoord(e,this.a,this.b,this.c,t)}getInterpolation(e,t,n,r,s){return Ur.getInterpolation(e,this.a,this.b,this.c,t,n,r,s)}containsPoint(e){return Ur.containsPoint(e,this.a,this.b,this.c)}isFrontFacing(e){return Ur.isFrontFacing(this.a,this.b,this.c,e)}intersectsBox(e){return e.intersectsTriangle(this)}closestPointToPoint(e,t){const n=this.a,r=this.b,s=this.c;let a,u;Af.subVectors(r,n),Sf.subVectors(s,n),Zv.subVectors(e,n);const d=Af.dot(Zv),h=Sf.dot(Zv);if(d<=0&&h<=0)return t.copy(n);$v.subVectors(e,r);const m=Af.dot($v),g=Sf.dot($v);if(m>=0&&g<=m)return t.copy(r);const v=d*g-m*h;if(v<=0&&d>=0&&m<=0)return a=d/(d-m),t.copy(n).addScaledVector(Af,a);ey.subVectors(e,s);const _=Af.dot(ey),A=Sf.dot(ey);if(A>=0&&_<=A)return t.copy(s);const C=_*h-d*A;if(C<=0&&h>=0&&A<=0)return u=h/(h-A),t.copy(n).addScaledVector(Sf,u);const M=m*A-_*g;if(M<=0&&g-m>=0&&_-A>=0)return nA.subVectors(s,r),u=(g-m)/(g-m+(_-A)),t.copy(r).addScaledVector(nA,u);const S=1/(M+C+v);return a=C*S,u=v*S,t.copy(n).addScaledVector(Af,a).addScaledVector(Sf,u)}equals(e){return e.a.equals(this.a)&&e.b.equals(this.b)&&e.c.equals(this.c)}}const PM={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},pl={h:0,s:0,l:0},Em={h:0,s:0,l:0};function ry(i,e,t){return t<0&&(t+=1),t>1&&(t-=1),t<1/6?i+(e-i)*6*t:t<1/2?e:t<2/3?i+(e-i)*6*(2/3-t):i}class tt{constructor(e,t,n){return this.isColor=!0,this.r=1,this.g=1,this.b=1,this.set(e,t,n)}set(e,t,n){if(t===void 0&&n===void 0){const r=e;r&&r.isColor?this.copy(r):typeof r=="number"?this.setHex(r):typeof r=="string"&&this.setStyle(r)}else this.setRGB(e,t,n);return this}setScalar(e){return this.r=e,this.g=e,this.b=e,this}setHex(e,t=Nr){return e=Math.floor(e),this.r=(e>>16&255)/255,this.g=(e>>8&255)/255,this.b=(e&255)/255,gn.toWorkingColorSpace(this,t),this}setRGB(e,t,n,r=gn.workingColorSpace){return this.r=e,this.g=t,this.b=n,gn.toWorkingColorSpace(this,r),this}setHSL(e,t,n,r=gn.workingColorSpace){if(e=$_(e,1),t=Xt(t,0,1),n=Xt(n,0,1),t===0)this.r=this.g=this.b=n;else{const s=n<=.5?n*(1+t):n+t-n*t,a=2*n-s;this.r=ry(a,s,e+1/3),this.g=ry(a,s,e),this.b=ry(a,s,e-1/3)}return gn.toWorkingColorSpace(this,r),this}setStyle(e,t=Nr){function n(s){s!==void 0&&parseFloat(s)<1&&console.warn("THREE.Color: Alpha component of "+e+" will be ignored.")}let r;if(r=/^(\w+)\(([^\)]*)\)/.exec(e)){let s;const a=r[1],u=r[2];switch(a){case"rgb":case"rgba":if(s=/^\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec(u))return n(s[4]),this.setRGB(Math.min(255,parseInt(s[1],10))/255,Math.min(255,parseInt(s[2],10))/255,Math.min(255,parseInt(s[3],10))/255,t);if(s=/^\s*(\d+)\%\s*,\s*(\d+)\%\s*,\s*(\d+)\%\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec(u))return n(s[4]),this.setRGB(Math.min(100,parseInt(s[1],10))/100,Math.min(100,parseInt(s[2],10))/100,Math.min(100,parseInt(s[3],10))/100,t);break;case"hsl":case"hsla":if(s=/^\s*(\d*\.?\d+)\s*,\s*(\d*\.?\d+)\%\s*,\s*(\d*\.?\d+)\%\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec(u))return n(s[4]),this.setHSL(parseFloat(s[1])/360,parseFloat(s[2])/100,parseFloat(s[3])/100,t);break;default:console.warn("THREE.Color: Unknown color model "+e)}}else if(r=/^\#([A-Fa-f\d]+)$/.exec(e)){const s=r[1],a=s.length;if(a===3)return this.setRGB(parseInt(s.charAt(0),16)/15,parseInt(s.charAt(1),16)/15,parseInt(s.charAt(2),16)/15,t);if(a===6)return this.setHex(parseInt(s,16),t);console.warn("THREE.Color: Invalid hex color "+e)}else if(e&&e.length>0)return this.setColorName(e,t);return this}setColorName(e,t=Nr){const n=PM[e.toLowerCase()];return n!==void 0?this.setHex(n,t):console.warn("THREE.Color: Unknown color "+e),this}clone(){return new this.constructor(this.r,this.g,this.b)}copy(e){return this.r=e.r,this.g=e.g,this.b=e.b,this}copySRGBToLinear(e){return this.r=Ea(e.r),this.g=Ea(e.g),this.b=Ea(e.b),this}copyLinearToSRGB(e){return this.r=Vf(e.r),this.g=Vf(e.g),this.b=Vf(e.b),this}convertSRGBToLinear(){return this.copySRGBToLinear(this),this}convertLinearToSRGB(){return this.copyLinearToSRGB(this),this}getHex(e=Nr){return gn.fromWorkingColorSpace(nr.copy(this),e),Math.round(Xt(nr.r*255,0,255))*65536+Math.round(Xt(nr.g*255,0,255))*256+Math.round(Xt(nr.b*255,0,255))}getHexString(e=Nr){return("000000"+this.getHex(e).toString(16)).slice(-6)}getHSL(e,t=gn.workingColorSpace){gn.fromWorkingColorSpace(nr.copy(this),t);const n=nr.r,r=nr.g,s=nr.b,a=Math.max(n,r,s),u=Math.min(n,r,s);let d,h;const m=(u+a)/2;if(u===a)d=0,h=0;else{const g=a-u;switch(h=m<=.5?g/(a+u):g/(2-a-u),a){case n:d=(r-s)/g+(r<s?6:0);break;case r:d=(s-n)/g+2;break;case s:d=(n-r)/g+4;break}d/=6}return e.h=d,e.s=h,e.l=m,e}getRGB(e,t=gn.workingColorSpace){return gn.fromWorkingColorSpace(nr.copy(this),t),e.r=nr.r,e.g=nr.g,e.b=nr.b,e}getStyle(e=Nr){gn.fromWorkingColorSpace(nr.copy(this),e);const t=nr.r,n=nr.g,r=nr.b;return e!==Nr?`color(${e} ${t.toFixed(3)} ${n.toFixed(3)} ${r.toFixed(3)})`:`rgb(${Math.round(t*255)},${Math.round(n*255)},${Math.round(r*255)})`}offsetHSL(e,t,n){return this.getHSL(pl),this.setHSL(pl.h+e,pl.s+t,pl.l+n)}add(e){return this.r+=e.r,this.g+=e.g,this.b+=e.b,this}addColors(e,t){return this.r=e.r+t.r,this.g=e.g+t.g,this.b=e.b+t.b,this}addScalar(e){return this.r+=e,this.g+=e,this.b+=e,this}sub(e){return this.r=Math.max(0,this.r-e.r),this.g=Math.max(0,this.g-e.g),this.b=Math.max(0,this.b-e.b),this}multiply(e){return this.r*=e.r,this.g*=e.g,this.b*=e.b,this}multiplyScalar(e){return this.r*=e,this.g*=e,this.b*=e,this}lerp(e,t){return this.r+=(e.r-this.r)*t,this.g+=(e.g-this.g)*t,this.b+=(e.b-this.b)*t,this}lerpColors(e,t,n){return this.r=e.r+(t.r-e.r)*n,this.g=e.g+(t.g-e.g)*n,this.b=e.b+(t.b-e.b)*n,this}lerpHSL(e,t){this.getHSL(pl),e.getHSL(Em);const n=Lh(pl.h,Em.h,t),r=Lh(pl.s,Em.s,t),s=Lh(pl.l,Em.l,t);return this.setHSL(n,r,s),this}setFromVector3(e){return this.r=e.x,this.g=e.y,this.b=e.z,this}applyMatrix3(e){const t=this.r,n=this.g,r=this.b,s=e.elements;return this.r=s[0]*t+s[3]*n+s[6]*r,this.g=s[1]*t+s[4]*n+s[7]*r,this.b=s[2]*t+s[5]*n+s[8]*r,this}equals(e){return e.r===this.r&&e.g===this.g&&e.b===this.b}fromArray(e,t=0){return this.r=e[t],this.g=e[t+1],this.b=e[t+2],this}toArray(e=[],t=0){return e[t]=this.r,e[t+1]=this.g,e[t+2]=this.b,e}fromBufferAttribute(e,t){return this.r=e.getX(t),this.g=e.getY(t),this.b=e.getZ(t),this}toJSON(){return this.getHex()}*[Symbol.iterator](){yield this.r,yield this.g,yield this.b}}const nr=new tt;tt.NAMES=PM;let i3=0;class Ei extends Io{constructor(){super(),this.isMaterial=!0,Object.defineProperty(this,"id",{value:i3++}),this.uuid=ts(),this.name="",this.type="Material",this.blending=Vu,this.side=To,this.vertexColors=!1,this.opacity=1,this.transparent=!1,this.alphaHash=!1,this.blendSrc=Cg,this.blendDst=Tg,this.blendEquation=_l,this.blendSrcAlpha=null,this.blendDstAlpha=null,this.blendEquationAlpha=null,this.blendColor=new tt(0,0,0),this.blendAlpha=0,this.depthFunc=Ku,this.depthTest=!0,this.depthWrite=!0,this.stencilWriteMask=255,this.stencilFunc=f_,this.stencilRef=0,this.stencilFuncMask=255,this.stencilFail=Bu,this.stencilZFail=Bu,this.stencilZPass=Bu,this.stencilWrite=!1,this.clippingPlanes=null,this.clipIntersection=!1,this.clipShadows=!1,this.shadowSide=null,this.colorWrite=!0,this.precision=null,this.polygonOffset=!1,this.polygonOffsetFactor=0,this.polygonOffsetUnits=0,this.dithering=!1,this.alphaToCoverage=!1,this.premultipliedAlpha=!1,this.forceSinglePass=!1,this.visible=!0,this.toneMapped=!0,this.userData={},this.version=0,this._alphaTest=0}get alphaTest(){return this._alphaTest}set alphaTest(e){this._alphaTest>0!=e>0&&this.version++,this._alphaTest=e}onBeforeRender(){}onBeforeCompile(){}customProgramCacheKey(){return this.onBeforeCompile.toString()}setValues(e){if(e!==void 0)for(const t in e){const n=e[t];if(n===void 0){console.warn(`THREE.Material: parameter '${t}' has value of undefined.`);continue}const r=this[t];if(r===void 0){console.warn(`THREE.Material: '${t}' is not a property of THREE.${this.type}.`);continue}r&&r.isColor?r.set(n):r&&r.isVector3&&n&&n.isVector3?r.copy(n):this[t]=n}}toJSON(e){const t=e===void 0||typeof e=="string";t&&(e={textures:{},images:{}});const n={metadata:{version:4.6,type:"Material",generator:"Material.toJSON"}};n.uuid=this.uuid,n.type=this.type,this.name!==""&&(n.name=this.name),this.color&&this.color.isColor&&(n.color=this.color.getHex()),this.roughness!==void 0&&(n.roughness=this.roughness),this.metalness!==void 0&&(n.metalness=this.metalness),this.sheen!==void 0&&(n.sheen=this.sheen),this.sheenColor&&this.sheenColor.isColor&&(n.sheenColor=this.sheenColor.getHex()),this.sheenRoughness!==void 0&&(n.sheenRoughness=this.sheenRoughness),this.emissive&&this.emissive.isColor&&(n.emissive=this.emissive.getHex()),this.emissiveIntensity!==void 0&&this.emissiveIntensity!==1&&(n.emissiveIntensity=this.emissiveIntensity),this.specular&&this.specular.isColor&&(n.specular=this.specular.getHex()),this.specularIntensity!==void 0&&(n.specularIntensity=this.specularIntensity),this.specularColor&&this.specularColor.isColor&&(n.specularColor=this.specularColor.getHex()),this.shininess!==void 0&&(n.shininess=this.shininess),this.clearcoat!==void 0&&(n.clearcoat=this.clearcoat),this.clearcoatRoughness!==void 0&&(n.clearcoatRoughness=this.clearcoatRoughness),this.clearcoatMap&&this.clearcoatMap.isTexture&&(n.clearcoatMap=this.clearcoatMap.toJSON(e).uuid),this.clearcoatRoughnessMap&&this.clearcoatRoughnessMap.isTexture&&(n.clearcoatRoughnessMap=this.clearcoatRoughnessMap.toJSON(e).uuid),this.clearcoatNormalMap&&this.clearcoatNormalMap.isTexture&&(n.clearcoatNormalMap=this.clearcoatNormalMap.toJSON(e).uuid,n.clearcoatNormalScale=this.clearcoatNormalScale.toArray()),this.dispersion!==void 0&&(n.dispersion=this.dispersion),this.iridescence!==void 0&&(n.iridescence=this.iridescence),this.iridescenceIOR!==void 0&&(n.iridescenceIOR=this.iridescenceIOR),this.iridescenceThicknessRange!==void 0&&(n.iridescenceThicknessRange=this.iridescenceThicknessRange),this.iridescenceMap&&this.iridescenceMap.isTexture&&(n.iridescenceMap=this.iridescenceMap.toJSON(e).uuid),this.iridescenceThicknessMap&&this.iridescenceThicknessMap.isTexture&&(n.iridescenceThicknessMap=this.iridescenceThicknessMap.toJSON(e).uuid),this.anisotropy!==void 0&&(n.anisotropy=this.anisotropy),this.anisotropyRotation!==void 0&&(n.anisotropyRotation=this.anisotropyRotation),this.anisotropyMap&&this.anisotropyMap.isTexture&&(n.anisotropyMap=this.anisotropyMap.toJSON(e).uuid),this.map&&this.map.isTexture&&(n.map=this.map.toJSON(e).uuid),this.matcap&&this.matcap.isTexture&&(n.matcap=this.matcap.toJSON(e).uuid),this.alphaMap&&this.alphaMap.isTexture&&(n.alphaMap=this.alphaMap.toJSON(e).uuid),this.lightMap&&this.lightMap.isTexture&&(n.lightMap=this.lightMap.toJSON(e).uuid,n.lightMapIntensity=this.lightMapIntensity),this.aoMap&&this.aoMap.isTexture&&(n.aoMap=this.aoMap.toJSON(e).uuid,n.aoMapIntensity=this.aoMapIntensity),this.bumpMap&&this.bumpMap.isTexture&&(n.bumpMap=this.bumpMap.toJSON(e).uuid,n.bumpScale=this.bumpScale),this.normalMap&&this.normalMap.isTexture&&(n.normalMap=this.normalMap.toJSON(e).uuid,n.normalMapType=this.normalMapType,n.normalScale=this.normalScale.toArray()),this.displacementMap&&this.displacementMap.isTexture&&(n.displacementMap=this.displacementMap.toJSON(e).uuid,n.displacementScale=this.displacementScale,n.displacementBias=this.displacementBias),this.roughnessMap&&this.roughnessMap.isTexture&&(n.roughnessMap=this.roughnessMap.toJSON(e).uuid),this.metalnessMap&&this.metalnessMap.isTexture&&(n.metalnessMap=this.metalnessMap.toJSON(e).uuid),this.emissiveMap&&this.emissiveMap.isTexture&&(n.emissiveMap=this.emissiveMap.toJSON(e).uuid),this.specularMap&&this.specularMap.isTexture&&(n.specularMap=this.specularMap.toJSON(e).uuid),this.specularIntensityMap&&this.specularIntensityMap.isTexture&&(n.specularIntensityMap=this.specularIntensityMap.toJSON(e).uuid),this.specularColorMap&&this.specularColorMap.isTexture&&(n.specularColorMap=this.specularColorMap.toJSON(e).uuid),this.envMap&&this.envMap.isTexture&&(n.envMap=this.envMap.toJSON(e).uuid,this.combine!==void 0&&(n.combine=this.combine)),this.envMapRotation!==void 0&&(n.envMapRotation=this.envMapRotation.toArray()),this.envMapIntensity!==void 0&&(n.envMapIntensity=this.envMapIntensity),this.reflectivity!==void 0&&(n.reflectivity=this.reflectivity),this.refractionRatio!==void 0&&(n.refractionRatio=this.refractionRatio),this.gradientMap&&this.gradientMap.isTexture&&(n.gradientMap=this.gradientMap.toJSON(e).uuid),this.transmission!==void 0&&(n.transmission=this.transmission),this.transmissionMap&&this.transmissionMap.isTexture&&(n.transmissionMap=this.transmissionMap.toJSON(e).uuid),this.thickness!==void 0&&(n.thickness=this.thickness),this.thicknessMap&&this.thicknessMap.isTexture&&(n.thicknessMap=this.thicknessMap.toJSON(e).uuid),this.attenuationDistance!==void 0&&this.attenuationDistance!==1/0&&(n.attenuationDistance=this.attenuationDistance),this.attenuationColor!==void 0&&(n.attenuationColor=this.attenuationColor.getHex()),this.size!==void 0&&(n.size=this.size),this.shadowSide!==null&&(n.shadowSide=this.shadowSide),this.sizeAttenuation!==void 0&&(n.sizeAttenuation=this.sizeAttenuation),this.blending!==Vu&&(n.blending=this.blending),this.side!==To&&(n.side=this.side),this.vertexColors===!0&&(n.vertexColors=!0),this.opacity<1&&(n.opacity=this.opacity),this.transparent===!0&&(n.transparent=!0),this.blendSrc!==Cg&&(n.blendSrc=this.blendSrc),this.blendDst!==Tg&&(n.blendDst=this.blendDst),this.blendEquation!==_l&&(n.blendEquation=this.blendEquation),this.blendSrcAlpha!==null&&(n.blendSrcAlpha=this.blendSrcAlpha),this.blendDstAlpha!==null&&(n.blendDstAlpha=this.blendDstAlpha),this.blendEquationAlpha!==null&&(n.blendEquationAlpha=this.blendEquationAlpha),this.blendColor&&this.blendColor.isColor&&(n.blendColor=this.blendColor.getHex()),this.blendAlpha!==0&&(n.blendAlpha=this.blendAlpha),this.depthFunc!==Ku&&(n.depthFunc=this.depthFunc),this.depthTest===!1&&(n.depthTest=this.depthTest),this.depthWrite===!1&&(n.depthWrite=this.depthWrite),this.colorWrite===!1&&(n.colorWrite=this.colorWrite),this.stencilWriteMask!==255&&(n.stencilWriteMask=this.stencilWriteMask),this.stencilFunc!==f_&&(n.stencilFunc=this.stencilFunc),this.stencilRef!==0&&(n.stencilRef=this.stencilRef),this.stencilFuncMask!==255&&(n.stencilFuncMask=this.stencilFuncMask),this.stencilFail!==Bu&&(n.stencilFail=this.stencilFail),this.stencilZFail!==Bu&&(n.stencilZFail=this.stencilZFail),this.stencilZPass!==Bu&&(n.stencilZPass=this.stencilZPass),this.stencilWrite===!0&&(n.stencilWrite=this.stencilWrite),this.rotation!==void 0&&this.rotation!==0&&(n.rotation=this.rotation),this.polygonOffset===!0&&(n.polygonOffset=!0),this.polygonOffsetFactor!==0&&(n.polygonOffsetFactor=this.polygonOffsetFactor),this.polygonOffsetUnits!==0&&(n.polygonOffsetUnits=this.polygonOffsetUnits),this.linewidth!==void 0&&this.linewidth!==1&&(n.linewidth=this.linewidth),this.dashSize!==void 0&&(n.dashSize=this.dashSize),this.gapSize!==void 0&&(n.gapSize=this.gapSize),this.scale!==void 0&&(n.scale=this.scale),this.dithering===!0&&(n.dithering=!0),this.alphaTest>0&&(n.alphaTest=this.alphaTest),this.alphaHash===!0&&(n.alphaHash=!0),this.alphaToCoverage===!0&&(n.alphaToCoverage=!0),this.premultipliedAlpha===!0&&(n.premultipliedAlpha=!0),this.forceSinglePass===!0&&(n.forceSinglePass=!0),this.wireframe===!0&&(n.wireframe=!0),this.wireframeLinewidth>1&&(n.wireframeLinewidth=this.wireframeLinewidth),this.wireframeLinecap!=="round"&&(n.wireframeLinecap=this.wireframeLinecap),this.wireframeLinejoin!=="round"&&(n.wireframeLinejoin=this.wireframeLinejoin),this.flatShading===!0&&(n.flatShading=!0),this.visible===!1&&(n.visible=!1),this.toneMapped===!1&&(n.toneMapped=!1),this.fog===!1&&(n.fog=!1),Object.keys(this.userData).length>0&&(n.userData=this.userData);function r(s){const a=[];for(const u in s){const d=s[u];delete d.metadata,a.push(d)}return a}if(t){const s=r(e.textures),a=r(e.images);s.length>0&&(n.textures=s),a.length>0&&(n.images=a)}return n}clone(){return new this.constructor().copy(this)}copy(e){this.name=e.name,this.blending=e.blending,this.side=e.side,this.vertexColors=e.vertexColors,this.opacity=e.opacity,this.transparent=e.transparent,this.blendSrc=e.blendSrc,this.blendDst=e.blendDst,this.blendEquation=e.blendEquation,this.blendSrcAlpha=e.blendSrcAlpha,this.blendDstAlpha=e.blendDstAlpha,this.blendEquationAlpha=e.blendEquationAlpha,this.blendColor.copy(e.blendColor),this.blendAlpha=e.blendAlpha,this.depthFunc=e.depthFunc,this.depthTest=e.depthTest,this.depthWrite=e.depthWrite,this.stencilWriteMask=e.stencilWriteMask,this.stencilFunc=e.stencilFunc,this.stencilRef=e.stencilRef,this.stencilFuncMask=e.stencilFuncMask,this.stencilFail=e.stencilFail,this.stencilZFail=e.stencilZFail,this.stencilZPass=e.stencilZPass,this.stencilWrite=e.stencilWrite;const t=e.clippingPlanes;let n=null;if(t!==null){const r=t.length;n=new Array(r);for(let s=0;s!==r;++s)n[s]=t[s].clone()}return this.clippingPlanes=n,this.clipIntersection=e.clipIntersection,this.clipShadows=e.clipShadows,this.shadowSide=e.shadowSide,this.colorWrite=e.colorWrite,this.precision=e.precision,this.polygonOffset=e.polygonOffset,this.polygonOffsetFactor=e.polygonOffsetFactor,this.polygonOffsetUnits=e.polygonOffsetUnits,this.dithering=e.dithering,this.alphaTest=e.alphaTest,this.alphaHash=e.alphaHash,this.alphaToCoverage=e.alphaToCoverage,this.premultipliedAlpha=e.premultipliedAlpha,this.forceSinglePass=e.forceSinglePass,this.visible=e.visible,this.toneMapped=e.toneMapped,this.userData=JSON.parse(JSON.stringify(e.userData)),this}dispose(){this.dispatchEvent({type:"dispose"})}set needsUpdate(e){e===!0&&this.version++}onBuild(){console.warn("Material: onBuild() has been removed.")}}class es extends Ei{constructor(e){super(),this.isMeshBasicMaterial=!0,this.type="MeshBasicMaterial",this.color=new tt(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 ns,this.combine=rp,this.reflectivity=1,this.refractionRatio=.98,this.wireframe=!1,this.wireframeLinewidth=1,this.wireframeLinecap="round",this.wireframeLinejoin="round",this.fog=!0,this.setValues(e)}copy(e){return super.copy(e),this.color.copy(e.color),this.map=e.map,this.lightMap=e.lightMap,this.lightMapIntensity=e.lightMapIntensity,this.aoMap=e.aoMap,this.aoMapIntensity=e.aoMapIntensity,this.specularMap=e.specularMap,this.alphaMap=e.alphaMap,this.envMap=e.envMap,this.envMapRotation.copy(e.envMapRotation),this.combine=e.combine,this.reflectivity=e.reflectivity,this.refractionRatio=e.refractionRatio,this.wireframe=e.wireframe,this.wireframeLinewidth=e.wireframeLinewidth,this.wireframeLinecap=e.wireframeLinecap,this.wireframeLinejoin=e.wireframeLinejoin,this.fog=e.fog,this}}const _a=r3();function r3(){const i=new ArrayBuffer(4),e=new Float32Array(i),t=new Uint32Array(i),n=new Uint32Array(512),r=new Uint32Array(512);for(let d=0;d<256;++d){const h=d-127;h<-27?(n[d]=0,n[d|256]=32768,r[d]=24,r[d|256]=24):h<-14?(n[d]=1024>>-h-14,n[d|256]=1024>>-h-14|32768,r[d]=-h-1,r[d|256]=-h-1):h<=15?(n[d]=h+15<<10,n[d|256]=h+15<<10|32768,r[d]=13,r[d|256]=13):h<128?(n[d]=31744,n[d|256]=64512,r[d]=24,r[d|256]=24):(n[d]=31744,n[d|256]=64512,r[d]=13,r[d|256]=13)}const s=new Uint32Array(2048),a=new Uint32Array(64),u=new Uint32Array(64);for(let d=1;d<1024;++d){let h=d<<13,m=0;for(;!(h&8388608);)h<<=1,m-=8388608;h&=-8388609,m+=947912704,s[d]=h|m}for(let d=1024;d<2048;++d)s[d]=939524096+(d-1024<<13);for(let d=1;d<31;++d)a[d]=d<<23;a[31]=1199570944,a[32]=2147483648;for(let d=33;d<63;++d)a[d]=2147483648+(d-32<<23);a[63]=3347054592;for(let d=1;d<64;++d)d!==32&&(u[d]=1024);return{floatView:e,uint32View:t,baseTable:n,shiftTable:r,mantissaTable:s,exponentTable:a,offsetTable:u}}function Fr(i){Math.abs(i)>65504&&console.warn("THREE.DataUtils.toHalfFloat(): Value out of range."),i=Xt(i,-65504,65504),_a.floatView[0]=i;const e=_a.uint32View[0],t=e>>23&511;return _a.baseTable[t]+((e&8388607)>>_a.shiftTable[t])}function wh(i){const e=i>>10;return _a.uint32View[0]=_a.mantissaTable[_a.offsetTable[e]+(i&1023)]+_a.exponentTable[e],_a.floatView[0]}const s3={toHalfFloat:Fr,fromHalfFloat:wh},pi=new X,wm=new Le;let o3=0;class xn{constructor(e,t,n=!1){if(Array.isArray(e))throw new TypeError("THREE.BufferAttribute: array should be a Typed Array.");this.isBufferAttribute=!0,Object.defineProperty(this,"id",{value:o3++}),this.name="",this.array=e,this.itemSize=t,this.count=e!==void 0?e.length/t:0,this.normalized=n,this.usage=Gh,this.updateRanges=[],this.gpuType=Or,this.version=0}onUploadCallback(){}set needsUpdate(e){e===!0&&this.version++}setUsage(e){return this.usage=e,this}addUpdateRange(e,t){this.updateRanges.push({start:e,count:t})}clearUpdateRanges(){this.updateRanges.length=0}copy(e){return this.name=e.name,this.array=new e.array.constructor(e.array),this.itemSize=e.itemSize,this.count=e.count,this.normalized=e.normalized,this.usage=e.usage,this.gpuType=e.gpuType,this}copyAt(e,t,n){e*=this.itemSize,n*=t.itemSize;for(let r=0,s=this.itemSize;r<s;r++)this.array[e+r]=t.array[n+r];return this}copyArray(e){return this.array.set(e),this}applyMatrix3(e){if(this.itemSize===2)for(let t=0,n=this.count;t<n;t++)wm.fromBufferAttribute(this,t),wm.applyMatrix3(e),this.setXY(t,wm.x,wm.y);else if(this.itemSize===3)for(let t=0,n=this.count;t<n;t++)pi.fromBufferAttribute(this,t),pi.applyMatrix3(e),this.setXYZ(t,pi.x,pi.y,pi.z);return this}applyMatrix4(e){for(let t=0,n=this.count;t<n;t++)pi.fromBufferAttribute(this,t),pi.applyMatrix4(e),this.setXYZ(t,pi.x,pi.y,pi.z);return this}applyNormalMatrix(e){for(let t=0,n=this.count;t<n;t++)pi.fromBufferAttribute(this,t),pi.applyNormalMatrix(e),this.setXYZ(t,pi.x,pi.y,pi.z);return this}transformDirection(e){for(let t=0,n=this.count;t<n;t++)pi.fromBufferAttribute(this,t),pi.transformDirection(e),this.setXYZ(t,pi.x,pi.y,pi.z);return this}set(e,t=0){return this.array.set(e,t),this}getComponent(e,t){let n=this.array[e*this.itemSize+t];return this.normalized&&(n=xr(n,this.array)),n}setComponent(e,t,n){return this.normalized&&(n=Zt(n,this.array)),this.array[e*this.itemSize+t]=n,this}getX(e){let t=this.array[e*this.itemSize];return this.normalized&&(t=xr(t,this.array)),t}setX(e,t){return this.normalized&&(t=Zt(t,this.array)),this.array[e*this.itemSize]=t,this}getY(e){let t=this.array[e*this.itemSize+1];return this.normalized&&(t=xr(t,this.array)),t}setY(e,t){return this.normalized&&(t=Zt(t,this.array)),this.array[e*this.itemSize+1]=t,this}getZ(e){let t=this.array[e*this.itemSize+2];return this.normalized&&(t=xr(t,this.array)),t}setZ(e,t){return this.normalized&&(t=Zt(t,this.array)),this.array[e*this.itemSize+2]=t,this}getW(e){let t=this.array[e*this.itemSize+3];return this.normalized&&(t=xr(t,this.array)),t}setW(e,t){return this.normalized&&(t=Zt(t,this.array)),this.array[e*this.itemSize+3]=t,this}setXY(e,t,n){return e*=this.itemSize,this.normalized&&(t=Zt(t,this.array),n=Zt(n,this.array)),this.array[e+0]=t,this.array[e+1]=n,this}setXYZ(e,t,n,r){return e*=this.itemSize,this.normalized&&(t=Zt(t,this.array),n=Zt(n,this.array),r=Zt(r,this.array)),this.array[e+0]=t,this.array[e+1]=n,this.array[e+2]=r,this}setXYZW(e,t,n,r,s){return e*=this.itemSize,this.normalized&&(t=Zt(t,this.array),n=Zt(n,this.array),r=Zt(r,this.array),s=Zt(s,this.array)),this.array[e+0]=t,this.array[e+1]=n,this.array[e+2]=r,this.array[e+3]=s,this}onUpload(e){return this.onUploadCallback=e,this}clone(){return new this.constructor(this.array,this.itemSize).copy(this)}toJSON(){const e={itemSize:this.itemSize,type:this.array.constructor.name,array:Array.from(this.array),normalized:this.normalized};return this.name!==""&&(e.name=this.name),this.usage!==Gh&&(e.usage=this.usage),e}}class a3 extends xn{constructor(e,t,n){super(new Int8Array(e),t,n)}}class l3 extends xn{constructor(e,t,n){super(new Uint8Array(e),t,n)}}class u3 extends xn{constructor(e,t,n){super(new Uint8ClampedArray(e),t,n)}}class c3 extends xn{constructor(e,t,n){super(new Int16Array(e),t,n)}}class ex extends xn{constructor(e,t,n){super(new Uint16Array(e),t,n)}}class f3 extends xn{constructor(e,t,n){super(new Int32Array(e),t,n)}}class tx extends xn{constructor(e,t,n){super(new Uint32Array(e),t,n)}}class d3 extends xn{constructor(e,t,n){super(new Uint16Array(e),t,n),this.isFloat16BufferAttribute=!0}getX(e){let t=wh(this.array[e*this.itemSize]);return this.normalized&&(t=xr(t,this.array)),t}setX(e,t){return this.normalized&&(t=Zt(t,this.array)),this.array[e*this.itemSize]=Fr(t),this}getY(e){let t=wh(this.array[e*this.itemSize+1]);return this.normalized&&(t=xr(t,this.array)),t}setY(e,t){return this.normalized&&(t=Zt(t,this.array)),this.array[e*this.itemSize+1]=Fr(t),this}getZ(e){let t=wh(this.array[e*this.itemSize+2]);return this.normalized&&(t=xr(t,this.array)),t}setZ(e,t){return this.normalized&&(t=Zt(t,this.array)),this.array[e*this.itemSize+2]=Fr(t),this}getW(e){let t=wh(this.array[e*this.itemSize+3]);return this.normalized&&(t=xr(t,this.array)),t}setW(e,t){return this.normalized&&(t=Zt(t,this.array)),this.array[e*this.itemSize+3]=Fr(t),this}setXY(e,t,n){return e*=this.itemSize,this.normalized&&(t=Zt(t,this.array),n=Zt(n,this.array)),this.array[e+0]=Fr(t),this.array[e+1]=Fr(n),this}setXYZ(e,t,n,r){return e*=this.itemSize,this.normalized&&(t=Zt(t,this.array),n=Zt(n,this.array),r=Zt(r,this.array)),this.array[e+0]=Fr(t),this.array[e+1]=Fr(n),this.array[e+2]=Fr(r),this}setXYZW(e,t,n,r,s){return e*=this.itemSize,this.normalized&&(t=Zt(t,this.array),n=Zt(n,this.array),r=Zt(r,this.array),s=Zt(s,this.array)),this.array[e+0]=Fr(t),this.array[e+1]=Fr(n),this.array[e+2]=Fr(r),this.array[e+3]=Fr(s),this}}class Tt extends xn{constructor(e,t,n){super(new Float32Array(e),t,n)}}let h3=0;const vs=new Ot,sy=new fn,Mf=new X,Zr=new sr,ch=new sr,Li=new X;class Kt extends Io{constructor(){super(),this.isBufferGeometry=!0,Object.defineProperty(this,"id",{value:h3++}),this.uuid=ts(),this.name="",this.type="BufferGeometry",this.index=null,this.indirect=null,this.attributes={},this.morphAttributes={},this.morphTargetsRelative=!1,this.groups=[],this.boundingBox=null,this.boundingSphere=null,this.drawRange={start:0,count:1/0},this.userData={}}getIndex(){return this.index}setIndex(e){return Array.isArray(e)?this.index=new(bM(e)?tx:ex)(e,1):this.index=e,this}setIndirect(e){return this.indirect=e,this}getIndirect(){return this.indirect}getAttribute(e){return this.attributes[e]}setAttribute(e,t){return this.attributes[e]=t,this}deleteAttribute(e){return delete this.attributes[e],this}hasAttribute(e){return this.attributes[e]!==void 0}addGroup(e,t,n=0){this.groups.push({start:e,count:t,materialIndex:n})}clearGroups(){this.groups=[]}setDrawRange(e,t){this.drawRange.start=e,this.drawRange.count=t}applyMatrix4(e){const t=this.attributes.position;t!==void 0&&(t.applyMatrix4(e),t.needsUpdate=!0);const n=this.attributes.normal;if(n!==void 0){const s=new Jt().getNormalMatrix(e);n.applyNormalMatrix(s),n.needsUpdate=!0}const r=this.attributes.tangent;return r!==void 0&&(r.transformDirection(e),r.needsUpdate=!0),this.boundingBox!==null&&this.computeBoundingBox(),this.boundingSphere!==null&&this.computeBoundingSphere(),this}applyQuaternion(e){return vs.makeRotationFromQuaternion(e),this.applyMatrix4(vs),this}rotateX(e){return vs.makeRotationX(e),this.applyMatrix4(vs),this}rotateY(e){return vs.makeRotationY(e),this.applyMatrix4(vs),this}rotateZ(e){return vs.makeRotationZ(e),this.applyMatrix4(vs),this}translate(e,t,n){return vs.makeTranslation(e,t,n),this.applyMatrix4(vs),this}scale(e,t,n){return vs.makeScale(e,t,n),this.applyMatrix4(vs),this}lookAt(e){return sy.lookAt(e),sy.updateMatrix(),this.applyMatrix4(sy.matrix),this}center(){return this.computeBoundingBox(),this.boundingBox.getCenter(Mf).negate(),this.translate(Mf.x,Mf.y,Mf.z),this}setFromPoints(e){const t=this.getAttribute("position");if(t===void 0){const n=[];for(let r=0,s=e.length;r<s;r++){const a=e[r];n.push(a.x,a.y,a.z||0)}this.setAttribute("position",new Tt(n,3))}else{const n=Math.min(e.length,t.count);for(let r=0;r<n;r++){const s=e[r];t.setXYZ(r,s.x,s.y,s.z||0)}e.length>t.count&&console.warn("THREE.BufferGeometry: Buffer size too small for points data. Use .dispose() and create a new geometry."),t.needsUpdate=!0}return this}computeBoundingBox(){this.boundingBox===null&&(this.boundingBox=new sr);const e=this.attributes.position,t=this.morphAttributes.position;if(e&&e.isGLBufferAttribute){console.error("THREE.BufferGeometry.computeBoundingBox(): GLBufferAttribute requires a manual bounding box.",this),this.boundingBox.set(new X(-1/0,-1/0,-1/0),new X(1/0,1/0,1/0));return}if(e!==void 0){if(this.boundingBox.setFromBufferAttribute(e),t)for(let n=0,r=t.length;n<r;n++){const s=t[n];Zr.setFromBufferAttribute(s),this.morphTargetsRelative?(Li.addVectors(this.boundingBox.min,Zr.min),this.boundingBox.expandByPoint(Li),Li.addVectors(this.boundingBox.max,Zr.max),this.boundingBox.expandByPoint(Li)):(this.boundingBox.expandByPoint(Zr.min),this.boundingBox.expandByPoint(Zr.max))}}else this.boundingBox.makeEmpty();(isNaN(this.boundingBox.min.x)||isNaN(this.boundingBox.min.y)||isNaN(this.boundingBox.min.z))&&console.error('THREE.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 ji);const e=this.attributes.position,t=this.morphAttributes.position;if(e&&e.isGLBufferAttribute){console.error("THREE.BufferGeometry.computeBoundingSphere(): GLBufferAttribute requires a manual bounding sphere.",this),this.boundingSphere.set(new X,1/0);return}if(e){const n=this.boundingSphere.center;if(Zr.setFromBufferAttribute(e),t)for(let s=0,a=t.length;s<a;s++){const u=t[s];ch.setFromBufferAttribute(u),this.morphTargetsRelative?(Li.addVectors(Zr.min,ch.min),Zr.expandByPoint(Li),Li.addVectors(Zr.max,ch.max),Zr.expandByPoint(Li)):(Zr.expandByPoint(ch.min),Zr.expandByPoint(ch.max))}Zr.getCenter(n);let r=0;for(let s=0,a=e.count;s<a;s++)Li.fromBufferAttribute(e,s),r=Math.max(r,n.distanceToSquared(Li));if(t)for(let s=0,a=t.length;s<a;s++){const u=t[s],d=this.morphTargetsRelative;for(let h=0,m=u.count;h<m;h++)Li.fromBufferAttribute(u,h),d&&(Mf.fromBufferAttribute(e,h),Li.add(Mf)),r=Math.max(r,n.distanceToSquared(Li))}this.boundingSphere.radius=Math.sqrt(r),isNaN(this.boundingSphere.radius)&&console.error('THREE.BufferGeometry.computeBoundingSphere(): Computed radius is NaN. The "position" attribute is likely to have NaN values.',this)}}computeTangents(){const e=this.index,t=this.attributes;if(e===null||t.position===void 0||t.normal===void 0||t.uv===void 0){console.error("THREE.BufferGeometry: .computeTangents() failed. Missing required attributes (index, position, normal or uv)");return}const n=t.position,r=t.normal,s=t.uv;this.hasAttribute("tangent")===!1&&this.setAttribute("tangent",new xn(new Float32Array(4*n.count),4));const a=this.getAttribute("tangent"),u=[],d=[];for(let G=0;G<n.count;G++)u[G]=new X,d[G]=new X;const h=new X,m=new X,g=new X,v=new Le,_=new Le,A=new Le,C=new X,M=new X;function S(G,D,L){h.fromBufferAttribute(n,G),m.fromBufferAttribute(n,D),g.fromBufferAttribute(n,L),v.fromBufferAttribute(s,G),_.fromBufferAttribute(s,D),A.fromBufferAttribute(s,L),m.sub(h),g.sub(h),_.sub(v),A.sub(v);const V=1/(_.x*A.y-A.x*_.y);isFinite(V)&&(C.copy(m).multiplyScalar(A.y).addScaledVector(g,-_.y).multiplyScalar(V),M.copy(g).multiplyScalar(_.x).addScaledVector(m,-A.x).multiplyScalar(V),u[G].add(C),u[D].add(C),u[L].add(C),d[G].add(M),d[D].add(M),d[L].add(M))}let b=this.groups;b.length===0&&(b=[{start:0,count:e.count}]);for(let G=0,D=b.length;G<D;++G){const L=b[G],V=L.start,oe=L.count;for(let ie=V,ge=V+oe;ie<ge;ie+=3)S(e.getX(ie+0),e.getX(ie+1),e.getX(ie+2))}const R=new X,P=new X,U=new X,F=new X;function k(G){U.fromBufferAttribute(r,G),F.copy(U);const D=u[G];R.copy(D),R.sub(U.multiplyScalar(U.dot(D))).normalize(),P.crossVectors(F,D);const V=P.dot(d[G])<0?-1:1;a.setXYZW(G,R.x,R.y,R.z,V)}for(let G=0,D=b.length;G<D;++G){const L=b[G],V=L.start,oe=L.count;for(let ie=V,ge=V+oe;ie<ge;ie+=3)k(e.getX(ie+0)),k(e.getX(ie+1)),k(e.getX(ie+2))}}computeVertexNormals(){const e=this.index,t=this.getAttribute("position");if(t!==void 0){let n=this.getAttribute("normal");if(n===void 0)n=new xn(new Float32Array(t.count*3),3),this.setAttribute("normal",n);else for(let v=0,_=n.count;v<_;v++)n.setXYZ(v,0,0,0);const r=new X,s=new X,a=new X,u=new X,d=new X,h=new X,m=new X,g=new X;if(e)for(let v=0,_=e.count;v<_;v+=3){const A=e.getX(v+0),C=e.getX(v+1),M=e.getX(v+2);r.fromBufferAttribute(t,A),s.fromBufferAttribute(t,C),a.fromBufferAttribute(t,M),m.subVectors(a,s),g.subVectors(r,s),m.cross(g),u.fromBufferAttribute(n,A),d.fromBufferAttribute(n,C),h.fromBufferAttribute(n,M),u.add(m),d.add(m),h.add(m),n.setXYZ(A,u.x,u.y,u.z),n.setXYZ(C,d.x,d.y,d.z),n.setXYZ(M,h.x,h.y,h.z)}else for(let v=0,_=t.count;v<_;v+=3)r.fromBufferAttribute(t,v+0),s.fromBufferAttribute(t,v+1),a.fromBufferAttribute(t,v+2),m.subVectors(a,s),g.subVectors(r,s),m.cross(g),n.setXYZ(v+0,m.x,m.y,m.z),n.setXYZ(v+1,m.x,m.y,m.z),n.setXYZ(v+2,m.x,m.y,m.z);this.normalizeNormals(),n.needsUpdate=!0}}normalizeNormals(){const e=this.attributes.normal;for(let t=0,n=e.count;t<n;t++)Li.fromBufferAttribute(e,t),Li.normalize(),e.setXYZ(t,Li.x,Li.y,Li.z)}toNonIndexed(){function e(u,d){const h=u.array,m=u.itemSize,g=u.normalized,v=new h.constructor(d.length*m);let _=0,A=0;for(let C=0,M=d.length;C<M;C++){u.isInterleavedBufferAttribute?_=d[C]*u.data.stride+u.offset:_=d[C]*m;for(let S=0;S<m;S++)v[A++]=h[_++]}return new xn(v,m,g)}if(this.index===null)return console.warn("THREE.BufferGeometry.toNonIndexed(): BufferGeometry is already non-indexed."),this;const t=new Kt,n=this.index.array,r=this.attributes;for(const u in r){const d=r[u],h=e(d,n);t.setAttribute(u,h)}const s=this.morphAttributes;for(const u in s){const d=[],h=s[u];for(let m=0,g=h.length;m<g;m++){const v=h[m],_=e(v,n);d.push(_)}t.morphAttributes[u]=d}t.morphTargetsRelative=this.morphTargetsRelative;const a=this.groups;for(let u=0,d=a.length;u<d;u++){const h=a[u];t.addGroup(h.start,h.count,h.materialIndex)}return t}toJSON(){const e={metadata:{version:4.6,type:"BufferGeometry",generator:"BufferGeometry.toJSON"}};if(e.uuid=this.uuid,e.type=this.type,this.name!==""&&(e.name=this.name),Object.keys(this.userData).length>0&&(e.userData=this.userData),this.parameters!==void 0){const d=this.parameters;for(const h in d)d[h]!==void 0&&(e[h]=d[h]);return e}e.data={attributes:{}};const t=this.index;t!==null&&(e.data.index={type:t.array.constructor.name,array:Array.prototype.slice.call(t.array)});const n=this.attributes;for(const d in n){const h=n[d];e.data.attributes[d]=h.toJSON(e.data)}const r={};let s=!1;for(const d in this.morphAttributes){const h=this.morphAttributes[d],m=[];for(let g=0,v=h.length;g<v;g++){const _=h[g];m.push(_.toJSON(e.data))}m.length>0&&(r[d]=m,s=!0)}s&&(e.data.morphAttributes=r,e.data.morphTargetsRelative=this.morphTargetsRelative);const a=this.groups;a.length>0&&(e.data.groups=JSON.parse(JSON.stringify(a)));const u=this.boundingSphere;return u!==null&&(e.data.boundingSphere={center:u.center.toArray(),radius:u.radius}),e}clone(){return new this.constructor().copy(this)}copy(e){this.index=null,this.attributes={},this.morphAttributes={},this.groups=[],this.boundingBox=null,this.boundingSphere=null;const t={};this.name=e.name;const n=e.index;n!==null&&this.setIndex(n.clone(t));const r=e.attributes;for(const h in r){const m=r[h];this.setAttribute(h,m.clone(t))}const s=e.morphAttributes;for(const h in s){const m=[],g=s[h];for(let v=0,_=g.length;v<_;v++)m.push(g[v].clone(t));this.morphAttributes[h]=m}this.morphTargetsRelative=e.morphTargetsRelative;const a=e.groups;for(let h=0,m=a.length;h<m;h++){const g=a[h];this.addGroup(g.start,g.count,g.materialIndex)}const u=e.boundingBox;u!==null&&(this.boundingBox=u.clone());const d=e.boundingSphere;return d!==null&&(this.boundingSphere=d.clone()),this.drawRange.start=e.drawRange.start,this.drawRange.count=e.drawRange.count,this.userData=e.userData,this}dispose(){this.dispatchEvent({type:"dispose"})}}const iA=new Ot,yu=new rc,Cm=new ji,rA=new X,Tm=new X,bm=new X,Rm=new X,oy=new X,Im=new X,sA=new X,Pm=new X;class si extends fn{constructor(e=new Kt,t=new es){super(),this.isMesh=!0,this.type="Mesh",this.geometry=e,this.material=t,this.updateMorphTargets()}copy(e,t){return super.copy(e,t),e.morphTargetInfluences!==void 0&&(this.morphTargetInfluences=e.morphTargetInfluences.slice()),e.morphTargetDictionary!==void 0&&(this.morphTargetDictionary=Object.assign({},e.morphTargetDictionary)),this.material=Array.isArray(e.material)?e.material.slice():e.material,this.geometry=e.geometry,this}updateMorphTargets(){const t=this.geometry.morphAttributes,n=Object.keys(t);if(n.length>0){const r=t[n[0]];if(r!==void 0){this.morphTargetInfluences=[],this.morphTargetDictionary={};for(let s=0,a=r.length;s<a;s++){const u=r[s].name||String(s);this.morphTargetInfluences.push(0),this.morphTargetDictionary[u]=s}}}}getVertexPosition(e,t){const n=this.geometry,r=n.attributes.position,s=n.morphAttributes.position,a=n.morphTargetsRelative;t.fromBufferAttribute(r,e);const u=this.morphTargetInfluences;if(s&&u){Im.set(0,0,0);for(let d=0,h=s.length;d<h;d++){const m=u[d],g=s[d];m!==0&&(oy.fromBufferAttribute(g,e),a?Im.addScaledVector(oy,m):Im.addScaledVector(oy.sub(t),m))}t.add(Im)}return t}raycast(e,t){const n=this.geometry,r=this.material,s=this.matrixWorld;r!==void 0&&(n.boundingSphere===null&&n.computeBoundingSphere(),Cm.copy(n.boundingSphere),Cm.applyMatrix4(s),yu.copy(e.ray).recast(e.near),!(Cm.containsPoint(yu.origin)===!1&&(yu.intersectSphere(Cm,rA)===null||yu.origin.distanceToSquared(rA)>(e.far-e.near)**2))&&(iA.copy(s).invert(),yu.copy(e.ray).applyMatrix4(iA),!(n.boundingBox!==null&&yu.intersectsBox(n.boundingBox)===!1)&&this._computeIntersections(e,t,yu)))}_computeIntersections(e,t,n){let r;const s=this.geometry,a=this.material,u=s.index,d=s.attributes.position,h=s.attributes.uv,m=s.attributes.uv1,g=s.attributes.normal,v=s.groups,_=s.drawRange;if(u!==null)if(Array.isArray(a))for(let A=0,C=v.length;A<C;A++){const M=v[A],S=a[M.materialIndex],b=Math.max(M.start,_.start),R=Math.min(u.count,Math.min(M.start+M.count,_.start+_.count));for(let P=b,U=R;P<U;P+=3){const F=u.getX(P),k=u.getX(P+1),G=u.getX(P+2);r=Bm(this,S,e,n,h,m,g,F,k,G),r&&(r.faceIndex=Math.floor(P/3),r.face.materialIndex=M.materialIndex,t.push(r))}}else{const A=Math.max(0,_.start),C=Math.min(u.count,_.start+_.count);for(let M=A,S=C;M<S;M+=3){const b=u.getX(M),R=u.getX(M+1),P=u.getX(M+2);r=Bm(this,a,e,n,h,m,g,b,R,P),r&&(r.faceIndex=Math.floor(M/3),t.push(r))}}else if(d!==void 0)if(Array.isArray(a))for(let A=0,C=v.length;A<C;A++){const M=v[A],S=a[M.materialIndex],b=Math.max(M.start,_.start),R=Math.min(d.count,Math.min(M.start+M.count,_.start+_.count));for(let P=b,U=R;P<U;P+=3){const F=P,k=P+1,G=P+2;r=Bm(this,S,e,n,h,m,g,F,k,G),r&&(r.faceIndex=Math.floor(P/3),r.face.materialIndex=M.materialIndex,t.push(r))}}else{const A=Math.max(0,_.start),C=Math.min(d.count,_.start+_.count);for(let M=A,S=C;M<S;M+=3){const b=M,R=M+1,P=M+2;r=Bm(this,a,e,n,h,m,g,b,R,P),r&&(r.faceIndex=Math.floor(M/3),t.push(r))}}}}function p3(i,e,t,n,r,s,a,u){let d;if(e.side===Ar?d=n.intersectTriangle(a,s,r,!0,u):d=n.intersectTriangle(r,s,a,e.side===To,u),d===null)return null;Pm.copy(u),Pm.applyMatrix4(i.matrixWorld);const h=t.ray.origin.distanceTo(Pm);return h<t.near||h>t.far?null:{distance:h,point:Pm.clone(),object:i}}function Bm(i,e,t,n,r,s,a,u,d,h){i.getVertexPosition(u,Tm),i.getVertexPosition(d,bm),i.getVertexPosition(h,Rm);const m=p3(i,e,t,n,Tm,bm,Rm,sA);if(m){const g=new X;Ur.getBarycoord(sA,Tm,bm,Rm,g),r&&(m.uv=Ur.getInterpolatedAttribute(r,u,d,h,g,new Le)),s&&(m.uv1=Ur.getInterpolatedAttribute(s,u,d,h,g,new Le)),a&&(m.normal=Ur.getInterpolatedAttribute(a,u,d,h,g,new X),m.normal.dot(n.direction)>0&&m.normal.multiplyScalar(-1));const v={a:u,b:d,c:h,normal:new X,materialIndex:0};Ur.getNormal(Tm,bm,Rm,v.normal),m.face=v,m.barycoord=g}return m}class sc extends Kt{constructor(e=1,t=1,n=1,r=1,s=1,a=1){super(),this.type="BoxGeometry",this.parameters={width:e,height:t,depth:n,widthSegments:r,heightSegments:s,depthSegments:a};const u=this;r=Math.floor(r),s=Math.floor(s),a=Math.floor(a);const d=[],h=[],m=[],g=[];let v=0,_=0;A("z","y","x",-1,-1,n,t,e,a,s,0),A("z","y","x",1,-1,n,t,-e,a,s,1),A("x","z","y",1,1,e,n,t,r,a,2),A("x","z","y",1,-1,e,n,-t,r,a,3),A("x","y","z",1,-1,e,t,n,r,s,4),A("x","y","z",-1,-1,e,t,-n,r,s,5),this.setIndex(d),this.setAttribute("position",new Tt(h,3)),this.setAttribute("normal",new Tt(m,3)),this.setAttribute("uv",new Tt(g,2));function A(C,M,S,b,R,P,U,F,k,G,D){const L=P/k,V=U/G,oe=P/2,ie=U/2,ge=F/2,ye=k+1,he=G+1;let _e=0,H=0;const Z=new X;for(let q=0;q<he;q++){const W=q*V-ie;for(let ne=0;ne<ye;ne++){const Fe=ne*L-oe;Z[C]=Fe*b,Z[M]=W*R,Z[S]=ge,h.push(Z.x,Z.y,Z.z),Z[C]=0,Z[M]=0,Z[S]=F>0?1:-1,m.push(Z.x,Z.y,Z.z),g.push(ne/k),g.push(1-q/G),_e+=1}}for(let q=0;q<G;q++)for(let W=0;W<k;W++){const ne=v+W+ye*q,Fe=v+W+ye*(q+1),ae=v+(W+1)+ye*(q+1),we=v+(W+1)+ye*q;d.push(ne,Fe,we),d.push(Fe,ae,we),H+=6}u.addGroup(_,H,D),_+=H,v+=_e}}copy(e){return super.copy(e),this.parameters=Object.assign({},e.parameters),this}static fromJSON(e){return new sc(e.width,e.height,e.depth,e.widthSegments,e.heightSegments,e.depthSegments)}}function qf(i){const e={};for(const t in i){e[t]={};for(const n in i[t]){const r=i[t][n];r&&(r.isColor||r.isMatrix3||r.isMatrix4||r.isVector2||r.isVector3||r.isVector4||r.isTexture||r.isQuaternion)?r.isRenderTargetTexture?(console.warn("UniformsUtils: Textures of render targets cannot be cloned via cloneUniforms() or mergeUniforms()."),e[t][n]=null):e[t][n]=r.clone():Array.isArray(r)?e[t][n]=r.slice():e[t][n]=r}}return e}function _r(i){const e={};for(let t=0;t<i.length;t++){const n=qf(i[t]);for(const r in n)e[r]=n[r]}return e}function m3(i){const e=[];for(let t=0;t<i.length;t++)e.push(i[t].clone());return e}function BM(i){const e=i.getRenderTarget();return e===null?i.outputColorSpace:e.isXRRenderTarget===!0?e.texture.colorSpace:gn.workingColorSpace}const LM={clone:qf,merge:_r};var g3=`void main() {
	gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );
}`,v3=`void main() {
	gl_FragColor = vec4( 1.0, 0.0, 0.0, 1.0 );
}`;class no extends Ei{constructor(e){super(),this.isShaderMaterial=!0,this.type="ShaderMaterial",this.defines={},this.uniforms={},this.uniformsGroups=[],this.vertexShader=g3,this.fragmentShader=v3,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,e!==void 0&&this.setValues(e)}copy(e){return super.copy(e),this.fragmentShader=e.fragmentShader,this.vertexShader=e.vertexShader,this.uniforms=qf(e.uniforms),this.uniformsGroups=m3(e.uniformsGroups),this.defines=Object.assign({},e.defines),this.wireframe=e.wireframe,this.wireframeLinewidth=e.wireframeLinewidth,this.fog=e.fog,this.lights=e.lights,this.clipping=e.clipping,this.extensions=Object.assign({},e.extensions),this.glslVersion=e.glslVersion,this}toJSON(e){const t=super.toJSON(e);t.glslVersion=this.glslVersion,t.uniforms={};for(const r in this.uniforms){const a=this.uniforms[r].value;a&&a.isTexture?t.uniforms[r]={type:"t",value:a.toJSON(e).uuid}:a&&a.isColor?t.uniforms[r]={type:"c",value:a.getHex()}:a&&a.isVector2?t.uniforms[r]={type:"v2",value:a.toArray()}:a&&a.isVector3?t.uniforms[r]={type:"v3",value:a.toArray()}:a&&a.isVector4?t.uniforms[r]={type:"v4",value:a.toArray()}:a&&a.isMatrix3?t.uniforms[r]={type:"m3",value:a.toArray()}:a&&a.isMatrix4?t.uniforms[r]={type:"m4",value:a.toArray()}:t.uniforms[r]={value:a}}Object.keys(this.defines).length>0&&(t.defines=this.defines),t.vertexShader=this.vertexShader,t.fragmentShader=this.fragmentShader,t.lights=this.lights,t.clipping=this.clipping;const n={};for(const r in this.extensions)this.extensions[r]===!0&&(n[r]=!0);return Object.keys(n).length>0&&(t.extensions=n),t}}class ap extends fn{constructor(){super(),this.isCamera=!0,this.type="Camera",this.matrixWorldInverse=new Ot,this.projectionMatrix=new Ot,this.projectionMatrixInverse=new Ot,this.coordinateSystem=Zs}copy(e,t){return super.copy(e,t),this.matrixWorldInverse.copy(e.matrixWorldInverse),this.projectionMatrix.copy(e.projectionMatrix),this.projectionMatrixInverse.copy(e.projectionMatrixInverse),this.coordinateSystem=e.coordinateSystem,this}getWorldDirection(e){return super.getWorldDirection(e).negate()}updateMatrixWorld(e){super.updateMatrixWorld(e),this.matrixWorldInverse.copy(this.matrixWorld).invert()}updateWorldMatrix(e,t){super.updateWorldMatrix(e,t),this.matrixWorldInverse.copy(this.matrixWorld).invert()}clone(){return new this.constructor().copy(this)}}const ml=new X,oA=new Le,aA=new Le;class Hn extends ap{constructor(e=50,t=1,n=.1,r=2e3){super(),this.isPerspectiveCamera=!0,this.type="PerspectiveCamera",this.fov=e,this.zoom=1,this.near=n,this.far=r,this.focus=10,this.aspect=t,this.view=null,this.filmGauge=35,this.filmOffset=0,this.updateProjectionMatrix()}copy(e,t){return super.copy(e,t),this.fov=e.fov,this.zoom=e.zoom,this.near=e.near,this.far=e.far,this.focus=e.focus,this.aspect=e.aspect,this.view=e.view===null?null:Object.assign({},e.view),this.filmGauge=e.filmGauge,this.filmOffset=e.filmOffset,this}setFocalLength(e){const t=.5*this.getFilmHeight()/e;this.fov=Qf*2*Math.atan(t),this.updateProjectionMatrix()}getFocalLength(){const e=Math.tan(Xu*.5*this.fov);return .5*this.getFilmHeight()/e}getEffectiveFOV(){return Qf*2*Math.atan(Math.tan(Xu*.5*this.fov)/this.zoom)}getFilmWidth(){return this.filmGauge*Math.min(this.aspect,1)}getFilmHeight(){return this.filmGauge/Math.max(this.aspect,1)}getViewBounds(e,t,n){ml.set(-1,-1,.5).applyMatrix4(this.projectionMatrixInverse),t.set(ml.x,ml.y).multiplyScalar(-e/ml.z),ml.set(1,1,.5).applyMatrix4(this.projectionMatrixInverse),n.set(ml.x,ml.y).multiplyScalar(-e/ml.z)}getViewSize(e,t){return this.getViewBounds(e,oA,aA),t.subVectors(aA,oA)}setViewOffset(e,t,n,r,s,a){this.aspect=e/t,this.view===null&&(this.view={enabled:!0,fullWidth:1,fullHeight:1,offsetX:0,offsetY:0,width:1,height:1}),this.view.enabled=!0,this.view.fullWidth=e,this.view.fullHeight=t,this.view.offsetX=n,this.view.offsetY=r,this.view.width=s,this.view.height=a,this.updateProjectionMatrix()}clearViewOffset(){this.view!==null&&(this.view.enabled=!1),this.updateProjectionMatrix()}updateProjectionMatrix(){const e=this.near;let t=e*Math.tan(Xu*.5*this.fov)/this.zoom,n=2*t,r=this.aspect*n,s=-.5*r;const a=this.view;if(this.view!==null&&this.view.enabled){const d=a.fullWidth,h=a.fullHeight;s+=a.offsetX*r/d,t-=a.offsetY*n/h,r*=a.width/d,n*=a.height/h}const u=this.filmOffset;u!==0&&(s+=e*u/this.getFilmWidth()),this.projectionMatrix.makePerspective(s,s+r,t,t-n,e,this.far,this.coordinateSystem),this.projectionMatrixInverse.copy(this.projectionMatrix).invert()}toJSON(e){const t=super.toJSON(e);return t.object.fov=this.fov,t.object.zoom=this.zoom,t.object.near=this.near,t.object.far=this.far,t.object.focus=this.focus,t.object.aspect=this.aspect,this.view!==null&&(t.object.view=Object.assign({},this.view)),t.object.filmGauge=this.filmGauge,t.object.filmOffset=this.filmOffset,t}}const Ef=-90,wf=1;class DM extends fn{constructor(e,t,n){super(),this.type="CubeCamera",this.renderTarget=n,this.coordinateSystem=null,this.activeMipmapLevel=0;const r=new Hn(Ef,wf,e,t);r.layers=this.layers,this.add(r);const s=new Hn(Ef,wf,e,t);s.layers=this.layers,this.add(s);const a=new Hn(Ef,wf,e,t);a.layers=this.layers,this.add(a);const u=new Hn(Ef,wf,e,t);u.layers=this.layers,this.add(u);const d=new Hn(Ef,wf,e,t);d.layers=this.layers,this.add(d);const h=new Hn(Ef,wf,e,t);h.layers=this.layers,this.add(h)}updateCoordinateSystem(){const e=this.coordinateSystem,t=this.children.concat(),[n,r,s,a,u,d]=t;for(const h of t)this.remove(h);if(e===Zs)n.up.set(0,1,0),n.lookAt(1,0,0),r.up.set(0,1,0),r.lookAt(-1,0,0),s.up.set(0,0,-1),s.lookAt(0,1,0),a.up.set(0,0,1),a.lookAt(0,-1,0),u.up.set(0,1,0),u.lookAt(0,0,1),d.up.set(0,1,0),d.lookAt(0,0,-1);else if(e===Vh)n.up.set(0,-1,0),n.lookAt(-1,0,0),r.up.set(0,-1,0),r.lookAt(1,0,0),s.up.set(0,0,1),s.lookAt(0,1,0),a.up.set(0,0,-1),a.lookAt(0,-1,0),u.up.set(0,-1,0),u.lookAt(0,0,1),d.up.set(0,-1,0),d.lookAt(0,0,-1);else throw new Error("THREE.CubeCamera.updateCoordinateSystem(): Invalid coordinate system: "+e);for(const h of t)this.add(h),h.updateMatrixWorld()}update(e,t){this.parent===null&&this.updateMatrixWorld();const{renderTarget:n,activeMipmapLevel:r}=this;this.coordinateSystem!==e.coordinateSystem&&(this.coordinateSystem=e.coordinateSystem,this.updateCoordinateSystem());const[s,a,u,d,h,m]=this.children,g=e.getRenderTarget(),v=e.getActiveCubeFace(),_=e.getActiveMipmapLevel(),A=e.xr.enabled;e.xr.enabled=!1;const C=n.texture.generateMipmaps;n.texture.generateMipmaps=!1,e.setRenderTarget(n,0,r),e.render(t,s),e.setRenderTarget(n,1,r),e.render(t,a),e.setRenderTarget(n,2,r),e.render(t,u),e.setRenderTarget(n,3,r),e.render(t,d),e.setRenderTarget(n,4,r),e.render(t,h),n.texture.generateMipmaps=C,e.setRenderTarget(n,5,r),e.render(t,m),e.setRenderTarget(g,v,_),e.xr.enabled=A,n.texture.needsPMREMUpdate=!0}}class lp extends zn{constructor(e,t,n,r,s,a,u,d,h,m){e=e!==void 0?e:[],t=t!==void 0?t:Ta,super(e,t,n,r,s,a,u,d,h,m),this.isCubeTexture=!0,this.flipY=!1}get images(){return this.image}set images(e){this.image=e}}class FM extends bo{constructor(e=1,t={}){super(e,e,t),this.isWebGLCubeRenderTarget=!0;const n={width:e,height:e,depth:1},r=[n,n,n,n,n,n];this.texture=new lp(r,t.mapping,t.wrapS,t.wrapT,t.magFilter,t.minFilter,t.format,t.type,t.anisotropy,t.colorSpace),this.texture.isRenderTargetTexture=!0,this.texture.generateMipmaps=t.generateMipmaps!==void 0?t.generateMipmaps:!1,this.texture.minFilter=t.minFilter!==void 0?t.minFilter:ri}fromEquirectangularTexture(e,t){this.texture.type=t.type,this.texture.colorSpace=t.colorSpace,this.texture.generateMipmaps=t.generateMipmaps,this.texture.minFilter=t.minFilter,this.texture.magFilter=t.magFilter;const n={uniforms:{tEquirect:{value:null}},vertexShader:`

				varying vec3 vWorldDirection;

				vec3 transformDirection( in vec3 dir, in mat4 matrix ) {

					return normalize( ( matrix * vec4( dir, 0.0 ) ).xyz );

				}

				void main() {

					vWorldDirection = transformDirection( position, modelMatrix );

					#include <begin_vertex>
					#include <project_vertex>

				}
			`,fragmentShader:`

				uniform sampler2D tEquirect;

				varying vec3 vWorldDirection;

				#include <common>

				void main() {

					vec3 direction = normalize( vWorldDirection );

					vec2 sampleUV = equirectUv( direction );

					gl_FragColor = texture2D( tEquirect, sampleUV );

				}
			`},r=new sc(5,5,5),s=new no({name:"CubemapFromEquirect",uniforms:qf(n.uniforms),vertexShader:n.vertexShader,fragmentShader:n.fragmentShader,side:Ar,blending:Ma});s.uniforms.tEquirect.value=t;const a=new si(r,s),u=t.minFilter;return t.minFilter===As&&(t.minFilter=ri),new DM(1,10,this).update(e,a),t.minFilter=u,a.geometry.dispose(),a.material.dispose(),this}clear(e,t,n,r){const s=e.getRenderTarget();for(let a=0;a<6;a++)e.setRenderTarget(this,a),e.clear(t,n,r);e.setRenderTarget(s)}}class xa extends fn{constructor(){super(),this.isGroup=!0,this.type="Group"}}const y3={type:"move"};class xg{constructor(){this._targetRay=null,this._grip=null,this._hand=null}getHandSpace(){return this._hand===null&&(this._hand=new xa,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 xa,this._targetRay.matrixAutoUpdate=!1,this._targetRay.visible=!1,this._targetRay.hasLinearVelocity=!1,this._targetRay.linearVelocity=new X,this._targetRay.hasAngularVelocity=!1,this._targetRay.angularVelocity=new X),this._targetRay}getGripSpace(){return this._grip===null&&(this._grip=new xa,this._grip.matrixAutoUpdate=!1,this._grip.visible=!1,this._grip.hasLinearVelocity=!1,this._grip.linearVelocity=new X,this._grip.hasAngularVelocity=!1,this._grip.angularVelocity=new X),this._grip}dispatchEvent(e){return this._targetRay!==null&&this._targetRay.dispatchEvent(e),this._grip!==null&&this._grip.dispatchEvent(e),this._hand!==null&&this._hand.dispatchEvent(e),this}connect(e){if(e&&e.hand){const t=this._hand;if(t)for(const n of e.hand.values())this._getHandJoint(t,n)}return this.dispatchEvent({type:"connected",data:e}),this}disconnect(e){return this.dispatchEvent({type:"disconnected",data:e}),this._targetRay!==null&&(this._targetRay.visible=!1),this._grip!==null&&(this._grip.visible=!1),this._hand!==null&&(this._hand.visible=!1),this}update(e,t,n){let r=null,s=null,a=null;const u=this._targetRay,d=this._grip,h=this._hand;if(e&&t.session.visibilityState!=="visible-blurred"){if(h&&e.hand){a=!0;for(const C of e.hand.values()){const M=t.getJointPose(C,n),S=this._getHandJoint(h,C);M!==null&&(S.matrix.fromArray(M.transform.matrix),S.matrix.decompose(S.position,S.rotation,S.scale),S.matrixWorldNeedsUpdate=!0,S.jointRadius=M.radius),S.visible=M!==null}const m=h.joints["index-finger-tip"],g=h.joints["thumb-tip"],v=m.position.distanceTo(g.position),_=.02,A=.005;h.inputState.pinching&&v>_+A?(h.inputState.pinching=!1,this.dispatchEvent({type:"pinchend",handedness:e.handedness,target:this})):!h.inputState.pinching&&v<=_-A&&(h.inputState.pinching=!0,this.dispatchEvent({type:"pinchstart",handedness:e.handedness,target:this}))}else d!==null&&e.gripSpace&&(s=t.getPose(e.gripSpace,n),s!==null&&(d.matrix.fromArray(s.transform.matrix),d.matrix.decompose(d.position,d.rotation,d.scale),d.matrixWorldNeedsUpdate=!0,s.linearVelocity?(d.hasLinearVelocity=!0,d.linearVelocity.copy(s.linearVelocity)):d.hasLinearVelocity=!1,s.angularVelocity?(d.hasAngularVelocity=!0,d.angularVelocity.copy(s.angularVelocity)):d.hasAngularVelocity=!1));u!==null&&(r=t.getPose(e.targetRaySpace,n),r===null&&s!==null&&(r=s),r!==null&&(u.matrix.fromArray(r.transform.matrix),u.matrix.decompose(u.position,u.rotation,u.scale),u.matrixWorldNeedsUpdate=!0,r.linearVelocity?(u.hasLinearVelocity=!0,u.linearVelocity.copy(r.linearVelocity)):u.hasLinearVelocity=!1,r.angularVelocity?(u.hasAngularVelocity=!0,u.angularVelocity.copy(r.angularVelocity)):u.hasAngularVelocity=!1,this.dispatchEvent(y3)))}return u!==null&&(u.visible=r!==null),d!==null&&(d.visible=s!==null),h!==null&&(h.visible=a!==null),this}_getHandJoint(e,t){if(e.joints[t.jointName]===void 0){const n=new xa;n.matrixAutoUpdate=!1,n.visible=!1,e.joints[t.jointName]=n,e.add(n)}return e.joints[t.jointName]}}class F0{constructor(e,t=25e-5){this.isFogExp2=!0,this.name="",this.color=new tt(e),this.density=t}clone(){return new F0(this.color,this.density)}toJSON(){return{type:"FogExp2",name:this.name,color:this.color.getHex(),density:this.density}}}class N0{constructor(e,t=1,n=1e3){this.isFog=!0,this.name="",this.color=new tt(e),this.near=t,this.far=n}clone(){return new N0(this.color,this.near,this.far)}toJSON(){return{type:"Fog",name:this.name,color:this.color.getHex(),near:this.near,far:this.far}}}class nx extends fn{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 ns,this.environmentIntensity=1,this.environmentRotation=new ns,this.overrideMaterial=null,typeof __THREE_DEVTOOLS__<"u"&&__THREE_DEVTOOLS__.dispatchEvent(new CustomEvent("observe",{detail:this}))}copy(e,t){return super.copy(e,t),e.background!==null&&(this.background=e.background.clone()),e.environment!==null&&(this.environment=e.environment.clone()),e.fog!==null&&(this.fog=e.fog.clone()),this.backgroundBlurriness=e.backgroundBlurriness,this.backgroundIntensity=e.backgroundIntensity,this.backgroundRotation.copy(e.backgroundRotation),this.environmentIntensity=e.environmentIntensity,this.environmentRotation.copy(e.environmentRotation),e.overrideMaterial!==null&&(this.overrideMaterial=e.overrideMaterial.clone()),this.matrixAutoUpdate=e.matrixAutoUpdate,this}toJSON(e){const t=super.toJSON(e);return this.fog!==null&&(t.object.fog=this.fog.toJSON()),this.backgroundBlurriness>0&&(t.object.backgroundBlurriness=this.backgroundBlurriness),this.backgroundIntensity!==1&&(t.object.backgroundIntensity=this.backgroundIntensity),t.object.backgroundRotation=this.backgroundRotation.toArray(),this.environmentIntensity!==1&&(t.object.environmentIntensity=this.environmentIntensity),t.object.environmentRotation=this.environmentRotation.toArray(),t}}class up{constructor(e,t){this.isInterleavedBuffer=!0,this.array=e,this.stride=t,this.count=e!==void 0?e.length/t:0,this.usage=Gh,this.updateRanges=[],this.version=0,this.uuid=ts()}onUploadCallback(){}set needsUpdate(e){e===!0&&this.version++}setUsage(e){return this.usage=e,this}addUpdateRange(e,t){this.updateRanges.push({start:e,count:t})}clearUpdateRanges(){this.updateRanges.length=0}copy(e){return this.array=new e.array.constructor(e.array),this.count=e.count,this.stride=e.stride,this.usage=e.usage,this}copyAt(e,t,n){e*=this.stride,n*=t.stride;for(let r=0,s=this.stride;r<s;r++)this.array[e+r]=t.array[n+r];return this}set(e,t=0){return this.array.set(e,t),this}clone(e){e.arrayBuffers===void 0&&(e.arrayBuffers={}),this.array.buffer._uuid===void 0&&(this.array.buffer._uuid=ts()),e.arrayBuffers[this.array.buffer._uuid]===void 0&&(e.arrayBuffers[this.array.buffer._uuid]=this.array.slice(0).buffer);const t=new this.array.constructor(e.arrayBuffers[this.array.buffer._uuid]),n=new this.constructor(t,this.stride);return n.setUsage(this.usage),n}onUpload(e){return this.onUploadCallback=e,this}toJSON(e){return e.arrayBuffers===void 0&&(e.arrayBuffers={}),this.array.buffer._uuid===void 0&&(this.array.buffer._uuid=ts()),e.arrayBuffers[this.array.buffer._uuid]===void 0&&(e.arrayBuffers[this.array.buffer._uuid]=Array.from(new Uint32Array(this.array.buffer))),{uuid:this.uuid,buffer:this.array.buffer._uuid,type:this.array.constructor.name,stride:this.stride}}}const yr=new X;class Tl{constructor(e,t,n,r=!1){this.isInterleavedBufferAttribute=!0,this.name="",this.data=e,this.itemSize=t,this.offset=n,this.normalized=r}get count(){return this.data.count}get array(){return this.data.array}set needsUpdate(e){this.data.needsUpdate=e}applyMatrix4(e){for(let t=0,n=this.data.count;t<n;t++)yr.fromBufferAttribute(this,t),yr.applyMatrix4(e),this.setXYZ(t,yr.x,yr.y,yr.z);return this}applyNormalMatrix(e){for(let t=0,n=this.count;t<n;t++)yr.fromBufferAttribute(this,t),yr.applyNormalMatrix(e),this.setXYZ(t,yr.x,yr.y,yr.z);return this}transformDirection(e){for(let t=0,n=this.count;t<n;t++)yr.fromBufferAttribute(this,t),yr.transformDirection(e),this.setXYZ(t,yr.x,yr.y,yr.z);return this}getComponent(e,t){let n=this.array[e*this.data.stride+this.offset+t];return this.normalized&&(n=xr(n,this.array)),n}setComponent(e,t,n){return this.normalized&&(n=Zt(n,this.array)),this.data.array[e*this.data.stride+this.offset+t]=n,this}setX(e,t){return this.normalized&&(t=Zt(t,this.array)),this.data.array[e*this.data.stride+this.offset]=t,this}setY(e,t){return this.normalized&&(t=Zt(t,this.array)),this.data.array[e*this.data.stride+this.offset+1]=t,this}setZ(e,t){return this.normalized&&(t=Zt(t,this.array)),this.data.array[e*this.data.stride+this.offset+2]=t,this}setW(e,t){return this.normalized&&(t=Zt(t,this.array)),this.data.array[e*this.data.stride+this.offset+3]=t,this}getX(e){let t=this.data.array[e*this.data.stride+this.offset];return this.normalized&&(t=xr(t,this.array)),t}getY(e){let t=this.data.array[e*this.data.stride+this.offset+1];return this.normalized&&(t=xr(t,this.array)),t}getZ(e){let t=this.data.array[e*this.data.stride+this.offset+2];return this.normalized&&(t=xr(t,this.array)),t}getW(e){let t=this.data.array[e*this.data.stride+this.offset+3];return this.normalized&&(t=xr(t,this.array)),t}setXY(e,t,n){return e=e*this.data.stride+this.offset,this.normalized&&(t=Zt(t,this.array),n=Zt(n,this.array)),this.data.array[e+0]=t,this.data.array[e+1]=n,this}setXYZ(e,t,n,r){return e=e*this.data.stride+this.offset,this.normalized&&(t=Zt(t,this.array),n=Zt(n,this.array),r=Zt(r,this.array)),this.data.array[e+0]=t,this.data.array[e+1]=n,this.data.array[e+2]=r,this}setXYZW(e,t,n,r,s){return e=e*this.data.stride+this.offset,this.normalized&&(t=Zt(t,this.array),n=Zt(n,this.array),r=Zt(r,this.array),s=Zt(s,this.array)),this.data.array[e+0]=t,this.data.array[e+1]=n,this.data.array[e+2]=r,this.data.array[e+3]=s,this}clone(e){if(e===void 0){console.log("THREE.InterleavedBufferAttribute.clone(): Cloning an interleaved buffer attribute will de-interleave buffer data.");const t=[];for(let n=0;n<this.count;n++){const r=n*this.data.stride+this.offset;for(let s=0;s<this.itemSize;s++)t.push(this.data.array[r+s])}return new xn(new this.array.constructor(t),this.itemSize,this.normalized)}else return e.interleavedBuffers===void 0&&(e.interleavedBuffers={}),e.interleavedBuffers[this.data.uuid]===void 0&&(e.interleavedBuffers[this.data.uuid]=this.data.clone(e)),new Tl(e.interleavedBuffers[this.data.uuid],this.itemSize,this.offset,this.normalized)}toJSON(e){if(e===void 0){console.log("THREE.InterleavedBufferAttribute.toJSON(): Serializing an interleaved buffer attribute will de-interleave buffer data.");const t=[];for(let n=0;n<this.count;n++){const r=n*this.data.stride+this.offset;for(let s=0;s<this.itemSize;s++)t.push(this.data.array[r+s])}return{itemSize:this.itemSize,type:this.array.constructor.name,array:t,normalized:this.normalized}}else return e.interleavedBuffers===void 0&&(e.interleavedBuffers={}),e.interleavedBuffers[this.data.uuid]===void 0&&(e.interleavedBuffers[this.data.uuid]=this.data.toJSON(e)),{isInterleavedBufferAttribute:!0,itemSize:this.itemSize,data:this.data.uuid,offset:this.offset,normalized:this.normalized}}}class ix extends Ei{constructor(e){super(),this.isSpriteMaterial=!0,this.type="SpriteMaterial",this.color=new tt(16777215),this.map=null,this.alphaMap=null,this.rotation=0,this.sizeAttenuation=!0,this.transparent=!0,this.fog=!0,this.setValues(e)}copy(e){return super.copy(e),this.color.copy(e.color),this.map=e.map,this.alphaMap=e.alphaMap,this.rotation=e.rotation,this.sizeAttenuation=e.sizeAttenuation,this.fog=e.fog,this}}let Cf;const fh=new X,Tf=new X,bf=new X,Rf=new Le,dh=new Le,NM=new Ot,Lm=new X,hh=new X,Dm=new X,lA=new Le,ay=new Le,uA=new Le;class UM extends fn{constructor(e=new ix){if(super(),this.isSprite=!0,this.type="Sprite",Cf===void 0){Cf=new Kt;const t=new Float32Array([-.5,-.5,0,0,0,.5,-.5,0,1,0,.5,.5,0,1,1,-.5,.5,0,0,1]),n=new up(t,5);Cf.setIndex([0,1,2,0,2,3]),Cf.setAttribute("position",new Tl(n,3,0,!1)),Cf.setAttribute("uv",new Tl(n,2,3,!1))}this.geometry=Cf,this.material=e,this.center=new Le(.5,.5)}raycast(e,t){e.camera===null&&console.error('THREE.Sprite: "Raycaster.camera" needs to be set in order to raycast against sprites.'),Tf.setFromMatrixScale(this.matrixWorld),NM.copy(e.camera.matrixWorld),this.modelViewMatrix.multiplyMatrices(e.camera.matrixWorldInverse,this.matrixWorld),bf.setFromMatrixPosition(this.modelViewMatrix),e.camera.isPerspectiveCamera&&this.material.sizeAttenuation===!1&&Tf.multiplyScalar(-bf.z);const n=this.material.rotation;let r,s;n!==0&&(s=Math.cos(n),r=Math.sin(n));const a=this.center;Fm(Lm.set(-.5,-.5,0),bf,a,Tf,r,s),Fm(hh.set(.5,-.5,0),bf,a,Tf,r,s),Fm(Dm.set(.5,.5,0),bf,a,Tf,r,s),lA.set(0,0),ay.set(1,0),uA.set(1,1);let u=e.ray.intersectTriangle(Lm,hh,Dm,!1,fh);if(u===null&&(Fm(hh.set(-.5,.5,0),bf,a,Tf,r,s),ay.set(0,1),u=e.ray.intersectTriangle(Lm,Dm,hh,!1,fh),u===null))return;const d=e.ray.origin.distanceTo(fh);d<e.near||d>e.far||t.push({distance:d,point:fh.clone(),uv:Ur.getInterpolation(fh,Lm,hh,Dm,lA,ay,uA,new Le),face:null,object:this})}copy(e,t){return super.copy(e,t),e.center!==void 0&&this.center.copy(e.center),this.material=e.material,this}}function Fm(i,e,t,n,r,s){Rf.subVectors(i,t).addScalar(.5).multiply(n),r!==void 0?(dh.x=s*Rf.x-r*Rf.y,dh.y=r*Rf.x+s*Rf.y):dh.copy(Rf),i.copy(e),i.x+=dh.x,i.y+=dh.y,i.applyMatrix4(NM)}const Nm=new X,cA=new X;class OM extends fn{constructor(){super(),this._currentLevel=0,this.type="LOD",Object.defineProperties(this,{levels:{enumerable:!0,value:[]},isLOD:{value:!0}}),this.autoUpdate=!0}copy(e){super.copy(e,!1);const t=e.levels;for(let n=0,r=t.length;n<r;n++){const s=t[n];this.addLevel(s.object.clone(),s.distance,s.hysteresis)}return this.autoUpdate=e.autoUpdate,this}addLevel(e,t=0,n=0){t=Math.abs(t);const r=this.levels;let s;for(s=0;s<r.length&&!(t<r[s].distance);s++);return r.splice(s,0,{distance:t,hysteresis:n,object:e}),this.add(e),this}removeLevel(e){const t=this.levels;for(let n=0;n<t.length;n++)if(t[n].distance===e){const r=t.splice(n,1);return this.remove(r[0].object),!0}return!1}getCurrentLevel(){return this._currentLevel}getObjectForDistance(e){const t=this.levels;if(t.length>0){let n,r;for(n=1,r=t.length;n<r;n++){let s=t[n].distance;if(t[n].object.visible&&(s-=s*t[n].hysteresis),e<s)break}return t[n-1].object}return null}raycast(e,t){if(this.levels.length>0){Nm.setFromMatrixPosition(this.matrixWorld);const r=e.ray.origin.distanceTo(Nm);this.getObjectForDistance(r).raycast(e,t)}}update(e){const t=this.levels;if(t.length>1){Nm.setFromMatrixPosition(e.matrixWorld),cA.setFromMatrixPosition(this.matrixWorld);const n=Nm.distanceTo(cA)/e.zoom;t[0].object.visible=!0;let r,s;for(r=1,s=t.length;r<s;r++){let a=t[r].distance;if(t[r].object.visible&&(a-=a*t[r].hysteresis),n>=a)t[r-1].object.visible=!1,t[r].object.visible=!0;else break}for(this._currentLevel=r-1;r<s;r++)t[r].object.visible=!1}}toJSON(e){const t=super.toJSON(e);this.autoUpdate===!1&&(t.object.autoUpdate=!1),t.object.levels=[];const n=this.levels;for(let r=0,s=n.length;r<s;r++){const a=n[r];t.object.levels.push({object:a.object.uuid,distance:a.distance,hysteresis:a.hysteresis})}return t}}const fA=new X,dA=new _n,hA=new _n,_3=new X,pA=new Ot,Um=new X,ly=new ji,mA=new Ot,uy=new rc;class rx extends si{constructor(e,t){super(e,t),this.isSkinnedMesh=!0,this.type="SkinnedMesh",this.bindMode=c_,this.bindMatrix=new Ot,this.bindMatrixInverse=new Ot,this.boundingBox=null,this.boundingSphere=null}computeBoundingBox(){const e=this.geometry;this.boundingBox===null&&(this.boundingBox=new sr),this.boundingBox.makeEmpty();const t=e.getAttribute("position");for(let n=0;n<t.count;n++)this.getVertexPosition(n,Um),this.boundingBox.expandByPoint(Um)}computeBoundingSphere(){const e=this.geometry;this.boundingSphere===null&&(this.boundingSphere=new ji),this.boundingSphere.makeEmpty();const t=e.getAttribute("position");for(let n=0;n<t.count;n++)this.getVertexPosition(n,Um),this.boundingSphere.expandByPoint(Um)}copy(e,t){return super.copy(e,t),this.bindMode=e.bindMode,this.bindMatrix.copy(e.bindMatrix),this.bindMatrixInverse.copy(e.bindMatrixInverse),this.skeleton=e.skeleton,e.boundingBox!==null&&(this.boundingBox=e.boundingBox.clone()),e.boundingSphere!==null&&(this.boundingSphere=e.boundingSphere.clone()),this}raycast(e,t){const n=this.material,r=this.matrixWorld;n!==void 0&&(this.boundingSphere===null&&this.computeBoundingSphere(),ly.copy(this.boundingSphere),ly.applyMatrix4(r),e.ray.intersectsSphere(ly)!==!1&&(mA.copy(r).invert(),uy.copy(e.ray).applyMatrix4(mA),!(this.boundingBox!==null&&uy.intersectsBox(this.boundingBox)===!1)&&this._computeIntersections(e,t,uy)))}getVertexPosition(e,t){return super.getVertexPosition(e,t),this.applyBoneTransform(e,t),t}bind(e,t){this.skeleton=e,t===void 0&&(this.updateMatrixWorld(!0),this.skeleton.calculateInverses(),t=this.matrixWorld),this.bindMatrix.copy(t),this.bindMatrixInverse.copy(t).invert()}pose(){this.skeleton.pose()}normalizeSkinWeights(){const e=new _n,t=this.geometry.attributes.skinWeight;for(let n=0,r=t.count;n<r;n++){e.fromBufferAttribute(t,n);const s=1/e.manhattanLength();s!==1/0?e.multiplyScalar(s):e.set(1,0,0,0),t.setXYZW(n,e.x,e.y,e.z,e.w)}}updateMatrixWorld(e){super.updateMatrixWorld(e),this.bindMode===c_?this.bindMatrixInverse.copy(this.matrixWorld).invert():this.bindMode===dM?this.bindMatrixInverse.copy(this.bindMatrix).invert():console.warn("THREE.SkinnedMesh: Unrecognized bindMode: "+this.bindMode)}applyBoneTransform(e,t){const n=this.skeleton,r=this.geometry;dA.fromBufferAttribute(r.attributes.skinIndex,e),hA.fromBufferAttribute(r.attributes.skinWeight,e),fA.copy(t).applyMatrix4(this.bindMatrix),t.set(0,0,0);for(let s=0;s<4;s++){const a=hA.getComponent(s);if(a!==0){const u=dA.getComponent(s);pA.multiplyMatrices(n.bones[u].matrixWorld,n.boneInverses[u]),t.addScaledVector(_3.copy(fA).applyMatrix4(pA),a)}}return t.applyMatrix4(this.bindMatrixInverse)}}class U0 extends fn{constructor(){super(),this.isBone=!0,this.type="Bone"}}class Eo extends zn{constructor(e=null,t=1,n=1,r,s,a,u,d,h=Di,m=Di,g,v){super(null,a,u,d,h,m,r,s,g,v),this.isDataTexture=!0,this.image={data:e,width:t,height:n},this.generateMipmaps=!1,this.flipY=!1,this.unpackAlignment=1}}const gA=new Ot,x3=new Ot;class cp{constructor(e=[],t=[]){this.uuid=ts(),this.bones=e.slice(0),this.boneInverses=t,this.boneMatrices=null,this.boneTexture=null,this.init()}init(){const e=this.bones,t=this.boneInverses;if(this.boneMatrices=new Float32Array(e.length*16),t.length===0)this.calculateInverses();else if(e.length!==t.length){console.warn("THREE.Skeleton: Number of inverse bone matrices does not match amount of bones."),this.boneInverses=[];for(let n=0,r=this.bones.length;n<r;n++)this.boneInverses.push(new Ot)}}calculateInverses(){this.boneInverses.length=0;for(let e=0,t=this.bones.length;e<t;e++){const n=new Ot;this.bones[e]&&n.copy(this.bones[e].matrixWorld).invert(),this.boneInverses.push(n)}}pose(){for(let e=0,t=this.bones.length;e<t;e++){const n=this.bones[e];n&&n.matrixWorld.copy(this.boneInverses[e]).invert()}for(let e=0,t=this.bones.length;e<t;e++){const n=this.bones[e];n&&(n.parent&&n.parent.isBone?(n.matrix.copy(n.parent.matrixWorld).invert(),n.matrix.multiply(n.matrixWorld)):n.matrix.copy(n.matrixWorld),n.matrix.decompose(n.position,n.quaternion,n.scale))}}update(){const e=this.bones,t=this.boneInverses,n=this.boneMatrices,r=this.boneTexture;for(let s=0,a=e.length;s<a;s++){const u=e[s]?e[s].matrixWorld:x3;gA.multiplyMatrices(u,t[s]),gA.toArray(n,s*16)}r!==null&&(r.needsUpdate=!0)}clone(){return new cp(this.bones,this.boneInverses)}computeBoneTexture(){let e=Math.sqrt(this.bones.length*4);e=Math.ceil(e/4)*4,e=Math.max(e,4);const t=new Float32Array(e*e*4);t.set(this.boneMatrices);const n=new Eo(t,e,e,rr,Or);return n.needsUpdate=!0,this.boneMatrices=t,this.boneTexture=n,this}getBoneByName(e){for(let t=0,n=this.bones.length;t<n;t++){const r=this.bones[t];if(r.name===e)return r}}dispose(){this.boneTexture!==null&&(this.boneTexture.dispose(),this.boneTexture=null)}fromJSON(e,t){this.uuid=e.uuid;for(let n=0,r=e.bones.length;n<r;n++){const s=e.bones[n];let a=t[s];a===void 0&&(console.warn("THREE.Skeleton: No bone found with UUID:",s),a=new U0),this.bones.push(a),this.boneInverses.push(new Ot().fromArray(e.boneInverses[n]))}return this.init(),this}toJSON(){const e={metadata:{version:4.6,type:"Skeleton",generator:"Skeleton.toJSON"},bones:[],boneInverses:[]};e.uuid=this.uuid;const t=this.bones,n=this.boneInverses;for(let r=0,s=t.length;r<s;r++){const a=t[r];e.bones.push(a.uuid);const u=n[r];e.boneInverses.push(u.toArray())}return e}}class Zu extends xn{constructor(e,t,n,r=1){super(e,t,n),this.isInstancedBufferAttribute=!0,this.meshPerAttribute=r}copy(e){return super.copy(e),this.meshPerAttribute=e.meshPerAttribute,this}toJSON(){const e=super.toJSON();return e.meshPerAttribute=this.meshPerAttribute,e.isInstancedBufferAttribute=!0,e}}const If=new Ot,vA=new Ot,Om=[],yA=new sr,A3=new Ot,ph=new si,mh=new ji;class sx extends si{constructor(e,t,n){super(e,t),this.isInstancedMesh=!0,this.instanceMatrix=new Zu(new Float32Array(n*16),16),this.instanceColor=null,this.morphTexture=null,this.count=n,this.boundingBox=null,this.boundingSphere=null;for(let r=0;r<n;r++)this.setMatrixAt(r,A3)}computeBoundingBox(){const e=this.geometry,t=this.count;this.boundingBox===null&&(this.boundingBox=new sr),e.boundingBox===null&&e.computeBoundingBox(),this.boundingBox.makeEmpty();for(let n=0;n<t;n++)this.getMatrixAt(n,If),yA.copy(e.boundingBox).applyMatrix4(If),this.boundingBox.union(yA)}computeBoundingSphere(){const e=this.geometry,t=this.count;this.boundingSphere===null&&(this.boundingSphere=new ji),e.boundingSphere===null&&e.computeBoundingSphere(),this.boundingSphere.makeEmpty();for(let n=0;n<t;n++)this.getMatrixAt(n,If),mh.copy(e.boundingSphere).applyMatrix4(If),this.boundingSphere.union(mh)}copy(e,t){return super.copy(e,t),this.instanceMatrix.copy(e.instanceMatrix),e.morphTexture!==null&&(this.morphTexture=e.morphTexture.clone()),e.instanceColor!==null&&(this.instanceColor=e.instanceColor.clone()),this.count=e.count,e.boundingBox!==null&&(this.boundingBox=e.boundingBox.clone()),e.boundingSphere!==null&&(this.boundingSphere=e.boundingSphere.clone()),this}getColorAt(e,t){t.fromArray(this.instanceColor.array,e*3)}getMatrixAt(e,t){t.fromArray(this.instanceMatrix.array,e*16)}getMorphAt(e,t){const n=t.morphTargetInfluences,r=this.morphTexture.source.data.data,s=n.length+1,a=e*s+1;for(let u=0;u<n.length;u++)n[u]=r[a+u]}raycast(e,t){const n=this.matrixWorld,r=this.count;if(ph.geometry=this.geometry,ph.material=this.material,ph.material!==void 0&&(this.boundingSphere===null&&this.computeBoundingSphere(),mh.copy(this.boundingSphere),mh.applyMatrix4(n),e.ray.intersectsSphere(mh)!==!1))for(let s=0;s<r;s++){this.getMatrixAt(s,If),vA.multiplyMatrices(n,If),ph.matrixWorld=vA,ph.raycast(e,Om);for(let a=0,u=Om.length;a<u;a++){const d=Om[a];d.instanceId=s,d.object=this,t.push(d)}Om.length=0}}setColorAt(e,t){this.instanceColor===null&&(this.instanceColor=new Zu(new Float32Array(this.instanceMatrix.count*3).fill(1),3)),t.toArray(this.instanceColor.array,e*3)}setMatrixAt(e,t){t.toArray(this.instanceMatrix.array,e*16)}setMorphAt(e,t){const n=t.morphTargetInfluences,r=n.length+1;this.morphTexture===null&&(this.morphTexture=new Eo(new Float32Array(r*this.count),r,this.count,R0,Or));const s=this.morphTexture.source.data.data;let a=0;for(let h=0;h<n.length;h++)a+=n[h];const u=this.geometry.morphTargetsRelative?1:1-a,d=r*e;s[d]=u,s.set(n,d+1)}updateMorphTargets(){}dispose(){return this.dispatchEvent({type:"dispose"}),this.morphTexture!==null&&(this.morphTexture.dispose(),this.morphTexture=null),this}}const cy=new X,S3=new X,M3=new Jt;let va=class{constructor(e=new X(1,0,0),t=0){this.isPlane=!0,this.normal=e,this.constant=t}set(e,t){return this.normal.copy(e),this.constant=t,this}setComponents(e,t,n,r){return this.normal.set(e,t,n),this.constant=r,this}setFromNormalAndCoplanarPoint(e,t){return this.normal.copy(e),this.constant=-t.dot(this.normal),this}setFromCoplanarPoints(e,t,n){const r=cy.subVectors(n,t).cross(S3.subVectors(e,t)).normalize();return this.setFromNormalAndCoplanarPoint(r,e),this}copy(e){return this.normal.copy(e.normal),this.constant=e.constant,this}normalize(){const e=1/this.normal.length();return this.normal.multiplyScalar(e),this.constant*=e,this}negate(){return this.constant*=-1,this.normal.negate(),this}distanceToPoint(e){return this.normal.dot(e)+this.constant}distanceToSphere(e){return this.distanceToPoint(e.center)-e.radius}projectPoint(e,t){return t.copy(e).addScaledVector(this.normal,-this.distanceToPoint(e))}intersectLine(e,t){const n=e.delta(cy),r=this.normal.dot(n);if(r===0)return this.distanceToPoint(e.start)===0?t.copy(e.start):null;const s=-(e.start.dot(this.normal)+this.constant)/r;return s<0||s>1?null:t.copy(e.start).addScaledVector(n,s)}intersectsLine(e){const t=this.distanceToPoint(e.start),n=this.distanceToPoint(e.end);return t<0&&n>0||n<0&&t>0}intersectsBox(e){return e.intersectsPlane(this)}intersectsSphere(e){return e.intersectsPlane(this)}coplanarPoint(e){return e.copy(this.normal).multiplyScalar(-this.constant)}applyMatrix4(e,t){const n=t||M3.getNormalMatrix(e),r=this.coplanarPoint(cy).applyMatrix4(e),s=this.normal.applyMatrix3(n).normalize();return this.constant=-r.dot(s),this}translate(e){return this.constant-=e.dot(this.normal),this}equals(e){return e.normal.equals(this.normal)&&e.constant===this.constant}clone(){return new this.constructor().copy(this)}};const _u=new ji,km=new X;class fp{constructor(e=new va,t=new va,n=new va,r=new va,s=new va,a=new va){this.planes=[e,t,n,r,s,a]}set(e,t,n,r,s,a){const u=this.planes;return u[0].copy(e),u[1].copy(t),u[2].copy(n),u[3].copy(r),u[4].copy(s),u[5].copy(a),this}copy(e){const t=this.planes;for(let n=0;n<6;n++)t[n].copy(e.planes[n]);return this}setFromProjectionMatrix(e,t=Zs){const n=this.planes,r=e.elements,s=r[0],a=r[1],u=r[2],d=r[3],h=r[4],m=r[5],g=r[6],v=r[7],_=r[8],A=r[9],C=r[10],M=r[11],S=r[12],b=r[13],R=r[14],P=r[15];if(n[0].setComponents(d-s,v-h,M-_,P-S).normalize(),n[1].setComponents(d+s,v+h,M+_,P+S).normalize(),n[2].setComponents(d+a,v+m,M+A,P+b).normalize(),n[3].setComponents(d-a,v-m,M-A,P-b).normalize(),n[4].setComponents(d-u,v-g,M-C,P-R).normalize(),t===Zs)n[5].setComponents(d+u,v+g,M+C,P+R).normalize();else if(t===Vh)n[5].setComponents(u,g,C,R).normalize();else throw new Error("THREE.Frustum.setFromProjectionMatrix(): Invalid coordinate system: "+t);return this}intersectsObject(e){if(e.boundingSphere!==void 0)e.boundingSphere===null&&e.computeBoundingSphere(),_u.copy(e.boundingSphere).applyMatrix4(e.matrixWorld);else{const t=e.geometry;t.boundingSphere===null&&t.computeBoundingSphere(),_u.copy(t.boundingSphere).applyMatrix4(e.matrixWorld)}return this.intersectsSphere(_u)}intersectsSprite(e){return _u.center.set(0,0,0),_u.radius=.7071067811865476,_u.applyMatrix4(e.matrixWorld),this.intersectsSphere(_u)}intersectsSphere(e){const t=this.planes,n=e.center,r=-e.radius;for(let s=0;s<6;s++)if(t[s].distanceToPoint(n)<r)return!1;return!0}intersectsBox(e){const t=this.planes;for(let n=0;n<6;n++){const r=t[n];if(km.x=r.normal.x>0?e.max.x:e.min.x,km.y=r.normal.y>0?e.max.y:e.min.y,km.z=r.normal.z>0?e.max.z:e.min.z,r.distanceToPoint(km)<0)return!1}return!0}containsPoint(e){const t=this.planes;for(let n=0;n<6;n++)if(t[n].distanceToPoint(e)<0)return!1;return!0}clone(){return new this.constructor().copy(this)}}function fy(i,e){return i-e}function E3(i,e){return i.z-e.z}function w3(i,e){return e.z-i.z}class C3{constructor(){this.index=0,this.pool=[],this.list=[]}push(e,t,n,r){const s=this.pool,a=this.list;this.index>=s.length&&s.push({start:-1,count:-1,z:-1,index:-1});const u=s[this.index];a.push(u),this.index++,u.start=e,u.count=t,u.z=n,u.index=r}reset(){this.list.length=0,this.index=0}}const Dr=new Ot,T3=new tt(1,1,1),dy=new fp,Hm=new sr,xu=new ji,gh=new X,_A=new X,b3=new X,hy=new C3,ir=new si,zm=[];function R3(i,e,t=0){const n=e.itemSize;if(i.isInterleavedBufferAttribute||i.array.constructor!==e.array.constructor){const r=i.count;for(let s=0;s<r;s++)for(let a=0;a<n;a++)e.setComponent(s+t,a,i.getComponent(s,a))}else e.array.set(i.array,t*n);e.needsUpdate=!0}function Au(i,e){if(i.constructor!==e.constructor){const t=Math.min(i.length,e.length);for(let n=0;n<t;n++)e[n]=i[n]}else{const t=Math.min(i.length,e.length);e.set(new i.constructor(i.buffer,0,t))}}class kM extends si{get maxInstanceCount(){return this._maxInstanceCount}get instanceCount(){return this._instanceInfo.length-this._availableInstanceIds.length}get unusedVertexCount(){return this._maxVertexCount-this._nextVertexStart}get unusedIndexCount(){return this._maxIndexCount-this._nextIndexStart}constructor(e,t,n=t*2,r){super(new Kt,r),this.isBatchedMesh=!0,this.perObjectFrustumCulled=!0,this.sortObjects=!0,this.boundingBox=null,this.boundingSphere=null,this.customSort=null,this._instanceInfo=[],this._geometryInfo=[],this._availableInstanceIds=[],this._availableGeometryIds=[],this._nextIndexStart=0,this._nextVertexStart=0,this._geometryCount=0,this._visibilityChanged=!0,this._geometryInitialized=!1,this._maxInstanceCount=e,this._maxVertexCount=t,this._maxIndexCount=n,this._multiDrawCounts=new Int32Array(e),this._multiDrawStarts=new Int32Array(e),this._multiDrawCount=0,this._multiDrawInstances=null,this._matricesTexture=null,this._indirectTexture=null,this._colorsTexture=null,this._initMatricesTexture(),this._initIndirectTexture()}_initMatricesTexture(){let e=Math.sqrt(this._maxInstanceCount*4);e=Math.ceil(e/4)*4,e=Math.max(e,4);const t=new Float32Array(e*e*4),n=new Eo(t,e,e,rr,Or);this._matricesTexture=n}_initIndirectTexture(){let e=Math.sqrt(this._maxInstanceCount);e=Math.ceil(e);const t=new Uint32Array(e*e),n=new Eo(t,e,e,sp,ba);this._indirectTexture=n}_initColorsTexture(){let e=Math.sqrt(this._maxInstanceCount);e=Math.ceil(e);const t=new Float32Array(e*e*4).fill(1),n=new Eo(t,e,e,rr,Or);n.colorSpace=gn.workingColorSpace,this._colorsTexture=n}_initializeGeometry(e){const t=this.geometry,n=this._maxVertexCount,r=this._maxIndexCount;if(this._geometryInitialized===!1){for(const s in e.attributes){const a=e.getAttribute(s),{array:u,itemSize:d,normalized:h}=a,m=new u.constructor(n*d),g=new xn(m,d,h);t.setAttribute(s,g)}if(e.getIndex()!==null){const s=n>65535?new Uint32Array(r):new Uint16Array(r);t.setIndex(new xn(s,1))}this._geometryInitialized=!0}}_validateGeometry(e){const t=this.geometry;if(!!e.getIndex()!=!!t.getIndex())throw new Error('THREE.BatchedMesh: All geometries must consistently have "index".');for(const n in t.attributes){if(!e.hasAttribute(n))throw new Error(`THREE.BatchedMesh: Added geometry missing "${n}". All geometries must have consistent attributes.`);const r=e.getAttribute(n),s=t.getAttribute(n);if(r.itemSize!==s.itemSize||r.normalized!==s.normalized)throw new Error("THREE.BatchedMesh: All attributes must have a consistent itemSize and normalized value.")}}validateInstanceId(e){const t=this._instanceInfo;if(e<0||e>=t.length||t[e].active===!1)throw new Error(`THREE.BatchedMesh: Invalid instanceId ${e}. Instance is either out of range or has been deleted.`)}validateGeometryId(e){const t=this._geometryInfo;if(e<0||e>=t.length||t[e].active===!1)throw new Error(`THREE.BatchedMesh: Invalid geometryId ${e}. Geometry is either out of range or has been deleted.`)}setCustomSort(e){return this.customSort=e,this}computeBoundingBox(){this.boundingBox===null&&(this.boundingBox=new sr);const e=this.boundingBox,t=this._instanceInfo;e.makeEmpty();for(let n=0,r=t.length;n<r;n++){if(t[n].active===!1)continue;const s=t[n].geometryIndex;this.getMatrixAt(n,Dr),this.getBoundingBoxAt(s,Hm).applyMatrix4(Dr),e.union(Hm)}}computeBoundingSphere(){this.boundingSphere===null&&(this.boundingSphere=new ji);const e=this.boundingSphere,t=this._instanceInfo;e.makeEmpty();for(let n=0,r=t.length;n<r;n++){if(t[n].active===!1)continue;const s=t[n].geometryIndex;this.getMatrixAt(n,Dr),this.getBoundingSphereAt(s,xu).applyMatrix4(Dr),e.union(xu)}}addInstance(e){if(this._instanceInfo.length>=this.maxInstanceCount&&this._availableInstanceIds.length===0)throw new Error("THREE.BatchedMesh: Maximum item count reached.");const n={visible:!0,active:!0,geometryIndex:e};let r=null;this._availableInstanceIds.length>0?(this._availableInstanceIds.sort(fy),r=this._availableInstanceIds.shift(),this._instanceInfo[r]=n):(r=this._instanceInfo.length,this._instanceInfo.push(n));const s=this._matricesTexture;Dr.identity().toArray(s.image.data,r*16),s.needsUpdate=!0;const a=this._colorsTexture;return a&&(T3.toArray(a.image.data,r*4),a.needsUpdate=!0),this._visibilityChanged=!0,r}addGeometry(e,t=-1,n=-1){this._initializeGeometry(e),this._validateGeometry(e);const r={vertexStart:-1,vertexCount:-1,reservedVertexCount:-1,indexStart:-1,indexCount:-1,reservedIndexCount:-1,start:-1,count:-1,boundingBox:null,boundingSphere:null,active:!0},s=this._geometryInfo;r.vertexStart=this._nextVertexStart,r.reservedVertexCount=t===-1?e.getAttribute("position").count:t;const a=e.getIndex();if(a!==null&&(r.indexStart=this._nextIndexStart,r.reservedIndexCount=n===-1?a.count:n),r.indexStart!==-1&&r.indexStart+r.reservedIndexCount>this._maxIndexCount||r.vertexStart+r.reservedVertexCount>this._maxVertexCount)throw new Error("THREE.BatchedMesh: Reserved space request exceeds the maximum buffer size.");let d;return this._availableGeometryIds.length>0?(this._availableGeometryIds.sort(fy),d=this._availableGeometryIds.shift(),s[d]=r):(d=this._geometryCount,this._geometryCount++,s.push(r)),this.setGeometryAt(d,e),this._nextIndexStart=r.indexStart+r.reservedIndexCount,this._nextVertexStart=r.vertexStart+r.reservedVertexCount,d}setGeometryAt(e,t){if(e>=this._geometryCount)throw new Error("THREE.BatchedMesh: Maximum geometry count reached.");this._validateGeometry(t);const n=this.geometry,r=n.getIndex()!==null,s=n.getIndex(),a=t.getIndex(),u=this._geometryInfo[e];if(r&&a.count>u.reservedIndexCount||t.attributes.position.count>u.reservedVertexCount)throw new Error("THREE.BatchedMesh: Reserved space not large enough for provided geometry.");const d=u.vertexStart,h=u.reservedVertexCount;u.vertexCount=t.getAttribute("position").count;for(const m in n.attributes){const g=t.getAttribute(m),v=n.getAttribute(m);R3(g,v,d);const _=g.itemSize;for(let A=g.count,C=h;A<C;A++){const M=d+A;for(let S=0;S<_;S++)v.setComponent(M,S,0)}v.needsUpdate=!0,v.addUpdateRange(d*_,h*_)}if(r){const m=u.indexStart,g=u.reservedIndexCount;u.indexCount=t.getIndex().count;for(let v=0;v<a.count;v++)s.setX(m+v,d+a.getX(v));for(let v=a.count,_=g;v<_;v++)s.setX(m+v,d);s.needsUpdate=!0,s.addUpdateRange(m,u.reservedIndexCount)}return u.start=r?u.indexStart:u.vertexStart,u.count=r?u.indexCount:u.vertexCount,u.boundingBox=null,t.boundingBox!==null&&(u.boundingBox=t.boundingBox.clone()),u.boundingSphere=null,t.boundingSphere!==null&&(u.boundingSphere=t.boundingSphere.clone()),this._visibilityChanged=!0,e}deleteGeometry(e){const t=this._geometryInfo;if(e>=t.length||t[e].active===!1)return this;const n=this._instanceInfo;for(let r=0,s=n.length;r<s;r++)n[r].active&&n[r].geometryIndex===e&&this.deleteInstance(r);return t[e].active=!1,this._availableGeometryIds.push(e),this._visibilityChanged=!0,this}deleteInstance(e){return this.validateInstanceId(e),this._instanceInfo[e].active=!1,this._availableInstanceIds.push(e),this._visibilityChanged=!0,this}optimize(){let e=0,t=0;const n=this._geometryInfo,r=n.map((a,u)=>u).sort((a,u)=>n[a].vertexStart-n[u].vertexStart),s=this.geometry;for(let a=0,u=n.length;a<u;a++){const d=r[a],h=n[d];if(h.active!==!1){if(s.index!==null){if(h.indexStart!==t){const{indexStart:m,vertexStart:g,reservedIndexCount:v}=h,_=s.index,A=_.array,C=e-g;for(let M=m;M<m+v;M++)A[M]=A[M]+C;_.array.copyWithin(t,m,m+v),_.addUpdateRange(t,v),h.indexStart=t}t+=h.reservedIndexCount}if(h.vertexStart!==e){const{vertexStart:m,reservedVertexCount:g}=h,v=s.attributes;for(const _ in v){const A=v[_],{array:C,itemSize:M}=A;C.copyWithin(e*M,m*M,(m+g)*M),A.addUpdateRange(e*M,g*M)}h.vertexStart=e}e+=h.reservedVertexCount,h.start=s.index?h.indexStart:h.vertexStart,this._nextIndexStart=s.index?h.indexStart+h.reservedIndexCount:0,this._nextVertexStart=h.vertexStart+h.reservedVertexCount}}return this}getBoundingBoxAt(e,t){if(e>=this._geometryCount)return null;const n=this.geometry,r=this._geometryInfo[e];if(r.boundingBox===null){const s=new sr,a=n.index,u=n.attributes.position;for(let d=r.start,h=r.start+r.count;d<h;d++){let m=d;a&&(m=a.getX(m)),s.expandByPoint(gh.fromBufferAttribute(u,m))}r.boundingBox=s}return t.copy(r.boundingBox),t}getBoundingSphereAt(e,t){if(e>=this._geometryCount)return null;const n=this.geometry,r=this._geometryInfo[e];if(r.boundingSphere===null){const s=new ji;this.getBoundingBoxAt(e,Hm),Hm.getCenter(s.center);const a=n.index,u=n.attributes.position;let d=0;for(let h=r.start,m=r.start+r.count;h<m;h++){let g=h;a&&(g=a.getX(g)),gh.fromBufferAttribute(u,g),d=Math.max(d,s.center.distanceToSquared(gh))}s.radius=Math.sqrt(d),r.boundingSphere=s}return t.copy(r.boundingSphere),t}setMatrixAt(e,t){this.validateInstanceId(e);const n=this._matricesTexture,r=this._matricesTexture.image.data;return t.toArray(r,e*16),n.needsUpdate=!0,this}getMatrixAt(e,t){return this.validateInstanceId(e),t.fromArray(this._matricesTexture.image.data,e*16)}setColorAt(e,t){return this.validateInstanceId(e),this._colorsTexture===null&&this._initColorsTexture(),t.toArray(this._colorsTexture.image.data,e*4),this._colorsTexture.needsUpdate=!0,this}getColorAt(e,t){return this.validateInstanceId(e),t.fromArray(this._colorsTexture.image.data,e*4)}setVisibleAt(e,t){return this.validateInstanceId(e),this._instanceInfo[e].visible===t?this:(this._instanceInfo[e].visible=t,this._visibilityChanged=!0,this)}getVisibleAt(e){return this.validateInstanceId(e),this._instanceInfo[e].visible}setGeometryIdAt(e,t){return this.validateInstanceId(e),this.validateGeometryId(t),this._instanceInfo[e].geometryIndex=t,this}getGeometryIdAt(e){return this.validateInstanceId(e),this._instanceInfo[e].geometryIndex}getGeometryRangeAt(e,t={}){this.validateGeometryId(e);const n=this._geometryInfo[e];return t.vertexStart=n.vertexStart,t.vertexCount=n.vertexCount,t.reservedVertexCount=n.reservedVertexCount,t.indexStart=n.indexStart,t.indexCount=n.indexCount,t.reservedIndexCount=n.reservedIndexCount,t.start=n.start,t.count=n.count,t}setInstanceCount(e){const t=this._availableInstanceIds,n=this._instanceInfo;for(t.sort(fy);t[t.length-1]===n.length;)n.pop(),t.pop();if(e<n.length)throw new Error(`BatchedMesh: Instance ids outside the range ${e} are being used. Cannot shrink instance count.`);const r=new Int32Array(e),s=new Int32Array(e);Au(this._multiDrawCounts,r),Au(this._multiDrawStarts,s),this._multiDrawCounts=r,this._multiDrawStarts=s,this._maxInstanceCount=e;const a=this._indirectTexture,u=this._matricesTexture,d=this._colorsTexture;a.dispose(),this._initIndirectTexture(),Au(a.image.data,this._indirectTexture.image.data),u.dispose(),this._initMatricesTexture(),Au(u.image.data,this._matricesTexture.image.data),d&&(d.dispose(),this._initColorsTexture(),Au(d.image.data,this._colorsTexture.image.data))}setGeometrySize(e,t){const n=[...this._geometryInfo].filter(u=>u.active);if(Math.max(...n.map(u=>u.vertexStart+u.reservedVertexCount))>e)throw new Error(`BatchedMesh: Geometry vertex values are being used outside the range ${t}. Cannot shrink further.`);if(this.geometry.index&&Math.max(...n.map(d=>d.indexStart+d.reservedIndexCount))>t)throw new Error(`BatchedMesh: Geometry index values are being used outside the range ${t}. Cannot shrink further.`);const s=this.geometry;s.dispose(),this._maxVertexCount=e,this._maxIndexCount=t,this._geometryInitialized&&(this._geometryInitialized=!1,this.geometry=new Kt,this._initializeGeometry(s));const a=this.geometry;s.index&&Au(s.index.array,a.index.array);for(const u in s.attributes)Au(s.attributes[u].array,a.attributes[u].array)}raycast(e,t){const n=this._instanceInfo,r=this._geometryInfo,s=this.matrixWorld,a=this.geometry;ir.material=this.material,ir.geometry.index=a.index,ir.geometry.attributes=a.attributes,ir.geometry.boundingBox===null&&(ir.geometry.boundingBox=new sr),ir.geometry.boundingSphere===null&&(ir.geometry.boundingSphere=new ji);for(let u=0,d=n.length;u<d;u++){if(!n[u].visible||!n[u].active)continue;const h=n[u].geometryIndex,m=r[h];ir.geometry.setDrawRange(m.start,m.count),this.getMatrixAt(u,ir.matrixWorld).premultiply(s),this.getBoundingBoxAt(h,ir.geometry.boundingBox),this.getBoundingSphereAt(h,ir.geometry.boundingSphere),ir.raycast(e,zm);for(let g=0,v=zm.length;g<v;g++){const _=zm[g];_.object=this,_.batchId=u,t.push(_)}zm.length=0}ir.material=null,ir.geometry.index=null,ir.geometry.attributes={},ir.geometry.setDrawRange(0,1/0)}copy(e){return super.copy(e),this.geometry=e.geometry.clone(),this.perObjectFrustumCulled=e.perObjectFrustumCulled,this.sortObjects=e.sortObjects,this.boundingBox=e.boundingBox!==null?e.boundingBox.clone():null,this.boundingSphere=e.boundingSphere!==null?e.boundingSphere.clone():null,this._geometryInfo=e._geometryInfo.map(t=>({...t,boundingBox:t.boundingBox!==null?t.boundingBox.clone():null,boundingSphere:t.boundingSphere!==null?t.boundingSphere.clone():null})),this._instanceInfo=e._instanceInfo.map(t=>({...t})),this._maxInstanceCount=e._maxInstanceCount,this._maxVertexCount=e._maxVertexCount,this._maxIndexCount=e._maxIndexCount,this._geometryInitialized=e._geometryInitialized,this._geometryCount=e._geometryCount,this._multiDrawCounts=e._multiDrawCounts.slice(),this._multiDrawStarts=e._multiDrawStarts.slice(),this._matricesTexture=e._matricesTexture.clone(),this._matricesTexture.image.data=this._matricesTexture.image.data.slice(),this._colorsTexture!==null&&(this._colorsTexture=e._colorsTexture.clone(),this._colorsTexture.image.data=this._colorsTexture.image.data.slice()),this}dispose(){return this.geometry.dispose(),this._matricesTexture.dispose(),this._matricesTexture=null,this._indirectTexture.dispose(),this._indirectTexture=null,this._colorsTexture!==null&&(this._colorsTexture.dispose(),this._colorsTexture=null),this}onBeforeRender(e,t,n,r,s){if(!this._visibilityChanged&&!this.perObjectFrustumCulled&&!this.sortObjects)return;const a=r.getIndex(),u=a===null?1:a.array.BYTES_PER_ELEMENT,d=this._instanceInfo,h=this._multiDrawStarts,m=this._multiDrawCounts,g=this._geometryInfo,v=this.perObjectFrustumCulled,_=this._indirectTexture,A=_.image.data;v&&(Dr.multiplyMatrices(n.projectionMatrix,n.matrixWorldInverse).multiply(this.matrixWorld),dy.setFromProjectionMatrix(Dr,e.coordinateSystem));let C=0;if(this.sortObjects){Dr.copy(this.matrixWorld).invert(),gh.setFromMatrixPosition(n.matrixWorld).applyMatrix4(Dr),_A.set(0,0,-1).transformDirection(n.matrixWorld).transformDirection(Dr);for(let b=0,R=d.length;b<R;b++)if(d[b].visible&&d[b].active){const P=d[b].geometryIndex;this.getMatrixAt(b,Dr),this.getBoundingSphereAt(P,xu).applyMatrix4(Dr);let U=!1;if(v&&(U=!dy.intersectsSphere(xu)),!U){const F=g[P],k=b3.subVectors(xu.center,gh).dot(_A);hy.push(F.start,F.count,k,b)}}const M=hy.list,S=this.customSort;S===null?M.sort(s.transparent?w3:E3):S.call(this,M,n);for(let b=0,R=M.length;b<R;b++){const P=M[b];h[C]=P.start*u,m[C]=P.count,A[C]=P.index,C++}hy.reset()}else for(let M=0,S=d.length;M<S;M++)if(d[M].visible&&d[M].active){const b=d[M].geometryIndex;let R=!1;if(v&&(this.getMatrixAt(M,Dr),this.getBoundingSphereAt(b,xu).applyMatrix4(Dr),R=!dy.intersectsSphere(xu)),!R){const P=g[b];h[C]=P.start*u,m[C]=P.count,A[C]=M,C++}}_.needsUpdate=!0,this._multiDrawCount=C,this._visibilityChanged=!1}onBeforeShadow(e,t,n,r,s,a){this.onBeforeRender(e,null,r,s,a)}}class or extends Ei{constructor(e){super(),this.isLineBasicMaterial=!0,this.type="LineBasicMaterial",this.color=new tt(16777215),this.map=null,this.linewidth=1,this.linecap="round",this.linejoin="round",this.fog=!0,this.setValues(e)}copy(e){return super.copy(e),this.color.copy(e.color),this.map=e.map,this.linewidth=e.linewidth,this.linecap=e.linecap,this.linejoin=e.linejoin,this.fog=e.fog,this}}const l0=new X,u0=new X,xA=new Ot,vh=new rc,Gm=new ji,py=new X,AA=new X;class Ra extends fn{constructor(e=new Kt,t=new or){super(),this.isLine=!0,this.type="Line",this.geometry=e,this.material=t,this.updateMorphTargets()}copy(e,t){return super.copy(e,t),this.material=Array.isArray(e.material)?e.material.slice():e.material,this.geometry=e.geometry,this}computeLineDistances(){const e=this.geometry;if(e.index===null){const t=e.attributes.position,n=[0];for(let r=1,s=t.count;r<s;r++)l0.fromBufferAttribute(t,r-1),u0.fromBufferAttribute(t,r),n[r]=n[r-1],n[r]+=l0.distanceTo(u0);e.setAttribute("lineDistance",new Tt(n,1))}else console.warn("THREE.Line.computeLineDistances(): Computation only possible with non-indexed BufferGeometry.");return this}raycast(e,t){const n=this.geometry,r=this.matrixWorld,s=e.params.Line.threshold,a=n.drawRange;if(n.boundingSphere===null&&n.computeBoundingSphere(),Gm.copy(n.boundingSphere),Gm.applyMatrix4(r),Gm.radius+=s,e.ray.intersectsSphere(Gm)===!1)return;xA.copy(r).invert(),vh.copy(e.ray).applyMatrix4(xA);const u=s/((this.scale.x+this.scale.y+this.scale.z)/3),d=u*u,h=this.isLineSegments?2:1,m=n.index,v=n.attributes.position;if(m!==null){const _=Math.max(0,a.start),A=Math.min(m.count,a.start+a.count);for(let C=_,M=A-1;C<M;C+=h){const S=m.getX(C),b=m.getX(C+1),R=Vm(this,e,vh,d,S,b,C);R&&t.push(R)}if(this.isLineLoop){const C=m.getX(A-1),M=m.getX(_),S=Vm(this,e,vh,d,C,M,A-1);S&&t.push(S)}}else{const _=Math.max(0,a.start),A=Math.min(v.count,a.start+a.count);for(let C=_,M=A-1;C<M;C+=h){const S=Vm(this,e,vh,d,C,C+1,C);S&&t.push(S)}if(this.isLineLoop){const C=Vm(this,e,vh,d,A-1,_,A-1);C&&t.push(C)}}}updateMorphTargets(){const t=this.geometry.morphAttributes,n=Object.keys(t);if(n.length>0){const r=t[n[0]];if(r!==void 0){this.morphTargetInfluences=[],this.morphTargetDictionary={};for(let s=0,a=r.length;s<a;s++){const u=r[s].name||String(s);this.morphTargetInfluences.push(0),this.morphTargetDictionary[u]=s}}}}}function Vm(i,e,t,n,r,s,a){const u=i.geometry.attributes.position;if(l0.fromBufferAttribute(u,r),u0.fromBufferAttribute(u,s),t.distanceSqToSegment(l0,u0,py,AA)>n)return;py.applyMatrix4(i.matrixWorld);const h=e.ray.origin.distanceTo(py);if(!(h<e.near||h>e.far))return{distance:h,point:AA.clone().applyMatrix4(i.matrixWorld),index:a,face:null,faceIndex:null,barycoord:null,object:i}}const SA=new X,MA=new X;class io extends Ra{constructor(e,t){super(e,t),this.isLineSegments=!0,this.type="LineSegments"}computeLineDistances(){const e=this.geometry;if(e.index===null){const t=e.attributes.position,n=[];for(let r=0,s=t.count;r<s;r+=2)SA.fromBufferAttribute(t,r),MA.fromBufferAttribute(t,r+1),n[r]=r===0?0:n[r-1],n[r+1]=n[r]+SA.distanceTo(MA);e.setAttribute("lineDistance",new Tt(n,1))}else console.warn("THREE.LineSegments.computeLineDistances(): Computation only possible with non-indexed BufferGeometry.");return this}}class ox extends Ra{constructor(e,t){super(e,t),this.isLineLoop=!0,this.type="LineLoop"}}class O0 extends Ei{constructor(e){super(),this.isPointsMaterial=!0,this.type="PointsMaterial",this.color=new tt(16777215),this.map=null,this.alphaMap=null,this.size=1,this.sizeAttenuation=!0,this.fog=!0,this.setValues(e)}copy(e){return super.copy(e),this.color.copy(e.color),this.map=e.map,this.alphaMap=e.alphaMap,this.size=e.size,this.sizeAttenuation=e.sizeAttenuation,this.fog=e.fog,this}}const EA=new Ot,h_=new rc,Wm=new ji,Xm=new X;class ax extends fn{constructor(e=new Kt,t=new O0){super(),this.isPoints=!0,this.type="Points",this.geometry=e,this.material=t,this.updateMorphTargets()}copy(e,t){return super.copy(e,t),this.material=Array.isArray(e.material)?e.material.slice():e.material,this.geometry=e.geometry,this}raycast(e,t){const n=this.geometry,r=this.matrixWorld,s=e.params.Points.threshold,a=n.drawRange;if(n.boundingSphere===null&&n.computeBoundingSphere(),Wm.copy(n.boundingSphere),Wm.applyMatrix4(r),Wm.radius+=s,e.ray.intersectsSphere(Wm)===!1)return;EA.copy(r).invert(),h_.copy(e.ray).applyMatrix4(EA);const u=s/((this.scale.x+this.scale.y+this.scale.z)/3),d=u*u,h=n.index,g=n.attributes.position;if(h!==null){const v=Math.max(0,a.start),_=Math.min(h.count,a.start+a.count);for(let A=v,C=_;A<C;A++){const M=h.getX(A);Xm.fromBufferAttribute(g,M),wA(Xm,M,d,r,e,t,this)}}else{const v=Math.max(0,a.start),_=Math.min(g.count,a.start+a.count);for(let A=v,C=_;A<C;A++)Xm.fromBufferAttribute(g,A),wA(Xm,A,d,r,e,t,this)}}updateMorphTargets(){const t=this.geometry.morphAttributes,n=Object.keys(t);if(n.length>0){const r=t[n[0]];if(r!==void 0){this.morphTargetInfluences=[],this.morphTargetDictionary={};for(let s=0,a=r.length;s<a;s++){const u=r[s].name||String(s);this.morphTargetInfluences.push(0),this.morphTargetDictionary[u]=s}}}}}function wA(i,e,t,n,r,s,a){const u=h_.distanceSqToPoint(i);if(u<t){const d=new X;h_.closestPointToPoint(i,d),d.applyMatrix4(n);const h=r.ray.origin.distanceTo(d);if(h<r.near||h>r.far)return;s.push({distance:h,distanceToRay:Math.sqrt(u),point:d,index:e,face:null,faceIndex:null,barycoord:null,object:a})}}class HM extends zn{constructor(e,t,n,r,s,a,u,d,h){super(e,t,n,r,s,a,u,d,h),this.isVideoTexture=!0,this.minFilter=a!==void 0?a:ri,this.magFilter=s!==void 0?s:ri,this.generateMipmaps=!1;const m=this;function g(){m.needsUpdate=!0,e.requestVideoFrameCallback(g)}"requestVideoFrameCallback"in e&&e.requestVideoFrameCallback(g)}clone(){return new this.constructor(this.image).copy(this)}update(){const e=this.image;"requestVideoFrameCallback"in e===!1&&e.readyState>=e.HAVE_CURRENT_DATA&&(this.needsUpdate=!0)}}class I3 extends HM{constructor(e,t,n,r,s,a,u,d){super({},e,t,n,r,s,a,u,d),this.isVideoFrameTexture=!0}update(){}clone(){return new this.constructor().copy(this)}setFrame(e){this.image=e,this.needsUpdate=!0}}class P3 extends zn{constructor(e,t){super({width:e,height:t}),this.isFramebufferTexture=!0,this.magFilter=Di,this.minFilter=Di,this.generateMipmaps=!1,this.needsUpdate=!0}}class k0 extends zn{constructor(e,t,n,r,s,a,u,d,h,m,g,v){super(null,a,u,d,h,m,r,s,g,v),this.isCompressedTexture=!0,this.image={width:t,height:n},this.mipmaps=e,this.flipY=!1,this.generateMipmaps=!1}}class B3 extends k0{constructor(e,t,n,r,s,a){super(e,t,n,s,a),this.isCompressedArrayTexture=!0,this.image.depth=r,this.wrapR=$r,this.layerUpdates=new Set}addLayerUpdate(e){this.layerUpdates.add(e)}clearLayerUpdates(){this.layerUpdates.clear()}}class L3 extends k0{constructor(e,t,n){super(void 0,e[0].width,e[0].height,t,n,Ta),this.isCompressedCubeTexture=!0,this.isCubeTexture=!0,this.image=e}}class D3 extends zn{constructor(e,t,n,r,s,a,u,d,h){super(e,t,n,r,s,a,u,d,h),this.isCanvasTexture=!0,this.needsUpdate=!0}}class lx extends zn{constructor(e,t,n,r,s,a,u,d,h,m=Wu){if(m!==Wu&&m!==Qu)throw new Error("DepthTexture format must be either THREE.DepthFormat or THREE.DepthStencilFormat");n===void 0&&m===Wu&&(n=ba),n===void 0&&m===Qu&&(n=Yu),super(null,r,s,a,u,d,m,n,h),this.isDepthTexture=!0,this.image={width:e,height:t},this.magFilter=u!==void 0?u:Di,this.minFilter=d!==void 0?d:Di,this.flipY=!1,this.generateMipmaps=!1,this.compareFunction=null}copy(e){return super.copy(e),this.compareFunction=e.compareFunction,this}toJSON(e){const t=super.toJSON(e);return this.compareFunction!==null&&(t.compareFunction=this.compareFunction),t}}class ro{constructor(){this.type="Curve",this.arcLengthDivisions=200}getPoint(){return console.warn("THREE.Curve: .getPoint() not implemented."),null}getPointAt(e,t){const n=this.getUtoTmapping(e);return this.getPoint(n,t)}getPoints(e=5){const t=[];for(let n=0;n<=e;n++)t.push(this.getPoint(n/e));return t}getSpacedPoints(e=5){const t=[];for(let n=0;n<=e;n++)t.push(this.getPointAt(n/e));return t}getLength(){const e=this.getLengths();return e[e.length-1]}getLengths(e=this.arcLengthDivisions){if(this.cacheArcLengths&&this.cacheArcLengths.length===e+1&&!this.needsUpdate)return this.cacheArcLengths;this.needsUpdate=!1;const t=[];let n,r=this.getPoint(0),s=0;t.push(0);for(let a=1;a<=e;a++)n=this.getPoint(a/e),s+=n.distanceTo(r),t.push(s),r=n;return this.cacheArcLengths=t,t}updateArcLengths(){this.needsUpdate=!0,this.getLengths()}getUtoTmapping(e,t){const n=this.getLengths();let r=0;const s=n.length;let a;t?a=t:a=e*n[s-1];let u=0,d=s-1,h;for(;u<=d;)if(r=Math.floor(u+(d-u)/2),h=n[r]-a,h<0)u=r+1;else if(h>0)d=r-1;else{d=r;break}if(r=d,n[r]===a)return r/(s-1);const m=n[r],v=n[r+1]-m,_=(a-m)/v;return(r+_)/(s-1)}getTangent(e,t){let r=e-1e-4,s=e+1e-4;r<0&&(r=0),s>1&&(s=1);const a=this.getPoint(r),u=this.getPoint(s),d=t||(a.isVector2?new Le:new X);return d.copy(u).sub(a).normalize(),d}getTangentAt(e,t){const n=this.getUtoTmapping(e);return this.getTangent(n,t)}computeFrenetFrames(e,t){const n=new X,r=[],s=[],a=[],u=new X,d=new Ot;for(let _=0;_<=e;_++){const A=_/e;r[_]=this.getTangentAt(A,new X)}s[0]=new X,a[0]=new X;let h=Number.MAX_VALUE;const m=Math.abs(r[0].x),g=Math.abs(r[0].y),v=Math.abs(r[0].z);m<=h&&(h=m,n.set(1,0,0)),g<=h&&(h=g,n.set(0,1,0)),v<=h&&n.set(0,0,1),u.crossVectors(r[0],n).normalize(),s[0].crossVectors(r[0],u),a[0].crossVectors(r[0],s[0]);for(let _=1;_<=e;_++){if(s[_]=s[_-1].clone(),a[_]=a[_-1].clone(),u.crossVectors(r[_-1],r[_]),u.length()>Number.EPSILON){u.normalize();const A=Math.acos(Xt(r[_-1].dot(r[_]),-1,1));s[_].applyMatrix4(d.makeRotationAxis(u,A))}a[_].crossVectors(r[_],s[_])}if(t===!0){let _=Math.acos(Xt(s[0].dot(s[e]),-1,1));_/=e,r[0].dot(u.crossVectors(s[0],s[e]))>0&&(_=-_);for(let A=1;A<=e;A++)s[A].applyMatrix4(d.makeRotationAxis(r[A],_*A)),a[A].crossVectors(r[A],s[A])}return{tangents:r,normals:s,binormals:a}}clone(){return new this.constructor().copy(this)}copy(e){return this.arcLengthDivisions=e.arcLengthDivisions,this}toJSON(){const e={metadata:{version:4.6,type:"Curve",generator:"Curve.toJSON"}};return e.arcLengthDivisions=this.arcLengthDivisions,e.type=this.type,e}fromJSON(e){return this.arcLengthDivisions=e.arcLengthDivisions,this}}class H0 extends ro{constructor(e=0,t=0,n=1,r=1,s=0,a=Math.PI*2,u=!1,d=0){super(),this.isEllipseCurve=!0,this.type="EllipseCurve",this.aX=e,this.aY=t,this.xRadius=n,this.yRadius=r,this.aStartAngle=s,this.aEndAngle=a,this.aClockwise=u,this.aRotation=d}getPoint(e,t=new Le){const n=t,r=Math.PI*2;let s=this.aEndAngle-this.aStartAngle;const a=Math.abs(s)<Number.EPSILON;for(;s<0;)s+=r;for(;s>r;)s-=r;s<Number.EPSILON&&(a?s=0:s=r),this.aClockwise===!0&&!a&&(s===r?s=-r:s=s-r);const u=this.aStartAngle+e*s;let d=this.aX+this.xRadius*Math.cos(u),h=this.aY+this.yRadius*Math.sin(u);if(this.aRotation!==0){const m=Math.cos(this.aRotation),g=Math.sin(this.aRotation),v=d-this.aX,_=h-this.aY;d=v*m-_*g+this.aX,h=v*g+_*m+this.aY}return n.set(d,h)}copy(e){return super.copy(e),this.aX=e.aX,this.aY=e.aY,this.xRadius=e.xRadius,this.yRadius=e.yRadius,this.aStartAngle=e.aStartAngle,this.aEndAngle=e.aEndAngle,this.aClockwise=e.aClockwise,this.aRotation=e.aRotation,this}toJSON(){const e=super.toJSON();return e.aX=this.aX,e.aY=this.aY,e.xRadius=this.xRadius,e.yRadius=this.yRadius,e.aStartAngle=this.aStartAngle,e.aEndAngle=this.aEndAngle,e.aClockwise=this.aClockwise,e.aRotation=this.aRotation,e}fromJSON(e){return super.fromJSON(e),this.aX=e.aX,this.aY=e.aY,this.xRadius=e.xRadius,this.yRadius=e.yRadius,this.aStartAngle=e.aStartAngle,this.aEndAngle=e.aEndAngle,this.aClockwise=e.aClockwise,this.aRotation=e.aRotation,this}}class zM extends H0{constructor(e,t,n,r,s,a){super(e,t,n,n,r,s,a),this.isArcCurve=!0,this.type="ArcCurve"}}function ux(){let i=0,e=0,t=0,n=0;function r(s,a,u,d){i=s,e=u,t=-3*s+3*a-2*u-d,n=2*s-2*a+u+d}return{initCatmullRom:function(s,a,u,d,h){r(a,u,h*(u-s),h*(d-a))},initNonuniformCatmullRom:function(s,a,u,d,h,m,g){let v=(a-s)/h-(u-s)/(h+m)+(u-a)/m,_=(u-a)/m-(d-a)/(m+g)+(d-u)/g;v*=m,_*=m,r(a,u,v,_)},calc:function(s){const a=s*s,u=a*s;return i+e*s+t*a+n*u}}}const jm=new X,my=new ux,gy=new ux,vy=new ux;class GM extends ro{constructor(e=[],t=!1,n="centripetal",r=.5){super(),this.isCatmullRomCurve3=!0,this.type="CatmullRomCurve3",this.points=e,this.closed=t,this.curveType=n,this.tension=r}getPoint(e,t=new X){const n=t,r=this.points,s=r.length,a=(s-(this.closed?0:1))*e;let u=Math.floor(a),d=a-u;this.closed?u+=u>0?0:(Math.floor(Math.abs(u)/s)+1)*s:d===0&&u===s-1&&(u=s-2,d=1);let h,m;this.closed||u>0?h=r[(u-1)%s]:(jm.subVectors(r[0],r[1]).add(r[0]),h=jm);const g=r[u%s],v=r[(u+1)%s];if(this.closed||u+2<s?m=r[(u+2)%s]:(jm.subVectors(r[s-1],r[s-2]).add(r[s-1]),m=jm),this.curveType==="centripetal"||this.curveType==="chordal"){const _=this.curveType==="chordal"?.5:.25;let A=Math.pow(h.distanceToSquared(g),_),C=Math.pow(g.distanceToSquared(v),_),M=Math.pow(v.distanceToSquared(m),_);C<1e-4&&(C=1),A<1e-4&&(A=C),M<1e-4&&(M=C),my.initNonuniformCatmullRom(h.x,g.x,v.x,m.x,A,C,M),gy.initNonuniformCatmullRom(h.y,g.y,v.y,m.y,A,C,M),vy.initNonuniformCatmullRom(h.z,g.z,v.z,m.z,A,C,M)}else this.curveType==="catmullrom"&&(my.initCatmullRom(h.x,g.x,v.x,m.x,this.tension),gy.initCatmullRom(h.y,g.y,v.y,m.y,this.tension),vy.initCatmullRom(h.z,g.z,v.z,m.z,this.tension));return n.set(my.calc(d),gy.calc(d),vy.calc(d)),n}copy(e){super.copy(e),this.points=[];for(let t=0,n=e.points.length;t<n;t++){const r=e.points[t];this.points.push(r.clone())}return this.closed=e.closed,this.curveType=e.curveType,this.tension=e.tension,this}toJSON(){const e=super.toJSON();e.points=[];for(let t=0,n=this.points.length;t<n;t++){const r=this.points[t];e.points.push(r.toArray())}return e.closed=this.closed,e.curveType=this.curveType,e.tension=this.tension,e}fromJSON(e){super.fromJSON(e),this.points=[];for(let t=0,n=e.points.length;t<n;t++){const r=e.points[t];this.points.push(new X().fromArray(r))}return this.closed=e.closed,this.curveType=e.curveType,this.tension=e.tension,this}}function CA(i,e,t,n,r){const s=(n-e)*.5,a=(r-t)*.5,u=i*i,d=i*u;return(2*t-2*n+s+a)*d+(-3*t+3*n-2*s-a)*u+s*i+t}function F3(i,e){const t=1-i;return t*t*e}function N3(i,e){return 2*(1-i)*i*e}function U3(i,e){return i*i*e}function Dh(i,e,t,n){return F3(i,e)+N3(i,t)+U3(i,n)}function O3(i,e){const t=1-i;return t*t*t*e}function k3(i,e){const t=1-i;return 3*t*t*i*e}function H3(i,e){return 3*(1-i)*i*i*e}function z3(i,e){return i*i*i*e}function Fh(i,e,t,n,r){return O3(i,e)+k3(i,t)+H3(i,n)+z3(i,r)}class cx extends ro{constructor(e=new Le,t=new Le,n=new Le,r=new Le){super(),this.isCubicBezierCurve=!0,this.type="CubicBezierCurve",this.v0=e,this.v1=t,this.v2=n,this.v3=r}getPoint(e,t=new Le){const n=t,r=this.v0,s=this.v1,a=this.v2,u=this.v3;return n.set(Fh(e,r.x,s.x,a.x,u.x),Fh(e,r.y,s.y,a.y,u.y)),n}copy(e){return super.copy(e),this.v0.copy(e.v0),this.v1.copy(e.v1),this.v2.copy(e.v2),this.v3.copy(e.v3),this}toJSON(){const e=super.toJSON();return e.v0=this.v0.toArray(),e.v1=this.v1.toArray(),e.v2=this.v2.toArray(),e.v3=this.v3.toArray(),e}fromJSON(e){return super.fromJSON(e),this.v0.fromArray(e.v0),this.v1.fromArray(e.v1),this.v2.fromArray(e.v2),this.v3.fromArray(e.v3),this}}class VM extends ro{constructor(e=new X,t=new X,n=new X,r=new X){super(),this.isCubicBezierCurve3=!0,this.type="CubicBezierCurve3",this.v0=e,this.v1=t,this.v2=n,this.v3=r}getPoint(e,t=new X){const n=t,r=this.v0,s=this.v1,a=this.v2,u=this.v3;return n.set(Fh(e,r.x,s.x,a.x,u.x),Fh(e,r.y,s.y,a.y,u.y),Fh(e,r.z,s.z,a.z,u.z)),n}copy(e){return super.copy(e),this.v0.copy(e.v0),this.v1.copy(e.v1),this.v2.copy(e.v2),this.v3.copy(e.v3),this}toJSON(){const e=super.toJSON();return e.v0=this.v0.toArray(),e.v1=this.v1.toArray(),e.v2=this.v2.toArray(),e.v3=this.v3.toArray(),e}fromJSON(e){return super.fromJSON(e),this.v0.fromArray(e.v0),this.v1.fromArray(e.v1),this.v2.fromArray(e.v2),this.v3.fromArray(e.v3),this}}class fx extends ro{constructor(e=new Le,t=new Le){super(),this.isLineCurve=!0,this.type="LineCurve",this.v1=e,this.v2=t}getPoint(e,t=new Le){const n=t;return e===1?n.copy(this.v2):(n.copy(this.v2).sub(this.v1),n.multiplyScalar(e).add(this.v1)),n}getPointAt(e,t){return this.getPoint(e,t)}getTangent(e,t=new Le){return t.subVectors(this.v2,this.v1).normalize()}getTangentAt(e,t){return this.getTangent(e,t)}copy(e){return super.copy(e),this.v1.copy(e.v1),this.v2.copy(e.v2),this}toJSON(){const e=super.toJSON();return e.v1=this.v1.toArray(),e.v2=this.v2.toArray(),e}fromJSON(e){return super.fromJSON(e),this.v1.fromArray(e.v1),this.v2.fromArray(e.v2),this}}class WM extends ro{constructor(e=new X,t=new X){super(),this.isLineCurve3=!0,this.type="LineCurve3",this.v1=e,this.v2=t}getPoint(e,t=new X){const n=t;return e===1?n.copy(this.v2):(n.copy(this.v2).sub(this.v1),n.multiplyScalar(e).add(this.v1)),n}getPointAt(e,t){return this.getPoint(e,t)}getTangent(e,t=new X){return t.subVectors(this.v2,this.v1).normalize()}getTangentAt(e,t){return this.getTangent(e,t)}copy(e){return super.copy(e),this.v1.copy(e.v1),this.v2.copy(e.v2),this}toJSON(){const e=super.toJSON();return e.v1=this.v1.toArray(),e.v2=this.v2.toArray(),e}fromJSON(e){return super.fromJSON(e),this.v1.fromArray(e.v1),this.v2.fromArray(e.v2),this}}class dx extends ro{constructor(e=new Le,t=new Le,n=new Le){super(),this.isQuadraticBezierCurve=!0,this.type="QuadraticBezierCurve",this.v0=e,this.v1=t,this.v2=n}getPoint(e,t=new Le){const n=t,r=this.v0,s=this.v1,a=this.v2;return n.set(Dh(e,r.x,s.x,a.x),Dh(e,r.y,s.y,a.y)),n}copy(e){return super.copy(e),this.v0.copy(e.v0),this.v1.copy(e.v1),this.v2.copy(e.v2),this}toJSON(){const e=super.toJSON();return e.v0=this.v0.toArray(),e.v1=this.v1.toArray(),e.v2=this.v2.toArray(),e}fromJSON(e){return super.fromJSON(e),this.v0.fromArray(e.v0),this.v1.fromArray(e.v1),this.v2.fromArray(e.v2),this}}class hx extends ro{constructor(e=new X,t=new X,n=new X){super(),this.isQuadraticBezierCurve3=!0,this.type="QuadraticBezierCurve3",this.v0=e,this.v1=t,this.v2=n}getPoint(e,t=new X){const n=t,r=this.v0,s=this.v1,a=this.v2;return n.set(Dh(e,r.x,s.x,a.x),Dh(e,r.y,s.y,a.y),Dh(e,r.z,s.z,a.z)),n}copy(e){return super.copy(e),this.v0.copy(e.v0),this.v1.copy(e.v1),this.v2.copy(e.v2),this}toJSON(){const e=super.toJSON();return e.v0=this.v0.toArray(),e.v1=this.v1.toArray(),e.v2=this.v2.toArray(),e}fromJSON(e){return super.fromJSON(e),this.v0.fromArray(e.v0),this.v1.fromArray(e.v1),this.v2.fromArray(e.v2),this}}class px extends ro{constructor(e=[]){super(),this.isSplineCurve=!0,this.type="SplineCurve",this.points=e}getPoint(e,t=new Le){const n=t,r=this.points,s=(r.length-1)*e,a=Math.floor(s),u=s-a,d=r[a===0?a:a-1],h=r[a],m=r[a>r.length-2?r.length-1:a+1],g=r[a>r.length-3?r.length-1:a+2];return n.set(CA(u,d.x,h.x,m.x,g.x),CA(u,d.y,h.y,m.y,g.y)),n}copy(e){super.copy(e),this.points=[];for(let t=0,n=e.points.length;t<n;t++){const r=e.points[t];this.points.push(r.clone())}return this}toJSON(){const e=super.toJSON();e.points=[];for(let t=0,n=this.points.length;t<n;t++){const r=this.points[t];e.points.push(r.toArray())}return e}fromJSON(e){super.fromJSON(e),this.points=[];for(let t=0,n=e.points.length;t<n;t++){const r=e.points[t];this.points.push(new Le().fromArray(r))}return this}}var c0=Object.freeze({__proto__:null,ArcCurve:zM,CatmullRomCurve3:GM,CubicBezierCurve:cx,CubicBezierCurve3:VM,EllipseCurve:H0,LineCurve:fx,LineCurve3:WM,QuadraticBezierCurve:dx,QuadraticBezierCurve3:hx,SplineCurve:px});class XM extends ro{constructor(){super(),this.type="CurvePath",this.curves=[],this.autoClose=!1}add(e){this.curves.push(e)}closePath(){const e=this.curves[0].getPoint(0),t=this.curves[this.curves.length-1].getPoint(1);if(!e.equals(t)){const n=e.isVector2===!0?"LineCurve":"LineCurve3";this.curves.push(new c0[n](t,e))}return this}getPoint(e,t){const n=e*this.getLength(),r=this.getCurveLengths();let s=0;for(;s<r.length;){if(r[s]>=n){const a=r[s]-n,u=this.curves[s],d=u.getLength(),h=d===0?0:1-a/d;return u.getPointAt(h,t)}s++}return null}getLength(){const e=this.getCurveLengths();return e[e.length-1]}updateArcLengths(){this.needsUpdate=!0,this.cacheLengths=null,this.getCurveLengths()}getCurveLengths(){if(this.cacheLengths&&this.cacheLengths.length===this.curves.length)return this.cacheLengths;const e=[];let t=0;for(let n=0,r=this.curves.length;n<r;n++)t+=this.curves[n].getLength(),e.push(t);return this.cacheLengths=e,e}getSpacedPoints(e=40){const t=[];for(let n=0;n<=e;n++)t.push(this.getPoint(n/e));return this.autoClose&&t.push(t[0]),t}getPoints(e=12){const t=[];let n;for(let r=0,s=this.curves;r<s.length;r++){const a=s[r],u=a.isEllipseCurve?e*2:a.isLineCurve||a.isLineCurve3?1:a.isSplineCurve?e*a.points.length:e,d=a.getPoints(u);for(let h=0;h<d.length;h++){const m=d[h];n&&n.equals(m)||(t.push(m),n=m)}}return this.autoClose&&t.length>1&&!t[t.length-1].equals(t[0])&&t.push(t[0]),t}copy(e){super.copy(e),this.curves=[];for(let t=0,n=e.curves.length;t<n;t++){const r=e.curves[t];this.curves.push(r.clone())}return this.autoClose=e.autoClose,this}toJSON(){const e=super.toJSON();e.autoClose=this.autoClose,e.curves=[];for(let t=0,n=this.curves.length;t<n;t++){const r=this.curves[t];e.curves.push(r.toJSON())}return e}fromJSON(e){super.fromJSON(e),this.autoClose=e.autoClose,this.curves=[];for(let t=0,n=e.curves.length;t<n;t++){const r=e.curves[t];this.curves.push(new c0[r.type]().fromJSON(r))}return this}}class Xh extends XM{constructor(e){super(),this.type="Path",this.currentPoint=new Le,e&&this.setFromPoints(e)}setFromPoints(e){this.moveTo(e[0].x,e[0].y);for(let t=1,n=e.length;t<n;t++)this.lineTo(e[t].x,e[t].y);return this}moveTo(e,t){return this.currentPoint.set(e,t),this}lineTo(e,t){const n=new fx(this.currentPoint.clone(),new Le(e,t));return this.curves.push(n),this.currentPoint.set(e,t),this}quadraticCurveTo(e,t,n,r){const s=new dx(this.currentPoint.clone(),new Le(e,t),new Le(n,r));return this.curves.push(s),this.currentPoint.set(n,r),this}bezierCurveTo(e,t,n,r,s,a){const u=new cx(this.currentPoint.clone(),new Le(e,t),new Le(n,r),new Le(s,a));return this.curves.push(u),this.currentPoint.set(s,a),this}splineThru(e){const t=[this.currentPoint.clone()].concat(e),n=new px(t);return this.curves.push(n),this.currentPoint.copy(e[e.length-1]),this}arc(e,t,n,r,s,a){const u=this.currentPoint.x,d=this.currentPoint.y;return this.absarc(e+u,t+d,n,r,s,a),this}absarc(e,t,n,r,s,a){return this.absellipse(e,t,n,n,r,s,a),this}ellipse(e,t,n,r,s,a,u,d){const h=this.currentPoint.x,m=this.currentPoint.y;return this.absellipse(e+h,t+m,n,r,s,a,u,d),this}absellipse(e,t,n,r,s,a,u,d){const h=new H0(e,t,n,r,s,a,u,d);if(this.curves.length>0){const g=h.getPoint(0);g.equals(this.currentPoint)||this.lineTo(g.x,g.y)}this.curves.push(h);const m=h.getPoint(1);return this.currentPoint.copy(m),this}copy(e){return super.copy(e),this.currentPoint.copy(e.currentPoint),this}toJSON(){const e=super.toJSON();return e.currentPoint=this.currentPoint.toArray(),e}fromJSON(e){return super.fromJSON(e),this.currentPoint.fromArray(e.currentPoint),this}}class dp extends Kt{constructor(e=[new Le(0,-.5),new Le(.5,0),new Le(0,.5)],t=12,n=0,r=Math.PI*2){super(),this.type="LatheGeometry",this.parameters={points:e,segments:t,phiStart:n,phiLength:r},t=Math.floor(t),r=Xt(r,0,Math.PI*2);const s=[],a=[],u=[],d=[],h=[],m=1/t,g=new X,v=new Le,_=new X,A=new X,C=new X;let M=0,S=0;for(let b=0;b<=e.length-1;b++)switch(b){case 0:M=e[b+1].x-e[b].x,S=e[b+1].y-e[b].y,_.x=S*1,_.y=-M,_.z=S*0,C.copy(_),_.normalize(),d.push(_.x,_.y,_.z);break;case e.length-1:d.push(C.x,C.y,C.z);break;default:M=e[b+1].x-e[b].x,S=e[b+1].y-e[b].y,_.x=S*1,_.y=-M,_.z=S*0,A.copy(_),_.x+=C.x,_.y+=C.y,_.z+=C.z,_.normalize(),d.push(_.x,_.y,_.z),C.copy(A)}for(let b=0;b<=t;b++){const R=n+b*m*r,P=Math.sin(R),U=Math.cos(R);for(let F=0;F<=e.length-1;F++){g.x=e[F].x*P,g.y=e[F].y,g.z=e[F].x*U,a.push(g.x,g.y,g.z),v.x=b/t,v.y=F/(e.length-1),u.push(v.x,v.y);const k=d[3*F+0]*P,G=d[3*F+1],D=d[3*F+0]*U;h.push(k,G,D)}}for(let b=0;b<t;b++)for(let R=0;R<e.length-1;R++){const P=R+b*e.length,U=P,F=P+e.length,k=P+e.length+1,G=P+1;s.push(U,F,G),s.push(k,G,F)}this.setIndex(s),this.setAttribute("position",new Tt(a,3)),this.setAttribute("uv",new Tt(u,2)),this.setAttribute("normal",new Tt(h,3))}copy(e){return super.copy(e),this.parameters=Object.assign({},e.parameters),this}static fromJSON(e){return new dp(e.points,e.segments,e.phiStart,e.phiLength)}}class z0 extends dp{constructor(e=1,t=1,n=4,r=8){const s=new Xh;s.absarc(0,-t/2,e,Math.PI*1.5,0),s.absarc(0,t/2,e,0,Math.PI*.5),super(s.getPoints(n),r),this.type="CapsuleGeometry",this.parameters={radius:e,length:t,capSegments:n,radialSegments:r}}static fromJSON(e){return new z0(e.radius,e.length,e.capSegments,e.radialSegments)}}class G0 extends Kt{constructor(e=1,t=32,n=0,r=Math.PI*2){super(),this.type="CircleGeometry",this.parameters={radius:e,segments:t,thetaStart:n,thetaLength:r},t=Math.max(3,t);const s=[],a=[],u=[],d=[],h=new X,m=new Le;a.push(0,0,0),u.push(0,0,1),d.push(.5,.5);for(let g=0,v=3;g<=t;g++,v+=3){const _=n+g/t*r;h.x=e*Math.cos(_),h.y=e*Math.sin(_),a.push(h.x,h.y,h.z),u.push(0,0,1),m.x=(a[v]/e+1)/2,m.y=(a[v+1]/e+1)/2,d.push(m.x,m.y)}for(let g=1;g<=t;g++)s.push(g,g+1,0);this.setIndex(s),this.setAttribute("position",new Tt(a,3)),this.setAttribute("normal",new Tt(u,3)),this.setAttribute("uv",new Tt(d,2))}copy(e){return super.copy(e),this.parameters=Object.assign({},e.parameters),this}static fromJSON(e){return new G0(e.radius,e.segments,e.thetaStart,e.thetaLength)}}class od extends Kt{constructor(e=1,t=1,n=1,r=32,s=1,a=!1,u=0,d=Math.PI*2){super(),this.type="CylinderGeometry",this.parameters={radiusTop:e,radiusBottom:t,height:n,radialSegments:r,heightSegments:s,openEnded:a,thetaStart:u,thetaLength:d};const h=this;r=Math.floor(r),s=Math.floor(s);const m=[],g=[],v=[],_=[];let A=0;const C=[],M=n/2;let S=0;b(),a===!1&&(e>0&&R(!0),t>0&&R(!1)),this.setIndex(m),this.setAttribute("position",new Tt(g,3)),this.setAttribute("normal",new Tt(v,3)),this.setAttribute("uv",new Tt(_,2));function b(){const P=new X,U=new X;let F=0;const k=(t-e)/n;for(let G=0;G<=s;G++){const D=[],L=G/s,V=L*(t-e)+e;for(let oe=0;oe<=r;oe++){const ie=oe/r,ge=ie*d+u,ye=Math.sin(ge),he=Math.cos(ge);U.x=V*ye,U.y=-L*n+M,U.z=V*he,g.push(U.x,U.y,U.z),P.set(ye,k,he).normalize(),v.push(P.x,P.y,P.z),_.push(ie,1-L),D.push(A++)}C.push(D)}for(let G=0;G<r;G++)for(let D=0;D<s;D++){const L=C[D][G],V=C[D+1][G],oe=C[D+1][G+1],ie=C[D][G+1];(e>0||D!==0)&&(m.push(L,V,ie),F+=3),(t>0||D!==s-1)&&(m.push(V,oe,ie),F+=3)}h.addGroup(S,F,0),S+=F}function R(P){const U=A,F=new Le,k=new X;let G=0;const D=P===!0?e:t,L=P===!0?1:-1;for(let oe=1;oe<=r;oe++)g.push(0,M*L,0),v.push(0,L,0),_.push(.5,.5),A++;const V=A;for(let oe=0;oe<=r;oe++){const ge=oe/r*d+u,ye=Math.cos(ge),he=Math.sin(ge);k.x=D*he,k.y=M*L,k.z=D*ye,g.push(k.x,k.y,k.z),v.push(0,L,0),F.x=ye*.5+.5,F.y=he*.5*L+.5,_.push(F.x,F.y),A++}for(let oe=0;oe<r;oe++){const ie=U+oe,ge=V+oe;P===!0?m.push(ge,ge+1,ie):m.push(ge+1,ge,ie),G+=3}h.addGroup(S,G,P===!0?1:2),S+=G}}copy(e){return super.copy(e),this.parameters=Object.assign({},e.parameters),this}static fromJSON(e){return new od(e.radiusTop,e.radiusBottom,e.height,e.radialSegments,e.heightSegments,e.openEnded,e.thetaStart,e.thetaLength)}}class V0 extends od{constructor(e=1,t=1,n=32,r=1,s=!1,a=0,u=Math.PI*2){super(0,e,t,n,r,s,a,u),this.type="ConeGeometry",this.parameters={radius:e,height:t,radialSegments:n,heightSegments:r,openEnded:s,thetaStart:a,thetaLength:u}}static fromJSON(e){return new V0(e.radius,e.height,e.radialSegments,e.heightSegments,e.openEnded,e.thetaStart,e.thetaLength)}}class Rl extends Kt{constructor(e=[],t=[],n=1,r=0){super(),this.type="PolyhedronGeometry",this.parameters={vertices:e,indices:t,radius:n,detail:r};const s=[],a=[];u(r),h(n),m(),this.setAttribute("position",new Tt(s,3)),this.setAttribute("normal",new Tt(s.slice(),3)),this.setAttribute("uv",new Tt(a,2)),r===0?this.computeVertexNormals():this.normalizeNormals();function u(b){const R=new X,P=new X,U=new X;for(let F=0;F<t.length;F+=3)_(t[F+0],R),_(t[F+1],P),_(t[F+2],U),d(R,P,U,b)}function d(b,R,P,U){const F=U+1,k=[];for(let G=0;G<=F;G++){k[G]=[];const D=b.clone().lerp(P,G/F),L=R.clone().lerp(P,G/F),V=F-G;for(let oe=0;oe<=V;oe++)oe===0&&G===F?k[G][oe]=D:k[G][oe]=D.clone().lerp(L,oe/V)}for(let G=0;G<F;G++)for(let D=0;D<2*(F-G)-1;D++){const L=Math.floor(D/2);D%2===0?(v(k[G][L+1]),v(k[G+1][L]),v(k[G][L])):(v(k[G][L+1]),v(k[G+1][L+1]),v(k[G+1][L]))}}function h(b){const R=new X;for(let P=0;P<s.length;P+=3)R.x=s[P+0],R.y=s[P+1],R.z=s[P+2],R.normalize().multiplyScalar(b),s[P+0]=R.x,s[P+1]=R.y,s[P+2]=R.z}function m(){const b=new X;for(let R=0;R<s.length;R+=3){b.x=s[R+0],b.y=s[R+1],b.z=s[R+2];const P=M(b)/2/Math.PI+.5,U=S(b)/Math.PI+.5;a.push(P,1-U)}A(),g()}function g(){for(let b=0;b<a.length;b+=6){const R=a[b+0],P=a[b+2],U=a[b+4],F=Math.max(R,P,U),k=Math.min(R,P,U);F>.9&&k<.1&&(R<.2&&(a[b+0]+=1),P<.2&&(a[b+2]+=1),U<.2&&(a[b+4]+=1))}}function v(b){s.push(b.x,b.y,b.z)}function _(b,R){const P=b*3;R.x=e[P+0],R.y=e[P+1],R.z=e[P+2]}function A(){const b=new X,R=new X,P=new X,U=new X,F=new Le,k=new Le,G=new Le;for(let D=0,L=0;D<s.length;D+=9,L+=6){b.set(s[D+0],s[D+1],s[D+2]),R.set(s[D+3],s[D+4],s[D+5]),P.set(s[D+6],s[D+7],s[D+8]),F.set(a[L+0],a[L+1]),k.set(a[L+2],a[L+3]),G.set(a[L+4],a[L+5]),U.copy(b).add(R).add(P).divideScalar(3);const V=M(U);C(F,L+0,b,V),C(k,L+2,R,V),C(G,L+4,P,V)}}function C(b,R,P,U){U<0&&b.x===1&&(a[R]=b.x-1),P.x===0&&P.z===0&&(a[R]=U/2/Math.PI+.5)}function M(b){return Math.atan2(b.z,-b.x)}function S(b){return Math.atan2(-b.y,Math.sqrt(b.x*b.x+b.z*b.z))}}copy(e){return super.copy(e),this.parameters=Object.assign({},e.parameters),this}static fromJSON(e){return new Rl(e.vertices,e.indices,e.radius,e.details)}}class W0 extends Rl{constructor(e=1,t=0){const n=(1+Math.sqrt(5))/2,r=1/n,s=[-1,-1,-1,-1,-1,1,-1,1,-1,-1,1,1,1,-1,-1,1,-1,1,1,1,-1,1,1,1,0,-r,-n,0,-r,n,0,r,-n,0,r,n,-r,-n,0,-r,n,0,r,-n,0,r,n,0,-n,0,-r,n,0,-r,-n,0,r,n,0,r],a=[3,11,7,3,7,15,3,15,13,7,19,17,7,17,6,7,6,15,17,4,8,17,8,10,17,10,6,8,0,16,8,16,2,8,2,10,0,12,1,0,1,18,0,18,16,6,10,2,6,2,13,6,13,15,2,16,18,2,18,3,2,3,13,18,1,9,18,9,11,18,11,3,4,14,12,4,12,0,4,0,8,11,9,5,11,5,19,11,19,7,19,5,14,19,14,4,19,4,17,1,12,14,1,14,5,1,5,9];super(s,a,e,t),this.type="DodecahedronGeometry",this.parameters={radius:e,detail:t}}static fromJSON(e){return new W0(e.radius,e.detail)}}const Jm=new X,Km=new X,yy=new X,Ym=new Ur;class jM extends Kt{constructor(e=null,t=1){if(super(),this.type="EdgesGeometry",this.parameters={geometry:e,thresholdAngle:t},e!==null){const r=Math.pow(10,4),s=Math.cos(Xu*t),a=e.getIndex(),u=e.getAttribute("position"),d=a?a.count:u.count,h=[0,0,0],m=["a","b","c"],g=new Array(3),v={},_=[];for(let A=0;A<d;A+=3){a?(h[0]=a.getX(A),h[1]=a.getX(A+1),h[2]=a.getX(A+2)):(h[0]=A,h[1]=A+1,h[2]=A+2);const{a:C,b:M,c:S}=Ym;if(C.fromBufferAttribute(u,h[0]),M.fromBufferAttribute(u,h[1]),S.fromBufferAttribute(u,h[2]),Ym.getNormal(yy),g[0]=`${Math.round(C.x*r)},${Math.round(C.y*r)},${Math.round(C.z*r)}`,g[1]=`${Math.round(M.x*r)},${Math.round(M.y*r)},${Math.round(M.z*r)}`,g[2]=`${Math.round(S.x*r)},${Math.round(S.y*r)},${Math.round(S.z*r)}`,!(g[0]===g[1]||g[1]===g[2]||g[2]===g[0]))for(let b=0;b<3;b++){const R=(b+1)%3,P=g[b],U=g[R],F=Ym[m[b]],k=Ym[m[R]],G=`${P}_${U}`,D=`${U}_${P}`;D in v&&v[D]?(yy.dot(v[D].normal)<=s&&(_.push(F.x,F.y,F.z),_.push(k.x,k.y,k.z)),v[D]=null):G in v||(v[G]={index0:h[b],index1:h[R],normal:yy.clone()})}}for(const A in v)if(v[A]){const{index0:C,index1:M}=v[A];Jm.fromBufferAttribute(u,C),Km.fromBufferAttribute(u,M),_.push(Jm.x,Jm.y,Jm.z),_.push(Km.x,Km.y,Km.z)}this.setAttribute("position",new Tt(_,3))}}copy(e){return super.copy(e),this.parameters=Object.assign({},e.parameters),this}}class Ju extends Xh{constructor(e){super(e),this.uuid=ts(),this.type="Shape",this.holes=[]}getPointsHoles(e){const t=[];for(let n=0,r=this.holes.length;n<r;n++)t[n]=this.holes[n].getPoints(e);return t}extractPoints(e){return{shape:this.getPoints(e),holes:this.getPointsHoles(e)}}copy(e){super.copy(e),this.holes=[];for(let t=0,n=e.holes.length;t<n;t++){const r=e.holes[t];this.holes.push(r.clone())}return this}toJSON(){const e=super.toJSON();e.uuid=this.uuid,e.holes=[];for(let t=0,n=this.holes.length;t<n;t++){const r=this.holes[t];e.holes.push(r.toJSON())}return e}fromJSON(e){super.fromJSON(e),this.uuid=e.uuid,this.holes=[];for(let t=0,n=e.holes.length;t<n;t++){const r=e.holes[t];this.holes.push(new Xh().fromJSON(r))}return this}}const G3={triangulate:function(i,e,t=2){const n=e&&e.length,r=n?e[0]*t:i.length;let s=JM(i,0,r,t,!0);const a=[];if(!s||s.next===s.prev)return a;let u,d,h,m,g,v,_;if(n&&(s=J3(i,e,s,t)),i.length>80*t){u=h=i[0],d=m=i[1];for(let A=t;A<r;A+=t)g=i[A],v=i[A+1],g<u&&(u=g),v<d&&(d=v),g>h&&(h=g),v>m&&(m=v);_=Math.max(h-u,m-d),_=_!==0?32767/_:0}return jh(s,a,t,u,d,_,0),a}};function JM(i,e,t,n,r){let s,a;if(r===rR(i,e,t,n)>0)for(s=e;s<t;s+=n)a=TA(s,i[s],i[s+1],a);else for(s=t-n;s>=e;s-=n)a=TA(s,i[s],i[s+1],a);return a&&X0(a,a.next)&&(Kh(a),a=a.next),a}function $u(i,e){if(!i)return i;e||(e=i);let t=i,n;do if(n=!1,!t.steiner&&(X0(t,t.next)||jn(t.prev,t,t.next)===0)){if(Kh(t),t=e=t.prev,t===t.next)break;n=!0}else t=t.next;while(n||t!==e);return e}function jh(i,e,t,n,r,s,a){if(!i)return;!a&&s&&Z3(i,n,r,s);let u=i,d,h;for(;i.prev!==i.next;){if(d=i.prev,h=i.next,s?W3(i,n,r,s):V3(i)){e.push(d.i/t|0),e.push(i.i/t|0),e.push(h.i/t|0),Kh(i),i=h.next,u=h.next;continue}if(i=h,i===u){a?a===1?(i=X3($u(i),e,t),jh(i,e,t,n,r,s,2)):a===2&&j3(i,e,t,n,r,s):jh($u(i),e,t,n,r,s,1);break}}}function V3(i){const e=i.prev,t=i,n=i.next;if(jn(e,t,n)>=0)return!1;const r=e.x,s=t.x,a=n.x,u=e.y,d=t.y,h=n.y,m=r<s?r<a?r:a:s<a?s:a,g=u<d?u<h?u:h:d<h?d:h,v=r>s?r>a?r:a:s>a?s:a,_=u>d?u>h?u:h:d>h?d:h;let A=n.next;for(;A!==e;){if(A.x>=m&&A.x<=v&&A.y>=g&&A.y<=_&&Of(r,u,s,d,a,h,A.x,A.y)&&jn(A.prev,A,A.next)>=0)return!1;A=A.next}return!0}function W3(i,e,t,n){const r=i.prev,s=i,a=i.next;if(jn(r,s,a)>=0)return!1;const u=r.x,d=s.x,h=a.x,m=r.y,g=s.y,v=a.y,_=u<d?u<h?u:h:d<h?d:h,A=m<g?m<v?m:v:g<v?g:v,C=u>d?u>h?u:h:d>h?d:h,M=m>g?m>v?m:v:g>v?g:v,S=p_(_,A,e,t,n),b=p_(C,M,e,t,n);let R=i.prevZ,P=i.nextZ;for(;R&&R.z>=S&&P&&P.z<=b;){if(R.x>=_&&R.x<=C&&R.y>=A&&R.y<=M&&R!==r&&R!==a&&Of(u,m,d,g,h,v,R.x,R.y)&&jn(R.prev,R,R.next)>=0||(R=R.prevZ,P.x>=_&&P.x<=C&&P.y>=A&&P.y<=M&&P!==r&&P!==a&&Of(u,m,d,g,h,v,P.x,P.y)&&jn(P.prev,P,P.next)>=0))return!1;P=P.nextZ}for(;R&&R.z>=S;){if(R.x>=_&&R.x<=C&&R.y>=A&&R.y<=M&&R!==r&&R!==a&&Of(u,m,d,g,h,v,R.x,R.y)&&jn(R.prev,R,R.next)>=0)return!1;R=R.prevZ}for(;P&&P.z<=b;){if(P.x>=_&&P.x<=C&&P.y>=A&&P.y<=M&&P!==r&&P!==a&&Of(u,m,d,g,h,v,P.x,P.y)&&jn(P.prev,P,P.next)>=0)return!1;P=P.nextZ}return!0}function X3(i,e,t){let n=i;do{const r=n.prev,s=n.next.next;!X0(r,s)&&KM(r,n,n.next,s)&&Jh(r,s)&&Jh(s,r)&&(e.push(r.i/t|0),e.push(n.i/t|0),e.push(s.i/t|0),Kh(n),Kh(n.next),n=i=s),n=n.next}while(n!==i);return $u(n)}function j3(i,e,t,n,r,s){let a=i;do{let u=a.next.next;for(;u!==a.prev;){if(a.i!==u.i&&tR(a,u)){let d=YM(a,u);a=$u(a,a.next),d=$u(d,d.next),jh(a,e,t,n,r,s,0),jh(d,e,t,n,r,s,0);return}u=u.next}a=a.next}while(a!==i)}function J3(i,e,t,n){const r=[];let s,a,u,d,h;for(s=0,a=e.length;s<a;s++)u=e[s]*n,d=s<a-1?e[s+1]*n:i.length,h=JM(i,u,d,n,!1),h===h.next&&(h.steiner=!0),r.push(eR(h));for(r.sort(K3),s=0;s<r.length;s++)t=Y3(r[s],t);return t}function K3(i,e){return i.x-e.x}function Y3(i,e){const t=Q3(i,e);if(!t)return e;const n=YM(t,i);return $u(n,n.next),$u(t,t.next)}function Q3(i,e){let t=e,n=-1/0,r;const s=i.x,a=i.y;do{if(a<=t.y&&a>=t.next.y&&t.next.y!==t.y){const v=t.x+(a-t.y)*(t.next.x-t.x)/(t.next.y-t.y);if(v<=s&&v>n&&(n=v,r=t.x<t.next.x?t:t.next,v===s))return r}t=t.next}while(t!==e);if(!r)return null;const u=r,d=r.x,h=r.y;let m=1/0,g;t=r;do s>=t.x&&t.x>=d&&s!==t.x&&Of(a<h?s:n,a,d,h,a<h?n:s,a,t.x,t.y)&&(g=Math.abs(a-t.y)/(s-t.x),Jh(t,i)&&(g<m||g===m&&(t.x>r.x||t.x===r.x&&q3(r,t)))&&(r=t,m=g)),t=t.next;while(t!==u);return r}function q3(i,e){return jn(i.prev,i,e.prev)<0&&jn(e.next,i,i.next)<0}function Z3(i,e,t,n){let r=i;do r.z===0&&(r.z=p_(r.x,r.y,e,t,n)),r.prevZ=r.prev,r.nextZ=r.next,r=r.next;while(r!==i);r.prevZ.nextZ=null,r.prevZ=null,$3(r)}function $3(i){let e,t,n,r,s,a,u,d,h=1;do{for(t=i,i=null,s=null,a=0;t;){for(a++,n=t,u=0,e=0;e<h&&(u++,n=n.nextZ,!!n);e++);for(d=h;u>0||d>0&&n;)u!==0&&(d===0||!n||t.z<=n.z)?(r=t,t=t.nextZ,u--):(r=n,n=n.nextZ,d--),s?s.nextZ=r:i=r,r.prevZ=s,s=r;t=n}s.nextZ=null,h*=2}while(a>1);return i}function p_(i,e,t,n,r){return i=(i-t)*r|0,e=(e-n)*r|0,i=(i|i<<8)&16711935,i=(i|i<<4)&252645135,i=(i|i<<2)&858993459,i=(i|i<<1)&1431655765,e=(e|e<<8)&16711935,e=(e|e<<4)&252645135,e=(e|e<<2)&858993459,e=(e|e<<1)&1431655765,i|e<<1}function eR(i){let e=i,t=i;do(e.x<t.x||e.x===t.x&&e.y<t.y)&&(t=e),e=e.next;while(e!==i);return t}function Of(i,e,t,n,r,s,a,u){return(r-a)*(e-u)>=(i-a)*(s-u)&&(i-a)*(n-u)>=(t-a)*(e-u)&&(t-a)*(s-u)>=(r-a)*(n-u)}function tR(i,e){return i.next.i!==e.i&&i.prev.i!==e.i&&!nR(i,e)&&(Jh(i,e)&&Jh(e,i)&&iR(i,e)&&(jn(i.prev,i,e.prev)||jn(i,e.prev,e))||X0(i,e)&&jn(i.prev,i,i.next)>0&&jn(e.prev,e,e.next)>0)}function jn(i,e,t){return(e.y-i.y)*(t.x-e.x)-(e.x-i.x)*(t.y-e.y)}function X0(i,e){return i.x===e.x&&i.y===e.y}function KM(i,e,t,n){const r=qm(jn(i,e,t)),s=qm(jn(i,e,n)),a=qm(jn(t,n,i)),u=qm(jn(t,n,e));return!!(r!==s&&a!==u||r===0&&Qm(i,t,e)||s===0&&Qm(i,n,e)||a===0&&Qm(t,i,n)||u===0&&Qm(t,e,n))}function Qm(i,e,t){return e.x<=Math.max(i.x,t.x)&&e.x>=Math.min(i.x,t.x)&&e.y<=Math.max(i.y,t.y)&&e.y>=Math.min(i.y,t.y)}function qm(i){return i>0?1:i<0?-1:0}function nR(i,e){let t=i;do{if(t.i!==i.i&&t.next.i!==i.i&&t.i!==e.i&&t.next.i!==e.i&&KM(t,t.next,i,e))return!0;t=t.next}while(t!==i);return!1}function Jh(i,e){return jn(i.prev,i,i.next)<0?jn(i,e,i.next)>=0&&jn(i,i.prev,e)>=0:jn(i,e,i.prev)<0||jn(i,i.next,e)<0}function iR(i,e){let t=i,n=!1;const r=(i.x+e.x)/2,s=(i.y+e.y)/2;do t.y>s!=t.next.y>s&&t.next.y!==t.y&&r<(t.next.x-t.x)*(s-t.y)/(t.next.y-t.y)+t.x&&(n=!n),t=t.next;while(t!==i);return n}function YM(i,e){const t=new m_(i.i,i.x,i.y),n=new m_(e.i,e.x,e.y),r=i.next,s=e.prev;return i.next=e,e.prev=i,t.next=r,r.prev=t,n.next=t,t.prev=n,s.next=n,n.prev=s,n}function TA(i,e,t,n){const r=new m_(i,e,t);return n?(r.next=n.next,r.prev=n,n.next.prev=r,n.next=r):(r.prev=r,r.next=r),r}function Kh(i){i.next.prev=i.prev,i.prev.next=i.next,i.prevZ&&(i.prevZ.nextZ=i.nextZ),i.nextZ&&(i.nextZ.prevZ=i.prevZ)}function m_(i,e,t){this.i=i,this.x=e,this.y=t,this.prev=null,this.next=null,this.z=0,this.prevZ=null,this.nextZ=null,this.steiner=!1}function rR(i,e,t,n){let r=0;for(let s=e,a=t-n;s<t;s+=n)r+=(i[a]-i[s])*(i[s+1]+i[a+1]),a=s;return r}class wo{static area(e){const t=e.length;let n=0;for(let r=t-1,s=0;s<t;r=s++)n+=e[r].x*e[s].y-e[s].x*e[r].y;return n*.5}static isClockWise(e){return wo.area(e)<0}static triangulateShape(e,t){const n=[],r=[],s=[];bA(e),RA(n,e);let a=e.length;t.forEach(bA);for(let d=0;d<t.length;d++)r.push(a),a+=t[d].length,RA(n,t[d]);const u=G3.triangulate(n,r);for(let d=0;d<u.length;d+=3)s.push(u.slice(d,d+3));return s}}function bA(i){const e=i.length;e>2&&i[e-1].equals(i[0])&&i.pop()}function RA(i,e){for(let t=0;t<e.length;t++)i.push(e[t].x),i.push(e[t].y)}class j0 extends Kt{constructor(e=new Ju([new Le(.5,.5),new Le(-.5,.5),new Le(-.5,-.5),new Le(.5,-.5)]),t={}){super(),this.type="ExtrudeGeometry",this.parameters={shapes:e,options:t},e=Array.isArray(e)?e:[e];const n=this,r=[],s=[];for(let u=0,d=e.length;u<d;u++){const h=e[u];a(h)}this.setAttribute("position",new Tt(r,3)),this.setAttribute("uv",new Tt(s,2)),this.computeVertexNormals();function a(u){const d=[],h=t.curveSegments!==void 0?t.curveSegments:12,m=t.steps!==void 0?t.steps:1,g=t.depth!==void 0?t.depth:1;let v=t.bevelEnabled!==void 0?t.bevelEnabled:!0,_=t.bevelThickness!==void 0?t.bevelThickness:.2,A=t.bevelSize!==void 0?t.bevelSize:_-.1,C=t.bevelOffset!==void 0?t.bevelOffset:0,M=t.bevelSegments!==void 0?t.bevelSegments:3;const S=t.extrudePath,b=t.UVGenerator!==void 0?t.UVGenerator:sR;let R,P=!1,U,F,k,G;S&&(R=S.getSpacedPoints(m),P=!0,v=!1,U=S.computeFrenetFrames(m,!1),F=new X,k=new X,G=new X),v||(M=0,_=0,A=0,C=0);const D=u.extractPoints(h);let L=D.shape;const V=D.holes;if(!wo.isClockWise(L)){L=L.reverse();for(let Ne=0,be=V.length;Ne<be;Ne++){const J=V[Ne];wo.isClockWise(J)&&(V[Ne]=J.reverse())}}const ie=wo.triangulateShape(L,V),ge=L;for(let Ne=0,be=V.length;Ne<be;Ne++){const J=V[Ne];L=L.concat(J)}function ye(Ne,be,J){return be||console.error("THREE.ExtrudeGeometry: vec does not exist"),Ne.clone().addScaledVector(be,J)}const he=L.length,_e=ie.length;function H(Ne,be,J){let mt,ke,et;const je=Ne.x-be.x,wt=Ne.y-be.y,qe=J.x-Ne.x,j=J.y-Ne.y,O=je*je+wt*wt,pe=je*j-wt*qe;if(Math.abs(pe)>Number.EPSILON){const Ce=Math.sqrt(O),Ue=Math.sqrt(qe*qe+j*j),Pe=be.x-wt/Ce,ot=be.y+je/Ce,Ze=J.x-j/Ue,ct=J.y+qe/Ue,zt=((Ze-Pe)*j-(ct-ot)*qe)/(je*j-wt*qe);mt=Pe+je*zt-Ne.x,ke=ot+wt*zt-Ne.y;const ze=mt*mt+ke*ke;if(ze<=2)return new Le(mt,ke);et=Math.sqrt(ze/2)}else{let Ce=!1;je>Number.EPSILON?qe>Number.EPSILON&&(Ce=!0):je<-Number.EPSILON?qe<-Number.EPSILON&&(Ce=!0):Math.sign(wt)===Math.sign(j)&&(Ce=!0),Ce?(mt=-wt,ke=je,et=Math.sqrt(O)):(mt=je,ke=wt,et=Math.sqrt(O/2))}return new Le(mt/et,ke/et)}const Z=[];for(let Ne=0,be=ge.length,J=be-1,mt=Ne+1;Ne<be;Ne++,J++,mt++)J===be&&(J=0),mt===be&&(mt=0),Z[Ne]=H(ge[Ne],ge[J],ge[mt]);const q=[];let W,ne=Z.concat();for(let Ne=0,be=V.length;Ne<be;Ne++){const J=V[Ne];W=[];for(let mt=0,ke=J.length,et=ke-1,je=mt+1;mt<ke;mt++,et++,je++)et===ke&&(et=0),je===ke&&(je=0),W[mt]=H(J[mt],J[et],J[je]);q.push(W),ne=ne.concat(W)}for(let Ne=0;Ne<M;Ne++){const be=Ne/M,J=_*Math.cos(be*Math.PI/2),mt=A*Math.sin(be*Math.PI/2)+C;for(let ke=0,et=ge.length;ke<et;ke++){const je=ye(ge[ke],Z[ke],mt);Ie(je.x,je.y,-J)}for(let ke=0,et=V.length;ke<et;ke++){const je=V[ke];W=q[ke];for(let wt=0,qe=je.length;wt<qe;wt++){const j=ye(je[wt],W[wt],mt);Ie(j.x,j.y,-J)}}}const Fe=A+C;for(let Ne=0;Ne<he;Ne++){const be=v?ye(L[Ne],ne[Ne],Fe):L[Ne];P?(k.copy(U.normals[0]).multiplyScalar(be.x),F.copy(U.binormals[0]).multiplyScalar(be.y),G.copy(R[0]).add(k).add(F),Ie(G.x,G.y,G.z)):Ie(be.x,be.y,0)}for(let Ne=1;Ne<=m;Ne++)for(let be=0;be<he;be++){const J=v?ye(L[be],ne[be],Fe):L[be];P?(k.copy(U.normals[Ne]).multiplyScalar(J.x),F.copy(U.binormals[Ne]).multiplyScalar(J.y),G.copy(R[Ne]).add(k).add(F),Ie(G.x,G.y,G.z)):Ie(J.x,J.y,g/m*Ne)}for(let Ne=M-1;Ne>=0;Ne--){const be=Ne/M,J=_*Math.cos(be*Math.PI/2),mt=A*Math.sin(be*Math.PI/2)+C;for(let ke=0,et=ge.length;ke<et;ke++){const je=ye(ge[ke],Z[ke],mt);Ie(je.x,je.y,g+J)}for(let ke=0,et=V.length;ke<et;ke++){const je=V[ke];W=q[ke];for(let wt=0,qe=je.length;wt<qe;wt++){const j=ye(je[wt],W[wt],mt);P?Ie(j.x,j.y+R[m-1].y,R[m-1].x+J):Ie(j.x,j.y,g+J)}}}ae(),we();function ae(){const Ne=r.length/3;if(v){let be=0,J=he*be;for(let mt=0;mt<_e;mt++){const ke=ie[mt];Xe(ke[2]+J,ke[1]+J,ke[0]+J)}be=m+M*2,J=he*be;for(let mt=0;mt<_e;mt++){const ke=ie[mt];Xe(ke[0]+J,ke[1]+J,ke[2]+J)}}else{for(let be=0;be<_e;be++){const J=ie[be];Xe(J[2],J[1],J[0])}for(let be=0;be<_e;be++){const J=ie[be];Xe(J[0]+he*m,J[1]+he*m,J[2]+he*m)}}n.addGroup(Ne,r.length/3-Ne,0)}function we(){const Ne=r.length/3;let be=0;De(ge,be),be+=ge.length;for(let J=0,mt=V.length;J<mt;J++){const ke=V[J];De(ke,be),be+=ke.length}n.addGroup(Ne,r.length/3-Ne,1)}function De(Ne,be){let J=Ne.length;for(;--J>=0;){const mt=J;let ke=J-1;ke<0&&(ke=Ne.length-1);for(let et=0,je=m+M*2;et<je;et++){const wt=he*et,qe=he*(et+1),j=be+mt+wt,O=be+ke+wt,pe=be+ke+qe,Ce=be+mt+qe;_t(j,O,pe,Ce)}}}function Ie(Ne,be,J){d.push(Ne),d.push(be),d.push(J)}function Xe(Ne,be,J){Je(Ne),Je(be),Je(J);const mt=r.length/3,ke=b.generateTopUV(n,r,mt-3,mt-2,mt-1);st(ke[0]),st(ke[1]),st(ke[2])}function _t(Ne,be,J,mt){Je(Ne),Je(be),Je(mt),Je(be),Je(J),Je(mt);const ke=r.length/3,et=b.generateSideWallUV(n,r,ke-6,ke-3,ke-2,ke-1);st(et[0]),st(et[1]),st(et[3]),st(et[1]),st(et[2]),st(et[3])}function Je(Ne){r.push(d[Ne*3+0]),r.push(d[Ne*3+1]),r.push(d[Ne*3+2])}function st(Ne){s.push(Ne.x),s.push(Ne.y)}}}copy(e){return super.copy(e),this.parameters=Object.assign({},e.parameters),this}toJSON(){const e=super.toJSON(),t=this.parameters.shapes,n=this.parameters.options;return oR(t,n,e)}static fromJSON(e,t){const n=[];for(let s=0,a=e.shapes.length;s<a;s++){const u=t[e.shapes[s]];n.push(u)}const r=e.options.extrudePath;return r!==void 0&&(e.options.extrudePath=new c0[r.type]().fromJSON(r)),new j0(n,e.options)}}const sR={generateTopUV:function(i,e,t,n,r){const s=e[t*3],a=e[t*3+1],u=e[n*3],d=e[n*3+1],h=e[r*3],m=e[r*3+1];return[new Le(s,a),new Le(u,d),new Le(h,m)]},generateSideWallUV:function(i,e,t,n,r,s){const a=e[t*3],u=e[t*3+1],d=e[t*3+2],h=e[n*3],m=e[n*3+1],g=e[n*3+2],v=e[r*3],_=e[r*3+1],A=e[r*3+2],C=e[s*3],M=e[s*3+1],S=e[s*3+2];return Math.abs(u-m)<Math.abs(a-h)?[new Le(a,1-d),new Le(h,1-g),new Le(v,1-A),new Le(C,1-S)]:[new Le(u,1-d),new Le(m,1-g),new Le(_,1-A),new Le(M,1-S)]}};function oR(i,e,t){if(t.shapes=[],Array.isArray(i))for(let n=0,r=i.length;n<r;n++){const s=i[n];t.shapes.push(s.uuid)}else t.shapes.push(i.uuid);return t.options=Object.assign({},e),e.extrudePath!==void 0&&(t.options.extrudePath=e.extrudePath.toJSON()),t}class J0 extends Rl{constructor(e=1,t=0){const n=(1+Math.sqrt(5))/2,r=[-1,n,0,1,n,0,-1,-n,0,1,-n,0,0,-1,n,0,1,n,0,-1,-n,0,1,-n,n,0,-1,n,0,1,-n,0,-1,-n,0,1],s=[0,11,5,0,5,1,0,1,7,0,7,10,0,10,11,1,5,9,5,11,4,11,10,2,10,7,6,7,1,8,3,9,4,3,4,2,3,2,6,3,6,8,3,8,9,4,9,5,2,4,11,6,2,10,8,6,7,9,8,1];super(r,s,e,t),this.type="IcosahedronGeometry",this.parameters={radius:e,detail:t}}static fromJSON(e){return new J0(e.radius,e.detail)}}class hp extends Rl{constructor(e=1,t=0){const n=[1,0,0,-1,0,0,0,1,0,0,-1,0,0,0,1,0,0,-1],r=[0,2,4,0,4,3,0,3,5,0,5,2,1,2,5,1,5,3,1,3,4,1,4,2];super(n,r,e,t),this.type="OctahedronGeometry",this.parameters={radius:e,detail:t}}static fromJSON(e){return new hp(e.radius,e.detail)}}class ad extends Kt{constructor(e=1,t=1,n=1,r=1){super(),this.type="PlaneGeometry",this.parameters={width:e,height:t,widthSegments:n,heightSegments:r};const s=e/2,a=t/2,u=Math.floor(n),d=Math.floor(r),h=u+1,m=d+1,g=e/u,v=t/d,_=[],A=[],C=[],M=[];for(let S=0;S<m;S++){const b=S*v-a;for(let R=0;R<h;R++){const P=R*g-s;A.push(P,-b,0),C.push(0,0,1),M.push(R/u),M.push(1-S/d)}}for(let S=0;S<d;S++)for(let b=0;b<u;b++){const R=b+h*S,P=b+h*(S+1),U=b+1+h*(S+1),F=b+1+h*S;_.push(R,P,F),_.push(P,U,F)}this.setIndex(_),this.setAttribute("position",new Tt(A,3)),this.setAttribute("normal",new Tt(C,3)),this.setAttribute("uv",new Tt(M,2))}copy(e){return super.copy(e),this.parameters=Object.assign({},e.parameters),this}static fromJSON(e){return new ad(e.width,e.height,e.widthSegments,e.heightSegments)}}class K0 extends Kt{constructor(e=.5,t=1,n=32,r=1,s=0,a=Math.PI*2){super(),this.type="RingGeometry",this.parameters={innerRadius:e,outerRadius:t,thetaSegments:n,phiSegments:r,thetaStart:s,thetaLength:a},n=Math.max(3,n),r=Math.max(1,r);const u=[],d=[],h=[],m=[];let g=e;const v=(t-e)/r,_=new X,A=new Le;for(let C=0;C<=r;C++){for(let M=0;M<=n;M++){const S=s+M/n*a;_.x=g*Math.cos(S),_.y=g*Math.sin(S),d.push(_.x,_.y,_.z),h.push(0,0,1),A.x=(_.x/t+1)/2,A.y=(_.y/t+1)/2,m.push(A.x,A.y)}g+=v}for(let C=0;C<r;C++){const M=C*(n+1);for(let S=0;S<n;S++){const b=S+M,R=b,P=b+n+1,U=b+n+2,F=b+1;u.push(R,P,F),u.push(P,U,F)}}this.setIndex(u),this.setAttribute("position",new Tt(d,3)),this.setAttribute("normal",new Tt(h,3)),this.setAttribute("uv",new Tt(m,2))}copy(e){return super.copy(e),this.parameters=Object.assign({},e.parameters),this}static fromJSON(e){return new K0(e.innerRadius,e.outerRadius,e.thetaSegments,e.phiSegments,e.thetaStart,e.thetaLength)}}class Y0 extends Kt{constructor(e=new Ju([new Le(0,.5),new Le(-.5,-.5),new Le(.5,-.5)]),t=12){super(),this.type="ShapeGeometry",this.parameters={shapes:e,curveSegments:t};const n=[],r=[],s=[],a=[];let u=0,d=0;if(Array.isArray(e)===!1)h(e);else for(let m=0;m<e.length;m++)h(e[m]),this.addGroup(u,d,m),u+=d,d=0;this.setIndex(n),this.setAttribute("position",new Tt(r,3)),this.setAttribute("normal",new Tt(s,3)),this.setAttribute("uv",new Tt(a,2));function h(m){const g=r.length/3,v=m.extractPoints(t);let _=v.shape;const A=v.holes;wo.isClockWise(_)===!1&&(_=_.reverse());for(let M=0,S=A.length;M<S;M++){const b=A[M];wo.isClockWise(b)===!0&&(A[M]=b.reverse())}const C=wo.triangulateShape(_,A);for(let M=0,S=A.length;M<S;M++){const b=A[M];_=_.concat(b)}for(let M=0,S=_.length;M<S;M++){const b=_[M];r.push(b.x,b.y,0),s.push(0,0,1),a.push(b.x,b.y)}for(let M=0,S=C.length;M<S;M++){const b=C[M],R=b[0]+g,P=b[1]+g,U=b[2]+g;n.push(R,P,U),d+=3}}}copy(e){return super.copy(e),this.parameters=Object.assign({},e.parameters),this}toJSON(){const e=super.toJSON(),t=this.parameters.shapes;return aR(t,e)}static fromJSON(e,t){const n=[];for(let r=0,s=e.shapes.length;r<s;r++){const a=t[e.shapes[r]];n.push(a)}return new Y0(n,e.curveSegments)}}function aR(i,e){if(e.shapes=[],Array.isArray(i))for(let t=0,n=i.length;t<n;t++){const r=i[t];e.shapes.push(r.uuid)}else e.shapes.push(i.uuid);return e}class pp extends Kt{constructor(e=1,t=32,n=16,r=0,s=Math.PI*2,a=0,u=Math.PI){super(),this.type="SphereGeometry",this.parameters={radius:e,widthSegments:t,heightSegments:n,phiStart:r,phiLength:s,thetaStart:a,thetaLength:u},t=Math.max(3,Math.floor(t)),n=Math.max(2,Math.floor(n));const d=Math.min(a+u,Math.PI);let h=0;const m=[],g=new X,v=new X,_=[],A=[],C=[],M=[];for(let S=0;S<=n;S++){const b=[],R=S/n;let P=0;S===0&&a===0?P=.5/t:S===n&&d===Math.PI&&(P=-.5/t);for(let U=0;U<=t;U++){const F=U/t;g.x=-e*Math.cos(r+F*s)*Math.sin(a+R*u),g.y=e*Math.cos(a+R*u),g.z=e*Math.sin(r+F*s)*Math.sin(a+R*u),A.push(g.x,g.y,g.z),v.copy(g).normalize(),C.push(v.x,v.y,v.z),M.push(F+P,1-R),b.push(h++)}m.push(b)}for(let S=0;S<n;S++)for(let b=0;b<t;b++){const R=m[S][b+1],P=m[S][b],U=m[S+1][b],F=m[S+1][b+1];(S!==0||a>0)&&_.push(R,P,F),(S!==n-1||d<Math.PI)&&_.push(P,U,F)}this.setIndex(_),this.setAttribute("position",new Tt(A,3)),this.setAttribute("normal",new Tt(C,3)),this.setAttribute("uv",new Tt(M,2))}copy(e){return super.copy(e),this.parameters=Object.assign({},e.parameters),this}static fromJSON(e){return new pp(e.radius,e.widthSegments,e.heightSegments,e.phiStart,e.phiLength,e.thetaStart,e.thetaLength)}}class Q0 extends Rl{constructor(e=1,t=0){const n=[1,1,1,-1,-1,1,-1,1,-1,1,-1,-1],r=[2,1,0,0,3,2,1,3,0,2,3,1];super(n,r,e,t),this.type="TetrahedronGeometry",this.parameters={radius:e,detail:t}}static fromJSON(e){return new Q0(e.radius,e.detail)}}class q0 extends Kt{constructor(e=1,t=.4,n=12,r=48,s=Math.PI*2){super(),this.type="TorusGeometry",this.parameters={radius:e,tube:t,radialSegments:n,tubularSegments:r,arc:s},n=Math.floor(n),r=Math.floor(r);const a=[],u=[],d=[],h=[],m=new X,g=new X,v=new X;for(let _=0;_<=n;_++)for(let A=0;A<=r;A++){const C=A/r*s,M=_/n*Math.PI*2;g.x=(e+t*Math.cos(M))*Math.cos(C),g.y=(e+t*Math.cos(M))*Math.sin(C),g.z=t*Math.sin(M),u.push(g.x,g.y,g.z),m.x=e*Math.cos(C),m.y=e*Math.sin(C),v.subVectors(g,m).normalize(),d.push(v.x,v.y,v.z),h.push(A/r),h.push(_/n)}for(let _=1;_<=n;_++)for(let A=1;A<=r;A++){const C=(r+1)*_+A-1,M=(r+1)*(_-1)+A-1,S=(r+1)*(_-1)+A,b=(r+1)*_+A;a.push(C,M,b),a.push(M,S,b)}this.setIndex(a),this.setAttribute("position",new Tt(u,3)),this.setAttribute("normal",new Tt(d,3)),this.setAttribute("uv",new Tt(h,2))}copy(e){return super.copy(e),this.parameters=Object.assign({},e.parameters),this}static fromJSON(e){return new q0(e.radius,e.tube,e.radialSegments,e.tubularSegments,e.arc)}}class Z0 extends Kt{constructor(e=1,t=.4,n=64,r=8,s=2,a=3){super(),this.type="TorusKnotGeometry",this.parameters={radius:e,tube:t,tubularSegments:n,radialSegments:r,p:s,q:a},n=Math.floor(n),r=Math.floor(r);const u=[],d=[],h=[],m=[],g=new X,v=new X,_=new X,A=new X,C=new X,M=new X,S=new X;for(let R=0;R<=n;++R){const P=R/n*s*Math.PI*2;b(P,s,a,e,_),b(P+.01,s,a,e,A),M.subVectors(A,_),S.addVectors(A,_),C.crossVectors(M,S),S.crossVectors(C,M),C.normalize(),S.normalize();for(let U=0;U<=r;++U){const F=U/r*Math.PI*2,k=-t*Math.cos(F),G=t*Math.sin(F);g.x=_.x+(k*S.x+G*C.x),g.y=_.y+(k*S.y+G*C.y),g.z=_.z+(k*S.z+G*C.z),d.push(g.x,g.y,g.z),v.subVectors(g,_).normalize(),h.push(v.x,v.y,v.z),m.push(R/n),m.push(U/r)}}for(let R=1;R<=n;R++)for(let P=1;P<=r;P++){const U=(r+1)*(R-1)+(P-1),F=(r+1)*R+(P-1),k=(r+1)*R+P,G=(r+1)*(R-1)+P;u.push(U,F,G),u.push(F,k,G)}this.setIndex(u),this.setAttribute("position",new Tt(d,3)),this.setAttribute("normal",new Tt(h,3)),this.setAttribute("uv",new Tt(m,2));function b(R,P,U,F,k){const G=Math.cos(R),D=Math.sin(R),L=U/P*R,V=Math.cos(L);k.x=F*(2+V)*.5*G,k.y=F*(2+V)*D*.5,k.z=F*Math.sin(L)*.5}}copy(e){return super.copy(e),this.parameters=Object.assign({},e.parameters),this}static fromJSON(e){return new Z0(e.radius,e.tube,e.tubularSegments,e.radialSegments,e.p,e.q)}}class $0 extends Kt{constructor(e=new hx(new X(-1,-1,0),new X(-1,1,0),new X(1,1,0)),t=64,n=1,r=8,s=!1){super(),this.type="TubeGeometry",this.parameters={path:e,tubularSegments:t,radius:n,radialSegments:r,closed:s};const a=e.computeFrenetFrames(t,s);this.tangents=a.tangents,this.normals=a.normals,this.binormals=a.binormals;const u=new X,d=new X,h=new Le;let m=new X;const g=[],v=[],_=[],A=[];C(),this.setIndex(A),this.setAttribute("position",new Tt(g,3)),this.setAttribute("normal",new Tt(v,3)),this.setAttribute("uv",new Tt(_,2));function C(){for(let R=0;R<t;R++)M(R);M(s===!1?t:0),b(),S()}function M(R){m=e.getPointAt(R/t,m);const P=a.normals[R],U=a.binormals[R];for(let F=0;F<=r;F++){const k=F/r*Math.PI*2,G=Math.sin(k),D=-Math.cos(k);d.x=D*P.x+G*U.x,d.y=D*P.y+G*U.y,d.z=D*P.z+G*U.z,d.normalize(),v.push(d.x,d.y,d.z),u.x=m.x+n*d.x,u.y=m.y+n*d.y,u.z=m.z+n*d.z,g.push(u.x,u.y,u.z)}}function S(){for(let R=1;R<=t;R++)for(let P=1;P<=r;P++){const U=(r+1)*(R-1)+(P-1),F=(r+1)*R+(P-1),k=(r+1)*R+P,G=(r+1)*(R-1)+P;A.push(U,F,G),A.push(F,k,G)}}function b(){for(let R=0;R<=t;R++)for(let P=0;P<=r;P++)h.x=R/t,h.y=P/r,_.push(h.x,h.y)}}copy(e){return super.copy(e),this.parameters=Object.assign({},e.parameters),this}toJSON(){const e=super.toJSON();return e.path=this.parameters.path.toJSON(),e}static fromJSON(e){return new $0(new c0[e.path.type]().fromJSON(e.path),e.tubularSegments,e.radius,e.radialSegments,e.closed)}}class QM extends Kt{constructor(e=null){if(super(),this.type="WireframeGeometry",this.parameters={geometry:e},e!==null){const t=[],n=new Set,r=new X,s=new X;if(e.index!==null){const a=e.attributes.position,u=e.index;let d=e.groups;d.length===0&&(d=[{start:0,count:u.count,materialIndex:0}]);for(let h=0,m=d.length;h<m;++h){const g=d[h],v=g.start,_=g.count;for(let A=v,C=v+_;A<C;A+=3)for(let M=0;M<3;M++){const S=u.getX(A+M),b=u.getX(A+(M+1)%3);r.fromBufferAttribute(a,S),s.fromBufferAttribute(a,b),IA(r,s,n)===!0&&(t.push(r.x,r.y,r.z),t.push(s.x,s.y,s.z))}}}else{const a=e.attributes.position;for(let u=0,d=a.count/3;u<d;u++)for(let h=0;h<3;h++){const m=3*u+h,g=3*u+(h+1)%3;r.fromBufferAttribute(a,m),s.fromBufferAttribute(a,g),IA(r,s,n)===!0&&(t.push(r.x,r.y,r.z),t.push(s.x,s.y,s.z))}}this.setAttribute("position",new Tt(t,3))}}copy(e){return super.copy(e),this.parameters=Object.assign({},e.parameters),this}}function IA(i,e,t){const n=`${i.x},${i.y},${i.z}-${e.x},${e.y},${e.z}`,r=`${e.x},${e.y},${e.z}-${i.x},${i.y},${i.z}`;return t.has(n)===!0||t.has(r)===!0?!1:(t.add(n),t.add(r),!0)}var PA=Object.freeze({__proto__:null,BoxGeometry:sc,CapsuleGeometry:z0,CircleGeometry:G0,ConeGeometry:V0,CylinderGeometry:od,DodecahedronGeometry:W0,EdgesGeometry:jM,ExtrudeGeometry:j0,IcosahedronGeometry:J0,LatheGeometry:dp,OctahedronGeometry:hp,PlaneGeometry:ad,PolyhedronGeometry:Rl,RingGeometry:K0,ShapeGeometry:Y0,SphereGeometry:pp,TetrahedronGeometry:Q0,TorusGeometry:q0,TorusKnotGeometry:Z0,TubeGeometry:$0,WireframeGeometry:QM});class qM extends Ei{constructor(e){super(),this.isShadowMaterial=!0,this.type="ShadowMaterial",this.color=new tt(0),this.transparent=!0,this.fog=!0,this.setValues(e)}copy(e){return super.copy(e),this.color.copy(e.color),this.fog=e.fog,this}}class ZM extends no{constructor(e){super(e),this.isRawShaderMaterial=!0,this.type="RawShaderMaterial"}}class mp extends Ei{constructor(e){super(),this.isMeshStandardMaterial=!0,this.type="MeshStandardMaterial",this.defines={STANDARD:""},this.color=new tt(16777215),this.roughness=1,this.metalness=0,this.map=null,this.lightMap=null,this.lightMapIntensity=1,this.aoMap=null,this.aoMapIntensity=1,this.emissive=new tt(0),this.emissiveIntensity=1,this.emissiveMap=null,this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=bl,this.normalScale=new Le(1,1),this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.roughnessMap=null,this.metalnessMap=null,this.alphaMap=null,this.envMap=null,this.envMapRotation=new ns,this.envMapIntensity=1,this.wireframe=!1,this.wireframeLinewidth=1,this.wireframeLinecap="round",this.wireframeLinejoin="round",this.flatShading=!1,this.fog=!0,this.setValues(e)}copy(e){return super.copy(e),this.defines={STANDARD:""},this.color.copy(e.color),this.roughness=e.roughness,this.metalness=e.metalness,this.map=e.map,this.lightMap=e.lightMap,this.lightMapIntensity=e.lightMapIntensity,this.aoMap=e.aoMap,this.aoMapIntensity=e.aoMapIntensity,this.emissive.copy(e.emissive),this.emissiveMap=e.emissiveMap,this.emissiveIntensity=e.emissiveIntensity,this.bumpMap=e.bumpMap,this.bumpScale=e.bumpScale,this.normalMap=e.normalMap,this.normalMapType=e.normalMapType,this.normalScale.copy(e.normalScale),this.displacementMap=e.displacementMap,this.displacementScale=e.displacementScale,this.displacementBias=e.displacementBias,this.roughnessMap=e.roughnessMap,this.metalnessMap=e.metalnessMap,this.alphaMap=e.alphaMap,this.envMap=e.envMap,this.envMapRotation.copy(e.envMapRotation),this.envMapIntensity=e.envMapIntensity,this.wireframe=e.wireframe,this.wireframeLinewidth=e.wireframeLinewidth,this.wireframeLinecap=e.wireframeLinecap,this.wireframeLinejoin=e.wireframeLinejoin,this.flatShading=e.flatShading,this.fog=e.fog,this}}class Ss extends mp{constructor(e){super(),this.isMeshPhysicalMaterial=!0,this.defines={STANDARD:"",PHYSICAL:""},this.type="MeshPhysicalMaterial",this.anisotropyRotation=0,this.anisotropyMap=null,this.clearcoatMap=null,this.clearcoatRoughness=0,this.clearcoatRoughnessMap=null,this.clearcoatNormalScale=new Le(1,1),this.clearcoatNormalMap=null,this.ior=1.5,Object.defineProperty(this,"reflectivity",{get:function(){return Xt(2.5*(this.ior-1)/(this.ior+1),0,1)},set:function(t){this.ior=(1+.4*t)/(1-.4*t)}}),this.iridescenceMap=null,this.iridescenceIOR=1.3,this.iridescenceThicknessRange=[100,400],this.iridescenceThicknessMap=null,this.sheenColor=new tt(0),this.sheenColorMap=null,this.sheenRoughness=1,this.sheenRoughnessMap=null,this.transmissionMap=null,this.thickness=0,this.thicknessMap=null,this.attenuationDistance=1/0,this.attenuationColor=new tt(1,1,1),this.specularIntensity=1,this.specularIntensityMap=null,this.specularColor=new tt(1,1,1),this.specularColorMap=null,this._anisotropy=0,this._clearcoat=0,this._dispersion=0,this._iridescence=0,this._sheen=0,this._transmission=0,this.setValues(e)}get anisotropy(){return this._anisotropy}set anisotropy(e){this._anisotropy>0!=e>0&&this.version++,this._anisotropy=e}get clearcoat(){return this._clearcoat}set clearcoat(e){this._clearcoat>0!=e>0&&this.version++,this._clearcoat=e}get iridescence(){return this._iridescence}set iridescence(e){this._iridescence>0!=e>0&&this.version++,this._iridescence=e}get dispersion(){return this._dispersion}set dispersion(e){this._dispersion>0!=e>0&&this.version++,this._dispersion=e}get sheen(){return this._sheen}set sheen(e){this._sheen>0!=e>0&&this.version++,this._sheen=e}get transmission(){return this._transmission}set transmission(e){this._transmission>0!=e>0&&this.version++,this._transmission=e}copy(e){return super.copy(e),this.defines={STANDARD:"",PHYSICAL:""},this.anisotropy=e.anisotropy,this.anisotropyRotation=e.anisotropyRotation,this.anisotropyMap=e.anisotropyMap,this.clearcoat=e.clearcoat,this.clearcoatMap=e.clearcoatMap,this.clearcoatRoughness=e.clearcoatRoughness,this.clearcoatRoughnessMap=e.clearcoatRoughnessMap,this.clearcoatNormalMap=e.clearcoatNormalMap,this.clearcoatNormalScale.copy(e.clearcoatNormalScale),this.dispersion=e.dispersion,this.ior=e.ior,this.iridescence=e.iridescence,this.iridescenceMap=e.iridescenceMap,this.iridescenceIOR=e.iridescenceIOR,this.iridescenceThicknessRange=[...e.iridescenceThicknessRange],this.iridescenceThicknessMap=e.iridescenceThicknessMap,this.sheen=e.sheen,this.sheenColor.copy(e.sheenColor),this.sheenColorMap=e.sheenColorMap,this.sheenRoughness=e.sheenRoughness,this.sheenRoughnessMap=e.sheenRoughnessMap,this.transmission=e.transmission,this.transmissionMap=e.transmissionMap,this.thickness=e.thickness,this.thicknessMap=e.thicknessMap,this.attenuationDistance=e.attenuationDistance,this.attenuationColor.copy(e.attenuationColor),this.specularIntensity=e.specularIntensity,this.specularIntensityMap=e.specularIntensityMap,this.specularColor.copy(e.specularColor),this.specularColorMap=e.specularColorMap,this}}class $M extends Ei{constructor(e){super(),this.isMeshPhongMaterial=!0,this.type="MeshPhongMaterial",this.color=new tt(16777215),this.specular=new tt(1118481),this.shininess=30,this.map=null,this.lightMap=null,this.lightMapIntensity=1,this.aoMap=null,this.aoMapIntensity=1,this.emissive=new tt(0),this.emissiveIntensity=1,this.emissiveMap=null,this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=bl,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 ns,this.combine=rp,this.reflectivity=1,this.refractionRatio=.98,this.wireframe=!1,this.wireframeLinewidth=1,this.wireframeLinecap="round",this.wireframeLinejoin="round",this.flatShading=!1,this.fog=!0,this.setValues(e)}copy(e){return super.copy(e),this.color.copy(e.color),this.specular.copy(e.specular),this.shininess=e.shininess,this.map=e.map,this.lightMap=e.lightMap,this.lightMapIntensity=e.lightMapIntensity,this.aoMap=e.aoMap,this.aoMapIntensity=e.aoMapIntensity,this.emissive.copy(e.emissive),this.emissiveMap=e.emissiveMap,this.emissiveIntensity=e.emissiveIntensity,this.bumpMap=e.bumpMap,this.bumpScale=e.bumpScale,this.normalMap=e.normalMap,this.normalMapType=e.normalMapType,this.normalScale.copy(e.normalScale),this.displacementMap=e.displacementMap,this.displacementScale=e.displacementScale,this.displacementBias=e.displacementBias,this.specularMap=e.specularMap,this.alphaMap=e.alphaMap,this.envMap=e.envMap,this.envMapRotation.copy(e.envMapRotation),this.combine=e.combine,this.reflectivity=e.reflectivity,this.refractionRatio=e.refractionRatio,this.wireframe=e.wireframe,this.wireframeLinewidth=e.wireframeLinewidth,this.wireframeLinecap=e.wireframeLinecap,this.wireframeLinejoin=e.wireframeLinejoin,this.flatShading=e.flatShading,this.fog=e.fog,this}}class eE extends Ei{constructor(e){super(),this.isMeshToonMaterial=!0,this.defines={TOON:""},this.type="MeshToonMaterial",this.color=new tt(16777215),this.map=null,this.gradientMap=null,this.lightMap=null,this.lightMapIntensity=1,this.aoMap=null,this.aoMapIntensity=1,this.emissive=new tt(0),this.emissiveIntensity=1,this.emissiveMap=null,this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=bl,this.normalScale=new Le(1,1),this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.alphaMap=null,this.wireframe=!1,this.wireframeLinewidth=1,this.wireframeLinecap="round",this.wireframeLinejoin="round",this.fog=!0,this.setValues(e)}copy(e){return super.copy(e),this.color.copy(e.color),this.map=e.map,this.gradientMap=e.gradientMap,this.lightMap=e.lightMap,this.lightMapIntensity=e.lightMapIntensity,this.aoMap=e.aoMap,this.aoMapIntensity=e.aoMapIntensity,this.emissive.copy(e.emissive),this.emissiveMap=e.emissiveMap,this.emissiveIntensity=e.emissiveIntensity,this.bumpMap=e.bumpMap,this.bumpScale=e.bumpScale,this.normalMap=e.normalMap,this.normalMapType=e.normalMapType,this.normalScale.copy(e.normalScale),this.displacementMap=e.displacementMap,this.displacementScale=e.displacementScale,this.displacementBias=e.displacementBias,this.alphaMap=e.alphaMap,this.wireframe=e.wireframe,this.wireframeLinewidth=e.wireframeLinewidth,this.wireframeLinecap=e.wireframeLinecap,this.wireframeLinejoin=e.wireframeLinejoin,this.fog=e.fog,this}}class tE extends Ei{constructor(e){super(),this.isMeshNormalMaterial=!0,this.type="MeshNormalMaterial",this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=bl,this.normalScale=new Le(1,1),this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.wireframe=!1,this.wireframeLinewidth=1,this.flatShading=!1,this.setValues(e)}copy(e){return super.copy(e),this.bumpMap=e.bumpMap,this.bumpScale=e.bumpScale,this.normalMap=e.normalMap,this.normalMapType=e.normalMapType,this.normalScale.copy(e.normalScale),this.displacementMap=e.displacementMap,this.displacementScale=e.displacementScale,this.displacementBias=e.displacementBias,this.wireframe=e.wireframe,this.wireframeLinewidth=e.wireframeLinewidth,this.flatShading=e.flatShading,this}}class nE extends Ei{constructor(e){super(),this.isMeshLambertMaterial=!0,this.type="MeshLambertMaterial",this.color=new tt(16777215),this.map=null,this.lightMap=null,this.lightMapIntensity=1,this.aoMap=null,this.aoMapIntensity=1,this.emissive=new tt(0),this.emissiveIntensity=1,this.emissiveMap=null,this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=bl,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 ns,this.combine=rp,this.reflectivity=1,this.refractionRatio=.98,this.wireframe=!1,this.wireframeLinewidth=1,this.wireframeLinecap="round",this.wireframeLinejoin="round",this.flatShading=!1,this.fog=!0,this.setValues(e)}copy(e){return super.copy(e),this.color.copy(e.color),this.map=e.map,this.lightMap=e.lightMap,this.lightMapIntensity=e.lightMapIntensity,this.aoMap=e.aoMap,this.aoMapIntensity=e.aoMapIntensity,this.emissive.copy(e.emissive),this.emissiveMap=e.emissiveMap,this.emissiveIntensity=e.emissiveIntensity,this.bumpMap=e.bumpMap,this.bumpScale=e.bumpScale,this.normalMap=e.normalMap,this.normalMapType=e.normalMapType,this.normalScale.copy(e.normalScale),this.displacementMap=e.displacementMap,this.displacementScale=e.displacementScale,this.displacementBias=e.displacementBias,this.specularMap=e.specularMap,this.alphaMap=e.alphaMap,this.envMap=e.envMap,this.envMapRotation.copy(e.envMapRotation),this.combine=e.combine,this.reflectivity=e.reflectivity,this.refractionRatio=e.refractionRatio,this.wireframe=e.wireframe,this.wireframeLinewidth=e.wireframeLinewidth,this.wireframeLinecap=e.wireframeLinecap,this.wireframeLinejoin=e.wireframeLinejoin,this.flatShading=e.flatShading,this.fog=e.fog,this}}class mx extends Ei{constructor(e){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(e)}copy(e){return super.copy(e),this.depthPacking=e.depthPacking,this.map=e.map,this.alphaMap=e.alphaMap,this.displacementMap=e.displacementMap,this.displacementScale=e.displacementScale,this.displacementBias=e.displacementBias,this.wireframe=e.wireframe,this.wireframeLinewidth=e.wireframeLinewidth,this}}class gx extends Ei{constructor(e){super(),this.isMeshDistanceMaterial=!0,this.type="MeshDistanceMaterial",this.map=null,this.alphaMap=null,this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.setValues(e)}copy(e){return super.copy(e),this.map=e.map,this.alphaMap=e.alphaMap,this.displacementMap=e.displacementMap,this.displacementScale=e.displacementScale,this.displacementBias=e.displacementBias,this}}class iE extends Ei{constructor(e){super(),this.isMeshMatcapMaterial=!0,this.defines={MATCAP:""},this.type="MeshMatcapMaterial",this.color=new tt(16777215),this.matcap=null,this.map=null,this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=bl,this.normalScale=new Le(1,1),this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.alphaMap=null,this.flatShading=!1,this.fog=!0,this.setValues(e)}copy(e){return super.copy(e),this.defines={MATCAP:""},this.color.copy(e.color),this.matcap=e.matcap,this.map=e.map,this.bumpMap=e.bumpMap,this.bumpScale=e.bumpScale,this.normalMap=e.normalMap,this.normalMapType=e.normalMapType,this.normalScale.copy(e.normalScale),this.displacementMap=e.displacementMap,this.displacementScale=e.displacementScale,this.displacementBias=e.displacementBias,this.alphaMap=e.alphaMap,this.flatShading=e.flatShading,this.fog=e.fog,this}}class rE extends or{constructor(e){super(),this.isLineDashedMaterial=!0,this.type="LineDashedMaterial",this.scale=1,this.dashSize=3,this.gapSize=1,this.setValues(e)}copy(e){return super.copy(e),this.scale=e.scale,this.dashSize=e.dashSize,this.gapSize=e.gapSize,this}}function Hu(i,e,t){return!i||!t&&i.constructor===e?i:typeof e.BYTES_PER_ELEMENT=="number"?new e(i):Array.prototype.slice.call(i)}function sE(i){return ArrayBuffer.isView(i)&&!(i instanceof DataView)}function oE(i){function e(r,s){return i[r]-i[s]}const t=i.length,n=new Array(t);for(let r=0;r!==t;++r)n[r]=r;return n.sort(e),n}function g_(i,e,t){const n=i.length,r=new i.constructor(n);for(let s=0,a=0;a!==n;++s){const u=t[s]*e;for(let d=0;d!==e;++d)r[a++]=i[u+d]}return r}function vx(i,e,t,n){let r=1,s=i[0];for(;s!==void 0&&s[n]===void 0;)s=i[r++];if(s===void 0)return;let a=s[n];if(a!==void 0)if(Array.isArray(a))do a=s[n],a!==void 0&&(e.push(s.time),t.push.apply(t,a)),s=i[r++];while(s!==void 0);else if(a.toArray!==void 0)do a=s[n],a!==void 0&&(e.push(s.time),a.toArray(t,t.length)),s=i[r++];while(s!==void 0);else do a=s[n],a!==void 0&&(e.push(s.time),t.push(a)),s=i[r++];while(s!==void 0)}function lR(i,e,t,n,r=30){const s=i.clone();s.name=e;const a=[];for(let d=0;d<s.tracks.length;++d){const h=s.tracks[d],m=h.getValueSize(),g=[],v=[];for(let _=0;_<h.times.length;++_){const A=h.times[_]*r;if(!(A<t||A>=n)){g.push(h.times[_]);for(let C=0;C<m;++C)v.push(h.values[_*m+C])}}g.length!==0&&(h.times=Hu(g,h.times.constructor),h.values=Hu(v,h.values.constructor),a.push(h))}s.tracks=a;let u=1/0;for(let d=0;d<s.tracks.length;++d)u>s.tracks[d].times[0]&&(u=s.tracks[d].times[0]);for(let d=0;d<s.tracks.length;++d)s.tracks[d].shift(-1*u);return s.resetDuration(),s}function uR(i,e=0,t=i,n=30){n<=0&&(n=30);const r=t.tracks.length,s=e/n;for(let a=0;a<r;++a){const u=t.tracks[a],d=u.ValueTypeName;if(d==="bool"||d==="string")continue;const h=i.tracks.find(function(S){return S.name===u.name&&S.ValueTypeName===d});if(h===void 0)continue;let m=0;const g=u.getValueSize();u.createInterpolant.isInterpolantFactoryMethodGLTFCubicSpline&&(m=g/3);let v=0;const _=h.getValueSize();h.createInterpolant.isInterpolantFactoryMethodGLTFCubicSpline&&(v=_/3);const A=u.times.length-1;let C;if(s<=u.times[0]){const S=m,b=g-m;C=u.values.slice(S,b)}else if(s>=u.times[A]){const S=A*g+m,b=S+g-m;C=u.values.slice(S,b)}else{const S=u.createInterpolant(),b=m,R=g-m;S.evaluate(s),C=S.resultBuffer.slice(b,R)}d==="quaternion"&&new Fi().fromArray(C).normalize().conjugate().toArray(C);const M=h.times.length;for(let S=0;S<M;++S){const b=S*_+v;if(d==="quaternion")Fi.multiplyQuaternionsFlat(h.values,b,C,0,h.values,b);else{const R=_-v*2;for(let P=0;P<R;++P)h.values[b+P]-=C[P]}}}return i.blendMode=Q_,i}const cR={convertArray:Hu,isTypedArray:sE,getKeyframeOrder:oE,sortedArray:g_,flattenJSON:vx,subclip:lR,makeClipAdditive:uR};class ld{constructor(e,t,n,r){this.parameterPositions=e,this._cachedIndex=0,this.resultBuffer=r!==void 0?r:new t.constructor(n),this.sampleValues=t,this.valueSize=n,this.settings=null,this.DefaultSettings_={}}evaluate(e){const t=this.parameterPositions;let n=this._cachedIndex,r=t[n],s=t[n-1];e:{t:{let a;n:{i:if(!(e<r)){for(let u=n+2;;){if(r===void 0){if(e<s)break i;return n=t.length,this._cachedIndex=n,this.copySampleValue_(n-1)}if(n===u)break;if(s=r,r=t[++n],e<r)break t}a=t.length;break n}if(!(e>=s)){const u=t[1];e<u&&(n=2,s=u);for(let d=n-2;;){if(s===void 0)return this._cachedIndex=0,this.copySampleValue_(0);if(n===d)break;if(r=s,s=t[--n-1],e>=s)break t}a=n,n=0;break n}break e}for(;n<a;){const u=n+a>>>1;e<t[u]?a=u:n=u+1}if(r=t[n],s=t[n-1],s===void 0)return this._cachedIndex=0,this.copySampleValue_(0);if(r===void 0)return n=t.length,this._cachedIndex=n,this.copySampleValue_(n-1)}this._cachedIndex=n,this.intervalChanged_(n,s,r)}return this.interpolate_(n,s,e,r)}getSettings_(){return this.settings||this.DefaultSettings_}copySampleValue_(e){const t=this.resultBuffer,n=this.sampleValues,r=this.valueSize,s=e*r;for(let a=0;a!==r;++a)t[a]=n[s+a];return t}interpolate_(){throw new Error("call to abstract method")}intervalChanged_(){}}class aE extends ld{constructor(e,t,n,r){super(e,t,n,r),this._weightPrev=-0,this._offsetPrev=-0,this._weightNext=-0,this._offsetNext=-0,this.DefaultSettings_={endingStart:Uu,endingEnd:Uu}}intervalChanged_(e,t,n){const r=this.parameterPositions;let s=e-2,a=e+1,u=r[s],d=r[a];if(u===void 0)switch(this.getSettings_().endingStart){case Ou:s=e,u=2*t-n;break;case Hh:s=r.length-2,u=t+r[s]-r[s+1];break;default:s=e,u=n}if(d===void 0)switch(this.getSettings_().endingEnd){case Ou:a=e,d=2*n-t;break;case Hh:a=1,d=n+r[1]-r[0];break;default:a=e-1,d=t}const h=(n-t)*.5,m=this.valueSize;this._weightPrev=h/(t-u),this._weightNext=h/(d-n),this._offsetPrev=s*m,this._offsetNext=a*m}interpolate_(e,t,n,r){const s=this.resultBuffer,a=this.sampleValues,u=this.valueSize,d=e*u,h=d-u,m=this._offsetPrev,g=this._offsetNext,v=this._weightPrev,_=this._weightNext,A=(n-t)/(r-t),C=A*A,M=C*A,S=-v*M+2*v*C-v*A,b=(1+v)*M+(-1.5-2*v)*C+(-.5+v)*A+1,R=(-1-_)*M+(1.5+_)*C+.5*A,P=_*M-_*C;for(let U=0;U!==u;++U)s[U]=S*a[m+U]+b*a[h+U]+R*a[d+U]+P*a[g+U];return s}}class yx extends ld{constructor(e,t,n,r){super(e,t,n,r)}interpolate_(e,t,n,r){const s=this.resultBuffer,a=this.sampleValues,u=this.valueSize,d=e*u,h=d-u,m=(n-t)/(r-t),g=1-m;for(let v=0;v!==u;++v)s[v]=a[h+v]*g+a[d+v]*m;return s}}class lE extends ld{constructor(e,t,n,r){super(e,t,n,r)}interpolate_(e){return this.copySampleValue_(e-1)}}class so{constructor(e,t,n,r){if(e===void 0)throw new Error("THREE.KeyframeTrack: track name is undefined");if(t===void 0||t.length===0)throw new Error("THREE.KeyframeTrack: no keyframes in track named "+e);this.name=e,this.times=Hu(t,this.TimeBufferType),this.values=Hu(n,this.ValueBufferType),this.setInterpolation(r||this.DefaultInterpolation)}static toJSON(e){const t=e.constructor;let n;if(t.toJSON!==this.toJSON)n=t.toJSON(e);else{n={name:e.name,times:Hu(e.times,Array),values:Hu(e.values,Array)};const r=e.getInterpolation();r!==e.DefaultInterpolation&&(n.interpolation=r)}return n.type=e.ValueTypeName,n}InterpolantFactoryMethodDiscrete(e){return new lE(this.times,this.values,this.getValueSize(),e)}InterpolantFactoryMethodLinear(e){return new yx(this.times,this.values,this.getValueSize(),e)}InterpolantFactoryMethodSmooth(e){return new aE(this.times,this.values,this.getValueSize(),e)}setInterpolation(e){let t;switch(e){case Kf:t=this.InterpolantFactoryMethodDiscrete;break;case Yf:t=this.InterpolantFactoryMethodLinear;break;case _g:t=this.InterpolantFactoryMethodSmooth;break}if(t===void 0){const n="unsupported interpolation for "+this.ValueTypeName+" keyframe track named "+this.name;if(this.createInterpolant===void 0)if(e!==this.DefaultInterpolation)this.setInterpolation(this.DefaultInterpolation);else throw new Error(n);return console.warn("THREE.KeyframeTrack:",n),this}return this.createInterpolant=t,this}getInterpolation(){switch(this.createInterpolant){case this.InterpolantFactoryMethodDiscrete:return Kf;case this.InterpolantFactoryMethodLinear:return Yf;case this.InterpolantFactoryMethodSmooth:return _g}}getValueSize(){return this.values.length/this.times.length}shift(e){if(e!==0){const t=this.times;for(let n=0,r=t.length;n!==r;++n)t[n]+=e}return this}scale(e){if(e!==1){const t=this.times;for(let n=0,r=t.length;n!==r;++n)t[n]*=e}return this}trim(e,t){const n=this.times,r=n.length;let s=0,a=r-1;for(;s!==r&&n[s]<e;)++s;for(;a!==-1&&n[a]>t;)--a;if(++a,s!==0||a!==r){s>=a&&(a=Math.max(a,1),s=a-1);const u=this.getValueSize();this.times=n.slice(s,a),this.values=this.values.slice(s*u,a*u)}return this}validate(){let e=!0;const t=this.getValueSize();t-Math.floor(t)!==0&&(console.error("THREE.KeyframeTrack: Invalid value size in track.",this),e=!1);const n=this.times,r=this.values,s=n.length;s===0&&(console.error("THREE.KeyframeTrack: Track is empty.",this),e=!1);let a=null;for(let u=0;u!==s;u++){const d=n[u];if(typeof d=="number"&&isNaN(d)){console.error("THREE.KeyframeTrack: Time is not a valid number.",this,u,d),e=!1;break}if(a!==null&&a>d){console.error("THREE.KeyframeTrack: Out of order keys.",this,u,d,a),e=!1;break}a=d}if(r!==void 0&&sE(r))for(let u=0,d=r.length;u!==d;++u){const h=r[u];if(isNaN(h)){console.error("THREE.KeyframeTrack: Value is not a valid number.",this,u,h),e=!1;break}}return e}optimize(){const e=this.times.slice(),t=this.values.slice(),n=this.getValueSize(),r=this.getInterpolation()===_g,s=e.length-1;let a=1;for(let u=1;u<s;++u){let d=!1;const h=e[u],m=e[u+1];if(h!==m&&(u!==1||h!==e[0]))if(r)d=!0;else{const g=u*n,v=g-n,_=g+n;for(let A=0;A!==n;++A){const C=t[g+A];if(C!==t[v+A]||C!==t[_+A]){d=!0;break}}}if(d){if(u!==a){e[a]=e[u];const g=u*n,v=a*n;for(let _=0;_!==n;++_)t[v+_]=t[g+_]}++a}}if(s>0){e[a]=e[s];for(let u=s*n,d=a*n,h=0;h!==n;++h)t[d+h]=t[u+h];++a}return a!==e.length?(this.times=e.slice(0,a),this.values=t.slice(0,a*n)):(this.times=e,this.values=t),this}clone(){const e=this.times.slice(),t=this.values.slice(),n=this.constructor,r=new n(this.name,e,t);return r.createInterpolant=this.createInterpolant,r}}so.prototype.TimeBufferType=Float32Array;so.prototype.ValueBufferType=Float32Array;so.prototype.DefaultInterpolation=Yf;class oc extends so{constructor(e,t,n){super(e,t,n)}}oc.prototype.ValueTypeName="bool";oc.prototype.ValueBufferType=Array;oc.prototype.DefaultInterpolation=Kf;oc.prototype.InterpolantFactoryMethodLinear=void 0;oc.prototype.InterpolantFactoryMethodSmooth=void 0;class _x extends so{}_x.prototype.ValueTypeName="color";class ec extends so{}ec.prototype.ValueTypeName="number";class uE extends ld{constructor(e,t,n,r){super(e,t,n,r)}interpolate_(e,t,n,r){const s=this.resultBuffer,a=this.sampleValues,u=this.valueSize,d=(n-t)/(r-t);let h=e*u;for(let m=h+u;h!==m;h+=4)Fi.slerpFlat(s,0,a,h-u,a,h,d);return s}}class tc extends so{InterpolantFactoryMethodLinear(e){return new uE(this.times,this.values,this.getValueSize(),e)}}tc.prototype.ValueTypeName="quaternion";tc.prototype.InterpolantFactoryMethodSmooth=void 0;class ac extends so{constructor(e,t,n){super(e,t,n)}}ac.prototype.ValueTypeName="string";ac.prototype.ValueBufferType=Array;ac.prototype.DefaultInterpolation=Kf;ac.prototype.InterpolantFactoryMethodLinear=void 0;ac.prototype.InterpolantFactoryMethodSmooth=void 0;class nc extends so{}nc.prototype.ValueTypeName="vector";class Zf{constructor(e="",t=-1,n=[],r=B0){this.name=e,this.tracks=n,this.duration=t,this.blendMode=r,this.uuid=ts(),this.duration<0&&this.resetDuration()}static parse(e){const t=[],n=e.tracks,r=1/(e.fps||1);for(let a=0,u=n.length;a!==u;++a)t.push(dR(n[a]).scale(r));const s=new this(e.name,e.duration,t,e.blendMode);return s.uuid=e.uuid,s}static toJSON(e){const t=[],n=e.tracks,r={name:e.name,duration:e.duration,tracks:t,uuid:e.uuid,blendMode:e.blendMode};for(let s=0,a=n.length;s!==a;++s)t.push(so.toJSON(n[s]));return r}static CreateFromMorphTargetSequence(e,t,n,r){const s=t.length,a=[];for(let u=0;u<s;u++){let d=[],h=[];d.push((u+s-1)%s,u,(u+1)%s),h.push(0,1,0);const m=oE(d);d=g_(d,1,m),h=g_(h,1,m),!r&&d[0]===0&&(d.push(s),h.push(h[0])),a.push(new ec(".morphTargetInfluences["+t[u].name+"]",d,h).scale(1/n))}return new this(e,-1,a)}static findByName(e,t){let n=e;if(!Array.isArray(e)){const r=e;n=r.geometry&&r.geometry.animations||r.animations}for(let r=0;r<n.length;r++)if(n[r].name===t)return n[r];return null}static CreateClipsFromMorphTargetSequences(e,t,n){const r={},s=/^([\w-]*?)([\d]+)$/;for(let u=0,d=e.length;u<d;u++){const h=e[u],m=h.name.match(s);if(m&&m.length>1){const g=m[1];let v=r[g];v||(r[g]=v=[]),v.push(h)}}const a=[];for(const u in r)a.push(this.CreateFromMorphTargetSequence(u,r[u],t,n));return a}static parseAnimation(e,t){if(!e)return console.error("THREE.AnimationClip: No animation in JSONLoader data."),null;const n=function(g,v,_,A,C){if(_.length!==0){const M=[],S=[];vx(_,M,S,A),M.length!==0&&C.push(new g(v,M,S))}},r=[],s=e.name||"default",a=e.fps||30,u=e.blendMode;let d=e.length||-1;const h=e.hierarchy||[];for(let g=0;g<h.length;g++){const v=h[g].keys;if(!(!v||v.length===0))if(v[0].morphTargets){const _={};let A;for(A=0;A<v.length;A++)if(v[A].morphTargets)for(let C=0;C<v[A].morphTargets.length;C++)_[v[A].morphTargets[C]]=-1;for(const C in _){const M=[],S=[];for(let b=0;b!==v[A].morphTargets.length;++b){const R=v[A];M.push(R.time),S.push(R.morphTarget===C?1:0)}r.push(new ec(".morphTargetInfluence["+C+"]",M,S))}d=_.length*a}else{const _=".bones["+t[g].name+"]";n(nc,_+".position",v,"pos",r),n(tc,_+".quaternion",v,"rot",r),n(nc,_+".scale",v,"scl",r)}}return r.length===0?null:new this(s,d,r,u)}resetDuration(){const e=this.tracks;let t=0;for(let n=0,r=e.length;n!==r;++n){const s=this.tracks[n];t=Math.max(t,s.times[s.times.length-1])}return this.duration=t,this}trim(){for(let e=0;e<this.tracks.length;e++)this.tracks[e].trim(0,this.duration);return this}validate(){let e=!0;for(let t=0;t<this.tracks.length;t++)e=e&&this.tracks[t].validate();return e}optimize(){for(let e=0;e<this.tracks.length;e++)this.tracks[e].optimize();return this}clone(){const e=[];for(let t=0;t<this.tracks.length;t++)e.push(this.tracks[t].clone());return new this.constructor(this.name,this.duration,e,this.blendMode)}toJSON(){return this.constructor.toJSON(this)}}function fR(i){switch(i.toLowerCase()){case"scalar":case"double":case"float":case"number":case"integer":return ec;case"vector":case"vector2":case"vector3":case"vector4":return nc;case"color":return _x;case"quaternion":return tc;case"bool":case"boolean":return oc;case"string":return ac}throw new Error("THREE.KeyframeTrack: Unsupported typeName: "+i)}function dR(i){if(i.type===void 0)throw new Error("THREE.KeyframeTrack: track type undefined, can not parse");const e=fR(i.type);if(i.times===void 0){const t=[],n=[];vx(i.keys,t,n,"value"),i.times=t,i.values=n}return e.parse!==void 0?e.parse(i):new e(i.name,i.times,i.values,i.interpolation)}const Aa={enabled:!1,files:{},add:function(i,e){this.enabled!==!1&&(this.files[i]=e)},get:function(i){if(this.enabled!==!1)return this.files[i]},remove:function(i){delete this.files[i]},clear:function(){this.files={}}};class xx{constructor(e,t,n){const r=this;let s=!1,a=0,u=0,d;const h=[];this.onStart=void 0,this.onLoad=e,this.onProgress=t,this.onError=n,this.itemStart=function(m){u++,s===!1&&r.onStart!==void 0&&r.onStart(m,a,u),s=!0},this.itemEnd=function(m){a++,r.onProgress!==void 0&&r.onProgress(m,a,u),a===u&&(s=!1,r.onLoad!==void 0&&r.onLoad())},this.itemError=function(m){r.onError!==void 0&&r.onError(m)},this.resolveURL=function(m){return d?d(m):m},this.setURLModifier=function(m){return d=m,this},this.addHandler=function(m,g){return h.push(m,g),this},this.removeHandler=function(m){const g=h.indexOf(m);return g!==-1&&h.splice(g,2),this},this.getHandler=function(m){for(let g=0,v=h.length;g<v;g+=2){const _=h[g],A=h[g+1];if(_.global&&(_.lastIndex=0),_.test(m))return A}return null}}}const cE=new xx;let ar=class{constructor(e){this.manager=e!==void 0?e:cE,this.crossOrigin="anonymous",this.withCredentials=!1,this.path="",this.resourcePath="",this.requestHeader={}}load(){}loadAsync(e,t){const n=this;return new Promise(function(r,s){n.load(e,r,t,s)})}parse(){}setCrossOrigin(e){return this.crossOrigin=e,this}setWithCredentials(e){return this.withCredentials=e,this}setPath(e){return this.path=e,this}setResourcePath(e){return this.resourcePath=e,this}setRequestHeader(e){return this.requestHeader=e,this}};ar.DEFAULT_MATERIAL_NAME="__DEFAULT";const ma={};class hR extends Error{constructor(e,t){super(e),this.response=t}}class is extends ar{constructor(e){super(e)}load(e,t,n,r){e===void 0&&(e=""),this.path!==void 0&&(e=this.path+e),e=this.manager.resolveURL(e);const s=Aa.get(e);if(s!==void 0)return this.manager.itemStart(e),setTimeout(()=>{t&&t(s),this.manager.itemEnd(e)},0),s;if(ma[e]!==void 0){ma[e].push({onLoad:t,onProgress:n,onError:r});return}ma[e]=[],ma[e].push({onLoad:t,onProgress:n,onError:r});const a=new Request(e,{headers:new Headers(this.requestHeader),credentials:this.withCredentials?"include":"same-origin"}),u=this.mimeType,d=this.responseType;fetch(a).then(h=>{if(h.status===200||h.status===0){if(h.status===0&&console.warn("THREE.FileLoader: HTTP Status 0 received."),typeof ReadableStream>"u"||h.body===void 0||h.body.getReader===void 0)return h;const m=ma[e],g=h.body.getReader(),v=h.headers.get("X-File-Size")||h.headers.get("Content-Length"),_=v?parseInt(v):0,A=_!==0;let C=0;const M=new ReadableStream({start(S){b();function b(){g.read().then(({done:R,value:P})=>{if(R)S.close();else{C+=P.byteLength;const U=new ProgressEvent("progress",{lengthComputable:A,loaded:C,total:_});for(let F=0,k=m.length;F<k;F++){const G=m[F];G.onProgress&&G.onProgress(U)}S.enqueue(P),b()}},R=>{S.error(R)})}}});return new Response(M)}else throw new hR(`fetch for "${h.url}" responded with ${h.status}: ${h.statusText}`,h)}).then(h=>{switch(d){case"arraybuffer":return h.arrayBuffer();case"blob":return h.blob();case"document":return h.text().then(m=>new DOMParser().parseFromString(m,u));case"json":return h.json();default:if(u===void 0)return h.text();{const g=/charset="?([^;"\s]*)"?/i.exec(u),v=g&&g[1]?g[1].toLowerCase():void 0,_=new TextDecoder(v);return h.arrayBuffer().then(A=>_.decode(A))}}}).then(h=>{Aa.add(e,h);const m=ma[e];delete ma[e];for(let g=0,v=m.length;g<v;g++){const _=m[g];_.onLoad&&_.onLoad(h)}}).catch(h=>{const m=ma[e];if(m===void 0)throw this.manager.itemError(e),h;delete ma[e];for(let g=0,v=m.length;g<v;g++){const _=m[g];_.onError&&_.onError(h)}this.manager.itemError(e)}).finally(()=>{this.manager.itemEnd(e)}),this.manager.itemStart(e)}setResponseType(e){return this.responseType=e,this}setMimeType(e){return this.mimeType=e,this}}class pR extends ar{constructor(e){super(e)}load(e,t,n,r){const s=this,a=new is(this.manager);a.setPath(this.path),a.setRequestHeader(this.requestHeader),a.setWithCredentials(this.withCredentials),a.load(e,function(u){try{t(s.parse(JSON.parse(u)))}catch(d){r?r(d):console.error(d),s.manager.itemError(e)}},n,r)}parse(e){const t=[];for(let n=0;n<e.length;n++){const r=Zf.parse(e[n]);t.push(r)}return t}}class mR extends ar{constructor(e){super(e)}load(e,t,n,r){const s=this,a=[],u=new k0,d=new is(this.manager);d.setPath(this.path),d.setResponseType("arraybuffer"),d.setRequestHeader(this.requestHeader),d.setWithCredentials(s.withCredentials);let h=0;function m(g){d.load(e[g],function(v){const _=s.parse(v,!0);a[g]={width:_.width,height:_.height,format:_.format,mipmaps:_.mipmaps},h+=1,h===6&&(_.mipmapCount===1&&(u.minFilter=ri),u.image=a,u.format=_.format,u.needsUpdate=!0,t&&t(u))},n,r)}if(Array.isArray(e))for(let g=0,v=e.length;g<v;++g)m(g);else d.load(e,function(g){const v=s.parse(g,!0);if(v.isCubemap){const _=v.mipmaps.length/v.mipmapCount;for(let A=0;A<_;A++){a[A]={mipmaps:[]};for(let C=0;C<v.mipmapCount;C++)a[A].mipmaps.push(v.mipmaps[A*v.mipmapCount+C]),a[A].format=v.format,a[A].width=v.width,a[A].height=v.height}u.image=a}else u.image.width=v.width,u.image.height=v.height,u.mipmaps=v.mipmaps;v.mipmapCount===1&&(u.minFilter=ri),u.format=v.format,u.needsUpdate=!0,t&&t(u)},n,r);return u}}class Yh extends ar{constructor(e){super(e)}load(e,t,n,r){this.path!==void 0&&(e=this.path+e),e=this.manager.resolveURL(e);const s=this,a=Aa.get(e);if(a!==void 0)return s.manager.itemStart(e),setTimeout(function(){t&&t(a),s.manager.itemEnd(e)},0),a;const u=Wh("img");function d(){m(),Aa.add(e,this),t&&t(this),s.manager.itemEnd(e)}function h(g){m(),r&&r(g),s.manager.itemError(e),s.manager.itemEnd(e)}function m(){u.removeEventListener("load",d,!1),u.removeEventListener("error",h,!1)}return u.addEventListener("load",d,!1),u.addEventListener("error",h,!1),e.slice(0,5)!=="data:"&&this.crossOrigin!==void 0&&(u.crossOrigin=this.crossOrigin),s.manager.itemStart(e),u.src=e,u}}class gR extends ar{constructor(e){super(e)}load(e,t,n,r){const s=new lp;s.colorSpace=Nr;const a=new Yh(this.manager);a.setCrossOrigin(this.crossOrigin),a.setPath(this.path);let u=0;function d(h){a.load(e[h],function(m){s.images[h]=m,u++,u===6&&(s.needsUpdate=!0,t&&t(s))},void 0,r)}for(let h=0;h<e.length;++h)d(h);return s}}class vR extends ar{constructor(e){super(e)}load(e,t,n,r){const s=this,a=new Eo,u=new is(this.manager);return u.setResponseType("arraybuffer"),u.setRequestHeader(this.requestHeader),u.setPath(this.path),u.setWithCredentials(s.withCredentials),u.load(e,function(d){let h;try{h=s.parse(d)}catch(m){if(r!==void 0)r(m);else{console.error(m);return}}h.image!==void 0?a.image=h.image:h.data!==void 0&&(a.image.width=h.width,a.image.height=h.height,a.image.data=h.data),a.wrapS=h.wrapS!==void 0?h.wrapS:$r,a.wrapT=h.wrapT!==void 0?h.wrapT:$r,a.magFilter=h.magFilter!==void 0?h.magFilter:ri,a.minFilter=h.minFilter!==void 0?h.minFilter:ri,a.anisotropy=h.anisotropy!==void 0?h.anisotropy:1,h.colorSpace!==void 0&&(a.colorSpace=h.colorSpace),h.flipY!==void 0&&(a.flipY=h.flipY),h.format!==void 0&&(a.format=h.format),h.type!==void 0&&(a.type=h.type),h.mipmaps!==void 0&&(a.mipmaps=h.mipmaps,a.minFilter=As),h.mipmapCount===1&&(a.minFilter=ri),h.generateMipmaps!==void 0&&(a.generateMipmaps=h.generateMipmaps),a.needsUpdate=!0,t&&t(a,h)},n,r),a}}class fE extends ar{constructor(e){super(e)}load(e,t,n,r){const s=new zn,a=new Yh(this.manager);return a.setCrossOrigin(this.crossOrigin),a.setPath(this.path),a.load(e,function(u){s.image=u,s.needsUpdate=!0,t!==void 0&&t(s)},n,r),s}}class Il extends fn{constructor(e,t=1){super(),this.isLight=!0,this.type="Light",this.color=new tt(e),this.intensity=t}dispose(){}copy(e,t){return super.copy(e,t),this.color.copy(e.color),this.intensity=e.intensity,this}toJSON(e){const t=super.toJSON(e);return t.object.color=this.color.getHex(),t.object.intensity=this.intensity,this.groundColor!==void 0&&(t.object.groundColor=this.groundColor.getHex()),this.distance!==void 0&&(t.object.distance=this.distance),this.angle!==void 0&&(t.object.angle=this.angle),this.decay!==void 0&&(t.object.decay=this.decay),this.penumbra!==void 0&&(t.object.penumbra=this.penumbra),this.shadow!==void 0&&(t.object.shadow=this.shadow.toJSON()),this.target!==void 0&&(t.object.target=this.target.uuid),t}}class dE extends Il{constructor(e,t,n){super(e,n),this.isHemisphereLight=!0,this.type="HemisphereLight",this.position.copy(fn.DEFAULT_UP),this.updateMatrix(),this.groundColor=new tt(t)}copy(e,t){return super.copy(e,t),this.groundColor.copy(e.groundColor),this}}const _y=new Ot,BA=new X,LA=new X;class Ax{constructor(e){this.camera=e,this.intensity=1,this.bias=0,this.normalBias=0,this.radius=1,this.blurSamples=8,this.mapSize=new Le(512,512),this.map=null,this.mapPass=null,this.matrix=new Ot,this.autoUpdate=!0,this.needsUpdate=!1,this._frustum=new fp,this._frameExtents=new Le(1,1),this._viewportCount=1,this._viewports=[new _n(0,0,1,1)]}getViewportCount(){return this._viewportCount}getFrustum(){return this._frustum}updateMatrices(e){const t=this.camera,n=this.matrix;BA.setFromMatrixPosition(e.matrixWorld),t.position.copy(BA),LA.setFromMatrixPosition(e.target.matrixWorld),t.lookAt(LA),t.updateMatrixWorld(),_y.multiplyMatrices(t.projectionMatrix,t.matrixWorldInverse),this._frustum.setFromProjectionMatrix(_y),n.set(.5,0,0,.5,0,.5,0,.5,0,0,.5,.5,0,0,0,1),n.multiply(_y)}getViewport(e){return this._viewports[e]}getFrameExtents(){return this._frameExtents}dispose(){this.map&&this.map.dispose(),this.mapPass&&this.mapPass.dispose()}copy(e){return this.camera=e.camera.clone(),this.intensity=e.intensity,this.bias=e.bias,this.radius=e.radius,this.mapSize.copy(e.mapSize),this}clone(){return new this.constructor().copy(this)}toJSON(){const e={};return this.intensity!==1&&(e.intensity=this.intensity),this.bias!==0&&(e.bias=this.bias),this.normalBias!==0&&(e.normalBias=this.normalBias),this.radius!==1&&(e.radius=this.radius),(this.mapSize.x!==512||this.mapSize.y!==512)&&(e.mapSize=this.mapSize.toArray()),e.camera=this.camera.toJSON(!1).object,delete e.camera.matrix,e}}class yR extends Ax{constructor(){super(new Hn(50,1,.5,500)),this.isSpotLightShadow=!0,this.focus=1}updateMatrices(e){const t=this.camera,n=Qf*2*e.angle*this.focus,r=this.mapSize.width/this.mapSize.height,s=e.distance||t.far;(n!==t.fov||r!==t.aspect||s!==t.far)&&(t.fov=n,t.aspect=r,t.far=s,t.updateProjectionMatrix()),super.updateMatrices(e)}copy(e){return super.copy(e),this.focus=e.focus,this}}class Sx extends Il{constructor(e,t,n=0,r=Math.PI/3,s=0,a=2){super(e,t),this.isSpotLight=!0,this.type="SpotLight",this.position.copy(fn.DEFAULT_UP),this.updateMatrix(),this.target=new fn,this.distance=n,this.angle=r,this.penumbra=s,this.decay=a,this.map=null,this.shadow=new yR}get power(){return this.intensity*Math.PI}set power(e){this.intensity=e/Math.PI}dispose(){this.shadow.dispose()}copy(e,t){return super.copy(e,t),this.distance=e.distance,this.angle=e.angle,this.penumbra=e.penumbra,this.decay=e.decay,this.target=e.target.clone(),this.shadow=e.shadow.clone(),this}}const DA=new Ot,yh=new X,xy=new X;class _R extends Ax{constructor(){super(new Hn(90,1,.5,500)),this.isPointLightShadow=!0,this._frameExtents=new Le(4,2),this._viewportCount=6,this._viewports=[new _n(2,1,1,1),new _n(0,1,1,1),new _n(3,1,1,1),new _n(1,1,1,1),new _n(3,0,1,1),new _n(1,0,1,1)],this._cubeDirections=[new X(1,0,0),new X(-1,0,0),new X(0,0,1),new X(0,0,-1),new X(0,1,0),new X(0,-1,0)],this._cubeUps=[new X(0,1,0),new X(0,1,0),new X(0,1,0),new X(0,1,0),new X(0,0,1),new X(0,0,-1)]}updateMatrices(e,t=0){const n=this.camera,r=this.matrix,s=e.distance||n.far;s!==n.far&&(n.far=s,n.updateProjectionMatrix()),yh.setFromMatrixPosition(e.matrixWorld),n.position.copy(yh),xy.copy(n.position),xy.add(this._cubeDirections[t]),n.up.copy(this._cubeUps[t]),n.lookAt(xy),n.updateMatrixWorld(),r.makeTranslation(-yh.x,-yh.y,-yh.z),DA.multiplyMatrices(n.projectionMatrix,n.matrixWorldInverse),this._frustum.setFromProjectionMatrix(DA)}}class Mx extends Il{constructor(e,t,n=0,r=2){super(e,t),this.isPointLight=!0,this.type="PointLight",this.distance=n,this.decay=r,this.shadow=new _R}get power(){return this.intensity*4*Math.PI}set power(e){this.intensity=e/(4*Math.PI)}dispose(){this.shadow.dispose()}copy(e,t){return super.copy(e,t),this.distance=e.distance,this.decay=e.decay,this.shadow=e.shadow.clone(),this}}class eo extends ap{constructor(e=-1,t=1,n=1,r=-1,s=.1,a=2e3){super(),this.isOrthographicCamera=!0,this.type="OrthographicCamera",this.zoom=1,this.view=null,this.left=e,this.right=t,this.top=n,this.bottom=r,this.near=s,this.far=a,this.updateProjectionMatrix()}copy(e,t){return super.copy(e,t),this.left=e.left,this.right=e.right,this.top=e.top,this.bottom=e.bottom,this.near=e.near,this.far=e.far,this.zoom=e.zoom,this.view=e.view===null?null:Object.assign({},e.view),this}setViewOffset(e,t,n,r,s,a){this.view===null&&(this.view={enabled:!0,fullWidth:1,fullHeight:1,offsetX:0,offsetY:0,width:1,height:1}),this.view.enabled=!0,this.view.fullWidth=e,this.view.fullHeight=t,this.view.offsetX=n,this.view.offsetY=r,this.view.width=s,this.view.height=a,this.updateProjectionMatrix()}clearViewOffset(){this.view!==null&&(this.view.enabled=!1),this.updateProjectionMatrix()}updateProjectionMatrix(){const e=(this.right-this.left)/(2*this.zoom),t=(this.top-this.bottom)/(2*this.zoom),n=(this.right+this.left)/2,r=(this.top+this.bottom)/2;let s=n-e,a=n+e,u=r+t,d=r-t;if(this.view!==null&&this.view.enabled){const h=(this.right-this.left)/this.view.fullWidth/this.zoom,m=(this.top-this.bottom)/this.view.fullHeight/this.zoom;s+=h*this.view.offsetX,a=s+h*this.view.width,u-=m*this.view.offsetY,d=u-m*this.view.height}this.projectionMatrix.makeOrthographic(s,a,u,d,this.near,this.far,this.coordinateSystem),this.projectionMatrixInverse.copy(this.projectionMatrix).invert()}toJSON(e){const t=super.toJSON(e);return t.object.zoom=this.zoom,t.object.left=this.left,t.object.right=this.right,t.object.top=this.top,t.object.bottom=this.bottom,t.object.near=this.near,t.object.far=this.far,this.view!==null&&(t.object.view=Object.assign({},this.view)),t}}class xR extends Ax{constructor(){super(new eo(-5,5,5,-5,.5,500)),this.isDirectionalLightShadow=!0}}class Ex extends Il{constructor(e,t){super(e,t),this.isDirectionalLight=!0,this.type="DirectionalLight",this.position.copy(fn.DEFAULT_UP),this.updateMatrix(),this.target=new fn,this.shadow=new xR}dispose(){this.shadow.dispose()}copy(e){return super.copy(e),this.target=e.target.clone(),this.shadow=e.shadow.clone(),this}}class hE extends Il{constructor(e,t){super(e,t),this.isAmbientLight=!0,this.type="AmbientLight"}}class pE extends Il{constructor(e,t,n=10,r=10){super(e,t),this.isRectAreaLight=!0,this.type="RectAreaLight",this.width=n,this.height=r}get power(){return this.intensity*this.width*this.height*Math.PI}set power(e){this.intensity=e/(this.width*this.height*Math.PI)}copy(e){return super.copy(e),this.width=e.width,this.height=e.height,this}toJSON(e){const t=super.toJSON(e);return t.object.width=this.width,t.object.height=this.height,t}}class mE{constructor(){this.isSphericalHarmonics3=!0,this.coefficients=[];for(let e=0;e<9;e++)this.coefficients.push(new X)}set(e){for(let t=0;t<9;t++)this.coefficients[t].copy(e[t]);return this}zero(){for(let e=0;e<9;e++)this.coefficients[e].set(0,0,0);return this}getAt(e,t){const n=e.x,r=e.y,s=e.z,a=this.coefficients;return t.copy(a[0]).multiplyScalar(.282095),t.addScaledVector(a[1],.488603*r),t.addScaledVector(a[2],.488603*s),t.addScaledVector(a[3],.488603*n),t.addScaledVector(a[4],1.092548*(n*r)),t.addScaledVector(a[5],1.092548*(r*s)),t.addScaledVector(a[6],.315392*(3*s*s-1)),t.addScaledVector(a[7],1.092548*(n*s)),t.addScaledVector(a[8],.546274*(n*n-r*r)),t}getIrradianceAt(e,t){const n=e.x,r=e.y,s=e.z,a=this.coefficients;return t.copy(a[0]).multiplyScalar(.886227),t.addScaledVector(a[1],2*.511664*r),t.addScaledVector(a[2],2*.511664*s),t.addScaledVector(a[3],2*.511664*n),t.addScaledVector(a[4],2*.429043*n*r),t.addScaledVector(a[5],2*.429043*r*s),t.addScaledVector(a[6],.743125*s*s-.247708),t.addScaledVector(a[7],2*.429043*n*s),t.addScaledVector(a[8],.429043*(n*n-r*r)),t}add(e){for(let t=0;t<9;t++)this.coefficients[t].add(e.coefficients[t]);return this}addScaledSH(e,t){for(let n=0;n<9;n++)this.coefficients[n].addScaledVector(e.coefficients[n],t);return this}scale(e){for(let t=0;t<9;t++)this.coefficients[t].multiplyScalar(e);return this}lerp(e,t){for(let n=0;n<9;n++)this.coefficients[n].lerp(e.coefficients[n],t);return this}equals(e){for(let t=0;t<9;t++)if(!this.coefficients[t].equals(e.coefficients[t]))return!1;return!0}copy(e){return this.set(e.coefficients)}clone(){return new this.constructor().copy(this)}fromArray(e,t=0){const n=this.coefficients;for(let r=0;r<9;r++)n[r].fromArray(e,t+r*3);return this}toArray(e=[],t=0){const n=this.coefficients;for(let r=0;r<9;r++)n[r].toArray(e,t+r*3);return e}static getBasisAt(e,t){const n=e.x,r=e.y,s=e.z;t[0]=.282095,t[1]=.488603*r,t[2]=.488603*s,t[3]=.488603*n,t[4]=1.092548*n*r,t[5]=1.092548*r*s,t[6]=.315392*(3*s*s-1),t[7]=1.092548*n*s,t[8]=.546274*(n*n-r*r)}}class gE extends Il{constructor(e=new mE,t=1){super(void 0,t),this.isLightProbe=!0,this.sh=e}copy(e){return super.copy(e),this.sh.copy(e.sh),this}fromJSON(e){return this.intensity=e.intensity,this.sh.fromArray(e.sh),this}toJSON(e){const t=super.toJSON(e);return t.object.sh=this.sh.toArray(),t}}class ev extends ar{constructor(e){super(e),this.textures={}}load(e,t,n,r){const s=this,a=new is(s.manager);a.setPath(s.path),a.setRequestHeader(s.requestHeader),a.setWithCredentials(s.withCredentials),a.load(e,function(u){try{t(s.parse(JSON.parse(u)))}catch(d){r?r(d):console.error(d),s.manager.itemError(e)}},n,r)}parse(e){const t=this.textures;function n(s){return t[s]===void 0&&console.warn("THREE.MaterialLoader: Undefined texture",s),t[s]}const r=this.createMaterialFromType(e.type);if(e.uuid!==void 0&&(r.uuid=e.uuid),e.name!==void 0&&(r.name=e.name),e.color!==void 0&&r.color!==void 0&&r.color.setHex(e.color),e.roughness!==void 0&&(r.roughness=e.roughness),e.metalness!==void 0&&(r.metalness=e.metalness),e.sheen!==void 0&&(r.sheen=e.sheen),e.sheenColor!==void 0&&(r.sheenColor=new tt().setHex(e.sheenColor)),e.sheenRoughness!==void 0&&(r.sheenRoughness=e.sheenRoughness),e.emissive!==void 0&&r.emissive!==void 0&&r.emissive.setHex(e.emissive),e.specular!==void 0&&r.specular!==void 0&&r.specular.setHex(e.specular),e.specularIntensity!==void 0&&(r.specularIntensity=e.specularIntensity),e.specularColor!==void 0&&r.specularColor!==void 0&&r.specularColor.setHex(e.specularColor),e.shininess!==void 0&&(r.shininess=e.shininess),e.clearcoat!==void 0&&(r.clearcoat=e.clearcoat),e.clearcoatRoughness!==void 0&&(r.clearcoatRoughness=e.clearcoatRoughness),e.dispersion!==void 0&&(r.dispersion=e.dispersion),e.iridescence!==void 0&&(r.iridescence=e.iridescence),e.iridescenceIOR!==void 0&&(r.iridescenceIOR=e.iridescenceIOR),e.iridescenceThicknessRange!==void 0&&(r.iridescenceThicknessRange=e.iridescenceThicknessRange),e.transmission!==void 0&&(r.transmission=e.transmission),e.thickness!==void 0&&(r.thickness=e.thickness),e.attenuationDistance!==void 0&&(r.attenuationDistance=e.attenuationDistance),e.attenuationColor!==void 0&&r.attenuationColor!==void 0&&r.attenuationColor.setHex(e.attenuationColor),e.anisotropy!==void 0&&(r.anisotropy=e.anisotropy),e.anisotropyRotation!==void 0&&(r.anisotropyRotation=e.anisotropyRotation),e.fog!==void 0&&(r.fog=e.fog),e.flatShading!==void 0&&(r.flatShading=e.flatShading),e.blending!==void 0&&(r.blending=e.blending),e.combine!==void 0&&(r.combine=e.combine),e.side!==void 0&&(r.side=e.side),e.shadowSide!==void 0&&(r.shadowSide=e.shadowSide),e.opacity!==void 0&&(r.opacity=e.opacity),e.transparent!==void 0&&(r.transparent=e.transparent),e.alphaTest!==void 0&&(r.alphaTest=e.alphaTest),e.alphaHash!==void 0&&(r.alphaHash=e.alphaHash),e.depthFunc!==void 0&&(r.depthFunc=e.depthFunc),e.depthTest!==void 0&&(r.depthTest=e.depthTest),e.depthWrite!==void 0&&(r.depthWrite=e.depthWrite),e.colorWrite!==void 0&&(r.colorWrite=e.colorWrite),e.blendSrc!==void 0&&(r.blendSrc=e.blendSrc),e.blendDst!==void 0&&(r.blendDst=e.blendDst),e.blendEquation!==void 0&&(r.blendEquation=e.blendEquation),e.blendSrcAlpha!==void 0&&(r.blendSrcAlpha=e.blendSrcAlpha),e.blendDstAlpha!==void 0&&(r.blendDstAlpha=e.blendDstAlpha),e.blendEquationAlpha!==void 0&&(r.blendEquationAlpha=e.blendEquationAlpha),e.blendColor!==void 0&&r.blendColor!==void 0&&r.blendColor.setHex(e.blendColor),e.blendAlpha!==void 0&&(r.blendAlpha=e.blendAlpha),e.stencilWriteMask!==void 0&&(r.stencilWriteMask=e.stencilWriteMask),e.stencilFunc!==void 0&&(r.stencilFunc=e.stencilFunc),e.stencilRef!==void 0&&(r.stencilRef=e.stencilRef),e.stencilFuncMask!==void 0&&(r.stencilFuncMask=e.stencilFuncMask),e.stencilFail!==void 0&&(r.stencilFail=e.stencilFail),e.stencilZFail!==void 0&&(r.stencilZFail=e.stencilZFail),e.stencilZPass!==void 0&&(r.stencilZPass=e.stencilZPass),e.stencilWrite!==void 0&&(r.stencilWrite=e.stencilWrite),e.wireframe!==void 0&&(r.wireframe=e.wireframe),e.wireframeLinewidth!==void 0&&(r.wireframeLinewidth=e.wireframeLinewidth),e.wireframeLinecap!==void 0&&(r.wireframeLinecap=e.wireframeLinecap),e.wireframeLinejoin!==void 0&&(r.wireframeLinejoin=e.wireframeLinejoin),e.rotation!==void 0&&(r.rotation=e.rotation),e.linewidth!==void 0&&(r.linewidth=e.linewidth),e.dashSize!==void 0&&(r.dashSize=e.dashSize),e.gapSize!==void 0&&(r.gapSize=e.gapSize),e.scale!==void 0&&(r.scale=e.scale),e.polygonOffset!==void 0&&(r.polygonOffset=e.polygonOffset),e.polygonOffsetFactor!==void 0&&(r.polygonOffsetFactor=e.polygonOffsetFactor),e.polygonOffsetUnits!==void 0&&(r.polygonOffsetUnits=e.polygonOffsetUnits),e.dithering!==void 0&&(r.dithering=e.dithering),e.alphaToCoverage!==void 0&&(r.alphaToCoverage=e.alphaToCoverage),e.premultipliedAlpha!==void 0&&(r.premultipliedAlpha=e.premultipliedAlpha),e.forceSinglePass!==void 0&&(r.forceSinglePass=e.forceSinglePass),e.visible!==void 0&&(r.visible=e.visible),e.toneMapped!==void 0&&(r.toneMapped=e.toneMapped),e.userData!==void 0&&(r.userData=e.userData),e.vertexColors!==void 0&&(typeof e.vertexColors=="number"?r.vertexColors=e.vertexColors>0:r.vertexColors=e.vertexColors),e.uniforms!==void 0)for(const s in e.uniforms){const a=e.uniforms[s];switch(r.uniforms[s]={},a.type){case"t":r.uniforms[s].value=n(a.value);break;case"c":r.uniforms[s].value=new tt().setHex(a.value);break;case"v2":r.uniforms[s].value=new Le().fromArray(a.value);break;case"v3":r.uniforms[s].value=new X().fromArray(a.value);break;case"v4":r.uniforms[s].value=new _n().fromArray(a.value);break;case"m3":r.uniforms[s].value=new Jt().fromArray(a.value);break;case"m4":r.uniforms[s].value=new Ot().fromArray(a.value);break;default:r.uniforms[s].value=a.value}}if(e.defines!==void 0&&(r.defines=e.defines),e.vertexShader!==void 0&&(r.vertexShader=e.vertexShader),e.fragmentShader!==void 0&&(r.fragmentShader=e.fragmentShader),e.glslVersion!==void 0&&(r.glslVersion=e.glslVersion),e.extensions!==void 0)for(const s in e.extensions)r.extensions[s]=e.extensions[s];if(e.lights!==void 0&&(r.lights=e.lights),e.clipping!==void 0&&(r.clipping=e.clipping),e.size!==void 0&&(r.size=e.size),e.sizeAttenuation!==void 0&&(r.sizeAttenuation=e.sizeAttenuation),e.map!==void 0&&(r.map=n(e.map)),e.matcap!==void 0&&(r.matcap=n(e.matcap)),e.alphaMap!==void 0&&(r.alphaMap=n(e.alphaMap)),e.bumpMap!==void 0&&(r.bumpMap=n(e.bumpMap)),e.bumpScale!==void 0&&(r.bumpScale=e.bumpScale),e.normalMap!==void 0&&(r.normalMap=n(e.normalMap)),e.normalMapType!==void 0&&(r.normalMapType=e.normalMapType),e.normalScale!==void 0){let s=e.normalScale;Array.isArray(s)===!1&&(s=[s,s]),r.normalScale=new Le().fromArray(s)}return e.displacementMap!==void 0&&(r.displacementMap=n(e.displacementMap)),e.displacementScale!==void 0&&(r.displacementScale=e.displacementScale),e.displacementBias!==void 0&&(r.displacementBias=e.displacementBias),e.roughnessMap!==void 0&&(r.roughnessMap=n(e.roughnessMap)),e.metalnessMap!==void 0&&(r.metalnessMap=n(e.metalnessMap)),e.emissiveMap!==void 0&&(r.emissiveMap=n(e.emissiveMap)),e.emissiveIntensity!==void 0&&(r.emissiveIntensity=e.emissiveIntensity),e.specularMap!==void 0&&(r.specularMap=n(e.specularMap)),e.specularIntensityMap!==void 0&&(r.specularIntensityMap=n(e.specularIntensityMap)),e.specularColorMap!==void 0&&(r.specularColorMap=n(e.specularColorMap)),e.envMap!==void 0&&(r.envMap=n(e.envMap)),e.envMapRotation!==void 0&&r.envMapRotation.fromArray(e.envMapRotation),e.envMapIntensity!==void 0&&(r.envMapIntensity=e.envMapIntensity),e.reflectivity!==void 0&&(r.reflectivity=e.reflectivity),e.refractionRatio!==void 0&&(r.refractionRatio=e.refractionRatio),e.lightMap!==void 0&&(r.lightMap=n(e.lightMap)),e.lightMapIntensity!==void 0&&(r.lightMapIntensity=e.lightMapIntensity),e.aoMap!==void 0&&(r.aoMap=n(e.aoMap)),e.aoMapIntensity!==void 0&&(r.aoMapIntensity=e.aoMapIntensity),e.gradientMap!==void 0&&(r.gradientMap=n(e.gradientMap)),e.clearcoatMap!==void 0&&(r.clearcoatMap=n(e.clearcoatMap)),e.clearcoatRoughnessMap!==void 0&&(r.clearcoatRoughnessMap=n(e.clearcoatRoughnessMap)),e.clearcoatNormalMap!==void 0&&(r.clearcoatNormalMap=n(e.clearcoatNormalMap)),e.clearcoatNormalScale!==void 0&&(r.clearcoatNormalScale=new Le().fromArray(e.clearcoatNormalScale)),e.iridescenceMap!==void 0&&(r.iridescenceMap=n(e.iridescenceMap)),e.iridescenceThicknessMap!==void 0&&(r.iridescenceThicknessMap=n(e.iridescenceThicknessMap)),e.transmissionMap!==void 0&&(r.transmissionMap=n(e.transmissionMap)),e.thicknessMap!==void 0&&(r.thicknessMap=n(e.thicknessMap)),e.anisotropyMap!==void 0&&(r.anisotropyMap=n(e.anisotropyMap)),e.sheenColorMap!==void 0&&(r.sheenColorMap=n(e.sheenColorMap)),e.sheenRoughnessMap!==void 0&&(r.sheenRoughnessMap=n(e.sheenRoughnessMap)),r}setTextures(e){return this.textures=e,this}createMaterialFromType(e){return ev.createMaterialFromType(e)}static createMaterialFromType(e){const t={ShadowMaterial:qM,SpriteMaterial:ix,RawShaderMaterial:ZM,ShaderMaterial:no,PointsMaterial:O0,MeshPhysicalMaterial:Ss,MeshStandardMaterial:mp,MeshPhongMaterial:$M,MeshToonMaterial:eE,MeshNormalMaterial:tE,MeshLambertMaterial:nE,MeshDepthMaterial:mx,MeshDistanceMaterial:gx,MeshBasicMaterial:es,MeshMatcapMaterial:iE,LineDashedMaterial:rE,LineBasicMaterial:or,Material:Ei};return new t[e]}}class Sl{static decodeText(e){if(console.warn("THREE.LoaderUtils: decodeText() has been deprecated with r165 and will be removed with r175. Use TextDecoder instead."),typeof TextDecoder<"u")return new TextDecoder().decode(e);let t="";for(let n=0,r=e.length;n<r;n++)t+=String.fromCharCode(e[n]);try{return decodeURIComponent(escape(t))}catch{return t}}static extractUrlBase(e){const t=e.lastIndexOf("/");return t===-1?"./":e.slice(0,t+1)}static resolveURL(e,t){return typeof e!="string"||e===""?"":(/^https?:\/\//i.test(t)&&/^\//.test(e)&&(t=t.replace(/(^https?:\/\/[^\/]+).*/i,"$1")),/^(https?:)?\/\//i.test(e)||/^data:.*,.*$/i.test(e)||/^blob:.*$/i.test(e)?e:t+e)}}class vE extends Kt{constructor(){super(),this.isInstancedBufferGeometry=!0,this.type="InstancedBufferGeometry",this.instanceCount=1/0}copy(e){return super.copy(e),this.instanceCount=e.instanceCount,this}toJSON(){const e=super.toJSON();return e.instanceCount=this.instanceCount,e.isInstancedBufferGeometry=!0,e}}class yE extends ar{constructor(e){super(e)}load(e,t,n,r){const s=this,a=new is(s.manager);a.setPath(s.path),a.setRequestHeader(s.requestHeader),a.setWithCredentials(s.withCredentials),a.load(e,function(u){try{t(s.parse(JSON.parse(u)))}catch(d){r?r(d):console.error(d),s.manager.itemError(e)}},n,r)}parse(e){const t={},n={};function r(_,A){if(t[A]!==void 0)return t[A];const M=_.interleavedBuffers[A],S=s(_,M.buffer),b=Uf(M.type,S),R=new up(b,M.stride);return R.uuid=M.uuid,t[A]=R,R}function s(_,A){if(n[A]!==void 0)return n[A];const M=_.arrayBuffers[A],S=new Uint32Array(M).buffer;return n[A]=S,S}const a=e.isInstancedBufferGeometry?new vE:new Kt,u=e.data.index;if(u!==void 0){const _=Uf(u.type,u.array);a.setIndex(new xn(_,1))}const d=e.data.attributes;for(const _ in d){const A=d[_];let C;if(A.isInterleavedBufferAttribute){const M=r(e.data,A.data);C=new Tl(M,A.itemSize,A.offset,A.normalized)}else{const M=Uf(A.type,A.array),S=A.isInstancedBufferAttribute?Zu:xn;C=new S(M,A.itemSize,A.normalized)}A.name!==void 0&&(C.name=A.name),A.usage!==void 0&&C.setUsage(A.usage),a.setAttribute(_,C)}const h=e.data.morphAttributes;if(h)for(const _ in h){const A=h[_],C=[];for(let M=0,S=A.length;M<S;M++){const b=A[M];let R;if(b.isInterleavedBufferAttribute){const P=r(e.data,b.data);R=new Tl(P,b.itemSize,b.offset,b.normalized)}else{const P=Uf(b.type,b.array);R=new xn(P,b.itemSize,b.normalized)}b.name!==void 0&&(R.name=b.name),C.push(R)}a.morphAttributes[_]=C}e.data.morphTargetsRelative&&(a.morphTargetsRelative=!0);const g=e.data.groups||e.data.drawcalls||e.data.offsets;if(g!==void 0)for(let _=0,A=g.length;_!==A;++_){const C=g[_];a.addGroup(C.start,C.count,C.materialIndex)}const v=e.data.boundingSphere;if(v!==void 0){const _=new X;v.center!==void 0&&_.fromArray(v.center),a.boundingSphere=new ji(_,v.radius)}return e.name&&(a.name=e.name),e.userData&&(a.userData=e.userData),a}}class AR extends ar{constructor(e){super(e)}load(e,t,n,r){const s=this,a=this.path===""?Sl.extractUrlBase(e):this.path;this.resourcePath=this.resourcePath||a;const u=new is(this.manager);u.setPath(this.path),u.setRequestHeader(this.requestHeader),u.setWithCredentials(this.withCredentials),u.load(e,function(d){let h=null;try{h=JSON.parse(d)}catch(g){r!==void 0&&r(g),console.error("THREE:ObjectLoader: Can't parse "+e+".",g.message);return}const m=h.metadata;if(m===void 0||m.type===void 0||m.type.toLowerCase()==="geometry"){r!==void 0&&r(new Error("THREE.ObjectLoader: Can't load "+e)),console.error("THREE.ObjectLoader: Can't load "+e);return}s.parse(h,t)},n,r)}async loadAsync(e,t){const n=this,r=this.path===""?Sl.extractUrlBase(e):this.path;this.resourcePath=this.resourcePath||r;const s=new is(this.manager);s.setPath(this.path),s.setRequestHeader(this.requestHeader),s.setWithCredentials(this.withCredentials);const a=await s.loadAsync(e,t),u=JSON.parse(a),d=u.metadata;if(d===void 0||d.type===void 0||d.type.toLowerCase()==="geometry")throw new Error("THREE.ObjectLoader: Can't load "+e);return await n.parseAsync(u)}parse(e,t){const n=this.parseAnimations(e.animations),r=this.parseShapes(e.shapes),s=this.parseGeometries(e.geometries,r),a=this.parseImages(e.images,function(){t!==void 0&&t(h)}),u=this.parseTextures(e.textures,a),d=this.parseMaterials(e.materials,u),h=this.parseObject(e.object,s,d,u,n),m=this.parseSkeletons(e.skeletons,h);if(this.bindSkeletons(h,m),this.bindLightTargets(h),t!==void 0){let g=!1;for(const v in a)if(a[v].data instanceof HTMLImageElement){g=!0;break}g===!1&&t(h)}return h}async parseAsync(e){const t=this.parseAnimations(e.animations),n=this.parseShapes(e.shapes),r=this.parseGeometries(e.geometries,n),s=await this.parseImagesAsync(e.images),a=this.parseTextures(e.textures,s),u=this.parseMaterials(e.materials,a),d=this.parseObject(e.object,r,u,a,t),h=this.parseSkeletons(e.skeletons,d);return this.bindSkeletons(d,h),this.bindLightTargets(d),d}parseShapes(e){const t={};if(e!==void 0)for(let n=0,r=e.length;n<r;n++){const s=new Ju().fromJSON(e[n]);t[s.uuid]=s}return t}parseSkeletons(e,t){const n={},r={};if(t.traverse(function(s){s.isBone&&(r[s.uuid]=s)}),e!==void 0)for(let s=0,a=e.length;s<a;s++){const u=new cp().fromJSON(e[s],r);n[u.uuid]=u}return n}parseGeometries(e,t){const n={};if(e!==void 0){const r=new yE;for(let s=0,a=e.length;s<a;s++){let u;const d=e[s];switch(d.type){case"BufferGeometry":case"InstancedBufferGeometry":u=r.parse(d);break;default:d.type in PA?u=PA[d.type].fromJSON(d,t):console.warn(`THREE.ObjectLoader: Unsupported geometry type "${d.type}"`)}u.uuid=d.uuid,d.name!==void 0&&(u.name=d.name),d.userData!==void 0&&(u.userData=d.userData),n[d.uuid]=u}}return n}parseMaterials(e,t){const n={},r={};if(e!==void 0){const s=new ev;s.setTextures(t);for(let a=0,u=e.length;a<u;a++){const d=e[a];n[d.uuid]===void 0&&(n[d.uuid]=s.parse(d)),r[d.uuid]=n[d.uuid]}}return r}parseAnimations(e){const t={};if(e!==void 0)for(let n=0;n<e.length;n++){const r=e[n],s=Zf.parse(r);t[s.uuid]=s}return t}parseImages(e,t){const n=this,r={};let s;function a(d){return n.manager.itemStart(d),s.load(d,function(){n.manager.itemEnd(d)},void 0,function(){n.manager.itemError(d),n.manager.itemEnd(d)})}function u(d){if(typeof d=="string"){const h=d,m=/^(\/\/)|([a-z]+:(\/\/)?)/i.test(h)?h:n.resourcePath+h;return a(m)}else return d.data?{data:Uf(d.type,d.data),width:d.width,height:d.height}:null}if(e!==void 0&&e.length>0){const d=new xx(t);s=new Yh(d),s.setCrossOrigin(this.crossOrigin);for(let h=0,m=e.length;h<m;h++){const g=e[h],v=g.url;if(Array.isArray(v)){const _=[];for(let A=0,C=v.length;A<C;A++){const M=v[A],S=u(M);S!==null&&(S instanceof HTMLImageElement?_.push(S):_.push(new Eo(S.data,S.width,S.height)))}r[g.uuid]=new ku(_)}else{const _=u(g.url);r[g.uuid]=new ku(_)}}}return r}async parseImagesAsync(e){const t=this,n={};let r;async function s(a){if(typeof a=="string"){const u=a,d=/^(\/\/)|([a-z]+:(\/\/)?)/i.test(u)?u:t.resourcePath+u;return await r.loadAsync(d)}else return a.data?{data:Uf(a.type,a.data),width:a.width,height:a.height}:null}if(e!==void 0&&e.length>0){r=new Yh(this.manager),r.setCrossOrigin(this.crossOrigin);for(let a=0,u=e.length;a<u;a++){const d=e[a],h=d.url;if(Array.isArray(h)){const m=[];for(let g=0,v=h.length;g<v;g++){const _=h[g],A=await s(_);A!==null&&(A instanceof HTMLImageElement?m.push(A):m.push(new Eo(A.data,A.width,A.height)))}n[d.uuid]=new ku(m)}else{const m=await s(d.url);n[d.uuid]=new ku(m)}}}return n}parseTextures(e,t){function n(s,a){return typeof s=="number"?s:(console.warn("THREE.ObjectLoader.parseTexture: Constant should be in numeric form.",s),a[s])}const r={};if(e!==void 0)for(let s=0,a=e.length;s<a;s++){const u=e[s];u.image===void 0&&console.warn('THREE.ObjectLoader: No "image" specified for',u.uuid),t[u.image]===void 0&&console.warn("THREE.ObjectLoader: Undefined image",u.image);const d=t[u.image],h=d.data;let m;Array.isArray(h)?(m=new lp,h.length===6&&(m.needsUpdate=!0)):(h&&h.data?m=new Eo:m=new zn,h&&(m.needsUpdate=!0)),m.source=d,m.uuid=u.uuid,u.name!==void 0&&(m.name=u.name),u.mapping!==void 0&&(m.mapping=n(u.mapping,SR)),u.channel!==void 0&&(m.channel=u.channel),u.offset!==void 0&&m.offset.fromArray(u.offset),u.repeat!==void 0&&m.repeat.fromArray(u.repeat),u.center!==void 0&&m.center.fromArray(u.center),u.rotation!==void 0&&(m.rotation=u.rotation),u.wrap!==void 0&&(m.wrapS=n(u.wrap[0],FA),m.wrapT=n(u.wrap[1],FA)),u.format!==void 0&&(m.format=u.format),u.internalFormat!==void 0&&(m.internalFormat=u.internalFormat),u.type!==void 0&&(m.type=u.type),u.colorSpace!==void 0&&(m.colorSpace=u.colorSpace),u.minFilter!==void 0&&(m.minFilter=n(u.minFilter,NA)),u.magFilter!==void 0&&(m.magFilter=n(u.magFilter,NA)),u.anisotropy!==void 0&&(m.anisotropy=u.anisotropy),u.flipY!==void 0&&(m.flipY=u.flipY),u.generateMipmaps!==void 0&&(m.generateMipmaps=u.generateMipmaps),u.premultiplyAlpha!==void 0&&(m.premultiplyAlpha=u.premultiplyAlpha),u.unpackAlignment!==void 0&&(m.unpackAlignment=u.unpackAlignment),u.compareFunction!==void 0&&(m.compareFunction=u.compareFunction),u.userData!==void 0&&(m.userData=u.userData),r[u.uuid]=m}return r}parseObject(e,t,n,r,s){let a;function u(v){return t[v]===void 0&&console.warn("THREE.ObjectLoader: Undefined geometry",v),t[v]}function d(v){if(v!==void 0){if(Array.isArray(v)){const _=[];for(let A=0,C=v.length;A<C;A++){const M=v[A];n[M]===void 0&&console.warn("THREE.ObjectLoader: Undefined material",M),_.push(n[M])}return _}return n[v]===void 0&&console.warn("THREE.ObjectLoader: Undefined material",v),n[v]}}function h(v){return r[v]===void 0&&console.warn("THREE.ObjectLoader: Undefined texture",v),r[v]}let m,g;switch(e.type){case"Scene":a=new nx,e.background!==void 0&&(Number.isInteger(e.background)?a.background=new tt(e.background):a.background=h(e.background)),e.environment!==void 0&&(a.environment=h(e.environment)),e.fog!==void 0&&(e.fog.type==="Fog"?a.fog=new N0(e.fog.color,e.fog.near,e.fog.far):e.fog.type==="FogExp2"&&(a.fog=new F0(e.fog.color,e.fog.density)),e.fog.name!==""&&(a.fog.name=e.fog.name)),e.backgroundBlurriness!==void 0&&(a.backgroundBlurriness=e.backgroundBlurriness),e.backgroundIntensity!==void 0&&(a.backgroundIntensity=e.backgroundIntensity),e.backgroundRotation!==void 0&&a.backgroundRotation.fromArray(e.backgroundRotation),e.environmentIntensity!==void 0&&(a.environmentIntensity=e.environmentIntensity),e.environmentRotation!==void 0&&a.environmentRotation.fromArray(e.environmentRotation);break;case"PerspectiveCamera":a=new Hn(e.fov,e.aspect,e.near,e.far),e.focus!==void 0&&(a.focus=e.focus),e.zoom!==void 0&&(a.zoom=e.zoom),e.filmGauge!==void 0&&(a.filmGauge=e.filmGauge),e.filmOffset!==void 0&&(a.filmOffset=e.filmOffset),e.view!==void 0&&(a.view=Object.assign({},e.view));break;case"OrthographicCamera":a=new eo(e.left,e.right,e.top,e.bottom,e.near,e.far),e.zoom!==void 0&&(a.zoom=e.zoom),e.view!==void 0&&(a.view=Object.assign({},e.view));break;case"AmbientLight":a=new hE(e.color,e.intensity);break;case"DirectionalLight":a=new Ex(e.color,e.intensity),a.target=e.target||"";break;case"PointLight":a=new Mx(e.color,e.intensity,e.distance,e.decay);break;case"RectAreaLight":a=new pE(e.color,e.intensity,e.width,e.height);break;case"SpotLight":a=new Sx(e.color,e.intensity,e.distance,e.angle,e.penumbra,e.decay),a.target=e.target||"";break;case"HemisphereLight":a=new dE(e.color,e.groundColor,e.intensity);break;case"LightProbe":a=new gE().fromJSON(e);break;case"SkinnedMesh":m=u(e.geometry),g=d(e.material),a=new rx(m,g),e.bindMode!==void 0&&(a.bindMode=e.bindMode),e.bindMatrix!==void 0&&a.bindMatrix.fromArray(e.bindMatrix),e.skeleton!==void 0&&(a.skeleton=e.skeleton);break;case"Mesh":m=u(e.geometry),g=d(e.material),a=new si(m,g);break;case"InstancedMesh":m=u(e.geometry),g=d(e.material);const v=e.count,_=e.instanceMatrix,A=e.instanceColor;a=new sx(m,g,v),a.instanceMatrix=new Zu(new Float32Array(_.array),16),A!==void 0&&(a.instanceColor=new Zu(new Float32Array(A.array),A.itemSize));break;case"BatchedMesh":m=u(e.geometry),g=d(e.material),a=new kM(e.maxInstanceCount,e.maxVertexCount,e.maxIndexCount,g),a.geometry=m,a.perObjectFrustumCulled=e.perObjectFrustumCulled,a.sortObjects=e.sortObjects,a._drawRanges=e.drawRanges,a._reservedRanges=e.reservedRanges,a._visibility=e.visibility,a._active=e.active,a._bounds=e.bounds.map(C=>{const M=new sr;M.min.fromArray(C.boxMin),M.max.fromArray(C.boxMax);const S=new ji;return S.radius=C.sphereRadius,S.center.fromArray(C.sphereCenter),{boxInitialized:C.boxInitialized,box:M,sphereInitialized:C.sphereInitialized,sphere:S}}),a._maxInstanceCount=e.maxInstanceCount,a._maxVertexCount=e.maxVertexCount,a._maxIndexCount=e.maxIndexCount,a._geometryInitialized=e.geometryInitialized,a._geometryCount=e.geometryCount,a._matricesTexture=h(e.matricesTexture.uuid),e.colorsTexture!==void 0&&(a._colorsTexture=h(e.colorsTexture.uuid));break;case"LOD":a=new OM;break;case"Line":a=new Ra(u(e.geometry),d(e.material));break;case"LineLoop":a=new ox(u(e.geometry),d(e.material));break;case"LineSegments":a=new io(u(e.geometry),d(e.material));break;case"PointCloud":case"Points":a=new ax(u(e.geometry),d(e.material));break;case"Sprite":a=new UM(d(e.material));break;case"Group":a=new xa;break;case"Bone":a=new U0;break;default:a=new fn}if(a.uuid=e.uuid,e.name!==void 0&&(a.name=e.name),e.matrix!==void 0?(a.matrix.fromArray(e.matrix),e.matrixAutoUpdate!==void 0&&(a.matrixAutoUpdate=e.matrixAutoUpdate),a.matrixAutoUpdate&&a.matrix.decompose(a.position,a.quaternion,a.scale)):(e.position!==void 0&&a.position.fromArray(e.position),e.rotation!==void 0&&a.rotation.fromArray(e.rotation),e.quaternion!==void 0&&a.quaternion.fromArray(e.quaternion),e.scale!==void 0&&a.scale.fromArray(e.scale)),e.up!==void 0&&a.up.fromArray(e.up),e.castShadow!==void 0&&(a.castShadow=e.castShadow),e.receiveShadow!==void 0&&(a.receiveShadow=e.receiveShadow),e.shadow&&(e.shadow.intensity!==void 0&&(a.shadow.intensity=e.shadow.intensity),e.shadow.bias!==void 0&&(a.shadow.bias=e.shadow.bias),e.shadow.normalBias!==void 0&&(a.shadow.normalBias=e.shadow.normalBias),e.shadow.radius!==void 0&&(a.shadow.radius=e.shadow.radius),e.shadow.mapSize!==void 0&&a.shadow.mapSize.fromArray(e.shadow.mapSize),e.shadow.camera!==void 0&&(a.shadow.camera=this.parseObject(e.shadow.camera))),e.visible!==void 0&&(a.visible=e.visible),e.frustumCulled!==void 0&&(a.frustumCulled=e.frustumCulled),e.renderOrder!==void 0&&(a.renderOrder=e.renderOrder),e.userData!==void 0&&(a.userData=e.userData),e.layers!==void 0&&(a.layers.mask=e.layers),e.children!==void 0){const v=e.children;for(let _=0;_<v.length;_++)a.add(this.parseObject(v[_],t,n,r,s))}if(e.animations!==void 0){const v=e.animations;for(let _=0;_<v.length;_++){const A=v[_];a.animations.push(s[A])}}if(e.type==="LOD"){e.autoUpdate!==void 0&&(a.autoUpdate=e.autoUpdate);const v=e.levels;for(let _=0;_<v.length;_++){const A=v[_],C=a.getObjectByProperty("uuid",A.object);C!==void 0&&a.addLevel(C,A.distance,A.hysteresis)}}return a}bindSkeletons(e,t){Object.keys(t).length!==0&&e.traverse(function(n){if(n.isSkinnedMesh===!0&&n.skeleton!==void 0){const r=t[n.skeleton];r===void 0?console.warn("THREE.ObjectLoader: No skeleton found with UUID:",n.skeleton):n.bind(r,n.bindMatrix)}})}bindLightTargets(e){e.traverse(function(t){if(t.isDirectionalLight||t.isSpotLight){const n=t.target,r=e.getObjectByProperty("uuid",n);r!==void 0?t.target=r:t.target=new fn}})}}const SR={UVMapping:E0,CubeReflectionMapping:Ta,CubeRefractionMapping:wl,EquirectangularReflectionMapping:Oh,EquirectangularRefractionMapping:kh,CubeUVReflectionMapping:rd},FA={RepeatWrapping:Cl,ClampToEdgeWrapping:$r,MirroredRepeatWrapping:jf},NA={NearestFilter:Di,NearestMipmapNearestFilter:w0,NearestMipmapLinearFilter:Nu,LinearFilter:ri,LinearMipmapNearestFilter:Gf,LinearMipmapLinearFilter:As};class _E extends ar{constructor(e){super(e),this.isImageBitmapLoader=!0,typeof createImageBitmap>"u"&&console.warn("THREE.ImageBitmapLoader: createImageBitmap() not supported."),typeof fetch>"u"&&console.warn("THREE.ImageBitmapLoader: fetch() not supported."),this.options={premultiplyAlpha:"none"}}setOptions(e){return this.options=e,this}load(e,t,n,r){e===void 0&&(e=""),this.path!==void 0&&(e=this.path+e),e=this.manager.resolveURL(e);const s=this,a=Aa.get(e);if(a!==void 0){if(s.manager.itemStart(e),a.then){a.then(h=>{t&&t(h),s.manager.itemEnd(e)}).catch(h=>{r&&r(h)});return}return setTimeout(function(){t&&t(a),s.manager.itemEnd(e)},0),a}const u={};u.credentials=this.crossOrigin==="anonymous"?"same-origin":"include",u.headers=this.requestHeader;const d=fetch(e,u).then(function(h){return h.blob()}).then(function(h){return createImageBitmap(h,Object.assign(s.options,{colorSpaceConversion:"none"}))}).then(function(h){return Aa.add(e,h),t&&t(h),s.manager.itemEnd(e),h}).catch(function(h){r&&r(h),Aa.remove(e),s.manager.itemError(e),s.manager.itemEnd(e)});Aa.add(e,d),s.manager.itemStart(e)}}let Zm;class wx{static getContext(){return Zm===void 0&&(Zm=new(window.AudioContext||window.webkitAudioContext)),Zm}static setContext(e){Zm=e}}class MR extends ar{constructor(e){super(e)}load(e,t,n,r){const s=this,a=new is(this.manager);a.setResponseType("arraybuffer"),a.setPath(this.path),a.setRequestHeader(this.requestHeader),a.setWithCredentials(this.withCredentials),a.load(e,function(d){try{const h=d.slice(0);wx.getContext().decodeAudioData(h,function(g){t(g)}).catch(u)}catch(h){u(h)}},n,r);function u(d){r?r(d):console.error(d),s.manager.itemError(e)}}}const UA=new Ot,OA=new Ot,Su=new Ot;class ER{constructor(){this.type="StereoCamera",this.aspect=1,this.eyeSep=.064,this.cameraL=new Hn,this.cameraL.layers.enable(1),this.cameraL.matrixAutoUpdate=!1,this.cameraR=new Hn,this.cameraR.layers.enable(2),this.cameraR.matrixAutoUpdate=!1,this._cache={focus:null,fov:null,aspect:null,near:null,far:null,zoom:null,eyeSep:null}}update(e){const t=this._cache;if(t.focus!==e.focus||t.fov!==e.fov||t.aspect!==e.aspect*this.aspect||t.near!==e.near||t.far!==e.far||t.zoom!==e.zoom||t.eyeSep!==this.eyeSep){t.focus=e.focus,t.fov=e.fov,t.aspect=e.aspect*this.aspect,t.near=e.near,t.far=e.far,t.zoom=e.zoom,t.eyeSep=this.eyeSep,Su.copy(e.projectionMatrix);const r=t.eyeSep/2,s=r*t.near/t.focus,a=t.near*Math.tan(Xu*t.fov*.5)/t.zoom;let u,d;OA.elements[12]=-r,UA.elements[12]=r,u=-a*t.aspect+s,d=a*t.aspect+s,Su.elements[0]=2*t.near/(d-u),Su.elements[8]=(d+u)/(d-u),this.cameraL.projectionMatrix.copy(Su),u=-a*t.aspect-s,d=a*t.aspect-s,Su.elements[0]=2*t.near/(d-u),Su.elements[8]=(d+u)/(d-u),this.cameraR.projectionMatrix.copy(Su)}this.cameraL.matrixWorld.copy(e.matrixWorld).multiply(OA),this.cameraR.matrixWorld.copy(e.matrixWorld).multiply(UA)}}class xE extends Hn{constructor(e=[]){super(),this.isArrayCamera=!0,this.cameras=e,this.index=0}}class Cx{constructor(e=!0){this.autoStart=e,this.startTime=0,this.oldTime=0,this.elapsedTime=0,this.running=!1}start(){this.startTime=kA(),this.oldTime=this.startTime,this.elapsedTime=0,this.running=!0}stop(){this.getElapsedTime(),this.running=!1,this.autoStart=!1}getElapsedTime(){return this.getDelta(),this.elapsedTime}getDelta(){let e=0;if(this.autoStart&&!this.running)return this.start(),0;if(this.running){const t=kA();e=(t-this.oldTime)/1e3,this.oldTime=t,this.elapsedTime+=e}return e}}function kA(){return performance.now()}const Mu=new X,HA=new Fi,wR=new X,Eu=new X;class CR extends fn{constructor(){super(),this.type="AudioListener",this.context=wx.getContext(),this.gain=this.context.createGain(),this.gain.connect(this.context.destination),this.filter=null,this.timeDelta=0,this._clock=new Cx}getInput(){return this.gain}removeFilter(){return this.filter!==null&&(this.gain.disconnect(this.filter),this.filter.disconnect(this.context.destination),this.gain.connect(this.context.destination),this.filter=null),this}getFilter(){return this.filter}setFilter(e){return this.filter!==null?(this.gain.disconnect(this.filter),this.filter.disconnect(this.context.destination)):this.gain.disconnect(this.context.destination),this.filter=e,this.gain.connect(this.filter),this.filter.connect(this.context.destination),this}getMasterVolume(){return this.gain.gain.value}setMasterVolume(e){return this.gain.gain.setTargetAtTime(e,this.context.currentTime,.01),this}updateMatrixWorld(e){super.updateMatrixWorld(e);const t=this.context.listener,n=this.up;if(this.timeDelta=this._clock.getDelta(),this.matrixWorld.decompose(Mu,HA,wR),Eu.set(0,0,-1).applyQuaternion(HA),t.positionX){const r=this.context.currentTime+this.timeDelta;t.positionX.linearRampToValueAtTime(Mu.x,r),t.positionY.linearRampToValueAtTime(Mu.y,r),t.positionZ.linearRampToValueAtTime(Mu.z,r),t.forwardX.linearRampToValueAtTime(Eu.x,r),t.forwardY.linearRampToValueAtTime(Eu.y,r),t.forwardZ.linearRampToValueAtTime(Eu.z,r),t.upX.linearRampToValueAtTime(n.x,r),t.upY.linearRampToValueAtTime(n.y,r),t.upZ.linearRampToValueAtTime(n.z,r)}else t.setPosition(Mu.x,Mu.y,Mu.z),t.setOrientation(Eu.x,Eu.y,Eu.z,n.x,n.y,n.z)}}let AE=class extends fn{constructor(e){super(),this.type="Audio",this.listener=e,this.context=e.context,this.gain=this.context.createGain(),this.gain.connect(e.getInput()),this.autoplay=!1,this.buffer=null,this.detune=0,this.loop=!1,this.loopStart=0,this.loopEnd=0,this.offset=0,this.duration=void 0,this.playbackRate=1,this.isPlaying=!1,this.hasPlaybackControl=!0,this.source=null,this.sourceType="empty",this._startedAt=0,this._progress=0,this._connected=!1,this.filters=[]}getOutput(){return this.gain}setNodeSource(e){return this.hasPlaybackControl=!1,this.sourceType="audioNode",this.source=e,this.connect(),this}setMediaElementSource(e){return this.hasPlaybackControl=!1,this.sourceType="mediaNode",this.source=this.context.createMediaElementSource(e),this.connect(),this}setMediaStreamSource(e){return this.hasPlaybackControl=!1,this.sourceType="mediaStreamNode",this.source=this.context.createMediaStreamSource(e),this.connect(),this}setBuffer(e){return this.buffer=e,this.sourceType="buffer",this.autoplay&&this.play(),this}play(e=0){if(this.isPlaying===!0){console.warn("THREE.Audio: Audio is already playing.");return}if(this.hasPlaybackControl===!1){console.warn("THREE.Audio: this Audio has no playback control.");return}this._startedAt=this.context.currentTime+e;const t=this.context.createBufferSource();return t.buffer=this.buffer,t.loop=this.loop,t.loopStart=this.loopStart,t.loopEnd=this.loopEnd,t.onended=this.onEnded.bind(this),t.start(this._startedAt,this._progress+this.offset,this.duration),this.isPlaying=!0,this.source=t,this.setDetune(this.detune),this.setPlaybackRate(this.playbackRate),this.connect()}pause(){if(this.hasPlaybackControl===!1){console.warn("THREE.Audio: this Audio has no playback control.");return}return this.isPlaying===!0&&(this._progress+=Math.max(this.context.currentTime-this._startedAt,0)*this.playbackRate,this.loop===!0&&(this._progress=this._progress%(this.duration||this.buffer.duration)),this.source.stop(),this.source.onended=null,this.isPlaying=!1),this}stop(e=0){if(this.hasPlaybackControl===!1){console.warn("THREE.Audio: this Audio has no playback control.");return}return this._progress=0,this.source!==null&&(this.source.stop(this.context.currentTime+e),this.source.onended=null),this.isPlaying=!1,this}connect(){if(this.filters.length>0){this.source.connect(this.filters[0]);for(let e=1,t=this.filters.length;e<t;e++)this.filters[e-1].connect(this.filters[e]);this.filters[this.filters.length-1].connect(this.getOutput())}else this.source.connect(this.getOutput());return this._connected=!0,this}disconnect(){if(this._connected!==!1){if(this.filters.length>0){this.source.disconnect(this.filters[0]);for(let e=1,t=this.filters.length;e<t;e++)this.filters[e-1].disconnect(this.filters[e]);this.filters[this.filters.length-1].disconnect(this.getOutput())}else this.source.disconnect(this.getOutput());return this._connected=!1,this}}getFilters(){return this.filters}setFilters(e){return e||(e=[]),this._connected===!0?(this.disconnect(),this.filters=e.slice(),this.connect()):this.filters=e.slice(),this}setDetune(e){return this.detune=e,this.isPlaying===!0&&this.source.detune!==void 0&&this.source.detune.setTargetAtTime(this.detune,this.context.currentTime,.01),this}getDetune(){return this.detune}getFilter(){return this.getFilters()[0]}setFilter(e){return this.setFilters(e?[e]:[])}setPlaybackRate(e){if(this.hasPlaybackControl===!1){console.warn("THREE.Audio: this Audio has no playback control.");return}return this.playbackRate=e,this.isPlaying===!0&&this.source.playbackRate.setTargetAtTime(this.playbackRate,this.context.currentTime,.01),this}getPlaybackRate(){return this.playbackRate}onEnded(){this.isPlaying=!1,this._progress=0}getLoop(){return this.hasPlaybackControl===!1?(console.warn("THREE.Audio: this Audio has no playback control."),!1):this.loop}setLoop(e){if(this.hasPlaybackControl===!1){console.warn("THREE.Audio: this Audio has no playback control.");return}return this.loop=e,this.isPlaying===!0&&(this.source.loop=this.loop),this}setLoopStart(e){return this.loopStart=e,this}setLoopEnd(e){return this.loopEnd=e,this}getVolume(){return this.gain.gain.value}setVolume(e){return this.gain.gain.setTargetAtTime(e,this.context.currentTime,.01),this}copy(e,t){return super.copy(e,t),e.sourceType!=="buffer"?(console.warn("THREE.Audio: Audio source type cannot be copied."),this):(this.autoplay=e.autoplay,this.buffer=e.buffer,this.detune=e.detune,this.loop=e.loop,this.loopStart=e.loopStart,this.loopEnd=e.loopEnd,this.offset=e.offset,this.duration=e.duration,this.playbackRate=e.playbackRate,this.hasPlaybackControl=e.hasPlaybackControl,this.sourceType=e.sourceType,this.filters=e.filters.slice(),this)}clone(e){return new this.constructor(this.listener).copy(this,e)}};const wu=new X,zA=new Fi,TR=new X,Cu=new X;class bR extends AE{constructor(e){super(e),this.panner=this.context.createPanner(),this.panner.panningModel="HRTF",this.panner.connect(this.gain)}connect(){super.connect(),this.panner.connect(this.gain)}disconnect(){super.disconnect(),this.panner.disconnect(this.gain)}getOutput(){return this.panner}getRefDistance(){return this.panner.refDistance}setRefDistance(e){return this.panner.refDistance=e,this}getRolloffFactor(){return this.panner.rolloffFactor}setRolloffFactor(e){return this.panner.rolloffFactor=e,this}getDistanceModel(){return this.panner.distanceModel}setDistanceModel(e){return this.panner.distanceModel=e,this}getMaxDistance(){return this.panner.maxDistance}setMaxDistance(e){return this.panner.maxDistance=e,this}setDirectionalCone(e,t,n){return this.panner.coneInnerAngle=e,this.panner.coneOuterAngle=t,this.panner.coneOuterGain=n,this}updateMatrixWorld(e){if(super.updateMatrixWorld(e),this.hasPlaybackControl===!0&&this.isPlaying===!1)return;this.matrixWorld.decompose(wu,zA,TR),Cu.set(0,0,1).applyQuaternion(zA);const t=this.panner;if(t.positionX){const n=this.context.currentTime+this.listener.timeDelta;t.positionX.linearRampToValueAtTime(wu.x,n),t.positionY.linearRampToValueAtTime(wu.y,n),t.positionZ.linearRampToValueAtTime(wu.z,n),t.orientationX.linearRampToValueAtTime(Cu.x,n),t.orientationY.linearRampToValueAtTime(Cu.y,n),t.orientationZ.linearRampToValueAtTime(Cu.z,n)}else t.setPosition(wu.x,wu.y,wu.z),t.setOrientation(Cu.x,Cu.y,Cu.z)}}class RR{constructor(e,t=2048){this.analyser=e.context.createAnalyser(),this.analyser.fftSize=t,this.data=new Uint8Array(this.analyser.frequencyBinCount),e.getOutput().connect(this.analyser)}getFrequencyData(){return this.analyser.getByteFrequencyData(this.data),this.data}getAverageFrequency(){let e=0;const t=this.getFrequencyData();for(let n=0;n<t.length;n++)e+=t[n];return e/t.length}}class SE{constructor(e,t,n){this.binding=e,this.valueSize=n;let r,s,a;switch(t){case"quaternion":r=this._slerp,s=this._slerpAdditive,a=this._setAdditiveIdentityQuaternion,this.buffer=new Float64Array(n*6),this._workIndex=5;break;case"string":case"bool":r=this._select,s=this._select,a=this._setAdditiveIdentityOther,this.buffer=new Array(n*5);break;default:r=this._lerp,s=this._lerpAdditive,a=this._setAdditiveIdentityNumeric,this.buffer=new Float64Array(n*5)}this._mixBufferRegion=r,this._mixBufferRegionAdditive=s,this._setIdentity=a,this._origIndex=3,this._addIndex=4,this.cumulativeWeight=0,this.cumulativeWeightAdditive=0,this.useCount=0,this.referenceCount=0}accumulate(e,t){const n=this.buffer,r=this.valueSize,s=e*r+r;let a=this.cumulativeWeight;if(a===0){for(let u=0;u!==r;++u)n[s+u]=n[u];a=t}else{a+=t;const u=t/a;this._mixBufferRegion(n,s,0,u,r)}this.cumulativeWeight=a}accumulateAdditive(e){const t=this.buffer,n=this.valueSize,r=n*this._addIndex;this.cumulativeWeightAdditive===0&&this._setIdentity(),this._mixBufferRegionAdditive(t,r,0,e,n),this.cumulativeWeightAdditive+=e}apply(e){const t=this.valueSize,n=this.buffer,r=e*t+t,s=this.cumulativeWeight,a=this.cumulativeWeightAdditive,u=this.binding;if(this.cumulativeWeight=0,this.cumulativeWeightAdditive=0,s<1){const d=t*this._origIndex;this._mixBufferRegion(n,r,d,1-s,t)}a>0&&this._mixBufferRegionAdditive(n,r,this._addIndex*t,1,t);for(let d=t,h=t+t;d!==h;++d)if(n[d]!==n[d+t]){u.setValue(n,r);break}}saveOriginalState(){const e=this.binding,t=this.buffer,n=this.valueSize,r=n*this._origIndex;e.getValue(t,r);for(let s=n,a=r;s!==a;++s)t[s]=t[r+s%n];this._setIdentity(),this.cumulativeWeight=0,this.cumulativeWeightAdditive=0}restoreOriginalState(){const e=this.valueSize*3;this.binding.setValue(this.buffer,e)}_setAdditiveIdentityNumeric(){const e=this._addIndex*this.valueSize,t=e+this.valueSize;for(let n=e;n<t;n++)this.buffer[n]=0}_setAdditiveIdentityQuaternion(){this._setAdditiveIdentityNumeric(),this.buffer[this._addIndex*this.valueSize+3]=1}_setAdditiveIdentityOther(){const e=this._origIndex*this.valueSize,t=this._addIndex*this.valueSize;for(let n=0;n<this.valueSize;n++)this.buffer[t+n]=this.buffer[e+n]}_select(e,t,n,r,s){if(r>=.5)for(let a=0;a!==s;++a)e[t+a]=e[n+a]}_slerp(e,t,n,r){Fi.slerpFlat(e,t,e,t,e,n,r)}_slerpAdditive(e,t,n,r,s){const a=this._workIndex*s;Fi.multiplyQuaternionsFlat(e,a,e,t,e,n),Fi.slerpFlat(e,t,e,t,e,a,r)}_lerp(e,t,n,r,s){const a=1-r;for(let u=0;u!==s;++u){const d=t+u;e[d]=e[d]*a+e[n+u]*r}}_lerpAdditive(e,t,n,r,s){for(let a=0;a!==s;++a){const u=t+a;e[u]=e[u]+e[n+a]*r}}}const Tx="\\[\\]\\.:\\/",IR=new RegExp("["+Tx+"]","g"),bx="[^"+Tx+"]",PR="[^"+Tx.replace("\\.","")+"]",BR=/((?:WC+[\/:])*)/.source.replace("WC",bx),LR=/(WCOD+)?/.source.replace("WCOD",PR),DR=/(?:\.(WC+)(?:\[(.+)\])?)?/.source.replace("WC",bx),FR=/\.(WC+)(?:\[(.+)\])?/.source.replace("WC",bx),NR=new RegExp("^"+BR+LR+DR+FR+"$"),UR=["material","materials","bones","map"];class OR{constructor(e,t,n){const r=n||mn.parseTrackName(t);this._targetGroup=e,this._bindings=e.subscribe_(t,r)}getValue(e,t){this.bind();const n=this._targetGroup.nCachedObjects_,r=this._bindings[n];r!==void 0&&r.getValue(e,t)}setValue(e,t){const n=this._bindings;for(let r=this._targetGroup.nCachedObjects_,s=n.length;r!==s;++r)n[r].setValue(e,t)}bind(){const e=this._bindings;for(let t=this._targetGroup.nCachedObjects_,n=e.length;t!==n;++t)e[t].bind()}unbind(){const e=this._bindings;for(let t=this._targetGroup.nCachedObjects_,n=e.length;t!==n;++t)e[t].unbind()}}class mn{constructor(e,t,n){this.path=t,this.parsedPath=n||mn.parseTrackName(t),this.node=mn.findNode(e,this.parsedPath.nodeName),this.rootNode=e,this.getValue=this._getValue_unbound,this.setValue=this._setValue_unbound}static create(e,t,n){return e&&e.isAnimationObjectGroup?new mn.Composite(e,t,n):new mn(e,t,n)}static sanitizeNodeName(e){return e.replace(/\s/g,"_").replace(IR,"")}static parseTrackName(e){const t=NR.exec(e);if(t===null)throw new Error("PropertyBinding: Cannot parse trackName: "+e);const n={nodeName:t[2],objectName:t[3],objectIndex:t[4],propertyName:t[5],propertyIndex:t[6]},r=n.nodeName&&n.nodeName.lastIndexOf(".");if(r!==void 0&&r!==-1){const s=n.nodeName.substring(r+1);UR.indexOf(s)!==-1&&(n.nodeName=n.nodeName.substring(0,r),n.objectName=s)}if(n.propertyName===null||n.propertyName.length===0)throw new Error("PropertyBinding: can not parse propertyName from trackName: "+e);return n}static findNode(e,t){if(t===void 0||t===""||t==="."||t===-1||t===e.name||t===e.uuid)return e;if(e.skeleton){const n=e.skeleton.getBoneByName(t);if(n!==void 0)return n}if(e.children){const n=function(s){for(let a=0;a<s.length;a++){const u=s[a];if(u.name===t||u.uuid===t)return u;const d=n(u.children);if(d)return d}return null},r=n(e.children);if(r)return r}return null}_getValue_unavailable(){}_setValue_unavailable(){}_getValue_direct(e,t){e[t]=this.targetObject[this.propertyName]}_getValue_array(e,t){const n=this.resolvedProperty;for(let r=0,s=n.length;r!==s;++r)e[t++]=n[r]}_getValue_arrayElement(e,t){e[t]=this.resolvedProperty[this.propertyIndex]}_getValue_toArray(e,t){this.resolvedProperty.toArray(e,t)}_setValue_direct(e,t){this.targetObject[this.propertyName]=e[t]}_setValue_direct_setNeedsUpdate(e,t){this.targetObject[this.propertyName]=e[t],this.targetObject.needsUpdate=!0}_setValue_direct_setMatrixWorldNeedsUpdate(e,t){this.targetObject[this.propertyName]=e[t],this.targetObject.matrixWorldNeedsUpdate=!0}_setValue_array(e,t){const n=this.resolvedProperty;for(let r=0,s=n.length;r!==s;++r)n[r]=e[t++]}_setValue_array_setNeedsUpdate(e,t){const n=this.resolvedProperty;for(let r=0,s=n.length;r!==s;++r)n[r]=e[t++];this.targetObject.needsUpdate=!0}_setValue_array_setMatrixWorldNeedsUpdate(e,t){const n=this.resolvedProperty;for(let r=0,s=n.length;r!==s;++r)n[r]=e[t++];this.targetObject.matrixWorldNeedsUpdate=!0}_setValue_arrayElement(e,t){this.resolvedProperty[this.propertyIndex]=e[t]}_setValue_arrayElement_setNeedsUpdate(e,t){this.resolvedProperty[this.propertyIndex]=e[t],this.targetObject.needsUpdate=!0}_setValue_arrayElement_setMatrixWorldNeedsUpdate(e,t){this.resolvedProperty[this.propertyIndex]=e[t],this.targetObject.matrixWorldNeedsUpdate=!0}_setValue_fromArray(e,t){this.resolvedProperty.fromArray(e,t)}_setValue_fromArray_setNeedsUpdate(e,t){this.resolvedProperty.fromArray(e,t),this.targetObject.needsUpdate=!0}_setValue_fromArray_setMatrixWorldNeedsUpdate(e,t){this.resolvedProperty.fromArray(e,t),this.targetObject.matrixWorldNeedsUpdate=!0}_getValue_unbound(e,t){this.bind(),this.getValue(e,t)}_setValue_unbound(e,t){this.bind(),this.setValue(e,t)}bind(){let e=this.node;const t=this.parsedPath,n=t.objectName,r=t.propertyName;let s=t.propertyIndex;if(e||(e=mn.findNode(this.rootNode,t.nodeName),this.node=e),this.getValue=this._getValue_unavailable,this.setValue=this._setValue_unavailable,!e){console.warn("THREE.PropertyBinding: No target node found for track: "+this.path+".");return}if(n){let h=t.objectIndex;switch(n){case"materials":if(!e.material){console.error("THREE.PropertyBinding: Can not bind to material as node does not have a material.",this);return}if(!e.material.materials){console.error("THREE.PropertyBinding: Can not bind to material.materials as node.material does not have a materials array.",this);return}e=e.material.materials;break;case"bones":if(!e.skeleton){console.error("THREE.PropertyBinding: Can not bind to bones as node does not have a skeleton.",this);return}e=e.skeleton.bones;for(let m=0;m<e.length;m++)if(e[m].name===h){h=m;break}break;case"map":if("map"in e){e=e.map;break}if(!e.material){console.error("THREE.PropertyBinding: Can not bind to material as node does not have a material.",this);return}if(!e.material.map){console.error("THREE.PropertyBinding: Can not bind to material.map as node.material does not have a map.",this);return}e=e.material.map;break;default:if(e[n]===void 0){console.error("THREE.PropertyBinding: Can not bind to objectName of node undefined.",this);return}e=e[n]}if(h!==void 0){if(e[h]===void 0){console.error("THREE.PropertyBinding: Trying to bind to objectIndex of objectName, but is undefined.",this,e);return}e=e[h]}}const a=e[r];if(a===void 0){const h=t.nodeName;console.error("THREE.PropertyBinding: Trying to update property for track: "+h+"."+r+" but it wasn't found.",e);return}let u=this.Versioning.None;this.targetObject=e,e.isMaterial===!0?u=this.Versioning.NeedsUpdate:e.isObject3D===!0&&(u=this.Versioning.MatrixWorldNeedsUpdate);let d=this.BindingType.Direct;if(s!==void 0){if(r==="morphTargetInfluences"){if(!e.geometry){console.error("THREE.PropertyBinding: Can not bind to morphTargetInfluences because node does not have a geometry.",this);return}if(!e.geometry.morphAttributes){console.error("THREE.PropertyBinding: Can not bind to morphTargetInfluences because node does not have a geometry.morphAttributes.",this);return}e.morphTargetDictionary[s]!==void 0&&(s=e.morphTargetDictionary[s])}d=this.BindingType.ArrayElement,this.resolvedProperty=a,this.propertyIndex=s}else a.fromArray!==void 0&&a.toArray!==void 0?(d=this.BindingType.HasFromToArray,this.resolvedProperty=a):Array.isArray(a)?(d=this.BindingType.EntireArray,this.resolvedProperty=a):this.propertyName=r;this.getValue=this.GetterByBindingType[d],this.setValue=this.SetterByBindingTypeAndVersioning[d][u]}unbind(){this.node=null,this.getValue=this._getValue_unbound,this.setValue=this._setValue_unbound}}mn.Composite=OR;mn.prototype.BindingType={Direct:0,EntireArray:1,ArrayElement:2,HasFromToArray:3};mn.prototype.Versioning={None:0,NeedsUpdate:1,MatrixWorldNeedsUpdate:2};mn.prototype.GetterByBindingType=[mn.prototype._getValue_direct,mn.prototype._getValue_array,mn.prototype._getValue_arrayElement,mn.prototype._getValue_toArray];mn.prototype.SetterByBindingTypeAndVersioning=[[mn.prototype._setValue_direct,mn.prototype._setValue_direct_setNeedsUpdate,mn.prototype._setValue_direct_setMatrixWorldNeedsUpdate],[mn.prototype._setValue_array,mn.prototype._setValue_array_setNeedsUpdate,mn.prototype._setValue_array_setMatrixWorldNeedsUpdate],[mn.prototype._setValue_arrayElement,mn.prototype._setValue_arrayElement_setNeedsUpdate,mn.prototype._setValue_arrayElement_setMatrixWorldNeedsUpdate],[mn.prototype._setValue_fromArray,mn.prototype._setValue_fromArray_setNeedsUpdate,mn.prototype._setValue_fromArray_setMatrixWorldNeedsUpdate]];class kR{constructor(){this.isAnimationObjectGroup=!0,this.uuid=ts(),this._objects=Array.prototype.slice.call(arguments),this.nCachedObjects_=0;const e={};this._indicesByUUID=e;for(let n=0,r=arguments.length;n!==r;++n)e[arguments[n].uuid]=n;this._paths=[],this._parsedPaths=[],this._bindings=[],this._bindingsIndicesByPath={};const t=this;this.stats={objects:{get total(){return t._objects.length},get inUse(){return this.total-t.nCachedObjects_}},get bindingsPerObject(){return t._bindings.length}}}add(){const e=this._objects,t=this._indicesByUUID,n=this._paths,r=this._parsedPaths,s=this._bindings,a=s.length;let u,d=e.length,h=this.nCachedObjects_;for(let m=0,g=arguments.length;m!==g;++m){const v=arguments[m],_=v.uuid;let A=t[_];if(A===void 0){A=d++,t[_]=A,e.push(v);for(let C=0,M=a;C!==M;++C)s[C].push(new mn(v,n[C],r[C]))}else if(A<h){u=e[A];const C=--h,M=e[C];t[M.uuid]=A,e[A]=M,t[_]=C,e[C]=v;for(let S=0,b=a;S!==b;++S){const R=s[S],P=R[C];let U=R[A];R[A]=P,U===void 0&&(U=new mn(v,n[S],r[S])),R[C]=U}}else e[A]!==u&&console.error("THREE.AnimationObjectGroup: Different objects with the same UUID detected. Clean the caches or recreate your infrastructure when reloading scenes.")}this.nCachedObjects_=h}remove(){const e=this._objects,t=this._indicesByUUID,n=this._bindings,r=n.length;let s=this.nCachedObjects_;for(let a=0,u=arguments.length;a!==u;++a){const d=arguments[a],h=d.uuid,m=t[h];if(m!==void 0&&m>=s){const g=s++,v=e[g];t[v.uuid]=m,e[m]=v,t[h]=g,e[g]=d;for(let _=0,A=r;_!==A;++_){const C=n[_],M=C[g],S=C[m];C[m]=M,C[g]=S}}}this.nCachedObjects_=s}uncache(){const e=this._objects,t=this._indicesByUUID,n=this._bindings,r=n.length;let s=this.nCachedObjects_,a=e.length;for(let u=0,d=arguments.length;u!==d;++u){const h=arguments[u],m=h.uuid,g=t[m];if(g!==void 0)if(delete t[m],g<s){const v=--s,_=e[v],A=--a,C=e[A];t[_.uuid]=g,e[g]=_,t[C.uuid]=v,e[v]=C,e.pop();for(let M=0,S=r;M!==S;++M){const b=n[M],R=b[v],P=b[A];b[g]=R,b[v]=P,b.pop()}}else{const v=--a,_=e[v];v>0&&(t[_.uuid]=g),e[g]=_,e.pop();for(let A=0,C=r;A!==C;++A){const M=n[A];M[g]=M[v],M.pop()}}}this.nCachedObjects_=s}subscribe_(e,t){const n=this._bindingsIndicesByPath;let r=n[e];const s=this._bindings;if(r!==void 0)return s[r];const a=this._paths,u=this._parsedPaths,d=this._objects,h=d.length,m=this.nCachedObjects_,g=new Array(h);r=s.length,n[e]=r,a.push(e),u.push(t),s.push(g);for(let v=m,_=d.length;v!==_;++v){const A=d[v];g[v]=new mn(A,e,t)}return g}unsubscribe_(e){const t=this._bindingsIndicesByPath,n=t[e];if(n!==void 0){const r=this._paths,s=this._parsedPaths,a=this._bindings,u=a.length-1,d=a[u],h=e[u];t[h]=n,a[n]=d,a.pop(),s[n]=s[u],s.pop(),r[n]=r[u],r.pop()}}}class ME{constructor(e,t,n=null,r=t.blendMode){this._mixer=e,this._clip=t,this._localRoot=n,this.blendMode=r;const s=t.tracks,a=s.length,u=new Array(a),d={endingStart:Uu,endingEnd:Uu};for(let h=0;h!==a;++h){const m=s[h].createInterpolant(null);u[h]=m,m.settings=d}this._interpolantSettings=d,this._interpolants=u,this._propertyBindings=new Array(a),this._cacheIndex=null,this._byClipCacheIndex=null,this._timeScaleInterpolant=null,this._weightInterpolant=null,this.loop=pM,this._loopCount=-1,this._startTime=null,this.time=0,this.timeScale=1,this._effectiveTimeScale=1,this.weight=1,this._effectiveWeight=1,this.repetitions=1/0,this.paused=!1,this.enabled=!0,this.clampWhenFinished=!1,this.zeroSlopeAtStart=!0,this.zeroSlopeAtEnd=!0}play(){return this._mixer._activateAction(this),this}stop(){return this._mixer._deactivateAction(this),this.reset()}reset(){return this.paused=!1,this.enabled=!0,this.time=0,this._loopCount=-1,this._startTime=null,this.stopFading().stopWarping()}isRunning(){return this.enabled&&!this.paused&&this.timeScale!==0&&this._startTime===null&&this._mixer._isActiveAction(this)}isScheduled(){return this._mixer._isActiveAction(this)}startAt(e){return this._startTime=e,this}setLoop(e,t){return this.loop=e,this.repetitions=t,this}setEffectiveWeight(e){return this.weight=e,this._effectiveWeight=this.enabled?e:0,this.stopFading()}getEffectiveWeight(){return this._effectiveWeight}fadeIn(e){return this._scheduleFading(e,0,1)}fadeOut(e){return this._scheduleFading(e,1,0)}crossFadeFrom(e,t,n){if(e.fadeOut(t),this.fadeIn(t),n){const r=this._clip.duration,s=e._clip.duration,a=s/r,u=r/s;e.warp(1,a,t),this.warp(u,1,t)}return this}crossFadeTo(e,t,n){return e.crossFadeFrom(this,t,n)}stopFading(){const e=this._weightInterpolant;return e!==null&&(this._weightInterpolant=null,this._mixer._takeBackControlInterpolant(e)),this}setEffectiveTimeScale(e){return this.timeScale=e,this._effectiveTimeScale=this.paused?0:e,this.stopWarping()}getEffectiveTimeScale(){return this._effectiveTimeScale}setDuration(e){return this.timeScale=this._clip.duration/e,this.stopWarping()}syncWith(e){return this.time=e.time,this.timeScale=e.timeScale,this.stopWarping()}halt(e){return this.warp(this._effectiveTimeScale,0,e)}warp(e,t,n){const r=this._mixer,s=r.time,a=this.timeScale;let u=this._timeScaleInterpolant;u===null&&(u=r._lendControlInterpolant(),this._timeScaleInterpolant=u);const d=u.parameterPositions,h=u.sampleValues;return d[0]=s,d[1]=s+n,h[0]=e/a,h[1]=t/a,this}stopWarping(){const e=this._timeScaleInterpolant;return e!==null&&(this._timeScaleInterpolant=null,this._mixer._takeBackControlInterpolant(e)),this}getMixer(){return this._mixer}getClip(){return this._clip}getRoot(){return this._localRoot||this._mixer._root}_update(e,t,n,r){if(!this.enabled){this._updateWeight(e);return}const s=this._startTime;if(s!==null){const d=(e-s)*n;d<0||n===0?t=0:(this._startTime=null,t=n*d)}t*=this._updateTimeScale(e);const a=this._updateTime(t),u=this._updateWeight(e);if(u>0){const d=this._interpolants,h=this._propertyBindings;switch(this.blendMode){case Q_:for(let m=0,g=d.length;m!==g;++m)d[m].evaluate(a),h[m].accumulateAdditive(u);break;case B0:default:for(let m=0,g=d.length;m!==g;++m)d[m].evaluate(a),h[m].accumulate(r,u)}}}_updateWeight(e){let t=0;if(this.enabled){t=this.weight;const n=this._weightInterpolant;if(n!==null){const r=n.evaluate(e)[0];t*=r,e>n.parameterPositions[1]&&(this.stopFading(),r===0&&(this.enabled=!1))}}return this._effectiveWeight=t,t}_updateTimeScale(e){let t=0;if(!this.paused){t=this.timeScale;const n=this._timeScaleInterpolant;if(n!==null){const r=n.evaluate(e)[0];t*=r,e>n.parameterPositions[1]&&(this.stopWarping(),t===0?this.paused=!0:this.timeScale=t)}}return this._effectiveTimeScale=t,t}_updateTime(e){const t=this._clip.duration,n=this.loop;let r=this.time+e,s=this._loopCount;const a=n===mM;if(e===0)return s===-1?r:a&&(s&1)===1?t-r:r;if(n===hM){s===-1&&(this._loopCount=0,this._setEndings(!0,!0,!1));e:{if(r>=t)r=t;else if(r<0)r=0;else{this.time=r;break e}this.clampWhenFinished?this.paused=!0:this.enabled=!1,this.time=r,this._mixer.dispatchEvent({type:"finished",action:this,direction:e<0?-1:1})}}else{if(s===-1&&(e>=0?(s=0,this._setEndings(!0,this.repetitions===0,a)):this._setEndings(this.repetitions===0,!0,a)),r>=t||r<0){const u=Math.floor(r/t);r-=t*u,s+=Math.abs(u);const d=this.repetitions-s;if(d<=0)this.clampWhenFinished?this.paused=!0:this.enabled=!1,r=e>0?t:0,this.time=r,this._mixer.dispatchEvent({type:"finished",action:this,direction:e>0?1:-1});else{if(d===1){const h=e<0;this._setEndings(h,!h,a)}else this._setEndings(!1,!1,a);this._loopCount=s,this.time=r,this._mixer.dispatchEvent({type:"loop",action:this,loopDelta:u})}}else this.time=r;if(a&&(s&1)===1)return t-r}return r}_setEndings(e,t,n){const r=this._interpolantSettings;n?(r.endingStart=Ou,r.endingEnd=Ou):(e?r.endingStart=this.zeroSlopeAtStart?Ou:Uu:r.endingStart=Hh,t?r.endingEnd=this.zeroSlopeAtEnd?Ou:Uu:r.endingEnd=Hh)}_scheduleFading(e,t,n){const r=this._mixer,s=r.time;let a=this._weightInterpolant;a===null&&(a=r._lendControlInterpolant(),this._weightInterpolant=a);const u=a.parameterPositions,d=a.sampleValues;return u[0]=s,d[0]=t,u[1]=s+e,d[1]=n,this}}const HR=new Float32Array(1);class EE extends Io{constructor(e){super(),this._root=e,this._initMemoryManager(),this._accuIndex=0,this.time=0,this.timeScale=1}_bindAction(e,t){const n=e._localRoot||this._root,r=e._clip.tracks,s=r.length,a=e._propertyBindings,u=e._interpolants,d=n.uuid,h=this._bindingsByRootAndName;let m=h[d];m===void 0&&(m={},h[d]=m);for(let g=0;g!==s;++g){const v=r[g],_=v.name;let A=m[_];if(A!==void 0)++A.referenceCount,a[g]=A;else{if(A=a[g],A!==void 0){A._cacheIndex===null&&(++A.referenceCount,this._addInactiveBinding(A,d,_));continue}const C=t&&t._propertyBindings[g].binding.parsedPath;A=new SE(mn.create(n,_,C),v.ValueTypeName,v.getValueSize()),++A.referenceCount,this._addInactiveBinding(A,d,_),a[g]=A}u[g].resultBuffer=A.buffer}}_activateAction(e){if(!this._isActiveAction(e)){if(e._cacheIndex===null){const n=(e._localRoot||this._root).uuid,r=e._clip.uuid,s=this._actionsByClip[r];this._bindAction(e,s&&s.knownActions[0]),this._addInactiveAction(e,r,n)}const t=e._propertyBindings;for(let n=0,r=t.length;n!==r;++n){const s=t[n];s.useCount++===0&&(this._lendBinding(s),s.saveOriginalState())}this._lendAction(e)}}_deactivateAction(e){if(this._isActiveAction(e)){const t=e._propertyBindings;for(let n=0,r=t.length;n!==r;++n){const s=t[n];--s.useCount===0&&(s.restoreOriginalState(),this._takeBackBinding(s))}this._takeBackAction(e)}}_initMemoryManager(){this._actions=[],this._nActiveActions=0,this._actionsByClip={},this._bindings=[],this._nActiveBindings=0,this._bindingsByRootAndName={},this._controlInterpolants=[],this._nActiveControlInterpolants=0;const e=this;this.stats={actions:{get total(){return e._actions.length},get inUse(){return e._nActiveActions}},bindings:{get total(){return e._bindings.length},get inUse(){return e._nActiveBindings}},controlInterpolants:{get total(){return e._controlInterpolants.length},get inUse(){return e._nActiveControlInterpolants}}}}_isActiveAction(e){const t=e._cacheIndex;return t!==null&&t<this._nActiveActions}_addInactiveAction(e,t,n){const r=this._actions,s=this._actionsByClip;let a=s[t];if(a===void 0)a={knownActions:[e],actionByRoot:{}},e._byClipCacheIndex=0,s[t]=a;else{const u=a.knownActions;e._byClipCacheIndex=u.length,u.push(e)}e._cacheIndex=r.length,r.push(e),a.actionByRoot[n]=e}_removeInactiveAction(e){const t=this._actions,n=t[t.length-1],r=e._cacheIndex;n._cacheIndex=r,t[r]=n,t.pop(),e._cacheIndex=null;const s=e._clip.uuid,a=this._actionsByClip,u=a[s],d=u.knownActions,h=d[d.length-1],m=e._byClipCacheIndex;h._byClipCacheIndex=m,d[m]=h,d.pop(),e._byClipCacheIndex=null;const g=u.actionByRoot,v=(e._localRoot||this._root).uuid;delete g[v],d.length===0&&delete a[s],this._removeInactiveBindingsForAction(e)}_removeInactiveBindingsForAction(e){const t=e._propertyBindings;for(let n=0,r=t.length;n!==r;++n){const s=t[n];--s.referenceCount===0&&this._removeInactiveBinding(s)}}_lendAction(e){const t=this._actions,n=e._cacheIndex,r=this._nActiveActions++,s=t[r];e._cacheIndex=r,t[r]=e,s._cacheIndex=n,t[n]=s}_takeBackAction(e){const t=this._actions,n=e._cacheIndex,r=--this._nActiveActions,s=t[r];e._cacheIndex=r,t[r]=e,s._cacheIndex=n,t[n]=s}_addInactiveBinding(e,t,n){const r=this._bindingsByRootAndName,s=this._bindings;let a=r[t];a===void 0&&(a={},r[t]=a),a[n]=e,e._cacheIndex=s.length,s.push(e)}_removeInactiveBinding(e){const t=this._bindings,n=e.binding,r=n.rootNode.uuid,s=n.path,a=this._bindingsByRootAndName,u=a[r],d=t[t.length-1],h=e._cacheIndex;d._cacheIndex=h,t[h]=d,t.pop(),delete u[s],Object.keys(u).length===0&&delete a[r]}_lendBinding(e){const t=this._bindings,n=e._cacheIndex,r=this._nActiveBindings++,s=t[r];e._cacheIndex=r,t[r]=e,s._cacheIndex=n,t[n]=s}_takeBackBinding(e){const t=this._bindings,n=e._cacheIndex,r=--this._nActiveBindings,s=t[r];e._cacheIndex=r,t[r]=e,s._cacheIndex=n,t[n]=s}_lendControlInterpolant(){const e=this._controlInterpolants,t=this._nActiveControlInterpolants++;let n=e[t];return n===void 0&&(n=new yx(new Float32Array(2),new Float32Array(2),1,HR),n.__cacheIndex=t,e[t]=n),n}_takeBackControlInterpolant(e){const t=this._controlInterpolants,n=e.__cacheIndex,r=--this._nActiveControlInterpolants,s=t[r];e.__cacheIndex=r,t[r]=e,s.__cacheIndex=n,t[n]=s}clipAction(e,t,n){const r=t||this._root,s=r.uuid;let a=typeof e=="string"?Zf.findByName(r,e):e;const u=a!==null?a.uuid:e,d=this._actionsByClip[u];let h=null;if(n===void 0&&(a!==null?n=a.blendMode:n=B0),d!==void 0){const g=d.actionByRoot[s];if(g!==void 0&&g.blendMode===n)return g;h=d.knownActions[0],a===null&&(a=h._clip)}if(a===null)return null;const m=new ME(this,a,t,n);return this._bindAction(m,h),this._addInactiveAction(m,u,s),m}existingAction(e,t){const n=t||this._root,r=n.uuid,s=typeof e=="string"?Zf.findByName(n,e):e,a=s?s.uuid:e,u=this._actionsByClip[a];return u!==void 0&&u.actionByRoot[r]||null}stopAllAction(){const e=this._actions,t=this._nActiveActions;for(let n=t-1;n>=0;--n)e[n].stop();return this}update(e){e*=this.timeScale;const t=this._actions,n=this._nActiveActions,r=this.time+=e,s=Math.sign(e),a=this._accuIndex^=1;for(let h=0;h!==n;++h)t[h]._update(r,e,s,a);const u=this._bindings,d=this._nActiveBindings;for(let h=0;h!==d;++h)u[h].apply(a);return this}setTime(e){this.time=0;for(let t=0;t<this._actions.length;t++)this._actions[t].time=0;return this.update(e)}getRoot(){return this._root}uncacheClip(e){const t=this._actions,n=e.uuid,r=this._actionsByClip,s=r[n];if(s!==void 0){const a=s.knownActions;for(let u=0,d=a.length;u!==d;++u){const h=a[u];this._deactivateAction(h);const m=h._cacheIndex,g=t[t.length-1];h._cacheIndex=null,h._byClipCacheIndex=null,g._cacheIndex=m,t[m]=g,t.pop(),this._removeInactiveBindingsForAction(h)}delete r[n]}}uncacheRoot(e){const t=e.uuid,n=this._actionsByClip;for(const a in n){const u=n[a].actionByRoot,d=u[t];d!==void 0&&(this._deactivateAction(d),this._removeInactiveAction(d))}const r=this._bindingsByRootAndName,s=r[t];if(s!==void 0)for(const a in s){const u=s[a];u.restoreOriginalState(),this._removeInactiveBinding(u)}}uncacheAction(e,t){const n=this.existingAction(e,t);n!==null&&(this._deactivateAction(n),this._removeInactiveAction(n))}}class zR extends L0{constructor(e=1,t=1,n=1,r={}){super(e,t,r),this.isRenderTarget3D=!0,this.depth=n,this.texture=new D0(null,e,t,n),this.texture.isRenderTargetTexture=!0}}class GR extends L0{constructor(e=1,t=1,n=1,r={}){super(e,t,r),this.isRenderTargetArray=!0,this.depth=n,this.texture=new op(null,e,t,n),this.texture.isRenderTargetTexture=!0}}class Rx{constructor(e){this.value=e}clone(){return new Rx(this.value.clone===void 0?this.value:this.value.clone())}}let VR=0;class WR extends Io{constructor(){super(),this.isUniformsGroup=!0,Object.defineProperty(this,"id",{value:VR++}),this.name="",this.usage=Gh,this.uniforms=[]}add(e){return this.uniforms.push(e),this}remove(e){const t=this.uniforms.indexOf(e);return t!==-1&&this.uniforms.splice(t,1),this}setName(e){return this.name=e,this}setUsage(e){return this.usage=e,this}dispose(){return this.dispatchEvent({type:"dispose"}),this}copy(e){this.name=e.name,this.usage=e.usage;const t=e.uniforms;this.uniforms.length=0;for(let n=0,r=t.length;n<r;n++){const s=Array.isArray(t[n])?t[n]:[t[n]];for(let a=0;a<s.length;a++)this.uniforms.push(s[a].clone())}return this}clone(){return new this.constructor().copy(this)}}class XR extends up{constructor(e,t,n=1){super(e,t),this.isInstancedInterleavedBuffer=!0,this.meshPerAttribute=n}copy(e){return super.copy(e),this.meshPerAttribute=e.meshPerAttribute,this}clone(e){const t=super.clone(e);return t.meshPerAttribute=this.meshPerAttribute,t}toJSON(e){const t=super.toJSON(e);return t.isInstancedInterleavedBuffer=!0,t.meshPerAttribute=this.meshPerAttribute,t}}class jR{constructor(e,t,n,r,s){this.isGLBufferAttribute=!0,this.name="",this.buffer=e,this.type=t,this.itemSize=n,this.elementSize=r,this.count=s,this.version=0}set needsUpdate(e){e===!0&&this.version++}setBuffer(e){return this.buffer=e,this}setType(e,t){return this.type=e,this.elementSize=t,this}setItemSize(e){return this.itemSize=e,this}setCount(e){return this.count=e,this}}const GA=new Ot;class wE{constructor(e,t,n=0,r=1/0){this.ray=new rc(e,t),this.near=n,this.far=r,this.camera=null,this.layers=new ju,this.params={Mesh:{},Line:{threshold:1},LOD:{},Points:{threshold:1},Sprite:{}}}set(e,t){this.ray.set(e,t)}setFromCamera(e,t){t.isPerspectiveCamera?(this.ray.origin.setFromMatrixPosition(t.matrixWorld),this.ray.direction.set(e.x,e.y,.5).unproject(t).sub(this.ray.origin).normalize(),this.camera=t):t.isOrthographicCamera?(this.ray.origin.set(e.x,e.y,(t.near+t.far)/(t.near-t.far)).unproject(t),this.ray.direction.set(0,0,-1).transformDirection(t.matrixWorld),this.camera=t):console.error("THREE.Raycaster: Unsupported camera type: "+t.type)}setFromXRController(e){return GA.identity().extractRotation(e.matrixWorld),this.ray.origin.setFromMatrixPosition(e.matrixWorld),this.ray.direction.set(0,0,-1).applyMatrix4(GA),this}intersectObject(e,t=!0,n=[]){return v_(e,this,n,t),n.sort(VA),n}intersectObjects(e,t=!0,n=[]){for(let r=0,s=e.length;r<s;r++)v_(e[r],this,n,t);return n.sort(VA),n}}function VA(i,e){return i.distance-e.distance}function v_(i,e,t,n){let r=!0;if(i.layers.test(e.layers)&&i.raycast(e,t)===!1&&(r=!1),r===!0&&n===!0){const s=i.children;for(let a=0,u=s.length;a<u;a++)v_(s[a],e,t,!0)}}class y_{constructor(e=1,t=0,n=0){return this.radius=e,this.phi=t,this.theta=n,this}set(e,t,n){return this.radius=e,this.phi=t,this.theta=n,this}copy(e){return this.radius=e.radius,this.phi=e.phi,this.theta=e.theta,this}makeSafe(){return this.phi=Xt(this.phi,1e-6,Math.PI-1e-6),this}setFromVector3(e){return this.setFromCartesianCoords(e.x,e.y,e.z)}setFromCartesianCoords(e,t,n){return this.radius=Math.sqrt(e*e+t*t+n*n),this.radius===0?(this.theta=0,this.phi=0):(this.theta=Math.atan2(e,n),this.phi=Math.acos(Xt(t/this.radius,-1,1))),this}clone(){return new this.constructor().copy(this)}}class JR{constructor(e=1,t=0,n=0){return this.radius=e,this.theta=t,this.y=n,this}set(e,t,n){return this.radius=e,this.theta=t,this.y=n,this}copy(e){return this.radius=e.radius,this.theta=e.theta,this.y=e.y,this}setFromVector3(e){return this.setFromCartesianCoords(e.x,e.y,e.z)}setFromCartesianCoords(e,t,n){return this.radius=Math.sqrt(e*e+n*n),this.theta=Math.atan2(e,n),this.y=t,this}clone(){return new this.constructor().copy(this)}}class Ix{constructor(e,t,n,r){Ix.prototype.isMatrix2=!0,this.elements=[1,0,0,1],e!==void 0&&this.set(e,t,n,r)}identity(){return this.set(1,0,0,1),this}fromArray(e,t=0){for(let n=0;n<4;n++)this.elements[n]=e[n+t];return this}set(e,t,n,r){const s=this.elements;return s[0]=e,s[2]=t,s[1]=n,s[3]=r,this}}const WA=new Le;class KR{constructor(e=new Le(1/0,1/0),t=new Le(-1/0,-1/0)){this.isBox2=!0,this.min=e,this.max=t}set(e,t){return this.min.copy(e),this.max.copy(t),this}setFromPoints(e){this.makeEmpty();for(let t=0,n=e.length;t<n;t++)this.expandByPoint(e[t]);return this}setFromCenterAndSize(e,t){const n=WA.copy(t).multiplyScalar(.5);return this.min.copy(e).sub(n),this.max.copy(e).add(n),this}clone(){return new this.constructor().copy(this)}copy(e){return this.min.copy(e.min),this.max.copy(e.max),this}makeEmpty(){return this.min.x=this.min.y=1/0,this.max.x=this.max.y=-1/0,this}isEmpty(){return this.max.x<this.min.x||this.max.y<this.min.y}getCenter(e){return this.isEmpty()?e.set(0,0):e.addVectors(this.min,this.max).multiplyScalar(.5)}getSize(e){return this.isEmpty()?e.set(0,0):e.subVectors(this.max,this.min)}expandByPoint(e){return this.min.min(e),this.max.max(e),this}expandByVector(e){return this.min.sub(e),this.max.add(e),this}expandByScalar(e){return this.min.addScalar(-e),this.max.addScalar(e),this}containsPoint(e){return e.x>=this.min.x&&e.x<=this.max.x&&e.y>=this.min.y&&e.y<=this.max.y}containsBox(e){return this.min.x<=e.min.x&&e.max.x<=this.max.x&&this.min.y<=e.min.y&&e.max.y<=this.max.y}getParameter(e,t){return t.set((e.x-this.min.x)/(this.max.x-this.min.x),(e.y-this.min.y)/(this.max.y-this.min.y))}intersectsBox(e){return e.max.x>=this.min.x&&e.min.x<=this.max.x&&e.max.y>=this.min.y&&e.min.y<=this.max.y}clampPoint(e,t){return t.copy(e).clamp(this.min,this.max)}distanceToPoint(e){return this.clampPoint(e,WA).distanceTo(e)}intersect(e){return this.min.max(e.min),this.max.min(e.max),this.isEmpty()&&this.makeEmpty(),this}union(e){return this.min.min(e.min),this.max.max(e.max),this}translate(e){return this.min.add(e),this.max.add(e),this}equals(e){return e.min.equals(this.min)&&e.max.equals(this.max)}}const XA=new X,$m=new X;class YR{constructor(e=new X,t=new X){this.start=e,this.end=t}set(e,t){return this.start.copy(e),this.end.copy(t),this}copy(e){return this.start.copy(e.start),this.end.copy(e.end),this}getCenter(e){return e.addVectors(this.start,this.end).multiplyScalar(.5)}delta(e){return e.subVectors(this.end,this.start)}distanceSq(){return this.start.distanceToSquared(this.end)}distance(){return this.start.distanceTo(this.end)}at(e,t){return this.delta(t).multiplyScalar(e).add(this.start)}closestPointToPointParameter(e,t){XA.subVectors(e,this.start),$m.subVectors(this.end,this.start);const n=$m.dot($m);let s=$m.dot(XA)/n;return t&&(s=Xt(s,0,1)),s}closestPointToPoint(e,t,n){const r=this.closestPointToPointParameter(e,t);return this.delta(n).multiplyScalar(r).add(this.start)}applyMatrix4(e){return this.start.applyMatrix4(e),this.end.applyMatrix4(e),this}equals(e){return e.start.equals(this.start)&&e.end.equals(this.end)}clone(){return new this.constructor().copy(this)}}const jA=new X;class QR extends fn{constructor(e,t){super(),this.light=e,this.matrixAutoUpdate=!1,this.color=t,this.type="SpotLightHelper";const n=new Kt,r=[0,0,0,0,0,1,0,0,0,1,0,1,0,0,0,-1,0,1,0,0,0,0,1,1,0,0,0,0,-1,1];for(let a=0,u=1,d=32;a<d;a++,u++){const h=a/d*Math.PI*2,m=u/d*Math.PI*2;r.push(Math.cos(h),Math.sin(h),1,Math.cos(m),Math.sin(m),1)}n.setAttribute("position",new Tt(r,3));const s=new or({fog:!1,toneMapped:!1});this.cone=new io(n,s),this.add(this.cone),this.update()}dispose(){this.cone.geometry.dispose(),this.cone.material.dispose()}update(){this.light.updateWorldMatrix(!0,!1),this.light.target.updateWorldMatrix(!0,!1),this.parent?(this.parent.updateWorldMatrix(!0),this.matrix.copy(this.parent.matrixWorld).invert().multiply(this.light.matrixWorld)):this.matrix.copy(this.light.matrixWorld),this.matrixWorld.copy(this.light.matrixWorld);const e=this.light.distance?this.light.distance:1e3,t=e*Math.tan(this.light.angle);this.cone.scale.set(t,t,e),jA.setFromMatrixPosition(this.light.target.matrixWorld),this.cone.lookAt(jA),this.color!==void 0?this.cone.material.color.set(this.color):this.cone.material.color.copy(this.light.color)}}const gl=new X,eg=new Ot,Ay=new Ot;class qR extends io{constructor(e){const t=CE(e),n=new Kt,r=[],s=[],a=new tt(0,0,1),u=new tt(0,1,0);for(let h=0;h<t.length;h++){const m=t[h];m.parent&&m.parent.isBone&&(r.push(0,0,0),r.push(0,0,0),s.push(a.r,a.g,a.b),s.push(u.r,u.g,u.b))}n.setAttribute("position",new Tt(r,3)),n.setAttribute("color",new Tt(s,3));const d=new or({vertexColors:!0,depthTest:!1,depthWrite:!1,toneMapped:!1,transparent:!0});super(n,d),this.isSkeletonHelper=!0,this.type="SkeletonHelper",this.root=e,this.bones=t,this.matrix=e.matrixWorld,this.matrixAutoUpdate=!1}updateMatrixWorld(e){const t=this.bones,n=this.geometry,r=n.getAttribute("position");Ay.copy(this.root.matrixWorld).invert();for(let s=0,a=0;s<t.length;s++){const u=t[s];u.parent&&u.parent.isBone&&(eg.multiplyMatrices(Ay,u.matrixWorld),gl.setFromMatrixPosition(eg),r.setXYZ(a,gl.x,gl.y,gl.z),eg.multiplyMatrices(Ay,u.parent.matrixWorld),gl.setFromMatrixPosition(eg),r.setXYZ(a+1,gl.x,gl.y,gl.z),a+=2)}n.getAttribute("position").needsUpdate=!0,super.updateMatrixWorld(e)}dispose(){this.geometry.dispose(),this.material.dispose()}}function CE(i){const e=[];i.isBone===!0&&e.push(i);for(let t=0;t<i.children.length;t++)e.push.apply(e,CE(i.children[t]));return e}class ZR extends si{constructor(e,t,n){const r=new pp(t,4,2),s=new es({wireframe:!0,fog:!1,toneMapped:!1});super(r,s),this.light=e,this.color=n,this.type="PointLightHelper",this.matrix=this.light.matrixWorld,this.matrixAutoUpdate=!1,this.update()}dispose(){this.geometry.dispose(),this.material.dispose()}update(){this.light.updateWorldMatrix(!0,!1),this.color!==void 0?this.material.color.set(this.color):this.material.color.copy(this.light.color)}}const $R=new X,JA=new tt,KA=new tt;class eI extends fn{constructor(e,t,n){super(),this.light=e,this.matrix=e.matrixWorld,this.matrixAutoUpdate=!1,this.color=n,this.type="HemisphereLightHelper";const r=new hp(t);r.rotateY(Math.PI*.5),this.material=new es({wireframe:!0,fog:!1,toneMapped:!1}),this.color===void 0&&(this.material.vertexColors=!0);const s=r.getAttribute("position"),a=new Float32Array(s.count*3);r.setAttribute("color",new xn(a,3)),this.add(new si(r,this.material)),this.update()}dispose(){this.children[0].geometry.dispose(),this.children[0].material.dispose()}update(){const e=this.children[0];if(this.color!==void 0)this.material.color.set(this.color);else{const t=e.geometry.getAttribute("color");JA.copy(this.light.color),KA.copy(this.light.groundColor);for(let n=0,r=t.count;n<r;n++){const s=n<r/2?JA:KA;t.setXYZ(n,s.r,s.g,s.b)}t.needsUpdate=!0}this.light.updateWorldMatrix(!0,!1),e.lookAt($R.setFromMatrixPosition(this.light.matrixWorld).negate())}}class tI extends io{constructor(e=10,t=10,n=4473924,r=8947848){n=new tt(n),r=new tt(r);const s=t/2,a=e/t,u=e/2,d=[],h=[];for(let v=0,_=0,A=-u;v<=t;v++,A+=a){d.push(-u,0,A,u,0,A),d.push(A,0,-u,A,0,u);const C=v===s?n:r;C.toArray(h,_),_+=3,C.toArray(h,_),_+=3,C.toArray(h,_),_+=3,C.toArray(h,_),_+=3}const m=new Kt;m.setAttribute("position",new Tt(d,3)),m.setAttribute("color",new Tt(h,3));const g=new or({vertexColors:!0,toneMapped:!1});super(m,g),this.type="GridHelper"}dispose(){this.geometry.dispose(),this.material.dispose()}}class nI extends io{constructor(e=10,t=16,n=8,r=64,s=4473924,a=8947848){s=new tt(s),a=new tt(a);const u=[],d=[];if(t>1)for(let g=0;g<t;g++){const v=g/t*(Math.PI*2),_=Math.sin(v)*e,A=Math.cos(v)*e;u.push(0,0,0),u.push(_,0,A);const C=g&1?s:a;d.push(C.r,C.g,C.b),d.push(C.r,C.g,C.b)}for(let g=0;g<n;g++){const v=g&1?s:a,_=e-e/n*g;for(let A=0;A<r;A++){let C=A/r*(Math.PI*2),M=Math.sin(C)*_,S=Math.cos(C)*_;u.push(M,0,S),d.push(v.r,v.g,v.b),C=(A+1)/r*(Math.PI*2),M=Math.sin(C)*_,S=Math.cos(C)*_,u.push(M,0,S),d.push(v.r,v.g,v.b)}}const h=new Kt;h.setAttribute("position",new Tt(u,3)),h.setAttribute("color",new Tt(d,3));const m=new or({vertexColors:!0,toneMapped:!1});super(h,m),this.type="PolarGridHelper"}dispose(){this.geometry.dispose(),this.material.dispose()}}const YA=new X,tg=new X,QA=new X;class iI extends fn{constructor(e,t,n){super(),this.light=e,this.matrix=e.matrixWorld,this.matrixAutoUpdate=!1,this.color=n,this.type="DirectionalLightHelper",t===void 0&&(t=1);let r=new Kt;r.setAttribute("position",new Tt([-t,t,0,t,t,0,t,-t,0,-t,-t,0,-t,t,0],3));const s=new or({fog:!1,toneMapped:!1});this.lightPlane=new Ra(r,s),this.add(this.lightPlane),r=new Kt,r.setAttribute("position",new Tt([0,0,0,0,0,1],3)),this.targetLine=new Ra(r,s),this.add(this.targetLine),this.update()}dispose(){this.lightPlane.geometry.dispose(),this.lightPlane.material.dispose(),this.targetLine.geometry.dispose(),this.targetLine.material.dispose()}update(){this.light.updateWorldMatrix(!0,!1),this.light.target.updateWorldMatrix(!0,!1),YA.setFromMatrixPosition(this.light.matrixWorld),tg.setFromMatrixPosition(this.light.target.matrixWorld),QA.subVectors(tg,YA),this.lightPlane.lookAt(tg),this.color!==void 0?(this.lightPlane.material.color.set(this.color),this.targetLine.material.color.set(this.color)):(this.lightPlane.material.color.copy(this.light.color),this.targetLine.material.color.copy(this.light.color)),this.targetLine.lookAt(tg),this.targetLine.scale.z=QA.length()}}const ng=new X,Zn=new ap;class rI extends io{constructor(e){const t=new Kt,n=new or({color:16777215,vertexColors:!0,toneMapped:!1}),r=[],s=[],a={};u("n1","n2"),u("n2","n4"),u("n4","n3"),u("n3","n1"),u("f1","f2"),u("f2","f4"),u("f4","f3"),u("f3","f1"),u("n1","f1"),u("n2","f2"),u("n3","f3"),u("n4","f4"),u("p","n1"),u("p","n2"),u("p","n3"),u("p","n4"),u("u1","u2"),u("u2","u3"),u("u3","u1"),u("c","t"),u("p","c"),u("cn1","cn2"),u("cn3","cn4"),u("cf1","cf2"),u("cf3","cf4");function u(A,C){d(A),d(C)}function d(A){r.push(0,0,0),s.push(0,0,0),a[A]===void 0&&(a[A]=[]),a[A].push(r.length/3-1)}t.setAttribute("position",new Tt(r,3)),t.setAttribute("color",new Tt(s,3)),super(t,n),this.type="CameraHelper",this.camera=e,this.camera.updateProjectionMatrix&&this.camera.updateProjectionMatrix(),this.matrix=e.matrixWorld,this.matrixAutoUpdate=!1,this.pointMap=a,this.update();const h=new tt(16755200),m=new tt(16711680),g=new tt(43775),v=new tt(16777215),_=new tt(3355443);this.setColors(h,m,g,v,_)}setColors(e,t,n,r,s){const u=this.geometry.getAttribute("color");u.setXYZ(0,e.r,e.g,e.b),u.setXYZ(1,e.r,e.g,e.b),u.setXYZ(2,e.r,e.g,e.b),u.setXYZ(3,e.r,e.g,e.b),u.setXYZ(4,e.r,e.g,e.b),u.setXYZ(5,e.r,e.g,e.b),u.setXYZ(6,e.r,e.g,e.b),u.setXYZ(7,e.r,e.g,e.b),u.setXYZ(8,e.r,e.g,e.b),u.setXYZ(9,e.r,e.g,e.b),u.setXYZ(10,e.r,e.g,e.b),u.setXYZ(11,e.r,e.g,e.b),u.setXYZ(12,e.r,e.g,e.b),u.setXYZ(13,e.r,e.g,e.b),u.setXYZ(14,e.r,e.g,e.b),u.setXYZ(15,e.r,e.g,e.b),u.setXYZ(16,e.r,e.g,e.b),u.setXYZ(17,e.r,e.g,e.b),u.setXYZ(18,e.r,e.g,e.b),u.setXYZ(19,e.r,e.g,e.b),u.setXYZ(20,e.r,e.g,e.b),u.setXYZ(21,e.r,e.g,e.b),u.setXYZ(22,e.r,e.g,e.b),u.setXYZ(23,e.r,e.g,e.b),u.setXYZ(24,t.r,t.g,t.b),u.setXYZ(25,t.r,t.g,t.b),u.setXYZ(26,t.r,t.g,t.b),u.setXYZ(27,t.r,t.g,t.b),u.setXYZ(28,t.r,t.g,t.b),u.setXYZ(29,t.r,t.g,t.b),u.setXYZ(30,t.r,t.g,t.b),u.setXYZ(31,t.r,t.g,t.b),u.setXYZ(32,n.r,n.g,n.b),u.setXYZ(33,n.r,n.g,n.b),u.setXYZ(34,n.r,n.g,n.b),u.setXYZ(35,n.r,n.g,n.b),u.setXYZ(36,n.r,n.g,n.b),u.setXYZ(37,n.r,n.g,n.b),u.setXYZ(38,r.r,r.g,r.b),u.setXYZ(39,r.r,r.g,r.b),u.setXYZ(40,s.r,s.g,s.b),u.setXYZ(41,s.r,s.g,s.b),u.setXYZ(42,s.r,s.g,s.b),u.setXYZ(43,s.r,s.g,s.b),u.setXYZ(44,s.r,s.g,s.b),u.setXYZ(45,s.r,s.g,s.b),u.setXYZ(46,s.r,s.g,s.b),u.setXYZ(47,s.r,s.g,s.b),u.setXYZ(48,s.r,s.g,s.b),u.setXYZ(49,s.r,s.g,s.b),u.needsUpdate=!0}update(){const e=this.geometry,t=this.pointMap,n=1,r=1;Zn.projectionMatrixInverse.copy(this.camera.projectionMatrixInverse);const s=this.camera.coordinateSystem===Zs?-1:0;ii("c",t,e,Zn,0,0,s),ii("t",t,e,Zn,0,0,1),ii("n1",t,e,Zn,-1,-1,s),ii("n2",t,e,Zn,n,-1,s),ii("n3",t,e,Zn,-1,r,s),ii("n4",t,e,Zn,n,r,s),ii("f1",t,e,Zn,-1,-1,1),ii("f2",t,e,Zn,n,-1,1),ii("f3",t,e,Zn,-1,r,1),ii("f4",t,e,Zn,n,r,1),ii("u1",t,e,Zn,n*.7,r*1.1,s),ii("u2",t,e,Zn,-1*.7,r*1.1,s),ii("u3",t,e,Zn,0,r*2,s),ii("cf1",t,e,Zn,-1,0,1),ii("cf2",t,e,Zn,n,0,1),ii("cf3",t,e,Zn,0,-1,1),ii("cf4",t,e,Zn,0,r,1),ii("cn1",t,e,Zn,-1,0,s),ii("cn2",t,e,Zn,n,0,s),ii("cn3",t,e,Zn,0,-1,s),ii("cn4",t,e,Zn,0,r,s),e.getAttribute("position").needsUpdate=!0}dispose(){this.geometry.dispose(),this.material.dispose()}}function ii(i,e,t,n,r,s,a){ng.set(r,s,a).unproject(n);const u=e[i];if(u!==void 0){const d=t.getAttribute("position");for(let h=0,m=u.length;h<m;h++)d.setXYZ(u[h],ng.x,ng.y,ng.z)}}const ig=new sr;class TE extends io{constructor(e,t=16776960){const n=new Uint16Array([0,1,1,2,2,3,3,0,4,5,5,6,6,7,7,4,0,4,1,5,2,6,3,7]),r=new Float32Array(8*3),s=new Kt;s.setIndex(new xn(n,1)),s.setAttribute("position",new xn(r,3)),super(s,new or({color:t,toneMapped:!1})),this.object=e,this.type="BoxHelper",this.matrixAutoUpdate=!1,this.update()}update(e){if(e!==void 0&&console.warn("THREE.BoxHelper: .update() has no longer arguments."),this.object!==void 0&&ig.setFromObject(this.object),ig.isEmpty())return;const t=ig.min,n=ig.max,r=this.geometry.attributes.position,s=r.array;s[0]=n.x,s[1]=n.y,s[2]=n.z,s[3]=t.x,s[4]=n.y,s[5]=n.z,s[6]=t.x,s[7]=t.y,s[8]=n.z,s[9]=n.x,s[10]=t.y,s[11]=n.z,s[12]=n.x,s[13]=n.y,s[14]=t.z,s[15]=t.x,s[16]=n.y,s[17]=t.z,s[18]=t.x,s[19]=t.y,s[20]=t.z,s[21]=n.x,s[22]=t.y,s[23]=t.z,r.needsUpdate=!0,this.geometry.computeBoundingSphere()}setFromObject(e){return this.object=e,this.update(),this}copy(e,t){return super.copy(e,t),this.object=e.object,this}dispose(){this.geometry.dispose(),this.material.dispose()}}class sI extends io{constructor(e,t=16776960){const n=new Uint16Array([0,1,1,2,2,3,3,0,4,5,5,6,6,7,7,4,0,4,1,5,2,6,3,7]),r=[1,1,1,-1,1,1,-1,-1,1,1,-1,1,1,1,-1,-1,1,-1,-1,-1,-1,1,-1,-1],s=new Kt;s.setIndex(new xn(n,1)),s.setAttribute("position",new Tt(r,3)),super(s,new or({color:t,toneMapped:!1})),this.box=e,this.type="Box3Helper",this.geometry.computeBoundingSphere()}updateMatrixWorld(e){const t=this.box;t.isEmpty()||(t.getCenter(this.position),t.getSize(this.scale),this.scale.multiplyScalar(.5),super.updateMatrixWorld(e))}dispose(){this.geometry.dispose(),this.material.dispose()}}class oI extends Ra{constructor(e,t=1,n=16776960){const r=n,s=[1,-1,0,-1,1,0,-1,-1,0,1,1,0,-1,1,0,-1,-1,0,1,-1,0,1,1,0],a=new Kt;a.setAttribute("position",new Tt(s,3)),a.computeBoundingSphere(),super(a,new or({color:r,toneMapped:!1})),this.type="PlaneHelper",this.plane=e,this.size=t;const u=[1,1,0,-1,1,0,-1,-1,0,1,1,0,-1,-1,0,1,-1,0],d=new Kt;d.setAttribute("position",new Tt(u,3)),d.computeBoundingSphere(),this.add(new si(d,new es({color:r,opacity:.2,transparent:!0,depthWrite:!1,toneMapped:!1})))}updateMatrixWorld(e){this.position.set(0,0,0),this.scale.set(.5*this.size,.5*this.size,1),this.lookAt(this.plane.normal),this.translateZ(-this.plane.constant),super.updateMatrixWorld(e)}dispose(){this.geometry.dispose(),this.material.dispose(),this.children[0].geometry.dispose(),this.children[0].material.dispose()}}const qA=new X;let rg,Sy;class aI extends fn{constructor(e=new X(0,0,1),t=new X(0,0,0),n=1,r=16776960,s=n*.2,a=s*.2){super(),this.type="ArrowHelper",rg===void 0&&(rg=new Kt,rg.setAttribute("position",new Tt([0,0,0,0,1,0],3)),Sy=new od(0,.5,1,5,1),Sy.translate(0,-.5,0)),this.position.copy(t),this.line=new Ra(rg,new or({color:r,toneMapped:!1})),this.line.matrixAutoUpdate=!1,this.add(this.line),this.cone=new si(Sy,new es({color:r,toneMapped:!1})),this.cone.matrixAutoUpdate=!1,this.add(this.cone),this.setDirection(e),this.setLength(n,s,a)}setDirection(e){if(e.y>.99999)this.quaternion.set(0,0,0,1);else if(e.y<-.99999)this.quaternion.set(1,0,0,0);else{qA.set(e.z,0,-e.x).normalize();const t=Math.acos(e.y);this.quaternion.setFromAxisAngle(qA,t)}}setLength(e,t=e*.2,n=t*.2){this.line.scale.set(1,Math.max(1e-4,e-t),1),this.line.updateMatrix(),this.cone.scale.set(n,t,n),this.cone.position.y=e,this.cone.updateMatrix()}setColor(e){this.line.material.color.set(e),this.cone.material.color.set(e)}copy(e){return super.copy(e,!1),this.line.copy(e.line),this.cone.copy(e.cone),this}dispose(){this.line.geometry.dispose(),this.line.material.dispose(),this.cone.geometry.dispose(),this.cone.material.dispose()}}class lI extends io{constructor(e=1){const t=[0,0,0,e,0,0,0,0,0,0,e,0,0,0,0,0,0,e],n=[1,0,0,1,.6,0,0,1,0,.6,1,0,0,0,1,0,.6,1],r=new Kt;r.setAttribute("position",new Tt(t,3)),r.setAttribute("color",new Tt(n,3));const s=new or({vertexColors:!0,toneMapped:!1});super(r,s),this.type="AxesHelper"}setColors(e,t,n){const r=new tt,s=this.geometry.attributes.color.array;return r.set(e),r.toArray(s,0),r.toArray(s,3),r.set(t),r.toArray(s,6),r.toArray(s,9),r.set(n),r.toArray(s,12),r.toArray(s,15),this.geometry.attributes.color.needsUpdate=!0,this}dispose(){this.geometry.dispose(),this.material.dispose()}}class uI{constructor(){this.type="ShapePath",this.color=new tt,this.subPaths=[],this.currentPath=null}moveTo(e,t){return this.currentPath=new Xh,this.subPaths.push(this.currentPath),this.currentPath.moveTo(e,t),this}lineTo(e,t){return this.currentPath.lineTo(e,t),this}quadraticCurveTo(e,t,n,r){return this.currentPath.quadraticCurveTo(e,t,n,r),this}bezierCurveTo(e,t,n,r,s,a){return this.currentPath.bezierCurveTo(e,t,n,r,s,a),this}splineThru(e){return this.currentPath.splineThru(e),this}toShapes(e){function t(S){const b=[];for(let R=0,P=S.length;R<P;R++){const U=S[R],F=new Ju;F.curves=U.curves,b.push(F)}return b}function n(S,b){const R=b.length;let P=!1;for(let U=R-1,F=0;F<R;U=F++){let k=b[U],G=b[F],D=G.x-k.x,L=G.y-k.y;if(Math.abs(L)>Number.EPSILON){if(L<0&&(k=b[F],D=-D,G=b[U],L=-L),S.y<k.y||S.y>G.y)continue;if(S.y===k.y){if(S.x===k.x)return!0}else{const V=L*(S.x-k.x)-D*(S.y-k.y);if(V===0)return!0;if(V<0)continue;P=!P}}else{if(S.y!==k.y)continue;if(G.x<=S.x&&S.x<=k.x||k.x<=S.x&&S.x<=G.x)return!0}}return P}const r=wo.isClockWise,s=this.subPaths;if(s.length===0)return[];let a,u,d;const h=[];if(s.length===1)return u=s[0],d=new Ju,d.curves=u.curves,h.push(d),h;let m=!r(s[0].getPoints());m=e?!m:m;const g=[],v=[];let _=[],A=0,C;v[A]=void 0,_[A]=[];for(let S=0,b=s.length;S<b;S++)u=s[S],C=u.getPoints(),a=r(C),a=e?!a:a,a?(!m&&v[A]&&A++,v[A]={s:new Ju,p:C},v[A].s.curves=u.curves,m&&A++,_[A]=[]):_[A].push({h:u,p:C[0]});if(!v[0])return t(s);if(v.length>1){let S=!1,b=0;for(let R=0,P=v.length;R<P;R++)g[R]=[];for(let R=0,P=v.length;R<P;R++){const U=_[R];for(let F=0;F<U.length;F++){const k=U[F];let G=!0;for(let D=0;D<v.length;D++)n(k.p,v[D].p)&&(R!==D&&b++,G?(G=!1,g[D].push(k)):S=!0);G&&g[R].push(k)}}b>0&&S===!1&&(_=g)}let M;for(let S=0,b=v.length;S<b;S++){d=v[S].s,h.push(d),M=_[S];for(let R=0,P=M.length;R<P;R++)d.holes.push(M[R].h)}return h}}class cI extends Io{constructor(e,t=null){super(),this.object=e,this.domElement=t,this.enabled=!0,this.state=-1,this.keys={},this.mouseButtons={LEFT:null,MIDDLE:null,RIGHT:null},this.touches={ONE:null,TWO:null}}connect(){}disconnect(){}dispose(){}update(){}}function fI(i,e){const t=i.image&&i.image.width?i.image.width/i.image.height:1;return t>e?(i.repeat.x=1,i.repeat.y=t/e,i.offset.x=0,i.offset.y=(1-i.repeat.y)/2):(i.repeat.x=e/t,i.repeat.y=1,i.offset.x=(1-i.repeat.x)/2,i.offset.y=0),i}function dI(i,e){const t=i.image&&i.image.width?i.image.width/i.image.height:1;return t>e?(i.repeat.x=e/t,i.repeat.y=1,i.offset.x=(1-i.repeat.x)/2,i.offset.y=0):(i.repeat.x=1,i.repeat.y=t/e,i.offset.x=0,i.offset.y=(1-i.repeat.y)/2),i}function hI(i){return i.repeat.x=1,i.repeat.y=1,i.offset.x=0,i.offset.y=0,i}function __(i,e,t,n){const r=pI(n);switch(t){case W_:return i*e;case j_:return i*e;case J_:return i*e*2;case R0:return i*e/r.components*r.byteLength;case sp:return i*e/r.components*r.byteLength;case K_:return i*e*2/r.components*r.byteLength;case I0:return i*e*2/r.components*r.byteLength;case X_:return i*e*3/r.components*r.byteLength;case rr:return i*e*4/r.components*r.byteLength;case P0:return i*e*4/r.components*r.byteLength;case bh:case Rh:return Math.floor((i+3)/4)*Math.floor((e+3)/4)*8;case Ih:case Ph:return Math.floor((i+3)/4)*Math.floor((e+3)/4)*16;case Ng:case Og:return Math.max(i,16)*Math.max(e,8)/4;case Fg:case Ug:return Math.max(i,8)*Math.max(e,8)/2;case kg:case Hg:return Math.floor((i+3)/4)*Math.floor((e+3)/4)*8;case zg:return Math.floor((i+3)/4)*Math.floor((e+3)/4)*16;case Gg:return Math.floor((i+3)/4)*Math.floor((e+3)/4)*16;case Vg:return Math.floor((i+4)/5)*Math.floor((e+3)/4)*16;case Wg:return Math.floor((i+4)/5)*Math.floor((e+4)/5)*16;case Xg:return Math.floor((i+5)/6)*Math.floor((e+4)/5)*16;case jg:return Math.floor((i+5)/6)*Math.floor((e+5)/6)*16;case Jg:return Math.floor((i+7)/8)*Math.floor((e+4)/5)*16;case Kg:return Math.floor((i+7)/8)*Math.floor((e+5)/6)*16;case Yg:return Math.floor((i+7)/8)*Math.floor((e+7)/8)*16;case Qg:return Math.floor((i+9)/10)*Math.floor((e+4)/5)*16;case qg:return Math.floor((i+9)/10)*Math.floor((e+5)/6)*16;case Zg:return Math.floor((i+9)/10)*Math.floor((e+7)/8)*16;case $g:return Math.floor((i+9)/10)*Math.floor((e+9)/10)*16;case e0:return Math.floor((i+11)/12)*Math.floor((e+9)/10)*16;case t0:return Math.floor((i+11)/12)*Math.floor((e+11)/12)*16;case Bh:case n0:case i0:return Math.ceil(i/4)*Math.ceil(e/4)*16;case Y_:case r0:return Math.ceil(i/4)*Math.ceil(e/4)*8;case s0:case o0:return Math.ceil(i/4)*Math.ceil(e/4)*16}throw new Error(`Unable to determine texture byte length for ${t} format.`)}function pI(i){switch(i){case to:case z_:return{byteLength:1,components:1};case Jf:case G_:case sd:return{byteLength:2,components:1};case T0:case b0:return{byteLength:2,components:4};case ba:case C0:case Or:return{byteLength:4,components:1};case V_:return{byteLength:4,components:3}}throw new Error(`Unknown texture type ${i}.`)}const mI={contain:fI,cover:dI,fill:hI,getByteLength:__};typeof __THREE_DEVTOOLS__<"u"&&__THREE_DEVTOOLS__.dispatchEvent(new CustomEvent("register",{detail:{revision:ip}}));typeof window<"u"&&(window.__THREE__?console.warn("WARNING: Multiple instances of Three.js being imported."):window.__THREE__=ip);/**
 * @license
 * Copyright 2010-2025 Three.js Authors
 * SPDX-License-Identifier: MIT
 */function bE(){let i=null,e=!1,t=null,n=null;function r(s,a){t(s,a),n=i.requestAnimationFrame(r)}return{start:function(){e!==!0&&t!==null&&(n=i.requestAnimationFrame(r),e=!0)},stop:function(){i.cancelAnimationFrame(n),e=!1},setAnimationLoop:function(s){t=s},setContext:function(s){i=s}}}function gI(i){const e=new WeakMap;function t(u,d){const h=u.array,m=u.usage,g=h.byteLength,v=i.createBuffer();i.bindBuffer(d,v),i.bufferData(d,h,m),u.onUploadCallback();let _;if(h instanceof Float32Array)_=i.FLOAT;else if(h instanceof Uint16Array)u.isFloat16BufferAttribute?_=i.HALF_FLOAT:_=i.UNSIGNED_SHORT;else if(h instanceof Int16Array)_=i.SHORT;else if(h instanceof Uint32Array)_=i.UNSIGNED_INT;else if(h instanceof Int32Array)_=i.INT;else if(h instanceof Int8Array)_=i.BYTE;else if(h instanceof Uint8Array)_=i.UNSIGNED_BYTE;else if(h instanceof Uint8ClampedArray)_=i.UNSIGNED_BYTE;else throw new Error("THREE.WebGLAttributes: Unsupported buffer data format: "+h);return{buffer:v,type:_,bytesPerElement:h.BYTES_PER_ELEMENT,version:u.version,size:g}}function n(u,d,h){const m=d.array,g=d.updateRanges;if(i.bindBuffer(h,u),g.length===0)i.bufferSubData(h,0,m);else{g.sort((_,A)=>_.start-A.start);let v=0;for(let _=1;_<g.length;_++){const A=g[v],C=g[_];C.start<=A.start+A.count+1?A.count=Math.max(A.count,C.start+C.count-A.start):(++v,g[v]=C)}g.length=v+1;for(let _=0,A=g.length;_<A;_++){const C=g[_];i.bufferSubData(h,C.start*m.BYTES_PER_ELEMENT,m,C.start,C.count)}d.clearUpdateRanges()}d.onUploadCallback()}function r(u){return u.isInterleavedBufferAttribute&&(u=u.data),e.get(u)}function s(u){u.isInterleavedBufferAttribute&&(u=u.data);const d=e.get(u);d&&(i.deleteBuffer(d.buffer),e.delete(u))}function a(u,d){if(u.isInterleavedBufferAttribute&&(u=u.data),u.isGLBufferAttribute){const m=e.get(u);(!m||m.version<u.version)&&e.set(u,{buffer:u.buffer,type:u.type,bytesPerElement:u.elementSize,version:u.version});return}const h=e.get(u);if(h===void 0)e.set(u,t(u,d));else if(h.version<u.version){if(h.size!==u.array.byteLength)throw new Error("THREE.WebGLAttributes: The size of the buffer attribute's array buffer does not match the original size. Resizing buffer attributes is not supported.");n(h.buffer,u,d),h.version=u.version}}return{get:r,remove:s,update:a}}var vI=`#ifdef USE_ALPHAHASH
	if ( diffuseColor.a < getAlphaHashThreshold( vPosition ) ) discard;
#endif`,yI=`#ifdef USE_ALPHAHASH
	const float ALPHA_HASH_SCALE = 0.05;
	float hash2D( vec2 value ) {
		return fract( 1.0e4 * sin( 17.0 * value.x + 0.1 * value.y ) * ( 0.1 + abs( sin( 13.0 * value.y + value.x ) ) ) );
	}
	float hash3D( vec3 value ) {
		return hash2D( vec2( hash2D( value.xy ), value.z ) );
	}
	float getAlphaHashThreshold( vec3 position ) {
		float maxDeriv = max(
			length( dFdx( position.xyz ) ),
			length( dFdy( position.xyz ) )
		);
		float pixScale = 1.0 / ( ALPHA_HASH_SCALE * maxDeriv );
		vec2 pixScales = vec2(
			exp2( floor( log2( pixScale ) ) ),
			exp2( ceil( log2( pixScale ) ) )
		);
		vec2 alpha = vec2(
			hash3D( floor( pixScales.x * position.xyz ) ),
			hash3D( floor( pixScales.y * position.xyz ) )
		);
		float lerpFactor = fract( log2( pixScale ) );
		float x = ( 1.0 - lerpFactor ) * alpha.x + lerpFactor * alpha.y;
		float a = min( lerpFactor, 1.0 - lerpFactor );
		vec3 cases = vec3(
			x * x / ( 2.0 * a * ( 1.0 - a ) ),
			( x - 0.5 * a ) / ( 1.0 - a ),
			1.0 - ( ( 1.0 - x ) * ( 1.0 - x ) / ( 2.0 * a * ( 1.0 - a ) ) )
		);
		float threshold = ( x < ( 1.0 - a ) )
			? ( ( x < a ) ? cases.x : cases.y )
			: cases.z;
		return clamp( threshold , 1.0e-6, 1.0 );
	}
#endif`,_I=`#ifdef USE_ALPHAMAP
	diffuseColor.a *= texture2D( alphaMap, vAlphaMapUv ).g;
#endif`,xI=`#ifdef USE_ALPHAMAP
	uniform sampler2D alphaMap;
#endif`,AI=`#ifdef USE_ALPHATEST
	#ifdef ALPHA_TO_COVERAGE
	diffuseColor.a = smoothstep( alphaTest, alphaTest + fwidth( diffuseColor.a ), diffuseColor.a );
	if ( diffuseColor.a == 0.0 ) discard;
	#else
	if ( diffuseColor.a < alphaTest ) discard;
	#endif
#endif`,SI=`#ifdef USE_ALPHATEST
	uniform float alphaTest;
#endif`,MI=`#ifdef USE_AOMAP
	float ambientOcclusion = ( texture2D( aoMap, vAoMapUv ).r - 1.0 ) * aoMapIntensity + 1.0;
	reflectedLight.indirectDiffuse *= ambientOcclusion;
	#if defined( USE_CLEARCOAT ) 
		clearcoatSpecularIndirect *= ambientOcclusion;
	#endif
	#if defined( USE_SHEEN ) 
		sheenSpecularIndirect *= ambientOcclusion;
	#endif
	#if defined( USE_ENVMAP ) && defined( STANDARD )
		float dotNV = saturate( dot( geometryNormal, geometryViewDir ) );
		reflectedLight.indirectSpecular *= computeSpecularOcclusion( dotNV, ambientOcclusion, material.roughness );
	#endif
#endif`,EI=`#ifdef USE_AOMAP
	uniform sampler2D aoMap;
	uniform float aoMapIntensity;
#endif`,wI=`#ifdef USE_BATCHING
	#if ! defined( GL_ANGLE_multi_draw )
	#define gl_DrawID _gl_DrawID
	uniform int _gl_DrawID;
	#endif
	uniform highp sampler2D batchingTexture;
	uniform highp usampler2D batchingIdTexture;
	mat4 getBatchingMatrix( const in float i ) {
		int size = textureSize( batchingTexture, 0 ).x;
		int j = int( i ) * 4;
		int x = j % size;
		int y = j / size;
		vec4 v1 = texelFetch( batchingTexture, ivec2( x, y ), 0 );
		vec4 v2 = texelFetch( batchingTexture, ivec2( x + 1, y ), 0 );
		vec4 v3 = texelFetch( batchingTexture, ivec2( x + 2, y ), 0 );
		vec4 v4 = texelFetch( batchingTexture, ivec2( x + 3, y ), 0 );
		return mat4( v1, v2, v3, v4 );
	}
	float getIndirectIndex( const in int i ) {
		int size = textureSize( batchingIdTexture, 0 ).x;
		int x = i % size;
		int y = i / size;
		return float( texelFetch( batchingIdTexture, ivec2( x, y ), 0 ).r );
	}
#endif
#ifdef USE_BATCHING_COLOR
	uniform sampler2D batchingColorTexture;
	vec3 getBatchingColor( const in float i ) {
		int size = textureSize( batchingColorTexture, 0 ).x;
		int j = int( i );
		int x = j % size;
		int y = j / size;
		return texelFetch( batchingColorTexture, ivec2( x, y ), 0 ).rgb;
	}
#endif`,CI=`#ifdef USE_BATCHING
	mat4 batchingMatrix = getBatchingMatrix( getIndirectIndex( gl_DrawID ) );
#endif`,TI=`vec3 transformed = vec3( position );
#ifdef USE_ALPHAHASH
	vPosition = vec3( position );
#endif`,bI=`vec3 objectNormal = vec3( normal );
#ifdef USE_TANGENT
	vec3 objectTangent = vec3( tangent.xyz );
#endif`,RI=`float G_BlinnPhong_Implicit( ) {
	return 0.25;
}
float D_BlinnPhong( const in float shininess, const in float dotNH ) {
	return RECIPROCAL_PI * ( shininess * 0.5 + 1.0 ) * pow( dotNH, shininess );
}
vec3 BRDF_BlinnPhong( const in vec3 lightDir, const in vec3 viewDir, const in vec3 normal, const in vec3 specularColor, const in float shininess ) {
	vec3 halfDir = normalize( lightDir + viewDir );
	float dotNH = saturate( dot( normal, halfDir ) );
	float dotVH = saturate( dot( viewDir, halfDir ) );
	vec3 F = F_Schlick( specularColor, 1.0, dotVH );
	float G = G_BlinnPhong_Implicit( );
	float D = D_BlinnPhong( shininess, dotNH );
	return F * ( G * D );
} // validated`,II=`#ifdef USE_IRIDESCENCE
	const mat3 XYZ_TO_REC709 = mat3(
		 3.2404542, -0.9692660,  0.0556434,
		-1.5371385,  1.8760108, -0.2040259,
		-0.4985314,  0.0415560,  1.0572252
	);
	vec3 Fresnel0ToIor( vec3 fresnel0 ) {
		vec3 sqrtF0 = sqrt( fresnel0 );
		return ( vec3( 1.0 ) + sqrtF0 ) / ( vec3( 1.0 ) - sqrtF0 );
	}
	vec3 IorToFresnel0( vec3 transmittedIor, float incidentIor ) {
		return pow2( ( transmittedIor - vec3( incidentIor ) ) / ( transmittedIor + vec3( incidentIor ) ) );
	}
	float IorToFresnel0( float transmittedIor, float incidentIor ) {
		return pow2( ( transmittedIor - incidentIor ) / ( transmittedIor + incidentIor ));
	}
	vec3 evalSensitivity( float OPD, vec3 shift ) {
		float phase = 2.0 * PI * OPD * 1.0e-9;
		vec3 val = vec3( 5.4856e-13, 4.4201e-13, 5.2481e-13 );
		vec3 pos = vec3( 1.6810e+06, 1.7953e+06, 2.2084e+06 );
		vec3 var = vec3( 4.3278e+09, 9.3046e+09, 6.6121e+09 );
		vec3 xyz = val * sqrt( 2.0 * PI * var ) * cos( pos * phase + shift ) * exp( - pow2( phase ) * var );
		xyz.x += 9.7470e-14 * sqrt( 2.0 * PI * 4.5282e+09 ) * cos( 2.2399e+06 * phase + shift[ 0 ] ) * exp( - 4.5282e+09 * pow2( phase ) );
		xyz /= 1.0685e-7;
		vec3 rgb = XYZ_TO_REC709 * xyz;
		return rgb;
	}
	vec3 evalIridescence( float outsideIOR, float eta2, float cosTheta1, float thinFilmThickness, vec3 baseF0 ) {
		vec3 I;
		float iridescenceIOR = mix( outsideIOR, eta2, smoothstep( 0.0, 0.03, thinFilmThickness ) );
		float sinTheta2Sq = pow2( outsideIOR / iridescenceIOR ) * ( 1.0 - pow2( cosTheta1 ) );
		float cosTheta2Sq = 1.0 - sinTheta2Sq;
		if ( cosTheta2Sq < 0.0 ) {
			return vec3( 1.0 );
		}
		float cosTheta2 = sqrt( cosTheta2Sq );
		float R0 = IorToFresnel0( iridescenceIOR, outsideIOR );
		float R12 = F_Schlick( R0, 1.0, cosTheta1 );
		float T121 = 1.0 - R12;
		float phi12 = 0.0;
		if ( iridescenceIOR < outsideIOR ) phi12 = PI;
		float phi21 = PI - phi12;
		vec3 baseIOR = Fresnel0ToIor( clamp( baseF0, 0.0, 0.9999 ) );		vec3 R1 = IorToFresnel0( baseIOR, iridescenceIOR );
		vec3 R23 = F_Schlick( R1, 1.0, cosTheta2 );
		vec3 phi23 = vec3( 0.0 );
		if ( baseIOR[ 0 ] < iridescenceIOR ) phi23[ 0 ] = PI;
		if ( baseIOR[ 1 ] < iridescenceIOR ) phi23[ 1 ] = PI;
		if ( baseIOR[ 2 ] < iridescenceIOR ) phi23[ 2 ] = PI;
		float OPD = 2.0 * iridescenceIOR * thinFilmThickness * cosTheta2;
		vec3 phi = vec3( phi21 ) + phi23;
		vec3 R123 = clamp( R12 * R23, 1e-5, 0.9999 );
		vec3 r123 = sqrt( R123 );
		vec3 Rs = pow2( T121 ) * R23 / ( vec3( 1.0 ) - R123 );
		vec3 C0 = R12 + Rs;
		I = C0;
		vec3 Cm = Rs - T121;
		for ( int m = 1; m <= 2; ++ m ) {
			Cm *= r123;
			vec3 Sm = 2.0 * evalSensitivity( float( m ) * OPD, float( m ) * phi );
			I += Cm * Sm;
		}
		return max( I, vec3( 0.0 ) );
	}
#endif`,PI=`#ifdef USE_BUMPMAP
	uniform sampler2D bumpMap;
	uniform float bumpScale;
	vec2 dHdxy_fwd() {
		vec2 dSTdx = dFdx( vBumpMapUv );
		vec2 dSTdy = dFdy( vBumpMapUv );
		float Hll = bumpScale * texture2D( bumpMap, vBumpMapUv ).x;
		float dBx = bumpScale * texture2D( bumpMap, vBumpMapUv + dSTdx ).x - Hll;
		float dBy = bumpScale * texture2D( bumpMap, vBumpMapUv + dSTdy ).x - Hll;
		return vec2( dBx, dBy );
	}
	vec3 perturbNormalArb( vec3 surf_pos, vec3 surf_norm, vec2 dHdxy, float faceDirection ) {
		vec3 vSigmaX = normalize( dFdx( surf_pos.xyz ) );
		vec3 vSigmaY = normalize( dFdy( surf_pos.xyz ) );
		vec3 vN = surf_norm;
		vec3 R1 = cross( vSigmaY, vN );
		vec3 R2 = cross( vN, vSigmaX );
		float fDet = dot( vSigmaX, R1 ) * faceDirection;
		vec3 vGrad = sign( fDet ) * ( dHdxy.x * R1 + dHdxy.y * R2 );
		return normalize( abs( fDet ) * surf_norm - vGrad );
	}
#endif`,BI=`#if NUM_CLIPPING_PLANES > 0
	vec4 plane;
	#ifdef ALPHA_TO_COVERAGE
		float distanceToPlane, distanceGradient;
		float clipOpacity = 1.0;
		#pragma unroll_loop_start
		for ( int i = 0; i < UNION_CLIPPING_PLANES; i ++ ) {
			plane = clippingPlanes[ i ];
			distanceToPlane = - dot( vClipPosition, plane.xyz ) + plane.w;
			distanceGradient = fwidth( distanceToPlane ) / 2.0;
			clipOpacity *= smoothstep( - distanceGradient, distanceGradient, distanceToPlane );
			if ( clipOpacity == 0.0 ) discard;
		}
		#pragma unroll_loop_end
		#if UNION_CLIPPING_PLANES < NUM_CLIPPING_PLANES
			float unionClipOpacity = 1.0;
			#pragma unroll_loop_start
			for ( int i = UNION_CLIPPING_PLANES; i < NUM_CLIPPING_PLANES; i ++ ) {
				plane = clippingPlanes[ i ];
				distanceToPlane = - dot( vClipPosition, plane.xyz ) + plane.w;
				distanceGradient = fwidth( distanceToPlane ) / 2.0;
				unionClipOpacity *= 1.0 - smoothstep( - distanceGradient, distanceGradient, distanceToPlane );
			}
			#pragma unroll_loop_end
			clipOpacity *= 1.0 - unionClipOpacity;
		#endif
		diffuseColor.a *= clipOpacity;
		if ( diffuseColor.a == 0.0 ) discard;
	#else
		#pragma unroll_loop_start
		for ( int i = 0; i < UNION_CLIPPING_PLANES; i ++ ) {
			plane = clippingPlanes[ i ];
			if ( dot( vClipPosition, plane.xyz ) > plane.w ) discard;
		}
		#pragma unroll_loop_end
		#if UNION_CLIPPING_PLANES < NUM_CLIPPING_PLANES
			bool clipped = true;
			#pragma unroll_loop_start
			for ( int i = UNION_CLIPPING_PLANES; i < NUM_CLIPPING_PLANES; i ++ ) {
				plane = clippingPlanes[ i ];
				clipped = ( dot( vClipPosition, plane.xyz ) > plane.w ) && clipped;
			}
			#pragma unroll_loop_end
			if ( clipped ) discard;
		#endif
	#endif
#endif`,LI=`#if NUM_CLIPPING_PLANES > 0
	varying vec3 vClipPosition;
	uniform vec4 clippingPlanes[ NUM_CLIPPING_PLANES ];
#endif`,DI=`#if NUM_CLIPPING_PLANES > 0
	varying vec3 vClipPosition;
#endif`,FI=`#if NUM_CLIPPING_PLANES > 0
	vClipPosition = - mvPosition.xyz;
#endif`,NI=`#if defined( USE_COLOR_ALPHA )
	diffuseColor *= vColor;
#elif defined( USE_COLOR )
	diffuseColor.rgb *= vColor;
#endif`,UI=`#if defined( USE_COLOR_ALPHA )
	varying vec4 vColor;
#elif defined( USE_COLOR )
	varying vec3 vColor;
#endif`,OI=`#if defined( USE_COLOR_ALPHA )
	varying vec4 vColor;
#elif defined( USE_COLOR ) || defined( USE_INSTANCING_COLOR ) || defined( USE_BATCHING_COLOR )
	varying vec3 vColor;
#endif`,kI=`#if defined( USE_COLOR_ALPHA )
	vColor = vec4( 1.0 );
#elif defined( USE_COLOR ) || defined( USE_INSTANCING_COLOR ) || defined( USE_BATCHING_COLOR )
	vColor = vec3( 1.0 );
#endif
#ifdef USE_COLOR
	vColor *= color;
#endif
#ifdef USE_INSTANCING_COLOR
	vColor.xyz *= instanceColor.xyz;
#endif
#ifdef USE_BATCHING_COLOR
	vec3 batchingColor = getBatchingColor( getIndirectIndex( gl_DrawID ) );
	vColor.xyz *= batchingColor.xyz;
#endif`,HI=`#define PI 3.141592653589793
#define PI2 6.283185307179586
#define PI_HALF 1.5707963267948966
#define RECIPROCAL_PI 0.3183098861837907
#define RECIPROCAL_PI2 0.15915494309189535
#define EPSILON 1e-6
#ifndef saturate
#define saturate( a ) clamp( a, 0.0, 1.0 )
#endif
#define whiteComplement( a ) ( 1.0 - saturate( a ) )
float pow2( const in float x ) { return x*x; }
vec3 pow2( const in vec3 x ) { return x*x; }
float pow3( const in float x ) { return x*x*x; }
float pow4( const in float x ) { float x2 = x*x; return x2*x2; }
float max3( const in vec3 v ) { return max( max( v.x, v.y ), v.z ); }
float average( const in vec3 v ) { return dot( v, vec3( 0.3333333 ) ); }
highp float rand( const in vec2 uv ) {
	const highp float a = 12.9898, b = 78.233, c = 43758.5453;
	highp float dt = dot( uv.xy, vec2( a,b ) ), sn = mod( dt, PI );
	return fract( sin( sn ) * c );
}
#ifdef HIGH_PRECISION
	float precisionSafeLength( vec3 v ) { return length( v ); }
#else
	float precisionSafeLength( vec3 v ) {
		float maxComponent = max3( abs( v ) );
		return length( v / maxComponent ) * maxComponent;
	}
#endif
struct IncidentLight {
	vec3 color;
	vec3 direction;
	bool visible;
};
struct ReflectedLight {
	vec3 directDiffuse;
	vec3 directSpecular;
	vec3 indirectDiffuse;
	vec3 indirectSpecular;
};
#ifdef USE_ALPHAHASH
	varying vec3 vPosition;
#endif
vec3 transformDirection( in vec3 dir, in mat4 matrix ) {
	return normalize( ( matrix * vec4( dir, 0.0 ) ).xyz );
}
vec3 inverseTransformDirection( in vec3 dir, in mat4 matrix ) {
	return normalize( ( vec4( dir, 0.0 ) * matrix ).xyz );
}
mat3 transposeMat3( const in mat3 m ) {
	mat3 tmp;
	tmp[ 0 ] = vec3( m[ 0 ].x, m[ 1 ].x, m[ 2 ].x );
	tmp[ 1 ] = vec3( m[ 0 ].y, m[ 1 ].y, m[ 2 ].y );
	tmp[ 2 ] = vec3( m[ 0 ].z, m[ 1 ].z, m[ 2 ].z );
	return tmp;
}
bool isPerspectiveMatrix( mat4 m ) {
	return m[ 2 ][ 3 ] == - 1.0;
}
vec2 equirectUv( in vec3 dir ) {
	float u = atan( dir.z, dir.x ) * RECIPROCAL_PI2 + 0.5;
	float v = asin( clamp( dir.y, - 1.0, 1.0 ) ) * RECIPROCAL_PI + 0.5;
	return vec2( u, v );
}
vec3 BRDF_Lambert( const in vec3 diffuseColor ) {
	return RECIPROCAL_PI * diffuseColor;
}
vec3 F_Schlick( const in vec3 f0, const in float f90, const in float dotVH ) {
	float fresnel = exp2( ( - 5.55473 * dotVH - 6.98316 ) * dotVH );
	return f0 * ( 1.0 - fresnel ) + ( f90 * fresnel );
}
float F_Schlick( const in float f0, const in float f90, const in float dotVH ) {
	float fresnel = exp2( ( - 5.55473 * dotVH - 6.98316 ) * dotVH );
	return f0 * ( 1.0 - fresnel ) + ( f90 * fresnel );
} // validated`,zI=`#ifdef ENVMAP_TYPE_CUBE_UV
	#define cubeUV_minMipLevel 4.0
	#define cubeUV_minTileSize 16.0
	float getFace( vec3 direction ) {
		vec3 absDirection = abs( direction );
		float face = - 1.0;
		if ( absDirection.x > absDirection.z ) {
			if ( absDirection.x > absDirection.y )
				face = direction.x > 0.0 ? 0.0 : 3.0;
			else
				face = direction.y > 0.0 ? 1.0 : 4.0;
		} else {
			if ( absDirection.z > absDirection.y )
				face = direction.z > 0.0 ? 2.0 : 5.0;
			else
				face = direction.y > 0.0 ? 1.0 : 4.0;
		}
		return face;
	}
	vec2 getUV( vec3 direction, float face ) {
		vec2 uv;
		if ( face == 0.0 ) {
			uv = vec2( direction.z, direction.y ) / abs( direction.x );
		} else if ( face == 1.0 ) {
			uv = vec2( - direction.x, - direction.z ) / abs( direction.y );
		} else if ( face == 2.0 ) {
			uv = vec2( - direction.x, direction.y ) / abs( direction.z );
		} else if ( face == 3.0 ) {
			uv = vec2( - direction.z, direction.y ) / abs( direction.x );
		} else if ( face == 4.0 ) {
			uv = vec2( - direction.x, direction.z ) / abs( direction.y );
		} else {
			uv = vec2( direction.x, direction.y ) / abs( direction.z );
		}
		return 0.5 * ( uv + 1.0 );
	}
	vec3 bilinearCubeUV( sampler2D envMap, vec3 direction, float mipInt ) {
		float face = getFace( direction );
		float filterInt = max( cubeUV_minMipLevel - mipInt, 0.0 );
		mipInt = max( mipInt, cubeUV_minMipLevel );
		float faceSize = exp2( mipInt );
		highp vec2 uv = getUV( direction, face ) * ( faceSize - 2.0 ) + 1.0;
		if ( face > 2.0 ) {
			uv.y += faceSize;
			face -= 3.0;
		}
		uv.x += face * faceSize;
		uv.x += filterInt * 3.0 * cubeUV_minTileSize;
		uv.y += 4.0 * ( exp2( CUBEUV_MAX_MIP ) - faceSize );
		uv.x *= CUBEUV_TEXEL_WIDTH;
		uv.y *= CUBEUV_TEXEL_HEIGHT;
		#ifdef texture2DGradEXT
			return texture2DGradEXT( envMap, uv, vec2( 0.0 ), vec2( 0.0 ) ).rgb;
		#else
			return texture2D( envMap, uv ).rgb;
		#endif
	}
	#define cubeUV_r0 1.0
	#define cubeUV_m0 - 2.0
	#define cubeUV_r1 0.8
	#define cubeUV_m1 - 1.0
	#define cubeUV_r4 0.4
	#define cubeUV_m4 2.0
	#define cubeUV_r5 0.305
	#define cubeUV_m5 3.0
	#define cubeUV_r6 0.21
	#define cubeUV_m6 4.0
	float roughnessToMip( float roughness ) {
		float mip = 0.0;
		if ( roughness >= cubeUV_r1 ) {
			mip = ( cubeUV_r0 - roughness ) * ( cubeUV_m1 - cubeUV_m0 ) / ( cubeUV_r0 - cubeUV_r1 ) + cubeUV_m0;
		} else if ( roughness >= cubeUV_r4 ) {
			mip = ( cubeUV_r1 - roughness ) * ( cubeUV_m4 - cubeUV_m1 ) / ( cubeUV_r1 - cubeUV_r4 ) + cubeUV_m1;
		} else if ( roughness >= cubeUV_r5 ) {
			mip = ( cubeUV_r4 - roughness ) * ( cubeUV_m5 - cubeUV_m4 ) / ( cubeUV_r4 - cubeUV_r5 ) + cubeUV_m4;
		} else if ( roughness >= cubeUV_r6 ) {
			mip = ( cubeUV_r5 - roughness ) * ( cubeUV_m6 - cubeUV_m5 ) / ( cubeUV_r5 - cubeUV_r6 ) + cubeUV_m5;
		} else {
			mip = - 2.0 * log2( 1.16 * roughness );		}
		return mip;
	}
	vec4 textureCubeUV( sampler2D envMap, vec3 sampleDir, float roughness ) {
		float mip = clamp( roughnessToMip( roughness ), cubeUV_m0, CUBEUV_MAX_MIP );
		float mipF = fract( mip );
		float mipInt = floor( mip );
		vec3 color0 = bilinearCubeUV( envMap, sampleDir, mipInt );
		if ( mipF == 0.0 ) {
			return vec4( color0, 1.0 );
		} else {
			vec3 color1 = bilinearCubeUV( envMap, sampleDir, mipInt + 1.0 );
			return vec4( mix( color0, color1, mipF ), 1.0 );
		}
	}
#endif`,GI=`vec3 transformedNormal = objectNormal;
#ifdef USE_TANGENT
	vec3 transformedTangent = objectTangent;
#endif
#ifdef USE_BATCHING
	mat3 bm = mat3( batchingMatrix );
	transformedNormal /= vec3( dot( bm[ 0 ], bm[ 0 ] ), dot( bm[ 1 ], bm[ 1 ] ), dot( bm[ 2 ], bm[ 2 ] ) );
	transformedNormal = bm * transformedNormal;
	#ifdef USE_TANGENT
		transformedTangent = bm * transformedTangent;
	#endif
#endif
#ifdef USE_INSTANCING
	mat3 im = mat3( instanceMatrix );
	transformedNormal /= vec3( dot( im[ 0 ], im[ 0 ] ), dot( im[ 1 ], im[ 1 ] ), dot( im[ 2 ], im[ 2 ] ) );
	transformedNormal = im * transformedNormal;
	#ifdef USE_TANGENT
		transformedTangent = im * transformedTangent;
	#endif
#endif
transformedNormal = normalMatrix * transformedNormal;
#ifdef FLIP_SIDED
	transformedNormal = - transformedNormal;
#endif
#ifdef USE_TANGENT
	transformedTangent = ( modelViewMatrix * vec4( transformedTangent, 0.0 ) ).xyz;
	#ifdef FLIP_SIDED
		transformedTangent = - transformedTangent;
	#endif
#endif`,VI=`#ifdef USE_DISPLACEMENTMAP
	uniform sampler2D displacementMap;
	uniform float displacementScale;
	uniform float displacementBias;
#endif`,WI=`#ifdef USE_DISPLACEMENTMAP
	transformed += normalize( objectNormal ) * ( texture2D( displacementMap, vDisplacementMapUv ).x * displacementScale + displacementBias );
#endif`,XI=`#ifdef USE_EMISSIVEMAP
	vec4 emissiveColor = texture2D( emissiveMap, vEmissiveMapUv );
	#ifdef DECODE_VIDEO_TEXTURE_EMISSIVE
		emissiveColor = sRGBTransferEOTF( emissiveColor );
	#endif
	totalEmissiveRadiance *= emissiveColor.rgb;
#endif`,jI=`#ifdef USE_EMISSIVEMAP
	uniform sampler2D emissiveMap;
#endif`,JI="gl_FragColor = linearToOutputTexel( gl_FragColor );",KI=`vec4 LinearTransferOETF( in vec4 value ) {
	return value;
}
vec4 sRGBTransferEOTF( in vec4 value ) {
	return vec4( mix( pow( value.rgb * 0.9478672986 + vec3( 0.0521327014 ), vec3( 2.4 ) ), value.rgb * 0.0773993808, vec3( lessThanEqual( value.rgb, vec3( 0.04045 ) ) ) ), value.a );
}
vec4 sRGBTransferOETF( in vec4 value ) {
	return vec4( mix( pow( value.rgb, vec3( 0.41666 ) ) * 1.055 - vec3( 0.055 ), value.rgb * 12.92, vec3( lessThanEqual( value.rgb, vec3( 0.0031308 ) ) ) ), value.a );
}`,YI=`#ifdef USE_ENVMAP
	#ifdef ENV_WORLDPOS
		vec3 cameraToFrag;
		if ( isOrthographic ) {
			cameraToFrag = normalize( vec3( - viewMatrix[ 0 ][ 2 ], - viewMatrix[ 1 ][ 2 ], - viewMatrix[ 2 ][ 2 ] ) );
		} else {
			cameraToFrag = normalize( vWorldPosition - cameraPosition );
		}
		vec3 worldNormal = inverseTransformDirection( normal, viewMatrix );
		#ifdef ENVMAP_MODE_REFLECTION
			vec3 reflectVec = reflect( cameraToFrag, worldNormal );
		#else
			vec3 reflectVec = refract( cameraToFrag, worldNormal, refractionRatio );
		#endif
	#else
		vec3 reflectVec = vReflect;
	#endif
	#ifdef ENVMAP_TYPE_CUBE
		vec4 envColor = textureCube( envMap, envMapRotation * vec3( flipEnvMap * reflectVec.x, reflectVec.yz ) );
	#else
		vec4 envColor = vec4( 0.0 );
	#endif
	#ifdef ENVMAP_BLENDING_MULTIPLY
		outgoingLight = mix( outgoingLight, outgoingLight * envColor.xyz, specularStrength * reflectivity );
	#elif defined( ENVMAP_BLENDING_MIX )
		outgoingLight = mix( outgoingLight, envColor.xyz, specularStrength * reflectivity );
	#elif defined( ENVMAP_BLENDING_ADD )
		outgoingLight += envColor.xyz * specularStrength * reflectivity;
	#endif
#endif`,QI=`#ifdef USE_ENVMAP
	uniform float envMapIntensity;
	uniform float flipEnvMap;
	uniform mat3 envMapRotation;
	#ifdef ENVMAP_TYPE_CUBE
		uniform samplerCube envMap;
	#else
		uniform sampler2D envMap;
	#endif
	
#endif`,qI=`#ifdef USE_ENVMAP
	uniform float reflectivity;
	#if defined( USE_BUMPMAP ) || defined( USE_NORMALMAP ) || defined( PHONG ) || defined( LAMBERT )
		#define ENV_WORLDPOS
	#endif
	#ifdef ENV_WORLDPOS
		varying vec3 vWorldPosition;
		uniform float refractionRatio;
	#else
		varying vec3 vReflect;
	#endif
#endif`,ZI=`#ifdef USE_ENVMAP
	#if defined( USE_BUMPMAP ) || defined( USE_NORMALMAP ) || defined( PHONG ) || defined( LAMBERT )
		#define ENV_WORLDPOS
	#endif
	#ifdef ENV_WORLDPOS
		
		varying vec3 vWorldPosition;
	#else
		varying vec3 vReflect;
		uniform float refractionRatio;
	#endif
#endif`,$I=`#ifdef USE_ENVMAP
	#ifdef ENV_WORLDPOS
		vWorldPosition = worldPosition.xyz;
	#else
		vec3 cameraToVertex;
		if ( isOrthographic ) {
			cameraToVertex = normalize( vec3( - viewMatrix[ 0 ][ 2 ], - viewMatrix[ 1 ][ 2 ], - viewMatrix[ 2 ][ 2 ] ) );
		} else {
			cameraToVertex = normalize( worldPosition.xyz - cameraPosition );
		}
		vec3 worldNormal = inverseTransformDirection( transformedNormal, viewMatrix );
		#ifdef ENVMAP_MODE_REFLECTION
			vReflect = reflect( cameraToVertex, worldNormal );
		#else
			vReflect = refract( cameraToVertex, worldNormal, refractionRatio );
		#endif
	#endif
#endif`,eP=`#ifdef USE_FOG
	vFogDepth = - mvPosition.z;
#endif`,tP=`#ifdef USE_FOG
	varying float vFogDepth;
#endif`,nP=`#ifdef USE_FOG
	#ifdef FOG_EXP2
		float fogFactor = 1.0 - exp( - fogDensity * fogDensity * vFogDepth * vFogDepth );
	#else
		float fogFactor = smoothstep( fogNear, fogFar, vFogDepth );
	#endif
	gl_FragColor.rgb = mix( gl_FragColor.rgb, fogColor, fogFactor );
#endif`,iP=`#ifdef USE_FOG
	uniform vec3 fogColor;
	varying float vFogDepth;
	#ifdef FOG_EXP2
		uniform float fogDensity;
	#else
		uniform float fogNear;
		uniform float fogFar;
	#endif
#endif`,rP=`#ifdef USE_GRADIENTMAP
	uniform sampler2D gradientMap;
#endif
vec3 getGradientIrradiance( vec3 normal, vec3 lightDirection ) {
	float dotNL = dot( normal, lightDirection );
	vec2 coord = vec2( dotNL * 0.5 + 0.5, 0.0 );
	#ifdef USE_GRADIENTMAP
		return vec3( texture2D( gradientMap, coord ).r );
	#else
		vec2 fw = fwidth( coord ) * 0.5;
		return mix( vec3( 0.7 ), vec3( 1.0 ), smoothstep( 0.7 - fw.x, 0.7 + fw.x, coord.x ) );
	#endif
}`,sP=`#ifdef USE_LIGHTMAP
	uniform sampler2D lightMap;
	uniform float lightMapIntensity;
#endif`,oP=`LambertMaterial material;
material.diffuseColor = diffuseColor.rgb;
material.specularStrength = specularStrength;`,aP=`varying vec3 vViewPosition;
struct LambertMaterial {
	vec3 diffuseColor;
	float specularStrength;
};
void RE_Direct_Lambert( const in IncidentLight directLight, const in vec3 geometryPosition, const in vec3 geometryNormal, const in vec3 geometryViewDir, const in vec3 geometryClearcoatNormal, const in LambertMaterial material, inout ReflectedLight reflectedLight ) {
	float dotNL = saturate( dot( geometryNormal, directLight.direction ) );
	vec3 irradiance = dotNL * directLight.color;
	reflectedLight.directDiffuse += irradiance * BRDF_Lambert( material.diffuseColor );
}
void RE_IndirectDiffuse_Lambert( const in vec3 irradiance, const in vec3 geometryPosition, const in vec3 geometryNormal, const in vec3 geometryViewDir, const in vec3 geometryClearcoatNormal, const in LambertMaterial material, inout ReflectedLight reflectedLight ) {
	reflectedLight.indirectDiffuse += irradiance * BRDF_Lambert( material.diffuseColor );
}
#define RE_Direct				RE_Direct_Lambert
#define RE_IndirectDiffuse		RE_IndirectDiffuse_Lambert`,lP=`uniform bool receiveShadow;
uniform vec3 ambientLightColor;
#if defined( USE_LIGHT_PROBES )
	uniform vec3 lightProbe[ 9 ];
#endif
vec3 shGetIrradianceAt( in vec3 normal, in vec3 shCoefficients[ 9 ] ) {
	float x = normal.x, y = normal.y, z = normal.z;
	vec3 result = shCoefficients[ 0 ] * 0.886227;
	result += shCoefficients[ 1 ] * 2.0 * 0.511664 * y;
	result += shCoefficients[ 2 ] * 2.0 * 0.511664 * z;
	result += shCoefficients[ 3 ] * 2.0 * 0.511664 * x;
	result += shCoefficients[ 4 ] * 2.0 * 0.429043 * x * y;
	result += shCoefficients[ 5 ] * 2.0 * 0.429043 * y * z;
	result += shCoefficients[ 6 ] * ( 0.743125 * z * z - 0.247708 );
	result += shCoefficients[ 7 ] * 2.0 * 0.429043 * x * z;
	result += shCoefficients[ 8 ] * 0.429043 * ( x * x - y * y );
	return result;
}
vec3 getLightProbeIrradiance( const in vec3 lightProbe[ 9 ], const in vec3 normal ) {
	vec3 worldNormal = inverseTransformDirection( normal, viewMatrix );
	vec3 irradiance = shGetIrradianceAt( worldNormal, lightProbe );
	return irradiance;
}
vec3 getAmbientLightIrradiance( const in vec3 ambientLightColor ) {
	vec3 irradiance = ambientLightColor;
	return irradiance;
}
float getDistanceAttenuation( const in float lightDistance, const in float cutoffDistance, const in float decayExponent ) {
	float distanceFalloff = 1.0 / max( pow( lightDistance, decayExponent ), 0.01 );
	if ( cutoffDistance > 0.0 ) {
		distanceFalloff *= pow2( saturate( 1.0 - pow4( lightDistance / cutoffDistance ) ) );
	}
	return distanceFalloff;
}
float getSpotAttenuation( const in float coneCosine, const in float penumbraCosine, const in float angleCosine ) {
	return smoothstep( coneCosine, penumbraCosine, angleCosine );
}
#if NUM_DIR_LIGHTS > 0
	struct DirectionalLight {
		vec3 direction;
		vec3 color;
	};
	uniform DirectionalLight directionalLights[ NUM_DIR_LIGHTS ];
	void getDirectionalLightInfo( const in DirectionalLight directionalLight, out IncidentLight light ) {
		light.color = directionalLight.color;
		light.direction = directionalLight.direction;
		light.visible = true;
	}
#endif
#if NUM_POINT_LIGHTS > 0
	struct PointLight {
		vec3 position;
		vec3 color;
		float distance;
		float decay;
	};
	uniform PointLight pointLights[ NUM_POINT_LIGHTS ];
	void getPointLightInfo( const in PointLight pointLight, const in vec3 geometryPosition, out IncidentLight light ) {
		vec3 lVector = pointLight.position - geometryPosition;
		light.direction = normalize( lVector );
		float lightDistance = length( lVector );
		light.color = pointLight.color;
		light.color *= getDistanceAttenuation( lightDistance, pointLight.distance, pointLight.decay );
		light.visible = ( light.color != vec3( 0.0 ) );
	}
#endif
#if NUM_SPOT_LIGHTS > 0
	struct SpotLight {
		vec3 position;
		vec3 direction;
		vec3 color;
		float distance;
		float decay;
		float coneCos;
		float penumbraCos;
	};
	uniform SpotLight spotLights[ NUM_SPOT_LIGHTS ];
	void getSpotLightInfo( const in SpotLight spotLight, const in vec3 geometryPosition, out IncidentLight light ) {
		vec3 lVector = spotLight.position - geometryPosition;
		light.direction = normalize( lVector );
		float angleCos = dot( light.direction, spotLight.direction );
		float spotAttenuation = getSpotAttenuation( spotLight.coneCos, spotLight.penumbraCos, angleCos );
		if ( spotAttenuation > 0.0 ) {
			float lightDistance = length( lVector );
			light.color = spotLight.color * spotAttenuation;
			light.color *= getDistanceAttenuation( lightDistance, spotLight.distance, spotLight.decay );
			light.visible = ( light.color != vec3( 0.0 ) );
		} else {
			light.color = vec3( 0.0 );
			light.visible = false;
		}
	}
#endif
#if NUM_RECT_AREA_LIGHTS > 0
	struct RectAreaLight {
		vec3 color;
		vec3 position;
		vec3 halfWidth;
		vec3 halfHeight;
	};
	uniform sampler2D ltc_1;	uniform sampler2D ltc_2;
	uniform RectAreaLight rectAreaLights[ NUM_RECT_AREA_LIGHTS ];
#endif
#if NUM_HEMI_LIGHTS > 0
	struct HemisphereLight {
		vec3 direction;
		vec3 skyColor;
		vec3 groundColor;
	};
	uniform HemisphereLight hemisphereLights[ NUM_HEMI_LIGHTS ];
	vec3 getHemisphereLightIrradiance( const in HemisphereLight hemiLight, const in vec3 normal ) {
		float dotNL = dot( normal, hemiLight.direction );
		float hemiDiffuseWeight = 0.5 * dotNL + 0.5;
		vec3 irradiance = mix( hemiLight.groundColor, hemiLight.skyColor, hemiDiffuseWeight );
		return irradiance;
	}
#endif`,uP=`#ifdef USE_ENVMAP
	vec3 getIBLIrradiance( const in vec3 normal ) {
		#ifdef ENVMAP_TYPE_CUBE_UV
			vec3 worldNormal = inverseTransformDirection( normal, viewMatrix );
			vec4 envMapColor = textureCubeUV( envMap, envMapRotation * worldNormal, 1.0 );
			return PI * envMapColor.rgb * envMapIntensity;
		#else
			return vec3( 0.0 );
		#endif
	}
	vec3 getIBLRadiance( const in vec3 viewDir, const in vec3 normal, const in float roughness ) {
		#ifdef ENVMAP_TYPE_CUBE_UV
			vec3 reflectVec = reflect( - viewDir, normal );
			reflectVec = normalize( mix( reflectVec, normal, roughness * roughness) );
			reflectVec = inverseTransformDirection( reflectVec, viewMatrix );
			vec4 envMapColor = textureCubeUV( envMap, envMapRotation * reflectVec, roughness );
			return envMapColor.rgb * envMapIntensity;
		#else
			return vec3( 0.0 );
		#endif
	}
	#ifdef USE_ANISOTROPY
		vec3 getIBLAnisotropyRadiance( const in vec3 viewDir, const in vec3 normal, const in float roughness, const in vec3 bitangent, const in float anisotropy ) {
			#ifdef ENVMAP_TYPE_CUBE_UV
				vec3 bentNormal = cross( bitangent, viewDir );
				bentNormal = normalize( cross( bentNormal, bitangent ) );
				bentNormal = normalize( mix( bentNormal, normal, pow2( pow2( 1.0 - anisotropy * ( 1.0 - roughness ) ) ) ) );
				return getIBLRadiance( viewDir, bentNormal, roughness );
			#else
				return vec3( 0.0 );
			#endif
		}
	#endif
#endif`,cP=`ToonMaterial material;
material.diffuseColor = diffuseColor.rgb;`,fP=`varying vec3 vViewPosition;
struct ToonMaterial {
	vec3 diffuseColor;
};
void RE_Direct_Toon( const in IncidentLight directLight, const in vec3 geometryPosition, const in vec3 geometryNormal, const in vec3 geometryViewDir, const in vec3 geometryClearcoatNormal, const in ToonMaterial material, inout ReflectedLight reflectedLight ) {
	vec3 irradiance = getGradientIrradiance( geometryNormal, directLight.direction ) * directLight.color;
	reflectedLight.directDiffuse += irradiance * BRDF_Lambert( material.diffuseColor );
}
void RE_IndirectDiffuse_Toon( const in vec3 irradiance, const in vec3 geometryPosition, const in vec3 geometryNormal, const in vec3 geometryViewDir, const in vec3 geometryClearcoatNormal, const in ToonMaterial material, inout ReflectedLight reflectedLight ) {
	reflectedLight.indirectDiffuse += irradiance * BRDF_Lambert( material.diffuseColor );
}
#define RE_Direct				RE_Direct_Toon
#define RE_IndirectDiffuse		RE_IndirectDiffuse_Toon`,dP=`BlinnPhongMaterial material;
material.diffuseColor = diffuseColor.rgb;
material.specularColor = specular;
material.specularShininess = shininess;
material.specularStrength = specularStrength;`,hP=`varying vec3 vViewPosition;
struct BlinnPhongMaterial {
	vec3 diffuseColor;
	vec3 specularColor;
	float specularShininess;
	float specularStrength;
};
void RE_Direct_BlinnPhong( const in IncidentLight directLight, const in vec3 geometryPosition, const in vec3 geometryNormal, const in vec3 geometryViewDir, const in vec3 geometryClearcoatNormal, const in BlinnPhongMaterial material, inout ReflectedLight reflectedLight ) {
	float dotNL = saturate( dot( geometryNormal, directLight.direction ) );
	vec3 irradiance = dotNL * directLight.color;
	reflectedLight.directDiffuse += irradiance * BRDF_Lambert( material.diffuseColor );
	reflectedLight.directSpecular += irradiance * BRDF_BlinnPhong( directLight.direction, geometryViewDir, geometryNormal, material.specularColor, material.specularShininess ) * material.specularStrength;
}
void RE_IndirectDiffuse_BlinnPhong( const in vec3 irradiance, const in vec3 geometryPosition, const in vec3 geometryNormal, const in vec3 geometryViewDir, const in vec3 geometryClearcoatNormal, const in BlinnPhongMaterial material, inout ReflectedLight reflectedLight ) {
	reflectedLight.indirectDiffuse += irradiance * BRDF_Lambert( material.diffuseColor );
}
#define RE_Direct				RE_Direct_BlinnPhong
#define RE_IndirectDiffuse		RE_IndirectDiffuse_BlinnPhong`,pP=`PhysicalMaterial material;
material.diffuseColor = diffuseColor.rgb * ( 1.0 - metalnessFactor );
vec3 dxy = max( abs( dFdx( nonPerturbedNormal ) ), abs( dFdy( nonPerturbedNormal ) ) );
float geometryRoughness = max( max( dxy.x, dxy.y ), dxy.z );
material.roughness = max( roughnessFactor, 0.0525 );material.roughness += geometryRoughness;
material.roughness = min( material.roughness, 1.0 );
#ifdef IOR
	material.ior = ior;
	#ifdef USE_SPECULAR
		float specularIntensityFactor = specularIntensity;
		vec3 specularColorFactor = specularColor;
		#ifdef USE_SPECULAR_COLORMAP
			specularColorFactor *= texture2D( specularColorMap, vSpecularColorMapUv ).rgb;
		#endif
		#ifdef USE_SPECULAR_INTENSITYMAP
			specularIntensityFactor *= texture2D( specularIntensityMap, vSpecularIntensityMapUv ).a;
		#endif
		material.specularF90 = mix( specularIntensityFactor, 1.0, metalnessFactor );
	#else
		float specularIntensityFactor = 1.0;
		vec3 specularColorFactor = vec3( 1.0 );
		material.specularF90 = 1.0;
	#endif
	material.specularColor = mix( min( pow2( ( material.ior - 1.0 ) / ( material.ior + 1.0 ) ) * specularColorFactor, vec3( 1.0 ) ) * specularIntensityFactor, diffuseColor.rgb, metalnessFactor );
#else
	material.specularColor = mix( vec3( 0.04 ), diffuseColor.rgb, metalnessFactor );
	material.specularF90 = 1.0;
#endif
#ifdef USE_CLEARCOAT
	material.clearcoat = clearcoat;
	material.clearcoatRoughness = clearcoatRoughness;
	material.clearcoatF0 = vec3( 0.04 );
	material.clearcoatF90 = 1.0;
	#ifdef USE_CLEARCOATMAP
		material.clearcoat *= texture2D( clearcoatMap, vClearcoatMapUv ).x;
	#endif
	#ifdef USE_CLEARCOAT_ROUGHNESSMAP
		material.clearcoatRoughness *= texture2D( clearcoatRoughnessMap, vClearcoatRoughnessMapUv ).y;
	#endif
	material.clearcoat = saturate( material.clearcoat );	material.clearcoatRoughness = max( material.clearcoatRoughness, 0.0525 );
	material.clearcoatRoughness += geometryRoughness;
	material.clearcoatRoughness = min( material.clearcoatRoughness, 1.0 );
#endif
#ifdef USE_DISPERSION
	material.dispersion = dispersion;
#endif
#ifdef USE_IRIDESCENCE
	material.iridescence = iridescence;
	material.iridescenceIOR = iridescenceIOR;
	#ifdef USE_IRIDESCENCEMAP
		material.iridescence *= texture2D( iridescenceMap, vIridescenceMapUv ).r;
	#endif
	#ifdef USE_IRIDESCENCE_THICKNESSMAP
		material.iridescenceThickness = (iridescenceThicknessMaximum - iridescenceThicknessMinimum) * texture2D( iridescenceThicknessMap, vIridescenceThicknessMapUv ).g + iridescenceThicknessMinimum;
	#else
		material.iridescenceThickness = iridescenceThicknessMaximum;
	#endif
#endif
#ifdef USE_SHEEN
	material.sheenColor = sheenColor;
	#ifdef USE_SHEEN_COLORMAP
		material.sheenColor *= texture2D( sheenColorMap, vSheenColorMapUv ).rgb;
	#endif
	material.sheenRoughness = clamp( sheenRoughness, 0.07, 1.0 );
	#ifdef USE_SHEEN_ROUGHNESSMAP
		material.sheenRoughness *= texture2D( sheenRoughnessMap, vSheenRoughnessMapUv ).a;
	#endif
#endif
#ifdef USE_ANISOTROPY
	#ifdef USE_ANISOTROPYMAP
		mat2 anisotropyMat = mat2( anisotropyVector.x, anisotropyVector.y, - anisotropyVector.y, anisotropyVector.x );
		vec3 anisotropyPolar = texture2D( anisotropyMap, vAnisotropyMapUv ).rgb;
		vec2 anisotropyV = anisotropyMat * normalize( 2.0 * anisotropyPolar.rg - vec2( 1.0 ) ) * anisotropyPolar.b;
	#else
		vec2 anisotropyV = anisotropyVector;
	#endif
	material.anisotropy = length( anisotropyV );
	if( material.anisotropy == 0.0 ) {
		anisotropyV = vec2( 1.0, 0.0 );
	} else {
		anisotropyV /= material.anisotropy;
		material.anisotropy = saturate( material.anisotropy );
	}
	material.alphaT = mix( pow2( material.roughness ), 1.0, pow2( material.anisotropy ) );
	material.anisotropyT = tbn[ 0 ] * anisotropyV.x + tbn[ 1 ] * anisotropyV.y;
	material.anisotropyB = tbn[ 1 ] * anisotropyV.x - tbn[ 0 ] * anisotropyV.y;
#endif`,mP=`struct PhysicalMaterial {
	vec3 diffuseColor;
	float roughness;
	vec3 specularColor;
	float specularF90;
	float dispersion;
	#ifdef USE_CLEARCOAT
		float clearcoat;
		float clearcoatRoughness;
		vec3 clearcoatF0;
		float clearcoatF90;
	#endif
	#ifdef USE_IRIDESCENCE
		float iridescence;
		float iridescenceIOR;
		float iridescenceThickness;
		vec3 iridescenceFresnel;
		vec3 iridescenceF0;
	#endif
	#ifdef USE_SHEEN
		vec3 sheenColor;
		float sheenRoughness;
	#endif
	#ifdef IOR
		float ior;
	#endif
	#ifdef USE_TRANSMISSION
		float transmission;
		float transmissionAlpha;
		float thickness;
		float attenuationDistance;
		vec3 attenuationColor;
	#endif
	#ifdef USE_ANISOTROPY
		float anisotropy;
		float alphaT;
		vec3 anisotropyT;
		vec3 anisotropyB;
	#endif
};
vec3 clearcoatSpecularDirect = vec3( 0.0 );
vec3 clearcoatSpecularIndirect = vec3( 0.0 );
vec3 sheenSpecularDirect = vec3( 0.0 );
vec3 sheenSpecularIndirect = vec3(0.0 );
vec3 Schlick_to_F0( const in vec3 f, const in float f90, const in float dotVH ) {
    float x = clamp( 1.0 - dotVH, 0.0, 1.0 );
    float x2 = x * x;
    float x5 = clamp( x * x2 * x2, 0.0, 0.9999 );
    return ( f - vec3( f90 ) * x5 ) / ( 1.0 - x5 );
}
float V_GGX_SmithCorrelated( const in float alpha, const in float dotNL, const in float dotNV ) {
	float a2 = pow2( alpha );
	float gv = dotNL * sqrt( a2 + ( 1.0 - a2 ) * pow2( dotNV ) );
	float gl = dotNV * sqrt( a2 + ( 1.0 - a2 ) * pow2( dotNL ) );
	return 0.5 / max( gv + gl, EPSILON );
}
float D_GGX( const in float alpha, const in float dotNH ) {
	float a2 = pow2( alpha );
	float denom = pow2( dotNH ) * ( a2 - 1.0 ) + 1.0;
	return RECIPROCAL_PI * a2 / pow2( denom );
}
#ifdef USE_ANISOTROPY
	float V_GGX_SmithCorrelated_Anisotropic( const in float alphaT, const in float alphaB, const in float dotTV, const in float dotBV, const in float dotTL, const in float dotBL, const in float dotNV, const in float dotNL ) {
		float gv = dotNL * length( vec3( alphaT * dotTV, alphaB * dotBV, dotNV ) );
		float gl = dotNV * length( vec3( alphaT * dotTL, alphaB * dotBL, dotNL ) );
		float v = 0.5 / ( gv + gl );
		return saturate(v);
	}
	float D_GGX_Anisotropic( const in float alphaT, const in float alphaB, const in float dotNH, const in float dotTH, const in float dotBH ) {
		float a2 = alphaT * alphaB;
		highp vec3 v = vec3( alphaB * dotTH, alphaT * dotBH, a2 * dotNH );
		highp float v2 = dot( v, v );
		float w2 = a2 / v2;
		return RECIPROCAL_PI * a2 * pow2 ( w2 );
	}
#endif
#ifdef USE_CLEARCOAT
	vec3 BRDF_GGX_Clearcoat( const in vec3 lightDir, const in vec3 viewDir, const in vec3 normal, const in PhysicalMaterial material) {
		vec3 f0 = material.clearcoatF0;
		float f90 = material.clearcoatF90;
		float roughness = material.clearcoatRoughness;
		float alpha = pow2( roughness );
		vec3 halfDir = normalize( lightDir + viewDir );
		float dotNL = saturate( dot( normal, lightDir ) );
		float dotNV = saturate( dot( normal, viewDir ) );
		float dotNH = saturate( dot( normal, halfDir ) );
		float dotVH = saturate( dot( viewDir, halfDir ) );
		vec3 F = F_Schlick( f0, f90, dotVH );
		float V = V_GGX_SmithCorrelated( alpha, dotNL, dotNV );
		float D = D_GGX( alpha, dotNH );
		return F * ( V * D );
	}
#endif
vec3 BRDF_GGX( const in vec3 lightDir, const in vec3 viewDir, const in vec3 normal, const in PhysicalMaterial material ) {
	vec3 f0 = material.specularColor;
	float f90 = material.specularF90;
	float roughness = material.roughness;
	float alpha = pow2( roughness );
	vec3 halfDir = normalize( lightDir + viewDir );
	float dotNL = saturate( dot( normal, lightDir ) );
	float dotNV = saturate( dot( normal, viewDir ) );
	float dotNH = saturate( dot( normal, halfDir ) );
	float dotVH = saturate( dot( viewDir, halfDir ) );
	vec3 F = F_Schlick( f0, f90, dotVH );
	#ifdef USE_IRIDESCENCE
		F = mix( F, material.iridescenceFresnel, material.iridescence );
	#endif
	#ifdef USE_ANISOTROPY
		float dotTL = dot( material.anisotropyT, lightDir );
		float dotTV = dot( material.anisotropyT, viewDir );
		float dotTH = dot( material.anisotropyT, halfDir );
		float dotBL = dot( material.anisotropyB, lightDir );
		float dotBV = dot( material.anisotropyB, viewDir );
		float dotBH = dot( material.anisotropyB, halfDir );
		float V = V_GGX_SmithCorrelated_Anisotropic( material.alphaT, alpha, dotTV, dotBV, dotTL, dotBL, dotNV, dotNL );
		float D = D_GGX_Anisotropic( material.alphaT, alpha, dotNH, dotTH, dotBH );
	#else
		float V = V_GGX_SmithCorrelated( alpha, dotNL, dotNV );
		float D = D_GGX( alpha, dotNH );
	#endif
	return F * ( V * D );
}
vec2 LTC_Uv( const in vec3 N, const in vec3 V, const in float roughness ) {
	const float LUT_SIZE = 64.0;
	const float LUT_SCALE = ( LUT_SIZE - 1.0 ) / LUT_SIZE;
	const float LUT_BIAS = 0.5 / LUT_SIZE;
	float dotNV = saturate( dot( N, V ) );
	vec2 uv = vec2( roughness, sqrt( 1.0 - dotNV ) );
	uv = uv * LUT_SCALE + LUT_BIAS;
	return uv;
}
float LTC_ClippedSphereFormFactor( const in vec3 f ) {
	float l = length( f );
	return max( ( l * l + f.z ) / ( l + 1.0 ), 0.0 );
}
vec3 LTC_EdgeVectorFormFactor( const in vec3 v1, const in vec3 v2 ) {
	float x = dot( v1, v2 );
	float y = abs( x );
	float a = 0.8543985 + ( 0.4965155 + 0.0145206 * y ) * y;
	float b = 3.4175940 + ( 4.1616724 + y ) * y;
	float v = a / b;
	float theta_sintheta = ( x > 0.0 ) ? v : 0.5 * inversesqrt( max( 1.0 - x * x, 1e-7 ) ) - v;
	return cross( v1, v2 ) * theta_sintheta;
}
vec3 LTC_Evaluate( const in vec3 N, const in vec3 V, const in vec3 P, const in mat3 mInv, const in vec3 rectCoords[ 4 ] ) {
	vec3 v1 = rectCoords[ 1 ] - rectCoords[ 0 ];
	vec3 v2 = rectCoords[ 3 ] - rectCoords[ 0 ];
	vec3 lightNormal = cross( v1, v2 );
	if( dot( lightNormal, P - rectCoords[ 0 ] ) < 0.0 ) return vec3( 0.0 );
	vec3 T1, T2;
	T1 = normalize( V - N * dot( V, N ) );
	T2 = - cross( N, T1 );
	mat3 mat = mInv * transposeMat3( mat3( T1, T2, N ) );
	vec3 coords[ 4 ];
	coords[ 0 ] = mat * ( rectCoords[ 0 ] - P );
	coords[ 1 ] = mat * ( rectCoords[ 1 ] - P );
	coords[ 2 ] = mat * ( rectCoords[ 2 ] - P );
	coords[ 3 ] = mat * ( rectCoords[ 3 ] - P );
	coords[ 0 ] = normalize( coords[ 0 ] );
	coords[ 1 ] = normalize( coords[ 1 ] );
	coords[ 2 ] = normalize( coords[ 2 ] );
	coords[ 3 ] = normalize( coords[ 3 ] );
	vec3 vectorFormFactor = vec3( 0.0 );
	vectorFormFactor += LTC_EdgeVectorFormFactor( coords[ 0 ], coords[ 1 ] );
	vectorFormFactor += LTC_EdgeVectorFormFactor( coords[ 1 ], coords[ 2 ] );
	vectorFormFactor += LTC_EdgeVectorFormFactor( coords[ 2 ], coords[ 3 ] );
	vectorFormFactor += LTC_EdgeVectorFormFactor( coords[ 3 ], coords[ 0 ] );
	float result = LTC_ClippedSphereFormFactor( vectorFormFactor );
	return vec3( result );
}
#if defined( USE_SHEEN )
float D_Charlie( float roughness, float dotNH ) {
	float alpha = pow2( roughness );
	float invAlpha = 1.0 / alpha;
	float cos2h = dotNH * dotNH;
	float sin2h = max( 1.0 - cos2h, 0.0078125 );
	return ( 2.0 + invAlpha ) * pow( sin2h, invAlpha * 0.5 ) / ( 2.0 * PI );
}
float V_Neubelt( float dotNV, float dotNL ) {
	return saturate( 1.0 / ( 4.0 * ( dotNL + dotNV - dotNL * dotNV ) ) );
}
vec3 BRDF_Sheen( const in vec3 lightDir, const in vec3 viewDir, const in vec3 normal, vec3 sheenColor, const in float sheenRoughness ) {
	vec3 halfDir = normalize( lightDir + viewDir );
	float dotNL = saturate( dot( normal, lightDir ) );
	float dotNV = saturate( dot( normal, viewDir ) );
	float dotNH = saturate( dot( normal, halfDir ) );
	float D = D_Charlie( sheenRoughness, dotNH );
	float V = V_Neubelt( dotNV, dotNL );
	return sheenColor * ( D * V );
}
#endif
float IBLSheenBRDF( const in vec3 normal, const in vec3 viewDir, const in float roughness ) {
	float dotNV = saturate( dot( normal, viewDir ) );
	float r2 = roughness * roughness;
	float a = roughness < 0.25 ? -339.2 * r2 + 161.4 * roughness - 25.9 : -8.48 * r2 + 14.3 * roughness - 9.95;
	float b = roughness < 0.25 ? 44.0 * r2 - 23.7 * roughness + 3.26 : 1.97 * r2 - 3.27 * roughness + 0.72;
	float DG = exp( a * dotNV + b ) + ( roughness < 0.25 ? 0.0 : 0.1 * ( roughness - 0.25 ) );
	return saturate( DG * RECIPROCAL_PI );
}
vec2 DFGApprox( const in vec3 normal, const in vec3 viewDir, const in float roughness ) {
	float dotNV = saturate( dot( normal, viewDir ) );
	const vec4 c0 = vec4( - 1, - 0.0275, - 0.572, 0.022 );
	const vec4 c1 = vec4( 1, 0.0425, 1.04, - 0.04 );
	vec4 r = roughness * c0 + c1;
	float a004 = min( r.x * r.x, exp2( - 9.28 * dotNV ) ) * r.x + r.y;
	vec2 fab = vec2( - 1.04, 1.04 ) * a004 + r.zw;
	return fab;
}
vec3 EnvironmentBRDF( const in vec3 normal, const in vec3 viewDir, const in vec3 specularColor, const in float specularF90, const in float roughness ) {
	vec2 fab = DFGApprox( normal, viewDir, roughness );
	return specularColor * fab.x + specularF90 * fab.y;
}
#ifdef USE_IRIDESCENCE
void computeMultiscatteringIridescence( const in vec3 normal, const in vec3 viewDir, const in vec3 specularColor, const in float specularF90, const in float iridescence, const in vec3 iridescenceF0, const in float roughness, inout vec3 singleScatter, inout vec3 multiScatter ) {
#else
void computeMultiscattering( const in vec3 normal, const in vec3 viewDir, const in vec3 specularColor, const in float specularF90, const in float roughness, inout vec3 singleScatter, inout vec3 multiScatter ) {
#endif
	vec2 fab = DFGApprox( normal, viewDir, roughness );
	#ifdef USE_IRIDESCENCE
		vec3 Fr = mix( specularColor, iridescenceF0, iridescence );
	#else
		vec3 Fr = specularColor;
	#endif
	vec3 FssEss = Fr * fab.x + specularF90 * fab.y;
	float Ess = fab.x + fab.y;
	float Ems = 1.0 - Ess;
	vec3 Favg = Fr + ( 1.0 - Fr ) * 0.047619;	vec3 Fms = FssEss * Favg / ( 1.0 - Ems * Favg );
	singleScatter += FssEss;
	multiScatter += Fms * Ems;
}
#if NUM_RECT_AREA_LIGHTS > 0
	void RE_Direct_RectArea_Physical( const in RectAreaLight rectAreaLight, const in vec3 geometryPosition, const in vec3 geometryNormal, const in vec3 geometryViewDir, const in vec3 geometryClearcoatNormal, const in PhysicalMaterial material, inout ReflectedLight reflectedLight ) {
		vec3 normal = geometryNormal;
		vec3 viewDir = geometryViewDir;
		vec3 position = geometryPosition;
		vec3 lightPos = rectAreaLight.position;
		vec3 halfWidth = rectAreaLight.halfWidth;
		vec3 halfHeight = rectAreaLight.halfHeight;
		vec3 lightColor = rectAreaLight.color;
		float roughness = material.roughness;
		vec3 rectCoords[ 4 ];
		rectCoords[ 0 ] = lightPos + halfWidth - halfHeight;		rectCoords[ 1 ] = lightPos - halfWidth - halfHeight;
		rectCoords[ 2 ] = lightPos - halfWidth + halfHeight;
		rectCoords[ 3 ] = lightPos + halfWidth + halfHeight;
		vec2 uv = LTC_Uv( normal, viewDir, roughness );
		vec4 t1 = texture2D( ltc_1, uv );
		vec4 t2 = texture2D( ltc_2, uv );
		mat3 mInv = mat3(
			vec3( t1.x, 0, t1.y ),
			vec3(    0, 1,    0 ),
			vec3( t1.z, 0, t1.w )
		);
		vec3 fresnel = ( material.specularColor * t2.x + ( vec3( 1.0 ) - material.specularColor ) * t2.y );
		reflectedLight.directSpecular += lightColor * fresnel * LTC_Evaluate( normal, viewDir, position, mInv, rectCoords );
		reflectedLight.directDiffuse += lightColor * material.diffuseColor * LTC_Evaluate( normal, viewDir, position, mat3( 1.0 ), rectCoords );
	}
#endif
void RE_Direct_Physical( const in IncidentLight directLight, const in vec3 geometryPosition, const in vec3 geometryNormal, const in vec3 geometryViewDir, const in vec3 geometryClearcoatNormal, const in PhysicalMaterial material, inout ReflectedLight reflectedLight ) {
	float dotNL = saturate( dot( geometryNormal, directLight.direction ) );
	vec3 irradiance = dotNL * directLight.color;
	#ifdef USE_CLEARCOAT
		float dotNLcc = saturate( dot( geometryClearcoatNormal, directLight.direction ) );
		vec3 ccIrradiance = dotNLcc * directLight.color;
		clearcoatSpecularDirect += ccIrradiance * BRDF_GGX_Clearcoat( directLight.direction, geometryViewDir, geometryClearcoatNormal, material );
	#endif
	#ifdef USE_SHEEN
		sheenSpecularDirect += irradiance * BRDF_Sheen( directLight.direction, geometryViewDir, geometryNormal, material.sheenColor, material.sheenRoughness );
	#endif
	reflectedLight.directSpecular += irradiance * BRDF_GGX( directLight.direction, geometryViewDir, geometryNormal, material );
	reflectedLight.directDiffuse += irradiance * BRDF_Lambert( material.diffuseColor );
}
void RE_IndirectDiffuse_Physical( const in vec3 irradiance, const in vec3 geometryPosition, const in vec3 geometryNormal, const in vec3 geometryViewDir, const in vec3 geometryClearcoatNormal, const in PhysicalMaterial material, inout ReflectedLight reflectedLight ) {
	reflectedLight.indirectDiffuse += irradiance * BRDF_Lambert( material.diffuseColor );
}
void RE_IndirectSpecular_Physical( const in vec3 radiance, const in vec3 irradiance, const in vec3 clearcoatRadiance, const in vec3 geometryPosition, const in vec3 geometryNormal, const in vec3 geometryViewDir, const in vec3 geometryClearcoatNormal, const in PhysicalMaterial material, inout ReflectedLight reflectedLight) {
	#ifdef USE_CLEARCOAT
		clearcoatSpecularIndirect += clearcoatRadiance * EnvironmentBRDF( geometryClearcoatNormal, geometryViewDir, material.clearcoatF0, material.clearcoatF90, material.clearcoatRoughness );
	#endif
	#ifdef USE_SHEEN
		sheenSpecularIndirect += irradiance * material.sheenColor * IBLSheenBRDF( geometryNormal, geometryViewDir, material.sheenRoughness );
	#endif
	vec3 singleScattering = vec3( 0.0 );
	vec3 multiScattering = vec3( 0.0 );
	vec3 cosineWeightedIrradiance = irradiance * RECIPROCAL_PI;
	#ifdef USE_IRIDESCENCE
		computeMultiscatteringIridescence( geometryNormal, geometryViewDir, material.specularColor, material.specularF90, material.iridescence, material.iridescenceFresnel, material.roughness, singleScattering, multiScattering );
	#else
		computeMultiscattering( geometryNormal, geometryViewDir, material.specularColor, material.specularF90, material.roughness, singleScattering, multiScattering );
	#endif
	vec3 totalScattering = singleScattering + multiScattering;
	vec3 diffuse = material.diffuseColor * ( 1.0 - max( max( totalScattering.r, totalScattering.g ), totalScattering.b ) );
	reflectedLight.indirectSpecular += radiance * singleScattering;
	reflectedLight.indirectSpecular += multiScattering * cosineWeightedIrradiance;
	reflectedLight.indirectDiffuse += diffuse * cosineWeightedIrradiance;
}
#define RE_Direct				RE_Direct_Physical
#define RE_Direct_RectArea		RE_Direct_RectArea_Physical
#define RE_IndirectDiffuse		RE_IndirectDiffuse_Physical
#define RE_IndirectSpecular		RE_IndirectSpecular_Physical
float computeSpecularOcclusion( const in float dotNV, const in float ambientOcclusion, const in float roughness ) {
	return saturate( pow( dotNV + ambientOcclusion, exp2( - 16.0 * roughness - 1.0 ) ) - 1.0 + ambientOcclusion );
}`,gP=`
vec3 geometryPosition = - vViewPosition;
vec3 geometryNormal = normal;
vec3 geometryViewDir = ( isOrthographic ) ? vec3( 0, 0, 1 ) : normalize( vViewPosition );
vec3 geometryClearcoatNormal = vec3( 0.0 );
#ifdef USE_CLEARCOAT
	geometryClearcoatNormal = clearcoatNormal;
#endif
#ifdef USE_IRIDESCENCE
	float dotNVi = saturate( dot( normal, geometryViewDir ) );
	if ( material.iridescenceThickness == 0.0 ) {
		material.iridescence = 0.0;
	} else {
		material.iridescence = saturate( material.iridescence );
	}
	if ( material.iridescence > 0.0 ) {
		material.iridescenceFresnel = evalIridescence( 1.0, material.iridescenceIOR, dotNVi, material.iridescenceThickness, material.specularColor );
		material.iridescenceF0 = Schlick_to_F0( material.iridescenceFresnel, 1.0, dotNVi );
	}
#endif
IncidentLight directLight;
#if ( NUM_POINT_LIGHTS > 0 ) && defined( RE_Direct )
	PointLight pointLight;
	#if defined( USE_SHADOWMAP ) && NUM_POINT_LIGHT_SHADOWS > 0
	PointLightShadow pointLightShadow;
	#endif
	#pragma unroll_loop_start
	for ( int i = 0; i < NUM_POINT_LIGHTS; i ++ ) {
		pointLight = pointLights[ i ];
		getPointLightInfo( pointLight, geometryPosition, directLight );
		#if defined( USE_SHADOWMAP ) && ( UNROLLED_LOOP_INDEX < NUM_POINT_LIGHT_SHADOWS )
		pointLightShadow = pointLightShadows[ i ];
		directLight.color *= ( directLight.visible && receiveShadow ) ? getPointShadow( pointShadowMap[ i ], pointLightShadow.shadowMapSize, pointLightShadow.shadowIntensity, pointLightShadow.shadowBias, pointLightShadow.shadowRadius, vPointShadowCoord[ i ], pointLightShadow.shadowCameraNear, pointLightShadow.shadowCameraFar ) : 1.0;
		#endif
		RE_Direct( directLight, geometryPosition, geometryNormal, geometryViewDir, geometryClearcoatNormal, material, reflectedLight );
	}
	#pragma unroll_loop_end
#endif
#if ( NUM_SPOT_LIGHTS > 0 ) && defined( RE_Direct )
	SpotLight spotLight;
	vec4 spotColor;
	vec3 spotLightCoord;
	bool inSpotLightMap;
	#if defined( USE_SHADOWMAP ) && NUM_SPOT_LIGHT_SHADOWS > 0
	SpotLightShadow spotLightShadow;
	#endif
	#pragma unroll_loop_start
	for ( int i = 0; i < NUM_SPOT_LIGHTS; i ++ ) {
		spotLight = spotLights[ i ];
		getSpotLightInfo( spotLight, geometryPosition, directLight );
		#if ( UNROLLED_LOOP_INDEX < NUM_SPOT_LIGHT_SHADOWS_WITH_MAPS )
		#define SPOT_LIGHT_MAP_INDEX UNROLLED_LOOP_INDEX
		#elif ( UNROLLED_LOOP_INDEX < NUM_SPOT_LIGHT_SHADOWS )
		#define SPOT_LIGHT_MAP_INDEX NUM_SPOT_LIGHT_MAPS
		#else
		#define SPOT_LIGHT_MAP_INDEX ( UNROLLED_LOOP_INDEX - NUM_SPOT_LIGHT_SHADOWS + NUM_SPOT_LIGHT_SHADOWS_WITH_MAPS )
		#endif
		#if ( SPOT_LIGHT_MAP_INDEX < NUM_SPOT_LIGHT_MAPS )
			spotLightCoord = vSpotLightCoord[ i ].xyz / vSpotLightCoord[ i ].w;
			inSpotLightMap = all( lessThan( abs( spotLightCoord * 2. - 1. ), vec3( 1.0 ) ) );
			spotColor = texture2D( spotLightMap[ SPOT_LIGHT_MAP_INDEX ], spotLightCoord.xy );
			directLight.color = inSpotLightMap ? directLight.color * spotColor.rgb : directLight.color;
		#endif
		#undef SPOT_LIGHT_MAP_INDEX
		#if defined( USE_SHADOWMAP ) && ( UNROLLED_LOOP_INDEX < NUM_SPOT_LIGHT_SHADOWS )
		spotLightShadow = spotLightShadows[ i ];
		directLight.color *= ( directLight.visible && receiveShadow ) ? getShadow( spotShadowMap[ i ], spotLightShadow.shadowMapSize, spotLightShadow.shadowIntensity, spotLightShadow.shadowBias, spotLightShadow.shadowRadius, vSpotLightCoord[ i ] ) : 1.0;
		#endif
		RE_Direct( directLight, geometryPosition, geometryNormal, geometryViewDir, geometryClearcoatNormal, material, reflectedLight );
	}
	#pragma unroll_loop_end
#endif
#if ( NUM_DIR_LIGHTS > 0 ) && defined( RE_Direct )
	DirectionalLight directionalLight;
	#if defined( USE_SHADOWMAP ) && NUM_DIR_LIGHT_SHADOWS > 0
	DirectionalLightShadow directionalLightShadow;
	#endif
	#pragma unroll_loop_start
	for ( int i = 0; i < NUM_DIR_LIGHTS; i ++ ) {
		directionalLight = directionalLights[ i ];
		getDirectionalLightInfo( directionalLight, directLight );
		#if defined( USE_SHADOWMAP ) && ( UNROLLED_LOOP_INDEX < NUM_DIR_LIGHT_SHADOWS )
		directionalLightShadow = directionalLightShadows[ i ];
		directLight.color *= ( directLight.visible && receiveShadow ) ? getShadow( directionalShadowMap[ i ], directionalLightShadow.shadowMapSize, directionalLightShadow.shadowIntensity, directionalLightShadow.shadowBias, directionalLightShadow.shadowRadius, vDirectionalShadowCoord[ i ] ) : 1.0;
		#endif
		RE_Direct( directLight, geometryPosition, geometryNormal, geometryViewDir, geometryClearcoatNormal, material, reflectedLight );
	}
	#pragma unroll_loop_end
#endif
#if ( NUM_RECT_AREA_LIGHTS > 0 ) && defined( RE_Direct_RectArea )
	RectAreaLight rectAreaLight;
	#pragma unroll_loop_start
	for ( int i = 0; i < NUM_RECT_AREA_LIGHTS; i ++ ) {
		rectAreaLight = rectAreaLights[ i ];
		RE_Direct_RectArea( rectAreaLight, geometryPosition, geometryNormal, geometryViewDir, geometryClearcoatNormal, material, reflectedLight );
	}
	#pragma unroll_loop_end
#endif
#if defined( RE_IndirectDiffuse )
	vec3 iblIrradiance = vec3( 0.0 );
	vec3 irradiance = getAmbientLightIrradiance( ambientLightColor );
	#if defined( USE_LIGHT_PROBES )
		irradiance += getLightProbeIrradiance( lightProbe, geometryNormal );
	#endif
	#if ( NUM_HEMI_LIGHTS > 0 )
		#pragma unroll_loop_start
		for ( int i = 0; i < NUM_HEMI_LIGHTS; i ++ ) {
			irradiance += getHemisphereLightIrradiance( hemisphereLights[ i ], geometryNormal );
		}
		#pragma unroll_loop_end
	#endif
#endif
#if defined( RE_IndirectSpecular )
	vec3 radiance = vec3( 0.0 );
	vec3 clearcoatRadiance = vec3( 0.0 );
#endif`,vP=`#if defined( RE_IndirectDiffuse )
	#ifdef USE_LIGHTMAP
		vec4 lightMapTexel = texture2D( lightMap, vLightMapUv );
		vec3 lightMapIrradiance = lightMapTexel.rgb * lightMapIntensity;
		irradiance += lightMapIrradiance;
	#endif
	#if defined( USE_ENVMAP ) && defined( STANDARD ) && defined( ENVMAP_TYPE_CUBE_UV )
		iblIrradiance += getIBLIrradiance( geometryNormal );
	#endif
#endif
#if defined( USE_ENVMAP ) && defined( RE_IndirectSpecular )
	#ifdef USE_ANISOTROPY
		radiance += getIBLAnisotropyRadiance( geometryViewDir, geometryNormal, material.roughness, material.anisotropyB, material.anisotropy );
	#else
		radiance += getIBLRadiance( geometryViewDir, geometryNormal, material.roughness );
	#endif
	#ifdef USE_CLEARCOAT
		clearcoatRadiance += getIBLRadiance( geometryViewDir, geometryClearcoatNormal, material.clearcoatRoughness );
	#endif
#endif`,yP=`#if defined( RE_IndirectDiffuse )
	RE_IndirectDiffuse( irradiance, geometryPosition, geometryNormal, geometryViewDir, geometryClearcoatNormal, material, reflectedLight );
#endif
#if defined( RE_IndirectSpecular )
	RE_IndirectSpecular( radiance, iblIrradiance, clearcoatRadiance, geometryPosition, geometryNormal, geometryViewDir, geometryClearcoatNormal, material, reflectedLight );
#endif`,_P=`#if defined( USE_LOGDEPTHBUF )
	gl_FragDepth = vIsPerspective == 0.0 ? gl_FragCoord.z : log2( vFragDepth ) * logDepthBufFC * 0.5;
#endif`,xP=`#if defined( USE_LOGDEPTHBUF )
	uniform float logDepthBufFC;
	varying float vFragDepth;
	varying float vIsPerspective;
#endif`,AP=`#ifdef USE_LOGDEPTHBUF
	varying float vFragDepth;
	varying float vIsPerspective;
#endif`,SP=`#ifdef USE_LOGDEPTHBUF
	vFragDepth = 1.0 + gl_Position.w;
	vIsPerspective = float( isPerspectiveMatrix( projectionMatrix ) );
#endif`,MP=`#ifdef USE_MAP
	vec4 sampledDiffuseColor = texture2D( map, vMapUv );
	#ifdef DECODE_VIDEO_TEXTURE
		sampledDiffuseColor = sRGBTransferEOTF( sampledDiffuseColor );
	#endif
	diffuseColor *= sampledDiffuseColor;
#endif`,EP=`#ifdef USE_MAP
	uniform sampler2D map;
#endif`,wP=`#if defined( USE_MAP ) || defined( USE_ALPHAMAP )
	#if defined( USE_POINTS_UV )
		vec2 uv = vUv;
	#else
		vec2 uv = ( uvTransform * vec3( gl_PointCoord.x, 1.0 - gl_PointCoord.y, 1 ) ).xy;
	#endif
#endif
#ifdef USE_MAP
	diffuseColor *= texture2D( map, uv );
#endif
#ifdef USE_ALPHAMAP
	diffuseColor.a *= texture2D( alphaMap, uv ).g;
#endif`,CP=`#if defined( USE_POINTS_UV )
	varying vec2 vUv;
#else
	#if defined( USE_MAP ) || defined( USE_ALPHAMAP )
		uniform mat3 uvTransform;
	#endif
#endif
#ifdef USE_MAP
	uniform sampler2D map;
#endif
#ifdef USE_ALPHAMAP
	uniform sampler2D alphaMap;
#endif`,TP=`float metalnessFactor = metalness;
#ifdef USE_METALNESSMAP
	vec4 texelMetalness = texture2D( metalnessMap, vMetalnessMapUv );
	metalnessFactor *= texelMetalness.b;
#endif`,bP=`#ifdef USE_METALNESSMAP
	uniform sampler2D metalnessMap;
#endif`,RP=`#ifdef USE_INSTANCING_MORPH
	float morphTargetInfluences[ MORPHTARGETS_COUNT ];
	float morphTargetBaseInfluence = texelFetch( morphTexture, ivec2( 0, gl_InstanceID ), 0 ).r;
	for ( int i = 0; i < MORPHTARGETS_COUNT; i ++ ) {
		morphTargetInfluences[i] =  texelFetch( morphTexture, ivec2( i + 1, gl_InstanceID ), 0 ).r;
	}
#endif`,IP=`#if defined( USE_MORPHCOLORS )
	vColor *= morphTargetBaseInfluence;
	for ( int i = 0; i < MORPHTARGETS_COUNT; i ++ ) {
		#if defined( USE_COLOR_ALPHA )
			if ( morphTargetInfluences[ i ] != 0.0 ) vColor += getMorph( gl_VertexID, i, 2 ) * morphTargetInfluences[ i ];
		#elif defined( USE_COLOR )
			if ( morphTargetInfluences[ i ] != 0.0 ) vColor += getMorph( gl_VertexID, i, 2 ).rgb * morphTargetInfluences[ i ];
		#endif
	}
#endif`,PP=`#ifdef USE_MORPHNORMALS
	objectNormal *= morphTargetBaseInfluence;
	for ( int i = 0; i < MORPHTARGETS_COUNT; i ++ ) {
		if ( morphTargetInfluences[ i ] != 0.0 ) objectNormal += getMorph( gl_VertexID, i, 1 ).xyz * morphTargetInfluences[ i ];
	}
#endif`,BP=`#ifdef USE_MORPHTARGETS
	#ifndef USE_INSTANCING_MORPH
		uniform float morphTargetBaseInfluence;
		uniform float morphTargetInfluences[ MORPHTARGETS_COUNT ];
	#endif
	uniform sampler2DArray morphTargetsTexture;
	uniform ivec2 morphTargetsTextureSize;
	vec4 getMorph( const in int vertexIndex, const in int morphTargetIndex, const in int offset ) {
		int texelIndex = vertexIndex * MORPHTARGETS_TEXTURE_STRIDE + offset;
		int y = texelIndex / morphTargetsTextureSize.x;
		int x = texelIndex - y * morphTargetsTextureSize.x;
		ivec3 morphUV = ivec3( x, y, morphTargetIndex );
		return texelFetch( morphTargetsTexture, morphUV, 0 );
	}
#endif`,LP=`#ifdef USE_MORPHTARGETS
	transformed *= morphTargetBaseInfluence;
	for ( int i = 0; i < MORPHTARGETS_COUNT; i ++ ) {
		if ( morphTargetInfluences[ i ] != 0.0 ) transformed += getMorph( gl_VertexID, i, 0 ).xyz * morphTargetInfluences[ i ];
	}
#endif`,DP=`float faceDirection = gl_FrontFacing ? 1.0 : - 1.0;
#ifdef FLAT_SHADED
	vec3 fdx = dFdx( vViewPosition );
	vec3 fdy = dFdy( vViewPosition );
	vec3 normal = normalize( cross( fdx, fdy ) );
#else
	vec3 normal = normalize( vNormal );
	#ifdef DOUBLE_SIDED
		normal *= faceDirection;
	#endif
#endif
#if defined( USE_NORMALMAP_TANGENTSPACE ) || defined( USE_CLEARCOAT_NORMALMAP ) || defined( USE_ANISOTROPY )
	#ifdef USE_TANGENT
		mat3 tbn = mat3( normalize( vTangent ), normalize( vBitangent ), normal );
	#else
		mat3 tbn = getTangentFrame( - vViewPosition, normal,
		#if defined( USE_NORMALMAP )
			vNormalMapUv
		#elif defined( USE_CLEARCOAT_NORMALMAP )
			vClearcoatNormalMapUv
		#else
			vUv
		#endif
		);
	#endif
	#if defined( DOUBLE_SIDED ) && ! defined( FLAT_SHADED )
		tbn[0] *= faceDirection;
		tbn[1] *= faceDirection;
	#endif
#endif
#ifdef USE_CLEARCOAT_NORMALMAP
	#ifdef USE_TANGENT
		mat3 tbn2 = mat3( normalize( vTangent ), normalize( vBitangent ), normal );
	#else
		mat3 tbn2 = getTangentFrame( - vViewPosition, normal, vClearcoatNormalMapUv );
	#endif
	#if defined( DOUBLE_SIDED ) && ! defined( FLAT_SHADED )
		tbn2[0] *= faceDirection;
		tbn2[1] *= faceDirection;
	#endif
#endif
vec3 nonPerturbedNormal = normal;`,FP=`#ifdef USE_NORMALMAP_OBJECTSPACE
	normal = texture2D( normalMap, vNormalMapUv ).xyz * 2.0 - 1.0;
	#ifdef FLIP_SIDED
		normal = - normal;
	#endif
	#ifdef DOUBLE_SIDED
		normal = normal * faceDirection;
	#endif
	normal = normalize( normalMatrix * normal );
#elif defined( USE_NORMALMAP_TANGENTSPACE )
	vec3 mapN = texture2D( normalMap, vNormalMapUv ).xyz * 2.0 - 1.0;
	mapN.xy *= normalScale;
	normal = normalize( tbn * mapN );
#elif defined( USE_BUMPMAP )
	normal = perturbNormalArb( - vViewPosition, normal, dHdxy_fwd(), faceDirection );
#endif`,NP=`#ifndef FLAT_SHADED
	varying vec3 vNormal;
	#ifdef USE_TANGENT
		varying vec3 vTangent;
		varying vec3 vBitangent;
	#endif
#endif`,UP=`#ifndef FLAT_SHADED
	varying vec3 vNormal;
	#ifdef USE_TANGENT
		varying vec3 vTangent;
		varying vec3 vBitangent;
	#endif
#endif`,OP=`#ifndef FLAT_SHADED
	vNormal = normalize( transformedNormal );
	#ifdef USE_TANGENT
		vTangent = normalize( transformedTangent );
		vBitangent = normalize( cross( vNormal, vTangent ) * tangent.w );
	#endif
#endif`,kP=`#ifdef USE_NORMALMAP
	uniform sampler2D normalMap;
	uniform vec2 normalScale;
#endif
#ifdef USE_NORMALMAP_OBJECTSPACE
	uniform mat3 normalMatrix;
#endif
#if ! defined ( USE_TANGENT ) && ( defined ( USE_NORMALMAP_TANGENTSPACE ) || defined ( USE_CLEARCOAT_NORMALMAP ) || defined( USE_ANISOTROPY ) )
	mat3 getTangentFrame( vec3 eye_pos, vec3 surf_norm, vec2 uv ) {
		vec3 q0 = dFdx( eye_pos.xyz );
		vec3 q1 = dFdy( eye_pos.xyz );
		vec2 st0 = dFdx( uv.st );
		vec2 st1 = dFdy( uv.st );
		vec3 N = surf_norm;
		vec3 q1perp = cross( q1, N );
		vec3 q0perp = cross( N, q0 );
		vec3 T = q1perp * st0.x + q0perp * st1.x;
		vec3 B = q1perp * st0.y + q0perp * st1.y;
		float det = max( dot( T, T ), dot( B, B ) );
		float scale = ( det == 0.0 ) ? 0.0 : inversesqrt( det );
		return mat3( T * scale, B * scale, N );
	}
#endif`,HP=`#ifdef USE_CLEARCOAT
	vec3 clearcoatNormal = nonPerturbedNormal;
#endif`,zP=`#ifdef USE_CLEARCOAT_NORMALMAP
	vec3 clearcoatMapN = texture2D( clearcoatNormalMap, vClearcoatNormalMapUv ).xyz * 2.0 - 1.0;
	clearcoatMapN.xy *= clearcoatNormalScale;
	clearcoatNormal = normalize( tbn2 * clearcoatMapN );
#endif`,GP=`#ifdef USE_CLEARCOATMAP
	uniform sampler2D clearcoatMap;
#endif
#ifdef USE_CLEARCOAT_NORMALMAP
	uniform sampler2D clearcoatNormalMap;
	uniform vec2 clearcoatNormalScale;
#endif
#ifdef USE_CLEARCOAT_ROUGHNESSMAP
	uniform sampler2D clearcoatRoughnessMap;
#endif`,VP=`#ifdef USE_IRIDESCENCEMAP
	uniform sampler2D iridescenceMap;
#endif
#ifdef USE_IRIDESCENCE_THICKNESSMAP
	uniform sampler2D iridescenceThicknessMap;
#endif`,WP=`#ifdef OPAQUE
diffuseColor.a = 1.0;
#endif
#ifdef USE_TRANSMISSION
diffuseColor.a *= material.transmissionAlpha;
#endif
gl_FragColor = vec4( outgoingLight, diffuseColor.a );`,XP=`vec3 packNormalToRGB( const in vec3 normal ) {
	return normalize( normal ) * 0.5 + 0.5;
}
vec3 unpackRGBToNormal( const in vec3 rgb ) {
	return 2.0 * rgb.xyz - 1.0;
}
const float PackUpscale = 256. / 255.;const float UnpackDownscale = 255. / 256.;const float ShiftRight8 = 1. / 256.;
const float Inv255 = 1. / 255.;
const vec4 PackFactors = vec4( 1.0, 256.0, 256.0 * 256.0, 256.0 * 256.0 * 256.0 );
const vec2 UnpackFactors2 = vec2( UnpackDownscale, 1.0 / PackFactors.g );
const vec3 UnpackFactors3 = vec3( UnpackDownscale / PackFactors.rg, 1.0 / PackFactors.b );
const vec4 UnpackFactors4 = vec4( UnpackDownscale / PackFactors.rgb, 1.0 / PackFactors.a );
vec4 packDepthToRGBA( const in float v ) {
	if( v <= 0.0 )
		return vec4( 0., 0., 0., 0. );
	if( v >= 1.0 )
		return vec4( 1., 1., 1., 1. );
	float vuf;
	float af = modf( v * PackFactors.a, vuf );
	float bf = modf( vuf * ShiftRight8, vuf );
	float gf = modf( vuf * ShiftRight8, vuf );
	return vec4( vuf * Inv255, gf * PackUpscale, bf * PackUpscale, af );
}
vec3 packDepthToRGB( const in float v ) {
	if( v <= 0.0 )
		return vec3( 0., 0., 0. );
	if( v >= 1.0 )
		return vec3( 1., 1., 1. );
	float vuf;
	float bf = modf( v * PackFactors.b, vuf );
	float gf = modf( vuf * ShiftRight8, vuf );
	return vec3( vuf * Inv255, gf * PackUpscale, bf );
}
vec2 packDepthToRG( const in float v ) {
	if( v <= 0.0 )
		return vec2( 0., 0. );
	if( v >= 1.0 )
		return vec2( 1., 1. );
	float vuf;
	float gf = modf( v * 256., vuf );
	return vec2( vuf * Inv255, gf );
}
float unpackRGBAToDepth( const in vec4 v ) {
	return dot( v, UnpackFactors4 );
}
float unpackRGBToDepth( const in vec3 v ) {
	return dot( v, UnpackFactors3 );
}
float unpackRGToDepth( const in vec2 v ) {
	return v.r * UnpackFactors2.r + v.g * UnpackFactors2.g;
}
vec4 pack2HalfToRGBA( const in vec2 v ) {
	vec4 r = vec4( v.x, fract( v.x * 255.0 ), v.y, fract( v.y * 255.0 ) );
	return vec4( r.x - r.y / 255.0, r.y, r.z - r.w / 255.0, r.w );
}
vec2 unpackRGBATo2Half( const in vec4 v ) {
	return vec2( v.x + ( v.y / 255.0 ), v.z + ( v.w / 255.0 ) );
}
float viewZToOrthographicDepth( const in float viewZ, const in float near, const in float far ) {
	return ( viewZ + near ) / ( near - far );
}
float orthographicDepthToViewZ( const in float depth, const in float near, const in float far ) {
	return depth * ( near - far ) - near;
}
float viewZToPerspectiveDepth( const in float viewZ, const in float near, const in float far ) {
	return ( ( near + viewZ ) * far ) / ( ( far - near ) * viewZ );
}
float perspectiveDepthToViewZ( const in float depth, const in float near, const in float far ) {
	return ( near * far ) / ( ( far - near ) * depth - far );
}`,jP=`#ifdef PREMULTIPLIED_ALPHA
	gl_FragColor.rgb *= gl_FragColor.a;
#endif`,JP=`vec4 mvPosition = vec4( transformed, 1.0 );
#ifdef USE_BATCHING
	mvPosition = batchingMatrix * mvPosition;
#endif
#ifdef USE_INSTANCING
	mvPosition = instanceMatrix * mvPosition;
#endif
mvPosition = modelViewMatrix * mvPosition;
gl_Position = projectionMatrix * mvPosition;`,KP=`#ifdef DITHERING
	gl_FragColor.rgb = dithering( gl_FragColor.rgb );
#endif`,YP=`#ifdef DITHERING
	vec3 dithering( vec3 color ) {
		float grid_position = rand( gl_FragCoord.xy );
		vec3 dither_shift_RGB = vec3( 0.25 / 255.0, -0.25 / 255.0, 0.25 / 255.0 );
		dither_shift_RGB = mix( 2.0 * dither_shift_RGB, -2.0 * dither_shift_RGB, grid_position );
		return color + dither_shift_RGB;
	}
#endif`,QP=`float roughnessFactor = roughness;
#ifdef USE_ROUGHNESSMAP
	vec4 texelRoughness = texture2D( roughnessMap, vRoughnessMapUv );
	roughnessFactor *= texelRoughness.g;
#endif`,qP=`#ifdef USE_ROUGHNESSMAP
	uniform sampler2D roughnessMap;
#endif`,ZP=`#if NUM_SPOT_LIGHT_COORDS > 0
	varying vec4 vSpotLightCoord[ NUM_SPOT_LIGHT_COORDS ];
#endif
#if NUM_SPOT_LIGHT_MAPS > 0
	uniform sampler2D spotLightMap[ NUM_SPOT_LIGHT_MAPS ];
#endif
#ifdef USE_SHADOWMAP
	#if NUM_DIR_LIGHT_SHADOWS > 0
		uniform sampler2D directionalShadowMap[ NUM_DIR_LIGHT_SHADOWS ];
		varying vec4 vDirectionalShadowCoord[ NUM_DIR_LIGHT_SHADOWS ];
		struct DirectionalLightShadow {
			float shadowIntensity;
			float shadowBias;
			float shadowNormalBias;
			float shadowRadius;
			vec2 shadowMapSize;
		};
		uniform DirectionalLightShadow directionalLightShadows[ NUM_DIR_LIGHT_SHADOWS ];
	#endif
	#if NUM_SPOT_LIGHT_SHADOWS > 0
		uniform sampler2D spotShadowMap[ NUM_SPOT_LIGHT_SHADOWS ];
		struct SpotLightShadow {
			float shadowIntensity;
			float shadowBias;
			float shadowNormalBias;
			float shadowRadius;
			vec2 shadowMapSize;
		};
		uniform SpotLightShadow spotLightShadows[ NUM_SPOT_LIGHT_SHADOWS ];
	#endif
	#if NUM_POINT_LIGHT_SHADOWS > 0
		uniform sampler2D pointShadowMap[ NUM_POINT_LIGHT_SHADOWS ];
		varying vec4 vPointShadowCoord[ NUM_POINT_LIGHT_SHADOWS ];
		struct PointLightShadow {
			float shadowIntensity;
			float shadowBias;
			float shadowNormalBias;
			float shadowRadius;
			vec2 shadowMapSize;
			float shadowCameraNear;
			float shadowCameraFar;
		};
		uniform PointLightShadow pointLightShadows[ NUM_POINT_LIGHT_SHADOWS ];
	#endif
	float texture2DCompare( sampler2D depths, vec2 uv, float compare ) {
		return step( compare, unpackRGBAToDepth( texture2D( depths, uv ) ) );
	}
	vec2 texture2DDistribution( sampler2D shadow, vec2 uv ) {
		return unpackRGBATo2Half( texture2D( shadow, uv ) );
	}
	float VSMShadow (sampler2D shadow, vec2 uv, float compare ){
		float occlusion = 1.0;
		vec2 distribution = texture2DDistribution( shadow, uv );
		float hard_shadow = step( compare , distribution.x );
		if (hard_shadow != 1.0 ) {
			float distance = compare - distribution.x ;
			float variance = max( 0.00000, distribution.y * distribution.y );
			float softness_probability = variance / (variance + distance * distance );			softness_probability = clamp( ( softness_probability - 0.3 ) / ( 0.95 - 0.3 ), 0.0, 1.0 );			occlusion = clamp( max( hard_shadow, softness_probability ), 0.0, 1.0 );
		}
		return occlusion;
	}
	float getShadow( sampler2D shadowMap, vec2 shadowMapSize, float shadowIntensity, float shadowBias, float shadowRadius, vec4 shadowCoord ) {
		float shadow = 1.0;
		shadowCoord.xyz /= shadowCoord.w;
		shadowCoord.z += shadowBias;
		bool inFrustum = shadowCoord.x >= 0.0 && shadowCoord.x <= 1.0 && shadowCoord.y >= 0.0 && shadowCoord.y <= 1.0;
		bool frustumTest = inFrustum && shadowCoord.z <= 1.0;
		if ( frustumTest ) {
		#if defined( SHADOWMAP_TYPE_PCF )
			vec2 texelSize = vec2( 1.0 ) / shadowMapSize;
			float dx0 = - texelSize.x * shadowRadius;
			float dy0 = - texelSize.y * shadowRadius;
			float dx1 = + texelSize.x * shadowRadius;
			float dy1 = + texelSize.y * shadowRadius;
			float dx2 = dx0 / 2.0;
			float dy2 = dy0 / 2.0;
			float dx3 = dx1 / 2.0;
			float dy3 = dy1 / 2.0;
			shadow = (
				texture2DCompare( shadowMap, shadowCoord.xy + vec2( dx0, dy0 ), shadowCoord.z ) +
				texture2DCompare( shadowMap, shadowCoord.xy + vec2( 0.0, dy0 ), shadowCoord.z ) +
				texture2DCompare( shadowMap, shadowCoord.xy + vec2( dx1, dy0 ), shadowCoord.z ) +
				texture2DCompare( shadowMap, shadowCoord.xy + vec2( dx2, dy2 ), shadowCoord.z ) +
				texture2DCompare( shadowMap, shadowCoord.xy + vec2( 0.0, dy2 ), shadowCoord.z ) +
				texture2DCompare( shadowMap, shadowCoord.xy + vec2( dx3, dy2 ), shadowCoord.z ) +
				texture2DCompare( shadowMap, shadowCoord.xy + vec2( dx0, 0.0 ), shadowCoord.z ) +
				texture2DCompare( shadowMap, shadowCoord.xy + vec2( dx2, 0.0 ), shadowCoord.z ) +
				texture2DCompare( shadowMap, shadowCoord.xy, shadowCoord.z ) +
				texture2DCompare( shadowMap, shadowCoord.xy + vec2( dx3, 0.0 ), shadowCoord.z ) +
				texture2DCompare( shadowMap, shadowCoord.xy + vec2( dx1, 0.0 ), shadowCoord.z ) +
				texture2DCompare( shadowMap, shadowCoord.xy + vec2( dx2, dy3 ), shadowCoord.z ) +
				texture2DCompare( shadowMap, shadowCoord.xy + vec2( 0.0, dy3 ), shadowCoord.z ) +
				texture2DCompare( shadowMap, shadowCoord.xy + vec2( dx3, dy3 ), shadowCoord.z ) +
				texture2DCompare( shadowMap, shadowCoord.xy + vec2( dx0, dy1 ), shadowCoord.z ) +
				texture2DCompare( shadowMap, shadowCoord.xy + vec2( 0.0, dy1 ), shadowCoord.z ) +
				texture2DCompare( shadowMap, shadowCoord.xy + vec2( dx1, dy1 ), shadowCoord.z )
			) * ( 1.0 / 17.0 );
		#elif defined( SHADOWMAP_TYPE_PCF_SOFT )
			vec2 texelSize = vec2( 1.0 ) / shadowMapSize;
			float dx = texelSize.x;
			float dy = texelSize.y;
			vec2 uv = shadowCoord.xy;
			vec2 f = fract( uv * shadowMapSize + 0.5 );
			uv -= f * texelSize;
			shadow = (
				texture2DCompare( shadowMap, uv, shadowCoord.z ) +
				texture2DCompare( shadowMap, uv + vec2( dx, 0.0 ), shadowCoord.z ) +
				texture2DCompare( shadowMap, uv + vec2( 0.0, dy ), shadowCoord.z ) +
				texture2DCompare( shadowMap, uv + texelSize, shadowCoord.z ) +
				mix( texture2DCompare( shadowMap, uv + vec2( -dx, 0.0 ), shadowCoord.z ),
					 texture2DCompare( shadowMap, uv + vec2( 2.0 * dx, 0.0 ), shadowCoord.z ),
					 f.x ) +
				mix( texture2DCompare( shadowMap, uv + vec2( -dx, dy ), shadowCoord.z ),
					 texture2DCompare( shadowMap, uv + vec2( 2.0 * dx, dy ), shadowCoord.z ),
					 f.x ) +
				mix( texture2DCompare( shadowMap, uv + vec2( 0.0, -dy ), shadowCoord.z ),
					 texture2DCompare( shadowMap, uv + vec2( 0.0, 2.0 * dy ), shadowCoord.z ),
					 f.y ) +
				mix( texture2DCompare( shadowMap, uv + vec2( dx, -dy ), shadowCoord.z ),
					 texture2DCompare( shadowMap, uv + vec2( dx, 2.0 * dy ), shadowCoord.z ),
					 f.y ) +
				mix( mix( texture2DCompare( shadowMap, uv + vec2( -dx, -dy ), shadowCoord.z ),
						  texture2DCompare( shadowMap, uv + vec2( 2.0 * dx, -dy ), shadowCoord.z ),
						  f.x ),
					 mix( texture2DCompare( shadowMap, uv + vec2( -dx, 2.0 * dy ), shadowCoord.z ),
						  texture2DCompare( shadowMap, uv + vec2( 2.0 * dx, 2.0 * dy ), shadowCoord.z ),
						  f.x ),
					 f.y )
			) * ( 1.0 / 9.0 );
		#elif defined( SHADOWMAP_TYPE_VSM )
			shadow = VSMShadow( shadowMap, shadowCoord.xy, shadowCoord.z );
		#else
			shadow = texture2DCompare( shadowMap, shadowCoord.xy, shadowCoord.z );
		#endif
		}
		return mix( 1.0, shadow, shadowIntensity );
	}
	vec2 cubeToUV( vec3 v, float texelSizeY ) {
		vec3 absV = abs( v );
		float scaleToCube = 1.0 / max( absV.x, max( absV.y, absV.z ) );
		absV *= scaleToCube;
		v *= scaleToCube * ( 1.0 - 2.0 * texelSizeY );
		vec2 planar = v.xy;
		float almostATexel = 1.5 * texelSizeY;
		float almostOne = 1.0 - almostATexel;
		if ( absV.z >= almostOne ) {
			if ( v.z > 0.0 )
				planar.x = 4.0 - v.x;
		} else if ( absV.x >= almostOne ) {
			float signX = sign( v.x );
			planar.x = v.z * signX + 2.0 * signX;
		} else if ( absV.y >= almostOne ) {
			float signY = sign( v.y );
			planar.x = v.x + 2.0 * signY + 2.0;
			planar.y = v.z * signY - 2.0;
		}
		return vec2( 0.125, 0.25 ) * planar + vec2( 0.375, 0.75 );
	}
	float getPointShadow( sampler2D shadowMap, vec2 shadowMapSize, float shadowIntensity, float shadowBias, float shadowRadius, vec4 shadowCoord, float shadowCameraNear, float shadowCameraFar ) {
		float shadow = 1.0;
		vec3 lightToPosition = shadowCoord.xyz;
		
		float lightToPositionLength = length( lightToPosition );
		if ( lightToPositionLength - shadowCameraFar <= 0.0 && lightToPositionLength - shadowCameraNear >= 0.0 ) {
			float dp = ( lightToPositionLength - shadowCameraNear ) / ( shadowCameraFar - shadowCameraNear );			dp += shadowBias;
			vec3 bd3D = normalize( lightToPosition );
			vec2 texelSize = vec2( 1.0 ) / ( shadowMapSize * vec2( 4.0, 2.0 ) );
			#if defined( SHADOWMAP_TYPE_PCF ) || defined( SHADOWMAP_TYPE_PCF_SOFT ) || defined( SHADOWMAP_TYPE_VSM )
				vec2 offset = vec2( - 1, 1 ) * shadowRadius * texelSize.y;
				shadow = (
					texture2DCompare( shadowMap, cubeToUV( bd3D + offset.xyy, texelSize.y ), dp ) +
					texture2DCompare( shadowMap, cubeToUV( bd3D + offset.yyy, texelSize.y ), dp ) +
					texture2DCompare( shadowMap, cubeToUV( bd3D + offset.xyx, texelSize.y ), dp ) +
					texture2DCompare( shadowMap, cubeToUV( bd3D + offset.yyx, texelSize.y ), dp ) +
					texture2DCompare( shadowMap, cubeToUV( bd3D, texelSize.y ), dp ) +
					texture2DCompare( shadowMap, cubeToUV( bd3D + offset.xxy, texelSize.y ), dp ) +
					texture2DCompare( shadowMap, cubeToUV( bd3D + offset.yxy, texelSize.y ), dp ) +
					texture2DCompare( shadowMap, cubeToUV( bd3D + offset.xxx, texelSize.y ), dp ) +
					texture2DCompare( shadowMap, cubeToUV( bd3D + offset.yxx, texelSize.y ), dp )
				) * ( 1.0 / 9.0 );
			#else
				shadow = texture2DCompare( shadowMap, cubeToUV( bd3D, texelSize.y ), dp );
			#endif
		}
		return mix( 1.0, shadow, shadowIntensity );
	}
#endif`,$P=`#if NUM_SPOT_LIGHT_COORDS > 0
	uniform mat4 spotLightMatrix[ NUM_SPOT_LIGHT_COORDS ];
	varying vec4 vSpotLightCoord[ NUM_SPOT_LIGHT_COORDS ];
#endif
#ifdef USE_SHADOWMAP
	#if NUM_DIR_LIGHT_SHADOWS > 0
		uniform mat4 directionalShadowMatrix[ NUM_DIR_LIGHT_SHADOWS ];
		varying vec4 vDirectionalShadowCoord[ NUM_DIR_LIGHT_SHADOWS ];
		struct DirectionalLightShadow {
			float shadowIntensity;
			float shadowBias;
			float shadowNormalBias;
			float shadowRadius;
			vec2 shadowMapSize;
		};
		uniform DirectionalLightShadow directionalLightShadows[ NUM_DIR_LIGHT_SHADOWS ];
	#endif
	#if NUM_SPOT_LIGHT_SHADOWS > 0
		struct SpotLightShadow {
			float shadowIntensity;
			float shadowBias;
			float shadowNormalBias;
			float shadowRadius;
			vec2 shadowMapSize;
		};
		uniform SpotLightShadow spotLightShadows[ NUM_SPOT_LIGHT_SHADOWS ];
	#endif
	#if NUM_POINT_LIGHT_SHADOWS > 0
		uniform mat4 pointShadowMatrix[ NUM_POINT_LIGHT_SHADOWS ];
		varying vec4 vPointShadowCoord[ NUM_POINT_LIGHT_SHADOWS ];
		struct PointLightShadow {
			float shadowIntensity;
			float shadowBias;
			float shadowNormalBias;
			float shadowRadius;
			vec2 shadowMapSize;
			float shadowCameraNear;
			float shadowCameraFar;
		};
		uniform PointLightShadow pointLightShadows[ NUM_POINT_LIGHT_SHADOWS ];
	#endif
#endif`,eB=`#if ( defined( USE_SHADOWMAP ) && ( NUM_DIR_LIGHT_SHADOWS > 0 || NUM_POINT_LIGHT_SHADOWS > 0 ) ) || ( NUM_SPOT_LIGHT_COORDS > 0 )
	vec3 shadowWorldNormal = inverseTransformDirection( transformedNormal, viewMatrix );
	vec4 shadowWorldPosition;
#endif
#if defined( USE_SHADOWMAP )
	#if NUM_DIR_LIGHT_SHADOWS > 0
		#pragma unroll_loop_start
		for ( int i = 0; i < NUM_DIR_LIGHT_SHADOWS; i ++ ) {
			shadowWorldPosition = worldPosition + vec4( shadowWorldNormal * directionalLightShadows[ i ].shadowNormalBias, 0 );
			vDirectionalShadowCoord[ i ] = directionalShadowMatrix[ i ] * shadowWorldPosition;
		}
		#pragma unroll_loop_end
	#endif
	#if NUM_POINT_LIGHT_SHADOWS > 0
		#pragma unroll_loop_start
		for ( int i = 0; i < NUM_POINT_LIGHT_SHADOWS; i ++ ) {
			shadowWorldPosition = worldPosition + vec4( shadowWorldNormal * pointLightShadows[ i ].shadowNormalBias, 0 );
			vPointShadowCoord[ i ] = pointShadowMatrix[ i ] * shadowWorldPosition;
		}
		#pragma unroll_loop_end
	#endif
#endif
#if NUM_SPOT_LIGHT_COORDS > 0
	#pragma unroll_loop_start
	for ( int i = 0; i < NUM_SPOT_LIGHT_COORDS; i ++ ) {
		shadowWorldPosition = worldPosition;
		#if ( defined( USE_SHADOWMAP ) && UNROLLED_LOOP_INDEX < NUM_SPOT_LIGHT_SHADOWS )
			shadowWorldPosition.xyz += shadowWorldNormal * spotLightShadows[ i ].shadowNormalBias;
		#endif
		vSpotLightCoord[ i ] = spotLightMatrix[ i ] * shadowWorldPosition;
	}
	#pragma unroll_loop_end
#endif`,tB=`float getShadowMask() {
	float shadow = 1.0;
	#ifdef USE_SHADOWMAP
	#if NUM_DIR_LIGHT_SHADOWS > 0
	DirectionalLightShadow directionalLight;
	#pragma unroll_loop_start
	for ( int i = 0; i < NUM_DIR_LIGHT_SHADOWS; i ++ ) {
		directionalLight = directionalLightShadows[ i ];
		shadow *= receiveShadow ? getShadow( directionalShadowMap[ i ], directionalLight.shadowMapSize, directionalLight.shadowIntensity, directionalLight.shadowBias, directionalLight.shadowRadius, vDirectionalShadowCoord[ i ] ) : 1.0;
	}
	#pragma unroll_loop_end
	#endif
	#if NUM_SPOT_LIGHT_SHADOWS > 0
	SpotLightShadow spotLight;
	#pragma unroll_loop_start
	for ( int i = 0; i < NUM_SPOT_LIGHT_SHADOWS; i ++ ) {
		spotLight = spotLightShadows[ i ];
		shadow *= receiveShadow ? getShadow( spotShadowMap[ i ], spotLight.shadowMapSize, spotLight.shadowIntensity, spotLight.shadowBias, spotLight.shadowRadius, vSpotLightCoord[ i ] ) : 1.0;
	}
	#pragma unroll_loop_end
	#endif
	#if NUM_POINT_LIGHT_SHADOWS > 0
	PointLightShadow pointLight;
	#pragma unroll_loop_start
	for ( int i = 0; i < NUM_POINT_LIGHT_SHADOWS; i ++ ) {
		pointLight = pointLightShadows[ i ];
		shadow *= receiveShadow ? getPointShadow( pointShadowMap[ i ], pointLight.shadowMapSize, pointLight.shadowIntensity, pointLight.shadowBias, pointLight.shadowRadius, vPointShadowCoord[ i ], pointLight.shadowCameraNear, pointLight.shadowCameraFar ) : 1.0;
	}
	#pragma unroll_loop_end
	#endif
	#endif
	return shadow;
}`,nB=`#ifdef USE_SKINNING
	mat4 boneMatX = getBoneMatrix( skinIndex.x );
	mat4 boneMatY = getBoneMatrix( skinIndex.y );
	mat4 boneMatZ = getBoneMatrix( skinIndex.z );
	mat4 boneMatW = getBoneMatrix( skinIndex.w );
#endif`,iB=`#ifdef USE_SKINNING
	uniform mat4 bindMatrix;
	uniform mat4 bindMatrixInverse;
	uniform highp sampler2D boneTexture;
	mat4 getBoneMatrix( const in float i ) {
		int size = textureSize( boneTexture, 0 ).x;
		int j = int( i ) * 4;
		int x = j % size;
		int y = j / size;
		vec4 v1 = texelFetch( boneTexture, ivec2( x, y ), 0 );
		vec4 v2 = texelFetch( boneTexture, ivec2( x + 1, y ), 0 );
		vec4 v3 = texelFetch( boneTexture, ivec2( x + 2, y ), 0 );
		vec4 v4 = texelFetch( boneTexture, ivec2( x + 3, y ), 0 );
		return mat4( v1, v2, v3, v4 );
	}
#endif`,rB=`#ifdef USE_SKINNING
	vec4 skinVertex = bindMatrix * vec4( transformed, 1.0 );
	vec4 skinned = vec4( 0.0 );
	skinned += boneMatX * skinVertex * skinWeight.x;
	skinned += boneMatY * skinVertex * skinWeight.y;
	skinned += boneMatZ * skinVertex * skinWeight.z;
	skinned += boneMatW * skinVertex * skinWeight.w;
	transformed = ( bindMatrixInverse * skinned ).xyz;
#endif`,sB=`#ifdef USE_SKINNING
	mat4 skinMatrix = mat4( 0.0 );
	skinMatrix += skinWeight.x * boneMatX;
	skinMatrix += skinWeight.y * boneMatY;
	skinMatrix += skinWeight.z * boneMatZ;
	skinMatrix += skinWeight.w * boneMatW;
	skinMatrix = bindMatrixInverse * skinMatrix * bindMatrix;
	objectNormal = vec4( skinMatrix * vec4( objectNormal, 0.0 ) ).xyz;
	#ifdef USE_TANGENT
		objectTangent = vec4( skinMatrix * vec4( objectTangent, 0.0 ) ).xyz;
	#endif
#endif`,oB=`float specularStrength;
#ifdef USE_SPECULARMAP
	vec4 texelSpecular = texture2D( specularMap, vSpecularMapUv );
	specularStrength = texelSpecular.r;
#else
	specularStrength = 1.0;
#endif`,aB=`#ifdef USE_SPECULARMAP
	uniform sampler2D specularMap;
#endif`,lB=`#if defined( TONE_MAPPING )
	gl_FragColor.rgb = toneMapping( gl_FragColor.rgb );
#endif`,uB=`#ifndef saturate
#define saturate( a ) clamp( a, 0.0, 1.0 )
#endif
uniform float toneMappingExposure;
vec3 LinearToneMapping( vec3 color ) {
	return saturate( toneMappingExposure * color );
}
vec3 ReinhardToneMapping( vec3 color ) {
	color *= toneMappingExposure;
	return saturate( color / ( vec3( 1.0 ) + color ) );
}
vec3 CineonToneMapping( vec3 color ) {
	color *= toneMappingExposure;
	color = max( vec3( 0.0 ), color - 0.004 );
	return pow( ( color * ( 6.2 * color + 0.5 ) ) / ( color * ( 6.2 * color + 1.7 ) + 0.06 ), vec3( 2.2 ) );
}
vec3 RRTAndODTFit( vec3 v ) {
	vec3 a = v * ( v + 0.0245786 ) - 0.000090537;
	vec3 b = v * ( 0.983729 * v + 0.4329510 ) + 0.238081;
	return a / b;
}
vec3 ACESFilmicToneMapping( vec3 color ) {
	const mat3 ACESInputMat = mat3(
		vec3( 0.59719, 0.07600, 0.02840 ),		vec3( 0.35458, 0.90834, 0.13383 ),
		vec3( 0.04823, 0.01566, 0.83777 )
	);
	const mat3 ACESOutputMat = mat3(
		vec3(  1.60475, -0.10208, -0.00327 ),		vec3( -0.53108,  1.10813, -0.07276 ),
		vec3( -0.07367, -0.00605,  1.07602 )
	);
	color *= toneMappingExposure / 0.6;
	color = ACESInputMat * color;
	color = RRTAndODTFit( color );
	color = ACESOutputMat * color;
	return saturate( color );
}
const mat3 LINEAR_REC2020_TO_LINEAR_SRGB = mat3(
	vec3( 1.6605, - 0.1246, - 0.0182 ),
	vec3( - 0.5876, 1.1329, - 0.1006 ),
	vec3( - 0.0728, - 0.0083, 1.1187 )
);
const mat3 LINEAR_SRGB_TO_LINEAR_REC2020 = mat3(
	vec3( 0.6274, 0.0691, 0.0164 ),
	vec3( 0.3293, 0.9195, 0.0880 ),
	vec3( 0.0433, 0.0113, 0.8956 )
);
vec3 agxDefaultContrastApprox( vec3 x ) {
	vec3 x2 = x * x;
	vec3 x4 = x2 * x2;
	return + 15.5 * x4 * x2
		- 40.14 * x4 * x
		+ 31.96 * x4
		- 6.868 * x2 * x
		+ 0.4298 * x2
		+ 0.1191 * x
		- 0.00232;
}
vec3 AgXToneMapping( vec3 color ) {
	const mat3 AgXInsetMatrix = mat3(
		vec3( 0.856627153315983, 0.137318972929847, 0.11189821299995 ),
		vec3( 0.0951212405381588, 0.761241990602591, 0.0767994186031903 ),
		vec3( 0.0482516061458583, 0.101439036467562, 0.811302368396859 )
	);
	const mat3 AgXOutsetMatrix = mat3(
		vec3( 1.1271005818144368, - 0.1413297634984383, - 0.14132976349843826 ),
		vec3( - 0.11060664309660323, 1.157823702216272, - 0.11060664309660294 ),
		vec3( - 0.016493938717834573, - 0.016493938717834257, 1.2519364065950405 )
	);
	const float AgxMinEv = - 12.47393;	const float AgxMaxEv = 4.026069;
	color *= toneMappingExposure;
	color = LINEAR_SRGB_TO_LINEAR_REC2020 * color;
	color = AgXInsetMatrix * color;
	color = max( color, 1e-10 );	color = log2( color );
	color = ( color - AgxMinEv ) / ( AgxMaxEv - AgxMinEv );
	color = clamp( color, 0.0, 1.0 );
	color = agxDefaultContrastApprox( color );
	color = AgXOutsetMatrix * color;
	color = pow( max( vec3( 0.0 ), color ), vec3( 2.2 ) );
	color = LINEAR_REC2020_TO_LINEAR_SRGB * color;
	color = clamp( color, 0.0, 1.0 );
	return color;
}
vec3 NeutralToneMapping( vec3 color ) {
	const float StartCompression = 0.8 - 0.04;
	const float Desaturation = 0.15;
	color *= toneMappingExposure;
	float x = min( color.r, min( color.g, color.b ) );
	float offset = x < 0.08 ? x - 6.25 * x * x : 0.04;
	color -= offset;
	float peak = max( color.r, max( color.g, color.b ) );
	if ( peak < StartCompression ) return color;
	float d = 1. - StartCompression;
	float newPeak = 1. - d * d / ( peak + d - StartCompression );
	color *= newPeak / peak;
	float g = 1. - 1. / ( Desaturation * ( peak - newPeak ) + 1. );
	return mix( color, vec3( newPeak ), g );
}
vec3 CustomToneMapping( vec3 color ) { return color; }`,cB=`#ifdef USE_TRANSMISSION
	material.transmission = transmission;
	material.transmissionAlpha = 1.0;
	material.thickness = thickness;
	material.attenuationDistance = attenuationDistance;
	material.attenuationColor = attenuationColor;
	#ifdef USE_TRANSMISSIONMAP
		material.transmission *= texture2D( transmissionMap, vTransmissionMapUv ).r;
	#endif
	#ifdef USE_THICKNESSMAP
		material.thickness *= texture2D( thicknessMap, vThicknessMapUv ).g;
	#endif
	vec3 pos = vWorldPosition;
	vec3 v = normalize( cameraPosition - pos );
	vec3 n = inverseTransformDirection( normal, viewMatrix );
	vec4 transmitted = getIBLVolumeRefraction(
		n, v, material.roughness, material.diffuseColor, material.specularColor, material.specularF90,
		pos, modelMatrix, viewMatrix, projectionMatrix, material.dispersion, material.ior, material.thickness,
		material.attenuationColor, material.attenuationDistance );
	material.transmissionAlpha = mix( material.transmissionAlpha, transmitted.a, material.transmission );
	totalDiffuse = mix( totalDiffuse, transmitted.rgb, material.transmission );
#endif`,fB=`#ifdef USE_TRANSMISSION
	uniform float transmission;
	uniform float thickness;
	uniform float attenuationDistance;
	uniform vec3 attenuationColor;
	#ifdef USE_TRANSMISSIONMAP
		uniform sampler2D transmissionMap;
	#endif
	#ifdef USE_THICKNESSMAP
		uniform sampler2D thicknessMap;
	#endif
	uniform vec2 transmissionSamplerSize;
	uniform sampler2D transmissionSamplerMap;
	uniform mat4 modelMatrix;
	uniform mat4 projectionMatrix;
	varying vec3 vWorldPosition;
	float w0( float a ) {
		return ( 1.0 / 6.0 ) * ( a * ( a * ( - a + 3.0 ) - 3.0 ) + 1.0 );
	}
	float w1( float a ) {
		return ( 1.0 / 6.0 ) * ( a *  a * ( 3.0 * a - 6.0 ) + 4.0 );
	}
	float w2( float a ){
		return ( 1.0 / 6.0 ) * ( a * ( a * ( - 3.0 * a + 3.0 ) + 3.0 ) + 1.0 );
	}
	float w3( float a ) {
		return ( 1.0 / 6.0 ) * ( a * a * a );
	}
	float g0( float a ) {
		return w0( a ) + w1( a );
	}
	float g1( float a ) {
		return w2( a ) + w3( a );
	}
	float h0( float a ) {
		return - 1.0 + w1( a ) / ( w0( a ) + w1( a ) );
	}
	float h1( float a ) {
		return 1.0 + w3( a ) / ( w2( a ) + w3( a ) );
	}
	vec4 bicubic( sampler2D tex, vec2 uv, vec4 texelSize, float lod ) {
		uv = uv * texelSize.zw + 0.5;
		vec2 iuv = floor( uv );
		vec2 fuv = fract( uv );
		float g0x = g0( fuv.x );
		float g1x = g1( fuv.x );
		float h0x = h0( fuv.x );
		float h1x = h1( fuv.x );
		float h0y = h0( fuv.y );
		float h1y = h1( fuv.y );
		vec2 p0 = ( vec2( iuv.x + h0x, iuv.y + h0y ) - 0.5 ) * texelSize.xy;
		vec2 p1 = ( vec2( iuv.x + h1x, iuv.y + h0y ) - 0.5 ) * texelSize.xy;
		vec2 p2 = ( vec2( iuv.x + h0x, iuv.y + h1y ) - 0.5 ) * texelSize.xy;
		vec2 p3 = ( vec2( iuv.x + h1x, iuv.y + h1y ) - 0.5 ) * texelSize.xy;
		return g0( fuv.y ) * ( g0x * textureLod( tex, p0, lod ) + g1x * textureLod( tex, p1, lod ) ) +
			g1( fuv.y ) * ( g0x * textureLod( tex, p2, lod ) + g1x * textureLod( tex, p3, lod ) );
	}
	vec4 textureBicubic( sampler2D sampler, vec2 uv, float lod ) {
		vec2 fLodSize = vec2( textureSize( sampler, int( lod ) ) );
		vec2 cLodSize = vec2( textureSize( sampler, int( lod + 1.0 ) ) );
		vec2 fLodSizeInv = 1.0 / fLodSize;
		vec2 cLodSizeInv = 1.0 / cLodSize;
		vec4 fSample = bicubic( sampler, uv, vec4( fLodSizeInv, fLodSize ), floor( lod ) );
		vec4 cSample = bicubic( sampler, uv, vec4( cLodSizeInv, cLodSize ), ceil( lod ) );
		return mix( fSample, cSample, fract( lod ) );
	}
	vec3 getVolumeTransmissionRay( const in vec3 n, const in vec3 v, const in float thickness, const in float ior, const in mat4 modelMatrix ) {
		vec3 refractionVector = refract( - v, normalize( n ), 1.0 / ior );
		vec3 modelScale;
		modelScale.x = length( vec3( modelMatrix[ 0 ].xyz ) );
		modelScale.y = length( vec3( modelMatrix[ 1 ].xyz ) );
		modelScale.z = length( vec3( modelMatrix[ 2 ].xyz ) );
		return normalize( refractionVector ) * thickness * modelScale;
	}
	float applyIorToRoughness( const in float roughness, const in float ior ) {
		return roughness * clamp( ior * 2.0 - 2.0, 0.0, 1.0 );
	}
	vec4 getTransmissionSample( const in vec2 fragCoord, const in float roughness, const in float ior ) {
		float lod = log2( transmissionSamplerSize.x ) * applyIorToRoughness( roughness, ior );
		return textureBicubic( transmissionSamplerMap, fragCoord.xy, lod );
	}
	vec3 volumeAttenuation( const in float transmissionDistance, const in vec3 attenuationColor, const in float attenuationDistance ) {
		if ( isinf( attenuationDistance ) ) {
			return vec3( 1.0 );
		} else {
			vec3 attenuationCoefficient = -log( attenuationColor ) / attenuationDistance;
			vec3 transmittance = exp( - attenuationCoefficient * transmissionDistance );			return transmittance;
		}
	}
	vec4 getIBLVolumeRefraction( const in vec3 n, const in vec3 v, const in float roughness, const in vec3 diffuseColor,
		const in vec3 specularColor, const in float specularF90, const in vec3 position, const in mat4 modelMatrix,
		const in mat4 viewMatrix, const in mat4 projMatrix, const in float dispersion, const in float ior, const in float thickness,
		const in vec3 attenuationColor, const in float attenuationDistance ) {
		vec4 transmittedLight;
		vec3 transmittance;
		#ifdef USE_DISPERSION
			float halfSpread = ( ior - 1.0 ) * 0.025 * dispersion;
			vec3 iors = vec3( ior - halfSpread, ior, ior + halfSpread );
			for ( int i = 0; i < 3; i ++ ) {
				vec3 transmissionRay = getVolumeTransmissionRay( n, v, thickness, iors[ i ], modelMatrix );
				vec3 refractedRayExit = position + transmissionRay;
				vec4 ndcPos = projMatrix * viewMatrix * vec4( refractedRayExit, 1.0 );
				vec2 refractionCoords = ndcPos.xy / ndcPos.w;
				refractionCoords += 1.0;
				refractionCoords /= 2.0;
				vec4 transmissionSample = getTransmissionSample( refractionCoords, roughness, iors[ i ] );
				transmittedLight[ i ] = transmissionSample[ i ];
				transmittedLight.a += transmissionSample.a;
				transmittance[ i ] = diffuseColor[ i ] * volumeAttenuation( length( transmissionRay ), attenuationColor, attenuationDistance )[ i ];
			}
			transmittedLight.a /= 3.0;
		#else
			vec3 transmissionRay = getVolumeTransmissionRay( n, v, thickness, ior, modelMatrix );
			vec3 refractedRayExit = position + transmissionRay;
			vec4 ndcPos = projMatrix * viewMatrix * vec4( refractedRayExit, 1.0 );
			vec2 refractionCoords = ndcPos.xy / ndcPos.w;
			refractionCoords += 1.0;
			refractionCoords /= 2.0;
			transmittedLight = getTransmissionSample( refractionCoords, roughness, ior );
			transmittance = diffuseColor * volumeAttenuation( length( transmissionRay ), attenuationColor, attenuationDistance );
		#endif
		vec3 attenuatedColor = transmittance * transmittedLight.rgb;
		vec3 F = EnvironmentBRDF( n, v, specularColor, specularF90, roughness );
		float transmittanceFactor = ( transmittance.r + transmittance.g + transmittance.b ) / 3.0;
		return vec4( ( 1.0 - F ) * attenuatedColor, 1.0 - ( 1.0 - transmittedLight.a ) * transmittanceFactor );
	}
#endif`,dB=`#if defined( USE_UV ) || defined( USE_ANISOTROPY )
	varying vec2 vUv;
#endif
#ifdef USE_MAP
	varying vec2 vMapUv;
#endif
#ifdef USE_ALPHAMAP
	varying vec2 vAlphaMapUv;
#endif
#ifdef USE_LIGHTMAP
	varying vec2 vLightMapUv;
#endif
#ifdef USE_AOMAP
	varying vec2 vAoMapUv;
#endif
#ifdef USE_BUMPMAP
	varying vec2 vBumpMapUv;
#endif
#ifdef USE_NORMALMAP
	varying vec2 vNormalMapUv;
#endif
#ifdef USE_EMISSIVEMAP
	varying vec2 vEmissiveMapUv;
#endif
#ifdef USE_METALNESSMAP
	varying vec2 vMetalnessMapUv;
#endif
#ifdef USE_ROUGHNESSMAP
	varying vec2 vRoughnessMapUv;
#endif
#ifdef USE_ANISOTROPYMAP
	varying vec2 vAnisotropyMapUv;
#endif
#ifdef USE_CLEARCOATMAP
	varying vec2 vClearcoatMapUv;
#endif
#ifdef USE_CLEARCOAT_NORMALMAP
	varying vec2 vClearcoatNormalMapUv;
#endif
#ifdef USE_CLEARCOAT_ROUGHNESSMAP
	varying vec2 vClearcoatRoughnessMapUv;
#endif
#ifdef USE_IRIDESCENCEMAP
	varying vec2 vIridescenceMapUv;
#endif
#ifdef USE_IRIDESCENCE_THICKNESSMAP
	varying vec2 vIridescenceThicknessMapUv;
#endif
#ifdef USE_SHEEN_COLORMAP
	varying vec2 vSheenColorMapUv;
#endif
#ifdef USE_SHEEN_ROUGHNESSMAP
	varying vec2 vSheenRoughnessMapUv;
#endif
#ifdef USE_SPECULARMAP
	varying vec2 vSpecularMapUv;
#endif
#ifdef USE_SPECULAR_COLORMAP
	varying vec2 vSpecularColorMapUv;
#endif
#ifdef USE_SPECULAR_INTENSITYMAP
	varying vec2 vSpecularIntensityMapUv;
#endif
#ifdef USE_TRANSMISSIONMAP
	uniform mat3 transmissionMapTransform;
	varying vec2 vTransmissionMapUv;
#endif
#ifdef USE_THICKNESSMAP
	uniform mat3 thicknessMapTransform;
	varying vec2 vThicknessMapUv;
#endif`,hB=`#if defined( USE_UV ) || defined( USE_ANISOTROPY )
	varying vec2 vUv;
#endif
#ifdef USE_MAP
	uniform mat3 mapTransform;
	varying vec2 vMapUv;
#endif
#ifdef USE_ALPHAMAP
	uniform mat3 alphaMapTransform;
	varying vec2 vAlphaMapUv;
#endif
#ifdef USE_LIGHTMAP
	uniform mat3 lightMapTransform;
	varying vec2 vLightMapUv;
#endif
#ifdef USE_AOMAP
	uniform mat3 aoMapTransform;
	varying vec2 vAoMapUv;
#endif
#ifdef USE_BUMPMAP
	uniform mat3 bumpMapTransform;
	varying vec2 vBumpMapUv;
#endif
#ifdef USE_NORMALMAP
	uniform mat3 normalMapTransform;
	varying vec2 vNormalMapUv;
#endif
#ifdef USE_DISPLACEMENTMAP
	uniform mat3 displacementMapTransform;
	varying vec2 vDisplacementMapUv;
#endif
#ifdef USE_EMISSIVEMAP
	uniform mat3 emissiveMapTransform;
	varying vec2 vEmissiveMapUv;
#endif
#ifdef USE_METALNESSMAP
	uniform mat3 metalnessMapTransform;
	varying vec2 vMetalnessMapUv;
#endif
#ifdef USE_ROUGHNESSMAP
	uniform mat3 roughnessMapTransform;
	varying vec2 vRoughnessMapUv;
#endif
#ifdef USE_ANISOTROPYMAP
	uniform mat3 anisotropyMapTransform;
	varying vec2 vAnisotropyMapUv;
#endif
#ifdef USE_CLEARCOATMAP
	uniform mat3 clearcoatMapTransform;
	varying vec2 vClearcoatMapUv;
#endif
#ifdef USE_CLEARCOAT_NORMALMAP
	uniform mat3 clearcoatNormalMapTransform;
	varying vec2 vClearcoatNormalMapUv;
#endif
#ifdef USE_CLEARCOAT_ROUGHNESSMAP
	uniform mat3 clearcoatRoughnessMapTransform;
	varying vec2 vClearcoatRoughnessMapUv;
#endif
#ifdef USE_SHEEN_COLORMAP
	uniform mat3 sheenColorMapTransform;
	varying vec2 vSheenColorMapUv;
#endif
#ifdef USE_SHEEN_ROUGHNESSMAP
	uniform mat3 sheenRoughnessMapTransform;
	varying vec2 vSheenRoughnessMapUv;
#endif
#ifdef USE_IRIDESCENCEMAP
	uniform mat3 iridescenceMapTransform;
	varying vec2 vIridescenceMapUv;
#endif
#ifdef USE_IRIDESCENCE_THICKNESSMAP
	uniform mat3 iridescenceThicknessMapTransform;
	varying vec2 vIridescenceThicknessMapUv;
#endif
#ifdef USE_SPECULARMAP
	uniform mat3 specularMapTransform;
	varying vec2 vSpecularMapUv;
#endif
#ifdef USE_SPECULAR_COLORMAP
	uniform mat3 specularColorMapTransform;
	varying vec2 vSpecularColorMapUv;
#endif
#ifdef USE_SPECULAR_INTENSITYMAP
	uniform mat3 specularIntensityMapTransform;
	varying vec2 vSpecularIntensityMapUv;
#endif
#ifdef USE_TRANSMISSIONMAP
	uniform mat3 transmissionMapTransform;
	varying vec2 vTransmissionMapUv;
#endif
#ifdef USE_THICKNESSMAP
	uniform mat3 thicknessMapTransform;
	varying vec2 vThicknessMapUv;
#endif`,pB=`#if defined( USE_UV ) || defined( USE_ANISOTROPY )
	vUv = vec3( uv, 1 ).xy;
#endif
#ifdef USE_MAP
	vMapUv = ( mapTransform * vec3( MAP_UV, 1 ) ).xy;
#endif
#ifdef USE_ALPHAMAP
	vAlphaMapUv = ( alphaMapTransform * vec3( ALPHAMAP_UV, 1 ) ).xy;
#endif
#ifdef USE_LIGHTMAP
	vLightMapUv = ( lightMapTransform * vec3( LIGHTMAP_UV, 1 ) ).xy;
#endif
#ifdef USE_AOMAP
	vAoMapUv = ( aoMapTransform * vec3( AOMAP_UV, 1 ) ).xy;
#endif
#ifdef USE_BUMPMAP
	vBumpMapUv = ( bumpMapTransform * vec3( BUMPMAP_UV, 1 ) ).xy;
#endif
#ifdef USE_NORMALMAP
	vNormalMapUv = ( normalMapTransform * vec3( NORMALMAP_UV, 1 ) ).xy;
#endif
#ifdef USE_DISPLACEMENTMAP
	vDisplacementMapUv = ( displacementMapTransform * vec3( DISPLACEMENTMAP_UV, 1 ) ).xy;
#endif
#ifdef USE_EMISSIVEMAP
	vEmissiveMapUv = ( emissiveMapTransform * vec3( EMISSIVEMAP_UV, 1 ) ).xy;
#endif
#ifdef USE_METALNESSMAP
	vMetalnessMapUv = ( metalnessMapTransform * vec3( METALNESSMAP_UV, 1 ) ).xy;
#endif
#ifdef USE_ROUGHNESSMAP
	vRoughnessMapUv = ( roughnessMapTransform * vec3( ROUGHNESSMAP_UV, 1 ) ).xy;
#endif
#ifdef USE_ANISOTROPYMAP
	vAnisotropyMapUv = ( anisotropyMapTransform * vec3( ANISOTROPYMAP_UV, 1 ) ).xy;
#endif
#ifdef USE_CLEARCOATMAP
	vClearcoatMapUv = ( clearcoatMapTransform * vec3( CLEARCOATMAP_UV, 1 ) ).xy;
#endif
#ifdef USE_CLEARCOAT_NORMALMAP
	vClearcoatNormalMapUv = ( clearcoatNormalMapTransform * vec3( CLEARCOAT_NORMALMAP_UV, 1 ) ).xy;
#endif
#ifdef USE_CLEARCOAT_ROUGHNESSMAP
	vClearcoatRoughnessMapUv = ( clearcoatRoughnessMapTransform * vec3( CLEARCOAT_ROUGHNESSMAP_UV, 1 ) ).xy;
#endif
#ifdef USE_IRIDESCENCEMAP
	vIridescenceMapUv = ( iridescenceMapTransform * vec3( IRIDESCENCEMAP_UV, 1 ) ).xy;
#endif
#ifdef USE_IRIDESCENCE_THICKNESSMAP
	vIridescenceThicknessMapUv = ( iridescenceThicknessMapTransform * vec3( IRIDESCENCE_THICKNESSMAP_UV, 1 ) ).xy;
#endif
#ifdef USE_SHEEN_COLORMAP
	vSheenColorMapUv = ( sheenColorMapTransform * vec3( SHEEN_COLORMAP_UV, 1 ) ).xy;
#endif
#ifdef USE_SHEEN_ROUGHNESSMAP
	vSheenRoughnessMapUv = ( sheenRoughnessMapTransform * vec3( SHEEN_ROUGHNESSMAP_UV, 1 ) ).xy;
#endif
#ifdef USE_SPECULARMAP
	vSpecularMapUv = ( specularMapTransform * vec3( SPECULARMAP_UV, 1 ) ).xy;
#endif
#ifdef USE_SPECULAR_COLORMAP
	vSpecularColorMapUv = ( specularColorMapTransform * vec3( SPECULAR_COLORMAP_UV, 1 ) ).xy;
#endif
#ifdef USE_SPECULAR_INTENSITYMAP
	vSpecularIntensityMapUv = ( specularIntensityMapTransform * vec3( SPECULAR_INTENSITYMAP_UV, 1 ) ).xy;
#endif
#ifdef USE_TRANSMISSIONMAP
	vTransmissionMapUv = ( transmissionMapTransform * vec3( TRANSMISSIONMAP_UV, 1 ) ).xy;
#endif
#ifdef USE_THICKNESSMAP
	vThicknessMapUv = ( thicknessMapTransform * vec3( THICKNESSMAP_UV, 1 ) ).xy;
#endif`,mB=`#if defined( USE_ENVMAP ) || defined( DISTANCE ) || defined ( USE_SHADOWMAP ) || defined ( USE_TRANSMISSION ) || NUM_SPOT_LIGHT_COORDS > 0
	vec4 worldPosition = vec4( transformed, 1.0 );
	#ifdef USE_BATCHING
		worldPosition = batchingMatrix * worldPosition;
	#endif
	#ifdef USE_INSTANCING
		worldPosition = instanceMatrix * worldPosition;
	#endif
	worldPosition = modelMatrix * worldPosition;
#endif`;const gB=`varying vec2 vUv;
uniform mat3 uvTransform;
void main() {
	vUv = ( uvTransform * vec3( uv, 1 ) ).xy;
	gl_Position = vec4( position.xy, 1.0, 1.0 );
}`,vB=`uniform sampler2D t2D;
uniform float backgroundIntensity;
varying vec2 vUv;
void main() {
	vec4 texColor = texture2D( t2D, vUv );
	#ifdef DECODE_VIDEO_TEXTURE
		texColor = vec4( mix( pow( texColor.rgb * 0.9478672986 + vec3( 0.0521327014 ), vec3( 2.4 ) ), texColor.rgb * 0.0773993808, vec3( lessThanEqual( texColor.rgb, vec3( 0.04045 ) ) ) ), texColor.w );
	#endif
	texColor.rgb *= backgroundIntensity;
	gl_FragColor = texColor;
	#include <tonemapping_fragment>
	#include <colorspace_fragment>
}`,yB=`varying vec3 vWorldDirection;
#include <common>
void main() {
	vWorldDirection = transformDirection( position, modelMatrix );
	#include <begin_vertex>
	#include <project_vertex>
	gl_Position.z = gl_Position.w;
}`,_B=`#ifdef ENVMAP_TYPE_CUBE
	uniform samplerCube envMap;
#elif defined( ENVMAP_TYPE_CUBE_UV )
	uniform sampler2D envMap;
#endif
uniform float flipEnvMap;
uniform float backgroundBlurriness;
uniform float backgroundIntensity;
uniform mat3 backgroundRotation;
varying vec3 vWorldDirection;
#include <cube_uv_reflection_fragment>
void main() {
	#ifdef ENVMAP_TYPE_CUBE
		vec4 texColor = textureCube( envMap, backgroundRotation * vec3( flipEnvMap * vWorldDirection.x, vWorldDirection.yz ) );
	#elif defined( ENVMAP_TYPE_CUBE_UV )
		vec4 texColor = textureCubeUV( envMap, backgroundRotation * vWorldDirection, backgroundBlurriness );
	#else
		vec4 texColor = vec4( 0.0, 0.0, 0.0, 1.0 );
	#endif
	texColor.rgb *= backgroundIntensity;
	gl_FragColor = texColor;
	#include <tonemapping_fragment>
	#include <colorspace_fragment>
}`,xB=`varying vec3 vWorldDirection;
#include <common>
void main() {
	vWorldDirection = transformDirection( position, modelMatrix );
	#include <begin_vertex>
	#include <project_vertex>
	gl_Position.z = gl_Position.w;
}`,AB=`uniform samplerCube tCube;
uniform float tFlip;
uniform float opacity;
varying vec3 vWorldDirection;
void main() {
	vec4 texColor = textureCube( tCube, vec3( tFlip * vWorldDirection.x, vWorldDirection.yz ) );
	gl_FragColor = texColor;
	gl_FragColor.a *= opacity;
	#include <tonemapping_fragment>
	#include <colorspace_fragment>
}`,SB=`#include <common>
#include <batching_pars_vertex>
#include <uv_pars_vertex>
#include <displacementmap_pars_vertex>
#include <morphtarget_pars_vertex>
#include <skinning_pars_vertex>
#include <logdepthbuf_pars_vertex>
#include <clipping_planes_pars_vertex>
varying vec2 vHighPrecisionZW;
void main() {
	#include <uv_vertex>
	#include <batching_vertex>
	#include <skinbase_vertex>
	#include <morphinstance_vertex>
	#ifdef USE_DISPLACEMENTMAP
		#include <beginnormal_vertex>
		#include <morphnormal_vertex>
		#include <skinnormal_vertex>
	#endif
	#include <begin_vertex>
	#include <morphtarget_vertex>
	#include <skinning_vertex>
	#include <displacementmap_vertex>
	#include <project_vertex>
	#include <logdepthbuf_vertex>
	#include <clipping_planes_vertex>
	vHighPrecisionZW = gl_Position.zw;
}`,MB=`#if DEPTH_PACKING == 3200
	uniform float opacity;
#endif
#include <common>
#include <packing>
#include <uv_pars_fragment>
#include <map_pars_fragment>
#include <alphamap_pars_fragment>
#include <alphatest_pars_fragment>
#include <alphahash_pars_fragment>
#include <logdepthbuf_pars_fragment>
#include <clipping_planes_pars_fragment>
varying vec2 vHighPrecisionZW;
void main() {
	vec4 diffuseColor = vec4( 1.0 );
	#include <clipping_planes_fragment>
	#if DEPTH_PACKING == 3200
		diffuseColor.a = opacity;
	#endif
	#include <map_fragment>
	#include <alphamap_fragment>
	#include <alphatest_fragment>
	#include <alphahash_fragment>
	#include <logdepthbuf_fragment>
	float fragCoordZ = 0.5 * vHighPrecisionZW[0] / vHighPrecisionZW[1] + 0.5;
	#if DEPTH_PACKING == 3200
		gl_FragColor = vec4( vec3( 1.0 - fragCoordZ ), opacity );
	#elif DEPTH_PACKING == 3201
		gl_FragColor = packDepthToRGBA( fragCoordZ );
	#elif DEPTH_PACKING == 3202
		gl_FragColor = vec4( packDepthToRGB( fragCoordZ ), 1.0 );
	#elif DEPTH_PACKING == 3203
		gl_FragColor = vec4( packDepthToRG( fragCoordZ ), 0.0, 1.0 );
	#endif
}`,EB=`#define DISTANCE
varying vec3 vWorldPosition;
#include <common>
#include <batching_pars_vertex>
#include <uv_pars_vertex>
#include <displacementmap_pars_vertex>
#include <morphtarget_pars_vertex>
#include <skinning_pars_vertex>
#include <clipping_planes_pars_vertex>
void main() {
	#include <uv_vertex>
	#include <batching_vertex>
	#include <skinbase_vertex>
	#include <morphinstance_vertex>
	#ifdef USE_DISPLACEMENTMAP
		#include <beginnormal_vertex>
		#include <morphnormal_vertex>
		#include <skinnormal_vertex>
	#endif
	#include <begin_vertex>
	#include <morphtarget_vertex>
	#include <skinning_vertex>
	#include <displacementmap_vertex>
	#include <project_vertex>
	#include <worldpos_vertex>
	#include <clipping_planes_vertex>
	vWorldPosition = worldPosition.xyz;
}`,wB=`#define DISTANCE
uniform vec3 referencePosition;
uniform float nearDistance;
uniform float farDistance;
varying vec3 vWorldPosition;
#include <common>
#include <packing>
#include <uv_pars_fragment>
#include <map_pars_fragment>
#include <alphamap_pars_fragment>
#include <alphatest_pars_fragment>
#include <alphahash_pars_fragment>
#include <clipping_planes_pars_fragment>
void main () {
	vec4 diffuseColor = vec4( 1.0 );
	#include <clipping_planes_fragment>
	#include <map_fragment>
	#include <alphamap_fragment>
	#include <alphatest_fragment>
	#include <alphahash_fragment>
	float dist = length( vWorldPosition - referencePosition );
	dist = ( dist - nearDistance ) / ( farDistance - nearDistance );
	dist = saturate( dist );
	gl_FragColor = packDepthToRGBA( dist );
}`,CB=`varying vec3 vWorldDirection;
#include <common>
void main() {
	vWorldDirection = transformDirection( position, modelMatrix );
	#include <begin_vertex>
	#include <project_vertex>
}`,TB=`uniform sampler2D tEquirect;
varying vec3 vWorldDirection;
#include <common>
void main() {
	vec3 direction = normalize( vWorldDirection );
	vec2 sampleUV = equirectUv( direction );
	gl_FragColor = texture2D( tEquirect, sampleUV );
	#include <tonemapping_fragment>
	#include <colorspace_fragment>
}`,bB=`uniform float scale;
attribute float lineDistance;
varying float vLineDistance;
#include <common>
#include <uv_pars_vertex>
#include <color_pars_vertex>
#include <fog_pars_vertex>
#include <morphtarget_pars_vertex>
#include <logdepthbuf_pars_vertex>
#include <clipping_planes_pars_vertex>
void main() {
	vLineDistance = scale * lineDistance;
	#include <uv_vertex>
	#include <color_vertex>
	#include <morphinstance_vertex>
	#include <morphcolor_vertex>
	#include <begin_vertex>
	#include <morphtarget_vertex>
	#include <project_vertex>
	#include <logdepthbuf_vertex>
	#include <clipping_planes_vertex>
	#include <fog_vertex>
}`,RB=`uniform vec3 diffuse;
uniform float opacity;
uniform float dashSize;
uniform float totalSize;
varying float vLineDistance;
#include <common>
#include <color_pars_fragment>
#include <uv_pars_fragment>
#include <map_pars_fragment>
#include <fog_pars_fragment>
#include <logdepthbuf_pars_fragment>
#include <clipping_planes_pars_fragment>
void main() {
	vec4 diffuseColor = vec4( diffuse, opacity );
	#include <clipping_planes_fragment>
	if ( mod( vLineDistance, totalSize ) > dashSize ) {
		discard;
	}
	vec3 outgoingLight = vec3( 0.0 );
	#include <logdepthbuf_fragment>
	#include <map_fragment>
	#include <color_fragment>
	outgoingLight = diffuseColor.rgb;
	#include <opaque_fragment>
	#include <tonemapping_fragment>
	#include <colorspace_fragment>
	#include <fog_fragment>
	#include <premultiplied_alpha_fragment>
}`,IB=`#include <common>
#include <batching_pars_vertex>
#include <uv_pars_vertex>
#include <envmap_pars_vertex>
#include <color_pars_vertex>
#include <fog_pars_vertex>
#include <morphtarget_pars_vertex>
#include <skinning_pars_vertex>
#include <logdepthbuf_pars_vertex>
#include <clipping_planes_pars_vertex>
void main() {
	#include <uv_vertex>
	#include <color_vertex>
	#include <morphinstance_vertex>
	#include <morphcolor_vertex>
	#include <batching_vertex>
	#if defined ( USE_ENVMAP ) || defined ( USE_SKINNING )
		#include <beginnormal_vertex>
		#include <morphnormal_vertex>
		#include <skinbase_vertex>
		#include <skinnormal_vertex>
		#include <defaultnormal_vertex>
	#endif
	#include <begin_vertex>
	#include <morphtarget_vertex>
	#include <skinning_vertex>
	#include <project_vertex>
	#include <logdepthbuf_vertex>
	#include <clipping_planes_vertex>
	#include <worldpos_vertex>
	#include <envmap_vertex>
	#include <fog_vertex>
}`,PB=`uniform vec3 diffuse;
uniform float opacity;
#ifndef FLAT_SHADED
	varying vec3 vNormal;
#endif
#include <common>
#include <dithering_pars_fragment>
#include <color_pars_fragment>
#include <uv_pars_fragment>
#include <map_pars_fragment>
#include <alphamap_pars_fragment>
#include <alphatest_pars_fragment>
#include <alphahash_pars_fragment>
#include <aomap_pars_fragment>
#include <lightmap_pars_fragment>
#include <envmap_common_pars_fragment>
#include <envmap_pars_fragment>
#include <fog_pars_fragment>
#include <specularmap_pars_fragment>
#include <logdepthbuf_pars_fragment>
#include <clipping_planes_pars_fragment>
void main() {
	vec4 diffuseColor = vec4( diffuse, opacity );
	#include <clipping_planes_fragment>
	#include <logdepthbuf_fragment>
	#include <map_fragment>
	#include <color_fragment>
	#include <alphamap_fragment>
	#include <alphatest_fragment>
	#include <alphahash_fragment>
	#include <specularmap_fragment>
	ReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) );
	#ifdef USE_LIGHTMAP
		vec4 lightMapTexel = texture2D( lightMap, vLightMapUv );
		reflectedLight.indirectDiffuse += lightMapTexel.rgb * lightMapIntensity * RECIPROCAL_PI;
	#else
		reflectedLight.indirectDiffuse += vec3( 1.0 );
	#endif
	#include <aomap_fragment>
	reflectedLight.indirectDiffuse *= diffuseColor.rgb;
	vec3 outgoingLight = reflectedLight.indirectDiffuse;
	#include <envmap_fragment>
	#include <opaque_fragment>
	#include <tonemapping_fragment>
	#include <colorspace_fragment>
	#include <fog_fragment>
	#include <premultiplied_alpha_fragment>
	#include <dithering_fragment>
}`,BB=`#define LAMBERT
varying vec3 vViewPosition;
#include <common>
#include <batching_pars_vertex>
#include <uv_pars_vertex>
#include <displacementmap_pars_vertex>
#include <envmap_pars_vertex>
#include <color_pars_vertex>
#include <fog_pars_vertex>
#include <normal_pars_vertex>
#include <morphtarget_pars_vertex>
#include <skinning_pars_vertex>
#include <shadowmap_pars_vertex>
#include <logdepthbuf_pars_vertex>
#include <clipping_planes_pars_vertex>
void main() {
	#include <uv_vertex>
	#include <color_vertex>
	#include <morphinstance_vertex>
	#include <morphcolor_vertex>
	#include <batching_vertex>
	#include <beginnormal_vertex>
	#include <morphnormal_vertex>
	#include <skinbase_vertex>
	#include <skinnormal_vertex>
	#include <defaultnormal_vertex>
	#include <normal_vertex>
	#include <begin_vertex>
	#include <morphtarget_vertex>
	#include <skinning_vertex>
	#include <displacementmap_vertex>
	#include <project_vertex>
	#include <logdepthbuf_vertex>
	#include <clipping_planes_vertex>
	vViewPosition = - mvPosition.xyz;
	#include <worldpos_vertex>
	#include <envmap_vertex>
	#include <shadowmap_vertex>
	#include <fog_vertex>
}`,LB=`#define LAMBERT
uniform vec3 diffuse;
uniform vec3 emissive;
uniform float opacity;
#include <common>
#include <packing>
#include <dithering_pars_fragment>
#include <color_pars_fragment>
#include <uv_pars_fragment>
#include <map_pars_fragment>
#include <alphamap_pars_fragment>
#include <alphatest_pars_fragment>
#include <alphahash_pars_fragment>
#include <aomap_pars_fragment>
#include <lightmap_pars_fragment>
#include <emissivemap_pars_fragment>
#include <envmap_common_pars_fragment>
#include <envmap_pars_fragment>
#include <fog_pars_fragment>
#include <bsdfs>
#include <lights_pars_begin>
#include <normal_pars_fragment>
#include <lights_lambert_pars_fragment>
#include <shadowmap_pars_fragment>
#include <bumpmap_pars_fragment>
#include <normalmap_pars_fragment>
#include <specularmap_pars_fragment>
#include <logdepthbuf_pars_fragment>
#include <clipping_planes_pars_fragment>
void main() {
	vec4 diffuseColor = vec4( diffuse, opacity );
	#include <clipping_planes_fragment>
	ReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) );
	vec3 totalEmissiveRadiance = emissive;
	#include <logdepthbuf_fragment>
	#include <map_fragment>
	#include <color_fragment>
	#include <alphamap_fragment>
	#include <alphatest_fragment>
	#include <alphahash_fragment>
	#include <specularmap_fragment>
	#include <normal_fragment_begin>
	#include <normal_fragment_maps>
	#include <emissivemap_fragment>
	#include <lights_lambert_fragment>
	#include <lights_fragment_begin>
	#include <lights_fragment_maps>
	#include <lights_fragment_end>
	#include <aomap_fragment>
	vec3 outgoingLight = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse + totalEmissiveRadiance;
	#include <envmap_fragment>
	#include <opaque_fragment>
	#include <tonemapping_fragment>
	#include <colorspace_fragment>
	#include <fog_fragment>
	#include <premultiplied_alpha_fragment>
	#include <dithering_fragment>
}`,DB=`#define MATCAP
varying vec3 vViewPosition;
#include <common>
#include <batching_pars_vertex>
#include <uv_pars_vertex>
#include <color_pars_vertex>
#include <displacementmap_pars_vertex>
#include <fog_pars_vertex>
#include <normal_pars_vertex>
#include <morphtarget_pars_vertex>
#include <skinning_pars_vertex>
#include <logdepthbuf_pars_vertex>
#include <clipping_planes_pars_vertex>
void main() {
	#include <uv_vertex>
	#include <color_vertex>
	#include <morphinstance_vertex>
	#include <morphcolor_vertex>
	#include <batching_vertex>
	#include <beginnormal_vertex>
	#include <morphnormal_vertex>
	#include <skinbase_vertex>
	#include <skinnormal_vertex>
	#include <defaultnormal_vertex>
	#include <normal_vertex>
	#include <begin_vertex>
	#include <morphtarget_vertex>
	#include <skinning_vertex>
	#include <displacementmap_vertex>
	#include <project_vertex>
	#include <logdepthbuf_vertex>
	#include <clipping_planes_vertex>
	#include <fog_vertex>
	vViewPosition = - mvPosition.xyz;
}`,FB=`#define MATCAP
uniform vec3 diffuse;
uniform float opacity;
uniform sampler2D matcap;
varying vec3 vViewPosition;
#include <common>
#include <dithering_pars_fragment>
#include <color_pars_fragment>
#include <uv_pars_fragment>
#include <map_pars_fragment>
#include <alphamap_pars_fragment>
#include <alphatest_pars_fragment>
#include <alphahash_pars_fragment>
#include <fog_pars_fragment>
#include <normal_pars_fragment>
#include <bumpmap_pars_fragment>
#include <normalmap_pars_fragment>
#include <logdepthbuf_pars_fragment>
#include <clipping_planes_pars_fragment>
void main() {
	vec4 diffuseColor = vec4( diffuse, opacity );
	#include <clipping_planes_fragment>
	#include <logdepthbuf_fragment>
	#include <map_fragment>
	#include <color_fragment>
	#include <alphamap_fragment>
	#include <alphatest_fragment>
	#include <alphahash_fragment>
	#include <normal_fragment_begin>
	#include <normal_fragment_maps>
	vec3 viewDir = normalize( vViewPosition );
	vec3 x = normalize( vec3( viewDir.z, 0.0, - viewDir.x ) );
	vec3 y = cross( viewDir, x );
	vec2 uv = vec2( dot( x, normal ), dot( y, normal ) ) * 0.495 + 0.5;
	#ifdef USE_MATCAP
		vec4 matcapColor = texture2D( matcap, uv );
	#else
		vec4 matcapColor = vec4( vec3( mix( 0.2, 0.8, uv.y ) ), 1.0 );
	#endif
	vec3 outgoingLight = diffuseColor.rgb * matcapColor.rgb;
	#include <opaque_fragment>
	#include <tonemapping_fragment>
	#include <colorspace_fragment>
	#include <fog_fragment>
	#include <premultiplied_alpha_fragment>
	#include <dithering_fragment>
}`,NB=`#define NORMAL
#if defined( FLAT_SHADED ) || defined( USE_BUMPMAP ) || defined( USE_NORMALMAP_TANGENTSPACE )
	varying vec3 vViewPosition;
#endif
#include <common>
#include <batching_pars_vertex>
#include <uv_pars_vertex>
#include <displacementmap_pars_vertex>
#include <normal_pars_vertex>
#include <morphtarget_pars_vertex>
#include <skinning_pars_vertex>
#include <logdepthbuf_pars_vertex>
#include <clipping_planes_pars_vertex>
void main() {
	#include <uv_vertex>
	#include <batching_vertex>
	#include <beginnormal_vertex>
	#include <morphinstance_vertex>
	#include <morphnormal_vertex>
	#include <skinbase_vertex>
	#include <skinnormal_vertex>
	#include <defaultnormal_vertex>
	#include <normal_vertex>
	#include <begin_vertex>
	#include <morphtarget_vertex>
	#include <skinning_vertex>
	#include <displacementmap_vertex>
	#include <project_vertex>
	#include <logdepthbuf_vertex>
	#include <clipping_planes_vertex>
#if defined( FLAT_SHADED ) || defined( USE_BUMPMAP ) || defined( USE_NORMALMAP_TANGENTSPACE )
	vViewPosition = - mvPosition.xyz;
#endif
}`,UB=`#define NORMAL
uniform float opacity;
#if defined( FLAT_SHADED ) || defined( USE_BUMPMAP ) || defined( USE_NORMALMAP_TANGENTSPACE )
	varying vec3 vViewPosition;
#endif
#include <packing>
#include <uv_pars_fragment>
#include <normal_pars_fragment>
#include <bumpmap_pars_fragment>
#include <normalmap_pars_fragment>
#include <logdepthbuf_pars_fragment>
#include <clipping_planes_pars_fragment>
void main() {
	vec4 diffuseColor = vec4( 0.0, 0.0, 0.0, opacity );
	#include <clipping_planes_fragment>
	#include <logdepthbuf_fragment>
	#include <normal_fragment_begin>
	#include <normal_fragment_maps>
	gl_FragColor = vec4( packNormalToRGB( normal ), diffuseColor.a );
	#ifdef OPAQUE
		gl_FragColor.a = 1.0;
	#endif
}`,OB=`#define PHONG
varying vec3 vViewPosition;
#include <common>
#include <batching_pars_vertex>
#include <uv_pars_vertex>
#include <displacementmap_pars_vertex>
#include <envmap_pars_vertex>
#include <color_pars_vertex>
#include <fog_pars_vertex>
#include <normal_pars_vertex>
#include <morphtarget_pars_vertex>
#include <skinning_pars_vertex>
#include <shadowmap_pars_vertex>
#include <logdepthbuf_pars_vertex>
#include <clipping_planes_pars_vertex>
void main() {
	#include <uv_vertex>
	#include <color_vertex>
	#include <morphcolor_vertex>
	#include <batching_vertex>
	#include <beginnormal_vertex>
	#include <morphinstance_vertex>
	#include <morphnormal_vertex>
	#include <skinbase_vertex>
	#include <skinnormal_vertex>
	#include <defaultnormal_vertex>
	#include <normal_vertex>
	#include <begin_vertex>
	#include <morphtarget_vertex>
	#include <skinning_vertex>
	#include <displacementmap_vertex>
	#include <project_vertex>
	#include <logdepthbuf_vertex>
	#include <clipping_planes_vertex>
	vViewPosition = - mvPosition.xyz;
	#include <worldpos_vertex>
	#include <envmap_vertex>
	#include <shadowmap_vertex>
	#include <fog_vertex>
}`,kB=`#define PHONG
uniform vec3 diffuse;
uniform vec3 emissive;
uniform vec3 specular;
uniform float shininess;
uniform float opacity;
#include <common>
#include <packing>
#include <dithering_pars_fragment>
#include <color_pars_fragment>
#include <uv_pars_fragment>
#include <map_pars_fragment>
#include <alphamap_pars_fragment>
#include <alphatest_pars_fragment>
#include <alphahash_pars_fragment>
#include <aomap_pars_fragment>
#include <lightmap_pars_fragment>
#include <emissivemap_pars_fragment>
#include <envmap_common_pars_fragment>
#include <envmap_pars_fragment>
#include <fog_pars_fragment>
#include <bsdfs>
#include <lights_pars_begin>
#include <normal_pars_fragment>
#include <lights_phong_pars_fragment>
#include <shadowmap_pars_fragment>
#include <bumpmap_pars_fragment>
#include <normalmap_pars_fragment>
#include <specularmap_pars_fragment>
#include <logdepthbuf_pars_fragment>
#include <clipping_planes_pars_fragment>
void main() {
	vec4 diffuseColor = vec4( diffuse, opacity );
	#include <clipping_planes_fragment>
	ReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) );
	vec3 totalEmissiveRadiance = emissive;
	#include <logdepthbuf_fragment>
	#include <map_fragment>
	#include <color_fragment>
	#include <alphamap_fragment>
	#include <alphatest_fragment>
	#include <alphahash_fragment>
	#include <specularmap_fragment>
	#include <normal_fragment_begin>
	#include <normal_fragment_maps>
	#include <emissivemap_fragment>
	#include <lights_phong_fragment>
	#include <lights_fragment_begin>
	#include <lights_fragment_maps>
	#include <lights_fragment_end>
	#include <aomap_fragment>
	vec3 outgoingLight = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse + reflectedLight.directSpecular + reflectedLight.indirectSpecular + totalEmissiveRadiance;
	#include <envmap_fragment>
	#include <opaque_fragment>
	#include <tonemapping_fragment>
	#include <colorspace_fragment>
	#include <fog_fragment>
	#include <premultiplied_alpha_fragment>
	#include <dithering_fragment>
}`,HB=`#define STANDARD
varying vec3 vViewPosition;
#ifdef USE_TRANSMISSION
	varying vec3 vWorldPosition;
#endif
#include <common>
#include <batching_pars_vertex>
#include <uv_pars_vertex>
#include <displacementmap_pars_vertex>
#include <color_pars_vertex>
#include <fog_pars_vertex>
#include <normal_pars_vertex>
#include <morphtarget_pars_vertex>
#include <skinning_pars_vertex>
#include <shadowmap_pars_vertex>
#include <logdepthbuf_pars_vertex>
#include <clipping_planes_pars_vertex>
void main() {
	#include <uv_vertex>
	#include <color_vertex>
	#include <morphinstance_vertex>
	#include <morphcolor_vertex>
	#include <batching_vertex>
	#include <beginnormal_vertex>
	#include <morphnormal_vertex>
	#include <skinbase_vertex>
	#include <skinnormal_vertex>
	#include <defaultnormal_vertex>
	#include <normal_vertex>
	#include <begin_vertex>
	#include <morphtarget_vertex>
	#include <skinning_vertex>
	#include <displacementmap_vertex>
	#include <project_vertex>
	#include <logdepthbuf_vertex>
	#include <clipping_planes_vertex>
	vViewPosition = - mvPosition.xyz;
	#include <worldpos_vertex>
	#include <shadowmap_vertex>
	#include <fog_vertex>
#ifdef USE_TRANSMISSION
	vWorldPosition = worldPosition.xyz;
#endif
}`,zB=`#define STANDARD
#ifdef PHYSICAL
	#define IOR
	#define USE_SPECULAR
#endif
uniform vec3 diffuse;
uniform vec3 emissive;
uniform float roughness;
uniform float metalness;
uniform float opacity;
#ifdef IOR
	uniform float ior;
#endif
#ifdef USE_SPECULAR
	uniform float specularIntensity;
	uniform vec3 specularColor;
	#ifdef USE_SPECULAR_COLORMAP
		uniform sampler2D specularColorMap;
	#endif
	#ifdef USE_SPECULAR_INTENSITYMAP
		uniform sampler2D specularIntensityMap;
	#endif
#endif
#ifdef USE_CLEARCOAT
	uniform float clearcoat;
	uniform float clearcoatRoughness;
#endif
#ifdef USE_DISPERSION
	uniform float dispersion;
#endif
#ifdef USE_IRIDESCENCE
	uniform float iridescence;
	uniform float iridescenceIOR;
	uniform float iridescenceThicknessMinimum;
	uniform float iridescenceThicknessMaximum;
#endif
#ifdef USE_SHEEN
	uniform vec3 sheenColor;
	uniform float sheenRoughness;
	#ifdef USE_SHEEN_COLORMAP
		uniform sampler2D sheenColorMap;
	#endif
	#ifdef USE_SHEEN_ROUGHNESSMAP
		uniform sampler2D sheenRoughnessMap;
	#endif
#endif
#ifdef USE_ANISOTROPY
	uniform vec2 anisotropyVector;
	#ifdef USE_ANISOTROPYMAP
		uniform sampler2D anisotropyMap;
	#endif
#endif
varying vec3 vViewPosition;
#include <common>
#include <packing>
#include <dithering_pars_fragment>
#include <color_pars_fragment>
#include <uv_pars_fragment>
#include <map_pars_fragment>
#include <alphamap_pars_fragment>
#include <alphatest_pars_fragment>
#include <alphahash_pars_fragment>
#include <aomap_pars_fragment>
#include <lightmap_pars_fragment>
#include <emissivemap_pars_fragment>
#include <iridescence_fragment>
#include <cube_uv_reflection_fragment>
#include <envmap_common_pars_fragment>
#include <envmap_physical_pars_fragment>
#include <fog_pars_fragment>
#include <lights_pars_begin>
#include <normal_pars_fragment>
#include <lights_physical_pars_fragment>
#include <transmission_pars_fragment>
#include <shadowmap_pars_fragment>
#include <bumpmap_pars_fragment>
#include <normalmap_pars_fragment>
#include <clearcoat_pars_fragment>
#include <iridescence_pars_fragment>
#include <roughnessmap_pars_fragment>
#include <metalnessmap_pars_fragment>
#include <logdepthbuf_pars_fragment>
#include <clipping_planes_pars_fragment>
void main() {
	vec4 diffuseColor = vec4( diffuse, opacity );
	#include <clipping_planes_fragment>
	ReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) );
	vec3 totalEmissiveRadiance = emissive;
	#include <logdepthbuf_fragment>
	#include <map_fragment>
	#include <color_fragment>
	#include <alphamap_fragment>
	#include <alphatest_fragment>
	#include <alphahash_fragment>
	#include <roughnessmap_fragment>
	#include <metalnessmap_fragment>
	#include <normal_fragment_begin>
	#include <normal_fragment_maps>
	#include <clearcoat_normal_fragment_begin>
	#include <clearcoat_normal_fragment_maps>
	#include <emissivemap_fragment>
	#include <lights_physical_fragment>
	#include <lights_fragment_begin>
	#include <lights_fragment_maps>
	#include <lights_fragment_end>
	#include <aomap_fragment>
	vec3 totalDiffuse = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse;
	vec3 totalSpecular = reflectedLight.directSpecular + reflectedLight.indirectSpecular;
	#include <transmission_fragment>
	vec3 outgoingLight = totalDiffuse + totalSpecular + totalEmissiveRadiance;
	#ifdef USE_SHEEN
		float sheenEnergyComp = 1.0 - 0.157 * max3( material.sheenColor );
		outgoingLight = outgoingLight * sheenEnergyComp + sheenSpecularDirect + sheenSpecularIndirect;
	#endif
	#ifdef USE_CLEARCOAT
		float dotNVcc = saturate( dot( geometryClearcoatNormal, geometryViewDir ) );
		vec3 Fcc = F_Schlick( material.clearcoatF0, material.clearcoatF90, dotNVcc );
		outgoingLight = outgoingLight * ( 1.0 - material.clearcoat * Fcc ) + ( clearcoatSpecularDirect + clearcoatSpecularIndirect ) * material.clearcoat;
	#endif
	#include <opaque_fragment>
	#include <tonemapping_fragment>
	#include <colorspace_fragment>
	#include <fog_fragment>
	#include <premultiplied_alpha_fragment>
	#include <dithering_fragment>
}`,GB=`#define TOON
varying vec3 vViewPosition;
#include <common>
#include <batching_pars_vertex>
#include <uv_pars_vertex>
#include <displacementmap_pars_vertex>
#include <color_pars_vertex>
#include <fog_pars_vertex>
#include <normal_pars_vertex>
#include <morphtarget_pars_vertex>
#include <skinning_pars_vertex>
#include <shadowmap_pars_vertex>
#include <logdepthbuf_pars_vertex>
#include <clipping_planes_pars_vertex>
void main() {
	#include <uv_vertex>
	#include <color_vertex>
	#include <morphinstance_vertex>
	#include <morphcolor_vertex>
	#include <batching_vertex>
	#include <beginnormal_vertex>
	#include <morphnormal_vertex>
	#include <skinbase_vertex>
	#include <skinnormal_vertex>
	#include <defaultnormal_vertex>
	#include <normal_vertex>
	#include <begin_vertex>
	#include <morphtarget_vertex>
	#include <skinning_vertex>
	#include <displacementmap_vertex>
	#include <project_vertex>
	#include <logdepthbuf_vertex>
	#include <clipping_planes_vertex>
	vViewPosition = - mvPosition.xyz;
	#include <worldpos_vertex>
	#include <shadowmap_vertex>
	#include <fog_vertex>
}`,VB=`#define TOON
uniform vec3 diffuse;
uniform vec3 emissive;
uniform float opacity;
#include <common>
#include <packing>
#include <dithering_pars_fragment>
#include <color_pars_fragment>
#include <uv_pars_fragment>
#include <map_pars_fragment>
#include <alphamap_pars_fragment>
#include <alphatest_pars_fragment>
#include <alphahash_pars_fragment>
#include <aomap_pars_fragment>
#include <lightmap_pars_fragment>
#include <emissivemap_pars_fragment>
#include <gradientmap_pars_fragment>
#include <fog_pars_fragment>
#include <bsdfs>
#include <lights_pars_begin>
#include <normal_pars_fragment>
#include <lights_toon_pars_fragment>
#include <shadowmap_pars_fragment>
#include <bumpmap_pars_fragment>
#include <normalmap_pars_fragment>
#include <logdepthbuf_pars_fragment>
#include <clipping_planes_pars_fragment>
void main() {
	vec4 diffuseColor = vec4( diffuse, opacity );
	#include <clipping_planes_fragment>
	ReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) );
	vec3 totalEmissiveRadiance = emissive;
	#include <logdepthbuf_fragment>
	#include <map_fragment>
	#include <color_fragment>
	#include <alphamap_fragment>
	#include <alphatest_fragment>
	#include <alphahash_fragment>
	#include <normal_fragment_begin>
	#include <normal_fragment_maps>
	#include <emissivemap_fragment>
	#include <lights_toon_fragment>
	#include <lights_fragment_begin>
	#include <lights_fragment_maps>
	#include <lights_fragment_end>
	#include <aomap_fragment>
	vec3 outgoingLight = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse + totalEmissiveRadiance;
	#include <opaque_fragment>
	#include <tonemapping_fragment>
	#include <colorspace_fragment>
	#include <fog_fragment>
	#include <premultiplied_alpha_fragment>
	#include <dithering_fragment>
}`,WB=`uniform float size;
uniform float scale;
#include <common>
#include <color_pars_vertex>
#include <fog_pars_vertex>
#include <morphtarget_pars_vertex>
#include <logdepthbuf_pars_vertex>
#include <clipping_planes_pars_vertex>
#ifdef USE_POINTS_UV
	varying vec2 vUv;
	uniform mat3 uvTransform;
#endif
void main() {
	#ifdef USE_POINTS_UV
		vUv = ( uvTransform * vec3( uv, 1 ) ).xy;
	#endif
	#include <color_vertex>
	#include <morphinstance_vertex>
	#include <morphcolor_vertex>
	#include <begin_vertex>
	#include <morphtarget_vertex>
	#include <project_vertex>
	gl_PointSize = size;
	#ifdef USE_SIZEATTENUATION
		bool isPerspective = isPerspectiveMatrix( projectionMatrix );
		if ( isPerspective ) gl_PointSize *= ( scale / - mvPosition.z );
	#endif
	#include <logdepthbuf_vertex>
	#include <clipping_planes_vertex>
	#include <worldpos_vertex>
	#include <fog_vertex>
}`,XB=`uniform vec3 diffuse;
uniform float opacity;
#include <common>
#include <color_pars_fragment>
#include <map_particle_pars_fragment>
#include <alphatest_pars_fragment>
#include <alphahash_pars_fragment>
#include <fog_pars_fragment>
#include <logdepthbuf_pars_fragment>
#include <clipping_planes_pars_fragment>
void main() {
	vec4 diffuseColor = vec4( diffuse, opacity );
	#include <clipping_planes_fragment>
	vec3 outgoingLight = vec3( 0.0 );
	#include <logdepthbuf_fragment>
	#include <map_particle_fragment>
	#include <color_fragment>
	#include <alphatest_fragment>
	#include <alphahash_fragment>
	outgoingLight = diffuseColor.rgb;
	#include <opaque_fragment>
	#include <tonemapping_fragment>
	#include <colorspace_fragment>
	#include <fog_fragment>
	#include <premultiplied_alpha_fragment>
}`,jB=`#include <common>
#include <batching_pars_vertex>
#include <fog_pars_vertex>
#include <morphtarget_pars_vertex>
#include <skinning_pars_vertex>
#include <logdepthbuf_pars_vertex>
#include <shadowmap_pars_vertex>
void main() {
	#include <batching_vertex>
	#include <beginnormal_vertex>
	#include <morphinstance_vertex>
	#include <morphnormal_vertex>
	#include <skinbase_vertex>
	#include <skinnormal_vertex>
	#include <defaultnormal_vertex>
	#include <begin_vertex>
	#include <morphtarget_vertex>
	#include <skinning_vertex>
	#include <project_vertex>
	#include <logdepthbuf_vertex>
	#include <worldpos_vertex>
	#include <shadowmap_vertex>
	#include <fog_vertex>
}`,JB=`uniform vec3 color;
uniform float opacity;
#include <common>
#include <packing>
#include <fog_pars_fragment>
#include <bsdfs>
#include <lights_pars_begin>
#include <logdepthbuf_pars_fragment>
#include <shadowmap_pars_fragment>
#include <shadowmask_pars_fragment>
void main() {
	#include <logdepthbuf_fragment>
	gl_FragColor = vec4( color, opacity * ( 1.0 - getShadowMask() ) );
	#include <tonemapping_fragment>
	#include <colorspace_fragment>
	#include <fog_fragment>
}`,KB=`uniform float rotation;
uniform vec2 center;
#include <common>
#include <uv_pars_vertex>
#include <fog_pars_vertex>
#include <logdepthbuf_pars_vertex>
#include <clipping_planes_pars_vertex>
void main() {
	#include <uv_vertex>
	vec4 mvPosition = modelViewMatrix[ 3 ];
	vec2 scale = vec2( length( modelMatrix[ 0 ].xyz ), length( modelMatrix[ 1 ].xyz ) );
	#ifndef USE_SIZEATTENUATION
		bool isPerspective = isPerspectiveMatrix( projectionMatrix );
		if ( isPerspective ) scale *= - mvPosition.z;
	#endif
	vec2 alignedPosition = ( position.xy - ( center - vec2( 0.5 ) ) ) * scale;
	vec2 rotatedPosition;
	rotatedPosition.x = cos( rotation ) * alignedPosition.x - sin( rotation ) * alignedPosition.y;
	rotatedPosition.y = sin( rotation ) * alignedPosition.x + cos( rotation ) * alignedPosition.y;
	mvPosition.xy += rotatedPosition;
	gl_Position = projectionMatrix * mvPosition;
	#include <logdepthbuf_vertex>
	#include <clipping_planes_vertex>
	#include <fog_vertex>
}`,YB=`uniform vec3 diffuse;
uniform float opacity;
#include <common>
#include <uv_pars_fragment>
#include <map_pars_fragment>
#include <alphamap_pars_fragment>
#include <alphatest_pars_fragment>
#include <alphahash_pars_fragment>
#include <fog_pars_fragment>
#include <logdepthbuf_pars_fragment>
#include <clipping_planes_pars_fragment>
void main() {
	vec4 diffuseColor = vec4( diffuse, opacity );
	#include <clipping_planes_fragment>
	vec3 outgoingLight = vec3( 0.0 );
	#include <logdepthbuf_fragment>
	#include <map_fragment>
	#include <alphamap_fragment>
	#include <alphatest_fragment>
	#include <alphahash_fragment>
	outgoingLight = diffuseColor.rgb;
	#include <opaque_fragment>
	#include <tonemapping_fragment>
	#include <colorspace_fragment>
	#include <fog_fragment>
}`,tn={alphahash_fragment:vI,alphahash_pars_fragment:yI,alphamap_fragment:_I,alphamap_pars_fragment:xI,alphatest_fragment:AI,alphatest_pars_fragment:SI,aomap_fragment:MI,aomap_pars_fragment:EI,batching_pars_vertex:wI,batching_vertex:CI,begin_vertex:TI,beginnormal_vertex:bI,bsdfs:RI,iridescence_fragment:II,bumpmap_pars_fragment:PI,clipping_planes_fragment:BI,clipping_planes_pars_fragment:LI,clipping_planes_pars_vertex:DI,clipping_planes_vertex:FI,color_fragment:NI,color_pars_fragment:UI,color_pars_vertex:OI,color_vertex:kI,common:HI,cube_uv_reflection_fragment:zI,defaultnormal_vertex:GI,displacementmap_pars_vertex:VI,displacementmap_vertex:WI,emissivemap_fragment:XI,emissivemap_pars_fragment:jI,colorspace_fragment:JI,colorspace_pars_fragment:KI,envmap_fragment:YI,envmap_common_pars_fragment:QI,envmap_pars_fragment:qI,envmap_pars_vertex:ZI,envmap_physical_pars_fragment:uP,envmap_vertex:$I,fog_vertex:eP,fog_pars_vertex:tP,fog_fragment:nP,fog_pars_fragment:iP,gradientmap_pars_fragment:rP,lightmap_pars_fragment:sP,lights_lambert_fragment:oP,lights_lambert_pars_fragment:aP,lights_pars_begin:lP,lights_toon_fragment:cP,lights_toon_pars_fragment:fP,lights_phong_fragment:dP,lights_phong_pars_fragment:hP,lights_physical_fragment:pP,lights_physical_pars_fragment:mP,lights_fragment_begin:gP,lights_fragment_maps:vP,lights_fragment_end:yP,logdepthbuf_fragment:_P,logdepthbuf_pars_fragment:xP,logdepthbuf_pars_vertex:AP,logdepthbuf_vertex:SP,map_fragment:MP,map_pars_fragment:EP,map_particle_fragment:wP,map_particle_pars_fragment:CP,metalnessmap_fragment:TP,metalnessmap_pars_fragment:bP,morphinstance_vertex:RP,morphcolor_vertex:IP,morphnormal_vertex:PP,morphtarget_pars_vertex:BP,morphtarget_vertex:LP,normal_fragment_begin:DP,normal_fragment_maps:FP,normal_pars_fragment:NP,normal_pars_vertex:UP,normal_vertex:OP,normalmap_pars_fragment:kP,clearcoat_normal_fragment_begin:HP,clearcoat_normal_fragment_maps:zP,clearcoat_pars_fragment:GP,iridescence_pars_fragment:VP,opaque_fragment:WP,packing:XP,premultiplied_alpha_fragment:jP,project_vertex:JP,dithering_fragment:KP,dithering_pars_fragment:YP,roughnessmap_fragment:QP,roughnessmap_pars_fragment:qP,shadowmap_pars_fragment:ZP,shadowmap_pars_vertex:$P,shadowmap_vertex:eB,shadowmask_pars_fragment:tB,skinbase_vertex:nB,skinning_pars_vertex:iB,skinning_vertex:rB,skinnormal_vertex:sB,specularmap_fragment:oB,specularmap_pars_fragment:aB,tonemapping_fragment:lB,tonemapping_pars_fragment:uB,transmission_fragment:cB,transmission_pars_fragment:fB,uv_pars_fragment:dB,uv_pars_vertex:hB,uv_vertex:pB,worldpos_vertex:mB,background_vert:gB,background_frag:vB,backgroundCube_vert:yB,backgroundCube_frag:_B,cube_vert:xB,cube_frag:AB,depth_vert:SB,depth_frag:MB,distanceRGBA_vert:EB,distanceRGBA_frag:wB,equirect_vert:CB,equirect_frag:TB,linedashed_vert:bB,linedashed_frag:RB,meshbasic_vert:IB,meshbasic_frag:PB,meshlambert_vert:BB,meshlambert_frag:LB,meshmatcap_vert:DB,meshmatcap_frag:FB,meshnormal_vert:NB,meshnormal_frag:UB,meshphong_vert:OB,meshphong_frag:kB,meshphysical_vert:HB,meshphysical_frag:zB,meshtoon_vert:GB,meshtoon_frag:VB,points_vert:WB,points_frag:XB,shadow_vert:jB,shadow_frag:JB,sprite_vert:KB,sprite_frag:YB},lt={common:{diffuse:{value:new tt(16777215)},opacity:{value:1},map:{value:null},mapTransform:{value:new Jt},alphaMap:{value:null},alphaMapTransform:{value:new Jt},alphaTest:{value:0}},specularmap:{specularMap:{value:null},specularMapTransform:{value:new Jt}},envmap:{envMap:{value:null},envMapRotation:{value:new Jt},flipEnvMap:{value:-1},reflectivity:{value:1},ior:{value:1.5},refractionRatio:{value:.98}},aomap:{aoMap:{value:null},aoMapIntensity:{value:1},aoMapTransform:{value:new Jt}},lightmap:{lightMap:{value:null},lightMapIntensity:{value:1},lightMapTransform:{value:new Jt}},bumpmap:{bumpMap:{value:null},bumpMapTransform:{value:new Jt},bumpScale:{value:1}},normalmap:{normalMap:{value:null},normalMapTransform:{value:new Jt},normalScale:{value:new Le(1,1)}},displacementmap:{displacementMap:{value:null},displacementMapTransform:{value:new Jt},displacementScale:{value:1},displacementBias:{value:0}},emissivemap:{emissiveMap:{value:null},emissiveMapTransform:{value:new Jt}},metalnessmap:{metalnessMap:{value:null},metalnessMapTransform:{value:new Jt}},roughnessmap:{roughnessMap:{value:null},roughnessMapTransform:{value:new Jt}},gradientmap:{gradientMap:{value:null}},fog:{fogDensity:{value:25e-5},fogNear:{value:1},fogFar:{value:2e3},fogColor:{value:new tt(16777215)}},lights:{ambientLightColor:{value:[]},lightProbe:{value:[]},directionalLights:{value:[],properties:{direction:{},color:{}}},directionalLightShadows:{value:[],properties:{shadowIntensity:1,shadowBias:{},shadowNormalBias:{},shadowRadius:{},shadowMapSize:{}}},directionalShadowMap:{value:[]},directionalShadowMatrix:{value:[]},spotLights:{value:[],properties:{color:{},position:{},direction:{},distance:{},coneCos:{},penumbraCos:{},decay:{}}},spotLightShadows:{value:[],properties:{shadowIntensity:1,shadowBias:{},shadowNormalBias:{},shadowRadius:{},shadowMapSize:{}}},spotLightMap:{value:[]},spotShadowMap:{value:[]},spotLightMatrix:{value:[]},pointLights:{value:[],properties:{color:{},position:{},decay:{},distance:{}}},pointLightShadows:{value:[],properties:{shadowIntensity:1,shadowBias:{},shadowNormalBias:{},shadowRadius:{},shadowMapSize:{},shadowCameraNear:{},shadowCameraFar:{}}},pointShadowMap:{value:[]},pointShadowMatrix:{value:[]},hemisphereLights:{value:[],properties:{direction:{},skyColor:{},groundColor:{}}},rectAreaLights:{value:[],properties:{color:{},position:{},width:{},height:{}}},ltc_1:{value:null},ltc_2:{value:null}},points:{diffuse:{value:new tt(16777215)},opacity:{value:1},size:{value:1},scale:{value:1},map:{value:null},alphaMap:{value:null},alphaMapTransform:{value:new Jt},alphaTest:{value:0},uvTransform:{value:new Jt}},sprite:{diffuse:{value:new tt(16777215)},opacity:{value:1},center:{value:new Le(.5,.5)},rotation:{value:0},map:{value:null},mapTransform:{value:new Jt},alphaMap:{value:null},alphaMapTransform:{value:new Jt},alphaTest:{value:0}}},qs={basic:{uniforms:_r([lt.common,lt.specularmap,lt.envmap,lt.aomap,lt.lightmap,lt.fog]),vertexShader:tn.meshbasic_vert,fragmentShader:tn.meshbasic_frag},lambert:{uniforms:_r([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 tt(0)}}]),vertexShader:tn.meshlambert_vert,fragmentShader:tn.meshlambert_frag},phong:{uniforms:_r([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 tt(0)},specular:{value:new tt(1118481)},shininess:{value:30}}]),vertexShader:tn.meshphong_vert,fragmentShader:tn.meshphong_frag},standard:{uniforms:_r([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 tt(0)},roughness:{value:1},metalness:{value:0},envMapIntensity:{value:1}}]),vertexShader:tn.meshphysical_vert,fragmentShader:tn.meshphysical_frag},toon:{uniforms:_r([lt.common,lt.aomap,lt.lightmap,lt.emissivemap,lt.bumpmap,lt.normalmap,lt.displacementmap,lt.gradientmap,lt.fog,lt.lights,{emissive:{value:new tt(0)}}]),vertexShader:tn.meshtoon_vert,fragmentShader:tn.meshtoon_frag},matcap:{uniforms:_r([lt.common,lt.bumpmap,lt.normalmap,lt.displacementmap,lt.fog,{matcap:{value:null}}]),vertexShader:tn.meshmatcap_vert,fragmentShader:tn.meshmatcap_frag},points:{uniforms:_r([lt.points,lt.fog]),vertexShader:tn.points_vert,fragmentShader:tn.points_frag},dashed:{uniforms:_r([lt.common,lt.fog,{scale:{value:1},dashSize:{value:1},totalSize:{value:2}}]),vertexShader:tn.linedashed_vert,fragmentShader:tn.linedashed_frag},depth:{uniforms:_r([lt.common,lt.displacementmap]),vertexShader:tn.depth_vert,fragmentShader:tn.depth_frag},normal:{uniforms:_r([lt.common,lt.bumpmap,lt.normalmap,lt.displacementmap,{opacity:{value:1}}]),vertexShader:tn.meshnormal_vert,fragmentShader:tn.meshnormal_frag},sprite:{uniforms:_r([lt.sprite,lt.fog]),vertexShader:tn.sprite_vert,fragmentShader:tn.sprite_frag},background:{uniforms:{uvTransform:{value:new Jt},t2D:{value:null},backgroundIntensity:{value:1}},vertexShader:tn.background_vert,fragmentShader:tn.background_frag},backgroundCube:{uniforms:{envMap:{value:null},flipEnvMap:{value:-1},backgroundBlurriness:{value:0},backgroundIntensity:{value:1},backgroundRotation:{value:new Jt}},vertexShader:tn.backgroundCube_vert,fragmentShader:tn.backgroundCube_frag},cube:{uniforms:{tCube:{value:null},tFlip:{value:-1},opacity:{value:1}},vertexShader:tn.cube_vert,fragmentShader:tn.cube_frag},equirect:{uniforms:{tEquirect:{value:null}},vertexShader:tn.equirect_vert,fragmentShader:tn.equirect_frag},distanceRGBA:{uniforms:_r([lt.common,lt.displacementmap,{referencePosition:{value:new X},nearDistance:{value:1},farDistance:{value:1e3}}]),vertexShader:tn.distanceRGBA_vert,fragmentShader:tn.distanceRGBA_frag},shadow:{uniforms:_r([lt.lights,lt.fog,{color:{value:new tt(0)},opacity:{value:1}}]),vertexShader:tn.shadow_vert,fragmentShader:tn.shadow_frag}};qs.physical={uniforms:_r([qs.standard.uniforms,{clearcoat:{value:0},clearcoatMap:{value:null},clearcoatMapTransform:{value:new Jt},clearcoatNormalMap:{value:null},clearcoatNormalMapTransform:{value:new Jt},clearcoatNormalScale:{value:new Le(1,1)},clearcoatRoughness:{value:0},clearcoatRoughnessMap:{value:null},clearcoatRoughnessMapTransform:{value:new Jt},dispersion:{value:0},iridescence:{value:0},iridescenceMap:{value:null},iridescenceMapTransform:{value:new Jt},iridescenceIOR:{value:1.3},iridescenceThicknessMinimum:{value:100},iridescenceThicknessMaximum:{value:400},iridescenceThicknessMap:{value:null},iridescenceThicknessMapTransform:{value:new Jt},sheen:{value:0},sheenColor:{value:new tt(0)},sheenColorMap:{value:null},sheenColorMapTransform:{value:new Jt},sheenRoughness:{value:1},sheenRoughnessMap:{value:null},sheenRoughnessMapTransform:{value:new Jt},transmission:{value:0},transmissionMap:{value:null},transmissionMapTransform:{value:new Jt},transmissionSamplerSize:{value:new Le},transmissionSamplerMap:{value:null},thickness:{value:0},thicknessMap:{value:null},thicknessMapTransform:{value:new Jt},attenuationDistance:{value:0},attenuationColor:{value:new tt(0)},specularColor:{value:new tt(1,1,1)},specularColorMap:{value:null},specularColorMapTransform:{value:new Jt},specularIntensity:{value:1},specularIntensityMap:{value:null},specularIntensityMapTransform:{value:new Jt},anisotropyVector:{value:new Le},anisotropyMap:{value:null},anisotropyMapTransform:{value:new Jt}}]),vertexShader:tn.meshphysical_vert,fragmentShader:tn.meshphysical_frag};const sg={r:0,b:0,g:0},Tu=new ns,QB=new Ot;function qB(i,e,t,n,r,s,a){const u=new tt(0);let d=s===!0?0:1,h,m,g=null,v=0,_=null;function A(R){let P=R.isScene===!0?R.background:null;return P&&P.isTexture&&(P=(R.backgroundBlurriness>0?t:e).get(P)),P}function C(R){let P=!1;const U=A(R);U===null?S(u,d):U&&U.isColor&&(S(U,1),P=!0);const F=i.xr.getEnvironmentBlendMode();F==="additive"?n.buffers.color.setClear(0,0,0,1,a):F==="alpha-blend"&&n.buffers.color.setClear(0,0,0,0,a),(i.autoClear||P)&&(n.buffers.depth.setTest(!0),n.buffers.depth.setMask(!0),n.buffers.color.setMask(!0),i.clear(i.autoClearColor,i.autoClearDepth,i.autoClearStencil))}function M(R,P){const U=A(P);U&&(U.isCubeTexture||U.mapping===rd)?(m===void 0&&(m=new si(new sc(1,1,1),new no({name:"BackgroundCubeMaterial",uniforms:qf(qs.backgroundCube.uniforms),vertexShader:qs.backgroundCube.vertexShader,fragmentShader:qs.backgroundCube.fragmentShader,side:Ar,depthTest:!1,depthWrite:!1,fog:!1})),m.geometry.deleteAttribute("normal"),m.geometry.deleteAttribute("uv"),m.onBeforeRender=function(F,k,G){this.matrixWorld.copyPosition(G.matrixWorld)},Object.defineProperty(m.material,"envMap",{get:function(){return this.uniforms.envMap.value}}),r.update(m)),Tu.copy(P.backgroundRotation),Tu.x*=-1,Tu.y*=-1,Tu.z*=-1,U.isCubeTexture&&U.isRenderTargetTexture===!1&&(Tu.y*=-1,Tu.z*=-1),m.material.uniforms.envMap.value=U,m.material.uniforms.flipEnvMap.value=U.isCubeTexture&&U.isRenderTargetTexture===!1?-1:1,m.material.uniforms.backgroundBlurriness.value=P.backgroundBlurriness,m.material.uniforms.backgroundIntensity.value=P.backgroundIntensity,m.material.uniforms.backgroundRotation.value.setFromMatrix4(QB.makeRotationFromEuler(Tu)),m.material.toneMapped=gn.getTransfer(U.colorSpace)!==wn,(g!==U||v!==U.version||_!==i.toneMapping)&&(m.material.needsUpdate=!0,g=U,v=U.version,_=i.toneMapping),m.layers.enableAll(),R.unshift(m,m.geometry,m.material,0,0,null)):U&&U.isTexture&&(h===void 0&&(h=new si(new ad(2,2),new no({name:"BackgroundMaterial",uniforms:qf(qs.background.uniforms),vertexShader:qs.background.vertexShader,fragmentShader:qs.background.fragmentShader,side:To,depthTest:!1,depthWrite:!1,fog:!1})),h.geometry.deleteAttribute("normal"),Object.defineProperty(h.material,"map",{get:function(){return this.uniforms.t2D.value}}),r.update(h)),h.material.uniforms.t2D.value=U,h.material.uniforms.backgroundIntensity.value=P.backgroundIntensity,h.material.toneMapped=gn.getTransfer(U.colorSpace)!==wn,U.matrixAutoUpdate===!0&&U.updateMatrix(),h.material.uniforms.uvTransform.value.copy(U.matrix),(g!==U||v!==U.version||_!==i.toneMapping)&&(h.material.needsUpdate=!0,g=U,v=U.version,_=i.toneMapping),h.layers.enableAll(),R.unshift(h,h.geometry,h.material,0,0,null))}function S(R,P){R.getRGB(sg,BM(i)),n.buffers.color.setClear(sg.r,sg.g,sg.b,P,a)}function b(){m!==void 0&&(m.geometry.dispose(),m.material.dispose(),m=void 0),h!==void 0&&(h.geometry.dispose(),h.material.dispose(),h=void 0)}return{getClearColor:function(){return u},setClearColor:function(R,P=1){u.set(R),d=P,S(u,d)},getClearAlpha:function(){return d},setClearAlpha:function(R){d=R,S(u,d)},render:C,addToRenderList:M,dispose:b}}function ZB(i,e){const t=i.getParameter(i.MAX_VERTEX_ATTRIBS),n={},r=v(null);let s=r,a=!1;function u(L,V,oe,ie,ge){let ye=!1;const he=g(ie,oe,V);s!==he&&(s=he,h(s.object)),ye=_(L,ie,oe,ge),ye&&A(L,ie,oe,ge),ge!==null&&e.update(ge,i.ELEMENT_ARRAY_BUFFER),(ye||a)&&(a=!1,P(L,V,oe,ie),ge!==null&&i.bindBuffer(i.ELEMENT_ARRAY_BUFFER,e.get(ge).buffer))}function d(){return i.createVertexArray()}function h(L){return i.bindVertexArray(L)}function m(L){return i.deleteVertexArray(L)}function g(L,V,oe){const ie=oe.wireframe===!0;let ge=n[L.id];ge===void 0&&(ge={},n[L.id]=ge);let ye=ge[V.id];ye===void 0&&(ye={},ge[V.id]=ye);let he=ye[ie];return he===void 0&&(he=v(d()),ye[ie]=he),he}function v(L){const V=[],oe=[],ie=[];for(let ge=0;ge<t;ge++)V[ge]=0,oe[ge]=0,ie[ge]=0;return{geometry:null,program:null,wireframe:!1,newAttributes:V,enabledAttributes:oe,attributeDivisors:ie,object:L,attributes:{},index:null}}function _(L,V,oe,ie){const ge=s.attributes,ye=V.attributes;let he=0;const _e=oe.getAttributes();for(const H in _e)if(_e[H].location>=0){const q=ge[H];let W=ye[H];if(W===void 0&&(H==="instanceMatrix"&&L.instanceMatrix&&(W=L.instanceMatrix),H==="instanceColor"&&L.instanceColor&&(W=L.instanceColor)),q===void 0||q.attribute!==W||W&&q.data!==W.data)return!0;he++}return s.attributesNum!==he||s.index!==ie}function A(L,V,oe,ie){const ge={},ye=V.attributes;let he=0;const _e=oe.getAttributes();for(const H in _e)if(_e[H].location>=0){let q=ye[H];q===void 0&&(H==="instanceMatrix"&&L.instanceMatrix&&(q=L.instanceMatrix),H==="instanceColor"&&L.instanceColor&&(q=L.instanceColor));const W={};W.attribute=q,q&&q.data&&(W.data=q.data),ge[H]=W,he++}s.attributes=ge,s.attributesNum=he,s.index=ie}function C(){const L=s.newAttributes;for(let V=0,oe=L.length;V<oe;V++)L[V]=0}function M(L){S(L,0)}function S(L,V){const oe=s.newAttributes,ie=s.enabledAttributes,ge=s.attributeDivisors;oe[L]=1,ie[L]===0&&(i.enableVertexAttribArray(L),ie[L]=1),ge[L]!==V&&(i.vertexAttribDivisor(L,V),ge[L]=V)}function b(){const L=s.newAttributes,V=s.enabledAttributes;for(let oe=0,ie=V.length;oe<ie;oe++)V[oe]!==L[oe]&&(i.disableVertexAttribArray(oe),V[oe]=0)}function R(L,V,oe,ie,ge,ye,he){he===!0?i.vertexAttribIPointer(L,V,oe,ge,ye):i.vertexAttribPointer(L,V,oe,ie,ge,ye)}function P(L,V,oe,ie){C();const ge=ie.attributes,ye=oe.getAttributes(),he=V.defaultAttributeValues;for(const _e in ye){const H=ye[_e];if(H.location>=0){let Z=ge[_e];if(Z===void 0&&(_e==="instanceMatrix"&&L.instanceMatrix&&(Z=L.instanceMatrix),_e==="instanceColor"&&L.instanceColor&&(Z=L.instanceColor)),Z!==void 0){const q=Z.normalized,W=Z.itemSize,ne=e.get(Z);if(ne===void 0)continue;const Fe=ne.buffer,ae=ne.type,we=ne.bytesPerElement,De=ae===i.INT||ae===i.UNSIGNED_INT||Z.gpuType===C0;if(Z.isInterleavedBufferAttribute){const Ie=Z.data,Xe=Ie.stride,_t=Z.offset;if(Ie.isInstancedInterleavedBuffer){for(let Je=0;Je<H.locationSize;Je++)S(H.location+Je,Ie.meshPerAttribute);L.isInstancedMesh!==!0&&ie._maxInstanceCount===void 0&&(ie._maxInstanceCount=Ie.meshPerAttribute*Ie.count)}else for(let Je=0;Je<H.locationSize;Je++)M(H.location+Je);i.bindBuffer(i.ARRAY_BUFFER,Fe);for(let Je=0;Je<H.locationSize;Je++)R(H.location+Je,W/H.locationSize,ae,q,Xe*we,(_t+W/H.locationSize*Je)*we,De)}else{if(Z.isInstancedBufferAttribute){for(let Ie=0;Ie<H.locationSize;Ie++)S(H.location+Ie,Z.meshPerAttribute);L.isInstancedMesh!==!0&&ie._maxInstanceCount===void 0&&(ie._maxInstanceCount=Z.meshPerAttribute*Z.count)}else for(let Ie=0;Ie<H.locationSize;Ie++)M(H.location+Ie);i.bindBuffer(i.ARRAY_BUFFER,Fe);for(let Ie=0;Ie<H.locationSize;Ie++)R(H.location+Ie,W/H.locationSize,ae,q,W*we,W/H.locationSize*Ie*we,De)}}else if(he!==void 0){const q=he[_e];if(q!==void 0)switch(q.length){case 2:i.vertexAttrib2fv(H.location,q);break;case 3:i.vertexAttrib3fv(H.location,q);break;case 4:i.vertexAttrib4fv(H.location,q);break;default:i.vertexAttrib1fv(H.location,q)}}}}b()}function U(){G();for(const L in n){const V=n[L];for(const oe in V){const ie=V[oe];for(const ge in ie)m(ie[ge].object),delete ie[ge];delete V[oe]}delete n[L]}}function F(L){if(n[L.id]===void 0)return;const V=n[L.id];for(const oe in V){const ie=V[oe];for(const ge in ie)m(ie[ge].object),delete ie[ge];delete V[oe]}delete n[L.id]}function k(L){for(const V in n){const oe=n[V];if(oe[L.id]===void 0)continue;const ie=oe[L.id];for(const ge in ie)m(ie[ge].object),delete ie[ge];delete oe[L.id]}}function G(){D(),a=!0,s!==r&&(s=r,h(s.object))}function D(){r.geometry=null,r.program=null,r.wireframe=!1}return{setup:u,reset:G,resetDefaultState:D,dispose:U,releaseStatesOfGeometry:F,releaseStatesOfProgram:k,initAttributes:C,enableAttribute:M,disableUnusedAttributes:b}}function $B(i,e,t){let n;function r(h){n=h}function s(h,m){i.drawArrays(n,h,m),t.update(m,n,1)}function a(h,m,g){g!==0&&(i.drawArraysInstanced(n,h,m,g),t.update(m,n,g))}function u(h,m,g){if(g===0)return;e.get("WEBGL_multi_draw").multiDrawArraysWEBGL(n,h,0,m,0,g);let _=0;for(let A=0;A<g;A++)_+=m[A];t.update(_,n,1)}function d(h,m,g,v){if(g===0)return;const _=e.get("WEBGL_multi_draw");if(_===null)for(let A=0;A<h.length;A++)a(h[A],m[A],v[A]);else{_.multiDrawArraysInstancedWEBGL(n,h,0,m,0,v,0,g);let A=0;for(let C=0;C<g;C++)A+=m[C]*v[C];t.update(A,n,1)}}this.setMode=r,this.render=s,this.renderInstances=a,this.renderMultiDraw=u,this.renderMultiDrawInstances=d}function eL(i,e,t,n){let r;function s(){if(r!==void 0)return r;if(e.has("EXT_texture_filter_anisotropic")===!0){const k=e.get("EXT_texture_filter_anisotropic");r=i.getParameter(k.MAX_TEXTURE_MAX_ANISOTROPY_EXT)}else r=0;return r}function a(k){return!(k!==rr&&n.convert(k)!==i.getParameter(i.IMPLEMENTATION_COLOR_READ_FORMAT))}function u(k){const G=k===sd&&(e.has("EXT_color_buffer_half_float")||e.has("EXT_color_buffer_float"));return!(k!==to&&n.convert(k)!==i.getParameter(i.IMPLEMENTATION_COLOR_READ_TYPE)&&k!==Or&&!G)}function d(k){if(k==="highp"){if(i.getShaderPrecisionFormat(i.VERTEX_SHADER,i.HIGH_FLOAT).precision>0&&i.getShaderPrecisionFormat(i.FRAGMENT_SHADER,i.HIGH_FLOAT).precision>0)return"highp";k="mediump"}return k==="mediump"&&i.getShaderPrecisionFormat(i.VERTEX_SHADER,i.MEDIUM_FLOAT).precision>0&&i.getShaderPrecisionFormat(i.FRAGMENT_SHADER,i.MEDIUM_FLOAT).precision>0?"mediump":"lowp"}let h=t.precision!==void 0?t.precision:"highp";const m=d(h);m!==h&&(console.warn("THREE.WebGLRenderer:",h,"not supported, using",m,"instead."),h=m);const g=t.logarithmicDepthBuffer===!0,v=t.reverseDepthBuffer===!0&&e.has("EXT_clip_control"),_=i.getParameter(i.MAX_TEXTURE_IMAGE_UNITS),A=i.getParameter(i.MAX_VERTEX_TEXTURE_IMAGE_UNITS),C=i.getParameter(i.MAX_TEXTURE_SIZE),M=i.getParameter(i.MAX_CUBE_MAP_TEXTURE_SIZE),S=i.getParameter(i.MAX_VERTEX_ATTRIBS),b=i.getParameter(i.MAX_VERTEX_UNIFORM_VECTORS),R=i.getParameter(i.MAX_VARYING_VECTORS),P=i.getParameter(i.MAX_FRAGMENT_UNIFORM_VECTORS),U=A>0,F=i.getParameter(i.MAX_SAMPLES);return{isWebGL2:!0,getMaxAnisotropy:s,getMaxPrecision:d,textureFormatReadable:a,textureTypeReadable:u,precision:h,logarithmicDepthBuffer:g,reverseDepthBuffer:v,maxTextures:_,maxVertexTextures:A,maxTextureSize:C,maxCubemapSize:M,maxAttributes:S,maxVertexUniforms:b,maxVaryings:R,maxFragmentUniforms:P,vertexTextures:U,maxSamples:F}}function tL(i){const e=this;let t=null,n=0,r=!1,s=!1;const a=new va,u=new Jt,d={value:null,needsUpdate:!1};this.uniform=d,this.numPlanes=0,this.numIntersection=0,this.init=function(g,v){const _=g.length!==0||v||n!==0||r;return r=v,n=g.length,_},this.beginShadows=function(){s=!0,m(null)},this.endShadows=function(){s=!1},this.setGlobalState=function(g,v){t=m(g,v,0)},this.setState=function(g,v,_){const A=g.clippingPlanes,C=g.clipIntersection,M=g.clipShadows,S=i.get(g);if(!r||A===null||A.length===0||s&&!M)s?m(null):h();else{const b=s?0:n,R=b*4;let P=S.clippingState||null;d.value=P,P=m(A,v,R,_);for(let U=0;U!==R;++U)P[U]=t[U];S.clippingState=P,this.numIntersection=C?this.numPlanes:0,this.numPlanes+=b}};function h(){d.value!==t&&(d.value=t,d.needsUpdate=n>0),e.numPlanes=n,e.numIntersection=0}function m(g,v,_,A){const C=g!==null?g.length:0;let M=null;if(C!==0){if(M=d.value,A!==!0||M===null){const S=_+C*4,b=v.matrixWorldInverse;u.getNormalMatrix(b),(M===null||M.length<S)&&(M=new Float32Array(S));for(let R=0,P=_;R!==C;++R,P+=4)a.copy(g[R]).applyMatrix4(b,u),a.normal.toArray(M,P),M[P+3]=a.constant}d.value=M,d.needsUpdate=!0}return e.numPlanes=C,e.numIntersection=0,M}}function nL(i){let e=new WeakMap;function t(a,u){return u===Oh?a.mapping=Ta:u===kh&&(a.mapping=wl),a}function n(a){if(a&&a.isTexture){const u=a.mapping;if(u===Oh||u===kh)if(e.has(a)){const d=e.get(a).texture;return t(d,a.mapping)}else{const d=a.image;if(d&&d.height>0){const h=new FM(d.height);return h.fromEquirectangularTexture(i,a),e.set(a,h),a.addEventListener("dispose",r),t(h.texture,a.mapping)}else return null}}return a}function r(a){const u=a.target;u.removeEventListener("dispose",r);const d=e.get(u);d!==void 0&&(e.delete(u),d.dispose())}function s(){e=new WeakMap}return{get:n,dispose:s}}const kf=4,ZA=[.125,.215,.35,.446,.526,.582],Fu=20,My=new eo,$A=new tt;let Ey=null,wy=0,Cy=0,Ty=!1;const Lu=(1+Math.sqrt(5))/2,Pf=1/Lu,eS=[new X(-Lu,Pf,0),new X(Lu,Pf,0),new X(-Pf,0,Lu),new X(Pf,0,Lu),new X(0,Lu,-Pf),new X(0,Lu,Pf),new X(-1,1,-1),new X(1,1,-1),new X(-1,1,1),new X(1,1,1)];class x_{constructor(e){this._renderer=e,this._pingPongRenderTarget=null,this._lodMax=0,this._cubeSize=0,this._lodPlanes=[],this._sizeLods=[],this._sigmas=[],this._blurMaterial=null,this._cubemapMaterial=null,this._equirectMaterial=null,this._compileMaterial(this._blurMaterial)}fromScene(e,t=0,n=.1,r=100){Ey=this._renderer.getRenderTarget(),wy=this._renderer.getActiveCubeFace(),Cy=this._renderer.getActiveMipmapLevel(),Ty=this._renderer.xr.enabled,this._renderer.xr.enabled=!1,this._setSize(256);const s=this._allocateTargets();return s.depthBuffer=!0,this._sceneToCubeUV(e,n,r,s),t>0&&this._blur(s,0,0,t),this._applyPMREM(s),this._cleanup(s),s}fromEquirectangular(e,t=null){return this._fromTexture(e,t)}fromCubemap(e,t=null){return this._fromTexture(e,t)}compileCubemapShader(){this._cubemapMaterial===null&&(this._cubemapMaterial=iS(),this._compileMaterial(this._cubemapMaterial))}compileEquirectangularShader(){this._equirectMaterial===null&&(this._equirectMaterial=nS(),this._compileMaterial(this._equirectMaterial))}dispose(){this._dispose(),this._cubemapMaterial!==null&&this._cubemapMaterial.dispose(),this._equirectMaterial!==null&&this._equirectMaterial.dispose()}_setSize(e){this._lodMax=Math.floor(Math.log2(e)),this._cubeSize=Math.pow(2,this._lodMax)}_dispose(){this._blurMaterial!==null&&this._blurMaterial.dispose(),this._pingPongRenderTarget!==null&&this._pingPongRenderTarget.dispose();for(let e=0;e<this._lodPlanes.length;e++)this._lodPlanes[e].dispose()}_cleanup(e){this._renderer.setRenderTarget(Ey,wy,Cy),this._renderer.xr.enabled=Ty,e.scissorTest=!1,og(e,0,0,e.width,e.height)}_fromTexture(e,t){e.mapping===Ta||e.mapping===wl?this._setSize(e.image.length===0?16:e.image[0].width||e.image[0].image.width):this._setSize(e.image.width/4),Ey=this._renderer.getRenderTarget(),wy=this._renderer.getActiveCubeFace(),Cy=this._renderer.getActiveMipmapLevel(),Ty=this._renderer.xr.enabled,this._renderer.xr.enabled=!1;const n=t||this._allocateTargets();return this._textureToCubeUV(e,n),this._applyPMREM(n),this._cleanup(n),n}_allocateTargets(){const e=3*Math.max(this._cubeSize,112),t=4*this._cubeSize,n={magFilter:ri,minFilter:ri,generateMipmaps:!1,type:sd,format:rr,colorSpace:qu,depthBuffer:!1},r=tS(e,t,n);if(this._pingPongRenderTarget===null||this._pingPongRenderTarget.width!==e||this._pingPongRenderTarget.height!==t){this._pingPongRenderTarget!==null&&this._dispose(),this._pingPongRenderTarget=tS(e,t,n);const{_lodMax:s}=this;({sizeLods:this._sizeLods,lodPlanes:this._lodPlanes,sigmas:this._sigmas}=iL(s)),this._blurMaterial=rL(s,e,t)}return r}_compileMaterial(e){const t=new si(this._lodPlanes[0],e);this._renderer.compile(t,My)}_sceneToCubeUV(e,t,n,r){const u=new Hn(90,1,t,n),d=[1,-1,1,1,1,1],h=[1,1,1,-1,-1,-1],m=this._renderer,g=m.autoClear,v=m.toneMapping;m.getClearColor($A),m.toneMapping=Mo,m.autoClear=!1;const _=new es({name:"PMREM.Background",side:Ar,depthWrite:!1,depthTest:!1}),A=new si(new sc,_);let C=!1;const M=e.background;M?M.isColor&&(_.color.copy(M),e.background=null,C=!0):(_.color.copy($A),C=!0);for(let S=0;S<6;S++){const b=S%3;b===0?(u.up.set(0,d[S],0),u.lookAt(h[S],0,0)):b===1?(u.up.set(0,0,d[S]),u.lookAt(0,h[S],0)):(u.up.set(0,d[S],0),u.lookAt(0,0,h[S]));const R=this._cubeSize;og(r,b*R,S>2?R:0,R,R),m.setRenderTarget(r),C&&m.render(A,u),m.render(e,u)}A.geometry.dispose(),A.material.dispose(),m.toneMapping=v,m.autoClear=g,e.background=M}_textureToCubeUV(e,t){const n=this._renderer,r=e.mapping===Ta||e.mapping===wl;r?(this._cubemapMaterial===null&&(this._cubemapMaterial=iS()),this._cubemapMaterial.uniforms.flipEnvMap.value=e.isRenderTargetTexture===!1?-1:1):this._equirectMaterial===null&&(this._equirectMaterial=nS());const s=r?this._cubemapMaterial:this._equirectMaterial,a=new si(this._lodPlanes[0],s),u=s.uniforms;u.envMap.value=e;const d=this._cubeSize;og(t,0,0,3*d,2*d),n.setRenderTarget(t),n.render(a,My)}_applyPMREM(e){const t=this._renderer,n=t.autoClear;t.autoClear=!1;const r=this._lodPlanes.length;for(let s=1;s<r;s++){const a=Math.sqrt(this._sigmas[s]*this._sigmas[s]-this._sigmas[s-1]*this._sigmas[s-1]),u=eS[(r-s-1)%eS.length];this._blur(e,s-1,s,a,u)}t.autoClear=n}_blur(e,t,n,r,s){const a=this._pingPongRenderTarget;this._halfBlur(e,a,t,n,r,"latitudinal",s),this._halfBlur(a,e,n,n,r,"longitudinal",s)}_halfBlur(e,t,n,r,s,a,u){const d=this._renderer,h=this._blurMaterial;a!=="latitudinal"&&a!=="longitudinal"&&console.error("blur direction must be either latitudinal or longitudinal!");const m=3,g=new si(this._lodPlanes[r],h),v=h.uniforms,_=this._sizeLods[n]-1,A=isFinite(s)?Math.PI/(2*_):2*Math.PI/(2*Fu-1),C=s/A,M=isFinite(s)?1+Math.floor(m*C):Fu;M>Fu&&console.warn(`sigmaRadians, ${s}, is too large and will clip, as it requested ${M} samples when the maximum is set to ${Fu}`);const S=[];let b=0;for(let k=0;k<Fu;++k){const G=k/C,D=Math.exp(-G*G/2);S.push(D),k===0?b+=D:k<M&&(b+=2*D)}for(let k=0;k<S.length;k++)S[k]=S[k]/b;v.envMap.value=e.texture,v.samples.value=M,v.weights.value=S,v.latitudinal.value=a==="latitudinal",u&&(v.poleAxis.value=u);const{_lodMax:R}=this;v.dTheta.value=A,v.mipInt.value=R-n;const P=this._sizeLods[r],U=3*P*(r>R-kf?r-R+kf:0),F=4*(this._cubeSize-P);og(t,U,F,3*P,2*P),d.setRenderTarget(t),d.render(g,My)}}function iL(i){const e=[],t=[],n=[];let r=i;const s=i-kf+1+ZA.length;for(let a=0;a<s;a++){const u=Math.pow(2,r);t.push(u);let d=1/u;a>i-kf?d=ZA[a-i+kf-1]:a===0&&(d=0),n.push(d);const h=1/(u-2),m=-h,g=1+h,v=[m,m,g,m,g,g,m,m,g,g,m,g],_=6,A=6,C=3,M=2,S=1,b=new Float32Array(C*A*_),R=new Float32Array(M*A*_),P=new Float32Array(S*A*_);for(let F=0;F<_;F++){const k=F%3*2/3-1,G=F>2?0:-1,D=[k,G,0,k+2/3,G,0,k+2/3,G+1,0,k,G,0,k+2/3,G+1,0,k,G+1,0];b.set(D,C*A*F),R.set(v,M*A*F);const L=[F,F,F,F,F,F];P.set(L,S*A*F)}const U=new Kt;U.setAttribute("position",new xn(b,C)),U.setAttribute("uv",new xn(R,M)),U.setAttribute("faceIndex",new xn(P,S)),e.push(U),r>kf&&r--}return{lodPlanes:e,sizeLods:t,sigmas:n}}function tS(i,e,t){const n=new bo(i,e,t);return n.texture.mapping=rd,n.texture.name="PMREM.cubeUv",n.scissorTest=!0,n}function og(i,e,t,n,r){i.viewport.set(e,t,n,r),i.scissor.set(e,t,n,r)}function rL(i,e,t){const n=new Float32Array(Fu),r=new X(0,1,0);return new no({name:"SphericalGaussianBlur",defines:{n:Fu,CUBEUV_TEXEL_WIDTH:1/e,CUBEUV_TEXEL_HEIGHT:1/t,CUBEUV_MAX_MIP:`${i}.0`},uniforms:{envMap:{value:null},samples:{value:1},weights:{value:n},latitudinal:{value:!1},dTheta:{value:0},mipInt:{value:0},poleAxis:{value:r}},vertexShader:Px(),fragmentShader:`

			precision mediump float;
			precision mediump int;

			varying vec3 vOutputDirection;

			uniform sampler2D envMap;
			uniform int samples;
			uniform float weights[ n ];
			uniform bool latitudinal;
			uniform float dTheta;
			uniform float mipInt;
			uniform vec3 poleAxis;

			#define ENVMAP_TYPE_CUBE_UV
			#include <cube_uv_reflection_fragment>

			vec3 getSample( float theta, vec3 axis ) {

				float cosTheta = cos( theta );
				// Rodrigues' axis-angle rotation
				vec3 sampleDirection = vOutputDirection * cosTheta
					+ cross( axis, vOutputDirection ) * sin( theta )
					+ axis * dot( axis, vOutputDirection ) * ( 1.0 - cosTheta );

				return bilinearCubeUV( envMap, sampleDirection, mipInt );

			}

			void main() {

				vec3 axis = latitudinal ? poleAxis : cross( poleAxis, vOutputDirection );

				if ( all( equal( axis, vec3( 0.0 ) ) ) ) {

					axis = vec3( vOutputDirection.z, 0.0, - vOutputDirection.x );

				}

				axis = normalize( axis );

				gl_FragColor = vec4( 0.0, 0.0, 0.0, 1.0 );
				gl_FragColor.rgb += weights[ 0 ] * getSample( 0.0, axis );

				for ( int i = 1; i < n; i++ ) {

					if ( i >= samples ) {

						break;

					}

					float theta = dTheta * float( i );
					gl_FragColor.rgb += weights[ i ] * getSample( -1.0 * theta, axis );
					gl_FragColor.rgb += weights[ i ] * getSample( theta, axis );

				}

			}
		`,blending:Ma,depthTest:!1,depthWrite:!1})}function nS(){return new no({name:"EquirectangularToCubeUV",uniforms:{envMap:{value:null}},vertexShader:Px(),fragmentShader:`

			precision mediump float;
			precision mediump int;

			varying vec3 vOutputDirection;

			uniform sampler2D envMap;

			#include <common>

			void main() {

				vec3 outputDirection = normalize( vOutputDirection );
				vec2 uv = equirectUv( outputDirection );

				gl_FragColor = vec4( texture2D ( envMap, uv ).rgb, 1.0 );

			}
		`,blending:Ma,depthTest:!1,depthWrite:!1})}function iS(){return new no({name:"CubemapToCubeUV",uniforms:{envMap:{value:null},flipEnvMap:{value:-1}},vertexShader:Px(),fragmentShader:`

			precision mediump float;
			precision mediump int;

			uniform float flipEnvMap;

			varying vec3 vOutputDirection;

			uniform samplerCube envMap;

			void main() {

				gl_FragColor = textureCube( envMap, vec3( flipEnvMap * vOutputDirection.x, vOutputDirection.yz ) );

			}
		`,blending:Ma,depthTest:!1,depthWrite:!1})}function Px(){return`

		precision mediump float;
		precision mediump int;

		attribute float faceIndex;

		varying vec3 vOutputDirection;

		// RH coordinate system; PMREM face-indexing convention
		vec3 getDirection( vec2 uv, float face ) {

			uv = 2.0 * uv - 1.0;

			vec3 direction = vec3( uv, 1.0 );

			if ( face == 0.0 ) {

				direction = direction.zyx; // ( 1, v, u ) pos x

			} else if ( face == 1.0 ) {

				direction = direction.xzy;
				direction.xz *= -1.0; // ( -u, 1, -v ) pos y

			} else if ( face == 2.0 ) {

				direction.x *= -1.0; // ( -u, v, 1 ) pos z

			} else if ( face == 3.0 ) {

				direction = direction.zyx;
				direction.xz *= -1.0; // ( -1, v, -u ) neg x

			} else if ( face == 4.0 ) {

				direction = direction.xzy;
				direction.xy *= -1.0; // ( -u, -1, v ) neg y

			} else if ( face == 5.0 ) {

				direction.z *= -1.0; // ( u, v, -1 ) neg z

			}

			return direction;

		}

		void main() {

			vOutputDirection = getDirection( uv, faceIndex );
			gl_Position = vec4( position, 1.0 );

		}
	`}function sL(i){let e=new WeakMap,t=null;function n(u){if(u&&u.isTexture){const d=u.mapping,h=d===Oh||d===kh,m=d===Ta||d===wl;if(h||m){let g=e.get(u);const v=g!==void 0?g.texture.pmremVersion:0;if(u.isRenderTargetTexture&&u.pmremVersion!==v)return t===null&&(t=new x_(i)),g=h?t.fromEquirectangular(u,g):t.fromCubemap(u,g),g.texture.pmremVersion=u.pmremVersion,e.set(u,g),g.texture;if(g!==void 0)return g.texture;{const _=u.image;return h&&_&&_.height>0||m&&_&&r(_)?(t===null&&(t=new x_(i)),g=h?t.fromEquirectangular(u):t.fromCubemap(u),g.texture.pmremVersion=u.pmremVersion,e.set(u,g),u.addEventListener("dispose",s),g.texture):null}}}return u}function r(u){let d=0;const h=6;for(let m=0;m<h;m++)u[m]!==void 0&&d++;return d===h}function s(u){const d=u.target;d.removeEventListener("dispose",s);const h=e.get(d);h!==void 0&&(e.delete(d),h.dispose())}function a(){e=new WeakMap,t!==null&&(t.dispose(),t=null)}return{get:n,dispose:a}}function oL(i){const e={};function t(n){if(e[n]!==void 0)return e[n];let r;switch(n){case"WEBGL_depth_texture":r=i.getExtension("WEBGL_depth_texture")||i.getExtension("MOZ_WEBGL_depth_texture")||i.getExtension("WEBKIT_WEBGL_depth_texture");break;case"EXT_texture_filter_anisotropic":r=i.getExtension("EXT_texture_filter_anisotropic")||i.getExtension("MOZ_EXT_texture_filter_anisotropic")||i.getExtension("WEBKIT_EXT_texture_filter_anisotropic");break;case"WEBGL_compressed_texture_s3tc":r=i.getExtension("WEBGL_compressed_texture_s3tc")||i.getExtension("MOZ_WEBGL_compressed_texture_s3tc")||i.getExtension("WEBKIT_WEBGL_compressed_texture_s3tc");break;case"WEBGL_compressed_texture_pvrtc":r=i.getExtension("WEBGL_compressed_texture_pvrtc")||i.getExtension("WEBKIT_WEBGL_compressed_texture_pvrtc");break;default:r=i.getExtension(n)}return e[n]=r,r}return{has:function(n){return t(n)!==null},init:function(){t("EXT_color_buffer_float"),t("WEBGL_clip_cull_distance"),t("OES_texture_float_linear"),t("EXT_color_buffer_half_float"),t("WEBGL_multisampled_render_to_texture"),t("WEBGL_render_shared_exponent")},get:function(n){const r=t(n);return r===null&&Df("THREE.WebGLRenderer: "+n+" extension not supported."),r}}}function aL(i,e,t,n){const r={},s=new WeakMap;function a(g){const v=g.target;v.index!==null&&e.remove(v.index);for(const A in v.attributes)e.remove(v.attributes[A]);v.removeEventListener("dispose",a),delete r[v.id];const _=s.get(v);_&&(e.remove(_),s.delete(v)),n.releaseStatesOfGeometry(v),v.isInstancedBufferGeometry===!0&&delete v._maxInstanceCount,t.memory.geometries--}function u(g,v){return r[v.id]===!0||(v.addEventListener("dispose",a),r[v.id]=!0,t.memory.geometries++),v}function d(g){const v=g.attributes;for(const _ in v)e.update(v[_],i.ARRAY_BUFFER)}function h(g){const v=[],_=g.index,A=g.attributes.position;let C=0;if(_!==null){const b=_.array;C=_.version;for(let R=0,P=b.length;R<P;R+=3){const U=b[R+0],F=b[R+1],k=b[R+2];v.push(U,F,F,k,k,U)}}else if(A!==void 0){const b=A.array;C=A.version;for(let R=0,P=b.length/3-1;R<P;R+=3){const U=R+0,F=R+1,k=R+2;v.push(U,F,F,k,k,U)}}else return;const M=new(bM(v)?tx:ex)(v,1);M.version=C;const S=s.get(g);S&&e.remove(S),s.set(g,M)}function m(g){const v=s.get(g);if(v){const _=g.index;_!==null&&v.version<_.version&&h(g)}else h(g);return s.get(g)}return{get:u,update:d,getWireframeAttribute:m}}function lL(i,e,t){let n;function r(v){n=v}let s,a;function u(v){s=v.type,a=v.bytesPerElement}function d(v,_){i.drawElements(n,_,s,v*a),t.update(_,n,1)}function h(v,_,A){A!==0&&(i.drawElementsInstanced(n,_,s,v*a,A),t.update(_,n,A))}function m(v,_,A){if(A===0)return;e.get("WEBGL_multi_draw").multiDrawElementsWEBGL(n,_,0,s,v,0,A);let M=0;for(let S=0;S<A;S++)M+=_[S];t.update(M,n,1)}function g(v,_,A,C){if(A===0)return;const M=e.get("WEBGL_multi_draw");if(M===null)for(let S=0;S<v.length;S++)h(v[S]/a,_[S],C[S]);else{M.multiDrawElementsInstancedWEBGL(n,_,0,s,v,0,C,0,A);let S=0;for(let b=0;b<A;b++)S+=_[b]*C[b];t.update(S,n,1)}}this.setMode=r,this.setIndex=u,this.render=d,this.renderInstances=h,this.renderMultiDraw=m,this.renderMultiDrawInstances=g}function uL(i){const e={geometries:0,textures:0},t={frame:0,calls:0,triangles:0,points:0,lines:0};function n(s,a,u){switch(t.calls++,a){case i.TRIANGLES:t.triangles+=u*(s/3);break;case i.LINES:t.lines+=u*(s/2);break;case i.LINE_STRIP:t.lines+=u*(s-1);break;case i.LINE_LOOP:t.lines+=u*s;break;case i.POINTS:t.points+=u*s;break;default:console.error("THREE.WebGLInfo: Unknown draw mode:",a);break}}function r(){t.calls=0,t.triangles=0,t.points=0,t.lines=0}return{memory:e,render:t,programs:null,autoReset:!0,reset:r,update:n}}function cL(i,e,t){const n=new WeakMap,r=new _n;function s(a,u,d){const h=a.morphTargetInfluences,m=u.morphAttributes.position||u.morphAttributes.normal||u.morphAttributes.color,g=m!==void 0?m.length:0;let v=n.get(u);if(v===void 0||v.count!==g){let L=function(){G.dispose(),n.delete(u),u.removeEventListener("dispose",L)};var _=L;v!==void 0&&v.texture.dispose();const A=u.morphAttributes.position!==void 0,C=u.morphAttributes.normal!==void 0,M=u.morphAttributes.color!==void 0,S=u.morphAttributes.position||[],b=u.morphAttributes.normal||[],R=u.morphAttributes.color||[];let P=0;A===!0&&(P=1),C===!0&&(P=2),M===!0&&(P=3);let U=u.attributes.position.count*P,F=1;U>e.maxTextureSize&&(F=Math.ceil(U/e.maxTextureSize),U=e.maxTextureSize);const k=new Float32Array(U*F*4*g),G=new op(k,U,F,g);G.type=Or,G.needsUpdate=!0;const D=P*4;for(let V=0;V<g;V++){const oe=S[V],ie=b[V],ge=R[V],ye=U*F*4*V;for(let he=0;he<oe.count;he++){const _e=he*D;A===!0&&(r.fromBufferAttribute(oe,he),k[ye+_e+0]=r.x,k[ye+_e+1]=r.y,k[ye+_e+2]=r.z,k[ye+_e+3]=0),C===!0&&(r.fromBufferAttribute(ie,he),k[ye+_e+4]=r.x,k[ye+_e+5]=r.y,k[ye+_e+6]=r.z,k[ye+_e+7]=0),M===!0&&(r.fromBufferAttribute(ge,he),k[ye+_e+8]=r.x,k[ye+_e+9]=r.y,k[ye+_e+10]=r.z,k[ye+_e+11]=ge.itemSize===4?r.w:1)}}v={count:g,texture:G,size:new Le(U,F)},n.set(u,v),u.addEventListener("dispose",L)}if(a.isInstancedMesh===!0&&a.morphTexture!==null)d.getUniforms().setValue(i,"morphTexture",a.morphTexture,t);else{let A=0;for(let M=0;M<h.length;M++)A+=h[M];const C=u.morphTargetsRelative?1:1-A;d.getUniforms().setValue(i,"morphTargetBaseInfluence",C),d.getUniforms().setValue(i,"morphTargetInfluences",h)}d.getUniforms().setValue(i,"morphTargetsTexture",v.texture,t),d.getUniforms().setValue(i,"morphTargetsTextureSize",v.size)}return{update:s}}function fL(i,e,t,n){let r=new WeakMap;function s(d){const h=n.render.frame,m=d.geometry,g=e.get(d,m);if(r.get(g)!==h&&(e.update(g),r.set(g,h)),d.isInstancedMesh&&(d.hasEventListener("dispose",u)===!1&&d.addEventListener("dispose",u),r.get(d)!==h&&(t.update(d.instanceMatrix,i.ARRAY_BUFFER),d.instanceColor!==null&&t.update(d.instanceColor,i.ARRAY_BUFFER),r.set(d,h))),d.isSkinnedMesh){const v=d.skeleton;r.get(v)!==h&&(v.update(),r.set(v,h))}return g}function a(){r=new WeakMap}function u(d){const h=d.target;h.removeEventListener("dispose",u),t.remove(h.instanceMatrix),h.instanceColor!==null&&t.remove(h.instanceColor)}return{update:s,dispose:a}}const RE=new zn,rS=new lx(1,1),IE=new op,PE=new D0,BE=new lp,sS=[],oS=[],aS=new Float32Array(16),lS=new Float32Array(9),uS=new Float32Array(4);function ud(i,e,t){const n=i[0];if(n<=0||n>0)return i;const r=e*t;let s=sS[r];if(s===void 0&&(s=new Float32Array(r),sS[r]=s),e!==0){n.toArray(s,0);for(let a=1,u=0;a!==e;++a)u+=t,i[a].toArray(s,u)}return s}function wi(i,e){if(i.length!==e.length)return!1;for(let t=0,n=i.length;t<n;t++)if(i[t]!==e[t])return!1;return!0}function Ci(i,e){for(let t=0,n=e.length;t<n;t++)i[t]=e[t]}function tv(i,e){let t=oS[e];t===void 0&&(t=new Int32Array(e),oS[e]=t);for(let n=0;n!==e;++n)t[n]=i.allocateTextureUnit();return t}function dL(i,e){const t=this.cache;t[0]!==e&&(i.uniform1f(this.addr,e),t[0]=e)}function hL(i,e){const t=this.cache;if(e.x!==void 0)(t[0]!==e.x||t[1]!==e.y)&&(i.uniform2f(this.addr,e.x,e.y),t[0]=e.x,t[1]=e.y);else{if(wi(t,e))return;i.uniform2fv(this.addr,e),Ci(t,e)}}function pL(i,e){const t=this.cache;if(e.x!==void 0)(t[0]!==e.x||t[1]!==e.y||t[2]!==e.z)&&(i.uniform3f(this.addr,e.x,e.y,e.z),t[0]=e.x,t[1]=e.y,t[2]=e.z);else if(e.r!==void 0)(t[0]!==e.r||t[1]!==e.g||t[2]!==e.b)&&(i.uniform3f(this.addr,e.r,e.g,e.b),t[0]=e.r,t[1]=e.g,t[2]=e.b);else{if(wi(t,e))return;i.uniform3fv(this.addr,e),Ci(t,e)}}function mL(i,e){const t=this.cache;if(e.x!==void 0)(t[0]!==e.x||t[1]!==e.y||t[2]!==e.z||t[3]!==e.w)&&(i.uniform4f(this.addr,e.x,e.y,e.z,e.w),t[0]=e.x,t[1]=e.y,t[2]=e.z,t[3]=e.w);else{if(wi(t,e))return;i.uniform4fv(this.addr,e),Ci(t,e)}}function gL(i,e){const t=this.cache,n=e.elements;if(n===void 0){if(wi(t,e))return;i.uniformMatrix2fv(this.addr,!1,e),Ci(t,e)}else{if(wi(t,n))return;uS.set(n),i.uniformMatrix2fv(this.addr,!1,uS),Ci(t,n)}}function vL(i,e){const t=this.cache,n=e.elements;if(n===void 0){if(wi(t,e))return;i.uniformMatrix3fv(this.addr,!1,e),Ci(t,e)}else{if(wi(t,n))return;lS.set(n),i.uniformMatrix3fv(this.addr,!1,lS),Ci(t,n)}}function yL(i,e){const t=this.cache,n=e.elements;if(n===void 0){if(wi(t,e))return;i.uniformMatrix4fv(this.addr,!1,e),Ci(t,e)}else{if(wi(t,n))return;aS.set(n),i.uniformMatrix4fv(this.addr,!1,aS),Ci(t,n)}}function _L(i,e){const t=this.cache;t[0]!==e&&(i.uniform1i(this.addr,e),t[0]=e)}function xL(i,e){const t=this.cache;if(e.x!==void 0)(t[0]!==e.x||t[1]!==e.y)&&(i.uniform2i(this.addr,e.x,e.y),t[0]=e.x,t[1]=e.y);else{if(wi(t,e))return;i.uniform2iv(this.addr,e),Ci(t,e)}}function AL(i,e){const t=this.cache;if(e.x!==void 0)(t[0]!==e.x||t[1]!==e.y||t[2]!==e.z)&&(i.uniform3i(this.addr,e.x,e.y,e.z),t[0]=e.x,t[1]=e.y,t[2]=e.z);else{if(wi(t,e))return;i.uniform3iv(this.addr,e),Ci(t,e)}}function SL(i,e){const t=this.cache;if(e.x!==void 0)(t[0]!==e.x||t[1]!==e.y||t[2]!==e.z||t[3]!==e.w)&&(i.uniform4i(this.addr,e.x,e.y,e.z,e.w),t[0]=e.x,t[1]=e.y,t[2]=e.z,t[3]=e.w);else{if(wi(t,e))return;i.uniform4iv(this.addr,e),Ci(t,e)}}function ML(i,e){const t=this.cache;t[0]!==e&&(i.uniform1ui(this.addr,e),t[0]=e)}function EL(i,e){const t=this.cache;if(e.x!==void 0)(t[0]!==e.x||t[1]!==e.y)&&(i.uniform2ui(this.addr,e.x,e.y),t[0]=e.x,t[1]=e.y);else{if(wi(t,e))return;i.uniform2uiv(this.addr,e),Ci(t,e)}}function wL(i,e){const t=this.cache;if(e.x!==void 0)(t[0]!==e.x||t[1]!==e.y||t[2]!==e.z)&&(i.uniform3ui(this.addr,e.x,e.y,e.z),t[0]=e.x,t[1]=e.y,t[2]=e.z);else{if(wi(t,e))return;i.uniform3uiv(this.addr,e),Ci(t,e)}}function CL(i,e){const t=this.cache;if(e.x!==void 0)(t[0]!==e.x||t[1]!==e.y||t[2]!==e.z||t[3]!==e.w)&&(i.uniform4ui(this.addr,e.x,e.y,e.z,e.w),t[0]=e.x,t[1]=e.y,t[2]=e.z,t[3]=e.w);else{if(wi(t,e))return;i.uniform4uiv(this.addr,e),Ci(t,e)}}function TL(i,e,t){const n=this.cache,r=t.allocateTextureUnit();n[0]!==r&&(i.uniform1i(this.addr,r),n[0]=r);let s;this.type===i.SAMPLER_2D_SHADOW?(rS.compareFunction=Z_,s=rS):s=RE,t.setTexture2D(e||s,r)}function bL(i,e,t){const n=this.cache,r=t.allocateTextureUnit();n[0]!==r&&(i.uniform1i(this.addr,r),n[0]=r),t.setTexture3D(e||PE,r)}function RL(i,e,t){const n=this.cache,r=t.allocateTextureUnit();n[0]!==r&&(i.uniform1i(this.addr,r),n[0]=r),t.setTextureCube(e||BE,r)}function IL(i,e,t){const n=this.cache,r=t.allocateTextureUnit();n[0]!==r&&(i.uniform1i(this.addr,r),n[0]=r),t.setTexture2DArray(e||IE,r)}function PL(i){switch(i){case 5126:return dL;case 35664:return hL;case 35665:return pL;case 35666:return mL;case 35674:return gL;case 35675:return vL;case 35676:return yL;case 5124:case 35670:return _L;case 35667:case 35671:return xL;case 35668:case 35672:return AL;case 35669:case 35673:return SL;case 5125:return ML;case 36294:return EL;case 36295:return wL;case 36296:return CL;case 35678:case 36198:case 36298:case 36306:case 35682:return TL;case 35679:case 36299:case 36307:return bL;case 35680:case 36300:case 36308:case 36293:return RL;case 36289:case 36303:case 36311:case 36292:return IL}}function BL(i,e){i.uniform1fv(this.addr,e)}function LL(i,e){const t=ud(e,this.size,2);i.uniform2fv(this.addr,t)}function DL(i,e){const t=ud(e,this.size,3);i.uniform3fv(this.addr,t)}function FL(i,e){const t=ud(e,this.size,4);i.uniform4fv(this.addr,t)}function NL(i,e){const t=ud(e,this.size,4);i.uniformMatrix2fv(this.addr,!1,t)}function UL(i,e){const t=ud(e,this.size,9);i.uniformMatrix3fv(this.addr,!1,t)}function OL(i,e){const t=ud(e,this.size,16);i.uniformMatrix4fv(this.addr,!1,t)}function kL(i,e){i.uniform1iv(this.addr,e)}function HL(i,e){i.uniform2iv(this.addr,e)}function zL(i,e){i.uniform3iv(this.addr,e)}function GL(i,e){i.uniform4iv(this.addr,e)}function VL(i,e){i.uniform1uiv(this.addr,e)}function WL(i,e){i.uniform2uiv(this.addr,e)}function XL(i,e){i.uniform3uiv(this.addr,e)}function jL(i,e){i.uniform4uiv(this.addr,e)}function JL(i,e,t){const n=this.cache,r=e.length,s=tv(t,r);wi(n,s)||(i.uniform1iv(this.addr,s),Ci(n,s));for(let a=0;a!==r;++a)t.setTexture2D(e[a]||RE,s[a])}function KL(i,e,t){const n=this.cache,r=e.length,s=tv(t,r);wi(n,s)||(i.uniform1iv(this.addr,s),Ci(n,s));for(let a=0;a!==r;++a)t.setTexture3D(e[a]||PE,s[a])}function YL(i,e,t){const n=this.cache,r=e.length,s=tv(t,r);wi(n,s)||(i.uniform1iv(this.addr,s),Ci(n,s));for(let a=0;a!==r;++a)t.setTextureCube(e[a]||BE,s[a])}function QL(i,e,t){const n=this.cache,r=e.length,s=tv(t,r);wi(n,s)||(i.uniform1iv(this.addr,s),Ci(n,s));for(let a=0;a!==r;++a)t.setTexture2DArray(e[a]||IE,s[a])}function qL(i){switch(i){case 5126:return BL;case 35664:return LL;case 35665:return DL;case 35666:return FL;case 35674:return NL;case 35675:return UL;case 35676:return OL;case 5124:case 35670:return kL;case 35667:case 35671:return HL;case 35668:case 35672:return zL;case 35669:case 35673:return GL;case 5125:return VL;case 36294:return WL;case 36295:return XL;case 36296:return jL;case 35678:case 36198:case 36298:case 36306:case 35682:return JL;case 35679:case 36299:case 36307:return KL;case 35680:case 36300:case 36308:case 36293:return YL;case 36289:case 36303:case 36311:case 36292:return QL}}class ZL{constructor(e,t,n){this.id=e,this.addr=n,this.cache=[],this.type=t.type,this.setValue=PL(t.type)}}class $L{constructor(e,t,n){this.id=e,this.addr=n,this.cache=[],this.type=t.type,this.size=t.size,this.setValue=qL(t.type)}}class eD{constructor(e){this.id=e,this.seq=[],this.map={}}setValue(e,t,n){const r=this.seq;for(let s=0,a=r.length;s!==a;++s){const u=r[s];u.setValue(e,t[u.id],n)}}}const by=/(\w+)(\])?(\[|\.)?/g;function cS(i,e){i.seq.push(e),i.map[e.id]=e}function tD(i,e,t){const n=i.name,r=n.length;for(by.lastIndex=0;;){const s=by.exec(n),a=by.lastIndex;let u=s[1];const d=s[2]==="]",h=s[3];if(d&&(u=u|0),h===void 0||h==="["&&a+2===r){cS(t,h===void 0?new ZL(u,i,e):new $L(u,i,e));break}else{let g=t.map[u];g===void 0&&(g=new eD(u),cS(t,g)),t=g}}}class Ag{constructor(e,t){this.seq=[],this.map={};const n=e.getProgramParameter(t,e.ACTIVE_UNIFORMS);for(let r=0;r<n;++r){const s=e.getActiveUniform(t,r),a=e.getUniformLocation(t,s.name);tD(s,a,this)}}setValue(e,t,n,r){const s=this.map[t];s!==void 0&&s.setValue(e,n,r)}setOptional(e,t,n){const r=t[n];r!==void 0&&this.setValue(e,n,r)}static upload(e,t,n,r){for(let s=0,a=t.length;s!==a;++s){const u=t[s],d=n[u.id];d.needsUpdate!==!1&&u.setValue(e,d.value,r)}}static seqWithValue(e,t){const n=[];for(let r=0,s=e.length;r!==s;++r){const a=e[r];a.id in t&&n.push(a)}return n}}function fS(i,e,t){const n=i.createShader(e);return i.shaderSource(n,t),i.compileShader(n),n}const nD=37297;let iD=0;function rD(i,e){const t=i.split(`
`),n=[],r=Math.max(e-6,0),s=Math.min(e+6,t.length);for(let a=r;a<s;a++){const u=a+1;n.push(`${u===e?">":" "} ${u}: ${t[a]}`)}return n.join(`
`)}const dS=new Jt;function sD(i){gn._getMatrix(dS,gn.workingColorSpace,i);const e=`mat3( ${dS.elements.map(t=>t.toFixed(4))} )`;switch(gn.getTransfer(i)){case zh:return[e,"LinearTransferOETF"];case wn:return[e,"sRGBTransferOETF"];default:return console.warn("THREE.WebGLProgram: Unsupported color space: ",i),[e,"LinearTransferOETF"]}}function hS(i,e,t){const n=i.getShaderParameter(e,i.COMPILE_STATUS),r=i.getShaderInfoLog(e).trim();if(n&&r==="")return"";const s=/ERROR: 0:(\d+)/.exec(r);if(s){const a=parseInt(s[1]);return t.toUpperCase()+`

`+r+`

`+rD(i.getShaderSource(e),a)}else return r}function oD(i,e){const t=sD(e);return[`vec4 ${i}( vec4 value ) {`,`	return ${t[1]}( vec4( value.rgb * ${t[0]}, value.a ) );`,"}"].join(`
`)}function aD(i,e){let t;switch(e){case oM:t="Linear";break;case aM:t="Reinhard";break;case lM:t="Cineon";break;case H_:t="ACESFilmic";break;case cM:t="AgX";break;case fM:t="Neutral";break;case uM:t="Custom";break;default:console.warn("THREE.WebGLProgram: Unsupported toneMapping:",e),t="Linear"}return"vec3 "+i+"( vec3 color ) { return "+t+"ToneMapping( color ); }"}const ag=new X;function lD(){gn.getLuminanceCoefficients(ag);const i=ag.x.toFixed(4),e=ag.y.toFixed(4),t=ag.z.toFixed(4);return["float luminance( const in vec3 rgb ) {",`	const vec3 weights = vec3( ${i}, ${e}, ${t} );`,"	return dot( weights, rgb );","}"].join(`
`)}function uD(i){return[i.extensionClipCullDistance?"#extension GL_ANGLE_clip_cull_distance : require":"",i.extensionMultiDraw?"#extension GL_ANGLE_multi_draw : require":""].filter(Ch).join(`
`)}function cD(i){const e=[];for(const t in i){const n=i[t];n!==!1&&e.push("#define "+t+" "+n)}return e.join(`
`)}function fD(i,e){const t={},n=i.getProgramParameter(e,i.ACTIVE_ATTRIBUTES);for(let r=0;r<n;r++){const s=i.getActiveAttrib(e,r),a=s.name;let u=1;s.type===i.FLOAT_MAT2&&(u=2),s.type===i.FLOAT_MAT3&&(u=3),s.type===i.FLOAT_MAT4&&(u=4),t[a]={type:s.type,location:i.getAttribLocation(e,a),locationSize:u}}return t}function Ch(i){return i!==""}function pS(i,e){const t=e.numSpotLightShadows+e.numSpotLightMaps-e.numSpotLightShadowsWithMaps;return i.replace(/NUM_DIR_LIGHTS/g,e.numDirLights).replace(/NUM_SPOT_LIGHTS/g,e.numSpotLights).replace(/NUM_SPOT_LIGHT_MAPS/g,e.numSpotLightMaps).replace(/NUM_SPOT_LIGHT_COORDS/g,t).replace(/NUM_RECT_AREA_LIGHTS/g,e.numRectAreaLights).replace(/NUM_POINT_LIGHTS/g,e.numPointLights).replace(/NUM_HEMI_LIGHTS/g,e.numHemiLights).replace(/NUM_DIR_LIGHT_SHADOWS/g,e.numDirLightShadows).replace(/NUM_SPOT_LIGHT_SHADOWS_WITH_MAPS/g,e.numSpotLightShadowsWithMaps).replace(/NUM_SPOT_LIGHT_SHADOWS/g,e.numSpotLightShadows).replace(/NUM_POINT_LIGHT_SHADOWS/g,e.numPointLightShadows)}function mS(i,e){return i.replace(/NUM_CLIPPING_PLANES/g,e.numClippingPlanes).replace(/UNION_CLIPPING_PLANES/g,e.numClippingPlanes-e.numClipIntersection)}const dD=/^[ \t]*#include +<([\w\d./]+)>/gm;function A_(i){return i.replace(dD,pD)}const hD=new Map;function pD(i,e){let t=tn[e];if(t===void 0){const n=hD.get(e);if(n!==void 0)t=tn[n],console.warn('THREE.WebGLRenderer: Shader chunk "%s" has been deprecated. Use "%s" instead.',e,n);else throw new Error("Can not resolve #include <"+e+">")}return A_(t)}const mD=/#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 gS(i){return i.replace(mD,gD)}function gD(i,e,t,n){let r="";for(let s=parseInt(e);s<parseInt(t);s++)r+=n.replace(/\[\s*i\s*\]/g,"[ "+s+" ]").replace(/UNROLLED_LOOP_INDEX/g,s);return r}function vS(i){let e=`precision ${i.precision} float;
	precision ${i.precision} int;
	precision ${i.precision} sampler2D;
	precision ${i.precision} samplerCube;
	precision ${i.precision} sampler3D;
	precision ${i.precision} sampler2DArray;
	precision ${i.precision} sampler2DShadow;
	precision ${i.precision} samplerCubeShadow;
	precision ${i.precision} sampler2DArrayShadow;
	precision ${i.precision} isampler2D;
	precision ${i.precision} isampler3D;
	precision ${i.precision} isamplerCube;
	precision ${i.precision} isampler2DArray;
	precision ${i.precision} usampler2D;
	precision ${i.precision} usampler3D;
	precision ${i.precision} usamplerCube;
	precision ${i.precision} usampler2DArray;
	`;return i.precision==="highp"?e+=`
#define HIGH_PRECISION`:i.precision==="mediump"?e+=`
#define MEDIUM_PRECISION`:i.precision==="lowp"&&(e+=`
#define LOW_PRECISION`),e}function vD(i){let e="SHADOWMAP_TYPE_BASIC";return i.shadowMapType===M0?e="SHADOWMAP_TYPE_PCF":i.shadowMapType===Th?e="SHADOWMAP_TYPE_PCF_SOFT":i.shadowMapType===Qs&&(e="SHADOWMAP_TYPE_VSM"),e}function yD(i){let e="ENVMAP_TYPE_CUBE";if(i.envMap)switch(i.envMapMode){case Ta:case wl:e="ENVMAP_TYPE_CUBE";break;case rd:e="ENVMAP_TYPE_CUBE_UV";break}return e}function _D(i){let e="ENVMAP_MODE_REFLECTION";if(i.envMap)switch(i.envMapMode){case wl:e="ENVMAP_MODE_REFRACTION";break}return e}function xD(i){let e="ENVMAP_BLENDING_NONE";if(i.envMap)switch(i.combine){case rp:e="ENVMAP_BLENDING_MULTIPLY";break;case rM:e="ENVMAP_BLENDING_MIX";break;case sM:e="ENVMAP_BLENDING_ADD";break}return e}function AD(i){const e=i.envMapCubeUVHeight;if(e===null)return null;const t=Math.log2(e)-2,n=1/e;return{texelWidth:1/(3*Math.max(Math.pow(2,t),7*16)),texelHeight:n,maxMip:t}}function SD(i,e,t,n){const r=i.getContext(),s=t.defines;let a=t.vertexShader,u=t.fragmentShader;const d=vD(t),h=yD(t),m=_D(t),g=xD(t),v=AD(t),_=uD(t),A=cD(s),C=r.createProgram();let M,S,b=t.glslVersion?"#version "+t.glslVersion+`
`:"";t.isRawShaderMaterial?(M=["#define SHADER_TYPE "+t.shaderType,"#define SHADER_NAME "+t.shaderName,A].filter(Ch).join(`
`),M.length>0&&(M+=`
`),S=["#define SHADER_TYPE "+t.shaderType,"#define SHADER_NAME "+t.shaderName,A].filter(Ch).join(`
`),S.length>0&&(S+=`
`)):(M=[vS(t),"#define SHADER_TYPE "+t.shaderType,"#define SHADER_NAME "+t.shaderName,A,t.extensionClipCullDistance?"#define USE_CLIP_DISTANCE":"",t.batching?"#define USE_BATCHING":"",t.batchingColor?"#define USE_BATCHING_COLOR":"",t.instancing?"#define USE_INSTANCING":"",t.instancingColor?"#define USE_INSTANCING_COLOR":"",t.instancingMorph?"#define USE_INSTANCING_MORPH":"",t.useFog&&t.fog?"#define USE_FOG":"",t.useFog&&t.fogExp2?"#define FOG_EXP2":"",t.map?"#define USE_MAP":"",t.envMap?"#define USE_ENVMAP":"",t.envMap?"#define "+m:"",t.lightMap?"#define USE_LIGHTMAP":"",t.aoMap?"#define USE_AOMAP":"",t.bumpMap?"#define USE_BUMPMAP":"",t.normalMap?"#define USE_NORMALMAP":"",t.normalMapObjectSpace?"#define USE_NORMALMAP_OBJECTSPACE":"",t.normalMapTangentSpace?"#define USE_NORMALMAP_TANGENTSPACE":"",t.displacementMap?"#define USE_DISPLACEMENTMAP":"",t.emissiveMap?"#define USE_EMISSIVEMAP":"",t.anisotropy?"#define USE_ANISOTROPY":"",t.anisotropyMap?"#define USE_ANISOTROPYMAP":"",t.clearcoatMap?"#define USE_CLEARCOATMAP":"",t.clearcoatRoughnessMap?"#define USE_CLEARCOAT_ROUGHNESSMAP":"",t.clearcoatNormalMap?"#define USE_CLEARCOAT_NORMALMAP":"",t.iridescenceMap?"#define USE_IRIDESCENCEMAP":"",t.iridescenceThicknessMap?"#define USE_IRIDESCENCE_THICKNESSMAP":"",t.specularMap?"#define USE_SPECULARMAP":"",t.specularColorMap?"#define USE_SPECULAR_COLORMAP":"",t.specularIntensityMap?"#define USE_SPECULAR_INTENSITYMAP":"",t.roughnessMap?"#define USE_ROUGHNESSMAP":"",t.metalnessMap?"#define USE_METALNESSMAP":"",t.alphaMap?"#define USE_ALPHAMAP":"",t.alphaHash?"#define USE_ALPHAHASH":"",t.transmission?"#define USE_TRANSMISSION":"",t.transmissionMap?"#define USE_TRANSMISSIONMAP":"",t.thicknessMap?"#define USE_THICKNESSMAP":"",t.sheenColorMap?"#define USE_SHEEN_COLORMAP":"",t.sheenRoughnessMap?"#define USE_SHEEN_ROUGHNESSMAP":"",t.mapUv?"#define MAP_UV "+t.mapUv:"",t.alphaMapUv?"#define ALPHAMAP_UV "+t.alphaMapUv:"",t.lightMapUv?"#define LIGHTMAP_UV "+t.lightMapUv:"",t.aoMapUv?"#define AOMAP_UV "+t.aoMapUv:"",t.emissiveMapUv?"#define EMISSIVEMAP_UV "+t.emissiveMapUv:"",t.bumpMapUv?"#define BUMPMAP_UV "+t.bumpMapUv:"",t.normalMapUv?"#define NORMALMAP_UV "+t.normalMapUv:"",t.displacementMapUv?"#define DISPLACEMENTMAP_UV "+t.displacementMapUv:"",t.metalnessMapUv?"#define METALNESSMAP_UV "+t.metalnessMapUv:"",t.roughnessMapUv?"#define ROUGHNESSMAP_UV "+t.roughnessMapUv:"",t.anisotropyMapUv?"#define ANISOTROPYMAP_UV "+t.anisotropyMapUv:"",t.clearcoatMapUv?"#define CLEARCOATMAP_UV "+t.clearcoatMapUv:"",t.clearcoatNormalMapUv?"#define CLEARCOAT_NORMALMAP_UV "+t.clearcoatNormalMapUv:"",t.clearcoatRoughnessMapUv?"#define CLEARCOAT_ROUGHNESSMAP_UV "+t.clearcoatRoughnessMapUv:"",t.iridescenceMapUv?"#define IRIDESCENCEMAP_UV "+t.iridescenceMapUv:"",t.iridescenceThicknessMapUv?"#define IRIDESCENCE_THICKNESSMAP_UV "+t.iridescenceThicknessMapUv:"",t.sheenColorMapUv?"#define SHEEN_COLORMAP_UV "+t.sheenColorMapUv:"",t.sheenRoughnessMapUv?"#define SHEEN_ROUGHNESSMAP_UV "+t.sheenRoughnessMapUv:"",t.specularMapUv?"#define SPECULARMAP_UV "+t.specularMapUv:"",t.specularColorMapUv?"#define SPECULAR_COLORMAP_UV "+t.specularColorMapUv:"",t.specularIntensityMapUv?"#define SPECULAR_INTENSITYMAP_UV "+t.specularIntensityMapUv:"",t.transmissionMapUv?"#define TRANSMISSIONMAP_UV "+t.transmissionMapUv:"",t.thicknessMapUv?"#define THICKNESSMAP_UV "+t.thicknessMapUv:"",t.vertexTangents&&t.flatShading===!1?"#define USE_TANGENT":"",t.vertexColors?"#define USE_COLOR":"",t.vertexAlphas?"#define USE_COLOR_ALPHA":"",t.vertexUv1s?"#define USE_UV1":"",t.vertexUv2s?"#define USE_UV2":"",t.vertexUv3s?"#define USE_UV3":"",t.pointsUvs?"#define USE_POINTS_UV":"",t.flatShading?"#define FLAT_SHADED":"",t.skinning?"#define USE_SKINNING":"",t.morphTargets?"#define USE_MORPHTARGETS":"",t.morphNormals&&t.flatShading===!1?"#define USE_MORPHNORMALS":"",t.morphColors?"#define USE_MORPHCOLORS":"",t.morphTargetsCount>0?"#define MORPHTARGETS_TEXTURE_STRIDE "+t.morphTextureStride:"",t.morphTargetsCount>0?"#define MORPHTARGETS_COUNT "+t.morphTargetsCount:"",t.doubleSided?"#define DOUBLE_SIDED":"",t.flipSided?"#define FLIP_SIDED":"",t.shadowMapEnabled?"#define USE_SHADOWMAP":"",t.shadowMapEnabled?"#define "+d:"",t.sizeAttenuation?"#define USE_SIZEATTENUATION":"",t.numLightProbes>0?"#define USE_LIGHT_PROBES":"",t.logarithmicDepthBuffer?"#define USE_LOGDEPTHBUF":"",t.reverseDepthBuffer?"#define USE_REVERSEDEPTHBUF":"","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",`
`].filter(Ch).join(`
`),S=[vS(t),"#define SHADER_TYPE "+t.shaderType,"#define SHADER_NAME "+t.shaderName,A,t.useFog&&t.fog?"#define USE_FOG":"",t.useFog&&t.fogExp2?"#define FOG_EXP2":"",t.alphaToCoverage?"#define ALPHA_TO_COVERAGE":"",t.map?"#define USE_MAP":"",t.matcap?"#define USE_MATCAP":"",t.envMap?"#define USE_ENVMAP":"",t.envMap?"#define "+h:"",t.envMap?"#define "+m:"",t.envMap?"#define "+g:"",v?"#define CUBEUV_TEXEL_WIDTH "+v.texelWidth:"",v?"#define CUBEUV_TEXEL_HEIGHT "+v.texelHeight:"",v?"#define CUBEUV_MAX_MIP "+v.maxMip+".0":"",t.lightMap?"#define USE_LIGHTMAP":"",t.aoMap?"#define USE_AOMAP":"",t.bumpMap?"#define USE_BUMPMAP":"",t.normalMap?"#define USE_NORMALMAP":"",t.normalMapObjectSpace?"#define USE_NORMALMAP_OBJECTSPACE":"",t.normalMapTangentSpace?"#define USE_NORMALMAP_TANGENTSPACE":"",t.emissiveMap?"#define USE_EMISSIVEMAP":"",t.anisotropy?"#define USE_ANISOTROPY":"",t.anisotropyMap?"#define USE_ANISOTROPYMAP":"",t.clearcoat?"#define USE_CLEARCOAT":"",t.clearcoatMap?"#define USE_CLEARCOATMAP":"",t.clearcoatRoughnessMap?"#define USE_CLEARCOAT_ROUGHNESSMAP":"",t.clearcoatNormalMap?"#define USE_CLEARCOAT_NORMALMAP":"",t.dispersion?"#define USE_DISPERSION":"",t.iridescence?"#define USE_IRIDESCENCE":"",t.iridescenceMap?"#define USE_IRIDESCENCEMAP":"",t.iridescenceThicknessMap?"#define USE_IRIDESCENCE_THICKNESSMAP":"",t.specularMap?"#define USE_SPECULARMAP":"",t.specularColorMap?"#define USE_SPECULAR_COLORMAP":"",t.specularIntensityMap?"#define USE_SPECULAR_INTENSITYMAP":"",t.roughnessMap?"#define USE_ROUGHNESSMAP":"",t.metalnessMap?"#define USE_METALNESSMAP":"",t.alphaMap?"#define USE_ALPHAMAP":"",t.alphaTest?"#define USE_ALPHATEST":"",t.alphaHash?"#define USE_ALPHAHASH":"",t.sheen?"#define USE_SHEEN":"",t.sheenColorMap?"#define USE_SHEEN_COLORMAP":"",t.sheenRoughnessMap?"#define USE_SHEEN_ROUGHNESSMAP":"",t.transmission?"#define USE_TRANSMISSION":"",t.transmissionMap?"#define USE_TRANSMISSIONMAP":"",t.thicknessMap?"#define USE_THICKNESSMAP":"",t.vertexTangents&&t.flatShading===!1?"#define USE_TANGENT":"",t.vertexColors||t.instancingColor||t.batchingColor?"#define USE_COLOR":"",t.vertexAlphas?"#define USE_COLOR_ALPHA":"",t.vertexUv1s?"#define USE_UV1":"",t.vertexUv2s?"#define USE_UV2":"",t.vertexUv3s?"#define USE_UV3":"",t.pointsUvs?"#define USE_POINTS_UV":"",t.gradientMap?"#define USE_GRADIENTMAP":"",t.flatShading?"#define FLAT_SHADED":"",t.doubleSided?"#define DOUBLE_SIDED":"",t.flipSided?"#define FLIP_SIDED":"",t.shadowMapEnabled?"#define USE_SHADOWMAP":"",t.shadowMapEnabled?"#define "+d:"",t.premultipliedAlpha?"#define PREMULTIPLIED_ALPHA":"",t.numLightProbes>0?"#define USE_LIGHT_PROBES":"",t.decodeVideoTexture?"#define DECODE_VIDEO_TEXTURE":"",t.decodeVideoTextureEmissive?"#define DECODE_VIDEO_TEXTURE_EMISSIVE":"",t.logarithmicDepthBuffer?"#define USE_LOGDEPTHBUF":"",t.reverseDepthBuffer?"#define USE_REVERSEDEPTHBUF":"","uniform mat4 viewMatrix;","uniform vec3 cameraPosition;","uniform bool isOrthographic;",t.toneMapping!==Mo?"#define TONE_MAPPING":"",t.toneMapping!==Mo?tn.tonemapping_pars_fragment:"",t.toneMapping!==Mo?aD("toneMapping",t.toneMapping):"",t.dithering?"#define DITHERING":"",t.opaque?"#define OPAQUE":"",tn.colorspace_pars_fragment,oD("linearToOutputTexel",t.outputColorSpace),lD(),t.useDepthPacking?"#define DEPTH_PACKING "+t.depthPacking:"",`
`].filter(Ch).join(`
`)),a=A_(a),a=pS(a,t),a=mS(a,t),u=A_(u),u=pS(u,t),u=mS(u,t),a=gS(a),u=gS(u),t.isRawShaderMaterial!==!0&&(b=`#version 300 es
`,M=[_,"#define attribute in","#define varying out","#define texture2D texture"].join(`
`)+`
`+M,S=["#define varying in",t.glslVersion===d_?"":"layout(location = 0) out highp vec4 pc_fragColor;",t.glslVersion===d_?"":"#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(`
`)+`
`+S);const R=b+M+a,P=b+S+u,U=fS(r,r.VERTEX_SHADER,R),F=fS(r,r.FRAGMENT_SHADER,P);r.attachShader(C,U),r.attachShader(C,F),t.index0AttributeName!==void 0?r.bindAttribLocation(C,0,t.index0AttributeName):t.morphTargets===!0&&r.bindAttribLocation(C,0,"position"),r.linkProgram(C);function k(V){if(i.debug.checkShaderErrors){const oe=r.getProgramInfoLog(C).trim(),ie=r.getShaderInfoLog(U).trim(),ge=r.getShaderInfoLog(F).trim();let ye=!0,he=!0;if(r.getProgramParameter(C,r.LINK_STATUS)===!1)if(ye=!1,typeof i.debug.onShaderError=="function")i.debug.onShaderError(r,C,U,F);else{const _e=hS(r,U,"vertex"),H=hS(r,F,"fragment");console.error("THREE.WebGLProgram: Shader Error "+r.getError()+" - VALIDATE_STATUS "+r.getProgramParameter(C,r.VALIDATE_STATUS)+`

Material Name: `+V.name+`
Material Type: `+V.type+`

Program Info Log: `+oe+`
`+_e+`
`+H)}else oe!==""?console.warn("THREE.WebGLProgram: Program Info Log:",oe):(ie===""||ge==="")&&(he=!1);he&&(V.diagnostics={runnable:ye,programLog:oe,vertexShader:{log:ie,prefix:M},fragmentShader:{log:ge,prefix:S}})}r.deleteShader(U),r.deleteShader(F),G=new Ag(r,C),D=fD(r,C)}let G;this.getUniforms=function(){return G===void 0&&k(this),G};let D;this.getAttributes=function(){return D===void 0&&k(this),D};let L=t.rendererExtensionParallelShaderCompile===!1;return this.isReady=function(){return L===!1&&(L=r.getProgramParameter(C,nD)),L},this.destroy=function(){n.releaseStatesOfProgram(this),r.deleteProgram(C),this.program=void 0},this.type=t.shaderType,this.name=t.shaderName,this.id=iD++,this.cacheKey=e,this.usedTimes=1,this.program=C,this.vertexShader=U,this.fragmentShader=F,this}let MD=0;class ED{constructor(){this.shaderCache=new Map,this.materialCache=new Map}update(e){const t=e.vertexShader,n=e.fragmentShader,r=this._getShaderStage(t),s=this._getShaderStage(n),a=this._getShaderCacheForMaterial(e);return a.has(r)===!1&&(a.add(r),r.usedTimes++),a.has(s)===!1&&(a.add(s),s.usedTimes++),this}remove(e){const t=this.materialCache.get(e);for(const n of t)n.usedTimes--,n.usedTimes===0&&this.shaderCache.delete(n.code);return this.materialCache.delete(e),this}getVertexShaderID(e){return this._getShaderStage(e.vertexShader).id}getFragmentShaderID(e){return this._getShaderStage(e.fragmentShader).id}dispose(){this.shaderCache.clear(),this.materialCache.clear()}_getShaderCacheForMaterial(e){const t=this.materialCache;let n=t.get(e);return n===void 0&&(n=new Set,t.set(e,n)),n}_getShaderStage(e){const t=this.shaderCache;let n=t.get(e);return n===void 0&&(n=new wD(e),t.set(e,n)),n}}class wD{constructor(e){this.id=MD++,this.code=e,this.usedTimes=0}}function CD(i,e,t,n,r,s,a){const u=new ju,d=new ED,h=new Set,m=[],g=r.logarithmicDepthBuffer,v=r.vertexTextures;let _=r.precision;const A={MeshDepthMaterial:"depth",MeshDistanceMaterial:"distanceRGBA",MeshNormalMaterial:"normal",MeshBasicMaterial:"basic",MeshLambertMaterial:"lambert",MeshPhongMaterial:"phong",MeshToonMaterial:"toon",MeshStandardMaterial:"physical",MeshPhysicalMaterial:"physical",MeshMatcapMaterial:"matcap",LineBasicMaterial:"basic",LineDashedMaterial:"dashed",PointsMaterial:"points",ShadowMaterial:"shadow",SpriteMaterial:"sprite"};function C(D){return h.add(D),D===0?"uv":`uv${D}`}function M(D,L,V,oe,ie){const ge=oe.fog,ye=ie.geometry,he=D.isMeshStandardMaterial?oe.environment:null,_e=(D.isMeshStandardMaterial?t:e).get(D.envMap||he),H=_e&&_e.mapping===rd?_e.image.height:null,Z=A[D.type];D.precision!==null&&(_=r.getMaxPrecision(D.precision),_!==D.precision&&console.warn("THREE.WebGLProgram.getParameters:",D.precision,"not supported, using",_,"instead."));const q=ye.morphAttributes.position||ye.morphAttributes.normal||ye.morphAttributes.color,W=q!==void 0?q.length:0;let ne=0;ye.morphAttributes.position!==void 0&&(ne=1),ye.morphAttributes.normal!==void 0&&(ne=2),ye.morphAttributes.color!==void 0&&(ne=3);let Fe,ae,we,De;if(Z){const Yt=qs[Z];Fe=Yt.vertexShader,ae=Yt.fragmentShader}else Fe=D.vertexShader,ae=D.fragmentShader,d.update(D),we=d.getVertexShaderID(D),De=d.getFragmentShaderID(D);const Ie=i.getRenderTarget(),Xe=i.state.buffers.depth.getReversed(),_t=ie.isInstancedMesh===!0,Je=ie.isBatchedMesh===!0,st=!!D.map,Ne=!!D.matcap,be=!!_e,J=!!D.aoMap,mt=!!D.lightMap,ke=!!D.bumpMap,et=!!D.normalMap,je=!!D.displacementMap,wt=!!D.emissiveMap,qe=!!D.metalnessMap,j=!!D.roughnessMap,O=D.anisotropy>0,pe=D.clearcoat>0,Ce=D.dispersion>0,Ue=D.iridescence>0,Pe=D.sheen>0,ot=D.transmission>0,Ze=O&&!!D.anisotropyMap,ct=pe&&!!D.clearcoatMap,zt=pe&&!!D.clearcoatNormalMap,ze=pe&&!!D.clearcoatRoughnessMap,gt=Ue&&!!D.iridescenceMap,Pt=Ue&&!!D.iridescenceThicknessMap,Dt=Pe&&!!D.sheenColorMap,ht=Pe&&!!D.sheenRoughnessMap,ee=!!D.specularMap,Re=!!D.specularColorMap,nt=!!D.specularIntensityMap,$=ot&&!!D.transmissionMap,Ve=ot&&!!D.thicknessMap,Me=!!D.gradientMap,Be=!!D.alphaMap,ut=D.alphaTest>0,it=!!D.alphaHash,It=!!D.extensions;let ln=Mo;D.toneMapped&&(Ie===null||Ie.isXRRenderTarget===!0)&&(ln=i.toneMapping);const Cn={shaderID:Z,shaderType:D.type,shaderName:D.name,vertexShader:Fe,fragmentShader:ae,defines:D.defines,customVertexShaderID:we,customFragmentShaderID:De,isRawShaderMaterial:D.isRawShaderMaterial===!0,glslVersion:D.glslVersion,precision:_,batching:Je,batchingColor:Je&&ie._colorsTexture!==null,instancing:_t,instancingColor:_t&&ie.instanceColor!==null,instancingMorph:_t&&ie.morphTexture!==null,supportsVertexTextures:v,outputColorSpace:Ie===null?i.outputColorSpace:Ie.isXRRenderTarget===!0?Ie.texture.colorSpace:qu,alphaToCoverage:!!D.alphaToCoverage,map:st,matcap:Ne,envMap:be,envMapMode:be&&_e.mapping,envMapCubeUVHeight:H,aoMap:J,lightMap:mt,bumpMap:ke,normalMap:et,displacementMap:v&&je,emissiveMap:wt,normalMapObjectSpace:et&&D.normalMapType===_M,normalMapTangentSpace:et&&D.normalMapType===bl,metalnessMap:qe,roughnessMap:j,anisotropy:O,anisotropyMap:Ze,clearcoat:pe,clearcoatMap:ct,clearcoatNormalMap:zt,clearcoatRoughnessMap:ze,dispersion:Ce,iridescence:Ue,iridescenceMap:gt,iridescenceThicknessMap:Pt,sheen:Pe,sheenColorMap:Dt,sheenRoughnessMap:ht,specularMap:ee,specularColorMap:Re,specularIntensityMap:nt,transmission:ot,transmissionMap:$,thicknessMap:Ve,gradientMap:Me,opaque:D.transparent===!1&&D.blending===Vu&&D.alphaToCoverage===!1,alphaMap:Be,alphaTest:ut,alphaHash:it,combine:D.combine,mapUv:st&&C(D.map.channel),aoMapUv:J&&C(D.aoMap.channel),lightMapUv:mt&&C(D.lightMap.channel),bumpMapUv:ke&&C(D.bumpMap.channel),normalMapUv:et&&C(D.normalMap.channel),displacementMapUv:je&&C(D.displacementMap.channel),emissiveMapUv:wt&&C(D.emissiveMap.channel),metalnessMapUv:qe&&C(D.metalnessMap.channel),roughnessMapUv:j&&C(D.roughnessMap.channel),anisotropyMapUv:Ze&&C(D.anisotropyMap.channel),clearcoatMapUv:ct&&C(D.clearcoatMap.channel),clearcoatNormalMapUv:zt&&C(D.clearcoatNormalMap.channel),clearcoatRoughnessMapUv:ze&&C(D.clearcoatRoughnessMap.channel),iridescenceMapUv:gt&&C(D.iridescenceMap.channel),iridescenceThicknessMapUv:Pt&&C(D.iridescenceThicknessMap.channel),sheenColorMapUv:Dt&&C(D.sheenColorMap.channel),sheenRoughnessMapUv:ht&&C(D.sheenRoughnessMap.channel),specularMapUv:ee&&C(D.specularMap.channel),specularColorMapUv:Re&&C(D.specularColorMap.channel),specularIntensityMapUv:nt&&C(D.specularIntensityMap.channel),transmissionMapUv:$&&C(D.transmissionMap.channel),thicknessMapUv:Ve&&C(D.thicknessMap.channel),alphaMapUv:Be&&C(D.alphaMap.channel),vertexTangents:!!ye.attributes.tangent&&(et||O),vertexColors:D.vertexColors,vertexAlphas:D.vertexColors===!0&&!!ye.attributes.color&&ye.attributes.color.itemSize===4,pointsUvs:ie.isPoints===!0&&!!ye.attributes.uv&&(st||Be),fog:!!ge,useFog:D.fog===!0,fogExp2:!!ge&&ge.isFogExp2,flatShading:D.flatShading===!0,sizeAttenuation:D.sizeAttenuation===!0,logarithmicDepthBuffer:g,reverseDepthBuffer:Xe,skinning:ie.isSkinnedMesh===!0,morphTargets:ye.morphAttributes.position!==void 0,morphNormals:ye.morphAttributes.normal!==void 0,morphColors:ye.morphAttributes.color!==void 0,morphTargetsCount:W,morphTextureStride:ne,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:a.numPlanes,numClipIntersection:a.numIntersection,dithering:D.dithering,shadowMapEnabled:i.shadowMap.enabled&&V.length>0,shadowMapType:i.shadowMap.type,toneMapping:ln,decodeVideoTexture:st&&D.map.isVideoTexture===!0&&gn.getTransfer(D.map.colorSpace)===wn,decodeVideoTextureEmissive:wt&&D.emissiveMap.isVideoTexture===!0&&gn.getTransfer(D.emissiveMap.colorSpace)===wn,premultipliedAlpha:D.premultipliedAlpha,doubleSided:D.side===_s,flipSided:D.side===Ar,useDepthPacking:D.depthPacking>=0,depthPacking:D.depthPacking||0,index0AttributeName:D.index0AttributeName,extensionClipCullDistance:It&&D.extensions.clipCullDistance===!0&&n.has("WEBGL_clip_cull_distance"),extensionMultiDraw:(It&&D.extensions.multiDraw===!0||Je)&&n.has("WEBGL_multi_draw"),rendererExtensionParallelShaderCompile:n.has("KHR_parallel_shader_compile"),customProgramCacheKey:D.customProgramCacheKey()};return Cn.vertexUv1s=h.has(1),Cn.vertexUv2s=h.has(2),Cn.vertexUv3s=h.has(3),h.clear(),Cn}function S(D){const L=[];if(D.shaderID?L.push(D.shaderID):(L.push(D.customVertexShaderID),L.push(D.customFragmentShaderID)),D.defines!==void 0)for(const V in D.defines)L.push(V),L.push(D.defines[V]);return D.isRawShaderMaterial===!1&&(b(L,D),R(L,D),L.push(i.outputColorSpace)),L.push(D.customProgramCacheKey),L.join()}function b(D,L){D.push(L.precision),D.push(L.outputColorSpace),D.push(L.envMapMode),D.push(L.envMapCubeUVHeight),D.push(L.mapUv),D.push(L.alphaMapUv),D.push(L.lightMapUv),D.push(L.aoMapUv),D.push(L.bumpMapUv),D.push(L.normalMapUv),D.push(L.displacementMapUv),D.push(L.emissiveMapUv),D.push(L.metalnessMapUv),D.push(L.roughnessMapUv),D.push(L.anisotropyMapUv),D.push(L.clearcoatMapUv),D.push(L.clearcoatNormalMapUv),D.push(L.clearcoatRoughnessMapUv),D.push(L.iridescenceMapUv),D.push(L.iridescenceThicknessMapUv),D.push(L.sheenColorMapUv),D.push(L.sheenRoughnessMapUv),D.push(L.specularMapUv),D.push(L.specularColorMapUv),D.push(L.specularIntensityMapUv),D.push(L.transmissionMapUv),D.push(L.thicknessMapUv),D.push(L.combine),D.push(L.fogExp2),D.push(L.sizeAttenuation),D.push(L.morphTargetsCount),D.push(L.morphAttributeCount),D.push(L.numDirLights),D.push(L.numPointLights),D.push(L.numSpotLights),D.push(L.numSpotLightMaps),D.push(L.numHemiLights),D.push(L.numRectAreaLights),D.push(L.numDirLightShadows),D.push(L.numPointLightShadows),D.push(L.numSpotLightShadows),D.push(L.numSpotLightShadowsWithMaps),D.push(L.numLightProbes),D.push(L.shadowMapType),D.push(L.toneMapping),D.push(L.numClippingPlanes),D.push(L.numClipIntersection),D.push(L.depthPacking)}function R(D,L){u.disableAll(),L.supportsVertexTextures&&u.enable(0),L.instancing&&u.enable(1),L.instancingColor&&u.enable(2),L.instancingMorph&&u.enable(3),L.matcap&&u.enable(4),L.envMap&&u.enable(5),L.normalMapObjectSpace&&u.enable(6),L.normalMapTangentSpace&&u.enable(7),L.clearcoat&&u.enable(8),L.iridescence&&u.enable(9),L.alphaTest&&u.enable(10),L.vertexColors&&u.enable(11),L.vertexAlphas&&u.enable(12),L.vertexUv1s&&u.enable(13),L.vertexUv2s&&u.enable(14),L.vertexUv3s&&u.enable(15),L.vertexTangents&&u.enable(16),L.anisotropy&&u.enable(17),L.alphaHash&&u.enable(18),L.batching&&u.enable(19),L.dispersion&&u.enable(20),L.batchingColor&&u.enable(21),D.push(u.mask),u.disableAll(),L.fog&&u.enable(0),L.useFog&&u.enable(1),L.flatShading&&u.enable(2),L.logarithmicDepthBuffer&&u.enable(3),L.reverseDepthBuffer&&u.enable(4),L.skinning&&u.enable(5),L.morphTargets&&u.enable(6),L.morphNormals&&u.enable(7),L.morphColors&&u.enable(8),L.premultipliedAlpha&&u.enable(9),L.shadowMapEnabled&&u.enable(10),L.doubleSided&&u.enable(11),L.flipSided&&u.enable(12),L.useDepthPacking&&u.enable(13),L.dithering&&u.enable(14),L.transmission&&u.enable(15),L.sheen&&u.enable(16),L.opaque&&u.enable(17),L.pointsUvs&&u.enable(18),L.decodeVideoTexture&&u.enable(19),L.decodeVideoTextureEmissive&&u.enable(20),L.alphaToCoverage&&u.enable(21),D.push(u.mask)}function P(D){const L=A[D.type];let V;if(L){const oe=qs[L];V=LM.clone(oe.uniforms)}else V=D.uniforms;return V}function U(D,L){let V;for(let oe=0,ie=m.length;oe<ie;oe++){const ge=m[oe];if(ge.cacheKey===L){V=ge,++V.usedTimes;break}}return V===void 0&&(V=new SD(i,L,D,s),m.push(V)),V}function F(D){if(--D.usedTimes===0){const L=m.indexOf(D);m[L]=m[m.length-1],m.pop(),D.destroy()}}function k(D){d.remove(D)}function G(){d.dispose()}return{getParameters:M,getProgramCacheKey:S,getUniforms:P,acquireProgram:U,releaseProgram:F,releaseShaderCache:k,programs:m,dispose:G}}function TD(){let i=new WeakMap;function e(a){return i.has(a)}function t(a){let u=i.get(a);return u===void 0&&(u={},i.set(a,u)),u}function n(a){i.delete(a)}function r(a,u,d){i.get(a)[u]=d}function s(){i=new WeakMap}return{has:e,get:t,remove:n,update:r,dispose:s}}function bD(i,e){return i.groupOrder!==e.groupOrder?i.groupOrder-e.groupOrder:i.renderOrder!==e.renderOrder?i.renderOrder-e.renderOrder:i.material.id!==e.material.id?i.material.id-e.material.id:i.z!==e.z?i.z-e.z:i.id-e.id}function yS(i,e){return i.groupOrder!==e.groupOrder?i.groupOrder-e.groupOrder:i.renderOrder!==e.renderOrder?i.renderOrder-e.renderOrder:i.z!==e.z?e.z-i.z:i.id-e.id}function _S(){const i=[];let e=0;const t=[],n=[],r=[];function s(){e=0,t.length=0,n.length=0,r.length=0}function a(g,v,_,A,C,M){let S=i[e];return S===void 0?(S={id:g.id,object:g,geometry:v,material:_,groupOrder:A,renderOrder:g.renderOrder,z:C,group:M},i[e]=S):(S.id=g.id,S.object=g,S.geometry=v,S.material=_,S.groupOrder=A,S.renderOrder=g.renderOrder,S.z=C,S.group=M),e++,S}function u(g,v,_,A,C,M){const S=a(g,v,_,A,C,M);_.transmission>0?n.push(S):_.transparent===!0?r.push(S):t.push(S)}function d(g,v,_,A,C,M){const S=a(g,v,_,A,C,M);_.transmission>0?n.unshift(S):_.transparent===!0?r.unshift(S):t.unshift(S)}function h(g,v){t.length>1&&t.sort(g||bD),n.length>1&&n.sort(v||yS),r.length>1&&r.sort(v||yS)}function m(){for(let g=e,v=i.length;g<v;g++){const _=i[g];if(_.id===null)break;_.id=null,_.object=null,_.geometry=null,_.material=null,_.group=null}}return{opaque:t,transmissive:n,transparent:r,init:s,push:u,unshift:d,finish:m,sort:h}}function RD(){let i=new WeakMap;function e(n,r){const s=i.get(n);let a;return s===void 0?(a=new _S,i.set(n,[a])):r>=s.length?(a=new _S,s.push(a)):a=s[r],a}function t(){i=new WeakMap}return{get:e,dispose:t}}function ID(){const i={};return{get:function(e){if(i[e.id]!==void 0)return i[e.id];let t;switch(e.type){case"DirectionalLight":t={direction:new X,color:new tt};break;case"SpotLight":t={position:new X,direction:new X,color:new tt,distance:0,coneCos:0,penumbraCos:0,decay:0};break;case"PointLight":t={position:new X,color:new tt,distance:0,decay:0};break;case"HemisphereLight":t={direction:new X,skyColor:new tt,groundColor:new tt};break;case"RectAreaLight":t={color:new tt,position:new X,halfWidth:new X,halfHeight:new X};break}return i[e.id]=t,t}}}function PD(){const i={};return{get:function(e){if(i[e.id]!==void 0)return i[e.id];let t;switch(e.type){case"DirectionalLight":t={shadowIntensity:1,shadowBias:0,shadowNormalBias:0,shadowRadius:1,shadowMapSize:new Le};break;case"SpotLight":t={shadowIntensity:1,shadowBias:0,shadowNormalBias:0,shadowRadius:1,shadowMapSize:new Le};break;case"PointLight":t={shadowIntensity:1,shadowBias:0,shadowNormalBias:0,shadowRadius:1,shadowMapSize:new Le,shadowCameraNear:1,shadowCameraFar:1e3};break}return i[e.id]=t,t}}}let BD=0;function LD(i,e){return(e.castShadow?2:0)-(i.castShadow?2:0)+(e.map?1:0)-(i.map?1:0)}function DD(i){const e=new ID,t=PD(),n={version:0,hash:{directionalLength:-1,pointLength:-1,spotLength:-1,rectAreaLength:-1,hemiLength:-1,numDirectionalShadows:-1,numPointShadows:-1,numSpotShadows:-1,numSpotMaps:-1,numLightProbes:-1},ambient:[0,0,0],probe:[],directional:[],directionalShadow:[],directionalShadowMap:[],directionalShadowMatrix:[],spot:[],spotLightMap:[],spotShadow:[],spotShadowMap:[],spotLightMatrix:[],rectArea:[],rectAreaLTC1:null,rectAreaLTC2:null,point:[],pointShadow:[],pointShadowMap:[],pointShadowMatrix:[],hemi:[],numSpotLightShadowsWithMaps:0,numLightProbes:0};for(let h=0;h<9;h++)n.probe.push(new X);const r=new X,s=new Ot,a=new Ot;function u(h){let m=0,g=0,v=0;for(let D=0;D<9;D++)n.probe[D].set(0,0,0);let _=0,A=0,C=0,M=0,S=0,b=0,R=0,P=0,U=0,F=0,k=0;h.sort(LD);for(let D=0,L=h.length;D<L;D++){const V=h[D],oe=V.color,ie=V.intensity,ge=V.distance,ye=V.shadow&&V.shadow.map?V.shadow.map.texture:null;if(V.isAmbientLight)m+=oe.r*ie,g+=oe.g*ie,v+=oe.b*ie;else if(V.isLightProbe){for(let he=0;he<9;he++)n.probe[he].addScaledVector(V.sh.coefficients[he],ie);k++}else if(V.isDirectionalLight){const he=e.get(V);if(he.color.copy(V.color).multiplyScalar(V.intensity),V.castShadow){const _e=V.shadow,H=t.get(V);H.shadowIntensity=_e.intensity,H.shadowBias=_e.bias,H.shadowNormalBias=_e.normalBias,H.shadowRadius=_e.radius,H.shadowMapSize=_e.mapSize,n.directionalShadow[_]=H,n.directionalShadowMap[_]=ye,n.directionalShadowMatrix[_]=V.shadow.matrix,b++}n.directional[_]=he,_++}else if(V.isSpotLight){const he=e.get(V);he.position.setFromMatrixPosition(V.matrixWorld),he.color.copy(oe).multiplyScalar(ie),he.distance=ge,he.coneCos=Math.cos(V.angle),he.penumbraCos=Math.cos(V.angle*(1-V.penumbra)),he.decay=V.decay,n.spot[C]=he;const _e=V.shadow;if(V.map&&(n.spotLightMap[U]=V.map,U++,_e.updateMatrices(V),V.castShadow&&F++),n.spotLightMatrix[C]=_e.matrix,V.castShadow){const H=t.get(V);H.shadowIntensity=_e.intensity,H.shadowBias=_e.bias,H.shadowNormalBias=_e.normalBias,H.shadowRadius=_e.radius,H.shadowMapSize=_e.mapSize,n.spotShadow[C]=H,n.spotShadowMap[C]=ye,P++}C++}else if(V.isRectAreaLight){const he=e.get(V);he.color.copy(oe).multiplyScalar(ie),he.halfWidth.set(V.width*.5,0,0),he.halfHeight.set(0,V.height*.5,0),n.rectArea[M]=he,M++}else if(V.isPointLight){const he=e.get(V);if(he.color.copy(V.color).multiplyScalar(V.intensity),he.distance=V.distance,he.decay=V.decay,V.castShadow){const _e=V.shadow,H=t.get(V);H.shadowIntensity=_e.intensity,H.shadowBias=_e.bias,H.shadowNormalBias=_e.normalBias,H.shadowRadius=_e.radius,H.shadowMapSize=_e.mapSize,H.shadowCameraNear=_e.camera.near,H.shadowCameraFar=_e.camera.far,n.pointShadow[A]=H,n.pointShadowMap[A]=ye,n.pointShadowMatrix[A]=V.shadow.matrix,R++}n.point[A]=he,A++}else if(V.isHemisphereLight){const he=e.get(V);he.skyColor.copy(V.color).multiplyScalar(ie),he.groundColor.copy(V.groundColor).multiplyScalar(ie),n.hemi[S]=he,S++}}M>0&&(i.has("OES_texture_float_linear")===!0?(n.rectAreaLTC1=lt.LTC_FLOAT_1,n.rectAreaLTC2=lt.LTC_FLOAT_2):(n.rectAreaLTC1=lt.LTC_HALF_1,n.rectAreaLTC2=lt.LTC_HALF_2)),n.ambient[0]=m,n.ambient[1]=g,n.ambient[2]=v;const G=n.hash;(G.directionalLength!==_||G.pointLength!==A||G.spotLength!==C||G.rectAreaLength!==M||G.hemiLength!==S||G.numDirectionalShadows!==b||G.numPointShadows!==R||G.numSpotShadows!==P||G.numSpotMaps!==U||G.numLightProbes!==k)&&(n.directional.length=_,n.spot.length=C,n.rectArea.length=M,n.point.length=A,n.hemi.length=S,n.directionalShadow.length=b,n.directionalShadowMap.length=b,n.pointShadow.length=R,n.pointShadowMap.length=R,n.spotShadow.length=P,n.spotShadowMap.length=P,n.directionalShadowMatrix.length=b,n.pointShadowMatrix.length=R,n.spotLightMatrix.length=P+U-F,n.spotLightMap.length=U,n.numSpotLightShadowsWithMaps=F,n.numLightProbes=k,G.directionalLength=_,G.pointLength=A,G.spotLength=C,G.rectAreaLength=M,G.hemiLength=S,G.numDirectionalShadows=b,G.numPointShadows=R,G.numSpotShadows=P,G.numSpotMaps=U,G.numLightProbes=k,n.version=BD++)}function d(h,m){let g=0,v=0,_=0,A=0,C=0;const M=m.matrixWorldInverse;for(let S=0,b=h.length;S<b;S++){const R=h[S];if(R.isDirectionalLight){const P=n.directional[g];P.direction.setFromMatrixPosition(R.matrixWorld),r.setFromMatrixPosition(R.target.matrixWorld),P.direction.sub(r),P.direction.transformDirection(M),g++}else if(R.isSpotLight){const P=n.spot[_];P.position.setFromMatrixPosition(R.matrixWorld),P.position.applyMatrix4(M),P.direction.setFromMatrixPosition(R.matrixWorld),r.setFromMatrixPosition(R.target.matrixWorld),P.direction.sub(r),P.direction.transformDirection(M),_++}else if(R.isRectAreaLight){const P=n.rectArea[A];P.position.setFromMatrixPosition(R.matrixWorld),P.position.applyMatrix4(M),a.identity(),s.copy(R.matrixWorld),s.premultiply(M),a.extractRotation(s),P.halfWidth.set(R.width*.5,0,0),P.halfHeight.set(0,R.height*.5,0),P.halfWidth.applyMatrix4(a),P.halfHeight.applyMatrix4(a),A++}else if(R.isPointLight){const P=n.point[v];P.position.setFromMatrixPosition(R.matrixWorld),P.position.applyMatrix4(M),v++}else if(R.isHemisphereLight){const P=n.hemi[C];P.direction.setFromMatrixPosition(R.matrixWorld),P.direction.transformDirection(M),C++}}}return{setup:u,setupView:d,state:n}}function xS(i){const e=new DD(i),t=[],n=[];function r(m){h.camera=m,t.length=0,n.length=0}function s(m){t.push(m)}function a(m){n.push(m)}function u(){e.setup(t)}function d(m){e.setupView(t,m)}const h={lightsArray:t,shadowsArray:n,camera:null,lights:e,transmissionRenderTarget:{}};return{init:r,state:h,setupLights:u,setupLightsView:d,pushLight:s,pushShadow:a}}function FD(i){let e=new WeakMap;function t(r,s=0){const a=e.get(r);let u;return a===void 0?(u=new xS(i),e.set(r,[u])):s>=a.length?(u=new xS(i),a.push(u)):u=a[s],u}function n(){e=new WeakMap}return{get:t,dispose:n}}const ND=`void main() {
	gl_Position = vec4( position, 1.0 );
}`,UD=`uniform sampler2D shadow_pass;
uniform vec2 resolution;
uniform float radius;
#include <packing>
void main() {
	const float samples = float( VSM_SAMPLES );
	float mean = 0.0;
	float squared_mean = 0.0;
	float uvStride = samples <= 1.0 ? 0.0 : 2.0 / ( samples - 1.0 );
	float uvStart = samples <= 1.0 ? 0.0 : - 1.0;
	for ( float i = 0.0; i < samples; i ++ ) {
		float uvOffset = uvStart + i * uvStride;
		#ifdef HORIZONTAL_PASS
			vec2 distribution = unpackRGBATo2Half( texture2D( shadow_pass, ( gl_FragCoord.xy + vec2( uvOffset, 0.0 ) * radius ) / resolution ) );
			mean += distribution.x;
			squared_mean += distribution.y * distribution.y + distribution.x * distribution.x;
		#else
			float depth = unpackRGBAToDepth( texture2D( shadow_pass, ( gl_FragCoord.xy + vec2( 0.0, uvOffset ) * radius ) / resolution ) );
			mean += depth;
			squared_mean += depth * depth;
		#endif
	}
	mean = mean / samples;
	squared_mean = squared_mean / samples;
	float std_dev = sqrt( squared_mean - mean * mean );
	gl_FragColor = pack2HalfToRGBA( vec2( mean, std_dev ) );
}`;function OD(i,e,t){let n=new fp;const r=new Le,s=new Le,a=new _n,u=new mx({depthPacking:yM}),d=new gx,h={},m=t.maxTextureSize,g={[To]:Ar,[Ar]:To,[_s]:_s},v=new no({defines:{VSM_SAMPLES:8},uniforms:{shadow_pass:{value:null},resolution:{value:new Le},radius:{value:4}},vertexShader:ND,fragmentShader:UD}),_=v.clone();_.defines.HORIZONTAL_PASS=1;const A=new Kt;A.setAttribute("position",new xn(new Float32Array([-1,-1,.5,3,-1,.5,-1,3,.5]),3));const C=new si(A,v),M=this;this.enabled=!1,this.autoUpdate=!0,this.needsUpdate=!1,this.type=M0;let S=this.type;this.render=function(F,k,G){if(M.enabled===!1||M.autoUpdate===!1&&M.needsUpdate===!1||F.length===0)return;const D=i.getRenderTarget(),L=i.getActiveCubeFace(),V=i.getActiveMipmapLevel(),oe=i.state;oe.setBlending(Ma),oe.buffers.color.setClear(1,1,1,1),oe.buffers.depth.setTest(!0),oe.setScissorTest(!1);const ie=S!==Qs&&this.type===Qs,ge=S===Qs&&this.type!==Qs;for(let ye=0,he=F.length;ye<he;ye++){const _e=F[ye],H=_e.shadow;if(H===void 0){console.warn("THREE.WebGLShadowMap:",_e,"has no shadow.");continue}if(H.autoUpdate===!1&&H.needsUpdate===!1)continue;r.copy(H.mapSize);const Z=H.getFrameExtents();if(r.multiply(Z),s.copy(H.mapSize),(r.x>m||r.y>m)&&(r.x>m&&(s.x=Math.floor(m/Z.x),r.x=s.x*Z.x,H.mapSize.x=s.x),r.y>m&&(s.y=Math.floor(m/Z.y),r.y=s.y*Z.y,H.mapSize.y=s.y)),H.map===null||ie===!0||ge===!0){const W=this.type!==Qs?{minFilter:Di,magFilter:Di}:{};H.map!==null&&H.map.dispose(),H.map=new bo(r.x,r.y,W),H.map.texture.name=_e.name+".shadowMap",H.camera.updateProjectionMatrix()}i.setRenderTarget(H.map),i.clear();const q=H.getViewportCount();for(let W=0;W<q;W++){const ne=H.getViewport(W);a.set(s.x*ne.x,s.y*ne.y,s.x*ne.z,s.y*ne.w),oe.viewport(a),H.updateMatrices(_e,W),n=H.getFrustum(),P(k,G,H.camera,_e,this.type)}H.isPointLightShadow!==!0&&this.type===Qs&&b(H,G),H.needsUpdate=!1}S=this.type,M.needsUpdate=!1,i.setRenderTarget(D,L,V)};function b(F,k){const G=e.update(C);v.defines.VSM_SAMPLES!==F.blurSamples&&(v.defines.VSM_SAMPLES=F.blurSamples,_.defines.VSM_SAMPLES=F.blurSamples,v.needsUpdate=!0,_.needsUpdate=!0),F.mapPass===null&&(F.mapPass=new bo(r.x,r.y)),v.uniforms.shadow_pass.value=F.map.texture,v.uniforms.resolution.value=F.mapSize,v.uniforms.radius.value=F.radius,i.setRenderTarget(F.mapPass),i.clear(),i.renderBufferDirect(k,null,G,v,C,null),_.uniforms.shadow_pass.value=F.mapPass.texture,_.uniforms.resolution.value=F.mapSize,_.uniforms.radius.value=F.radius,i.setRenderTarget(F.map),i.clear(),i.renderBufferDirect(k,null,G,_,C,null)}function R(F,k,G,D){let L=null;const V=G.isPointLight===!0?F.customDistanceMaterial:F.customDepthMaterial;if(V!==void 0)L=V;else if(L=G.isPointLight===!0?d:u,i.localClippingEnabled&&k.clipShadows===!0&&Array.isArray(k.clippingPlanes)&&k.clippingPlanes.length!==0||k.displacementMap&&k.displacementScale!==0||k.alphaMap&&k.alphaTest>0||k.map&&k.alphaTest>0){const oe=L.uuid,ie=k.uuid;let ge=h[oe];ge===void 0&&(ge={},h[oe]=ge);let ye=ge[ie];ye===void 0&&(ye=L.clone(),ge[ie]=ye,k.addEventListener("dispose",U)),L=ye}if(L.visible=k.visible,L.wireframe=k.wireframe,D===Qs?L.side=k.shadowSide!==null?k.shadowSide:k.side:L.side=k.shadowSide!==null?k.shadowSide:g[k.side],L.alphaMap=k.alphaMap,L.alphaTest=k.alphaTest,L.map=k.map,L.clipShadows=k.clipShadows,L.clippingPlanes=k.clippingPlanes,L.clipIntersection=k.clipIntersection,L.displacementMap=k.displacementMap,L.displacementScale=k.displacementScale,L.displacementBias=k.displacementBias,L.wireframeLinewidth=k.wireframeLinewidth,L.linewidth=k.linewidth,G.isPointLight===!0&&L.isMeshDistanceMaterial===!0){const oe=i.properties.get(L);oe.light=G}return L}function P(F,k,G,D,L){if(F.visible===!1)return;if(F.layers.test(k.layers)&&(F.isMesh||F.isLine||F.isPoints)&&(F.castShadow||F.receiveShadow&&L===Qs)&&(!F.frustumCulled||n.intersectsObject(F))){F.modelViewMatrix.multiplyMatrices(G.matrixWorldInverse,F.matrixWorld);const ie=e.update(F),ge=F.material;if(Array.isArray(ge)){const ye=ie.groups;for(let he=0,_e=ye.length;he<_e;he++){const H=ye[he],Z=ge[H.materialIndex];if(Z&&Z.visible){const q=R(F,Z,D,L);F.onBeforeShadow(i,F,k,G,ie,q,H),i.renderBufferDirect(G,null,ie,q,F,H),F.onAfterShadow(i,F,k,G,ie,q,H)}}}else if(ge.visible){const ye=R(F,ge,D,L);F.onBeforeShadow(i,F,k,G,ie,ye,null),i.renderBufferDirect(G,null,ie,ye,F,null),F.onAfterShadow(i,F,k,G,ie,ye,null)}}const oe=F.children;for(let ie=0,ge=oe.length;ie<ge;ie++)P(oe[ie],k,G,D,L)}function U(F){F.target.removeEventListener("dispose",U);for(const G in h){const D=h[G],L=F.target.uuid;L in D&&(D[L].dispose(),delete D[L])}}}const kD={[bg]:Rg,[Ig]:Lg,[Pg]:Dg,[Ku]:Bg,[Rg]:bg,[Lg]:Ig,[Dg]:Pg,[Bg]:Ku};function HD(i,e){function t(){let $=!1;const Ve=new _n;let Me=null;const Be=new _n(0,0,0,0);return{setMask:function(ut){Me!==ut&&!$&&(i.colorMask(ut,ut,ut,ut),Me=ut)},setLocked:function(ut){$=ut},setClear:function(ut,it,It,ln,Cn){Cn===!0&&(ut*=ln,it*=ln,It*=ln),Ve.set(ut,it,It,ln),Be.equals(Ve)===!1&&(i.clearColor(ut,it,It,ln),Be.copy(Ve))},reset:function(){$=!1,Me=null,Be.set(-1,0,0,0)}}}function n(){let $=!1,Ve=!1,Me=null,Be=null,ut=null;return{setReversed:function(it){if(Ve!==it){const It=e.get("EXT_clip_control");Ve?It.clipControlEXT(It.LOWER_LEFT_EXT,It.ZERO_TO_ONE_EXT):It.clipControlEXT(It.LOWER_LEFT_EXT,It.NEGATIVE_ONE_TO_ONE_EXT);const ln=ut;ut=null,this.setClear(ln)}Ve=it},getReversed:function(){return Ve},setTest:function(it){it?Ie(i.DEPTH_TEST):Xe(i.DEPTH_TEST)},setMask:function(it){Me!==it&&!$&&(i.depthMask(it),Me=it)},setFunc:function(it){if(Ve&&(it=kD[it]),Be!==it){switch(it){case bg:i.depthFunc(i.NEVER);break;case Rg:i.depthFunc(i.ALWAYS);break;case Ig:i.depthFunc(i.LESS);break;case Ku:i.depthFunc(i.LEQUAL);break;case Pg:i.depthFunc(i.EQUAL);break;case Bg:i.depthFunc(i.GEQUAL);break;case Lg:i.depthFunc(i.GREATER);break;case Dg:i.depthFunc(i.NOTEQUAL);break;default:i.depthFunc(i.LEQUAL)}Be=it}},setLocked:function(it){$=it},setClear:function(it){ut!==it&&(Ve&&(it=1-it),i.clearDepth(it),ut=it)},reset:function(){$=!1,Me=null,Be=null,ut=null,Ve=!1}}}function r(){let $=!1,Ve=null,Me=null,Be=null,ut=null,it=null,It=null,ln=null,Cn=null;return{setTest:function(Yt){$||(Yt?Ie(i.STENCIL_TEST):Xe(i.STENCIL_TEST))},setMask:function(Yt){Ve!==Yt&&!$&&(i.stencilMask(Yt),Ve=Yt)},setFunc:function(Yt,Gn,Kn){(Me!==Yt||Be!==Gn||ut!==Kn)&&(i.stencilFunc(Yt,Gn,Kn),Me=Yt,Be=Gn,ut=Kn)},setOp:function(Yt,Gn,Kn){(it!==Yt||It!==Gn||ln!==Kn)&&(i.stencilOp(Yt,Gn,Kn),it=Yt,It=Gn,ln=Kn)},setLocked:function(Yt){$=Yt},setClear:function(Yt){Cn!==Yt&&(i.clearStencil(Yt),Cn=Yt)},reset:function(){$=!1,Ve=null,Me=null,Be=null,ut=null,it=null,It=null,ln=null,Cn=null}}}const s=new t,a=new n,u=new r,d=new WeakMap,h=new WeakMap;let m={},g={},v=new WeakMap,_=[],A=null,C=!1,M=null,S=null,b=null,R=null,P=null,U=null,F=null,k=new tt(0,0,0),G=0,D=!1,L=null,V=null,oe=null,ie=null,ge=null;const ye=i.getParameter(i.MAX_COMBINED_TEXTURE_IMAGE_UNITS);let he=!1,_e=0;const H=i.getParameter(i.VERSION);H.indexOf("WebGL")!==-1?(_e=parseFloat(/^WebGL (\d)/.exec(H)[1]),he=_e>=1):H.indexOf("OpenGL ES")!==-1&&(_e=parseFloat(/^OpenGL ES (\d)/.exec(H)[1]),he=_e>=2);let Z=null,q={};const W=i.getParameter(i.SCISSOR_BOX),ne=i.getParameter(i.VIEWPORT),Fe=new _n().fromArray(W),ae=new _n().fromArray(ne);function we($,Ve,Me,Be){const ut=new Uint8Array(4),it=i.createTexture();i.bindTexture($,it),i.texParameteri($,i.TEXTURE_MIN_FILTER,i.NEAREST),i.texParameteri($,i.TEXTURE_MAG_FILTER,i.NEAREST);for(let It=0;It<Me;It++)$===i.TEXTURE_3D||$===i.TEXTURE_2D_ARRAY?i.texImage3D(Ve,0,i.RGBA,1,1,Be,0,i.RGBA,i.UNSIGNED_BYTE,ut):i.texImage2D(Ve+It,0,i.RGBA,1,1,0,i.RGBA,i.UNSIGNED_BYTE,ut);return it}const De={};De[i.TEXTURE_2D]=we(i.TEXTURE_2D,i.TEXTURE_2D,1),De[i.TEXTURE_CUBE_MAP]=we(i.TEXTURE_CUBE_MAP,i.TEXTURE_CUBE_MAP_POSITIVE_X,6),De[i.TEXTURE_2D_ARRAY]=we(i.TEXTURE_2D_ARRAY,i.TEXTURE_2D_ARRAY,1,1),De[i.TEXTURE_3D]=we(i.TEXTURE_3D,i.TEXTURE_3D,1,1),s.setClear(0,0,0,1),a.setClear(1),u.setClear(0),Ie(i.DEPTH_TEST),a.setFunc(Ku),ke(!1),et(o_),Ie(i.CULL_FACE),J(Ma);function Ie($){m[$]!==!0&&(i.enable($),m[$]=!0)}function Xe($){m[$]!==!1&&(i.disable($),m[$]=!1)}function _t($,Ve){return g[$]!==Ve?(i.bindFramebuffer($,Ve),g[$]=Ve,$===i.DRAW_FRAMEBUFFER&&(g[i.FRAMEBUFFER]=Ve),$===i.FRAMEBUFFER&&(g[i.DRAW_FRAMEBUFFER]=Ve),!0):!1}function Je($,Ve){let Me=_,Be=!1;if($){Me=v.get(Ve),Me===void 0&&(Me=[],v.set(Ve,Me));const ut=$.textures;if(Me.length!==ut.length||Me[0]!==i.COLOR_ATTACHMENT0){for(let it=0,It=ut.length;it<It;it++)Me[it]=i.COLOR_ATTACHMENT0+it;Me.length=ut.length,Be=!0}}else Me[0]!==i.BACK&&(Me[0]=i.BACK,Be=!0);Be&&i.drawBuffers(Me)}function st($){return A!==$?(i.useProgram($),A=$,!0):!1}const Ne={[_l]:i.FUNC_ADD,[z2]:i.FUNC_SUBTRACT,[G2]:i.FUNC_REVERSE_SUBTRACT};Ne[V2]=i.MIN,Ne[W2]=i.MAX;const be={[X2]:i.ZERO,[j2]:i.ONE,[J2]:i.SRC_COLOR,[Cg]:i.SRC_ALPHA,[$2]:i.SRC_ALPHA_SATURATE,[q2]:i.DST_COLOR,[Y2]:i.DST_ALPHA,[K2]:i.ONE_MINUS_SRC_COLOR,[Tg]:i.ONE_MINUS_SRC_ALPHA,[Z2]:i.ONE_MINUS_DST_COLOR,[Q2]:i.ONE_MINUS_DST_ALPHA,[eM]:i.CONSTANT_COLOR,[tM]:i.ONE_MINUS_CONSTANT_COLOR,[nM]:i.CONSTANT_ALPHA,[iM]:i.ONE_MINUS_CONSTANT_ALPHA};function J($,Ve,Me,Be,ut,it,It,ln,Cn,Yt){if($===Ma){C===!0&&(Xe(i.BLEND),C=!1);return}if(C===!1&&(Ie(i.BLEND),C=!0),$!==H2){if($!==M||Yt!==D){if((S!==_l||P!==_l)&&(i.blendEquation(i.FUNC_ADD),S=_l,P=_l),Yt)switch($){case Vu:i.blendFuncSeparate(i.ONE,i.ONE_MINUS_SRC_ALPHA,i.ONE,i.ONE_MINUS_SRC_ALPHA);break;case a_:i.blendFunc(i.ONE,i.ONE);break;case l_:i.blendFuncSeparate(i.ZERO,i.ONE_MINUS_SRC_COLOR,i.ZERO,i.ONE);break;case u_:i.blendFuncSeparate(i.ZERO,i.SRC_COLOR,i.ZERO,i.SRC_ALPHA);break;default:console.error("THREE.WebGLState: Invalid blending: ",$);break}else switch($){case Vu:i.blendFuncSeparate(i.SRC_ALPHA,i.ONE_MINUS_SRC_ALPHA,i.ONE,i.ONE_MINUS_SRC_ALPHA);break;case a_:i.blendFunc(i.SRC_ALPHA,i.ONE);break;case l_:i.blendFuncSeparate(i.ZERO,i.ONE_MINUS_SRC_COLOR,i.ZERO,i.ONE);break;case u_:i.blendFunc(i.ZERO,i.SRC_COLOR);break;default:console.error("THREE.WebGLState: Invalid blending: ",$);break}b=null,R=null,U=null,F=null,k.set(0,0,0),G=0,M=$,D=Yt}return}ut=ut||Ve,it=it||Me,It=It||Be,(Ve!==S||ut!==P)&&(i.blendEquationSeparate(Ne[Ve],Ne[ut]),S=Ve,P=ut),(Me!==b||Be!==R||it!==U||It!==F)&&(i.blendFuncSeparate(be[Me],be[Be],be[it],be[It]),b=Me,R=Be,U=it,F=It),(ln.equals(k)===!1||Cn!==G)&&(i.blendColor(ln.r,ln.g,ln.b,Cn),k.copy(ln),G=Cn),M=$,D=!1}function mt($,Ve){$.side===_s?Xe(i.CULL_FACE):Ie(i.CULL_FACE);let Me=$.side===Ar;Ve&&(Me=!Me),ke(Me),$.blending===Vu&&$.transparent===!1?J(Ma):J($.blending,$.blendEquation,$.blendSrc,$.blendDst,$.blendEquationAlpha,$.blendSrcAlpha,$.blendDstAlpha,$.blendColor,$.blendAlpha,$.premultipliedAlpha),a.setFunc($.depthFunc),a.setTest($.depthTest),a.setMask($.depthWrite),s.setMask($.colorWrite);const Be=$.stencilWrite;u.setTest(Be),Be&&(u.setMask($.stencilWriteMask),u.setFunc($.stencilFunc,$.stencilRef,$.stencilFuncMask),u.setOp($.stencilFail,$.stencilZFail,$.stencilZPass)),wt($.polygonOffset,$.polygonOffsetFactor,$.polygonOffsetUnits),$.alphaToCoverage===!0?Ie(i.SAMPLE_ALPHA_TO_COVERAGE):Xe(i.SAMPLE_ALPHA_TO_COVERAGE)}function ke($){L!==$&&($?i.frontFace(i.CW):i.frontFace(i.CCW),L=$)}function et($){$!==U2?(Ie(i.CULL_FACE),$!==V&&($===o_?i.cullFace(i.BACK):$===O2?i.cullFace(i.FRONT):i.cullFace(i.FRONT_AND_BACK))):Xe(i.CULL_FACE),V=$}function je($){$!==oe&&(he&&i.lineWidth($),oe=$)}function wt($,Ve,Me){$?(Ie(i.POLYGON_OFFSET_FILL),(ie!==Ve||ge!==Me)&&(i.polygonOffset(Ve,Me),ie=Ve,ge=Me)):Xe(i.POLYGON_OFFSET_FILL)}function qe($){$?Ie(i.SCISSOR_TEST):Xe(i.SCISSOR_TEST)}function j($){$===void 0&&($=i.TEXTURE0+ye-1),Z!==$&&(i.activeTexture($),Z=$)}function O($,Ve,Me){Me===void 0&&(Z===null?Me=i.TEXTURE0+ye-1:Me=Z);let Be=q[Me];Be===void 0&&(Be={type:void 0,texture:void 0},q[Me]=Be),(Be.type!==$||Be.texture!==Ve)&&(Z!==Me&&(i.activeTexture(Me),Z=Me),i.bindTexture($,Ve||De[$]),Be.type=$,Be.texture=Ve)}function pe(){const $=q[Z];$!==void 0&&$.type!==void 0&&(i.bindTexture($.type,null),$.type=void 0,$.texture=void 0)}function Ce(){try{i.compressedTexImage2D.apply(i,arguments)}catch($){console.error("THREE.WebGLState:",$)}}function Ue(){try{i.compressedTexImage3D.apply(i,arguments)}catch($){console.error("THREE.WebGLState:",$)}}function Pe(){try{i.texSubImage2D.apply(i,arguments)}catch($){console.error("THREE.WebGLState:",$)}}function ot(){try{i.texSubImage3D.apply(i,arguments)}catch($){console.error("THREE.WebGLState:",$)}}function Ze(){try{i.compressedTexSubImage2D.apply(i,arguments)}catch($){console.error("THREE.WebGLState:",$)}}function ct(){try{i.compressedTexSubImage3D.apply(i,arguments)}catch($){console.error("THREE.WebGLState:",$)}}function zt(){try{i.texStorage2D.apply(i,arguments)}catch($){console.error("THREE.WebGLState:",$)}}function ze(){try{i.texStorage3D.apply(i,arguments)}catch($){console.error("THREE.WebGLState:",$)}}function gt(){try{i.texImage2D.apply(i,arguments)}catch($){console.error("THREE.WebGLState:",$)}}function Pt(){try{i.texImage3D.apply(i,arguments)}catch($){console.error("THREE.WebGLState:",$)}}function Dt($){Fe.equals($)===!1&&(i.scissor($.x,$.y,$.z,$.w),Fe.copy($))}function ht($){ae.equals($)===!1&&(i.viewport($.x,$.y,$.z,$.w),ae.copy($))}function ee($,Ve){let Me=h.get(Ve);Me===void 0&&(Me=new WeakMap,h.set(Ve,Me));let Be=Me.get($);Be===void 0&&(Be=i.getUniformBlockIndex(Ve,$.name),Me.set($,Be))}function Re($,Ve){const Be=h.get(Ve).get($);d.get(Ve)!==Be&&(i.uniformBlockBinding(Ve,Be,$.__bindingPointIndex),d.set(Ve,Be))}function nt(){i.disable(i.BLEND),i.disable(i.CULL_FACE),i.disable(i.DEPTH_TEST),i.disable(i.POLYGON_OFFSET_FILL),i.disable(i.SCISSOR_TEST),i.disable(i.STENCIL_TEST),i.disable(i.SAMPLE_ALPHA_TO_COVERAGE),i.blendEquation(i.FUNC_ADD),i.blendFunc(i.ONE,i.ZERO),i.blendFuncSeparate(i.ONE,i.ZERO,i.ONE,i.ZERO),i.blendColor(0,0,0,0),i.colorMask(!0,!0,!0,!0),i.clearColor(0,0,0,0),i.depthMask(!0),i.depthFunc(i.LESS),a.setReversed(!1),i.clearDepth(1),i.stencilMask(4294967295),i.stencilFunc(i.ALWAYS,0,4294967295),i.stencilOp(i.KEEP,i.KEEP,i.KEEP),i.clearStencil(0),i.cullFace(i.BACK),i.frontFace(i.CCW),i.polygonOffset(0,0),i.activeTexture(i.TEXTURE0),i.bindFramebuffer(i.FRAMEBUFFER,null),i.bindFramebuffer(i.DRAW_FRAMEBUFFER,null),i.bindFramebuffer(i.READ_FRAMEBUFFER,null),i.useProgram(null),i.lineWidth(1),i.scissor(0,0,i.canvas.width,i.canvas.height),i.viewport(0,0,i.canvas.width,i.canvas.height),m={},Z=null,q={},g={},v=new WeakMap,_=[],A=null,C=!1,M=null,S=null,b=null,R=null,P=null,U=null,F=null,k=new tt(0,0,0),G=0,D=!1,L=null,V=null,oe=null,ie=null,ge=null,Fe.set(0,0,i.canvas.width,i.canvas.height),ae.set(0,0,i.canvas.width,i.canvas.height),s.reset(),a.reset(),u.reset()}return{buffers:{color:s,depth:a,stencil:u},enable:Ie,disable:Xe,bindFramebuffer:_t,drawBuffers:Je,useProgram:st,setBlending:J,setMaterial:mt,setFlipSided:ke,setCullFace:et,setLineWidth:je,setPolygonOffset:wt,setScissorTest:qe,activeTexture:j,bindTexture:O,unbindTexture:pe,compressedTexImage2D:Ce,compressedTexImage3D:Ue,texImage2D:gt,texImage3D:Pt,updateUBOMapping:ee,uniformBlockBinding:Re,texStorage2D:zt,texStorage3D:ze,texSubImage2D:Pe,texSubImage3D:ot,compressedTexSubImage2D:Ze,compressedTexSubImage3D:ct,scissor:Dt,viewport:ht,reset:nt}}function zD(i,e,t,n,r,s,a){const u=e.has("WEBGL_multisampled_render_to_texture")?e.get("WEBGL_multisampled_render_to_texture"):null,d=typeof navigator>"u"?!1:/OculusBrowser/g.test(navigator.userAgent),h=new Le,m=new WeakMap;let g;const v=new WeakMap;let _=!1;try{_=typeof OffscreenCanvas<"u"&&new OffscreenCanvas(1,1).getContext("2d")!==null}catch{}function A(j,O){return _?new OffscreenCanvas(j,O):Wh("canvas")}function C(j,O,pe){let Ce=1;const Ue=qe(j);if((Ue.width>pe||Ue.height>pe)&&(Ce=pe/Math.max(Ue.width,Ue.height)),Ce<1)if(typeof HTMLImageElement<"u"&&j instanceof HTMLImageElement||typeof HTMLCanvasElement<"u"&&j instanceof HTMLCanvasElement||typeof ImageBitmap<"u"&&j instanceof ImageBitmap||typeof VideoFrame<"u"&&j instanceof VideoFrame){const Pe=Math.floor(Ce*Ue.width),ot=Math.floor(Ce*Ue.height);g===void 0&&(g=A(Pe,ot));const Ze=O?A(Pe,ot):g;return Ze.width=Pe,Ze.height=ot,Ze.getContext("2d").drawImage(j,0,0,Pe,ot),console.warn("THREE.WebGLRenderer: Texture has been resized from ("+Ue.width+"x"+Ue.height+") to ("+Pe+"x"+ot+")."),Ze}else return"data"in j&&console.warn("THREE.WebGLRenderer: Image in DataTexture is too big ("+Ue.width+"x"+Ue.height+")."),j;return j}function M(j){return j.generateMipmaps}function S(j){i.generateMipmap(j)}function b(j){return j.isWebGLCubeRenderTarget?i.TEXTURE_CUBE_MAP:j.isWebGL3DRenderTarget?i.TEXTURE_3D:j.isWebGLArrayRenderTarget||j.isCompressedArrayTexture?i.TEXTURE_2D_ARRAY:i.TEXTURE_2D}function R(j,O,pe,Ce,Ue=!1){if(j!==null){if(i[j]!==void 0)return i[j];console.warn("THREE.WebGLRenderer: Attempt to use non-existing WebGL internal format '"+j+"'")}let Pe=O;if(O===i.RED&&(pe===i.FLOAT&&(Pe=i.R32F),pe===i.HALF_FLOAT&&(Pe=i.R16F),pe===i.UNSIGNED_BYTE&&(Pe=i.R8)),O===i.RED_INTEGER&&(pe===i.UNSIGNED_BYTE&&(Pe=i.R8UI),pe===i.UNSIGNED_SHORT&&(Pe=i.R16UI),pe===i.UNSIGNED_INT&&(Pe=i.R32UI),pe===i.BYTE&&(Pe=i.R8I),pe===i.SHORT&&(Pe=i.R16I),pe===i.INT&&(Pe=i.R32I)),O===i.RG&&(pe===i.FLOAT&&(Pe=i.RG32F),pe===i.HALF_FLOAT&&(Pe=i.RG16F),pe===i.UNSIGNED_BYTE&&(Pe=i.RG8)),O===i.RG_INTEGER&&(pe===i.UNSIGNED_BYTE&&(Pe=i.RG8UI),pe===i.UNSIGNED_SHORT&&(Pe=i.RG16UI),pe===i.UNSIGNED_INT&&(Pe=i.RG32UI),pe===i.BYTE&&(Pe=i.RG8I),pe===i.SHORT&&(Pe=i.RG16I),pe===i.INT&&(Pe=i.RG32I)),O===i.RGB_INTEGER&&(pe===i.UNSIGNED_BYTE&&(Pe=i.RGB8UI),pe===i.UNSIGNED_SHORT&&(Pe=i.RGB16UI),pe===i.UNSIGNED_INT&&(Pe=i.RGB32UI),pe===i.BYTE&&(Pe=i.RGB8I),pe===i.SHORT&&(Pe=i.RGB16I),pe===i.INT&&(Pe=i.RGB32I)),O===i.RGBA_INTEGER&&(pe===i.UNSIGNED_BYTE&&(Pe=i.RGBA8UI),pe===i.UNSIGNED_SHORT&&(Pe=i.RGBA16UI),pe===i.UNSIGNED_INT&&(Pe=i.RGBA32UI),pe===i.BYTE&&(Pe=i.RGBA8I),pe===i.SHORT&&(Pe=i.RGBA16I),pe===i.INT&&(Pe=i.RGBA32I)),O===i.RGB&&pe===i.UNSIGNED_INT_5_9_9_9_REV&&(Pe=i.RGB9_E5),O===i.RGBA){const ot=Ue?zh:gn.getTransfer(Ce);pe===i.FLOAT&&(Pe=i.RGBA32F),pe===i.HALF_FLOAT&&(Pe=i.RGBA16F),pe===i.UNSIGNED_BYTE&&(Pe=ot===wn?i.SRGB8_ALPHA8:i.RGBA8),pe===i.UNSIGNED_SHORT_4_4_4_4&&(Pe=i.RGBA4),pe===i.UNSIGNED_SHORT_5_5_5_1&&(Pe=i.RGB5_A1)}return(Pe===i.R16F||Pe===i.R32F||Pe===i.RG16F||Pe===i.RG32F||Pe===i.RGBA16F||Pe===i.RGBA32F)&&e.get("EXT_color_buffer_float"),Pe}function P(j,O){let pe;return j?O===null||O===ba||O===Yu?pe=i.DEPTH24_STENCIL8:O===Or?pe=i.DEPTH32F_STENCIL8:O===Jf&&(pe=i.DEPTH24_STENCIL8,console.warn("DepthTexture: 16 bit depth attachment is not supported with stencil. Using 24-bit attachment.")):O===null||O===ba||O===Yu?pe=i.DEPTH_COMPONENT24:O===Or?pe=i.DEPTH_COMPONENT32F:O===Jf&&(pe=i.DEPTH_COMPONENT16),pe}function U(j,O){return M(j)===!0||j.isFramebufferTexture&&j.minFilter!==Di&&j.minFilter!==ri?Math.log2(Math.max(O.width,O.height))+1:j.mipmaps!==void 0&&j.mipmaps.length>0?j.mipmaps.length:j.isCompressedTexture&&Array.isArray(j.image)?O.mipmaps.length:1}function F(j){const O=j.target;O.removeEventListener("dispose",F),G(O),O.isVideoTexture&&m.delete(O)}function k(j){const O=j.target;O.removeEventListener("dispose",k),L(O)}function G(j){const O=n.get(j);if(O.__webglInit===void 0)return;const pe=j.source,Ce=v.get(pe);if(Ce){const Ue=Ce[O.__cacheKey];Ue.usedTimes--,Ue.usedTimes===0&&D(j),Object.keys(Ce).length===0&&v.delete(pe)}n.remove(j)}function D(j){const O=n.get(j);i.deleteTexture(O.__webglTexture);const pe=j.source,Ce=v.get(pe);delete Ce[O.__cacheKey],a.memory.textures--}function L(j){const O=n.get(j);if(j.depthTexture&&(j.depthTexture.dispose(),n.remove(j.depthTexture)),j.isWebGLCubeRenderTarget)for(let Ce=0;Ce<6;Ce++){if(Array.isArray(O.__webglFramebuffer[Ce]))for(let Ue=0;Ue<O.__webglFramebuffer[Ce].length;Ue++)i.deleteFramebuffer(O.__webglFramebuffer[Ce][Ue]);else i.deleteFramebuffer(O.__webglFramebuffer[Ce]);O.__webglDepthbuffer&&i.deleteRenderbuffer(O.__webglDepthbuffer[Ce])}else{if(Array.isArray(O.__webglFramebuffer))for(let Ce=0;Ce<O.__webglFramebuffer.length;Ce++)i.deleteFramebuffer(O.__webglFramebuffer[Ce]);else i.deleteFramebuffer(O.__webglFramebuffer);if(O.__webglDepthbuffer&&i.deleteRenderbuffer(O.__webglDepthbuffer),O.__webglMultisampledFramebuffer&&i.deleteFramebuffer(O.__webglMultisampledFramebuffer),O.__webglColorRenderbuffer)for(let Ce=0;Ce<O.__webglColorRenderbuffer.length;Ce++)O.__webglColorRenderbuffer[Ce]&&i.deleteRenderbuffer(O.__webglColorRenderbuffer[Ce]);O.__webglDepthRenderbuffer&&i.deleteRenderbuffer(O.__webglDepthRenderbuffer)}const pe=j.textures;for(let Ce=0,Ue=pe.length;Ce<Ue;Ce++){const Pe=n.get(pe[Ce]);Pe.__webglTexture&&(i.deleteTexture(Pe.__webglTexture),a.memory.textures--),n.remove(pe[Ce])}n.remove(j)}let V=0;function oe(){V=0}function ie(){const j=V;return j>=r.maxTextures&&console.warn("THREE.WebGLTextures: Trying to use "+j+" texture units while this GPU supports only "+r.maxTextures),V+=1,j}function ge(j){const O=[];return O.push(j.wrapS),O.push(j.wrapT),O.push(j.wrapR||0),O.push(j.magFilter),O.push(j.minFilter),O.push(j.anisotropy),O.push(j.internalFormat),O.push(j.format),O.push(j.type),O.push(j.generateMipmaps),O.push(j.premultiplyAlpha),O.push(j.flipY),O.push(j.unpackAlignment),O.push(j.colorSpace),O.join()}function ye(j,O){const pe=n.get(j);if(j.isVideoTexture&&je(j),j.isRenderTargetTexture===!1&&j.version>0&&pe.__version!==j.version){const Ce=j.image;if(Ce===null)console.warn("THREE.WebGLRenderer: Texture marked for update but no image data found.");else if(Ce.complete===!1)console.warn("THREE.WebGLRenderer: Texture marked for update but image is incomplete");else{ae(pe,j,O);return}}t.bindTexture(i.TEXTURE_2D,pe.__webglTexture,i.TEXTURE0+O)}function he(j,O){const pe=n.get(j);if(j.version>0&&pe.__version!==j.version){ae(pe,j,O);return}t.bindTexture(i.TEXTURE_2D_ARRAY,pe.__webglTexture,i.TEXTURE0+O)}function _e(j,O){const pe=n.get(j);if(j.version>0&&pe.__version!==j.version){ae(pe,j,O);return}t.bindTexture(i.TEXTURE_3D,pe.__webglTexture,i.TEXTURE0+O)}function H(j,O){const pe=n.get(j);if(j.version>0&&pe.__version!==j.version){we(pe,j,O);return}t.bindTexture(i.TEXTURE_CUBE_MAP,pe.__webglTexture,i.TEXTURE0+O)}const Z={[Cl]:i.REPEAT,[$r]:i.CLAMP_TO_EDGE,[jf]:i.MIRRORED_REPEAT},q={[Di]:i.NEAREST,[w0]:i.NEAREST_MIPMAP_NEAREST,[Nu]:i.NEAREST_MIPMAP_LINEAR,[ri]:i.LINEAR,[Gf]:i.LINEAR_MIPMAP_NEAREST,[As]:i.LINEAR_MIPMAP_LINEAR},W={[xM]:i.NEVER,[CM]:i.ALWAYS,[AM]:i.LESS,[Z_]:i.LEQUAL,[SM]:i.EQUAL,[wM]:i.GEQUAL,[MM]:i.GREATER,[EM]:i.NOTEQUAL};function ne(j,O){if(O.type===Or&&e.has("OES_texture_float_linear")===!1&&(O.magFilter===ri||O.magFilter===Gf||O.magFilter===Nu||O.magFilter===As||O.minFilter===ri||O.minFilter===Gf||O.minFilter===Nu||O.minFilter===As)&&console.warn("THREE.WebGLRenderer: Unable to use linear filtering with floating point textures. OES_texture_float_linear not supported on this device."),i.texParameteri(j,i.TEXTURE_WRAP_S,Z[O.wrapS]),i.texParameteri(j,i.TEXTURE_WRAP_T,Z[O.wrapT]),(j===i.TEXTURE_3D||j===i.TEXTURE_2D_ARRAY)&&i.texParameteri(j,i.TEXTURE_WRAP_R,Z[O.wrapR]),i.texParameteri(j,i.TEXTURE_MAG_FILTER,q[O.magFilter]),i.texParameteri(j,i.TEXTURE_MIN_FILTER,q[O.minFilter]),O.compareFunction&&(i.texParameteri(j,i.TEXTURE_COMPARE_MODE,i.COMPARE_REF_TO_TEXTURE),i.texParameteri(j,i.TEXTURE_COMPARE_FUNC,W[O.compareFunction])),e.has("EXT_texture_filter_anisotropic")===!0){if(O.magFilter===Di||O.minFilter!==Nu&&O.minFilter!==As||O.type===Or&&e.has("OES_texture_float_linear")===!1)return;if(O.anisotropy>1||n.get(O).__currentAnisotropy){const pe=e.get("EXT_texture_filter_anisotropic");i.texParameterf(j,pe.TEXTURE_MAX_ANISOTROPY_EXT,Math.min(O.anisotropy,r.getMaxAnisotropy())),n.get(O).__currentAnisotropy=O.anisotropy}}}function Fe(j,O){let pe=!1;j.__webglInit===void 0&&(j.__webglInit=!0,O.addEventListener("dispose",F));const Ce=O.source;let Ue=v.get(Ce);Ue===void 0&&(Ue={},v.set(Ce,Ue));const Pe=ge(O);if(Pe!==j.__cacheKey){Ue[Pe]===void 0&&(Ue[Pe]={texture:i.createTexture(),usedTimes:0},a.memory.textures++,pe=!0),Ue[Pe].usedTimes++;const ot=Ue[j.__cacheKey];ot!==void 0&&(Ue[j.__cacheKey].usedTimes--,ot.usedTimes===0&&D(O)),j.__cacheKey=Pe,j.__webglTexture=Ue[Pe].texture}return pe}function ae(j,O,pe){let Ce=i.TEXTURE_2D;(O.isDataArrayTexture||O.isCompressedArrayTexture)&&(Ce=i.TEXTURE_2D_ARRAY),O.isData3DTexture&&(Ce=i.TEXTURE_3D);const Ue=Fe(j,O),Pe=O.source;t.bindTexture(Ce,j.__webglTexture,i.TEXTURE0+pe);const ot=n.get(Pe);if(Pe.version!==ot.__version||Ue===!0){t.activeTexture(i.TEXTURE0+pe);const Ze=gn.getPrimaries(gn.workingColorSpace),ct=O.colorSpace===ya?null:gn.getPrimaries(O.colorSpace),zt=O.colorSpace===ya||Ze===ct?i.NONE:i.BROWSER_DEFAULT_WEBGL;i.pixelStorei(i.UNPACK_FLIP_Y_WEBGL,O.flipY),i.pixelStorei(i.UNPACK_PREMULTIPLY_ALPHA_WEBGL,O.premultiplyAlpha),i.pixelStorei(i.UNPACK_ALIGNMENT,O.unpackAlignment),i.pixelStorei(i.UNPACK_COLORSPACE_CONVERSION_WEBGL,zt);let ze=C(O.image,!1,r.maxTextureSize);ze=wt(O,ze);const gt=s.convert(O.format,O.colorSpace),Pt=s.convert(O.type);let Dt=R(O.internalFormat,gt,Pt,O.colorSpace,O.isVideoTexture);ne(Ce,O);let ht;const ee=O.mipmaps,Re=O.isVideoTexture!==!0,nt=ot.__version===void 0||Ue===!0,$=Pe.dataReady,Ve=U(O,ze);if(O.isDepthTexture)Dt=P(O.format===Qu,O.type),nt&&(Re?t.texStorage2D(i.TEXTURE_2D,1,Dt,ze.width,ze.height):t.texImage2D(i.TEXTURE_2D,0,Dt,ze.width,ze.height,0,gt,Pt,null));else if(O.isDataTexture)if(ee.length>0){Re&&nt&&t.texStorage2D(i.TEXTURE_2D,Ve,Dt,ee[0].width,ee[0].height);for(let Me=0,Be=ee.length;Me<Be;Me++)ht=ee[Me],Re?$&&t.texSubImage2D(i.TEXTURE_2D,Me,0,0,ht.width,ht.height,gt,Pt,ht.data):t.texImage2D(i.TEXTURE_2D,Me,Dt,ht.width,ht.height,0,gt,Pt,ht.data);O.generateMipmaps=!1}else Re?(nt&&t.texStorage2D(i.TEXTURE_2D,Ve,Dt,ze.width,ze.height),$&&t.texSubImage2D(i.TEXTURE_2D,0,0,0,ze.width,ze.height,gt,Pt,ze.data)):t.texImage2D(i.TEXTURE_2D,0,Dt,ze.width,ze.height,0,gt,Pt,ze.data);else if(O.isCompressedTexture)if(O.isCompressedArrayTexture){Re&&nt&&t.texStorage3D(i.TEXTURE_2D_ARRAY,Ve,Dt,ee[0].width,ee[0].height,ze.depth);for(let Me=0,Be=ee.length;Me<Be;Me++)if(ht=ee[Me],O.format!==rr)if(gt!==null)if(Re){if($)if(O.layerUpdates.size>0){const ut=__(ht.width,ht.height,O.format,O.type);for(const it of O.layerUpdates){const It=ht.data.subarray(it*ut/ht.data.BYTES_PER_ELEMENT,(it+1)*ut/ht.data.BYTES_PER_ELEMENT);t.compressedTexSubImage3D(i.TEXTURE_2D_ARRAY,Me,0,0,it,ht.width,ht.height,1,gt,It)}O.clearLayerUpdates()}else t.compressedTexSubImage3D(i.TEXTURE_2D_ARRAY,Me,0,0,0,ht.width,ht.height,ze.depth,gt,ht.data)}else t.compressedTexImage3D(i.TEXTURE_2D_ARRAY,Me,Dt,ht.width,ht.height,ze.depth,0,ht.data,0,0);else console.warn("THREE.WebGLRenderer: Attempt to load unsupported compressed texture format in .uploadTexture()");else Re?$&&t.texSubImage3D(i.TEXTURE_2D_ARRAY,Me,0,0,0,ht.width,ht.height,ze.depth,gt,Pt,ht.data):t.texImage3D(i.TEXTURE_2D_ARRAY,Me,Dt,ht.width,ht.height,ze.depth,0,gt,Pt,ht.data)}else{Re&&nt&&t.texStorage2D(i.TEXTURE_2D,Ve,Dt,ee[0].width,ee[0].height);for(let Me=0,Be=ee.length;Me<Be;Me++)ht=ee[Me],O.format!==rr?gt!==null?Re?$&&t.compressedTexSubImage2D(i.TEXTURE_2D,Me,0,0,ht.width,ht.height,gt,ht.data):t.compressedTexImage2D(i.TEXTURE_2D,Me,Dt,ht.width,ht.height,0,ht.data):console.warn("THREE.WebGLRenderer: Attempt to load unsupported compressed texture format in .uploadTexture()"):Re?$&&t.texSubImage2D(i.TEXTURE_2D,Me,0,0,ht.width,ht.height,gt,Pt,ht.data):t.texImage2D(i.TEXTURE_2D,Me,Dt,ht.width,ht.height,0,gt,Pt,ht.data)}else if(O.isDataArrayTexture)if(Re){if(nt&&t.texStorage3D(i.TEXTURE_2D_ARRAY,Ve,Dt,ze.width,ze.height,ze.depth),$)if(O.layerUpdates.size>0){const Me=__(ze.width,ze.height,O.format,O.type);for(const Be of O.layerUpdates){const ut=ze.data.subarray(Be*Me/ze.data.BYTES_PER_ELEMENT,(Be+1)*Me/ze.data.BYTES_PER_ELEMENT);t.texSubImage3D(i.TEXTURE_2D_ARRAY,0,0,0,Be,ze.width,ze.height,1,gt,Pt,ut)}O.clearLayerUpdates()}else t.texSubImage3D(i.TEXTURE_2D_ARRAY,0,0,0,0,ze.width,ze.height,ze.depth,gt,Pt,ze.data)}else t.texImage3D(i.TEXTURE_2D_ARRAY,0,Dt,ze.width,ze.height,ze.depth,0,gt,Pt,ze.data);else if(O.isData3DTexture)Re?(nt&&t.texStorage3D(i.TEXTURE_3D,Ve,Dt,ze.width,ze.height,ze.depth),$&&t.texSubImage3D(i.TEXTURE_3D,0,0,0,0,ze.width,ze.height,ze.depth,gt,Pt,ze.data)):t.texImage3D(i.TEXTURE_3D,0,Dt,ze.width,ze.height,ze.depth,0,gt,Pt,ze.data);else if(O.isFramebufferTexture){if(nt)if(Re)t.texStorage2D(i.TEXTURE_2D,Ve,Dt,ze.width,ze.height);else{let Me=ze.width,Be=ze.height;for(let ut=0;ut<Ve;ut++)t.texImage2D(i.TEXTURE_2D,ut,Dt,Me,Be,0,gt,Pt,null),Me>>=1,Be>>=1}}else if(ee.length>0){if(Re&&nt){const Me=qe(ee[0]);t.texStorage2D(i.TEXTURE_2D,Ve,Dt,Me.width,Me.height)}for(let Me=0,Be=ee.length;Me<Be;Me++)ht=ee[Me],Re?$&&t.texSubImage2D(i.TEXTURE_2D,Me,0,0,gt,Pt,ht):t.texImage2D(i.TEXTURE_2D,Me,Dt,gt,Pt,ht);O.generateMipmaps=!1}else if(Re){if(nt){const Me=qe(ze);t.texStorage2D(i.TEXTURE_2D,Ve,Dt,Me.width,Me.height)}$&&t.texSubImage2D(i.TEXTURE_2D,0,0,0,gt,Pt,ze)}else t.texImage2D(i.TEXTURE_2D,0,Dt,gt,Pt,ze);M(O)&&S(Ce),ot.__version=Pe.version,O.onUpdate&&O.onUpdate(O)}j.__version=O.version}function we(j,O,pe){if(O.image.length!==6)return;const Ce=Fe(j,O),Ue=O.source;t.bindTexture(i.TEXTURE_CUBE_MAP,j.__webglTexture,i.TEXTURE0+pe);const Pe=n.get(Ue);if(Ue.version!==Pe.__version||Ce===!0){t.activeTexture(i.TEXTURE0+pe);const ot=gn.getPrimaries(gn.workingColorSpace),Ze=O.colorSpace===ya?null:gn.getPrimaries(O.colorSpace),ct=O.colorSpace===ya||ot===Ze?i.NONE:i.BROWSER_DEFAULT_WEBGL;i.pixelStorei(i.UNPACK_FLIP_Y_WEBGL,O.flipY),i.pixelStorei(i.UNPACK_PREMULTIPLY_ALPHA_WEBGL,O.premultiplyAlpha),i.pixelStorei(i.UNPACK_ALIGNMENT,O.unpackAlignment),i.pixelStorei(i.UNPACK_COLORSPACE_CONVERSION_WEBGL,ct);const zt=O.isCompressedTexture||O.image[0].isCompressedTexture,ze=O.image[0]&&O.image[0].isDataTexture,gt=[];for(let Be=0;Be<6;Be++)!zt&&!ze?gt[Be]=C(O.image[Be],!0,r.maxCubemapSize):gt[Be]=ze?O.image[Be].image:O.image[Be],gt[Be]=wt(O,gt[Be]);const Pt=gt[0],Dt=s.convert(O.format,O.colorSpace),ht=s.convert(O.type),ee=R(O.internalFormat,Dt,ht,O.colorSpace),Re=O.isVideoTexture!==!0,nt=Pe.__version===void 0||Ce===!0,$=Ue.dataReady;let Ve=U(O,Pt);ne(i.TEXTURE_CUBE_MAP,O);let Me;if(zt){Re&&nt&&t.texStorage2D(i.TEXTURE_CUBE_MAP,Ve,ee,Pt.width,Pt.height);for(let Be=0;Be<6;Be++){Me=gt[Be].mipmaps;for(let ut=0;ut<Me.length;ut++){const it=Me[ut];O.format!==rr?Dt!==null?Re?$&&t.compressedTexSubImage2D(i.TEXTURE_CUBE_MAP_POSITIVE_X+Be,ut,0,0,it.width,it.height,Dt,it.data):t.compressedTexImage2D(i.TEXTURE_CUBE_MAP_POSITIVE_X+Be,ut,ee,it.width,it.height,0,it.data):console.warn("THREE.WebGLRenderer: Attempt to load unsupported compressed texture format in .setTextureCube()"):Re?$&&t.texSubImage2D(i.TEXTURE_CUBE_MAP_POSITIVE_X+Be,ut,0,0,it.width,it.height,Dt,ht,it.data):t.texImage2D(i.TEXTURE_CUBE_MAP_POSITIVE_X+Be,ut,ee,it.width,it.height,0,Dt,ht,it.data)}}}else{if(Me=O.mipmaps,Re&&nt){Me.length>0&&Ve++;const Be=qe(gt[0]);t.texStorage2D(i.TEXTURE_CUBE_MAP,Ve,ee,Be.width,Be.height)}for(let Be=0;Be<6;Be++)if(ze){Re?$&&t.texSubImage2D(i.TEXTURE_CUBE_MAP_POSITIVE_X+Be,0,0,0,gt[Be].width,gt[Be].height,Dt,ht,gt[Be].data):t.texImage2D(i.TEXTURE_CUBE_MAP_POSITIVE_X+Be,0,ee,gt[Be].width,gt[Be].height,0,Dt,ht,gt[Be].data);for(let ut=0;ut<Me.length;ut++){const It=Me[ut].image[Be].image;Re?$&&t.texSubImage2D(i.TEXTURE_CUBE_MAP_POSITIVE_X+Be,ut+1,0,0,It.width,It.height,Dt,ht,It.data):t.texImage2D(i.TEXTURE_CUBE_MAP_POSITIVE_X+Be,ut+1,ee,It.width,It.height,0,Dt,ht,It.data)}}else{Re?$&&t.texSubImage2D(i.TEXTURE_CUBE_MAP_POSITIVE_X+Be,0,0,0,Dt,ht,gt[Be]):t.texImage2D(i.TEXTURE_CUBE_MAP_POSITIVE_X+Be,0,ee,Dt,ht,gt[Be]);for(let ut=0;ut<Me.length;ut++){const it=Me[ut];Re?$&&t.texSubImage2D(i.TEXTURE_CUBE_MAP_POSITIVE_X+Be,ut+1,0,0,Dt,ht,it.image[Be]):t.texImage2D(i.TEXTURE_CUBE_MAP_POSITIVE_X+Be,ut+1,ee,Dt,ht,it.image[Be])}}}M(O)&&S(i.TEXTURE_CUBE_MAP),Pe.__version=Ue.version,O.onUpdate&&O.onUpdate(O)}j.__version=O.version}function De(j,O,pe,Ce,Ue,Pe){const ot=s.convert(pe.format,pe.colorSpace),Ze=s.convert(pe.type),ct=R(pe.internalFormat,ot,Ze,pe.colorSpace),zt=n.get(O),ze=n.get(pe);if(ze.__renderTarget=O,!zt.__hasExternalTextures){const gt=Math.max(1,O.width>>Pe),Pt=Math.max(1,O.height>>Pe);Ue===i.TEXTURE_3D||Ue===i.TEXTURE_2D_ARRAY?t.texImage3D(Ue,Pe,ct,gt,Pt,O.depth,0,ot,Ze,null):t.texImage2D(Ue,Pe,ct,gt,Pt,0,ot,Ze,null)}t.bindFramebuffer(i.FRAMEBUFFER,j),et(O)?u.framebufferTexture2DMultisampleEXT(i.FRAMEBUFFER,Ce,Ue,ze.__webglTexture,0,ke(O)):(Ue===i.TEXTURE_2D||Ue>=i.TEXTURE_CUBE_MAP_POSITIVE_X&&Ue<=i.TEXTURE_CUBE_MAP_NEGATIVE_Z)&&i.framebufferTexture2D(i.FRAMEBUFFER,Ce,Ue,ze.__webglTexture,Pe),t.bindFramebuffer(i.FRAMEBUFFER,null)}function Ie(j,O,pe){if(i.bindRenderbuffer(i.RENDERBUFFER,j),O.depthBuffer){const Ce=O.depthTexture,Ue=Ce&&Ce.isDepthTexture?Ce.type:null,Pe=P(O.stencilBuffer,Ue),ot=O.stencilBuffer?i.DEPTH_STENCIL_ATTACHMENT:i.DEPTH_ATTACHMENT,Ze=ke(O);et(O)?u.renderbufferStorageMultisampleEXT(i.RENDERBUFFER,Ze,Pe,O.width,O.height):pe?i.renderbufferStorageMultisample(i.RENDERBUFFER,Ze,Pe,O.width,O.height):i.renderbufferStorage(i.RENDERBUFFER,Pe,O.width,O.height),i.framebufferRenderbuffer(i.FRAMEBUFFER,ot,i.RENDERBUFFER,j)}else{const Ce=O.textures;for(let Ue=0;Ue<Ce.length;Ue++){const Pe=Ce[Ue],ot=s.convert(Pe.format,Pe.colorSpace),Ze=s.convert(Pe.type),ct=R(Pe.internalFormat,ot,Ze,Pe.colorSpace),zt=ke(O);pe&&et(O)===!1?i.renderbufferStorageMultisample(i.RENDERBUFFER,zt,ct,O.width,O.height):et(O)?u.renderbufferStorageMultisampleEXT(i.RENDERBUFFER,zt,ct,O.width,O.height):i.renderbufferStorage(i.RENDERBUFFER,ct,O.width,O.height)}}i.bindRenderbuffer(i.RENDERBUFFER,null)}function Xe(j,O){if(O&&O.isWebGLCubeRenderTarget)throw new Error("Depth Texture with cube render targets is not supported");if(t.bindFramebuffer(i.FRAMEBUFFER,j),!(O.depthTexture&&O.depthTexture.isDepthTexture))throw new Error("renderTarget.depthTexture must be an instance of THREE.DepthTexture");const Ce=n.get(O.depthTexture);Ce.__renderTarget=O,(!Ce.__webglTexture||O.depthTexture.image.width!==O.width||O.depthTexture.image.height!==O.height)&&(O.depthTexture.image.width=O.width,O.depthTexture.image.height=O.height,O.depthTexture.needsUpdate=!0),ye(O.depthTexture,0);const Ue=Ce.__webglTexture,Pe=ke(O);if(O.depthTexture.format===Wu)et(O)?u.framebufferTexture2DMultisampleEXT(i.FRAMEBUFFER,i.DEPTH_ATTACHMENT,i.TEXTURE_2D,Ue,0,Pe):i.framebufferTexture2D(i.FRAMEBUFFER,i.DEPTH_ATTACHMENT,i.TEXTURE_2D,Ue,0);else if(O.depthTexture.format===Qu)et(O)?u.framebufferTexture2DMultisampleEXT(i.FRAMEBUFFER,i.DEPTH_STENCIL_ATTACHMENT,i.TEXTURE_2D,Ue,0,Pe):i.framebufferTexture2D(i.FRAMEBUFFER,i.DEPTH_STENCIL_ATTACHMENT,i.TEXTURE_2D,Ue,0);else throw new Error("Unknown depthTexture format")}function _t(j){const O=n.get(j),pe=j.isWebGLCubeRenderTarget===!0;if(O.__boundDepthTexture!==j.depthTexture){const Ce=j.depthTexture;if(O.__depthDisposeCallback&&O.__depthDisposeCallback(),Ce){const Ue=()=>{delete O.__boundDepthTexture,delete O.__depthDisposeCallback,Ce.removeEventListener("dispose",Ue)};Ce.addEventListener("dispose",Ue),O.__depthDisposeCallback=Ue}O.__boundDepthTexture=Ce}if(j.depthTexture&&!O.__autoAllocateDepthBuffer){if(pe)throw new Error("target.depthTexture not supported in Cube render targets");Xe(O.__webglFramebuffer,j)}else if(pe){O.__webglDepthbuffer=[];for(let Ce=0;Ce<6;Ce++)if(t.bindFramebuffer(i.FRAMEBUFFER,O.__webglFramebuffer[Ce]),O.__webglDepthbuffer[Ce]===void 0)O.__webglDepthbuffer[Ce]=i.createRenderbuffer(),Ie(O.__webglDepthbuffer[Ce],j,!1);else{const Ue=j.stencilBuffer?i.DEPTH_STENCIL_ATTACHMENT:i.DEPTH_ATTACHMENT,Pe=O.__webglDepthbuffer[Ce];i.bindRenderbuffer(i.RENDERBUFFER,Pe),i.framebufferRenderbuffer(i.FRAMEBUFFER,Ue,i.RENDERBUFFER,Pe)}}else if(t.bindFramebuffer(i.FRAMEBUFFER,O.__webglFramebuffer),O.__webglDepthbuffer===void 0)O.__webglDepthbuffer=i.createRenderbuffer(),Ie(O.__webglDepthbuffer,j,!1);else{const Ce=j.stencilBuffer?i.DEPTH_STENCIL_ATTACHMENT:i.DEPTH_ATTACHMENT,Ue=O.__webglDepthbuffer;i.bindRenderbuffer(i.RENDERBUFFER,Ue),i.framebufferRenderbuffer(i.FRAMEBUFFER,Ce,i.RENDERBUFFER,Ue)}t.bindFramebuffer(i.FRAMEBUFFER,null)}function Je(j,O,pe){const Ce=n.get(j);O!==void 0&&De(Ce.__webglFramebuffer,j,j.texture,i.COLOR_ATTACHMENT0,i.TEXTURE_2D,0),pe!==void 0&&_t(j)}function st(j){const O=j.texture,pe=n.get(j),Ce=n.get(O);j.addEventListener("dispose",k);const Ue=j.textures,Pe=j.isWebGLCubeRenderTarget===!0,ot=Ue.length>1;if(ot||(Ce.__webglTexture===void 0&&(Ce.__webglTexture=i.createTexture()),Ce.__version=O.version,a.memory.textures++),Pe){pe.__webglFramebuffer=[];for(let Ze=0;Ze<6;Ze++)if(O.mipmaps&&O.mipmaps.length>0){pe.__webglFramebuffer[Ze]=[];for(let ct=0;ct<O.mipmaps.length;ct++)pe.__webglFramebuffer[Ze][ct]=i.createFramebuffer()}else pe.__webglFramebuffer[Ze]=i.createFramebuffer()}else{if(O.mipmaps&&O.mipmaps.length>0){pe.__webglFramebuffer=[];for(let Ze=0;Ze<O.mipmaps.length;Ze++)pe.__webglFramebuffer[Ze]=i.createFramebuffer()}else pe.__webglFramebuffer=i.createFramebuffer();if(ot)for(let Ze=0,ct=Ue.length;Ze<ct;Ze++){const zt=n.get(Ue[Ze]);zt.__webglTexture===void 0&&(zt.__webglTexture=i.createTexture(),a.memory.textures++)}if(j.samples>0&&et(j)===!1){pe.__webglMultisampledFramebuffer=i.createFramebuffer(),pe.__webglColorRenderbuffer=[],t.bindFramebuffer(i.FRAMEBUFFER,pe.__webglMultisampledFramebuffer);for(let Ze=0;Ze<Ue.length;Ze++){const ct=Ue[Ze];pe.__webglColorRenderbuffer[Ze]=i.createRenderbuffer(),i.bindRenderbuffer(i.RENDERBUFFER,pe.__webglColorRenderbuffer[Ze]);const zt=s.convert(ct.format,ct.colorSpace),ze=s.convert(ct.type),gt=R(ct.internalFormat,zt,ze,ct.colorSpace,j.isXRRenderTarget===!0),Pt=ke(j);i.renderbufferStorageMultisample(i.RENDERBUFFER,Pt,gt,j.width,j.height),i.framebufferRenderbuffer(i.FRAMEBUFFER,i.COLOR_ATTACHMENT0+Ze,i.RENDERBUFFER,pe.__webglColorRenderbuffer[Ze])}i.bindRenderbuffer(i.RENDERBUFFER,null),j.depthBuffer&&(pe.__webglDepthRenderbuffer=i.createRenderbuffer(),Ie(pe.__webglDepthRenderbuffer,j,!0)),t.bindFramebuffer(i.FRAMEBUFFER,null)}}if(Pe){t.bindTexture(i.TEXTURE_CUBE_MAP,Ce.__webglTexture),ne(i.TEXTURE_CUBE_MAP,O);for(let Ze=0;Ze<6;Ze++)if(O.mipmaps&&O.mipmaps.length>0)for(let ct=0;ct<O.mipmaps.length;ct++)De(pe.__webglFramebuffer[Ze][ct],j,O,i.COLOR_ATTACHMENT0,i.TEXTURE_CUBE_MAP_POSITIVE_X+Ze,ct);else De(pe.__webglFramebuffer[Ze],j,O,i.COLOR_ATTACHMENT0,i.TEXTURE_CUBE_MAP_POSITIVE_X+Ze,0);M(O)&&S(i.TEXTURE_CUBE_MAP),t.unbindTexture()}else if(ot){for(let Ze=0,ct=Ue.length;Ze<ct;Ze++){const zt=Ue[Ze],ze=n.get(zt);t.bindTexture(i.TEXTURE_2D,ze.__webglTexture),ne(i.TEXTURE_2D,zt),De(pe.__webglFramebuffer,j,zt,i.COLOR_ATTACHMENT0+Ze,i.TEXTURE_2D,0),M(zt)&&S(i.TEXTURE_2D)}t.unbindTexture()}else{let Ze=i.TEXTURE_2D;if((j.isWebGL3DRenderTarget||j.isWebGLArrayRenderTarget)&&(Ze=j.isWebGL3DRenderTarget?i.TEXTURE_3D:i.TEXTURE_2D_ARRAY),t.bindTexture(Ze,Ce.__webglTexture),ne(Ze,O),O.mipmaps&&O.mipmaps.length>0)for(let ct=0;ct<O.mipmaps.length;ct++)De(pe.__webglFramebuffer[ct],j,O,i.COLOR_ATTACHMENT0,Ze,ct);else De(pe.__webglFramebuffer,j,O,i.COLOR_ATTACHMENT0,Ze,0);M(O)&&S(Ze),t.unbindTexture()}j.depthBuffer&&_t(j)}function Ne(j){const O=j.textures;for(let pe=0,Ce=O.length;pe<Ce;pe++){const Ue=O[pe];if(M(Ue)){const Pe=b(j),ot=n.get(Ue).__webglTexture;t.bindTexture(Pe,ot),S(Pe),t.unbindTexture()}}}const be=[],J=[];function mt(j){if(j.samples>0){if(et(j)===!1){const O=j.textures,pe=j.width,Ce=j.height;let Ue=i.COLOR_BUFFER_BIT;const Pe=j.stencilBuffer?i.DEPTH_STENCIL_ATTACHMENT:i.DEPTH_ATTACHMENT,ot=n.get(j),Ze=O.length>1;if(Ze)for(let ct=0;ct<O.length;ct++)t.bindFramebuffer(i.FRAMEBUFFER,ot.__webglMultisampledFramebuffer),i.framebufferRenderbuffer(i.FRAMEBUFFER,i.COLOR_ATTACHMENT0+ct,i.RENDERBUFFER,null),t.bindFramebuffer(i.FRAMEBUFFER,ot.__webglFramebuffer),i.framebufferTexture2D(i.DRAW_FRAMEBUFFER,i.COLOR_ATTACHMENT0+ct,i.TEXTURE_2D,null,0);t.bindFramebuffer(i.READ_FRAMEBUFFER,ot.__webglMultisampledFramebuffer),t.bindFramebuffer(i.DRAW_FRAMEBUFFER,ot.__webglFramebuffer);for(let ct=0;ct<O.length;ct++){if(j.resolveDepthBuffer&&(j.depthBuffer&&(Ue|=i.DEPTH_BUFFER_BIT),j.stencilBuffer&&j.resolveStencilBuffer&&(Ue|=i.STENCIL_BUFFER_BIT)),Ze){i.framebufferRenderbuffer(i.READ_FRAMEBUFFER,i.COLOR_ATTACHMENT0,i.RENDERBUFFER,ot.__webglColorRenderbuffer[ct]);const zt=n.get(O[ct]).__webglTexture;i.framebufferTexture2D(i.DRAW_FRAMEBUFFER,i.COLOR_ATTACHMENT0,i.TEXTURE_2D,zt,0)}i.blitFramebuffer(0,0,pe,Ce,0,0,pe,Ce,Ue,i.NEAREST),d===!0&&(be.length=0,J.length=0,be.push(i.COLOR_ATTACHMENT0+ct),j.depthBuffer&&j.resolveDepthBuffer===!1&&(be.push(Pe),J.push(Pe),i.invalidateFramebuffer(i.DRAW_FRAMEBUFFER,J)),i.invalidateFramebuffer(i.READ_FRAMEBUFFER,be))}if(t.bindFramebuffer(i.READ_FRAMEBUFFER,null),t.bindFramebuffer(i.DRAW_FRAMEBUFFER,null),Ze)for(let ct=0;ct<O.length;ct++){t.bindFramebuffer(i.FRAMEBUFFER,ot.__webglMultisampledFramebuffer),i.framebufferRenderbuffer(i.FRAMEBUFFER,i.COLOR_ATTACHMENT0+ct,i.RENDERBUFFER,ot.__webglColorRenderbuffer[ct]);const zt=n.get(O[ct]).__webglTexture;t.bindFramebuffer(i.FRAMEBUFFER,ot.__webglFramebuffer),i.framebufferTexture2D(i.DRAW_FRAMEBUFFER,i.COLOR_ATTACHMENT0+ct,i.TEXTURE_2D,zt,0)}t.bindFramebuffer(i.DRAW_FRAMEBUFFER,ot.__webglMultisampledFramebuffer)}else if(j.depthBuffer&&j.resolveDepthBuffer===!1&&d){const O=j.stencilBuffer?i.DEPTH_STENCIL_ATTACHMENT:i.DEPTH_ATTACHMENT;i.invalidateFramebuffer(i.DRAW_FRAMEBUFFER,[O])}}}function ke(j){return Math.min(r.maxSamples,j.samples)}function et(j){const O=n.get(j);return j.samples>0&&e.has("WEBGL_multisampled_render_to_texture")===!0&&O.__useRenderToTexture!==!1}function je(j){const O=a.render.frame;m.get(j)!==O&&(m.set(j,O),j.update())}function wt(j,O){const pe=j.colorSpace,Ce=j.format,Ue=j.type;return j.isCompressedTexture===!0||j.isVideoTexture===!0||pe!==qu&&pe!==ya&&(gn.getTransfer(pe)===wn?(Ce!==rr||Ue!==to)&&console.warn("THREE.WebGLTextures: sRGB encoded textures have to use RGBAFormat and UnsignedByteType."):console.error("THREE.WebGLTextures: Unsupported texture color space:",pe)),O}function qe(j){return typeof HTMLImageElement<"u"&&j instanceof HTMLImageElement?(h.width=j.naturalWidth||j.width,h.height=j.naturalHeight||j.height):typeof VideoFrame<"u"&&j instanceof VideoFrame?(h.width=j.displayWidth,h.height=j.displayHeight):(h.width=j.width,h.height=j.height),h}this.allocateTextureUnit=ie,this.resetTextureUnits=oe,this.setTexture2D=ye,this.setTexture2DArray=he,this.setTexture3D=_e,this.setTextureCube=H,this.rebindTextures=Je,this.setupRenderTarget=st,this.updateRenderTargetMipmap=Ne,this.updateMultisampleRenderTarget=mt,this.setupDepthRenderbuffer=_t,this.setupFrameBufferTexture=De,this.useMultisampledRTT=et}function LE(i,e){function t(n,r=ya){let s;const a=gn.getTransfer(r);if(n===to)return i.UNSIGNED_BYTE;if(n===T0)return i.UNSIGNED_SHORT_4_4_4_4;if(n===b0)return i.UNSIGNED_SHORT_5_5_5_1;if(n===V_)return i.UNSIGNED_INT_5_9_9_9_REV;if(n===z_)return i.BYTE;if(n===G_)return i.SHORT;if(n===Jf)return i.UNSIGNED_SHORT;if(n===C0)return i.INT;if(n===ba)return i.UNSIGNED_INT;if(n===Or)return i.FLOAT;if(n===sd)return i.HALF_FLOAT;if(n===W_)return i.ALPHA;if(n===X_)return i.RGB;if(n===rr)return i.RGBA;if(n===j_)return i.LUMINANCE;if(n===J_)return i.LUMINANCE_ALPHA;if(n===Wu)return i.DEPTH_COMPONENT;if(n===Qu)return i.DEPTH_STENCIL;if(n===R0)return i.RED;if(n===sp)return i.RED_INTEGER;if(n===K_)return i.RG;if(n===I0)return i.RG_INTEGER;if(n===P0)return i.RGBA_INTEGER;if(n===bh||n===Rh||n===Ih||n===Ph)if(a===wn)if(s=e.get("WEBGL_compressed_texture_s3tc_srgb"),s!==null){if(n===bh)return s.COMPRESSED_SRGB_S3TC_DXT1_EXT;if(n===Rh)return s.COMPRESSED_SRGB_ALPHA_S3TC_DXT1_EXT;if(n===Ih)return s.COMPRESSED_SRGB_ALPHA_S3TC_DXT3_EXT;if(n===Ph)return s.COMPRESSED_SRGB_ALPHA_S3TC_DXT5_EXT}else return null;else if(s=e.get("WEBGL_compressed_texture_s3tc"),s!==null){if(n===bh)return s.COMPRESSED_RGB_S3TC_DXT1_EXT;if(n===Rh)return s.COMPRESSED_RGBA_S3TC_DXT1_EXT;if(n===Ih)return s.COMPRESSED_RGBA_S3TC_DXT3_EXT;if(n===Ph)return s.COMPRESSED_RGBA_S3TC_DXT5_EXT}else return null;if(n===Fg||n===Ng||n===Ug||n===Og)if(s=e.get("WEBGL_compressed_texture_pvrtc"),s!==null){if(n===Fg)return s.COMPRESSED_RGB_PVRTC_4BPPV1_IMG;if(n===Ng)return s.COMPRESSED_RGB_PVRTC_2BPPV1_IMG;if(n===Ug)return s.COMPRESSED_RGBA_PVRTC_4BPPV1_IMG;if(n===Og)return s.COMPRESSED_RGBA_PVRTC_2BPPV1_IMG}else return null;if(n===kg||n===Hg||n===zg)if(s=e.get("WEBGL_compressed_texture_etc"),s!==null){if(n===kg||n===Hg)return a===wn?s.COMPRESSED_SRGB8_ETC2:s.COMPRESSED_RGB8_ETC2;if(n===zg)return a===wn?s.COMPRESSED_SRGB8_ALPHA8_ETC2_EAC:s.COMPRESSED_RGBA8_ETC2_EAC}else return null;if(n===Gg||n===Vg||n===Wg||n===Xg||n===jg||n===Jg||n===Kg||n===Yg||n===Qg||n===qg||n===Zg||n===$g||n===e0||n===t0)if(s=e.get("WEBGL_compressed_texture_astc"),s!==null){if(n===Gg)return a===wn?s.COMPRESSED_SRGB8_ALPHA8_ASTC_4x4_KHR:s.COMPRESSED_RGBA_ASTC_4x4_KHR;if(n===Vg)return a===wn?s.COMPRESSED_SRGB8_ALPHA8_ASTC_5x4_KHR:s.COMPRESSED_RGBA_ASTC_5x4_KHR;if(n===Wg)return a===wn?s.COMPRESSED_SRGB8_ALPHA8_ASTC_5x5_KHR:s.COMPRESSED_RGBA_ASTC_5x5_KHR;if(n===Xg)return a===wn?s.COMPRESSED_SRGB8_ALPHA8_ASTC_6x5_KHR:s.COMPRESSED_RGBA_ASTC_6x5_KHR;if(n===jg)return a===wn?s.COMPRESSED_SRGB8_ALPHA8_ASTC_6x6_KHR:s.COMPRESSED_RGBA_ASTC_6x6_KHR;if(n===Jg)return a===wn?s.COMPRESSED_SRGB8_ALPHA8_ASTC_8x5_KHR:s.COMPRESSED_RGBA_ASTC_8x5_KHR;if(n===Kg)return a===wn?s.COMPRESSED_SRGB8_ALPHA8_ASTC_8x6_KHR:s.COMPRESSED_RGBA_ASTC_8x6_KHR;if(n===Yg)return a===wn?s.COMPRESSED_SRGB8_ALPHA8_ASTC_8x8_KHR:s.COMPRESSED_RGBA_ASTC_8x8_KHR;if(n===Qg)return a===wn?s.COMPRESSED_SRGB8_ALPHA8_ASTC_10x5_KHR:s.COMPRESSED_RGBA_ASTC_10x5_KHR;if(n===qg)return a===wn?s.COMPRESSED_SRGB8_ALPHA8_ASTC_10x6_KHR:s.COMPRESSED_RGBA_ASTC_10x6_KHR;if(n===Zg)return a===wn?s.COMPRESSED_SRGB8_ALPHA8_ASTC_10x8_KHR:s.COMPRESSED_RGBA_ASTC_10x8_KHR;if(n===$g)return a===wn?s.COMPRESSED_SRGB8_ALPHA8_ASTC_10x10_KHR:s.COMPRESSED_RGBA_ASTC_10x10_KHR;if(n===e0)return a===wn?s.COMPRESSED_SRGB8_ALPHA8_ASTC_12x10_KHR:s.COMPRESSED_RGBA_ASTC_12x10_KHR;if(n===t0)return a===wn?s.COMPRESSED_SRGB8_ALPHA8_ASTC_12x12_KHR:s.COMPRESSED_RGBA_ASTC_12x12_KHR}else return null;if(n===Bh||n===n0||n===i0)if(s=e.get("EXT_texture_compression_bptc"),s!==null){if(n===Bh)return a===wn?s.COMPRESSED_SRGB_ALPHA_BPTC_UNORM_EXT:s.COMPRESSED_RGBA_BPTC_UNORM_EXT;if(n===n0)return s.COMPRESSED_RGB_BPTC_SIGNED_FLOAT_EXT;if(n===i0)return s.COMPRESSED_RGB_BPTC_UNSIGNED_FLOAT_EXT}else return null;if(n===Y_||n===r0||n===s0||n===o0)if(s=e.get("EXT_texture_compression_rgtc"),s!==null){if(n===Bh)return s.COMPRESSED_RED_RGTC1_EXT;if(n===r0)return s.COMPRESSED_SIGNED_RED_RGTC1_EXT;if(n===s0)return s.COMPRESSED_RED_GREEN_RGTC2_EXT;if(n===o0)return s.COMPRESSED_SIGNED_RED_GREEN_RGTC2_EXT}else return null;return n===Yu?i.UNSIGNED_INT_24_8:i[n]!==void 0?i[n]:null}return{convert:t}}const GD=`
void main() {

	gl_Position = vec4( position, 1.0 );

}`,VD=`
uniform sampler2DArray depthColor;
uniform float depthWidth;
uniform float depthHeight;

void main() {

	vec2 coord = vec2( gl_FragCoord.x / depthWidth, gl_FragCoord.y / depthHeight );

	if ( coord.x >= 1.0 ) {

		gl_FragDepth = texture( depthColor, vec3( coord.x - 1.0, coord.y, 1 ) ).r;

	} else {

		gl_FragDepth = texture( depthColor, vec3( coord.x, coord.y, 0 ) ).r;

	}

}`;class WD{constructor(){this.texture=null,this.mesh=null,this.depthNear=0,this.depthFar=0}init(e,t,n){if(this.texture===null){const r=new zn,s=e.properties.get(r);s.__webglTexture=t.texture,(t.depthNear!==n.depthNear||t.depthFar!==n.depthFar)&&(this.depthNear=t.depthNear,this.depthFar=t.depthFar),this.texture=r}}getMesh(e){if(this.texture!==null&&this.mesh===null){const t=e.cameras[0].viewport,n=new no({vertexShader:GD,fragmentShader:VD,uniforms:{depthColor:{value:this.texture},depthWidth:{value:t.z},depthHeight:{value:t.w}}});this.mesh=new si(new ad(20,20),n)}return this.mesh}reset(){this.texture=null,this.mesh=null}getDepthTexture(){return this.texture}}class XD extends Io{constructor(e,t){super();const n=this;let r=null,s=1,a=null,u="local-floor",d=1,h=null,m=null,g=null,v=null,_=null,A=null;const C=new WD,M=t.getContextAttributes();let S=null,b=null;const R=[],P=[],U=new Le;let F=null;const k=new Hn;k.viewport=new _n;const G=new Hn;G.viewport=new _n;const D=[k,G],L=new xE;let V=null,oe=null;this.cameraAutoUpdate=!0,this.enabled=!1,this.isPresenting=!1,this.getController=function(ae){let we=R[ae];return we===void 0&&(we=new xg,R[ae]=we),we.getTargetRaySpace()},this.getControllerGrip=function(ae){let we=R[ae];return we===void 0&&(we=new xg,R[ae]=we),we.getGripSpace()},this.getHand=function(ae){let we=R[ae];return we===void 0&&(we=new xg,R[ae]=we),we.getHandSpace()};function ie(ae){const we=P.indexOf(ae.inputSource);if(we===-1)return;const De=R[we];De!==void 0&&(De.update(ae.inputSource,ae.frame,h||a),De.dispatchEvent({type:ae.type,data:ae.inputSource}))}function ge(){r.removeEventListener("select",ie),r.removeEventListener("selectstart",ie),r.removeEventListener("selectend",ie),r.removeEventListener("squeeze",ie),r.removeEventListener("squeezestart",ie),r.removeEventListener("squeezeend",ie),r.removeEventListener("end",ge),r.removeEventListener("inputsourceschange",ye);for(let ae=0;ae<R.length;ae++){const we=P[ae];we!==null&&(P[ae]=null,R[ae].disconnect(we))}V=null,oe=null,C.reset(),e.setRenderTarget(S),_=null,v=null,g=null,r=null,b=null,Fe.stop(),n.isPresenting=!1,e.setPixelRatio(F),e.setSize(U.width,U.height,!1),n.dispatchEvent({type:"sessionend"})}this.setFramebufferScaleFactor=function(ae){s=ae,n.isPresenting===!0&&console.warn("THREE.WebXRManager: Cannot change framebuffer scale while presenting.")},this.setReferenceSpaceType=function(ae){u=ae,n.isPresenting===!0&&console.warn("THREE.WebXRManager: Cannot change reference space type while presenting.")},this.getReferenceSpace=function(){return h||a},this.setReferenceSpace=function(ae){h=ae},this.getBaseLayer=function(){return v!==null?v:_},this.getBinding=function(){return g},this.getFrame=function(){return A},this.getSession=function(){return r},this.setSession=async function(ae){if(r=ae,r!==null){if(S=e.getRenderTarget(),r.addEventListener("select",ie),r.addEventListener("selectstart",ie),r.addEventListener("selectend",ie),r.addEventListener("squeeze",ie),r.addEventListener("squeezestart",ie),r.addEventListener("squeezeend",ie),r.addEventListener("end",ge),r.addEventListener("inputsourceschange",ye),M.xrCompatible!==!0&&await t.makeXRCompatible(),F=e.getPixelRatio(),e.getSize(U),typeof XRWebGLBinding<"u"&&"createProjectionLayer"in XRWebGLBinding.prototype){let De=null,Ie=null,Xe=null;M.depth&&(Xe=M.stencil?t.DEPTH24_STENCIL8:t.DEPTH_COMPONENT24,De=M.stencil?Qu:Wu,Ie=M.stencil?Yu:ba);const _t={colorFormat:t.RGBA8,depthFormat:Xe,scaleFactor:s};g=new XRWebGLBinding(r,t),v=g.createProjectionLayer(_t),r.updateRenderState({layers:[v]}),e.setPixelRatio(1),e.setSize(v.textureWidth,v.textureHeight,!1),b=new bo(v.textureWidth,v.textureHeight,{format:rr,type:to,depthTexture:new lx(v.textureWidth,v.textureHeight,Ie,void 0,void 0,void 0,void 0,void 0,void 0,De),stencilBuffer:M.stencil,colorSpace:e.outputColorSpace,samples:M.antialias?4:0,resolveDepthBuffer:v.ignoreDepthValues===!1})}else{const De={antialias:M.antialias,alpha:!0,depth:M.depth,stencil:M.stencil,framebufferScaleFactor:s};_=new XRWebGLLayer(r,t,De),r.updateRenderState({baseLayer:_}),e.setPixelRatio(1),e.setSize(_.framebufferWidth,_.framebufferHeight,!1),b=new bo(_.framebufferWidth,_.framebufferHeight,{format:rr,type:to,colorSpace:e.outputColorSpace,stencilBuffer:M.stencil})}b.isXRRenderTarget=!0,this.setFoveation(d),h=null,a=await r.requestReferenceSpace(u),Fe.setContext(r),Fe.start(),n.isPresenting=!0,n.dispatchEvent({type:"sessionstart"})}},this.getEnvironmentBlendMode=function(){if(r!==null)return r.environmentBlendMode},this.getDepthTexture=function(){return C.getDepthTexture()};function ye(ae){for(let we=0;we<ae.removed.length;we++){const De=ae.removed[we],Ie=P.indexOf(De);Ie>=0&&(P[Ie]=null,R[Ie].disconnect(De))}for(let we=0;we<ae.added.length;we++){const De=ae.added[we];let Ie=P.indexOf(De);if(Ie===-1){for(let _t=0;_t<R.length;_t++)if(_t>=P.length){P.push(De),Ie=_t;break}else if(P[_t]===null){P[_t]=De,Ie=_t;break}if(Ie===-1)break}const Xe=R[Ie];Xe&&Xe.connect(De)}}const he=new X,_e=new X;function H(ae,we,De){he.setFromMatrixPosition(we.matrixWorld),_e.setFromMatrixPosition(De.matrixWorld);const Ie=he.distanceTo(_e),Xe=we.projectionMatrix.elements,_t=De.projectionMatrix.elements,Je=Xe[14]/(Xe[10]-1),st=Xe[14]/(Xe[10]+1),Ne=(Xe[9]+1)/Xe[5],be=(Xe[9]-1)/Xe[5],J=(Xe[8]-1)/Xe[0],mt=(_t[8]+1)/_t[0],ke=Je*J,et=Je*mt,je=Ie/(-J+mt),wt=je*-J;if(we.matrixWorld.decompose(ae.position,ae.quaternion,ae.scale),ae.translateX(wt),ae.translateZ(je),ae.matrixWorld.compose(ae.position,ae.quaternion,ae.scale),ae.matrixWorldInverse.copy(ae.matrixWorld).invert(),Xe[10]===-1)ae.projectionMatrix.copy(we.projectionMatrix),ae.projectionMatrixInverse.copy(we.projectionMatrixInverse);else{const qe=Je+je,j=st+je,O=ke-wt,pe=et+(Ie-wt),Ce=Ne*st/j*qe,Ue=be*st/j*qe;ae.projectionMatrix.makePerspective(O,pe,Ce,Ue,qe,j),ae.projectionMatrixInverse.copy(ae.projectionMatrix).invert()}}function Z(ae,we){we===null?ae.matrixWorld.copy(ae.matrix):ae.matrixWorld.multiplyMatrices(we.matrixWorld,ae.matrix),ae.matrixWorldInverse.copy(ae.matrixWorld).invert()}this.updateCamera=function(ae){if(r===null)return;let we=ae.near,De=ae.far;C.texture!==null&&(C.depthNear>0&&(we=C.depthNear),C.depthFar>0&&(De=C.depthFar)),L.near=G.near=k.near=we,L.far=G.far=k.far=De,(V!==L.near||oe!==L.far)&&(r.updateRenderState({depthNear:L.near,depthFar:L.far}),V=L.near,oe=L.far),k.layers.mask=ae.layers.mask|2,G.layers.mask=ae.layers.mask|4,L.layers.mask=k.layers.mask|G.layers.mask;const Ie=ae.parent,Xe=L.cameras;Z(L,Ie);for(let _t=0;_t<Xe.length;_t++)Z(Xe[_t],Ie);Xe.length===2?H(L,k,G):L.projectionMatrix.copy(k.projectionMatrix),q(ae,L,Ie)};function q(ae,we,De){De===null?ae.matrix.copy(we.matrixWorld):(ae.matrix.copy(De.matrixWorld),ae.matrix.invert(),ae.matrix.multiply(we.matrixWorld)),ae.matrix.decompose(ae.position,ae.quaternion,ae.scale),ae.updateMatrixWorld(!0),ae.projectionMatrix.copy(we.projectionMatrix),ae.projectionMatrixInverse.copy(we.projectionMatrixInverse),ae.isPerspectiveCamera&&(ae.fov=Qf*2*Math.atan(1/ae.projectionMatrix.elements[5]),ae.zoom=1)}this.getCamera=function(){return L},this.getFoveation=function(){if(!(v===null&&_===null))return d},this.setFoveation=function(ae){d=ae,v!==null&&(v.fixedFoveation=ae),_!==null&&_.fixedFoveation!==void 0&&(_.fixedFoveation=ae)},this.hasDepthSensing=function(){return C.texture!==null},this.getDepthSensingMesh=function(){return C.getMesh(L)};let W=null;function ne(ae,we){if(m=we.getViewerPose(h||a),A=we,m!==null){const De=m.views;_!==null&&(e.setRenderTargetFramebuffer(b,_.framebuffer),e.setRenderTarget(b));let Ie=!1;De.length!==L.cameras.length&&(L.cameras.length=0,Ie=!0);for(let Je=0;Je<De.length;Je++){const st=De[Je];let Ne=null;if(_!==null)Ne=_.getViewport(st);else{const J=g.getViewSubImage(v,st);Ne=J.viewport,Je===0&&(e.setRenderTargetTextures(b,J.colorTexture,v.ignoreDepthValues?void 0:J.depthStencilTexture),e.setRenderTarget(b))}let be=D[Je];be===void 0&&(be=new Hn,be.layers.enable(Je),be.viewport=new _n,D[Je]=be),be.matrix.fromArray(st.transform.matrix),be.matrix.decompose(be.position,be.quaternion,be.scale),be.projectionMatrix.fromArray(st.projectionMatrix),be.projectionMatrixInverse.copy(be.projectionMatrix).invert(),be.viewport.set(Ne.x,Ne.y,Ne.width,Ne.height),Je===0&&(L.matrix.copy(be.matrix),L.matrix.decompose(L.position,L.quaternion,L.scale)),Ie===!0&&L.cameras.push(be)}const Xe=r.enabledFeatures;if(Xe&&Xe.includes("depth-sensing")&&r.depthUsage=="gpu-optimized"&&g){const Je=g.getDepthInformation(De[0]);Je&&Je.isValid&&Je.texture&&C.init(e,Je,r.renderState)}}for(let De=0;De<R.length;De++){const Ie=P[De],Xe=R[De];Ie!==null&&Xe!==void 0&&Xe.update(Ie,we,h||a)}W&&W(ae,we),we.detectedPlanes&&n.dispatchEvent({type:"planesdetected",data:we}),A=null}const Fe=new bE;Fe.setAnimationLoop(ne),this.setAnimationLoop=function(ae){W=ae},this.dispose=function(){}}}const bu=new ns,jD=new Ot;function JD(i,e){function t(M,S){M.matrixAutoUpdate===!0&&M.updateMatrix(),S.value.copy(M.matrix)}function n(M,S){S.color.getRGB(M.fogColor.value,BM(i)),S.isFog?(M.fogNear.value=S.near,M.fogFar.value=S.far):S.isFogExp2&&(M.fogDensity.value=S.density)}function r(M,S,b,R,P){S.isMeshBasicMaterial||S.isMeshLambertMaterial?s(M,S):S.isMeshToonMaterial?(s(M,S),g(M,S)):S.isMeshPhongMaterial?(s(M,S),m(M,S)):S.isMeshStandardMaterial?(s(M,S),v(M,S),S.isMeshPhysicalMaterial&&_(M,S,P)):S.isMeshMatcapMaterial?(s(M,S),A(M,S)):S.isMeshDepthMaterial?s(M,S):S.isMeshDistanceMaterial?(s(M,S),C(M,S)):S.isMeshNormalMaterial?s(M,S):S.isLineBasicMaterial?(a(M,S),S.isLineDashedMaterial&&u(M,S)):S.isPointsMaterial?d(M,S,b,R):S.isSpriteMaterial?h(M,S):S.isShadowMaterial?(M.color.value.copy(S.color),M.opacity.value=S.opacity):S.isShaderMaterial&&(S.uniformsNeedUpdate=!1)}function s(M,S){M.opacity.value=S.opacity,S.color&&M.diffuse.value.copy(S.color),S.emissive&&M.emissive.value.copy(S.emissive).multiplyScalar(S.emissiveIntensity),S.map&&(M.map.value=S.map,t(S.map,M.mapTransform)),S.alphaMap&&(M.alphaMap.value=S.alphaMap,t(S.alphaMap,M.alphaMapTransform)),S.bumpMap&&(M.bumpMap.value=S.bumpMap,t(S.bumpMap,M.bumpMapTransform),M.bumpScale.value=S.bumpScale,S.side===Ar&&(M.bumpScale.value*=-1)),S.normalMap&&(M.normalMap.value=S.normalMap,t(S.normalMap,M.normalMapTransform),M.normalScale.value.copy(S.normalScale),S.side===Ar&&M.normalScale.value.negate()),S.displacementMap&&(M.displacementMap.value=S.displacementMap,t(S.displacementMap,M.displacementMapTransform),M.displacementScale.value=S.displacementScale,M.displacementBias.value=S.displacementBias),S.emissiveMap&&(M.emissiveMap.value=S.emissiveMap,t(S.emissiveMap,M.emissiveMapTransform)),S.specularMap&&(M.specularMap.value=S.specularMap,t(S.specularMap,M.specularMapTransform)),S.alphaTest>0&&(M.alphaTest.value=S.alphaTest);const b=e.get(S),R=b.envMap,P=b.envMapRotation;R&&(M.envMap.value=R,bu.copy(P),bu.x*=-1,bu.y*=-1,bu.z*=-1,R.isCubeTexture&&R.isRenderTargetTexture===!1&&(bu.y*=-1,bu.z*=-1),M.envMapRotation.value.setFromMatrix4(jD.makeRotationFromEuler(bu)),M.flipEnvMap.value=R.isCubeTexture&&R.isRenderTargetTexture===!1?-1:1,M.reflectivity.value=S.reflectivity,M.ior.value=S.ior,M.refractionRatio.value=S.refractionRatio),S.lightMap&&(M.lightMap.value=S.lightMap,M.lightMapIntensity.value=S.lightMapIntensity,t(S.lightMap,M.lightMapTransform)),S.aoMap&&(M.aoMap.value=S.aoMap,M.aoMapIntensity.value=S.aoMapIntensity,t(S.aoMap,M.aoMapTransform))}function a(M,S){M.diffuse.value.copy(S.color),M.opacity.value=S.opacity,S.map&&(M.map.value=S.map,t(S.map,M.mapTransform))}function u(M,S){M.dashSize.value=S.dashSize,M.totalSize.value=S.dashSize+S.gapSize,M.scale.value=S.scale}function d(M,S,b,R){M.diffuse.value.copy(S.color),M.opacity.value=S.opacity,M.size.value=S.size*b,M.scale.value=R*.5,S.map&&(M.map.value=S.map,t(S.map,M.uvTransform)),S.alphaMap&&(M.alphaMap.value=S.alphaMap,t(S.alphaMap,M.alphaMapTransform)),S.alphaTest>0&&(M.alphaTest.value=S.alphaTest)}function h(M,S){M.diffuse.value.copy(S.color),M.opacity.value=S.opacity,M.rotation.value=S.rotation,S.map&&(M.map.value=S.map,t(S.map,M.mapTransform)),S.alphaMap&&(M.alphaMap.value=S.alphaMap,t(S.alphaMap,M.alphaMapTransform)),S.alphaTest>0&&(M.alphaTest.value=S.alphaTest)}function m(M,S){M.specular.value.copy(S.specular),M.shininess.value=Math.max(S.shininess,1e-4)}function g(M,S){S.gradientMap&&(M.gradientMap.value=S.gradientMap)}function v(M,S){M.metalness.value=S.metalness,S.metalnessMap&&(M.metalnessMap.value=S.metalnessMap,t(S.metalnessMap,M.metalnessMapTransform)),M.roughness.value=S.roughness,S.roughnessMap&&(M.roughnessMap.value=S.roughnessMap,t(S.roughnessMap,M.roughnessMapTransform)),S.envMap&&(M.envMapIntensity.value=S.envMapIntensity)}function _(M,S,b){M.ior.value=S.ior,S.sheen>0&&(M.sheenColor.value.copy(S.sheenColor).multiplyScalar(S.sheen),M.sheenRoughness.value=S.sheenRoughness,S.sheenColorMap&&(M.sheenColorMap.value=S.sheenColorMap,t(S.sheenColorMap,M.sheenColorMapTransform)),S.sheenRoughnessMap&&(M.sheenRoughnessMap.value=S.sheenRoughnessMap,t(S.sheenRoughnessMap,M.sheenRoughnessMapTransform))),S.clearcoat>0&&(M.clearcoat.value=S.clearcoat,M.clearcoatRoughness.value=S.clearcoatRoughness,S.clearcoatMap&&(M.clearcoatMap.value=S.clearcoatMap,t(S.clearcoatMap,M.clearcoatMapTransform)),S.clearcoatRoughnessMap&&(M.clearcoatRoughnessMap.value=S.clearcoatRoughnessMap,t(S.clearcoatRoughnessMap,M.clearcoatRoughnessMapTransform)),S.clearcoatNormalMap&&(M.clearcoatNormalMap.value=S.clearcoatNormalMap,t(S.clearcoatNormalMap,M.clearcoatNormalMapTransform),M.clearcoatNormalScale.value.copy(S.clearcoatNormalScale),S.side===Ar&&M.clearcoatNormalScale.value.negate())),S.dispersion>0&&(M.dispersion.value=S.dispersion),S.iridescence>0&&(M.iridescence.value=S.iridescence,M.iridescenceIOR.value=S.iridescenceIOR,M.iridescenceThicknessMinimum.value=S.iridescenceThicknessRange[0],M.iridescenceThicknessMaximum.value=S.iridescenceThicknessRange[1],S.iridescenceMap&&(M.iridescenceMap.value=S.iridescenceMap,t(S.iridescenceMap,M.iridescenceMapTransform)),S.iridescenceThicknessMap&&(M.iridescenceThicknessMap.value=S.iridescenceThicknessMap,t(S.iridescenceThicknessMap,M.iridescenceThicknessMapTransform))),S.transmission>0&&(M.transmission.value=S.transmission,M.transmissionSamplerMap.value=b.texture,M.transmissionSamplerSize.value.set(b.width,b.height),S.transmissionMap&&(M.transmissionMap.value=S.transmissionMap,t(S.transmissionMap,M.transmissionMapTransform)),M.thickness.value=S.thickness,S.thicknessMap&&(M.thicknessMap.value=S.thicknessMap,t(S.thicknessMap,M.thicknessMapTransform)),M.attenuationDistance.value=S.attenuationDistance,M.attenuationColor.value.copy(S.attenuationColor)),S.anisotropy>0&&(M.anisotropyVector.value.set(S.anisotropy*Math.cos(S.anisotropyRotation),S.anisotropy*Math.sin(S.anisotropyRotation)),S.anisotropyMap&&(M.anisotropyMap.value=S.anisotropyMap,t(S.anisotropyMap,M.anisotropyMapTransform))),M.specularIntensity.value=S.specularIntensity,M.specularColor.value.copy(S.specularColor),S.specularColorMap&&(M.specularColorMap.value=S.specularColorMap,t(S.specularColorMap,M.specularColorMapTransform)),S.specularIntensityMap&&(M.specularIntensityMap.value=S.specularIntensityMap,t(S.specularIntensityMap,M.specularIntensityMapTransform))}function A(M,S){S.matcap&&(M.matcap.value=S.matcap)}function C(M,S){const b=e.get(S).light;M.referencePosition.value.setFromMatrixPosition(b.matrixWorld),M.nearDistance.value=b.shadow.camera.near,M.farDistance.value=b.shadow.camera.far}return{refreshFogUniforms:n,refreshMaterialUniforms:r}}function KD(i,e,t,n){let r={},s={},a=[];const u=i.getParameter(i.MAX_UNIFORM_BUFFER_BINDINGS);function d(b,R){const P=R.program;n.uniformBlockBinding(b,P)}function h(b,R){let P=r[b.id];P===void 0&&(A(b),P=m(b),r[b.id]=P,b.addEventListener("dispose",M));const U=R.program;n.updateUBOMapping(b,U);const F=e.render.frame;s[b.id]!==F&&(v(b),s[b.id]=F)}function m(b){const R=g();b.__bindingPointIndex=R;const P=i.createBuffer(),U=b.__size,F=b.usage;return i.bindBuffer(i.UNIFORM_BUFFER,P),i.bufferData(i.UNIFORM_BUFFER,U,F),i.bindBuffer(i.UNIFORM_BUFFER,null),i.bindBufferBase(i.UNIFORM_BUFFER,R,P),P}function g(){for(let b=0;b<u;b++)if(a.indexOf(b)===-1)return a.push(b),b;return console.error("THREE.WebGLRenderer: Maximum number of simultaneously usable uniforms groups reached."),0}function v(b){const R=r[b.id],P=b.uniforms,U=b.__cache;i.bindBuffer(i.UNIFORM_BUFFER,R);for(let F=0,k=P.length;F<k;F++){const G=Array.isArray(P[F])?P[F]:[P[F]];for(let D=0,L=G.length;D<L;D++){const V=G[D];if(_(V,F,D,U)===!0){const oe=V.__offset,ie=Array.isArray(V.value)?V.value:[V.value];let ge=0;for(let ye=0;ye<ie.length;ye++){const he=ie[ye],_e=C(he);typeof he=="number"||typeof he=="boolean"?(V.__data[0]=he,i.bufferSubData(i.UNIFORM_BUFFER,oe+ge,V.__data)):he.isMatrix3?(V.__data[0]=he.elements[0],V.__data[1]=he.elements[1],V.__data[2]=he.elements[2],V.__data[3]=0,V.__data[4]=he.elements[3],V.__data[5]=he.elements[4],V.__data[6]=he.elements[5],V.__data[7]=0,V.__data[8]=he.elements[6],V.__data[9]=he.elements[7],V.__data[10]=he.elements[8],V.__data[11]=0):(he.toArray(V.__data,ge),ge+=_e.storage/Float32Array.BYTES_PER_ELEMENT)}i.bufferSubData(i.UNIFORM_BUFFER,oe,V.__data)}}}i.bindBuffer(i.UNIFORM_BUFFER,null)}function _(b,R,P,U){const F=b.value,k=R+"_"+P;if(U[k]===void 0)return typeof F=="number"||typeof F=="boolean"?U[k]=F:U[k]=F.clone(),!0;{const G=U[k];if(typeof F=="number"||typeof F=="boolean"){if(G!==F)return U[k]=F,!0}else if(G.equals(F)===!1)return G.copy(F),!0}return!1}function A(b){const R=b.uniforms;let P=0;const U=16;for(let k=0,G=R.length;k<G;k++){const D=Array.isArray(R[k])?R[k]:[R[k]];for(let L=0,V=D.length;L<V;L++){const oe=D[L],ie=Array.isArray(oe.value)?oe.value:[oe.value];for(let ge=0,ye=ie.length;ge<ye;ge++){const he=ie[ge],_e=C(he),H=P%U,Z=H%_e.boundary,q=H+Z;P+=Z,q!==0&&U-q<_e.storage&&(P+=U-q),oe.__data=new Float32Array(_e.storage/Float32Array.BYTES_PER_ELEMENT),oe.__offset=P,P+=_e.storage}}}const F=P%U;return F>0&&(P+=U-F),b.__size=P,b.__cache={},this}function C(b){const R={boundary:0,storage:0};return typeof b=="number"||typeof b=="boolean"?(R.boundary=4,R.storage=4):b.isVector2?(R.boundary=8,R.storage=8):b.isVector3||b.isColor?(R.boundary=16,R.storage=12):b.isVector4?(R.boundary=16,R.storage=16):b.isMatrix3?(R.boundary=48,R.storage=48):b.isMatrix4?(R.boundary=64,R.storage=64):b.isTexture?console.warn("THREE.WebGLRenderer: Texture samplers can not be part of an uniforms group."):console.warn("THREE.WebGLRenderer: Unsupported uniform value type.",b),R}function M(b){const R=b.target;R.removeEventListener("dispose",M);const P=a.indexOf(R.__bindingPointIndex);a.splice(P,1),i.deleteBuffer(r[R.id]),delete r[R.id],delete s[R.id]}function S(){for(const b in r)i.deleteBuffer(r[b]);a=[],r={},s={}}return{bind:d,update:h,dispose:S}}class DE{constructor(e={}){const{canvas:t=RM(),context:n=null,depth:r=!0,stencil:s=!1,alpha:a=!1,antialias:u=!1,premultipliedAlpha:d=!0,preserveDrawingBuffer:h=!1,powerPreference:m="default",failIfMajorPerformanceCaveat:g=!1,reverseDepthBuffer:v=!1}=e;this.isWebGLRenderer=!0;let _;if(n!==null){if(typeof WebGLRenderingContext<"u"&&n instanceof WebGLRenderingContext)throw new Error("THREE.WebGLRenderer: WebGL 1 is not supported since r163.");_=n.getContextAttributes().alpha}else _=a;const A=new Uint32Array(4),C=new Int32Array(4);let M=null,S=null;const b=[],R=[];this.domElement=t,this.debug={checkShaderErrors:!0,onShaderError:null},this.autoClear=!0,this.autoClearColor=!0,this.autoClearDepth=!0,this.autoClearStencil=!0,this.sortObjects=!0,this.clippingPlanes=[],this.localClippingEnabled=!1,this._outputColorSpace=Nr,this.toneMapping=Mo,this.toneMappingExposure=1;const P=this;let U=!1,F=0,k=0,G=null,D=-1,L=null;const V=new _n,oe=new _n;let ie=null;const ge=new tt(0);let ye=0,he=t.width,_e=t.height,H=1,Z=null,q=null;const W=new _n(0,0,he,_e),ne=new _n(0,0,he,_e);let Fe=!1;const ae=new fp;let we=!1,De=!1;this.transmissionResolutionScale=1;const Ie=new Ot,Xe=new Ot,_t=new X,Je=new _n,st={background:null,fog:null,environment:null,overrideMaterial:null,isScene:!0};let Ne=!1;function be(){return G===null?H:1}let J=n;function mt(z,le){return t.getContext(z,le)}try{const z={alpha:!0,depth:r,stencil:s,antialias:u,premultipliedAlpha:d,preserveDrawingBuffer:h,powerPreference:m,failIfMajorPerformanceCaveat:g};if("setAttribute"in t&&t.setAttribute("data-engine",`three.js r${ip}`),t.addEventListener("webglcontextlost",Be,!1),t.addEventListener("webglcontextrestored",ut,!1),t.addEventListener("webglcontextcreationerror",it,!1),J===null){const le="webgl2";if(J=mt(le,z),J===null)throw mt(le)?new Error("Error creating WebGL context with your selected attributes."):new Error("Error creating WebGL context.")}}catch(z){throw console.error("THREE.WebGLRenderer: "+z.message),z}let ke,et,je,wt,qe,j,O,pe,Ce,Ue,Pe,ot,Ze,ct,zt,ze,gt,Pt,Dt,ht,ee,Re,nt,$;function Ve(){ke=new oL(J),ke.init(),Re=new LE(J,ke),et=new eL(J,ke,e,Re),je=new HD(J,ke),et.reverseDepthBuffer&&v&&je.buffers.depth.setReversed(!0),wt=new uL(J),qe=new TD,j=new zD(J,ke,je,qe,et,Re,wt),O=new nL(P),pe=new sL(P),Ce=new gI(J),nt=new ZB(J,Ce),Ue=new aL(J,Ce,wt,nt),Pe=new fL(J,Ue,Ce,wt),Dt=new cL(J,et,j),ze=new tL(qe),ot=new CD(P,O,pe,ke,et,nt,ze),Ze=new JD(P,qe),ct=new RD,zt=new FD(ke),Pt=new qB(P,O,pe,je,Pe,_,d),gt=new OD(P,Pe,et),$=new KD(J,wt,et,je),ht=new $B(J,ke,wt),ee=new lL(J,ke,wt),wt.programs=ot.programs,P.capabilities=et,P.extensions=ke,P.properties=qe,P.renderLists=ct,P.shadowMap=gt,P.state=je,P.info=wt}Ve();const Me=new XD(P,J);this.xr=Me,this.getContext=function(){return J},this.getContextAttributes=function(){return J.getContextAttributes()},this.forceContextLoss=function(){const z=ke.get("WEBGL_lose_context");z&&z.loseContext()},this.forceContextRestore=function(){const z=ke.get("WEBGL_lose_context");z&&z.restoreContext()},this.getPixelRatio=function(){return H},this.setPixelRatio=function(z){z!==void 0&&(H=z,this.setSize(he,_e,!1))},this.getSize=function(z){return z.set(he,_e)},this.setSize=function(z,le,Ae=!0){if(Me.isPresenting){console.warn("THREE.WebGLRenderer: Can't change size while VR device is presenting.");return}he=z,_e=le,t.width=Math.floor(z*H),t.height=Math.floor(le*H),Ae===!0&&(t.style.width=z+"px",t.style.height=le+"px"),this.setViewport(0,0,z,le)},this.getDrawingBufferSize=function(z){return z.set(he*H,_e*H).floor()},this.setDrawingBufferSize=function(z,le,Ae){he=z,_e=le,H=Ae,t.width=Math.floor(z*Ae),t.height=Math.floor(le*Ae),this.setViewport(0,0,z,le)},this.getCurrentViewport=function(z){return z.copy(V)},this.getViewport=function(z){return z.copy(W)},this.setViewport=function(z,le,Ae,de){z.isVector4?W.set(z.x,z.y,z.z,z.w):W.set(z,le,Ae,de),je.viewport(V.copy(W).multiplyScalar(H).round())},this.getScissor=function(z){return z.copy(ne)},this.setScissor=function(z,le,Ae,de){z.isVector4?ne.set(z.x,z.y,z.z,z.w):ne.set(z,le,Ae,de),je.scissor(oe.copy(ne).multiplyScalar(H).round())},this.getScissorTest=function(){return Fe},this.setScissorTest=function(z){je.setScissorTest(Fe=z)},this.setOpaqueSort=function(z){Z=z},this.setTransparentSort=function(z){q=z},this.getClearColor=function(z){return z.copy(Pt.getClearColor())},this.setClearColor=function(){Pt.setClearColor.apply(Pt,arguments)},this.getClearAlpha=function(){return Pt.getClearAlpha()},this.setClearAlpha=function(){Pt.setClearAlpha.apply(Pt,arguments)},this.clear=function(z=!0,le=!0,Ae=!0){let de=0;if(z){let ce=!1;if(G!==null){const Ge=G.texture.format;ce=Ge===P0||Ge===I0||Ge===sp}if(ce){const Ge=G.texture.type,rt=Ge===to||Ge===ba||Ge===Jf||Ge===Yu||Ge===T0||Ge===b0,dt=Pt.getClearColor(),vt=Pt.getClearAlpha(),Bt=dt.r,Rt=dt.g,Ye=dt.b;rt?(A[0]=Bt,A[1]=Rt,A[2]=Ye,A[3]=vt,J.clearBufferuiv(J.COLOR,0,A)):(C[0]=Bt,C[1]=Rt,C[2]=Ye,C[3]=vt,J.clearBufferiv(J.COLOR,0,C))}else de|=J.COLOR_BUFFER_BIT}le&&(de|=J.DEPTH_BUFFER_BIT),Ae&&(de|=J.STENCIL_BUFFER_BIT,this.state.buffers.stencil.setMask(4294967295)),J.clear(de)},this.clearColor=function(){this.clear(!0,!1,!1)},this.clearDepth=function(){this.clear(!1,!0,!1)},this.clearStencil=function(){this.clear(!1,!1,!0)},this.dispose=function(){t.removeEventListener("webglcontextlost",Be,!1),t.removeEventListener("webglcontextrestored",ut,!1),t.removeEventListener("webglcontextcreationerror",it,!1),Pt.dispose(),ct.dispose(),zt.dispose(),qe.dispose(),O.dispose(),pe.dispose(),Pe.dispose(),nt.dispose(),$.dispose(),ot.dispose(),Me.dispose(),Me.removeEventListener("sessionstart",Ba),Me.removeEventListener("sessionend",oo),rs.stop()};function Be(z){z.preventDefault(),console.log("THREE.WebGLRenderer: Context Lost."),U=!0}function ut(){console.log("THREE.WebGLRenderer: Context Restored."),U=!1;const z=wt.autoReset,le=gt.enabled,Ae=gt.autoUpdate,de=gt.needsUpdate,ce=gt.type;Ve(),wt.autoReset=z,gt.enabled=le,gt.autoUpdate=Ae,gt.needsUpdate=de,gt.type=ce}function it(z){console.error("THREE.WebGLRenderer: A WebGL context could not be created. Reason: ",z.statusMessage)}function It(z){const le=z.target;le.removeEventListener("dispose",It),ln(le)}function ln(z){Cn(z),qe.remove(z)}function Cn(z){const le=qe.get(z).programs;le!==void 0&&(le.forEach(function(Ae){ot.releaseProgram(Ae)}),z.isShaderMaterial&&ot.releaseShaderCache(z))}this.renderBufferDirect=function(z,le,Ae,de,ce,Ge){le===null&&(le=st);const rt=ce.isMesh&&ce.matrixWorld.determinant()<0,dt=cc(z,le,Ae,de,ce);je.setMaterial(de,rt);let vt=Ae.index,Bt=1;if(de.wireframe===!0){if(vt=Ue.getWireframeAttribute(Ae),vt===void 0)return;Bt=2}const Rt=Ae.drawRange,Ye=Ae.attributes.position;let Mt=Rt.start*Bt,kt=(Rt.start+Rt.count)*Bt;Ge!==null&&(Mt=Math.max(Mt,Ge.start*Bt),kt=Math.min(kt,(Ge.start+Ge.count)*Bt)),vt!==null?(Mt=Math.max(Mt,0),kt=Math.min(kt,vt.count)):Ye!=null&&(Mt=Math.max(Mt,0),kt=Math.min(kt,Ye.count));const nn=kt-Mt;if(nn<0||nn===1/0)return;nt.setup(ce,de,dt,Ae,vt);let rn,Qt=ht;if(vt!==null&&(rn=Ce.get(vt),Qt=ee,Qt.setIndex(rn)),ce.isMesh)de.wireframe===!0?(je.setLineWidth(de.wireframeLinewidth*be()),Qt.setMode(J.LINES)):Qt.setMode(J.TRIANGLES);else if(ce.isLine){let St=de.linewidth;St===void 0&&(St=1),je.setLineWidth(St*be()),ce.isLineSegments?Qt.setMode(J.LINES):ce.isLineLoop?Qt.setMode(J.LINE_LOOP):Qt.setMode(J.LINE_STRIP)}else ce.isPoints?Qt.setMode(J.POINTS):ce.isSprite&&Qt.setMode(J.TRIANGLES);if(ce.isBatchedMesh)if(ce._multiDrawInstances!==null)Qt.renderMultiDrawInstances(ce._multiDrawStarts,ce._multiDrawCounts,ce._multiDrawCount,ce._multiDrawInstances);else if(ke.get("WEBGL_multi_draw"))Qt.renderMultiDraw(ce._multiDrawStarts,ce._multiDrawCounts,ce._multiDrawCount);else{const St=ce._multiDrawStarts,un=ce._multiDrawCounts,$t=ce._multiDrawCount,mi=vt?Ce.get(vt).bytesPerElement:1,Ms=qe.get(de).currentProgram.getUniforms();for(let oi=0;oi<$t;oi++)Ms.setValue(J,"_gl_DrawID",oi),Qt.render(St[oi]/mi,un[oi])}else if(ce.isInstancedMesh)Qt.renderInstances(Mt,nn,ce.count);else if(Ae.isInstancedBufferGeometry){const St=Ae._maxInstanceCount!==void 0?Ae._maxInstanceCount:1/0,un=Math.min(Ae.instanceCount,St);Qt.renderInstances(Mt,nn,un)}else Qt.render(Mt,nn)};function Yt(z,le,Ae){z.transparent===!0&&z.side===_s&&z.forceSinglePass===!1?(z.side=Ar,z.needsUpdate=!0,La(z,le,Ae),z.side=To,z.needsUpdate=!0,La(z,le,Ae),z.side=_s):La(z,le,Ae)}this.compile=function(z,le,Ae=null){Ae===null&&(Ae=z),S=zt.get(Ae),S.init(le),R.push(S),Ae.traverseVisible(function(ce){ce.isLight&&ce.layers.test(le.layers)&&(S.pushLight(ce),ce.castShadow&&S.pushShadow(ce))}),z!==Ae&&z.traverseVisible(function(ce){ce.isLight&&ce.layers.test(le.layers)&&(S.pushLight(ce),ce.castShadow&&S.pushShadow(ce))}),S.setupLights();const de=new Set;return z.traverse(function(ce){if(!(ce.isMesh||ce.isPoints||ce.isLine||ce.isSprite))return;const Ge=ce.material;if(Ge)if(Array.isArray(Ge))for(let rt=0;rt<Ge.length;rt++){const dt=Ge[rt];Yt(dt,Ae,ce),de.add(dt)}else Yt(Ge,Ae,ce),de.add(Ge)}),R.pop(),S=null,de},this.compileAsync=function(z,le,Ae=null){const de=this.compile(z,le,Ae);return new Promise(ce=>{function Ge(){if(de.forEach(function(rt){qe.get(rt).currentProgram.isReady()&&de.delete(rt)}),de.size===0){ce(z);return}setTimeout(Ge,10)}ke.get("KHR_parallel_shader_compile")!==null?Ge():setTimeout(Ge,10)})};let Gn=null;function Kn(z){Gn&&Gn(z)}function Ba(){rs.stop()}function oo(){rs.start()}const rs=new bE;rs.setAnimationLoop(Kn),typeof self<"u"&&rs.setContext(self),this.setAnimationLoop=function(z){Gn=z,Me.setAnimationLoop(z),z===null?rs.stop():rs.start()},Me.addEventListener("sessionstart",Ba),Me.addEventListener("sessionend",oo),this.render=function(z,le){if(le!==void 0&&le.isCamera!==!0){console.error("THREE.WebGLRenderer.render: camera is not an instance of THREE.Camera.");return}if(U===!0)return;if(z.matrixWorldAutoUpdate===!0&&z.updateMatrixWorld(),le.parent===null&&le.matrixWorldAutoUpdate===!0&&le.updateMatrixWorld(),Me.enabled===!0&&Me.isPresenting===!0&&(Me.cameraAutoUpdate===!0&&Me.updateCamera(le),le=Me.getCamera()),z.isScene===!0&&z.onBeforeRender(P,z,le,G),S=zt.get(z,R.length),S.init(le),R.push(S),Xe.multiplyMatrices(le.projectionMatrix,le.matrixWorldInverse),ae.setFromProjectionMatrix(Xe),De=this.localClippingEnabled,we=ze.init(this.clippingPlanes,De),M=ct.get(z,b.length),M.init(),b.push(M),Me.enabled===!0&&Me.isPresenting===!0){const Ge=P.xr.getDepthSensingMesh();Ge!==null&&kr(Ge,le,-1/0,P.sortObjects)}kr(z,le,0,P.sortObjects),M.finish(),P.sortObjects===!0&&M.sort(Z,q),Ne=Me.enabled===!1||Me.isPresenting===!1||Me.hasDepthSensing()===!1,Ne&&Pt.addToRenderList(M,z),this.info.render.frame++,we===!0&&ze.beginShadows();const Ae=S.state.shadowsArray;gt.render(Ae,z,le),we===!0&&ze.endShadows(),this.info.autoReset===!0&&this.info.reset();const de=M.opaque,ce=M.transmissive;if(S.setupLights(),le.isArrayCamera){const Ge=le.cameras;if(ce.length>0)for(let rt=0,dt=Ge.length;rt<dt;rt++){const vt=Ge[rt];Hr(de,ce,z,vt)}Ne&&Pt.render(z);for(let rt=0,dt=Ge.length;rt<dt;rt++){const vt=Ge[rt];Po(M,z,vt,vt.viewport)}}else ce.length>0&&Hr(de,ce,z,le),Ne&&Pt.render(z),Po(M,z,le);G!==null&&k===0&&(j.updateMultisampleRenderTarget(G),j.updateRenderTargetMipmap(G)),z.isScene===!0&&z.onAfterRender(P,z,le),nt.resetDefaultState(),D=-1,L=null,R.pop(),R.length>0?(S=R[R.length-1],we===!0&&ze.setGlobalState(P.clippingPlanes,S.state.camera)):S=null,b.pop(),b.length>0?M=b[b.length-1]:M=null};function kr(z,le,Ae,de){if(z.visible===!1)return;if(z.layers.test(le.layers)){if(z.isGroup)Ae=z.renderOrder;else if(z.isLOD)z.autoUpdate===!0&&z.update(le);else if(z.isLight)S.pushLight(z),z.castShadow&&S.pushShadow(z);else if(z.isSprite){if(!z.frustumCulled||ae.intersectsSprite(z)){de&&Je.setFromMatrixPosition(z.matrixWorld).applyMatrix4(Xe);const rt=Pe.update(z),dt=z.material;dt.visible&&M.push(z,rt,dt,Ae,Je.z,null)}}else if((z.isMesh||z.isLine||z.isPoints)&&(!z.frustumCulled||ae.intersectsObject(z))){const rt=Pe.update(z),dt=z.material;if(de&&(z.boundingSphere!==void 0?(z.boundingSphere===null&&z.computeBoundingSphere(),Je.copy(z.boundingSphere.center)):(rt.boundingSphere===null&&rt.computeBoundingSphere(),Je.copy(rt.boundingSphere.center)),Je.applyMatrix4(z.matrixWorld).applyMatrix4(Xe)),Array.isArray(dt)){const vt=rt.groups;for(let Bt=0,Rt=vt.length;Bt<Rt;Bt++){const Ye=vt[Bt],Mt=dt[Ye.materialIndex];Mt&&Mt.visible&&M.push(z,rt,Mt,Ae,Je.z,Ye)}}else dt.visible&&M.push(z,rt,dt,Ae,Je.z,null)}}const Ge=z.children;for(let rt=0,dt=Ge.length;rt<dt;rt++)kr(Ge[rt],le,Ae,de)}function Po(z,le,Ae,de){const ce=z.opaque,Ge=z.transmissive,rt=z.transparent;S.setupLightsView(Ae),we===!0&&ze.setGlobalState(P.clippingPlanes,Ae),de&&je.viewport(V.copy(de)),ce.length>0&&ao(ce,le,Ae),Ge.length>0&&ao(Ge,le,Ae),rt.length>0&&ao(rt,le,Ae),je.buffers.depth.setTest(!0),je.buffers.depth.setMask(!0),je.buffers.color.setMask(!0),je.setPolygonOffset(!1)}function Hr(z,le,Ae,de){if((Ae.isScene===!0?Ae.overrideMaterial:null)!==null)return;S.state.transmissionRenderTarget[de.id]===void 0&&(S.state.transmissionRenderTarget[de.id]=new bo(1,1,{generateMipmaps:!0,type:ke.has("EXT_color_buffer_half_float")||ke.has("EXT_color_buffer_float")?sd:to,minFilter:As,samples:4,stencilBuffer:s,resolveDepthBuffer:!1,resolveStencilBuffer:!1,colorSpace:gn.workingColorSpace}));const Ge=S.state.transmissionRenderTarget[de.id],rt=de.viewport||V;Ge.setSize(rt.z*P.transmissionResolutionScale,rt.w*P.transmissionResolutionScale);const dt=P.getRenderTarget();P.setRenderTarget(Ge),P.getClearColor(ge),ye=P.getClearAlpha(),ye<1&&P.setClearColor(16777215,.5),P.clear(),Ne&&Pt.render(Ae);const vt=P.toneMapping;P.toneMapping=Mo;const Bt=de.viewport;if(de.viewport!==void 0&&(de.viewport=void 0),S.setupLightsView(de),we===!0&&ze.setGlobalState(P.clippingPlanes,de),ao(z,Ae,de),j.updateMultisampleRenderTarget(Ge),j.updateRenderTargetMipmap(Ge),ke.has("WEBGL_multisampled_render_to_texture")===!1){let Rt=!1;for(let Ye=0,Mt=le.length;Ye<Mt;Ye++){const kt=le[Ye],nn=kt.object,rn=kt.geometry,Qt=kt.material,St=kt.group;if(Qt.side===_s&&nn.layers.test(de.layers)){const un=Qt.side;Qt.side=Ar,Qt.needsUpdate=!0,lc(nn,Ae,de,rn,Qt,St),Qt.side=un,Qt.needsUpdate=!0,Rt=!0}}Rt===!0&&(j.updateMultisampleRenderTarget(Ge),j.updateRenderTargetMipmap(Ge))}P.setRenderTarget(dt),P.setClearColor(ge,ye),Bt!==void 0&&(de.viewport=Bt),P.toneMapping=vt}function ao(z,le,Ae){const de=le.isScene===!0?le.overrideMaterial:null;for(let ce=0,Ge=z.length;ce<Ge;ce++){const rt=z[ce],dt=rt.object,vt=rt.geometry,Bt=de===null?rt.material:de,Rt=rt.group;dt.layers.test(Ae.layers)&&lc(dt,le,Ae,vt,Bt,Rt)}}function lc(z,le,Ae,de,ce,Ge){z.onBeforeRender(P,le,Ae,de,ce,Ge),z.modelViewMatrix.multiplyMatrices(Ae.matrixWorldInverse,z.matrixWorld),z.normalMatrix.getNormalMatrix(z.modelViewMatrix),ce.onBeforeRender(P,le,Ae,de,z,Ge),ce.transparent===!0&&ce.side===_s&&ce.forceSinglePass===!1?(ce.side=Ar,ce.needsUpdate=!0,P.renderBufferDirect(Ae,le,de,ce,z,Ge),ce.side=To,ce.needsUpdate=!0,P.renderBufferDirect(Ae,le,de,ce,z,Ge),ce.side=_s):P.renderBufferDirect(Ae,le,de,ce,z,Ge),z.onAfterRender(P,le,Ae,de,ce,Ge)}function La(z,le,Ae){le.isScene!==!0&&(le=st);const de=qe.get(z),ce=S.state.lights,Ge=S.state.shadowsArray,rt=ce.state.version,dt=ot.getParameters(z,ce.state,Ge,le,Ae),vt=ot.getProgramCacheKey(dt);let Bt=de.programs;de.environment=z.isMeshStandardMaterial?le.environment:null,de.fog=le.fog,de.envMap=(z.isMeshStandardMaterial?pe:O).get(z.envMap||de.environment),de.envMapRotation=de.environment!==null&&z.envMap===null?le.environmentRotation:z.envMapRotation,Bt===void 0&&(z.addEventListener("dispose",It),Bt=new Map,de.programs=Bt);let Rt=Bt.get(vt);if(Rt!==void 0){if(de.currentProgram===Rt&&de.lightsStateVersion===rt)return ss(z,dt),Rt}else dt.uniforms=ot.getUniforms(z),z.onBeforeCompile(dt,P),Rt=ot.acquireProgram(dt,vt),Bt.set(vt,Rt),de.uniforms=dt.uniforms;const Ye=de.uniforms;return(!z.isShaderMaterial&&!z.isRawShaderMaterial||z.clipping===!0)&&(Ye.clippingPlanes=ze.uniform),ss(z,dt),de.needsLights=dc(z),de.lightsStateVersion=rt,de.needsLights&&(Ye.ambientLightColor.value=ce.state.ambient,Ye.lightProbe.value=ce.state.probe,Ye.directionalLights.value=ce.state.directional,Ye.directionalLightShadows.value=ce.state.directionalShadow,Ye.spotLights.value=ce.state.spot,Ye.spotLightShadows.value=ce.state.spotShadow,Ye.rectAreaLights.value=ce.state.rectArea,Ye.ltc_1.value=ce.state.rectAreaLTC1,Ye.ltc_2.value=ce.state.rectAreaLTC2,Ye.pointLights.value=ce.state.point,Ye.pointLightShadows.value=ce.state.pointShadow,Ye.hemisphereLights.value=ce.state.hemi,Ye.directionalShadowMap.value=ce.state.directionalShadowMap,Ye.directionalShadowMatrix.value=ce.state.directionalShadowMatrix,Ye.spotShadowMap.value=ce.state.spotShadowMap,Ye.spotLightMatrix.value=ce.state.spotLightMatrix,Ye.spotLightMap.value=ce.state.spotLightMap,Ye.pointShadowMap.value=ce.state.pointShadowMap,Ye.pointShadowMatrix.value=ce.state.pointShadowMatrix),de.currentProgram=Rt,de.uniformsList=null,Rt}function uc(z){if(z.uniformsList===null){const le=z.currentProgram.getUniforms();z.uniformsList=Ag.seqWithValue(le.seq,z.uniforms)}return z.uniformsList}function ss(z,le){const Ae=qe.get(z);Ae.outputColorSpace=le.outputColorSpace,Ae.batching=le.batching,Ae.batchingColor=le.batchingColor,Ae.instancing=le.instancing,Ae.instancingColor=le.instancingColor,Ae.instancingMorph=le.instancingMorph,Ae.skinning=le.skinning,Ae.morphTargets=le.morphTargets,Ae.morphNormals=le.morphNormals,Ae.morphColors=le.morphColors,Ae.morphTargetsCount=le.morphTargetsCount,Ae.numClippingPlanes=le.numClippingPlanes,Ae.numIntersection=le.numClipIntersection,Ae.vertexAlphas=le.vertexAlphas,Ae.vertexTangents=le.vertexTangents,Ae.toneMapping=le.toneMapping}function cc(z,le,Ae,de,ce){le.isScene!==!0&&(le=st),j.resetTextureUnits();const Ge=le.fog,rt=de.isMeshStandardMaterial?le.environment:null,dt=G===null?P.outputColorSpace:G.isXRRenderTarget===!0?G.texture.colorSpace:qu,vt=(de.isMeshStandardMaterial?pe:O).get(de.envMap||rt),Bt=de.vertexColors===!0&&!!Ae.attributes.color&&Ae.attributes.color.itemSize===4,Rt=!!Ae.attributes.tangent&&(!!de.normalMap||de.anisotropy>0),Ye=!!Ae.morphAttributes.position,Mt=!!Ae.morphAttributes.normal,kt=!!Ae.morphAttributes.color;let nn=Mo;de.toneMapped&&(G===null||G.isXRRenderTarget===!0)&&(nn=P.toneMapping);const rn=Ae.morphAttributes.position||Ae.morphAttributes.normal||Ae.morphAttributes.color,Qt=rn!==void 0?rn.length:0,St=qe.get(de),un=S.state.lights;if(we===!0&&(De===!0||z!==L)){const gi=z===L&&de.id===D;ze.setState(de,z,gi)}let $t=!1;de.version===St.__version?(St.needsLights&&St.lightsStateVersion!==un.state.version||St.outputColorSpace!==dt||ce.isBatchedMesh&&St.batching===!1||!ce.isBatchedMesh&&St.batching===!0||ce.isBatchedMesh&&St.batchingColor===!0&&ce.colorTexture===null||ce.isBatchedMesh&&St.batchingColor===!1&&ce.colorTexture!==null||ce.isInstancedMesh&&St.instancing===!1||!ce.isInstancedMesh&&St.instancing===!0||ce.isSkinnedMesh&&St.skinning===!1||!ce.isSkinnedMesh&&St.skinning===!0||ce.isInstancedMesh&&St.instancingColor===!0&&ce.instanceColor===null||ce.isInstancedMesh&&St.instancingColor===!1&&ce.instanceColor!==null||ce.isInstancedMesh&&St.instancingMorph===!0&&ce.morphTexture===null||ce.isInstancedMesh&&St.instancingMorph===!1&&ce.morphTexture!==null||St.envMap!==vt||de.fog===!0&&St.fog!==Ge||St.numClippingPlanes!==void 0&&(St.numClippingPlanes!==ze.numPlanes||St.numIntersection!==ze.numIntersection)||St.vertexAlphas!==Bt||St.vertexTangents!==Rt||St.morphTargets!==Ye||St.morphNormals!==Mt||St.morphColors!==kt||St.toneMapping!==nn||St.morphTargetsCount!==Qt)&&($t=!0):($t=!0,St.__version=de.version);let mi=St.currentProgram;$t===!0&&(mi=La(de,le,ce));let Ms=!1,oi=!1,os=!1;const sn=mi.getUniforms(),Ti=St.uniforms;if(je.useProgram(mi.program)&&(Ms=!0,oi=!0,os=!0),de.id!==D&&(D=de.id,oi=!0),Ms||L!==z){je.buffers.depth.getReversed()?(Ie.copy(z.projectionMatrix),Vb(Ie),Wb(Ie),sn.setValue(J,"projectionMatrix",Ie)):sn.setValue(J,"projectionMatrix",z.projectionMatrix),sn.setValue(J,"viewMatrix",z.matrixWorldInverse);const Vn=sn.map.cameraPosition;Vn!==void 0&&Vn.setValue(J,_t.setFromMatrixPosition(z.matrixWorld)),et.logarithmicDepthBuffer&&sn.setValue(J,"logDepthBufFC",2/(Math.log(z.far+1)/Math.LN2)),(de.isMeshPhongMaterial||de.isMeshToonMaterial||de.isMeshLambertMaterial||de.isMeshBasicMaterial||de.isMeshStandardMaterial||de.isShaderMaterial)&&sn.setValue(J,"isOrthographic",z.isOrthographicCamera===!0),L!==z&&(L=z,oi=!0,os=!0)}if(ce.isSkinnedMesh){sn.setOptional(J,ce,"bindMatrix"),sn.setOptional(J,ce,"bindMatrixInverse");const gi=ce.skeleton;gi&&(gi.boneTexture===null&&gi.computeBoneTexture(),sn.setValue(J,"boneTexture",gi.boneTexture,j))}ce.isBatchedMesh&&(sn.setOptional(J,ce,"batchingTexture"),sn.setValue(J,"batchingTexture",ce._matricesTexture,j),sn.setOptional(J,ce,"batchingIdTexture"),sn.setValue(J,"batchingIdTexture",ce._indirectTexture,j),sn.setOptional(J,ce,"batchingColorTexture"),ce._colorsTexture!==null&&sn.setValue(J,"batchingColorTexture",ce._colorsTexture,j));const ai=Ae.morphAttributes;if((ai.position!==void 0||ai.normal!==void 0||ai.color!==void 0)&&Dt.update(ce,Ae,mi),(oi||St.receiveShadow!==ce.receiveShadow)&&(St.receiveShadow=ce.receiveShadow,sn.setValue(J,"receiveShadow",ce.receiveShadow)),de.isMeshGouraudMaterial&&de.envMap!==null&&(Ti.envMap.value=vt,Ti.flipEnvMap.value=vt.isCubeTexture&&vt.isRenderTargetTexture===!1?-1:1),de.isMeshStandardMaterial&&de.envMap===null&&le.environment!==null&&(Ti.envMapIntensity.value=le.environmentIntensity),oi&&(sn.setValue(J,"toneMappingExposure",P.toneMappingExposure),St.needsLights&&fc(Ti,os),Ge&&de.fog===!0&&Ze.refreshFogUniforms(Ti,Ge),Ze.refreshMaterialUniforms(Ti,de,H,_e,S.state.transmissionRenderTarget[z.id]),Ag.upload(J,uc(St),Ti,j)),de.isShaderMaterial&&de.uniformsNeedUpdate===!0&&(Ag.upload(J,uc(St),Ti,j),de.uniformsNeedUpdate=!1),de.isSpriteMaterial&&sn.setValue(J,"center",ce.center),sn.setValue(J,"modelViewMatrix",ce.modelViewMatrix),sn.setValue(J,"normalMatrix",ce.normalMatrix),sn.setValue(J,"modelMatrix",ce.matrixWorld),de.isShaderMaterial||de.isRawShaderMaterial){const gi=de.uniformsGroups;for(let Vn=0,on=gi.length;Vn<on;Vn++){const Ji=gi[Vn];$.update(Ji,mi),$.bind(Ji,mi)}}return mi}function fc(z,le){z.ambientLightColor.needsUpdate=le,z.lightProbe.needsUpdate=le,z.directionalLights.needsUpdate=le,z.directionalLightShadows.needsUpdate=le,z.pointLights.needsUpdate=le,z.pointLightShadows.needsUpdate=le,z.spotLights.needsUpdate=le,z.spotLightShadows.needsUpdate=le,z.rectAreaLights.needsUpdate=le,z.hemisphereLights.needsUpdate=le}function dc(z){return z.isMeshLambertMaterial||z.isMeshToonMaterial||z.isMeshPhongMaterial||z.isMeshStandardMaterial||z.isShadowMaterial||z.isShaderMaterial&&z.lights===!0}this.getActiveCubeFace=function(){return F},this.getActiveMipmapLevel=function(){return k},this.getRenderTarget=function(){return G},this.setRenderTargetTextures=function(z,le,Ae){qe.get(z.texture).__webglTexture=le,qe.get(z.depthTexture).__webglTexture=Ae;const de=qe.get(z);de.__hasExternalTextures=!0,de.__autoAllocateDepthBuffer=Ae===void 0,de.__autoAllocateDepthBuffer||ke.has("WEBGL_multisampled_render_to_texture")===!0&&(console.warn("THREE.WebGLRenderer: Render-to-texture extension was disabled because an external texture was provided"),de.__useRenderToTexture=!1)},this.setRenderTargetFramebuffer=function(z,le){const Ae=qe.get(z);Ae.__webglFramebuffer=le,Ae.__useDefaultFramebuffer=le===void 0};const hc=J.createFramebuffer();this.setRenderTarget=function(z,le=0,Ae=0){G=z,F=le,k=Ae;let de=!0,ce=null,Ge=!1,rt=!1;if(z){const vt=qe.get(z);if(vt.__useDefaultFramebuffer!==void 0)je.bindFramebuffer(J.FRAMEBUFFER,null),de=!1;else if(vt.__webglFramebuffer===void 0)j.setupRenderTarget(z);else if(vt.__hasExternalTextures)j.rebindTextures(z,qe.get(z.texture).__webglTexture,qe.get(z.depthTexture).__webglTexture);else if(z.depthBuffer){const Ye=z.depthTexture;if(vt.__boundDepthTexture!==Ye){if(Ye!==null&&qe.has(Ye)&&(z.width!==Ye.image.width||z.height!==Ye.image.height))throw new Error("WebGLRenderTarget: Attached DepthTexture is initialized to the incorrect size.");j.setupDepthRenderbuffer(z)}}const Bt=z.texture;(Bt.isData3DTexture||Bt.isDataArrayTexture||Bt.isCompressedArrayTexture)&&(rt=!0);const Rt=qe.get(z).__webglFramebuffer;z.isWebGLCubeRenderTarget?(Array.isArray(Rt[le])?ce=Rt[le][Ae]:ce=Rt[le],Ge=!0):z.samples>0&&j.useMultisampledRTT(z)===!1?ce=qe.get(z).__webglMultisampledFramebuffer:Array.isArray(Rt)?ce=Rt[Ae]:ce=Rt,V.copy(z.viewport),oe.copy(z.scissor),ie=z.scissorTest}else V.copy(W).multiplyScalar(H).floor(),oe.copy(ne).multiplyScalar(H).floor(),ie=Fe;if(Ae!==0&&(ce=hc),je.bindFramebuffer(J.FRAMEBUFFER,ce)&&de&&je.drawBuffers(z,ce),je.viewport(V),je.scissor(oe),je.setScissorTest(ie),Ge){const vt=qe.get(z.texture);J.framebufferTexture2D(J.FRAMEBUFFER,J.COLOR_ATTACHMENT0,J.TEXTURE_CUBE_MAP_POSITIVE_X+le,vt.__webglTexture,Ae)}else if(rt){const vt=qe.get(z.texture),Bt=le;J.framebufferTextureLayer(J.FRAMEBUFFER,J.COLOR_ATTACHMENT0,vt.__webglTexture,Ae,Bt)}else if(z!==null&&Ae!==0){const vt=qe.get(z.texture);J.framebufferTexture2D(J.FRAMEBUFFER,J.COLOR_ATTACHMENT0,J.TEXTURE_2D,vt.__webglTexture,Ae)}D=-1},this.readRenderTargetPixels=function(z,le,Ae,de,ce,Ge,rt){if(!(z&&z.isWebGLRenderTarget)){console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not THREE.WebGLRenderTarget.");return}let dt=qe.get(z).__webglFramebuffer;if(z.isWebGLCubeRenderTarget&&rt!==void 0&&(dt=dt[rt]),dt){je.bindFramebuffer(J.FRAMEBUFFER,dt);try{const vt=z.texture,Bt=vt.format,Rt=vt.type;if(!et.textureFormatReadable(Bt)){console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not in RGBA or implementation defined format.");return}if(!et.textureTypeReadable(Rt)){console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not in UnsignedByteType or implementation defined type.");return}le>=0&&le<=z.width-de&&Ae>=0&&Ae<=z.height-ce&&J.readPixels(le,Ae,de,ce,Re.convert(Bt),Re.convert(Rt),Ge)}finally{const vt=G!==null?qe.get(G).__webglFramebuffer:null;je.bindFramebuffer(J.FRAMEBUFFER,vt)}}},this.readRenderTargetPixelsAsync=async function(z,le,Ae,de,ce,Ge,rt){if(!(z&&z.isWebGLRenderTarget))throw new Error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not THREE.WebGLRenderTarget.");let dt=qe.get(z).__webglFramebuffer;if(z.isWebGLCubeRenderTarget&&rt!==void 0&&(dt=dt[rt]),dt){const vt=z.texture,Bt=vt.format,Rt=vt.type;if(!et.textureFormatReadable(Bt))throw new Error("THREE.WebGLRenderer.readRenderTargetPixelsAsync: renderTarget is not in RGBA or implementation defined format.");if(!et.textureTypeReadable(Rt))throw new Error("THREE.WebGLRenderer.readRenderTargetPixelsAsync: renderTarget is not in UnsignedByteType or implementation defined type.");if(le>=0&&le<=z.width-de&&Ae>=0&&Ae<=z.height-ce){je.bindFramebuffer(J.FRAMEBUFFER,dt);const Ye=J.createBuffer();J.bindBuffer(J.PIXEL_PACK_BUFFER,Ye),J.bufferData(J.PIXEL_PACK_BUFFER,Ge.byteLength,J.STREAM_READ),J.readPixels(le,Ae,de,ce,Re.convert(Bt),Re.convert(Rt),0);const Mt=G!==null?qe.get(G).__webglFramebuffer:null;je.bindFramebuffer(J.FRAMEBUFFER,Mt);const kt=J.fenceSync(J.SYNC_GPU_COMMANDS_COMPLETE,0);return J.flush(),await Gb(J,kt,4),J.bindBuffer(J.PIXEL_PACK_BUFFER,Ye),J.getBufferSubData(J.PIXEL_PACK_BUFFER,0,Ge),J.deleteBuffer(Ye),J.deleteSync(kt),Ge}else throw new Error("THREE.WebGLRenderer.readRenderTargetPixelsAsync: requested read bounds are out of range.")}},this.copyFramebufferToTexture=function(z,le=null,Ae=0){z.isTexture!==!0&&(Df("WebGLRenderer: copyFramebufferToTexture function signature has changed."),le=arguments[0]||null,z=arguments[1]);const de=Math.pow(2,-Ae),ce=Math.floor(z.image.width*de),Ge=Math.floor(z.image.height*de),rt=le!==null?le.x:0,dt=le!==null?le.y:0;j.setTexture2D(z,0),J.copyTexSubImage2D(J.TEXTURE_2D,Ae,0,0,rt,dt,ce,Ge),je.unbindTexture()};const pc=J.createFramebuffer(),mc=J.createFramebuffer();this.copyTextureToTexture=function(z,le,Ae=null,de=null,ce=0,Ge=null){z.isTexture!==!0&&(Df("WebGLRenderer: copyTextureToTexture function signature has changed."),de=arguments[0]||null,z=arguments[1],le=arguments[2],Ge=arguments[3]||0,Ae=null),Ge===null&&(ce!==0?(Df("WebGLRenderer: copyTextureToTexture function signature has changed to support src and dst mipmap levels."),Ge=ce,ce=0):Ge=0);let rt,dt,vt,Bt,Rt,Ye,Mt,kt,nn;const rn=z.isCompressedTexture?z.mipmaps[Ge]:z.image;if(Ae!==null)rt=Ae.max.x-Ae.min.x,dt=Ae.max.y-Ae.min.y,vt=Ae.isBox3?Ae.max.z-Ae.min.z:1,Bt=Ae.min.x,Rt=Ae.min.y,Ye=Ae.isBox3?Ae.min.z:0;else{const ai=Math.pow(2,-ce);rt=Math.floor(rn.width*ai),dt=Math.floor(rn.height*ai),z.isDataArrayTexture?vt=rn.depth:z.isData3DTexture?vt=Math.floor(rn.depth*ai):vt=1,Bt=0,Rt=0,Ye=0}de!==null?(Mt=de.x,kt=de.y,nn=de.z):(Mt=0,kt=0,nn=0);const Qt=Re.convert(le.format),St=Re.convert(le.type);let un;le.isData3DTexture?(j.setTexture3D(le,0),un=J.TEXTURE_3D):le.isDataArrayTexture||le.isCompressedArrayTexture?(j.setTexture2DArray(le,0),un=J.TEXTURE_2D_ARRAY):(j.setTexture2D(le,0),un=J.TEXTURE_2D),J.pixelStorei(J.UNPACK_FLIP_Y_WEBGL,le.flipY),J.pixelStorei(J.UNPACK_PREMULTIPLY_ALPHA_WEBGL,le.premultiplyAlpha),J.pixelStorei(J.UNPACK_ALIGNMENT,le.unpackAlignment);const $t=J.getParameter(J.UNPACK_ROW_LENGTH),mi=J.getParameter(J.UNPACK_IMAGE_HEIGHT),Ms=J.getParameter(J.UNPACK_SKIP_PIXELS),oi=J.getParameter(J.UNPACK_SKIP_ROWS),os=J.getParameter(J.UNPACK_SKIP_IMAGES);J.pixelStorei(J.UNPACK_ROW_LENGTH,rn.width),J.pixelStorei(J.UNPACK_IMAGE_HEIGHT,rn.height),J.pixelStorei(J.UNPACK_SKIP_PIXELS,Bt),J.pixelStorei(J.UNPACK_SKIP_ROWS,Rt),J.pixelStorei(J.UNPACK_SKIP_IMAGES,Ye);const sn=z.isDataArrayTexture||z.isData3DTexture,Ti=le.isDataArrayTexture||le.isData3DTexture;if(z.isDepthTexture){const ai=qe.get(z),gi=qe.get(le),Vn=qe.get(ai.__renderTarget),on=qe.get(gi.__renderTarget);je.bindFramebuffer(J.READ_FRAMEBUFFER,Vn.__webglFramebuffer),je.bindFramebuffer(J.DRAW_FRAMEBUFFER,on.__webglFramebuffer);for(let Ji=0;Ji<vt;Ji++)sn&&(J.framebufferTextureLayer(J.READ_FRAMEBUFFER,J.COLOR_ATTACHMENT0,qe.get(z).__webglTexture,ce,Ye+Ji),J.framebufferTextureLayer(J.DRAW_FRAMEBUFFER,J.COLOR_ATTACHMENT0,qe.get(le).__webglTexture,Ge,nn+Ji)),J.blitFramebuffer(Bt,Rt,rt,dt,Mt,kt,rt,dt,J.DEPTH_BUFFER_BIT,J.NEAREST);je.bindFramebuffer(J.READ_FRAMEBUFFER,null),je.bindFramebuffer(J.DRAW_FRAMEBUFFER,null)}else if(ce!==0||z.isRenderTargetTexture||qe.has(z)){const ai=qe.get(z),gi=qe.get(le);je.bindFramebuffer(J.READ_FRAMEBUFFER,pc),je.bindFramebuffer(J.DRAW_FRAMEBUFFER,mc);for(let Vn=0;Vn<vt;Vn++)sn?J.framebufferTextureLayer(J.READ_FRAMEBUFFER,J.COLOR_ATTACHMENT0,ai.__webglTexture,ce,Ye+Vn):J.framebufferTexture2D(J.READ_FRAMEBUFFER,J.COLOR_ATTACHMENT0,J.TEXTURE_2D,ai.__webglTexture,ce),Ti?J.framebufferTextureLayer(J.DRAW_FRAMEBUFFER,J.COLOR_ATTACHMENT0,gi.__webglTexture,Ge,nn+Vn):J.framebufferTexture2D(J.DRAW_FRAMEBUFFER,J.COLOR_ATTACHMENT0,J.TEXTURE_2D,gi.__webglTexture,Ge),ce!==0?J.blitFramebuffer(Bt,Rt,rt,dt,Mt,kt,rt,dt,J.COLOR_BUFFER_BIT,J.NEAREST):Ti?J.copyTexSubImage3D(un,Ge,Mt,kt,nn+Vn,Bt,Rt,rt,dt):J.copyTexSubImage2D(un,Ge,Mt,kt,Bt,Rt,rt,dt);je.bindFramebuffer(J.READ_FRAMEBUFFER,null),je.bindFramebuffer(J.DRAW_FRAMEBUFFER,null)}else Ti?z.isDataTexture||z.isData3DTexture?J.texSubImage3D(un,Ge,Mt,kt,nn,rt,dt,vt,Qt,St,rn.data):le.isCompressedArrayTexture?J.compressedTexSubImage3D(un,Ge,Mt,kt,nn,rt,dt,vt,Qt,rn.data):J.texSubImage3D(un,Ge,Mt,kt,nn,rt,dt,vt,Qt,St,rn):z.isDataTexture?J.texSubImage2D(J.TEXTURE_2D,Ge,Mt,kt,rt,dt,Qt,St,rn.data):z.isCompressedTexture?J.compressedTexSubImage2D(J.TEXTURE_2D,Ge,Mt,kt,rn.width,rn.height,Qt,rn.data):J.texSubImage2D(J.TEXTURE_2D,Ge,Mt,kt,rt,dt,Qt,St,rn);J.pixelStorei(J.UNPACK_ROW_LENGTH,$t),J.pixelStorei(J.UNPACK_IMAGE_HEIGHT,mi),J.pixelStorei(J.UNPACK_SKIP_PIXELS,Ms),J.pixelStorei(J.UNPACK_SKIP_ROWS,oi),J.pixelStorei(J.UNPACK_SKIP_IMAGES,os),Ge===0&&le.generateMipmaps&&J.generateMipmap(un),je.unbindTexture()},this.copyTextureToTexture3D=function(z,le,Ae=null,de=null,ce=0){return z.isTexture!==!0&&(Df("WebGLRenderer: copyTextureToTexture3D function signature has changed."),Ae=arguments[0]||null,de=arguments[1]||null,z=arguments[2],le=arguments[3],ce=arguments[4]||0),Df('WebGLRenderer: copyTextureToTexture3D function has been deprecated. Use "copyTextureToTexture" instead.'),this.copyTextureToTexture(z,le,Ae,de,ce)},this.initRenderTarget=function(z){qe.get(z).__webglFramebuffer===void 0&&j.setupRenderTarget(z)},this.initTexture=function(z){z.isCubeTexture?j.setTextureCube(z,0):z.isData3DTexture?j.setTexture3D(z,0):z.isDataArrayTexture||z.isCompressedArrayTexture?j.setTexture2DArray(z,0):j.setTexture2D(z,0),je.unbindTexture()},this.resetState=function(){F=0,k=0,G=null,je.reset(),nt.reset()},typeof __THREE_DEVTOOLS__<"u"&&__THREE_DEVTOOLS__.dispatchEvent(new CustomEvent("observe",{detail:this}))}get coordinateSystem(){return Zs}get outputColorSpace(){return this._outputColorSpace}set outputColorSpace(e){this._outputColorSpace=e;const t=this.getContext();t.drawingBufferColorspace=gn._getDrawingBufferColorSpace(e),t.unpackColorSpace=gn._getUnpackColorSpace()}}const FE=Object.freeze(Object.defineProperty({__proto__:null,ACESFilmicToneMapping:H_,AddEquation:_l,AddOperation:sM,AdditiveAnimationBlendMode:Q_,AdditiveBlending:a_,AgXToneMapping:cM,AlphaFormat:W_,AlwaysCompare:CM,AlwaysDepth:Rg,AlwaysStencilFunc:f_,AmbientLight:hE,AnimationAction:ME,AnimationClip:Zf,AnimationLoader:pR,AnimationMixer:EE,AnimationObjectGroup:kR,AnimationUtils:cR,ArcCurve:zM,ArrayCamera:xE,ArrowHelper:aI,AttachedBindMode:c_,Audio:AE,AudioAnalyser:RR,AudioContext:wx,AudioListener:CR,AudioLoader:MR,AxesHelper:lI,BackSide:Ar,BasicDepthPacking:vM,BasicShadowMap:k2,BatchedMesh:kM,Bone:U0,BooleanKeyframeTrack:oc,Box2:KR,Box3:sr,Box3Helper:sI,BoxGeometry:sc,BoxHelper:TE,BufferAttribute:xn,BufferGeometry:Kt,BufferGeometryLoader:yE,ByteType:z_,Cache:Aa,Camera:ap,CameraHelper:rI,CanvasTexture:D3,CapsuleGeometry:z0,CatmullRomCurve3:GM,CineonToneMapping:lM,CircleGeometry:G0,ClampToEdgeWrapping:$r,Clock:Cx,Color:tt,ColorKeyframeTrack:_x,ColorManagement:gn,CompressedArrayTexture:B3,CompressedCubeTexture:L3,CompressedTexture:k0,CompressedTextureLoader:mR,ConeGeometry:V0,ConstantAlphaFactor:nM,ConstantColorFactor:eM,Controls:cI,CubeCamera:DM,CubeReflectionMapping:Ta,CubeRefractionMapping:wl,CubeTexture:lp,CubeTextureLoader:gR,CubeUVReflectionMapping:rd,CubicBezierCurve:cx,CubicBezierCurve3:VM,CubicInterpolant:aE,CullFaceBack:o_,CullFaceFront:O2,CullFaceFrontBack:JT,CullFaceNone:U2,Curve:ro,CurvePath:XM,CustomBlending:H2,CustomToneMapping:uM,CylinderGeometry:od,Cylindrical:JR,Data3DTexture:D0,DataArrayTexture:op,DataTexture:Eo,DataTextureLoader:vR,DataUtils:s3,DecrementStencilOp:rb,DecrementWrapStencilOp:ob,DefaultLoadingManager:cE,DepthFormat:Wu,DepthStencilFormat:Qu,DepthTexture:lx,DetachedBindMode:dM,DirectionalLight:Ex,DirectionalLightHelper:iI,DiscreteInterpolant:lE,DodecahedronGeometry:W0,DoubleSide:_s,DstAlphaFactor:Y2,DstColorFactor:q2,DynamicCopyUsage:Ab,DynamicDrawUsage:mb,DynamicReadUsage:yb,EdgesGeometry:jM,EllipseCurve:H0,EqualCompare:SM,EqualDepth:Pg,EqualStencilFunc:cb,EquirectangularReflectionMapping:Oh,EquirectangularRefractionMapping:kh,Euler:ns,EventDispatcher:Io,ExtrudeGeometry:j0,FileLoader:is,Float16BufferAttribute:d3,Float32BufferAttribute:Tt,FloatType:Or,Fog:N0,FogExp2:F0,FramebufferTexture:P3,FrontSide:To,Frustum:fp,GLBufferAttribute:jR,GLSL1:Mb,GLSL3:d_,GreaterCompare:MM,GreaterDepth:Lg,GreaterEqualCompare:wM,GreaterEqualDepth:Bg,GreaterEqualStencilFunc:pb,GreaterStencilFunc:db,GridHelper:tI,Group:xa,HalfFloatType:sd,HemisphereLight:dE,HemisphereLightHelper:eI,IcosahedronGeometry:J0,ImageBitmapLoader:_E,ImageLoader:Yh,ImageUtils:IM,IncrementStencilOp:ib,IncrementWrapStencilOp:sb,InstancedBufferAttribute:Zu,InstancedBufferGeometry:vE,InstancedInterleavedBuffer:XR,InstancedMesh:sx,Int16BufferAttribute:c3,Int32BufferAttribute:f3,Int8BufferAttribute:a3,IntType:C0,InterleavedBuffer:up,InterleavedBufferAttribute:Tl,Interpolant:ld,InterpolateDiscrete:Kf,InterpolateLinear:Yf,InterpolateSmooth:_g,InvertStencilOp:ab,KeepStencilOp:Bu,KeyframeTrack:so,LOD:OM,LatheGeometry:dp,Layers:ju,LessCompare:AM,LessDepth:Ig,LessEqualCompare:Z_,LessEqualDepth:Ku,LessEqualStencilFunc:fb,LessStencilFunc:ub,Light:Il,LightProbe:gE,Line:Ra,Line3:YR,LineBasicMaterial:or,LineCurve:fx,LineCurve3:WM,LineDashedMaterial:rE,LineLoop:ox,LineSegments:io,LinearFilter:ri,LinearInterpolant:yx,LinearMipMapLinearFilter:qT,LinearMipMapNearestFilter:QT,LinearMipmapLinearFilter:As,LinearMipmapNearestFilter:Gf,LinearSRGBColorSpace:qu,LinearToneMapping:oM,LinearTransfer:zh,Loader:ar,LoaderUtils:Sl,LoadingManager:xx,LoopOnce:hM,LoopPingPong:mM,LoopRepeat:pM,LuminanceAlphaFormat:J_,LuminanceFormat:j_,MOUSE:Iu,Material:Ei,MaterialLoader:ev,MathUtils:TM,Matrix2:Ix,Matrix3:Jt,Matrix4:Ot,MaxEquation:W2,Mesh:si,MeshBasicMaterial:es,MeshDepthMaterial:mx,MeshDistanceMaterial:gx,MeshLambertMaterial:nE,MeshMatcapMaterial:iE,MeshNormalMaterial:tE,MeshPhongMaterial:$M,MeshPhysicalMaterial:Ss,MeshStandardMaterial:mp,MeshToonMaterial:eE,MinEquation:V2,MirroredRepeatWrapping:jf,MixOperation:rM,MultiplyBlending:u_,MultiplyOperation:rp,NearestFilter:Di,NearestMipMapLinearFilter:YT,NearestMipMapNearestFilter:KT,NearestMipmapLinearFilter:Nu,NearestMipmapNearestFilter:w0,NeutralToneMapping:fM,NeverCompare:xM,NeverDepth:bg,NeverStencilFunc:lb,NoBlending:Ma,NoColorSpace:ya,NoToneMapping:Mo,NormalAnimationBlendMode:B0,NormalBlending:Vu,NotEqualCompare:EM,NotEqualDepth:Dg,NotEqualStencilFunc:hb,NumberKeyframeTrack:ec,Object3D:fn,ObjectLoader:AR,ObjectSpaceNormalMap:_M,OctahedronGeometry:hp,OneFactor:j2,OneMinusConstantAlphaFactor:iM,OneMinusConstantColorFactor:tM,OneMinusDstAlphaFactor:Q2,OneMinusDstColorFactor:Z2,OneMinusSrcAlphaFactor:Tg,OneMinusSrcColorFactor:K2,OrthographicCamera:eo,PCFShadowMap:M0,PCFSoftShadowMap:Th,PMREMGenerator:x_,Path:Xh,PerspectiveCamera:Hn,Plane:va,PlaneGeometry:ad,PlaneHelper:oI,PointLight:Mx,PointLightHelper:ZR,Points:ax,PointsMaterial:O0,PolarGridHelper:nI,PolyhedronGeometry:Rl,PositionalAudio:bR,PropertyBinding:mn,PropertyMixer:SE,QuadraticBezierCurve:dx,QuadraticBezierCurve3:hx,Quaternion:Fi,QuaternionKeyframeTrack:tc,QuaternionLinearInterpolant:uE,RED_GREEN_RGTC2_Format:s0,RED_RGTC1_Format:Y_,REVISION:ip,RGBADepthPacking:yM,RGBAFormat:rr,RGBAIntegerFormat:P0,RGBA_ASTC_10x10_Format:$g,RGBA_ASTC_10x5_Format:Qg,RGBA_ASTC_10x6_Format:qg,RGBA_ASTC_10x8_Format:Zg,RGBA_ASTC_12x10_Format:e0,RGBA_ASTC_12x12_Format:t0,RGBA_ASTC_4x4_Format:Gg,RGBA_ASTC_5x4_Format:Vg,RGBA_ASTC_5x5_Format:Wg,RGBA_ASTC_6x5_Format:Xg,RGBA_ASTC_6x6_Format:jg,RGBA_ASTC_8x5_Format:Jg,RGBA_ASTC_8x6_Format:Kg,RGBA_ASTC_8x8_Format:Yg,RGBA_BPTC_Format:Bh,RGBA_ETC2_EAC_Format:zg,RGBA_PVRTC_2BPPV1_Format:Og,RGBA_PVRTC_4BPPV1_Format:Ug,RGBA_S3TC_DXT1_Format:Rh,RGBA_S3TC_DXT3_Format:Ih,RGBA_S3TC_DXT5_Format:Ph,RGBDepthPacking:$T,RGBFormat:X_,RGBIntegerFormat:ZT,RGB_BPTC_SIGNED_Format:n0,RGB_BPTC_UNSIGNED_Format:i0,RGB_ETC1_Format:kg,RGB_ETC2_Format:Hg,RGB_PVRTC_2BPPV1_Format:Ng,RGB_PVRTC_4BPPV1_Format:Fg,RGB_S3TC_DXT1_Format:bh,RGDepthPacking:eb,RGFormat:K_,RGIntegerFormat:I0,RawShaderMaterial:ZM,Ray:rc,Raycaster:wE,RectAreaLight:pE,RedFormat:R0,RedIntegerFormat:sp,ReinhardToneMapping:aM,RenderTarget:L0,RenderTarget3D:zR,RenderTargetArray:GR,RepeatWrapping:Cl,ReplaceStencilOp:nb,ReverseSubtractEquation:G2,RingGeometry:K0,SIGNED_RED_GREEN_RGTC2_Format:o0,SIGNED_RED_RGTC1_Format:r0,SRGBColorSpace:Nr,SRGBTransfer:wn,Scene:nx,ShaderChunk:tn,ShaderLib:qs,ShaderMaterial:no,ShadowMaterial:qM,Shape:Ju,ShapeGeometry:Y0,ShapePath:uI,ShapeUtils:wo,ShortType:G_,Skeleton:cp,SkeletonHelper:qR,SkinnedMesh:rx,Source:ku,Sphere:ji,SphereGeometry:pp,Spherical:y_,SphericalHarmonics3:mE,SplineCurve:px,SpotLight:Sx,SpotLightHelper:QR,Sprite:UM,SpriteMaterial:ix,SrcAlphaFactor:Cg,SrcAlphaSaturateFactor:$2,SrcColorFactor:J2,StaticCopyUsage:xb,StaticDrawUsage:Gh,StaticReadUsage:vb,StereoCamera:ER,StreamCopyUsage:Sb,StreamDrawUsage:gb,StreamReadUsage:_b,StringKeyframeTrack:ac,SubtractEquation:z2,SubtractiveBlending:l_,TOUCH:Pu,TangentSpaceNormalMap:bl,TetrahedronGeometry:Q0,Texture:zn,TextureLoader:fE,TextureUtils:mI,TimestampQuery:Eb,TorusGeometry:q0,TorusKnotGeometry:Z0,Triangle:Ur,TriangleFanDrawMode:a0,TriangleStripDrawMode:q_,TrianglesDrawMode:gM,TubeGeometry:$0,UVMapping:E0,Uint16BufferAttribute:ex,Uint32BufferAttribute:tx,Uint8BufferAttribute:l3,Uint8ClampedBufferAttribute:u3,Uniform:Rx,UniformsGroup:WR,UniformsLib:lt,UniformsUtils:LM,UnsignedByteType:to,UnsignedInt248Type:Yu,UnsignedInt5999Type:V_,UnsignedIntType:ba,UnsignedShort4444Type:T0,UnsignedShort5551Type:b0,UnsignedShortType:Jf,VSMShadowMap:Qs,Vector2:Le,Vector3:X,Vector4:_n,VectorKeyframeTrack:nc,VideoFrameTexture:I3,VideoTexture:HM,WebGL3DRenderTarget:Yb,WebGLArrayRenderTarget:Kb,WebGLCoordinateSystem:Zs,WebGLCubeRenderTarget:FM,WebGLRenderTarget:bo,WebGLRenderer:DE,WebGLUtils:LE,WebGPUCoordinateSystem:Vh,WebXRController:xg,WireframeGeometry:QM,WrapAroundEnding:Hh,ZeroCurvatureEnding:Uu,ZeroFactor:X2,ZeroSlopeEnding:Ou,ZeroStencilOp:tb,createCanvasElement:RM},Symbol.toStringTag,{value:"Module"}));var Ry={exports:{}},vl={};/**
 * @license React
 * react-reconciler-constants.production.min.js
 *
 * Copyright (c) Facebook, Inc. and its affiliates.
 *
 * This source code is licensed under the MIT license found in the
 * LICENSE file in the root directory of this source tree.
 */var AS;function YD(){return AS||(AS=1,vl.ConcurrentRoot=1,vl.ContinuousEventPriority=4,vl.DefaultEventPriority=16,vl.DiscreteEventPriority=1,vl.IdleEventPriority=536870912,vl.LegacyRoot=0),vl}var SS;function QD(){return SS||(SS=1,Ry.exports=YD()),Ry.exports}var Hf=QD();function qD(i){let e;const t=new Set,n=(h,m)=>{const g=typeof h=="function"?h(e):h;if(g!==e){const v=e;e=m?g:Object.assign({},e,g),t.forEach(_=>_(e,v))}},r=()=>e,s=(h,m=r,g=Object.is)=>{console.warn("[DEPRECATED] Please use `subscribeWithSelector` middleware");let v=m(e);function _(){const A=m(e);if(!g(v,A)){const C=v;h(v=A,C)}}return t.add(_),()=>t.delete(_)},d={setState:n,getState:r,subscribe:(h,m,g)=>m||g?s(h,m,g):(t.add(h),()=>t.delete(h)),destroy:()=>t.clear()};return e=i(n,r,d),d}const ZD=typeof window>"u"||!window.navigator||/ServerSideRendering|^Deno\//.test(window.navigator.userAgent),MS=ZD?Y.useEffect:Y.useLayoutEffect;function $D(i){const e=typeof i=="function"?qD(i):i,t=(n=e.getState,r=Object.is)=>{const[,s]=Y.useReducer(M=>M+1,0),a=e.getState(),u=Y.useRef(a),d=Y.useRef(n),h=Y.useRef(r),m=Y.useRef(!1),g=Y.useRef();g.current===void 0&&(g.current=n(a));let v,_=!1;(u.current!==a||d.current!==n||h.current!==r||m.current)&&(v=n(a),_=!r(g.current,v)),MS(()=>{_&&(g.current=v),u.current=a,d.current=n,h.current=r,m.current=!1});const A=Y.useRef(a);MS(()=>{const M=()=>{try{const b=e.getState(),R=d.current(b);h.current(g.current,R)||(u.current=b,g.current=R,s())}catch{m.current=!0,s()}},S=e.subscribe(M);return e.getState()!==A.current&&M(),S},[]);const C=_?v:g.current;return Y.useDebugValue(C),C};return Object.assign(t,e),t[Symbol.iterator]=function(){console.warn("[useStore, api] = create() is deprecated and will be removed in v4");const n=[t,e];return{next(){const r=n.length<=0;return{value:n.shift(),done:r}}}},t}const eF=i=>typeof i=="object"&&typeof i.then=="function",zu=[];function NE(i,e,t=(n,r)=>n===r){if(i===e)return!0;if(!i||!e)return!1;const n=i.length;if(e.length!==n)return!1;for(let r=0;r<n;r++)if(!t(i[r],e[r]))return!1;return!0}function UE(i,e=null,t=!1,n={}){e===null&&(e=[i]);for(const s of zu)if(NE(e,s.keys,s.equal)){if(t)return;if(Object.prototype.hasOwnProperty.call(s,"error"))throw s.error;if(Object.prototype.hasOwnProperty.call(s,"response"))return n.lifespan&&n.lifespan>0&&(s.timeout&&clearTimeout(s.timeout),s.timeout=setTimeout(s.remove,n.lifespan)),s.response;if(!t)throw s.promise}const r={keys:e,equal:n.equal,remove:()=>{const s=zu.indexOf(r);s!==-1&&zu.splice(s,1)},promise:(eF(i)?i:i(...e)).then(s=>{r.response=s,n.lifespan&&n.lifespan>0&&(r.timeout=setTimeout(r.remove,n.lifespan))}).catch(s=>r.error=s)};if(zu.push(r),!t)throw r.promise}const tF=(i,e,t)=>UE(i,e,!1,t),nF=(i,e,t)=>void UE(i,e,!0,t),iF=i=>{if(i===void 0||i.length===0)zu.splice(0,zu.length);else{const e=zu.find(t=>NE(i,t.keys,t.equal));e&&e.remove()}};var Iy={exports:{}},Py={exports:{}},By={};/**
 * @license React
 * scheduler.production.min.js
 *
 * Copyright (c) Facebook, Inc. and its affiliates.
 *
 * This source code is licensed under the MIT license found in the
 * LICENSE file in the root directory of this source tree.
 */var ES;function rF(){return ES||(ES=1,function(i){function e(H,Z){var q=H.length;H.push(Z);e:for(;0<q;){var W=q-1>>>1,ne=H[W];if(0<r(ne,Z))H[W]=Z,H[q]=ne,q=W;else break e}}function t(H){return H.length===0?null:H[0]}function n(H){if(H.length===0)return null;var Z=H[0],q=H.pop();if(q!==Z){H[0]=q;e:for(var W=0,ne=H.length,Fe=ne>>>1;W<Fe;){var ae=2*(W+1)-1,we=H[ae],De=ae+1,Ie=H[De];if(0>r(we,q))De<ne&&0>r(Ie,we)?(H[W]=Ie,H[De]=q,W=De):(H[W]=we,H[ae]=q,W=ae);else if(De<ne&&0>r(Ie,q))H[W]=Ie,H[De]=q,W=De;else break e}}return Z}function r(H,Z){var q=H.sortIndex-Z.sortIndex;return q!==0?q:H.id-Z.id}if(typeof performance=="object"&&typeof performance.now=="function"){var s=performance;i.unstable_now=function(){return s.now()}}else{var a=Date,u=a.now();i.unstable_now=function(){return a.now()-u}}var d=[],h=[],m=1,g=null,v=3,_=!1,A=!1,C=!1,M=typeof setTimeout=="function"?setTimeout:null,S=typeof clearTimeout=="function"?clearTimeout:null,b=typeof setImmediate<"u"?setImmediate:null;typeof navigator<"u"&&navigator.scheduling!==void 0&&navigator.scheduling.isInputPending!==void 0&&navigator.scheduling.isInputPending.bind(navigator.scheduling);function R(H){for(var Z=t(h);Z!==null;){if(Z.callback===null)n(h);else if(Z.startTime<=H)n(h),Z.sortIndex=Z.expirationTime,e(d,Z);else break;Z=t(h)}}function P(H){if(C=!1,R(H),!A)if(t(d)!==null)A=!0,he(U);else{var Z=t(h);Z!==null&&_e(P,Z.startTime-H)}}function U(H,Z){A=!1,C&&(C=!1,S(G),G=-1),_=!0;var q=v;try{for(R(Z),g=t(d);g!==null&&(!(g.expirationTime>Z)||H&&!V());){var W=g.callback;if(typeof W=="function"){g.callback=null,v=g.priorityLevel;var ne=W(g.expirationTime<=Z);Z=i.unstable_now(),typeof ne=="function"?g.callback=ne:g===t(d)&&n(d),R(Z)}else n(d);g=t(d)}if(g!==null)var Fe=!0;else{var ae=t(h);ae!==null&&_e(P,ae.startTime-Z),Fe=!1}return Fe}finally{g=null,v=q,_=!1}}var F=!1,k=null,G=-1,D=5,L=-1;function V(){return!(i.unstable_now()-L<D)}function oe(){if(k!==null){var H=i.unstable_now();L=H;var Z=!0;try{Z=k(!0,H)}finally{Z?ie():(F=!1,k=null)}}else F=!1}var ie;if(typeof b=="function")ie=function(){b(oe)};else if(typeof MessageChannel<"u"){var ge=new MessageChannel,ye=ge.port2;ge.port1.onmessage=oe,ie=function(){ye.postMessage(null)}}else ie=function(){M(oe,0)};function he(H){k=H,F||(F=!0,ie())}function _e(H,Z){G=M(function(){H(i.unstable_now())},Z)}i.unstable_IdlePriority=5,i.unstable_ImmediatePriority=1,i.unstable_LowPriority=4,i.unstable_NormalPriority=3,i.unstable_Profiling=null,i.unstable_UserBlockingPriority=2,i.unstable_cancelCallback=function(H){H.callback=null},i.unstable_continueExecution=function(){A||_||(A=!0,he(U))},i.unstable_forceFrameRate=function(H){0>H||125<H?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):D=0<H?Math.floor(1e3/H):5},i.unstable_getCurrentPriorityLevel=function(){return v},i.unstable_getFirstCallbackNode=function(){return t(d)},i.unstable_next=function(H){switch(v){case 1:case 2:case 3:var Z=3;break;default:Z=v}var q=v;v=Z;try{return H()}finally{v=q}},i.unstable_pauseExecution=function(){},i.unstable_requestPaint=function(){},i.unstable_runWithPriority=function(H,Z){switch(H){case 1:case 2:case 3:case 4:case 5:break;default:H=3}var q=v;v=H;try{return Z()}finally{v=q}},i.unstable_scheduleCallback=function(H,Z,q){var W=i.unstable_now();switch(typeof q=="object"&&q!==null?(q=q.delay,q=typeof q=="number"&&0<q?W+q:W):q=W,H){case 1:var ne=-1;break;case 2:ne=250;break;case 5:ne=1073741823;break;case 4:ne=1e4;break;default:ne=5e3}return ne=q+ne,H={id:m++,callback:Z,priorityLevel:H,startTime:q,expirationTime:ne,sortIndex:-1},q>W?(H.sortIndex=q,e(h,H),t(d)===null&&H===t(h)&&(C?(S(G),G=-1):C=!0,_e(P,q-W))):(H.sortIndex=ne,e(d,H),A||_||(A=!0,he(U))),H},i.unstable_shouldYield=V,i.unstable_wrapCallback=function(H){var Z=v;return function(){var q=v;v=Z;try{return H.apply(this,arguments)}finally{v=q}}}}(By)),By}var wS;function sF(){return wS||(wS=1,Py.exports=rF()),Py.exports}/**
 * @license React
 * react-reconciler.production.min.js
 *
 * Copyright (c) Facebook, Inc. and its affiliates.
 *
 * This source code is licensed under the MIT license found in the
 * LICENSE file in the root directory of this source tree.
 */var Ly,CS;function oF(){return CS||(CS=1,Ly=function(e){var t={},n=td(),r=sF(),s=Object.assign;function a(c){for(var f="https://reactjs.org/docs/error-decoder.html?invariant="+c,y=1;y<arguments.length;y++)f+="&args[]="+encodeURIComponent(arguments[y]);return"Minified React error #"+c+"; visit "+f+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}var u=n.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED,d=Symbol.for("react.element"),h=Symbol.for("react.portal"),m=Symbol.for("react.fragment"),g=Symbol.for("react.strict_mode"),v=Symbol.for("react.profiler"),_=Symbol.for("react.provider"),A=Symbol.for("react.context"),C=Symbol.for("react.forward_ref"),M=Symbol.for("react.suspense"),S=Symbol.for("react.suspense_list"),b=Symbol.for("react.memo"),R=Symbol.for("react.lazy"),P=Symbol.for("react.offscreen"),U=Symbol.iterator;function F(c){return c===null||typeof c!="object"?null:(c=U&&c[U]||c["@@iterator"],typeof c=="function"?c:null)}function k(c){if(c==null)return null;if(typeof c=="function")return c.displayName||c.name||null;if(typeof c=="string")return c;switch(c){case m:return"Fragment";case h:return"Portal";case v:return"Profiler";case g:return"StrictMode";case M:return"Suspense";case S:return"SuspenseList"}if(typeof c=="object")switch(c.$$typeof){case A:return(c.displayName||"Context")+".Consumer";case _:return(c._context.displayName||"Context")+".Provider";case C:var f=c.render;return c=c.displayName,c||(c=f.displayName||f.name||"",c=c!==""?"ForwardRef("+c+")":"ForwardRef"),c;case b:return f=c.displayName||null,f!==null?f:k(c.type)||"Memo";case R:f=c._payload,c=c._init;try{return k(c(f))}catch{}}return null}function G(c){var f=c.type;switch(c.tag){case 24:return"Cache";case 9:return(f.displayName||"Context")+".Consumer";case 10:return(f._context.displayName||"Context")+".Provider";case 18:return"DehydratedFragment";case 11:return c=f.render,c=c.displayName||c.name||"",f.displayName||(c!==""?"ForwardRef("+c+")":"ForwardRef");case 7:return"Fragment";case 5:return f;case 4:return"Portal";case 3:return"Root";case 6:return"Text";case 16:return k(f);case 8:return f===g?"StrictMode":"Mode";case 22:return"Offscreen";case 12:return"Profiler";case 21:return"Scope";case 13:return"Suspense";case 19:return"SuspenseList";case 25:return"TracingMarker";case 1:case 0:case 17:case 2:case 14:case 15:if(typeof f=="function")return f.displayName||f.name||null;if(typeof f=="string")return f}return null}function D(c){var f=c,y=c;if(c.alternate)for(;f.return;)f=f.return;else{c=f;do f=c,f.flags&4098&&(y=f.return),c=f.return;while(c)}return f.tag===3?y:null}function L(c){if(D(c)!==c)throw Error(a(188))}function V(c){var f=c.alternate;if(!f){if(f=D(c),f===null)throw Error(a(188));return f!==c?null:c}for(var y=c,E=f;;){var T=y.return;if(T===null)break;var B=T.alternate;if(B===null){if(E=T.return,E!==null){y=E;continue}break}if(T.child===B.child){for(B=T.child;B;){if(B===y)return L(T),c;if(B===E)return L(T),f;B=B.sibling}throw Error(a(188))}if(y.return!==E.return)y=T,E=B;else{for(var K=!1,se=T.child;se;){if(se===y){K=!0,y=T,E=B;break}if(se===E){K=!0,E=T,y=B;break}se=se.sibling}if(!K){for(se=B.child;se;){if(se===y){K=!0,y=B,E=T;break}if(se===E){K=!0,E=B,y=T;break}se=se.sibling}if(!K)throw Error(a(189))}}if(y.alternate!==E)throw Error(a(190))}if(y.tag!==3)throw Error(a(188));return y.stateNode.current===y?c:f}function oe(c){return c=V(c),c!==null?ie(c):null}function ie(c){if(c.tag===5||c.tag===6)return c;for(c=c.child;c!==null;){var f=ie(c);if(f!==null)return f;c=c.sibling}return null}function ge(c){if(c.tag===5||c.tag===6)return c;for(c=c.child;c!==null;){if(c.tag!==4){var f=ge(c);if(f!==null)return f}c=c.sibling}return null}var ye=Array.isArray,he=e.getPublicInstance,_e=e.getRootHostContext,H=e.getChildHostContext,Z=e.prepareForCommit,q=e.resetAfterCommit,W=e.createInstance,ne=e.appendInitialChild,Fe=e.finalizeInitialChildren,ae=e.prepareUpdate,we=e.shouldSetTextContent,De=e.createTextInstance,Ie=e.scheduleTimeout,Xe=e.cancelTimeout,_t=e.noTimeout,Je=e.isPrimaryRenderer,st=e.supportsMutation,Ne=e.supportsPersistence,be=e.supportsHydration,J=e.getInstanceFromNode,mt=e.preparePortalMount,ke=e.getCurrentEventPriority,et=e.detachDeletedInstance,je=e.supportsMicrotasks,wt=e.scheduleMicrotask,qe=e.supportsTestSelectors,j=e.findFiberRoot,O=e.getBoundingRect,pe=e.getTextContent,Ce=e.isHiddenSubtree,Ue=e.matchAccessibilityRole,Pe=e.setFocusIfFocusable,ot=e.setupIntersectionObserver,Ze=e.appendChild,ct=e.appendChildToContainer,zt=e.commitTextUpdate,ze=e.commitMount,gt=e.commitUpdate,Pt=e.insertBefore,Dt=e.insertInContainerBefore,ht=e.removeChild,ee=e.removeChildFromContainer,Re=e.resetTextContent,nt=e.hideInstance,$=e.hideTextInstance,Ve=e.unhideInstance,Me=e.unhideTextInstance,Be=e.clearContainer,ut=e.cloneInstance,it=e.createContainerChildSet,It=e.appendChildToContainerChildSet,ln=e.finalizeContainerChildren,Cn=e.replaceContainerChildren,Yt=e.cloneHiddenInstance,Gn=e.cloneHiddenTextInstance,Kn=e.canHydrateInstance,Ba=e.canHydrateTextInstance,oo=e.canHydrateSuspenseInstance,rs=e.isSuspenseInstancePending,kr=e.isSuspenseInstanceFallback,Po=e.registerSuspenseInstanceRetry,Hr=e.getNextHydratableSibling,ao=e.getFirstHydratableChild,lc=e.getFirstHydratableChildWithinContainer,La=e.getFirstHydratableChildWithinSuspenseInstance,uc=e.hydrateInstance,ss=e.hydrateTextInstance,cc=e.hydrateSuspenseInstance,fc=e.getNextHydratableInstanceAfterSuspenseInstance,dc=e.commitHydratedContainer,hc=e.commitHydratedSuspenseInstance,pc=e.clearSuspenseBoundary,mc=e.clearSuspenseBoundaryFromContainer,z=e.shouldDeleteUnhydratedTailInstances,le=e.didNotMatchHydratedContainerTextInstance,Ae=e.didNotMatchHydratedTextInstance,de;function ce(c){if(de===void 0)try{throw Error()}catch(y){var f=y.stack.trim().match(/\n( *(at )?)/);de=f&&f[1]||""}return`
`+de+c}var Ge=!1;function rt(c,f){if(!c||Ge)return"";Ge=!0;var y=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{if(f)if(f=function(){throw Error()},Object.defineProperty(f.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(f,[])}catch(Ke){var E=Ke}Reflect.construct(c,[],f)}else{try{f.call()}catch(Ke){E=Ke}c.call(f.prototype)}else{try{throw Error()}catch(Ke){E=Ke}c()}}catch(Ke){if(Ke&&E&&typeof Ke.stack=="string"){for(var T=Ke.stack.split(`
`),B=E.stack.split(`
`),K=T.length-1,se=B.length-1;1<=K&&0<=se&&T[K]!==B[se];)se--;for(;1<=K&&0<=se;K--,se--)if(T[K]!==B[se]){if(K!==1||se!==1)do if(K--,se--,0>se||T[K]!==B[se]){var Te=`
`+T[K].replace(" at new "," at ");return c.displayName&&Te.includes("<anonymous>")&&(Te=Te.replace("<anonymous>",c.displayName)),Te}while(1<=K&&0<=se);break}}}finally{Ge=!1,Error.prepareStackTrace=y}return(c=c?c.displayName||c.name:"")?ce(c):""}var dt=Object.prototype.hasOwnProperty,vt=[],Bt=-1;function Rt(c){return{current:c}}function Ye(c){0>Bt||(c.current=vt[Bt],vt[Bt]=null,Bt--)}function Mt(c,f){Bt++,vt[Bt]=c.current,c.current=f}var kt={},nn=Rt(kt),rn=Rt(!1),Qt=kt;function St(c,f){var y=c.type.contextTypes;if(!y)return kt;var E=c.stateNode;if(E&&E.__reactInternalMemoizedUnmaskedChildContext===f)return E.__reactInternalMemoizedMaskedChildContext;var T={},B;for(B in y)T[B]=f[B];return E&&(c=c.stateNode,c.__reactInternalMemoizedUnmaskedChildContext=f,c.__reactInternalMemoizedMaskedChildContext=T),T}function un(c){return c=c.childContextTypes,c!=null}function $t(){Ye(rn),Ye(nn)}function mi(c,f,y){if(nn.current!==kt)throw Error(a(168));Mt(nn,f),Mt(rn,y)}function Ms(c,f,y){var E=c.stateNode;if(f=f.childContextTypes,typeof E.getChildContext!="function")return y;E=E.getChildContext();for(var T in E)if(!(T in f))throw Error(a(108,G(c)||"Unknown",T));return s({},y,E)}function oi(c){return c=(c=c.stateNode)&&c.__reactInternalMemoizedMergedChildContext||kt,Qt=nn.current,Mt(nn,c),Mt(rn,rn.current),!0}function os(c,f,y){var E=c.stateNode;if(!E)throw Error(a(169));y?(c=Ms(c,f,Qt),E.__reactInternalMemoizedMergedChildContext=c,Ye(rn),Ye(nn),Mt(nn,c)):Ye(rn),Mt(rn,y)}var sn=Math.clz32?Math.clz32:gi,Ti=Math.log,ai=Math.LN2;function gi(c){return c>>>=0,c===0?32:31-(Ti(c)/ai|0)|0}var Vn=64,on=4194304;function Ji(c){switch(c&-c){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return c&4194240;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return c&130023424;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 1073741824;default:return c}}function Pl(c,f){var y=c.pendingLanes;if(y===0)return 0;var E=0,T=c.suspendedLanes,B=c.pingedLanes,K=y&268435455;if(K!==0){var se=K&~T;se!==0?E=Ji(se):(B&=K,B!==0&&(E=Ji(B)))}else K=y&~T,K!==0?E=Ji(K):B!==0&&(E=Ji(B));if(E===0)return 0;if(f!==0&&f!==E&&!(f&T)&&(T=E&-E,B=f&-f,T>=B||T===16&&(B&4194240)!==0))return f;if(E&4&&(E|=y&16),f=c.entangledLanes,f!==0)for(c=c.entanglements,f&=E;0<f;)y=31-sn(f),T=1<<y,E|=c[y],f&=~T;return E}function cd(c,f){switch(c){case 1:case 2:case 4:return f+250;case 8:case 16:case 32:case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return f+5e3;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return-1;case 134217728:case 268435456:case 536870912:case 1073741824:return-1;default:return-1}}function Mp(c,f){for(var y=c.suspendedLanes,E=c.pingedLanes,T=c.expirationTimes,B=c.pendingLanes;0<B;){var K=31-sn(B),se=1<<K,Te=T[K];Te===-1?(!(se&y)||se&E)&&(T[K]=cd(se,f)):Te<=f&&(c.expiredLanes|=se),B&=~se}}function gc(c){return c=c.pendingLanes&-1073741825,c!==0?c:c&1073741824?1073741824:0}function vc(c){for(var f=[],y=0;31>y;y++)f.push(c);return f}function Bo(c,f,y){c.pendingLanes|=f,f!==536870912&&(c.suspendedLanes=0,c.pingedLanes=0),c=c.eventTimes,f=31-sn(f),c[f]=y}function yc(c,f){var y=c.pendingLanes&~f;c.pendingLanes=f,c.suspendedLanes=0,c.pingedLanes=0,c.expiredLanes&=f,c.mutableReadLanes&=f,c.entangledLanes&=f,f=c.entanglements;var E=c.eventTimes;for(c=c.expirationTimes;0<y;){var T=31-sn(y),B=1<<T;f[T]=0,E[T]=-1,c[T]=-1,y&=~B}}function as(c,f){var y=c.entangledLanes|=f;for(c=c.entanglements;y;){var E=31-sn(y),T=1<<E;T&f|c[E]&f&&(c[E]|=f),y&=~T}}var en=0;function Es(c){return c&=-c,1<c?4<c?c&268435455?16:536870912:4:1}var Lo=r.unstable_scheduleCallback,Da=r.unstable_cancelCallback,lo=r.unstable_shouldYield,ov=r.unstable_requestPaint,ei=r.unstable_now,Do=r.unstable_ImmediatePriority,av=r.unstable_UserBlockingPriority,_c=r.unstable_NormalPriority,xc=r.unstable_IdlePriority,Bl=null,ls=null;function Ll(c){if(ls&&typeof ls.onCommitFiberRoot=="function")try{ls.onCommitFiberRoot(Bl,c,void 0,(c.current.flags&128)===128)}catch{}}function Dl(c,f){return c===f&&(c!==0||1/c===1/f)||c!==c&&f!==f}var Ni=typeof Object.is=="function"?Object.is:Dl,Sr=null,Ac=!1,fd=!1;function Sc(c){Sr===null?Sr=[c]:Sr.push(c)}function Mc(c){Ac=!0,Sc(c)}function Mr(){if(!fd&&Sr!==null){fd=!0;var c=0,f=en;try{var y=Sr;for(en=1;c<y.length;c++){var E=y[c];do E=E(!0);while(E!==null)}Sr=null,Ac=!1}catch(T){throw Sr!==null&&(Sr=Sr.slice(c+1)),Lo(Do,Mr),T}finally{en=f,fd=!1}}return null}var Ep=u.ReactCurrentBatchConfig;function zr(c,f){if(Ni(c,f))return!0;if(typeof c!="object"||c===null||typeof f!="object"||f===null)return!1;var y=Object.keys(c),E=Object.keys(f);if(y.length!==E.length)return!1;for(E=0;E<y.length;E++){var T=y[E];if(!dt.call(f,T)||!Ni(c[T],f[T]))return!1}return!0}function dd(c){switch(c.tag){case 5:return ce(c.type);case 16:return ce("Lazy");case 13:return ce("Suspense");case 19:return ce("SuspenseList");case 0:case 2:case 15:return c=rt(c.type,!1),c;case 11:return c=rt(c.type.render,!1),c;case 1:return c=rt(c.type,!0),c;default:return""}}function Ki(c,f){if(c&&c.defaultProps){f=s({},f),c=c.defaultProps;for(var y in c)f[y]===void 0&&(f[y]=c[y]);return f}return f}var Fl=Rt(null),Fo=null,ws=null,Ec=null;function Ui(){Ec=ws=Fo=null}function No(c,f,y){Je?(Mt(Fl,f._currentValue),f._currentValue=y):(Mt(Fl,f._currentValue2),f._currentValue2=y)}function Nl(c){var f=Fl.current;Ye(Fl),Je?c._currentValue=f:c._currentValue2=f}function Uo(c,f,y){for(;c!==null;){var E=c.alternate;if((c.childLanes&f)!==f?(c.childLanes|=f,E!==null&&(E.childLanes|=f)):E!==null&&(E.childLanes&f)!==f&&(E.childLanes|=f),c===y)break;c=c.return}}function Fa(c,f){Fo=c,Ec=ws=null,c=c.dependencies,c!==null&&c.firstContext!==null&&(c.lanes&f&&(fi=!0),c.firstContext=null)}function Yi(c){var f=Je?c._currentValue:c._currentValue2;if(Ec!==c)if(c={context:c,memoizedValue:f,next:null},ws===null){if(Fo===null)throw Error(a(308));ws=c,Fo.dependencies={lanes:0,firstContext:c}}else ws=ws.next=c;return f}var Er=null,wr=!1;function Na(c){c.updateQueue={baseState:c.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,interleaved:null,lanes:0},effects:null}}function hd(c,f){c=c.updateQueue,f.updateQueue===c&&(f.updateQueue={baseState:c.baseState,firstBaseUpdate:c.firstBaseUpdate,lastBaseUpdate:c.lastBaseUpdate,shared:c.shared,effects:c.effects})}function Cs(c,f){return{eventTime:c,lane:f,tag:0,payload:null,callback:null,next:null}}function uo(c,f){var y=c.updateQueue;y!==null&&(y=y.shared,Xn!==null&&c.mode&1&&!(jt&2)?(c=y.interleaved,c===null?(f.next=f,Er===null?Er=[y]:Er.push(y)):(f.next=c.next,c.next=f),y.interleaved=f):(c=y.pending,c===null?f.next=f:(f.next=c.next,c.next=f),y.pending=f))}function wc(c,f,y){if(f=f.updateQueue,f!==null&&(f=f.shared,(y&4194240)!==0)){var E=f.lanes;E&=c.pendingLanes,y|=E,f.lanes=y,as(c,y)}}function Cc(c,f){var y=c.updateQueue,E=c.alternate;if(E!==null&&(E=E.updateQueue,y===E)){var T=null,B=null;if(y=y.firstBaseUpdate,y!==null){do{var K={eventTime:y.eventTime,lane:y.lane,tag:y.tag,payload:y.payload,callback:y.callback,next:null};B===null?T=B=K:B=B.next=K,y=y.next}while(y!==null);B===null?T=B=f:B=B.next=f}else T=B=f;y={baseState:E.baseState,firstBaseUpdate:T,lastBaseUpdate:B,shared:E.shared,effects:E.effects},c.updateQueue=y;return}c=y.lastBaseUpdate,c===null?y.firstBaseUpdate=f:c.next=f,y.lastBaseUpdate=f}function Tc(c,f,y,E){var T=c.updateQueue;wr=!1;var B=T.firstBaseUpdate,K=T.lastBaseUpdate,se=T.shared.pending;if(se!==null){T.shared.pending=null;var Te=se,Ke=Te.next;Te.next=null,K===null?B=Ke:K.next=Ke,K=Te;var yt=c.alternate;yt!==null&&(yt=yt.updateQueue,se=yt.lastBaseUpdate,se!==K&&(se===null?yt.firstBaseUpdate=Ke:se.next=Ke,yt.lastBaseUpdate=Te))}if(B!==null){var Gt=T.baseState;K=0,yt=Ke=Te=null,se=B;do{var Lt=se.lane,qt=se.eventTime;if((E&Lt)===Lt){yt!==null&&(yt=yt.next={eventTime:qt,lane:0,tag:se.tag,payload:se.payload,callback:se.callback,next:null});e:{var ft=c,Si=se;switch(Lt=f,qt=y,Si.tag){case 1:if(ft=Si.payload,typeof ft=="function"){Gt=ft.call(qt,Gt,Lt);break e}Gt=ft;break e;case 3:ft.flags=ft.flags&-65537|128;case 0:if(ft=Si.payload,Lt=typeof ft=="function"?ft.call(qt,Gt,Lt):ft,Lt==null)break e;Gt=s({},Gt,Lt);break e;case 2:wr=!0}}se.callback!==null&&se.lane!==0&&(c.flags|=64,Lt=T.effects,Lt===null?T.effects=[se]:Lt.push(se))}else qt={eventTime:qt,lane:Lt,tag:se.tag,payload:se.payload,callback:se.callback,next:null},yt===null?(Ke=yt=qt,Te=Gt):yt=yt.next=qt,K|=Lt;if(se=se.next,se===null){if(se=T.shared.pending,se===null)break;Lt=se,se=Lt.next,Lt.next=null,T.lastBaseUpdate=Lt,T.shared.pending=null}}while(!0);if(yt===null&&(Te=Gt),T.baseState=Te,T.firstBaseUpdate=Ke,T.lastBaseUpdate=yt,f=T.shared.interleaved,f!==null){T=f;do K|=T.lane,T=T.next;while(T!==f)}else B===null&&(T.shared.lanes=0);ds|=K,c.lanes=K,c.memoizedState=Gt}}function wp(c,f,y){if(c=f.effects,f.effects=null,c!==null)for(f=0;f<c.length;f++){var E=c[f],T=E.callback;if(T!==null){if(E.callback=null,E=y,typeof T!="function")throw Error(a(191,T));T.call(E)}}}var Cp=new n.Component().refs;function pd(c,f,y,E){f=c.memoizedState,y=y(E,f),y=y==null?f:s({},f,y),c.memoizedState=y,c.lanes===0&&(c.updateQueue.baseState=y)}var bc={isMounted:function(c){return(c=c._reactInternals)?D(c)===c:!1},enqueueSetState:function(c,f,y){c=c._reactInternals;var E=pn(),T=Kr(c),B=Cs(E,T);B.payload=f,y!=null&&(B.callback=y),uo(c,B),f=Ii(c,T,E),f!==null&&wc(f,c,T)},enqueueReplaceState:function(c,f,y){c=c._reactInternals;var E=pn(),T=Kr(c),B=Cs(E,T);B.tag=1,B.payload=f,y!=null&&(B.callback=y),uo(c,B),f=Ii(c,T,E),f!==null&&wc(f,c,T)},enqueueForceUpdate:function(c,f){c=c._reactInternals;var y=pn(),E=Kr(c),T=Cs(y,E);T.tag=2,f!=null&&(T.callback=f),uo(c,T),f=Ii(c,E,y),f!==null&&wc(f,c,E)}};function md(c,f,y,E,T,B,K){return c=c.stateNode,typeof c.shouldComponentUpdate=="function"?c.shouldComponentUpdate(E,B,K):f.prototype&&f.prototype.isPureReactComponent?!zr(y,E)||!zr(T,B):!0}function Tp(c,f,y){var E=!1,T=kt,B=f.contextType;return typeof B=="object"&&B!==null?B=Yi(B):(T=un(f)?Qt:nn.current,E=f.contextTypes,B=(E=E!=null)?St(c,T):kt),f=new f(y,B),c.memoizedState=f.state!==null&&f.state!==void 0?f.state:null,f.updater=bc,c.stateNode=f,f._reactInternals=c,E&&(c=c.stateNode,c.__reactInternalMemoizedUnmaskedChildContext=T,c.__reactInternalMemoizedMaskedChildContext=B),f}function bp(c,f,y,E){c=f.state,typeof f.componentWillReceiveProps=="function"&&f.componentWillReceiveProps(y,E),typeof f.UNSAFE_componentWillReceiveProps=="function"&&f.UNSAFE_componentWillReceiveProps(y,E),f.state!==c&&bc.enqueueReplaceState(f,f.state,null)}function gd(c,f,y,E){var T=c.stateNode;T.props=y,T.state=c.memoizedState,T.refs=Cp,Na(c);var B=f.contextType;typeof B=="object"&&B!==null?T.context=Yi(B):(B=un(f)?Qt:nn.current,T.context=St(c,B)),T.state=c.memoizedState,B=f.getDerivedStateFromProps,typeof B=="function"&&(pd(c,f,B,y),T.state=c.memoizedState),typeof f.getDerivedStateFromProps=="function"||typeof T.getSnapshotBeforeUpdate=="function"||typeof T.UNSAFE_componentWillMount!="function"&&typeof T.componentWillMount!="function"||(f=T.state,typeof T.componentWillMount=="function"&&T.componentWillMount(),typeof T.UNSAFE_componentWillMount=="function"&&T.UNSAFE_componentWillMount(),f!==T.state&&bc.enqueueReplaceState(T,T.state,null),Tc(c,y,T,E),T.state=c.memoizedState),typeof T.componentDidMount=="function"&&(c.flags|=4194308)}var Ua=[],co=0,Rc=null,Ic=0,Cr=[],lr=0,Oo=null,Ts=1,bs="";function ko(c,f){Ua[co++]=Ic,Ua[co++]=Rc,Rc=c,Ic=f}function Rp(c,f,y){Cr[lr++]=Ts,Cr[lr++]=bs,Cr[lr++]=Oo,Oo=c;var E=Ts;c=bs;var T=32-sn(E)-1;E&=~(1<<T),y+=1;var B=32-sn(f)+T;if(30<B){var K=T-T%5;B=(E&(1<<K)-1).toString(32),E>>=K,T-=K,Ts=1<<32-sn(f)+T|y<<T|E,bs=B+c}else Ts=1<<B|y<<T|E,bs=c}function vd(c){c.return!==null&&(ko(c,1),Rp(c,1,0))}function yd(c){for(;c===Rc;)Rc=Ua[--co],Ua[co]=null,Ic=Ua[--co],Ua[co]=null;for(;c===Oo;)Oo=Cr[--lr],Cr[lr]=null,bs=Cr[--lr],Cr[lr]=null,Ts=Cr[--lr],Cr[lr]=null}var Oi=null,vi=null,Bn=!1,Oa=!1,Tr=null;function _d(c,f){var y=mr(5,null,null,0);y.elementType="DELETED",y.stateNode=f,y.return=c,f=c.deletions,f===null?(c.deletions=[y],c.flags|=16):f.push(y)}function xd(c,f){switch(c.tag){case 5:return f=Kn(f,c.type,c.pendingProps),f!==null?(c.stateNode=f,Oi=c,vi=ao(f),!0):!1;case 6:return f=Ba(f,c.pendingProps),f!==null?(c.stateNode=f,Oi=c,vi=null,!0):!1;case 13:if(f=oo(f),f!==null){var y=Oo!==null?{id:Ts,overflow:bs}:null;return c.memoizedState={dehydrated:f,treeContext:y,retryLane:1073741824},y=mr(18,null,null,0),y.stateNode=f,y.return=c,c.child=y,Oi=c,vi=null,!0}return!1;default:return!1}}function Pc(c){return(c.mode&1)!==0&&(c.flags&128)===0}function fo(c){if(Bn){var f=vi;if(f){var y=f;if(!xd(c,f)){if(Pc(c))throw Error(a(418));f=Hr(y);var E=Oi;f&&xd(c,f)?_d(E,y):(c.flags=c.flags&-4097|2,Bn=!1,Oi=c)}}else{if(Pc(c))throw Error(a(418));c.flags=c.flags&-4097|2,Bn=!1,Oi=c}}}function Ip(c){for(c=c.return;c!==null&&c.tag!==5&&c.tag!==3&&c.tag!==13;)c=c.return;Oi=c}function Ul(c){if(!be||c!==Oi)return!1;if(!Bn)return Ip(c),Bn=!0,!1;if(c.tag!==3&&(c.tag!==5||z(c.type)&&!we(c.type,c.memoizedProps))){var f=vi;if(f){if(Pc(c)){for(c=vi;c;)c=Hr(c);throw Error(a(418))}for(;f;)_d(c,f),f=Hr(f)}}if(Ip(c),c.tag===13){if(!be)throw Error(a(316));if(c=c.memoizedState,c=c!==null?c.dehydrated:null,!c)throw Error(a(317));vi=fc(c)}else vi=Oi?Hr(c.stateNode):null;return!0}function ka(){be&&(vi=Oi=null,Oa=Bn=!1)}function Bc(c){Tr===null?Tr=[c]:Tr.push(c)}function Ha(c,f,y){if(c=y.ref,c!==null&&typeof c!="function"&&typeof c!="object"){if(y._owner){if(y=y._owner,y){if(y.tag!==1)throw Error(a(309));var E=y.stateNode}if(!E)throw Error(a(147,c));var T=E,B=""+c;return f!==null&&f.ref!==null&&typeof f.ref=="function"&&f.ref._stringRef===B?f.ref:(f=function(K){var se=T.refs;se===Cp&&(se=T.refs={}),K===null?delete se[B]:se[B]=K},f._stringRef=B,f)}if(typeof c!="string")throw Error(a(284));if(!y._owner)throw Error(a(290,c))}return c}function ho(c,f){throw c=Object.prototype.toString.call(f),Error(a(31,c==="[object Object]"?"object with keys {"+Object.keys(f).join(", ")+"}":c))}function za(c){var f=c._init;return f(c._payload)}function Pp(c){function f(xe,ue){if(c){var Ee=xe.deletions;Ee===null?(xe.deletions=[ue],xe.flags|=16):Ee.push(ue)}}function y(xe,ue){if(!c)return null;for(;ue!==null;)f(xe,ue),ue=ue.sibling;return null}function E(xe,ue){for(xe=new Map;ue!==null;)ue.key!==null?xe.set(ue.key,ue):xe.set(ue.index,ue),ue=ue.sibling;return xe}function T(xe,ue){return xe=Gs(xe,ue),xe.index=0,xe.sibling=null,xe}function B(xe,ue,Ee){return xe.index=Ee,c?(Ee=xe.alternate,Ee!==null?(Ee=Ee.index,Ee<ue?(xe.flags|=2,ue):Ee):(xe.flags|=2,ue)):(xe.flags|=1048576,ue)}function K(xe){return c&&xe.alternate===null&&(xe.flags|=2),xe}function se(xe,ue,Ee,at){return ue===null||ue.tag!==6?(ue=of(Ee,xe.mode,at),ue.return=xe,ue):(ue=T(ue,Ee),ue.return=xe,ue)}function Te(xe,ue,Ee,at){var Ct=Ee.type;return Ct===m?yt(xe,ue,Ee.props.children,at,Ee.key):ue!==null&&(ue.elementType===Ct||typeof Ct=="object"&&Ct!==null&&Ct.$$typeof===R&&za(Ct)===ue.type)?(at=T(ue,Ee.props),at.ref=Ha(xe,ue,Ee),at.return=xe,at):(at=sf(Ee.type,Ee.key,Ee.props,null,xe.mode,at),at.ref=Ha(xe,ue,Ee),at.return=xe,at)}function Ke(xe,ue,Ee,at){return ue===null||ue.tag!==4||ue.stateNode.containerInfo!==Ee.containerInfo||ue.stateNode.implementation!==Ee.implementation?(ue=af(Ee,xe.mode,at),ue.return=xe,ue):(ue=T(ue,Ee.children||[]),ue.return=xe,ue)}function yt(xe,ue,Ee,at,Ct){return ue===null||ue.tag!==7?(ue=aa(Ee,xe.mode,at,Ct),ue.return=xe,ue):(ue=T(ue,Ee),ue.return=xe,ue)}function Gt(xe,ue,Ee){if(typeof ue=="string"&&ue!==""||typeof ue=="number")return ue=of(""+ue,xe.mode,Ee),ue.return=xe,ue;if(typeof ue=="object"&&ue!==null){switch(ue.$$typeof){case d:return Ee=sf(ue.type,ue.key,ue.props,null,xe.mode,Ee),Ee.ref=Ha(xe,null,ue),Ee.return=xe,Ee;case h:return ue=af(ue,xe.mode,Ee),ue.return=xe,ue;case R:var at=ue._init;return Gt(xe,at(ue._payload),Ee)}if(ye(ue)||F(ue))return ue=aa(ue,xe.mode,Ee,null),ue.return=xe,ue;ho(xe,ue)}return null}function Lt(xe,ue,Ee,at){var Ct=ue!==null?ue.key:null;if(typeof Ee=="string"&&Ee!==""||typeof Ee=="number")return Ct!==null?null:se(xe,ue,""+Ee,at);if(typeof Ee=="object"&&Ee!==null){switch(Ee.$$typeof){case d:return Ee.key===Ct?Te(xe,ue,Ee,at):null;case h:return Ee.key===Ct?Ke(xe,ue,Ee,at):null;case R:return Ct=Ee._init,Lt(xe,ue,Ct(Ee._payload),at)}if(ye(Ee)||F(Ee))return Ct!==null?null:yt(xe,ue,Ee,at,null);ho(xe,Ee)}return null}function qt(xe,ue,Ee,at,Ct){if(typeof at=="string"&&at!==""||typeof at=="number")return xe=xe.get(Ee)||null,se(ue,xe,""+at,Ct);if(typeof at=="object"&&at!==null){switch(at.$$typeof){case d:return xe=xe.get(at.key===null?Ee:at.key)||null,Te(ue,xe,at,Ct);case h:return xe=xe.get(at.key===null?Ee:at.key)||null,Ke(ue,xe,at,Ct);case R:var Wt=at._init;return qt(xe,ue,Ee,Wt(at._payload),Ct)}if(ye(at)||F(at))return xe=xe.get(Ee)||null,yt(ue,xe,at,Ct,null);ho(ue,at)}return null}function ft(xe,ue,Ee,at){for(var Ct=null,Wt=null,Vt=ue,hn=ue=0,Qn=null;Vt!==null&&hn<Ee.length;hn++){Vt.index>hn?(Qn=Vt,Vt=null):Qn=Vt.sibling;var dn=Lt(xe,Vt,Ee[hn],at);if(dn===null){Vt===null&&(Vt=Qn);break}c&&Vt&&dn.alternate===null&&f(xe,Vt),ue=B(dn,ue,hn),Wt===null?Ct=dn:Wt.sibling=dn,Wt=dn,Vt=Qn}if(hn===Ee.length)return y(xe,Vt),Bn&&ko(xe,hn),Ct;if(Vt===null){for(;hn<Ee.length;hn++)Vt=Gt(xe,Ee[hn],at),Vt!==null&&(ue=B(Vt,ue,hn),Wt===null?Ct=Vt:Wt.sibling=Vt,Wt=Vt);return Bn&&ko(xe,hn),Ct}for(Vt=E(xe,Vt);hn<Ee.length;hn++)Qn=qt(Vt,xe,hn,Ee[hn],at),Qn!==null&&(c&&Qn.alternate!==null&&Vt.delete(Qn.key===null?hn:Qn.key),ue=B(Qn,ue,hn),Wt===null?Ct=Qn:Wt.sibling=Qn,Wt=Qn);return c&&Vt.forEach(function(Vs){return f(xe,Vs)}),Bn&&ko(xe,hn),Ct}function Si(xe,ue,Ee,at){var Ct=F(Ee);if(typeof Ct!="function")throw Error(a(150));if(Ee=Ct.call(Ee),Ee==null)throw Error(a(151));for(var Wt=Ct=null,Vt=ue,hn=ue=0,Qn=null,dn=Ee.next();Vt!==null&&!dn.done;hn++,dn=Ee.next()){Vt.index>hn?(Qn=Vt,Vt=null):Qn=Vt.sibling;var Vs=Lt(xe,Vt,dn.value,at);if(Vs===null){Vt===null&&(Vt=Qn);break}c&&Vt&&Vs.alternate===null&&f(xe,Vt),ue=B(Vs,ue,hn),Wt===null?Ct=Vs:Wt.sibling=Vs,Wt=Vs,Vt=Qn}if(dn.done)return y(xe,Vt),Bn&&ko(xe,hn),Ct;if(Vt===null){for(;!dn.done;hn++,dn=Ee.next())dn=Gt(xe,dn.value,at),dn!==null&&(ue=B(dn,ue,hn),Wt===null?Ct=dn:Wt.sibling=dn,Wt=dn);return Bn&&ko(xe,hn),Ct}for(Vt=E(xe,Vt);!dn.done;hn++,dn=Ee.next())dn=qt(Vt,xe,hn,dn.value,at),dn!==null&&(c&&dn.alternate!==null&&Vt.delete(dn.key===null?hn:dn.key),ue=B(dn,ue,hn),Wt===null?Ct=dn:Wt.sibling=dn,Wt=dn);return c&&Vt.forEach(function(qd){return f(xe,qd)}),Bn&&ko(xe,hn),Ct}function gr(xe,ue,Ee,at){if(typeof Ee=="object"&&Ee!==null&&Ee.type===m&&Ee.key===null&&(Ee=Ee.props.children),typeof Ee=="object"&&Ee!==null){switch(Ee.$$typeof){case d:e:{for(var Ct=Ee.key,Wt=ue;Wt!==null;){if(Wt.key===Ct){if(Ct=Ee.type,Ct===m){if(Wt.tag===7){y(xe,Wt.sibling),ue=T(Wt,Ee.props.children),ue.return=xe,xe=ue;break e}}else if(Wt.elementType===Ct||typeof Ct=="object"&&Ct!==null&&Ct.$$typeof===R&&za(Ct)===Wt.type){y(xe,Wt.sibling),ue=T(Wt,Ee.props),ue.ref=Ha(xe,Wt,Ee),ue.return=xe,xe=ue;break e}y(xe,Wt);break}else f(xe,Wt);Wt=Wt.sibling}Ee.type===m?(ue=aa(Ee.props.children,xe.mode,at,Ee.key),ue.return=xe,xe=ue):(at=sf(Ee.type,Ee.key,Ee.props,null,xe.mode,at),at.ref=Ha(xe,ue,Ee),at.return=xe,xe=at)}return K(xe);case h:e:{for(Wt=Ee.key;ue!==null;){if(ue.key===Wt)if(ue.tag===4&&ue.stateNode.containerInfo===Ee.containerInfo&&ue.stateNode.implementation===Ee.implementation){y(xe,ue.sibling),ue=T(ue,Ee.children||[]),ue.return=xe,xe=ue;break e}else{y(xe,ue);break}else f(xe,ue);ue=ue.sibling}ue=af(Ee,xe.mode,at),ue.return=xe,xe=ue}return K(xe);case R:return Wt=Ee._init,gr(xe,ue,Wt(Ee._payload),at)}if(ye(Ee))return ft(xe,ue,Ee,at);if(F(Ee))return Si(xe,ue,Ee,at);ho(xe,Ee)}return typeof Ee=="string"&&Ee!==""||typeof Ee=="number"?(Ee=""+Ee,ue!==null&&ue.tag===6?(y(xe,ue.sibling),ue=T(ue,Ee),ue.return=xe,xe=ue):(y(xe,ue),ue=of(Ee,xe.mode,at),ue.return=xe,xe=ue),K(xe)):y(xe,ue)}return gr}var Rs=Pp(!0),Bp=Pp(!1),Ga={},Qi=Rt(Ga),Ho=Rt(Ga),zo=Rt(Ga);function Gr(c){if(c===Ga)throw Error(a(174));return c}function Lc(c,f){Mt(zo,f),Mt(Ho,c),Mt(Qi,Ga),c=_e(f),Ye(Qi),Mt(Qi,c)}function Va(){Ye(Qi),Ye(Ho),Ye(zo)}function Lp(c){var f=Gr(zo.current),y=Gr(Qi.current);f=H(y,c.type,f),y!==f&&(Mt(Ho,c),Mt(Qi,f))}function Ad(c){Ho.current===c&&(Ye(Qi),Ye(Ho))}var Fn=Rt(0);function Dc(c){for(var f=c;f!==null;){if(f.tag===13){var y=f.memoizedState;if(y!==null&&(y=y.dehydrated,y===null||rs(y)||kr(y)))return f}else if(f.tag===19&&f.memoizedProps.revealOrder!==void 0){if(f.flags&128)return f}else if(f.child!==null){f.child.return=f,f=f.child;continue}if(f===c)break;for(;f.sibling===null;){if(f.return===null||f.return===c)return null;f=f.return}f.sibling.return=f.return,f=f.sibling}return null}var ur=[];function Go(){for(var c=0;c<ur.length;c++){var f=ur[c];Je?f._workInProgressVersionPrimary=null:f._workInProgressVersionSecondary=null}ur.length=0}var Ol=u.ReactCurrentDispatcher,cr=u.ReactCurrentBatchConfig,Vo=0,Nn=null,li=null,ui=null,Fc=!1,us=!1,Wo=0,kl=0;function ci(){throw Error(a(321))}function Nc(c,f){if(f===null)return!1;for(var y=0;y<f.length&&y<c.length;y++)if(!Ni(c[y],f[y]))return!1;return!0}function Wa(c,f,y,E,T,B){if(Vo=B,Nn=f,f.memoizedState=null,f.updateQueue=null,f.lanes=0,Ol.current=c===null||c.memoizedState===null?Td:bd,c=y(E,T),us){B=0;do{if(us=!1,Wo=0,25<=B)throw Error(a(301));B+=1,ui=li=null,f.updateQueue=null,Ol.current=Rd,c=y(E,T)}while(us)}if(Ol.current=Ka,f=li!==null&&li.next!==null,Vo=0,ui=li=Nn=null,Fc=!1,f)throw Error(a(300));return c}function po(){var c=Wo!==0;return Wo=0,c}function Vr(){var c={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return ui===null?Nn.memoizedState=ui=c:ui=ui.next=c,ui}function Wr(){if(li===null){var c=Nn.alternate;c=c!==null?c.memoizedState:null}else c=li.next;var f=ui===null?Nn.memoizedState:ui.next;if(f!==null)ui=f,li=c;else{if(c===null)throw Error(a(310));li=c,c={memoizedState:li.memoizedState,baseState:li.baseState,baseQueue:li.baseQueue,queue:li.queue,next:null},ui===null?Nn.memoizedState=ui=c:ui=ui.next=c}return ui}function cs(c,f){return typeof f=="function"?f(c):f}function Hl(c){var f=Wr(),y=f.queue;if(y===null)throw Error(a(311));y.lastRenderedReducer=c;var E=li,T=E.baseQueue,B=y.pending;if(B!==null){if(T!==null){var K=T.next;T.next=B.next,B.next=K}E.baseQueue=T=B,y.pending=null}if(T!==null){B=T.next,E=E.baseState;var se=K=null,Te=null,Ke=B;do{var yt=Ke.lane;if((Vo&yt)===yt)Te!==null&&(Te=Te.next={lane:0,action:Ke.action,hasEagerState:Ke.hasEagerState,eagerState:Ke.eagerState,next:null}),E=Ke.hasEagerState?Ke.eagerState:c(E,Ke.action);else{var Gt={lane:yt,action:Ke.action,hasEagerState:Ke.hasEagerState,eagerState:Ke.eagerState,next:null};Te===null?(se=Te=Gt,K=E):Te=Te.next=Gt,Nn.lanes|=yt,ds|=yt}Ke=Ke.next}while(Ke!==null&&Ke!==B);Te===null?K=E:Te.next=se,Ni(E,f.memoizedState)||(fi=!0),f.memoizedState=E,f.baseState=K,f.baseQueue=Te,y.lastRenderedState=E}if(c=y.interleaved,c!==null){T=c;do B=T.lane,Nn.lanes|=B,ds|=B,T=T.next;while(T!==c)}else T===null&&(y.lanes=0);return[f.memoizedState,y.dispatch]}function zl(c){var f=Wr(),y=f.queue;if(y===null)throw Error(a(311));y.lastRenderedReducer=c;var E=y.dispatch,T=y.pending,B=f.memoizedState;if(T!==null){y.pending=null;var K=T=T.next;do B=c(B,K.action),K=K.next;while(K!==T);Ni(B,f.memoizedState)||(fi=!0),f.memoizedState=B,f.baseQueue===null&&(f.baseState=B),y.lastRenderedState=B}return[B,E]}function Sd(){}function Md(c,f){var y=Nn,E=Wr(),T=f(),B=!Ni(E.memoizedState,T);if(B&&(E.memoizedState=T,fi=!0),E=E.queue,Xa(Is.bind(null,y,E,c),[c]),E.getSnapshot!==f||B||ui!==null&&ui.memoizedState.tag&1){if(y.flags|=2048,Vl(9,wd.bind(null,y,E,T,f),void 0,null),Xn===null)throw Error(a(349));Vo&30||Ed(y,f,T)}return T}function Ed(c,f,y){c.flags|=16384,c={getSnapshot:f,value:y},f=Nn.updateQueue,f===null?(f={lastEffect:null,stores:null},Nn.updateQueue=f,f.stores=[c]):(y=f.stores,y===null?f.stores=[c]:y.push(c))}function wd(c,f,y,E){f.value=y,f.getSnapshot=E,Uc(f)&&Ii(c,1,-1)}function Is(c,f,y){return y(function(){Uc(f)&&Ii(c,1,-1)})}function Uc(c){var f=c.getSnapshot;c=c.value;try{var y=f();return!Ni(c,y)}catch{return!0}}function Gl(c){var f=Vr();return typeof c=="function"&&(c=c()),f.memoizedState=f.baseState=c,c={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:cs,lastRenderedState:c},f.queue=c,c=c.dispatch=lv.bind(null,Nn,c),[f.memoizedState,c]}function Vl(c,f,y,E){return c={tag:c,create:f,destroy:y,deps:E,next:null},f=Nn.updateQueue,f===null?(f={lastEffect:null,stores:null},Nn.updateQueue=f,f.lastEffect=c.next=c):(y=f.lastEffect,y===null?f.lastEffect=c.next=c:(E=y.next,y.next=c,c.next=E,f.lastEffect=c)),c}function Dp(){return Wr().memoizedState}function mo(c,f,y,E){var T=Vr();Nn.flags|=c,T.memoizedState=Vl(1|f,y,void 0,E===void 0?null:E)}function Oc(c,f,y,E){var T=Wr();E=E===void 0?null:E;var B=void 0;if(li!==null){var K=li.memoizedState;if(B=K.destroy,E!==null&&Nc(E,K.deps)){T.memoizedState=Vl(f,y,B,E);return}}Nn.flags|=c,T.memoizedState=Vl(1|f,y,B,E)}function kc(c,f){return mo(8390656,8,c,f)}function Xa(c,f){return Oc(2048,8,c,f)}function Tn(c,f){return Oc(4,2,c,f)}function Hc(c,f){return Oc(4,4,c,f)}function Wl(c,f){if(typeof f=="function")return c=c(),f(c),function(){f(null)};if(f!=null)return c=c(),f.current=c,function(){f.current=null}}function ja(c,f,y){return y=y!=null?y.concat([c]):null,Oc(4,4,Wl.bind(null,f,c),y)}function zc(){}function Gc(c,f){var y=Wr();f=f===void 0?null:f;var E=y.memoizedState;return E!==null&&f!==null&&Nc(f,E[1])?E[0]:(y.memoizedState=[c,f],c)}function Ja(c,f){var y=Wr();f=f===void 0?null:f;var E=y.memoizedState;return E!==null&&f!==null&&Nc(f,E[1])?E[0]:(c=c(),y.memoizedState=[c,f],c)}function Vc(c,f){var y=en;en=y!==0&&4>y?y:4,c(!0);var E=cr.transition;cr.transition={};try{c(!1),f()}finally{en=y,cr.transition=E}}function Xo(){return Wr().memoizedState}function Fp(c,f,y){var E=Kr(c);y={lane:E,action:y,hasEagerState:!1,eagerState:null,next:null},Np(c)?Cd(f,y):(Xl(c,f,y),y=pn(),c=Ii(c,E,y),c!==null&&jl(c,f,E))}function lv(c,f,y){var E=Kr(c),T={lane:E,action:y,hasEagerState:!1,eagerState:null,next:null};if(Np(c))Cd(f,T);else{Xl(c,f,T);var B=c.alternate;if(c.lanes===0&&(B===null||B.lanes===0)&&(B=f.lastRenderedReducer,B!==null))try{var K=f.lastRenderedState,se=B(K,y);if(T.hasEagerState=!0,T.eagerState=se,Ni(se,K))return}catch{}finally{}y=pn(),c=Ii(c,E,y),c!==null&&jl(c,f,E)}}function Np(c){var f=c.alternate;return c===Nn||f!==null&&f===Nn}function Cd(c,f){us=Fc=!0;var y=c.pending;y===null?f.next=f:(f.next=y.next,y.next=f),c.pending=f}function Xl(c,f,y){Xn!==null&&c.mode&1&&!(jt&2)?(c=f.interleaved,c===null?(y.next=y,Er===null?Er=[f]:Er.push(f)):(y.next=c.next,c.next=y),f.interleaved=y):(c=f.pending,c===null?y.next=y:(y.next=c.next,c.next=y),f.pending=y)}function jl(c,f,y){if(y&4194240){var E=f.lanes;E&=c.pendingLanes,y|=E,f.lanes=y,as(c,y)}}var Ka={readContext:Yi,useCallback:ci,useContext:ci,useEffect:ci,useImperativeHandle:ci,useInsertionEffect:ci,useLayoutEffect:ci,useMemo:ci,useReducer:ci,useRef:ci,useState:ci,useDebugValue:ci,useDeferredValue:ci,useTransition:ci,useMutableSource:ci,useSyncExternalStore:ci,useId:ci,unstable_isNewReconciler:!1},Td={readContext:Yi,useCallback:function(c,f){return Vr().memoizedState=[c,f===void 0?null:f],c},useContext:Yi,useEffect:kc,useImperativeHandle:function(c,f,y){return y=y!=null?y.concat([c]):null,mo(4194308,4,Wl.bind(null,f,c),y)},useLayoutEffect:function(c,f){return mo(4194308,4,c,f)},useInsertionEffect:function(c,f){return mo(4,2,c,f)},useMemo:function(c,f){var y=Vr();return f=f===void 0?null:f,c=c(),y.memoizedState=[c,f],c},useReducer:function(c,f,y){var E=Vr();return f=y!==void 0?y(f):f,E.memoizedState=E.baseState=f,c={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:c,lastRenderedState:f},E.queue=c,c=c.dispatch=Fp.bind(null,Nn,c),[E.memoizedState,c]},useRef:function(c){var f=Vr();return c={current:c},f.memoizedState=c},useState:Gl,useDebugValue:zc,useDeferredValue:function(c){var f=Gl(c),y=f[0],E=f[1];return kc(function(){var T=cr.transition;cr.transition={};try{E(c)}finally{cr.transition=T}},[c]),y},useTransition:function(){var c=Gl(!1),f=c[0];return c=Vc.bind(null,c[1]),Vr().memoizedState=c,[f,c]},useMutableSource:function(){},useSyncExternalStore:function(c,f,y){var E=Nn,T=Vr();if(Bn){if(y===void 0)throw Error(a(407));y=y()}else{if(y=f(),Xn===null)throw Error(a(349));Vo&30||Ed(E,f,y)}T.memoizedState=y;var B={value:y,getSnapshot:f};return T.queue=B,kc(Is.bind(null,E,B,c),[c]),E.flags|=2048,Vl(9,wd.bind(null,E,B,y,f),void 0,null),y},useId:function(){var c=Vr(),f=Xn.identifierPrefix;if(Bn){var y=bs,E=Ts;y=(E&~(1<<32-sn(E)-1)).toString(32)+y,f=":"+f+"R"+y,y=Wo++,0<y&&(f+="H"+y.toString(32)),f+=":"}else y=kl++,f=":"+f+"r"+y.toString(32)+":";return c.memoizedState=f},unstable_isNewReconciler:!1},bd={readContext:Yi,useCallback:Gc,useContext:Yi,useEffect:Xa,useImperativeHandle:ja,useInsertionEffect:Tn,useLayoutEffect:Hc,useMemo:Ja,useReducer:Hl,useRef:Dp,useState:function(){return Hl(cs)},useDebugValue:zc,useDeferredValue:function(c){var f=Hl(cs),y=f[0],E=f[1];return Xa(function(){var T=cr.transition;cr.transition={};try{E(c)}finally{cr.transition=T}},[c]),y},useTransition:function(){var c=Hl(cs)[0],f=Wr().memoizedState;return[c,f]},useMutableSource:Sd,useSyncExternalStore:Md,useId:Xo,unstable_isNewReconciler:!1},Rd={readContext:Yi,useCallback:Gc,useContext:Yi,useEffect:Xa,useImperativeHandle:ja,useInsertionEffect:Tn,useLayoutEffect:Hc,useMemo:Ja,useReducer:zl,useRef:Dp,useState:function(){return zl(cs)},useDebugValue:zc,useDeferredValue:function(c){var f=zl(cs),y=f[0],E=f[1];return Xa(function(){var T=cr.transition;cr.transition={};try{E(c)}finally{cr.transition=T}},[c]),y},useTransition:function(){var c=zl(cs)[0],f=Wr().memoizedState;return[c,f]},useMutableSource:Sd,useSyncExternalStore:Md,useId:Xo,unstable_isNewReconciler:!1};function Id(c,f){try{var y="",E=f;do y+=dd(E),E=E.return;while(E);var T=y}catch(B){T=`
Error generating stack: `+B.message+`
`+B.stack}return{value:c,source:f,stack:T}}function Wc(c,f){try{console.error(f.value)}catch(y){setTimeout(function(){throw y})}}var uv=typeof WeakMap=="function"?WeakMap:Map;function Up(c,f,y){y=Cs(-1,y),y.tag=3,y.payload={element:null};var E=f.value;return y.callback=function(){el||(el=!0,Pn=E),Wc(c,f)},y}function Xc(c,f,y){y=Cs(-1,y),y.tag=3;var E=c.type.getDerivedStateFromError;if(typeof E=="function"){var T=f.value;y.payload=function(){return E(T)},y.callback=function(){Wc(c,f)}}var B=c.stateNode;return B!==null&&typeof B.componentDidCatch=="function"&&(y.callback=function(){Wc(c,f),typeof E!="function"&&(Jr===null?Jr=new Set([this]):Jr.add(this));var K=f.stack;this.componentDidCatch(f.value,{componentStack:K!==null?K:""})}),y}function Ps(c,f,y){var E=c.pingCache;if(E===null){E=c.pingCache=new uv;var T=new Set;E.set(f,T)}else T=E.get(f),T===void 0&&(T=new Set,E.set(f,T));T.has(y)||(T.add(y),c=Kd.bind(null,c,f,y),f.then(c,c))}function Pd(c){do{var f;if((f=c.tag===13)&&(f=c.memoizedState,f=f!==null?f.dehydrated!==null:!0),f)return c;c=c.return}while(c!==null);return null}function jo(c,f,y,E,T){return c.mode&1?(c.flags|=65536,c.lanes=T,c):(c===f?c.flags|=65536:(c.flags|=128,y.flags|=131072,y.flags&=-52805,y.tag===1&&(y.alternate===null?y.tag=17:(f=Cs(-1,1),f.tag=2,uo(y,f))),y.lanes|=1),c)}function ti(c){c.flags|=4}function Ya(c,f){if(c!==null&&c.child===f.child)return!0;if(f.flags&16)return!1;for(c=f.child;c!==null;){if(c.flags&12854||c.subtreeFlags&12854)return!1;c=c.sibling}return!0}var fr,Jo,jc,Jc;if(st)fr=function(c,f){for(var y=f.child;y!==null;){if(y.tag===5||y.tag===6)ne(c,y.stateNode);else if(y.tag!==4&&y.child!==null){y.child.return=y,y=y.child;continue}if(y===f)break;for(;y.sibling===null;){if(y.return===null||y.return===f)return;y=y.return}y.sibling.return=y.return,y=y.sibling}},Jo=function(){},jc=function(c,f,y,E,T){if(c=c.memoizedProps,c!==E){var B=f.stateNode,K=Gr(Qi.current);y=ae(B,y,c,E,T,K),(f.updateQueue=y)&&ti(f)}},Jc=function(c,f,y,E){y!==E&&ti(f)};else if(Ne){fr=function(c,f,y,E){for(var T=f.child;T!==null;){if(T.tag===5){var B=T.stateNode;y&&E&&(B=Yt(B,T.type,T.memoizedProps,T)),ne(c,B)}else if(T.tag===6)B=T.stateNode,y&&E&&(B=Gn(B,T.memoizedProps,T)),ne(c,B);else if(T.tag!==4){if(T.tag===22&&T.memoizedState!==null)B=T.child,B!==null&&(B.return=T),fr(c,T,!0,!0);else if(T.child!==null){T.child.return=T,T=T.child;continue}}if(T===f)break;for(;T.sibling===null;){if(T.return===null||T.return===f)return;T=T.return}T.sibling.return=T.return,T=T.sibling}};var go=function(c,f,y,E){for(var T=f.child;T!==null;){if(T.tag===5){var B=T.stateNode;y&&E&&(B=Yt(B,T.type,T.memoizedProps,T)),It(c,B)}else if(T.tag===6)B=T.stateNode,y&&E&&(B=Gn(B,T.memoizedProps,T)),It(c,B);else if(T.tag!==4){if(T.tag===22&&T.memoizedState!==null)B=T.child,B!==null&&(B.return=T),go(c,T,!0,!0);else if(T.child!==null){T.child.return=T,T=T.child;continue}}if(T===f)break;for(;T.sibling===null;){if(T.return===null||T.return===f)return;T=T.return}T.sibling.return=T.return,T=T.sibling}};Jo=function(c,f){var y=f.stateNode;if(!Ya(c,f)){c=y.containerInfo;var E=it(c);go(E,f,!1,!1),y.pendingChildren=E,ti(f),ln(c,E)}},jc=function(c,f,y,E,T){var B=c.stateNode,K=c.memoizedProps;if((c=Ya(c,f))&&K===E)f.stateNode=B;else{var se=f.stateNode,Te=Gr(Qi.current),Ke=null;K!==E&&(Ke=ae(se,y,K,E,T,Te)),c&&Ke===null?f.stateNode=B:(B=ut(B,Ke,y,K,E,f,c,se),Fe(B,y,E,T,Te)&&ti(f),f.stateNode=B,c?ti(f):fr(B,f,!1,!1))}},Jc=function(c,f,y,E){y!==E?(c=Gr(zo.current),y=Gr(Qi.current),f.stateNode=De(E,c,y,f),ti(f)):f.stateNode=c.stateNode}}else Jo=function(){},jc=function(){},Jc=function(){};function Bs(c,f){if(!Bn)switch(c.tailMode){case"hidden":f=c.tail;for(var y=null;f!==null;)f.alternate!==null&&(y=f),f=f.sibling;y===null?c.tail=null:y.sibling=null;break;case"collapsed":y=c.tail;for(var E=null;y!==null;)y.alternate!==null&&(E=y),y=y.sibling;E===null?f||c.tail===null?c.tail=null:c.tail.sibling=null:E.sibling=null}}function Wn(c){var f=c.alternate!==null&&c.alternate.child===c.child,y=0,E=0;if(f)for(var T=c.child;T!==null;)y|=T.lanes|T.childLanes,E|=T.subtreeFlags&14680064,E|=T.flags&14680064,T.return=c,T=T.sibling;else for(T=c.child;T!==null;)y|=T.lanes|T.childLanes,E|=T.subtreeFlags,E|=T.flags,T.return=c,T=T.sibling;return c.subtreeFlags|=E,c.childLanes=y,f}function Kc(c,f,y){var E=f.pendingProps;switch(yd(f),f.tag){case 2:case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return Wn(f),null;case 1:return un(f.type)&&$t(),Wn(f),null;case 3:return E=f.stateNode,Va(),Ye(rn),Ye(nn),Go(),E.pendingContext&&(E.context=E.pendingContext,E.pendingContext=null),(c===null||c.child===null)&&(Ul(f)?ti(f):c===null||c.memoizedState.isDehydrated&&!(f.flags&256)||(f.flags|=1024,Tr!==null&&(su(Tr),Tr=null))),Jo(c,f),Wn(f),null;case 5:Ad(f),y=Gr(zo.current);var T=f.type;if(c!==null&&f.stateNode!=null)jc(c,f,T,E,y),c.ref!==f.ref&&(f.flags|=512,f.flags|=2097152);else{if(!E){if(f.stateNode===null)throw Error(a(166));return Wn(f),null}if(c=Gr(Qi.current),Ul(f)){if(!be)throw Error(a(175));c=uc(f.stateNode,f.type,f.memoizedProps,y,c,f,!Oa),f.updateQueue=c,c!==null&&ti(f)}else{var B=W(T,E,y,c,f);fr(B,f,!1,!1),f.stateNode=B,Fe(B,T,E,y,c)&&ti(f)}f.ref!==null&&(f.flags|=512,f.flags|=2097152)}return Wn(f),null;case 6:if(c&&f.stateNode!=null)Jc(c,f,c.memoizedProps,E);else{if(typeof E!="string"&&f.stateNode===null)throw Error(a(166));if(c=Gr(zo.current),y=Gr(Qi.current),Ul(f)){if(!be)throw Error(a(176));if(c=f.stateNode,E=f.memoizedProps,(y=ss(c,E,f,!Oa))&&(T=Oi,T!==null))switch(B=(T.mode&1)!==0,T.tag){case 3:le(T.stateNode.containerInfo,c,E,B);break;case 5:Ae(T.type,T.memoizedProps,T.stateNode,c,E,B)}y&&ti(f)}else f.stateNode=De(E,c,y,f)}return Wn(f),null;case 13:if(Ye(Fn),E=f.memoizedState,Bn&&vi!==null&&f.mode&1&&!(f.flags&128)){for(c=vi;c;)c=Hr(c);return ka(),f.flags|=98560,f}if(E!==null&&E.dehydrated!==null){if(E=Ul(f),c===null){if(!E)throw Error(a(318));if(!be)throw Error(a(344));if(c=f.memoizedState,c=c!==null?c.dehydrated:null,!c)throw Error(a(317));cc(c,f)}else ka(),!(f.flags&128)&&(f.memoizedState=null),f.flags|=4;return Wn(f),null}return Tr!==null&&(su(Tr),Tr=null),f.flags&128?(f.lanes=y,f):(E=E!==null,y=!1,c===null?Ul(f):y=c.memoizedState!==null,E&&!y&&(f.child.flags|=8192,f.mode&1&&(c===null||Fn.current&1?On===0&&(On=3):tf())),f.updateQueue!==null&&(f.flags|=4),Wn(f),null);case 4:return Va(),Jo(c,f),c===null&&mt(f.stateNode.containerInfo),Wn(f),null;case 10:return Nl(f.type._context),Wn(f),null;case 17:return un(f.type)&&$t(),Wn(f),null;case 19:if(Ye(Fn),T=f.memoizedState,T===null)return Wn(f),null;if(E=(f.flags&128)!==0,B=T.rendering,B===null)if(E)Bs(T,!1);else{if(On!==0||c!==null&&c.flags&128)for(c=f.child;c!==null;){if(B=Dc(c),B!==null){for(f.flags|=128,Bs(T,!1),c=B.updateQueue,c!==null&&(f.updateQueue=c,f.flags|=4),f.subtreeFlags=0,c=y,E=f.child;E!==null;)y=E,T=c,y.flags&=14680066,B=y.alternate,B===null?(y.childLanes=0,y.lanes=T,y.child=null,y.subtreeFlags=0,y.memoizedProps=null,y.memoizedState=null,y.updateQueue=null,y.dependencies=null,y.stateNode=null):(y.childLanes=B.childLanes,y.lanes=B.lanes,y.child=B.child,y.subtreeFlags=0,y.deletions=null,y.memoizedProps=B.memoizedProps,y.memoizedState=B.memoizedState,y.updateQueue=B.updateQueue,y.type=B.type,T=B.dependencies,y.dependencies=T===null?null:{lanes:T.lanes,firstContext:T.firstContext}),E=E.sibling;return Mt(Fn,Fn.current&1|2),f.child}c=c.sibling}T.tail!==null&&ei()>_o&&(f.flags|=128,E=!0,Bs(T,!1),f.lanes=4194304)}else{if(!E)if(c=Dc(B),c!==null){if(f.flags|=128,E=!0,c=c.updateQueue,c!==null&&(f.updateQueue=c,f.flags|=4),Bs(T,!0),T.tail===null&&T.tailMode==="hidden"&&!B.alternate&&!Bn)return Wn(f),null}else 2*ei()-T.renderingStartTime>_o&&y!==1073741824&&(f.flags|=128,E=!0,Bs(T,!1),f.lanes=4194304);T.isBackwards?(B.sibling=f.child,f.child=B):(c=T.last,c!==null?c.sibling=B:f.child=B,T.last=B)}return T.tail!==null?(f=T.tail,T.rendering=f,T.tail=f.sibling,T.renderingStartTime=ei(),f.sibling=null,c=Fn.current,Mt(Fn,E?c&1|2:c&1),f):(Wn(f),null);case 22:case 23:return ou(),E=f.memoizedState!==null,c!==null&&c.memoizedState!==null!==E&&(f.flags|=8192),E&&f.mode&1?Ri&1073741824&&(Wn(f),st&&f.subtreeFlags&6&&(f.flags|=8192)):Wn(f),null;case 24:return null;case 25:return null}throw Error(a(156,f.tag))}var Bd=u.ReactCurrentOwner,fi=!1;function Un(c,f,y,E){f.child=c===null?Bp(f,null,y,E):Rs(f,c.child,y,E)}function bn(c,f,y,E,T){y=y.render;var B=f.ref;return Fa(f,T),E=Wa(c,f,y,E,B,T),y=po(),c!==null&&!fi?(f.updateQueue=c.updateQueue,f.flags&=-2053,c.lanes&=~T,qi(c,f,T)):(Bn&&y&&vd(f),f.flags|=1,Un(c,f,E,T),f.child)}function En(c,f,y,E,T){if(c===null){var B=y.type;return typeof B=="function"&&!rf(B)&&B.defaultProps===void 0&&y.compare===null&&y.defaultProps===void 0?(f.tag=15,f.type=B,Ls(c,f,B,E,T)):(c=sf(y.type,null,E,f,f.mode,T),c.ref=f.ref,c.return=f,f.child=c)}if(B=c.child,!(c.lanes&T)){var K=B.memoizedProps;if(y=y.compare,y=y!==null?y:zr,y(K,E)&&c.ref===f.ref)return qi(c,f,T)}return f.flags|=1,c=Gs(B,E),c.ref=f.ref,c.return=f,f.child=c}function Ls(c,f,y,E,T){if(c!==null&&zr(c.memoizedProps,E)&&c.ref===f.ref)if(fi=!1,(c.lanes&T)!==0)c.flags&131072&&(fi=!0);else return f.lanes=c.lanes,qi(c,f,T);return Ds(c,f,y,E,T)}function yi(c,f,y){var E=f.pendingProps,T=E.children,B=c!==null?c.memoizedState:null;if(E.mode==="hidden")if(!(f.mode&1))f.memoizedState={baseLanes:0,cachePool:null},Mt(na,Ri),Ri|=y;else if(y&1073741824)f.memoizedState={baseLanes:0,cachePool:null},E=B!==null?B.baseLanes:y,Mt(na,Ri),Ri|=E;else return c=B!==null?B.baseLanes|y:y,f.lanes=f.childLanes=1073741824,f.memoizedState={baseLanes:c,cachePool:null},f.updateQueue=null,Mt(na,Ri),Ri|=c,null;else B!==null?(E=B.baseLanes|y,f.memoizedState=null):E=y,Mt(na,Ri),Ri|=E;return Un(c,f,T,y),f.child}function ki(c,f){var y=f.ref;(c===null&&y!==null||c!==null&&c.ref!==y)&&(f.flags|=512,f.flags|=2097152)}function Ds(c,f,y,E,T){var B=un(y)?Qt:nn.current;return B=St(f,B),Fa(f,T),y=Wa(c,f,y,E,B,T),E=po(),c!==null&&!fi?(f.updateQueue=c.updateQueue,f.flags&=-2053,c.lanes&=~T,qi(c,f,T)):(Bn&&E&&vd(f),f.flags|=1,Un(c,f,y,T),f.child)}function Ko(c,f,y,E,T){if(un(y)){var B=!0;oi(f)}else B=!1;if(Fa(f,T),f.stateNode===null)c!==null&&(c.alternate=null,f.alternate=null,f.flags|=2),Tp(f,y,E),gd(f,y,E,T),E=!0;else if(c===null){var K=f.stateNode,se=f.memoizedProps;K.props=se;var Te=K.context,Ke=y.contextType;typeof Ke=="object"&&Ke!==null?Ke=Yi(Ke):(Ke=un(y)?Qt:nn.current,Ke=St(f,Ke));var yt=y.getDerivedStateFromProps,Gt=typeof yt=="function"||typeof K.getSnapshotBeforeUpdate=="function";Gt||typeof K.UNSAFE_componentWillReceiveProps!="function"&&typeof K.componentWillReceiveProps!="function"||(se!==E||Te!==Ke)&&bp(f,K,E,Ke),wr=!1;var Lt=f.memoizedState;K.state=Lt,Tc(f,E,K,T),Te=f.memoizedState,se!==E||Lt!==Te||rn.current||wr?(typeof yt=="function"&&(pd(f,y,yt,E),Te=f.memoizedState),(se=wr||md(f,y,se,E,Lt,Te,Ke))?(Gt||typeof K.UNSAFE_componentWillMount!="function"&&typeof K.componentWillMount!="function"||(typeof K.componentWillMount=="function"&&K.componentWillMount(),typeof K.UNSAFE_componentWillMount=="function"&&K.UNSAFE_componentWillMount()),typeof K.componentDidMount=="function"&&(f.flags|=4194308)):(typeof K.componentDidMount=="function"&&(f.flags|=4194308),f.memoizedProps=E,f.memoizedState=Te),K.props=E,K.state=Te,K.context=Ke,E=se):(typeof K.componentDidMount=="function"&&(f.flags|=4194308),E=!1)}else{K=f.stateNode,hd(c,f),se=f.memoizedProps,Ke=f.type===f.elementType?se:Ki(f.type,se),K.props=Ke,Gt=f.pendingProps,Lt=K.context,Te=y.contextType,typeof Te=="object"&&Te!==null?Te=Yi(Te):(Te=un(y)?Qt:nn.current,Te=St(f,Te));var qt=y.getDerivedStateFromProps;(yt=typeof qt=="function"||typeof K.getSnapshotBeforeUpdate=="function")||typeof K.UNSAFE_componentWillReceiveProps!="function"&&typeof K.componentWillReceiveProps!="function"||(se!==Gt||Lt!==Te)&&bp(f,K,E,Te),wr=!1,Lt=f.memoizedState,K.state=Lt,Tc(f,E,K,T);var ft=f.memoizedState;se!==Gt||Lt!==ft||rn.current||wr?(typeof qt=="function"&&(pd(f,y,qt,E),ft=f.memoizedState),(Ke=wr||md(f,y,Ke,E,Lt,ft,Te)||!1)?(yt||typeof K.UNSAFE_componentWillUpdate!="function"&&typeof K.componentWillUpdate!="function"||(typeof K.componentWillUpdate=="function"&&K.componentWillUpdate(E,ft,Te),typeof K.UNSAFE_componentWillUpdate=="function"&&K.UNSAFE_componentWillUpdate(E,ft,Te)),typeof K.componentDidUpdate=="function"&&(f.flags|=4),typeof K.getSnapshotBeforeUpdate=="function"&&(f.flags|=1024)):(typeof K.componentDidUpdate!="function"||se===c.memoizedProps&&Lt===c.memoizedState||(f.flags|=4),typeof K.getSnapshotBeforeUpdate!="function"||se===c.memoizedProps&&Lt===c.memoizedState||(f.flags|=1024),f.memoizedProps=E,f.memoizedState=ft),K.props=E,K.state=ft,K.context=Te,E=Ke):(typeof K.componentDidUpdate!="function"||se===c.memoizedProps&&Lt===c.memoizedState||(f.flags|=4),typeof K.getSnapshotBeforeUpdate!="function"||se===c.memoizedProps&&Lt===c.memoizedState||(f.flags|=1024),E=!1)}return bi(c,f,y,E,B,T)}function bi(c,f,y,E,T,B){ki(c,f);var K=(f.flags&128)!==0;if(!E&&!K)return T&&os(f,y,!1),qi(c,f,B);E=f.stateNode,Bd.current=f;var se=K&&typeof y.getDerivedStateFromError!="function"?null:E.render();return f.flags|=1,c!==null&&K?(f.child=Rs(f,c.child,null,B),f.child=Rs(f,null,se,B)):Un(c,f,se,B),f.memoizedState=E.state,T&&os(f,y,!0),f.child}function Jl(c){var f=c.stateNode;f.pendingContext?mi(c,f.pendingContext,f.pendingContext!==f.context):f.context&&mi(c,f.context,!1),Lc(c,f.containerInfo)}function Ld(c,f,y,E,T){return ka(),Bc(T),f.flags|=256,Un(c,f,y,E),f.child}var Kl={dehydrated:null,treeContext:null,retryLane:0};function Yo(c){return{baseLanes:c,cachePool:null}}function Dd(c,f,y){var E=f.pendingProps,T=Fn.current,B=!1,K=(f.flags&128)!==0,se;if((se=K)||(se=c!==null&&c.memoizedState===null?!1:(T&2)!==0),se?(B=!0,f.flags&=-129):(c===null||c.memoizedState!==null)&&(T|=1),Mt(Fn,T&1),c===null)return fo(f),c=f.memoizedState,c!==null&&(c=c.dehydrated,c!==null)?(f.mode&1?kr(c)?f.lanes=8:f.lanes=1073741824:f.lanes=1,null):(T=E.children,c=E.fallback,B?(E=f.mode,B=f.child,T={mode:"hidden",children:T},!(E&1)&&B!==null?(B.childLanes=0,B.pendingProps=T):B=uu(T,E,0,null),c=aa(c,E,y,null),B.return=f,c.return=f,B.sibling=c,f.child=B,f.child.memoizedState=Yo(y),f.memoizedState=Kl,c):Xr(f,T));if(T=c.memoizedState,T!==null){if(se=T.dehydrated,se!==null){if(K)return f.flags&256?(f.flags&=-257,Ql(c,f,y,Error(a(422)))):f.memoizedState!==null?(f.child=c.child,f.flags|=128,null):(B=E.fallback,T=f.mode,E=uu({mode:"visible",children:E.children},T,0,null),B=aa(B,T,y,null),B.flags|=2,E.return=f,B.return=f,E.sibling=B,f.child=E,f.mode&1&&Rs(f,c.child,null,y),f.child.memoizedState=Yo(y),f.memoizedState=Kl,B);if(!(f.mode&1))f=Ql(c,f,y,null);else if(kr(se))f=Ql(c,f,y,Error(a(419)));else if(E=(y&c.childLanes)!==0,fi||E){if(E=Xn,E!==null){switch(y&-y){case 4:B=2;break;case 16:B=8;break;case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:B=32;break;case 536870912:B=268435456;break;default:B=0}E=B&(E.suspendedLanes|y)?0:B,E!==0&&E!==T.retryLane&&(T.retryLane=E,Ii(c,E,-1))}tf(),f=Ql(c,f,y,Error(a(421)))}else rs(se)?(f.flags|=128,f.child=c.child,f=Gp.bind(null,c),Po(se,f),f=null):(y=T.treeContext,be&&(vi=La(se),Oi=f,Bn=!0,Tr=null,Oa=!1,y!==null&&(Cr[lr++]=Ts,Cr[lr++]=bs,Cr[lr++]=Oo,Ts=y.id,bs=y.overflow,Oo=f)),f=Xr(f,f.pendingProps.children),f.flags|=4096);return f}return B?(E=Yc(c,f,E.children,E.fallback,y),B=f.child,T=c.child.memoizedState,B.memoizedState=T===null?Yo(y):{baseLanes:T.baseLanes|y,cachePool:null},B.childLanes=c.childLanes&~y,f.memoizedState=Kl,E):(y=Yl(c,f,E.children,y),f.memoizedState=null,y)}return B?(E=Yc(c,f,E.children,E.fallback,y),B=f.child,T=c.child.memoizedState,B.memoizedState=T===null?Yo(y):{baseLanes:T.baseLanes|y,cachePool:null},B.childLanes=c.childLanes&~y,f.memoizedState=Kl,E):(y=Yl(c,f,E.children,y),f.memoizedState=null,y)}function Xr(c,f){return f=uu({mode:"visible",children:f},c.mode,0,null),f.return=c,c.child=f}function Yl(c,f,y,E){var T=c.child;return c=T.sibling,y=Gs(T,{mode:"visible",children:y}),!(f.mode&1)&&(y.lanes=E),y.return=f,y.sibling=null,c!==null&&(E=f.deletions,E===null?(f.deletions=[c],f.flags|=16):E.push(c)),f.child=y}function Yc(c,f,y,E,T){var B=f.mode;c=c.child;var K=c.sibling,se={mode:"hidden",children:y};return!(B&1)&&f.child!==c?(y=f.child,y.childLanes=0,y.pendingProps=se,f.deletions=null):(y=Gs(c,se),y.subtreeFlags=c.subtreeFlags&14680064),K!==null?E=Gs(K,E):(E=aa(E,B,T,null),E.flags|=2),E.return=f,y.return=f,y.sibling=E,f.child=y,E}function Ql(c,f,y,E){return E!==null&&Bc(E),Rs(f,c.child,null,y),c=Xr(f,f.pendingProps.children),c.flags|=2,f.memoizedState=null,c}function Op(c,f,y){c.lanes|=f;var E=c.alternate;E!==null&&(E.lanes|=f),Uo(c.return,f,y)}function fs(c,f,y,E,T){var B=c.memoizedState;B===null?c.memoizedState={isBackwards:f,rendering:null,renderingStartTime:0,last:E,tail:y,tailMode:T}:(B.isBackwards=f,B.rendering=null,B.renderingStartTime=0,B.last=E,B.tail=y,B.tailMode=T)}function Qo(c,f,y){var E=f.pendingProps,T=E.revealOrder,B=E.tail;if(Un(c,f,E.children,y),E=Fn.current,E&2)E=E&1|2,f.flags|=128;else{if(c!==null&&c.flags&128)e:for(c=f.child;c!==null;){if(c.tag===13)c.memoizedState!==null&&Op(c,y,f);else if(c.tag===19)Op(c,y,f);else if(c.child!==null){c.child.return=c,c=c.child;continue}if(c===f)break e;for(;c.sibling===null;){if(c.return===null||c.return===f)break e;c=c.return}c.sibling.return=c.return,c=c.sibling}E&=1}if(Mt(Fn,E),!(f.mode&1))f.memoizedState=null;else switch(T){case"forwards":for(y=f.child,T=null;y!==null;)c=y.alternate,c!==null&&Dc(c)===null&&(T=y),y=y.sibling;y=T,y===null?(T=f.child,f.child=null):(T=y.sibling,y.sibling=null),fs(f,!1,T,y,B);break;case"backwards":for(y=null,T=f.child,f.child=null;T!==null;){if(c=T.alternate,c!==null&&Dc(c)===null){f.child=T;break}c=T.sibling,T.sibling=y,y=T,T=c}fs(f,!0,y,null,B);break;case"together":fs(f,!1,null,null,void 0);break;default:f.memoizedState=null}return f.child}function qi(c,f,y){if(c!==null&&(f.dependencies=c.dependencies),ds|=f.lanes,!(y&f.childLanes))return null;if(c!==null&&f.child!==c.child)throw Error(a(153));if(f.child!==null){for(c=f.child,y=Gs(c,c.pendingProps),f.child=y,y.return=f;c.sibling!==null;)c=c.sibling,y=y.sibling=Gs(c,c.pendingProps),y.return=f;y.sibling=null}return f.child}function Qc(c,f,y){switch(f.tag){case 3:Jl(f),ka();break;case 5:Lp(f);break;case 1:un(f.type)&&oi(f);break;case 4:Lc(f,f.stateNode.containerInfo);break;case 10:No(f,f.type._context,f.memoizedProps.value);break;case 13:var E=f.memoizedState;if(E!==null)return E.dehydrated!==null?(Mt(Fn,Fn.current&1),f.flags|=128,null):y&f.child.childLanes?Dd(c,f,y):(Mt(Fn,Fn.current&1),c=qi(c,f,y),c!==null?c.sibling:null);Mt(Fn,Fn.current&1);break;case 19:if(E=(y&f.childLanes)!==0,c.flags&128){if(E)return Qo(c,f,y);f.flags|=128}var T=f.memoizedState;if(T!==null&&(T.rendering=null,T.tail=null,T.lastEffect=null),Mt(Fn,Fn.current),E)break;return null;case 22:case 23:return f.lanes=0,yi(c,f,y)}return qi(c,f,y)}function qc(c,f){switch(yd(f),f.tag){case 1:return un(f.type)&&$t(),c=f.flags,c&65536?(f.flags=c&-65537|128,f):null;case 3:return Va(),Ye(rn),Ye(nn),Go(),c=f.flags,c&65536&&!(c&128)?(f.flags=c&-65537|128,f):null;case 5:return Ad(f),null;case 13:if(Ye(Fn),c=f.memoizedState,c!==null&&c.dehydrated!==null){if(f.alternate===null)throw Error(a(340));ka()}return c=f.flags,c&65536?(f.flags=c&-65537|128,f):null;case 19:return Ye(Fn),null;case 4:return Va(),null;case 10:return Nl(f.type._context),null;case 22:case 23:return ou(),null;case 24:return null;default:return null}}var Hi=!1,di=!1,qo=typeof WeakSet=="function"?WeakSet:Set,$e=null;function br(c,f){var y=c.ref;if(y!==null)if(typeof y=="function")try{y(null)}catch(E){Gi(c,f,E)}else y.current=null}function Fs(c,f,y){try{y()}catch(E){Gi(c,f,E)}}var Fd=!1;function Nd(c,f){for(Z(c.containerInfo),$e=f;$e!==null;)if(c=$e,f=c.child,(c.subtreeFlags&1028)!==0&&f!==null)f.return=c,$e=f;else for(;$e!==null;){c=$e;try{var y=c.alternate;if(c.flags&1024)switch(c.tag){case 0:case 11:case 15:break;case 1:if(y!==null){var E=y.memoizedProps,T=y.memoizedState,B=c.stateNode,K=B.getSnapshotBeforeUpdate(c.elementType===c.type?E:Ki(c.type,E),T);B.__reactInternalSnapshotBeforeUpdate=K}break;case 3:st&&Be(c.stateNode.containerInfo);break;case 5:case 6:case 4:case 17:break;default:throw Error(a(163))}}catch(se){Gi(c,c.return,se)}if(f=c.sibling,f!==null){f.return=c.return,$e=f;break}$e=c.return}return y=Fd,Fd=!1,y}function Ns(c,f,y){var E=f.updateQueue;if(E=E!==null?E.lastEffect:null,E!==null){var T=E=E.next;do{if((T.tag&c)===c){var B=T.destroy;T.destroy=void 0,B!==void 0&&Fs(f,y,B)}T=T.next}while(T!==E)}}function _i(c,f){if(f=f.updateQueue,f=f!==null?f.lastEffect:null,f!==null){var y=f=f.next;do{if((y.tag&c)===c){var E=y.create;y.destroy=E()}y=y.next}while(y!==f)}}function zi(c){var f=c.ref;if(f!==null){var y=c.stateNode;switch(c.tag){case 5:c=he(y);break;default:c=y}typeof f=="function"?f(c):f.current=c}}function In(c,f,y){if(ls&&typeof ls.onCommitFiberUnmount=="function")try{ls.onCommitFiberUnmount(Bl,f)}catch{}switch(f.tag){case 0:case 11:case 14:case 15:if(c=f.updateQueue,c!==null&&(c=c.lastEffect,c!==null)){var E=c=c.next;do{var T=E,B=T.destroy;T=T.tag,B!==void 0&&(T&2||T&4)&&Fs(f,y,B),E=E.next}while(E!==c)}break;case 1:if(br(f,y),c=f.stateNode,typeof c.componentWillUnmount=="function")try{c.props=f.memoizedProps,c.state=f.memoizedState,c.componentWillUnmount()}catch(K){Gi(f,y,K)}break;case 5:br(f,y);break;case 4:st?kd(c,f,y):Ne&&Ne&&(f=f.stateNode.containerInfo,y=it(f),Cn(f,y))}}function Rr(c,f,y){for(var E=f;;)if(In(c,E,y),E.child===null||st&&E.tag===4){if(E===f)break;for(;E.sibling===null;){if(E.return===null||E.return===f)return;E=E.return}E.sibling.return=E.return,E=E.sibling}else E.child.return=E,E=E.child}function Ud(c){var f=c.alternate;f!==null&&(c.alternate=null,Ud(f)),c.child=null,c.deletions=null,c.sibling=null,c.tag===5&&(f=c.stateNode,f!==null&&et(f)),c.stateNode=null,c.return=null,c.dependencies=null,c.memoizedProps=null,c.memoizedState=null,c.pendingProps=null,c.stateNode=null,c.updateQueue=null}function Od(c){return c.tag===5||c.tag===3||c.tag===4}function Zc(c){e:for(;;){for(;c.sibling===null;){if(c.return===null||Od(c.return))return null;c=c.return}for(c.sibling.return=c.return,c=c.sibling;c.tag!==5&&c.tag!==6&&c.tag!==18;){if(c.flags&2||c.child===null||c.tag===4)continue e;c.child.return=c,c=c.child}if(!(c.flags&2))return c.stateNode}}function $c(c){if(st){e:{for(var f=c.return;f!==null;){if(Od(f))break e;f=f.return}throw Error(a(160))}var y=f;switch(y.tag){case 5:f=y.stateNode,y.flags&32&&(Re(f),y.flags&=-33),y=Zc(c),Qa(c,y,f);break;case 3:case 4:f=y.stateNode.containerInfo,y=Zc(c),ef(c,y,f);break;default:throw Error(a(161))}}}function ef(c,f,y){var E=c.tag;if(E===5||E===6)c=c.stateNode,f?Dt(y,c,f):ct(y,c);else if(E!==4&&(c=c.child,c!==null))for(ef(c,f,y),c=c.sibling;c!==null;)ef(c,f,y),c=c.sibling}function Qa(c,f,y){var E=c.tag;if(E===5||E===6)c=c.stateNode,f?Pt(y,c,f):Ze(y,c);else if(E!==4&&(c=c.child,c!==null))for(Qa(c,f,y),c=c.sibling;c!==null;)Qa(c,f,y),c=c.sibling}function kd(c,f,y){for(var E=f,T=!1,B,K;;){if(!T){T=E.return;e:for(;;){if(T===null)throw Error(a(160));switch(B=T.stateNode,T.tag){case 5:K=!1;break e;case 3:B=B.containerInfo,K=!0;break e;case 4:B=B.containerInfo,K=!0;break e}T=T.return}T=!0}if(E.tag===5||E.tag===6)Rr(c,E,y),K?ee(B,E.stateNode):ht(B,E.stateNode);else if(E.tag===18)K?mc(B,E.stateNode):pc(B,E.stateNode);else if(E.tag===4){if(E.child!==null){B=E.stateNode.containerInfo,K=!0,E.child.return=E,E=E.child;continue}}else if(In(c,E,y),E.child!==null){E.child.return=E,E=E.child;continue}if(E===f)break;for(;E.sibling===null;){if(E.return===null||E.return===f)return;E=E.return,E.tag===4&&(T=!1)}E.sibling.return=E.return,E=E.sibling}}function vo(c,f){if(st){switch(f.tag){case 0:case 11:case 14:case 15:Ns(3,f,f.return),_i(3,f),Ns(5,f,f.return);return;case 1:return;case 5:var y=f.stateNode;if(y!=null){var E=f.memoizedProps;c=c!==null?c.memoizedProps:E;var T=f.type,B=f.updateQueue;f.updateQueue=null,B!==null&&gt(y,B,T,c,E,f)}return;case 6:if(f.stateNode===null)throw Error(a(162));y=f.memoizedProps,zt(f.stateNode,c!==null?c.memoizedProps:y,y);return;case 3:be&&c!==null&&c.memoizedState.isDehydrated&&dc(f.stateNode.containerInfo);return;case 12:return;case 13:qa(f);return;case 19:qa(f);return;case 17:return}throw Error(a(163))}switch(f.tag){case 0:case 11:case 14:case 15:Ns(3,f,f.return),_i(3,f),Ns(5,f,f.return);return;case 12:return;case 13:qa(f);return;case 19:qa(f);return;case 3:be&&c!==null&&c.memoizedState.isDehydrated&&dc(f.stateNode.containerInfo);break;case 22:case 23:return}e:if(Ne){switch(f.tag){case 1:case 5:case 6:break e;case 3:case 4:f=f.stateNode,Cn(f.containerInfo,f.pendingChildren);break e}throw Error(a(163))}}function qa(c){var f=c.updateQueue;if(f!==null){c.updateQueue=null;var y=c.stateNode;y===null&&(y=c.stateNode=new qo),f.forEach(function(E){var T=Vp.bind(null,c,E);y.has(E)||(y.add(E),E.then(T,T))})}}function cv(c,f){for($e=f;$e!==null;){f=$e;var y=f.deletions;if(y!==null)for(var E=0;E<y.length;E++){var T=y[E];try{var B=c;st?kd(B,T,f):Rr(B,T,f);var K=T.alternate;K!==null&&(K.return=null),T.return=null}catch(Ct){Gi(T,f,Ct)}}if(y=f.child,f.subtreeFlags&12854&&y!==null)y.return=f,$e=y;else for(;$e!==null;){f=$e;try{var se=f.flags;if(se&32&&st&&Re(f.stateNode),se&512){var Te=f.alternate;if(Te!==null){var Ke=Te.ref;Ke!==null&&(typeof Ke=="function"?Ke(null):Ke.current=null)}}if(se&8192)switch(f.tag){case 13:if(f.memoizedState!==null){var yt=f.alternate;(yt===null||yt.memoizedState===null)&&(iu=ei())}break;case 22:var Gt=f.memoizedState!==null,Lt=f.alternate,qt=Lt!==null&&Lt.memoizedState!==null;if(y=f,st){e:if(E=y,T=Gt,B=null,st)for(var ft=E;;){if(ft.tag===5){if(B===null){B=ft;var Si=ft.stateNode;T?nt(Si):Ve(ft.stateNode,ft.memoizedProps)}}else if(ft.tag===6){if(B===null){var gr=ft.stateNode;T?$(gr):Me(gr,ft.memoizedProps)}}else if((ft.tag!==22&&ft.tag!==23||ft.memoizedState===null||ft===E)&&ft.child!==null){ft.child.return=ft,ft=ft.child;continue}if(ft===E)break;for(;ft.sibling===null;){if(ft.return===null||ft.return===E)break e;B===ft&&(B=null),ft=ft.return}B===ft&&(B=null),ft.sibling.return=ft.return,ft=ft.sibling}}if(Gt&&!qt&&y.mode&1){$e=y;for(var xe=y.child;xe!==null;){for(y=$e=xe;$e!==null;){E=$e;var ue=E.child;switch(E.tag){case 0:case 11:case 14:case 15:Ns(4,E,E.return);break;case 1:br(E,E.return);var Ee=E.stateNode;if(typeof Ee.componentWillUnmount=="function"){var at=E.return;try{Ee.props=E.memoizedProps,Ee.state=E.memoizedState,Ee.componentWillUnmount()}catch(Ct){Gi(E,at,Ct)}}break;case 5:br(E,E.return);break;case 22:if(E.memoizedState!==null){zd(y);continue}}ue!==null?(ue.return=E,$e=ue):zd(y)}xe=xe.sibling}}}switch(se&4102){case 2:$c(f),f.flags&=-3;break;case 6:$c(f),f.flags&=-3,vo(f.alternate,f);break;case 4096:f.flags&=-4097;break;case 4100:f.flags&=-4097,vo(f.alternate,f);break;case 4:vo(f.alternate,f)}}catch(Ct){Gi(f,f.return,Ct)}if(y=f.sibling,y!==null){y.return=f.return,$e=y;break}$e=f.return}}}function ql(c,f,y){$e=c,Zl(c)}function Zl(c,f,y){for(var E=(c.mode&1)!==0;$e!==null;){var T=$e,B=T.child;if(T.tag===22&&E){var K=T.memoizedState!==null||Hi;if(!K){var se=T.alternate,Te=se!==null&&se.memoizedState!==null||di;se=Hi;var Ke=di;if(Hi=K,(di=Te)&&!Ke)for($e=T;$e!==null;)K=$e,Te=K.child,K.tag===22&&K.memoizedState!==null?Zo(T):Te!==null?(Te.return=K,$e=Te):Zo(T);for(;B!==null;)$e=B,Zl(B),B=B.sibling;$e=T,Hi=se,di=Ke}Hd(c)}else T.subtreeFlags&8772&&B!==null?(B.return=T,$e=B):Hd(c)}}function Hd(c){for(;$e!==null;){var f=$e;if(f.flags&8772){var y=f.alternate;try{if(f.flags&8772)switch(f.tag){case 0:case 11:case 15:di||_i(5,f);break;case 1:var E=f.stateNode;if(f.flags&4&&!di)if(y===null)E.componentDidMount();else{var T=f.elementType===f.type?y.memoizedProps:Ki(f.type,y.memoizedProps);E.componentDidUpdate(T,y.memoizedState,E.__reactInternalSnapshotBeforeUpdate)}var B=f.updateQueue;B!==null&&wp(f,B,E);break;case 3:var K=f.updateQueue;if(K!==null){if(y=null,f.child!==null)switch(f.child.tag){case 5:y=he(f.child.stateNode);break;case 1:y=f.child.stateNode}wp(f,K,y)}break;case 5:var se=f.stateNode;y===null&&f.flags&4&&ze(se,f.type,f.memoizedProps,f);break;case 6:break;case 4:break;case 12:break;case 13:if(be&&f.memoizedState===null){var Te=f.alternate;if(Te!==null){var Ke=Te.memoizedState;if(Ke!==null){var yt=Ke.dehydrated;yt!==null&&hc(yt)}}}break;case 19:case 17:case 21:case 22:case 23:break;default:throw Error(a(163))}di||f.flags&512&&zi(f)}catch(Gt){Gi(f,f.return,Gt)}}if(f===c){$e=null;break}if(y=f.sibling,y!==null){y.return=f.return,$e=y;break}$e=f.return}}function zd(c){for(;$e!==null;){var f=$e;if(f===c){$e=null;break}var y=f.sibling;if(y!==null){y.return=f.return,$e=y;break}$e=f.return}}function Zo(c){for(;$e!==null;){var f=$e;try{switch(f.tag){case 0:case 11:case 15:var y=f.return;try{_i(4,f)}catch(Te){Gi(f,y,Te)}break;case 1:var E=f.stateNode;if(typeof E.componentDidMount=="function"){var T=f.return;try{E.componentDidMount()}catch(Te){Gi(f,T,Te)}}var B=f.return;try{zi(f)}catch(Te){Gi(f,B,Te)}break;case 5:var K=f.return;try{zi(f)}catch(Te){Gi(f,K,Te)}}}catch(Te){Gi(f,f.return,Te)}if(f===c){$e=null;break}var se=f.sibling;if(se!==null){se.return=f.return,$e=se;break}$e=f.return}}var $l=0,$o=1,ea=2,Us=3,Za=4;if(typeof Symbol=="function"&&Symbol.for){var ta=Symbol.for;$l=ta("selector.component"),$o=ta("selector.has_pseudo_class"),ea=ta("selector.role"),Us=ta("selector.test_id"),Za=ta("selector.text")}function eu(c){var f=J(c);if(f!=null){if(typeof f.memoizedProps["data-testname"]!="string")throw Error(a(364));return f}if(c=j(c),c===null)throw Error(a(362));return c.stateNode.current}function tu(c,f){switch(f.$$typeof){case $l:if(c.type===f.value)return!0;break;case $o:e:{f=f.value,c=[c,0];for(var y=0;y<c.length;){var E=c[y++],T=c[y++],B=f[T];if(E.tag!==5||!Ce(E)){for(;B!=null&&tu(E,B);)T++,B=f[T];if(T===f.length){f=!0;break e}else for(E=E.child;E!==null;)c.push(E,T),E=E.sibling}}f=!1}return f;case ea:if(c.tag===5&&Ue(c.stateNode,f.value))return!0;break;case Za:if((c.tag===5||c.tag===6)&&(c=pe(c),c!==null&&0<=c.indexOf(f.value)))return!0;break;case Us:if(c.tag===5&&(c=c.memoizedProps["data-testname"],typeof c=="string"&&c.toLowerCase()===f.value.toLowerCase()))return!0;break;default:throw Error(a(365))}return!1}function yo(c){switch(c.$$typeof){case $l:return"<"+(k(c.value)||"Unknown")+">";case $o:return":has("+(yo(c)||"")+")";case ea:return'[role="'+c.value+'"]';case Za:return'"'+c.value+'"';case Us:return'[data-testname="'+c.value+'"]';default:throw Error(a(365))}}function dr(c,f){var y=[];c=[c,0];for(var E=0;E<c.length;){var T=c[E++],B=c[E++],K=f[B];if(T.tag!==5||!Ce(T)){for(;K!=null&&tu(T,K);)B++,K=f[B];if(B===f.length)y.push(T);else for(T=T.child;T!==null;)c.push(T,B),T=T.sibling}}return y}function Os(c,f){if(!qe)throw Error(a(363));c=eu(c),c=dr(c,f),f=[],c=Array.from(c);for(var y=0;y<c.length;){var E=c[y++];if(E.tag===5)Ce(E)||f.push(E.stateNode);else for(E=E.child;E!==null;)c.push(E),E=E.sibling}return f}var Gd=Math.ceil,nu=u.ReactCurrentDispatcher,jr=u.ReactCurrentOwner,Sn=u.ReactCurrentBatchConfig,jt=0,Xn=null,Mn=null,Ln=0,Ri=0,na=Rt(0),On=0,$a=null,ds=0,hr=0,ia=0,ks=null,Yn=null,iu=0,_o=1/0;function ra(){_o=ei()+500}var el=!1,Pn=null,Jr=null,tl=!1,hs=null,sa=0,oa=0,Hs=null,Rn=-1,kn=0;function pn(){return jt&6?ei():Rn!==-1?Rn:Rn=ei()}function Kr(c){return c.mode&1?jt&2&&Ln!==0?Ln&-Ln:Ep.transition!==null?(kn===0&&(c=Vn,Vn<<=1,!(Vn&4194240)&&(Vn=64),kn=c),kn):(c=en,c!==0?c:ke()):1}function Ii(c,f,y){if(50<oa)throw oa=0,Hs=null,Error(a(185));var E=xo(c,f);return E===null?null:(Bo(E,f,y),(!(jt&2)||E!==Xn)&&(E===Xn&&(!(jt&2)&&(hr|=f),On===4&&Ai(E,Ln)),Zi(E,y),f===1&&jt===0&&!(c.mode&1)&&(ra(),Ac&&Mr())),E)}function xo(c,f){c.lanes|=f;var y=c.alternate;for(y!==null&&(y.lanes|=f),y=c,c=c.return;c!==null;)c.childLanes|=f,y=c.alternate,y!==null&&(y.childLanes|=f),y=c,c=c.return;return y.tag===3?y.stateNode:null}function Zi(c,f){var y=c.callbackNode;Mp(c,f);var E=Pl(c,c===Xn?Ln:0);if(E===0)y!==null&&Da(y),c.callbackNode=null,c.callbackPriority=0;else if(f=E&-E,c.callbackPriority!==f){if(y!=null&&Da(y),f===1)c.tag===0?Mc(pr.bind(null,c)):Sc(pr.bind(null,c)),je?wt(function(){jt===0&&Mr()}):Lo(Do,Mr),y=null;else{switch(Es(E)){case 1:y=Do;break;case 4:y=av;break;case 16:y=_c;break;case 536870912:y=xc;break;default:y=_c}y=nf(y,xi.bind(null,c))}c.callbackPriority=f,c.callbackNode=y}}function xi(c,f){if(Rn=-1,kn=0,jt&6)throw Error(a(327));var y=c.callbackNode;if(ps()&&c.callbackNode!==y)return null;var E=Pl(c,c===Xn?Ln:0);if(E===0)return null;if(E&30||E&c.expiredLanes||f)f=au(c,E);else{f=E;var T=jt;jt|=2;var B=Xd();(Xn!==c||Ln!==f)&&(ra(),zs(c,f));do try{Hp();break}catch(se){Wd(c,se)}while(!0);Ui(),nu.current=B,jt=T,Mn!==null?f=0:(Xn=null,Ln=0,f=On)}if(f!==0){if(f===2&&(T=gc(c),T!==0&&(E=T,f=ru(c,T))),f===1)throw y=$a,zs(c,0),Ai(c,E),Zi(c,ei()),y;if(f===6)Ai(c,E);else{if(T=c.current.alternate,!(E&30)&&!Vd(T)&&(f=au(c,E),f===2&&(B=gc(c),B!==0&&(E=B,f=ru(c,B))),f===1))throw y=$a,zs(c,0),Ai(c,E),Zi(c,ei()),y;switch(c.finishedWork=T,c.finishedLanes=E,f){case 0:case 1:throw Error(a(345));case 2:Yr(c,Yn);break;case 3:if(Ai(c,E),(E&130023424)===E&&(f=iu+500-ei(),10<f)){if(Pl(c,0)!==0)break;if(T=c.suspendedLanes,(T&E)!==E){pn(),c.pingedLanes|=c.suspendedLanes&T;break}c.timeoutHandle=Ie(Yr.bind(null,c,Yn),f);break}Yr(c,Yn);break;case 4:if(Ai(c,E),(E&4194240)===E)break;for(f=c.eventTimes,T=-1;0<E;){var K=31-sn(E);B=1<<K,K=f[K],K>T&&(T=K),E&=~B}if(E=T,E=ei()-E,E=(120>E?120:480>E?480:1080>E?1080:1920>E?1920:3e3>E?3e3:4320>E?4320:1960*Gd(E/1960))-E,10<E){c.timeoutHandle=Ie(Yr.bind(null,c,Yn),E);break}Yr(c,Yn);break;case 5:Yr(c,Yn);break;default:throw Error(a(329))}}}return Zi(c,ei()),c.callbackNode===y?xi.bind(null,c):null}function ru(c,f){var y=ks;return c.current.memoizedState.isDehydrated&&(zs(c,f).flags|=256),c=au(c,f),c!==2&&(f=Yn,Yn=y,f!==null&&su(f)),c}function su(c){Yn===null?Yn=c:Yn.push.apply(Yn,c)}function Vd(c){for(var f=c;;){if(f.flags&16384){var y=f.updateQueue;if(y!==null&&(y=y.stores,y!==null))for(var E=0;E<y.length;E++){var T=y[E],B=T.getSnapshot;T=T.value;try{if(!Ni(B(),T))return!1}catch{return!1}}}if(y=f.child,f.subtreeFlags&16384&&y!==null)y.return=f,f=y;else{if(f===c)break;for(;f.sibling===null;){if(f.return===null||f.return===c)return!0;f=f.return}f.sibling.return=f.return,f=f.sibling}}return!0}function Ai(c,f){for(f&=~ia,f&=~hr,c.suspendedLanes|=f,c.pingedLanes&=~f,c=c.expirationTimes;0<f;){var y=31-sn(f),E=1<<y;c[y]=-1,f&=~E}}function pr(c){if(jt&6)throw Error(a(327));ps();var f=Pl(c,0);if(!(f&1))return Zi(c,ei()),null;var y=au(c,f);if(c.tag!==0&&y===2){var E=gc(c);E!==0&&(f=E,y=ru(c,E))}if(y===1)throw y=$a,zs(c,0),Ai(c,f),Zi(c,ei()),y;if(y===6)throw Error(a(345));return c.finishedWork=c.current.alternate,c.finishedLanes=f,Yr(c,Yn),Zi(c,ei()),null}function nl(c){hs!==null&&hs.tag===0&&!(jt&6)&&ps();var f=jt;jt|=1;var y=Sn.transition,E=en;try{if(Sn.transition=null,en=1,c)return c()}finally{en=E,Sn.transition=y,jt=f,!(jt&6)&&Mr()}}function ou(){Ri=na.current,Ye(na)}function zs(c,f){c.finishedWork=null,c.finishedLanes=0;var y=c.timeoutHandle;if(y!==_t&&(c.timeoutHandle=_t,Xe(y)),Mn!==null)for(y=Mn.return;y!==null;){var E=y;switch(yd(E),E.tag){case 1:E=E.type.childContextTypes,E!=null&&$t();break;case 3:Va(),Ye(rn),Ye(nn),Go();break;case 5:Ad(E);break;case 4:Va();break;case 13:Ye(Fn);break;case 19:Ye(Fn);break;case 10:Nl(E.type._context);break;case 22:case 23:ou()}y=y.return}if(Xn=c,Mn=c=Gs(c.current,null),Ln=Ri=f,On=0,$a=null,ia=hr=ds=0,Yn=ks=null,Er!==null){for(f=0;f<Er.length;f++)if(y=Er[f],E=y.interleaved,E!==null){y.interleaved=null;var T=E.next,B=y.pending;if(B!==null){var K=B.next;B.next=T,E.next=K}y.pending=E}Er=null}return c}function Wd(c,f){do{var y=Mn;try{if(Ui(),Ol.current=Ka,Fc){for(var E=Nn.memoizedState;E!==null;){var T=E.queue;T!==null&&(T.pending=null),E=E.next}Fc=!1}if(Vo=0,ui=li=Nn=null,us=!1,Wo=0,jr.current=null,y===null||y.return===null){On=1,$a=f,Mn=null;break}e:{var B=c,K=y.return,se=y,Te=f;if(f=Ln,se.flags|=32768,Te!==null&&typeof Te=="object"&&typeof Te.then=="function"){var Ke=Te,yt=se,Gt=yt.tag;if(!(yt.mode&1)&&(Gt===0||Gt===11||Gt===15)){var Lt=yt.alternate;Lt?(yt.updateQueue=Lt.updateQueue,yt.memoizedState=Lt.memoizedState,yt.lanes=Lt.lanes):(yt.updateQueue=null,yt.memoizedState=null)}var qt=Pd(K);if(qt!==null){qt.flags&=-257,jo(qt,K,se,B,f),qt.mode&1&&Ps(B,Ke,f),f=qt,Te=Ke;var ft=f.updateQueue;if(ft===null){var Si=new Set;Si.add(Te),f.updateQueue=Si}else ft.add(Te);break e}else{if(!(f&1)){Ps(B,Ke,f),tf();break e}Te=Error(a(426))}}else if(Bn&&se.mode&1){var gr=Pd(K);if(gr!==null){!(gr.flags&65536)&&(gr.flags|=256),jo(gr,K,se,B,f),Bc(Te);break e}}B=Te,On!==4&&(On=2),ks===null?ks=[B]:ks.push(B),Te=Id(Te,se),se=K;do{switch(se.tag){case 3:se.flags|=65536,f&=-f,se.lanes|=f;var xe=Up(se,Te,f);Cc(se,xe);break e;case 1:B=Te;var ue=se.type,Ee=se.stateNode;if(!(se.flags&128)&&(typeof ue.getDerivedStateFromError=="function"||Ee!==null&&typeof Ee.componentDidCatch=="function"&&(Jr===null||!Jr.has(Ee)))){se.flags|=65536,f&=-f,se.lanes|=f;var at=Xc(se,B,f);Cc(se,at);break e}}se=se.return}while(se!==null)}Jd(y)}catch(Ct){f=Ct,Mn===y&&y!==null&&(Mn=y=y.return);continue}break}while(!0)}function Xd(){var c=nu.current;return nu.current=Ka,c===null?Ka:c}function tf(){(On===0||On===3||On===2)&&(On=4),Xn===null||!(ds&268435455)&&!(hr&268435455)||Ai(Xn,Ln)}function au(c,f){var y=jt;jt|=2;var E=Xd();Xn===c&&Ln===f||zs(c,f);do try{kp();break}catch(T){Wd(c,T)}while(!0);if(Ui(),jt=y,nu.current=E,Mn!==null)throw Error(a(261));return Xn=null,Ln=0,On}function kp(){for(;Mn!==null;)jd(Mn)}function Hp(){for(;Mn!==null&&!lo();)jd(Mn)}function jd(c){var f=Qd(c.alternate,c,Ri);c.memoizedProps=c.pendingProps,f===null?Jd(c):Mn=f,jr.current=null}function Jd(c){var f=c;do{var y=f.alternate;if(c=f.return,f.flags&32768){if(y=qc(y,f),y!==null){y.flags&=32767,Mn=y;return}if(c!==null)c.flags|=32768,c.subtreeFlags=0,c.deletions=null;else{On=6,Mn=null;return}}else if(y=Kc(y,f,Ri),y!==null){Mn=y;return}if(f=f.sibling,f!==null){Mn=f;return}Mn=f=c}while(f!==null);On===0&&(On=5)}function Yr(c,f){var y=en,E=Sn.transition;try{Sn.transition=null,en=1,zp(c,f,y)}finally{Sn.transition=E,en=y}return null}function zp(c,f,y){do ps();while(hs!==null);if(jt&6)throw Error(a(327));var E=c.finishedWork,T=c.finishedLanes;if(E===null)return null;if(c.finishedWork=null,c.finishedLanes=0,E===c.current)throw Error(a(177));c.callbackNode=null,c.callbackPriority=0;var B=E.lanes|E.childLanes;if(yc(c,B),c===Xn&&(Mn=Xn=null,Ln=0),!(E.subtreeFlags&2064)&&!(E.flags&2064)||tl||(tl=!0,nf(_c,function(){return ps(),null})),B=(E.flags&15990)!==0,E.subtreeFlags&15990||B){B=Sn.transition,Sn.transition=null;var K=en;en=1;var se=jt;jt|=4,jr.current=null,Nd(c,E),cv(c,E),q(c.containerInfo),c.current=E,ql(E),ov(),jt=se,en=K,Sn.transition=B}else c.current=E;if(tl&&(tl=!1,hs=c,sa=T),B=c.pendingLanes,B===0&&(Jr=null),Ll(E.stateNode),Zi(c,ei()),f!==null)for(y=c.onRecoverableError,E=0;E<f.length;E++)y(f[E]);if(el)throw el=!1,c=Pn,Pn=null,c;return sa&1&&c.tag!==0&&ps(),B=c.pendingLanes,B&1?c===Hs?oa++:(oa=0,Hs=c):oa=0,Mr(),null}function ps(){if(hs!==null){var c=Es(sa),f=Sn.transition,y=en;try{if(Sn.transition=null,en=16>c?16:c,hs===null)var E=!1;else{if(c=hs,hs=null,sa=0,jt&6)throw Error(a(331));var T=jt;for(jt|=4,$e=c.current;$e!==null;){var B=$e,K=B.child;if($e.flags&16){var se=B.deletions;if(se!==null){for(var Te=0;Te<se.length;Te++){var Ke=se[Te];for($e=Ke;$e!==null;){var yt=$e;switch(yt.tag){case 0:case 11:case 15:Ns(8,yt,B)}var Gt=yt.child;if(Gt!==null)Gt.return=yt,$e=Gt;else for(;$e!==null;){yt=$e;var Lt=yt.sibling,qt=yt.return;if(Ud(yt),yt===Ke){$e=null;break}if(Lt!==null){Lt.return=qt,$e=Lt;break}$e=qt}}}var ft=B.alternate;if(ft!==null){var Si=ft.child;if(Si!==null){ft.child=null;do{var gr=Si.sibling;Si.sibling=null,Si=gr}while(Si!==null)}}$e=B}}if(B.subtreeFlags&2064&&K!==null)K.return=B,$e=K;else e:for(;$e!==null;){if(B=$e,B.flags&2048)switch(B.tag){case 0:case 11:case 15:Ns(9,B,B.return)}var xe=B.sibling;if(xe!==null){xe.return=B.return,$e=xe;break e}$e=B.return}}var ue=c.current;for($e=ue;$e!==null;){K=$e;var Ee=K.child;if(K.subtreeFlags&2064&&Ee!==null)Ee.return=K,$e=Ee;else e:for(K=ue;$e!==null;){if(se=$e,se.flags&2048)try{switch(se.tag){case 0:case 11:case 15:_i(9,se)}}catch(Ct){Gi(se,se.return,Ct)}if(se===K){$e=null;break e}var at=se.sibling;if(at!==null){at.return=se.return,$e=at;break e}$e=se.return}}if(jt=T,Mr(),ls&&typeof ls.onPostCommitFiberRoot=="function")try{ls.onPostCommitFiberRoot(Bl,c)}catch{}E=!0}return E}finally{en=y,Sn.transition=f}}return!1}function lu(c,f,y){f=Id(y,f),f=Up(c,f,1),uo(c,f),f=pn(),c=xo(c,1),c!==null&&(Bo(c,1,f),Zi(c,f))}function Gi(c,f,y){if(c.tag===3)lu(c,c,y);else for(;f!==null;){if(f.tag===3){lu(f,c,y);break}else if(f.tag===1){var E=f.stateNode;if(typeof f.type.getDerivedStateFromError=="function"||typeof E.componentDidCatch=="function"&&(Jr===null||!Jr.has(E))){c=Id(y,c),c=Xc(f,c,1),uo(f,c),c=pn(),f=xo(f,1),f!==null&&(Bo(f,1,c),Zi(f,c));break}}f=f.return}}function Kd(c,f,y){var E=c.pingCache;E!==null&&E.delete(f),f=pn(),c.pingedLanes|=c.suspendedLanes&y,Xn===c&&(Ln&y)===y&&(On===4||On===3&&(Ln&130023424)===Ln&&500>ei()-iu?zs(c,0):ia|=y),Zi(c,f)}function Yd(c,f){f===0&&(c.mode&1?(f=on,on<<=1,!(on&130023424)&&(on=4194304)):f=1);var y=pn();c=xo(c,f),c!==null&&(Bo(c,f,y),Zi(c,y))}function Gp(c){var f=c.memoizedState,y=0;f!==null&&(y=f.retryLane),Yd(c,y)}function Vp(c,f){var y=0;switch(c.tag){case 13:var E=c.stateNode,T=c.memoizedState;T!==null&&(y=T.retryLane);break;case 19:E=c.stateNode;break;default:throw Error(a(314))}E!==null&&E.delete(f),Yd(c,y)}var Qd;Qd=function(c,f,y){if(c!==null)if(c.memoizedProps!==f.pendingProps||rn.current)fi=!0;else{if(!(c.lanes&y)&&!(f.flags&128))return fi=!1,Qc(c,f,y);fi=!!(c.flags&131072)}else fi=!1,Bn&&f.flags&1048576&&Rp(f,Ic,f.index);switch(f.lanes=0,f.tag){case 2:var E=f.type;c!==null&&(c.alternate=null,f.alternate=null,f.flags|=2),c=f.pendingProps;var T=St(f,nn.current);Fa(f,y),T=Wa(null,f,E,c,T,y);var B=po();return f.flags|=1,typeof T=="object"&&T!==null&&typeof T.render=="function"&&T.$$typeof===void 0?(f.tag=1,f.memoizedState=null,f.updateQueue=null,un(E)?(B=!0,oi(f)):B=!1,f.memoizedState=T.state!==null&&T.state!==void 0?T.state:null,Na(f),T.updater=bc,f.stateNode=T,T._reactInternals=f,gd(f,E,c,y),f=bi(null,f,E,!0,B,y)):(f.tag=0,Bn&&B&&vd(f),Un(null,f,T,y),f=f.child),f;case 16:E=f.elementType;e:{switch(c!==null&&(c.alternate=null,f.alternate=null,f.flags|=2),c=f.pendingProps,T=E._init,E=T(E._payload),f.type=E,T=f.tag=fv(E),c=Ki(E,c),T){case 0:f=Ds(null,f,E,c,y);break e;case 1:f=Ko(null,f,E,c,y);break e;case 11:f=bn(null,f,E,c,y);break e;case 14:f=En(null,f,E,Ki(E.type,c),y);break e}throw Error(a(306,E,""))}return f;case 0:return E=f.type,T=f.pendingProps,T=f.elementType===E?T:Ki(E,T),Ds(c,f,E,T,y);case 1:return E=f.type,T=f.pendingProps,T=f.elementType===E?T:Ki(E,T),Ko(c,f,E,T,y);case 3:e:{if(Jl(f),c===null)throw Error(a(387));E=f.pendingProps,B=f.memoizedState,T=B.element,hd(c,f),Tc(f,E,null,y);var K=f.memoizedState;if(E=K.element,be&&B.isDehydrated)if(B={element:E,isDehydrated:!1,cache:K.cache,transitions:K.transitions},f.updateQueue.baseState=B,f.memoizedState=B,f.flags&256){T=Error(a(423)),f=Ld(c,f,E,y,T);break e}else if(E!==T){T=Error(a(424)),f=Ld(c,f,E,y,T);break e}else for(be&&(vi=lc(f.stateNode.containerInfo),Oi=f,Bn=!0,Tr=null,Oa=!1),y=Bp(f,null,E,y),f.child=y;y;)y.flags=y.flags&-3|4096,y=y.sibling;else{if(ka(),E===T){f=qi(c,f,y);break e}Un(c,f,E,y)}f=f.child}return f;case 5:return Lp(f),c===null&&fo(f),E=f.type,T=f.pendingProps,B=c!==null?c.memoizedProps:null,K=T.children,we(E,T)?K=null:B!==null&&we(E,B)&&(f.flags|=32),ki(c,f),Un(c,f,K,y),f.child;case 6:return c===null&&fo(f),null;case 13:return Dd(c,f,y);case 4:return Lc(f,f.stateNode.containerInfo),E=f.pendingProps,c===null?f.child=Rs(f,null,E,y):Un(c,f,E,y),f.child;case 11:return E=f.type,T=f.pendingProps,T=f.elementType===E?T:Ki(E,T),bn(c,f,E,T,y);case 7:return Un(c,f,f.pendingProps,y),f.child;case 8:return Un(c,f,f.pendingProps.children,y),f.child;case 12:return Un(c,f,f.pendingProps.children,y),f.child;case 10:e:{if(E=f.type._context,T=f.pendingProps,B=f.memoizedProps,K=T.value,No(f,E,K),B!==null)if(Ni(B.value,K)){if(B.children===T.children&&!rn.current){f=qi(c,f,y);break e}}else for(B=f.child,B!==null&&(B.return=f);B!==null;){var se=B.dependencies;if(se!==null){K=B.child;for(var Te=se.firstContext;Te!==null;){if(Te.context===E){if(B.tag===1){Te=Cs(-1,y&-y),Te.tag=2;var Ke=B.updateQueue;if(Ke!==null){Ke=Ke.shared;var yt=Ke.pending;yt===null?Te.next=Te:(Te.next=yt.next,yt.next=Te),Ke.pending=Te}}B.lanes|=y,Te=B.alternate,Te!==null&&(Te.lanes|=y),Uo(B.return,y,f),se.lanes|=y;break}Te=Te.next}}else if(B.tag===10)K=B.type===f.type?null:B.child;else if(B.tag===18){if(K=B.return,K===null)throw Error(a(341));K.lanes|=y,se=K.alternate,se!==null&&(se.lanes|=y),Uo(K,y,f),K=B.sibling}else K=B.child;if(K!==null)K.return=B;else for(K=B;K!==null;){if(K===f){K=null;break}if(B=K.sibling,B!==null){B.return=K.return,K=B;break}K=K.return}B=K}Un(c,f,T.children,y),f=f.child}return f;case 9:return T=f.type,E=f.pendingProps.children,Fa(f,y),T=Yi(T),E=E(T),f.flags|=1,Un(c,f,E,y),f.child;case 14:return E=f.type,T=Ki(E,f.pendingProps),T=Ki(E.type,T),En(c,f,E,T,y);case 15:return Ls(c,f,f.type,f.pendingProps,y);case 17:return E=f.type,T=f.pendingProps,T=f.elementType===E?T:Ki(E,T),c!==null&&(c.alternate=null,f.alternate=null,f.flags|=2),f.tag=1,un(E)?(c=!0,oi(f)):c=!1,Fa(f,y),Tp(f,E,T),gd(f,E,T,y),bi(null,f,E,!0,c,y);case 19:return Qo(c,f,y);case 22:return yi(c,f,y)}throw Error(a(156,f.tag))};function nf(c,f){return Lo(c,f)}function Wp(c,f,y,E){this.tag=c,this.key=y,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.ref=null,this.pendingProps=f,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=E,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function mr(c,f,y,E){return new Wp(c,f,y,E)}function rf(c){return c=c.prototype,!(!c||!c.isReactComponent)}function fv(c){if(typeof c=="function")return rf(c)?1:0;if(c!=null){if(c=c.$$typeof,c===C)return 11;if(c===b)return 14}return 2}function Gs(c,f){var y=c.alternate;return y===null?(y=mr(c.tag,f,c.key,c.mode),y.elementType=c.elementType,y.type=c.type,y.stateNode=c.stateNode,y.alternate=c,c.alternate=y):(y.pendingProps=f,y.type=c.type,y.flags=0,y.subtreeFlags=0,y.deletions=null),y.flags=c.flags&14680064,y.childLanes=c.childLanes,y.lanes=c.lanes,y.child=c.child,y.memoizedProps=c.memoizedProps,y.memoizedState=c.memoizedState,y.updateQueue=c.updateQueue,f=c.dependencies,y.dependencies=f===null?null:{lanes:f.lanes,firstContext:f.firstContext},y.sibling=c.sibling,y.index=c.index,y.ref=c.ref,y}function sf(c,f,y,E,T,B){var K=2;if(E=c,typeof c=="function")rf(c)&&(K=1);else if(typeof c=="string")K=5;else e:switch(c){case m:return aa(y.children,T,B,f);case g:K=8,T|=8;break;case v:return c=mr(12,y,f,T|2),c.elementType=v,c.lanes=B,c;case M:return c=mr(13,y,f,T),c.elementType=M,c.lanes=B,c;case S:return c=mr(19,y,f,T),c.elementType=S,c.lanes=B,c;case P:return uu(y,T,B,f);default:if(typeof c=="object"&&c!==null)switch(c.$$typeof){case _:K=10;break e;case A:K=9;break e;case C:K=11;break e;case b:K=14;break e;case R:K=16,E=null;break e}throw Error(a(130,c==null?c:typeof c,""))}return f=mr(K,y,f,T),f.elementType=c,f.type=E,f.lanes=B,f}function aa(c,f,y,E){return c=mr(7,c,E,f),c.lanes=y,c}function uu(c,f,y,E){return c=mr(22,c,E,f),c.elementType=P,c.lanes=y,c.stateNode={},c}function of(c,f,y){return c=mr(6,c,null,f),c.lanes=y,c}function af(c,f,y){return f=mr(4,c.children!==null?c.children:[],c.key,f),f.lanes=y,f.stateNode={containerInfo:c.containerInfo,pendingChildren:null,implementation:c.implementation},f}function lf(c,f,y,E,T){this.tag=f,this.containerInfo=c,this.finishedWork=this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=_t,this.callbackNode=this.pendingContext=this.context=null,this.callbackPriority=0,this.eventTimes=vc(0),this.expirationTimes=vc(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=vc(0),this.identifierPrefix=E,this.onRecoverableError=T,be&&(this.mutableSourceEagerHydrationData=null)}function Xp(c,f,y,E,T,B,K,se,Te){return c=new lf(c,f,y,se,Te),f===1?(f=1,B===!0&&(f|=8)):f=0,B=mr(3,null,null,f),c.current=B,B.stateNode=c,B.memoizedState={element:E,isDehydrated:y,cache:null,transitions:null},Na(B),c}function jp(c){if(!c)return kt;c=c._reactInternals;e:{if(D(c)!==c||c.tag!==1)throw Error(a(170));var f=c;do{switch(f.tag){case 3:f=f.stateNode.context;break e;case 1:if(un(f.type)){f=f.stateNode.__reactInternalMemoizedMergedChildContext;break e}}f=f.return}while(f!==null);throw Error(a(171))}if(c.tag===1){var y=c.type;if(un(y))return Ms(c,y,f)}return f}function Jp(c){var f=c._reactInternals;if(f===void 0)throw typeof c.render=="function"?Error(a(188)):(c=Object.keys(c).join(","),Error(a(268,c)));return c=oe(f),c===null?null:c.stateNode}function Ir(c,f){if(c=c.memoizedState,c!==null&&c.dehydrated!==null){var y=c.retryLane;c.retryLane=y!==0&&y<f?y:f}}function cu(c,f){Ir(c,f),(c=c.alternate)&&Ir(c,f)}function uf(c){return c=oe(c),c===null?null:c.stateNode}function Kp(){return null}return t.attemptContinuousHydration=function(c){if(c.tag===13){var f=pn();Ii(c,134217728,f),cu(c,134217728)}},t.attemptHydrationAtCurrentPriority=function(c){if(c.tag===13){var f=pn(),y=Kr(c);Ii(c,y,f),cu(c,y)}},t.attemptSynchronousHydration=function(c){switch(c.tag){case 3:var f=c.stateNode;if(f.current.memoizedState.isDehydrated){var y=Ji(f.pendingLanes);y!==0&&(as(f,y|1),Zi(f,ei()),!(jt&6)&&(ra(),Mr()))}break;case 13:var E=pn();nl(function(){return Ii(c,1,E)}),cu(c,1)}},t.batchedUpdates=function(c,f){var y=jt;jt|=1;try{return c(f)}finally{jt=y,jt===0&&(ra(),Ac&&Mr())}},t.createComponentSelector=function(c){return{$$typeof:$l,value:c}},t.createContainer=function(c,f,y,E,T,B,K){return Xp(c,f,!1,null,y,E,T,B,K)},t.createHasPseudoClassSelector=function(c){return{$$typeof:$o,value:c}},t.createHydrationContainer=function(c,f,y,E,T,B,K,se,Te){return c=Xp(y,E,!0,c,T,B,K,se,Te),c.context=jp(null),y=c.current,E=pn(),T=Kr(y),B=Cs(E,T),B.callback=f??null,uo(y,B),c.current.lanes=T,Bo(c,T,E),Zi(c,E),c},t.createPortal=function(c,f,y){var E=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:h,key:E==null?null:""+E,children:c,containerInfo:f,implementation:y}},t.createRoleSelector=function(c){return{$$typeof:ea,value:c}},t.createTestNameSelector=function(c){return{$$typeof:Us,value:c}},t.createTextSelector=function(c){return{$$typeof:Za,value:c}},t.deferredUpdates=function(c){var f=en,y=Sn.transition;try{return Sn.transition=null,en=16,c()}finally{en=f,Sn.transition=y}},t.discreteUpdates=function(c,f,y,E,T){var B=en,K=Sn.transition;try{return Sn.transition=null,en=1,c(f,y,E,T)}finally{en=B,Sn.transition=K,jt===0&&ra()}},t.findAllNodes=Os,t.findBoundingRects=function(c,f){if(!qe)throw Error(a(363));f=Os(c,f),c=[];for(var y=0;y<f.length;y++)c.push(O(f[y]));for(f=c.length-1;0<f;f--){y=c[f];for(var E=y.x,T=E+y.width,B=y.y,K=B+y.height,se=f-1;0<=se;se--)if(f!==se){var Te=c[se],Ke=Te.x,yt=Ke+Te.width,Gt=Te.y,Lt=Gt+Te.height;if(E>=Ke&&B>=Gt&&T<=yt&&K<=Lt){c.splice(f,1);break}else if(E!==Ke||y.width!==Te.width||Lt<B||Gt>K){if(!(B!==Gt||y.height!==Te.height||yt<E||Ke>T)){Ke>E&&(Te.width+=Ke-E,Te.x=E),yt<T&&(Te.width=T-Ke),c.splice(f,1);break}}else{Gt>B&&(Te.height+=Gt-B,Te.y=B),Lt<K&&(Te.height=K-Gt),c.splice(f,1);break}}}return c},t.findHostInstance=Jp,t.findHostInstanceWithNoPortals=function(c){return c=V(c),c=c!==null?ge(c):null,c===null?null:c.stateNode},t.findHostInstanceWithWarning=function(c){return Jp(c)},t.flushControlled=function(c){var f=jt;jt|=1;var y=Sn.transition,E=en;try{Sn.transition=null,en=1,c()}finally{en=E,Sn.transition=y,jt=f,jt===0&&(ra(),Mr())}},t.flushPassiveEffects=ps,t.flushSync=nl,t.focusWithin=function(c,f){if(!qe)throw Error(a(363));for(c=eu(c),f=dr(c,f),f=Array.from(f),c=0;c<f.length;){var y=f[c++];if(!Ce(y)){if(y.tag===5&&Pe(y.stateNode))return!0;for(y=y.child;y!==null;)f.push(y),y=y.sibling}}return!1},t.getCurrentUpdatePriority=function(){return en},t.getFindAllNodesFailureDescription=function(c,f){if(!qe)throw Error(a(363));var y=0,E=[];c=[eu(c),0];for(var T=0;T<c.length;){var B=c[T++],K=c[T++],se=f[K];if((B.tag!==5||!Ce(B))&&(tu(B,se)&&(E.push(yo(se)),K++,K>y&&(y=K)),K<f.length))for(B=B.child;B!==null;)c.push(B,K),B=B.sibling}if(y<f.length){for(c=[];y<f.length;y++)c.push(yo(f[y]));return`findAllNodes was able to match part of the selector:
  `+(E.join(" > ")+`

No matching component was found for:
  `)+c.join(" > ")}return null},t.getPublicRootInstance=function(c){if(c=c.current,!c.child)return null;switch(c.child.tag){case 5:return he(c.child.stateNode);default:return c.child.stateNode}},t.injectIntoDevTools=function(c){if(c={bundleType:c.bundleType,version:c.version,rendererPackageName:c.rendererPackageName,rendererConfig:c.rendererConfig,overrideHookState:null,overrideHookStateDeletePath:null,overrideHookStateRenamePath:null,overrideProps:null,overridePropsDeletePath:null,overridePropsRenamePath:null,setErrorHandler:null,setSuspenseHandler:null,scheduleUpdate:null,currentDispatcherRef:u.ReactCurrentDispatcher,findHostInstanceByFiber:uf,findFiberByHostInstance:c.findFiberByHostInstance||Kp,findHostInstancesForRefresh:null,scheduleRefresh:null,scheduleRoot:null,setRefreshHandler:null,getCurrentFiber:null,reconcilerVersion:"18.0.0-fc46dba67-20220329"},typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u")c=!1;else{var f=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(f.isDisabled||!f.supportsFiber)c=!0;else{try{Bl=f.inject(c),ls=f}catch{}c=!!f.checkDCE}}return c},t.isAlreadyRendering=function(){return!1},t.observeVisibleRects=function(c,f,y,E){if(!qe)throw Error(a(363));c=Os(c,f);var T=ot(c,y,E).disconnect;return{disconnect:function(){T()}}},t.registerMutableSourceForHydration=function(c,f){var y=f._getVersion;y=y(f._source),c.mutableSourceEagerHydrationData==null?c.mutableSourceEagerHydrationData=[f,y]:c.mutableSourceEagerHydrationData.push(f,y)},t.runWithPriority=function(c,f){var y=en;try{return en=c,f()}finally{en=y}},t.shouldError=function(){return null},t.shouldSuspend=function(){return!1},t.updateContainer=function(c,f,y,E){var T=f.current,B=pn(),K=Kr(T);return y=jp(y),f.context===null?f.context=y:f.pendingContext=y,f=Cs(B,K),f.payload={element:c},E=E===void 0?null:E,E!==null&&(f.callback=E),uo(T,f),c=Ii(T,K,B),c!==null&&wc(c,T,K),K},t}),Ly}var TS;function aF(){return TS||(TS=1,Iy.exports=oF()),Iy.exports}var lF=aF();const uF=hC(lF);var Dy={exports:{}},Fy={};/**
 * @license React
 * scheduler.production.min.js
 *
 * Copyright (c) Facebook, Inc. and its affiliates.
 *
 * This source code is licensed under the MIT license found in the
 * LICENSE file in the root directory of this source tree.
 */var bS;function cF(){return bS||(bS=1,function(i){function e(H,Z){var q=H.length;H.push(Z);e:for(;0<q;){var W=q-1>>>1,ne=H[W];if(0<r(ne,Z))H[W]=Z,H[q]=ne,q=W;else break e}}function t(H){return H.length===0?null:H[0]}function n(H){if(H.length===0)return null;var Z=H[0],q=H.pop();if(q!==Z){H[0]=q;e:for(var W=0,ne=H.length,Fe=ne>>>1;W<Fe;){var ae=2*(W+1)-1,we=H[ae],De=ae+1,Ie=H[De];if(0>r(we,q))De<ne&&0>r(Ie,we)?(H[W]=Ie,H[De]=q,W=De):(H[W]=we,H[ae]=q,W=ae);else if(De<ne&&0>r(Ie,q))H[W]=Ie,H[De]=q,W=De;else break e}}return Z}function r(H,Z){var q=H.sortIndex-Z.sortIndex;return q!==0?q:H.id-Z.id}if(typeof performance=="object"&&typeof performance.now=="function"){var s=performance;i.unstable_now=function(){return s.now()}}else{var a=Date,u=a.now();i.unstable_now=function(){return a.now()-u}}var d=[],h=[],m=1,g=null,v=3,_=!1,A=!1,C=!1,M=typeof setTimeout=="function"?setTimeout:null,S=typeof clearTimeout=="function"?clearTimeout:null,b=typeof setImmediate<"u"?setImmediate:null;typeof navigator<"u"&&navigator.scheduling!==void 0&&navigator.scheduling.isInputPending!==void 0&&navigator.scheduling.isInputPending.bind(navigator.scheduling);function R(H){for(var Z=t(h);Z!==null;){if(Z.callback===null)n(h);else if(Z.startTime<=H)n(h),Z.sortIndex=Z.expirationTime,e(d,Z);else break;Z=t(h)}}function P(H){if(C=!1,R(H),!A)if(t(d)!==null)A=!0,he(U);else{var Z=t(h);Z!==null&&_e(P,Z.startTime-H)}}function U(H,Z){A=!1,C&&(C=!1,S(G),G=-1),_=!0;var q=v;try{for(R(Z),g=t(d);g!==null&&(!(g.expirationTime>Z)||H&&!V());){var W=g.callback;if(typeof W=="function"){g.callback=null,v=g.priorityLevel;var ne=W(g.expirationTime<=Z);Z=i.unstable_now(),typeof ne=="function"?g.callback=ne:g===t(d)&&n(d),R(Z)}else n(d);g=t(d)}if(g!==null)var Fe=!0;else{var ae=t(h);ae!==null&&_e(P,ae.startTime-Z),Fe=!1}return Fe}finally{g=null,v=q,_=!1}}var F=!1,k=null,G=-1,D=5,L=-1;function V(){return!(i.unstable_now()-L<D)}function oe(){if(k!==null){var H=i.unstable_now();L=H;var Z=!0;try{Z=k(!0,H)}finally{Z?ie():(F=!1,k=null)}}else F=!1}var ie;if(typeof b=="function")ie=function(){b(oe)};else if(typeof MessageChannel<"u"){var ge=new MessageChannel,ye=ge.port2;ge.port1.onmessage=oe,ie=function(){ye.postMessage(null)}}else ie=function(){M(oe,0)};function he(H){k=H,F||(F=!0,ie())}function _e(H,Z){G=M(function(){H(i.unstable_now())},Z)}i.unstable_IdlePriority=5,i.unstable_ImmediatePriority=1,i.unstable_LowPriority=4,i.unstable_NormalPriority=3,i.unstable_Profiling=null,i.unstable_UserBlockingPriority=2,i.unstable_cancelCallback=function(H){H.callback=null},i.unstable_continueExecution=function(){A||_||(A=!0,he(U))},i.unstable_forceFrameRate=function(H){0>H||125<H?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):D=0<H?Math.floor(1e3/H):5},i.unstable_getCurrentPriorityLevel=function(){return v},i.unstable_getFirstCallbackNode=function(){return t(d)},i.unstable_next=function(H){switch(v){case 1:case 2:case 3:var Z=3;break;default:Z=v}var q=v;v=Z;try{return H()}finally{v=q}},i.unstable_pauseExecution=function(){},i.unstable_requestPaint=function(){},i.unstable_runWithPriority=function(H,Z){switch(H){case 1:case 2:case 3:case 4:case 5:break;default:H=3}var q=v;v=H;try{return Z()}finally{v=q}},i.unstable_scheduleCallback=function(H,Z,q){var W=i.unstable_now();switch(typeof q=="object"&&q!==null?(q=q.delay,q=typeof q=="number"&&0<q?W+q:W):q=W,H){case 1:var ne=-1;break;case 2:ne=250;break;case 5:ne=1073741823;break;case 4:ne=1e4;break;default:ne=5e3}return ne=q+ne,H={id:m++,callback:Z,priorityLevel:H,startTime:q,expirationTime:ne,sortIndex:-1},q>W?(H.sortIndex=q,e(h,H),t(d)===null&&H===t(h)&&(C?(S(G),G=-1):C=!0,_e(P,q-W))):(H.sortIndex=ne,e(d,H),A||_||(A=!0,he(U))),H},i.unstable_shouldYield=V,i.unstable_wrapCallback=function(H){var Z=v;return function(){var q=v;v=Z;try{return H.apply(this,arguments)}finally{v=q}}}}(Fy)),Fy}var RS;function fF(){return RS||(RS=1,Dy.exports=cF()),Dy.exports}var IS=fF();const Bx={},dF=i=>void Object.assign(Bx,i);function hF(i,e){function t(m,{args:g=[],attach:v,..._},A){let C=`${m[0].toUpperCase()}${m.slice(1)}`,M;if(m==="primitive"){if(_.object===void 0)throw new Error("R3F: Primitives without 'object' are invalid!");const S=_.object;M=Ff(S,{type:m,root:A,attach:v,primitive:!0})}else{const S=Bx[C];if(!S)throw new Error(`R3F: ${C} is not part of the THREE namespace! Did you forget to extend? See: https://docs.pmnd.rs/react-three-fiber/api/objects#using-3rd-party-objects-declaratively`);if(!Array.isArray(g))throw new Error("R3F: The args prop must be an array!");M=Ff(new S(...g),{type:m,root:A,attach:v,memoizedProps:{args:g}})}return M.__r3f.attach===void 0&&(M.isBufferGeometry?M.__r3f.attach="geometry":M.isMaterial&&(M.__r3f.attach="material")),C!=="inject"&&Oy(M,_),M}function n(m,g){let v=!1;if(g){var _,A;(_=g.__r3f)!=null&&_.attach?Uy(m,g,g.__r3f.attach):g.isObject3D&&m.isObject3D&&(m.add(g),v=!0),v||(A=m.__r3f)==null||A.objects.push(g),g.__r3f||Ff(g,{}),g.__r3f.parent=m,M_(g),Nf(g)}}function r(m,g,v){let _=!1;if(g){var A,C;if((A=g.__r3f)!=null&&A.attach)Uy(m,g,g.__r3f.attach);else if(g.isObject3D&&m.isObject3D){g.parent=m,g.dispatchEvent({type:"added"}),m.dispatchEvent({type:"childadded",child:g});const M=m.children.filter(b=>b!==g),S=M.indexOf(v);m.children=[...M.slice(0,S),g,...M.slice(S)],_=!0}_||(C=m.__r3f)==null||C.objects.push(g),g.__r3f||Ff(g,{}),g.__r3f.parent=m,M_(g),Nf(g)}}function s(m,g,v=!1){m&&[...m].forEach(_=>a(g,_,v))}function a(m,g,v){if(g){var _,A,C;if(g.__r3f&&(g.__r3f.parent=null),(_=m.__r3f)!=null&&_.objects&&(m.__r3f.objects=m.__r3f.objects.filter(P=>P!==g)),(A=g.__r3f)!=null&&A.attach)FS(m,g,g.__r3f.attach);else if(g.isObject3D&&m.isObject3D){var M;m.remove(g),(M=g.__r3f)!=null&&M.root&&AF(Sg(g),g)}const b=(C=g.__r3f)==null?void 0:C.primitive,R=!b&&(v===void 0?g.dispose!==null:v);if(!b){var S;s((S=g.__r3f)==null?void 0:S.objects,g,R),s(g.children,g,R)}if(delete g.__r3f,R&&g.dispose&&g.type!=="Scene"){const P=()=>{try{g.dispose()}catch{}};typeof IS_REACT_ACT_ENVIRONMENT>"u"?IS.unstable_scheduleCallback(IS.unstable_IdlePriority,P):P()}Nf(m)}}function u(m,g,v,_){var A;const C=(A=m.__r3f)==null?void 0:A.parent;if(!C)return;const M=t(g,v,m.__r3f.root);if(m.children){for(const S of m.children)S.__r3f&&n(M,S);m.children=m.children.filter(S=>!S.__r3f)}m.__r3f.objects.forEach(S=>n(M,S)),m.__r3f.objects=[],m.__r3f.autoRemovedBeforeAppend||a(C,m),M.parent&&(M.__r3f.autoRemovedBeforeAppend=!0),n(C,M),M.raycast&&M.__r3f.eventCount&&Sg(M).getState().internal.interaction.push(M),[_,_.alternate].forEach(S=>{S!==null&&(S.stateNode=M,S.ref&&(typeof S.ref=="function"?S.ref(M):S.ref.current=M))})}const d=()=>{};return{reconciler:uF({createInstance:t,removeChild:a,appendChild:n,appendInitialChild:n,insertBefore:r,supportsMutation:!0,isPrimaryRenderer:!1,supportsPersistence:!1,supportsHydration:!1,noTimeout:-1,appendChildToContainer:(m,g)=>{if(!g)return;const v=m.getState().scene;v.__r3f&&(v.__r3f.root=m,n(v,g))},removeChildFromContainer:(m,g)=>{g&&a(m.getState().scene,g)},insertInContainerBefore:(m,g,v)=>{if(!g||!v)return;const _=m.getState().scene;_.__r3f&&r(_,g,v)},getRootHostContext:()=>null,getChildHostContext:m=>m,finalizeInitialChildren(m){var g;return!!((g=m==null?void 0:m.__r3f)!=null?g:{}).handlers},prepareUpdate(m,g,v,_){var A;if(((A=m==null?void 0:m.__r3f)!=null?A:{}).primitive&&_.object&&_.object!==m)return[!0];{const{args:M=[],children:S,...b}=_,{args:R=[],children:P,...U}=v;if(!Array.isArray(M))throw new Error("R3F: the args prop must be an array!");if(M.some((k,G)=>k!==R[G]))return[!0];const F=WE(m,b,U,!0);return F.changes.length?[!1,F]:null}},commitUpdate(m,[g,v],_,A,C,M){g?u(m,_,C,M):Oy(m,v)},commitMount(m,g,v,_){var A;const C=(A=m.__r3f)!=null?A:{};m.raycast&&C.handlers&&C.eventCount&&Sg(m).getState().internal.interaction.push(m)},getPublicInstance:m=>m,prepareForCommit:()=>null,preparePortalMount:m=>Ff(m.getState().scene),resetAfterCommit:()=>{},shouldSetTextContent:()=>!1,clearContainer:()=>!1,hideInstance(m){var g;const{attach:v,parent:_}=(g=m.__r3f)!=null?g:{};v&&_&&FS(_,m,v),m.isObject3D&&(m.visible=!1),Nf(m)},unhideInstance(m,g){var v;const{attach:_,parent:A}=(v=m.__r3f)!=null?v:{};_&&A&&Uy(A,m,_),(m.isObject3D&&g.visible==null||g.visible)&&(m.visible=!0),Nf(m)},createTextInstance:d,hideTextInstance:d,unhideTextInstance:d,getCurrentEventPriority:()=>e?e():Hf.DefaultEventPriority,beforeActiveInstanceBlur:()=>{},afterActiveInstanceBlur:()=>{},detachDeletedInstance:()=>{},now:typeof performance<"u"&&Dn.fun(performance.now)?performance.now:Dn.fun(Date.now)?Date.now:()=>0,scheduleTimeout:Dn.fun(setTimeout)?setTimeout:void 0,cancelTimeout:Dn.fun(clearTimeout)?clearTimeout:void 0}),applyProps:Oy}}var PS,BS;const Ny=i=>"colorSpace"in i||"outputColorSpace"in i,OE=()=>{var i;return(i=Bx.ColorManagement)!=null?i:null},kE=i=>i&&i.isOrthographicCamera,pF=i=>i&&i.hasOwnProperty("current"),gp=typeof window<"u"&&((PS=window.document)!=null&&PS.createElement||((BS=window.navigator)==null?void 0:BS.product)==="ReactNative")?Y.useLayoutEffect:Y.useEffect;function HE(i){const e=Y.useRef(i);return gp(()=>void(e.current=i),[i]),e}function mF({set:i}){return gp(()=>(i(new Promise(()=>null)),()=>i(!1)),[i]),null}class zE extends Y.Component{constructor(...e){super(...e),this.state={error:!1}}componentDidCatch(e){this.props.set(e)}render(){return this.state.error?null:this.props.children}}zE.getDerivedStateFromError=()=>({error:!0});const GE="__default",LS=new Map,gF=i=>i&&!!i.memoized&&!!i.changes;function VE(i){var e;const t=typeof window<"u"?(e=window.devicePixelRatio)!=null?e:2:1;return Array.isArray(i)?Math.min(Math.max(i[0],t),i[1]):i}const _h=i=>{var e;return(e=i.__r3f)==null?void 0:e.root.getState()};function Sg(i){let e=i.__r3f.root;for(;e.getState().previousRoot;)e=e.getState().previousRoot;return e}const Dn={obj:i=>i===Object(i)&&!Dn.arr(i)&&typeof i!="function",fun:i=>typeof i=="function",str:i=>typeof i=="string",num:i=>typeof i=="number",boo:i=>typeof i=="boolean",und:i=>i===void 0,arr:i=>Array.isArray(i),equ(i,e,{arrays:t="shallow",objects:n="reference",strict:r=!0}={}){if(typeof i!=typeof e||!!i!=!!e)return!1;if(Dn.str(i)||Dn.num(i)||Dn.boo(i))return i===e;const s=Dn.obj(i);if(s&&n==="reference")return i===e;const a=Dn.arr(i);if(a&&t==="reference")return i===e;if((a||s)&&i===e)return!0;let u;for(u in i)if(!(u in e))return!1;if(s&&t==="shallow"&&n==="shallow"){for(u in r?e:i)if(!Dn.equ(i[u],e[u],{strict:r,objects:"reference"}))return!1}else for(u in r?e:i)if(i[u]!==e[u])return!1;if(Dn.und(u)){if(a&&i.length===0&&e.length===0||s&&Object.keys(i).length===0&&Object.keys(e).length===0)return!0;if(i!==e)return!1}return!0}};function vF(i){const e={nodes:{},materials:{}};return i&&i.traverse(t=>{t.name&&(e.nodes[t.name]=t),t.material&&!e.materials[t.material.name]&&(e.materials[t.material.name]=t.material)}),e}function yF(i){i.dispose&&i.type!=="Scene"&&i.dispose();for(const e in i)e.dispose==null||e.dispose(),delete i[e]}function Ff(i,e){const t=i;return t.__r3f={type:"",root:null,previousAttach:null,memoizedProps:{},eventCount:0,handlers:{},objects:[],parent:null,...e},i}function S_(i,e){let t=i;if(e.includes("-")){const n=e.split("-"),r=n.pop();return t=n.reduce((s,a)=>s[a],i),{target:t,key:r}}else return{target:t,key:e}}const DS=/-\d+$/;function Uy(i,e,t){if(Dn.str(t)){if(DS.test(t)){const s=t.replace(DS,""),{target:a,key:u}=S_(i,s);Array.isArray(a[u])||(a[u]=[])}const{target:n,key:r}=S_(i,t);e.__r3f.previousAttach=n[r],n[r]=e}else e.__r3f.previousAttach=t(i,e)}function FS(i,e,t){var n,r;if(Dn.str(t)){const{target:s,key:a}=S_(i,t),u=e.__r3f.previousAttach;u===void 0?delete s[a]:s[a]=u}else(n=e.__r3f)==null||n.previousAttach==null||n.previousAttach(i,e);(r=e.__r3f)==null||delete r.previousAttach}function WE(i,{children:e,key:t,ref:n,...r},{children:s,key:a,ref:u,...d}={},h=!1){const m=i.__r3f,g=Object.entries(r),v=[];if(h){const A=Object.keys(d);for(let C=0;C<A.length;C++)r.hasOwnProperty(A[C])||g.unshift([A[C],GE+"remove"])}g.forEach(([A,C])=>{var M;if((M=i.__r3f)!=null&&M.primitive&&A==="object"||Dn.equ(C,d[A]))return;if(/^on(Pointer|Click|DoubleClick|ContextMenu|Wheel)/.test(A))return v.push([A,C,!0,[]]);let S=[];A.includes("-")&&(S=A.split("-")),v.push([A,C,!1,S]);for(const b in r){const R=r[b];b.startsWith(`${A}-`)&&v.push([b,R,!1,b.split("-")])}});const _={...r};return m!=null&&m.memoizedProps&&m!=null&&m.memoizedProps.args&&(_.args=m.memoizedProps.args),m!=null&&m.memoizedProps&&m!=null&&m.memoizedProps.attach&&(_.attach=m.memoizedProps.attach),{memoized:_,changes:v}}function Oy(i,e){var t;const n=i.__r3f,r=n==null?void 0:n.root,s=r==null||r.getState==null?void 0:r.getState(),{memoized:a,changes:u}=gF(e)?e:WE(i,e),d=n==null?void 0:n.eventCount;i.__r3f&&(i.__r3f.memoizedProps=a);for(let v=0;v<u.length;v++){let[_,A,C,M]=u[v];if(Ny(i)){const P="srgb",U="srgb-linear";_==="encoding"?(_="colorSpace",A=A===3001?P:U):_==="outputEncoding"&&(_="outputColorSpace",A=A===3001?P:U)}let S=i,b=S[_];if(M.length&&(b=M.reduce((R,P)=>R[P],i),!(b&&b.set))){const[R,...P]=M.reverse();S=P.reverse().reduce((U,F)=>U[F],i),_=R}if(A===GE+"remove")if(S.constructor){let R=LS.get(S.constructor);R||(R=new S.constructor,LS.set(S.constructor,R)),A=R[_]}else A=0;if(C&&n)A?n.handlers[_]=A:delete n.handlers[_],n.eventCount=Object.keys(n.handlers).length;else if(b&&b.set&&(b.copy||b instanceof ju)){if(Array.isArray(A))b.fromArray?b.fromArray(A):b.set(...A);else if(b.copy&&A&&A.constructor&&b.constructor===A.constructor)b.copy(A);else if(A!==void 0){var h;const R=(h=b)==null?void 0:h.isColor;!R&&b.setScalar?b.setScalar(A):b instanceof ju&&A instanceof ju?b.mask=A.mask:b.set(A),!OE()&&s&&!s.linear&&R&&b.convertSRGBToLinear()}}else{var m;if(S[_]=A,(m=S[_])!=null&&m.isTexture&&S[_].format===rr&&S[_].type===to&&s){const R=S[_];Ny(R)&&Ny(s.gl)?R.colorSpace=s.gl.outputColorSpace:R.encoding=s.gl.outputEncoding}}Nf(i)}if(n&&n.parent&&i.raycast&&d!==n.eventCount){const v=Sg(i).getState().internal,_=v.interaction.indexOf(i);_>-1&&v.interaction.splice(_,1),n.eventCount&&v.interaction.push(i)}return!(u.length===1&&u[0][0]==="onUpdate")&&u.length&&(t=i.__r3f)!=null&&t.parent&&M_(i),i}function Nf(i){var e,t;const n=(e=i.__r3f)==null||(t=e.root)==null||t.getState==null?void 0:t.getState();n&&n.internal.frames===0&&n.invalidate()}function M_(i){i.onUpdate==null||i.onUpdate(i)}function _F(i,e){i.manual||(kE(i)?(i.left=e.width/-2,i.right=e.width/2,i.top=e.height/2,i.bottom=e.height/-2):i.aspect=e.width/e.height,i.updateProjectionMatrix(),i.updateMatrixWorld())}function lg(i){return(i.eventObject||i.object).uuid+"/"+i.index+i.instanceId}function xF(){var i;const e=typeof self<"u"&&self||typeof window<"u"&&window;if(!e)return Hf.DefaultEventPriority;switch((i=e.event)==null?void 0:i.type){case"click":case"contextmenu":case"dblclick":case"pointercancel":case"pointerdown":case"pointerup":return Hf.DiscreteEventPriority;case"pointermove":case"pointerout":case"pointerover":case"pointerenter":case"pointerleave":case"wheel":return Hf.ContinuousEventPriority;default:return Hf.DefaultEventPriority}}function XE(i,e,t,n){const r=t.get(e);r&&(t.delete(e),t.size===0&&(i.delete(n),r.target.releasePointerCapture(n)))}function AF(i,e){const{internal:t}=i.getState();t.interaction=t.interaction.filter(n=>n!==e),t.initialHits=t.initialHits.filter(n=>n!==e),t.hovered.forEach((n,r)=>{(n.eventObject===e||n.object===e)&&t.hovered.delete(r)}),t.capturedMap.forEach((n,r)=>{XE(t.capturedMap,e,n,r)})}function SF(i){function e(d){const{internal:h}=i.getState(),m=d.offsetX-h.initialClick[0],g=d.offsetY-h.initialClick[1];return Math.round(Math.sqrt(m*m+g*g))}function t(d){return d.filter(h=>["Move","Over","Enter","Out","Leave"].some(m=>{var g;return(g=h.__r3f)==null?void 0:g.handlers["onPointer"+m]}))}function n(d,h){const m=i.getState(),g=new Set,v=[],_=h?h(m.internal.interaction):m.internal.interaction;for(let S=0;S<_.length;S++){const b=_h(_[S]);b&&(b.raycaster.camera=void 0)}m.previousRoot||m.events.compute==null||m.events.compute(d,m);function A(S){const b=_h(S);if(!b||!b.events.enabled||b.raycaster.camera===null)return[];if(b.raycaster.camera===void 0){var R;b.events.compute==null||b.events.compute(d,b,(R=b.previousRoot)==null?void 0:R.getState()),b.raycaster.camera===void 0&&(b.raycaster.camera=null)}return b.raycaster.camera?b.raycaster.intersectObject(S,!0):[]}let C=_.flatMap(A).sort((S,b)=>{const R=_h(S.object),P=_h(b.object);return!R||!P?S.distance-b.distance:P.events.priority-R.events.priority||S.distance-b.distance}).filter(S=>{const b=lg(S);return g.has(b)?!1:(g.add(b),!0)});m.events.filter&&(C=m.events.filter(C,m));for(const S of C){let b=S.object;for(;b;){var M;(M=b.__r3f)!=null&&M.eventCount&&v.push({...S,eventObject:b}),b=b.parent}}if("pointerId"in d&&m.internal.capturedMap.has(d.pointerId))for(let S of m.internal.capturedMap.get(d.pointerId).values())g.has(lg(S.intersection))||v.push(S.intersection);return v}function r(d,h,m,g){const v=i.getState();if(d.length){const _={stopped:!1};for(const A of d){const C=_h(A.object)||v,{raycaster:M,pointer:S,camera:b,internal:R}=C,P=new X(S.x,S.y,0).unproject(b),U=L=>{var V,oe;return(V=(oe=R.capturedMap.get(L))==null?void 0:oe.has(A.eventObject))!=null?V:!1},F=L=>{const V={intersection:A,target:h.target};R.capturedMap.has(L)?R.capturedMap.get(L).set(A.eventObject,V):R.capturedMap.set(L,new Map([[A.eventObject,V]])),h.target.setPointerCapture(L)},k=L=>{const V=R.capturedMap.get(L);V&&XE(R.capturedMap,A.eventObject,V,L)};let G={};for(let L in h){let V=h[L];typeof V!="function"&&(G[L]=V)}let D={...A,...G,pointer:S,intersections:d,stopped:_.stopped,delta:m,unprojectedPoint:P,ray:M.ray,camera:b,stopPropagation(){const L="pointerId"in h&&R.capturedMap.get(h.pointerId);if((!L||L.has(A.eventObject))&&(D.stopped=_.stopped=!0,R.hovered.size&&Array.from(R.hovered.values()).find(V=>V.eventObject===A.eventObject))){const V=d.slice(0,d.indexOf(A));s([...V,A])}},target:{hasPointerCapture:U,setPointerCapture:F,releasePointerCapture:k},currentTarget:{hasPointerCapture:U,setPointerCapture:F,releasePointerCapture:k},nativeEvent:h};if(g(D),_.stopped===!0)break}}return d}function s(d){const{internal:h}=i.getState();for(const m of h.hovered.values())if(!d.length||!d.find(g=>g.object===m.object&&g.index===m.index&&g.instanceId===m.instanceId)){const v=m.eventObject.__r3f,_=v==null?void 0:v.handlers;if(h.hovered.delete(lg(m)),v!=null&&v.eventCount){const A={...m,intersections:d};_.onPointerOut==null||_.onPointerOut(A),_.onPointerLeave==null||_.onPointerLeave(A)}}}function a(d,h){for(let m=0;m<h.length;m++){const g=h[m].__r3f;g==null||g.handlers.onPointerMissed==null||g.handlers.onPointerMissed(d)}}function u(d){switch(d){case"onPointerLeave":case"onPointerCancel":return()=>s([]);case"onLostPointerCapture":return h=>{const{internal:m}=i.getState();"pointerId"in h&&m.capturedMap.has(h.pointerId)&&requestAnimationFrame(()=>{m.capturedMap.has(h.pointerId)&&(m.capturedMap.delete(h.pointerId),s([]))})}}return function(m){const{onPointerMissed:g,internal:v}=i.getState();v.lastEvent.current=m;const _=d==="onPointerMove",A=d==="onClick"||d==="onContextMenu"||d==="onDoubleClick",M=n(m,_?t:void 0),S=A?e(m):0;d==="onPointerDown"&&(v.initialClick=[m.offsetX,m.offsetY],v.initialHits=M.map(R=>R.eventObject)),A&&!M.length&&S<=2&&(a(m,v.interaction),g&&g(m)),_&&s(M);function b(R){const P=R.eventObject,U=P.__r3f,F=U==null?void 0:U.handlers;if(U!=null&&U.eventCount)if(_){if(F.onPointerOver||F.onPointerEnter||F.onPointerOut||F.onPointerLeave){const k=lg(R),G=v.hovered.get(k);G?G.stopped&&R.stopPropagation():(v.hovered.set(k,R),F.onPointerOver==null||F.onPointerOver(R),F.onPointerEnter==null||F.onPointerEnter(R))}F.onPointerMove==null||F.onPointerMove(R)}else{const k=F[d];k?(!A||v.initialHits.includes(P))&&(a(m,v.interaction.filter(G=>!v.initialHits.includes(G))),k(R)):A&&v.initialHits.includes(P)&&a(m,v.interaction.filter(G=>!v.initialHits.includes(G)))}}r(M,m,S,b)}}return{handlePointer:u}}const jE=i=>!!(i!=null&&i.render),JE=Y.createContext(null),MF=(i,e)=>{const t=$D((u,d)=>{const h=new X,m=new X,g=new X;function v(S=d().camera,b=m,R=d().size){const{width:P,height:U,top:F,left:k}=R,G=P/U;b.isVector3?g.copy(b):g.set(...b);const D=S.getWorldPosition(h).distanceTo(g);if(kE(S))return{width:P/S.zoom,height:U/S.zoom,top:F,left:k,factor:1,distance:D,aspect:G};{const L=S.fov*Math.PI/180,V=2*Math.tan(L/2)*D,oe=V*(P/U);return{width:oe,height:V,top:F,left:k,factor:P/oe,distance:D,aspect:G}}}let _;const A=S=>u(b=>({performance:{...b.performance,current:S}})),C=new Le;return{set:u,get:d,gl:null,camera:null,raycaster:null,events:{priority:1,enabled:!0,connected:!1},xr:null,scene:null,invalidate:(S=1)=>i(d(),S),advance:(S,b)=>e(S,b,d()),legacy:!1,linear:!1,flat:!1,controls:null,clock:new Cx,pointer:C,mouse:C,frameloop:"always",onPointerMissed:void 0,performance:{current:1,min:.5,max:1,debounce:200,regress:()=>{const S=d();_&&clearTimeout(_),S.performance.current!==S.performance.min&&A(S.performance.min),_=setTimeout(()=>A(d().performance.max),S.performance.debounce)}},size:{width:0,height:0,top:0,left:0,updateStyle:!1},viewport:{initialDpr:0,dpr:0,width:0,height:0,top:0,left:0,aspect:0,distance:0,factor:0,getCurrentViewport:v},setEvents:S=>u(b=>({...b,events:{...b.events,...S}})),setSize:(S,b,R,P,U)=>{const F=d().camera,k={width:S,height:b,top:P||0,left:U||0,updateStyle:R};u(G=>({size:k,viewport:{...G.viewport,...v(F,m,k)}}))},setDpr:S=>u(b=>{const R=VE(S);return{viewport:{...b.viewport,dpr:R,initialDpr:b.viewport.initialDpr||R}}}),setFrameloop:(S="always")=>{const b=d().clock;b.stop(),b.elapsedTime=0,S!=="never"&&(b.start(),b.elapsedTime=0),u(()=>({frameloop:S}))},previousRoot:void 0,internal:{active:!1,priority:0,frames:0,lastEvent:Y.createRef(),interaction:[],hovered:new Map,subscribers:[],initialClick:[0,0],initialHits:[],capturedMap:new Map,subscribe:(S,b,R)=>{const P=d().internal;return P.priority=P.priority+(b>0?1:0),P.subscribers.push({ref:S,priority:b,store:R}),P.subscribers=P.subscribers.sort((U,F)=>U.priority-F.priority),()=>{const U=d().internal;U!=null&&U.subscribers&&(U.priority=U.priority-(b>0?1:0),U.subscribers=U.subscribers.filter(F=>F.ref!==S))}}}}}),n=t.getState();let r=n.size,s=n.viewport.dpr,a=n.camera;return t.subscribe(()=>{const{camera:u,size:d,viewport:h,gl:m,set:g}=t.getState();if(d.width!==r.width||d.height!==r.height||h.dpr!==s){var v;r=d,s=h.dpr,_F(u,d),m.setPixelRatio(h.dpr);const _=(v=d.updateStyle)!=null?v:typeof HTMLCanvasElement<"u"&&m.domElement instanceof HTMLCanvasElement;m.setSize(d.width,d.height,_)}u!==a&&(a=u,g(_=>({viewport:{..._.viewport,..._.viewport.getCurrentViewport(u)}})))}),t.subscribe(u=>i(u)),t};function EF(i,e){const t={callback:i};return e.add(t),()=>void e.delete(t)}let ug,KE=new Set,wF=new Set,CF=new Set;const TF=i=>EF(i,KE);function ky(i,e){if(i.size)for(const{callback:t}of i.values())t(e)}function xh(i,e){switch(i){case"before":return ky(KE,e);case"after":return ky(wF,e);case"tail":return ky(CF,e)}}let Hy,zy;function Gy(i,e,t){let n=e.clock.getDelta();for(e.frameloop==="never"&&typeof i=="number"&&(n=i-e.clock.elapsedTime,e.clock.oldTime=e.clock.elapsedTime,e.clock.elapsedTime=i),Hy=e.internal.subscribers,ug=0;ug<Hy.length;ug++)zy=Hy[ug],zy.ref.current(zy.store.getState(),n,t);return!e.internal.priority&&e.gl.render&&e.gl.render(e.scene,e.camera),e.internal.frames=Math.max(0,e.internal.frames-1),e.frameloop==="always"?1:e.internal.frames}function bF(i){let e=!1,t=!1,n,r,s;function a(h){r=requestAnimationFrame(a),e=!0,n=0,xh("before",h),t=!0;for(const g of i.values()){var m;s=g.store.getState(),s.internal.active&&(s.frameloop==="always"||s.internal.frames>0)&&!((m=s.gl.xr)!=null&&m.isPresenting)&&(n+=Gy(h,s))}if(t=!1,xh("after",h),n===0)return xh("tail",h),e=!1,cancelAnimationFrame(r)}function u(h,m=1){var g;if(!h)return i.forEach(v=>u(v.store.getState(),m));(g=h.gl.xr)!=null&&g.isPresenting||!h.internal.active||h.frameloop==="never"||(m>1?h.internal.frames=Math.min(60,h.internal.frames+m):t?h.internal.frames=2:h.internal.frames=1,e||(e=!0,requestAnimationFrame(a)))}function d(h,m=!0,g,v){if(m&&xh("before",h),g)Gy(h,g,v);else for(const _ of i.values())Gy(h,_.store.getState());m&&xh("after",h)}return{loop:a,invalidate:u,advance:d}}function YE(){const i=Y.useContext(JE);if(!i)throw new Error("R3F: Hooks can only be used within the Canvas component!");return i}function So(i=t=>t,e){return YE()(i,e)}function vp(i,e=0){const t=YE(),n=t.getState().internal.subscribe,r=HE(i);return gp(()=>n(r,e,t),[e,n,t]),null}const NS=new WeakMap;function QE(i,e){return function(t,...n){let r=NS.get(t);return r||(r=new t,NS.set(t,r)),i&&i(r),Promise.all(n.map(s=>new Promise((a,u)=>r.load(s,d=>{d.scene&&Object.assign(d,vF(d.scene)),a(d)},e,d=>u(new Error(`Could not load ${s}: ${d==null?void 0:d.message}`))))))}}function yp(i,e,t,n){const r=Array.isArray(e)?e:[e],s=tF(QE(t,n),[i,...r],{equal:Dn.equ});return Array.isArray(e)?s:s[0]}yp.preload=function(i,e,t){const n=Array.isArray(e)?e:[e];return nF(QE(t),[i,...n])};yp.clear=function(i,e){const t=Array.isArray(e)?e:[e];return iF([i,...t])};const $f=new Map,{invalidate:US,advance:OS}=bF($f),{reconciler:f0,applyProps:Du}=hF($f,xF),Bf={objects:"shallow",strict:!1},RF=(i,e)=>{const t=typeof i=="function"?i(e):i;return jE(t)?t:new DE({powerPreference:"high-performance",canvas:e,antialias:!0,alpha:!0,...i})};function IF(i,e){const t=typeof HTMLCanvasElement<"u"&&i instanceof HTMLCanvasElement;if(e){const{width:n,height:r,top:s,left:a,updateStyle:u=t}=e;return{width:n,height:r,top:s,left:a,updateStyle:u}}else if(typeof HTMLCanvasElement<"u"&&i instanceof HTMLCanvasElement&&i.parentElement){const{width:n,height:r,top:s,left:a}=i.parentElement.getBoundingClientRect();return{width:n,height:r,top:s,left:a,updateStyle:t}}else if(typeof OffscreenCanvas<"u"&&i instanceof OffscreenCanvas)return{width:i.width,height:i.height,top:0,left:0,updateStyle:t};return{width:0,height:0,top:0,left:0}}function PF(i){const e=$f.get(i),t=e==null?void 0:e.fiber,n=e==null?void 0:e.store;e&&console.warn("R3F.createRoot should only be called once!");const r=typeof reportError=="function"?reportError:console.error,s=n||MF(US,OS),a=t||f0.createContainer(s,Hf.ConcurrentRoot,null,!1,null,"",r,null);e||$f.set(i,{fiber:a,store:s});let u,d=!1,h;return{configure(m={}){let{gl:g,size:v,scene:_,events:A,onCreated:C,shadows:M=!1,linear:S=!1,flat:b=!1,legacy:R=!1,orthographic:P=!1,frameloop:U="always",dpr:F=[1,2],performance:k,raycaster:G,camera:D,onPointerMissed:L}=m,V=s.getState(),oe=V.gl;V.gl||V.set({gl:oe=RF(g,i)});let ie=V.raycaster;ie||V.set({raycaster:ie=new wE});const{params:ge,...ye}=G||{};if(Dn.equ(ye,ie,Bf)||Du(ie,{...ye}),Dn.equ(ge,ie.params,Bf)||Du(ie,{params:{...ie.params,...ge}}),!V.camera||V.camera===h&&!Dn.equ(h,D,Bf)){h=D;const q=D instanceof ap,W=q?D:P?new eo(0,0,0,0,.1,1e3):new Hn(75,0,.1,1e3);q||(W.position.z=5,D&&(Du(W,D),("aspect"in D||"left"in D||"right"in D||"bottom"in D||"top"in D)&&(W.manual=!0,W.updateProjectionMatrix())),!V.camera&&!(D!=null&&D.rotation)&&W.lookAt(0,0,0)),V.set({camera:W}),ie.camera=W}if(!V.scene){let q;_!=null&&_.isScene?q=_:(q=new nx,_&&Du(q,_)),V.set({scene:Ff(q)})}if(!V.xr){var he;const q=(Fe,ae)=>{const we=s.getState();we.frameloop!=="never"&&OS(Fe,!0,we,ae)},W=()=>{const Fe=s.getState();Fe.gl.xr.enabled=Fe.gl.xr.isPresenting,Fe.gl.xr.setAnimationLoop(Fe.gl.xr.isPresenting?q:null),Fe.gl.xr.isPresenting||US(Fe)},ne={connect(){const Fe=s.getState().gl;Fe.xr.addEventListener("sessionstart",W),Fe.xr.addEventListener("sessionend",W)},disconnect(){const Fe=s.getState().gl;Fe.xr.removeEventListener("sessionstart",W),Fe.xr.removeEventListener("sessionend",W)}};typeof((he=oe.xr)==null?void 0:he.addEventListener)=="function"&&ne.connect(),V.set({xr:ne})}if(oe.shadowMap){const q=oe.shadowMap.enabled,W=oe.shadowMap.type;if(oe.shadowMap.enabled=!!M,Dn.boo(M))oe.shadowMap.type=Th;else if(Dn.str(M)){var _e;const ne={basic:k2,percentage:M0,soft:Th,variance:Qs};oe.shadowMap.type=(_e=ne[M])!=null?_e:Th}else Dn.obj(M)&&Object.assign(oe.shadowMap,M);(q!==oe.shadowMap.enabled||W!==oe.shadowMap.type)&&(oe.shadowMap.needsUpdate=!0)}const H=OE();H&&("enabled"in H?H.enabled=!R:"legacyMode"in H&&(H.legacyMode=R)),d||Du(oe,{outputEncoding:S?3e3:3001,toneMapping:b?Mo:H_}),V.legacy!==R&&V.set(()=>({legacy:R})),V.linear!==S&&V.set(()=>({linear:S})),V.flat!==b&&V.set(()=>({flat:b})),g&&!Dn.fun(g)&&!jE(g)&&!Dn.equ(g,oe,Bf)&&Du(oe,g),A&&!V.events.handlers&&V.set({events:A(s)});const Z=IF(i,v);return Dn.equ(Z,V.size,Bf)||V.setSize(Z.width,Z.height,Z.updateStyle,Z.top,Z.left),F&&V.viewport.dpr!==VE(F)&&V.setDpr(F),V.frameloop!==U&&V.setFrameloop(U),V.onPointerMissed||V.set({onPointerMissed:L}),k&&!Dn.equ(k,V.performance,Bf)&&V.set(q=>({performance:{...q.performance,...k}})),u=C,d=!0,this},render(m){return d||this.configure(),f0.updateContainer(fe.jsx(BF,{store:s,children:m,onCreated:u,rootElement:i}),a,null,()=>{}),s},unmount(){qE(i)}}}function BF({store:i,children:e,onCreated:t,rootElement:n}){return gp(()=>{const r=i.getState();r.set(s=>({internal:{...s.internal,active:!0}})),t&&t(r),i.getState().events.connected||r.events.connect==null||r.events.connect(n)},[]),fe.jsx(JE.Provider,{value:i,children:e})}function qE(i,e){const t=$f.get(i),n=t==null?void 0:t.fiber;if(n){const r=t==null?void 0:t.store.getState();r&&(r.internal.active=!1),f0.updateContainer(null,n,null,()=>{r&&setTimeout(()=>{try{var s,a,u,d;r.events.disconnect==null||r.events.disconnect(),(s=r.gl)==null||(a=s.renderLists)==null||a.dispose==null||a.dispose(),(u=r.gl)==null||u.forceContextLoss==null||u.forceContextLoss(),(d=r.gl)!=null&&d.xr&&r.xr.disconnect(),yF(r),$f.delete(i)}catch{}},500)})}}f0.injectIntoDevTools({bundleType:0,rendererPackageName:"@react-three/fiber",version:Y.version});const Vy={onClick:["click",!1],onContextMenu:["contextmenu",!1],onDoubleClick:["dblclick",!1],onWheel:["wheel",!0],onPointerDown:["pointerdown",!0],onPointerUp:["pointerup",!0],onPointerLeave:["pointerleave",!0],onPointerMove:["pointermove",!0],onPointerCancel:["pointercancel",!0],onLostPointerCapture:["lostpointercapture",!0]};function LF(i){const{handlePointer:e}=SF(i);return{priority:1,enabled:!0,compute(t,n,r){n.pointer.set(t.offsetX/n.size.width*2-1,-(t.offsetY/n.size.height)*2+1),n.raycaster.setFromCamera(n.pointer,n.camera)},connected:void 0,handlers:Object.keys(Vy).reduce((t,n)=>({...t,[n]:e(n)}),{}),update:()=>{var t;const{events:n,internal:r}=i.getState();(t=r.lastEvent)!=null&&t.current&&n.handlers&&n.handlers.onPointerMove(r.lastEvent.current)},connect:t=>{var n;const{set:r,events:s}=i.getState();s.disconnect==null||s.disconnect(),r(a=>({events:{...a.events,connected:t}})),Object.entries((n=s.handlers)!=null?n:[]).forEach(([a,u])=>{const[d,h]=Vy[a];t.addEventListener(d,u,{passive:h})})},disconnect:()=>{const{set:t,events:n}=i.getState();if(n.connected){var r;Object.entries((r=n.handlers)!=null?r:[]).forEach(([s,a])=>{if(n&&n.connected instanceof HTMLElement){const[u]=Vy[s];n.connected.removeEventListener(u,a)}}),t(s=>({events:{...s.events,connected:void 0}}))}}}}function kS(i,e){let t;return(...n)=>{window.clearTimeout(t),t=window.setTimeout(()=>i(...n),e)}}function DF({debounce:i,scroll:e,polyfill:t,offsetSize:n}={debounce:0,scroll:!1,offsetSize:!1}){const r=t||(typeof window>"u"?class{}:window.ResizeObserver);if(!r)throw new Error("This browser does not support ResizeObserver out of the box. See: https://github.com/react-spring/react-use-measure/#resize-observer-polyfills");const[s,a]=Y.useState({left:0,top:0,width:0,height:0,bottom:0,right:0,x:0,y:0}),u=Y.useRef({element:null,scrollContainers:null,resizeObserver:null,lastBounds:s,orientationHandler:null}),d=i?typeof i=="number"?i:i.scroll:null,h=i?typeof i=="number"?i:i.resize:null,m=Y.useRef(!1);Y.useEffect(()=>(m.current=!0,()=>void(m.current=!1)));const[g,v,_]=Y.useMemo(()=>{const S=()=>{if(!u.current.element)return;const{left:b,top:R,width:P,height:U,bottom:F,right:k,x:G,y:D}=u.current.element.getBoundingClientRect(),L={left:b,top:R,width:P,height:U,bottom:F,right:k,x:G,y:D};u.current.element instanceof HTMLElement&&n&&(L.height=u.current.element.offsetHeight,L.width=u.current.element.offsetWidth),Object.freeze(L),m.current&&!OF(u.current.lastBounds,L)&&a(u.current.lastBounds=L)};return[S,h?kS(S,h):S,d?kS(S,d):S]},[a,n,d,h]);function A(){u.current.scrollContainers&&(u.current.scrollContainers.forEach(S=>S.removeEventListener("scroll",_,!0)),u.current.scrollContainers=null),u.current.resizeObserver&&(u.current.resizeObserver.disconnect(),u.current.resizeObserver=null),u.current.orientationHandler&&("orientation"in screen&&"removeEventListener"in screen.orientation?screen.orientation.removeEventListener("change",u.current.orientationHandler):"onorientationchange"in window&&window.removeEventListener("orientationchange",u.current.orientationHandler))}function C(){u.current.element&&(u.current.resizeObserver=new r(_),u.current.resizeObserver.observe(u.current.element),e&&u.current.scrollContainers&&u.current.scrollContainers.forEach(S=>S.addEventListener("scroll",_,{capture:!0,passive:!0})),u.current.orientationHandler=()=>{_()},"orientation"in screen&&"addEventListener"in screen.orientation?screen.orientation.addEventListener("change",u.current.orientationHandler):"onorientationchange"in window&&window.addEventListener("orientationchange",u.current.orientationHandler))}const M=S=>{!S||S===u.current.element||(A(),u.current.element=S,u.current.scrollContainers=ZE(S),C())};return NF(_,!!e),FF(v),Y.useEffect(()=>{A(),C()},[e,_,v]),Y.useEffect(()=>A,[]),[M,s,g]}function FF(i){Y.useEffect(()=>{const e=i;return window.addEventListener("resize",e),()=>void window.removeEventListener("resize",e)},[i])}function NF(i,e){Y.useEffect(()=>{if(e){const t=i;return window.addEventListener("scroll",t,{capture:!0,passive:!0}),()=>void window.removeEventListener("scroll",t,!0)}},[i,e])}function ZE(i){const e=[];if(!i||i===document.body)return e;const{overflow:t,overflowX:n,overflowY:r}=window.getComputedStyle(i);return[t,n,r].some(s=>s==="auto"||s==="scroll")&&e.push(i),[...e,...ZE(i.parentElement)]}const UF=["x","y","top","bottom","left","right","width","height"],OF=(i,e)=>UF.every(t=>i[t]===e[t]);var kF=Object.defineProperty,HF=Object.defineProperties,zF=Object.getOwnPropertyDescriptors,HS=Object.getOwnPropertySymbols,GF=Object.prototype.hasOwnProperty,VF=Object.prototype.propertyIsEnumerable,zS=(i,e,t)=>e in i?kF(i,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):i[e]=t,GS=(i,e)=>{for(var t in e||(e={}))GF.call(e,t)&&zS(i,t,e[t]);if(HS)for(var t of HS(e))VF.call(e,t)&&zS(i,t,e[t]);return i},WF=(i,e)=>HF(i,zF(e)),VS,WS;typeof window<"u"&&((VS=window.document)!=null&&VS.createElement||((WS=window.navigator)==null?void 0:WS.product)==="ReactNative")?Y.useLayoutEffect:Y.useEffect;function $E(i,e,t){if(!i)return;if(t(i)===!0)return i;let n=i.child;for(;n;){const r=$E(n,e,t);if(r)return r;n=n.sibling}}function ew(i){try{return Object.defineProperties(i,{_currentRenderer:{get(){return null},set(){}},_currentRenderer2:{get(){return null},set(){}}})}catch{return i}}const XS=console.error;console.error=function(){const i=[...arguments].join("");if(i!=null&&i.startsWith("Warning:")&&i.includes("useContext")){console.error=XS;return}return XS.apply(this,arguments)};const Lx=ew(Y.createContext(null));class tw extends Y.Component{render(){return Y.createElement(Lx.Provider,{value:this._reactInternals},this.props.children)}}function XF(){const i=Y.useContext(Lx);if(i===null)throw new Error("its-fine: useFiber must be called within a <FiberProvider />!");const e=Y.useId();return Y.useMemo(()=>{for(const n of[i,i==null?void 0:i.alternate]){if(!n)continue;const r=$E(n,!1,s=>{let a=s.memoizedState;for(;a;){if(a.memoizedState===e)return!0;a=a.next}});if(r)return r}},[i,e])}function jF(){const i=XF(),[e]=Y.useState(()=>new Map);e.clear();let t=i;for(;t;){if(t.type&&typeof t.type=="object"){const r=t.type._context===void 0&&t.type.Provider===t.type?t.type:t.type._context;r&&r!==Lx&&!e.has(r)&&e.set(r,Y.useContext(ew(r)))}t=t.return}return e}function JF(){const i=jF();return Y.useMemo(()=>Array.from(i.keys()).reduce((e,t)=>n=>Y.createElement(e,null,Y.createElement(t.Provider,WF(GS({},n),{value:i.get(t)}))),e=>Y.createElement(tw,GS({},e))),[i])}const KF=Y.forwardRef(function({children:e,fallback:t,resize:n,style:r,gl:s,events:a=LF,eventSource:u,eventPrefix:d,shadows:h,linear:m,flat:g,legacy:v,orthographic:_,frameloop:A,dpr:C,performance:M,raycaster:S,camera:b,scene:R,onPointerMissed:P,onCreated:U,...F},k){Y.useMemo(()=>dF(FE),[]);const G=JF(),[D,L]=DF({scroll:!0,debounce:{scroll:50,resize:0},...n}),V=Y.useRef(null),oe=Y.useRef(null);Y.useImperativeHandle(k,()=>V.current);const ie=HE(P),[ge,ye]=Y.useState(!1),[he,_e]=Y.useState(!1);if(ge)throw ge;if(he)throw he;const H=Y.useRef(null);gp(()=>{const q=V.current;L.width>0&&L.height>0&&q&&(H.current||(H.current=PF(q)),H.current.configure({gl:s,events:a,shadows:h,linear:m,flat:g,legacy:v,orthographic:_,frameloop:A,dpr:C,performance:M,raycaster:S,camera:b,scene:R,size:L,onPointerMissed:(...W)=>ie.current==null?void 0:ie.current(...W),onCreated:W=>{W.events.connect==null||W.events.connect(u?pF(u)?u.current:u:oe.current),d&&W.setEvents({compute:(ne,Fe)=>{const ae=ne[d+"X"],we=ne[d+"Y"];Fe.pointer.set(ae/Fe.size.width*2-1,-(we/Fe.size.height)*2+1),Fe.raycaster.setFromCamera(Fe.pointer,Fe.camera)}}),U==null||U(W)}}),H.current.render(fe.jsx(G,{children:fe.jsx(zE,{set:_e,children:fe.jsx(Y.Suspense,{fallback:fe.jsx(mF,{set:ye}),children:e})})})))}),Y.useEffect(()=>{const q=V.current;if(q)return()=>qE(q)},[]);const Z=u?"none":"auto";return fe.jsx("div",{ref:oe,style:{position:"relative",width:"100%",height:"100%",overflow:"hidden",pointerEvents:Z,...r},...F,children:fe.jsx("div",{ref:D,style:{width:"100%",height:"100%"},children:fe.jsx("canvas",{ref:V,style:{display:"block"},children:t})})})}),nw=Y.forwardRef(function(e,t){return fe.jsx(tw,{children:fe.jsx(KF,{...e,ref:t})})});function d0(){return d0=Object.assign?Object.assign.bind():function(i){for(var e=1;e<arguments.length;e++){var t=arguments[e];for(var n in t)({}).hasOwnProperty.call(t,n)&&(i[n]=t[n])}return i},d0.apply(null,arguments)}const _p=new X,Dx=new X,YF=new X,jS=new Le;function QF(i,e,t){const n=_p.setFromMatrixPosition(i.matrixWorld);n.project(e);const r=t.width/2,s=t.height/2;return[n.x*r+r,-(n.y*s)+s]}function qF(i,e){const t=_p.setFromMatrixPosition(i.matrixWorld),n=Dx.setFromMatrixPosition(e.matrixWorld),r=t.sub(n),s=e.getWorldDirection(YF);return r.angleTo(s)>Math.PI/2}function ZF(i,e,t,n){const r=_p.setFromMatrixPosition(i.matrixWorld),s=r.clone();s.project(e),jS.set(s.x,s.y),t.setFromCamera(jS,e);const a=t.intersectObjects(n,!0);if(a.length){const u=a[0].distance;return r.distanceTo(t.ray.origin)<u}return!0}function $F(i,e){if(e instanceof eo)return e.zoom;if(e instanceof Hn){const t=_p.setFromMatrixPosition(i.matrixWorld),n=Dx.setFromMatrixPosition(e.matrixWorld),r=e.fov*Math.PI/180,s=t.distanceTo(n);return 1/(2*Math.tan(r/2)*s)}else return 1}function eN(i,e,t){if(e instanceof Hn||e instanceof eo){const n=_p.setFromMatrixPosition(i.matrixWorld),r=Dx.setFromMatrixPosition(e.matrixWorld),s=n.distanceTo(r),a=(t[1]-t[0])/(e.far-e.near),u=t[1]-a*e.far;return Math.round(a*s+u)}}const E_=i=>Math.abs(i)<1e-10?0:i;function iw(i,e,t=""){let n="matrix3d(";for(let r=0;r!==16;r++)n+=E_(e[r]*i.elements[r])+(r!==15?",":")");return t+n}const tN=(i=>e=>iw(e,i))([1,-1,1,1,1,-1,1,1,1,-1,1,1,1,-1,1,1]),nN=(i=>(e,t)=>iw(e,i(t),"translate(-50%,-50%)"))(i=>[1/i,1/i,1/i,1,-1/i,-1/i,-1/i,-1,1/i,1/i,1/i,1,1,1,1,1]);function iN(i){return i&&typeof i=="object"&&"current"in i}const rN=Y.forwardRef(({children:i,eps:e=.001,style:t,className:n,prepend:r,center:s,fullscreen:a,portal:u,distanceFactor:d,sprite:h=!1,transform:m=!1,occlude:g,onOcclude:v,castShadow:_,receiveShadow:A,material:C,geometry:M,zIndexRange:S=[16777271,0],calculatePosition:b=QF,as:R="div",wrapperClass:P,pointerEvents:U="auto",...F},k)=>{const{gl:G,camera:D,scene:L,size:V,raycaster:oe,events:ie,viewport:ge}=So(),[ye]=Y.useState(()=>document.createElement(R)),he=Y.useRef(),_e=Y.useRef(null),H=Y.useRef(0),Z=Y.useRef([0,0]),q=Y.useRef(null),W=Y.useRef(null),ne=(u==null?void 0:u.current)||ie.connected||G.domElement.parentNode,Fe=Y.useRef(null),ae=Y.useRef(!1),we=Y.useMemo(()=>g&&g!=="blending"||Array.isArray(g)&&g.length&&iN(g[0]),[g]);Y.useLayoutEffect(()=>{const Je=G.domElement;g&&g==="blending"?(Je.style.zIndex=`${Math.floor(S[0]/2)}`,Je.style.position="absolute",Je.style.pointerEvents="none"):(Je.style.zIndex=null,Je.style.position=null,Je.style.pointerEvents=null)},[g]),Y.useLayoutEffect(()=>{if(_e.current){const Je=he.current=A2.createRoot(ye);if(L.updateMatrixWorld(),m)ye.style.cssText="position:absolute;top:0;left:0;pointer-events:none;overflow:hidden;";else{const st=b(_e.current,D,V);ye.style.cssText=`position:absolute;top:0;left:0;transform:translate3d(${st[0]}px,${st[1]}px,0);transform-origin:0 0;`}return ne&&(r?ne.prepend(ye):ne.appendChild(ye)),()=>{ne&&ne.removeChild(ye),Je.unmount()}}},[ne,m]),Y.useLayoutEffect(()=>{P&&(ye.className=P)},[P]);const De=Y.useMemo(()=>m?{position:"absolute",top:0,left:0,width:V.width,height:V.height,transformStyle:"preserve-3d",pointerEvents:"none"}:{position:"absolute",transform:s?"translate3d(-50%,-50%,0)":"none",...a&&{top:-V.height/2,left:-V.width/2,width:V.width,height:V.height},...t},[t,s,a,V,m]),Ie=Y.useMemo(()=>({position:"absolute",pointerEvents:U}),[U]);Y.useLayoutEffect(()=>{if(ae.current=!1,m){var Je;(Je=he.current)==null||Je.render(Y.createElement("div",{ref:q,style:De},Y.createElement("div",{ref:W,style:Ie},Y.createElement("div",{ref:k,className:n,style:t,children:i}))))}else{var st;(st=he.current)==null||st.render(Y.createElement("div",{ref:k,style:De,className:n,children:i}))}});const Xe=Y.useRef(!0);vp(Je=>{if(_e.current){D.updateMatrixWorld(),_e.current.updateWorldMatrix(!0,!1);const st=m?Z.current:b(_e.current,D,V);if(m||Math.abs(H.current-D.zoom)>e||Math.abs(Z.current[0]-st[0])>e||Math.abs(Z.current[1]-st[1])>e){const Ne=qF(_e.current,D);let be=!1;we&&(Array.isArray(g)?be=g.map(et=>et.current):g!=="blending"&&(be=[L]));const J=Xe.current;if(be){const et=ZF(_e.current,D,oe,be);Xe.current=et&&!Ne}else Xe.current=!Ne;J!==Xe.current&&(v?v(!Xe.current):ye.style.display=Xe.current?"block":"none");const mt=Math.floor(S[0]/2),ke=g?we?[S[0],mt]:[mt-1,0]:S;if(ye.style.zIndex=`${eN(_e.current,D,ke)}`,m){const[et,je]=[V.width/2,V.height/2],wt=D.projectionMatrix.elements[5]*je,{isOrthographicCamera:qe,top:j,left:O,bottom:pe,right:Ce}=D,Ue=tN(D.matrixWorldInverse),Pe=qe?`scale(${wt})translate(${E_(-(Ce+O)/2)}px,${E_((j+pe)/2)}px)`:`translateZ(${wt}px)`;let ot=_e.current.matrixWorld;h&&(ot=D.matrixWorldInverse.clone().transpose().copyPosition(ot).scale(_e.current.scale),ot.elements[3]=ot.elements[7]=ot.elements[11]=0,ot.elements[15]=1),ye.style.width=V.width+"px",ye.style.height=V.height+"px",ye.style.perspective=qe?"":`${wt}px`,q.current&&W.current&&(q.current.style.transform=`${Pe}${Ue}translate(${et}px,${je}px)`,W.current.style.transform=nN(ot,1/((d||10)/400)))}else{const et=d===void 0?1:$F(_e.current,D)*d;ye.style.transform=`translate3d(${st[0]}px,${st[1]}px,0) scale(${et})`}Z.current=st,H.current=D.zoom}}if(!we&&Fe.current&&!ae.current)if(m){if(q.current){const st=q.current.children[0];if(st!=null&&st.clientWidth&&st!=null&&st.clientHeight){const{isOrthographicCamera:Ne}=D;if(Ne||M)F.scale&&(Array.isArray(F.scale)?F.scale instanceof X?Fe.current.scale.copy(F.scale.clone().divideScalar(1)):Fe.current.scale.set(1/F.scale[0],1/F.scale[1],1/F.scale[2]):Fe.current.scale.setScalar(1/F.scale));else{const be=(d||10)/400,J=st.clientWidth*be,mt=st.clientHeight*be;Fe.current.scale.set(J,mt,1)}ae.current=!0}}}else{const st=ye.children[0];if(st!=null&&st.clientWidth&&st!=null&&st.clientHeight){const Ne=1/ge.factor,be=st.clientWidth*Ne,J=st.clientHeight*Ne;Fe.current.scale.set(be,J,1),ae.current=!0}Fe.current.lookAt(Je.camera.position)}});const _t=Y.useMemo(()=>({vertexShader:m?void 0:`
          /*
            This shader is from the THREE's SpriteMaterial.
            We need to turn the backing plane into a Sprite
            (make it always face the camera) if "transfrom"
            is false.
          */
          #include <common>

          void main() {
            vec2 center = vec2(0., 1.);
            float rotation = 0.0;

            // This is somewhat arbitrary, but it seems to work well
            // Need to figure out how to derive this dynamically if it even matters
            float size = 0.03;

            vec4 mvPosition = modelViewMatrix * vec4( 0.0, 0.0, 0.0, 1.0 );
            vec2 scale;
            scale.x = length( vec3( modelMatrix[ 0 ].x, modelMatrix[ 0 ].y, modelMatrix[ 0 ].z ) );
            scale.y = length( vec3( modelMatrix[ 1 ].x, modelMatrix[ 1 ].y, modelMatrix[ 1 ].z ) );

            bool isPerspective = isPerspectiveMatrix( projectionMatrix );
            if ( isPerspective ) scale *= - mvPosition.z;

            vec2 alignedPosition = ( position.xy - ( center - vec2( 0.5 ) ) ) * scale * size;
            vec2 rotatedPosition;
            rotatedPosition.x = cos( rotation ) * alignedPosition.x - sin( rotation ) * alignedPosition.y;
            rotatedPosition.y = sin( rotation ) * alignedPosition.x + cos( rotation ) * alignedPosition.y;
            mvPosition.xy += rotatedPosition;

            gl_Position = projectionMatrix * mvPosition;
          }
      `,fragmentShader:`
        void main() {
          gl_FragColor = vec4(0.0, 0.0, 0.0, 0.0);
        }
      `}),[m]);return Y.createElement("group",d0({},F,{ref:_e}),g&&!we&&Y.createElement("mesh",{castShadow:_,receiveShadow:A,ref:Fe},M||Y.createElement("planeGeometry",null),C||Y.createElement("shaderMaterial",{side:_s,vertexShader:_t.vertexShader,fragmentShader:_t.fragmentShader})))});var Fx=Ap(),vn=i=>xp(i,Fx),Nx=Ap();vn.write=i=>xp(i,Nx);var nv=Ap();vn.onStart=i=>xp(i,nv);var Ux=Ap();vn.onFrame=i=>xp(i,Ux);var Ox=Ap();vn.onFinish=i=>xp(i,Ox);var Wf=[];vn.setTimeout=(i,e)=>{const t=vn.now()+e,n=()=>{const s=Wf.findIndex(a=>a.cancel==n);~s&&Wf.splice(s,1),Al-=~s?1:0},r={time:t,handler:i,cancel:n};return Wf.splice(rw(t),0,r),Al+=1,sw(),r};var rw=i=>~(~Wf.findIndex(e=>e.time>i)||~Wf.length);vn.cancel=i=>{nv.delete(i),Ux.delete(i),Ox.delete(i),Fx.delete(i),Nx.delete(i)};vn.sync=i=>{w_=!0,vn.batchedUpdates(i),w_=!1};vn.throttle=i=>{let e;function t(){try{i(...e)}finally{e=null}}function n(...r){e=r,vn.onStart(t)}return n.handler=i,n.cancel=()=>{nv.delete(t),e=null},n};var kx=typeof window<"u"?window.requestAnimationFrame:()=>{};vn.use=i=>kx=i;vn.now=typeof performance<"u"?()=>performance.now():Date.now;vn.batchedUpdates=i=>i();vn.catch=console.error;vn.frameLoop="always";vn.advance=()=>{vn.frameLoop!=="demand"?console.warn("Cannot call the manual advancement of rafz whilst frameLoop is not set as demand"):aw()};var xl=-1,Al=0,w_=!1;function xp(i,e){w_?(e.delete(i),i(0)):(e.add(i),sw())}function sw(){xl<0&&(xl=0,vn.frameLoop!=="demand"&&kx(ow))}function sN(){xl=-1}function ow(){~xl&&(kx(ow),vn.batchedUpdates(aw))}function aw(){const i=xl;xl=vn.now();const e=rw(xl);if(e&&(lw(Wf.splice(0,e),t=>t.handler()),Al-=e),!Al){sN();return}nv.flush(),Fx.flush(i?Math.min(64,xl-i):16.667),Ux.flush(),Nx.flush(),Ox.flush()}function Ap(){let i=new Set,e=i;return{add(t){Al+=e==i&&!i.has(t)?1:0,i.add(t)},delete(t){return Al-=e==i&&i.has(t)?1:0,i.delete(t)},flush(t){e.size&&(i=new Set,Al-=e.size,lw(e,n=>n(t)&&i.add(n)),Al+=i.size,e=i)}}}function lw(i,e){i.forEach(t=>{try{e(t)}catch(n){vn.catch(n)}})}var oN=Object.defineProperty,aN=(i,e)=>{for(var t in e)oN(i,t,{get:e[t],enumerable:!0})},ed={};aN(ed,{assign:()=>fN,colors:()=>Ml,createStringInterpolator:()=>zx,skipAnimation:()=>cw,to:()=>uw,willAdvance:()=>Gx});function lN(){}var uN=(i,e,t)=>Object.defineProperty(i,e,{value:t,writable:!0,configurable:!0}),$n={arr:Array.isArray,obj:i=>!!i&&i.constructor.name==="Object",fun:i=>typeof i=="function",str:i=>typeof i=="string",num:i=>typeof i=="number",und:i=>i===void 0};function cN(i,e){if($n.arr(i)){if(!$n.arr(e)||i.length!==e.length)return!1;for(let t=0;t<i.length;t++)if(i[t]!==e[t])return!1;return!0}return i===e}var wa=(i,e)=>i.forEach(e);function C_(i,e,t){if($n.arr(i)){for(let n=0;n<i.length;n++)e.call(t,i[n],`${n}`);return}for(const n in i)i.hasOwnProperty(n)&&e.call(t,i[n],n)}var cg=i=>$n.und(i)?[]:$n.arr(i)?i:[i],Hx=()=>typeof window>"u"||!window.navigator||/ServerSideRendering|^Deno\//.test(window.navigator.userAgent),zx,uw,Ml=null,cw=!1,Gx=lN,fN=i=>{i.to&&(uw=i.to),i.now&&(vn.now=i.now),i.colors!==void 0&&(Ml=i.colors),i.skipAnimation!=null&&(cw=i.skipAnimation),i.createStringInterpolator&&(zx=i.createStringInterpolator),i.requestAnimationFrame&&vn.use(i.requestAnimationFrame),i.batchedUpdates&&(vn.batchedUpdates=i.batchedUpdates),i.willAdvance&&(Gx=i.willAdvance),i.frameLoop&&(vn.frameLoop=i.frameLoop)},Nh=new Set,xs=[],Wy=[],h0=0,Vx={get idle(){return!Nh.size&&!xs.length},start(i){h0>i.priority?(Nh.add(i),vn.onStart(dN)):(fw(i),vn(T_))},advance:T_,sort(i){if(h0)vn.onFrame(()=>Vx.sort(i));else{const e=xs.indexOf(i);~e&&(xs.splice(e,1),dw(i))}},clear(){xs=[],Nh.clear()}};function dN(){Nh.forEach(fw),Nh.clear(),vn(T_)}function fw(i){xs.includes(i)||dw(i)}function dw(i){xs.splice(hN(xs,e=>e.priority>i.priority),0,i)}function T_(i){const e=Wy;for(let t=0;t<xs.length;t++){const n=xs[t];h0=n.priority,n.idle||(Gx(n),n.advance(i),n.idle||e.push(n))}return h0=0,Wy=xs,Wy.length=0,xs=e,xs.length>0}function hN(i,e){const t=i.findIndex(e);return t<0?i.length:t}var pN={transparent:0,aliceblue:4042850303,antiquewhite:4209760255,aqua:16777215,aquamarine:2147472639,azure:4043309055,beige:4126530815,bisque:4293182719,black:255,blanchedalmond:4293643775,blue:65535,blueviolet:2318131967,brown:2771004159,burlywood:3736635391,burntsienna:3934150143,cadetblue:1604231423,chartreuse:2147418367,chocolate:3530104575,coral:4286533887,cornflowerblue:1687547391,cornsilk:4294499583,crimson:3692313855,cyan:16777215,darkblue:35839,darkcyan:9145343,darkgoldenrod:3095792639,darkgray:2846468607,darkgreen:6553855,darkgrey:2846468607,darkkhaki:3182914559,darkmagenta:2332068863,darkolivegreen:1433087999,darkorange:4287365375,darkorchid:2570243327,darkred:2332033279,darksalmon:3918953215,darkseagreen:2411499519,darkslateblue:1211993087,darkslategray:793726975,darkslategrey:793726975,darkturquoise:13554175,darkviolet:2483082239,deeppink:4279538687,deepskyblue:12582911,dimgray:1768516095,dimgrey:1768516095,dodgerblue:512819199,firebrick:2988581631,floralwhite:4294635775,forestgreen:579543807,fuchsia:4278255615,gainsboro:3705462015,ghostwhite:4177068031,gold:4292280575,goldenrod:3668254975,gray:2155905279,green:8388863,greenyellow:2919182335,grey:2155905279,honeydew:4043305215,hotpink:4285117695,indianred:3445382399,indigo:1258324735,ivory:4294963455,khaki:4041641215,lavender:3873897215,lavenderblush:4293981695,lawngreen:2096890111,lemonchiffon:4294626815,lightblue:2916673279,lightcoral:4034953471,lightcyan:3774873599,lightgoldenrodyellow:4210742015,lightgray:3553874943,lightgreen:2431553791,lightgrey:3553874943,lightpink:4290167295,lightsalmon:4288707327,lightseagreen:548580095,lightskyblue:2278488831,lightslategray:2005441023,lightslategrey:2005441023,lightsteelblue:2965692159,lightyellow:4294959359,lime:16711935,limegreen:852308735,linen:4210091775,magenta:4278255615,maroon:2147483903,mediumaquamarine:1724754687,mediumblue:52735,mediumorchid:3126187007,mediumpurple:2473647103,mediumseagreen:1018393087,mediumslateblue:2070474495,mediumspringgreen:16423679,mediumturquoise:1221709055,mediumvioletred:3340076543,midnightblue:421097727,mintcream:4127193855,mistyrose:4293190143,moccasin:4293178879,navajowhite:4292783615,navy:33023,oldlace:4260751103,olive:2155872511,olivedrab:1804477439,orange:4289003775,orangered:4282712319,orchid:3664828159,palegoldenrod:4008225535,palegreen:2566625535,paleturquoise:2951671551,palevioletred:3681588223,papayawhip:4293907967,peachpuff:4292524543,peru:3448061951,pink:4290825215,plum:3718307327,powderblue:2967529215,purple:2147516671,rebeccapurple:1714657791,red:4278190335,rosybrown:3163525119,royalblue:1097458175,saddlebrown:2336560127,salmon:4202722047,sandybrown:4104413439,seagreen:780883967,seashell:4294307583,sienna:2689740287,silver:3233857791,skyblue:2278484991,slateblue:1784335871,slategray:1887473919,slategrey:1887473919,snow:4294638335,springgreen:16744447,steelblue:1182971135,tan:3535047935,teal:8421631,thistle:3636451583,tomato:4284696575,turquoise:1088475391,violet:4001558271,wheat:4125012991,white:4294967295,whitesmoke:4126537215,yellow:4294902015,yellowgreen:2597139199},$s="[-+]?\\d*\\.?\\d+",p0=$s+"%";function iv(...i){return"\\(\\s*("+i.join(")\\s*,\\s*(")+")\\s*\\)"}var mN=new RegExp("rgb"+iv($s,$s,$s)),gN=new RegExp("rgba"+iv($s,$s,$s,$s)),vN=new RegExp("hsl"+iv($s,p0,p0)),yN=new RegExp("hsla"+iv($s,p0,p0,$s)),_N=/^#([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,xN=/^#([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,AN=/^#([0-9a-fA-F]{6})$/,SN=/^#([0-9a-fA-F]{8})$/;function MN(i){let e;return typeof i=="number"?i>>>0===i&&i>=0&&i<=4294967295?i:null:(e=AN.exec(i))?parseInt(e[1]+"ff",16)>>>0:Ml&&Ml[i]!==void 0?Ml[i]:(e=mN.exec(i))?(Lf(e[1])<<24|Lf(e[2])<<16|Lf(e[3])<<8|255)>>>0:(e=gN.exec(i))?(Lf(e[1])<<24|Lf(e[2])<<16|Lf(e[3])<<8|YS(e[4]))>>>0:(e=_N.exec(i))?parseInt(e[1]+e[1]+e[2]+e[2]+e[3]+e[3]+"ff",16)>>>0:(e=SN.exec(i))?parseInt(e[1],16)>>>0:(e=xN.exec(i))?parseInt(e[1]+e[1]+e[2]+e[2]+e[3]+e[3]+e[4]+e[4],16)>>>0:(e=vN.exec(i))?(JS(KS(e[1]),fg(e[2]),fg(e[3]))|255)>>>0:(e=yN.exec(i))?(JS(KS(e[1]),fg(e[2]),fg(e[3]))|YS(e[4]))>>>0:null}function Xy(i,e,t){return t<0&&(t+=1),t>1&&(t-=1),t<1/6?i+(e-i)*6*t:t<1/2?e:t<2/3?i+(e-i)*(2/3-t)*6:i}function JS(i,e,t){const n=t<.5?t*(1+e):t+e-t*e,r=2*t-n,s=Xy(r,n,i+1/3),a=Xy(r,n,i),u=Xy(r,n,i-1/3);return Math.round(s*255)<<24|Math.round(a*255)<<16|Math.round(u*255)<<8}function Lf(i){const e=parseInt(i,10);return e<0?0:e>255?255:e}function KS(i){return(parseFloat(i)%360+360)%360/360}function YS(i){const e=parseFloat(i);return e<0?0:e>1?255:Math.round(e*255)}function fg(i){const e=parseFloat(i);return e<0?0:e>100?1:e/100}function QS(i){let e=MN(i);if(e===null)return i;e=e||0;const t=(e&4278190080)>>>24,n=(e&16711680)>>>16,r=(e&65280)>>>8,s=(e&255)/255;return`rgba(${t}, ${n}, ${r}, ${s})`}var Qh=(i,e,t)=>{if($n.fun(i))return i;if($n.arr(i))return Qh({range:i,output:e,extrapolate:t});if($n.str(i.output[0]))return zx(i);const n=i,r=n.output,s=n.range||[0,1],a=n.extrapolateLeft||n.extrapolate||"extend",u=n.extrapolateRight||n.extrapolate||"extend",d=n.easing||(h=>h);return h=>{const m=wN(h,s);return EN(h,s[m],s[m+1],r[m],r[m+1],d,a,u,n.map)}};function EN(i,e,t,n,r,s,a,u,d){let h=d?d(i):i;if(h<e){if(a==="identity")return h;a==="clamp"&&(h=e)}if(h>t){if(u==="identity")return h;u==="clamp"&&(h=t)}return n===r?n:e===t?i<=e?n:r:(e===-1/0?h=-h:t===1/0?h=h-e:h=(h-e)/(t-e),h=s(h),n===-1/0?h=-h:r===1/0?h=h+n:h=h*(r-n)+n,h)}function wN(i,e){for(var t=1;t<e.length-1&&!(e[t]>=i);++t);return t-1}var qh=Symbol.for("FluidValue.get"),Zh=Symbol.for("FluidValue.observers"),m0=i=>!!(i&&i[qh]),g0=i=>i&&i[qh]?i[qh]():i;function CN(i,e){i.eventObserved?i.eventObserved(e):i(e)}function b_(i,e){const t=i[Zh];t&&t.forEach(n=>{CN(n,e)})}var TN=class{constructor(i){if(!i&&!(i=this.get))throw Error("Unknown getter");bN(this,i)}},bN=(i,e)=>pw(i,qh,e);function hw(i,e){if(i[qh]){let t=i[Zh];t||pw(i,Zh,t=new Set),t.has(e)||(t.add(e),i.observerAdded&&i.observerAdded(t.size,e))}return e}function R_(i,e){const t=i[Zh];if(t&&t.has(e)){const n=t.size-1;n?t.delete(e):i[Zh]=null,i.observerRemoved&&i.observerRemoved(n,e)}}var pw=(i,e,t)=>Object.defineProperty(i,e,{value:t,writable:!0,configurable:!0}),Mg=/[+\-]?(?:0|[1-9]\d*)(?:\.\d*)?(?:[eE][+\-]?\d+)?/g,RN=/(#(?:[0-9a-f]{2}){2,4}|(#[0-9a-f]{3})|(rgb|hsl)a?\((-?\d+%?[,\s]+){2,3}\s*[\d\.]+%?\))/gi,qS=new RegExp(`(${Mg.source})(%|[a-z]+)`,"i"),IN=/rgba\(([0-9\.-]+), ([0-9\.-]+), ([0-9\.-]+), ([0-9\.-]+)\)/gi,rv=/var\((--[a-zA-Z0-9-_]+),? ?([a-zA-Z0-9 ()%#.,-]+)?\)/,mw=i=>{const[e,t]=PN(i);if(!e||Hx())return i;const n=window.getComputedStyle(document.documentElement).getPropertyValue(e);if(n)return n.trim();if(t&&t.startsWith("--")){const r=window.getComputedStyle(document.documentElement).getPropertyValue(t);return r||i}else{if(t&&rv.test(t))return mw(t);if(t)return t}return i},PN=i=>{const e=rv.exec(i);if(!e)return[,];const[,t,n]=e;return[t,n]},jy,BN=(i,e,t,n,r)=>`rgba(${Math.round(e)}, ${Math.round(t)}, ${Math.round(n)}, ${r})`,gw=i=>{jy||(jy=Ml?new RegExp(`(${Object.keys(Ml).join("|")})(?!\\w)`,"g"):/^\b$/);const e=i.output.map(s=>g0(s).replace(rv,mw).replace(RN,QS).replace(jy,QS)),t=e.map(s=>s.match(Mg).map(Number)),r=t[0].map((s,a)=>t.map(u=>{if(!(a in u))throw Error('The arity of each "output" value must be equal');return u[a]})).map(s=>Qh({...i,output:s}));return s=>{var d;const a=!qS.test(e[0])&&((d=e.find(h=>qS.test(h)))==null?void 0:d.replace(Mg,""));let u=0;return e[0].replace(Mg,()=>`${r[u++](s)}${a||""}`).replace(IN,BN)}},vw="react-spring: ",yw=i=>{const e=i;let t=!1;if(typeof e!="function")throw new TypeError(`${vw}once requires a function parameter`);return(...n)=>{t||(e(...n),t=!0)}},LN=yw(console.warn);function DN(){LN(`${vw}The "interpolate" function is deprecated in v9 (use "to" instead)`)}yw(console.warn);function _w(i){return $n.str(i)&&(i[0]=="#"||/\d/.test(i)||!Hx()&&rv.test(i)||i in(Ml||{}))}var xw=Hx()?Y.useEffect:Y.useLayoutEffect,FN=()=>{const i=Y.useRef(!1);return xw(()=>(i.current=!0,()=>{i.current=!1}),[]),i};function NN(){const i=Y.useState()[1],e=FN();return()=>{e.current&&i(Math.random())}}function UN(i,e){const[t]=Y.useState(()=>({inputs:e,result:i()})),n=Y.useRef(),r=n.current;let s=r;return s?e&&s.inputs&&ON(e,s.inputs)||(s={inputs:e,result:i()}):s=t,Y.useEffect(()=>{n.current=s,r==t&&(t.inputs=t.result=void 0)},[s]),s.result}function ON(i,e){if(i.length!==e.length)return!1;for(let t=0;t<i.length;t++)if(i[t]!==e[t])return!1;return!0}var kN=i=>Y.useEffect(i,HN),HN=[],$h=Symbol.for("Animated:node"),zN=i=>!!i&&i[$h]===i,Wx=i=>i&&i[$h],Aw=(i,e)=>uN(i,$h,e),Xx=i=>i&&i[$h]&&i[$h].getPayload(),Sw=class{constructor(){Aw(this,this)}getPayload(){return this.payload||[]}},sv=class extends Sw{constructor(i){super(),this._value=i,this.done=!0,this.durationProgress=0,$n.num(this._value)&&(this.lastPosition=this._value)}static create(i){return new sv(i)}getPayload(){return[this]}getValue(){return this._value}setValue(i,e){return $n.num(i)&&(this.lastPosition=i,e&&(i=Math.round(i/e)*e,this.done&&(this.lastPosition=i))),this._value===i?!1:(this._value=i,!0)}reset(){const{done:i}=this;this.done=!1,$n.num(this._value)&&(this.elapsedTime=0,this.durationProgress=0,this.lastPosition=this._value,i&&(this.lastVelocity=null),this.v0=null)}},jx=class extends sv{constructor(i){super(0),this._string=null,this._toString=Qh({output:[i,i]})}static create(i){return new jx(i)}getValue(){const i=this._string;return i??(this._string=this._toString(this._value))}setValue(i){if($n.str(i)){if(i==this._string)return!1;this._string=i,this._value=1}else if(super.setValue(i))this._string=null;else return!1;return!0}reset(i){i&&(this._toString=Qh({output:[this.getValue(),i]})),this._value=0,super.reset()}},v0={dependencies:null},Jx=class extends Sw{constructor(i){super(),this.source=i,this.setValue(i)}getValue(i){const e={};return C_(this.source,(t,n)=>{zN(t)?e[n]=t.getValue(i):m0(t)?e[n]=g0(t):i||(e[n]=t)}),e}setValue(i){this.source=i,this.payload=this._makePayload(i)}reset(){this.payload&&wa(this.payload,i=>i.reset())}_makePayload(i){if(i){const e=new Set;return C_(i,this._addToPayload,e),Array.from(e)}}_addToPayload(i){v0.dependencies&&m0(i)&&v0.dependencies.add(i);const e=Xx(i);e&&wa(e,t=>this.add(t))}},Mw=class extends Jx{constructor(i){super(i)}static create(i){return new Mw(i)}getValue(){return this.source.map(i=>i.getValue())}setValue(i){const e=this.getPayload();return i.length==e.length?e.map((t,n)=>t.setValue(i[n])).some(Boolean):(super.setValue(i.map(GN)),!0)}};function GN(i){return(_w(i)?jx:sv).create(i)}function VN(i){const e=Wx(i);return e?e.constructor:$n.arr(i)?Mw:_w(i)?jx:sv}var ZS=(i,e)=>{const t=!$n.fun(i)||i.prototype&&i.prototype.isReactComponent;return Y.forwardRef((n,r)=>{const s=Y.useRef(null),a=t&&Y.useCallback(A=>{s.current=jN(r,A)},[r]),[u,d]=XN(n,e),h=NN(),m=()=>{const A=s.current;if(t&&!A)return;(A?e.applyAnimatedValues(A,u.getValue(!0)):!1)===!1&&h()},g=new WN(m,d),v=Y.useRef();xw(()=>(v.current=g,wa(d,A=>hw(A,g)),()=>{v.current&&(wa(v.current.deps,A=>R_(A,v.current)),vn.cancel(v.current.update))})),Y.useEffect(m,[]),kN(()=>()=>{const A=v.current;wa(A.deps,C=>R_(C,A))});const _=e.getComponentProps(u.getValue());return Y.createElement(i,{..._,ref:a})})},WN=class{constructor(i,e){this.update=i,this.deps=e}eventObserved(i){i.type=="change"&&vn.write(this.update)}};function XN(i,e){const t=new Set;return v0.dependencies=t,i.style&&(i={...i,style:e.createAnimatedStyle(i.style)}),i=new Jx(i),v0.dependencies=null,[i,t]}function jN(i,e){return i&&($n.fun(i)?i(e):i.current=e),e}var $S=Symbol.for("AnimatedComponent"),JN=(i,{applyAnimatedValues:e=()=>!1,createAnimatedStyle:t=r=>new Jx(r),getComponentProps:n=r=>r}={})=>{const r={applyAnimatedValues:e,createAnimatedStyle:t,getComponentProps:n},s=a=>{const u=e2(a)||"Anonymous";return $n.str(a)?a=s[a]||(s[a]=ZS(a,r)):a=a[$S]||(a[$S]=ZS(a,r)),a.displayName=`Animated(${u})`,a};return C_(i,(a,u)=>{$n.arr(i)&&(u=e2(a)),s[u]=s(a)}),{animated:s}},e2=i=>$n.str(i)?i:i&&$n.str(i.displayName)?i.displayName:$n.fun(i)&&i.name||null,t2=i=>i instanceof Ew,KN=1,Ew=class extends TN{constructor(){super(...arguments),this.id=KN++,this._priority=0}get priority(){return this._priority}set priority(i){this._priority!=i&&(this._priority=i,this._onPriorityChange(i))}get(){const i=Wx(this);return i&&i.getValue()}to(...i){return ed.to(this,i)}interpolate(...i){return DN(),ed.to(this,i)}toJSON(){return this.get()}observerAdded(i){i==1&&this._attach()}observerRemoved(i){i==0&&this._detach()}_attach(){}_detach(){}_onChange(i,e=!1){b_(this,{type:"change",parent:this,value:i,idle:e})}_onPriorityChange(i){this.idle||Vx.sort(this),b_(this,{type:"priority",parent:this,priority:i})}},Kx=({children:i,...e})=>{const t=Y.useContext(y0),n=e.pause||!!t.pause,r=e.immediate||!!t.immediate;e=UN(()=>({pause:n,immediate:r}),[n,r]);const{Provider:s}=y0;return Y.createElement(s,{value:e},i)},y0=YN(Kx,{});Kx.Provider=y0.Provider;Kx.Consumer=y0.Consumer;function YN(i,e){return Object.assign(i,Y.createContext(e)),i.Provider._context=i,i.Consumer._context=i,i}var QN=class extends Ew{constructor(i,e){super(),this.source=i,this.idle=!0,this._active=new Set,this.calc=Qh(...e);const t=this._get(),n=VN(t);Aw(this,n.create(t))}advance(i){const e=this._get(),t=this.get();cN(e,t)||(Wx(this).setValue(e),this._onChange(e,this.idle)),!this.idle&&n2(this._active)&&Jy(this)}_get(){const i=$n.arr(this.source)?this.source.map(g0):cg(g0(this.source));return this.calc(...i)}_start(){this.idle&&!n2(this._active)&&(this.idle=!1,wa(Xx(this),i=>{i.done=!1}),ed.skipAnimation?(vn.batchedUpdates(()=>this.advance()),Jy(this)):Vx.start(this))}_attach(){let i=1;wa(cg(this.source),e=>{m0(e)&&hw(e,this),t2(e)&&(e.idle||this._active.add(e),i=Math.max(i,e.priority+1))}),this.priority=i,this._start()}_detach(){wa(cg(this.source),i=>{m0(i)&&R_(i,this)}),this._active.clear(),Jy(this)}eventObserved(i){i.type=="change"?i.idle?this.advance():(this._active.add(i.parent),this._start()):i.type=="idle"?this._active.delete(i.parent):i.type=="priority"&&(this.priority=cg(this.source).reduce((e,t)=>Math.max(e,(t2(t)?t.priority:0)+1),0))}};function qN(i){return i.idle!==!1}function n2(i){return!i.size||Array.from(i).every(qN)}function Jy(i){i.idle||(i.idle=!0,wa(Xx(i),e=>{e.done=!0}),b_(i,{type:"idle",parent:i}))}ed.assign({createStringInterpolator:gw,to:(i,e)=>new QN(i,e)});var ZN=["primitive"].concat(Object.keys(FE).filter(i=>/^[A-Z]/.test(i)).map(i=>i[0].toLowerCase()+i.slice(1)));ed.assign({createStringInterpolator:gw,colors:pN,frameLoop:"demand"});TF(()=>{vn.advance()});var $N=JN(ZN,{applyAnimatedValues:Du}),e4=$N.animated;const t4=parseInt(ip.replace(/\D+/g,""));function i2(i,e){if(e===gM)return console.warn("THREE.BufferGeometryUtils.toTrianglesDrawMode(): Geometry already defined as triangles."),i;if(e===a0||e===q_){let t=i.getIndex();if(t===null){const a=[],u=i.getAttribute("position");if(u!==void 0){for(let d=0;d<u.count;d++)a.push(d);i.setIndex(a),t=i.getIndex()}else return console.error("THREE.BufferGeometryUtils.toTrianglesDrawMode(): Undefined position attribute. Processing not possible."),i}const n=t.count-2,r=[];if(t)if(e===a0)for(let a=1;a<=n;a++)r.push(t.getX(0)),r.push(t.getX(a)),r.push(t.getX(a+1));else for(let a=0;a<n;a++)a%2===0?(r.push(t.getX(a)),r.push(t.getX(a+1)),r.push(t.getX(a+2))):(r.push(t.getX(a+2)),r.push(t.getX(a+1)),r.push(t.getX(a)));r.length/3!==n&&console.error("THREE.BufferGeometryUtils.toTrianglesDrawMode(): Unable to generate correct amount of triangles.");const s=i.clone();return s.setIndex(r),s.clearGroups(),s}else return console.error("THREE.BufferGeometryUtils.toTrianglesDrawMode(): Unknown draw mode:",e),i}var n4=Object.defineProperty,i4=(i,e,t)=>e in i?n4(i,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):i[e]=t,r4=(i,e,t)=>(i4(i,e+"",t),t);class s4{constructor(){r4(this,"_listeners")}addEventListener(e,t){this._listeners===void 0&&(this._listeners={});const n=this._listeners;n[e]===void 0&&(n[e]=[]),n[e].indexOf(t)===-1&&n[e].push(t)}hasEventListener(e,t){if(this._listeners===void 0)return!1;const n=this._listeners;return n[e]!==void 0&&n[e].indexOf(t)!==-1}removeEventListener(e,t){if(this._listeners===void 0)return;const r=this._listeners[e];if(r!==void 0){const s=r.indexOf(t);s!==-1&&r.splice(s,1)}}dispatchEvent(e){if(this._listeners===void 0)return;const n=this._listeners[e.type];if(n!==void 0){e.target=this;const r=n.slice(0);for(let s=0,a=r.length;s<a;s++)r[s].call(this,e);e.target=null}}}var o4=Object.defineProperty,a4=(i,e,t)=>e in i?o4(i,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):i[e]=t,Ut=(i,e,t)=>(a4(i,typeof e!="symbol"?e+"":e,t),t);const dg=new rc,r2=new va,l4=Math.cos(70*(Math.PI/180)),s2=(i,e)=>(i%e+e)%e;let u4=class extends s4{constructor(e,t){super(),Ut(this,"object"),Ut(this,"domElement"),Ut(this,"enabled",!0),Ut(this,"target",new X),Ut(this,"minDistance",0),Ut(this,"maxDistance",1/0),Ut(this,"minZoom",0),Ut(this,"maxZoom",1/0),Ut(this,"minPolarAngle",0),Ut(this,"maxPolarAngle",Math.PI),Ut(this,"minAzimuthAngle",-1/0),Ut(this,"maxAzimuthAngle",1/0),Ut(this,"enableDamping",!1),Ut(this,"dampingFactor",.05),Ut(this,"enableZoom",!0),Ut(this,"zoomSpeed",1),Ut(this,"enableRotate",!0),Ut(this,"rotateSpeed",1),Ut(this,"enablePan",!0),Ut(this,"panSpeed",1),Ut(this,"screenSpacePanning",!0),Ut(this,"keyPanSpeed",7),Ut(this,"zoomToCursor",!1),Ut(this,"autoRotate",!1),Ut(this,"autoRotateSpeed",2),Ut(this,"reverseOrbit",!1),Ut(this,"reverseHorizontalOrbit",!1),Ut(this,"reverseVerticalOrbit",!1),Ut(this,"keys",{LEFT:"ArrowLeft",UP:"ArrowUp",RIGHT:"ArrowRight",BOTTOM:"ArrowDown"}),Ut(this,"mouseButtons",{LEFT:Iu.ROTATE,MIDDLE:Iu.DOLLY,RIGHT:Iu.PAN}),Ut(this,"touches",{ONE:Pu.ROTATE,TWO:Pu.DOLLY_PAN}),Ut(this,"target0"),Ut(this,"position0"),Ut(this,"zoom0"),Ut(this,"_domElementKeyEvents",null),Ut(this,"getPolarAngle"),Ut(this,"getAzimuthalAngle"),Ut(this,"setPolarAngle"),Ut(this,"setAzimuthalAngle"),Ut(this,"getDistance"),Ut(this,"getZoomScale"),Ut(this,"listenToKeyEvents"),Ut(this,"stopListenToKeyEvents"),Ut(this,"saveState"),Ut(this,"reset"),Ut(this,"update"),Ut(this,"connect"),Ut(this,"dispose"),Ut(this,"dollyIn"),Ut(this,"dollyOut"),Ut(this,"getScale"),Ut(this,"setScale"),this.object=e,this.domElement=t,this.target0=this.target.clone(),this.position0=this.object.position.clone(),this.zoom0=this.object.zoom,this.getPolarAngle=()=>m.phi,this.getAzimuthalAngle=()=>m.theta,this.setPolarAngle=ee=>{let Re=s2(ee,2*Math.PI),nt=m.phi;nt<0&&(nt+=2*Math.PI),Re<0&&(Re+=2*Math.PI);let $=Math.abs(Re-nt);2*Math.PI-$<$&&(Re<nt?Re+=2*Math.PI:nt+=2*Math.PI),g.phi=Re-nt,n.update()},this.setAzimuthalAngle=ee=>{let Re=s2(ee,2*Math.PI),nt=m.theta;nt<0&&(nt+=2*Math.PI),Re<0&&(Re+=2*Math.PI);let $=Math.abs(Re-nt);2*Math.PI-$<$&&(Re<nt?Re+=2*Math.PI:nt+=2*Math.PI),g.theta=Re-nt,n.update()},this.getDistance=()=>n.object.position.distanceTo(n.target),this.listenToKeyEvents=ee=>{ee.addEventListener("keydown",Ze),this._domElementKeyEvents=ee},this.stopListenToKeyEvents=()=>{this._domElementKeyEvents.removeEventListener("keydown",Ze),this._domElementKeyEvents=null},this.saveState=()=>{n.target0.copy(n.target),n.position0.copy(n.object.position),n.zoom0=n.object.zoom},this.reset=()=>{n.target.copy(n.target0),n.object.position.copy(n.position0),n.object.zoom=n.zoom0,n.object.updateProjectionMatrix(),n.dispatchEvent(r),n.update(),d=u.NONE},this.update=(()=>{const ee=new X,Re=new X(0,1,0),nt=new Fi().setFromUnitVectors(e.up,Re),$=nt.clone().invert(),Ve=new X,Me=new Fi,Be=2*Math.PI;return function(){const it=n.object.position;nt.setFromUnitVectors(e.up,Re),$.copy(nt).invert(),ee.copy(it).sub(n.target),ee.applyQuaternion(nt),m.setFromVector3(ee),n.autoRotate&&d===u.NONE&&ge(oe()),n.enableDamping?(m.theta+=g.theta*n.dampingFactor,m.phi+=g.phi*n.dampingFactor):(m.theta+=g.theta,m.phi+=g.phi);let It=n.minAzimuthAngle,ln=n.maxAzimuthAngle;isFinite(It)&&isFinite(ln)&&(It<-Math.PI?It+=Be:It>Math.PI&&(It-=Be),ln<-Math.PI?ln+=Be:ln>Math.PI&&(ln-=Be),It<=ln?m.theta=Math.max(It,Math.min(ln,m.theta)):m.theta=m.theta>(It+ln)/2?Math.max(It,m.theta):Math.min(ln,m.theta)),m.phi=Math.max(n.minPolarAngle,Math.min(n.maxPolarAngle,m.phi)),m.makeSafe(),n.enableDamping===!0?n.target.addScaledVector(_,n.dampingFactor):n.target.add(_),n.zoomToCursor&&D||n.object.isOrthographicCamera?m.radius=Fe(m.radius):m.radius=Fe(m.radius*v),ee.setFromSpherical(m),ee.applyQuaternion($),it.copy(n.target).add(ee),n.object.matrixAutoUpdate||n.object.updateMatrix(),n.object.lookAt(n.target),n.enableDamping===!0?(g.theta*=1-n.dampingFactor,g.phi*=1-n.dampingFactor,_.multiplyScalar(1-n.dampingFactor)):(g.set(0,0,0),_.set(0,0,0));let Cn=!1;if(n.zoomToCursor&&D){let Yt=null;if(n.object instanceof Hn&&n.object.isPerspectiveCamera){const Gn=ee.length();Yt=Fe(Gn*v);const Kn=Gn-Yt;n.object.position.addScaledVector(k,Kn),n.object.updateMatrixWorld()}else if(n.object.isOrthographicCamera){const Gn=new X(G.x,G.y,0);Gn.unproject(n.object),n.object.zoom=Math.max(n.minZoom,Math.min(n.maxZoom,n.object.zoom/v)),n.object.updateProjectionMatrix(),Cn=!0;const Kn=new X(G.x,G.y,0);Kn.unproject(n.object),n.object.position.sub(Kn).add(Gn),n.object.updateMatrixWorld(),Yt=ee.length()}else console.warn("WARNING: OrbitControls.js encountered an unknown camera type - zoom to cursor disabled."),n.zoomToCursor=!1;Yt!==null&&(n.screenSpacePanning?n.target.set(0,0,-1).transformDirection(n.object.matrix).multiplyScalar(Yt).add(n.object.position):(dg.origin.copy(n.object.position),dg.direction.set(0,0,-1).transformDirection(n.object.matrix),Math.abs(n.object.up.dot(dg.direction))<l4?e.lookAt(n.target):(r2.setFromNormalAndCoplanarPoint(n.object.up,n.target),dg.intersectPlane(r2,n.target))))}else n.object instanceof eo&&n.object.isOrthographicCamera&&(Cn=v!==1,Cn&&(n.object.zoom=Math.max(n.minZoom,Math.min(n.maxZoom,n.object.zoom/v)),n.object.updateProjectionMatrix()));return v=1,D=!1,Cn||Ve.distanceToSquared(n.object.position)>h||8*(1-Me.dot(n.object.quaternion))>h?(n.dispatchEvent(r),Ve.copy(n.object.position),Me.copy(n.object.quaternion),Cn=!1,!0):!1}})(),this.connect=ee=>{n.domElement=ee,n.domElement.style.touchAction="none",n.domElement.addEventListener("contextmenu",ze),n.domElement.addEventListener("pointerdown",O),n.domElement.addEventListener("pointercancel",Ce),n.domElement.addEventListener("wheel",ot)},this.dispose=()=>{var ee,Re,nt,$,Ve,Me;n.domElement&&(n.domElement.style.touchAction="auto"),(ee=n.domElement)==null||ee.removeEventListener("contextmenu",ze),(Re=n.domElement)==null||Re.removeEventListener("pointerdown",O),(nt=n.domElement)==null||nt.removeEventListener("pointercancel",Ce),($=n.domElement)==null||$.removeEventListener("wheel",ot),(Ve=n.domElement)==null||Ve.ownerDocument.removeEventListener("pointermove",pe),(Me=n.domElement)==null||Me.ownerDocument.removeEventListener("pointerup",Ce),n._domElementKeyEvents!==null&&n._domElementKeyEvents.removeEventListener("keydown",Ze)};const n=this,r={type:"change"},s={type:"start"},a={type:"end"},u={NONE:-1,ROTATE:0,DOLLY:1,PAN:2,TOUCH_ROTATE:3,TOUCH_PAN:4,TOUCH_DOLLY_PAN:5,TOUCH_DOLLY_ROTATE:6};let d=u.NONE;const h=1e-6,m=new y_,g=new y_;let v=1;const _=new X,A=new Le,C=new Le,M=new Le,S=new Le,b=new Le,R=new Le,P=new Le,U=new Le,F=new Le,k=new X,G=new Le;let D=!1;const L=[],V={};function oe(){return 2*Math.PI/60/60*n.autoRotateSpeed}function ie(){return Math.pow(.95,n.zoomSpeed)}function ge(ee){n.reverseOrbit||n.reverseHorizontalOrbit?g.theta+=ee:g.theta-=ee}function ye(ee){n.reverseOrbit||n.reverseVerticalOrbit?g.phi+=ee:g.phi-=ee}const he=(()=>{const ee=new X;return function(nt,$){ee.setFromMatrixColumn($,0),ee.multiplyScalar(-nt),_.add(ee)}})(),_e=(()=>{const ee=new X;return function(nt,$){n.screenSpacePanning===!0?ee.setFromMatrixColumn($,1):(ee.setFromMatrixColumn($,0),ee.crossVectors(n.object.up,ee)),ee.multiplyScalar(nt),_.add(ee)}})(),H=(()=>{const ee=new X;return function(nt,$){const Ve=n.domElement;if(Ve&&n.object instanceof Hn&&n.object.isPerspectiveCamera){const Me=n.object.position;ee.copy(Me).sub(n.target);let Be=ee.length();Be*=Math.tan(n.object.fov/2*Math.PI/180),he(2*nt*Be/Ve.clientHeight,n.object.matrix),_e(2*$*Be/Ve.clientHeight,n.object.matrix)}else Ve&&n.object instanceof eo&&n.object.isOrthographicCamera?(he(nt*(n.object.right-n.object.left)/n.object.zoom/Ve.clientWidth,n.object.matrix),_e($*(n.object.top-n.object.bottom)/n.object.zoom/Ve.clientHeight,n.object.matrix)):(console.warn("WARNING: OrbitControls.js encountered an unknown camera type - pan disabled."),n.enablePan=!1)}})();function Z(ee){n.object instanceof Hn&&n.object.isPerspectiveCamera||n.object instanceof eo&&n.object.isOrthographicCamera?v=ee:(console.warn("WARNING: OrbitControls.js encountered an unknown camera type - dolly/zoom disabled."),n.enableZoom=!1)}function q(ee){Z(v/ee)}function W(ee){Z(v*ee)}function ne(ee){if(!n.zoomToCursor||!n.domElement)return;D=!0;const Re=n.domElement.getBoundingClientRect(),nt=ee.clientX-Re.left,$=ee.clientY-Re.top,Ve=Re.width,Me=Re.height;G.x=nt/Ve*2-1,G.y=-($/Me)*2+1,k.set(G.x,G.y,1).unproject(n.object).sub(n.object.position).normalize()}function Fe(ee){return Math.max(n.minDistance,Math.min(n.maxDistance,ee))}function ae(ee){A.set(ee.clientX,ee.clientY)}function we(ee){ne(ee),P.set(ee.clientX,ee.clientY)}function De(ee){S.set(ee.clientX,ee.clientY)}function Ie(ee){C.set(ee.clientX,ee.clientY),M.subVectors(C,A).multiplyScalar(n.rotateSpeed);const Re=n.domElement;Re&&(ge(2*Math.PI*M.x/Re.clientHeight),ye(2*Math.PI*M.y/Re.clientHeight)),A.copy(C),n.update()}function Xe(ee){U.set(ee.clientX,ee.clientY),F.subVectors(U,P),F.y>0?q(ie()):F.y<0&&W(ie()),P.copy(U),n.update()}function _t(ee){b.set(ee.clientX,ee.clientY),R.subVectors(b,S).multiplyScalar(n.panSpeed),H(R.x,R.y),S.copy(b),n.update()}function Je(ee){ne(ee),ee.deltaY<0?W(ie()):ee.deltaY>0&&q(ie()),n.update()}function st(ee){let Re=!1;switch(ee.code){case n.keys.UP:H(0,n.keyPanSpeed),Re=!0;break;case n.keys.BOTTOM:H(0,-n.keyPanSpeed),Re=!0;break;case n.keys.LEFT:H(n.keyPanSpeed,0),Re=!0;break;case n.keys.RIGHT:H(-n.keyPanSpeed,0),Re=!0;break}Re&&(ee.preventDefault(),n.update())}function Ne(){if(L.length==1)A.set(L[0].pageX,L[0].pageY);else{const ee=.5*(L[0].pageX+L[1].pageX),Re=.5*(L[0].pageY+L[1].pageY);A.set(ee,Re)}}function be(){if(L.length==1)S.set(L[0].pageX,L[0].pageY);else{const ee=.5*(L[0].pageX+L[1].pageX),Re=.5*(L[0].pageY+L[1].pageY);S.set(ee,Re)}}function J(){const ee=L[0].pageX-L[1].pageX,Re=L[0].pageY-L[1].pageY,nt=Math.sqrt(ee*ee+Re*Re);P.set(0,nt)}function mt(){n.enableZoom&&J(),n.enablePan&&be()}function ke(){n.enableZoom&&J(),n.enableRotate&&Ne()}function et(ee){if(L.length==1)C.set(ee.pageX,ee.pageY);else{const nt=ht(ee),$=.5*(ee.pageX+nt.x),Ve=.5*(ee.pageY+nt.y);C.set($,Ve)}M.subVectors(C,A).multiplyScalar(n.rotateSpeed);const Re=n.domElement;Re&&(ge(2*Math.PI*M.x/Re.clientHeight),ye(2*Math.PI*M.y/Re.clientHeight)),A.copy(C)}function je(ee){if(L.length==1)b.set(ee.pageX,ee.pageY);else{const Re=ht(ee),nt=.5*(ee.pageX+Re.x),$=.5*(ee.pageY+Re.y);b.set(nt,$)}R.subVectors(b,S).multiplyScalar(n.panSpeed),H(R.x,R.y),S.copy(b)}function wt(ee){const Re=ht(ee),nt=ee.pageX-Re.x,$=ee.pageY-Re.y,Ve=Math.sqrt(nt*nt+$*$);U.set(0,Ve),F.set(0,Math.pow(U.y/P.y,n.zoomSpeed)),q(F.y),P.copy(U)}function qe(ee){n.enableZoom&&wt(ee),n.enablePan&&je(ee)}function j(ee){n.enableZoom&&wt(ee),n.enableRotate&&et(ee)}function O(ee){var Re,nt;n.enabled!==!1&&(L.length===0&&((Re=n.domElement)==null||Re.ownerDocument.addEventListener("pointermove",pe),(nt=n.domElement)==null||nt.ownerDocument.addEventListener("pointerup",Ce)),gt(ee),ee.pointerType==="touch"?ct(ee):Ue(ee))}function pe(ee){n.enabled!==!1&&(ee.pointerType==="touch"?zt(ee):Pe(ee))}function Ce(ee){var Re,nt,$;Pt(ee),L.length===0&&((Re=n.domElement)==null||Re.releasePointerCapture(ee.pointerId),(nt=n.domElement)==null||nt.ownerDocument.removeEventListener("pointermove",pe),($=n.domElement)==null||$.ownerDocument.removeEventListener("pointerup",Ce)),n.dispatchEvent(a),d=u.NONE}function Ue(ee){let Re;switch(ee.button){case 0:Re=n.mouseButtons.LEFT;break;case 1:Re=n.mouseButtons.MIDDLE;break;case 2:Re=n.mouseButtons.RIGHT;break;default:Re=-1}switch(Re){case Iu.DOLLY:if(n.enableZoom===!1)return;we(ee),d=u.DOLLY;break;case Iu.ROTATE:if(ee.ctrlKey||ee.metaKey||ee.shiftKey){if(n.enablePan===!1)return;De(ee),d=u.PAN}else{if(n.enableRotate===!1)return;ae(ee),d=u.ROTATE}break;case Iu.PAN:if(ee.ctrlKey||ee.metaKey||ee.shiftKey){if(n.enableRotate===!1)return;ae(ee),d=u.ROTATE}else{if(n.enablePan===!1)return;De(ee),d=u.PAN}break;default:d=u.NONE}d!==u.NONE&&n.dispatchEvent(s)}function Pe(ee){if(n.enabled!==!1)switch(d){case u.ROTATE:if(n.enableRotate===!1)return;Ie(ee);break;case u.DOLLY:if(n.enableZoom===!1)return;Xe(ee);break;case u.PAN:if(n.enablePan===!1)return;_t(ee);break}}function ot(ee){n.enabled===!1||n.enableZoom===!1||d!==u.NONE&&d!==u.ROTATE||(ee.preventDefault(),n.dispatchEvent(s),Je(ee),n.dispatchEvent(a))}function Ze(ee){n.enabled===!1||n.enablePan===!1||st(ee)}function ct(ee){switch(Dt(ee),L.length){case 1:switch(n.touches.ONE){case Pu.ROTATE:if(n.enableRotate===!1)return;Ne(),d=u.TOUCH_ROTATE;break;case Pu.PAN:if(n.enablePan===!1)return;be(),d=u.TOUCH_PAN;break;default:d=u.NONE}break;case 2:switch(n.touches.TWO){case Pu.DOLLY_PAN:if(n.enableZoom===!1&&n.enablePan===!1)return;mt(),d=u.TOUCH_DOLLY_PAN;break;case Pu.DOLLY_ROTATE:if(n.enableZoom===!1&&n.enableRotate===!1)return;ke(),d=u.TOUCH_DOLLY_ROTATE;break;default:d=u.NONE}break;default:d=u.NONE}d!==u.NONE&&n.dispatchEvent(s)}function zt(ee){switch(Dt(ee),d){case u.TOUCH_ROTATE:if(n.enableRotate===!1)return;et(ee),n.update();break;case u.TOUCH_PAN:if(n.enablePan===!1)return;je(ee),n.update();break;case u.TOUCH_DOLLY_PAN:if(n.enableZoom===!1&&n.enablePan===!1)return;qe(ee),n.update();break;case u.TOUCH_DOLLY_ROTATE:if(n.enableZoom===!1&&n.enableRotate===!1)return;j(ee),n.update();break;default:d=u.NONE}}function ze(ee){n.enabled!==!1&&ee.preventDefault()}function gt(ee){L.push(ee)}function Pt(ee){delete V[ee.pointerId];for(let Re=0;Re<L.length;Re++)if(L[Re].pointerId==ee.pointerId){L.splice(Re,1);return}}function Dt(ee){let Re=V[ee.pointerId];Re===void 0&&(Re=new Le,V[ee.pointerId]=Re),Re.set(ee.pageX,ee.pageY)}function ht(ee){const Re=ee.pointerId===L[0].pointerId?L[1]:L[0];return V[Re.pointerId]}this.dollyIn=(ee=ie())=>{W(ee),n.update()},this.dollyOut=(ee=ie())=>{q(ee),n.update()},this.getScale=()=>v,this.setScale=ee=>{Z(ee),n.update()},this.getZoomScale=()=>ie(),t!==void 0&&this.connect(t),this.update()}};function _0(i){if(typeof TextDecoder<"u")return new TextDecoder().decode(i);let e="";for(let t=0,n=i.length;t<n;t++)e+=String.fromCharCode(i[t]);try{return decodeURIComponent(escape(e))}catch{return e}}const Gu="srgb",Ca="srgb-linear",o2=3001,c4=3e3;class Yx extends ar{constructor(e){super(e),this.dracoLoader=null,this.ktx2Loader=null,this.meshoptDecoder=null,this.pluginCallbacks=[],this.register(function(t){return new m4(t)}),this.register(function(t){return new g4(t)}),this.register(function(t){return new w4(t)}),this.register(function(t){return new C4(t)}),this.register(function(t){return new T4(t)}),this.register(function(t){return new y4(t)}),this.register(function(t){return new _4(t)}),this.register(function(t){return new x4(t)}),this.register(function(t){return new A4(t)}),this.register(function(t){return new p4(t)}),this.register(function(t){return new S4(t)}),this.register(function(t){return new v4(t)}),this.register(function(t){return new E4(t)}),this.register(function(t){return new M4(t)}),this.register(function(t){return new d4(t)}),this.register(function(t){return new b4(t)}),this.register(function(t){return new R4(t)})}load(e,t,n,r){const s=this;let a;if(this.resourcePath!=="")a=this.resourcePath;else if(this.path!==""){const h=Sl.extractUrlBase(e);a=Sl.resolveURL(h,this.path)}else a=Sl.extractUrlBase(e);this.manager.itemStart(e);const u=function(h){r?r(h):console.error(h),s.manager.itemError(e),s.manager.itemEnd(e)},d=new is(this.manager);d.setPath(this.path),d.setResponseType("arraybuffer"),d.setRequestHeader(this.requestHeader),d.setWithCredentials(this.withCredentials),d.load(e,function(h){try{s.parse(h,a,function(m){t(m),s.manager.itemEnd(e)},u)}catch(m){u(m)}},n,u)}setDRACOLoader(e){return this.dracoLoader=e,this}setDDSLoader(){throw new Error('THREE.GLTFLoader: "MSFT_texture_dds" no longer supported. Please update to "KHR_texture_basisu".')}setKTX2Loader(e){return this.ktx2Loader=e,this}setMeshoptDecoder(e){return this.meshoptDecoder=e,this}register(e){return this.pluginCallbacks.indexOf(e)===-1&&this.pluginCallbacks.push(e),this}unregister(e){return this.pluginCallbacks.indexOf(e)!==-1&&this.pluginCallbacks.splice(this.pluginCallbacks.indexOf(e),1),this}parse(e,t,n,r){let s;const a={},u={};if(typeof e=="string")s=JSON.parse(e);else if(e instanceof ArrayBuffer)if(_0(new Uint8Array(e.slice(0,4)))===ww){try{a[cn.KHR_BINARY_GLTF]=new I4(e)}catch(m){r&&r(m);return}s=JSON.parse(a[cn.KHR_BINARY_GLTF].content)}else s=JSON.parse(_0(new Uint8Array(e)));else s=e;if(s.asset===void 0||s.asset.version[0]<2){r&&r(new Error("THREE.GLTFLoader: Unsupported asset. glTF versions >=2.0 are supported."));return}const d=new V4(s,{path:t||this.resourcePath||"",crossOrigin:this.crossOrigin,requestHeader:this.requestHeader,manager:this.manager,ktx2Loader:this.ktx2Loader,meshoptDecoder:this.meshoptDecoder});d.fileLoader.setRequestHeader(this.requestHeader);for(let h=0;h<this.pluginCallbacks.length;h++){const m=this.pluginCallbacks[h](d);m.name||console.error("THREE.GLTFLoader: Invalid plugin found: missing name"),u[m.name]=m,a[m.name]=!0}if(s.extensionsUsed)for(let h=0;h<s.extensionsUsed.length;++h){const m=s.extensionsUsed[h],g=s.extensionsRequired||[];switch(m){case cn.KHR_MATERIALS_UNLIT:a[m]=new h4;break;case cn.KHR_DRACO_MESH_COMPRESSION:a[m]=new P4(s,this.dracoLoader);break;case cn.KHR_TEXTURE_TRANSFORM:a[m]=new B4;break;case cn.KHR_MESH_QUANTIZATION:a[m]=new L4;break;default:g.indexOf(m)>=0&&u[m]===void 0&&console.warn('THREE.GLTFLoader: Unknown extension "'+m+'".')}}d.setExtensions(a),d.setPlugins(u),d.parse(n,r)}parseAsync(e,t){const n=this;return new Promise(function(r,s){n.parse(e,t,r,s)})}}function f4(){let i={};return{get:function(e){return i[e]},add:function(e,t){i[e]=t},remove:function(e){delete i[e]},removeAll:function(){i={}}}}const cn={KHR_BINARY_GLTF:"KHR_binary_glTF",KHR_DRACO_MESH_COMPRESSION:"KHR_draco_mesh_compression",KHR_LIGHTS_PUNCTUAL:"KHR_lights_punctual",KHR_MATERIALS_CLEARCOAT:"KHR_materials_clearcoat",KHR_MATERIALS_DISPERSION:"KHR_materials_dispersion",KHR_MATERIALS_IOR:"KHR_materials_ior",KHR_MATERIALS_SHEEN:"KHR_materials_sheen",KHR_MATERIALS_SPECULAR:"KHR_materials_specular",KHR_MATERIALS_TRANSMISSION:"KHR_materials_transmission",KHR_MATERIALS_IRIDESCENCE:"KHR_materials_iridescence",KHR_MATERIALS_ANISOTROPY:"KHR_materials_anisotropy",KHR_MATERIALS_UNLIT:"KHR_materials_unlit",KHR_MATERIALS_VOLUME:"KHR_materials_volume",KHR_TEXTURE_BASISU:"KHR_texture_basisu",KHR_TEXTURE_TRANSFORM:"KHR_texture_transform",KHR_MESH_QUANTIZATION:"KHR_mesh_quantization",KHR_MATERIALS_EMISSIVE_STRENGTH:"KHR_materials_emissive_strength",EXT_MATERIALS_BUMP:"EXT_materials_bump",EXT_TEXTURE_WEBP:"EXT_texture_webp",EXT_TEXTURE_AVIF:"EXT_texture_avif",EXT_MESHOPT_COMPRESSION:"EXT_meshopt_compression",EXT_MESH_GPU_INSTANCING:"EXT_mesh_gpu_instancing"};class d4{constructor(e){this.parser=e,this.name=cn.KHR_LIGHTS_PUNCTUAL,this.cache={refs:{},uses:{}}}_markDefs(){const e=this.parser,t=this.parser.json.nodes||[];for(let n=0,r=t.length;n<r;n++){const s=t[n];s.extensions&&s.extensions[this.name]&&s.extensions[this.name].light!==void 0&&e._addNodeRef(this.cache,s.extensions[this.name].light)}}_loadLight(e){const t=this.parser,n="light:"+e;let r=t.cache.get(n);if(r)return r;const s=t.json,d=((s.extensions&&s.extensions[this.name]||{}).lights||[])[e];let h;const m=new tt(16777215);d.color!==void 0&&m.setRGB(d.color[0],d.color[1],d.color[2],Ca);const g=d.range!==void 0?d.range:0;switch(d.type){case"directional":h=new Ex(m),h.target.position.set(0,0,-1),h.add(h.target);break;case"point":h=new Mx(m),h.distance=g;break;case"spot":h=new Sx(m),h.distance=g,d.spot=d.spot||{},d.spot.innerConeAngle=d.spot.innerConeAngle!==void 0?d.spot.innerConeAngle:0,d.spot.outerConeAngle=d.spot.outerConeAngle!==void 0?d.spot.outerConeAngle:Math.PI/4,h.angle=d.spot.outerConeAngle,h.penumbra=1-d.spot.innerConeAngle/d.spot.outerConeAngle,h.target.position.set(0,0,-1),h.add(h.target);break;default:throw new Error("THREE.GLTFLoader: Unexpected light type: "+d.type)}return h.position.set(0,0,0),h.decay=2,ga(h,d),d.intensity!==void 0&&(h.intensity=d.intensity),h.name=t.createUniqueName(d.name||"light_"+e),r=Promise.resolve(h),t.cache.add(n,r),r}getDependency(e,t){if(e==="light")return this._loadLight(t)}createNodeAttachment(e){const t=this,n=this.parser,s=n.json.nodes[e],u=(s.extensions&&s.extensions[this.name]||{}).light;return u===void 0?null:this._loadLight(u).then(function(d){return n._getNodeRef(t.cache,u,d)})}}class h4{constructor(){this.name=cn.KHR_MATERIALS_UNLIT}getMaterialType(){return es}extendParams(e,t,n){const r=[];e.color=new tt(1,1,1),e.opacity=1;const s=t.pbrMetallicRoughness;if(s){if(Array.isArray(s.baseColorFactor)){const a=s.baseColorFactor;e.color.setRGB(a[0],a[1],a[2],Ca),e.opacity=a[3]}s.baseColorTexture!==void 0&&r.push(n.assignTexture(e,"map",s.baseColorTexture,Gu))}return Promise.all(r)}}class p4{constructor(e){this.parser=e,this.name=cn.KHR_MATERIALS_EMISSIVE_STRENGTH}extendMaterialParams(e,t){const r=this.parser.json.materials[e];if(!r.extensions||!r.extensions[this.name])return Promise.resolve();const s=r.extensions[this.name].emissiveStrength;return s!==void 0&&(t.emissiveIntensity=s),Promise.resolve()}}class m4{constructor(e){this.parser=e,this.name=cn.KHR_MATERIALS_CLEARCOAT}getMaterialType(e){const n=this.parser.json.materials[e];return!n.extensions||!n.extensions[this.name]?null:Ss}extendMaterialParams(e,t){const n=this.parser,r=n.json.materials[e];if(!r.extensions||!r.extensions[this.name])return Promise.resolve();const s=[],a=r.extensions[this.name];if(a.clearcoatFactor!==void 0&&(t.clearcoat=a.clearcoatFactor),a.clearcoatTexture!==void 0&&s.push(n.assignTexture(t,"clearcoatMap",a.clearcoatTexture)),a.clearcoatRoughnessFactor!==void 0&&(t.clearcoatRoughness=a.clearcoatRoughnessFactor),a.clearcoatRoughnessTexture!==void 0&&s.push(n.assignTexture(t,"clearcoatRoughnessMap",a.clearcoatRoughnessTexture)),a.clearcoatNormalTexture!==void 0&&(s.push(n.assignTexture(t,"clearcoatNormalMap",a.clearcoatNormalTexture)),a.clearcoatNormalTexture.scale!==void 0)){const u=a.clearcoatNormalTexture.scale;t.clearcoatNormalScale=new Le(u,u)}return Promise.all(s)}}class g4{constructor(e){this.parser=e,this.name=cn.KHR_MATERIALS_DISPERSION}getMaterialType(e){const n=this.parser.json.materials[e];return!n.extensions||!n.extensions[this.name]?null:Ss}extendMaterialParams(e,t){const r=this.parser.json.materials[e];if(!r.extensions||!r.extensions[this.name])return Promise.resolve();const s=r.extensions[this.name];return t.dispersion=s.dispersion!==void 0?s.dispersion:0,Promise.resolve()}}class v4{constructor(e){this.parser=e,this.name=cn.KHR_MATERIALS_IRIDESCENCE}getMaterialType(e){const n=this.parser.json.materials[e];return!n.extensions||!n.extensions[this.name]?null:Ss}extendMaterialParams(e,t){const n=this.parser,r=n.json.materials[e];if(!r.extensions||!r.extensions[this.name])return Promise.resolve();const s=[],a=r.extensions[this.name];return a.iridescenceFactor!==void 0&&(t.iridescence=a.iridescenceFactor),a.iridescenceTexture!==void 0&&s.push(n.assignTexture(t,"iridescenceMap",a.iridescenceTexture)),a.iridescenceIor!==void 0&&(t.iridescenceIOR=a.iridescenceIor),t.iridescenceThicknessRange===void 0&&(t.iridescenceThicknessRange=[100,400]),a.iridescenceThicknessMinimum!==void 0&&(t.iridescenceThicknessRange[0]=a.iridescenceThicknessMinimum),a.iridescenceThicknessMaximum!==void 0&&(t.iridescenceThicknessRange[1]=a.iridescenceThicknessMaximum),a.iridescenceThicknessTexture!==void 0&&s.push(n.assignTexture(t,"iridescenceThicknessMap",a.iridescenceThicknessTexture)),Promise.all(s)}}class y4{constructor(e){this.parser=e,this.name=cn.KHR_MATERIALS_SHEEN}getMaterialType(e){const n=this.parser.json.materials[e];return!n.extensions||!n.extensions[this.name]?null:Ss}extendMaterialParams(e,t){const n=this.parser,r=n.json.materials[e];if(!r.extensions||!r.extensions[this.name])return Promise.resolve();const s=[];t.sheenColor=new tt(0,0,0),t.sheenRoughness=0,t.sheen=1;const a=r.extensions[this.name];if(a.sheenColorFactor!==void 0){const u=a.sheenColorFactor;t.sheenColor.setRGB(u[0],u[1],u[2],Ca)}return a.sheenRoughnessFactor!==void 0&&(t.sheenRoughness=a.sheenRoughnessFactor),a.sheenColorTexture!==void 0&&s.push(n.assignTexture(t,"sheenColorMap",a.sheenColorTexture,Gu)),a.sheenRoughnessTexture!==void 0&&s.push(n.assignTexture(t,"sheenRoughnessMap",a.sheenRoughnessTexture)),Promise.all(s)}}class _4{constructor(e){this.parser=e,this.name=cn.KHR_MATERIALS_TRANSMISSION}getMaterialType(e){const n=this.parser.json.materials[e];return!n.extensions||!n.extensions[this.name]?null:Ss}extendMaterialParams(e,t){const n=this.parser,r=n.json.materials[e];if(!r.extensions||!r.extensions[this.name])return Promise.resolve();const s=[],a=r.extensions[this.name];return a.transmissionFactor!==void 0&&(t.transmission=a.transmissionFactor),a.transmissionTexture!==void 0&&s.push(n.assignTexture(t,"transmissionMap",a.transmissionTexture)),Promise.all(s)}}class x4{constructor(e){this.parser=e,this.name=cn.KHR_MATERIALS_VOLUME}getMaterialType(e){const n=this.parser.json.materials[e];return!n.extensions||!n.extensions[this.name]?null:Ss}extendMaterialParams(e,t){const n=this.parser,r=n.json.materials[e];if(!r.extensions||!r.extensions[this.name])return Promise.resolve();const s=[],a=r.extensions[this.name];t.thickness=a.thicknessFactor!==void 0?a.thicknessFactor:0,a.thicknessTexture!==void 0&&s.push(n.assignTexture(t,"thicknessMap",a.thicknessTexture)),t.attenuationDistance=a.attenuationDistance||1/0;const u=a.attenuationColor||[1,1,1];return t.attenuationColor=new tt().setRGB(u[0],u[1],u[2],Ca),Promise.all(s)}}class A4{constructor(e){this.parser=e,this.name=cn.KHR_MATERIALS_IOR}getMaterialType(e){const n=this.parser.json.materials[e];return!n.extensions||!n.extensions[this.name]?null:Ss}extendMaterialParams(e,t){const r=this.parser.json.materials[e];if(!r.extensions||!r.extensions[this.name])return Promise.resolve();const s=r.extensions[this.name];return t.ior=s.ior!==void 0?s.ior:1.5,Promise.resolve()}}class S4{constructor(e){this.parser=e,this.name=cn.KHR_MATERIALS_SPECULAR}getMaterialType(e){const n=this.parser.json.materials[e];return!n.extensions||!n.extensions[this.name]?null:Ss}extendMaterialParams(e,t){const n=this.parser,r=n.json.materials[e];if(!r.extensions||!r.extensions[this.name])return Promise.resolve();const s=[],a=r.extensions[this.name];t.specularIntensity=a.specularFactor!==void 0?a.specularFactor:1,a.specularTexture!==void 0&&s.push(n.assignTexture(t,"specularIntensityMap",a.specularTexture));const u=a.specularColorFactor||[1,1,1];return t.specularColor=new tt().setRGB(u[0],u[1],u[2],Ca),a.specularColorTexture!==void 0&&s.push(n.assignTexture(t,"specularColorMap",a.specularColorTexture,Gu)),Promise.all(s)}}class M4{constructor(e){this.parser=e,this.name=cn.EXT_MATERIALS_BUMP}getMaterialType(e){const n=this.parser.json.materials[e];return!n.extensions||!n.extensions[this.name]?null:Ss}extendMaterialParams(e,t){const n=this.parser,r=n.json.materials[e];if(!r.extensions||!r.extensions[this.name])return Promise.resolve();const s=[],a=r.extensions[this.name];return t.bumpScale=a.bumpFactor!==void 0?a.bumpFactor:1,a.bumpTexture!==void 0&&s.push(n.assignTexture(t,"bumpMap",a.bumpTexture)),Promise.all(s)}}class E4{constructor(e){this.parser=e,this.name=cn.KHR_MATERIALS_ANISOTROPY}getMaterialType(e){const n=this.parser.json.materials[e];return!n.extensions||!n.extensions[this.name]?null:Ss}extendMaterialParams(e,t){const n=this.parser,r=n.json.materials[e];if(!r.extensions||!r.extensions[this.name])return Promise.resolve();const s=[],a=r.extensions[this.name];return a.anisotropyStrength!==void 0&&(t.anisotropy=a.anisotropyStrength),a.anisotropyRotation!==void 0&&(t.anisotropyRotation=a.anisotropyRotation),a.anisotropyTexture!==void 0&&s.push(n.assignTexture(t,"anisotropyMap",a.anisotropyTexture)),Promise.all(s)}}class w4{constructor(e){this.parser=e,this.name=cn.KHR_TEXTURE_BASISU}loadTexture(e){const t=this.parser,n=t.json,r=n.textures[e];if(!r.extensions||!r.extensions[this.name])return null;const s=r.extensions[this.name],a=t.options.ktx2Loader;if(!a){if(n.extensionsRequired&&n.extensionsRequired.indexOf(this.name)>=0)throw new Error("THREE.GLTFLoader: setKTX2Loader must be called before loading KTX2 textures");return null}return t.loadTextureImage(e,s.source,a)}}class C4{constructor(e){this.parser=e,this.name=cn.EXT_TEXTURE_WEBP,this.isSupported=null}loadTexture(e){const t=this.name,n=this.parser,r=n.json,s=r.textures[e];if(!s.extensions||!s.extensions[t])return null;const a=s.extensions[t],u=r.images[a.source];let d=n.textureLoader;if(u.uri){const h=n.options.manager.getHandler(u.uri);h!==null&&(d=h)}return this.detectSupport().then(function(h){if(h)return n.loadTextureImage(e,a.source,d);if(r.extensionsRequired&&r.extensionsRequired.indexOf(t)>=0)throw new Error("THREE.GLTFLoader: WebP required by asset but unsupported.");return n.loadTexture(e)})}detectSupport(){return this.isSupported||(this.isSupported=new Promise(function(e){const t=new Image;t.src="data:image/webp;base64,UklGRiIAAABXRUJQVlA4IBYAAAAwAQCdASoBAAEADsD+JaQAA3AAAAAA",t.onload=t.onerror=function(){e(t.height===1)}})),this.isSupported}}class T4{constructor(e){this.parser=e,this.name=cn.EXT_TEXTURE_AVIF,this.isSupported=null}loadTexture(e){const t=this.name,n=this.parser,r=n.json,s=r.textures[e];if(!s.extensions||!s.extensions[t])return null;const a=s.extensions[t],u=r.images[a.source];let d=n.textureLoader;if(u.uri){const h=n.options.manager.getHandler(u.uri);h!==null&&(d=h)}return this.detectSupport().then(function(h){if(h)return n.loadTextureImage(e,a.source,d);if(r.extensionsRequired&&r.extensionsRequired.indexOf(t)>=0)throw new Error("THREE.GLTFLoader: AVIF required by asset but unsupported.");return n.loadTexture(e)})}detectSupport(){return this.isSupported||(this.isSupported=new Promise(function(e){const t=new Image;t.src="data:image/avif;base64,AAAAIGZ0eXBhdmlmAAAAAGF2aWZtaWYxbWlhZk1BMUIAAADybWV0YQAAAAAAAAAoaGRscgAAAAAAAAAAcGljdAAAAAAAAAAAAAAAAGxpYmF2aWYAAAAADnBpdG0AAAAAAAEAAAAeaWxvYwAAAABEAAABAAEAAAABAAABGgAAABcAAAAoaWluZgAAAAAAAQAAABppbmZlAgAAAAABAABhdjAxQ29sb3IAAAAAamlwcnAAAABLaXBjbwAAABRpc3BlAAAAAAAAAAEAAAABAAAAEHBpeGkAAAAAAwgICAAAAAxhdjFDgQAMAAAAABNjb2xybmNseAACAAIABoAAAAAXaXBtYQAAAAAAAAABAAEEAQKDBAAAAB9tZGF0EgAKCBgABogQEDQgMgkQAAAAB8dSLfI=",t.onload=t.onerror=function(){e(t.height===1)}})),this.isSupported}}class b4{constructor(e){this.name=cn.EXT_MESHOPT_COMPRESSION,this.parser=e}loadBufferView(e){const t=this.parser.json,n=t.bufferViews[e];if(n.extensions&&n.extensions[this.name]){const r=n.extensions[this.name],s=this.parser.getDependency("buffer",r.buffer),a=this.parser.options.meshoptDecoder;if(!a||!a.supported){if(t.extensionsRequired&&t.extensionsRequired.indexOf(this.name)>=0)throw new Error("THREE.GLTFLoader: setMeshoptDecoder must be called before loading compressed files");return null}return s.then(function(u){const d=r.byteOffset||0,h=r.byteLength||0,m=r.count,g=r.byteStride,v=new Uint8Array(u,d,h);return a.decodeGltfBufferAsync?a.decodeGltfBufferAsync(m,g,v,r.mode,r.filter).then(function(_){return _.buffer}):a.ready.then(function(){const _=new ArrayBuffer(m*g);return a.decodeGltfBuffer(new Uint8Array(_),m,g,v,r.mode,r.filter),_})})}else return null}}class R4{constructor(e){this.name=cn.EXT_MESH_GPU_INSTANCING,this.parser=e}createNodeMesh(e){const t=this.parser.json,n=t.nodes[e];if(!n.extensions||!n.extensions[this.name]||n.mesh===void 0)return null;const r=t.meshes[n.mesh];for(const h of r.primitives)if(h.mode!==ys.TRIANGLES&&h.mode!==ys.TRIANGLE_STRIP&&h.mode!==ys.TRIANGLE_FAN&&h.mode!==void 0)return null;const a=n.extensions[this.name].attributes,u=[],d={};for(const h in a)u.push(this.parser.getDependency("accessor",a[h]).then(m=>(d[h]=m,d[h])));return u.length<1?null:(u.push(this.parser.createNodeMesh(e)),Promise.all(u).then(h=>{const m=h.pop(),g=m.isGroup?m.children:[m],v=h[0].count,_=[];for(const A of g){const C=new Ot,M=new X,S=new Fi,b=new X(1,1,1),R=new sx(A.geometry,A.material,v);for(let P=0;P<v;P++)d.TRANSLATION&&M.fromBufferAttribute(d.TRANSLATION,P),d.ROTATION&&S.fromBufferAttribute(d.ROTATION,P),d.SCALE&&b.fromBufferAttribute(d.SCALE,P),R.setMatrixAt(P,C.compose(M,S,b));for(const P in d)if(P==="_COLOR_0"){const U=d[P];R.instanceColor=new Zu(U.array,U.itemSize,U.normalized)}else P!=="TRANSLATION"&&P!=="ROTATION"&&P!=="SCALE"&&A.geometry.setAttribute(P,d[P]);fn.prototype.copy.call(R,A),this.parser.assignFinalMaterial(R),_.push(R)}return m.isGroup?(m.clear(),m.add(..._),m):_[0]}))}}const ww="glTF",Ah=12,a2={JSON:1313821514,BIN:5130562};class I4{constructor(e){this.name=cn.KHR_BINARY_GLTF,this.content=null,this.body=null;const t=new DataView(e,0,Ah);if(this.header={magic:_0(new Uint8Array(e.slice(0,4))),version:t.getUint32(4,!0),length:t.getUint32(8,!0)},this.header.magic!==ww)throw new Error("THREE.GLTFLoader: Unsupported glTF-Binary header.");if(this.header.version<2)throw new Error("THREE.GLTFLoader: Legacy binary file detected.");const n=this.header.length-Ah,r=new DataView(e,Ah);let s=0;for(;s<n;){const a=r.getUint32(s,!0);s+=4;const u=r.getUint32(s,!0);if(s+=4,u===a2.JSON){const d=new Uint8Array(e,Ah+s,a);this.content=_0(d)}else if(u===a2.BIN){const d=Ah+s;this.body=e.slice(d,d+a)}s+=a}if(this.content===null)throw new Error("THREE.GLTFLoader: JSON content not found.")}}class P4{constructor(e,t){if(!t)throw new Error("THREE.GLTFLoader: No DRACOLoader instance provided.");this.name=cn.KHR_DRACO_MESH_COMPRESSION,this.json=e,this.dracoLoader=t,this.dracoLoader.preload()}decodePrimitive(e,t){const n=this.json,r=this.dracoLoader,s=e.extensions[this.name].bufferView,a=e.extensions[this.name].attributes,u={},d={},h={};for(const m in a){const g=I_[m]||m.toLowerCase();u[g]=a[m]}for(const m in e.attributes){const g=I_[m]||m.toLowerCase();if(a[m]!==void 0){const v=n.accessors[e.attributes[m]],_=Xf[v.componentType];h[g]=_.name,d[g]=v.normalized===!0}}return t.getDependency("bufferView",s).then(function(m){return new Promise(function(g,v){r.decodeDracoFile(m,function(_){for(const A in _.attributes){const C=_.attributes[A],M=d[A];M!==void 0&&(C.normalized=M)}g(_)},u,h,Ca,v)})})}}class B4{constructor(){this.name=cn.KHR_TEXTURE_TRANSFORM}extendTexture(e,t){return(t.texCoord===void 0||t.texCoord===e.channel)&&t.offset===void 0&&t.rotation===void 0&&t.scale===void 0||(e=e.clone(),t.texCoord!==void 0&&(e.channel=t.texCoord),t.offset!==void 0&&e.offset.fromArray(t.offset),t.rotation!==void 0&&(e.rotation=t.rotation),t.scale!==void 0&&e.repeat.fromArray(t.scale),e.needsUpdate=!0),e}}class L4{constructor(){this.name=cn.KHR_MESH_QUANTIZATION}}class Cw extends ld{constructor(e,t,n,r){super(e,t,n,r)}copySampleValue_(e){const t=this.resultBuffer,n=this.sampleValues,r=this.valueSize,s=e*r*3+r;for(let a=0;a!==r;a++)t[a]=n[s+a];return t}interpolate_(e,t,n,r){const s=this.resultBuffer,a=this.sampleValues,u=this.valueSize,d=u*2,h=u*3,m=r-t,g=(n-t)/m,v=g*g,_=v*g,A=e*h,C=A-h,M=-2*_+3*v,S=_-v,b=1-M,R=S-v+g;for(let P=0;P!==u;P++){const U=a[C+P+u],F=a[C+P+d]*m,k=a[A+P+u],G=a[A+P]*m;s[P]=b*U+R*F+M*k+S*G}return s}}const D4=new Fi;class F4 extends Cw{interpolate_(e,t,n,r){const s=super.interpolate_(e,t,n,r);return D4.fromArray(s).normalize().toArray(s),s}}const ys={POINTS:0,LINES:1,LINE_LOOP:2,LINE_STRIP:3,TRIANGLES:4,TRIANGLE_STRIP:5,TRIANGLE_FAN:6},Xf={5120:Int8Array,5121:Uint8Array,5122:Int16Array,5123:Uint16Array,5125:Uint32Array,5126:Float32Array},l2={9728:Di,9729:ri,9984:w0,9985:Gf,9986:Nu,9987:As},u2={33071:$r,33648:jf,10497:Cl},Ky={SCALAR:1,VEC2:2,VEC3:3,VEC4:4,MAT2:4,MAT3:9,MAT4:16},I_={POSITION:"position",NORMAL:"normal",TANGENT:"tangent",...t4>=152?{TEXCOORD_0:"uv",TEXCOORD_1:"uv1",TEXCOORD_2:"uv2",TEXCOORD_3:"uv3"}:{TEXCOORD_0:"uv",TEXCOORD_1:"uv2"},COLOR_0:"color",WEIGHTS_0:"skinWeight",JOINTS_0:"skinIndex"},yl={scale:"scale",translation:"position",rotation:"quaternion",weights:"morphTargetInfluences"},N4={CUBICSPLINE:void 0,LINEAR:Yf,STEP:Kf},Yy={OPAQUE:"OPAQUE",MASK:"MASK",BLEND:"BLEND"};function U4(i){return i.DefaultMaterial===void 0&&(i.DefaultMaterial=new mp({color:16777215,emissive:0,metalness:1,roughness:1,transparent:!1,depthTest:!0,side:To})),i.DefaultMaterial}function Ru(i,e,t){for(const n in t.extensions)i[n]===void 0&&(e.userData.gltfExtensions=e.userData.gltfExtensions||{},e.userData.gltfExtensions[n]=t.extensions[n])}function ga(i,e){e.extras!==void 0&&(typeof e.extras=="object"?Object.assign(i.userData,e.extras):console.warn("THREE.GLTFLoader: Ignoring primitive type .extras, "+e.extras))}function O4(i,e,t){let n=!1,r=!1,s=!1;for(let h=0,m=e.length;h<m;h++){const g=e[h];if(g.POSITION!==void 0&&(n=!0),g.NORMAL!==void 0&&(r=!0),g.COLOR_0!==void 0&&(s=!0),n&&r&&s)break}if(!n&&!r&&!s)return Promise.resolve(i);const a=[],u=[],d=[];for(let h=0,m=e.length;h<m;h++){const g=e[h];if(n){const v=g.POSITION!==void 0?t.getDependency("accessor",g.POSITION):i.attributes.position;a.push(v)}if(r){const v=g.NORMAL!==void 0?t.getDependency("accessor",g.NORMAL):i.attributes.normal;u.push(v)}if(s){const v=g.COLOR_0!==void 0?t.getDependency("accessor",g.COLOR_0):i.attributes.color;d.push(v)}}return Promise.all([Promise.all(a),Promise.all(u),Promise.all(d)]).then(function(h){const m=h[0],g=h[1],v=h[2];return n&&(i.morphAttributes.position=m),r&&(i.morphAttributes.normal=g),s&&(i.morphAttributes.color=v),i.morphTargetsRelative=!0,i})}function k4(i,e){if(i.updateMorphTargets(),e.weights!==void 0)for(let t=0,n=e.weights.length;t<n;t++)i.morphTargetInfluences[t]=e.weights[t];if(e.extras&&Array.isArray(e.extras.targetNames)){const t=e.extras.targetNames;if(i.morphTargetInfluences.length===t.length){i.morphTargetDictionary={};for(let n=0,r=t.length;n<r;n++)i.morphTargetDictionary[t[n]]=n}else console.warn("THREE.GLTFLoader: Invalid extras.targetNames length. Ignoring names.")}}function H4(i){let e;const t=i.extensions&&i.extensions[cn.KHR_DRACO_MESH_COMPRESSION];if(t?e="draco:"+t.bufferView+":"+t.indices+":"+Qy(t.attributes):e=i.indices+":"+Qy(i.attributes)+":"+i.mode,i.targets!==void 0)for(let n=0,r=i.targets.length;n<r;n++)e+=":"+Qy(i.targets[n]);return e}function Qy(i){let e="";const t=Object.keys(i).sort();for(let n=0,r=t.length;n<r;n++)e+=t[n]+":"+i[t[n]]+";";return e}function P_(i){switch(i){case Int8Array:return 1/127;case Uint8Array:return 1/255;case Int16Array:return 1/32767;case Uint16Array:return 1/65535;default:throw new Error("THREE.GLTFLoader: Unsupported normalized accessor component type.")}}function z4(i){return i.search(/\.jpe?g($|\?)/i)>0||i.search(/^data\:image\/jpeg/)===0?"image/jpeg":i.search(/\.webp($|\?)/i)>0||i.search(/^data\:image\/webp/)===0?"image/webp":"image/png"}const G4=new Ot;class V4{constructor(e={},t={}){this.json=e,this.extensions={},this.plugins={},this.options=t,this.cache=new f4,this.associations=new Map,this.primitiveCache={},this.nodeCache={},this.meshCache={refs:{},uses:{}},this.cameraCache={refs:{},uses:{}},this.lightCache={refs:{},uses:{}},this.sourceCache={},this.textureCache={},this.nodeNamesUsed={};let n=!1,r=!1,s=-1;typeof navigator<"u"&&typeof navigator.userAgent<"u"&&(n=/^((?!chrome|android).)*safari/i.test(navigator.userAgent)===!0,r=navigator.userAgent.indexOf("Firefox")>-1,s=r?navigator.userAgent.match(/Firefox\/([0-9]+)\./)[1]:-1),typeof createImageBitmap>"u"||n||r&&s<98?this.textureLoader=new fE(this.options.manager):this.textureLoader=new _E(this.options.manager),this.textureLoader.setCrossOrigin(this.options.crossOrigin),this.textureLoader.setRequestHeader(this.options.requestHeader),this.fileLoader=new is(this.options.manager),this.fileLoader.setResponseType("arraybuffer"),this.options.crossOrigin==="use-credentials"&&this.fileLoader.setWithCredentials(!0)}setExtensions(e){this.extensions=e}setPlugins(e){this.plugins=e}parse(e,t){const n=this,r=this.json,s=this.extensions;this.cache.removeAll(),this.nodeCache={},this._invokeAll(function(a){return a._markDefs&&a._markDefs()}),Promise.all(this._invokeAll(function(a){return a.beforeRoot&&a.beforeRoot()})).then(function(){return Promise.all([n.getDependencies("scene"),n.getDependencies("animation"),n.getDependencies("camera")])}).then(function(a){const u={scene:a[0][r.scene||0],scenes:a[0],animations:a[1],cameras:a[2],asset:r.asset,parser:n,userData:{}};return Ru(s,u,r),ga(u,r),Promise.all(n._invokeAll(function(d){return d.afterRoot&&d.afterRoot(u)})).then(function(){for(const d of u.scenes)d.updateMatrixWorld();e(u)})}).catch(t)}_markDefs(){const e=this.json.nodes||[],t=this.json.skins||[],n=this.json.meshes||[];for(let r=0,s=t.length;r<s;r++){const a=t[r].joints;for(let u=0,d=a.length;u<d;u++)e[a[u]].isBone=!0}for(let r=0,s=e.length;r<s;r++){const a=e[r];a.mesh!==void 0&&(this._addNodeRef(this.meshCache,a.mesh),a.skin!==void 0&&(n[a.mesh].isSkinnedMesh=!0)),a.camera!==void 0&&this._addNodeRef(this.cameraCache,a.camera)}}_addNodeRef(e,t){t!==void 0&&(e.refs[t]===void 0&&(e.refs[t]=e.uses[t]=0),e.refs[t]++)}_getNodeRef(e,t,n){if(e.refs[t]<=1)return n;const r=n.clone(),s=(a,u)=>{const d=this.associations.get(a);d!=null&&this.associations.set(u,d);for(const[h,m]of a.children.entries())s(m,u.children[h])};return s(n,r),r.name+="_instance_"+e.uses[t]++,r}_invokeOne(e){const t=Object.values(this.plugins);t.push(this);for(let n=0;n<t.length;n++){const r=e(t[n]);if(r)return r}return null}_invokeAll(e){const t=Object.values(this.plugins);t.unshift(this);const n=[];for(let r=0;r<t.length;r++){const s=e(t[r]);s&&n.push(s)}return n}getDependency(e,t){const n=e+":"+t;let r=this.cache.get(n);if(!r){switch(e){case"scene":r=this.loadScene(t);break;case"node":r=this._invokeOne(function(s){return s.loadNode&&s.loadNode(t)});break;case"mesh":r=this._invokeOne(function(s){return s.loadMesh&&s.loadMesh(t)});break;case"accessor":r=this.loadAccessor(t);break;case"bufferView":r=this._invokeOne(function(s){return s.loadBufferView&&s.loadBufferView(t)});break;case"buffer":r=this.loadBuffer(t);break;case"material":r=this._invokeOne(function(s){return s.loadMaterial&&s.loadMaterial(t)});break;case"texture":r=this._invokeOne(function(s){return s.loadTexture&&s.loadTexture(t)});break;case"skin":r=this.loadSkin(t);break;case"animation":r=this._invokeOne(function(s){return s.loadAnimation&&s.loadAnimation(t)});break;case"camera":r=this.loadCamera(t);break;default:if(r=this._invokeOne(function(s){return s!=this&&s.getDependency&&s.getDependency(e,t)}),!r)throw new Error("Unknown type: "+e);break}this.cache.add(n,r)}return r}getDependencies(e){let t=this.cache.get(e);if(!t){const n=this,r=this.json[e+(e==="mesh"?"es":"s")]||[];t=Promise.all(r.map(function(s,a){return n.getDependency(e,a)})),this.cache.add(e,t)}return t}loadBuffer(e){const t=this.json.buffers[e],n=this.fileLoader;if(t.type&&t.type!=="arraybuffer")throw new Error("THREE.GLTFLoader: "+t.type+" buffer type is not supported.");if(t.uri===void 0&&e===0)return Promise.resolve(this.extensions[cn.KHR_BINARY_GLTF].body);const r=this.options;return new Promise(function(s,a){n.load(Sl.resolveURL(t.uri,r.path),s,void 0,function(){a(new Error('THREE.GLTFLoader: Failed to load buffer "'+t.uri+'".'))})})}loadBufferView(e){const t=this.json.bufferViews[e];return this.getDependency("buffer",t.buffer).then(function(n){const r=t.byteLength||0,s=t.byteOffset||0;return n.slice(s,s+r)})}loadAccessor(e){const t=this,n=this.json,r=this.json.accessors[e];if(r.bufferView===void 0&&r.sparse===void 0){const a=Ky[r.type],u=Xf[r.componentType],d=r.normalized===!0,h=new u(r.count*a);return Promise.resolve(new xn(h,a,d))}const s=[];return r.bufferView!==void 0?s.push(this.getDependency("bufferView",r.bufferView)):s.push(null),r.sparse!==void 0&&(s.push(this.getDependency("bufferView",r.sparse.indices.bufferView)),s.push(this.getDependency("bufferView",r.sparse.values.bufferView))),Promise.all(s).then(function(a){const u=a[0],d=Ky[r.type],h=Xf[r.componentType],m=h.BYTES_PER_ELEMENT,g=m*d,v=r.byteOffset||0,_=r.bufferView!==void 0?n.bufferViews[r.bufferView].byteStride:void 0,A=r.normalized===!0;let C,M;if(_&&_!==g){const S=Math.floor(v/_),b="InterleavedBuffer:"+r.bufferView+":"+r.componentType+":"+S+":"+r.count;let R=t.cache.get(b);R||(C=new h(u,S*_,r.count*_/m),R=new up(C,_/m),t.cache.add(b,R)),M=new Tl(R,d,v%_/m,A)}else u===null?C=new h(r.count*d):C=new h(u,v,r.count*d),M=new xn(C,d,A);if(r.sparse!==void 0){const S=Ky.SCALAR,b=Xf[r.sparse.indices.componentType],R=r.sparse.indices.byteOffset||0,P=r.sparse.values.byteOffset||0,U=new b(a[1],R,r.sparse.count*S),F=new h(a[2],P,r.sparse.count*d);u!==null&&(M=new xn(M.array.slice(),M.itemSize,M.normalized));for(let k=0,G=U.length;k<G;k++){const D=U[k];if(M.setX(D,F[k*d]),d>=2&&M.setY(D,F[k*d+1]),d>=3&&M.setZ(D,F[k*d+2]),d>=4&&M.setW(D,F[k*d+3]),d>=5)throw new Error("THREE.GLTFLoader: Unsupported itemSize in sparse BufferAttribute.")}}return M})}loadTexture(e){const t=this.json,n=this.options,s=t.textures[e].source,a=t.images[s];let u=this.textureLoader;if(a.uri){const d=n.manager.getHandler(a.uri);d!==null&&(u=d)}return this.loadTextureImage(e,s,u)}loadTextureImage(e,t,n){const r=this,s=this.json,a=s.textures[e],u=s.images[t],d=(u.uri||u.bufferView)+":"+a.sampler;if(this.textureCache[d])return this.textureCache[d];const h=this.loadImageSource(t,n).then(function(m){m.flipY=!1,m.name=a.name||u.name||"",m.name===""&&typeof u.uri=="string"&&u.uri.startsWith("data:image/")===!1&&(m.name=u.uri);const v=(s.samplers||{})[a.sampler]||{};return m.magFilter=l2[v.magFilter]||ri,m.minFilter=l2[v.minFilter]||As,m.wrapS=u2[v.wrapS]||Cl,m.wrapT=u2[v.wrapT]||Cl,r.associations.set(m,{textures:e}),m}).catch(function(){return null});return this.textureCache[d]=h,h}loadImageSource(e,t){const n=this,r=this.json,s=this.options;if(this.sourceCache[e]!==void 0)return this.sourceCache[e].then(g=>g.clone());const a=r.images[e],u=self.URL||self.webkitURL;let d=a.uri||"",h=!1;if(a.bufferView!==void 0)d=n.getDependency("bufferView",a.bufferView).then(function(g){h=!0;const v=new Blob([g],{type:a.mimeType});return d=u.createObjectURL(v),d});else if(a.uri===void 0)throw new Error("THREE.GLTFLoader: Image "+e+" is missing URI and bufferView");const m=Promise.resolve(d).then(function(g){return new Promise(function(v,_){let A=v;t.isImageBitmapLoader===!0&&(A=function(C){const M=new zn(C);M.needsUpdate=!0,v(M)}),t.load(Sl.resolveURL(g,s.path),A,void 0,_)})}).then(function(g){return h===!0&&u.revokeObjectURL(d),ga(g,a),g.userData.mimeType=a.mimeType||z4(a.uri),g}).catch(function(g){throw console.error("THREE.GLTFLoader: Couldn't load texture",d),g});return this.sourceCache[e]=m,m}assignTexture(e,t,n,r){const s=this;return this.getDependency("texture",n.index).then(function(a){if(!a)return null;if(n.texCoord!==void 0&&n.texCoord>0&&(a=a.clone(),a.channel=n.texCoord),s.extensions[cn.KHR_TEXTURE_TRANSFORM]){const u=n.extensions!==void 0?n.extensions[cn.KHR_TEXTURE_TRANSFORM]:void 0;if(u){const d=s.associations.get(a);a=s.extensions[cn.KHR_TEXTURE_TRANSFORM].extendTexture(a,u),s.associations.set(a,d)}}return r!==void 0&&(typeof r=="number"&&(r=r===o2?Gu:Ca),"colorSpace"in a?a.colorSpace=r:a.encoding=r===Gu?o2:c4),e[t]=a,a})}assignFinalMaterial(e){const t=e.geometry;let n=e.material;const r=t.attributes.tangent===void 0,s=t.attributes.color!==void 0,a=t.attributes.normal===void 0;if(e.isPoints){const u="PointsMaterial:"+n.uuid;let d=this.cache.get(u);d||(d=new O0,Ei.prototype.copy.call(d,n),d.color.copy(n.color),d.map=n.map,d.sizeAttenuation=!1,this.cache.add(u,d)),n=d}else if(e.isLine){const u="LineBasicMaterial:"+n.uuid;let d=this.cache.get(u);d||(d=new or,Ei.prototype.copy.call(d,n),d.color.copy(n.color),d.map=n.map,this.cache.add(u,d)),n=d}if(r||s||a){let u="ClonedMaterial:"+n.uuid+":";r&&(u+="derivative-tangents:"),s&&(u+="vertex-colors:"),a&&(u+="flat-shading:");let d=this.cache.get(u);d||(d=n.clone(),s&&(d.vertexColors=!0),a&&(d.flatShading=!0),r&&(d.normalScale&&(d.normalScale.y*=-1),d.clearcoatNormalScale&&(d.clearcoatNormalScale.y*=-1)),this.cache.add(u,d),this.associations.set(d,this.associations.get(n))),n=d}e.material=n}getMaterialType(){return mp}loadMaterial(e){const t=this,n=this.json,r=this.extensions,s=n.materials[e];let a;const u={},d=s.extensions||{},h=[];if(d[cn.KHR_MATERIALS_UNLIT]){const g=r[cn.KHR_MATERIALS_UNLIT];a=g.getMaterialType(),h.push(g.extendParams(u,s,t))}else{const g=s.pbrMetallicRoughness||{};if(u.color=new tt(1,1,1),u.opacity=1,Array.isArray(g.baseColorFactor)){const v=g.baseColorFactor;u.color.setRGB(v[0],v[1],v[2],Ca),u.opacity=v[3]}g.baseColorTexture!==void 0&&h.push(t.assignTexture(u,"map",g.baseColorTexture,Gu)),u.metalness=g.metallicFactor!==void 0?g.metallicFactor:1,u.roughness=g.roughnessFactor!==void 0?g.roughnessFactor:1,g.metallicRoughnessTexture!==void 0&&(h.push(t.assignTexture(u,"metalnessMap",g.metallicRoughnessTexture)),h.push(t.assignTexture(u,"roughnessMap",g.metallicRoughnessTexture))),a=this._invokeOne(function(v){return v.getMaterialType&&v.getMaterialType(e)}),h.push(Promise.all(this._invokeAll(function(v){return v.extendMaterialParams&&v.extendMaterialParams(e,u)})))}s.doubleSided===!0&&(u.side=_s);const m=s.alphaMode||Yy.OPAQUE;if(m===Yy.BLEND?(u.transparent=!0,u.depthWrite=!1):(u.transparent=!1,m===Yy.MASK&&(u.alphaTest=s.alphaCutoff!==void 0?s.alphaCutoff:.5)),s.normalTexture!==void 0&&a!==es&&(h.push(t.assignTexture(u,"normalMap",s.normalTexture)),u.normalScale=new Le(1,1),s.normalTexture.scale!==void 0)){const g=s.normalTexture.scale;u.normalScale.set(g,g)}if(s.occlusionTexture!==void 0&&a!==es&&(h.push(t.assignTexture(u,"aoMap",s.occlusionTexture)),s.occlusionTexture.strength!==void 0&&(u.aoMapIntensity=s.occlusionTexture.strength)),s.emissiveFactor!==void 0&&a!==es){const g=s.emissiveFactor;u.emissive=new tt().setRGB(g[0],g[1],g[2],Ca)}return s.emissiveTexture!==void 0&&a!==es&&h.push(t.assignTexture(u,"emissiveMap",s.emissiveTexture,Gu)),Promise.all(h).then(function(){const g=new a(u);return s.name&&(g.name=s.name),ga(g,s),t.associations.set(g,{materials:e}),s.extensions&&Ru(r,g,s),g})}createUniqueName(e){const t=mn.sanitizeNodeName(e||"");return t in this.nodeNamesUsed?t+"_"+ ++this.nodeNamesUsed[t]:(this.nodeNamesUsed[t]=0,t)}loadGeometries(e){const t=this,n=this.extensions,r=this.primitiveCache;function s(u){return n[cn.KHR_DRACO_MESH_COMPRESSION].decodePrimitive(u,t).then(function(d){return c2(d,u,t)})}const a=[];for(let u=0,d=e.length;u<d;u++){const h=e[u],m=H4(h),g=r[m];if(g)a.push(g.promise);else{let v;h.extensions&&h.extensions[cn.KHR_DRACO_MESH_COMPRESSION]?v=s(h):v=c2(new Kt,h,t),r[m]={primitive:h,promise:v},a.push(v)}}return Promise.all(a)}loadMesh(e){const t=this,n=this.json,r=this.extensions,s=n.meshes[e],a=s.primitives,u=[];for(let d=0,h=a.length;d<h;d++){const m=a[d].material===void 0?U4(this.cache):this.getDependency("material",a[d].material);u.push(m)}return u.push(t.loadGeometries(a)),Promise.all(u).then(function(d){const h=d.slice(0,d.length-1),m=d[d.length-1],g=[];for(let _=0,A=m.length;_<A;_++){const C=m[_],M=a[_];let S;const b=h[_];if(M.mode===ys.TRIANGLES||M.mode===ys.TRIANGLE_STRIP||M.mode===ys.TRIANGLE_FAN||M.mode===void 0)S=s.isSkinnedMesh===!0?new rx(C,b):new si(C,b),S.isSkinnedMesh===!0&&S.normalizeSkinWeights(),M.mode===ys.TRIANGLE_STRIP?S.geometry=i2(S.geometry,q_):M.mode===ys.TRIANGLE_FAN&&(S.geometry=i2(S.geometry,a0));else if(M.mode===ys.LINES)S=new io(C,b);else if(M.mode===ys.LINE_STRIP)S=new Ra(C,b);else if(M.mode===ys.LINE_LOOP)S=new ox(C,b);else if(M.mode===ys.POINTS)S=new ax(C,b);else throw new Error("THREE.GLTFLoader: Primitive mode unsupported: "+M.mode);Object.keys(S.geometry.morphAttributes).length>0&&k4(S,s),S.name=t.createUniqueName(s.name||"mesh_"+e),ga(S,s),M.extensions&&Ru(r,S,M),t.assignFinalMaterial(S),g.push(S)}for(let _=0,A=g.length;_<A;_++)t.associations.set(g[_],{meshes:e,primitives:_});if(g.length===1)return s.extensions&&Ru(r,g[0],s),g[0];const v=new xa;s.extensions&&Ru(r,v,s),t.associations.set(v,{meshes:e});for(let _=0,A=g.length;_<A;_++)v.add(g[_]);return v})}loadCamera(e){let t;const n=this.json.cameras[e],r=n[n.type];if(!r){console.warn("THREE.GLTFLoader: Missing camera parameters.");return}return n.type==="perspective"?t=new Hn(TM.radToDeg(r.yfov),r.aspectRatio||1,r.znear||1,r.zfar||2e6):n.type==="orthographic"&&(t=new eo(-r.xmag,r.xmag,r.ymag,-r.ymag,r.znear,r.zfar)),n.name&&(t.name=this.createUniqueName(n.name)),ga(t,n),Promise.resolve(t)}loadSkin(e){const t=this.json.skins[e],n=[];for(let r=0,s=t.joints.length;r<s;r++)n.push(this._loadNodeShallow(t.joints[r]));return t.inverseBindMatrices!==void 0?n.push(this.getDependency("accessor",t.inverseBindMatrices)):n.push(null),Promise.all(n).then(function(r){const s=r.pop(),a=r,u=[],d=[];for(let h=0,m=a.length;h<m;h++){const g=a[h];if(g){u.push(g);const v=new Ot;s!==null&&v.fromArray(s.array,h*16),d.push(v)}else console.warn('THREE.GLTFLoader: Joint "%s" could not be found.',t.joints[h])}return new cp(u,d)})}loadAnimation(e){const t=this.json,n=this,r=t.animations[e],s=r.name?r.name:"animation_"+e,a=[],u=[],d=[],h=[],m=[];for(let g=0,v=r.channels.length;g<v;g++){const _=r.channels[g],A=r.samplers[_.sampler],C=_.target,M=C.node,S=r.parameters!==void 0?r.parameters[A.input]:A.input,b=r.parameters!==void 0?r.parameters[A.output]:A.output;C.node!==void 0&&(a.push(this.getDependency("node",M)),u.push(this.getDependency("accessor",S)),d.push(this.getDependency("accessor",b)),h.push(A),m.push(C))}return Promise.all([Promise.all(a),Promise.all(u),Promise.all(d),Promise.all(h),Promise.all(m)]).then(function(g){const v=g[0],_=g[1],A=g[2],C=g[3],M=g[4],S=[];for(let b=0,R=v.length;b<R;b++){const P=v[b],U=_[b],F=A[b],k=C[b],G=M[b];if(P===void 0)continue;P.updateMatrix&&P.updateMatrix();const D=n._createAnimationTracks(P,U,F,k,G);if(D)for(let L=0;L<D.length;L++)S.push(D[L])}return new Zf(s,void 0,S)})}createNodeMesh(e){const t=this.json,n=this,r=t.nodes[e];return r.mesh===void 0?null:n.getDependency("mesh",r.mesh).then(function(s){const a=n._getNodeRef(n.meshCache,r.mesh,s);return r.weights!==void 0&&a.traverse(function(u){if(u.isMesh)for(let d=0,h=r.weights.length;d<h;d++)u.morphTargetInfluences[d]=r.weights[d]}),a})}loadNode(e){const t=this.json,n=this,r=t.nodes[e],s=n._loadNodeShallow(e),a=[],u=r.children||[];for(let h=0,m=u.length;h<m;h++)a.push(n.getDependency("node",u[h]));const d=r.skin===void 0?Promise.resolve(null):n.getDependency("skin",r.skin);return Promise.all([s,Promise.all(a),d]).then(function(h){const m=h[0],g=h[1],v=h[2];v!==null&&m.traverse(function(_){_.isSkinnedMesh&&_.bind(v,G4)});for(let _=0,A=g.length;_<A;_++)m.add(g[_]);return m})}_loadNodeShallow(e){const t=this.json,n=this.extensions,r=this;if(this.nodeCache[e]!==void 0)return this.nodeCache[e];const s=t.nodes[e],a=s.name?r.createUniqueName(s.name):"",u=[],d=r._invokeOne(function(h){return h.createNodeMesh&&h.createNodeMesh(e)});return d&&u.push(d),s.camera!==void 0&&u.push(r.getDependency("camera",s.camera).then(function(h){return r._getNodeRef(r.cameraCache,s.camera,h)})),r._invokeAll(function(h){return h.createNodeAttachment&&h.createNodeAttachment(e)}).forEach(function(h){u.push(h)}),this.nodeCache[e]=Promise.all(u).then(function(h){let m;if(s.isBone===!0?m=new U0:h.length>1?m=new xa:h.length===1?m=h[0]:m=new fn,m!==h[0])for(let g=0,v=h.length;g<v;g++)m.add(h[g]);if(s.name&&(m.userData.name=s.name,m.name=a),ga(m,s),s.extensions&&Ru(n,m,s),s.matrix!==void 0){const g=new Ot;g.fromArray(s.matrix),m.applyMatrix4(g)}else s.translation!==void 0&&m.position.fromArray(s.translation),s.rotation!==void 0&&m.quaternion.fromArray(s.rotation),s.scale!==void 0&&m.scale.fromArray(s.scale);return r.associations.has(m)||r.associations.set(m,{}),r.associations.get(m).nodes=e,m}),this.nodeCache[e]}loadScene(e){const t=this.extensions,n=this.json.scenes[e],r=this,s=new xa;n.name&&(s.name=r.createUniqueName(n.name)),ga(s,n),n.extensions&&Ru(t,s,n);const a=n.nodes||[],u=[];for(let d=0,h=a.length;d<h;d++)u.push(r.getDependency("node",a[d]));return Promise.all(u).then(function(d){for(let m=0,g=d.length;m<g;m++)s.add(d[m]);const h=m=>{const g=new Map;for(const[v,_]of r.associations)(v instanceof Ei||v instanceof zn)&&g.set(v,_);return m.traverse(v=>{const _=r.associations.get(v);_!=null&&g.set(v,_)}),g};return r.associations=h(s),s})}_createAnimationTracks(e,t,n,r,s){const a=[],u=e.name?e.name:e.uuid,d=[];yl[s.path]===yl.weights?e.traverse(function(v){v.morphTargetInfluences&&d.push(v.name?v.name:v.uuid)}):d.push(u);let h;switch(yl[s.path]){case yl.weights:h=ec;break;case yl.rotation:h=tc;break;case yl.position:case yl.scale:h=nc;break;default:switch(n.itemSize){case 1:h=ec;break;case 2:case 3:default:h=nc;break}break}const m=r.interpolation!==void 0?N4[r.interpolation]:Yf,g=this._getArrayFromAccessor(n);for(let v=0,_=d.length;v<_;v++){const A=new h(d[v]+"."+yl[s.path],t.array,g,m);r.interpolation==="CUBICSPLINE"&&this._createCubicSplineTrackInterpolant(A),a.push(A)}return a}_getArrayFromAccessor(e){let t=e.array;if(e.normalized){const n=P_(t.constructor),r=new Float32Array(t.length);for(let s=0,a=t.length;s<a;s++)r[s]=t[s]*n;t=r}return t}_createCubicSplineTrackInterpolant(e){e.createInterpolant=function(n){const r=this instanceof tc?F4:Cw;return new r(this.times,this.values,this.getValueSize()/3,n)},e.createInterpolant.isInterpolantFactoryMethodGLTFCubicSpline=!0}}function W4(i,e,t){const n=e.attributes,r=new sr;if(n.POSITION!==void 0){const u=t.json.accessors[n.POSITION],d=u.min,h=u.max;if(d!==void 0&&h!==void 0){if(r.set(new X(d[0],d[1],d[2]),new X(h[0],h[1],h[2])),u.normalized){const m=P_(Xf[u.componentType]);r.min.multiplyScalar(m),r.max.multiplyScalar(m)}}else{console.warn("THREE.GLTFLoader: Missing min/max properties for accessor POSITION.");return}}else return;const s=e.targets;if(s!==void 0){const u=new X,d=new X;for(let h=0,m=s.length;h<m;h++){const g=s[h];if(g.POSITION!==void 0){const v=t.json.accessors[g.POSITION],_=v.min,A=v.max;if(_!==void 0&&A!==void 0){if(d.setX(Math.max(Math.abs(_[0]),Math.abs(A[0]))),d.setY(Math.max(Math.abs(_[1]),Math.abs(A[1]))),d.setZ(Math.max(Math.abs(_[2]),Math.abs(A[2]))),v.normalized){const C=P_(Xf[v.componentType]);d.multiplyScalar(C)}u.max(d)}else console.warn("THREE.GLTFLoader: Missing min/max properties for accessor POSITION.")}}r.expandByVector(u)}i.boundingBox=r;const a=new ji;r.getCenter(a.center),a.radius=r.min.distanceTo(r.max)/2,i.boundingSphere=a}function c2(i,e,t){const n=e.attributes,r=[];function s(a,u){return t.getDependency("accessor",a).then(function(d){i.setAttribute(u,d)})}for(const a in n){const u=I_[a]||a.toLowerCase();u in i.attributes||r.push(s(n[a],u))}if(e.indices!==void 0&&!i.index){const a=t.getDependency("accessor",e.indices).then(function(u){i.setIndex(u)});r.push(a)}return ga(i,e),W4(i,e,t),Promise.all(r).then(function(){return e.targets!==void 0?O4(i,e.targets,t):i})}const qy=new WeakMap;class X4 extends ar{constructor(e){super(e),this.decoderPath="",this.decoderConfig={},this.decoderBinary=null,this.decoderPending=null,this.workerLimit=4,this.workerPool=[],this.workerNextTaskID=1,this.workerSourceURL="",this.defaultAttributeIDs={position:"POSITION",normal:"NORMAL",color:"COLOR",uv:"TEX_COORD"},this.defaultAttributeTypes={position:"Float32Array",normal:"Float32Array",color:"Float32Array",uv:"Float32Array"}}setDecoderPath(e){return this.decoderPath=e,this}setDecoderConfig(e){return this.decoderConfig=e,this}setWorkerLimit(e){return this.workerLimit=e,this}load(e,t,n,r){const s=new is(this.manager);s.setPath(this.path),s.setResponseType("arraybuffer"),s.setRequestHeader(this.requestHeader),s.setWithCredentials(this.withCredentials),s.load(e,a=>{const u={attributeIDs:this.defaultAttributeIDs,attributeTypes:this.defaultAttributeTypes,useUniqueIDs:!1};this.decodeGeometry(a,u).then(t).catch(r)},n,r)}decodeDracoFile(e,t,n,r){const s={attributeIDs:n||this.defaultAttributeIDs,attributeTypes:r||this.defaultAttributeTypes,useUniqueIDs:!!n};this.decodeGeometry(e,s).then(t)}decodeGeometry(e,t){for(const d in t.attributeTypes){const h=t.attributeTypes[d];h.BYTES_PER_ELEMENT!==void 0&&(t.attributeTypes[d]=h.name)}const n=JSON.stringify(t);if(qy.has(e)){const d=qy.get(e);if(d.key===n)return d.promise;if(e.byteLength===0)throw new Error("THREE.DRACOLoader: Unable to re-decode a buffer with different settings. Buffer has already been transferred.")}let r;const s=this.workerNextTaskID++,a=e.byteLength,u=this._getWorker(s,a).then(d=>(r=d,new Promise((h,m)=>{r._callbacks[s]={resolve:h,reject:m},r.postMessage({type:"decode",id:s,taskConfig:t,buffer:e},[e])}))).then(d=>this._createGeometry(d.geometry));return u.catch(()=>!0).then(()=>{r&&s&&this._releaseTask(r,s)}),qy.set(e,{key:n,promise:u}),u}_createGeometry(e){const t=new Kt;e.index&&t.setIndex(new xn(e.index.array,1));for(let n=0;n<e.attributes.length;n++){const r=e.attributes[n],s=r.name,a=r.array,u=r.itemSize;t.setAttribute(s,new xn(a,u))}return t}_loadLibrary(e,t){const n=new is(this.manager);return n.setPath(this.decoderPath),n.setResponseType(t),n.setWithCredentials(this.withCredentials),new Promise((r,s)=>{n.load(e,r,void 0,s)})}preload(){return this._initDecoder(),this}_initDecoder(){if(this.decoderPending)return this.decoderPending;const e=typeof WebAssembly!="object"||this.decoderConfig.type==="js",t=[];return e?t.push(this._loadLibrary("draco_decoder.js","text")):(t.push(this._loadLibrary("draco_wasm_wrapper.js","text")),t.push(this._loadLibrary("draco_decoder.wasm","arraybuffer"))),this.decoderPending=Promise.all(t).then(n=>{const r=n[0];e||(this.decoderConfig.wasmBinary=n[1]);const s=j4.toString(),a=["/* draco decoder */",r,"","/* worker */",s.substring(s.indexOf("{")+1,s.lastIndexOf("}"))].join(`
`);this.workerSourceURL=URL.createObjectURL(new Blob([a]))}),this.decoderPending}_getWorker(e,t){return this._initDecoder().then(()=>{if(this.workerPool.length<this.workerLimit){const r=new Worker(this.workerSourceURL);r._callbacks={},r._taskCosts={},r._taskLoad=0,r.postMessage({type:"init",decoderConfig:this.decoderConfig}),r.onmessage=function(s){const a=s.data;switch(a.type){case"decode":r._callbacks[a.id].resolve(a);break;case"error":r._callbacks[a.id].reject(a);break;default:console.error('THREE.DRACOLoader: Unexpected message, "'+a.type+'"')}},this.workerPool.push(r)}else this.workerPool.sort(function(r,s){return r._taskLoad>s._taskLoad?-1:1});const n=this.workerPool[this.workerPool.length-1];return n._taskCosts[e]=t,n._taskLoad+=t,n})}_releaseTask(e,t){e._taskLoad-=e._taskCosts[t],delete e._callbacks[t],delete e._taskCosts[t]}debug(){console.log("Task load: ",this.workerPool.map(e=>e._taskLoad))}dispose(){for(let e=0;e<this.workerPool.length;++e)this.workerPool[e].terminate();return this.workerPool.length=0,this}}function j4(){let i,e;onmessage=function(a){const u=a.data;switch(u.type){case"init":i=u.decoderConfig,e=new Promise(function(m){i.onModuleLoaded=function(g){m({draco:g})},DracoDecoderModule(i)});break;case"decode":const d=u.buffer,h=u.taskConfig;e.then(m=>{const g=m.draco,v=new g.Decoder,_=new g.DecoderBuffer;_.Init(new Int8Array(d),d.byteLength);try{const A=t(g,v,_,h),C=A.attributes.map(M=>M.array.buffer);A.index&&C.push(A.index.array.buffer),self.postMessage({type:"decode",id:u.id,geometry:A},C)}catch(A){console.error(A),self.postMessage({type:"error",id:u.id,error:A.message})}finally{g.destroy(_),g.destroy(v)}});break}};function t(a,u,d,h){const m=h.attributeIDs,g=h.attributeTypes;let v,_;const A=u.GetEncodedGeometryType(d);if(A===a.TRIANGULAR_MESH)v=new a.Mesh,_=u.DecodeBufferToMesh(d,v);else if(A===a.POINT_CLOUD)v=new a.PointCloud,_=u.DecodeBufferToPointCloud(d,v);else throw new Error("THREE.DRACOLoader: Unexpected geometry type.");if(!_.ok()||v.ptr===0)throw new Error("THREE.DRACOLoader: Decoding failed: "+_.error_msg());const C={index:null,attributes:[]};for(const M in m){const S=self[g[M]];let b,R;if(h.useUniqueIDs)R=m[M],b=u.GetAttributeByUniqueId(v,R);else{if(R=u.GetAttributeId(v,a[m[M]]),R===-1)continue;b=u.GetAttribute(v,R)}C.attributes.push(r(a,u,v,M,S,b))}return A===a.TRIANGULAR_MESH&&(C.index=n(a,u,v)),a.destroy(v),C}function n(a,u,d){const m=d.num_faces()*3,g=m*4,v=a._malloc(g);u.GetTrianglesUInt32Array(d,g,v);const _=new Uint32Array(a.HEAPF32.buffer,v,m).slice();return a._free(v),{array:_,itemSize:1}}function r(a,u,d,h,m,g){const v=g.num_components(),A=d.num_points()*v,C=A*m.BYTES_PER_ELEMENT,M=s(a,m),S=a._malloc(C);u.GetAttributeDataArrayForAllPoints(d,g,M,C,S);const b=new m(a.HEAPF32.buffer,S,A).slice();return a._free(S),{name:h,array:b,itemSize:v}}function s(a,u){switch(u){case Float32Array:return a.DT_FLOAT32;case Int8Array:return a.DT_INT8;case Int16Array:return a.DT_INT16;case Int32Array:return a.DT_INT32;case Uint8Array:return a.DT_UINT8;case Uint16Array:return a.DT_UINT16;case Uint32Array:return a.DT_UINT32}}}let hg;const Zy=()=>{if(hg)return hg;const i="B9h9z9tFBBBF8fL9gBB9gLaaaaaFa9gEaaaB9gFaFa9gEaaaFaEMcBFFFGGGEIIILF9wFFFLEFBFKNFaFCx/IFMO/LFVK9tv9t9vq95GBt9f9f939h9z9t9f9j9h9s9s9f9jW9vq9zBBp9tv9z9o9v9wW9f9kv9j9v9kv9WvqWv94h919m9mvqBF8Z9tv9z9o9v9wW9f9kv9j9v9kv9J9u9kv94h919m9mvqBGy9tv9z9o9v9wW9f9kv9j9v9kv9J9u9kv949TvZ91v9u9jvBEn9tv9z9o9v9wW9f9kv9j9v9kv69p9sWvq9P9jWBIi9tv9z9o9v9wW9f9kv9j9v9kv69p9sWvq9R919hWBLn9tv9z9o9v9wW9f9kv9j9v9kv69p9sWvq9F949wBKI9z9iqlBOc+x8ycGBM/qQFTa8jUUUUBCU/EBlHL8kUUUUBC9+RKGXAGCFJAI9LQBCaRKAE2BBC+gF9HQBALAEAIJHOAGlAGTkUUUBRNCUoBAG9uC/wgBZHKCUGAKCUG9JyRVAECFJRICBRcGXEXAcAF9PQFAVAFAclAcAVJAF9JyRMGXGXAG9FQBAMCbJHKC9wZRSAKCIrCEJCGrRQANCUGJRfCBRbAIRTEXGXAOATlAQ9PQBCBRISEMATAQJRIGXAS9FQBCBRtCBREEXGXAOAIlCi9PQBCBRISLMANCU/CBJAEJRKGXGXGXGXGXATAECKrJ2BBAtCKZrCEZfIBFGEBMAKhB83EBAKCNJhB83EBSEMAKAI2BIAI2BBHmCKrHYAYCE6HYy86BBAKCFJAICIJAYJHY2BBAmCIrCEZHPAPCE6HPy86BBAKCGJAYAPJHY2BBAmCGrCEZHPAPCE6HPy86BBAKCEJAYAPJHY2BBAmCEZHmAmCE6Hmy86BBAKCIJAYAmJHY2BBAI2BFHmCKrHPAPCE6HPy86BBAKCLJAYAPJHY2BBAmCIrCEZHPAPCE6HPy86BBAKCKJAYAPJHY2BBAmCGrCEZHPAPCE6HPy86BBAKCOJAYAPJHY2BBAmCEZHmAmCE6Hmy86BBAKCNJAYAmJHY2BBAI2BGHmCKrHPAPCE6HPy86BBAKCVJAYAPJHY2BBAmCIrCEZHPAPCE6HPy86BBAKCcJAYAPJHY2BBAmCGrCEZHPAPCE6HPy86BBAKCMJAYAPJHY2BBAmCEZHmAmCE6Hmy86BBAKCSJAYAmJHm2BBAI2BEHICKrHYAYCE6HYy86BBAKCQJAmAYJHm2BBAICIrCEZHYAYCE6HYy86BBAKCfJAmAYJHm2BBAICGrCEZHYAYCE6HYy86BBAKCbJAmAYJHK2BBAICEZHIAICE6HIy86BBAKAIJRISGMAKAI2BNAI2BBHmCIrHYAYCb6HYy86BBAKCFJAICNJAYJHY2BBAmCbZHmAmCb6Hmy86BBAKCGJAYAmJHm2BBAI2BFHYCIrHPAPCb6HPy86BBAKCEJAmAPJHm2BBAYCbZHYAYCb6HYy86BBAKCIJAmAYJHm2BBAI2BGHYCIrHPAPCb6HPy86BBAKCLJAmAPJHm2BBAYCbZHYAYCb6HYy86BBAKCKJAmAYJHm2BBAI2BEHYCIrHPAPCb6HPy86BBAKCOJAmAPJHm2BBAYCbZHYAYCb6HYy86BBAKCNJAmAYJHm2BBAI2BIHYCIrHPAPCb6HPy86BBAKCVJAmAPJHm2BBAYCbZHYAYCb6HYy86BBAKCcJAmAYJHm2BBAI2BLHYCIrHPAPCb6HPy86BBAKCMJAmAPJHm2BBAYCbZHYAYCb6HYy86BBAKCSJAmAYJHm2BBAI2BKHYCIrHPAPCb6HPy86BBAKCQJAmAPJHm2BBAYCbZHYAYCb6HYy86BBAKCfJAmAYJHm2BBAI2BOHICIrHYAYCb6HYy86BBAKCbJAmAYJHK2BBAICbZHIAICb6HIy86BBAKAIJRISFMAKAI8pBB83BBAKCNJAICNJ8pBB83BBAICTJRIMAtCGJRtAECTJHEAS9JQBMMGXAIQBCBRISEMGXAM9FQBANAbJ2BBRtCBRKAfREEXAEANCU/CBJAKJ2BBHTCFrCBATCFZl9zAtJHt86BBAEAGJREAKCFJHKAM9HQBMMAfCFJRfAIRTAbCFJHbAG9HQBMMABAcAG9sJANCUGJAMAG9sTkUUUBpANANCUGJAMCaJAG9sJAGTkUUUBpMAMCBAIyAcJRcAIQBMC9+RKSFMCBC99AOAIlAGCAAGCA9Ly6yRKMALCU/EBJ8kUUUUBAKM+OmFTa8jUUUUBCoFlHL8kUUUUBC9+RKGXAFCE9uHOCtJAI9LQBCaRKAE2BBHNC/wFZC/gF9HQBANCbZHVCF9LQBALCoBJCgFCUFT+JUUUBpALC84Jha83EBALC8wJha83EBALC8oJha83EBALCAJha83EBALCiJha83EBALCTJha83EBALha83ENALha83EBAEAIJC9wJRcAECFJHNAOJRMGXAF9FQBCQCbAVCF6yRSABRECBRVCBRQCBRfCBRICBRKEXGXAMAcuQBC9+RKSEMGXGXAN2BBHOC/vF9LQBALCoBJAOCIrCa9zAKJCbZCEWJHb8oGIRTAb8oGBRtGXAOCbZHbAS9PQBALAOCa9zAIJCbZCGWJ8oGBAVAbyROAb9FRbGXGXAGCG9HQBABAt87FBABCIJAO87FBABCGJAT87FBSFMAEAtjGBAECNJAOjGBAECIJATjGBMAVAbJRVALCoBJAKCEWJHmAOjGBAmATjGIALAICGWJAOjGBALCoBJAKCFJCbZHKCEWJHTAtjGBATAOjGIAIAbJRIAKCFJRKSGMGXGXAbCb6QBAQAbJAbC989zJCFJRQSFMAM1BBHbCgFZROGXGXAbCa9MQBAMCFJRMSFMAM1BFHbCgBZCOWAOCgBZqROGXAbCa9MQBAMCGJRMSFMAM1BGHbCgBZCfWAOqROGXAbCa9MQBAMCEJRMSFMAM1BEHbCgBZCdWAOqROGXAbCa9MQBAMCIJRMSFMAM2BIC8cWAOqROAMCLJRMMAOCFrCBAOCFZl9zAQJRQMGXGXAGCG9HQBABAt87FBABCIJAQ87FBABCGJAT87FBSFMAEAtjGBAECNJAQjGBAECIJATjGBMALCoBJAKCEWJHOAQjGBAOATjGIALAICGWJAQjGBALCoBJAKCFJCbZHKCEWJHOAtjGBAOAQjGIAICFJRIAKCFJRKSFMGXAOCDF9LQBALAIAcAOCbZJ2BBHbCIrHTlCbZCGWJ8oGBAVCFJHtATyROALAIAblCbZCGWJ8oGBAtAT9FHmJHtAbCbZHTyRbAT9FRTGXGXAGCG9HQBABAV87FBABCIJAb87FBABCGJAO87FBSFMAEAVjGBAECNJAbjGBAECIJAOjGBMALAICGWJAVjGBALCoBJAKCEWJHYAOjGBAYAVjGIALAICFJHICbZCGWJAOjGBALCoBJAKCFJCbZCEWJHYAbjGBAYAOjGIALAIAmJCbZHICGWJAbjGBALCoBJAKCGJCbZHKCEWJHOAVjGBAOAbjGIAKCFJRKAIATJRIAtATJRVSFMAVCBAM2BBHYyHTAOC/+F6HPJROAYCbZRtGXGXAYCIrHmQBAOCFJRbSFMAORbALAIAmlCbZCGWJ8oGBROMGXGXAtQBAbCFJRVSFMAbRVALAIAYlCbZCGWJ8oGBRbMGXGXAP9FQBAMCFJRYSFMAM1BFHYCgFZRTGXGXAYCa9MQBAMCGJRYSFMAM1BGHYCgBZCOWATCgBZqRTGXAYCa9MQBAMCEJRYSFMAM1BEHYCgBZCfWATqRTGXAYCa9MQBAMCIJRYSFMAM1BIHYCgBZCdWATqRTGXAYCa9MQBAMCLJRYSFMAMCKJRYAM2BLC8cWATqRTMATCFrCBATCFZl9zAQJHQRTMGXGXAmCb6QBAYRPSFMAY1BBHMCgFZROGXGXAMCa9MQBAYCFJRPSFMAY1BFHMCgBZCOWAOCgBZqROGXAMCa9MQBAYCGJRPSFMAY1BGHMCgBZCfWAOqROGXAMCa9MQBAYCEJRPSFMAY1BEHMCgBZCdWAOqROGXAMCa9MQBAYCIJRPSFMAYCLJRPAY2BIC8cWAOqROMAOCFrCBAOCFZl9zAQJHQROMGXGXAtCb6QBAPRMSFMAP1BBHMCgFZRbGXGXAMCa9MQBAPCFJRMSFMAP1BFHMCgBZCOWAbCgBZqRbGXAMCa9MQBAPCGJRMSFMAP1BGHMCgBZCfWAbqRbGXAMCa9MQBAPCEJRMSFMAP1BEHMCgBZCdWAbqRbGXAMCa9MQBAPCIJRMSFMAPCLJRMAP2BIC8cWAbqRbMAbCFrCBAbCFZl9zAQJHQRbMGXGXAGCG9HQBABAT87FBABCIJAb87FBABCGJAO87FBSFMAEATjGBAECNJAbjGBAECIJAOjGBMALCoBJAKCEWJHYAOjGBAYATjGIALAICGWJATjGBALCoBJAKCFJCbZCEWJHYAbjGBAYAOjGIALAICFJHICbZCGWJAOjGBALCoBJAKCGJCbZCEWJHOATjGBAOAbjGIALAIAm9FAmCb6qJHICbZCGWJAbjGBAIAt9FAtCb6qJRIAKCEJRKMANCFJRNABCKJRBAECSJREAKCbZRKAICbZRIAfCEJHfAF9JQBMMCBC99AMAc6yRKMALCoFJ8kUUUUBAKM/tIFGa8jUUUUBCTlRLC9+RKGXAFCLJAI9LQBCaRKAE2BBC/+FZC/QF9HQBALhB83ENAECFJRKAEAIJC98JREGXAF9FQBGXAGCG6QBEXGXAKAE9JQBC9+bMAK1BBHGCgFZRIGXGXAGCa9MQBAKCFJRKSFMAK1BFHGCgBZCOWAICgBZqRIGXAGCa9MQBAKCGJRKSFMAK1BGHGCgBZCfWAIqRIGXAGCa9MQBAKCEJRKSFMAK1BEHGCgBZCdWAIqRIGXAGCa9MQBAKCIJRKSFMAK2BIC8cWAIqRIAKCLJRKMALCNJAICFZCGWqHGAICGrCBAICFrCFZl9zAG8oGBJHIjGBABAIjGBABCIJRBAFCaJHFQBSGMMEXGXAKAE9JQBC9+bMAK1BBHGCgFZRIGXGXAGCa9MQBAKCFJRKSFMAK1BFHGCgBZCOWAICgBZqRIGXAGCa9MQBAKCGJRKSFMAK1BGHGCgBZCfWAIqRIGXAGCa9MQBAKCEJRKSFMAK1BEHGCgBZCdWAIqRIGXAGCa9MQBAKCIJRKSFMAK2BIC8cWAIqRIAKCLJRKMABAICGrCBAICFrCFZl9zALCNJAICFZCGWqHI8oGBJHG87FBAIAGjGBABCGJRBAFCaJHFQBMMCBC99AKAE6yRKMAKM+lLKFaF99GaG99FaG99GXGXAGCI9HQBAF9FQFEXGXGX9DBBB8/9DBBB+/ABCGJHG1BB+yAB1BBHE+yHI+L+TABCFJHL1BBHK+yHO+L+THN9DBBBB9gHVyAN9DBB/+hANAN+U9DBBBBANAVyHcAc+MHMAECa3yAI+SHIAI+UAcAMAKCa3yAO+SHcAc+U+S+S+R+VHO+U+SHN+L9DBBB9P9d9FQBAN+oRESFMCUUUU94REMAGAE86BBGXGX9DBBB8/9DBBB+/Ac9DBBBB9gyAcAO+U+SHN+L9DBBB9P9d9FQBAN+oRGSFMCUUUU94RGMALAG86BBGXGX9DBBB8/9DBBB+/AI9DBBBB9gyAIAO+U+SHN+L9DBBB9P9d9FQBAN+oRGSFMCUUUU94RGMABAG86BBABCIJRBAFCaJHFQBSGMMAF9FQBEXGXGX9DBBB8/9DBBB+/ABCIJHG8uFB+yAB8uFBHE+yHI+L+TABCGJHL8uFBHK+yHO+L+THN9DBBBB9gHVyAN9DB/+g6ANAN+U9DBBBBANAVyHcAc+MHMAECa3yAI+SHIAI+UAcAMAKCa3yAO+SHcAc+U+S+S+R+VHO+U+SHN+L9DBBB9P9d9FQBAN+oRESFMCUUUU94REMAGAE87FBGXGX9DBBB8/9DBBB+/Ac9DBBBB9gyAcAO+U+SHN+L9DBBB9P9d9FQBAN+oRGSFMCUUUU94RGMALAG87FBGXGX9DBBB8/9DBBB+/AI9DBBBB9gyAIAO+U+SHN+L9DBBB9P9d9FQBAN+oRGSFMCUUUU94RGMABAG87FBABCNJRBAFCaJHFQBMMM/SEIEaE99EaF99GXAF9FQBCBREABRIEXGXGX9D/zI818/AICKJ8uFBHLCEq+y+VHKAI8uFB+y+UHO9DB/+g6+U9DBBB8/9DBBB+/AO9DBBBB9gy+SHN+L9DBBB9P9d9FQBAN+oRVSFMCUUUU94RVMAICIJ8uFBRcAICGJ8uFBRMABALCFJCEZAEqCFWJAV87FBGXGXAKAM+y+UHN9DB/+g6+U9DBBB8/9DBBB+/AN9DBBBB9gy+SHS+L9DBBB9P9d9FQBAS+oRMSFMCUUUU94RMMABALCGJCEZAEqCFWJAM87FBGXGXAKAc+y+UHK9DB/+g6+U9DBBB8/9DBBB+/AK9DBBBB9gy+SHS+L9DBBB9P9d9FQBAS+oRcSFMCUUUU94RcMABALCaJCEZAEqCFWJAc87FBGXGX9DBBU8/AOAO+U+TANAN+U+TAKAK+U+THO9DBBBBAO9DBBBB9gy+R9DB/+g6+U9DBBB8/+SHO+L9DBBB9P9d9FQBAO+oRcSFMCUUUU94RcMABALCEZAEqCFWJAc87FBAICNJRIAECIJREAFCaJHFQBMMM9JBGXAGCGrAF9sHF9FQBEXABAB8oGBHGCNWCN91+yAGCi91CnWCUUU/8EJ+++U84GBABCIJRBAFCaJHFQBMMM9TFEaCBCB8oGUkUUBHFABCEJC98ZJHBjGUkUUBGXGXAB8/BCTWHGuQBCaREABAGlCggEJCTrXBCa6QFMAFREMAEM/lFFFaGXGXAFABqCEZ9FQBABRESFMGXGXAGCT9PQBABRESFMABREEXAEAF8oGBjGBAECIJAFCIJ8oGBjGBAECNJAFCNJ8oGBjGBAECSJAFCSJ8oGBjGBAECTJREAFCTJRFAGC9wJHGCb9LQBMMAGCI9JQBEXAEAF8oGBjGBAFCIJRFAECIJREAGC98JHGCE9LQBMMGXAG9FQBEXAEAF2BB86BBAECFJREAFCFJRFAGCaJHGQBMMABMoFFGaGXGXABCEZ9FQBABRESFMAFCgFZC+BwsN9sRIGXGXAGCT9PQBABRESFMABREEXAEAIjGBAECSJAIjGBAECNJAIjGBAECIJAIjGBAECTJREAGC9wJHGCb9LQBMMAGCI9JQBEXAEAIjGBAECIJREAGC98JHGCE9LQBMMGXAG9FQBEXAEAF86BBAECFJREAGCaJHGQBMMABMMMFBCUNMIT9kBB",e="B9h9z9tFBBBFiI9gBB9gLaaaaaFa9gEaaaB9gFaFaEMcBBFBFFGGGEILF9wFFFLEFBFKNFaFCx/aFMO/LFVK9tv9t9vq95GBt9f9f939h9z9t9f9j9h9s9s9f9jW9vq9zBBp9tv9z9o9v9wW9f9kv9j9v9kv9WvqWv94h919m9mvqBG8Z9tv9z9o9v9wW9f9kv9j9v9kv9J9u9kv94h919m9mvqBIy9tv9z9o9v9wW9f9kv9j9v9kv9J9u9kv949TvZ91v9u9jvBLn9tv9z9o9v9wW9f9kv9j9v9kv69p9sWvq9P9jWBKi9tv9z9o9v9wW9f9kv9j9v9kv69p9sWvq9R919hWBOn9tv9z9o9v9wW9f9kv9j9v9kv69p9sWvq9F949wBNI9z9iqlBVc+N9IcIBTEM9+FLa8jUUUUBCTlRBCBRFEXCBRGCBREEXABCNJAGJAECUaAFAGrCFZHIy86BBAEAIJREAGCFJHGCN9HQBMAFCx+YUUBJAE86BBAFCEWCxkUUBJAB8pEN83EBAFCFJHFCUG9HQBMMk8lLbaE97F9+FaL978jUUUUBCU/KBlHL8kUUUUBC9+RKGXAGCFJAI9LQBCaRKAE2BBC+gF9HQBALAEAIJHOAGlAG/8cBBCUoBAG9uC/wgBZHKCUGAKCUG9JyRNAECFJRKCBRVGXEXAVAF9PQFANAFAVlAVANJAF9JyRcGXGXAG9FQBAcCbJHIC9wZHMCE9sRSAMCFWRQAICIrCEJCGrRfCBRbEXAKRTCBRtGXEXGXAOATlAf9PQBCBRKSLMALCU/CBJAtAM9sJRmATAfJRKCBREGXAMCoB9JQBAOAKlC/gB9JQBCBRIEXAmAIJREGXGXGXGXGXATAICKrJ2BBHYCEZfIBFGEBMAECBDtDMIBSEMAEAKDBBIAKDBBBHPCID+MFAPDQBTFtGmEYIPLdKeOnHPCGD+MFAPDQBTFtGmEYIPLdKeOnC0+G+MiDtD9OHdCEDbD8jHPAPDQBFGENVcMILKOSQfbHeD8dBh+BsxoxoUwN0AeD8dFhxoUwkwk+gUa0sHnhTkAnsHnhNkAnsHn7CgFZHiCEWCxkUUBJDBEBAiCx+YUUBJDBBBHeAeDQBBBBBBBBBBBBBBBBAnhAk7CgFZHiCEWCxkUUBJDBEBD9uDQBFGEILKOTtmYPdenDfAdAPD9SDMIBAKCIJAeDeBJAiCx+YUUBJ2BBJRKSGMAEAKDBBNAKDBBBHPCID+MFAPDQBTFtGmEYIPLdKeOnC+P+e+8/4BDtD9OHdCbDbD8jHPAPDQBFGENVcMILKOSQfbHeD8dBh+BsxoxoUwN0AeD8dFhxoUwkwk+gUa0sHnhTkAnsHnhNkAnsHn7CgFZHiCEWCxkUUBJDBEBAiCx+YUUBJDBBBHeAeDQBBBBBBBBBBBBBBBBAnhAk7CgFZHiCEWCxkUUBJDBEBD9uDQBFGEILKOTtmYPdenDfAdAPD9SDMIBAKCNJAeDeBJAiCx+YUUBJ2BBJRKSFMAEAKDBBBDMIBAKCTJRKMGXGXGXGXGXAYCGrCEZfIBFGEBMAECBDtDMITSEMAEAKDBBIAKDBBBHPCID+MFAPDQBTFtGmEYIPLdKeOnHPCGD+MFAPDQBTFtGmEYIPLdKeOnC0+G+MiDtD9OHdCEDbD8jHPAPDQBFGENVcMILKOSQfbHeD8dBh+BsxoxoUwN0AeD8dFhxoUwkwk+gUa0sHnhTkAnsHnhNkAnsHn7CgFZHiCEWCxkUUBJDBEBAiCx+YUUBJDBBBHeAeDQBBBBBBBBBBBBBBBBAnhAk7CgFZHiCEWCxkUUBJDBEBD9uDQBFGEILKOTtmYPdenDfAdAPD9SDMITAKCIJAeDeBJAiCx+YUUBJ2BBJRKSGMAEAKDBBNAKDBBBHPCID+MFAPDQBTFtGmEYIPLdKeOnC+P+e+8/4BDtD9OHdCbDbD8jHPAPDQBFGENVcMILKOSQfbHeD8dBh+BsxoxoUwN0AeD8dFhxoUwkwk+gUa0sHnhTkAnsHnhNkAnsHn7CgFZHiCEWCxkUUBJDBEBAiCx+YUUBJDBBBHeAeDQBBBBBBBBBBBBBBBBAnhAk7CgFZHiCEWCxkUUBJDBEBD9uDQBFGEILKOTtmYPdenDfAdAPD9SDMITAKCNJAeDeBJAiCx+YUUBJ2BBJRKSFMAEAKDBBBDMITAKCTJRKMGXGXGXGXGXAYCIrCEZfIBFGEBMAECBDtDMIASEMAEAKDBBIAKDBBBHPCID+MFAPDQBTFtGmEYIPLdKeOnHPCGD+MFAPDQBTFtGmEYIPLdKeOnC0+G+MiDtD9OHdCEDbD8jHPAPDQBFGENVcMILKOSQfbHeD8dBh+BsxoxoUwN0AeD8dFhxoUwkwk+gUa0sHnhTkAnsHnhNkAnsHn7CgFZHiCEWCxkUUBJDBEBAiCx+YUUBJDBBBHeAeDQBBBBBBBBBBBBBBBBAnhAk7CgFZHiCEWCxkUUBJDBEBD9uDQBFGEILKOTtmYPdenDfAdAPD9SDMIAAKCIJAeDeBJAiCx+YUUBJ2BBJRKSGMAEAKDBBNAKDBBBHPCID+MFAPDQBTFtGmEYIPLdKeOnC+P+e+8/4BDtD9OHdCbDbD8jHPAPDQBFGENVcMILKOSQfbHeD8dBh+BsxoxoUwN0AeD8dFhxoUwkwk+gUa0sHnhTkAnsHnhNkAnsHn7CgFZHiCEWCxkUUBJDBEBAiCx+YUUBJDBBBHeAeDQBBBBBBBBBBBBBBBBAnhAk7CgFZHiCEWCxkUUBJDBEBD9uDQBFGEILKOTtmYPdenDfAdAPD9SDMIAAKCNJAeDeBJAiCx+YUUBJ2BBJRKSFMAEAKDBBBDMIAAKCTJRKMGXGXGXGXGXAYCKrfIBFGEBMAECBDtDMI8wSEMAEAKDBBIAKDBBBHPCID+MFAPDQBTFtGmEYIPLdKeOnHPCGD+MFAPDQBTFtGmEYIPLdKeOnC0+G+MiDtD9OHdCEDbD8jHPAPDQBFGENVcMILKOSQfbHeD8dBh+BsxoxoUwN0AeD8dFhxoUwkwk+gUa0sHnhTkAnsHnhNkAnsHn7CgFZHYCEWCxkUUBJDBEBAYCx+YUUBJDBBBHeAeDQBBBBBBBBBBBBBBBBAnhAk7CgFZHYCEWCxkUUBJDBEBD9uDQBFGEILKOTtmYPdenDfAdAPD9SDMI8wAKCIJAeDeBJAYCx+YUUBJ2BBJRKSGMAEAKDBBNAKDBBBHPCID+MFAPDQBTFtGmEYIPLdKeOnC+P+e+8/4BDtD9OHdCbDbD8jHPAPDQBFGENVcMILKOSQfbHeD8dBh+BsxoxoUwN0AeD8dFhxoUwkwk+gUa0sHnhTkAnsHnhNkAnsHn7CgFZHYCEWCxkUUBJDBEBAYCx+YUUBJDBBBHeAeDQBBBBBBBBBBBBBBBBAnhAk7CgFZHYCEWCxkUUBJDBEBD9uDQBFGEILKOTtmYPdenDfAdAPD9SDMI8wAKCNJAeDeBJAYCx+YUUBJ2BBJRKSFMAEAKDBBBDMI8wAKCTJRKMAICoBJREAICUFJAM9LQFAERIAOAKlC/fB9LQBMMGXAEAM9PQBAECErRIEXGXAOAKlCi9PQBCBRKSOMAmAEJRYGXGXGXGXGXATAECKrJ2BBAICKZrCEZfIBFGEBMAYCBDtDMIBSEMAYAKDBBIAKDBBBHPCID+MFAPDQBTFtGmEYIPLdKeOnHPCGD+MFAPDQBTFtGmEYIPLdKeOnC0+G+MiDtD9OHdCEDbD8jHPAPDQBFGENVcMILKOSQfbHeD8dBh+BsxoxoUwN0AeD8dFhxoUwkwk+gUa0sHnhTkAnsHnhNkAnsHn7CgFZHiCEWCxkUUBJDBEBAiCx+YUUBJDBBBHeAeDQBBBBBBBBBBBBBBBBAnhAk7CgFZHiCEWCxkUUBJDBEBD9uDQBFGEILKOTtmYPdenDfAdAPD9SDMIBAKCIJAeDeBJAiCx+YUUBJ2BBJRKSGMAYAKDBBNAKDBBBHPCID+MFAPDQBTFtGmEYIPLdKeOnC+P+e+8/4BDtD9OHdCbDbD8jHPAPDQBFGENVcMILKOSQfbHeD8dBh+BsxoxoUwN0AeD8dFhxoUwkwk+gUa0sHnhTkAnsHnhNkAnsHn7CgFZHiCEWCxkUUBJDBEBAiCx+YUUBJDBBBHeAeDQBBBBBBBBBBBBBBBBAnhAk7CgFZHiCEWCxkUUBJDBEBD9uDQBFGEILKOTtmYPdenDfAdAPD9SDMIBAKCNJAeDeBJAiCx+YUUBJ2BBJRKSFMAYAKDBBBDMIBAKCTJRKMAICGJRIAECTJHEAM9JQBMMGXAK9FQBAKRTAtCFJHtCI6QGSFMMCBRKSEMGXAM9FQBALCUGJAbJREALAbJDBGBReCBRYEXAEALCU/CBJAYJHIDBIBHdCFD9tAdCFDbHPD9OD9hD9RHdAIAMJDBIBH8ZCFD9tA8ZAPD9OD9hD9RH8ZDQBTFtGmEYIPLdKeOnHpAIAQJDBIBHyCFD9tAyAPD9OD9hD9RHyAIASJDBIBH8cCFD9tA8cAPD9OD9hD9RH8cDQBTFtGmEYIPLdKeOnH8dDQBFTtGEmYILPdKOenHPAPDQBFGEBFGEBFGEBFGEAeD9uHeDyBjGBAEAGJHIAeAPAPDQILKOILKOILKOILKOD9uHeDyBjGBAIAGJHIAeAPAPDQNVcMNVcMNVcMNVcMD9uHeDyBjGBAIAGJHIAeAPAPDQSQfbSQfbSQfbSQfbD9uHeDyBjGBAIAGJHIAeApA8dDQNVi8ZcMpySQ8c8dfb8e8fHPAPDQBFGEBFGEBFGEBFGED9uHeDyBjGBAIAGJHIAeAPAPDQILKOILKOILKOILKOD9uHeDyBjGBAIAGJHIAeAPAPDQNVcMNVcMNVcMNVcMD9uHeDyBjGBAIAGJHIAeAPAPDQSQfbSQfbSQfbSQfbD9uHeDyBjGBAIAGJHIAeAdA8ZDQNiV8ZcpMyS8cQ8df8eb8fHdAyA8cDQNiV8ZcpMyS8cQ8df8eb8fH8ZDQBFTtGEmYILPdKOenHPAPDQBFGEBFGEBFGEBFGED9uHeDyBjGBAIAGJHIAeAPAPDQILKOILKOILKOILKOD9uHeDyBjGBAIAGJHIAeAPAPDQNVcMNVcMNVcMNVcMD9uHeDyBjGBAIAGJHIAeAPAPDQSQfbSQfbSQfbSQfbD9uHeDyBjGBAIAGJHIAeAdA8ZDQNVi8ZcMpySQ8c8dfb8e8fHPAPDQBFGEBFGEBFGEBFGED9uHeDyBjGBAIAGJHIAeAPAPDQILKOILKOILKOILKOD9uHeDyBjGBAIAGJHIAeAPAPDQNVcMNVcMNVcMNVcMD9uHeDyBjGBAIAGJHIAeAPAPDQSQfbSQfbSQfbSQfbD9uHeDyBjGBAIAGJREAYCTJHYAM9JQBMMAbCIJHbAG9JQBMMABAVAG9sJALCUGJAcAG9s/8cBBALALCUGJAcCaJAG9sJAG/8cBBMAcCBAKyAVJRVAKQBMC9+RKSFMCBC99AOAKlAGCAAGCA9Ly6yRKMALCU/KBJ8kUUUUBAKMNBT+BUUUBM+KmFTa8jUUUUBCoFlHL8kUUUUBC9+RKGXAFCE9uHOCtJAI9LQBCaRKAE2BBHNC/wFZC/gF9HQBANCbZHVCF9LQBALCoBJCgFCUF/8MBALC84Jha83EBALC8wJha83EBALC8oJha83EBALCAJha83EBALCiJha83EBALCTJha83EBALha83ENALha83EBAEAIJC9wJRcAECFJHNAOJRMGXAF9FQBCQCbAVCF6yRSABRECBRVCBRQCBRfCBRICBRKEXGXAMAcuQBC9+RKSEMGXGXAN2BBHOC/vF9LQBALCoBJAOCIrCa9zAKJCbZCEWJHb8oGIRTAb8oGBRtGXAOCbZHbAS9PQBALAOCa9zAIJCbZCGWJ8oGBAVAbyROAb9FRbGXGXAGCG9HQBABAt87FBABCIJAO87FBABCGJAT87FBSFMAEAtjGBAECNJAOjGBAECIJATjGBMAVAbJRVALCoBJAKCEWJHmAOjGBAmATjGIALAICGWJAOjGBALCoBJAKCFJCbZHKCEWJHTAtjGBATAOjGIAIAbJRIAKCFJRKSGMGXGXAbCb6QBAQAbJAbC989zJCFJRQSFMAM1BBHbCgFZROGXGXAbCa9MQBAMCFJRMSFMAM1BFHbCgBZCOWAOCgBZqROGXAbCa9MQBAMCGJRMSFMAM1BGHbCgBZCfWAOqROGXAbCa9MQBAMCEJRMSFMAM1BEHbCgBZCdWAOqROGXAbCa9MQBAMCIJRMSFMAM2BIC8cWAOqROAMCLJRMMAOCFrCBAOCFZl9zAQJRQMGXGXAGCG9HQBABAt87FBABCIJAQ87FBABCGJAT87FBSFMAEAtjGBAECNJAQjGBAECIJATjGBMALCoBJAKCEWJHOAQjGBAOATjGIALAICGWJAQjGBALCoBJAKCFJCbZHKCEWJHOAtjGBAOAQjGIAICFJRIAKCFJRKSFMGXAOCDF9LQBALAIAcAOCbZJ2BBHbCIrHTlCbZCGWJ8oGBAVCFJHtATyROALAIAblCbZCGWJ8oGBAtAT9FHmJHtAbCbZHTyRbAT9FRTGXGXAGCG9HQBABAV87FBABCIJAb87FBABCGJAO87FBSFMAEAVjGBAECNJAbjGBAECIJAOjGBMALAICGWJAVjGBALCoBJAKCEWJHYAOjGBAYAVjGIALAICFJHICbZCGWJAOjGBALCoBJAKCFJCbZCEWJHYAbjGBAYAOjGIALAIAmJCbZHICGWJAbjGBALCoBJAKCGJCbZHKCEWJHOAVjGBAOAbjGIAKCFJRKAIATJRIAtATJRVSFMAVCBAM2BBHYyHTAOC/+F6HPJROAYCbZRtGXGXAYCIrHmQBAOCFJRbSFMAORbALAIAmlCbZCGWJ8oGBROMGXGXAtQBAbCFJRVSFMAbRVALAIAYlCbZCGWJ8oGBRbMGXGXAP9FQBAMCFJRYSFMAM1BFHYCgFZRTGXGXAYCa9MQBAMCGJRYSFMAM1BGHYCgBZCOWATCgBZqRTGXAYCa9MQBAMCEJRYSFMAM1BEHYCgBZCfWATqRTGXAYCa9MQBAMCIJRYSFMAM1BIHYCgBZCdWATqRTGXAYCa9MQBAMCLJRYSFMAMCKJRYAM2BLC8cWATqRTMATCFrCBATCFZl9zAQJHQRTMGXGXAmCb6QBAYRPSFMAY1BBHMCgFZROGXGXAMCa9MQBAYCFJRPSFMAY1BFHMCgBZCOWAOCgBZqROGXAMCa9MQBAYCGJRPSFMAY1BGHMCgBZCfWAOqROGXAMCa9MQBAYCEJRPSFMAY1BEHMCgBZCdWAOqROGXAMCa9MQBAYCIJRPSFMAYCLJRPAY2BIC8cWAOqROMAOCFrCBAOCFZl9zAQJHQROMGXGXAtCb6QBAPRMSFMAP1BBHMCgFZRbGXGXAMCa9MQBAPCFJRMSFMAP1BFHMCgBZCOWAbCgBZqRbGXAMCa9MQBAPCGJRMSFMAP1BGHMCgBZCfWAbqRbGXAMCa9MQBAPCEJRMSFMAP1BEHMCgBZCdWAbqRbGXAMCa9MQBAPCIJRMSFMAPCLJRMAP2BIC8cWAbqRbMAbCFrCBAbCFZl9zAQJHQRbMGXGXAGCG9HQBABAT87FBABCIJAb87FBABCGJAO87FBSFMAEATjGBAECNJAbjGBAECIJAOjGBMALCoBJAKCEWJHYAOjGBAYATjGIALAICGWJATjGBALCoBJAKCFJCbZCEWJHYAbjGBAYAOjGIALAICFJHICbZCGWJAOjGBALCoBJAKCGJCbZCEWJHOATjGBAOAbjGIALAIAm9FAmCb6qJHICbZCGWJAbjGBAIAt9FAtCb6qJRIAKCEJRKMANCFJRNABCKJRBAECSJREAKCbZRKAICbZRIAfCEJHfAF9JQBMMCBC99AMAc6yRKMALCoFJ8kUUUUBAKM/tIFGa8jUUUUBCTlRLC9+RKGXAFCLJAI9LQBCaRKAE2BBC/+FZC/QF9HQBALhB83ENAECFJRKAEAIJC98JREGXAF9FQBGXAGCG6QBEXGXAKAE9JQBC9+bMAK1BBHGCgFZRIGXGXAGCa9MQBAKCFJRKSFMAK1BFHGCgBZCOWAICgBZqRIGXAGCa9MQBAKCGJRKSFMAK1BGHGCgBZCfWAIqRIGXAGCa9MQBAKCEJRKSFMAK1BEHGCgBZCdWAIqRIGXAGCa9MQBAKCIJRKSFMAK2BIC8cWAIqRIAKCLJRKMALCNJAICFZCGWqHGAICGrCBAICFrCFZl9zAG8oGBJHIjGBABAIjGBABCIJRBAFCaJHFQBSGMMEXGXAKAE9JQBC9+bMAK1BBHGCgFZRIGXGXAGCa9MQBAKCFJRKSFMAK1BFHGCgBZCOWAICgBZqRIGXAGCa9MQBAKCGJRKSFMAK1BGHGCgBZCfWAIqRIGXAGCa9MQBAKCEJRKSFMAK1BEHGCgBZCdWAIqRIGXAGCa9MQBAKCIJRKSFMAK2BIC8cWAIqRIAKCLJRKMABAICGrCBAICFrCFZl9zALCNJAICFZCGWqHI8oGBJHG87FBAIAGjGBABCGJRBAFCaJHFQBMMCBC99AKAE6yRKMAKM/dLEK97FaF97GXGXAGCI9HQBAF9FQFCBRGEXABABDBBBHECiD+rFCiD+sFD/6FHIAECND+rFCiD+sFD/6FAID/gFAECTD+rFCiD+sFD/6FHLD/gFD/kFD/lFHKCBDtD+2FHOAICUUUU94DtHND9OD9RD/kFHI9DBB/+hDYAIAID/mFAKAKD/mFALAOALAND9OD9RD/kFHIAID/mFD/kFD/kFD/jFD/nFHLD/mF9DBBX9LDYHOD/kFCgFDtD9OAECUUU94DtD9OD9QAIALD/mFAOD/kFCND+rFCU/+EDtD9OD9QAKALD/mFAOD/kFCTD+rFCUU/8ODtD9OD9QDMBBABCTJRBAGCIJHGAF9JQBSGMMAF9FQBCBRGEXABCTJHVAVDBBBHECBDtHOCUU98D8cFCUU98D8cEHND9OABDBBBHKAEDQILKOSQfbPden8c8d8e8fCggFDtD9OD/6FAKAEDQBFGENVcMTtmYi8ZpyHECTD+sFD/6FHID/gFAECTD+rFCTD+sFD/6FHLD/gFD/kFD/lFHE9DB/+g6DYALAEAOD+2FHOALCUUUU94DtHcD9OD9RD/kFHLALD/mFAEAED/mFAIAOAIAcD9OD9RD/kFHEAED/mFD/kFD/kFD/jFD/nFHID/mF9DBBX9LDYHOD/kFCTD+rFALAID/mFAOD/kFCggEDtD9OD9QHLAEAID/mFAOD/kFCaDbCBDnGCBDnECBDnKCBDnOCBDncCBDnMCBDnfCBDnbD9OHEDQNVi8ZcMpySQ8c8dfb8e8fD9QDMBBABAKAND9OALAEDQBFTtGEmYILPdKOenD9QDMBBABCAJRBAGCIJHGAF9JQBMMM/hEIGaF97FaL978jUUUUBCTlREGXAF9FQBCBRIEXAEABDBBBHLABCTJHKDBBBHODQILKOSQfbPden8c8d8e8fHNCTD+sFHVCID+rFDMIBAB9DBBU8/DY9D/zI818/DYAVCEDtD9QD/6FD/nFHVALAODQBFGENVcMTtmYi8ZpyHLCTD+rFCTD+sFD/6FD/mFHOAOD/mFAVALCTD+sFD/6FD/mFHcAcD/mFAVANCTD+rFCTD+sFD/6FD/mFHNAND/mFD/kFD/kFD/lFCBDtD+4FD/jF9DB/+g6DYHVD/mF9DBBX9LDYHLD/kFCggEDtHMD9OAcAVD/mFALD/kFCTD+rFD9QHcANAVD/mFALD/kFCTD+rFAOAVD/mFALD/kFAMD9OD9QHVDQBFTtGEmYILPdKOenHLD8dBAEDBIBDyB+t+J83EBABCNJALD8dFAEDBIBDyF+t+J83EBAKAcAVDQNVi8ZcMpySQ8c8dfb8e8fHVD8dBAEDBIBDyG+t+J83EBABCiJAVD8dFAEDBIBDyE+t+J83EBABCAJRBAICIJHIAF9JQBMMM9jFF97GXAGCGrAF9sHG9FQBCBRFEXABABDBBBHECND+rFCND+sFD/6FAECiD+sFCnD+rFCUUU/8EDtD+uFD/mFDMBBABCTJRBAFCIJHFAG9JQBMMM9TFEaCBCB8oGUkUUBHFABCEJC98ZJHBjGUkUUBGXGXAB8/BCTWHGuQBCaREABAGlCggEJCTrXBCa6QFMAFREMAEMMMFBCUNMIT9tBB",t=new Uint8Array([0,97,115,109,1,0,0,0,1,4,1,96,0,0,3,3,2,0,0,5,3,1,0,1,12,1,0,10,22,2,12,0,65,0,65,0,65,0,252,10,0,0,11,7,0,65,0,253,15,26,11]),n=new Uint8Array([32,0,65,253,3,1,2,34,4,106,6,5,11,8,7,20,13,33,12,16,128,9,116,64,19,113,127,15,10,21,22,14,255,66,24,54,136,107,18,23,192,26,114,118,132,17,77,101,130,144,27,87,131,44,45,74,156,154,70,167]);if(typeof WebAssembly!="object")return{supported:!1};let r=i;WebAssembly.validate(t)&&(r=e);let s;const a=WebAssembly.instantiate(u(r),{}).then(g=>{s=g.instance,s.exports.__wasm_call_ctors()});function u(g){const v=new Uint8Array(g.length);for(let A=0;A<g.length;++A){const C=g.charCodeAt(A);v[A]=C>96?C-71:C>64?C-65:C>47?C+4:C>46?63:62}let _=0;for(let A=0;A<g.length;++A)v[_++]=v[A]<60?n[v[A]]:(v[A]-60)*64+v[++A];return v.buffer.slice(0,_)}function d(g,v,_,A,C,M){const S=s.exports.sbrk,b=_+3&-4,R=S(b*A),P=S(C.length),U=new Uint8Array(s.exports.memory.buffer);U.set(C,P);const F=g(R,_,A,P,C.length);if(F===0&&M&&M(R,b,A),v.set(U.subarray(R,R+_*A)),S(R-S(0)),F!==0)throw new Error(`Malformed buffer data: ${F}`)}const h={0:"",1:"meshopt_decodeFilterOct",2:"meshopt_decodeFilterQuat",3:"meshopt_decodeFilterExp",NONE:"",OCTAHEDRAL:"meshopt_decodeFilterOct",QUATERNION:"meshopt_decodeFilterQuat",EXPONENTIAL:"meshopt_decodeFilterExp"},m={0:"meshopt_decodeVertexBuffer",1:"meshopt_decodeIndexBuffer",2:"meshopt_decodeIndexSequence",ATTRIBUTES:"meshopt_decodeVertexBuffer",TRIANGLES:"meshopt_decodeIndexBuffer",INDICES:"meshopt_decodeIndexSequence"};return hg={ready:a,supported:!0,decodeVertexBuffer(g,v,_,A,C){d(s.exports.meshopt_decodeVertexBuffer,g,v,_,A,s.exports[h[C]])},decodeIndexBuffer(g,v,_,A){d(s.exports.meshopt_decodeIndexBuffer,g,v,_,A)},decodeIndexSequence(g,v,_,A){d(s.exports.meshopt_decodeIndexSequence,g,v,_,A)},decodeGltfBuffer(g,v,_,A,C,M){d(s.exports[m[C]],g,v,_,A,s.exports[h[M]])}},hg};let pg=null,Tw="https://www.gstatic.com/draco/versioned/decoders/1.5.5/";function bw(i=!0,e=!0,t){return n=>{t&&t(n),i&&(pg||(pg=new X4),pg.setDecoderPath(typeof i=="string"?i:Tw),n.setDRACOLoader(pg)),e&&n.setMeshoptDecoder(typeof Zy=="function"?Zy():Zy)}}const Pa=(i,e,t,n)=>yp(Yx,i,bw(e,t,n));Pa.preload=(i,e,t,n)=>yp.preload(Yx,i,bw(e,t,n));Pa.clear=i=>yp.clear(Yx,i);Pa.setDecoderPath=i=>{Tw=i};const J4=Y.forwardRef(({makeDefault:i,camera:e,regress:t,domElement:n,enableDamping:r=!0,keyEvents:s=!1,onChange:a,onStart:u,onEnd:d,...h},m)=>{const g=So(F=>F.invalidate),v=So(F=>F.camera),_=So(F=>F.gl),A=So(F=>F.events),C=So(F=>F.setEvents),M=So(F=>F.set),S=So(F=>F.get),b=So(F=>F.performance),R=e||v,P=n||A.connected||_.domElement,U=Y.useMemo(()=>new u4(R),[R]);return vp(()=>{U.enabled&&U.update()},-1),Y.useEffect(()=>(s&&U.connect(s===!0?P:s),U.connect(P),()=>void U.dispose()),[s,P,t,U,g]),Y.useEffect(()=>{const F=D=>{g(),t&&b.regress(),a&&a(D)},k=D=>{u&&u(D)},G=D=>{d&&d(D)};return U.addEventListener("change",F),U.addEventListener("start",k),U.addEventListener("end",G),()=>{U.removeEventListener("start",k),U.removeEventListener("end",G),U.removeEventListener("change",F)}},[a,u,d,U,g,C]),Y.useEffect(()=>{if(i){const F=S().controls;return M({controls:U}),()=>M({controls:F})}},[i,U]),Y.createElement("primitive",d0({ref:m,object:U,enableDamping:r},h))});function Rw(i,e){const t=Y.useRef(),[n]=Y.useState(()=>e?e instanceof fn?{current:e}:e:t),[r]=Y.useState(()=>new EE(void 0));Y.useLayoutEffect(()=>{e&&(n.current=e instanceof fn?e:e.current),r._root=n.current});const s=Y.useRef({}),a=Y.useMemo(()=>{const u={};return i.forEach(d=>Object.defineProperty(u,d.name,{enumerable:!0,get(){if(n.current)return s.current[d.name]||(s.current[d.name]=r.clipAction(d,n.current))},configurable:!0})),{ref:n,clips:i,actions:u,names:i.map(d=>d.name),mixer:r}},[i]);return vp((u,d)=>r.update(d)),Y.useEffect(()=>{const u=n.current;return()=>{s.current={},r.stopAllAction(),Object.values(a.actions).forEach(d=>{u&&r.uncacheAction(d,u)})}},[i]),a}var $y={exports:{}},e_,f2;function K4(){if(f2)return e_;f2=1;var i="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED";return e_=i,e_}var t_,d2;function Y4(){if(d2)return t_;d2=1;var i=K4();function e(){}function t(){}return t.resetWarningCache=e,t_=function(){function n(a,u,d,h,m,g){if(g!==i){var v=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types");throw v.name="Invariant Violation",v}}n.isRequired=n;function r(){return n}var s={array:n,bigint:n,bool:n,func:n,number:n,object:n,string:n,symbol:n,any:n,arrayOf:r,element:n,elementType:n,instanceOf:r,node:n,objectOf:r,oneOf:r,oneOfType:r,shape:r,exact:r,checkPropTypes:t,resetWarningCache:e};return s.PropTypes=s,s},t_}var h2;function Iw(){return h2||(h2=1,$y.exports=Y4()()),$y.exports}const Pw=()=>fe.jsx(rN,{children:fe.jsx("div",{className:"flex justify-center items-center",children:fe.jsx("div",{className:"w-20 h-20 border-2 border-opacity-20 border-blue-500 border-t-blue-500 rounded-full animate-spin"})})}),Q4="/assets/island-BN767CUw.glb",q4=({setCurrentStage:i,currentStage:e,isDayMode:t,...n})=>{const r=Y.useRef(),{gl:s,viewport:a,scene:u}=So(),{nodes:d,materials:h}=Pa(Q4);Y.useEffect(()=>{console.log("Island Loaded:",d,h)},[d,h]);const m=Y.useRef(0),g=Y.useRef(!1),v=Y.useRef(0),_=M=>{M.stopPropagation(),M.preventDefault(),g.current=!0,m.current=M.touches?M.touches[0].clientX:M.clientX},A=M=>{M.stopPropagation(),M.preventDefault(),g.current=!1},C=M=>{if(!g.current||!r.current)return;M.stopPropagation(),M.preventDefault();const S=M.touches?M.touches[0].clientX:M.clientX,b=(S-m.current)/a.width;r.current.rotation.y+=b*.1*Math.PI,m.current=S,v.current=b*.01*Math.PI};return vp(()=>{if(!r.current)return;r.current.rotation.y+=v.current,v.current*=.96,Math.abs(v.current)<1e-4&&(v.current=0);let M=r.current.rotation.y;M=(M%(2*Math.PI)+2*Math.PI)%(2*Math.PI);let S=null;const b=Math.PI/12;M>Math.PI/4-b&&M<Math.PI/4+b?S=1:M>Math.PI/2+Math.PI/4-b&&M<Math.PI/2+Math.PI/4+b?S=2:M>Math.PI+Math.PI/4-b&&M<Math.PI+Math.PI/4+b?S=3:M>3*Math.PI/2+Math.PI/4-b&&M<3*Math.PI/2+Math.PI/4+b&&(S=4),S!==e&&(console.log("Setting Stage:",S),i(S))}),Y.useEffect(()=>{const M=s.domElement;return M.addEventListener("pointerdown",_),M.addEventListener("pointerup",A),M.addEventListener("pointermove",C),()=>{M.removeEventListener("pointerdown",_),M.removeEventListener("pointerup",A),M.removeEventListener("pointermove",C)}},[s]),Y.useEffect(()=>{u.background=new tt(t?8900331:657930)},[t,u]),d?fe.jsxs(e4.group,{ref:r,...n,position:[0,-3,0],scale:[2,2,2],children:[t?fe.jsx("directionalLight",{intensity:1,position:[5,10,5],color:"white"}):fe.jsx("directionalLight",{intensity:.5,position:[5,10,5],color:"blue"}),fe.jsx("mesh",{geometry:d.polySurface944_tree_body_0.geometry,material:h.PaletteMaterial001}),fe.jsx("mesh",{geometry:d.polySurface945_tree1_0.geometry,material:h.PaletteMaterial001}),fe.jsx("mesh",{geometry:d.polySurface946_tree2_0.geometry,material:h.PaletteMaterial001}),fe.jsx("mesh",{geometry:d.polySurface947_tree1_0.geometry,material:h.PaletteMaterial001}),fe.jsx("mesh",{geometry:d.polySurface948_tree_body_0.geometry,material:h.PaletteMaterial001}),fe.jsx("mesh",{geometry:d.polySurface949_tree_body_0.geometry,material:h.PaletteMaterial001}),fe.jsx("mesh",{geometry:d.pCube11_rocks1_0.geometry,material:h.PaletteMaterial001})]}):null},Z4="/assets/sky-B0A1kvoP.glb",$4=({rotation:i=[0,0,0],isDayMode:e})=>{const{scene:t}=Pa(Z4);return Y.useEffect(()=>{t&&t.traverse(n=>{n.isMesh&&(e?(n.material.color=new tt("#87CEEB"),n.material.emissive=new tt("#000000"),n.material.emissiveIntensity=0):(n.material.color=new tt("#243B55"),n.material.emissive=new tt("#2C5373"),n.material.emissiveIntensity=.2))})},[e,t]),fe.jsx("mesh",{rotation:i,children:fe.jsx("primitive",{object:t})})},eU="/assets/plane-Dk3bBBjR.glb",tU=({isRotating:i})=>{const e=Y.useRef(),t=Y.useRef(1),{scene:n,animations:r}=Pa(eU),{actions:s}=Rw(r,e);return Y.useEffect(()=>{if(!n||!e.current)return;console.log("Plane Loaded:",n);const a=n.children.find(u=>u.isMesh);if(a&&a.geometry){a.geometry.computeBoundingBox(),a.geometry.computeBoundingSphere();const u=new TE(a,16711680);n.add(u),a.material.transparent=!0}s["Take 001"]&&(i?(s["Take 001"].play(),t.current=1):s["Take 001"].stop())},[n,s,i]),vp(()=>{n&&n.traverse(a=>{a.isMesh&&a.material&&(!i&&t.current>0?(t.current-=.02,a.material.opacity=Math.max(t.current,0)):i&&(t.current=1,a.material.opacity=1))})}),fe.jsx("primitive",{ref:e,object:n,position:[0,15,90],rotation:[0,20.1,0],scale:[4,4,4]})},nU="/assets/bird-D9YInZSw.glb",iU=()=>{const{scene:i,animations:e}=Pa(nU);return fe.jsx("mesh",{position:[0,20,70],scale:[5,5,5],children:fe.jsx("primitive",{object:i})})},rU="data:image/svg+xml,%3csvg%20width='50'%20height='50'%20viewBox='0%200%2050%2050'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20d='M7.03125%2044.9219L2.92969%200H46.9727L42.9688%2044.9219L25%2050'%20fill='%23264DE4'/%3e%3cpath%20d='M25%203.61328V46.0938L39.5508%2042.0898L42.9688%203.61328'%20fill='%232965F1'/%3e%3cpath%20d='M11.1328%209.17969H25V14.6484H11.6211M12.1094%2020.3125H25V25.8789H12.5977M12.8906%2028.6133H18.3594L18.75%2033.0078L25%2034.668V40.4297L13.5742%2037.3047'%20fill='%23EBEBEB'/%3e%3cpath%20d='M25%2020.3125V25.8789H31.7383L31.0547%2033.0078L25%2034.668V40.4297L36.2305%2037.3047L38.7695%209.17969H25V14.6484H32.8125L32.2754%2020.3125H25Z'%20fill='white'/%3e%3c/svg%3e",sU="data:image/svg+xml,%3csvg%20width='51'%20height='50'%20viewBox='0%200%2051%2050'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20d='M49%2038.2998C47.254%2038.7303%2046.174%2038.3187%2045.205%2036.908L38.314%2027.6642L37.318%2026.3844L29.2705%2036.9385C28.351%2038.2082%2027.3865%2038.7608%2025.6705%2038.3114L35.9755%2024.8995L26.3815%2012.7849C28.0315%2012.4737%2029.1715%2012.6322%2030.184%2014.0647L37.3315%2023.4234L44.5315%2014.1156C45.454%2012.846%2046.4455%2012.3632%2048.1015%2012.8315L44.3815%2017.6133L39.3415%2023.976C38.7415%2024.7032%2038.824%2025.2006%2039.376%2025.903L49%2038.2998ZM1.012%2024.6756L1.855%2020.6558C4.15%2012.7006%2013.555%209.39485%2020.041%2014.3105C23.8315%2017.2017%2024.7735%2021.2913%2024.586%2025.8725H3.22C2.899%2034.1186%209.0205%2039.0953%2016.825%2036.5561C19.5625%2035.6645%2021.175%2033.5863%2021.982%2030.9859C22.3915%2029.6829%2023.0695%2029.4792%2024.3325%2029.8516C23.6875%2033.1035%2022.2325%2035.8202%2019.1575%2037.5203C14.563%2040.0654%208.005%2039.2422%204.555%2035.7053C2.5%2033.6532%201.651%2031.0528%201.27%2028.2721C1.21%2027.8126%201.09%2027.3748%201%2026.9342C1.008%2026.1818%201.012%2025.4294%201.012%2024.677V24.6756ZM3.259%2024.1229H22.567C22.441%2018.1601%2018.6115%2013.9251%2013.378%2013.8888C7.633%2013.8451%203.508%2017.9798%203.259%2024.1229Z'%20fill='black'/%3e%3c/svg%3e",oU="data:image/svg+xml,%3csvg%20width='51'%20height='50'%20viewBox='0%200%2051%2050'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cg%20clip-path='url(%23clip0_1479_21476)'%3e%3cpath%20d='M2.04529%2027.5236C0.651571%2026.1298%200.651571%2023.8702%202.04529%2022.4764L23.4764%201.04529C24.8702%20-0.348429%2027.1298%20-0.348429%2028.5236%201.04529L49.9547%2022.4764C51.3484%2023.8702%2051.3484%2026.1298%2049.9547%2027.5236L28.5236%2048.9547C27.1298%2050.3484%2024.8702%2050.3484%2023.4764%2048.9547L2.04529%2027.5236Z'%20fill='%23EE513B'/%3e%3cpath%20d='M19.1342%205L17%207.17115L22.5122%2012.7787C22.2892%2013.2653%2022.1647%2013.8081%2022.1647%2014.3805C22.1647%2016.0054%2023.1683%2017.3919%2024.5793%2017.9334V31.6509C23.1683%2032.1923%2022.1647%2033.5788%2022.1647%2035.2038C22.1647%2037.3004%2023.8354%2039%2025.8963%2039C27.9573%2039%2029.628%2037.3004%2029.628%2035.2038C29.628%2033.7307%2028.8032%2032.4533%2027.5976%2031.8242V17.9521L32.8668%2023.3124C32.6546%2023.7892%2032.5366%2024.3185%2032.5366%2024.8759C32.5366%2026.9725%2034.2074%2028.6721%2036.2683%2028.6721C38.3293%2028.6721%2040%2026.9725%2040%2024.8759C40%2022.7793%2038.3293%2021.0797%2036.2683%2021.0797C35.8678%2021.0797%2035.4821%2021.1438%2035.1204%2021.2626L29.4614%2015.5058C29.5697%2015.1503%2029.628%2014.7722%2029.628%2014.3805C29.628%2012.2839%2027.9573%2010.5842%2025.8963%2010.5842C25.5112%2010.5842%2025.1398%2010.6436%2024.7902%2010.7538L19.1342%205Z'%20fill='white'/%3e%3c/g%3e%3cdefs%3e%3cclipPath%20id='clip0_1479_21476'%3e%3crect%20width='50'%20height='50'%20fill='white'%20transform='translate(0.820312)'/%3e%3c/clipPath%3e%3c/defs%3e%3c/svg%3e",aU="data:image/svg+xml,%3csvg%20width='51'%20height='50'%20viewBox='0%200%2051%2050'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cg%20clip-path='url(%23clip0_1479_21481)'%3e%3cpath%20fill-rule='evenodd'%20clip-rule='evenodd'%20d='M25.557%200.520996C11.7523%200.520996%200.558594%2011.7575%200.558594%2025.6216C0.558594%2036.7092%207.72108%2046.1167%2017.657%2049.436C18.907%2049.6666%2019.3633%2048.8916%2019.3633%2048.2265C19.3633%2047.6304%2019.3414%2046.0523%2019.3289%2043.9581C12.3742%2045.4751%2010.907%2040.5933%2010.907%2040.5933C9.7711%2037.6944%208.13204%2036.9226%208.13204%2036.9226C5.86173%2035.3648%208.30389%2035.3962%208.30389%2035.3962C10.8117%2035.5734%2012.132%2037.983%2012.132%2037.983C14.3633%2041.8184%2017.9836%2040.7109%2019.4086%2040.0678C19.6352%2038.4457%2020.282%2037.3398%2020.9961%2036.7124C15.4445%2036.0786%209.60858%2033.9263%209.60858%2024.3087C9.60858%2021.5682%2010.582%2019.3281%2012.182%2017.5727C11.9242%2016.9374%2011.0664%2014.3867%2012.4258%2010.9309C12.4258%2010.9309%2014.5258%2010.2563%2019.3008%2013.5035C21.2961%2012.9466%2023.4336%2012.6689%2025.5602%2012.658C27.6836%2012.6689%2029.8227%2012.9466%2031.8195%2013.5035C36.5914%2010.2563%2038.6867%2010.9309%2038.6867%2010.9309C40.0508%2014.3867%2039.193%2016.9374%2038.9351%2017.5727C40.5383%2019.3281%2041.5055%2021.5682%2041.5055%2024.3087C41.5055%2033.9499%2035.6602%2036.0723%2030.0914%2036.6935C30.9883%2037.4684%2031.7883%2038.9995%2031.7883%2041.3416C31.7883%2044.697%2031.757%2047.403%2031.757%2048.2265C31.757%2048.8979%2032.2071%2049.6791%2033.4758%2049.4329C43.4024%2046.1072%2050.5586%2036.706%2050.5586%2025.6216C50.5586%2011.7575%2039.3648%200.520996%2025.557%200.520996Z'%20fill='black'/%3e%3c/g%3e%3cdefs%3e%3cclipPath%20id='clip0_1479_21481'%3e%3crect%20width='50'%20height='50'%20fill='white'%20transform='translate(0.558594)'/%3e%3c/clipPath%3e%3c/defs%3e%3c/svg%3e",lU="data:image/svg+xml,%3csvg%20width='50'%20height='50'%20viewBox='0%200%2050%2050'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20d='M6.93359%2044.9219L2.92969%200H46.9727L42.9688%2044.9219L24.9023%2050'%20fill='%23E34F26'/%3e%3cpath%20d='M25%2046.0938L39.5508%2042.0898L42.9688%203.61328H25'%20fill='%23EF652A'/%3e%3cpath%20d='M25%2020.3125H17.6758L17.1875%2014.6484H25V9.17969H11.1328L12.5977%2025.8789H25V20.3125ZM24.9023%2034.668L18.75%2033.0078L18.3594%2028.6133H12.8906L13.5742%2037.3047L24.9023%2040.4297V34.668Z'%20fill='%23EBEBEB'/%3e%3cpath%20d='M24.9023%2020.3125V25.8789H31.7383L31.0547%2033.0078L24.9023%2034.668V40.4297L36.2305%2037.3047L37.793%2020.3125H24.9023ZM24.9023%209.17969V14.6484H38.2812L38.7695%209.17969H24.9023Z'%20fill='white'/%3e%3c/svg%3e",uU="data:image/svg+xml,%3csvg%20width='51'%20height='50'%20viewBox='0%200%2051%2050'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cg%20clip-path='url(%23clip0_1479_21409)'%3e%3cpath%20d='M43%200H8C3.85786%200%200.5%203.35786%200.5%207.5V42.5C0.5%2046.6421%203.85786%2050%208%2050H43C47.1421%2050%2050.5%2046.6421%2050.5%2042.5V7.5C50.5%203.35786%2047.1421%200%2043%200Z'%20fill='%23F0DB4F'/%3e%3cpath%20d='M32.1406%2036.1328C33.1172%2037.793%2034.4844%2038.9648%2036.7305%2038.9648C38.6836%2038.9648%2039.9531%2037.9883%2039.9531%2036.6211C39.9531%2035.0586%2038.6836%2034.4727%2036.5352%2033.4961L35.3633%2033.0078C31.9453%2031.543%2029.6992%2029.7852%2029.6992%2025.9766C29.6992%2022.4609%2032.3359%2019.7266%2036.5352%2019.7266C39.5625%2019.7266%2041.7109%2020.8008%2043.1758%2023.5352L39.5625%2025.8789C38.7812%2024.4141%2037.9023%2023.8281%2036.5352%2023.8281C35.168%2023.8281%2034.2891%2024.707%2034.2891%2025.8789C34.2891%2027.2461%2035.168%2027.832%2037.2188%2028.7109L38.3906%2029.1992C42.3945%2030.957%2044.6406%2032.6172%2044.6406%2036.6211C44.6406%2040.8203%2041.3203%2043.1641%2036.8281%2043.1641C32.4336%2043.1641%2029.6016%2041.1133%2028.2344%2038.3789L32.1406%2036.1328ZM15.5391%2036.5234C16.3203%2037.793%2016.9062%2038.9648%2018.5664%2038.9648C20.1289%2038.9648%2021.1055%2038.3789%2021.1055%2036.0352V19.8242H25.793V35.8398C25.793%2040.7227%2022.9609%2042.8711%2018.7617%2042.8711C14.9531%2042.8711%2012.8047%2040.918%2011.7305%2038.5742L15.5391%2036.5234Z'%20fill='%23323330'/%3e%3c/g%3e%3cdefs%3e%3cclipPath%20id='clip0_1479_21409'%3e%3crect%20width='50'%20height='50'%20fill='white'%20transform='translate(0.5)'/%3e%3c/clipPath%3e%3c/defs%3e%3c/svg%3e",cU="data:image/svg+xml,%3csvg%20width='45'%20height='50'%20viewBox='0%200%2045%2050'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20d='M22.2977%2049.9072C21.6099%2049.9072%2020.968%2049.7238%2020.372%2049.4029L14.274%2045.7808C13.357%2045.2764%2013.8155%2045.093%2014.0906%2045.0013C15.3285%2044.5887%2015.5578%2044.497%2016.8416%2043.7634C16.9791%2043.6717%2017.1625%2043.7175%2017.3001%2043.8092L21.9767%2046.6061C22.1601%2046.6978%2022.3894%2046.6978%2022.5269%2046.6061L40.8209%2036.0148C41.0043%2035.9231%2041.096%2035.7397%2041.096%2035.5105V14.3738C41.096%2014.1446%2041.0043%2013.9612%2040.8209%2013.8695L22.5269%203.32409C22.3435%203.23239%2022.1143%203.23239%2021.9767%203.32409L3.68276%2013.8695C3.49936%2013.9612%203.40766%2014.1904%203.40766%2014.3738V35.5105C3.40766%2035.6939%203.49936%2035.9231%203.68276%2036.0148L8.68036%2038.9033C11.3855%2040.2788%2013.0819%2038.6741%2013.0819%2037.0694V16.2078C13.0819%2015.9327%2013.3112%2015.6576%2013.6321%2015.6576H15.9704C16.2455%2015.6576%2016.5206%2015.8869%2016.5206%2016.2078V37.0694C16.5206%2040.6915%2014.5491%2042.8005%2011.1104%2042.8005C10.0558%2042.8005%209.23055%2042.8005%206.89223%2041.6543L2.07802%2038.9033C0.885936%2038.2156%200.152344%2036.9318%200.152344%2035.5563V14.4197C0.152344%2013.0442%200.885936%2011.7604%202.07802%2011.0727L20.372%200.48142C21.5182%20-0.160473%2023.0771%20-0.160473%2024.2234%200.48142L42.5173%2011.0727C43.7094%2011.7604%2044.443%2013.0442%2044.443%2014.4197V35.5563C44.443%2036.9318%2043.7094%2038.2156%2042.5173%2038.9033L24.2234%2049.4946C23.6273%2049.7697%2022.9396%2049.9072%2022.2977%2049.9072ZM27.9372%2035.3729C19.9135%2035.3729%2018.2629%2031.705%2018.2629%2028.5872C18.2629%2028.3121%2018.4922%2028.037%2018.8131%2028.037H21.1973C21.4724%2028.037%2021.7016%2028.2204%2021.7016%2028.4955C22.0684%2030.9255%2023.123%2032.1176%2027.983%2032.1176C31.8344%2032.1176%2033.485%2031.2465%2033.485%2029.1832C33.485%2027.9911%2033.0265%2027.12%2027.0202%2026.524C22.0226%2026.0196%2018.9048%2024.9192%2018.9048%2020.9303C18.9048%2017.2165%2022.0226%2015.0157%2027.2494%2015.0157C33.1182%2015.0157%2036.0067%2017.0331%2036.3735%2021.4347C36.3735%2021.5722%2036.3276%2021.7098%2036.2359%2021.8473C36.1442%2021.939%2036.0067%2022.0307%2035.8691%2022.0307H33.485C33.2557%2022.0307%2033.0265%2021.8473%2032.9806%2021.6181C32.4304%2019.0963%2031.0091%2018.271%2027.2494%2018.271C23.0313%2018.271%2022.5269%2019.7382%2022.5269%2020.8386C22.5269%2022.1683%2023.123%2022.5809%2028.8083%2023.3145C34.4478%2024.0481%2037.1071%2025.1026%2037.1071%2029.0457C37.0612%2033.0804%2033.7601%2035.3729%2027.9372%2035.3729Z'%20fill='%23539E43'/%3e%3c/svg%3e",fU="data:image/svg+xml,%3csvg%20width='81'%20height='80'%20viewBox='0%200%2081%2080'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cg%20clip-path='url(%23clip0_1479_21414)'%3e%3cpath%20d='M45.458%2041.5776C46.4212%2038.9707%2045.0226%2036.0517%2042.3335%2035.0581C39.6448%2034.0647%2036.6839%2035.3729%2035.7207%2037.9798C34.7574%2040.5871%2036.1565%2043.506%2038.8452%2044.4994C41.5342%2045.493%2044.4947%2044.1848%2045.458%2041.5776Z'%20fill='%2353C1DE'/%3e%3cpath%20fill-rule='evenodd'%20clip-rule='evenodd'%20d='M59.6393%2036.8569C62.1641%2033.1859%2066.232%2026.1515%2062.6171%2021.9214C59.0193%2017.7103%2051.3231%2020.3888%2047.1296%2022.154C45.0896%2018.1187%2040.8104%2011.0391%2035.3144%2011.9121C29.8415%2012.7815%2028.5099%2020.6853%2028.0547%2025.1499C23.3961%2024.752%2015.221%2024.5819%2013.3277%2029.7061C11.4398%2034.8158%2017.6725%2040.2198%2021.4461%2042.9362C18.8768%2046.6453%2014.8585%2053.4365%2018.4592%2057.652C22.0844%2061.8945%2029.8773%2059.4062%2034.1115%2057.6197C36.1635%2061.7121%2040.2513%2068.6252%2045.7274%2067.7553C51.2207%2066.8827%2052.774%2059.0337%2053.2378%2054.5454C57.7432%2054.885%2065.9859%2054.8969%2067.8502%2049.851C69.7253%2044.7761%2063.3722%2039.5552%2059.6393%2036.8569ZM53.4062%2052.1383C53.4986%2049.7653%2053.3994%2047.1688%2053.1197%2044.4212C55.0466%2042.5513%2056.7633%2040.6588%2058.2117%2038.8023C60.9457%2040.7872%2066.9143%2045.2201%2065.5212%2048.9905C64.115%2052.7964%2056.9614%2052.402%2053.4062%2052.1383ZM45.2824%2065.3697C41.1967%2066.0185%2037.8496%2059.6152%2036.3318%2056.5991C38.4703%2055.5375%2040.7055%2054.2107%2042.9811%2052.661C45.7008%2053.4083%2048.3278%2053.9576%2050.7731%2054.2858C50.4413%2057.4592%2049.3862%2064.7177%2045.2824%2065.3697ZM20.3459%2056.1254C17.6606%2052.9828%2021.6084%2047.0564%2023.5%2044.3238C25.5561%2045.628%2027.901%2046.886%2030.4664%2048.0699C31.2143%2050.6853%2032.0952%2053.1607%2033.0751%2055.4057C30.4265%2056.5238%2023.0437%2059.2825%2020.3459%2056.1254ZM15.6567%2030.5667C17.0682%2026.7466%2024.4399%2027.2588%2027.8765%2027.5563C27.7639%2029.96%2027.8276%2032.5405%2028.067%2035.2146C26.1199%2037.1192%2024.3678%2039.0692%2022.8747%2040.9918C20.2045%2039.0667%2014.2445%2034.389%2015.6567%2030.5667ZM35.7592%2014.2977C39.862%2013.6461%2043.4186%2020.239%2044.902%2023.163C42.7088%2024.2269%2040.4497%2025.5261%2038.1983%2027.0198C35.549%2026.3028%2032.9576%2025.7659%2030.5178%2025.4279C30.8859%2021.8274%2031.6608%2014.9486%2035.7592%2014.2977ZM51.5018%2034.7248C53.1628%2035.5804%2054.7249%2036.4794%2056.1619%2037.404C55.1526%2038.6905%2054.0029%2040.001%2052.7349%2041.3113C52.4147%2039.1027%2052.0074%2036.9038%2051.5018%2034.7248ZM45.9385%2025.3801C46.5958%2026.9054%2047.2062%2028.563%2047.7595%2030.3211C45.649%2029.4294%2043.4988%2028.6345%2041.3159%2027.9387C42.8757%2026.9757%2044.4257%2026.1185%2045.9385%2025.3801ZM30.3849%2033.0516C30.2829%2031.2413%2030.2692%2029.4933%2030.3425%2027.8372C32.0228%2028.0745%2033.7838%2028.4116%2035.5895%2028.8408C33.7866%2030.1626%2032.0496%2031.5683%2030.3849%2033.0516ZM29.6689%2045.0176C27.9548%2044.1647%2026.3675%2043.2806%2024.9336%2042.3778C25.9718%2041.0486%2027.1437%2039.7012%2028.4252%2038.3638C28.7319%2040.5974%2029.1476%2042.8183%2029.6689%2045.0176ZM35.297%2054.3797C34.6199%2052.8169%2033.9907%2051.1325%2033.423%2049.3612C35.5517%2050.2411%2037.7149%2051.0406%2039.9084%2051.7449C38.3297%2052.7516%2036.7849%2053.6348%2035.297%2054.3797ZM50.8253%2046.548C50.959%2048.4279%2050.9976%2050.2129%2050.9381%2051.8748C49.2279%2051.6405%2047.4171%2051.2916%2045.5415%2050.8363C47.3633%2049.4795%2049.1298%2048.052%2050.8253%2046.548ZM42.4809%2050.0166C39.0937%2049.0251%2035.7715%2047.7948%2032.5445%2046.3666C31.6496%2043.0143%2031.0116%2039.6007%2030.6416%2036.165C33.1475%2033.7986%2035.8375%2031.6209%2038.6866%2029.6567C42.0822%2030.636%2045.4089%2031.8643%2048.6246%2033.3303C49.4962%2036.669%2050.1242%2040.0644%2050.5324%2043.4777C48.0113%2045.8367%2045.3104%2048.0168%2042.4809%2050.0166ZM60.7309%2023.4479C63.4277%2026.6047%2059.4203%2032.7969%2057.593%2035.4583C55.518%2034.1164%2053.2008%2032.8322%2050.7156%2031.648C49.9815%2029.026%2049.1242%2026.5718%2048.1674%2024.3682C51.2411%2023.0767%2058.0602%2020.3219%2060.7309%2023.4479Z'%20fill='%2353C1DE'/%3e%3c/g%3e%3cdefs%3e%3cclipPath%20id='clip0_1479_21414'%3e%3crect%20width='62'%20height='62'%20fill='white'%20transform='translate(22.2383)%20rotate(20.2782)'/%3e%3c/clipPath%3e%3c/defs%3e%3c/svg%3e",Eg="data:image/svg+xml,%3csvg%20width='14'%20height='15'%20viewBox='0%200%2014%2015'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20d='M1.16602%207.49984H12.8327M12.8327%207.49984L6.99935%201.6665M12.8327%207.49984L6.99935%2013.3332'%20stroke='%23406AFF'%20stroke-width='1.66667'%20stroke-linecap='round'%20stroke-linejoin='round'/%3e%3c/svg%3e",dU="/assets/soundon-4GJHmOjh.png",hU="/assets/soundoff-B_dVLsfG.png",pU=({currentStage:i})=>i===3?fe.jsxs("h1",{style:{fontSize:"1.0rem",lineHeight:"2rem",textAlign:"center",background:"#3B82F6",padding:"16px 32px",color:"#F8FAFC",margin:"0 auto",display:"inline-block",borderRadius:"8px",boxShadow:"4px 4px 0px #1D4ED8",fontFamily:"'Verdana', 'Arial', sans-serif"},children:["Hi, I'm",fe.jsx("span",{style:{fontWeight:"bold",margin:"0 8px",color:"#F8FAFC"},children:"Aditya Pratap Singh"}),"👋",fe.jsx("br",{}),"A Software Engineer"]}):i===2?fe.jsxs("div",{style:{fontSize:"1.0rem",lineHeight:"2rem",textAlign:"center",background:"#3B82F6",padding:"16px 32px",color:"#F8FAFC",margin:"0 auto",display:"inline-block",borderRadius:"8px",boxShadow:"4px 4px 0px #1D4ED8",fontFamily:"'Verdana', 'Arial', sans-serif"},children:[fe.jsxs("p",{children:["Full-stack developer with internship experience, ",fe.jsx("br",{})," I picked up many skills along the way"]}),fe.jsxs(zf,{to:"/about",style:{display:"flex",alignItems:"center",justifyContent:"center",gap:"6px",backgroundColor:"#FFFFFF",color:"#2563EB",fontWeight:"500",padding:"6px 8px",fontSize:"0.80rem",borderRadius:"8px",textDecoration:"none",marginTop:"8px",boxShadow:"2px 2px 0px #1E40AF",transition:"all 0.2s ease-in-out"},children:[fe.jsx("span",{style:{color:"#3B82F6",fontWeight:"600"},children:"Learn more"}),fe.jsx("img",{src:Eg,alt:"arrow",style:{width:"16px",height:"16px",objectFit:"contain"}})]})]}):i===1?fe.jsxs("div",{style:{fontSize:"1.0rem",lineHeight:"2rem",textAlign:"center",background:"#3B82F6",padding:"16px 32px",color:"#F8FAFC",margin:"0 auto",display:"inline-block",borderRadius:"8px",boxShadow:"4px 4px 0px #1D4ED8",fontFamily:"'Verdana', 'Arial', sans-serif"},children:[fe.jsxs("p",{children:["Worked on multiple projects ",fe.jsx("br",{})," Curious about the impact?"]}),fe.jsxs(zf,{to:"/projects",style:{display:"flex",alignItems:"center",justifyContent:"center",gap:"6px",backgroundColor:"#FFFFFF",color:"#2563EB",fontWeight:"500",padding:"6px 8px",fontSize:"0.80rem",borderRadius:"8px",textDecoration:"none",marginTop:"8px",boxShadow:"2px 2px 0px #1E40AF",transition:"all 0.2s ease-in-out"},children:[fe.jsx("span",{style:{color:"#3B82F6",fontWeight:"600"},children:"View Projects"}),fe.jsx("img",{src:Eg,alt:"arrow",style:{width:"16px",height:"16px",objectFit:"contain"}})]})]}):i===4?fe.jsxs("div",{style:{fontSize:"1.0rem",lineHeight:"2rem",textAlign:"center",background:"#3B82F6",padding:"16px 32px",color:"#F8FAFC",margin:"0 auto",display:"inline-block",borderRadius:"8px",boxShadow:"4px 4px 0px #1D4ED8",fontFamily:"'Verdana', 'Arial', sans-serif"},children:[fe.jsxs("p",{children:["Lets create something together ",fe.jsx("br",{})," I'm just a few keystrokes away"]}),fe.jsxs(zf,{to:"/contact",style:{display:"flex",alignItems:"center",justifyContent:"center",gap:"6px",backgroundColor:"#FFFFFF",color:"#2563EB",fontWeight:"500",padding:"6px 8px",fontSize:"0.80rem",borderRadius:"8px",textDecoration:"none",marginTop:"8px",boxShadow:"2px 2px 0px #1E40AF",transition:"all 0.2s ease-in-out"},children:[fe.jsx("span",{style:{color:"#3B82F6",fontWeight:"600"},children:"Let's talk"}),fe.jsx("img",{src:Eg,alt:"arrow",style:{width:"16px",height:"16px",objectFit:"contain"}})]})]}):null,mU="/assets/sakura-Dh6hhofb.mp3",gU="/assets/sun-soE1KamU.png",vU="/assets/moon-C28zcf3Y.png",yU=()=>{const[i,e]=Y.useState(!0),[t,n]=Y.useState(!1),r=Y.useRef(new Audio("/sakura.mp3")),[s,a]=Y.useState(!1),[u,d]=Y.useState([0,-Math.PI/2,0]),[h,m]=Y.useState(null),[g,v]=Y.useState(!1),_=Y.useRef(null),A=Y.useRef(!1);let C=Y.useRef(null);Y.useEffect(()=>(r.current=new Audio(mU),r.current.volume=.4,r.current.loop=!0,()=>{r.current.pause(),r.current=null}),[]),Y.useEffect(()=>{t?r.current.play().catch(P=>console.error("Audio play failed:",P)):r.current.pause()},[t]),Y.useEffect(()=>{if(!_.current)return;const P=()=>{a(!0),A.current&&clearTimeout(A.current),A.current=setTimeout(()=>{a(!1)},300)},U=_.current;return U.addEventListener("change",P),()=>{U.removeEventListener("change",P)}},[]);const M=Math.PI/300,S=P=>{d(([U,F,k])=>[U,F+P*M,k]),C.current=requestAnimationFrame(()=>S(P))},b=P=>{C.current||(P.key==="ArrowLeft"&&S(1),P.key==="ArrowRight"&&S(-1)),a(!0)},R=()=>{cancelAnimationFrame(C.current),C.current=null,a(!1)};return Y.useEffect(()=>(window.addEventListener("keydown",b),window.addEventListener("keyup",R),()=>{window.removeEventListener("keydown",b),window.removeEventListener("keyup",R),cancelAnimationFrame(C.current)}),[]),Y.useEffect(()=>{console.log("Current Stage in Home:",h),h&&v(!0)},[h]),fe.jsxs("section",{className:"w-full h-screen relative",children:[g&&h&&fe.jsx("div",{className:"absolute top-28 left-0 right-0 z-10 flex items-center justify-center",children:fe.jsx(pU,{currentStage:h})}),fe.jsx(nw,{className:"w-full h-screen bg-transparent",camera:{position:[0,20,100],near:.1,far:1e3},children:fe.jsxs(Y.Suspense,{fallback:fe.jsx(Pw,{}),children:[i?fe.jsxs(fe.Fragment,{children:[fe.jsx("directionalLight",{intensity:.3,position:[1,5,10]}),fe.jsx("ambientLight",{intensity:.5}),fe.jsx("hemisphereLight",{skyColor:"#b1e1ff",groundColor:"#000000",intensity:.8})]}):fe.jsxs(fe.Fragment,{children:[fe.jsx("ambientLight",{intensity:.1}),fe.jsx("spotLight",{intensity:2,position:[0,20,0],angle:1,penumbra:1,castShadow:!0})]}),fe.jsx(J4,{ref:_,enableZoom:!1}),fe.jsx($4,{rotation:u,isDayMode:i}),fe.jsx(q4,{isRotating:s,isDayMode:i,setIsRotating:a,setCurrentStage:m,position:[0,-4,-20],rotation:u,scale:[2,2,2]}),fe.jsx(iU,{position:[0,25,-20],scale:[5,5,5]}),fe.jsx(tU,{isRotating:s,position:[0,25,-20],rotation:[0,u[1]+Math.PI/2,0],scale:[5,5,5]})]})}),fe.jsx("div",{className:"absolute bottom-2 left-2",children:fe.jsx("img",{src:t?dU:hU,alt:"sound",className:"w-10 h-10 cursor-pointer object-contain",onClick:()=>n(!t)})}),fe.jsx("div",{className:"absolute bottom-2 right-2",children:fe.jsx("img",{src:i?gU:vU,alt:"day-night-toggle",className:"w-10 h-10 cursor-pointer object-contain",onClick:()=>e(!i)})})]})};var Sh={},n_={exports:{}};/*!
	Copyright (c) 2018 Jed Watson.
	Licensed under the MIT License (MIT), see
	http://jedwatson.github.io/classnames
*/var p2;function Bw(){return p2||(p2=1,function(i){(function(){var e={}.hasOwnProperty;function t(){for(var s="",a=0;a<arguments.length;a++){var u=arguments[a];u&&(s=r(s,n(u)))}return s}function n(s){if(typeof s=="string"||typeof s=="number")return s;if(typeof s!="object")return"";if(Array.isArray(s))return t.apply(null,s);if(s.toString!==Object.prototype.toString&&!s.toString.toString().includes("[native code]"))return s.toString();var a="";for(var u in s)e.call(s,u)&&s[u]&&(a=r(a,u));return a}function r(s,a){return a?s?s+" "+a:s+a:s}i.exports?(t.default=t,i.exports=t):window.classNames=t})()}(n_)),n_.exports}var m2;function _U(){if(m2)return Sh;m2=1,Sh.__esModule=!0,Sh.default=void 0;var i=n(td()),e=n(Iw()),t=n(Bw());function n(a){return a&&a.__esModule?a:{default:a}}const r=({animate:a=!0,className:u="",layout:d="2-columns",lineColor:h="#FFF",children:m})=>(typeof window=="object"&&document.documentElement.style.setProperty("--line-color",h),i.default.createElement("div",{className:(0,t.default)(u,"vertical-timeline",{"vertical-timeline--animate":a,"vertical-timeline--two-columns":d==="2-columns","vertical-timeline--one-column-left":d==="1-column"||d==="1-column-left","vertical-timeline--one-column-right":d==="1-column-right"})},m));r.propTypes={children:e.default.oneOfType([e.default.arrayOf(e.default.node),e.default.node]).isRequired,className:e.default.string,animate:e.default.bool,layout:e.default.oneOf(["1-column-left","1-column","2-columns","1-column-right"]),lineColor:e.default.string};var s=r;return Sh.default=s,Sh}var Mh={};function B_(){return B_=Object.assign||function(i){for(var e=1;e<arguments.length;e++){var t=arguments[e];for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(i[n]=t[n])}return i},B_.apply(this,arguments)}function xU(i,e){i.prototype=Object.create(e.prototype),i.prototype.constructor=i,L_(i,e)}function L_(i,e){return L_=Object.setPrototypeOf||function(n,r){return n.__proto__=r,n},L_(i,e)}function AU(i,e){if(i==null)return{};var t={},n=Object.keys(i),r,s;for(s=0;s<n.length;s++)r=n[s],!(e.indexOf(r)>=0)&&(t[r]=i[r]);return t}var D_=new Map,mg=new WeakMap,g2=0,Lw=void 0;function SU(i){Lw=i}function MU(i){return i?(mg.has(i)||(g2+=1,mg.set(i,g2.toString())),mg.get(i)):"0"}function EU(i){return Object.keys(i).sort().filter(function(e){return i[e]!==void 0}).map(function(e){return e+"_"+(e==="root"?MU(i.root):i[e])}).toString()}function wU(i){var e=EU(i),t=D_.get(e);if(!t){var n=new Map,r,s=new IntersectionObserver(function(a){a.forEach(function(u){var d,h=u.isIntersecting&&r.some(function(m){return u.intersectionRatio>=m});i.trackVisibility&&typeof u.isVisible>"u"&&(u.isVisible=h),(d=n.get(u.target))==null||d.forEach(function(m){m(h,u)})})},i);r=s.thresholds||(Array.isArray(i.threshold)?i.threshold:[i.threshold||0]),t={id:e,observer:s,elements:n},D_.set(e,t)}return t}function Qx(i,e,t,n){if(t===void 0&&(t={}),n===void 0&&(n=Lw),typeof window.IntersectionObserver>"u"&&n!==void 0){var r=i.getBoundingClientRect();return e(n,{isIntersecting:n,target:i,intersectionRatio:typeof t.threshold=="number"?t.threshold:0,time:0,boundingClientRect:r,intersectionRect:r,rootBounds:r}),function(){}}var s=wU(t),a=s.id,u=s.observer,d=s.elements,h=d.get(i)||[];return d.has(i)||d.set(i,h),h.push(e),u.observe(i),function(){h.splice(h.indexOf(e),1),h.length===0&&(d.delete(i),u.unobserve(i)),d.size===0&&(u.disconnect(),D_.delete(a))}}var CU=["children","as","triggerOnce","threshold","root","rootMargin","onChange","skip","trackVisibility","delay","initialInView","fallbackInView"];function v2(i){return typeof i.children!="function"}var x0=function(i){xU(e,i);function e(n){var r;return r=i.call(this,n)||this,r.node=null,r._unobserveCb=null,r.handleNode=function(s){r.node&&(r.unobserve(),!s&&!r.props.triggerOnce&&!r.props.skip&&r.setState({inView:!!r.props.initialInView,entry:void 0})),r.node=s||null,r.observeNode()},r.handleChange=function(s,a){s&&r.props.triggerOnce&&r.unobserve(),v2(r.props)||r.setState({inView:s,entry:a}),r.props.onChange&&r.props.onChange(s,a)},r.state={inView:!!n.initialInView,entry:void 0},r}var t=e.prototype;return t.componentDidUpdate=function(r){(r.rootMargin!==this.props.rootMargin||r.root!==this.props.root||r.threshold!==this.props.threshold||r.skip!==this.props.skip||r.trackVisibility!==this.props.trackVisibility||r.delay!==this.props.delay)&&(this.unobserve(),this.observeNode())},t.componentWillUnmount=function(){this.unobserve(),this.node=null},t.observeNode=function(){if(!(!this.node||this.props.skip)){var r=this.props,s=r.threshold,a=r.root,u=r.rootMargin,d=r.trackVisibility,h=r.delay,m=r.fallbackInView;this._unobserveCb=Qx(this.node,this.handleChange,{threshold:s,root:a,rootMargin:u,trackVisibility:d,delay:h},m)}},t.unobserve=function(){this._unobserveCb&&(this._unobserveCb(),this._unobserveCb=null)},t.render=function(){if(!v2(this.props)){var r=this.state,s=r.inView,a=r.entry;return this.props.children({inView:s,entry:a,ref:this.handleNode})}var u=this.props,d=u.children,h=u.as,m=AU(u,CU);return Y.createElement(h||"div",B_({ref:this.handleNode},m),d)},e}(Y.Component);x0.displayName="InView";x0.defaultProps={threshold:0,triggerOnce:!1,initialInView:!1};function TU(i){var e=i===void 0?{}:i,t=e.threshold,n=e.delay,r=e.trackVisibility,s=e.rootMargin,a=e.root,u=e.triggerOnce,d=e.skip,h=e.initialInView,m=e.fallbackInView,g=Y.useRef(),v=Y.useState({inView:!!h}),_=v[0],A=v[1],C=Y.useCallback(function(S){g.current!==void 0&&(g.current(),g.current=void 0),!d&&S&&(g.current=Qx(S,function(b,R){A({inView:b,entry:R}),R.isIntersecting&&u&&g.current&&(g.current(),g.current=void 0)},{root:a,rootMargin:s,threshold:t,trackVisibility:r,delay:n},m))},[Array.isArray(t)?t.toString():t,a,s,u,d,r,m,n]);Y.useEffect(function(){!g.current&&_.entry&&!u&&!d&&A({inView:!!h})});var M=[C,_.inView,_.entry];return M.ref=M[0],M.inView=M[1],M.entry=M[2],M}const bU=Object.freeze(Object.defineProperty({__proto__:null,InView:x0,default:x0,defaultFallbackInView:SU,observe:Qx,useInView:TU},Symbol.toStringTag,{value:"Module"})),RU=pC(bU);var y2;function IU(){if(y2)return Mh;y2=1,Mh.__esModule=!0,Mh.default=void 0;var i=r(td()),e=r(Iw()),t=r(Bw()),n=RU;function r(u){return u&&u.__esModule?u:{default:u}}const s=({children:u="",className:d="",contentArrowStyle:h=null,contentStyle:m=null,date:g="",dateClassName:v="",icon:_=null,iconClassName:A="",iconOnClick:C=null,onTimelineElementClick:M=null,iconStyle:S=null,id:b="",position:R="",style:P=null,textClassName:U="",intersectionObserverProps:F={rootMargin:"0px 0px -40px 0px",triggerOnce:!0},visible:k=!1})=>i.default.createElement(n.InView,F,({inView:G,ref:D})=>i.default.createElement("div",{ref:D,id:b,className:(0,t.default)(d,"vertical-timeline-element",{"vertical-timeline-element--left":R==="left","vertical-timeline-element--right":R==="right","vertical-timeline-element--no-children":u===""}),style:P},i.default.createElement(i.default.Fragment,null,i.default.createElement("span",{style:S,onClick:C,className:(0,t.default)(A,"vertical-timeline-element-icon",{"bounce-in":G||k,"is-hidden":!(G||k)})},_),i.default.createElement("div",{style:m,onClick:M,className:(0,t.default)(U,"vertical-timeline-element-content",{"bounce-in":G||k,"is-hidden":!(G||k)})},i.default.createElement("div",{style:h,className:"vertical-timeline-element-content-arrow"}),u,i.default.createElement("span",{className:(0,t.default)(v,"vertical-timeline-element-date")},g)))));s.propTypes={children:e.default.oneOfType([e.default.arrayOf(e.default.node),e.default.node]),className:e.default.string,contentArrowStyle:e.default.shape({}),contentStyle:e.default.shape({}),date:e.default.node,dateClassName:e.default.string,icon:e.default.element,iconClassName:e.default.string,iconStyle:e.default.shape({}),iconOnClick:e.default.func,onTimelineElementClick:e.default.func,id:e.default.string,position:e.default.string,style:e.default.shape({}),textClassName:e.default.string,visible:e.default.bool,intersectionObserverProps:e.default.shape({root:e.default.object,rootMargin:e.default.string,threshold:e.default.number,triggerOnce:e.default.bool})};var a=s;return Mh.default=a,Mh}var i_,_2;function PU(){return _2||(_2=1,i_={VerticalTimeline:_U().default,VerticalTimelineElement:IU().default}),i_}var x2=PU();const BU="/assets/food-CJrrJV5e.png",LU="/assets/Cafe-CK9UR25N.png",DU="/assets/dnovo-Cx0-1Yot.png",FU="/assets/island-C9q8X93B.png",NU=[{imageUrl:rU,name:"CSS",type:"Frontend"},{imageUrl:sU,name:"Express",type:"Backend"},{imageUrl:oU,name:"Git",type:"Version Control"},{imageUrl:aU,name:"GitHub",type:"Version Control"},{imageUrl:lU,name:"HTML",type:"Frontend"},{imageUrl:uU,name:"JavaScript",type:"Frontend"},{imageUrl:cU,name:"Node.js",type:"Backend"},{imageUrl:fU,name:"React",type:"Frontend"}],UU=[{title:"Ex-Intern",company_name:"Eisystem",date:"April 2024 - June 2024",points:["During my internship at Eisystems, I gained hands-on experience in JavaScript, which played a crucial role in helping me develop an e-commerce website. This opportunity allowed me to strengthen my skills in front-end development, user interaction, and responsive design. I worked on optimizing UI components, improving functionality, and ensuring a seamless shopping experience. This experience not only enhanced my technical proficiency but also deepened my understanding of real-world web development challenges."]},{title:"Summer Intern",company_name:"EduSkill",date:"July 2024 - Sep 2024",points:["Gained hands-on experience in the basics of Android development.","Worked with Android Studio, Dart, and Java for UI and functionality.","Developed and tested basic Android applications.","Learned about activity lifecycle, UI components, and API integration."]},{title:"Co-Founder/Web Designer",company_name:"De' Novo",date:"Dec 2025 - 2025",points:["Conceptualized and developed an online street-style clothing brand.","Collaborated with college peers to design and curate trendy apparel.","Researched market trends to align product offerings with customer preferences.","Worked on branding, website design, and social media marketing strategies."]}],OU=[{image:BU,theme:"btn-back-red",name:"Restaurant Website",description:"Developed a complete ordering system with admin and user roles, including a dashboard for business management.",link:"https://aditya-9944.github.io/e-commerce/"},{image:LU,theme:"btn-back-green",name:"Cafe UI",description:"Designed and developed a visually appealing café website using HTML, CSS, and JavaScript, focusing on an engaging user experience and responsive design.",link:"https://aditya-9944.github.io/Cafe/"},{image:DU,theme:"btn-back-blue",name:"De Novo",description:"Co-founded De Novo, an online clothing brand focused on street-style fashion, in collaboration with college peers. Developed the brand concept, curated trendy apparel designs, and worked on the website, UI/UX, and social media marketing to establish a strong digital presence.",link:"https://aditya-9944.github.io/Dnovo/"},{image:FU,theme:"btn-back-pink",name:"Three.js Portfolio",description:"Built a responsive multi-page React website using Three.js and Tailwind CSS, featuring interactive 3D elements, smooth navigation, and optimized performance.",link:"/"}],kU=()=>fe.jsxs("section",{className:"max-container",children:[fe.jsxs("h1",{className:"head-text",children:["Hello, I'm"," ",fe.jsxs("span",{className:"blue-gradient_text font-semibold drop-shadow",children:[" ","Aditya Pratap Singh"]})," ","👋"]}),fe.jsx("div",{className:"mt-5 flex flex-col gap-3 text-slate-500",children:fe.jsx("p",{children:"I’m a passionate UI/UX designer and full-stack developer with hands-on internship experience. My creativity drives me to design intuitive and user-friendly web experiences, and I have worked on both front-end and back-end development for various projects, including e-commerce platforms. I aspire to become a great coder, continuously learning and improving my skills. Beyond coding, I have a strong background in sports—I was a national football player, representing my school multiple times at the national level. My passion for extracurricular activities extends to art and chess, where I love exploring creativity and strategy. I’m always eager to collaborate, learn, and take on new challenges. Let’s connect and create something impactful together!"})}),fe.jsxs("div",{className:"py-10 flex flex-col",children:[fe.jsx("h3",{className:"subhead-text",children:"My Skills"}),fe.jsx("div",{className:"mt-16 flex flex-wrap gap-12",children:NU.map(i=>fe.jsxs("div",{className:"block-container w-20 h-20",children:[fe.jsx("div",{className:"btn-back rounded-xl"}),fe.jsx("div",{className:"btn-front rounded-xl flex justify-center items-center",children:fe.jsx("img",{src:i.imageUrl,alt:i.name,className:"w-1/2 h-1/2 object-contain"})})]},i.name))})]}),fe.jsxs("div",{className:"py-16",children:[fe.jsx("h3",{className:"subhead-text",children:"Work Experience"}),fe.jsx("div",{className:"mt-5 flex flex-col gap-3 text-slate-500",children:fe.jsx("p",{children:"As a motivated and creative fresher, I have gained hands-on experience through internships and entrepreneurial projects. My background includes UI/UX design, full-stack development, sales and marketing, and Android development. Additionally, I co-founded De Novo, an online street-style clothing brand, showcasing my ability to blend business, design, and technology. My internship experiences across various industries have helped me develop problem-solving, teamwork, and project management skills. I am eager to apply my knowledge and creativity to dynamic opportunities in the tech and business domains:"})}),fe.jsx("div",{className:"mt-12 flex",children:fe.jsx(x2.VerticalTimeline,{children:UU.map((i,e)=>fe.jsxs(x2.VerticalTimelineElement,{date:i.date,iconStyle:{background:i.iconBg},icon:fe.jsx("div",{className:"flex justify-center items-center w-full h-full",children:fe.jsx("div",{alt:i.company_name,className:"w-[60%] h-[60%] object-contain"})}),contentStyle:{borderBottom:"8px",borderStyle:"solid",borderBottomColor:i.iconBg,boxShadow:"none"},children:[fe.jsxs("div",{children:[fe.jsx("h3",{className:"text-black text-xl font-poppins font-semibold",children:i.title}),fe.jsx("p",{className:"text-black-500 font-medium text-base",style:{margin:0},children:i.company_name})]}),fe.jsx("ul",{className:"my-5 list-disc ml-5 space-y-2",children:i.points.map((t,n)=>fe.jsx("li",{className:"text-black-500/50 font-normal pl-1 text-sm",children:t},`experience-point-${n}`))})]},i.company_name))})})]}),fe.jsx("hr",{className:"border-slate-200"}),fe.jsxs("div",{className:"mt-10 flex justify-center gap-6",children:[fe.jsx("a",{href:"https://www.linkedin.com/in/aditya-pratap-singh-179638309/",target:"_blank",rel:"noopener noreferrer",className:"text-blue-600 hover:text-blue-800 text-xl font-bold",children:fe.jsx("img",{src:"https://cdn-icons-png.flaticon.com/512/174/174857.png",alt:"LinkedIn",className:"w-10 h-10 hover:opacity-80"})}),fe.jsx("a",{href:"https://github.com/dashboard",target:"_blank",rel:"noopener noreferrer",className:"text-gray-800 hover:text-gray-900 text-xl font-bold",children:fe.jsx("img",{src:"https://cdn-icons-png.flaticon.com/512/25/25231.png",alt:"GitHub",className:"w-10 h-10 hover:opacity-80"})}),fe.jsx("a",{href:"/Contact",target:"_blank",rel:"noopener noreferrer",className:"text-blue-500 hover:text-blue-700 text-xl font-bold",children:fe.jsx("img",{src:"https://cdn-icons-png.flaticon.com/512/732/732200.png",alt:"Gmail",className:"w-10 h-10 hover:opacity-80"})})]})]}),HU=()=>fe.jsxs("section",{className:"max-container",children:[fe.jsxs("h1",{className:"head-text",children:["My"," ",fe.jsx("span",{className:"blue-gradient_text drop-shadow font-semibold",children:"Projects"})]}),fe.jsx("p",{className:"text-slate-500 mt-2 leading-relaxed",children:"As a passionate developer and designer, I have worked on diverse projects ranging from UI/UX design to full-stack development. My projects include designing an admin dashboard, building a super responsive website for a clothing brand, and developing an e-commerce platform during my internship. Additionally, I have explored Android development, creating basic applications as part of my internship at EduSkill. Through these projects, I have gained experience in frontend and backend technologies, responsive design, and user-centered development."}),fe.jsx("div",{className:"flex flex-wrap my-20 gap-16",children:OU.map(i=>fe.jsxs("div",{className:"lg:w-[400px] w-full",children:[fe.jsxs("div",{className:"block-container",style:{width:"10rem",height:"6rem"},children:[fe.jsx("div",{className:`btn-back rounded-xl ${i.theme}`}),fe.jsx("div",{className:"btn-front",style:{display:"flex",justifyContent:"center",alignItems:"center",borderRadius:"0.75rem",overflow:"hidden"},children:fe.jsx("img",{src:i.image,alt:i.name,className:"w-full h-full object-cover"})})]}),fe.jsxs("div",{className:"mt-5 flex flex-col",children:[fe.jsx("h4",{className:"text-2xl font-poppins font-semibold",children:i.name}),fe.jsx("p",{className:"mt-2 text-slate-500",children:i.description}),fe.jsxs("div",{className:"mt-5 flex items-center gap-2 font-poppins",children:[fe.jsx(zf,{to:i.link,target:"_blank",rel:"noopener noreferrer",className:"font-semibold text-blue-600",children:"Live Link"}),fe.jsx("img",{src:Eg,alt:"arrow",className:"w-4 h-4 object-contain"})]})]})]},i.name))}),fe.jsx("hr",{className:"border-slate-200"})]});class Sp{constructor(e=0,t="Network Error"){this.status=e,this.text=t}}const zU=()=>{if(!(typeof localStorage>"u"))return{get:i=>Promise.resolve(localStorage.getItem(i)),set:(i,e)=>Promise.resolve(localStorage.setItem(i,e)),remove:i=>Promise.resolve(localStorage.removeItem(i))}},Xi={origin:"https://api.emailjs.com",blockHeadless:!1,storageProvider:zU()},qx=i=>i?typeof i=="string"?{publicKey:i}:i.toString()==="[object Object]"?i:{}:{},GU=(i,e="https://api.emailjs.com")=>{if(!i)return;const t=qx(i);Xi.publicKey=t.publicKey,Xi.blockHeadless=t.blockHeadless,Xi.storageProvider=t.storageProvider,Xi.blockList=t.blockList,Xi.limitRate=t.limitRate,Xi.origin=t.origin||e},Dw=async(i,e,t={})=>{const n=await fetch(Xi.origin+i,{method:"POST",headers:t,body:e}),r=await n.text(),s=new Sp(n.status,r);if(n.ok)return s;throw s},Fw=(i,e,t)=>{if(!i||typeof i!="string")throw"The public key is required. Visit https://dashboard.emailjs.com/admin/account";if(!e||typeof e!="string")throw"The service ID is required. Visit https://dashboard.emailjs.com/admin";if(!t||typeof t!="string")throw"The template ID is required. Visit https://dashboard.emailjs.com/admin/templates"},VU=i=>{if(i&&i.toString()!=="[object Object]")throw"The template params have to be the object. Visit https://www.emailjs.com/docs/sdk/send/"},Nw=i=>i.webdriver||!i.languages||i.languages.length===0,Uw=()=>new Sp(451,"Unavailable For Headless Browser"),WU=(i,e)=>{if(!Array.isArray(i))throw"The BlockList list has to be an array";if(typeof e!="string")throw"The BlockList watchVariable has to be a string"},XU=i=>{var e;return!((e=i.list)!=null&&e.length)||!i.watchVariable},jU=(i,e)=>i instanceof FormData?i.get(e):i[e],Ow=(i,e)=>{if(XU(i))return!1;WU(i.list,i.watchVariable);const t=jU(e,i.watchVariable);return typeof t!="string"?!1:i.list.includes(t)},kw=()=>new Sp(403,"Forbidden"),JU=(i,e)=>{if(typeof i!="number"||i<0)throw"The LimitRate throttle has to be a positive number";if(e&&typeof e!="string")throw"The LimitRate ID has to be a non-empty string"},KU=async(i,e,t)=>{const n=Number(await t.get(i)||0);return e-Date.now()+n},Hw=async(i,e,t)=>{if(!e.throttle||!t)return!1;JU(e.throttle,e.id);const n=e.id||i;return await KU(n,e.throttle,t)>0?!0:(await t.set(n,Date.now().toString()),!1)},zw=()=>new Sp(429,"Too Many Requests"),YU=async(i,e,t,n)=>{const r=qx(n),s=r.publicKey||Xi.publicKey,a=r.blockHeadless||Xi.blockHeadless,u=r.storageProvider||Xi.storageProvider,d={...Xi.blockList,...r.blockList},h={...Xi.limitRate,...r.limitRate};return a&&Nw(navigator)?Promise.reject(Uw()):(Fw(s,i,e),VU(t),t&&Ow(d,t)?Promise.reject(kw()):await Hw(location.pathname,h,u)?Promise.reject(zw()):Dw("/api/v1.0/email/send",JSON.stringify({lib_version:"4.4.1",user_id:s,service_id:i,template_id:e,template_params:t}),{"Content-type":"application/json"}))},QU=i=>{if(!i||i.nodeName!=="FORM")throw"The 3rd parameter is expected to be the HTML form element or the style selector of the form"},qU=i=>typeof i=="string"?document.querySelector(i):i,ZU=async(i,e,t,n)=>{const r=qx(n),s=r.publicKey||Xi.publicKey,a=r.blockHeadless||Xi.blockHeadless,u=Xi.storageProvider||r.storageProvider,d={...Xi.blockList,...r.blockList},h={...Xi.limitRate,...r.limitRate};if(a&&Nw(navigator))return Promise.reject(Uw());const m=qU(t);Fw(s,i,e),QU(m);const g=new FormData(m);return Ow(d,g)?Promise.reject(kw()):await Hw(location.pathname,h,u)?Promise.reject(zw()):(g.append("lib_version","4.4.1"),g.append("service_id",i),g.append("template_id",e),g.append("user_id",s),Dw("/api/v1.0/email/send-form",g))},$U={init:GU,send:YU,sendForm:ZU,EmailJSResponseStatus:Sp},Gw="/assets/fox-W5Giziuq.glb";function eO({currentAnimation:i,...e}){const t=Y.useRef(),{nodes:n,materials:r,animations:s}=Pa(Gw),{actions:a}=Rw(s,t);return Y.useEffect(()=>{Object.values(a).forEach(u=>u.stop()),a[i]&&a[i].play()},[a,i]),fe.jsx("group",{ref:t,...e,dispose:null,children:fe.jsxs("group",{name:"Sketchfab_Scene",children:[fe.jsx("primitive",{object:n.GLTF_created_0_rootJoint}),fe.jsx("skinnedMesh",{name:"Object_7",geometry:n.Object_7.geometry,material:r.PaletteMaterial001,skeleton:n.Object_7.skeleton}),fe.jsx("skinnedMesh",{name:"Object_8",geometry:n.Object_8.geometry,material:r.PaletteMaterial001,skeleton:n.Object_8.skeleton}),fe.jsx("skinnedMesh",{name:"Object_9",geometry:n.Object_9.geometry,material:r.PaletteMaterial001,skeleton:n.Object_9.skeleton}),fe.jsx("skinnedMesh",{name:"Object_10",geometry:n.Object_10.geometry,material:r.PaletteMaterial001,skeleton:n.Object_10.skeleton}),fe.jsx("skinnedMesh",{name:"Object_11",geometry:n.Object_11.geometry,material:r.PaletteMaterial001,skeleton:n.Object_11.skeleton})]})})}Pa.preload(Gw);const tO=()=>{const[i,e]=Y.useState({show:!1,text:"",type:"danger"});return{alert:i,showAlert:({text:r,type:s="danger"})=>e({show:!0,text:r,type:s}),hideAlert:()=>e({show:!1,text:"",type:"danger"})}},nO=({type:i,text:e})=>fe.jsx("div",{className:"absolute top-10 left-0 right-0 flex justify-center items-center",children:fe.jsxs("div",{className:`p-2 ${i==="danger"?"bg-red-800":"bg-blue-800"} items-center text-indigo-100 leading-none lg:rounded-full flex lg:inline-flex`,role:"alert",children:[fe.jsx("p",{className:`flex rounded-full ${i==="danger"?"bg-red-500":"bg-blue-500"} uppercase px-2 py-1 text-xs font-semibold mr-3`,children:i==="danger"?"Failed":"Success"}),fe.jsx("p",{className:"mr-2 text-left",children:e})]})}),iO=()=>{const i=Y.useRef(),[e,t]=Y.useState({name:"",email:"",message:""}),{alert:n,showAlert:r,hideAlert:s}=tO(),[a,u]=Y.useState(!1),[d,h]=Y.useState("idle"),m=({target:{name:A,value:C}})=>{t({...e,[A]:C})},g=()=>h("walk"),v=()=>h("idle"),_=A=>{A.preventDefault(),u(!0),h("hit"),$U.send("service_m4drfn7","template_wv4hjra",{from_name:e.name,to_name:"dcj",from_email:e.email,to_email:"adiyaps2024@gmail.com",message:e.message},"WyDj8a4pgNoOZOavN").then(()=>{u(!1),r({show:!0,text:"Thank you for your message 😃",type:"success"}),setTimeout(()=>{s(!1),h("idle"),t({name:"",email:"",message:""})},[3e3])},C=>{u(!1),console.error(C),h("idle"),r({show:!0,text:"I didn't receive your message 😢",type:"danger"})})};return console.log("Service ID:","service_m4drfn7"),console.log("Template ID:","template_wv4hjra"),console.log("Public Key:","WyDj8a4pgNoOZOavN"),fe.jsxs("section",{className:"relative flex lg:flex-row flex-col max-container",children:[n.show&&fe.jsx(nO,{...n}),fe.jsxs("div",{className:"flex-1 min-w-[50%] flex flex-col",children:[fe.jsx("h1",{className:"head-text",children:"Get in Touch"}),fe.jsxs("form",{ref:i,onSubmit:_,className:"w-full flex flex-col gap-7 mt-14",children:[fe.jsxs("label",{className:"text-black-500 font-semibold",children:["Name",fe.jsx("input",{type:"text",name:"name",className:"input",placeholder:"Aditya",required:!0,value:e.name,onChange:m,onFocus:g,onBlur:v})]}),fe.jsxs("label",{className:"text-black-500 font-semibold",children:["Email",fe.jsx("input",{type:"email",name:"email",className:"input",placeholder:"aditya@gmail.com",required:!0,value:e.email,onChange:m,onFocus:g,onBlur:v})]}),fe.jsxs("label",{className:"text-black-500 font-semibold",children:["Your Message",fe.jsx("textarea",{name:"message",rows:"4",className:"textarea",placeholder:"Write your thoughts here...",value:e.message,onChange:m,onFocus:g,onBlur:v})]}),fe.jsx("button",{type:"submit",disabled:a,className:"btn",onFocus:g,onBlur:v,children:a?"Sending...":"Submit"})]})]}),fe.jsx("div",{className:"lg:w-1/2 w-full lg:h-auto md:h-[550px] h-[350px]",children:fe.jsxs(nw,{camera:{position:[0,0,5],fov:75,near:.1,far:1e3},children:[fe.jsx("directionalLight",{position:[0,0,1],intensity:2.5}),fe.jsx("ambientLight",{intensity:1}),fe.jsx("pointLight",{position:[5,10,0],intensity:2}),fe.jsx("spotLight",{position:[10,10,10],angle:.15,penumbra:1,intensity:2}),fe.jsx(Y.Suspense,{fallback:fe.jsx(Pw,{}),children:fe.jsx(eO,{currentAnimation:d,position:[.5,.35,0],rotation:[12.629,-.6,0],scale:[.5,.5,.5]})})]})})]})},rO=()=>fe.jsx("main",{className:"bg-slate-300/20 min-h-screen",children:fe.jsxs(UT,{children:[fe.jsx(jT,{}),fe.jsxs(hT,{children:[fe.jsx(Eh,{path:"/",element:fe.jsx(yU,{})}),fe.jsx(Eh,{path:"/about",element:fe.jsx(kU,{})}),fe.jsx(Eh,{path:"/projects",element:fe.jsx(HU,{})}),fe.jsx(Eh,{path:"/contact",element:fe.jsx(iO,{})})]})]})});A2.createRoot(document.getElementById("root")).render(fe.jsx(Y.StrictMode,{children:fe.jsx(rO,{})}));
