var oF=Object.defineProperty;var aF=(n,e,t)=>e in n?oF(n,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):n[e]=t;var Cs=(n,e,t)=>(aF(n,typeof e!="symbol"?e+"":e,t),t);function lF(n,e){for(var t=0;t<e.length;t++){const i=e[t];if(typeof i!="string"&&!Array.isArray(i)){for(const r in i)if(r!=="default"&&!(r in n)){const s=Object.getOwnPropertyDescriptor(i,r);s&&Object.defineProperty(n,r,s.get?s:{enumerable:!0,get:()=>i[r]})}}}return Object.freeze(Object.defineProperty(n,Symbol.toStringTag,{value:"Module"}))}(function(){const e=document.createElement("link").relList;if(e&&e.supports&&e.supports("modulepreload"))return;for(const r of document.querySelectorAll('link[rel="modulepreload"]'))i(r);new MutationObserver(r=>{for(const s of r)if(s.type==="childList")for(const o of s.addedNodes)o.tagName==="LINK"&&o.rel==="modulepreload"&&i(o)}).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 i(r){if(r.ep)return;r.ep=!0;const s=t(r);fetch(r.href,s)}})();function su(n){return n&&n.__esModule&&Object.prototype.hasOwnProperty.call(n,"default")?n.default:n}var Ob={exports:{}},lg={},Ub={exports:{}},Et={};/**
 * @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 gh=Symbol.for("react.element"),cF=Symbol.for("react.portal"),uF=Symbol.for("react.fragment"),fF=Symbol.for("react.strict_mode"),hF=Symbol.for("react.profiler"),dF=Symbol.for("react.provider"),pF=Symbol.for("react.context"),mF=Symbol.for("react.forward_ref"),gF=Symbol.for("react.suspense"),vF=Symbol.for("react.memo"),yF=Symbol.for("react.lazy"),rE=Symbol.iterator;function xF(n){return n===null||typeof n!="object"?null:(n=rE&&n[rE]||n["@@iterator"],typeof n=="function"?n:null)}var kb={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},Hb=Object.assign,zb={};function ou(n,e,t){this.props=n,this.context=e,this.refs=zb,this.updater=t||kb}ou.prototype.isReactComponent={};ou.prototype.setState=function(n,e){if(typeof n!="object"&&typeof n!="function"&&n!=null)throw Error("setState(...): takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,n,e,"setState")};ou.prototype.forceUpdate=function(n){this.updater.enqueueForceUpdate(this,n,"forceUpdate")};function Gb(){}Gb.prototype=ou.prototype;function lA(n,e,t){this.props=n,this.context=e,this.refs=zb,this.updater=t||kb}var cA=lA.prototype=new Gb;cA.constructor=lA;Hb(cA,ou.prototype);cA.isPureReactComponent=!0;var sE=Array.isArray,Vb=Object.prototype.hasOwnProperty,uA={current:null},Wb={key:!0,ref:!0,__self:!0,__source:!0};function jb(n,e,t){var i,r={},s=null,o=null;if(e!=null)for(i in e.ref!==void 0&&(o=e.ref),e.key!==void 0&&(s=""+e.key),e)Vb.call(e,i)&&!Wb.hasOwnProperty(i)&&(r[i]=e[i]);var a=arguments.length-2;if(a===1)r.children=t;else if(1<a){for(var l=Array(a),u=0;u<a;u++)l[u]=arguments[u+2];r.children=l}if(n&&n.defaultProps)for(i in a=n.defaultProps,a)r[i]===void 0&&(r[i]=a[i]);return{$$typeof:gh,type:n,key:s,ref:o,props:r,_owner:uA.current}}function _F(n,e){return{$$typeof:gh,type:n.type,key:e,ref:n.ref,props:n.props,_owner:n._owner}}function fA(n){return typeof n=="object"&&n!==null&&n.$$typeof===gh}function AF(n){var e={"=":"=0",":":"=2"};return"$"+n.replace(/[=:]/g,function(t){return e[t]})}var oE=/\/+/g;function vv(n,e){return typeof n=="object"&&n!==null&&n.key!=null?AF(""+n.key):e.toString(36)}function $p(n,e,t,i,r){var s=typeof n;(s==="undefined"||s==="boolean")&&(n=null);var o=!1;if(n===null)o=!0;else switch(s){case"string":case"number":o=!0;break;case"object":switch(n.$$typeof){case gh:case cF:o=!0}}if(o)return o=n,r=r(o),n=i===""?"."+vv(o,0):i,sE(r)?(t="",n!=null&&(t=n.replace(oE,"$&/")+"/"),$p(r,e,t,"",function(u){return u})):r!=null&&(fA(r)&&(r=_F(r,t+(!r.key||o&&o.key===r.key?"":(""+r.key).replace(oE,"$&/")+"/")+n)),e.push(r)),1;if(o=0,i=i===""?".":i+":",sE(n))for(var a=0;a<n.length;a++){s=n[a];var l=i+vv(s,a);o+=$p(s,e,t,l,r)}else if(l=xF(n),typeof l=="function")for(n=l.call(n),a=0;!(s=n.next()).done;)s=s.value,l=i+vv(s,a++),o+=$p(s,e,t,l,r);else if(s==="object")throw e=String(n),Error("Objects are not valid as a React child (found: "+(e==="[object Object]"?"object with keys {"+Object.keys(n).join(", ")+"}":e)+"). If you meant to render a collection of children, use an array instead.");return o}function zd(n,e,t){if(n==null)return n;var i=[],r=0;return $p(n,i,"","",function(s){return e.call(t,s,r++)}),i}function SF(n){if(n._status===-1){var e=n._result;e=e(),e.then(function(t){(n._status===0||n._status===-1)&&(n._status=1,n._result=t)},function(t){(n._status===0||n._status===-1)&&(n._status=2,n._result=t)}),n._status===-1&&(n._status=0,n._result=e)}if(n._status===1)return n._result.default;throw n._result}var yi={current:null},em={transition:null},MF={ReactCurrentDispatcher:yi,ReactCurrentBatchConfig:em,ReactCurrentOwner:uA};Et.Children={map:zd,forEach:function(n,e,t){zd(n,function(){e.apply(this,arguments)},t)},count:function(n){var e=0;return zd(n,function(){e++}),e},toArray:function(n){return zd(n,function(e){return e})||[]},only:function(n){if(!fA(n))throw Error("React.Children.only expected to receive a single React element child.");return n}};Et.Component=ou;Et.Fragment=uF;Et.Profiler=hF;Et.PureComponent=lA;Et.StrictMode=fF;Et.Suspense=gF;Et.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=MF;Et.cloneElement=function(n,e,t){if(n==null)throw Error("React.cloneElement(...): The argument must be a React element, but you passed "+n+".");var i=Hb({},n.props),r=n.key,s=n.ref,o=n._owner;if(e!=null){if(e.ref!==void 0&&(s=e.ref,o=uA.current),e.key!==void 0&&(r=""+e.key),n.type&&n.type.defaultProps)var a=n.type.defaultProps;for(l in e)Vb.call(e,l)&&!Wb.hasOwnProperty(l)&&(i[l]=e[l]===void 0&&a!==void 0?a[l]:e[l])}var l=arguments.length-2;if(l===1)i.children=t;else if(1<l){a=Array(l);for(var u=0;u<l;u++)a[u]=arguments[u+2];i.children=a}return{$$typeof:gh,type:n.type,key:r,ref:s,props:i,_owner:o}};Et.createContext=function(n){return n={$$typeof:pF,_currentValue:n,_currentValue2:n,_threadCount:0,Provider:null,Consumer:null,_defaultValue:null,_globalName:null},n.Provider={$$typeof:dF,_context:n},n.Consumer=n};Et.createElement=jb;Et.createFactory=function(n){var e=jb.bind(null,n);return e.type=n,e};Et.createRef=function(){return{current:null}};Et.forwardRef=function(n){return{$$typeof:mF,render:n}};Et.isValidElement=fA;Et.lazy=function(n){return{$$typeof:yF,_payload:{_status:-1,_result:n},_init:SF}};Et.memo=function(n,e){return{$$typeof:vF,type:n,compare:e===void 0?null:e}};Et.startTransition=function(n){var e=em.transition;em.transition={};try{n()}finally{em.transition=e}};Et.unstable_act=function(){throw Error("act(...) is not supported in production builds of React.")};Et.useCallback=function(n,e){return yi.current.useCallback(n,e)};Et.useContext=function(n){return yi.current.useContext(n)};Et.useDebugValue=function(){};Et.useDeferredValue=function(n){return yi.current.useDeferredValue(n)};Et.useEffect=function(n,e){return yi.current.useEffect(n,e)};Et.useId=function(){return yi.current.useId()};Et.useImperativeHandle=function(n,e,t){return yi.current.useImperativeHandle(n,e,t)};Et.useInsertionEffect=function(n,e){return yi.current.useInsertionEffect(n,e)};Et.useLayoutEffect=function(n,e){return yi.current.useLayoutEffect(n,e)};Et.useMemo=function(n,e){return yi.current.useMemo(n,e)};Et.useReducer=function(n,e,t){return yi.current.useReducer(n,e,t)};Et.useRef=function(n){return yi.current.useRef(n)};Et.useState=function(n){return yi.current.useState(n)};Et.useSyncExternalStore=function(n,e,t){return yi.current.useSyncExternalStore(n,e,t)};Et.useTransition=function(){return yi.current.useTransition()};Et.version="18.2.0";Ub.exports=Et;var J=Ub.exports;const zt=su(J),EF=lF({__proto__:null,default:zt},[J]);/**
 * @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 wF=J,TF=Symbol.for("react.element"),CF=Symbol.for("react.fragment"),bF=Object.prototype.hasOwnProperty,RF=wF.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,PF={key:!0,ref:!0,__self:!0,__source:!0};function Xb(n,e,t){var i,r={},s=null,o=null;t!==void 0&&(s=""+t),e.key!==void 0&&(s=""+e.key),e.ref!==void 0&&(o=e.ref);for(i in e)bF.call(e,i)&&!PF.hasOwnProperty(i)&&(r[i]=e[i]);if(n&&n.defaultProps)for(i in e=n.defaultProps,e)r[i]===void 0&&(r[i]=e[i]);return{$$typeof:TF,type:n,key:s,ref:o,props:r,_owner:RF.current}}lg.Fragment=CF;lg.jsx=Xb;lg.jsxs=Xb;Ob.exports=lg;var se=Ob.exports,ex={},Jb={exports:{}},Zi={},Kb={exports:{}},Yb={};/**
 * @license React
 * scheduler.production.min.js
 *
 * Copyright (c) Facebook, Inc. and its affiliates.
 *
 * This source code is licensed under the MIT license found in the
 * LICENSE file in the root directory of this source tree.
 */(function(n){function e(I,V){var H=I.length;I.push(V);e:for(;0<H;){var U=H-1>>>1,W=I[U];if(0<r(W,V))I[U]=V,I[H]=W,H=U;else break e}}function t(I){return I.length===0?null:I[0]}function i(I){if(I.length===0)return null;var V=I[0],H=I.pop();if(H!==V){I[0]=H;e:for(var U=0,W=I.length,ve=W>>>1;U<ve;){var ue=2*(U+1)-1,Ae=I[ue],Ee=ue+1,Ne=I[Ee];if(0>r(Ae,H))Ee<W&&0>r(Ne,Ae)?(I[U]=Ne,I[Ee]=H,U=Ee):(I[U]=Ae,I[ue]=H,U=ue);else if(Ee<W&&0>r(Ne,H))I[U]=Ne,I[Ee]=H,U=Ee;else break e}}return V}function r(I,V){var H=I.sortIndex-V.sortIndex;return H!==0?H:I.id-V.id}if(typeof performance=="object"&&typeof performance.now=="function"){var s=performance;n.unstable_now=function(){return s.now()}}else{var o=Date,a=o.now();n.unstable_now=function(){return o.now()-a}}var l=[],u=[],h=1,d=null,p=3,m=!1,y=!1,M=!1,_=typeof setTimeout=="function"?setTimeout:null,g=typeof clearTimeout=="function"?clearTimeout:null,x=typeof setImmediate<"u"?setImmediate:null;typeof navigator<"u"&&navigator.scheduling!==void 0&&navigator.scheduling.isInputPending!==void 0&&navigator.scheduling.isInputPending.bind(navigator.scheduling);function S(I){for(var V=t(u);V!==null;){if(V.callback===null)i(u);else if(V.startTime<=I)i(u),V.sortIndex=V.expirationTime,e(l,V);else break;V=t(u)}}function E(I){if(M=!1,S(I),!y)if(t(l)!==null)y=!0,ne(C);else{var V=t(u);V!==null&&ee(E,V.startTime-I)}}function C(I,V){y=!1,M&&(M=!1,g(B),B=-1),m=!0;var H=p;try{for(S(V),d=t(l);d!==null&&(!(d.expirationTime>V)||I&&!z());){var U=d.callback;if(typeof U=="function"){d.callback=null,p=d.priorityLevel;var W=U(d.expirationTime<=V);V=n.unstable_now(),typeof W=="function"?d.callback=W:d===t(l)&&i(l),S(V)}else i(l);d=t(l)}if(d!==null)var ve=!0;else{var ue=t(u);ue!==null&&ee(E,ue.startTime-V),ve=!1}return ve}finally{d=null,p=H,m=!1}}var b=!1,P=null,B=-1,R=5,L=-1;function z(){return!(n.unstable_now()-L<R)}function $(){if(P!==null){var I=n.unstable_now();L=I;var V=!0;try{V=P(!0,I)}finally{V?X():(b=!1,P=null)}}else b=!1}var X;if(typeof x=="function")X=function(){x($)};else if(typeof MessageChannel<"u"){var Q=new MessageChannel,Y=Q.port2;Q.port1.onmessage=$,X=function(){Y.postMessage(null)}}else X=function(){_($,0)};function ne(I){P=I,b||(b=!0,X())}function ee(I,V){B=_(function(){I(n.unstable_now())},V)}n.unstable_IdlePriority=5,n.unstable_ImmediatePriority=1,n.unstable_LowPriority=4,n.unstable_NormalPriority=3,n.unstable_Profiling=null,n.unstable_UserBlockingPriority=2,n.unstable_cancelCallback=function(I){I.callback=null},n.unstable_continueExecution=function(){y||m||(y=!0,ne(C))},n.unstable_forceFrameRate=function(I){0>I||125<I?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):R=0<I?Math.floor(1e3/I):5},n.unstable_getCurrentPriorityLevel=function(){return p},n.unstable_getFirstCallbackNode=function(){return t(l)},n.unstable_next=function(I){switch(p){case 1:case 2:case 3:var V=3;break;default:V=p}var H=p;p=V;try{return I()}finally{p=H}},n.unstable_pauseExecution=function(){},n.unstable_requestPaint=function(){},n.unstable_runWithPriority=function(I,V){switch(I){case 1:case 2:case 3:case 4:case 5:break;default:I=3}var H=p;p=I;try{return V()}finally{p=H}},n.unstable_scheduleCallback=function(I,V,H){var U=n.unstable_now();switch(typeof H=="object"&&H!==null?(H=H.delay,H=typeof H=="number"&&0<H?U+H:U):H=U,I){case 1:var W=-1;break;case 2:W=250;break;case 5:W=1073741823;break;case 4:W=1e4;break;default:W=5e3}return W=H+W,I={id:h++,callback:V,priorityLevel:I,startTime:H,expirationTime:W,sortIndex:-1},H>U?(I.sortIndex=H,e(u,I),t(l)===null&&I===t(u)&&(M?(g(B),B=-1):M=!0,ee(E,H-U))):(I.sortIndex=W,e(l,I),y||m||(y=!0,ne(C))),I},n.unstable_shouldYield=z,n.unstable_wrapCallback=function(I){var V=p;return function(){var H=p;p=V;try{return I.apply(this,arguments)}finally{p=H}}}})(Yb);Kb.exports=Yb;var BF=Kb.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 Qb=J,Ki=BF;function Ce(n){for(var e="https://reactjs.org/docs/error-decoder.html?invariant="+n,t=1;t<arguments.length;t++)e+="&args[]="+encodeURIComponent(arguments[t]);return"Minified React error #"+n+"; visit "+e+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}var Zb=new Set,Ff={};function ll(n,e){Hc(n,e),Hc(n+"Capture",e)}function Hc(n,e){for(Ff[n]=e,n=0;n<e.length;n++)Zb.add(e[n])}var Js=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),tx=Object.prototype.hasOwnProperty,LF=/^[: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]*$/,aE={},lE={};function IF(n){return tx.call(lE,n)?!0:tx.call(aE,n)?!1:LF.test(n)?lE[n]=!0:(aE[n]=!0,!1)}function DF(n,e,t,i){if(t!==null&&t.type===0)return!1;switch(typeof e){case"function":case"symbol":return!0;case"boolean":return i?!1:t!==null?!t.acceptsBooleans:(n=n.toLowerCase().slice(0,5),n!=="data-"&&n!=="aria-");default:return!1}}function FF(n,e,t,i){if(e===null||typeof e>"u"||DF(n,e,t,i))return!0;if(i)return!1;if(t!==null)switch(t.type){case 3:return!e;case 4:return e===!1;case 5:return isNaN(e);case 6:return isNaN(e)||1>e}return!1}function xi(n,e,t,i,r,s,o){this.acceptsBooleans=e===2||e===3||e===4,this.attributeName=i,this.attributeNamespace=r,this.mustUseProperty=t,this.propertyName=n,this.type=e,this.sanitizeURL=s,this.removeEmptyString=o}var Kn={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(n){Kn[n]=new xi(n,0,!1,n,null,!1,!1)});[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(function(n){var e=n[0];Kn[e]=new xi(e,1,!1,n[1],null,!1,!1)});["contentEditable","draggable","spellCheck","value"].forEach(function(n){Kn[n]=new xi(n,2,!1,n.toLowerCase(),null,!1,!1)});["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(n){Kn[n]=new xi(n,2,!1,n,null,!1,!1)});"allowFullScreen async autoFocus autoPlay controls default defer disabled disablePictureInPicture disableRemotePlayback formNoValidate hidden loop noModule noValidate open playsInline readOnly required reversed scoped seamless itemScope".split(" ").forEach(function(n){Kn[n]=new xi(n,3,!1,n.toLowerCase(),null,!1,!1)});["checked","multiple","muted","selected"].forEach(function(n){Kn[n]=new xi(n,3,!0,n,null,!1,!1)});["capture","download"].forEach(function(n){Kn[n]=new xi(n,4,!1,n,null,!1,!1)});["cols","rows","size","span"].forEach(function(n){Kn[n]=new xi(n,6,!1,n,null,!1,!1)});["rowSpan","start"].forEach(function(n){Kn[n]=new xi(n,5,!1,n.toLowerCase(),null,!1,!1)});var hA=/[\-:]([a-z])/g;function dA(n){return n[1].toUpperCase()}"accent-height alignment-baseline arabic-form baseline-shift cap-height clip-path clip-rule color-interpolation color-interpolation-filters color-profile color-rendering dominant-baseline enable-background fill-opacity fill-rule flood-color flood-opacity font-family font-size font-size-adjust font-stretch font-style font-variant font-weight glyph-name glyph-orientation-horizontal glyph-orientation-vertical horiz-adv-x horiz-origin-x image-rendering letter-spacing lighting-color marker-end marker-mid marker-start overline-position overline-thickness paint-order panose-1 pointer-events rendering-intent shape-rendering stop-color stop-opacity strikethrough-position strikethrough-thickness stroke-dasharray stroke-dashoffset stroke-linecap stroke-linejoin stroke-miterlimit stroke-opacity stroke-width text-anchor text-decoration text-rendering underline-position underline-thickness unicode-bidi unicode-range units-per-em v-alphabetic v-hanging v-ideographic v-mathematical vector-effect vert-adv-y vert-origin-x vert-origin-y word-spacing writing-mode xmlns:xlink x-height".split(" ").forEach(function(n){var e=n.replace(hA,dA);Kn[e]=new xi(e,1,!1,n,null,!1,!1)});"xlink:actuate xlink:arcrole xlink:role xlink:show xlink:title xlink:type".split(" ").forEach(function(n){var e=n.replace(hA,dA);Kn[e]=new xi(e,1,!1,n,"http://www.w3.org/1999/xlink",!1,!1)});["xml:base","xml:lang","xml:space"].forEach(function(n){var e=n.replace(hA,dA);Kn[e]=new xi(e,1,!1,n,"http://www.w3.org/XML/1998/namespace",!1,!1)});["tabIndex","crossOrigin"].forEach(function(n){Kn[n]=new xi(n,1,!1,n.toLowerCase(),null,!1,!1)});Kn.xlinkHref=new xi("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1);["src","href","action","formAction"].forEach(function(n){Kn[n]=new xi(n,1,!1,n.toLowerCase(),null,!0,!0)});function pA(n,e,t,i){var r=Kn.hasOwnProperty(e)?Kn[e]:null;(r!==null?r.type!==0:i||!(2<e.length)||e[0]!=="o"&&e[0]!=="O"||e[1]!=="n"&&e[1]!=="N")&&(FF(e,t,r,i)&&(t=null),i||r===null?IF(e)&&(t===null?n.removeAttribute(e):n.setAttribute(e,""+t)):r.mustUseProperty?n[r.propertyName]=t===null?r.type===3?!1:"":t:(e=r.attributeName,i=r.attributeNamespace,t===null?n.removeAttribute(e):(r=r.type,t=r===3||r===4&&t===!0?"":""+t,i?n.setAttributeNS(i,e,t):n.setAttribute(e,t))))}var eo=Qb.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED,Gd=Symbol.for("react.element"),rc=Symbol.for("react.portal"),sc=Symbol.for("react.fragment"),mA=Symbol.for("react.strict_mode"),nx=Symbol.for("react.profiler"),qb=Symbol.for("react.provider"),$b=Symbol.for("react.context"),gA=Symbol.for("react.forward_ref"),ix=Symbol.for("react.suspense"),rx=Symbol.for("react.suspense_list"),vA=Symbol.for("react.memo"),_o=Symbol.for("react.lazy"),eR=Symbol.for("react.offscreen"),cE=Symbol.iterator;function Du(n){return n===null||typeof n!="object"?null:(n=cE&&n[cE]||n["@@iterator"],typeof n=="function"?n:null)}var cn=Object.assign,yv;function uf(n){if(yv===void 0)try{throw Error()}catch(t){var e=t.stack.trim().match(/\n( *(at )?)/);yv=e&&e[1]||""}return`
`+yv+n}var xv=!1;function _v(n,e){if(!n||xv)return"";xv=!0;var t=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{if(e)if(e=function(){throw Error()},Object.defineProperty(e.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(e,[])}catch(u){var i=u}Reflect.construct(n,[],e)}else{try{e.call()}catch(u){i=u}n.call(e.prototype)}else{try{throw Error()}catch(u){i=u}n()}}catch(u){if(u&&i&&typeof u.stack=="string"){for(var r=u.stack.split(`
`),s=i.stack.split(`
`),o=r.length-1,a=s.length-1;1<=o&&0<=a&&r[o]!==s[a];)a--;for(;1<=o&&0<=a;o--,a--)if(r[o]!==s[a]){if(o!==1||a!==1)do if(o--,a--,0>a||r[o]!==s[a]){var l=`
`+r[o].replace(" at new "," at ");return n.displayName&&l.includes("<anonymous>")&&(l=l.replace("<anonymous>",n.displayName)),l}while(1<=o&&0<=a);break}}}finally{xv=!1,Error.prepareStackTrace=t}return(n=n?n.displayName||n.name:"")?uf(n):""}function NF(n){switch(n.tag){case 5:return uf(n.type);case 16:return uf("Lazy");case 13:return uf("Suspense");case 19:return uf("SuspenseList");case 0:case 2:case 15:return n=_v(n.type,!1),n;case 11:return n=_v(n.type.render,!1),n;case 1:return n=_v(n.type,!0),n;default:return""}}function sx(n){if(n==null)return null;if(typeof n=="function")return n.displayName||n.name||null;if(typeof n=="string")return n;switch(n){case sc:return"Fragment";case rc:return"Portal";case nx:return"Profiler";case mA:return"StrictMode";case ix:return"Suspense";case rx:return"SuspenseList"}if(typeof n=="object")switch(n.$$typeof){case $b:return(n.displayName||"Context")+".Consumer";case qb:return(n._context.displayName||"Context")+".Provider";case gA:var e=n.render;return n=n.displayName,n||(n=e.displayName||e.name||"",n=n!==""?"ForwardRef("+n+")":"ForwardRef"),n;case vA:return e=n.displayName||null,e!==null?e:sx(n.type)||"Memo";case _o:e=n._payload,n=n._init;try{return sx(n(e))}catch{}}return null}function OF(n){var e=n.type;switch(n.tag){case 24:return"Cache";case 9:return(e.displayName||"Context")+".Consumer";case 10:return(e._context.displayName||"Context")+".Provider";case 18:return"DehydratedFragment";case 11:return n=e.render,n=n.displayName||n.name||"",e.displayName||(n!==""?"ForwardRef("+n+")":"ForwardRef");case 7:return"Fragment";case 5:return e;case 4:return"Portal";case 3:return"Root";case 6:return"Text";case 16:return sx(e);case 8:return e===mA?"StrictMode":"Mode";case 22:return"Offscreen";case 12:return"Profiler";case 21:return"Scope";case 13:return"Suspense";case 19:return"SuspenseList";case 25:return"TracingMarker";case 1:case 0:case 17:case 2:case 14:case 15:if(typeof e=="function")return e.displayName||e.name||null;if(typeof e=="string")return e}return null}function Wo(n){switch(typeof n){case"boolean":case"number":case"string":case"undefined":return n;case"object":return n;default:return""}}function tR(n){var e=n.type;return(n=n.nodeName)&&n.toLowerCase()==="input"&&(e==="checkbox"||e==="radio")}function UF(n){var e=tR(n)?"checked":"value",t=Object.getOwnPropertyDescriptor(n.constructor.prototype,e),i=""+n[e];if(!n.hasOwnProperty(e)&&typeof t<"u"&&typeof t.get=="function"&&typeof t.set=="function"){var r=t.get,s=t.set;return Object.defineProperty(n,e,{configurable:!0,get:function(){return r.call(this)},set:function(o){i=""+o,s.call(this,o)}}),Object.defineProperty(n,e,{enumerable:t.enumerable}),{getValue:function(){return i},setValue:function(o){i=""+o},stopTracking:function(){n._valueTracker=null,delete n[e]}}}}function Vd(n){n._valueTracker||(n._valueTracker=UF(n))}function nR(n){if(!n)return!1;var e=n._valueTracker;if(!e)return!0;var t=e.getValue(),i="";return n&&(i=tR(n)?n.checked?"true":"false":n.value),n=i,n!==t?(e.setValue(n),!0):!1}function Mm(n){if(n=n||(typeof document<"u"?document:void 0),typeof n>"u")return null;try{return n.activeElement||n.body}catch{return n.body}}function ox(n,e){var t=e.checked;return cn({},e,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:t??n._wrapperState.initialChecked})}function uE(n,e){var t=e.defaultValue==null?"":e.defaultValue,i=e.checked!=null?e.checked:e.defaultChecked;t=Wo(e.value!=null?e.value:t),n._wrapperState={initialChecked:i,initialValue:t,controlled:e.type==="checkbox"||e.type==="radio"?e.checked!=null:e.value!=null}}function iR(n,e){e=e.checked,e!=null&&pA(n,"checked",e,!1)}function ax(n,e){iR(n,e);var t=Wo(e.value),i=e.type;if(t!=null)i==="number"?(t===0&&n.value===""||n.value!=t)&&(n.value=""+t):n.value!==""+t&&(n.value=""+t);else if(i==="submit"||i==="reset"){n.removeAttribute("value");return}e.hasOwnProperty("value")?lx(n,e.type,t):e.hasOwnProperty("defaultValue")&&lx(n,e.type,Wo(e.defaultValue)),e.checked==null&&e.defaultChecked!=null&&(n.defaultChecked=!!e.defaultChecked)}function fE(n,e,t){if(e.hasOwnProperty("value")||e.hasOwnProperty("defaultValue")){var i=e.type;if(!(i!=="submit"&&i!=="reset"||e.value!==void 0&&e.value!==null))return;e=""+n._wrapperState.initialValue,t||e===n.value||(n.value=e),n.defaultValue=e}t=n.name,t!==""&&(n.name=""),n.defaultChecked=!!n._wrapperState.initialChecked,t!==""&&(n.name=t)}function lx(n,e,t){(e!=="number"||Mm(n.ownerDocument)!==n)&&(t==null?n.defaultValue=""+n._wrapperState.initialValue:n.defaultValue!==""+t&&(n.defaultValue=""+t))}var ff=Array.isArray;function wc(n,e,t,i){if(n=n.options,e){e={};for(var r=0;r<t.length;r++)e["$"+t[r]]=!0;for(t=0;t<n.length;t++)r=e.hasOwnProperty("$"+n[t].value),n[t].selected!==r&&(n[t].selected=r),r&&i&&(n[t].defaultSelected=!0)}else{for(t=""+Wo(t),e=null,r=0;r<n.length;r++){if(n[r].value===t){n[r].selected=!0,i&&(n[r].defaultSelected=!0);return}e!==null||n[r].disabled||(e=n[r])}e!==null&&(e.selected=!0)}}function cx(n,e){if(e.dangerouslySetInnerHTML!=null)throw Error(Ce(91));return cn({},e,{value:void 0,defaultValue:void 0,children:""+n._wrapperState.initialValue})}function hE(n,e){var t=e.value;if(t==null){if(t=e.children,e=e.defaultValue,t!=null){if(e!=null)throw Error(Ce(92));if(ff(t)){if(1<t.length)throw Error(Ce(93));t=t[0]}e=t}e==null&&(e=""),t=e}n._wrapperState={initialValue:Wo(t)}}function rR(n,e){var t=Wo(e.value),i=Wo(e.defaultValue);t!=null&&(t=""+t,t!==n.value&&(n.value=t),e.defaultValue==null&&n.defaultValue!==t&&(n.defaultValue=t)),i!=null&&(n.defaultValue=""+i)}function dE(n){var e=n.textContent;e===n._wrapperState.initialValue&&e!==""&&e!==null&&(n.value=e)}function sR(n){switch(n){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 ux(n,e){return n==null||n==="http://www.w3.org/1999/xhtml"?sR(e):n==="http://www.w3.org/2000/svg"&&e==="foreignObject"?"http://www.w3.org/1999/xhtml":n}var Wd,oR=function(n){return typeof MSApp<"u"&&MSApp.execUnsafeLocalFunction?function(e,t,i,r){MSApp.execUnsafeLocalFunction(function(){return n(e,t,i,r)})}:n}(function(n,e){if(n.namespaceURI!=="http://www.w3.org/2000/svg"||"innerHTML"in n)n.innerHTML=e;else{for(Wd=Wd||document.createElement("div"),Wd.innerHTML="<svg>"+e.valueOf().toString()+"</svg>",e=Wd.firstChild;n.firstChild;)n.removeChild(n.firstChild);for(;e.firstChild;)n.appendChild(e.firstChild)}});function Nf(n,e){if(e){var t=n.firstChild;if(t&&t===n.lastChild&&t.nodeType===3){t.nodeValue=e;return}}n.textContent=e}var vf={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},kF=["Webkit","ms","Moz","O"];Object.keys(vf).forEach(function(n){kF.forEach(function(e){e=e+n.charAt(0).toUpperCase()+n.substring(1),vf[e]=vf[n]})});function aR(n,e,t){return e==null||typeof e=="boolean"||e===""?"":t||typeof e!="number"||e===0||vf.hasOwnProperty(n)&&vf[n]?(""+e).trim():e+"px"}function lR(n,e){n=n.style;for(var t in e)if(e.hasOwnProperty(t)){var i=t.indexOf("--")===0,r=aR(t,e[t],i);t==="float"&&(t="cssFloat"),i?n.setProperty(t,r):n[t]=r}}var HF=cn({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 fx(n,e){if(e){if(HF[n]&&(e.children!=null||e.dangerouslySetInnerHTML!=null))throw Error(Ce(137,n));if(e.dangerouslySetInnerHTML!=null){if(e.children!=null)throw Error(Ce(60));if(typeof e.dangerouslySetInnerHTML!="object"||!("__html"in e.dangerouslySetInnerHTML))throw Error(Ce(61))}if(e.style!=null&&typeof e.style!="object")throw Error(Ce(62))}}function hx(n,e){if(n.indexOf("-")===-1)return typeof e.is=="string";switch(n){case"annotation-xml":case"color-profile":case"font-face":case"font-face-src":case"font-face-uri":case"font-face-format":case"font-face-name":case"missing-glyph":return!1;default:return!0}}var dx=null;function yA(n){return n=n.target||n.srcElement||window,n.correspondingUseElement&&(n=n.correspondingUseElement),n.nodeType===3?n.parentNode:n}var px=null,Tc=null,Cc=null;function pE(n){if(n=xh(n)){if(typeof px!="function")throw Error(Ce(280));var e=n.stateNode;e&&(e=dg(e),px(n.stateNode,n.type,e))}}function cR(n){Tc?Cc?Cc.push(n):Cc=[n]:Tc=n}function uR(){if(Tc){var n=Tc,e=Cc;if(Cc=Tc=null,pE(n),e)for(n=0;n<e.length;n++)pE(e[n])}}function fR(n,e){return n(e)}function hR(){}var Av=!1;function dR(n,e,t){if(Av)return n(e,t);Av=!0;try{return fR(n,e,t)}finally{Av=!1,(Tc!==null||Cc!==null)&&(hR(),uR())}}function Of(n,e){var t=n.stateNode;if(t===null)return null;var i=dg(t);if(i===null)return null;t=i[e];e:switch(e){case"onClick":case"onClickCapture":case"onDoubleClick":case"onDoubleClickCapture":case"onMouseDown":case"onMouseDownCapture":case"onMouseMove":case"onMouseMoveCapture":case"onMouseUp":case"onMouseUpCapture":case"onMouseEnter":(i=!i.disabled)||(n=n.type,i=!(n==="button"||n==="input"||n==="select"||n==="textarea")),n=!i;break e;default:n=!1}if(n)return null;if(t&&typeof t!="function")throw Error(Ce(231,e,typeof t));return t}var mx=!1;if(Js)try{var Fu={};Object.defineProperty(Fu,"passive",{get:function(){mx=!0}}),window.addEventListener("test",Fu,Fu),window.removeEventListener("test",Fu,Fu)}catch{mx=!1}function zF(n,e,t,i,r,s,o,a,l){var u=Array.prototype.slice.call(arguments,3);try{e.apply(t,u)}catch(h){this.onError(h)}}var yf=!1,Em=null,wm=!1,gx=null,GF={onError:function(n){yf=!0,Em=n}};function VF(n,e,t,i,r,s,o,a,l){yf=!1,Em=null,zF.apply(GF,arguments)}function WF(n,e,t,i,r,s,o,a,l){if(VF.apply(this,arguments),yf){if(yf){var u=Em;yf=!1,Em=null}else throw Error(Ce(198));wm||(wm=!0,gx=u)}}function cl(n){var e=n,t=n;if(n.alternate)for(;e.return;)e=e.return;else{n=e;do e=n,e.flags&4098&&(t=e.return),n=e.return;while(n)}return e.tag===3?t:null}function pR(n){if(n.tag===13){var e=n.memoizedState;if(e===null&&(n=n.alternate,n!==null&&(e=n.memoizedState)),e!==null)return e.dehydrated}return null}function mE(n){if(cl(n)!==n)throw Error(Ce(188))}function jF(n){var e=n.alternate;if(!e){if(e=cl(n),e===null)throw Error(Ce(188));return e!==n?null:n}for(var t=n,i=e;;){var r=t.return;if(r===null)break;var s=r.alternate;if(s===null){if(i=r.return,i!==null){t=i;continue}break}if(r.child===s.child){for(s=r.child;s;){if(s===t)return mE(r),n;if(s===i)return mE(r),e;s=s.sibling}throw Error(Ce(188))}if(t.return!==i.return)t=r,i=s;else{for(var o=!1,a=r.child;a;){if(a===t){o=!0,t=r,i=s;break}if(a===i){o=!0,i=r,t=s;break}a=a.sibling}if(!o){for(a=s.child;a;){if(a===t){o=!0,t=s,i=r;break}if(a===i){o=!0,i=s,t=r;break}a=a.sibling}if(!o)throw Error(Ce(189))}}if(t.alternate!==i)throw Error(Ce(190))}if(t.tag!==3)throw Error(Ce(188));return t.stateNode.current===t?n:e}function mR(n){return n=jF(n),n!==null?gR(n):null}function gR(n){if(n.tag===5||n.tag===6)return n;for(n=n.child;n!==null;){var e=gR(n);if(e!==null)return e;n=n.sibling}return null}var vR=Ki.unstable_scheduleCallback,gE=Ki.unstable_cancelCallback,XF=Ki.unstable_shouldYield,JF=Ki.unstable_requestPaint,xn=Ki.unstable_now,KF=Ki.unstable_getCurrentPriorityLevel,xA=Ki.unstable_ImmediatePriority,yR=Ki.unstable_UserBlockingPriority,Tm=Ki.unstable_NormalPriority,YF=Ki.unstable_LowPriority,xR=Ki.unstable_IdlePriority,cg=null,us=null;function QF(n){if(us&&typeof us.onCommitFiberRoot=="function")try{us.onCommitFiberRoot(cg,n,void 0,(n.current.flags&128)===128)}catch{}}var Or=Math.clz32?Math.clz32:$F,ZF=Math.log,qF=Math.LN2;function $F(n){return n>>>=0,n===0?32:31-(ZF(n)/qF|0)|0}var jd=64,Xd=4194304;function hf(n){switch(n&-n){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return n&4194240;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return n&130023424;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 1073741824;default:return n}}function Cm(n,e){var t=n.pendingLanes;if(t===0)return 0;var i=0,r=n.suspendedLanes,s=n.pingedLanes,o=t&268435455;if(o!==0){var a=o&~r;a!==0?i=hf(a):(s&=o,s!==0&&(i=hf(s)))}else o=t&~r,o!==0?i=hf(o):s!==0&&(i=hf(s));if(i===0)return 0;if(e!==0&&e!==i&&!(e&r)&&(r=i&-i,s=e&-e,r>=s||r===16&&(s&4194240)!==0))return e;if(i&4&&(i|=t&16),e=n.entangledLanes,e!==0)for(n=n.entanglements,e&=i;0<e;)t=31-Or(e),r=1<<t,i|=n[t],e&=~r;return i}function eN(n,e){switch(n){case 1:case 2:case 4:return e+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 e+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 tN(n,e){for(var t=n.suspendedLanes,i=n.pingedLanes,r=n.expirationTimes,s=n.pendingLanes;0<s;){var o=31-Or(s),a=1<<o,l=r[o];l===-1?(!(a&t)||a&i)&&(r[o]=eN(a,e)):l<=e&&(n.expiredLanes|=a),s&=~a}}function vx(n){return n=n.pendingLanes&-1073741825,n!==0?n:n&1073741824?1073741824:0}function _R(){var n=jd;return jd<<=1,!(jd&4194240)&&(jd=64),n}function Sv(n){for(var e=[],t=0;31>t;t++)e.push(n);return e}function vh(n,e,t){n.pendingLanes|=e,e!==536870912&&(n.suspendedLanes=0,n.pingedLanes=0),n=n.eventTimes,e=31-Or(e),n[e]=t}function nN(n,e){var t=n.pendingLanes&~e;n.pendingLanes=e,n.suspendedLanes=0,n.pingedLanes=0,n.expiredLanes&=e,n.mutableReadLanes&=e,n.entangledLanes&=e,e=n.entanglements;var i=n.eventTimes;for(n=n.expirationTimes;0<t;){var r=31-Or(t),s=1<<r;e[r]=0,i[r]=-1,n[r]=-1,t&=~s}}function _A(n,e){var t=n.entangledLanes|=e;for(n=n.entanglements;t;){var i=31-Or(t),r=1<<i;r&e|n[i]&e&&(n[i]|=e),t&=~r}}var Ot=0;function AR(n){return n&=-n,1<n?4<n?n&268435455?16:536870912:4:1}var SR,AA,MR,ER,wR,yx=!1,Jd=[],Ro=null,Po=null,Bo=null,Uf=new Map,kf=new Map,wo=[],iN="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 vE(n,e){switch(n){case"focusin":case"focusout":Ro=null;break;case"dragenter":case"dragleave":Po=null;break;case"mouseover":case"mouseout":Bo=null;break;case"pointerover":case"pointerout":Uf.delete(e.pointerId);break;case"gotpointercapture":case"lostpointercapture":kf.delete(e.pointerId)}}function Nu(n,e,t,i,r,s){return n===null||n.nativeEvent!==s?(n={blockedOn:e,domEventName:t,eventSystemFlags:i,nativeEvent:s,targetContainers:[r]},e!==null&&(e=xh(e),e!==null&&AA(e)),n):(n.eventSystemFlags|=i,e=n.targetContainers,r!==null&&e.indexOf(r)===-1&&e.push(r),n)}function rN(n,e,t,i,r){switch(e){case"focusin":return Ro=Nu(Ro,n,e,t,i,r),!0;case"dragenter":return Po=Nu(Po,n,e,t,i,r),!0;case"mouseover":return Bo=Nu(Bo,n,e,t,i,r),!0;case"pointerover":var s=r.pointerId;return Uf.set(s,Nu(Uf.get(s)||null,n,e,t,i,r)),!0;case"gotpointercapture":return s=r.pointerId,kf.set(s,Nu(kf.get(s)||null,n,e,t,i,r)),!0}return!1}function TR(n){var e=Na(n.target);if(e!==null){var t=cl(e);if(t!==null){if(e=t.tag,e===13){if(e=pR(t),e!==null){n.blockedOn=e,wR(n.priority,function(){MR(t)});return}}else if(e===3&&t.stateNode.current.memoizedState.isDehydrated){n.blockedOn=t.tag===3?t.stateNode.containerInfo:null;return}}}n.blockedOn=null}function tm(n){if(n.blockedOn!==null)return!1;for(var e=n.targetContainers;0<e.length;){var t=xx(n.domEventName,n.eventSystemFlags,e[0],n.nativeEvent);if(t===null){t=n.nativeEvent;var i=new t.constructor(t.type,t);dx=i,t.target.dispatchEvent(i),dx=null}else return e=xh(t),e!==null&&AA(e),n.blockedOn=t,!1;e.shift()}return!0}function yE(n,e,t){tm(n)&&t.delete(e)}function sN(){yx=!1,Ro!==null&&tm(Ro)&&(Ro=null),Po!==null&&tm(Po)&&(Po=null),Bo!==null&&tm(Bo)&&(Bo=null),Uf.forEach(yE),kf.forEach(yE)}function Ou(n,e){n.blockedOn===e&&(n.blockedOn=null,yx||(yx=!0,Ki.unstable_scheduleCallback(Ki.unstable_NormalPriority,sN)))}function Hf(n){function e(r){return Ou(r,n)}if(0<Jd.length){Ou(Jd[0],n);for(var t=1;t<Jd.length;t++){var i=Jd[t];i.blockedOn===n&&(i.blockedOn=null)}}for(Ro!==null&&Ou(Ro,n),Po!==null&&Ou(Po,n),Bo!==null&&Ou(Bo,n),Uf.forEach(e),kf.forEach(e),t=0;t<wo.length;t++)i=wo[t],i.blockedOn===n&&(i.blockedOn=null);for(;0<wo.length&&(t=wo[0],t.blockedOn===null);)TR(t),t.blockedOn===null&&wo.shift()}var bc=eo.ReactCurrentBatchConfig,bm=!0;function oN(n,e,t,i){var r=Ot,s=bc.transition;bc.transition=null;try{Ot=1,SA(n,e,t,i)}finally{Ot=r,bc.transition=s}}function aN(n,e,t,i){var r=Ot,s=bc.transition;bc.transition=null;try{Ot=4,SA(n,e,t,i)}finally{Ot=r,bc.transition=s}}function SA(n,e,t,i){if(bm){var r=xx(n,e,t,i);if(r===null)Lv(n,e,i,Rm,t),vE(n,i);else if(rN(r,n,e,t,i))i.stopPropagation();else if(vE(n,i),e&4&&-1<iN.indexOf(n)){for(;r!==null;){var s=xh(r);if(s!==null&&SR(s),s=xx(n,e,t,i),s===null&&Lv(n,e,i,Rm,t),s===r)break;r=s}r!==null&&i.stopPropagation()}else Lv(n,e,i,null,t)}}var Rm=null;function xx(n,e,t,i){if(Rm=null,n=yA(i),n=Na(n),n!==null)if(e=cl(n),e===null)n=null;else if(t=e.tag,t===13){if(n=pR(e),n!==null)return n;n=null}else if(t===3){if(e.stateNode.current.memoizedState.isDehydrated)return e.tag===3?e.stateNode.containerInfo:null;n=null}else e!==n&&(n=null);return Rm=n,null}function CR(n){switch(n){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(KF()){case xA:return 1;case yR:return 4;case Tm:case YF:return 16;case xR:return 536870912;default:return 16}default:return 16}}var Co=null,MA=null,nm=null;function bR(){if(nm)return nm;var n,e=MA,t=e.length,i,r="value"in Co?Co.value:Co.textContent,s=r.length;for(n=0;n<t&&e[n]===r[n];n++);var o=t-n;for(i=1;i<=o&&e[t-i]===r[s-i];i++);return nm=r.slice(n,1<i?1-i:void 0)}function im(n){var e=n.keyCode;return"charCode"in n?(n=n.charCode,n===0&&e===13&&(n=13)):n=e,n===10&&(n=13),32<=n||n===13?n:0}function Kd(){return!0}function xE(){return!1}function qi(n){function e(t,i,r,s,o){this._reactName=t,this._targetInst=r,this.type=i,this.nativeEvent=s,this.target=o,this.currentTarget=null;for(var a in n)n.hasOwnProperty(a)&&(t=n[a],this[a]=t?t(s):s[a]);return this.isDefaultPrevented=(s.defaultPrevented!=null?s.defaultPrevented:s.returnValue===!1)?Kd:xE,this.isPropagationStopped=xE,this}return cn(e.prototype,{preventDefault:function(){this.defaultPrevented=!0;var t=this.nativeEvent;t&&(t.preventDefault?t.preventDefault():typeof t.returnValue!="unknown"&&(t.returnValue=!1),this.isDefaultPrevented=Kd)},stopPropagation:function(){var t=this.nativeEvent;t&&(t.stopPropagation?t.stopPropagation():typeof t.cancelBubble!="unknown"&&(t.cancelBubble=!0),this.isPropagationStopped=Kd)},persist:function(){},isPersistent:Kd}),e}var au={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(n){return n.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},EA=qi(au),yh=cn({},au,{view:0,detail:0}),lN=qi(yh),Mv,Ev,Uu,ug=cn({},yh,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:wA,button:0,buttons:0,relatedTarget:function(n){return n.relatedTarget===void 0?n.fromElement===n.srcElement?n.toElement:n.fromElement:n.relatedTarget},movementX:function(n){return"movementX"in n?n.movementX:(n!==Uu&&(Uu&&n.type==="mousemove"?(Mv=n.screenX-Uu.screenX,Ev=n.screenY-Uu.screenY):Ev=Mv=0,Uu=n),Mv)},movementY:function(n){return"movementY"in n?n.movementY:Ev}}),_E=qi(ug),cN=cn({},ug,{dataTransfer:0}),uN=qi(cN),fN=cn({},yh,{relatedTarget:0}),wv=qi(fN),hN=cn({},au,{animationName:0,elapsedTime:0,pseudoElement:0}),dN=qi(hN),pN=cn({},au,{clipboardData:function(n){return"clipboardData"in n?n.clipboardData:window.clipboardData}}),mN=qi(pN),gN=cn({},au,{data:0}),AE=qi(gN),vN={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},yN={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"},xN={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function _N(n){var e=this.nativeEvent;return e.getModifierState?e.getModifierState(n):(n=xN[n])?!!e[n]:!1}function wA(){return _N}var AN=cn({},yh,{key:function(n){if(n.key){var e=vN[n.key]||n.key;if(e!=="Unidentified")return e}return n.type==="keypress"?(n=im(n),n===13?"Enter":String.fromCharCode(n)):n.type==="keydown"||n.type==="keyup"?yN[n.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:wA,charCode:function(n){return n.type==="keypress"?im(n):0},keyCode:function(n){return n.type==="keydown"||n.type==="keyup"?n.keyCode:0},which:function(n){return n.type==="keypress"?im(n):n.type==="keydown"||n.type==="keyup"?n.keyCode:0}}),SN=qi(AN),MN=cn({},ug,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),SE=qi(MN),EN=cn({},yh,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:wA}),wN=qi(EN),TN=cn({},au,{propertyName:0,elapsedTime:0,pseudoElement:0}),CN=qi(TN),bN=cn({},ug,{deltaX:function(n){return"deltaX"in n?n.deltaX:"wheelDeltaX"in n?-n.wheelDeltaX:0},deltaY:function(n){return"deltaY"in n?n.deltaY:"wheelDeltaY"in n?-n.wheelDeltaY:"wheelDelta"in n?-n.wheelDelta:0},deltaZ:0,deltaMode:0}),RN=qi(bN),PN=[9,13,27,32],TA=Js&&"CompositionEvent"in window,xf=null;Js&&"documentMode"in document&&(xf=document.documentMode);var BN=Js&&"TextEvent"in window&&!xf,RR=Js&&(!TA||xf&&8<xf&&11>=xf),ME=String.fromCharCode(32),EE=!1;function PR(n,e){switch(n){case"keyup":return PN.indexOf(e.keyCode)!==-1;case"keydown":return e.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function BR(n){return n=n.detail,typeof n=="object"&&"data"in n?n.data:null}var oc=!1;function LN(n,e){switch(n){case"compositionend":return BR(e);case"keypress":return e.which!==32?null:(EE=!0,ME);case"textInput":return n=e.data,n===ME&&EE?null:n;default:return null}}function IN(n,e){if(oc)return n==="compositionend"||!TA&&PR(n,e)?(n=bR(),nm=MA=Co=null,oc=!1,n):null;switch(n){case"paste":return null;case"keypress":if(!(e.ctrlKey||e.altKey||e.metaKey)||e.ctrlKey&&e.altKey){if(e.char&&1<e.char.length)return e.char;if(e.which)return String.fromCharCode(e.which)}return null;case"compositionend":return RR&&e.locale!=="ko"?null:e.data;default:return null}}var DN={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 wE(n){var e=n&&n.nodeName&&n.nodeName.toLowerCase();return e==="input"?!!DN[n.type]:e==="textarea"}function LR(n,e,t,i){cR(i),e=Pm(e,"onChange"),0<e.length&&(t=new EA("onChange","change",null,t,i),n.push({event:t,listeners:e}))}var _f=null,zf=null;function FN(n){VR(n,0)}function fg(n){var e=cc(n);if(nR(e))return n}function NN(n,e){if(n==="change")return e}var IR=!1;if(Js){var Tv;if(Js){var Cv="oninput"in document;if(!Cv){var TE=document.createElement("div");TE.setAttribute("oninput","return;"),Cv=typeof TE.oninput=="function"}Tv=Cv}else Tv=!1;IR=Tv&&(!document.documentMode||9<document.documentMode)}function CE(){_f&&(_f.detachEvent("onpropertychange",DR),zf=_f=null)}function DR(n){if(n.propertyName==="value"&&fg(zf)){var e=[];LR(e,zf,n,yA(n)),dR(FN,e)}}function ON(n,e,t){n==="focusin"?(CE(),_f=e,zf=t,_f.attachEvent("onpropertychange",DR)):n==="focusout"&&CE()}function UN(n){if(n==="selectionchange"||n==="keyup"||n==="keydown")return fg(zf)}function kN(n,e){if(n==="click")return fg(e)}function HN(n,e){if(n==="input"||n==="change")return fg(e)}function zN(n,e){return n===e&&(n!==0||1/n===1/e)||n!==n&&e!==e}var Gr=typeof Object.is=="function"?Object.is:zN;function Gf(n,e){if(Gr(n,e))return!0;if(typeof n!="object"||n===null||typeof e!="object"||e===null)return!1;var t=Object.keys(n),i=Object.keys(e);if(t.length!==i.length)return!1;for(i=0;i<t.length;i++){var r=t[i];if(!tx.call(e,r)||!Gr(n[r],e[r]))return!1}return!0}function bE(n){for(;n&&n.firstChild;)n=n.firstChild;return n}function RE(n,e){var t=bE(n);n=0;for(var i;t;){if(t.nodeType===3){if(i=n+t.textContent.length,n<=e&&i>=e)return{node:t,offset:e-n};n=i}e:{for(;t;){if(t.nextSibling){t=t.nextSibling;break e}t=t.parentNode}t=void 0}t=bE(t)}}function FR(n,e){return n&&e?n===e?!0:n&&n.nodeType===3?!1:e&&e.nodeType===3?FR(n,e.parentNode):"contains"in n?n.contains(e):n.compareDocumentPosition?!!(n.compareDocumentPosition(e)&16):!1:!1}function NR(){for(var n=window,e=Mm();e instanceof n.HTMLIFrameElement;){try{var t=typeof e.contentWindow.location.href=="string"}catch{t=!1}if(t)n=e.contentWindow;else break;e=Mm(n.document)}return e}function CA(n){var e=n&&n.nodeName&&n.nodeName.toLowerCase();return e&&(e==="input"&&(n.type==="text"||n.type==="search"||n.type==="tel"||n.type==="url"||n.type==="password")||e==="textarea"||n.contentEditable==="true")}function GN(n){var e=NR(),t=n.focusedElem,i=n.selectionRange;if(e!==t&&t&&t.ownerDocument&&FR(t.ownerDocument.documentElement,t)){if(i!==null&&CA(t)){if(e=i.start,n=i.end,n===void 0&&(n=e),"selectionStart"in t)t.selectionStart=e,t.selectionEnd=Math.min(n,t.value.length);else if(n=(e=t.ownerDocument||document)&&e.defaultView||window,n.getSelection){n=n.getSelection();var r=t.textContent.length,s=Math.min(i.start,r);i=i.end===void 0?s:Math.min(i.end,r),!n.extend&&s>i&&(r=i,i=s,s=r),r=RE(t,s);var o=RE(t,i);r&&o&&(n.rangeCount!==1||n.anchorNode!==r.node||n.anchorOffset!==r.offset||n.focusNode!==o.node||n.focusOffset!==o.offset)&&(e=e.createRange(),e.setStart(r.node,r.offset),n.removeAllRanges(),s>i?(n.addRange(e),n.extend(o.node,o.offset)):(e.setEnd(o.node,o.offset),n.addRange(e)))}}for(e=[],n=t;n=n.parentNode;)n.nodeType===1&&e.push({element:n,left:n.scrollLeft,top:n.scrollTop});for(typeof t.focus=="function"&&t.focus(),t=0;t<e.length;t++)n=e[t],n.element.scrollLeft=n.left,n.element.scrollTop=n.top}}var VN=Js&&"documentMode"in document&&11>=document.documentMode,ac=null,_x=null,Af=null,Ax=!1;function PE(n,e,t){var i=t.window===t?t.document:t.nodeType===9?t:t.ownerDocument;Ax||ac==null||ac!==Mm(i)||(i=ac,"selectionStart"in i&&CA(i)?i={start:i.selectionStart,end:i.selectionEnd}:(i=(i.ownerDocument&&i.ownerDocument.defaultView||window).getSelection(),i={anchorNode:i.anchorNode,anchorOffset:i.anchorOffset,focusNode:i.focusNode,focusOffset:i.focusOffset}),Af&&Gf(Af,i)||(Af=i,i=Pm(_x,"onSelect"),0<i.length&&(e=new EA("onSelect","select",null,e,t),n.push({event:e,listeners:i}),e.target=ac)))}function Yd(n,e){var t={};return t[n.toLowerCase()]=e.toLowerCase(),t["Webkit"+n]="webkit"+e,t["Moz"+n]="moz"+e,t}var lc={animationend:Yd("Animation","AnimationEnd"),animationiteration:Yd("Animation","AnimationIteration"),animationstart:Yd("Animation","AnimationStart"),transitionend:Yd("Transition","TransitionEnd")},bv={},OR={};Js&&(OR=document.createElement("div").style,"AnimationEvent"in window||(delete lc.animationend.animation,delete lc.animationiteration.animation,delete lc.animationstart.animation),"TransitionEvent"in window||delete lc.transitionend.transition);function hg(n){if(bv[n])return bv[n];if(!lc[n])return n;var e=lc[n],t;for(t in e)if(e.hasOwnProperty(t)&&t in OR)return bv[n]=e[t];return n}var UR=hg("animationend"),kR=hg("animationiteration"),HR=hg("animationstart"),zR=hg("transitionend"),GR=new Map,BE="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 $o(n,e){GR.set(n,e),ll(e,[n])}for(var Rv=0;Rv<BE.length;Rv++){var Pv=BE[Rv],WN=Pv.toLowerCase(),jN=Pv[0].toUpperCase()+Pv.slice(1);$o(WN,"on"+jN)}$o(UR,"onAnimationEnd");$o(kR,"onAnimationIteration");$o(HR,"onAnimationStart");$o("dblclick","onDoubleClick");$o("focusin","onFocus");$o("focusout","onBlur");$o(zR,"onTransitionEnd");Hc("onMouseEnter",["mouseout","mouseover"]);Hc("onMouseLeave",["mouseout","mouseover"]);Hc("onPointerEnter",["pointerout","pointerover"]);Hc("onPointerLeave",["pointerout","pointerover"]);ll("onChange","change click focusin focusout input keydown keyup selectionchange".split(" "));ll("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" "));ll("onBeforeInput",["compositionend","keypress","textInput","paste"]);ll("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" "));ll("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" "));ll("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var df="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(" "),XN=new Set("cancel close invalid load scroll toggle".split(" ").concat(df));function LE(n,e,t){var i=n.type||"unknown-event";n.currentTarget=t,WF(i,e,void 0,n),n.currentTarget=null}function VR(n,e){e=(e&4)!==0;for(var t=0;t<n.length;t++){var i=n[t],r=i.event;i=i.listeners;e:{var s=void 0;if(e)for(var o=i.length-1;0<=o;o--){var a=i[o],l=a.instance,u=a.currentTarget;if(a=a.listener,l!==s&&r.isPropagationStopped())break e;LE(r,a,u),s=l}else for(o=0;o<i.length;o++){if(a=i[o],l=a.instance,u=a.currentTarget,a=a.listener,l!==s&&r.isPropagationStopped())break e;LE(r,a,u),s=l}}}if(wm)throw n=gx,wm=!1,gx=null,n}function Jt(n,e){var t=e[Tx];t===void 0&&(t=e[Tx]=new Set);var i=n+"__bubble";t.has(i)||(WR(e,n,2,!1),t.add(i))}function Bv(n,e,t){var i=0;e&&(i|=4),WR(t,n,i,e)}var Qd="_reactListening"+Math.random().toString(36).slice(2);function Vf(n){if(!n[Qd]){n[Qd]=!0,Zb.forEach(function(t){t!=="selectionchange"&&(XN.has(t)||Bv(t,!1,n),Bv(t,!0,n))});var e=n.nodeType===9?n:n.ownerDocument;e===null||e[Qd]||(e[Qd]=!0,Bv("selectionchange",!1,e))}}function WR(n,e,t,i){switch(CR(e)){case 1:var r=oN;break;case 4:r=aN;break;default:r=SA}t=r.bind(null,e,t,n),r=void 0,!mx||e!=="touchstart"&&e!=="touchmove"&&e!=="wheel"||(r=!0),i?r!==void 0?n.addEventListener(e,t,{capture:!0,passive:r}):n.addEventListener(e,t,!0):r!==void 0?n.addEventListener(e,t,{passive:r}):n.addEventListener(e,t,!1)}function Lv(n,e,t,i,r){var s=i;if(!(e&1)&&!(e&2)&&i!==null)e:for(;;){if(i===null)return;var o=i.tag;if(o===3||o===4){var a=i.stateNode.containerInfo;if(a===r||a.nodeType===8&&a.parentNode===r)break;if(o===4)for(o=i.return;o!==null;){var l=o.tag;if((l===3||l===4)&&(l=o.stateNode.containerInfo,l===r||l.nodeType===8&&l.parentNode===r))return;o=o.return}for(;a!==null;){if(o=Na(a),o===null)return;if(l=o.tag,l===5||l===6){i=s=o;continue e}a=a.parentNode}}i=i.return}dR(function(){var u=s,h=yA(t),d=[];e:{var p=GR.get(n);if(p!==void 0){var m=EA,y=n;switch(n){case"keypress":if(im(t)===0)break e;case"keydown":case"keyup":m=SN;break;case"focusin":y="focus",m=wv;break;case"focusout":y="blur",m=wv;break;case"beforeblur":case"afterblur":m=wv;break;case"click":if(t.button===2)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":m=_E;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":m=uN;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":m=wN;break;case UR:case kR:case HR:m=dN;break;case zR:m=CN;break;case"scroll":m=lN;break;case"wheel":m=RN;break;case"copy":case"cut":case"paste":m=mN;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":m=SE}var M=(e&4)!==0,_=!M&&n==="scroll",g=M?p!==null?p+"Capture":null:p;M=[];for(var x=u,S;x!==null;){S=x;var E=S.stateNode;if(S.tag===5&&E!==null&&(S=E,g!==null&&(E=Of(x,g),E!=null&&M.push(Wf(x,E,S)))),_)break;x=x.return}0<M.length&&(p=new m(p,y,null,t,h),d.push({event:p,listeners:M}))}}if(!(e&7)){e:{if(p=n==="mouseover"||n==="pointerover",m=n==="mouseout"||n==="pointerout",p&&t!==dx&&(y=t.relatedTarget||t.fromElement)&&(Na(y)||y[Ks]))break e;if((m||p)&&(p=h.window===h?h:(p=h.ownerDocument)?p.defaultView||p.parentWindow:window,m?(y=t.relatedTarget||t.toElement,m=u,y=y?Na(y):null,y!==null&&(_=cl(y),y!==_||y.tag!==5&&y.tag!==6)&&(y=null)):(m=null,y=u),m!==y)){if(M=_E,E="onMouseLeave",g="onMouseEnter",x="mouse",(n==="pointerout"||n==="pointerover")&&(M=SE,E="onPointerLeave",g="onPointerEnter",x="pointer"),_=m==null?p:cc(m),S=y==null?p:cc(y),p=new M(E,x+"leave",m,t,h),p.target=_,p.relatedTarget=S,E=null,Na(h)===u&&(M=new M(g,x+"enter",y,t,h),M.target=S,M.relatedTarget=_,E=M),_=E,m&&y)t:{for(M=m,g=y,x=0,S=M;S;S=Pl(S))x++;for(S=0,E=g;E;E=Pl(E))S++;for(;0<x-S;)M=Pl(M),x--;for(;0<S-x;)g=Pl(g),S--;for(;x--;){if(M===g||g!==null&&M===g.alternate)break t;M=Pl(M),g=Pl(g)}M=null}else M=null;m!==null&&IE(d,p,m,M,!1),y!==null&&_!==null&&IE(d,_,y,M,!0)}}e:{if(p=u?cc(u):window,m=p.nodeName&&p.nodeName.toLowerCase(),m==="select"||m==="input"&&p.type==="file")var C=NN;else if(wE(p))if(IR)C=HN;else{C=UN;var b=ON}else(m=p.nodeName)&&m.toLowerCase()==="input"&&(p.type==="checkbox"||p.type==="radio")&&(C=kN);if(C&&(C=C(n,u))){LR(d,C,t,h);break e}b&&b(n,p,u),n==="focusout"&&(b=p._wrapperState)&&b.controlled&&p.type==="number"&&lx(p,"number",p.value)}switch(b=u?cc(u):window,n){case"focusin":(wE(b)||b.contentEditable==="true")&&(ac=b,_x=u,Af=null);break;case"focusout":Af=_x=ac=null;break;case"mousedown":Ax=!0;break;case"contextmenu":case"mouseup":case"dragend":Ax=!1,PE(d,t,h);break;case"selectionchange":if(VN)break;case"keydown":case"keyup":PE(d,t,h)}var P;if(TA)e:{switch(n){case"compositionstart":var B="onCompositionStart";break e;case"compositionend":B="onCompositionEnd";break e;case"compositionupdate":B="onCompositionUpdate";break e}B=void 0}else oc?PR(n,t)&&(B="onCompositionEnd"):n==="keydown"&&t.keyCode===229&&(B="onCompositionStart");B&&(RR&&t.locale!=="ko"&&(oc||B!=="onCompositionStart"?B==="onCompositionEnd"&&oc&&(P=bR()):(Co=h,MA="value"in Co?Co.value:Co.textContent,oc=!0)),b=Pm(u,B),0<b.length&&(B=new AE(B,n,null,t,h),d.push({event:B,listeners:b}),P?B.data=P:(P=BR(t),P!==null&&(B.data=P)))),(P=BN?LN(n,t):IN(n,t))&&(u=Pm(u,"onBeforeInput"),0<u.length&&(h=new AE("onBeforeInput","beforeinput",null,t,h),d.push({event:h,listeners:u}),h.data=P))}VR(d,e)})}function Wf(n,e,t){return{instance:n,listener:e,currentTarget:t}}function Pm(n,e){for(var t=e+"Capture",i=[];n!==null;){var r=n,s=r.stateNode;r.tag===5&&s!==null&&(r=s,s=Of(n,t),s!=null&&i.unshift(Wf(n,s,r)),s=Of(n,e),s!=null&&i.push(Wf(n,s,r))),n=n.return}return i}function Pl(n){if(n===null)return null;do n=n.return;while(n&&n.tag!==5);return n||null}function IE(n,e,t,i,r){for(var s=e._reactName,o=[];t!==null&&t!==i;){var a=t,l=a.alternate,u=a.stateNode;if(l!==null&&l===i)break;a.tag===5&&u!==null&&(a=u,r?(l=Of(t,s),l!=null&&o.unshift(Wf(t,l,a))):r||(l=Of(t,s),l!=null&&o.push(Wf(t,l,a)))),t=t.return}o.length!==0&&n.push({event:e,listeners:o})}var JN=/\r\n?/g,KN=/\u0000|\uFFFD/g;function DE(n){return(typeof n=="string"?n:""+n).replace(JN,`
`).replace(KN,"")}function Zd(n,e,t){if(e=DE(e),DE(n)!==e&&t)throw Error(Ce(425))}function Bm(){}var Sx=null,Mx=null;function Ex(n,e){return n==="textarea"||n==="noscript"||typeof e.children=="string"||typeof e.children=="number"||typeof e.dangerouslySetInnerHTML=="object"&&e.dangerouslySetInnerHTML!==null&&e.dangerouslySetInnerHTML.__html!=null}var wx=typeof setTimeout=="function"?setTimeout:void 0,YN=typeof clearTimeout=="function"?clearTimeout:void 0,FE=typeof Promise=="function"?Promise:void 0,QN=typeof queueMicrotask=="function"?queueMicrotask:typeof FE<"u"?function(n){return FE.resolve(null).then(n).catch(ZN)}:wx;function ZN(n){setTimeout(function(){throw n})}function Iv(n,e){var t=e,i=0;do{var r=t.nextSibling;if(n.removeChild(t),r&&r.nodeType===8)if(t=r.data,t==="/$"){if(i===0){n.removeChild(r),Hf(e);return}i--}else t!=="$"&&t!=="$?"&&t!=="$!"||i++;t=r}while(t);Hf(e)}function Lo(n){for(;n!=null;n=n.nextSibling){var e=n.nodeType;if(e===1||e===3)break;if(e===8){if(e=n.data,e==="$"||e==="$!"||e==="$?")break;if(e==="/$")return null}}return n}function NE(n){n=n.previousSibling;for(var e=0;n;){if(n.nodeType===8){var t=n.data;if(t==="$"||t==="$!"||t==="$?"){if(e===0)return n;e--}else t==="/$"&&e++}n=n.previousSibling}return null}var lu=Math.random().toString(36).slice(2),as="__reactFiber$"+lu,jf="__reactProps$"+lu,Ks="__reactContainer$"+lu,Tx="__reactEvents$"+lu,qN="__reactListeners$"+lu,$N="__reactHandles$"+lu;function Na(n){var e=n[as];if(e)return e;for(var t=n.parentNode;t;){if(e=t[Ks]||t[as]){if(t=e.alternate,e.child!==null||t!==null&&t.child!==null)for(n=NE(n);n!==null;){if(t=n[as])return t;n=NE(n)}return e}n=t,t=n.parentNode}return null}function xh(n){return n=n[as]||n[Ks],!n||n.tag!==5&&n.tag!==6&&n.tag!==13&&n.tag!==3?null:n}function cc(n){if(n.tag===5||n.tag===6)return n.stateNode;throw Error(Ce(33))}function dg(n){return n[jf]||null}var Cx=[],uc=-1;function ea(n){return{current:n}}function Yt(n){0>uc||(n.current=Cx[uc],Cx[uc]=null,uc--)}function Wt(n,e){uc++,Cx[uc]=n.current,n.current=e}var jo={},oi=ea(jo),bi=ea(!1),$a=jo;function zc(n,e){var t=n.type.contextTypes;if(!t)return jo;var i=n.stateNode;if(i&&i.__reactInternalMemoizedUnmaskedChildContext===e)return i.__reactInternalMemoizedMaskedChildContext;var r={},s;for(s in t)r[s]=e[s];return i&&(n=n.stateNode,n.__reactInternalMemoizedUnmaskedChildContext=e,n.__reactInternalMemoizedMaskedChildContext=r),r}function Ri(n){return n=n.childContextTypes,n!=null}function Lm(){Yt(bi),Yt(oi)}function OE(n,e,t){if(oi.current!==jo)throw Error(Ce(168));Wt(oi,e),Wt(bi,t)}function jR(n,e,t){var i=n.stateNode;if(e=e.childContextTypes,typeof i.getChildContext!="function")return t;i=i.getChildContext();for(var r in i)if(!(r in e))throw Error(Ce(108,OF(n)||"Unknown",r));return cn({},t,i)}function Im(n){return n=(n=n.stateNode)&&n.__reactInternalMemoizedMergedChildContext||jo,$a=oi.current,Wt(oi,n),Wt(bi,bi.current),!0}function UE(n,e,t){var i=n.stateNode;if(!i)throw Error(Ce(169));t?(n=jR(n,e,$a),i.__reactInternalMemoizedMergedChildContext=n,Yt(bi),Yt(oi),Wt(oi,n)):Yt(bi),Wt(bi,t)}var Ns=null,pg=!1,Dv=!1;function XR(n){Ns===null?Ns=[n]:Ns.push(n)}function e3(n){pg=!0,XR(n)}function ta(){if(!Dv&&Ns!==null){Dv=!0;var n=0,e=Ot;try{var t=Ns;for(Ot=1;n<t.length;n++){var i=t[n];do i=i(!0);while(i!==null)}Ns=null,pg=!1}catch(r){throw Ns!==null&&(Ns=Ns.slice(n+1)),vR(xA,ta),r}finally{Ot=e,Dv=!1}}return null}var fc=[],hc=0,Dm=null,Fm=0,mr=[],gr=0,el=null,Us=1,ks="";function Ca(n,e){fc[hc++]=Fm,fc[hc++]=Dm,Dm=n,Fm=e}function JR(n,e,t){mr[gr++]=Us,mr[gr++]=ks,mr[gr++]=el,el=n;var i=Us;n=ks;var r=32-Or(i)-1;i&=~(1<<r),t+=1;var s=32-Or(e)+r;if(30<s){var o=r-r%5;s=(i&(1<<o)-1).toString(32),i>>=o,r-=o,Us=1<<32-Or(e)+r|t<<r|i,ks=s+n}else Us=1<<s|t<<r|i,ks=n}function bA(n){n.return!==null&&(Ca(n,1),JR(n,1,0))}function RA(n){for(;n===Dm;)Dm=fc[--hc],fc[hc]=null,Fm=fc[--hc],fc[hc]=null;for(;n===el;)el=mr[--gr],mr[gr]=null,ks=mr[--gr],mr[gr]=null,Us=mr[--gr],mr[gr]=null}var Xi=null,Vi=null,Zt=!1,Dr=null;function KR(n,e){var t=yr(5,null,null,0);t.elementType="DELETED",t.stateNode=e,t.return=n,e=n.deletions,e===null?(n.deletions=[t],n.flags|=16):e.push(t)}function kE(n,e){switch(n.tag){case 5:var t=n.type;return e=e.nodeType!==1||t.toLowerCase()!==e.nodeName.toLowerCase()?null:e,e!==null?(n.stateNode=e,Xi=n,Vi=Lo(e.firstChild),!0):!1;case 6:return e=n.pendingProps===""||e.nodeType!==3?null:e,e!==null?(n.stateNode=e,Xi=n,Vi=null,!0):!1;case 13:return e=e.nodeType!==8?null:e,e!==null?(t=el!==null?{id:Us,overflow:ks}:null,n.memoizedState={dehydrated:e,treeContext:t,retryLane:1073741824},t=yr(18,null,null,0),t.stateNode=e,t.return=n,n.child=t,Xi=n,Vi=null,!0):!1;default:return!1}}function bx(n){return(n.mode&1)!==0&&(n.flags&128)===0}function Rx(n){if(Zt){var e=Vi;if(e){var t=e;if(!kE(n,e)){if(bx(n))throw Error(Ce(418));e=Lo(t.nextSibling);var i=Xi;e&&kE(n,e)?KR(i,t):(n.flags=n.flags&-4097|2,Zt=!1,Xi=n)}}else{if(bx(n))throw Error(Ce(418));n.flags=n.flags&-4097|2,Zt=!1,Xi=n}}}function HE(n){for(n=n.return;n!==null&&n.tag!==5&&n.tag!==3&&n.tag!==13;)n=n.return;Xi=n}function qd(n){if(n!==Xi)return!1;if(!Zt)return HE(n),Zt=!0,!1;var e;if((e=n.tag!==3)&&!(e=n.tag!==5)&&(e=n.type,e=e!=="head"&&e!=="body"&&!Ex(n.type,n.memoizedProps)),e&&(e=Vi)){if(bx(n))throw YR(),Error(Ce(418));for(;e;)KR(n,e),e=Lo(e.nextSibling)}if(HE(n),n.tag===13){if(n=n.memoizedState,n=n!==null?n.dehydrated:null,!n)throw Error(Ce(317));e:{for(n=n.nextSibling,e=0;n;){if(n.nodeType===8){var t=n.data;if(t==="/$"){if(e===0){Vi=Lo(n.nextSibling);break e}e--}else t!=="$"&&t!=="$!"&&t!=="$?"||e++}n=n.nextSibling}Vi=null}}else Vi=Xi?Lo(n.stateNode.nextSibling):null;return!0}function YR(){for(var n=Vi;n;)n=Lo(n.nextSibling)}function Gc(){Vi=Xi=null,Zt=!1}function PA(n){Dr===null?Dr=[n]:Dr.push(n)}var t3=eo.ReactCurrentBatchConfig;function Br(n,e){if(n&&n.defaultProps){e=cn({},e),n=n.defaultProps;for(var t in n)e[t]===void 0&&(e[t]=n[t]);return e}return e}var Nm=ea(null),Om=null,dc=null,BA=null;function LA(){BA=dc=Om=null}function IA(n){var e=Nm.current;Yt(Nm),n._currentValue=e}function Px(n,e,t){for(;n!==null;){var i=n.alternate;if((n.childLanes&e)!==e?(n.childLanes|=e,i!==null&&(i.childLanes|=e)):i!==null&&(i.childLanes&e)!==e&&(i.childLanes|=e),n===t)break;n=n.return}}function Rc(n,e){Om=n,BA=dc=null,n=n.dependencies,n!==null&&n.firstContext!==null&&(n.lanes&e&&(Ci=!0),n.firstContext=null)}function _r(n){var e=n._currentValue;if(BA!==n)if(n={context:n,memoizedValue:e,next:null},dc===null){if(Om===null)throw Error(Ce(308));dc=n,Om.dependencies={lanes:0,firstContext:n}}else dc=dc.next=n;return e}var Oa=null;function DA(n){Oa===null?Oa=[n]:Oa.push(n)}function QR(n,e,t,i){var r=e.interleaved;return r===null?(t.next=t,DA(e)):(t.next=r.next,r.next=t),e.interleaved=t,Ys(n,i)}function Ys(n,e){n.lanes|=e;var t=n.alternate;for(t!==null&&(t.lanes|=e),t=n,n=n.return;n!==null;)n.childLanes|=e,t=n.alternate,t!==null&&(t.childLanes|=e),t=n,n=n.return;return t.tag===3?t.stateNode:null}var Ao=!1;function FA(n){n.updateQueue={baseState:n.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,interleaved:null,lanes:0},effects:null}}function ZR(n,e){n=n.updateQueue,e.updateQueue===n&&(e.updateQueue={baseState:n.baseState,firstBaseUpdate:n.firstBaseUpdate,lastBaseUpdate:n.lastBaseUpdate,shared:n.shared,effects:n.effects})}function Vs(n,e){return{eventTime:n,lane:e,tag:0,payload:null,callback:null,next:null}}function Io(n,e,t){var i=n.updateQueue;if(i===null)return null;if(i=i.shared,Pt&2){var r=i.pending;return r===null?e.next=e:(e.next=r.next,r.next=e),i.pending=e,Ys(n,t)}return r=i.interleaved,r===null?(e.next=e,DA(i)):(e.next=r.next,r.next=e),i.interleaved=e,Ys(n,t)}function rm(n,e,t){if(e=e.updateQueue,e!==null&&(e=e.shared,(t&4194240)!==0)){var i=e.lanes;i&=n.pendingLanes,t|=i,e.lanes=t,_A(n,t)}}function zE(n,e){var t=n.updateQueue,i=n.alternate;if(i!==null&&(i=i.updateQueue,t===i)){var r=null,s=null;if(t=t.firstBaseUpdate,t!==null){do{var o={eventTime:t.eventTime,lane:t.lane,tag:t.tag,payload:t.payload,callback:t.callback,next:null};s===null?r=s=o:s=s.next=o,t=t.next}while(t!==null);s===null?r=s=e:s=s.next=e}else r=s=e;t={baseState:i.baseState,firstBaseUpdate:r,lastBaseUpdate:s,shared:i.shared,effects:i.effects},n.updateQueue=t;return}n=t.lastBaseUpdate,n===null?t.firstBaseUpdate=e:n.next=e,t.lastBaseUpdate=e}function Um(n,e,t,i){var r=n.updateQueue;Ao=!1;var s=r.firstBaseUpdate,o=r.lastBaseUpdate,a=r.shared.pending;if(a!==null){r.shared.pending=null;var l=a,u=l.next;l.next=null,o===null?s=u:o.next=u,o=l;var h=n.alternate;h!==null&&(h=h.updateQueue,a=h.lastBaseUpdate,a!==o&&(a===null?h.firstBaseUpdate=u:a.next=u,h.lastBaseUpdate=l))}if(s!==null){var d=r.baseState;o=0,h=u=l=null,a=s;do{var p=a.lane,m=a.eventTime;if((i&p)===p){h!==null&&(h=h.next={eventTime:m,lane:0,tag:a.tag,payload:a.payload,callback:a.callback,next:null});e:{var y=n,M=a;switch(p=e,m=t,M.tag){case 1:if(y=M.payload,typeof y=="function"){d=y.call(m,d,p);break e}d=y;break e;case 3:y.flags=y.flags&-65537|128;case 0:if(y=M.payload,p=typeof y=="function"?y.call(m,d,p):y,p==null)break e;d=cn({},d,p);break e;case 2:Ao=!0}}a.callback!==null&&a.lane!==0&&(n.flags|=64,p=r.effects,p===null?r.effects=[a]:p.push(a))}else m={eventTime:m,lane:p,tag:a.tag,payload:a.payload,callback:a.callback,next:null},h===null?(u=h=m,l=d):h=h.next=m,o|=p;if(a=a.next,a===null){if(a=r.shared.pending,a===null)break;p=a,a=p.next,p.next=null,r.lastBaseUpdate=p,r.shared.pending=null}}while(1);if(h===null&&(l=d),r.baseState=l,r.firstBaseUpdate=u,r.lastBaseUpdate=h,e=r.shared.interleaved,e!==null){r=e;do o|=r.lane,r=r.next;while(r!==e)}else s===null&&(r.shared.lanes=0);nl|=o,n.lanes=o,n.memoizedState=d}}function GE(n,e,t){if(n=e.effects,e.effects=null,n!==null)for(e=0;e<n.length;e++){var i=n[e],r=i.callback;if(r!==null){if(i.callback=null,i=t,typeof r!="function")throw Error(Ce(191,r));r.call(i)}}}var qR=new Qb.Component().refs;function Bx(n,e,t,i){e=n.memoizedState,t=t(i,e),t=t==null?e:cn({},e,t),n.memoizedState=t,n.lanes===0&&(n.updateQueue.baseState=t)}var mg={isMounted:function(n){return(n=n._reactInternals)?cl(n)===n:!1},enqueueSetState:function(n,e,t){n=n._reactInternals;var i=gi(),r=Fo(n),s=Vs(i,r);s.payload=e,t!=null&&(s.callback=t),e=Io(n,s,r),e!==null&&(Ur(e,n,r,i),rm(e,n,r))},enqueueReplaceState:function(n,e,t){n=n._reactInternals;var i=gi(),r=Fo(n),s=Vs(i,r);s.tag=1,s.payload=e,t!=null&&(s.callback=t),e=Io(n,s,r),e!==null&&(Ur(e,n,r,i),rm(e,n,r))},enqueueForceUpdate:function(n,e){n=n._reactInternals;var t=gi(),i=Fo(n),r=Vs(t,i);r.tag=2,e!=null&&(r.callback=e),e=Io(n,r,i),e!==null&&(Ur(e,n,i,t),rm(e,n,i))}};function VE(n,e,t,i,r,s,o){return n=n.stateNode,typeof n.shouldComponentUpdate=="function"?n.shouldComponentUpdate(i,s,o):e.prototype&&e.prototype.isPureReactComponent?!Gf(t,i)||!Gf(r,s):!0}function $R(n,e,t){var i=!1,r=jo,s=e.contextType;return typeof s=="object"&&s!==null?s=_r(s):(r=Ri(e)?$a:oi.current,i=e.contextTypes,s=(i=i!=null)?zc(n,r):jo),e=new e(t,s),n.memoizedState=e.state!==null&&e.state!==void 0?e.state:null,e.updater=mg,n.stateNode=e,e._reactInternals=n,i&&(n=n.stateNode,n.__reactInternalMemoizedUnmaskedChildContext=r,n.__reactInternalMemoizedMaskedChildContext=s),e}function WE(n,e,t,i){n=e.state,typeof e.componentWillReceiveProps=="function"&&e.componentWillReceiveProps(t,i),typeof e.UNSAFE_componentWillReceiveProps=="function"&&e.UNSAFE_componentWillReceiveProps(t,i),e.state!==n&&mg.enqueueReplaceState(e,e.state,null)}function Lx(n,e,t,i){var r=n.stateNode;r.props=t,r.state=n.memoizedState,r.refs=qR,FA(n);var s=e.contextType;typeof s=="object"&&s!==null?r.context=_r(s):(s=Ri(e)?$a:oi.current,r.context=zc(n,s)),r.state=n.memoizedState,s=e.getDerivedStateFromProps,typeof s=="function"&&(Bx(n,e,s,t),r.state=n.memoizedState),typeof e.getDerivedStateFromProps=="function"||typeof r.getSnapshotBeforeUpdate=="function"||typeof r.UNSAFE_componentWillMount!="function"&&typeof r.componentWillMount!="function"||(e=r.state,typeof r.componentWillMount=="function"&&r.componentWillMount(),typeof r.UNSAFE_componentWillMount=="function"&&r.UNSAFE_componentWillMount(),e!==r.state&&mg.enqueueReplaceState(r,r.state,null),Um(n,t,r,i),r.state=n.memoizedState),typeof r.componentDidMount=="function"&&(n.flags|=4194308)}function ku(n,e,t){if(n=t.ref,n!==null&&typeof n!="function"&&typeof n!="object"){if(t._owner){if(t=t._owner,t){if(t.tag!==1)throw Error(Ce(309));var i=t.stateNode}if(!i)throw Error(Ce(147,n));var r=i,s=""+n;return e!==null&&e.ref!==null&&typeof e.ref=="function"&&e.ref._stringRef===s?e.ref:(e=function(o){var a=r.refs;a===qR&&(a=r.refs={}),o===null?delete a[s]:a[s]=o},e._stringRef=s,e)}if(typeof n!="string")throw Error(Ce(284));if(!t._owner)throw Error(Ce(290,n))}return n}function $d(n,e){throw n=Object.prototype.toString.call(e),Error(Ce(31,n==="[object Object]"?"object with keys {"+Object.keys(e).join(", ")+"}":n))}function jE(n){var e=n._init;return e(n._payload)}function eP(n){function e(g,x){if(n){var S=g.deletions;S===null?(g.deletions=[x],g.flags|=16):S.push(x)}}function t(g,x){if(!n)return null;for(;x!==null;)e(g,x),x=x.sibling;return null}function i(g,x){for(g=new Map;x!==null;)x.key!==null?g.set(x.key,x):g.set(x.index,x),x=x.sibling;return g}function r(g,x){return g=No(g,x),g.index=0,g.sibling=null,g}function s(g,x,S){return g.index=S,n?(S=g.alternate,S!==null?(S=S.index,S<x?(g.flags|=2,x):S):(g.flags|=2,x)):(g.flags|=1048576,x)}function o(g){return n&&g.alternate===null&&(g.flags|=2),g}function a(g,x,S,E){return x===null||x.tag!==6?(x=zv(S,g.mode,E),x.return=g,x):(x=r(x,S),x.return=g,x)}function l(g,x,S,E){var C=S.type;return C===sc?h(g,x,S.props.children,E,S.key):x!==null&&(x.elementType===C||typeof C=="object"&&C!==null&&C.$$typeof===_o&&jE(C)===x.type)?(E=r(x,S.props),E.ref=ku(g,x,S),E.return=g,E):(E=um(S.type,S.key,S.props,null,g.mode,E),E.ref=ku(g,x,S),E.return=g,E)}function u(g,x,S,E){return x===null||x.tag!==4||x.stateNode.containerInfo!==S.containerInfo||x.stateNode.implementation!==S.implementation?(x=Gv(S,g.mode,E),x.return=g,x):(x=r(x,S.children||[]),x.return=g,x)}function h(g,x,S,E,C){return x===null||x.tag!==7?(x=Ja(S,g.mode,E,C),x.return=g,x):(x=r(x,S),x.return=g,x)}function d(g,x,S){if(typeof x=="string"&&x!==""||typeof x=="number")return x=zv(""+x,g.mode,S),x.return=g,x;if(typeof x=="object"&&x!==null){switch(x.$$typeof){case Gd:return S=um(x.type,x.key,x.props,null,g.mode,S),S.ref=ku(g,null,x),S.return=g,S;case rc:return x=Gv(x,g.mode,S),x.return=g,x;case _o:var E=x._init;return d(g,E(x._payload),S)}if(ff(x)||Du(x))return x=Ja(x,g.mode,S,null),x.return=g,x;$d(g,x)}return null}function p(g,x,S,E){var C=x!==null?x.key:null;if(typeof S=="string"&&S!==""||typeof S=="number")return C!==null?null:a(g,x,""+S,E);if(typeof S=="object"&&S!==null){switch(S.$$typeof){case Gd:return S.key===C?l(g,x,S,E):null;case rc:return S.key===C?u(g,x,S,E):null;case _o:return C=S._init,p(g,x,C(S._payload),E)}if(ff(S)||Du(S))return C!==null?null:h(g,x,S,E,null);$d(g,S)}return null}function m(g,x,S,E,C){if(typeof E=="string"&&E!==""||typeof E=="number")return g=g.get(S)||null,a(x,g,""+E,C);if(typeof E=="object"&&E!==null){switch(E.$$typeof){case Gd:return g=g.get(E.key===null?S:E.key)||null,l(x,g,E,C);case rc:return g=g.get(E.key===null?S:E.key)||null,u(x,g,E,C);case _o:var b=E._init;return m(g,x,S,b(E._payload),C)}if(ff(E)||Du(E))return g=g.get(S)||null,h(x,g,E,C,null);$d(x,E)}return null}function y(g,x,S,E){for(var C=null,b=null,P=x,B=x=0,R=null;P!==null&&B<S.length;B++){P.index>B?(R=P,P=null):R=P.sibling;var L=p(g,P,S[B],E);if(L===null){P===null&&(P=R);break}n&&P&&L.alternate===null&&e(g,P),x=s(L,x,B),b===null?C=L:b.sibling=L,b=L,P=R}if(B===S.length)return t(g,P),Zt&&Ca(g,B),C;if(P===null){for(;B<S.length;B++)P=d(g,S[B],E),P!==null&&(x=s(P,x,B),b===null?C=P:b.sibling=P,b=P);return Zt&&Ca(g,B),C}for(P=i(g,P);B<S.length;B++)R=m(P,g,B,S[B],E),R!==null&&(n&&R.alternate!==null&&P.delete(R.key===null?B:R.key),x=s(R,x,B),b===null?C=R:b.sibling=R,b=R);return n&&P.forEach(function(z){return e(g,z)}),Zt&&Ca(g,B),C}function M(g,x,S,E){var C=Du(S);if(typeof C!="function")throw Error(Ce(150));if(S=C.call(S),S==null)throw Error(Ce(151));for(var b=C=null,P=x,B=x=0,R=null,L=S.next();P!==null&&!L.done;B++,L=S.next()){P.index>B?(R=P,P=null):R=P.sibling;var z=p(g,P,L.value,E);if(z===null){P===null&&(P=R);break}n&&P&&z.alternate===null&&e(g,P),x=s(z,x,B),b===null?C=z:b.sibling=z,b=z,P=R}if(L.done)return t(g,P),Zt&&Ca(g,B),C;if(P===null){for(;!L.done;B++,L=S.next())L=d(g,L.value,E),L!==null&&(x=s(L,x,B),b===null?C=L:b.sibling=L,b=L);return Zt&&Ca(g,B),C}for(P=i(g,P);!L.done;B++,L=S.next())L=m(P,g,B,L.value,E),L!==null&&(n&&L.alternate!==null&&P.delete(L.key===null?B:L.key),x=s(L,x,B),b===null?C=L:b.sibling=L,b=L);return n&&P.forEach(function($){return e(g,$)}),Zt&&Ca(g,B),C}function _(g,x,S,E){if(typeof S=="object"&&S!==null&&S.type===sc&&S.key===null&&(S=S.props.children),typeof S=="object"&&S!==null){switch(S.$$typeof){case Gd:e:{for(var C=S.key,b=x;b!==null;){if(b.key===C){if(C=S.type,C===sc){if(b.tag===7){t(g,b.sibling),x=r(b,S.props.children),x.return=g,g=x;break e}}else if(b.elementType===C||typeof C=="object"&&C!==null&&C.$$typeof===_o&&jE(C)===b.type){t(g,b.sibling),x=r(b,S.props),x.ref=ku(g,b,S),x.return=g,g=x;break e}t(g,b);break}else e(g,b);b=b.sibling}S.type===sc?(x=Ja(S.props.children,g.mode,E,S.key),x.return=g,g=x):(E=um(S.type,S.key,S.props,null,g.mode,E),E.ref=ku(g,x,S),E.return=g,g=E)}return o(g);case rc:e:{for(b=S.key;x!==null;){if(x.key===b)if(x.tag===4&&x.stateNode.containerInfo===S.containerInfo&&x.stateNode.implementation===S.implementation){t(g,x.sibling),x=r(x,S.children||[]),x.return=g,g=x;break e}else{t(g,x);break}else e(g,x);x=x.sibling}x=Gv(S,g.mode,E),x.return=g,g=x}return o(g);case _o:return b=S._init,_(g,x,b(S._payload),E)}if(ff(S))return y(g,x,S,E);if(Du(S))return M(g,x,S,E);$d(g,S)}return typeof S=="string"&&S!==""||typeof S=="number"?(S=""+S,x!==null&&x.tag===6?(t(g,x.sibling),x=r(x,S),x.return=g,g=x):(t(g,x),x=zv(S,g.mode,E),x.return=g,g=x),o(g)):t(g,x)}return _}var Vc=eP(!0),tP=eP(!1),_h={},fs=ea(_h),Xf=ea(_h),Jf=ea(_h);function Ua(n){if(n===_h)throw Error(Ce(174));return n}function NA(n,e){switch(Wt(Jf,e),Wt(Xf,n),Wt(fs,_h),n=e.nodeType,n){case 9:case 11:e=(e=e.documentElement)?e.namespaceURI:ux(null,"");break;default:n=n===8?e.parentNode:e,e=n.namespaceURI||null,n=n.tagName,e=ux(e,n)}Yt(fs),Wt(fs,e)}function Wc(){Yt(fs),Yt(Xf),Yt(Jf)}function nP(n){Ua(Jf.current);var e=Ua(fs.current),t=ux(e,n.type);e!==t&&(Wt(Xf,n),Wt(fs,t))}function OA(n){Xf.current===n&&(Yt(fs),Yt(Xf))}var nn=ea(0);function km(n){for(var e=n;e!==null;){if(e.tag===13){var t=e.memoizedState;if(t!==null&&(t=t.dehydrated,t===null||t.data==="$?"||t.data==="$!"))return e}else if(e.tag===19&&e.memoizedProps.revealOrder!==void 0){if(e.flags&128)return e}else if(e.child!==null){e.child.return=e,e=e.child;continue}if(e===n)break;for(;e.sibling===null;){if(e.return===null||e.return===n)return null;e=e.return}e.sibling.return=e.return,e=e.sibling}return null}var Fv=[];function UA(){for(var n=0;n<Fv.length;n++)Fv[n]._workInProgressVersionPrimary=null;Fv.length=0}var sm=eo.ReactCurrentDispatcher,Nv=eo.ReactCurrentBatchConfig,tl=0,ln=null,Pn=null,kn=null,Hm=!1,Sf=!1,Kf=0,n3=0;function ti(){throw Error(Ce(321))}function kA(n,e){if(e===null)return!1;for(var t=0;t<e.length&&t<n.length;t++)if(!Gr(n[t],e[t]))return!1;return!0}function HA(n,e,t,i,r,s){if(tl=s,ln=e,e.memoizedState=null,e.updateQueue=null,e.lanes=0,sm.current=n===null||n.memoizedState===null?o3:a3,n=t(i,r),Sf){s=0;do{if(Sf=!1,Kf=0,25<=s)throw Error(Ce(301));s+=1,kn=Pn=null,e.updateQueue=null,sm.current=l3,n=t(i,r)}while(Sf)}if(sm.current=zm,e=Pn!==null&&Pn.next!==null,tl=0,kn=Pn=ln=null,Hm=!1,e)throw Error(Ce(300));return n}function zA(){var n=Kf!==0;return Kf=0,n}function ss(){var n={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return kn===null?ln.memoizedState=kn=n:kn=kn.next=n,kn}function Ar(){if(Pn===null){var n=ln.alternate;n=n!==null?n.memoizedState:null}else n=Pn.next;var e=kn===null?ln.memoizedState:kn.next;if(e!==null)kn=e,Pn=n;else{if(n===null)throw Error(Ce(310));Pn=n,n={memoizedState:Pn.memoizedState,baseState:Pn.baseState,baseQueue:Pn.baseQueue,queue:Pn.queue,next:null},kn===null?ln.memoizedState=kn=n:kn=kn.next=n}return kn}function Yf(n,e){return typeof e=="function"?e(n):e}function Ov(n){var e=Ar(),t=e.queue;if(t===null)throw Error(Ce(311));t.lastRenderedReducer=n;var i=Pn,r=i.baseQueue,s=t.pending;if(s!==null){if(r!==null){var o=r.next;r.next=s.next,s.next=o}i.baseQueue=r=s,t.pending=null}if(r!==null){s=r.next,i=i.baseState;var a=o=null,l=null,u=s;do{var h=u.lane;if((tl&h)===h)l!==null&&(l=l.next={lane:0,action:u.action,hasEagerState:u.hasEagerState,eagerState:u.eagerState,next:null}),i=u.hasEagerState?u.eagerState:n(i,u.action);else{var d={lane:h,action:u.action,hasEagerState:u.hasEagerState,eagerState:u.eagerState,next:null};l===null?(a=l=d,o=i):l=l.next=d,ln.lanes|=h,nl|=h}u=u.next}while(u!==null&&u!==s);l===null?o=i:l.next=a,Gr(i,e.memoizedState)||(Ci=!0),e.memoizedState=i,e.baseState=o,e.baseQueue=l,t.lastRenderedState=i}if(n=t.interleaved,n!==null){r=n;do s=r.lane,ln.lanes|=s,nl|=s,r=r.next;while(r!==n)}else r===null&&(t.lanes=0);return[e.memoizedState,t.dispatch]}function Uv(n){var e=Ar(),t=e.queue;if(t===null)throw Error(Ce(311));t.lastRenderedReducer=n;var i=t.dispatch,r=t.pending,s=e.memoizedState;if(r!==null){t.pending=null;var o=r=r.next;do s=n(s,o.action),o=o.next;while(o!==r);Gr(s,e.memoizedState)||(Ci=!0),e.memoizedState=s,e.baseQueue===null&&(e.baseState=s),t.lastRenderedState=s}return[s,i]}function iP(){}function rP(n,e){var t=ln,i=Ar(),r=e(),s=!Gr(i.memoizedState,r);if(s&&(i.memoizedState=r,Ci=!0),i=i.queue,GA(aP.bind(null,t,i,n),[n]),i.getSnapshot!==e||s||kn!==null&&kn.memoizedState.tag&1){if(t.flags|=2048,Qf(9,oP.bind(null,t,i,r,e),void 0,null),zn===null)throw Error(Ce(349));tl&30||sP(t,e,r)}return r}function sP(n,e,t){n.flags|=16384,n={getSnapshot:e,value:t},e=ln.updateQueue,e===null?(e={lastEffect:null,stores:null},ln.updateQueue=e,e.stores=[n]):(t=e.stores,t===null?e.stores=[n]:t.push(n))}function oP(n,e,t,i){e.value=t,e.getSnapshot=i,lP(e)&&cP(n)}function aP(n,e,t){return t(function(){lP(e)&&cP(n)})}function lP(n){var e=n.getSnapshot;n=n.value;try{var t=e();return!Gr(n,t)}catch{return!0}}function cP(n){var e=Ys(n,1);e!==null&&Ur(e,n,1,-1)}function XE(n){var e=ss();return typeof n=="function"&&(n=n()),e.memoizedState=e.baseState=n,n={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:Yf,lastRenderedState:n},e.queue=n,n=n.dispatch=s3.bind(null,ln,n),[e.memoizedState,n]}function Qf(n,e,t,i){return n={tag:n,create:e,destroy:t,deps:i,next:null},e=ln.updateQueue,e===null?(e={lastEffect:null,stores:null},ln.updateQueue=e,e.lastEffect=n.next=n):(t=e.lastEffect,t===null?e.lastEffect=n.next=n:(i=t.next,t.next=n,n.next=i,e.lastEffect=n)),n}function uP(){return Ar().memoizedState}function om(n,e,t,i){var r=ss();ln.flags|=n,r.memoizedState=Qf(1|e,t,void 0,i===void 0?null:i)}function gg(n,e,t,i){var r=Ar();i=i===void 0?null:i;var s=void 0;if(Pn!==null){var o=Pn.memoizedState;if(s=o.destroy,i!==null&&kA(i,o.deps)){r.memoizedState=Qf(e,t,s,i);return}}ln.flags|=n,r.memoizedState=Qf(1|e,t,s,i)}function JE(n,e){return om(8390656,8,n,e)}function GA(n,e){return gg(2048,8,n,e)}function fP(n,e){return gg(4,2,n,e)}function hP(n,e){return gg(4,4,n,e)}function dP(n,e){if(typeof e=="function")return n=n(),e(n),function(){e(null)};if(e!=null)return n=n(),e.current=n,function(){e.current=null}}function pP(n,e,t){return t=t!=null?t.concat([n]):null,gg(4,4,dP.bind(null,e,n),t)}function VA(){}function mP(n,e){var t=Ar();e=e===void 0?null:e;var i=t.memoizedState;return i!==null&&e!==null&&kA(e,i[1])?i[0]:(t.memoizedState=[n,e],n)}function gP(n,e){var t=Ar();e=e===void 0?null:e;var i=t.memoizedState;return i!==null&&e!==null&&kA(e,i[1])?i[0]:(n=n(),t.memoizedState=[n,e],n)}function vP(n,e,t){return tl&21?(Gr(t,e)||(t=_R(),ln.lanes|=t,nl|=t,n.baseState=!0),e):(n.baseState&&(n.baseState=!1,Ci=!0),n.memoizedState=t)}function i3(n,e){var t=Ot;Ot=t!==0&&4>t?t:4,n(!0);var i=Nv.transition;Nv.transition={};try{n(!1),e()}finally{Ot=t,Nv.transition=i}}function yP(){return Ar().memoizedState}function r3(n,e,t){var i=Fo(n);if(t={lane:i,action:t,hasEagerState:!1,eagerState:null,next:null},xP(n))_P(e,t);else if(t=QR(n,e,t,i),t!==null){var r=gi();Ur(t,n,i,r),AP(t,e,i)}}function s3(n,e,t){var i=Fo(n),r={lane:i,action:t,hasEagerState:!1,eagerState:null,next:null};if(xP(n))_P(e,r);else{var s=n.alternate;if(n.lanes===0&&(s===null||s.lanes===0)&&(s=e.lastRenderedReducer,s!==null))try{var o=e.lastRenderedState,a=s(o,t);if(r.hasEagerState=!0,r.eagerState=a,Gr(a,o)){var l=e.interleaved;l===null?(r.next=r,DA(e)):(r.next=l.next,l.next=r),e.interleaved=r;return}}catch{}finally{}t=QR(n,e,r,i),t!==null&&(r=gi(),Ur(t,n,i,r),AP(t,e,i))}}function xP(n){var e=n.alternate;return n===ln||e!==null&&e===ln}function _P(n,e){Sf=Hm=!0;var t=n.pending;t===null?e.next=e:(e.next=t.next,t.next=e),n.pending=e}function AP(n,e,t){if(t&4194240){var i=e.lanes;i&=n.pendingLanes,t|=i,e.lanes=t,_A(n,t)}}var zm={readContext:_r,useCallback:ti,useContext:ti,useEffect:ti,useImperativeHandle:ti,useInsertionEffect:ti,useLayoutEffect:ti,useMemo:ti,useReducer:ti,useRef:ti,useState:ti,useDebugValue:ti,useDeferredValue:ti,useTransition:ti,useMutableSource:ti,useSyncExternalStore:ti,useId:ti,unstable_isNewReconciler:!1},o3={readContext:_r,useCallback:function(n,e){return ss().memoizedState=[n,e===void 0?null:e],n},useContext:_r,useEffect:JE,useImperativeHandle:function(n,e,t){return t=t!=null?t.concat([n]):null,om(4194308,4,dP.bind(null,e,n),t)},useLayoutEffect:function(n,e){return om(4194308,4,n,e)},useInsertionEffect:function(n,e){return om(4,2,n,e)},useMemo:function(n,e){var t=ss();return e=e===void 0?null:e,n=n(),t.memoizedState=[n,e],n},useReducer:function(n,e,t){var i=ss();return e=t!==void 0?t(e):e,i.memoizedState=i.baseState=e,n={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:n,lastRenderedState:e},i.queue=n,n=n.dispatch=r3.bind(null,ln,n),[i.memoizedState,n]},useRef:function(n){var e=ss();return n={current:n},e.memoizedState=n},useState:XE,useDebugValue:VA,useDeferredValue:function(n){return ss().memoizedState=n},useTransition:function(){var n=XE(!1),e=n[0];return n=i3.bind(null,n[1]),ss().memoizedState=n,[e,n]},useMutableSource:function(){},useSyncExternalStore:function(n,e,t){var i=ln,r=ss();if(Zt){if(t===void 0)throw Error(Ce(407));t=t()}else{if(t=e(),zn===null)throw Error(Ce(349));tl&30||sP(i,e,t)}r.memoizedState=t;var s={value:t,getSnapshot:e};return r.queue=s,JE(aP.bind(null,i,s,n),[n]),i.flags|=2048,Qf(9,oP.bind(null,i,s,t,e),void 0,null),t},useId:function(){var n=ss(),e=zn.identifierPrefix;if(Zt){var t=ks,i=Us;t=(i&~(1<<32-Or(i)-1)).toString(32)+t,e=":"+e+"R"+t,t=Kf++,0<t&&(e+="H"+t.toString(32)),e+=":"}else t=n3++,e=":"+e+"r"+t.toString(32)+":";return n.memoizedState=e},unstable_isNewReconciler:!1},a3={readContext:_r,useCallback:mP,useContext:_r,useEffect:GA,useImperativeHandle:pP,useInsertionEffect:fP,useLayoutEffect:hP,useMemo:gP,useReducer:Ov,useRef:uP,useState:function(){return Ov(Yf)},useDebugValue:VA,useDeferredValue:function(n){var e=Ar();return vP(e,Pn.memoizedState,n)},useTransition:function(){var n=Ov(Yf)[0],e=Ar().memoizedState;return[n,e]},useMutableSource:iP,useSyncExternalStore:rP,useId:yP,unstable_isNewReconciler:!1},l3={readContext:_r,useCallback:mP,useContext:_r,useEffect:GA,useImperativeHandle:pP,useInsertionEffect:fP,useLayoutEffect:hP,useMemo:gP,useReducer:Uv,useRef:uP,useState:function(){return Uv(Yf)},useDebugValue:VA,useDeferredValue:function(n){var e=Ar();return Pn===null?e.memoizedState=n:vP(e,Pn.memoizedState,n)},useTransition:function(){var n=Uv(Yf)[0],e=Ar().memoizedState;return[n,e]},useMutableSource:iP,useSyncExternalStore:rP,useId:yP,unstable_isNewReconciler:!1};function jc(n,e){try{var t="",i=e;do t+=NF(i),i=i.return;while(i);var r=t}catch(s){r=`
Error generating stack: `+s.message+`
`+s.stack}return{value:n,source:e,stack:r,digest:null}}function kv(n,e,t){return{value:n,source:null,stack:t??null,digest:e??null}}function Ix(n,e){try{console.error(e.value)}catch(t){setTimeout(function(){throw t})}}var c3=typeof WeakMap=="function"?WeakMap:Map;function SP(n,e,t){t=Vs(-1,t),t.tag=3,t.payload={element:null};var i=e.value;return t.callback=function(){Vm||(Vm=!0,Vx=i),Ix(n,e)},t}function MP(n,e,t){t=Vs(-1,t),t.tag=3;var i=n.type.getDerivedStateFromError;if(typeof i=="function"){var r=e.value;t.payload=function(){return i(r)},t.callback=function(){Ix(n,e)}}var s=n.stateNode;return s!==null&&typeof s.componentDidCatch=="function"&&(t.callback=function(){Ix(n,e),typeof i!="function"&&(Do===null?Do=new Set([this]):Do.add(this));var o=e.stack;this.componentDidCatch(e.value,{componentStack:o!==null?o:""})}),t}function KE(n,e,t){var i=n.pingCache;if(i===null){i=n.pingCache=new c3;var r=new Set;i.set(e,r)}else r=i.get(e),r===void 0&&(r=new Set,i.set(e,r));r.has(t)||(r.add(t),n=M3.bind(null,n,e,t),e.then(n,n))}function YE(n){do{var e;if((e=n.tag===13)&&(e=n.memoizedState,e=e!==null?e.dehydrated!==null:!0),e)return n;n=n.return}while(n!==null);return null}function QE(n,e,t,i,r){return n.mode&1?(n.flags|=65536,n.lanes=r,n):(n===e?n.flags|=65536:(n.flags|=128,t.flags|=131072,t.flags&=-52805,t.tag===1&&(t.alternate===null?t.tag=17:(e=Vs(-1,1),e.tag=2,Io(t,e,1))),t.lanes|=1),n)}var u3=eo.ReactCurrentOwner,Ci=!1;function pi(n,e,t,i){e.child=n===null?tP(e,null,t,i):Vc(e,n.child,t,i)}function ZE(n,e,t,i,r){t=t.render;var s=e.ref;return Rc(e,r),i=HA(n,e,t,i,s,r),t=zA(),n!==null&&!Ci?(e.updateQueue=n.updateQueue,e.flags&=-2053,n.lanes&=~r,Qs(n,e,r)):(Zt&&t&&bA(e),e.flags|=1,pi(n,e,i,r),e.child)}function qE(n,e,t,i,r){if(n===null){var s=t.type;return typeof s=="function"&&!ZA(s)&&s.defaultProps===void 0&&t.compare===null&&t.defaultProps===void 0?(e.tag=15,e.type=s,EP(n,e,s,i,r)):(n=um(t.type,null,i,e,e.mode,r),n.ref=e.ref,n.return=e,e.child=n)}if(s=n.child,!(n.lanes&r)){var o=s.memoizedProps;if(t=t.compare,t=t!==null?t:Gf,t(o,i)&&n.ref===e.ref)return Qs(n,e,r)}return e.flags|=1,n=No(s,i),n.ref=e.ref,n.return=e,e.child=n}function EP(n,e,t,i,r){if(n!==null){var s=n.memoizedProps;if(Gf(s,i)&&n.ref===e.ref)if(Ci=!1,e.pendingProps=i=s,(n.lanes&r)!==0)n.flags&131072&&(Ci=!0);else return e.lanes=n.lanes,Qs(n,e,r)}return Dx(n,e,t,i,r)}function wP(n,e,t){var i=e.pendingProps,r=i.children,s=n!==null?n.memoizedState:null;if(i.mode==="hidden")if(!(e.mode&1))e.memoizedState={baseLanes:0,cachePool:null,transitions:null},Wt(mc,Gi),Gi|=t;else{if(!(t&1073741824))return n=s!==null?s.baseLanes|t:t,e.lanes=e.childLanes=1073741824,e.memoizedState={baseLanes:n,cachePool:null,transitions:null},e.updateQueue=null,Wt(mc,Gi),Gi|=n,null;e.memoizedState={baseLanes:0,cachePool:null,transitions:null},i=s!==null?s.baseLanes:t,Wt(mc,Gi),Gi|=i}else s!==null?(i=s.baseLanes|t,e.memoizedState=null):i=t,Wt(mc,Gi),Gi|=i;return pi(n,e,r,t),e.child}function TP(n,e){var t=e.ref;(n===null&&t!==null||n!==null&&n.ref!==t)&&(e.flags|=512,e.flags|=2097152)}function Dx(n,e,t,i,r){var s=Ri(t)?$a:oi.current;return s=zc(e,s),Rc(e,r),t=HA(n,e,t,i,s,r),i=zA(),n!==null&&!Ci?(e.updateQueue=n.updateQueue,e.flags&=-2053,n.lanes&=~r,Qs(n,e,r)):(Zt&&i&&bA(e),e.flags|=1,pi(n,e,t,r),e.child)}function $E(n,e,t,i,r){if(Ri(t)){var s=!0;Im(e)}else s=!1;if(Rc(e,r),e.stateNode===null)am(n,e),$R(e,t,i),Lx(e,t,i,r),i=!0;else if(n===null){var o=e.stateNode,a=e.memoizedProps;o.props=a;var l=o.context,u=t.contextType;typeof u=="object"&&u!==null?u=_r(u):(u=Ri(t)?$a:oi.current,u=zc(e,u));var h=t.getDerivedStateFromProps,d=typeof h=="function"||typeof o.getSnapshotBeforeUpdate=="function";d||typeof o.UNSAFE_componentWillReceiveProps!="function"&&typeof o.componentWillReceiveProps!="function"||(a!==i||l!==u)&&WE(e,o,i,u),Ao=!1;var p=e.memoizedState;o.state=p,Um(e,i,o,r),l=e.memoizedState,a!==i||p!==l||bi.current||Ao?(typeof h=="function"&&(Bx(e,t,h,i),l=e.memoizedState),(a=Ao||VE(e,t,a,i,p,l,u))?(d||typeof o.UNSAFE_componentWillMount!="function"&&typeof o.componentWillMount!="function"||(typeof o.componentWillMount=="function"&&o.componentWillMount(),typeof o.UNSAFE_componentWillMount=="function"&&o.UNSAFE_componentWillMount()),typeof o.componentDidMount=="function"&&(e.flags|=4194308)):(typeof o.componentDidMount=="function"&&(e.flags|=4194308),e.memoizedProps=i,e.memoizedState=l),o.props=i,o.state=l,o.context=u,i=a):(typeof o.componentDidMount=="function"&&(e.flags|=4194308),i=!1)}else{o=e.stateNode,ZR(n,e),a=e.memoizedProps,u=e.type===e.elementType?a:Br(e.type,a),o.props=u,d=e.pendingProps,p=o.context,l=t.contextType,typeof l=="object"&&l!==null?l=_r(l):(l=Ri(t)?$a:oi.current,l=zc(e,l));var m=t.getDerivedStateFromProps;(h=typeof m=="function"||typeof o.getSnapshotBeforeUpdate=="function")||typeof o.UNSAFE_componentWillReceiveProps!="function"&&typeof o.componentWillReceiveProps!="function"||(a!==d||p!==l)&&WE(e,o,i,l),Ao=!1,p=e.memoizedState,o.state=p,Um(e,i,o,r);var y=e.memoizedState;a!==d||p!==y||bi.current||Ao?(typeof m=="function"&&(Bx(e,t,m,i),y=e.memoizedState),(u=Ao||VE(e,t,u,i,p,y,l)||!1)?(h||typeof o.UNSAFE_componentWillUpdate!="function"&&typeof o.componentWillUpdate!="function"||(typeof o.componentWillUpdate=="function"&&o.componentWillUpdate(i,y,l),typeof o.UNSAFE_componentWillUpdate=="function"&&o.UNSAFE_componentWillUpdate(i,y,l)),typeof o.componentDidUpdate=="function"&&(e.flags|=4),typeof o.getSnapshotBeforeUpdate=="function"&&(e.flags|=1024)):(typeof o.componentDidUpdate!="function"||a===n.memoizedProps&&p===n.memoizedState||(e.flags|=4),typeof o.getSnapshotBeforeUpdate!="function"||a===n.memoizedProps&&p===n.memoizedState||(e.flags|=1024),e.memoizedProps=i,e.memoizedState=y),o.props=i,o.state=y,o.context=l,i=u):(typeof o.componentDidUpdate!="function"||a===n.memoizedProps&&p===n.memoizedState||(e.flags|=4),typeof o.getSnapshotBeforeUpdate!="function"||a===n.memoizedProps&&p===n.memoizedState||(e.flags|=1024),i=!1)}return Fx(n,e,t,i,s,r)}function Fx(n,e,t,i,r,s){TP(n,e);var o=(e.flags&128)!==0;if(!i&&!o)return r&&UE(e,t,!1),Qs(n,e,s);i=e.stateNode,u3.current=e;var a=o&&typeof t.getDerivedStateFromError!="function"?null:i.render();return e.flags|=1,n!==null&&o?(e.child=Vc(e,n.child,null,s),e.child=Vc(e,null,a,s)):pi(n,e,a,s),e.memoizedState=i.state,r&&UE(e,t,!0),e.child}function CP(n){var e=n.stateNode;e.pendingContext?OE(n,e.pendingContext,e.pendingContext!==e.context):e.context&&OE(n,e.context,!1),NA(n,e.containerInfo)}function ew(n,e,t,i,r){return Gc(),PA(r),e.flags|=256,pi(n,e,t,i),e.child}var Nx={dehydrated:null,treeContext:null,retryLane:0};function Ox(n){return{baseLanes:n,cachePool:null,transitions:null}}function bP(n,e,t){var i=e.pendingProps,r=nn.current,s=!1,o=(e.flags&128)!==0,a;if((a=o)||(a=n!==null&&n.memoizedState===null?!1:(r&2)!==0),a?(s=!0,e.flags&=-129):(n===null||n.memoizedState!==null)&&(r|=1),Wt(nn,r&1),n===null)return Rx(e),n=e.memoizedState,n!==null&&(n=n.dehydrated,n!==null)?(e.mode&1?n.data==="$!"?e.lanes=8:e.lanes=1073741824:e.lanes=1,null):(o=i.children,n=i.fallback,s?(i=e.mode,s=e.child,o={mode:"hidden",children:o},!(i&1)&&s!==null?(s.childLanes=0,s.pendingProps=o):s=xg(o,i,0,null),n=Ja(n,i,t,null),s.return=e,n.return=e,s.sibling=n,e.child=s,e.child.memoizedState=Ox(t),e.memoizedState=Nx,n):WA(e,o));if(r=n.memoizedState,r!==null&&(a=r.dehydrated,a!==null))return f3(n,e,o,i,a,r,t);if(s){s=i.fallback,o=e.mode,r=n.child,a=r.sibling;var l={mode:"hidden",children:i.children};return!(o&1)&&e.child!==r?(i=e.child,i.childLanes=0,i.pendingProps=l,e.deletions=null):(i=No(r,l),i.subtreeFlags=r.subtreeFlags&14680064),a!==null?s=No(a,s):(s=Ja(s,o,t,null),s.flags|=2),s.return=e,i.return=e,i.sibling=s,e.child=i,i=s,s=e.child,o=n.child.memoizedState,o=o===null?Ox(t):{baseLanes:o.baseLanes|t,cachePool:null,transitions:o.transitions},s.memoizedState=o,s.childLanes=n.childLanes&~t,e.memoizedState=Nx,i}return s=n.child,n=s.sibling,i=No(s,{mode:"visible",children:i.children}),!(e.mode&1)&&(i.lanes=t),i.return=e,i.sibling=null,n!==null&&(t=e.deletions,t===null?(e.deletions=[n],e.flags|=16):t.push(n)),e.child=i,e.memoizedState=null,i}function WA(n,e){return e=xg({mode:"visible",children:e},n.mode,0,null),e.return=n,n.child=e}function ep(n,e,t,i){return i!==null&&PA(i),Vc(e,n.child,null,t),n=WA(e,e.pendingProps.children),n.flags|=2,e.memoizedState=null,n}function f3(n,e,t,i,r,s,o){if(t)return e.flags&256?(e.flags&=-257,i=kv(Error(Ce(422))),ep(n,e,o,i)):e.memoizedState!==null?(e.child=n.child,e.flags|=128,null):(s=i.fallback,r=e.mode,i=xg({mode:"visible",children:i.children},r,0,null),s=Ja(s,r,o,null),s.flags|=2,i.return=e,s.return=e,i.sibling=s,e.child=i,e.mode&1&&Vc(e,n.child,null,o),e.child.memoizedState=Ox(o),e.memoizedState=Nx,s);if(!(e.mode&1))return ep(n,e,o,null);if(r.data==="$!"){if(i=r.nextSibling&&r.nextSibling.dataset,i)var a=i.dgst;return i=a,s=Error(Ce(419)),i=kv(s,i,void 0),ep(n,e,o,i)}if(a=(o&n.childLanes)!==0,Ci||a){if(i=zn,i!==null){switch(o&-o){case 4:r=2;break;case 16:r=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:r=32;break;case 536870912:r=268435456;break;default:r=0}r=r&(i.suspendedLanes|o)?0:r,r!==0&&r!==s.retryLane&&(s.retryLane=r,Ys(n,r),Ur(i,n,r,-1))}return QA(),i=kv(Error(Ce(421))),ep(n,e,o,i)}return r.data==="$?"?(e.flags|=128,e.child=n.child,e=E3.bind(null,n),r._reactRetry=e,null):(n=s.treeContext,Vi=Lo(r.nextSibling),Xi=e,Zt=!0,Dr=null,n!==null&&(mr[gr++]=Us,mr[gr++]=ks,mr[gr++]=el,Us=n.id,ks=n.overflow,el=e),e=WA(e,i.children),e.flags|=4096,e)}function tw(n,e,t){n.lanes|=e;var i=n.alternate;i!==null&&(i.lanes|=e),Px(n.return,e,t)}function Hv(n,e,t,i,r){var s=n.memoizedState;s===null?n.memoizedState={isBackwards:e,rendering:null,renderingStartTime:0,last:i,tail:t,tailMode:r}:(s.isBackwards=e,s.rendering=null,s.renderingStartTime=0,s.last=i,s.tail=t,s.tailMode=r)}function RP(n,e,t){var i=e.pendingProps,r=i.revealOrder,s=i.tail;if(pi(n,e,i.children,t),i=nn.current,i&2)i=i&1|2,e.flags|=128;else{if(n!==null&&n.flags&128)e:for(n=e.child;n!==null;){if(n.tag===13)n.memoizedState!==null&&tw(n,t,e);else if(n.tag===19)tw(n,t,e);else if(n.child!==null){n.child.return=n,n=n.child;continue}if(n===e)break e;for(;n.sibling===null;){if(n.return===null||n.return===e)break e;n=n.return}n.sibling.return=n.return,n=n.sibling}i&=1}if(Wt(nn,i),!(e.mode&1))e.memoizedState=null;else switch(r){case"forwards":for(t=e.child,r=null;t!==null;)n=t.alternate,n!==null&&km(n)===null&&(r=t),t=t.sibling;t=r,t===null?(r=e.child,e.child=null):(r=t.sibling,t.sibling=null),Hv(e,!1,r,t,s);break;case"backwards":for(t=null,r=e.child,e.child=null;r!==null;){if(n=r.alternate,n!==null&&km(n)===null){e.child=r;break}n=r.sibling,r.sibling=t,t=r,r=n}Hv(e,!0,t,null,s);break;case"together":Hv(e,!1,null,null,void 0);break;default:e.memoizedState=null}return e.child}function am(n,e){!(e.mode&1)&&n!==null&&(n.alternate=null,e.alternate=null,e.flags|=2)}function Qs(n,e,t){if(n!==null&&(e.dependencies=n.dependencies),nl|=e.lanes,!(t&e.childLanes))return null;if(n!==null&&e.child!==n.child)throw Error(Ce(153));if(e.child!==null){for(n=e.child,t=No(n,n.pendingProps),e.child=t,t.return=e;n.sibling!==null;)n=n.sibling,t=t.sibling=No(n,n.pendingProps),t.return=e;t.sibling=null}return e.child}function h3(n,e,t){switch(e.tag){case 3:CP(e),Gc();break;case 5:nP(e);break;case 1:Ri(e.type)&&Im(e);break;case 4:NA(e,e.stateNode.containerInfo);break;case 10:var i=e.type._context,r=e.memoizedProps.value;Wt(Nm,i._currentValue),i._currentValue=r;break;case 13:if(i=e.memoizedState,i!==null)return i.dehydrated!==null?(Wt(nn,nn.current&1),e.flags|=128,null):t&e.child.childLanes?bP(n,e,t):(Wt(nn,nn.current&1),n=Qs(n,e,t),n!==null?n.sibling:null);Wt(nn,nn.current&1);break;case 19:if(i=(t&e.childLanes)!==0,n.flags&128){if(i)return RP(n,e,t);e.flags|=128}if(r=e.memoizedState,r!==null&&(r.rendering=null,r.tail=null,r.lastEffect=null),Wt(nn,nn.current),i)break;return null;case 22:case 23:return e.lanes=0,wP(n,e,t)}return Qs(n,e,t)}var PP,Ux,BP,LP;PP=function(n,e){for(var t=e.child;t!==null;){if(t.tag===5||t.tag===6)n.appendChild(t.stateNode);else if(t.tag!==4&&t.child!==null){t.child.return=t,t=t.child;continue}if(t===e)break;for(;t.sibling===null;){if(t.return===null||t.return===e)return;t=t.return}t.sibling.return=t.return,t=t.sibling}};Ux=function(){};BP=function(n,e,t,i){var r=n.memoizedProps;if(r!==i){n=e.stateNode,Ua(fs.current);var s=null;switch(t){case"input":r=ox(n,r),i=ox(n,i),s=[];break;case"select":r=cn({},r,{value:void 0}),i=cn({},i,{value:void 0}),s=[];break;case"textarea":r=cx(n,r),i=cx(n,i),s=[];break;default:typeof r.onClick!="function"&&typeof i.onClick=="function"&&(n.onclick=Bm)}fx(t,i);var o;t=null;for(u in r)if(!i.hasOwnProperty(u)&&r.hasOwnProperty(u)&&r[u]!=null)if(u==="style"){var a=r[u];for(o in a)a.hasOwnProperty(o)&&(t||(t={}),t[o]="")}else u!=="dangerouslySetInnerHTML"&&u!=="children"&&u!=="suppressContentEditableWarning"&&u!=="suppressHydrationWarning"&&u!=="autoFocus"&&(Ff.hasOwnProperty(u)?s||(s=[]):(s=s||[]).push(u,null));for(u in i){var l=i[u];if(a=r!=null?r[u]:void 0,i.hasOwnProperty(u)&&l!==a&&(l!=null||a!=null))if(u==="style")if(a){for(o in a)!a.hasOwnProperty(o)||l&&l.hasOwnProperty(o)||(t||(t={}),t[o]="");for(o in l)l.hasOwnProperty(o)&&a[o]!==l[o]&&(t||(t={}),t[o]=l[o])}else t||(s||(s=[]),s.push(u,t)),t=l;else u==="dangerouslySetInnerHTML"?(l=l?l.__html:void 0,a=a?a.__html:void 0,l!=null&&a!==l&&(s=s||[]).push(u,l)):u==="children"?typeof l!="string"&&typeof l!="number"||(s=s||[]).push(u,""+l):u!=="suppressContentEditableWarning"&&u!=="suppressHydrationWarning"&&(Ff.hasOwnProperty(u)?(l!=null&&u==="onScroll"&&Jt("scroll",n),s||a===l||(s=[])):(s=s||[]).push(u,l))}t&&(s=s||[]).push("style",t);var u=s;(e.updateQueue=u)&&(e.flags|=4)}};LP=function(n,e,t,i){t!==i&&(e.flags|=4)};function Hu(n,e){if(!Zt)switch(n.tailMode){case"hidden":e=n.tail;for(var t=null;e!==null;)e.alternate!==null&&(t=e),e=e.sibling;t===null?n.tail=null:t.sibling=null;break;case"collapsed":t=n.tail;for(var i=null;t!==null;)t.alternate!==null&&(i=t),t=t.sibling;i===null?e||n.tail===null?n.tail=null:n.tail.sibling=null:i.sibling=null}}function ni(n){var e=n.alternate!==null&&n.alternate.child===n.child,t=0,i=0;if(e)for(var r=n.child;r!==null;)t|=r.lanes|r.childLanes,i|=r.subtreeFlags&14680064,i|=r.flags&14680064,r.return=n,r=r.sibling;else for(r=n.child;r!==null;)t|=r.lanes|r.childLanes,i|=r.subtreeFlags,i|=r.flags,r.return=n,r=r.sibling;return n.subtreeFlags|=i,n.childLanes=t,e}function d3(n,e,t){var i=e.pendingProps;switch(RA(e),e.tag){case 2:case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return ni(e),null;case 1:return Ri(e.type)&&Lm(),ni(e),null;case 3:return i=e.stateNode,Wc(),Yt(bi),Yt(oi),UA(),i.pendingContext&&(i.context=i.pendingContext,i.pendingContext=null),(n===null||n.child===null)&&(qd(e)?e.flags|=4:n===null||n.memoizedState.isDehydrated&&!(e.flags&256)||(e.flags|=1024,Dr!==null&&(Xx(Dr),Dr=null))),Ux(n,e),ni(e),null;case 5:OA(e);var r=Ua(Jf.current);if(t=e.type,n!==null&&e.stateNode!=null)BP(n,e,t,i,r),n.ref!==e.ref&&(e.flags|=512,e.flags|=2097152);else{if(!i){if(e.stateNode===null)throw Error(Ce(166));return ni(e),null}if(n=Ua(fs.current),qd(e)){i=e.stateNode,t=e.type;var s=e.memoizedProps;switch(i[as]=e,i[jf]=s,n=(e.mode&1)!==0,t){case"dialog":Jt("cancel",i),Jt("close",i);break;case"iframe":case"object":case"embed":Jt("load",i);break;case"video":case"audio":for(r=0;r<df.length;r++)Jt(df[r],i);break;case"source":Jt("error",i);break;case"img":case"image":case"link":Jt("error",i),Jt("load",i);break;case"details":Jt("toggle",i);break;case"input":uE(i,s),Jt("invalid",i);break;case"select":i._wrapperState={wasMultiple:!!s.multiple},Jt("invalid",i);break;case"textarea":hE(i,s),Jt("invalid",i)}fx(t,s),r=null;for(var o in s)if(s.hasOwnProperty(o)){var a=s[o];o==="children"?typeof a=="string"?i.textContent!==a&&(s.suppressHydrationWarning!==!0&&Zd(i.textContent,a,n),r=["children",a]):typeof a=="number"&&i.textContent!==""+a&&(s.suppressHydrationWarning!==!0&&Zd(i.textContent,a,n),r=["children",""+a]):Ff.hasOwnProperty(o)&&a!=null&&o==="onScroll"&&Jt("scroll",i)}switch(t){case"input":Vd(i),fE(i,s,!0);break;case"textarea":Vd(i),dE(i);break;case"select":case"option":break;default:typeof s.onClick=="function"&&(i.onclick=Bm)}i=r,e.updateQueue=i,i!==null&&(e.flags|=4)}else{o=r.nodeType===9?r:r.ownerDocument,n==="http://www.w3.org/1999/xhtml"&&(n=sR(t)),n==="http://www.w3.org/1999/xhtml"?t==="script"?(n=o.createElement("div"),n.innerHTML="<script><\/script>",n=n.removeChild(n.firstChild)):typeof i.is=="string"?n=o.createElement(t,{is:i.is}):(n=o.createElement(t),t==="select"&&(o=n,i.multiple?o.multiple=!0:i.size&&(o.size=i.size))):n=o.createElementNS(n,t),n[as]=e,n[jf]=i,PP(n,e,!1,!1),e.stateNode=n;e:{switch(o=hx(t,i),t){case"dialog":Jt("cancel",n),Jt("close",n),r=i;break;case"iframe":case"object":case"embed":Jt("load",n),r=i;break;case"video":case"audio":for(r=0;r<df.length;r++)Jt(df[r],n);r=i;break;case"source":Jt("error",n),r=i;break;case"img":case"image":case"link":Jt("error",n),Jt("load",n),r=i;break;case"details":Jt("toggle",n),r=i;break;case"input":uE(n,i),r=ox(n,i),Jt("invalid",n);break;case"option":r=i;break;case"select":n._wrapperState={wasMultiple:!!i.multiple},r=cn({},i,{value:void 0}),Jt("invalid",n);break;case"textarea":hE(n,i),r=cx(n,i),Jt("invalid",n);break;default:r=i}fx(t,r),a=r;for(s in a)if(a.hasOwnProperty(s)){var l=a[s];s==="style"?lR(n,l):s==="dangerouslySetInnerHTML"?(l=l?l.__html:void 0,l!=null&&oR(n,l)):s==="children"?typeof l=="string"?(t!=="textarea"||l!=="")&&Nf(n,l):typeof l=="number"&&Nf(n,""+l):s!=="suppressContentEditableWarning"&&s!=="suppressHydrationWarning"&&s!=="autoFocus"&&(Ff.hasOwnProperty(s)?l!=null&&s==="onScroll"&&Jt("scroll",n):l!=null&&pA(n,s,l,o))}switch(t){case"input":Vd(n),fE(n,i,!1);break;case"textarea":Vd(n),dE(n);break;case"option":i.value!=null&&n.setAttribute("value",""+Wo(i.value));break;case"select":n.multiple=!!i.multiple,s=i.value,s!=null?wc(n,!!i.multiple,s,!1):i.defaultValue!=null&&wc(n,!!i.multiple,i.defaultValue,!0);break;default:typeof r.onClick=="function"&&(n.onclick=Bm)}switch(t){case"button":case"input":case"select":case"textarea":i=!!i.autoFocus;break e;case"img":i=!0;break e;default:i=!1}}i&&(e.flags|=4)}e.ref!==null&&(e.flags|=512,e.flags|=2097152)}return ni(e),null;case 6:if(n&&e.stateNode!=null)LP(n,e,n.memoizedProps,i);else{if(typeof i!="string"&&e.stateNode===null)throw Error(Ce(166));if(t=Ua(Jf.current),Ua(fs.current),qd(e)){if(i=e.stateNode,t=e.memoizedProps,i[as]=e,(s=i.nodeValue!==t)&&(n=Xi,n!==null))switch(n.tag){case 3:Zd(i.nodeValue,t,(n.mode&1)!==0);break;case 5:n.memoizedProps.suppressHydrationWarning!==!0&&Zd(i.nodeValue,t,(n.mode&1)!==0)}s&&(e.flags|=4)}else i=(t.nodeType===9?t:t.ownerDocument).createTextNode(i),i[as]=e,e.stateNode=i}return ni(e),null;case 13:if(Yt(nn),i=e.memoizedState,n===null||n.memoizedState!==null&&n.memoizedState.dehydrated!==null){if(Zt&&Vi!==null&&e.mode&1&&!(e.flags&128))YR(),Gc(),e.flags|=98560,s=!1;else if(s=qd(e),i!==null&&i.dehydrated!==null){if(n===null){if(!s)throw Error(Ce(318));if(s=e.memoizedState,s=s!==null?s.dehydrated:null,!s)throw Error(Ce(317));s[as]=e}else Gc(),!(e.flags&128)&&(e.memoizedState=null),e.flags|=4;ni(e),s=!1}else Dr!==null&&(Xx(Dr),Dr=null),s=!0;if(!s)return e.flags&65536?e:null}return e.flags&128?(e.lanes=t,e):(i=i!==null,i!==(n!==null&&n.memoizedState!==null)&&i&&(e.child.flags|=8192,e.mode&1&&(n===null||nn.current&1?Ln===0&&(Ln=3):QA())),e.updateQueue!==null&&(e.flags|=4),ni(e),null);case 4:return Wc(),Ux(n,e),n===null&&Vf(e.stateNode.containerInfo),ni(e),null;case 10:return IA(e.type._context),ni(e),null;case 17:return Ri(e.type)&&Lm(),ni(e),null;case 19:if(Yt(nn),s=e.memoizedState,s===null)return ni(e),null;if(i=(e.flags&128)!==0,o=s.rendering,o===null)if(i)Hu(s,!1);else{if(Ln!==0||n!==null&&n.flags&128)for(n=e.child;n!==null;){if(o=km(n),o!==null){for(e.flags|=128,Hu(s,!1),i=o.updateQueue,i!==null&&(e.updateQueue=i,e.flags|=4),e.subtreeFlags=0,i=t,t=e.child;t!==null;)s=t,n=i,s.flags&=14680066,o=s.alternate,o===null?(s.childLanes=0,s.lanes=n,s.child=null,s.subtreeFlags=0,s.memoizedProps=null,s.memoizedState=null,s.updateQueue=null,s.dependencies=null,s.stateNode=null):(s.childLanes=o.childLanes,s.lanes=o.lanes,s.child=o.child,s.subtreeFlags=0,s.deletions=null,s.memoizedProps=o.memoizedProps,s.memoizedState=o.memoizedState,s.updateQueue=o.updateQueue,s.type=o.type,n=o.dependencies,s.dependencies=n===null?null:{lanes:n.lanes,firstContext:n.firstContext}),t=t.sibling;return Wt(nn,nn.current&1|2),e.child}n=n.sibling}s.tail!==null&&xn()>Xc&&(e.flags|=128,i=!0,Hu(s,!1),e.lanes=4194304)}else{if(!i)if(n=km(o),n!==null){if(e.flags|=128,i=!0,t=n.updateQueue,t!==null&&(e.updateQueue=t,e.flags|=4),Hu(s,!0),s.tail===null&&s.tailMode==="hidden"&&!o.alternate&&!Zt)return ni(e),null}else 2*xn()-s.renderingStartTime>Xc&&t!==1073741824&&(e.flags|=128,i=!0,Hu(s,!1),e.lanes=4194304);s.isBackwards?(o.sibling=e.child,e.child=o):(t=s.last,t!==null?t.sibling=o:e.child=o,s.last=o)}return s.tail!==null?(e=s.tail,s.rendering=e,s.tail=e.sibling,s.renderingStartTime=xn(),e.sibling=null,t=nn.current,Wt(nn,i?t&1|2:t&1),e):(ni(e),null);case 22:case 23:return YA(),i=e.memoizedState!==null,n!==null&&n.memoizedState!==null!==i&&(e.flags|=8192),i&&e.mode&1?Gi&1073741824&&(ni(e),e.subtreeFlags&6&&(e.flags|=8192)):ni(e),null;case 24:return null;case 25:return null}throw Error(Ce(156,e.tag))}function p3(n,e){switch(RA(e),e.tag){case 1:return Ri(e.type)&&Lm(),n=e.flags,n&65536?(e.flags=n&-65537|128,e):null;case 3:return Wc(),Yt(bi),Yt(oi),UA(),n=e.flags,n&65536&&!(n&128)?(e.flags=n&-65537|128,e):null;case 5:return OA(e),null;case 13:if(Yt(nn),n=e.memoizedState,n!==null&&n.dehydrated!==null){if(e.alternate===null)throw Error(Ce(340));Gc()}return n=e.flags,n&65536?(e.flags=n&-65537|128,e):null;case 19:return Yt(nn),null;case 4:return Wc(),null;case 10:return IA(e.type._context),null;case 22:case 23:return YA(),null;case 24:return null;default:return null}}var tp=!1,si=!1,m3=typeof WeakSet=="function"?WeakSet:Set,je=null;function pc(n,e){var t=n.ref;if(t!==null)if(typeof t=="function")try{t(null)}catch(i){pn(n,e,i)}else t.current=null}function kx(n,e,t){try{t()}catch(i){pn(n,e,i)}}var nw=!1;function g3(n,e){if(Sx=bm,n=NR(),CA(n)){if("selectionStart"in n)var t={start:n.selectionStart,end:n.selectionEnd};else e:{t=(t=n.ownerDocument)&&t.defaultView||window;var i=t.getSelection&&t.getSelection();if(i&&i.rangeCount!==0){t=i.anchorNode;var r=i.anchorOffset,s=i.focusNode;i=i.focusOffset;try{t.nodeType,s.nodeType}catch{t=null;break e}var o=0,a=-1,l=-1,u=0,h=0,d=n,p=null;t:for(;;){for(var m;d!==t||r!==0&&d.nodeType!==3||(a=o+r),d!==s||i!==0&&d.nodeType!==3||(l=o+i),d.nodeType===3&&(o+=d.nodeValue.length),(m=d.firstChild)!==null;)p=d,d=m;for(;;){if(d===n)break t;if(p===t&&++u===r&&(a=o),p===s&&++h===i&&(l=o),(m=d.nextSibling)!==null)break;d=p,p=d.parentNode}d=m}t=a===-1||l===-1?null:{start:a,end:l}}else t=null}t=t||{start:0,end:0}}else t=null;for(Mx={focusedElem:n,selectionRange:t},bm=!1,je=e;je!==null;)if(e=je,n=e.child,(e.subtreeFlags&1028)!==0&&n!==null)n.return=e,je=n;else for(;je!==null;){e=je;try{var y=e.alternate;if(e.flags&1024)switch(e.tag){case 0:case 11:case 15:break;case 1:if(y!==null){var M=y.memoizedProps,_=y.memoizedState,g=e.stateNode,x=g.getSnapshotBeforeUpdate(e.elementType===e.type?M:Br(e.type,M),_);g.__reactInternalSnapshotBeforeUpdate=x}break;case 3:var S=e.stateNode.containerInfo;S.nodeType===1?S.textContent="":S.nodeType===9&&S.documentElement&&S.removeChild(S.documentElement);break;case 5:case 6:case 4:case 17:break;default:throw Error(Ce(163))}}catch(E){pn(e,e.return,E)}if(n=e.sibling,n!==null){n.return=e.return,je=n;break}je=e.return}return y=nw,nw=!1,y}function Mf(n,e,t){var i=e.updateQueue;if(i=i!==null?i.lastEffect:null,i!==null){var r=i=i.next;do{if((r.tag&n)===n){var s=r.destroy;r.destroy=void 0,s!==void 0&&kx(e,t,s)}r=r.next}while(r!==i)}}function vg(n,e){if(e=e.updateQueue,e=e!==null?e.lastEffect:null,e!==null){var t=e=e.next;do{if((t.tag&n)===n){var i=t.create;t.destroy=i()}t=t.next}while(t!==e)}}function Hx(n){var e=n.ref;if(e!==null){var t=n.stateNode;switch(n.tag){case 5:n=t;break;default:n=t}typeof e=="function"?e(n):e.current=n}}function IP(n){var e=n.alternate;e!==null&&(n.alternate=null,IP(e)),n.child=null,n.deletions=null,n.sibling=null,n.tag===5&&(e=n.stateNode,e!==null&&(delete e[as],delete e[jf],delete e[Tx],delete e[qN],delete e[$N])),n.stateNode=null,n.return=null,n.dependencies=null,n.memoizedProps=null,n.memoizedState=null,n.pendingProps=null,n.stateNode=null,n.updateQueue=null}function DP(n){return n.tag===5||n.tag===3||n.tag===4}function iw(n){e:for(;;){for(;n.sibling===null;){if(n.return===null||DP(n.return))return null;n=n.return}for(n.sibling.return=n.return,n=n.sibling;n.tag!==5&&n.tag!==6&&n.tag!==18;){if(n.flags&2||n.child===null||n.tag===4)continue e;n.child.return=n,n=n.child}if(!(n.flags&2))return n.stateNode}}function zx(n,e,t){var i=n.tag;if(i===5||i===6)n=n.stateNode,e?t.nodeType===8?t.parentNode.insertBefore(n,e):t.insertBefore(n,e):(t.nodeType===8?(e=t.parentNode,e.insertBefore(n,t)):(e=t,e.appendChild(n)),t=t._reactRootContainer,t!=null||e.onclick!==null||(e.onclick=Bm));else if(i!==4&&(n=n.child,n!==null))for(zx(n,e,t),n=n.sibling;n!==null;)zx(n,e,t),n=n.sibling}function Gx(n,e,t){var i=n.tag;if(i===5||i===6)n=n.stateNode,e?t.insertBefore(n,e):t.appendChild(n);else if(i!==4&&(n=n.child,n!==null))for(Gx(n,e,t),n=n.sibling;n!==null;)Gx(n,e,t),n=n.sibling}var jn=null,Ir=!1;function fo(n,e,t){for(t=t.child;t!==null;)FP(n,e,t),t=t.sibling}function FP(n,e,t){if(us&&typeof us.onCommitFiberUnmount=="function")try{us.onCommitFiberUnmount(cg,t)}catch{}switch(t.tag){case 5:si||pc(t,e);case 6:var i=jn,r=Ir;jn=null,fo(n,e,t),jn=i,Ir=r,jn!==null&&(Ir?(n=jn,t=t.stateNode,n.nodeType===8?n.parentNode.removeChild(t):n.removeChild(t)):jn.removeChild(t.stateNode));break;case 18:jn!==null&&(Ir?(n=jn,t=t.stateNode,n.nodeType===8?Iv(n.parentNode,t):n.nodeType===1&&Iv(n,t),Hf(n)):Iv(jn,t.stateNode));break;case 4:i=jn,r=Ir,jn=t.stateNode.containerInfo,Ir=!0,fo(n,e,t),jn=i,Ir=r;break;case 0:case 11:case 14:case 15:if(!si&&(i=t.updateQueue,i!==null&&(i=i.lastEffect,i!==null))){r=i=i.next;do{var s=r,o=s.destroy;s=s.tag,o!==void 0&&(s&2||s&4)&&kx(t,e,o),r=r.next}while(r!==i)}fo(n,e,t);break;case 1:if(!si&&(pc(t,e),i=t.stateNode,typeof i.componentWillUnmount=="function"))try{i.props=t.memoizedProps,i.state=t.memoizedState,i.componentWillUnmount()}catch(a){pn(t,e,a)}fo(n,e,t);break;case 21:fo(n,e,t);break;case 22:t.mode&1?(si=(i=si)||t.memoizedState!==null,fo(n,e,t),si=i):fo(n,e,t);break;default:fo(n,e,t)}}function rw(n){var e=n.updateQueue;if(e!==null){n.updateQueue=null;var t=n.stateNode;t===null&&(t=n.stateNode=new m3),e.forEach(function(i){var r=w3.bind(null,n,i);t.has(i)||(t.add(i),i.then(r,r))})}}function Cr(n,e){var t=e.deletions;if(t!==null)for(var i=0;i<t.length;i++){var r=t[i];try{var s=n,o=e,a=o;e:for(;a!==null;){switch(a.tag){case 5:jn=a.stateNode,Ir=!1;break e;case 3:jn=a.stateNode.containerInfo,Ir=!0;break e;case 4:jn=a.stateNode.containerInfo,Ir=!0;break e}a=a.return}if(jn===null)throw Error(Ce(160));FP(s,o,r),jn=null,Ir=!1;var l=r.alternate;l!==null&&(l.return=null),r.return=null}catch(u){pn(r,e,u)}}if(e.subtreeFlags&12854)for(e=e.child;e!==null;)NP(e,n),e=e.sibling}function NP(n,e){var t=n.alternate,i=n.flags;switch(n.tag){case 0:case 11:case 14:case 15:if(Cr(e,n),rs(n),i&4){try{Mf(3,n,n.return),vg(3,n)}catch(M){pn(n,n.return,M)}try{Mf(5,n,n.return)}catch(M){pn(n,n.return,M)}}break;case 1:Cr(e,n),rs(n),i&512&&t!==null&&pc(t,t.return);break;case 5:if(Cr(e,n),rs(n),i&512&&t!==null&&pc(t,t.return),n.flags&32){var r=n.stateNode;try{Nf(r,"")}catch(M){pn(n,n.return,M)}}if(i&4&&(r=n.stateNode,r!=null)){var s=n.memoizedProps,o=t!==null?t.memoizedProps:s,a=n.type,l=n.updateQueue;if(n.updateQueue=null,l!==null)try{a==="input"&&s.type==="radio"&&s.name!=null&&iR(r,s),hx(a,o);var u=hx(a,s);for(o=0;o<l.length;o+=2){var h=l[o],d=l[o+1];h==="style"?lR(r,d):h==="dangerouslySetInnerHTML"?oR(r,d):h==="children"?Nf(r,d):pA(r,h,d,u)}switch(a){case"input":ax(r,s);break;case"textarea":rR(r,s);break;case"select":var p=r._wrapperState.wasMultiple;r._wrapperState.wasMultiple=!!s.multiple;var m=s.value;m!=null?wc(r,!!s.multiple,m,!1):p!==!!s.multiple&&(s.defaultValue!=null?wc(r,!!s.multiple,s.defaultValue,!0):wc(r,!!s.multiple,s.multiple?[]:"",!1))}r[jf]=s}catch(M){pn(n,n.return,M)}}break;case 6:if(Cr(e,n),rs(n),i&4){if(n.stateNode===null)throw Error(Ce(162));r=n.stateNode,s=n.memoizedProps;try{r.nodeValue=s}catch(M){pn(n,n.return,M)}}break;case 3:if(Cr(e,n),rs(n),i&4&&t!==null&&t.memoizedState.isDehydrated)try{Hf(e.containerInfo)}catch(M){pn(n,n.return,M)}break;case 4:Cr(e,n),rs(n);break;case 13:Cr(e,n),rs(n),r=n.child,r.flags&8192&&(s=r.memoizedState!==null,r.stateNode.isHidden=s,!s||r.alternate!==null&&r.alternate.memoizedState!==null||(JA=xn())),i&4&&rw(n);break;case 22:if(h=t!==null&&t.memoizedState!==null,n.mode&1?(si=(u=si)||h,Cr(e,n),si=u):Cr(e,n),rs(n),i&8192){if(u=n.memoizedState!==null,(n.stateNode.isHidden=u)&&!h&&n.mode&1)for(je=n,h=n.child;h!==null;){for(d=je=h;je!==null;){switch(p=je,m=p.child,p.tag){case 0:case 11:case 14:case 15:Mf(4,p,p.return);break;case 1:pc(p,p.return);var y=p.stateNode;if(typeof y.componentWillUnmount=="function"){i=p,t=p.return;try{e=i,y.props=e.memoizedProps,y.state=e.memoizedState,y.componentWillUnmount()}catch(M){pn(i,t,M)}}break;case 5:pc(p,p.return);break;case 22:if(p.memoizedState!==null){ow(d);continue}}m!==null?(m.return=p,je=m):ow(d)}h=h.sibling}e:for(h=null,d=n;;){if(d.tag===5){if(h===null){h=d;try{r=d.stateNode,u?(s=r.style,typeof s.setProperty=="function"?s.setProperty("display","none","important"):s.display="none"):(a=d.stateNode,l=d.memoizedProps.style,o=l!=null&&l.hasOwnProperty("display")?l.display:null,a.style.display=aR("display",o))}catch(M){pn(n,n.return,M)}}}else if(d.tag===6){if(h===null)try{d.stateNode.nodeValue=u?"":d.memoizedProps}catch(M){pn(n,n.return,M)}}else if((d.tag!==22&&d.tag!==23||d.memoizedState===null||d===n)&&d.child!==null){d.child.return=d,d=d.child;continue}if(d===n)break e;for(;d.sibling===null;){if(d.return===null||d.return===n)break e;h===d&&(h=null),d=d.return}h===d&&(h=null),d.sibling.return=d.return,d=d.sibling}}break;case 19:Cr(e,n),rs(n),i&4&&rw(n);break;case 21:break;default:Cr(e,n),rs(n)}}function rs(n){var e=n.flags;if(e&2){try{e:{for(var t=n.return;t!==null;){if(DP(t)){var i=t;break e}t=t.return}throw Error(Ce(160))}switch(i.tag){case 5:var r=i.stateNode;i.flags&32&&(Nf(r,""),i.flags&=-33);var s=iw(n);Gx(n,s,r);break;case 3:case 4:var o=i.stateNode.containerInfo,a=iw(n);zx(n,a,o);break;default:throw Error(Ce(161))}}catch(l){pn(n,n.return,l)}n.flags&=-3}e&4096&&(n.flags&=-4097)}function v3(n,e,t){je=n,OP(n)}function OP(n,e,t){for(var i=(n.mode&1)!==0;je!==null;){var r=je,s=r.child;if(r.tag===22&&i){var o=r.memoizedState!==null||tp;if(!o){var a=r.alternate,l=a!==null&&a.memoizedState!==null||si;a=tp;var u=si;if(tp=o,(si=l)&&!u)for(je=r;je!==null;)o=je,l=o.child,o.tag===22&&o.memoizedState!==null?aw(r):l!==null?(l.return=o,je=l):aw(r);for(;s!==null;)je=s,OP(s),s=s.sibling;je=r,tp=a,si=u}sw(n)}else r.subtreeFlags&8772&&s!==null?(s.return=r,je=s):sw(n)}}function sw(n){for(;je!==null;){var e=je;if(e.flags&8772){var t=e.alternate;try{if(e.flags&8772)switch(e.tag){case 0:case 11:case 15:si||vg(5,e);break;case 1:var i=e.stateNode;if(e.flags&4&&!si)if(t===null)i.componentDidMount();else{var r=e.elementType===e.type?t.memoizedProps:Br(e.type,t.memoizedProps);i.componentDidUpdate(r,t.memoizedState,i.__reactInternalSnapshotBeforeUpdate)}var s=e.updateQueue;s!==null&&GE(e,s,i);break;case 3:var o=e.updateQueue;if(o!==null){if(t=null,e.child!==null)switch(e.child.tag){case 5:t=e.child.stateNode;break;case 1:t=e.child.stateNode}GE(e,o,t)}break;case 5:var a=e.stateNode;if(t===null&&e.flags&4){t=a;var l=e.memoizedProps;switch(e.type){case"button":case"input":case"select":case"textarea":l.autoFocus&&t.focus();break;case"img":l.src&&(t.src=l.src)}}break;case 6:break;case 4:break;case 12:break;case 13:if(e.memoizedState===null){var u=e.alternate;if(u!==null){var h=u.memoizedState;if(h!==null){var d=h.dehydrated;d!==null&&Hf(d)}}}break;case 19:case 17:case 21:case 22:case 23:case 25:break;default:throw Error(Ce(163))}si||e.flags&512&&Hx(e)}catch(p){pn(e,e.return,p)}}if(e===n){je=null;break}if(t=e.sibling,t!==null){t.return=e.return,je=t;break}je=e.return}}function ow(n){for(;je!==null;){var e=je;if(e===n){je=null;break}var t=e.sibling;if(t!==null){t.return=e.return,je=t;break}je=e.return}}function aw(n){for(;je!==null;){var e=je;try{switch(e.tag){case 0:case 11:case 15:var t=e.return;try{vg(4,e)}catch(l){pn(e,t,l)}break;case 1:var i=e.stateNode;if(typeof i.componentDidMount=="function"){var r=e.return;try{i.componentDidMount()}catch(l){pn(e,r,l)}}var s=e.return;try{Hx(e)}catch(l){pn(e,s,l)}break;case 5:var o=e.return;try{Hx(e)}catch(l){pn(e,o,l)}}}catch(l){pn(e,e.return,l)}if(e===n){je=null;break}var a=e.sibling;if(a!==null){a.return=e.return,je=a;break}je=e.return}}var y3=Math.ceil,Gm=eo.ReactCurrentDispatcher,jA=eo.ReactCurrentOwner,xr=eo.ReactCurrentBatchConfig,Pt=0,zn=null,Tn=null,Jn=0,Gi=0,mc=ea(0),Ln=0,Zf=null,nl=0,yg=0,XA=0,Ef=null,Ei=null,JA=0,Xc=1/0,Fs=null,Vm=!1,Vx=null,Do=null,np=!1,bo=null,Wm=0,wf=0,Wx=null,lm=-1,cm=0;function gi(){return Pt&6?xn():lm!==-1?lm:lm=xn()}function Fo(n){return n.mode&1?Pt&2&&Jn!==0?Jn&-Jn:t3.transition!==null?(cm===0&&(cm=_R()),cm):(n=Ot,n!==0||(n=window.event,n=n===void 0?16:CR(n.type)),n):1}function Ur(n,e,t,i){if(50<wf)throw wf=0,Wx=null,Error(Ce(185));vh(n,t,i),(!(Pt&2)||n!==zn)&&(n===zn&&(!(Pt&2)&&(yg|=t),Ln===4&&To(n,Jn)),Pi(n,i),t===1&&Pt===0&&!(e.mode&1)&&(Xc=xn()+500,pg&&ta()))}function Pi(n,e){var t=n.callbackNode;tN(n,e);var i=Cm(n,n===zn?Jn:0);if(i===0)t!==null&&gE(t),n.callbackNode=null,n.callbackPriority=0;else if(e=i&-i,n.callbackPriority!==e){if(t!=null&&gE(t),e===1)n.tag===0?e3(lw.bind(null,n)):XR(lw.bind(null,n)),QN(function(){!(Pt&6)&&ta()}),t=null;else{switch(AR(i)){case 1:t=xA;break;case 4:t=yR;break;case 16:t=Tm;break;case 536870912:t=xR;break;default:t=Tm}t=jP(t,UP.bind(null,n))}n.callbackPriority=e,n.callbackNode=t}}function UP(n,e){if(lm=-1,cm=0,Pt&6)throw Error(Ce(327));var t=n.callbackNode;if(Pc()&&n.callbackNode!==t)return null;var i=Cm(n,n===zn?Jn:0);if(i===0)return null;if(i&30||i&n.expiredLanes||e)e=jm(n,i);else{e=i;var r=Pt;Pt|=2;var s=HP();(zn!==n||Jn!==e)&&(Fs=null,Xc=xn()+500,Xa(n,e));do try{A3();break}catch(a){kP(n,a)}while(1);LA(),Gm.current=s,Pt=r,Tn!==null?e=0:(zn=null,Jn=0,e=Ln)}if(e!==0){if(e===2&&(r=vx(n),r!==0&&(i=r,e=jx(n,r))),e===1)throw t=Zf,Xa(n,0),To(n,i),Pi(n,xn()),t;if(e===6)To(n,i);else{if(r=n.current.alternate,!(i&30)&&!x3(r)&&(e=jm(n,i),e===2&&(s=vx(n),s!==0&&(i=s,e=jx(n,s))),e===1))throw t=Zf,Xa(n,0),To(n,i),Pi(n,xn()),t;switch(n.finishedWork=r,n.finishedLanes=i,e){case 0:case 1:throw Error(Ce(345));case 2:ba(n,Ei,Fs);break;case 3:if(To(n,i),(i&130023424)===i&&(e=JA+500-xn(),10<e)){if(Cm(n,0)!==0)break;if(r=n.suspendedLanes,(r&i)!==i){gi(),n.pingedLanes|=n.suspendedLanes&r;break}n.timeoutHandle=wx(ba.bind(null,n,Ei,Fs),e);break}ba(n,Ei,Fs);break;case 4:if(To(n,i),(i&4194240)===i)break;for(e=n.eventTimes,r=-1;0<i;){var o=31-Or(i);s=1<<o,o=e[o],o>r&&(r=o),i&=~s}if(i=r,i=xn()-i,i=(120>i?120:480>i?480:1080>i?1080:1920>i?1920:3e3>i?3e3:4320>i?4320:1960*y3(i/1960))-i,10<i){n.timeoutHandle=wx(ba.bind(null,n,Ei,Fs),i);break}ba(n,Ei,Fs);break;case 5:ba(n,Ei,Fs);break;default:throw Error(Ce(329))}}}return Pi(n,xn()),n.callbackNode===t?UP.bind(null,n):null}function jx(n,e){var t=Ef;return n.current.memoizedState.isDehydrated&&(Xa(n,e).flags|=256),n=jm(n,e),n!==2&&(e=Ei,Ei=t,e!==null&&Xx(e)),n}function Xx(n){Ei===null?Ei=n:Ei.push.apply(Ei,n)}function x3(n){for(var e=n;;){if(e.flags&16384){var t=e.updateQueue;if(t!==null&&(t=t.stores,t!==null))for(var i=0;i<t.length;i++){var r=t[i],s=r.getSnapshot;r=r.value;try{if(!Gr(s(),r))return!1}catch{return!1}}}if(t=e.child,e.subtreeFlags&16384&&t!==null)t.return=e,e=t;else{if(e===n)break;for(;e.sibling===null;){if(e.return===null||e.return===n)return!0;e=e.return}e.sibling.return=e.return,e=e.sibling}}return!0}function To(n,e){for(e&=~XA,e&=~yg,n.suspendedLanes|=e,n.pingedLanes&=~e,n=n.expirationTimes;0<e;){var t=31-Or(e),i=1<<t;n[t]=-1,e&=~i}}function lw(n){if(Pt&6)throw Error(Ce(327));Pc();var e=Cm(n,0);if(!(e&1))return Pi(n,xn()),null;var t=jm(n,e);if(n.tag!==0&&t===2){var i=vx(n);i!==0&&(e=i,t=jx(n,i))}if(t===1)throw t=Zf,Xa(n,0),To(n,e),Pi(n,xn()),t;if(t===6)throw Error(Ce(345));return n.finishedWork=n.current.alternate,n.finishedLanes=e,ba(n,Ei,Fs),Pi(n,xn()),null}function KA(n,e){var t=Pt;Pt|=1;try{return n(e)}finally{Pt=t,Pt===0&&(Xc=xn()+500,pg&&ta())}}function il(n){bo!==null&&bo.tag===0&&!(Pt&6)&&Pc();var e=Pt;Pt|=1;var t=xr.transition,i=Ot;try{if(xr.transition=null,Ot=1,n)return n()}finally{Ot=i,xr.transition=t,Pt=e,!(Pt&6)&&ta()}}function YA(){Gi=mc.current,Yt(mc)}function Xa(n,e){n.finishedWork=null,n.finishedLanes=0;var t=n.timeoutHandle;if(t!==-1&&(n.timeoutHandle=-1,YN(t)),Tn!==null)for(t=Tn.return;t!==null;){var i=t;switch(RA(i),i.tag){case 1:i=i.type.childContextTypes,i!=null&&Lm();break;case 3:Wc(),Yt(bi),Yt(oi),UA();break;case 5:OA(i);break;case 4:Wc();break;case 13:Yt(nn);break;case 19:Yt(nn);break;case 10:IA(i.type._context);break;case 22:case 23:YA()}t=t.return}if(zn=n,Tn=n=No(n.current,null),Jn=Gi=e,Ln=0,Zf=null,XA=yg=nl=0,Ei=Ef=null,Oa!==null){for(e=0;e<Oa.length;e++)if(t=Oa[e],i=t.interleaved,i!==null){t.interleaved=null;var r=i.next,s=t.pending;if(s!==null){var o=s.next;s.next=r,i.next=o}t.pending=i}Oa=null}return n}function kP(n,e){do{var t=Tn;try{if(LA(),sm.current=zm,Hm){for(var i=ln.memoizedState;i!==null;){var r=i.queue;r!==null&&(r.pending=null),i=i.next}Hm=!1}if(tl=0,kn=Pn=ln=null,Sf=!1,Kf=0,jA.current=null,t===null||t.return===null){Ln=1,Zf=e,Tn=null;break}e:{var s=n,o=t.return,a=t,l=e;if(e=Jn,a.flags|=32768,l!==null&&typeof l=="object"&&typeof l.then=="function"){var u=l,h=a,d=h.tag;if(!(h.mode&1)&&(d===0||d===11||d===15)){var p=h.alternate;p?(h.updateQueue=p.updateQueue,h.memoizedState=p.memoizedState,h.lanes=p.lanes):(h.updateQueue=null,h.memoizedState=null)}var m=YE(o);if(m!==null){m.flags&=-257,QE(m,o,a,s,e),m.mode&1&&KE(s,u,e),e=m,l=u;var y=e.updateQueue;if(y===null){var M=new Set;M.add(l),e.updateQueue=M}else y.add(l);break e}else{if(!(e&1)){KE(s,u,e),QA();break e}l=Error(Ce(426))}}else if(Zt&&a.mode&1){var _=YE(o);if(_!==null){!(_.flags&65536)&&(_.flags|=256),QE(_,o,a,s,e),PA(jc(l,a));break e}}s=l=jc(l,a),Ln!==4&&(Ln=2),Ef===null?Ef=[s]:Ef.push(s),s=o;do{switch(s.tag){case 3:s.flags|=65536,e&=-e,s.lanes|=e;var g=SP(s,l,e);zE(s,g);break e;case 1:a=l;var x=s.type,S=s.stateNode;if(!(s.flags&128)&&(typeof x.getDerivedStateFromError=="function"||S!==null&&typeof S.componentDidCatch=="function"&&(Do===null||!Do.has(S)))){s.flags|=65536,e&=-e,s.lanes|=e;var E=MP(s,a,e);zE(s,E);break e}}s=s.return}while(s!==null)}GP(t)}catch(C){e=C,Tn===t&&t!==null&&(Tn=t=t.return);continue}break}while(1)}function HP(){var n=Gm.current;return Gm.current=zm,n===null?zm:n}function QA(){(Ln===0||Ln===3||Ln===2)&&(Ln=4),zn===null||!(nl&268435455)&&!(yg&268435455)||To(zn,Jn)}function jm(n,e){var t=Pt;Pt|=2;var i=HP();(zn!==n||Jn!==e)&&(Fs=null,Xa(n,e));do try{_3();break}catch(r){kP(n,r)}while(1);if(LA(),Pt=t,Gm.current=i,Tn!==null)throw Error(Ce(261));return zn=null,Jn=0,Ln}function _3(){for(;Tn!==null;)zP(Tn)}function A3(){for(;Tn!==null&&!XF();)zP(Tn)}function zP(n){var e=WP(n.alternate,n,Gi);n.memoizedProps=n.pendingProps,e===null?GP(n):Tn=e,jA.current=null}function GP(n){var e=n;do{var t=e.alternate;if(n=e.return,e.flags&32768){if(t=p3(t,e),t!==null){t.flags&=32767,Tn=t;return}if(n!==null)n.flags|=32768,n.subtreeFlags=0,n.deletions=null;else{Ln=6,Tn=null;return}}else if(t=d3(t,e,Gi),t!==null){Tn=t;return}if(e=e.sibling,e!==null){Tn=e;return}Tn=e=n}while(e!==null);Ln===0&&(Ln=5)}function ba(n,e,t){var i=Ot,r=xr.transition;try{xr.transition=null,Ot=1,S3(n,e,t,i)}finally{xr.transition=r,Ot=i}return null}function S3(n,e,t,i){do Pc();while(bo!==null);if(Pt&6)throw Error(Ce(327));t=n.finishedWork;var r=n.finishedLanes;if(t===null)return null;if(n.finishedWork=null,n.finishedLanes=0,t===n.current)throw Error(Ce(177));n.callbackNode=null,n.callbackPriority=0;var s=t.lanes|t.childLanes;if(nN(n,s),n===zn&&(Tn=zn=null,Jn=0),!(t.subtreeFlags&2064)&&!(t.flags&2064)||np||(np=!0,jP(Tm,function(){return Pc(),null})),s=(t.flags&15990)!==0,t.subtreeFlags&15990||s){s=xr.transition,xr.transition=null;var o=Ot;Ot=1;var a=Pt;Pt|=4,jA.current=null,g3(n,t),NP(t,n),GN(Mx),bm=!!Sx,Mx=Sx=null,n.current=t,v3(t),JF(),Pt=a,Ot=o,xr.transition=s}else n.current=t;if(np&&(np=!1,bo=n,Wm=r),s=n.pendingLanes,s===0&&(Do=null),QF(t.stateNode),Pi(n,xn()),e!==null)for(i=n.onRecoverableError,t=0;t<e.length;t++)r=e[t],i(r.value,{componentStack:r.stack,digest:r.digest});if(Vm)throw Vm=!1,n=Vx,Vx=null,n;return Wm&1&&n.tag!==0&&Pc(),s=n.pendingLanes,s&1?n===Wx?wf++:(wf=0,Wx=n):wf=0,ta(),null}function Pc(){if(bo!==null){var n=AR(Wm),e=xr.transition,t=Ot;try{if(xr.transition=null,Ot=16>n?16:n,bo===null)var i=!1;else{if(n=bo,bo=null,Wm=0,Pt&6)throw Error(Ce(331));var r=Pt;for(Pt|=4,je=n.current;je!==null;){var s=je,o=s.child;if(je.flags&16){var a=s.deletions;if(a!==null){for(var l=0;l<a.length;l++){var u=a[l];for(je=u;je!==null;){var h=je;switch(h.tag){case 0:case 11:case 15:Mf(8,h,s)}var d=h.child;if(d!==null)d.return=h,je=d;else for(;je!==null;){h=je;var p=h.sibling,m=h.return;if(IP(h),h===u){je=null;break}if(p!==null){p.return=m,je=p;break}je=m}}}var y=s.alternate;if(y!==null){var M=y.child;if(M!==null){y.child=null;do{var _=M.sibling;M.sibling=null,M=_}while(M!==null)}}je=s}}if(s.subtreeFlags&2064&&o!==null)o.return=s,je=o;else e:for(;je!==null;){if(s=je,s.flags&2048)switch(s.tag){case 0:case 11:case 15:Mf(9,s,s.return)}var g=s.sibling;if(g!==null){g.return=s.return,je=g;break e}je=s.return}}var x=n.current;for(je=x;je!==null;){o=je;var S=o.child;if(o.subtreeFlags&2064&&S!==null)S.return=o,je=S;else e:for(o=x;je!==null;){if(a=je,a.flags&2048)try{switch(a.tag){case 0:case 11:case 15:vg(9,a)}}catch(C){pn(a,a.return,C)}if(a===o){je=null;break e}var E=a.sibling;if(E!==null){E.return=a.return,je=E;break e}je=a.return}}if(Pt=r,ta(),us&&typeof us.onPostCommitFiberRoot=="function")try{us.onPostCommitFiberRoot(cg,n)}catch{}i=!0}return i}finally{Ot=t,xr.transition=e}}return!1}function cw(n,e,t){e=jc(t,e),e=SP(n,e,1),n=Io(n,e,1),e=gi(),n!==null&&(vh(n,1,e),Pi(n,e))}function pn(n,e,t){if(n.tag===3)cw(n,n,t);else for(;e!==null;){if(e.tag===3){cw(e,n,t);break}else if(e.tag===1){var i=e.stateNode;if(typeof e.type.getDerivedStateFromError=="function"||typeof i.componentDidCatch=="function"&&(Do===null||!Do.has(i))){n=jc(t,n),n=MP(e,n,1),e=Io(e,n,1),n=gi(),e!==null&&(vh(e,1,n),Pi(e,n));break}}e=e.return}}function M3(n,e,t){var i=n.pingCache;i!==null&&i.delete(e),e=gi(),n.pingedLanes|=n.suspendedLanes&t,zn===n&&(Jn&t)===t&&(Ln===4||Ln===3&&(Jn&130023424)===Jn&&500>xn()-JA?Xa(n,0):XA|=t),Pi(n,e)}function VP(n,e){e===0&&(n.mode&1?(e=Xd,Xd<<=1,!(Xd&130023424)&&(Xd=4194304)):e=1);var t=gi();n=Ys(n,e),n!==null&&(vh(n,e,t),Pi(n,t))}function E3(n){var e=n.memoizedState,t=0;e!==null&&(t=e.retryLane),VP(n,t)}function w3(n,e){var t=0;switch(n.tag){case 13:var i=n.stateNode,r=n.memoizedState;r!==null&&(t=r.retryLane);break;case 19:i=n.stateNode;break;default:throw Error(Ce(314))}i!==null&&i.delete(e),VP(n,t)}var WP;WP=function(n,e,t){if(n!==null)if(n.memoizedProps!==e.pendingProps||bi.current)Ci=!0;else{if(!(n.lanes&t)&&!(e.flags&128))return Ci=!1,h3(n,e,t);Ci=!!(n.flags&131072)}else Ci=!1,Zt&&e.flags&1048576&&JR(e,Fm,e.index);switch(e.lanes=0,e.tag){case 2:var i=e.type;am(n,e),n=e.pendingProps;var r=zc(e,oi.current);Rc(e,t),r=HA(null,e,i,n,r,t);var s=zA();return e.flags|=1,typeof r=="object"&&r!==null&&typeof r.render=="function"&&r.$$typeof===void 0?(e.tag=1,e.memoizedState=null,e.updateQueue=null,Ri(i)?(s=!0,Im(e)):s=!1,e.memoizedState=r.state!==null&&r.state!==void 0?r.state:null,FA(e),r.updater=mg,e.stateNode=r,r._reactInternals=e,Lx(e,i,n,t),e=Fx(null,e,i,!0,s,t)):(e.tag=0,Zt&&s&&bA(e),pi(null,e,r,t),e=e.child),e;case 16:i=e.elementType;e:{switch(am(n,e),n=e.pendingProps,r=i._init,i=r(i._payload),e.type=i,r=e.tag=C3(i),n=Br(i,n),r){case 0:e=Dx(null,e,i,n,t);break e;case 1:e=$E(null,e,i,n,t);break e;case 11:e=ZE(null,e,i,n,t);break e;case 14:e=qE(null,e,i,Br(i.type,n),t);break e}throw Error(Ce(306,i,""))}return e;case 0:return i=e.type,r=e.pendingProps,r=e.elementType===i?r:Br(i,r),Dx(n,e,i,r,t);case 1:return i=e.type,r=e.pendingProps,r=e.elementType===i?r:Br(i,r),$E(n,e,i,r,t);case 3:e:{if(CP(e),n===null)throw Error(Ce(387));i=e.pendingProps,s=e.memoizedState,r=s.element,ZR(n,e),Um(e,i,null,t);var o=e.memoizedState;if(i=o.element,s.isDehydrated)if(s={element:i,isDehydrated:!1,cache:o.cache,pendingSuspenseBoundaries:o.pendingSuspenseBoundaries,transitions:o.transitions},e.updateQueue.baseState=s,e.memoizedState=s,e.flags&256){r=jc(Error(Ce(423)),e),e=ew(n,e,i,t,r);break e}else if(i!==r){r=jc(Error(Ce(424)),e),e=ew(n,e,i,t,r);break e}else for(Vi=Lo(e.stateNode.containerInfo.firstChild),Xi=e,Zt=!0,Dr=null,t=tP(e,null,i,t),e.child=t;t;)t.flags=t.flags&-3|4096,t=t.sibling;else{if(Gc(),i===r){e=Qs(n,e,t);break e}pi(n,e,i,t)}e=e.child}return e;case 5:return nP(e),n===null&&Rx(e),i=e.type,r=e.pendingProps,s=n!==null?n.memoizedProps:null,o=r.children,Ex(i,r)?o=null:s!==null&&Ex(i,s)&&(e.flags|=32),TP(n,e),pi(n,e,o,t),e.child;case 6:return n===null&&Rx(e),null;case 13:return bP(n,e,t);case 4:return NA(e,e.stateNode.containerInfo),i=e.pendingProps,n===null?e.child=Vc(e,null,i,t):pi(n,e,i,t),e.child;case 11:return i=e.type,r=e.pendingProps,r=e.elementType===i?r:Br(i,r),ZE(n,e,i,r,t);case 7:return pi(n,e,e.pendingProps,t),e.child;case 8:return pi(n,e,e.pendingProps.children,t),e.child;case 12:return pi(n,e,e.pendingProps.children,t),e.child;case 10:e:{if(i=e.type._context,r=e.pendingProps,s=e.memoizedProps,o=r.value,Wt(Nm,i._currentValue),i._currentValue=o,s!==null)if(Gr(s.value,o)){if(s.children===r.children&&!bi.current){e=Qs(n,e,t);break e}}else for(s=e.child,s!==null&&(s.return=e);s!==null;){var a=s.dependencies;if(a!==null){o=s.child;for(var l=a.firstContext;l!==null;){if(l.context===i){if(s.tag===1){l=Vs(-1,t&-t),l.tag=2;var u=s.updateQueue;if(u!==null){u=u.shared;var h=u.pending;h===null?l.next=l:(l.next=h.next,h.next=l),u.pending=l}}s.lanes|=t,l=s.alternate,l!==null&&(l.lanes|=t),Px(s.return,t,e),a.lanes|=t;break}l=l.next}}else if(s.tag===10)o=s.type===e.type?null:s.child;else if(s.tag===18){if(o=s.return,o===null)throw Error(Ce(341));o.lanes|=t,a=o.alternate,a!==null&&(a.lanes|=t),Px(o,t,e),o=s.sibling}else o=s.child;if(o!==null)o.return=s;else for(o=s;o!==null;){if(o===e){o=null;break}if(s=o.sibling,s!==null){s.return=o.return,o=s;break}o=o.return}s=o}pi(n,e,r.children,t),e=e.child}return e;case 9:return r=e.type,i=e.pendingProps.children,Rc(e,t),r=_r(r),i=i(r),e.flags|=1,pi(n,e,i,t),e.child;case 14:return i=e.type,r=Br(i,e.pendingProps),r=Br(i.type,r),qE(n,e,i,r,t);case 15:return EP(n,e,e.type,e.pendingProps,t);case 17:return i=e.type,r=e.pendingProps,r=e.elementType===i?r:Br(i,r),am(n,e),e.tag=1,Ri(i)?(n=!0,Im(e)):n=!1,Rc(e,t),$R(e,i,r),Lx(e,i,r,t),Fx(null,e,i,!0,n,t);case 19:return RP(n,e,t);case 22:return wP(n,e,t)}throw Error(Ce(156,e.tag))};function jP(n,e){return vR(n,e)}function T3(n,e,t,i){this.tag=n,this.key=t,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.ref=null,this.pendingProps=e,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=i,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function yr(n,e,t,i){return new T3(n,e,t,i)}function ZA(n){return n=n.prototype,!(!n||!n.isReactComponent)}function C3(n){if(typeof n=="function")return ZA(n)?1:0;if(n!=null){if(n=n.$$typeof,n===gA)return 11;if(n===vA)return 14}return 2}function No(n,e){var t=n.alternate;return t===null?(t=yr(n.tag,e,n.key,n.mode),t.elementType=n.elementType,t.type=n.type,t.stateNode=n.stateNode,t.alternate=n,n.alternate=t):(t.pendingProps=e,t.type=n.type,t.flags=0,t.subtreeFlags=0,t.deletions=null),t.flags=n.flags&14680064,t.childLanes=n.childLanes,t.lanes=n.lanes,t.child=n.child,t.memoizedProps=n.memoizedProps,t.memoizedState=n.memoizedState,t.updateQueue=n.updateQueue,e=n.dependencies,t.dependencies=e===null?null:{lanes:e.lanes,firstContext:e.firstContext},t.sibling=n.sibling,t.index=n.index,t.ref=n.ref,t}function um(n,e,t,i,r,s){var o=2;if(i=n,typeof n=="function")ZA(n)&&(o=1);else if(typeof n=="string")o=5;else e:switch(n){case sc:return Ja(t.children,r,s,e);case mA:o=8,r|=8;break;case nx:return n=yr(12,t,e,r|2),n.elementType=nx,n.lanes=s,n;case ix:return n=yr(13,t,e,r),n.elementType=ix,n.lanes=s,n;case rx:return n=yr(19,t,e,r),n.elementType=rx,n.lanes=s,n;case eR:return xg(t,r,s,e);default:if(typeof n=="object"&&n!==null)switch(n.$$typeof){case qb:o=10;break e;case $b:o=9;break e;case gA:o=11;break e;case vA:o=14;break e;case _o:o=16,i=null;break e}throw Error(Ce(130,n==null?n:typeof n,""))}return e=yr(o,t,e,r),e.elementType=n,e.type=i,e.lanes=s,e}function Ja(n,e,t,i){return n=yr(7,n,i,e),n.lanes=t,n}function xg(n,e,t,i){return n=yr(22,n,i,e),n.elementType=eR,n.lanes=t,n.stateNode={isHidden:!1},n}function zv(n,e,t){return n=yr(6,n,null,e),n.lanes=t,n}function Gv(n,e,t){return e=yr(4,n.children!==null?n.children:[],n.key,e),e.lanes=t,e.stateNode={containerInfo:n.containerInfo,pendingChildren:null,implementation:n.implementation},e}function b3(n,e,t,i,r){this.tag=e,this.containerInfo=n,this.finishedWork=this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.pendingContext=this.context=null,this.callbackPriority=0,this.eventTimes=Sv(0),this.expirationTimes=Sv(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=Sv(0),this.identifierPrefix=i,this.onRecoverableError=r,this.mutableSourceEagerHydrationData=null}function qA(n,e,t,i,r,s,o,a,l){return n=new b3(n,e,t,a,l),e===1?(e=1,s===!0&&(e|=8)):e=0,s=yr(3,null,null,e),n.current=s,s.stateNode=n,s.memoizedState={element:i,isDehydrated:t,cache:null,transitions:null,pendingSuspenseBoundaries:null},FA(s),n}function R3(n,e,t){var i=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:rc,key:i==null?null:""+i,children:n,containerInfo:e,implementation:t}}function XP(n){if(!n)return jo;n=n._reactInternals;e:{if(cl(n)!==n||n.tag!==1)throw Error(Ce(170));var e=n;do{switch(e.tag){case 3:e=e.stateNode.context;break e;case 1:if(Ri(e.type)){e=e.stateNode.__reactInternalMemoizedMergedChildContext;break e}}e=e.return}while(e!==null);throw Error(Ce(171))}if(n.tag===1){var t=n.type;if(Ri(t))return jR(n,t,e)}return e}function JP(n,e,t,i,r,s,o,a,l){return n=qA(t,i,!0,n,r,s,o,a,l),n.context=XP(null),t=n.current,i=gi(),r=Fo(t),s=Vs(i,r),s.callback=e??null,Io(t,s,r),n.current.lanes=r,vh(n,r,i),Pi(n,i),n}function _g(n,e,t,i){var r=e.current,s=gi(),o=Fo(r);return t=XP(t),e.context===null?e.context=t:e.pendingContext=t,e=Vs(s,o),e.payload={element:n},i=i===void 0?null:i,i!==null&&(e.callback=i),n=Io(r,e,o),n!==null&&(Ur(n,r,o,s),rm(n,r,o)),o}function Xm(n){if(n=n.current,!n.child)return null;switch(n.child.tag){case 5:return n.child.stateNode;default:return n.child.stateNode}}function uw(n,e){if(n=n.memoizedState,n!==null&&n.dehydrated!==null){var t=n.retryLane;n.retryLane=t!==0&&t<e?t:e}}function $A(n,e){uw(n,e),(n=n.alternate)&&uw(n,e)}function P3(){return null}var KP=typeof reportError=="function"?reportError:function(n){console.error(n)};function eS(n){this._internalRoot=n}Ag.prototype.render=eS.prototype.render=function(n){var e=this._internalRoot;if(e===null)throw Error(Ce(409));_g(n,e,null,null)};Ag.prototype.unmount=eS.prototype.unmount=function(){var n=this._internalRoot;if(n!==null){this._internalRoot=null;var e=n.containerInfo;il(function(){_g(null,n,null,null)}),e[Ks]=null}};function Ag(n){this._internalRoot=n}Ag.prototype.unstable_scheduleHydration=function(n){if(n){var e=ER();n={blockedOn:null,target:n,priority:e};for(var t=0;t<wo.length&&e!==0&&e<wo[t].priority;t++);wo.splice(t,0,n),t===0&&TR(n)}};function tS(n){return!(!n||n.nodeType!==1&&n.nodeType!==9&&n.nodeType!==11)}function Sg(n){return!(!n||n.nodeType!==1&&n.nodeType!==9&&n.nodeType!==11&&(n.nodeType!==8||n.nodeValue!==" react-mount-point-unstable "))}function fw(){}function B3(n,e,t,i,r){if(r){if(typeof i=="function"){var s=i;i=function(){var u=Xm(o);s.call(u)}}var o=JP(e,i,n,0,null,!1,!1,"",fw);return n._reactRootContainer=o,n[Ks]=o.current,Vf(n.nodeType===8?n.parentNode:n),il(),o}for(;r=n.lastChild;)n.removeChild(r);if(typeof i=="function"){var a=i;i=function(){var u=Xm(l);a.call(u)}}var l=qA(n,0,!1,null,null,!1,!1,"",fw);return n._reactRootContainer=l,n[Ks]=l.current,Vf(n.nodeType===8?n.parentNode:n),il(function(){_g(e,l,t,i)}),l}function Mg(n,e,t,i,r){var s=t._reactRootContainer;if(s){var o=s;if(typeof r=="function"){var a=r;r=function(){var l=Xm(o);a.call(l)}}_g(e,o,n,r)}else o=B3(t,e,n,r,i);return Xm(o)}SR=function(n){switch(n.tag){case 3:var e=n.stateNode;if(e.current.memoizedState.isDehydrated){var t=hf(e.pendingLanes);t!==0&&(_A(e,t|1),Pi(e,xn()),!(Pt&6)&&(Xc=xn()+500,ta()))}break;case 13:il(function(){var i=Ys(n,1);if(i!==null){var r=gi();Ur(i,n,1,r)}}),$A(n,1)}};AA=function(n){if(n.tag===13){var e=Ys(n,134217728);if(e!==null){var t=gi();Ur(e,n,134217728,t)}$A(n,134217728)}};MR=function(n){if(n.tag===13){var e=Fo(n),t=Ys(n,e);if(t!==null){var i=gi();Ur(t,n,e,i)}$A(n,e)}};ER=function(){return Ot};wR=function(n,e){var t=Ot;try{return Ot=n,e()}finally{Ot=t}};px=function(n,e,t){switch(e){case"input":if(ax(n,t),e=t.name,t.type==="radio"&&e!=null){for(t=n;t.parentNode;)t=t.parentNode;for(t=t.querySelectorAll("input[name="+JSON.stringify(""+e)+'][type="radio"]'),e=0;e<t.length;e++){var i=t[e];if(i!==n&&i.form===n.form){var r=dg(i);if(!r)throw Error(Ce(90));nR(i),ax(i,r)}}}break;case"textarea":rR(n,t);break;case"select":e=t.value,e!=null&&wc(n,!!t.multiple,e,!1)}};fR=KA;hR=il;var L3={usingClientEntryPoint:!1,Events:[xh,cc,dg,cR,uR,KA]},zu={findFiberByHostInstance:Na,bundleType:0,version:"18.2.0",rendererPackageName:"react-dom"},I3={bundleType:zu.bundleType,version:zu.version,rendererPackageName:zu.rendererPackageName,rendererConfig:zu.rendererConfig,overrideHookState:null,overrideHookStateDeletePath:null,overrideHookStateRenamePath:null,overrideProps:null,overridePropsDeletePath:null,overridePropsRenamePath:null,setErrorHandler:null,setSuspenseHandler:null,scheduleUpdate:null,currentDispatcherRef:eo.ReactCurrentDispatcher,findHostInstanceByFiber:function(n){return n=mR(n),n===null?null:n.stateNode},findFiberByHostInstance:zu.findFiberByHostInstance||P3,findHostInstancesForRefresh:null,scheduleRefresh:null,scheduleRoot:null,setRefreshHandler:null,getCurrentFiber:null,reconcilerVersion:"18.2.0-next-9e3b772b8-20220608"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var ip=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!ip.isDisabled&&ip.supportsFiber)try{cg=ip.inject(I3),us=ip}catch{}}Zi.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=L3;Zi.createPortal=function(n,e){var t=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!tS(e))throw Error(Ce(200));return R3(n,e,null,t)};Zi.createRoot=function(n,e){if(!tS(n))throw Error(Ce(299));var t=!1,i="",r=KP;return e!=null&&(e.unstable_strictMode===!0&&(t=!0),e.identifierPrefix!==void 0&&(i=e.identifierPrefix),e.onRecoverableError!==void 0&&(r=e.onRecoverableError)),e=qA(n,1,!1,null,null,t,!1,i,r),n[Ks]=e.current,Vf(n.nodeType===8?n.parentNode:n),new eS(e)};Zi.findDOMNode=function(n){if(n==null)return null;if(n.nodeType===1)return n;var e=n._reactInternals;if(e===void 0)throw typeof n.render=="function"?Error(Ce(188)):(n=Object.keys(n).join(","),Error(Ce(268,n)));return n=mR(e),n=n===null?null:n.stateNode,n};Zi.flushSync=function(n){return il(n)};Zi.hydrate=function(n,e,t){if(!Sg(e))throw Error(Ce(200));return Mg(null,n,e,!0,t)};Zi.hydrateRoot=function(n,e,t){if(!tS(n))throw Error(Ce(405));var i=t!=null&&t.hydratedSources||null,r=!1,s="",o=KP;if(t!=null&&(t.unstable_strictMode===!0&&(r=!0),t.identifierPrefix!==void 0&&(s=t.identifierPrefix),t.onRecoverableError!==void 0&&(o=t.onRecoverableError)),e=JP(e,null,n,1,t??null,r,!1,s,o),n[Ks]=e.current,Vf(n),i)for(n=0;n<i.length;n++)t=i[n],r=t._getVersion,r=r(t._source),e.mutableSourceEagerHydrationData==null?e.mutableSourceEagerHydrationData=[t,r]:e.mutableSourceEagerHydrationData.push(t,r);return new Ag(e)};Zi.render=function(n,e,t){if(!Sg(e))throw Error(Ce(200));return Mg(null,n,e,!1,t)};Zi.unmountComponentAtNode=function(n){if(!Sg(n))throw Error(Ce(40));return n._reactRootContainer?(il(function(){Mg(null,null,n,!1,function(){n._reactRootContainer=null,n[Ks]=null})}),!0):!1};Zi.unstable_batchedUpdates=KA;Zi.unstable_renderSubtreeIntoContainer=function(n,e,t,i){if(!Sg(t))throw Error(Ce(200));if(n==null||n._reactInternals===void 0)throw Error(Ce(38));return Mg(n,e,t,!1,i)};Zi.version="18.2.0-next-9e3b772b8-20220608";function YP(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(YP)}catch(n){console.error(n)}}YP(),Jb.exports=Zi;var D3=Jb.exports,QP,hw=D3;QP=ex.createRoot=hw.createRoot,ex.hydrateRoot=hw.hydrateRoot;/**
 * @remix-run/router v1.7.1
 *
 * 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
 */function qf(){return qf=Object.assign?Object.assign.bind():function(n){for(var e=1;e<arguments.length;e++){var t=arguments[e];for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&(n[i]=t[i])}return n},qf.apply(this,arguments)}var ka;(function(n){n.Pop="POP",n.Push="PUSH",n.Replace="REPLACE"})(ka||(ka={}));const dw="popstate";function F3(n){n===void 0&&(n={});function e(i,r){let{pathname:s,search:o,hash:a}=i.location;return Jx("",{pathname:s,search:o,hash:a},r.state&&r.state.usr||null,r.state&&r.state.key||"default")}function t(i,r){return typeof r=="string"?r:Jm(r)}return O3(e,t,null,n)}function kr(n,e){if(n===!1||n===null||typeof n>"u")throw new Error(e)}function N3(){return Math.random().toString(36).substr(2,8)}function pw(n,e){return{usr:n.state,key:n.key,idx:e}}function Jx(n,e,t,i){return t===void 0&&(t=null),qf({pathname:typeof n=="string"?n:n.pathname,search:"",hash:""},typeof e=="string"?Eg(e):e,{state:t,key:e&&e.key||i||N3()})}function Jm(n){let{pathname:e="/",search:t="",hash:i=""}=n;return t&&t!=="?"&&(e+=t.charAt(0)==="?"?t:"?"+t),i&&i!=="#"&&(e+=i.charAt(0)==="#"?i:"#"+i),e}function Eg(n){let e={};if(n){let t=n.indexOf("#");t>=0&&(e.hash=n.substr(t),n=n.substr(0,t));let i=n.indexOf("?");i>=0&&(e.search=n.substr(i),n=n.substr(0,i)),n&&(e.pathname=n)}return e}function O3(n,e,t,i){i===void 0&&(i={});let{window:r=document.defaultView,v5Compat:s=!1}=i,o=r.history,a=ka.Pop,l=null,u=h();u==null&&(u=0,o.replaceState(qf({},o.state,{idx:u}),""));function h(){return(o.state||{idx:null}).idx}function d(){a=ka.Pop;let _=h(),g=_==null?null:_-u;u=_,l&&l({action:a,location:M.location,delta:g})}function p(_,g){a=ka.Push;let x=Jx(M.location,_,g);t&&t(x,_),u=h()+1;let S=pw(x,u),E=M.createHref(x);try{o.pushState(S,"",E)}catch(C){if(C instanceof DOMException&&C.name==="DataCloneError")throw C;r.location.assign(E)}s&&l&&l({action:a,location:M.location,delta:1})}function m(_,g){a=ka.Replace;let x=Jx(M.location,_,g);t&&t(x,_),u=h();let S=pw(x,u),E=M.createHref(x);o.replaceState(S,"",E),s&&l&&l({action:a,location:M.location,delta:0})}function y(_){let g=r.location.origin!=="null"?r.location.origin:r.location.href,x=typeof _=="string"?_:Jm(_);return kr(g,"No window.location.(origin|href) available to create URL for href: "+x),new URL(x,g)}let M={get action(){return a},get location(){return n(r,o)},listen(_){if(l)throw new Error("A history only accepts one active listener");return r.addEventListener(dw,d),l=_,()=>{r.removeEventListener(dw,d),l=null}},createHref(_){return e(r,_)},createURL:y,encodeLocation(_){let g=y(_);return{pathname:g.pathname,search:g.search,hash:g.hash}},push:p,replace:m,go(_){return o.go(_)}};return M}var mw;(function(n){n.data="data",n.deferred="deferred",n.redirect="redirect",n.error="error"})(mw||(mw={}));function ZP(n,e){if(e==="/")return n;if(!n.toLowerCase().startsWith(e.toLowerCase()))return null;let t=e.endsWith("/")?e.length-1:e.length,i=n.charAt(t);return i&&i!=="/"?null:n.slice(t)||"/"}function U3(n,e){e===void 0&&(e="/");let{pathname:t,search:i="",hash:r=""}=typeof n=="string"?Eg(n):n;return{pathname:t?t.startsWith("/")?t:k3(t,e):e,search:H3(i),hash:z3(r)}}function k3(n,e){let t=e.replace(/\/+$/,"").split("/");return n.split("/").forEach(r=>{r===".."?t.length>1&&t.pop():r!=="."&&t.push(r)}),t.length>1?t.join("/"):"/"}function Vv(n,e,t,i){return"Cannot include a '"+n+"' character in a manually specified "+("`to."+e+"` field ["+JSON.stringify(i)+"].  Please separate it out to the ")+("`to."+t+"` field. Alternatively you may provide the full path as ")+'a string in <Link to="..."> and the router will parse it for you.'}function qP(n){return n.filter((e,t)=>t===0||e.route.path&&e.route.path.length>0)}function $P(n,e,t,i){i===void 0&&(i=!1);let r;typeof n=="string"?r=Eg(n):(r=qf({},n),kr(!r.pathname||!r.pathname.includes("?"),Vv("?","pathname","search",r)),kr(!r.pathname||!r.pathname.includes("#"),Vv("#","pathname","hash",r)),kr(!r.search||!r.search.includes("#"),Vv("#","search","hash",r)));let s=n===""||r.pathname==="",o=s?"/":r.pathname,a;if(i||o==null)a=t;else{let d=e.length-1;if(o.startsWith("..")){let p=o.split("/");for(;p[0]==="..";)p.shift(),d-=1;r.pathname=p.join("/")}a=d>=0?e[d]:"/"}let l=U3(r,a),u=o&&o!=="/"&&o.endsWith("/"),h=(s||o===".")&&t.endsWith("/");return!l.pathname.endsWith("/")&&(u||h)&&(l.pathname+="/"),l}const eB=n=>n.join("/").replace(/\/\/+/g,"/"),H3=n=>!n||n==="?"?"":n.startsWith("?")?n:"?"+n,z3=n=>!n||n==="#"?"":n.startsWith("#")?n:"#"+n,tB=["post","put","patch","delete"];new Set(tB);const G3=["get",...tB];new Set(G3);/**
 * React Router v6.14.1
 *
 * 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
 */function Kx(){return Kx=Object.assign?Object.assign.bind():function(n){for(var e=1;e<arguments.length;e++){var t=arguments[e];for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&(n[i]=t[i])}return n},Kx.apply(this,arguments)}const nB=J.createContext(null),Ah=J.createContext(null),nS=J.createContext(null),wg=J.createContext({outlet:null,matches:[],isDataRoute:!1});function V3(n,e){let{relative:t}=e===void 0?{}:e;Tg()||kr(!1);let{basename:i,navigator:r}=J.useContext(Ah),{hash:s,pathname:o,search:a}=rB(n,{relative:t}),l=o;return i!=="/"&&(l=o==="/"?i:eB([i,o])),r.createHref({pathname:l,search:a,hash:s})}function Tg(){return J.useContext(nS)!=null}function iS(){return Tg()||kr(!1),J.useContext(nS).location}function iB(n){J.useContext(Ah).static||J.useLayoutEffect(n)}function W3(){let{isDataRoute:n}=J.useContext(wg);return n?Y3():j3()}function j3(){Tg()||kr(!1);let n=J.useContext(nB),{basename:e,navigator:t}=J.useContext(Ah),{matches:i}=J.useContext(wg),{pathname:r}=iS(),s=JSON.stringify(qP(i).map(l=>l.pathnameBase)),o=J.useRef(!1);return iB(()=>{o.current=!0}),J.useCallback(function(l,u){if(u===void 0&&(u={}),!o.current)return;if(typeof l=="number"){t.go(l);return}let h=$P(l,JSON.parse(s),r,u.relative==="path");n==null&&e!=="/"&&(h.pathname=h.pathname==="/"?e:eB([e,h.pathname])),(u.replace?t.replace:t.push)(h,u.state,u)},[e,t,s,r,n])}function rB(n,e){let{relative:t}=e===void 0?{}:e,{matches:i}=J.useContext(wg),{pathname:r}=iS(),s=JSON.stringify(qP(i).map(o=>o.pathnameBase));return J.useMemo(()=>$P(n,JSON.parse(s),r,t==="path"),[n,s,r,t])}var Yx;(function(n){n.UseBlocker="useBlocker",n.UseRevalidator="useRevalidator",n.UseNavigateStable="useNavigate"})(Yx||(Yx={}));var Qx;(function(n){n.UseBlocker="useBlocker",n.UseLoaderData="useLoaderData",n.UseActionData="useActionData",n.UseRouteError="useRouteError",n.UseNavigation="useNavigation",n.UseRouteLoaderData="useRouteLoaderData",n.UseMatches="useMatches",n.UseRevalidator="useRevalidator",n.UseNavigateStable="useNavigate",n.UseRouteId="useRouteId"})(Qx||(Qx={}));function X3(n){let e=J.useContext(nB);return e||kr(!1),e}function J3(n){let e=J.useContext(wg);return e||kr(!1),e}function K3(n){let e=J3(),t=e.matches[e.matches.length-1];return t.route.id||kr(!1),t.route.id}function Y3(){let{router:n}=X3(Yx.UseNavigateStable),e=K3(Qx.UseNavigateStable),t=J.useRef(!1);return iB(()=>{t.current=!0}),J.useCallback(function(r,s){s===void 0&&(s={}),t.current&&(typeof r=="number"?n.navigate(r):n.navigate(r,Kx({fromRouteId:e},s)))},[n,e])}function Q3(n){let{basename:e="/",children:t=null,location:i,navigationType:r=ka.Pop,navigator:s,static:o=!1}=n;Tg()&&kr(!1);let a=e.replace(/^\/*/,"/"),l=J.useMemo(()=>({basename:a,navigator:s,static:o}),[a,s,o]);typeof i=="string"&&(i=Eg(i));let{pathname:u="/",search:h="",hash:d="",state:p=null,key:m="default"}=i,y=J.useMemo(()=>{let M=ZP(u,a);return M==null?null:{location:{pathname:M,search:h,hash:d,state:p,key:m},navigationType:r}},[a,u,h,d,p,m,r]);return y==null?null:J.createElement(Ah.Provider,{value:l},J.createElement(nS.Provider,{children:t,value:y}))}var gw;(function(n){n[n.pending=0]="pending",n[n.success=1]="success",n[n.error=2]="error"})(gw||(gw={}));new Promise(()=>{});/**
 * React Router DOM v6.14.1
 *
 * 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
 */function Zx(){return Zx=Object.assign?Object.assign.bind():function(n){for(var e=1;e<arguments.length;e++){var t=arguments[e];for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&(n[i]=t[i])}return n},Zx.apply(this,arguments)}function Z3(n,e){if(n==null)return{};var t={},i=Object.keys(n),r,s;for(s=0;s<i.length;s++)r=i[s],!(e.indexOf(r)>=0)&&(t[r]=n[r]);return t}function q3(n){return!!(n.metaKey||n.altKey||n.ctrlKey||n.shiftKey)}function $3(n,e){return n.button===0&&(!e||e==="_self")&&!q3(n)}const eO=["onClick","relative","reloadDocument","replace","state","target","to","preventScrollReset"],tO="startTransition",vw=EF[tO];function nO(n){let{basename:e,children:t,future:i,window:r}=n,s=J.useRef();s.current==null&&(s.current=F3({window:r,v5Compat:!0}));let o=s.current,[a,l]=J.useState({action:o.action,location:o.location}),{v7_startTransition:u}=i||{},h=J.useCallback(d=>{u&&vw?vw(()=>l(d)):l(d)},[l,u]);return J.useLayoutEffect(()=>o.listen(h),[o,h]),J.createElement(Q3,{basename:e,children:t,location:a.location,navigationType:a.action,navigator:o})}const iO=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u",rO=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,sO=J.forwardRef(function(e,t){let{onClick:i,relative:r,reloadDocument:s,replace:o,state:a,target:l,to:u,preventScrollReset:h}=e,d=Z3(e,eO),{basename:p}=J.useContext(Ah),m,y=!1;if(typeof u=="string"&&rO.test(u)&&(m=u,iO))try{let x=new URL(window.location.href),S=u.startsWith("//")?new URL(x.protocol+u):new URL(u),E=ZP(S.pathname,p);S.origin===x.origin&&E!=null?u=E+S.search+S.hash:y=!0}catch{}let M=V3(u,{relative:r}),_=oO(u,{replace:o,state:a,target:l,preventScrollReset:h,relative:r});function g(x){i&&i(x),x.defaultPrevented||_(x)}return J.createElement("a",Zx({},d,{href:m||M,onClick:y||s?i:g,ref:t,target:l}))});var yw;(function(n){n.UseScrollRestoration="useScrollRestoration",n.UseSubmit="useSubmit",n.UseSubmitFetcher="useSubmitFetcher",n.UseFetcher="useFetcher"})(yw||(yw={}));var xw;(function(n){n.UseFetchers="useFetchers",n.UseScrollRestoration="useScrollRestoration"})(xw||(xw={}));function oO(n,e){let{target:t,replace:i,state:r,preventScrollReset:s,relative:o}=e===void 0?{}:e,a=W3(),l=iS(),u=rB(n,{relative:o});return J.useCallback(h=>{if($3(h,t)){h.preventDefault();let d=i!==void 0?i:Jm(l)===Jm(u);a(n,{replace:d,state:r,preventScrollReset:s,relative:o})}},[l,a,u,i,r,t,n,s,o])}/**
 * @license
 * Copyright 2010-2023 Three.js Authors
 * SPDX-License-Identifier: MIT
 */const Sh="154",Ra={LEFT:0,MIDDLE:1,RIGHT:2,ROTATE:0,DOLLY:1,PAN:2},Pa={ROTATE:0,PAN:1,DOLLY_PAN:2,DOLLY_ROTATE:3},sB=0,qx=1,oB=2,aO=3,aB=0,Cg=1,Tf=2,Lr=3,gs=0,vi=1,vr=2,lO=2,Ws=0,Ka=1,$x=2,e_=3,t_=4,lB=5,Da=100,cB=101,uB=102,n_=103,i_=104,fB=200,hB=201,dB=202,pB=203,rS=204,sS=205,mB=206,gB=207,vB=208,yB=209,xB=210,_B=0,AB=1,SB=2,Km=3,MB=4,EB=5,wB=6,TB=7,Mh=0,CB=1,bB=2,Hr=0,RB=1,PB=2,BB=3,oS=4,LB=5,bg=300,Xo=301,Jo=302,$f=303,eh=304,cu=306,Ko=1e3,Xn=1001,Jc=1002,mn=1003,th=1004,cO=1004,Bc=1005,uO=1005,rn=1006,Rg=1007,fO=1007,vs=1008,hO=1008,hs=1009,IB=1010,DB=1011,Pg=1012,aS=1013,Hs=1014,ls=1015,Kc=1016,lS=1017,cS=1018,Oo=1020,FB=1021,Ti=1023,NB=1024,OB=1025,Uo=1026,rl=1027,UB=1028,uS=1029,kB=1030,fS=1031,hS=1033,fm=33776,hm=33777,dm=33778,pm=33779,r_=35840,s_=35841,o_=35842,a_=35843,HB=36196,l_=37492,c_=37496,u_=37808,f_=37809,h_=37810,d_=37811,p_=37812,m_=37813,g_=37814,v_=37815,y_=37816,x_=37817,__=37818,A_=37819,S_=37820,M_=37821,mm=36492,zB=36283,E_=36284,w_=36285,T_=36286,GB=2200,VB=2201,WB=2202,Yc=2300,sl=2301,gm=2302,Ha=2400,za=2401,nh=2402,Bg=2500,dS=2501,jB=0,pS=1,Ym=2,mS=3e3,ko=3001,XB=3200,JB=3201,na=0,KB=1,Ho="",mt="srgb",Vr="srgb-linear",gS="display-p3",dO=0,vm=7680,pO=7681,mO=7682,gO=7683,vO=34055,yO=34056,xO=5386,_O=512,AO=513,SO=514,MO=515,EO=516,wO=517,TO=518,YB=519,QB=512,ZB=513,qB=514,$B=515,e2=516,t2=517,n2=518,i2=519,ih=35044,Ya=35048,CO=35040,bO=35045,RO=35049,PO=35041,BO=35046,LO=35050,IO=35042,DO="100",C_="300 es",Qm=1035,cs=2e3,rh=2001;class xs{addEventListener(e,t){this._listeners===void 0&&(this._listeners={});const i=this._listeners;i[e]===void 0&&(i[e]=[]),i[e].indexOf(t)===-1&&i[e].push(t)}hasEventListener(e,t){if(this._listeners===void 0)return!1;const i=this._listeners;return i[e]!==void 0&&i[e].indexOf(t)!==-1}removeEventListener(e,t){if(this._listeners===void 0)return;const 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 i=this._listeners[e.type];if(i!==void 0){e.target=this;const r=i.slice(0);for(let s=0,o=r.length;s<o;s++)r[s].call(this,e);e.target=null}}}const ii=["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 _w=1234567;const Qa=Math.PI/180,Qc=180/Math.PI;function Ji(){const n=Math.random()*4294967295|0,e=Math.random()*4294967295|0,t=Math.random()*4294967295|0,i=Math.random()*4294967295|0;return(ii[n&255]+ii[n>>8&255]+ii[n>>16&255]+ii[n>>24&255]+"-"+ii[e&255]+ii[e>>8&255]+"-"+ii[e>>16&15|64]+ii[e>>24&255]+"-"+ii[t&63|128]+ii[t>>8&255]+"-"+ii[t>>16&255]+ii[t>>24&255]+ii[i&255]+ii[i>>8&255]+ii[i>>16&255]+ii[i>>24&255]).toLowerCase()}function gn(n,e,t){return Math.max(e,Math.min(t,n))}function vS(n,e){return(n%e+e)%e}function FO(n,e,t,i,r){return i+(n-e)*(r-i)/(t-e)}function NO(n,e,t){return n!==e?(t-n)/(e-n):0}function Cf(n,e,t){return(1-t)*n+t*e}function OO(n,e,t,i){return Cf(n,e,1-Math.exp(-t*i))}function UO(n,e=1){return e-Math.abs(vS(n,e*2)-e)}function kO(n,e,t){return n<=e?0:n>=t?1:(n=(n-e)/(t-e),n*n*(3-2*n))}function HO(n,e,t){return n<=e?0:n>=t?1:(n=(n-e)/(t-e),n*n*n*(n*(n*6-15)+10))}function zO(n,e){return n+Math.floor(Math.random()*(e-n+1))}function GO(n,e){return n+Math.random()*(e-n)}function VO(n){return n*(.5-Math.random())}function WO(n){n!==void 0&&(_w=n);let e=_w+=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 jO(n){return n*Qa}function XO(n){return n*Qc}function b_(n){return(n&n-1)===0&&n!==0}function r2(n){return Math.pow(2,Math.ceil(Math.log(n)/Math.LN2))}function Zm(n){return Math.pow(2,Math.floor(Math.log(n)/Math.LN2))}function JO(n,e,t,i,r){const s=Math.cos,o=Math.sin,a=s(t/2),l=o(t/2),u=s((e+i)/2),h=o((e+i)/2),d=s((e-i)/2),p=o((e-i)/2),m=s((i-e)/2),y=o((i-e)/2);switch(r){case"XYX":n.set(a*h,l*d,l*p,a*u);break;case"YZY":n.set(l*p,a*h,l*d,a*u);break;case"ZXZ":n.set(l*d,l*p,a*h,a*u);break;case"XZX":n.set(a*h,l*y,l*m,a*u);break;case"YXY":n.set(l*m,a*h,l*y,a*u);break;case"ZYZ":n.set(l*y,l*m,a*h,a*u);break;default:console.warn("THREE.MathUtils: .setQuaternionFromProperEuler() encountered an unknown order: "+r)}}function Wi(n,e){switch(e.constructor){case Float32Array:return n;case Uint32Array:return n/4294967295;case Uint16Array:return n/65535;case Uint8Array:return n/255;case Int32Array:return Math.max(n/2147483647,-1);case Int16Array:return Math.max(n/32767,-1);case Int8Array:return Math.max(n/127,-1);default:throw new Error("Invalid component type.")}}function At(n,e){switch(e.constructor){case Float32Array:return n;case Uint32Array:return Math.round(n*4294967295);case Uint16Array:return Math.round(n*65535);case Uint8Array:return Math.round(n*255);case Int32Array:return Math.round(n*2147483647);case Int16Array:return Math.round(n*32767);case Int8Array:return Math.round(n*127);default:throw new Error("Invalid component type.")}}const s2={DEG2RAD:Qa,RAD2DEG:Qc,generateUUID:Ji,clamp:gn,euclideanModulo:vS,mapLinear:FO,inverseLerp:NO,lerp:Cf,damp:OO,pingpong:UO,smoothstep:kO,smootherstep:HO,randInt:zO,randFloat:GO,randFloatSpread:VO,seededRandom:WO,degToRad:jO,radToDeg:XO,isPowerOfTwo:b_,ceilPowerOfTwo:r2,floorPowerOfTwo:Zm,setQuaternionFromProperEuler:JO,normalize:At,denormalize:Wi};class ge{constructor(e=0,t=0){ge.prototype.isVector2=!0,this.x=e,this.y=t}get width(){return this.x}set width(e){this.x=e}get height(){return this.y}set height(e){this.y=e}set(e,t){return this.x=e,this.y=t,this}setScalar(e){return this.x=e,this.y=e,this}setX(e){return this.x=e,this}setY(e){return this.y=e,this}setComponent(e,t){switch(e){case 0:this.x=t;break;case 1:this.y=t;break;default:throw new Error("index is out of range: "+e)}return this}getComponent(e){switch(e){case 0:return this.x;case 1:return this.y;default:throw new Error("index is out of range: "+e)}}clone(){return new this.constructor(this.x,this.y)}copy(e){return this.x=e.x,this.y=e.y,this}add(e){return this.x+=e.x,this.y+=e.y,this}addScalar(e){return this.x+=e,this.y+=e,this}addVectors(e,t){return this.x=e.x+t.x,this.y=e.y+t.y,this}addScaledVector(e,t){return this.x+=e.x*t,this.y+=e.y*t,this}sub(e){return this.x-=e.x,this.y-=e.y,this}subScalar(e){return this.x-=e,this.y-=e,this}subVectors(e,t){return this.x=e.x-t.x,this.y=e.y-t.y,this}multiply(e){return this.x*=e.x,this.y*=e.y,this}multiplyScalar(e){return this.x*=e,this.y*=e,this}divide(e){return this.x/=e.x,this.y/=e.y,this}divideScalar(e){return this.multiplyScalar(1/e)}applyMatrix3(e){const t=this.x,i=this.y,r=e.elements;return this.x=r[0]*t+r[3]*i+r[6],this.y=r[1]*t+r[4]*i+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=Math.max(e.x,Math.min(t.x,this.x)),this.y=Math.max(e.y,Math.min(t.y,this.y)),this}clampScalar(e,t){return this.x=Math.max(e,Math.min(t,this.x)),this.y=Math.max(e,Math.min(t,this.y)),this}clampLength(e,t){const i=this.length();return this.divideScalar(i||1).multiplyScalar(Math.max(e,Math.min(t,i)))}floor(){return this.x=Math.floor(this.x),this.y=Math.floor(this.y),this}ceil(){return this.x=Math.ceil(this.x),this.y=Math.ceil(this.y),this}round(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this}roundToZero(){return this.x=this.x<0?Math.ceil(this.x):Math.floor(this.x),this.y=this.y<0?Math.ceil(this.y):Math.floor(this.y),this}negate(){return this.x=-this.x,this.y=-this.y,this}dot(e){return this.x*e.x+this.y*e.y}cross(e){return this.x*e.y-this.y*e.x}lengthSq(){return this.x*this.x+this.y*this.y}length(){return Math.sqrt(this.x*this.x+this.y*this.y)}manhattanLength(){return Math.abs(this.x)+Math.abs(this.y)}normalize(){return this.divideScalar(this.length()||1)}angle(){return Math.atan2(-this.y,-this.x)+Math.PI}angleTo(e){const t=Math.sqrt(this.lengthSq()*e.lengthSq());if(t===0)return Math.PI/2;const i=this.dot(e)/t;return Math.acos(gn(i,-1,1))}distanceTo(e){return Math.sqrt(this.distanceToSquared(e))}distanceToSquared(e){const t=this.x-e.x,i=this.y-e.y;return t*t+i*i}manhattanDistanceTo(e){return Math.abs(this.x-e.x)+Math.abs(this.y-e.y)}setLength(e){return this.normalize().multiplyScalar(e)}lerp(e,t){return this.x+=(e.x-this.x)*t,this.y+=(e.y-this.y)*t,this}lerpVectors(e,t,i){return this.x=e.x+(t.x-e.x)*i,this.y=e.y+(t.y-e.y)*i,this}equals(e){return e.x===this.x&&e.y===this.y}fromArray(e,t=0){return this.x=e[t],this.y=e[t+1],this}toArray(e=[],t=0){return e[t]=this.x,e[t+1]=this.y,e}fromBufferAttribute(e,t){return this.x=e.getX(t),this.y=e.getY(t),this}rotateAround(e,t){const i=Math.cos(t),r=Math.sin(t),s=this.x-e.x,o=this.y-e.y;return this.x=s*i-o*r+e.x,this.y=s*r+o*i+e.y,this}random(){return this.x=Math.random(),this.y=Math.random(),this}*[Symbol.iterator](){yield this.x,yield this.y}}class _t{constructor(e,t,i,r,s,o,a,l,u){_t.prototype.isMatrix3=!0,this.elements=[1,0,0,0,1,0,0,0,1],e!==void 0&&this.set(e,t,i,r,s,o,a,l,u)}set(e,t,i,r,s,o,a,l,u){const h=this.elements;return h[0]=e,h[1]=r,h[2]=a,h[3]=t,h[4]=s,h[5]=l,h[6]=i,h[7]=o,h[8]=u,this}identity(){return this.set(1,0,0,0,1,0,0,0,1),this}copy(e){const t=this.elements,i=e.elements;return t[0]=i[0],t[1]=i[1],t[2]=i[2],t[3]=i[3],t[4]=i[4],t[5]=i[5],t[6]=i[6],t[7]=i[7],t[8]=i[8],this}extractBasis(e,t,i){return e.setFromMatrix3Column(this,0),t.setFromMatrix3Column(this,1),i.setFromMatrix3Column(this,2),this}setFromMatrix4(e){const t=e.elements;return this.set(t[0],t[4],t[8],t[1],t[5],t[9],t[2],t[6],t[10]),this}multiply(e){return this.multiplyMatrices(this,e)}premultiply(e){return this.multiplyMatrices(e,this)}multiplyMatrices(e,t){const i=e.elements,r=t.elements,s=this.elements,o=i[0],a=i[3],l=i[6],u=i[1],h=i[4],d=i[7],p=i[2],m=i[5],y=i[8],M=r[0],_=r[3],g=r[6],x=r[1],S=r[4],E=r[7],C=r[2],b=r[5],P=r[8];return s[0]=o*M+a*x+l*C,s[3]=o*_+a*S+l*b,s[6]=o*g+a*E+l*P,s[1]=u*M+h*x+d*C,s[4]=u*_+h*S+d*b,s[7]=u*g+h*E+d*P,s[2]=p*M+m*x+y*C,s[5]=p*_+m*S+y*b,s[8]=p*g+m*E+y*P,this}multiplyScalar(e){const t=this.elements;return t[0]*=e,t[3]*=e,t[6]*=e,t[1]*=e,t[4]*=e,t[7]*=e,t[2]*=e,t[5]*=e,t[8]*=e,this}determinant(){const e=this.elements,t=e[0],i=e[1],r=e[2],s=e[3],o=e[4],a=e[5],l=e[6],u=e[7],h=e[8];return t*o*h-t*a*u-i*s*h+i*a*l+r*s*u-r*o*l}invert(){const e=this.elements,t=e[0],i=e[1],r=e[2],s=e[3],o=e[4],a=e[5],l=e[6],u=e[7],h=e[8],d=h*o-a*u,p=a*l-h*s,m=u*s-o*l,y=t*d+i*p+r*m;if(y===0)return this.set(0,0,0,0,0,0,0,0,0);const M=1/y;return e[0]=d*M,e[1]=(r*u-h*i)*M,e[2]=(a*i-r*o)*M,e[3]=p*M,e[4]=(h*t-r*l)*M,e[5]=(r*s-a*t)*M,e[6]=m*M,e[7]=(i*l-u*t)*M,e[8]=(o*t-i*s)*M,this}transpose(){let e;const t=this.elements;return e=t[1],t[1]=t[3],t[3]=e,e=t[2],t[2]=t[6],t[6]=e,e=t[5],t[5]=t[7],t[7]=e,this}getNormalMatrix(e){return this.setFromMatrix4(e).invert().transpose()}transposeIntoArray(e){const t=this.elements;return e[0]=t[0],e[1]=t[3],e[2]=t[6],e[3]=t[1],e[4]=t[4],e[5]=t[7],e[6]=t[2],e[7]=t[5],e[8]=t[8],this}setUvTransform(e,t,i,r,s,o,a){const l=Math.cos(s),u=Math.sin(s);return this.set(i*l,i*u,-i*(l*o+u*a)+o+e,-r*u,r*l,-r*(-u*o+l*a)+a+t,0,0,1),this}scale(e,t){return this.premultiply(Wv.makeScale(e,t)),this}rotate(e){return this.premultiply(Wv.makeRotation(-e)),this}translate(e,t){return this.premultiply(Wv.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),i=Math.sin(e);return this.set(t,-i,0,i,t,0,0,0,1),this}makeScale(e,t){return this.set(e,0,0,0,t,0,0,0,1),this}equals(e){const t=this.elements,i=e.elements;for(let r=0;r<9;r++)if(t[r]!==i[r])return!1;return!0}fromArray(e,t=0){for(let i=0;i<9;i++)this.elements[i]=e[i+t];return this}toArray(e=[],t=0){const i=this.elements;return e[t]=i[0],e[t+1]=i[1],e[t+2]=i[2],e[t+3]=i[3],e[t+4]=i[4],e[t+5]=i[5],e[t+6]=i[6],e[t+7]=i[7],e[t+8]=i[8],e}clone(){return new this.constructor().fromArray(this.elements)}}const Wv=new _t;function o2(n){for(let e=n.length-1;e>=0;--e)if(n[e]>=65535)return!0;return!1}const KO={Int8Array,Uint8Array,Uint8ClampedArray,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array};function gc(n,e){return new KO[n](e)}function sh(n){return document.createElementNS("http://www.w3.org/1999/xhtml",n)}const Aw={};function bf(n){n in Aw||(Aw[n]=!0,console.warn(n))}function Lc(n){return n<.04045?n*.0773993808:Math.pow(n*.9478672986+.0521327014,2.4)}function jv(n){return n<.0031308?n*12.92:1.055*Math.pow(n,.41666)-.055}const YO=new _t().fromArray([.8224621,.0331941,.0170827,.177538,.9668058,.0723974,-1e-7,1e-7,.9105199]),QO=new _t().fromArray([1.2249401,-.0420569,-.0196376,-.2249404,1.0420571,-.0786361,1e-7,0,1.0982735]);function ZO(n){return n.convertSRGBToLinear().applyMatrix3(QO)}function qO(n){return n.applyMatrix3(YO).convertLinearToSRGB()}const $O={[Vr]:n=>n,[mt]:n=>n.convertSRGBToLinear(),[gS]:ZO},eU={[Vr]:n=>n,[mt]:n=>n.convertLinearToSRGB(),[gS]:qO},ur={enabled:!0,get legacyMode(){return console.warn("THREE.ColorManagement: .legacyMode=false renamed to .enabled=true in r150."),!this.enabled},set legacyMode(n){console.warn("THREE.ColorManagement: .legacyMode=false renamed to .enabled=true in r150."),this.enabled=!n},get workingColorSpace(){return Vr},set workingColorSpace(n){console.warn("THREE.ColorManagement: .workingColorSpace is readonly.")},convert:function(n,e,t){if(this.enabled===!1||e===t||!e||!t)return n;const i=$O[e],r=eU[t];if(i===void 0||r===void 0)throw new Error(`Unsupported color space conversion, "${e}" to "${t}".`);return r(i(n))},fromWorkingColorSpace:function(n,e){return this.convert(n,this.workingColorSpace,e)},toWorkingColorSpace:function(n,e){return this.convert(n,e,this.workingColorSpace)}};let Bl;class yS{static getDataURL(e){if(/^data:/i.test(e.src)||typeof HTMLCanvasElement>"u")return e.src;let t;if(e instanceof HTMLCanvasElement)t=e;else{Bl===void 0&&(Bl=sh("canvas")),Bl.width=e.width,Bl.height=e.height;const i=Bl.getContext("2d");e instanceof ImageData?i.putImageData(e,0,0):i.drawImage(e,0,0,e.width,e.height),t=Bl}return t.width>2048||t.height>2048?(console.warn("THREE.ImageUtils.getDataURL: Image converted to jpg for performance reasons",e),t.toDataURL("image/jpeg",.6)):t.toDataURL("image/png")}static sRGBToLinear(e){if(typeof HTMLImageElement<"u"&&e instanceof HTMLImageElement||typeof HTMLCanvasElement<"u"&&e instanceof HTMLCanvasElement||typeof ImageBitmap<"u"&&e instanceof ImageBitmap){const t=sh("canvas");t.width=e.width,t.height=e.height;const i=t.getContext("2d");i.drawImage(e,0,0,e.width,e.height);const r=i.getImageData(0,0,e.width,e.height),s=r.data;for(let o=0;o<s.length;o++)s[o]=Lc(s[o]/255)*255;return i.putImageData(r,0,0),t}else if(e.data){const t=e.data.slice(0);for(let i=0;i<t.length;i++)t instanceof Uint8Array||t instanceof Uint8ClampedArray?t[i]=Math.floor(Lc(t[i]/255)*255):t[i]=Lc(t[i]);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 tU=0;class Ga{constructor(e=null){this.isSource=!0,Object.defineProperty(this,"id",{value:tU++}),this.uuid=Ji(),this.data=e,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 i={uuid:this.uuid,url:""},r=this.data;if(r!==null){let s;if(Array.isArray(r)){s=[];for(let o=0,a=r.length;o<a;o++)r[o].isDataTexture?s.push(Xv(r[o].image)):s.push(Xv(r[o]))}else s=Xv(r);i.url=s}return t||(e.images[this.uuid]=i),i}}function Xv(n){return typeof HTMLImageElement<"u"&&n instanceof HTMLImageElement||typeof HTMLCanvasElement<"u"&&n instanceof HTMLCanvasElement||typeof ImageBitmap<"u"&&n instanceof ImageBitmap?yS.getDataURL(n):n.data?{data:Array.from(n.data),width:n.width,height:n.height,type:n.data.constructor.name}:(console.warn("THREE.Texture: Unable to serialize Texture."),{})}let nU=0;class $t extends xs{constructor(e=$t.DEFAULT_IMAGE,t=$t.DEFAULT_MAPPING,i=Xn,r=Xn,s=rn,o=vs,a=Ti,l=hs,u=$t.DEFAULT_ANISOTROPY,h=Ho){super(),this.isTexture=!0,Object.defineProperty(this,"id",{value:nU++}),this.uuid=Ji(),this.name="",this.source=new Ga(e),this.mipmaps=[],this.mapping=t,this.channel=0,this.wrapS=i,this.wrapT=r,this.magFilter=s,this.minFilter=o,this.anisotropy=u,this.format=a,this.internalFormat=null,this.type=l,this.offset=new ge(0,0),this.repeat=new ge(1,1),this.center=new ge(0,0),this.rotation=0,this.matrixAutoUpdate=!0,this.matrix=new _t,this.generateMipmaps=!0,this.premultiplyAlpha=!1,this.flipY=!0,this.unpackAlignment=4,typeof h=="string"?this.colorSpace=h:(bf("THREE.Texture: Property .encoding has been replaced by .colorSpace."),this.colorSpace=h===ko?mt:Ho),this.userData={},this.version=0,this.onUpdate=null,this.isRenderTargetTexture=!1,this.needsPMREMUpdate=!1}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.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 i={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&&(i.userData=this.userData),t||(e.textures[this.uuid]=i),i}dispose(){this.dispatchEvent({type:"dispose"})}transformUv(e){if(this.mapping!==bg)return e;if(e.applyMatrix3(this.matrix),e.x<0||e.x>1)switch(this.wrapS){case Ko:e.x=e.x-Math.floor(e.x);break;case Xn:e.x=e.x<0?0:1;break;case Jc: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 Ko:e.y=e.y-Math.floor(e.y);break;case Xn:e.y=e.y<0?0:1;break;case Jc:Math.abs(Math.floor(e.y)%2)===1?e.y=Math.ceil(e.y)-e.y:e.y=e.y-Math.floor(e.y);break}return this.flipY&&(e.y=1-e.y),e}set needsUpdate(e){e===!0&&(this.version++,this.source.needsUpdate=!0)}get encoding(){return bf("THREE.Texture: Property .encoding has been replaced by .colorSpace."),this.colorSpace===mt?ko:mS}set encoding(e){bf("THREE.Texture: Property .encoding has been replaced by .colorSpace."),this.colorSpace=e===ko?mt:Ho}}$t.DEFAULT_IMAGE=null;$t.DEFAULT_MAPPING=bg;$t.DEFAULT_ANISOTROPY=1;class Nt{constructor(e=0,t=0,i=0,r=1){Nt.prototype.isVector4=!0,this.x=e,this.y=t,this.z=i,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,i,r){return this.x=e,this.y=t,this.z=i,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,i=this.y,r=this.z,s=this.w,o=e.elements;return this.x=o[0]*t+o[4]*i+o[8]*r+o[12]*s,this.y=o[1]*t+o[5]*i+o[9]*r+o[13]*s,this.z=o[2]*t+o[6]*i+o[10]*r+o[14]*s,this.w=o[3]*t+o[7]*i+o[11]*r+o[15]*s,this}divideScalar(e){return this.multiplyScalar(1/e)}setAxisAngleFromQuaternion(e){this.w=2*Math.acos(e.w);const t=Math.sqrt(1-e.w*e.w);return t<1e-4?(this.x=1,this.y=0,this.z=0):(this.x=e.x/t,this.y=e.y/t,this.z=e.z/t),this}setAxisAngleFromRotationMatrix(e){let t,i,r,s;const l=e.elements,u=l[0],h=l[4],d=l[8],p=l[1],m=l[5],y=l[9],M=l[2],_=l[6],g=l[10];if(Math.abs(h-p)<.01&&Math.abs(d-M)<.01&&Math.abs(y-_)<.01){if(Math.abs(h+p)<.1&&Math.abs(d+M)<.1&&Math.abs(y+_)<.1&&Math.abs(u+m+g-3)<.1)return this.set(1,0,0,0),this;t=Math.PI;const S=(u+1)/2,E=(m+1)/2,C=(g+1)/2,b=(h+p)/4,P=(d+M)/4,B=(y+_)/4;return S>E&&S>C?S<.01?(i=0,r=.707106781,s=.707106781):(i=Math.sqrt(S),r=b/i,s=P/i):E>C?E<.01?(i=.707106781,r=0,s=.707106781):(r=Math.sqrt(E),i=b/r,s=B/r):C<.01?(i=.707106781,r=.707106781,s=0):(s=Math.sqrt(C),i=P/s,r=B/s),this.set(i,r,s,t),this}let x=Math.sqrt((_-y)*(_-y)+(d-M)*(d-M)+(p-h)*(p-h));return Math.abs(x)<.001&&(x=1),this.x=(_-y)/x,this.y=(d-M)/x,this.z=(p-h)/x,this.w=Math.acos((u+m+g-1)/2),this}min(e){return this.x=Math.min(this.x,e.x),this.y=Math.min(this.y,e.y),this.z=Math.min(this.z,e.z),this.w=Math.min(this.w,e.w),this}max(e){return this.x=Math.max(this.x,e.x),this.y=Math.max(this.y,e.y),this.z=Math.max(this.z,e.z),this.w=Math.max(this.w,e.w),this}clamp(e,t){return this.x=Math.max(e.x,Math.min(t.x,this.x)),this.y=Math.max(e.y,Math.min(t.y,this.y)),this.z=Math.max(e.z,Math.min(t.z,this.z)),this.w=Math.max(e.w,Math.min(t.w,this.w)),this}clampScalar(e,t){return this.x=Math.max(e,Math.min(t,this.x)),this.y=Math.max(e,Math.min(t,this.y)),this.z=Math.max(e,Math.min(t,this.z)),this.w=Math.max(e,Math.min(t,this.w)),this}clampLength(e,t){const i=this.length();return this.divideScalar(i||1).multiplyScalar(Math.max(e,Math.min(t,i)))}floor(){return this.x=Math.floor(this.x),this.y=Math.floor(this.y),this.z=Math.floor(this.z),this.w=Math.floor(this.w),this}ceil(){return this.x=Math.ceil(this.x),this.y=Math.ceil(this.y),this.z=Math.ceil(this.z),this.w=Math.ceil(this.w),this}round(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this.z=Math.round(this.z),this.w=Math.round(this.w),this}roundToZero(){return this.x=this.x<0?Math.ceil(this.x):Math.floor(this.x),this.y=this.y<0?Math.ceil(this.y):Math.floor(this.y),this.z=this.z<0?Math.ceil(this.z):Math.floor(this.z),this.w=this.w<0?Math.ceil(this.w):Math.floor(this.w),this}negate(){return this.x=-this.x,this.y=-this.y,this.z=-this.z,this.w=-this.w,this}dot(e){return this.x*e.x+this.y*e.y+this.z*e.z+this.w*e.w}lengthSq(){return this.x*this.x+this.y*this.y+this.z*this.z+this.w*this.w}length(){return Math.sqrt(this.x*this.x+this.y*this.y+this.z*this.z+this.w*this.w)}manhattanLength(){return Math.abs(this.x)+Math.abs(this.y)+Math.abs(this.z)+Math.abs(this.w)}normalize(){return this.divideScalar(this.length()||1)}setLength(e){return this.normalize().multiplyScalar(e)}lerp(e,t){return this.x+=(e.x-this.x)*t,this.y+=(e.y-this.y)*t,this.z+=(e.z-this.z)*t,this.w+=(e.w-this.w)*t,this}lerpVectors(e,t,i){return this.x=e.x+(t.x-e.x)*i,this.y=e.y+(t.y-e.y)*i,this.z=e.z+(t.z-e.z)*i,this.w=e.w+(t.w-e.w)*i,this}equals(e){return e.x===this.x&&e.y===this.y&&e.z===this.z&&e.w===this.w}fromArray(e,t=0){return this.x=e[t],this.y=e[t+1],this.z=e[t+2],this.w=e[t+3],this}toArray(e=[],t=0){return e[t]=this.x,e[t+1]=this.y,e[t+2]=this.z,e[t+3]=this.w,e}fromBufferAttribute(e,t){return this.x=e.getX(t),this.y=e.getY(t),this.z=e.getZ(t),this.w=e.getW(t),this}random(){return this.x=Math.random(),this.y=Math.random(),this.z=Math.random(),this.w=Math.random(),this}*[Symbol.iterator](){yield this.x,yield this.y,yield this.z,yield this.w}}class Wr extends xs{constructor(e=1,t=1,i={}){super(),this.isWebGLRenderTarget=!0,this.width=e,this.height=t,this.depth=1,this.scissor=new Nt(0,0,e,t),this.scissorTest=!1,this.viewport=new Nt(0,0,e,t);const r={width:e,height:t,depth:1};i.encoding!==void 0&&(bf("THREE.WebGLRenderTarget: option.encoding has been replaced by option.colorSpace."),i.colorSpace=i.encoding===ko?mt:Ho),this.texture=new $t(r,i.mapping,i.wrapS,i.wrapT,i.magFilter,i.minFilter,i.format,i.type,i.anisotropy,i.colorSpace),this.texture.isRenderTargetTexture=!0,this.texture.flipY=!1,this.texture.generateMipmaps=i.generateMipmaps!==void 0?i.generateMipmaps:!1,this.texture.internalFormat=i.internalFormat!==void 0?i.internalFormat:null,this.texture.minFilter=i.minFilter!==void 0?i.minFilter:rn,this.depthBuffer=i.depthBuffer!==void 0?i.depthBuffer:!0,this.stencilBuffer=i.stencilBuffer!==void 0?i.stencilBuffer:!1,this.depthTexture=i.depthTexture!==void 0?i.depthTexture:null,this.samples=i.samples!==void 0?i.samples:0}setSize(e,t,i=1){(this.width!==e||this.height!==t||this.depth!==i)&&(this.width=e,this.height=t,this.depth=i,this.texture.image.width=e,this.texture.image.height=t,this.texture.image.depth=i,this.dispose()),this.viewport.set(0,0,e,t),this.scissor.set(0,0,e,t)}clone(){return new this.constructor().copy(this)}copy(e){this.width=e.width,this.height=e.height,this.depth=e.depth,this.scissor.copy(e.scissor),this.scissorTest=e.scissorTest,this.viewport.copy(e.viewport),this.texture=e.texture.clone(),this.texture.isRenderTargetTexture=!0;const t=Object.assign({},e.texture.image);return this.texture.source=new Ga(t),this.depthBuffer=e.depthBuffer,this.stencilBuffer=e.stencilBuffer,e.depthTexture!==null&&(this.depthTexture=e.depthTexture.clone()),this.samples=e.samples,this}dispose(){this.dispatchEvent({type:"dispose"})}}class Lg extends $t{constructor(e=null,t=1,i=1,r=1){super(null),this.isDataArrayTexture=!0,this.image={data:e,width:t,height:i,depth:r},this.magFilter=mn,this.minFilter=mn,this.wrapR=Xn,this.generateMipmaps=!1,this.flipY=!1,this.unpackAlignment=1}}class iU extends Wr{constructor(e=1,t=1,i=1){super(e,t),this.isWebGLArrayRenderTarget=!0,this.depth=i,this.texture=new Lg(null,e,t,i),this.texture.isRenderTargetTexture=!0}}class xS extends $t{constructor(e=null,t=1,i=1,r=1){super(null),this.isData3DTexture=!0,this.image={data:e,width:t,height:i,depth:r},this.magFilter=mn,this.minFilter=mn,this.wrapR=Xn,this.generateMipmaps=!1,this.flipY=!1,this.unpackAlignment=1}}class rU extends Wr{constructor(e=1,t=1,i=1){super(e,t),this.isWebGL3DRenderTarget=!0,this.depth=i,this.texture=new xS(null,e,t,i),this.texture.isRenderTargetTexture=!0}}class sU extends Wr{constructor(e=1,t=1,i=1,r={}){super(e,t,r),this.isWebGLMultipleRenderTargets=!0;const s=this.texture;this.texture=[];for(let o=0;o<i;o++)this.texture[o]=s.clone(),this.texture[o].isRenderTargetTexture=!0}setSize(e,t,i=1){if(this.width!==e||this.height!==t||this.depth!==i){this.width=e,this.height=t,this.depth=i;for(let r=0,s=this.texture.length;r<s;r++)this.texture[r].image.width=e,this.texture[r].image.height=t,this.texture[r].image.depth=i;this.dispose()}return this.viewport.set(0,0,e,t),this.scissor.set(0,0,e,t),this}copy(e){this.dispose(),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.depthBuffer=e.depthBuffer,this.stencilBuffer=e.stencilBuffer,e.depthTexture!==null&&(this.depthTexture=e.depthTexture.clone()),this.texture.length=0;for(let t=0,i=e.texture.length;t<i;t++)this.texture[t]=e.texture[t].clone(),this.texture[t].isRenderTargetTexture=!0;return this}}class Gn{constructor(e=0,t=0,i=0,r=1){this.isQuaternion=!0,this._x=e,this._y=t,this._z=i,this._w=r}static slerpFlat(e,t,i,r,s,o,a){let l=i[r+0],u=i[r+1],h=i[r+2],d=i[r+3];const p=s[o+0],m=s[o+1],y=s[o+2],M=s[o+3];if(a===0){e[t+0]=l,e[t+1]=u,e[t+2]=h,e[t+3]=d;return}if(a===1){e[t+0]=p,e[t+1]=m,e[t+2]=y,e[t+3]=M;return}if(d!==M||l!==p||u!==m||h!==y){let _=1-a;const g=l*p+u*m+h*y+d*M,x=g>=0?1:-1,S=1-g*g;if(S>Number.EPSILON){const C=Math.sqrt(S),b=Math.atan2(C,g*x);_=Math.sin(_*b)/C,a=Math.sin(a*b)/C}const E=a*x;if(l=l*_+p*E,u=u*_+m*E,h=h*_+y*E,d=d*_+M*E,_===1-a){const C=1/Math.sqrt(l*l+u*u+h*h+d*d);l*=C,u*=C,h*=C,d*=C}}e[t]=l,e[t+1]=u,e[t+2]=h,e[t+3]=d}static multiplyQuaternionsFlat(e,t,i,r,s,o){const a=i[r],l=i[r+1],u=i[r+2],h=i[r+3],d=s[o],p=s[o+1],m=s[o+2],y=s[o+3];return e[t]=a*y+h*d+l*m-u*p,e[t+1]=l*y+h*p+u*d-a*m,e[t+2]=u*y+h*m+a*p-l*d,e[t+3]=h*y-a*d-l*p-u*m,e}get x(){return this._x}set x(e){this._x=e,this._onChangeCallback()}get y(){return this._y}set y(e){this._y=e,this._onChangeCallback()}get z(){return this._z}set z(e){this._z=e,this._onChangeCallback()}get w(){return this._w}set w(e){this._w=e,this._onChangeCallback()}set(e,t,i,r){return this._x=e,this._y=t,this._z=i,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){const i=e._x,r=e._y,s=e._z,o=e._order,a=Math.cos,l=Math.sin,u=a(i/2),h=a(r/2),d=a(s/2),p=l(i/2),m=l(r/2),y=l(s/2);switch(o){case"XYZ":this._x=p*h*d+u*m*y,this._y=u*m*d-p*h*y,this._z=u*h*y+p*m*d,this._w=u*h*d-p*m*y;break;case"YXZ":this._x=p*h*d+u*m*y,this._y=u*m*d-p*h*y,this._z=u*h*y-p*m*d,this._w=u*h*d+p*m*y;break;case"ZXY":this._x=p*h*d-u*m*y,this._y=u*m*d+p*h*y,this._z=u*h*y+p*m*d,this._w=u*h*d-p*m*y;break;case"ZYX":this._x=p*h*d-u*m*y,this._y=u*m*d+p*h*y,this._z=u*h*y-p*m*d,this._w=u*h*d+p*m*y;break;case"YZX":this._x=p*h*d+u*m*y,this._y=u*m*d+p*h*y,this._z=u*h*y-p*m*d,this._w=u*h*d-p*m*y;break;case"XZY":this._x=p*h*d-u*m*y,this._y=u*m*d-p*h*y,this._z=u*h*y+p*m*d,this._w=u*h*d+p*m*y;break;default:console.warn("THREE.Quaternion: .setFromEuler() encountered an unknown order: "+o)}return t!==!1&&this._onChangeCallback(),this}setFromAxisAngle(e,t){const i=t/2,r=Math.sin(i);return this._x=e.x*r,this._y=e.y*r,this._z=e.z*r,this._w=Math.cos(i),this._onChangeCallback(),this}setFromRotationMatrix(e){const t=e.elements,i=t[0],r=t[4],s=t[8],o=t[1],a=t[5],l=t[9],u=t[2],h=t[6],d=t[10],p=i+a+d;if(p>0){const m=.5/Math.sqrt(p+1);this._w=.25/m,this._x=(h-l)*m,this._y=(s-u)*m,this._z=(o-r)*m}else if(i>a&&i>d){const m=2*Math.sqrt(1+i-a-d);this._w=(h-l)/m,this._x=.25*m,this._y=(r+o)/m,this._z=(s+u)/m}else if(a>d){const m=2*Math.sqrt(1+a-i-d);this._w=(s-u)/m,this._x=(r+o)/m,this._y=.25*m,this._z=(l+h)/m}else{const m=2*Math.sqrt(1+d-i-a);this._w=(o-r)/m,this._x=(s+u)/m,this._y=(l+h)/m,this._z=.25*m}return this._onChangeCallback(),this}setFromUnitVectors(e,t){let i=e.dot(t)+1;return i<Number.EPSILON?(i=0,Math.abs(e.x)>Math.abs(e.z)?(this._x=-e.y,this._y=e.x,this._z=0,this._w=i):(this._x=0,this._y=-e.z,this._z=e.y,this._w=i)):(this._x=e.y*t.z-e.z*t.y,this._y=e.z*t.x-e.x*t.z,this._z=e.x*t.y-e.y*t.x,this._w=i),this.normalize()}angleTo(e){return 2*Math.acos(Math.abs(gn(this.dot(e),-1,1)))}rotateTowards(e,t){const i=this.angleTo(e);if(i===0)return this;const r=Math.min(1,t/i);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 i=e._x,r=e._y,s=e._z,o=e._w,a=t._x,l=t._y,u=t._z,h=t._w;return this._x=i*h+o*a+r*u-s*l,this._y=r*h+o*l+s*a-i*u,this._z=s*h+o*u+i*l-r*a,this._w=o*h-i*a-r*l-s*u,this._onChangeCallback(),this}slerp(e,t){if(t===0)return this;if(t===1)return this.copy(e);const i=this._x,r=this._y,s=this._z,o=this._w;let a=o*e._w+i*e._x+r*e._y+s*e._z;if(a<0?(this._w=-e._w,this._x=-e._x,this._y=-e._y,this._z=-e._z,a=-a):this.copy(e),a>=1)return this._w=o,this._x=i,this._y=r,this._z=s,this;const l=1-a*a;if(l<=Number.EPSILON){const m=1-t;return this._w=m*o+t*this._w,this._x=m*i+t*this._x,this._y=m*r+t*this._y,this._z=m*s+t*this._z,this.normalize(),this._onChangeCallback(),this}const u=Math.sqrt(l),h=Math.atan2(u,a),d=Math.sin((1-t)*h)/u,p=Math.sin(t*h)/u;return this._w=o*d+this._w*p,this._x=i*d+this._x*p,this._y=r*d+this._y*p,this._z=s*d+this._z*p,this._onChangeCallback(),this}slerpQuaternions(e,t,i){return this.copy(e).slerp(t,i)}random(){const e=Math.random(),t=Math.sqrt(1-e),i=Math.sqrt(e),r=2*Math.PI*Math.random(),s=2*Math.PI*Math.random();return this.set(t*Math.cos(r),i*Math.sin(s),i*Math.cos(s),t*Math.sin(r))}equals(e){return e._x===this._x&&e._y===this._y&&e._z===this._z&&e._w===this._w}fromArray(e,t=0){return this._x=e[t],this._y=e[t+1],this._z=e[t+2],this._w=e[t+3],this._onChangeCallback(),this}toArray(e=[],t=0){return e[t]=this._x,e[t+1]=this._y,e[t+2]=this._z,e[t+3]=this._w,e}fromBufferAttribute(e,t){return this._x=e.getX(t),this._y=e.getY(t),this._z=e.getZ(t),this._w=e.getW(t),this}toJSON(){return this.toArray()}_onChange(e){return this._onChangeCallback=e,this}_onChangeCallback(){}*[Symbol.iterator](){yield this._x,yield this._y,yield this._z,yield this._w}}class F{constructor(e=0,t=0,i=0){F.prototype.isVector3=!0,this.x=e,this.y=t,this.z=i}set(e,t,i){return i===void 0&&(i=this.z),this.x=e,this.y=t,this.z=i,this}setScalar(e){return this.x=e,this.y=e,this.z=e,this}setX(e){return this.x=e,this}setY(e){return this.y=e,this}setZ(e){return this.z=e,this}setComponent(e,t){switch(e){case 0:this.x=t;break;case 1:this.y=t;break;case 2:this.z=t;break;default:throw new Error("index is out of range: "+e)}return this}getComponent(e){switch(e){case 0:return this.x;case 1:return this.y;case 2:return this.z;default:throw new Error("index is out of range: "+e)}}clone(){return new this.constructor(this.x,this.y,this.z)}copy(e){return this.x=e.x,this.y=e.y,this.z=e.z,this}add(e){return this.x+=e.x,this.y+=e.y,this.z+=e.z,this}addScalar(e){return this.x+=e,this.y+=e,this.z+=e,this}addVectors(e,t){return this.x=e.x+t.x,this.y=e.y+t.y,this.z=e.z+t.z,this}addScaledVector(e,t){return this.x+=e.x*t,this.y+=e.y*t,this.z+=e.z*t,this}sub(e){return this.x-=e.x,this.y-=e.y,this.z-=e.z,this}subScalar(e){return this.x-=e,this.y-=e,this.z-=e,this}subVectors(e,t){return this.x=e.x-t.x,this.y=e.y-t.y,this.z=e.z-t.z,this}multiply(e){return this.x*=e.x,this.y*=e.y,this.z*=e.z,this}multiplyScalar(e){return this.x*=e,this.y*=e,this.z*=e,this}multiplyVectors(e,t){return this.x=e.x*t.x,this.y=e.y*t.y,this.z=e.z*t.z,this}applyEuler(e){return this.applyQuaternion(Sw.setFromEuler(e))}applyAxisAngle(e,t){return this.applyQuaternion(Sw.setFromAxisAngle(e,t))}applyMatrix3(e){const t=this.x,i=this.y,r=this.z,s=e.elements;return this.x=s[0]*t+s[3]*i+s[6]*r,this.y=s[1]*t+s[4]*i+s[7]*r,this.z=s[2]*t+s[5]*i+s[8]*r,this}applyNormalMatrix(e){return this.applyMatrix3(e).normalize()}applyMatrix4(e){const t=this.x,i=this.y,r=this.z,s=e.elements,o=1/(s[3]*t+s[7]*i+s[11]*r+s[15]);return this.x=(s[0]*t+s[4]*i+s[8]*r+s[12])*o,this.y=(s[1]*t+s[5]*i+s[9]*r+s[13])*o,this.z=(s[2]*t+s[6]*i+s[10]*r+s[14])*o,this}applyQuaternion(e){const t=this.x,i=this.y,r=this.z,s=e.x,o=e.y,a=e.z,l=e.w,u=l*t+o*r-a*i,h=l*i+a*t-s*r,d=l*r+s*i-o*t,p=-s*t-o*i-a*r;return this.x=u*l+p*-s+h*-a-d*-o,this.y=h*l+p*-o+d*-s-u*-a,this.z=d*l+p*-a+u*-o-h*-s,this}project(e){return this.applyMatrix4(e.matrixWorldInverse).applyMatrix4(e.projectionMatrix)}unproject(e){return this.applyMatrix4(e.projectionMatrixInverse).applyMatrix4(e.matrixWorld)}transformDirection(e){const t=this.x,i=this.y,r=this.z,s=e.elements;return this.x=s[0]*t+s[4]*i+s[8]*r,this.y=s[1]*t+s[5]*i+s[9]*r,this.z=s[2]*t+s[6]*i+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=Math.max(e.x,Math.min(t.x,this.x)),this.y=Math.max(e.y,Math.min(t.y,this.y)),this.z=Math.max(e.z,Math.min(t.z,this.z)),this}clampScalar(e,t){return this.x=Math.max(e,Math.min(t,this.x)),this.y=Math.max(e,Math.min(t,this.y)),this.z=Math.max(e,Math.min(t,this.z)),this}clampLength(e,t){const i=this.length();return this.divideScalar(i||1).multiplyScalar(Math.max(e,Math.min(t,i)))}floor(){return this.x=Math.floor(this.x),this.y=Math.floor(this.y),this.z=Math.floor(this.z),this}ceil(){return this.x=Math.ceil(this.x),this.y=Math.ceil(this.y),this.z=Math.ceil(this.z),this}round(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this.z=Math.round(this.z),this}roundToZero(){return this.x=this.x<0?Math.ceil(this.x):Math.floor(this.x),this.y=this.y<0?Math.ceil(this.y):Math.floor(this.y),this.z=this.z<0?Math.ceil(this.z):Math.floor(this.z),this}negate(){return this.x=-this.x,this.y=-this.y,this.z=-this.z,this}dot(e){return this.x*e.x+this.y*e.y+this.z*e.z}lengthSq(){return this.x*this.x+this.y*this.y+this.z*this.z}length(){return Math.sqrt(this.x*this.x+this.y*this.y+this.z*this.z)}manhattanLength(){return Math.abs(this.x)+Math.abs(this.y)+Math.abs(this.z)}normalize(){return this.divideScalar(this.length()||1)}setLength(e){return this.normalize().multiplyScalar(e)}lerp(e,t){return this.x+=(e.x-this.x)*t,this.y+=(e.y-this.y)*t,this.z+=(e.z-this.z)*t,this}lerpVectors(e,t,i){return this.x=e.x+(t.x-e.x)*i,this.y=e.y+(t.y-e.y)*i,this.z=e.z+(t.z-e.z)*i,this}cross(e){return this.crossVectors(this,e)}crossVectors(e,t){const i=e.x,r=e.y,s=e.z,o=t.x,a=t.y,l=t.z;return this.x=r*l-s*a,this.y=s*o-i*l,this.z=i*a-r*o,this}projectOnVector(e){const t=e.lengthSq();if(t===0)return this.set(0,0,0);const i=e.dot(this)/t;return this.copy(e).multiplyScalar(i)}projectOnPlane(e){return Jv.copy(this).projectOnVector(e),this.sub(Jv)}reflect(e){return this.sub(Jv.copy(e).multiplyScalar(2*this.dot(e)))}angleTo(e){const t=Math.sqrt(this.lengthSq()*e.lengthSq());if(t===0)return Math.PI/2;const i=this.dot(e)/t;return Math.acos(gn(i,-1,1))}distanceTo(e){return Math.sqrt(this.distanceToSquared(e))}distanceToSquared(e){const t=this.x-e.x,i=this.y-e.y,r=this.z-e.z;return t*t+i*i+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,i){const r=Math.sin(t)*e;return this.x=r*Math.sin(i),this.y=Math.cos(t)*e,this.z=r*Math.cos(i),this}setFromCylindrical(e){return this.setFromCylindricalCoords(e.radius,e.theta,e.y)}setFromCylindricalCoords(e,t,i){return this.x=e*Math.sin(t),this.y=i,this.z=e*Math.cos(t),this}setFromMatrixPosition(e){const t=e.elements;return this.x=t[12],this.y=t[13],this.z=t[14],this}setFromMatrixScale(e){const t=this.setFromMatrixColumn(e,0).length(),i=this.setFromMatrixColumn(e,1).length(),r=this.setFromMatrixColumn(e,2).length();return this.x=t,this.y=i,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()-.5)*2,t=Math.random()*Math.PI*2,i=Math.sqrt(1-e**2);return this.x=i*Math.cos(t),this.y=i*Math.sin(t),this.z=e,this}*[Symbol.iterator](){yield this.x,yield this.y,yield this.z}}const Jv=new F,Sw=new Gn;class Xr{constructor(e=new F(1/0,1/0,1/0),t=new F(-1/0,-1/0,-1/0)){this.isBox3=!0,this.min=e,this.max=t}set(e,t){return this.min.copy(e),this.max.copy(t),this}setFromArray(e){this.makeEmpty();for(let t=0,i=e.length;t<i;t+=3)this.expandByPoint(Rs.fromArray(e,t));return this}setFromBufferAttribute(e){this.makeEmpty();for(let t=0,i=e.count;t<i;t++)this.expandByPoint(Rs.fromBufferAttribute(e,t));return this}setFromPoints(e){this.makeEmpty();for(let t=0,i=e.length;t<i;t++)this.expandByPoint(e[t]);return this}setFromCenterAndSize(e,t){const i=Rs.copy(t).multiplyScalar(.5);return this.min.copy(e).sub(i),this.max.copy(e).add(i),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){if(e.updateWorldMatrix(!1,!1),e.boundingBox!==void 0)e.boundingBox===null&&e.computeBoundingBox(),Ll.copy(e.boundingBox),Ll.applyMatrix4(e.matrixWorld),this.union(Ll);else{const r=e.geometry;if(r!==void 0)if(t&&r.attributes!==void 0&&r.attributes.position!==void 0){const s=r.attributes.position;for(let o=0,a=s.count;o<a;o++)Rs.fromBufferAttribute(s,o).applyMatrix4(e.matrixWorld),this.expandByPoint(Rs)}else r.boundingBox===null&&r.computeBoundingBox(),Ll.copy(r.boundingBox),Ll.applyMatrix4(e.matrixWorld),this.union(Ll)}const i=e.children;for(let r=0,s=i.length;r<s;r++)this.expandByObject(i[r],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,Rs),Rs.distanceToSquared(e.center)<=e.radius*e.radius}intersectsPlane(e){let t,i;return e.normal.x>0?(t=e.normal.x*this.min.x,i=e.normal.x*this.max.x):(t=e.normal.x*this.max.x,i=e.normal.x*this.min.x),e.normal.y>0?(t+=e.normal.y*this.min.y,i+=e.normal.y*this.max.y):(t+=e.normal.y*this.max.y,i+=e.normal.y*this.min.y),e.normal.z>0?(t+=e.normal.z*this.min.z,i+=e.normal.z*this.max.z):(t+=e.normal.z*this.max.z,i+=e.normal.z*this.min.z),t<=-e.constant&&i>=-e.constant}intersectsTriangle(e){if(this.isEmpty())return!1;this.getCenter(Gu),rp.subVectors(this.max,Gu),Il.subVectors(e.a,Gu),Dl.subVectors(e.b,Gu),Fl.subVectors(e.c,Gu),ho.subVectors(Dl,Il),po.subVectors(Fl,Dl),ma.subVectors(Il,Fl);let t=[0,-ho.z,ho.y,0,-po.z,po.y,0,-ma.z,ma.y,ho.z,0,-ho.x,po.z,0,-po.x,ma.z,0,-ma.x,-ho.y,ho.x,0,-po.y,po.x,0,-ma.y,ma.x,0];return!Kv(t,Il,Dl,Fl,rp)||(t=[1,0,0,0,1,0,0,0,1],!Kv(t,Il,Dl,Fl,rp))?!1:(sp.crossVectors(ho,po),t=[sp.x,sp.y,sp.z],Kv(t,Il,Dl,Fl,rp))}clampPoint(e,t){return t.copy(e).clamp(this.min,this.max)}distanceToPoint(e){return this.clampPoint(e,Rs).distanceTo(e)}getBoundingSphere(e){return this.isEmpty()?e.makeEmpty():(this.getCenter(e.center),e.radius=this.getSize(Rs).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:(bs[0].set(this.min.x,this.min.y,this.min.z).applyMatrix4(e),bs[1].set(this.min.x,this.min.y,this.max.z).applyMatrix4(e),bs[2].set(this.min.x,this.max.y,this.min.z).applyMatrix4(e),bs[3].set(this.min.x,this.max.y,this.max.z).applyMatrix4(e),bs[4].set(this.max.x,this.min.y,this.min.z).applyMatrix4(e),bs[5].set(this.max.x,this.min.y,this.max.z).applyMatrix4(e),bs[6].set(this.max.x,this.max.y,this.min.z).applyMatrix4(e),bs[7].set(this.max.x,this.max.y,this.max.z).applyMatrix4(e),this.setFromPoints(bs),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 bs=[new F,new F,new F,new F,new F,new F,new F,new F],Rs=new F,Ll=new Xr,Il=new F,Dl=new F,Fl=new F,ho=new F,po=new F,ma=new F,Gu=new F,rp=new F,sp=new F,ga=new F;function Kv(n,e,t,i,r){for(let s=0,o=n.length-3;s<=o;s+=3){ga.fromArray(n,s);const a=r.x*Math.abs(ga.x)+r.y*Math.abs(ga.y)+r.z*Math.abs(ga.z),l=e.dot(ga),u=t.dot(ga),h=i.dot(ga);if(Math.max(-Math.max(l,u,h),Math.min(l,u,h))>a)return!1}return!0}const oU=new Xr,Vu=new F,Yv=new F;class Sr{constructor(e=new F,t=-1){this.center=e,this.radius=t}set(e,t){return this.center.copy(e),this.radius=t,this}setFromPoints(e,t){const i=this.center;t!==void 0?i.copy(t):oU.setFromPoints(e).getCenter(i);let r=0;for(let s=0,o=e.length;s<o;s++)r=Math.max(r,i.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 i=this.center.distanceToSquared(e);return t.copy(e),i>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;Vu.subVectors(e,this.center);const t=Vu.lengthSq();if(t>this.radius*this.radius){const i=Math.sqrt(t),r=(i-this.radius)*.5;this.center.addScaledVector(Vu,r/i),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):(Yv.subVectors(e.center,this.center).setLength(e.radius),this.expandByPoint(Vu.copy(e.center).add(Yv)),this.expandByPoint(Vu.copy(e.center).sub(Yv))),this)}equals(e){return e.center.equals(this.center)&&e.radius===this.radius}clone(){return new this.constructor().copy(this)}}const Ps=new F,Qv=new F,op=new F,mo=new F,Zv=new F,ap=new F,qv=new F;class uu{constructor(e=new F,t=new F(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,Ps)),this}closestPointToPoint(e,t){t.subVectors(e,this.origin);const i=t.dot(this.direction);return i<0?t.copy(this.origin):t.copy(this.origin).addScaledVector(this.direction,i)}distanceToPoint(e){return Math.sqrt(this.distanceSqToPoint(e))}distanceSqToPoint(e){const t=Ps.subVectors(e,this.origin).dot(this.direction);return t<0?this.origin.distanceToSquared(e):(Ps.copy(this.origin).addScaledVector(this.direction,t),Ps.distanceToSquared(e))}distanceSqToSegment(e,t,i,r){Qv.copy(e).add(t).multiplyScalar(.5),op.copy(t).sub(e).normalize(),mo.copy(this.origin).sub(Qv);const s=e.distanceTo(t)*.5,o=-this.direction.dot(op),a=mo.dot(this.direction),l=-mo.dot(op),u=mo.lengthSq(),h=Math.abs(1-o*o);let d,p,m,y;if(h>0)if(d=o*l-a,p=o*a-l,y=s*h,d>=0)if(p>=-y)if(p<=y){const M=1/h;d*=M,p*=M,m=d*(d+o*p+2*a)+p*(o*d+p+2*l)+u}else p=s,d=Math.max(0,-(o*p+a)),m=-d*d+p*(p+2*l)+u;else p=-s,d=Math.max(0,-(o*p+a)),m=-d*d+p*(p+2*l)+u;else p<=-y?(d=Math.max(0,-(-o*s+a)),p=d>0?-s:Math.min(Math.max(-s,-l),s),m=-d*d+p*(p+2*l)+u):p<=y?(d=0,p=Math.min(Math.max(-s,-l),s),m=p*(p+2*l)+u):(d=Math.max(0,-(o*s+a)),p=d>0?s:Math.min(Math.max(-s,-l),s),m=-d*d+p*(p+2*l)+u);else p=o>0?-s:s,d=Math.max(0,-(o*p+a)),m=-d*d+p*(p+2*l)+u;return i&&i.copy(this.origin).addScaledVector(this.direction,d),r&&r.copy(Qv).addScaledVector(op,p),m}intersectSphere(e,t){Ps.subVectors(e.center,this.origin);const i=Ps.dot(this.direction),r=Ps.dot(Ps)-i*i,s=e.radius*e.radius;if(r>s)return null;const o=Math.sqrt(s-r),a=i-o,l=i+o;return l<0?null:a<0?this.at(l,t):this.at(a,t)}intersectsSphere(e){return this.distanceSqToPoint(e.center)<=e.radius*e.radius}distanceToPlane(e){const t=e.normal.dot(this.direction);if(t===0)return e.distanceToPoint(this.origin)===0?0:null;const i=-(this.origin.dot(e.normal)+e.constant)/t;return i>=0?i:null}intersectPlane(e,t){const i=this.distanceToPlane(e);return i===null?null:this.at(i,t)}intersectsPlane(e){const t=e.distanceToPoint(this.origin);return t===0||e.normal.dot(this.direction)*t<0}intersectBox(e,t){let i,r,s,o,a,l;const u=1/this.direction.x,h=1/this.direction.y,d=1/this.direction.z,p=this.origin;return u>=0?(i=(e.min.x-p.x)*u,r=(e.max.x-p.x)*u):(i=(e.max.x-p.x)*u,r=(e.min.x-p.x)*u),h>=0?(s=(e.min.y-p.y)*h,o=(e.max.y-p.y)*h):(s=(e.max.y-p.y)*h,o=(e.min.y-p.y)*h),i>o||s>r||((s>i||isNaN(i))&&(i=s),(o<r||isNaN(r))&&(r=o),d>=0?(a=(e.min.z-p.z)*d,l=(e.max.z-p.z)*d):(a=(e.max.z-p.z)*d,l=(e.min.z-p.z)*d),i>l||a>r)||((a>i||i!==i)&&(i=a),(l<r||r!==r)&&(r=l),r<0)?null:this.at(i>=0?i:r,t)}intersectsBox(e){return this.intersectBox(e,Ps)!==null}intersectTriangle(e,t,i,r,s){Zv.subVectors(t,e),ap.subVectors(i,e),qv.crossVectors(Zv,ap);let o=this.direction.dot(qv),a;if(o>0){if(r)return null;a=1}else if(o<0)a=-1,o=-o;else return null;mo.subVectors(this.origin,e);const l=a*this.direction.dot(ap.crossVectors(mo,ap));if(l<0)return null;const u=a*this.direction.dot(Zv.cross(mo));if(u<0||l+u>o)return null;const h=-a*mo.dot(qv);return h<0?null:this.at(h/o,s)}applyMatrix4(e){return this.origin.applyMatrix4(e),this.direction.transformDirection(e),this}equals(e){return e.origin.equals(this.origin)&&e.direction.equals(this.direction)}clone(){return new this.constructor().copy(this)}}class rt{constructor(e,t,i,r,s,o,a,l,u,h,d,p,m,y,M,_){rt.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,i,r,s,o,a,l,u,h,d,p,m,y,M,_)}set(e,t,i,r,s,o,a,l,u,h,d,p,m,y,M,_){const g=this.elements;return g[0]=e,g[4]=t,g[8]=i,g[12]=r,g[1]=s,g[5]=o,g[9]=a,g[13]=l,g[2]=u,g[6]=h,g[10]=d,g[14]=p,g[3]=m,g[7]=y,g[11]=M,g[15]=_,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 rt().fromArray(this.elements)}copy(e){const t=this.elements,i=e.elements;return t[0]=i[0],t[1]=i[1],t[2]=i[2],t[3]=i[3],t[4]=i[4],t[5]=i[5],t[6]=i[6],t[7]=i[7],t[8]=i[8],t[9]=i[9],t[10]=i[10],t[11]=i[11],t[12]=i[12],t[13]=i[13],t[14]=i[14],t[15]=i[15],this}copyPosition(e){const t=this.elements,i=e.elements;return t[12]=i[12],t[13]=i[13],t[14]=i[14],this}setFromMatrix3(e){const t=e.elements;return this.set(t[0],t[3],t[6],0,t[1],t[4],t[7],0,t[2],t[5],t[8],0,0,0,0,1),this}extractBasis(e,t,i){return e.setFromMatrixColumn(this,0),t.setFromMatrixColumn(this,1),i.setFromMatrixColumn(this,2),this}makeBasis(e,t,i){return this.set(e.x,t.x,i.x,0,e.y,t.y,i.y,0,e.z,t.z,i.z,0,0,0,0,1),this}extractRotation(e){const t=this.elements,i=e.elements,r=1/Nl.setFromMatrixColumn(e,0).length(),s=1/Nl.setFromMatrixColumn(e,1).length(),o=1/Nl.setFromMatrixColumn(e,2).length();return t[0]=i[0]*r,t[1]=i[1]*r,t[2]=i[2]*r,t[3]=0,t[4]=i[4]*s,t[5]=i[5]*s,t[6]=i[6]*s,t[7]=0,t[8]=i[8]*o,t[9]=i[9]*o,t[10]=i[10]*o,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,this}makeRotationFromEuler(e){const t=this.elements,i=e.x,r=e.y,s=e.z,o=Math.cos(i),a=Math.sin(i),l=Math.cos(r),u=Math.sin(r),h=Math.cos(s),d=Math.sin(s);if(e.order==="XYZ"){const p=o*h,m=o*d,y=a*h,M=a*d;t[0]=l*h,t[4]=-l*d,t[8]=u,t[1]=m+y*u,t[5]=p-M*u,t[9]=-a*l,t[2]=M-p*u,t[6]=y+m*u,t[10]=o*l}else if(e.order==="YXZ"){const p=l*h,m=l*d,y=u*h,M=u*d;t[0]=p+M*a,t[4]=y*a-m,t[8]=o*u,t[1]=o*d,t[5]=o*h,t[9]=-a,t[2]=m*a-y,t[6]=M+p*a,t[10]=o*l}else if(e.order==="ZXY"){const p=l*h,m=l*d,y=u*h,M=u*d;t[0]=p-M*a,t[4]=-o*d,t[8]=y+m*a,t[1]=m+y*a,t[5]=o*h,t[9]=M-p*a,t[2]=-o*u,t[6]=a,t[10]=o*l}else if(e.order==="ZYX"){const p=o*h,m=o*d,y=a*h,M=a*d;t[0]=l*h,t[4]=y*u-m,t[8]=p*u+M,t[1]=l*d,t[5]=M*u+p,t[9]=m*u-y,t[2]=-u,t[6]=a*l,t[10]=o*l}else if(e.order==="YZX"){const p=o*l,m=o*u,y=a*l,M=a*u;t[0]=l*h,t[4]=M-p*d,t[8]=y*d+m,t[1]=d,t[5]=o*h,t[9]=-a*h,t[2]=-u*h,t[6]=m*d+y,t[10]=p-M*d}else if(e.order==="XZY"){const p=o*l,m=o*u,y=a*l,M=a*u;t[0]=l*h,t[4]=-d,t[8]=u*h,t[1]=p*d+M,t[5]=o*h,t[9]=m*d-y,t[2]=y*d-m,t[6]=a*h,t[10]=M*d+p}return t[3]=0,t[7]=0,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,this}makeRotationFromQuaternion(e){return this.compose(aU,e,lU)}lookAt(e,t,i){const r=this.elements;return Hi.subVectors(e,t),Hi.lengthSq()===0&&(Hi.z=1),Hi.normalize(),go.crossVectors(i,Hi),go.lengthSq()===0&&(Math.abs(i.z)===1?Hi.x+=1e-4:Hi.z+=1e-4,Hi.normalize(),go.crossVectors(i,Hi)),go.normalize(),lp.crossVectors(Hi,go),r[0]=go.x,r[4]=lp.x,r[8]=Hi.x,r[1]=go.y,r[5]=lp.y,r[9]=Hi.y,r[2]=go.z,r[6]=lp.z,r[10]=Hi.z,this}multiply(e){return this.multiplyMatrices(this,e)}premultiply(e){return this.multiplyMatrices(e,this)}multiplyMatrices(e,t){const i=e.elements,r=t.elements,s=this.elements,o=i[0],a=i[4],l=i[8],u=i[12],h=i[1],d=i[5],p=i[9],m=i[13],y=i[2],M=i[6],_=i[10],g=i[14],x=i[3],S=i[7],E=i[11],C=i[15],b=r[0],P=r[4],B=r[8],R=r[12],L=r[1],z=r[5],$=r[9],X=r[13],Q=r[2],Y=r[6],ne=r[10],ee=r[14],I=r[3],V=r[7],H=r[11],U=r[15];return s[0]=o*b+a*L+l*Q+u*I,s[4]=o*P+a*z+l*Y+u*V,s[8]=o*B+a*$+l*ne+u*H,s[12]=o*R+a*X+l*ee+u*U,s[1]=h*b+d*L+p*Q+m*I,s[5]=h*P+d*z+p*Y+m*V,s[9]=h*B+d*$+p*ne+m*H,s[13]=h*R+d*X+p*ee+m*U,s[2]=y*b+M*L+_*Q+g*I,s[6]=y*P+M*z+_*Y+g*V,s[10]=y*B+M*$+_*ne+g*H,s[14]=y*R+M*X+_*ee+g*U,s[3]=x*b+S*L+E*Q+C*I,s[7]=x*P+S*z+E*Y+C*V,s[11]=x*B+S*$+E*ne+C*H,s[15]=x*R+S*X+E*ee+C*U,this}multiplyScalar(e){const t=this.elements;return t[0]*=e,t[4]*=e,t[8]*=e,t[12]*=e,t[1]*=e,t[5]*=e,t[9]*=e,t[13]*=e,t[2]*=e,t[6]*=e,t[10]*=e,t[14]*=e,t[3]*=e,t[7]*=e,t[11]*=e,t[15]*=e,this}determinant(){const e=this.elements,t=e[0],i=e[4],r=e[8],s=e[12],o=e[1],a=e[5],l=e[9],u=e[13],h=e[2],d=e[6],p=e[10],m=e[14],y=e[3],M=e[7],_=e[11],g=e[15];return y*(+s*l*d-r*u*d-s*a*p+i*u*p+r*a*m-i*l*m)+M*(+t*l*m-t*u*p+s*o*p-r*o*m+r*u*h-s*l*h)+_*(+t*u*d-t*a*m-s*o*d+i*o*m+s*a*h-i*u*h)+g*(-r*a*h-t*l*d+t*a*p+r*o*d-i*o*p+i*l*h)}transpose(){const e=this.elements;let t;return t=e[1],e[1]=e[4],e[4]=t,t=e[2],e[2]=e[8],e[8]=t,t=e[6],e[6]=e[9],e[9]=t,t=e[3],e[3]=e[12],e[12]=t,t=e[7],e[7]=e[13],e[13]=t,t=e[11],e[11]=e[14],e[14]=t,this}setPosition(e,t,i){const 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]=i),this}invert(){const e=this.elements,t=e[0],i=e[1],r=e[2],s=e[3],o=e[4],a=e[5],l=e[6],u=e[7],h=e[8],d=e[9],p=e[10],m=e[11],y=e[12],M=e[13],_=e[14],g=e[15],x=d*_*u-M*p*u+M*l*m-a*_*m-d*l*g+a*p*g,S=y*p*u-h*_*u-y*l*m+o*_*m+h*l*g-o*p*g,E=h*M*u-y*d*u+y*a*m-o*M*m-h*a*g+o*d*g,C=y*d*l-h*M*l-y*a*p+o*M*p+h*a*_-o*d*_,b=t*x+i*S+r*E+s*C;if(b===0)return this.set(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0);const P=1/b;return e[0]=x*P,e[1]=(M*p*s-d*_*s-M*r*m+i*_*m+d*r*g-i*p*g)*P,e[2]=(a*_*s-M*l*s+M*r*u-i*_*u-a*r*g+i*l*g)*P,e[3]=(d*l*s-a*p*s-d*r*u+i*p*u+a*r*m-i*l*m)*P,e[4]=S*P,e[5]=(h*_*s-y*p*s+y*r*m-t*_*m-h*r*g+t*p*g)*P,e[6]=(y*l*s-o*_*s-y*r*u+t*_*u+o*r*g-t*l*g)*P,e[7]=(o*p*s-h*l*s+h*r*u-t*p*u-o*r*m+t*l*m)*P,e[8]=E*P,e[9]=(y*d*s-h*M*s-y*i*m+t*M*m+h*i*g-t*d*g)*P,e[10]=(o*M*s-y*a*s+y*i*u-t*M*u-o*i*g+t*a*g)*P,e[11]=(h*a*s-o*d*s-h*i*u+t*d*u+o*i*m-t*a*m)*P,e[12]=C*P,e[13]=(h*M*r-y*d*r+y*i*p-t*M*p-h*i*_+t*d*_)*P,e[14]=(y*a*r-o*M*r-y*i*l+t*M*l+o*i*_-t*a*_)*P,e[15]=(o*d*r-h*a*r+h*i*l-t*d*l-o*i*p+t*a*p)*P,this}scale(e){const t=this.elements,i=e.x,r=e.y,s=e.z;return t[0]*=i,t[4]*=r,t[8]*=s,t[1]*=i,t[5]*=r,t[9]*=s,t[2]*=i,t[6]*=r,t[10]*=s,t[3]*=i,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],i=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,i,r))}makeTranslation(e,t,i){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,i,0,0,0,1),this}makeRotationX(e){const t=Math.cos(e),i=Math.sin(e);return this.set(1,0,0,0,0,t,-i,0,0,i,t,0,0,0,0,1),this}makeRotationY(e){const t=Math.cos(e),i=Math.sin(e);return this.set(t,0,i,0,0,1,0,0,-i,0,t,0,0,0,0,1),this}makeRotationZ(e){const t=Math.cos(e),i=Math.sin(e);return this.set(t,-i,0,0,i,t,0,0,0,0,1,0,0,0,0,1),this}makeRotationAxis(e,t){const i=Math.cos(t),r=Math.sin(t),s=1-i,o=e.x,a=e.y,l=e.z,u=s*o,h=s*a;return this.set(u*o+i,u*a-r*l,u*l+r*a,0,u*a+r*l,h*a+i,h*l-r*o,0,u*l-r*a,h*l+r*o,s*l*l+i,0,0,0,0,1),this}makeScale(e,t,i){return this.set(e,0,0,0,0,t,0,0,0,0,i,0,0,0,0,1),this}makeShear(e,t,i,r,s,o){return this.set(1,i,s,0,e,1,o,0,t,r,1,0,0,0,0,1),this}compose(e,t,i){const r=this.elements,s=t._x,o=t._y,a=t._z,l=t._w,u=s+s,h=o+o,d=a+a,p=s*u,m=s*h,y=s*d,M=o*h,_=o*d,g=a*d,x=l*u,S=l*h,E=l*d,C=i.x,b=i.y,P=i.z;return r[0]=(1-(M+g))*C,r[1]=(m+E)*C,r[2]=(y-S)*C,r[3]=0,r[4]=(m-E)*b,r[5]=(1-(p+g))*b,r[6]=(_+x)*b,r[7]=0,r[8]=(y+S)*P,r[9]=(_-x)*P,r[10]=(1-(p+M))*P,r[11]=0,r[12]=e.x,r[13]=e.y,r[14]=e.z,r[15]=1,this}decompose(e,t,i){const r=this.elements;let s=Nl.set(r[0],r[1],r[2]).length();const o=Nl.set(r[4],r[5],r[6]).length(),a=Nl.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],br.copy(this);const u=1/s,h=1/o,d=1/a;return br.elements[0]*=u,br.elements[1]*=u,br.elements[2]*=u,br.elements[4]*=h,br.elements[5]*=h,br.elements[6]*=h,br.elements[8]*=d,br.elements[9]*=d,br.elements[10]*=d,t.setFromRotationMatrix(br),i.x=s,i.y=o,i.z=a,this}makePerspective(e,t,i,r,s,o,a=cs){const l=this.elements,u=2*s/(t-e),h=2*s/(i-r),d=(t+e)/(t-e),p=(i+r)/(i-r);let m,y;if(a===cs)m=-(o+s)/(o-s),y=-2*o*s/(o-s);else if(a===rh)m=-o/(o-s),y=-o*s/(o-s);else throw new Error("THREE.Matrix4.makePerspective(): Invalid coordinate system: "+a);return l[0]=u,l[4]=0,l[8]=d,l[12]=0,l[1]=0,l[5]=h,l[9]=p,l[13]=0,l[2]=0,l[6]=0,l[10]=m,l[14]=y,l[3]=0,l[7]=0,l[11]=-1,l[15]=0,this}makeOrthographic(e,t,i,r,s,o,a=cs){const l=this.elements,u=1/(t-e),h=1/(i-r),d=1/(o-s),p=(t+e)*u,m=(i+r)*h;let y,M;if(a===cs)y=(o+s)*d,M=-2*d;else if(a===rh)y=s*d,M=-1*d;else throw new Error("THREE.Matrix4.makeOrthographic(): Invalid coordinate system: "+a);return l[0]=2*u,l[4]=0,l[8]=0,l[12]=-p,l[1]=0,l[5]=2*h,l[9]=0,l[13]=-m,l[2]=0,l[6]=0,l[10]=M,l[14]=-y,l[3]=0,l[7]=0,l[11]=0,l[15]=1,this}equals(e){const t=this.elements,i=e.elements;for(let r=0;r<16;r++)if(t[r]!==i[r])return!1;return!0}fromArray(e,t=0){for(let i=0;i<16;i++)this.elements[i]=e[i+t];return this}toArray(e=[],t=0){const i=this.elements;return e[t]=i[0],e[t+1]=i[1],e[t+2]=i[2],e[t+3]=i[3],e[t+4]=i[4],e[t+5]=i[5],e[t+6]=i[6],e[t+7]=i[7],e[t+8]=i[8],e[t+9]=i[9],e[t+10]=i[10],e[t+11]=i[11],e[t+12]=i[12],e[t+13]=i[13],e[t+14]=i[14],e[t+15]=i[15],e}}const Nl=new F,br=new rt,aU=new F(0,0,0),lU=new F(1,1,1),go=new F,lp=new F,Hi=new F,Mw=new rt,Ew=new Gn;class Eh{constructor(e=0,t=0,i=0,r=Eh.DEFAULT_ORDER){this.isEuler=!0,this._x=e,this._y=t,this._z=i,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,i,r=this._order){return this._x=e,this._y=t,this._z=i,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,i=!0){const r=e.elements,s=r[0],o=r[4],a=r[8],l=r[1],u=r[5],h=r[9],d=r[2],p=r[6],m=r[10];switch(t){case"XYZ":this._y=Math.asin(gn(a,-1,1)),Math.abs(a)<.9999999?(this._x=Math.atan2(-h,m),this._z=Math.atan2(-o,s)):(this._x=Math.atan2(p,u),this._z=0);break;case"YXZ":this._x=Math.asin(-gn(h,-1,1)),Math.abs(h)<.9999999?(this._y=Math.atan2(a,m),this._z=Math.atan2(l,u)):(this._y=Math.atan2(-d,s),this._z=0);break;case"ZXY":this._x=Math.asin(gn(p,-1,1)),Math.abs(p)<.9999999?(this._y=Math.atan2(-d,m),this._z=Math.atan2(-o,u)):(this._y=0,this._z=Math.atan2(l,s));break;case"ZYX":this._y=Math.asin(-gn(d,-1,1)),Math.abs(d)<.9999999?(this._x=Math.atan2(p,m),this._z=Math.atan2(l,s)):(this._x=0,this._z=Math.atan2(-o,u));break;case"YZX":this._z=Math.asin(gn(l,-1,1)),Math.abs(l)<.9999999?(this._x=Math.atan2(-h,u),this._y=Math.atan2(-d,s)):(this._x=0,this._y=Math.atan2(a,m));break;case"XZY":this._z=Math.asin(-gn(o,-1,1)),Math.abs(o)<.9999999?(this._x=Math.atan2(p,u),this._y=Math.atan2(a,s)):(this._x=Math.atan2(-h,m),this._y=0);break;default:console.warn("THREE.Euler: .setFromRotationMatrix() encountered an unknown order: "+t)}return this._order=t,i===!0&&this._onChangeCallback(),this}setFromQuaternion(e,t,i){return Mw.makeRotationFromQuaternion(e),this.setFromRotationMatrix(Mw,t,i)}setFromVector3(e,t=this._order){return this.set(e.x,e.y,e.z,t)}reorder(e){return Ew.setFromEuler(this),this.setFromQuaternion(Ew,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}}Eh.DEFAULT_ORDER="XYZ";class Za{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 cU=0;const ww=new F,Ol=new Gn,Bs=new rt,cp=new F,Wu=new F,uU=new F,fU=new Gn,Tw=new F(1,0,0),Cw=new F(0,1,0),bw=new F(0,0,1),hU={type:"added"},Rw={type:"removed"};class bt extends xs{constructor(){super(),this.isObject3D=!0,Object.defineProperty(this,"id",{value:cU++}),this.uuid=Ji(),this.name="",this.type="Object3D",this.parent=null,this.children=[],this.up=bt.DEFAULT_UP.clone();const e=new F,t=new Eh,i=new Gn,r=new F(1,1,1);function s(){i.setFromEuler(t,!1)}function o(){t.setFromQuaternion(i,void 0,!1)}t._onChange(s),i._onChange(o),Object.defineProperties(this,{position:{configurable:!0,enumerable:!0,value:e},rotation:{configurable:!0,enumerable:!0,value:t},quaternion:{configurable:!0,enumerable:!0,value:i},scale:{configurable:!0,enumerable:!0,value:r},modelViewMatrix:{value:new rt},normalMatrix:{value:new _t}}),this.matrix=new rt,this.matrixWorld=new rt,this.matrixAutoUpdate=bt.DEFAULT_MATRIX_AUTO_UPDATE,this.matrixWorldNeedsUpdate=!1,this.matrixWorldAutoUpdate=bt.DEFAULT_MATRIX_WORLD_AUTO_UPDATE,this.layers=new Za,this.visible=!0,this.castShadow=!1,this.receiveShadow=!1,this.frustumCulled=!0,this.renderOrder=0,this.animations=[],this.userData={}}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 Ol.setFromAxisAngle(e,t),this.quaternion.multiply(Ol),this}rotateOnWorldAxis(e,t){return Ol.setFromAxisAngle(e,t),this.quaternion.premultiply(Ol),this}rotateX(e){return this.rotateOnAxis(Tw,e)}rotateY(e){return this.rotateOnAxis(Cw,e)}rotateZ(e){return this.rotateOnAxis(bw,e)}translateOnAxis(e,t){return ww.copy(e).applyQuaternion(this.quaternion),this.position.add(ww.multiplyScalar(t)),this}translateX(e){return this.translateOnAxis(Tw,e)}translateY(e){return this.translateOnAxis(Cw,e)}translateZ(e){return this.translateOnAxis(bw,e)}localToWorld(e){return this.updateWorldMatrix(!0,!1),e.applyMatrix4(this.matrixWorld)}worldToLocal(e){return this.updateWorldMatrix(!0,!1),e.applyMatrix4(Bs.copy(this.matrixWorld).invert())}lookAt(e,t,i){e.isVector3?cp.copy(e):cp.set(e,t,i);const r=this.parent;this.updateWorldMatrix(!0,!1),Wu.setFromMatrixPosition(this.matrixWorld),this.isCamera||this.isLight?Bs.lookAt(Wu,cp,this.up):Bs.lookAt(cp,Wu,this.up),this.quaternion.setFromRotationMatrix(Bs),r&&(Bs.extractRotation(r.matrixWorld),Ol.setFromRotationMatrix(Bs),this.quaternion.premultiply(Ol.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.parent!==null&&e.parent.remove(e),e.parent=this,this.children.push(e),e.dispatchEvent(hU)):console.error("THREE.Object3D.add: object not an instance of THREE.Object3D.",e),this)}remove(e){if(arguments.length>1){for(let i=0;i<arguments.length;i++)this.remove(arguments[i]);return this}const t=this.children.indexOf(e);return t!==-1&&(e.parent=null,this.children.splice(t,1),e.dispatchEvent(Rw)),this}removeFromParent(){const e=this.parent;return e!==null&&e.remove(this),this}clear(){for(let e=0;e<this.children.length;e++){const t=this.children[e];t.parent=null,t.dispatchEvent(Rw)}return this.children.length=0,this}attach(e){return this.updateWorldMatrix(!0,!1),Bs.copy(this.matrixWorld).invert(),e.parent!==null&&(e.parent.updateWorldMatrix(!0,!1),Bs.multiply(e.parent.matrixWorld)),e.applyMatrix4(Bs),this.add(e),e.updateWorldMatrix(!1,!0),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 i=0,r=this.children.length;i<r;i++){const o=this.children[i].getObjectByProperty(e,t);if(o!==void 0)return o}}getObjectsByProperty(e,t){let i=[];this[e]===t&&i.push(this);for(let r=0,s=this.children.length;r<s;r++){const o=this.children[r].getObjectsByProperty(e,t);o.length>0&&(i=i.concat(o))}return i}getWorldPosition(e){return this.updateWorldMatrix(!0,!1),e.setFromMatrixPosition(this.matrixWorld)}getWorldQuaternion(e){return this.updateWorldMatrix(!0,!1),this.matrixWorld.decompose(Wu,e,uU),e}getWorldScale(e){return this.updateWorldMatrix(!0,!1),this.matrixWorld.decompose(Wu,fU,e),e}getWorldDirection(e){this.updateWorldMatrix(!0,!1);const t=this.matrixWorld.elements;return e.set(t[8],t[9],t[10]).normalize()}raycast(){}traverse(e){e(this);const t=this.children;for(let i=0,r=t.length;i<r;i++)t[i].traverse(e)}traverseVisible(e){if(this.visible===!1)return;e(this);const t=this.children;for(let i=0,r=t.length;i<r;i++)t[i].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.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 i=0,r=t.length;i<r;i++){const s=t[i];(s.matrixWorldAutoUpdate===!0||e===!0)&&s.updateMatrixWorld(e)}}updateWorldMatrix(e,t){const i=this.parent;if(e===!0&&i!==null&&i.matrixWorldAutoUpdate===!0&&i.updateWorldMatrix(!0,!1),this.matrixAutoUpdate&&this.updateMatrix(),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,o=r.length;s<o;s++){const a=r[s];a.matrixWorldAutoUpdate===!0&&a.updateWorldMatrix(!1,!0)}}}toJSON(e){const t=e===void 0||typeof e=="string",i={};t&&(e={geometries:{},materials:{},textures:{},images:{},shapes:{},skeletons:{},animations:{},nodes:{}},i.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()));function s(a,l){return a[l.uuid]===void 0&&(a[l.uuid]=l.toJSON(e)),l.uuid}if(this.isScene)this.background&&(this.background.isColor?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 a=this.geometry.parameters;if(a!==void 0&&a.shapes!==void 0){const l=a.shapes;if(Array.isArray(l))for(let u=0,h=l.length;u<h;u++){const d=l[u];s(e.shapes,d)}else s(e.shapes,l)}}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 a=[];for(let l=0,u=this.material.length;l<u;l++)a.push(s(e.materials,this.material[l]));r.material=a}else r.material=s(e.materials,this.material);if(this.children.length>0){r.children=[];for(let a=0;a<this.children.length;a++)r.children.push(this.children[a].toJSON(e).object)}if(this.animations.length>0){r.animations=[];for(let a=0;a<this.animations.length;a++){const l=this.animations[a];r.animations.push(s(e.animations,l))}}if(t){const a=o(e.geometries),l=o(e.materials),u=o(e.textures),h=o(e.images),d=o(e.shapes),p=o(e.skeletons),m=o(e.animations),y=o(e.nodes);a.length>0&&(i.geometries=a),l.length>0&&(i.materials=l),u.length>0&&(i.textures=u),h.length>0&&(i.images=h),d.length>0&&(i.shapes=d),p.length>0&&(i.skeletons=p),m.length>0&&(i.animations=m),y.length>0&&(i.nodes=y)}return i.object=r,i;function o(a){const l=[];for(const u in a){const h=a[u];delete h.metadata,l.push(h)}return l}}clone(e){return new this.constructor().copy(this,e)}copy(e,t=!0){if(this.name=e.name,this.up.copy(e.up),this.position.copy(e.position),this.rotation.order=e.rotation.order,this.quaternion.copy(e.quaternion),this.scale.copy(e.scale),this.matrix.copy(e.matrix),this.matrixWorld.copy(e.matrixWorld),this.matrixAutoUpdate=e.matrixAutoUpdate,this.matrixWorldNeedsUpdate=e.matrixWorldNeedsUpdate,this.matrixWorldAutoUpdate=e.matrixWorldAutoUpdate,this.layers.mask=e.layers.mask,this.visible=e.visible,this.castShadow=e.castShadow,this.receiveShadow=e.receiveShadow,this.frustumCulled=e.frustumCulled,this.renderOrder=e.renderOrder,this.animations=e.animations,this.userData=JSON.parse(JSON.stringify(e.userData)),t===!0)for(let i=0;i<e.children.length;i++){const r=e.children[i];this.add(r.clone())}return this}}bt.DEFAULT_UP=new F(0,1,0);bt.DEFAULT_MATRIX_AUTO_UPDATE=!0;bt.DEFAULT_MATRIX_WORLD_AUTO_UPDATE=!0;const Rr=new F,Ls=new F,$v=new F,Is=new F,Ul=new F,kl=new F,Pw=new F,ey=new F,ty=new F,ny=new F;let up=!1;class wi{constructor(e=new F,t=new F,i=new F){this.a=e,this.b=t,this.c=i}static getNormal(e,t,i,r){r.subVectors(i,t),Rr.subVectors(e,t),r.cross(Rr);const s=r.lengthSq();return s>0?r.multiplyScalar(1/Math.sqrt(s)):r.set(0,0,0)}static getBarycoord(e,t,i,r,s){Rr.subVectors(r,t),Ls.subVectors(i,t),$v.subVectors(e,t);const o=Rr.dot(Rr),a=Rr.dot(Ls),l=Rr.dot($v),u=Ls.dot(Ls),h=Ls.dot($v),d=o*u-a*a;if(d===0)return s.set(-2,-1,-1);const p=1/d,m=(u*l-a*h)*p,y=(o*h-a*l)*p;return s.set(1-m-y,y,m)}static containsPoint(e,t,i,r){return this.getBarycoord(e,t,i,r,Is),Is.x>=0&&Is.y>=0&&Is.x+Is.y<=1}static getUV(e,t,i,r,s,o,a,l){return up===!1&&(console.warn("THREE.Triangle.getUV() has been renamed to THREE.Triangle.getInterpolation()."),up=!0),this.getInterpolation(e,t,i,r,s,o,a,l)}static getInterpolation(e,t,i,r,s,o,a,l){return this.getBarycoord(e,t,i,r,Is),l.setScalar(0),l.addScaledVector(s,Is.x),l.addScaledVector(o,Is.y),l.addScaledVector(a,Is.z),l}static isFrontFacing(e,t,i,r){return Rr.subVectors(i,t),Ls.subVectors(e,t),Rr.cross(Ls).dot(r)<0}set(e,t,i){return this.a.copy(e),this.b.copy(t),this.c.copy(i),this}setFromPointsAndIndices(e,t,i,r){return this.a.copy(e[t]),this.b.copy(e[i]),this.c.copy(e[r]),this}setFromAttributeAndIndices(e,t,i,r){return this.a.fromBufferAttribute(e,t),this.b.fromBufferAttribute(e,i),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 Rr.subVectors(this.c,this.b),Ls.subVectors(this.a,this.b),Rr.cross(Ls).length()*.5}getMidpoint(e){return e.addVectors(this.a,this.b).add(this.c).multiplyScalar(1/3)}getNormal(e){return wi.getNormal(this.a,this.b,this.c,e)}getPlane(e){return e.setFromCoplanarPoints(this.a,this.b,this.c)}getBarycoord(e,t){return wi.getBarycoord(e,this.a,this.b,this.c,t)}getUV(e,t,i,r,s){return up===!1&&(console.warn("THREE.Triangle.getUV() has been renamed to THREE.Triangle.getInterpolation()."),up=!0),wi.getInterpolation(e,this.a,this.b,this.c,t,i,r,s)}getInterpolation(e,t,i,r,s){return wi.getInterpolation(e,this.a,this.b,this.c,t,i,r,s)}containsPoint(e){return wi.containsPoint(e,this.a,this.b,this.c)}isFrontFacing(e){return wi.isFrontFacing(this.a,this.b,this.c,e)}intersectsBox(e){return e.intersectsTriangle(this)}closestPointToPoint(e,t){const i=this.a,r=this.b,s=this.c;let o,a;Ul.subVectors(r,i),kl.subVectors(s,i),ey.subVectors(e,i);const l=Ul.dot(ey),u=kl.dot(ey);if(l<=0&&u<=0)return t.copy(i);ty.subVectors(e,r);const h=Ul.dot(ty),d=kl.dot(ty);if(h>=0&&d<=h)return t.copy(r);const p=l*d-h*u;if(p<=0&&l>=0&&h<=0)return o=l/(l-h),t.copy(i).addScaledVector(Ul,o);ny.subVectors(e,s);const m=Ul.dot(ny),y=kl.dot(ny);if(y>=0&&m<=y)return t.copy(s);const M=m*u-l*y;if(M<=0&&u>=0&&y<=0)return a=u/(u-y),t.copy(i).addScaledVector(kl,a);const _=h*y-m*d;if(_<=0&&d-h>=0&&m-y>=0)return Pw.subVectors(s,r),a=(d-h)/(d-h+(m-y)),t.copy(r).addScaledVector(Pw,a);const g=1/(_+M+p);return o=M*g,a=p*g,t.copy(i).addScaledVector(Ul,o).addScaledVector(kl,a)}equals(e){return e.a.equals(this.a)&&e.b.equals(this.b)&&e.c.equals(this.c)}}let dU=0;class Cn extends xs{constructor(){super(),this.isMaterial=!0,Object.defineProperty(this,"id",{value:dU++}),this.uuid=Ji(),this.name="",this.type="Material",this.blending=Ka,this.side=gs,this.vertexColors=!1,this.opacity=1,this.transparent=!1,this.alphaHash=!1,this.blendSrc=rS,this.blendDst=sS,this.blendEquation=Da,this.blendSrcAlpha=null,this.blendDstAlpha=null,this.blendEquationAlpha=null,this.depthFunc=Km,this.depthTest=!0,this.depthWrite=!0,this.stencilWriteMask=255,this.stencilFunc=YB,this.stencilRef=0,this.stencilFuncMask=255,this.stencilFail=vm,this.stencilZFail=vm,this.stencilZPass=vm,this.stencilWrite=!1,this.clippingPlanes=null,this.clipIntersection=!1,this.clipShadows=!1,this.shadowSide=null,this.colorWrite=!0,this.precision=null,this.polygonOffset=!1,this.polygonOffsetFactor=0,this.polygonOffsetUnits=0,this.dithering=!1,this.alphaToCoverage=!1,this.premultipliedAlpha=!1,this.forceSinglePass=!1,this.visible=!0,this.toneMapped=!0,this.userData={},this.version=0,this._alphaTest=0}get alphaTest(){return this._alphaTest}set alphaTest(e){this._alphaTest>0!=e>0&&this.version++,this._alphaTest=e}onBuild(){}onBeforeRender(){}onBeforeCompile(){}customProgramCacheKey(){return this.onBeforeCompile.toString()}setValues(e){if(e!==void 0)for(const t in e){const i=e[t];if(i===void 0){console.warn(`THREE.Material: parameter '${t}' has value of undefined.`);continue}const 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(i):r&&r.isVector3&&i&&i.isVector3?r.copy(i):this[t]=i}}toJSON(e){const t=e===void 0||typeof e=="string";t&&(e={textures:{},images:{}});const i={metadata:{version:4.6,type:"Material",generator:"Material.toJSON"}};i.uuid=this.uuid,i.type=this.type,this.name!==""&&(i.name=this.name),this.color&&this.color.isColor&&(i.color=this.color.getHex()),this.roughness!==void 0&&(i.roughness=this.roughness),this.metalness!==void 0&&(i.metalness=this.metalness),this.sheen!==void 0&&(i.sheen=this.sheen),this.sheenColor&&this.sheenColor.isColor&&(i.sheenColor=this.sheenColor.getHex()),this.sheenRoughness!==void 0&&(i.sheenRoughness=this.sheenRoughness),this.emissive&&this.emissive.isColor&&(i.emissive=this.emissive.getHex()),this.emissiveIntensity&&this.emissiveIntensity!==1&&(i.emissiveIntensity=this.emissiveIntensity),this.specular&&this.specular.isColor&&(i.specular=this.specular.getHex()),this.specularIntensity!==void 0&&(i.specularIntensity=this.specularIntensity),this.specularColor&&this.specularColor.isColor&&(i.specularColor=this.specularColor.getHex()),this.shininess!==void 0&&(i.shininess=this.shininess),this.clearcoat!==void 0&&(i.clearcoat=this.clearcoat),this.clearcoatRoughness!==void 0&&(i.clearcoatRoughness=this.clearcoatRoughness),this.clearcoatMap&&this.clearcoatMap.isTexture&&(i.clearcoatMap=this.clearcoatMap.toJSON(e).uuid),this.clearcoatRoughnessMap&&this.clearcoatRoughnessMap.isTexture&&(i.clearcoatRoughnessMap=this.clearcoatRoughnessMap.toJSON(e).uuid),this.clearcoatNormalMap&&this.clearcoatNormalMap.isTexture&&(i.clearcoatNormalMap=this.clearcoatNormalMap.toJSON(e).uuid,i.clearcoatNormalScale=this.clearcoatNormalScale.toArray()),this.iridescence!==void 0&&(i.iridescence=this.iridescence),this.iridescenceIOR!==void 0&&(i.iridescenceIOR=this.iridescenceIOR),this.iridescenceThicknessRange!==void 0&&(i.iridescenceThicknessRange=this.iridescenceThicknessRange),this.iridescenceMap&&this.iridescenceMap.isTexture&&(i.iridescenceMap=this.iridescenceMap.toJSON(e).uuid),this.iridescenceThicknessMap&&this.iridescenceThicknessMap.isTexture&&(i.iridescenceThicknessMap=this.iridescenceThicknessMap.toJSON(e).uuid),this.anisotropy!==void 0&&(i.anisotropy=this.anisotropy),this.anisotropyRotation!==void 0&&(i.anisotropyRotation=this.anisotropyRotation),this.anisotropyMap&&this.anisotropyMap.isTexture&&(i.anisotropyMap=this.anisotropyMap.toJSON(e).uuid),this.map&&this.map.isTexture&&(i.map=this.map.toJSON(e).uuid),this.matcap&&this.matcap.isTexture&&(i.matcap=this.matcap.toJSON(e).uuid),this.alphaMap&&this.alphaMap.isTexture&&(i.alphaMap=this.alphaMap.toJSON(e).uuid),this.lightMap&&this.lightMap.isTexture&&(i.lightMap=this.lightMap.toJSON(e).uuid,i.lightMapIntensity=this.lightMapIntensity),this.aoMap&&this.aoMap.isTexture&&(i.aoMap=this.aoMap.toJSON(e).uuid,i.aoMapIntensity=this.aoMapIntensity),this.bumpMap&&this.bumpMap.isTexture&&(i.bumpMap=this.bumpMap.toJSON(e).uuid,i.bumpScale=this.bumpScale),this.normalMap&&this.normalMap.isTexture&&(i.normalMap=this.normalMap.toJSON(e).uuid,i.normalMapType=this.normalMapType,i.normalScale=this.normalScale.toArray()),this.displacementMap&&this.displacementMap.isTexture&&(i.displacementMap=this.displacementMap.toJSON(e).uuid,i.displacementScale=this.displacementScale,i.displacementBias=this.displacementBias),this.roughnessMap&&this.roughnessMap.isTexture&&(i.roughnessMap=this.roughnessMap.toJSON(e).uuid),this.metalnessMap&&this.metalnessMap.isTexture&&(i.metalnessMap=this.metalnessMap.toJSON(e).uuid),this.emissiveMap&&this.emissiveMap.isTexture&&(i.emissiveMap=this.emissiveMap.toJSON(e).uuid),this.specularMap&&this.specularMap.isTexture&&(i.specularMap=this.specularMap.toJSON(e).uuid),this.specularIntensityMap&&this.specularIntensityMap.isTexture&&(i.specularIntensityMap=this.specularIntensityMap.toJSON(e).uuid),this.specularColorMap&&this.specularColorMap.isTexture&&(i.specularColorMap=this.specularColorMap.toJSON(e).uuid),this.envMap&&this.envMap.isTexture&&(i.envMap=this.envMap.toJSON(e).uuid,this.combine!==void 0&&(i.combine=this.combine)),this.envMapIntensity!==void 0&&(i.envMapIntensity=this.envMapIntensity),this.reflectivity!==void 0&&(i.reflectivity=this.reflectivity),this.refractionRatio!==void 0&&(i.refractionRatio=this.refractionRatio),this.gradientMap&&this.gradientMap.isTexture&&(i.gradientMap=this.gradientMap.toJSON(e).uuid),this.transmission!==void 0&&(i.transmission=this.transmission),this.transmissionMap&&this.transmissionMap.isTexture&&(i.transmissionMap=this.transmissionMap.toJSON(e).uuid),this.thickness!==void 0&&(i.thickness=this.thickness),this.thicknessMap&&this.thicknessMap.isTexture&&(i.thicknessMap=this.thicknessMap.toJSON(e).uuid),this.attenuationDistance!==void 0&&this.attenuationDistance!==1/0&&(i.attenuationDistance=this.attenuationDistance),this.attenuationColor!==void 0&&(i.attenuationColor=this.attenuationColor.getHex()),this.size!==void 0&&(i.size=this.size),this.shadowSide!==null&&(i.shadowSide=this.shadowSide),this.sizeAttenuation!==void 0&&(i.sizeAttenuation=this.sizeAttenuation),this.blending!==Ka&&(i.blending=this.blending),this.side!==gs&&(i.side=this.side),this.vertexColors&&(i.vertexColors=!0),this.opacity<1&&(i.opacity=this.opacity),this.transparent===!0&&(i.transparent=this.transparent),i.depthFunc=this.depthFunc,i.depthTest=this.depthTest,i.depthWrite=this.depthWrite,i.colorWrite=this.colorWrite,i.stencilWrite=this.stencilWrite,i.stencilWriteMask=this.stencilWriteMask,i.stencilFunc=this.stencilFunc,i.stencilRef=this.stencilRef,i.stencilFuncMask=this.stencilFuncMask,i.stencilFail=this.stencilFail,i.stencilZFail=this.stencilZFail,i.stencilZPass=this.stencilZPass,this.rotation!==void 0&&this.rotation!==0&&(i.rotation=this.rotation),this.polygonOffset===!0&&(i.polygonOffset=!0),this.polygonOffsetFactor!==0&&(i.polygonOffsetFactor=this.polygonOffsetFactor),this.polygonOffsetUnits!==0&&(i.polygonOffsetUnits=this.polygonOffsetUnits),this.linewidth!==void 0&&this.linewidth!==1&&(i.linewidth=this.linewidth),this.dashSize!==void 0&&(i.dashSize=this.dashSize),this.gapSize!==void 0&&(i.gapSize=this.gapSize),this.scale!==void 0&&(i.scale=this.scale),this.dithering===!0&&(i.dithering=!0),this.alphaTest>0&&(i.alphaTest=this.alphaTest),this.alphaHash===!0&&(i.alphaHash=this.alphaHash),this.alphaToCoverage===!0&&(i.alphaToCoverage=this.alphaToCoverage),this.premultipliedAlpha===!0&&(i.premultipliedAlpha=this.premultipliedAlpha),this.forceSinglePass===!0&&(i.forceSinglePass=this.forceSinglePass),this.wireframe===!0&&(i.wireframe=this.wireframe),this.wireframeLinewidth>1&&(i.wireframeLinewidth=this.wireframeLinewidth),this.wireframeLinecap!=="round"&&(i.wireframeLinecap=this.wireframeLinecap),this.wireframeLinejoin!=="round"&&(i.wireframeLinejoin=this.wireframeLinejoin),this.flatShading===!0&&(i.flatShading=this.flatShading),this.visible===!1&&(i.visible=!1),this.toneMapped===!1&&(i.toneMapped=!1),this.fog===!1&&(i.fog=!1),Object.keys(this.userData).length>0&&(i.userData=this.userData);function r(s){const o=[];for(const a in s){const l=s[a];delete l.metadata,o.push(l)}return o}if(t){const s=r(e.textures),o=r(e.images);s.length>0&&(i.textures=s),o.length>0&&(i.images=o)}return i}clone(){return new this.constructor().copy(this)}copy(e){this.name=e.name,this.blending=e.blending,this.side=e.side,this.vertexColors=e.vertexColors,this.opacity=e.opacity,this.transparent=e.transparent,this.blendSrc=e.blendSrc,this.blendDst=e.blendDst,this.blendEquation=e.blendEquation,this.blendSrcAlpha=e.blendSrcAlpha,this.blendDstAlpha=e.blendDstAlpha,this.blendEquationAlpha=e.blendEquationAlpha,this.depthFunc=e.depthFunc,this.depthTest=e.depthTest,this.depthWrite=e.depthWrite,this.stencilWriteMask=e.stencilWriteMask,this.stencilFunc=e.stencilFunc,this.stencilRef=e.stencilRef,this.stencilFuncMask=e.stencilFuncMask,this.stencilFail=e.stencilFail,this.stencilZFail=e.stencilZFail,this.stencilZPass=e.stencilZPass,this.stencilWrite=e.stencilWrite;const t=e.clippingPlanes;let i=null;if(t!==null){const r=t.length;i=new Array(r);for(let s=0;s!==r;++s)i[s]=t[s].clone()}return this.clippingPlanes=i,this.clipIntersection=e.clipIntersection,this.clipShadows=e.clipShadows,this.shadowSide=e.shadowSide,this.colorWrite=e.colorWrite,this.precision=e.precision,this.polygonOffset=e.polygonOffset,this.polygonOffsetFactor=e.polygonOffsetFactor,this.polygonOffsetUnits=e.polygonOffsetUnits,this.dithering=e.dithering,this.alphaTest=e.alphaTest,this.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++}}const a2={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},Pr={h:0,s:0,l:0},fp={h:0,s:0,l:0};function iy(n,e,t){return t<0&&(t+=1),t>1&&(t-=1),t<1/6?n+(e-n)*6*t:t<1/2?e:t<2/3?n+(e-n)*6*(2/3-t):n}class Oe{constructor(e,t,i){return this.isColor=!0,this.r=1,this.g=1,this.b=1,this.set(e,t,i)}set(e,t,i){if(t===void 0&&i===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,i);return this}setScalar(e){return this.r=e,this.g=e,this.b=e,this}setHex(e,t=mt){return e=Math.floor(e),this.r=(e>>16&255)/255,this.g=(e>>8&255)/255,this.b=(e&255)/255,ur.toWorkingColorSpace(this,t),this}setRGB(e,t,i,r=ur.workingColorSpace){return this.r=e,this.g=t,this.b=i,ur.toWorkingColorSpace(this,r),this}setHSL(e,t,i,r=ur.workingColorSpace){if(e=vS(e,1),t=gn(t,0,1),i=gn(i,0,1),t===0)this.r=this.g=this.b=i;else{const s=i<=.5?i*(1+t):i+t-i*t,o=2*i-s;this.r=iy(o,s,e+1/3),this.g=iy(o,s,e),this.b=iy(o,s,e-1/3)}return ur.toWorkingColorSpace(this,r),this}setStyle(e,t=mt){function i(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 o=r[1],a=r[2];switch(o){case"rgb":case"rgba":if(s=/^\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec(a))return i(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(a))return i(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(a))return i(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],o=s.length;if(o===3)return this.setRGB(parseInt(s.charAt(0),16)/15,parseInt(s.charAt(1),16)/15,parseInt(s.charAt(2),16)/15,t);if(o===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=mt){const i=a2[e.toLowerCase()];return i!==void 0?this.setHex(i,t):console.warn("THREE.Color: Unknown color "+e),this}clone(){return new this.constructor(this.r,this.g,this.b)}copy(e){return this.r=e.r,this.g=e.g,this.b=e.b,this}copySRGBToLinear(e){return this.r=Lc(e.r),this.g=Lc(e.g),this.b=Lc(e.b),this}copyLinearToSRGB(e){return this.r=jv(e.r),this.g=jv(e.g),this.b=jv(e.b),this}convertSRGBToLinear(){return this.copySRGBToLinear(this),this}convertLinearToSRGB(){return this.copyLinearToSRGB(this),this}getHex(e=mt){return ur.fromWorkingColorSpace(ri.copy(this),e),Math.round(gn(ri.r*255,0,255))*65536+Math.round(gn(ri.g*255,0,255))*256+Math.round(gn(ri.b*255,0,255))}getHexString(e=mt){return("000000"+this.getHex(e).toString(16)).slice(-6)}getHSL(e,t=ur.workingColorSpace){ur.fromWorkingColorSpace(ri.copy(this),t);const i=ri.r,r=ri.g,s=ri.b,o=Math.max(i,r,s),a=Math.min(i,r,s);let l,u;const h=(a+o)/2;if(a===o)l=0,u=0;else{const d=o-a;switch(u=h<=.5?d/(o+a):d/(2-o-a),o){case i:l=(r-s)/d+(r<s?6:0);break;case r:l=(s-i)/d+2;break;case s:l=(i-r)/d+4;break}l/=6}return e.h=l,e.s=u,e.l=h,e}getRGB(e,t=ur.workingColorSpace){return ur.fromWorkingColorSpace(ri.copy(this),t),e.r=ri.r,e.g=ri.g,e.b=ri.b,e}getStyle(e=mt){ur.fromWorkingColorSpace(ri.copy(this),e);const t=ri.r,i=ri.g,r=ri.b;return e!==mt?`color(${e} ${t.toFixed(3)} ${i.toFixed(3)} ${r.toFixed(3)})`:`rgb(${Math.round(t*255)},${Math.round(i*255)},${Math.round(r*255)})`}offsetHSL(e,t,i){return this.getHSL(Pr),Pr.h+=e,Pr.s+=t,Pr.l+=i,this.setHSL(Pr.h,Pr.s,Pr.l),this}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,i){return this.r=e.r+(t.r-e.r)*i,this.g=e.g+(t.g-e.g)*i,this.b=e.b+(t.b-e.b)*i,this}lerpHSL(e,t){this.getHSL(Pr),e.getHSL(fp);const i=Cf(Pr.h,fp.h,t),r=Cf(Pr.s,fp.s,t),s=Cf(Pr.l,fp.l,t);return this.setHSL(i,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,i=this.g,r=this.b,s=e.elements;return this.r=s[0]*t+s[3]*i+s[6]*r,this.g=s[1]*t+s[4]*i+s[7]*r,this.b=s[2]*t+s[5]*i+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 ri=new Oe;Oe.NAMES=a2;class ji extends Cn{constructor(e){super(),this.isMeshBasicMaterial=!0,this.type="MeshBasicMaterial",this.color=new Oe(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.combine=Mh,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.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 Os=pU();function pU(){const n=new ArrayBuffer(4),e=new Float32Array(n),t=new Uint32Array(n),i=new Uint32Array(512),r=new Uint32Array(512);for(let l=0;l<256;++l){const u=l-127;u<-27?(i[l]=0,i[l|256]=32768,r[l]=24,r[l|256]=24):u<-14?(i[l]=1024>>-u-14,i[l|256]=1024>>-u-14|32768,r[l]=-u-1,r[l|256]=-u-1):u<=15?(i[l]=u+15<<10,i[l|256]=u+15<<10|32768,r[l]=13,r[l|256]=13):u<128?(i[l]=31744,i[l|256]=64512,r[l]=24,r[l|256]=24):(i[l]=31744,i[l|256]=64512,r[l]=13,r[l|256]=13)}const s=new Uint32Array(2048),o=new Uint32Array(64),a=new Uint32Array(64);for(let l=1;l<1024;++l){let u=l<<13,h=0;for(;!(u&8388608);)u<<=1,h-=8388608;u&=-8388609,h+=947912704,s[l]=u|h}for(let l=1024;l<2048;++l)s[l]=939524096+(l-1024<<13);for(let l=1;l<31;++l)o[l]=l<<23;o[31]=1199570944,o[32]=2147483648;for(let l=33;l<63;++l)o[l]=2147483648+(l-32<<23);o[63]=3347054592;for(let l=1;l<64;++l)l!==32&&(a[l]=1024);return{floatView:e,uint32View:t,baseTable:i,shiftTable:r,mantissaTable:s,exponentTable:o,offsetTable:a}}function Mi(n){Math.abs(n)>65504&&console.warn("THREE.DataUtils.toHalfFloat(): Value out of range."),n=gn(n,-65504,65504),Os.floatView[0]=n;const e=Os.uint32View[0],t=e>>23&511;return Os.baseTable[t]+((e&8388607)>>Os.shiftTable[t])}function pf(n){const e=n>>10;return Os.uint32View[0]=Os.mantissaTable[Os.offsetTable[e]+(n&1023)]+Os.exponentTable[e],Os.floatView[0]}const mU={toHalfFloat:Mi,fromHalfFloat:pf},En=new F,hp=new ge;class Dt{constructor(e,t,i=!1){if(Array.isArray(e))throw new TypeError("THREE.BufferAttribute: array should be a Typed Array.");this.isBufferAttribute=!0,this.name="",this.array=e,this.itemSize=t,this.count=e!==void 0?e.length/t:0,this.normalized=i,this.usage=ih,this.updateRange={offset:0,count:-1},this.gpuType=ls,this.version=0}onUploadCallback(){}set needsUpdate(e){e===!0&&this.version++}setUsage(e){return this.usage=e,this}copy(e){return this.name=e.name,this.array=new e.array.constructor(e.array),this.itemSize=e.itemSize,this.count=e.count,this.normalized=e.normalized,this.usage=e.usage,this.gpuType=e.gpuType,this}copyAt(e,t,i){e*=this.itemSize,i*=t.itemSize;for(let r=0,s=this.itemSize;r<s;r++)this.array[e+r]=t.array[i+r];return this}copyArray(e){return this.array.set(e),this}applyMatrix3(e){if(this.itemSize===2)for(let t=0,i=this.count;t<i;t++)hp.fromBufferAttribute(this,t),hp.applyMatrix3(e),this.setXY(t,hp.x,hp.y);else if(this.itemSize===3)for(let t=0,i=this.count;t<i;t++)En.fromBufferAttribute(this,t),En.applyMatrix3(e),this.setXYZ(t,En.x,En.y,En.z);return this}applyMatrix4(e){for(let t=0,i=this.count;t<i;t++)En.fromBufferAttribute(this,t),En.applyMatrix4(e),this.setXYZ(t,En.x,En.y,En.z);return this}applyNormalMatrix(e){for(let t=0,i=this.count;t<i;t++)En.fromBufferAttribute(this,t),En.applyNormalMatrix(e),this.setXYZ(t,En.x,En.y,En.z);return this}transformDirection(e){for(let t=0,i=this.count;t<i;t++)En.fromBufferAttribute(this,t),En.transformDirection(e),this.setXYZ(t,En.x,En.y,En.z);return this}set(e,t=0){return this.array.set(e,t),this}getX(e){let t=this.array[e*this.itemSize];return this.normalized&&(t=Wi(t,this.array)),t}setX(e,t){return this.normalized&&(t=At(t,this.array)),this.array[e*this.itemSize]=t,this}getY(e){let t=this.array[e*this.itemSize+1];return this.normalized&&(t=Wi(t,this.array)),t}setY(e,t){return this.normalized&&(t=At(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=Wi(t,this.array)),t}setZ(e,t){return this.normalized&&(t=At(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=Wi(t,this.array)),t}setW(e,t){return this.normalized&&(t=At(t,this.array)),this.array[e*this.itemSize+3]=t,this}setXY(e,t,i){return e*=this.itemSize,this.normalized&&(t=At(t,this.array),i=At(i,this.array)),this.array[e+0]=t,this.array[e+1]=i,this}setXYZ(e,t,i,r){return e*=this.itemSize,this.normalized&&(t=At(t,this.array),i=At(i,this.array),r=At(r,this.array)),this.array[e+0]=t,this.array[e+1]=i,this.array[e+2]=r,this}setXYZW(e,t,i,r,s){return e*=this.itemSize,this.normalized&&(t=At(t,this.array),i=At(i,this.array),r=At(r,this.array),s=At(s,this.array)),this.array[e+0]=t,this.array[e+1]=i,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!==ih&&(e.usage=this.usage),(this.updateRange.offset!==0||this.updateRange.count!==-1)&&(e.updateRange=this.updateRange),e}}class gU extends Dt{constructor(e,t,i){super(new Int8Array(e),t,i)}}class vU extends Dt{constructor(e,t,i){super(new Uint8Array(e),t,i)}}class yU extends Dt{constructor(e,t,i){super(new Uint8ClampedArray(e),t,i)}}class xU extends Dt{constructor(e,t,i){super(new Int16Array(e),t,i)}}class _S extends Dt{constructor(e,t,i){super(new Uint16Array(e),t,i)}}class _U extends Dt{constructor(e,t,i){super(new Int32Array(e),t,i)}}class AS extends Dt{constructor(e,t,i){super(new Uint32Array(e),t,i)}}class AU extends Dt{constructor(e,t,i){super(new Uint16Array(e),t,i),this.isFloat16BufferAttribute=!0}getX(e){let t=pf(this.array[e*this.itemSize]);return this.normalized&&(t=Wi(t,this.array)),t}setX(e,t){return this.normalized&&(t=At(t,this.array)),this.array[e*this.itemSize]=Mi(t),this}getY(e){let t=pf(this.array[e*this.itemSize+1]);return this.normalized&&(t=Wi(t,this.array)),t}setY(e,t){return this.normalized&&(t=At(t,this.array)),this.array[e*this.itemSize+1]=Mi(t),this}getZ(e){let t=pf(this.array[e*this.itemSize+2]);return this.normalized&&(t=Wi(t,this.array)),t}setZ(e,t){return this.normalized&&(t=At(t,this.array)),this.array[e*this.itemSize+2]=Mi(t),this}getW(e){let t=pf(this.array[e*this.itemSize+3]);return this.normalized&&(t=Wi(t,this.array)),t}setW(e,t){return this.normalized&&(t=At(t,this.array)),this.array[e*this.itemSize+3]=Mi(t),this}setXY(e,t,i){return e*=this.itemSize,this.normalized&&(t=At(t,this.array),i=At(i,this.array)),this.array[e+0]=Mi(t),this.array[e+1]=Mi(i),this}setXYZ(e,t,i,r){return e*=this.itemSize,this.normalized&&(t=At(t,this.array),i=At(i,this.array),r=At(r,this.array)),this.array[e+0]=Mi(t),this.array[e+1]=Mi(i),this.array[e+2]=Mi(r),this}setXYZW(e,t,i,r,s){return e*=this.itemSize,this.normalized&&(t=At(t,this.array),i=At(i,this.array),r=At(r,this.array),s=At(s,this.array)),this.array[e+0]=Mi(t),this.array[e+1]=Mi(i),this.array[e+2]=Mi(r),this.array[e+3]=Mi(s),this}}class Ye extends Dt{constructor(e,t,i){super(new Float32Array(e),t,i)}}class SU extends Dt{constructor(e,t,i){super(new Float64Array(e),t,i)}}let MU=0;const ar=new rt,ry=new bt,Hl=new F,zi=new Xr,ju=new Xr,Un=new F;class gt extends xs{constructor(){super(),this.isBufferGeometry=!0,Object.defineProperty(this,"id",{value:MU++}),this.uuid=Ji(),this.name="",this.type="BufferGeometry",this.index=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(o2(e)?AS:_S)(e,1):this.index=e,this}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,i=0){this.groups.push({start:e,count:t,materialIndex:i})}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 i=this.attributes.normal;if(i!==void 0){const s=new _t().getNormalMatrix(e);i.applyNormalMatrix(s),i.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 ar.makeRotationFromQuaternion(e),this.applyMatrix4(ar),this}rotateX(e){return ar.makeRotationX(e),this.applyMatrix4(ar),this}rotateY(e){return ar.makeRotationY(e),this.applyMatrix4(ar),this}rotateZ(e){return ar.makeRotationZ(e),this.applyMatrix4(ar),this}translate(e,t,i){return ar.makeTranslation(e,t,i),this.applyMatrix4(ar),this}scale(e,t,i){return ar.makeScale(e,t,i),this.applyMatrix4(ar),this}lookAt(e){return ry.lookAt(e),ry.updateMatrix(),this.applyMatrix4(ry.matrix),this}center(){return this.computeBoundingBox(),this.boundingBox.getCenter(Hl).negate(),this.translate(Hl.x,Hl.y,Hl.z),this}setFromPoints(e){const t=[];for(let i=0,r=e.length;i<r;i++){const s=e[i];t.push(s.x,s.y,s.z||0)}return this.setAttribute("position",new Ye(t,3)),this}computeBoundingBox(){this.boundingBox===null&&(this.boundingBox=new Xr);const e=this.attributes.position,t=this.morphAttributes.position;if(e&&e.isGLBufferAttribute){console.error('THREE.BufferGeometry.computeBoundingBox(): GLBufferAttribute requires a manual bounding box. Alternatively set "mesh.frustumCulled" to "false".',this),this.boundingBox.set(new F(-1/0,-1/0,-1/0),new F(1/0,1/0,1/0));return}if(e!==void 0){if(this.boundingBox.setFromBufferAttribute(e),t)for(let i=0,r=t.length;i<r;i++){const s=t[i];zi.setFromBufferAttribute(s),this.morphTargetsRelative?(Un.addVectors(this.boundingBox.min,zi.min),this.boundingBox.expandByPoint(Un),Un.addVectors(this.boundingBox.max,zi.max),this.boundingBox.expandByPoint(Un)):(this.boundingBox.expandByPoint(zi.min),this.boundingBox.expandByPoint(zi.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 Sr);const e=this.attributes.position,t=this.morphAttributes.position;if(e&&e.isGLBufferAttribute){console.error('THREE.BufferGeometry.computeBoundingSphere(): GLBufferAttribute requires a manual bounding sphere. Alternatively set "mesh.frustumCulled" to "false".',this),this.boundingSphere.set(new F,1/0);return}if(e){const i=this.boundingSphere.center;if(zi.setFromBufferAttribute(e),t)for(let s=0,o=t.length;s<o;s++){const a=t[s];ju.setFromBufferAttribute(a),this.morphTargetsRelative?(Un.addVectors(zi.min,ju.min),zi.expandByPoint(Un),Un.addVectors(zi.max,ju.max),zi.expandByPoint(Un)):(zi.expandByPoint(ju.min),zi.expandByPoint(ju.max))}zi.getCenter(i);let r=0;for(let s=0,o=e.count;s<o;s++)Un.fromBufferAttribute(e,s),r=Math.max(r,i.distanceToSquared(Un));if(t)for(let s=0,o=t.length;s<o;s++){const a=t[s],l=this.morphTargetsRelative;for(let u=0,h=a.count;u<h;u++)Un.fromBufferAttribute(a,u),l&&(Hl.fromBufferAttribute(e,u),Un.add(Hl)),r=Math.max(r,i.distanceToSquared(Un))}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 i=e.array,r=t.position.array,s=t.normal.array,o=t.uv.array,a=r.length/3;this.hasAttribute("tangent")===!1&&this.setAttribute("tangent",new Dt(new Float32Array(4*a),4));const l=this.getAttribute("tangent").array,u=[],h=[];for(let L=0;L<a;L++)u[L]=new F,h[L]=new F;const d=new F,p=new F,m=new F,y=new ge,M=new ge,_=new ge,g=new F,x=new F;function S(L,z,$){d.fromArray(r,L*3),p.fromArray(r,z*3),m.fromArray(r,$*3),y.fromArray(o,L*2),M.fromArray(o,z*2),_.fromArray(o,$*2),p.sub(d),m.sub(d),M.sub(y),_.sub(y);const X=1/(M.x*_.y-_.x*M.y);isFinite(X)&&(g.copy(p).multiplyScalar(_.y).addScaledVector(m,-M.y).multiplyScalar(X),x.copy(m).multiplyScalar(M.x).addScaledVector(p,-_.x).multiplyScalar(X),u[L].add(g),u[z].add(g),u[$].add(g),h[L].add(x),h[z].add(x),h[$].add(x))}let E=this.groups;E.length===0&&(E=[{start:0,count:i.length}]);for(let L=0,z=E.length;L<z;++L){const $=E[L],X=$.start,Q=$.count;for(let Y=X,ne=X+Q;Y<ne;Y+=3)S(i[Y+0],i[Y+1],i[Y+2])}const C=new F,b=new F,P=new F,B=new F;function R(L){P.fromArray(s,L*3),B.copy(P);const z=u[L];C.copy(z),C.sub(P.multiplyScalar(P.dot(z))).normalize(),b.crossVectors(B,z);const X=b.dot(h[L])<0?-1:1;l[L*4]=C.x,l[L*4+1]=C.y,l[L*4+2]=C.z,l[L*4+3]=X}for(let L=0,z=E.length;L<z;++L){const $=E[L],X=$.start,Q=$.count;for(let Y=X,ne=X+Q;Y<ne;Y+=3)R(i[Y+0]),R(i[Y+1]),R(i[Y+2])}}computeVertexNormals(){const e=this.index,t=this.getAttribute("position");if(t!==void 0){let i=this.getAttribute("normal");if(i===void 0)i=new Dt(new Float32Array(t.count*3),3),this.setAttribute("normal",i);else for(let p=0,m=i.count;p<m;p++)i.setXYZ(p,0,0,0);const r=new F,s=new F,o=new F,a=new F,l=new F,u=new F,h=new F,d=new F;if(e)for(let p=0,m=e.count;p<m;p+=3){const y=e.getX(p+0),M=e.getX(p+1),_=e.getX(p+2);r.fromBufferAttribute(t,y),s.fromBufferAttribute(t,M),o.fromBufferAttribute(t,_),h.subVectors(o,s),d.subVectors(r,s),h.cross(d),a.fromBufferAttribute(i,y),l.fromBufferAttribute(i,M),u.fromBufferAttribute(i,_),a.add(h),l.add(h),u.add(h),i.setXYZ(y,a.x,a.y,a.z),i.setXYZ(M,l.x,l.y,l.z),i.setXYZ(_,u.x,u.y,u.z)}else for(let p=0,m=t.count;p<m;p+=3)r.fromBufferAttribute(t,p+0),s.fromBufferAttribute(t,p+1),o.fromBufferAttribute(t,p+2),h.subVectors(o,s),d.subVectors(r,s),h.cross(d),i.setXYZ(p+0,h.x,h.y,h.z),i.setXYZ(p+1,h.x,h.y,h.z),i.setXYZ(p+2,h.x,h.y,h.z);this.normalizeNormals(),i.needsUpdate=!0}}normalizeNormals(){const e=this.attributes.normal;for(let t=0,i=e.count;t<i;t++)Un.fromBufferAttribute(e,t),Un.normalize(),e.setXYZ(t,Un.x,Un.y,Un.z)}toNonIndexed(){function e(a,l){const u=a.array,h=a.itemSize,d=a.normalized,p=new u.constructor(l.length*h);let m=0,y=0;for(let M=0,_=l.length;M<_;M++){a.isInterleavedBufferAttribute?m=l[M]*a.data.stride+a.offset:m=l[M]*h;for(let g=0;g<h;g++)p[y++]=u[m++]}return new Dt(p,h,d)}if(this.index===null)return console.warn("THREE.BufferGeometry.toNonIndexed(): BufferGeometry is already non-indexed."),this;const t=new gt,i=this.index.array,r=this.attributes;for(const a in r){const l=r[a],u=e(l,i);t.setAttribute(a,u)}const s=this.morphAttributes;for(const a in s){const l=[],u=s[a];for(let h=0,d=u.length;h<d;h++){const p=u[h],m=e(p,i);l.push(m)}t.morphAttributes[a]=l}t.morphTargetsRelative=this.morphTargetsRelative;const o=this.groups;for(let a=0,l=o.length;a<l;a++){const u=o[a];t.addGroup(u.start,u.count,u.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 l=this.parameters;for(const u in l)l[u]!==void 0&&(e[u]=l[u]);return e}e.data={attributes:{}};const t=this.index;t!==null&&(e.data.index={type:t.array.constructor.name,array:Array.prototype.slice.call(t.array)});const i=this.attributes;for(const l in i){const u=i[l];e.data.attributes[l]=u.toJSON(e.data)}const r={};let s=!1;for(const l in this.morphAttributes){const u=this.morphAttributes[l],h=[];for(let d=0,p=u.length;d<p;d++){const m=u[d];h.push(m.toJSON(e.data))}h.length>0&&(r[l]=h,s=!0)}s&&(e.data.morphAttributes=r,e.data.morphTargetsRelative=this.morphTargetsRelative);const o=this.groups;o.length>0&&(e.data.groups=JSON.parse(JSON.stringify(o)));const a=this.boundingSphere;return a!==null&&(e.data.boundingSphere={center:a.center.toArray(),radius:a.radius}),e}clone(){return new this.constructor().copy(this)}copy(e){this.index=null,this.attributes={},this.morphAttributes={},this.groups=[],this.boundingBox=null,this.boundingSphere=null;const t={};this.name=e.name;const i=e.index;i!==null&&this.setIndex(i.clone(t));const r=e.attributes;for(const u in r){const h=r[u];this.setAttribute(u,h.clone(t))}const s=e.morphAttributes;for(const u in s){const h=[],d=s[u];for(let p=0,m=d.length;p<m;p++)h.push(d[p].clone(t));this.morphAttributes[u]=h}this.morphTargetsRelative=e.morphTargetsRelative;const o=e.groups;for(let u=0,h=o.length;u<h;u++){const d=o[u];this.addGroup(d.start,d.count,d.materialIndex)}const a=e.boundingBox;a!==null&&(this.boundingBox=a.clone());const l=e.boundingSphere;return l!==null&&(this.boundingSphere=l.clone()),this.drawRange.start=e.drawRange.start,this.drawRange.count=e.drawRange.count,this.userData=e.userData,this}dispose(){this.dispatchEvent({type:"dispose"})}}const Bw=new rt,va=new uu,dp=new Sr,Lw=new F,zl=new F,Gl=new F,Vl=new F,sy=new F,pp=new F,mp=new ge,gp=new ge,vp=new ge,Iw=new F,Dw=new F,Fw=new F,yp=new F,xp=new F;class Hn extends bt{constructor(e=new gt,t=new ji){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=e.material,this.geometry=e.geometry,this}updateMorphTargets(){const t=this.geometry.morphAttributes,i=Object.keys(t);if(i.length>0){const r=t[i[0]];if(r!==void 0){this.morphTargetInfluences=[],this.morphTargetDictionary={};for(let s=0,o=r.length;s<o;s++){const a=r[s].name||String(s);this.morphTargetInfluences.push(0),this.morphTargetDictionary[a]=s}}}}getVertexPosition(e,t){const i=this.geometry,r=i.attributes.position,s=i.morphAttributes.position,o=i.morphTargetsRelative;t.fromBufferAttribute(r,e);const a=this.morphTargetInfluences;if(s&&a){pp.set(0,0,0);for(let l=0,u=s.length;l<u;l++){const h=a[l],d=s[l];h!==0&&(sy.fromBufferAttribute(d,e),o?pp.addScaledVector(sy,h):pp.addScaledVector(sy.sub(t),h))}t.add(pp)}return t}raycast(e,t){const i=this.geometry,r=this.material,s=this.matrixWorld;r!==void 0&&(i.boundingSphere===null&&i.computeBoundingSphere(),dp.copy(i.boundingSphere),dp.applyMatrix4(s),va.copy(e.ray).recast(e.near),!(dp.containsPoint(va.origin)===!1&&(va.intersectSphere(dp,Lw)===null||va.origin.distanceToSquared(Lw)>(e.far-e.near)**2))&&(Bw.copy(s).invert(),va.copy(e.ray).applyMatrix4(Bw),!(i.boundingBox!==null&&va.intersectsBox(i.boundingBox)===!1)&&this._computeIntersections(e,t,va)))}_computeIntersections(e,t,i){let r;const s=this.geometry,o=this.material,a=s.index,l=s.attributes.position,u=s.attributes.uv,h=s.attributes.uv1,d=s.attributes.normal,p=s.groups,m=s.drawRange;if(a!==null)if(Array.isArray(o))for(let y=0,M=p.length;y<M;y++){const _=p[y],g=o[_.materialIndex],x=Math.max(_.start,m.start),S=Math.min(a.count,Math.min(_.start+_.count,m.start+m.count));for(let E=x,C=S;E<C;E+=3){const b=a.getX(E),P=a.getX(E+1),B=a.getX(E+2);r=_p(this,g,e,i,u,h,d,b,P,B),r&&(r.faceIndex=Math.floor(E/3),r.face.materialIndex=_.materialIndex,t.push(r))}}else{const y=Math.max(0,m.start),M=Math.min(a.count,m.start+m.count);for(let _=y,g=M;_<g;_+=3){const x=a.getX(_),S=a.getX(_+1),E=a.getX(_+2);r=_p(this,o,e,i,u,h,d,x,S,E),r&&(r.faceIndex=Math.floor(_/3),t.push(r))}}else if(l!==void 0)if(Array.isArray(o))for(let y=0,M=p.length;y<M;y++){const _=p[y],g=o[_.materialIndex],x=Math.max(_.start,m.start),S=Math.min(l.count,Math.min(_.start+_.count,m.start+m.count));for(let E=x,C=S;E<C;E+=3){const b=E,P=E+1,B=E+2;r=_p(this,g,e,i,u,h,d,b,P,B),r&&(r.faceIndex=Math.floor(E/3),r.face.materialIndex=_.materialIndex,t.push(r))}}else{const y=Math.max(0,m.start),M=Math.min(l.count,m.start+m.count);for(let _=y,g=M;_<g;_+=3){const x=_,S=_+1,E=_+2;r=_p(this,o,e,i,u,h,d,x,S,E),r&&(r.faceIndex=Math.floor(_/3),t.push(r))}}}}function EU(n,e,t,i,r,s,o,a){let l;if(e.side===vi?l=i.intersectTriangle(o,s,r,!0,a):l=i.intersectTriangle(r,s,o,e.side===gs,a),l===null)return null;xp.copy(a),xp.applyMatrix4(n.matrixWorld);const u=t.ray.origin.distanceTo(xp);return u<t.near||u>t.far?null:{distance:u,point:xp.clone(),object:n}}function _p(n,e,t,i,r,s,o,a,l,u){n.getVertexPosition(a,zl),n.getVertexPosition(l,Gl),n.getVertexPosition(u,Vl);const h=EU(n,e,t,i,zl,Gl,Vl,yp);if(h){r&&(mp.fromBufferAttribute(r,a),gp.fromBufferAttribute(r,l),vp.fromBufferAttribute(r,u),h.uv=wi.getInterpolation(yp,zl,Gl,Vl,mp,gp,vp,new ge)),s&&(mp.fromBufferAttribute(s,a),gp.fromBufferAttribute(s,l),vp.fromBufferAttribute(s,u),h.uv1=wi.getInterpolation(yp,zl,Gl,Vl,mp,gp,vp,new ge),h.uv2=h.uv1),o&&(Iw.fromBufferAttribute(o,a),Dw.fromBufferAttribute(o,l),Fw.fromBufferAttribute(o,u),h.normal=wi.getInterpolation(yp,zl,Gl,Vl,Iw,Dw,Fw,new F),h.normal.dot(i.direction)>0&&h.normal.multiplyScalar(-1));const d={a,b:l,c:u,normal:new F,materialIndex:0};wi.getNormal(zl,Gl,Vl,d.normal),h.face=d}return h}class ul extends gt{constructor(e=1,t=1,i=1,r=1,s=1,o=1){super(),this.type="BoxGeometry",this.parameters={width:e,height:t,depth:i,widthSegments:r,heightSegments:s,depthSegments:o};const a=this;r=Math.floor(r),s=Math.floor(s),o=Math.floor(o);const l=[],u=[],h=[],d=[];let p=0,m=0;y("z","y","x",-1,-1,i,t,e,o,s,0),y("z","y","x",1,-1,i,t,-e,o,s,1),y("x","z","y",1,1,e,i,t,r,o,2),y("x","z","y",1,-1,e,i,-t,r,o,3),y("x","y","z",1,-1,e,t,i,r,s,4),y("x","y","z",-1,-1,e,t,-i,r,s,5),this.setIndex(l),this.setAttribute("position",new Ye(u,3)),this.setAttribute("normal",new Ye(h,3)),this.setAttribute("uv",new Ye(d,2));function y(M,_,g,x,S,E,C,b,P,B,R){const L=E/P,z=C/B,$=E/2,X=C/2,Q=b/2,Y=P+1,ne=B+1;let ee=0,I=0;const V=new F;for(let H=0;H<ne;H++){const U=H*z-X;for(let W=0;W<Y;W++){const ve=W*L-$;V[M]=ve*x,V[_]=U*S,V[g]=Q,u.push(V.x,V.y,V.z),V[M]=0,V[_]=0,V[g]=b>0?1:-1,h.push(V.x,V.y,V.z),d.push(W/P),d.push(1-H/B),ee+=1}}for(let H=0;H<B;H++)for(let U=0;U<P;U++){const W=p+U+Y*H,ve=p+U+Y*(H+1),ue=p+(U+1)+Y*(H+1),Ae=p+(U+1)+Y*H;l.push(W,ve,Ae),l.push(ve,ue,Ae),I+=6}a.addGroup(m,I,R),m+=I,p+=ee}}copy(e){return super.copy(e),this.parameters=Object.assign({},e.parameters),this}static fromJSON(e){return new ul(e.width,e.height,e.depth,e.widthSegments,e.heightSegments,e.depthSegments)}}function Zc(n){const e={};for(const t in n){e[t]={};for(const i in n[t]){const r=n[t][i];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][i]=null):e[t][i]=r.clone():Array.isArray(r)?e[t][i]=r.slice():e[t][i]=r}}return e}function hi(n){const e={};for(let t=0;t<n.length;t++){const i=Zc(n[t]);for(const r in i)e[r]=i[r]}return e}function wU(n){const e=[];for(let t=0;t<n.length;t++)e.push(n[t].clone());return e}function l2(n){return n.getRenderTarget()===null?n.outputColorSpace:Vr}const c2={clone:Zc,merge:hi};var TU=`void main() {
	gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );
}`,CU=`void main() {
	gl_FragColor = vec4( 1.0, 0.0, 0.0, 1.0 );
}`;class ys extends Cn{constructor(e){super(),this.isShaderMaterial=!0,this.type="ShaderMaterial",this.defines={},this.uniforms={},this.uniformsGroups=[],this.vertexShader=TU,this.fragmentShader=CU,this.linewidth=1,this.wireframe=!1,this.wireframeLinewidth=1,this.fog=!1,this.lights=!1,this.clipping=!1,this.forceSinglePass=!0,this.extensions={derivatives:!1,fragDepth:!1,drawBuffers:!1,shaderTextureLOD:!1},this.defaultAttributeValues={color:[1,1,1],uv:[0,0],uv1:[0,0]},this.index0AttributeName=void 0,this.uniformsNeedUpdate=!1,this.glslVersion=null,e!==void 0&&this.setValues(e)}copy(e){return super.copy(e),this.fragmentShader=e.fragmentShader,this.vertexShader=e.vertexShader,this.uniforms=Zc(e.uniforms),this.uniformsGroups=wU(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 o=this.uniforms[r].value;o&&o.isTexture?t.uniforms[r]={type:"t",value:o.toJSON(e).uuid}:o&&o.isColor?t.uniforms[r]={type:"c",value:o.getHex()}:o&&o.isVector2?t.uniforms[r]={type:"v2",value:o.toArray()}:o&&o.isVector3?t.uniforms[r]={type:"v3",value:o.toArray()}:o&&o.isVector4?t.uniforms[r]={type:"v4",value:o.toArray()}:o&&o.isMatrix3?t.uniforms[r]={type:"m3",value:o.toArray()}:o&&o.isMatrix4?t.uniforms[r]={type:"m4",value:o.toArray()}:t.uniforms[r]={value:o}}Object.keys(this.defines).length>0&&(t.defines=this.defines),t.vertexShader=this.vertexShader,t.fragmentShader=this.fragmentShader,t.lights=this.lights,t.clipping=this.clipping;const i={};for(const r in this.extensions)this.extensions[r]===!0&&(i[r]=!0);return Object.keys(i).length>0&&(t.extensions=i),t}}class wh extends bt{constructor(){super(),this.isCamera=!0,this.type="Camera",this.matrixWorldInverse=new rt,this.projectionMatrix=new rt,this.projectionMatrixInverse=new rt,this.coordinateSystem=cs}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){this.updateWorldMatrix(!0,!1);const t=this.matrixWorld.elements;return e.set(-t[8],-t[9],-t[10]).normalize()}updateMatrixWorld(e){super.updateMatrixWorld(e),this.matrixWorldInverse.copy(this.matrixWorld).invert()}updateWorldMatrix(e,t){super.updateWorldMatrix(e,t),this.matrixWorldInverse.copy(this.matrixWorld).invert()}clone(){return new this.constructor().copy(this)}}class qt extends wh{constructor(e=50,t=1,i=.1,r=2e3){super(),this.isPerspectiveCamera=!0,this.type="PerspectiveCamera",this.fov=e,this.zoom=1,this.near=i,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=Qc*2*Math.atan(t),this.updateProjectionMatrix()}getFocalLength(){const e=Math.tan(Qa*.5*this.fov);return .5*this.getFilmHeight()/e}getEffectiveFOV(){return Qc*2*Math.atan(Math.tan(Qa*.5*this.fov)/this.zoom)}getFilmWidth(){return this.filmGauge*Math.min(this.aspect,1)}getFilmHeight(){return this.filmGauge/Math.max(this.aspect,1)}setViewOffset(e,t,i,r,s,o){this.aspect=e/t,this.view===null&&(this.view={enabled:!0,fullWidth:1,fullHeight:1,offsetX:0,offsetY:0,width:1,height:1}),this.view.enabled=!0,this.view.fullWidth=e,this.view.fullHeight=t,this.view.offsetX=i,this.view.offsetY=r,this.view.width=s,this.view.height=o,this.updateProjectionMatrix()}clearViewOffset(){this.view!==null&&(this.view.enabled=!1),this.updateProjectionMatrix()}updateProjectionMatrix(){const e=this.near;let t=e*Math.tan(Qa*.5*this.fov)/this.zoom,i=2*t,r=this.aspect*i,s=-.5*r;const o=this.view;if(this.view!==null&&this.view.enabled){const l=o.fullWidth,u=o.fullHeight;s+=o.offsetX*r/l,t-=o.offsetY*i/u,r*=o.width/l,i*=o.height/u}const a=this.filmOffset;a!==0&&(s+=e*a/this.getFilmWidth()),this.projectionMatrix.makePerspective(s,s+r,t,t-i,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 Wl=-90,jl=1;class SS extends bt{constructor(e,t,i){super(),this.type="CubeCamera",this.renderTarget=i,this.coordinateSystem=null;const r=new qt(Wl,jl,e,t);r.layers=this.layers,this.add(r);const s=new qt(Wl,jl,e,t);s.layers=this.layers,this.add(s);const o=new qt(Wl,jl,e,t);o.layers=this.layers,this.add(o);const a=new qt(Wl,jl,e,t);a.layers=this.layers,this.add(a);const l=new qt(Wl,jl,e,t);l.layers=this.layers,this.add(l);const u=new qt(Wl,jl,e,t);u.layers=this.layers,this.add(u)}updateCoordinateSystem(){const e=this.coordinateSystem,t=this.children.concat(),[i,r,s,o,a,l]=t;for(const u of t)this.remove(u);if(e===cs)i.up.set(0,1,0),i.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),o.up.set(0,0,1),o.lookAt(0,-1,0),a.up.set(0,1,0),a.lookAt(0,0,1),l.up.set(0,1,0),l.lookAt(0,0,-1);else if(e===rh)i.up.set(0,-1,0),i.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),o.up.set(0,0,-1),o.lookAt(0,-1,0),a.up.set(0,-1,0),a.lookAt(0,0,1),l.up.set(0,-1,0),l.lookAt(0,0,-1);else throw new Error("THREE.CubeCamera.updateCoordinateSystem(): Invalid coordinate system: "+e);for(const u of t)this.add(u),u.updateMatrixWorld()}update(e,t){this.parent===null&&this.updateMatrixWorld();const i=this.renderTarget;this.coordinateSystem!==e.coordinateSystem&&(this.coordinateSystem=e.coordinateSystem,this.updateCoordinateSystem());const[r,s,o,a,l,u]=this.children,h=e.getRenderTarget(),d=e.toneMapping,p=e.xr.enabled;e.toneMapping=Hr,e.xr.enabled=!1;const m=i.texture.generateMipmaps;i.texture.generateMipmaps=!1,e.setRenderTarget(i,0),e.render(t,r),e.setRenderTarget(i,1),e.render(t,s),e.setRenderTarget(i,2),e.render(t,o),e.setRenderTarget(i,3),e.render(t,a),e.setRenderTarget(i,4),e.render(t,l),i.texture.generateMipmaps=m,e.setRenderTarget(i,5),e.render(t,u),e.setRenderTarget(h),e.toneMapping=d,e.xr.enabled=p,i.texture.needsPMREMUpdate=!0}}class Th extends $t{constructor(e,t,i,r,s,o,a,l,u,h){e=e!==void 0?e:[],t=t!==void 0?t:Xo,super(e,t,i,r,s,o,a,l,u,h),this.isCubeTexture=!0,this.flipY=!1}get images(){return this.image}set images(e){this.image=e}}class MS extends Wr{constructor(e=1,t={}){super(e,e,t),this.isWebGLCubeRenderTarget=!0;const i={width:e,height:e,depth:1},r=[i,i,i,i,i,i];t.encoding!==void 0&&(bf("THREE.WebGLCubeRenderTarget: option.encoding has been replaced by option.colorSpace."),t.colorSpace=t.encoding===ko?mt:Ho),this.texture=new Th(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:rn}fromEquirectangularTexture(e,t){this.texture.type=t.type,this.texture.colorSpace=t.colorSpace,this.texture.generateMipmaps=t.generateMipmaps,this.texture.minFilter=t.minFilter,this.texture.magFilter=t.magFilter;const i={uniforms:{tEquirect:{value:null}},vertexShader:`

				varying vec3 vWorldDirection;

				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 ul(5,5,5),s=new ys({name:"CubemapFromEquirect",uniforms:Zc(i.uniforms),vertexShader:i.vertexShader,fragmentShader:i.fragmentShader,side:vi,blending:Ws});s.uniforms.tEquirect.value=t;const o=new Hn(r,s),a=t.minFilter;return t.minFilter===vs&&(t.minFilter=rn),new SS(1,10,this).update(e,o),t.minFilter=a,o.geometry.dispose(),o.material.dispose(),this}clear(e,t,i,r){const s=e.getRenderTarget();for(let o=0;o<6;o++)e.setRenderTarget(this,o),e.clear(t,i,r);e.setRenderTarget(s)}}const oy=new F,bU=new F,RU=new _t;class So{constructor(e=new F(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,i,r){return this.normal.set(e,t,i),this.constant=r,this}setFromNormalAndCoplanarPoint(e,t){return this.normal.copy(e),this.constant=-t.dot(this.normal),this}setFromCoplanarPoints(e,t,i){const r=oy.subVectors(i,t).cross(bU.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 i=e.delta(oy),r=this.normal.dot(i);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(i,s)}intersectsLine(e){const t=this.distanceToPoint(e.start),i=this.distanceToPoint(e.end);return t<0&&i>0||i<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 i=t||RU.getNormalMatrix(e),r=this.coplanarPoint(oy).applyMatrix4(e),s=this.normal.applyMatrix3(i).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 ya=new Sr,Ap=new F;class Ig{constructor(e=new So,t=new So,i=new So,r=new So,s=new So,o=new So){this.planes=[e,t,i,r,s,o]}set(e,t,i,r,s,o){const a=this.planes;return a[0].copy(e),a[1].copy(t),a[2].copy(i),a[3].copy(r),a[4].copy(s),a[5].copy(o),this}copy(e){const t=this.planes;for(let i=0;i<6;i++)t[i].copy(e.planes[i]);return this}setFromProjectionMatrix(e,t=cs){const i=this.planes,r=e.elements,s=r[0],o=r[1],a=r[2],l=r[3],u=r[4],h=r[5],d=r[6],p=r[7],m=r[8],y=r[9],M=r[10],_=r[11],g=r[12],x=r[13],S=r[14],E=r[15];if(i[0].setComponents(l-s,p-u,_-m,E-g).normalize(),i[1].setComponents(l+s,p+u,_+m,E+g).normalize(),i[2].setComponents(l+o,p+h,_+y,E+x).normalize(),i[3].setComponents(l-o,p-h,_-y,E-x).normalize(),i[4].setComponents(l-a,p-d,_-M,E-S).normalize(),t===cs)i[5].setComponents(l+a,p+d,_+M,E+S).normalize();else if(t===rh)i[5].setComponents(a,d,M,S).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(),ya.copy(e.boundingSphere).applyMatrix4(e.matrixWorld);else{const t=e.geometry;t.boundingSphere===null&&t.computeBoundingSphere(),ya.copy(t.boundingSphere).applyMatrix4(e.matrixWorld)}return this.intersectsSphere(ya)}intersectsSprite(e){return ya.center.set(0,0,0),ya.radius=.7071067811865476,ya.applyMatrix4(e.matrixWorld),this.intersectsSphere(ya)}intersectsSphere(e){const t=this.planes,i=e.center,r=-e.radius;for(let s=0;s<6;s++)if(t[s].distanceToPoint(i)<r)return!1;return!0}intersectsBox(e){const t=this.planes;for(let i=0;i<6;i++){const r=t[i];if(Ap.x=r.normal.x>0?e.max.x:e.min.x,Ap.y=r.normal.y>0?e.max.y:e.min.y,Ap.z=r.normal.z>0?e.max.z:e.min.z,r.distanceToPoint(Ap)<0)return!1}return!0}containsPoint(e){const t=this.planes;for(let i=0;i<6;i++)if(t[i].distanceToPoint(e)<0)return!1;return!0}clone(){return new this.constructor().copy(this)}}function u2(){let n=null,e=!1,t=null,i=null;function r(s,o){t(s,o),i=n.requestAnimationFrame(r)}return{start:function(){e!==!0&&t!==null&&(i=n.requestAnimationFrame(r),e=!0)},stop:function(){n.cancelAnimationFrame(i),e=!1},setAnimationLoop:function(s){t=s},setContext:function(s){n=s}}}function PU(n,e){const t=e.isWebGL2,i=new WeakMap;function r(u,h){const d=u.array,p=u.usage,m=n.createBuffer();n.bindBuffer(h,m),n.bufferData(h,d,p),u.onUploadCallback();let y;if(d instanceof Float32Array)y=n.FLOAT;else if(d instanceof Uint16Array)if(u.isFloat16BufferAttribute)if(t)y=n.HALF_FLOAT;else throw new Error("THREE.WebGLAttributes: Usage of Float16BufferAttribute requires WebGL2.");else y=n.UNSIGNED_SHORT;else if(d instanceof Int16Array)y=n.SHORT;else if(d instanceof Uint32Array)y=n.UNSIGNED_INT;else if(d instanceof Int32Array)y=n.INT;else if(d instanceof Int8Array)y=n.BYTE;else if(d instanceof Uint8Array)y=n.UNSIGNED_BYTE;else if(d instanceof Uint8ClampedArray)y=n.UNSIGNED_BYTE;else throw new Error("THREE.WebGLAttributes: Unsupported buffer data format: "+d);return{buffer:m,type:y,bytesPerElement:d.BYTES_PER_ELEMENT,version:u.version}}function s(u,h,d){const p=h.array,m=h.updateRange;n.bindBuffer(d,u),m.count===-1?n.bufferSubData(d,0,p):(t?n.bufferSubData(d,m.offset*p.BYTES_PER_ELEMENT,p,m.offset,m.count):n.bufferSubData(d,m.offset*p.BYTES_PER_ELEMENT,p.subarray(m.offset,m.offset+m.count)),m.count=-1),h.onUploadCallback()}function o(u){return u.isInterleavedBufferAttribute&&(u=u.data),i.get(u)}function a(u){u.isInterleavedBufferAttribute&&(u=u.data);const h=i.get(u);h&&(n.deleteBuffer(h.buffer),i.delete(u))}function l(u,h){if(u.isGLBufferAttribute){const p=i.get(u);(!p||p.version<u.version)&&i.set(u,{buffer:u.buffer,type:u.type,bytesPerElement:u.elementSize,version:u.version});return}u.isInterleavedBufferAttribute&&(u=u.data);const d=i.get(u);d===void 0?i.set(u,r(u,h)):d.version<u.version&&(s(d.buffer,u,h),d.version=u.version)}return{get:o,remove:a,update:l}}class Ch extends gt{constructor(e=1,t=1,i=1,r=1){super(),this.type="PlaneGeometry",this.parameters={width:e,height:t,widthSegments:i,heightSegments:r};const s=e/2,o=t/2,a=Math.floor(i),l=Math.floor(r),u=a+1,h=l+1,d=e/a,p=t/l,m=[],y=[],M=[],_=[];for(let g=0;g<h;g++){const x=g*p-o;for(let S=0;S<u;S++){const E=S*d-s;y.push(E,-x,0),M.push(0,0,1),_.push(S/a),_.push(1-g/l)}}for(let g=0;g<l;g++)for(let x=0;x<a;x++){const S=x+u*g,E=x+u*(g+1),C=x+1+u*(g+1),b=x+1+u*g;m.push(S,E,b),m.push(E,C,b)}this.setIndex(m),this.setAttribute("position",new Ye(y,3)),this.setAttribute("normal",new Ye(M,3)),this.setAttribute("uv",new Ye(_,2))}copy(e){return super.copy(e),this.parameters=Object.assign({},e.parameters),this}static fromJSON(e){return new Ch(e.width,e.height,e.widthSegments,e.heightSegments)}}var BU=`#ifdef USE_ALPHAHASH
	if ( diffuseColor.a < getAlphaHashThreshold( vPosition ) ) discard;
#endif`,LU=`#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`,IU=`#ifdef USE_ALPHAMAP
	diffuseColor.a *= texture2D( alphaMap, vAlphaMapUv ).g;
#endif`,DU=`#ifdef USE_ALPHAMAP
	uniform sampler2D alphaMap;
#endif`,FU=`#ifdef USE_ALPHATEST
	if ( diffuseColor.a < alphaTest ) discard;
#endif`,NU=`#ifdef USE_ALPHATEST
	uniform float alphaTest;
#endif`,OU=`#ifdef USE_AOMAP
	float ambientOcclusion = ( texture2D( aoMap, vAoMapUv ).r - 1.0 ) * aoMapIntensity + 1.0;
	reflectedLight.indirectDiffuse *= ambientOcclusion;
	#if defined( USE_ENVMAP ) && defined( STANDARD )
		float dotNV = saturate( dot( geometry.normal, geometry.viewDir ) );
		reflectedLight.indirectSpecular *= computeSpecularOcclusion( dotNV, ambientOcclusion, material.roughness );
	#endif
#endif`,UU=`#ifdef USE_AOMAP
	uniform sampler2D aoMap;
	uniform float aoMapIntensity;
#endif`,kU=`vec3 transformed = vec3( position );
#ifdef USE_ALPHAHASH
	vPosition = vec3( position );
#endif`,HU=`vec3 objectNormal = vec3( normal );
#ifdef USE_TANGENT
	vec3 objectTangent = vec3( tangent.xyz );
#endif`,zU=`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`,GU=`#ifdef USE_IRIDESCENCE
	const mat3 XYZ_TO_REC709 = mat3(
		 3.2404542, -0.9692660,  0.0556434,
		-1.5371385,  1.8760108, -0.2040259,
		-0.4985314,  0.0415560,  1.0572252
	);
	vec3 Fresnel0ToIor( vec3 fresnel0 ) {
		vec3 sqrtF0 = sqrt( fresnel0 );
		return ( vec3( 1.0 ) + sqrtF0 ) / ( vec3( 1.0 ) - sqrtF0 );
	}
	vec3 IorToFresnel0( vec3 transmittedIor, float incidentIor ) {
		return pow2( ( transmittedIor - vec3( incidentIor ) ) / ( transmittedIor + vec3( incidentIor ) ) );
	}
	float IorToFresnel0( float transmittedIor, float incidentIor ) {
		return pow2( ( transmittedIor - incidentIor ) / ( transmittedIor + incidentIor ));
	}
	vec3 evalSensitivity( float OPD, vec3 shift ) {
		float phase = 2.0 * PI * OPD * 1.0e-9;
		vec3 val = vec3( 5.4856e-13, 4.4201e-13, 5.2481e-13 );
		vec3 pos = vec3( 1.6810e+06, 1.7953e+06, 2.2084e+06 );
		vec3 var = vec3( 4.3278e+09, 9.3046e+09, 6.6121e+09 );
		vec3 xyz = val * sqrt( 2.0 * PI * var ) * cos( pos * phase + shift ) * exp( - pow2( phase ) * var );
		xyz.x += 9.7470e-14 * sqrt( 2.0 * PI * 4.5282e+09 ) * cos( 2.2399e+06 * phase + shift[ 0 ] ) * exp( - 4.5282e+09 * pow2( phase ) );
		xyz /= 1.0685e-7;
		vec3 rgb = XYZ_TO_REC709 * xyz;
		return rgb;
	}
	vec3 evalIridescence( float outsideIOR, float eta2, float cosTheta1, float thinFilmThickness, vec3 baseF0 ) {
		vec3 I;
		float iridescenceIOR = mix( outsideIOR, eta2, smoothstep( 0.0, 0.03, thinFilmThickness ) );
		float sinTheta2Sq = pow2( outsideIOR / iridescenceIOR ) * ( 1.0 - pow2( cosTheta1 ) );
		float cosTheta2Sq = 1.0 - sinTheta2Sq;
		if ( cosTheta2Sq < 0.0 ) {
			 return vec3( 1.0 );
		}
		float cosTheta2 = sqrt( cosTheta2Sq );
		float R0 = IorToFresnel0( iridescenceIOR, outsideIOR );
		float R12 = F_Schlick( R0, 1.0, cosTheta1 );
		float R21 = R12;
		float T121 = 1.0 - R12;
		float phi12 = 0.0;
		if ( iridescenceIOR < outsideIOR ) phi12 = PI;
		float phi21 = PI - phi12;
		vec3 baseIOR = Fresnel0ToIor( clamp( baseF0, 0.0, 0.9999 ) );		vec3 R1 = IorToFresnel0( baseIOR, iridescenceIOR );
		vec3 R23 = F_Schlick( R1, 1.0, cosTheta2 );
		vec3 phi23 = vec3( 0.0 );
		if ( baseIOR[ 0 ] < iridescenceIOR ) phi23[ 0 ] = PI;
		if ( baseIOR[ 1 ] < iridescenceIOR ) phi23[ 1 ] = PI;
		if ( baseIOR[ 2 ] < iridescenceIOR ) phi23[ 2 ] = PI;
		float OPD = 2.0 * iridescenceIOR * thinFilmThickness * cosTheta2;
		vec3 phi = vec3( phi21 ) + phi23;
		vec3 R123 = clamp( R12 * R23, 1e-5, 0.9999 );
		vec3 r123 = sqrt( R123 );
		vec3 Rs = pow2( T121 ) * R23 / ( vec3( 1.0 ) - R123 );
		vec3 C0 = R12 + Rs;
		I = C0;
		vec3 Cm = Rs - T121;
		for ( int m = 1; m <= 2; ++ m ) {
			Cm *= r123;
			vec3 Sm = 2.0 * evalSensitivity( float( m ) * OPD, float( m ) * phi );
			I += Cm * Sm;
		}
		return max( I, vec3( 0.0 ) );
	}
#endif`,VU=`#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 = dFdx( surf_pos.xyz );
		vec3 vSigmaY = dFdy( surf_pos.xyz );
		vec3 vN = surf_norm;
		vec3 R1 = cross( vSigmaY, vN );
		vec3 R2 = cross( vN, vSigmaX );
		float fDet = dot( vSigmaX, R1 ) * faceDirection;
		vec3 vGrad = sign( fDet ) * ( dHdxy.x * R1 + dHdxy.y * R2 );
		return normalize( abs( fDet ) * surf_norm - vGrad );
	}
#endif`,WU=`#if NUM_CLIPPING_PLANES > 0
	vec4 plane;
	#pragma unroll_loop_start
	for ( int i = 0; i < UNION_CLIPPING_PLANES; i ++ ) {
		plane = clippingPlanes[ i ];
		if ( dot( vClipPosition, plane.xyz ) > plane.w ) discard;
	}
	#pragma unroll_loop_end
	#if UNION_CLIPPING_PLANES < NUM_CLIPPING_PLANES
		bool clipped = true;
		#pragma unroll_loop_start
		for ( int i = UNION_CLIPPING_PLANES; i < NUM_CLIPPING_PLANES; i ++ ) {
			plane = clippingPlanes[ i ];
			clipped = ( dot( vClipPosition, plane.xyz ) > plane.w ) && clipped;
		}
		#pragma unroll_loop_end
		if ( clipped ) discard;
	#endif
#endif`,jU=`#if NUM_CLIPPING_PLANES > 0
	varying vec3 vClipPosition;
	uniform vec4 clippingPlanes[ NUM_CLIPPING_PLANES ];
#endif`,XU=`#if NUM_CLIPPING_PLANES > 0
	varying vec3 vClipPosition;
#endif`,JU=`#if NUM_CLIPPING_PLANES > 0
	vClipPosition = - mvPosition.xyz;
#endif`,KU=`#if defined( USE_COLOR_ALPHA )
	diffuseColor *= vColor;
#elif defined( USE_COLOR )
	diffuseColor.rgb *= vColor;
#endif`,YU=`#if defined( USE_COLOR_ALPHA )
	varying vec4 vColor;
#elif defined( USE_COLOR )
	varying vec3 vColor;
#endif`,QU=`#if defined( USE_COLOR_ALPHA )
	varying vec4 vColor;
#elif defined( USE_COLOR ) || defined( USE_INSTANCING_COLOR )
	varying vec3 vColor;
#endif`,ZU=`#if defined( USE_COLOR_ALPHA )
	vColor = vec4( 1.0 );
#elif defined( USE_COLOR ) || defined( USE_INSTANCING_COLOR )
	vColor = vec3( 1.0 );
#endif
#ifdef USE_COLOR
	vColor *= color;
#endif
#ifdef USE_INSTANCING_COLOR
	vColor.xyz *= instanceColor.xyz;
#endif`,qU=`#define PI 3.141592653589793
#define PI2 6.283185307179586
#define PI_HALF 1.5707963267948966
#define RECIPROCAL_PI 0.3183098861837907
#define RECIPROCAL_PI2 0.15915494309189535
#define EPSILON 1e-6
#ifndef saturate
#define saturate( a ) clamp( a, 0.0, 1.0 )
#endif
#define whiteComplement( a ) ( 1.0 - saturate( a ) )
float pow2( const in float x ) { return x*x; }
vec3 pow2( const in vec3 x ) { return x*x; }
float pow3( const in float x ) { return x*x*x; }
float pow4( const in float x ) { float x2 = x*x; return x2*x2; }
float max3( const in vec3 v ) { return max( max( v.x, v.y ), v.z ); }
float average( const in vec3 v ) { return dot( v, vec3( 0.3333333 ) ); }
highp float rand( const in vec2 uv ) {
	const highp float a = 12.9898, b = 78.233, c = 43758.5453;
	highp float dt = dot( uv.xy, vec2( a,b ) ), sn = mod( dt, PI );
	return fract( sin( sn ) * c );
}
#ifdef HIGH_PRECISION
	float precisionSafeLength( vec3 v ) { return length( v ); }
#else
	float precisionSafeLength( vec3 v ) {
		float maxComponent = max3( abs( v ) );
		return length( v / maxComponent ) * maxComponent;
	}
#endif
struct IncidentLight {
	vec3 color;
	vec3 direction;
	bool visible;
};
struct ReflectedLight {
	vec3 directDiffuse;
	vec3 directSpecular;
	vec3 indirectDiffuse;
	vec3 indirectSpecular;
};
struct GeometricContext {
	vec3 position;
	vec3 normal;
	vec3 viewDir;
#ifdef USE_CLEARCOAT
	vec3 clearcoatNormal;
#endif
};
#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;
}
float luminance( const in vec3 rgb ) {
	const vec3 weights = vec3( 0.2126729, 0.7151522, 0.0721750 );
	return dot( weights, rgb );
}
bool isPerspectiveMatrix( mat4 m ) {
	return m[ 2 ][ 3 ] == - 1.0;
}
vec2 equirectUv( in vec3 dir ) {
	float u = atan( dir.z, dir.x ) * RECIPROCAL_PI2 + 0.5;
	float v = asin( clamp( dir.y, - 1.0, 1.0 ) ) * RECIPROCAL_PI + 0.5;
	return vec2( u, v );
}
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`,$U=`#ifdef ENVMAP_TYPE_CUBE_UV
	#define cubeUV_minMipLevel 4.0
	#define cubeUV_minTileSize 16.0
	float getFace( vec3 direction ) {
		vec3 absDirection = abs( direction );
		float face = - 1.0;
		if ( absDirection.x > absDirection.z ) {
			if ( absDirection.x > absDirection.y )
				face = direction.x > 0.0 ? 0.0 : 3.0;
			else
				face = direction.y > 0.0 ? 1.0 : 4.0;
		} else {
			if ( absDirection.z > absDirection.y )
				face = direction.z > 0.0 ? 2.0 : 5.0;
			else
				face = direction.y > 0.0 ? 1.0 : 4.0;
		}
		return face;
	}
	vec2 getUV( vec3 direction, float face ) {
		vec2 uv;
		if ( face == 0.0 ) {
			uv = vec2( direction.z, direction.y ) / abs( direction.x );
		} else if ( face == 1.0 ) {
			uv = vec2( - direction.x, - direction.z ) / abs( direction.y );
		} else if ( face == 2.0 ) {
			uv = vec2( - direction.x, direction.y ) / abs( direction.z );
		} else if ( face == 3.0 ) {
			uv = vec2( - direction.z, direction.y ) / abs( direction.x );
		} else if ( face == 4.0 ) {
			uv = vec2( - direction.x, direction.z ) / abs( direction.y );
		} else {
			uv = vec2( direction.x, direction.y ) / abs( direction.z );
		}
		return 0.5 * ( uv + 1.0 );
	}
	vec3 bilinearCubeUV( sampler2D envMap, vec3 direction, float mipInt ) {
		float face = getFace( direction );
		float filterInt = max( cubeUV_minMipLevel - mipInt, 0.0 );
		mipInt = max( mipInt, cubeUV_minMipLevel );
		float faceSize = exp2( mipInt );
		highp vec2 uv = getUV( direction, face ) * ( faceSize - 2.0 ) + 1.0;
		if ( face > 2.0 ) {
			uv.y += faceSize;
			face -= 3.0;
		}
		uv.x += face * faceSize;
		uv.x += filterInt * 3.0 * cubeUV_minTileSize;
		uv.y += 4.0 * ( exp2( CUBEUV_MAX_MIP ) - faceSize );
		uv.x *= CUBEUV_TEXEL_WIDTH;
		uv.y *= CUBEUV_TEXEL_HEIGHT;
		#ifdef texture2DGradEXT
			return texture2DGradEXT( envMap, uv, vec2( 0.0 ), vec2( 0.0 ) ).rgb;
		#else
			return texture2D( envMap, uv ).rgb;
		#endif
	}
	#define cubeUV_r0 1.0
	#define cubeUV_v0 0.339
	#define cubeUV_m0 - 2.0
	#define cubeUV_r1 0.8
	#define cubeUV_v1 0.276
	#define cubeUV_m1 - 1.0
	#define cubeUV_r4 0.4
	#define cubeUV_v4 0.046
	#define cubeUV_m4 2.0
	#define cubeUV_r5 0.305
	#define cubeUV_v5 0.016
	#define cubeUV_m5 3.0
	#define cubeUV_r6 0.21
	#define cubeUV_v6 0.0038
	#define cubeUV_m6 4.0
	float roughnessToMip( float roughness ) {
		float mip = 0.0;
		if ( roughness >= cubeUV_r1 ) {
			mip = ( cubeUV_r0 - roughness ) * ( cubeUV_m1 - cubeUV_m0 ) / ( cubeUV_r0 - cubeUV_r1 ) + cubeUV_m0;
		} else if ( roughness >= cubeUV_r4 ) {
			mip = ( cubeUV_r1 - roughness ) * ( cubeUV_m4 - cubeUV_m1 ) / ( cubeUV_r1 - cubeUV_r4 ) + cubeUV_m1;
		} else if ( roughness >= cubeUV_r5 ) {
			mip = ( cubeUV_r4 - roughness ) * ( cubeUV_m5 - cubeUV_m4 ) / ( cubeUV_r4 - cubeUV_r5 ) + cubeUV_m4;
		} else if ( roughness >= cubeUV_r6 ) {
			mip = ( cubeUV_r5 - roughness ) * ( cubeUV_m6 - cubeUV_m5 ) / ( cubeUV_r5 - cubeUV_r6 ) + cubeUV_m5;
		} else {
			mip = - 2.0 * log2( 1.16 * roughness );		}
		return mip;
	}
	vec4 textureCubeUV( sampler2D envMap, vec3 sampleDir, float roughness ) {
		float mip = clamp( roughnessToMip( roughness ), cubeUV_m0, CUBEUV_MAX_MIP );
		float mipF = fract( mip );
		float mipInt = floor( mip );
		vec3 color0 = bilinearCubeUV( envMap, sampleDir, mipInt );
		if ( mipF == 0.0 ) {
			return vec4( color0, 1.0 );
		} else {
			vec3 color1 = bilinearCubeUV( envMap, sampleDir, mipInt + 1.0 );
			return vec4( mix( color0, color1, mipF ), 1.0 );
		}
	}
#endif`,ek=`vec3 transformedNormal = objectNormal;
#ifdef USE_INSTANCING
	mat3 m = mat3( instanceMatrix );
	transformedNormal /= vec3( dot( m[ 0 ], m[ 0 ] ), dot( m[ 1 ], m[ 1 ] ), dot( m[ 2 ], m[ 2 ] ) );
	transformedNormal = m * transformedNormal;
#endif
transformedNormal = normalMatrix * transformedNormal;
#ifdef FLIP_SIDED
	transformedNormal = - transformedNormal;
#endif
#ifdef USE_TANGENT
	vec3 transformedTangent = ( modelViewMatrix * vec4( objectTangent, 0.0 ) ).xyz;
	#ifdef FLIP_SIDED
		transformedTangent = - transformedTangent;
	#endif
#endif`,tk=`#ifdef USE_DISPLACEMENTMAP
	uniform sampler2D displacementMap;
	uniform float displacementScale;
	uniform float displacementBias;
#endif`,nk=`#ifdef USE_DISPLACEMENTMAP
	transformed += normalize( objectNormal ) * ( texture2D( displacementMap, vDisplacementMapUv ).x * displacementScale + displacementBias );
#endif`,ik=`#ifdef USE_EMISSIVEMAP
	vec4 emissiveColor = texture2D( emissiveMap, vEmissiveMapUv );
	totalEmissiveRadiance *= emissiveColor.rgb;
#endif`,rk=`#ifdef USE_EMISSIVEMAP
	uniform sampler2D emissiveMap;
#endif`,sk="gl_FragColor = linearToOutputTexel( gl_FragColor );",ok=`vec4 LinearToLinear( in vec4 value ) {
	return value;
}
vec4 LinearTosRGB( in vec4 value ) {
	return vec4( mix( pow( value.rgb, vec3( 0.41666 ) ) * 1.055 - vec3( 0.055 ), value.rgb * 12.92, vec3( lessThanEqual( value.rgb, vec3( 0.0031308 ) ) ) ), value.a );
}`,ak=`#ifdef USE_ENVMAP
	#ifdef ENV_WORLDPOS
		vec3 cameraToFrag;
		if ( isOrthographic ) {
			cameraToFrag = normalize( vec3( - viewMatrix[ 0 ][ 2 ], - viewMatrix[ 1 ][ 2 ], - viewMatrix[ 2 ][ 2 ] ) );
		} else {
			cameraToFrag = normalize( vWorldPosition - cameraPosition );
		}
		vec3 worldNormal = inverseTransformDirection( normal, viewMatrix );
		#ifdef ENVMAP_MODE_REFLECTION
			vec3 reflectVec = reflect( cameraToFrag, worldNormal );
		#else
			vec3 reflectVec = refract( cameraToFrag, worldNormal, refractionRatio );
		#endif
	#else
		vec3 reflectVec = vReflect;
	#endif
	#ifdef ENVMAP_TYPE_CUBE
		vec4 envColor = textureCube( envMap, vec3( flipEnvMap * reflectVec.x, reflectVec.yz ) );
	#else
		vec4 envColor = vec4( 0.0 );
	#endif
	#ifdef ENVMAP_BLENDING_MULTIPLY
		outgoingLight = mix( outgoingLight, outgoingLight * envColor.xyz, specularStrength * reflectivity );
	#elif defined( ENVMAP_BLENDING_MIX )
		outgoingLight = mix( outgoingLight, envColor.xyz, specularStrength * reflectivity );
	#elif defined( ENVMAP_BLENDING_ADD )
		outgoingLight += envColor.xyz * specularStrength * reflectivity;
	#endif
#endif`,lk=`#ifdef USE_ENVMAP
	uniform float envMapIntensity;
	uniform float flipEnvMap;
	#ifdef ENVMAP_TYPE_CUBE
		uniform samplerCube envMap;
	#else
		uniform sampler2D envMap;
	#endif
	
#endif`,ck=`#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`,uk=`#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`,fk=`#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`,hk=`#ifdef USE_FOG
	vFogDepth = - mvPosition.z;
#endif`,dk=`#ifdef USE_FOG
	varying float vFogDepth;
#endif`,pk=`#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`,mk=`#ifdef USE_FOG
	uniform vec3 fogColor;
	varying float vFogDepth;
	#ifdef FOG_EXP2
		uniform float fogDensity;
	#else
		uniform float fogNear;
		uniform float fogFar;
	#endif
#endif`,gk=`#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
}`,vk=`#ifdef USE_LIGHTMAP
	vec4 lightMapTexel = texture2D( lightMap, vLightMapUv );
	vec3 lightMapIrradiance = lightMapTexel.rgb * lightMapIntensity;
	reflectedLight.indirectDiffuse += lightMapIrradiance;
#endif`,yk=`#ifdef USE_LIGHTMAP
	uniform sampler2D lightMap;
	uniform float lightMapIntensity;
#endif`,xk=`LambertMaterial material;
material.diffuseColor = diffuseColor.rgb;
material.specularStrength = specularStrength;`,_k=`varying vec3 vViewPosition;
struct LambertMaterial {
	vec3 diffuseColor;
	float specularStrength;
};
void RE_Direct_Lambert( const in IncidentLight directLight, const in GeometricContext geometry, const in LambertMaterial material, inout ReflectedLight reflectedLight ) {
	float dotNL = saturate( dot( geometry.normal, directLight.direction ) );
	vec3 irradiance = dotNL * directLight.color;
	reflectedLight.directDiffuse += irradiance * BRDF_Lambert( material.diffuseColor );
}
void RE_IndirectDiffuse_Lambert( const in vec3 irradiance, const in GeometricContext geometry, const in LambertMaterial material, inout ReflectedLight reflectedLight ) {
	reflectedLight.indirectDiffuse += irradiance * BRDF_Lambert( material.diffuseColor );
}
#define RE_Direct				RE_Direct_Lambert
#define RE_IndirectDiffuse		RE_IndirectDiffuse_Lambert`,Ak=`uniform bool receiveShadow;
uniform vec3 ambientLightColor;
uniform vec3 lightProbe[ 9 ];
vec3 shGetIrradianceAt( in vec3 normal, in vec3 shCoefficients[ 9 ] ) {
	float x = normal.x, y = normal.y, z = normal.z;
	vec3 result = shCoefficients[ 0 ] * 0.886227;
	result += shCoefficients[ 1 ] * 2.0 * 0.511664 * y;
	result += shCoefficients[ 2 ] * 2.0 * 0.511664 * z;
	result += shCoefficients[ 3 ] * 2.0 * 0.511664 * x;
	result += shCoefficients[ 4 ] * 2.0 * 0.429043 * x * y;
	result += shCoefficients[ 5 ] * 2.0 * 0.429043 * y * z;
	result += shCoefficients[ 6 ] * ( 0.743125 * z * z - 0.247708 );
	result += shCoefficients[ 7 ] * 2.0 * 0.429043 * x * z;
	result += shCoefficients[ 8 ] * 0.429043 * ( x * x - y * y );
	return result;
}
vec3 getLightProbeIrradiance( const in vec3 lightProbe[ 9 ], const in vec3 normal ) {
	vec3 worldNormal = inverseTransformDirection( normal, viewMatrix );
	vec3 irradiance = shGetIrradianceAt( worldNormal, lightProbe );
	return irradiance;
}
vec3 getAmbientLightIrradiance( const in vec3 ambientLightColor ) {
	vec3 irradiance = ambientLightColor;
	return irradiance;
}
float getDistanceAttenuation( const in float lightDistance, const in float cutoffDistance, const in float decayExponent ) {
	#if defined ( LEGACY_LIGHTS )
		if ( cutoffDistance > 0.0 && decayExponent > 0.0 ) {
			return pow( saturate( - lightDistance / cutoffDistance + 1.0 ), decayExponent );
		}
		return 1.0;
	#else
		float distanceFalloff = 1.0 / max( pow( lightDistance, decayExponent ), 0.01 );
		if ( cutoffDistance > 0.0 ) {
			distanceFalloff *= pow2( saturate( 1.0 - pow4( lightDistance / cutoffDistance ) ) );
		}
		return distanceFalloff;
	#endif
}
float getSpotAttenuation( const in float coneCosine, const in float penumbraCosine, const in float angleCosine ) {
	return smoothstep( coneCosine, penumbraCosine, angleCosine );
}
#if NUM_DIR_LIGHTS > 0
	struct DirectionalLight {
		vec3 direction;
		vec3 color;
	};
	uniform DirectionalLight directionalLights[ NUM_DIR_LIGHTS ];
	void getDirectionalLightInfo( const in DirectionalLight directionalLight, const in GeometricContext geometry, out IncidentLight light ) {
		light.color = directionalLight.color;
		light.direction = directionalLight.direction;
		light.visible = true;
	}
#endif
#if NUM_POINT_LIGHTS > 0
	struct PointLight {
		vec3 position;
		vec3 color;
		float distance;
		float decay;
	};
	uniform PointLight pointLights[ NUM_POINT_LIGHTS ];
	void getPointLightInfo( const in PointLight pointLight, const in GeometricContext geometry, out IncidentLight light ) {
		vec3 lVector = pointLight.position - geometry.position;
		light.direction = normalize( lVector );
		float lightDistance = length( lVector );
		light.color = pointLight.color;
		light.color *= getDistanceAttenuation( lightDistance, pointLight.distance, pointLight.decay );
		light.visible = ( light.color != vec3( 0.0 ) );
	}
#endif
#if NUM_SPOT_LIGHTS > 0
	struct SpotLight {
		vec3 position;
		vec3 direction;
		vec3 color;
		float distance;
		float decay;
		float coneCos;
		float penumbraCos;
	};
	uniform SpotLight spotLights[ NUM_SPOT_LIGHTS ];
	void getSpotLightInfo( const in SpotLight spotLight, const in GeometricContext geometry, out IncidentLight light ) {
		vec3 lVector = spotLight.position - geometry.position;
		light.direction = normalize( lVector );
		float angleCos = dot( light.direction, spotLight.direction );
		float spotAttenuation = getSpotAttenuation( spotLight.coneCos, spotLight.penumbraCos, angleCos );
		if ( spotAttenuation > 0.0 ) {
			float lightDistance = length( lVector );
			light.color = spotLight.color * spotAttenuation;
			light.color *= getDistanceAttenuation( lightDistance, spotLight.distance, spotLight.decay );
			light.visible = ( light.color != vec3( 0.0 ) );
		} else {
			light.color = vec3( 0.0 );
			light.visible = false;
		}
	}
#endif
#if NUM_RECT_AREA_LIGHTS > 0
	struct RectAreaLight {
		vec3 color;
		vec3 position;
		vec3 halfWidth;
		vec3 halfHeight;
	};
	uniform sampler2D ltc_1;	uniform sampler2D ltc_2;
	uniform RectAreaLight rectAreaLights[ NUM_RECT_AREA_LIGHTS ];
#endif
#if NUM_HEMI_LIGHTS > 0
	struct HemisphereLight {
		vec3 direction;
		vec3 skyColor;
		vec3 groundColor;
	};
	uniform HemisphereLight hemisphereLights[ NUM_HEMI_LIGHTS ];
	vec3 getHemisphereLightIrradiance( const in HemisphereLight hemiLight, const in vec3 normal ) {
		float dotNL = dot( normal, hemiLight.direction );
		float hemiDiffuseWeight = 0.5 * dotNL + 0.5;
		vec3 irradiance = mix( hemiLight.groundColor, hemiLight.skyColor, hemiDiffuseWeight );
		return irradiance;
	}
#endif`,Sk=`#ifdef USE_ENVMAP
	vec3 getIBLIrradiance( const in vec3 normal ) {
		#ifdef ENVMAP_TYPE_CUBE_UV
			vec3 worldNormal = inverseTransformDirection( normal, viewMatrix );
			vec4 envMapColor = textureCubeUV( envMap, worldNormal, 1.0 );
			return PI * envMapColor.rgb * envMapIntensity;
		#else
			return vec3( 0.0 );
		#endif
	}
	vec3 getIBLRadiance( const in vec3 viewDir, const in vec3 normal, const in float roughness ) {
		#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, 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`,Mk=`ToonMaterial material;
material.diffuseColor = diffuseColor.rgb;`,Ek=`varying vec3 vViewPosition;
struct ToonMaterial {
	vec3 diffuseColor;
};
void RE_Direct_Toon( const in IncidentLight directLight, const in GeometricContext geometry, const in ToonMaterial material, inout ReflectedLight reflectedLight ) {
	vec3 irradiance = getGradientIrradiance( geometry.normal, directLight.direction ) * directLight.color;
	reflectedLight.directDiffuse += irradiance * BRDF_Lambert( material.diffuseColor );
}
void RE_IndirectDiffuse_Toon( const in vec3 irradiance, const in GeometricContext geometry, const in ToonMaterial material, inout ReflectedLight reflectedLight ) {
	reflectedLight.indirectDiffuse += irradiance * BRDF_Lambert( material.diffuseColor );
}
#define RE_Direct				RE_Direct_Toon
#define RE_IndirectDiffuse		RE_IndirectDiffuse_Toon`,wk=`BlinnPhongMaterial material;
material.diffuseColor = diffuseColor.rgb;
material.specularColor = specular;
material.specularShininess = shininess;
material.specularStrength = specularStrength;`,Tk=`varying vec3 vViewPosition;
struct BlinnPhongMaterial {
	vec3 diffuseColor;
	vec3 specularColor;
	float specularShininess;
	float specularStrength;
};
void RE_Direct_BlinnPhong( const in IncidentLight directLight, const in GeometricContext geometry, const in BlinnPhongMaterial material, inout ReflectedLight reflectedLight ) {
	float dotNL = saturate( dot( geometry.normal, directLight.direction ) );
	vec3 irradiance = dotNL * directLight.color;
	reflectedLight.directDiffuse += irradiance * BRDF_Lambert( material.diffuseColor );
	reflectedLight.directSpecular += irradiance * BRDF_BlinnPhong( directLight.direction, geometry.viewDir, geometry.normal, material.specularColor, material.specularShininess ) * material.specularStrength;
}
void RE_IndirectDiffuse_BlinnPhong( const in vec3 irradiance, const in GeometricContext geometry, const in BlinnPhongMaterial material, inout ReflectedLight reflectedLight ) {
	reflectedLight.indirectDiffuse += irradiance * BRDF_Lambert( material.diffuseColor );
}
#define RE_Direct				RE_Direct_BlinnPhong
#define RE_IndirectDiffuse		RE_IndirectDiffuse_BlinnPhong`,Ck=`PhysicalMaterial material;
material.diffuseColor = diffuseColor.rgb * ( 1.0 - metalnessFactor );
vec3 dxy = max( abs( dFdx( geometryNormal ) ), abs( dFdy( geometryNormal ) ) );
float geometryRoughness = max( max( dxy.x, dxy.y ), dxy.z );
material.roughness = max( roughnessFactor, 0.0525 );material.roughness += geometryRoughness;
material.roughness = min( material.roughness, 1.0 );
#ifdef IOR
	material.ior = ior;
	#ifdef 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_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 );
	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`,bk=`struct PhysicalMaterial {
	vec3 diffuseColor;
	float roughness;
	vec3 specularColor;
	float specularF90;
	#ifdef USE_CLEARCOAT
		float clearcoat;
		float clearcoatRoughness;
		vec3 clearcoatF0;
		float clearcoatF90;
	#endif
	#ifdef USE_IRIDESCENCE
		float iridescence;
		float iridescenceIOR;
		float iridescenceThickness;
		vec3 iridescenceFresnel;
		vec3 iridescenceF0;
	#endif
	#ifdef USE_SHEEN
		vec3 sheenColor;
		float sheenRoughness;
	#endif
	#ifdef IOR
		float ior;
	#endif
	#ifdef USE_TRANSMISSION
		float transmission;
		float transmissionAlpha;
		float thickness;
		float attenuationDistance;
		vec3 attenuationColor;
	#endif
	#ifdef USE_ANISOTROPY
		float anisotropy;
		float alphaT;
		vec3 anisotropyT;
		vec3 anisotropyB;
	#endif
};
vec3 clearcoatSpecular = vec3( 0.0 );
vec3 sheenSpecular = 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 GeometricContext geometry, const in PhysicalMaterial material, inout ReflectedLight reflectedLight ) {
		vec3 normal = geometry.normal;
		vec3 viewDir = geometry.viewDir;
		vec3 position = geometry.position;
		vec3 lightPos = rectAreaLight.position;
		vec3 halfWidth = rectAreaLight.halfWidth;
		vec3 halfHeight = rectAreaLight.halfHeight;
		vec3 lightColor = rectAreaLight.color;
		float roughness = material.roughness;
		vec3 rectCoords[ 4 ];
		rectCoords[ 0 ] = lightPos + halfWidth - halfHeight;		rectCoords[ 1 ] = lightPos - halfWidth - halfHeight;
		rectCoords[ 2 ] = lightPos - halfWidth + halfHeight;
		rectCoords[ 3 ] = lightPos + halfWidth + halfHeight;
		vec2 uv = LTC_Uv( normal, viewDir, roughness );
		vec4 t1 = texture2D( ltc_1, uv );
		vec4 t2 = texture2D( ltc_2, uv );
		mat3 mInv = mat3(
			vec3( t1.x, 0, t1.y ),
			vec3(    0, 1,    0 ),
			vec3( t1.z, 0, t1.w )
		);
		vec3 fresnel = ( material.specularColor * t2.x + ( vec3( 1.0 ) - material.specularColor ) * t2.y );
		reflectedLight.directSpecular += lightColor * fresnel * LTC_Evaluate( normal, viewDir, position, mInv, rectCoords );
		reflectedLight.directDiffuse += lightColor * material.diffuseColor * LTC_Evaluate( normal, viewDir, position, mat3( 1.0 ), rectCoords );
	}
#endif
void RE_Direct_Physical( const in IncidentLight directLight, const in GeometricContext geometry, const in PhysicalMaterial material, inout ReflectedLight reflectedLight ) {
	float dotNL = saturate( dot( geometry.normal, directLight.direction ) );
	vec3 irradiance = dotNL * directLight.color;
	#ifdef USE_CLEARCOAT
		float dotNLcc = saturate( dot( geometry.clearcoatNormal, directLight.direction ) );
		vec3 ccIrradiance = dotNLcc * directLight.color;
		clearcoatSpecular += ccIrradiance * BRDF_GGX_Clearcoat( directLight.direction, geometry.viewDir, geometry.clearcoatNormal, material );
	#endif
	#ifdef USE_SHEEN
		sheenSpecular += irradiance * BRDF_Sheen( directLight.direction, geometry.viewDir, geometry.normal, material.sheenColor, material.sheenRoughness );
	#endif
	reflectedLight.directSpecular += irradiance * BRDF_GGX( directLight.direction, geometry.viewDir, geometry.normal, material );
	reflectedLight.directDiffuse += irradiance * BRDF_Lambert( material.diffuseColor );
}
void RE_IndirectDiffuse_Physical( const in vec3 irradiance, const in GeometricContext geometry, const in PhysicalMaterial material, inout ReflectedLight reflectedLight ) {
	reflectedLight.indirectDiffuse += irradiance * BRDF_Lambert( material.diffuseColor );
}
void RE_IndirectSpecular_Physical( const in vec3 radiance, const in vec3 irradiance, const in vec3 clearcoatRadiance, const in GeometricContext geometry, const in PhysicalMaterial material, inout ReflectedLight reflectedLight) {
	#ifdef USE_CLEARCOAT
		clearcoatSpecular += clearcoatRadiance * EnvironmentBRDF( geometry.clearcoatNormal, geometry.viewDir, material.clearcoatF0, material.clearcoatF90, material.clearcoatRoughness );
	#endif
	#ifdef USE_SHEEN
		sheenSpecular += irradiance * material.sheenColor * IBLSheenBRDF( geometry.normal, geometry.viewDir, material.sheenRoughness );
	#endif
	vec3 singleScattering = vec3( 0.0 );
	vec3 multiScattering = vec3( 0.0 );
	vec3 cosineWeightedIrradiance = irradiance * RECIPROCAL_PI;
	#ifdef USE_IRIDESCENCE
		computeMultiscatteringIridescence( geometry.normal, geometry.viewDir, material.specularColor, material.specularF90, material.iridescence, material.iridescenceFresnel, material.roughness, singleScattering, multiScattering );
	#else
		computeMultiscattering( geometry.normal, geometry.viewDir, material.specularColor, material.specularF90, material.roughness, singleScattering, multiScattering );
	#endif
	vec3 totalScattering = singleScattering + multiScattering;
	vec3 diffuse = material.diffuseColor * ( 1.0 - max( max( totalScattering.r, totalScattering.g ), totalScattering.b ) );
	reflectedLight.indirectSpecular += radiance * singleScattering;
	reflectedLight.indirectSpecular += multiScattering * cosineWeightedIrradiance;
	reflectedLight.indirectDiffuse += diffuse * cosineWeightedIrradiance;
}
#define RE_Direct				RE_Direct_Physical
#define RE_Direct_RectArea		RE_Direct_RectArea_Physical
#define RE_IndirectDiffuse		RE_IndirectDiffuse_Physical
#define RE_IndirectSpecular		RE_IndirectSpecular_Physical
float computeSpecularOcclusion( const in float dotNV, const in float ambientOcclusion, const in float roughness ) {
	return saturate( pow( dotNV + ambientOcclusion, exp2( - 16.0 * roughness - 1.0 ) ) - 1.0 + ambientOcclusion );
}`,Rk=`
GeometricContext geometry;
geometry.position = - vViewPosition;
geometry.normal = normal;
geometry.viewDir = ( isOrthographic ) ? vec3( 0, 0, 1 ) : normalize( vViewPosition );
#ifdef USE_CLEARCOAT
	geometry.clearcoatNormal = clearcoatNormal;
#endif
#ifdef USE_IRIDESCENCE
	float dotNVi = saturate( dot( normal, geometry.viewDir ) );
	if ( material.iridescenceThickness == 0.0 ) {
		material.iridescence = 0.0;
	} else {
		material.iridescence = saturate( material.iridescence );
	}
	if ( material.iridescence > 0.0 ) {
		material.iridescenceFresnel = evalIridescence( 1.0, material.iridescenceIOR, dotNVi, material.iridescenceThickness, material.specularColor );
		material.iridescenceF0 = Schlick_to_F0( material.iridescenceFresnel, 1.0, dotNVi );
	}
#endif
IncidentLight directLight;
#if ( NUM_POINT_LIGHTS > 0 ) && defined( RE_Direct )
	PointLight pointLight;
	#if defined( USE_SHADOWMAP ) && NUM_POINT_LIGHT_SHADOWS > 0
	PointLightShadow pointLightShadow;
	#endif
	#pragma unroll_loop_start
	for ( int i = 0; i < NUM_POINT_LIGHTS; i ++ ) {
		pointLight = pointLights[ i ];
		getPointLightInfo( pointLight, geometry, directLight );
		#if defined( USE_SHADOWMAP ) && ( UNROLLED_LOOP_INDEX < NUM_POINT_LIGHT_SHADOWS )
		pointLightShadow = pointLightShadows[ i ];
		directLight.color *= ( directLight.visible && receiveShadow ) ? getPointShadow( pointShadowMap[ i ], pointLightShadow.shadowMapSize, pointLightShadow.shadowBias, pointLightShadow.shadowRadius, vPointShadowCoord[ i ], pointLightShadow.shadowCameraNear, pointLightShadow.shadowCameraFar ) : 1.0;
		#endif
		RE_Direct( directLight, geometry, material, reflectedLight );
	}
	#pragma unroll_loop_end
#endif
#if ( NUM_SPOT_LIGHTS > 0 ) && defined( RE_Direct )
	SpotLight spotLight;
	vec4 spotColor;
	vec3 spotLightCoord;
	bool inSpotLightMap;
	#if defined( USE_SHADOWMAP ) && NUM_SPOT_LIGHT_SHADOWS > 0
	SpotLightShadow spotLightShadow;
	#endif
	#pragma unroll_loop_start
	for ( int i = 0; i < NUM_SPOT_LIGHTS; i ++ ) {
		spotLight = spotLights[ i ];
		getSpotLightInfo( spotLight, geometry, directLight );
		#if ( UNROLLED_LOOP_INDEX < NUM_SPOT_LIGHT_SHADOWS_WITH_MAPS )
		#define SPOT_LIGHT_MAP_INDEX UNROLLED_LOOP_INDEX
		#elif ( UNROLLED_LOOP_INDEX < NUM_SPOT_LIGHT_SHADOWS )
		#define SPOT_LIGHT_MAP_INDEX NUM_SPOT_LIGHT_MAPS
		#else
		#define SPOT_LIGHT_MAP_INDEX ( UNROLLED_LOOP_INDEX - NUM_SPOT_LIGHT_SHADOWS + NUM_SPOT_LIGHT_SHADOWS_WITH_MAPS )
		#endif
		#if ( SPOT_LIGHT_MAP_INDEX < NUM_SPOT_LIGHT_MAPS )
			spotLightCoord = vSpotLightCoord[ i ].xyz / vSpotLightCoord[ i ].w;
			inSpotLightMap = all( lessThan( abs( spotLightCoord * 2. - 1. ), vec3( 1.0 ) ) );
			spotColor = texture2D( spotLightMap[ SPOT_LIGHT_MAP_INDEX ], spotLightCoord.xy );
			directLight.color = inSpotLightMap ? directLight.color * spotColor.rgb : directLight.color;
		#endif
		#undef SPOT_LIGHT_MAP_INDEX
		#if defined( USE_SHADOWMAP ) && ( UNROLLED_LOOP_INDEX < NUM_SPOT_LIGHT_SHADOWS )
		spotLightShadow = spotLightShadows[ i ];
		directLight.color *= ( directLight.visible && receiveShadow ) ? getShadow( spotShadowMap[ i ], spotLightShadow.shadowMapSize, spotLightShadow.shadowBias, spotLightShadow.shadowRadius, vSpotLightCoord[ i ] ) : 1.0;
		#endif
		RE_Direct( directLight, geometry, material, reflectedLight );
	}
	#pragma unroll_loop_end
#endif
#if ( NUM_DIR_LIGHTS > 0 ) && defined( RE_Direct )
	DirectionalLight directionalLight;
	#if defined( USE_SHADOWMAP ) && NUM_DIR_LIGHT_SHADOWS > 0
	DirectionalLightShadow directionalLightShadow;
	#endif
	#pragma unroll_loop_start
	for ( int i = 0; i < NUM_DIR_LIGHTS; i ++ ) {
		directionalLight = directionalLights[ i ];
		getDirectionalLightInfo( directionalLight, geometry, directLight );
		#if defined( USE_SHADOWMAP ) && ( UNROLLED_LOOP_INDEX < NUM_DIR_LIGHT_SHADOWS )
		directionalLightShadow = directionalLightShadows[ i ];
		directLight.color *= ( directLight.visible && receiveShadow ) ? getShadow( directionalShadowMap[ i ], directionalLightShadow.shadowMapSize, directionalLightShadow.shadowBias, directionalLightShadow.shadowRadius, vDirectionalShadowCoord[ i ] ) : 1.0;
		#endif
		RE_Direct( directLight, geometry, material, reflectedLight );
	}
	#pragma unroll_loop_end
#endif
#if ( NUM_RECT_AREA_LIGHTS > 0 ) && defined( RE_Direct_RectArea )
	RectAreaLight rectAreaLight;
	#pragma unroll_loop_start
	for ( int i = 0; i < NUM_RECT_AREA_LIGHTS; i ++ ) {
		rectAreaLight = rectAreaLights[ i ];
		RE_Direct_RectArea( rectAreaLight, geometry, material, reflectedLight );
	}
	#pragma unroll_loop_end
#endif
#if defined( RE_IndirectDiffuse )
	vec3 iblIrradiance = vec3( 0.0 );
	vec3 irradiance = getAmbientLightIrradiance( ambientLightColor );
	irradiance += getLightProbeIrradiance( lightProbe, geometry.normal );
	#if ( NUM_HEMI_LIGHTS > 0 )
		#pragma unroll_loop_start
		for ( int i = 0; i < NUM_HEMI_LIGHTS; i ++ ) {
			irradiance += getHemisphereLightIrradiance( hemisphereLights[ i ], geometry.normal );
		}
		#pragma unroll_loop_end
	#endif
#endif
#if defined( RE_IndirectSpecular )
	vec3 radiance = vec3( 0.0 );
	vec3 clearcoatRadiance = vec3( 0.0 );
#endif`,Pk=`#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( geometry.normal );
	#endif
#endif
#if defined( USE_ENVMAP ) && defined( RE_IndirectSpecular )
	#ifdef USE_ANISOTROPY
		radiance += getIBLAnisotropyRadiance( geometry.viewDir, geometry.normal, material.roughness, material.anisotropyB, material.anisotropy );
	#else
		radiance += getIBLRadiance( geometry.viewDir, geometry.normal, material.roughness );
	#endif
	#ifdef USE_CLEARCOAT
		clearcoatRadiance += getIBLRadiance( geometry.viewDir, geometry.clearcoatNormal, material.clearcoatRoughness );
	#endif
#endif`,Bk=`#if defined( RE_IndirectDiffuse )
	RE_IndirectDiffuse( irradiance, geometry, material, reflectedLight );
#endif
#if defined( RE_IndirectSpecular )
	RE_IndirectSpecular( radiance, iblIrradiance, clearcoatRadiance, geometry, material, reflectedLight );
#endif`,Lk=`#if defined( USE_LOGDEPTHBUF ) && defined( USE_LOGDEPTHBUF_EXT )
	gl_FragDepthEXT = vIsPerspective == 0.0 ? gl_FragCoord.z : log2( vFragDepth ) * logDepthBufFC * 0.5;
#endif`,Ik=`#if defined( USE_LOGDEPTHBUF ) && defined( USE_LOGDEPTHBUF_EXT )
	uniform float logDepthBufFC;
	varying float vFragDepth;
	varying float vIsPerspective;
#endif`,Dk=`#ifdef USE_LOGDEPTHBUF
	#ifdef USE_LOGDEPTHBUF_EXT
		varying float vFragDepth;
		varying float vIsPerspective;
	#else
		uniform float logDepthBufFC;
	#endif
#endif`,Fk=`#ifdef USE_LOGDEPTHBUF
	#ifdef USE_LOGDEPTHBUF_EXT
		vFragDepth = 1.0 + gl_Position.w;
		vIsPerspective = float( isPerspectiveMatrix( projectionMatrix ) );
	#else
		if ( isPerspectiveMatrix( projectionMatrix ) ) {
			gl_Position.z = log2( max( EPSILON, gl_Position.w + 1.0 ) ) * logDepthBufFC - 1.0;
			gl_Position.z *= gl_Position.w;
		}
	#endif
#endif`,Nk=`#ifdef USE_MAP
	diffuseColor *= texture2D( map, vMapUv );
#endif`,Ok=`#ifdef USE_MAP
	uniform sampler2D map;
#endif`,Uk=`#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`,kk=`#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`,Hk=`float metalnessFactor = metalness;
#ifdef USE_METALNESSMAP
	vec4 texelMetalness = texture2D( metalnessMap, vMetalnessMapUv );
	metalnessFactor *= texelMetalness.b;
#endif`,zk=`#ifdef USE_METALNESSMAP
	uniform sampler2D metalnessMap;
#endif`,Gk=`#if defined( USE_MORPHCOLORS ) && defined( MORPHTARGETS_TEXTURE )
	vColor *= morphTargetBaseInfluence;
	for ( int i = 0; i < MORPHTARGETS_COUNT; i ++ ) {
		#if defined( USE_COLOR_ALPHA )
			if ( morphTargetInfluences[ i ] != 0.0 ) vColor += getMorph( gl_VertexID, i, 2 ) * morphTargetInfluences[ i ];
		#elif defined( USE_COLOR )
			if ( morphTargetInfluences[ i ] != 0.0 ) vColor += getMorph( gl_VertexID, i, 2 ).rgb * morphTargetInfluences[ i ];
		#endif
	}
#endif`,Vk=`#ifdef USE_MORPHNORMALS
	objectNormal *= morphTargetBaseInfluence;
	#ifdef MORPHTARGETS_TEXTURE
		for ( int i = 0; i < MORPHTARGETS_COUNT; i ++ ) {
			if ( morphTargetInfluences[ i ] != 0.0 ) objectNormal += getMorph( gl_VertexID, i, 1 ).xyz * morphTargetInfluences[ i ];
		}
	#else
		objectNormal += morphNormal0 * morphTargetInfluences[ 0 ];
		objectNormal += morphNormal1 * morphTargetInfluences[ 1 ];
		objectNormal += morphNormal2 * morphTargetInfluences[ 2 ];
		objectNormal += morphNormal3 * morphTargetInfluences[ 3 ];
	#endif
#endif`,Wk=`#ifdef USE_MORPHTARGETS
	uniform float morphTargetBaseInfluence;
	#ifdef MORPHTARGETS_TEXTURE
		uniform float morphTargetInfluences[ MORPHTARGETS_COUNT ];
		uniform sampler2DArray morphTargetsTexture;
		uniform ivec2 morphTargetsTextureSize;
		vec4 getMorph( const in int vertexIndex, const in int morphTargetIndex, const in int offset ) {
			int texelIndex = vertexIndex * MORPHTARGETS_TEXTURE_STRIDE + offset;
			int y = texelIndex / morphTargetsTextureSize.x;
			int x = texelIndex - y * morphTargetsTextureSize.x;
			ivec3 morphUV = ivec3( x, y, morphTargetIndex );
			return texelFetch( morphTargetsTexture, morphUV, 0 );
		}
	#else
		#ifndef USE_MORPHNORMALS
			uniform float morphTargetInfluences[ 8 ];
		#else
			uniform float morphTargetInfluences[ 4 ];
		#endif
	#endif
#endif`,jk=`#ifdef USE_MORPHTARGETS
	transformed *= morphTargetBaseInfluence;
	#ifdef MORPHTARGETS_TEXTURE
		for ( int i = 0; i < MORPHTARGETS_COUNT; i ++ ) {
			if ( morphTargetInfluences[ i ] != 0.0 ) transformed += getMorph( gl_VertexID, i, 0 ).xyz * morphTargetInfluences[ i ];
		}
	#else
		transformed += morphTarget0 * morphTargetInfluences[ 0 ];
		transformed += morphTarget1 * morphTargetInfluences[ 1 ];
		transformed += morphTarget2 * morphTargetInfluences[ 2 ];
		transformed += morphTarget3 * morphTargetInfluences[ 3 ];
		#ifndef USE_MORPHNORMALS
			transformed += morphTarget4 * morphTargetInfluences[ 4 ];
			transformed += morphTarget5 * morphTargetInfluences[ 5 ];
			transformed += morphTarget6 * morphTargetInfluences[ 6 ];
			transformed += morphTarget7 * morphTargetInfluences[ 7 ];
		#endif
	#endif
#endif`,Xk=`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 geometryNormal = normal;`,Jk=`#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`,Kk=`#ifndef FLAT_SHADED
	varying vec3 vNormal;
	#ifdef USE_TANGENT
		varying vec3 vTangent;
		varying vec3 vBitangent;
	#endif
#endif`,Yk=`#ifndef FLAT_SHADED
	varying vec3 vNormal;
	#ifdef USE_TANGENT
		varying vec3 vTangent;
		varying vec3 vBitangent;
	#endif
#endif`,Qk=`#ifndef FLAT_SHADED
	vNormal = normalize( transformedNormal );
	#ifdef USE_TANGENT
		vTangent = normalize( transformedTangent );
		vBitangent = normalize( cross( vNormal, vTangent ) * tangent.w );
	#endif
#endif`,Zk=`#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`,qk=`#ifdef USE_CLEARCOAT
	vec3 clearcoatNormal = geometryNormal;
#endif`,$k=`#ifdef USE_CLEARCOAT_NORMALMAP
	vec3 clearcoatMapN = texture2D( clearcoatNormalMap, vClearcoatNormalMapUv ).xyz * 2.0 - 1.0;
	clearcoatMapN.xy *= clearcoatNormalScale;
	clearcoatNormal = normalize( tbn2 * clearcoatMapN );
#endif`,eH=`#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`,tH=`#ifdef USE_IRIDESCENCEMAP
	uniform sampler2D iridescenceMap;
#endif
#ifdef USE_IRIDESCENCE_THICKNESSMAP
	uniform sampler2D iridescenceThicknessMap;
#endif`,nH=`#ifdef OPAQUE
diffuseColor.a = 1.0;
#endif
#ifdef USE_TRANSMISSION
diffuseColor.a *= material.transmissionAlpha;
#endif
gl_FragColor = vec4( outgoingLight, diffuseColor.a );`,iH=`vec3 packNormalToRGB( const in vec3 normal ) {
	return normalize( normal ) * 0.5 + 0.5;
}
vec3 unpackRGBToNormal( const in vec3 rgb ) {
	return 2.0 * rgb.xyz - 1.0;
}
const float PackUpscale = 256. / 255.;const float UnpackDownscale = 255. / 256.;
const vec3 PackFactors = vec3( 256. * 256. * 256., 256. * 256., 256. );
const vec4 UnpackFactors = UnpackDownscale / vec4( PackFactors, 1. );
const float ShiftRight8 = 1. / 256.;
vec4 packDepthToRGBA( const in float v ) {
	vec4 r = vec4( fract( v * PackFactors ), v );
	r.yzw -= r.xyz * ShiftRight8;	return r * PackUpscale;
}
float unpackRGBAToDepth( const in vec4 v ) {
	return dot( v, UnpackFactors );
}
vec2 packDepthToRG( in highp float v ) {
	return packDepthToRGBA( v ).yx;
}
float unpackRGToDepth( const in highp vec2 v ) {
	return unpackRGBAToDepth( vec4( v.xy, 0.0, 0.0 ) );
}
vec4 pack2HalfToRGBA( vec2 v ) {
	vec4 r = vec4( v.x, fract( v.x * 255.0 ), v.y, fract( v.y * 255.0 ) );
	return vec4( r.x - r.y / 255.0, r.y, r.z - r.w / 255.0, r.w );
}
vec2 unpackRGBATo2Half( vec4 v ) {
	return vec2( v.x + ( v.y / 255.0 ), v.z + ( v.w / 255.0 ) );
}
float viewZToOrthographicDepth( const in float viewZ, const in float near, const in float far ) {
	return ( viewZ + near ) / ( near - far );
}
float orthographicDepthToViewZ( const in float 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 );
}`,rH=`#ifdef PREMULTIPLIED_ALPHA
	gl_FragColor.rgb *= gl_FragColor.a;
#endif`,sH=`vec4 mvPosition = vec4( transformed, 1.0 );
#ifdef USE_INSTANCING
	mvPosition = instanceMatrix * mvPosition;
#endif
mvPosition = modelViewMatrix * mvPosition;
gl_Position = projectionMatrix * mvPosition;`,oH=`#ifdef DITHERING
	gl_FragColor.rgb = dithering( gl_FragColor.rgb );
#endif`,aH=`#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`,lH=`float roughnessFactor = roughness;
#ifdef USE_ROUGHNESSMAP
	vec4 texelRoughness = texture2D( roughnessMap, vRoughnessMapUv );
	roughnessFactor *= texelRoughness.g;
#endif`,cH=`#ifdef USE_ROUGHNESSMAP
	uniform sampler2D roughnessMap;
#endif`,uH=`#if NUM_SPOT_LIGHT_COORDS > 0
	varying vec4 vSpotLightCoord[ NUM_SPOT_LIGHT_COORDS ];
#endif
#if NUM_SPOT_LIGHT_MAPS > 0
	uniform sampler2D spotLightMap[ NUM_SPOT_LIGHT_MAPS ];
#endif
#ifdef USE_SHADOWMAP
	#if NUM_DIR_LIGHT_SHADOWS > 0
		uniform sampler2D directionalShadowMap[ NUM_DIR_LIGHT_SHADOWS ];
		varying vec4 vDirectionalShadowCoord[ NUM_DIR_LIGHT_SHADOWS ];
		struct DirectionalLightShadow {
			float shadowBias;
			float shadowNormalBias;
			float shadowRadius;
			vec2 shadowMapSize;
		};
		uniform DirectionalLightShadow directionalLightShadows[ NUM_DIR_LIGHT_SHADOWS ];
	#endif
	#if NUM_SPOT_LIGHT_SHADOWS > 0
		uniform sampler2D spotShadowMap[ NUM_SPOT_LIGHT_SHADOWS ];
		struct SpotLightShadow {
			float shadowBias;
			float shadowNormalBias;
			float shadowRadius;
			vec2 shadowMapSize;
		};
		uniform SpotLightShadow spotLightShadows[ NUM_SPOT_LIGHT_SHADOWS ];
	#endif
	#if NUM_POINT_LIGHT_SHADOWS > 0
		uniform sampler2D pointShadowMap[ NUM_POINT_LIGHT_SHADOWS ];
		varying vec4 vPointShadowCoord[ NUM_POINT_LIGHT_SHADOWS ];
		struct PointLightShadow {
			float shadowBias;
			float shadowNormalBias;
			float shadowRadius;
			vec2 shadowMapSize;
			float shadowCameraNear;
			float shadowCameraFar;
		};
		uniform PointLightShadow pointLightShadows[ NUM_POINT_LIGHT_SHADOWS ];
	#endif
	float texture2DCompare( sampler2D depths, vec2 uv, float compare ) {
		return step( compare, unpackRGBAToDepth( texture2D( depths, uv ) ) );
	}
	vec2 texture2DDistribution( sampler2D shadow, vec2 uv ) {
		return unpackRGBATo2Half( texture2D( shadow, uv ) );
	}
	float VSMShadow (sampler2D shadow, vec2 uv, float compare ){
		float occlusion = 1.0;
		vec2 distribution = texture2DDistribution( shadow, uv );
		float hard_shadow = step( compare , distribution.x );
		if (hard_shadow != 1.0 ) {
			float distance = compare - distribution.x ;
			float variance = max( 0.00000, distribution.y * distribution.y );
			float softness_probability = variance / (variance + distance * distance );			softness_probability = clamp( ( softness_probability - 0.3 ) / ( 0.95 - 0.3 ), 0.0, 1.0 );			occlusion = clamp( max( hard_shadow, softness_probability ), 0.0, 1.0 );
		}
		return occlusion;
	}
	float getShadow( sampler2D shadowMap, vec2 shadowMapSize, float shadowBias, float shadowRadius, vec4 shadowCoord ) {
		float shadow = 1.0;
		shadowCoord.xyz /= shadowCoord.w;
		shadowCoord.z += shadowBias;
		bool inFrustum = shadowCoord.x >= 0.0 && shadowCoord.x <= 1.0 && shadowCoord.y >= 0.0 && shadowCoord.y <= 1.0;
		bool frustumTest = inFrustum && shadowCoord.z <= 1.0;
		if ( frustumTest ) {
		#if defined( SHADOWMAP_TYPE_PCF )
			vec2 texelSize = vec2( 1.0 ) / shadowMapSize;
			float dx0 = - texelSize.x * shadowRadius;
			float dy0 = - texelSize.y * shadowRadius;
			float dx1 = + texelSize.x * shadowRadius;
			float dy1 = + texelSize.y * shadowRadius;
			float dx2 = dx0 / 2.0;
			float dy2 = dy0 / 2.0;
			float dx3 = dx1 / 2.0;
			float dy3 = dy1 / 2.0;
			shadow = (
				texture2DCompare( shadowMap, shadowCoord.xy + vec2( dx0, dy0 ), shadowCoord.z ) +
				texture2DCompare( shadowMap, shadowCoord.xy + vec2( 0.0, dy0 ), shadowCoord.z ) +
				texture2DCompare( shadowMap, shadowCoord.xy + vec2( dx1, dy0 ), shadowCoord.z ) +
				texture2DCompare( shadowMap, shadowCoord.xy + vec2( dx2, dy2 ), shadowCoord.z ) +
				texture2DCompare( shadowMap, shadowCoord.xy + vec2( 0.0, dy2 ), shadowCoord.z ) +
				texture2DCompare( shadowMap, shadowCoord.xy + vec2( dx3, dy2 ), shadowCoord.z ) +
				texture2DCompare( shadowMap, shadowCoord.xy + vec2( dx0, 0.0 ), shadowCoord.z ) +
				texture2DCompare( shadowMap, shadowCoord.xy + vec2( dx2, 0.0 ), shadowCoord.z ) +
				texture2DCompare( shadowMap, shadowCoord.xy, shadowCoord.z ) +
				texture2DCompare( shadowMap, shadowCoord.xy + vec2( dx3, 0.0 ), shadowCoord.z ) +
				texture2DCompare( shadowMap, shadowCoord.xy + vec2( dx1, 0.0 ), shadowCoord.z ) +
				texture2DCompare( shadowMap, shadowCoord.xy + vec2( dx2, dy3 ), shadowCoord.z ) +
				texture2DCompare( shadowMap, shadowCoord.xy + vec2( 0.0, dy3 ), shadowCoord.z ) +
				texture2DCompare( shadowMap, shadowCoord.xy + vec2( dx3, dy3 ), shadowCoord.z ) +
				texture2DCompare( shadowMap, shadowCoord.xy + vec2( dx0, dy1 ), shadowCoord.z ) +
				texture2DCompare( shadowMap, shadowCoord.xy + vec2( 0.0, dy1 ), shadowCoord.z ) +
				texture2DCompare( shadowMap, shadowCoord.xy + vec2( dx1, dy1 ), shadowCoord.z )
			) * ( 1.0 / 17.0 );
		#elif defined( SHADOWMAP_TYPE_PCF_SOFT )
			vec2 texelSize = vec2( 1.0 ) / shadowMapSize;
			float dx = texelSize.x;
			float dy = texelSize.y;
			vec2 uv = shadowCoord.xy;
			vec2 f = fract( uv * shadowMapSize + 0.5 );
			uv -= f * texelSize;
			shadow = (
				texture2DCompare( shadowMap, uv, shadowCoord.z ) +
				texture2DCompare( shadowMap, uv + vec2( dx, 0.0 ), shadowCoord.z ) +
				texture2DCompare( shadowMap, uv + vec2( 0.0, dy ), shadowCoord.z ) +
				texture2DCompare( shadowMap, uv + texelSize, shadowCoord.z ) +
				mix( texture2DCompare( shadowMap, uv + vec2( -dx, 0.0 ), shadowCoord.z ),
					 texture2DCompare( shadowMap, uv + vec2( 2.0 * dx, 0.0 ), shadowCoord.z ),
					 f.x ) +
				mix( texture2DCompare( shadowMap, uv + vec2( -dx, dy ), shadowCoord.z ),
					 texture2DCompare( shadowMap, uv + vec2( 2.0 * dx, dy ), shadowCoord.z ),
					 f.x ) +
				mix( texture2DCompare( shadowMap, uv + vec2( 0.0, -dy ), shadowCoord.z ),
					 texture2DCompare( shadowMap, uv + vec2( 0.0, 2.0 * dy ), shadowCoord.z ),
					 f.y ) +
				mix( texture2DCompare( shadowMap, uv + vec2( dx, -dy ), shadowCoord.z ),
					 texture2DCompare( shadowMap, uv + vec2( dx, 2.0 * dy ), shadowCoord.z ),
					 f.y ) +
				mix( mix( texture2DCompare( shadowMap, uv + vec2( -dx, -dy ), shadowCoord.z ),
						  texture2DCompare( shadowMap, uv + vec2( 2.0 * dx, -dy ), shadowCoord.z ),
						  f.x ),
					 mix( texture2DCompare( shadowMap, uv + vec2( -dx, 2.0 * dy ), shadowCoord.z ),
						  texture2DCompare( shadowMap, uv + vec2( 2.0 * dx, 2.0 * dy ), shadowCoord.z ),
						  f.x ),
					 f.y )
			) * ( 1.0 / 9.0 );
		#elif defined( SHADOWMAP_TYPE_VSM )
			shadow = VSMShadow( shadowMap, shadowCoord.xy, shadowCoord.z );
		#else
			shadow = texture2DCompare( shadowMap, shadowCoord.xy, shadowCoord.z );
		#endif
		}
		return shadow;
	}
	vec2 cubeToUV( vec3 v, float texelSizeY ) {
		vec3 absV = abs( v );
		float scaleToCube = 1.0 / max( absV.x, max( absV.y, absV.z ) );
		absV *= scaleToCube;
		v *= scaleToCube * ( 1.0 - 2.0 * texelSizeY );
		vec2 planar = v.xy;
		float almostATexel = 1.5 * texelSizeY;
		float almostOne = 1.0 - almostATexel;
		if ( absV.z >= almostOne ) {
			if ( v.z > 0.0 )
				planar.x = 4.0 - v.x;
		} else if ( absV.x >= almostOne ) {
			float signX = sign( v.x );
			planar.x = v.z * signX + 2.0 * signX;
		} else if ( absV.y >= almostOne ) {
			float signY = sign( v.y );
			planar.x = v.x + 2.0 * signY + 2.0;
			planar.y = v.z * signY - 2.0;
		}
		return vec2( 0.125, 0.25 ) * planar + vec2( 0.375, 0.75 );
	}
	float getPointShadow( sampler2D shadowMap, vec2 shadowMapSize, float shadowBias, float shadowRadius, vec4 shadowCoord, float shadowCameraNear, float shadowCameraFar ) {
		vec2 texelSize = vec2( 1.0 ) / ( shadowMapSize * vec2( 4.0, 2.0 ) );
		vec3 lightToPosition = shadowCoord.xyz;
		float dp = ( length( lightToPosition ) - shadowCameraNear ) / ( shadowCameraFar - shadowCameraNear );		dp += shadowBias;
		vec3 bd3D = normalize( lightToPosition );
		#if defined( SHADOWMAP_TYPE_PCF ) || defined( SHADOWMAP_TYPE_PCF_SOFT ) || defined( SHADOWMAP_TYPE_VSM )
			vec2 offset = vec2( - 1, 1 ) * shadowRadius * texelSize.y;
			return (
				texture2DCompare( shadowMap, cubeToUV( bd3D + offset.xyy, texelSize.y ), dp ) +
				texture2DCompare( shadowMap, cubeToUV( bd3D + offset.yyy, texelSize.y ), dp ) +
				texture2DCompare( shadowMap, cubeToUV( bd3D + offset.xyx, texelSize.y ), dp ) +
				texture2DCompare( shadowMap, cubeToUV( bd3D + offset.yyx, texelSize.y ), dp ) +
				texture2DCompare( shadowMap, cubeToUV( bd3D, texelSize.y ), dp ) +
				texture2DCompare( shadowMap, cubeToUV( bd3D + offset.xxy, texelSize.y ), dp ) +
				texture2DCompare( shadowMap, cubeToUV( bd3D + offset.yxy, texelSize.y ), dp ) +
				texture2DCompare( shadowMap, cubeToUV( bd3D + offset.xxx, texelSize.y ), dp ) +
				texture2DCompare( shadowMap, cubeToUV( bd3D + offset.yxx, texelSize.y ), dp )
			) * ( 1.0 / 9.0 );
		#else
			return texture2DCompare( shadowMap, cubeToUV( bd3D, texelSize.y ), dp );
		#endif
	}
#endif`,fH=`#if NUM_SPOT_LIGHT_COORDS > 0
	uniform mat4 spotLightMatrix[ NUM_SPOT_LIGHT_COORDS ];
	varying vec4 vSpotLightCoord[ NUM_SPOT_LIGHT_COORDS ];
#endif
#ifdef USE_SHADOWMAP
	#if NUM_DIR_LIGHT_SHADOWS > 0
		uniform mat4 directionalShadowMatrix[ NUM_DIR_LIGHT_SHADOWS ];
		varying vec4 vDirectionalShadowCoord[ NUM_DIR_LIGHT_SHADOWS ];
		struct DirectionalLightShadow {
			float shadowBias;
			float shadowNormalBias;
			float shadowRadius;
			vec2 shadowMapSize;
		};
		uniform DirectionalLightShadow directionalLightShadows[ NUM_DIR_LIGHT_SHADOWS ];
	#endif
	#if NUM_SPOT_LIGHT_SHADOWS > 0
		struct SpotLightShadow {
			float shadowBias;
			float shadowNormalBias;
			float shadowRadius;
			vec2 shadowMapSize;
		};
		uniform SpotLightShadow spotLightShadows[ NUM_SPOT_LIGHT_SHADOWS ];
	#endif
	#if NUM_POINT_LIGHT_SHADOWS > 0
		uniform mat4 pointShadowMatrix[ NUM_POINT_LIGHT_SHADOWS ];
		varying vec4 vPointShadowCoord[ NUM_POINT_LIGHT_SHADOWS ];
		struct PointLightShadow {
			float shadowBias;
			float shadowNormalBias;
			float shadowRadius;
			vec2 shadowMapSize;
			float shadowCameraNear;
			float shadowCameraFar;
		};
		uniform PointLightShadow pointLightShadows[ NUM_POINT_LIGHT_SHADOWS ];
	#endif
#endif`,hH=`#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`,dH=`float getShadowMask() {
	float shadow = 1.0;
	#ifdef USE_SHADOWMAP
	#if NUM_DIR_LIGHT_SHADOWS > 0
	DirectionalLightShadow directionalLight;
	#pragma unroll_loop_start
	for ( int i = 0; i < NUM_DIR_LIGHT_SHADOWS; i ++ ) {
		directionalLight = directionalLightShadows[ i ];
		shadow *= receiveShadow ? getShadow( directionalShadowMap[ i ], directionalLight.shadowMapSize, directionalLight.shadowBias, directionalLight.shadowRadius, vDirectionalShadowCoord[ i ] ) : 1.0;
	}
	#pragma unroll_loop_end
	#endif
	#if NUM_SPOT_LIGHT_SHADOWS > 0
	SpotLightShadow spotLight;
	#pragma unroll_loop_start
	for ( int i = 0; i < NUM_SPOT_LIGHT_SHADOWS; i ++ ) {
		spotLight = spotLightShadows[ i ];
		shadow *= receiveShadow ? getShadow( spotShadowMap[ i ], spotLight.shadowMapSize, spotLight.shadowBias, spotLight.shadowRadius, vSpotLightCoord[ i ] ) : 1.0;
	}
	#pragma unroll_loop_end
	#endif
	#if NUM_POINT_LIGHT_SHADOWS > 0
	PointLightShadow pointLight;
	#pragma unroll_loop_start
	for ( int i = 0; i < NUM_POINT_LIGHT_SHADOWS; i ++ ) {
		pointLight = pointLightShadows[ i ];
		shadow *= receiveShadow ? getPointShadow( pointShadowMap[ i ], pointLight.shadowMapSize, pointLight.shadowBias, pointLight.shadowRadius, vPointShadowCoord[ i ], pointLight.shadowCameraNear, pointLight.shadowCameraFar ) : 1.0;
	}
	#pragma unroll_loop_end
	#endif
	#endif
	return shadow;
}`,pH=`#ifdef USE_SKINNING
	mat4 boneMatX = getBoneMatrix( skinIndex.x );
	mat4 boneMatY = getBoneMatrix( skinIndex.y );
	mat4 boneMatZ = getBoneMatrix( skinIndex.z );
	mat4 boneMatW = getBoneMatrix( skinIndex.w );
#endif`,mH=`#ifdef USE_SKINNING
	uniform mat4 bindMatrix;
	uniform mat4 bindMatrixInverse;
	uniform highp sampler2D boneTexture;
	uniform int boneTextureSize;
	mat4 getBoneMatrix( const in float i ) {
		float j = i * 4.0;
		float x = mod( j, float( boneTextureSize ) );
		float y = floor( j / float( boneTextureSize ) );
		float dx = 1.0 / float( boneTextureSize );
		float dy = 1.0 / float( boneTextureSize );
		y = dy * ( y + 0.5 );
		vec4 v1 = texture2D( boneTexture, vec2( dx * ( x + 0.5 ), y ) );
		vec4 v2 = texture2D( boneTexture, vec2( dx * ( x + 1.5 ), y ) );
		vec4 v3 = texture2D( boneTexture, vec2( dx * ( x + 2.5 ), y ) );
		vec4 v4 = texture2D( boneTexture, vec2( dx * ( x + 3.5 ), y ) );
		mat4 bone = mat4( v1, v2, v3, v4 );
		return bone;
	}
#endif`,gH=`#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`,vH=`#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`,yH=`float specularStrength;
#ifdef USE_SPECULARMAP
	vec4 texelSpecular = texture2D( specularMap, vSpecularMapUv );
	specularStrength = texelSpecular.r;
#else
	specularStrength = 1.0;
#endif`,xH=`#ifdef USE_SPECULARMAP
	uniform sampler2D specularMap;
#endif`,_H=`#if defined( TONE_MAPPING )
	gl_FragColor.rgb = toneMapping( gl_FragColor.rgb );
#endif`,AH=`#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 OptimizedCineonToneMapping( vec3 color ) {
	color *= toneMappingExposure;
	color = max( vec3( 0.0 ), color - 0.004 );
	return pow( ( color * ( 6.2 * color + 0.5 ) ) / ( color * ( 6.2 * color + 1.7 ) + 0.06 ), vec3( 2.2 ) );
}
vec3 RRTAndODTFit( vec3 v ) {
	vec3 a = v * ( v + 0.0245786 ) - 0.000090537;
	vec3 b = v * ( 0.983729 * v + 0.4329510 ) + 0.238081;
	return a / b;
}
vec3 ACESFilmicToneMapping( vec3 color ) {
	const mat3 ACESInputMat = mat3(
		vec3( 0.59719, 0.07600, 0.02840 ),		vec3( 0.35458, 0.90834, 0.13383 ),
		vec3( 0.04823, 0.01566, 0.83777 )
	);
	const mat3 ACESOutputMat = mat3(
		vec3(  1.60475, -0.10208, -0.00327 ),		vec3( -0.53108,  1.10813, -0.07276 ),
		vec3( -0.07367, -0.00605,  1.07602 )
	);
	color *= toneMappingExposure / 0.6;
	color = ACESInputMat * color;
	color = RRTAndODTFit( color );
	color = ACESOutputMat * color;
	return saturate( color );
}
vec3 CustomToneMapping( vec3 color ) { return color; }`,SH=`#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.ior, material.thickness,
		material.attenuationColor, material.attenuationDistance );
	material.transmissionAlpha = mix( material.transmissionAlpha, transmitted.a, material.transmission );
	totalDiffuse = mix( totalDiffuse, transmitted.rgb, material.transmission );
#endif`,MH=`#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 ior, const in float thickness,
		const in vec3 attenuationColor, const in float attenuationDistance ) {
		vec3 transmissionRay = getVolumeTransmissionRay( n, v, thickness, ior, modelMatrix );
		vec3 refractedRayExit = position + transmissionRay;
		vec4 ndcPos = projMatrix * viewMatrix * vec4( refractedRayExit, 1.0 );
		vec2 refractionCoords = ndcPos.xy / ndcPos.w;
		refractionCoords += 1.0;
		refractionCoords /= 2.0;
		vec4 transmittedLight = getTransmissionSample( refractionCoords, roughness, ior );
		vec3 transmittance = diffuseColor * volumeAttenuation( length( transmissionRay ), attenuationColor, attenuationDistance );
		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`,EH=`#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`,wH=`#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`,TH=`#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`,CH=`#if defined( USE_ENVMAP ) || defined( DISTANCE ) || defined ( USE_SHADOWMAP ) || defined ( USE_TRANSMISSION ) || NUM_SPOT_LIGHT_COORDS > 0
	vec4 worldPosition = vec4( transformed, 1.0 );
	#ifdef USE_INSTANCING
		worldPosition = instanceMatrix * worldPosition;
	#endif
	worldPosition = modelMatrix * worldPosition;
#endif`;const bH=`varying vec2 vUv;
uniform mat3 uvTransform;
void main() {
	vUv = ( uvTransform * vec3( uv, 1 ) ).xy;
	gl_Position = vec4( position.xy, 1.0, 1.0 );
}`,RH=`uniform sampler2D t2D;
uniform float backgroundIntensity;
varying vec2 vUv;
void main() {
	vec4 texColor = texture2D( t2D, vUv );
	texColor.rgb *= backgroundIntensity;
	gl_FragColor = texColor;
	#include <tonemapping_fragment>
	#include <colorspace_fragment>
}`,PH=`varying vec3 vWorldDirection;
#include <common>
void main() {
	vWorldDirection = transformDirection( position, modelMatrix );
	#include <begin_vertex>
	#include <project_vertex>
	gl_Position.z = gl_Position.w;
}`,BH=`#ifdef ENVMAP_TYPE_CUBE
	uniform samplerCube envMap;
#elif defined( ENVMAP_TYPE_CUBE_UV )
	uniform sampler2D envMap;
#endif
uniform float flipEnvMap;
uniform float backgroundBlurriness;
uniform float backgroundIntensity;
varying vec3 vWorldDirection;
#include <cube_uv_reflection_fragment>
void main() {
	#ifdef ENVMAP_TYPE_CUBE
		vec4 texColor = textureCube( envMap, vec3( flipEnvMap * vWorldDirection.x, vWorldDirection.yz ) );
	#elif defined( ENVMAP_TYPE_CUBE_UV )
		vec4 texColor = textureCubeUV( envMap, vWorldDirection, backgroundBlurriness );
	#else
		vec4 texColor = vec4( 0.0, 0.0, 0.0, 1.0 );
	#endif
	texColor.rgb *= backgroundIntensity;
	gl_FragColor = texColor;
	#include <tonemapping_fragment>
	#include <colorspace_fragment>
}`,LH=`varying vec3 vWorldDirection;
#include <common>
void main() {
	vWorldDirection = transformDirection( position, modelMatrix );
	#include <begin_vertex>
	#include <project_vertex>
	gl_Position.z = gl_Position.w;
}`,IH=`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>
}`,DH=`#include <common>
#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 <skinbase_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;
}`,FH=`#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() {
	#include <clipping_planes_fragment>
	vec4 diffuseColor = vec4( 1.0 );
	#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 );
	#endif
}`,NH=`#define DISTANCE
varying vec3 vWorldPosition;
#include <common>
#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 <skinbase_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;
}`,OH=`#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 () {
	#include <clipping_planes_fragment>
	vec4 diffuseColor = vec4( 1.0 );
	#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 );
}`,UH=`varying vec3 vWorldDirection;
#include <common>
void main() {
	vWorldDirection = transformDirection( position, modelMatrix );
	#include <begin_vertex>
	#include <project_vertex>
}`,kH=`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>
}`,HH=`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 <morphcolor_vertex>
	#include <begin_vertex>
	#include <morphtarget_vertex>
	#include <project_vertex>
	#include <logdepthbuf_vertex>
	#include <clipping_planes_vertex>
	#include <fog_vertex>
}`,zH=`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() {
	#include <clipping_planes_fragment>
	if ( mod( vLineDistance, totalSize ) > dashSize ) {
		discard;
	}
	vec3 outgoingLight = vec3( 0.0 );
	vec4 diffuseColor = vec4( diffuse, opacity );
	#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>
}`,GH=`#include <common>
#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 <morphcolor_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>
}`,VH=`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() {
	#include <clipping_planes_fragment>
	vec4 diffuseColor = vec4( diffuse, opacity );
	#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>
}`,WH=`#define LAMBERT
varying vec3 vViewPosition;
#include <common>
#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 <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>
}`,jH=`#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() {
	#include <clipping_planes_fragment>
	vec4 diffuseColor = vec4( diffuse, opacity );
	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>
}`,XH=`#define MATCAP
varying vec3 vViewPosition;
#include <common>
#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 <morphcolor_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;
}`,JH=`#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() {
	#include <clipping_planes_fragment>
	vec4 diffuseColor = vec4( diffuse, opacity );
	#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>
}`,KH=`#define NORMAL
#if defined( FLAT_SHADED ) || defined( USE_BUMPMAP ) || defined( USE_NORMALMAP_TANGENTSPACE )
	varying vec3 vViewPosition;
#endif
#include <common>
#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 <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>
#if defined( FLAT_SHADED ) || defined( USE_BUMPMAP ) || defined( USE_NORMALMAP_TANGENTSPACE )
	vViewPosition = - mvPosition.xyz;
#endif
}`,YH=`#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() {
	#include <clipping_planes_fragment>
	#include <logdepthbuf_fragment>
	#include <normal_fragment_begin>
	#include <normal_fragment_maps>
	gl_FragColor = vec4( packNormalToRGB( normal ), opacity );
	#ifdef OPAQUE
		gl_FragColor.a = 1.0;
	#endif
}`,QH=`#define PHONG
varying vec3 vViewPosition;
#include <common>
#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 <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>
}`,ZH=`#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() {
	#include <clipping_planes_fragment>
	vec4 diffuseColor = vec4( diffuse, opacity );
	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>
}`,qH=`#define STANDARD
varying vec3 vViewPosition;
#ifdef USE_TRANSMISSION
	varying vec3 vWorldPosition;
#endif
#include <common>
#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 <morphcolor_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
}`,$H=`#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_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() {
	#include <clipping_planes_fragment>
	vec4 diffuseColor = vec4( diffuse, opacity );
	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 + sheenSpecular;
	#endif
	#ifdef USE_CLEARCOAT
		float dotNVcc = saturate( dot( geometry.clearcoatNormal, geometry.viewDir ) );
		vec3 Fcc = F_Schlick( material.clearcoatF0, material.clearcoatF90, dotNVcc );
		outgoingLight = outgoingLight * ( 1.0 - material.clearcoat * Fcc ) + clearcoatSpecular * material.clearcoat;
	#endif
	#include <opaque_fragment>
	#include <tonemapping_fragment>
	#include <colorspace_fragment>
	#include <fog_fragment>
	#include <premultiplied_alpha_fragment>
	#include <dithering_fragment>
}`,ez=`#define TOON
varying vec3 vViewPosition;
#include <common>
#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 <morphcolor_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>
}`,tz=`#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() {
	#include <clipping_planes_fragment>
	vec4 diffuseColor = vec4( diffuse, opacity );
	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>
}`,nz=`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 <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>
}`,iz=`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() {
	#include <clipping_planes_fragment>
	vec3 outgoingLight = vec3( 0.0 );
	vec4 diffuseColor = vec4( diffuse, opacity );
	#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>
}`,rz=`#include <common>
#include <fog_pars_vertex>
#include <morphtarget_pars_vertex>
#include <skinning_pars_vertex>
#include <logdepthbuf_pars_vertex>
#include <shadowmap_pars_vertex>
void main() {
	#include <beginnormal_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>
}`,sz=`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>
}`,oz=`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 * vec4( 0.0, 0.0, 0.0, 1.0 );
	vec2 scale;
	scale.x = length( vec3( modelMatrix[ 0 ].x, modelMatrix[ 0 ].y, modelMatrix[ 0 ].z ) );
	scale.y = length( vec3( modelMatrix[ 1 ].x, modelMatrix[ 1 ].y, modelMatrix[ 1 ].z ) );
	#ifndef USE_SIZEATTENUATION
		bool isPerspective = isPerspectiveMatrix( projectionMatrix );
		if ( isPerspective ) scale *= - mvPosition.z;
	#endif
	vec2 alignedPosition = ( position.xy - ( center - vec2( 0.5 ) ) ) * scale;
	vec2 rotatedPosition;
	rotatedPosition.x = cos( rotation ) * alignedPosition.x - sin( rotation ) * alignedPosition.y;
	rotatedPosition.y = sin( rotation ) * alignedPosition.x + cos( rotation ) * alignedPosition.y;
	mvPosition.xy += rotatedPosition;
	gl_Position = projectionMatrix * mvPosition;
	#include <logdepthbuf_vertex>
	#include <clipping_planes_vertex>
	#include <fog_vertex>
}`,az=`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() {
	#include <clipping_planes_fragment>
	vec3 outgoingLight = vec3( 0.0 );
	vec4 diffuseColor = vec4( diffuse, opacity );
	#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>
}`,yt={alphahash_fragment:BU,alphahash_pars_fragment:LU,alphamap_fragment:IU,alphamap_pars_fragment:DU,alphatest_fragment:FU,alphatest_pars_fragment:NU,aomap_fragment:OU,aomap_pars_fragment:UU,begin_vertex:kU,beginnormal_vertex:HU,bsdfs:zU,iridescence_fragment:GU,bumpmap_pars_fragment:VU,clipping_planes_fragment:WU,clipping_planes_pars_fragment:jU,clipping_planes_pars_vertex:XU,clipping_planes_vertex:JU,color_fragment:KU,color_pars_fragment:YU,color_pars_vertex:QU,color_vertex:ZU,common:qU,cube_uv_reflection_fragment:$U,defaultnormal_vertex:ek,displacementmap_pars_vertex:tk,displacementmap_vertex:nk,emissivemap_fragment:ik,emissivemap_pars_fragment:rk,colorspace_fragment:sk,colorspace_pars_fragment:ok,envmap_fragment:ak,envmap_common_pars_fragment:lk,envmap_pars_fragment:ck,envmap_pars_vertex:uk,envmap_physical_pars_fragment:Sk,envmap_vertex:fk,fog_vertex:hk,fog_pars_vertex:dk,fog_fragment:pk,fog_pars_fragment:mk,gradientmap_pars_fragment:gk,lightmap_fragment:vk,lightmap_pars_fragment:yk,lights_lambert_fragment:xk,lights_lambert_pars_fragment:_k,lights_pars_begin:Ak,lights_toon_fragment:Mk,lights_toon_pars_fragment:Ek,lights_phong_fragment:wk,lights_phong_pars_fragment:Tk,lights_physical_fragment:Ck,lights_physical_pars_fragment:bk,lights_fragment_begin:Rk,lights_fragment_maps:Pk,lights_fragment_end:Bk,logdepthbuf_fragment:Lk,logdepthbuf_pars_fragment:Ik,logdepthbuf_pars_vertex:Dk,logdepthbuf_vertex:Fk,map_fragment:Nk,map_pars_fragment:Ok,map_particle_fragment:Uk,map_particle_pars_fragment:kk,metalnessmap_fragment:Hk,metalnessmap_pars_fragment:zk,morphcolor_vertex:Gk,morphnormal_vertex:Vk,morphtarget_pars_vertex:Wk,morphtarget_vertex:jk,normal_fragment_begin:Xk,normal_fragment_maps:Jk,normal_pars_fragment:Kk,normal_pars_vertex:Yk,normal_vertex:Qk,normalmap_pars_fragment:Zk,clearcoat_normal_fragment_begin:qk,clearcoat_normal_fragment_maps:$k,clearcoat_pars_fragment:eH,iridescence_pars_fragment:tH,opaque_fragment:nH,packing:iH,premultiplied_alpha_fragment:rH,project_vertex:sH,dithering_fragment:oH,dithering_pars_fragment:aH,roughnessmap_fragment:lH,roughnessmap_pars_fragment:cH,shadowmap_pars_fragment:uH,shadowmap_pars_vertex:fH,shadowmap_vertex:hH,shadowmask_pars_fragment:dH,skinbase_vertex:pH,skinning_pars_vertex:mH,skinning_vertex:gH,skinnormal_vertex:vH,specularmap_fragment:yH,specularmap_pars_fragment:xH,tonemapping_fragment:_H,tonemapping_pars_fragment:AH,transmission_fragment:SH,transmission_pars_fragment:MH,uv_pars_fragment:EH,uv_pars_vertex:wH,uv_vertex:TH,worldpos_vertex:CH,background_vert:bH,background_frag:RH,backgroundCube_vert:PH,backgroundCube_frag:BH,cube_vert:LH,cube_frag:IH,depth_vert:DH,depth_frag:FH,distanceRGBA_vert:NH,distanceRGBA_frag:OH,equirect_vert:UH,equirect_frag:kH,linedashed_vert:HH,linedashed_frag:zH,meshbasic_vert:GH,meshbasic_frag:VH,meshlambert_vert:WH,meshlambert_frag:jH,meshmatcap_vert:XH,meshmatcap_frag:JH,meshnormal_vert:KH,meshnormal_frag:YH,meshphong_vert:QH,meshphong_frag:ZH,meshphysical_vert:qH,meshphysical_frag:$H,meshtoon_vert:ez,meshtoon_frag:tz,points_vert:nz,points_frag:iz,shadow_vert:rz,shadow_frag:sz,sprite_vert:oz,sprite_frag:az},Fe={common:{diffuse:{value:new Oe(16777215)},opacity:{value:1},map:{value:null},mapTransform:{value:new _t},alphaMap:{value:null},alphaMapTransform:{value:new _t},alphaTest:{value:0}},specularmap:{specularMap:{value:null},specularMapTransform:{value:new _t}},envmap:{envMap:{value:null},flipEnvMap:{value:-1},reflectivity:{value:1},ior:{value:1.5},refractionRatio:{value:.98}},aomap:{aoMap:{value:null},aoMapIntensity:{value:1},aoMapTransform:{value:new _t}},lightmap:{lightMap:{value:null},lightMapIntensity:{value:1},lightMapTransform:{value:new _t}},bumpmap:{bumpMap:{value:null},bumpMapTransform:{value:new _t},bumpScale:{value:1}},normalmap:{normalMap:{value:null},normalMapTransform:{value:new _t},normalScale:{value:new ge(1,1)}},displacementmap:{displacementMap:{value:null},displacementMapTransform:{value:new _t},displacementScale:{value:1},displacementBias:{value:0}},emissivemap:{emissiveMap:{value:null},emissiveMapTransform:{value:new _t}},metalnessmap:{metalnessMap:{value:null},metalnessMapTransform:{value:new _t}},roughnessmap:{roughnessMap:{value:null},roughnessMapTransform:{value:new _t}},gradientmap:{gradientMap:{value:null}},fog:{fogDensity:{value:25e-5},fogNear:{value:1},fogFar:{value:2e3},fogColor:{value:new Oe(16777215)}},lights:{ambientLightColor:{value:[]},lightProbe:{value:[]},directionalLights:{value:[],properties:{direction:{},color:{}}},directionalLightShadows:{value:[],properties:{shadowBias:{},shadowNormalBias:{},shadowRadius:{},shadowMapSize:{}}},directionalShadowMap:{value:[]},directionalShadowMatrix:{value:[]},spotLights:{value:[],properties:{color:{},position:{},direction:{},distance:{},coneCos:{},penumbraCos:{},decay:{}}},spotLightShadows:{value:[],properties:{shadowBias:{},shadowNormalBias:{},shadowRadius:{},shadowMapSize:{}}},spotLightMap:{value:[]},spotShadowMap:{value:[]},spotLightMatrix:{value:[]},pointLights:{value:[],properties:{color:{},position:{},decay:{},distance:{}}},pointLightShadows:{value:[],properties:{shadowBias:{},shadowNormalBias:{},shadowRadius:{},shadowMapSize:{},shadowCameraNear:{},shadowCameraFar:{}}},pointShadowMap:{value:[]},pointShadowMatrix:{value:[]},hemisphereLights:{value:[],properties:{direction:{},skyColor:{},groundColor:{}}},rectAreaLights:{value:[],properties:{color:{},position:{},width:{},height:{}}},ltc_1:{value:null},ltc_2:{value:null}},points:{diffuse:{value:new Oe(16777215)},opacity:{value:1},size:{value:1},scale:{value:1},map:{value:null},alphaMap:{value:null},alphaMapTransform:{value:new _t},alphaTest:{value:0},uvTransform:{value:new _t}},sprite:{diffuse:{value:new Oe(16777215)},opacity:{value:1},center:{value:new ge(.5,.5)},rotation:{value:0},map:{value:null},mapTransform:{value:new _t},alphaMap:{value:null},alphaMapTransform:{value:new _t},alphaTest:{value:0}}},Fr={basic:{uniforms:hi([Fe.common,Fe.specularmap,Fe.envmap,Fe.aomap,Fe.lightmap,Fe.fog]),vertexShader:yt.meshbasic_vert,fragmentShader:yt.meshbasic_frag},lambert:{uniforms:hi([Fe.common,Fe.specularmap,Fe.envmap,Fe.aomap,Fe.lightmap,Fe.emissivemap,Fe.bumpmap,Fe.normalmap,Fe.displacementmap,Fe.fog,Fe.lights,{emissive:{value:new Oe(0)}}]),vertexShader:yt.meshlambert_vert,fragmentShader:yt.meshlambert_frag},phong:{uniforms:hi([Fe.common,Fe.specularmap,Fe.envmap,Fe.aomap,Fe.lightmap,Fe.emissivemap,Fe.bumpmap,Fe.normalmap,Fe.displacementmap,Fe.fog,Fe.lights,{emissive:{value:new Oe(0)},specular:{value:new Oe(1118481)},shininess:{value:30}}]),vertexShader:yt.meshphong_vert,fragmentShader:yt.meshphong_frag},standard:{uniforms:hi([Fe.common,Fe.envmap,Fe.aomap,Fe.lightmap,Fe.emissivemap,Fe.bumpmap,Fe.normalmap,Fe.displacementmap,Fe.roughnessmap,Fe.metalnessmap,Fe.fog,Fe.lights,{emissive:{value:new Oe(0)},roughness:{value:1},metalness:{value:0},envMapIntensity:{value:1}}]),vertexShader:yt.meshphysical_vert,fragmentShader:yt.meshphysical_frag},toon:{uniforms:hi([Fe.common,Fe.aomap,Fe.lightmap,Fe.emissivemap,Fe.bumpmap,Fe.normalmap,Fe.displacementmap,Fe.gradientmap,Fe.fog,Fe.lights,{emissive:{value:new Oe(0)}}]),vertexShader:yt.meshtoon_vert,fragmentShader:yt.meshtoon_frag},matcap:{uniforms:hi([Fe.common,Fe.bumpmap,Fe.normalmap,Fe.displacementmap,Fe.fog,{matcap:{value:null}}]),vertexShader:yt.meshmatcap_vert,fragmentShader:yt.meshmatcap_frag},points:{uniforms:hi([Fe.points,Fe.fog]),vertexShader:yt.points_vert,fragmentShader:yt.points_frag},dashed:{uniforms:hi([Fe.common,Fe.fog,{scale:{value:1},dashSize:{value:1},totalSize:{value:2}}]),vertexShader:yt.linedashed_vert,fragmentShader:yt.linedashed_frag},depth:{uniforms:hi([Fe.common,Fe.displacementmap]),vertexShader:yt.depth_vert,fragmentShader:yt.depth_frag},normal:{uniforms:hi([Fe.common,Fe.bumpmap,Fe.normalmap,Fe.displacementmap,{opacity:{value:1}}]),vertexShader:yt.meshnormal_vert,fragmentShader:yt.meshnormal_frag},sprite:{uniforms:hi([Fe.sprite,Fe.fog]),vertexShader:yt.sprite_vert,fragmentShader:yt.sprite_frag},background:{uniforms:{uvTransform:{value:new _t},t2D:{value:null},backgroundIntensity:{value:1}},vertexShader:yt.background_vert,fragmentShader:yt.background_frag},backgroundCube:{uniforms:{envMap:{value:null},flipEnvMap:{value:-1},backgroundBlurriness:{value:0},backgroundIntensity:{value:1}},vertexShader:yt.backgroundCube_vert,fragmentShader:yt.backgroundCube_frag},cube:{uniforms:{tCube:{value:null},tFlip:{value:-1},opacity:{value:1}},vertexShader:yt.cube_vert,fragmentShader:yt.cube_frag},equirect:{uniforms:{tEquirect:{value:null}},vertexShader:yt.equirect_vert,fragmentShader:yt.equirect_frag},distanceRGBA:{uniforms:hi([Fe.common,Fe.displacementmap,{referencePosition:{value:new F},nearDistance:{value:1},farDistance:{value:1e3}}]),vertexShader:yt.distanceRGBA_vert,fragmentShader:yt.distanceRGBA_frag},shadow:{uniforms:hi([Fe.lights,Fe.fog,{color:{value:new Oe(0)},opacity:{value:1}}]),vertexShader:yt.shadow_vert,fragmentShader:yt.shadow_frag}};Fr.physical={uniforms:hi([Fr.standard.uniforms,{clearcoat:{value:0},clearcoatMap:{value:null},clearcoatMapTransform:{value:new _t},clearcoatNormalMap:{value:null},clearcoatNormalMapTransform:{value:new _t},clearcoatNormalScale:{value:new ge(1,1)},clearcoatRoughness:{value:0},clearcoatRoughnessMap:{value:null},clearcoatRoughnessMapTransform:{value:new _t},iridescence:{value:0},iridescenceMap:{value:null},iridescenceMapTransform:{value:new _t},iridescenceIOR:{value:1.3},iridescenceThicknessMinimum:{value:100},iridescenceThicknessMaximum:{value:400},iridescenceThicknessMap:{value:null},iridescenceThicknessMapTransform:{value:new _t},sheen:{value:0},sheenColor:{value:new Oe(0)},sheenColorMap:{value:null},sheenColorMapTransform:{value:new _t},sheenRoughness:{value:1},sheenRoughnessMap:{value:null},sheenRoughnessMapTransform:{value:new _t},transmission:{value:0},transmissionMap:{value:null},transmissionMapTransform:{value:new _t},transmissionSamplerSize:{value:new ge},transmissionSamplerMap:{value:null},thickness:{value:0},thicknessMap:{value:null},thicknessMapTransform:{value:new _t},attenuationDistance:{value:0},attenuationColor:{value:new Oe(0)},specularColor:{value:new Oe(1,1,1)},specularColorMap:{value:null},specularColorMapTransform:{value:new _t},specularIntensity:{value:1},specularIntensityMap:{value:null},specularIntensityMapTransform:{value:new _t},anisotropyVector:{value:new ge},anisotropyMap:{value:null},anisotropyMapTransform:{value:new _t}}]),vertexShader:yt.meshphysical_vert,fragmentShader:yt.meshphysical_frag};const Sp={r:0,b:0,g:0};function lz(n,e,t,i,r,s,o){const a=new Oe(0);let l=s===!0?0:1,u,h,d=null,p=0,m=null;function y(_,g){let x=!1,S=g.isScene===!0?g.background:null;switch(S&&S.isTexture&&(S=(g.backgroundBlurriness>0?t:e).get(S)),S===null?M(a,l):S&&S.isColor&&(M(S,1),x=!0),n.xr.getEnvironmentBlendMode()){case"opaque":x=!0;break;case"additive":i.buffers.color.setClear(0,0,0,1,o),x=!0;break;case"alpha-blend":i.buffers.color.setClear(0,0,0,0,o),x=!0;break}(n.autoClear||x)&&n.clear(n.autoClearColor,n.autoClearDepth,n.autoClearStencil),S&&(S.isCubeTexture||S.mapping===cu)?(h===void 0&&(h=new Hn(new ul(1,1,1),new ys({name:"BackgroundCubeMaterial",uniforms:Zc(Fr.backgroundCube.uniforms),vertexShader:Fr.backgroundCube.vertexShader,fragmentShader:Fr.backgroundCube.fragmentShader,side:vi,depthTest:!1,depthWrite:!1,fog:!1})),h.geometry.deleteAttribute("normal"),h.geometry.deleteAttribute("uv"),h.onBeforeRender=function(b,P,B){this.matrixWorld.copyPosition(B.matrixWorld)},Object.defineProperty(h.material,"envMap",{get:function(){return this.uniforms.envMap.value}}),r.update(h)),h.material.uniforms.envMap.value=S,h.material.uniforms.flipEnvMap.value=S.isCubeTexture&&S.isRenderTargetTexture===!1?-1:1,h.material.uniforms.backgroundBlurriness.value=g.backgroundBlurriness,h.material.uniforms.backgroundIntensity.value=g.backgroundIntensity,h.material.toneMapped=S.colorSpace!==mt,(d!==S||p!==S.version||m!==n.toneMapping)&&(h.material.needsUpdate=!0,d=S,p=S.version,m=n.toneMapping),h.layers.enableAll(),_.unshift(h,h.geometry,h.material,0,0,null)):S&&S.isTexture&&(u===void 0&&(u=new Hn(new Ch(2,2),new ys({name:"BackgroundMaterial",uniforms:Zc(Fr.background.uniforms),vertexShader:Fr.background.vertexShader,fragmentShader:Fr.background.fragmentShader,side:gs,depthTest:!1,depthWrite:!1,fog:!1})),u.geometry.deleteAttribute("normal"),Object.defineProperty(u.material,"map",{get:function(){return this.uniforms.t2D.value}}),r.update(u)),u.material.uniforms.t2D.value=S,u.material.uniforms.backgroundIntensity.value=g.backgroundIntensity,u.material.toneMapped=S.colorSpace!==mt,S.matrixAutoUpdate===!0&&S.updateMatrix(),u.material.uniforms.uvTransform.value.copy(S.matrix),(d!==S||p!==S.version||m!==n.toneMapping)&&(u.material.needsUpdate=!0,d=S,p=S.version,m=n.toneMapping),u.layers.enableAll(),_.unshift(u,u.geometry,u.material,0,0,null))}function M(_,g){_.getRGB(Sp,l2(n)),i.buffers.color.setClear(Sp.r,Sp.g,Sp.b,g,o)}return{getClearColor:function(){return a},setClearColor:function(_,g=1){a.set(_),l=g,M(a,l)},getClearAlpha:function(){return l},setClearAlpha:function(_){l=_,M(a,l)},render:y}}function cz(n,e,t,i){const r=n.getParameter(n.MAX_VERTEX_ATTRIBS),s=i.isWebGL2?null:e.get("OES_vertex_array_object"),o=i.isWebGL2||s!==null,a={},l=_(null);let u=l,h=!1;function d(Q,Y,ne,ee,I){let V=!1;if(o){const H=M(ee,ne,Y);u!==H&&(u=H,m(u.object)),V=g(Q,ee,ne,I),V&&x(Q,ee,ne,I)}else{const H=Y.wireframe===!0;(u.geometry!==ee.id||u.program!==ne.id||u.wireframe!==H)&&(u.geometry=ee.id,u.program=ne.id,u.wireframe=H,V=!0)}I!==null&&t.update(I,n.ELEMENT_ARRAY_BUFFER),(V||h)&&(h=!1,B(Q,Y,ne,ee),I!==null&&n.bindBuffer(n.ELEMENT_ARRAY_BUFFER,t.get(I).buffer))}function p(){return i.isWebGL2?n.createVertexArray():s.createVertexArrayOES()}function m(Q){return i.isWebGL2?n.bindVertexArray(Q):s.bindVertexArrayOES(Q)}function y(Q){return i.isWebGL2?n.deleteVertexArray(Q):s.deleteVertexArrayOES(Q)}function M(Q,Y,ne){const ee=ne.wireframe===!0;let I=a[Q.id];I===void 0&&(I={},a[Q.id]=I);let V=I[Y.id];V===void 0&&(V={},I[Y.id]=V);let H=V[ee];return H===void 0&&(H=_(p()),V[ee]=H),H}function _(Q){const Y=[],ne=[],ee=[];for(let I=0;I<r;I++)Y[I]=0,ne[I]=0,ee[I]=0;return{geometry:null,program:null,wireframe:!1,newAttributes:Y,enabledAttributes:ne,attributeDivisors:ee,object:Q,attributes:{},index:null}}function g(Q,Y,ne,ee){const I=u.attributes,V=Y.attributes;let H=0;const U=ne.getAttributes();for(const W in U)if(U[W].location>=0){const ue=I[W];let Ae=V[W];if(Ae===void 0&&(W==="instanceMatrix"&&Q.instanceMatrix&&(Ae=Q.instanceMatrix),W==="instanceColor"&&Q.instanceColor&&(Ae=Q.instanceColor)),ue===void 0||ue.attribute!==Ae||Ae&&ue.data!==Ae.data)return!0;H++}return u.attributesNum!==H||u.index!==ee}function x(Q,Y,ne,ee){const I={},V=Y.attributes;let H=0;const U=ne.getAttributes();for(const W in U)if(U[W].location>=0){let ue=V[W];ue===void 0&&(W==="instanceMatrix"&&Q.instanceMatrix&&(ue=Q.instanceMatrix),W==="instanceColor"&&Q.instanceColor&&(ue=Q.instanceColor));const Ae={};Ae.attribute=ue,ue&&ue.data&&(Ae.data=ue.data),I[W]=Ae,H++}u.attributes=I,u.attributesNum=H,u.index=ee}function S(){const Q=u.newAttributes;for(let Y=0,ne=Q.length;Y<ne;Y++)Q[Y]=0}function E(Q){C(Q,0)}function C(Q,Y){const ne=u.newAttributes,ee=u.enabledAttributes,I=u.attributeDivisors;ne[Q]=1,ee[Q]===0&&(n.enableVertexAttribArray(Q),ee[Q]=1),I[Q]!==Y&&((i.isWebGL2?n:e.get("ANGLE_instanced_arrays"))[i.isWebGL2?"vertexAttribDivisor":"vertexAttribDivisorANGLE"](Q,Y),I[Q]=Y)}function b(){const Q=u.newAttributes,Y=u.enabledAttributes;for(let ne=0,ee=Y.length;ne<ee;ne++)Y[ne]!==Q[ne]&&(n.disableVertexAttribArray(ne),Y[ne]=0)}function P(Q,Y,ne,ee,I,V,H){H===!0?n.vertexAttribIPointer(Q,Y,ne,I,V):n.vertexAttribPointer(Q,Y,ne,ee,I,V)}function B(Q,Y,ne,ee){if(i.isWebGL2===!1&&(Q.isInstancedMesh||ee.isInstancedBufferGeometry)&&e.get("ANGLE_instanced_arrays")===null)return;S();const I=ee.attributes,V=ne.getAttributes(),H=Y.defaultAttributeValues;for(const U in V){const W=V[U];if(W.location>=0){let ve=I[U];if(ve===void 0&&(U==="instanceMatrix"&&Q.instanceMatrix&&(ve=Q.instanceMatrix),U==="instanceColor"&&Q.instanceColor&&(ve=Q.instanceColor)),ve!==void 0){const ue=ve.normalized,Ae=ve.itemSize,Ee=t.get(ve);if(Ee===void 0)continue;const Ne=Ee.buffer,We=Ee.type,ct=Ee.bytesPerElement,tt=i.isWebGL2===!0&&(We===n.INT||We===n.UNSIGNED_INT||ve.gpuType===aS);if(ve.isInterleavedBufferAttribute){const Se=ve.data,G=Se.stride,ye=ve.offset;if(Se.isInstancedInterleavedBuffer){for(let pe=0;pe<W.locationSize;pe++)C(W.location+pe,Se.meshPerAttribute);Q.isInstancedMesh!==!0&&ee._maxInstanceCount===void 0&&(ee._maxInstanceCount=Se.meshPerAttribute*Se.count)}else for(let pe=0;pe<W.locationSize;pe++)E(W.location+pe);n.bindBuffer(n.ARRAY_BUFFER,Ne);for(let pe=0;pe<W.locationSize;pe++)P(W.location+pe,Ae/W.locationSize,We,ue,G*ct,(ye+Ae/W.locationSize*pe)*ct,tt)}else{if(ve.isInstancedBufferAttribute){for(let Se=0;Se<W.locationSize;Se++)C(W.location+Se,ve.meshPerAttribute);Q.isInstancedMesh!==!0&&ee._maxInstanceCount===void 0&&(ee._maxInstanceCount=ve.meshPerAttribute*ve.count)}else for(let Se=0;Se<W.locationSize;Se++)E(W.location+Se);n.bindBuffer(n.ARRAY_BUFFER,Ne);for(let Se=0;Se<W.locationSize;Se++)P(W.location+Se,Ae/W.locationSize,We,ue,Ae*ct,Ae/W.locationSize*Se*ct,tt)}}else if(H!==void 0){const ue=H[U];if(ue!==void 0)switch(ue.length){case 2:n.vertexAttrib2fv(W.location,ue);break;case 3:n.vertexAttrib3fv(W.location,ue);break;case 4:n.vertexAttrib4fv(W.location,ue);break;default:n.vertexAttrib1fv(W.location,ue)}}}}b()}function R(){$();for(const Q in a){const Y=a[Q];for(const ne in Y){const ee=Y[ne];for(const I in ee)y(ee[I].object),delete ee[I];delete Y[ne]}delete a[Q]}}function L(Q){if(a[Q.id]===void 0)return;const Y=a[Q.id];for(const ne in Y){const ee=Y[ne];for(const I in ee)y(ee[I].object),delete ee[I];delete Y[ne]}delete a[Q.id]}function z(Q){for(const Y in a){const ne=a[Y];if(ne[Q.id]===void 0)continue;const ee=ne[Q.id];for(const I in ee)y(ee[I].object),delete ee[I];delete ne[Q.id]}}function $(){X(),h=!0,u!==l&&(u=l,m(u.object))}function X(){l.geometry=null,l.program=null,l.wireframe=!1}return{setup:d,reset:$,resetDefaultState:X,dispose:R,releaseStatesOfGeometry:L,releaseStatesOfProgram:z,initAttributes:S,enableAttribute:E,disableUnusedAttributes:b}}function uz(n,e,t,i){const r=i.isWebGL2;let s;function o(u){s=u}function a(u,h){n.drawArrays(s,u,h),t.update(h,s,1)}function l(u,h,d){if(d===0)return;let p,m;if(r)p=n,m="drawArraysInstanced";else if(p=e.get("ANGLE_instanced_arrays"),m="drawArraysInstancedANGLE",p===null){console.error("THREE.WebGLBufferRenderer: using THREE.InstancedBufferGeometry but hardware does not support extension ANGLE_instanced_arrays.");return}p[m](s,u,h,d),t.update(h,s,d)}this.setMode=o,this.render=a,this.renderInstances=l}function fz(n,e,t){let i;function r(){if(i!==void 0)return i;if(e.has("EXT_texture_filter_anisotropic")===!0){const P=e.get("EXT_texture_filter_anisotropic");i=n.getParameter(P.MAX_TEXTURE_MAX_ANISOTROPY_EXT)}else i=0;return i}function s(P){if(P==="highp"){if(n.getShaderPrecisionFormat(n.VERTEX_SHADER,n.HIGH_FLOAT).precision>0&&n.getShaderPrecisionFormat(n.FRAGMENT_SHADER,n.HIGH_FLOAT).precision>0)return"highp";P="mediump"}return P==="mediump"&&n.getShaderPrecisionFormat(n.VERTEX_SHADER,n.MEDIUM_FLOAT).precision>0&&n.getShaderPrecisionFormat(n.FRAGMENT_SHADER,n.MEDIUM_FLOAT).precision>0?"mediump":"lowp"}const o=typeof WebGL2RenderingContext<"u"&&n.constructor.name==="WebGL2RenderingContext";let a=t.precision!==void 0?t.precision:"highp";const l=s(a);l!==a&&(console.warn("THREE.WebGLRenderer:",a,"not supported, using",l,"instead."),a=l);const u=o||e.has("WEBGL_draw_buffers"),h=t.logarithmicDepthBuffer===!0,d=n.getParameter(n.MAX_TEXTURE_IMAGE_UNITS),p=n.getParameter(n.MAX_VERTEX_TEXTURE_IMAGE_UNITS),m=n.getParameter(n.MAX_TEXTURE_SIZE),y=n.getParameter(n.MAX_CUBE_MAP_TEXTURE_SIZE),M=n.getParameter(n.MAX_VERTEX_ATTRIBS),_=n.getParameter(n.MAX_VERTEX_UNIFORM_VECTORS),g=n.getParameter(n.MAX_VARYING_VECTORS),x=n.getParameter(n.MAX_FRAGMENT_UNIFORM_VECTORS),S=p>0,E=o||e.has("OES_texture_float"),C=S&&E,b=o?n.getParameter(n.MAX_SAMPLES):0;return{isWebGL2:o,drawBuffers:u,getMaxAnisotropy:r,getMaxPrecision:s,precision:a,logarithmicDepthBuffer:h,maxTextures:d,maxVertexTextures:p,maxTextureSize:m,maxCubemapSize:y,maxAttributes:M,maxVertexUniforms:_,maxVaryings:g,maxFragmentUniforms:x,vertexTextures:S,floatFragmentTextures:E,floatVertexTextures:C,maxSamples:b}}function hz(n){const e=this;let t=null,i=0,r=!1,s=!1;const o=new So,a=new _t,l={value:null,needsUpdate:!1};this.uniform=l,this.numPlanes=0,this.numIntersection=0,this.init=function(d,p){const m=d.length!==0||p||i!==0||r;return r=p,i=d.length,m},this.beginShadows=function(){s=!0,h(null)},this.endShadows=function(){s=!1},this.setGlobalState=function(d,p){t=h(d,p,0)},this.setState=function(d,p,m){const y=d.clippingPlanes,M=d.clipIntersection,_=d.clipShadows,g=n.get(d);if(!r||y===null||y.length===0||s&&!_)s?h(null):u();else{const x=s?0:i,S=x*4;let E=g.clippingState||null;l.value=E,E=h(y,p,S,m);for(let C=0;C!==S;++C)E[C]=t[C];g.clippingState=E,this.numIntersection=M?this.numPlanes:0,this.numPlanes+=x}};function u(){l.value!==t&&(l.value=t,l.needsUpdate=i>0),e.numPlanes=i,e.numIntersection=0}function h(d,p,m,y){const M=d!==null?d.length:0;let _=null;if(M!==0){if(_=l.value,y!==!0||_===null){const g=m+M*4,x=p.matrixWorldInverse;a.getNormalMatrix(x),(_===null||_.length<g)&&(_=new Float32Array(g));for(let S=0,E=m;S!==M;++S,E+=4)o.copy(d[S]).applyMatrix4(x,a),o.normal.toArray(_,E),_[E+3]=o.constant}l.value=_,l.needsUpdate=!0}return e.numPlanes=M,e.numIntersection=0,_}}function dz(n){let e=new WeakMap;function t(o,a){return a===$f?o.mapping=Xo:a===eh&&(o.mapping=Jo),o}function i(o){if(o&&o.isTexture&&o.isRenderTargetTexture===!1){const a=o.mapping;if(a===$f||a===eh)if(e.has(o)){const l=e.get(o).texture;return t(l,o.mapping)}else{const l=o.image;if(l&&l.height>0){const u=new MS(l.height/2);return u.fromEquirectangularTexture(n,o),e.set(o,u),o.addEventListener("dispose",r),t(u.texture,o.mapping)}else return null}}return o}function r(o){const a=o.target;a.removeEventListener("dispose",r);const l=e.get(a);l!==void 0&&(e.delete(a),l.dispose())}function s(){e=new WeakMap}return{get:i,dispose:s}}class zr extends wh{constructor(e=-1,t=1,i=1,r=-1,s=.1,o=2e3){super(),this.isOrthographicCamera=!0,this.type="OrthographicCamera",this.zoom=1,this.view=null,this.left=e,this.right=t,this.top=i,this.bottom=r,this.near=s,this.far=o,this.updateProjectionMatrix()}copy(e,t){return super.copy(e,t),this.left=e.left,this.right=e.right,this.top=e.top,this.bottom=e.bottom,this.near=e.near,this.far=e.far,this.zoom=e.zoom,this.view=e.view===null?null:Object.assign({},e.view),this}setViewOffset(e,t,i,r,s,o){this.view===null&&(this.view={enabled:!0,fullWidth:1,fullHeight:1,offsetX:0,offsetY:0,width:1,height:1}),this.view.enabled=!0,this.view.fullWidth=e,this.view.fullHeight=t,this.view.offsetX=i,this.view.offsetY=r,this.view.width=s,this.view.height=o,this.updateProjectionMatrix()}clearViewOffset(){this.view!==null&&(this.view.enabled=!1),this.updateProjectionMatrix()}updateProjectionMatrix(){const e=(this.right-this.left)/(2*this.zoom),t=(this.top-this.bottom)/(2*this.zoom),i=(this.right+this.left)/2,r=(this.top+this.bottom)/2;let s=i-e,o=i+e,a=r+t,l=r-t;if(this.view!==null&&this.view.enabled){const u=(this.right-this.left)/this.view.fullWidth/this.zoom,h=(this.top-this.bottom)/this.view.fullHeight/this.zoom;s+=u*this.view.offsetX,o=s+u*this.view.width,a-=h*this.view.offsetY,l=a-h*this.view.height}this.projectionMatrix.makeOrthographic(s,o,a,l,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}}const vc=4,Nw=[.125,.215,.35,.446,.526,.582],Fa=20,ay=new zr,Ow=new Oe;let ly=null;const Ba=(1+Math.sqrt(5))/2,Xl=1/Ba,Uw=[new F(1,1,1),new F(-1,1,1),new F(1,1,-1),new F(-1,1,-1),new F(0,Ba,Xl),new F(0,Ba,-Xl),new F(Xl,0,Ba),new F(-Xl,0,Ba),new F(Ba,Xl,0),new F(-Ba,Xl,0)];class R_{constructor(e){this._renderer=e,this._pingPongRenderTarget=null,this._lodMax=0,this._cubeSize=0,this._lodPlanes=[],this._sizeLods=[],this._sigmas=[],this._blurMaterial=null,this._cubemapMaterial=null,this._equirectMaterial=null,this._compileMaterial(this._blurMaterial)}fromScene(e,t=0,i=.1,r=100){ly=this._renderer.getRenderTarget(),this._setSize(256);const s=this._allocateTargets();return s.depthBuffer=!0,this._sceneToCubeUV(e,i,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=zw(),this._compileMaterial(this._cubemapMaterial))}compileEquirectangularShader(){this._equirectMaterial===null&&(this._equirectMaterial=Hw(),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(ly),e.scissorTest=!1,Mp(e,0,0,e.width,e.height)}_fromTexture(e,t){e.mapping===Xo||e.mapping===Jo?this._setSize(e.image.length===0?16:e.image[0].width||e.image[0].image.width):this._setSize(e.image.width/4),ly=this._renderer.getRenderTarget();const i=t||this._allocateTargets();return this._textureToCubeUV(e,i),this._applyPMREM(i),this._cleanup(i),i}_allocateTargets(){const e=3*Math.max(this._cubeSize,112),t=4*this._cubeSize,i={magFilter:rn,minFilter:rn,generateMipmaps:!1,type:Kc,format:Ti,colorSpace:Vr,depthBuffer:!1},r=kw(e,t,i);if(this._pingPongRenderTarget===null||this._pingPongRenderTarget.width!==e||this._pingPongRenderTarget.height!==t){this._pingPongRenderTarget!==null&&this._dispose(),this._pingPongRenderTarget=kw(e,t,i);const{_lodMax:s}=this;({sizeLods:this._sizeLods,lodPlanes:this._lodPlanes,sigmas:this._sigmas}=pz(s)),this._blurMaterial=mz(s,e,t)}return r}_compileMaterial(e){const t=new Hn(this._lodPlanes[0],e);this._renderer.compile(t,ay)}_sceneToCubeUV(e,t,i,r){const a=new qt(90,1,t,i),l=[1,-1,1,1,1,1],u=[1,1,1,-1,-1,-1],h=this._renderer,d=h.autoClear,p=h.toneMapping;h.getClearColor(Ow),h.toneMapping=Hr,h.autoClear=!1;const m=new ji({name:"PMREM.Background",side:vi,depthWrite:!1,depthTest:!1}),y=new Hn(new ul,m);let M=!1;const _=e.background;_?_.isColor&&(m.color.copy(_),e.background=null,M=!0):(m.color.copy(Ow),M=!0);for(let g=0;g<6;g++){const x=g%3;x===0?(a.up.set(0,l[g],0),a.lookAt(u[g],0,0)):x===1?(a.up.set(0,0,l[g]),a.lookAt(0,u[g],0)):(a.up.set(0,l[g],0),a.lookAt(0,0,u[g]));const S=this._cubeSize;Mp(r,x*S,g>2?S:0,S,S),h.setRenderTarget(r),M&&h.render(y,a),h.render(e,a)}y.geometry.dispose(),y.material.dispose(),h.toneMapping=p,h.autoClear=d,e.background=_}_textureToCubeUV(e,t){const i=this._renderer,r=e.mapping===Xo||e.mapping===Jo;r?(this._cubemapMaterial===null&&(this._cubemapMaterial=zw()),this._cubemapMaterial.uniforms.flipEnvMap.value=e.isRenderTargetTexture===!1?-1:1):this._equirectMaterial===null&&(this._equirectMaterial=Hw());const s=r?this._cubemapMaterial:this._equirectMaterial,o=new Hn(this._lodPlanes[0],s),a=s.uniforms;a.envMap.value=e;const l=this._cubeSize;Mp(t,0,0,3*l,2*l),i.setRenderTarget(t),i.render(o,ay)}_applyPMREM(e){const t=this._renderer,i=t.autoClear;t.autoClear=!1;for(let r=1;r<this._lodPlanes.length;r++){const s=Math.sqrt(this._sigmas[r]*this._sigmas[r]-this._sigmas[r-1]*this._sigmas[r-1]),o=Uw[(r-1)%Uw.length];this._blur(e,r-1,r,s,o)}t.autoClear=i}_blur(e,t,i,r,s){const o=this._pingPongRenderTarget;this._halfBlur(e,o,t,i,r,"latitudinal",s),this._halfBlur(o,e,i,i,r,"longitudinal",s)}_halfBlur(e,t,i,r,s,o,a){const l=this._renderer,u=this._blurMaterial;o!=="latitudinal"&&o!=="longitudinal"&&console.error("blur direction must be either latitudinal or longitudinal!");const h=3,d=new Hn(this._lodPlanes[r],u),p=u.uniforms,m=this._sizeLods[i]-1,y=isFinite(s)?Math.PI/(2*m):2*Math.PI/(2*Fa-1),M=s/y,_=isFinite(s)?1+Math.floor(h*M):Fa;_>Fa&&console.warn(`sigmaRadians, ${s}, is too large and will clip, as it requested ${_} samples when the maximum is set to ${Fa}`);const g=[];let x=0;for(let P=0;P<Fa;++P){const B=P/M,R=Math.exp(-B*B/2);g.push(R),P===0?x+=R:P<_&&(x+=2*R)}for(let P=0;P<g.length;P++)g[P]=g[P]/x;p.envMap.value=e.texture,p.samples.value=_,p.weights.value=g,p.latitudinal.value=o==="latitudinal",a&&(p.poleAxis.value=a);const{_lodMax:S}=this;p.dTheta.value=y,p.mipInt.value=S-i;const E=this._sizeLods[r],C=3*E*(r>S-vc?r-S+vc:0),b=4*(this._cubeSize-E);Mp(t,C,b,3*E,2*E),l.setRenderTarget(t),l.render(d,ay)}}function pz(n){const e=[],t=[],i=[];let r=n;const s=n-vc+1+Nw.length;for(let o=0;o<s;o++){const a=Math.pow(2,r);t.push(a);let l=1/a;o>n-vc?l=Nw[o-n+vc-1]:o===0&&(l=0),i.push(l);const u=1/(a-2),h=-u,d=1+u,p=[h,h,d,h,d,d,h,h,d,d,h,d],m=6,y=6,M=3,_=2,g=1,x=new Float32Array(M*y*m),S=new Float32Array(_*y*m),E=new Float32Array(g*y*m);for(let b=0;b<m;b++){const P=b%3*2/3-1,B=b>2?0:-1,R=[P,B,0,P+2/3,B,0,P+2/3,B+1,0,P,B,0,P+2/3,B+1,0,P,B+1,0];x.set(R,M*y*b),S.set(p,_*y*b);const L=[b,b,b,b,b,b];E.set(L,g*y*b)}const C=new gt;C.setAttribute("position",new Dt(x,M)),C.setAttribute("uv",new Dt(S,_)),C.setAttribute("faceIndex",new Dt(E,g)),e.push(C),r>vc&&r--}return{lodPlanes:e,sizeLods:t,sigmas:i}}function kw(n,e,t){const i=new Wr(n,e,t);return i.texture.mapping=cu,i.texture.name="PMREM.cubeUv",i.scissorTest=!0,i}function Mp(n,e,t,i,r){n.viewport.set(e,t,i,r),n.scissor.set(e,t,i,r)}function mz(n,e,t){const i=new Float32Array(Fa),r=new F(0,1,0);return new ys({name:"SphericalGaussianBlur",defines:{n:Fa,CUBEUV_TEXEL_WIDTH:1/e,CUBEUV_TEXEL_HEIGHT:1/t,CUBEUV_MAX_MIP:`${n}.0`},uniforms:{envMap:{value:null},samples:{value:1},weights:{value:i},latitudinal:{value:!1},dTheta:{value:0},mipInt:{value:0},poleAxis:{value:r}},vertexShader:ES(),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:Ws,depthTest:!1,depthWrite:!1})}function Hw(){return new ys({name:"EquirectangularToCubeUV",uniforms:{envMap:{value:null}},vertexShader:ES(),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:Ws,depthTest:!1,depthWrite:!1})}function zw(){return new ys({name:"CubemapToCubeUV",uniforms:{envMap:{value:null},flipEnvMap:{value:-1}},vertexShader:ES(),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:Ws,depthTest:!1,depthWrite:!1})}function ES(){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 gz(n){let e=new WeakMap,t=null;function i(a){if(a&&a.isTexture){const l=a.mapping,u=l===$f||l===eh,h=l===Xo||l===Jo;if(u||h)if(a.isRenderTargetTexture&&a.needsPMREMUpdate===!0){a.needsPMREMUpdate=!1;let d=e.get(a);return t===null&&(t=new R_(n)),d=u?t.fromEquirectangular(a,d):t.fromCubemap(a,d),e.set(a,d),d.texture}else{if(e.has(a))return e.get(a).texture;{const d=a.image;if(u&&d&&d.height>0||h&&d&&r(d)){t===null&&(t=new R_(n));const p=u?t.fromEquirectangular(a):t.fromCubemap(a);return e.set(a,p),a.addEventListener("dispose",s),p.texture}else return null}}}return a}function r(a){let l=0;const u=6;for(let h=0;h<u;h++)a[h]!==void 0&&l++;return l===u}function s(a){const l=a.target;l.removeEventListener("dispose",s);const u=e.get(l);u!==void 0&&(e.delete(l),u.dispose())}function o(){e=new WeakMap,t!==null&&(t.dispose(),t=null)}return{get:i,dispose:o}}function vz(n){const e={};function t(i){if(e[i]!==void 0)return e[i];let r;switch(i){case"WEBGL_depth_texture":r=n.getExtension("WEBGL_depth_texture")||n.getExtension("MOZ_WEBGL_depth_texture")||n.getExtension("WEBKIT_WEBGL_depth_texture");break;case"EXT_texture_filter_anisotropic":r=n.getExtension("EXT_texture_filter_anisotropic")||n.getExtension("MOZ_EXT_texture_filter_anisotropic")||n.getExtension("WEBKIT_EXT_texture_filter_anisotropic");break;case"WEBGL_compressed_texture_s3tc":r=n.getExtension("WEBGL_compressed_texture_s3tc")||n.getExtension("MOZ_WEBGL_compressed_texture_s3tc")||n.getExtension("WEBKIT_WEBGL_compressed_texture_s3tc");break;case"WEBGL_compressed_texture_pvrtc":r=n.getExtension("WEBGL_compressed_texture_pvrtc")||n.getExtension("WEBKIT_WEBGL_compressed_texture_pvrtc");break;default:r=n.getExtension(i)}return e[i]=r,r}return{has:function(i){return t(i)!==null},init:function(i){i.isWebGL2?t("EXT_color_buffer_float"):(t("WEBGL_depth_texture"),t("OES_texture_float"),t("OES_texture_half_float"),t("OES_texture_half_float_linear"),t("OES_standard_derivatives"),t("OES_element_index_uint"),t("OES_vertex_array_object"),t("ANGLE_instanced_arrays")),t("OES_texture_float_linear"),t("EXT_color_buffer_half_float"),t("WEBGL_multisampled_render_to_texture")},get:function(i){const r=t(i);return r===null&&console.warn("THREE.WebGLRenderer: "+i+" extension not supported."),r}}}function yz(n,e,t,i){const r={},s=new WeakMap;function o(d){const p=d.target;p.index!==null&&e.remove(p.index);for(const y in p.attributes)e.remove(p.attributes[y]);for(const y in p.morphAttributes){const M=p.morphAttributes[y];for(let _=0,g=M.length;_<g;_++)e.remove(M[_])}p.removeEventListener("dispose",o),delete r[p.id];const m=s.get(p);m&&(e.remove(m),s.delete(p)),i.releaseStatesOfGeometry(p),p.isInstancedBufferGeometry===!0&&delete p._maxInstanceCount,t.memory.geometries--}function a(d,p){return r[p.id]===!0||(p.addEventListener("dispose",o),r[p.id]=!0,t.memory.geometries++),p}function l(d){const p=d.attributes;for(const y in p)e.update(p[y],n.ARRAY_BUFFER);const m=d.morphAttributes;for(const y in m){const M=m[y];for(let _=0,g=M.length;_<g;_++)e.update(M[_],n.ARRAY_BUFFER)}}function u(d){const p=[],m=d.index,y=d.attributes.position;let M=0;if(m!==null){const x=m.array;M=m.version;for(let S=0,E=x.length;S<E;S+=3){const C=x[S+0],b=x[S+1],P=x[S+2];p.push(C,b,b,P,P,C)}}else{const x=y.array;M=y.version;for(let S=0,E=x.length/3-1;S<E;S+=3){const C=S+0,b=S+1,P=S+2;p.push(C,b,b,P,P,C)}}const _=new(o2(p)?AS:_S)(p,1);_.version=M;const g=s.get(d);g&&e.remove(g),s.set(d,_)}function h(d){const p=s.get(d);if(p){const m=d.index;m!==null&&p.version<m.version&&u(d)}else u(d);return s.get(d)}return{get:a,update:l,getWireframeAttribute:h}}function xz(n,e,t,i){const r=i.isWebGL2;let s;function o(p){s=p}let a,l;function u(p){a=p.type,l=p.bytesPerElement}function h(p,m){n.drawElements(s,m,a,p*l),t.update(m,s,1)}function d(p,m,y){if(y===0)return;let M,_;if(r)M=n,_="drawElementsInstanced";else if(M=e.get("ANGLE_instanced_arrays"),_="drawElementsInstancedANGLE",M===null){console.error("THREE.WebGLIndexedBufferRenderer: using THREE.InstancedBufferGeometry but hardware does not support extension ANGLE_instanced_arrays.");return}M[_](s,m,a,p*l,y),t.update(m,s,y)}this.setMode=o,this.setIndex=u,this.render=h,this.renderInstances=d}function _z(n){const e={geometries:0,textures:0},t={frame:0,calls:0,triangles:0,points:0,lines:0};function i(s,o,a){switch(t.calls++,o){case n.TRIANGLES:t.triangles+=a*(s/3);break;case n.LINES:t.lines+=a*(s/2);break;case n.LINE_STRIP:t.lines+=a*(s-1);break;case n.LINE_LOOP:t.lines+=a*s;break;case n.POINTS:t.points+=a*s;break;default:console.error("THREE.WebGLInfo: Unknown draw mode:",o);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:i}}function Az(n,e){return n[0]-e[0]}function Sz(n,e){return Math.abs(e[1])-Math.abs(n[1])}function Mz(n,e,t){const i={},r=new Float32Array(8),s=new WeakMap,o=new Nt,a=[];for(let u=0;u<8;u++)a[u]=[u,0];function l(u,h,d){const p=u.morphTargetInfluences;if(e.isWebGL2===!0){const y=h.morphAttributes.position||h.morphAttributes.normal||h.morphAttributes.color,M=y!==void 0?y.length:0;let _=s.get(h);if(_===void 0||_.count!==M){let Y=function(){X.dispose(),s.delete(h),h.removeEventListener("dispose",Y)};var m=Y;_!==void 0&&_.texture.dispose();const S=h.morphAttributes.position!==void 0,E=h.morphAttributes.normal!==void 0,C=h.morphAttributes.color!==void 0,b=h.morphAttributes.position||[],P=h.morphAttributes.normal||[],B=h.morphAttributes.color||[];let R=0;S===!0&&(R=1),E===!0&&(R=2),C===!0&&(R=3);let L=h.attributes.position.count*R,z=1;L>e.maxTextureSize&&(z=Math.ceil(L/e.maxTextureSize),L=e.maxTextureSize);const $=new Float32Array(L*z*4*M),X=new Lg($,L,z,M);X.type=ls,X.needsUpdate=!0;const Q=R*4;for(let ne=0;ne<M;ne++){const ee=b[ne],I=P[ne],V=B[ne],H=L*z*4*ne;for(let U=0;U<ee.count;U++){const W=U*Q;S===!0&&(o.fromBufferAttribute(ee,U),$[H+W+0]=o.x,$[H+W+1]=o.y,$[H+W+2]=o.z,$[H+W+3]=0),E===!0&&(o.fromBufferAttribute(I,U),$[H+W+4]=o.x,$[H+W+5]=o.y,$[H+W+6]=o.z,$[H+W+7]=0),C===!0&&(o.fromBufferAttribute(V,U),$[H+W+8]=o.x,$[H+W+9]=o.y,$[H+W+10]=o.z,$[H+W+11]=V.itemSize===4?o.w:1)}}_={count:M,texture:X,size:new ge(L,z)},s.set(h,_),h.addEventListener("dispose",Y)}let g=0;for(let S=0;S<p.length;S++)g+=p[S];const x=h.morphTargetsRelative?1:1-g;d.getUniforms().setValue(n,"morphTargetBaseInfluence",x),d.getUniforms().setValue(n,"morphTargetInfluences",p),d.getUniforms().setValue(n,"morphTargetsTexture",_.texture,t),d.getUniforms().setValue(n,"morphTargetsTextureSize",_.size)}else{const y=p===void 0?0:p.length;let M=i[h.id];if(M===void 0||M.length!==y){M=[];for(let E=0;E<y;E++)M[E]=[E,0];i[h.id]=M}for(let E=0;E<y;E++){const C=M[E];C[0]=E,C[1]=p[E]}M.sort(Sz);for(let E=0;E<8;E++)E<y&&M[E][1]?(a[E][0]=M[E][0],a[E][1]=M[E][1]):(a[E][0]=Number.MAX_SAFE_INTEGER,a[E][1]=0);a.sort(Az);const _=h.morphAttributes.position,g=h.morphAttributes.normal;let x=0;for(let E=0;E<8;E++){const C=a[E],b=C[0],P=C[1];b!==Number.MAX_SAFE_INTEGER&&P?(_&&h.getAttribute("morphTarget"+E)!==_[b]&&h.setAttribute("morphTarget"+E,_[b]),g&&h.getAttribute("morphNormal"+E)!==g[b]&&h.setAttribute("morphNormal"+E,g[b]),r[E]=P,x+=P):(_&&h.hasAttribute("morphTarget"+E)===!0&&h.deleteAttribute("morphTarget"+E),g&&h.hasAttribute("morphNormal"+E)===!0&&h.deleteAttribute("morphNormal"+E),r[E]=0)}const S=h.morphTargetsRelative?1:1-x;d.getUniforms().setValue(n,"morphTargetBaseInfluence",S),d.getUniforms().setValue(n,"morphTargetInfluences",r)}}return{update:l}}function Ez(n,e,t,i){let r=new WeakMap;function s(l){const u=i.render.frame,h=l.geometry,d=e.get(l,h);if(r.get(d)!==u&&(e.update(d),r.set(d,u)),l.isInstancedMesh&&(l.hasEventListener("dispose",a)===!1&&l.addEventListener("dispose",a),r.get(l)!==u&&(t.update(l.instanceMatrix,n.ARRAY_BUFFER),l.instanceColor!==null&&t.update(l.instanceColor,n.ARRAY_BUFFER),r.set(l,u))),l.isSkinnedMesh){const p=l.skeleton;r.get(p)!==u&&(p.update(),r.set(p,u))}return d}function o(){r=new WeakMap}function a(l){const u=l.target;u.removeEventListener("dispose",a),t.remove(u.instanceMatrix),u.instanceColor!==null&&t.remove(u.instanceColor)}return{update:s,dispose:o}}const f2=new $t,h2=new Lg,d2=new xS,p2=new Th,Gw=[],Vw=[],Ww=new Float32Array(16),jw=new Float32Array(9),Xw=new Float32Array(4);function fu(n,e,t){const i=n[0];if(i<=0||i>0)return n;const r=e*t;let s=Gw[r];if(s===void 0&&(s=new Float32Array(r),Gw[r]=s),e!==0){i.toArray(s,0);for(let o=1,a=0;o!==e;++o)a+=t,n[o].toArray(s,a)}return s}function In(n,e){if(n.length!==e.length)return!1;for(let t=0,i=n.length;t<i;t++)if(n[t]!==e[t])return!1;return!0}function Dn(n,e){for(let t=0,i=e.length;t<i;t++)n[t]=e[t]}function Dg(n,e){let t=Vw[e];t===void 0&&(t=new Int32Array(e),Vw[e]=t);for(let i=0;i!==e;++i)t[i]=n.allocateTextureUnit();return t}function wz(n,e){const t=this.cache;t[0]!==e&&(n.uniform1f(this.addr,e),t[0]=e)}function Tz(n,e){const t=this.cache;if(e.x!==void 0)(t[0]!==e.x||t[1]!==e.y)&&(n.uniform2f(this.addr,e.x,e.y),t[0]=e.x,t[1]=e.y);else{if(In(t,e))return;n.uniform2fv(this.addr,e),Dn(t,e)}}function Cz(n,e){const t=this.cache;if(e.x!==void 0)(t[0]!==e.x||t[1]!==e.y||t[2]!==e.z)&&(n.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)&&(n.uniform3f(this.addr,e.r,e.g,e.b),t[0]=e.r,t[1]=e.g,t[2]=e.b);else{if(In(t,e))return;n.uniform3fv(this.addr,e),Dn(t,e)}}function bz(n,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)&&(n.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(In(t,e))return;n.uniform4fv(this.addr,e),Dn(t,e)}}function Rz(n,e){const t=this.cache,i=e.elements;if(i===void 0){if(In(t,e))return;n.uniformMatrix2fv(this.addr,!1,e),Dn(t,e)}else{if(In(t,i))return;Xw.set(i),n.uniformMatrix2fv(this.addr,!1,Xw),Dn(t,i)}}function Pz(n,e){const t=this.cache,i=e.elements;if(i===void 0){if(In(t,e))return;n.uniformMatrix3fv(this.addr,!1,e),Dn(t,e)}else{if(In(t,i))return;jw.set(i),n.uniformMatrix3fv(this.addr,!1,jw),Dn(t,i)}}function Bz(n,e){const t=this.cache,i=e.elements;if(i===void 0){if(In(t,e))return;n.uniformMatrix4fv(this.addr,!1,e),Dn(t,e)}else{if(In(t,i))return;Ww.set(i),n.uniformMatrix4fv(this.addr,!1,Ww),Dn(t,i)}}function Lz(n,e){const t=this.cache;t[0]!==e&&(n.uniform1i(this.addr,e),t[0]=e)}function Iz(n,e){const t=this.cache;if(e.x!==void 0)(t[0]!==e.x||t[1]!==e.y)&&(n.uniform2i(this.addr,e.x,e.y),t[0]=e.x,t[1]=e.y);else{if(In(t,e))return;n.uniform2iv(this.addr,e),Dn(t,e)}}function Dz(n,e){const t=this.cache;if(e.x!==void 0)(t[0]!==e.x||t[1]!==e.y||t[2]!==e.z)&&(n.uniform3i(this.addr,e.x,e.y,e.z),t[0]=e.x,t[1]=e.y,t[2]=e.z);else{if(In(t,e))return;n.uniform3iv(this.addr,e),Dn(t,e)}}function Fz(n,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)&&(n.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(In(t,e))return;n.uniform4iv(this.addr,e),Dn(t,e)}}function Nz(n,e){const t=this.cache;t[0]!==e&&(n.uniform1ui(this.addr,e),t[0]=e)}function Oz(n,e){const t=this.cache;if(e.x!==void 0)(t[0]!==e.x||t[1]!==e.y)&&(n.uniform2ui(this.addr,e.x,e.y),t[0]=e.x,t[1]=e.y);else{if(In(t,e))return;n.uniform2uiv(this.addr,e),Dn(t,e)}}function Uz(n,e){const t=this.cache;if(e.x!==void 0)(t[0]!==e.x||t[1]!==e.y||t[2]!==e.z)&&(n.uniform3ui(this.addr,e.x,e.y,e.z),t[0]=e.x,t[1]=e.y,t[2]=e.z);else{if(In(t,e))return;n.uniform3uiv(this.addr,e),Dn(t,e)}}function kz(n,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)&&(n.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(In(t,e))return;n.uniform4uiv(this.addr,e),Dn(t,e)}}function Hz(n,e,t){const i=this.cache,r=t.allocateTextureUnit();i[0]!==r&&(n.uniform1i(this.addr,r),i[0]=r),t.setTexture2D(e||f2,r)}function zz(n,e,t){const i=this.cache,r=t.allocateTextureUnit();i[0]!==r&&(n.uniform1i(this.addr,r),i[0]=r),t.setTexture3D(e||d2,r)}function Gz(n,e,t){const i=this.cache,r=t.allocateTextureUnit();i[0]!==r&&(n.uniform1i(this.addr,r),i[0]=r),t.setTextureCube(e||p2,r)}function Vz(n,e,t){const i=this.cache,r=t.allocateTextureUnit();i[0]!==r&&(n.uniform1i(this.addr,r),i[0]=r),t.setTexture2DArray(e||h2,r)}function Wz(n){switch(n){case 5126:return wz;case 35664:return Tz;case 35665:return Cz;case 35666:return bz;case 35674:return Rz;case 35675:return Pz;case 35676:return Bz;case 5124:case 35670:return Lz;case 35667:case 35671:return Iz;case 35668:case 35672:return Dz;case 35669:case 35673:return Fz;case 5125:return Nz;case 36294:return Oz;case 36295:return Uz;case 36296:return kz;case 35678:case 36198:case 36298:case 36306:case 35682:return Hz;case 35679:case 36299:case 36307:return zz;case 35680:case 36300:case 36308:case 36293:return Gz;case 36289:case 36303:case 36311:case 36292:return Vz}}function jz(n,e){n.uniform1fv(this.addr,e)}function Xz(n,e){const t=fu(e,this.size,2);n.uniform2fv(this.addr,t)}function Jz(n,e){const t=fu(e,this.size,3);n.uniform3fv(this.addr,t)}function Kz(n,e){const t=fu(e,this.size,4);n.uniform4fv(this.addr,t)}function Yz(n,e){const t=fu(e,this.size,4);n.uniformMatrix2fv(this.addr,!1,t)}function Qz(n,e){const t=fu(e,this.size,9);n.uniformMatrix3fv(this.addr,!1,t)}function Zz(n,e){const t=fu(e,this.size,16);n.uniformMatrix4fv(this.addr,!1,t)}function qz(n,e){n.uniform1iv(this.addr,e)}function $z(n,e){n.uniform2iv(this.addr,e)}function eG(n,e){n.uniform3iv(this.addr,e)}function tG(n,e){n.uniform4iv(this.addr,e)}function nG(n,e){n.uniform1uiv(this.addr,e)}function iG(n,e){n.uniform2uiv(this.addr,e)}function rG(n,e){n.uniform3uiv(this.addr,e)}function sG(n,e){n.uniform4uiv(this.addr,e)}function oG(n,e,t){const i=this.cache,r=e.length,s=Dg(t,r);In(i,s)||(n.uniform1iv(this.addr,s),Dn(i,s));for(let o=0;o!==r;++o)t.setTexture2D(e[o]||f2,s[o])}function aG(n,e,t){const i=this.cache,r=e.length,s=Dg(t,r);In(i,s)||(n.uniform1iv(this.addr,s),Dn(i,s));for(let o=0;o!==r;++o)t.setTexture3D(e[o]||d2,s[o])}function lG(n,e,t){const i=this.cache,r=e.length,s=Dg(t,r);In(i,s)||(n.uniform1iv(this.addr,s),Dn(i,s));for(let o=0;o!==r;++o)t.setTextureCube(e[o]||p2,s[o])}function cG(n,e,t){const i=this.cache,r=e.length,s=Dg(t,r);In(i,s)||(n.uniform1iv(this.addr,s),Dn(i,s));for(let o=0;o!==r;++o)t.setTexture2DArray(e[o]||h2,s[o])}function uG(n){switch(n){case 5126:return jz;case 35664:return Xz;case 35665:return Jz;case 35666:return Kz;case 35674:return Yz;case 35675:return Qz;case 35676:return Zz;case 5124:case 35670:return qz;case 35667:case 35671:return $z;case 35668:case 35672:return eG;case 35669:case 35673:return tG;case 5125:return nG;case 36294:return iG;case 36295:return rG;case 36296:return sG;case 35678:case 36198:case 36298:case 36306:case 35682:return oG;case 35679:case 36299:case 36307:return aG;case 35680:case 36300:case 36308:case 36293:return lG;case 36289:case 36303:case 36311:case 36292:return cG}}class fG{constructor(e,t,i){this.id=e,this.addr=i,this.cache=[],this.setValue=Wz(t.type)}}class hG{constructor(e,t,i){this.id=e,this.addr=i,this.cache=[],this.size=t.size,this.setValue=uG(t.type)}}class dG{constructor(e){this.id=e,this.seq=[],this.map={}}setValue(e,t,i){const r=this.seq;for(let s=0,o=r.length;s!==o;++s){const a=r[s];a.setValue(e,t[a.id],i)}}}const cy=/(\w+)(\])?(\[|\.)?/g;function Jw(n,e){n.seq.push(e),n.map[e.id]=e}function pG(n,e,t){const i=n.name,r=i.length;for(cy.lastIndex=0;;){const s=cy.exec(i),o=cy.lastIndex;let a=s[1];const l=s[2]==="]",u=s[3];if(l&&(a=a|0),u===void 0||u==="["&&o+2===r){Jw(t,u===void 0?new fG(a,n,e):new hG(a,n,e));break}else{let d=t.map[a];d===void 0&&(d=new dG(a),Jw(t,d)),t=d}}}class ym{constructor(e,t){this.seq=[],this.map={};const i=e.getProgramParameter(t,e.ACTIVE_UNIFORMS);for(let r=0;r<i;++r){const s=e.getActiveUniform(t,r),o=e.getUniformLocation(t,s.name);pG(s,o,this)}}setValue(e,t,i,r){const s=this.map[t];s!==void 0&&s.setValue(e,i,r)}setOptional(e,t,i){const r=t[i];r!==void 0&&this.setValue(e,i,r)}static upload(e,t,i,r){for(let s=0,o=t.length;s!==o;++s){const a=t[s],l=i[a.id];l.needsUpdate!==!1&&a.setValue(e,l.value,r)}}static seqWithValue(e,t){const i=[];for(let r=0,s=e.length;r!==s;++r){const o=e[r];o.id in t&&i.push(o)}return i}}function Kw(n,e,t){const i=n.createShader(e);return n.shaderSource(i,t),n.compileShader(i),i}let mG=0;function gG(n,e){const t=n.split(`
`),i=[],r=Math.max(e-6,0),s=Math.min(e+6,t.length);for(let o=r;o<s;o++){const a=o+1;i.push(`${a===e?">":" "} ${a}: ${t[o]}`)}return i.join(`
`)}function vG(n){switch(n){case Vr:return["Linear","( value )"];case mt:return["sRGB","( value )"];default:return console.warn("THREE.WebGLProgram: Unsupported color space:",n),["Linear","( value )"]}}function Yw(n,e,t){const i=n.getShaderParameter(e,n.COMPILE_STATUS),r=n.getShaderInfoLog(e).trim();if(i&&r==="")return"";const s=/ERROR: 0:(\d+)/.exec(r);if(s){const o=parseInt(s[1]);return t.toUpperCase()+`

`+r+`

`+gG(n.getShaderSource(e),o)}else return r}function yG(n,e){const t=vG(e);return"vec4 "+n+"( vec4 value ) { return LinearTo"+t[0]+t[1]+"; }"}function xG(n,e){let t;switch(e){case RB:t="Linear";break;case PB:t="Reinhard";break;case BB:t="OptimizedCineon";break;case oS:t="ACESFilmic";break;case LB:t="Custom";break;default:console.warn("THREE.WebGLProgram: Unsupported toneMapping:",e),t="Linear"}return"vec3 "+n+"( vec3 color ) { return "+t+"ToneMapping( color ); }"}function _G(n){return[n.extensionDerivatives||n.envMapCubeUVHeight||n.bumpMap||n.normalMapTangentSpace||n.clearcoatNormalMap||n.flatShading||n.shaderID==="physical"?"#extension GL_OES_standard_derivatives : enable":"",(n.extensionFragDepth||n.logarithmicDepthBuffer)&&n.rendererExtensionFragDepth?"#extension GL_EXT_frag_depth : enable":"",n.extensionDrawBuffers&&n.rendererExtensionDrawBuffers?"#extension GL_EXT_draw_buffers : require":"",(n.extensionShaderTextureLOD||n.envMap||n.transmission)&&n.rendererExtensionShaderTextureLod?"#extension GL_EXT_shader_texture_lod : enable":""].filter(mf).join(`
`)}function AG(n){const e=[];for(const t in n){const i=n[t];i!==!1&&e.push("#define "+t+" "+i)}return e.join(`
`)}function SG(n,e){const t={},i=n.getProgramParameter(e,n.ACTIVE_ATTRIBUTES);for(let r=0;r<i;r++){const s=n.getActiveAttrib(e,r),o=s.name;let a=1;s.type===n.FLOAT_MAT2&&(a=2),s.type===n.FLOAT_MAT3&&(a=3),s.type===n.FLOAT_MAT4&&(a=4),t[o]={type:s.type,location:n.getAttribLocation(e,o),locationSize:a}}return t}function mf(n){return n!==""}function Qw(n,e){const t=e.numSpotLightShadows+e.numSpotLightMaps-e.numSpotLightShadowsWithMaps;return n.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 Zw(n,e){return n.replace(/NUM_CLIPPING_PLANES/g,e.numClippingPlanes).replace(/UNION_CLIPPING_PLANES/g,e.numClippingPlanes-e.numClipIntersection)}const MG=/^[ \t]*#include +<([\w\d./]+)>/gm;function P_(n){return n.replace(MG,wG)}const EG=new Map([["encodings_fragment","colorspace_fragment"],["encodings_pars_fragment","colorspace_pars_fragment"],["output_fragment","opaque_fragment"]]);function wG(n,e){let t=yt[e];if(t===void 0){const i=EG.get(e);if(i!==void 0)t=yt[i],console.warn('THREE.WebGLRenderer: Shader chunk "%s" has been deprecated. Use "%s" instead.',e,i);else throw new Error("Can not resolve #include <"+e+">")}return P_(t)}const TG=/#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 qw(n){return n.replace(TG,CG)}function CG(n,e,t,i){let r="";for(let s=parseInt(e);s<parseInt(t);s++)r+=i.replace(/\[\s*i\s*\]/g,"[ "+s+" ]").replace(/UNROLLED_LOOP_INDEX/g,s);return r}function $w(n){let e="precision "+n.precision+` float;
precision `+n.precision+" int;";return n.precision==="highp"?e+=`
#define HIGH_PRECISION`:n.precision==="mediump"?e+=`
#define MEDIUM_PRECISION`:n.precision==="lowp"&&(e+=`
#define LOW_PRECISION`),e}function bG(n){let e="SHADOWMAP_TYPE_BASIC";return n.shadowMapType===Cg?e="SHADOWMAP_TYPE_PCF":n.shadowMapType===Tf?e="SHADOWMAP_TYPE_PCF_SOFT":n.shadowMapType===Lr&&(e="SHADOWMAP_TYPE_VSM"),e}function RG(n){let e="ENVMAP_TYPE_CUBE";if(n.envMap)switch(n.envMapMode){case Xo:case Jo:e="ENVMAP_TYPE_CUBE";break;case cu:e="ENVMAP_TYPE_CUBE_UV";break}return e}function PG(n){let e="ENVMAP_MODE_REFLECTION";if(n.envMap)switch(n.envMapMode){case Jo:e="ENVMAP_MODE_REFRACTION";break}return e}function BG(n){let e="ENVMAP_BLENDING_NONE";if(n.envMap)switch(n.combine){case Mh:e="ENVMAP_BLENDING_MULTIPLY";break;case CB:e="ENVMAP_BLENDING_MIX";break;case bB:e="ENVMAP_BLENDING_ADD";break}return e}function LG(n){const e=n.envMapCubeUVHeight;if(e===null)return null;const t=Math.log2(e)-2,i=1/e;return{texelWidth:1/(3*Math.max(Math.pow(2,t),7*16)),texelHeight:i,maxMip:t}}function IG(n,e,t,i){const r=n.getContext(),s=t.defines;let o=t.vertexShader,a=t.fragmentShader;const l=bG(t),u=RG(t),h=PG(t),d=BG(t),p=LG(t),m=t.isWebGL2?"":_G(t),y=AG(s),M=r.createProgram();let _,g,x=t.glslVersion?"#version "+t.glslVersion+`
`:"";t.isRawShaderMaterial?(_=["#define SHADER_TYPE "+t.shaderType,"#define SHADER_NAME "+t.shaderName,y].filter(mf).join(`
`),_.length>0&&(_+=`
`),g=[m,"#define SHADER_TYPE "+t.shaderType,"#define SHADER_NAME "+t.shaderName,y].filter(mf).join(`
`),g.length>0&&(g+=`
`)):(_=[$w(t),"#define SHADER_TYPE "+t.shaderType,"#define SHADER_NAME "+t.shaderName,y,t.instancing?"#define USE_INSTANCING":"",t.instancingColor?"#define USE_INSTANCING_COLOR":"",t.useFog&&t.fog?"#define USE_FOG":"",t.useFog&&t.fogExp2?"#define FOG_EXP2":"",t.map?"#define USE_MAP":"",t.envMap?"#define USE_ENVMAP":"",t.envMap?"#define "+h:"",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.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&&t.isWebGL2?"#define USE_MORPHCOLORS":"",t.morphTargetsCount>0&&t.isWebGL2?"#define MORPHTARGETS_TEXTURE":"",t.morphTargetsCount>0&&t.isWebGL2?"#define MORPHTARGETS_TEXTURE_STRIDE "+t.morphTextureStride:"",t.morphTargetsCount>0&&t.isWebGL2?"#define MORPHTARGETS_COUNT "+t.morphTargetsCount:"",t.doubleSided?"#define DOUBLE_SIDED":"",t.flipSided?"#define FLIP_SIDED":"",t.shadowMapEnabled?"#define USE_SHADOWMAP":"",t.shadowMapEnabled?"#define "+l:"",t.sizeAttenuation?"#define USE_SIZEATTENUATION":"",t.useLegacyLights?"#define LEGACY_LIGHTS":"",t.logarithmicDepthBuffer?"#define USE_LOGDEPTHBUF":"",t.logarithmicDepthBuffer&&t.rendererExtensionFragDepth?"#define USE_LOGDEPTHBUF_EXT":"","uniform mat4 modelMatrix;","uniform mat4 modelViewMatrix;","uniform mat4 projectionMatrix;","uniform mat4 viewMatrix;","uniform mat3 normalMatrix;","uniform vec3 cameraPosition;","uniform bool isOrthographic;","#ifdef USE_INSTANCING","	attribute mat4 instanceMatrix;","#endif","#ifdef USE_INSTANCING_COLOR","	attribute vec3 instanceColor;","#endif","attribute vec3 position;","attribute vec3 normal;","attribute vec2 uv;","#ifdef USE_UV1","	attribute vec2 uv1;","#endif","#ifdef USE_UV2","	attribute vec2 uv2;","#endif","#ifdef USE_UV3","	attribute vec2 uv3;","#endif","#ifdef USE_TANGENT","	attribute vec4 tangent;","#endif","#if defined( USE_COLOR_ALPHA )","	attribute vec4 color;","#elif defined( USE_COLOR )","	attribute vec3 color;","#endif","#if ( defined( USE_MORPHTARGETS ) && ! defined( MORPHTARGETS_TEXTURE ) )","	attribute vec3 morphTarget0;","	attribute vec3 morphTarget1;","	attribute vec3 morphTarget2;","	attribute vec3 morphTarget3;","	#ifdef USE_MORPHNORMALS","		attribute vec3 morphNormal0;","		attribute vec3 morphNormal1;","		attribute vec3 morphNormal2;","		attribute vec3 morphNormal3;","	#else","		attribute vec3 morphTarget4;","		attribute vec3 morphTarget5;","		attribute vec3 morphTarget6;","		attribute vec3 morphTarget7;","	#endif","#endif","#ifdef USE_SKINNING","	attribute vec4 skinIndex;","	attribute vec4 skinWeight;","#endif",`
`].filter(mf).join(`
`),g=[m,$w(t),"#define SHADER_TYPE "+t.shaderType,"#define SHADER_NAME "+t.shaderName,y,t.useFog&&t.fog?"#define USE_FOG":"",t.useFog&&t.fogExp2?"#define FOG_EXP2":"",t.map?"#define USE_MAP":"",t.matcap?"#define USE_MATCAP":"",t.envMap?"#define USE_ENVMAP":"",t.envMap?"#define "+u:"",t.envMap?"#define "+h:"",t.envMap?"#define "+d:"",p?"#define CUBEUV_TEXEL_WIDTH "+p.texelWidth:"",p?"#define CUBEUV_TEXEL_HEIGHT "+p.texelHeight:"",p?"#define CUBEUV_MAX_MIP "+p.maxMip+".0":"",t.lightMap?"#define USE_LIGHTMAP":"",t.aoMap?"#define USE_AOMAP":"",t.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.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?"#define USE_COLOR":"",t.vertexAlphas?"#define USE_COLOR_ALPHA":"",t.vertexUv1s?"#define USE_UV1":"",t.vertexUv2s?"#define USE_UV2":"",t.vertexUv3s?"#define USE_UV3":"",t.pointsUvs?"#define USE_POINTS_UV":"",t.gradientMap?"#define USE_GRADIENTMAP":"",t.flatShading?"#define FLAT_SHADED":"",t.doubleSided?"#define DOUBLE_SIDED":"",t.flipSided?"#define FLIP_SIDED":"",t.shadowMapEnabled?"#define USE_SHADOWMAP":"",t.shadowMapEnabled?"#define "+l:"",t.premultipliedAlpha?"#define PREMULTIPLIED_ALPHA":"",t.useLegacyLights?"#define LEGACY_LIGHTS":"",t.logarithmicDepthBuffer?"#define USE_LOGDEPTHBUF":"",t.logarithmicDepthBuffer&&t.rendererExtensionFragDepth?"#define USE_LOGDEPTHBUF_EXT":"","uniform mat4 viewMatrix;","uniform vec3 cameraPosition;","uniform bool isOrthographic;",t.toneMapping!==Hr?"#define TONE_MAPPING":"",t.toneMapping!==Hr?yt.tonemapping_pars_fragment:"",t.toneMapping!==Hr?xG("toneMapping",t.toneMapping):"",t.dithering?"#define DITHERING":"",t.opaque?"#define OPAQUE":"",yt.colorspace_pars_fragment,yG("linearToOutputTexel",t.outputColorSpace),t.useDepthPacking?"#define DEPTH_PACKING "+t.depthPacking:"",`
`].filter(mf).join(`
`)),o=P_(o),o=Qw(o,t),o=Zw(o,t),a=P_(a),a=Qw(a,t),a=Zw(a,t),o=qw(o),a=qw(a),t.isWebGL2&&t.isRawShaderMaterial!==!0&&(x=`#version 300 es
`,_=["precision mediump sampler2DArray;","#define attribute in","#define varying out","#define texture2D texture"].join(`
`)+`
`+_,g=["#define varying in",t.glslVersion===C_?"":"layout(location = 0) out highp vec4 pc_fragColor;",t.glslVersion===C_?"":"#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(`
`)+`
`+g);const S=x+_+o,E=x+g+a,C=Kw(r,r.VERTEX_SHADER,S),b=Kw(r,r.FRAGMENT_SHADER,E);if(r.attachShader(M,C),r.attachShader(M,b),t.index0AttributeName!==void 0?r.bindAttribLocation(M,0,t.index0AttributeName):t.morphTargets===!0&&r.bindAttribLocation(M,0,"position"),r.linkProgram(M),n.debug.checkShaderErrors){const R=r.getProgramInfoLog(M).trim(),L=r.getShaderInfoLog(C).trim(),z=r.getShaderInfoLog(b).trim();let $=!0,X=!0;if(r.getProgramParameter(M,r.LINK_STATUS)===!1)if($=!1,typeof n.debug.onShaderError=="function")n.debug.onShaderError(r,M,C,b);else{const Q=Yw(r,C,"vertex"),Y=Yw(r,b,"fragment");console.error("THREE.WebGLProgram: Shader Error "+r.getError()+" - VALIDATE_STATUS "+r.getProgramParameter(M,r.VALIDATE_STATUS)+`

Program Info Log: `+R+`
`+Q+`
`+Y)}else R!==""?console.warn("THREE.WebGLProgram: Program Info Log:",R):(L===""||z==="")&&(X=!1);X&&(this.diagnostics={runnable:$,programLog:R,vertexShader:{log:L,prefix:_},fragmentShader:{log:z,prefix:g}})}r.deleteShader(C),r.deleteShader(b);let P;this.getUniforms=function(){return P===void 0&&(P=new ym(r,M)),P};let B;return this.getAttributes=function(){return B===void 0&&(B=SG(r,M)),B},this.destroy=function(){i.releaseStatesOfProgram(this),r.deleteProgram(M),this.program=void 0},this.type=t.shaderType,this.name=t.shaderName,this.id=mG++,this.cacheKey=e,this.usedTimes=1,this.program=M,this.vertexShader=C,this.fragmentShader=b,this}let DG=0;class FG{constructor(){this.shaderCache=new Map,this.materialCache=new Map}update(e){const t=e.vertexShader,i=e.fragmentShader,r=this._getShaderStage(t),s=this._getShaderStage(i),o=this._getShaderCacheForMaterial(e);return o.has(r)===!1&&(o.add(r),r.usedTimes++),o.has(s)===!1&&(o.add(s),s.usedTimes++),this}remove(e){const t=this.materialCache.get(e);for(const i of t)i.usedTimes--,i.usedTimes===0&&this.shaderCache.delete(i.code);return this.materialCache.delete(e),this}getVertexShaderID(e){return this._getShaderStage(e.vertexShader).id}getFragmentShaderID(e){return this._getShaderStage(e.fragmentShader).id}dispose(){this.shaderCache.clear(),this.materialCache.clear()}_getShaderCacheForMaterial(e){const t=this.materialCache;let i=t.get(e);return i===void 0&&(i=new Set,t.set(e,i)),i}_getShaderStage(e){const t=this.shaderCache;let i=t.get(e);return i===void 0&&(i=new NG(e),t.set(e,i)),i}}class NG{constructor(e){this.id=DG++,this.code=e,this.usedTimes=0}}function OG(n,e,t,i,r,s,o){const a=new Za,l=new FG,u=[],h=r.isWebGL2,d=r.logarithmicDepthBuffer,p=r.vertexTextures;let m=r.precision;const y={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 M(R){return R===0?"uv":`uv${R}`}function _(R,L,z,$,X){const Q=$.fog,Y=X.geometry,ne=R.isMeshStandardMaterial?$.environment:null,ee=(R.isMeshStandardMaterial?t:e).get(R.envMap||ne),I=ee&&ee.mapping===cu?ee.image.height:null,V=y[R.type];R.precision!==null&&(m=r.getMaxPrecision(R.precision),m!==R.precision&&console.warn("THREE.WebGLProgram.getParameters:",R.precision,"not supported, using",m,"instead."));const H=Y.morphAttributes.position||Y.morphAttributes.normal||Y.morphAttributes.color,U=H!==void 0?H.length:0;let W=0;Y.morphAttributes.position!==void 0&&(W=1),Y.morphAttributes.normal!==void 0&&(W=2),Y.morphAttributes.color!==void 0&&(W=3);let ve,ue,Ae,Ee;if(V){const Li=Fr[V];ve=Li.vertexShader,ue=Li.fragmentShader}else ve=R.vertexShader,ue=R.fragmentShader,l.update(R),Ae=l.getVertexShaderID(R),Ee=l.getFragmentShaderID(R);const Ne=n.getRenderTarget(),We=X.isInstancedMesh===!0,ct=!!R.map,tt=!!R.matcap,Se=!!ee,G=!!R.aoMap,ye=!!R.lightMap,pe=!!R.bumpMap,Me=!!R.normalMap,xe=!!R.displacementMap,Ve=!!R.emissiveMap,Ue=!!R.metalnessMap,Ge=!!R.roughnessMap,qe=R.anisotropy>0,vt=R.clearcoat>0,Ut=R.iridescence>0,k=R.sheen>0,D=R.transmission>0,le=qe&&!!R.anisotropyMap,we=vt&&!!R.clearcoatMap,_e=vt&&!!R.clearcoatNormalMap,De=vt&&!!R.clearcoatRoughnessMap,Ke=Ut&&!!R.iridescenceMap,Le=Ut&&!!R.iridescenceThicknessMap,he=k&&!!R.sheenColorMap,j=k&&!!R.sheenRoughnessMap,fe=!!R.specularMap,Te=!!R.specularColorMap,be=!!R.specularIntensityMap,Ie=D&&!!R.transmissionMap,nt=D&&!!R.thicknessMap,Rt=!!R.gradientMap,K=!!R.alphaMap,Pe=R.alphaTest>0,oe=!!R.alphaHash,Be=!!R.extensions,He=!!Y.attributes.uv1,wt=!!Y.attributes.uv2,Gt=!!Y.attributes.uv3;return{isWebGL2:h,shaderID:V,shaderType:R.type,shaderName:R.name,vertexShader:ve,fragmentShader:ue,defines:R.defines,customVertexShaderID:Ae,customFragmentShaderID:Ee,isRawShaderMaterial:R.isRawShaderMaterial===!0,glslVersion:R.glslVersion,precision:m,instancing:We,instancingColor:We&&X.instanceColor!==null,supportsVertexTextures:p,outputColorSpace:Ne===null?n.outputColorSpace:Ne.isXRRenderTarget===!0?Ne.texture.colorSpace:Vr,map:ct,matcap:tt,envMap:Se,envMapMode:Se&&ee.mapping,envMapCubeUVHeight:I,aoMap:G,lightMap:ye,bumpMap:pe,normalMap:Me,displacementMap:p&&xe,emissiveMap:Ve,normalMapObjectSpace:Me&&R.normalMapType===KB,normalMapTangentSpace:Me&&R.normalMapType===na,metalnessMap:Ue,roughnessMap:Ge,anisotropy:qe,anisotropyMap:le,clearcoat:vt,clearcoatMap:we,clearcoatNormalMap:_e,clearcoatRoughnessMap:De,iridescence:Ut,iridescenceMap:Ke,iridescenceThicknessMap:Le,sheen:k,sheenColorMap:he,sheenRoughnessMap:j,specularMap:fe,specularColorMap:Te,specularIntensityMap:be,transmission:D,transmissionMap:Ie,thicknessMap:nt,gradientMap:Rt,opaque:R.transparent===!1&&R.blending===Ka,alphaMap:K,alphaTest:Pe,alphaHash:oe,combine:R.combine,mapUv:ct&&M(R.map.channel),aoMapUv:G&&M(R.aoMap.channel),lightMapUv:ye&&M(R.lightMap.channel),bumpMapUv:pe&&M(R.bumpMap.channel),normalMapUv:Me&&M(R.normalMap.channel),displacementMapUv:xe&&M(R.displacementMap.channel),emissiveMapUv:Ve&&M(R.emissiveMap.channel),metalnessMapUv:Ue&&M(R.metalnessMap.channel),roughnessMapUv:Ge&&M(R.roughnessMap.channel),anisotropyMapUv:le&&M(R.anisotropyMap.channel),clearcoatMapUv:we&&M(R.clearcoatMap.channel),clearcoatNormalMapUv:_e&&M(R.clearcoatNormalMap.channel),clearcoatRoughnessMapUv:De&&M(R.clearcoatRoughnessMap.channel),iridescenceMapUv:Ke&&M(R.iridescenceMap.channel),iridescenceThicknessMapUv:Le&&M(R.iridescenceThicknessMap.channel),sheenColorMapUv:he&&M(R.sheenColorMap.channel),sheenRoughnessMapUv:j&&M(R.sheenRoughnessMap.channel),specularMapUv:fe&&M(R.specularMap.channel),specularColorMapUv:Te&&M(R.specularColorMap.channel),specularIntensityMapUv:be&&M(R.specularIntensityMap.channel),transmissionMapUv:Ie&&M(R.transmissionMap.channel),thicknessMapUv:nt&&M(R.thicknessMap.channel),alphaMapUv:K&&M(R.alphaMap.channel),vertexTangents:!!Y.attributes.tangent&&(Me||qe),vertexColors:R.vertexColors,vertexAlphas:R.vertexColors===!0&&!!Y.attributes.color&&Y.attributes.color.itemSize===4,vertexUv1s:He,vertexUv2s:wt,vertexUv3s:Gt,pointsUvs:X.isPoints===!0&&!!Y.attributes.uv&&(ct||K),fog:!!Q,useFog:R.fog===!0,fogExp2:Q&&Q.isFogExp2,flatShading:R.flatShading===!0,sizeAttenuation:R.sizeAttenuation===!0,logarithmicDepthBuffer:d,skinning:X.isSkinnedMesh===!0,morphTargets:Y.morphAttributes.position!==void 0,morphNormals:Y.morphAttributes.normal!==void 0,morphColors:Y.morphAttributes.color!==void 0,morphTargetsCount:U,morphTextureStride:W,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,numClippingPlanes:o.numPlanes,numClipIntersection:o.numIntersection,dithering:R.dithering,shadowMapEnabled:n.shadowMap.enabled&&z.length>0,shadowMapType:n.shadowMap.type,toneMapping:R.toneMapped?n.toneMapping:Hr,useLegacyLights:n.useLegacyLights,premultipliedAlpha:R.premultipliedAlpha,doubleSided:R.side===vr,flipSided:R.side===vi,useDepthPacking:R.depthPacking>=0,depthPacking:R.depthPacking||0,index0AttributeName:R.index0AttributeName,extensionDerivatives:Be&&R.extensions.derivatives===!0,extensionFragDepth:Be&&R.extensions.fragDepth===!0,extensionDrawBuffers:Be&&R.extensions.drawBuffers===!0,extensionShaderTextureLOD:Be&&R.extensions.shaderTextureLOD===!0,rendererExtensionFragDepth:h||i.has("EXT_frag_depth"),rendererExtensionDrawBuffers:h||i.has("WEBGL_draw_buffers"),rendererExtensionShaderTextureLod:h||i.has("EXT_shader_texture_lod"),customProgramCacheKey:R.customProgramCacheKey()}}function g(R){const L=[];if(R.shaderID?L.push(R.shaderID):(L.push(R.customVertexShaderID),L.push(R.customFragmentShaderID)),R.defines!==void 0)for(const z in R.defines)L.push(z),L.push(R.defines[z]);return R.isRawShaderMaterial===!1&&(x(L,R),S(L,R),L.push(n.outputColorSpace)),L.push(R.customProgramCacheKey),L.join()}function x(R,L){R.push(L.precision),R.push(L.outputColorSpace),R.push(L.envMapMode),R.push(L.envMapCubeUVHeight),R.push(L.mapUv),R.push(L.alphaMapUv),R.push(L.lightMapUv),R.push(L.aoMapUv),R.push(L.bumpMapUv),R.push(L.normalMapUv),R.push(L.displacementMapUv),R.push(L.emissiveMapUv),R.push(L.metalnessMapUv),R.push(L.roughnessMapUv),R.push(L.anisotropyMapUv),R.push(L.clearcoatMapUv),R.push(L.clearcoatNormalMapUv),R.push(L.clearcoatRoughnessMapUv),R.push(L.iridescenceMapUv),R.push(L.iridescenceThicknessMapUv),R.push(L.sheenColorMapUv),R.push(L.sheenRoughnessMapUv),R.push(L.specularMapUv),R.push(L.specularColorMapUv),R.push(L.specularIntensityMapUv),R.push(L.transmissionMapUv),R.push(L.thicknessMapUv),R.push(L.combine),R.push(L.fogExp2),R.push(L.sizeAttenuation),R.push(L.morphTargetsCount),R.push(L.morphAttributeCount),R.push(L.numDirLights),R.push(L.numPointLights),R.push(L.numSpotLights),R.push(L.numSpotLightMaps),R.push(L.numHemiLights),R.push(L.numRectAreaLights),R.push(L.numDirLightShadows),R.push(L.numPointLightShadows),R.push(L.numSpotLightShadows),R.push(L.numSpotLightShadowsWithMaps),R.push(L.shadowMapType),R.push(L.toneMapping),R.push(L.numClippingPlanes),R.push(L.numClipIntersection),R.push(L.depthPacking)}function S(R,L){a.disableAll(),L.isWebGL2&&a.enable(0),L.supportsVertexTextures&&a.enable(1),L.instancing&&a.enable(2),L.instancingColor&&a.enable(3),L.matcap&&a.enable(4),L.envMap&&a.enable(5),L.normalMapObjectSpace&&a.enable(6),L.normalMapTangentSpace&&a.enable(7),L.clearcoat&&a.enable(8),L.iridescence&&a.enable(9),L.alphaTest&&a.enable(10),L.vertexColors&&a.enable(11),L.vertexAlphas&&a.enable(12),L.vertexUv1s&&a.enable(13),L.vertexUv2s&&a.enable(14),L.vertexUv3s&&a.enable(15),L.vertexTangents&&a.enable(16),L.anisotropy&&a.enable(17),R.push(a.mask),a.disableAll(),L.fog&&a.enable(0),L.useFog&&a.enable(1),L.flatShading&&a.enable(2),L.logarithmicDepthBuffer&&a.enable(3),L.skinning&&a.enable(4),L.morphTargets&&a.enable(5),L.morphNormals&&a.enable(6),L.morphColors&&a.enable(7),L.premultipliedAlpha&&a.enable(8),L.shadowMapEnabled&&a.enable(9),L.useLegacyLights&&a.enable(10),L.doubleSided&&a.enable(11),L.flipSided&&a.enable(12),L.useDepthPacking&&a.enable(13),L.dithering&&a.enable(14),L.transmission&&a.enable(15),L.sheen&&a.enable(16),L.opaque&&a.enable(17),L.pointsUvs&&a.enable(18),R.push(a.mask)}function E(R){const L=y[R.type];let z;if(L){const $=Fr[L];z=c2.clone($.uniforms)}else z=R.uniforms;return z}function C(R,L){let z;for(let $=0,X=u.length;$<X;$++){const Q=u[$];if(Q.cacheKey===L){z=Q,++z.usedTimes;break}}return z===void 0&&(z=new IG(n,L,R,s),u.push(z)),z}function b(R){if(--R.usedTimes===0){const L=u.indexOf(R);u[L]=u[u.length-1],u.pop(),R.destroy()}}function P(R){l.remove(R)}function B(){l.dispose()}return{getParameters:_,getProgramCacheKey:g,getUniforms:E,acquireProgram:C,releaseProgram:b,releaseShaderCache:P,programs:u,dispose:B}}function UG(){let n=new WeakMap;function e(s){let o=n.get(s);return o===void 0&&(o={},n.set(s,o)),o}function t(s){n.delete(s)}function i(s,o,a){n.get(s)[o]=a}function r(){n=new WeakMap}return{get:e,remove:t,update:i,dispose:r}}function kG(n,e){return n.groupOrder!==e.groupOrder?n.groupOrder-e.groupOrder:n.renderOrder!==e.renderOrder?n.renderOrder-e.renderOrder:n.material.id!==e.material.id?n.material.id-e.material.id:n.z!==e.z?n.z-e.z:n.id-e.id}function eT(n,e){return n.groupOrder!==e.groupOrder?n.groupOrder-e.groupOrder:n.renderOrder!==e.renderOrder?n.renderOrder-e.renderOrder:n.z!==e.z?e.z-n.z:n.id-e.id}function tT(){const n=[];let e=0;const t=[],i=[],r=[];function s(){e=0,t.length=0,i.length=0,r.length=0}function o(d,p,m,y,M,_){let g=n[e];return g===void 0?(g={id:d.id,object:d,geometry:p,material:m,groupOrder:y,renderOrder:d.renderOrder,z:M,group:_},n[e]=g):(g.id=d.id,g.object=d,g.geometry=p,g.material=m,g.groupOrder=y,g.renderOrder=d.renderOrder,g.z=M,g.group=_),e++,g}function a(d,p,m,y,M,_){const g=o(d,p,m,y,M,_);m.transmission>0?i.push(g):m.transparent===!0?r.push(g):t.push(g)}function l(d,p,m,y,M,_){const g=o(d,p,m,y,M,_);m.transmission>0?i.unshift(g):m.transparent===!0?r.unshift(g):t.unshift(g)}function u(d,p){t.length>1&&t.sort(d||kG),i.length>1&&i.sort(p||eT),r.length>1&&r.sort(p||eT)}function h(){for(let d=e,p=n.length;d<p;d++){const m=n[d];if(m.id===null)break;m.id=null,m.object=null,m.geometry=null,m.material=null,m.group=null}}return{opaque:t,transmissive:i,transparent:r,init:s,push:a,unshift:l,finish:h,sort:u}}function HG(){let n=new WeakMap;function e(i,r){const s=n.get(i);let o;return s===void 0?(o=new tT,n.set(i,[o])):r>=s.length?(o=new tT,s.push(o)):o=s[r],o}function t(){n=new WeakMap}return{get:e,dispose:t}}function zG(){const n={};return{get:function(e){if(n[e.id]!==void 0)return n[e.id];let t;switch(e.type){case"DirectionalLight":t={direction:new F,color:new Oe};break;case"SpotLight":t={position:new F,direction:new F,color:new Oe,distance:0,coneCos:0,penumbraCos:0,decay:0};break;case"PointLight":t={position:new F,color:new Oe,distance:0,decay:0};break;case"HemisphereLight":t={direction:new F,skyColor:new Oe,groundColor:new Oe};break;case"RectAreaLight":t={color:new Oe,position:new F,halfWidth:new F,halfHeight:new F};break}return n[e.id]=t,t}}}function GG(){const n={};return{get:function(e){if(n[e.id]!==void 0)return n[e.id];let t;switch(e.type){case"DirectionalLight":t={shadowBias:0,shadowNormalBias:0,shadowRadius:1,shadowMapSize:new ge};break;case"SpotLight":t={shadowBias:0,shadowNormalBias:0,shadowRadius:1,shadowMapSize:new ge};break;case"PointLight":t={shadowBias:0,shadowNormalBias:0,shadowRadius:1,shadowMapSize:new ge,shadowCameraNear:1,shadowCameraFar:1e3};break}return n[e.id]=t,t}}}let VG=0;function WG(n,e){return(e.castShadow?2:0)-(n.castShadow?2:0)+(e.map?1:0)-(n.map?1:0)}function jG(n,e){const t=new zG,i=GG(),r={version:0,hash:{directionalLength:-1,pointLength:-1,spotLength:-1,rectAreaLength:-1,hemiLength:-1,numDirectionalShadows:-1,numPointShadows:-1,numSpotShadows:-1,numSpotMaps:-1},ambient:[0,0,0],probe:[],directional:[],directionalShadow:[],directionalShadowMap:[],directionalShadowMatrix:[],spot:[],spotLightMap:[],spotShadow:[],spotShadowMap:[],spotLightMatrix:[],rectArea:[],rectAreaLTC1:null,rectAreaLTC2:null,point:[],pointShadow:[],pointShadowMap:[],pointShadowMatrix:[],hemi:[],numSpotLightShadowsWithMaps:0};for(let h=0;h<9;h++)r.probe.push(new F);const s=new F,o=new rt,a=new rt;function l(h,d){let p=0,m=0,y=0;for(let z=0;z<9;z++)r.probe[z].set(0,0,0);let M=0,_=0,g=0,x=0,S=0,E=0,C=0,b=0,P=0,B=0;h.sort(WG);const R=d===!0?Math.PI:1;for(let z=0,$=h.length;z<$;z++){const X=h[z],Q=X.color,Y=X.intensity,ne=X.distance,ee=X.shadow&&X.shadow.map?X.shadow.map.texture:null;if(X.isAmbientLight)p+=Q.r*Y*R,m+=Q.g*Y*R,y+=Q.b*Y*R;else if(X.isLightProbe)for(let I=0;I<9;I++)r.probe[I].addScaledVector(X.sh.coefficients[I],Y);else if(X.isDirectionalLight){const I=t.get(X);if(I.color.copy(X.color).multiplyScalar(X.intensity*R),X.castShadow){const V=X.shadow,H=i.get(X);H.shadowBias=V.bias,H.shadowNormalBias=V.normalBias,H.shadowRadius=V.radius,H.shadowMapSize=V.mapSize,r.directionalShadow[M]=H,r.directionalShadowMap[M]=ee,r.directionalShadowMatrix[M]=X.shadow.matrix,E++}r.directional[M]=I,M++}else if(X.isSpotLight){const I=t.get(X);I.position.setFromMatrixPosition(X.matrixWorld),I.color.copy(Q).multiplyScalar(Y*R),I.distance=ne,I.coneCos=Math.cos(X.angle),I.penumbraCos=Math.cos(X.angle*(1-X.penumbra)),I.decay=X.decay,r.spot[g]=I;const V=X.shadow;if(X.map&&(r.spotLightMap[P]=X.map,P++,V.updateMatrices(X),X.castShadow&&B++),r.spotLightMatrix[g]=V.matrix,X.castShadow){const H=i.get(X);H.shadowBias=V.bias,H.shadowNormalBias=V.normalBias,H.shadowRadius=V.radius,H.shadowMapSize=V.mapSize,r.spotShadow[g]=H,r.spotShadowMap[g]=ee,b++}g++}else if(X.isRectAreaLight){const I=t.get(X);I.color.copy(Q).multiplyScalar(Y),I.halfWidth.set(X.width*.5,0,0),I.halfHeight.set(0,X.height*.5,0),r.rectArea[x]=I,x++}else if(X.isPointLight){const I=t.get(X);if(I.color.copy(X.color).multiplyScalar(X.intensity*R),I.distance=X.distance,I.decay=X.decay,X.castShadow){const V=X.shadow,H=i.get(X);H.shadowBias=V.bias,H.shadowNormalBias=V.normalBias,H.shadowRadius=V.radius,H.shadowMapSize=V.mapSize,H.shadowCameraNear=V.camera.near,H.shadowCameraFar=V.camera.far,r.pointShadow[_]=H,r.pointShadowMap[_]=ee,r.pointShadowMatrix[_]=X.shadow.matrix,C++}r.point[_]=I,_++}else if(X.isHemisphereLight){const I=t.get(X);I.skyColor.copy(X.color).multiplyScalar(Y*R),I.groundColor.copy(X.groundColor).multiplyScalar(Y*R),r.hemi[S]=I,S++}}x>0&&(e.isWebGL2||n.has("OES_texture_float_linear")===!0?(r.rectAreaLTC1=Fe.LTC_FLOAT_1,r.rectAreaLTC2=Fe.LTC_FLOAT_2):n.has("OES_texture_half_float_linear")===!0?(r.rectAreaLTC1=Fe.LTC_HALF_1,r.rectAreaLTC2=Fe.LTC_HALF_2):console.error("THREE.WebGLRenderer: Unable to use RectAreaLight. Missing WebGL extensions.")),r.ambient[0]=p,r.ambient[1]=m,r.ambient[2]=y;const L=r.hash;(L.directionalLength!==M||L.pointLength!==_||L.spotLength!==g||L.rectAreaLength!==x||L.hemiLength!==S||L.numDirectionalShadows!==E||L.numPointShadows!==C||L.numSpotShadows!==b||L.numSpotMaps!==P)&&(r.directional.length=M,r.spot.length=g,r.rectArea.length=x,r.point.length=_,r.hemi.length=S,r.directionalShadow.length=E,r.directionalShadowMap.length=E,r.pointShadow.length=C,r.pointShadowMap.length=C,r.spotShadow.length=b,r.spotShadowMap.length=b,r.directionalShadowMatrix.length=E,r.pointShadowMatrix.length=C,r.spotLightMatrix.length=b+P-B,r.spotLightMap.length=P,r.numSpotLightShadowsWithMaps=B,L.directionalLength=M,L.pointLength=_,L.spotLength=g,L.rectAreaLength=x,L.hemiLength=S,L.numDirectionalShadows=E,L.numPointShadows=C,L.numSpotShadows=b,L.numSpotMaps=P,r.version=VG++)}function u(h,d){let p=0,m=0,y=0,M=0,_=0;const g=d.matrixWorldInverse;for(let x=0,S=h.length;x<S;x++){const E=h[x];if(E.isDirectionalLight){const C=r.directional[p];C.direction.setFromMatrixPosition(E.matrixWorld),s.setFromMatrixPosition(E.target.matrixWorld),C.direction.sub(s),C.direction.transformDirection(g),p++}else if(E.isSpotLight){const C=r.spot[y];C.position.setFromMatrixPosition(E.matrixWorld),C.position.applyMatrix4(g),C.direction.setFromMatrixPosition(E.matrixWorld),s.setFromMatrixPosition(E.target.matrixWorld),C.direction.sub(s),C.direction.transformDirection(g),y++}else if(E.isRectAreaLight){const C=r.rectArea[M];C.position.setFromMatrixPosition(E.matrixWorld),C.position.applyMatrix4(g),a.identity(),o.copy(E.matrixWorld),o.premultiply(g),a.extractRotation(o),C.halfWidth.set(E.width*.5,0,0),C.halfHeight.set(0,E.height*.5,0),C.halfWidth.applyMatrix4(a),C.halfHeight.applyMatrix4(a),M++}else if(E.isPointLight){const C=r.point[m];C.position.setFromMatrixPosition(E.matrixWorld),C.position.applyMatrix4(g),m++}else if(E.isHemisphereLight){const C=r.hemi[_];C.direction.setFromMatrixPosition(E.matrixWorld),C.direction.transformDirection(g),_++}}}return{setup:l,setupView:u,state:r}}function nT(n,e){const t=new jG(n,e),i=[],r=[];function s(){i.length=0,r.length=0}function o(d){i.push(d)}function a(d){r.push(d)}function l(d){t.setup(i,d)}function u(d){t.setupView(i,d)}return{init:s,state:{lightsArray:i,shadowsArray:r,lights:t},setupLights:l,setupLightsView:u,pushLight:o,pushShadow:a}}function XG(n,e){let t=new WeakMap;function i(s,o=0){const a=t.get(s);let l;return a===void 0?(l=new nT(n,e),t.set(s,[l])):o>=a.length?(l=new nT(n,e),a.push(l)):l=a[o],l}function r(){t=new WeakMap}return{get:i,dispose:r}}class wS extends Cn{constructor(e){super(),this.isMeshDepthMaterial=!0,this.type="MeshDepthMaterial",this.depthPacking=XB,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 TS extends Cn{constructor(e){super(),this.isMeshDistanceMaterial=!0,this.type="MeshDistanceMaterial",this.map=null,this.alphaMap=null,this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.setValues(e)}copy(e){return super.copy(e),this.map=e.map,this.alphaMap=e.alphaMap,this.displacementMap=e.displacementMap,this.displacementScale=e.displacementScale,this.displacementBias=e.displacementBias,this}}const JG=`void main() {
	gl_Position = vec4( position, 1.0 );
}`,KG=`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 YG(n,e,t){let i=new Ig;const r=new ge,s=new ge,o=new Nt,a=new wS({depthPacking:JB}),l=new TS,u={},h=t.maxTextureSize,d={[gs]:vi,[vi]:gs,[vr]:vr},p=new ys({defines:{VSM_SAMPLES:8},uniforms:{shadow_pass:{value:null},resolution:{value:new ge},radius:{value:4}},vertexShader:JG,fragmentShader:KG}),m=p.clone();m.defines.HORIZONTAL_PASS=1;const y=new gt;y.setAttribute("position",new Dt(new Float32Array([-1,-1,.5,3,-1,.5,-1,3,.5]),3));const M=new Hn(y,p),_=this;this.enabled=!1,this.autoUpdate=!0,this.needsUpdate=!1,this.type=Cg;let g=this.type;this.render=function(C,b,P){if(_.enabled===!1||_.autoUpdate===!1&&_.needsUpdate===!1||C.length===0)return;const B=n.getRenderTarget(),R=n.getActiveCubeFace(),L=n.getActiveMipmapLevel(),z=n.state;z.setBlending(Ws),z.buffers.color.setClear(1,1,1,1),z.buffers.depth.setTest(!0),z.setScissorTest(!1);const $=g!==Lr&&this.type===Lr,X=g===Lr&&this.type!==Lr;for(let Q=0,Y=C.length;Q<Y;Q++){const ne=C[Q],ee=ne.shadow;if(ee===void 0){console.warn("THREE.WebGLShadowMap:",ne,"has no shadow.");continue}if(ee.autoUpdate===!1&&ee.needsUpdate===!1)continue;r.copy(ee.mapSize);const I=ee.getFrameExtents();if(r.multiply(I),s.copy(ee.mapSize),(r.x>h||r.y>h)&&(r.x>h&&(s.x=Math.floor(h/I.x),r.x=s.x*I.x,ee.mapSize.x=s.x),r.y>h&&(s.y=Math.floor(h/I.y),r.y=s.y*I.y,ee.mapSize.y=s.y)),ee.map===null||$===!0||X===!0){const H=this.type!==Lr?{minFilter:mn,magFilter:mn}:{};ee.map!==null&&ee.map.dispose(),ee.map=new Wr(r.x,r.y,H),ee.map.texture.name=ne.name+".shadowMap",ee.camera.updateProjectionMatrix()}n.setRenderTarget(ee.map),n.clear();const V=ee.getViewportCount();for(let H=0;H<V;H++){const U=ee.getViewport(H);o.set(s.x*U.x,s.y*U.y,s.x*U.z,s.y*U.w),z.viewport(o),ee.updateMatrices(ne,H),i=ee.getFrustum(),E(b,P,ee.camera,ne,this.type)}ee.isPointLightShadow!==!0&&this.type===Lr&&x(ee,P),ee.needsUpdate=!1}g=this.type,_.needsUpdate=!1,n.setRenderTarget(B,R,L)};function x(C,b){const P=e.update(M);p.defines.VSM_SAMPLES!==C.blurSamples&&(p.defines.VSM_SAMPLES=C.blurSamples,m.defines.VSM_SAMPLES=C.blurSamples,p.needsUpdate=!0,m.needsUpdate=!0),C.mapPass===null&&(C.mapPass=new Wr(r.x,r.y)),p.uniforms.shadow_pass.value=C.map.texture,p.uniforms.resolution.value=C.mapSize,p.uniforms.radius.value=C.radius,n.setRenderTarget(C.mapPass),n.clear(),n.renderBufferDirect(b,null,P,p,M,null),m.uniforms.shadow_pass.value=C.mapPass.texture,m.uniforms.resolution.value=C.mapSize,m.uniforms.radius.value=C.radius,n.setRenderTarget(C.map),n.clear(),n.renderBufferDirect(b,null,P,m,M,null)}function S(C,b,P,B){let R=null;const L=P.isPointLight===!0?C.customDistanceMaterial:C.customDepthMaterial;if(L!==void 0)R=L;else if(R=P.isPointLight===!0?l:a,n.localClippingEnabled&&b.clipShadows===!0&&Array.isArray(b.clippingPlanes)&&b.clippingPlanes.length!==0||b.displacementMap&&b.displacementScale!==0||b.alphaMap&&b.alphaTest>0||b.map&&b.alphaTest>0){const z=R.uuid,$=b.uuid;let X=u[z];X===void 0&&(X={},u[z]=X);let Q=X[$];Q===void 0&&(Q=R.clone(),X[$]=Q),R=Q}if(R.visible=b.visible,R.wireframe=b.wireframe,B===Lr?R.side=b.shadowSide!==null?b.shadowSide:b.side:R.side=b.shadowSide!==null?b.shadowSide:d[b.side],R.alphaMap=b.alphaMap,R.alphaTest=b.alphaTest,R.map=b.map,R.clipShadows=b.clipShadows,R.clippingPlanes=b.clippingPlanes,R.clipIntersection=b.clipIntersection,R.displacementMap=b.displacementMap,R.displacementScale=b.displacementScale,R.displacementBias=b.displacementBias,R.wireframeLinewidth=b.wireframeLinewidth,R.linewidth=b.linewidth,P.isPointLight===!0&&R.isMeshDistanceMaterial===!0){const z=n.properties.get(R);z.light=P}return R}function E(C,b,P,B,R){if(C.visible===!1)return;if(C.layers.test(b.layers)&&(C.isMesh||C.isLine||C.isPoints)&&(C.castShadow||C.receiveShadow&&R===Lr)&&(!C.frustumCulled||i.intersectsObject(C))){C.modelViewMatrix.multiplyMatrices(P.matrixWorldInverse,C.matrixWorld);const $=e.update(C),X=C.material;if(Array.isArray(X)){const Q=$.groups;for(let Y=0,ne=Q.length;Y<ne;Y++){const ee=Q[Y],I=X[ee.materialIndex];if(I&&I.visible){const V=S(C,I,B,R);n.renderBufferDirect(P,null,$,V,C,ee)}}}else if(X.visible){const Q=S(C,X,B,R);n.renderBufferDirect(P,null,$,Q,C,null)}}const z=C.children;for(let $=0,X=z.length;$<X;$++)E(z[$],b,P,B,R)}}function QG(n,e,t){const i=t.isWebGL2;function r(){let K=!1;const Pe=new Nt;let oe=null;const Be=new Nt(0,0,0,0);return{setMask:function(He){oe!==He&&!K&&(n.colorMask(He,He,He,He),oe=He)},setLocked:function(He){K=He},setClear:function(He,wt,Gt,_n,Li){Li===!0&&(He*=_n,wt*=_n,Gt*=_n),Pe.set(He,wt,Gt,_n),Be.equals(Pe)===!1&&(n.clearColor(He,wt,Gt,_n),Be.copy(Pe))},reset:function(){K=!1,oe=null,Be.set(-1,0,0,0)}}}function s(){let K=!1,Pe=null,oe=null,Be=null;return{setTest:function(He){He?Ne(n.DEPTH_TEST):We(n.DEPTH_TEST)},setMask:function(He){Pe!==He&&!K&&(n.depthMask(He),Pe=He)},setFunc:function(He){if(oe!==He){switch(He){case _B:n.depthFunc(n.NEVER);break;case AB:n.depthFunc(n.ALWAYS);break;case SB:n.depthFunc(n.LESS);break;case Km:n.depthFunc(n.LEQUAL);break;case MB:n.depthFunc(n.EQUAL);break;case EB:n.depthFunc(n.GEQUAL);break;case wB:n.depthFunc(n.GREATER);break;case TB:n.depthFunc(n.NOTEQUAL);break;default:n.depthFunc(n.LEQUAL)}oe=He}},setLocked:function(He){K=He},setClear:function(He){Be!==He&&(n.clearDepth(He),Be=He)},reset:function(){K=!1,Pe=null,oe=null,Be=null}}}function o(){let K=!1,Pe=null,oe=null,Be=null,He=null,wt=null,Gt=null,_n=null,Li=null;return{setTest:function(jt){K||(jt?Ne(n.STENCIL_TEST):We(n.STENCIL_TEST))},setMask:function(jt){Pe!==jt&&!K&&(n.stencilMask(jt),Pe=jt)},setFunc:function(jt,Ii,Vn){(oe!==jt||Be!==Ii||He!==Vn)&&(n.stencilFunc(jt,Ii,Vn),oe=jt,Be=Ii,He=Vn)},setOp:function(jt,Ii,Vn){(wt!==jt||Gt!==Ii||_n!==Vn)&&(n.stencilOp(jt,Ii,Vn),wt=jt,Gt=Ii,_n=Vn)},setLocked:function(jt){K=jt},setClear:function(jt){Li!==jt&&(n.clearStencil(jt),Li=jt)},reset:function(){K=!1,Pe=null,oe=null,Be=null,He=null,wt=null,Gt=null,_n=null,Li=null}}}const a=new r,l=new s,u=new o,h=new WeakMap,d=new WeakMap;let p={},m={},y=new WeakMap,M=[],_=null,g=!1,x=null,S=null,E=null,C=null,b=null,P=null,B=null,R=!1,L=null,z=null,$=null,X=null,Q=null;const Y=n.getParameter(n.MAX_COMBINED_TEXTURE_IMAGE_UNITS);let ne=!1,ee=0;const I=n.getParameter(n.VERSION);I.indexOf("WebGL")!==-1?(ee=parseFloat(/^WebGL (\d)/.exec(I)[1]),ne=ee>=1):I.indexOf("OpenGL ES")!==-1&&(ee=parseFloat(/^OpenGL ES (\d)/.exec(I)[1]),ne=ee>=2);let V=null,H={};const U=n.getParameter(n.SCISSOR_BOX),W=n.getParameter(n.VIEWPORT),ve=new Nt().fromArray(U),ue=new Nt().fromArray(W);function Ae(K,Pe,oe,Be){const He=new Uint8Array(4),wt=n.createTexture();n.bindTexture(K,wt),n.texParameteri(K,n.TEXTURE_MIN_FILTER,n.NEAREST),n.texParameteri(K,n.TEXTURE_MAG_FILTER,n.NEAREST);for(let Gt=0;Gt<oe;Gt++)i&&(K===n.TEXTURE_3D||K===n.TEXTURE_2D_ARRAY)?n.texImage3D(Pe,0,n.RGBA,1,1,Be,0,n.RGBA,n.UNSIGNED_BYTE,He):n.texImage2D(Pe+Gt,0,n.RGBA,1,1,0,n.RGBA,n.UNSIGNED_BYTE,He);return wt}const Ee={};Ee[n.TEXTURE_2D]=Ae(n.TEXTURE_2D,n.TEXTURE_2D,1),Ee[n.TEXTURE_CUBE_MAP]=Ae(n.TEXTURE_CUBE_MAP,n.TEXTURE_CUBE_MAP_POSITIVE_X,6),i&&(Ee[n.TEXTURE_2D_ARRAY]=Ae(n.TEXTURE_2D_ARRAY,n.TEXTURE_2D_ARRAY,1,1),Ee[n.TEXTURE_3D]=Ae(n.TEXTURE_3D,n.TEXTURE_3D,1,1)),a.setClear(0,0,0,1),l.setClear(1),u.setClear(0),Ne(n.DEPTH_TEST),l.setFunc(Km),xe(!1),Ve(qx),Ne(n.CULL_FACE),pe(Ws);function Ne(K){p[K]!==!0&&(n.enable(K),p[K]=!0)}function We(K){p[K]!==!1&&(n.disable(K),p[K]=!1)}function ct(K,Pe){return m[K]!==Pe?(n.bindFramebuffer(K,Pe),m[K]=Pe,i&&(K===n.DRAW_FRAMEBUFFER&&(m[n.FRAMEBUFFER]=Pe),K===n.FRAMEBUFFER&&(m[n.DRAW_FRAMEBUFFER]=Pe)),!0):!1}function tt(K,Pe){let oe=M,Be=!1;if(K)if(oe=y.get(Pe),oe===void 0&&(oe=[],y.set(Pe,oe)),K.isWebGLMultipleRenderTargets){const He=K.texture;if(oe.length!==He.length||oe[0]!==n.COLOR_ATTACHMENT0){for(let wt=0,Gt=He.length;wt<Gt;wt++)oe[wt]=n.COLOR_ATTACHMENT0+wt;oe.length=He.length,Be=!0}}else oe[0]!==n.COLOR_ATTACHMENT0&&(oe[0]=n.COLOR_ATTACHMENT0,Be=!0);else oe[0]!==n.BACK&&(oe[0]=n.BACK,Be=!0);Be&&(t.isWebGL2?n.drawBuffers(oe):e.get("WEBGL_draw_buffers").drawBuffersWEBGL(oe))}function Se(K){return _!==K?(n.useProgram(K),_=K,!0):!1}const G={[Da]:n.FUNC_ADD,[cB]:n.FUNC_SUBTRACT,[uB]:n.FUNC_REVERSE_SUBTRACT};if(i)G[n_]=n.MIN,G[i_]=n.MAX;else{const K=e.get("EXT_blend_minmax");K!==null&&(G[n_]=K.MIN_EXT,G[i_]=K.MAX_EXT)}const ye={[fB]:n.ZERO,[hB]:n.ONE,[dB]:n.SRC_COLOR,[rS]:n.SRC_ALPHA,[xB]:n.SRC_ALPHA_SATURATE,[vB]:n.DST_COLOR,[mB]:n.DST_ALPHA,[pB]:n.ONE_MINUS_SRC_COLOR,[sS]:n.ONE_MINUS_SRC_ALPHA,[yB]:n.ONE_MINUS_DST_COLOR,[gB]:n.ONE_MINUS_DST_ALPHA};function pe(K,Pe,oe,Be,He,wt,Gt,_n){if(K===Ws){g===!0&&(We(n.BLEND),g=!1);return}if(g===!1&&(Ne(n.BLEND),g=!0),K!==lB){if(K!==x||_n!==R){if((S!==Da||b!==Da)&&(n.blendEquation(n.FUNC_ADD),S=Da,b=Da),_n)switch(K){case Ka:n.blendFuncSeparate(n.ONE,n.ONE_MINUS_SRC_ALPHA,n.ONE,n.ONE_MINUS_SRC_ALPHA);break;case $x:n.blendFunc(n.ONE,n.ONE);break;case e_:n.blendFuncSeparate(n.ZERO,n.ONE_MINUS_SRC_COLOR,n.ZERO,n.ONE);break;case t_:n.blendFuncSeparate(n.ZERO,n.SRC_COLOR,n.ZERO,n.SRC_ALPHA);break;default:console.error("THREE.WebGLState: Invalid blending: ",K);break}else switch(K){case Ka:n.blendFuncSeparate(n.SRC_ALPHA,n.ONE_MINUS_SRC_ALPHA,n.ONE,n.ONE_MINUS_SRC_ALPHA);break;case $x:n.blendFunc(n.SRC_ALPHA,n.ONE);break;case e_:n.blendFuncSeparate(n.ZERO,n.ONE_MINUS_SRC_COLOR,n.ZERO,n.ONE);break;case t_:n.blendFunc(n.ZERO,n.SRC_COLOR);break;default:console.error("THREE.WebGLState: Invalid blending: ",K);break}E=null,C=null,P=null,B=null,x=K,R=_n}return}He=He||Pe,wt=wt||oe,Gt=Gt||Be,(Pe!==S||He!==b)&&(n.blendEquationSeparate(G[Pe],G[He]),S=Pe,b=He),(oe!==E||Be!==C||wt!==P||Gt!==B)&&(n.blendFuncSeparate(ye[oe],ye[Be],ye[wt],ye[Gt]),E=oe,C=Be,P=wt,B=Gt),x=K,R=!1}function Me(K,Pe){K.side===vr?We(n.CULL_FACE):Ne(n.CULL_FACE);let oe=K.side===vi;Pe&&(oe=!oe),xe(oe),K.blending===Ka&&K.transparent===!1?pe(Ws):pe(K.blending,K.blendEquation,K.blendSrc,K.blendDst,K.blendEquationAlpha,K.blendSrcAlpha,K.blendDstAlpha,K.premultipliedAlpha),l.setFunc(K.depthFunc),l.setTest(K.depthTest),l.setMask(K.depthWrite),a.setMask(K.colorWrite);const Be=K.stencilWrite;u.setTest(Be),Be&&(u.setMask(K.stencilWriteMask),u.setFunc(K.stencilFunc,K.stencilRef,K.stencilFuncMask),u.setOp(K.stencilFail,K.stencilZFail,K.stencilZPass)),Ge(K.polygonOffset,K.polygonOffsetFactor,K.polygonOffsetUnits),K.alphaToCoverage===!0?Ne(n.SAMPLE_ALPHA_TO_COVERAGE):We(n.SAMPLE_ALPHA_TO_COVERAGE)}function xe(K){L!==K&&(K?n.frontFace(n.CW):n.frontFace(n.CCW),L=K)}function Ve(K){K!==sB?(Ne(n.CULL_FACE),K!==z&&(K===qx?n.cullFace(n.BACK):K===oB?n.cullFace(n.FRONT):n.cullFace(n.FRONT_AND_BACK))):We(n.CULL_FACE),z=K}function Ue(K){K!==$&&(ne&&n.lineWidth(K),$=K)}function Ge(K,Pe,oe){K?(Ne(n.POLYGON_OFFSET_FILL),(X!==Pe||Q!==oe)&&(n.polygonOffset(Pe,oe),X=Pe,Q=oe)):We(n.POLYGON_OFFSET_FILL)}function qe(K){K?Ne(n.SCISSOR_TEST):We(n.SCISSOR_TEST)}function vt(K){K===void 0&&(K=n.TEXTURE0+Y-1),V!==K&&(n.activeTexture(K),V=K)}function Ut(K,Pe,oe){oe===void 0&&(V===null?oe=n.TEXTURE0+Y-1:oe=V);let Be=H[oe];Be===void 0&&(Be={type:void 0,texture:void 0},H[oe]=Be),(Be.type!==K||Be.texture!==Pe)&&(V!==oe&&(n.activeTexture(oe),V=oe),n.bindTexture(K,Pe||Ee[K]),Be.type=K,Be.texture=Pe)}function k(){const K=H[V];K!==void 0&&K.type!==void 0&&(n.bindTexture(K.type,null),K.type=void 0,K.texture=void 0)}function D(){try{n.compressedTexImage2D.apply(n,arguments)}catch(K){console.error("THREE.WebGLState:",K)}}function le(){try{n.compressedTexImage3D.apply(n,arguments)}catch(K){console.error("THREE.WebGLState:",K)}}function we(){try{n.texSubImage2D.apply(n,arguments)}catch(K){console.error("THREE.WebGLState:",K)}}function _e(){try{n.texSubImage3D.apply(n,arguments)}catch(K){console.error("THREE.WebGLState:",K)}}function De(){try{n.compressedTexSubImage2D.apply(n,arguments)}catch(K){console.error("THREE.WebGLState:",K)}}function Ke(){try{n.compressedTexSubImage3D.apply(n,arguments)}catch(K){console.error("THREE.WebGLState:",K)}}function Le(){try{n.texStorage2D.apply(n,arguments)}catch(K){console.error("THREE.WebGLState:",K)}}function he(){try{n.texStorage3D.apply(n,arguments)}catch(K){console.error("THREE.WebGLState:",K)}}function j(){try{n.texImage2D.apply(n,arguments)}catch(K){console.error("THREE.WebGLState:",K)}}function fe(){try{n.texImage3D.apply(n,arguments)}catch(K){console.error("THREE.WebGLState:",K)}}function Te(K){ve.equals(K)===!1&&(n.scissor(K.x,K.y,K.z,K.w),ve.copy(K))}function be(K){ue.equals(K)===!1&&(n.viewport(K.x,K.y,K.z,K.w),ue.copy(K))}function Ie(K,Pe){let oe=d.get(Pe);oe===void 0&&(oe=new WeakMap,d.set(Pe,oe));let Be=oe.get(K);Be===void 0&&(Be=n.getUniformBlockIndex(Pe,K.name),oe.set(K,Be))}function nt(K,Pe){const Be=d.get(Pe).get(K);h.get(Pe)!==Be&&(n.uniformBlockBinding(Pe,Be,K.__bindingPointIndex),h.set(Pe,Be))}function Rt(){n.disable(n.BLEND),n.disable(n.CULL_FACE),n.disable(n.DEPTH_TEST),n.disable(n.POLYGON_OFFSET_FILL),n.disable(n.SCISSOR_TEST),n.disable(n.STENCIL_TEST),n.disable(n.SAMPLE_ALPHA_TO_COVERAGE),n.blendEquation(n.FUNC_ADD),n.blendFunc(n.ONE,n.ZERO),n.blendFuncSeparate(n.ONE,n.ZERO,n.ONE,n.ZERO),n.colorMask(!0,!0,!0,!0),n.clearColor(0,0,0,0),n.depthMask(!0),n.depthFunc(n.LESS),n.clearDepth(1),n.stencilMask(4294967295),n.stencilFunc(n.ALWAYS,0,4294967295),n.stencilOp(n.KEEP,n.KEEP,n.KEEP),n.clearStencil(0),n.cullFace(n.BACK),n.frontFace(n.CCW),n.polygonOffset(0,0),n.activeTexture(n.TEXTURE0),n.bindFramebuffer(n.FRAMEBUFFER,null),i===!0&&(n.bindFramebuffer(n.DRAW_FRAMEBUFFER,null),n.bindFramebuffer(n.READ_FRAMEBUFFER,null)),n.useProgram(null),n.lineWidth(1),n.scissor(0,0,n.canvas.width,n.canvas.height),n.viewport(0,0,n.canvas.width,n.canvas.height),p={},V=null,H={},m={},y=new WeakMap,M=[],_=null,g=!1,x=null,S=null,E=null,C=null,b=null,P=null,B=null,R=!1,L=null,z=null,$=null,X=null,Q=null,ve.set(0,0,n.canvas.width,n.canvas.height),ue.set(0,0,n.canvas.width,n.canvas.height),a.reset(),l.reset(),u.reset()}return{buffers:{color:a,depth:l,stencil:u},enable:Ne,disable:We,bindFramebuffer:ct,drawBuffers:tt,useProgram:Se,setBlending:pe,setMaterial:Me,setFlipSided:xe,setCullFace:Ve,setLineWidth:Ue,setPolygonOffset:Ge,setScissorTest:qe,activeTexture:vt,bindTexture:Ut,unbindTexture:k,compressedTexImage2D:D,compressedTexImage3D:le,texImage2D:j,texImage3D:fe,updateUBOMapping:Ie,uniformBlockBinding:nt,texStorage2D:Le,texStorage3D:he,texSubImage2D:we,texSubImage3D:_e,compressedTexSubImage2D:De,compressedTexSubImage3D:Ke,scissor:Te,viewport:be,reset:Rt}}function ZG(n,e,t,i,r,s,o){const a=r.isWebGL2,l=r.maxTextures,u=r.maxCubemapSize,h=r.maxTextureSize,d=r.maxSamples,p=e.has("WEBGL_multisampled_render_to_texture")?e.get("WEBGL_multisampled_render_to_texture"):null,m=typeof navigator>"u"?!1:/OculusBrowser/g.test(navigator.userAgent),y=new WeakMap;let M;const _=new WeakMap;let g=!1;try{g=typeof OffscreenCanvas<"u"&&new OffscreenCanvas(1,1).getContext("2d")!==null}catch{}function x(k,D){return g?new OffscreenCanvas(k,D):sh("canvas")}function S(k,D,le,we){let _e=1;if((k.width>we||k.height>we)&&(_e=we/Math.max(k.width,k.height)),_e<1||D===!0)if(typeof HTMLImageElement<"u"&&k instanceof HTMLImageElement||typeof HTMLCanvasElement<"u"&&k instanceof HTMLCanvasElement||typeof ImageBitmap<"u"&&k instanceof ImageBitmap){const De=D?Zm:Math.floor,Ke=De(_e*k.width),Le=De(_e*k.height);M===void 0&&(M=x(Ke,Le));const he=le?x(Ke,Le):M;return he.width=Ke,he.height=Le,he.getContext("2d").drawImage(k,0,0,Ke,Le),console.warn("THREE.WebGLRenderer: Texture has been resized from ("+k.width+"x"+k.height+") to ("+Ke+"x"+Le+")."),he}else return"data"in k&&console.warn("THREE.WebGLRenderer: Image in DataTexture is too big ("+k.width+"x"+k.height+")."),k;return k}function E(k){return b_(k.width)&&b_(k.height)}function C(k){return a?!1:k.wrapS!==Xn||k.wrapT!==Xn||k.minFilter!==mn&&k.minFilter!==rn}function b(k,D){return k.generateMipmaps&&D&&k.minFilter!==mn&&k.minFilter!==rn}function P(k){n.generateMipmap(k)}function B(k,D,le,we,_e=!1){if(a===!1)return D;if(k!==null){if(n[k]!==void 0)return n[k];console.warn("THREE.WebGLRenderer: Attempt to use non-existing WebGL internal format '"+k+"'")}let De=D;return D===n.RED&&(le===n.FLOAT&&(De=n.R32F),le===n.HALF_FLOAT&&(De=n.R16F),le===n.UNSIGNED_BYTE&&(De=n.R8)),D===n.RG&&(le===n.FLOAT&&(De=n.RG32F),le===n.HALF_FLOAT&&(De=n.RG16F),le===n.UNSIGNED_BYTE&&(De=n.RG8)),D===n.RGBA&&(le===n.FLOAT&&(De=n.RGBA32F),le===n.HALF_FLOAT&&(De=n.RGBA16F),le===n.UNSIGNED_BYTE&&(De=we===mt&&_e===!1?n.SRGB8_ALPHA8:n.RGBA8),le===n.UNSIGNED_SHORT_4_4_4_4&&(De=n.RGBA4),le===n.UNSIGNED_SHORT_5_5_5_1&&(De=n.RGB5_A1)),(De===n.R16F||De===n.R32F||De===n.RG16F||De===n.RG32F||De===n.RGBA16F||De===n.RGBA32F)&&e.get("EXT_color_buffer_float"),De}function R(k,D,le){return b(k,le)===!0||k.isFramebufferTexture&&k.minFilter!==mn&&k.minFilter!==rn?Math.log2(Math.max(D.width,D.height))+1:k.mipmaps!==void 0&&k.mipmaps.length>0?k.mipmaps.length:k.isCompressedTexture&&Array.isArray(k.image)?D.mipmaps.length:1}function L(k){return k===mn||k===th||k===Bc?n.NEAREST:n.LINEAR}function z(k){const D=k.target;D.removeEventListener("dispose",z),X(D),D.isVideoTexture&&y.delete(D)}function $(k){const D=k.target;D.removeEventListener("dispose",$),Y(D)}function X(k){const D=i.get(k);if(D.__webglInit===void 0)return;const le=k.source,we=_.get(le);if(we){const _e=we[D.__cacheKey];_e.usedTimes--,_e.usedTimes===0&&Q(k),Object.keys(we).length===0&&_.delete(le)}i.remove(k)}function Q(k){const D=i.get(k);n.deleteTexture(D.__webglTexture);const le=k.source,we=_.get(le);delete we[D.__cacheKey],o.memory.textures--}function Y(k){const D=k.texture,le=i.get(k),we=i.get(D);if(we.__webglTexture!==void 0&&(n.deleteTexture(we.__webglTexture),o.memory.textures--),k.depthTexture&&k.depthTexture.dispose(),k.isWebGLCubeRenderTarget)for(let _e=0;_e<6;_e++)n.deleteFramebuffer(le.__webglFramebuffer[_e]),le.__webglDepthbuffer&&n.deleteRenderbuffer(le.__webglDepthbuffer[_e]);else{if(n.deleteFramebuffer(le.__webglFramebuffer),le.__webglDepthbuffer&&n.deleteRenderbuffer(le.__webglDepthbuffer),le.__webglMultisampledFramebuffer&&n.deleteFramebuffer(le.__webglMultisampledFramebuffer),le.__webglColorRenderbuffer)for(let _e=0;_e<le.__webglColorRenderbuffer.length;_e++)le.__webglColorRenderbuffer[_e]&&n.deleteRenderbuffer(le.__webglColorRenderbuffer[_e]);le.__webglDepthRenderbuffer&&n.deleteRenderbuffer(le.__webglDepthRenderbuffer)}if(k.isWebGLMultipleRenderTargets)for(let _e=0,De=D.length;_e<De;_e++){const Ke=i.get(D[_e]);Ke.__webglTexture&&(n.deleteTexture(Ke.__webglTexture),o.memory.textures--),i.remove(D[_e])}i.remove(D),i.remove(k)}let ne=0;function ee(){ne=0}function I(){const k=ne;return k>=l&&console.warn("THREE.WebGLTextures: Trying to use "+k+" texture units while this GPU supports only "+l),ne+=1,k}function V(k){const D=[];return D.push(k.wrapS),D.push(k.wrapT),D.push(k.wrapR||0),D.push(k.magFilter),D.push(k.minFilter),D.push(k.anisotropy),D.push(k.internalFormat),D.push(k.format),D.push(k.type),D.push(k.generateMipmaps),D.push(k.premultiplyAlpha),D.push(k.flipY),D.push(k.unpackAlignment),D.push(k.colorSpace),D.join()}function H(k,D){const le=i.get(k);if(k.isVideoTexture&&vt(k),k.isRenderTargetTexture===!1&&k.version>0&&le.__version!==k.version){const we=k.image;if(we===null)console.warn("THREE.WebGLRenderer: Texture marked for update but no image data found.");else if(we.complete===!1)console.warn("THREE.WebGLRenderer: Texture marked for update but image is incomplete");else{ct(le,k,D);return}}t.bindTexture(n.TEXTURE_2D,le.__webglTexture,n.TEXTURE0+D)}function U(k,D){const le=i.get(k);if(k.version>0&&le.__version!==k.version){ct(le,k,D);return}t.bindTexture(n.TEXTURE_2D_ARRAY,le.__webglTexture,n.TEXTURE0+D)}function W(k,D){const le=i.get(k);if(k.version>0&&le.__version!==k.version){ct(le,k,D);return}t.bindTexture(n.TEXTURE_3D,le.__webglTexture,n.TEXTURE0+D)}function ve(k,D){const le=i.get(k);if(k.version>0&&le.__version!==k.version){tt(le,k,D);return}t.bindTexture(n.TEXTURE_CUBE_MAP,le.__webglTexture,n.TEXTURE0+D)}const ue={[Ko]:n.REPEAT,[Xn]:n.CLAMP_TO_EDGE,[Jc]:n.MIRRORED_REPEAT},Ae={[mn]:n.NEAREST,[th]:n.NEAREST_MIPMAP_NEAREST,[Bc]:n.NEAREST_MIPMAP_LINEAR,[rn]:n.LINEAR,[Rg]:n.LINEAR_MIPMAP_NEAREST,[vs]:n.LINEAR_MIPMAP_LINEAR},Ee={[QB]:n.NEVER,[i2]:n.ALWAYS,[ZB]:n.LESS,[$B]:n.LEQUAL,[qB]:n.EQUAL,[n2]:n.GEQUAL,[e2]:n.GREATER,[t2]:n.NOTEQUAL};function Ne(k,D,le){if(le?(n.texParameteri(k,n.TEXTURE_WRAP_S,ue[D.wrapS]),n.texParameteri(k,n.TEXTURE_WRAP_T,ue[D.wrapT]),(k===n.TEXTURE_3D||k===n.TEXTURE_2D_ARRAY)&&n.texParameteri(k,n.TEXTURE_WRAP_R,ue[D.wrapR]),n.texParameteri(k,n.TEXTURE_MAG_FILTER,Ae[D.magFilter]),n.texParameteri(k,n.TEXTURE_MIN_FILTER,Ae[D.minFilter])):(n.texParameteri(k,n.TEXTURE_WRAP_S,n.CLAMP_TO_EDGE),n.texParameteri(k,n.TEXTURE_WRAP_T,n.CLAMP_TO_EDGE),(k===n.TEXTURE_3D||k===n.TEXTURE_2D_ARRAY)&&n.texParameteri(k,n.TEXTURE_WRAP_R,n.CLAMP_TO_EDGE),(D.wrapS!==Xn||D.wrapT!==Xn)&&console.warn("THREE.WebGLRenderer: Texture is not power of two. Texture.wrapS and Texture.wrapT should be set to THREE.ClampToEdgeWrapping."),n.texParameteri(k,n.TEXTURE_MAG_FILTER,L(D.magFilter)),n.texParameteri(k,n.TEXTURE_MIN_FILTER,L(D.minFilter)),D.minFilter!==mn&&D.minFilter!==rn&&console.warn("THREE.WebGLRenderer: Texture is not power of two. Texture.minFilter should be set to THREE.NearestFilter or THREE.LinearFilter.")),D.compareFunction&&(n.texParameteri(k,n.TEXTURE_COMPARE_MODE,n.COMPARE_REF_TO_TEXTURE),n.texParameteri(k,n.TEXTURE_COMPARE_FUNC,Ee[D.compareFunction])),e.has("EXT_texture_filter_anisotropic")===!0){const we=e.get("EXT_texture_filter_anisotropic");if(D.magFilter===mn||D.minFilter!==Bc&&D.minFilter!==vs||D.type===ls&&e.has("OES_texture_float_linear")===!1||a===!1&&D.type===Kc&&e.has("OES_texture_half_float_linear")===!1)return;(D.anisotropy>1||i.get(D).__currentAnisotropy)&&(n.texParameterf(k,we.TEXTURE_MAX_ANISOTROPY_EXT,Math.min(D.anisotropy,r.getMaxAnisotropy())),i.get(D).__currentAnisotropy=D.anisotropy)}}function We(k,D){let le=!1;k.__webglInit===void 0&&(k.__webglInit=!0,D.addEventListener("dispose",z));const we=D.source;let _e=_.get(we);_e===void 0&&(_e={},_.set(we,_e));const De=V(D);if(De!==k.__cacheKey){_e[De]===void 0&&(_e[De]={texture:n.createTexture(),usedTimes:0},o.memory.textures++,le=!0),_e[De].usedTimes++;const Ke=_e[k.__cacheKey];Ke!==void 0&&(_e[k.__cacheKey].usedTimes--,Ke.usedTimes===0&&Q(D)),k.__cacheKey=De,k.__webglTexture=_e[De].texture}return le}function ct(k,D,le){let we=n.TEXTURE_2D;(D.isDataArrayTexture||D.isCompressedArrayTexture)&&(we=n.TEXTURE_2D_ARRAY),D.isData3DTexture&&(we=n.TEXTURE_3D);const _e=We(k,D),De=D.source;t.bindTexture(we,k.__webglTexture,n.TEXTURE0+le);const Ke=i.get(De);if(De.version!==Ke.__version||_e===!0){t.activeTexture(n.TEXTURE0+le),n.pixelStorei(n.UNPACK_FLIP_Y_WEBGL,D.flipY),n.pixelStorei(n.UNPACK_PREMULTIPLY_ALPHA_WEBGL,D.premultiplyAlpha),n.pixelStorei(n.UNPACK_ALIGNMENT,D.unpackAlignment),n.pixelStorei(n.UNPACK_COLORSPACE_CONVERSION_WEBGL,n.NONE);const Le=C(D)&&E(D.image)===!1;let he=S(D.image,Le,!1,h);he=Ut(D,he);const j=E(he)||a,fe=s.convert(D.format,D.colorSpace);let Te=s.convert(D.type),be=B(D.internalFormat,fe,Te,D.colorSpace);Ne(we,D,j);let Ie;const nt=D.mipmaps,Rt=a&&D.isVideoTexture!==!0,K=Ke.__version===void 0||_e===!0,Pe=R(D,he,j);if(D.isDepthTexture)be=n.DEPTH_COMPONENT,a?D.type===ls?be=n.DEPTH_COMPONENT32F:D.type===Hs?be=n.DEPTH_COMPONENT24:D.type===Oo?be=n.DEPTH24_STENCIL8:be=n.DEPTH_COMPONENT16:D.type===ls&&console.error("WebGLRenderer: Floating point depth texture requires WebGL2."),D.format===Uo&&be===n.DEPTH_COMPONENT&&D.type!==Pg&&D.type!==Hs&&(console.warn("THREE.WebGLRenderer: Use UnsignedShortType or UnsignedIntType for DepthFormat DepthTexture."),D.type=Hs,Te=s.convert(D.type)),D.format===rl&&be===n.DEPTH_COMPONENT&&(be=n.DEPTH_STENCIL,D.type!==Oo&&(console.warn("THREE.WebGLRenderer: Use UnsignedInt248Type for DepthStencilFormat DepthTexture."),D.type=Oo,Te=s.convert(D.type))),K&&(Rt?t.texStorage2D(n.TEXTURE_2D,1,be,he.width,he.height):t.texImage2D(n.TEXTURE_2D,0,be,he.width,he.height,0,fe,Te,null));else if(D.isDataTexture)if(nt.length>0&&j){Rt&&K&&t.texStorage2D(n.TEXTURE_2D,Pe,be,nt[0].width,nt[0].height);for(let oe=0,Be=nt.length;oe<Be;oe++)Ie=nt[oe],Rt?t.texSubImage2D(n.TEXTURE_2D,oe,0,0,Ie.width,Ie.height,fe,Te,Ie.data):t.texImage2D(n.TEXTURE_2D,oe,be,Ie.width,Ie.height,0,fe,Te,Ie.data);D.generateMipmaps=!1}else Rt?(K&&t.texStorage2D(n.TEXTURE_2D,Pe,be,he.width,he.height),t.texSubImage2D(n.TEXTURE_2D,0,0,0,he.width,he.height,fe,Te,he.data)):t.texImage2D(n.TEXTURE_2D,0,be,he.width,he.height,0,fe,Te,he.data);else if(D.isCompressedTexture)if(D.isCompressedArrayTexture){Rt&&K&&t.texStorage3D(n.TEXTURE_2D_ARRAY,Pe,be,nt[0].width,nt[0].height,he.depth);for(let oe=0,Be=nt.length;oe<Be;oe++)Ie=nt[oe],D.format!==Ti?fe!==null?Rt?t.compressedTexSubImage3D(n.TEXTURE_2D_ARRAY,oe,0,0,0,Ie.width,Ie.height,he.depth,fe,Ie.data,0,0):t.compressedTexImage3D(n.TEXTURE_2D_ARRAY,oe,be,Ie.width,Ie.height,he.depth,0,Ie.data,0,0):console.warn("THREE.WebGLRenderer: Attempt to load unsupported compressed texture format in .uploadTexture()"):Rt?t.texSubImage3D(n.TEXTURE_2D_ARRAY,oe,0,0,0,Ie.width,Ie.height,he.depth,fe,Te,Ie.data):t.texImage3D(n.TEXTURE_2D_ARRAY,oe,be,Ie.width,Ie.height,he.depth,0,fe,Te,Ie.data)}else{Rt&&K&&t.texStorage2D(n.TEXTURE_2D,Pe,be,nt[0].width,nt[0].height);for(let oe=0,Be=nt.length;oe<Be;oe++)Ie=nt[oe],D.format!==Ti?fe!==null?Rt?t.compressedTexSubImage2D(n.TEXTURE_2D,oe,0,0,Ie.width,Ie.height,fe,Ie.data):t.compressedTexImage2D(n.TEXTURE_2D,oe,be,Ie.width,Ie.height,0,Ie.data):console.warn("THREE.WebGLRenderer: Attempt to load unsupported compressed texture format in .uploadTexture()"):Rt?t.texSubImage2D(n.TEXTURE_2D,oe,0,0,Ie.width,Ie.height,fe,Te,Ie.data):t.texImage2D(n.TEXTURE_2D,oe,be,Ie.width,Ie.height,0,fe,Te,Ie.data)}else if(D.isDataArrayTexture)Rt?(K&&t.texStorage3D(n.TEXTURE_2D_ARRAY,Pe,be,he.width,he.height,he.depth),t.texSubImage3D(n.TEXTURE_2D_ARRAY,0,0,0,0,he.width,he.height,he.depth,fe,Te,he.data)):t.texImage3D(n.TEXTURE_2D_ARRAY,0,be,he.width,he.height,he.depth,0,fe,Te,he.data);else if(D.isData3DTexture)Rt?(K&&t.texStorage3D(n.TEXTURE_3D,Pe,be,he.width,he.height,he.depth),t.texSubImage3D(n.TEXTURE_3D,0,0,0,0,he.width,he.height,he.depth,fe,Te,he.data)):t.texImage3D(n.TEXTURE_3D,0,be,he.width,he.height,he.depth,0,fe,Te,he.data);else if(D.isFramebufferTexture){if(K)if(Rt)t.texStorage2D(n.TEXTURE_2D,Pe,be,he.width,he.height);else{let oe=he.width,Be=he.height;for(let He=0;He<Pe;He++)t.texImage2D(n.TEXTURE_2D,He,be,oe,Be,0,fe,Te,null),oe>>=1,Be>>=1}}else if(nt.length>0&&j){Rt&&K&&t.texStorage2D(n.TEXTURE_2D,Pe,be,nt[0].width,nt[0].height);for(let oe=0,Be=nt.length;oe<Be;oe++)Ie=nt[oe],Rt?t.texSubImage2D(n.TEXTURE_2D,oe,0,0,fe,Te,Ie):t.texImage2D(n.TEXTURE_2D,oe,be,fe,Te,Ie);D.generateMipmaps=!1}else Rt?(K&&t.texStorage2D(n.TEXTURE_2D,Pe,be,he.width,he.height),t.texSubImage2D(n.TEXTURE_2D,0,0,0,fe,Te,he)):t.texImage2D(n.TEXTURE_2D,0,be,fe,Te,he);b(D,j)&&P(we),Ke.__version=De.version,D.onUpdate&&D.onUpdate(D)}k.__version=D.version}function tt(k,D,le){if(D.image.length!==6)return;const we=We(k,D),_e=D.source;t.bindTexture(n.TEXTURE_CUBE_MAP,k.__webglTexture,n.TEXTURE0+le);const De=i.get(_e);if(_e.version!==De.__version||we===!0){t.activeTexture(n.TEXTURE0+le),n.pixelStorei(n.UNPACK_FLIP_Y_WEBGL,D.flipY),n.pixelStorei(n.UNPACK_PREMULTIPLY_ALPHA_WEBGL,D.premultiplyAlpha),n.pixelStorei(n.UNPACK_ALIGNMENT,D.unpackAlignment),n.pixelStorei(n.UNPACK_COLORSPACE_CONVERSION_WEBGL,n.NONE);const Ke=D.isCompressedTexture||D.image[0].isCompressedTexture,Le=D.image[0]&&D.image[0].isDataTexture,he=[];for(let oe=0;oe<6;oe++)!Ke&&!Le?he[oe]=S(D.image[oe],!1,!0,u):he[oe]=Le?D.image[oe].image:D.image[oe],he[oe]=Ut(D,he[oe]);const j=he[0],fe=E(j)||a,Te=s.convert(D.format,D.colorSpace),be=s.convert(D.type),Ie=B(D.internalFormat,Te,be,D.colorSpace),nt=a&&D.isVideoTexture!==!0,Rt=De.__version===void 0||we===!0;let K=R(D,j,fe);Ne(n.TEXTURE_CUBE_MAP,D,fe);let Pe;if(Ke){nt&&Rt&&t.texStorage2D(n.TEXTURE_CUBE_MAP,K,Ie,j.width,j.height);for(let oe=0;oe<6;oe++){Pe=he[oe].mipmaps;for(let Be=0;Be<Pe.length;Be++){const He=Pe[Be];D.format!==Ti?Te!==null?nt?t.compressedTexSubImage2D(n.TEXTURE_CUBE_MAP_POSITIVE_X+oe,Be,0,0,He.width,He.height,Te,He.data):t.compressedTexImage2D(n.TEXTURE_CUBE_MAP_POSITIVE_X+oe,Be,Ie,He.width,He.height,0,He.data):console.warn("THREE.WebGLRenderer: Attempt to load unsupported compressed texture format in .setTextureCube()"):nt?t.texSubImage2D(n.TEXTURE_CUBE_MAP_POSITIVE_X+oe,Be,0,0,He.width,He.height,Te,be,He.data):t.texImage2D(n.TEXTURE_CUBE_MAP_POSITIVE_X+oe,Be,Ie,He.width,He.height,0,Te,be,He.data)}}}else{Pe=D.mipmaps,nt&&Rt&&(Pe.length>0&&K++,t.texStorage2D(n.TEXTURE_CUBE_MAP,K,Ie,he[0].width,he[0].height));for(let oe=0;oe<6;oe++)if(Le){nt?t.texSubImage2D(n.TEXTURE_CUBE_MAP_POSITIVE_X+oe,0,0,0,he[oe].width,he[oe].height,Te,be,he[oe].data):t.texImage2D(n.TEXTURE_CUBE_MAP_POSITIVE_X+oe,0,Ie,he[oe].width,he[oe].height,0,Te,be,he[oe].data);for(let Be=0;Be<Pe.length;Be++){const wt=Pe[Be].image[oe].image;nt?t.texSubImage2D(n.TEXTURE_CUBE_MAP_POSITIVE_X+oe,Be+1,0,0,wt.width,wt.height,Te,be,wt.data):t.texImage2D(n.TEXTURE_CUBE_MAP_POSITIVE_X+oe,Be+1,Ie,wt.width,wt.height,0,Te,be,wt.data)}}else{nt?t.texSubImage2D(n.TEXTURE_CUBE_MAP_POSITIVE_X+oe,0,0,0,Te,be,he[oe]):t.texImage2D(n.TEXTURE_CUBE_MAP_POSITIVE_X+oe,0,Ie,Te,be,he[oe]);for(let Be=0;Be<Pe.length;Be++){const He=Pe[Be];nt?t.texSubImage2D(n.TEXTURE_CUBE_MAP_POSITIVE_X+oe,Be+1,0,0,Te,be,He.image[oe]):t.texImage2D(n.TEXTURE_CUBE_MAP_POSITIVE_X+oe,Be+1,Ie,Te,be,He.image[oe])}}}b(D,fe)&&P(n.TEXTURE_CUBE_MAP),De.__version=_e.version,D.onUpdate&&D.onUpdate(D)}k.__version=D.version}function Se(k,D,le,we,_e){const De=s.convert(le.format,le.colorSpace),Ke=s.convert(le.type),Le=B(le.internalFormat,De,Ke,le.colorSpace);i.get(D).__hasExternalTextures||(_e===n.TEXTURE_3D||_e===n.TEXTURE_2D_ARRAY?t.texImage3D(_e,0,Le,D.width,D.height,D.depth,0,De,Ke,null):t.texImage2D(_e,0,Le,D.width,D.height,0,De,Ke,null)),t.bindFramebuffer(n.FRAMEBUFFER,k),qe(D)?p.framebufferTexture2DMultisampleEXT(n.FRAMEBUFFER,we,_e,i.get(le).__webglTexture,0,Ge(D)):(_e===n.TEXTURE_2D||_e>=n.TEXTURE_CUBE_MAP_POSITIVE_X&&_e<=n.TEXTURE_CUBE_MAP_NEGATIVE_Z)&&n.framebufferTexture2D(n.FRAMEBUFFER,we,_e,i.get(le).__webglTexture,0),t.bindFramebuffer(n.FRAMEBUFFER,null)}function G(k,D,le){if(n.bindRenderbuffer(n.RENDERBUFFER,k),D.depthBuffer&&!D.stencilBuffer){let we=n.DEPTH_COMPONENT16;if(le||qe(D)){const _e=D.depthTexture;_e&&_e.isDepthTexture&&(_e.type===ls?we=n.DEPTH_COMPONENT32F:_e.type===Hs&&(we=n.DEPTH_COMPONENT24));const De=Ge(D);qe(D)?p.renderbufferStorageMultisampleEXT(n.RENDERBUFFER,De,we,D.width,D.height):n.renderbufferStorageMultisample(n.RENDERBUFFER,De,we,D.width,D.height)}else n.renderbufferStorage(n.RENDERBUFFER,we,D.width,D.height);n.framebufferRenderbuffer(n.FRAMEBUFFER,n.DEPTH_ATTACHMENT,n.RENDERBUFFER,k)}else if(D.depthBuffer&&D.stencilBuffer){const we=Ge(D);le&&qe(D)===!1?n.renderbufferStorageMultisample(n.RENDERBUFFER,we,n.DEPTH24_STENCIL8,D.width,D.height):qe(D)?p.renderbufferStorageMultisampleEXT(n.RENDERBUFFER,we,n.DEPTH24_STENCIL8,D.width,D.height):n.renderbufferStorage(n.RENDERBUFFER,n.DEPTH_STENCIL,D.width,D.height),n.framebufferRenderbuffer(n.FRAMEBUFFER,n.DEPTH_STENCIL_ATTACHMENT,n.RENDERBUFFER,k)}else{const we=D.isWebGLMultipleRenderTargets===!0?D.texture:[D.texture];for(let _e=0;_e<we.length;_e++){const De=we[_e],Ke=s.convert(De.format,De.colorSpace),Le=s.convert(De.type),he=B(De.internalFormat,Ke,Le,De.colorSpace),j=Ge(D);le&&qe(D)===!1?n.renderbufferStorageMultisample(n.RENDERBUFFER,j,he,D.width,D.height):qe(D)?p.renderbufferStorageMultisampleEXT(n.RENDERBUFFER,j,he,D.width,D.height):n.renderbufferStorage(n.RENDERBUFFER,he,D.width,D.height)}}n.bindRenderbuffer(n.RENDERBUFFER,null)}function ye(k,D){if(D&&D.isWebGLCubeRenderTarget)throw new Error("Depth Texture with cube render targets is not supported");if(t.bindFramebuffer(n.FRAMEBUFFER,k),!(D.depthTexture&&D.depthTexture.isDepthTexture))throw new Error("renderTarget.depthTexture must be an instance of THREE.DepthTexture");(!i.get(D.depthTexture).__webglTexture||D.depthTexture.image.width!==D.width||D.depthTexture.image.height!==D.height)&&(D.depthTexture.image.width=D.width,D.depthTexture.image.height=D.height,D.depthTexture.needsUpdate=!0),H(D.depthTexture,0);const we=i.get(D.depthTexture).__webglTexture,_e=Ge(D);if(D.depthTexture.format===Uo)qe(D)?p.framebufferTexture2DMultisampleEXT(n.FRAMEBUFFER,n.DEPTH_ATTACHMENT,n.TEXTURE_2D,we,0,_e):n.framebufferTexture2D(n.FRAMEBUFFER,n.DEPTH_ATTACHMENT,n.TEXTURE_2D,we,0);else if(D.depthTexture.format===rl)qe(D)?p.framebufferTexture2DMultisampleEXT(n.FRAMEBUFFER,n.DEPTH_STENCIL_ATTACHMENT,n.TEXTURE_2D,we,0,_e):n.framebufferTexture2D(n.FRAMEBUFFER,n.DEPTH_STENCIL_ATTACHMENT,n.TEXTURE_2D,we,0);else throw new Error("Unknown depthTexture format")}function pe(k){const D=i.get(k),le=k.isWebGLCubeRenderTarget===!0;if(k.depthTexture&&!D.__autoAllocateDepthBuffer){if(le)throw new Error("target.depthTexture not supported in Cube render targets");ye(D.__webglFramebuffer,k)}else if(le){D.__webglDepthbuffer=[];for(let we=0;we<6;we++)t.bindFramebuffer(n.FRAMEBUFFER,D.__webglFramebuffer[we]),D.__webglDepthbuffer[we]=n.createRenderbuffer(),G(D.__webglDepthbuffer[we],k,!1)}else t.bindFramebuffer(n.FRAMEBUFFER,D.__webglFramebuffer),D.__webglDepthbuffer=n.createRenderbuffer(),G(D.__webglDepthbuffer,k,!1);t.bindFramebuffer(n.FRAMEBUFFER,null)}function Me(k,D,le){const we=i.get(k);D!==void 0&&Se(we.__webglFramebuffer,k,k.texture,n.COLOR_ATTACHMENT0,n.TEXTURE_2D),le!==void 0&&pe(k)}function xe(k){const D=k.texture,le=i.get(k),we=i.get(D);k.addEventListener("dispose",$),k.isWebGLMultipleRenderTargets!==!0&&(we.__webglTexture===void 0&&(we.__webglTexture=n.createTexture()),we.__version=D.version,o.memory.textures++);const _e=k.isWebGLCubeRenderTarget===!0,De=k.isWebGLMultipleRenderTargets===!0,Ke=E(k)||a;if(_e){le.__webglFramebuffer=[];for(let Le=0;Le<6;Le++)le.__webglFramebuffer[Le]=n.createFramebuffer()}else{if(le.__webglFramebuffer=n.createFramebuffer(),De)if(r.drawBuffers){const Le=k.texture;for(let he=0,j=Le.length;he<j;he++){const fe=i.get(Le[he]);fe.__webglTexture===void 0&&(fe.__webglTexture=n.createTexture(),o.memory.textures++)}}else console.warn("THREE.WebGLRenderer: WebGLMultipleRenderTargets can only be used with WebGL2 or WEBGL_draw_buffers extension.");if(a&&k.samples>0&&qe(k)===!1){const Le=De?D:[D];le.__webglMultisampledFramebuffer=n.createFramebuffer(),le.__webglColorRenderbuffer=[],t.bindFramebuffer(n.FRAMEBUFFER,le.__webglMultisampledFramebuffer);for(let he=0;he<Le.length;he++){const j=Le[he];le.__webglColorRenderbuffer[he]=n.createRenderbuffer(),n.bindRenderbuffer(n.RENDERBUFFER,le.__webglColorRenderbuffer[he]);const fe=s.convert(j.format,j.colorSpace),Te=s.convert(j.type),be=B(j.internalFormat,fe,Te,j.colorSpace,k.isXRRenderTarget===!0),Ie=Ge(k);n.renderbufferStorageMultisample(n.RENDERBUFFER,Ie,be,k.width,k.height),n.framebufferRenderbuffer(n.FRAMEBUFFER,n.COLOR_ATTACHMENT0+he,n.RENDERBUFFER,le.__webglColorRenderbuffer[he])}n.bindRenderbuffer(n.RENDERBUFFER,null),k.depthBuffer&&(le.__webglDepthRenderbuffer=n.createRenderbuffer(),G(le.__webglDepthRenderbuffer,k,!0)),t.bindFramebuffer(n.FRAMEBUFFER,null)}}if(_e){t.bindTexture(n.TEXTURE_CUBE_MAP,we.__webglTexture),Ne(n.TEXTURE_CUBE_MAP,D,Ke);for(let Le=0;Le<6;Le++)Se(le.__webglFramebuffer[Le],k,D,n.COLOR_ATTACHMENT0,n.TEXTURE_CUBE_MAP_POSITIVE_X+Le);b(D,Ke)&&P(n.TEXTURE_CUBE_MAP),t.unbindTexture()}else if(De){const Le=k.texture;for(let he=0,j=Le.length;he<j;he++){const fe=Le[he],Te=i.get(fe);t.bindTexture(n.TEXTURE_2D,Te.__webglTexture),Ne(n.TEXTURE_2D,fe,Ke),Se(le.__webglFramebuffer,k,fe,n.COLOR_ATTACHMENT0+he,n.TEXTURE_2D),b(fe,Ke)&&P(n.TEXTURE_2D)}t.unbindTexture()}else{let Le=n.TEXTURE_2D;(k.isWebGL3DRenderTarget||k.isWebGLArrayRenderTarget)&&(a?Le=k.isWebGL3DRenderTarget?n.TEXTURE_3D:n.TEXTURE_2D_ARRAY:console.error("THREE.WebGLTextures: THREE.Data3DTexture and THREE.DataArrayTexture only supported with WebGL2.")),t.bindTexture(Le,we.__webglTexture),Ne(Le,D,Ke),Se(le.__webglFramebuffer,k,D,n.COLOR_ATTACHMENT0,Le),b(D,Ke)&&P(Le),t.unbindTexture()}k.depthBuffer&&pe(k)}function Ve(k){const D=E(k)||a,le=k.isWebGLMultipleRenderTargets===!0?k.texture:[k.texture];for(let we=0,_e=le.length;we<_e;we++){const De=le[we];if(b(De,D)){const Ke=k.isWebGLCubeRenderTarget?n.TEXTURE_CUBE_MAP:n.TEXTURE_2D,Le=i.get(De).__webglTexture;t.bindTexture(Ke,Le),P(Ke),t.unbindTexture()}}}function Ue(k){if(a&&k.samples>0&&qe(k)===!1){const D=k.isWebGLMultipleRenderTargets?k.texture:[k.texture],le=k.width,we=k.height;let _e=n.COLOR_BUFFER_BIT;const De=[],Ke=k.stencilBuffer?n.DEPTH_STENCIL_ATTACHMENT:n.DEPTH_ATTACHMENT,Le=i.get(k),he=k.isWebGLMultipleRenderTargets===!0;if(he)for(let j=0;j<D.length;j++)t.bindFramebuffer(n.FRAMEBUFFER,Le.__webglMultisampledFramebuffer),n.framebufferRenderbuffer(n.FRAMEBUFFER,n.COLOR_ATTACHMENT0+j,n.RENDERBUFFER,null),t.bindFramebuffer(n.FRAMEBUFFER,Le.__webglFramebuffer),n.framebufferTexture2D(n.DRAW_FRAMEBUFFER,n.COLOR_ATTACHMENT0+j,n.TEXTURE_2D,null,0);t.bindFramebuffer(n.READ_FRAMEBUFFER,Le.__webglMultisampledFramebuffer),t.bindFramebuffer(n.DRAW_FRAMEBUFFER,Le.__webglFramebuffer);for(let j=0;j<D.length;j++){De.push(n.COLOR_ATTACHMENT0+j),k.depthBuffer&&De.push(Ke);const fe=Le.__ignoreDepthValues!==void 0?Le.__ignoreDepthValues:!1;if(fe===!1&&(k.depthBuffer&&(_e|=n.DEPTH_BUFFER_BIT),k.stencilBuffer&&(_e|=n.STENCIL_BUFFER_BIT)),he&&n.framebufferRenderbuffer(n.READ_FRAMEBUFFER,n.COLOR_ATTACHMENT0,n.RENDERBUFFER,Le.__webglColorRenderbuffer[j]),fe===!0&&(n.invalidateFramebuffer(n.READ_FRAMEBUFFER,[Ke]),n.invalidateFramebuffer(n.DRAW_FRAMEBUFFER,[Ke])),he){const Te=i.get(D[j]).__webglTexture;n.framebufferTexture2D(n.DRAW_FRAMEBUFFER,n.COLOR_ATTACHMENT0,n.TEXTURE_2D,Te,0)}n.blitFramebuffer(0,0,le,we,0,0,le,we,_e,n.NEAREST),m&&n.invalidateFramebuffer(n.READ_FRAMEBUFFER,De)}if(t.bindFramebuffer(n.READ_FRAMEBUFFER,null),t.bindFramebuffer(n.DRAW_FRAMEBUFFER,null),he)for(let j=0;j<D.length;j++){t.bindFramebuffer(n.FRAMEBUFFER,Le.__webglMultisampledFramebuffer),n.framebufferRenderbuffer(n.FRAMEBUFFER,n.COLOR_ATTACHMENT0+j,n.RENDERBUFFER,Le.__webglColorRenderbuffer[j]);const fe=i.get(D[j]).__webglTexture;t.bindFramebuffer(n.FRAMEBUFFER,Le.__webglFramebuffer),n.framebufferTexture2D(n.DRAW_FRAMEBUFFER,n.COLOR_ATTACHMENT0+j,n.TEXTURE_2D,fe,0)}t.bindFramebuffer(n.DRAW_FRAMEBUFFER,Le.__webglMultisampledFramebuffer)}}function Ge(k){return Math.min(d,k.samples)}function qe(k){const D=i.get(k);return a&&k.samples>0&&e.has("WEBGL_multisampled_render_to_texture")===!0&&D.__useRenderToTexture!==!1}function vt(k){const D=o.render.frame;y.get(k)!==D&&(y.set(k,D),k.update())}function Ut(k,D){const le=k.colorSpace,we=k.format,_e=k.type;return k.isCompressedTexture===!0||k.format===Qm||le!==Vr&&le!==Ho&&(le===mt?a===!1?e.has("EXT_sRGB")===!0&&we===Ti?(k.format=Qm,k.minFilter=rn,k.generateMipmaps=!1):D=yS.sRGBToLinear(D):(we!==Ti||_e!==hs)&&console.warn("THREE.WebGLTextures: sRGB encoded textures have to use RGBAFormat and UnsignedByteType."):console.error("THREE.WebGLTextures: Unsupported texture color space:",le)),D}this.allocateTextureUnit=I,this.resetTextureUnits=ee,this.setTexture2D=H,this.setTexture2DArray=U,this.setTexture3D=W,this.setTextureCube=ve,this.rebindTextures=Me,this.setupRenderTarget=xe,this.updateRenderTargetMipmap=Ve,this.updateMultisampleRenderTarget=Ue,this.setupDepthRenderbuffer=pe,this.setupFrameBufferTexture=Se,this.useMultisampledRTT=qe}function m2(n,e,t){const i=t.isWebGL2;function r(s,o=Ho){let a;if(s===hs)return n.UNSIGNED_BYTE;if(s===lS)return n.UNSIGNED_SHORT_4_4_4_4;if(s===cS)return n.UNSIGNED_SHORT_5_5_5_1;if(s===IB)return n.BYTE;if(s===DB)return n.SHORT;if(s===Pg)return n.UNSIGNED_SHORT;if(s===aS)return n.INT;if(s===Hs)return n.UNSIGNED_INT;if(s===ls)return n.FLOAT;if(s===Kc)return i?n.HALF_FLOAT:(a=e.get("OES_texture_half_float"),a!==null?a.HALF_FLOAT_OES:null);if(s===FB)return n.ALPHA;if(s===Ti)return n.RGBA;if(s===NB)return n.LUMINANCE;if(s===OB)return n.LUMINANCE_ALPHA;if(s===Uo)return n.DEPTH_COMPONENT;if(s===rl)return n.DEPTH_STENCIL;if(s===Qm)return a=e.get("EXT_sRGB"),a!==null?a.SRGB_ALPHA_EXT:null;if(s===UB)return n.RED;if(s===uS)return n.RED_INTEGER;if(s===kB)return n.RG;if(s===fS)return n.RG_INTEGER;if(s===hS)return n.RGBA_INTEGER;if(s===fm||s===hm||s===dm||s===pm)if(o===mt)if(a=e.get("WEBGL_compressed_texture_s3tc_srgb"),a!==null){if(s===fm)return a.COMPRESSED_SRGB_S3TC_DXT1_EXT;if(s===hm)return a.COMPRESSED_SRGB_ALPHA_S3TC_DXT1_EXT;if(s===dm)return a.COMPRESSED_SRGB_ALPHA_S3TC_DXT3_EXT;if(s===pm)return a.COMPRESSED_SRGB_ALPHA_S3TC_DXT5_EXT}else return null;else if(a=e.get("WEBGL_compressed_texture_s3tc"),a!==null){if(s===fm)return a.COMPRESSED_RGB_S3TC_DXT1_EXT;if(s===hm)return a.COMPRESSED_RGBA_S3TC_DXT1_EXT;if(s===dm)return a.COMPRESSED_RGBA_S3TC_DXT3_EXT;if(s===pm)return a.COMPRESSED_RGBA_S3TC_DXT5_EXT}else return null;if(s===r_||s===s_||s===o_||s===a_)if(a=e.get("WEBGL_compressed_texture_pvrtc"),a!==null){if(s===r_)return a.COMPRESSED_RGB_PVRTC_4BPPV1_IMG;if(s===s_)return a.COMPRESSED_RGB_PVRTC_2BPPV1_IMG;if(s===o_)return a.COMPRESSED_RGBA_PVRTC_4BPPV1_IMG;if(s===a_)return a.COMPRESSED_RGBA_PVRTC_2BPPV1_IMG}else return null;if(s===HB)return a=e.get("WEBGL_compressed_texture_etc1"),a!==null?a.COMPRESSED_RGB_ETC1_WEBGL:null;if(s===l_||s===c_)if(a=e.get("WEBGL_compressed_texture_etc"),a!==null){if(s===l_)return o===mt?a.COMPRESSED_SRGB8_ETC2:a.COMPRESSED_RGB8_ETC2;if(s===c_)return o===mt?a.COMPRESSED_SRGB8_ALPHA8_ETC2_EAC:a.COMPRESSED_RGBA8_ETC2_EAC}else return null;if(s===u_||s===f_||s===h_||s===d_||s===p_||s===m_||s===g_||s===v_||s===y_||s===x_||s===__||s===A_||s===S_||s===M_)if(a=e.get("WEBGL_compressed_texture_astc"),a!==null){if(s===u_)return o===mt?a.COMPRESSED_SRGB8_ALPHA8_ASTC_4x4_KHR:a.COMPRESSED_RGBA_ASTC_4x4_KHR;if(s===f_)return o===mt?a.COMPRESSED_SRGB8_ALPHA8_ASTC_5x4_KHR:a.COMPRESSED_RGBA_ASTC_5x4_KHR;if(s===h_)return o===mt?a.COMPRESSED_SRGB8_ALPHA8_ASTC_5x5_KHR:a.COMPRESSED_RGBA_ASTC_5x5_KHR;if(s===d_)return o===mt?a.COMPRESSED_SRGB8_ALPHA8_ASTC_6x5_KHR:a.COMPRESSED_RGBA_ASTC_6x5_KHR;if(s===p_)return o===mt?a.COMPRESSED_SRGB8_ALPHA8_ASTC_6x6_KHR:a.COMPRESSED_RGBA_ASTC_6x6_KHR;if(s===m_)return o===mt?a.COMPRESSED_SRGB8_ALPHA8_ASTC_8x5_KHR:a.COMPRESSED_RGBA_ASTC_8x5_KHR;if(s===g_)return o===mt?a.COMPRESSED_SRGB8_ALPHA8_ASTC_8x6_KHR:a.COMPRESSED_RGBA_ASTC_8x6_KHR;if(s===v_)return o===mt?a.COMPRESSED_SRGB8_ALPHA8_ASTC_8x8_KHR:a.COMPRESSED_RGBA_ASTC_8x8_KHR;if(s===y_)return o===mt?a.COMPRESSED_SRGB8_ALPHA8_ASTC_10x5_KHR:a.COMPRESSED_RGBA_ASTC_10x5_KHR;if(s===x_)return o===mt?a.COMPRESSED_SRGB8_ALPHA8_ASTC_10x6_KHR:a.COMPRESSED_RGBA_ASTC_10x6_KHR;if(s===__)return o===mt?a.COMPRESSED_SRGB8_ALPHA8_ASTC_10x8_KHR:a.COMPRESSED_RGBA_ASTC_10x8_KHR;if(s===A_)return o===mt?a.COMPRESSED_SRGB8_ALPHA8_ASTC_10x10_KHR:a.COMPRESSED_RGBA_ASTC_10x10_KHR;if(s===S_)return o===mt?a.COMPRESSED_SRGB8_ALPHA8_ASTC_12x10_KHR:a.COMPRESSED_RGBA_ASTC_12x10_KHR;if(s===M_)return o===mt?a.COMPRESSED_SRGB8_ALPHA8_ASTC_12x12_KHR:a.COMPRESSED_RGBA_ASTC_12x12_KHR}else return null;if(s===mm)if(a=e.get("EXT_texture_compression_bptc"),a!==null){if(s===mm)return o===mt?a.COMPRESSED_SRGB_ALPHA_BPTC_UNORM_EXT:a.COMPRESSED_RGBA_BPTC_UNORM_EXT}else return null;if(s===zB||s===E_||s===w_||s===T_)if(a=e.get("EXT_texture_compression_rgtc"),a!==null){if(s===mm)return a.COMPRESSED_RED_RGTC1_EXT;if(s===E_)return a.COMPRESSED_SIGNED_RED_RGTC1_EXT;if(s===w_)return a.COMPRESSED_RED_GREEN_RGTC2_EXT;if(s===T_)return a.COMPRESSED_SIGNED_RED_GREEN_RGTC2_EXT}else return null;return s===Oo?i?n.UNSIGNED_INT_24_8:(a=e.get("WEBGL_depth_texture"),a!==null?a.UNSIGNED_INT_24_8_WEBGL:null):n[s]!==void 0?n[s]:null}return{convert:r}}class g2 extends qt{constructor(e=[]){super(),this.isArrayCamera=!0,this.cameras=e}}class zs extends bt{constructor(){super(),this.isGroup=!0,this.type="Group"}}const qG={type:"move"};class uy{constructor(){this._targetRay=null,this._grip=null,this._hand=null}getHandSpace(){return this._hand===null&&(this._hand=new zs,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 zs,this._targetRay.matrixAutoUpdate=!1,this._targetRay.visible=!1,this._targetRay.hasLinearVelocity=!1,this._targetRay.linearVelocity=new F,this._targetRay.hasAngularVelocity=!1,this._targetRay.angularVelocity=new F),this._targetRay}getGripSpace(){return this._grip===null&&(this._grip=new zs,this._grip.matrixAutoUpdate=!1,this._grip.visible=!1,this._grip.hasLinearVelocity=!1,this._grip.linearVelocity=new F,this._grip.hasAngularVelocity=!1,this._grip.angularVelocity=new F),this._grip}dispatchEvent(e){return this._targetRay!==null&&this._targetRay.dispatchEvent(e),this._grip!==null&&this._grip.dispatchEvent(e),this._hand!==null&&this._hand.dispatchEvent(e),this}connect(e){if(e&&e.hand){const t=this._hand;if(t)for(const i of e.hand.values())this._getHandJoint(t,i)}return this.dispatchEvent({type:"connected",data:e}),this}disconnect(e){return this.dispatchEvent({type:"disconnected",data:e}),this._targetRay!==null&&(this._targetRay.visible=!1),this._grip!==null&&(this._grip.visible=!1),this._hand!==null&&(this._hand.visible=!1),this}update(e,t,i){let r=null,s=null,o=null;const a=this._targetRay,l=this._grip,u=this._hand;if(e&&t.session.visibilityState!=="visible-blurred"){if(u&&e.hand){o=!0;for(const M of e.hand.values()){const _=t.getJointPose(M,i),g=this._getHandJoint(u,M);_!==null&&(g.matrix.fromArray(_.transform.matrix),g.matrix.decompose(g.position,g.rotation,g.scale),g.matrixWorldNeedsUpdate=!0,g.jointRadius=_.radius),g.visible=_!==null}const h=u.joints["index-finger-tip"],d=u.joints["thumb-tip"],p=h.position.distanceTo(d.position),m=.02,y=.005;u.inputState.pinching&&p>m+y?(u.inputState.pinching=!1,this.dispatchEvent({type:"pinchend",handedness:e.handedness,target:this})):!u.inputState.pinching&&p<=m-y&&(u.inputState.pinching=!0,this.dispatchEvent({type:"pinchstart",handedness:e.handedness,target:this}))}else l!==null&&e.gripSpace&&(s=t.getPose(e.gripSpace,i),s!==null&&(l.matrix.fromArray(s.transform.matrix),l.matrix.decompose(l.position,l.rotation,l.scale),l.matrixWorldNeedsUpdate=!0,s.linearVelocity?(l.hasLinearVelocity=!0,l.linearVelocity.copy(s.linearVelocity)):l.hasLinearVelocity=!1,s.angularVelocity?(l.hasAngularVelocity=!0,l.angularVelocity.copy(s.angularVelocity)):l.hasAngularVelocity=!1));a!==null&&(r=t.getPose(e.targetRaySpace,i),r===null&&s!==null&&(r=s),r!==null&&(a.matrix.fromArray(r.transform.matrix),a.matrix.decompose(a.position,a.rotation,a.scale),a.matrixWorldNeedsUpdate=!0,r.linearVelocity?(a.hasLinearVelocity=!0,a.linearVelocity.copy(r.linearVelocity)):a.hasLinearVelocity=!1,r.angularVelocity?(a.hasAngularVelocity=!0,a.angularVelocity.copy(r.angularVelocity)):a.hasAngularVelocity=!1,this.dispatchEvent(qG)))}return a!==null&&(a.visible=r!==null),l!==null&&(l.visible=s!==null),u!==null&&(u.visible=o!==null),this}_getHandJoint(e,t){if(e.joints[t.jointName]===void 0){const i=new zs;i.matrixAutoUpdate=!1,i.visible=!1,e.joints[t.jointName]=i,e.add(i)}return e.joints[t.jointName]}}class v2 extends $t{constructor(e,t,i,r,s,o,a,l,u,h){if(h=h!==void 0?h:Uo,h!==Uo&&h!==rl)throw new Error("DepthTexture format must be either THREE.DepthFormat or THREE.DepthStencilFormat");i===void 0&&h===Uo&&(i=Hs),i===void 0&&h===rl&&(i=Oo),super(null,r,s,o,a,l,h,i,u),this.isDepthTexture=!0,this.image={width:e,height:t},this.magFilter=a!==void 0?a:mn,this.minFilter=l!==void 0?l:mn,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 $G extends xs{constructor(e,t){super();const i=this;let r=null,s=1,o=null,a="local-floor",l=1,u=null,h=null,d=null,p=null,m=null,y=null;const M=t.getContextAttributes();let _=null,g=null;const x=[],S=[],E=new qt;E.layers.enable(1),E.viewport=new Nt;const C=new qt;C.layers.enable(2),C.viewport=new Nt;const b=[E,C],P=new g2;P.layers.enable(1),P.layers.enable(2);let B=null,R=null;this.cameraAutoUpdate=!0,this.enabled=!1,this.isPresenting=!1,this.getController=function(U){let W=x[U];return W===void 0&&(W=new uy,x[U]=W),W.getTargetRaySpace()},this.getControllerGrip=function(U){let W=x[U];return W===void 0&&(W=new uy,x[U]=W),W.getGripSpace()},this.getHand=function(U){let W=x[U];return W===void 0&&(W=new uy,x[U]=W),W.getHandSpace()};function L(U){const W=S.indexOf(U.inputSource);if(W===-1)return;const ve=x[W];ve!==void 0&&(ve.update(U.inputSource,U.frame,u||o),ve.dispatchEvent({type:U.type,data:U.inputSource}))}function z(){r.removeEventListener("select",L),r.removeEventListener("selectstart",L),r.removeEventListener("selectend",L),r.removeEventListener("squeeze",L),r.removeEventListener("squeezestart",L),r.removeEventListener("squeezeend",L),r.removeEventListener("end",z),r.removeEventListener("inputsourceschange",$);for(let U=0;U<x.length;U++){const W=S[U];W!==null&&(S[U]=null,x[U].disconnect(W))}B=null,R=null,e.setRenderTarget(_),m=null,p=null,d=null,r=null,g=null,H.stop(),i.isPresenting=!1,i.dispatchEvent({type:"sessionend"})}this.setFramebufferScaleFactor=function(U){s=U,i.isPresenting===!0&&console.warn("THREE.WebXRManager: Cannot change framebuffer scale while presenting.")},this.setReferenceSpaceType=function(U){a=U,i.isPresenting===!0&&console.warn("THREE.WebXRManager: Cannot change reference space type while presenting.")},this.getReferenceSpace=function(){return u||o},this.setReferenceSpace=function(U){u=U},this.getBaseLayer=function(){return p!==null?p:m},this.getBinding=function(){return d},this.getFrame=function(){return y},this.getSession=function(){return r},this.setSession=async function(U){if(r=U,r!==null){if(_=e.getRenderTarget(),r.addEventListener("select",L),r.addEventListener("selectstart",L),r.addEventListener("selectend",L),r.addEventListener("squeeze",L),r.addEventListener("squeezestart",L),r.addEventListener("squeezeend",L),r.addEventListener("end",z),r.addEventListener("inputsourceschange",$),M.xrCompatible!==!0&&await t.makeXRCompatible(),r.renderState.layers===void 0||e.capabilities.isWebGL2===!1){const W={antialias:r.renderState.layers===void 0?M.antialias:!0,alpha:!0,depth:M.depth,stencil:M.stencil,framebufferScaleFactor:s};m=new XRWebGLLayer(r,t,W),r.updateRenderState({baseLayer:m}),g=new Wr(m.framebufferWidth,m.framebufferHeight,{format:Ti,type:hs,colorSpace:e.outputColorSpace,stencilBuffer:M.stencil})}else{let W=null,ve=null,ue=null;M.depth&&(ue=M.stencil?t.DEPTH24_STENCIL8:t.DEPTH_COMPONENT24,W=M.stencil?rl:Uo,ve=M.stencil?Oo:Hs);const Ae={colorFormat:t.RGBA8,depthFormat:ue,scaleFactor:s};d=new XRWebGLBinding(r,t),p=d.createProjectionLayer(Ae),r.updateRenderState({layers:[p]}),g=new Wr(p.textureWidth,p.textureHeight,{format:Ti,type:hs,depthTexture:new v2(p.textureWidth,p.textureHeight,ve,void 0,void 0,void 0,void 0,void 0,void 0,W),stencilBuffer:M.stencil,colorSpace:e.outputColorSpace,samples:M.antialias?4:0});const Ee=e.properties.get(g);Ee.__ignoreDepthValues=p.ignoreDepthValues}g.isXRRenderTarget=!0,this.setFoveation(l),u=null,o=await r.requestReferenceSpace(a),H.setContext(r),H.start(),i.isPresenting=!0,i.dispatchEvent({type:"sessionstart"})}},this.getEnvironmentBlendMode=function(){if(r!==null)return r.environmentBlendMode};function $(U){for(let W=0;W<U.removed.length;W++){const ve=U.removed[W],ue=S.indexOf(ve);ue>=0&&(S[ue]=null,x[ue].disconnect(ve))}for(let W=0;W<U.added.length;W++){const ve=U.added[W];let ue=S.indexOf(ve);if(ue===-1){for(let Ee=0;Ee<x.length;Ee++)if(Ee>=S.length){S.push(ve),ue=Ee;break}else if(S[Ee]===null){S[Ee]=ve,ue=Ee;break}if(ue===-1)break}const Ae=x[ue];Ae&&Ae.connect(ve)}}const X=new F,Q=new F;function Y(U,W,ve){X.setFromMatrixPosition(W.matrixWorld),Q.setFromMatrixPosition(ve.matrixWorld);const ue=X.distanceTo(Q),Ae=W.projectionMatrix.elements,Ee=ve.projectionMatrix.elements,Ne=Ae[14]/(Ae[10]-1),We=Ae[14]/(Ae[10]+1),ct=(Ae[9]+1)/Ae[5],tt=(Ae[9]-1)/Ae[5],Se=(Ae[8]-1)/Ae[0],G=(Ee[8]+1)/Ee[0],ye=Ne*Se,pe=Ne*G,Me=ue/(-Se+G),xe=Me*-Se;W.matrixWorld.decompose(U.position,U.quaternion,U.scale),U.translateX(xe),U.translateZ(Me),U.matrixWorld.compose(U.position,U.quaternion,U.scale),U.matrixWorldInverse.copy(U.matrixWorld).invert();const Ve=Ne+Me,Ue=We+Me,Ge=ye-xe,qe=pe+(ue-xe),vt=ct*We/Ue*Ve,Ut=tt*We/Ue*Ve;U.projectionMatrix.makePerspective(Ge,qe,vt,Ut,Ve,Ue),U.projectionMatrixInverse.copy(U.projectionMatrix).invert()}function ne(U,W){W===null?U.matrixWorld.copy(U.matrix):U.matrixWorld.multiplyMatrices(W.matrixWorld,U.matrix),U.matrixWorldInverse.copy(U.matrixWorld).invert()}this.updateCamera=function(U){if(r===null)return;P.near=C.near=E.near=U.near,P.far=C.far=E.far=U.far,(B!==P.near||R!==P.far)&&(r.updateRenderState({depthNear:P.near,depthFar:P.far}),B=P.near,R=P.far);const W=U.parent,ve=P.cameras;ne(P,W);for(let ue=0;ue<ve.length;ue++)ne(ve[ue],W);ve.length===2?Y(P,E,C):P.projectionMatrix.copy(E.projectionMatrix),ee(U,P,W)};function ee(U,W,ve){ve===null?U.matrix.copy(W.matrixWorld):(U.matrix.copy(ve.matrixWorld),U.matrix.invert(),U.matrix.multiply(W.matrixWorld)),U.matrix.decompose(U.position,U.quaternion,U.scale),U.updateMatrixWorld(!0);const ue=U.children;for(let Ae=0,Ee=ue.length;Ae<Ee;Ae++)ue[Ae].updateMatrixWorld(!0);U.projectionMatrix.copy(W.projectionMatrix),U.projectionMatrixInverse.copy(W.projectionMatrixInverse),U.isPerspectiveCamera&&(U.fov=Qc*2*Math.atan(1/U.projectionMatrix.elements[5]),U.zoom=1)}this.getCamera=function(){return P},this.getFoveation=function(){if(!(p===null&&m===null))return l},this.setFoveation=function(U){l=U,p!==null&&(p.fixedFoveation=U),m!==null&&m.fixedFoveation!==void 0&&(m.fixedFoveation=U)};let I=null;function V(U,W){if(h=W.getViewerPose(u||o),y=W,h!==null){const ve=h.views;m!==null&&(e.setRenderTargetFramebuffer(g,m.framebuffer),e.setRenderTarget(g));let ue=!1;ve.length!==P.cameras.length&&(P.cameras.length=0,ue=!0);for(let Ae=0;Ae<ve.length;Ae++){const Ee=ve[Ae];let Ne=null;if(m!==null)Ne=m.getViewport(Ee);else{const ct=d.getViewSubImage(p,Ee);Ne=ct.viewport,Ae===0&&(e.setRenderTargetTextures(g,ct.colorTexture,p.ignoreDepthValues?void 0:ct.depthStencilTexture),e.setRenderTarget(g))}let We=b[Ae];We===void 0&&(We=new qt,We.layers.enable(Ae),We.viewport=new Nt,b[Ae]=We),We.matrix.fromArray(Ee.transform.matrix),We.matrix.decompose(We.position,We.quaternion,We.scale),We.projectionMatrix.fromArray(Ee.projectionMatrix),We.projectionMatrixInverse.copy(We.projectionMatrix).invert(),We.viewport.set(Ne.x,Ne.y,Ne.width,Ne.height),Ae===0&&(P.matrix.copy(We.matrix),P.matrix.decompose(P.position,P.quaternion,P.scale)),ue===!0&&P.cameras.push(We)}}for(let ve=0;ve<x.length;ve++){const ue=S[ve],Ae=x[ve];ue!==null&&Ae!==void 0&&Ae.update(ue,W,u||o)}I&&I(U,W),W.detectedPlanes&&i.dispatchEvent({type:"planesdetected",data:W}),y=null}const H=new u2;H.setAnimationLoop(V),this.setAnimationLoop=function(U){I=U},this.dispose=function(){}}}function e4(n,e){function t(_,g){_.matrixAutoUpdate===!0&&_.updateMatrix(),g.value.copy(_.matrix)}function i(_,g){g.color.getRGB(_.fogColor.value,l2(n)),g.isFog?(_.fogNear.value=g.near,_.fogFar.value=g.far):g.isFogExp2&&(_.fogDensity.value=g.density)}function r(_,g,x,S,E){g.isMeshBasicMaterial||g.isMeshLambertMaterial?s(_,g):g.isMeshToonMaterial?(s(_,g),d(_,g)):g.isMeshPhongMaterial?(s(_,g),h(_,g)):g.isMeshStandardMaterial?(s(_,g),p(_,g),g.isMeshPhysicalMaterial&&m(_,g,E)):g.isMeshMatcapMaterial?(s(_,g),y(_,g)):g.isMeshDepthMaterial?s(_,g):g.isMeshDistanceMaterial?(s(_,g),M(_,g)):g.isMeshNormalMaterial?s(_,g):g.isLineBasicMaterial?(o(_,g),g.isLineDashedMaterial&&a(_,g)):g.isPointsMaterial?l(_,g,x,S):g.isSpriteMaterial?u(_,g):g.isShadowMaterial?(_.color.value.copy(g.color),_.opacity.value=g.opacity):g.isShaderMaterial&&(g.uniformsNeedUpdate=!1)}function s(_,g){_.opacity.value=g.opacity,g.color&&_.diffuse.value.copy(g.color),g.emissive&&_.emissive.value.copy(g.emissive).multiplyScalar(g.emissiveIntensity),g.map&&(_.map.value=g.map,t(g.map,_.mapTransform)),g.alphaMap&&(_.alphaMap.value=g.alphaMap,t(g.alphaMap,_.alphaMapTransform)),g.bumpMap&&(_.bumpMap.value=g.bumpMap,t(g.bumpMap,_.bumpMapTransform),_.bumpScale.value=g.bumpScale,g.side===vi&&(_.bumpScale.value*=-1)),g.normalMap&&(_.normalMap.value=g.normalMap,t(g.normalMap,_.normalMapTransform),_.normalScale.value.copy(g.normalScale),g.side===vi&&_.normalScale.value.negate()),g.displacementMap&&(_.displacementMap.value=g.displacementMap,t(g.displacementMap,_.displacementMapTransform),_.displacementScale.value=g.displacementScale,_.displacementBias.value=g.displacementBias),g.emissiveMap&&(_.emissiveMap.value=g.emissiveMap,t(g.emissiveMap,_.emissiveMapTransform)),g.specularMap&&(_.specularMap.value=g.specularMap,t(g.specularMap,_.specularMapTransform)),g.alphaTest>0&&(_.alphaTest.value=g.alphaTest);const x=e.get(g).envMap;if(x&&(_.envMap.value=x,_.flipEnvMap.value=x.isCubeTexture&&x.isRenderTargetTexture===!1?-1:1,_.reflectivity.value=g.reflectivity,_.ior.value=g.ior,_.refractionRatio.value=g.refractionRatio),g.lightMap){_.lightMap.value=g.lightMap;const S=n.useLegacyLights===!0?Math.PI:1;_.lightMapIntensity.value=g.lightMapIntensity*S,t(g.lightMap,_.lightMapTransform)}g.aoMap&&(_.aoMap.value=g.aoMap,_.aoMapIntensity.value=g.aoMapIntensity,t(g.aoMap,_.aoMapTransform))}function o(_,g){_.diffuse.value.copy(g.color),_.opacity.value=g.opacity,g.map&&(_.map.value=g.map,t(g.map,_.mapTransform))}function a(_,g){_.dashSize.value=g.dashSize,_.totalSize.value=g.dashSize+g.gapSize,_.scale.value=g.scale}function l(_,g,x,S){_.diffuse.value.copy(g.color),_.opacity.value=g.opacity,_.size.value=g.size*x,_.scale.value=S*.5,g.map&&(_.map.value=g.map,t(g.map,_.uvTransform)),g.alphaMap&&(_.alphaMap.value=g.alphaMap,t(g.alphaMap,_.alphaMapTransform)),g.alphaTest>0&&(_.alphaTest.value=g.alphaTest)}function u(_,g){_.diffuse.value.copy(g.color),_.opacity.value=g.opacity,_.rotation.value=g.rotation,g.map&&(_.map.value=g.map,t(g.map,_.mapTransform)),g.alphaMap&&(_.alphaMap.value=g.alphaMap,t(g.alphaMap,_.alphaMapTransform)),g.alphaTest>0&&(_.alphaTest.value=g.alphaTest)}function h(_,g){_.specular.value.copy(g.specular),_.shininess.value=Math.max(g.shininess,1e-4)}function d(_,g){g.gradientMap&&(_.gradientMap.value=g.gradientMap)}function p(_,g){_.metalness.value=g.metalness,g.metalnessMap&&(_.metalnessMap.value=g.metalnessMap,t(g.metalnessMap,_.metalnessMapTransform)),_.roughness.value=g.roughness,g.roughnessMap&&(_.roughnessMap.value=g.roughnessMap,t(g.roughnessMap,_.roughnessMapTransform)),e.get(g).envMap&&(_.envMapIntensity.value=g.envMapIntensity)}function m(_,g,x){_.ior.value=g.ior,g.sheen>0&&(_.sheenColor.value.copy(g.sheenColor).multiplyScalar(g.sheen),_.sheenRoughness.value=g.sheenRoughness,g.sheenColorMap&&(_.sheenColorMap.value=g.sheenColorMap,t(g.sheenColorMap,_.sheenColorMapTransform)),g.sheenRoughnessMap&&(_.sheenRoughnessMap.value=g.sheenRoughnessMap,t(g.sheenRoughnessMap,_.sheenRoughnessMapTransform))),g.clearcoat>0&&(_.clearcoat.value=g.clearcoat,_.clearcoatRoughness.value=g.clearcoatRoughness,g.clearcoatMap&&(_.clearcoatMap.value=g.clearcoatMap,t(g.clearcoatMap,_.clearcoatMapTransform)),g.clearcoatRoughnessMap&&(_.clearcoatRoughnessMap.value=g.clearcoatRoughnessMap,t(g.clearcoatRoughnessMap,_.clearcoatRoughnessMapTransform)),g.clearcoatNormalMap&&(_.clearcoatNormalMap.value=g.clearcoatNormalMap,t(g.clearcoatNormalMap,_.clearcoatNormalMapTransform),_.clearcoatNormalScale.value.copy(g.clearcoatNormalScale),g.side===vi&&_.clearcoatNormalScale.value.negate())),g.iridescence>0&&(_.iridescence.value=g.iridescence,_.iridescenceIOR.value=g.iridescenceIOR,_.iridescenceThicknessMinimum.value=g.iridescenceThicknessRange[0],_.iridescenceThicknessMaximum.value=g.iridescenceThicknessRange[1],g.iridescenceMap&&(_.iridescenceMap.value=g.iridescenceMap,t(g.iridescenceMap,_.iridescenceMapTransform)),g.iridescenceThicknessMap&&(_.iridescenceThicknessMap.value=g.iridescenceThicknessMap,t(g.iridescenceThicknessMap,_.iridescenceThicknessMapTransform))),g.transmission>0&&(_.transmission.value=g.transmission,_.transmissionSamplerMap.value=x.texture,_.transmissionSamplerSize.value.set(x.width,x.height),g.transmissionMap&&(_.transmissionMap.value=g.transmissionMap,t(g.transmissionMap,_.transmissionMapTransform)),_.thickness.value=g.thickness,g.thicknessMap&&(_.thicknessMap.value=g.thicknessMap,t(g.thicknessMap,_.thicknessMapTransform)),_.attenuationDistance.value=g.attenuationDistance,_.attenuationColor.value.copy(g.attenuationColor)),g.anisotropy>0&&(_.anisotropyVector.value.set(g.anisotropy*Math.cos(g.anisotropyRotation),g.anisotropy*Math.sin(g.anisotropyRotation)),g.anisotropyMap&&(_.anisotropyMap.value=g.anisotropyMap,t(g.anisotropyMap,_.anisotropyMapTransform))),_.specularIntensity.value=g.specularIntensity,_.specularColor.value.copy(g.specularColor),g.specularColorMap&&(_.specularColorMap.value=g.specularColorMap,t(g.specularColorMap,_.specularColorMapTransform)),g.specularIntensityMap&&(_.specularIntensityMap.value=g.specularIntensityMap,t(g.specularIntensityMap,_.specularIntensityMapTransform))}function y(_,g){g.matcap&&(_.matcap.value=g.matcap)}function M(_,g){const x=e.get(g).light;_.referencePosition.value.setFromMatrixPosition(x.matrixWorld),_.nearDistance.value=x.shadow.camera.near,_.farDistance.value=x.shadow.camera.far}return{refreshFogUniforms:i,refreshMaterialUniforms:r}}function t4(n,e,t,i){let r={},s={},o=[];const a=t.isWebGL2?n.getParameter(n.MAX_UNIFORM_BUFFER_BINDINGS):0;function l(x,S){const E=S.program;i.uniformBlockBinding(x,E)}function u(x,S){let E=r[x.id];E===void 0&&(y(x),E=h(x),r[x.id]=E,x.addEventListener("dispose",_));const C=S.program;i.updateUBOMapping(x,C);const b=e.render.frame;s[x.id]!==b&&(p(x),s[x.id]=b)}function h(x){const S=d();x.__bindingPointIndex=S;const E=n.createBuffer(),C=x.__size,b=x.usage;return n.bindBuffer(n.UNIFORM_BUFFER,E),n.bufferData(n.UNIFORM_BUFFER,C,b),n.bindBuffer(n.UNIFORM_BUFFER,null),n.bindBufferBase(n.UNIFORM_BUFFER,S,E),E}function d(){for(let x=0;x<a;x++)if(o.indexOf(x)===-1)return o.push(x),x;return console.error("THREE.WebGLRenderer: Maximum number of simultaneously usable uniforms groups reached."),0}function p(x){const S=r[x.id],E=x.uniforms,C=x.__cache;n.bindBuffer(n.UNIFORM_BUFFER,S);for(let b=0,P=E.length;b<P;b++){const B=E[b];if(m(B,b,C)===!0){const R=B.__offset,L=Array.isArray(B.value)?B.value:[B.value];let z=0;for(let $=0;$<L.length;$++){const X=L[$],Q=M(X);typeof X=="number"?(B.__data[0]=X,n.bufferSubData(n.UNIFORM_BUFFER,R+z,B.__data)):X.isMatrix3?(B.__data[0]=X.elements[0],B.__data[1]=X.elements[1],B.__data[2]=X.elements[2],B.__data[3]=X.elements[0],B.__data[4]=X.elements[3],B.__data[5]=X.elements[4],B.__data[6]=X.elements[5],B.__data[7]=X.elements[0],B.__data[8]=X.elements[6],B.__data[9]=X.elements[7],B.__data[10]=X.elements[8],B.__data[11]=X.elements[0]):(X.toArray(B.__data,z),z+=Q.storage/Float32Array.BYTES_PER_ELEMENT)}n.bufferSubData(n.UNIFORM_BUFFER,R,B.__data)}}n.bindBuffer(n.UNIFORM_BUFFER,null)}function m(x,S,E){const C=x.value;if(E[S]===void 0){if(typeof C=="number")E[S]=C;else{const b=Array.isArray(C)?C:[C],P=[];for(let B=0;B<b.length;B++)P.push(b[B].clone());E[S]=P}return!0}else if(typeof C=="number"){if(E[S]!==C)return E[S]=C,!0}else{const b=Array.isArray(E[S])?E[S]:[E[S]],P=Array.isArray(C)?C:[C];for(let B=0;B<b.length;B++){const R=b[B];if(R.equals(P[B])===!1)return R.copy(P[B]),!0}}return!1}function y(x){const S=x.uniforms;let E=0;const C=16;let b=0;for(let P=0,B=S.length;P<B;P++){const R=S[P],L={boundary:0,storage:0},z=Array.isArray(R.value)?R.value:[R.value];for(let $=0,X=z.length;$<X;$++){const Q=z[$],Y=M(Q);L.boundary+=Y.boundary,L.storage+=Y.storage}if(R.__data=new Float32Array(L.storage/Float32Array.BYTES_PER_ELEMENT),R.__offset=E,P>0){b=E%C;const $=C-b;b!==0&&$-L.boundary<0&&(E+=C-b,R.__offset=E)}E+=L.storage}return b=E%C,b>0&&(E+=C-b),x.__size=E,x.__cache={},this}function M(x){const S={boundary:0,storage:0};return typeof x=="number"?(S.boundary=4,S.storage=4):x.isVector2?(S.boundary=8,S.storage=8):x.isVector3||x.isColor?(S.boundary=16,S.storage=12):x.isVector4?(S.boundary=16,S.storage=16):x.isMatrix3?(S.boundary=48,S.storage=48):x.isMatrix4?(S.boundary=64,S.storage=64):x.isTexture?console.warn("THREE.WebGLRenderer: Texture samplers can not be part of an uniforms group."):console.warn("THREE.WebGLRenderer: Unsupported uniform value type.",x),S}function _(x){const S=x.target;S.removeEventListener("dispose",_);const E=o.indexOf(S.__bindingPointIndex);o.splice(E,1),n.deleteBuffer(r[S.id]),delete r[S.id],delete s[S.id]}function g(){for(const x in r)n.deleteBuffer(r[x]);o=[],r={},s={}}return{bind:l,update:u,dispose:g}}function n4(){const n=sh("canvas");return n.style.display="block",n}class CS{constructor(e={}){const{canvas:t=n4(),context:i=null,depth:r=!0,stencil:s=!0,alpha:o=!1,antialias:a=!1,premultipliedAlpha:l=!0,preserveDrawingBuffer:u=!1,powerPreference:h="default",failIfMajorPerformanceCaveat:d=!1}=e;this.isWebGLRenderer=!0;let p;i!==null?p=i.getContextAttributes().alpha:p=o;const m=new Uint32Array(4),y=new Int32Array(4);let M=null,_=null;const g=[],x=[];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=mt,this.useLegacyLights=!0,this.toneMapping=Hr,this.toneMappingExposure=1;const S=this;let E=!1,C=0,b=0,P=null,B=-1,R=null;const L=new Nt,z=new Nt;let $=null;const X=new Oe(0);let Q=0,Y=t.width,ne=t.height,ee=1,I=null,V=null;const H=new Nt(0,0,Y,ne),U=new Nt(0,0,Y,ne);let W=!1;const ve=new Ig;let ue=!1,Ae=!1,Ee=null;const Ne=new rt,We=new ge,ct=new F,tt={background:null,fog:null,environment:null,overrideMaterial:null,isScene:!0};function Se(){return P===null?ee:1}let G=i;function ye(N,re){for(let de=0;de<N.length;de++){const te=N[de],me=t.getContext(te,re);if(me!==null)return me}return null}try{const N={alpha:!0,depth:r,stencil:s,antialias:a,premultipliedAlpha:l,preserveDrawingBuffer:u,powerPreference:h,failIfMajorPerformanceCaveat:d};if("setAttribute"in t&&t.setAttribute("data-engine",`three.js r${Sh}`),t.addEventListener("webglcontextlost",Pe,!1),t.addEventListener("webglcontextrestored",oe,!1),t.addEventListener("webglcontextcreationerror",Be,!1),G===null){const re=["webgl2","webgl","experimental-webgl"];if(S.isWebGL1Renderer===!0&&re.shift(),G=ye(re,N),G===null)throw ye(re)?new Error("Error creating WebGL context with your selected attributes."):new Error("Error creating WebGL context.")}typeof WebGLRenderingContext<"u"&&G instanceof WebGLRenderingContext&&console.warn("THREE.WebGLRenderer: WebGL 1 support was deprecated in r153 and will be removed in r163."),G.getShaderPrecisionFormat===void 0&&(G.getShaderPrecisionFormat=function(){return{rangeMin:1,rangeMax:1,precision:1}})}catch(N){throw console.error("THREE.WebGLRenderer: "+N.message),N}let pe,Me,xe,Ve,Ue,Ge,qe,vt,Ut,k,D,le,we,_e,De,Ke,Le,he,j,fe,Te,be,Ie,nt;function Rt(){pe=new vz(G),Me=new fz(G,pe,e),pe.init(Me),be=new m2(G,pe,Me),xe=new QG(G,pe,Me),Ve=new _z(G),Ue=new UG,Ge=new ZG(G,pe,xe,Ue,Me,be,Ve),qe=new dz(S),vt=new gz(S),Ut=new PU(G,Me),Ie=new cz(G,pe,Ut,Me),k=new yz(G,Ut,Ve,Ie),D=new Ez(G,k,Ut,Ve),j=new Mz(G,Me,Ge),Ke=new hz(Ue),le=new OG(S,qe,vt,pe,Me,Ie,Ke),we=new e4(S,Ue),_e=new HG,De=new XG(pe,Me),he=new lz(S,qe,vt,xe,D,p,l),Le=new YG(S,D,Me),nt=new t4(G,Ve,Me,xe),fe=new uz(G,pe,Ve,Me),Te=new xz(G,pe,Ve,Me),Ve.programs=le.programs,S.capabilities=Me,S.extensions=pe,S.properties=Ue,S.renderLists=_e,S.shadowMap=Le,S.state=xe,S.info=Ve}Rt();const K=new $G(S,G);this.xr=K,this.getContext=function(){return G},this.getContextAttributes=function(){return G.getContextAttributes()},this.forceContextLoss=function(){const N=pe.get("WEBGL_lose_context");N&&N.loseContext()},this.forceContextRestore=function(){const N=pe.get("WEBGL_lose_context");N&&N.restoreContext()},this.getPixelRatio=function(){return ee},this.setPixelRatio=function(N){N!==void 0&&(ee=N,this.setSize(Y,ne,!1))},this.getSize=function(N){return N.set(Y,ne)},this.setSize=function(N,re,de=!0){if(K.isPresenting){console.warn("THREE.WebGLRenderer: Can't change size while VR device is presenting.");return}Y=N,ne=re,t.width=Math.floor(N*ee),t.height=Math.floor(re*ee),de===!0&&(t.style.width=N+"px",t.style.height=re+"px"),this.setViewport(0,0,N,re)},this.getDrawingBufferSize=function(N){return N.set(Y*ee,ne*ee).floor()},this.setDrawingBufferSize=function(N,re,de){Y=N,ne=re,ee=de,t.width=Math.floor(N*de),t.height=Math.floor(re*de),this.setViewport(0,0,N,re)},this.getCurrentViewport=function(N){return N.copy(L)},this.getViewport=function(N){return N.copy(H)},this.setViewport=function(N,re,de,te){N.isVector4?H.set(N.x,N.y,N.z,N.w):H.set(N,re,de,te),xe.viewport(L.copy(H).multiplyScalar(ee).floor())},this.getScissor=function(N){return N.copy(U)},this.setScissor=function(N,re,de,te){N.isVector4?U.set(N.x,N.y,N.z,N.w):U.set(N,re,de,te),xe.scissor(z.copy(U).multiplyScalar(ee).floor())},this.getScissorTest=function(){return W},this.setScissorTest=function(N){xe.setScissorTest(W=N)},this.setOpaqueSort=function(N){I=N},this.setTransparentSort=function(N){V=N},this.getClearColor=function(N){return N.copy(he.getClearColor())},this.setClearColor=function(){he.setClearColor.apply(he,arguments)},this.getClearAlpha=function(){return he.getClearAlpha()},this.setClearAlpha=function(){he.setClearAlpha.apply(he,arguments)},this.clear=function(N=!0,re=!0,de=!0){let te=0;if(N){let me=!1;if(P!==null){const Xe=P.texture.format;me=Xe===hS||Xe===fS||Xe===uS}if(me){const Xe=P.texture.type,$e=Xe===hs||Xe===Hs||Xe===Pg||Xe===Oo||Xe===lS||Xe===cS,st=he.getClearColor(),ot=he.getClearAlpha(),St=st.r,at=st.g,lt=st.b;$e?(m[0]=St,m[1]=at,m[2]=lt,m[3]=ot,G.clearBufferuiv(G.COLOR,0,m)):(y[0]=St,y[1]=at,y[2]=lt,y[3]=ot,G.clearBufferiv(G.COLOR,0,y))}else te|=G.COLOR_BUFFER_BIT}re&&(te|=G.DEPTH_BUFFER_BIT),de&&(te|=G.STENCIL_BUFFER_BIT),G.clear(te)},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",Pe,!1),t.removeEventListener("webglcontextrestored",oe,!1),t.removeEventListener("webglcontextcreationerror",Be,!1),_e.dispose(),De.dispose(),Ue.dispose(),qe.dispose(),vt.dispose(),D.dispose(),Ie.dispose(),nt.dispose(),le.dispose(),K.dispose(),K.removeEventListener("sessionstart",jt),K.removeEventListener("sessionend",Ii),Ee&&(Ee.dispose(),Ee=null),Vn.stop()};function Pe(N){N.preventDefault(),console.log("THREE.WebGLRenderer: Context Lost."),E=!0}function oe(){console.log("THREE.WebGLRenderer: Context Restored."),E=!1;const N=Ve.autoReset,re=Le.enabled,de=Le.autoUpdate,te=Le.needsUpdate,me=Le.type;Rt(),Ve.autoReset=N,Le.enabled=re,Le.autoUpdate=de,Le.needsUpdate=te,Le.type=me}function Be(N){console.error("THREE.WebGLRenderer: A WebGL context could not be created. Reason: ",N.statusMessage)}function He(N){const re=N.target;re.removeEventListener("dispose",He),wt(re)}function wt(N){Gt(N),Ue.remove(N)}function Gt(N){const re=Ue.get(N).programs;re!==void 0&&(re.forEach(function(de){le.releaseProgram(de)}),N.isShaderMaterial&&le.releaseShaderCache(N))}this.renderBufferDirect=function(N,re,de,te,me,Xe){re===null&&(re=tt);const $e=me.isMesh&&me.matrixWorld.determinant()<0,st=u0(N,re,de,te,me);xe.setMaterial(te,$e);let ot=de.index,St=1;te.wireframe===!0&&(ot=k.getWireframeAttribute(de),St=2);const at=de.drawRange,lt=de.attributes.position;let Vt=at.start*St,Xt=(at.start+at.count)*St;Xe!==null&&(Vt=Math.max(Vt,Xe.start*St),Xt=Math.min(Xt,(Xe.start+Xe.count)*St)),ot!==null?(Vt=Math.max(Vt,0),Xt=Math.min(Xt,ot.count)):lt!=null&&(Vt=Math.max(Vt,0),Xt=Math.min(Xt,lt.count));const Di=Xt-Vt;if(Di<0||Di===1/0)return;Ie.setup(me,te,st,de,ot);let Fi,kt=fe;if(ot!==null&&(Fi=Ut.get(ot),kt=Te,kt.setIndex(Fi)),me.isMesh)te.wireframe===!0?(xe.setLineWidth(te.wireframeLinewidth*Se()),kt.setMode(G.LINES)):kt.setMode(G.TRIANGLES);else if(me.isLine){let ft=te.linewidth;ft===void 0&&(ft=1),xe.setLineWidth(ft*Se()),me.isLineSegments?kt.setMode(G.LINES):me.isLineLoop?kt.setMode(G.LINE_LOOP):kt.setMode(G.LINE_STRIP)}else me.isPoints?kt.setMode(G.POINTS):me.isSprite&&kt.setMode(G.TRIANGLES);if(me.isInstancedMesh)kt.renderInstances(Vt,Di,me.count);else if(de.isInstancedBufferGeometry){const ft=de._maxInstanceCount!==void 0?de._maxInstanceCount:1/0,Ft=Math.min(de.instanceCount,ft);kt.renderInstances(Vt,Di,Ft)}else kt.render(Vt,Di)},this.compile=function(N,re){function de(te,me,Xe){te.transparent===!0&&te.side===vr&&te.forceSinglePass===!1?(te.side=vi,te.needsUpdate=!0,Qr(te,me,Xe),te.side=gs,te.needsUpdate=!0,Qr(te,me,Xe),te.side=vr):Qr(te,me,Xe)}_=De.get(N),_.init(),x.push(_),N.traverseVisible(function(te){te.isLight&&te.layers.test(re.layers)&&(_.pushLight(te),te.castShadow&&_.pushShadow(te))}),_.setupLights(S.useLegacyLights),N.traverse(function(te){const me=te.material;if(me)if(Array.isArray(me))for(let Xe=0;Xe<me.length;Xe++){const $e=me[Xe];de($e,N,te)}else de(me,N,te)}),x.pop(),_=null};let _n=null;function Li(N){_n&&_n(N)}function jt(){Vn.stop()}function Ii(){Vn.start()}const Vn=new u2;Vn.setAnimationLoop(Li),typeof self<"u"&&Vn.setContext(self),this.setAnimationLoop=function(N){_n=N,K.setAnimationLoop(N),N===null?Vn.stop():Vn.start()},K.addEventListener("sessionstart",jt),K.addEventListener("sessionend",Ii),this.render=function(N,re){if(re!==void 0&&re.isCamera!==!0){console.error("THREE.WebGLRenderer.render: camera is not an instance of THREE.Camera.");return}if(E===!0)return;N.matrixWorldAutoUpdate===!0&&N.updateMatrixWorld(),re.parent===null&&re.matrixWorldAutoUpdate===!0&&re.updateMatrixWorld(),K.enabled===!0&&K.isPresenting===!0&&(K.cameraAutoUpdate===!0&&K.updateCamera(re),re=K.getCamera()),N.isScene===!0&&N.onBeforeRender(S,N,re,P),_=De.get(N,x.length),_.init(),x.push(_),Ne.multiplyMatrices(re.projectionMatrix,re.matrixWorldInverse),ve.setFromProjectionMatrix(Ne),Ae=this.localClippingEnabled,ue=Ke.init(this.clippingPlanes,Ae),M=_e.get(N,g.length),M.init(),g.push(M),Wh(N,re,0,S.sortObjects),M.finish(),S.sortObjects===!0&&M.sort(I,V),this.info.render.frame++,ue===!0&&Ke.beginShadows();const de=_.state.shadowsArray;if(Le.render(de,N,re),ue===!0&&Ke.endShadows(),this.info.autoReset===!0&&this.info.reset(),he.render(M,N),_.setupLights(S.useLegacyLights),re.isArrayCamera){const te=re.cameras;for(let me=0,Xe=te.length;me<Xe;me++){const $e=te[me];jh(M,N,$e,$e.viewport)}}else jh(M,N,re);P!==null&&(Ge.updateMultisampleRenderTarget(P),Ge.updateRenderTargetMipmap(P)),N.isScene===!0&&N.onAfterRender(S,N,re),Ie.resetDefaultState(),B=-1,R=null,x.pop(),x.length>0?_=x[x.length-1]:_=null,g.pop(),g.length>0?M=g[g.length-1]:M=null};function Wh(N,re,de,te){if(N.visible===!1)return;if(N.layers.test(re.layers)){if(N.isGroup)de=N.renderOrder;else if(N.isLOD)N.autoUpdate===!0&&N.update(re);else if(N.isLight)_.pushLight(N),N.castShadow&&_.pushShadow(N);else if(N.isSprite){if(!N.frustumCulled||ve.intersectsSprite(N)){te&&ct.setFromMatrixPosition(N.matrixWorld).applyMatrix4(Ne);const $e=D.update(N),st=N.material;st.visible&&M.push(N,$e,st,de,ct.z,null)}}else if((N.isMesh||N.isLine||N.isPoints)&&(!N.frustumCulled||ve.intersectsObject(N))){const $e=D.update(N),st=N.material;if(te&&(N.boundingSphere!==void 0?(N.boundingSphere===null&&N.computeBoundingSphere(),ct.copy(N.boundingSphere.center)):($e.boundingSphere===null&&$e.computeBoundingSphere(),ct.copy($e.boundingSphere.center)),ct.applyMatrix4(N.matrixWorld).applyMatrix4(Ne)),Array.isArray(st)){const ot=$e.groups;for(let St=0,at=ot.length;St<at;St++){const lt=ot[St],Vt=st[lt.materialIndex];Vt&&Vt.visible&&M.push(N,$e,Vt,de,ct.z,lt)}}else st.visible&&M.push(N,$e,st,de,ct.z,null)}}const Xe=N.children;for(let $e=0,st=Xe.length;$e<st;$e++)Wh(Xe[$e],re,de,te)}function jh(N,re,de,te){const me=N.opaque,Xe=N.transmissive,$e=N.transparent;_.setupLightsView(de),ue===!0&&Ke.setGlobalState(S.clippingPlanes,de),Xe.length>0&&Xh(me,Xe,re,de),te&&xe.viewport(L.copy(te)),me.length>0&&to(me,re,de),Xe.length>0&&to(Xe,re,de),$e.length>0&&to($e,re,de),xe.buffers.depth.setTest(!0),xe.buffers.depth.setMask(!0),xe.buffers.color.setMask(!0),xe.setPolygonOffset(!1)}function Xh(N,re,de,te){const me=Me.isWebGL2;Ee===null&&(Ee=new Wr(1,1,{generateMipmaps:!0,type:pe.has("EXT_color_buffer_half_float")?Kc:hs,minFilter:vs,samples:me?4:0})),S.getDrawingBufferSize(We),me?Ee.setSize(We.x,We.y):Ee.setSize(Zm(We.x),Zm(We.y));const Xe=S.getRenderTarget();S.setRenderTarget(Ee),S.getClearColor(X),Q=S.getClearAlpha(),Q<1&&S.setClearColor(16777215,.5),S.clear();const $e=S.toneMapping;S.toneMapping=Hr,to(N,de,te),Ge.updateMultisampleRenderTarget(Ee),Ge.updateRenderTargetMipmap(Ee);let st=!1;for(let ot=0,St=re.length;ot<St;ot++){const at=re[ot],lt=at.object,Vt=at.geometry,Xt=at.material,Di=at.group;if(Xt.side===vr&&lt.layers.test(te.layers)){const Fi=Xt.side;Xt.side=vi,Xt.needsUpdate=!0,Jh(lt,de,te,Vt,Xt,Di),Xt.side=Fi,Xt.needsUpdate=!0,st=!0}}st===!0&&(Ge.updateMultisampleRenderTarget(Ee),Ge.updateRenderTargetMipmap(Ee)),S.setRenderTarget(Xe),S.setClearColor(X,Q),S.toneMapping=$e}function to(N,re,de){const te=re.isScene===!0?re.overrideMaterial:null;for(let me=0,Xe=N.length;me<Xe;me++){const $e=N[me],st=$e.object,ot=$e.geometry,St=te===null?$e.material:te,at=$e.group;st.layers.test(de.layers)&&Jh(st,re,de,ot,St,at)}}function Jh(N,re,de,te,me,Xe){N.onBeforeRender(S,re,de,te,me,Xe),N.modelViewMatrix.multiplyMatrices(de.matrixWorldInverse,N.matrixWorld),N.normalMatrix.getNormalMatrix(N.modelViewMatrix),me.onBeforeRender(S,re,de,te,N,Xe),me.transparent===!0&&me.side===vr&&me.forceSinglePass===!1?(me.side=vi,me.needsUpdate=!0,S.renderBufferDirect(de,re,te,me,N,Xe),me.side=gs,me.needsUpdate=!0,S.renderBufferDirect(de,re,te,me,N,Xe),me.side=vr):S.renderBufferDirect(de,re,te,me,N,Xe),N.onAfterRender(S,re,de,te,me,Xe)}function Qr(N,re,de){re.isScene!==!0&&(re=tt);const te=Ue.get(N),me=_.state.lights,Xe=_.state.shadowsArray,$e=me.state.version,st=le.getParameters(N,me.state,Xe,re,de),ot=le.getProgramCacheKey(st);let St=te.programs;te.environment=N.isMeshStandardMaterial?re.environment:null,te.fog=re.fog,te.envMap=(N.isMeshStandardMaterial?vt:qe).get(N.envMap||te.environment),St===void 0&&(N.addEventListener("dispose",He),St=new Map,te.programs=St);let at=St.get(ot);if(at!==void 0){if(te.currentProgram===at&&te.lightsStateVersion===$e)return Kh(N,st),at}else st.uniforms=le.getUniforms(N),N.onBuild(de,st,S),N.onBeforeCompile(st,S),at=le.acquireProgram(st,ot),St.set(ot,at),te.uniforms=st.uniforms;const lt=te.uniforms;(!N.isShaderMaterial&&!N.isRawShaderMaterial||N.clipping===!0)&&(lt.clippingPlanes=Ke.uniform),Kh(N,st),te.needsLights=h0(N),te.lightsStateVersion=$e,te.needsLights&&(lt.ambientLightColor.value=me.state.ambient,lt.lightProbe.value=me.state.probe,lt.directionalLights.value=me.state.directional,lt.directionalLightShadows.value=me.state.directionalShadow,lt.spotLights.value=me.state.spot,lt.spotLightShadows.value=me.state.spotShadow,lt.rectAreaLights.value=me.state.rectArea,lt.ltc_1.value=me.state.rectAreaLTC1,lt.ltc_2.value=me.state.rectAreaLTC2,lt.pointLights.value=me.state.point,lt.pointLightShadows.value=me.state.pointShadow,lt.hemisphereLights.value=me.state.hemi,lt.directionalShadowMap.value=me.state.directionalShadowMap,lt.directionalShadowMatrix.value=me.state.directionalShadowMatrix,lt.spotShadowMap.value=me.state.spotShadowMap,lt.spotLightMatrix.value=me.state.spotLightMatrix,lt.spotLightMap.value=me.state.spotLightMap,lt.pointShadowMap.value=me.state.pointShadowMap,lt.pointShadowMatrix.value=me.state.pointShadowMatrix);const Vt=at.getUniforms(),Xt=ym.seqWithValue(Vt.seq,lt);return te.currentProgram=at,te.uniformsList=Xt,at}function Kh(N,re){const de=Ue.get(N);de.outputColorSpace=re.outputColorSpace,de.instancing=re.instancing,de.skinning=re.skinning,de.morphTargets=re.morphTargets,de.morphNormals=re.morphNormals,de.morphColors=re.morphColors,de.morphTargetsCount=re.morphTargetsCount,de.numClippingPlanes=re.numClippingPlanes,de.numIntersection=re.numClipIntersection,de.vertexAlphas=re.vertexAlphas,de.vertexTangents=re.vertexTangents,de.toneMapping=re.toneMapping}function u0(N,re,de,te,me){re.isScene!==!0&&(re=tt),Ge.resetTextureUnits();const Xe=re.fog,$e=te.isMeshStandardMaterial?re.environment:null,st=P===null?S.outputColorSpace:P.isXRRenderTarget===!0?P.texture.colorSpace:Vr,ot=(te.isMeshStandardMaterial?vt:qe).get(te.envMap||$e),St=te.vertexColors===!0&&!!de.attributes.color&&de.attributes.color.itemSize===4,at=!!de.attributes.tangent&&(!!te.normalMap||te.anisotropy>0),lt=!!de.morphAttributes.position,Vt=!!de.morphAttributes.normal,Xt=!!de.morphAttributes.color,Di=te.toneMapped?S.toneMapping:Hr,Fi=de.morphAttributes.position||de.morphAttributes.normal||de.morphAttributes.color,kt=Fi!==void 0?Fi.length:0,ft=Ue.get(te),Ft=_.state.lights;if(ue===!0&&(Ae===!0||N!==R)){const Qn=N===R&&te.id===B;Ke.setState(te,N,Qn)}let ut=!1;te.version===ft.__version?(ft.needsLights&&ft.lightsStateVersion!==Ft.state.version||ft.outputColorSpace!==st||me.isInstancedMesh&&ft.instancing===!1||!me.isInstancedMesh&&ft.instancing===!0||me.isSkinnedMesh&&ft.skinning===!1||!me.isSkinnedMesh&&ft.skinning===!0||ft.envMap!==ot||te.fog===!0&&ft.fog!==Xe||ft.numClippingPlanes!==void 0&&(ft.numClippingPlanes!==Ke.numPlanes||ft.numIntersection!==Ke.numIntersection)||ft.vertexAlphas!==St||ft.vertexTangents!==at||ft.morphTargets!==lt||ft.morphNormals!==Vt||ft.morphColors!==Xt||ft.toneMapping!==Di||Me.isWebGL2===!0&&ft.morphTargetsCount!==kt)&&(ut=!0):(ut=!0,ft.__version=te.version);let Yn=ft.currentProgram;ut===!0&&(Yn=Qr(te,re,me));let bn=!1,An=!1,Mr=!1;const un=Yn.getUniforms(),fn=ft.uniforms;if(xe.useProgram(Yn.program)&&(bn=!0,An=!0,Mr=!0),te.id!==B&&(B=te.id,An=!0),bn||R!==N){if(un.setValue(G,"projectionMatrix",N.projectionMatrix),Me.logarithmicDepthBuffer&&un.setValue(G,"logDepthBufFC",2/(Math.log(N.far+1)/Math.LN2)),R!==N&&(R=N,An=!0,Mr=!0),te.isShaderMaterial||te.isMeshPhongMaterial||te.isMeshToonMaterial||te.isMeshStandardMaterial||te.envMap){const Qn=un.map.cameraPosition;Qn!==void 0&&Qn.setValue(G,ct.setFromMatrixPosition(N.matrixWorld))}(te.isMeshPhongMaterial||te.isMeshToonMaterial||te.isMeshLambertMaterial||te.isMeshBasicMaterial||te.isMeshStandardMaterial||te.isShaderMaterial)&&un.setValue(G,"isOrthographic",N.isOrthographicCamera===!0),(te.isMeshPhongMaterial||te.isMeshToonMaterial||te.isMeshLambertMaterial||te.isMeshBasicMaterial||te.isMeshStandardMaterial||te.isShaderMaterial||te.isShadowMaterial||me.isSkinnedMesh)&&un.setValue(G,"viewMatrix",N.matrixWorldInverse)}if(me.isSkinnedMesh){un.setOptional(G,me,"bindMatrix"),un.setOptional(G,me,"bindMatrixInverse");const Qn=me.skeleton;Qn&&(Me.floatVertexTextures?(Qn.boneTexture===null&&Qn.computeBoneTexture(),un.setValue(G,"boneTexture",Qn.boneTexture,Ge),un.setValue(G,"boneTextureSize",Qn.boneTextureSize)):console.warn("THREE.WebGLRenderer: SkinnedMesh can only be used with WebGL 2. With WebGL 1 OES_texture_float and vertex textures support is required."))}const no=de.morphAttributes;if((no.position!==void 0||no.normal!==void 0||no.color!==void 0&&Me.isWebGL2===!0)&&j.update(me,de,Yn),(An||ft.receiveShadow!==me.receiveShadow)&&(ft.receiveShadow=me.receiveShadow,un.setValue(G,"receiveShadow",me.receiveShadow)),te.isMeshGouraudMaterial&&te.envMap!==null&&(fn.envMap.value=ot,fn.flipEnvMap.value=ot.isCubeTexture&&ot.isRenderTargetTexture===!1?-1:1),An&&(un.setValue(G,"toneMappingExposure",S.toneMappingExposure),ft.needsLights&&f0(fn,Mr),Xe&&te.fog===!0&&we.refreshFogUniforms(fn,Xe),we.refreshMaterialUniforms(fn,te,ee,ne,Ee),ym.upload(G,ft.uniformsList,fn,Ge)),te.isShaderMaterial&&te.uniformsNeedUpdate===!0&&(ym.upload(G,ft.uniformsList,fn,Ge),te.uniformsNeedUpdate=!1),te.isSpriteMaterial&&un.setValue(G,"center",me.center),un.setValue(G,"modelViewMatrix",me.modelViewMatrix),un.setValue(G,"normalMatrix",me.normalMatrix),un.setValue(G,"modelMatrix",me.matrixWorld),te.isShaderMaterial||te.isRawShaderMaterial){const Qn=te.uniformsGroups;for(let gl=0,vl=Qn.length;gl<vl;gl++)if(Me.isWebGL2){const pu=Qn[gl];nt.update(pu,Yn),nt.bind(pu,Yn)}else console.warn("THREE.WebGLRenderer: Uniform Buffer Objects can only be used with WebGL 2.")}return Yn}function f0(N,re){N.ambientLightColor.needsUpdate=re,N.lightProbe.needsUpdate=re,N.directionalLights.needsUpdate=re,N.directionalLightShadows.needsUpdate=re,N.pointLights.needsUpdate=re,N.pointLightShadows.needsUpdate=re,N.spotLights.needsUpdate=re,N.spotLightShadows.needsUpdate=re,N.rectAreaLights.needsUpdate=re,N.hemisphereLights.needsUpdate=re}function h0(N){return N.isMeshLambertMaterial||N.isMeshToonMaterial||N.isMeshPhongMaterial||N.isMeshStandardMaterial||N.isShadowMaterial||N.isShaderMaterial&&N.lights===!0}this.getActiveCubeFace=function(){return C},this.getActiveMipmapLevel=function(){return b},this.getRenderTarget=function(){return P},this.setRenderTargetTextures=function(N,re,de){Ue.get(N.texture).__webglTexture=re,Ue.get(N.depthTexture).__webglTexture=de;const te=Ue.get(N);te.__hasExternalTextures=!0,te.__hasExternalTextures&&(te.__autoAllocateDepthBuffer=de===void 0,te.__autoAllocateDepthBuffer||pe.has("WEBGL_multisampled_render_to_texture")===!0&&(console.warn("THREE.WebGLRenderer: Render-to-texture extension was disabled because an external texture was provided"),te.__useRenderToTexture=!1))},this.setRenderTargetFramebuffer=function(N,re){const de=Ue.get(N);de.__webglFramebuffer=re,de.__useDefaultFramebuffer=re===void 0},this.setRenderTarget=function(N,re=0,de=0){P=N,C=re,b=de;let te=!0,me=null,Xe=!1,$e=!1;if(N){const ot=Ue.get(N);ot.__useDefaultFramebuffer!==void 0?(xe.bindFramebuffer(G.FRAMEBUFFER,null),te=!1):ot.__webglFramebuffer===void 0?Ge.setupRenderTarget(N):ot.__hasExternalTextures&&Ge.rebindTextures(N,Ue.get(N.texture).__webglTexture,Ue.get(N.depthTexture).__webglTexture);const St=N.texture;(St.isData3DTexture||St.isDataArrayTexture||St.isCompressedArrayTexture)&&($e=!0);const at=Ue.get(N).__webglFramebuffer;N.isWebGLCubeRenderTarget?(me=at[re],Xe=!0):Me.isWebGL2&&N.samples>0&&Ge.useMultisampledRTT(N)===!1?me=Ue.get(N).__webglMultisampledFramebuffer:me=at,L.copy(N.viewport),z.copy(N.scissor),$=N.scissorTest}else L.copy(H).multiplyScalar(ee).floor(),z.copy(U).multiplyScalar(ee).floor(),$=W;if(xe.bindFramebuffer(G.FRAMEBUFFER,me)&&Me.drawBuffers&&te&&xe.drawBuffers(N,me),xe.viewport(L),xe.scissor(z),xe.setScissorTest($),Xe){const ot=Ue.get(N.texture);G.framebufferTexture2D(G.FRAMEBUFFER,G.COLOR_ATTACHMENT0,G.TEXTURE_CUBE_MAP_POSITIVE_X+re,ot.__webglTexture,de)}else if($e){const ot=Ue.get(N.texture),St=re||0;G.framebufferTextureLayer(G.FRAMEBUFFER,G.COLOR_ATTACHMENT0,ot.__webglTexture,de||0,St)}B=-1},this.readRenderTargetPixels=function(N,re,de,te,me,Xe,$e){if(!(N&&N.isWebGLRenderTarget)){console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not THREE.WebGLRenderTarget.");return}let st=Ue.get(N).__webglFramebuffer;if(N.isWebGLCubeRenderTarget&&$e!==void 0&&(st=st[$e]),st){xe.bindFramebuffer(G.FRAMEBUFFER,st);try{const ot=N.texture,St=ot.format,at=ot.type;if(St!==Ti&&be.convert(St)!==G.getParameter(G.IMPLEMENTATION_COLOR_READ_FORMAT)){console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not in RGBA or implementation defined format.");return}const lt=at===Kc&&(pe.has("EXT_color_buffer_half_float")||Me.isWebGL2&&pe.has("EXT_color_buffer_float"));if(at!==hs&&be.convert(at)!==G.getParameter(G.IMPLEMENTATION_COLOR_READ_TYPE)&&!(at===ls&&(Me.isWebGL2||pe.has("OES_texture_float")||pe.has("WEBGL_color_buffer_float")))&&!lt){console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not in UnsignedByteType or implementation defined type.");return}re>=0&&re<=N.width-te&&de>=0&&de<=N.height-me&&G.readPixels(re,de,te,me,be.convert(St),be.convert(at),Xe)}finally{const ot=P!==null?Ue.get(P).__webglFramebuffer:null;xe.bindFramebuffer(G.FRAMEBUFFER,ot)}}},this.copyFramebufferToTexture=function(N,re,de=0){const te=Math.pow(2,-de),me=Math.floor(re.image.width*te),Xe=Math.floor(re.image.height*te);Ge.setTexture2D(re,0),G.copyTexSubImage2D(G.TEXTURE_2D,de,0,0,N.x,N.y,me,Xe),xe.unbindTexture()},this.copyTextureToTexture=function(N,re,de,te=0){const me=re.image.width,Xe=re.image.height,$e=be.convert(de.format),st=be.convert(de.type);Ge.setTexture2D(de,0),G.pixelStorei(G.UNPACK_FLIP_Y_WEBGL,de.flipY),G.pixelStorei(G.UNPACK_PREMULTIPLY_ALPHA_WEBGL,de.premultiplyAlpha),G.pixelStorei(G.UNPACK_ALIGNMENT,de.unpackAlignment),re.isDataTexture?G.texSubImage2D(G.TEXTURE_2D,te,N.x,N.y,me,Xe,$e,st,re.image.data):re.isCompressedTexture?G.compressedTexSubImage2D(G.TEXTURE_2D,te,N.x,N.y,re.mipmaps[0].width,re.mipmaps[0].height,$e,re.mipmaps[0].data):G.texSubImage2D(G.TEXTURE_2D,te,N.x,N.y,$e,st,re.image),te===0&&de.generateMipmaps&&G.generateMipmap(G.TEXTURE_2D),xe.unbindTexture()},this.copyTextureToTexture3D=function(N,re,de,te,me=0){if(S.isWebGL1Renderer){console.warn("THREE.WebGLRenderer.copyTextureToTexture3D: can only be used with WebGL2.");return}const Xe=N.max.x-N.min.x+1,$e=N.max.y-N.min.y+1,st=N.max.z-N.min.z+1,ot=be.convert(te.format),St=be.convert(te.type);let at;if(te.isData3DTexture)Ge.setTexture3D(te,0),at=G.TEXTURE_3D;else if(te.isDataArrayTexture)Ge.setTexture2DArray(te,0),at=G.TEXTURE_2D_ARRAY;else{console.warn("THREE.WebGLRenderer.copyTextureToTexture3D: only supports THREE.DataTexture3D and THREE.DataTexture2DArray.");return}G.pixelStorei(G.UNPACK_FLIP_Y_WEBGL,te.flipY),G.pixelStorei(G.UNPACK_PREMULTIPLY_ALPHA_WEBGL,te.premultiplyAlpha),G.pixelStorei(G.UNPACK_ALIGNMENT,te.unpackAlignment);const lt=G.getParameter(G.UNPACK_ROW_LENGTH),Vt=G.getParameter(G.UNPACK_IMAGE_HEIGHT),Xt=G.getParameter(G.UNPACK_SKIP_PIXELS),Di=G.getParameter(G.UNPACK_SKIP_ROWS),Fi=G.getParameter(G.UNPACK_SKIP_IMAGES),kt=de.isCompressedTexture?de.mipmaps[0]:de.image;G.pixelStorei(G.UNPACK_ROW_LENGTH,kt.width),G.pixelStorei(G.UNPACK_IMAGE_HEIGHT,kt.height),G.pixelStorei(G.UNPACK_SKIP_PIXELS,N.min.x),G.pixelStorei(G.UNPACK_SKIP_ROWS,N.min.y),G.pixelStorei(G.UNPACK_SKIP_IMAGES,N.min.z),de.isDataTexture||de.isData3DTexture?G.texSubImage3D(at,me,re.x,re.y,re.z,Xe,$e,st,ot,St,kt.data):de.isCompressedArrayTexture?(console.warn("THREE.WebGLRenderer.copyTextureToTexture3D: untested support for compressed srcTexture."),G.compressedTexSubImage3D(at,me,re.x,re.y,re.z,Xe,$e,st,ot,kt.data)):G.texSubImage3D(at,me,re.x,re.y,re.z,Xe,$e,st,ot,St,kt),G.pixelStorei(G.UNPACK_ROW_LENGTH,lt),G.pixelStorei(G.UNPACK_IMAGE_HEIGHT,Vt),G.pixelStorei(G.UNPACK_SKIP_PIXELS,Xt),G.pixelStorei(G.UNPACK_SKIP_ROWS,Di),G.pixelStorei(G.UNPACK_SKIP_IMAGES,Fi),me===0&&te.generateMipmaps&&G.generateMipmap(at),xe.unbindTexture()},this.initTexture=function(N){N.isCubeTexture?Ge.setTextureCube(N,0):N.isData3DTexture?Ge.setTexture3D(N,0):N.isDataArrayTexture||N.isCompressedArrayTexture?Ge.setTexture2DArray(N,0):Ge.setTexture2D(N,0),xe.unbindTexture()},this.resetState=function(){C=0,b=0,P=null,xe.reset(),Ie.reset()},typeof __THREE_DEVTOOLS__<"u"&&__THREE_DEVTOOLS__.dispatchEvent(new CustomEvent("observe",{detail:this}))}get coordinateSystem(){return cs}get physicallyCorrectLights(){return console.warn("THREE.WebGLRenderer: the property .physicallyCorrectLights has been removed. Set renderer.useLegacyLights instead."),!this.useLegacyLights}set physicallyCorrectLights(e){console.warn("THREE.WebGLRenderer: the property .physicallyCorrectLights has been removed. Set renderer.useLegacyLights instead."),this.useLegacyLights=!e}get outputEncoding(){return console.warn("THREE.WebGLRenderer: Property .outputEncoding has been removed. Use .outputColorSpace instead."),this.outputColorSpace===mt?ko:mS}set outputEncoding(e){console.warn("THREE.WebGLRenderer: Property .outputEncoding has been removed. Use .outputColorSpace instead."),this.outputColorSpace=e===ko?mt:Vr}}class y2 extends CS{}y2.prototype.isWebGL1Renderer=!0;class Fg{constructor(e,t=25e-5){this.isFogExp2=!0,this.name="",this.color=new Oe(e),this.density=t}clone(){return new Fg(this.color,this.density)}toJSON(){return{type:"FogExp2",color:this.color.getHex(),density:this.density}}}class Ng{constructor(e,t=1,i=1e3){this.isFog=!0,this.name="",this.color=new Oe(e),this.near=t,this.far=i}clone(){return new Ng(this.color,this.near,this.far)}toJSON(){return{type:"Fog",color:this.color.getHex(),near:this.near,far:this.far}}}class qm extends bt{constructor(){super(),this.isScene=!0,this.type="Scene",this.background=null,this.environment=null,this.fog=null,this.backgroundBlurriness=0,this.backgroundIntensity=1,this.overrideMaterial=null,typeof __THREE_DEVTOOLS__<"u"&&__THREE_DEVTOOLS__.dispatchEvent(new CustomEvent("observe",{detail:this}))}copy(e,t){return super.copy(e,t),e.background!==null&&(this.background=e.background.clone()),e.environment!==null&&(this.environment=e.environment.clone()),e.fog!==null&&(this.fog=e.fog.clone()),this.backgroundBlurriness=e.backgroundBlurriness,this.backgroundIntensity=e.backgroundIntensity,e.overrideMaterial!==null&&(this.overrideMaterial=e.overrideMaterial.clone()),this.matrixAutoUpdate=e.matrixAutoUpdate,this}toJSON(e){const t=super.toJSON(e);return this.fog!==null&&(t.object.fog=this.fog.toJSON()),this.backgroundBlurriness>0&&(t.object.backgroundBlurriness=this.backgroundBlurriness),this.backgroundIntensity!==1&&(t.object.backgroundIntensity=this.backgroundIntensity),t}}class bh{constructor(e,t){this.isInterleavedBuffer=!0,this.array=e,this.stride=t,this.count=e!==void 0?e.length/t:0,this.usage=ih,this.updateRange={offset:0,count:-1},this.version=0,this.uuid=Ji()}onUploadCallback(){}set needsUpdate(e){e===!0&&this.version++}setUsage(e){return this.usage=e,this}copy(e){return this.array=new e.array.constructor(e.array),this.count=e.count,this.stride=e.stride,this.usage=e.usage,this}copyAt(e,t,i){e*=this.stride,i*=t.stride;for(let r=0,s=this.stride;r<s;r++)this.array[e+r]=t.array[i+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=Ji()),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]),i=new this.constructor(t,this.stride);return i.setUsage(this.usage),i}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=Ji()),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 fi=new F;class Yo{constructor(e,t,i,r=!1){this.isInterleavedBufferAttribute=!0,this.name="",this.data=e,this.itemSize=t,this.offset=i,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,i=this.data.count;t<i;t++)fi.fromBufferAttribute(this,t),fi.applyMatrix4(e),this.setXYZ(t,fi.x,fi.y,fi.z);return this}applyNormalMatrix(e){for(let t=0,i=this.count;t<i;t++)fi.fromBufferAttribute(this,t),fi.applyNormalMatrix(e),this.setXYZ(t,fi.x,fi.y,fi.z);return this}transformDirection(e){for(let t=0,i=this.count;t<i;t++)fi.fromBufferAttribute(this,t),fi.transformDirection(e),this.setXYZ(t,fi.x,fi.y,fi.z);return this}setX(e,t){return this.normalized&&(t=At(t,this.array)),this.data.array[e*this.data.stride+this.offset]=t,this}setY(e,t){return this.normalized&&(t=At(t,this.array)),this.data.array[e*this.data.stride+this.offset+1]=t,this}setZ(e,t){return this.normalized&&(t=At(t,this.array)),this.data.array[e*this.data.stride+this.offset+2]=t,this}setW(e,t){return this.normalized&&(t=At(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=Wi(t,this.array)),t}getY(e){let t=this.data.array[e*this.data.stride+this.offset+1];return this.normalized&&(t=Wi(t,this.array)),t}getZ(e){let t=this.data.array[e*this.data.stride+this.offset+2];return this.normalized&&(t=Wi(t,this.array)),t}getW(e){let t=this.data.array[e*this.data.stride+this.offset+3];return this.normalized&&(t=Wi(t,this.array)),t}setXY(e,t,i){return e=e*this.data.stride+this.offset,this.normalized&&(t=At(t,this.array),i=At(i,this.array)),this.data.array[e+0]=t,this.data.array[e+1]=i,this}setXYZ(e,t,i,r){return e=e*this.data.stride+this.offset,this.normalized&&(t=At(t,this.array),i=At(i,this.array),r=At(r,this.array)),this.data.array[e+0]=t,this.data.array[e+1]=i,this.data.array[e+2]=r,this}setXYZW(e,t,i,r,s){return e=e*this.data.stride+this.offset,this.normalized&&(t=At(t,this.array),i=At(i,this.array),r=At(r,this.array),s=At(s,this.array)),this.data.array[e+0]=t,this.data.array[e+1]=i,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 i=0;i<this.count;i++){const r=i*this.data.stride+this.offset;for(let s=0;s<this.itemSize;s++)t.push(this.data.array[r+s])}return new Dt(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 Yo(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 i=0;i<this.count;i++){const r=i*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 bS extends Cn{constructor(e){super(),this.isSpriteMaterial=!0,this.type="SpriteMaterial",this.color=new Oe(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 Jl;const Xu=new F,Kl=new F,Yl=new F,Ql=new ge,Ju=new ge,x2=new rt,Ep=new F,Ku=new F,wp=new F,iT=new ge,fy=new ge,rT=new ge;class _2 extends bt{constructor(e){if(super(),this.isSprite=!0,this.type="Sprite",Jl===void 0){Jl=new gt;const t=new Float32Array([-.5,-.5,0,0,0,.5,-.5,0,1,0,.5,.5,0,1,1,-.5,.5,0,0,1]),i=new bh(t,5);Jl.setIndex([0,1,2,0,2,3]),Jl.setAttribute("position",new Yo(i,3,0,!1)),Jl.setAttribute("uv",new Yo(i,2,3,!1))}this.geometry=Jl,this.material=e!==void 0?e:new bS,this.center=new ge(.5,.5)}raycast(e,t){e.camera===null&&console.error('THREE.Sprite: "Raycaster.camera" needs to be set in order to raycast against sprites.'),Kl.setFromMatrixScale(this.matrixWorld),x2.copy(e.camera.matrixWorld),this.modelViewMatrix.multiplyMatrices(e.camera.matrixWorldInverse,this.matrixWorld),Yl.setFromMatrixPosition(this.modelViewMatrix),e.camera.isPerspectiveCamera&&this.material.sizeAttenuation===!1&&Kl.multiplyScalar(-Yl.z);const i=this.material.rotation;let r,s;i!==0&&(s=Math.cos(i),r=Math.sin(i));const o=this.center;Tp(Ep.set(-.5,-.5,0),Yl,o,Kl,r,s),Tp(Ku.set(.5,-.5,0),Yl,o,Kl,r,s),Tp(wp.set(.5,.5,0),Yl,o,Kl,r,s),iT.set(0,0),fy.set(1,0),rT.set(1,1);let a=e.ray.intersectTriangle(Ep,Ku,wp,!1,Xu);if(a===null&&(Tp(Ku.set(-.5,.5,0),Yl,o,Kl,r,s),fy.set(0,1),a=e.ray.intersectTriangle(Ep,wp,Ku,!1,Xu),a===null))return;const l=e.ray.origin.distanceTo(Xu);l<e.near||l>e.far||t.push({distance:l,point:Xu.clone(),uv:wi.getInterpolation(Xu,Ep,Ku,wp,iT,fy,rT,new ge),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 Tp(n,e,t,i,r,s){Ql.subVectors(n,t).addScalar(.5).multiply(i),r!==void 0?(Ju.x=s*Ql.x-r*Ql.y,Ju.y=r*Ql.x+s*Ql.y):Ju.copy(Ql),n.copy(e),n.x+=Ju.x,n.y+=Ju.y,n.applyMatrix4(x2)}const Cp=new F,sT=new F;class A2 extends bt{constructor(){super(),this._currentLevel=0,this.type="LOD",Object.defineProperties(this,{levels:{enumerable:!0,value:[]},isLOD:{value:!0}}),this.autoUpdate=!0}copy(e){super.copy(e,!1);const t=e.levels;for(let i=0,r=t.length;i<r;i++){const s=t[i];this.addLevel(s.object.clone(),s.distance,s.hysteresis)}return this.autoUpdate=e.autoUpdate,this}addLevel(e,t=0,i=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:i,object:e}),this.add(e),this}getCurrentLevel(){return this._currentLevel}getObjectForDistance(e){const t=this.levels;if(t.length>0){let i,r;for(i=1,r=t.length;i<r;i++){let s=t[i].distance;if(t[i].object.visible&&(s-=s*t[i].hysteresis),e<s)break}return t[i-1].object}return null}raycast(e,t){if(this.levels.length>0){Cp.setFromMatrixPosition(this.matrixWorld);const r=e.ray.origin.distanceTo(Cp);this.getObjectForDistance(r).raycast(e,t)}}update(e){const t=this.levels;if(t.length>1){Cp.setFromMatrixPosition(e.matrixWorld),sT.setFromMatrixPosition(this.matrixWorld);const i=Cp.distanceTo(sT)/e.zoom;t[0].object.visible=!0;let r,s;for(r=1,s=t.length;r<s;r++){let o=t[r].distance;if(t[r].object.visible&&(o-=o*t[r].hysteresis),i>=o)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 i=this.levels;for(let r=0,s=i.length;r<s;r++){const o=i[r];t.object.levels.push({object:o.object.uuid,distance:o.distance,hysteresis:o.hysteresis})}return t}}const oT=new F,aT=new Nt,lT=new Nt,i4=new F,cT=new rt,Zl=new F,hy=new Sr,uT=new rt,dy=new uu;class RS extends Hn{constructor(e,t){super(e,t),this.isSkinnedMesh=!0,this.type="SkinnedMesh",this.bindMode="attached",this.bindMatrix=new rt,this.bindMatrixInverse=new rt,this.boundingBox=null,this.boundingSphere=null}computeBoundingBox(){const e=this.geometry;this.boundingBox===null&&(this.boundingBox=new Xr),this.boundingBox.makeEmpty();const t=e.getAttribute("position");for(let i=0;i<t.count;i++)Zl.fromBufferAttribute(t,i),this.applyBoneTransform(i,Zl),this.boundingBox.expandByPoint(Zl)}computeBoundingSphere(){const e=this.geometry;this.boundingSphere===null&&(this.boundingSphere=new Sr),this.boundingSphere.makeEmpty();const t=e.getAttribute("position");for(let i=0;i<t.count;i++)Zl.fromBufferAttribute(t,i),this.applyBoneTransform(i,Zl),this.boundingSphere.expandByPoint(Zl)}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 i=this.material,r=this.matrixWorld;i!==void 0&&(this.boundingSphere===null&&this.computeBoundingSphere(),hy.copy(this.boundingSphere),hy.applyMatrix4(r),e.ray.intersectsSphere(hy)!==!1&&(uT.copy(r).invert(),dy.copy(e.ray).applyMatrix4(uT),!(this.boundingBox!==null&&dy.intersectsBox(this.boundingBox)===!1)&&this._computeIntersections(e,t,dy)))}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 Nt,t=this.geometry.attributes.skinWeight;for(let i=0,r=t.count;i<r;i++){e.fromBufferAttribute(t,i);const s=1/e.manhattanLength();s!==1/0?e.multiplyScalar(s):e.set(1,0,0,0),t.setXYZW(i,e.x,e.y,e.z,e.w)}}updateMatrixWorld(e){super.updateMatrixWorld(e),this.bindMode==="attached"?this.bindMatrixInverse.copy(this.matrixWorld).invert():this.bindMode==="detached"?this.bindMatrixInverse.copy(this.bindMatrix).invert():console.warn("THREE.SkinnedMesh: Unrecognized bindMode: "+this.bindMode)}applyBoneTransform(e,t){const i=this.skeleton,r=this.geometry;aT.fromBufferAttribute(r.attributes.skinIndex,e),lT.fromBufferAttribute(r.attributes.skinWeight,e),oT.copy(t).applyMatrix4(this.bindMatrix),t.set(0,0,0);for(let s=0;s<4;s++){const o=lT.getComponent(s);if(o!==0){const a=aT.getComponent(s);cT.multiplyMatrices(i.bones[a].matrixWorld,i.boneInverses[a]),t.addScaledVector(i4.copy(oT).applyMatrix4(cT),o)}}return t.applyMatrix4(this.bindMatrixInverse)}boneTransform(e,t){return console.warn("THREE.SkinnedMesh: .boneTransform() was renamed to .applyBoneTransform() in r151."),this.applyBoneTransform(e,t)}}class Og extends bt{constructor(){super(),this.isBone=!0,this.type="Bone"}}class Ic extends $t{constructor(e=null,t=1,i=1,r,s,o,a,l,u=mn,h=mn,d,p){super(null,o,a,l,u,h,r,s,d,p),this.isDataTexture=!0,this.image={data:e,width:t,height:i},this.generateMipmaps=!1,this.flipY=!1,this.unpackAlignment=1}}const fT=new rt,r4=new rt;class Rh{constructor(e=[],t=[]){this.uuid=Ji(),this.bones=e.slice(0),this.boneInverses=t,this.boneMatrices=null,this.boneTexture=null,this.boneTextureSize=0,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 i=0,r=this.bones.length;i<r;i++)this.boneInverses.push(new rt)}}calculateInverses(){this.boneInverses.length=0;for(let e=0,t=this.bones.length;e<t;e++){const i=new rt;this.bones[e]&&i.copy(this.bones[e].matrixWorld).invert(),this.boneInverses.push(i)}}pose(){for(let e=0,t=this.bones.length;e<t;e++){const i=this.bones[e];i&&i.matrixWorld.copy(this.boneInverses[e]).invert()}for(let e=0,t=this.bones.length;e<t;e++){const i=this.bones[e];i&&(i.parent&&i.parent.isBone?(i.matrix.copy(i.parent.matrixWorld).invert(),i.matrix.multiply(i.matrixWorld)):i.matrix.copy(i.matrixWorld),i.matrix.decompose(i.position,i.quaternion,i.scale))}}update(){const e=this.bones,t=this.boneInverses,i=this.boneMatrices,r=this.boneTexture;for(let s=0,o=e.length;s<o;s++){const a=e[s]?e[s].matrixWorld:r4;fT.multiplyMatrices(a,t[s]),fT.toArray(i,s*16)}r!==null&&(r.needsUpdate=!0)}clone(){return new Rh(this.bones,this.boneInverses)}computeBoneTexture(){let e=Math.sqrt(this.bones.length*4);e=r2(e),e=Math.max(e,4);const t=new Float32Array(e*e*4);t.set(this.boneMatrices);const i=new Ic(t,e,e,Ti,ls);return i.needsUpdate=!0,this.boneMatrices=t,this.boneTexture=i,this.boneTextureSize=e,this}getBoneByName(e){for(let t=0,i=this.bones.length;t<i;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 i=0,r=e.bones.length;i<r;i++){const s=e.bones[i];let o=t[s];o===void 0&&(console.warn("THREE.Skeleton: No bone found with UUID:",s),o=new Og),this.bones.push(o),this.boneInverses.push(new rt().fromArray(e.boneInverses[i]))}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,i=this.boneInverses;for(let r=0,s=t.length;r<s;r++){const o=t[r];e.bones.push(o.uuid);const a=i[r];e.boneInverses.push(a.toArray())}return e}}class qc extends Dt{constructor(e,t,i,r=1){super(e,t,i),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 ql=new rt,hT=new rt,bp=[],dT=new Xr,s4=new rt,Yu=new Hn,Qu=new Sr;class PS extends Hn{constructor(e,t,i){super(e,t),this.isInstancedMesh=!0,this.instanceMatrix=new qc(new Float32Array(i*16),16),this.instanceColor=null,this.count=i,this.boundingBox=null,this.boundingSphere=null;for(let r=0;r<i;r++)this.setMatrixAt(r,s4)}computeBoundingBox(){const e=this.geometry,t=this.count;this.boundingBox===null&&(this.boundingBox=new Xr),e.boundingBox===null&&e.computeBoundingBox(),this.boundingBox.makeEmpty();for(let i=0;i<t;i++)this.getMatrixAt(i,ql),dT.copy(e.boundingBox).applyMatrix4(ql),this.boundingBox.union(dT)}computeBoundingSphere(){const e=this.geometry,t=this.count;this.boundingSphere===null&&(this.boundingSphere=new Sr),e.boundingSphere===null&&e.computeBoundingSphere(),this.boundingSphere.makeEmpty();for(let i=0;i<t;i++)this.getMatrixAt(i,ql),Qu.copy(e.boundingSphere).applyMatrix4(ql),this.boundingSphere.union(Qu)}copy(e,t){return super.copy(e,t),this.instanceMatrix.copy(e.instanceMatrix),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)}raycast(e,t){const i=this.matrixWorld,r=this.count;if(Yu.geometry=this.geometry,Yu.material=this.material,Yu.material!==void 0&&(this.boundingSphere===null&&this.computeBoundingSphere(),Qu.copy(this.boundingSphere),Qu.applyMatrix4(i),e.ray.intersectsSphere(Qu)!==!1))for(let s=0;s<r;s++){this.getMatrixAt(s,ql),hT.multiplyMatrices(i,ql),Yu.matrixWorld=hT,Yu.raycast(e,bp);for(let o=0,a=bp.length;o<a;o++){const l=bp[o];l.instanceId=s,l.object=this,t.push(l)}bp.length=0}}setColorAt(e,t){this.instanceColor===null&&(this.instanceColor=new qc(new Float32Array(this.instanceMatrix.count*3),3)),t.toArray(this.instanceColor.array,e*3)}setMatrixAt(e,t){t.toArray(this.instanceMatrix.array,e*16)}updateMorphTargets(){}dispose(){this.dispatchEvent({type:"dispose"})}}class ai extends Cn{constructor(e){super(),this.isLineBasicMaterial=!0,this.type="LineBasicMaterial",this.color=new Oe(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 pT=new F,mT=new F,gT=new rt,py=new uu,Rp=new Sr;class Zs extends bt{constructor(e=new gt,t=new ai){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=e.material,this.geometry=e.geometry,this}computeLineDistances(){const e=this.geometry;if(e.index===null){const t=e.attributes.position,i=[0];for(let r=1,s=t.count;r<s;r++)pT.fromBufferAttribute(t,r-1),mT.fromBufferAttribute(t,r),i[r]=i[r-1],i[r]+=pT.distanceTo(mT);e.setAttribute("lineDistance",new Ye(i,1))}else console.warn("THREE.Line.computeLineDistances(): Computation only possible with non-indexed BufferGeometry.");return this}raycast(e,t){const i=this.geometry,r=this.matrixWorld,s=e.params.Line.threshold,o=i.drawRange;if(i.boundingSphere===null&&i.computeBoundingSphere(),Rp.copy(i.boundingSphere),Rp.applyMatrix4(r),Rp.radius+=s,e.ray.intersectsSphere(Rp)===!1)return;gT.copy(r).invert(),py.copy(e.ray).applyMatrix4(gT);const a=s/((this.scale.x+this.scale.y+this.scale.z)/3),l=a*a,u=new F,h=new F,d=new F,p=new F,m=this.isLineSegments?2:1,y=i.index,_=i.attributes.position;if(y!==null){const g=Math.max(0,o.start),x=Math.min(y.count,o.start+o.count);for(let S=g,E=x-1;S<E;S+=m){const C=y.getX(S),b=y.getX(S+1);if(u.fromBufferAttribute(_,C),h.fromBufferAttribute(_,b),py.distanceSqToSegment(u,h,p,d)>l)continue;p.applyMatrix4(this.matrixWorld);const B=e.ray.origin.distanceTo(p);B<e.near||B>e.far||t.push({distance:B,point:d.clone().applyMatrix4(this.matrixWorld),index:S,face:null,faceIndex:null,object:this})}}else{const g=Math.max(0,o.start),x=Math.min(_.count,o.start+o.count);for(let S=g,E=x-1;S<E;S+=m){if(u.fromBufferAttribute(_,S),h.fromBufferAttribute(_,S+1),py.distanceSqToSegment(u,h,p,d)>l)continue;p.applyMatrix4(this.matrixWorld);const b=e.ray.origin.distanceTo(p);b<e.near||b>e.far||t.push({distance:b,point:d.clone().applyMatrix4(this.matrixWorld),index:S,face:null,faceIndex:null,object:this})}}}updateMorphTargets(){const t=this.geometry.morphAttributes,i=Object.keys(t);if(i.length>0){const r=t[i[0]];if(r!==void 0){this.morphTargetInfluences=[],this.morphTargetDictionary={};for(let s=0,o=r.length;s<o;s++){const a=r[s].name||String(s);this.morphTargetInfluences.push(0),this.morphTargetDictionary[a]=s}}}}}const vT=new F,yT=new F;class Jr extends Zs{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,i=[];for(let r=0,s=t.count;r<s;r+=2)vT.fromBufferAttribute(t,r),yT.fromBufferAttribute(t,r+1),i[r]=r===0?0:i[r-1],i[r+1]=i[r]+vT.distanceTo(yT);e.setAttribute("lineDistance",new Ye(i,1))}else console.warn("THREE.LineSegments.computeLineDistances(): Computation only possible with non-indexed BufferGeometry.");return this}}class BS extends Zs{constructor(e,t){super(e,t),this.isLineLoop=!0,this.type="LineLoop"}}class Ph extends Cn{constructor(e){super(),this.isPointsMaterial=!0,this.type="PointsMaterial",this.color=new Oe(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 xT=new rt,B_=new uu,Pp=new Sr,Bp=new F;let LS=class extends bt{constructor(e=new gt,t=new Ph){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=e.material,this.geometry=e.geometry,this}raycast(e,t){const i=this.geometry,r=this.matrixWorld,s=e.params.Points.threshold,o=i.drawRange;if(i.boundingSphere===null&&i.computeBoundingSphere(),Pp.copy(i.boundingSphere),Pp.applyMatrix4(r),Pp.radius+=s,e.ray.intersectsSphere(Pp)===!1)return;xT.copy(r).invert(),B_.copy(e.ray).applyMatrix4(xT);const a=s/((this.scale.x+this.scale.y+this.scale.z)/3),l=a*a,u=i.index,d=i.attributes.position;if(u!==null){const p=Math.max(0,o.start),m=Math.min(u.count,o.start+o.count);for(let y=p,M=m;y<M;y++){const _=u.getX(y);Bp.fromBufferAttribute(d,_),_T(Bp,_,l,r,e,t,this)}}else{const p=Math.max(0,o.start),m=Math.min(d.count,o.start+o.count);for(let y=p,M=m;y<M;y++)Bp.fromBufferAttribute(d,y),_T(Bp,y,l,r,e,t,this)}}updateMorphTargets(){const t=this.geometry.morphAttributes,i=Object.keys(t);if(i.length>0){const r=t[i[0]];if(r!==void 0){this.morphTargetInfluences=[],this.morphTargetDictionary={};for(let s=0,o=r.length;s<o;s++){const a=r[s].name||String(s);this.morphTargetInfluences.push(0),this.morphTargetDictionary[a]=s}}}}};function _T(n,e,t,i,r,s,o){const a=B_.distanceSqToPoint(n);if(a<t){const l=new F;B_.closestPointToPoint(n,l),l.applyMatrix4(i);const u=r.ray.origin.distanceTo(l);if(u<r.near||u>r.far)return;s.push({distance:u,distanceToRay:Math.sqrt(a),point:l,index:e,face:null,object:o})}}class o4 extends $t{constructor(e,t,i,r,s,o,a,l,u){super(e,t,i,r,s,o,a,l,u),this.isVideoTexture=!0,this.minFilter=o!==void 0?o:rn,this.magFilter=s!==void 0?s:rn,this.generateMipmaps=!1;const h=this;function d(){h.needsUpdate=!0,e.requestVideoFrameCallback(d)}"requestVideoFrameCallback"in e&&e.requestVideoFrameCallback(d)}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 a4 extends $t{constructor(e,t){super({width:e,height:t}),this.isFramebufferTexture=!0,this.magFilter=mn,this.minFilter=mn,this.generateMipmaps=!1,this.needsUpdate=!0}}class IS extends $t{constructor(e,t,i,r,s,o,a,l,u,h,d,p){super(null,o,a,l,u,h,r,s,d,p),this.isCompressedTexture=!0,this.image={width:t,height:i},this.mipmaps=e,this.flipY=!1,this.generateMipmaps=!1}}class l4 extends IS{constructor(e,t,i,r,s,o){super(e,t,i,s,o),this.isCompressedArrayTexture=!0,this.image.depth=r,this.wrapR=Xn}}class c4 extends $t{constructor(e,t,i,r,s,o,a,l,u){super(e,t,i,r,s,o,a,l,u),this.isCanvasTexture=!0,this.needsUpdate=!0}}class Kr{constructor(){this.type="Curve",this.arcLengthDivisions=200}getPoint(){return console.warn("THREE.Curve: .getPoint() not implemented."),null}getPointAt(e,t){const i=this.getUtoTmapping(e);return this.getPoint(i,t)}getPoints(e=5){const t=[];for(let i=0;i<=e;i++)t.push(this.getPoint(i/e));return t}getSpacedPoints(e=5){const t=[];for(let i=0;i<=e;i++)t.push(this.getPointAt(i/e));return t}getLength(){const e=this.getLengths();return e[e.length-1]}getLengths(e=this.arcLengthDivisions){if(this.cacheArcLengths&&this.cacheArcLengths.length===e+1&&!this.needsUpdate)return this.cacheArcLengths;this.needsUpdate=!1;const t=[];let i,r=this.getPoint(0),s=0;t.push(0);for(let o=1;o<=e;o++)i=this.getPoint(o/e),s+=i.distanceTo(r),t.push(s),r=i;return this.cacheArcLengths=t,t}updateArcLengths(){this.needsUpdate=!0,this.getLengths()}getUtoTmapping(e,t){const i=this.getLengths();let r=0;const s=i.length;let o;t?o=t:o=e*i[s-1];let a=0,l=s-1,u;for(;a<=l;)if(r=Math.floor(a+(l-a)/2),u=i[r]-o,u<0)a=r+1;else if(u>0)l=r-1;else{l=r;break}if(r=l,i[r]===o)return r/(s-1);const h=i[r],p=i[r+1]-h,m=(o-h)/p;return(r+m)/(s-1)}getTangent(e,t){let r=e-1e-4,s=e+1e-4;r<0&&(r=0),s>1&&(s=1);const o=this.getPoint(r),a=this.getPoint(s),l=t||(o.isVector2?new ge:new F);return l.copy(a).sub(o).normalize(),l}getTangentAt(e,t){const i=this.getUtoTmapping(e);return this.getTangent(i,t)}computeFrenetFrames(e,t){const i=new F,r=[],s=[],o=[],a=new F,l=new rt;for(let m=0;m<=e;m++){const y=m/e;r[m]=this.getTangentAt(y,new F)}s[0]=new F,o[0]=new F;let u=Number.MAX_VALUE;const h=Math.abs(r[0].x),d=Math.abs(r[0].y),p=Math.abs(r[0].z);h<=u&&(u=h,i.set(1,0,0)),d<=u&&(u=d,i.set(0,1,0)),p<=u&&i.set(0,0,1),a.crossVectors(r[0],i).normalize(),s[0].crossVectors(r[0],a),o[0].crossVectors(r[0],s[0]);for(let m=1;m<=e;m++){if(s[m]=s[m-1].clone(),o[m]=o[m-1].clone(),a.crossVectors(r[m-1],r[m]),a.length()>Number.EPSILON){a.normalize();const y=Math.acos(gn(r[m-1].dot(r[m]),-1,1));s[m].applyMatrix4(l.makeRotationAxis(a,y))}o[m].crossVectors(r[m],s[m])}if(t===!0){let m=Math.acos(gn(s[0].dot(s[e]),-1,1));m/=e,r[0].dot(a.crossVectors(s[0],s[e]))>0&&(m=-m);for(let y=1;y<=e;y++)s[y].applyMatrix4(l.makeRotationAxis(r[y],m*y)),o[y].crossVectors(r[y],s[y])}return{tangents:r,normals:s,binormals:o}}clone(){return new this.constructor().copy(this)}copy(e){return this.arcLengthDivisions=e.arcLengthDivisions,this}toJSON(){const e={metadata:{version:4.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 Ug extends Kr{constructor(e=0,t=0,i=1,r=1,s=0,o=Math.PI*2,a=!1,l=0){super(),this.isEllipseCurve=!0,this.type="EllipseCurve",this.aX=e,this.aY=t,this.xRadius=i,this.yRadius=r,this.aStartAngle=s,this.aEndAngle=o,this.aClockwise=a,this.aRotation=l}getPoint(e,t){const i=t||new ge,r=Math.PI*2;let s=this.aEndAngle-this.aStartAngle;const o=Math.abs(s)<Number.EPSILON;for(;s<0;)s+=r;for(;s>r;)s-=r;s<Number.EPSILON&&(o?s=0:s=r),this.aClockwise===!0&&!o&&(s===r?s=-r:s=s-r);const a=this.aStartAngle+e*s;let l=this.aX+this.xRadius*Math.cos(a),u=this.aY+this.yRadius*Math.sin(a);if(this.aRotation!==0){const h=Math.cos(this.aRotation),d=Math.sin(this.aRotation),p=l-this.aX,m=u-this.aY;l=p*h-m*d+this.aX,u=p*d+m*h+this.aY}return i.set(l,u)}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 S2 extends Ug{constructor(e,t,i,r,s,o){super(e,t,i,i,r,s,o),this.isArcCurve=!0,this.type="ArcCurve"}}function DS(){let n=0,e=0,t=0,i=0;function r(s,o,a,l){n=s,e=a,t=-3*s+3*o-2*a-l,i=2*s-2*o+a+l}return{initCatmullRom:function(s,o,a,l,u){r(o,a,u*(a-s),u*(l-o))},initNonuniformCatmullRom:function(s,o,a,l,u,h,d){let p=(o-s)/u-(a-s)/(u+h)+(a-o)/h,m=(a-o)/h-(l-o)/(h+d)+(l-a)/d;p*=h,m*=h,r(o,a,p,m)},calc:function(s){const o=s*s,a=o*s;return n+e*s+t*o+i*a}}}const Lp=new F,my=new DS,gy=new DS,vy=new DS;class M2 extends Kr{constructor(e=[],t=!1,i="centripetal",r=.5){super(),this.isCatmullRomCurve3=!0,this.type="CatmullRomCurve3",this.points=e,this.closed=t,this.curveType=i,this.tension=r}getPoint(e,t=new F){const i=t,r=this.points,s=r.length,o=(s-(this.closed?0:1))*e;let a=Math.floor(o),l=o-a;this.closed?a+=a>0?0:(Math.floor(Math.abs(a)/s)+1)*s:l===0&&a===s-1&&(a=s-2,l=1);let u,h;this.closed||a>0?u=r[(a-1)%s]:(Lp.subVectors(r[0],r[1]).add(r[0]),u=Lp);const d=r[a%s],p=r[(a+1)%s];if(this.closed||a+2<s?h=r[(a+2)%s]:(Lp.subVectors(r[s-1],r[s-2]).add(r[s-1]),h=Lp),this.curveType==="centripetal"||this.curveType==="chordal"){const m=this.curveType==="chordal"?.5:.25;let y=Math.pow(u.distanceToSquared(d),m),M=Math.pow(d.distanceToSquared(p),m),_=Math.pow(p.distanceToSquared(h),m);M<1e-4&&(M=1),y<1e-4&&(y=M),_<1e-4&&(_=M),my.initNonuniformCatmullRom(u.x,d.x,p.x,h.x,y,M,_),gy.initNonuniformCatmullRom(u.y,d.y,p.y,h.y,y,M,_),vy.initNonuniformCatmullRom(u.z,d.z,p.z,h.z,y,M,_)}else this.curveType==="catmullrom"&&(my.initCatmullRom(u.x,d.x,p.x,h.x,this.tension),gy.initCatmullRom(u.y,d.y,p.y,h.y,this.tension),vy.initCatmullRom(u.z,d.z,p.z,h.z,this.tension));return i.set(my.calc(l),gy.calc(l),vy.calc(l)),i}copy(e){super.copy(e),this.points=[];for(let t=0,i=e.points.length;t<i;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,i=this.points.length;t<i;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,i=e.points.length;t<i;t++){const r=e.points[t];this.points.push(new F().fromArray(r))}return this.closed=e.closed,this.curveType=e.curveType,this.tension=e.tension,this}}function AT(n,e,t,i,r){const s=(i-e)*.5,o=(r-t)*.5,a=n*n,l=n*a;return(2*t-2*i+s+o)*l+(-3*t+3*i-2*s-o)*a+s*n+t}function u4(n,e){const t=1-n;return t*t*e}function f4(n,e){return 2*(1-n)*n*e}function h4(n,e){return n*n*e}function Rf(n,e,t,i){return u4(n,e)+f4(n,t)+h4(n,i)}function d4(n,e){const t=1-n;return t*t*t*e}function p4(n,e){const t=1-n;return 3*t*t*n*e}function m4(n,e){return 3*(1-n)*n*n*e}function g4(n,e){return n*n*n*e}function Pf(n,e,t,i,r){return d4(n,e)+p4(n,t)+m4(n,i)+g4(n,r)}class FS extends Kr{constructor(e=new ge,t=new ge,i=new ge,r=new ge){super(),this.isCubicBezierCurve=!0,this.type="CubicBezierCurve",this.v0=e,this.v1=t,this.v2=i,this.v3=r}getPoint(e,t=new ge){const i=t,r=this.v0,s=this.v1,o=this.v2,a=this.v3;return i.set(Pf(e,r.x,s.x,o.x,a.x),Pf(e,r.y,s.y,o.y,a.y)),i}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 E2 extends Kr{constructor(e=new F,t=new F,i=new F,r=new F){super(),this.isCubicBezierCurve3=!0,this.type="CubicBezierCurve3",this.v0=e,this.v1=t,this.v2=i,this.v3=r}getPoint(e,t=new F){const i=t,r=this.v0,s=this.v1,o=this.v2,a=this.v3;return i.set(Pf(e,r.x,s.x,o.x,a.x),Pf(e,r.y,s.y,o.y,a.y),Pf(e,r.z,s.z,o.z,a.z)),i}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 kg extends Kr{constructor(e=new ge,t=new ge){super(),this.isLineCurve=!0,this.type="LineCurve",this.v1=e,this.v2=t}getPoint(e,t=new ge){const i=t;return e===1?i.copy(this.v2):(i.copy(this.v2).sub(this.v1),i.multiplyScalar(e).add(this.v1)),i}getPointAt(e,t){return this.getPoint(e,t)}getTangent(e,t=new ge){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 w2 extends Kr{constructor(e=new F,t=new F){super(),this.isLineCurve3=!0,this.type="LineCurve3",this.v1=e,this.v2=t}getPoint(e,t=new F){const i=t;return e===1?i.copy(this.v2):(i.copy(this.v2).sub(this.v1),i.multiplyScalar(e).add(this.v1)),i}getPointAt(e,t){return this.getPoint(e,t)}getTangent(e,t=new F){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 NS extends Kr{constructor(e=new ge,t=new ge,i=new ge){super(),this.isQuadraticBezierCurve=!0,this.type="QuadraticBezierCurve",this.v0=e,this.v1=t,this.v2=i}getPoint(e,t=new ge){const i=t,r=this.v0,s=this.v1,o=this.v2;return i.set(Rf(e,r.x,s.x,o.x),Rf(e,r.y,s.y,o.y)),i}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 OS extends Kr{constructor(e=new F,t=new F,i=new F){super(),this.isQuadraticBezierCurve3=!0,this.type="QuadraticBezierCurve3",this.v0=e,this.v1=t,this.v2=i}getPoint(e,t=new F){const i=t,r=this.v0,s=this.v1,o=this.v2;return i.set(Rf(e,r.x,s.x,o.x),Rf(e,r.y,s.y,o.y),Rf(e,r.z,s.z,o.z)),i}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 US extends Kr{constructor(e=[]){super(),this.isSplineCurve=!0,this.type="SplineCurve",this.points=e}getPoint(e,t=new ge){const i=t,r=this.points,s=(r.length-1)*e,o=Math.floor(s),a=s-o,l=r[o===0?o:o-1],u=r[o],h=r[o>r.length-2?r.length-1:o+1],d=r[o>r.length-3?r.length-1:o+2];return i.set(AT(a,l.x,u.x,h.x,d.x),AT(a,l.y,u.y,h.y,d.y)),i}copy(e){super.copy(e),this.points=[];for(let t=0,i=e.points.length;t<i;t++){const r=e.points[t];this.points.push(r.clone())}return this}toJSON(){const e=super.toJSON();e.points=[];for(let t=0,i=this.points.length;t<i;t++){const r=this.points[t];e.points.push(r.toArray())}return e}fromJSON(e){super.fromJSON(e),this.points=[];for(let t=0,i=e.points.length;t<i;t++){const r=e.points[t];this.points.push(new ge().fromArray(r))}return this}}var kS=Object.freeze({__proto__:null,ArcCurve:S2,CatmullRomCurve3:M2,CubicBezierCurve:FS,CubicBezierCurve3:E2,EllipseCurve:Ug,LineCurve:kg,LineCurve3:w2,QuadraticBezierCurve:NS,QuadraticBezierCurve3:OS,SplineCurve:US});class T2 extends Kr{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);e.equals(t)||this.curves.push(new kg(t,e))}getPoint(e,t){const i=e*this.getLength(),r=this.getCurveLengths();let s=0;for(;s<r.length;){if(r[s]>=i){const o=r[s]-i,a=this.curves[s],l=a.getLength(),u=l===0?0:1-o/l;return a.getPointAt(u,t)}s++}return null}getLength(){const e=this.getCurveLengths();return e[e.length-1]}updateArcLengths(){this.needsUpdate=!0,this.cacheLengths=null,this.getCurveLengths()}getCurveLengths(){if(this.cacheLengths&&this.cacheLengths.length===this.curves.length)return this.cacheLengths;const e=[];let t=0;for(let i=0,r=this.curves.length;i<r;i++)t+=this.curves[i].getLength(),e.push(t);return this.cacheLengths=e,e}getSpacedPoints(e=40){const t=[];for(let i=0;i<=e;i++)t.push(this.getPoint(i/e));return this.autoClose&&t.push(t[0]),t}getPoints(e=12){const t=[];let i;for(let r=0,s=this.curves;r<s.length;r++){const o=s[r],a=o.isEllipseCurve?e*2:o.isLineCurve||o.isLineCurve3?1:o.isSplineCurve?e*o.points.length:e,l=o.getPoints(a);for(let u=0;u<l.length;u++){const h=l[u];i&&i.equals(h)||(t.push(h),i=h)}}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,i=e.curves.length;t<i;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,i=this.curves.length;t<i;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,i=e.curves.length;t<i;t++){const r=e.curves[t];this.curves.push(new kS[r.type]().fromJSON(r))}return this}}class oh extends T2{constructor(e){super(),this.type="Path",this.currentPoint=new ge,e&&this.setFromPoints(e)}setFromPoints(e){this.moveTo(e[0].x,e[0].y);for(let t=1,i=e.length;t<i;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 i=new kg(this.currentPoint.clone(),new ge(e,t));return this.curves.push(i),this.currentPoint.set(e,t),this}quadraticCurveTo(e,t,i,r){const s=new NS(this.currentPoint.clone(),new ge(e,t),new ge(i,r));return this.curves.push(s),this.currentPoint.set(i,r),this}bezierCurveTo(e,t,i,r,s,o){const a=new FS(this.currentPoint.clone(),new ge(e,t),new ge(i,r),new ge(s,o));return this.curves.push(a),this.currentPoint.set(s,o),this}splineThru(e){const t=[this.currentPoint.clone()].concat(e),i=new US(t);return this.curves.push(i),this.currentPoint.copy(e[e.length-1]),this}arc(e,t,i,r,s,o){const a=this.currentPoint.x,l=this.currentPoint.y;return this.absarc(e+a,t+l,i,r,s,o),this}absarc(e,t,i,r,s,o){return this.absellipse(e,t,i,i,r,s,o),this}ellipse(e,t,i,r,s,o,a,l){const u=this.currentPoint.x,h=this.currentPoint.y;return this.absellipse(e+u,t+h,i,r,s,o,a,l),this}absellipse(e,t,i,r,s,o,a,l){const u=new Ug(e,t,i,r,s,o,a,l);if(this.curves.length>0){const d=u.getPoint(0);d.equals(this.currentPoint)||this.lineTo(d.x,d.y)}this.curves.push(u);const h=u.getPoint(1);return this.currentPoint.copy(h),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 Bh extends gt{constructor(e=[new ge(0,-.5),new ge(.5,0),new ge(0,.5)],t=12,i=0,r=Math.PI*2){super(),this.type="LatheGeometry",this.parameters={points:e,segments:t,phiStart:i,phiLength:r},t=Math.floor(t),r=gn(r,0,Math.PI*2);const s=[],o=[],a=[],l=[],u=[],h=1/t,d=new F,p=new ge,m=new F,y=new F,M=new F;let _=0,g=0;for(let x=0;x<=e.length-1;x++)switch(x){case 0:_=e[x+1].x-e[x].x,g=e[x+1].y-e[x].y,m.x=g*1,m.y=-_,m.z=g*0,M.copy(m),m.normalize(),l.push(m.x,m.y,m.z);break;case e.length-1:l.push(M.x,M.y,M.z);break;default:_=e[x+1].x-e[x].x,g=e[x+1].y-e[x].y,m.x=g*1,m.y=-_,m.z=g*0,y.copy(m),m.x+=M.x,m.y+=M.y,m.z+=M.z,m.normalize(),l.push(m.x,m.y,m.z),M.copy(y)}for(let x=0;x<=t;x++){const S=i+x*h*r,E=Math.sin(S),C=Math.cos(S);for(let b=0;b<=e.length-1;b++){d.x=e[b].x*E,d.y=e[b].y,d.z=e[b].x*C,o.push(d.x,d.y,d.z),p.x=x/t,p.y=b/(e.length-1),a.push(p.x,p.y);const P=l[3*b+0]*E,B=l[3*b+1],R=l[3*b+0]*C;u.push(P,B,R)}}for(let x=0;x<t;x++)for(let S=0;S<e.length-1;S++){const E=S+x*e.length,C=E,b=E+e.length,P=E+e.length+1,B=E+1;s.push(C,b,B),s.push(P,B,b)}this.setIndex(s),this.setAttribute("position",new Ye(o,3)),this.setAttribute("uv",new Ye(a,2)),this.setAttribute("normal",new Ye(u,3))}copy(e){return super.copy(e),this.parameters=Object.assign({},e.parameters),this}static fromJSON(e){return new Bh(e.points,e.segments,e.phiStart,e.phiLength)}}class Hg extends Bh{constructor(e=1,t=1,i=4,r=8){const s=new oh;s.absarc(0,-t/2,e,Math.PI*1.5,0),s.absarc(0,t/2,e,0,Math.PI*.5),super(s.getPoints(i),r),this.type="CapsuleGeometry",this.parameters={radius:e,height:t,capSegments:i,radialSegments:r}}static fromJSON(e){return new Hg(e.radius,e.length,e.capSegments,e.radialSegments)}}class zg extends gt{constructor(e=1,t=32,i=0,r=Math.PI*2){super(),this.type="CircleGeometry",this.parameters={radius:e,segments:t,thetaStart:i,thetaLength:r},t=Math.max(3,t);const s=[],o=[],a=[],l=[],u=new F,h=new ge;o.push(0,0,0),a.push(0,0,1),l.push(.5,.5);for(let d=0,p=3;d<=t;d++,p+=3){const m=i+d/t*r;u.x=e*Math.cos(m),u.y=e*Math.sin(m),o.push(u.x,u.y,u.z),a.push(0,0,1),h.x=(o[p]/e+1)/2,h.y=(o[p+1]/e+1)/2,l.push(h.x,h.y)}for(let d=1;d<=t;d++)s.push(d,d+1,0);this.setIndex(s),this.setAttribute("position",new Ye(o,3)),this.setAttribute("normal",new Ye(a,3)),this.setAttribute("uv",new Ye(l,2))}copy(e){return super.copy(e),this.parameters=Object.assign({},e.parameters),this}static fromJSON(e){return new zg(e.radius,e.segments,e.thetaStart,e.thetaLength)}}class hu extends gt{constructor(e=1,t=1,i=1,r=32,s=1,o=!1,a=0,l=Math.PI*2){super(),this.type="CylinderGeometry",this.parameters={radiusTop:e,radiusBottom:t,height:i,radialSegments:r,heightSegments:s,openEnded:o,thetaStart:a,thetaLength:l};const u=this;r=Math.floor(r),s=Math.floor(s);const h=[],d=[],p=[],m=[];let y=0;const M=[],_=i/2;let g=0;x(),o===!1&&(e>0&&S(!0),t>0&&S(!1)),this.setIndex(h),this.setAttribute("position",new Ye(d,3)),this.setAttribute("normal",new Ye(p,3)),this.setAttribute("uv",new Ye(m,2));function x(){const E=new F,C=new F;let b=0;const P=(t-e)/i;for(let B=0;B<=s;B++){const R=[],L=B/s,z=L*(t-e)+e;for(let $=0;$<=r;$++){const X=$/r,Q=X*l+a,Y=Math.sin(Q),ne=Math.cos(Q);C.x=z*Y,C.y=-L*i+_,C.z=z*ne,d.push(C.x,C.y,C.z),E.set(Y,P,ne).normalize(),p.push(E.x,E.y,E.z),m.push(X,1-L),R.push(y++)}M.push(R)}for(let B=0;B<r;B++)for(let R=0;R<s;R++){const L=M[R][B],z=M[R+1][B],$=M[R+1][B+1],X=M[R][B+1];h.push(L,z,X),h.push(z,$,X),b+=6}u.addGroup(g,b,0),g+=b}function S(E){const C=y,b=new ge,P=new F;let B=0;const R=E===!0?e:t,L=E===!0?1:-1;for(let $=1;$<=r;$++)d.push(0,_*L,0),p.push(0,L,0),m.push(.5,.5),y++;const z=y;for(let $=0;$<=r;$++){const Q=$/r*l+a,Y=Math.cos(Q),ne=Math.sin(Q);P.x=R*ne,P.y=_*L,P.z=R*Y,d.push(P.x,P.y,P.z),p.push(0,L,0),b.x=Y*.5+.5,b.y=ne*.5*L+.5,m.push(b.x,b.y),y++}for(let $=0;$<r;$++){const X=C+$,Q=z+$;E===!0?h.push(Q,Q+1,X):h.push(Q+1,Q,X),B+=3}u.addGroup(g,B,E===!0?1:2),g+=B}}copy(e){return super.copy(e),this.parameters=Object.assign({},e.parameters),this}static fromJSON(e){return new hu(e.radiusTop,e.radiusBottom,e.height,e.radialSegments,e.heightSegments,e.openEnded,e.thetaStart,e.thetaLength)}}class Gg extends hu{constructor(e=1,t=1,i=32,r=1,s=!1,o=0,a=Math.PI*2){super(0,e,t,i,r,s,o,a),this.type="ConeGeometry",this.parameters={radius:e,height:t,radialSegments:i,heightSegments:r,openEnded:s,thetaStart:o,thetaLength:a}}static fromJSON(e){return new Gg(e.radius,e.height,e.radialSegments,e.heightSegments,e.openEnded,e.thetaStart,e.thetaLength)}}class ia extends gt{constructor(e=[],t=[],i=1,r=0){super(),this.type="PolyhedronGeometry",this.parameters={vertices:e,indices:t,radius:i,detail:r};const s=[],o=[];a(r),u(i),h(),this.setAttribute("position",new Ye(s,3)),this.setAttribute("normal",new Ye(s.slice(),3)),this.setAttribute("uv",new Ye(o,2)),r===0?this.computeVertexNormals():this.normalizeNormals();function a(x){const S=new F,E=new F,C=new F;for(let b=0;b<t.length;b+=3)m(t[b+0],S),m(t[b+1],E),m(t[b+2],C),l(S,E,C,x)}function l(x,S,E,C){const b=C+1,P=[];for(let B=0;B<=b;B++){P[B]=[];const R=x.clone().lerp(E,B/b),L=S.clone().lerp(E,B/b),z=b-B;for(let $=0;$<=z;$++)$===0&&B===b?P[B][$]=R:P[B][$]=R.clone().lerp(L,$/z)}for(let B=0;B<b;B++)for(let R=0;R<2*(b-B)-1;R++){const L=Math.floor(R/2);R%2===0?(p(P[B][L+1]),p(P[B+1][L]),p(P[B][L])):(p(P[B][L+1]),p(P[B+1][L+1]),p(P[B+1][L]))}}function u(x){const S=new F;for(let E=0;E<s.length;E+=3)S.x=s[E+0],S.y=s[E+1],S.z=s[E+2],S.normalize().multiplyScalar(x),s[E+0]=S.x,s[E+1]=S.y,s[E+2]=S.z}function h(){const x=new F;for(let S=0;S<s.length;S+=3){x.x=s[S+0],x.y=s[S+1],x.z=s[S+2];const E=_(x)/2/Math.PI+.5,C=g(x)/Math.PI+.5;o.push(E,1-C)}y(),d()}function d(){for(let x=0;x<o.length;x+=6){const S=o[x+0],E=o[x+2],C=o[x+4],b=Math.max(S,E,C),P=Math.min(S,E,C);b>.9&&P<.1&&(S<.2&&(o[x+0]+=1),E<.2&&(o[x+2]+=1),C<.2&&(o[x+4]+=1))}}function p(x){s.push(x.x,x.y,x.z)}function m(x,S){const E=x*3;S.x=e[E+0],S.y=e[E+1],S.z=e[E+2]}function y(){const x=new F,S=new F,E=new F,C=new F,b=new ge,P=new ge,B=new ge;for(let R=0,L=0;R<s.length;R+=9,L+=6){x.set(s[R+0],s[R+1],s[R+2]),S.set(s[R+3],s[R+4],s[R+5]),E.set(s[R+6],s[R+7],s[R+8]),b.set(o[L+0],o[L+1]),P.set(o[L+2],o[L+3]),B.set(o[L+4],o[L+5]),C.copy(x).add(S).add(E).divideScalar(3);const z=_(C);M(b,L+0,x,z),M(P,L+2,S,z),M(B,L+4,E,z)}}function M(x,S,E,C){C<0&&x.x===1&&(o[S]=x.x-1),E.x===0&&E.z===0&&(o[S]=C/2/Math.PI+.5)}function _(x){return Math.atan2(x.z,-x.x)}function g(x){return Math.atan2(-x.y,Math.sqrt(x.x*x.x+x.z*x.z))}}copy(e){return super.copy(e),this.parameters=Object.assign({},e.parameters),this}static fromJSON(e){return new ia(e.vertices,e.indices,e.radius,e.details)}}class Vg extends ia{constructor(e=1,t=0){const i=(1+Math.sqrt(5))/2,r=1/i,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,-i,0,-r,i,0,r,-i,0,r,i,-r,-i,0,-r,i,0,r,-i,0,r,i,0,-i,0,-r,i,0,-r,-i,0,r,i,0,r],o=[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,o,e,t),this.type="DodecahedronGeometry",this.parameters={radius:e,detail:t}}static fromJSON(e){return new Vg(e.radius,e.detail)}}const Ip=new F,Dp=new F,yy=new F,Fp=new wi;class C2 extends gt{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(Qa*t),o=e.getIndex(),a=e.getAttribute("position"),l=o?o.count:a.count,u=[0,0,0],h=["a","b","c"],d=new Array(3),p={},m=[];for(let y=0;y<l;y+=3){o?(u[0]=o.getX(y),u[1]=o.getX(y+1),u[2]=o.getX(y+2)):(u[0]=y,u[1]=y+1,u[2]=y+2);const{a:M,b:_,c:g}=Fp;if(M.fromBufferAttribute(a,u[0]),_.fromBufferAttribute(a,u[1]),g.fromBufferAttribute(a,u[2]),Fp.getNormal(yy),d[0]=`${Math.round(M.x*r)},${Math.round(M.y*r)},${Math.round(M.z*r)}`,d[1]=`${Math.round(_.x*r)},${Math.round(_.y*r)},${Math.round(_.z*r)}`,d[2]=`${Math.round(g.x*r)},${Math.round(g.y*r)},${Math.round(g.z*r)}`,!(d[0]===d[1]||d[1]===d[2]||d[2]===d[0]))for(let x=0;x<3;x++){const S=(x+1)%3,E=d[x],C=d[S],b=Fp[h[x]],P=Fp[h[S]],B=`${E}_${C}`,R=`${C}_${E}`;R in p&&p[R]?(yy.dot(p[R].normal)<=s&&(m.push(b.x,b.y,b.z),m.push(P.x,P.y,P.z)),p[R]=null):B in p||(p[B]={index0:u[x],index1:u[S],normal:yy.clone()})}}for(const y in p)if(p[y]){const{index0:M,index1:_}=p[y];Ip.fromBufferAttribute(a,M),Dp.fromBufferAttribute(a,_),m.push(Ip.x,Ip.y,Ip.z),m.push(Dp.x,Dp.y,Dp.z)}this.setAttribute("position",new Ye(m,3))}}copy(e){return super.copy(e),this.parameters=Object.assign({},e.parameters),this}}class qa extends oh{constructor(e){super(e),this.uuid=Ji(),this.type="Shape",this.holes=[]}getPointsHoles(e){const t=[];for(let i=0,r=this.holes.length;i<r;i++)t[i]=this.holes[i].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,i=e.holes.length;t<i;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,i=this.holes.length;t<i;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,i=e.holes.length;t<i;t++){const r=e.holes[t];this.holes.push(new oh().fromJSON(r))}return this}}const v4={triangulate:function(n,e,t=2){const i=e&&e.length,r=i?e[0]*t:n.length;let s=b2(n,0,r,t,!0);const o=[];if(!s||s.next===s.prev)return o;let a,l,u,h,d,p,m;if(i&&(s=S4(n,e,s,t)),n.length>80*t){a=u=n[0],l=h=n[1];for(let y=t;y<r;y+=t)d=n[y],p=n[y+1],d<a&&(a=d),p<l&&(l=p),d>u&&(u=d),p>h&&(h=p);m=Math.max(u-a,h-l),m=m!==0?32767/m:0}return ah(s,o,t,a,l,m,0),o}};function b2(n,e,t,i,r){let s,o;if(r===I4(n,e,t,i)>0)for(s=e;s<t;s+=i)o=ST(s,n[s],n[s+1],o);else for(s=t-i;s>=e;s-=i)o=ST(s,n[s],n[s+1],o);return o&&Wg(o,o.next)&&(ch(o),o=o.next),o}function ol(n,e){if(!n)return n;e||(e=n);let t=n,i;do if(i=!1,!t.steiner&&(Wg(t,t.next)||sn(t.prev,t,t.next)===0)){if(ch(t),t=e=t.prev,t===t.next)break;i=!0}else t=t.next;while(i||t!==e);return e}function ah(n,e,t,i,r,s,o){if(!n)return;!o&&s&&C4(n,i,r,s);let a=n,l,u;for(;n.prev!==n.next;){if(l=n.prev,u=n.next,s?x4(n,i,r,s):y4(n)){e.push(l.i/t|0),e.push(n.i/t|0),e.push(u.i/t|0),ch(n),n=u.next,a=u.next;continue}if(n=u,n===a){o?o===1?(n=_4(ol(n),e,t),ah(n,e,t,i,r,s,2)):o===2&&A4(n,e,t,i,r,s):ah(ol(n),e,t,i,r,s,1);break}}}function y4(n){const e=n.prev,t=n,i=n.next;if(sn(e,t,i)>=0)return!1;const r=e.x,s=t.x,o=i.x,a=e.y,l=t.y,u=i.y,h=r<s?r<o?r:o:s<o?s:o,d=a<l?a<u?a:u:l<u?l:u,p=r>s?r>o?r:o:s>o?s:o,m=a>l?a>u?a:u:l>u?l:u;let y=i.next;for(;y!==e;){if(y.x>=h&&y.x<=p&&y.y>=d&&y.y<=m&&yc(r,a,s,l,o,u,y.x,y.y)&&sn(y.prev,y,y.next)>=0)return!1;y=y.next}return!0}function x4(n,e,t,i){const r=n.prev,s=n,o=n.next;if(sn(r,s,o)>=0)return!1;const a=r.x,l=s.x,u=o.x,h=r.y,d=s.y,p=o.y,m=a<l?a<u?a:u:l<u?l:u,y=h<d?h<p?h:p:d<p?d:p,M=a>l?a>u?a:u:l>u?l:u,_=h>d?h>p?h:p:d>p?d:p,g=L_(m,y,e,t,i),x=L_(M,_,e,t,i);let S=n.prevZ,E=n.nextZ;for(;S&&S.z>=g&&E&&E.z<=x;){if(S.x>=m&&S.x<=M&&S.y>=y&&S.y<=_&&S!==r&&S!==o&&yc(a,h,l,d,u,p,S.x,S.y)&&sn(S.prev,S,S.next)>=0||(S=S.prevZ,E.x>=m&&E.x<=M&&E.y>=y&&E.y<=_&&E!==r&&E!==o&&yc(a,h,l,d,u,p,E.x,E.y)&&sn(E.prev,E,E.next)>=0))return!1;E=E.nextZ}for(;S&&S.z>=g;){if(S.x>=m&&S.x<=M&&S.y>=y&&S.y<=_&&S!==r&&S!==o&&yc(a,h,l,d,u,p,S.x,S.y)&&sn(S.prev,S,S.next)>=0)return!1;S=S.prevZ}for(;E&&E.z<=x;){if(E.x>=m&&E.x<=M&&E.y>=y&&E.y<=_&&E!==r&&E!==o&&yc(a,h,l,d,u,p,E.x,E.y)&&sn(E.prev,E,E.next)>=0)return!1;E=E.nextZ}return!0}function _4(n,e,t){let i=n;do{const r=i.prev,s=i.next.next;!Wg(r,s)&&R2(r,i,i.next,s)&&lh(r,s)&&lh(s,r)&&(e.push(r.i/t|0),e.push(i.i/t|0),e.push(s.i/t|0),ch(i),ch(i.next),i=n=s),i=i.next}while(i!==n);return ol(i)}function A4(n,e,t,i,r,s){let o=n;do{let a=o.next.next;for(;a!==o.prev;){if(o.i!==a.i&&P4(o,a)){let l=P2(o,a);o=ol(o,o.next),l=ol(l,l.next),ah(o,e,t,i,r,s,0),ah(l,e,t,i,r,s,0);return}a=a.next}o=o.next}while(o!==n)}function S4(n,e,t,i){const r=[];let s,o,a,l,u;for(s=0,o=e.length;s<o;s++)a=e[s]*i,l=s<o-1?e[s+1]*i:n.length,u=b2(n,a,l,i,!1),u===u.next&&(u.steiner=!0),r.push(R4(u));for(r.sort(M4),s=0;s<r.length;s++)t=E4(r[s],t);return t}function M4(n,e){return n.x-e.x}function E4(n,e){const t=w4(n,e);if(!t)return e;const i=P2(t,n);return ol(i,i.next),ol(t,t.next)}function w4(n,e){let t=e,i=-1/0,r;const s=n.x,o=n.y;do{if(o<=t.y&&o>=t.next.y&&t.next.y!==t.y){const p=t.x+(o-t.y)*(t.next.x-t.x)/(t.next.y-t.y);if(p<=s&&p>i&&(i=p,r=t.x<t.next.x?t:t.next,p===s))return r}t=t.next}while(t!==e);if(!r)return null;const a=r,l=r.x,u=r.y;let h=1/0,d;t=r;do s>=t.x&&t.x>=l&&s!==t.x&&yc(o<u?s:i,o,l,u,o<u?i:s,o,t.x,t.y)&&(d=Math.abs(o-t.y)/(s-t.x),lh(t,n)&&(d<h||d===h&&(t.x>r.x||t.x===r.x&&T4(r,t)))&&(r=t,h=d)),t=t.next;while(t!==a);return r}function T4(n,e){return sn(n.prev,n,e.prev)<0&&sn(e.next,n,n.next)<0}function C4(n,e,t,i){let r=n;do r.z===0&&(r.z=L_(r.x,r.y,e,t,i)),r.prevZ=r.prev,r.nextZ=r.next,r=r.next;while(r!==n);r.prevZ.nextZ=null,r.prevZ=null,b4(r)}function b4(n){let e,t,i,r,s,o,a,l,u=1;do{for(t=n,n=null,s=null,o=0;t;){for(o++,i=t,a=0,e=0;e<u&&(a++,i=i.nextZ,!!i);e++);for(l=u;a>0||l>0&&i;)a!==0&&(l===0||!i||t.z<=i.z)?(r=t,t=t.nextZ,a--):(r=i,i=i.nextZ,l--),s?s.nextZ=r:n=r,r.prevZ=s,s=r;t=i}s.nextZ=null,u*=2}while(o>1);return n}function L_(n,e,t,i,r){return n=(n-t)*r|0,e=(e-i)*r|0,n=(n|n<<8)&16711935,n=(n|n<<4)&252645135,n=(n|n<<2)&858993459,n=(n|n<<1)&1431655765,e=(e|e<<8)&16711935,e=(e|e<<4)&252645135,e=(e|e<<2)&858993459,e=(e|e<<1)&1431655765,n|e<<1}function R4(n){let e=n,t=n;do(e.x<t.x||e.x===t.x&&e.y<t.y)&&(t=e),e=e.next;while(e!==n);return t}function yc(n,e,t,i,r,s,o,a){return(r-o)*(e-a)>=(n-o)*(s-a)&&(n-o)*(i-a)>=(t-o)*(e-a)&&(t-o)*(s-a)>=(r-o)*(i-a)}function P4(n,e){return n.next.i!==e.i&&n.prev.i!==e.i&&!B4(n,e)&&(lh(n,e)&&lh(e,n)&&L4(n,e)&&(sn(n.prev,n,e.prev)||sn(n,e.prev,e))||Wg(n,e)&&sn(n.prev,n,n.next)>0&&sn(e.prev,e,e.next)>0)}function sn(n,e,t){return(e.y-n.y)*(t.x-e.x)-(e.x-n.x)*(t.y-e.y)}function Wg(n,e){return n.x===e.x&&n.y===e.y}function R2(n,e,t,i){const r=Op(sn(n,e,t)),s=Op(sn(n,e,i)),o=Op(sn(t,i,n)),a=Op(sn(t,i,e));return!!(r!==s&&o!==a||r===0&&Np(n,t,e)||s===0&&Np(n,i,e)||o===0&&Np(t,n,i)||a===0&&Np(t,e,i))}function Np(n,e,t){return e.x<=Math.max(n.x,t.x)&&e.x>=Math.min(n.x,t.x)&&e.y<=Math.max(n.y,t.y)&&e.y>=Math.min(n.y,t.y)}function Op(n){return n>0?1:n<0?-1:0}function B4(n,e){let t=n;do{if(t.i!==n.i&&t.next.i!==n.i&&t.i!==e.i&&t.next.i!==e.i&&R2(t,t.next,n,e))return!0;t=t.next}while(t!==n);return!1}function lh(n,e){return sn(n.prev,n,n.next)<0?sn(n,e,n.next)>=0&&sn(n,n.prev,e)>=0:sn(n,e,n.prev)<0||sn(n,n.next,e)<0}function L4(n,e){let t=n,i=!1;const r=(n.x+e.x)/2,s=(n.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&&(i=!i),t=t.next;while(t!==n);return i}function P2(n,e){const t=new I_(n.i,n.x,n.y),i=new I_(e.i,e.x,e.y),r=n.next,s=e.prev;return n.next=e,e.prev=n,t.next=r,r.prev=t,i.next=t,t.prev=i,s.next=i,i.prev=s,i}function ST(n,e,t,i){const r=new I_(n,e,t);return i?(r.next=i.next,r.prev=i,i.next.prev=r,i.next=r):(r.prev=r,r.next=r),r}function ch(n){n.next.prev=n.prev,n.prev.next=n.next,n.prevZ&&(n.prevZ.nextZ=n.nextZ),n.nextZ&&(n.nextZ.prevZ=n.prevZ)}function I_(n,e,t){this.i=n,this.x=e,this.y=t,this.prev=null,this.next=null,this.z=0,this.prevZ=null,this.nextZ=null,this.steiner=!1}function I4(n,e,t,i){let r=0;for(let s=e,o=t-i;s<t;s+=i)r+=(n[o]-n[s])*(n[s+1]+n[o+1]),o=s;return r}class ds{static area(e){const t=e.length;let i=0;for(let r=t-1,s=0;s<t;r=s++)i+=e[r].x*e[s].y-e[s].x*e[r].y;return i*.5}static isClockWise(e){return ds.area(e)<0}static triangulateShape(e,t){const i=[],r=[],s=[];MT(e),ET(i,e);let o=e.length;t.forEach(MT);for(let l=0;l<t.length;l++)r.push(o),o+=t[l].length,ET(i,t[l]);const a=v4.triangulate(i,r);for(let l=0;l<a.length;l+=3)s.push(a.slice(l,l+3));return s}}function MT(n){const e=n.length;e>2&&n[e-1].equals(n[0])&&n.pop()}function ET(n,e){for(let t=0;t<e.length;t++)n.push(e[t].x),n.push(e[t].y)}class jg extends gt{constructor(e=new qa([new ge(.5,.5),new ge(-.5,.5),new ge(-.5,-.5),new ge(.5,-.5)]),t={}){super(),this.type="ExtrudeGeometry",this.parameters={shapes:e,options:t},e=Array.isArray(e)?e:[e];const i=this,r=[],s=[];for(let a=0,l=e.length;a<l;a++){const u=e[a];o(u)}this.setAttribute("position",new Ye(r,3)),this.setAttribute("uv",new Ye(s,2)),this.computeVertexNormals();function o(a){const l=[],u=t.curveSegments!==void 0?t.curveSegments:12,h=t.steps!==void 0?t.steps:1,d=t.depth!==void 0?t.depth:1;let p=t.bevelEnabled!==void 0?t.bevelEnabled:!0,m=t.bevelThickness!==void 0?t.bevelThickness:.2,y=t.bevelSize!==void 0?t.bevelSize:m-.1,M=t.bevelOffset!==void 0?t.bevelOffset:0,_=t.bevelSegments!==void 0?t.bevelSegments:3;const g=t.extrudePath,x=t.UVGenerator!==void 0?t.UVGenerator:D4;let S,E=!1,C,b,P,B;g&&(S=g.getSpacedPoints(h),E=!0,p=!1,C=g.computeFrenetFrames(h,!1),b=new F,P=new F,B=new F),p||(_=0,m=0,y=0,M=0);const R=a.extractPoints(u);let L=R.shape;const z=R.holes;if(!ds.isClockWise(L)){L=L.reverse();for(let G=0,ye=z.length;G<ye;G++){const pe=z[G];ds.isClockWise(pe)&&(z[G]=pe.reverse())}}const X=ds.triangulateShape(L,z),Q=L;for(let G=0,ye=z.length;G<ye;G++){const pe=z[G];L=L.concat(pe)}function Y(G,ye,pe){return ye||console.error("THREE.ExtrudeGeometry: vec does not exist"),G.clone().addScaledVector(ye,pe)}const ne=L.length,ee=X.length;function I(G,ye,pe){let Me,xe,Ve;const Ue=G.x-ye.x,Ge=G.y-ye.y,qe=pe.x-G.x,vt=pe.y-G.y,Ut=Ue*Ue+Ge*Ge,k=Ue*vt-Ge*qe;if(Math.abs(k)>Number.EPSILON){const D=Math.sqrt(Ut),le=Math.sqrt(qe*qe+vt*vt),we=ye.x-Ge/D,_e=ye.y+Ue/D,De=pe.x-vt/le,Ke=pe.y+qe/le,Le=((De-we)*vt-(Ke-_e)*qe)/(Ue*vt-Ge*qe);Me=we+Ue*Le-G.x,xe=_e+Ge*Le-G.y;const he=Me*Me+xe*xe;if(he<=2)return new ge(Me,xe);Ve=Math.sqrt(he/2)}else{let D=!1;Ue>Number.EPSILON?qe>Number.EPSILON&&(D=!0):Ue<-Number.EPSILON?qe<-Number.EPSILON&&(D=!0):Math.sign(Ge)===Math.sign(vt)&&(D=!0),D?(Me=-Ge,xe=Ue,Ve=Math.sqrt(Ut)):(Me=Ue,xe=Ge,Ve=Math.sqrt(Ut/2))}return new ge(Me/Ve,xe/Ve)}const V=[];for(let G=0,ye=Q.length,pe=ye-1,Me=G+1;G<ye;G++,pe++,Me++)pe===ye&&(pe=0),Me===ye&&(Me=0),V[G]=I(Q[G],Q[pe],Q[Me]);const H=[];let U,W=V.concat();for(let G=0,ye=z.length;G<ye;G++){const pe=z[G];U=[];for(let Me=0,xe=pe.length,Ve=xe-1,Ue=Me+1;Me<xe;Me++,Ve++,Ue++)Ve===xe&&(Ve=0),Ue===xe&&(Ue=0),U[Me]=I(pe[Me],pe[Ve],pe[Ue]);H.push(U),W=W.concat(U)}for(let G=0;G<_;G++){const ye=G/_,pe=m*Math.cos(ye*Math.PI/2),Me=y*Math.sin(ye*Math.PI/2)+M;for(let xe=0,Ve=Q.length;xe<Ve;xe++){const Ue=Y(Q[xe],V[xe],Me);Ne(Ue.x,Ue.y,-pe)}for(let xe=0,Ve=z.length;xe<Ve;xe++){const Ue=z[xe];U=H[xe];for(let Ge=0,qe=Ue.length;Ge<qe;Ge++){const vt=Y(Ue[Ge],U[Ge],Me);Ne(vt.x,vt.y,-pe)}}}const ve=y+M;for(let G=0;G<ne;G++){const ye=p?Y(L[G],W[G],ve):L[G];E?(P.copy(C.normals[0]).multiplyScalar(ye.x),b.copy(C.binormals[0]).multiplyScalar(ye.y),B.copy(S[0]).add(P).add(b),Ne(B.x,B.y,B.z)):Ne(ye.x,ye.y,0)}for(let G=1;G<=h;G++)for(let ye=0;ye<ne;ye++){const pe=p?Y(L[ye],W[ye],ve):L[ye];E?(P.copy(C.normals[G]).multiplyScalar(pe.x),b.copy(C.binormals[G]).multiplyScalar(pe.y),B.copy(S[G]).add(P).add(b),Ne(B.x,B.y,B.z)):Ne(pe.x,pe.y,d/h*G)}for(let G=_-1;G>=0;G--){const ye=G/_,pe=m*Math.cos(ye*Math.PI/2),Me=y*Math.sin(ye*Math.PI/2)+M;for(let xe=0,Ve=Q.length;xe<Ve;xe++){const Ue=Y(Q[xe],V[xe],Me);Ne(Ue.x,Ue.y,d+pe)}for(let xe=0,Ve=z.length;xe<Ve;xe++){const Ue=z[xe];U=H[xe];for(let Ge=0,qe=Ue.length;Ge<qe;Ge++){const vt=Y(Ue[Ge],U[Ge],Me);E?Ne(vt.x,vt.y+S[h-1].y,S[h-1].x+pe):Ne(vt.x,vt.y,d+pe)}}}ue(),Ae();function ue(){const G=r.length/3;if(p){let ye=0,pe=ne*ye;for(let Me=0;Me<ee;Me++){const xe=X[Me];We(xe[2]+pe,xe[1]+pe,xe[0]+pe)}ye=h+_*2,pe=ne*ye;for(let Me=0;Me<ee;Me++){const xe=X[Me];We(xe[0]+pe,xe[1]+pe,xe[2]+pe)}}else{for(let ye=0;ye<ee;ye++){const pe=X[ye];We(pe[2],pe[1],pe[0])}for(let ye=0;ye<ee;ye++){const pe=X[ye];We(pe[0]+ne*h,pe[1]+ne*h,pe[2]+ne*h)}}i.addGroup(G,r.length/3-G,0)}function Ae(){const G=r.length/3;let ye=0;Ee(Q,ye),ye+=Q.length;for(let pe=0,Me=z.length;pe<Me;pe++){const xe=z[pe];Ee(xe,ye),ye+=xe.length}i.addGroup(G,r.length/3-G,1)}function Ee(G,ye){let pe=G.length;for(;--pe>=0;){const Me=pe;let xe=pe-1;xe<0&&(xe=G.length-1);for(let Ve=0,Ue=h+_*2;Ve<Ue;Ve++){const Ge=ne*Ve,qe=ne*(Ve+1),vt=ye+Me+Ge,Ut=ye+xe+Ge,k=ye+xe+qe,D=ye+Me+qe;ct(vt,Ut,k,D)}}}function Ne(G,ye,pe){l.push(G),l.push(ye),l.push(pe)}function We(G,ye,pe){tt(G),tt(ye),tt(pe);const Me=r.length/3,xe=x.generateTopUV(i,r,Me-3,Me-2,Me-1);Se(xe[0]),Se(xe[1]),Se(xe[2])}function ct(G,ye,pe,Me){tt(G),tt(ye),tt(Me),tt(ye),tt(pe),tt(Me);const xe=r.length/3,Ve=x.generateSideWallUV(i,r,xe-6,xe-3,xe-2,xe-1);Se(Ve[0]),Se(Ve[1]),Se(Ve[3]),Se(Ve[1]),Se(Ve[2]),Se(Ve[3])}function tt(G){r.push(l[G*3+0]),r.push(l[G*3+1]),r.push(l[G*3+2])}function Se(G){s.push(G.x),s.push(G.y)}}}copy(e){return super.copy(e),this.parameters=Object.assign({},e.parameters),this}toJSON(){const e=super.toJSON(),t=this.parameters.shapes,i=this.parameters.options;return F4(t,i,e)}static fromJSON(e,t){const i=[];for(let s=0,o=e.shapes.length;s<o;s++){const a=t[e.shapes[s]];i.push(a)}const r=e.options.extrudePath;return r!==void 0&&(e.options.extrudePath=new kS[r.type]().fromJSON(r)),new jg(i,e.options)}}const D4={generateTopUV:function(n,e,t,i,r){const s=e[t*3],o=e[t*3+1],a=e[i*3],l=e[i*3+1],u=e[r*3],h=e[r*3+1];return[new ge(s,o),new ge(a,l),new ge(u,h)]},generateSideWallUV:function(n,e,t,i,r,s){const o=e[t*3],a=e[t*3+1],l=e[t*3+2],u=e[i*3],h=e[i*3+1],d=e[i*3+2],p=e[r*3],m=e[r*3+1],y=e[r*3+2],M=e[s*3],_=e[s*3+1],g=e[s*3+2];return Math.abs(a-h)<Math.abs(o-u)?[new ge(o,1-l),new ge(u,1-d),new ge(p,1-y),new ge(M,1-g)]:[new ge(a,1-l),new ge(h,1-d),new ge(m,1-y),new ge(_,1-g)]}};function F4(n,e,t){if(t.shapes=[],Array.isArray(n))for(let i=0,r=n.length;i<r;i++){const s=n[i];t.shapes.push(s.uuid)}else t.shapes.push(n.uuid);return t.options=Object.assign({},e),e.extrudePath!==void 0&&(t.options.extrudePath=e.extrudePath.toJSON()),t}class Xg extends ia{constructor(e=1,t=0){const i=(1+Math.sqrt(5))/2,r=[-1,i,0,1,i,0,-1,-i,0,1,-i,0,0,-1,i,0,1,i,0,-1,-i,0,1,-i,i,0,-1,i,0,1,-i,0,-1,-i,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 Xg(e.radius,e.detail)}}class Lh extends ia{constructor(e=1,t=0){const i=[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(i,r,e,t),this.type="OctahedronGeometry",this.parameters={radius:e,detail:t}}static fromJSON(e){return new Lh(e.radius,e.detail)}}class Jg extends gt{constructor(e=.5,t=1,i=32,r=1,s=0,o=Math.PI*2){super(),this.type="RingGeometry",this.parameters={innerRadius:e,outerRadius:t,thetaSegments:i,phiSegments:r,thetaStart:s,thetaLength:o},i=Math.max(3,i),r=Math.max(1,r);const a=[],l=[],u=[],h=[];let d=e;const p=(t-e)/r,m=new F,y=new ge;for(let M=0;M<=r;M++){for(let _=0;_<=i;_++){const g=s+_/i*o;m.x=d*Math.cos(g),m.y=d*Math.sin(g),l.push(m.x,m.y,m.z),u.push(0,0,1),y.x=(m.x/t+1)/2,y.y=(m.y/t+1)/2,h.push(y.x,y.y)}d+=p}for(let M=0;M<r;M++){const _=M*(i+1);for(let g=0;g<i;g++){const x=g+_,S=x,E=x+i+1,C=x+i+2,b=x+1;a.push(S,E,b),a.push(E,C,b)}}this.setIndex(a),this.setAttribute("position",new Ye(l,3)),this.setAttribute("normal",new Ye(u,3)),this.setAttribute("uv",new Ye(h,2))}copy(e){return super.copy(e),this.parameters=Object.assign({},e.parameters),this}static fromJSON(e){return new Jg(e.innerRadius,e.outerRadius,e.thetaSegments,e.phiSegments,e.thetaStart,e.thetaLength)}}class Kg extends gt{constructor(e=new qa([new ge(0,.5),new ge(-.5,-.5),new ge(.5,-.5)]),t=12){super(),this.type="ShapeGeometry",this.parameters={shapes:e,curveSegments:t};const i=[],r=[],s=[],o=[];let a=0,l=0;if(Array.isArray(e)===!1)u(e);else for(let h=0;h<e.length;h++)u(e[h]),this.addGroup(a,l,h),a+=l,l=0;this.setIndex(i),this.setAttribute("position",new Ye(r,3)),this.setAttribute("normal",new Ye(s,3)),this.setAttribute("uv",new Ye(o,2));function u(h){const d=r.length/3,p=h.extractPoints(t);let m=p.shape;const y=p.holes;ds.isClockWise(m)===!1&&(m=m.reverse());for(let _=0,g=y.length;_<g;_++){const x=y[_];ds.isClockWise(x)===!0&&(y[_]=x.reverse())}const M=ds.triangulateShape(m,y);for(let _=0,g=y.length;_<g;_++){const x=y[_];m=m.concat(x)}for(let _=0,g=m.length;_<g;_++){const x=m[_];r.push(x.x,x.y,0),s.push(0,0,1),o.push(x.x,x.y)}for(let _=0,g=M.length;_<g;_++){const x=M[_],S=x[0]+d,E=x[1]+d,C=x[2]+d;i.push(S,E,C),l+=3}}}copy(e){return super.copy(e),this.parameters=Object.assign({},e.parameters),this}toJSON(){const e=super.toJSON(),t=this.parameters.shapes;return N4(t,e)}static fromJSON(e,t){const i=[];for(let r=0,s=e.shapes.length;r<s;r++){const o=t[e.shapes[r]];i.push(o)}return new Kg(i,e.curveSegments)}}function N4(n,e){if(e.shapes=[],Array.isArray(n))for(let t=0,i=n.length;t<i;t++){const r=n[t];e.shapes.push(r.uuid)}else e.shapes.push(n.uuid);return e}class Ih extends gt{constructor(e=1,t=32,i=16,r=0,s=Math.PI*2,o=0,a=Math.PI){super(),this.type="SphereGeometry",this.parameters={radius:e,widthSegments:t,heightSegments:i,phiStart:r,phiLength:s,thetaStart:o,thetaLength:a},t=Math.max(3,Math.floor(t)),i=Math.max(2,Math.floor(i));const l=Math.min(o+a,Math.PI);let u=0;const h=[],d=new F,p=new F,m=[],y=[],M=[],_=[];for(let g=0;g<=i;g++){const x=[],S=g/i;let E=0;g===0&&o===0?E=.5/t:g===i&&l===Math.PI&&(E=-.5/t);for(let C=0;C<=t;C++){const b=C/t;d.x=-e*Math.cos(r+b*s)*Math.sin(o+S*a),d.y=e*Math.cos(o+S*a),d.z=e*Math.sin(r+b*s)*Math.sin(o+S*a),y.push(d.x,d.y,d.z),p.copy(d).normalize(),M.push(p.x,p.y,p.z),_.push(b+E,1-S),x.push(u++)}h.push(x)}for(let g=0;g<i;g++)for(let x=0;x<t;x++){const S=h[g][x+1],E=h[g][x],C=h[g+1][x],b=h[g+1][x+1];(g!==0||o>0)&&m.push(S,E,b),(g!==i-1||l<Math.PI)&&m.push(E,C,b)}this.setIndex(m),this.setAttribute("position",new Ye(y,3)),this.setAttribute("normal",new Ye(M,3)),this.setAttribute("uv",new Ye(_,2))}copy(e){return super.copy(e),this.parameters=Object.assign({},e.parameters),this}static fromJSON(e){return new Ih(e.radius,e.widthSegments,e.heightSegments,e.phiStart,e.phiLength,e.thetaStart,e.thetaLength)}}class Yg extends ia{constructor(e=1,t=0){const i=[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(i,r,e,t),this.type="TetrahedronGeometry",this.parameters={radius:e,detail:t}}static fromJSON(e){return new Yg(e.radius,e.detail)}}class Qg extends gt{constructor(e=1,t=.4,i=12,r=48,s=Math.PI*2){super(),this.type="TorusGeometry",this.parameters={radius:e,tube:t,radialSegments:i,tubularSegments:r,arc:s},i=Math.floor(i),r=Math.floor(r);const o=[],a=[],l=[],u=[],h=new F,d=new F,p=new F;for(let m=0;m<=i;m++)for(let y=0;y<=r;y++){const M=y/r*s,_=m/i*Math.PI*2;d.x=(e+t*Math.cos(_))*Math.cos(M),d.y=(e+t*Math.cos(_))*Math.sin(M),d.z=t*Math.sin(_),a.push(d.x,d.y,d.z),h.x=e*Math.cos(M),h.y=e*Math.sin(M),p.subVectors(d,h).normalize(),l.push(p.x,p.y,p.z),u.push(y/r),u.push(m/i)}for(let m=1;m<=i;m++)for(let y=1;y<=r;y++){const M=(r+1)*m+y-1,_=(r+1)*(m-1)+y-1,g=(r+1)*(m-1)+y,x=(r+1)*m+y;o.push(M,_,x),o.push(_,g,x)}this.setIndex(o),this.setAttribute("position",new Ye(a,3)),this.setAttribute("normal",new Ye(l,3)),this.setAttribute("uv",new Ye(u,2))}copy(e){return super.copy(e),this.parameters=Object.assign({},e.parameters),this}static fromJSON(e){return new Qg(e.radius,e.tube,e.radialSegments,e.tubularSegments,e.arc)}}class Zg extends gt{constructor(e=1,t=.4,i=64,r=8,s=2,o=3){super(),this.type="TorusKnotGeometry",this.parameters={radius:e,tube:t,tubularSegments:i,radialSegments:r,p:s,q:o},i=Math.floor(i),r=Math.floor(r);const a=[],l=[],u=[],h=[],d=new F,p=new F,m=new F,y=new F,M=new F,_=new F,g=new F;for(let S=0;S<=i;++S){const E=S/i*s*Math.PI*2;x(E,s,o,e,m),x(E+.01,s,o,e,y),_.subVectors(y,m),g.addVectors(y,m),M.crossVectors(_,g),g.crossVectors(M,_),M.normalize(),g.normalize();for(let C=0;C<=r;++C){const b=C/r*Math.PI*2,P=-t*Math.cos(b),B=t*Math.sin(b);d.x=m.x+(P*g.x+B*M.x),d.y=m.y+(P*g.y+B*M.y),d.z=m.z+(P*g.z+B*M.z),l.push(d.x,d.y,d.z),p.subVectors(d,m).normalize(),u.push(p.x,p.y,p.z),h.push(S/i),h.push(C/r)}}for(let S=1;S<=i;S++)for(let E=1;E<=r;E++){const C=(r+1)*(S-1)+(E-1),b=(r+1)*S+(E-1),P=(r+1)*S+E,B=(r+1)*(S-1)+E;a.push(C,b,B),a.push(b,P,B)}this.setIndex(a),this.setAttribute("position",new Ye(l,3)),this.setAttribute("normal",new Ye(u,3)),this.setAttribute("uv",new Ye(h,2));function x(S,E,C,b,P){const B=Math.cos(S),R=Math.sin(S),L=C/E*S,z=Math.cos(L);P.x=b*(2+z)*.5*B,P.y=b*(2+z)*R*.5,P.z=b*Math.sin(L)*.5}}copy(e){return super.copy(e),this.parameters=Object.assign({},e.parameters),this}static fromJSON(e){return new Zg(e.radius,e.tube,e.tubularSegments,e.radialSegments,e.p,e.q)}}class qg extends gt{constructor(e=new OS(new F(-1,-1,0),new F(-1,1,0),new F(1,1,0)),t=64,i=1,r=8,s=!1){super(),this.type="TubeGeometry",this.parameters={path:e,tubularSegments:t,radius:i,radialSegments:r,closed:s};const o=e.computeFrenetFrames(t,s);this.tangents=o.tangents,this.normals=o.normals,this.binormals=o.binormals;const a=new F,l=new F,u=new ge;let h=new F;const d=[],p=[],m=[],y=[];M(),this.setIndex(y),this.setAttribute("position",new Ye(d,3)),this.setAttribute("normal",new Ye(p,3)),this.setAttribute("uv",new Ye(m,2));function M(){for(let S=0;S<t;S++)_(S);_(s===!1?t:0),x(),g()}function _(S){h=e.getPointAt(S/t,h);const E=o.normals[S],C=o.binormals[S];for(let b=0;b<=r;b++){const P=b/r*Math.PI*2,B=Math.sin(P),R=-Math.cos(P);l.x=R*E.x+B*C.x,l.y=R*E.y+B*C.y,l.z=R*E.z+B*C.z,l.normalize(),p.push(l.x,l.y,l.z),a.x=h.x+i*l.x,a.y=h.y+i*l.y,a.z=h.z+i*l.z,d.push(a.x,a.y,a.z)}}function g(){for(let S=1;S<=t;S++)for(let E=1;E<=r;E++){const C=(r+1)*(S-1)+(E-1),b=(r+1)*S+(E-1),P=(r+1)*S+E,B=(r+1)*(S-1)+E;y.push(C,b,B),y.push(b,P,B)}}function x(){for(let S=0;S<=t;S++)for(let E=0;E<=r;E++)u.x=S/t,u.y=E/r,m.push(u.x,u.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 qg(new kS[e.path.type]().fromJSON(e.path),e.tubularSegments,e.radius,e.radialSegments,e.closed)}}class B2 extends gt{constructor(e=null){if(super(),this.type="WireframeGeometry",this.parameters={geometry:e},e!==null){const t=[],i=new Set,r=new F,s=new F;if(e.index!==null){const o=e.attributes.position,a=e.index;let l=e.groups;l.length===0&&(l=[{start:0,count:a.count,materialIndex:0}]);for(let u=0,h=l.length;u<h;++u){const d=l[u],p=d.start,m=d.count;for(let y=p,M=p+m;y<M;y+=3)for(let _=0;_<3;_++){const g=a.getX(y+_),x=a.getX(y+(_+1)%3);r.fromBufferAttribute(o,g),s.fromBufferAttribute(o,x),wT(r,s,i)===!0&&(t.push(r.x,r.y,r.z),t.push(s.x,s.y,s.z))}}}else{const o=e.attributes.position;for(let a=0,l=o.count/3;a<l;a++)for(let u=0;u<3;u++){const h=3*a+u,d=3*a+(u+1)%3;r.fromBufferAttribute(o,h),s.fromBufferAttribute(o,d),wT(r,s,i)===!0&&(t.push(r.x,r.y,r.z),t.push(s.x,s.y,s.z))}}this.setAttribute("position",new Ye(t,3))}}copy(e){return super.copy(e),this.parameters=Object.assign({},e.parameters),this}}function wT(n,e,t){const i=`${n.x},${n.y},${n.z}-${e.x},${e.y},${e.z}`,r=`${e.x},${e.y},${e.z}-${n.x},${n.y},${n.z}`;return t.has(i)===!0||t.has(r)===!0?!1:(t.add(i),t.add(r),!0)}var TT=Object.freeze({__proto__:null,BoxGeometry:ul,CapsuleGeometry:Hg,CircleGeometry:zg,ConeGeometry:Gg,CylinderGeometry:hu,DodecahedronGeometry:Vg,EdgesGeometry:C2,ExtrudeGeometry:jg,IcosahedronGeometry:Xg,LatheGeometry:Bh,OctahedronGeometry:Lh,PlaneGeometry:Ch,PolyhedronGeometry:ia,RingGeometry:Jg,ShapeGeometry:Kg,SphereGeometry:Ih,TetrahedronGeometry:Yg,TorusGeometry:Qg,TorusKnotGeometry:Zg,TubeGeometry:qg,WireframeGeometry:B2});class L2 extends Cn{constructor(e){super(),this.isShadowMaterial=!0,this.type="ShadowMaterial",this.color=new Oe(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 I2 extends ys{constructor(e){super(e),this.isRawShaderMaterial=!0,this.type="RawShaderMaterial"}}class Dh extends Cn{constructor(e){super(),this.isMeshStandardMaterial=!0,this.defines={STANDARD:""},this.type="MeshStandardMaterial",this.color=new Oe(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 Oe(0),this.emissiveIntensity=1,this.emissiveMap=null,this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=na,this.normalScale=new ge(1,1),this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.roughnessMap=null,this.metalnessMap=null,this.alphaMap=null,this.envMap=null,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.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 _s extends Dh{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 ge(1,1),this.clearcoatNormalMap=null,this.ior=1.5,Object.defineProperty(this,"reflectivity",{get:function(){return gn(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 Oe(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 Oe(1,1,1),this.specularIntensity=1,this.specularIntensityMap=null,this.specularColor=new Oe(1,1,1),this.specularColorMap=null,this._anisotropy=0,this._clearcoat=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 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.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 D2 extends Cn{constructor(e){super(),this.isMeshPhongMaterial=!0,this.type="MeshPhongMaterial",this.color=new Oe(16777215),this.specular=new Oe(1118481),this.shininess=30,this.map=null,this.lightMap=null,this.lightMapIntensity=1,this.aoMap=null,this.aoMapIntensity=1,this.emissive=new Oe(0),this.emissiveIntensity=1,this.emissiveMap=null,this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=na,this.normalScale=new ge(1,1),this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.specularMap=null,this.alphaMap=null,this.envMap=null,this.combine=Mh,this.reflectivity=1,this.refractionRatio=.98,this.wireframe=!1,this.wireframeLinewidth=1,this.wireframeLinecap="round",this.wireframeLinejoin="round",this.flatShading=!1,this.fog=!0,this.setValues(e)}copy(e){return super.copy(e),this.color.copy(e.color),this.specular.copy(e.specular),this.shininess=e.shininess,this.map=e.map,this.lightMap=e.lightMap,this.lightMapIntensity=e.lightMapIntensity,this.aoMap=e.aoMap,this.aoMapIntensity=e.aoMapIntensity,this.emissive.copy(e.emissive),this.emissiveMap=e.emissiveMap,this.emissiveIntensity=e.emissiveIntensity,this.bumpMap=e.bumpMap,this.bumpScale=e.bumpScale,this.normalMap=e.normalMap,this.normalMapType=e.normalMapType,this.normalScale.copy(e.normalScale),this.displacementMap=e.displacementMap,this.displacementScale=e.displacementScale,this.displacementBias=e.displacementBias,this.specularMap=e.specularMap,this.alphaMap=e.alphaMap,this.envMap=e.envMap,this.combine=e.combine,this.reflectivity=e.reflectivity,this.refractionRatio=e.refractionRatio,this.wireframe=e.wireframe,this.wireframeLinewidth=e.wireframeLinewidth,this.wireframeLinecap=e.wireframeLinecap,this.wireframeLinejoin=e.wireframeLinejoin,this.flatShading=e.flatShading,this.fog=e.fog,this}}class F2 extends Cn{constructor(e){super(),this.isMeshToonMaterial=!0,this.defines={TOON:""},this.type="MeshToonMaterial",this.color=new Oe(16777215),this.map=null,this.gradientMap=null,this.lightMap=null,this.lightMapIntensity=1,this.aoMap=null,this.aoMapIntensity=1,this.emissive=new Oe(0),this.emissiveIntensity=1,this.emissiveMap=null,this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=na,this.normalScale=new ge(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 N2 extends Cn{constructor(e){super(),this.isMeshNormalMaterial=!0,this.type="MeshNormalMaterial",this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=na,this.normalScale=new ge(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 O2 extends Cn{constructor(e){super(),this.isMeshLambertMaterial=!0,this.type="MeshLambertMaterial",this.color=new Oe(16777215),this.map=null,this.lightMap=null,this.lightMapIntensity=1,this.aoMap=null,this.aoMapIntensity=1,this.emissive=new Oe(0),this.emissiveIntensity=1,this.emissiveMap=null,this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=na,this.normalScale=new ge(1,1),this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.specularMap=null,this.alphaMap=null,this.envMap=null,this.combine=Mh,this.reflectivity=1,this.refractionRatio=.98,this.wireframe=!1,this.wireframeLinewidth=1,this.wireframeLinecap="round",this.wireframeLinejoin="round",this.flatShading=!1,this.fog=!0,this.setValues(e)}copy(e){return super.copy(e),this.color.copy(e.color),this.map=e.map,this.lightMap=e.lightMap,this.lightMapIntensity=e.lightMapIntensity,this.aoMap=e.aoMap,this.aoMapIntensity=e.aoMapIntensity,this.emissive.copy(e.emissive),this.emissiveMap=e.emissiveMap,this.emissiveIntensity=e.emissiveIntensity,this.bumpMap=e.bumpMap,this.bumpScale=e.bumpScale,this.normalMap=e.normalMap,this.normalMapType=e.normalMapType,this.normalScale.copy(e.normalScale),this.displacementMap=e.displacementMap,this.displacementScale=e.displacementScale,this.displacementBias=e.displacementBias,this.specularMap=e.specularMap,this.alphaMap=e.alphaMap,this.envMap=e.envMap,this.combine=e.combine,this.reflectivity=e.reflectivity,this.refractionRatio=e.refractionRatio,this.wireframe=e.wireframe,this.wireframeLinewidth=e.wireframeLinewidth,this.wireframeLinecap=e.wireframeLinecap,this.wireframeLinejoin=e.wireframeLinejoin,this.flatShading=e.flatShading,this.fog=e.fog,this}}class U2 extends Cn{constructor(e){super(),this.isMeshMatcapMaterial=!0,this.defines={MATCAP:""},this.type="MeshMatcapMaterial",this.color=new Oe(16777215),this.matcap=null,this.map=null,this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=na,this.normalScale=new ge(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 k2 extends ai{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 dr(n,e,t){return HS(n)?new n.constructor(n.subarray(e,t!==void 0?t:n.length)):n.slice(e,t)}function Va(n,e,t){return!n||!t&&n.constructor===e?n:typeof e.BYTES_PER_ELEMENT=="number"?new e(n):Array.prototype.slice.call(n)}function HS(n){return ArrayBuffer.isView(n)&&!(n instanceof DataView)}function H2(n){function e(r,s){return n[r]-n[s]}const t=n.length,i=new Array(t);for(let r=0;r!==t;++r)i[r]=r;return i.sort(e),i}function D_(n,e,t){const i=n.length,r=new n.constructor(i);for(let s=0,o=0;o!==i;++s){const a=t[s]*e;for(let l=0;l!==e;++l)r[o++]=n[a+l]}return r}function zS(n,e,t,i){let r=1,s=n[0];for(;s!==void 0&&s[i]===void 0;)s=n[r++];if(s===void 0)return;let o=s[i];if(o!==void 0)if(Array.isArray(o))do o=s[i],o!==void 0&&(e.push(s.time),t.push.apply(t,o)),s=n[r++];while(s!==void 0);else if(o.toArray!==void 0)do o=s[i],o!==void 0&&(e.push(s.time),o.toArray(t,t.length)),s=n[r++];while(s!==void 0);else do o=s[i],o!==void 0&&(e.push(s.time),t.push(o)),s=n[r++];while(s!==void 0)}function O4(n,e,t,i,r=30){const s=n.clone();s.name=e;const o=[];for(let l=0;l<s.tracks.length;++l){const u=s.tracks[l],h=u.getValueSize(),d=[],p=[];for(let m=0;m<u.times.length;++m){const y=u.times[m]*r;if(!(y<t||y>=i)){d.push(u.times[m]);for(let M=0;M<h;++M)p.push(u.values[m*h+M])}}d.length!==0&&(u.times=Va(d,u.times.constructor),u.values=Va(p,u.values.constructor),o.push(u))}s.tracks=o;let a=1/0;for(let l=0;l<s.tracks.length;++l)a>s.tracks[l].times[0]&&(a=s.tracks[l].times[0]);for(let l=0;l<s.tracks.length;++l)s.tracks[l].shift(-1*a);return s.resetDuration(),s}function U4(n,e=0,t=n,i=30){i<=0&&(i=30);const r=t.tracks.length,s=e/i;for(let o=0;o<r;++o){const a=t.tracks[o],l=a.ValueTypeName;if(l==="bool"||l==="string")continue;const u=n.tracks.find(function(g){return g.name===a.name&&g.ValueTypeName===l});if(u===void 0)continue;let h=0;const d=a.getValueSize();a.createInterpolant.isInterpolantFactoryMethodGLTFCubicSpline&&(h=d/3);let p=0;const m=u.getValueSize();u.createInterpolant.isInterpolantFactoryMethodGLTFCubicSpline&&(p=m/3);const y=a.times.length-1;let M;if(s<=a.times[0]){const g=h,x=d-h;M=dr(a.values,g,x)}else if(s>=a.times[y]){const g=y*d+h,x=g+d-h;M=dr(a.values,g,x)}else{const g=a.createInterpolant(),x=h,S=d-h;g.evaluate(s),M=dr(g.resultBuffer,x,S)}l==="quaternion"&&new Gn().fromArray(M).normalize().conjugate().toArray(M);const _=u.times.length;for(let g=0;g<_;++g){const x=g*m+p;if(l==="quaternion")Gn.multiplyQuaternionsFlat(u.values,x,M,0,u.values,x);else{const S=m-p*2;for(let E=0;E<S;++E)u.values[x+E]-=M[E]}}}return n.blendMode=dS,n}const k4={arraySlice:dr,convertArray:Va,isTypedArray:HS,getKeyframeOrder:H2,sortedArray:D_,flattenJSON:zS,subclip:O4,makeClipAdditive:U4};class du{constructor(e,t,i,r){this.parameterPositions=e,this._cachedIndex=0,this.resultBuffer=r!==void 0?r:new t.constructor(i),this.sampleValues=t,this.valueSize=i,this.settings=null,this.DefaultSettings_={}}evaluate(e){const t=this.parameterPositions;let i=this._cachedIndex,r=t[i],s=t[i-1];e:{t:{let o;n:{i:if(!(e<r)){for(let a=i+2;;){if(r===void 0){if(e<s)break i;return i=t.length,this._cachedIndex=i,this.copySampleValue_(i-1)}if(i===a)break;if(s=r,r=t[++i],e<r)break t}o=t.length;break n}if(!(e>=s)){const a=t[1];e<a&&(i=2,s=a);for(let l=i-2;;){if(s===void 0)return this._cachedIndex=0,this.copySampleValue_(0);if(i===l)break;if(r=s,s=t[--i-1],e>=s)break t}o=i,i=0;break n}break e}for(;i<o;){const a=i+o>>>1;e<t[a]?o=a:i=a+1}if(r=t[i],s=t[i-1],s===void 0)return this._cachedIndex=0,this.copySampleValue_(0);if(r===void 0)return i=t.length,this._cachedIndex=i,this.copySampleValue_(i-1)}this._cachedIndex=i,this.intervalChanged_(i,s,r)}return this.interpolate_(i,s,e,r)}getSettings_(){return this.settings||this.DefaultSettings_}copySampleValue_(e){const t=this.resultBuffer,i=this.sampleValues,r=this.valueSize,s=e*r;for(let o=0;o!==r;++o)t[o]=i[s+o];return t}interpolate_(){throw new Error("call to abstract method")}intervalChanged_(){}}class z2 extends du{constructor(e,t,i,r){super(e,t,i,r),this._weightPrev=-0,this._offsetPrev=-0,this._weightNext=-0,this._offsetNext=-0,this.DefaultSettings_={endingStart:Ha,endingEnd:Ha}}intervalChanged_(e,t,i){const r=this.parameterPositions;let s=e-2,o=e+1,a=r[s],l=r[o];if(a===void 0)switch(this.getSettings_().endingStart){case za:s=e,a=2*t-i;break;case nh:s=r.length-2,a=t+r[s]-r[s+1];break;default:s=e,a=i}if(l===void 0)switch(this.getSettings_().endingEnd){case za:o=e,l=2*i-t;break;case nh:o=1,l=i+r[1]-r[0];break;default:o=e-1,l=t}const u=(i-t)*.5,h=this.valueSize;this._weightPrev=u/(t-a),this._weightNext=u/(l-i),this._offsetPrev=s*h,this._offsetNext=o*h}interpolate_(e,t,i,r){const s=this.resultBuffer,o=this.sampleValues,a=this.valueSize,l=e*a,u=l-a,h=this._offsetPrev,d=this._offsetNext,p=this._weightPrev,m=this._weightNext,y=(i-t)/(r-t),M=y*y,_=M*y,g=-p*_+2*p*M-p*y,x=(1+p)*_+(-1.5-2*p)*M+(-.5+p)*y+1,S=(-1-m)*_+(1.5+m)*M+.5*y,E=m*_-m*M;for(let C=0;C!==a;++C)s[C]=g*o[h+C]+x*o[u+C]+S*o[l+C]+E*o[d+C];return s}}class GS extends du{constructor(e,t,i,r){super(e,t,i,r)}interpolate_(e,t,i,r){const s=this.resultBuffer,o=this.sampleValues,a=this.valueSize,l=e*a,u=l-a,h=(i-t)/(r-t),d=1-h;for(let p=0;p!==a;++p)s[p]=o[u+p]*d+o[l+p]*h;return s}}class G2 extends du{constructor(e,t,i,r){super(e,t,i,r)}interpolate_(e){return this.copySampleValue_(e-1)}}class Yr{constructor(e,t,i,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=Va(t,this.TimeBufferType),this.values=Va(i,this.ValueBufferType),this.setInterpolation(r||this.DefaultInterpolation)}static toJSON(e){const t=e.constructor;let i;if(t.toJSON!==this.toJSON)i=t.toJSON(e);else{i={name:e.name,times:Va(e.times,Array),values:Va(e.values,Array)};const r=e.getInterpolation();r!==e.DefaultInterpolation&&(i.interpolation=r)}return i.type=e.ValueTypeName,i}InterpolantFactoryMethodDiscrete(e){return new G2(this.times,this.values,this.getValueSize(),e)}InterpolantFactoryMethodLinear(e){return new GS(this.times,this.values,this.getValueSize(),e)}InterpolantFactoryMethodSmooth(e){return new z2(this.times,this.values,this.getValueSize(),e)}setInterpolation(e){let t;switch(e){case Yc:t=this.InterpolantFactoryMethodDiscrete;break;case sl:t=this.InterpolantFactoryMethodLinear;break;case gm:t=this.InterpolantFactoryMethodSmooth;break}if(t===void 0){const i="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(i);return console.warn("THREE.KeyframeTrack:",i),this}return this.createInterpolant=t,this}getInterpolation(){switch(this.createInterpolant){case this.InterpolantFactoryMethodDiscrete:return Yc;case this.InterpolantFactoryMethodLinear:return sl;case this.InterpolantFactoryMethodSmooth:return gm}}getValueSize(){return this.values.length/this.times.length}shift(e){if(e!==0){const t=this.times;for(let i=0,r=t.length;i!==r;++i)t[i]+=e}return this}scale(e){if(e!==1){const t=this.times;for(let i=0,r=t.length;i!==r;++i)t[i]*=e}return this}trim(e,t){const i=this.times,r=i.length;let s=0,o=r-1;for(;s!==r&&i[s]<e;)++s;for(;o!==-1&&i[o]>t;)--o;if(++o,s!==0||o!==r){s>=o&&(o=Math.max(o,1),s=o-1);const a=this.getValueSize();this.times=dr(i,s,o),this.values=dr(this.values,s*a,o*a)}return this}validate(){let e=!0;const t=this.getValueSize();t-Math.floor(t)!==0&&(console.error("THREE.KeyframeTrack: Invalid value size in track.",this),e=!1);const i=this.times,r=this.values,s=i.length;s===0&&(console.error("THREE.KeyframeTrack: Track is empty.",this),e=!1);let o=null;for(let a=0;a!==s;a++){const l=i[a];if(typeof l=="number"&&isNaN(l)){console.error("THREE.KeyframeTrack: Time is not a valid number.",this,a,l),e=!1;break}if(o!==null&&o>l){console.error("THREE.KeyframeTrack: Out of order keys.",this,a,l,o),e=!1;break}o=l}if(r!==void 0&&HS(r))for(let a=0,l=r.length;a!==l;++a){const u=r[a];if(isNaN(u)){console.error("THREE.KeyframeTrack: Value is not a valid number.",this,a,u),e=!1;break}}return e}optimize(){const e=dr(this.times),t=dr(this.values),i=this.getValueSize(),r=this.getInterpolation()===gm,s=e.length-1;let o=1;for(let a=1;a<s;++a){let l=!1;const u=e[a],h=e[a+1];if(u!==h&&(a!==1||u!==e[0]))if(r)l=!0;else{const d=a*i,p=d-i,m=d+i;for(let y=0;y!==i;++y){const M=t[d+y];if(M!==t[p+y]||M!==t[m+y]){l=!0;break}}}if(l){if(a!==o){e[o]=e[a];const d=a*i,p=o*i;for(let m=0;m!==i;++m)t[p+m]=t[d+m]}++o}}if(s>0){e[o]=e[s];for(let a=s*i,l=o*i,u=0;u!==i;++u)t[l+u]=t[a+u];++o}return o!==e.length?(this.times=dr(e,0,o),this.values=dr(t,0,o*i)):(this.times=e,this.values=t),this}clone(){const e=dr(this.times,0),t=dr(this.values,0),i=this.constructor,r=new i(this.name,e,t);return r.createInterpolant=this.createInterpolant,r}}Yr.prototype.TimeBufferType=Float32Array;Yr.prototype.ValueBufferType=Float32Array;Yr.prototype.DefaultInterpolation=sl;class fl extends Yr{}fl.prototype.ValueTypeName="bool";fl.prototype.ValueBufferType=Array;fl.prototype.DefaultInterpolation=Yc;fl.prototype.InterpolantFactoryMethodLinear=void 0;fl.prototype.InterpolantFactoryMethodSmooth=void 0;class VS extends Yr{}VS.prototype.ValueTypeName="color";class $c extends Yr{}$c.prototype.ValueTypeName="number";class V2 extends du{constructor(e,t,i,r){super(e,t,i,r)}interpolate_(e,t,i,r){const s=this.resultBuffer,o=this.sampleValues,a=this.valueSize,l=(i-t)/(r-t);let u=e*a;for(let h=u+a;u!==h;u+=4)Gn.slerpFlat(s,0,o,u-a,o,u,l);return s}}class Qo extends Yr{InterpolantFactoryMethodLinear(e){return new V2(this.times,this.values,this.getValueSize(),e)}}Qo.prototype.ValueTypeName="quaternion";Qo.prototype.DefaultInterpolation=sl;Qo.prototype.InterpolantFactoryMethodSmooth=void 0;class hl extends Yr{}hl.prototype.ValueTypeName="string";hl.prototype.ValueBufferType=Array;hl.prototype.DefaultInterpolation=Yc;hl.prototype.InterpolantFactoryMethodLinear=void 0;hl.prototype.InterpolantFactoryMethodSmooth=void 0;class eu extends Yr{}eu.prototype.ValueTypeName="vector";class tu{constructor(e,t=-1,i,r=Bg){this.name=e,this.tracks=i,this.duration=t,this.blendMode=r,this.uuid=Ji(),this.duration<0&&this.resetDuration()}static parse(e){const t=[],i=e.tracks,r=1/(e.fps||1);for(let o=0,a=i.length;o!==a;++o)t.push(z4(i[o]).scale(r));const s=new this(e.name,e.duration,t,e.blendMode);return s.uuid=e.uuid,s}static toJSON(e){const t=[],i=e.tracks,r={name:e.name,duration:e.duration,tracks:t,uuid:e.uuid,blendMode:e.blendMode};for(let s=0,o=i.length;s!==o;++s)t.push(Yr.toJSON(i[s]));return r}static CreateFromMorphTargetSequence(e,t,i,r){const s=t.length,o=[];for(let a=0;a<s;a++){let l=[],u=[];l.push((a+s-1)%s,a,(a+1)%s),u.push(0,1,0);const h=H2(l);l=D_(l,1,h),u=D_(u,1,h),!r&&l[0]===0&&(l.push(s),u.push(u[0])),o.push(new $c(".morphTargetInfluences["+t[a].name+"]",l,u).scale(1/i))}return new this(e,-1,o)}static findByName(e,t){let i=e;if(!Array.isArray(e)){const r=e;i=r.geometry&&r.geometry.animations||r.animations}for(let r=0;r<i.length;r++)if(i[r].name===t)return i[r];return null}static CreateClipsFromMorphTargetSequences(e,t,i){const r={},s=/^([\w-]*?)([\d]+)$/;for(let a=0,l=e.length;a<l;a++){const u=e[a],h=u.name.match(s);if(h&&h.length>1){const d=h[1];let p=r[d];p||(r[d]=p=[]),p.push(u)}}const o=[];for(const a in r)o.push(this.CreateFromMorphTargetSequence(a,r[a],t,i));return o}static parseAnimation(e,t){if(!e)return console.error("THREE.AnimationClip: No animation in JSONLoader data."),null;const i=function(d,p,m,y,M){if(m.length!==0){const _=[],g=[];zS(m,_,g,y),_.length!==0&&M.push(new d(p,_,g))}},r=[],s=e.name||"default",o=e.fps||30,a=e.blendMode;let l=e.length||-1;const u=e.hierarchy||[];for(let d=0;d<u.length;d++){const p=u[d].keys;if(!(!p||p.length===0))if(p[0].morphTargets){const m={};let y;for(y=0;y<p.length;y++)if(p[y].morphTargets)for(let M=0;M<p[y].morphTargets.length;M++)m[p[y].morphTargets[M]]=-1;for(const M in m){const _=[],g=[];for(let x=0;x!==p[y].morphTargets.length;++x){const S=p[y];_.push(S.time),g.push(S.morphTarget===M?1:0)}r.push(new $c(".morphTargetInfluence["+M+"]",_,g))}l=m.length*o}else{const m=".bones["+t[d].name+"]";i(eu,m+".position",p,"pos",r),i(Qo,m+".quaternion",p,"rot",r),i(eu,m+".scale",p,"scl",r)}}return r.length===0?null:new this(s,l,r,a)}resetDuration(){const e=this.tracks;let t=0;for(let i=0,r=e.length;i!==r;++i){const s=this.tracks[i];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 H4(n){switch(n.toLowerCase()){case"scalar":case"double":case"float":case"number":case"integer":return $c;case"vector":case"vector2":case"vector3":case"vector4":return eu;case"color":return VS;case"quaternion":return Qo;case"bool":case"boolean":return fl;case"string":return hl}throw new Error("THREE.KeyframeTrack: Unsupported typeName: "+n)}function z4(n){if(n.type===void 0)throw new Error("THREE.KeyframeTrack: track type undefined, can not parse");const e=H4(n.type);if(n.times===void 0){const t=[],i=[];zS(n.keys,t,i,"value"),n.times=t,n.values=i}return e.parse!==void 0?e.parse(n):new e(n.name,n.times,n.values,n.interpolation)}const al={enabled:!1,files:{},add:function(n,e){this.enabled!==!1&&(this.files[n]=e)},get:function(n){if(this.enabled!==!1)return this.files[n]},remove:function(n){delete this.files[n]},clear:function(){this.files={}}};class WS{constructor(e,t,i){const r=this;let s=!1,o=0,a=0,l;const u=[];this.onStart=void 0,this.onLoad=e,this.onProgress=t,this.onError=i,this.itemStart=function(h){a++,s===!1&&r.onStart!==void 0&&r.onStart(h,o,a),s=!0},this.itemEnd=function(h){o++,r.onProgress!==void 0&&r.onProgress(h,o,a),o===a&&(s=!1,r.onLoad!==void 0&&r.onLoad())},this.itemError=function(h){r.onError!==void 0&&r.onError(h)},this.resolveURL=function(h){return l?l(h):h},this.setURLModifier=function(h){return l=h,this},this.addHandler=function(h,d){return u.push(h,d),this},this.removeHandler=function(h){const d=u.indexOf(h);return d!==-1&&u.splice(d,2),this},this.getHandler=function(h){for(let d=0,p=u.length;d<p;d+=2){const m=u[d],y=u[d+1];if(m.global&&(m.lastIndex=0),m.test(h))return y}return null}}}const xc=new WS;let li=class{constructor(e){this.manager=e!==void 0?e:xc,this.crossOrigin="anonymous",this.withCredentials=!1,this.path="",this.resourcePath="",this.requestHeader={}}load(){}loadAsync(e,t){const i=this;return new Promise(function(r,s){i.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}};li.DEFAULT_MATERIAL_NAME="__DEFAULT";const Ds={};class G4 extends Error{constructor(e,t){super(e),this.response=t}}class Yi extends li{constructor(e){super(e)}load(e,t,i,r){e===void 0&&(e=""),this.path!==void 0&&(e=this.path+e),e=this.manager.resolveURL(e);const s=al.get(e);if(s!==void 0)return this.manager.itemStart(e),setTimeout(()=>{t&&t(s),this.manager.itemEnd(e)},0),s;if(Ds[e]!==void 0){Ds[e].push({onLoad:t,onProgress:i,onError:r});return}Ds[e]=[],Ds[e].push({onLoad:t,onProgress:i,onError:r});const o=new Request(e,{headers:new Headers(this.requestHeader),credentials:this.withCredentials?"include":"same-origin"}),a=this.mimeType,l=this.responseType;fetch(o).then(u=>{if(u.status===200||u.status===0){if(u.status===0&&console.warn("THREE.FileLoader: HTTP Status 0 received."),typeof ReadableStream>"u"||u.body===void 0||u.body.getReader===void 0)return u;const h=Ds[e],d=u.body.getReader(),p=u.headers.get("Content-Length")||u.headers.get("X-File-Size"),m=p?parseInt(p):0,y=m!==0;let M=0;const _=new ReadableStream({start(g){x();function x(){d.read().then(({done:S,value:E})=>{if(S)g.close();else{M+=E.byteLength;const C=new ProgressEvent("progress",{lengthComputable:y,loaded:M,total:m});for(let b=0,P=h.length;b<P;b++){const B=h[b];B.onProgress&&B.onProgress(C)}g.enqueue(E),x()}})}}});return new Response(_)}else throw new G4(`fetch for "${u.url}" responded with ${u.status}: ${u.statusText}`,u)}).then(u=>{switch(l){case"arraybuffer":return u.arrayBuffer();case"blob":return u.blob();case"document":return u.text().then(h=>new DOMParser().parseFromString(h,a));case"json":return u.json();default:if(a===void 0)return u.text();{const d=/charset="?([^;"\s]*)"?/i.exec(a),p=d&&d[1]?d[1].toLowerCase():void 0,m=new TextDecoder(p);return u.arrayBuffer().then(y=>m.decode(y))}}}).then(u=>{al.add(e,u);const h=Ds[e];delete Ds[e];for(let d=0,p=h.length;d<p;d++){const m=h[d];m.onLoad&&m.onLoad(u)}}).catch(u=>{const h=Ds[e];if(h===void 0)throw this.manager.itemError(e),u;delete Ds[e];for(let d=0,p=h.length;d<p;d++){const m=h[d];m.onError&&m.onError(u)}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 V4 extends li{constructor(e){super(e)}load(e,t,i,r){const s=this,o=new Yi(this.manager);o.setPath(this.path),o.setRequestHeader(this.requestHeader),o.setWithCredentials(this.withCredentials),o.load(e,function(a){try{t(s.parse(JSON.parse(a)))}catch(l){r?r(l):console.error(l),s.manager.itemError(e)}},i,r)}parse(e){const t=[];for(let i=0;i<e.length;i++){const r=tu.parse(e[i]);t.push(r)}return t}}class W4 extends li{constructor(e){super(e)}load(e,t,i,r){const s=this,o=[],a=new IS,l=new Yi(this.manager);l.setPath(this.path),l.setResponseType("arraybuffer"),l.setRequestHeader(this.requestHeader),l.setWithCredentials(s.withCredentials);let u=0;function h(d){l.load(e[d],function(p){const m=s.parse(p,!0);o[d]={width:m.width,height:m.height,format:m.format,mipmaps:m.mipmaps},u+=1,u===6&&(m.mipmapCount===1&&(a.minFilter=rn),a.image=o,a.format=m.format,a.needsUpdate=!0,t&&t(a))},i,r)}if(Array.isArray(e))for(let d=0,p=e.length;d<p;++d)h(d);else l.load(e,function(d){const p=s.parse(d,!0);if(p.isCubemap){const m=p.mipmaps.length/p.mipmapCount;for(let y=0;y<m;y++){o[y]={mipmaps:[]};for(let M=0;M<p.mipmapCount;M++)o[y].mipmaps.push(p.mipmaps[y*p.mipmapCount+M]),o[y].format=p.format,o[y].width=p.width,o[y].height=p.height}a.image=o}else a.image.width=p.width,a.image.height=p.height,a.mipmaps=p.mipmaps;p.mipmapCount===1&&(a.minFilter=rn),a.format=p.format,a.needsUpdate=!0,t&&t(a)},i,r);return a}}class uh extends li{constructor(e){super(e)}load(e,t,i,r){this.path!==void 0&&(e=this.path+e),e=this.manager.resolveURL(e);const s=this,o=al.get(e);if(o!==void 0)return s.manager.itemStart(e),setTimeout(function(){t&&t(o),s.manager.itemEnd(e)},0),o;const a=sh("img");function l(){h(),al.add(e,this),t&&t(this),s.manager.itemEnd(e)}function u(d){h(),r&&r(d),s.manager.itemError(e),s.manager.itemEnd(e)}function h(){a.removeEventListener("load",l,!1),a.removeEventListener("error",u,!1)}return a.addEventListener("load",l,!1),a.addEventListener("error",u,!1),e.slice(0,5)!=="data:"&&this.crossOrigin!==void 0&&(a.crossOrigin=this.crossOrigin),s.manager.itemStart(e),a.src=e,a}}class j4 extends li{constructor(e){super(e)}load(e,t,i,r){const s=new Th;s.colorSpace=mt;const o=new uh(this.manager);o.setCrossOrigin(this.crossOrigin),o.setPath(this.path);let a=0;function l(u){o.load(e[u],function(h){s.images[u]=h,a++,a===6&&(s.needsUpdate=!0,t&&t(s))},void 0,r)}for(let u=0;u<e.length;++u)l(u);return s}}class X4 extends li{constructor(e){super(e)}load(e,t,i,r){const s=this,o=new Ic,a=new Yi(this.manager);return a.setResponseType("arraybuffer"),a.setRequestHeader(this.requestHeader),a.setPath(this.path),a.setWithCredentials(s.withCredentials),a.load(e,function(l){const u=s.parse(l);u&&(u.image!==void 0?o.image=u.image:u.data!==void 0&&(o.image.width=u.width,o.image.height=u.height,o.image.data=u.data),o.wrapS=u.wrapS!==void 0?u.wrapS:Xn,o.wrapT=u.wrapT!==void 0?u.wrapT:Xn,o.magFilter=u.magFilter!==void 0?u.magFilter:rn,o.minFilter=u.minFilter!==void 0?u.minFilter:rn,o.anisotropy=u.anisotropy!==void 0?u.anisotropy:1,u.colorSpace!==void 0?o.colorSpace=u.colorSpace:u.encoding!==void 0&&(o.encoding=u.encoding),u.flipY!==void 0&&(o.flipY=u.flipY),u.format!==void 0&&(o.format=u.format),u.type!==void 0&&(o.type=u.type),u.mipmaps!==void 0&&(o.mipmaps=u.mipmaps,o.minFilter=vs),u.mipmapCount===1&&(o.minFilter=rn),u.generateMipmaps!==void 0&&(o.generateMipmaps=u.generateMipmaps),o.needsUpdate=!0,t&&t(o,u))},i,r),o}}class W2 extends li{constructor(e){super(e)}load(e,t,i,r){const s=new $t,o=new uh(this.manager);return o.setCrossOrigin(this.crossOrigin),o.setPath(this.path),o.load(e,function(a){s.image=a,s.needsUpdate=!0,t!==void 0&&t(s)},i,r),s}}class ra extends bt{constructor(e,t=1){super(),this.isLight=!0,this.type="Light",this.color=new Oe(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()),t}}class j2 extends ra{constructor(e,t,i){super(e,i),this.isHemisphereLight=!0,this.type="HemisphereLight",this.position.copy(bt.DEFAULT_UP),this.updateMatrix(),this.groundColor=new Oe(t)}copy(e,t){return super.copy(e,t),this.groundColor.copy(e.groundColor),this}}const xy=new rt,CT=new F,bT=new F;class jS{constructor(e){this.camera=e,this.bias=0,this.normalBias=0,this.radius=1,this.blurSamples=8,this.mapSize=new ge(512,512),this.map=null,this.mapPass=null,this.matrix=new rt,this.autoUpdate=!0,this.needsUpdate=!1,this._frustum=new Ig,this._frameExtents=new ge(1,1),this._viewportCount=1,this._viewports=[new Nt(0,0,1,1)]}getViewportCount(){return this._viewportCount}getFrustum(){return this._frustum}updateMatrices(e){const t=this.camera,i=this.matrix;CT.setFromMatrixPosition(e.matrixWorld),t.position.copy(CT),bT.setFromMatrixPosition(e.target.matrixWorld),t.lookAt(bT),t.updateMatrixWorld(),xy.multiplyMatrices(t.projectionMatrix,t.matrixWorldInverse),this._frustum.setFromProjectionMatrix(xy),i.set(.5,0,0,.5,0,.5,0,.5,0,0,.5,.5,0,0,0,1),i.multiply(xy)}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.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.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 J4 extends jS{constructor(){super(new qt(50,1,.5,500)),this.isSpotLightShadow=!0,this.focus=1}updateMatrices(e){const t=this.camera,i=Qc*2*e.angle*this.focus,r=this.mapSize.width/this.mapSize.height,s=e.distance||t.far;(i!==t.fov||r!==t.aspect||s!==t.far)&&(t.fov=i,t.aspect=r,t.far=s,t.updateProjectionMatrix()),super.updateMatrices(e)}copy(e){return super.copy(e),this.focus=e.focus,this}}class XS extends ra{constructor(e,t,i=0,r=Math.PI/3,s=0,o=2){super(e,t),this.isSpotLight=!0,this.type="SpotLight",this.position.copy(bt.DEFAULT_UP),this.updateMatrix(),this.target=new bt,this.distance=i,this.angle=r,this.penumbra=s,this.decay=o,this.map=null,this.shadow=new J4}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 RT=new rt,Zu=new F,_y=new F;class K4 extends jS{constructor(){super(new qt(90,1,.5,500)),this.isPointLightShadow=!0,this._frameExtents=new ge(4,2),this._viewportCount=6,this._viewports=[new Nt(2,1,1,1),new Nt(0,1,1,1),new Nt(3,1,1,1),new Nt(1,1,1,1),new Nt(3,0,1,1),new Nt(1,0,1,1)],this._cubeDirections=[new F(1,0,0),new F(-1,0,0),new F(0,0,1),new F(0,0,-1),new F(0,1,0),new F(0,-1,0)],this._cubeUps=[new F(0,1,0),new F(0,1,0),new F(0,1,0),new F(0,1,0),new F(0,0,1),new F(0,0,-1)]}updateMatrices(e,t=0){const i=this.camera,r=this.matrix,s=e.distance||i.far;s!==i.far&&(i.far=s,i.updateProjectionMatrix()),Zu.setFromMatrixPosition(e.matrixWorld),i.position.copy(Zu),_y.copy(i.position),_y.add(this._cubeDirections[t]),i.up.copy(this._cubeUps[t]),i.lookAt(_y),i.updateMatrixWorld(),r.makeTranslation(-Zu.x,-Zu.y,-Zu.z),RT.multiplyMatrices(i.projectionMatrix,i.matrixWorldInverse),this._frustum.setFromProjectionMatrix(RT)}}class JS extends ra{constructor(e,t,i=0,r=2){super(e,t),this.isPointLight=!0,this.type="PointLight",this.distance=i,this.decay=r,this.shadow=new K4}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 Y4 extends jS{constructor(){super(new zr(-5,5,5,-5,.5,500)),this.isDirectionalLightShadow=!0}}class KS extends ra{constructor(e,t){super(e,t),this.isDirectionalLight=!0,this.type="DirectionalLight",this.position.copy(bt.DEFAULT_UP),this.updateMatrix(),this.target=new bt,this.shadow=new Y4}dispose(){this.shadow.dispose()}copy(e){return super.copy(e),this.target=e.target.clone(),this.shadow=e.shadow.clone(),this}}class X2 extends ra{constructor(e,t){super(e,t),this.isAmbientLight=!0,this.type="AmbientLight"}}class J2 extends ra{constructor(e,t,i=10,r=10){super(e,t),this.isRectAreaLight=!0,this.type="RectAreaLight",this.width=i,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 K2{constructor(){this.isSphericalHarmonics3=!0,this.coefficients=[];for(let e=0;e<9;e++)this.coefficients.push(new F)}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 i=e.x,r=e.y,s=e.z,o=this.coefficients;return t.copy(o[0]).multiplyScalar(.282095),t.addScaledVector(o[1],.488603*r),t.addScaledVector(o[2],.488603*s),t.addScaledVector(o[3],.488603*i),t.addScaledVector(o[4],1.092548*(i*r)),t.addScaledVector(o[5],1.092548*(r*s)),t.addScaledVector(o[6],.315392*(3*s*s-1)),t.addScaledVector(o[7],1.092548*(i*s)),t.addScaledVector(o[8],.546274*(i*i-r*r)),t}getIrradianceAt(e,t){const i=e.x,r=e.y,s=e.z,o=this.coefficients;return t.copy(o[0]).multiplyScalar(.886227),t.addScaledVector(o[1],2*.511664*r),t.addScaledVector(o[2],2*.511664*s),t.addScaledVector(o[3],2*.511664*i),t.addScaledVector(o[4],2*.429043*i*r),t.addScaledVector(o[5],2*.429043*r*s),t.addScaledVector(o[6],.743125*s*s-.247708),t.addScaledVector(o[7],2*.429043*i*s),t.addScaledVector(o[8],.429043*(i*i-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 i=0;i<9;i++)this.coefficients[i].addScaledVector(e.coefficients[i],t);return this}scale(e){for(let t=0;t<9;t++)this.coefficients[t].multiplyScalar(e);return this}lerp(e,t){for(let i=0;i<9;i++)this.coefficients[i].lerp(e.coefficients[i],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 i=this.coefficients;for(let r=0;r<9;r++)i[r].fromArray(e,t+r*3);return this}toArray(e=[],t=0){const i=this.coefficients;for(let r=0;r<9;r++)i[r].toArray(e,t+r*3);return e}static getBasisAt(e,t){const i=e.x,r=e.y,s=e.z;t[0]=.282095,t[1]=.488603*r,t[2]=.488603*s,t[3]=.488603*i,t[4]=1.092548*i*r,t[5]=1.092548*r*s,t[6]=.315392*(3*s*s-1),t[7]=1.092548*i*s,t[8]=.546274*(i*i-r*r)}}class $g extends ra{constructor(e=new K2,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 e0 extends li{constructor(e){super(e),this.textures={}}load(e,t,i,r){const s=this,o=new Yi(s.manager);o.setPath(s.path),o.setRequestHeader(s.requestHeader),o.setWithCredentials(s.withCredentials),o.load(e,function(a){try{t(s.parse(JSON.parse(a)))}catch(l){r?r(l):console.error(l),s.manager.itemError(e)}},i,r)}parse(e){const t=this.textures;function i(s){return t[s]===void 0&&console.warn("THREE.MaterialLoader: Undefined texture",s),t[s]}const r=e0.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 Oe().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.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.depthTest!==void 0&&(r.depthTest=e.depthTest),e.depthWrite!==void 0&&(r.depthWrite=e.depthWrite),e.colorWrite!==void 0&&(r.colorWrite=e.colorWrite),e.stencilWrite!==void 0&&(r.stencilWrite=e.stencilWrite),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.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!==1&&(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 o=e.uniforms[s];switch(r.uniforms[s]={},o.type){case"t":r.uniforms[s].value=i(o.value);break;case"c":r.uniforms[s].value=new Oe().setHex(o.value);break;case"v2":r.uniforms[s].value=new ge().fromArray(o.value);break;case"v3":r.uniforms[s].value=new F().fromArray(o.value);break;case"v4":r.uniforms[s].value=new Nt().fromArray(o.value);break;case"m3":r.uniforms[s].value=new _t().fromArray(o.value);break;case"m4":r.uniforms[s].value=new rt().fromArray(o.value);break;default:r.uniforms[s].value=o.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=i(e.map)),e.matcap!==void 0&&(r.matcap=i(e.matcap)),e.alphaMap!==void 0&&(r.alphaMap=i(e.alphaMap)),e.bumpMap!==void 0&&(r.bumpMap=i(e.bumpMap)),e.bumpScale!==void 0&&(r.bumpScale=e.bumpScale),e.normalMap!==void 0&&(r.normalMap=i(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 ge().fromArray(s)}return e.displacementMap!==void 0&&(r.displacementMap=i(e.displacementMap)),e.displacementScale!==void 0&&(r.displacementScale=e.displacementScale),e.displacementBias!==void 0&&(r.displacementBias=e.displacementBias),e.roughnessMap!==void 0&&(r.roughnessMap=i(e.roughnessMap)),e.metalnessMap!==void 0&&(r.metalnessMap=i(e.metalnessMap)),e.emissiveMap!==void 0&&(r.emissiveMap=i(e.emissiveMap)),e.emissiveIntensity!==void 0&&(r.emissiveIntensity=e.emissiveIntensity),e.specularMap!==void 0&&(r.specularMap=i(e.specularMap)),e.specularIntensityMap!==void 0&&(r.specularIntensityMap=i(e.specularIntensityMap)),e.specularColorMap!==void 0&&(r.specularColorMap=i(e.specularColorMap)),e.envMap!==void 0&&(r.envMap=i(e.envMap)),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=i(e.lightMap)),e.lightMapIntensity!==void 0&&(r.lightMapIntensity=e.lightMapIntensity),e.aoMap!==void 0&&(r.aoMap=i(e.aoMap)),e.aoMapIntensity!==void 0&&(r.aoMapIntensity=e.aoMapIntensity),e.gradientMap!==void 0&&(r.gradientMap=i(e.gradientMap)),e.clearcoatMap!==void 0&&(r.clearcoatMap=i(e.clearcoatMap)),e.clearcoatRoughnessMap!==void 0&&(r.clearcoatRoughnessMap=i(e.clearcoatRoughnessMap)),e.clearcoatNormalMap!==void 0&&(r.clearcoatNormalMap=i(e.clearcoatNormalMap)),e.clearcoatNormalScale!==void 0&&(r.clearcoatNormalScale=new ge().fromArray(e.clearcoatNormalScale)),e.iridescenceMap!==void 0&&(r.iridescenceMap=i(e.iridescenceMap)),e.iridescenceThicknessMap!==void 0&&(r.iridescenceThicknessMap=i(e.iridescenceThicknessMap)),e.transmissionMap!==void 0&&(r.transmissionMap=i(e.transmissionMap)),e.thicknessMap!==void 0&&(r.thicknessMap=i(e.thicknessMap)),e.anisotropyMap!==void 0&&(r.anisotropyMap=i(e.anisotropyMap)),e.sheenColorMap!==void 0&&(r.sheenColorMap=i(e.sheenColorMap)),e.sheenRoughnessMap!==void 0&&(r.sheenRoughnessMap=i(e.sheenRoughnessMap)),r}setTextures(e){return this.textures=e,this}static createMaterialFromType(e){const t={ShadowMaterial:L2,SpriteMaterial:bS,RawShaderMaterial:I2,ShaderMaterial:ys,PointsMaterial:Ph,MeshPhysicalMaterial:_s,MeshStandardMaterial:Dh,MeshPhongMaterial:D2,MeshToonMaterial:F2,MeshNormalMaterial:N2,MeshLambertMaterial:O2,MeshDepthMaterial:wS,MeshDistanceMaterial:TS,MeshBasicMaterial:ji,MeshMatcapMaterial:U2,LineDashedMaterial:k2,LineBasicMaterial:ai,Material:Cn};return new t[e]}}class ps{static decodeText(e){if(typeof TextDecoder<"u")return new TextDecoder().decode(e);let t="";for(let i=0,r=e.length;i<r;i++)t+=String.fromCharCode(e[i]);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 Y2 extends gt{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 Q2 extends li{constructor(e){super(e)}load(e,t,i,r){const s=this,o=new Yi(s.manager);o.setPath(s.path),o.setRequestHeader(s.requestHeader),o.setWithCredentials(s.withCredentials),o.load(e,function(a){try{t(s.parse(JSON.parse(a)))}catch(l){r?r(l):console.error(l),s.manager.itemError(e)}},i,r)}parse(e){const t={},i={};function r(m,y){if(t[y]!==void 0)return t[y];const _=m.interleavedBuffers[y],g=s(m,_.buffer),x=gc(_.type,g),S=new bh(x,_.stride);return S.uuid=_.uuid,t[y]=S,S}function s(m,y){if(i[y]!==void 0)return i[y];const _=m.arrayBuffers[y],g=new Uint32Array(_).buffer;return i[y]=g,g}const o=e.isInstancedBufferGeometry?new Y2:new gt,a=e.data.index;if(a!==void 0){const m=gc(a.type,a.array);o.setIndex(new Dt(m,1))}const l=e.data.attributes;for(const m in l){const y=l[m];let M;if(y.isInterleavedBufferAttribute){const _=r(e.data,y.data);M=new Yo(_,y.itemSize,y.offset,y.normalized)}else{const _=gc(y.type,y.array),g=y.isInstancedBufferAttribute?qc:Dt;M=new g(_,y.itemSize,y.normalized)}y.name!==void 0&&(M.name=y.name),y.usage!==void 0&&M.setUsage(y.usage),y.updateRange!==void 0&&(M.updateRange.offset=y.updateRange.offset,M.updateRange.count=y.updateRange.count),o.setAttribute(m,M)}const u=e.data.morphAttributes;if(u)for(const m in u){const y=u[m],M=[];for(let _=0,g=y.length;_<g;_++){const x=y[_];let S;if(x.isInterleavedBufferAttribute){const E=r(e.data,x.data);S=new Yo(E,x.itemSize,x.offset,x.normalized)}else{const E=gc(x.type,x.array);S=new Dt(E,x.itemSize,x.normalized)}x.name!==void 0&&(S.name=x.name),M.push(S)}o.morphAttributes[m]=M}e.data.morphTargetsRelative&&(o.morphTargetsRelative=!0);const d=e.data.groups||e.data.drawcalls||e.data.offsets;if(d!==void 0)for(let m=0,y=d.length;m!==y;++m){const M=d[m];o.addGroup(M.start,M.count,M.materialIndex)}const p=e.data.boundingSphere;if(p!==void 0){const m=new F;p.center!==void 0&&m.fromArray(p.center),o.boundingSphere=new Sr(m,p.radius)}return e.name&&(o.name=e.name),e.userData&&(o.userData=e.userData),o}}class Q4 extends li{constructor(e){super(e)}load(e,t,i,r){const s=this,o=this.path===""?ps.extractUrlBase(e):this.path;this.resourcePath=this.resourcePath||o;const a=new Yi(this.manager);a.setPath(this.path),a.setRequestHeader(this.requestHeader),a.setWithCredentials(this.withCredentials),a.load(e,function(l){let u=null;try{u=JSON.parse(l)}catch(d){r!==void 0&&r(d),console.error("THREE:ObjectLoader: Can't parse "+e+".",d.message);return}const h=u.metadata;if(h===void 0||h.type===void 0||h.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(u,t)},i,r)}async loadAsync(e,t){const i=this,r=this.path===""?ps.extractUrlBase(e):this.path;this.resourcePath=this.resourcePath||r;const s=new Yi(this.manager);s.setPath(this.path),s.setRequestHeader(this.requestHeader),s.setWithCredentials(this.withCredentials);const o=await s.loadAsync(e,t),a=JSON.parse(o),l=a.metadata;if(l===void 0||l.type===void 0||l.type.toLowerCase()==="geometry")throw new Error("THREE.ObjectLoader: Can't load "+e);return await i.parseAsync(a)}parse(e,t){const i=this.parseAnimations(e.animations),r=this.parseShapes(e.shapes),s=this.parseGeometries(e.geometries,r),o=this.parseImages(e.images,function(){t!==void 0&&t(u)}),a=this.parseTextures(e.textures,o),l=this.parseMaterials(e.materials,a),u=this.parseObject(e.object,s,l,a,i),h=this.parseSkeletons(e.skeletons,u);if(this.bindSkeletons(u,h),t!==void 0){let d=!1;for(const p in o)if(o[p].data instanceof HTMLImageElement){d=!0;break}d===!1&&t(u)}return u}async parseAsync(e){const t=this.parseAnimations(e.animations),i=this.parseShapes(e.shapes),r=this.parseGeometries(e.geometries,i),s=await this.parseImagesAsync(e.images),o=this.parseTextures(e.textures,s),a=this.parseMaterials(e.materials,o),l=this.parseObject(e.object,r,a,o,t),u=this.parseSkeletons(e.skeletons,l);return this.bindSkeletons(l,u),l}parseShapes(e){const t={};if(e!==void 0)for(let i=0,r=e.length;i<r;i++){const s=new qa().fromJSON(e[i]);t[s.uuid]=s}return t}parseSkeletons(e,t){const i={},r={};if(t.traverse(function(s){s.isBone&&(r[s.uuid]=s)}),e!==void 0)for(let s=0,o=e.length;s<o;s++){const a=new Rh().fromJSON(e[s],r);i[a.uuid]=a}return i}parseGeometries(e,t){const i={};if(e!==void 0){const r=new Q2;for(let s=0,o=e.length;s<o;s++){let a;const l=e[s];switch(l.type){case"BufferGeometry":case"InstancedBufferGeometry":a=r.parse(l);break;default:l.type in TT?a=TT[l.type].fromJSON(l,t):console.warn(`THREE.ObjectLoader: Unsupported geometry type "${l.type}"`)}a.uuid=l.uuid,l.name!==void 0&&(a.name=l.name),l.userData!==void 0&&(a.userData=l.userData),i[l.uuid]=a}}return i}parseMaterials(e,t){const i={},r={};if(e!==void 0){const s=new e0;s.setTextures(t);for(let o=0,a=e.length;o<a;o++){const l=e[o];i[l.uuid]===void 0&&(i[l.uuid]=s.parse(l)),r[l.uuid]=i[l.uuid]}}return r}parseAnimations(e){const t={};if(e!==void 0)for(let i=0;i<e.length;i++){const r=e[i],s=tu.parse(r);t[s.uuid]=s}return t}parseImages(e,t){const i=this,r={};let s;function o(l){return i.manager.itemStart(l),s.load(l,function(){i.manager.itemEnd(l)},void 0,function(){i.manager.itemError(l),i.manager.itemEnd(l)})}function a(l){if(typeof l=="string"){const u=l,h=/^(\/\/)|([a-z]+:(\/\/)?)/i.test(u)?u:i.resourcePath+u;return o(h)}else return l.data?{data:gc(l.type,l.data),width:l.width,height:l.height}:null}if(e!==void 0&&e.length>0){const l=new WS(t);s=new uh(l),s.setCrossOrigin(this.crossOrigin);for(let u=0,h=e.length;u<h;u++){const d=e[u],p=d.url;if(Array.isArray(p)){const m=[];for(let y=0,M=p.length;y<M;y++){const _=p[y],g=a(_);g!==null&&(g instanceof HTMLImageElement?m.push(g):m.push(new Ic(g.data,g.width,g.height)))}r[d.uuid]=new Ga(m)}else{const m=a(d.url);r[d.uuid]=new Ga(m)}}}return r}async parseImagesAsync(e){const t=this,i={};let r;async function s(o){if(typeof o=="string"){const a=o,l=/^(\/\/)|([a-z]+:(\/\/)?)/i.test(a)?a:t.resourcePath+a;return await r.loadAsync(l)}else return o.data?{data:gc(o.type,o.data),width:o.width,height:o.height}:null}if(e!==void 0&&e.length>0){r=new uh(this.manager),r.setCrossOrigin(this.crossOrigin);for(let o=0,a=e.length;o<a;o++){const l=e[o],u=l.url;if(Array.isArray(u)){const h=[];for(let d=0,p=u.length;d<p;d++){const m=u[d],y=await s(m);y!==null&&(y instanceof HTMLImageElement?h.push(y):h.push(new Ic(y.data,y.width,y.height)))}i[l.uuid]=new Ga(h)}else{const h=await s(l.url);i[l.uuid]=new Ga(h)}}}return i}parseTextures(e,t){function i(s,o){return typeof s=="number"?s:(console.warn("THREE.ObjectLoader.parseTexture: Constant should be in numeric form.",s),o[s])}const r={};if(e!==void 0)for(let s=0,o=e.length;s<o;s++){const a=e[s];a.image===void 0&&console.warn('THREE.ObjectLoader: No "image" specified for',a.uuid),t[a.image]===void 0&&console.warn("THREE.ObjectLoader: Undefined image",a.image);const l=t[a.image],u=l.data;let h;Array.isArray(u)?(h=new Th,u.length===6&&(h.needsUpdate=!0)):(u&&u.data?h=new Ic:h=new $t,u&&(h.needsUpdate=!0)),h.source=l,h.uuid=a.uuid,a.name!==void 0&&(h.name=a.name),a.mapping!==void 0&&(h.mapping=i(a.mapping,Z4)),a.channel!==void 0&&(h.channel=a.channel),a.offset!==void 0&&h.offset.fromArray(a.offset),a.repeat!==void 0&&h.repeat.fromArray(a.repeat),a.center!==void 0&&h.center.fromArray(a.center),a.rotation!==void 0&&(h.rotation=a.rotation),a.wrap!==void 0&&(h.wrapS=i(a.wrap[0],PT),h.wrapT=i(a.wrap[1],PT)),a.format!==void 0&&(h.format=a.format),a.internalFormat!==void 0&&(h.internalFormat=a.internalFormat),a.type!==void 0&&(h.type=a.type),a.colorSpace!==void 0&&(h.colorSpace=a.colorSpace),a.encoding!==void 0&&(h.encoding=a.encoding),a.minFilter!==void 0&&(h.minFilter=i(a.minFilter,BT)),a.magFilter!==void 0&&(h.magFilter=i(a.magFilter,BT)),a.anisotropy!==void 0&&(h.anisotropy=a.anisotropy),a.flipY!==void 0&&(h.flipY=a.flipY),a.generateMipmaps!==void 0&&(h.generateMipmaps=a.generateMipmaps),a.premultiplyAlpha!==void 0&&(h.premultiplyAlpha=a.premultiplyAlpha),a.unpackAlignment!==void 0&&(h.unpackAlignment=a.unpackAlignment),a.compareFunction!==void 0&&(h.compareFunction=a.compareFunction),a.userData!==void 0&&(h.userData=a.userData),r[a.uuid]=h}return r}parseObject(e,t,i,r,s){let o;function a(p){return t[p]===void 0&&console.warn("THREE.ObjectLoader: Undefined geometry",p),t[p]}function l(p){if(p!==void 0){if(Array.isArray(p)){const m=[];for(let y=0,M=p.length;y<M;y++){const _=p[y];i[_]===void 0&&console.warn("THREE.ObjectLoader: Undefined material",_),m.push(i[_])}return m}return i[p]===void 0&&console.warn("THREE.ObjectLoader: Undefined material",p),i[p]}}function u(p){return r[p]===void 0&&console.warn("THREE.ObjectLoader: Undefined texture",p),r[p]}let h,d;switch(e.type){case"Scene":o=new qm,e.background!==void 0&&(Number.isInteger(e.background)?o.background=new Oe(e.background):o.background=u(e.background)),e.environment!==void 0&&(o.environment=u(e.environment)),e.fog!==void 0&&(e.fog.type==="Fog"?o.fog=new Ng(e.fog.color,e.fog.near,e.fog.far):e.fog.type==="FogExp2"&&(o.fog=new Fg(e.fog.color,e.fog.density))),e.backgroundBlurriness!==void 0&&(o.backgroundBlurriness=e.backgroundBlurriness),e.backgroundIntensity!==void 0&&(o.backgroundIntensity=e.backgroundIntensity);break;case"PerspectiveCamera":o=new qt(e.fov,e.aspect,e.near,e.far),e.focus!==void 0&&(o.focus=e.focus),e.zoom!==void 0&&(o.zoom=e.zoom),e.filmGauge!==void 0&&(o.filmGauge=e.filmGauge),e.filmOffset!==void 0&&(o.filmOffset=e.filmOffset),e.view!==void 0&&(o.view=Object.assign({},e.view));break;case"OrthographicCamera":o=new zr(e.left,e.right,e.top,e.bottom,e.near,e.far),e.zoom!==void 0&&(o.zoom=e.zoom),e.view!==void 0&&(o.view=Object.assign({},e.view));break;case"AmbientLight":o=new X2(e.color,e.intensity);break;case"DirectionalLight":o=new KS(e.color,e.intensity);break;case"PointLight":o=new JS(e.color,e.intensity,e.distance,e.decay);break;case"RectAreaLight":o=new J2(e.color,e.intensity,e.width,e.height);break;case"SpotLight":o=new XS(e.color,e.intensity,e.distance,e.angle,e.penumbra,e.decay);break;case"HemisphereLight":o=new j2(e.color,e.groundColor,e.intensity);break;case"LightProbe":o=new $g().fromJSON(e);break;case"SkinnedMesh":h=a(e.geometry),d=l(e.material),o=new RS(h,d),e.bindMode!==void 0&&(o.bindMode=e.bindMode),e.bindMatrix!==void 0&&o.bindMatrix.fromArray(e.bindMatrix),e.skeleton!==void 0&&(o.skeleton=e.skeleton);break;case"Mesh":h=a(e.geometry),d=l(e.material),o=new Hn(h,d);break;case"InstancedMesh":h=a(e.geometry),d=l(e.material);const p=e.count,m=e.instanceMatrix,y=e.instanceColor;o=new PS(h,d,p),o.instanceMatrix=new qc(new Float32Array(m.array),16),y!==void 0&&(o.instanceColor=new qc(new Float32Array(y.array),y.itemSize));break;case"LOD":o=new A2;break;case"Line":o=new Zs(a(e.geometry),l(e.material));break;case"LineLoop":o=new BS(a(e.geometry),l(e.material));break;case"LineSegments":o=new Jr(a(e.geometry),l(e.material));break;case"PointCloud":case"Points":o=new LS(a(e.geometry),l(e.material));break;case"Sprite":o=new _2(l(e.material));break;case"Group":o=new zs;break;case"Bone":o=new Og;break;default:o=new bt}if(o.uuid=e.uuid,e.name!==void 0&&(o.name=e.name),e.matrix!==void 0?(o.matrix.fromArray(e.matrix),e.matrixAutoUpdate!==void 0&&(o.matrixAutoUpdate=e.matrixAutoUpdate),o.matrixAutoUpdate&&o.matrix.decompose(o.position,o.quaternion,o.scale)):(e.position!==void 0&&o.position.fromArray(e.position),e.rotation!==void 0&&o.rotation.fromArray(e.rotation),e.quaternion!==void 0&&o.quaternion.fromArray(e.quaternion),e.scale!==void 0&&o.scale.fromArray(e.scale)),e.up!==void 0&&o.up.fromArray(e.up),e.castShadow!==void 0&&(o.castShadow=e.castShadow),e.receiveShadow!==void 0&&(o.receiveShadow=e.receiveShadow),e.shadow&&(e.shadow.bias!==void 0&&(o.shadow.bias=e.shadow.bias),e.shadow.normalBias!==void 0&&(o.shadow.normalBias=e.shadow.normalBias),e.shadow.radius!==void 0&&(o.shadow.radius=e.shadow.radius),e.shadow.mapSize!==void 0&&o.shadow.mapSize.fromArray(e.shadow.mapSize),e.shadow.camera!==void 0&&(o.shadow.camera=this.parseObject(e.shadow.camera))),e.visible!==void 0&&(o.visible=e.visible),e.frustumCulled!==void 0&&(o.frustumCulled=e.frustumCulled),e.renderOrder!==void 0&&(o.renderOrder=e.renderOrder),e.userData!==void 0&&(o.userData=e.userData),e.layers!==void 0&&(o.layers.mask=e.layers),e.children!==void 0){const p=e.children;for(let m=0;m<p.length;m++)o.add(this.parseObject(p[m],t,i,r,s))}if(e.animations!==void 0){const p=e.animations;for(let m=0;m<p.length;m++){const y=p[m];o.animations.push(s[y])}}if(e.type==="LOD"){e.autoUpdate!==void 0&&(o.autoUpdate=e.autoUpdate);const p=e.levels;for(let m=0;m<p.length;m++){const y=p[m],M=o.getObjectByProperty("uuid",y.object);M!==void 0&&o.addLevel(M,y.distance,y.hysteresis)}}return o}bindSkeletons(e,t){Object.keys(t).length!==0&&e.traverse(function(i){if(i.isSkinnedMesh===!0&&i.skeleton!==void 0){const r=t[i.skeleton];r===void 0?console.warn("THREE.ObjectLoader: No skeleton found with UUID:",i.skeleton):i.bind(r,i.bindMatrix)}})}}const Z4={UVMapping:bg,CubeReflectionMapping:Xo,CubeRefractionMapping:Jo,EquirectangularReflectionMapping:$f,EquirectangularRefractionMapping:eh,CubeUVReflectionMapping:cu},PT={RepeatWrapping:Ko,ClampToEdgeWrapping:Xn,MirroredRepeatWrapping:Jc},BT={NearestFilter:mn,NearestMipmapNearestFilter:th,NearestMipmapLinearFilter:Bc,LinearFilter:rn,LinearMipmapNearestFilter:Rg,LinearMipmapLinearFilter:vs};class Z2 extends li{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,i,r){e===void 0&&(e=""),this.path!==void 0&&(e=this.path+e),e=this.manager.resolveURL(e);const s=this,o=al.get(e);if(o!==void 0)return s.manager.itemStart(e),setTimeout(function(){t&&t(o),s.manager.itemEnd(e)},0),o;const a={};a.credentials=this.crossOrigin==="anonymous"?"same-origin":"include",a.headers=this.requestHeader,fetch(e,a).then(function(l){return l.blob()}).then(function(l){return createImageBitmap(l,Object.assign(s.options,{colorSpaceConversion:"none"}))}).then(function(l){al.add(e,l),t&&t(l),s.manager.itemEnd(e)}).catch(function(l){r&&r(l),s.manager.itemError(e),s.manager.itemEnd(e)}),s.manager.itemStart(e)}}let Up;class YS{static getContext(){return Up===void 0&&(Up=new(window.AudioContext||window.webkitAudioContext)),Up}static setContext(e){Up=e}}class q4 extends li{constructor(e){super(e)}load(e,t,i,r){const s=this,o=new Yi(this.manager);o.setResponseType("arraybuffer"),o.setPath(this.path),o.setRequestHeader(this.requestHeader),o.setWithCredentials(this.withCredentials),o.load(e,function(l){try{const u=l.slice(0);YS.getContext().decodeAudioData(u,function(d){t(d)},a)}catch(u){a(u)}},i,r);function a(l){r?r(l):console.error(l),s.manager.itemError(e)}}}class $4 extends $g{constructor(e,t,i=1){super(void 0,i),this.isHemisphereLightProbe=!0;const r=new Oe().set(e),s=new Oe().set(t),o=new F(r.r,r.g,r.b),a=new F(s.r,s.g,s.b),l=Math.sqrt(Math.PI),u=l*Math.sqrt(.75);this.sh.coefficients[0].copy(o).add(a).multiplyScalar(l),this.sh.coefficients[1].copy(o).sub(a).multiplyScalar(u)}}class eV extends $g{constructor(e,t=1){super(void 0,t),this.isAmbientLightProbe=!0;const i=new Oe().set(e);this.sh.coefficients[0].set(i.r,i.g,i.b).multiplyScalar(2*Math.sqrt(Math.PI))}}const LT=new rt,IT=new rt,xa=new rt;class tV{constructor(){this.type="StereoCamera",this.aspect=1,this.eyeSep=.064,this.cameraL=new qt,this.cameraL.layers.enable(1),this.cameraL.matrixAutoUpdate=!1,this.cameraR=new qt,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,xa.copy(e.projectionMatrix);const r=t.eyeSep/2,s=r*t.near/t.focus,o=t.near*Math.tan(Qa*t.fov*.5)/t.zoom;let a,l;IT.elements[12]=-r,LT.elements[12]=r,a=-o*t.aspect+s,l=o*t.aspect+s,xa.elements[0]=2*t.near/(l-a),xa.elements[8]=(l+a)/(l-a),this.cameraL.projectionMatrix.copy(xa),a=-o*t.aspect-s,l=o*t.aspect-s,xa.elements[0]=2*t.near/(l-a),xa.elements[8]=(l+a)/(l-a),this.cameraR.projectionMatrix.copy(xa)}this.cameraL.matrixWorld.copy(e.matrixWorld).multiply(IT),this.cameraR.matrixWorld.copy(e.matrixWorld).multiply(LT)}}class QS{constructor(e=!0){this.autoStart=e,this.startTime=0,this.oldTime=0,this.elapsedTime=0,this.running=!1}start(){this.startTime=DT(),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=DT();e=(t-this.oldTime)/1e3,this.oldTime=t,this.elapsedTime+=e}return e}}function DT(){return(typeof performance>"u"?Date:performance).now()}const _a=new F,FT=new Gn,nV=new F,Aa=new F;class iV extends bt{constructor(){super(),this.type="AudioListener",this.context=YS.getContext(),this.gain=this.context.createGain(),this.gain.connect(this.context.destination),this.filter=null,this.timeDelta=0,this._clock=new QS}getInput(){return this.gain}removeFilter(){return this.filter!==null&&(this.gain.disconnect(this.filter),this.filter.disconnect(this.context.destination),this.gain.connect(this.context.destination),this.filter=null),this}getFilter(){return this.filter}setFilter(e){return this.filter!==null?(this.gain.disconnect(this.filter),this.filter.disconnect(this.context.destination)):this.gain.disconnect(this.context.destination),this.filter=e,this.gain.connect(this.filter),this.filter.connect(this.context.destination),this}getMasterVolume(){return this.gain.gain.value}setMasterVolume(e){return this.gain.gain.setTargetAtTime(e,this.context.currentTime,.01),this}updateMatrixWorld(e){super.updateMatrixWorld(e);const t=this.context.listener,i=this.up;if(this.timeDelta=this._clock.getDelta(),this.matrixWorld.decompose(_a,FT,nV),Aa.set(0,0,-1).applyQuaternion(FT),t.positionX){const r=this.context.currentTime+this.timeDelta;t.positionX.linearRampToValueAtTime(_a.x,r),t.positionY.linearRampToValueAtTime(_a.y,r),t.positionZ.linearRampToValueAtTime(_a.z,r),t.forwardX.linearRampToValueAtTime(Aa.x,r),t.forwardY.linearRampToValueAtTime(Aa.y,r),t.forwardZ.linearRampToValueAtTime(Aa.z,r),t.upX.linearRampToValueAtTime(i.x,r),t.upY.linearRampToValueAtTime(i.y,r),t.upZ.linearRampToValueAtTime(i.z,r)}else t.setPosition(_a.x,_a.y,_a.z),t.setOrientation(Aa.x,Aa.y,Aa.z,i.x,i.y,i.z)}}class q2 extends bt{constructor(e){super(),this.type="Audio",this.listener=e,this.context=e.context,this.gain=this.context.createGain(),this.gain.connect(e.getInput()),this.autoplay=!1,this.buffer=null,this.detune=0,this.loop=!1,this.loopStart=0,this.loopEnd=0,this.offset=0,this.duration=void 0,this.playbackRate=1,this.isPlaying=!1,this.hasPlaybackControl=!0,this.source=null,this.sourceType="empty",this._startedAt=0,this._progress=0,this._connected=!1,this.filters=[]}getOutput(){return this.gain}setNodeSource(e){return this.hasPlaybackControl=!1,this.sourceType="audioNode",this.source=e,this.connect(),this}setMediaElementSource(e){return this.hasPlaybackControl=!1,this.sourceType="mediaNode",this.source=this.context.createMediaElementSource(e),this.connect(),this}setMediaStreamSource(e){return this.hasPlaybackControl=!1,this.sourceType="mediaStreamNode",this.source=this.context.createMediaStreamSource(e),this.connect(),this}setBuffer(e){return this.buffer=e,this.sourceType="buffer",this.autoplay&&this.play(),this}play(e=0){if(this.isPlaying===!0){console.warn("THREE.Audio: Audio is already playing.");return}if(this.hasPlaybackControl===!1){console.warn("THREE.Audio: this Audio has no playback control.");return}this._startedAt=this.context.currentTime+e;const t=this.context.createBufferSource();return t.buffer=this.buffer,t.loop=this.loop,t.loopStart=this.loopStart,t.loopEnd=this.loopEnd,t.onended=this.onEnded.bind(this),t.start(this._startedAt,this._progress+this.offset,this.duration),this.isPlaying=!0,this.source=t,this.setDetune(this.detune),this.setPlaybackRate(this.playbackRate),this.connect()}pause(){if(this.hasPlaybackControl===!1){console.warn("THREE.Audio: this Audio has no playback control.");return}return this.isPlaying===!0&&(this._progress+=Math.max(this.context.currentTime-this._startedAt,0)*this.playbackRate,this.loop===!0&&(this._progress=this._progress%(this.duration||this.buffer.duration)),this.source.stop(),this.source.onended=null,this.isPlaying=!1),this}stop(){if(this.hasPlaybackControl===!1){console.warn("THREE.Audio: this Audio has no playback control.");return}return this._progress=0,this.source!==null&&(this.source.stop(),this.source.onended=null),this.isPlaying=!1,this}connect(){if(this.filters.length>0){this.source.connect(this.filters[0]);for(let e=1,t=this.filters.length;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.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){if(this.detune=e,this.source.detune!==void 0)return this.isPlaying===!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}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}}const Sa=new F,NT=new Gn,rV=new F,Ma=new F;class sV extends q2{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,i){return this.panner.coneInnerAngle=e,this.panner.coneOuterAngle=t,this.panner.coneOuterGain=i,this}updateMatrixWorld(e){if(super.updateMatrixWorld(e),this.hasPlaybackControl===!0&&this.isPlaying===!1)return;this.matrixWorld.decompose(Sa,NT,rV),Ma.set(0,0,1).applyQuaternion(NT);const t=this.panner;if(t.positionX){const i=this.context.currentTime+this.listener.timeDelta;t.positionX.linearRampToValueAtTime(Sa.x,i),t.positionY.linearRampToValueAtTime(Sa.y,i),t.positionZ.linearRampToValueAtTime(Sa.z,i),t.orientationX.linearRampToValueAtTime(Ma.x,i),t.orientationY.linearRampToValueAtTime(Ma.y,i),t.orientationZ.linearRampToValueAtTime(Ma.z,i)}else t.setPosition(Sa.x,Sa.y,Sa.z),t.setOrientation(Ma.x,Ma.y,Ma.z)}}class oV{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 i=0;i<t.length;i++)e+=t[i];return e/t.length}}class $2{constructor(e,t,i){this.binding=e,this.valueSize=i;let r,s,o;switch(t){case"quaternion":r=this._slerp,s=this._slerpAdditive,o=this._setAdditiveIdentityQuaternion,this.buffer=new Float64Array(i*6),this._workIndex=5;break;case"string":case"bool":r=this._select,s=this._select,o=this._setAdditiveIdentityOther,this.buffer=new Array(i*5);break;default:r=this._lerp,s=this._lerpAdditive,o=this._setAdditiveIdentityNumeric,this.buffer=new Float64Array(i*5)}this._mixBufferRegion=r,this._mixBufferRegionAdditive=s,this._setIdentity=o,this._origIndex=3,this._addIndex=4,this.cumulativeWeight=0,this.cumulativeWeightAdditive=0,this.useCount=0,this.referenceCount=0}accumulate(e,t){const i=this.buffer,r=this.valueSize,s=e*r+r;let o=this.cumulativeWeight;if(o===0){for(let a=0;a!==r;++a)i[s+a]=i[a];o=t}else{o+=t;const a=t/o;this._mixBufferRegion(i,s,0,a,r)}this.cumulativeWeight=o}accumulateAdditive(e){const t=this.buffer,i=this.valueSize,r=i*this._addIndex;this.cumulativeWeightAdditive===0&&this._setIdentity(),this._mixBufferRegionAdditive(t,r,0,e,i),this.cumulativeWeightAdditive+=e}apply(e){const t=this.valueSize,i=this.buffer,r=e*t+t,s=this.cumulativeWeight,o=this.cumulativeWeightAdditive,a=this.binding;if(this.cumulativeWeight=0,this.cumulativeWeightAdditive=0,s<1){const l=t*this._origIndex;this._mixBufferRegion(i,r,l,1-s,t)}o>0&&this._mixBufferRegionAdditive(i,r,this._addIndex*t,1,t);for(let l=t,u=t+t;l!==u;++l)if(i[l]!==i[l+t]){a.setValue(i,r);break}}saveOriginalState(){const e=this.binding,t=this.buffer,i=this.valueSize,r=i*this._origIndex;e.getValue(t,r);for(let s=i,o=r;s!==o;++s)t[s]=t[r+s%i];this._setIdentity(),this.cumulativeWeight=0,this.cumulativeWeightAdditive=0}restoreOriginalState(){const e=this.valueSize*3;this.binding.setValue(this.buffer,e)}_setAdditiveIdentityNumeric(){const e=this._addIndex*this.valueSize,t=e+this.valueSize;for(let i=e;i<t;i++)this.buffer[i]=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 i=0;i<this.valueSize;i++)this.buffer[t+i]=this.buffer[e+i]}_select(e,t,i,r,s){if(r>=.5)for(let o=0;o!==s;++o)e[t+o]=e[i+o]}_slerp(e,t,i,r){Gn.slerpFlat(e,t,e,t,e,i,r)}_slerpAdditive(e,t,i,r,s){const o=this._workIndex*s;Gn.multiplyQuaternionsFlat(e,o,e,t,e,i),Gn.slerpFlat(e,t,e,t,e,o,r)}_lerp(e,t,i,r,s){const o=1-r;for(let a=0;a!==s;++a){const l=t+a;e[l]=e[l]*o+e[i+a]*r}}_lerpAdditive(e,t,i,r,s){for(let o=0;o!==s;++o){const a=t+o;e[a]=e[a]+e[i+o]*r}}}const ZS="\\[\\]\\.:\\/",aV=new RegExp("["+ZS+"]","g"),qS="[^"+ZS+"]",lV="[^"+ZS.replace("\\.","")+"]",cV=/((?:WC+[\/:])*)/.source.replace("WC",qS),uV=/(WCOD+)?/.source.replace("WCOD",lV),fV=/(?:\.(WC+)(?:\[(.+)\])?)?/.source.replace("WC",qS),hV=/\.(WC+)(?:\[(.+)\])?/.source.replace("WC",qS),dV=new RegExp("^"+cV+uV+fV+hV+"$"),pV=["material","materials","bones","map"];class mV{constructor(e,t,i){const r=i||Ct.parseTrackName(t);this._targetGroup=e,this._bindings=e.subscribe_(t,r)}getValue(e,t){this.bind();const i=this._targetGroup.nCachedObjects_,r=this._bindings[i];r!==void 0&&r.getValue(e,t)}setValue(e,t){const i=this._bindings;for(let r=this._targetGroup.nCachedObjects_,s=i.length;r!==s;++r)i[r].setValue(e,t)}bind(){const e=this._bindings;for(let t=this._targetGroup.nCachedObjects_,i=e.length;t!==i;++t)e[t].bind()}unbind(){const e=this._bindings;for(let t=this._targetGroup.nCachedObjects_,i=e.length;t!==i;++t)e[t].unbind()}}class Ct{constructor(e,t,i){this.path=t,this.parsedPath=i||Ct.parseTrackName(t),this.node=Ct.findNode(e,this.parsedPath.nodeName),this.rootNode=e,this.getValue=this._getValue_unbound,this.setValue=this._setValue_unbound}static create(e,t,i){return e&&e.isAnimationObjectGroup?new Ct.Composite(e,t,i):new Ct(e,t,i)}static sanitizeNodeName(e){return e.replace(/\s/g,"_").replace(aV,"")}static parseTrackName(e){const t=dV.exec(e);if(t===null)throw new Error("PropertyBinding: Cannot parse trackName: "+e);const i={nodeName:t[2],objectName:t[3],objectIndex:t[4],propertyName:t[5],propertyIndex:t[6]},r=i.nodeName&&i.nodeName.lastIndexOf(".");if(r!==void 0&&r!==-1){const s=i.nodeName.substring(r+1);pV.indexOf(s)!==-1&&(i.nodeName=i.nodeName.substring(0,r),i.objectName=s)}if(i.propertyName===null||i.propertyName.length===0)throw new Error("PropertyBinding: can not parse propertyName from trackName: "+e);return i}static findNode(e,t){if(t===void 0||t===""||t==="."||t===-1||t===e.name||t===e.uuid)return e;if(e.skeleton){const i=e.skeleton.getBoneByName(t);if(i!==void 0)return i}if(e.children){const i=function(s){for(let o=0;o<s.length;o++){const a=s[o];if(a.name===t||a.uuid===t)return a;const l=i(a.children);if(l)return l}return null},r=i(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 i=this.resolvedProperty;for(let r=0,s=i.length;r!==s;++r)e[t++]=i[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 i=this.resolvedProperty;for(let r=0,s=i.length;r!==s;++r)i[r]=e[t++]}_setValue_array_setNeedsUpdate(e,t){const i=this.resolvedProperty;for(let r=0,s=i.length;r!==s;++r)i[r]=e[t++];this.targetObject.needsUpdate=!0}_setValue_array_setMatrixWorldNeedsUpdate(e,t){const i=this.resolvedProperty;for(let r=0,s=i.length;r!==s;++r)i[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,i=t.objectName,r=t.propertyName;let s=t.propertyIndex;if(e||(e=Ct.findNode(this.rootNode,t.nodeName),this.node=e),this.getValue=this._getValue_unavailable,this.setValue=this._setValue_unavailable,!e){console.error("THREE.PropertyBinding: Trying to update node for track: "+this.path+" but it wasn't found.");return}if(i){let u=t.objectIndex;switch(i){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 h=0;h<e.length;h++)if(e[h].name===u){u=h;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[i]===void 0){console.error("THREE.PropertyBinding: Can not bind to objectName of node undefined.",this);return}e=e[i]}if(u!==void 0){if(e[u]===void 0){console.error("THREE.PropertyBinding: Trying to bind to objectIndex of objectName, but is undefined.",this,e);return}e=e[u]}}const o=e[r];if(o===void 0){const u=t.nodeName;console.error("THREE.PropertyBinding: Trying to update property for track: "+u+"."+r+" but it wasn't found.",e);return}let a=this.Versioning.None;this.targetObject=e,e.needsUpdate!==void 0?a=this.Versioning.NeedsUpdate:e.matrixWorldNeedsUpdate!==void 0&&(a=this.Versioning.MatrixWorldNeedsUpdate);let l=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])}l=this.BindingType.ArrayElement,this.resolvedProperty=o,this.propertyIndex=s}else o.fromArray!==void 0&&o.toArray!==void 0?(l=this.BindingType.HasFromToArray,this.resolvedProperty=o):Array.isArray(o)?(l=this.BindingType.EntireArray,this.resolvedProperty=o):this.propertyName=r;this.getValue=this.GetterByBindingType[l],this.setValue=this.SetterByBindingTypeAndVersioning[l][a]}unbind(){this.node=null,this.getValue=this._getValue_unbound,this.setValue=this._setValue_unbound}}Ct.Composite=mV;Ct.prototype.BindingType={Direct:0,EntireArray:1,ArrayElement:2,HasFromToArray:3};Ct.prototype.Versioning={None:0,NeedsUpdate:1,MatrixWorldNeedsUpdate:2};Ct.prototype.GetterByBindingType=[Ct.prototype._getValue_direct,Ct.prototype._getValue_array,Ct.prototype._getValue_arrayElement,Ct.prototype._getValue_toArray];Ct.prototype.SetterByBindingTypeAndVersioning=[[Ct.prototype._setValue_direct,Ct.prototype._setValue_direct_setNeedsUpdate,Ct.prototype._setValue_direct_setMatrixWorldNeedsUpdate],[Ct.prototype._setValue_array,Ct.prototype._setValue_array_setNeedsUpdate,Ct.prototype._setValue_array_setMatrixWorldNeedsUpdate],[Ct.prototype._setValue_arrayElement,Ct.prototype._setValue_arrayElement_setNeedsUpdate,Ct.prototype._setValue_arrayElement_setMatrixWorldNeedsUpdate],[Ct.prototype._setValue_fromArray,Ct.prototype._setValue_fromArray_setNeedsUpdate,Ct.prototype._setValue_fromArray_setMatrixWorldNeedsUpdate]];class gV{constructor(){this.isAnimationObjectGroup=!0,this.uuid=Ji(),this._objects=Array.prototype.slice.call(arguments),this.nCachedObjects_=0;const e={};this._indicesByUUID=e;for(let i=0,r=arguments.length;i!==r;++i)e[arguments[i].uuid]=i;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,i=this._paths,r=this._parsedPaths,s=this._bindings,o=s.length;let a,l=e.length,u=this.nCachedObjects_;for(let h=0,d=arguments.length;h!==d;++h){const p=arguments[h],m=p.uuid;let y=t[m];if(y===void 0){y=l++,t[m]=y,e.push(p);for(let M=0,_=o;M!==_;++M)s[M].push(new Ct(p,i[M],r[M]))}else if(y<u){a=e[y];const M=--u,_=e[M];t[_.uuid]=y,e[y]=_,t[m]=M,e[M]=p;for(let g=0,x=o;g!==x;++g){const S=s[g],E=S[M];let C=S[y];S[y]=E,C===void 0&&(C=new Ct(p,i[g],r[g])),S[M]=C}}else e[y]!==a&&console.error("THREE.AnimationObjectGroup: Different objects with the same UUID detected. Clean the caches or recreate your infrastructure when reloading scenes.")}this.nCachedObjects_=u}remove(){const e=this._objects,t=this._indicesByUUID,i=this._bindings,r=i.length;let s=this.nCachedObjects_;for(let o=0,a=arguments.length;o!==a;++o){const l=arguments[o],u=l.uuid,h=t[u];if(h!==void 0&&h>=s){const d=s++,p=e[d];t[p.uuid]=h,e[h]=p,t[u]=d,e[d]=l;for(let m=0,y=r;m!==y;++m){const M=i[m],_=M[d],g=M[h];M[h]=_,M[d]=g}}}this.nCachedObjects_=s}uncache(){const e=this._objects,t=this._indicesByUUID,i=this._bindings,r=i.length;let s=this.nCachedObjects_,o=e.length;for(let a=0,l=arguments.length;a!==l;++a){const u=arguments[a],h=u.uuid,d=t[h];if(d!==void 0)if(delete t[h],d<s){const p=--s,m=e[p],y=--o,M=e[y];t[m.uuid]=d,e[d]=m,t[M.uuid]=p,e[p]=M,e.pop();for(let _=0,g=r;_!==g;++_){const x=i[_],S=x[p],E=x[y];x[d]=S,x[p]=E,x.pop()}}else{const p=--o,m=e[p];p>0&&(t[m.uuid]=d),e[d]=m,e.pop();for(let y=0,M=r;y!==M;++y){const _=i[y];_[d]=_[p],_.pop()}}}this.nCachedObjects_=s}subscribe_(e,t){const i=this._bindingsIndicesByPath;let r=i[e];const s=this._bindings;if(r!==void 0)return s[r];const o=this._paths,a=this._parsedPaths,l=this._objects,u=l.length,h=this.nCachedObjects_,d=new Array(u);r=s.length,i[e]=r,o.push(e),a.push(t),s.push(d);for(let p=h,m=l.length;p!==m;++p){const y=l[p];d[p]=new Ct(y,e,t)}return d}unsubscribe_(e){const t=this._bindingsIndicesByPath,i=t[e];if(i!==void 0){const r=this._paths,s=this._parsedPaths,o=this._bindings,a=o.length-1,l=o[a],u=e[a];t[u]=i,o[i]=l,o.pop(),s[i]=s[a],s.pop(),r[i]=r[a],r.pop()}}}class eL{constructor(e,t,i=null,r=t.blendMode){this._mixer=e,this._clip=t,this._localRoot=i,this.blendMode=r;const s=t.tracks,o=s.length,a=new Array(o),l={endingStart:Ha,endingEnd:Ha};for(let u=0;u!==o;++u){const h=s[u].createInterpolant(null);a[u]=h,h.settings=l}this._interpolantSettings=l,this._interpolants=a,this._propertyBindings=new Array(o),this._cacheIndex=null,this._byClipCacheIndex=null,this._timeScaleInterpolant=null,this._weightInterpolant=null,this.loop=VB,this._loopCount=-1,this._startTime=null,this.time=0,this.timeScale=1,this._effectiveTimeScale=1,this.weight=1,this._effectiveWeight=1,this.repetitions=1/0,this.paused=!1,this.enabled=!0,this.clampWhenFinished=!1,this.zeroSlopeAtStart=!0,this.zeroSlopeAtEnd=!0}play(){return this._mixer._activateAction(this),this}stop(){return this._mixer._deactivateAction(this),this.reset()}reset(){return this.paused=!1,this.enabled=!0,this.time=0,this._loopCount=-1,this._startTime=null,this.stopFading().stopWarping()}isRunning(){return this.enabled&&!this.paused&&this.timeScale!==0&&this._startTime===null&&this._mixer._isActiveAction(this)}isScheduled(){return this._mixer._isActiveAction(this)}startAt(e){return this._startTime=e,this}setLoop(e,t){return this.loop=e,this.repetitions=t,this}setEffectiveWeight(e){return this.weight=e,this._effectiveWeight=this.enabled?e:0,this.stopFading()}getEffectiveWeight(){return this._effectiveWeight}fadeIn(e){return this._scheduleFading(e,0,1)}fadeOut(e){return this._scheduleFading(e,1,0)}crossFadeFrom(e,t,i){if(e.fadeOut(t),this.fadeIn(t),i){const r=this._clip.duration,s=e._clip.duration,o=s/r,a=r/s;e.warp(1,o,t),this.warp(a,1,t)}return this}crossFadeTo(e,t,i){return e.crossFadeFrom(this,t,i)}stopFading(){const e=this._weightInterpolant;return e!==null&&(this._weightInterpolant=null,this._mixer._takeBackControlInterpolant(e)),this}setEffectiveTimeScale(e){return this.timeScale=e,this._effectiveTimeScale=this.paused?0:e,this.stopWarping()}getEffectiveTimeScale(){return this._effectiveTimeScale}setDuration(e){return this.timeScale=this._clip.duration/e,this.stopWarping()}syncWith(e){return this.time=e.time,this.timeScale=e.timeScale,this.stopWarping()}halt(e){return this.warp(this._effectiveTimeScale,0,e)}warp(e,t,i){const r=this._mixer,s=r.time,o=this.timeScale;let a=this._timeScaleInterpolant;a===null&&(a=r._lendControlInterpolant(),this._timeScaleInterpolant=a);const l=a.parameterPositions,u=a.sampleValues;return l[0]=s,l[1]=s+i,u[0]=e/o,u[1]=t/o,this}stopWarping(){const e=this._timeScaleInterpolant;return e!==null&&(this._timeScaleInterpolant=null,this._mixer._takeBackControlInterpolant(e)),this}getMixer(){return this._mixer}getClip(){return this._clip}getRoot(){return this._localRoot||this._mixer._root}_update(e,t,i,r){if(!this.enabled){this._updateWeight(e);return}const s=this._startTime;if(s!==null){const l=(e-s)*i;l<0||i===0?t=0:(this._startTime=null,t=i*l)}t*=this._updateTimeScale(e);const o=this._updateTime(t),a=this._updateWeight(e);if(a>0){const l=this._interpolants,u=this._propertyBindings;switch(this.blendMode){case dS:for(let h=0,d=l.length;h!==d;++h)l[h].evaluate(o),u[h].accumulateAdditive(a);break;case Bg:default:for(let h=0,d=l.length;h!==d;++h)l[h].evaluate(o),u[h].accumulate(r,a)}}}_updateWeight(e){let t=0;if(this.enabled){t=this.weight;const i=this._weightInterpolant;if(i!==null){const r=i.evaluate(e)[0];t*=r,e>i.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 i=this._timeScaleInterpolant;if(i!==null){const r=i.evaluate(e)[0];t*=r,e>i.parameterPositions[1]&&(this.stopWarping(),t===0?this.paused=!0:this.timeScale=t)}}return this._effectiveTimeScale=t,t}_updateTime(e){const t=this._clip.duration,i=this.loop;let r=this.time+e,s=this._loopCount;const o=i===WB;if(e===0)return s===-1?r:o&&(s&1)===1?t-r:r;if(i===GB){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,o)):this._setEndings(this.repetitions===0,!0,o)),r>=t||r<0){const a=Math.floor(r/t);r-=t*a,s+=Math.abs(a);const l=this.repetitions-s;if(l<=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(l===1){const u=e<0;this._setEndings(u,!u,o)}else this._setEndings(!1,!1,o);this._loopCount=s,this.time=r,this._mixer.dispatchEvent({type:"loop",action:this,loopDelta:a})}}else this.time=r;if(o&&(s&1)===1)return t-r}return r}_setEndings(e,t,i){const r=this._interpolantSettings;i?(r.endingStart=za,r.endingEnd=za):(e?r.endingStart=this.zeroSlopeAtStart?za:Ha:r.endingStart=nh,t?r.endingEnd=this.zeroSlopeAtEnd?za:Ha:r.endingEnd=nh)}_scheduleFading(e,t,i){const r=this._mixer,s=r.time;let o=this._weightInterpolant;o===null&&(o=r._lendControlInterpolant(),this._weightInterpolant=o);const a=o.parameterPositions,l=o.sampleValues;return a[0]=s,l[0]=t,a[1]=s+e,l[1]=i,this}}const vV=new Float32Array(1);class yV extends xs{constructor(e){super(),this._root=e,this._initMemoryManager(),this._accuIndex=0,this.time=0,this.timeScale=1}_bindAction(e,t){const i=e._localRoot||this._root,r=e._clip.tracks,s=r.length,o=e._propertyBindings,a=e._interpolants,l=i.uuid,u=this._bindingsByRootAndName;let h=u[l];h===void 0&&(h={},u[l]=h);for(let d=0;d!==s;++d){const p=r[d],m=p.name;let y=h[m];if(y!==void 0)++y.referenceCount,o[d]=y;else{if(y=o[d],y!==void 0){y._cacheIndex===null&&(++y.referenceCount,this._addInactiveBinding(y,l,m));continue}const M=t&&t._propertyBindings[d].binding.parsedPath;y=new $2(Ct.create(i,m,M),p.ValueTypeName,p.getValueSize()),++y.referenceCount,this._addInactiveBinding(y,l,m),o[d]=y}a[d].resultBuffer=y.buffer}}_activateAction(e){if(!this._isActiveAction(e)){if(e._cacheIndex===null){const i=(e._localRoot||this._root).uuid,r=e._clip.uuid,s=this._actionsByClip[r];this._bindAction(e,s&&s.knownActions[0]),this._addInactiveAction(e,r,i)}const t=e._propertyBindings;for(let i=0,r=t.length;i!==r;++i){const s=t[i];s.useCount++===0&&(this._lendBinding(s),s.saveOriginalState())}this._lendAction(e)}}_deactivateAction(e){if(this._isActiveAction(e)){const t=e._propertyBindings;for(let i=0,r=t.length;i!==r;++i){const s=t[i];--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,i){const r=this._actions,s=this._actionsByClip;let o=s[t];if(o===void 0)o={knownActions:[e],actionByRoot:{}},e._byClipCacheIndex=0,s[t]=o;else{const a=o.knownActions;e._byClipCacheIndex=a.length,a.push(e)}e._cacheIndex=r.length,r.push(e),o.actionByRoot[i]=e}_removeInactiveAction(e){const t=this._actions,i=t[t.length-1],r=e._cacheIndex;i._cacheIndex=r,t[r]=i,t.pop(),e._cacheIndex=null;const s=e._clip.uuid,o=this._actionsByClip,a=o[s],l=a.knownActions,u=l[l.length-1],h=e._byClipCacheIndex;u._byClipCacheIndex=h,l[h]=u,l.pop(),e._byClipCacheIndex=null;const d=a.actionByRoot,p=(e._localRoot||this._root).uuid;delete d[p],l.length===0&&delete o[s],this._removeInactiveBindingsForAction(e)}_removeInactiveBindingsForAction(e){const t=e._propertyBindings;for(let i=0,r=t.length;i!==r;++i){const s=t[i];--s.referenceCount===0&&this._removeInactiveBinding(s)}}_lendAction(e){const t=this._actions,i=e._cacheIndex,r=this._nActiveActions++,s=t[r];e._cacheIndex=r,t[r]=e,s._cacheIndex=i,t[i]=s}_takeBackAction(e){const t=this._actions,i=e._cacheIndex,r=--this._nActiveActions,s=t[r];e._cacheIndex=r,t[r]=e,s._cacheIndex=i,t[i]=s}_addInactiveBinding(e,t,i){const r=this._bindingsByRootAndName,s=this._bindings;let o=r[t];o===void 0&&(o={},r[t]=o),o[i]=e,e._cacheIndex=s.length,s.push(e)}_removeInactiveBinding(e){const t=this._bindings,i=e.binding,r=i.rootNode.uuid,s=i.path,o=this._bindingsByRootAndName,a=o[r],l=t[t.length-1],u=e._cacheIndex;l._cacheIndex=u,t[u]=l,t.pop(),delete a[s],Object.keys(a).length===0&&delete o[r]}_lendBinding(e){const t=this._bindings,i=e._cacheIndex,r=this._nActiveBindings++,s=t[r];e._cacheIndex=r,t[r]=e,s._cacheIndex=i,t[i]=s}_takeBackBinding(e){const t=this._bindings,i=e._cacheIndex,r=--this._nActiveBindings,s=t[r];e._cacheIndex=r,t[r]=e,s._cacheIndex=i,t[i]=s}_lendControlInterpolant(){const e=this._controlInterpolants,t=this._nActiveControlInterpolants++;let i=e[t];return i===void 0&&(i=new GS(new Float32Array(2),new Float32Array(2),1,vV),i.__cacheIndex=t,e[t]=i),i}_takeBackControlInterpolant(e){const t=this._controlInterpolants,i=e.__cacheIndex,r=--this._nActiveControlInterpolants,s=t[r];e.__cacheIndex=r,t[r]=e,s.__cacheIndex=i,t[i]=s}clipAction(e,t,i){const r=t||this._root,s=r.uuid;let o=typeof e=="string"?tu.findByName(r,e):e;const a=o!==null?o.uuid:e,l=this._actionsByClip[a];let u=null;if(i===void 0&&(o!==null?i=o.blendMode:i=Bg),l!==void 0){const d=l.actionByRoot[s];if(d!==void 0&&d.blendMode===i)return d;u=l.knownActions[0],o===null&&(o=u._clip)}if(o===null)return null;const h=new eL(this,o,t,i);return this._bindAction(h,u),this._addInactiveAction(h,a,s),h}existingAction(e,t){const i=t||this._root,r=i.uuid,s=typeof e=="string"?tu.findByName(i,e):e,o=s?s.uuid:e,a=this._actionsByClip[o];return a!==void 0&&a.actionByRoot[r]||null}stopAllAction(){const e=this._actions,t=this._nActiveActions;for(let i=t-1;i>=0;--i)e[i].stop();return this}update(e){e*=this.timeScale;const t=this._actions,i=this._nActiveActions,r=this.time+=e,s=Math.sign(e),o=this._accuIndex^=1;for(let u=0;u!==i;++u)t[u]._update(r,e,s,o);const a=this._bindings,l=this._nActiveBindings;for(let u=0;u!==l;++u)a[u].apply(o);return this}setTime(e){this.time=0;for(let t=0;t<this._actions.length;t++)this._actions[t].time=0;return this.update(e)}getRoot(){return this._root}uncacheClip(e){const t=this._actions,i=e.uuid,r=this._actionsByClip,s=r[i];if(s!==void 0){const o=s.knownActions;for(let a=0,l=o.length;a!==l;++a){const u=o[a];this._deactivateAction(u);const h=u._cacheIndex,d=t[t.length-1];u._cacheIndex=null,u._byClipCacheIndex=null,d._cacheIndex=h,t[h]=d,t.pop(),this._removeInactiveBindingsForAction(u)}delete r[i]}}uncacheRoot(e){const t=e.uuid,i=this._actionsByClip;for(const o in i){const a=i[o].actionByRoot,l=a[t];l!==void 0&&(this._deactivateAction(l),this._removeInactiveAction(l))}const r=this._bindingsByRootAndName,s=r[t];if(s!==void 0)for(const o in s){const a=s[o];a.restoreOriginalState(),this._removeInactiveBinding(a)}}uncacheAction(e,t){const i=this.existingAction(e,t);i!==null&&(this._deactivateAction(i),this._removeInactiveAction(i))}}class $S{constructor(e){this.value=e}clone(){return new $S(this.value.clone===void 0?this.value:this.value.clone())}}let xV=0;class _V extends xs{constructor(){super(),this.isUniformsGroup=!0,Object.defineProperty(this,"id",{value:xV++}),this.name="",this.usage=ih,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 i=0,r=t.length;i<r;i++)this.uniforms.push(t[i].clone());return this}clone(){return new this.constructor().copy(this)}}class AV extends bh{constructor(e,t,i=1){super(e,t),this.isInstancedInterleavedBuffer=!0,this.meshPerAttribute=i}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 SV{constructor(e,t,i,r,s){this.isGLBufferAttribute=!0,this.name="",this.buffer=e,this.type=t,this.itemSize=i,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}}class tL{constructor(e,t,i=0,r=1/0){this.ray=new uu(e,t),this.near=i,this.far=r,this.camera=null,this.layers=new Za,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)}intersectObject(e,t=!0,i=[]){return F_(e,this,i,t),i.sort(OT),i}intersectObjects(e,t=!0,i=[]){for(let r=0,s=e.length;r<s;r++)F_(e[r],this,i,t);return i.sort(OT),i}}function OT(n,e){return n.distance-e.distance}function F_(n,e,t,i){if(n.layers.test(e.layers)&&n.raycast(e,t),i===!0){const r=n.children;for(let s=0,o=r.length;s<o;s++)F_(r[s],e,t,!0)}}class N_{constructor(e=1,t=0,i=0){return this.radius=e,this.phi=t,this.theta=i,this}set(e,t,i){return this.radius=e,this.phi=t,this.theta=i,this}copy(e){return this.radius=e.radius,this.phi=e.phi,this.theta=e.theta,this}makeSafe(){return this.phi=Math.max(1e-6,Math.min(Math.PI-1e-6,this.phi)),this}setFromVector3(e){return this.setFromCartesianCoords(e.x,e.y,e.z)}setFromCartesianCoords(e,t,i){return this.radius=Math.sqrt(e*e+t*t+i*i),this.radius===0?(this.theta=0,this.phi=0):(this.theta=Math.atan2(e,i),this.phi=Math.acos(gn(t/this.radius,-1,1))),this}clone(){return new this.constructor().copy(this)}}class MV{constructor(e=1,t=0,i=0){return this.radius=e,this.theta=t,this.y=i,this}set(e,t,i){return this.radius=e,this.theta=t,this.y=i,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,i){return this.radius=Math.sqrt(e*e+i*i),this.theta=Math.atan2(e,i),this.y=t,this}clone(){return new this.constructor().copy(this)}}const UT=new ge;class EV{constructor(e=new ge(1/0,1/0),t=new ge(-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,i=e.length;t<i;t++)this.expandByPoint(e[t]);return this}setFromCenterAndSize(e,t){const i=UT.copy(t).multiplyScalar(.5);return this.min.copy(e).sub(i),this.max.copy(e).add(i),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,UT).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 kT=new F,kp=new F;class wV{constructor(e=new F,t=new F){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){kT.subVectors(e,this.start),kp.subVectors(this.end,this.start);const i=kp.dot(kp);let s=kp.dot(kT)/i;return t&&(s=gn(s,0,1)),s}closestPointToPoint(e,t,i){const r=this.closestPointToPointParameter(e,t);return this.delta(i).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 HT=new F;class TV extends bt{constructor(e,t){super(),this.light=e,this.matrix=e.matrixWorld,this.matrixAutoUpdate=!1,this.color=t,this.type="SpotLightHelper";const i=new gt,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 o=0,a=1,l=32;o<l;o++,a++){const u=o/l*Math.PI*2,h=a/l*Math.PI*2;r.push(Math.cos(u),Math.sin(u),1,Math.cos(h),Math.sin(h),1)}i.setAttribute("position",new Ye(r,3));const s=new ai({fog:!1,toneMapped:!1});this.cone=new Jr(i,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);const e=this.light.distance?this.light.distance:1e3,t=e*Math.tan(this.light.angle);this.cone.scale.set(t,t,e),HT.setFromMatrixPosition(this.light.target.matrixWorld),this.cone.lookAt(HT),this.color!==void 0?this.cone.material.color.set(this.color):this.cone.material.color.copy(this.light.color)}}const vo=new F,Hp=new rt,Ay=new rt;class CV extends Jr{constructor(e){const t=nL(e),i=new gt,r=[],s=[],o=new Oe(0,0,1),a=new Oe(0,1,0);for(let u=0;u<t.length;u++){const h=t[u];h.parent&&h.parent.isBone&&(r.push(0,0,0),r.push(0,0,0),s.push(o.r,o.g,o.b),s.push(a.r,a.g,a.b))}i.setAttribute("position",new Ye(r,3)),i.setAttribute("color",new Ye(s,3));const l=new ai({vertexColors:!0,depthTest:!1,depthWrite:!1,toneMapped:!1,transparent:!0});super(i,l),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,i=this.geometry,r=i.getAttribute("position");Ay.copy(this.root.matrixWorld).invert();for(let s=0,o=0;s<t.length;s++){const a=t[s];a.parent&&a.parent.isBone&&(Hp.multiplyMatrices(Ay,a.matrixWorld),vo.setFromMatrixPosition(Hp),r.setXYZ(o,vo.x,vo.y,vo.z),Hp.multiplyMatrices(Ay,a.parent.matrixWorld),vo.setFromMatrixPosition(Hp),r.setXYZ(o+1,vo.x,vo.y,vo.z),o+=2)}i.getAttribute("position").needsUpdate=!0,super.updateMatrixWorld(e)}dispose(){this.geometry.dispose(),this.material.dispose()}}function nL(n){const e=[];n.isBone===!0&&e.push(n);for(let t=0;t<n.children.length;t++)e.push.apply(e,nL(n.children[t]));return e}class bV extends Hn{constructor(e,t,i){const r=new Ih(t,4,2),s=new ji({wireframe:!0,fog:!1,toneMapped:!1});super(r,s),this.light=e,this.color=i,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 RV=new F,zT=new Oe,GT=new Oe;class PV extends bt{constructor(e,t,i){super(),this.light=e,this.matrix=e.matrixWorld,this.matrixAutoUpdate=!1,this.color=i,this.type="HemisphereLightHelper";const r=new Lh(t);r.rotateY(Math.PI*.5),this.material=new ji({wireframe:!0,fog:!1,toneMapped:!1}),this.color===void 0&&(this.material.vertexColors=!0);const s=r.getAttribute("position"),o=new Float32Array(s.count*3);r.setAttribute("color",new Dt(o,3)),this.add(new Hn(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");zT.copy(this.light.color),GT.copy(this.light.groundColor);for(let i=0,r=t.count;i<r;i++){const s=i<r/2?zT:GT;t.setXYZ(i,s.r,s.g,s.b)}t.needsUpdate=!0}this.light.updateWorldMatrix(!0,!1),e.lookAt(RV.setFromMatrixPosition(this.light.matrixWorld).negate())}}class BV extends Jr{constructor(e=10,t=10,i=4473924,r=8947848){i=new Oe(i),r=new Oe(r);const s=t/2,o=e/t,a=e/2,l=[],u=[];for(let p=0,m=0,y=-a;p<=t;p++,y+=o){l.push(-a,0,y,a,0,y),l.push(y,0,-a,y,0,a);const M=p===s?i:r;M.toArray(u,m),m+=3,M.toArray(u,m),m+=3,M.toArray(u,m),m+=3,M.toArray(u,m),m+=3}const h=new gt;h.setAttribute("position",new Ye(l,3)),h.setAttribute("color",new Ye(u,3));const d=new ai({vertexColors:!0,toneMapped:!1});super(h,d),this.type="GridHelper"}dispose(){this.geometry.dispose(),this.material.dispose()}}class LV extends Jr{constructor(e=10,t=16,i=8,r=64,s=4473924,o=8947848){s=new Oe(s),o=new Oe(o);const a=[],l=[];if(t>1)for(let d=0;d<t;d++){const p=d/t*(Math.PI*2),m=Math.sin(p)*e,y=Math.cos(p)*e;a.push(0,0,0),a.push(m,0,y);const M=d&1?s:o;l.push(M.r,M.g,M.b),l.push(M.r,M.g,M.b)}for(let d=0;d<i;d++){const p=d&1?s:o,m=e-e/i*d;for(let y=0;y<r;y++){let M=y/r*(Math.PI*2),_=Math.sin(M)*m,g=Math.cos(M)*m;a.push(_,0,g),l.push(p.r,p.g,p.b),M=(y+1)/r*(Math.PI*2),_=Math.sin(M)*m,g=Math.cos(M)*m,a.push(_,0,g),l.push(p.r,p.g,p.b)}}const u=new gt;u.setAttribute("position",new Ye(a,3)),u.setAttribute("color",new Ye(l,3));const h=new ai({vertexColors:!0,toneMapped:!1});super(u,h),this.type="PolarGridHelper"}dispose(){this.geometry.dispose(),this.material.dispose()}}const VT=new F,zp=new F,WT=new F;class IV extends bt{constructor(e,t,i){super(),this.light=e,this.matrix=e.matrixWorld,this.matrixAutoUpdate=!1,this.color=i,this.type="DirectionalLightHelper",t===void 0&&(t=1);let r=new gt;r.setAttribute("position",new Ye([-t,t,0,t,t,0,t,-t,0,-t,-t,0,-t,t,0],3));const s=new ai({fog:!1,toneMapped:!1});this.lightPlane=new Zs(r,s),this.add(this.lightPlane),r=new gt,r.setAttribute("position",new Ye([0,0,0,0,0,1],3)),this.targetLine=new Zs(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),VT.setFromMatrixPosition(this.light.matrixWorld),zp.setFromMatrixPosition(this.light.target.matrixWorld),WT.subVectors(zp,VT),this.lightPlane.lookAt(zp),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(zp),this.targetLine.scale.z=WT.length()}}const Gp=new F,dn=new wh;class DV extends Jr{constructor(e){const t=new gt,i=new ai({color:16777215,vertexColors:!0,toneMapped:!1}),r=[],s=[],o={};a("n1","n2"),a("n2","n4"),a("n4","n3"),a("n3","n1"),a("f1","f2"),a("f2","f4"),a("f4","f3"),a("f3","f1"),a("n1","f1"),a("n2","f2"),a("n3","f3"),a("n4","f4"),a("p","n1"),a("p","n2"),a("p","n3"),a("p","n4"),a("u1","u2"),a("u2","u3"),a("u3","u1"),a("c","t"),a("p","c"),a("cn1","cn2"),a("cn3","cn4"),a("cf1","cf2"),a("cf3","cf4");function a(y,M){l(y),l(M)}function l(y){r.push(0,0,0),s.push(0,0,0),o[y]===void 0&&(o[y]=[]),o[y].push(r.length/3-1)}t.setAttribute("position",new Ye(r,3)),t.setAttribute("color",new Ye(s,3)),super(t,i),this.type="CameraHelper",this.camera=e,this.camera.updateProjectionMatrix&&this.camera.updateProjectionMatrix(),this.matrix=e.matrixWorld,this.matrixAutoUpdate=!1,this.pointMap=o,this.update();const u=new Oe(16755200),h=new Oe(16711680),d=new Oe(43775),p=new Oe(16777215),m=new Oe(3355443);this.setColors(u,h,d,p,m)}setColors(e,t,i,r,s){const a=this.geometry.getAttribute("color");a.setXYZ(0,e.r,e.g,e.b),a.setXYZ(1,e.r,e.g,e.b),a.setXYZ(2,e.r,e.g,e.b),a.setXYZ(3,e.r,e.g,e.b),a.setXYZ(4,e.r,e.g,e.b),a.setXYZ(5,e.r,e.g,e.b),a.setXYZ(6,e.r,e.g,e.b),a.setXYZ(7,e.r,e.g,e.b),a.setXYZ(8,e.r,e.g,e.b),a.setXYZ(9,e.r,e.g,e.b),a.setXYZ(10,e.r,e.g,e.b),a.setXYZ(11,e.r,e.g,e.b),a.setXYZ(12,e.r,e.g,e.b),a.setXYZ(13,e.r,e.g,e.b),a.setXYZ(14,e.r,e.g,e.b),a.setXYZ(15,e.r,e.g,e.b),a.setXYZ(16,e.r,e.g,e.b),a.setXYZ(17,e.r,e.g,e.b),a.setXYZ(18,e.r,e.g,e.b),a.setXYZ(19,e.r,e.g,e.b),a.setXYZ(20,e.r,e.g,e.b),a.setXYZ(21,e.r,e.g,e.b),a.setXYZ(22,e.r,e.g,e.b),a.setXYZ(23,e.r,e.g,e.b),a.setXYZ(24,t.r,t.g,t.b),a.setXYZ(25,t.r,t.g,t.b),a.setXYZ(26,t.r,t.g,t.b),a.setXYZ(27,t.r,t.g,t.b),a.setXYZ(28,t.r,t.g,t.b),a.setXYZ(29,t.r,t.g,t.b),a.setXYZ(30,t.r,t.g,t.b),a.setXYZ(31,t.r,t.g,t.b),a.setXYZ(32,i.r,i.g,i.b),a.setXYZ(33,i.r,i.g,i.b),a.setXYZ(34,i.r,i.g,i.b),a.setXYZ(35,i.r,i.g,i.b),a.setXYZ(36,i.r,i.g,i.b),a.setXYZ(37,i.r,i.g,i.b),a.setXYZ(38,r.r,r.g,r.b),a.setXYZ(39,r.r,r.g,r.b),a.setXYZ(40,s.r,s.g,s.b),a.setXYZ(41,s.r,s.g,s.b),a.setXYZ(42,s.r,s.g,s.b),a.setXYZ(43,s.r,s.g,s.b),a.setXYZ(44,s.r,s.g,s.b),a.setXYZ(45,s.r,s.g,s.b),a.setXYZ(46,s.r,s.g,s.b),a.setXYZ(47,s.r,s.g,s.b),a.setXYZ(48,s.r,s.g,s.b),a.setXYZ(49,s.r,s.g,s.b),a.needsUpdate=!0}update(){const e=this.geometry,t=this.pointMap,i=1,r=1;dn.projectionMatrixInverse.copy(this.camera.projectionMatrixInverse),yn("c",t,e,dn,0,0,-1),yn("t",t,e,dn,0,0,1),yn("n1",t,e,dn,-i,-r,-1),yn("n2",t,e,dn,i,-r,-1),yn("n3",t,e,dn,-i,r,-1),yn("n4",t,e,dn,i,r,-1),yn("f1",t,e,dn,-i,-r,1),yn("f2",t,e,dn,i,-r,1),yn("f3",t,e,dn,-i,r,1),yn("f4",t,e,dn,i,r,1),yn("u1",t,e,dn,i*.7,r*1.1,-1),yn("u2",t,e,dn,-i*.7,r*1.1,-1),yn("u3",t,e,dn,0,r*2,-1),yn("cf1",t,e,dn,-i,0,1),yn("cf2",t,e,dn,i,0,1),yn("cf3",t,e,dn,0,-r,1),yn("cf4",t,e,dn,0,r,1),yn("cn1",t,e,dn,-i,0,-1),yn("cn2",t,e,dn,i,0,-1),yn("cn3",t,e,dn,0,-r,-1),yn("cn4",t,e,dn,0,r,-1),e.getAttribute("position").needsUpdate=!0}dispose(){this.geometry.dispose(),this.material.dispose()}}function yn(n,e,t,i,r,s,o){Gp.set(r,s,o).unproject(i);const a=e[n];if(a!==void 0){const l=t.getAttribute("position");for(let u=0,h=a.length;u<h;u++)l.setXYZ(a[u],Gp.x,Gp.y,Gp.z)}}const Vp=new Xr;class FV extends Jr{constructor(e,t=16776960){const i=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 gt;s.setIndex(new Dt(i,1)),s.setAttribute("position",new Dt(r,3)),super(s,new ai({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&&Vp.setFromObject(this.object),Vp.isEmpty())return;const t=Vp.min,i=Vp.max,r=this.geometry.attributes.position,s=r.array;s[0]=i.x,s[1]=i.y,s[2]=i.z,s[3]=t.x,s[4]=i.y,s[5]=i.z,s[6]=t.x,s[7]=t.y,s[8]=i.z,s[9]=i.x,s[10]=t.y,s[11]=i.z,s[12]=i.x,s[13]=i.y,s[14]=t.z,s[15]=t.x,s[16]=i.y,s[17]=t.z,s[18]=t.x,s[19]=t.y,s[20]=t.z,s[21]=i.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 NV extends Jr{constructor(e,t=16776960){const i=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 gt;s.setIndex(new Dt(i,1)),s.setAttribute("position",new Ye(r,3)),super(s,new ai({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 OV extends Zs{constructor(e,t=1,i=16776960){const r=i,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],o=new gt;o.setAttribute("position",new Ye(s,3)),o.computeBoundingSphere(),super(o,new ai({color:r,toneMapped:!1})),this.type="PlaneHelper",this.plane=e,this.size=t;const a=[1,1,0,-1,1,0,-1,-1,0,1,1,0,-1,-1,0,1,-1,0],l=new gt;l.setAttribute("position",new Ye(a,3)),l.computeBoundingSphere(),this.add(new Hn(l,new ji({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 jT=new F;let Wp,Sy;class UV extends bt{constructor(e=new F(0,0,1),t=new F(0,0,0),i=1,r=16776960,s=i*.2,o=s*.2){super(),this.type="ArrowHelper",Wp===void 0&&(Wp=new gt,Wp.setAttribute("position",new Ye([0,0,0,0,1,0],3)),Sy=new hu(0,.5,1,5,1),Sy.translate(0,-.5,0)),this.position.copy(t),this.line=new Zs(Wp,new ai({color:r,toneMapped:!1})),this.line.matrixAutoUpdate=!1,this.add(this.line),this.cone=new Hn(Sy,new ji({color:r,toneMapped:!1})),this.cone.matrixAutoUpdate=!1,this.add(this.cone),this.setDirection(e),this.setLength(i,s,o)}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{jT.set(e.z,0,-e.x).normalize();const t=Math.acos(e.y);this.quaternion.setFromAxisAngle(jT,t)}}setLength(e,t=e*.2,i=t*.2){this.line.scale.set(1,Math.max(1e-4,e-t),1),this.line.updateMatrix(),this.cone.scale.set(i,t,i),this.cone.position.y=e,this.cone.updateMatrix()}setColor(e){this.line.material.color.set(e),this.cone.material.color.set(e)}copy(e){return super.copy(e,!1),this.line.copy(e.line),this.cone.copy(e.cone),this}dispose(){this.line.geometry.dispose(),this.line.material.dispose(),this.cone.geometry.dispose(),this.cone.material.dispose()}}class kV extends Jr{constructor(e=1){const t=[0,0,0,e,0,0,0,0,0,0,e,0,0,0,0,0,0,e],i=[1,0,0,1,.6,0,0,1,0,.6,1,0,0,0,1,0,.6,1],r=new gt;r.setAttribute("position",new Ye(t,3)),r.setAttribute("color",new Ye(i,3));const s=new ai({vertexColors:!0,toneMapped:!1});super(r,s),this.type="AxesHelper"}setColors(e,t,i){const r=new Oe,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(i),r.toArray(s,12),r.toArray(s,15),this.geometry.attributes.color.needsUpdate=!0,this}dispose(){this.geometry.dispose(),this.material.dispose()}}class HV{constructor(){this.type="ShapePath",this.color=new Oe,this.subPaths=[],this.currentPath=null}moveTo(e,t){return this.currentPath=new oh,this.subPaths.push(this.currentPath),this.currentPath.moveTo(e,t),this}lineTo(e,t){return this.currentPath.lineTo(e,t),this}quadraticCurveTo(e,t,i,r){return this.currentPath.quadraticCurveTo(e,t,i,r),this}bezierCurveTo(e,t,i,r,s,o){return this.currentPath.bezierCurveTo(e,t,i,r,s,o),this}splineThru(e){return this.currentPath.splineThru(e),this}toShapes(e){function t(g){const x=[];for(let S=0,E=g.length;S<E;S++){const C=g[S],b=new qa;b.curves=C.curves,x.push(b)}return x}function i(g,x){const S=x.length;let E=!1;for(let C=S-1,b=0;b<S;C=b++){let P=x[C],B=x[b],R=B.x-P.x,L=B.y-P.y;if(Math.abs(L)>Number.EPSILON){if(L<0&&(P=x[b],R=-R,B=x[C],L=-L),g.y<P.y||g.y>B.y)continue;if(g.y===P.y){if(g.x===P.x)return!0}else{const z=L*(g.x-P.x)-R*(g.y-P.y);if(z===0)return!0;if(z<0)continue;E=!E}}else{if(g.y!==P.y)continue;if(B.x<=g.x&&g.x<=P.x||P.x<=g.x&&g.x<=B.x)return!0}}return E}const r=ds.isClockWise,s=this.subPaths;if(s.length===0)return[];let o,a,l;const u=[];if(s.length===1)return a=s[0],l=new qa,l.curves=a.curves,u.push(l),u;let h=!r(s[0].getPoints());h=e?!h:h;const d=[],p=[];let m=[],y=0,M;p[y]=void 0,m[y]=[];for(let g=0,x=s.length;g<x;g++)a=s[g],M=a.getPoints(),o=r(M),o=e?!o:o,o?(!h&&p[y]&&y++,p[y]={s:new qa,p:M},p[y].s.curves=a.curves,h&&y++,m[y]=[]):m[y].push({h:a,p:M[0]});if(!p[0])return t(s);if(p.length>1){let g=!1,x=0;for(let S=0,E=p.length;S<E;S++)d[S]=[];for(let S=0,E=p.length;S<E;S++){const C=m[S];for(let b=0;b<C.length;b++){const P=C[b];let B=!0;for(let R=0;R<p.length;R++)i(P.p,p[R].p)&&(S!==R&&x++,B?(B=!1,d[R].push(P)):g=!0);B&&d[S].push(P)}}x>0&&g===!1&&(m=d)}let _;for(let g=0,x=p.length;g<x;g++){l=p[g].s,u.push(l),_=m[g];for(let S=0,E=_.length;S<E;S++)l.holes.push(_[S].h)}return u}}typeof __THREE_DEVTOOLS__<"u"&&__THREE_DEVTOOLS__.dispatchEvent(new CustomEvent("register",{detail:{revision:Sh}}));typeof window<"u"&&(window.__THREE__?console.warn("WARNING: Multiple instances of Three.js being imported."):window.__THREE__=Sh);const zV=Object.freeze(Object.defineProperty({__proto__:null,ACESFilmicToneMapping:oS,AddEquation:Da,AddOperation:bB,AdditiveAnimationBlendMode:dS,AdditiveBlending:$x,AlphaFormat:FB,AlwaysCompare:i2,AlwaysDepth:AB,AlwaysStencilFunc:YB,AmbientLight:X2,AmbientLightProbe:eV,AnimationAction:eL,AnimationClip:tu,AnimationLoader:V4,AnimationMixer:yV,AnimationObjectGroup:gV,AnimationUtils:k4,ArcCurve:S2,ArrayCamera:g2,ArrowHelper:UV,Audio:q2,AudioAnalyser:oV,AudioContext:YS,AudioListener:iV,AudioLoader:q4,AxesHelper:kV,BackSide:vi,BasicDepthPacking:XB,BasicShadowMap:aB,Bone:Og,BooleanKeyframeTrack:fl,Box2:EV,Box3:Xr,Box3Helper:NV,BoxGeometry:ul,BoxHelper:FV,BufferAttribute:Dt,BufferGeometry:gt,BufferGeometryLoader:Q2,ByteType:IB,Cache:al,Camera:wh,CameraHelper:DV,CanvasTexture:c4,CapsuleGeometry:Hg,CatmullRomCurve3:M2,CineonToneMapping:BB,CircleGeometry:zg,ClampToEdgeWrapping:Xn,Clock:QS,Color:Oe,ColorKeyframeTrack:VS,ColorManagement:ur,CompressedArrayTexture:l4,CompressedTexture:IS,CompressedTextureLoader:W4,ConeGeometry:Gg,CubeCamera:SS,CubeReflectionMapping:Xo,CubeRefractionMapping:Jo,CubeTexture:Th,CubeTextureLoader:j4,CubeUVReflectionMapping:cu,CubicBezierCurve:FS,CubicBezierCurve3:E2,CubicInterpolant:z2,CullFaceBack:qx,CullFaceFront:oB,CullFaceFrontBack:aO,CullFaceNone:sB,Curve:Kr,CurvePath:T2,CustomBlending:lB,CustomToneMapping:LB,CylinderGeometry:hu,Cylindrical:MV,Data3DTexture:xS,DataArrayTexture:Lg,DataTexture:Ic,DataTextureLoader:X4,DataUtils:mU,DecrementStencilOp:gO,DecrementWrapStencilOp:yO,DefaultLoadingManager:xc,DepthFormat:Uo,DepthStencilFormat:rl,DepthTexture:v2,DirectionalLight:KS,DirectionalLightHelper:IV,DiscreteInterpolant:G2,DisplayP3ColorSpace:gS,DodecahedronGeometry:Vg,DoubleSide:vr,DstAlphaFactor:mB,DstColorFactor:vB,DynamicCopyUsage:LO,DynamicDrawUsage:Ya,DynamicReadUsage:RO,EdgesGeometry:C2,EllipseCurve:Ug,EqualCompare:qB,EqualDepth:MB,EqualStencilFunc:SO,EquirectangularReflectionMapping:$f,EquirectangularRefractionMapping:eh,Euler:Eh,EventDispatcher:xs,ExtrudeGeometry:jg,FileLoader:Yi,Float16BufferAttribute:AU,Float32BufferAttribute:Ye,Float64BufferAttribute:SU,FloatType:ls,Fog:Ng,FogExp2:Fg,FramebufferTexture:a4,FrontSide:gs,Frustum:Ig,GLBufferAttribute:SV,GLSL1:DO,GLSL3:C_,GreaterCompare:e2,GreaterDepth:wB,GreaterEqualCompare:n2,GreaterEqualDepth:EB,GreaterEqualStencilFunc:TO,GreaterStencilFunc:EO,GridHelper:BV,Group:zs,HalfFloatType:Kc,HemisphereLight:j2,HemisphereLightHelper:PV,HemisphereLightProbe:$4,IcosahedronGeometry:Xg,ImageBitmapLoader:Z2,ImageLoader:uh,ImageUtils:yS,IncrementStencilOp:mO,IncrementWrapStencilOp:vO,InstancedBufferAttribute:qc,InstancedBufferGeometry:Y2,InstancedInterleavedBuffer:AV,InstancedMesh:PS,Int16BufferAttribute:xU,Int32BufferAttribute:_U,Int8BufferAttribute:gU,IntType:aS,InterleavedBuffer:bh,InterleavedBufferAttribute:Yo,Interpolant:du,InterpolateDiscrete:Yc,InterpolateLinear:sl,InterpolateSmooth:gm,InvertStencilOp:xO,KeepStencilOp:vm,KeyframeTrack:Yr,LOD:A2,LatheGeometry:Bh,Layers:Za,LessCompare:ZB,LessDepth:SB,LessEqualCompare:$B,LessEqualDepth:Km,LessEqualStencilFunc:MO,LessStencilFunc:AO,Light:ra,LightProbe:$g,Line:Zs,Line3:wV,LineBasicMaterial:ai,LineCurve:kg,LineCurve3:w2,LineDashedMaterial:k2,LineLoop:BS,LineSegments:Jr,LinearEncoding:mS,LinearFilter:rn,LinearInterpolant:GS,LinearMipMapLinearFilter:hO,LinearMipMapNearestFilter:fO,LinearMipmapLinearFilter:vs,LinearMipmapNearestFilter:Rg,LinearSRGBColorSpace:Vr,LinearToneMapping:RB,Loader:li,LoaderUtils:ps,LoadingManager:WS,LoopOnce:GB,LoopPingPong:WB,LoopRepeat:VB,LuminanceAlphaFormat:OB,LuminanceFormat:NB,MOUSE:Ra,Material:Cn,MaterialLoader:e0,MathUtils:s2,Matrix3:_t,Matrix4:rt,MaxEquation:i_,Mesh:Hn,MeshBasicMaterial:ji,MeshDepthMaterial:wS,MeshDistanceMaterial:TS,MeshLambertMaterial:O2,MeshMatcapMaterial:U2,MeshNormalMaterial:N2,MeshPhongMaterial:D2,MeshPhysicalMaterial:_s,MeshStandardMaterial:Dh,MeshToonMaterial:F2,MinEquation:n_,MirroredRepeatWrapping:Jc,MixOperation:CB,MultiplyBlending:t_,MultiplyOperation:Mh,NearestFilter:mn,NearestMipMapLinearFilter:uO,NearestMipMapNearestFilter:cO,NearestMipmapLinearFilter:Bc,NearestMipmapNearestFilter:th,NeverCompare:QB,NeverDepth:_B,NeverStencilFunc:_O,NoBlending:Ws,NoColorSpace:Ho,NoToneMapping:Hr,NormalAnimationBlendMode:Bg,NormalBlending:Ka,NotEqualCompare:t2,NotEqualDepth:TB,NotEqualStencilFunc:wO,NumberKeyframeTrack:$c,Object3D:bt,ObjectLoader:Q4,ObjectSpaceNormalMap:KB,OctahedronGeometry:Lh,OneFactor:hB,OneMinusDstAlphaFactor:gB,OneMinusDstColorFactor:yB,OneMinusSrcAlphaFactor:sS,OneMinusSrcColorFactor:pB,OrthographicCamera:zr,PCFShadowMap:Cg,PCFSoftShadowMap:Tf,PMREMGenerator:R_,Path:oh,PerspectiveCamera:qt,Plane:So,PlaneGeometry:Ch,PlaneHelper:OV,PointLight:JS,PointLightHelper:bV,Points:LS,PointsMaterial:Ph,PolarGridHelper:LV,PolyhedronGeometry:ia,PositionalAudio:sV,PropertyBinding:Ct,PropertyMixer:$2,QuadraticBezierCurve:NS,QuadraticBezierCurve3:OS,Quaternion:Gn,QuaternionKeyframeTrack:Qo,QuaternionLinearInterpolant:V2,RED_GREEN_RGTC2_Format:w_,RED_RGTC1_Format:zB,REVISION:Sh,RGBADepthPacking:JB,RGBAFormat:Ti,RGBAIntegerFormat:hS,RGBA_ASTC_10x10_Format:A_,RGBA_ASTC_10x5_Format:y_,RGBA_ASTC_10x6_Format:x_,RGBA_ASTC_10x8_Format:__,RGBA_ASTC_12x10_Format:S_,RGBA_ASTC_12x12_Format:M_,RGBA_ASTC_4x4_Format:u_,RGBA_ASTC_5x4_Format:f_,RGBA_ASTC_5x5_Format:h_,RGBA_ASTC_6x5_Format:d_,RGBA_ASTC_6x6_Format:p_,RGBA_ASTC_8x5_Format:m_,RGBA_ASTC_8x6_Format:g_,RGBA_ASTC_8x8_Format:v_,RGBA_BPTC_Format:mm,RGBA_ETC2_EAC_Format:c_,RGBA_PVRTC_2BPPV1_Format:a_,RGBA_PVRTC_4BPPV1_Format:o_,RGBA_S3TC_DXT1_Format:hm,RGBA_S3TC_DXT3_Format:dm,RGBA_S3TC_DXT5_Format:pm,RGB_ETC1_Format:HB,RGB_ETC2_Format:l_,RGB_PVRTC_2BPPV1_Format:s_,RGB_PVRTC_4BPPV1_Format:r_,RGB_S3TC_DXT1_Format:fm,RGFormat:kB,RGIntegerFormat:fS,RawShaderMaterial:I2,Ray:uu,Raycaster:tL,RectAreaLight:J2,RedFormat:UB,RedIntegerFormat:uS,ReinhardToneMapping:PB,RepeatWrapping:Ko,ReplaceStencilOp:pO,ReverseSubtractEquation:uB,RingGeometry:Jg,SIGNED_RED_GREEN_RGTC2_Format:T_,SIGNED_RED_RGTC1_Format:E_,SRGBColorSpace:mt,Scene:qm,ShaderChunk:yt,ShaderLib:Fr,ShaderMaterial:ys,ShadowMaterial:L2,Shape:qa,ShapeGeometry:Kg,ShapePath:HV,ShapeUtils:ds,ShortType:DB,Skeleton:Rh,SkeletonHelper:CV,SkinnedMesh:RS,Source:Ga,Sphere:Sr,SphereGeometry:Ih,Spherical:N_,SphericalHarmonics3:K2,SplineCurve:US,SpotLight:XS,SpotLightHelper:TV,Sprite:_2,SpriteMaterial:bS,SrcAlphaFactor:rS,SrcAlphaSaturateFactor:xB,SrcColorFactor:dB,StaticCopyUsage:BO,StaticDrawUsage:ih,StaticReadUsage:bO,StereoCamera:tV,StreamCopyUsage:IO,StreamDrawUsage:CO,StreamReadUsage:PO,StringKeyframeTrack:hl,SubtractEquation:cB,SubtractiveBlending:e_,TOUCH:Pa,TangentSpaceNormalMap:na,TetrahedronGeometry:Yg,Texture:$t,TextureLoader:W2,TorusGeometry:Qg,TorusKnotGeometry:Zg,Triangle:wi,TriangleFanDrawMode:Ym,TriangleStripDrawMode:pS,TrianglesDrawMode:jB,TubeGeometry:qg,TwoPassDoubleSide:lO,UVMapping:bg,Uint16BufferAttribute:_S,Uint32BufferAttribute:AS,Uint8BufferAttribute:vU,Uint8ClampedBufferAttribute:yU,Uniform:$S,UniformsGroup:_V,UniformsLib:Fe,UniformsUtils:c2,UnsignedByteType:hs,UnsignedInt248Type:Oo,UnsignedIntType:Hs,UnsignedShort4444Type:lS,UnsignedShort5551Type:cS,UnsignedShortType:Pg,VSMShadowMap:Lr,Vector2:ge,Vector3:F,Vector4:Nt,VectorKeyframeTrack:eu,VideoTexture:o4,WebGL1Renderer:y2,WebGL3DRenderTarget:rU,WebGLArrayRenderTarget:iU,WebGLCoordinateSystem:cs,WebGLCubeRenderTarget:MS,WebGLMultipleRenderTargets:sU,WebGLRenderTarget:Wr,WebGLRenderer:CS,WebGLUtils:m2,WebGPUCoordinateSystem:rh,WireframeGeometry:B2,WrapAroundEnding:nh,ZeroCurvatureEnding:Ha,ZeroFactor:fB,ZeroSlopeEnding:za,ZeroStencilOp:dO,_SRGBAFormat:Qm,sRGBEncoding:ko},Symbol.toStringTag,{value:"Module"}));var iL={exports:{}},dl={};/**
 * @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.
 */dl.ConcurrentRoot=1;dl.ContinuousEventPriority=4;dl.DefaultEventPriority=16;dl.DiscreteEventPriority=1;dl.IdleEventPriority=536870912;dl.LegacyRoot=0;iL.exports=dl;var _c=iL.exports;function GV(n){let e;const t=new Set,i=(u,h)=>{const d=typeof u=="function"?u(e):u;if(d!==e){const p=e;e=h?d:Object.assign({},e,d),t.forEach(m=>m(e,p))}},r=()=>e,s=(u,h=r,d=Object.is)=>{console.warn("[DEPRECATED] Please use `subscribeWithSelector` middleware");let p=h(e);function m(){const y=h(e);if(!d(p,y)){const M=p;u(p=y,M)}}return t.add(m),()=>t.delete(m)},l={setState:i,getState:r,subscribe:(u,h,d)=>h||d?s(u,h,d):(t.add(u),()=>t.delete(u)),destroy:()=>t.clear()};return e=n(i,r,l),l}const VV=typeof window>"u"||!window.navigator||/ServerSideRendering|^Deno\//.test(window.navigator.userAgent),XT=VV?J.useEffect:J.useLayoutEffect;function rL(n){const e=typeof n=="function"?GV(n):n,t=(i=e.getState,r=Object.is)=>{const[,s]=J.useReducer(_=>_+1,0),o=e.getState(),a=J.useRef(o),l=J.useRef(i),u=J.useRef(r),h=J.useRef(!1),d=J.useRef();d.current===void 0&&(d.current=i(o));let p,m=!1;(a.current!==o||l.current!==i||u.current!==r||h.current)&&(p=i(o),m=!r(d.current,p)),XT(()=>{m&&(d.current=p),a.current=o,l.current=i,u.current=r,h.current=!1});const y=J.useRef(o);XT(()=>{const _=()=>{try{const x=e.getState(),S=l.current(x);u.current(d.current,S)||(a.current=x,d.current=S,s())}catch{h.current=!0,s()}},g=e.subscribe(_);return e.getState()!==y.current&&_(),g},[]);const M=m?p:d.current;return J.useDebugValue(M),M};return Object.assign(t,e),t[Symbol.iterator]=function(){console.warn("[useStore, api] = create() is deprecated and will be removed in v4");const i=[t,e];return{next(){const r=i.length<=0;return{value:i.shift(),done:r}}}},t}var sL={exports:{}},My={exports:{}},Ey={};/**
 * @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 JT;function WV(){return JT||(JT=1,function(n){function e(I,V){var H=I.length;I.push(V);e:for(;0<H;){var U=H-1>>>1,W=I[U];if(0<r(W,V))I[U]=V,I[H]=W,H=U;else break e}}function t(I){return I.length===0?null:I[0]}function i(I){if(I.length===0)return null;var V=I[0],H=I.pop();if(H!==V){I[0]=H;e:for(var U=0,W=I.length,ve=W>>>1;U<ve;){var ue=2*(U+1)-1,Ae=I[ue],Ee=ue+1,Ne=I[Ee];if(0>r(Ae,H))Ee<W&&0>r(Ne,Ae)?(I[U]=Ne,I[Ee]=H,U=Ee):(I[U]=Ae,I[ue]=H,U=ue);else if(Ee<W&&0>r(Ne,H))I[U]=Ne,I[Ee]=H,U=Ee;else break e}}return V}function r(I,V){var H=I.sortIndex-V.sortIndex;return H!==0?H:I.id-V.id}if(typeof performance=="object"&&typeof performance.now=="function"){var s=performance;n.unstable_now=function(){return s.now()}}else{var o=Date,a=o.now();n.unstable_now=function(){return o.now()-a}}var l=[],u=[],h=1,d=null,p=3,m=!1,y=!1,M=!1,_=typeof setTimeout=="function"?setTimeout:null,g=typeof clearTimeout=="function"?clearTimeout:null,x=typeof setImmediate<"u"?setImmediate:null;typeof navigator<"u"&&navigator.scheduling!==void 0&&navigator.scheduling.isInputPending!==void 0&&navigator.scheduling.isInputPending.bind(navigator.scheduling);function S(I){for(var V=t(u);V!==null;){if(V.callback===null)i(u);else if(V.startTime<=I)i(u),V.sortIndex=V.expirationTime,e(l,V);else break;V=t(u)}}function E(I){if(M=!1,S(I),!y)if(t(l)!==null)y=!0,ne(C);else{var V=t(u);V!==null&&ee(E,V.startTime-I)}}function C(I,V){y=!1,M&&(M=!1,g(B),B=-1),m=!0;var H=p;try{for(S(V),d=t(l);d!==null&&(!(d.expirationTime>V)||I&&!z());){var U=d.callback;if(typeof U=="function"){d.callback=null,p=d.priorityLevel;var W=U(d.expirationTime<=V);V=n.unstable_now(),typeof W=="function"?d.callback=W:d===t(l)&&i(l),S(V)}else i(l);d=t(l)}if(d!==null)var ve=!0;else{var ue=t(u);ue!==null&&ee(E,ue.startTime-V),ve=!1}return ve}finally{d=null,p=H,m=!1}}var b=!1,P=null,B=-1,R=5,L=-1;function z(){return!(n.unstable_now()-L<R)}function $(){if(P!==null){var I=n.unstable_now();L=I;var V=!0;try{V=P(!0,I)}finally{V?X():(b=!1,P=null)}}else b=!1}var X;if(typeof x=="function")X=function(){x($)};else if(typeof MessageChannel<"u"){var Q=new MessageChannel,Y=Q.port2;Q.port1.onmessage=$,X=function(){Y.postMessage(null)}}else X=function(){_($,0)};function ne(I){P=I,b||(b=!0,X())}function ee(I,V){B=_(function(){I(n.unstable_now())},V)}n.unstable_IdlePriority=5,n.unstable_ImmediatePriority=1,n.unstable_LowPriority=4,n.unstable_NormalPriority=3,n.unstable_Profiling=null,n.unstable_UserBlockingPriority=2,n.unstable_cancelCallback=function(I){I.callback=null},n.unstable_continueExecution=function(){y||m||(y=!0,ne(C))},n.unstable_forceFrameRate=function(I){0>I||125<I?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):R=0<I?Math.floor(1e3/I):5},n.unstable_getCurrentPriorityLevel=function(){return p},n.unstable_getFirstCallbackNode=function(){return t(l)},n.unstable_next=function(I){switch(p){case 1:case 2:case 3:var V=3;break;default:V=p}var H=p;p=V;try{return I()}finally{p=H}},n.unstable_pauseExecution=function(){},n.unstable_requestPaint=function(){},n.unstable_runWithPriority=function(I,V){switch(I){case 1:case 2:case 3:case 4:case 5:break;default:I=3}var H=p;p=I;try{return V()}finally{p=H}},n.unstable_scheduleCallback=function(I,V,H){var U=n.unstable_now();switch(typeof H=="object"&&H!==null?(H=H.delay,H=typeof H=="number"&&0<H?U+H:U):H=U,I){case 1:var W=-1;break;case 2:W=250;break;case 5:W=1073741823;break;case 4:W=1e4;break;default:W=5e3}return W=H+W,I={id:h++,callback:V,priorityLevel:I,startTime:H,expirationTime:W,sortIndex:-1},H>U?(I.sortIndex=H,e(u,I),t(l)===null&&I===t(u)&&(M?(g(B),B=-1):M=!0,ee(E,H-U))):(I.sortIndex=W,e(l,I),y||m||(y=!0,ne(C))),I},n.unstable_shouldYield=z,n.unstable_wrapCallback=function(I){var V=p;return function(){var H=p;p=V;try{return I.apply(this,arguments)}finally{p=H}}}}(Ey)),Ey}var KT;function jV(){return KT||(KT=1,My.exports=WV()),My.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 XV=function(e){var t={},i=J,r=jV(),s=Object.assign;function o(c){for(var f="https://reactjs.org/docs/error-decoder.html?invariant="+c,v=1;v<arguments.length;v++)f+="&args[]="+encodeURIComponent(arguments[v]);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 a=i.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED,l=Symbol.for("react.element"),u=Symbol.for("react.portal"),h=Symbol.for("react.fragment"),d=Symbol.for("react.strict_mode"),p=Symbol.for("react.profiler"),m=Symbol.for("react.provider"),y=Symbol.for("react.context"),M=Symbol.for("react.forward_ref"),_=Symbol.for("react.suspense"),g=Symbol.for("react.suspense_list"),x=Symbol.for("react.memo"),S=Symbol.for("react.lazy"),E=Symbol.for("react.offscreen"),C=Symbol.iterator;function b(c){return c===null||typeof c!="object"?null:(c=C&&c[C]||c["@@iterator"],typeof c=="function"?c:null)}function P(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 h:return"Fragment";case u:return"Portal";case p:return"Profiler";case d:return"StrictMode";case _:return"Suspense";case g:return"SuspenseList"}if(typeof c=="object")switch(c.$$typeof){case y:return(c.displayName||"Context")+".Consumer";case m:return(c._context.displayName||"Context")+".Provider";case M:var f=c.render;return c=c.displayName,c||(c=f.displayName||f.name||"",c=c!==""?"ForwardRef("+c+")":"ForwardRef"),c;case x:return f=c.displayName||null,f!==null?f:P(c.type)||"Memo";case S:f=c._payload,c=c._init;try{return P(c(f))}catch{}}return null}function B(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 P(f);case 8:return f===d?"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 R(c){var f=c,v=c;if(c.alternate)for(;f.return;)f=f.return;else{c=f;do f=c,f.flags&4098&&(v=f.return),c=f.return;while(c)}return f.tag===3?v:null}function L(c){if(R(c)!==c)throw Error(o(188))}function z(c){var f=c.alternate;if(!f){if(f=R(c),f===null)throw Error(o(188));return f!==c?null:c}for(var v=c,A=f;;){var w=v.return;if(w===null)break;var T=w.alternate;if(T===null){if(A=w.return,A!==null){v=A;continue}break}if(w.child===T.child){for(T=w.child;T;){if(T===v)return L(w),c;if(T===A)return L(w),f;T=T.sibling}throw Error(o(188))}if(v.return!==A.return)v=w,A=T;else{for(var O=!1,Z=w.child;Z;){if(Z===v){O=!0,v=w,A=T;break}if(Z===A){O=!0,A=w,v=T;break}Z=Z.sibling}if(!O){for(Z=T.child;Z;){if(Z===v){O=!0,v=T,A=w;break}if(Z===A){O=!0,A=T,v=w;break}Z=Z.sibling}if(!O)throw Error(o(189))}}if(v.alternate!==A)throw Error(o(190))}if(v.tag!==3)throw Error(o(188));return v.stateNode.current===v?c:f}function $(c){return c=z(c),c!==null?X(c):null}function X(c){if(c.tag===5||c.tag===6)return c;for(c=c.child;c!==null;){var f=X(c);if(f!==null)return f;c=c.sibling}return null}function Q(c){if(c.tag===5||c.tag===6)return c;for(c=c.child;c!==null;){if(c.tag!==4){var f=Q(c);if(f!==null)return f}c=c.sibling}return null}var Y=Array.isArray,ne=e.getPublicInstance,ee=e.getRootHostContext,I=e.getChildHostContext,V=e.prepareForCommit,H=e.resetAfterCommit,U=e.createInstance,W=e.appendInitialChild,ve=e.finalizeInitialChildren,ue=e.prepareUpdate,Ae=e.shouldSetTextContent,Ee=e.createTextInstance,Ne=e.scheduleTimeout,We=e.cancelTimeout,ct=e.noTimeout,tt=e.isPrimaryRenderer,Se=e.supportsMutation,G=e.supportsPersistence,ye=e.supportsHydration,pe=e.getInstanceFromNode,Me=e.preparePortalMount,xe=e.getCurrentEventPriority,Ve=e.detachDeletedInstance,Ue=e.supportsMicrotasks,Ge=e.scheduleMicrotask,qe=e.supportsTestSelectors,vt=e.findFiberRoot,Ut=e.getBoundingRect,k=e.getTextContent,D=e.isHiddenSubtree,le=e.matchAccessibilityRole,we=e.setFocusIfFocusable,_e=e.setupIntersectionObserver,De=e.appendChild,Ke=e.appendChildToContainer,Le=e.commitTextUpdate,he=e.commitMount,j=e.commitUpdate,fe=e.insertBefore,Te=e.insertInContainerBefore,be=e.removeChild,Ie=e.removeChildFromContainer,nt=e.resetTextContent,Rt=e.hideInstance,K=e.hideTextInstance,Pe=e.unhideInstance,oe=e.unhideTextInstance,Be=e.clearContainer,He=e.cloneInstance,wt=e.createContainerChildSet,Gt=e.appendChildToContainerChildSet,_n=e.finalizeContainerChildren,Li=e.replaceContainerChildren,jt=e.cloneHiddenInstance,Ii=e.cloneHiddenTextInstance,Vn=e.canHydrateInstance,Wh=e.canHydrateTextInstance,jh=e.canHydrateSuspenseInstance,Xh=e.isSuspenseInstancePending,to=e.isSuspenseInstanceFallback,Jh=e.registerSuspenseInstanceRetry,Qr=e.getNextHydratableSibling,Kh=e.getFirstHydratableChild,u0=e.getFirstHydratableChildWithinContainer,f0=e.getFirstHydratableChildWithinSuspenseInstance,h0=e.hydrateInstance,N=e.hydrateTextInstance,re=e.hydrateSuspenseInstance,de=e.getNextHydratableInstanceAfterSuspenseInstance,te=e.commitHydratedContainer,me=e.commitHydratedSuspenseInstance,Xe=e.clearSuspenseBoundary,$e=e.clearSuspenseBoundaryFromContainer,st=e.shouldDeleteUnhydratedTailInstances,ot=e.didNotMatchHydratedContainerTextInstance,St=e.didNotMatchHydratedTextInstance,at;function lt(c){if(at===void 0)try{throw Error()}catch(v){var f=v.stack.trim().match(/\n( *(at )?)/);at=f&&f[1]||""}return`
`+at+c}var Vt=!1;function Xt(c,f){if(!c||Vt)return"";Vt=!0;var v=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(Re){var A=Re}Reflect.construct(c,[],f)}else{try{f.call()}catch(Re){A=Re}c.call(f.prototype)}else{try{throw Error()}catch(Re){A=Re}c()}}catch(Re){if(Re&&A&&typeof Re.stack=="string"){for(var w=Re.stack.split(`
`),T=A.stack.split(`
`),O=w.length-1,Z=T.length-1;1<=O&&0<=Z&&w[O]!==T[Z];)Z--;for(;1<=O&&0<=Z;O--,Z--)if(w[O]!==T[Z]){if(O!==1||Z!==1)do if(O--,Z--,0>Z||w[O]!==T[Z]){var ce=`
`+w[O].replace(" at new "," at ");return c.displayName&&ce.includes("<anonymous>")&&(ce=ce.replace("<anonymous>",c.displayName)),ce}while(1<=O&&0<=Z);break}}}finally{Vt=!1,Error.prepareStackTrace=v}return(c=c?c.displayName||c.name:"")?lt(c):""}var Di=Object.prototype.hasOwnProperty,Fi=[],kt=-1;function ft(c){return{current:c}}function Ft(c){0>kt||(c.current=Fi[kt],Fi[kt]=null,kt--)}function ut(c,f){kt++,Fi[kt]=c.current,c.current=f}var Yn={},bn=ft(Yn),An=ft(!1),Mr=Yn;function un(c,f){var v=c.type.contextTypes;if(!v)return Yn;var A=c.stateNode;if(A&&A.__reactInternalMemoizedUnmaskedChildContext===f)return A.__reactInternalMemoizedMaskedChildContext;var w={},T;for(T in v)w[T]=f[T];return A&&(c=c.stateNode,c.__reactInternalMemoizedUnmaskedChildContext=f,c.__reactInternalMemoizedMaskedChildContext=w),w}function fn(c){return c=c.childContextTypes,c!=null}function no(){Ft(An),Ft(bn)}function Qn(c,f,v){if(bn.current!==Yn)throw Error(o(168));ut(bn,f),ut(An,v)}function gl(c,f,v){var A=c.stateNode;if(f=f.childContextTypes,typeof A.getChildContext!="function")return v;A=A.getChildContext();for(var w in A)if(!(w in f))throw Error(o(108,B(c)||"Unknown",w));return s({},v,A)}function vl(c){return c=(c=c.stateNode)&&c.__reactInternalMemoizedMergedChildContext||Yn,Mr=bn.current,ut(bn,c),ut(An,An.current),!0}function pu(c,f,v){var A=c.stateNode;if(!A)throw Error(o(169));v?(c=gl(c,f,Mr),A.__reactInternalMemoizedMergedChildContext=c,Ft(An),Ft(bn),ut(bn,c)):Ft(An),ut(An,v)}var Er=Math.clz32?Math.clz32:vD,mD=Math.log,gD=Math.LN2;function vD(c){return c>>>=0,c===0?32:31-(mD(c)/gD|0)|0}var Yh=64,Qh=4194304;function mu(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 Zh(c,f){var v=c.pendingLanes;if(v===0)return 0;var A=0,w=c.suspendedLanes,T=c.pingedLanes,O=v&268435455;if(O!==0){var Z=O&~w;Z!==0?A=mu(Z):(T&=O,T!==0&&(A=mu(T)))}else O=v&~w,O!==0?A=mu(O):T!==0&&(A=mu(T));if(A===0)return 0;if(f!==0&&f!==A&&!(f&w)&&(w=A&-A,T=f&-f,w>=T||w===16&&(T&4194240)!==0))return f;if(A&4&&(A|=v&16),f=c.entangledLanes,f!==0)for(c=c.entanglements,f&=A;0<f;)v=31-Er(f),w=1<<v,A|=c[v],f&=~w;return A}function yD(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 xD(c,f){for(var v=c.suspendedLanes,A=c.pingedLanes,w=c.expirationTimes,T=c.pendingLanes;0<T;){var O=31-Er(T),Z=1<<O,ce=w[O];ce===-1?(!(Z&v)||Z&A)&&(w[O]=yD(Z,f)):ce<=f&&(c.expiredLanes|=Z),T&=~Z}}function d0(c){return c=c.pendingLanes&-1073741825,c!==0?c:c&1073741824?1073741824:0}function p0(c){for(var f=[],v=0;31>v;v++)f.push(c);return f}function gu(c,f,v){c.pendingLanes|=f,f!==536870912&&(c.suspendedLanes=0,c.pingedLanes=0),c=c.eventTimes,f=31-Er(f),c[f]=v}function _D(c,f){var v=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 A=c.eventTimes;for(c=c.expirationTimes;0<v;){var w=31-Er(v),T=1<<w;f[w]=0,A[w]=-1,c[w]=-1,v&=~T}}function m0(c,f){var v=c.entangledLanes|=f;for(c=c.entanglements;v;){var A=31-Er(v),w=1<<A;w&f|c[A]&f&&(c[A]|=f),v&=~w}}var Bt=0;function C1(c){return c&=-c,1<c?4<c?c&268435455?16:536870912:4:1}var g0=r.unstable_scheduleCallback,b1=r.unstable_cancelCallback,AD=r.unstable_shouldYield,SD=r.unstable_requestPaint,Fn=r.unstable_now,v0=r.unstable_ImmediatePriority,MD=r.unstable_UserBlockingPriority,y0=r.unstable_NormalPriority,ED=r.unstable_IdlePriority,qh=null,Zr=null;function wD(c){if(Zr&&typeof Zr.onCommitFiberRoot=="function")try{Zr.onCommitFiberRoot(qh,c,void 0,(c.current.flags&128)===128)}catch{}}function TD(c,f){return c===f&&(c!==0||1/c===1/f)||c!==c&&f!==f}var qr=typeof Object.is=="function"?Object.is:TD,As=null,$h=!1,x0=!1;function R1(c){As===null?As=[c]:As.push(c)}function CD(c){$h=!0,R1(c)}function $r(){if(!x0&&As!==null){x0=!0;var c=0,f=Bt;try{var v=As;for(Bt=1;c<v.length;c++){var A=v[c];do A=A(!0);while(A!==null)}As=null,$h=!1}catch(w){throw As!==null&&(As=As.slice(c+1)),g0(v0,$r),w}finally{Bt=f,x0=!1}}return null}var bD=a.ReactCurrentBatchConfig;function ed(c,f){if(qr(c,f))return!0;if(typeof c!="object"||c===null||typeof f!="object"||f===null)return!1;var v=Object.keys(c),A=Object.keys(f);if(v.length!==A.length)return!1;for(A=0;A<v.length;A++){var w=v[A];if(!Di.call(f,w)||!qr(c[w],f[w]))return!1}return!0}function RD(c){switch(c.tag){case 5:return lt(c.type);case 16:return lt("Lazy");case 13:return lt("Suspense");case 19:return lt("SuspenseList");case 0:case 2:case 15:return c=Xt(c.type,!1),c;case 11:return c=Xt(c.type.render,!1),c;case 1:return c=Xt(c.type,!0),c;default:return""}}function wr(c,f){if(c&&c.defaultProps){f=s({},f),c=c.defaultProps;for(var v in c)f[v]===void 0&&(f[v]=c[v]);return f}return f}var td=ft(null),nd=null,yl=null,_0=null;function A0(){_0=yl=nd=null}function P1(c,f,v){tt?(ut(td,f._currentValue),f._currentValue=v):(ut(td,f._currentValue2),f._currentValue2=v)}function S0(c){var f=td.current;Ft(td),tt?c._currentValue=f:c._currentValue2=f}function M0(c,f,v){for(;c!==null;){var A=c.alternate;if((c.childLanes&f)!==f?(c.childLanes|=f,A!==null&&(A.childLanes|=f)):A!==null&&(A.childLanes&f)!==f&&(A.childLanes|=f),c===v)break;c=c.return}}function xl(c,f){nd=c,_0=yl=null,c=c.dependencies,c!==null&&c.firstContext!==null&&(c.lanes&f&&(Ui=!0),c.firstContext=null)}function $i(c){var f=tt?c._currentValue:c._currentValue2;if(_0!==c)if(c={context:c,memoizedValue:f,next:null},yl===null){if(nd===null)throw Error(o(308));yl=c,nd.dependencies={lanes:0,firstContext:c}}else yl=yl.next=c;return f}var es=null,io=!1;function E0(c){c.updateQueue={baseState:c.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,interleaved:null,lanes:0},effects:null}}function B1(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 Ss(c,f){return{eventTime:c,lane:f,tag:0,payload:null,callback:null,next:null}}function ro(c,f){var v=c.updateQueue;v!==null&&(v=v.shared,Sn!==null&&c.mode&1&&!(Mt&2)?(c=v.interleaved,c===null?(f.next=f,es===null?es=[v]:es.push(v)):(f.next=c.next,c.next=f),v.interleaved=f):(c=v.pending,c===null?f.next=f:(f.next=c.next,c.next=f),v.pending=f))}function id(c,f,v){if(f=f.updateQueue,f!==null&&(f=f.shared,(v&4194240)!==0)){var A=f.lanes;A&=c.pendingLanes,v|=A,f.lanes=v,m0(c,v)}}function L1(c,f){var v=c.updateQueue,A=c.alternate;if(A!==null&&(A=A.updateQueue,v===A)){var w=null,T=null;if(v=v.firstBaseUpdate,v!==null){do{var O={eventTime:v.eventTime,lane:v.lane,tag:v.tag,payload:v.payload,callback:v.callback,next:null};T===null?w=T=O:T=T.next=O,v=v.next}while(v!==null);T===null?w=T=f:T=T.next=f}else w=T=f;v={baseState:A.baseState,firstBaseUpdate:w,lastBaseUpdate:T,shared:A.shared,effects:A.effects},c.updateQueue=v;return}c=v.lastBaseUpdate,c===null?v.firstBaseUpdate=f:c.next=f,v.lastBaseUpdate=f}function rd(c,f,v,A){var w=c.updateQueue;io=!1;var T=w.firstBaseUpdate,O=w.lastBaseUpdate,Z=w.shared.pending;if(Z!==null){w.shared.pending=null;var ce=Z,Re=ce.next;ce.next=null,O===null?T=Re:O.next=Re,O=ce;var Je=c.alternate;Je!==null&&(Je=Je.updateQueue,Z=Je.lastBaseUpdate,Z!==O&&(Z===null?Je.firstBaseUpdate=Re:Z.next=Re,Je.lastBaseUpdate=ce))}if(T!==null){var ht=w.baseState;O=0,Je=Re=ce=null,Z=T;do{var et=Z.lane,Ht=Z.eventTime;if((A&et)===et){Je!==null&&(Je=Je.next={eventTime:Ht,lane:0,tag:Z.tag,payload:Z.payload,callback:Z.callback,next:null});e:{var Ze=c,ei=Z;switch(et=f,Ht=v,ei.tag){case 1:if(Ze=ei.payload,typeof Ze=="function"){ht=Ze.call(Ht,ht,et);break e}ht=Ze;break e;case 3:Ze.flags=Ze.flags&-65537|128;case 0:if(Ze=ei.payload,et=typeof Ze=="function"?Ze.call(Ht,ht,et):Ze,et==null)break e;ht=s({},ht,et);break e;case 2:io=!0}}Z.callback!==null&&Z.lane!==0&&(c.flags|=64,et=w.effects,et===null?w.effects=[Z]:et.push(Z))}else Ht={eventTime:Ht,lane:et,tag:Z.tag,payload:Z.payload,callback:Z.callback,next:null},Je===null?(Re=Je=Ht,ce=ht):Je=Je.next=Ht,O|=et;if(Z=Z.next,Z===null){if(Z=w.shared.pending,Z===null)break;et=Z,Z=et.next,et.next=null,w.lastBaseUpdate=et,w.shared.pending=null}}while(1);if(Je===null&&(ce=ht),w.baseState=ce,w.firstBaseUpdate=Re,w.lastBaseUpdate=Je,f=w.shared.interleaved,f!==null){w=f;do O|=w.lane,w=w.next;while(w!==f)}else T===null&&(w.shared.lanes=0);bl|=O,c.lanes=O,c.memoizedState=ht}}function I1(c,f,v){if(c=f.effects,f.effects=null,c!==null)for(f=0;f<c.length;f++){var A=c[f],w=A.callback;if(w!==null){if(A.callback=null,A=v,typeof w!="function")throw Error(o(191,w));w.call(A)}}}var D1=new i.Component().refs;function w0(c,f,v,A){f=c.memoizedState,v=v(A,f),v=v==null?f:s({},f,v),c.memoizedState=v,c.lanes===0&&(c.updateQueue.baseState=v)}var sd={isMounted:function(c){return(c=c._reactInternals)?R(c)===c:!1},enqueueSetState:function(c,f,v){c=c._reactInternals;var A=ui(),w=ao(c),T=Ss(A,w);T.payload=f,v!=null&&(T.callback=v),ro(c,T),f=rr(c,w,A),f!==null&&id(f,c,w)},enqueueReplaceState:function(c,f,v){c=c._reactInternals;var A=ui(),w=ao(c),T=Ss(A,w);T.tag=1,T.payload=f,v!=null&&(T.callback=v),ro(c,T),f=rr(c,w,A),f!==null&&id(f,c,w)},enqueueForceUpdate:function(c,f){c=c._reactInternals;var v=ui(),A=ao(c),w=Ss(v,A);w.tag=2,f!=null&&(w.callback=f),ro(c,w),f=rr(c,A,v),f!==null&&id(f,c,A)}};function F1(c,f,v,A,w,T,O){return c=c.stateNode,typeof c.shouldComponentUpdate=="function"?c.shouldComponentUpdate(A,T,O):f.prototype&&f.prototype.isPureReactComponent?!ed(v,A)||!ed(w,T):!0}function N1(c,f,v){var A=!1,w=Yn,T=f.contextType;return typeof T=="object"&&T!==null?T=$i(T):(w=fn(f)?Mr:bn.current,A=f.contextTypes,T=(A=A!=null)?un(c,w):Yn),f=new f(v,T),c.memoizedState=f.state!==null&&f.state!==void 0?f.state:null,f.updater=sd,c.stateNode=f,f._reactInternals=c,A&&(c=c.stateNode,c.__reactInternalMemoizedUnmaskedChildContext=w,c.__reactInternalMemoizedMaskedChildContext=T),f}function O1(c,f,v,A){c=f.state,typeof f.componentWillReceiveProps=="function"&&f.componentWillReceiveProps(v,A),typeof f.UNSAFE_componentWillReceiveProps=="function"&&f.UNSAFE_componentWillReceiveProps(v,A),f.state!==c&&sd.enqueueReplaceState(f,f.state,null)}function T0(c,f,v,A){var w=c.stateNode;w.props=v,w.state=c.memoizedState,w.refs=D1,E0(c);var T=f.contextType;typeof T=="object"&&T!==null?w.context=$i(T):(T=fn(f)?Mr:bn.current,w.context=un(c,T)),w.state=c.memoizedState,T=f.getDerivedStateFromProps,typeof T=="function"&&(w0(c,f,T,v),w.state=c.memoizedState),typeof f.getDerivedStateFromProps=="function"||typeof w.getSnapshotBeforeUpdate=="function"||typeof w.UNSAFE_componentWillMount!="function"&&typeof w.componentWillMount!="function"||(f=w.state,typeof w.componentWillMount=="function"&&w.componentWillMount(),typeof w.UNSAFE_componentWillMount=="function"&&w.UNSAFE_componentWillMount(),f!==w.state&&sd.enqueueReplaceState(w,w.state,null),rd(c,v,w,A),w.state=c.memoizedState),typeof w.componentDidMount=="function"&&(c.flags|=4194308)}var _l=[],Al=0,od=null,ad=0,er=[],tr=0,oa=null,Ms=1,Es="";function aa(c,f){_l[Al++]=ad,_l[Al++]=od,od=c,ad=f}function U1(c,f,v){er[tr++]=Ms,er[tr++]=Es,er[tr++]=oa,oa=c;var A=Ms;c=Es;var w=32-Er(A)-1;A&=~(1<<w),v+=1;var T=32-Er(f)+w;if(30<T){var O=w-w%5;T=(A&(1<<O)-1).toString(32),A>>=O,w-=O,Ms=1<<32-Er(f)+w|v<<w|A,Es=T+c}else Ms=1<<T|v<<w|A,Es=c}function C0(c){c.return!==null&&(aa(c,1),U1(c,1,0))}function b0(c){for(;c===od;)od=_l[--Al],_l[Al]=null,ad=_l[--Al],_l[Al]=null;for(;c===oa;)oa=er[--tr],er[tr]=null,Es=er[--tr],er[tr]=null,Ms=er[--tr],er[tr]=null}var Ni=null,Oi=null,Qt=!1,vu=!1,Tr=null;function k1(c,f){var v=sr(5,null,null,0);v.elementType="DELETED",v.stateNode=f,v.return=c,f=c.deletions,f===null?(c.deletions=[v],c.flags|=16):f.push(v)}function H1(c,f){switch(c.tag){case 5:return f=Vn(f,c.type,c.pendingProps),f!==null?(c.stateNode=f,Ni=c,Oi=Kh(f),!0):!1;case 6:return f=Wh(f,c.pendingProps),f!==null?(c.stateNode=f,Ni=c,Oi=null,!0):!1;case 13:if(f=jh(f),f!==null){var v=oa!==null?{id:Ms,overflow:Es}:null;return c.memoizedState={dehydrated:f,treeContext:v,retryLane:1073741824},v=sr(18,null,null,0),v.stateNode=f,v.return=c,c.child=v,Ni=c,Oi=null,!0}return!1;default:return!1}}function R0(c){return(c.mode&1)!==0&&(c.flags&128)===0}function P0(c){if(Qt){var f=Oi;if(f){var v=f;if(!H1(c,f)){if(R0(c))throw Error(o(418));f=Qr(v);var A=Ni;f&&H1(c,f)?k1(A,v):(c.flags=c.flags&-4097|2,Qt=!1,Ni=c)}}else{if(R0(c))throw Error(o(418));c.flags=c.flags&-4097|2,Qt=!1,Ni=c}}}function z1(c){for(c=c.return;c!==null&&c.tag!==5&&c.tag!==3&&c.tag!==13;)c=c.return;Ni=c}function yu(c){if(!ye||c!==Ni)return!1;if(!Qt)return z1(c),Qt=!0,!1;if(c.tag!==3&&(c.tag!==5||st(c.type)&&!Ae(c.type,c.memoizedProps))){var f=Oi;if(f){if(R0(c)){for(c=Oi;c;)c=Qr(c);throw Error(o(418))}for(;f;)k1(c,f),f=Qr(f)}}if(z1(c),c.tag===13){if(!ye)throw Error(o(316));if(c=c.memoizedState,c=c!==null?c.dehydrated:null,!c)throw Error(o(317));Oi=de(c)}else Oi=Ni?Qr(c.stateNode):null;return!0}function Sl(){ye&&(Oi=Ni=null,vu=Qt=!1)}function B0(c){Tr===null?Tr=[c]:Tr.push(c)}function xu(c,f,v){if(c=v.ref,c!==null&&typeof c!="function"&&typeof c!="object"){if(v._owner){if(v=v._owner,v){if(v.tag!==1)throw Error(o(309));var A=v.stateNode}if(!A)throw Error(o(147,c));var w=A,T=""+c;return f!==null&&f.ref!==null&&typeof f.ref=="function"&&f.ref._stringRef===T?f.ref:(f=function(O){var Z=w.refs;Z===D1&&(Z=w.refs={}),O===null?delete Z[T]:Z[T]=O},f._stringRef=T,f)}if(typeof c!="string")throw Error(o(284));if(!v._owner)throw Error(o(290,c))}return c}function ld(c,f){throw c=Object.prototype.toString.call(f),Error(o(31,c==="[object Object]"?"object with keys {"+Object.keys(f).join(", ")+"}":c))}function G1(c){var f=c._init;return f(c._payload)}function V1(c){function f(ie,q){if(c){var ae=ie.deletions;ae===null?(ie.deletions=[q],ie.flags|=16):ae.push(q)}}function v(ie,q){if(!c)return null;for(;q!==null;)f(ie,q),q=q.sibling;return null}function A(ie,q){for(ie=new Map;q!==null;)q.key!==null?ie.set(q.key,q):ie.set(q.index,q),q=q.sibling;return ie}function w(ie,q){return ie=co(ie,q),ie.index=0,ie.sibling=null,ie}function T(ie,q,ae){return ie.index=ae,c?(ae=ie.alternate,ae!==null?(ae=ae.index,ae<q?(ie.flags|=2,q):ae):(ie.flags|=2,q)):(ie.flags|=1048576,q)}function O(ie){return c&&ie.alternate===null&&(ie.flags|=2),ie}function Z(ie,q,ae,ze){return q===null||q.tag!==6?(q=pv(ae,ie.mode,ze),q.return=ie,q):(q=w(q,ae),q.return=ie,q)}function ce(ie,q,ae,ze){var Qe=ae.type;return Qe===h?Je(ie,q,ae.props.children,ze,ae.key):q!==null&&(q.elementType===Qe||typeof Qe=="object"&&Qe!==null&&Qe.$$typeof===S&&G1(Qe)===q.type)?(ze=w(q,ae.props),ze.ref=xu(ie,q,ae),ze.return=ie,ze):(ze=kd(ae.type,ae.key,ae.props,null,ie.mode,ze),ze.ref=xu(ie,q,ae),ze.return=ie,ze)}function Re(ie,q,ae,ze){return q===null||q.tag!==4||q.stateNode.containerInfo!==ae.containerInfo||q.stateNode.implementation!==ae.implementation?(q=mv(ae,ie.mode,ze),q.return=ie,q):(q=w(q,ae.children||[]),q.return=ie,q)}function Je(ie,q,ae,ze,Qe){return q===null||q.tag!==7?(q=pa(ae,ie.mode,ze,Qe),q.return=ie,q):(q=w(q,ae),q.return=ie,q)}function ht(ie,q,ae){if(typeof q=="string"&&q!==""||typeof q=="number")return q=pv(""+q,ie.mode,ae),q.return=ie,q;if(typeof q=="object"&&q!==null){switch(q.$$typeof){case l:return ae=kd(q.type,q.key,q.props,null,ie.mode,ae),ae.ref=xu(ie,null,q),ae.return=ie,ae;case u:return q=mv(q,ie.mode,ae),q.return=ie,q;case S:var ze=q._init;return ht(ie,ze(q._payload),ae)}if(Y(q)||b(q))return q=pa(q,ie.mode,ae,null),q.return=ie,q;ld(ie,q)}return null}function et(ie,q,ae,ze){var Qe=q!==null?q.key:null;if(typeof ae=="string"&&ae!==""||typeof ae=="number")return Qe!==null?null:Z(ie,q,""+ae,ze);if(typeof ae=="object"&&ae!==null){switch(ae.$$typeof){case l:return ae.key===Qe?ce(ie,q,ae,ze):null;case u:return ae.key===Qe?Re(ie,q,ae,ze):null;case S:return Qe=ae._init,et(ie,q,Qe(ae._payload),ze)}if(Y(ae)||b(ae))return Qe!==null?null:Je(ie,q,ae,ze,null);ld(ie,ae)}return null}function Ht(ie,q,ae,ze,Qe){if(typeof ze=="string"&&ze!==""||typeof ze=="number")return ie=ie.get(ae)||null,Z(q,ie,""+ze,Qe);if(typeof ze=="object"&&ze!==null){switch(ze.$$typeof){case l:return ie=ie.get(ze.key===null?ae:ze.key)||null,ce(q,ie,ze,Qe);case u:return ie=ie.get(ze.key===null?ae:ze.key)||null,Re(q,ie,ze,Qe);case S:var xt=ze._init;return Ht(ie,q,ae,xt(ze._payload),Qe)}if(Y(ze)||b(ze))return ie=ie.get(ae)||null,Je(q,ie,ze,Qe,null);ld(q,ze)}return null}function Ze(ie,q,ae,ze){for(var Qe=null,xt=null,dt=q,Lt=q=0,On=null;dt!==null&&Lt<ae.length;Lt++){dt.index>Lt?(On=dt,dt=null):On=dt.sibling;var It=et(ie,dt,ae[Lt],ze);if(It===null){dt===null&&(dt=On);break}c&&dt&&It.alternate===null&&f(ie,dt),q=T(It,q,Lt),xt===null?Qe=It:xt.sibling=It,xt=It,dt=On}if(Lt===ae.length)return v(ie,dt),Qt&&aa(ie,Lt),Qe;if(dt===null){for(;Lt<ae.length;Lt++)dt=ht(ie,ae[Lt],ze),dt!==null&&(q=T(dt,q,Lt),xt===null?Qe=dt:xt.sibling=dt,xt=dt);return Qt&&aa(ie,Lt),Qe}for(dt=A(ie,dt);Lt<ae.length;Lt++)On=Ht(dt,ie,Lt,ae[Lt],ze),On!==null&&(c&&On.alternate!==null&&dt.delete(On.key===null?Lt:On.key),q=T(On,q,Lt),xt===null?Qe=On:xt.sibling=On,xt=On);return c&&dt.forEach(function(uo){return f(ie,uo)}),Qt&&aa(ie,Lt),Qe}function ei(ie,q,ae,ze){var Qe=b(ae);if(typeof Qe!="function")throw Error(o(150));if(ae=Qe.call(ae),ae==null)throw Error(o(151));for(var xt=Qe=null,dt=q,Lt=q=0,On=null,It=ae.next();dt!==null&&!It.done;Lt++,It=ae.next()){dt.index>Lt?(On=dt,dt=null):On=dt.sibling;var uo=et(ie,dt,It.value,ze);if(uo===null){dt===null&&(dt=On);break}c&&dt&&uo.alternate===null&&f(ie,dt),q=T(uo,q,Lt),xt===null?Qe=uo:xt.sibling=uo,xt=uo,dt=On}if(It.done)return v(ie,dt),Qt&&aa(ie,Lt),Qe;if(dt===null){for(;!It.done;Lt++,It=ae.next())It=ht(ie,It.value,ze),It!==null&&(q=T(It,q,Lt),xt===null?Qe=It:xt.sibling=It,xt=It);return Qt&&aa(ie,Lt),Qe}for(dt=A(ie,dt);!It.done;Lt++,It=ae.next())It=Ht(dt,ie,Lt,It.value,ze),It!==null&&(c&&It.alternate!==null&&dt.delete(It.key===null?Lt:It.key),q=T(It,q,Lt),xt===null?Qe=It:xt.sibling=It,xt=It);return c&&dt.forEach(function(sF){return f(ie,sF)}),Qt&&aa(ie,Lt),Qe}function or(ie,q,ae,ze){if(typeof ae=="object"&&ae!==null&&ae.type===h&&ae.key===null&&(ae=ae.props.children),typeof ae=="object"&&ae!==null){switch(ae.$$typeof){case l:e:{for(var Qe=ae.key,xt=q;xt!==null;){if(xt.key===Qe){if(Qe=ae.type,Qe===h){if(xt.tag===7){v(ie,xt.sibling),q=w(xt,ae.props.children),q.return=ie,ie=q;break e}}else if(xt.elementType===Qe||typeof Qe=="object"&&Qe!==null&&Qe.$$typeof===S&&G1(Qe)===xt.type){v(ie,xt.sibling),q=w(xt,ae.props),q.ref=xu(ie,xt,ae),q.return=ie,ie=q;break e}v(ie,xt);break}else f(ie,xt);xt=xt.sibling}ae.type===h?(q=pa(ae.props.children,ie.mode,ze,ae.key),q.return=ie,ie=q):(ze=kd(ae.type,ae.key,ae.props,null,ie.mode,ze),ze.ref=xu(ie,q,ae),ze.return=ie,ie=ze)}return O(ie);case u:e:{for(xt=ae.key;q!==null;){if(q.key===xt)if(q.tag===4&&q.stateNode.containerInfo===ae.containerInfo&&q.stateNode.implementation===ae.implementation){v(ie,q.sibling),q=w(q,ae.children||[]),q.return=ie,ie=q;break e}else{v(ie,q);break}else f(ie,q);q=q.sibling}q=mv(ae,ie.mode,ze),q.return=ie,ie=q}return O(ie);case S:return xt=ae._init,or(ie,q,xt(ae._payload),ze)}if(Y(ae))return Ze(ie,q,ae,ze);if(b(ae))return ei(ie,q,ae,ze);ld(ie,ae)}return typeof ae=="string"&&ae!==""||typeof ae=="number"?(ae=""+ae,q!==null&&q.tag===6?(v(ie,q.sibling),q=w(q,ae),q.return=ie,ie=q):(v(ie,q),q=pv(ae,ie.mode,ze),q.return=ie,ie=q),O(ie)):v(ie,q)}return or}var Ml=V1(!0),W1=V1(!1),_u={},nr=ft(_u),Au=ft(_u),El=ft(_u);function ts(c){if(c===_u)throw Error(o(174));return c}function L0(c,f){ut(El,f),ut(Au,c),ut(nr,_u),c=ee(f),Ft(nr),ut(nr,c)}function wl(){Ft(nr),Ft(Au),Ft(El)}function j1(c){var f=ts(El.current),v=ts(nr.current);f=I(v,c.type,f),v!==f&&(ut(Au,c),ut(nr,f))}function I0(c){Au.current===c&&(Ft(nr),Ft(Au))}var en=ft(0);function cd(c){for(var f=c;f!==null;){if(f.tag===13){var v=f.memoizedState;if(v!==null&&(v=v.dehydrated,v===null||Xh(v)||to(v)))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 D0=[];function F0(){for(var c=0;c<D0.length;c++){var f=D0[c];tt?f._workInProgressVersionPrimary=null:f._workInProgressVersionSecondary=null}D0.length=0}var ud=a.ReactCurrentDispatcher,ir=a.ReactCurrentBatchConfig,Tl=0,hn=null,Zn=null,Nn=null,fd=!1,Su=!1,Mu=0,PD=0;function qn(){throw Error(o(321))}function N0(c,f){if(f===null)return!1;for(var v=0;v<f.length&&v<c.length;v++)if(!qr(c[v],f[v]))return!1;return!0}function O0(c,f,v,A,w,T){if(Tl=T,hn=f,f.memoizedState=null,f.updateQueue=null,f.lanes=0,ud.current=c===null||c.memoizedState===null?DD:FD,c=v(A,w),Su){T=0;do{if(Su=!1,Mu=0,25<=T)throw Error(o(301));T+=1,Nn=Zn=null,f.updateQueue=null,ud.current=ND,c=v(A,w)}while(Su)}if(ud.current=gd,f=Zn!==null&&Zn.next!==null,Tl=0,Nn=Zn=hn=null,fd=!1,f)throw Error(o(300));return c}function U0(){var c=Mu!==0;return Mu=0,c}function ws(){var c={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return Nn===null?hn.memoizedState=Nn=c:Nn=Nn.next=c,Nn}function ns(){if(Zn===null){var c=hn.alternate;c=c!==null?c.memoizedState:null}else c=Zn.next;var f=Nn===null?hn.memoizedState:Nn.next;if(f!==null)Nn=f,Zn=c;else{if(c===null)throw Error(o(310));Zn=c,c={memoizedState:Zn.memoizedState,baseState:Zn.baseState,baseQueue:Zn.baseQueue,queue:Zn.queue,next:null},Nn===null?hn.memoizedState=Nn=c:Nn=Nn.next=c}return Nn}function la(c,f){return typeof f=="function"?f(c):f}function hd(c){var f=ns(),v=f.queue;if(v===null)throw Error(o(311));v.lastRenderedReducer=c;var A=Zn,w=A.baseQueue,T=v.pending;if(T!==null){if(w!==null){var O=w.next;w.next=T.next,T.next=O}A.baseQueue=w=T,v.pending=null}if(w!==null){T=w.next,A=A.baseState;var Z=O=null,ce=null,Re=T;do{var Je=Re.lane;if((Tl&Je)===Je)ce!==null&&(ce=ce.next={lane:0,action:Re.action,hasEagerState:Re.hasEagerState,eagerState:Re.eagerState,next:null}),A=Re.hasEagerState?Re.eagerState:c(A,Re.action);else{var ht={lane:Je,action:Re.action,hasEagerState:Re.hasEagerState,eagerState:Re.eagerState,next:null};ce===null?(Z=ce=ht,O=A):ce=ce.next=ht,hn.lanes|=Je,bl|=Je}Re=Re.next}while(Re!==null&&Re!==T);ce===null?O=A:ce.next=Z,qr(A,f.memoizedState)||(Ui=!0),f.memoizedState=A,f.baseState=O,f.baseQueue=ce,v.lastRenderedState=A}if(c=v.interleaved,c!==null){w=c;do T=w.lane,hn.lanes|=T,bl|=T,w=w.next;while(w!==c)}else w===null&&(v.lanes=0);return[f.memoizedState,v.dispatch]}function dd(c){var f=ns(),v=f.queue;if(v===null)throw Error(o(311));v.lastRenderedReducer=c;var A=v.dispatch,w=v.pending,T=f.memoizedState;if(w!==null){v.pending=null;var O=w=w.next;do T=c(T,O.action),O=O.next;while(O!==w);qr(T,f.memoizedState)||(Ui=!0),f.memoizedState=T,f.baseQueue===null&&(f.baseState=T),v.lastRenderedState=T}return[T,A]}function X1(){}function J1(c,f){var v=hn,A=ns(),w=f(),T=!qr(A.memoizedState,w);if(T&&(A.memoizedState=w,Ui=!0),A=A.queue,wu(Q1.bind(null,v,A,c),[c]),A.getSnapshot!==f||T||Nn!==null&&Nn.memoizedState.tag&1){if(v.flags|=2048,Eu(9,Y1.bind(null,v,A,w,f),void 0,null),Sn===null)throw Error(o(349));Tl&30||K1(v,f,w)}return w}function K1(c,f,v){c.flags|=16384,c={getSnapshot:f,value:v},f=hn.updateQueue,f===null?(f={lastEffect:null,stores:null},hn.updateQueue=f,f.stores=[c]):(v=f.stores,v===null?f.stores=[c]:v.push(c))}function Y1(c,f,v,A){f.value=v,f.getSnapshot=A,Z1(f)&&rr(c,1,-1)}function Q1(c,f,v){return v(function(){Z1(f)&&rr(c,1,-1)})}function Z1(c){var f=c.getSnapshot;c=c.value;try{var v=f();return!qr(c,v)}catch{return!0}}function k0(c){var f=ws();return typeof c=="function"&&(c=c()),f.memoizedState=f.baseState=c,c={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:la,lastRenderedState:c},f.queue=c,c=c.dispatch=ID.bind(null,hn,c),[f.memoizedState,c]}function Eu(c,f,v,A){return c={tag:c,create:f,destroy:v,deps:A,next:null},f=hn.updateQueue,f===null?(f={lastEffect:null,stores:null},hn.updateQueue=f,f.lastEffect=c.next=c):(v=f.lastEffect,v===null?f.lastEffect=c.next=c:(A=v.next,v.next=c,c.next=A,f.lastEffect=c)),c}function q1(){return ns().memoizedState}function pd(c,f,v,A){var w=ws();hn.flags|=c,w.memoizedState=Eu(1|f,v,void 0,A===void 0?null:A)}function md(c,f,v,A){var w=ns();A=A===void 0?null:A;var T=void 0;if(Zn!==null){var O=Zn.memoizedState;if(T=O.destroy,A!==null&&N0(A,O.deps)){w.memoizedState=Eu(f,v,T,A);return}}hn.flags|=c,w.memoizedState=Eu(1|f,v,T,A)}function H0(c,f){return pd(8390656,8,c,f)}function wu(c,f){return md(2048,8,c,f)}function $1(c,f){return md(4,2,c,f)}function eM(c,f){return md(4,4,c,f)}function tM(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 nM(c,f,v){return v=v!=null?v.concat([c]):null,md(4,4,tM.bind(null,f,c),v)}function z0(){}function iM(c,f){var v=ns();f=f===void 0?null:f;var A=v.memoizedState;return A!==null&&f!==null&&N0(f,A[1])?A[0]:(v.memoizedState=[c,f],c)}function rM(c,f){var v=ns();f=f===void 0?null:f;var A=v.memoizedState;return A!==null&&f!==null&&N0(f,A[1])?A[0]:(c=c(),v.memoizedState=[c,f],c)}function BD(c,f){var v=Bt;Bt=v!==0&&4>v?v:4,c(!0);var A=ir.transition;ir.transition={};try{c(!1),f()}finally{Bt=v,ir.transition=A}}function sM(){return ns().memoizedState}function LD(c,f,v){var A=ao(c);v={lane:A,action:v,hasEagerState:!1,eagerState:null,next:null},oM(c)?aM(f,v):(lM(c,f,v),v=ui(),c=rr(c,A,v),c!==null&&cM(c,f,A))}function ID(c,f,v){var A=ao(c),w={lane:A,action:v,hasEagerState:!1,eagerState:null,next:null};if(oM(c))aM(f,w);else{lM(c,f,w);var T=c.alternate;if(c.lanes===0&&(T===null||T.lanes===0)&&(T=f.lastRenderedReducer,T!==null))try{var O=f.lastRenderedState,Z=T(O,v);if(w.hasEagerState=!0,w.eagerState=Z,qr(Z,O))return}catch{}finally{}v=ui(),c=rr(c,A,v),c!==null&&cM(c,f,A)}}function oM(c){var f=c.alternate;return c===hn||f!==null&&f===hn}function aM(c,f){Su=fd=!0;var v=c.pending;v===null?f.next=f:(f.next=v.next,v.next=f),c.pending=f}function lM(c,f,v){Sn!==null&&c.mode&1&&!(Mt&2)?(c=f.interleaved,c===null?(v.next=v,es===null?es=[f]:es.push(f)):(v.next=c.next,c.next=v),f.interleaved=v):(c=f.pending,c===null?v.next=v:(v.next=c.next,c.next=v),f.pending=v)}function cM(c,f,v){if(v&4194240){var A=f.lanes;A&=c.pendingLanes,v|=A,f.lanes=v,m0(c,v)}}var gd={readContext:$i,useCallback:qn,useContext:qn,useEffect:qn,useImperativeHandle:qn,useInsertionEffect:qn,useLayoutEffect:qn,useMemo:qn,useReducer:qn,useRef:qn,useState:qn,useDebugValue:qn,useDeferredValue:qn,useTransition:qn,useMutableSource:qn,useSyncExternalStore:qn,useId:qn,unstable_isNewReconciler:!1},DD={readContext:$i,useCallback:function(c,f){return ws().memoizedState=[c,f===void 0?null:f],c},useContext:$i,useEffect:H0,useImperativeHandle:function(c,f,v){return v=v!=null?v.concat([c]):null,pd(4194308,4,tM.bind(null,f,c),v)},useLayoutEffect:function(c,f){return pd(4194308,4,c,f)},useInsertionEffect:function(c,f){return pd(4,2,c,f)},useMemo:function(c,f){var v=ws();return f=f===void 0?null:f,c=c(),v.memoizedState=[c,f],c},useReducer:function(c,f,v){var A=ws();return f=v!==void 0?v(f):f,A.memoizedState=A.baseState=f,c={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:c,lastRenderedState:f},A.queue=c,c=c.dispatch=LD.bind(null,hn,c),[A.memoizedState,c]},useRef:function(c){var f=ws();return c={current:c},f.memoizedState=c},useState:k0,useDebugValue:z0,useDeferredValue:function(c){var f=k0(c),v=f[0],A=f[1];return H0(function(){var w=ir.transition;ir.transition={};try{A(c)}finally{ir.transition=w}},[c]),v},useTransition:function(){var c=k0(!1),f=c[0];return c=BD.bind(null,c[1]),ws().memoizedState=c,[f,c]},useMutableSource:function(){},useSyncExternalStore:function(c,f,v){var A=hn,w=ws();if(Qt){if(v===void 0)throw Error(o(407));v=v()}else{if(v=f(),Sn===null)throw Error(o(349));Tl&30||K1(A,f,v)}w.memoizedState=v;var T={value:v,getSnapshot:f};return w.queue=T,H0(Q1.bind(null,A,T,c),[c]),A.flags|=2048,Eu(9,Y1.bind(null,A,T,v,f),void 0,null),v},useId:function(){var c=ws(),f=Sn.identifierPrefix;if(Qt){var v=Es,A=Ms;v=(A&~(1<<32-Er(A)-1)).toString(32)+v,f=":"+f+"R"+v,v=Mu++,0<v&&(f+="H"+v.toString(32)),f+=":"}else v=PD++,f=":"+f+"r"+v.toString(32)+":";return c.memoizedState=f},unstable_isNewReconciler:!1},FD={readContext:$i,useCallback:iM,useContext:$i,useEffect:wu,useImperativeHandle:nM,useInsertionEffect:$1,useLayoutEffect:eM,useMemo:rM,useReducer:hd,useRef:q1,useState:function(){return hd(la)},useDebugValue:z0,useDeferredValue:function(c){var f=hd(la),v=f[0],A=f[1];return wu(function(){var w=ir.transition;ir.transition={};try{A(c)}finally{ir.transition=w}},[c]),v},useTransition:function(){var c=hd(la)[0],f=ns().memoizedState;return[c,f]},useMutableSource:X1,useSyncExternalStore:J1,useId:sM,unstable_isNewReconciler:!1},ND={readContext:$i,useCallback:iM,useContext:$i,useEffect:wu,useImperativeHandle:nM,useInsertionEffect:$1,useLayoutEffect:eM,useMemo:rM,useReducer:dd,useRef:q1,useState:function(){return dd(la)},useDebugValue:z0,useDeferredValue:function(c){var f=dd(la),v=f[0],A=f[1];return wu(function(){var w=ir.transition;ir.transition={};try{A(c)}finally{ir.transition=w}},[c]),v},useTransition:function(){var c=dd(la)[0],f=ns().memoizedState;return[c,f]},useMutableSource:X1,useSyncExternalStore:J1,useId:sM,unstable_isNewReconciler:!1};function G0(c,f){try{var v="",A=f;do v+=RD(A),A=A.return;while(A);var w=v}catch(T){w=`
Error generating stack: `+T.message+`
`+T.stack}return{value:c,source:f,stack:w}}function V0(c,f){try{console.error(f.value)}catch(v){setTimeout(function(){throw v})}}var OD=typeof WeakMap=="function"?WeakMap:Map;function uM(c,f,v){v=Ss(-1,v),v.tag=3,v.payload={element:null};var A=f.value;return v.callback=function(){Ld||(Ld=!0,av=A),V0(c,f)},v}function fM(c,f,v){v=Ss(-1,v),v.tag=3;var A=c.type.getDerivedStateFromError;if(typeof A=="function"){var w=f.value;v.payload=function(){return A(w)},v.callback=function(){V0(c,f)}}var T=c.stateNode;return T!==null&&typeof T.componentDidCatch=="function"&&(v.callback=function(){V0(c,f),typeof A!="function"&&(so===null?so=new Set([this]):so.add(this));var O=f.stack;this.componentDidCatch(f.value,{componentStack:O!==null?O:""})}),v}function hM(c,f,v){var A=c.pingCache;if(A===null){A=c.pingCache=new OD;var w=new Set;A.set(f,w)}else w=A.get(f),w===void 0&&(w=new Set,A.set(f,w));w.has(v)||(w.add(v),c=ZD.bind(null,c,f,v),f.then(c,c))}function dM(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 pM(c,f,v,A,w){return c.mode&1?(c.flags|=65536,c.lanes=w,c):(c===f?c.flags|=65536:(c.flags|=128,v.flags|=131072,v.flags&=-52805,v.tag===1&&(v.alternate===null?v.tag=17:(f=Ss(-1,1),f.tag=2,ro(v,f))),v.lanes|=1),c)}function is(c){c.flags|=4}function mM(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 Tu,Cu,vd,yd;if(Se)Tu=function(c,f){for(var v=f.child;v!==null;){if(v.tag===5||v.tag===6)W(c,v.stateNode);else if(v.tag!==4&&v.child!==null){v.child.return=v,v=v.child;continue}if(v===f)break;for(;v.sibling===null;){if(v.return===null||v.return===f)return;v=v.return}v.sibling.return=v.return,v=v.sibling}},Cu=function(){},vd=function(c,f,v,A,w){if(c=c.memoizedProps,c!==A){var T=f.stateNode,O=ts(nr.current);v=ue(T,v,c,A,w,O),(f.updateQueue=v)&&is(f)}},yd=function(c,f,v,A){v!==A&&is(f)};else if(G){Tu=function(c,f,v,A){for(var w=f.child;w!==null;){if(w.tag===5){var T=w.stateNode;v&&A&&(T=jt(T,w.type,w.memoizedProps,w)),W(c,T)}else if(w.tag===6)T=w.stateNode,v&&A&&(T=Ii(T,w.memoizedProps,w)),W(c,T);else if(w.tag!==4){if(w.tag===22&&w.memoizedState!==null)T=w.child,T!==null&&(T.return=w),Tu(c,w,!0,!0);else if(w.child!==null){w.child.return=w,w=w.child;continue}}if(w===f)break;for(;w.sibling===null;){if(w.return===null||w.return===f)return;w=w.return}w.sibling.return=w.return,w=w.sibling}};var gM=function(c,f,v,A){for(var w=f.child;w!==null;){if(w.tag===5){var T=w.stateNode;v&&A&&(T=jt(T,w.type,w.memoizedProps,w)),Gt(c,T)}else if(w.tag===6)T=w.stateNode,v&&A&&(T=Ii(T,w.memoizedProps,w)),Gt(c,T);else if(w.tag!==4){if(w.tag===22&&w.memoizedState!==null)T=w.child,T!==null&&(T.return=w),gM(c,w,!0,!0);else if(w.child!==null){w.child.return=w,w=w.child;continue}}if(w===f)break;for(;w.sibling===null;){if(w.return===null||w.return===f)return;w=w.return}w.sibling.return=w.return,w=w.sibling}};Cu=function(c,f){var v=f.stateNode;if(!mM(c,f)){c=v.containerInfo;var A=wt(c);gM(A,f,!1,!1),v.pendingChildren=A,is(f),_n(c,A)}},vd=function(c,f,v,A,w){var T=c.stateNode,O=c.memoizedProps;if((c=mM(c,f))&&O===A)f.stateNode=T;else{var Z=f.stateNode,ce=ts(nr.current),Re=null;O!==A&&(Re=ue(Z,v,O,A,w,ce)),c&&Re===null?f.stateNode=T:(T=He(T,Re,v,O,A,f,c,Z),ve(T,v,A,w,ce)&&is(f),f.stateNode=T,c?is(f):Tu(T,f,!1,!1))}},yd=function(c,f,v,A){v!==A?(c=ts(El.current),v=ts(nr.current),f.stateNode=Ee(A,c,v,f),is(f)):f.stateNode=c.stateNode}}else Cu=function(){},vd=function(){},yd=function(){};function bu(c,f){if(!Qt)switch(c.tailMode){case"hidden":f=c.tail;for(var v=null;f!==null;)f.alternate!==null&&(v=f),f=f.sibling;v===null?c.tail=null:v.sibling=null;break;case"collapsed":v=c.tail;for(var A=null;v!==null;)v.alternate!==null&&(A=v),v=v.sibling;A===null?f||c.tail===null?c.tail=null:c.tail.sibling=null:A.sibling=null}}function $n(c){var f=c.alternate!==null&&c.alternate.child===c.child,v=0,A=0;if(f)for(var w=c.child;w!==null;)v|=w.lanes|w.childLanes,A|=w.subtreeFlags&14680064,A|=w.flags&14680064,w.return=c,w=w.sibling;else for(w=c.child;w!==null;)v|=w.lanes|w.childLanes,A|=w.subtreeFlags,A|=w.flags,w.return=c,w=w.sibling;return c.subtreeFlags|=A,c.childLanes=v,f}function UD(c,f,v){var A=f.pendingProps;switch(b0(f),f.tag){case 2:case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return $n(f),null;case 1:return fn(f.type)&&no(),$n(f),null;case 3:return A=f.stateNode,wl(),Ft(An),Ft(bn),F0(),A.pendingContext&&(A.context=A.pendingContext,A.pendingContext=null),(c===null||c.child===null)&&(yu(f)?is(f):c===null||c.memoizedState.isDehydrated&&!(f.flags&256)||(f.flags|=1024,Tr!==null&&(uv(Tr),Tr=null))),Cu(c,f),$n(f),null;case 5:I0(f),v=ts(El.current);var w=f.type;if(c!==null&&f.stateNode!=null)vd(c,f,w,A,v),c.ref!==f.ref&&(f.flags|=512,f.flags|=2097152);else{if(!A){if(f.stateNode===null)throw Error(o(166));return $n(f),null}if(c=ts(nr.current),yu(f)){if(!ye)throw Error(o(175));c=h0(f.stateNode,f.type,f.memoizedProps,v,c,f,!vu),f.updateQueue=c,c!==null&&is(f)}else{var T=U(w,A,v,c,f);Tu(T,f,!1,!1),f.stateNode=T,ve(T,w,A,v,c)&&is(f)}f.ref!==null&&(f.flags|=512,f.flags|=2097152)}return $n(f),null;case 6:if(c&&f.stateNode!=null)yd(c,f,c.memoizedProps,A);else{if(typeof A!="string"&&f.stateNode===null)throw Error(o(166));if(c=ts(El.current),v=ts(nr.current),yu(f)){if(!ye)throw Error(o(176));if(c=f.stateNode,A=f.memoizedProps,(v=N(c,A,f,!vu))&&(w=Ni,w!==null))switch(T=(w.mode&1)!==0,w.tag){case 3:ot(w.stateNode.containerInfo,c,A,T);break;case 5:St(w.type,w.memoizedProps,w.stateNode,c,A,T)}v&&is(f)}else f.stateNode=Ee(A,c,v,f)}return $n(f),null;case 13:if(Ft(en),A=f.memoizedState,Qt&&Oi!==null&&f.mode&1&&!(f.flags&128)){for(c=Oi;c;)c=Qr(c);return Sl(),f.flags|=98560,f}if(A!==null&&A.dehydrated!==null){if(A=yu(f),c===null){if(!A)throw Error(o(318));if(!ye)throw Error(o(344));if(c=f.memoizedState,c=c!==null?c.dehydrated:null,!c)throw Error(o(317));re(c,f)}else Sl(),!(f.flags&128)&&(f.memoizedState=null),f.flags|=4;return $n(f),null}return Tr!==null&&(uv(Tr),Tr=null),f.flags&128?(f.lanes=v,f):(A=A!==null,v=!1,c===null?yu(f):v=c.memoizedState!==null,A&&!v&&(f.child.flags|=8192,f.mode&1&&(c===null||en.current&1?Rn===0&&(Rn=3):hv())),f.updateQueue!==null&&(f.flags|=4),$n(f),null);case 4:return wl(),Cu(c,f),c===null&&Me(f.stateNode.containerInfo),$n(f),null;case 10:return S0(f.type._context),$n(f),null;case 17:return fn(f.type)&&no(),$n(f),null;case 19:if(Ft(en),w=f.memoizedState,w===null)return $n(f),null;if(A=(f.flags&128)!==0,T=w.rendering,T===null)if(A)bu(w,!1);else{if(Rn!==0||c!==null&&c.flags&128)for(c=f.child;c!==null;){if(T=cd(c),T!==null){for(f.flags|=128,bu(w,!1),c=T.updateQueue,c!==null&&(f.updateQueue=c,f.flags|=4),f.subtreeFlags=0,c=v,A=f.child;A!==null;)v=A,w=c,v.flags&=14680066,T=v.alternate,T===null?(v.childLanes=0,v.lanes=w,v.child=null,v.subtreeFlags=0,v.memoizedProps=null,v.memoizedState=null,v.updateQueue=null,v.dependencies=null,v.stateNode=null):(v.childLanes=T.childLanes,v.lanes=T.lanes,v.child=T.child,v.subtreeFlags=0,v.deletions=null,v.memoizedProps=T.memoizedProps,v.memoizedState=T.memoizedState,v.updateQueue=T.updateQueue,v.type=T.type,w=T.dependencies,v.dependencies=w===null?null:{lanes:w.lanes,firstContext:w.firstContext}),A=A.sibling;return ut(en,en.current&1|2),f.child}c=c.sibling}w.tail!==null&&Fn()>ov&&(f.flags|=128,A=!0,bu(w,!1),f.lanes=4194304)}else{if(!A)if(c=cd(T),c!==null){if(f.flags|=128,A=!0,c=c.updateQueue,c!==null&&(f.updateQueue=c,f.flags|=4),bu(w,!0),w.tail===null&&w.tailMode==="hidden"&&!T.alternate&&!Qt)return $n(f),null}else 2*Fn()-w.renderingStartTime>ov&&v!==1073741824&&(f.flags|=128,A=!0,bu(w,!1),f.lanes=4194304);w.isBackwards?(T.sibling=f.child,f.child=T):(c=w.last,c!==null?c.sibling=T:f.child=T,w.last=T)}return w.tail!==null?(f=w.tail,w.rendering=f,w.tail=f.sibling,w.renderingStartTime=Fn(),f.sibling=null,c=en.current,ut(en,A?c&1|2:c&1),f):($n(f),null);case 22:case 23:return fv(),A=f.memoizedState!==null,c!==null&&c.memoizedState!==null!==A&&(f.flags|=8192),A&&f.mode&1?ki&1073741824&&($n(f),Se&&f.subtreeFlags&6&&(f.flags|=8192)):$n(f),null;case 24:return null;case 25:return null}throw Error(o(156,f.tag))}var kD=a.ReactCurrentOwner,Ui=!1;function ci(c,f,v,A){f.child=c===null?W1(f,null,v,A):Ml(f,c.child,v,A)}function vM(c,f,v,A,w){v=v.render;var T=f.ref;return xl(f,w),A=O0(c,f,v,A,T,w),v=U0(),c!==null&&!Ui?(f.updateQueue=c.updateQueue,f.flags&=-2053,c.lanes&=~w,Ts(c,f,w)):(Qt&&v&&C0(f),f.flags|=1,ci(c,f,A,w),f.child)}function yM(c,f,v,A,w){if(c===null){var T=v.type;return typeof T=="function"&&!dv(T)&&T.defaultProps===void 0&&v.compare===null&&v.defaultProps===void 0?(f.tag=15,f.type=T,xM(c,f,T,A,w)):(c=kd(v.type,null,A,f,f.mode,w),c.ref=f.ref,c.return=f,f.child=c)}if(T=c.child,!(c.lanes&w)){var O=T.memoizedProps;if(v=v.compare,v=v!==null?v:ed,v(O,A)&&c.ref===f.ref)return Ts(c,f,w)}return f.flags|=1,c=co(T,A),c.ref=f.ref,c.return=f,f.child=c}function xM(c,f,v,A,w){if(c!==null&&ed(c.memoizedProps,A)&&c.ref===f.ref)if(Ui=!1,(c.lanes&w)!==0)c.flags&131072&&(Ui=!0);else return f.lanes=c.lanes,Ts(c,f,w);return W0(c,f,v,A,w)}function _M(c,f,v){var A=f.pendingProps,w=A.children,T=c!==null?c.memoizedState:null;if(A.mode==="hidden")if(!(f.mode&1))f.memoizedState={baseLanes:0,cachePool:null},ut(Cl,ki),ki|=v;else if(v&1073741824)f.memoizedState={baseLanes:0,cachePool:null},A=T!==null?T.baseLanes:v,ut(Cl,ki),ki|=A;else return c=T!==null?T.baseLanes|v:v,f.lanes=f.childLanes=1073741824,f.memoizedState={baseLanes:c,cachePool:null},f.updateQueue=null,ut(Cl,ki),ki|=c,null;else T!==null?(A=T.baseLanes|v,f.memoizedState=null):A=v,ut(Cl,ki),ki|=A;return ci(c,f,w,v),f.child}function AM(c,f){var v=f.ref;(c===null&&v!==null||c!==null&&c.ref!==v)&&(f.flags|=512,f.flags|=2097152)}function W0(c,f,v,A,w){var T=fn(v)?Mr:bn.current;return T=un(f,T),xl(f,w),v=O0(c,f,v,A,T,w),A=U0(),c!==null&&!Ui?(f.updateQueue=c.updateQueue,f.flags&=-2053,c.lanes&=~w,Ts(c,f,w)):(Qt&&A&&C0(f),f.flags|=1,ci(c,f,v,w),f.child)}function SM(c,f,v,A,w){if(fn(v)){var T=!0;vl(f)}else T=!1;if(xl(f,w),f.stateNode===null)c!==null&&(c.alternate=null,f.alternate=null,f.flags|=2),N1(f,v,A),T0(f,v,A,w),A=!0;else if(c===null){var O=f.stateNode,Z=f.memoizedProps;O.props=Z;var ce=O.context,Re=v.contextType;typeof Re=="object"&&Re!==null?Re=$i(Re):(Re=fn(v)?Mr:bn.current,Re=un(f,Re));var Je=v.getDerivedStateFromProps,ht=typeof Je=="function"||typeof O.getSnapshotBeforeUpdate=="function";ht||typeof O.UNSAFE_componentWillReceiveProps!="function"&&typeof O.componentWillReceiveProps!="function"||(Z!==A||ce!==Re)&&O1(f,O,A,Re),io=!1;var et=f.memoizedState;O.state=et,rd(f,A,O,w),ce=f.memoizedState,Z!==A||et!==ce||An.current||io?(typeof Je=="function"&&(w0(f,v,Je,A),ce=f.memoizedState),(Z=io||F1(f,v,Z,A,et,ce,Re))?(ht||typeof O.UNSAFE_componentWillMount!="function"&&typeof O.componentWillMount!="function"||(typeof O.componentWillMount=="function"&&O.componentWillMount(),typeof O.UNSAFE_componentWillMount=="function"&&O.UNSAFE_componentWillMount()),typeof O.componentDidMount=="function"&&(f.flags|=4194308)):(typeof O.componentDidMount=="function"&&(f.flags|=4194308),f.memoizedProps=A,f.memoizedState=ce),O.props=A,O.state=ce,O.context=Re,A=Z):(typeof O.componentDidMount=="function"&&(f.flags|=4194308),A=!1)}else{O=f.stateNode,B1(c,f),Z=f.memoizedProps,Re=f.type===f.elementType?Z:wr(f.type,Z),O.props=Re,ht=f.pendingProps,et=O.context,ce=v.contextType,typeof ce=="object"&&ce!==null?ce=$i(ce):(ce=fn(v)?Mr:bn.current,ce=un(f,ce));var Ht=v.getDerivedStateFromProps;(Je=typeof Ht=="function"||typeof O.getSnapshotBeforeUpdate=="function")||typeof O.UNSAFE_componentWillReceiveProps!="function"&&typeof O.componentWillReceiveProps!="function"||(Z!==ht||et!==ce)&&O1(f,O,A,ce),io=!1,et=f.memoizedState,O.state=et,rd(f,A,O,w);var Ze=f.memoizedState;Z!==ht||et!==Ze||An.current||io?(typeof Ht=="function"&&(w0(f,v,Ht,A),Ze=f.memoizedState),(Re=io||F1(f,v,Re,A,et,Ze,ce)||!1)?(Je||typeof O.UNSAFE_componentWillUpdate!="function"&&typeof O.componentWillUpdate!="function"||(typeof O.componentWillUpdate=="function"&&O.componentWillUpdate(A,Ze,ce),typeof O.UNSAFE_componentWillUpdate=="function"&&O.UNSAFE_componentWillUpdate(A,Ze,ce)),typeof O.componentDidUpdate=="function"&&(f.flags|=4),typeof O.getSnapshotBeforeUpdate=="function"&&(f.flags|=1024)):(typeof O.componentDidUpdate!="function"||Z===c.memoizedProps&&et===c.memoizedState||(f.flags|=4),typeof O.getSnapshotBeforeUpdate!="function"||Z===c.memoizedProps&&et===c.memoizedState||(f.flags|=1024),f.memoizedProps=A,f.memoizedState=Ze),O.props=A,O.state=Ze,O.context=ce,A=Re):(typeof O.componentDidUpdate!="function"||Z===c.memoizedProps&&et===c.memoizedState||(f.flags|=4),typeof O.getSnapshotBeforeUpdate!="function"||Z===c.memoizedProps&&et===c.memoizedState||(f.flags|=1024),A=!1)}return j0(c,f,v,A,T,w)}function j0(c,f,v,A,w,T){AM(c,f);var O=(f.flags&128)!==0;if(!A&&!O)return w&&pu(f,v,!1),Ts(c,f,T);A=f.stateNode,kD.current=f;var Z=O&&typeof v.getDerivedStateFromError!="function"?null:A.render();return f.flags|=1,c!==null&&O?(f.child=Ml(f,c.child,null,T),f.child=Ml(f,null,Z,T)):ci(c,f,Z,T),f.memoizedState=A.state,w&&pu(f,v,!0),f.child}function MM(c){var f=c.stateNode;f.pendingContext?Qn(c,f.pendingContext,f.pendingContext!==f.context):f.context&&Qn(c,f.context,!1),L0(c,f.containerInfo)}function EM(c,f,v,A,w){return Sl(),B0(w),f.flags|=256,ci(c,f,v,A),f.child}var xd={dehydrated:null,treeContext:null,retryLane:0};function _d(c){return{baseLanes:c,cachePool:null}}function wM(c,f,v){var A=f.pendingProps,w=en.current,T=!1,O=(f.flags&128)!==0,Z;if((Z=O)||(Z=c!==null&&c.memoizedState===null?!1:(w&2)!==0),Z?(T=!0,f.flags&=-129):(c===null||c.memoizedState!==null)&&(w|=1),ut(en,w&1),c===null)return P0(f),c=f.memoizedState,c!==null&&(c=c.dehydrated,c!==null)?(f.mode&1?to(c)?f.lanes=8:f.lanes=1073741824:f.lanes=1,null):(w=A.children,c=A.fallback,T?(A=f.mode,T=f.child,w={mode:"hidden",children:w},!(A&1)&&T!==null?(T.childLanes=0,T.pendingProps=w):T=Hd(w,A,0,null),c=pa(c,A,v,null),T.return=f,c.return=f,T.sibling=c,f.child=T,f.child.memoizedState=_d(v),f.memoizedState=xd,c):X0(f,w));if(w=c.memoizedState,w!==null){if(Z=w.dehydrated,Z!==null){if(O)return f.flags&256?(f.flags&=-257,Ad(c,f,v,Error(o(422)))):f.memoizedState!==null?(f.child=c.child,f.flags|=128,null):(T=A.fallback,w=f.mode,A=Hd({mode:"visible",children:A.children},w,0,null),T=pa(T,w,v,null),T.flags|=2,A.return=f,T.return=f,A.sibling=T,f.child=A,f.mode&1&&Ml(f,c.child,null,v),f.child.memoizedState=_d(v),f.memoizedState=xd,T);if(!(f.mode&1))f=Ad(c,f,v,null);else if(to(Z))f=Ad(c,f,v,Error(o(419)));else if(A=(v&c.childLanes)!==0,Ui||A){if(A=Sn,A!==null){switch(v&-v){case 4:T=2;break;case 16:T=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:T=32;break;case 536870912:T=268435456;break;default:T=0}A=T&(A.suspendedLanes|v)?0:T,A!==0&&A!==w.retryLane&&(w.retryLane=A,rr(c,A,-1))}hv(),f=Ad(c,f,v,Error(o(421)))}else Xh(Z)?(f.flags|=128,f.child=c.child,f=qD.bind(null,c),Jh(Z,f),f=null):(v=w.treeContext,ye&&(Oi=f0(Z),Ni=f,Qt=!0,Tr=null,vu=!1,v!==null&&(er[tr++]=Ms,er[tr++]=Es,er[tr++]=oa,Ms=v.id,Es=v.overflow,oa=f)),f=X0(f,f.pendingProps.children),f.flags|=4096);return f}return T?(A=CM(c,f,A.children,A.fallback,v),T=f.child,w=c.child.memoizedState,T.memoizedState=w===null?_d(v):{baseLanes:w.baseLanes|v,cachePool:null},T.childLanes=c.childLanes&~v,f.memoizedState=xd,A):(v=TM(c,f,A.children,v),f.memoizedState=null,v)}return T?(A=CM(c,f,A.children,A.fallback,v),T=f.child,w=c.child.memoizedState,T.memoizedState=w===null?_d(v):{baseLanes:w.baseLanes|v,cachePool:null},T.childLanes=c.childLanes&~v,f.memoizedState=xd,A):(v=TM(c,f,A.children,v),f.memoizedState=null,v)}function X0(c,f){return f=Hd({mode:"visible",children:f},c.mode,0,null),f.return=c,c.child=f}function TM(c,f,v,A){var w=c.child;return c=w.sibling,v=co(w,{mode:"visible",children:v}),!(f.mode&1)&&(v.lanes=A),v.return=f,v.sibling=null,c!==null&&(A=f.deletions,A===null?(f.deletions=[c],f.flags|=16):A.push(c)),f.child=v}function CM(c,f,v,A,w){var T=f.mode;c=c.child;var O=c.sibling,Z={mode:"hidden",children:v};return!(T&1)&&f.child!==c?(v=f.child,v.childLanes=0,v.pendingProps=Z,f.deletions=null):(v=co(c,Z),v.subtreeFlags=c.subtreeFlags&14680064),O!==null?A=co(O,A):(A=pa(A,T,w,null),A.flags|=2),A.return=f,v.return=f,v.sibling=A,f.child=v,A}function Ad(c,f,v,A){return A!==null&&B0(A),Ml(f,c.child,null,v),c=X0(f,f.pendingProps.children),c.flags|=2,f.memoizedState=null,c}function bM(c,f,v){c.lanes|=f;var A=c.alternate;A!==null&&(A.lanes|=f),M0(c.return,f,v)}function J0(c,f,v,A,w){var T=c.memoizedState;T===null?c.memoizedState={isBackwards:f,rendering:null,renderingStartTime:0,last:A,tail:v,tailMode:w}:(T.isBackwards=f,T.rendering=null,T.renderingStartTime=0,T.last=A,T.tail=v,T.tailMode=w)}function RM(c,f,v){var A=f.pendingProps,w=A.revealOrder,T=A.tail;if(ci(c,f,A.children,v),A=en.current,A&2)A=A&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&&bM(c,v,f);else if(c.tag===19)bM(c,v,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}A&=1}if(ut(en,A),!(f.mode&1))f.memoizedState=null;else switch(w){case"forwards":for(v=f.child,w=null;v!==null;)c=v.alternate,c!==null&&cd(c)===null&&(w=v),v=v.sibling;v=w,v===null?(w=f.child,f.child=null):(w=v.sibling,v.sibling=null),J0(f,!1,w,v,T);break;case"backwards":for(v=null,w=f.child,f.child=null;w!==null;){if(c=w.alternate,c!==null&&cd(c)===null){f.child=w;break}c=w.sibling,w.sibling=v,v=w,w=c}J0(f,!0,v,null,T);break;case"together":J0(f,!1,null,null,void 0);break;default:f.memoizedState=null}return f.child}function Ts(c,f,v){if(c!==null&&(f.dependencies=c.dependencies),bl|=f.lanes,!(v&f.childLanes))return null;if(c!==null&&f.child!==c.child)throw Error(o(153));if(f.child!==null){for(c=f.child,v=co(c,c.pendingProps),f.child=v,v.return=f;c.sibling!==null;)c=c.sibling,v=v.sibling=co(c,c.pendingProps),v.return=f;v.sibling=null}return f.child}function HD(c,f,v){switch(f.tag){case 3:MM(f),Sl();break;case 5:j1(f);break;case 1:fn(f.type)&&vl(f);break;case 4:L0(f,f.stateNode.containerInfo);break;case 10:P1(f,f.type._context,f.memoizedProps.value);break;case 13:var A=f.memoizedState;if(A!==null)return A.dehydrated!==null?(ut(en,en.current&1),f.flags|=128,null):v&f.child.childLanes?wM(c,f,v):(ut(en,en.current&1),c=Ts(c,f,v),c!==null?c.sibling:null);ut(en,en.current&1);break;case 19:if(A=(v&f.childLanes)!==0,c.flags&128){if(A)return RM(c,f,v);f.flags|=128}var w=f.memoizedState;if(w!==null&&(w.rendering=null,w.tail=null,w.lastEffect=null),ut(en,en.current),A)break;return null;case 22:case 23:return f.lanes=0,_M(c,f,v)}return Ts(c,f,v)}function zD(c,f){switch(b0(f),f.tag){case 1:return fn(f.type)&&no(),c=f.flags,c&65536?(f.flags=c&-65537|128,f):null;case 3:return wl(),Ft(An),Ft(bn),F0(),c=f.flags,c&65536&&!(c&128)?(f.flags=c&-65537|128,f):null;case 5:return I0(f),null;case 13:if(Ft(en),c=f.memoizedState,c!==null&&c.dehydrated!==null){if(f.alternate===null)throw Error(o(340));Sl()}return c=f.flags,c&65536?(f.flags=c&-65537|128,f):null;case 19:return Ft(en),null;case 4:return wl(),null;case 10:return S0(f.type._context),null;case 22:case 23:return fv(),null;case 24:return null;default:return null}}var Sd=!1,ca=!1,GD=typeof WeakSet=="function"?WeakSet:Set,ke=null;function Md(c,f){var v=c.ref;if(v!==null)if(typeof v=="function")try{v(null)}catch(A){Si(c,f,A)}else v.current=null}function K0(c,f,v){try{v()}catch(A){Si(c,f,A)}}var PM=!1;function VD(c,f){for(V(c.containerInfo),ke=f;ke!==null;)if(c=ke,f=c.child,(c.subtreeFlags&1028)!==0&&f!==null)f.return=c,ke=f;else for(;ke!==null;){c=ke;try{var v=c.alternate;if(c.flags&1024)switch(c.tag){case 0:case 11:case 15:break;case 1:if(v!==null){var A=v.memoizedProps,w=v.memoizedState,T=c.stateNode,O=T.getSnapshotBeforeUpdate(c.elementType===c.type?A:wr(c.type,A),w);T.__reactInternalSnapshotBeforeUpdate=O}break;case 3:Se&&Be(c.stateNode.containerInfo);break;case 5:case 6:case 4:case 17:break;default:throw Error(o(163))}}catch(Z){Si(c,c.return,Z)}if(f=c.sibling,f!==null){f.return=c.return,ke=f;break}ke=c.return}return v=PM,PM=!1,v}function ua(c,f,v){var A=f.updateQueue;if(A=A!==null?A.lastEffect:null,A!==null){var w=A=A.next;do{if((w.tag&c)===c){var T=w.destroy;w.destroy=void 0,T!==void 0&&K0(f,v,T)}w=w.next}while(w!==A)}}function Ru(c,f){if(f=f.updateQueue,f=f!==null?f.lastEffect:null,f!==null){var v=f=f.next;do{if((v.tag&c)===c){var A=v.create;v.destroy=A()}v=v.next}while(v!==f)}}function Y0(c){var f=c.ref;if(f!==null){var v=c.stateNode;switch(c.tag){case 5:c=ne(v);break;default:c=v}typeof f=="function"?f(c):f.current=c}}function BM(c,f,v){if(Zr&&typeof Zr.onCommitFiberUnmount=="function")try{Zr.onCommitFiberUnmount(qh,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 A=c=c.next;do{var w=A,T=w.destroy;w=w.tag,T!==void 0&&(w&2||w&4)&&K0(f,v,T),A=A.next}while(A!==c)}break;case 1:if(Md(f,v),c=f.stateNode,typeof c.componentWillUnmount=="function")try{c.props=f.memoizedProps,c.state=f.memoizedState,c.componentWillUnmount()}catch(O){Si(f,v,O)}break;case 5:Md(f,v);break;case 4:Se?OM(c,f,v):G&&G&&(f=f.stateNode.containerInfo,v=wt(f),Li(f,v))}}function LM(c,f,v){for(var A=f;;)if(BM(c,A,v),A.child===null||Se&&A.tag===4){if(A===f)break;for(;A.sibling===null;){if(A.return===null||A.return===f)return;A=A.return}A.sibling.return=A.return,A=A.sibling}else A.child.return=A,A=A.child}function IM(c){var f=c.alternate;f!==null&&(c.alternate=null,IM(f)),c.child=null,c.deletions=null,c.sibling=null,c.tag===5&&(f=c.stateNode,f!==null&&Ve(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 DM(c){return c.tag===5||c.tag===3||c.tag===4}function FM(c){e:for(;;){for(;c.sibling===null;){if(c.return===null||DM(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 NM(c){if(Se){e:{for(var f=c.return;f!==null;){if(DM(f))break e;f=f.return}throw Error(o(160))}var v=f;switch(v.tag){case 5:f=v.stateNode,v.flags&32&&(nt(f),v.flags&=-33),v=FM(c),Z0(c,v,f);break;case 3:case 4:f=v.stateNode.containerInfo,v=FM(c),Q0(c,v,f);break;default:throw Error(o(161))}}}function Q0(c,f,v){var A=c.tag;if(A===5||A===6)c=c.stateNode,f?Te(v,c,f):Ke(v,c);else if(A!==4&&(c=c.child,c!==null))for(Q0(c,f,v),c=c.sibling;c!==null;)Q0(c,f,v),c=c.sibling}function Z0(c,f,v){var A=c.tag;if(A===5||A===6)c=c.stateNode,f?fe(v,c,f):De(v,c);else if(A!==4&&(c=c.child,c!==null))for(Z0(c,f,v),c=c.sibling;c!==null;)Z0(c,f,v),c=c.sibling}function OM(c,f,v){for(var A=f,w=!1,T,O;;){if(!w){w=A.return;e:for(;;){if(w===null)throw Error(o(160));switch(T=w.stateNode,w.tag){case 5:O=!1;break e;case 3:T=T.containerInfo,O=!0;break e;case 4:T=T.containerInfo,O=!0;break e}w=w.return}w=!0}if(A.tag===5||A.tag===6)LM(c,A,v),O?Ie(T,A.stateNode):be(T,A.stateNode);else if(A.tag===18)O?$e(T,A.stateNode):Xe(T,A.stateNode);else if(A.tag===4){if(A.child!==null){T=A.stateNode.containerInfo,O=!0,A.child.return=A,A=A.child;continue}}else if(BM(c,A,v),A.child!==null){A.child.return=A,A=A.child;continue}if(A===f)break;for(;A.sibling===null;){if(A.return===null||A.return===f)return;A=A.return,A.tag===4&&(w=!1)}A.sibling.return=A.return,A=A.sibling}}function q0(c,f){if(Se){switch(f.tag){case 0:case 11:case 14:case 15:ua(3,f,f.return),Ru(3,f),ua(5,f,f.return);return;case 1:return;case 5:var v=f.stateNode;if(v!=null){var A=f.memoizedProps;c=c!==null?c.memoizedProps:A;var w=f.type,T=f.updateQueue;f.updateQueue=null,T!==null&&j(v,T,w,c,A,f)}return;case 6:if(f.stateNode===null)throw Error(o(162));v=f.memoizedProps,Le(f.stateNode,c!==null?c.memoizedProps:v,v);return;case 3:ye&&c!==null&&c.memoizedState.isDehydrated&&te(f.stateNode.containerInfo);return;case 12:return;case 13:Ed(f);return;case 19:Ed(f);return;case 17:return}throw Error(o(163))}switch(f.tag){case 0:case 11:case 14:case 15:ua(3,f,f.return),Ru(3,f),ua(5,f,f.return);return;case 12:return;case 13:Ed(f);return;case 19:Ed(f);return;case 3:ye&&c!==null&&c.memoizedState.isDehydrated&&te(f.stateNode.containerInfo);break;case 22:case 23:return}e:if(G){switch(f.tag){case 1:case 5:case 6:break e;case 3:case 4:f=f.stateNode,Li(f.containerInfo,f.pendingChildren);break e}throw Error(o(163))}}function Ed(c){var f=c.updateQueue;if(f!==null){c.updateQueue=null;var v=c.stateNode;v===null&&(v=c.stateNode=new GD),f.forEach(function(A){var w=$D.bind(null,c,A);v.has(A)||(v.add(A),A.then(w,w))})}}function WD(c,f){for(ke=f;ke!==null;){f=ke;var v=f.deletions;if(v!==null)for(var A=0;A<v.length;A++){var w=v[A];try{var T=c;Se?OM(T,w,f):LM(T,w,f);var O=w.alternate;O!==null&&(O.return=null),w.return=null}catch(Qe){Si(w,f,Qe)}}if(v=f.child,f.subtreeFlags&12854&&v!==null)v.return=f,ke=v;else for(;ke!==null;){f=ke;try{var Z=f.flags;if(Z&32&&Se&&nt(f.stateNode),Z&512){var ce=f.alternate;if(ce!==null){var Re=ce.ref;Re!==null&&(typeof Re=="function"?Re(null):Re.current=null)}}if(Z&8192)switch(f.tag){case 13:if(f.memoizedState!==null){var Je=f.alternate;(Je===null||Je.memoizedState===null)&&(sv=Fn())}break;case 22:var ht=f.memoizedState!==null,et=f.alternate,Ht=et!==null&&et.memoizedState!==null;if(v=f,Se){e:if(A=v,w=ht,T=null,Se)for(var Ze=A;;){if(Ze.tag===5){if(T===null){T=Ze;var ei=Ze.stateNode;w?Rt(ei):Pe(Ze.stateNode,Ze.memoizedProps)}}else if(Ze.tag===6){if(T===null){var or=Ze.stateNode;w?K(or):oe(or,Ze.memoizedProps)}}else if((Ze.tag!==22&&Ze.tag!==23||Ze.memoizedState===null||Ze===A)&&Ze.child!==null){Ze.child.return=Ze,Ze=Ze.child;continue}if(Ze===A)break;for(;Ze.sibling===null;){if(Ze.return===null||Ze.return===A)break e;T===Ze&&(T=null),Ze=Ze.return}T===Ze&&(T=null),Ze.sibling.return=Ze.return,Ze=Ze.sibling}}if(ht&&!Ht&&v.mode&1){ke=v;for(var ie=v.child;ie!==null;){for(v=ke=ie;ke!==null;){A=ke;var q=A.child;switch(A.tag){case 0:case 11:case 14:case 15:ua(4,A,A.return);break;case 1:Md(A,A.return);var ae=A.stateNode;if(typeof ae.componentWillUnmount=="function"){var ze=A.return;try{ae.props=A.memoizedProps,ae.state=A.memoizedState,ae.componentWillUnmount()}catch(Qe){Si(A,ze,Qe)}}break;case 5:Md(A,A.return);break;case 22:if(A.memoizedState!==null){HM(v);continue}}q!==null?(q.return=A,ke=q):HM(v)}ie=ie.sibling}}}switch(Z&4102){case 2:NM(f),f.flags&=-3;break;case 6:NM(f),f.flags&=-3,q0(f.alternate,f);break;case 4096:f.flags&=-4097;break;case 4100:f.flags&=-4097,q0(f.alternate,f);break;case 4:q0(f.alternate,f)}}catch(Qe){Si(f,f.return,Qe)}if(v=f.sibling,v!==null){v.return=f.return,ke=v;break}ke=f.return}}}function jD(c,f,v){ke=c,UM(c)}function UM(c,f,v){for(var A=(c.mode&1)!==0;ke!==null;){var w=ke,T=w.child;if(w.tag===22&&A){var O=w.memoizedState!==null||Sd;if(!O){var Z=w.alternate,ce=Z!==null&&Z.memoizedState!==null||ca;Z=Sd;var Re=ca;if(Sd=O,(ca=ce)&&!Re)for(ke=w;ke!==null;)O=ke,ce=O.child,O.tag===22&&O.memoizedState!==null?zM(w):ce!==null?(ce.return=O,ke=ce):zM(w);for(;T!==null;)ke=T,UM(T),T=T.sibling;ke=w,Sd=Z,ca=Re}kM(c)}else w.subtreeFlags&8772&&T!==null?(T.return=w,ke=T):kM(c)}}function kM(c){for(;ke!==null;){var f=ke;if(f.flags&8772){var v=f.alternate;try{if(f.flags&8772)switch(f.tag){case 0:case 11:case 15:ca||Ru(5,f);break;case 1:var A=f.stateNode;if(f.flags&4&&!ca)if(v===null)A.componentDidMount();else{var w=f.elementType===f.type?v.memoizedProps:wr(f.type,v.memoizedProps);A.componentDidUpdate(w,v.memoizedState,A.__reactInternalSnapshotBeforeUpdate)}var T=f.updateQueue;T!==null&&I1(f,T,A);break;case 3:var O=f.updateQueue;if(O!==null){if(v=null,f.child!==null)switch(f.child.tag){case 5:v=ne(f.child.stateNode);break;case 1:v=f.child.stateNode}I1(f,O,v)}break;case 5:var Z=f.stateNode;v===null&&f.flags&4&&he(Z,f.type,f.memoizedProps,f);break;case 6:break;case 4:break;case 12:break;case 13:if(ye&&f.memoizedState===null){var ce=f.alternate;if(ce!==null){var Re=ce.memoizedState;if(Re!==null){var Je=Re.dehydrated;Je!==null&&me(Je)}}}break;case 19:case 17:case 21:case 22:case 23:break;default:throw Error(o(163))}ca||f.flags&512&&Y0(f)}catch(ht){Si(f,f.return,ht)}}if(f===c){ke=null;break}if(v=f.sibling,v!==null){v.return=f.return,ke=v;break}ke=f.return}}function HM(c){for(;ke!==null;){var f=ke;if(f===c){ke=null;break}var v=f.sibling;if(v!==null){v.return=f.return,ke=v;break}ke=f.return}}function zM(c){for(;ke!==null;){var f=ke;try{switch(f.tag){case 0:case 11:case 15:var v=f.return;try{Ru(4,f)}catch(ce){Si(f,v,ce)}break;case 1:var A=f.stateNode;if(typeof A.componentDidMount=="function"){var w=f.return;try{A.componentDidMount()}catch(ce){Si(f,w,ce)}}var T=f.return;try{Y0(f)}catch(ce){Si(f,T,ce)}break;case 5:var O=f.return;try{Y0(f)}catch(ce){Si(f,O,ce)}}}catch(ce){Si(f,f.return,ce)}if(f===c){ke=null;break}var Z=f.sibling;if(Z!==null){Z.return=f.return,ke=Z;break}ke=f.return}}var wd=0,Td=1,Cd=2,bd=3,Rd=4;if(typeof Symbol=="function"&&Symbol.for){var Pu=Symbol.for;wd=Pu("selector.component"),Td=Pu("selector.has_pseudo_class"),Cd=Pu("selector.role"),bd=Pu("selector.test_id"),Rd=Pu("selector.text")}function $0(c){var f=pe(c);if(f!=null){if(typeof f.memoizedProps["data-testname"]!="string")throw Error(o(364));return f}if(c=vt(c),c===null)throw Error(o(362));return c.stateNode.current}function ev(c,f){switch(f.$$typeof){case wd:if(c.type===f.value)return!0;break;case Td:e:{f=f.value,c=[c,0];for(var v=0;v<c.length;){var A=c[v++],w=c[v++],T=f[w];if(A.tag!==5||!D(A)){for(;T!=null&&ev(A,T);)w++,T=f[w];if(w===f.length){f=!0;break e}else for(A=A.child;A!==null;)c.push(A,w),A=A.sibling}}f=!1}return f;case Cd:if(c.tag===5&&le(c.stateNode,f.value))return!0;break;case Rd:if((c.tag===5||c.tag===6)&&(c=k(c),c!==null&&0<=c.indexOf(f.value)))return!0;break;case bd:if(c.tag===5&&(c=c.memoizedProps["data-testname"],typeof c=="string"&&c.toLowerCase()===f.value.toLowerCase()))return!0;break;default:throw Error(o(365))}return!1}function tv(c){switch(c.$$typeof){case wd:return"<"+(P(c.value)||"Unknown")+">";case Td:return":has("+(tv(c)||"")+")";case Cd:return'[role="'+c.value+'"]';case Rd:return'"'+c.value+'"';case bd:return'[data-testname="'+c.value+'"]';default:throw Error(o(365))}}function GM(c,f){var v=[];c=[c,0];for(var A=0;A<c.length;){var w=c[A++],T=c[A++],O=f[T];if(w.tag!==5||!D(w)){for(;O!=null&&ev(w,O);)T++,O=f[T];if(T===f.length)v.push(w);else for(w=w.child;w!==null;)c.push(w,T),w=w.sibling}}return v}function nv(c,f){if(!qe)throw Error(o(363));c=$0(c),c=GM(c,f),f=[],c=Array.from(c);for(var v=0;v<c.length;){var A=c[v++];if(A.tag===5)D(A)||f.push(A.stateNode);else for(A=A.child;A!==null;)c.push(A),A=A.sibling}return f}var XD=Math.ceil,Pd=a.ReactCurrentDispatcher,iv=a.ReactCurrentOwner,vn=a.ReactCurrentBatchConfig,Mt=0,Sn=null,Mn=null,Wn=0,ki=0,Cl=ft(0),Rn=0,Bu=null,bl=0,Bd=0,rv=0,Lu=null,_i=null,sv=0,ov=1/0;function Rl(){ov=Fn()+500}var Ld=!1,av=null,so=null,Id=!1,oo=null,Dd=0,Iu=0,lv=null,Fd=-1,Nd=0;function ui(){return Mt&6?Fn():Fd!==-1?Fd:Fd=Fn()}function ao(c){return c.mode&1?Mt&2&&Wn!==0?Wn&-Wn:bD.transition!==null?(Nd===0&&(c=Yh,Yh<<=1,!(Yh&4194240)&&(Yh=64),Nd=c),Nd):(c=Bt,c!==0?c:xe()):1}function rr(c,f,v){if(50<Iu)throw Iu=0,lv=null,Error(o(185));var A=Od(c,f);return A===null?null:(gu(A,f,v),(!(Mt&2)||A!==Sn)&&(A===Sn&&(!(Mt&2)&&(Bd|=f),Rn===4&&lo(A,Wn)),Ai(A,v),f===1&&Mt===0&&!(c.mode&1)&&(Rl(),$h&&$r())),A)}function Od(c,f){c.lanes|=f;var v=c.alternate;for(v!==null&&(v.lanes|=f),v=c,c=c.return;c!==null;)c.childLanes|=f,v=c.alternate,v!==null&&(v.childLanes|=f),v=c,c=c.return;return v.tag===3?v.stateNode:null}function Ai(c,f){var v=c.callbackNode;xD(c,f);var A=Zh(c,c===Sn?Wn:0);if(A===0)v!==null&&b1(v),c.callbackNode=null,c.callbackPriority=0;else if(f=A&-A,c.callbackPriority!==f){if(v!=null&&b1(v),f===1)c.tag===0?CD(WM.bind(null,c)):R1(WM.bind(null,c)),Ue?Ge(function(){Mt===0&&$r()}):g0(v0,$r),v=null;else{switch(C1(A)){case 1:v=v0;break;case 4:v=MD;break;case 16:v=y0;break;case 536870912:v=ED;break;default:v=y0}v=$M(v,VM.bind(null,c))}c.callbackPriority=f,c.callbackNode=v}}function VM(c,f){if(Fd=-1,Nd=0,Mt&6)throw Error(o(327));var v=c.callbackNode;if(da()&&c.callbackNode!==v)return null;var A=Zh(c,c===Sn?Wn:0);if(A===0)return null;if(A&30||A&c.expiredLanes||f)f=Ud(c,A);else{f=A;var w=Mt;Mt|=2;var T=JM();(Sn!==c||Wn!==f)&&(Rl(),fa(c,f));do try{YD();break}catch(Z){XM(c,Z)}while(1);A0(),Pd.current=T,Mt=w,Mn!==null?f=0:(Sn=null,Wn=0,f=Rn)}if(f!==0){if(f===2&&(w=d0(c),w!==0&&(A=w,f=cv(c,w))),f===1)throw v=Bu,fa(c,0),lo(c,A),Ai(c,Fn()),v;if(f===6)lo(c,A);else{if(w=c.current.alternate,!(A&30)&&!JD(w)&&(f=Ud(c,A),f===2&&(T=d0(c),T!==0&&(A=T,f=cv(c,T))),f===1))throw v=Bu,fa(c,0),lo(c,A),Ai(c,Fn()),v;switch(c.finishedWork=w,c.finishedLanes=A,f){case 0:case 1:throw Error(o(345));case 2:ha(c,_i);break;case 3:if(lo(c,A),(A&130023424)===A&&(f=sv+500-Fn(),10<f)){if(Zh(c,0)!==0)break;if(w=c.suspendedLanes,(w&A)!==A){ui(),c.pingedLanes|=c.suspendedLanes&w;break}c.timeoutHandle=Ne(ha.bind(null,c,_i),f);break}ha(c,_i);break;case 4:if(lo(c,A),(A&4194240)===A)break;for(f=c.eventTimes,w=-1;0<A;){var O=31-Er(A);T=1<<O,O=f[O],O>w&&(w=O),A&=~T}if(A=w,A=Fn()-A,A=(120>A?120:480>A?480:1080>A?1080:1920>A?1920:3e3>A?3e3:4320>A?4320:1960*XD(A/1960))-A,10<A){c.timeoutHandle=Ne(ha.bind(null,c,_i),A);break}ha(c,_i);break;case 5:ha(c,_i);break;default:throw Error(o(329))}}}return Ai(c,Fn()),c.callbackNode===v?VM.bind(null,c):null}function cv(c,f){var v=Lu;return c.current.memoizedState.isDehydrated&&(fa(c,f).flags|=256),c=Ud(c,f),c!==2&&(f=_i,_i=v,f!==null&&uv(f)),c}function uv(c){_i===null?_i=c:_i.push.apply(_i,c)}function JD(c){for(var f=c;;){if(f.flags&16384){var v=f.updateQueue;if(v!==null&&(v=v.stores,v!==null))for(var A=0;A<v.length;A++){var w=v[A],T=w.getSnapshot;w=w.value;try{if(!qr(T(),w))return!1}catch{return!1}}}if(v=f.child,f.subtreeFlags&16384&&v!==null)v.return=f,f=v;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 lo(c,f){for(f&=~rv,f&=~Bd,c.suspendedLanes|=f,c.pingedLanes&=~f,c=c.expirationTimes;0<f;){var v=31-Er(f),A=1<<v;c[v]=-1,f&=~A}}function WM(c){if(Mt&6)throw Error(o(327));da();var f=Zh(c,0);if(!(f&1))return Ai(c,Fn()),null;var v=Ud(c,f);if(c.tag!==0&&v===2){var A=d0(c);A!==0&&(f=A,v=cv(c,A))}if(v===1)throw v=Bu,fa(c,0),lo(c,f),Ai(c,Fn()),v;if(v===6)throw Error(o(345));return c.finishedWork=c.current.alternate,c.finishedLanes=f,ha(c,_i),Ai(c,Fn()),null}function jM(c){oo!==null&&oo.tag===0&&!(Mt&6)&&da();var f=Mt;Mt|=1;var v=vn.transition,A=Bt;try{if(vn.transition=null,Bt=1,c)return c()}finally{Bt=A,vn.transition=v,Mt=f,!(Mt&6)&&$r()}}function fv(){ki=Cl.current,Ft(Cl)}function fa(c,f){c.finishedWork=null,c.finishedLanes=0;var v=c.timeoutHandle;if(v!==ct&&(c.timeoutHandle=ct,We(v)),Mn!==null)for(v=Mn.return;v!==null;){var A=v;switch(b0(A),A.tag){case 1:A=A.type.childContextTypes,A!=null&&no();break;case 3:wl(),Ft(An),Ft(bn),F0();break;case 5:I0(A);break;case 4:wl();break;case 13:Ft(en);break;case 19:Ft(en);break;case 10:S0(A.type._context);break;case 22:case 23:fv()}v=v.return}if(Sn=c,Mn=c=co(c.current,null),Wn=ki=f,Rn=0,Bu=null,rv=Bd=bl=0,_i=Lu=null,es!==null){for(f=0;f<es.length;f++)if(v=es[f],A=v.interleaved,A!==null){v.interleaved=null;var w=A.next,T=v.pending;if(T!==null){var O=T.next;T.next=w,A.next=O}v.pending=A}es=null}return c}function XM(c,f){do{var v=Mn;try{if(A0(),ud.current=gd,fd){for(var A=hn.memoizedState;A!==null;){var w=A.queue;w!==null&&(w.pending=null),A=A.next}fd=!1}if(Tl=0,Nn=Zn=hn=null,Su=!1,Mu=0,iv.current=null,v===null||v.return===null){Rn=1,Bu=f,Mn=null;break}e:{var T=c,O=v.return,Z=v,ce=f;if(f=Wn,Z.flags|=32768,ce!==null&&typeof ce=="object"&&typeof ce.then=="function"){var Re=ce,Je=Z,ht=Je.tag;if(!(Je.mode&1)&&(ht===0||ht===11||ht===15)){var et=Je.alternate;et?(Je.updateQueue=et.updateQueue,Je.memoizedState=et.memoizedState,Je.lanes=et.lanes):(Je.updateQueue=null,Je.memoizedState=null)}var Ht=dM(O);if(Ht!==null){Ht.flags&=-257,pM(Ht,O,Z,T,f),Ht.mode&1&&hM(T,Re,f),f=Ht,ce=Re;var Ze=f.updateQueue;if(Ze===null){var ei=new Set;ei.add(ce),f.updateQueue=ei}else Ze.add(ce);break e}else{if(!(f&1)){hM(T,Re,f),hv();break e}ce=Error(o(426))}}else if(Qt&&Z.mode&1){var or=dM(O);if(or!==null){!(or.flags&65536)&&(or.flags|=256),pM(or,O,Z,T,f),B0(ce);break e}}T=ce,Rn!==4&&(Rn=2),Lu===null?Lu=[T]:Lu.push(T),ce=G0(ce,Z),Z=O;do{switch(Z.tag){case 3:Z.flags|=65536,f&=-f,Z.lanes|=f;var ie=uM(Z,ce,f);L1(Z,ie);break e;case 1:T=ce;var q=Z.type,ae=Z.stateNode;if(!(Z.flags&128)&&(typeof q.getDerivedStateFromError=="function"||ae!==null&&typeof ae.componentDidCatch=="function"&&(so===null||!so.has(ae)))){Z.flags|=65536,f&=-f,Z.lanes|=f;var ze=fM(Z,T,f);L1(Z,ze);break e}}Z=Z.return}while(Z!==null)}YM(v)}catch(Qe){f=Qe,Mn===v&&v!==null&&(Mn=v=v.return);continue}break}while(1)}function JM(){var c=Pd.current;return Pd.current=gd,c===null?gd:c}function hv(){(Rn===0||Rn===3||Rn===2)&&(Rn=4),Sn===null||!(bl&268435455)&&!(Bd&268435455)||lo(Sn,Wn)}function Ud(c,f){var v=Mt;Mt|=2;var A=JM();Sn===c&&Wn===f||fa(c,f);do try{KD();break}catch(w){XM(c,w)}while(1);if(A0(),Mt=v,Pd.current=A,Mn!==null)throw Error(o(261));return Sn=null,Wn=0,Rn}function KD(){for(;Mn!==null;)KM(Mn)}function YD(){for(;Mn!==null&&!AD();)KM(Mn)}function KM(c){var f=qM(c.alternate,c,ki);c.memoizedProps=c.pendingProps,f===null?YM(c):Mn=f,iv.current=null}function YM(c){var f=c;do{var v=f.alternate;if(c=f.return,f.flags&32768){if(v=zD(v,f),v!==null){v.flags&=32767,Mn=v;return}if(c!==null)c.flags|=32768,c.subtreeFlags=0,c.deletions=null;else{Rn=6,Mn=null;return}}else if(v=UD(v,f,ki),v!==null){Mn=v;return}if(f=f.sibling,f!==null){Mn=f;return}Mn=f=c}while(f!==null);Rn===0&&(Rn=5)}function ha(c,f){var v=Bt,A=vn.transition;try{vn.transition=null,Bt=1,QD(c,f,v)}finally{vn.transition=A,Bt=v}return null}function QD(c,f,v){do da();while(oo!==null);if(Mt&6)throw Error(o(327));var A=c.finishedWork,w=c.finishedLanes;if(A===null)return null;if(c.finishedWork=null,c.finishedLanes=0,A===c.current)throw Error(o(177));c.callbackNode=null,c.callbackPriority=0;var T=A.lanes|A.childLanes;if(_D(c,T),c===Sn&&(Mn=Sn=null,Wn=0),!(A.subtreeFlags&2064)&&!(A.flags&2064)||Id||(Id=!0,$M(y0,function(){return da(),null})),T=(A.flags&15990)!==0,A.subtreeFlags&15990||T){T=vn.transition,vn.transition=null;var O=Bt;Bt=1;var Z=Mt;Mt|=4,iv.current=null,VD(c,A),WD(c,A),H(c.containerInfo),c.current=A,jD(A),SD(),Mt=Z,Bt=O,vn.transition=T}else c.current=A;if(Id&&(Id=!1,oo=c,Dd=w),T=c.pendingLanes,T===0&&(so=null),wD(A.stateNode),Ai(c,Fn()),f!==null)for(v=c.onRecoverableError,A=0;A<f.length;A++)v(f[A]);if(Ld)throw Ld=!1,c=av,av=null,c;return Dd&1&&c.tag!==0&&da(),T=c.pendingLanes,T&1?c===lv?Iu++:(Iu=0,lv=c):Iu=0,$r(),null}function da(){if(oo!==null){var c=C1(Dd),f=vn.transition,v=Bt;try{if(vn.transition=null,Bt=16>c?16:c,oo===null)var A=!1;else{if(c=oo,oo=null,Dd=0,Mt&6)throw Error(o(331));var w=Mt;for(Mt|=4,ke=c.current;ke!==null;){var T=ke,O=T.child;if(ke.flags&16){var Z=T.deletions;if(Z!==null){for(var ce=0;ce<Z.length;ce++){var Re=Z[ce];for(ke=Re;ke!==null;){var Je=ke;switch(Je.tag){case 0:case 11:case 15:ua(8,Je,T)}var ht=Je.child;if(ht!==null)ht.return=Je,ke=ht;else for(;ke!==null;){Je=ke;var et=Je.sibling,Ht=Je.return;if(IM(Je),Je===Re){ke=null;break}if(et!==null){et.return=Ht,ke=et;break}ke=Ht}}}var Ze=T.alternate;if(Ze!==null){var ei=Ze.child;if(ei!==null){Ze.child=null;do{var or=ei.sibling;ei.sibling=null,ei=or}while(ei!==null)}}ke=T}}if(T.subtreeFlags&2064&&O!==null)O.return=T,ke=O;else e:for(;ke!==null;){if(T=ke,T.flags&2048)switch(T.tag){case 0:case 11:case 15:ua(9,T,T.return)}var ie=T.sibling;if(ie!==null){ie.return=T.return,ke=ie;break e}ke=T.return}}var q=c.current;for(ke=q;ke!==null;){O=ke;var ae=O.child;if(O.subtreeFlags&2064&&ae!==null)ae.return=O,ke=ae;else e:for(O=q;ke!==null;){if(Z=ke,Z.flags&2048)try{switch(Z.tag){case 0:case 11:case 15:Ru(9,Z)}}catch(Qe){Si(Z,Z.return,Qe)}if(Z===O){ke=null;break e}var ze=Z.sibling;if(ze!==null){ze.return=Z.return,ke=ze;break e}ke=Z.return}}if(Mt=w,$r(),Zr&&typeof Zr.onPostCommitFiberRoot=="function")try{Zr.onPostCommitFiberRoot(qh,c)}catch{}A=!0}return A}finally{Bt=v,vn.transition=f}}return!1}function QM(c,f,v){f=G0(v,f),f=uM(c,f,1),ro(c,f),f=ui(),c=Od(c,1),c!==null&&(gu(c,1,f),Ai(c,f))}function Si(c,f,v){if(c.tag===3)QM(c,c,v);else for(;f!==null;){if(f.tag===3){QM(f,c,v);break}else if(f.tag===1){var A=f.stateNode;if(typeof f.type.getDerivedStateFromError=="function"||typeof A.componentDidCatch=="function"&&(so===null||!so.has(A))){c=G0(v,c),c=fM(f,c,1),ro(f,c),c=ui(),f=Od(f,1),f!==null&&(gu(f,1,c),Ai(f,c));break}}f=f.return}}function ZD(c,f,v){var A=c.pingCache;A!==null&&A.delete(f),f=ui(),c.pingedLanes|=c.suspendedLanes&v,Sn===c&&(Wn&v)===v&&(Rn===4||Rn===3&&(Wn&130023424)===Wn&&500>Fn()-sv?fa(c,0):rv|=v),Ai(c,f)}function ZM(c,f){f===0&&(c.mode&1?(f=Qh,Qh<<=1,!(Qh&130023424)&&(Qh=4194304)):f=1);var v=ui();c=Od(c,f),c!==null&&(gu(c,f,v),Ai(c,v))}function qD(c){var f=c.memoizedState,v=0;f!==null&&(v=f.retryLane),ZM(c,v)}function $D(c,f){var v=0;switch(c.tag){case 13:var A=c.stateNode,w=c.memoizedState;w!==null&&(v=w.retryLane);break;case 19:A=c.stateNode;break;default:throw Error(o(314))}A!==null&&A.delete(f),ZM(c,v)}var qM;qM=function(c,f,v){if(c!==null)if(c.memoizedProps!==f.pendingProps||An.current)Ui=!0;else{if(!(c.lanes&v)&&!(f.flags&128))return Ui=!1,HD(c,f,v);Ui=!!(c.flags&131072)}else Ui=!1,Qt&&f.flags&1048576&&U1(f,ad,f.index);switch(f.lanes=0,f.tag){case 2:var A=f.type;c!==null&&(c.alternate=null,f.alternate=null,f.flags|=2),c=f.pendingProps;var w=un(f,bn.current);xl(f,v),w=O0(null,f,A,c,w,v);var T=U0();return f.flags|=1,typeof w=="object"&&w!==null&&typeof w.render=="function"&&w.$$typeof===void 0?(f.tag=1,f.memoizedState=null,f.updateQueue=null,fn(A)?(T=!0,vl(f)):T=!1,f.memoizedState=w.state!==null&&w.state!==void 0?w.state:null,E0(f),w.updater=sd,f.stateNode=w,w._reactInternals=f,T0(f,A,c,v),f=j0(null,f,A,!0,T,v)):(f.tag=0,Qt&&T&&C0(f),ci(null,f,w,v),f=f.child),f;case 16:A=f.elementType;e:{switch(c!==null&&(c.alternate=null,f.alternate=null,f.flags|=2),c=f.pendingProps,w=A._init,A=w(A._payload),f.type=A,w=f.tag=tF(A),c=wr(A,c),w){case 0:f=W0(null,f,A,c,v);break e;case 1:f=SM(null,f,A,c,v);break e;case 11:f=vM(null,f,A,c,v);break e;case 14:f=yM(null,f,A,wr(A.type,c),v);break e}throw Error(o(306,A,""))}return f;case 0:return A=f.type,w=f.pendingProps,w=f.elementType===A?w:wr(A,w),W0(c,f,A,w,v);case 1:return A=f.type,w=f.pendingProps,w=f.elementType===A?w:wr(A,w),SM(c,f,A,w,v);case 3:e:{if(MM(f),c===null)throw Error(o(387));A=f.pendingProps,T=f.memoizedState,w=T.element,B1(c,f),rd(f,A,null,v);var O=f.memoizedState;if(A=O.element,ye&&T.isDehydrated)if(T={element:A,isDehydrated:!1,cache:O.cache,transitions:O.transitions},f.updateQueue.baseState=T,f.memoizedState=T,f.flags&256){w=Error(o(423)),f=EM(c,f,A,v,w);break e}else if(A!==w){w=Error(o(424)),f=EM(c,f,A,v,w);break e}else for(ye&&(Oi=u0(f.stateNode.containerInfo),Ni=f,Qt=!0,Tr=null,vu=!1),v=W1(f,null,A,v),f.child=v;v;)v.flags=v.flags&-3|4096,v=v.sibling;else{if(Sl(),A===w){f=Ts(c,f,v);break e}ci(c,f,A,v)}f=f.child}return f;case 5:return j1(f),c===null&&P0(f),A=f.type,w=f.pendingProps,T=c!==null?c.memoizedProps:null,O=w.children,Ae(A,w)?O=null:T!==null&&Ae(A,T)&&(f.flags|=32),AM(c,f),ci(c,f,O,v),f.child;case 6:return c===null&&P0(f),null;case 13:return wM(c,f,v);case 4:return L0(f,f.stateNode.containerInfo),A=f.pendingProps,c===null?f.child=Ml(f,null,A,v):ci(c,f,A,v),f.child;case 11:return A=f.type,w=f.pendingProps,w=f.elementType===A?w:wr(A,w),vM(c,f,A,w,v);case 7:return ci(c,f,f.pendingProps,v),f.child;case 8:return ci(c,f,f.pendingProps.children,v),f.child;case 12:return ci(c,f,f.pendingProps.children,v),f.child;case 10:e:{if(A=f.type._context,w=f.pendingProps,T=f.memoizedProps,O=w.value,P1(f,A,O),T!==null)if(qr(T.value,O)){if(T.children===w.children&&!An.current){f=Ts(c,f,v);break e}}else for(T=f.child,T!==null&&(T.return=f);T!==null;){var Z=T.dependencies;if(Z!==null){O=T.child;for(var ce=Z.firstContext;ce!==null;){if(ce.context===A){if(T.tag===1){ce=Ss(-1,v&-v),ce.tag=2;var Re=T.updateQueue;if(Re!==null){Re=Re.shared;var Je=Re.pending;Je===null?ce.next=ce:(ce.next=Je.next,Je.next=ce),Re.pending=ce}}T.lanes|=v,ce=T.alternate,ce!==null&&(ce.lanes|=v),M0(T.return,v,f),Z.lanes|=v;break}ce=ce.next}}else if(T.tag===10)O=T.type===f.type?null:T.child;else if(T.tag===18){if(O=T.return,O===null)throw Error(o(341));O.lanes|=v,Z=O.alternate,Z!==null&&(Z.lanes|=v),M0(O,v,f),O=T.sibling}else O=T.child;if(O!==null)O.return=T;else for(O=T;O!==null;){if(O===f){O=null;break}if(T=O.sibling,T!==null){T.return=O.return,O=T;break}O=O.return}T=O}ci(c,f,w.children,v),f=f.child}return f;case 9:return w=f.type,A=f.pendingProps.children,xl(f,v),w=$i(w),A=A(w),f.flags|=1,ci(c,f,A,v),f.child;case 14:return A=f.type,w=wr(A,f.pendingProps),w=wr(A.type,w),yM(c,f,A,w,v);case 15:return xM(c,f,f.type,f.pendingProps,v);case 17:return A=f.type,w=f.pendingProps,w=f.elementType===A?w:wr(A,w),c!==null&&(c.alternate=null,f.alternate=null,f.flags|=2),f.tag=1,fn(A)?(c=!0,vl(f)):c=!1,xl(f,v),N1(f,A,w),T0(f,A,w,v),j0(null,f,A,!0,c,v);case 19:return RM(c,f,v);case 22:return _M(c,f,v)}throw Error(o(156,f.tag))};function $M(c,f){return g0(c,f)}function eF(c,f,v,A){this.tag=c,this.key=v,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=A,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function sr(c,f,v,A){return new eF(c,f,v,A)}function dv(c){return c=c.prototype,!(!c||!c.isReactComponent)}function tF(c){if(typeof c=="function")return dv(c)?1:0;if(c!=null){if(c=c.$$typeof,c===M)return 11;if(c===x)return 14}return 2}function co(c,f){var v=c.alternate;return v===null?(v=sr(c.tag,f,c.key,c.mode),v.elementType=c.elementType,v.type=c.type,v.stateNode=c.stateNode,v.alternate=c,c.alternate=v):(v.pendingProps=f,v.type=c.type,v.flags=0,v.subtreeFlags=0,v.deletions=null),v.flags=c.flags&14680064,v.childLanes=c.childLanes,v.lanes=c.lanes,v.child=c.child,v.memoizedProps=c.memoizedProps,v.memoizedState=c.memoizedState,v.updateQueue=c.updateQueue,f=c.dependencies,v.dependencies=f===null?null:{lanes:f.lanes,firstContext:f.firstContext},v.sibling=c.sibling,v.index=c.index,v.ref=c.ref,v}function kd(c,f,v,A,w,T){var O=2;if(A=c,typeof c=="function")dv(c)&&(O=1);else if(typeof c=="string")O=5;else e:switch(c){case h:return pa(v.children,w,T,f);case d:O=8,w|=8;break;case p:return c=sr(12,v,f,w|2),c.elementType=p,c.lanes=T,c;case _:return c=sr(13,v,f,w),c.elementType=_,c.lanes=T,c;case g:return c=sr(19,v,f,w),c.elementType=g,c.lanes=T,c;case E:return Hd(v,w,T,f);default:if(typeof c=="object"&&c!==null)switch(c.$$typeof){case m:O=10;break e;case y:O=9;break e;case M:O=11;break e;case x:O=14;break e;case S:O=16,A=null;break e}throw Error(o(130,c==null?c:typeof c,""))}return f=sr(O,v,f,w),f.elementType=c,f.type=A,f.lanes=T,f}function pa(c,f,v,A){return c=sr(7,c,A,f),c.lanes=v,c}function Hd(c,f,v,A){return c=sr(22,c,A,f),c.elementType=E,c.lanes=v,c.stateNode={},c}function pv(c,f,v){return c=sr(6,c,null,f),c.lanes=v,c}function mv(c,f,v){return f=sr(4,c.children!==null?c.children:[],c.key,f),f.lanes=v,f.stateNode={containerInfo:c.containerInfo,pendingChildren:null,implementation:c.implementation},f}function nF(c,f,v,A,w){this.tag=f,this.containerInfo=c,this.finishedWork=this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=ct,this.callbackNode=this.pendingContext=this.context=null,this.callbackPriority=0,this.eventTimes=p0(0),this.expirationTimes=p0(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=p0(0),this.identifierPrefix=A,this.onRecoverableError=w,ye&&(this.mutableSourceEagerHydrationData=null)}function eE(c,f,v,A,w,T,O,Z,ce){return c=new nF(c,f,v,Z,ce),f===1?(f=1,T===!0&&(f|=8)):f=0,T=sr(3,null,null,f),c.current=T,T.stateNode=c,T.memoizedState={element:A,isDehydrated:v,cache:null,transitions:null},E0(T),c}function tE(c){if(!c)return Yn;c=c._reactInternals;e:{if(R(c)!==c||c.tag!==1)throw Error(o(170));var f=c;do{switch(f.tag){case 3:f=f.stateNode.context;break e;case 1:if(fn(f.type)){f=f.stateNode.__reactInternalMemoizedMergedChildContext;break e}}f=f.return}while(f!==null);throw Error(o(171))}if(c.tag===1){var v=c.type;if(fn(v))return gl(c,v,f)}return f}function nE(c){var f=c._reactInternals;if(f===void 0)throw typeof c.render=="function"?Error(o(188)):(c=Object.keys(c).join(","),Error(o(268,c)));return c=$(f),c===null?null:c.stateNode}function iE(c,f){if(c=c.memoizedState,c!==null&&c.dehydrated!==null){var v=c.retryLane;c.retryLane=v!==0&&v<f?v:f}}function gv(c,f){iE(c,f),(c=c.alternate)&&iE(c,f)}function iF(c){return c=$(c),c===null?null:c.stateNode}function rF(){return null}return t.attemptContinuousHydration=function(c){if(c.tag===13){var f=ui();rr(c,134217728,f),gv(c,134217728)}},t.attemptHydrationAtCurrentPriority=function(c){if(c.tag===13){var f=ui(),v=ao(c);rr(c,v,f),gv(c,v)}},t.attemptSynchronousHydration=function(c){switch(c.tag){case 3:var f=c.stateNode;if(f.current.memoizedState.isDehydrated){var v=mu(f.pendingLanes);v!==0&&(m0(f,v|1),Ai(f,Fn()),!(Mt&6)&&(Rl(),$r()))}break;case 13:var A=ui();jM(function(){return rr(c,1,A)}),gv(c,1)}},t.batchedUpdates=function(c,f){var v=Mt;Mt|=1;try{return c(f)}finally{Mt=v,Mt===0&&(Rl(),$h&&$r())}},t.createComponentSelector=function(c){return{$$typeof:wd,value:c}},t.createContainer=function(c,f,v,A,w,T,O){return eE(c,f,!1,null,v,A,w,T,O)},t.createHasPseudoClassSelector=function(c){return{$$typeof:Td,value:c}},t.createHydrationContainer=function(c,f,v,A,w,T,O,Z,ce){return c=eE(v,A,!0,c,w,T,O,Z,ce),c.context=tE(null),v=c.current,A=ui(),w=ao(v),T=Ss(A,w),T.callback=f??null,ro(v,T),c.current.lanes=w,gu(c,w,A),Ai(c,A),c},t.createPortal=function(c,f,v){var A=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:u,key:A==null?null:""+A,children:c,containerInfo:f,implementation:v}},t.createRoleSelector=function(c){return{$$typeof:Cd,value:c}},t.createTestNameSelector=function(c){return{$$typeof:bd,value:c}},t.createTextSelector=function(c){return{$$typeof:Rd,value:c}},t.deferredUpdates=function(c){var f=Bt,v=vn.transition;try{return vn.transition=null,Bt=16,c()}finally{Bt=f,vn.transition=v}},t.discreteUpdates=function(c,f,v,A,w){var T=Bt,O=vn.transition;try{return vn.transition=null,Bt=1,c(f,v,A,w)}finally{Bt=T,vn.transition=O,Mt===0&&Rl()}},t.findAllNodes=nv,t.findBoundingRects=function(c,f){if(!qe)throw Error(o(363));f=nv(c,f),c=[];for(var v=0;v<f.length;v++)c.push(Ut(f[v]));for(f=c.length-1;0<f;f--){v=c[f];for(var A=v.x,w=A+v.width,T=v.y,O=T+v.height,Z=f-1;0<=Z;Z--)if(f!==Z){var ce=c[Z],Re=ce.x,Je=Re+ce.width,ht=ce.y,et=ht+ce.height;if(A>=Re&&T>=ht&&w<=Je&&O<=et){c.splice(f,1);break}else if(A!==Re||v.width!==ce.width||et<T||ht>O){if(!(T!==ht||v.height!==ce.height||Je<A||Re>w)){Re>A&&(ce.width+=Re-A,ce.x=A),Je<w&&(ce.width=w-Re),c.splice(f,1);break}}else{ht>T&&(ce.height+=ht-T,ce.y=T),et<O&&(ce.height=O-ht),c.splice(f,1);break}}}return c},t.findHostInstance=nE,t.findHostInstanceWithNoPortals=function(c){return c=z(c),c=c!==null?Q(c):null,c===null?null:c.stateNode},t.findHostInstanceWithWarning=function(c){return nE(c)},t.flushControlled=function(c){var f=Mt;Mt|=1;var v=vn.transition,A=Bt;try{vn.transition=null,Bt=1,c()}finally{Bt=A,vn.transition=v,Mt=f,Mt===0&&(Rl(),$r())}},t.flushPassiveEffects=da,t.flushSync=jM,t.focusWithin=function(c,f){if(!qe)throw Error(o(363));for(c=$0(c),f=GM(c,f),f=Array.from(f),c=0;c<f.length;){var v=f[c++];if(!D(v)){if(v.tag===5&&we(v.stateNode))return!0;for(v=v.child;v!==null;)f.push(v),v=v.sibling}}return!1},t.getCurrentUpdatePriority=function(){return Bt},t.getFindAllNodesFailureDescription=function(c,f){if(!qe)throw Error(o(363));var v=0,A=[];c=[$0(c),0];for(var w=0;w<c.length;){var T=c[w++],O=c[w++],Z=f[O];if((T.tag!==5||!D(T))&&(ev(T,Z)&&(A.push(tv(Z)),O++,O>v&&(v=O)),O<f.length))for(T=T.child;T!==null;)c.push(T,O),T=T.sibling}if(v<f.length){for(c=[];v<f.length;v++)c.push(tv(f[v]));return`findAllNodes was able to match part of the selector:
  `+(A.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 ne(c.child.stateNode);default:return c.child.stateNode}},t.injectIntoDevTools=function(c){if(c={bundleType:c.bundleType,version:c.version,rendererPackageName:c.rendererPackageName,rendererConfig:c.rendererConfig,overrideHookState:null,overrideHookStateDeletePath:null,overrideHookStateRenamePath:null,overrideProps:null,overridePropsDeletePath:null,overridePropsRenamePath:null,setErrorHandler:null,setSuspenseHandler:null,scheduleUpdate:null,currentDispatcherRef:a.ReactCurrentDispatcher,findHostInstanceByFiber:iF,findFiberByHostInstance:c.findFiberByHostInstance||rF,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{qh=f.inject(c),Zr=f}catch{}c=!!f.checkDCE}}return c},t.isAlreadyRendering=function(){return!1},t.observeVisibleRects=function(c,f,v,A){if(!qe)throw Error(o(363));c=nv(c,f);var w=_e(c,v,A).disconnect;return{disconnect:function(){w()}}},t.registerMutableSourceForHydration=function(c,f){var v=f._getVersion;v=v(f._source),c.mutableSourceEagerHydrationData==null?c.mutableSourceEagerHydrationData=[f,v]:c.mutableSourceEagerHydrationData.push(f,v)},t.runWithPriority=function(c,f){var v=Bt;try{return Bt=c,f()}finally{Bt=v}},t.shouldError=function(){return null},t.shouldSuspend=function(){return!1},t.updateContainer=function(c,f,v,A){var w=f.current,T=ui(),O=ao(w);return v=tE(v),f.context===null?f.context=v:f.pendingContext=v,f=Ss(T,O),f.payload={element:c},A=A===void 0?null:A,A!==null&&(f.callback=A),ro(w,f),c=rr(w,O,T),c!==null&&id(c,w,O),O},t};sL.exports=XV;var JV=sL.exports;const KV=su(JV);var oL={exports:{}},aL={};/**
 * @license React
 * scheduler.production.min.js
 *
 * Copyright (c) Facebook, Inc. and its affiliates.
 *
 * This source code is licensed under the MIT license found in the
 * LICENSE file in the root directory of this source tree.
 */(function(n){function e(I,V){var H=I.length;I.push(V);e:for(;0<H;){var U=H-1>>>1,W=I[U];if(0<r(W,V))I[U]=V,I[H]=W,H=U;else break e}}function t(I){return I.length===0?null:I[0]}function i(I){if(I.length===0)return null;var V=I[0],H=I.pop();if(H!==V){I[0]=H;e:for(var U=0,W=I.length,ve=W>>>1;U<ve;){var ue=2*(U+1)-1,Ae=I[ue],Ee=ue+1,Ne=I[Ee];if(0>r(Ae,H))Ee<W&&0>r(Ne,Ae)?(I[U]=Ne,I[Ee]=H,U=Ee):(I[U]=Ae,I[ue]=H,U=ue);else if(Ee<W&&0>r(Ne,H))I[U]=Ne,I[Ee]=H,U=Ee;else break e}}return V}function r(I,V){var H=I.sortIndex-V.sortIndex;return H!==0?H:I.id-V.id}if(typeof performance=="object"&&typeof performance.now=="function"){var s=performance;n.unstable_now=function(){return s.now()}}else{var o=Date,a=o.now();n.unstable_now=function(){return o.now()-a}}var l=[],u=[],h=1,d=null,p=3,m=!1,y=!1,M=!1,_=typeof setTimeout=="function"?setTimeout:null,g=typeof clearTimeout=="function"?clearTimeout:null,x=typeof setImmediate<"u"?setImmediate:null;typeof navigator<"u"&&navigator.scheduling!==void 0&&navigator.scheduling.isInputPending!==void 0&&navigator.scheduling.isInputPending.bind(navigator.scheduling);function S(I){for(var V=t(u);V!==null;){if(V.callback===null)i(u);else if(V.startTime<=I)i(u),V.sortIndex=V.expirationTime,e(l,V);else break;V=t(u)}}function E(I){if(M=!1,S(I),!y)if(t(l)!==null)y=!0,ne(C);else{var V=t(u);V!==null&&ee(E,V.startTime-I)}}function C(I,V){y=!1,M&&(M=!1,g(B),B=-1),m=!0;var H=p;try{for(S(V),d=t(l);d!==null&&(!(d.expirationTime>V)||I&&!z());){var U=d.callback;if(typeof U=="function"){d.callback=null,p=d.priorityLevel;var W=U(d.expirationTime<=V);V=n.unstable_now(),typeof W=="function"?d.callback=W:d===t(l)&&i(l),S(V)}else i(l);d=t(l)}if(d!==null)var ve=!0;else{var ue=t(u);ue!==null&&ee(E,ue.startTime-V),ve=!1}return ve}finally{d=null,p=H,m=!1}}var b=!1,P=null,B=-1,R=5,L=-1;function z(){return!(n.unstable_now()-L<R)}function $(){if(P!==null){var I=n.unstable_now();L=I;var V=!0;try{V=P(!0,I)}finally{V?X():(b=!1,P=null)}}else b=!1}var X;if(typeof x=="function")X=function(){x($)};else if(typeof MessageChannel<"u"){var Q=new MessageChannel,Y=Q.port2;Q.port1.onmessage=$,X=function(){Y.postMessage(null)}}else X=function(){_($,0)};function ne(I){P=I,b||(b=!0,X())}function ee(I,V){B=_(function(){I(n.unstable_now())},V)}n.unstable_IdlePriority=5,n.unstable_ImmediatePriority=1,n.unstable_LowPriority=4,n.unstable_NormalPriority=3,n.unstable_Profiling=null,n.unstable_UserBlockingPriority=2,n.unstable_cancelCallback=function(I){I.callback=null},n.unstable_continueExecution=function(){y||m||(y=!0,ne(C))},n.unstable_forceFrameRate=function(I){0>I||125<I?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):R=0<I?Math.floor(1e3/I):5},n.unstable_getCurrentPriorityLevel=function(){return p},n.unstable_getFirstCallbackNode=function(){return t(l)},n.unstable_next=function(I){switch(p){case 1:case 2:case 3:var V=3;break;default:V=p}var H=p;p=V;try{return I()}finally{p=H}},n.unstable_pauseExecution=function(){},n.unstable_requestPaint=function(){},n.unstable_runWithPriority=function(I,V){switch(I){case 1:case 2:case 3:case 4:case 5:break;default:I=3}var H=p;p=I;try{return V()}finally{p=H}},n.unstable_scheduleCallback=function(I,V,H){var U=n.unstable_now();switch(typeof H=="object"&&H!==null?(H=H.delay,H=typeof H=="number"&&0<H?U+H:U):H=U,I){case 1:var W=-1;break;case 2:W=250;break;case 5:W=1073741823;break;case 4:W=1e4;break;default:W=5e3}return W=H+W,I={id:h++,callback:V,priorityLevel:I,startTime:H,expirationTime:W,sortIndex:-1},H>U?(I.sortIndex=H,e(u,I),t(l)===null&&I===t(u)&&(M?(g(B),B=-1):M=!0,ee(E,H-U))):(I.sortIndex=W,e(l,I),y||m||(y=!0,ne(C))),I},n.unstable_shouldYield=z,n.unstable_wrapCallback=function(I){var V=p;return function(){var H=p;p=V;try{return I.apply(this,arguments)}finally{p=H}}}})(aL);oL.exports=aL;var YT=oL.exports;const YV=n=>typeof n=="object"&&typeof n.then=="function",Wa=[];function lL(n,e,t=(i,r)=>i===r){if(n===e)return!0;if(!n||!e)return!1;const i=n.length;if(e.length!==i)return!1;for(let r=0;r<i;r++)if(!t(n[r],e[r]))return!1;return!0}function cL(n,e=null,t=!1,i={}){e===null&&(e=[n]);for(const s of Wa)if(lL(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 i.lifespan&&i.lifespan>0&&(s.timeout&&clearTimeout(s.timeout),s.timeout=setTimeout(s.remove,i.lifespan)),s.response;if(!t)throw s.promise}const r={keys:e,equal:i.equal,remove:()=>{const s=Wa.indexOf(r);s!==-1&&Wa.splice(s,1)},promise:(YV(n)?n:n(...e)).then(s=>{r.response=s,i.lifespan&&i.lifespan>0&&(r.timeout=setTimeout(r.remove,i.lifespan))}).catch(s=>r.error=s)};if(Wa.push(r),!t)throw r.promise}const QV=(n,e,t)=>cL(n,e,!1,t),ZV=(n,e,t)=>void cL(n,e,!0,t),qV=n=>{if(n===void 0||n.length===0)Wa.splice(0,Wa.length);else{const e=Wa.find(t=>lL(n,t.keys,t.equal));e&&e.remove()}},e1={},$V=n=>void Object.assign(e1,n);function e5(n,e){function t(h,{args:d=[],attach:p,...m},y){let M=`${h[0].toUpperCase()}${h.slice(1)}`,_;if(h==="primitive"){if(m.object===void 0)throw new Error("R3F: Primitives without 'object' are invalid!");const g=m.object;_=nc(g,{type:h,root:y,attach:p,primitive:!0})}else{const g=e1[M];if(!g)throw new Error(`R3F: ${M} 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(d))throw new Error("R3F: The args prop must be an array!");_=nc(new g(...d),{type:h,root:y,attach:p,memoizedProps:{args:d}})}return _.__r3f.attach===void 0&&(_ instanceof gt?_.__r3f.attach="geometry":_ instanceof Cn&&(_.__r3f.attach="material")),M!=="inject"&&Cy(_,m),_}function i(h,d){let p=!1;if(d){var m,y;(m=d.__r3f)!=null&&m.attach?Ty(h,d,d.__r3f.attach):d.isObject3D&&h.isObject3D&&(h.add(d),p=!0),p||(y=h.__r3f)==null||y.objects.push(d),d.__r3f||nc(d,{}),d.__r3f.parent=h,U_(d),ic(d)}}function r(h,d,p){let m=!1;if(d){var y,M;if((y=d.__r3f)!=null&&y.attach)Ty(h,d,d.__r3f.attach);else if(d.isObject3D&&h.isObject3D){d.parent=h,d.dispatchEvent({type:"added"});const _=h.children.filter(x=>x!==d),g=_.indexOf(p);h.children=[..._.slice(0,g),d,..._.slice(g)],m=!0}m||(M=h.__r3f)==null||M.objects.push(d),d.__r3f||nc(d,{}),d.__r3f.parent=h,U_(d),ic(d)}}function s(h,d,p=!1){h&&[...h].forEach(m=>o(d,m,p))}function o(h,d,p){if(d){var m,y,M;if(d.__r3f&&(d.__r3f.parent=null),(m=h.__r3f)!=null&&m.objects&&(h.__r3f.objects=h.__r3f.objects.filter(E=>E!==d)),(y=d.__r3f)!=null&&y.attach)eC(h,d,d.__r3f.attach);else if(d.isObject3D&&h.isObject3D){var _;h.remove(d),(_=d.__r3f)!=null&&_.root&&l5(d.__r3f.root,d)}const x=(M=d.__r3f)==null?void 0:M.primitive,S=p===void 0?d.dispose!==null&&!x:p;if(!x){var g;s((g=d.__r3f)==null?void 0:g.objects,d,S),s(d.children,d,S)}delete d.__r3f,S&&d.dispose&&d.type!=="Scene"&&YT.unstable_scheduleCallback(YT.unstable_IdlePriority,()=>{try{d.dispose()}catch{}}),ic(h)}}function a(h,d,p,m){var y;const M=(y=h.__r3f)==null?void 0:y.parent;if(!M)return;const _=t(d,p,h.__r3f.root);if(h.children){for(const g of h.children)g.__r3f&&i(_,g);h.children=h.children.filter(g=>!g.__r3f)}h.__r3f.objects.forEach(g=>i(_,g)),h.__r3f.objects=[],h.__r3f.autoRemovedBeforeAppend||o(M,h),_.parent&&(_.__r3f.autoRemovedBeforeAppend=!0),i(M,_),_.raycast&&_.__r3f.eventCount&&_.__r3f.root.getState().internal.interaction.push(_),[m,m.alternate].forEach(g=>{g!==null&&(g.stateNode=_,g.ref&&(typeof g.ref=="function"?g.ref(_):g.ref.current=_))})}const l=()=>console.warn("Text is not allowed in the R3F tree! This could be stray whitespace or characters.");return{reconciler:KV({createInstance:t,removeChild:o,appendChild:i,appendInitialChild:i,insertBefore:r,supportsMutation:!0,isPrimaryRenderer:!1,supportsPersistence:!1,supportsHydration:!1,noTimeout:-1,appendChildToContainer:(h,d)=>{if(!d)return;const p=h.getState().scene;p.__r3f&&(p.__r3f.root=h,i(p,d))},removeChildFromContainer:(h,d)=>{d&&o(h.getState().scene,d)},insertInContainerBefore:(h,d,p)=>{if(!d||!p)return;const m=h.getState().scene;m.__r3f&&r(m,d,p)},getRootHostContext:()=>null,getChildHostContext:h=>h,finalizeInitialChildren(h){var d;return!!((d=h==null?void 0:h.__r3f)!=null?d:{}).handlers},prepareUpdate(h,d,p,m){var y;if(((y=h==null?void 0:h.__r3f)!=null?y:{}).primitive&&m.object&&m.object!==h)return[!0];{const{args:_=[],children:g,...x}=m,{args:S=[],children:E,...C}=p;if(!Array.isArray(_))throw new Error("R3F: the args prop must be an array!");if(_.some((P,B)=>P!==S[B]))return[!0];const b=gL(h,x,C,!0);return b.changes.length?[!1,b]:null}},commitUpdate(h,[d,p],m,y,M,_){d?a(h,m,M,_):Cy(h,p)},commitMount(h,d,p,m){var y;const M=(y=h.__r3f)!=null?y:{};h.raycast&&M.handlers&&M.eventCount&&h.__r3f.root.getState().internal.interaction.push(h)},getPublicInstance:h=>h,prepareForCommit:()=>null,preparePortalMount:h=>nc(h.getState().scene),resetAfterCommit:()=>{},shouldSetTextContent:()=>!1,clearContainer:()=>!1,hideInstance(h){var d;const{attach:p,parent:m}=(d=h.__r3f)!=null?d:{};p&&m&&eC(m,h,p),h.isObject3D&&(h.visible=!1),ic(h)},unhideInstance(h,d){var p;const{attach:m,parent:y}=(p=h.__r3f)!=null?p:{};m&&y&&Ty(y,h,m),(h.isObject3D&&d.visible==null||d.visible)&&(h.visible=!0),ic(h)},createTextInstance:l,hideTextInstance:l,unhideTextInstance:l,getCurrentEventPriority:()=>e?e():_c.DefaultEventPriority,beforeActiveInstanceBlur:()=>{},afterActiveInstanceBlur:()=>{},detachDeletedInstance:()=>{},now:typeof performance<"u"&&Kt.fun(performance.now)?performance.now:Kt.fun(Date.now)?Date.now:()=>0,scheduleTimeout:Kt.fun(setTimeout)?setTimeout:void 0,cancelTimeout:Kt.fun(clearTimeout)?clearTimeout:void 0}),applyProps:Cy}}var QT,ZT;const wy=n=>"colorSpace"in n||"outputColorSpace"in n,uL=()=>{var n;return(n=e1.ColorManagement)!=null?n:null},fL=n=>n&&n.isOrthographicCamera,t5=n=>n&&n.hasOwnProperty("current"),Fh=typeof window<"u"&&((QT=window.document)!=null&&QT.createElement||((ZT=window.navigator)==null?void 0:ZT.product)==="ReactNative")?J.useLayoutEffect:J.useEffect;function hL(n){const e=J.useRef(n);return Fh(()=>void(e.current=n),[n]),e}function n5({set:n}){return Fh(()=>(n(new Promise(()=>null)),()=>n(!1)),[n]),null}class dL extends J.Component{constructor(...e){super(...e),this.state={error:!1}}componentDidCatch(e){this.props.set(e)}render(){return this.state.error?null:this.props.children}}dL.getDerivedStateFromError=()=>({error:!0});const pL="__default",qT=new Map,i5=n=>n&&!!n.memoized&&!!n.changes;function mL(n){var e;const t=typeof window<"u"?(e=window.devicePixelRatio)!=null?e:2:1;return Array.isArray(n)?Math.min(Math.max(n[0],t),n[1]):n}const qu=n=>{var e;return(e=n.__r3f)==null?void 0:e.root.getState()},Kt={obj:n=>n===Object(n)&&!Kt.arr(n)&&typeof n!="function",fun:n=>typeof n=="function",str:n=>typeof n=="string",num:n=>typeof n=="number",boo:n=>typeof n=="boolean",und:n=>n===void 0,arr:n=>Array.isArray(n),equ(n,e,{arrays:t="shallow",objects:i="reference",strict:r=!0}={}){if(typeof n!=typeof e||!!n!=!!e)return!1;if(Kt.str(n)||Kt.num(n))return n===e;const s=Kt.obj(n);if(s&&i==="reference")return n===e;const o=Kt.arr(n);if(o&&t==="reference")return n===e;if((o||s)&&n===e)return!0;let a;for(a in n)if(!(a in e))return!1;if(s&&t==="shallow"&&i==="shallow"){for(a in r?e:n)if(!Kt.equ(n[a],e[a],{strict:r,objects:"reference"}))return!1}else for(a in r?e:n)if(n[a]!==e[a])return!1;if(Kt.und(a)){if(o&&n.length===0&&e.length===0||s&&Object.keys(n).length===0&&Object.keys(e).length===0)return!0;if(n!==e)return!1}return!0}};function r5(n){const e={nodes:{},materials:{}};return n&&n.traverse(t=>{t.name&&(e.nodes[t.name]=t),t.material&&!e.materials[t.material.name]&&(e.materials[t.material.name]=t.material)}),e}function s5(n){n.dispose&&n.type!=="Scene"&&n.dispose();for(const e in n)e.dispose==null||e.dispose(),delete n[e]}function nc(n,e){const t=n;return t.__r3f={type:"",root:null,previousAttach:null,memoizedProps:{},eventCount:0,handlers:{},objects:[],parent:null,...e},n}function O_(n,e){let t=n;if(e.includes("-")){const i=e.split("-"),r=i.pop();return t=i.reduce((s,o)=>s[o],n),{target:t,key:r}}else return{target:t,key:e}}const $T=/-\d+$/;function Ty(n,e,t){if(Kt.str(t)){if($T.test(t)){const s=t.replace($T,""),{target:o,key:a}=O_(n,s);Array.isArray(o[a])||(o[a]=[])}const{target:i,key:r}=O_(n,t);e.__r3f.previousAttach=i[r],i[r]=e}else e.__r3f.previousAttach=t(n,e)}function eC(n,e,t){var i,r;if(Kt.str(t)){const{target:s,key:o}=O_(n,t),a=e.__r3f.previousAttach;a===void 0?delete s[o]:s[o]=a}else(i=e.__r3f)==null||i.previousAttach==null||i.previousAttach(n,e);(r=e.__r3f)==null||delete r.previousAttach}function gL(n,{children:e,key:t,ref:i,...r},{children:s,key:o,ref:a,...l}={},u=!1){var h;const d=(h=n==null?void 0:n.__r3f)!=null?h:{},p=Object.entries(r),m=[];if(u){const M=Object.keys(l);for(let _=0;_<M.length;_++)r.hasOwnProperty(M[_])||p.unshift([M[_],pL+"remove"])}p.forEach(([M,_])=>{var g;if((g=n.__r3f)!=null&&g.primitive&&M==="object"||Kt.equ(_,l[M]))return;if(/^on(Pointer|Click|DoubleClick|ContextMenu|Wheel)/.test(M))return m.push([M,_,!0,[]]);let x=[];M.includes("-")&&(x=M.split("-")),m.push([M,_,!1,x]);for(const S in r){const E=r[S];S.startsWith(`${M}-`)&&m.push([S,E,!1,S.split("-")])}});const y={...r};return d.memoizedProps&&d.memoizedProps.args&&(y.args=d.memoizedProps.args),d.memoizedProps&&d.memoizedProps.attach&&(y.attach=d.memoizedProps.attach),{memoized:y,changes:m}}function Cy(n,e){var t,i,r;const s=(t=n.__r3f)!=null?t:{},o=s.root,a=(i=o==null||o.getState==null?void 0:o.getState())!=null?i:{},{memoized:l,changes:u}=i5(e)?e:gL(n,e),h=s.eventCount;n.__r3f&&(n.__r3f.memoizedProps=l);for(let p=0;p<u.length;p++){let[m,y,M,_]=u[p];if(wy(n)){const E="srgb",C="srgb-linear";m==="encoding"?(m="colorSpace",y=y===3001?E:C):m==="outputEncoding"&&(m="outputColorSpace",y=y===3001?E:C)}let g=n,x=g[m];if(_.length&&(x=_.reduce((S,E)=>S[E],n),!(x&&x.set))){const[S,...E]=_.reverse();g=E.reverse().reduce((C,b)=>C[b],n),m=S}if(y===pL+"remove")if(g.constructor){let S=qT.get(g.constructor);S||(S=new g.constructor,qT.set(g.constructor,S)),y=S[m]}else y=0;if(M)y?s.handlers[m]=y:delete s.handlers[m],s.eventCount=Object.keys(s.handlers).length;else if(x&&x.set&&(x.copy||x instanceof Za)){if(Array.isArray(y))x.fromArray?x.fromArray(y):x.set(...y);else if(x.copy&&y&&y.constructor&&x.constructor===y.constructor)x.copy(y);else if(y!==void 0){const S=x instanceof Oe;!S&&x.setScalar?x.setScalar(y):x instanceof Za&&y instanceof Za?x.mask=y.mask:x.set(y),!uL()&&!a.linear&&S&&x.convertSRGBToLinear()}}else if(g[m]=y,g[m]instanceof $t&&g[m].format===Ti&&g[m].type===hs){const S=g[m];wy(S)&&wy(a.gl)?S.colorSpace=a.gl.outputColorSpace:S.encoding=a.gl.outputEncoding}ic(n)}if(s.parent&&a.internal&&n.raycast&&h!==s.eventCount){const p=a.internal.interaction.indexOf(n);p>-1&&a.internal.interaction.splice(p,1),s.eventCount&&a.internal.interaction.push(n)}return!(u.length===1&&u[0][0]==="onUpdate")&&u.length&&(r=n.__r3f)!=null&&r.parent&&U_(n),n}function ic(n){var e,t;const i=(e=n.__r3f)==null||(t=e.root)==null||t.getState==null?void 0:t.getState();i&&i.internal.frames===0&&i.invalidate()}function U_(n){n.onUpdate==null||n.onUpdate(n)}function o5(n,e){n.manual||(fL(n)?(n.left=e.width/-2,n.right=e.width/2,n.top=e.height/2,n.bottom=e.height/-2):n.aspect=e.width/e.height,n.updateProjectionMatrix(),n.updateMatrixWorld())}function jp(n){return(n.eventObject||n.object).uuid+"/"+n.index+n.instanceId}function a5(){var n;const e=typeof self<"u"&&self||typeof window<"u"&&window;if(!e)return _c.DefaultEventPriority;switch((n=e.event)==null?void 0:n.type){case"click":case"contextmenu":case"dblclick":case"pointercancel":case"pointerdown":case"pointerup":return _c.DiscreteEventPriority;case"pointermove":case"pointerout":case"pointerover":case"pointerenter":case"pointerleave":case"wheel":return _c.ContinuousEventPriority;default:return _c.DefaultEventPriority}}function vL(n,e,t,i){const r=t.get(e);r&&(t.delete(e),t.size===0&&(n.delete(i),r.target.releasePointerCapture(i)))}function l5(n,e){const{internal:t}=n.getState();t.interaction=t.interaction.filter(i=>i!==e),t.initialHits=t.initialHits.filter(i=>i!==e),t.hovered.forEach((i,r)=>{(i.eventObject===e||i.object===e)&&t.hovered.delete(r)}),t.capturedMap.forEach((i,r)=>{vL(t.capturedMap,e,i,r)})}function c5(n){function e(l){const{internal:u}=n.getState(),h=l.offsetX-u.initialClick[0],d=l.offsetY-u.initialClick[1];return Math.round(Math.sqrt(h*h+d*d))}function t(l){return l.filter(u=>["Move","Over","Enter","Out","Leave"].some(h=>{var d;return(d=u.__r3f)==null?void 0:d.handlers["onPointer"+h]}))}function i(l,u){const h=n.getState(),d=new Set,p=[],m=u?u(h.internal.interaction):h.internal.interaction;for(let g=0;g<m.length;g++){const x=qu(m[g]);x&&(x.raycaster.camera=void 0)}h.previousRoot||h.events.compute==null||h.events.compute(l,h);function y(g){const x=qu(g);if(!x||!x.events.enabled||x.raycaster.camera===null)return[];if(x.raycaster.camera===void 0){var S;x.events.compute==null||x.events.compute(l,x,(S=x.previousRoot)==null?void 0:S.getState()),x.raycaster.camera===void 0&&(x.raycaster.camera=null)}return x.raycaster.camera?x.raycaster.intersectObject(g,!0):[]}let M=m.flatMap(y).sort((g,x)=>{const S=qu(g.object),E=qu(x.object);return!S||!E?g.distance-x.distance:E.events.priority-S.events.priority||g.distance-x.distance}).filter(g=>{const x=jp(g);return d.has(x)?!1:(d.add(x),!0)});h.events.filter&&(M=h.events.filter(M,h));for(const g of M){let x=g.object;for(;x;){var _;(_=x.__r3f)!=null&&_.eventCount&&p.push({...g,eventObject:x}),x=x.parent}}if("pointerId"in l&&h.internal.capturedMap.has(l.pointerId))for(let g of h.internal.capturedMap.get(l.pointerId).values())d.has(jp(g.intersection))||p.push(g.intersection);return p}function r(l,u,h,d){const p=n.getState();if(l.length){const m={stopped:!1};for(const y of l){const M=qu(y.object)||p,{raycaster:_,pointer:g,camera:x,internal:S}=M,E=new F(g.x,g.y,0).unproject(x),C=L=>{var z,$;return(z=($=S.capturedMap.get(L))==null?void 0:$.has(y.eventObject))!=null?z:!1},b=L=>{const z={intersection:y,target:u.target};S.capturedMap.has(L)?S.capturedMap.get(L).set(y.eventObject,z):S.capturedMap.set(L,new Map([[y.eventObject,z]])),u.target.setPointerCapture(L)},P=L=>{const z=S.capturedMap.get(L);z&&vL(S.capturedMap,y.eventObject,z,L)};let B={};for(let L in u){let z=u[L];typeof z!="function"&&(B[L]=z)}let R={...y,...B,pointer:g,intersections:l,stopped:m.stopped,delta:h,unprojectedPoint:E,ray:_.ray,camera:x,stopPropagation(){const L="pointerId"in u&&S.capturedMap.get(u.pointerId);if((!L||L.has(y.eventObject))&&(R.stopped=m.stopped=!0,S.hovered.size&&Array.from(S.hovered.values()).find(z=>z.eventObject===y.eventObject))){const z=l.slice(0,l.indexOf(y));s([...z,y])}},target:{hasPointerCapture:C,setPointerCapture:b,releasePointerCapture:P},currentTarget:{hasPointerCapture:C,setPointerCapture:b,releasePointerCapture:P},nativeEvent:u};if(d(R),m.stopped===!0)break}}return l}function s(l){const{internal:u}=n.getState();for(const h of u.hovered.values())if(!l.length||!l.find(d=>d.object===h.object&&d.index===h.index&&d.instanceId===h.instanceId)){const p=h.eventObject.__r3f,m=p==null?void 0:p.handlers;if(u.hovered.delete(jp(h)),p!=null&&p.eventCount){const y={...h,intersections:l};m.onPointerOut==null||m.onPointerOut(y),m.onPointerLeave==null||m.onPointerLeave(y)}}}function o(l,u){for(let h=0;h<u.length;h++){const d=u[h].__r3f;d==null||d.handlers.onPointerMissed==null||d.handlers.onPointerMissed(l)}}function a(l){switch(l){case"onPointerLeave":case"onPointerCancel":return()=>s([]);case"onLostPointerCapture":return u=>{const{internal:h}=n.getState();"pointerId"in u&&h.capturedMap.has(u.pointerId)&&requestAnimationFrame(()=>{h.capturedMap.has(u.pointerId)&&(h.capturedMap.delete(u.pointerId),s([]))})}}return function(h){const{onPointerMissed:d,internal:p}=n.getState();p.lastEvent.current=h;const m=l==="onPointerMove",y=l==="onClick"||l==="onContextMenu"||l==="onDoubleClick",_=i(h,m?t:void 0),g=y?e(h):0;l==="onPointerDown"&&(p.initialClick=[h.offsetX,h.offsetY],p.initialHits=_.map(S=>S.eventObject)),y&&!_.length&&g<=2&&(o(h,p.interaction),d&&d(h)),m&&s(_);function x(S){const E=S.eventObject,C=E.__r3f,b=C==null?void 0:C.handlers;if(C!=null&&C.eventCount)if(m){if(b.onPointerOver||b.onPointerEnter||b.onPointerOut||b.onPointerLeave){const P=jp(S),B=p.hovered.get(P);B?B.stopped&&S.stopPropagation():(p.hovered.set(P,S),b.onPointerOver==null||b.onPointerOver(S),b.onPointerEnter==null||b.onPointerEnter(S))}b.onPointerMove==null||b.onPointerMove(S)}else{const P=b[l];P?(!y||p.initialHits.includes(E))&&(o(h,p.interaction.filter(B=>!p.initialHits.includes(B))),P(S)):y&&p.initialHits.includes(E)&&o(h,p.interaction.filter(B=>!p.initialHits.includes(B)))}}r(_,h,g,x)}}return{handlePointer:a}}const yL=n=>!!(n!=null&&n.render),xL=J.createContext(null),u5=(n,e)=>{const t=rL((a,l)=>{const u=new F,h=new F,d=new F;function p(g=l().camera,x=h,S=l().size){const{width:E,height:C,top:b,left:P}=S,B=E/C;x instanceof F?d.copy(x):d.set(...x);const R=g.getWorldPosition(u).distanceTo(d);if(fL(g))return{width:E/g.zoom,height:C/g.zoom,top:b,left:P,factor:1,distance:R,aspect:B};{const L=g.fov*Math.PI/180,z=2*Math.tan(L/2)*R,$=z*(E/C);return{width:$,height:z,top:b,left:P,factor:E/$,distance:R,aspect:B}}}let m;const y=g=>a(x=>({performance:{...x.performance,current:g}})),M=new ge;return{set:a,get:l,gl:null,camera:null,raycaster:null,events:{priority:1,enabled:!0,connected:!1},xr:null,scene:null,invalidate:(g=1)=>n(l(),g),advance:(g,x)=>e(g,x,l()),legacy:!1,linear:!1,flat:!1,controls:null,clock:new QS,pointer:M,mouse:M,frameloop:"always",onPointerMissed:void 0,performance:{current:1,min:.5,max:1,debounce:200,regress:()=>{const g=l();m&&clearTimeout(m),g.performance.current!==g.performance.min&&y(g.performance.min),m=setTimeout(()=>y(l().performance.max),g.performance.debounce)}},size:{width:0,height:0,top:0,left:0,updateStyle:!1},viewport:{initialDpr:0,dpr:0,width:0,height:0,top:0,left:0,aspect:0,distance:0,factor:0,getCurrentViewport:p},setEvents:g=>a(x=>({...x,events:{...x.events,...g}})),setSize:(g,x,S,E,C)=>{const b=l().camera,P={width:g,height:x,top:E||0,left:C||0,updateStyle:S};a(B=>({size:P,viewport:{...B.viewport,...p(b,h,P)}}))},setDpr:g=>a(x=>{const S=mL(g);return{viewport:{...x.viewport,dpr:S,initialDpr:x.viewport.initialDpr||S}}}),setFrameloop:(g="always")=>{const x=l().clock;x.stop(),x.elapsedTime=0,g!=="never"&&(x.start(),x.elapsedTime=0),a(()=>({frameloop:g}))},previousRoot:void 0,internal:{active:!1,priority:0,frames:0,lastEvent:J.createRef(),interaction:[],hovered:new Map,subscribers:[],initialClick:[0,0],initialHits:[],capturedMap:new Map,subscribe:(g,x,S)=>{const E=l().internal;return E.priority=E.priority+(x>0?1:0),E.subscribers.push({ref:g,priority:x,store:S}),E.subscribers=E.subscribers.sort((C,b)=>C.priority-b.priority),()=>{const C=l().internal;C!=null&&C.subscribers&&(C.priority=C.priority-(x>0?1:0),C.subscribers=C.subscribers.filter(b=>b.ref!==g))}}}}}),i=t.getState();let r=i.size,s=i.viewport.dpr,o=i.camera;return t.subscribe(()=>{const{camera:a,size:l,viewport:u,gl:h,set:d}=t.getState();if(l!==r||u.dpr!==s){var p;r=l,s=u.dpr,o5(a,l),h.setPixelRatio(u.dpr);const m=(p=l.updateStyle)!=null?p:typeof HTMLCanvasElement<"u"&&h.domElement instanceof HTMLCanvasElement;h.setSize(l.width,l.height,m)}a!==o&&(o=a,d(m=>({viewport:{...m.viewport,...m.viewport.getCurrentViewport(a)}})))}),t.subscribe(a=>n(a)),t};let Xp,f5=new Set,h5=new Set,d5=new Set;function by(n,e){if(n.size)for(const{callback:t}of n.values())t(e)}function $u(n,e){switch(n){case"before":return by(f5,e);case"after":return by(h5,e);case"tail":return by(d5,e)}}let Ry,Py;function By(n,e,t){let i=e.clock.getDelta();for(e.frameloop==="never"&&typeof n=="number"&&(i=n-e.clock.elapsedTime,e.clock.oldTime=e.clock.elapsedTime,e.clock.elapsedTime=n),Ry=e.internal.subscribers,Xp=0;Xp<Ry.length;Xp++)Py=Ry[Xp],Py.ref.current(Py.store.getState(),i,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 p5(n){let e=!1,t,i,r;function s(l){i=requestAnimationFrame(s),e=!0,t=0,$u("before",l);for(const h of n.values()){var u;r=h.store.getState(),r.internal.active&&(r.frameloop==="always"||r.internal.frames>0)&&!((u=r.gl.xr)!=null&&u.isPresenting)&&(t+=By(l,r))}if($u("after",l),t===0)return $u("tail",l),e=!1,cancelAnimationFrame(i)}function o(l,u=1){var h;if(!l)return n.forEach(d=>o(d.store.getState()),u);(h=l.gl.xr)!=null&&h.isPresenting||!l.internal.active||l.frameloop==="never"||(l.internal.frames=Math.min(60,l.internal.frames+u),e||(e=!0,requestAnimationFrame(s)))}function a(l,u=!0,h,d){if(u&&$u("before",l),h)By(l,h,d);else for(const p of n.values())By(l,p.store.getState());u&&$u("after",l)}return{loop:s,invalidate:o,advance:a}}function _L(){const n=J.useContext(xL);if(!n)throw new Error("R3F: Hooks can only be used within the Canvas component!");return n}function pr(n=t=>t,e){return _L()(n,e)}function Nh(n,e=0){const t=_L(),i=t.getState().internal.subscribe,r=hL(n);return Fh(()=>i(r,e,t),[e,i,t]),null}function AL(n,e){return function(t,...i){const r=new t;return n&&n(r),Promise.all(i.map(s=>new Promise((o,a)=>r.load(s,l=>{l.scene&&Object.assign(l,r5(l.scene)),o(l)},e,l=>a(new Error(`Could not load ${s}: ${l.message})`))))))}}function Oh(n,e,t,i){const r=Array.isArray(e)?e:[e],s=QV(AL(t,i),[n,...r],{equal:Kt.equ});return Array.isArray(e)?s:s[0]}Oh.preload=function(n,e,t){const i=Array.isArray(e)?e:[e];return ZV(AL(t),[n,...i])};Oh.clear=function(n,e){const t=Array.isArray(e)?e:[e];return qV([n,...t])};const nu=new Map,{invalidate:tC,advance:nC}=p5(nu),{reconciler:$m,applyProps:$l}=e5(nu,a5),ec={objects:"shallow",strict:!1},m5=(n,e)=>{const t=typeof n=="function"?n(e):n;return yL(t)?t:new CS({powerPreference:"high-performance",canvas:e,antialias:!0,alpha:!0,...n})};function g5(n,e){if(e)return e;if(typeof HTMLCanvasElement<"u"&&n instanceof HTMLCanvasElement&&n.parentElement){const{width:t,height:i,top:r,left:s}=n.parentElement.getBoundingClientRect();return{width:t,height:i,top:r,left:s}}else if(typeof OffscreenCanvas<"u"&&n instanceof OffscreenCanvas)return{width:n.width,height:n.height,top:0,left:0};return{width:0,height:0,top:0,left:0}}function v5(n){const e=nu.get(n),t=e==null?void 0:e.fiber,i=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=i||u5(tC,nC),o=t||$m.createContainer(s,_c.ConcurrentRoot,null,!1,null,"",r,null);e||nu.set(n,{fiber:o,store:s});let a,l=!1,u;return{configure(h={}){let{gl:d,size:p,scene:m,events:y,onCreated:M,shadows:_=!1,linear:g=!1,flat:x=!1,legacy:S=!1,orthographic:E=!1,frameloop:C="always",dpr:b=[1,2],performance:P,raycaster:B,camera:R,onPointerMissed:L}=h,z=s.getState(),$=z.gl;z.gl||z.set({gl:$=m5(d,n)});let X=z.raycaster;X||z.set({raycaster:X=new tL});const{params:Q,...Y}=B||{};if(Kt.equ(Y,X,ec)||$l(X,{...Y}),Kt.equ(Q,X.params,ec)||$l(X,{params:{...X.params,...Q}}),!z.camera||z.camera===u&&!Kt.equ(u,R,ec)){u=R;const U=R instanceof wh,W=U?R:E?new zr(0,0,0,0,.1,1e3):new qt(75,0,.1,1e3);U||(W.position.z=5,R&&$l(W,R),!z.camera&&!(R!=null&&R.rotation)&&W.lookAt(0,0,0)),z.set({camera:W})}if(!z.scene){let U;m instanceof qm?U=m:(U=new qm,m&&$l(U,m)),z.set({scene:nc(U)})}if(!z.xr){const U=(ue,Ae)=>{const Ee=s.getState();Ee.frameloop!=="never"&&nC(ue,!0,Ee,Ae)},W=()=>{const ue=s.getState();ue.gl.xr.enabled=ue.gl.xr.isPresenting,ue.gl.xr.setAnimationLoop(ue.gl.xr.isPresenting?U:null),ue.gl.xr.isPresenting||tC(ue)},ve={connect(){const ue=s.getState().gl;ue.xr.addEventListener("sessionstart",W),ue.xr.addEventListener("sessionend",W)},disconnect(){const ue=s.getState().gl;ue.xr.removeEventListener("sessionstart",W),ue.xr.removeEventListener("sessionend",W)}};$.xr&&ve.connect(),z.set({xr:ve})}if($.shadowMap){const U=$.shadowMap.enabled,W=$.shadowMap.type;if($.shadowMap.enabled=!!_,Kt.boo(_))$.shadowMap.type=Tf;else if(Kt.str(_)){var ne;const ve={basic:aB,percentage:Cg,soft:Tf,variance:Lr};$.shadowMap.type=(ne=ve[_])!=null?ne:Tf}else Kt.obj(_)&&Object.assign($.shadowMap,_);(U!==$.shadowMap.enabled||W!==$.shadowMap.type)&&($.shadowMap.needsUpdate=!0)}const ee=uL();ee&&("enabled"in ee?ee.enabled=!S:"legacyMode"in ee&&(ee.legacyMode=S)),$l($,{outputEncoding:g?3e3:3001,toneMapping:x?Hr:oS}),z.legacy!==S&&z.set(()=>({legacy:S})),z.linear!==g&&z.set(()=>({linear:g})),z.flat!==x&&z.set(()=>({flat:x})),d&&!Kt.fun(d)&&!yL(d)&&!Kt.equ(d,$,ec)&&$l($,d),y&&!z.events.handlers&&z.set({events:y(s)});const H=g5(n,p);return Kt.equ(H,z.size,ec)||z.setSize(H.width,H.height,H.updateStyle,H.top,H.left),b&&z.viewport.dpr!==mL(b)&&z.setDpr(b),z.frameloop!==C&&z.setFrameloop(C),z.onPointerMissed||z.set({onPointerMissed:L}),P&&!Kt.equ(P,z.performance,ec)&&z.set(U=>({performance:{...U.performance,...P}})),a=M,l=!0,this},render(h){return l||this.configure(),$m.updateContainer(J.createElement(y5,{store:s,children:h,onCreated:a,rootElement:n}),o,null,()=>{}),s},unmount(){SL(n)}}}function y5({store:n,children:e,onCreated:t,rootElement:i}){return Fh(()=>{const r=n.getState();r.set(s=>({internal:{...s.internal,active:!0}})),t&&t(r),n.getState().events.connected||r.events.connect==null||r.events.connect(i)},[]),J.createElement(xL.Provider,{value:n},e)}function SL(n,e){const t=nu.get(n),i=t==null?void 0:t.fiber;if(i){const r=t==null?void 0:t.store.getState();r&&(r.internal.active=!1),$m.updateContainer(null,i,null,()=>{r&&setTimeout(()=>{try{var s,o,a,l;r.events.disconnect==null||r.events.disconnect(),(s=r.gl)==null||(o=s.renderLists)==null||o.dispose==null||o.dispose(),(a=r.gl)==null||a.forceContextLoss==null||a.forceContextLoss(),(l=r.gl)!=null&&l.xr&&r.xr.disconnect(),s5(r),nu.delete(n),e&&e(n)}catch{}},500)})}}$m.injectIntoDevTools({bundleType:0,rendererPackageName:"@react-three/fiber",version:J.version});function jr(){return jr=Object.assign?Object.assign.bind():function(n){for(var e=1;e<arguments.length;e++){var t=arguments[e];for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&(n[i]=t[i])}return n},jr.apply(this,arguments)}function k_(n,e,t){var i,r,s,o,a;e==null&&(e=100);function l(){var h=Date.now()-o;h<e&&h>=0?i=setTimeout(l,e-h):(i=null,t||(a=n.apply(s,r),s=r=null))}var u=function(){s=this,r=arguments,o=Date.now();var h=t&&!i;return i||(i=setTimeout(l,e)),h&&(a=n.apply(s,r),s=r=null),a};return u.clear=function(){i&&(clearTimeout(i),i=null)},u.flush=function(){i&&(a=n.apply(s,r),s=r=null,clearTimeout(i),i=null)},u}k_.debounce=k_;var x5=k_;const iC=su(x5);function _5(n){let{debounce:e,scroll:t,polyfill:i,offsetSize:r}=n===void 0?{debounce:0,scroll:!1,offsetSize:!1}:n;const s=i||(typeof window>"u"?class{}:window.ResizeObserver);if(!s)throw new Error("This browser does not support ResizeObserver out of the box. See: https://github.com/react-spring/react-use-measure/#resize-observer-polyfills");const[o,a]=J.useState({left:0,top:0,width:0,height:0,bottom:0,right:0,x:0,y:0}),l=J.useRef({element:null,scrollContainers:null,resizeObserver:null,lastBounds:o}),u=e?typeof e=="number"?e:e.scroll:null,h=e?typeof e=="number"?e:e.resize:null,d=J.useRef(!1);J.useEffect(()=>(d.current=!0,()=>void(d.current=!1)));const[p,m,y]=J.useMemo(()=>{const x=()=>{if(!l.current.element)return;const{left:S,top:E,width:C,height:b,bottom:P,right:B,x:R,y:L}=l.current.element.getBoundingClientRect(),z={left:S,top:E,width:C,height:b,bottom:P,right:B,x:R,y:L};l.current.element instanceof HTMLElement&&r&&(z.height=l.current.element.offsetHeight,z.width=l.current.element.offsetWidth),Object.freeze(z),d.current&&!E5(l.current.lastBounds,z)&&a(l.current.lastBounds=z)};return[x,h?iC(x,h):x,u?iC(x,u):x]},[a,r,u,h]);function M(){l.current.scrollContainers&&(l.current.scrollContainers.forEach(x=>x.removeEventListener("scroll",y,!0)),l.current.scrollContainers=null),l.current.resizeObserver&&(l.current.resizeObserver.disconnect(),l.current.resizeObserver=null)}function _(){l.current.element&&(l.current.resizeObserver=new s(y),l.current.resizeObserver.observe(l.current.element),t&&l.current.scrollContainers&&l.current.scrollContainers.forEach(x=>x.addEventListener("scroll",y,{capture:!0,passive:!0})))}const g=x=>{!x||x===l.current.element||(M(),l.current.element=x,l.current.scrollContainers=ML(x),_())};return S5(y,!!t),A5(m),J.useEffect(()=>{M(),_()},[t,y,m]),J.useEffect(()=>M,[]),[g,o,p]}function A5(n){J.useEffect(()=>{const e=n;return window.addEventListener("resize",e),()=>void window.removeEventListener("resize",e)},[n])}function S5(n,e){J.useEffect(()=>{if(e){const t=n;return window.addEventListener("scroll",t,{capture:!0,passive:!0}),()=>void window.removeEventListener("scroll",t,!0)}},[n,e])}function ML(n){const e=[];if(!n||n===document.body)return e;const{overflow:t,overflowX:i,overflowY:r}=window.getComputedStyle(n);return[t,i,r].some(s=>s==="auto"||s==="scroll")&&e.push(n),[...e,...ML(n.parentElement)]}const M5=["x","y","top","bottom","left","right","width","height"],E5=(n,e)=>M5.every(t=>n[t]===e[t]);var w5=Object.defineProperty,T5=Object.defineProperties,C5=Object.getOwnPropertyDescriptors,rC=Object.getOwnPropertySymbols,b5=Object.prototype.hasOwnProperty,R5=Object.prototype.propertyIsEnumerable,sC=(n,e,t)=>e in n?w5(n,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):n[e]=t,oC=(n,e)=>{for(var t in e||(e={}))b5.call(e,t)&&sC(n,t,e[t]);if(rC)for(var t of rC(e))R5.call(e,t)&&sC(n,t,e[t]);return n},P5=(n,e)=>T5(n,C5(e));function EL(n,e,t){if(!n)return;if(t(n)===!0)return n;let i=e?n.return:n.child;for(;i;){const r=EL(i,e,t);if(r)return r;i=e?null:i.sibling}}function wL(n){try{return Object.defineProperties(n,{_currentRenderer:{get(){return null},set(){}},_currentRenderer2:{get(){return null},set(){}}})}catch{return n}}const t1=wL(J.createContext(null));class TL extends J.Component{render(){return J.createElement(t1.Provider,{value:this._reactInternals},this.props.children)}}const{ReactCurrentOwner:aC,ReactCurrentDispatcher:lC}=J.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;function B5(){const n=J.useContext(t1);if(n===null)throw new Error("its-fine: useFiber must be called within a <FiberProvider />!");const e=J.useId();return J.useMemo(()=>{for(const i of[aC==null?void 0:aC.current,n,n==null?void 0:n.alternate]){if(!i)continue;const r=EL(i,!1,s=>{let o=s.memoizedState;for(;o;){if(o.memoizedState===e)return!0;o=o.next}});if(r)return r}},[n,e])}function L5(){var n,e;const t=B5(),[i]=J.useState(()=>new Map);i.clear();let r=t;for(;r;){const s=(n=r.type)==null?void 0:n._context;s&&s!==t1&&!i.has(s)&&i.set(s,(e=lC==null?void 0:lC.current)==null?void 0:e.readContext(wL(s))),r=r.return}return i}function I5(){const n=L5();return J.useMemo(()=>Array.from(n.keys()).reduce((e,t)=>i=>J.createElement(e,null,J.createElement(t.Provider,P5(oC({},i),{value:n.get(t)}))),e=>J.createElement(TL,oC({},e))),[n])}const Ly={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 D5(n){const{handlePointer:e}=c5(n);return{priority:1,enabled:!0,compute(t,i,r){i.pointer.set(t.offsetX/i.size.width*2-1,-(t.offsetY/i.size.height)*2+1),i.raycaster.setFromCamera(i.pointer,i.camera)},connected:void 0,handlers:Object.keys(Ly).reduce((t,i)=>({...t,[i]:e(i)}),{}),update:()=>{var t;const{events:i,internal:r}=n.getState();(t=r.lastEvent)!=null&&t.current&&i.handlers&&i.handlers.onPointerMove(r.lastEvent.current)},connect:t=>{var i;const{set:r,events:s}=n.getState();s.disconnect==null||s.disconnect(),r(o=>({events:{...o.events,connected:t}})),Object.entries((i=s.handlers)!=null?i:[]).forEach(([o,a])=>{const[l,u]=Ly[o];t.addEventListener(l,a,{passive:u})})},disconnect:()=>{const{set:t,events:i}=n.getState();if(i.connected){var r;Object.entries((r=i.handlers)!=null?r:[]).forEach(([s,o])=>{if(i&&i.connected instanceof HTMLElement){const[a]=Ly[s];i.connected.removeEventListener(a,o)}}),t(s=>({events:{...s.events,connected:void 0}}))}}}}const F5=J.forwardRef(function({children:e,fallback:t,resize:i,style:r,gl:s,events:o=D5,eventSource:a,eventPrefix:l,shadows:u,linear:h,flat:d,legacy:p,orthographic:m,frameloop:y,dpr:M,performance:_,raycaster:g,camera:x,onPointerMissed:S,onCreated:E,...C},b){J.useMemo(()=>$V(zV),[]);const P=I5(),[B,R]=_5({scroll:!0,debounce:{scroll:50,resize:0},...i}),L=J.useRef(null),z=J.useRef(null);J.useImperativeHandle(b,()=>L.current);const $=hL(S),[X,Q]=J.useState(!1),[Y,ne]=J.useState(!1);if(X)throw X;if(Y)throw Y;const ee=J.useRef(null);Fh(()=>{const V=L.current;R.width>0&&R.height>0&&V&&(ee.current||(ee.current=v5(V)),ee.current.configure({gl:s,events:o,shadows:u,linear:h,flat:d,legacy:p,orthographic:m,frameloop:y,dpr:M,performance:_,raycaster:g,camera:x,size:R,onPointerMissed:(...H)=>$.current==null?void 0:$.current(...H),onCreated:H=>{H.events.connect==null||H.events.connect(a?t5(a)?a.current:a:z.current),l&&H.setEvents({compute:(U,W)=>{const ve=U[l+"X"],ue=U[l+"Y"];W.pointer.set(ve/W.size.width*2-1,-(ue/W.size.height)*2+1),W.raycaster.setFromCamera(W.pointer,W.camera)}}),E==null||E(H)}}),ee.current.render(J.createElement(P,null,J.createElement(dL,{set:ne},J.createElement(J.Suspense,{fallback:J.createElement(n5,{set:Q})},e)))))}),J.useEffect(()=>{const V=L.current;if(V)return()=>SL(V)},[]);const I=a?"none":"auto";return J.createElement("div",jr({ref:z,style:{position:"relative",width:"100%",height:"100%",overflow:"hidden",pointerEvents:I,...r}},C),J.createElement("div",{ref:B,style:{width:"100%",height:"100%"}},J.createElement("canvas",{ref:L,style:{display:"block"}},t)))}),CL=J.forwardRef(function(e,t){return J.createElement(TL,null,J.createElement(F5,jr({},e,{ref:t})))}),Uh=new F,n1=new F,N5=new F;function O5(n,e,t){const i=Uh.setFromMatrixPosition(n.matrixWorld);i.project(e);const r=t.width/2,s=t.height/2;return[i.x*r+r,-(i.y*s)+s]}function U5(n,e){const t=Uh.setFromMatrixPosition(n.matrixWorld),i=n1.setFromMatrixPosition(e.matrixWorld),r=t.sub(i),s=e.getWorldDirection(N5);return r.angleTo(s)>Math.PI/2}function k5(n,e,t,i){const r=Uh.setFromMatrixPosition(n.matrixWorld),s=r.clone();s.project(e),t.setFromCamera(s,e);const o=t.intersectObjects(i,!0);if(o.length){const a=o[0].distance;return r.distanceTo(t.ray.origin)<a}return!0}function H5(n,e){if(e instanceof zr)return e.zoom;if(e instanceof qt){const t=Uh.setFromMatrixPosition(n.matrixWorld),i=n1.setFromMatrixPosition(e.matrixWorld),r=e.fov*Math.PI/180,s=t.distanceTo(i);return 1/(2*Math.tan(r/2)*s)}else return 1}function z5(n,e,t){if(e instanceof qt||e instanceof zr){const i=Uh.setFromMatrixPosition(n.matrixWorld),r=n1.setFromMatrixPosition(e.matrixWorld),s=i.distanceTo(r),o=(t[1]-t[0])/(e.far-e.near),a=t[1]-o*e.far;return Math.round(o*s+a)}}const H_=n=>Math.abs(n)<1e-10?0:n;function bL(n,e,t=""){let i="matrix3d(";for(let r=0;r!==16;r++)i+=H_(e[r]*n.elements[r])+(r!==15?",":")");return t+i}const G5=(n=>e=>bL(e,n))([1,-1,1,1,1,-1,1,1,1,-1,1,1,1,-1,1,1]),V5=(n=>(e,t)=>bL(e,n(t),"translate(-50%,-50%)"))(n=>[1/n,1/n,1/n,1,-1/n,-1/n,-1/n,-1,1/n,1/n,1/n,1,1,1,1,1]);function W5(n){return n&&typeof n=="object"&&"current"in n}const j5=J.forwardRef(({children:n,eps:e=.001,style:t,className:i,prepend:r,center:s,fullscreen:o,portal:a,distanceFactor:l,sprite:u=!1,transform:h=!1,occlude:d,onOcclude:p,castShadow:m,receiveShadow:y,material:M,geometry:_,zIndexRange:g=[16777271,0],calculatePosition:x=O5,as:S="div",wrapperClass:E,pointerEvents:C="auto",...b},P)=>{const{gl:B,camera:R,scene:L,size:z,raycaster:$,events:X,viewport:Q}=pr(),[Y]=J.useState(()=>document.createElement(S)),ne=J.useRef(),ee=J.useRef(null),I=J.useRef(0),V=J.useRef([0,0]),H=J.useRef(null),U=J.useRef(null),W=(a==null?void 0:a.current)||X.connected||B.domElement.parentNode,ve=J.useRef(null),ue=J.useRef(!1),Ae=J.useMemo(()=>d&&d!=="blending"||Array.isArray(d)&&d.length&&W5(d[0]),[d]);J.useLayoutEffect(()=>{const tt=B.domElement;d&&d==="blending"?(tt.style.zIndex=`${Math.floor(g[0]/2)}`,tt.style.position="absolute",tt.style.pointerEvents="none"):(tt.style.zIndex=null,tt.style.position=null,tt.style.pointerEvents=null)},[d]),J.useLayoutEffect(()=>{if(ee.current){const tt=ne.current=QP(Y);if(L.updateMatrixWorld(),h)Y.style.cssText="position:absolute;top:0;left:0;pointer-events:none;overflow:hidden;";else{const Se=x(ee.current,R,z);Y.style.cssText=`position:absolute;top:0;left:0;transform:translate3d(${Se[0]}px,${Se[1]}px,0);transform-origin:0 0;`}return W&&(r?W.prepend(Y):W.appendChild(Y)),()=>{W&&W.removeChild(Y),tt.unmount()}}},[W,h]),J.useLayoutEffect(()=>{E&&(Y.className=E)},[E]);const Ee=J.useMemo(()=>h?{position:"absolute",top:0,left:0,width:z.width,height:z.height,transformStyle:"preserve-3d",pointerEvents:"none"}:{position:"absolute",transform:s?"translate3d(-50%,-50%,0)":"none",...o&&{top:-z.height/2,left:-z.width/2,width:z.width,height:z.height},...t},[t,s,o,z,h]),Ne=J.useMemo(()=>({position:"absolute",pointerEvents:C}),[C]);J.useLayoutEffect(()=>{if(ue.current=!1,h){var tt;(tt=ne.current)==null||tt.render(J.createElement("div",{ref:H,style:Ee},J.createElement("div",{ref:U,style:Ne},J.createElement("div",{ref:P,className:i,style:t,children:n}))))}else{var Se;(Se=ne.current)==null||Se.render(J.createElement("div",{ref:P,style:Ee,className:i,children:n}))}});const We=J.useRef(!0);Nh(tt=>{if(ee.current){R.updateMatrixWorld(),ee.current.updateWorldMatrix(!0,!1);const Se=h?V.current:x(ee.current,R,z);if(h||Math.abs(I.current-R.zoom)>e||Math.abs(V.current[0]-Se[0])>e||Math.abs(V.current[1]-Se[1])>e){const G=U5(ee.current,R);let ye=!1;Ae&&(d!=="blending"?ye=[L]:Array.isArray(d)&&(ye=d.map(Ve=>Ve.current)));const pe=We.current;if(ye){const Ve=k5(ee.current,R,$,ye);We.current=Ve&&!G}else We.current=!G;pe!==We.current&&(p?p(!We.current):Y.style.display=We.current?"block":"none");const Me=Math.floor(g[0]/2),xe=d?Ae?[g[0],Me]:[Me-1,0]:g;if(Y.style.zIndex=`${z5(ee.current,R,xe)}`,h){const[Ve,Ue]=[z.width/2,z.height/2],Ge=R.projectionMatrix.elements[5]*Ue,{isOrthographicCamera:qe,top:vt,left:Ut,bottom:k,right:D}=R,le=G5(R.matrixWorldInverse),we=qe?`scale(${Ge})translate(${H_(-(D+Ut)/2)}px,${H_((vt+k)/2)}px)`:`translateZ(${Ge}px)`;let _e=ee.current.matrixWorld;u&&(_e=R.matrixWorldInverse.clone().transpose().copyPosition(_e).scale(ee.current.scale),_e.elements[3]=_e.elements[7]=_e.elements[11]=0,_e.elements[15]=1),Y.style.width=z.width+"px",Y.style.height=z.height+"px",Y.style.perspective=qe?"":`${Ge}px`,H.current&&U.current&&(H.current.style.transform=`${we}${le}translate(${Ve}px,${Ue}px)`,U.current.style.transform=V5(_e,1/((l||10)/400)))}else{const Ve=l===void 0?1:H5(ee.current,R)*l;Y.style.transform=`translate3d(${Se[0]}px,${Se[1]}px,0) scale(${Ve})`}V.current=Se,I.current=R.zoom}}if(!Ae&&ve.current&&!ue.current)if(h){if(H.current){const Se=H.current.children[0];if(Se!=null&&Se.clientWidth&&Se!=null&&Se.clientHeight){const{isOrthographicCamera:G}=R;if(G||_)b.scale&&(Array.isArray(b.scale)?b.scale instanceof F?ve.current.scale.copy(b.scale.clone().divideScalar(1)):ve.current.scale.set(1/b.scale[0],1/b.scale[1],1/b.scale[2]):ve.current.scale.setScalar(1/b.scale));else{const ye=(l||10)/400,pe=Se.clientWidth*ye,Me=Se.clientHeight*ye;ve.current.scale.set(pe,Me,1)}ue.current=!0}}}else{const Se=Y.children[0];if(Se!=null&&Se.clientWidth&&Se!=null&&Se.clientHeight){const G=1/Q.factor,ye=Se.clientWidth*G,pe=Se.clientHeight*G;ve.current.scale.set(ye,pe,1),ue.current=!0}ve.current.lookAt(tt.camera.position)}});const ct=J.useMemo(()=>({vertexShader:h?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);
        }
      `}),[h]);return J.createElement("group",jr({},b,{ref:ee}),d&&!Ae&&J.createElement("mesh",{castShadow:m,receiveShadow:y,ref:ve},_||J.createElement("planeGeometry",null),M||J.createElement("shaderMaterial",{side:vr,vertexShader:ct.vertexShader,fragmentShader:ct.fragmentShader})))});let ef=0;const X5=rL(n=>(xc.onStart=(e,t,i)=>{n({active:!0,item:e,loaded:t,total:i,progress:(t-ef)/(i-ef)*100})},xc.onLoad=()=>{n({active:!1})},xc.onError=e=>n(t=>({errors:[...t.errors,e]})),xc.onProgress=(e,t,i)=>{t===i&&(ef=i),n({active:!0,item:e,loaded:t,total:i,progress:(t-ef)/(i-ef)*100||100})},{errors:[],active:!1,progress:0,item:"",loaded:0,total:0}));function RL(n){return function(e){n.forEach(function(t){typeof t=="function"?t(e):t!=null&&(t.current=e)})}}function cC(n,e){if(e===jB)return console.warn("THREE.BufferGeometryUtils.toTrianglesDrawMode(): Geometry already defined as triangles."),n;if(e===Ym||e===pS){let t=n.getIndex();if(t===null){const o=[],a=n.getAttribute("position");if(a!==void 0){for(let l=0;l<a.count;l++)o.push(l);n.setIndex(o),t=n.getIndex()}else return console.error("THREE.BufferGeometryUtils.toTrianglesDrawMode(): Undefined position attribute. Processing not possible."),n}const i=t.count-2,r=[];if(t)if(e===Ym)for(let o=1;o<=i;o++)r.push(t.getX(0)),r.push(t.getX(o)),r.push(t.getX(o+1));else for(let o=0;o<i;o++)o%2===0?(r.push(t.getX(o)),r.push(t.getX(o+1)),r.push(t.getX(o+2))):(r.push(t.getX(o+2)),r.push(t.getX(o+1)),r.push(t.getX(o)));r.length/3!==i&&console.error("THREE.BufferGeometryUtils.toTrianglesDrawMode(): Unable to generate correct amount of triangles.");const s=n.clone();return s.setIndex(r),s.clearGroups(),s}else return console.error("THREE.BufferGeometryUtils.toTrianglesDrawMode(): Unknown draw mode:",e),n}var J5=Object.defineProperty,K5=(n,e,t)=>e in n?J5(n,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):n[e]=t,pt=(n,e,t)=>(K5(n,typeof e!="symbol"?e+"":e,t),t);const uC=(n,e)=>(n%e+e)%e;let Y5=class extends xs{constructor(e,t){super(),pt(this,"object"),pt(this,"domElement"),pt(this,"enabled",!0),pt(this,"target",new F),pt(this,"minDistance",0),pt(this,"maxDistance",1/0),pt(this,"minZoom",0),pt(this,"maxZoom",1/0),pt(this,"minPolarAngle",0),pt(this,"maxPolarAngle",Math.PI),pt(this,"minAzimuthAngle",-1/0),pt(this,"maxAzimuthAngle",1/0),pt(this,"enableDamping",!1),pt(this,"dampingFactor",.05),pt(this,"enableZoom",!0),pt(this,"zoomSpeed",1),pt(this,"enableRotate",!0),pt(this,"rotateSpeed",1),pt(this,"enablePan",!0),pt(this,"panSpeed",1),pt(this,"screenSpacePanning",!0),pt(this,"keyPanSpeed",7),pt(this,"autoRotate",!1),pt(this,"autoRotateSpeed",2),pt(this,"reverseOrbit",!1),pt(this,"keys",{LEFT:"ArrowLeft",UP:"ArrowUp",RIGHT:"ArrowRight",BOTTOM:"ArrowDown"}),pt(this,"mouseButtons",{LEFT:Ra.ROTATE,MIDDLE:Ra.DOLLY,RIGHT:Ra.PAN}),pt(this,"touches",{ONE:Pa.ROTATE,TWO:Pa.DOLLY_PAN}),pt(this,"target0"),pt(this,"position0"),pt(this,"zoom0"),pt(this,"_domElementKeyEvents",null),pt(this,"getPolarAngle"),pt(this,"getAzimuthalAngle"),pt(this,"setPolarAngle"),pt(this,"setAzimuthalAngle"),pt(this,"getDistance"),pt(this,"listenToKeyEvents"),pt(this,"saveState"),pt(this,"reset"),pt(this,"update"),pt(this,"connect"),pt(this,"dispose"),this.object=e,this.domElement=t,this.target0=this.target.clone(),this.position0=this.object.position.clone(),this.zoom0=this.object.zoom,this.getPolarAngle=()=>h.phi,this.getAzimuthalAngle=()=>h.theta,this.setPolarAngle=j=>{let fe=uC(j,2*Math.PI),Te=h.phi;Te<0&&(Te+=2*Math.PI),fe<0&&(fe+=2*Math.PI);let be=Math.abs(fe-Te);2*Math.PI-be<be&&(fe<Te?fe+=2*Math.PI:Te+=2*Math.PI),d.phi=fe-Te,i.update()},this.setAzimuthalAngle=j=>{let fe=uC(j,2*Math.PI),Te=h.theta;Te<0&&(Te+=2*Math.PI),fe<0&&(fe+=2*Math.PI);let be=Math.abs(fe-Te);2*Math.PI-be<be&&(fe<Te?fe+=2*Math.PI:Te+=2*Math.PI),d.theta=fe-Te,i.update()},this.getDistance=()=>i.object.position.distanceTo(i.target),this.listenToKeyEvents=j=>{j.addEventListener("keydown",D),this._domElementKeyEvents=j},this.saveState=()=>{i.target0.copy(i.target),i.position0.copy(i.object.position),i.zoom0=i.object.zoom},this.reset=()=>{i.target.copy(i.target0),i.object.position.copy(i.position0),i.object.zoom=i.zoom0,i.object.updateProjectionMatrix(),i.dispatchEvent(r),i.update(),l=a.NONE},this.update=(()=>{const j=new F,fe=new Gn().setFromUnitVectors(e.up,new F(0,1,0)),Te=fe.clone().invert(),be=new F,Ie=new Gn,nt=2*Math.PI;return function(){const K=i.object.position;j.copy(K).sub(i.target),j.applyQuaternion(fe),h.setFromVector3(j),i.autoRotate&&l===a.NONE&&$(L()),i.enableDamping?(h.theta+=d.theta*i.dampingFactor,h.phi+=d.phi*i.dampingFactor):(h.theta+=d.theta,h.phi+=d.phi);let Pe=i.minAzimuthAngle,oe=i.maxAzimuthAngle;return isFinite(Pe)&&isFinite(oe)&&(Pe<-Math.PI?Pe+=nt:Pe>Math.PI&&(Pe-=nt),oe<-Math.PI?oe+=nt:oe>Math.PI&&(oe-=nt),Pe<=oe?h.theta=Math.max(Pe,Math.min(oe,h.theta)):h.theta=h.theta>(Pe+oe)/2?Math.max(Pe,h.theta):Math.min(oe,h.theta)),h.phi=Math.max(i.minPolarAngle,Math.min(i.maxPolarAngle,h.phi)),h.makeSafe(),h.radius*=p,h.radius=Math.max(i.minDistance,Math.min(i.maxDistance,h.radius)),i.enableDamping===!0?i.target.addScaledVector(m,i.dampingFactor):i.target.add(m),j.setFromSpherical(h),j.applyQuaternion(Te),K.copy(i.target).add(j),i.object.lookAt(i.target),i.enableDamping===!0?(d.theta*=1-i.dampingFactor,d.phi*=1-i.dampingFactor,m.multiplyScalar(1-i.dampingFactor)):(d.set(0,0,0),m.set(0,0,0)),p=1,y||be.distanceToSquared(i.object.position)>u||8*(1-Ie.dot(i.object.quaternion))>u?(i.dispatchEvent(r),be.copy(i.object.position),Ie.copy(i.object.quaternion),y=!1,!0):!1}})(),this.connect=j=>{j===document&&console.error('THREE.OrbitControls: "document" should not be used as the target "domElement". Please use "renderer.domElement" instead.'),i.domElement=j,i.domElement.style.touchAction="none",i.domElement.addEventListener("contextmenu",_e),i.domElement.addEventListener("pointerdown",Ve),i.domElement.addEventListener("pointercancel",qe),i.domElement.addEventListener("wheel",k)},this.dispose=()=>{var j,fe,Te,be,Ie,nt;(j=i.domElement)==null||j.removeEventListener("contextmenu",_e),(fe=i.domElement)==null||fe.removeEventListener("pointerdown",Ve),(Te=i.domElement)==null||Te.removeEventListener("pointercancel",qe),(be=i.domElement)==null||be.removeEventListener("wheel",k),(Ie=i.domElement)==null||Ie.ownerDocument.removeEventListener("pointermove",Ue),(nt=i.domElement)==null||nt.ownerDocument.removeEventListener("pointerup",Ge),i._domElementKeyEvents!==null&&i._domElementKeyEvents.removeEventListener("keydown",D)};const i=this,r={type:"change"},s={type:"start"},o={type:"end"},a={NONE:-1,ROTATE:0,DOLLY:1,PAN:2,TOUCH_ROTATE:3,TOUCH_PAN:4,TOUCH_DOLLY_PAN:5,TOUCH_DOLLY_ROTATE:6};let l=a.NONE;const u=1e-6,h=new N_,d=new N_;let p=1;const m=new F;let y=!1;const M=new ge,_=new ge,g=new ge,x=new ge,S=new ge,E=new ge,C=new ge,b=new ge,P=new ge,B=[],R={};function L(){return 2*Math.PI/60/60*i.autoRotateSpeed}function z(){return Math.pow(.95,i.zoomSpeed)}function $(j){i.reverseOrbit?d.theta+=j:d.theta-=j}function X(j){i.reverseOrbit?d.phi+=j:d.phi-=j}const Q=(()=>{const j=new F;return function(Te,be){j.setFromMatrixColumn(be,0),j.multiplyScalar(-Te),m.add(j)}})(),Y=(()=>{const j=new F;return function(Te,be){i.screenSpacePanning===!0?j.setFromMatrixColumn(be,1):(j.setFromMatrixColumn(be,0),j.crossVectors(i.object.up,j)),j.multiplyScalar(Te),m.add(j)}})(),ne=(()=>{const j=new F;return function(Te,be){const Ie=i.domElement;if(Ie&&i.object instanceof qt&&i.object.isPerspectiveCamera){const nt=i.object.position;j.copy(nt).sub(i.target);let Rt=j.length();Rt*=Math.tan(i.object.fov/2*Math.PI/180),Q(2*Te*Rt/Ie.clientHeight,i.object.matrix),Y(2*be*Rt/Ie.clientHeight,i.object.matrix)}else Ie&&i.object instanceof zr&&i.object.isOrthographicCamera?(Q(Te*(i.object.right-i.object.left)/i.object.zoom/Ie.clientWidth,i.object.matrix),Y(be*(i.object.top-i.object.bottom)/i.object.zoom/Ie.clientHeight,i.object.matrix)):(console.warn("WARNING: OrbitControls.js encountered an unknown camera type - pan disabled."),i.enablePan=!1)}})();function ee(j){i.object instanceof qt&&i.object.isPerspectiveCamera?p/=j:i.object instanceof zr&&i.object.isOrthographicCamera?(i.object.zoom=Math.max(i.minZoom,Math.min(i.maxZoom,i.object.zoom*j)),i.object.updateProjectionMatrix(),y=!0):(console.warn("WARNING: OrbitControls.js encountered an unknown camera type - dolly/zoom disabled."),i.enableZoom=!1)}function I(j){i.object instanceof qt&&i.object.isPerspectiveCamera?p*=j:i.object instanceof zr&&i.object.isOrthographicCamera?(i.object.zoom=Math.max(i.minZoom,Math.min(i.maxZoom,i.object.zoom/j)),i.object.updateProjectionMatrix(),y=!0):(console.warn("WARNING: OrbitControls.js encountered an unknown camera type - dolly/zoom disabled."),i.enableZoom=!1)}function V(j){M.set(j.clientX,j.clientY)}function H(j){C.set(j.clientX,j.clientY)}function U(j){x.set(j.clientX,j.clientY)}function W(j){_.set(j.clientX,j.clientY),g.subVectors(_,M).multiplyScalar(i.rotateSpeed);const fe=i.domElement;fe&&($(2*Math.PI*g.x/fe.clientHeight),X(2*Math.PI*g.y/fe.clientHeight)),M.copy(_),i.update()}function ve(j){b.set(j.clientX,j.clientY),P.subVectors(b,C),P.y>0?ee(z()):P.y<0&&I(z()),C.copy(b),i.update()}function ue(j){S.set(j.clientX,j.clientY),E.subVectors(S,x).multiplyScalar(i.panSpeed),ne(E.x,E.y),x.copy(S),i.update()}function Ae(j){j.deltaY<0?I(z()):j.deltaY>0&&ee(z()),i.update()}function Ee(j){let fe=!1;switch(j.code){case i.keys.UP:ne(0,i.keyPanSpeed),fe=!0;break;case i.keys.BOTTOM:ne(0,-i.keyPanSpeed),fe=!0;break;case i.keys.LEFT:ne(i.keyPanSpeed,0),fe=!0;break;case i.keys.RIGHT:ne(-i.keyPanSpeed,0),fe=!0;break}fe&&(j.preventDefault(),i.update())}function Ne(){if(B.length==1)M.set(B[0].pageX,B[0].pageY);else{const j=.5*(B[0].pageX+B[1].pageX),fe=.5*(B[0].pageY+B[1].pageY);M.set(j,fe)}}function We(){if(B.length==1)x.set(B[0].pageX,B[0].pageY);else{const j=.5*(B[0].pageX+B[1].pageX),fe=.5*(B[0].pageY+B[1].pageY);x.set(j,fe)}}function ct(){const j=B[0].pageX-B[1].pageX,fe=B[0].pageY-B[1].pageY,Te=Math.sqrt(j*j+fe*fe);C.set(0,Te)}function tt(){i.enableZoom&&ct(),i.enablePan&&We()}function Se(){i.enableZoom&&ct(),i.enableRotate&&Ne()}function G(j){if(B.length==1)_.set(j.pageX,j.pageY);else{const Te=he(j),be=.5*(j.pageX+Te.x),Ie=.5*(j.pageY+Te.y);_.set(be,Ie)}g.subVectors(_,M).multiplyScalar(i.rotateSpeed);const fe=i.domElement;fe&&($(2*Math.PI*g.x/fe.clientHeight),X(2*Math.PI*g.y/fe.clientHeight)),M.copy(_)}function ye(j){if(B.length==1)S.set(j.pageX,j.pageY);else{const fe=he(j),Te=.5*(j.pageX+fe.x),be=.5*(j.pageY+fe.y);S.set(Te,be)}E.subVectors(S,x).multiplyScalar(i.panSpeed),ne(E.x,E.y),x.copy(S)}function pe(j){const fe=he(j),Te=j.pageX-fe.x,be=j.pageY-fe.y,Ie=Math.sqrt(Te*Te+be*be);b.set(0,Ie),P.set(0,Math.pow(b.y/C.y,i.zoomSpeed)),ee(P.y),C.copy(b)}function Me(j){i.enableZoom&&pe(j),i.enablePan&&ye(j)}function xe(j){i.enableZoom&&pe(j),i.enableRotate&&G(j)}function Ve(j){var fe,Te;i.enabled!==!1&&(B.length===0&&((fe=i.domElement)==null||fe.ownerDocument.addEventListener("pointermove",Ue),(Te=i.domElement)==null||Te.ownerDocument.addEventListener("pointerup",Ge)),De(j),j.pointerType==="touch"?le(j):vt(j))}function Ue(j){i.enabled!==!1&&(j.pointerType==="touch"?we(j):Ut(j))}function Ge(j){var fe,Te,be;Ke(j),B.length===0&&((fe=i.domElement)==null||fe.releasePointerCapture(j.pointerId),(Te=i.domElement)==null||Te.ownerDocument.removeEventListener("pointermove",Ue),(be=i.domElement)==null||be.ownerDocument.removeEventListener("pointerup",Ge)),i.dispatchEvent(o),l=a.NONE}function qe(j){Ke(j)}function vt(j){let fe;switch(j.button){case 0:fe=i.mouseButtons.LEFT;break;case 1:fe=i.mouseButtons.MIDDLE;break;case 2:fe=i.mouseButtons.RIGHT;break;default:fe=-1}switch(fe){case Ra.DOLLY:if(i.enableZoom===!1)return;H(j),l=a.DOLLY;break;case Ra.ROTATE:if(j.ctrlKey||j.metaKey||j.shiftKey){if(i.enablePan===!1)return;U(j),l=a.PAN}else{if(i.enableRotate===!1)return;V(j),l=a.ROTATE}break;case Ra.PAN:if(j.ctrlKey||j.metaKey||j.shiftKey){if(i.enableRotate===!1)return;V(j),l=a.ROTATE}else{if(i.enablePan===!1)return;U(j),l=a.PAN}break;default:l=a.NONE}l!==a.NONE&&i.dispatchEvent(s)}function Ut(j){if(i.enabled!==!1)switch(l){case a.ROTATE:if(i.enableRotate===!1)return;W(j);break;case a.DOLLY:if(i.enableZoom===!1)return;ve(j);break;case a.PAN:if(i.enablePan===!1)return;ue(j);break}}function k(j){i.enabled===!1||i.enableZoom===!1||l!==a.NONE&&l!==a.ROTATE||(j.preventDefault(),i.dispatchEvent(s),Ae(j),i.dispatchEvent(o))}function D(j){i.enabled===!1||i.enablePan===!1||Ee(j)}function le(j){switch(Le(j),B.length){case 1:switch(i.touches.ONE){case Pa.ROTATE:if(i.enableRotate===!1)return;Ne(),l=a.TOUCH_ROTATE;break;case Pa.PAN:if(i.enablePan===!1)return;We(),l=a.TOUCH_PAN;break;default:l=a.NONE}break;case 2:switch(i.touches.TWO){case Pa.DOLLY_PAN:if(i.enableZoom===!1&&i.enablePan===!1)return;tt(),l=a.TOUCH_DOLLY_PAN;break;case Pa.DOLLY_ROTATE:if(i.enableZoom===!1&&i.enableRotate===!1)return;Se(),l=a.TOUCH_DOLLY_ROTATE;break;default:l=a.NONE}break;default:l=a.NONE}l!==a.NONE&&i.dispatchEvent(s)}function we(j){switch(Le(j),l){case a.TOUCH_ROTATE:if(i.enableRotate===!1)return;G(j),i.update();break;case a.TOUCH_PAN:if(i.enablePan===!1)return;ye(j),i.update();break;case a.TOUCH_DOLLY_PAN:if(i.enableZoom===!1&&i.enablePan===!1)return;Me(j),i.update();break;case a.TOUCH_DOLLY_ROTATE:if(i.enableZoom===!1&&i.enableRotate===!1)return;xe(j),i.update();break;default:l=a.NONE}}function _e(j){i.enabled!==!1&&j.preventDefault()}function De(j){B.push(j)}function Ke(j){delete R[j.pointerId];for(let fe=0;fe<B.length;fe++)if(B[fe].pointerId==j.pointerId){B.splice(fe,1);return}}function Le(j){let fe=R[j.pointerId];fe===void 0&&(fe=new ge,R[j.pointerId]=fe),fe.set(j.pageX,j.pageY)}function he(j){const fe=j.pointerId===B[0].pointerId?B[1]:B[0];return R[fe.pointerId]}t!==void 0&&this.connect(t),this.update()}};class i1 extends li{constructor(e){super(e),this.dracoLoader=null,this.ktx2Loader=null,this.meshoptDecoder=null,this.pluginCallbacks=[],this.register(function(t){return new e9(t)}),this.register(function(t){return new l9(t)}),this.register(function(t){return new c9(t)}),this.register(function(t){return new u9(t)}),this.register(function(t){return new n9(t)}),this.register(function(t){return new i9(t)}),this.register(function(t){return new r9(t)}),this.register(function(t){return new s9(t)}),this.register(function(t){return new $5(t)}),this.register(function(t){return new o9(t)}),this.register(function(t){return new t9(t)}),this.register(function(t){return new a9(t)}),this.register(function(t){return new Z5(t)}),this.register(function(t){return new f9(t)}),this.register(function(t){return new h9(t)})}load(e,t,i,r){const s=this;let o;this.resourcePath!==""?o=this.resourcePath:this.path!==""?o=this.path:o=ps.extractUrlBase(e),this.manager.itemStart(e);const a=function(u){r?r(u):console.error(u),s.manager.itemError(e),s.manager.itemEnd(e)},l=new Yi(this.manager);l.setPath(this.path),l.setResponseType("arraybuffer"),l.setRequestHeader(this.requestHeader),l.setWithCredentials(this.withCredentials),l.load(e,function(u){try{s.parse(u,o,function(h){t(h),s.manager.itemEnd(e)},a)}catch(h){a(h)}},i,a)}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,i,r){let s;const o={},a={};if(typeof e=="string")s=JSON.parse(e);else if(e instanceof ArrayBuffer)if(ps.decodeText(new Uint8Array(e.slice(0,4)))===PL){try{o[Tt.KHR_BINARY_GLTF]=new d9(e)}catch(h){r&&r(h);return}s=JSON.parse(o[Tt.KHR_BINARY_GLTF].content)}else s=JSON.parse(ps.decodeText(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 l=new T9(s,{path:t||this.resourcePath||"",crossOrigin:this.crossOrigin,requestHeader:this.requestHeader,manager:this.manager,ktx2Loader:this.ktx2Loader,meshoptDecoder:this.meshoptDecoder});l.fileLoader.setRequestHeader(this.requestHeader);for(let u=0;u<this.pluginCallbacks.length;u++){const h=this.pluginCallbacks[u](l);a[h.name]=h,o[h.name]=!0}if(s.extensionsUsed)for(let u=0;u<s.extensionsUsed.length;++u){const h=s.extensionsUsed[u],d=s.extensionsRequired||[];switch(h){case Tt.KHR_MATERIALS_UNLIT:o[h]=new q5;break;case Tt.KHR_DRACO_MESH_COMPRESSION:o[h]=new p9(s,this.dracoLoader);break;case Tt.KHR_TEXTURE_TRANSFORM:o[h]=new m9;break;case Tt.KHR_MESH_QUANTIZATION:o[h]=new g9;break;default:d.indexOf(h)>=0&&a[h]===void 0&&console.warn('THREE.GLTFLoader: Unknown extension "'+h+'".')}}l.setExtensions(o),l.setPlugins(a),l.parse(i,r)}parseAsync(e,t){const i=this;return new Promise(function(r,s){i.parse(e,t,r,s)})}}function Q5(){let n={};return{get:function(e){return n[e]},add:function(e,t){n[e]=t},remove:function(e){delete n[e]},removeAll:function(){n={}}}}const Tt={KHR_BINARY_GLTF:"KHR_binary_glTF",KHR_DRACO_MESH_COMPRESSION:"KHR_draco_mesh_compression",KHR_LIGHTS_PUNCTUAL:"KHR_lights_punctual",KHR_MATERIALS_CLEARCOAT:"KHR_materials_clearcoat",KHR_MATERIALS_IOR:"KHR_materials_ior",KHR_MATERIALS_SHEEN:"KHR_materials_sheen",KHR_MATERIALS_SPECULAR:"KHR_materials_specular",KHR_MATERIALS_TRANSMISSION:"KHR_materials_transmission",KHR_MATERIALS_IRIDESCENCE:"KHR_materials_iridescence",KHR_MATERIALS_ANISOTROPY:"KHR_materials_anisotropy",KHR_MATERIALS_UNLIT:"KHR_materials_unlit",KHR_MATERIALS_VOLUME:"KHR_materials_volume",KHR_TEXTURE_BASISU:"KHR_texture_basisu",KHR_TEXTURE_TRANSFORM:"KHR_texture_transform",KHR_MESH_QUANTIZATION:"KHR_mesh_quantization",KHR_MATERIALS_EMISSIVE_STRENGTH:"KHR_materials_emissive_strength",EXT_TEXTURE_WEBP:"EXT_texture_webp",EXT_TEXTURE_AVIF:"EXT_texture_avif",EXT_MESHOPT_COMPRESSION:"EXT_meshopt_compression",EXT_MESH_GPU_INSTANCING:"EXT_mesh_gpu_instancing"};class Z5{constructor(e){this.parser=e,this.name=Tt.KHR_LIGHTS_PUNCTUAL,this.cache={refs:{},uses:{}}}_markDefs(){const e=this.parser,t=this.parser.json.nodes||[];for(let i=0,r=t.length;i<r;i++){const s=t[i];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,i="light:"+e;let r=t.cache.get(i);if(r)return r;const s=t.json,l=((s.extensions&&s.extensions[this.name]||{}).lights||[])[e];let u;const h=new Oe(16777215);l.color!==void 0&&h.fromArray(l.color);const d=l.range!==void 0?l.range:0;switch(l.type){case"directional":u=new KS(h),u.target.position.set(0,0,-1),u.add(u.target);break;case"point":u=new JS(h),u.distance=d;break;case"spot":u=new XS(h),u.distance=d,l.spot=l.spot||{},l.spot.innerConeAngle=l.spot.innerConeAngle!==void 0?l.spot.innerConeAngle:0,l.spot.outerConeAngle=l.spot.outerConeAngle!==void 0?l.spot.outerConeAngle:Math.PI/4,u.angle=l.spot.outerConeAngle,u.penumbra=1-l.spot.innerConeAngle/l.spot.outerConeAngle,u.target.position.set(0,0,-1),u.add(u.target);break;default:throw new Error("THREE.GLTFLoader: Unexpected light type: "+l.type)}return u.position.set(0,0,0),u.decay=2,Mo(u,l),l.intensity!==void 0&&(u.intensity=l.intensity),u.name=t.createUniqueName(l.name||"light_"+e),r=Promise.resolve(u),t.cache.add(i,r),r}getDependency(e,t){if(e==="light")return this._loadLight(t)}createNodeAttachment(e){const t=this,i=this.parser,s=i.json.nodes[e],a=(s.extensions&&s.extensions[this.name]||{}).light;return a===void 0?null:this._loadLight(a).then(function(l){return i._getNodeRef(t.cache,a,l)})}}class q5{constructor(){this.name=Tt.KHR_MATERIALS_UNLIT}getMaterialType(){return ji}extendParams(e,t,i){const r=[];e.color=new Oe(1,1,1),e.opacity=1;const s=t.pbrMetallicRoughness;if(s){if(Array.isArray(s.baseColorFactor)){const o=s.baseColorFactor;e.color.fromArray(o),e.opacity=o[3]}s.baseColorTexture!==void 0&&r.push(i.assignTexture(e,"map",s.baseColorTexture,3001))}return Promise.all(r)}}class $5{constructor(e){this.parser=e,this.name=Tt.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 e9{constructor(e){this.parser=e,this.name=Tt.KHR_MATERIALS_CLEARCOAT}getMaterialType(e){const i=this.parser.json.materials[e];return!i.extensions||!i.extensions[this.name]?null:_s}extendMaterialParams(e,t){const i=this.parser,r=i.json.materials[e];if(!r.extensions||!r.extensions[this.name])return Promise.resolve();const s=[],o=r.extensions[this.name];if(o.clearcoatFactor!==void 0&&(t.clearcoat=o.clearcoatFactor),o.clearcoatTexture!==void 0&&s.push(i.assignTexture(t,"clearcoatMap",o.clearcoatTexture)),o.clearcoatRoughnessFactor!==void 0&&(t.clearcoatRoughness=o.clearcoatRoughnessFactor),o.clearcoatRoughnessTexture!==void 0&&s.push(i.assignTexture(t,"clearcoatRoughnessMap",o.clearcoatRoughnessTexture)),o.clearcoatNormalTexture!==void 0&&(s.push(i.assignTexture(t,"clearcoatNormalMap",o.clearcoatNormalTexture)),o.clearcoatNormalTexture.scale!==void 0)){const a=o.clearcoatNormalTexture.scale;t.clearcoatNormalScale=new ge(a,a)}return Promise.all(s)}}class t9{constructor(e){this.parser=e,this.name=Tt.KHR_MATERIALS_IRIDESCENCE}getMaterialType(e){const i=this.parser.json.materials[e];return!i.extensions||!i.extensions[this.name]?null:_s}extendMaterialParams(e,t){const i=this.parser,r=i.json.materials[e];if(!r.extensions||!r.extensions[this.name])return Promise.resolve();const s=[],o=r.extensions[this.name];return o.iridescenceFactor!==void 0&&(t.iridescence=o.iridescenceFactor),o.iridescenceTexture!==void 0&&s.push(i.assignTexture(t,"iridescenceMap",o.iridescenceTexture)),o.iridescenceIor!==void 0&&(t.iridescenceIOR=o.iridescenceIor),t.iridescenceThicknessRange===void 0&&(t.iridescenceThicknessRange=[100,400]),o.iridescenceThicknessMinimum!==void 0&&(t.iridescenceThicknessRange[0]=o.iridescenceThicknessMinimum),o.iridescenceThicknessMaximum!==void 0&&(t.iridescenceThicknessRange[1]=o.iridescenceThicknessMaximum),o.iridescenceThicknessTexture!==void 0&&s.push(i.assignTexture(t,"iridescenceThicknessMap",o.iridescenceThicknessTexture)),Promise.all(s)}}class n9{constructor(e){this.parser=e,this.name=Tt.KHR_MATERIALS_SHEEN}getMaterialType(e){const i=this.parser.json.materials[e];return!i.extensions||!i.extensions[this.name]?null:_s}extendMaterialParams(e,t){const i=this.parser,r=i.json.materials[e];if(!r.extensions||!r.extensions[this.name])return Promise.resolve();const s=[];t.sheenColor=new Oe(0,0,0),t.sheenRoughness=0,t.sheen=1;const o=r.extensions[this.name];return o.sheenColorFactor!==void 0&&t.sheenColor.fromArray(o.sheenColorFactor),o.sheenRoughnessFactor!==void 0&&(t.sheenRoughness=o.sheenRoughnessFactor),o.sheenColorTexture!==void 0&&s.push(i.assignTexture(t,"sheenColorMap",o.sheenColorTexture,3001)),o.sheenRoughnessTexture!==void 0&&s.push(i.assignTexture(t,"sheenRoughnessMap",o.sheenRoughnessTexture)),Promise.all(s)}}class i9{constructor(e){this.parser=e,this.name=Tt.KHR_MATERIALS_TRANSMISSION}getMaterialType(e){const i=this.parser.json.materials[e];return!i.extensions||!i.extensions[this.name]?null:_s}extendMaterialParams(e,t){const i=this.parser,r=i.json.materials[e];if(!r.extensions||!r.extensions[this.name])return Promise.resolve();const s=[],o=r.extensions[this.name];return o.transmissionFactor!==void 0&&(t.transmission=o.transmissionFactor),o.transmissionTexture!==void 0&&s.push(i.assignTexture(t,"transmissionMap",o.transmissionTexture)),Promise.all(s)}}class r9{constructor(e){this.parser=e,this.name=Tt.KHR_MATERIALS_VOLUME}getMaterialType(e){const i=this.parser.json.materials[e];return!i.extensions||!i.extensions[this.name]?null:_s}extendMaterialParams(e,t){const i=this.parser,r=i.json.materials[e];if(!r.extensions||!r.extensions[this.name])return Promise.resolve();const s=[],o=r.extensions[this.name];t.thickness=o.thicknessFactor!==void 0?o.thicknessFactor:0,o.thicknessTexture!==void 0&&s.push(i.assignTexture(t,"thicknessMap",o.thicknessTexture)),t.attenuationDistance=o.attenuationDistance||1/0;const a=o.attenuationColor||[1,1,1];return t.attenuationColor=new Oe(a[0],a[1],a[2]),Promise.all(s)}}class s9{constructor(e){this.parser=e,this.name=Tt.KHR_MATERIALS_IOR}getMaterialType(e){const i=this.parser.json.materials[e];return!i.extensions||!i.extensions[this.name]?null:_s}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 o9{constructor(e){this.parser=e,this.name=Tt.KHR_MATERIALS_SPECULAR}getMaterialType(e){const i=this.parser.json.materials[e];return!i.extensions||!i.extensions[this.name]?null:_s}extendMaterialParams(e,t){const i=this.parser,r=i.json.materials[e];if(!r.extensions||!r.extensions[this.name])return Promise.resolve();const s=[],o=r.extensions[this.name];t.specularIntensity=o.specularFactor!==void 0?o.specularFactor:1,o.specularTexture!==void 0&&s.push(i.assignTexture(t,"specularIntensityMap",o.specularTexture));const a=o.specularColorFactor||[1,1,1];return t.specularColor=new Oe(a[0],a[1],a[2]),o.specularColorTexture!==void 0&&s.push(i.assignTexture(t,"specularColorMap",o.specularColorTexture,3001)),Promise.all(s)}}class a9{constructor(e){this.parser=e,this.name=Tt.KHR_MATERIALS_ANISOTROPY}getMaterialType(e){const i=this.parser.json.materials[e];return!i.extensions||!i.extensions[this.name]?null:_s}extendMaterialParams(e,t){const i=this.parser,r=i.json.materials[e];if(!r.extensions||!r.extensions[this.name])return Promise.resolve();const s=[],o=r.extensions[this.name];return o.anisotropyStrength!==void 0&&(t.anisotropy=o.anisotropyStrength),o.anisotropyRotation!==void 0&&(t.anisotropyRotation=o.anisotropyRotation),o.anisotropyTexture!==void 0&&s.push(i.assignTexture(t,"anisotropyMap",o.anisotropyTexture)),Promise.all(s)}}class l9{constructor(e){this.parser=e,this.name=Tt.KHR_TEXTURE_BASISU}loadTexture(e){const t=this.parser,i=t.json,r=i.textures[e];if(!r.extensions||!r.extensions[this.name])return null;const s=r.extensions[this.name],o=t.options.ktx2Loader;if(!o){if(i.extensionsRequired&&i.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,o)}}class c9{constructor(e){this.parser=e,this.name=Tt.EXT_TEXTURE_WEBP,this.isSupported=null}loadTexture(e){const t=this.name,i=this.parser,r=i.json,s=r.textures[e];if(!s.extensions||!s.extensions[t])return null;const o=s.extensions[t],a=r.images[o.source];let l=i.textureLoader;if(a.uri){const u=i.options.manager.getHandler(a.uri);u!==null&&(l=u)}return this.detectSupport().then(function(u){if(u)return i.loadTextureImage(e,o.source,l);if(r.extensionsRequired&&r.extensionsRequired.indexOf(t)>=0)throw new Error("THREE.GLTFLoader: WebP required by asset but unsupported.");return i.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 u9{constructor(e){this.parser=e,this.name=Tt.EXT_TEXTURE_AVIF,this.isSupported=null}loadTexture(e){const t=this.name,i=this.parser,r=i.json,s=r.textures[e];if(!s.extensions||!s.extensions[t])return null;const o=s.extensions[t],a=r.images[o.source];let l=i.textureLoader;if(a.uri){const u=i.options.manager.getHandler(a.uri);u!==null&&(l=u)}return this.detectSupport().then(function(u){if(u)return i.loadTextureImage(e,o.source,l);if(r.extensionsRequired&&r.extensionsRequired.indexOf(t)>=0)throw new Error("THREE.GLTFLoader: AVIF required by asset but unsupported.");return i.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 f9{constructor(e){this.name=Tt.EXT_MESHOPT_COMPRESSION,this.parser=e}loadBufferView(e){const t=this.parser.json,i=t.bufferViews[e];if(i.extensions&&i.extensions[this.name]){const r=i.extensions[this.name],s=this.parser.getDependency("buffer",r.buffer),o=this.parser.options.meshoptDecoder;if(!o||!o.supported){if(t.extensionsRequired&&t.extensionsRequired.indexOf(this.name)>=0)throw new Error("THREE.GLTFLoader: setMeshoptDecoder must be called before loading compressed files");return null}return s.then(function(a){const l=r.byteOffset||0,u=r.byteLength||0,h=r.count,d=r.byteStride,p=new Uint8Array(a,l,u);return o.decodeGltfBufferAsync?o.decodeGltfBufferAsync(h,d,p,r.mode,r.filter).then(function(m){return m.buffer}):o.ready.then(function(){const m=new ArrayBuffer(h*d);return o.decodeGltfBuffer(new Uint8Array(m),h,d,p,r.mode,r.filter),m})})}else return null}}class h9{constructor(e){this.name=Tt.EXT_MESH_GPU_INSTANCING,this.parser=e}createNodeMesh(e){const t=this.parser.json,i=t.nodes[e];if(!i.extensions||!i.extensions[this.name]||i.mesh===void 0)return null;const r=t.meshes[i.mesh];for(const u of r.primitives)if(u.mode!==fr.TRIANGLES&&u.mode!==fr.TRIANGLE_STRIP&&u.mode!==fr.TRIANGLE_FAN&&u.mode!==void 0)return null;const o=i.extensions[this.name].attributes,a=[],l={};for(const u in o)a.push(this.parser.getDependency("accessor",o[u]).then(h=>(l[u]=h,l[u])));return a.length<1?null:(a.push(this.parser.createNodeMesh(e)),Promise.all(a).then(u=>{const h=u.pop(),d=h.isGroup?h.children:[h],p=u[0].count,m=[];for(const y of d){const M=new rt,_=new F,g=new Gn,x=new F(1,1,1),S=new PS(y.geometry,y.material,p);for(let E=0;E<p;E++)l.TRANSLATION&&_.fromBufferAttribute(l.TRANSLATION,E),l.ROTATION&&g.fromBufferAttribute(l.ROTATION,E),l.SCALE&&x.fromBufferAttribute(l.SCALE,E),S.setMatrixAt(E,M.compose(_,g,x));for(const E in l)E!=="TRANSLATION"&&E!=="ROTATION"&&E!=="SCALE"&&y.geometry.setAttribute(E,l[E]);bt.prototype.copy.call(S,y),this.parser.assignFinalMaterial(S),m.push(S)}return h.isGroup?(h.clear(),h.add(...m),h):m[0]}))}}const PL="glTF",tf=12,fC={JSON:1313821514,BIN:5130562};class d9{constructor(e){this.name=Tt.KHR_BINARY_GLTF,this.content=null,this.body=null;const t=new DataView(e,0,tf);if(this.header={magic:ps.decodeText(new Uint8Array(e.slice(0,4))),version:t.getUint32(4,!0),length:t.getUint32(8,!0)},this.header.magic!==PL)throw new Error("THREE.GLTFLoader: Unsupported glTF-Binary header.");if(this.header.version<2)throw new Error("THREE.GLTFLoader: Legacy binary file detected.");const i=this.header.length-tf,r=new DataView(e,tf);let s=0;for(;s<i;){const o=r.getUint32(s,!0);s+=4;const a=r.getUint32(s,!0);if(s+=4,a===fC.JSON){const l=new Uint8Array(e,tf+s,o);this.content=ps.decodeText(l)}else if(a===fC.BIN){const l=tf+s;this.body=e.slice(l,l+o)}s+=o}if(this.content===null)throw new Error("THREE.GLTFLoader: JSON content not found.")}}class p9{constructor(e,t){if(!t)throw new Error("THREE.GLTFLoader: No DRACOLoader instance provided.");this.name=Tt.KHR_DRACO_MESH_COMPRESSION,this.json=e,this.dracoLoader=t,this.dracoLoader.preload()}decodePrimitive(e,t){const i=this.json,r=this.dracoLoader,s=e.extensions[this.name].bufferView,o=e.extensions[this.name].attributes,a={},l={},u={};for(const h in o){const d=z_[h]||h.toLowerCase();a[d]=o[h]}for(const h in e.attributes){const d=z_[h]||h.toLowerCase();if(o[h]!==void 0){const p=i.accessors[e.attributes[h]],m=Dc[p.componentType];u[d]=m.name,l[d]=p.normalized===!0}}return t.getDependency("bufferView",s).then(function(h){return new Promise(function(d){r.decodeDracoFile(h,function(p){for(const m in p.attributes){const y=p.attributes[m],M=l[m];M!==void 0&&(y.normalized=M)}d(p)},a,u)})})}}class m9{constructor(){this.name=Tt.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 g9{constructor(){this.name=Tt.KHR_MESH_QUANTIZATION}}class BL extends du{constructor(e,t,i,r){super(e,t,i,r)}copySampleValue_(e){const t=this.resultBuffer,i=this.sampleValues,r=this.valueSize,s=e*r*3+r;for(let o=0;o!==r;o++)t[o]=i[s+o];return t}interpolate_(e,t,i,r){const s=this.resultBuffer,o=this.sampleValues,a=this.valueSize,l=a*2,u=a*3,h=r-t,d=(i-t)/h,p=d*d,m=p*d,y=e*u,M=y-u,_=-2*m+3*p,g=m-p,x=1-_,S=g-p+d;for(let E=0;E!==a;E++){const C=o[M+E+a],b=o[M+E+l]*h,P=o[y+E+a],B=o[y+E]*h;s[E]=x*C+S*b+_*P+g*B}return s}}const v9=new Gn;class y9 extends BL{interpolate_(e,t,i,r){const s=super.interpolate_(e,t,i,r);return v9.fromArray(s).normalize().toArray(s),s}}const fr={FLOAT:5126,FLOAT_MAT3:35675,FLOAT_MAT4:35676,FLOAT_VEC2:35664,FLOAT_VEC3:35665,FLOAT_VEC4:35666,LINEAR:9729,REPEAT:10497,SAMPLER_2D:35678,POINTS:0,LINES:1,LINE_LOOP:2,LINE_STRIP:3,TRIANGLES:4,TRIANGLE_STRIP:5,TRIANGLE_FAN:6,UNSIGNED_BYTE:5121,UNSIGNED_SHORT:5123},Dc={5120:Int8Array,5121:Uint8Array,5122:Int16Array,5123:Uint16Array,5125:Uint32Array,5126:Float32Array},hC={9728:mn,9729:rn,9984:th,9985:Rg,9986:Bc,9987:vs},dC={33071:Xn,33648:Jc,10497:Ko},Iy={SCALAR:1,VEC2:2,VEC3:3,VEC4:4,MAT2:4,MAT3:9,MAT4:16},z_={POSITION:"position",NORMAL:"normal",TANGENT:"tangent",...Sh.replace(/\D+/g,"")>=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"},yo={scale:"scale",translation:"position",rotation:"quaternion",weights:"morphTargetInfluences"},x9={CUBICSPLINE:void 0,LINEAR:sl,STEP:Yc},Dy={OPAQUE:"OPAQUE",MASK:"MASK",BLEND:"BLEND"};function _9(n){return n.DefaultMaterial===void 0&&(n.DefaultMaterial=new Dh({color:16777215,emissive:0,metalness:1,roughness:1,transparent:!1,depthTest:!0,side:gs})),n.DefaultMaterial}function Ea(n,e,t){for(const i in t.extensions)n[i]===void 0&&(e.userData.gltfExtensions=e.userData.gltfExtensions||{},e.userData.gltfExtensions[i]=t.extensions[i])}function Mo(n,e){e.extras!==void 0&&(typeof e.extras=="object"?Object.assign(n.userData,e.extras):console.warn("THREE.GLTFLoader: Ignoring primitive type .extras, "+e.extras))}function A9(n,e,t){let i=!1,r=!1,s=!1;for(let u=0,h=e.length;u<h;u++){const d=e[u];if(d.POSITION!==void 0&&(i=!0),d.NORMAL!==void 0&&(r=!0),d.COLOR_0!==void 0&&(s=!0),i&&r&&s)break}if(!i&&!r&&!s)return Promise.resolve(n);const o=[],a=[],l=[];for(let u=0,h=e.length;u<h;u++){const d=e[u];if(i){const p=d.POSITION!==void 0?t.getDependency("accessor",d.POSITION):n.attributes.position;o.push(p)}if(r){const p=d.NORMAL!==void 0?t.getDependency("accessor",d.NORMAL):n.attributes.normal;a.push(p)}if(s){const p=d.COLOR_0!==void 0?t.getDependency("accessor",d.COLOR_0):n.attributes.color;l.push(p)}}return Promise.all([Promise.all(o),Promise.all(a),Promise.all(l)]).then(function(u){const h=u[0],d=u[1],p=u[2];return i&&(n.morphAttributes.position=h),r&&(n.morphAttributes.normal=d),s&&(n.morphAttributes.color=p),n.morphTargetsRelative=!0,n})}function S9(n,e){if(n.updateMorphTargets(),e.weights!==void 0)for(let t=0,i=e.weights.length;t<i;t++)n.morphTargetInfluences[t]=e.weights[t];if(e.extras&&Array.isArray(e.extras.targetNames)){const t=e.extras.targetNames;if(n.morphTargetInfluences.length===t.length){n.morphTargetDictionary={};for(let i=0,r=t.length;i<r;i++)n.morphTargetDictionary[t[i]]=i}else console.warn("THREE.GLTFLoader: Invalid extras.targetNames length. Ignoring names.")}}function M9(n){let e;const t=n.extensions&&n.extensions[Tt.KHR_DRACO_MESH_COMPRESSION];if(t?e="draco:"+t.bufferView+":"+t.indices+":"+Fy(t.attributes):e=n.indices+":"+Fy(n.attributes)+":"+n.mode,n.targets!==void 0)for(let i=0,r=n.targets.length;i<r;i++)e+=":"+Fy(n.targets[i]);return e}function Fy(n){let e="";const t=Object.keys(n).sort();for(let i=0,r=t.length;i<r;i++)e+=t[i]+":"+n[t[i]]+";";return e}function G_(n){switch(n){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 E9(n){return n.search(/\.jpe?g($|\?)/i)>0||n.search(/^data\:image\/jpeg/)===0?"image/jpeg":n.search(/\.webp($|\?)/i)>0||n.search(/^data\:image\/webp/)===0?"image/webp":"image/png"}const w9=new rt;class T9{constructor(e={},t={}){this.json=e,this.extensions={},this.plugins={},this.options=t,this.cache=new Q5,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 i=!1,r=!1,s=-1;typeof navigator<"u"&&typeof navigator.userAgent<"u"&&(i=/^((?!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"||i||r&&s<98?this.textureLoader=new W2(this.options.manager):this.textureLoader=new Z2(this.options.manager),this.textureLoader.setCrossOrigin(this.options.crossOrigin),this.textureLoader.setRequestHeader(this.options.requestHeader),this.fileLoader=new Yi(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 i=this,r=this.json,s=this.extensions;this.cache.removeAll(),this.nodeCache={},this._invokeAll(function(o){return o._markDefs&&o._markDefs()}),Promise.all(this._invokeAll(function(o){return o.beforeRoot&&o.beforeRoot()})).then(function(){return Promise.all([i.getDependencies("scene"),i.getDependencies("animation"),i.getDependencies("camera")])}).then(function(o){const a={scene:o[0][r.scene||0],scenes:o[0],animations:o[1],cameras:o[2],asset:r.asset,parser:i,userData:{}};Ea(s,a,r),Mo(a,r),Promise.all(i._invokeAll(function(l){return l.afterRoot&&l.afterRoot(a)})).then(function(){e(a)})}).catch(t)}_markDefs(){const e=this.json.nodes||[],t=this.json.skins||[],i=this.json.meshes||[];for(let r=0,s=t.length;r<s;r++){const o=t[r].joints;for(let a=0,l=o.length;a<l;a++)e[o[a]].isBone=!0}for(let r=0,s=e.length;r<s;r++){const o=e[r];o.mesh!==void 0&&(this._addNodeRef(this.meshCache,o.mesh),o.skin!==void 0&&(i[o.mesh].isSkinnedMesh=!0)),o.camera!==void 0&&this._addNodeRef(this.cameraCache,o.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,i){if(e.refs[t]<=1)return i;const r=i.clone(),s=(o,a)=>{const l=this.associations.get(o);l!=null&&this.associations.set(a,l);for(const[u,h]of o.children.entries())s(h,a.children[u])};return s(i,r),r.name+="_instance_"+e.uses[t]++,r}_invokeOne(e){const t=Object.values(this.plugins);t.push(this);for(let i=0;i<t.length;i++){const r=e(t[i]);if(r)return r}return null}_invokeAll(e){const t=Object.values(this.plugins);t.unshift(this);const i=[];for(let r=0;r<t.length;r++){const s=e(t[r]);s&&i.push(s)}return i}getDependency(e,t){const i=e+":"+t;let r=this.cache.get(i);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(i,r)}return r}getDependencies(e){let t=this.cache.get(e);if(!t){const i=this,r=this.json[e+(e==="mesh"?"es":"s")]||[];t=Promise.all(r.map(function(s,o){return i.getDependency(e,o)})),this.cache.add(e,t)}return t}loadBuffer(e){const t=this.json.buffers[e],i=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[Tt.KHR_BINARY_GLTF].body);const r=this.options;return new Promise(function(s,o){i.load(ps.resolveURL(t.uri,r.path),s,void 0,function(){o(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(i){const r=t.byteLength||0,s=t.byteOffset||0;return i.slice(s,s+r)})}loadAccessor(e){const t=this,i=this.json,r=this.json.accessors[e];if(r.bufferView===void 0&&r.sparse===void 0){const o=Iy[r.type],a=Dc[r.componentType],l=r.normalized===!0,u=new a(r.count*o);return Promise.resolve(new Dt(u,o,l))}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(o){const a=o[0],l=Iy[r.type],u=Dc[r.componentType],h=u.BYTES_PER_ELEMENT,d=h*l,p=r.byteOffset||0,m=r.bufferView!==void 0?i.bufferViews[r.bufferView].byteStride:void 0,y=r.normalized===!0;let M,_;if(m&&m!==d){const g=Math.floor(p/m),x="InterleavedBuffer:"+r.bufferView+":"+r.componentType+":"+g+":"+r.count;let S=t.cache.get(x);S||(M=new u(a,g*m,r.count*m/h),S=new bh(M,m/h),t.cache.add(x,S)),_=new Yo(S,l,p%m/h,y)}else a===null?M=new u(r.count*l):M=new u(a,p,r.count*l),_=new Dt(M,l,y);if(r.sparse!==void 0){const g=Iy.SCALAR,x=Dc[r.sparse.indices.componentType],S=r.sparse.indices.byteOffset||0,E=r.sparse.values.byteOffset||0,C=new x(o[1],S,r.sparse.count*g),b=new u(o[2],E,r.sparse.count*l);a!==null&&(_=new Dt(_.array.slice(),_.itemSize,_.normalized));for(let P=0,B=C.length;P<B;P++){const R=C[P];if(_.setX(R,b[P*l]),l>=2&&_.setY(R,b[P*l+1]),l>=3&&_.setZ(R,b[P*l+2]),l>=4&&_.setW(R,b[P*l+3]),l>=5)throw new Error("THREE.GLTFLoader: Unsupported itemSize in sparse BufferAttribute.")}}return _})}loadTexture(e){const t=this.json,i=this.options,s=t.textures[e].source,o=t.images[s];let a=this.textureLoader;if(o.uri){const l=i.manager.getHandler(o.uri);l!==null&&(a=l)}return this.loadTextureImage(e,s,a)}loadTextureImage(e,t,i){const r=this,s=this.json,o=s.textures[e],a=s.images[t],l=(a.uri||a.bufferView)+":"+o.sampler;if(this.textureCache[l])return this.textureCache[l];const u=this.loadImageSource(t,i).then(function(h){h.flipY=!1,h.name=o.name||a.name||"",h.name===""&&typeof a.uri=="string"&&a.uri.startsWith("data:image/")===!1&&(h.name=a.uri);const p=(s.samplers||{})[o.sampler]||{};return h.magFilter=hC[p.magFilter]||rn,h.minFilter=hC[p.minFilter]||vs,h.wrapS=dC[p.wrapS]||Ko,h.wrapT=dC[p.wrapT]||Ko,r.associations.set(h,{textures:e}),h}).catch(function(){return null});return this.textureCache[l]=u,u}loadImageSource(e,t){const i=this,r=this.json,s=this.options;if(this.sourceCache[e]!==void 0)return this.sourceCache[e].then(d=>d.clone());const o=r.images[e],a=self.URL||self.webkitURL;let l=o.uri||"",u=!1;if(o.bufferView!==void 0)l=i.getDependency("bufferView",o.bufferView).then(function(d){u=!0;const p=new Blob([d],{type:o.mimeType});return l=a.createObjectURL(p),l});else if(o.uri===void 0)throw new Error("THREE.GLTFLoader: Image "+e+" is missing URI and bufferView");const h=Promise.resolve(l).then(function(d){return new Promise(function(p,m){let y=p;t.isImageBitmapLoader===!0&&(y=function(M){const _=new $t(M);_.needsUpdate=!0,p(_)}),t.load(ps.resolveURL(d,s.path),y,void 0,m)})}).then(function(d){return u===!0&&a.revokeObjectURL(l),d.userData.mimeType=o.mimeType||E9(o.uri),d}).catch(function(d){throw console.error("THREE.GLTFLoader: Couldn't load texture",l),d});return this.sourceCache[e]=h,h}assignTexture(e,t,i,r){const s=this;return this.getDependency("texture",i.index).then(function(o){if(!o)return null;if(i.texCoord!==void 0&&i.texCoord>0&&(o=o.clone(),o.channel=i.texCoord),s.extensions[Tt.KHR_TEXTURE_TRANSFORM]){const a=i.extensions!==void 0?i.extensions[Tt.KHR_TEXTURE_TRANSFORM]:void 0;if(a){const l=s.associations.get(o);o=s.extensions[Tt.KHR_TEXTURE_TRANSFORM].extendTexture(o,a),s.associations.set(o,l)}}return r!==void 0&&("colorSpace"in o?o.colorSpace=r===3001?"srgb":"srgb-linear":o.encoding=r),e[t]=o,o})}assignFinalMaterial(e){const t=e.geometry;let i=e.material;const r=t.attributes.tangent===void 0,s=t.attributes.color!==void 0,o=t.attributes.normal===void 0;if(e.isPoints){const a="PointsMaterial:"+i.uuid;let l=this.cache.get(a);l||(l=new Ph,Cn.prototype.copy.call(l,i),l.color.copy(i.color),l.map=i.map,l.sizeAttenuation=!1,this.cache.add(a,l)),i=l}else if(e.isLine){const a="LineBasicMaterial:"+i.uuid;let l=this.cache.get(a);l||(l=new ai,Cn.prototype.copy.call(l,i),l.color.copy(i.color),l.map=i.map,this.cache.add(a,l)),i=l}if(r||s||o){let a="ClonedMaterial:"+i.uuid+":";r&&(a+="derivative-tangents:"),s&&(a+="vertex-colors:"),o&&(a+="flat-shading:");let l=this.cache.get(a);l||(l=i.clone(),s&&(l.vertexColors=!0),o&&(l.flatShading=!0),r&&(l.normalScale&&(l.normalScale.y*=-1),l.clearcoatNormalScale&&(l.clearcoatNormalScale.y*=-1)),this.cache.add(a,l),this.associations.set(l,this.associations.get(i))),i=l}e.material=i}getMaterialType(){return Dh}loadMaterial(e){const t=this,i=this.json,r=this.extensions,s=i.materials[e];let o;const a={},l=s.extensions||{},u=[];if(l[Tt.KHR_MATERIALS_UNLIT]){const d=r[Tt.KHR_MATERIALS_UNLIT];o=d.getMaterialType(),u.push(d.extendParams(a,s,t))}else{const d=s.pbrMetallicRoughness||{};if(a.color=new Oe(1,1,1),a.opacity=1,Array.isArray(d.baseColorFactor)){const p=d.baseColorFactor;a.color.fromArray(p),a.opacity=p[3]}d.baseColorTexture!==void 0&&u.push(t.assignTexture(a,"map",d.baseColorTexture,3001)),a.metalness=d.metallicFactor!==void 0?d.metallicFactor:1,a.roughness=d.roughnessFactor!==void 0?d.roughnessFactor:1,d.metallicRoughnessTexture!==void 0&&(u.push(t.assignTexture(a,"metalnessMap",d.metallicRoughnessTexture)),u.push(t.assignTexture(a,"roughnessMap",d.metallicRoughnessTexture))),o=this._invokeOne(function(p){return p.getMaterialType&&p.getMaterialType(e)}),u.push(Promise.all(this._invokeAll(function(p){return p.extendMaterialParams&&p.extendMaterialParams(e,a)})))}s.doubleSided===!0&&(a.side=vr);const h=s.alphaMode||Dy.OPAQUE;if(h===Dy.BLEND?(a.transparent=!0,a.depthWrite=!1):(a.transparent=!1,h===Dy.MASK&&(a.alphaTest=s.alphaCutoff!==void 0?s.alphaCutoff:.5)),s.normalTexture!==void 0&&o!==ji&&(u.push(t.assignTexture(a,"normalMap",s.normalTexture)),a.normalScale=new ge(1,1),s.normalTexture.scale!==void 0)){const d=s.normalTexture.scale;a.normalScale.set(d,d)}return s.occlusionTexture!==void 0&&o!==ji&&(u.push(t.assignTexture(a,"aoMap",s.occlusionTexture)),s.occlusionTexture.strength!==void 0&&(a.aoMapIntensity=s.occlusionTexture.strength)),s.emissiveFactor!==void 0&&o!==ji&&(a.emissive=new Oe().fromArray(s.emissiveFactor)),s.emissiveTexture!==void 0&&o!==ji&&u.push(t.assignTexture(a,"emissiveMap",s.emissiveTexture,3001)),Promise.all(u).then(function(){const d=new o(a);return s.name&&(d.name=s.name),Mo(d,s),t.associations.set(d,{materials:e}),s.extensions&&Ea(r,d,s),d})}createUniqueName(e){const t=Ct.sanitizeNodeName(e||"");return t in this.nodeNamesUsed?t+"_"+ ++this.nodeNamesUsed[t]:(this.nodeNamesUsed[t]=0,t)}loadGeometries(e){const t=this,i=this.extensions,r=this.primitiveCache;function s(a){return i[Tt.KHR_DRACO_MESH_COMPRESSION].decodePrimitive(a,t).then(function(l){return pC(l,a,t)})}const o=[];for(let a=0,l=e.length;a<l;a++){const u=e[a],h=M9(u),d=r[h];if(d)o.push(d.promise);else{let p;u.extensions&&u.extensions[Tt.KHR_DRACO_MESH_COMPRESSION]?p=s(u):p=pC(new gt,u,t),r[h]={primitive:u,promise:p},o.push(p)}}return Promise.all(o)}loadMesh(e){const t=this,i=this.json,r=this.extensions,s=i.meshes[e],o=s.primitives,a=[];for(let l=0,u=o.length;l<u;l++){const h=o[l].material===void 0?_9(this.cache):this.getDependency("material",o[l].material);a.push(h)}return a.push(t.loadGeometries(o)),Promise.all(a).then(function(l){const u=l.slice(0,l.length-1),h=l[l.length-1],d=[];for(let m=0,y=h.length;m<y;m++){const M=h[m],_=o[m];let g;const x=u[m];if(_.mode===fr.TRIANGLES||_.mode===fr.TRIANGLE_STRIP||_.mode===fr.TRIANGLE_FAN||_.mode===void 0)g=s.isSkinnedMesh===!0?new RS(M,x):new Hn(M,x),g.isSkinnedMesh===!0&&g.normalizeSkinWeights(),_.mode===fr.TRIANGLE_STRIP?g.geometry=cC(g.geometry,pS):_.mode===fr.TRIANGLE_FAN&&(g.geometry=cC(g.geometry,Ym));else if(_.mode===fr.LINES)g=new Jr(M,x);else if(_.mode===fr.LINE_STRIP)g=new Zs(M,x);else if(_.mode===fr.LINE_LOOP)g=new BS(M,x);else if(_.mode===fr.POINTS)g=new LS(M,x);else throw new Error("THREE.GLTFLoader: Primitive mode unsupported: "+_.mode);Object.keys(g.geometry.morphAttributes).length>0&&S9(g,s),g.name=t.createUniqueName(s.name||"mesh_"+e),Mo(g,s),_.extensions&&Ea(r,g,_),t.assignFinalMaterial(g),d.push(g)}for(let m=0,y=d.length;m<y;m++)t.associations.set(d[m],{meshes:e,primitives:m});if(d.length===1)return s.extensions&&Ea(r,d[0],s),d[0];const p=new zs;s.extensions&&Ea(r,p,s),t.associations.set(p,{meshes:e});for(let m=0,y=d.length;m<y;m++)p.add(d[m]);return p})}loadCamera(e){let t;const i=this.json.cameras[e],r=i[i.type];if(!r){console.warn("THREE.GLTFLoader: Missing camera parameters.");return}return i.type==="perspective"?t=new qt(s2.radToDeg(r.yfov),r.aspectRatio||1,r.znear||1,r.zfar||2e6):i.type==="orthographic"&&(t=new zr(-r.xmag,r.xmag,r.ymag,-r.ymag,r.znear,r.zfar)),i.name&&(t.name=this.createUniqueName(i.name)),Mo(t,i),Promise.resolve(t)}loadSkin(e){const t=this.json.skins[e],i=[];for(let r=0,s=t.joints.length;r<s;r++)i.push(this._loadNodeShallow(t.joints[r]));return t.inverseBindMatrices!==void 0?i.push(this.getDependency("accessor",t.inverseBindMatrices)):i.push(null),Promise.all(i).then(function(r){const s=r.pop(),o=r,a=[],l=[];for(let u=0,h=o.length;u<h;u++){const d=o[u];if(d){a.push(d);const p=new rt;s!==null&&p.fromArray(s.array,u*16),l.push(p)}else console.warn('THREE.GLTFLoader: Joint "%s" could not be found.',t.joints[u])}return new Rh(a,l)})}loadAnimation(e){const i=this.json.animations[e],r=i.name?i.name:"animation_"+e,s=[],o=[],a=[],l=[],u=[];for(let h=0,d=i.channels.length;h<d;h++){const p=i.channels[h],m=i.samplers[p.sampler],y=p.target,M=y.node,_=i.parameters!==void 0?i.parameters[m.input]:m.input,g=i.parameters!==void 0?i.parameters[m.output]:m.output;y.node!==void 0&&(s.push(this.getDependency("node",M)),o.push(this.getDependency("accessor",_)),a.push(this.getDependency("accessor",g)),l.push(m),u.push(y))}return Promise.all([Promise.all(s),Promise.all(o),Promise.all(a),Promise.all(l),Promise.all(u)]).then(function(h){const d=h[0],p=h[1],m=h[2],y=h[3],M=h[4],_=[];for(let g=0,x=d.length;g<x;g++){const S=d[g],E=p[g],C=m[g],b=y[g],P=M[g];if(S===void 0)continue;S.updateMatrix();let B;switch(yo[P.path]){case yo.weights:B=$c;break;case yo.rotation:B=Qo;break;case yo.position:case yo.scale:default:B=eu;break}const R=S.name?S.name:S.uuid,L=b.interpolation!==void 0?x9[b.interpolation]:sl,z=[];yo[P.path]===yo.weights?S.traverse(function(X){X.morphTargetInfluences&&z.push(X.name?X.name:X.uuid)}):z.push(R);let $=C.array;if(C.normalized){const X=G_($.constructor),Q=new Float32Array($.length);for(let Y=0,ne=$.length;Y<ne;Y++)Q[Y]=$[Y]*X;$=Q}for(let X=0,Q=z.length;X<Q;X++){const Y=new B(z[X]+"."+yo[P.path],E.array,$,L);b.interpolation==="CUBICSPLINE"&&(Y.createInterpolant=function(ee){const I=this instanceof Qo?y9:BL;return new I(this.times,this.values,this.getValueSize()/3,ee)},Y.createInterpolant.isInterpolantFactoryMethodGLTFCubicSpline=!0),_.push(Y)}}return new tu(r,void 0,_)})}createNodeMesh(e){const t=this.json,i=this,r=t.nodes[e];return r.mesh===void 0?null:i.getDependency("mesh",r.mesh).then(function(s){const o=i._getNodeRef(i.meshCache,r.mesh,s);return r.weights!==void 0&&o.traverse(function(a){if(a.isMesh)for(let l=0,u=r.weights.length;l<u;l++)a.morphTargetInfluences[l]=r.weights[l]}),o})}loadNode(e){const t=this.json,i=this,r=t.nodes[e],s=i._loadNodeShallow(e),o=[],a=r.children||[];for(let u=0,h=a.length;u<h;u++)o.push(i.getDependency("node",a[u]));const l=r.skin===void 0?Promise.resolve(null):i.getDependency("skin",r.skin);return Promise.all([s,Promise.all(o),l]).then(function(u){const h=u[0],d=u[1],p=u[2];p!==null&&h.traverse(function(m){m.isSkinnedMesh&&m.bind(p,w9)});for(let m=0,y=d.length;m<y;m++)h.add(d[m]);return h})}_loadNodeShallow(e){const t=this.json,i=this.extensions,r=this;if(this.nodeCache[e]!==void 0)return this.nodeCache[e];const s=t.nodes[e],o=s.name?r.createUniqueName(s.name):"",a=[],l=r._invokeOne(function(u){return u.createNodeMesh&&u.createNodeMesh(e)});return l&&a.push(l),s.camera!==void 0&&a.push(r.getDependency("camera",s.camera).then(function(u){return r._getNodeRef(r.cameraCache,s.camera,u)})),r._invokeAll(function(u){return u.createNodeAttachment&&u.createNodeAttachment(e)}).forEach(function(u){a.push(u)}),this.nodeCache[e]=Promise.all(a).then(function(u){let h;if(s.isBone===!0?h=new Og:u.length>1?h=new zs:u.length===1?h=u[0]:h=new bt,h!==u[0])for(let d=0,p=u.length;d<p;d++)h.add(u[d]);if(s.name&&(h.userData.name=s.name,h.name=o),Mo(h,s),s.extensions&&Ea(i,h,s),s.matrix!==void 0){const d=new rt;d.fromArray(s.matrix),h.applyMatrix4(d)}else s.translation!==void 0&&h.position.fromArray(s.translation),s.rotation!==void 0&&h.quaternion.fromArray(s.rotation),s.scale!==void 0&&h.scale.fromArray(s.scale);return r.associations.has(h)||r.associations.set(h,{}),r.associations.get(h).nodes=e,h}),this.nodeCache[e]}loadScene(e){const t=this.extensions,i=this.json.scenes[e],r=this,s=new zs;i.name&&(s.name=r.createUniqueName(i.name)),Mo(s,i),i.extensions&&Ea(t,s,i);const o=i.nodes||[],a=[];for(let l=0,u=o.length;l<u;l++)a.push(r.getDependency("node",o[l]));return Promise.all(a).then(function(l){for(let h=0,d=l.length;h<d;h++)s.add(l[h]);const u=h=>{const d=new Map;for(const[p,m]of r.associations)(p instanceof Cn||p instanceof $t)&&d.set(p,m);return h.traverse(p=>{const m=r.associations.get(p);m!=null&&d.set(p,m)}),d};return r.associations=u(s),s})}}function C9(n,e,t){const i=e.attributes,r=new Xr;if(i.POSITION!==void 0){const a=t.json.accessors[i.POSITION],l=a.min,u=a.max;if(l!==void 0&&u!==void 0){if(r.set(new F(l[0],l[1],l[2]),new F(u[0],u[1],u[2])),a.normalized){const h=G_(Dc[a.componentType]);r.min.multiplyScalar(h),r.max.multiplyScalar(h)}}else{console.warn("THREE.GLTFLoader: Missing min/max properties for accessor POSITION.");return}}else return;const s=e.targets;if(s!==void 0){const a=new F,l=new F;for(let u=0,h=s.length;u<h;u++){const d=s[u];if(d.POSITION!==void 0){const p=t.json.accessors[d.POSITION],m=p.min,y=p.max;if(m!==void 0&&y!==void 0){if(l.setX(Math.max(Math.abs(m[0]),Math.abs(y[0]))),l.setY(Math.max(Math.abs(m[1]),Math.abs(y[1]))),l.setZ(Math.max(Math.abs(m[2]),Math.abs(y[2]))),p.normalized){const M=G_(Dc[p.componentType]);l.multiplyScalar(M)}a.max(l)}else console.warn("THREE.GLTFLoader: Missing min/max properties for accessor POSITION.")}}r.expandByVector(a)}n.boundingBox=r;const o=new Sr;r.getCenter(o.center),o.radius=r.min.distanceTo(r.max)/2,n.boundingSphere=o}function pC(n,e,t){const i=e.attributes,r=[];function s(o,a){return t.getDependency("accessor",o).then(function(l){n.setAttribute(a,l)})}for(const o in i){const a=z_[o]||o.toLowerCase();a in n.attributes||r.push(s(i[o],a))}if(e.indices!==void 0&&!n.index){const o=t.getDependency("accessor",e.indices).then(function(a){n.setIndex(a)});r.push(o)}return Mo(n,e),C9(n,e,t),Promise.all(r).then(function(){return e.targets!==void 0?A9(n,e.targets,t):n})}const Ny=new WeakMap;class b9 extends li{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,i,r){const s=new Yi(this.manager);s.setPath(this.path),s.setResponseType("arraybuffer"),s.setRequestHeader(this.requestHeader),s.setWithCredentials(this.withCredentials),s.load(e,o=>{const a={attributeIDs:this.defaultAttributeIDs,attributeTypes:this.defaultAttributeTypes,useUniqueIDs:!1};this.decodeGeometry(o,a).then(t).catch(r)},i,r)}decodeDracoFile(e,t,i,r){const s={attributeIDs:i||this.defaultAttributeIDs,attributeTypes:r||this.defaultAttributeTypes,useUniqueIDs:!!i};this.decodeGeometry(e,s).then(t)}decodeGeometry(e,t){for(const l in t.attributeTypes){const u=t.attributeTypes[l];u.BYTES_PER_ELEMENT!==void 0&&(t.attributeTypes[l]=u.name)}const i=JSON.stringify(t);if(Ny.has(e)){const l=Ny.get(e);if(l.key===i)return l.promise;if(e.byteLength===0)throw new Error("THREE.DRACOLoader: Unable to re-decode a buffer with different settings. Buffer has already been transferred.")}let r;const s=this.workerNextTaskID++,o=e.byteLength,a=this._getWorker(s,o).then(l=>(r=l,new Promise((u,h)=>{r._callbacks[s]={resolve:u,reject:h},r.postMessage({type:"decode",id:s,taskConfig:t,buffer:e},[e])}))).then(l=>this._createGeometry(l.geometry));return a.catch(()=>!0).then(()=>{r&&s&&this._releaseTask(r,s)}),Ny.set(e,{key:i,promise:a}),a}_createGeometry(e){const t=new gt;e.index&&t.setIndex(new Dt(e.index.array,1));for(let i=0;i<e.attributes.length;i++){const r=e.attributes[i],s=r.name,o=r.array,a=r.itemSize;t.setAttribute(s,new Dt(o,a))}return t}_loadLibrary(e,t){const i=new Yi(this.manager);return i.setPath(this.decoderPath),i.setResponseType(t),i.setWithCredentials(this.withCredentials),new Promise((r,s)=>{i.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(i=>{const r=i[0];e||(this.decoderConfig.wasmBinary=i[1]);const s=R9.toString(),o=["/* draco decoder */",r,"","/* worker */",s.substring(s.indexOf("{")+1,s.lastIndexOf("}"))].join(`
`);this.workerSourceURL=URL.createObjectURL(new Blob([o]))}),this.decoderPending}_getWorker(e,t){return this._initDecoder().then(()=>{if(this.workerPool.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 o=s.data;switch(o.type){case"decode":r._callbacks[o.id].resolve(o);break;case"error":r._callbacks[o.id].reject(o);break;default:console.error('THREE.DRACOLoader: Unexpected message, "'+o.type+'"')}},this.workerPool.push(r)}else this.workerPool.sort(function(r,s){return r._taskLoad>s._taskLoad?-1:1});const i=this.workerPool[this.workerPool.length-1];return i._taskCosts[e]=t,i._taskLoad+=t,i})}_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 R9(){let n,e;onmessage=function(o){const a=o.data;switch(a.type){case"init":n=a.decoderConfig,e=new Promise(function(h){n.onModuleLoaded=function(d){h({draco:d})},DracoDecoderModule(n)});break;case"decode":const l=a.buffer,u=a.taskConfig;e.then(h=>{const d=h.draco,p=new d.Decoder,m=new d.DecoderBuffer;m.Init(new Int8Array(l),l.byteLength);try{const y=t(d,p,m,u),M=y.attributes.map(_=>_.array.buffer);y.index&&M.push(y.index.array.buffer),self.postMessage({type:"decode",id:a.id,geometry:y},M)}catch(y){console.error(y),self.postMessage({type:"error",id:a.id,error:y.message})}finally{d.destroy(m),d.destroy(p)}});break}};function t(o,a,l,u){const h=u.attributeIDs,d=u.attributeTypes;let p,m;const y=a.GetEncodedGeometryType(l);if(y===o.TRIANGULAR_MESH)p=new o.Mesh,m=a.DecodeBufferToMesh(l,p);else if(y===o.POINT_CLOUD)p=new o.PointCloud,m=a.DecodeBufferToPointCloud(l,p);else throw new Error("THREE.DRACOLoader: Unexpected geometry type.");if(!m.ok()||p.ptr===0)throw new Error("THREE.DRACOLoader: Decoding failed: "+m.error_msg());const M={index:null,attributes:[]};for(const _ in h){const g=self[d[_]];let x,S;if(u.useUniqueIDs)S=h[_],x=a.GetAttributeByUniqueId(p,S);else{if(S=a.GetAttributeId(p,o[h[_]]),S===-1)continue;x=a.GetAttribute(p,S)}M.attributes.push(r(o,a,p,_,g,x))}return y===o.TRIANGULAR_MESH&&(M.index=i(o,a,p)),o.destroy(p),M}function i(o,a,l){const h=l.num_faces()*3,d=h*4,p=o._malloc(d);a.GetTrianglesUInt32Array(l,d,p);const m=new Uint32Array(o.HEAPF32.buffer,p,h).slice();return o._free(p),{array:m,itemSize:1}}function r(o,a,l,u,h,d){const p=d.num_components(),y=l.num_points()*p,M=y*h.BYTES_PER_ELEMENT,_=s(o,h),g=o._malloc(M);a.GetAttributeDataArrayForAllPoints(l,d,_,M,g);const x=new h(o.HEAPF32.buffer,g,y).slice();return o._free(g),{name:u,array:x,itemSize:p}}function s(o,a){switch(a){case Float32Array:return o.DT_FLOAT32;case Int8Array:return o.DT_INT8;case Int16Array:return o.DT_INT16;case Int32Array:return o.DT_INT32;case Uint8Array:return o.DT_UINT8;case Uint16Array:return o.DT_UINT16;case Uint32Array:return o.DT_UINT32}}}let Jp;const Oy=()=>{if(Jp)return Jp;const n="B9h9z9tFBBBF8fL9gBB9gLaaaaaFa9gEaaaB9gFaFa9gEaaaFaEMcBFFFGGGEIIILF9wFFFLEFBFKNFaFCx/IFMO/LFVK9tv9t9vq95GBt9f9f939h9z9t9f9j9h9s9s9f9jW9vq9zBBp9tv9z9o9v9wW9f9kv9j9v9kv9WvqWv94h919m9mvqBF8Z9tv9z9o9v9wW9f9kv9j9v9kv9J9u9kv94h919m9mvqBGy9tv9z9o9v9wW9f9kv9j9v9kv9J9u9kv949TvZ91v9u9jvBEn9tv9z9o9v9wW9f9kv9j9v9kv69p9sWvq9P9jWBIi9tv9z9o9v9wW9f9kv9j9v9kv69p9sWvq9R919hWBLn9tv9z9o9v9wW9f9kv9j9v9kv69p9sWvq9F949wBKI9z9iqlBOc+x8ycGBM/qQFTa8jUUUUBCU/EBlHL8kUUUUBC9+RKGXAGCFJAI9LQBCaRKAE2BBC+gF9HQBALAEAIJHOAGlAGTkUUUBRNCUoBAG9uC/wgBZHKCUGAKCUG9JyRVAECFJRICBRcGXEXAcAF9PQFAVAFAclAcAVJAF9JyRMGXGXAG9FQBAMCbJHKC9wZRSAKCIrCEJCGrRQANCUGJRfCBRbAIRTEXGXAOATlAQ9PQBCBRISEMATAQJRIGXAS9FQBCBRtCBREEXGXAOAIlCi9PQBCBRISLMANCU/CBJAEJRKGXGXGXGXGXATAECKrJ2BBAtCKZrCEZfIBFGEBMAKhB83EBAKCNJhB83EBSEMAKAI2BIAI2BBHmCKrHYAYCE6HYy86BBAKCFJAICIJAYJHY2BBAmCIrCEZHPAPCE6HPy86BBAKCGJAYAPJHY2BBAmCGrCEZHPAPCE6HPy86BBAKCEJAYAPJHY2BBAmCEZHmAmCE6Hmy86BBAKCIJAYAmJHY2BBAI2BFHmCKrHPAPCE6HPy86BBAKCLJAYAPJHY2BBAmCIrCEZHPAPCE6HPy86BBAKCKJAYAPJHY2BBAmCGrCEZHPAPCE6HPy86BBAKCOJAYAPJHY2BBAmCEZHmAmCE6Hmy86BBAKCNJAYAmJHY2BBAI2BGHmCKrHPAPCE6HPy86BBAKCVJAYAPJHY2BBAmCIrCEZHPAPCE6HPy86BBAKCcJAYAPJHY2BBAmCGrCEZHPAPCE6HPy86BBAKCMJAYAPJHY2BBAmCEZHmAmCE6Hmy86BBAKCSJAYAmJHm2BBAI2BEHICKrHYAYCE6HYy86BBAKCQJAmAYJHm2BBAICIrCEZHYAYCE6HYy86BBAKCfJAmAYJHm2BBAICGrCEZHYAYCE6HYy86BBAKCbJAmAYJHK2BBAICEZHIAICE6HIy86BBAKAIJRISGMAKAI2BNAI2BBHmCIrHYAYCb6HYy86BBAKCFJAICNJAYJHY2BBAmCbZHmAmCb6Hmy86BBAKCGJAYAmJHm2BBAI2BFHYCIrHPAPCb6HPy86BBAKCEJAmAPJHm2BBAYCbZHYAYCb6HYy86BBAKCIJAmAYJHm2BBAI2BGHYCIrHPAPCb6HPy86BBAKCLJAmAPJHm2BBAYCbZHYAYCb6HYy86BBAKCKJAmAYJHm2BBAI2BEHYCIrHPAPCb6HPy86BBAKCOJAmAPJHm2BBAYCbZHYAYCb6HYy86BBAKCNJAmAYJHm2BBAI2BIHYCIrHPAPCb6HPy86BBAKCVJAmAPJHm2BBAYCbZHYAYCb6HYy86BBAKCcJAmAYJHm2BBAI2BLHYCIrHPAPCb6HPy86BBAKCMJAmAPJHm2BBAYCbZHYAYCb6HYy86BBAKCSJAmAYJHm2BBAI2BKHYCIrHPAPCb6HPy86BBAKCQJAmAPJHm2BBAYCbZHYAYCb6HYy86BBAKCfJAmAYJHm2BBAI2BOHICIrHYAYCb6HYy86BBAKCbJAmAYJHK2BBAICbZHIAICb6HIy86BBAKAIJRISFMAKAI8pBB83BBAKCNJAICNJ8pBB83BBAICTJRIMAtCGJRtAECTJHEAS9JQBMMGXAIQBCBRISEMGXAM9FQBANAbJ2BBRtCBRKAfREEXAEANCU/CBJAKJ2BBHTCFrCBATCFZl9zAtJHt86BBAEAGJREAKCFJHKAM9HQBMMAfCFJRfAIRTAbCFJHbAG9HQBMMABAcAG9sJANCUGJAMAG9sTkUUUBpANANCUGJAMCaJAG9sJAGTkUUUBpMAMCBAIyAcJRcAIQBMC9+RKSFMCBC99AOAIlAGCAAGCA9Ly6yRKMALCU/EBJ8kUUUUBAKM+OmFTa8jUUUUBCoFlHL8kUUUUBC9+RKGXAFCE9uHOCtJAI9LQBCaRKAE2BBHNC/wFZC/gF9HQBANCbZHVCF9LQBALCoBJCgFCUFT+JUUUBpALC84Jha83EBALC8wJha83EBALC8oJha83EBALCAJha83EBALCiJha83EBALCTJha83EBALha83ENALha83EBAEAIJC9wJRcAECFJHNAOJRMGXAF9FQBCQCbAVCF6yRSABRECBRVCBRQCBRfCBRICBRKEXGXAMAcuQBC9+RKSEMGXGXAN2BBHOC/vF9LQBALCoBJAOCIrCa9zAKJCbZCEWJHb8oGIRTAb8oGBRtGXAOCbZHbAS9PQBALAOCa9zAIJCbZCGWJ8oGBAVAbyROAb9FRbGXGXAGCG9HQBABAt87FBABCIJAO87FBABCGJAT87FBSFMAEAtjGBAECNJAOjGBAECIJATjGBMAVAbJRVALCoBJAKCEWJHmAOjGBAmATjGIALAICGWJAOjGBALCoBJAKCFJCbZHKCEWJHTAtjGBATAOjGIAIAbJRIAKCFJRKSGMGXGXAbCb6QBAQAbJAbC989zJCFJRQSFMAM1BBHbCgFZROGXGXAbCa9MQBAMCFJRMSFMAM1BFHbCgBZCOWAOCgBZqROGXAbCa9MQBAMCGJRMSFMAM1BGHbCgBZCfWAOqROGXAbCa9MQBAMCEJRMSFMAM1BEHbCgBZCdWAOqROGXAbCa9MQBAMCIJRMSFMAM2BIC8cWAOqROAMCLJRMMAOCFrCBAOCFZl9zAQJRQMGXGXAGCG9HQBABAt87FBABCIJAQ87FBABCGJAT87FBSFMAEAtjGBAECNJAQjGBAECIJATjGBMALCoBJAKCEWJHOAQjGBAOATjGIALAICGWJAQjGBALCoBJAKCFJCbZHKCEWJHOAtjGBAOAQjGIAICFJRIAKCFJRKSFMGXAOCDF9LQBALAIAcAOCbZJ2BBHbCIrHTlCbZCGWJ8oGBAVCFJHtATyROALAIAblCbZCGWJ8oGBAtAT9FHmJHtAbCbZHTyRbAT9FRTGXGXAGCG9HQBABAV87FBABCIJAb87FBABCGJAO87FBSFMAEAVjGBAECNJAbjGBAECIJAOjGBMALAICGWJAVjGBALCoBJAKCEWJHYAOjGBAYAVjGIALAICFJHICbZCGWJAOjGBALCoBJAKCFJCbZCEWJHYAbjGBAYAOjGIALAIAmJCbZHICGWJAbjGBALCoBJAKCGJCbZHKCEWJHOAVjGBAOAbjGIAKCFJRKAIATJRIAtATJRVSFMAVCBAM2BBHYyHTAOC/+F6HPJROAYCbZRtGXGXAYCIrHmQBAOCFJRbSFMAORbALAIAmlCbZCGWJ8oGBROMGXGXAtQBAbCFJRVSFMAbRVALAIAYlCbZCGWJ8oGBRbMGXGXAP9FQBAMCFJRYSFMAM1BFHYCgFZRTGXGXAYCa9MQBAMCGJRYSFMAM1BGHYCgBZCOWATCgBZqRTGXAYCa9MQBAMCEJRYSFMAM1BEHYCgBZCfWATqRTGXAYCa9MQBAMCIJRYSFMAM1BIHYCgBZCdWATqRTGXAYCa9MQBAMCLJRYSFMAMCKJRYAM2BLC8cWATqRTMATCFrCBATCFZl9zAQJHQRTMGXGXAmCb6QBAYRPSFMAY1BBHMCgFZROGXGXAMCa9MQBAYCFJRPSFMAY1BFHMCgBZCOWAOCgBZqROGXAMCa9MQBAYCGJRPSFMAY1BGHMCgBZCfWAOqROGXAMCa9MQBAYCEJRPSFMAY1BEHMCgBZCdWAOqROGXAMCa9MQBAYCIJRPSFMAYCLJRPAY2BIC8cWAOqROMAOCFrCBAOCFZl9zAQJHQROMGXGXAtCb6QBAPRMSFMAP1BBHMCgFZRbGXGXAMCa9MQBAPCFJRMSFMAP1BFHMCgBZCOWAbCgBZqRbGXAMCa9MQBAPCGJRMSFMAP1BGHMCgBZCfWAbqRbGXAMCa9MQBAPCEJRMSFMAP1BEHMCgBZCdWAbqRbGXAMCa9MQBAPCIJRMSFMAPCLJRMAP2BIC8cWAbqRbMAbCFrCBAbCFZl9zAQJHQRbMGXGXAGCG9HQBABAT87FBABCIJAb87FBABCGJAO87FBSFMAEATjGBAECNJAbjGBAECIJAOjGBMALCoBJAKCEWJHYAOjGBAYATjGIALAICGWJATjGBALCoBJAKCFJCbZCEWJHYAbjGBAYAOjGIALAICFJHICbZCGWJAOjGBALCoBJAKCGJCbZCEWJHOATjGBAOAbjGIALAIAm9FAmCb6qJHICbZCGWJAbjGBAIAt9FAtCb6qJRIAKCEJRKMANCFJRNABCKJRBAECSJREAKCbZRKAICbZRIAfCEJHfAF9JQBMMCBC99AMAc6yRKMALCoFJ8kUUUUBAKM/tIFGa8jUUUUBCTlRLC9+RKGXAFCLJAI9LQBCaRKAE2BBC/+FZC/QF9HQBALhB83ENAECFJRKAEAIJC98JREGXAF9FQBGXAGCG6QBEXGXAKAE9JQBC9+bMAK1BBHGCgFZRIGXGXAGCa9MQBAKCFJRKSFMAK1BFHGCgBZCOWAICgBZqRIGXAGCa9MQBAKCGJRKSFMAK1BGHGCgBZCfWAIqRIGXAGCa9MQBAKCEJRKSFMAK1BEHGCgBZCdWAIqRIGXAGCa9MQBAKCIJRKSFMAK2BIC8cWAIqRIAKCLJRKMALCNJAICFZCGWqHGAICGrCBAICFrCFZl9zAG8oGBJHIjGBABAIjGBABCIJRBAFCaJHFQBSGMMEXGXAKAE9JQBC9+bMAK1BBHGCgFZRIGXGXAGCa9MQBAKCFJRKSFMAK1BFHGCgBZCOWAICgBZqRIGXAGCa9MQBAKCGJRKSFMAK1BGHGCgBZCfWAIqRIGXAGCa9MQBAKCEJRKSFMAK1BEHGCgBZCdWAIqRIGXAGCa9MQBAKCIJRKSFMAK2BIC8cWAIqRIAKCLJRKMABAICGrCBAICFrCFZl9zALCNJAICFZCGWqHI8oGBJHG87FBAIAGjGBABCGJRBAFCaJHFQBMMCBC99AKAE6yRKMAKM+lLKFaF99GaG99FaG99GXGXAGCI9HQBAF9FQFEXGXGX9DBBB8/9DBBB+/ABCGJHG1BB+yAB1BBHE+yHI+L+TABCFJHL1BBHK+yHO+L+THN9DBBBB9gHVyAN9DBB/+hANAN+U9DBBBBANAVyHcAc+MHMAECa3yAI+SHIAI+UAcAMAKCa3yAO+SHcAc+U+S+S+R+VHO+U+SHN+L9DBBB9P9d9FQBAN+oRESFMCUUUU94REMAGAE86BBGXGX9DBBB8/9DBBB+/Ac9DBBBB9gyAcAO+U+SHN+L9DBBB9P9d9FQBAN+oRGSFMCUUUU94RGMALAG86BBGXGX9DBBB8/9DBBB+/AI9DBBBB9gyAIAO+U+SHN+L9DBBB9P9d9FQBAN+oRGSFMCUUUU94RGMABAG86BBABCIJRBAFCaJHFQBSGMMAF9FQBEXGXGX9DBBB8/9DBBB+/ABCIJHG8uFB+yAB8uFBHE+yHI+L+TABCGJHL8uFBHK+yHO+L+THN9DBBBB9gHVyAN9DB/+g6ANAN+U9DBBBBANAVyHcAc+MHMAECa3yAI+SHIAI+UAcAMAKCa3yAO+SHcAc+U+S+S+R+VHO+U+SHN+L9DBBB9P9d9FQBAN+oRESFMCUUUU94REMAGAE87FBGXGX9DBBB8/9DBBB+/Ac9DBBBB9gyAcAO+U+SHN+L9DBBB9P9d9FQBAN+oRGSFMCUUUU94RGMALAG87FBGXGX9DBBB8/9DBBB+/AI9DBBBB9gyAIAO+U+SHN+L9DBBB9P9d9FQBAN+oRGSFMCUUUU94RGMABAG87FBABCNJRBAFCaJHFQBMMM/SEIEaE99EaF99GXAF9FQBCBREABRIEXGXGX9D/zI818/AICKJ8uFBHLCEq+y+VHKAI8uFB+y+UHO9DB/+g6+U9DBBB8/9DBBB+/AO9DBBBB9gy+SHN+L9DBBB9P9d9FQBAN+oRVSFMCUUUU94RVMAICIJ8uFBRcAICGJ8uFBRMABALCFJCEZAEqCFWJAV87FBGXGXAKAM+y+UHN9DB/+g6+U9DBBB8/9DBBB+/AN9DBBBB9gy+SHS+L9DBBB9P9d9FQBAS+oRMSFMCUUUU94RMMABALCGJCEZAEqCFWJAM87FBGXGXAKAc+y+UHK9DB/+g6+U9DBBB8/9DBBB+/AK9DBBBB9gy+SHS+L9DBBB9P9d9FQBAS+oRcSFMCUUUU94RcMABALCaJCEZAEqCFWJAc87FBGXGX9DBBU8/AOAO+U+TANAN+U+TAKAK+U+THO9DBBBBAO9DBBBB9gy+R9DB/+g6+U9DBBB8/+SHO+L9DBBB9P9d9FQBAO+oRcSFMCUUUU94RcMABALCEZAEqCFWJAc87FBAICNJRIAECIJREAFCaJHFQBMMM9JBGXAGCGrAF9sHF9FQBEXABAB8oGBHGCNWCN91+yAGCi91CnWCUUU/8EJ+++U84GBABCIJRBAFCaJHFQBMMM9TFEaCBCB8oGUkUUBHFABCEJC98ZJHBjGUkUUBGXGXAB8/BCTWHGuQBCaREABAGlCggEJCTrXBCa6QFMAFREMAEM/lFFFaGXGXAFABqCEZ9FQBABRESFMGXGXAGCT9PQBABRESFMABREEXAEAF8oGBjGBAECIJAFCIJ8oGBjGBAECNJAFCNJ8oGBjGBAECSJAFCSJ8oGBjGBAECTJREAFCTJRFAGC9wJHGCb9LQBMMAGCI9JQBEXAEAF8oGBjGBAFCIJRFAECIJREAGC98JHGCE9LQBMMGXAG9FQBEXAEAF2BB86BBAECFJREAFCFJRFAGCaJHGQBMMABMoFFGaGXGXABCEZ9FQBABRESFMAFCgFZC+BwsN9sRIGXGXAGCT9PQBABRESFMABREEXAEAIjGBAECSJAIjGBAECNJAIjGBAECIJAIjGBAECTJREAGC9wJHGCb9LQBMMAGCI9JQBEXAEAIjGBAECIJREAGC98JHGCE9LQBMMGXAG9FQBEXAEAF86BBAECFJREAGCaJHGQBMMABMMMFBCUNMIT9kBB",e="B9h9z9tFBBBFiI9gBB9gLaaaaaFa9gEaaaB9gFaFaEMcBBFBFFGGGEILF9wFFFLEFBFKNFaFCx/aFMO/LFVK9tv9t9vq95GBt9f9f939h9z9t9f9j9h9s9s9f9jW9vq9zBBp9tv9z9o9v9wW9f9kv9j9v9kv9WvqWv94h919m9mvqBG8Z9tv9z9o9v9wW9f9kv9j9v9kv9J9u9kv94h919m9mvqBIy9tv9z9o9v9wW9f9kv9j9v9kv9J9u9kv949TvZ91v9u9jvBLn9tv9z9o9v9wW9f9kv9j9v9kv69p9sWvq9P9jWBKi9tv9z9o9v9wW9f9kv9j9v9kv69p9sWvq9R919hWBOn9tv9z9o9v9wW9f9kv9j9v9kv69p9sWvq9F949wBNI9z9iqlBVc+N9IcIBTEM9+FLa8jUUUUBCTlRBCBRFEXCBRGCBREEXABCNJAGJAECUaAFAGrCFZHIy86BBAEAIJREAGCFJHGCN9HQBMAFCx+YUUBJAE86BBAFCEWCxkUUBJAB8pEN83EBAFCFJHFCUG9HQBMMk8lLbaE97F9+FaL978jUUUUBCU/KBlHL8kUUUUBC9+RKGXAGCFJAI9LQBCaRKAE2BBC+gF9HQBALAEAIJHOAGlAG/8cBBCUoBAG9uC/wgBZHKCUGAKCUG9JyRNAECFJRKCBRVGXEXAVAF9PQFANAFAVlAVANJAF9JyRcGXGXAG9FQBAcCbJHIC9wZHMCE9sRSAMCFWRQAICIrCEJCGrRfCBRbEXAKRTCBRtGXEXGXAOATlAf9PQBCBRKSLMALCU/CBJAtAM9sJRmATAfJRKCBREGXAMCoB9JQBAOAKlC/gB9JQBCBRIEXAmAIJREGXGXGXGXGXATAICKrJ2BBHYCEZfIBFGEBMAECBDtDMIBSEMAEAKDBBIAKDBBBHPCID+MFAPDQBTFtGmEYIPLdKeOnHPCGD+MFAPDQBTFtGmEYIPLdKeOnC0+G+MiDtD9OHdCEDbD8jHPAPDQBFGENVcMILKOSQfbHeD8dBh+BsxoxoUwN0AeD8dFhxoUwkwk+gUa0sHnhTkAnsHnhNkAnsHn7CgFZHiCEWCxkUUBJDBEBAiCx+YUUBJDBBBHeAeDQBBBBBBBBBBBBBBBBAnhAk7CgFZHiCEWCxkUUBJDBEBD9uDQBFGEILKOTtmYPdenDfAdAPD9SDMIBAKCIJAeDeBJAiCx+YUUBJ2BBJRKSGMAEAKDBBNAKDBBBHPCID+MFAPDQBTFtGmEYIPLdKeOnC+P+e+8/4BDtD9OHdCbDbD8jHPAPDQBFGENVcMILKOSQfbHeD8dBh+BsxoxoUwN0AeD8dFhxoUwkwk+gUa0sHnhTkAnsHnhNkAnsHn7CgFZHiCEWCxkUUBJDBEBAiCx+YUUBJDBBBHeAeDQBBBBBBBBBBBBBBBBAnhAk7CgFZHiCEWCxkUUBJDBEBD9uDQBFGEILKOTtmYPdenDfAdAPD9SDMIBAKCNJAeDeBJAiCx+YUUBJ2BBJRKSFMAEAKDBBBDMIBAKCTJRKMGXGXGXGXGXAYCGrCEZfIBFGEBMAECBDtDMITSEMAEAKDBBIAKDBBBHPCID+MFAPDQBTFtGmEYIPLdKeOnHPCGD+MFAPDQBTFtGmEYIPLdKeOnC0+G+MiDtD9OHdCEDbD8jHPAPDQBFGENVcMILKOSQfbHeD8dBh+BsxoxoUwN0AeD8dFhxoUwkwk+gUa0sHnhTkAnsHnhNkAnsHn7CgFZHiCEWCxkUUBJDBEBAiCx+YUUBJDBBBHeAeDQBBBBBBBBBBBBBBBBAnhAk7CgFZHiCEWCxkUUBJDBEBD9uDQBFGEILKOTtmYPdenDfAdAPD9SDMITAKCIJAeDeBJAiCx+YUUBJ2BBJRKSGMAEAKDBBNAKDBBBHPCID+MFAPDQBTFtGmEYIPLdKeOnC+P+e+8/4BDtD9OHdCbDbD8jHPAPDQBFGENVcMILKOSQfbHeD8dBh+BsxoxoUwN0AeD8dFhxoUwkwk+gUa0sHnhTkAnsHnhNkAnsHn7CgFZHiCEWCxkUUBJDBEBAiCx+YUUBJDBBBHeAeDQBBBBBBBBBBBBBBBBAnhAk7CgFZHiCEWCxkUUBJDBEBD9uDQBFGEILKOTtmYPdenDfAdAPD9SDMITAKCNJAeDeBJAiCx+YUUBJ2BBJRKSFMAEAKDBBBDMITAKCTJRKMGXGXGXGXGXAYCIrCEZfIBFGEBMAECBDtDMIASEMAEAKDBBIAKDBBBHPCID+MFAPDQBTFtGmEYIPLdKeOnHPCGD+MFAPDQBTFtGmEYIPLdKeOnC0+G+MiDtD9OHdCEDbD8jHPAPDQBFGENVcMILKOSQfbHeD8dBh+BsxoxoUwN0AeD8dFhxoUwkwk+gUa0sHnhTkAnsHnhNkAnsHn7CgFZHiCEWCxkUUBJDBEBAiCx+YUUBJDBBBHeAeDQBBBBBBBBBBBBBBBBAnhAk7CgFZHiCEWCxkUUBJDBEBD9uDQBFGEILKOTtmYPdenDfAdAPD9SDMIAAKCIJAeDeBJAiCx+YUUBJ2BBJRKSGMAEAKDBBNAKDBBBHPCID+MFAPDQBTFtGmEYIPLdKeOnC+P+e+8/4BDtD9OHdCbDbD8jHPAPDQBFGENVcMILKOSQfbHeD8dBh+BsxoxoUwN0AeD8dFhxoUwkwk+gUa0sHnhTkAnsHnhNkAnsHn7CgFZHiCEWCxkUUBJDBEBAiCx+YUUBJDBBBHeAeDQBBBBBBBBBBBBBBBBAnhAk7CgFZHiCEWCxkUUBJDBEBD9uDQBFGEILKOTtmYPdenDfAdAPD9SDMIAAKCNJAeDeBJAiCx+YUUBJ2BBJRKSFMAEAKDBBBDMIAAKCTJRKMGXGXGXGXGXAYCKrfIBFGEBMAECBDtDMI8wSEMAEAKDBBIAKDBBBHPCID+MFAPDQBTFtGmEYIPLdKeOnHPCGD+MFAPDQBTFtGmEYIPLdKeOnC0+G+MiDtD9OHdCEDbD8jHPAPDQBFGENVcMILKOSQfbHeD8dBh+BsxoxoUwN0AeD8dFhxoUwkwk+gUa0sHnhTkAnsHnhNkAnsHn7CgFZHYCEWCxkUUBJDBEBAYCx+YUUBJDBBBHeAeDQBBBBBBBBBBBBBBBBAnhAk7CgFZHYCEWCxkUUBJDBEBD9uDQBFGEILKOTtmYPdenDfAdAPD9SDMI8wAKCIJAeDeBJAYCx+YUUBJ2BBJRKSGMAEAKDBBNAKDBBBHPCID+MFAPDQBTFtGmEYIPLdKeOnC+P+e+8/4BDtD9OHdCbDbD8jHPAPDQBFGENVcMILKOSQfbHeD8dBh+BsxoxoUwN0AeD8dFhxoUwkwk+gUa0sHnhTkAnsHnhNkAnsHn7CgFZHYCEWCxkUUBJDBEBAYCx+YUUBJDBBBHeAeDQBBBBBBBBBBBBBBBBAnhAk7CgFZHYCEWCxkUUBJDBEBD9uDQBFGEILKOTtmYPdenDfAdAPD9SDMI8wAKCNJAeDeBJAYCx+YUUBJ2BBJRKSFMAEAKDBBBDMI8wAKCTJRKMAICoBJREAICUFJAM9LQFAERIAOAKlC/fB9LQBMMGXAEAM9PQBAECErRIEXGXAOAKlCi9PQBCBRKSOMAmAEJRYGXGXGXGXGXATAECKrJ2BBAICKZrCEZfIBFGEBMAYCBDtDMIBSEMAYAKDBBIAKDBBBHPCID+MFAPDQBTFtGmEYIPLdKeOnHPCGD+MFAPDQBTFtGmEYIPLdKeOnC0+G+MiDtD9OHdCEDbD8jHPAPDQBFGENVcMILKOSQfbHeD8dBh+BsxoxoUwN0AeD8dFhxoUwkwk+gUa0sHnhTkAnsHnhNkAnsHn7CgFZHiCEWCxkUUBJDBEBAiCx+YUUBJDBBBHeAeDQBBBBBBBBBBBBBBBBAnhAk7CgFZHiCEWCxkUUBJDBEBD9uDQBFGEILKOTtmYPdenDfAdAPD9SDMIBAKCIJAeDeBJAiCx+YUUBJ2BBJRKSGMAYAKDBBNAKDBBBHPCID+MFAPDQBTFtGmEYIPLdKeOnC+P+e+8/4BDtD9OHdCbDbD8jHPAPDQBFGENVcMILKOSQfbHeD8dBh+BsxoxoUwN0AeD8dFhxoUwkwk+gUa0sHnhTkAnsHnhNkAnsHn7CgFZHiCEWCxkUUBJDBEBAiCx+YUUBJDBBBHeAeDQBBBBBBBBBBBBBBBBAnhAk7CgFZHiCEWCxkUUBJDBEBD9uDQBFGEILKOTtmYPdenDfAdAPD9SDMIBAKCNJAeDeBJAiCx+YUUBJ2BBJRKSFMAYAKDBBBDMIBAKCTJRKMAICGJRIAECTJHEAM9JQBMMGXAK9FQBAKRTAtCFJHtCI6QGSFMMCBRKSEMGXAM9FQBALCUGJAbJREALAbJDBGBReCBRYEXAEALCU/CBJAYJHIDBIBHdCFD9tAdCFDbHPD9OD9hD9RHdAIAMJDBIBH8ZCFD9tA8ZAPD9OD9hD9RH8ZDQBTFtGmEYIPLdKeOnHpAIAQJDBIBHyCFD9tAyAPD9OD9hD9RHyAIASJDBIBH8cCFD9tA8cAPD9OD9hD9RH8cDQBTFtGmEYIPLdKeOnH8dDQBFTtGEmYILPdKOenHPAPDQBFGEBFGEBFGEBFGEAeD9uHeDyBjGBAEAGJHIAeAPAPDQILKOILKOILKOILKOD9uHeDyBjGBAIAGJHIAeAPAPDQNVcMNVcMNVcMNVcMD9uHeDyBjGBAIAGJHIAeAPAPDQSQfbSQfbSQfbSQfbD9uHeDyBjGBAIAGJHIAeApA8dDQNVi8ZcMpySQ8c8dfb8e8fHPAPDQBFGEBFGEBFGEBFGED9uHeDyBjGBAIAGJHIAeAPAPDQILKOILKOILKOILKOD9uHeDyBjGBAIAGJHIAeAPAPDQNVcMNVcMNVcMNVcMD9uHeDyBjGBAIAGJHIAeAPAPDQSQfbSQfbSQfbSQfbD9uHeDyBjGBAIAGJHIAeAdA8ZDQNiV8ZcpMyS8cQ8df8eb8fHdAyA8cDQNiV8ZcpMyS8cQ8df8eb8fH8ZDQBFTtGEmYILPdKOenHPAPDQBFGEBFGEBFGEBFGED9uHeDyBjGBAIAGJHIAeAPAPDQILKOILKOILKOILKOD9uHeDyBjGBAIAGJHIAeAPAPDQNVcMNVcMNVcMNVcMD9uHeDyBjGBAIAGJHIAeAPAPDQSQfbSQfbSQfbSQfbD9uHeDyBjGBAIAGJHIAeAdA8ZDQNVi8ZcMpySQ8c8dfb8e8fHPAPDQBFGEBFGEBFGEBFGED9uHeDyBjGBAIAGJHIAeAPAPDQILKOILKOILKOILKOD9uHeDyBjGBAIAGJHIAeAPAPDQNVcMNVcMNVcMNVcMD9uHeDyBjGBAIAGJHIAeAPAPDQSQfbSQfbSQfbSQfbD9uHeDyBjGBAIAGJREAYCTJHYAM9JQBMMAbCIJHbAG9JQBMMABAVAG9sJALCUGJAcAG9s/8cBBALALCUGJAcCaJAG9sJAG/8cBBMAcCBAKyAVJRVAKQBMC9+RKSFMCBC99AOAKlAGCAAGCA9Ly6yRKMALCU/KBJ8kUUUUBAKMNBT+BUUUBM+KmFTa8jUUUUBCoFlHL8kUUUUBC9+RKGXAFCE9uHOCtJAI9LQBCaRKAE2BBHNC/wFZC/gF9HQBANCbZHVCF9LQBALCoBJCgFCUF/8MBALC84Jha83EBALC8wJha83EBALC8oJha83EBALCAJha83EBALCiJha83EBALCTJha83EBALha83ENALha83EBAEAIJC9wJRcAECFJHNAOJRMGXAF9FQBCQCbAVCF6yRSABRECBRVCBRQCBRfCBRICBRKEXGXAMAcuQBC9+RKSEMGXGXAN2BBHOC/vF9LQBALCoBJAOCIrCa9zAKJCbZCEWJHb8oGIRTAb8oGBRtGXAOCbZHbAS9PQBALAOCa9zAIJCbZCGWJ8oGBAVAbyROAb9FRbGXGXAGCG9HQBABAt87FBABCIJAO87FBABCGJAT87FBSFMAEAtjGBAECNJAOjGBAECIJATjGBMAVAbJRVALCoBJAKCEWJHmAOjGBAmATjGIALAICGWJAOjGBALCoBJAKCFJCbZHKCEWJHTAtjGBATAOjGIAIAbJRIAKCFJRKSGMGXGXAbCb6QBAQAbJAbC989zJCFJRQSFMAM1BBHbCgFZROGXGXAbCa9MQBAMCFJRMSFMAM1BFHbCgBZCOWAOCgBZqROGXAbCa9MQBAMCGJRMSFMAM1BGHbCgBZCfWAOqROGXAbCa9MQBAMCEJRMSFMAM1BEHbCgBZCdWAOqROGXAbCa9MQBAMCIJRMSFMAM2BIC8cWAOqROAMCLJRMMAOCFrCBAOCFZl9zAQJRQMGXGXAGCG9HQBABAt87FBABCIJAQ87FBABCGJAT87FBSFMAEAtjGBAECNJAQjGBAECIJATjGBMALCoBJAKCEWJHOAQjGBAOATjGIALAICGWJAQjGBALCoBJAKCFJCbZHKCEWJHOAtjGBAOAQjGIAICFJRIAKCFJRKSFMGXAOCDF9LQBALAIAcAOCbZJ2BBHbCIrHTlCbZCGWJ8oGBAVCFJHtATyROALAIAblCbZCGWJ8oGBAtAT9FHmJHtAbCbZHTyRbAT9FRTGXGXAGCG9HQBABAV87FBABCIJAb87FBABCGJAO87FBSFMAEAVjGBAECNJAbjGBAECIJAOjGBMALAICGWJAVjGBALCoBJAKCEWJHYAOjGBAYAVjGIALAICFJHICbZCGWJAOjGBALCoBJAKCFJCbZCEWJHYAbjGBAYAOjGIALAIAmJCbZHICGWJAbjGBALCoBJAKCGJCbZHKCEWJHOAVjGBAOAbjGIAKCFJRKAIATJRIAtATJRVSFMAVCBAM2BBHYyHTAOC/+F6HPJROAYCbZRtGXGXAYCIrHmQBAOCFJRbSFMAORbALAIAmlCbZCGWJ8oGBROMGXGXAtQBAbCFJRVSFMAbRVALAIAYlCbZCGWJ8oGBRbMGXGXAP9FQBAMCFJRYSFMAM1BFHYCgFZRTGXGXAYCa9MQBAMCGJRYSFMAM1BGHYCgBZCOWATCgBZqRTGXAYCa9MQBAMCEJRYSFMAM1BEHYCgBZCfWATqRTGXAYCa9MQBAMCIJRYSFMAM1BIHYCgBZCdWATqRTGXAYCa9MQBAMCLJRYSFMAMCKJRYAM2BLC8cWATqRTMATCFrCBATCFZl9zAQJHQRTMGXGXAmCb6QBAYRPSFMAY1BBHMCgFZROGXGXAMCa9MQBAYCFJRPSFMAY1BFHMCgBZCOWAOCgBZqROGXAMCa9MQBAYCGJRPSFMAY1BGHMCgBZCfWAOqROGXAMCa9MQBAYCEJRPSFMAY1BEHMCgBZCdWAOqROGXAMCa9MQBAYCIJRPSFMAYCLJRPAY2BIC8cWAOqROMAOCFrCBAOCFZl9zAQJHQROMGXGXAtCb6QBAPRMSFMAP1BBHMCgFZRbGXGXAMCa9MQBAPCFJRMSFMAP1BFHMCgBZCOWAbCgBZqRbGXAMCa9MQBAPCGJRMSFMAP1BGHMCgBZCfWAbqRbGXAMCa9MQBAPCEJRMSFMAP1BEHMCgBZCdWAbqRbGXAMCa9MQBAPCIJRMSFMAPCLJRMAP2BIC8cWAbqRbMAbCFrCBAbCFZl9zAQJHQRbMGXGXAGCG9HQBABAT87FBABCIJAb87FBABCGJAO87FBSFMAEATjGBAECNJAbjGBAECIJAOjGBMALCoBJAKCEWJHYAOjGBAYATjGIALAICGWJATjGBALCoBJAKCFJCbZCEWJHYAbjGBAYAOjGIALAICFJHICbZCGWJAOjGBALCoBJAKCGJCbZCEWJHOATjGBAOAbjGIALAIAm9FAmCb6qJHICbZCGWJAbjGBAIAt9FAtCb6qJRIAKCEJRKMANCFJRNABCKJRBAECSJREAKCbZRKAICbZRIAfCEJHfAF9JQBMMCBC99AMAc6yRKMALCoFJ8kUUUUBAKM/tIFGa8jUUUUBCTlRLC9+RKGXAFCLJAI9LQBCaRKAE2BBC/+FZC/QF9HQBALhB83ENAECFJRKAEAIJC98JREGXAF9FQBGXAGCG6QBEXGXAKAE9JQBC9+bMAK1BBHGCgFZRIGXGXAGCa9MQBAKCFJRKSFMAK1BFHGCgBZCOWAICgBZqRIGXAGCa9MQBAKCGJRKSFMAK1BGHGCgBZCfWAIqRIGXAGCa9MQBAKCEJRKSFMAK1BEHGCgBZCdWAIqRIGXAGCa9MQBAKCIJRKSFMAK2BIC8cWAIqRIAKCLJRKMALCNJAICFZCGWqHGAICGrCBAICFrCFZl9zAG8oGBJHIjGBABAIjGBABCIJRBAFCaJHFQBSGMMEXGXAKAE9JQBC9+bMAK1BBHGCgFZRIGXGXAGCa9MQBAKCFJRKSFMAK1BFHGCgBZCOWAICgBZqRIGXAGCa9MQBAKCGJRKSFMAK1BGHGCgBZCfWAIqRIGXAGCa9MQBAKCEJRKSFMAK1BEHGCgBZCdWAIqRIGXAGCa9MQBAKCIJRKSFMAK2BIC8cWAIqRIAKCLJRKMABAICGrCBAICFrCFZl9zALCNJAICFZCGWqHI8oGBJHG87FBAIAGjGBABCGJRBAFCaJHFQBMMCBC99AKAE6yRKMAKM/dLEK97FaF97GXGXAGCI9HQBAF9FQFCBRGEXABABDBBBHECiD+rFCiD+sFD/6FHIAECND+rFCiD+sFD/6FAID/gFAECTD+rFCiD+sFD/6FHLD/gFD/kFD/lFHKCBDtD+2FHOAICUUUU94DtHND9OD9RD/kFHI9DBB/+hDYAIAID/mFAKAKD/mFALAOALAND9OD9RD/kFHIAID/mFD/kFD/kFD/jFD/nFHLD/mF9DBBX9LDYHOD/kFCgFDtD9OAECUUU94DtD9OD9QAIALD/mFAOD/kFCND+rFCU/+EDtD9OD9QAKALD/mFAOD/kFCTD+rFCUU/8ODtD9OD9QDMBBABCTJRBAGCIJHGAF9JQBSGMMAF9FQBCBRGEXABCTJHVAVDBBBHECBDtHOCUU98D8cFCUU98D8cEHND9OABDBBBHKAEDQILKOSQfbPden8c8d8e8fCggFDtD9OD/6FAKAEDQBFGENVcMTtmYi8ZpyHECTD+sFD/6FHID/gFAECTD+rFCTD+sFD/6FHLD/gFD/kFD/lFHE9DB/+g6DYALAEAOD+2FHOALCUUUU94DtHcD9OD9RD/kFHLALD/mFAEAED/mFAIAOAIAcD9OD9RD/kFHEAED/mFD/kFD/kFD/jFD/nFHID/mF9DBBX9LDYHOD/kFCTD+rFALAID/mFAOD/kFCggEDtD9OD9QHLAEAID/mFAOD/kFCaDbCBDnGCBDnECBDnKCBDnOCBDncCBDnMCBDnfCBDnbD9OHEDQNVi8ZcMpySQ8c8dfb8e8fD9QDMBBABAKAND9OALAEDQBFTtGEmYILPdKOenD9QDMBBABCAJRBAGCIJHGAF9JQBMMM/hEIGaF97FaL978jUUUUBCTlREGXAF9FQBCBRIEXAEABDBBBHLABCTJHKDBBBHODQILKOSQfbPden8c8d8e8fHNCTD+sFHVCID+rFDMIBAB9DBBU8/DY9D/zI818/DYAVCEDtD9QD/6FD/nFHVALAODQBFGENVcMTtmYi8ZpyHLCTD+rFCTD+sFD/6FD/mFHOAOD/mFAVALCTD+sFD/6FD/mFHcAcD/mFAVANCTD+rFCTD+sFD/6FD/mFHNAND/mFD/kFD/kFD/lFCBDtD+4FD/jF9DB/+g6DYHVD/mF9DBBX9LDYHLD/kFCggEDtHMD9OAcAVD/mFALD/kFCTD+rFD9QHcANAVD/mFALD/kFCTD+rFAOAVD/mFALD/kFAMD9OD9QHVDQBFTtGEmYILPdKOenHLD8dBAEDBIBDyB+t+J83EBABCNJALD8dFAEDBIBDyF+t+J83EBAKAcAVDQNVi8ZcMpySQ8c8dfb8e8fHVD8dBAEDBIBDyG+t+J83EBABCiJAVD8dFAEDBIBDyE+t+J83EBABCAJRBAICIJHIAF9JQBMMM9jFF97GXAGCGrAF9sHG9FQBCBRFEXABABDBBBHECND+rFCND+sFD/6FAECiD+sFCnD+rFCUUU/8EDtD+uFD/mFDMBBABCTJRBAFCIJHFAG9JQBMMM9TFEaCBCB8oGUkUUBHFABCEJC98ZJHBjGUkUUBGXGXAB8/BCTWHGuQBCaREABAGlCggEJCTrXBCa6QFMAFREMAEMMMFBCUNMIT9tBB",t=new Uint8Array([0,97,115,109,1,0,0,0,1,4,1,96,0,0,3,3,2,0,0,5,3,1,0,1,12,1,0,10,22,2,12,0,65,0,65,0,65,0,252,10,0,0,11,7,0,65,0,253,15,26,11]),i=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=n;WebAssembly.validate(t)&&(r=e);let s;const o=WebAssembly.instantiate(a(r),{}).then(d=>{s=d.instance,s.exports.__wasm_call_ctors()});function a(d){const p=new Uint8Array(d.length);for(let y=0;y<d.length;++y){const M=d.charCodeAt(y);p[y]=M>96?M-71:M>64?M-65:M>47?M+4:M>46?63:62}let m=0;for(let y=0;y<d.length;++y)p[m++]=p[y]<60?i[p[y]]:(p[y]-60)*64+p[++y];return p.buffer.slice(0,m)}function l(d,p,m,y,M,_){const g=s.exports.sbrk,x=m+3&-4,S=g(x*y),E=g(M.length),C=new Uint8Array(s.exports.memory.buffer);C.set(M,E);const b=d(S,m,y,E,M.length);if(b===0&&_&&_(S,x,y),p.set(C.subarray(S,S+m*y)),g(S-g(0)),b!==0)throw new Error(`Malformed buffer data: ${b}`)}const u={0:"",1:"meshopt_decodeFilterOct",2:"meshopt_decodeFilterQuat",3:"meshopt_decodeFilterExp",NONE:"",OCTAHEDRAL:"meshopt_decodeFilterOct",QUATERNION:"meshopt_decodeFilterQuat",EXPONENTIAL:"meshopt_decodeFilterExp"},h={0:"meshopt_decodeVertexBuffer",1:"meshopt_decodeIndexBuffer",2:"meshopt_decodeIndexSequence",ATTRIBUTES:"meshopt_decodeVertexBuffer",TRIANGLES:"meshopt_decodeIndexBuffer",INDICES:"meshopt_decodeIndexSequence"};return Jp={ready:o,supported:!0,decodeVertexBuffer(d,p,m,y,M){l(s.exports.meshopt_decodeVertexBuffer,d,p,m,y,s.exports[u[M]])},decodeIndexBuffer(d,p,m,y){l(s.exports.meshopt_decodeIndexBuffer,d,p,m,y)},decodeIndexSequence(d,p,m,y){l(s.exports.meshopt_decodeIndexSequence,d,p,m,y)},decodeGltfBuffer(d,p,m,y,M,_){l(s.exports[h[M]],d,p,m,y,s.exports[u[_]])}},Jp};let Kp=null;function LL(n,e,t){return i=>{t&&t(i),n&&(Kp||(Kp=new b9),Kp.setDecoderPath(typeof n=="string"?n:"https://www.gstatic.com/draco/versioned/decoders/1.5.5/"),i.setDRACOLoader(Kp)),e&&i.setMeshoptDecoder(typeof Oy=="function"?Oy():Oy)}}function r1(n,e=!0,t=!0,i){return Oh(i1,n,LL(e,t,i))}r1.preload=(n,e=!0,t=!0,i)=>Oh.preload(i1,n,LL(e,t,i));r1.clear=n=>Oh.clear(i1,n);const P9=J.forwardRef(({makeDefault:n,camera:e,regress:t,domElement:i,enableDamping:r=!0,keyEvents:s=!1,onChange:o,onStart:a,onEnd:l,...u},h)=>{const d=pr(b=>b.invalidate),p=pr(b=>b.camera),m=pr(b=>b.gl),y=pr(b=>b.events),M=pr(b=>b.setEvents),_=pr(b=>b.set),g=pr(b=>b.get),x=pr(b=>b.performance),S=e||p,E=i||y.connected||m.domElement,C=J.useMemo(()=>new Y5(S),[S]);return Nh(()=>{C.enabled&&C.update()},-1),J.useEffect(()=>(s&&C.connect(s===!0?E:s),C.connect(E),()=>void C.dispose()),[s,E,t,C,d]),J.useEffect(()=>{const b=R=>{d(),t&&x.regress(),o&&o(R)},P=R=>{a&&a(R)},B=R=>{l&&l(R)};return C.addEventListener("change",b),C.addEventListener("start",P),C.addEventListener("end",B),()=>{C.removeEventListener("start",P),C.removeEventListener("end",B),C.removeEventListener("change",b)}},[o,a,l,C,d,M]),J.useEffect(()=>{if(n){const b=g().controls;return _({controls:C}),()=>_({controls:b})}},[n,C]),J.createElement("primitive",jr({ref:h,object:C,enableDamping:r},u))});class B9 extends Ph{constructor(e){super(e),this.onBeforeCompile=(t,i)=>{const{isWebGL2:r}=i.capabilities;t.fragmentShader=t.fragmentShader.replace("#include <output_fragment>",`
        ${r?"#include <output_fragment>":`#extension GL_OES_standard_derivatives : enable
#include <output_fragment>`}
      vec2 cxy = 2.0 * gl_PointCoord - 1.0;
      float r = dot(cxy, cxy);
      float delta = fwidth(r);     
      float mask = 1.0 - smoothstep(1.0 - delta, 1.0 + delta, r);
      gl_FragColor = vec4(gl_FragColor.rgb, mask * gl_FragColor.a );
      #include <tonemapping_fragment>
      #include <encodings_fragment>
      `)}}}const L9=J.forwardRef((n,e)=>{const[t]=J.useState(()=>new B9(null));return J.createElement("primitive",jr({},n,{object:t,ref:e,attach:"material"}))});let wa,nf;const I9=J.createContext(null),mC=new rt,gC=new F,D9=J.forwardRef(({children:n,range:e,limit:t=1e3,...i},r)=>{const s=J.useRef(null),[o,a]=J.useState([]),[[l,u,h]]=J.useState(()=>[new Float32Array(t*3),Float32Array.from({length:t*3},()=>1),Float32Array.from({length:t},()=>1)]);J.useEffect(()=>{s.current.geometry.attributes.position.needsUpdate=!0}),Nh(()=>{for(s.current.updateMatrix(),s.current.updateMatrixWorld(),mC.copy(s.current.matrixWorld).invert(),s.current.geometry.drawRange.count=Math.min(t,e!==void 0?e:t,o.length),wa=0;wa<o.length;wa++)nf=o[wa].current,nf.getWorldPosition(gC).applyMatrix4(mC),gC.toArray(l,wa*3),s.current.geometry.attributes.position.needsUpdate=!0,nf.matrixWorldNeedsUpdate=!0,nf.color.toArray(u,wa*3),s.current.geometry.attributes.color.needsUpdate=!0,h.set([nf.size],wa),s.current.geometry.attributes.size.needsUpdate=!0});const d=J.useMemo(()=>({getParent:()=>s,subscribe:p=>(a(m=>[...m,p]),()=>a(m=>m.filter(y=>y.current!==p.current)))}),[]);return J.createElement("points",jr({userData:{instances:o},matrixAutoUpdate:!1,ref:RL([r,s]),raycast:()=>null},i),J.createElement("bufferGeometry",null,J.createElement("bufferAttribute",{attach:"attributes-position",count:l.length/3,array:l,itemSize:3,usage:Ya}),J.createElement("bufferAttribute",{attach:"attributes-color",count:u.length/3,array:u,itemSize:3,usage:Ya}),J.createElement("bufferAttribute",{attach:"attributes-size",count:h.length,array:h,itemSize:1,usage:Ya})),J.createElement(I9.Provider,{value:d},n))}),F9=J.forwardRef(({children:n,positions:e,colors:t,sizes:i,stride:r=3,...s},o)=>{const a=J.useRef(null);return Nh(()=>{const l=a.current.geometry.attributes;l.position.needsUpdate=!0,t&&(l.color.needsUpdate=!0),i&&(l.size.needsUpdate=!0)}),J.createElement("points",jr({ref:RL([o,a])},s),J.createElement("bufferGeometry",null,J.createElement("bufferAttribute",{attach:"attributes-position",count:e.length/r,array:e,itemSize:r,usage:Ya}),t&&J.createElement("bufferAttribute",{attach:"attributes-color",count:t.length/r,array:t,itemSize:3,usage:Ya}),i&&J.createElement("bufferAttribute",{attach:"attributes-size",count:i.length/r,array:i,itemSize:1,usage:Ya})),n)}),N9=J.forwardRef((n,e)=>n.positions instanceof Float32Array?J.createElement(F9,jr({},n,{ref:e})):J.createElement(D9,jr({},n,{ref:e})));function IL({all:n,scene:e,camera:t}){const i=pr(({gl:o})=>o),r=pr(({camera:o})=>o),s=pr(({scene:o})=>o);return J.useLayoutEffect(()=>{const o=[];n&&(e||s).traverse(u=>{u.visible===!1&&(o.push(u),u.visible=!0)}),i.compile(e||s,t||r);const a=new MS(128);new SS(.01,1e5,a).update(i,e||s),a.dispose(),o.forEach(u=>u.visible=!1)},[]),null}const O9=()=>{const{progress:n}=X5();return se.jsxs(j5,{children:[se.jsx("span",{className:"canvas-load"}),se.jsxs("p",{style:{fontSize:14,color:"#f1f1f1",fontWeight:800,marginTop:40},children:[n.toFixed(2),"%"]})]})},U9=()=>{const n=r1("./planet/scene.gltf");return se.jsx("primitive",{object:n.scene,scale:2.5,"position-y":0,"rotation-y":0})},k9=()=>se.jsxs(CL,{shadows:!0,frameloop:"demand",camera:{fov:45,near:.1,far:200,position:[-3,3,6]},gl:{preserveDrawingBuffer:!0},children:[se.jsxs(J.Suspense,{fallback:se.jsx(O9,{}),children:[se.jsx(P9,{autoRotate:!0,enableZoom:!1,maxPolarAngle:Math.PI/2,minPolarAngle:Math.PI/2}),se.jsx(U9,{})]}),se.jsx(IL,{all:!0})]});function Fc(n,e,t){return e in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function vC(n,e){var t=Object.keys(n);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(n);e&&(i=i.filter(function(r){return Object.getOwnPropertyDescriptor(n,r).enumerable})),t.push.apply(t,i)}return t}function yC(n){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?vC(Object(t),!0).forEach(function(i){Fc(n,i,t[i])}):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(t)):vC(Object(t)).forEach(function(i){Object.defineProperty(n,i,Object.getOwnPropertyDescriptor(t,i))})}return n}function DL(n,e){if(!(n instanceof e))throw new TypeError("Cannot call a class as a function")}new ge;new ge;var lr=function n(e,t,i){var r=this;DL(this,n),Fc(this,"dot2",function(s,o){return r.x*s+r.y*o}),Fc(this,"dot3",function(s,o,a){return r.x*s+r.y*o+r.z*a}),this.x=e,this.y=t,this.z=i},H9=[new lr(1,1,0),new lr(-1,1,0),new lr(1,-1,0),new lr(-1,-1,0),new lr(1,0,1),new lr(-1,0,1),new lr(1,0,-1),new lr(-1,0,-1),new lr(0,1,1),new lr(0,-1,1),new lr(0,1,-1),new lr(0,-1,-1)],xC=[151,160,137,91,90,15,131,13,201,95,96,53,194,233,7,225,140,36,103,30,69,142,8,99,37,240,21,10,23,190,6,148,247,120,234,75,0,26,197,62,94,252,219,203,117,35,11,32,57,177,33,88,237,149,56,87,174,20,125,136,171,168,68,175,74,165,71,134,139,48,27,166,77,146,158,231,83,111,229,122,60,211,133,230,220,105,92,41,55,46,245,40,244,102,143,54,65,25,63,161,1,216,80,73,209,76,132,187,208,89,18,169,200,196,135,130,116,188,159,86,164,100,109,198,173,186,3,64,52,217,226,250,124,123,5,202,38,147,118,126,255,82,85,212,207,206,59,227,47,16,58,17,182,189,28,42,223,183,170,213,119,248,152,2,44,154,163,70,221,153,101,155,167,43,172,9,129,22,39,253,19,98,108,110,79,113,224,232,178,185,112,104,218,246,97,228,251,34,242,193,238,210,144,12,191,179,162,241,81,51,145,235,249,14,239,107,49,192,214,31,181,199,106,157,184,84,204,176,115,121,50,45,127,4,150,254,138,236,205,93,222,114,67,29,24,72,243,141,128,195,78,66,215,61,156,180],_C=new Array(512),AC=new Array(512),z9=function(e){e>0&&e<1&&(e*=65536),e=Math.floor(e),e<256&&(e|=e<<8);for(var t=0;t<256;t++){var i;t&1?i=xC[t]^e&255:i=xC[t]^e>>8&255,_C[t]=_C[t+256]=i,AC[t]=AC[t+256]=H9[i%12]}};z9(0);function G9(n){if(typeof n=="number")n=Math.abs(n);else if(typeof n=="string"){var e=n;n=0;for(var t=0;t<e.length;t++)n=(n+(t+1)*(e.charCodeAt(t)%96))%2147483647}return n===0&&(n=311),n}function SC(n){var e=G9(n);return function(){var t=e*48271%2147483647;return e=t,t/2147483647}}var V9=function n(e){var t=this;DL(this,n),Fc(this,"seed",0),Fc(this,"init",function(i){t.seed=i,t.value=SC(i)}),Fc(this,"value",SC(this.seed)),this.init(e)},W9=new V9(Math.random()),j9={radius:1,center:[0,0,0]};function X9(n,e){for(var t=arguments.length>2&&arguments[2]!==void 0?arguments[2]:W9,i=yC(yC({},j9),e),r=i.radius,s=i.center,o=0;o<n.length;o+=3){var a=Math.pow(t.value(),.3333333333333333),l=t.value()*2-1,u=t.value()*2-1,h=t.value()*2-1,d=Math.sqrt(l*l+u*u+h*h);l=a*l/d,u=a*u/d,h=a*h/d,n[o]=l*r+s[0],n[o+1]=u*r+s[1],n[o+2]=h*r+s[2]}return n}const J9=n=>{const e=J.useRef(),t=X9(new Float32Array(5e3),{radius:1.2});return Nh((i,r)=>{e.current.rotation.x-=r/10,e.current.rotation.y-=r/15}),se.jsx("group",{rotation:[0,0,Math.PI/4],children:se.jsx(N9,{ref:e,positions:t,stride:3,frustumCulled:!0,...n,children:se.jsx(L9,{transparent:!0,color:"#fff",size:.002,sizeAttenuation:!0,depthWrite:!1})})})},K9=()=>se.jsx("div",{className:"w-full h-auto absolute inset-0 z-[-1]",children:se.jsxs(CL,{camera:{position:[0,0,1]},children:[se.jsx(J.Suspense,{fallback:null,children:se.jsx(J9,{})}),se.jsx(IL,{all:!0})]})}),FL=J.createContext({transformPagePoint:n=>n,isStatic:!1,reducedMotion:"never"}),t0=J.createContext({}),s1=J.createContext(null),n0=typeof document<"u",MC=n0?J.useLayoutEffect:J.useEffect,NL=J.createContext({strict:!1});function Y9(n,e,t,i){const{visualElement:r}=J.useContext(t0),s=J.useContext(NL),o=J.useContext(s1),a=J.useContext(FL).reducedMotion,l=J.useRef();i=i||s.renderer,!l.current&&i&&(l.current=i(n,{visualState:e,parent:r,props:t,presenceContext:o,blockInitialAnimation:o?o.initial===!1:!1,reducedMotionConfig:a}));const u=l.current;return J.useInsertionEffect(()=>{u&&u.update(t,o)}),MC(()=>{u&&u.render()}),J.useEffect(()=>{u&&u.updateFeatures()}),(window.HandoffAppearAnimations?MC:J.useEffect)(()=>{u&&u.animationState&&u.animationState.animateChanges()}),u}function Ac(n){return typeof n=="object"&&Object.prototype.hasOwnProperty.call(n,"current")}function Q9(n,e,t){return J.useCallback(i=>{i&&n.mount&&n.mount(i),e&&(i?e.mount(i):e.unmount()),t&&(typeof t=="function"?t(i):Ac(t)&&(t.current=i))},[e])}function fh(n){return typeof n=="string"||Array.isArray(n)}function i0(n){return typeof n=="object"&&typeof n.start=="function"}const o1=["animate","whileInView","whileFocus","whileHover","whileTap","whileDrag","exit"],a1=["initial",...o1];function r0(n){return i0(n.animate)||a1.some(e=>fh(n[e]))}function OL(n){return!!(r0(n)||n.variants)}function Z9(n,e){if(r0(n)){const{initial:t,animate:i}=n;return{initial:t===!1||fh(t)?t:void 0,animate:fh(i)?i:void 0}}return n.inherit!==!1?e:{}}function q9(n){const{initial:e,animate:t}=Z9(n,J.useContext(t0));return J.useMemo(()=>({initial:e,animate:t}),[EC(e),EC(t)])}function EC(n){return Array.isArray(n)?n.join(" "):n}const wC={animation:["animate","variants","whileHover","whileTap","exit","whileInView","whileFocus","whileDrag"],exit:["exit"],drag:["drag","dragControls"],focus:["whileFocus"],hover:["whileHover","onHoverStart","onHoverEnd"],tap:["whileTap","onTap","onTapStart","onTapCancel"],pan:["onPan","onPanStart","onPanSessionStart","onPanEnd"],inView:["whileInView","onViewportEnter","onViewportLeave"],layout:["layout","layoutId"]},hh={};for(const n in wC)hh[n]={isEnabled:e=>wC[n].some(t=>!!e[t])};function $9(n){for(const e in n)hh[e]={...hh[e],...n[e]}}const UL=J.createContext({}),kL=J.createContext({}),e8=Symbol.for("motionComponentSymbol");function t8({preloadedFeatures:n,createVisualElement:e,useRender:t,useVisualState:i,Component:r}){n&&$9(n);function s(a,l){let u;const h={...J.useContext(FL),...a,layoutId:n8(a)},{isStatic:d}=h,p=q9(a),m=i(a,d);if(!d&&n0){p.visualElement=Y9(r,m,h,e);const y=J.useContext(kL),M=J.useContext(NL).strict;p.visualElement&&(u=p.visualElement.loadFeatures(h,M,n,y))}return J.createElement(t0.Provider,{value:p},u&&p.visualElement?J.createElement(u,{visualElement:p.visualElement,...h}):null,t(r,a,Q9(m,p.visualElement,l),m,d,p.visualElement))}const o=J.forwardRef(s);return o[e8]=r,o}function n8({layoutId:n}){const e=J.useContext(UL).id;return e&&n!==void 0?e+"-"+n:n}function i8(n){function e(i,r={}){return t8(n(i,r))}if(typeof Proxy>"u")return e;const t=new Map;return new Proxy(e,{get:(i,r)=>(t.has(r)||t.set(r,e(r)),t.get(r))})}const r8=["animate","circle","defs","desc","ellipse","g","image","line","filter","marker","mask","metadata","path","pattern","polygon","polyline","rect","stop","switch","symbol","svg","text","tspan","use","view"];function l1(n){return typeof n!="string"||n.includes("-")?!1:!!(r8.indexOf(n)>-1||/[A-Z]/.test(n))}const eg={};function s8(n){Object.assign(eg,n)}const kh=["transformPerspective","x","y","z","translateX","translateY","translateZ","scale","scaleX","scaleY","rotate","rotateX","rotateY","rotateZ","skew","skewX","skewY"],pl=new Set(kh);function HL(n,{layout:e,layoutId:t}){return pl.has(n)||n.startsWith("origin")||(e||t!==void 0)&&(!!eg[n]||n==="opacity")}const Bi=n=>!!(n&&n.getVelocity),o8={x:"translateX",y:"translateY",z:"translateZ",transformPerspective:"perspective"},a8=kh.length;function l8(n,{enableHardwareAcceleration:e=!0,allowTransformNone:t=!0},i,r){let s="";for(let o=0;o<a8;o++){const a=kh[o];if(n[a]!==void 0){const l=o8[a]||a;s+=`${l}(${n[a]}) `}}return e&&!n.z&&(s+="translateZ(0)"),s=s.trim(),r?s=r(n,i?"":s):t&&i&&(s="none"),s}const zL=n=>e=>typeof e=="string"&&e.startsWith(n),GL=zL("--"),V_=zL("var(--"),c8=/var\s*\(\s*--[\w-]+(\s*,\s*(?:(?:[^)(]|\((?:[^)(]+|\([^)(]*\))*\))*)+)?\s*\)/g,u8=(n,e)=>e&&typeof n=="number"?e.transform(n):n,Zo=(n,e,t)=>Math.min(Math.max(t,n),e),ml={test:n=>typeof n=="number",parse:parseFloat,transform:n=>n},Bf={...ml,transform:n=>Zo(0,1,n)},Yp={...ml,default:1},Lf=n=>Math.round(n*1e5)/1e5,s0=/(-)?([\d]*\.?[\d])+/g,VL=/(#[0-9a-f]{3,8}|(rgb|hsl)a?\((-?[\d\.]+%?[,\s]+){2}(-?[\d\.]+%?)\s*[\,\/]?\s*[\d\.]*%?\))/gi,f8=/^(#[0-9a-f]{3,8}|(rgb|hsl)a?\((-?[\d\.]+%?[,\s]+){2}(-?[\d\.]+%?)\s*[\,\/]?\s*[\d\.]*%?\))$/i;function Hh(n){return typeof n=="string"}const zh=n=>({test:e=>Hh(e)&&e.endsWith(n)&&e.split(" ").length===1,parse:parseFloat,transform:e=>`${e}${n}`}),xo=zh("deg"),ms=zh("%"),it=zh("px"),h8=zh("vh"),d8=zh("vw"),TC={...ms,parse:n=>ms.parse(n)/100,transform:n=>ms.transform(n*100)},CC={...ml,transform:Math.round},WL={borderWidth:it,borderTopWidth:it,borderRightWidth:it,borderBottomWidth:it,borderLeftWidth:it,borderRadius:it,radius:it,borderTopLeftRadius:it,borderTopRightRadius:it,borderBottomRightRadius:it,borderBottomLeftRadius:it,width:it,maxWidth:it,height:it,maxHeight:it,size:it,top:it,right:it,bottom:it,left:it,padding:it,paddingTop:it,paddingRight:it,paddingBottom:it,paddingLeft:it,margin:it,marginTop:it,marginRight:it,marginBottom:it,marginLeft:it,rotate:xo,rotateX:xo,rotateY:xo,rotateZ:xo,scale:Yp,scaleX:Yp,scaleY:Yp,scaleZ:Yp,skew:xo,skewX:xo,skewY:xo,distance:it,translateX:it,translateY:it,translateZ:it,x:it,y:it,z:it,perspective:it,transformPerspective:it,opacity:Bf,originX:TC,originY:TC,originZ:it,zIndex:CC,fillOpacity:Bf,strokeOpacity:Bf,numOctaves:CC};function c1(n,e,t,i){const{style:r,vars:s,transform:o,transformOrigin:a}=n;let l=!1,u=!1,h=!0;for(const d in e){const p=e[d];if(GL(d)){s[d]=p;continue}const m=WL[d],y=u8(p,m);if(pl.has(d)){if(l=!0,o[d]=y,!h)continue;p!==(m.default||0)&&(h=!1)}else d.startsWith("origin")?(u=!0,a[d]=y):r[d]=y}if(e.transform||(l||i?r.transform=l8(n.transform,t,h,i):r.transform&&(r.transform="none")),u){const{originX:d="50%",originY:p="50%",originZ:m=0}=a;r.transformOrigin=`${d} ${p} ${m}`}}const u1=()=>({style:{},transform:{},transformOrigin:{},vars:{}});function jL(n,e,t){for(const i in e)!Bi(e[i])&&!HL(i,t)&&(n[i]=e[i])}function p8({transformTemplate:n},e,t){return J.useMemo(()=>{const i=u1();return c1(i,e,{enableHardwareAcceleration:!t},n),Object.assign({},i.vars,i.style)},[e])}function m8(n,e,t){const i=n.style||{},r={};return jL(r,i,n),Object.assign(r,p8(n,e,t)),n.transformValues?n.transformValues(r):r}function g8(n,e,t){const i={},r=m8(n,e,t);return n.drag&&n.dragListener!==!1&&(i.draggable=!1,r.userSelect=r.WebkitUserSelect=r.WebkitTouchCallout="none",r.touchAction=n.drag===!0?"none":`pan-${n.drag==="x"?"y":"x"}`),n.tabIndex===void 0&&(n.onTap||n.onTapStart||n.whileTap)&&(i.tabIndex=0),i.style=r,i}const v8=new Set(["animate","exit","variants","initial","style","values","variants","transition","transformTemplate","transformValues","custom","inherit","onLayoutAnimationStart","onLayoutAnimationComplete","onLayoutMeasure","onBeforeLayoutMeasure","onAnimationStart","onAnimationComplete","onUpdate","onDragStart","onDrag","onDragEnd","onMeasureDragConstraints","onDirectionLock","onDragTransitionEnd","_dragX","_dragY","onHoverStart","onHoverEnd","onViewportEnter","onViewportLeave","ignoreStrict","viewport"]);function tg(n){return n.startsWith("while")||n.startsWith("drag")&&n!=="draggable"||n.startsWith("layout")||n.startsWith("onTap")||n.startsWith("onPan")||v8.has(n)}let XL=n=>!tg(n);function y8(n){n&&(XL=e=>e.startsWith("on")?!tg(e):n(e))}try{y8(require("@emotion/is-prop-valid").default)}catch{}function x8(n,e,t){const i={};for(const r in n)r==="values"&&typeof n.values=="object"||(XL(r)||t===!0&&tg(r)||!e&&!tg(r)||n.draggable&&r.startsWith("onDrag"))&&(i[r]=n[r]);return i}function bC(n,e,t){return typeof n=="string"?n:it.transform(e+t*n)}function _8(n,e,t){const i=bC(e,n.x,n.width),r=bC(t,n.y,n.height);return`${i} ${r}`}const A8={offset:"stroke-dashoffset",array:"stroke-dasharray"},S8={offset:"strokeDashoffset",array:"strokeDasharray"};function M8(n,e,t=1,i=0,r=!0){n.pathLength=1;const s=r?A8:S8;n[s.offset]=it.transform(-i);const o=it.transform(e),a=it.transform(t);n[s.array]=`${o} ${a}`}function f1(n,{attrX:e,attrY:t,attrScale:i,originX:r,originY:s,pathLength:o,pathSpacing:a=1,pathOffset:l=0,...u},h,d,p){if(c1(n,u,h,p),d){n.style.viewBox&&(n.attrs.viewBox=n.style.viewBox);return}n.attrs=n.style,n.style={};const{attrs:m,style:y,dimensions:M}=n;m.transform&&(M&&(y.transform=m.transform),delete m.transform),M&&(r!==void 0||s!==void 0||y.transform)&&(y.transformOrigin=_8(M,r!==void 0?r:.5,s!==void 0?s:.5)),e!==void 0&&(m.x=e),t!==void 0&&(m.y=t),i!==void 0&&(m.scale=i),o!==void 0&&M8(m,o,a,l,!1)}const JL=()=>({...u1(),attrs:{}}),h1=n=>typeof n=="string"&&n.toLowerCase()==="svg";function E8(n,e,t,i){const r=J.useMemo(()=>{const s=JL();return f1(s,e,{enableHardwareAcceleration:!1},h1(i),n.transformTemplate),{...s.attrs,style:{...s.style}}},[e]);if(n.style){const s={};jL(s,n.style,n),r.style={...s,...r.style}}return r}function w8(n=!1){return(t,i,r,{latestValues:s},o)=>{const l=(l1(t)?E8:g8)(i,s,o,t),h={...x8(i,typeof t=="string",n),...l,ref:r},{children:d}=i,p=J.useMemo(()=>Bi(d)?d.get():d,[d]);return J.createElement(t,{...h,children:p})}}const d1=n=>n.replace(/([a-z])([A-Z])/g,"$1-$2").toLowerCase();function KL(n,{style:e,vars:t},i,r){Object.assign(n.style,e,r&&r.getProjectionStyles(i));for(const s in t)n.style.setProperty(s,t[s])}const YL=new Set(["baseFrequency","diffuseConstant","kernelMatrix","kernelUnitLength","keySplines","keyTimes","limitingConeAngle","markerHeight","markerWidth","numOctaves","targetX","targetY","surfaceScale","specularConstant","specularExponent","stdDeviation","tableValues","viewBox","gradientTransform","pathLength","startOffset","textLength","lengthAdjust"]);function QL(n,e,t,i){KL(n,e,void 0,i);for(const r in e.attrs)n.setAttribute(YL.has(r)?r:d1(r),e.attrs[r])}function p1(n,e){const{style:t}=n,i={};for(const r in t)(Bi(t[r])||e.style&&Bi(e.style[r])||HL(r,n))&&(i[r]=t[r]);return i}function ZL(n,e){const t=p1(n,e);for(const i in n)if(Bi(n[i])||Bi(e[i])){const r=kh.indexOf(i)!==-1?"attr"+i.charAt(0).toUpperCase()+i.substring(1):i;t[r]=n[i]}return t}function m1(n,e,t,i={},r={}){return typeof e=="function"&&(e=e(t!==void 0?t:n.custom,i,r)),typeof e=="string"&&(e=n.variants&&n.variants[e]),typeof e=="function"&&(e=e(t!==void 0?t:n.custom,i,r)),e}function T8(n){const e=J.useRef(null);return e.current===null&&(e.current=n()),e.current}const ng=n=>Array.isArray(n),C8=n=>!!(n&&typeof n=="object"&&n.mix&&n.toValue),b8=n=>ng(n)?n[n.length-1]||0:n;function xm(n){const e=Bi(n)?n.get():n;return C8(e)?e.toValue():e}function R8({scrapeMotionValuesFromProps:n,createRenderState:e,onMount:t},i,r,s){const o={latestValues:P8(i,r,s,n),renderState:e()};return t&&(o.mount=a=>t(i,a,o)),o}const qL=n=>(e,t)=>{const i=J.useContext(t0),r=J.useContext(s1),s=()=>R8(n,e,i,r);return t?s():T8(s)};function P8(n,e,t,i){const r={},s=i(n,{});for(const p in s)r[p]=xm(s[p]);let{initial:o,animate:a}=n;const l=r0(n),u=OL(n);e&&u&&!l&&n.inherit!==!1&&(o===void 0&&(o=e.initial),a===void 0&&(a=e.animate));let h=t?t.initial===!1:!1;h=h||o===!1;const d=h?a:o;return d&&typeof d!="boolean"&&!i0(d)&&(Array.isArray(d)?d:[d]).forEach(m=>{const y=m1(n,m);if(!y)return;const{transitionEnd:M,transition:_,...g}=y;for(const x in g){let S=g[x];if(Array.isArray(S)){const E=h?S.length-1:0;S=S[E]}S!==null&&(r[x]=S)}for(const x in M)r[x]=M[x]}),r}const B8={useVisualState:qL({scrapeMotionValuesFromProps:ZL,createRenderState:JL,onMount:(n,e,{renderState:t,latestValues:i})=>{try{t.dimensions=typeof e.getBBox=="function"?e.getBBox():e.getBoundingClientRect()}catch{t.dimensions={x:0,y:0,width:0,height:0}}f1(t,i,{enableHardwareAcceleration:!1},h1(e.tagName),n.transformTemplate),QL(e,t)}})},L8={useVisualState:qL({scrapeMotionValuesFromProps:p1,createRenderState:u1})};function I8(n,{forwardMotionProps:e=!1},t,i){return{...l1(n)?B8:L8,preloadedFeatures:t,useRender:w8(e),createVisualElement:i,Component:n}}function Gs(n,e,t,i={passive:!0}){return n.addEventListener(e,t,i),()=>n.removeEventListener(e,t)}const $L=n=>n.pointerType==="mouse"?typeof n.button!="number"||n.button<=0:n.isPrimary!==!1;function o0(n,e="page"){return{point:{x:n[e+"X"],y:n[e+"Y"]}}}const D8=n=>e=>$L(e)&&n(e,o0(e));function js(n,e,t,i){return Gs(n,e,D8(t),i)}const F8=(n,e)=>t=>e(n(t)),zo=(...n)=>n.reduce(F8);function eI(n){let e=null;return()=>{const t=()=>{e=null};return e===null?(e=n,t):!1}}const RC=eI("dragHorizontal"),PC=eI("dragVertical");function tI(n){let e=!1;if(n==="y")e=PC();else if(n==="x")e=RC();else{const t=RC(),i=PC();t&&i?e=()=>{t(),i()}:(t&&t(),i&&i())}return e}function nI(){const n=tI(!0);return n?(n(),!1):!0}class sa{constructor(e){this.isMounted=!1,this.node=e}update(){}}function N8(n){let e=[],t=[],i=0,r=!1,s=!1;const o=new WeakSet,a={schedule:(l,u=!1,h=!1)=>{const d=h&&r,p=d?e:t;return u&&o.add(l),p.indexOf(l)===-1&&(p.push(l),d&&r&&(i=e.length)),l},cancel:l=>{const u=t.indexOf(l);u!==-1&&t.splice(u,1),o.delete(l)},process:l=>{if(r){s=!0;return}if(r=!0,[e,t]=[t,e],t.length=0,i=e.length,i)for(let u=0;u<i;u++){const h=e[u];h(l),o.has(h)&&(a.schedule(h),n())}r=!1,s&&(s=!1,a.process(l))}};return a}const tn={delta:0,timestamp:0,isProcessing:!1},O8=40;let W_=!0,dh=!1;const a0=["read","update","preRender","render","postRender"],Nc=a0.reduce((n,e)=>(n[e]=N8(()=>dh=!0),n),{}),U8=n=>Nc[n].process(tn),iI=n=>{dh=!1,tn.delta=W_?1e3/60:Math.max(Math.min(n-tn.timestamp,O8),1),tn.timestamp=n,tn.isProcessing=!0,a0.forEach(U8),tn.isProcessing=!1,dh&&(W_=!1,requestAnimationFrame(iI))},k8=()=>{dh=!0,W_=!0,tn.isProcessing||requestAnimationFrame(iI)},an=a0.reduce((n,e)=>{const t=Nc[e];return n[e]=(i,r=!1,s=!1)=>(dh||k8(),t.schedule(i,r,s)),n},{});function qs(n){a0.forEach(e=>Nc[e].cancel(n))}function BC(n,e){const t="pointer"+(e?"enter":"leave"),i="onHover"+(e?"Start":"End"),r=(s,o)=>{if(s.type==="touch"||nI())return;const a=n.getProps();n.animationState&&a.whileHover&&n.animationState.setActive("whileHover",e),a[i]&&an.update(()=>a[i](s,o))};return js(n.current,t,r,{passive:!n.getProps()[i]})}class H8 extends sa{mount(){this.unmount=zo(BC(this.node,!0),BC(this.node,!1))}unmount(){}}class z8 extends sa{constructor(){super(...arguments),this.isActive=!1}onFocus(){let e=!1;try{e=this.node.current.matches(":focus-visible")}catch{e=!0}!e||!this.node.animationState||(this.node.animationState.setActive("whileFocus",!0),this.isActive=!0)}onBlur(){!this.isActive||!this.node.animationState||(this.node.animationState.setActive("whileFocus",!1),this.isActive=!1)}mount(){this.unmount=zo(Gs(this.node.current,"focus",()=>this.onFocus()),Gs(this.node.current,"blur",()=>this.onBlur()))}unmount(){}}const rI=(n,e)=>e?n===e?!0:rI(n,e.parentElement):!1,Bn=n=>n;function Uy(n,e){if(!e)return;const t=new PointerEvent("pointer"+n);e(t,o0(t))}class G8 extends sa{constructor(){super(...arguments),this.removeStartListeners=Bn,this.removeEndListeners=Bn,this.removeAccessibleListeners=Bn,this.startPointerPress=(e,t)=>{if(this.removeEndListeners(),this.isPressing)return;const i=this.node.getProps(),s=js(window,"pointerup",(a,l)=>{if(!this.checkPressEnd())return;const{onTap:u,onTapCancel:h}=this.node.getProps();an.update(()=>{rI(this.node.current,a.target)?u&&u(a,l):h&&h(a,l)})},{passive:!(i.onTap||i.onPointerUp)}),o=js(window,"pointercancel",(a,l)=>this.cancelPress(a,l),{passive:!(i.onTapCancel||i.onPointerCancel)});this.removeEndListeners=zo(s,o),this.startPress(e,t)},this.startAccessiblePress=()=>{const e=s=>{if(s.key!=="Enter"||this.isPressing)return;const o=a=>{a.key!=="Enter"||!this.checkPressEnd()||Uy("up",(l,u)=>{const{onTap:h}=this.node.getProps();h&&an.update(()=>h(l,u))})};this.removeEndListeners(),this.removeEndListeners=Gs(this.node.current,"keyup",o),Uy("down",(a,l)=>{this.startPress(a,l)})},t=Gs(this.node.current,"keydown",e),i=()=>{this.isPressing&&Uy("cancel",(s,o)=>this.cancelPress(s,o))},r=Gs(this.node.current,"blur",i);this.removeAccessibleListeners=zo(t,r)}}startPress(e,t){this.isPressing=!0;const{onTapStart:i,whileTap:r}=this.node.getProps();r&&this.node.animationState&&this.node.animationState.setActive("whileTap",!0),i&&an.update(()=>i(e,t))}checkPressEnd(){return this.removeEndListeners(),this.isPressing=!1,this.node.getProps().whileTap&&this.node.animationState&&this.node.animationState.setActive("whileTap",!1),!nI()}cancelPress(e,t){if(!this.checkPressEnd())return;const{onTapCancel:i}=this.node.getProps();i&&an.update(()=>i(e,t))}mount(){const e=this.node.getProps(),t=js(this.node.current,"pointerdown",this.startPointerPress,{passive:!(e.onTapStart||e.onPointerStart)}),i=Gs(this.node.current,"focus",this.startAccessiblePress);this.removeStartListeners=zo(t,i)}unmount(){this.removeStartListeners(),this.removeEndListeners(),this.removeAccessibleListeners()}}const j_=new WeakMap,ky=new WeakMap,V8=n=>{const e=j_.get(n.target);e&&e(n)},W8=n=>{n.forEach(V8)};function j8({root:n,...e}){const t=n||document;ky.has(t)||ky.set(t,{});const i=ky.get(t),r=JSON.stringify(e);return i[r]||(i[r]=new IntersectionObserver(W8,{root:n,...e})),i[r]}function X8(n,e,t){const i=j8(e);return j_.set(n,t),i.observe(n),()=>{j_.delete(n),i.unobserve(n)}}const J8={some:0,all:1};class K8 extends sa{constructor(){super(...arguments),this.hasEnteredView=!1,this.isInView=!1}startObserver(){this.unmount();const{viewport:e={}}=this.node.getProps(),{root:t,margin:i,amount:r="some",once:s}=e,o={root:t?t.current:void 0,rootMargin:i,threshold:typeof r=="number"?r:J8[r]},a=l=>{const{isIntersecting:u}=l;if(this.isInView===u||(this.isInView=u,s&&!u&&this.hasEnteredView))return;u&&(this.hasEnteredView=!0),this.node.animationState&&this.node.animationState.setActive("whileInView",u);const{onViewportEnter:h,onViewportLeave:d}=this.node.getProps(),p=u?h:d;p&&p(l)};return X8(this.node.current,o,a)}mount(){this.startObserver()}update(){if(typeof IntersectionObserver>"u")return;const{props:e,prevProps:t}=this.node;["amount","margin","root"].some(Y8(e,t))&&this.startObserver()}unmount(){}}function Y8({viewport:n={}},{viewport:e={}}={}){return t=>n[t]!==e[t]}const Q8={inView:{Feature:K8},tap:{Feature:G8},focus:{Feature:z8},hover:{Feature:H8}};function sI(n,e){if(!Array.isArray(e))return!1;const t=e.length;if(t!==n.length)return!1;for(let i=0;i<t;i++)if(e[i]!==n[i])return!1;return!0}function Z8(n){const e={};return n.values.forEach((t,i)=>e[i]=t.get()),e}function q8(n){const e={};return n.values.forEach((t,i)=>e[i]=t.getVelocity()),e}function l0(n,e,t){const i=n.getProps();return m1(i,e,t!==void 0?t:i.custom,Z8(n),q8(n))}const $8="framerAppearId",eW="data-"+d1($8);let tW=Bn,g1=Bn;const Go=n=>n*1e3,Xs=n=>n/1e3,nW={current:!1},oI=n=>Array.isArray(n)&&typeof n[0]=="number";function aI(n){return!!(!n||typeof n=="string"&&lI[n]||oI(n)||Array.isArray(n)&&n.every(aI))}const gf=([n,e,t,i])=>`cubic-bezier(${n}, ${e}, ${t}, ${i})`,lI={linear:"linear",ease:"ease",easeIn:"ease-in",easeOut:"ease-out",easeInOut:"ease-in-out",circIn:gf([0,.65,.55,1]),circOut:gf([.55,0,1,.45]),backIn:gf([.31,.01,.66,-.59]),backOut:gf([.33,1.53,.69,.99])};function cI(n){if(n)return oI(n)?gf(n):Array.isArray(n)?n.map(cI):lI[n]}function iW(n,e,t,{delay:i=0,duration:r,repeat:s=0,repeatType:o="loop",ease:a,times:l}={}){const u={[e]:t};l&&(u.offset=l);const h=cI(a);return Array.isArray(h)&&(u.easing=h),n.animate(u,{delay:i,duration:r,easing:Array.isArray(h)?"linear":h,fill:"both",iterations:s+1,direction:o==="reverse"?"alternate":"normal"})}const LC={waapi:()=>Object.hasOwnProperty.call(Element.prototype,"animate")},Hy={},uI={};for(const n in LC)uI[n]=()=>(Hy[n]===void 0&&(Hy[n]=LC[n]()),Hy[n]);function rW(n,{repeat:e,repeatType:t="loop"}){const i=e&&t!=="loop"&&e%2===1?0:n.length-1;return n[i]}const fI=(n,e,t)=>(((1-3*t+3*e)*n+(3*t-6*e))*n+3*e)*n,sW=1e-7,oW=12;function aW(n,e,t,i,r){let s,o,a=0;do o=e+(t-e)/2,s=fI(o,i,r)-n,s>0?t=o:e=o;while(Math.abs(s)>sW&&++a<oW);return o}function Gh(n,e,t,i){if(n===e&&t===i)return Bn;const r=s=>aW(s,0,1,n,t);return s=>s===0||s===1?s:fI(r(s),e,i)}const lW=Gh(.42,0,1,1),cW=Gh(0,0,.58,1),hI=Gh(.42,0,.58,1),uW=n=>Array.isArray(n)&&typeof n[0]!="number",dI=n=>e=>e<=.5?n(2*e)/2:(2-n(2*(1-e)))/2,pI=n=>e=>1-n(1-e),mI=n=>1-Math.sin(Math.acos(n)),v1=pI(mI),fW=dI(v1),gI=Gh(.33,1.53,.69,.99),y1=pI(gI),hW=dI(y1),dW=n=>(n*=2)<1?.5*y1(n):.5*(2-Math.pow(2,-10*(n-1))),pW={linear:Bn,easeIn:lW,easeInOut:hI,easeOut:cW,circIn:mI,circInOut:fW,circOut:v1,backIn:y1,backInOut:hW,backOut:gI,anticipate:dW},IC=n=>{if(Array.isArray(n)){g1(n.length===4);const[e,t,i,r]=n;return Gh(e,t,i,r)}else if(typeof n=="string")return pW[n];return n},x1=(n,e)=>t=>!!(Hh(t)&&f8.test(t)&&t.startsWith(n)||e&&Object.prototype.hasOwnProperty.call(t,e)),vI=(n,e,t)=>i=>{if(!Hh(i))return i;const[r,s,o,a]=i.match(s0);return{[n]:parseFloat(r),[e]:parseFloat(s),[t]:parseFloat(o),alpha:a!==void 0?parseFloat(a):1}},mW=n=>Zo(0,255,n),zy={...ml,transform:n=>Math.round(mW(n))},ja={test:x1("rgb","red"),parse:vI("red","green","blue"),transform:({red:n,green:e,blue:t,alpha:i=1})=>"rgba("+zy.transform(n)+", "+zy.transform(e)+", "+zy.transform(t)+", "+Lf(Bf.transform(i))+")"};function gW(n){let e="",t="",i="",r="";return n.length>5?(e=n.substring(1,3),t=n.substring(3,5),i=n.substring(5,7),r=n.substring(7,9)):(e=n.substring(1,2),t=n.substring(2,3),i=n.substring(3,4),r=n.substring(4,5),e+=e,t+=t,i+=i,r+=r),{red:parseInt(e,16),green:parseInt(t,16),blue:parseInt(i,16),alpha:r?parseInt(r,16)/255:1}}const X_={test:x1("#"),parse:gW,transform:ja.transform},Sc={test:x1("hsl","hue"),parse:vI("hue","saturation","lightness"),transform:({hue:n,saturation:e,lightness:t,alpha:i=1})=>"hsla("+Math.round(n)+", "+ms.transform(Lf(e))+", "+ms.transform(Lf(t))+", "+Lf(Bf.transform(i))+")"},di={test:n=>ja.test(n)||X_.test(n)||Sc.test(n),parse:n=>ja.test(n)?ja.parse(n):Sc.test(n)?Sc.parse(n):X_.parse(n),transform:n=>Hh(n)?n:n.hasOwnProperty("red")?ja.transform(n):Sc.transform(n)},on=(n,e,t)=>-t*n+t*e+n;function Gy(n,e,t){return t<0&&(t+=1),t>1&&(t-=1),t<1/6?n+(e-n)*6*t:t<1/2?e:t<2/3?n+(e-n)*(2/3-t)*6:n}function vW({hue:n,saturation:e,lightness:t,alpha:i}){n/=360,e/=100,t/=100;let r=0,s=0,o=0;if(!e)r=s=o=t;else{const a=t<.5?t*(1+e):t+e-t*e,l=2*t-a;r=Gy(l,a,n+1/3),s=Gy(l,a,n),o=Gy(l,a,n-1/3)}return{red:Math.round(r*255),green:Math.round(s*255),blue:Math.round(o*255),alpha:i}}const Vy=(n,e,t)=>{const i=n*n;return Math.sqrt(Math.max(0,t*(e*e-i)+i))},yW=[X_,ja,Sc],xW=n=>yW.find(e=>e.test(n));function DC(n){const e=xW(n);let t=e.parse(n);return e===Sc&&(t=vW(t)),t}const yI=(n,e)=>{const t=DC(n),i=DC(e),r={...t};return s=>(r.red=Vy(t.red,i.red,s),r.green=Vy(t.green,i.green,s),r.blue=Vy(t.blue,i.blue,s),r.alpha=on(t.alpha,i.alpha,s),ja.transform(r))};function _W(n){var e,t;return isNaN(n)&&Hh(n)&&(((e=n.match(s0))===null||e===void 0?void 0:e.length)||0)+(((t=n.match(VL))===null||t===void 0?void 0:t.length)||0)>0}const xI={regex:c8,countKey:"Vars",token:"${v}",parse:Bn},_I={regex:VL,countKey:"Colors",token:"${c}",parse:di.parse},AI={regex:s0,countKey:"Numbers",token:"${n}",parse:ml.parse};function Wy(n,{regex:e,countKey:t,token:i,parse:r}){const s=n.tokenised.match(e);s&&(n["num"+t]=s.length,n.tokenised=n.tokenised.replace(e,i),n.values.push(...s.map(r)))}function ig(n){const e=n.toString(),t={value:e,tokenised:e,values:[],numVars:0,numColors:0,numNumbers:0};return t.value.includes("var(--")&&Wy(t,xI),Wy(t,_I),Wy(t,AI),t}function SI(n){return ig(n).values}function MI(n){const{values:e,numColors:t,numVars:i,tokenised:r}=ig(n),s=e.length;return o=>{let a=r;for(let l=0;l<s;l++)l<i?a=a.replace(xI.token,o[l]):l<i+t?a=a.replace(_I.token,di.transform(o[l])):a=a.replace(AI.token,Lf(o[l]));return a}}const AW=n=>typeof n=="number"?0:n;function SW(n){const e=SI(n);return MI(n)(e.map(AW))}const qo={test:_W,parse:SI,createTransformer:MI,getAnimatableNone:SW},EI=(n,e)=>t=>`${t>0?e:n}`;function wI(n,e){return typeof n=="number"?t=>on(n,e,t):di.test(n)?yI(n,e):n.startsWith("var(")?EI(n,e):CI(n,e)}const TI=(n,e)=>{const t=[...n],i=t.length,r=n.map((s,o)=>wI(s,e[o]));return s=>{for(let o=0;o<i;o++)t[o]=r[o](s);return t}},MW=(n,e)=>{const t={...n,...e},i={};for(const r in t)n[r]!==void 0&&e[r]!==void 0&&(i[r]=wI(n[r],e[r]));return r=>{for(const s in i)t[s]=i[s](r);return t}},CI=(n,e)=>{const t=qo.createTransformer(e),i=ig(n),r=ig(e);return i.numVars===r.numVars&&i.numColors===r.numColors&&i.numNumbers>=r.numNumbers?zo(TI(i.values,r.values),t):EI(n,e)},ph=(n,e,t)=>{const i=e-n;return i===0?1:(t-n)/i},FC=(n,e)=>t=>on(n,e,t);function EW(n){return typeof n=="number"?FC:typeof n=="string"?di.test(n)?yI:CI:Array.isArray(n)?TI:typeof n=="object"?MW:FC}function wW(n,e,t){const i=[],r=t||EW(n[0]),s=n.length-1;for(let o=0;o<s;o++){let a=r(n[o],n[o+1]);if(e){const l=Array.isArray(e)?e[o]||Bn:e;a=zo(l,a)}i.push(a)}return i}function bI(n,e,{clamp:t=!0,ease:i,mixer:r}={}){const s=n.length;if(g1(s===e.length),s===1)return()=>e[0];n[0]>n[s-1]&&(n=[...n].reverse(),e=[...e].reverse());const o=wW(e,i,r),a=o.length,l=u=>{let h=0;if(a>1)for(;h<n.length-2&&!(u<n[h+1]);h++);const d=ph(n[h],n[h+1],u);return o[h](d)};return t?u=>l(Zo(n[0],n[s-1],u)):l}function TW(n,e){const t=n[n.length-1];for(let i=1;i<=e;i++){const r=ph(0,e,i);n.push(on(t,1,r))}}function CW(n){const e=[0];return TW(e,n.length-1),e}function bW(n,e){return n.map(t=>t*e)}function RW(n,e){return n.map(()=>e||hI).splice(0,n.length-1)}function rg({duration:n=300,keyframes:e,times:t,ease:i="easeInOut"}){const r=uW(i)?i.map(IC):IC(i),s={done:!1,value:e[0]},o=bW(t&&t.length===e.length?t:CW(e),n),a=bI(o,e,{ease:Array.isArray(r)?r:RW(e,r)});return{calculatedDuration:n,next:l=>(s.value=a(l),s.done=l>=n,s)}}function RI(n,e){return e?n*(1e3/e):0}const PW=5;function PI(n,e,t){const i=Math.max(e-PW,0);return RI(t-n(i),e-i)}const jy=.001,BW=.01,NC=10,LW=.05,IW=1;function DW({duration:n=800,bounce:e=.25,velocity:t=0,mass:i=1}){let r,s;tW(n<=Go(NC));let o=1-e;o=Zo(LW,IW,o),n=Zo(BW,NC,Xs(n)),o<1?(r=u=>{const h=u*o,d=h*n,p=h-t,m=J_(u,o),y=Math.exp(-d);return jy-p/m*y},s=u=>{const d=u*o*n,p=d*t+t,m=Math.pow(o,2)*Math.pow(u,2)*n,y=Math.exp(-d),M=J_(Math.pow(u,2),o);return(-r(u)+jy>0?-1:1)*((p-m)*y)/M}):(r=u=>{const h=Math.exp(-u*n),d=(u-t)*n+1;return-jy+h*d},s=u=>{const h=Math.exp(-u*n),d=(t-u)*(n*n);return h*d});const a=5/n,l=NW(r,s,a);if(n=Go(n),isNaN(l))return{stiffness:100,damping:10,duration:n};{const u=Math.pow(l,2)*i;return{stiffness:u,damping:o*2*Math.sqrt(i*u),duration:n}}}const FW=12;function NW(n,e,t){let i=t;for(let r=1;r<FW;r++)i=i-n(i)/e(i);return i}function J_(n,e){return n*Math.sqrt(1-e*e)}const OW=["duration","bounce"],UW=["stiffness","damping","mass"];function OC(n,e){return e.some(t=>n[t]!==void 0)}function kW(n){let e={velocity:0,stiffness:100,damping:10,mass:1,isResolvedFromDuration:!1,...n};if(!OC(n,UW)&&OC(n,OW)){const t=DW(n);e={...e,...t,velocity:0,mass:1},e.isResolvedFromDuration=!0}return e}function BI({keyframes:n,restDelta:e,restSpeed:t,...i}){const r=n[0],s=n[n.length-1],o={done:!1,value:r},{stiffness:a,damping:l,mass:u,velocity:h,duration:d,isResolvedFromDuration:p}=kW(i),m=h?-Xs(h):0,y=l/(2*Math.sqrt(a*u)),M=s-r,_=Xs(Math.sqrt(a/u)),g=Math.abs(M)<5;t||(t=g?.01:2),e||(e=g?.005:.5);let x;if(y<1){const S=J_(_,y);x=E=>{const C=Math.exp(-y*_*E);return s-C*((m+y*_*M)/S*Math.sin(S*E)+M*Math.cos(S*E))}}else if(y===1)x=S=>s-Math.exp(-_*S)*(M+(m+_*M)*S);else{const S=_*Math.sqrt(y*y-1);x=E=>{const C=Math.exp(-y*_*E),b=Math.min(S*E,300);return s-C*((m+y*_*M)*Math.sinh(b)+S*M*Math.cosh(b))/S}}return{calculatedDuration:p&&d||null,next:S=>{const E=x(S);if(p)o.done=S>=d;else{let C=m;S!==0&&(y<1?C=PI(x,S,E):C=0);const b=Math.abs(C)<=t,P=Math.abs(s-E)<=e;o.done=b&&P}return o.value=o.done?s:E,o}}}function UC({keyframes:n,velocity:e=0,power:t=.8,timeConstant:i=325,bounceDamping:r=10,bounceStiffness:s=500,modifyTarget:o,min:a,max:l,restDelta:u=.5,restSpeed:h}){const d=n[0],p={done:!1,value:d},m=B=>a!==void 0&&B<a||l!==void 0&&B>l,y=B=>a===void 0?l:l===void 0||Math.abs(a-B)<Math.abs(l-B)?a:l;let M=t*e;const _=d+M,g=o===void 0?_:o(_);g!==_&&(M=g-d);const x=B=>-M*Math.exp(-B/i),S=B=>g+x(B),E=B=>{const R=x(B),L=S(B);p.done=Math.abs(R)<=u,p.value=p.done?g:L};let C,b;const P=B=>{m(p.value)&&(C=B,b=BI({keyframes:[p.value,y(p.value)],velocity:PI(S,B,p.value),damping:r,stiffness:s,restDelta:u,restSpeed:h}))};return P(0),{calculatedDuration:null,next:B=>{let R=!1;return!b&&C===void 0&&(R=!0,E(B),P(B)),C!==void 0&&B>C?b.next(B-C):(!R&&E(B),p)}}}const HW=n=>{const e=({timestamp:t})=>n(t);return{start:()=>an.update(e,!0),stop:()=>qs(e),now:()=>tn.isProcessing?tn.timestamp:performance.now()}},kC=2e4;function HC(n){let e=0;const t=50;let i=n.next(e);for(;!i.done&&e<kC;)e+=t,i=n.next(e);return e>=kC?1/0:e}const zW={decay:UC,inertia:UC,tween:rg,keyframes:rg,spring:BI};function sg({autoplay:n=!0,delay:e=0,driver:t=HW,keyframes:i,type:r="keyframes",repeat:s=0,repeatDelay:o=0,repeatType:a="loop",onPlay:l,onStop:u,onComplete:h,onUpdate:d,...p}){let m=1,y=!1,M,_;const g=()=>{_=new Promise(U=>{M=U})};g();let x;const S=zW[r]||rg;let E;S!==rg&&typeof i[0]!="number"&&(E=bI([0,100],i,{clamp:!1}),i=[0,100]);const C=S({...p,keyframes:i});let b;a==="mirror"&&(b=S({...p,keyframes:[...i].reverse(),velocity:-(p.velocity||0)}));let P="idle",B=null,R=null,L=null;C.calculatedDuration===null&&s&&(C.calculatedDuration=HC(C));const{calculatedDuration:z}=C;let $=1/0,X=1/0;z!==null&&($=z+o,X=$*(s+1)-o);let Q=0;const Y=U=>{if(R===null)return;m>0&&(R=Math.min(R,U)),m<0&&(R=Math.min(U-X/m,R)),B!==null?Q=B:Q=Math.round(U-R)*m;const W=Q-e*(m>=0?1:-1),ve=m>=0?W<0:W>X;Q=Math.max(W,0),P==="finished"&&B===null&&(Q=X);let ue=Q,Ae=C;if(s){const ct=Q/$;let tt=Math.floor(ct),Se=ct%1;!Se&&ct>=1&&(Se=1),Se===1&&tt--,tt=Math.min(tt,s+1);const G=!!(tt%2);G&&(a==="reverse"?(Se=1-Se,o&&(Se-=o/$)):a==="mirror"&&(Ae=b));let ye=Zo(0,1,Se);Q>X&&(ye=a==="reverse"&&G?1:0),ue=ye*$}const Ee=ve?{done:!1,value:i[0]}:Ae.next(ue);E&&(Ee.value=E(Ee.value));let{done:Ne}=Ee;!ve&&z!==null&&(Ne=m>=0?Q>=X:Q<=0);const We=B===null&&(P==="finished"||P==="running"&&Ne);return d&&d(Ee.value),We&&I(),Ee},ne=()=>{x&&x.stop(),x=void 0},ee=()=>{P="idle",ne(),M(),g(),R=L=null},I=()=>{P="finished",h&&h(),ne(),M()},V=()=>{if(y)return;x||(x=t(Y));const U=x.now();l&&l(),B!==null?R=U-B:(!R||P==="finished")&&(R=U),P==="finished"&&g(),L=R,B=null,P="running",x.start()};n&&V();const H={then(U,W){return _.then(U,W)},get time(){return Xs(Q)},set time(U){U=Go(U),Q=U,B!==null||!x||m===0?B=U:R=x.now()-U/m},get duration(){const U=C.calculatedDuration===null?HC(C):C.calculatedDuration;return Xs(U)},get speed(){return m},set speed(U){U===m||!x||(m=U,H.time=Xs(Q))},get state(){return P},play:V,pause:()=>{P="paused",B=Q},stop:()=>{y=!0,P!=="idle"&&(P="idle",u&&u(),ee())},cancel:()=>{L!==null&&Y(L),ee()},complete:()=>{P="finished"},sample:U=>(R=0,Y(U))};return H}const GW=new Set(["opacity","clipPath","filter","transform","backgroundColor"]),Qp=10,VW=2e4,WW=(n,e)=>e.type==="spring"||n==="backgroundColor"||!aI(e.ease);function jW(n,e,{onUpdate:t,onComplete:i,...r}){if(!(uI.waapi()&&GW.has(e)&&!r.repeatDelay&&r.repeatType!=="mirror"&&r.damping!==0&&r.type!=="inertia"))return!1;let o=!1,a,l;const u=()=>{l=new Promise(g=>{a=g})};u();let{keyframes:h,duration:d=300,ease:p,times:m}=r;if(WW(e,r)){const g=sg({...r,repeat:0,delay:0});let x={done:!1,value:h[0]};const S=[];let E=0;for(;!x.done&&E<VW;)x=g.sample(E),S.push(x.value),E+=Qp;m=void 0,h=S,d=E-Qp,p="linear"}const y=iW(n.owner.current,e,h,{...r,duration:d,ease:p,times:m}),M=()=>y.cancel(),_=()=>{an.update(M),a(),u()};return y.onfinish=()=>{n.set(rW(h,r)),i&&i(),_()},{then(g,x){return l.then(g,x)},get time(){return Xs(y.currentTime||0)},set time(g){y.currentTime=Go(g)},get speed(){return y.playbackRate},set speed(g){y.playbackRate=g},get duration(){return Xs(d)},play:()=>{o||(y.play(),qs(M))},pause:()=>y.pause(),stop:()=>{if(o=!0,y.playState==="idle")return;const{currentTime:g}=y;if(g){const x=sg({...r,autoplay:!1});n.setWithVelocity(x.sample(g-Qp).value,x.sample(g).value,Qp)}_()},complete:()=>y.finish(),cancel:_}}function XW({keyframes:n,delay:e,onUpdate:t,onComplete:i}){const r=()=>(t&&t(n[n.length-1]),i&&i(),{time:0,speed:1,duration:0,play:Bn,pause:Bn,stop:Bn,then:s=>(s(),Promise.resolve()),cancel:Bn,complete:Bn});return e?sg({keyframes:[0,1],duration:0,delay:e,onComplete:r}):r()}const JW={type:"spring",stiffness:500,damping:25,restSpeed:10},KW=n=>({type:"spring",stiffness:550,damping:n===0?2*Math.sqrt(550):30,restSpeed:10}),YW={type:"keyframes",duration:.8},QW={type:"keyframes",ease:[.25,.1,.35,1],duration:.3},ZW=(n,{keyframes:e})=>e.length>2?YW:pl.has(n)?n.startsWith("scale")?KW(e[1]):JW:QW,K_=(n,e)=>n==="zIndex"?!1:!!(typeof e=="number"||Array.isArray(e)||typeof e=="string"&&(qo.test(e)||e==="0")&&!e.startsWith("url(")),qW=new Set(["brightness","contrast","saturate","opacity"]);function $W(n){const[e,t]=n.slice(0,-1).split("(");if(e==="drop-shadow")return n;const[i]=t.match(s0)||[];if(!i)return n;const r=t.replace(i,"");let s=qW.has(e)?1:0;return i!==t&&(s*=100),e+"("+s+r+")"}const e6=/([a-z-]*)\(.*?\)/g,Y_={...qo,getAnimatableNone:n=>{const e=n.match(e6);return e?e.map($W).join(" "):n}},t6={...WL,color:di,backgroundColor:di,outlineColor:di,fill:di,stroke:di,borderColor:di,borderTopColor:di,borderRightColor:di,borderBottomColor:di,borderLeftColor:di,filter:Y_,WebkitFilter:Y_},_1=n=>t6[n];function LI(n,e){let t=_1(n);return t!==Y_&&(t=qo),t.getAnimatableNone?t.getAnimatableNone(e):void 0}const II=n=>/^0[^.\s]+$/.test(n);function n6(n){if(typeof n=="number")return n===0;if(n!==null)return n==="none"||n==="0"||II(n)}function i6(n,e,t,i){const r=K_(e,t);let s;Array.isArray(t)?s=[...t]:s=[null,t];const o=i.from!==void 0?i.from:n.get();let a;const l=[];for(let u=0;u<s.length;u++)s[u]===null&&(s[u]=u===0?o:s[u-1]),n6(s[u])&&l.push(u),typeof s[u]=="string"&&s[u]!=="none"&&s[u]!=="0"&&(a=s[u]);if(r&&l.length&&a)for(let u=0;u<l.length;u++){const h=l[u];s[h]=LI(e,a)}return s}function r6({when:n,delay:e,delayChildren:t,staggerChildren:i,staggerDirection:r,repeat:s,repeatType:o,repeatDelay:a,from:l,elapsed:u,...h}){return!!Object.keys(h).length}function DI(n,e){return n[e]||n.default||n}const A1=(n,e,t,i={})=>r=>{const s=DI(i,n)||{},o=s.delay||i.delay||0;let{elapsed:a=0}=i;a=a-Go(o);const l=i6(e,n,t,s),u=l[0],h=l[l.length-1],d=K_(n,u),p=K_(n,h);let m={keyframes:l,velocity:e.getVelocity(),ease:"easeOut",...s,delay:-a,onUpdate:y=>{e.set(y),s.onUpdate&&s.onUpdate(y)},onComplete:()=>{r(),s.onComplete&&s.onComplete()}};if(r6(s)||(m={...m,...ZW(n,m)}),m.duration&&(m.duration=Go(m.duration)),m.repeatDelay&&(m.repeatDelay=Go(m.repeatDelay)),!d||!p||nW.current||s.type===!1)return XW(m);if(e.owner&&e.owner.current instanceof HTMLElement&&!e.owner.getProps().onUpdate){const y=jW(e,n,m);if(y)return y}return sg(m)};function og(n){return!!(Bi(n)&&n.add)}const s6=n=>/^\-?\d*\.?\d+$/.test(n);function S1(n,e){n.indexOf(e)===-1&&n.push(e)}function M1(n,e){const t=n.indexOf(e);t>-1&&n.splice(t,1)}class E1{constructor(){this.subscriptions=[]}add(e){return S1(this.subscriptions,e),()=>M1(this.subscriptions,e)}notify(e,t,i){const r=this.subscriptions.length;if(r)if(r===1)this.subscriptions[0](e,t,i);else for(let s=0;s<r;s++){const o=this.subscriptions[s];o&&o(e,t,i)}}getSize(){return this.subscriptions.length}clear(){this.subscriptions.length=0}}const o6=n=>!isNaN(parseFloat(n));class a6{constructor(e,t={}){this.version="10.12.21",this.timeDelta=0,this.lastUpdated=0,this.canTrackVelocity=!1,this.events={},this.updateAndNotify=(i,r=!0)=>{this.prev=this.current,this.current=i;const{delta:s,timestamp:o}=tn;this.lastUpdated!==o&&(this.timeDelta=s,this.lastUpdated=o,an.postRender(this.scheduleVelocityCheck)),this.prev!==this.current&&this.events.change&&this.events.change.notify(this.current),this.events.velocityChange&&this.events.velocityChange.notify(this.getVelocity()),r&&this.events.renderRequest&&this.events.renderRequest.notify(this.current)},this.scheduleVelocityCheck=()=>an.postRender(this.velocityCheck),this.velocityCheck=({timestamp:i})=>{i!==this.lastUpdated&&(this.prev=this.current,this.events.velocityChange&&this.events.velocityChange.notify(this.getVelocity()))},this.hasAnimated=!1,this.prev=this.current=e,this.canTrackVelocity=o6(this.current),this.owner=t.owner}onChange(e){return this.on("change",e)}on(e,t){this.events[e]||(this.events[e]=new E1);const i=this.events[e].add(t);return e==="change"?()=>{i(),an.read(()=>{this.events.change.getSize()||this.stop()})}:i}clearListeners(){for(const e in this.events)this.events[e].clear()}attach(e,t){this.passiveEffect=e,this.stopPassiveEffect=t}set(e,t=!0){!t||!this.passiveEffect?this.updateAndNotify(e,t):this.passiveEffect(e,this.updateAndNotify)}setWithVelocity(e,t,i){this.set(t),this.prev=e,this.timeDelta=i}jump(e){this.updateAndNotify(e),this.prev=e,this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}get(){return this.current}getPrevious(){return this.prev}getVelocity(){return this.canTrackVelocity?RI(parseFloat(this.current)-parseFloat(this.prev),this.timeDelta):0}start(e){return this.stop(),new Promise(t=>{this.hasAnimated=!0,this.animation=e(t),this.events.animationStart&&this.events.animationStart.notify()}).then(()=>{this.events.animationComplete&&this.events.animationComplete.notify(),this.clearAnimation()})}stop(){this.animation&&(this.animation.stop(),this.events.animationCancel&&this.events.animationCancel.notify()),this.clearAnimation()}isAnimating(){return!!this.animation}clearAnimation(){delete this.animation}destroy(){this.clearListeners(),this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}}function iu(n,e){return new a6(n,e)}const FI=n=>e=>e.test(n),l6={test:n=>n==="auto",parse:n=>n},NI=[ml,it,ms,xo,d8,h8,l6],rf=n=>NI.find(FI(n)),c6=[...NI,di,qo],u6=n=>c6.find(FI(n));function f6(n,e,t){n.hasValue(e)?n.getValue(e).set(t):n.addValue(e,iu(t))}function h6(n,e){const t=l0(n,e);let{transitionEnd:i={},transition:r={},...s}=t?n.makeTargetAnimatable(t,!1):{};s={...s,...i};for(const o in s){const a=b8(s[o]);f6(n,o,a)}}function d6(n,e,t){var i,r;const s=Object.keys(e).filter(a=>!n.hasValue(a)),o=s.length;if(!o)return!1;for(let a=0;a<o;a++){const l=s[a],u=e[l];let h=null;Array.isArray(u)&&(h=u[0]),h===null&&(h=(r=(i=t[l])!==null&&i!==void 0?i:n.readValue(l))!==null&&r!==void 0?r:e[l]),h!=null&&(typeof h=="string"&&(s6(h)||II(h))?h=parseFloat(h):!u6(h)&&qo.test(u)&&(h=LI(l,u)),n.addValue(l,iu(h,{owner:n})),t[l]===void 0&&(t[l]=h),h!==null&&n.setBaseTarget(l,h))}return!0}function p6(n,e){return e?(e[n]||e.default||e).from:void 0}function m6(n,e,t){const i={};for(const r in n){const s=p6(r,e);if(s!==void 0)i[r]=s;else{const o=t.getValue(r);o&&(i[r]=o.get())}}return i}function g6({protectedKeys:n,needsAnimating:e},t){const i=n.hasOwnProperty(t)&&e[t]!==!0;return e[t]=!1,i}function OI(n,e,{delay:t=0,transitionOverride:i,type:r}={}){let{transition:s=n.getDefaultTransition(),transitionEnd:o,...a}=n.makeTargetAnimatable(e);const l=n.getValue("willChange");i&&(s=i);const u=[],h=r&&n.animationState&&n.animationState.getState()[r];for(const d in a){const p=n.getValue(d),m=a[d];if(!p||m===void 0||h&&g6(h,d))continue;const y={delay:t,elapsed:0,...s};if(window.HandoffAppearAnimations&&!p.hasAnimated){const _=n.getProps()[eW];_&&(y.elapsed=window.HandoffAppearAnimations(_,d,p,an))}p.start(A1(d,p,m,n.shouldReduceMotion&&pl.has(d)?{type:!1}:y));const M=p.animation;og(l)&&(l.add(d),M.then(()=>l.remove(d))),u.push(M)}return o&&Promise.all(u).then(()=>{o&&h6(n,o)}),u}function Q_(n,e,t={}){const i=l0(n,e,t.custom);let{transition:r=n.getDefaultTransition()||{}}=i||{};t.transitionOverride&&(r=t.transitionOverride);const s=i?()=>Promise.all(OI(n,i,t)):()=>Promise.resolve(),o=n.variantChildren&&n.variantChildren.size?(l=0)=>{const{delayChildren:u=0,staggerChildren:h,staggerDirection:d}=r;return v6(n,e,u+l,h,d,t)}:()=>Promise.resolve(),{when:a}=r;if(a){const[l,u]=a==="beforeChildren"?[s,o]:[o,s];return l().then(()=>u())}else return Promise.all([s(),o(t.delay)])}function v6(n,e,t=0,i=0,r=1,s){const o=[],a=(n.variantChildren.size-1)*i,l=r===1?(u=0)=>u*i:(u=0)=>a-u*i;return Array.from(n.variantChildren).sort(y6).forEach((u,h)=>{u.notify("AnimationStart",e),o.push(Q_(u,e,{...s,delay:t+l(h)}).then(()=>u.notify("AnimationComplete",e)))}),Promise.all(o)}function y6(n,e){return n.sortNodePosition(e)}function x6(n,e,t={}){n.notify("AnimationStart",e);let i;if(Array.isArray(e)){const r=e.map(s=>Q_(n,s,t));i=Promise.all(r)}else if(typeof e=="string")i=Q_(n,e,t);else{const r=typeof e=="function"?l0(n,e,t.custom):e;i=Promise.all(OI(n,r,t))}return i.then(()=>n.notify("AnimationComplete",e))}const _6=[...o1].reverse(),A6=o1.length;function S6(n){return e=>Promise.all(e.map(({animation:t,options:i})=>x6(n,t,i)))}function M6(n){let e=S6(n);const t=w6();let i=!0;const r=(l,u)=>{const h=l0(n,u);if(h){const{transition:d,transitionEnd:p,...m}=h;l={...l,...m,...p}}return l};function s(l){e=l(n)}function o(l,u){const h=n.getProps(),d=n.getVariantContext(!0)||{},p=[],m=new Set;let y={},M=1/0;for(let g=0;g<A6;g++){const x=_6[g],S=t[x],E=h[x]!==void 0?h[x]:d[x],C=fh(E),b=x===u?S.isActive:null;b===!1&&(M=g);let P=E===d[x]&&E!==h[x]&&C;if(P&&i&&n.manuallyAnimateOnMount&&(P=!1),S.protectedKeys={...y},!S.isActive&&b===null||!E&&!S.prevProp||i0(E)||typeof E=="boolean")continue;const B=E6(S.prevProp,E);let R=B||x===u&&S.isActive&&!P&&C||g>M&&C;const L=Array.isArray(E)?E:[E];let z=L.reduce(r,{});b===!1&&(z={});const{prevResolvedValues:$={}}=S,X={...$,...z},Q=Y=>{R=!0,m.delete(Y),S.needsAnimating[Y]=!0};for(const Y in X){const ne=z[Y],ee=$[Y];y.hasOwnProperty(Y)||(ne!==ee?ng(ne)&&ng(ee)?!sI(ne,ee)||B?Q(Y):S.protectedKeys[Y]=!0:ne!==void 0?Q(Y):m.add(Y):ne!==void 0&&m.has(Y)?Q(Y):S.protectedKeys[Y]=!0)}S.prevProp=E,S.prevResolvedValues=z,S.isActive&&(y={...y,...z}),i&&n.blockInitialAnimation&&(R=!1),R&&!P&&p.push(...L.map(Y=>({animation:Y,options:{type:x,...l}})))}if(m.size){const g={};m.forEach(x=>{const S=n.getBaseTarget(x);S!==void 0&&(g[x]=S)}),p.push({animation:g})}let _=!!p.length;return i&&h.initial===!1&&!n.manuallyAnimateOnMount&&(_=!1),i=!1,_?e(p):Promise.resolve()}function a(l,u,h){var d;if(t[l].isActive===u)return Promise.resolve();(d=n.variantChildren)===null||d===void 0||d.forEach(m=>{var y;return(y=m.animationState)===null||y===void 0?void 0:y.setActive(l,u)}),t[l].isActive=u;const p=o(h,l);for(const m in t)t[m].protectedKeys={};return p}return{animateChanges:o,setActive:a,setAnimateFunction:s,getState:()=>t}}function E6(n,e){return typeof e=="string"?e!==n:Array.isArray(e)?!sI(e,n):!1}function Ta(n=!1){return{isActive:n,protectedKeys:{},needsAnimating:{},prevResolvedValues:{}}}function w6(){return{animate:Ta(!0),whileInView:Ta(),whileHover:Ta(),whileTap:Ta(),whileDrag:Ta(),whileFocus:Ta(),exit:Ta()}}class T6 extends sa{constructor(e){super(e),e.animationState||(e.animationState=M6(e))}updateAnimationControlsSubscription(){const{animate:e}=this.node.getProps();this.unmount(),i0(e)&&(this.unmount=e.subscribe(this.node))}mount(){this.updateAnimationControlsSubscription()}update(){const{animate:e}=this.node.getProps(),{animate:t}=this.node.prevProps||{};e!==t&&this.updateAnimationControlsSubscription()}unmount(){}}let C6=0;class b6 extends sa{constructor(){super(...arguments),this.id=C6++}update(){if(!this.node.presenceContext)return;const{isPresent:e,onExitComplete:t,custom:i}=this.node.presenceContext,{isPresent:r}=this.node.prevPresenceContext||{};if(!this.node.animationState||e===r)return;const s=this.node.animationState.setActive("exit",!e,{custom:i??this.node.getProps().custom});t&&!e&&s.then(()=>t(this.id))}mount(){const{register:e}=this.node.presenceContext||{};e&&(this.unmount=e(this.id))}unmount(){}}const R6={animation:{Feature:T6},exit:{Feature:b6}},zC=(n,e)=>Math.abs(n-e);function P6(n,e){const t=zC(n.x,e.x),i=zC(n.y,e.y);return Math.sqrt(t**2+i**2)}class UI{constructor(e,t,{transformPagePoint:i}={}){if(this.startEvent=null,this.lastMoveEvent=null,this.lastMoveEventInfo=null,this.handlers={},this.updatePoint=()=>{if(!(this.lastMoveEvent&&this.lastMoveEventInfo))return;const u=Jy(this.lastMoveEventInfo,this.history),h=this.startEvent!==null,d=P6(u.offset,{x:0,y:0})>=3;if(!h&&!d)return;const{point:p}=u,{timestamp:m}=tn;this.history.push({...p,timestamp:m});const{onStart:y,onMove:M}=this.handlers;h||(y&&y(this.lastMoveEvent,u),this.startEvent=this.lastMoveEvent),M&&M(this.lastMoveEvent,u)},this.handlePointerMove=(u,h)=>{this.lastMoveEvent=u,this.lastMoveEventInfo=Xy(h,this.transformPagePoint),an.update(this.updatePoint,!0)},this.handlePointerUp=(u,h)=>{if(this.end(),!(this.lastMoveEvent&&this.lastMoveEventInfo))return;const{onEnd:d,onSessionEnd:p}=this.handlers,m=Jy(u.type==="pointercancel"?this.lastMoveEventInfo:Xy(h,this.transformPagePoint),this.history);this.startEvent&&d&&d(u,m),p&&p(u,m)},!$L(e))return;this.handlers=t,this.transformPagePoint=i;const r=o0(e),s=Xy(r,this.transformPagePoint),{point:o}=s,{timestamp:a}=tn;this.history=[{...o,timestamp:a}];const{onSessionStart:l}=t;l&&l(e,Jy(s,this.history)),this.removeListeners=zo(js(window,"pointermove",this.handlePointerMove),js(window,"pointerup",this.handlePointerUp),js(window,"pointercancel",this.handlePointerUp))}updateHandlers(e){this.handlers=e}end(){this.removeListeners&&this.removeListeners(),qs(this.updatePoint)}}function Xy(n,e){return e?{point:e(n.point)}:n}function GC(n,e){return{x:n.x-e.x,y:n.y-e.y}}function Jy({point:n},e){return{point:n,delta:GC(n,kI(e)),offset:GC(n,B6(e)),velocity:L6(e,.1)}}function B6(n){return n[0]}function kI(n){return n[n.length-1]}function L6(n,e){if(n.length<2)return{x:0,y:0};let t=n.length-1,i=null;const r=kI(n);for(;t>=0&&(i=n[t],!(r.timestamp-i.timestamp>Go(e)));)t--;if(!i)return{x:0,y:0};const s=Xs(r.timestamp-i.timestamp);if(s===0)return{x:0,y:0};const o={x:(r.x-i.x)/s,y:(r.y-i.y)/s};return o.x===1/0&&(o.x=0),o.y===1/0&&(o.y=0),o}function Qi(n){return n.max-n.min}function Z_(n,e=0,t=.01){return Math.abs(n-e)<=t}function VC(n,e,t,i=.5){n.origin=i,n.originPoint=on(e.min,e.max,n.origin),n.scale=Qi(t)/Qi(e),(Z_(n.scale,1,1e-4)||isNaN(n.scale))&&(n.scale=1),n.translate=on(t.min,t.max,n.origin)-n.originPoint,(Z_(n.translate)||isNaN(n.translate))&&(n.translate=0)}function If(n,e,t,i){VC(n.x,e.x,t.x,i?i.originX:void 0),VC(n.y,e.y,t.y,i?i.originY:void 0)}function WC(n,e,t){n.min=t.min+e.min,n.max=n.min+Qi(e)}function I6(n,e,t){WC(n.x,e.x,t.x),WC(n.y,e.y,t.y)}function jC(n,e,t){n.min=e.min-t.min,n.max=n.min+Qi(e)}function Df(n,e,t){jC(n.x,e.x,t.x),jC(n.y,e.y,t.y)}function D6(n,{min:e,max:t},i){return e!==void 0&&n<e?n=i?on(e,n,i.min):Math.max(n,e):t!==void 0&&n>t&&(n=i?on(t,n,i.max):Math.min(n,t)),n}function XC(n,e,t){return{min:e!==void 0?n.min+e:void 0,max:t!==void 0?n.max+t-(n.max-n.min):void 0}}function F6(n,{top:e,left:t,bottom:i,right:r}){return{x:XC(n.x,t,r),y:XC(n.y,e,i)}}function JC(n,e){let t=e.min-n.min,i=e.max-n.max;return e.max-e.min<n.max-n.min&&([t,i]=[i,t]),{min:t,max:i}}function N6(n,e){return{x:JC(n.x,e.x),y:JC(n.y,e.y)}}function O6(n,e){let t=.5;const i=Qi(n),r=Qi(e);return r>i?t=ph(e.min,e.max-i,n.min):i>r&&(t=ph(n.min,n.max-r,e.min)),Zo(0,1,t)}function U6(n,e){const t={};return e.min!==void 0&&(t.min=e.min-n.min),e.max!==void 0&&(t.max=e.max-n.min),t}const q_=.35;function k6(n=q_){return n===!1?n=0:n===!0&&(n=q_),{x:KC(n,"left","right"),y:KC(n,"top","bottom")}}function KC(n,e,t){return{min:YC(n,e),max:YC(n,t)}}function YC(n,e){return typeof n=="number"?n:n[e]||0}const QC=()=>({translate:0,scale:1,origin:0,originPoint:0}),Mc=()=>({x:QC(),y:QC()}),ZC=()=>({min:0,max:0}),wn=()=>({x:ZC(),y:ZC()});function os(n){return[n("x"),n("y")]}function HI({top:n,left:e,right:t,bottom:i}){return{x:{min:e,max:t},y:{min:n,max:i}}}function H6({x:n,y:e}){return{top:e.min,right:n.max,bottom:e.max,left:n.min}}function z6(n,e){if(!e)return n;const t=e({x:n.left,y:n.top}),i=e({x:n.right,y:n.bottom});return{top:t.y,left:t.x,bottom:i.y,right:i.x}}function Ky(n){return n===void 0||n===1}function $_({scale:n,scaleX:e,scaleY:t}){return!Ky(n)||!Ky(e)||!Ky(t)}function La(n){return $_(n)||zI(n)||n.z||n.rotate||n.rotateX||n.rotateY}function zI(n){return qC(n.x)||qC(n.y)}function qC(n){return n&&n!=="0%"}function ag(n,e,t){const i=n-t,r=e*i;return t+r}function $C(n,e,t,i,r){return r!==void 0&&(n=ag(n,r,i)),ag(n,t,i)+e}function eA(n,e=0,t=1,i,r){n.min=$C(n.min,e,t,i,r),n.max=$C(n.max,e,t,i,r)}function GI(n,{x:e,y:t}){eA(n.x,e.translate,e.scale,e.originPoint),eA(n.y,t.translate,t.scale,t.originPoint)}function G6(n,e,t,i=!1){const r=t.length;if(!r)return;e.x=e.y=1;let s,o;for(let a=0;a<r;a++){s=t[a],o=s.projectionDelta;const l=s.instance;l&&l.style&&l.style.display==="contents"||(i&&s.options.layoutScroll&&s.scroll&&s!==s.root&&Ec(n,{x:-s.scroll.offset.x,y:-s.scroll.offset.y}),o&&(e.x*=o.x.scale,e.y*=o.y.scale,GI(n,o)),i&&La(s.latestValues)&&Ec(n,s.latestValues))}e.x=eb(e.x),e.y=eb(e.y)}function eb(n){return Number.isInteger(n)||n>1.0000000000001||n<.999999999999?n:1}function Eo(n,e){n.min=n.min+e,n.max=n.max+e}function tb(n,e,[t,i,r]){const s=e[r]!==void 0?e[r]:.5,o=on(n.min,n.max,s);eA(n,e[t],e[i],o,e.scale)}const V6=["x","scaleX","originX"],W6=["y","scaleY","originY"];function Ec(n,e){tb(n.x,e,V6),tb(n.y,e,W6)}function VI(n,e){return HI(z6(n.getBoundingClientRect(),e))}function j6(n,e,t){const i=VI(n,t),{scroll:r}=e;return r&&(Eo(i.x,r.offset.x),Eo(i.y,r.offset.y)),i}const X6=new WeakMap;class J6{constructor(e){this.openGlobalLock=null,this.isDragging=!1,this.currentDirection=null,this.originPoint={x:0,y:0},this.constraints=!1,this.hasMutatedConstraints=!1,this.elastic=wn(),this.visualElement=e}start(e,{snapToCursor:t=!1}={}){const{presenceContext:i}=this.visualElement;if(i&&i.isPresent===!1)return;const r=l=>{this.stopAnimation(),t&&this.snapToCursor(o0(l,"page").point)},s=(l,u)=>{const{drag:h,dragPropagation:d,onDragStart:p}=this.getProps();if(h&&!d&&(this.openGlobalLock&&this.openGlobalLock(),this.openGlobalLock=tI(h),!this.openGlobalLock))return;this.isDragging=!0,this.currentDirection=null,this.resolveConstraints(),this.visualElement.projection&&(this.visualElement.projection.isAnimationBlocked=!0,this.visualElement.projection.target=void 0),os(y=>{let M=this.getAxisMotionValue(y).get()||0;if(ms.test(M)){const{projection:_}=this.visualElement;if(_&&_.layout){const g=_.layout.layoutBox[y];g&&(M=Qi(g)*(parseFloat(M)/100))}}this.originPoint[y]=M}),p&&an.update(()=>p(l,u),!1,!0);const{animationState:m}=this.visualElement;m&&m.setActive("whileDrag",!0)},o=(l,u)=>{const{dragPropagation:h,dragDirectionLock:d,onDirectionLock:p,onDrag:m}=this.getProps();if(!h&&!this.openGlobalLock)return;const{offset:y}=u;if(d&&this.currentDirection===null){this.currentDirection=K6(y),this.currentDirection!==null&&p&&p(this.currentDirection);return}this.updateAxis("x",u.point,y),this.updateAxis("y",u.point,y),this.visualElement.render(),m&&m(l,u)},a=(l,u)=>this.stop(l,u);this.panSession=new UI(e,{onSessionStart:r,onStart:s,onMove:o,onSessionEnd:a},{transformPagePoint:this.visualElement.getTransformPagePoint()})}stop(e,t){const i=this.isDragging;if(this.cancel(),!i)return;const{velocity:r}=t;this.startAnimation(r);const{onDragEnd:s}=this.getProps();s&&an.update(()=>s(e,t))}cancel(){this.isDragging=!1;const{projection:e,animationState:t}=this.visualElement;e&&(e.isAnimationBlocked=!1),this.panSession&&this.panSession.end(),this.panSession=void 0;const{dragPropagation:i}=this.getProps();!i&&this.openGlobalLock&&(this.openGlobalLock(),this.openGlobalLock=null),t&&t.setActive("whileDrag",!1)}updateAxis(e,t,i){const{drag:r}=this.getProps();if(!i||!Zp(e,r,this.currentDirection))return;const s=this.getAxisMotionValue(e);let o=this.originPoint[e]+i[e];this.constraints&&this.constraints[e]&&(o=D6(o,this.constraints[e],this.elastic[e])),s.set(o)}resolveConstraints(){const{dragConstraints:e,dragElastic:t}=this.getProps(),{layout:i}=this.visualElement.projection||{},r=this.constraints;e&&Ac(e)?this.constraints||(this.constraints=this.resolveRefConstraints()):e&&i?this.constraints=F6(i.layoutBox,e):this.constraints=!1,this.elastic=k6(t),r!==this.constraints&&i&&this.constraints&&!this.hasMutatedConstraints&&os(s=>{this.getAxisMotionValue(s)&&(this.constraints[s]=U6(i.layoutBox[s],this.constraints[s]))})}resolveRefConstraints(){const{dragConstraints:e,onMeasureDragConstraints:t}=this.getProps();if(!e||!Ac(e))return!1;const i=e.current,{projection:r}=this.visualElement;if(!r||!r.layout)return!1;const s=j6(i,r.root,this.visualElement.getTransformPagePoint());let o=N6(r.layout.layoutBox,s);if(t){const a=t(H6(o));this.hasMutatedConstraints=!!a,a&&(o=HI(a))}return o}startAnimation(e){const{drag:t,dragMomentum:i,dragElastic:r,dragTransition:s,dragSnapToOrigin:o,onDragTransitionEnd:a}=this.getProps(),l=this.constraints||{},u=os(h=>{if(!Zp(h,t,this.currentDirection))return;let d=l&&l[h]||{};o&&(d={min:0,max:0});const p=r?200:1e6,m=r?40:1e7,y={type:"inertia",velocity:i?e[h]:0,bounceStiffness:p,bounceDamping:m,timeConstant:750,restDelta:1,restSpeed:10,...s,...d};return this.startAxisValueAnimation(h,y)});return Promise.all(u).then(a)}startAxisValueAnimation(e,t){const i=this.getAxisMotionValue(e);return i.start(A1(e,i,0,t))}stopAnimation(){os(e=>this.getAxisMotionValue(e).stop())}getAxisMotionValue(e){const t="_drag"+e.toUpperCase(),i=this.visualElement.getProps(),r=i[t];return r||this.visualElement.getValue(e,(i.initial?i.initial[e]:void 0)||0)}snapToCursor(e){os(t=>{const{drag:i}=this.getProps();if(!Zp(t,i,this.currentDirection))return;const{projection:r}=this.visualElement,s=this.getAxisMotionValue(t);if(r&&r.layout){const{min:o,max:a}=r.layout.layoutBox[t];s.set(e[t]-on(o,a,.5))}})}scalePositionWithinConstraints(){if(!this.visualElement.current)return;const{drag:e,dragConstraints:t}=this.getProps(),{projection:i}=this.visualElement;if(!Ac(t)||!i||!this.constraints)return;this.stopAnimation();const r={x:0,y:0};os(o=>{const a=this.getAxisMotionValue(o);if(a){const l=a.get();r[o]=O6({min:l,max:l},this.constraints[o])}});const{transformTemplate:s}=this.visualElement.getProps();this.visualElement.current.style.transform=s?s({},""):"none",i.root&&i.root.updateScroll(),i.updateLayout(),this.resolveConstraints(),os(o=>{if(!Zp(o,e,null))return;const a=this.getAxisMotionValue(o),{min:l,max:u}=this.constraints[o];a.set(on(l,u,r[o]))})}addListeners(){if(!this.visualElement.current)return;X6.set(this.visualElement,this);const e=this.visualElement.current,t=js(e,"pointerdown",l=>{const{drag:u,dragListener:h=!0}=this.getProps();u&&h&&this.start(l)}),i=()=>{const{dragConstraints:l}=this.getProps();Ac(l)&&(this.constraints=this.resolveRefConstraints())},{projection:r}=this.visualElement,s=r.addEventListener("measure",i);r&&!r.layout&&(r.root&&r.root.updateScroll(),r.updateLayout()),i();const o=Gs(window,"resize",()=>this.scalePositionWithinConstraints()),a=r.addEventListener("didUpdate",({delta:l,hasLayoutChanged:u})=>{this.isDragging&&u&&(os(h=>{const d=this.getAxisMotionValue(h);d&&(this.originPoint[h]+=l[h].translate,d.set(d.get()+l[h].translate))}),this.visualElement.render())});return()=>{o(),t(),s(),a&&a()}}getProps(){const e=this.visualElement.getProps(),{drag:t=!1,dragDirectionLock:i=!1,dragPropagation:r=!1,dragConstraints:s=!1,dragElastic:o=q_,dragMomentum:a=!0}=e;return{...e,drag:t,dragDirectionLock:i,dragPropagation:r,dragConstraints:s,dragElastic:o,dragMomentum:a}}}function Zp(n,e,t){return(e===!0||e===n)&&(t===null||t===n)}function K6(n,e=10){let t=null;return Math.abs(n.y)>e?t="y":Math.abs(n.x)>e&&(t="x"),t}class Y6 extends sa{constructor(e){super(e),this.removeGroupControls=Bn,this.removeListeners=Bn,this.controls=new J6(e)}mount(){const{dragControls:e}=this.node.getProps();e&&(this.removeGroupControls=e.subscribe(this.controls)),this.removeListeners=this.controls.addListeners()||Bn}unmount(){this.removeGroupControls(),this.removeListeners()}}const nb=n=>(e,t)=>{n&&an.update(()=>n(e,t))};class Q6 extends sa{constructor(){super(...arguments),this.removePointerDownListener=Bn}onPointerDown(e){this.session=new UI(e,this.createPanHandlers(),{transformPagePoint:this.node.getTransformPagePoint()})}createPanHandlers(){const{onPanSessionStart:e,onPanStart:t,onPan:i,onPanEnd:r}=this.node.getProps();return{onSessionStart:nb(e),onStart:nb(t),onMove:i,onEnd:(s,o)=>{delete this.session,r&&an.update(()=>r(s,o))}}}mount(){this.removePointerDownListener=js(this.node.current,"pointerdown",e=>this.onPointerDown(e))}update(){this.session&&this.session.updateHandlers(this.createPanHandlers())}unmount(){this.removePointerDownListener(),this.session&&this.session.end()}}function Z6(){const n=J.useContext(s1);if(n===null)return[!0,null];const{isPresent:e,onExitComplete:t,register:i}=n,r=J.useId();return J.useEffect(()=>i(r),[]),!e&&t?[!1,()=>t&&t(r)]:[!0]}const _m={hasAnimatedSinceResize:!0,hasEverUpdated:!1};function ib(n,e){return e.max===e.min?0:n/(e.max-e.min)*100}const sf={correct:(n,e)=>{if(!e.target)return n;if(typeof n=="string")if(it.test(n))n=parseFloat(n);else return n;const t=ib(n,e.target.x),i=ib(n,e.target.y);return`${t}% ${i}%`}},q6={correct:(n,{treeScale:e,projectionDelta:t})=>{const i=n,r=qo.parse(n);if(r.length>5)return i;const s=qo.createTransformer(n),o=typeof r[0]!="number"?1:0,a=t.x.scale*e.x,l=t.y.scale*e.y;r[0+o]/=a,r[1+o]/=l;const u=on(a,l,.5);return typeof r[2+o]=="number"&&(r[2+o]/=u),typeof r[3+o]=="number"&&(r[3+o]/=u),s(r)}};class $6 extends zt.Component{componentDidMount(){const{visualElement:e,layoutGroup:t,switchLayoutGroup:i,layoutId:r}=this.props,{projection:s}=e;s8(ej),s&&(t.group&&t.group.add(s),i&&i.register&&r&&i.register(s),s.root.didUpdate(),s.addEventListener("animationComplete",()=>{this.safeToRemove()}),s.setOptions({...s.options,onExitComplete:()=>this.safeToRemove()})),_m.hasEverUpdated=!0}getSnapshotBeforeUpdate(e){const{layoutDependency:t,visualElement:i,drag:r,isPresent:s}=this.props,o=i.projection;return o&&(o.isPresent=s,r||e.layoutDependency!==t||t===void 0?o.willUpdate():this.safeToRemove(),e.isPresent!==s&&(s?o.promote():o.relegate()||an.postRender(()=>{const a=o.getStack();(!a||!a.members.length)&&this.safeToRemove()}))),null}componentDidUpdate(){const{projection:e}=this.props.visualElement;e&&(e.root.didUpdate(),queueMicrotask(()=>{!e.currentAnimation&&e.isLead()&&this.safeToRemove()}))}componentWillUnmount(){const{visualElement:e,layoutGroup:t,switchLayoutGroup:i}=this.props,{projection:r}=e;r&&(r.scheduleCheckAfterUnmount(),t&&t.group&&t.group.remove(r),i&&i.deregister&&i.deregister(r))}safeToRemove(){const{safeToRemove:e}=this.props;e&&e()}render(){return null}}function WI(n){const[e,t]=Z6(),i=J.useContext(UL);return zt.createElement($6,{...n,layoutGroup:i,switchLayoutGroup:J.useContext(kL),isPresent:e,safeToRemove:t})}const ej={borderRadius:{...sf,applyTo:["borderTopLeftRadius","borderTopRightRadius","borderBottomLeftRadius","borderBottomRightRadius"]},borderTopLeftRadius:sf,borderTopRightRadius:sf,borderBottomLeftRadius:sf,borderBottomRightRadius:sf,boxShadow:q6},jI=["TopLeft","TopRight","BottomLeft","BottomRight"],tj=jI.length,rb=n=>typeof n=="string"?parseFloat(n):n,sb=n=>typeof n=="number"||it.test(n);function nj(n,e,t,i,r,s){r?(n.opacity=on(0,t.opacity!==void 0?t.opacity:1,ij(i)),n.opacityExit=on(e.opacity!==void 0?e.opacity:1,0,rj(i))):s&&(n.opacity=on(e.opacity!==void 0?e.opacity:1,t.opacity!==void 0?t.opacity:1,i));for(let o=0;o<tj;o++){const a=`border${jI[o]}Radius`;let l=ob(e,a),u=ob(t,a);if(l===void 0&&u===void 0)continue;l||(l=0),u||(u=0),l===0||u===0||sb(l)===sb(u)?(n[a]=Math.max(on(rb(l),rb(u),i),0),(ms.test(u)||ms.test(l))&&(n[a]+="%")):n[a]=u}(e.rotate||t.rotate)&&(n.rotate=on(e.rotate||0,t.rotate||0,i))}function ob(n,e){return n[e]!==void 0?n[e]:n.borderRadius}const ij=XI(0,.5,v1),rj=XI(.5,.95,Bn);function XI(n,e,t){return i=>i<n?0:i>e?1:t(ph(n,e,i))}function ab(n,e){n.min=e.min,n.max=e.max}function cr(n,e){ab(n.x,e.x),ab(n.y,e.y)}function lb(n,e,t,i,r){return n-=e,n=ag(n,1/t,i),r!==void 0&&(n=ag(n,1/r,i)),n}function sj(n,e=0,t=1,i=.5,r,s=n,o=n){if(ms.test(e)&&(e=parseFloat(e),e=on(o.min,o.max,e/100)-o.min),typeof e!="number")return;let a=on(s.min,s.max,i);n===s&&(a-=e),n.min=lb(n.min,e,t,a,r),n.max=lb(n.max,e,t,a,r)}function cb(n,e,[t,i,r],s,o){sj(n,e[t],e[i],e[r],e.scale,s,o)}const oj=["x","scaleX","originX"],aj=["y","scaleY","originY"];function ub(n,e,t,i){cb(n.x,e,oj,t?t.x:void 0,i?i.x:void 0),cb(n.y,e,aj,t?t.y:void 0,i?i.y:void 0)}function fb(n){return n.translate===0&&n.scale===1}function JI(n){return fb(n.x)&&fb(n.y)}function tA(n,e){return n.x.min===e.x.min&&n.x.max===e.x.max&&n.y.min===e.y.min&&n.y.max===e.y.max}function hb(n){return Qi(n.x)/Qi(n.y)}class lj{constructor(){this.members=[]}add(e){S1(this.members,e),e.scheduleRender()}remove(e){if(M1(this.members,e),e===this.prevLead&&(this.prevLead=void 0),e===this.lead){const t=this.members[this.members.length-1];t&&this.promote(t)}}relegate(e){const t=this.members.findIndex(r=>e===r);if(t===0)return!1;let i;for(let r=t;r>=0;r--){const s=this.members[r];if(s.isPresent!==!1){i=s;break}}return i?(this.promote(i),!0):!1}promote(e,t){const i=this.lead;if(e!==i&&(this.prevLead=i,this.lead=e,e.show(),i)){i.instance&&i.scheduleRender(),e.scheduleRender(),e.resumeFrom=i,t&&(e.resumeFrom.preserveOpacity=!0),i.snapshot&&(e.snapshot=i.snapshot,e.snapshot.latestValues=i.animationValues||i.latestValues),e.root&&e.root.isUpdating&&(e.isLayoutDirty=!0);const{crossfade:r}=e.options;r===!1&&i.hide()}}exitAnimationComplete(){this.members.forEach(e=>{const{options:t,resumingFrom:i}=e;t.onExitComplete&&t.onExitComplete(),i&&i.options.onExitComplete&&i.options.onExitComplete()})}scheduleRender(){this.members.forEach(e=>{e.instance&&e.scheduleRender(!1)})}removeLeadSnapshot(){this.lead&&this.lead.snapshot&&(this.lead.snapshot=void 0)}}function db(n,e,t){let i="";const r=n.x.translate/e.x,s=n.y.translate/e.y;if((r||s)&&(i=`translate3d(${r}px, ${s}px, 0) `),(e.x!==1||e.y!==1)&&(i+=`scale(${1/e.x}, ${1/e.y}) `),t){const{rotate:l,rotateX:u,rotateY:h}=t;l&&(i+=`rotate(${l}deg) `),u&&(i+=`rotateX(${u}deg) `),h&&(i+=`rotateY(${h}deg) `)}const o=n.x.scale*e.x,a=n.y.scale*e.y;return(o!==1||a!==1)&&(i+=`scale(${o}, ${a})`),i||"none"}const cj=(n,e)=>n.depth-e.depth;class uj{constructor(){this.children=[],this.isDirty=!1}add(e){S1(this.children,e),this.isDirty=!0}remove(e){M1(this.children,e),this.isDirty=!0}forEach(e){this.isDirty&&this.children.sort(cj),this.isDirty=!1,this.children.forEach(e)}}function fj(n,e){const t=performance.now(),i=({timestamp:r})=>{const s=r-t;s>=e&&(qs(i),n(s-e))};return an.read(i,!0),()=>qs(i)}function hj(n){window.MotionDebug&&window.MotionDebug.record(n)}function dj(n){return n instanceof SVGElement&&n.tagName!=="svg"}function pj(n,e,t){const i=Bi(n)?n:iu(n);return i.start(A1("",i,e,t)),i.animation}const pb=["","X","Y","Z"],mb=1e3;let mj=0;const Ia={type:"projectionFrame",totalNodes:0,resolvedTargetDeltas:0,recalculatedProjection:0};function KI({attachResizeListener:n,defaultParent:e,measureScroll:t,checkIsScrollRoot:i,resetTransform:r}){return class{constructor(o={},a=e==null?void 0:e()){this.id=mj++,this.animationId=0,this.children=new Set,this.options={},this.isTreeAnimating=!1,this.isAnimationBlocked=!1,this.isLayoutDirty=!1,this.isProjectionDirty=!1,this.isSharedProjectionDirty=!1,this.isTransformDirty=!1,this.updateManuallyBlocked=!1,this.updateBlockedByResize=!1,this.isUpdating=!1,this.isSVG=!1,this.needsReset=!1,this.shouldResetTransform=!1,this.treeScale={x:1,y:1},this.eventHandlers=new Map,this.hasTreeAnimated=!1,this.updateScheduled=!1,this.checkUpdateFailed=()=>{this.isUpdating&&(this.isUpdating=!1,this.clearAllSnapshots())},this.updateProjection=()=>{Ia.totalNodes=Ia.resolvedTargetDeltas=Ia.recalculatedProjection=0,this.nodes.forEach(yj),this.nodes.forEach(Mj),this.nodes.forEach(Ej),this.nodes.forEach(xj),hj(Ia)},this.hasProjected=!1,this.isVisible=!0,this.animationProgress=0,this.sharedNodes=new Map,this.latestValues=o,this.root=a?a.root||a:this,this.path=a?[...a.path,a]:[],this.parent=a,this.depth=a?a.depth+1:0;for(let l=0;l<this.path.length;l++)this.path[l].shouldResetTransform=!0;this.root===this&&(this.nodes=new uj)}addEventListener(o,a){return this.eventHandlers.has(o)||this.eventHandlers.set(o,new E1),this.eventHandlers.get(o).add(a)}notifyListeners(o,...a){const l=this.eventHandlers.get(o);l&&l.notify(...a)}hasListeners(o){return this.eventHandlers.has(o)}mount(o,a=this.root.hasTreeAnimated){if(this.instance)return;this.isSVG=dj(o),this.instance=o;const{layoutId:l,layout:u,visualElement:h}=this.options;if(h&&!h.current&&h.mount(o),this.root.nodes.add(this),this.parent&&this.parent.children.add(this),a&&(u||l)&&(this.isLayoutDirty=!0),n){let d;const p=()=>this.root.updateBlockedByResize=!1;n(o,()=>{this.root.updateBlockedByResize=!0,d&&d(),d=fj(p,250),_m.hasAnimatedSinceResize&&(_m.hasAnimatedSinceResize=!1,this.nodes.forEach(vb))})}l&&this.root.registerSharedNode(l,this),this.options.animate!==!1&&h&&(l||u)&&this.addEventListener("didUpdate",({delta:d,hasLayoutChanged:p,hasRelativeTargetChanged:m,layout:y})=>{if(this.isTreeAnimationBlocked()){this.target=void 0,this.relativeTarget=void 0;return}const M=this.options.transition||h.getDefaultTransition()||Rj,{onLayoutAnimationStart:_,onLayoutAnimationComplete:g}=h.getProps(),x=!this.targetLayout||!tA(this.targetLayout,y)||m,S=!p&&m;if(this.options.layoutRoot||this.resumeFrom&&this.resumeFrom.instance||S||p&&(x||!this.currentAnimation)){this.resumeFrom&&(this.resumingFrom=this.resumeFrom,this.resumingFrom.resumingFrom=void 0),this.setAnimationOrigin(d,S);const E={...DI(M,"layout"),onPlay:_,onComplete:g};(h.shouldReduceMotion||this.options.layoutRoot)&&(E.delay=0,E.type=!1),this.startAnimation(E)}else p||vb(this),this.isLead()&&this.options.onExitComplete&&this.options.onExitComplete();this.targetLayout=y})}unmount(){this.options.layoutId&&this.willUpdate(),this.root.nodes.remove(this);const o=this.getStack();o&&o.remove(this),this.parent&&this.parent.children.delete(this),this.instance=void 0,qs(this.updateProjection)}blockUpdate(){this.updateManuallyBlocked=!0}unblockUpdate(){this.updateManuallyBlocked=!1}isUpdateBlocked(){return this.updateManuallyBlocked||this.updateBlockedByResize}isTreeAnimationBlocked(){return this.isAnimationBlocked||this.parent&&this.parent.isTreeAnimationBlocked()||!1}startUpdate(){this.isUpdateBlocked()||(this.isUpdating=!0,this.nodes&&this.nodes.forEach(wj),this.animationId++)}getTransformTemplate(){const{visualElement:o}=this.options;return o&&o.getProps().transformTemplate}willUpdate(o=!0){if(this.root.hasTreeAnimated=!0,this.root.isUpdateBlocked()){this.options.onExitComplete&&this.options.onExitComplete();return}if(!this.root.isUpdating&&this.root.startUpdate(),this.isLayoutDirty)return;this.isLayoutDirty=!0;for(let h=0;h<this.path.length;h++){const d=this.path[h];d.shouldResetTransform=!0,d.updateScroll("snapshot"),d.options.layoutRoot&&d.willUpdate(!1)}const{layoutId:a,layout:l}=this.options;if(a===void 0&&!l)return;const u=this.getTransformTemplate();this.prevTransformTemplateValue=u?u(this.latestValues,""):void 0,this.updateSnapshot(),o&&this.notifyListeners("willUpdate")}update(){if(this.updateScheduled=!1,this.isUpdateBlocked()){this.unblockUpdate(),this.clearAllSnapshots(),this.nodes.forEach(gb);return}this.isUpdating||this.nodes.forEach(Aj),this.isUpdating=!1,this.nodes.forEach(Sj),this.nodes.forEach(gj),this.nodes.forEach(vj),this.clearAllSnapshots();const a=performance.now();tn.delta=Zo(0,1e3/60,a-tn.timestamp),tn.timestamp=a,tn.isProcessing=!0,Nc.update.process(tn),Nc.preRender.process(tn),Nc.render.process(tn),tn.isProcessing=!1}didUpdate(){this.updateScheduled||(this.updateScheduled=!0,queueMicrotask(()=>this.update()))}clearAllSnapshots(){this.nodes.forEach(_j),this.sharedNodes.forEach(Tj)}scheduleUpdateProjection(){an.preRender(this.updateProjection,!1,!0)}scheduleCheckAfterUnmount(){an.postRender(()=>{this.isLayoutDirty?this.root.didUpdate():this.root.checkUpdateFailed()})}updateSnapshot(){this.snapshot||!this.instance||(this.snapshot=this.measure())}updateLayout(){if(!this.instance||(this.updateScroll(),!(this.options.alwaysMeasureLayout&&this.isLead())&&!this.isLayoutDirty))return;if(this.resumeFrom&&!this.resumeFrom.instance)for(let l=0;l<this.path.length;l++)this.path[l].updateScroll();const o=this.layout;this.layout=this.measure(!1),this.layoutCorrected=wn(),this.isLayoutDirty=!1,this.projectionDelta=void 0,this.notifyListeners("measure",this.layout.layoutBox);const{visualElement:a}=this.options;a&&a.notify("LayoutMeasure",this.layout.layoutBox,o?o.layoutBox:void 0)}updateScroll(o="measure"){let a=!!(this.options.layoutScroll&&this.instance);this.scroll&&this.scroll.animationId===this.root.animationId&&this.scroll.phase===o&&(a=!1),a&&(this.scroll={animationId:this.root.animationId,phase:o,isRoot:i(this.instance),offset:t(this.instance)})}resetTransform(){if(!r)return;const o=this.isLayoutDirty||this.shouldResetTransform,a=this.projectionDelta&&!JI(this.projectionDelta),l=this.getTransformTemplate(),u=l?l(this.latestValues,""):void 0,h=u!==this.prevTransformTemplateValue;o&&(a||La(this.latestValues)||h)&&(r(this.instance,u),this.shouldResetTransform=!1,this.scheduleRender())}measure(o=!0){const a=this.measurePageBox();let l=this.removeElementScroll(a);return o&&(l=this.removeTransform(l)),Pj(l),{animationId:this.root.animationId,measuredBox:a,layoutBox:l,latestValues:{},source:this.id}}measurePageBox(){const{visualElement:o}=this.options;if(!o)return wn();const a=o.measureViewportBox(),{scroll:l}=this.root;return l&&(Eo(a.x,l.offset.x),Eo(a.y,l.offset.y)),a}removeElementScroll(o){const a=wn();cr(a,o);for(let l=0;l<this.path.length;l++){const u=this.path[l],{scroll:h,options:d}=u;if(u!==this.root&&h&&d.layoutScroll){if(h.isRoot){cr(a,o);const{scroll:p}=this.root;p&&(Eo(a.x,-p.offset.x),Eo(a.y,-p.offset.y))}Eo(a.x,h.offset.x),Eo(a.y,h.offset.y)}}return a}applyTransform(o,a=!1){const l=wn();cr(l,o);for(let u=0;u<this.path.length;u++){const h=this.path[u];!a&&h.options.layoutScroll&&h.scroll&&h!==h.root&&Ec(l,{x:-h.scroll.offset.x,y:-h.scroll.offset.y}),La(h.latestValues)&&Ec(l,h.latestValues)}return La(this.latestValues)&&Ec(l,this.latestValues),l}removeTransform(o){const a=wn();cr(a,o);for(let l=0;l<this.path.length;l++){const u=this.path[l];if(!u.instance||!La(u.latestValues))continue;$_(u.latestValues)&&u.updateSnapshot();const h=wn(),d=u.measurePageBox();cr(h,d),ub(a,u.latestValues,u.snapshot?u.snapshot.layoutBox:void 0,h)}return La(this.latestValues)&&ub(a,this.latestValues),a}setTargetDelta(o){this.targetDelta=o,this.root.scheduleUpdateProjection(),this.isProjectionDirty=!0}setOptions(o){this.options={...this.options,...o,crossfade:o.crossfade!==void 0?o.crossfade:!0}}clearMeasurements(){this.scroll=void 0,this.layout=void 0,this.snapshot=void 0,this.prevTransformTemplateValue=void 0,this.targetDelta=void 0,this.target=void 0,this.isLayoutDirty=!1}forceRelativeParentToResolveTarget(){this.relativeParent&&this.relativeParent.resolvedRelativeTargetAt!==tn.timestamp&&this.relativeParent.resolveTargetDelta(!0)}resolveTargetDelta(o=!1){var a;const l=this.getLead();this.isProjectionDirty||(this.isProjectionDirty=l.isProjectionDirty),this.isTransformDirty||(this.isTransformDirty=l.isTransformDirty),this.isSharedProjectionDirty||(this.isSharedProjectionDirty=l.isSharedProjectionDirty);const u=!!this.resumingFrom||this!==l;if(!(o||u&&this.isSharedProjectionDirty||this.isProjectionDirty||!((a=this.parent)===null||a===void 0)&&a.isProjectionDirty||this.attemptToResolveRelativeTarget))return;const{layout:d,layoutId:p}=this.options;if(!(!this.layout||!(d||p))){if(this.resolvedRelativeTargetAt=tn.timestamp,!this.targetDelta&&!this.relativeTarget){const m=this.getClosestProjectingParent();m&&m.layout&&this.animationProgress!==1?(this.relativeParent=m,this.forceRelativeParentToResolveTarget(),this.relativeTarget=wn(),this.relativeTargetOrigin=wn(),Df(this.relativeTargetOrigin,this.layout.layoutBox,m.layout.layoutBox),cr(this.relativeTarget,this.relativeTargetOrigin)):this.relativeParent=this.relativeTarget=void 0}if(!(!this.relativeTarget&&!this.targetDelta)){if(this.target||(this.target=wn(),this.targetWithTransforms=wn()),this.relativeTarget&&this.relativeTargetOrigin&&this.relativeParent&&this.relativeParent.target?(this.forceRelativeParentToResolveTarget(),I6(this.target,this.relativeTarget,this.relativeParent.target)):this.targetDelta?(this.resumingFrom?this.target=this.applyTransform(this.layout.layoutBox):cr(this.target,this.layout.layoutBox),GI(this.target,this.targetDelta)):cr(this.target,this.layout.layoutBox),this.attemptToResolveRelativeTarget){this.attemptToResolveRelativeTarget=!1;const m=this.getClosestProjectingParent();m&&!!m.resumingFrom==!!this.resumingFrom&&!m.options.layoutScroll&&m.target&&this.animationProgress!==1?(this.relativeParent=m,this.forceRelativeParentToResolveTarget(),this.relativeTarget=wn(),this.relativeTargetOrigin=wn(),Df(this.relativeTargetOrigin,this.target,m.target),cr(this.relativeTarget,this.relativeTargetOrigin)):this.relativeParent=this.relativeTarget=void 0}Ia.resolvedTargetDeltas++}}}getClosestProjectingParent(){if(!(!this.parent||$_(this.parent.latestValues)||zI(this.parent.latestValues)))return this.parent.isProjecting()?this.parent:this.parent.getClosestProjectingParent()}isProjecting(){return!!((this.relativeTarget||this.targetDelta||this.options.layoutRoot)&&this.layout)}calcProjection(){var o;const a=this.getLead(),l=!!this.resumingFrom||this!==a;let u=!0;if((this.isProjectionDirty||!((o=this.parent)===null||o===void 0)&&o.isProjectionDirty)&&(u=!1),l&&(this.isSharedProjectionDirty||this.isTransformDirty)&&(u=!1),this.resolvedRelativeTargetAt===tn.timestamp&&(u=!1),u)return;const{layout:h,layoutId:d}=this.options;if(this.isTreeAnimating=!!(this.parent&&this.parent.isTreeAnimating||this.currentAnimation||this.pendingAnimation),this.isTreeAnimating||(this.targetDelta=this.relativeTarget=void 0),!this.layout||!(h||d))return;cr(this.layoutCorrected,this.layout.layoutBox);const p=this.treeScale.x,m=this.treeScale.y;G6(this.layoutCorrected,this.treeScale,this.path,l),a.layout&&!a.target&&(this.treeScale.x!==1||this.treeScale.y!==1)&&(a.target=a.layout.layoutBox);const{target:y}=a;if(!y){this.projectionTransform&&(this.projectionDelta=Mc(),this.projectionTransform="none",this.scheduleRender());return}this.projectionDelta||(this.projectionDelta=Mc(),this.projectionDeltaWithTransform=Mc());const M=this.projectionTransform;If(this.projectionDelta,this.layoutCorrected,y,this.latestValues),this.projectionTransform=db(this.projectionDelta,this.treeScale),(this.projectionTransform!==M||this.treeScale.x!==p||this.treeScale.y!==m)&&(this.hasProjected=!0,this.scheduleRender(),this.notifyListeners("projectionUpdate",y)),Ia.recalculatedProjection++}hide(){this.isVisible=!1}show(){this.isVisible=!0}scheduleRender(o=!0){if(this.options.scheduleRender&&this.options.scheduleRender(),o){const a=this.getStack();a&&a.scheduleRender()}this.resumingFrom&&!this.resumingFrom.instance&&(this.resumingFrom=void 0)}setAnimationOrigin(o,a=!1){const l=this.snapshot,u=l?l.latestValues:{},h={...this.latestValues},d=Mc();(!this.relativeParent||!this.relativeParent.options.layoutRoot)&&(this.relativeTarget=this.relativeTargetOrigin=void 0),this.attemptToResolveRelativeTarget=!a;const p=wn(),m=l?l.source:void 0,y=this.layout?this.layout.source:void 0,M=m!==y,_=this.getStack(),g=!_||_.members.length<=1,x=!!(M&&!g&&this.options.crossfade===!0&&!this.path.some(bj));this.animationProgress=0;let S;this.mixTargetDelta=E=>{const C=E/1e3;yb(d.x,o.x,C),yb(d.y,o.y,C),this.setTargetDelta(d),this.relativeTarget&&this.relativeTargetOrigin&&this.layout&&this.relativeParent&&this.relativeParent.layout&&(Df(p,this.layout.layoutBox,this.relativeParent.layout.layoutBox),Cj(this.relativeTarget,this.relativeTargetOrigin,p,C),S&&tA(this.relativeTarget,S)&&(this.isProjectionDirty=!1),S||(S=wn()),cr(S,this.relativeTarget)),M&&(this.animationValues=h,nj(h,u,this.latestValues,C,x,g)),this.root.scheduleUpdateProjection(),this.scheduleRender(),this.animationProgress=C},this.mixTargetDelta(this.options.layoutRoot?1e3:0)}startAnimation(o){this.notifyListeners("animationStart"),this.currentAnimation&&this.currentAnimation.stop(),this.resumingFrom&&this.resumingFrom.currentAnimation&&this.resumingFrom.currentAnimation.stop(),this.pendingAnimation&&(qs(this.pendingAnimation),this.pendingAnimation=void 0),this.pendingAnimation=an.update(()=>{_m.hasAnimatedSinceResize=!0,this.currentAnimation=pj(0,mb,{...o,onUpdate:a=>{this.mixTargetDelta(a),o.onUpdate&&o.onUpdate(a)},onComplete:()=>{o.onComplete&&o.onComplete(),this.completeAnimation()}}),this.resumingFrom&&(this.resumingFrom.currentAnimation=this.currentAnimation),this.pendingAnimation=void 0})}completeAnimation(){this.resumingFrom&&(this.resumingFrom.currentAnimation=void 0,this.resumingFrom.preserveOpacity=void 0);const o=this.getStack();o&&o.exitAnimationComplete(),this.resumingFrom=this.currentAnimation=this.animationValues=void 0,this.notifyListeners("animationComplete")}finishAnimation(){this.currentAnimation&&(this.mixTargetDelta&&this.mixTargetDelta(mb),this.currentAnimation.stop()),this.completeAnimation()}applyTransformsToTarget(){const o=this.getLead();let{targetWithTransforms:a,target:l,layout:u,latestValues:h}=o;if(!(!a||!l||!u)){if(this!==o&&this.layout&&u&&YI(this.options.animationType,this.layout.layoutBox,u.layoutBox)){l=this.target||wn();const d=Qi(this.layout.layoutBox.x);l.x.min=o.target.x.min,l.x.max=l.x.min+d;const p=Qi(this.layout.layoutBox.y);l.y.min=o.target.y.min,l.y.max=l.y.min+p}cr(a,l),Ec(a,h),If(this.projectionDeltaWithTransform,this.layoutCorrected,a,h)}}registerSharedNode(o,a){this.sharedNodes.has(o)||this.sharedNodes.set(o,new lj),this.sharedNodes.get(o).add(a);const u=a.options.initialPromotionConfig;a.promote({transition:u?u.transition:void 0,preserveFollowOpacity:u&&u.shouldPreserveFollowOpacity?u.shouldPreserveFollowOpacity(a):void 0})}isLead(){const o=this.getStack();return o?o.lead===this:!0}getLead(){var o;const{layoutId:a}=this.options;return a?((o=this.getStack())===null||o===void 0?void 0:o.lead)||this:this}getPrevLead(){var o;const{layoutId:a}=this.options;return a?(o=this.getStack())===null||o===void 0?void 0:o.prevLead:void 0}getStack(){const{layoutId:o}=this.options;if(o)return this.root.sharedNodes.get(o)}promote({needsReset:o,transition:a,preserveFollowOpacity:l}={}){const u=this.getStack();u&&u.promote(this,l),o&&(this.projectionDelta=void 0,this.needsReset=!0),a&&this.setOptions({transition:a})}relegate(){const o=this.getStack();return o?o.relegate(this):!1}resetRotation(){const{visualElement:o}=this.options;if(!o)return;let a=!1;const{latestValues:l}=o;if((l.rotate||l.rotateX||l.rotateY||l.rotateZ)&&(a=!0),!a)return;const u={};for(let h=0;h<pb.length;h++){const d="rotate"+pb[h];l[d]&&(u[d]=l[d],o.setStaticValue(d,0))}o.render();for(const h in u)o.setStaticValue(h,u[h]);o.scheduleRender()}getProjectionStyles(o={}){var a,l;const u={};if(!this.instance||this.isSVG)return u;if(this.isVisible)u.visibility="";else return{visibility:"hidden"};const h=this.getTransformTemplate();if(this.needsReset)return this.needsReset=!1,u.opacity="",u.pointerEvents=xm(o.pointerEvents)||"",u.transform=h?h(this.latestValues,""):"none",u;const d=this.getLead();if(!this.projectionDelta||!this.layout||!d.target){const M={};return this.options.layoutId&&(M.opacity=this.latestValues.opacity!==void 0?this.latestValues.opacity:1,M.pointerEvents=xm(o.pointerEvents)||""),this.hasProjected&&!La(this.latestValues)&&(M.transform=h?h({},""):"none",this.hasProjected=!1),M}const p=d.animationValues||d.latestValues;this.applyTransformsToTarget(),u.transform=db(this.projectionDeltaWithTransform,this.treeScale,p),h&&(u.transform=h(p,u.transform));const{x:m,y}=this.projectionDelta;u.transformOrigin=`${m.origin*100}% ${y.origin*100}% 0`,d.animationValues?u.opacity=d===this?(l=(a=p.opacity)!==null&&a!==void 0?a:this.latestValues.opacity)!==null&&l!==void 0?l:1:this.preserveOpacity?this.latestValues.opacity:p.opacityExit:u.opacity=d===this?p.opacity!==void 0?p.opacity:"":p.opacityExit!==void 0?p.opacityExit:0;for(const M in eg){if(p[M]===void 0)continue;const{correct:_,applyTo:g}=eg[M],x=u.transform==="none"?p[M]:_(p[M],d);if(g){const S=g.length;for(let E=0;E<S;E++)u[g[E]]=x}else u[M]=x}return this.options.layoutId&&(u.pointerEvents=d===this?xm(o.pointerEvents)||"":"none"),u}clearSnapshot(){this.resumeFrom=this.snapshot=void 0}resetTree(){this.root.nodes.forEach(o=>{var a;return(a=o.currentAnimation)===null||a===void 0?void 0:a.stop()}),this.root.nodes.forEach(gb),this.root.sharedNodes.clear()}}}function gj(n){n.updateLayout()}function vj(n){var e;const t=((e=n.resumeFrom)===null||e===void 0?void 0:e.snapshot)||n.snapshot;if(n.isLead()&&n.layout&&t&&n.hasListeners("didUpdate")){const{layoutBox:i,measuredBox:r}=n.layout,{animationType:s}=n.options,o=t.source!==n.layout.source;s==="size"?os(d=>{const p=o?t.measuredBox[d]:t.layoutBox[d],m=Qi(p);p.min=i[d].min,p.max=p.min+m}):YI(s,t.layoutBox,i)&&os(d=>{const p=o?t.measuredBox[d]:t.layoutBox[d],m=Qi(i[d]);p.max=p.min+m,n.relativeTarget&&!n.currentAnimation&&(n.isProjectionDirty=!0,n.relativeTarget[d].max=n.relativeTarget[d].min+m)});const a=Mc();If(a,i,t.layoutBox);const l=Mc();o?If(l,n.applyTransform(r,!0),t.measuredBox):If(l,i,t.layoutBox);const u=!JI(a);let h=!1;if(!n.resumeFrom){const d=n.getClosestProjectingParent();if(d&&!d.resumeFrom){const{snapshot:p,layout:m}=d;if(p&&m){const y=wn();Df(y,t.layoutBox,p.layoutBox);const M=wn();Df(M,i,m.layoutBox),tA(y,M)||(h=!0),d.options.layoutRoot&&(n.relativeTarget=M,n.relativeTargetOrigin=y,n.relativeParent=d)}}}n.notifyListeners("didUpdate",{layout:i,snapshot:t,delta:l,layoutDelta:a,hasLayoutChanged:u,hasRelativeTargetChanged:h})}else if(n.isLead()){const{onExitComplete:i}=n.options;i&&i()}n.options.transition=void 0}function yj(n){Ia.totalNodes++,n.parent&&(n.isProjecting()||(n.isProjectionDirty=n.parent.isProjectionDirty),n.isSharedProjectionDirty||(n.isSharedProjectionDirty=!!(n.isProjectionDirty||n.parent.isProjectionDirty||n.parent.isSharedProjectionDirty)),n.isTransformDirty||(n.isTransformDirty=n.parent.isTransformDirty))}function xj(n){n.isProjectionDirty=n.isSharedProjectionDirty=n.isTransformDirty=!1}function _j(n){n.clearSnapshot()}function gb(n){n.clearMeasurements()}function Aj(n){n.isLayoutDirty=!1}function Sj(n){const{visualElement:e}=n.options;e&&e.getProps().onBeforeLayoutMeasure&&e.notify("BeforeLayoutMeasure"),n.resetTransform()}function vb(n){n.finishAnimation(),n.targetDelta=n.relativeTarget=n.target=void 0,n.isProjectionDirty=!0}function Mj(n){n.resolveTargetDelta()}function Ej(n){n.calcProjection()}function wj(n){n.resetRotation()}function Tj(n){n.removeLeadSnapshot()}function yb(n,e,t){n.translate=on(e.translate,0,t),n.scale=on(e.scale,1,t),n.origin=e.origin,n.originPoint=e.originPoint}function xb(n,e,t,i){n.min=on(e.min,t.min,i),n.max=on(e.max,t.max,i)}function Cj(n,e,t,i){xb(n.x,e.x,t.x,i),xb(n.y,e.y,t.y,i)}function bj(n){return n.animationValues&&n.animationValues.opacityExit!==void 0}const Rj={duration:.45,ease:[.4,0,.1,1]};function _b(n){n.min=Math.round(n.min),n.max=Math.round(n.max)}function Pj(n){_b(n.x),_b(n.y)}function YI(n,e,t){return n==="position"||n==="preserve-aspect"&&!Z_(hb(e),hb(t),.2)}const Bj=KI({attachResizeListener:(n,e)=>Gs(n,"resize",e),measureScroll:()=>({x:document.documentElement.scrollLeft||document.body.scrollLeft,y:document.documentElement.scrollTop||document.body.scrollTop}),checkIsScrollRoot:()=>!0}),Yy={current:void 0},QI=KI({measureScroll:n=>({x:n.scrollLeft,y:n.scrollTop}),defaultParent:()=>{if(!Yy.current){const n=new Bj({});n.mount(window),n.setOptions({layoutScroll:!0}),Yy.current=n}return Yy.current},resetTransform:(n,e)=>{n.style.transform=e!==void 0?e:"none"},checkIsScrollRoot:n=>window.getComputedStyle(n).position==="fixed"}),Lj={pan:{Feature:Q6},drag:{Feature:Y6,ProjectionNode:QI,MeasureLayout:WI}},Ij=/var\((--[a-zA-Z0-9-_]+),? ?([a-zA-Z0-9 ()%#.,-]+)?\)/;function Dj(n){const e=Ij.exec(n);if(!e)return[,];const[,t,i]=e;return[t,i]}function nA(n,e,t=1){const[i,r]=Dj(n);if(!i)return;const s=window.getComputedStyle(e).getPropertyValue(i);return s?s.trim():V_(r)?nA(r,e,t+1):r}function Fj(n,{...e},t){const i=n.current;if(!(i instanceof Element))return{target:e,transitionEnd:t};t&&(t={...t}),n.values.forEach(r=>{const s=r.get();if(!V_(s))return;const o=nA(s,i);o&&r.set(o)});for(const r in e){const s=e[r];if(!V_(s))continue;const o=nA(s,i);o&&(e[r]=o,t||(t={}),t[r]===void 0&&(t[r]=s))}return{target:e,transitionEnd:t}}const Nj=new Set(["width","height","top","left","right","bottom","x","y","translateX","translateY"]),ZI=n=>Nj.has(n),Oj=n=>Object.keys(n).some(ZI),Ab=n=>n===ml||n===it,Sb=(n,e)=>parseFloat(n.split(", ")[e]),Mb=(n,e)=>(t,{transform:i})=>{if(i==="none"||!i)return 0;const r=i.match(/^matrix3d\((.+)\)$/);if(r)return Sb(r[1],e);{const s=i.match(/^matrix\((.+)\)$/);return s?Sb(s[1],n):0}},Uj=new Set(["x","y","z"]),kj=kh.filter(n=>!Uj.has(n));function Hj(n){const e=[];return kj.forEach(t=>{const i=n.getValue(t);i!==void 0&&(e.push([t,i.get()]),i.set(t.startsWith("scale")?1:0))}),e.length&&n.render(),e}const ru={width:({x:n},{paddingLeft:e="0",paddingRight:t="0"})=>n.max-n.min-parseFloat(e)-parseFloat(t),height:({y:n},{paddingTop:e="0",paddingBottom:t="0"})=>n.max-n.min-parseFloat(e)-parseFloat(t),top:(n,{top:e})=>parseFloat(e),left:(n,{left:e})=>parseFloat(e),bottom:({y:n},{top:e})=>parseFloat(e)+(n.max-n.min),right:({x:n},{left:e})=>parseFloat(e)+(n.max-n.min),x:Mb(4,13),y:Mb(5,14)};ru.translateX=ru.x;ru.translateY=ru.y;const zj=(n,e,t)=>{const i=e.measureViewportBox(),r=e.current,s=getComputedStyle(r),{display:o}=s,a={};o==="none"&&e.setStaticValue("display",n.display||"block"),t.forEach(u=>{a[u]=ru[u](i,s)}),e.render();const l=e.measureViewportBox();return t.forEach(u=>{const h=e.getValue(u);h&&h.jump(a[u]),n[u]=ru[u](l,s)}),n},Gj=(n,e,t={},i={})=>{e={...e},i={...i};const r=Object.keys(e).filter(ZI);let s=[],o=!1;const a=[];if(r.forEach(l=>{const u=n.getValue(l);if(!n.hasValue(l))return;let h=t[l],d=rf(h);const p=e[l];let m;if(ng(p)){const y=p.length,M=p[0]===null?1:0;h=p[M],d=rf(h);for(let _=M;_<y&&p[_]!==null;_++)m?g1(rf(p[_])===m):m=rf(p[_])}else m=rf(p);if(d!==m)if(Ab(d)&&Ab(m)){const y=u.get();typeof y=="string"&&u.set(parseFloat(y)),typeof p=="string"?e[l]=parseFloat(p):Array.isArray(p)&&m===it&&(e[l]=p.map(parseFloat))}else d!=null&&d.transform&&(m!=null&&m.transform)&&(h===0||p===0)?h===0?u.set(m.transform(h)):e[l]=d.transform(p):(o||(s=Hj(n),o=!0),a.push(l),i[l]=i[l]!==void 0?i[l]:e[l],u.jump(p))}),a.length){const l=a.indexOf("height")>=0?window.pageYOffset:null,u=zj(e,n,a);return s.length&&s.forEach(([h,d])=>{n.getValue(h).set(d)}),n.render(),n0&&l!==null&&window.scrollTo({top:l}),{target:u,transitionEnd:i}}else return{target:e,transitionEnd:i}};function Vj(n,e,t,i){return Oj(e)?Gj(n,e,t,i):{target:e,transitionEnd:i}}const Wj=(n,e,t,i)=>{const r=Fj(n,e,i);return e=r.target,i=r.transitionEnd,Vj(n,e,t,i)},iA={current:null},qI={current:!1};function jj(){if(qI.current=!0,!!n0)if(window.matchMedia){const n=window.matchMedia("(prefers-reduced-motion)"),e=()=>iA.current=n.matches;n.addListener(e),e()}else iA.current=!1}function Xj(n,e,t){const{willChange:i}=e;for(const r in e){const s=e[r],o=t[r];if(Bi(s))n.addValue(r,s),og(i)&&i.add(r);else if(Bi(o))n.addValue(r,iu(s,{owner:n})),og(i)&&i.remove(r);else if(o!==s)if(n.hasValue(r)){const a=n.getValue(r);!a.hasAnimated&&a.set(s)}else{const a=n.getStaticValue(r);n.addValue(r,iu(a!==void 0?a:s,{owner:n}))}}for(const r in t)e[r]===void 0&&n.removeValue(r);return e}const Eb=new WeakMap,$I=Object.keys(hh),Jj=$I.length,wb=["AnimationStart","AnimationComplete","Update","BeforeLayoutMeasure","LayoutMeasure","LayoutAnimationStart","LayoutAnimationComplete"],Kj=a1.length;class Yj{constructor({parent:e,props:t,presenceContext:i,reducedMotionConfig:r,visualState:s},o={}){this.current=null,this.children=new Set,this.isVariantNode=!1,this.isControllingVariants=!1,this.shouldReduceMotion=null,this.values=new Map,this.features={},this.valueSubscriptions=new Map,this.prevMotionValues={},this.events={},this.propEventSubscriptions={},this.notifyUpdate=()=>this.notify("Update",this.latestValues),this.render=()=>{this.current&&(this.triggerBuild(),this.renderInstance(this.current,this.renderState,this.props.style,this.projection))},this.scheduleRender=()=>an.render(this.render,!1,!0);const{latestValues:a,renderState:l}=s;this.latestValues=a,this.baseTarget={...a},this.initialValues=t.initial?{...a}:{},this.renderState=l,this.parent=e,this.props=t,this.presenceContext=i,this.depth=e?e.depth+1:0,this.reducedMotionConfig=r,this.options=o,this.isControllingVariants=r0(t),this.isVariantNode=OL(t),this.isVariantNode&&(this.variantChildren=new Set),this.manuallyAnimateOnMount=!!(e&&e.current);const{willChange:u,...h}=this.scrapeMotionValuesFromProps(t,{});for(const d in h){const p=h[d];a[d]!==void 0&&Bi(p)&&(p.set(a[d],!1),og(u)&&u.add(d))}}scrapeMotionValuesFromProps(e,t){return{}}mount(e){this.current=e,Eb.set(e,this),this.projection&&!this.projection.instance&&this.projection.mount(e),this.parent&&this.isVariantNode&&!this.isControllingVariants&&(this.removeFromVariantTree=this.parent.addVariantChild(this)),this.values.forEach((t,i)=>this.bindToMotionValue(i,t)),qI.current||jj(),this.shouldReduceMotion=this.reducedMotionConfig==="never"?!1:this.reducedMotionConfig==="always"?!0:iA.current,this.parent&&this.parent.children.add(this),this.update(this.props,this.presenceContext)}unmount(){Eb.delete(this.current),this.projection&&this.projection.unmount(),qs(this.notifyUpdate),qs(this.render),this.valueSubscriptions.forEach(e=>e()),this.removeFromVariantTree&&this.removeFromVariantTree(),this.parent&&this.parent.children.delete(this);for(const e in this.events)this.events[e].clear();for(const e in this.features)this.features[e].unmount();this.current=null}bindToMotionValue(e,t){const i=pl.has(e),r=t.on("change",o=>{this.latestValues[e]=o,this.props.onUpdate&&an.update(this.notifyUpdate,!1,!0),i&&this.projection&&(this.projection.isTransformDirty=!0)}),s=t.on("renderRequest",this.scheduleRender);this.valueSubscriptions.set(e,()=>{r(),s()})}sortNodePosition(e){return!this.current||!this.sortInstanceNodePosition||this.type!==e.type?0:this.sortInstanceNodePosition(this.current,e.current)}loadFeatures({children:e,...t},i,r,s){let o,a;for(let l=0;l<Jj;l++){const u=$I[l],{isEnabled:h,Feature:d,ProjectionNode:p,MeasureLayout:m}=hh[u];p&&(o=p),h(t)&&(!this.features[u]&&d&&(this.features[u]=new d(this)),m&&(a=m))}if(!this.projection&&o){this.projection=new o(this.latestValues,this.parent&&this.parent.projection);const{layoutId:l,layout:u,drag:h,dragConstraints:d,layoutScroll:p,layoutRoot:m}=t;this.projection.setOptions({layoutId:l,layout:u,alwaysMeasureLayout:!!h||d&&Ac(d),visualElement:this,scheduleRender:()=>this.scheduleRender(),animationType:typeof u=="string"?u:"both",initialPromotionConfig:s,layoutScroll:p,layoutRoot:m})}return a}updateFeatures(){for(const e in this.features){const t=this.features[e];t.isMounted?t.update():(t.mount(),t.isMounted=!0)}}triggerBuild(){this.build(this.renderState,this.latestValues,this.options,this.props)}measureViewportBox(){return this.current?this.measureInstanceViewportBox(this.current,this.props):wn()}getStaticValue(e){return this.latestValues[e]}setStaticValue(e,t){this.latestValues[e]=t}makeTargetAnimatable(e,t=!0){return this.makeTargetAnimatableFromInstance(e,this.props,t)}update(e,t){(e.transformTemplate||this.props.transformTemplate)&&this.scheduleRender(),this.prevProps=this.props,this.props=e,this.prevPresenceContext=this.presenceContext,this.presenceContext=t;for(let i=0;i<wb.length;i++){const r=wb[i];this.propEventSubscriptions[r]&&(this.propEventSubscriptions[r](),delete this.propEventSubscriptions[r]);const s=e["on"+r];s&&(this.propEventSubscriptions[r]=this.on(r,s))}this.prevMotionValues=Xj(this,this.scrapeMotionValuesFromProps(e,this.prevProps),this.prevMotionValues),this.handleChildMotionValue&&this.handleChildMotionValue()}getProps(){return this.props}getVariant(e){return this.props.variants?this.props.variants[e]:void 0}getDefaultTransition(){return this.props.transition}getTransformPagePoint(){return this.props.transformPagePoint}getClosestVariantNode(){return this.isVariantNode?this:this.parent?this.parent.getClosestVariantNode():void 0}getVariantContext(e=!1){if(e)return this.parent?this.parent.getVariantContext():void 0;if(!this.isControllingVariants){const i=this.parent?this.parent.getVariantContext()||{}:{};return this.props.initial!==void 0&&(i.initial=this.props.initial),i}const t={};for(let i=0;i<Kj;i++){const r=a1[i],s=this.props[r];(fh(s)||s===!1)&&(t[r]=s)}return t}addVariantChild(e){const t=this.getClosestVariantNode();if(t)return t.variantChildren&&t.variantChildren.add(e),()=>t.variantChildren.delete(e)}addValue(e,t){t!==this.values.get(e)&&(this.removeValue(e),this.bindToMotionValue(e,t)),this.values.set(e,t),this.latestValues[e]=t.get()}removeValue(e){this.values.delete(e);const t=this.valueSubscriptions.get(e);t&&(t(),this.valueSubscriptions.delete(e)),delete this.latestValues[e],this.removeValueFromRenderState(e,this.renderState)}hasValue(e){return this.values.has(e)}getValue(e,t){if(this.props.values&&this.props.values[e])return this.props.values[e];let i=this.values.get(e);return i===void 0&&t!==void 0&&(i=iu(t,{owner:this}),this.addValue(e,i)),i}readValue(e){var t;return this.latestValues[e]!==void 0||!this.current?this.latestValues[e]:(t=this.getBaseTargetFromProps(this.props,e))!==null&&t!==void 0?t:this.readValueFromInstance(this.current,e,this.options)}setBaseTarget(e,t){this.baseTarget[e]=t}getBaseTarget(e){var t;const{initial:i}=this.props,r=typeof i=="string"||typeof i=="object"?(t=m1(this.props,i))===null||t===void 0?void 0:t[e]:void 0;if(i&&r!==void 0)return r;const s=this.getBaseTargetFromProps(this.props,e);return s!==void 0&&!Bi(s)?s:this.initialValues[e]!==void 0&&r===void 0?void 0:this.baseTarget[e]}on(e,t){return this.events[e]||(this.events[e]=new E1),this.events[e].add(t)}notify(e,...t){this.events[e]&&this.events[e].notify(...t)}}class eD extends Yj{sortInstanceNodePosition(e,t){return e.compareDocumentPosition(t)&2?1:-1}getBaseTargetFromProps(e,t){return e.style?e.style[t]:void 0}removeValueFromRenderState(e,{vars:t,style:i}){delete t[e],delete i[e]}makeTargetAnimatableFromInstance({transition:e,transitionEnd:t,...i},{transformValues:r},s){let o=m6(i,e||{},this);if(r&&(t&&(t=r(t)),i&&(i=r(i)),o&&(o=r(o))),s){const a=d6(this,i,o);r&&a&&(o=r(o));const l=Wj(this,i,o,t);t=l.transitionEnd,i=l.target}return{transition:e,transitionEnd:t,...i}}}function Qj(n){return window.getComputedStyle(n)}class Zj extends eD{readValueFromInstance(e,t){if(pl.has(t)){const i=_1(t);return i&&i.default||0}else{const i=Qj(e),r=(GL(t)?i.getPropertyValue(t):i[t])||0;return typeof r=="string"?r.trim():r}}measureInstanceViewportBox(e,{transformPagePoint:t}){return VI(e,t)}build(e,t,i,r){c1(e,t,i,r.transformTemplate)}scrapeMotionValuesFromProps(e,t){return p1(e,t)}handleChildMotionValue(){this.childSubscription&&(this.childSubscription(),delete this.childSubscription);const{children:e}=this.props;Bi(e)&&(this.childSubscription=e.on("change",t=>{this.current&&(this.current.textContent=`${t}`)}))}renderInstance(e,t,i,r){KL(e,t,i,r)}}class qj extends eD{constructor(){super(...arguments),this.isSVGTag=!1}getBaseTargetFromProps(e,t){return e[t]}readValueFromInstance(e,t){if(pl.has(t)){const i=_1(t);return i&&i.default||0}return t=YL.has(t)?t:d1(t),e.getAttribute(t)}measureInstanceViewportBox(){return wn()}scrapeMotionValuesFromProps(e,t){return ZL(e,t)}build(e,t,i,r){f1(e,t,i,this.isSVGTag,r.transformTemplate)}renderInstance(e,t,i,r){QL(e,t,i,r)}mount(e){this.isSVGTag=h1(e.tagName),super.mount(e)}}const $j=(n,e)=>l1(n)?new qj(e,{enableHardwareAcceleration:!1}):new Zj(e,{enableHardwareAcceleration:!0}),eX={layout:{ProjectionNode:QI,MeasureLayout:WI}},tX={...R6,...Q8,...Lj,...eX},$s=i8((n,e)=>I8(n,e,tX,$j)),mi={paddingX:"sm:px-16 px-3",paddingY:"sm:py-16 py-6",padding:"sm:px-16 px-6 sm:py-16 py-10",heroHeadText:"font-black text-white lg:text-[80px] sm:text-[60px] xs:text-[50px] text-[40px] lg:leading-[98px] mt-2",heroSubText:"text-[#dfd9ff] font-medium lg:text-[30px] sm:text-[26px] xs:text-[20px] text-[16px] lg:leading-[40px]",sectionHeadText:"text-white font-black md:text-[60px] sm:text-[50px] xs:text-[40px] text-[30px]",sectionSubText:"sm:text-[18px] text-[14px] text-secondary uppercase tracking-wider"},tD=n=>({hidden:{y:-50,opacity:0},show:{y:0,opacity:1,transition:{type:"spring",duration:1.25,delay:n}}}),w1=(n,e,t,i)=>({hidden:{x:n==="left"?100:n==="right"?-100:0,y:n==="up"?100:n==="down"?-100:0,opacity:0},show:{x:0,y:0,opacity:1,transition:{type:e,delay:t,duration:i,ease:"easeOut"}}}),Tb=(n,e,t,i)=>({hidden:{x:n==="left"?"-100%":n==="right"?"100%":0,y:n==="up"||n==="down"?"100%":0},show:{x:0,y:0,transition:{type:e,delay:t,duration:i,ease:"easeOut"}}}),nD=(n,e)=>({hidden:{},show:{transition:{staggerChildren:n,delayChildren:e||0}}});var nX=typeof Element<"u",iX=typeof Map=="function",rX=typeof Set=="function",sX=typeof ArrayBuffer=="function"&&!!ArrayBuffer.isView;function Am(n,e){if(n===e)return!0;if(n&&e&&typeof n=="object"&&typeof e=="object"){if(n.constructor!==e.constructor)return!1;var t,i,r;if(Array.isArray(n)){if(t=n.length,t!=e.length)return!1;for(i=t;i--!==0;)if(!Am(n[i],e[i]))return!1;return!0}var s;if(iX&&n instanceof Map&&e instanceof Map){if(n.size!==e.size)return!1;for(s=n.entries();!(i=s.next()).done;)if(!e.has(i.value[0]))return!1;for(s=n.entries();!(i=s.next()).done;)if(!Am(i.value[1],e.get(i.value[0])))return!1;return!0}if(rX&&n instanceof Set&&e instanceof Set){if(n.size!==e.size)return!1;for(s=n.entries();!(i=s.next()).done;)if(!e.has(i.value[0]))return!1;return!0}if(sX&&ArrayBuffer.isView(n)&&ArrayBuffer.isView(e)){if(t=n.length,t!=e.length)return!1;for(i=t;i--!==0;)if(n[i]!==e[i])return!1;return!0}if(n.constructor===RegExp)return n.source===e.source&&n.flags===e.flags;if(n.valueOf!==Object.prototype.valueOf&&typeof n.valueOf=="function"&&typeof e.valueOf=="function")return n.valueOf()===e.valueOf();if(n.toString!==Object.prototype.toString&&typeof n.toString=="function"&&typeof e.toString=="function")return n.toString()===e.toString();if(r=Object.keys(n),t=r.length,t!==Object.keys(e).length)return!1;for(i=t;i--!==0;)if(!Object.prototype.hasOwnProperty.call(e,r[i]))return!1;if(nX&&n instanceof Element)return!1;for(i=t;i--!==0;)if(!((r[i]==="_owner"||r[i]==="__v"||r[i]==="__o")&&n.$$typeof)&&!Am(n[r[i]],e[r[i]]))return!1;return!0}return n!==n&&e!==e}var oX=function(e,t){try{return Am(e,t)}catch(i){if((i.message||"").match(/stack|recursion/i))return console.warn("react-fast-compare cannot handle circular refs"),!1;throw i}};const aX=su(oX);var lX=function(n,e,t,i,r,s,o,a){if(!n){var l;if(e===void 0)l=new Error("Minified exception occurred; use the non-minified dev environment for the full error message and additional helpful warnings.");else{var u=[t,i,r,s,o,a],h=0;l=new Error(e.replace(/%s/g,function(){return u[h++]})),l.name="Invariant Violation"}throw l.framesToPop=1,l}},cX=lX;const Cb=su(cX);var uX=function(e,t,i,r){var s=i?i.call(r,e,t):void 0;if(s!==void 0)return!!s;if(e===t)return!0;if(typeof e!="object"||!e||typeof t!="object"||!t)return!1;var o=Object.keys(e),a=Object.keys(t);if(o.length!==a.length)return!1;for(var l=Object.prototype.hasOwnProperty.bind(t),u=0;u<o.length;u++){var h=o[u];if(!l(h))return!1;var d=e[h],p=t[h];if(s=i?i.call(r,d,p,h):void 0,s===!1||s===void 0&&d!==p)return!1}return!0};const fX=su(uX);var iD=(n=>(n.BASE="base",n.BODY="body",n.HEAD="head",n.HTML="html",n.LINK="link",n.META="meta",n.NOSCRIPT="noscript",n.SCRIPT="script",n.STYLE="style",n.TITLE="title",n.FRAGMENT="Symbol(react.fragment)",n))(iD||{}),Qy={link:{rel:["amphtml","canonical","alternate"]},script:{type:["application/ld+json"]},meta:{charset:"",name:["generator","robots","description"],property:["og:type","og:title","og:url","og:image","og:image:alt","og:description","twitter:url","twitter:title","twitter:description","twitter:image","twitter:image:alt","twitter:card","twitter:site"]}},bb=Object.values(iD),T1={accesskey:"accessKey",charset:"charSet",class:"className",contenteditable:"contentEditable",contextmenu:"contextMenu","http-equiv":"httpEquiv",itemprop:"itemProp",tabindex:"tabIndex"},hX=Object.entries(T1).reduce((n,[e,t])=>(n[t]=e,n),{}),Nr="data-rh",Oc={DEFAULT_TITLE:"defaultTitle",DEFER:"defer",ENCODE_SPECIAL_CHARACTERS:"encodeSpecialCharacters",ON_CHANGE_CLIENT_STATE:"onChangeClientState",TITLE_TEMPLATE:"titleTemplate",PRIORITIZE_SEO_TAGS:"prioritizeSeoTags"},Uc=(n,e)=>{for(let t=n.length-1;t>=0;t-=1){const i=n[t];if(Object.prototype.hasOwnProperty.call(i,e))return i[e]}return null},dX=n=>{let e=Uc(n,"title");const t=Uc(n,Oc.TITLE_TEMPLATE);if(Array.isArray(e)&&(e=e.join("")),t&&e)return t.replace(/%s/g,()=>e);const i=Uc(n,Oc.DEFAULT_TITLE);return e||i||void 0},pX=n=>Uc(n,Oc.ON_CHANGE_CLIENT_STATE)||(()=>{}),Zy=(n,e)=>e.filter(t=>typeof t[n]<"u").map(t=>t[n]).reduce((t,i)=>({...t,...i}),{}),mX=(n,e)=>e.filter(t=>typeof t.base<"u").map(t=>t.base).reverse().reduce((t,i)=>{if(!t.length){const r=Object.keys(i);for(let s=0;s<r.length;s+=1){const a=r[s].toLowerCase();if(n.indexOf(a)!==-1&&i[a])return t.concat(i)}}return t},[]),gX=n=>console&&typeof console.warn=="function"&&console.warn(n),of=(n,e,t)=>{const i={};return t.filter(r=>Array.isArray(r[n])?!0:(typeof r[n]<"u"&&gX(`Helmet: ${n} should be of type "Array". Instead found type "${typeof r[n]}"`),!1)).map(r=>r[n]).reverse().reduce((r,s)=>{const o={};s.filter(l=>{let u;const h=Object.keys(l);for(let p=0;p<h.length;p+=1){const m=h[p],y=m.toLowerCase();e.indexOf(y)!==-1&&!(u==="rel"&&l[u].toLowerCase()==="canonical")&&!(y==="rel"&&l[y].toLowerCase()==="stylesheet")&&(u=y),e.indexOf(m)!==-1&&(m==="innerHTML"||m==="cssText"||m==="itemprop")&&(u=m)}if(!u||!l[u])return!1;const d=l[u].toLowerCase();return i[u]||(i[u]={}),o[u]||(o[u]={}),i[u][d]?!1:(o[u][d]=!0,!0)}).reverse().forEach(l=>r.push(l));const a=Object.keys(o);for(let l=0;l<a.length;l+=1){const u=a[l],h={...i[u],...o[u]};i[u]=h}return r},[]).reverse()},vX=(n,e)=>{if(Array.isArray(n)&&n.length){for(let t=0;t<n.length;t+=1)if(n[t][e])return!0}return!1},yX=n=>({baseTag:mX(["href"],n),bodyAttributes:Zy("bodyAttributes",n),defer:Uc(n,Oc.DEFER),encode:Uc(n,Oc.ENCODE_SPECIAL_CHARACTERS),htmlAttributes:Zy("htmlAttributes",n),linkTags:of("link",["rel","href"],n),metaTags:of("meta",["name","charset","http-equiv","property","itemprop"],n),noscriptTags:of("noscript",["innerHTML"],n),onChangeClientState:pX(n),scriptTags:of("script",["src","innerHTML"],n),styleTags:of("style",["cssText"],n),title:dX(n),titleAttributes:Zy("titleAttributes",n),prioritizeSeoTags:vX(n,Oc.PRIORITIZE_SEO_TAGS)}),rD=n=>Array.isArray(n)?n.join(""):n,xX=(n,e)=>{const t=Object.keys(n);for(let i=0;i<t.length;i+=1)if(e[t[i]]&&e[t[i]].includes(n[t[i]]))return!0;return!1},qy=(n,e)=>Array.isArray(n)?n.reduce((t,i)=>(xX(i,e)?t.priority.push(i):t.default.push(i),t),{priority:[],default:[]}):{default:n,priority:[]},Rb=(n,e)=>({...n,[e]:void 0}),_X=["noscript","script","style"],rA=(n,e=!0)=>e===!1?String(n):String(n).replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;").replace(/'/g,"&#x27;"),sD=n=>Object.keys(n).reduce((e,t)=>{const i=typeof n[t]<"u"?`${t}="${n[t]}"`:`${t}`;return e?`${e} ${i}`:i},""),AX=(n,e,t,i)=>{const r=sD(t),s=rD(e);return r?`<${n} ${Nr}="true" ${r}>${rA(s,i)}</${n}>`:`<${n} ${Nr}="true">${rA(s,i)}</${n}>`},SX=(n,e,t=!0)=>e.reduce((i,r)=>{const s=r,o=Object.keys(s).filter(u=>!(u==="innerHTML"||u==="cssText")).reduce((u,h)=>{const d=typeof s[h]>"u"?h:`${h}="${rA(s[h],t)}"`;return u?`${u} ${d}`:d},""),a=s.innerHTML||s.cssText||"",l=_X.indexOf(n)===-1;return`${i}<${n} ${Nr}="true" ${o}${l?"/>":`>${a}</${n}>`}`},""),oD=(n,e={})=>Object.keys(n).reduce((t,i)=>{const r=T1[i];return t[r||i]=n[i],t},e),MX=(n,e,t)=>{const i={key:e,[Nr]:!0},r=oD(t,i);return[zt.createElement("title",r,e)]},Sm=(n,e)=>e.map((t,i)=>{const r={key:i,[Nr]:!0};return Object.keys(t).forEach(s=>{const a=T1[s]||s;if(a==="innerHTML"||a==="cssText"){const l=t.innerHTML||t.cssText;r.dangerouslySetInnerHTML={__html:l}}else r[a]=t[s]}),zt.createElement(n,r)}),hr=(n,e,t=!0)=>{switch(n){case"title":return{toComponent:()=>MX(n,e.title,e.titleAttributes),toString:()=>AX(n,e.title,e.titleAttributes,t)};case"bodyAttributes":case"htmlAttributes":return{toComponent:()=>oD(e),toString:()=>sD(e)};default:return{toComponent:()=>Sm(n,e),toString:()=>SX(n,e,t)}}},EX=({metaTags:n,linkTags:e,scriptTags:t,encode:i})=>{const r=qy(n,Qy.meta),s=qy(e,Qy.link),o=qy(t,Qy.script);return{priorityMethods:{toComponent:()=>[...Sm("meta",r.priority),...Sm("link",s.priority),...Sm("script",o.priority)],toString:()=>`${hr("meta",r.priority,i)} ${hr("link",s.priority,i)} ${hr("script",o.priority,i)}`},metaTags:r.default,linkTags:s.default,scriptTags:o.default}},wX=n=>{const{baseTag:e,bodyAttributes:t,encode:i=!0,htmlAttributes:r,noscriptTags:s,styleTags:o,title:a="",titleAttributes:l,prioritizeSeoTags:u}=n;let{linkTags:h,metaTags:d,scriptTags:p}=n,m={toComponent:()=>{},toString:()=>""};return u&&({priorityMethods:m,linkTags:h,metaTags:d,scriptTags:p}=EX(n)),{priority:m,base:hr("base",e,i),bodyAttributes:hr("bodyAttributes",t,i),htmlAttributes:hr("htmlAttributes",r,i),link:hr("link",h,i),meta:hr("meta",d,i),noscript:hr("noscript",s,i),script:hr("script",p,i),style:hr("style",o,i),title:hr("title",{title:a,titleAttributes:l},i)}},sA=wX,qp=[],aD=!!(typeof window<"u"&&window.document&&window.document.createElement),oA=class{constructor(n,e){Cs(this,"instances",[]);Cs(this,"canUseDOM",aD);Cs(this,"context");Cs(this,"value",{setHelmet:n=>{this.context.helmet=n},helmetInstances:{get:()=>this.canUseDOM?qp:this.instances,add:n=>{(this.canUseDOM?qp:this.instances).push(n)},remove:n=>{const e=(this.canUseDOM?qp:this.instances).indexOf(n);(this.canUseDOM?qp:this.instances).splice(e,1)}}});this.context=n,this.canUseDOM=e||!1,e||(n.helmet=sA({baseTag:[],bodyAttributes:{},encodeSpecialCharacters:!0,htmlAttributes:{},linkTags:[],metaTags:[],noscriptTags:[],scriptTags:[],styleTags:[],title:"",titleAttributes:{}}))}},TX={},lD=zt.createContext(TX),kc,cD=(kc=class extends J.Component{constructor(t){super(t);Cs(this,"helmetData");this.helmetData=new oA(this.props.context||{},kc.canUseDOM)}render(){return zt.createElement(lD.Provider,{value:this.helmetData.value},this.props.children)}},Cs(kc,"canUseDOM",aD),kc),tc=(n,e)=>{const t=document.head||document.querySelector("head"),i=t.querySelectorAll(`${n}[${Nr}]`),r=[].slice.call(i),s=[];let o;return e&&e.length&&e.forEach(a=>{const l=document.createElement(n);for(const u in a)if(Object.prototype.hasOwnProperty.call(a,u))if(u==="innerHTML")l.innerHTML=a.innerHTML;else if(u==="cssText")l.styleSheet?l.styleSheet.cssText=a.cssText:l.appendChild(document.createTextNode(a.cssText));else{const h=u,d=typeof a[h]>"u"?"":a[h];l.setAttribute(u,d)}l.setAttribute(Nr,"true"),r.some((u,h)=>(o=h,l.isEqualNode(u)))?r.splice(o,1):s.push(l)}),r.forEach(a=>{var l;return(l=a.parentNode)==null?void 0:l.removeChild(a)}),s.forEach(a=>t.appendChild(a)),{oldTags:r,newTags:s}},aA=(n,e)=>{const t=document.getElementsByTagName(n)[0];if(!t)return;const i=t.getAttribute(Nr),r=i?i.split(","):[],s=[...r],o=Object.keys(e);for(const a of o){const l=e[a]||"";t.getAttribute(a)!==l&&t.setAttribute(a,l),r.indexOf(a)===-1&&r.push(a);const u=s.indexOf(a);u!==-1&&s.splice(u,1)}for(let a=s.length-1;a>=0;a-=1)t.removeAttribute(s[a]);r.length===s.length?t.removeAttribute(Nr):t.getAttribute(Nr)!==o.join(",")&&t.setAttribute(Nr,o.join(","))},CX=(n,e)=>{typeof n<"u"&&document.title!==n&&(document.title=rD(n)),aA("title",e)},Pb=(n,e)=>{const{baseTag:t,bodyAttributes:i,htmlAttributes:r,linkTags:s,metaTags:o,noscriptTags:a,onChangeClientState:l,scriptTags:u,styleTags:h,title:d,titleAttributes:p}=n;aA("body",i),aA("html",r),CX(d,p);const m={baseTag:tc("base",t),linkTags:tc("link",s),metaTags:tc("meta",o),noscriptTags:tc("noscript",a),scriptTags:tc("script",u),styleTags:tc("style",h)},y={},M={};Object.keys(m).forEach(_=>{const{newTags:g,oldTags:x}=m[_];g.length&&(y[_]=g),x.length&&(M[_]=m[_].oldTags)}),e&&e(),l(n,y,M)},af=null,bX=n=>{af&&cancelAnimationFrame(af),n.defer?af=requestAnimationFrame(()=>{Pb(n,()=>{af=null})}):(Pb(n),af=null)},RX=bX,Bb=class extends J.Component{constructor(){super(...arguments);Cs(this,"rendered",!1)}shouldComponentUpdate(e){return!fX(e,this.props)}componentDidUpdate(){this.emitChange()}componentWillUnmount(){const{helmetInstances:e}=this.props.context;e.remove(this),this.emitChange()}emitChange(){const{helmetInstances:e,setHelmet:t}=this.props.context;let i=null;const r=yX(e.get().map(s=>{const o={...s.props};return delete o.context,o}));cD.canUseDOM?RX(r):sA&&(i=sA(r)),t(i)}init(){if(this.rendered)return;this.rendered=!0;const{helmetInstances:e}=this.props.context;e.add(this),this.emitChange()}render(){return this.init(),null}},$y,c0=($y=class extends J.Component{shouldComponentUpdate(n){return!aX(Rb(this.props,"helmetData"),Rb(n,"helmetData"))}mapNestedChildrenToProps(n,e){if(!e)return null;switch(n.type){case"script":case"noscript":return{innerHTML:e};case"style":return{cssText:e};default:throw new Error(`<${n.type} /> elements are self-closing and can not contain children. Refer to our API for more information.`)}}flattenArrayTypeChildren(n,e,t,i){return{...e,[n.type]:[...e[n.type]||[],{...t,...this.mapNestedChildrenToProps(n,i)}]}}mapObjectTypeChildren(n,e,t,i){switch(n.type){case"title":return{...e,[n.type]:i,titleAttributes:{...t}};case"body":return{...e,bodyAttributes:{...t}};case"html":return{...e,htmlAttributes:{...t}};default:return{...e,[n.type]:{...t}}}}mapArrayTypeChildrenToProps(n,e){let t={...e};return Object.keys(n).forEach(i=>{t={...t,[i]:n[i]}}),t}warnOnInvalidChildren(n,e){return Cb(bb.some(t=>n.type===t),typeof n.type=="function"?"You may be attempting to nest <Helmet> components within each other, which is not allowed. Refer to our API for more information.":`Only elements types ${bb.join(", ")} are allowed. Helmet does not support rendering <${n.type}> elements. Refer to our API for more information.`),Cb(!e||typeof e=="string"||Array.isArray(e)&&!e.some(t=>typeof t!="string"),`Helmet expects a string as a child of <${n.type}>. Did you forget to wrap your children in braces? ( <${n.type}>{\`\`}</${n.type}> ) Refer to our API for more information.`),!0}mapChildrenToProps(n,e){let t={};return zt.Children.forEach(n,i=>{if(!i||!i.props)return;const{children:r,...s}=i.props,o=Object.keys(s).reduce((l,u)=>(l[hX[u]||u]=s[u],l),{});let{type:a}=i;switch(typeof a=="symbol"?a=a.toString():this.warnOnInvalidChildren(i,r),a){case"Symbol(react.fragment)":e=this.mapChildrenToProps(r,e);break;case"link":case"meta":case"noscript":case"script":case"style":t=this.flattenArrayTypeChildren(i,t,o,r);break;default:e=this.mapObjectTypeChildren(i,e,o,r);break}}),this.mapArrayTypeChildrenToProps(t,e)}render(){const{children:n,...e}=this.props;let t={...e},{helmetData:i}=e;if(n&&(t=this.mapChildrenToProps(n,t)),i&&!(i instanceof oA)){const r=i;i=new oA(r.context,!0),delete t.helmetData}return i?zt.createElement(Bb,{...t,context:i.value}):zt.createElement(lD.Consumer,null,r=>zt.createElement(Bb,{...t,context:r}))}},Cs($y,"defaultProps",{defer:!0,encodeSpecialCharacters:!0,prioritizeSeoTags:!1}),$y);const PX=()=>se.jsxs($s.section,{variants:nD(),initial:"hidden",whileInView:"show",viewport:{once:!0,amount:.25},className:"max-w-[100rem] relative h-screen ipad-height:h-[60vh] md:h-[70vh] lg:h-[90vh] xl:h-[95vh] mx-auto",children:[se.jsxs(c0,{children:[se.jsx("meta",{name:"description",content:`Transform Your Business with Digital Bots Agency - Leaders in Web Design, AI Chatbots, \r
            and Business Process Automation. Boost Your Online Presence, Engage Customers 24/7, Streamline Operations, \r
            and Drive Positive Reviews. `}),se.jsx("link",{rel:"canonical",href:"/"})]}),se.jsxs("div",{className:`${mi.paddingX} bg-[#dbdbdb] h-max py-10 absolute w-full justify-center gap-y-10 flex flex-col md:flex-row top-2/3`,children:[se.jsx("div",{className:"w-full md:w-2/3",children:se.jsxs("h1",{className:"text-2xl sm:text-3xl lg:text-4xl xl:text-6xl font-black leading-none text-gray-900 uppercase text-left",children:["Unlock Growth with Cutting Edge",se.jsx("span",{className:"text-purple-600",children:" AI Solutions"})," and Tailored ",se.jsx("span",{className:"text-purple-600",children:" >"}),"Web Design"]})}),se.jsxs("div",{className:"w-full md:w-1/3 flex flex-wrap gap-1  lg:flex-nowrap justify-around md:justify-end",children:[se.jsx("a",{href:"#book",children:se.jsx("button",{className:"border-2 bg-purple-900 hover:bg-transparent transition-colors ease-in-out duration-150 hover:border-purple-900 hover:text-black-100 text-white px-5 py-2 xs:py-3 w-40 rounded-xl",children:"Let's Talk"})}),se.jsx("a",{href:"#services",children:se.jsx("button",{className:"border-2 border-purple-900 hover:bg-purple-900 hover:border-purple-900 hover:text-white px-5 py-2 xs:py-3 w-40 rounded-xl",children:"Our Services "})})]})]})]}),BX="/assets/backend-565fc01f.png",LX="/assets/mobile-896ef2f5.png",IX="/assets/web-0d05165f.png",DX="/assets/menu-242d80a8.svg",FX="/assets/close-ad0e0ca6.svg",NX="/assets/roy-ef48be93.png",OX="/assets/site1-b5cd7ee6.jpg",UX="/assets/site2-3f3f5fce.jpg",kX="/assets/site3-1ba7e28f.jpg",HX="/assets/site4-e1b87e4f.jpg",zX="/assets/site5-d2ee7936.jpg",GX="/assets/site6-90f726b0.jpg",VX="/assets/walter-0de0eba2.png",WX="/assets/dr-aafa9c20.jpg",Lb=[{id:"#",title:"Home"},{id:"#about",title:"About"},{id:"#work",title:"Work"},{id:"#contact",title:"Contact"}],jX=[{title:"Chatbot Development",icon:LX,points:["Deliver instant support and answer FAQs effortlessly.","Engage visitors 24/7 with interactive and personalized chatbots.","Integrate chatbots with existing systems to streamline operations."]},{title:"Website Development",icon:BX,points:["Captivate your audience with stunning and user-friendly websites.","Enjoy lightning-fast loading speeds for seamless browsing.","Boost online visibility and stand out from the competition."]},{title:"AI Automation",icon:IX,points:["Personalize customer experiences for lasting impressions.","Streamline tasks and boost productivity with AI-powered automation.","Implement AI algorithms to automate repetitive tasks"]}],XX=[{testimonial:"Digital Bots Agency worked really hard to make our online presence better, and it helped our business grow a lot.",name:"Amanda Jenkins",designation:"COO",company:"Navino",image:"https://img.freepik.com/free-photo/confident-african-businesswoman-smiling-closeup-portrait-jobs-career-campaign_53876-143280.jpg?size=626&ext=jpg&ga=GA1.2.1353295161.1681227691&semt=ais"},{testimonial:"Digital Bots Agency's dedication to our success transformed our online presence, leading to significant business growth",name:"Roy Zimanyiwa",designation:"CTO",company:"SalesDue",image:NX},{testimonial:"With Digital Bots Agency's optimization, our website traffic soared by 50%. Our gratitude to them is immense!",name:"Walter Kubiku",designation:"CEO",company:"Valtru Enterprises",image:VX},{testimonial:"Thanks to Digital Bots Agency's smart technology, more people are booking appointments at our medical center online",name:"Dr T.Masiyiwa",designation:"CEO",company:"Entumbane Medical Centre",image:WX}],JX=[{name:"Medical Centre",description:"Enhance patient engagement with a landing page designed for easy navigation and seamless appointment booking.",image:UX,live_app_link:"https://entumbane-medical-centre.web.app/"},{name:"Acute and Chronic Medical Centre",description:"Improve patient care with a user-friendly landing page designed to help ease access to essential information.",image:OX,live_app_link:"https://acute-and-chronic.vercel.app/"},{name:"Furniture Shop",description:"Showcase your furniture collection with a sleek landing page. Customers can explore modern designs, and shop with ease.",image:HX,live_app_link:"https://modern-home.vercel.app/"},{name:"Maize and Mingle Restaurant",description:"Attract more diners with a vibrant website for your restaurant. Simplify table reservations and ensure a delightful experience for your guests.",image:GX,live_app_link:"https://maizeandmingle.framer.website/"},{name:"Restaurant",description:" Boost your restaurant's online presence with a dynamic landing page. Customers can effortlessly book tables and explore the menu.",image:zX,live_app_link:"https://valtru-restaurant.web.app/"},{name:"Denim Store",description:" Elevate your store with a trendy website.Shoppers can browse the latest fashion trends, and enjoy a seamless shopping experience.",image:kX,live_app_link:"https://denim-store.vercel.app/"}],KX=()=>{const[n,e]=zt.useState("Home"),[t,i]=zt.useState(!0),[r,s]=zt.useState(!1);return zt.useEffect(()=>{function o(){window.scrollY>5?s(!0):s(!1)}return window.addEventListener("scroll",o),()=>window.removeEventListener("scroll",o)},[]),se.jsx("div",{children:se.jsx("nav",{className:`${mi.paddingX} w-full fixed z-20 top-0`,children:se.jsxs("div",{className:"max-w-[100rem] mx-auto flex items-center justify-between",children:[se.jsx(sO,{to:"/",className:"flex",onClick:()=>{e(""),window.scrollTo(0,0)},children:se.jsxs("div",{id:"logo",className:` ${r?" bg-white rounded-xl backdrop-blur-md backdrop-filter bg-opacity-20":""} flex  justify-center items-center  mt-2 px-2 `,children:[se.jsx("img",{src:"db-agency.png",alt:"logo",className:"w-14"}),se.jsxs("p",{className:"flex flex-row gap-1 text-white",children:[se.jsx("span",{className:"hidden xs:flex",children:"Digital Bots"})," Agency"]})]})}),se.jsx("ul",{className:"list-none hidden md:flex flex-row items-center gap-10 md:border-2 md:border-white md:p-1 md:rounded-xl",children:Lb.map(o=>se.jsx("li",{className:`${n===o.title?"text-secondary hover:text-secondary bg-white  rounded-lg":"text-white"} hover:text-secondary p-1 text-[18px] font-medium cursor-pointer`,onClick:()=>e(o.title),children:se.jsx("a",{href:`${o.id}`,children:o.title})},o.id))}),se.jsxs("div",{className:"md:hidden flex flex-1 justify-end transition delay-150 ease-in-out duration-75",children:[se.jsx("img",{src:t?DX:FX,alt:"menu",className:"cursor-pointer",onClick:()=>i(!t)}),se.jsx("div",{className:`${t?"hidden":"flex"} absolute black-gradient top-20 right-0 mx-10 my-5 p-6 max-w-[140px] rounded-2xl`,children:se.jsx("ul",{className:"list-none flex flex-col gap-3 ",children:Lb.map(o=>se.jsx("li",{className:`${n===o.title?"text-white":"text-secondary"} hover:text-white text-[18px] font-medium cursor-pointer`,onClick:()=>{e(o.title),i(!t)},children:se.jsx("a",{href:`${o.id}`,children:o.title})},o.id))})})]})]})})})},Vh=(n,e)=>function(){return se.jsxs($s.section,{variants:nD(),initial:"hidden",whileInView:"show",viewport:{once:!0,amount:.25},className:`${mi.padding} max-w-[100rem] mx-auto relative z-0`,children:[se.jsx("span",{className:"hash-span",id:e,children:" "}),se.jsx(n,{})]})},YX=()=>se.jsxs(se.Fragment,{children:[se.jsxs(c0,{children:[se.jsx("meta",{name:"description",content:`Discover Digital Bots Agency – Your trusted partner in transforming ideas into reality. \r
                  Learn about our journey, our passion for innovation, and how we help businesses thrive with our \r
                  expertise in web design, AI chatbots, and business process automation. Meet the dedicated team \r
                  led by Tawanda Mubatapasango, committed to delivering exceptional digital solutions tailored to your needs. `}),se.jsx("link",{rel:"canonical",href:"#about"})]}),se.jsxs($s.div,{variants:tD(),className:"mt-20 xss:mt-[0rem] lg:!mt-0 xl:!mt-20  ipad-height:-mt-[5rem]",children:[se.jsx("p",{className:`${mi.sectionSubText}`,children:"Introduction"}),se.jsx("h2",{className:`${mi.sectionHeadText}`,children:"Overview."}),se.jsxs($s.p,{variants:w1("","",.2,2),className:"text-secondary mt-4 leading-[30px] max-w-3xl xss:text-[15px] sm:text-[18px] text-justify",children:["At Digital Bots Agency, we are your trusted partner in AI development and web design, dedicated to transforming your ideas into reality. From initial concept to full-scale production, we support your journey with tailored solutions that drive measurable results. Our team excels at creating cutting-edge AI products that boost efficiency, enhance customer engagement, and fuel your business growth.",se.jsx("br",{}),se.jsx("br",{}),"Whether you're a startup looking to break into the market or an established enterprise aiming to innovate, we deliver solutions that align perfectly with your objectives. Our expertly crafted websites are designed to improve your online visibility, attract more customer bookings, and ensure a seamless digital presence that resonates with your target audience."]})]})]}),QX=Vh(YX,"about");var ZX=Object.defineProperty,qX=Object.defineProperties,$X=Object.getOwnPropertyDescriptors,Ib=Object.getOwnPropertySymbols,eJ=Object.prototype.hasOwnProperty,tJ=Object.prototype.propertyIsEnumerable,Db=(n,e,t)=>e in n?ZX(n,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):n[e]=t,lf=(n,e)=>{for(var t in e||(e={}))eJ.call(e,t)&&Db(n,t,e[t]);if(Ib)for(var t of Ib(e))tJ.call(e,t)&&Db(n,t,e[t]);return n},cf=(n,e)=>qX(n,$X(e)),uD=class extends J.Component{constructor(n){super(n),this.ref=zt.createRef(),this.state={style:{}};const e={reverse:!1,max:35,perspective:1e3,easing:"cubic-bezier(.03,.98,.52,.99)",scale:"1.1",speed:"1000",transition:!0,axis:null,reset:!0};this.width=null,this.height=null,this.left=null,this.top=null,this.transitionTimeout=null,this.updateCall=null,this.element=null,this.settings=Object.assign({},e,this.props.options),this.reverse=this.settings.reverse?-1:1,this.onMouseEnter=this.onMouseEnter.bind(this,this.props.onMouseEnter),this.onMouseMove=this.onMouseMove.bind(this,this.props.onMouseMove),this.onMouseLeave=this.onMouseLeave.bind(this,this.props.onMouseLeave)}componentDidMount(){this.element=this.ref.current,setTimeout(()=>{this.element.parentElement.querySelector(":hover")===this.element&&this.onMouseEnter()},0)}componentWillUnmount(){clearTimeout(this.transitionTimeout),cancelAnimationFrame(this.updateCall)}onMouseEnter(n=()=>{},e){return this.updateElementPosition(),this.setState(Object.assign({},this.state,{style:cf(lf({},this.state.style),{willChange:"transform"})})),this.setTransition(),n(e)}reset(){window.requestAnimationFrame(()=>{this.setState(Object.assign({},this.state,{style:cf(lf({},this.state.style),{transform:`perspective(${this.settings.perspective}px) rotateX(0deg) rotateY(0deg) scale3d(1, 1, 1)`})}))})}onMouseMove(n=()=>{},e){return e.persist(),this.updateCall!==null&&window.cancelAnimationFrame(this.updateCall),this.event=e,this.updateCall=requestAnimationFrame(this.update.bind(this,e)),n(e)}setTransition(){clearTimeout(this.transitionTimeout),this.setState(Object.assign({},this.state,{style:cf(lf({},this.state.style),{transition:`${this.settings.speed}ms ${this.settings.easing}`})})),this.transitionTimeout=setTimeout(()=>{this.setState(Object.assign({},this.state,{style:cf(lf({},this.state.style),{transition:""})}))},this.settings.speed)}onMouseLeave(n=()=>{},e){return this.setTransition(),this.settings.reset&&this.reset(),n(e)}getValues(n){const e=(n.nativeEvent.clientX-this.left)/this.width,t=(n.nativeEvent.clientY-this.top)/this.height,i=Math.min(Math.max(e,0),1),r=Math.min(Math.max(t,0),1),s=(this.reverse*(this.settings.max/2-i*this.settings.max)).toFixed(2),o=(this.reverse*(r*this.settings.max-this.settings.max/2)).toFixed(2),a=i*100,l=r*100;return{tiltX:s,tiltY:o,percentageX:a,percentageY:l}}updateElementPosition(){const n=this.element.getBoundingClientRect();this.width=this.element.offsetWidth,this.height=this.element.offsetHeight,this.left=n.left,this.top=n.top}update(n){const e=this.getValues(n);this.setState(Object.assign({},this.state,{style:cf(lf({},this.state.style),{transform:`perspective(${this.settings.perspective}px) rotateX(${this.settings.axis==="x"?0:e.tiltY}deg) rotateY(${this.settings.axis==="y"?0:e.tiltX}deg) scale3d(${this.settings.scale}, ${this.settings.scale}, ${this.settings.scale})`})})),this.updateCall=null}render(){const n=Object.assign({},this.props.style,this.state.style);return se.jsx("div",{style:n,ref:this.ref,className:this.props.className,onMouseEnter:this.onMouseEnter,onMouseMove:this.onMouseMove,onMouseLeave:this.onMouseLeave,children:this.props.children})}};const nJ=({index:n,image:e,name:t,description:i,live_app_link:r})=>se.jsx("div",{children:se.jsxs(uD,{options:{max:45,scale:1,speed:450},className:"bg-tertiary p-5 rounded-2xl sm:w-[300px] lg:w-[350px] w-full",children:[se.jsx("div",{className:"relative w-full h-[230px]",children:se.jsx("img",{src:e,alt:t,className:"w-full h-full object-cover rounded-2xl"})}),se.jsxs("div",{className:"mt-5",children:[se.jsxs("h3",{className:"text-white font-bold flex gap-1",children:[t," ",se.jsx("p",{className:"text-blue-600 after:content-['_↗']",onClick:()=>window.open(r,"_blank")})]}),se.jsx("p",{className:"mt-2 text-secondary text-[14px]",children:i})]})]})}),iJ=()=>{const n=JX.map((e,t)=>se.jsx(nJ,{index:t,...e},e.name));return se.jsxs(se.Fragment,{children:[se.jsxs(c0,{children:[se.jsx("meta",{name:"description",content:`Explore our portfolio of success stories at Digital Bots Agency. \r
          See how we've helped businesses across various industries enhance their digital presence, \r
          streamline operations, and engage customers with top-tier web design, AI chatbots, and automation solutions. \r
          View our featured projects and discover how we can bring your vision to life with innovative technology. `}),se.jsx("link",{rel:"canonical",href:"#work"})]}),se.jsxs("div",{children:[se.jsx("p",{className:mi.sectionSubText,children:"Our work"}),se.jsx("h2",{className:mi.sectionHeadText,children:"Projects."})]}),se.jsx("p",{className:"mt-3 leading-[30px] text-secondary xss:text-[15px] sm:text-[18px] max-w-3xl text-justify",children:"The following projects showcase our skills and experience through real-world examples. Each project is briefly described with links to live demonstrations. This reflects our ability to solve complex problems, work with different technologies and manage projects effectively."}),se.jsx("div",{className:"mt-20 flex flex-wrap gap-7",children:n})]})},rJ=Vh(iJ,"work"),sJ=({title:n,index:e,icon:t,points:i})=>{const r=i.map((s,o)=>se.jsx("ul",{className:"list-disc",children:se.jsx("li",{className:"xsss:text-[11px] xs:text-[15px] text-zinc-400 leading-relaxed",children:s})},o));return se.jsx(uD,{className:" sm:w-[300px] mdd:w-[340px] smm:w-[360px] lg:w-[400px] min-h-[180px] w-full",children:se.jsx($s.div,{variants:w1("right","spring",.75*e,.75),className:"w-full green-pink-gradient shadow-card p-[1px] rounded-[20px]",children:se.jsxs("div",{className:"bg-tertiary rounded-[20px] min-h-[250px] flex justify-center items-center flex-col px-12 py-5",children:[se.jsx("img",{src:t,alt:n,className:"w-16 h-16 object-contain"}),se.jsx("h3",{className:"text-white text-center text-[20px] mb-4",children:n}),r]})})})},oJ=()=>se.jsxs(se.Fragment,{children:[se.jsx("p",{id:"services",className:`${mi.sectionSubText}`,children:"What we offer"}),se.jsx("h2",{className:`${mi.sectionHeadText}`,children:"Services."}),se.jsx("div",{className:"mt-20 flex flex-wrap gap-10",children:jX.map((n,e)=>se.jsx(sJ,{index:e,...n},n.title))})]}),aJ=Vh(oJ,"services"),mh={_origin:"https://api.emailjs.com"},lJ=(n,e="https://api.emailjs.com")=>{mh._userID=n,mh._origin=e},fD=(n,e,t)=>{if(!n)throw"The public key is required. Visit https://dashboard.emailjs.com/admin/account";if(!e)throw"The service ID is required. Visit https://dashboard.emailjs.com/admin";if(!t)throw"The template ID is required. Visit https://dashboard.emailjs.com/admin/templates";return!0};class Fb{constructor(e){this.status=e?e.status:0,this.text=e?e.responseText:"Network Error"}}const hD=(n,e,t={})=>new Promise((i,r)=>{const s=new XMLHttpRequest;s.addEventListener("load",({target:o})=>{const a=new Fb(o);a.status===200||a.text==="OK"?i(a):r(a)}),s.addEventListener("error",({target:o})=>{r(new Fb(o))}),s.open("POST",mh._origin+n,!0),Object.keys(t).forEach(o=>{s.setRequestHeader(o,t[o])}),s.send(e)}),cJ=(n,e,t,i)=>{const r=i||mh._userID;return fD(r,n,e),hD("/api/v1.0/email/send",JSON.stringify({lib_version:"3.11.0",user_id:r,service_id:n,template_id:e,template_params:t}),{"Content-type":"application/json"})},uJ=n=>{let e;if(typeof n=="string"?e=document.querySelector(n):e=n,!e||e.nodeName!=="FORM")throw"The 3rd parameter is expected to be the HTML form element or the style selector of form";return e},fJ=(n,e,t,i)=>{const r=i||mh._userID,s=uJ(t);fD(r,n,e);const o=new FormData(s);return o.append("lib_version","3.11.0"),o.append("service_id",n),o.append("template_id",e),o.append("user_id",r),hD("/api/v1.0/email/send-form",o)},hJ={init:lJ,send:cJ,sendForm:fJ},dJ=()=>{const n=zt.useRef(),[e,t]=zt.useState({name:"",email:"",message:""}),[i,r]=zt.useState(!1);function s(a){const{name:l,value:u}=a.target;t(h=>({...h,[l]:u}))}function o(a){a.preventDefault(),r(!0),hJ.send("service_whec0nn","template_njuinwq",{from_name:e.name,to_name:"Tawanda Mubatapasango",from_email:e.email,to_email:"tawandamubatapasango@gmail.com",message:e.message},"YhjDP7r__yY-tjtoe").then(()=>{r(!1),alert("Thank you. l will get back to you as soon as possible."),t({name:"",email:"",message:""})},l=>{r(!1),console.log(l),alert("Something went wrong.")})}return se.jsxs("div",{className:"xl:mt-12 xl:flex-row flex-col-reverse flex gap-10 overflow-hidden",children:[se.jsxs($s.div,{variants:Tb("left","tween",.2,1),className:"flex-[0.75] bg-black-100 xsss:px-2 xsss:py-4 xss:px-6 sm:p-8  rounded-2xl",children:[se.jsx("p",{className:mi.sectionSubText,children:"Get in Touch"}),se.jsx("h3",{className:mi.sectionHeadText,children:"Contact."}),se.jsxs("form",{ref:n,onSubmit:o,className:"flex flex-col mt-12 gap-8 px-5 md:px-10",children:[se.jsxs("label",{className:"flex flex-col",children:[se.jsx("span",{className:"text-white font-medium mb-4",children:"Your Name"}),se.jsx("input",{name:"name",type:"text",value:e.name,onChange:s,placeholder:"What's your name",className:"indent-2 py-2 px-3 rounded-lg text-white text-[14px] bg-tertiary focus:outline-none"})]}),se.jsxs("label",{className:"flex flex-col",children:[se.jsx("span",{className:"text-white font-medium mb-4",children:"Your Email"}),se.jsx("input",{name:"email",type:"email",value:e.email,onChange:s,placeholder:"What's your email",className:"indent-2 py-2 px-3 rounded-lg text-white text-[14px] bg-tertiary focus:outline-none"})]}),se.jsxs("label",{className:"flex flex-col",children:[se.jsx("span",{className:"text-white font-medium mb-4",children:"Your Message"}),se.jsx("textarea",{rows:7,name:"message",value:e.message,onChange:s,placeholder:"How can l help?",className:"indent-2 py-2 px-3 rounded-lg text-white text-[14px] bg-tertiary focus:outline-none"})]}),se.jsx("button",{type:"submit",className:"bg-tertiary rounded-lg py-2 px-4 inset-2 cursor-pointer text-white focus:outline-none w-fit",children:i?"Sending...":"Send"})]})]}),se.jsx($s.div,{variants:Tb("right","tween",.2,1),className:"xl:flex-1 xl:h-auto md:h-[550px] h-[310px]",children:se.jsx(k9,{})})]})},pJ=Vh(dJ,"contact");var dD={color:void 0,size:void 0,className:void 0,style:void 0,attr:void 0},Nb=zt.createContext&&zt.createContext(dD),Vo=globalThis&&globalThis.__assign||function(){return Vo=Object.assign||function(n){for(var e,t=1,i=arguments.length;t<i;t++){e=arguments[t];for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(n[r]=e[r])}return n},Vo.apply(this,arguments)},mJ=globalThis&&globalThis.__rest||function(n,e){var t={};for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&e.indexOf(i)<0&&(t[i]=n[i]);if(n!=null&&typeof Object.getOwnPropertySymbols=="function")for(var r=0,i=Object.getOwnPropertySymbols(n);r<i.length;r++)e.indexOf(i[r])<0&&Object.prototype.propertyIsEnumerable.call(n,i[r])&&(t[i[r]]=n[i[r]]);return t};function pD(n){return n&&n.map(function(e,t){return zt.createElement(e.tag,Vo({key:t},e.attr),pD(e.child))})}function gJ(n){return function(e){return zt.createElement(vJ,Vo({attr:Vo({},n.attr)},e),pD(n.child))}}function vJ(n){var e=function(t){var i=n.attr,r=n.size,s=n.title,o=mJ(n,["attr","size","title"]),a=r||t.size||"1em",l;return t.className&&(l=t.className),n.className&&(l=(l?l+" ":"")+n.className),zt.createElement("svg",Vo({stroke:"currentColor",fill:"currentColor",strokeWidth:"0"},t.attr,i,o,{className:l,style:Vo(Vo({color:n.color||t.color},t.style),n.style),height:a,width:a,xmlns:"http://www.w3.org/2000/svg"}),s&&zt.createElement("title",null,s),n.children)};return Nb!==void 0?zt.createElement(Nb.Consumer,null,function(t){return e(t)}):e(dD)}function yJ(n){return gJ({tag:"svg",attr:{viewBox:"0 0 24 24"},child:[{tag:"path",attr:{d:"M4.58341 17.3211C3.55316 16.2275 3 15 3 13.0104C3 9.51092 5.45651 6.37372 9.03059 4.82324L9.92328 6.20085C6.58804 8.00545 5.93618 10.3461 5.67564 11.8221C6.21263 11.5444 6.91558 11.4467 7.60471 11.5106C9.40908 11.6778 10.8312 13.1591 10.8312 15C10.8312 16.933 9.26416 18.5 7.33116 18.5C6.2581 18.5 5.23196 18.0096 4.58341 17.3211ZM14.5834 17.3211C13.5532 16.2275 13 15 13 13.0104C13 9.51092 15.4565 6.37372 19.0306 4.82324L19.9233 6.20085C16.588 8.00545 15.9362 10.3461 15.6756 11.8221C16.2126 11.5444 16.9156 11.4467 17.6047 11.5106C19.4091 11.6778 20.8312 13.1591 20.8312 15C20.8312 16.933 19.2642 18.5 17.3312 18.5C16.2581 18.5 15.232 18.0096 14.5834 17.3211Z"}}]})(n)}const xJ=({index:n,testimonial:e,name:t,designation:i,company:r,image:s})=>se.jsxs($s.div,{variants:w1("","spring",n*.5,.75),className:"bg-black-200 p-10 rounded-3xl xs:w-[290px] w-full",children:[se.jsx("p",{className:"text-blue-500 text-[48px]",children:se.jsx(yJ,{})}),se.jsxs("div",{className:"mt-1",children:[se.jsx("p",{className:"text-white tracking-wider text-[16px]",children:e}),se.jsxs("div",{className:"flex justify-between items-center gap-1 mt-7",children:[se.jsxs("div",{className:"flex-1 flex flex-col",children:[se.jsxs("p",{className:"text-white font-medium text-[14px]",children:[se.jsx("span",{className:"blue-text-gradient",children:"@"})," ",t]}),se.jsxs("p",{className:"text-secondary mt-1 text-[12px]",children:[i," at ",r]})]}),se.jsx("img",{src:s,alt:`feedback by-${t}`,className:"w-12 h-12 rounded-full object-cover"})]})]})]}),_J=()=>se.jsxs("div",{className:"mt-12 bg-black-100 rounded-[20px]",children:[se.jsx("div",{className:`bg-tertiary rounded-2xl min-h-[300px] ${mi.padding}`,children:se.jsxs($s.div,{variants:tD(),children:[se.jsx("p",{className:mi.sectionSubText,children:"What others say"}),se.jsx("h2",{className:mi.sectionHeadText,children:"Testimonials."})]})}),se.jsx("div",{className:`${mi.paddingX} -mt-20 pb-14 flex flex-wrap gap-7`,children:XX.map((n,e)=>se.jsx(xJ,{index:e,...n},n.name))})]}),AJ=Vh(_J,"");function SJ(){return se.jsxs(nO,{children:[se.jsxs(c0,{children:[se.jsx("meta",{name:"description",content:`Elevate your digital presence with Digital Bots Agency's collaborative Web design  and development services. \r
        Engage customers around the clock with interactive AI chatbots and streamline operations through business process \r
        automation. Boost your reputation with more positive reviews. Transform your business with innovative solutions and \r
        seamless digital experiences. Contact us today!`}),se.jsx("link",{rel:"canonical",href:"/"})]}),se.jsxs("div",{className:"bg-primary relative",children:[se.jsxs("div",{className:"bg-hero-pattern bg-cover bg-no-repeat bg-center",children:[se.jsx(KX,{}),se.jsx(PX,{})]}),se.jsx(QX,{}),se.jsx(aJ,{}),se.jsx(rJ,{}),se.jsx(AJ,{}),se.jsxs("div",{className:"relative z-0",children:[se.jsx(pJ,{}),se.jsx(K9,{})]})]})]})}ex.createRoot(document.getElementById("root")).render(se.jsx(zt.StrictMode,{children:se.jsx(cD,{children:se.jsx(SJ,{})})}));
